From 8201c2c30953d7e5d6845f8cd9c625198574f156 Mon Sep 17 00:00:00 2001 From: Vincent Favre-Nicolin Date: Wed, 12 Aug 2026 22:47:49 +0200 Subject: [PATCH 01/21] Switch pyobjcryst to nanobind, directly including objcryst++ (submodule) and cctbx+newmat --- .gitignore | 5 + .gitmodules | 3 + CMakeLists.txt | 157 + MANIFEST.in | 25 +- SConstruct | 224 - cmake/version.cpp | 12 + cmake/version.h.in | 34 + extern/cctbx/COPYRIGHT_2_0.txt | 27 + .../cctbx/LICENSE_2_0.txt | 16 - extern/cctbx/cctbx/eltbx/basic.cpp | 53 + extern/cctbx/cctbx/eltbx/covalent_radii.cpp | 161 + extern/cctbx/cctbx/eltbx/fp_fdp.cpp | 34 + extern/cctbx/cctbx/eltbx/henke.cpp | 261 + .../cctbx/cctbx/eltbx/henke_tables_01_12.cpp | 6094 +++++++++++++++ .../cctbx/cctbx/eltbx/henke_tables_13_24.cpp | 6116 +++++++++++++++ .../cctbx/cctbx/eltbx/henke_tables_25_36.cpp | 6130 +++++++++++++++ .../cctbx/cctbx/eltbx/henke_tables_37_48.cpp | 6164 +++++++++++++++ .../cctbx/cctbx/eltbx/henke_tables_49_60.cpp | 6168 +++++++++++++++ .../cctbx/cctbx/eltbx/henke_tables_61_72.cpp | 6223 ++++++++++++++++ .../cctbx/cctbx/eltbx/henke_tables_73_84.cpp | 6246 ++++++++++++++++ .../cctbx/cctbx/eltbx/henke_tables_85_92.cpp | 4177 +++++++++++ extern/cctbx/cctbx/eltbx/icsd_radii.cpp | 531 ++ extern/cctbx/cctbx/eltbx/neutron.cpp | 256 + extern/cctbx/cctbx/eltbx/tiny_pse.cpp | 173 + extern/cctbx/cctbx/eltbx/wavelengths.cpp | 49 + .../cctbx/eltbx/xray_scattering/wk1995.cpp | 692 ++ extern/cctbx/cctbx/miller/index_generator.cpp | 128 + extern/cctbx/cctbx/miller/sym_equiv.cpp | 103 + extern/cctbx/cctbx/sgtbx/bricks.cpp | 871 +++ .../cctbx/cctbx/sgtbx/change_of_basis_op.cpp | 117 + extern/cctbx/cctbx/sgtbx/hall_in.cpp | 445 ++ extern/cctbx/cctbx/sgtbx/lattice_tr.cpp | 133 + extern/cctbx/cctbx/sgtbx/miller.cpp | 191 + .../cctbx/sgtbx/reciprocal_space_asu.cpp | 13 + .../cctbx/sgtbx/reciprocal_space_ref_asu.cpp | 243 + .../reference_settings/hall_symbol_table.cpp | 487 ++ .../matrix_group_code_table.cpp | 246 + .../sgtbx/reference_settings/normalizer.cpp | 360 + extern/cctbx/cctbx/sgtbx/rot_mx.cpp | 116 + extern/cctbx/cctbx/sgtbx/rot_mx_info.cpp | 59 + .../cctbx/cctbx/sgtbx/row_echelon_solve.cpp | 70 + extern/cctbx/cctbx/sgtbx/rt_mx.cpp | 379 + .../cctbx/cctbx/sgtbx/select_generators.cpp | 238 + extern/cctbx/cctbx/sgtbx/space_group.cpp | 759 ++ extern/cctbx/cctbx/sgtbx/space_group_type.cpp | 1025 +++ extern/cctbx/cctbx/sgtbx/symbols.cpp | 1256 ++++ extern/cctbx/cctbx/sgtbx/tr_group.cpp | 148 + extern/cctbx/cctbx/sgtbx/tr_vec.cpp | 72 + extern/cctbx/cctbx/sgtbx/utils.cpp | 42 + .../cctbx/cctbx/uctbx/spoil_optimization.cpp | 6 + extern/cctbx/cctbx/uctbx/uctbx.cpp | 558 ++ extern/cctbx/include/cctbx/coordinates.h | 189 + extern/cctbx/include/cctbx/eltbx/basic.h | 49 + .../include/cctbx/eltbx/covalent_radii.h | 86 + extern/cctbx/include/cctbx/eltbx/fp_fdp.h | 117 + extern/cctbx/include/cctbx/eltbx/henke.h | 131 + extern/cctbx/include/cctbx/eltbx/icsd_radii.h | 105 + extern/cctbx/include/cctbx/eltbx/neutron.h | 131 + extern/cctbx/include/cctbx/eltbx/tiny_pse.h | 92 + .../cctbx/include/cctbx/eltbx/wavelengths.h | 96 + .../include/cctbx/eltbx/xray_scattering.h | 353 + .../cctbx/eltbx/xray_scattering/form_factor.h | 88 + .../cctbx/eltbx/xray_scattering/gaussian.h | 61 + extern/cctbx/include/cctbx/error.h | 77 + .../cctbx/include/cctbx/hendrickson_lattman.h | 223 + extern/cctbx/include/cctbx/import_scitbx_af.h | 11 + .../cctbx/include/cctbx/math/loop_n_from_m.h | 67 + extern/cctbx/include/cctbx/miller.h | 134 + .../include/cctbx/miller/index_generator.h | 118 + extern/cctbx/include/cctbx/miller/sym_equiv.h | 350 + extern/cctbx/include/cctbx/sgtbx/basic.h | 58 + extern/cctbx/include/cctbx/sgtbx/brick.h | 120 + .../include/cctbx/sgtbx/change_of_basis_op.h | 339 + .../cctbx/include/cctbx/sgtbx/group_codes.h | 119 + extern/cctbx/include/cctbx/sgtbx/lattice_tr.h | 30 + extern/cctbx/include/cctbx/sgtbx/miller_ops.h | 34 + .../cctbx/include/cctbx/sgtbx/parse_string.h | 115 + extern/cctbx/include/cctbx/sgtbx/phase_info.h | 156 + .../cctbx/sgtbx/reciprocal_space_asu.h | 119 + .../sgtbx/reciprocal_space_reference_asu.h | 119 + .../include/cctbx/sgtbx/reference_settings.h | 100 + extern/cctbx/include/cctbx/sgtbx/rot_mx.h | 410 + .../cctbx/include/cctbx/sgtbx/rot_mx_info.h | 47 + .../include/cctbx/sgtbx/rotation_matrices.h | 54 + .../include/cctbx/sgtbx/row_echelon_solve.h | 22 + extern/cctbx/include/cctbx/sgtbx/rt_mx.h | 672 ++ .../include/cctbx/sgtbx/select_generators.h | 40 + .../include/cctbx/sgtbx/smith_normal_form.h | 32 + .../cctbx/include/cctbx/sgtbx/space_group.h | 793 ++ .../include/cctbx/sgtbx/space_group_type.h | 263 + extern/cctbx/include/cctbx/sgtbx/symbols.h | 360 + extern/cctbx/include/cctbx/sgtbx/tr_group.h | 73 + extern/cctbx/include/cctbx/sgtbx/tr_vec.h | 235 + extern/cctbx/include/cctbx/sgtbx/utils.h | 23 + extern/cctbx/include/cctbx/uctbx.h | 1240 ++++ .../cctbx/uctbx/fast_minimum_reduction.h | 400 + .../scitbx/array_family/accessors/c_grid.h | 247 + .../accessors/c_index_1d_calculator.h | 32 + .../scitbx/array_family/accessors/flex_grid.h | 401 + .../scitbx/array_family/accessors/mat_grid.h | 13 + .../scitbx/array_family/accessors/trivial.h | 28 + .../scitbx/array_family/array_adaptor.h | 38 + .../array_family/detail/auto_allocator.h | 20 + .../detail/generic_array_functors.h | 330 + .../detail/generic_array_operators.h | 379 + .../include/scitbx/array_family/detail/misc.h | 132 + .../array_family/detail/operator_functors.h | 227 + .../array_family/detail/push_back_etc.h | 205 + .../detail/reducing_boolean_mem_fun.h | 76 + .../scitbx/array_family/detail/ref_helpers.h | 90 + .../scitbx/array_family/detail/std_imports.h | 317 + .../scitbx/array_family/detail/tiny_helpers.h | 162 + .../cctbx/include/scitbx/array_family/error.h | 19 + .../cctbx/include/scitbx/array_family/loops.h | 112 + .../include/scitbx/array_family/memory.h | 105 + .../scitbx/array_family/misc_functions.h | 149 + .../array_family/operator_traits_builtin.h | 316 + .../cctbx/include/scitbx/array_family/ref.h | 515 ++ .../scitbx/array_family/ref_reductions.h | 521 ++ .../include/scitbx/array_family/shared.h | 133 + .../scitbx/array_family/shared_plain.h | 381 + .../cctbx/include/scitbx/array_family/small.h | 64 + .../scitbx/array_family/small_algebra.h | 1818 +++++ .../include/scitbx/array_family/small_plain.h | 153 + .../scitbx/array_family/small_reductions.h | 155 + .../cctbx/include/scitbx/array_family/tiny.h | 38 + .../scitbx/array_family/tiny_algebra.h | 1838 +++++ .../scitbx/array_family/tiny_mat_ref.h | 24 + .../include/scitbx/array_family/tiny_plain.h | 59 + .../scitbx/array_family/tiny_reductions.h | 155 + .../include/scitbx/array_family/tiny_types.h | 115 + .../include/scitbx/array_family/type_traits.h | 70 + extern/cctbx/include/scitbx/constants.h | 59 + extern/cctbx/include/scitbx/error.h | 79 + extern/cctbx/include/scitbx/error_utils.h | 169 + extern/cctbx/include/scitbx/mat3.h | 977 +++ .../cctbx/include/scitbx/math/approx_equal.h | 78 + extern/cctbx/include/scitbx/math/atanh.h | 21 + extern/cctbx/include/scitbx/math/bessel.h | 370 + .../cctbx/include/scitbx/math/compile_time.h | 26 + extern/cctbx/include/scitbx/math/erf.h | 60 + .../cctbx/include/scitbx/math/erf/constants.h | 79 + extern/cctbx/include/scitbx/math/erf/engine.h | 187 + .../cctbx/include/scitbx/math/gaussian/sum.h | 233 + .../cctbx/include/scitbx/math/gaussian/term.h | 105 + extern/cctbx/include/scitbx/math/gcd.h | 195 + extern/cctbx/include/scitbx/math/modulo.h | 43 + extern/cctbx/include/scitbx/math/traits.h | 20 + .../scitbx/math/unimodular_generator.h | 122 + extern/cctbx/include/scitbx/math/utils.h | 161 + extern/cctbx/include/scitbx/matrix/as_xyz.h | 81 + extern/cctbx/include/scitbx/matrix/multiply.h | 227 + .../cctbx/include/scitbx/matrix/row_echelon.h | 199 + extern/cctbx/include/scitbx/rational.h | 73 + .../include/scitbx/serialization/base_256.h | 402 + extern/cctbx/include/scitbx/sym_mat3.h | 845 +++ extern/cctbx/include/scitbx/type_holder.h | 10 + extern/cctbx/include/scitbx/vec3.h | 736 ++ extern/newmat/Makefile.in | 116 + extern/newmat/_newmat.dox | 29 + extern/newmat/_rbd_com.dox | 26 + extern/newmat/add_time.png | Bin 0 -> 15259 bytes extern/newmat/bandmat.cpp | 718 ++ extern/newmat/cholesky.cpp | 289 + extern/newmat/controlw.h | 56 + extern/newmat/evalue.cpp | 303 + extern/newmat/example.cpp | 346 + extern/newmat/example.txt | 123 + extern/newmat/fft.cpp | 480 ++ extern/newmat/garch.cpp | 198 + extern/newmat/garch.dat | 502 ++ extern/newmat/garch.txt | 45 + extern/newmat/hholder.cpp | 520 ++ extern/newmat/include.h | 362 + extern/newmat/jacobi.cpp | 130 + extern/newmat/myexcept.cpp | 496 ++ extern/newmat/myexcept.h | 448 ++ extern/newmat/newfft.cpp | 1065 +++ extern/newmat/newmat.h | 2253 ++++++ extern/newmat/newmat.lfl | 4 + extern/newmat/newmat1.cpp | 209 + extern/newmat/newmat2.cpp | 675 ++ extern/newmat/newmat3.cpp | 855 +++ extern/newmat/newmat4.cpp | 1387 ++++ extern/newmat/newmat5.cpp | 557 ++ extern/newmat/newmat6.cpp | 937 +++ extern/newmat/newmat7.cpp | 1053 +++ extern/newmat/newmat8.cpp | 833 +++ extern/newmat/newmat9.cpp | 82 + extern/newmat/newmatap.h | 272 + extern/newmat/newmatex.cpp | 325 + extern/newmat/newmatio.h | 67 + extern/newmat/newmatnl.cpp | 266 + extern/newmat/newmatnl.h | 327 + extern/newmat/newmatrc.h | 186 + extern/newmat/newmatrm.cpp | 221 + extern/newmat/newmatrm.h | 156 + extern/newmat/nl_ex.cpp | 125 + extern/newmat/nl_ex.txt | 42 + extern/newmat/nm11.htm | 5145 +++++++++++++ extern/newmat/nm_b55.mak | 234 + extern/newmat/nm_b56.mak | 234 + extern/newmat/nm_cc.mak | 217 + extern/newmat/nm_ex1.cpp | 63 + extern/newmat/nm_ex1.txt | 18 + extern/newmat/nm_ex2.cpp | 76 + extern/newmat/nm_ex2.txt | 45 + extern/newmat/nm_ex3.cpp | 103 + extern/newmat/nm_ex3.txt | 50 + extern/newmat/nm_gnu.mak | 212 + extern/newmat/nm_i10.mak | 211 + extern/newmat/nm_i8.mak | 211 + extern/newmat/nm_il8.mak | 212 + extern/newmat/nm_m6.mak | 211 + extern/newmat/nm_m8.mak | 211 + extern/newmat/nm_misc.cpp | 147 + extern/newmat/nm_ow.mak | 212 + extern/newmat/nm_targ.txt | 10 + extern/newmat/precisio.h | 266 + extern/newmat/rbd.css | 20 + extern/newmat/readme.txt | 12 + extern/newmat/sl_ex.cpp | 59 + extern/newmat/sl_ex.txt | 21 + extern/newmat/solution.cpp | 205 + extern/newmat/solution.h | 99 + extern/newmat/sort.cpp | 277 + extern/newmat/submat.cpp | 401 + extern/newmat/svd.cpp | 209 + extern/newmat/test_exc.cpp | 221 + extern/newmat/test_exc.txt | 210 + extern/newmat/tmt.cpp | 559 ++ extern/newmat/tmt.h | 100 + extern/newmat/tmt.txt | 6594 +++++++++++++++++ extern/newmat/tmt1.cpp | 292 + extern/newmat/tmt2.cpp | 314 + extern/newmat/tmt3.cpp | 168 + extern/newmat/tmt4.cpp | 253 + extern/newmat/tmt5.cpp | 135 + extern/newmat/tmt6.cpp | 163 + extern/newmat/tmt7.cpp | 299 + extern/newmat/tmt8.cpp | 298 + extern/newmat/tmt9.cpp | 293 + extern/newmat/tmta.cpp | 135 + extern/newmat/tmtb.cpp | 162 + extern/newmat/tmtc.cpp | 555 ++ extern/newmat/tmtd.cpp | 769 ++ extern/newmat/tmte.cpp | 513 ++ extern/newmat/tmtf.cpp | 430 ++ extern/newmat/tmtg.cpp | 163 + extern/newmat/tmth.cpp | 849 +++ extern/newmat/tmti.cpp | 240 + extern/newmat/tmtj.cpp | 159 + extern/newmat/tmtk.cpp | 208 + extern/newmat/tmtl.cpp | 206 + extern/newmat/tmtm.cpp | 279 + extern/objcryst | 1 + nanobind_migration_notes.md | 530 ++ pyproject.toml | 33 +- setup.py | 123 - src/extensions/SConscript | 52 - src/extensions/SConscript.configure | 91 - src/extensions/asymmetricunit_ext.cpp | 45 - src/extensions/atom_ext.cpp | 72 - src/extensions/crystal_ext.cpp | 431 -- .../diffractiondatasinglecrystal_ext.cpp | 199 - src/extensions/general_ext.cpp | 78 - src/extensions/globaloptim_ext.cpp | 220 - src/extensions/globalscatteringpower_ext.cpp | 40 - src/extensions/helpers.cpp | 133 - src/extensions/helpers.hpp | 158 - src/extensions/helpers_nb.hpp | 557 ++ src/extensions/indexing_ext.cpp | 445 -- src/extensions/io_ext.cpp | 96 - src/extensions/lsq_ext.cpp | 128 - src/extensions/molatom_ext.cpp | 95 - src/extensions/molbond_ext.cpp | 108 - src/extensions/molbondangle_ext.cpp | 115 - src/extensions/moldihedralangle_ext.cpp | 118 - src/extensions/molecule_ext.cpp | 863 --- src/extensions/nb_asymmetricunit.cpp | 27 + src/extensions/nb_atom.cpp | 85 + src/extensions/nb_crystal.cpp | 346 + .../nb_diffractiondatasinglecrystal.cpp | 124 + src/extensions/nb_general.cpp | 90 + src/extensions/nb_globaloptim.cpp | 168 + src/extensions/nb_globalscatteringpower.cpp | 34 + src/extensions/nb_indexing.cpp | 385 + src/extensions/nb_io.cpp | 69 + src/extensions/nb_lsq.cpp | 97 + src/extensions/nb_module.cpp | 136 + src/extensions/nb_molatom.cpp | 70 + src/extensions/nb_molbond.cpp | 53 + src/extensions/nb_molbondangle.cpp | 59 + src/extensions/nb_moldihedralangle.cpp | 63 + src/extensions/nb_molecule.cpp | 545 ++ src/extensions/nb_objregistry.cpp | 152 + src/extensions/nb_polyhedron.cpp | 126 + src/extensions/nb_powderpattern.cpp | 342 + src/extensions/nb_powderpatternbackground.cpp | 54 + src/extensions/nb_powderpatterncomponent.cpp | 56 + .../nb_powderpatterndiffraction.cpp | 89 + src/extensions/nb_quaternion.cpp | 54 + src/extensions/nb_radiation.cpp | 47 + src/extensions/nb_refinableobj.cpp | 297 + src/extensions/nb_refinableobjclock.cpp | 36 + src/extensions/nb_refinablepar.cpp | 123 + src/extensions/nb_reflectionprofile.cpp | 97 + src/extensions/nb_refobjopt.cpp | 37 + src/extensions/nb_refpartype.cpp | 27 + src/extensions/nb_restraint.cpp | 42 + src/extensions/nb_rigidgroup.cpp | 87 + src/extensions/nb_scatterer.cpp | 150 + src/extensions/nb_scatteringcomponent.cpp | 56 + src/extensions/nb_scatteringcomponentlist.cpp | 48 + src/extensions/nb_scatteringdata.cpp | 107 + src/extensions/nb_scatteringpower.cpp | 155 + src/extensions/nb_scatteringpoweratom.cpp | 116 + src/extensions/nb_scatteringpowersphere.cpp | 25 + src/extensions/nb_spacegroup.cpp | 110 + src/extensions/nb_stretchmode.cpp | 120 + src/extensions/nb_unitcell.cpp | 123 + src/extensions/nb_zatom.cpp | 33 + src/extensions/nb_zpolyhedron.cpp | 37 + src/extensions/nb_zscatterer.cpp | 81 + src/extensions/objregistry_ext.cpp | 208 - src/extensions/polyhedron_ext.cpp | 89 - src/extensions/powderpattern_ext.cpp | 401 - .../powderpatternbackground_ext.cpp | 95 - src/extensions/powderpatterncomponent_ext.cpp | 39 - .../powderpatterndiffraction_ext.cpp | 96 - src/extensions/pyobjcryst.cpp | 140 - src/extensions/pyobjcryst_numpy_setup.hpp | 29 - src/extensions/python_streambuf.hpp | 541 -- src/extensions/quaternion_ext.cpp | 114 - src/extensions/radiation_ext.cpp | 66 - src/extensions/refinableobj_ext.cpp | 598 -- src/extensions/refinableobjclock_ext.cpp | 103 - src/extensions/refinablepar_ext.cpp | 164 - src/extensions/reflectionprofile_ext.cpp | 169 - src/extensions/refobjopt_ext.cpp | 75 - src/extensions/refpartype_ext.cpp | 51 - src/extensions/registerconverters.cpp | 327 - src/extensions/restraint_ext.cpp | 102 - src/extensions/rigidgroup_ext.cpp | 49 - src/extensions/scatterer_ext.cpp | 276 - src/extensions/scatteringcomponent_ext.cpp | 62 - .../scatteringcomponentlist_ext.cpp | 92 - src/extensions/scatteringdata_ext.cpp | 172 - src/extensions/scatteringpower_ext.cpp | 295 - src/extensions/scatteringpoweratom_ext.cpp | 53 - src/extensions/scatteringpowersphere_ext.cpp | 49 - src/extensions/spacegroup_ext.cpp | 160 - src/extensions/stretchmode_ext.cpp | 275 - src/extensions/unitcell_ext.cpp | 201 - src/extensions/zatom_ext.cpp | 82 - src/extensions/zpolyhedron_ext.cpp | 68 - src/extensions/zscatterer_ext.cpp | 106 - tests/test_powderpattern.py | 130 +- tests/test_refinableobj.py | 43 + tests/test_scatterer.py | 124 + tests/test_single_crystal_data.py | 24 + tests/test_virtualbase_forwarding.py | 131 + 362 files changed, 129024 insertions(+), 9267 deletions(-) create mode 100644 .gitmodules create mode 100644 CMakeLists.txt delete mode 100644 SConstruct create mode 100644 cmake/version.cpp create mode 100644 cmake/version.h.in create mode 100644 extern/cctbx/COPYRIGHT_2_0.txt rename src/extensions/python_streambuf.cpp => extern/cctbx/LICENSE_2_0.txt (86%) create mode 100644 extern/cctbx/cctbx/eltbx/basic.cpp create mode 100644 extern/cctbx/cctbx/eltbx/covalent_radii.cpp create mode 100644 extern/cctbx/cctbx/eltbx/fp_fdp.cpp create mode 100644 extern/cctbx/cctbx/eltbx/henke.cpp create mode 100644 extern/cctbx/cctbx/eltbx/henke_tables_01_12.cpp create mode 100644 extern/cctbx/cctbx/eltbx/henke_tables_13_24.cpp create mode 100644 extern/cctbx/cctbx/eltbx/henke_tables_25_36.cpp create mode 100644 extern/cctbx/cctbx/eltbx/henke_tables_37_48.cpp create mode 100644 extern/cctbx/cctbx/eltbx/henke_tables_49_60.cpp create mode 100644 extern/cctbx/cctbx/eltbx/henke_tables_61_72.cpp create mode 100644 extern/cctbx/cctbx/eltbx/henke_tables_73_84.cpp create mode 100644 extern/cctbx/cctbx/eltbx/henke_tables_85_92.cpp create mode 100644 extern/cctbx/cctbx/eltbx/icsd_radii.cpp create mode 100644 extern/cctbx/cctbx/eltbx/neutron.cpp create mode 100644 extern/cctbx/cctbx/eltbx/tiny_pse.cpp create mode 100644 extern/cctbx/cctbx/eltbx/wavelengths.cpp create mode 100644 extern/cctbx/cctbx/eltbx/xray_scattering/wk1995.cpp create mode 100644 extern/cctbx/cctbx/miller/index_generator.cpp create mode 100644 extern/cctbx/cctbx/miller/sym_equiv.cpp create mode 100644 extern/cctbx/cctbx/sgtbx/bricks.cpp create mode 100644 extern/cctbx/cctbx/sgtbx/change_of_basis_op.cpp create mode 100644 extern/cctbx/cctbx/sgtbx/hall_in.cpp create mode 100644 extern/cctbx/cctbx/sgtbx/lattice_tr.cpp create mode 100644 extern/cctbx/cctbx/sgtbx/miller.cpp create mode 100644 extern/cctbx/cctbx/sgtbx/reciprocal_space_asu.cpp create mode 100644 extern/cctbx/cctbx/sgtbx/reciprocal_space_ref_asu.cpp create mode 100644 extern/cctbx/cctbx/sgtbx/reference_settings/hall_symbol_table.cpp create mode 100644 extern/cctbx/cctbx/sgtbx/reference_settings/matrix_group_code_table.cpp create mode 100644 extern/cctbx/cctbx/sgtbx/reference_settings/normalizer.cpp create mode 100644 extern/cctbx/cctbx/sgtbx/rot_mx.cpp create mode 100644 extern/cctbx/cctbx/sgtbx/rot_mx_info.cpp create mode 100644 extern/cctbx/cctbx/sgtbx/row_echelon_solve.cpp create mode 100644 extern/cctbx/cctbx/sgtbx/rt_mx.cpp create mode 100644 extern/cctbx/cctbx/sgtbx/select_generators.cpp create mode 100644 extern/cctbx/cctbx/sgtbx/space_group.cpp create mode 100644 extern/cctbx/cctbx/sgtbx/space_group_type.cpp create mode 100644 extern/cctbx/cctbx/sgtbx/symbols.cpp create mode 100644 extern/cctbx/cctbx/sgtbx/tr_group.cpp create mode 100644 extern/cctbx/cctbx/sgtbx/tr_vec.cpp create mode 100644 extern/cctbx/cctbx/sgtbx/utils.cpp create mode 100644 extern/cctbx/cctbx/uctbx/spoil_optimization.cpp create mode 100644 extern/cctbx/cctbx/uctbx/uctbx.cpp create mode 100644 extern/cctbx/include/cctbx/coordinates.h create mode 100644 extern/cctbx/include/cctbx/eltbx/basic.h create mode 100644 extern/cctbx/include/cctbx/eltbx/covalent_radii.h create mode 100644 extern/cctbx/include/cctbx/eltbx/fp_fdp.h create mode 100644 extern/cctbx/include/cctbx/eltbx/henke.h create mode 100644 extern/cctbx/include/cctbx/eltbx/icsd_radii.h create mode 100644 extern/cctbx/include/cctbx/eltbx/neutron.h create mode 100644 extern/cctbx/include/cctbx/eltbx/tiny_pse.h create mode 100644 extern/cctbx/include/cctbx/eltbx/wavelengths.h create mode 100644 extern/cctbx/include/cctbx/eltbx/xray_scattering.h create mode 100644 extern/cctbx/include/cctbx/eltbx/xray_scattering/form_factor.h create mode 100644 extern/cctbx/include/cctbx/eltbx/xray_scattering/gaussian.h create mode 100644 extern/cctbx/include/cctbx/error.h create mode 100644 extern/cctbx/include/cctbx/hendrickson_lattman.h create mode 100644 extern/cctbx/include/cctbx/import_scitbx_af.h create mode 100644 extern/cctbx/include/cctbx/math/loop_n_from_m.h create mode 100644 extern/cctbx/include/cctbx/miller.h create mode 100644 extern/cctbx/include/cctbx/miller/index_generator.h create mode 100644 extern/cctbx/include/cctbx/miller/sym_equiv.h create mode 100644 extern/cctbx/include/cctbx/sgtbx/basic.h create mode 100644 extern/cctbx/include/cctbx/sgtbx/brick.h create mode 100644 extern/cctbx/include/cctbx/sgtbx/change_of_basis_op.h create mode 100644 extern/cctbx/include/cctbx/sgtbx/group_codes.h create mode 100644 extern/cctbx/include/cctbx/sgtbx/lattice_tr.h create mode 100644 extern/cctbx/include/cctbx/sgtbx/miller_ops.h create mode 100644 extern/cctbx/include/cctbx/sgtbx/parse_string.h create mode 100644 extern/cctbx/include/cctbx/sgtbx/phase_info.h create mode 100644 extern/cctbx/include/cctbx/sgtbx/reciprocal_space_asu.h create mode 100644 extern/cctbx/include/cctbx/sgtbx/reciprocal_space_reference_asu.h create mode 100644 extern/cctbx/include/cctbx/sgtbx/reference_settings.h create mode 100644 extern/cctbx/include/cctbx/sgtbx/rot_mx.h create mode 100644 extern/cctbx/include/cctbx/sgtbx/rot_mx_info.h create mode 100644 extern/cctbx/include/cctbx/sgtbx/rotation_matrices.h create mode 100644 extern/cctbx/include/cctbx/sgtbx/row_echelon_solve.h create mode 100644 extern/cctbx/include/cctbx/sgtbx/rt_mx.h create mode 100644 extern/cctbx/include/cctbx/sgtbx/select_generators.h create mode 100644 extern/cctbx/include/cctbx/sgtbx/smith_normal_form.h create mode 100644 extern/cctbx/include/cctbx/sgtbx/space_group.h create mode 100644 extern/cctbx/include/cctbx/sgtbx/space_group_type.h create mode 100644 extern/cctbx/include/cctbx/sgtbx/symbols.h create mode 100644 extern/cctbx/include/cctbx/sgtbx/tr_group.h create mode 100644 extern/cctbx/include/cctbx/sgtbx/tr_vec.h create mode 100644 extern/cctbx/include/cctbx/sgtbx/utils.h create mode 100644 extern/cctbx/include/cctbx/uctbx.h create mode 100644 extern/cctbx/include/cctbx/uctbx/fast_minimum_reduction.h create mode 100644 extern/cctbx/include/scitbx/array_family/accessors/c_grid.h create mode 100644 extern/cctbx/include/scitbx/array_family/accessors/c_index_1d_calculator.h create mode 100644 extern/cctbx/include/scitbx/array_family/accessors/flex_grid.h create mode 100644 extern/cctbx/include/scitbx/array_family/accessors/mat_grid.h create mode 100644 extern/cctbx/include/scitbx/array_family/accessors/trivial.h create mode 100644 extern/cctbx/include/scitbx/array_family/array_adaptor.h create mode 100644 extern/cctbx/include/scitbx/array_family/detail/auto_allocator.h create mode 100644 extern/cctbx/include/scitbx/array_family/detail/generic_array_functors.h create mode 100644 extern/cctbx/include/scitbx/array_family/detail/generic_array_operators.h create mode 100644 extern/cctbx/include/scitbx/array_family/detail/misc.h create mode 100644 extern/cctbx/include/scitbx/array_family/detail/operator_functors.h create mode 100644 extern/cctbx/include/scitbx/array_family/detail/push_back_etc.h create mode 100644 extern/cctbx/include/scitbx/array_family/detail/reducing_boolean_mem_fun.h create mode 100644 extern/cctbx/include/scitbx/array_family/detail/ref_helpers.h create mode 100644 extern/cctbx/include/scitbx/array_family/detail/std_imports.h create mode 100644 extern/cctbx/include/scitbx/array_family/detail/tiny_helpers.h create mode 100644 extern/cctbx/include/scitbx/array_family/error.h create mode 100644 extern/cctbx/include/scitbx/array_family/loops.h create mode 100644 extern/cctbx/include/scitbx/array_family/memory.h create mode 100644 extern/cctbx/include/scitbx/array_family/misc_functions.h create mode 100644 extern/cctbx/include/scitbx/array_family/operator_traits_builtin.h create mode 100644 extern/cctbx/include/scitbx/array_family/ref.h create mode 100644 extern/cctbx/include/scitbx/array_family/ref_reductions.h create mode 100644 extern/cctbx/include/scitbx/array_family/shared.h create mode 100644 extern/cctbx/include/scitbx/array_family/shared_plain.h create mode 100644 extern/cctbx/include/scitbx/array_family/small.h create mode 100644 extern/cctbx/include/scitbx/array_family/small_algebra.h create mode 100644 extern/cctbx/include/scitbx/array_family/small_plain.h create mode 100644 extern/cctbx/include/scitbx/array_family/small_reductions.h create mode 100644 extern/cctbx/include/scitbx/array_family/tiny.h create mode 100644 extern/cctbx/include/scitbx/array_family/tiny_algebra.h create mode 100644 extern/cctbx/include/scitbx/array_family/tiny_mat_ref.h create mode 100644 extern/cctbx/include/scitbx/array_family/tiny_plain.h create mode 100644 extern/cctbx/include/scitbx/array_family/tiny_reductions.h create mode 100644 extern/cctbx/include/scitbx/array_family/tiny_types.h create mode 100644 extern/cctbx/include/scitbx/array_family/type_traits.h create mode 100644 extern/cctbx/include/scitbx/constants.h create mode 100644 extern/cctbx/include/scitbx/error.h create mode 100644 extern/cctbx/include/scitbx/error_utils.h create mode 100644 extern/cctbx/include/scitbx/mat3.h create mode 100644 extern/cctbx/include/scitbx/math/approx_equal.h create mode 100644 extern/cctbx/include/scitbx/math/atanh.h create mode 100644 extern/cctbx/include/scitbx/math/bessel.h create mode 100644 extern/cctbx/include/scitbx/math/compile_time.h create mode 100644 extern/cctbx/include/scitbx/math/erf.h create mode 100644 extern/cctbx/include/scitbx/math/erf/constants.h create mode 100644 extern/cctbx/include/scitbx/math/erf/engine.h create mode 100644 extern/cctbx/include/scitbx/math/gaussian/sum.h create mode 100644 extern/cctbx/include/scitbx/math/gaussian/term.h create mode 100644 extern/cctbx/include/scitbx/math/gcd.h create mode 100644 extern/cctbx/include/scitbx/math/modulo.h create mode 100644 extern/cctbx/include/scitbx/math/traits.h create mode 100644 extern/cctbx/include/scitbx/math/unimodular_generator.h create mode 100644 extern/cctbx/include/scitbx/math/utils.h create mode 100644 extern/cctbx/include/scitbx/matrix/as_xyz.h create mode 100644 extern/cctbx/include/scitbx/matrix/multiply.h create mode 100644 extern/cctbx/include/scitbx/matrix/row_echelon.h create mode 100644 extern/cctbx/include/scitbx/rational.h create mode 100644 extern/cctbx/include/scitbx/serialization/base_256.h create mode 100644 extern/cctbx/include/scitbx/sym_mat3.h create mode 100644 extern/cctbx/include/scitbx/type_holder.h create mode 100644 extern/cctbx/include/scitbx/vec3.h create mode 100644 extern/newmat/Makefile.in create mode 100644 extern/newmat/_newmat.dox create mode 100644 extern/newmat/_rbd_com.dox create mode 100644 extern/newmat/add_time.png create mode 100644 extern/newmat/bandmat.cpp create mode 100644 extern/newmat/cholesky.cpp create mode 100644 extern/newmat/controlw.h create mode 100644 extern/newmat/evalue.cpp create mode 100644 extern/newmat/example.cpp create mode 100644 extern/newmat/example.txt create mode 100644 extern/newmat/fft.cpp create mode 100644 extern/newmat/garch.cpp create mode 100644 extern/newmat/garch.dat create mode 100644 extern/newmat/garch.txt create mode 100644 extern/newmat/hholder.cpp create mode 100644 extern/newmat/include.h create mode 100644 extern/newmat/jacobi.cpp create mode 100644 extern/newmat/myexcept.cpp create mode 100644 extern/newmat/myexcept.h create mode 100644 extern/newmat/newfft.cpp create mode 100644 extern/newmat/newmat.h create mode 100644 extern/newmat/newmat.lfl create mode 100644 extern/newmat/newmat1.cpp create mode 100644 extern/newmat/newmat2.cpp create mode 100644 extern/newmat/newmat3.cpp create mode 100644 extern/newmat/newmat4.cpp create mode 100644 extern/newmat/newmat5.cpp create mode 100644 extern/newmat/newmat6.cpp create mode 100644 extern/newmat/newmat7.cpp create mode 100644 extern/newmat/newmat8.cpp create mode 100644 extern/newmat/newmat9.cpp create mode 100644 extern/newmat/newmatap.h create mode 100644 extern/newmat/newmatex.cpp create mode 100644 extern/newmat/newmatio.h create mode 100644 extern/newmat/newmatnl.cpp create mode 100644 extern/newmat/newmatnl.h create mode 100644 extern/newmat/newmatrc.h create mode 100644 extern/newmat/newmatrm.cpp create mode 100644 extern/newmat/newmatrm.h create mode 100644 extern/newmat/nl_ex.cpp create mode 100644 extern/newmat/nl_ex.txt create mode 100644 extern/newmat/nm11.htm create mode 100644 extern/newmat/nm_b55.mak create mode 100644 extern/newmat/nm_b56.mak create mode 100644 extern/newmat/nm_cc.mak create mode 100644 extern/newmat/nm_ex1.cpp create mode 100644 extern/newmat/nm_ex1.txt create mode 100644 extern/newmat/nm_ex2.cpp create mode 100644 extern/newmat/nm_ex2.txt create mode 100644 extern/newmat/nm_ex3.cpp create mode 100644 extern/newmat/nm_ex3.txt create mode 100644 extern/newmat/nm_gnu.mak create mode 100644 extern/newmat/nm_i10.mak create mode 100644 extern/newmat/nm_i8.mak create mode 100644 extern/newmat/nm_il8.mak create mode 100644 extern/newmat/nm_m6.mak create mode 100644 extern/newmat/nm_m8.mak create mode 100644 extern/newmat/nm_misc.cpp create mode 100644 extern/newmat/nm_ow.mak create mode 100644 extern/newmat/nm_targ.txt create mode 100644 extern/newmat/precisio.h create mode 100644 extern/newmat/rbd.css create mode 100644 extern/newmat/readme.txt create mode 100644 extern/newmat/sl_ex.cpp create mode 100644 extern/newmat/sl_ex.txt create mode 100644 extern/newmat/solution.cpp create mode 100644 extern/newmat/solution.h create mode 100644 extern/newmat/sort.cpp create mode 100644 extern/newmat/submat.cpp create mode 100644 extern/newmat/svd.cpp create mode 100644 extern/newmat/test_exc.cpp create mode 100644 extern/newmat/test_exc.txt create mode 100644 extern/newmat/tmt.cpp create mode 100644 extern/newmat/tmt.h create mode 100644 extern/newmat/tmt.txt create mode 100644 extern/newmat/tmt1.cpp create mode 100644 extern/newmat/tmt2.cpp create mode 100644 extern/newmat/tmt3.cpp create mode 100644 extern/newmat/tmt4.cpp create mode 100644 extern/newmat/tmt5.cpp create mode 100644 extern/newmat/tmt6.cpp create mode 100644 extern/newmat/tmt7.cpp create mode 100644 extern/newmat/tmt8.cpp create mode 100644 extern/newmat/tmt9.cpp create mode 100644 extern/newmat/tmta.cpp create mode 100644 extern/newmat/tmtb.cpp create mode 100644 extern/newmat/tmtc.cpp create mode 100644 extern/newmat/tmtd.cpp create mode 100644 extern/newmat/tmte.cpp create mode 100644 extern/newmat/tmtf.cpp create mode 100644 extern/newmat/tmtg.cpp create mode 100644 extern/newmat/tmth.cpp create mode 100644 extern/newmat/tmti.cpp create mode 100644 extern/newmat/tmtj.cpp create mode 100644 extern/newmat/tmtk.cpp create mode 100644 extern/newmat/tmtl.cpp create mode 100644 extern/newmat/tmtm.cpp create mode 160000 extern/objcryst create mode 100644 nanobind_migration_notes.md delete mode 100644 setup.py delete mode 100644 src/extensions/SConscript delete mode 100644 src/extensions/SConscript.configure delete mode 100644 src/extensions/asymmetricunit_ext.cpp delete mode 100644 src/extensions/atom_ext.cpp delete mode 100644 src/extensions/crystal_ext.cpp delete mode 100644 src/extensions/diffractiondatasinglecrystal_ext.cpp delete mode 100644 src/extensions/general_ext.cpp delete mode 100644 src/extensions/globaloptim_ext.cpp delete mode 100644 src/extensions/globalscatteringpower_ext.cpp delete mode 100644 src/extensions/helpers.cpp delete mode 100644 src/extensions/helpers.hpp create mode 100644 src/extensions/helpers_nb.hpp delete mode 100644 src/extensions/indexing_ext.cpp delete mode 100644 src/extensions/io_ext.cpp delete mode 100644 src/extensions/lsq_ext.cpp delete mode 100644 src/extensions/molatom_ext.cpp delete mode 100644 src/extensions/molbond_ext.cpp delete mode 100644 src/extensions/molbondangle_ext.cpp delete mode 100644 src/extensions/moldihedralangle_ext.cpp delete mode 100644 src/extensions/molecule_ext.cpp create mode 100644 src/extensions/nb_asymmetricunit.cpp create mode 100644 src/extensions/nb_atom.cpp create mode 100644 src/extensions/nb_crystal.cpp create mode 100644 src/extensions/nb_diffractiondatasinglecrystal.cpp create mode 100644 src/extensions/nb_general.cpp create mode 100644 src/extensions/nb_globaloptim.cpp create mode 100644 src/extensions/nb_globalscatteringpower.cpp create mode 100644 src/extensions/nb_indexing.cpp create mode 100644 src/extensions/nb_io.cpp create mode 100644 src/extensions/nb_lsq.cpp create mode 100644 src/extensions/nb_module.cpp create mode 100644 src/extensions/nb_molatom.cpp create mode 100644 src/extensions/nb_molbond.cpp create mode 100644 src/extensions/nb_molbondangle.cpp create mode 100644 src/extensions/nb_moldihedralangle.cpp create mode 100644 src/extensions/nb_molecule.cpp create mode 100644 src/extensions/nb_objregistry.cpp create mode 100644 src/extensions/nb_polyhedron.cpp create mode 100644 src/extensions/nb_powderpattern.cpp create mode 100644 src/extensions/nb_powderpatternbackground.cpp create mode 100644 src/extensions/nb_powderpatterncomponent.cpp create mode 100644 src/extensions/nb_powderpatterndiffraction.cpp create mode 100644 src/extensions/nb_quaternion.cpp create mode 100644 src/extensions/nb_radiation.cpp create mode 100644 src/extensions/nb_refinableobj.cpp create mode 100644 src/extensions/nb_refinableobjclock.cpp create mode 100644 src/extensions/nb_refinablepar.cpp create mode 100644 src/extensions/nb_reflectionprofile.cpp create mode 100644 src/extensions/nb_refobjopt.cpp create mode 100644 src/extensions/nb_refpartype.cpp create mode 100644 src/extensions/nb_restraint.cpp create mode 100644 src/extensions/nb_rigidgroup.cpp create mode 100644 src/extensions/nb_scatterer.cpp create mode 100644 src/extensions/nb_scatteringcomponent.cpp create mode 100644 src/extensions/nb_scatteringcomponentlist.cpp create mode 100644 src/extensions/nb_scatteringdata.cpp create mode 100644 src/extensions/nb_scatteringpower.cpp create mode 100644 src/extensions/nb_scatteringpoweratom.cpp create mode 100644 src/extensions/nb_scatteringpowersphere.cpp create mode 100644 src/extensions/nb_spacegroup.cpp create mode 100644 src/extensions/nb_stretchmode.cpp create mode 100644 src/extensions/nb_unitcell.cpp create mode 100644 src/extensions/nb_zatom.cpp create mode 100644 src/extensions/nb_zpolyhedron.cpp create mode 100644 src/extensions/nb_zscatterer.cpp delete mode 100644 src/extensions/objregistry_ext.cpp delete mode 100644 src/extensions/polyhedron_ext.cpp delete mode 100644 src/extensions/powderpattern_ext.cpp delete mode 100644 src/extensions/powderpatternbackground_ext.cpp delete mode 100644 src/extensions/powderpatterncomponent_ext.cpp delete mode 100644 src/extensions/powderpatterndiffraction_ext.cpp delete mode 100644 src/extensions/pyobjcryst.cpp delete mode 100644 src/extensions/pyobjcryst_numpy_setup.hpp delete mode 100644 src/extensions/python_streambuf.hpp delete mode 100644 src/extensions/quaternion_ext.cpp delete mode 100644 src/extensions/radiation_ext.cpp delete mode 100644 src/extensions/refinableobj_ext.cpp delete mode 100644 src/extensions/refinableobjclock_ext.cpp delete mode 100644 src/extensions/refinablepar_ext.cpp delete mode 100644 src/extensions/reflectionprofile_ext.cpp delete mode 100644 src/extensions/refobjopt_ext.cpp delete mode 100644 src/extensions/refpartype_ext.cpp delete mode 100644 src/extensions/registerconverters.cpp delete mode 100644 src/extensions/restraint_ext.cpp delete mode 100644 src/extensions/rigidgroup_ext.cpp delete mode 100644 src/extensions/scatterer_ext.cpp delete mode 100644 src/extensions/scatteringcomponent_ext.cpp delete mode 100644 src/extensions/scatteringcomponentlist_ext.cpp delete mode 100644 src/extensions/scatteringdata_ext.cpp delete mode 100644 src/extensions/scatteringpower_ext.cpp delete mode 100644 src/extensions/scatteringpoweratom_ext.cpp delete mode 100644 src/extensions/scatteringpowersphere_ext.cpp delete mode 100644 src/extensions/spacegroup_ext.cpp delete mode 100644 src/extensions/stretchmode_ext.cpp delete mode 100644 src/extensions/unitcell_ext.cpp delete mode 100644 src/extensions/zatom_ext.cpp delete mode 100644 src/extensions/zpolyhedron_ext.cpp delete mode 100644 src/extensions/zscatterer_ext.cpp create mode 100644 tests/test_scatterer.py create mode 100644 tests/test_virtualbase_forwarding.py diff --git a/.gitignore b/.gitignore index e384938d..24c49bd7 100644 --- a/.gitignore +++ b/.gitignore @@ -128,3 +128,8 @@ target/ # source distribution tarball libdiffpy-*.tar.gz + +# ObjCryst run-log autosave files (MonteCarloObj/LSQ XML dumps), produced +# any time an example notebook/script runs an optimization. +ObjCryst*.xml +*-Run#*-Cost-*.xml diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000..314a711b --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "extern/objcryst"] + path = extern/objcryst + url = https://github.com/vincefn/objcryst.git diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..f1be3e7b --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,157 @@ +cmake_minimum_required(VERSION 3.15) + +project(pyobjcryst CXX) + +# Require C++17 globally +set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + +# --------------------------------------------------------------------------- +# Python / nanobind +# --------------------------------------------------------------------------- +find_package(Python 3.11 REQUIRED COMPONENTS Interpreter Development.Module NumPy) + +execute_process( + COMMAND "${Python_EXECUTABLE}" -c "import nanobind; print(nanobind.cmake_dir())" + OUTPUT_VARIABLE NB_CMAKE_DIR + OUTPUT_STRIP_TRAILING_WHITESPACE +) +list(APPEND CMAKE_PREFIX_PATH "${NB_CMAKE_DIR}") +find_package(nanobind CONFIG REQUIRED) + +# --------------------------------------------------------------------------- +# Boost (header-only: format, rational, date_time used by ObjCryst sources) +# --------------------------------------------------------------------------- +find_package(Boost REQUIRED) + +# --------------------------------------------------------------------------- +# External source paths +# --------------------------------------------------------------------------- +set(OBJCRYST_SRC "${CMAKE_CURRENT_SOURCE_DIR}/extern/objcryst/ObjCryst") +set(NEWMAT_SRC "${CMAKE_CURRENT_SOURCE_DIR}/extern/newmat") +set(CCTBX_SRC "${CMAKE_CURRENT_SOURCE_DIR}/extern/cctbx") + +# --------------------------------------------------------------------------- +# Generate version.h so that ObjCryst sources can be compiled standalone +# --------------------------------------------------------------------------- +set(PYOBJCRYST_EMBED_VERSION_MAJOR 2024) +set(PYOBJCRYST_EMBED_VERSION_MINOR 1) +set(PYOBJCRYST_EMBED_VERSION_MICRO 0) +set(PYOBJCRYST_EMBED_VERSION_PATCH 3) +# Build integer: MAJOR*1e9 + MINOR*1e6 + MICRO*1e3 + PATCH +math(EXPR PYOBJCRYST_EMBED_VERSION + "${PYOBJCRYST_EMBED_VERSION_MAJOR} * 1000000000 + \ + ${PYOBJCRYST_EMBED_VERSION_MINOR} * 1000000 + \ + ${PYOBJCRYST_EMBED_VERSION_MICRO} * 1000 + \ + ${PYOBJCRYST_EMBED_VERSION_PATCH}") + +configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.h.in" + "${CMAKE_CURRENT_BINARY_DIR}/include/ObjCryst/version.h" + @ONLY +) + +# --------------------------------------------------------------------------- +# newmat static library +# --------------------------------------------------------------------------- +set(NEWMAT_SOURCES + ${NEWMAT_SRC}/bandmat.cpp + ${NEWMAT_SRC}/evalue.cpp + ${NEWMAT_SRC}/myexcept.cpp + ${NEWMAT_SRC}/newmat1.cpp + ${NEWMAT_SRC}/newmat2.cpp + ${NEWMAT_SRC}/newmat3.cpp + ${NEWMAT_SRC}/newmat4.cpp + ${NEWMAT_SRC}/newmat5.cpp + ${NEWMAT_SRC}/newmat6.cpp + ${NEWMAT_SRC}/newmat7.cpp + ${NEWMAT_SRC}/newmat8.cpp + ${NEWMAT_SRC}/newmat9.cpp + ${NEWMAT_SRC}/newmatex.cpp + ${NEWMAT_SRC}/sort.cpp + ${NEWMAT_SRC}/submat.cpp +) + +add_library(newmat STATIC ${NEWMAT_SOURCES}) +target_include_directories(newmat PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/extern") +set_property(TARGET newmat PROPERTY POSITION_INDEPENDENT_CODE ON) + +# --------------------------------------------------------------------------- +# cctbx static library +# --------------------------------------------------------------------------- +file(GLOB_RECURSE CCTBX_SOURCES + "${CCTBX_SRC}/cctbx/eltbx/*.cpp" + "${CCTBX_SRC}/cctbx/sgtbx/*.cpp" + "${CCTBX_SRC}/cctbx/miller/*.cpp" + "${CCTBX_SRC}/cctbx/uctbx/*.cpp" +) + +add_library(cctbx STATIC ${CCTBX_SOURCES}) +target_include_directories(cctbx PUBLIC + "${CCTBX_SRC}/include" + "${Python_ROOT_DIR}/include" +) +# Add conda/system boost headers if available +if(DEFINED ENV{CONDA_PREFIX}) + target_include_directories(cctbx PUBLIC "$ENV{CONDA_PREFIX}/include") +endif() +set_property(TARGET cctbx PROPERTY POSITION_INDEPENDENT_CODE ON) + +# --------------------------------------------------------------------------- +# ObjCryst++ static library +# --------------------------------------------------------------------------- +file(GLOB OBJCRYST_SOURCES + "${OBJCRYST_SRC}/ObjCryst/*.cpp" + "${OBJCRYST_SRC}/RefinableObj/*.cpp" + "${OBJCRYST_SRC}/CrystVector/*.cpp" + "${OBJCRYST_SRC}/Quirks/VFNDebug.cpp" + "${OBJCRYST_SRC}/Quirks/VFNStreamFormat.cpp" + "${OBJCRYST_SRC}/Quirks/ci_string.cpp" +) +list(APPEND OBJCRYST_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.cpp") + +add_library(ObjCryst STATIC ${OBJCRYST_SOURCES}) + +target_include_directories(ObjCryst PUBLIC + "${CMAKE_CURRENT_SOURCE_DIR}/extern/objcryst" + "${CCTBX_SRC}/include" + "${CMAKE_CURRENT_SOURCE_DIR}/extern" + "${CMAKE_CURRENT_BINARY_DIR}/include" + ${Boost_INCLUDE_DIRS} +) +set_property(TARGET ObjCryst PROPERTY POSITION_INDEPENDENT_CODE ON) +target_compile_definitions(ObjCryst PUBLIC + REAL=double + BOOST_ERROR_CODE_HEADER_ONLY + $<$:__DEBUG__> +) +target_link_libraries(ObjCryst PUBLIC cctbx newmat) + +# Put VFNDebug.cpp first so debug-level constants are defined before use +set_source_files_properties( + "${OBJCRYST_SRC}/Quirks/VFNDebug.cpp" + PROPERTIES COMPILE_FLAGS "-O0" +) + +# --------------------------------------------------------------------------- +# nanobind extension: _pyobjcryst +# --------------------------------------------------------------------------- +file(GLOB NB_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/extensions/*.cpp") + +nanobind_add_module(_pyobjcryst STABLE_ABI NB_STATIC ${NB_SOURCES}) + +target_include_directories(_pyobjcryst PRIVATE + "${CMAKE_CURRENT_SOURCE_DIR}/extern/objcryst" + "${CCTBX_SRC}/include" + "${CMAKE_CURRENT_SOURCE_DIR}/extern" + "${CMAKE_CURRENT_BINARY_DIR}/include" + ${Boost_INCLUDE_DIRS} + ${Python_NumPy_INCLUDE_DIRS} + "${CMAKE_CURRENT_SOURCE_DIR}/src/extensions" +) + +target_link_libraries(_pyobjcryst PRIVATE ObjCryst) + +# Install into pyobjcryst package +install(TARGETS _pyobjcryst LIBRARY DESTINATION pyobjcryst) diff --git a/MANIFEST.in b/MANIFEST.in index 00d47e0f..5c93a06c 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,14 +1,15 @@ -graft src -graft tests -graft requirements +recursive-include src * +include AUTHORS.txt LICENSE*.txt README.rst +recursive-exclude src *.pyc *.so +global-exclude .gitattributes .gitignore .gitarchive.cfg +global-exclude .DS_Store -include AUTHORS.rst LICENSE*.rst README.rst +# Avoid user content in setup.cfg to make distribution reproducible. +exclude setup.cfg -# Exclude all bytecode files and __pycache__ directories -global-exclude *.py[cod] # Exclude all .pyc, .pyo, and .pyd files. -global-exclude *.so # Exclude shared object files. -global-exclude .DS_Store # Exclude Mac filesystem artifacts. -global-exclude __pycache__ # Exclude Python cache directories. -global-exclude .git* # Exclude git files and directories. -global-exclude .idea # Exclude PyCharm project settings. -global-exclude SConscript.configure SConscript # SCons build scripts +# Exclude git-tracked files spuriously added by setuptools_scm +exclude .coveragerc +exclude .travis* +prune conda-recipe +prune devutils +prune doc diff --git a/SConstruct b/SConstruct deleted file mode 100644 index fd66c232..00000000 --- a/SConstruct +++ /dev/null @@ -1,224 +0,0 @@ -# This SConstruct is for faster parallel builds. -# Use "setup.py" for normal installation. - -MY_SCONS_HELP = """\ -SCons rules for compiling and installing pyobjcryst. - -Compile and install the pyobjcryst Python extension. -For faster builds, run with parallel jobs, e.g.: - scons -j4 - -Usage: - scons [target] [var=value] - -Targets: - (default) Build the Python extension module `_pyobjcryst.so` (or `.pyd` on Windows) - dev install extension module into `src/pyobjcryst/` (development mode) - test Run pytest on the package with the installed extension - -Build configuration variables: -%s -Variables can be also assigned in a user script sconsvars.py. -SCons construction environment can be customized in sconscript.local script. -""" - -import os -from os.path import join as pjoin -import re -import sys - - -def subdictionary(d, keyset): - return dict(kv for kv in d.items() if kv[0] in keyset) - - -def getsyspaths(*names): - pall = sum((os.environ.get(n, '').split(os.pathsep) for n in names), []) - rv = [p for p in pall if os.path.exists(p)] - return rv - -def ftpyflag(flags): - # Figure out compilation switches, filter away fancy flags. - pattern = re.compile(r'^(-g|-Wstrict-prototypes|-O\d|-fPIC)$') - return [f for f in flags if not (isinstance(f, str) and pattern.match(f))] - -# copy system environment variables related to compilation -DefaultEnvironment(ENV=subdictionary(os.environ, ''' - PATH PYTHONPATH GIT_DIR HOMEPATH HOMEDRIVE - CPATH CPLUS_INCLUDE_PATH LIBRARY_PATH LD_RUN_PATH - LD_LIBRARY_PATH DYLD_LIBRARY_PATH DYLD_FALLBACK_LIBRARY_PATH - MACOSX_DEPLOYMENT_TARGET LANG - _PYTHON_SYSCONFIGDATA_NAME - _CONDA_PYTHON_SYSCONFIGDATA_NAME - CONDA_PREFIX - '''.split()) - ) - -# Create construction environment -env = DefaultEnvironment().Clone() - -# Variables definitions below work only with 0.98 or later. -env.EnsureSConsVersion(0, 98) - -# Customizable compile variables -vars = Variables('sconsvars.py') - -# Customizable build variables -vars.Add(EnumVariable( - 'build', - 'compiler settings', - 'fast', allowed_values=('debug', 'fast'))) -vars.Add(EnumVariable( - 'tool', - 'C++ compiler toolkit to be used', - 'default', allowed_values=('default', 'intelc'))) -vars.Add(BoolVariable( - 'profile', - 'build with profiling information', False)) -vars.Add( - 'arch', - 'target CPU passed to -march in the \'fast\' build, e.g. \'native\' for local ' - 'builds or \'x86-64-v3\' for a portable AVX2 deployment. Empty means no -march. ' - 'Defaults to the OBJCRYST_ARCH environment variable if set.', - os.environ.get('OBJCRYST_ARCH', '')) -vars.Update(env) - -# Use C++ compiler specified by the 'tool' option. -if env['tool'] == 'intelc': - icpc = env.WhereIs('icpc') - if not icpc: - print("Cannot find the Intel C/C++ compiler 'icpc'.") - Exit(1) - env.Tool('intelc', topdir=icpc[:icpc.rfind('/bin')]) - env=env.Clone() -# Default use scons auto found compiler - -# Get prefixes, make sure current interpreter is in conda env so thus is the target. -if 'PREFIX' in os.environ: - default_prefix = os.environ['PREFIX'] -elif 'CONDA_PREFIX' in os.environ: - default_prefix = os.environ['CONDA_PREFIX'] -else: - print("Environment variable PREFIX or CONDA_PREFIX must be set." - " Activate conda environment.") - Exit(1) - -vars.Add(PathVariable( - 'prefix', - 'installation prefix directory', - default_prefix)) -vars.Update(env) - -# Set paths -if env['PLATFORM'] == "win32": - include_path = pjoin(env['prefix'], 'Library', 'include') - lib_path = pjoin(env['prefix'], 'Library', 'lib') - shared_path = pjoin(env['prefix'], 'Library', 'share') - - env.AppendUnique(CPPPATH=[ pjoin(env['prefix'], 'include') ]) # for python headers - env.AppendUnique(LIBPATH=[ pjoin(env['prefix'], 'libs') ]) # for python libs - - env['ENV']['TMP'] = os.environ.get('TMP', env['ENV'].get('TMP', '')) -else: - include_path = pjoin(env['prefix'], 'include') - lib_path = pjoin(env['prefix'], 'lib') - shared_path = pjoin(env['prefix'], 'share') - -vars.Add(PathVariable( - 'includedir', - 'installation directory for C++ header files', - include_path, - PathVariable.PathAccept)) -vars.Add(PathVariable( - 'libdir', - 'installation directory for compiled programs', - lib_path, - PathVariable.PathAccept)) -vars.Add(PathVariable( - 'datadir', - 'installation directory for architecture independent data', - shared_path, - PathVariable.PathAccept)) -vars.Update(env) - -env.AppendUnique(CPPPATH=[include_path]) -env.AppendUnique(LIBPATH=[lib_path]) - -env.Help(MY_SCONS_HELP % vars.GenerateHelpText(env)) - -# Determine python-config script name. -pyversion = os.environ.get('PY_VER') or f"{sys.version_info.major}.{sys.version_info.minor}" -if env['PLATFORM'] != 'win32': - pythonconfig = pjoin(env['prefix'], 'bin', f'python{pyversion}-config') - xpython = pjoin(env['prefix'], 'bin', 'python') -else: - # use sysconfig on Windows - pythonconfig = None - xpython = pjoin(env['prefix'], 'python.exe') -print(f"Using python-config: {pythonconfig} from {xpython}") - - -common_cppdefs = ['REAL=double', 'BOOST_ERROR_CODE_HEADER_ONLY'] -env.AppendUnique(CPPDEFINES=common_cppdefs) - -if env['PLATFORM'] == 'win32': - env.AppendUnique(CPPDEFINES=['BOOST_ALL_NO_LIB']) - env.AppendUnique(CCFLAGS=['/EHsc', '/MD']) - - if env['build'] == 'debug': - env.Append(CCFLAGS=['/Zi', '/Od', '/FS']) - env.Append(LINKFLAGS=['/DEBUG']) - - elif env['build'] == 'fast': - env.Append(CCFLAGS=['/Ox', '/GL']) - env.Append(LINKFLAGS=['/LTCG', '/OPT:REF', '/OPT:ICF']) - -else: - # get python flags from python-config script - # not using sysconfig here because of parsing issues - env.ParseConfig(f"{pythonconfig} --cflags") - env.Replace(CCFLAGS=ftpyflag(env['CCFLAGS'])) - - env.PrependUnique(CCFLAGS=['-Wextra']) - env.PrependUnique(CXXFLAGS=['-std=c++11']) - - if env['tool'] == 'intelc': - # options for Intel C++ compiler on hpc dev-intel07 - env.AppendUnique(CCFLAGS=['-w1', '-fp-model', 'precise']) - env.PrependUnique(LIBS=['imf']) - fast_opts = ['-fast', '-no-ipo'] - else: - env.AppendUnique(CCFLAGS=['-fno-strict-aliasing']) - fast_opts = ['-ffast-math'] - if env.get('arch'): - fast_opts.append('-march=' + env['arch']) - - if env['PLATFORM'] == 'darwin': - # macOS bundle - sh = [f for f in env['SHLINKFLAGS'] if f != '-dynamiclib'] - env.Replace(SHLINKFLAGS=sh + ['-bundle', '-undefined', 'dynamic_lookup']) - fast_link = [] # no strip on macOS bundles - else: - fast_link = ['-s'] - - if env['build'] == 'debug': - # Python has NDEBUG defined in release builds. - cppdefs = env.get('CPPDEFINES', []) - env.Replace(CPPDEFINES=[d for d in cppdefs if d != 'NDEBUG']) - - env.Append(CCFLAGS=['-g', '-O0']) - - elif env['build'] == 'fast': - env.Append(CCFLAGS=['-O3'] + fast_opts) - env.Append(LINKFLAGS=fast_link) - -builddir = env.Dir('build/%s-%s' % (env['build'], env['PLATFORM'])) - -Export('env', 'pyversion') - -if os.path.isfile('sconscript.local'): - env.SConscript('sconscript.local') - -env.SConscript('src/extensions/SConscript', variant_dir=builddir) - -# vim: ft=python diff --git a/cmake/version.cpp b/cmake/version.cpp new file mode 100644 index 00000000..2f0f2a2f --- /dev/null +++ b/cmake/version.cpp @@ -0,0 +1,12 @@ +// Auto-generated definitions for libobjcryst_version_info static members. +#include "ObjCryst/version.h" + +const long long libobjcryst_version_info::version = LIBOBJCRYST_VERSION; +const char* libobjcryst_version_info::version_str = LIBOBJCRYST_VERSION_STR; +const int libobjcryst_version_info::major = LIBOBJCRYST_VERSION_MAJOR; +const int libobjcryst_version_info::minor = LIBOBJCRYST_VERSION_MINOR; +const int libobjcryst_version_info::micro = LIBOBJCRYST_VERSION_MICRO; +const int libobjcryst_version_info::patch = LIBOBJCRYST_VERSION_PATCH; +const char* libobjcryst_version_info::date = LIBOBJCRYST_VERSION_DATE; +const char* libobjcryst_version_info::git_commit = LIBOBJCRYST_GIT_COMMIT; +const char* libobjcryst_version_info::git_sha = LIBOBJCRYST_GIT_COMMIT; diff --git a/cmake/version.h.in b/cmake/version.h.in new file mode 100644 index 00000000..43cec258 --- /dev/null +++ b/cmake/version.h.in @@ -0,0 +1,34 @@ +// Auto-generated by CMake for pyobjcryst embedded build. +// This provides the libobjcryst_version_info struct for standalone compilation. + +#ifndef LIBOBJCRYST_VERSION_HPP_INCLUDED +#define LIBOBJCRYST_VERSION_HPP_INCLUDED + +#define LIBOBJCRYST_VERSION_MAJOR @PYOBJCRYST_EMBED_VERSION_MAJOR@ +#define LIBOBJCRYST_VERSION_MINOR @PYOBJCRYST_EMBED_VERSION_MINOR@ +#define LIBOBJCRYST_VERSION_MICRO @PYOBJCRYST_EMBED_VERSION_MICRO@ +#define LIBOBJCRYST_VERSION_PATCH @PYOBJCRYST_EMBED_VERSION_PATCH@ + +#define LIBOBJCRYST_VERSION @PYOBJCRYST_EMBED_VERSION@LL + +#define LIBOBJCRYST_VERSION_STR "@PYOBJCRYST_EMBED_VERSION_MAJOR@.@PYOBJCRYST_EMBED_VERSION_MINOR@" + +#define LIBOBJCRYST_VERSION_DATE "embedded" + +#define LIBOBJCRYST_GIT_COMMIT "d40d537b642abc0211ccd071e459c7ccb3495c3d" + +#define LIBOBJCRYST_GIT_SHA LIBOBJCRYST_GIT_COMMIT + +struct libobjcryst_version_info { + static const long long version; + static const char* version_str; + static const int major; + static const int minor; + static const int micro; + static const int patch; + static const char* date; + static const char* git_commit; + static const char* git_sha; +}; + +#endif // LIBOBJCRYST_VERSION_HPP_INCLUDED diff --git a/extern/cctbx/COPYRIGHT_2_0.txt b/extern/cctbx/COPYRIGHT_2_0.txt new file mode 100644 index 00000000..f88692cd --- /dev/null +++ b/extern/cctbx/COPYRIGHT_2_0.txt @@ -0,0 +1,27 @@ +*** Copyright Notice *** + +cctbx Copyright (c) 2006, The Regents of the University of +California, through Lawrence Berkeley National Laboratory (subject to +receipt of any required approvals from the U.S. Dept. of Energy). All +rights reserved. + +If you have questions about your rights to use or distribute this +software, please contact Berkeley Lab's Technology Transfer Department +at TTD@lbl.gov referring to "cctbx (LBNL Ref CR-1726)" + +This software package includes code written by others which may be +governed by separate license agreements. Please refer to the associated +licenses for further details. + +NOTICE. This software was developed under funding from the U.S. +Department of Energy. As such, the U.S. Government has been granted for +itself and others acting on its behalf a paid-up, nonexclusive, +irrevocable, worldwide license in the Software to reproduce, prepare +derivative works, and perform publicly and display publicly. Beginning +five (5) years after the date permission to assert copyright is obtained +from the U.S. Department of Energy, and subject to any subsequent five +(5) year renewals, the U.S. Government is granted for itself and others +acting on its behalf a paid-up, nonexclusive, irrevocable, worldwide +license in the Software to reproduce, prepare derivative works, +distribute copies to the public, perform publicly and display publicly, +and to permit others to do so. diff --git a/src/extensions/python_streambuf.cpp b/extern/cctbx/LICENSE_2_0.txt similarity index 86% rename from src/extensions/python_streambuf.cpp rename to extern/cctbx/LICENSE_2_0.txt index 2a6c3904..51ef4c52 100644 --- a/src/extensions/python_streambuf.cpp +++ b/extern/cctbx/LICENSE_2_0.txt @@ -1,4 +1,3 @@ -/****************************************************************************** *** License agreement *** cctbx Copyright (c) 2006, The Regents of the University of @@ -43,18 +42,3 @@ the following license: a non-exclusive, royalty-free perpetual license to install, use, modify, prepare derivative works, incorporate into other computer software, distribute, and sublicense such enhancements or derivative works thereof, in binary and source code form. - -******************************************************************************/ - - -#include "python_streambuf.hpp" - -namespace boost_adaptbx { -namespace python { - -// Initialize the static class variable. - -std::size_t streambuf::default_buffer_size = 1024; - -} // python -} // namespace boost_adaptbx diff --git a/extern/cctbx/cctbx/eltbx/basic.cpp b/extern/cctbx/cctbx/eltbx/basic.cpp new file mode 100644 index 00000000..803d3176 --- /dev/null +++ b/extern/cctbx/cctbx/eltbx/basic.cpp @@ -0,0 +1,53 @@ +#include +#include +#include + +namespace cctbx { namespace eltbx { namespace basic { + + std::string strip_label(std::string const& label, bool exact) + { + std::string result; + std::string::const_iterator l; + for (l = label.begin(); l != label.end(); l++) { + if (!isspace(*l)) break; + } + char digit = '\0'; + for (; l != label.end(); l++) { + if (isspace(*l)) { + break; + } + if (isdigit(*l)) { + if (digit != '\0') break; + digit = *l; + } + else if (*l == '+' || *l == '-') { + if (digit == '\0') + digit = '1'; + result += digit; + result += *l++; + break; + } + else if (digit != '\0') { + break; + } + else { + result += toupper(*l); + } + } + if (exact && l != label.end() && !isspace(*l)) { + return ""; + } + return result; + } + + int match_labels(std::string const& work_label, const char* tab_label) + { + int i; + for (i = 0; i < work_label.size() && tab_label[i]; i++) + if (work_label[i] != toupper(tab_label[i])) break; + if (i == work_label.size() && tab_label[i] == '\0') return -i; + if (i == 1 && isalpha(tab_label[1])) return 0; + return i; + } + +}}} // namespace cctbx::eltbx::basic diff --git a/extern/cctbx/cctbx/eltbx/covalent_radii.cpp b/extern/cctbx/cctbx/eltbx/covalent_radii.cpp new file mode 100644 index 00000000..0fd4ece5 --- /dev/null +++ b/extern/cctbx/cctbx/eltbx/covalent_radii.cpp @@ -0,0 +1,161 @@ +#include +#include + +namespace cctbx { namespace eltbx { namespace covalent_radii { + +namespace detail { +namespace { + +/*! Table of covalent radii + + Reference: + Beatriz Cordero, Verónica Gómez, Ana E. Platero-Prats, Marc Revés, + Jorge Echeverría, Eduard Cremades, Flavia Barragán and Santiago Alvarez. + Covalent radii revisited. Dalton Trans., 2008, 2832-2838, + doi:10.1039/b801115j +*/ + const raw_record table[] = { +// BEGIN_COMPILED_IN_REFERENCE_DATA + {"H", 0.31, 0.05}, + {"D", 0.31, 0.05}, + {"He", 0.28, 0.00}, + {"Li", 1.28, 0.07}, + {"Be", 0.96, 0.03}, + {"B", 0.84, 0.03}, + {"C", 0.76, 0.01}, /* sp3 value */ + {"N", 0.71, 0.01}, + {"O", 0.66, 0.02}, + {"F", 0.57, 0.03}, + {"Ne", 0.58, 0.00}, + {"Na", 1.66, 0.09}, + {"Mg", 1.41, 0.07}, + {"Al", 1.21, 0.04}, + {"Si", 1.11, 0.02}, + {"P", 1.07, 0.03}, + {"S", 1.05, 0.03}, + {"Cl", 1.02, 0.04}, + {"Ar", 1.06, 0.10}, + {"K", 2.03, 0.12}, + {"Ca", 1.76, 0.10}, + {"Sc", 1.70, 0.07}, + {"Ti", 1.60, 0.08}, + {"V", 1.53, 0.08}, + {"Cr", 1.39, 0.05}, + {"Mn", 1.39, 0.05}, /* low-spin value */ + {"Fe", 1.32, 0.03}, /* low-spin value */ + {"Co", 1.26, 0.03}, /* low-spin value */ + {"Ni", 1.24, 0.04}, + {"Cu", 1.32, 0.04}, + {"Zn", 1.22, 0.04}, + {"Ga", 1.22, 0.03}, + {"Ge", 1.20, 0.04}, + {"As", 1.19, 0.04}, + {"Se", 1.20, 0.04}, + {"Br", 1.20, 0.03}, + {"Kr", 1.16, 0.04}, + {"Rb", 2.20, 0.09}, + {"Sr", 1.95, 0.10}, + {"Y", 1.90, 0.07}, + {"Zr", 1.75, 0.07}, + {"Nb", 1.64, 0.06}, + {"Mo", 1.54, 0.05}, + {"Tc", 1.47, 0.07}, + {"Ru", 1.46, 0.07}, + {"Rh", 1.42, 0.07}, + {"Pd", 1.39, 0.06}, + {"Ag", 1.45, 0.05}, + {"Cd", 1.44, 0.09}, + {"In", 1.42, 0.05}, + {"Sn", 1.39, 0.04}, + {"Sb", 1.39, 0.05}, + {"Te", 1.38, 0.04}, + {"I", 1.39, 0.03}, + {"Xe", 1.40, 0.09}, + {"Cs", 2.44, 0.11}, + {"Ba", 2.15, 0.11}, + {"La", 2.07, 0.08}, + {"Ce", 2.04, 0.09}, + {"Pr", 2.03, 0.07}, + {"Nd", 2.01, 0.06}, + {"Pm", 1.99, 0.00}, + {"Sm", 1.98, 0.08}, + {"Eu", 1.98, 0.06}, + {"Gd", 1.96, 0.06}, + {"Tb", 1.94, 0.05}, + {"Dy", 1.92, 0.07}, + {"Ho", 1.92, 0.07}, + {"Er", 1.89, 0.06}, + {"Tm", 1.90, 0.10}, + {"Yb", 1.87, 0.08}, + {"Lu", 1.87, 0.08}, + {"Hf", 1.75, 0.10}, + {"Ta", 1.70, 0.08}, + {"W", 1.62, 0.07}, + {"Re", 1.51, 0.07}, + {"Os", 1.44, 0.04}, + {"Ir", 1.41, 0.06}, + {"Pt", 1.36, 0.05}, + {"Au", 1.36, 0.06}, + {"Hg", 1.32, 0.05}, + {"Tl", 1.45, 0.07}, + {"Pb", 1.46, 0.05}, + {"Bi", 1.48, 0.04}, + {"Po", 1.40, 0.04}, + {"At", 1.50, 0.00}, + {"Rn", 1.50, 0.00}, + {"Fr", 2.60, 0.00}, + {"Ra", 2.21, 0.02}, + {"Ac", 2.15, 0.00}, + {"Th", 2.06, 0.06}, + {"Pa", 2.00, 0.00}, + {"U", 1.96, 0.07}, + {"Np", 1.90, 0.01}, + {"Pu", 1.87, 0.01}, + {"Am", 1.80, 0.06}, + {"Cm", 1.69, 0.03}, + {0, 0} +// END_COMPILED_IN_REFERENCE_DATA + }; + + const raw_record* + find_record(std::string const& work_label, bool exact) + { + int m = 0; + const raw_record* matching_record = 0; + for (const raw_record* record = table; record->label; record++) { + int i = basic::match_labels(work_label, record->label); + if (i < 0) return record; + if (i > m) { + m = i; + matching_record = record; + } + } + if (exact || !matching_record) { + throw error("Unknown atom label."); + } + return matching_record; + } + +} // namespace +} // namespace detail + + table::table(std::string const& label, bool exact) + { + std::string work_label = basic::strip_label(label, exact); + record_ = detail::find_record(work_label, exact); + } + + table_iterator::table_iterator() + : + current_("H", true) + {} + + table + table_iterator::next() + { + table result = current_; + if (current_.is_valid()) current_.record_++; + return result; + } + +}}} // namespace cctbx::eltbx::covalent_radii diff --git a/extern/cctbx/cctbx/eltbx/fp_fdp.cpp b/extern/cctbx/cctbx/eltbx/fp_fdp.cpp new file mode 100644 index 00000000..04f344b2 --- /dev/null +++ b/extern/cctbx/cctbx/eltbx/fp_fdp.cpp @@ -0,0 +1,34 @@ +#include +#include + +namespace cctbx { namespace eltbx { + + namespace anomalous { + + fp_fdp + interpolate(const label_z_e_fp_fdp* label_z_e_fp_fdp_, double energy) + { + float fp = fp_fdp_undefined; + float fdp = fp_fdp_undefined; + const e_fp_fdp* data = label_z_e_fp_fdp_->data; + float energy1 = data[0].e; + float energy2 = data[1].e; + std::size_t i; + for(i = 2; energy2 > 0. && energy2 < energy; i++) { + energy1 = energy2; + energy2 = data[i].e; + } + if (energy >= energy1 && energy2 > 0.) { + float f = (energy - energy1) / (energy2 - energy1); + if ( data[i-2].fp != fp_fdp_undefined + && data[i-1].fp != fp_fdp_undefined) { + fp = data[i-2].fp + f * (data[i-1].fp - data[i-2].fp); + } + fdp = data[i-2].fdp + f * (data[i-1].fdp - data[i-2].fdp); + } + return fp_fdp(fp, fdp); + } + + } // namespace anomalous + +}} // namespace cctbx::eltbx diff --git a/extern/cctbx/cctbx/eltbx/henke.cpp b/extern/cctbx/cctbx/eltbx/henke.cpp new file mode 100644 index 00000000..5b314563 --- /dev/null +++ b/extern/cctbx/cctbx/eltbx/henke.cpp @@ -0,0 +1,261 @@ +/* ***************************************************** + THIS IS AN AUTOMATICALLY GENERATED FILE. DO NOT EDIT. + ***************************************************** + + Generated by: + cctbx.source_generators.eltbx.generate_henke_cpp + */ + +#include + +namespace cctbx { namespace eltbx { namespace henke { + +/* + Henke Tables + + The original data can be found at: + ftp://grace.lbl.gov/pub/sf/ + + From ftp://grace.lbl.gov/pub/sf/read.me: + + Low-Energy X-ray Interaction Coefficients: + Photoabsorption, Scattering, and Reflection + E = 30-30,000 eV, Z = 1-92 + + B. L. Henke, E. M. Gullikson, and J. C. Davis + Center for X-Ray Optics, 2-400 + Lawrence Berkeley Laboratory + Berkeley, California 94720 + + Reference: B. L. Henke, E. M. Gullikson, and J. C. Davis, + Atomic Data and Nuclear Data Tables Vol. 54 No. 2 (July 1993). + */ + +namespace table_data { + +using anomalous::e_fp_fdp; + +extern e_fp_fdp h[]; +extern e_fp_fdp he[]; +extern e_fp_fdp li[]; +extern e_fp_fdp be[]; +extern e_fp_fdp b[]; +extern e_fp_fdp c[]; +extern e_fp_fdp n[]; +extern e_fp_fdp o[]; +extern e_fp_fdp f[]; +extern e_fp_fdp ne[]; +extern e_fp_fdp na[]; +extern e_fp_fdp mg[]; +extern e_fp_fdp al[]; +extern e_fp_fdp si[]; +extern e_fp_fdp p[]; +extern e_fp_fdp s[]; +extern e_fp_fdp cl[]; +extern e_fp_fdp ar[]; +extern e_fp_fdp k[]; +extern e_fp_fdp ca[]; +extern e_fp_fdp sc[]; +extern e_fp_fdp ti[]; +extern e_fp_fdp v[]; +extern e_fp_fdp cr[]; +extern e_fp_fdp mn[]; +extern e_fp_fdp fe[]; +extern e_fp_fdp co[]; +extern e_fp_fdp ni[]; +extern e_fp_fdp cu[]; +extern e_fp_fdp zn[]; +extern e_fp_fdp ga[]; +extern e_fp_fdp ge[]; +extern e_fp_fdp as[]; +extern e_fp_fdp se[]; +extern e_fp_fdp br[]; +extern e_fp_fdp kr[]; +extern e_fp_fdp rb[]; +extern e_fp_fdp sr[]; +extern e_fp_fdp y[]; +extern e_fp_fdp zr[]; +extern e_fp_fdp nb[]; +extern e_fp_fdp mo[]; +extern e_fp_fdp tc[]; +extern e_fp_fdp ru[]; +extern e_fp_fdp rh[]; +extern e_fp_fdp pd[]; +extern e_fp_fdp ag[]; +extern e_fp_fdp cd[]; +extern e_fp_fdp in[]; +extern e_fp_fdp sn[]; +extern e_fp_fdp sb[]; +extern e_fp_fdp te[]; +extern e_fp_fdp i[]; +extern e_fp_fdp xe[]; +extern e_fp_fdp cs[]; +extern e_fp_fdp ba[]; +extern e_fp_fdp la[]; +extern e_fp_fdp ce[]; +extern e_fp_fdp pr[]; +extern e_fp_fdp nd[]; +extern e_fp_fdp pm[]; +extern e_fp_fdp sm[]; +extern e_fp_fdp eu[]; +extern e_fp_fdp gd[]; +extern e_fp_fdp tb[]; +extern e_fp_fdp dy[]; +extern e_fp_fdp ho[]; +extern e_fp_fdp er[]; +extern e_fp_fdp tm[]; +extern e_fp_fdp yb[]; +extern e_fp_fdp lu[]; +extern e_fp_fdp hf[]; +extern e_fp_fdp ta[]; +extern e_fp_fdp w[]; +extern e_fp_fdp re[]; +extern e_fp_fdp os[]; +extern e_fp_fdp ir[]; +extern e_fp_fdp pt[]; +extern e_fp_fdp au[]; +extern e_fp_fdp hg[]; +extern e_fp_fdp tl[]; +extern e_fp_fdp pb[]; +extern e_fp_fdp bi[]; +extern e_fp_fdp po[]; +extern e_fp_fdp at[]; +extern e_fp_fdp rn[]; +extern e_fp_fdp fr[]; +extern e_fp_fdp ra[]; +extern e_fp_fdp ac[]; +extern e_fp_fdp th[]; +extern e_fp_fdp pa[]; +extern e_fp_fdp u[]; + +static const anomalous::label_z_e_fp_fdp all[] = { +{"H", 1, h}, +{"He", 2, he}, +{"Li", 3, li}, +{"Be", 4, be}, +{"B", 5, b}, +{"C", 6, c}, +{"N", 7, n}, +{"O", 8, o}, +{"F", 9, f}, +{"Ne", 10, ne}, +{"Na", 11, na}, +{"Mg", 12, mg}, +{"Al", 13, al}, +{"Si", 14, si}, +{"P", 15, p}, +{"S", 16, s}, +{"Cl", 17, cl}, +{"Ar", 18, ar}, +{"K", 19, k}, +{"Ca", 20, ca}, +{"Sc", 21, sc}, +{"Ti", 22, ti}, +{"V", 23, v}, +{"Cr", 24, cr}, +{"Mn", 25, mn}, +{"Fe", 26, fe}, +{"Co", 27, co}, +{"Ni", 28, ni}, +{"Cu", 29, cu}, +{"Zn", 30, zn}, +{"Ga", 31, ga}, +{"Ge", 32, ge}, +{"As", 33, as}, +{"Se", 34, se}, +{"Br", 35, br}, +{"Kr", 36, kr}, +{"Rb", 37, rb}, +{"Sr", 38, sr}, +{"Y", 39, y}, +{"Zr", 40, zr}, +{"Nb", 41, nb}, +{"Mo", 42, mo}, +{"Tc", 43, tc}, +{"Ru", 44, ru}, +{"Rh", 45, rh}, +{"Pd", 46, pd}, +{"Ag", 47, ag}, +{"Cd", 48, cd}, +{"In", 49, in}, +{"Sn", 50, sn}, +{"Sb", 51, sb}, +{"Te", 52, te}, +{"I", 53, i}, +{"Xe", 54, xe}, +{"Cs", 55, cs}, +{"Ba", 56, ba}, +{"La", 57, la}, +{"Ce", 58, ce}, +{"Pr", 59, pr}, +{"Nd", 60, nd}, +{"Pm", 61, pm}, +{"Sm", 62, sm}, +{"Eu", 63, eu}, +{"Gd", 64, gd}, +{"Tb", 65, tb}, +{"Dy", 66, dy}, +{"Ho", 67, ho}, +{"Er", 68, er}, +{"Tm", 69, tm}, +{"Yb", 70, yb}, +{"Lu", 71, lu}, +{"Hf", 72, hf}, +{"Ta", 73, ta}, +{"W", 74, w}, +{"Re", 75, re}, +{"Os", 76, os}, +{"Ir", 77, ir}, +{"Pt", 78, pt}, +{"Au", 79, au}, +{"Hg", 80, hg}, +{"Tl", 81, tl}, +{"Pb", 82, pb}, +{"Bi", 83, bi}, +{"Po", 84, po}, +{"At", 85, at}, +{"Rn", 86, rn}, +{"Fr", 87, fr}, +{"Ra", 88, ra}, +{"Ac", 89, ac}, +{"Th", 90, th}, +{"Pa", 91, pa}, +{"U", 92, u}, +{0, 0, 0} +}; + + } // namespace table_data + + table::table( + std::string const& label, + bool exact, + bool exception_if_no_match) + { + std::string work_label = basic::strip_label(label, exact); + label_z_e_fp_fdp_ = anomalous::find_entry( + table_data::all, work_label, exact, exception_if_no_match); + } + + fp_fdp + table::at_ev(double energy) const + { + fp_fdp raw = anomalous::interpolate(label_z_e_fp_fdp_, energy); + if (!raw.is_valid_fp()) return raw; + // subtract the number of electrons + return fp_fdp(raw.fp() - label_z_e_fp_fdp_->z, raw.fdp()); + } + + table_iterator::table_iterator() + : + current_("H", true) + {} + + table + table_iterator::next() + { + table result = current_; + if (current_.is_valid()) current_.label_z_e_fp_fdp_++; + return result; + } + +}}} // namespace cctbx::eltbx::henke diff --git a/extern/cctbx/cctbx/eltbx/henke_tables_01_12.cpp b/extern/cctbx/cctbx/eltbx/henke_tables_01_12.cpp new file mode 100644 index 00000000..ad9a2f7a --- /dev/null +++ b/extern/cctbx/cctbx/eltbx/henke_tables_01_12.cpp @@ -0,0 +1,6094 @@ +/* ***************************************************** + THIS IS AN AUTOMATICALLY GENERATED FILE. DO NOT EDIT. + ***************************************************** + + Generated by: + cctbx.source_generators.eltbx.generate_henke_cpp + */ + +#include + +namespace cctbx { namespace eltbx { namespace henke { + +namespace table_data { + +using anomalous::e_fp_fdp; + +e_fp_fdp h[] = { /* Z = 1 */ +{10.0000, -9999.00, 0.239540E-16}, +{10.1617, -9999.00, 0.243414E-16}, +{10.3261, -9999.00, 0.247351E-16}, +{10.4931, -9999.00, 0.251352E-16}, +{10.6628, -9999.00, 0.255417E-16}, +{10.8353, -9999.00, 0.259549E-16}, +{11.0106, -9999.00, 0.263746E-16}, +{11.1886, -9999.00, 0.268012E-16}, +{11.3696, -9999.00, 0.272347E-16}, +{11.5535, -9999.00, 0.276752E-16}, +{11.7404, -9999.00, 0.281229E-16}, +{11.9303, -9999.00, 0.285777E-16}, +{12.1232, -9999.00, 0.290399E-16}, +{12.3193, -9999.00, 0.295096E-16}, +{12.5186, -9999.00, 0.299869E-16}, +{12.7210, -9999.00, 0.304720E-16}, +{12.9268, -9999.00, 0.309648E-16}, +{13.1359, -9999.00, 0.314656E-16}, +{13.3483, -9999.00, 0.319746E-16}, +{13.5642, -9999.00, 0.324917E-16}, +{13.7836, -9999.00, 0.330173E-16}, +{14.0066, -9999.00, 0.335513E-16}, +{14.2331, -9999.00, 0.340940E-16}, +{14.4633, -9999.00, 0.346454E-16}, +{14.6973, -9999.00, 0.352058E-16}, +{14.9350, -9999.00, 0.357752E-16}, +{15.1765, -9999.00, 0.363538E-16}, +{15.4220, -9999.00, 0.369418E-16}, +{15.6714, -9999.00, 0.375393E-16}, +{15.9000, -9999.00, 0.380868E-16}, +{16.1000, -9999.00, 0.611915E-14}, +{16.1825, -9999.00, 0.392474E-12}, +{16.4442, -9999.00, 0.185104E-06}, +{16.7102, -9999.00, 0.873013E-01}, +{16.9805, -9999.00, 0.960229}, +{17.2551, -9999.00, 0.931364}, +{17.5342, -9999.00, 0.903367}, +{17.8178, -9999.00, 0.876211}, +{18.1060, -9999.00, 0.849873}, +{18.3989, -9999.00, 0.824325}, +{18.6964, -9999.00, 0.799546}, +{18.9988, -9999.00, 0.775511}, +{19.3061, -9999.00, 0.752199}, +{19.6184, -9999.00, 0.729131}, +{19.9357, -9999.00, 0.705642}, +{20.2582, -9999.00, 0.682908}, +{20.5858, -9999.00, 0.660907}, +{20.9188, -9999.00, 0.639615}, +{21.2571, -9999.00, 0.619009}, +{21.6009, -9999.00, 0.599067}, +{21.9503, -9999.00, 0.579767}, +{22.3053, -9999.00, 0.561089}, +{22.6661, -9999.00, 0.543013}, +{23.0327, -9999.00, 0.525519}, +{23.4053, -9999.00, 0.508588}, +{23.7838, -9999.00, 0.492203}, +{24.1685, -9999.00, 0.476347}, +{24.5594, -9999.00, 0.460795}, +{24.9566, -9999.00, 0.445595}, +{25.3603, -9999.00, 0.430897}, +{25.7705, -9999.00, 0.416683}, +{26.1873, -9999.00, 0.402938}, +{26.6109, -9999.00, 0.389647}, +{27.0413, -9999.00, 0.376794}, +{27.4786, -9999.00, 0.364365}, +{27.9231, -9999.00, 0.352346}, +{28.3747, -9999.00, 0.340723}, +{28.8337, -9999.00, 0.329484}, +{29.3000, 1.07342, 0.318616}, +{29.7739, 1.07482, 0.308106}, +{30.2555, 1.07577, 0.298515}, +{30.7449, 1.07696, 0.289718}, +{31.2421, 1.07825, 0.281082}, +{31.7475, 1.07940, 0.272600}, +{32.2609, 1.08039, 0.264377}, +{32.7827, 1.08123, 0.256403}, +{33.3130, 1.08195, 0.248667}, +{33.8518, 1.08254, 0.241163}, +{34.3993, 1.08300, 0.233886}, +{34.9557, 1.08337, 0.226829}, +{35.5211, 1.08362, 0.219960}, +{36.0956, 1.08376, 0.213297}, +{36.6794, 1.08380, 0.206836}, +{37.2727, 1.08375, 0.200567}, +{37.8755, 1.08362, 0.194485}, +{38.4882, 1.08341, 0.188585}, +{39.1107, 1.08312, 0.182864}, +{39.7432, 1.08278, 0.177319}, +{40.3861, 1.08238, 0.171944}, +{41.0393, 1.08198, 0.166725}, +{41.7031, 1.08151, 0.161576}, +{42.3776, 1.08094, 0.156586}, +{43.0630, 1.08032, 0.151750}, +{43.7595, 1.07964, 0.147051}, +{44.4673, 1.07892, 0.142495}, +{45.1865, 1.07815, 0.138078}, +{45.9174, 1.07735, 0.133798}, +{46.6600, 1.07651, 0.129650}, +{47.4147, 1.07564, 0.125634}, +{48.1816, 1.07476, 0.121741}, +{48.9609, 1.07386, 0.117960}, +{49.7528, 1.07294, 0.114297}, +{50.5576, 1.07201, 0.110729}, +{51.3753, 1.07105, 0.107265}, +{52.2062, 1.07008, 0.103910}, +{53.0506, 1.06908, 0.100659}, +{53.9087, 1.06808, 0.975106E-01}, +{54.7806, 1.06708, 0.944602E-01}, +{55.6667, 1.06607, 0.915051E-01}, +{56.5670, 1.06505, 0.886427E-01}, +{57.4820, 1.06404, 0.858697E-01}, +{58.4117, 1.06302, 0.831839E-01}, +{59.3564, 1.06202, 0.805822E-01}, +{60.3165, 1.06102, 0.780614E-01}, +{61.2921, 1.06005, 0.756082E-01}, +{62.2834, 1.05907, 0.732062E-01}, +{63.2908, 1.05809, 0.708702E-01}, +{64.3145, 1.05711, 0.685836E-01}, +{65.3547, 1.05611, 0.663707E-01}, +{66.4118, 1.05511, 0.642289E-01}, +{67.4859, 1.05411, 0.621564E-01}, +{68.5775, 1.05312, 0.601513E-01}, +{69.6867, 1.05213, 0.582104E-01}, +{70.8138, 1.05114, 0.563323E-01}, +{71.9591, 1.05017, 0.545150E-01}, +{73.1230, 1.04920, 0.527566E-01}, +{74.3057, 1.04825, 0.510546E-01}, +{75.5076, 1.04730, 0.494071E-01}, +{76.7289, 1.04637, 0.478129E-01}, +{77.9699, 1.04544, 0.462703E-01}, +{79.2310, 1.04453, 0.447771E-01}, +{80.5125, 1.04364, 0.433320E-01}, +{81.8147, 1.04276, 0.419309E-01}, +{83.1380, 1.04190, 0.405709E-01}, +{84.4827, 1.04105, 0.392348E-01}, +{85.8491, 1.04020, 0.379426E-01}, +{87.2377, 1.03936, 0.366920E-01}, +{88.6487, 1.03853, 0.354828E-01}, +{90.0825, 1.03770, 0.343137E-01}, +{91.5395, 1.03689, 0.331831E-01}, +{93.0201, 1.03609, 0.320897E-01}, +{94.5246, 1.03531, 0.310324E-01}, +{96.0535, 1.03453, 0.300101E-01}, +{97.6071, 1.03377, 0.290214E-01}, +{99.1858, 1.03302, 0.280652E-01}, +{100.790, 1.03229, 0.271368E-01}, +{102.420, 1.03156, 0.262374E-01}, +{104.077, 1.03085, 0.253737E-01}, +{105.760, 1.03015, 0.245376E-01}, +{107.471, 1.02946, 0.237290E-01}, +{109.209, 1.02879, 0.229472E-01}, +{110.975, 1.02813, 0.221911E-01}, +{112.770, 1.02749, 0.214598E-01}, +{114.594, 1.02685, 0.207528E-01}, +{116.448, 1.02623, 0.200690E-01}, +{118.331, 1.02562, 0.194077E-01}, +{120.245, 1.02503, 0.187681E-01}, +{122.190, 1.02445, 0.181496E-01}, +{124.166, 1.02389, 0.175503E-01}, +{126.175, 1.02334, 0.169580E-01}, +{128.215, 1.02279, 0.163857E-01}, +{130.289, 1.02225, 0.158328E-01}, +{132.397, 1.02172, 0.152983E-01}, +{134.538, 1.02120, 0.147820E-01}, +{136.714, 1.02069, 0.142832E-01}, +{138.925, 1.02019, 0.138012E-01}, +{141.172, 1.01970, 0.133353E-01}, +{143.456, 1.01923, 0.128851E-01}, +{145.776, 1.01876, 0.124503E-01}, +{148.134, 1.01830, 0.120301E-01}, +{150.530, 1.01785, 0.116240E-01}, +{152.964, 1.01741, 0.112318E-01}, +{155.439, 1.01698, 0.108526E-01}, +{157.953, 1.01657, 0.104863E-01}, +{160.507, 1.01616, 0.101325E-01}, +{163.103, 1.01576, 0.978989E-02}, +{165.742, 1.01537, 0.945798E-02}, +{168.422, 1.01499, 0.913121E-02}, +{171.146, 1.01462, 0.881506E-02}, +{173.915, 1.01425, 0.850979E-02}, +{176.727, 1.01390, 0.821516E-02}, +{179.586, 1.01354, 0.793080E-02}, +{182.491, 1.01320, 0.765630E-02}, +{185.442, 1.01286, 0.739119E-02}, +{188.442, 1.01253, 0.713519E-02}, +{191.489, 1.01221, 0.688805E-02}, +{194.587, 1.01190, 0.664962E-02}, +{197.734, 1.01159, 0.641948E-02}, +{200.932, 1.01129, 0.619731E-02}, +{204.182, 1.01100, 0.598257E-02}, +{207.485, 1.01071, 0.577539E-02}, +{210.840, 1.01043, 0.557553E-02}, +{214.251, 1.01016, 0.538225E-02}, +{217.716, 1.00989, 0.519584E-02}, +{221.237, 1.00963, 0.501608E-02}, +{224.816, 1.00938, 0.484241E-02}, +{228.452, 1.00913, 0.467475E-02}, +{232.147, 1.00889, 0.451287E-02}, +{235.902, 1.00866, 0.435661E-02}, +{239.717, 1.00843, 0.420577E-02}, +{243.595, 1.00821, 0.406014E-02}, +{247.535, 1.00799, 0.391955E-02}, +{251.538, 1.00777, 0.378382E-02}, +{255.607, 1.00757, 0.365277E-02}, +{259.741, 1.00737, 0.352625E-02}, +{263.942, 1.00717, 0.340413E-02}, +{268.211, 1.00698, 0.328624E-02}, +{272.549, 1.00679, 0.317240E-02}, +{276.957, 1.00661, 0.306252E-02}, +{281.437, 1.00643, 0.295645E-02}, +{285.989, 1.00626, 0.285407E-02}, +{290.615, 1.00609, 0.275523E-02}, +{295.315, 1.00592, 0.265984E-02}, +{300.092, 1.00577, 0.256773E-02}, +{304.945, 1.00561, 0.247864E-02}, +{309.878, 1.00546, 0.239241E-02}, +{314.890, 1.00531, 0.230717E-02}, +{319.983, 1.00517, 0.222440E-02}, +{325.158, 1.00503, 0.214460E-02}, +{330.418, 1.00489, 0.206767E-02}, +{335.762, 1.00476, 0.199351E-02}, +{341.192, 1.00463, 0.192206E-02}, +{346.711, 1.00450, 0.185312E-02}, +{352.319, 1.00438, 0.178664E-02}, +{358.017, 1.00426, 0.172253E-02}, +{363.808, 1.00414, 0.166075E-02}, +{369.692, 1.00402, 0.160119E-02}, +{375.672, 1.00391, 0.154377E-02}, +{381.748, 1.00380, 0.148837E-02}, +{387.922, 1.00370, 0.143498E-02}, +{394.197, 1.00359, 0.138356E-02}, +{400.573, 1.00349, 0.133393E-02}, +{407.052, 1.00340, 0.128607E-02}, +{413.635, 1.00330, 0.123994E-02}, +{420.326, 1.00321, 0.119547E-02}, +{427.124, 1.00312, 0.115259E-02}, +{434.032, 1.00303, 0.111124E-02}, +{441.052, 1.00294, 0.107134E-02}, +{448.186, 1.00286, 0.103287E-02}, +{455.435, 1.00278, 0.995812E-03}, +{462.802, 1.00270, 0.960079E-03}, +{470.287, 1.00262, 0.925627E-03}, +{477.894, 1.00255, 0.892416E-03}, +{485.623, 1.00248, 0.860393E-03}, +{493.478, 1.00241, 0.829518E-03}, +{501.459, 1.00234, 0.799751E-03}, +{509.570, 1.00227, 0.771052E-03}, +{517.812, 1.00221, 0.743383E-03}, +{526.187, 1.00214, 0.716714E-03}, +{534.698, 1.00208, 0.690999E-03}, +{543.346, 1.00202, 0.666203E-03}, +{552.134, 1.00196, 0.642299E-03}, +{561.065, 1.00191, 0.619249E-03}, +{570.139, 1.00185, 0.597026E-03}, +{579.361, 1.00180, 0.575597E-03}, +{588.732, 1.00175, 0.554945E-03}, +{598.254, 1.00170, 0.535035E-03}, +{607.930, 1.00165, 0.515832E-03}, +{617.763, 1.00160, 0.497219E-03}, +{627.755, 1.00155, 0.479195E-03}, +{637.908, 1.00151, 0.461657E-03}, +{648.226, 1.00146, 0.444758E-03}, +{658.711, 1.00142, 0.428477E-03}, +{669.365, 1.00138, 0.412792E-03}, +{680.191, 1.00134, 0.397680E-03}, +{691.193, 1.00130, 0.383120E-03}, +{702.372, 1.00126, 0.369094E-03}, +{713.733, 1.00122, 0.355582E-03}, +{725.277, 1.00119, 0.342565E-03}, +{737.008, 1.00115, 0.330026E-03}, +{748.928, 1.00112, 0.317945E-03}, +{761.042, 1.00109, 0.306305E-03}, +{773.351, 1.00105, 0.295082E-03}, +{785.859, 1.00102, 0.284275E-03}, +{798.570, 1.00099, 0.273869E-03}, +{811.486, 1.00096, 0.263852E-03}, +{824.611, 1.00093, 0.254197E-03}, +{837.949, 1.00091, 0.244890E-03}, +{851.502, 1.00088, 0.235924E-03}, +{865.274, 1.00085, 0.227288E-03}, +{879.269, 1.00083, 0.218969E-03}, +{893.491, 1.00080, 0.210948E-03}, +{907.943, 1.00078, 0.203223E-03}, +{922.628, 1.00075, 0.195782E-03}, +{937.551, 1.00073, 0.188614E-03}, +{952.715, 1.00071, 0.181709E-03}, +{968.124, 1.00069, 0.175057E-03}, +{983.783, 1.00067, 0.168649E-03}, +{999.695, 1.00065, 0.162475E-03}, +{1015.86, 1.00063, 0.156527E-03}, +{1032.29, 1.00061, 0.150796E-03}, +{1048.99, 1.00059, 0.145275E-03}, +{1065.96, 1.00057, 0.139956E-03}, +{1083.20, 1.00055, 0.134833E-03}, +{1100.72, 1.00054, 0.129897E-03}, +{1118.52, 1.00052, 0.125140E-03}, +{1136.61, 1.00050, 0.120559E-03}, +{1155.00, 1.00049, 0.116145E-03}, +{1173.68, 1.00047, 0.111894E-03}, +{1192.66, 1.00046, 0.107798E-03}, +{1211.95, 1.00044, 0.103851E-03}, +{1231.55, 1.00043, 0.100048E-03}, +{1251.47, 1.00042, 0.963431E-04}, +{1271.72, 1.00040, 0.927658E-04}, +{1292.29, 1.00039, 0.893136E-04}, +{1313.19, 1.00038, 0.859897E-04}, +{1334.43, 1.00037, 0.827890E-04}, +{1356.01, 1.00035, 0.797065E-04}, +{1377.94, 1.00034, 0.767399E-04}, +{1400.23, 1.00033, 0.738845E-04}, +{1422.88, 1.00032, 0.711367E-04}, +{1445.89, 1.00031, 0.684890E-04}, +{1469.28, 1.00030, 0.659394E-04}, +{1493.04, 1.00029, 0.634846E-04}, +{1517.19, 1.00028, 0.611222E-04}, +{1541.73, 1.00027, 0.588497E-04}, +{1566.67, 1.00026, 0.566648E-04}, +{1592.01, 1.00025, 0.545650E-04}, +{1617.76, 1.00025, 0.525439E-04}, +{1643.92, 1.00024, 0.505984E-04}, +{1670.51, 1.00023, 0.487229E-04}, +{1697.53, 1.00022, 0.469171E-04}, +{1724.99, 1.00021, 0.451791E-04}, +{1752.89, 1.00021, 0.434988E-04}, +{1781.24, 1.00020, 0.418788E-04}, +{1810.05, 1.00019, 0.403175E-04}, +{1839.32, 1.00019, 0.388144E-04}, +{1869.07, 1.00018, 0.373672E-04}, +{1899.30, 1.00017, 0.359738E-04}, +{1930.02, 1.00017, 0.346325E-04}, +{1961.24, 1.00016, 0.333413E-04}, +{1992.96, 1.00016, 0.320983E-04}, +{2025.20, 1.00015, 0.309117E-04}, +{2057.95, 1.00015, 0.297548E-04}, +{2091.24, 1.00014, 0.286399E-04}, +{2125.06, 1.00014, 0.275656E-04}, +{2159.43, 1.00013, 0.265311E-04}, +{2194.36, 1.00013, 0.255340E-04}, +{2229.85, 1.00012, 0.245737E-04}, +{2265.92, 1.00012, 0.236488E-04}, +{2302.57, 1.00011, 0.227578E-04}, +{2339.81, 1.00011, 0.218996E-04}, +{2377.66, 1.00010, 0.210728E-04}, +{2416.11, 1.00010, 0.202763E-04}, +{2455.19, 1.00010, 0.195099E-04}, +{2494.90, 1.00009, 0.187711E-04}, +{2535.26, 1.00009, 0.180601E-04}, +{2576.26, 1.00008, 0.173752E-04}, +{2617.93, 1.00008, 0.167157E-04}, +{2660.27, 1.00008, 0.160808E-04}, +{2703.30, 1.00007, 0.154691E-04}, +{2747.03, 1.00007, 0.148806E-04}, +{2791.46, 1.00007, 0.143137E-04}, +{2836.61, 1.00007, 0.137685E-04}, +{2882.49, 1.00006, 0.132435E-04}, +{2929.11, 1.00006, 0.127377E-04}, +{2976.48, 1.00006, 0.122510E-04}, +{3024.63, 1.00005, 0.117831E-04}, +{3073.55, 1.00005, 0.113326E-04}, +{3123.26, 1.00005, 0.108987E-04}, +{3173.78, 1.00005, 0.104815E-04}, +{3225.11, 1.00005, 0.100803E-04}, +{3277.27, 1.00004, 0.969407E-05}, +{3330.28, 1.00004, 0.932280E-05}, +{3384.15, 1.00004, 0.896570E-05}, +{3438.88, 1.00004, 0.862159E-05}, +{3494.50, 1.00003, 0.829117E-05}, +{3551.02, 1.00003, 0.797348E-05}, +{3608.46, 1.00003, 0.766792E-05}, +{3666.82, 1.00003, 0.737417E-05}, +{3726.13, 1.00003, 0.709177E-05}, +{3786.40, 1.00003, 0.682040E-05}, +{3847.64, 1.00002, 0.655955E-05}, +{3909.87, 1.00002, 0.630887E-05}, +{3973.11, 1.00002, 0.606802E-05}, +{4037.38, 1.00002, 0.583417E-05}, +{4102.68, 1.00002, 0.561182E-05}, +{4169.03, 1.00002, 0.539804E-05}, +{4236.46, 1.00001, 0.519262E-05}, +{4304.98, 1.00001, 0.499505E-05}, +{4374.62, 1.00001, 0.480512E-05}, +{4445.37, 1.00001, 0.462252E-05}, +{4517.27, 1.00001, 0.444693E-05}, +{4590.33, 1.00001, 0.427824E-05}, +{4664.58, 1.00001, 0.411592E-05}, +{4740.03, 1.00001, 0.395980E-05}, +{4816.69, 1.00001, 0.380971E-05}, +{4894.60, 1.00000, 0.366534E-05}, +{4973.77, 1.00000, 0.352656E-05}, +{5054.21, 1.00000, 0.339308E-05}, +{5135.96, 1.00000, 0.326467E-05}, +{5219.03, 1.00000, 0.314122E-05}, +{5303.44, 1.00000, 0.302240E-05}, +{5389.22, 0.999999, 0.290811E-05}, +{5476.39, 0.999998, 0.279820E-05}, +{5564.97, 0.999997, 0.269252E-05}, +{5654.98, 0.999996, 0.259080E-05}, +{5746.44, 0.999995, 0.249292E-05}, +{5839.39, 0.999995, 0.239878E-05}, +{5933.83, 0.999994, 0.230825E-05}, +{6029.81, 0.999993, 0.222111E-05}, +{6127.33, 0.999993, 0.213725E-05}, +{6226.44, 0.999992, 0.205662E-05}, +{6327.15, 0.999991, 0.197895E-05}, +{6429.48, 0.999991, 0.190427E-05}, +{6533.48, 0.999990, 0.183248E-05}, +{6639.15, 0.999990, 0.176329E-05}, +{6746.54, 0.999989, 0.169670E-05}, +{6855.65, 0.999988, 0.163268E-05}, +{6966.54, 0.999988, 0.157105E-05}, +{7079.22, 0.999987, 0.151173E-05}, +{7193.72, 0.999987, 0.145464E-05}, +{7310.07, 0.999986, 0.139970E-05}, +{7428.31, 0.999986, 0.134683E-05}, +{7548.45, 0.999985, 0.129594E-05}, +{7670.54, 0.999985, 0.124696E-05}, +{7794.61, 0.999985, 0.119981E-05}, +{7920.68, 0.999984, 0.115443E-05}, +{8048.79, 0.999984, 0.111076E-05}, +{8178.98, 0.999983, 0.106872E-05}, +{8311.26, 0.999983, 0.102826E-05}, +{8445.69, 0.999983, 0.989303E-06}, +{8582.29, 0.999982, 0.951814E-06}, +{8721.11, 0.999982, 0.915734E-06}, +{8862.16, 0.999982, 0.880992E-06}, +{9005.50, 0.999981, 0.847563E-06}, +{9151.16, 0.999981, 0.815359E-06}, +{9299.17, 0.999981, 0.784388E-06}, +{9449.58, 0.999980, 0.754553E-06}, +{9602.42, 0.999980, 0.725847E-06}, +{9757.73, 0.999980, 0.698223E-06}, +{9915.55, 0.999980, 0.671626E-06}, +{10075.9, 0.999979, 0.646075E-06}, +{10238.9, 0.999979, 0.621481E-06}, +{10404.5, 0.999979, 0.597806E-06}, +{10572.8, 0.999979, 0.575016E-06}, +{10743.8, 0.999978, 0.553081E-06}, +{10917.6, 0.999978, 0.531965E-06}, +{11094.2, 0.999978, 0.511641E-06}, +{11273.6, 0.999978, 0.492077E-06}, +{11455.9, 0.999978, 0.473248E-06}, +{11641.2, 0.999977, 0.455123E-06}, +{11829.5, 0.999977, 0.437678E-06}, +{12020.8, 0.999977, 0.420889E-06}, +{12215.3, 0.999977, 0.404728E-06}, +{12412.8, 0.999977, 0.389176E-06}, +{12613.6, 0.999977, 0.374207E-06}, +{12817.6, 0.999976, 0.359802E-06}, +{13025.0, 0.999976, 0.345939E-06}, +{13235.6, 0.999976, 0.332598E-06}, +{13449.7, 0.999976, 0.319760E-06}, +{13667.2, 0.999976, 0.307406E-06}, +{13888.3, 0.999976, 0.295519E-06}, +{14112.9, 0.999975, 0.284081E-06}, +{14341.2, 0.999975, 0.273076E-06}, +{14573.1, 0.999975, 0.262488E-06}, +{14808.9, 0.999975, 0.252302E-06}, +{15048.4, 0.999975, 0.242502E-06}, +{15291.8, 0.999975, 0.233075E-06}, +{15539.1, 0.999975, 0.224007E-06}, +{15790.4, 0.999975, 0.215284E-06}, +{16045.8, 0.999974, 0.206894E-06}, +{16305.4, 0.999974, 0.198825E-06}, +{16569.1, 0.999974, 0.191065E-06}, +{16837.1, 0.999974, 0.183603E-06}, +{17109.4, 0.999974, 0.176428E-06}, +{17386.1, 0.999974, 0.169528E-06}, +{17667.4, 0.999974, 0.162895E-06}, +{17953.1, 0.999974, 0.156518E-06}, +{18243.5, 0.999974, 0.150387E-06}, +{18538.6, 0.999974, 0.144495E-06}, +{18838.4, 0.999974, 0.138831E-06}, +{19143.1, 0.999974, 0.133389E-06}, +{19452.7, 0.999974, 0.128159E-06}, +{19767.4, 0.999973, 0.123133E-06}, +{20087.1, 0.999973, 0.118381E-06}, +{20412.0, 0.999973, 0.113744E-06}, +{20742.1, 0.999973, 0.109292E-06}, +{21077.6, 0.999973, 0.105019E-06}, +{21418.5, 0.999973, 0.100917E-06}, +{21765.0, 0.999973, 0.969783E-07}, +{22117.0, 0.999973, 0.931972E-07}, +{22474.7, 0.999973, 0.895669E-07}, +{22838.2, 0.999973, 0.860810E-07}, +{23207.6, 0.999973, 0.827338E-07}, +{23583.0, 0.999973, 0.795195E-07}, +{23964.4, 0.999973, 0.764328E-07}, +{24352.0, 0.999973, 0.734683E-07}, +{24745.9, 0.999973, 0.706213E-07}, +{25146.2, 0.999973, 0.678867E-07}, +{25552.9, 0.999973, 0.652602E-07}, +{25966.2, 0.999973, 0.627372E-07}, +{26386.1, 0.999972, 0.603136E-07}, +{26812.9, 0.999972, 0.579854E-07}, +{27246.6, 0.999972, 0.557487E-07}, +{27687.3, 0.999972, 0.535999E-07}, +{28135.1, 0.999972, 0.515352E-07}, +{28590.2, 0.999972, 0.495516E-07}, +{29052.6, 0.999972, 0.476455E-07}, +{29522.5, 0.999972, 0.458139E-07}, +{30000.0, 0.999972, 0.440539E-07}, +{0, 0, 0} +}; + +e_fp_fdp he[] = { /* Z = 2 */ +{10.0000, -9999.00, 0.951230E-16}, +{10.1617, -9999.00, 0.966615E-16}, +{10.3261, -9999.00, 0.982249E-16}, +{10.4931, -9999.00, 0.998136E-16}, +{10.6628, -9999.00, 0.101428E-15}, +{10.8353, -9999.00, 0.103069E-15}, +{11.0106, -9999.00, 0.104736E-15}, +{11.1886, -9999.00, 0.106430E-15}, +{11.3696, -9999.00, 0.108151E-15}, +{11.5535, -9999.00, 0.109900E-15}, +{11.7404, -9999.00, 0.111678E-15}, +{11.9303, -9999.00, 0.113484E-15}, +{12.1232, -9999.00, 0.115320E-15}, +{12.3193, -9999.00, 0.117185E-15}, +{12.5186, -9999.00, 0.119080E-15}, +{12.7210, -9999.00, 0.121006E-15}, +{12.9268, -9999.00, 0.122964E-15}, +{13.1359, -9999.00, 0.124952E-15}, +{13.3483, -9999.00, 0.126973E-15}, +{13.5642, -9999.00, 0.129027E-15}, +{13.7836, -9999.00, 0.131114E-15}, +{14.0066, -9999.00, 0.133235E-15}, +{14.2331, -9999.00, 0.135390E-15}, +{14.4633, -9999.00, 0.137579E-15}, +{14.6973, -9999.00, 0.139805E-15}, +{14.9350, -9999.00, 0.142066E-15}, +{15.1765, -9999.00, 0.144364E-15}, +{15.4220, -9999.00, 0.146699E-15}, +{15.6714, -9999.00, 0.149071E-15}, +{15.9249, -9999.00, 0.151483E-15}, +{16.1825, -9999.00, 0.153933E-15}, +{16.4442, -9999.00, 0.156422E-15}, +{16.7102, -9999.00, 0.158952E-15}, +{16.9805, -9999.00, 0.161523E-15}, +{17.2551, -9999.00, 0.164136E-15}, +{17.5342, -9999.00, 0.166791E-15}, +{17.8178, -9999.00, 0.169488E-15}, +{18.1060, -9999.00, 0.172230E-15}, +{18.3989, -9999.00, 0.175015E-15}, +{18.6964, -9999.00, 0.177846E-15}, +{18.9988, -9999.00, 0.180723E-15}, +{19.3061, -9999.00, 0.183646E-15}, +{19.6184, -9999.00, 0.186616E-15}, +{19.9357, -9999.00, 0.189634E-15}, +{20.2582, -9999.00, 0.192702E-15}, +{20.5858, -9999.00, 0.195818E-15}, +{20.9188, -9999.00, 0.198986E-15}, +{21.2571, -9999.00, 0.202204E-15}, +{21.6009, -9999.00, 0.205474E-15}, +{21.9503, -9999.00, 0.208798E-15}, +{22.3053, -9999.00, 0.212175E-15}, +{22.6661, -9999.00, 0.215607E-15}, +{23.0327, -9999.00, 0.219094E-15}, +{23.4053, -9999.00, 0.222638E-15}, +{23.7838, -9999.00, 0.226239E-15}, +{24.1685, -9999.00, 0.229898E-15}, +{24.5000, -9999.00, 0.233051E-15}, +{24.7000, -9999.00, 2.76823}, +{24.9566, -9999.00, 2.74626}, +{25.3603, -9999.00, 2.71250}, +{25.7705, -9999.00, 2.67915}, +{26.1873, -9999.00, 2.64621}, +{26.6109, -9999.00, 2.61368}, +{27.0413, -9999.00, 2.58155}, +{27.4786, -9999.00, 2.54981}, +{27.9231, -9999.00, 2.51846}, +{28.3747, -9999.00, 2.48750}, +{28.8337, -9999.00, 2.45692}, +{29.3000, 0.267470, 2.42672}, +{29.7739, 0.362843, 2.39689}, +{30.2555, 0.451234, 2.36853}, +{30.7449, 0.534067, 2.34051}, +{31.2421, 0.611945, 2.31282}, +{31.7475, 0.685527, 2.28545}, +{32.2609, 0.755443, 2.25841}, +{32.7827, 0.822211, 2.23169}, +{33.3130, 0.887846, 2.20529}, +{33.8518, 0.951922, 2.17643}, +{34.3993, 1.01126, 2.14429}, +{34.9557, 1.06605, 2.11264}, +{35.5211, 1.11755, 2.08145}, +{36.0956, 1.16625, 2.05072}, +{36.6794, 1.21249, 2.02044}, +{37.2727, 1.25652, 1.99061}, +{37.8755, 1.29857, 1.96122}, +{38.4882, 1.33882, 1.93227}, +{39.1107, 1.37746, 1.90374}, +{39.7432, 1.41467, 1.87564}, +{40.3861, 1.45070, 1.84795}, +{41.0393, 1.48603, 1.82066}, +{41.7031, 1.52089, 1.79233}, +{42.3776, 1.55372, 1.76283}, +{43.0630, 1.58406, 1.73381}, +{43.7595, 1.61289, 1.70527}, +{44.4673, 1.64032, 1.67720}, +{45.1865, 1.66651, 1.64959}, +{45.9174, 1.69154, 1.62244}, +{46.6600, 1.71551, 1.59573}, +{47.4147, 1.73847, 1.56946}, +{48.1816, 1.76048, 1.54363}, +{48.9609, 1.78155, 1.51822}, +{49.7528, 1.80162, 1.49323}, +{50.5576, 1.82066, 1.46914}, +{51.3753, 1.83934, 1.44608}, +{52.2062, 1.85796, 1.42339}, +{53.0506, 1.87622, 1.40105}, +{53.9087, 1.89417, 1.37907}, +{54.7806, 1.91185, 1.35743}, +{55.6667, 1.92933, 1.33612}, +{56.5670, 1.94669, 1.31516}, +{57.4820, 1.96406, 1.29452}, +{58.4117, 1.98163, 1.27420}, +{59.3564, 1.99969, 1.25421}, +{60.3165, 2.01823, 1.23453}, +{61.2921, 2.04407, 1.21515}, +{62.2834, 2.06855, 1.18262}, +{63.2908, 2.08356, 1.15072}, +{64.3145, 2.09590, 1.11968}, +{65.3547, 2.10574, 1.08948}, +{66.4118, 2.11331, 1.06009}, +{67.4859, 2.11846, 1.03150}, +{68.5775, 2.11942, 1.00367}, +{69.6867, 2.11942, 0.984085}, +{70.8138, 2.12233, 0.965555}, +{71.9591, 2.12643, 0.947372}, +{73.1230, 2.13093, 0.929534}, +{74.3057, 2.13567, 0.912031}, +{75.5076, 2.14055, 0.894858}, +{76.7289, 2.14552, 0.878008}, +{77.9699, 2.15055, 0.861474}, +{79.2310, 2.15565, 0.845254}, +{80.5125, 2.16086, 0.829337}, +{81.8147, 2.16625, 0.813721}, +{83.1380, 2.17187, 0.798399}, +{84.4827, 2.17877, 0.783365}, +{85.8491, 2.18648, 0.766782}, +{87.2377, 2.19271, 0.747865}, +{88.6487, 2.19719, 0.729416}, +{90.0825, 2.20071, 0.711421}, +{91.5395, 2.20348, 0.693871}, +{93.0201, 2.20554, 0.676753}, +{94.5246, 2.20703, 0.660057}, +{96.0535, 2.20503, 0.643774}, +{97.6071, 2.20321, 0.634306}, +{99.1858, 2.21029, 0.626245}, +{100.790, 2.21897, 0.610238}, +{102.420, 2.22247, 0.592700}, +{104.077, 2.22456, 0.576422}, +{105.760, 2.22622, 0.560590}, +{107.471, 2.22730, 0.545193}, +{109.209, 2.22795, 0.530220}, +{110.975, 2.22825, 0.515658}, +{112.770, 2.22826, 0.501495}, +{114.594, 2.22802, 0.487721}, +{116.448, 2.22759, 0.474327}, +{118.331, 2.22699, 0.461300}, +{120.245, 2.22627, 0.448630}, +{122.190, 2.22547, 0.436308}, +{124.166, 2.22468, 0.424326}, +{126.175, 2.22415, 0.412671}, +{128.215, 2.22353, 0.400327}, +{130.289, 2.22227, 0.388289}, +{132.397, 2.22070, 0.376612}, +{134.538, 2.21894, 0.365286}, +{136.714, 2.21702, 0.354301}, +{138.925, 2.21502, 0.343646}, +{141.172, 2.21300, 0.333312}, +{143.456, 2.21116, 0.323288}, +{145.776, 2.20922, 0.312726}, +{148.134, 2.20672, 0.302492}, +{150.530, 2.20396, 0.292593}, +{152.964, 2.20099, 0.283018}, +{155.439, 2.19784, 0.273756}, +{157.953, 2.19452, 0.264798}, +{160.507, 2.19093, 0.256133}, +{163.103, 2.18694, 0.247841}, +{165.742, 2.18298, 0.240850}, +{168.422, 2.17956, 0.234056}, +{171.146, 2.17636, 0.227455}, +{173.915, 2.17331, 0.221039}, +{176.727, 2.17038, 0.214804}, +{179.586, 2.16759, 0.208745}, +{182.491, 2.16507, 0.202828}, +{185.442, 2.16258, 0.196671}, +{188.442, 2.15987, 0.190702}, +{191.489, 2.15714, 0.184913}, +{194.587, 2.15442, 0.179300}, +{197.734, 2.15170, 0.173858}, +{200.932, 2.14900, 0.168581}, +{204.182, 2.14632, 0.163464}, +{207.485, 2.14366, 0.158502}, +{210.840, 2.14103, 0.153691}, +{214.251, 2.13843, 0.149026}, +{217.716, 2.13587, 0.144503}, +{221.237, 2.13334, 0.140116}, +{224.816, 2.13086, 0.135862}, +{228.452, 2.12841, 0.131736}, +{232.147, 2.12601, 0.127734}, +{235.902, 2.12366, 0.123855}, +{239.717, 2.12136, 0.120093}, +{243.595, 2.11912, 0.116446}, +{247.535, 2.11695, 0.112909}, +{251.538, 2.11487, 0.109480}, +{255.607, 2.11291, 0.106155}, +{259.741, 2.11132, 0.102930}, +{263.942, 2.11022, 0.994029E-01}, +{268.211, 2.10794, 0.941967E-01}, +{272.549, 2.10459, 0.908527E-01}, +{276.957, 2.10213, 0.879361E-01}, +{281.437, 2.09979, 0.850658E-01}, +{285.989, 2.09752, 0.822728E-01}, +{290.615, 2.09531, 0.795694E-01}, +{295.315, 2.09315, 0.769556E-01}, +{300.092, 2.09103, 0.744264E-01}, +{304.945, 2.08896, 0.719808E-01}, +{309.878, 2.08693, 0.696165E-01}, +{314.890, 2.08493, 0.673286E-01}, +{319.983, 2.08298, 0.651156E-01}, +{325.158, 2.08107, 0.629754E-01}, +{330.418, 2.07919, 0.609068E-01}, +{335.762, 2.07736, 0.589059E-01}, +{341.192, 2.07556, 0.569701E-01}, +{346.711, 2.07380, 0.550978E-01}, +{352.319, 2.07207, 0.532873E-01}, +{358.017, 2.07038, 0.515374E-01}, +{363.808, 2.06873, 0.498434E-01}, +{369.692, 2.06712, 0.482049E-01}, +{375.672, 2.06554, 0.466205E-01}, +{381.748, 2.06401, 0.450888E-01}, +{387.922, 2.06252, 0.435958E-01}, +{394.197, 2.06106, 0.421268E-01}, +{400.573, 2.05962, 0.406931E-01}, +{407.052, 2.05819, 0.393032E-01}, +{413.635, 2.05679, 0.379631E-01}, +{420.326, 2.05541, 0.366677E-01}, +{427.124, 2.05405, 0.354162E-01}, +{434.032, 2.05273, 0.342073E-01}, +{441.052, 2.05142, 0.330398E-01}, +{448.186, 2.05015, 0.319128E-01}, +{455.435, 2.04890, 0.308267E-01}, +{462.802, 2.04767, 0.297797E-01}, +{470.287, 2.04648, 0.287692E-01}, +{477.894, 2.04531, 0.277928E-01}, +{485.623, 2.04417, 0.268495E-01}, +{493.478, 2.04305, 0.259383E-01}, +{501.459, 2.04196, 0.250583E-01}, +{509.570, 2.04090, 0.242080E-01}, +{517.812, 2.03986, 0.233872E-01}, +{526.187, 2.03884, 0.225968E-01}, +{534.698, 2.03785, 0.218376E-01}, +{543.346, 2.03688, 0.211062E-01}, +{552.134, 2.03595, 0.203995E-01}, +{561.065, 2.03505, 0.196897E-01}, +{570.139, 2.03415, 0.189948E-01}, +{579.361, 2.03326, 0.183411E-01}, +{588.732, 2.03239, 0.177148E-01}, +{598.254, 2.03155, 0.171129E-01}, +{607.930, 2.03074, 0.165319E-01}, +{617.763, 2.02994, 0.159706E-01}, +{627.755, 2.02918, 0.154266E-01}, +{637.908, 2.02845, 0.148835E-01}, +{648.226, 2.02772, 0.143347E-01}, +{658.711, 2.02698, 0.137903E-01}, +{669.365, 2.02624, 0.132667E-01}, +{680.191, 2.02548, 0.128070E-01}, +{691.193, 2.02476, 0.123966E-01}, +{702.372, 2.02410, 0.120090E-01}, +{713.733, 2.02347, 0.116123E-01}, +{725.277, 2.02285, 0.112146E-01}, +{737.008, 2.02224, 0.108303E-01}, +{748.928, 2.02165, 0.104593E-01}, +{761.042, 2.02107, 0.101010E-01}, +{773.351, 2.02050, 0.975343E-02}, +{785.859, 2.01995, 0.941479E-02}, +{798.570, 2.01942, 0.908546E-02}, +{811.486, 2.01889, 0.876776E-02}, +{824.611, 2.01837, 0.846090E-02}, +{837.949, 2.01787, 0.816451E-02}, +{851.502, 2.01737, 0.788252E-02}, +{865.274, 2.01689, 0.761410E-02}, +{879.269, 2.01642, 0.735815E-02}, +{893.491, 2.01597, 0.711087E-02}, +{907.943, 2.01553, 0.687187E-02}, +{922.628, 2.01510, 0.664090E-02}, +{937.551, 2.01469, 0.641889E-02}, +{952.715, 2.01429, 0.620460E-02}, +{968.124, 2.01389, 0.599768E-02}, +{983.783, 2.01351, 0.579768E-02}, +{999.695, 2.01315, 0.560349E-02}, +{1015.86, 2.01279, 0.541492E-02}, +{1032.29, 2.01244, 0.522484E-02}, +{1048.99, 2.01210, 0.504261E-02}, +{1065.96, 2.01177, 0.486804E-02}, +{1083.20, 2.01144, 0.469946E-02}, +{1100.72, 2.01113, 0.453673E-02}, +{1118.52, 2.01082, 0.437964E-02}, +{1136.61, 2.01051, 0.422801E-02}, +{1155.00, 2.01022, 0.408163E-02}, +{1173.68, 2.00994, 0.394032E-02}, +{1192.66, 2.00966, 0.380385E-02}, +{1211.95, 2.00939, 0.367215E-02}, +{1231.55, 2.00912, 0.354507E-02}, +{1251.47, 2.00886, 0.342352E-02}, +{1271.72, 2.00861, 0.330743E-02}, +{1292.29, 2.00837, 0.319685E-02}, +{1313.19, 2.00813, 0.308992E-02}, +{1334.43, 2.00790, 0.298659E-02}, +{1356.01, 2.00768, 0.288676E-02}, +{1377.94, 2.00747, 0.279024E-02}, +{1400.23, 2.00726, 0.269692E-02}, +{1422.88, 2.00705, 0.260671E-02}, +{1445.89, 2.00686, 0.251952E-02}, +{1469.28, 2.00667, 0.243458E-02}, +{1493.04, 2.00649, 0.235152E-02}, +{1517.19, 2.00631, 0.226698E-02}, +{1541.73, 2.00613, 0.218491E-02}, +{1566.67, 2.00596, 0.210584E-02}, +{1592.01, 2.00579, 0.202959E-02}, +{1617.76, 2.00563, 0.195614E-02}, +{1643.92, 2.00547, 0.188542E-02}, +{1670.51, 2.00531, 0.181712E-02}, +{1697.53, 2.00516, 0.175132E-02}, +{1724.99, 2.00501, 0.168795E-02}, +{1752.89, 2.00487, 0.162588E-02}, +{1781.24, 2.00473, 0.156576E-02}, +{1810.05, 2.00460, 0.150761E-02}, +{1839.32, 2.00446, 0.145162E-02}, +{1869.07, 2.00433, 0.139770E-02}, +{1899.30, 2.00421, 0.134578E-02}, +{1930.02, 2.00408, 0.129580E-02}, +{1961.24, 2.00396, 0.124768E-02}, +{1992.96, 2.00385, 0.120133E-02}, +{2025.20, 2.00374, 0.115724E-02}, +{2057.95, 2.00363, 0.111375E-02}, +{2091.24, 2.00352, 0.107178E-02}, +{2125.06, 2.00342, 0.103129E-02}, +{2159.43, 2.00331, 0.992242E-03}, +{2194.36, 2.00322, 0.954583E-03}, +{2229.85, 2.00312, 0.918257E-03}, +{2265.92, 2.00303, 0.883244E-03}, +{2302.57, 2.00294, 0.849488E-03}, +{2339.81, 2.00285, 0.816939E-03}, +{2377.66, 2.00276, 0.785565E-03}, +{2416.11, 2.00268, 0.755334E-03}, +{2455.19, 2.00260, 0.726220E-03}, +{2494.90, 2.00252, 0.698159E-03}, +{2535.26, 2.00244, 0.671108E-03}, +{2576.26, 2.00237, 0.645079E-03}, +{2617.93, 2.00229, 0.619993E-03}, +{2660.27, 2.00222, 0.595853E-03}, +{2703.30, 2.00215, 0.572612E-03}, +{2747.03, 2.00209, 0.550216E-03}, +{2791.46, 2.00202, 0.528679E-03}, +{2836.61, 2.00196, 0.507958E-03}, +{2882.49, 2.00190, 0.488010E-03}, +{2929.11, 2.00184, 0.468829E-03}, +{2976.48, 2.00178, 0.450387E-03}, +{3024.63, 2.00172, 0.432633E-03}, +{3073.55, 2.00167, 0.415595E-03}, +{3123.26, 2.00161, 0.399184E-03}, +{3173.78, 2.00156, 0.383415E-03}, +{3225.11, 2.00151, 0.368279E-03}, +{3277.27, 2.00146, 0.353746E-03}, +{3330.28, 2.00141, 0.339766E-03}, +{3384.15, 2.00137, 0.326349E-03}, +{3438.88, 2.00132, 0.313472E-03}, +{3494.50, 2.00128, 0.301111E-03}, +{3551.02, 2.00124, 0.289253E-03}, +{3608.46, 2.00119, 0.277876E-03}, +{3666.82, 2.00115, 0.266965E-03}, +{3726.13, 2.00111, 0.256505E-03}, +{3786.40, 2.00108, 0.246479E-03}, +{3847.64, 2.00104, 0.236873E-03}, +{3909.87, 2.00100, 0.227671E-03}, +{3973.11, 2.00097, 0.218857E-03}, +{4037.38, 2.00094, 0.210456E-03}, +{4102.68, 2.00090, 0.202354E-03}, +{4169.03, 2.00087, 0.194569E-03}, +{4236.46, 2.00084, 0.187095E-03}, +{4304.98, 2.00081, 0.179915E-03}, +{4374.62, 2.00078, 0.173016E-03}, +{4445.37, 2.00075, 0.166391E-03}, +{4517.27, 2.00073, 0.160023E-03}, +{4590.33, 2.00070, 0.153908E-03}, +{4664.58, 2.00068, 0.148032E-03}, +{4740.03, 2.00065, 0.142385E-03}, +{4816.69, 2.00063, 0.136961E-03}, +{4894.60, 2.00060, 0.131745E-03}, +{4973.77, 2.00058, 0.126734E-03}, +{5054.21, 2.00056, 0.121919E-03}, +{5135.96, 2.00054, 0.117291E-03}, +{5219.03, 2.00052, 0.112845E-03}, +{5303.44, 2.00050, 0.108569E-03}, +{5389.22, 2.00048, 0.104459E-03}, +{5476.39, 2.00046, 0.100509E-03}, +{5564.97, 2.00044, 0.967114E-04}, +{5654.98, 2.00042, 0.930583E-04}, +{5746.44, 2.00040, 0.895479E-04}, +{5839.39, 2.00039, 0.861710E-04}, +{5933.83, 2.00037, 0.829271E-04}, +{6029.81, 2.00036, 0.798013E-04}, +{6127.33, 2.00034, 0.768045E-04}, +{6226.44, 2.00033, 0.739192E-04}, +{6327.15, 2.00031, 0.711412E-04}, +{6429.48, 2.00030, 0.684727E-04}, +{6533.48, 2.00028, 0.659050E-04}, +{6639.15, 2.00027, 0.634339E-04}, +{6746.54, 2.00026, 0.610575E-04}, +{6855.65, 2.00025, 0.587721E-04}, +{6966.54, 2.00023, 0.565742E-04}, +{7079.22, 2.00022, 0.544591E-04}, +{7193.72, 2.00021, 0.524244E-04}, +{7310.07, 2.00020, 0.504667E-04}, +{7428.31, 2.00019, 0.485830E-04}, +{7548.45, 2.00018, 0.467709E-04}, +{7670.54, 2.00017, 0.450273E-04}, +{7794.61, 2.00016, 0.433495E-04}, +{7920.68, 2.00015, 0.417344E-04}, +{8048.79, 2.00014, 0.401808E-04}, +{8178.98, 2.00013, 0.386851E-04}, +{8311.26, 2.00012, 0.372463E-04}, +{8445.69, 2.00012, 0.358607E-04}, +{8582.29, 2.00011, 0.345279E-04}, +{8721.11, 2.00010, 0.332444E-04}, +{8862.16, 2.00009, 0.320095E-04}, +{9005.50, 2.00008, 0.308211E-04}, +{9151.16, 2.00008, 0.296762E-04}, +{9299.17, 2.00007, 0.285749E-04}, +{9449.58, 2.00006, 0.275144E-04}, +{9602.42, 2.00006, 0.264930E-04}, +{9757.73, 2.00005, 0.255105E-04}, +{9915.55, 2.00005, 0.245639E-04}, +{10075.9, 2.00004, 0.236529E-04}, +{10238.9, 2.00003, 0.227757E-04}, +{10404.5, 2.00003, 0.219312E-04}, +{10572.8, 2.00002, 0.211180E-04}, +{10743.8, 2.00002, 0.203350E-04}, +{10917.6, 2.00001, 0.195811E-04}, +{11094.2, 2.00001, 0.188551E-04}, +{11273.6, 2.00000, 0.181560E-04}, +{11455.9, 2.00000, 0.174828E-04}, +{11641.2, 1.99999, 0.168345E-04}, +{11829.5, 1.99999, 0.162102E-04}, +{12020.8, 1.99999, 0.156091E-04}, +{12215.3, 1.99998, 0.150301E-04}, +{12412.8, 1.99998, 0.144725E-04}, +{12613.6, 1.99997, 0.139355E-04}, +{12817.6, 1.99997, 0.134184E-04}, +{13025.0, 1.99997, 0.129203E-04}, +{13235.6, 1.99996, 0.124406E-04}, +{13449.7, 1.99996, 0.119786E-04}, +{13667.2, 1.99996, 0.115336E-04}, +{13888.3, 1.99995, 0.111051E-04}, +{14112.9, 1.99995, 0.106923E-04}, +{14341.2, 1.99995, 0.102948E-04}, +{14573.1, 1.99994, 0.991188E-05}, +{14808.9, 1.99994, 0.954309E-05}, +{15048.4, 1.99994, 0.918789E-05}, +{15291.8, 1.99994, 0.884577E-05}, +{15539.1, 1.99993, 0.851627E-05}, +{15790.4, 1.99993, 0.819889E-05}, +{16045.8, 1.99993, 0.789321E-05}, +{16305.4, 1.99993, 0.759879E-05}, +{16569.1, 1.99992, 0.731522E-05}, +{16837.1, 1.99992, 0.704210E-05}, +{17109.4, 1.99992, 0.677905E-05}, +{17386.1, 1.99992, 0.652570E-05}, +{17667.4, 1.99992, 0.628168E-05}, +{17953.1, 1.99991, 0.604668E-05}, +{18243.5, 1.99991, 0.582034E-05}, +{18538.6, 1.99991, 0.560236E-05}, +{18838.4, 1.99991, 0.539242E-05}, +{19143.1, 1.99991, 0.519025E-05}, +{19452.7, 1.99990, 0.499555E-05}, +{19767.4, 1.99990, 0.480804E-05}, +{20087.1, 1.99990, 0.474564E-05}, +{20412.0, 1.99990, 0.455916E-05}, +{20742.1, 1.99990, 0.438013E-05}, +{21077.6, 1.99990, 0.420822E-05}, +{21418.5, 1.99989, 0.404316E-05}, +{21765.0, 1.99989, 0.388467E-05}, +{22117.0, 1.99989, 0.373247E-05}, +{22474.7, 1.99989, 0.358632E-05}, +{22838.2, 1.99989, 0.344596E-05}, +{23207.6, 1.99989, 0.331117E-05}, +{23583.0, 1.99989, 0.318171E-05}, +{23964.4, 1.99989, 0.305738E-05}, +{24352.0, 1.99989, 0.293795E-05}, +{24745.9, 1.99988, 0.282325E-05}, +{25146.2, 1.99988, 0.271307E-05}, +{25552.9, 1.99988, 0.260724E-05}, +{25966.2, 1.99988, 0.250558E-05}, +{26386.1, 1.99988, 0.240791E-05}, +{26812.9, 1.99988, 0.231409E-05}, +{27246.6, 1.99988, 0.222396E-05}, +{27687.3, 1.99988, 0.213737E-05}, +{28135.1, 1.99988, 0.205418E-05}, +{28590.2, 1.99988, 0.197425E-05}, +{29052.6, 1.99988, 0.189745E-05}, +{29522.5, 1.99987, 0.182367E-05}, +{30000.0, 1.99987, 0.175277E-05}, +{0, 0, 0} +}; + +e_fp_fdp li[] = { /* Z = 3 */ +{10.0000, -9999.00, 0.116418}, +{10.1617, -9999.00, 0.117427}, +{10.3261, -9999.00, 0.118445}, +{10.4931, -9999.00, 0.119472}, +{10.6628, -9999.00, 0.120508}, +{10.8353, -9999.00, 0.121552}, +{11.0106, -9999.00, 0.122606}, +{11.1886, -9999.00, 0.123668}, +{11.3696, -9999.00, 0.124440}, +{11.5535, -9999.00, 0.125017}, +{11.7404, -9999.00, 0.125598}, +{11.9303, -9999.00, 0.126181}, +{12.1232, -9999.00, 0.126767}, +{12.3193, -9999.00, 0.127356}, +{12.5186, -9999.00, 0.127947}, +{12.7210, -9999.00, 0.128541}, +{12.9268, -9999.00, 0.129138}, +{13.1359, -9999.00, 0.129738}, +{13.3483, -9999.00, 0.130340}, +{13.5642, -9999.00, 0.130945}, +{13.7836, -9999.00, 0.131550}, +{14.0066, -9999.00, 0.132137}, +{14.2331, -9999.00, 0.132727}, +{14.4633, -9999.00, 0.133319}, +{14.6973, -9999.00, 0.133914}, +{14.9350, -9999.00, 0.134512}, +{15.1765, -9999.00, 0.135113}, +{15.4220, -9999.00, 0.135716}, +{15.6714, -9999.00, 0.136322}, +{15.9249, -9999.00, 0.136930}, +{16.1825, -9999.00, 0.137541}, +{16.4442, -9999.00, 0.138155}, +{16.7102, -9999.00, 0.138772}, +{16.9805, -9999.00, 0.139071}, +{17.2551, -9999.00, 0.138903}, +{17.5342, -9999.00, 0.138735}, +{17.8178, -9999.00, 0.138567}, +{18.1060, -9999.00, 0.138399}, +{18.3989, -9999.00, 0.138232}, +{18.6964, -9999.00, 0.138065}, +{18.9988, -9999.00, 0.137898}, +{19.3061, -9999.00, 0.137709}, +{19.6184, -9999.00, 0.137514}, +{19.9357, -9999.00, 0.137318}, +{20.2582, -9999.00, 0.137123}, +{20.5858, -9999.00, 0.136928}, +{20.9188, -9999.00, 0.136733}, +{21.2571, -9999.00, 0.136539}, +{21.6009, -9999.00, 0.136345}, +{21.9503, -9999.00, 0.136151}, +{22.3053, -9999.00, 0.135586}, +{22.6661, -9999.00, 0.134963}, +{23.0327, -9999.00, 0.134343}, +{23.4053, -9999.00, 0.133726}, +{23.7838, -9999.00, 0.133111}, +{24.1685, -9999.00, 0.132500}, +{24.5594, -9999.00, 0.131891}, +{24.9566, -9999.00, 0.131285}, +{25.3603, -9999.00, 0.130681}, +{25.7705, -9999.00, 0.130081}, +{26.1873, -9999.00, 0.129483}, +{26.6109, -9999.00, 0.128888}, +{27.0413, -9999.00, 0.127621}, +{27.4786, -9999.00, 0.125603}, +{27.9231, -9999.00, 0.123616}, +{28.3747, -9999.00, 0.121662}, +{28.8337, -9999.00, 0.119738}, +{29.3000, 0.680884, 0.117845}, +{29.7739, 0.672057, 0.115981}, +{30.2555, 0.662457, 0.114147}, +{30.7449, 0.652204, 0.112619}, +{31.2421, 0.641495, 0.111196}, +{31.7475, 0.630185, 0.109791}, +{32.2609, 0.618217, 0.108404}, +{32.7827, 0.605541, 0.107034}, +{33.3130, 0.592108, 0.105682}, +{33.8518, 0.577867, 0.104347}, +{34.3993, 0.562767, 0.103028}, +{34.9557, 0.546756, 0.101727}, +{35.5211, 0.529790, 0.100441}, +{36.0956, 0.511913, 0.991722E-01}, +{36.6794, 0.492899, 0.974117E-01}, +{37.2727, 0.472300, 0.955735E-01}, +{37.8755, 0.450106, 0.937699E-01}, +{38.4882, 0.426271, 0.920004E-01}, +{39.1107, 0.400660, 0.902642E-01}, +{39.7432, 0.373113, 0.885608E-01}, +{40.3861, 0.343436, 0.868896E-01}, +{41.0393, 0.311403, 0.852499E-01}, +{41.7031, 0.276728, 0.836412E-01}, +{42.3776, 0.239096, 0.820959E-01}, +{43.0630, 0.198182, 0.806583E-01}, +{43.7595, 0.153553, 0.792460E-01}, +{44.4673, 0.104628, 0.778582E-01}, +{45.1865, 0.507173E-01, 0.764948E-01}, +{45.9174, -0.904566E-02, 0.751554E-01}, +{46.6600, -0.757630E-01, 0.738393E-01}, +{47.4147, -0.150875, 0.725463E-01}, +{48.1816, -0.236314, 0.712759E-01}, +{48.9609, -0.334760, 0.700278E-01}, +{49.7528, -0.450076, 0.688015E-01}, +{50.5576, -0.588230, 0.674866E-01}, +{51.3753, -0.759145, 0.661458E-01}, +{52.2062, -0.981045, 0.648315E-01}, +{53.0506, -1.29425, 0.636408E-01}, +{53.9087, -1.82877, 0.627145E-01}, +{54.6000, -3.20462, 0.619885E-01}, +{54.8000, -3.26778, 1.99565}, +{55.6667, -2.01988, 2.17298}, +{56.5670, -1.68391, 2.37060}, +{57.4820, -1.44905, 2.58621}, +{58.4117, -1.20997, 2.78791}, +{59.3564, -0.978073, 2.94577}, +{60.3165, -0.760569, 3.08872}, +{61.2921, -0.542090, 3.21499}, +{62.2834, -0.319116, 3.33533}, +{63.2908, -0.699885E-01, 3.44780}, +{64.3145, 0.209528, 3.50010}, +{65.3547, 0.490103, 3.51380}, +{66.4118, 0.743078, 3.44849}, +{67.4859, 0.976848, 3.38439}, +{68.5775, 1.16223, 3.20844}, +{69.6867, 1.24896, 3.07443}, +{70.8138, 1.30607, 2.96708}, +{71.9591, 1.34649, 2.89749}, +{73.1230, 1.37483, 2.82954}, +{74.3057, 1.38674, 2.79758}, +{75.5076, 1.40488, 2.78483}, +{76.7289, 1.42925, 2.79626}, +{77.9699, 1.46026, 2.80820}, +{79.2310, 1.49817, 2.85028}, +{80.5125, 1.56749, 2.89349}, +{81.8147, 1.65297, 2.93282}, +{83.1380, 1.74778, 2.95689}, +{84.4827, 1.84633, 2.98116}, +{85.8491, 1.96188, 3.00563}, +{87.2377, 2.09531, 3.01725}, +{88.6487, 2.24307, 3.00041}, +{90.0825, 2.39000, 2.95722}, +{91.5395, 2.53184, 2.88927}, +{93.0201, 2.64865, 2.77915}, +{94.5246, 2.72433, 2.68556}, +{96.0535, 2.79740, 2.59906}, +{97.6071, 2.85171, 2.48846}, +{99.1858, 2.87356, 2.39352}, +{100.790, 2.92523, 2.36108}, +{102.420, 2.97852, 2.23552}, +{104.077, 2.97334, 2.17080}, +{105.760, 2.98478, 2.10776}, +{107.471, 2.99098, 2.05038}, +{109.209, 2.99580, 2.00447}, +{110.975, 3.00520, 1.96700}, +{112.770, 3.02065, 1.93440}, +{114.594, 3.04395, 1.90000}, +{116.448, 3.06819, 1.85974}, +{118.331, 3.08790, 1.81856}, +{120.245, 3.10614, 1.77829}, +{122.190, 3.12324, 1.73891}, +{124.166, 3.13943, 1.70040}, +{126.175, 3.15484, 1.66274}, +{128.215, 3.16966, 1.62592}, +{130.289, 3.18417, 1.58989}, +{132.397, 3.19888, 1.55441}, +{134.538, 3.21330, 1.51713}, +{136.714, 3.22540, 1.47975}, +{138.925, 3.23556, 1.44328}, +{141.172, 3.24442, 1.40771}, +{143.456, 3.25202, 1.37302}, +{145.776, 3.25797, 1.33918}, +{148.134, 3.26235, 1.30831}, +{150.530, 3.26778, 1.28017}, +{152.964, 3.27528, 1.25177}, +{155.439, 3.28270, 1.22254}, +{157.953, 3.28877, 1.19295}, +{160.507, 3.29388, 1.16408}, +{163.103, 3.29834, 1.13591}, +{165.742, 3.30227, 1.10842}, +{168.422, 3.30557, 1.08158}, +{171.146, 3.30839, 1.05569}, +{173.915, 3.31098, 1.03081}, +{176.727, 3.31372, 1.00703}, +{179.586, 3.31737, 0.983784}, +{182.491, 3.32179, 0.960465}, +{185.442, 3.32594, 0.934802}, +{188.442, 3.32824, 0.909232}, +{191.489, 3.32851, 0.884027}, +{194.587, 3.32778, 0.861010}, +{197.734, 3.32732, 0.839043}, +{200.932, 3.32690, 0.817994}, +{204.182, 3.32669, 0.797466}, +{207.485, 3.32652, 0.777459}, +{210.840, 3.32698, 0.757960}, +{214.251, 3.32750, 0.737532}, +{217.716, 3.32695, 0.717367}, +{221.237, 3.32594, 0.697533}, +{224.816, 3.32445, 0.678251}, +{228.452, 3.32265, 0.659499}, +{232.147, 3.32059, 0.641261}, +{235.902, 3.31831, 0.623542}, +{239.717, 3.31587, 0.606309}, +{243.595, 3.31327, 0.589546}, +{247.535, 3.31055, 0.573246}, +{251.538, 3.30771, 0.557394}, +{255.607, 3.30479, 0.541978}, +{259.741, 3.30180, 0.527003}, +{263.942, 3.29878, 0.512429}, +{268.211, 3.29574, 0.498243}, +{272.549, 3.29282, 0.484490}, +{276.957, 3.29002, 0.470846}, +{281.437, 3.28707, 0.457242}, +{285.989, 3.28389, 0.443849}, +{290.615, 3.28043, 0.430821}, +{295.315, 3.27686, 0.418174}, +{300.092, 3.27318, 0.405896}, +{304.945, 3.26943, 0.393981}, +{309.878, 3.26563, 0.382416}, +{314.890, 3.26179, 0.371191}, +{319.983, 3.25793, 0.360294}, +{325.158, 3.25404, 0.349719}, +{330.418, 3.25015, 0.339453}, +{335.762, 3.24626, 0.329488}, +{341.192, 3.24237, 0.319816}, +{346.711, 3.23850, 0.310428}, +{352.319, 3.23464, 0.301315}, +{358.017, 3.23082, 0.292473}, +{363.808, 3.22703, 0.283888}, +{369.692, 3.22328, 0.275554}, +{375.672, 3.21959, 0.267464}, +{381.748, 3.21599, 0.259613}, +{387.922, 3.21253, 0.251897}, +{394.197, 3.20905, 0.244208}, +{400.573, 3.20547, 0.236732}, +{407.052, 3.20187, 0.229475}, +{413.635, 3.19827, 0.222436}, +{420.326, 3.19469, 0.215618}, +{427.124, 3.19113, 0.209010}, +{434.032, 3.18762, 0.202601}, +{441.052, 3.18416, 0.196389}, +{448.186, 3.18077, 0.190350}, +{455.435, 3.17744, 0.184411}, +{462.802, 3.17411, 0.178594}, +{470.287, 3.17076, 0.172928}, +{477.894, 3.16740, 0.167439}, +{485.623, 3.16407, 0.162127}, +{493.478, 3.16076, 0.156984}, +{501.459, 3.15749, 0.152005}, +{509.570, 3.15424, 0.147184}, +{517.812, 3.15103, 0.142522}, +{526.187, 3.14785, 0.138026}, +{534.698, 3.14473, 0.133710}, +{543.346, 3.14169, 0.129547}, +{552.134, 3.13876, 0.125509}, +{561.065, 3.13591, 0.121508}, +{570.139, 3.13303, 0.117597}, +{579.361, 3.13018, 0.113829}, +{588.732, 3.12737, 0.110194}, +{598.254, 3.12462, 0.106681}, +{607.930, 3.12192, 0.103275}, +{617.763, 3.11929, 0.999807E-01}, +{627.755, 3.11676, 0.967852E-01}, +{637.908, 3.11431, 0.935986E-01}, +{648.226, 3.11187, 0.903850E-01}, +{658.711, 3.10934, 0.871976E-01}, +{669.365, 3.10662, 0.841223E-01}, +{680.191, 3.10384, 0.814099E-01}, +{691.193, 3.10129, 0.789774E-01}, +{702.372, 3.09896, 0.766669E-01}, +{713.733, 3.09682, 0.742675E-01}, +{725.277, 3.09467, 0.718383E-01}, +{737.008, 3.09249, 0.694890E-01}, +{748.928, 3.09035, 0.672168E-01}, +{761.042, 3.08825, 0.650189E-01}, +{773.351, 3.08618, 0.628898E-01}, +{785.859, 3.08416, 0.608226E-01}, +{798.570, 3.08217, 0.588170E-01}, +{811.486, 3.08021, 0.568785E-01}, +{824.611, 3.07829, 0.550035E-01}, +{837.949, 3.07640, 0.531901E-01}, +{851.502, 3.07455, 0.514403E-01}, +{865.274, 3.07274, 0.497524E-01}, +{879.269, 3.07097, 0.481237E-01}, +{893.491, 3.06925, 0.465489E-01}, +{907.943, 3.06756, 0.450255E-01}, +{922.628, 3.06592, 0.435519E-01}, +{937.551, 3.06432, 0.421079E-01}, +{952.715, 3.06274, 0.407079E-01}, +{968.124, 3.06119, 0.393511E-01}, +{983.783, 3.05967, 0.380389E-01}, +{999.695, 3.05818, 0.367729E-01}, +{1015.86, 3.05671, 0.355517E-01}, +{1032.29, 3.05528, 0.343936E-01}, +{1048.99, 3.05390, 0.332643E-01}, +{1065.96, 3.05256, 0.321625E-01}, +{1083.20, 3.05123, 0.310974E-01}, +{1100.72, 3.04994, 0.300677E-01}, +{1118.52, 3.04868, 0.290722E-01}, +{1136.61, 3.04745, 0.281097E-01}, +{1155.00, 3.04624, 0.271788E-01}, +{1173.68, 3.04507, 0.262784E-01}, +{1192.66, 3.04392, 0.254085E-01}, +{1211.95, 3.04280, 0.245671E-01}, +{1231.55, 3.04172, 0.237533E-01}, +{1251.47, 3.04066, 0.229618E-01}, +{1271.72, 3.03963, 0.221907E-01}, +{1292.29, 3.03862, 0.214382E-01}, +{1313.19, 3.03762, 0.207116E-01}, +{1334.43, 3.03665, 0.200097E-01}, +{1356.01, 3.03570, 0.193314E-01}, +{1377.94, 3.03477, 0.186762E-01}, +{1400.23, 3.03387, 0.180431E-01}, +{1422.88, 3.03298, 0.174315E-01}, +{1445.89, 3.03212, 0.168406E-01}, +{1469.28, 3.03128, 0.162689E-01}, +{1493.04, 3.03047, 0.157153E-01}, +{1517.19, 3.02967, 0.151752E-01}, +{1541.73, 3.02889, 0.146530E-01}, +{1566.67, 3.02812, 0.141488E-01}, +{1592.01, 3.02737, 0.136619E-01}, +{1617.76, 3.02664, 0.131917E-01}, +{1643.92, 3.02593, 0.127378E-01}, +{1670.51, 3.02524, 0.122994E-01}, +{1697.53, 3.02456, 0.118761E-01}, +{1724.99, 3.02391, 0.114673E-01}, +{1752.89, 3.02327, 0.110671E-01}, +{1781.24, 3.02264, 0.106790E-01}, +{1810.05, 3.02202, 0.103031E-01}, +{1839.32, 3.02142, 0.994046E-02}, +{1869.07, 3.02083, 0.959413E-02}, +{1899.30, 3.02025, 0.926777E-02}, +{1930.02, 3.01969, 0.895249E-02}, +{1961.24, 3.01915, 0.864796E-02}, +{1992.96, 3.01863, 0.835378E-02}, +{2025.20, 3.01811, 0.806960E-02}, +{2057.95, 3.01761, 0.779510E-02}, +{2091.24, 3.01713, 0.752992E-02}, +{2125.06, 3.01666, 0.727378E-02}, +{2159.43, 3.01620, 0.702633E-02}, +{2194.36, 3.01575, 0.678732E-02}, +{2229.85, 3.01532, 0.655644E-02}, +{2265.92, 3.01490, 0.633340E-02}, +{2302.57, 3.01449, 0.611795E-02}, +{2339.81, 3.01409, 0.590983E-02}, +{2377.66, 3.01370, 0.570880E-02}, +{2416.11, 3.01333, 0.551262E-02}, +{2455.19, 3.01297, 0.531145E-02}, +{2494.90, 3.01262, 0.511762E-02}, +{2535.26, 3.01226, 0.493087E-02}, +{2576.26, 3.01192, 0.475093E-02}, +{2617.93, 3.01159, 0.457755E-02}, +{2660.27, 3.01126, 0.441008E-02}, +{2703.30, 3.01094, 0.424784E-02}, +{2747.03, 3.01063, 0.409159E-02}, +{2791.46, 3.01033, 0.394107E-02}, +{2836.61, 3.01003, 0.379610E-02}, +{2882.49, 3.00974, 0.365646E-02}, +{2929.11, 3.00946, 0.352145E-02}, +{2976.48, 3.00919, 0.339096E-02}, +{3024.63, 3.00892, 0.326531E-02}, +{3073.55, 3.00866, 0.314430E-02}, +{3123.26, 3.00841, 0.302778E-02}, +{3173.78, 3.00816, 0.291558E-02}, +{3225.11, 3.00792, 0.280726E-02}, +{3277.27, 3.00769, 0.270283E-02}, +{3330.28, 3.00746, 0.260229E-02}, +{3384.15, 3.00724, 0.250549E-02}, +{3438.88, 3.00702, 0.241229E-02}, +{3494.50, 3.00681, 0.232255E-02}, +{3551.02, 3.00661, 0.223631E-02}, +{3608.46, 3.00641, 0.215327E-02}, +{3666.82, 3.00621, 0.207333E-02}, +{3726.13, 3.00602, 0.199635E-02}, +{3786.40, 3.00584, 0.192222E-02}, +{3847.64, 3.00566, 0.185088E-02}, +{3909.87, 3.00549, 0.178266E-02}, +{3973.11, 3.00532, 0.171696E-02}, +{4037.38, 3.00515, 0.165368E-02}, +{4102.68, 3.00499, 0.159274E-02}, +{4169.03, 3.00484, 0.153404E-02}, +{4236.46, 3.00469, 0.147754E-02}, +{4304.98, 3.00454, 0.142325E-02}, +{4374.62, 3.00440, 0.137097E-02}, +{4445.37, 3.00426, 0.132060E-02}, +{4517.27, 3.00413, 0.127208E-02}, +{4590.33, 3.00399, 0.122534E-02}, +{4664.58, 3.00387, 0.118039E-02}, +{4740.03, 3.00374, 0.113717E-02}, +{4816.69, 3.00362, 0.109554E-02}, +{4894.60, 3.00351, 0.105543E-02}, +{4973.77, 3.00339, 0.101679E-02}, +{5054.21, 3.00328, 0.979567E-03}, +{5135.96, 3.00318, 0.943747E-03}, +{5219.03, 3.00307, 0.909264E-03}, +{5303.44, 3.00297, 0.876043E-03}, +{5389.22, 3.00287, 0.844037E-03}, +{5476.39, 3.00278, 0.813196E-03}, +{5564.97, 3.00269, 0.783486E-03}, +{5654.98, 3.00260, 0.754904E-03}, +{5746.44, 3.00251, 0.727378E-03}, +{5839.39, 3.00242, 0.700857E-03}, +{5933.83, 3.00234, 0.675300E-03}, +{6029.81, 3.00226, 0.650677E-03}, +{6127.33, 3.00218, 0.626951E-03}, +{6226.44, 3.00211, 0.604111E-03}, +{6327.15, 3.00203, 0.582105E-03}, +{6429.48, 3.00196, 0.560900E-03}, +{6533.48, 3.00189, 0.540466E-03}, +{6639.15, 3.00183, 0.520778E-03}, +{6746.54, 3.00176, 0.501809E-03}, +{6855.65, 3.00170, 0.483540E-03}, +{6966.54, 3.00164, 0.465936E-03}, +{7079.22, 3.00158, 0.448971E-03}, +{7193.72, 3.00152, 0.432626E-03}, +{7310.07, 3.00146, 0.416874E-03}, +{7428.31, 3.00141, 0.401695E-03}, +{7548.45, 3.00136, 0.387063E-03}, +{7670.54, 3.00130, 0.372963E-03}, +{7794.61, 3.00125, 0.359378E-03}, +{7920.68, 3.00121, 0.346287E-03}, +{8048.79, 3.00116, 0.333673E-03}, +{8178.98, 3.00111, 0.321512E-03}, +{8311.26, 3.00107, 0.309790E-03}, +{8445.69, 3.00103, 0.298496E-03}, +{8582.29, 3.00098, 0.287612E-03}, +{8721.11, 3.00094, 0.277127E-03}, +{8862.16, 3.00090, 0.267023E-03}, +{9005.50, 3.00087, 0.257276E-03}, +{9151.16, 3.00083, 0.247879E-03}, +{9299.17, 3.00079, 0.238826E-03}, +{9449.58, 3.00076, 0.230102E-03}, +{9602.42, 3.00072, 0.221698E-03}, +{9757.73, 3.00069, 0.213601E-03}, +{9915.55, 3.00066, 0.205779E-03}, +{10075.9, 3.00063, 0.198251E-03}, +{10238.9, 3.00060, 0.190995E-03}, +{10404.5, 3.00057, 0.184002E-03}, +{10572.8, 3.00054, 0.177261E-03}, +{10743.8, 3.00051, 0.170764E-03}, +{10917.6, 3.00048, 0.164502E-03}, +{11094.2, 3.00046, 0.158467E-03}, +{11273.6, 3.00043, 0.152651E-03}, +{11455.9, 3.00041, 0.147044E-03}, +{11641.2, 3.00039, 0.141641E-03}, +{11829.5, 3.00036, 0.136434E-03}, +{12020.8, 3.00034, 0.131415E-03}, +{12215.3, 3.00032, 0.126578E-03}, +{12412.8, 3.00030, 0.121916E-03}, +{12613.6, 3.00028, 0.117424E-03}, +{12817.6, 3.00026, 0.113094E-03}, +{13025.0, 3.00024, 0.108922E-03}, +{13235.6, 3.00022, 0.104901E-03}, +{13449.7, 3.00020, 0.101026E-03}, +{13667.2, 3.00018, 0.972922E-04}, +{13888.3, 3.00017, 0.936942E-04}, +{14112.9, 3.00015, 0.902272E-04}, +{14341.2, 3.00013, 0.868865E-04}, +{14573.1, 3.00012, 0.836676E-04}, +{14808.9, 3.00010, 0.805662E-04}, +{15048.4, 3.00009, 0.775780E-04}, +{15291.8, 3.00007, 0.746991E-04}, +{15539.1, 3.00006, 0.719256E-04}, +{15790.4, 3.00005, 0.692535E-04}, +{16045.8, 3.00003, 0.666795E-04}, +{16305.4, 3.00002, 0.641998E-04}, +{16569.1, 3.00001, 0.618114E-04}, +{16837.1, 3.00000, 0.595107E-04}, +{17109.4, 2.99998, 0.572949E-04}, +{17386.1, 2.99997, 0.551607E-04}, +{17667.4, 2.99996, 0.531053E-04}, +{17953.1, 2.99995, 0.511259E-04}, +{18243.5, 2.99994, 0.492198E-04}, +{18538.6, 2.99993, 0.473844E-04}, +{18838.4, 2.99992, 0.456171E-04}, +{19143.1, 2.99991, 0.439156E-04}, +{19452.7, 2.99990, 0.422775E-04}, +{19767.4, 2.99989, 0.407005E-04}, +{20087.1, 2.99989, 0.390553E-04}, +{20412.0, 2.99988, 0.375510E-04}, +{20742.1, 2.99987, 0.361054E-04}, +{21077.6, 2.99986, 0.347159E-04}, +{21418.5, 2.99985, 0.333804E-04}, +{21765.0, 2.99985, 0.320968E-04}, +{22117.0, 2.99984, 0.308630E-04}, +{22474.7, 2.99983, 0.296771E-04}, +{22838.2, 2.99983, 0.285370E-04}, +{23207.6, 2.99982, 0.274411E-04}, +{23583.0, 2.99981, 0.263875E-04}, +{23964.4, 2.99981, 0.253747E-04}, +{24352.0, 2.99980, 0.244010E-04}, +{24745.9, 2.99980, 0.234648E-04}, +{25146.2, 2.99979, 0.225648E-04}, +{25552.9, 2.99978, 0.216994E-04}, +{25966.2, 2.99978, 0.208674E-04}, +{26386.1, 2.99977, 0.200674E-04}, +{26812.9, 2.99977, 0.192981E-04}, +{27246.6, 2.99976, 0.185584E-04}, +{27687.3, 2.99976, 0.178472E-04}, +{28135.1, 2.99976, 0.171632E-04}, +{28590.2, 2.99975, 0.165056E-04}, +{29052.6, 2.99975, 0.158731E-04}, +{29522.5, 2.99974, 0.152649E-04}, +{30000.0, 2.99974, 0.146800E-04}, +{0, 0, 0} +}; + +e_fp_fdp be[] = { /* Z = 4 */ +{10.0000, -9999.00, 0.398134}, +{10.1617, -9999.00, 0.407934}, +{10.3261, -9999.00, 0.417975}, +{10.4931, -9999.00, 0.428263}, +{10.6628, -9999.00, 0.438804}, +{10.8353, -9999.00, 0.449604}, +{11.0106, -9999.00, 0.460217}, +{11.1886, -9999.00, 0.467574}, +{11.3696, -9999.00, 0.475049}, +{11.5535, -9999.00, 0.482651}, +{11.7404, -9999.00, 0.490468}, +{11.9303, -9999.00, 0.498411}, +{12.1232, -9999.00, 0.506506}, +{12.3193, -9999.00, 0.514745}, +{12.5186, -9999.00, 0.519710}, +{12.7210, -9999.00, 0.524527}, +{12.9268, -9999.00, 0.529388}, +{13.1359, -9999.00, 0.533988}, +{13.3483, -9999.00, 0.536420}, +{13.5642, -9999.00, 0.538862}, +{13.7836, -9999.00, 0.541382}, +{14.0066, -9999.00, 0.544467}, +{14.2331, -9999.00, 0.547569}, +{14.4633, -9999.00, 0.550030}, +{14.6973, -9999.00, 0.552100}, +{14.9350, -9999.00, 0.554176}, +{15.1765, -9999.00, 0.556607}, +{15.4220, -9999.00, 0.559129}, +{15.6714, -9999.00, 0.561662}, +{15.9249, -9999.00, 0.563425}, +{16.1825, -9999.00, 0.564956}, +{16.4442, -9999.00, 0.566492}, +{16.7102, -9999.00, 0.565608}, +{16.9805, -9999.00, 0.562546}, +{17.2551, -9999.00, 0.559501}, +{17.5342, -9999.00, 0.556472}, +{17.8178, -9999.00, 0.553415}, +{18.1060, -9999.00, 0.550372}, +{18.3989, -9999.00, 0.547346}, +{18.6964, -9999.00, 0.544766}, +{18.9988, -9999.00, 0.542359}, +{19.3061, -9999.00, 0.539963}, +{19.6184, -9999.00, 0.537577}, +{19.9357, -9999.00, 0.532883}, +{20.2582, -9999.00, 0.528060}, +{20.5858, -9999.00, 0.523282}, +{20.9188, -9999.00, 0.518790}, +{21.2571, -9999.00, 0.514914}, +{21.6009, -9999.00, 0.511068}, +{21.9503, -9999.00, 0.507250}, +{22.3053, -9999.00, 0.503461}, +{22.6661, -9999.00, 0.499701}, +{23.0327, -9999.00, 0.495968}, +{23.4053, -9999.00, 0.492263}, +{23.7838, -9999.00, 0.488586}, +{24.1685, -9999.00, 0.484936}, +{24.5594, -9999.00, 0.481314}, +{24.9566, -9999.00, 0.477718}, +{25.3603, -9999.00, 0.474150}, +{25.7705, -9999.00, 0.470608}, +{26.1873, -9999.00, 0.467093}, +{26.6109, -9999.00, 0.463603}, +{27.0413, -9999.00, 0.460141}, +{27.4786, -9999.00, 0.456703}, +{27.9231, -9999.00, 0.453292}, +{28.3747, -9999.00, 0.449905}, +{28.8337, -9999.00, 0.446545}, +{29.3000, 1.78392, 0.443209}, +{29.7739, 1.78619, 0.440577}, +{30.2555, 1.78894, 0.438415}, +{30.7449, 1.79184, 0.436264}, +{31.2421, 1.79477, 0.434123}, +{31.7475, 1.79771, 0.431993}, +{32.2609, 1.80063, 0.429873}, +{32.7827, 1.80351, 0.427764}, +{33.3130, 1.80636, 0.425665}, +{33.8518, 1.80917, 0.423576}, +{34.3993, 1.81195, 0.421498}, +{34.9557, 1.81469, 0.419430}, +{35.5211, 1.81741, 0.417372}, +{36.0956, 1.82013, 0.415324}, +{36.6794, 1.82288, 0.413286}, +{37.2727, 1.82573, 0.411258}, +{37.8755, 1.82883, 0.409241}, +{38.4882, 1.83271, 0.406912}, +{39.1107, 1.83607, 0.402694}, +{39.7432, 1.83846, 0.398520}, +{40.3861, 1.84026, 0.394389}, +{41.0393, 1.84164, 0.390301}, +{41.7031, 1.84265, 0.386255}, +{42.3776, 1.84333, 0.382251}, +{43.0630, 1.84369, 0.378288}, +{43.7595, 1.84375, 0.374367}, +{44.4673, 1.84352, 0.370486}, +{45.1865, 1.84300, 0.366646}, +{45.9174, 1.84220, 0.362845}, +{46.6600, 1.84111, 0.359084}, +{47.4147, 1.83975, 0.355362}, +{48.1816, 1.83811, 0.351678}, +{48.9609, 1.83621, 0.348033}, +{49.7528, 1.83405, 0.344425}, +{50.5576, 1.83168, 0.340855}, +{51.3753, 1.82924, 0.337244}, +{52.2062, 1.82637, 0.333149}, +{53.0506, 1.82296, 0.329103}, +{53.9087, 1.81912, 0.325107}, +{54.7806, 1.81491, 0.321160}, +{55.6667, 1.81043, 0.317260}, +{56.5670, 1.80599, 0.313408}, +{57.4820, 1.80107, 0.308206}, +{58.4117, 1.79497, 0.302970}, +{59.3564, 1.78794, 0.297823}, +{60.3165, 1.78014, 0.292764}, +{61.2921, 1.77158, 0.287790}, +{62.2834, 1.76226, 0.282901}, +{63.2908, 1.75216, 0.278095}, +{64.3145, 1.74127, 0.273371}, +{65.3547, 1.72955, 0.268727}, +{66.4118, 1.71697, 0.264162}, +{67.4859, 1.70347, 0.259674}, +{68.5775, 1.68902, 0.255263}, +{69.6867, 1.67354, 0.250926}, +{70.8138, 1.65698, 0.246664}, +{71.9591, 1.63926, 0.242473}, +{73.1230, 1.62029, 0.238354}, +{74.3057, 1.59998, 0.234305}, +{75.5076, 1.57822, 0.230325}, +{76.7289, 1.55489, 0.226412}, +{77.9699, 1.52984, 0.222566}, +{79.2310, 1.50292, 0.218785}, +{80.5125, 1.47394, 0.215068}, +{81.8147, 1.44270, 0.211414}, +{83.1380, 1.40894, 0.207823}, +{84.4827, 1.37241, 0.204292}, +{85.8491, 1.33277, 0.200822}, +{87.2377, 1.28973, 0.197410}, +{88.6487, 1.24320, 0.194008}, +{90.0825, 1.19163, 0.188958}, +{91.5395, 1.13380, 0.184039}, +{93.0201, 1.06903, 0.179248}, +{94.5246, 0.996280, 0.174582}, +{96.0535, 0.914013, 0.170037}, +{97.6071, 0.820150, 0.165611}, +{99.1858, 0.711812, 0.161300}, +{100.790, 0.584880, 0.157101}, +{102.420, 0.433182, 0.153011}, +{104.077, 0.246849, 0.149028}, +{105.760, 0.859302E-02, 0.145149}, +{107.471, -0.316509, 0.141370}, +{109.209, -0.819304, 0.137690}, +{110.975, -1.95607, 0.134106}, +{111.600, -3.68317, 0.132874}, +{111.800, -3.71547, 2.79011}, +{112.770, -1.80050, 2.88199}, +{114.594, -1.03772, 3.06065}, +{116.448, -0.647346, 3.25039}, +{118.331, -0.352768, 3.45189}, +{120.245, -0.852938E-01, 3.66589}, +{122.190, 0.191651, 3.89315}, +{124.166, 0.526998, 4.13449}, +{126.175, 0.901788, 4.30069}, +{128.215, 1.33218, 4.46690}, +{130.289, 1.84515, 4.50954}, +{132.397, 2.45528, 4.48878}, +{134.538, 2.99166, 3.97828}, +{136.714, 3.00577, 3.49585}, +{138.925, 2.95608, 3.22871}, +{141.172, 2.90972, 3.12887}, +{143.456, 2.91905, 3.07172}, +{145.776, 2.96150, 3.01561}, +{148.134, 3.00741, 2.96053}, +{150.530, 3.04782, 2.91521}, +{152.964, 3.09830, 2.88034}, +{155.439, 3.15603, 2.84589}, +{157.953, 3.21732, 2.81186}, +{160.507, 3.28594, 2.77823}, +{163.103, 3.35586, 2.73050}, +{165.742, 3.41679, 2.67935}, +{168.422, 3.47260, 2.62916}, +{171.146, 3.52493, 2.57991}, +{173.915, 3.57449, 2.53158}, +{176.727, 3.62175, 2.48416}, +{179.586, 3.66716, 2.43763}, +{182.491, 3.71131, 2.39196}, +{185.442, 3.75618, 2.34578}, +{188.442, 3.79694, 2.29644}, +{191.489, 3.83426, 2.24813}, +{194.587, 3.86897, 2.20084}, +{197.734, 3.90157, 2.15455}, +{200.932, 3.93229, 2.10922}, +{204.182, 3.96133, 2.06486}, +{207.485, 3.98887, 2.02142}, +{210.840, 4.01504, 1.97890}, +{214.251, 4.03999, 1.93727}, +{217.716, 4.06385, 1.89652}, +{221.237, 4.08676, 1.85663}, +{224.816, 4.10888, 1.81757}, +{228.452, 4.13041, 1.77934}, +{232.147, 4.15165, 1.74191}, +{235.902, 4.17319, 1.70527}, +{239.717, 4.19759, 1.66890}, +{243.595, 4.21916, 1.62506}, +{247.535, 4.23679, 1.58238}, +{251.538, 4.25163, 1.54083}, +{255.607, 4.26461, 1.50036}, +{259.741, 4.27605, 1.46095}, +{263.942, 4.28617, 1.42258}, +{268.211, 4.29512, 1.38522}, +{272.549, 4.30302, 1.34884}, +{276.957, 4.30997, 1.31342}, +{281.437, 4.31606, 1.27892}, +{285.989, 4.32135, 1.24533}, +{290.615, 4.32591, 1.21263}, +{295.315, 4.32978, 1.18078}, +{300.092, 4.33301, 1.14977}, +{304.945, 4.33560, 1.11957}, +{309.878, 4.33752, 1.09017}, +{314.890, 4.33862, 1.06196}, +{319.983, 4.33968, 1.03493}, +{325.158, 4.34068, 1.00857}, +{330.418, 4.34144, 0.982895}, +{335.762, 4.34199, 0.957879}, +{341.192, 4.34231, 0.933502}, +{346.711, 4.34244, 0.909753}, +{352.319, 4.34241, 0.886606}, +{358.017, 4.34220, 0.864038}, +{363.808, 4.34187, 0.842061}, +{369.692, 4.34147, 0.820640}, +{375.672, 4.34104, 0.799753}, +{381.748, 4.34069, 0.779400}, +{387.922, 4.34072, 0.759289}, +{394.197, 4.34074, 0.739100}, +{400.573, 4.34043, 0.718469}, +{407.052, 4.33923, 0.698036}, +{413.635, 4.33747, 0.678186}, +{420.326, 4.33533, 0.658904}, +{427.124, 4.33291, 0.640170}, +{434.032, 4.33024, 0.621962}, +{441.052, 4.32738, 0.604274}, +{448.186, 4.32440, 0.587076}, +{455.435, 4.32126, 0.570302}, +{462.802, 4.31797, 0.553961}, +{470.287, 4.31452, 0.538064}, +{477.894, 4.31094, 0.522621}, +{485.623, 4.30727, 0.507623}, +{493.478, 4.30351, 0.493056}, +{501.459, 4.29969, 0.478909}, +{509.570, 4.29581, 0.465162}, +{517.812, 4.29185, 0.451825}, +{526.187, 4.28787, 0.438924}, +{534.698, 4.28391, 0.426483}, +{543.346, 4.28007, 0.414437}, +{552.134, 4.27645, 0.402734}, +{561.065, 4.27294, 0.390883}, +{570.139, 4.26911, 0.379178}, +{579.361, 4.26510, 0.367948}, +{588.732, 4.26106, 0.357094}, +{598.254, 4.25705, 0.346587}, +{607.930, 4.25308, 0.336400}, +{617.763, 4.24919, 0.326505}, +{627.755, 4.24546, 0.316873}, +{637.908, 4.24185, 0.307247}, +{648.226, 4.23817, 0.297505}, +{658.711, 4.23403, 0.287810}, +{669.365, 4.22936, 0.278431}, +{680.191, 4.22431, 0.270158}, +{691.193, 4.21971, 0.262736}, +{702.372, 4.21600, 0.255658}, +{713.733, 4.21267, 0.248183}, +{725.277, 4.20908, 0.240533}, +{737.008, 4.20536, 0.233130}, +{748.928, 4.20161, 0.225953}, +{761.042, 4.19786, 0.218997}, +{773.351, 4.19415, 0.212248}, +{785.859, 4.19046, 0.205674}, +{798.570, 4.18676, 0.199278}, +{811.486, 4.18308, 0.193085}, +{824.611, 4.17942, 0.187081}, +{837.949, 4.17578, 0.181261}, +{851.502, 4.17215, 0.175669}, +{865.274, 4.16858, 0.170290}, +{879.269, 4.16509, 0.165111}, +{893.491, 4.16170, 0.160090}, +{907.943, 4.15838, 0.155222}, +{922.628, 4.15518, 0.150502}, +{937.551, 4.15202, 0.145811}, +{952.715, 4.14889, 0.141239}, +{968.124, 4.14576, 0.136786}, +{983.783, 4.14265, 0.132473}, +{999.695, 4.13956, 0.128287}, +{1015.86, 4.13650, 0.124282}, +{1032.29, 4.13352, 0.120403}, +{1048.99, 4.13058, 0.116645}, +{1065.96, 4.12770, 0.113004}, +{1083.20, 4.12487, 0.109477}, +{1100.72, 4.12209, 0.106060}, +{1118.52, 4.11936, 0.102750}, +{1136.61, 4.11668, 0.995429E-01}, +{1155.00, 4.11405, 0.964359E-01}, +{1173.68, 4.11147, 0.934261E-01}, +{1192.66, 4.10894, 0.905101E-01}, +{1211.95, 4.10646, 0.876851E-01}, +{1231.55, 4.10403, 0.849484E-01}, +{1251.47, 4.10164, 0.822969E-01}, +{1271.72, 4.09931, 0.797283E-01}, +{1292.29, 4.09702, 0.772398E-01}, +{1313.19, 4.09477, 0.748291E-01}, +{1334.43, 4.09258, 0.724936E-01}, +{1356.01, 4.09043, 0.702309E-01}, +{1377.94, 4.08833, 0.680389E-01}, +{1400.23, 4.08627, 0.659153E-01}, +{1422.88, 4.08426, 0.638580E-01}, +{1445.89, 4.08229, 0.618648E-01}, +{1469.28, 4.08038, 0.599340E-01}, +{1493.04, 4.07853, 0.580634E-01}, +{1517.19, 4.07672, 0.562083E-01}, +{1541.73, 4.07493, 0.543956E-01}, +{1566.67, 4.07315, 0.526414E-01}, +{1592.01, 4.07141, 0.509438E-01}, +{1617.76, 4.06971, 0.493008E-01}, +{1643.92, 4.06803, 0.477109E-01}, +{1670.51, 4.06639, 0.461723E-01}, +{1697.53, 4.06478, 0.446833E-01}, +{1724.99, 4.06321, 0.432423E-01}, +{1752.89, 4.06167, 0.418477E-01}, +{1781.24, 4.06016, 0.404982E-01}, +{1810.05, 4.05868, 0.391921E-01}, +{1839.32, 4.05724, 0.379282E-01}, +{1869.07, 4.05583, 0.367050E-01}, +{1899.30, 4.05446, 0.355213E-01}, +{1930.02, 4.05312, 0.343758E-01}, +{1961.24, 4.05181, 0.332672E-01}, +{1992.96, 4.05054, 0.321944E-01}, +{2025.20, 4.04930, 0.311312E-01}, +{2057.95, 4.04808, 0.300964E-01}, +{2091.24, 4.04688, 0.290960E-01}, +{2125.06, 4.04570, 0.281288E-01}, +{2159.43, 4.04454, 0.271938E-01}, +{2194.36, 4.04341, 0.262898E-01}, +{2229.85, 4.04230, 0.254159E-01}, +{2265.92, 4.04122, 0.245711E-01}, +{2302.57, 4.04016, 0.237543E-01}, +{2339.81, 4.03913, 0.229647E-01}, +{2377.66, 4.03812, 0.222014E-01}, +{2416.11, 4.03713, 0.214634E-01}, +{2455.19, 4.03616, 0.207499E-01}, +{2494.90, 4.03522, 0.200602E-01}, +{2535.26, 4.03430, 0.193933E-01}, +{2576.26, 4.03341, 0.187487E-01}, +{2617.93, 4.03253, 0.181255E-01}, +{2660.27, 4.03167, 0.175230E-01}, +{2703.30, 4.03084, 0.169405E-01}, +{2747.03, 4.03003, 0.163774E-01}, +{2791.46, 4.02923, 0.158330E-01}, +{2836.61, 4.02846, 0.153067E-01}, +{2882.49, 4.02770, 0.147979E-01}, +{2929.11, 4.02697, 0.143060E-01}, +{2976.48, 4.02625, 0.138305E-01}, +{3024.63, 4.02556, 0.133645E-01}, +{3073.55, 4.02488, 0.129085E-01}, +{3123.26, 4.02421, 0.124679E-01}, +{3173.78, 4.02356, 0.120425E-01}, +{3225.11, 4.02293, 0.116316E-01}, +{3277.27, 4.02230, 0.112347E-01}, +{3330.28, 4.02170, 0.108513E-01}, +{3384.15, 4.02110, 0.104810E-01}, +{3438.88, 4.02052, 0.101233E-01}, +{3494.50, 4.01996, 0.977786E-02}, +{3551.02, 4.01941, 0.944423E-02}, +{3608.46, 4.01887, 0.912194E-02}, +{3666.82, 4.01835, 0.881066E-02}, +{3726.13, 4.01784, 0.851001E-02}, +{3786.40, 4.01735, 0.821960E-02}, +{3847.64, 4.01686, 0.793914E-02}, +{3909.87, 4.01639, 0.766821E-02}, +{3973.11, 4.01593, 0.740654E-02}, +{4037.38, 4.01549, 0.715149E-02}, +{4102.68, 4.01505, 0.690366E-02}, +{4169.03, 4.01463, 0.666438E-02}, +{4236.46, 4.01421, 0.643341E-02}, +{4304.98, 4.01381, 0.621045E-02}, +{4374.62, 4.01341, 0.599521E-02}, +{4445.37, 4.01303, 0.578744E-02}, +{4517.27, 4.01265, 0.558684E-02}, +{4590.33, 4.01229, 0.539322E-02}, +{4664.58, 4.01193, 0.520631E-02}, +{4740.03, 4.01159, 0.502587E-02}, +{4816.69, 4.01125, 0.485169E-02}, +{4894.60, 4.01092, 0.468353E-02}, +{4973.77, 4.01060, 0.452121E-02}, +{5054.21, 4.01029, 0.436330E-02}, +{5135.96, 4.00999, 0.421033E-02}, +{5219.03, 4.00969, 0.406272E-02}, +{5303.44, 4.00941, 0.392028E-02}, +{5389.22, 4.00913, 0.378285E-02}, +{5476.39, 4.00885, 0.365022E-02}, +{5564.97, 4.00859, 0.352225E-02}, +{5654.98, 4.00833, 0.339876E-02}, +{5746.44, 4.00808, 0.327961E-02}, +{5839.39, 4.00783, 0.316463E-02}, +{5933.83, 4.00759, 0.305368E-02}, +{6029.81, 4.00736, 0.294623E-02}, +{6127.33, 4.00714, 0.284174E-02}, +{6226.44, 4.00692, 0.274094E-02}, +{6327.15, 4.00670, 0.264373E-02}, +{6429.48, 4.00649, 0.254996E-02}, +{6533.48, 4.00629, 0.245951E-02}, +{6639.15, 4.00609, 0.237228E-02}, +{6746.54, 4.00590, 0.228814E-02}, +{6855.65, 4.00571, 0.220698E-02}, +{6966.54, 4.00553, 0.212870E-02}, +{7079.22, 4.00535, 0.205320E-02}, +{7193.72, 4.00518, 0.198037E-02}, +{7310.07, 4.00501, 0.191013E-02}, +{7428.31, 4.00485, 0.184238E-02}, +{7548.45, 4.00469, 0.177703E-02}, +{7670.54, 4.00454, 0.171400E-02}, +{7794.61, 4.00439, 0.165321E-02}, +{7920.68, 4.00424, 0.159457E-02}, +{8048.79, 4.00410, 0.153779E-02}, +{8178.98, 4.00396, 0.148265E-02}, +{8311.26, 4.00383, 0.142949E-02}, +{8445.69, 4.00370, 0.137824E-02}, +{8582.29, 4.00357, 0.132882E-02}, +{8721.11, 4.00345, 0.128118E-02}, +{8862.16, 4.00333, 0.123525E-02}, +{9005.50, 4.00321, 0.119096E-02}, +{9151.16, 4.00309, 0.114826E-02}, +{9299.17, 4.00298, 0.110709E-02}, +{9449.58, 4.00288, 0.106740E-02}, +{9602.42, 4.00277, 0.102913E-02}, +{9757.73, 4.00267, 0.992234E-03}, +{9915.55, 4.00257, 0.956657E-03}, +{10075.9, 4.00248, 0.922385E-03}, +{10238.9, 4.00238, 0.889326E-03}, +{10404.5, 4.00229, 0.857435E-03}, +{10572.8, 4.00220, 0.826670E-03}, +{10743.8, 4.00212, 0.796994E-03}, +{10917.6, 4.00203, 0.768367E-03}, +{11094.2, 4.00195, 0.740753E-03}, +{11273.6, 4.00187, 0.714114E-03}, +{11455.9, 4.00180, 0.688420E-03}, +{11641.2, 4.00172, 0.663634E-03}, +{11829.5, 4.00165, 0.639724E-03}, +{12020.8, 4.00158, 0.616663E-03}, +{12215.3, 4.00151, 0.594417E-03}, +{12412.8, 4.00145, 0.572960E-03}, +{12613.6, 4.00138, 0.552263E-03}, +{12817.6, 4.00132, 0.532301E-03}, +{13025.0, 4.00126, 0.513046E-03}, +{13235.6, 4.00120, 0.494476E-03}, +{13449.7, 4.00114, 0.476565E-03}, +{13667.2, 4.00109, 0.459289E-03}, +{13888.3, 4.00103, 0.442629E-03}, +{14112.9, 4.00098, 0.426561E-03}, +{14341.2, 4.00093, 0.411065E-03}, +{14573.1, 4.00088, 0.396121E-03}, +{14808.9, 4.00083, 0.381710E-03}, +{15048.4, 4.00079, 0.367813E-03}, +{15291.8, 4.00074, 0.354413E-03}, +{15539.1, 4.00070, 0.341491E-03}, +{15790.4, 4.00065, 0.329031E-03}, +{16045.8, 4.00061, 0.317018E-03}, +{16305.4, 4.00057, 0.305435E-03}, +{16569.1, 4.00053, 0.294267E-03}, +{16837.1, 4.00049, 0.283500E-03}, +{17109.4, 4.00046, 0.273121E-03}, +{17386.1, 4.00042, 0.263115E-03}, +{17667.4, 4.00039, 0.253470E-03}, +{17953.1, 4.00035, 0.244172E-03}, +{18243.5, 4.00032, 0.235210E-03}, +{18538.6, 4.00029, 0.226573E-03}, +{18838.4, 4.00026, 0.218248E-03}, +{19143.1, 4.00023, 0.210225E-03}, +{19452.7, 4.00020, 0.202493E-03}, +{19767.4, 4.00017, 0.195043E-03}, +{20087.1, 4.00014, 0.187868E-03}, +{20412.0, 4.00011, 0.180955E-03}, +{20742.1, 4.00009, 0.174299E-03}, +{21077.6, 4.00006, 0.167890E-03}, +{21418.5, 4.00004, 0.161720E-03}, +{21765.0, 4.00001, 0.155777E-03}, +{22117.0, 3.99999, 0.150055E-03}, +{22474.7, 3.99997, 0.144545E-03}, +{22838.2, 3.99995, 0.139239E-03}, +{23207.6, 3.99992, 0.134129E-03}, +{23583.0, 3.99990, 0.129207E-03}, +{23964.4, 3.99988, 0.124467E-03}, +{24352.0, 3.99986, 0.119902E-03}, +{24745.9, 3.99985, 0.115505E-03}, +{25146.2, 3.99983, 0.111270E-03}, +{25552.9, 3.99981, 0.107191E-03}, +{25966.2, 3.99979, 0.103261E-03}, +{26386.1, 3.99978, 0.994763E-04}, +{26812.9, 3.99976, 0.958302E-04}, +{27246.6, 3.99974, 0.923179E-04}, +{27687.3, 3.99973, 0.889344E-04}, +{28135.1, 3.99971, 0.856748E-04}, +{28590.2, 3.99970, 0.825347E-04}, +{29052.6, 3.99969, 0.795095E-04}, +{29522.5, 3.99967, 0.765949E-04}, +{30000.0, 3.99966, 0.737870E-04}, +{0, 0, 0} +}; + +e_fp_fdp b[] = { /* Z = 5 */ +{10.0000, -9999.00, 1.48933}, +{10.1617, -9999.00, 1.48084}, +{10.3261, -9999.00, 1.47240}, +{10.4931, -9999.00, 1.46401}, +{10.6628, -9999.00, 1.45567}, +{10.8353, -9999.00, 1.44738}, +{11.0106, -9999.00, 1.43913}, +{11.1886, -9999.00, 1.43093}, +{11.3696, -9999.00, 1.42278}, +{11.5535, -9999.00, 1.41467}, +{11.7404, -9999.00, 1.40661}, +{11.9303, -9999.00, 1.39860}, +{12.1232, -9999.00, 1.39063}, +{12.3193, -9999.00, 1.38271}, +{12.5186, -9999.00, 1.37483}, +{12.7210, -9999.00, 1.36700}, +{12.9268, -9999.00, 1.35921}, +{13.1359, -9999.00, 1.35146}, +{13.3483, -9999.00, 1.34376}, +{13.5642, -9999.00, 1.33611}, +{13.7836, -9999.00, 1.32849}, +{14.0066, -9999.00, 1.32092}, +{14.2331, -9999.00, 1.31340}, +{14.4633, -9999.00, 1.30592}, +{14.6973, -9999.00, 1.29847}, +{14.9350, -9999.00, 1.29108}, +{15.1765, -9999.00, 1.28304}, +{15.4220, -9999.00, 1.27123}, +{15.6714, -9999.00, 1.25954}, +{15.9249, -9999.00, 1.24795}, +{16.1825, -9999.00, 1.23647}, +{16.4442, -9999.00, 1.22509}, +{16.7102, -9999.00, 1.21382}, +{16.9805, -9999.00, 1.20265}, +{17.2551, -9999.00, 1.19158}, +{17.5342, -9999.00, 1.18062}, +{17.8178, -9999.00, 1.16976}, +{18.1060, -9999.00, 1.15899}, +{18.3989, -9999.00, 1.14833}, +{18.6964, -9999.00, 1.13777}, +{18.9988, -9999.00, 1.12730}, +{19.3061, -9999.00, 1.11692}, +{19.6184, -9999.00, 1.10665}, +{19.9357, -9999.00, 1.09647}, +{20.2582, -9999.00, 1.08638}, +{20.5858, -9999.00, 1.07638}, +{20.9188, -9999.00, 1.06648}, +{21.2571, -9999.00, 1.05666}, +{21.6009, -9999.00, 1.04694}, +{21.9503, -9999.00, 1.03731}, +{22.3053, -9999.00, 1.02777}, +{22.6661, -9999.00, 1.01831}, +{23.0327, -9999.00, 1.00894}, +{23.4053, -9999.00, 0.999657}, +{23.7838, -9999.00, 0.990606}, +{24.1685, -9999.00, 0.981763}, +{24.5594, -9999.00, 0.973000}, +{24.9566, -9999.00, 0.964313}, +{25.3603, -9999.00, 0.955706}, +{25.7705, -9999.00, 0.947175}, +{26.1873, -9999.00, 0.938720}, +{26.6109, -9999.00, 0.930340}, +{27.0413, -9999.00, 0.922036}, +{27.4786, -9999.00, 0.913805}, +{27.9231, -9999.00, 0.905648}, +{28.3747, -9999.00, 0.897563}, +{28.8337, -9999.00, 0.889552}, +{29.3000, 2.70114, 0.881611}, +{29.7739, 2.70924, 0.873741}, +{30.2555, 2.71684, 0.866681}, +{30.7449, 2.72467, 0.860334}, +{31.2421, 2.73292, 0.854029}, +{31.7475, 2.74123, 0.847767}, +{32.2609, 2.74958, 0.841550}, +{32.7827, 2.75795, 0.835377}, +{33.3130, 2.76635, 0.829250}, +{33.8518, 2.77479, 0.823169}, +{34.3993, 2.78332, 0.817131}, +{34.9557, 2.79220, 0.811138}, +{35.5211, 2.80101, 0.804267}, +{36.0956, 2.80936, 0.797376}, +{36.6794, 2.81743, 0.790543}, +{37.2727, 2.82532, 0.783769}, +{37.8755, 2.83309, 0.777052}, +{38.4882, 2.84076, 0.770390}, +{39.1107, 2.84837, 0.763785}, +{39.7432, 2.85607, 0.757243}, +{40.3861, 2.86381, 0.750307}, +{41.0393, 2.87121, 0.743136}, +{41.7031, 2.87824, 0.736032}, +{42.3776, 2.88508, 0.728996}, +{43.0630, 2.89177, 0.722028}, +{43.7595, 2.89833, 0.715129}, +{44.4673, 2.90488, 0.708294}, +{45.1865, 2.91145, 0.701381}, +{45.9174, 2.91778, 0.694129}, +{46.6600, 2.92380, 0.686952}, +{47.4147, 2.92962, 0.679852}, +{48.1816, 2.93531, 0.672826}, +{48.9609, 2.94094, 0.665869}, +{49.7528, 2.94670, 0.658982}, +{50.5576, 2.95245, 0.651457}, +{51.3753, 2.95768, 0.643703}, +{52.2062, 2.96242, 0.636041}, +{53.0506, 2.96687, 0.628470}, +{53.9087, 2.97107, 0.620981}, +{54.7806, 2.97504, 0.613587}, +{55.6667, 2.97882, 0.606281}, +{56.5670, 2.98242, 0.599067}, +{57.4820, 2.98589, 0.591940}, +{58.4117, 2.98929, 0.584894}, +{59.3564, 2.99270, 0.577734}, +{60.3165, 2.99591, 0.570345}, +{61.2921, 2.99887, 0.562897}, +{62.2834, 3.00149, 0.555186}, +{63.2908, 3.00359, 0.547583}, +{64.3145, 3.00540, 0.540088}, +{65.3547, 3.00694, 0.532694}, +{66.4118, 3.00824, 0.525399}, +{67.4859, 3.00933, 0.518204}, +{68.5775, 3.01030, 0.511109}, +{69.6867, 3.01114, 0.503853}, +{70.8138, 3.01173, 0.496542}, +{71.9591, 3.01194, 0.488988}, +{73.1230, 3.01167, 0.481482}, +{74.3057, 3.01097, 0.474092}, +{75.5076, 3.00995, 0.466822}, +{76.7289, 3.00862, 0.459657}, +{77.9699, 3.00704, 0.452598}, +{79.2310, 3.00517, 0.445455}, +{80.5125, 3.00296, 0.438421}, +{81.8147, 3.00044, 0.431260}, +{83.1380, 2.99744, 0.424073}, +{84.4827, 2.99392, 0.416993}, +{85.8491, 2.98998, 0.410033}, +{87.2377, 2.98566, 0.403193}, +{88.6487, 2.98095, 0.396414}, +{90.0825, 2.97584, 0.389685}, +{91.5395, 2.97030, 0.382981}, +{93.0201, 2.96424, 0.376240}, +{94.5246, 2.95761, 0.369619}, +{96.0535, 2.95047, 0.363116}, +{97.6071, 2.94283, 0.356731}, +{99.1858, 2.93493, 0.350464}, +{100.790, 2.92657, 0.343808}, +{102.420, 2.91715, 0.336799}, +{104.077, 2.90673, 0.330006}, +{105.760, 2.89532, 0.323331}, +{107.471, 2.88287, 0.317003}, +{109.209, 2.86954, 0.311354}, +{110.975, 2.85569, 0.306228}, +{112.770, 2.84162, 0.301331}, +{114.594, 2.82707, 0.296255}, +{116.448, 2.81160, 0.290579}, +{118.331, 2.79476, 0.284822}, +{120.245, 2.77657, 0.279180}, +{122.190, 2.75708, 0.273649}, +{124.166, 2.73621, 0.268226}, +{126.175, 2.71386, 0.262912}, +{128.215, 2.68993, 0.257703}, +{130.289, 2.66427, 0.252595}, +{132.397, 2.63679, 0.247574}, +{134.538, 2.60723, 0.242496}, +{136.714, 2.57523, 0.237462}, +{138.925, 2.54059, 0.232530}, +{141.172, 2.50303, 0.227702}, +{143.456, 2.46220, 0.222974}, +{145.776, 2.41750, 0.218344}, +{148.134, 2.36863, 0.214205}, +{150.530, 2.31566, 0.210328}, +{152.964, 2.25735, 0.205697}, +{155.439, 2.19207, 0.200712}, +{157.953, 2.11854, 0.195525}, +{160.507, 2.03507, 0.190474}, +{163.103, 1.93966, 0.185553}, +{165.742, 1.82931, 0.180757}, +{168.422, 1.69968, 0.176085}, +{171.146, 1.54436, 0.171826}, +{173.915, 1.35360, 0.168067}, +{176.727, 1.11057, 0.164874}, +{179.586, 0.782171, 0.161758}, +{182.491, 0.290493, 0.158617}, +{185.442, -0.637089, 0.155123}, +{187.900, -4.78581, 0.152313}, +{188.100, -4.77338, 4.25155}, +{188.442, -2.81976, 4.24286}, +{191.489, -0.321484E-01, 4.16670}, +{194.587, 0.859101, 4.09191}, +{197.734, 1.41819, 4.02128}, +{200.932, 1.83260, 3.95414}, +{204.182, 2.16495, 3.88815}, +{207.485, 2.44452, 3.82327}, +{210.840, 2.68979, 3.75945}, +{214.251, 2.90804, 3.68555}, +{217.716, 3.09795, 3.61074}, +{221.237, 3.26593, 3.53565}, +{224.816, 3.41619, 3.46212}, +{228.452, 3.55209, 3.39013}, +{232.147, 3.67588, 3.31961}, +{235.902, 3.78930, 3.25058}, +{239.717, 3.89373, 3.18300}, +{243.595, 3.99030, 3.11683}, +{247.535, 4.07992, 3.05201}, +{251.538, 4.16334, 2.98855}, +{255.607, 4.24126, 2.92641}, +{259.741, 4.31429, 2.86554}, +{263.942, 4.38295, 2.80593}, +{268.211, 4.44782, 2.74757}, +{272.549, 4.50978, 2.69044}, +{276.957, 4.56954, 2.63274}, +{281.437, 4.62551, 2.57409}, +{285.989, 4.67680, 2.51536}, +{290.615, 4.72393, 2.45779}, +{295.315, 4.76763, 2.40154}, +{300.092, 4.80833, 2.34657}, +{304.945, 4.84632, 2.29285}, +{309.878, 4.88183, 2.24035}, +{314.890, 4.91505, 2.18908}, +{319.983, 4.94621, 2.13898}, +{325.158, 4.97540, 2.09001}, +{330.418, 5.00279, 2.04220}, +{335.762, 5.02857, 1.99548}, +{341.192, 5.05277, 1.94978}, +{346.711, 5.07551, 1.90518}, +{352.319, 5.09696, 1.86160}, +{358.017, 5.11718, 1.81899}, +{363.808, 5.13624, 1.77735}, +{369.692, 5.15427, 1.73667}, +{375.672, 5.17136, 1.69691}, +{381.748, 5.18754, 1.65808}, +{387.922, 5.20299, 1.62030}, +{394.197, 5.21918, 1.58371}, +{400.573, 5.23517, 1.54540}, +{407.052, 5.24857, 1.50702}, +{413.635, 5.26049, 1.46951}, +{420.326, 5.27124, 1.43298}, +{427.124, 5.28107, 1.39737}, +{434.032, 5.29012, 1.36262}, +{441.052, 5.29851, 1.32873}, +{448.186, 5.30657, 1.29556}, +{455.435, 5.31408, 1.26256}, +{462.802, 5.32065, 1.22991}, +{470.287, 5.32625, 1.19786}, +{477.894, 5.33098, 1.16667}, +{485.623, 5.33508, 1.13629}, +{493.478, 5.33862, 1.10670}, +{501.459, 5.34167, 1.07788}, +{509.570, 5.34435, 1.04981}, +{517.812, 5.34673, 1.02238}, +{526.187, 5.34893, 0.995385}, +{534.698, 5.35064, 0.968563}, +{543.346, 5.35143, 0.942202}, +{552.134, 5.35135, 0.916550}, +{561.065, 5.35073, 0.892625}, +{570.139, 5.35066, 0.869687}, +{579.361, 5.35087, 0.846550}, +{588.732, 5.35065, 0.823799}, +{598.254, 5.35003, 0.801516}, +{607.930, 5.34917, 0.779833}, +{617.763, 5.34826, 0.758739}, +{627.755, 5.34744, 0.738149}, +{637.908, 5.34702, 0.717286}, +{648.226, 5.34607, 0.695804}, +{658.711, 5.34351, 0.674188}, +{669.365, 5.33936, 0.653250}, +{680.191, 5.33390, 0.634968}, +{691.193, 5.32934, 0.618719}, +{702.372, 5.32662, 0.603267}, +{713.733, 5.32467, 0.586951}, +{725.277, 5.32199, 0.570232}, +{737.008, 5.31890, 0.553984}, +{748.928, 5.31562, 0.538204}, +{761.042, 5.31223, 0.522872}, +{773.351, 5.30882, 0.507937}, +{785.859, 5.30534, 0.493312}, +{798.570, 5.30171, 0.479013}, +{811.486, 5.29797, 0.465121}, +{824.611, 5.29417, 0.451634}, +{837.949, 5.29037, 0.438538}, +{851.502, 5.28662, 0.425697}, +{865.274, 5.28280, 0.413094}, +{879.269, 5.27882, 0.400743}, +{893.491, 5.27471, 0.388746}, +{907.943, 5.27049, 0.377113}, +{922.628, 5.26617, 0.365835}, +{937.551, 5.26180, 0.355111}, +{952.715, 5.25754, 0.344749}, +{968.124, 5.25338, 0.334727}, +{983.783, 5.24931, 0.324999}, +{999.695, 5.24536, 0.315525}, +{1015.86, 5.24154, 0.306299}, +{1032.29, 5.23778, 0.297006}, +{1048.99, 5.23388, 0.287954}, +{1065.96, 5.22991, 0.279137}, +{1083.20, 5.22591, 0.270598}, +{1100.72, 5.22191, 0.262319}, +{1118.52, 5.21792, 0.254289}, +{1136.61, 5.21394, 0.246507}, +{1155.00, 5.20998, 0.238961}, +{1173.68, 5.20605, 0.231645}, +{1192.66, 5.20216, 0.224555}, +{1211.95, 5.19831, 0.217682}, +{1231.55, 5.19450, 0.211021}, +{1251.47, 5.19075, 0.204548}, +{1271.72, 5.18704, 0.198261}, +{1292.29, 5.18336, 0.192151}, +{1313.19, 5.17972, 0.186228}, +{1334.43, 5.17612, 0.180488}, +{1356.01, 5.17257, 0.174925}, +{1377.94, 5.16907, 0.169534}, +{1400.23, 5.16562, 0.164310}, +{1422.88, 5.16223, 0.159248}, +{1445.89, 5.15890, 0.154338}, +{1469.28, 5.15563, 0.149571}, +{1493.04, 5.15243, 0.144939}, +{1517.19, 5.14929, 0.140388}, +{1541.73, 5.14615, 0.135973}, +{1566.67, 5.14305, 0.131697}, +{1592.01, 5.13999, 0.127556}, +{1617.76, 5.13698, 0.123544}, +{1643.92, 5.13402, 0.119658}, +{1670.51, 5.13110, 0.115894}, +{1697.53, 5.12824, 0.112248}, +{1724.99, 5.12544, 0.108716}, +{1752.89, 5.12270, 0.105266}, +{1781.24, 5.11999, 0.101916}, +{1810.05, 5.11732, 0.986663E-01}, +{1839.32, 5.11469, 0.955176E-01}, +{1869.07, 5.11210, 0.924686E-01}, +{1899.30, 5.10955, 0.895166E-01}, +{1930.02, 5.10705, 0.866612E-01}, +{1961.24, 5.10459, 0.838971E-01}, +{1992.96, 5.10216, 0.812206E-01}, +{2025.20, 5.09981, 0.787027E-01}, +{2057.95, 5.09757, 0.761739E-01}, +{2091.24, 5.09532, 0.737227E-01}, +{2125.06, 5.09311, 0.713481E-01}, +{2159.43, 5.09094, 0.690489E-01}, +{2194.36, 5.08881, 0.668140E-01}, +{2229.85, 5.08672, 0.646543E-01}, +{2265.92, 5.08468, 0.625607E-01}, +{2302.57, 5.08267, 0.605286E-01}, +{2339.81, 5.08070, 0.585635E-01}, +{2377.66, 5.07877, 0.566582E-01}, +{2416.11, 5.07689, 0.548123E-01}, +{2455.19, 5.07503, 0.530246E-01}, +{2494.90, 5.07322, 0.512928E-01}, +{2535.26, 5.07144, 0.496148E-01}, +{2576.26, 5.06971, 0.479897E-01}, +{2617.93, 5.06800, 0.464157E-01}, +{2660.27, 5.06633, 0.448913E-01}, +{2703.30, 5.06470, 0.434149E-01}, +{2747.03, 5.06310, 0.419853E-01}, +{2791.46, 5.06154, 0.406005E-01}, +{2836.61, 5.06001, 0.392606E-01}, +{2882.49, 5.05851, 0.379625E-01}, +{2929.11, 5.05705, 0.367055E-01}, +{2976.48, 5.05561, 0.354884E-01}, +{3024.63, 5.05421, 0.343104E-01}, +{3073.55, 5.05284, 0.331697E-01}, +{3123.26, 5.05150, 0.320658E-01}, +{3173.78, 5.05019, 0.309971E-01}, +{3225.11, 5.04891, 0.299625E-01}, +{3277.27, 5.04765, 0.289616E-01}, +{3330.28, 5.04643, 0.279922E-01}, +{3384.15, 5.04523, 0.270543E-01}, +{3438.88, 5.04406, 0.261471E-01}, +{3494.50, 5.04292, 0.252687E-01}, +{3551.02, 5.04180, 0.244190E-01}, +{3608.46, 5.04071, 0.235963E-01}, +{3666.82, 5.03964, 0.228007E-01}, +{3726.13, 5.03860, 0.220309E-01}, +{3786.40, 5.03758, 0.212856E-01}, +{3847.64, 5.03658, 0.205649E-01}, +{3909.87, 5.03561, 0.198682E-01}, +{3973.11, 5.03466, 0.191937E-01}, +{4037.38, 5.03373, 0.185476E-01}, +{4102.68, 5.03283, 0.179165E-01}, +{4169.03, 5.03195, 0.173072E-01}, +{4236.46, 5.03109, 0.167181E-01}, +{4304.98, 5.03024, 0.161487E-01}, +{4374.62, 5.02942, 0.155980E-01}, +{4445.37, 5.02862, 0.150659E-01}, +{4517.27, 5.02784, 0.145518E-01}, +{4590.33, 5.02708, 0.140547E-01}, +{4664.58, 5.02633, 0.135741E-01}, +{4740.03, 5.02560, 0.131094E-01}, +{4816.69, 5.02490, 0.126607E-01}, +{4894.60, 5.02420, 0.122266E-01}, +{4973.77, 5.02353, 0.118072E-01}, +{5054.21, 5.02287, 0.114019E-01}, +{5135.96, 5.02223, 0.110101E-01}, +{5219.03, 5.02161, 0.106315E-01}, +{5303.44, 5.02100, 0.102655E-01}, +{5389.22, 5.02040, 0.991185E-02}, +{5476.39, 5.01982, 0.957001E-02}, +{5564.97, 5.01926, 0.923971E-02}, +{5654.98, 5.01871, 0.892048E-02}, +{5746.44, 5.01817, 0.861194E-02}, +{5839.39, 5.01765, 0.831380E-02}, +{5933.83, 5.01714, 0.802574E-02}, +{6029.81, 5.01665, 0.774736E-02}, +{6127.33, 5.01616, 0.747830E-02}, +{6226.44, 5.01569, 0.721834E-02}, +{6327.15, 5.01523, 0.696712E-02}, +{6429.48, 5.01478, 0.672443E-02}, +{6533.48, 5.01435, 0.648984E-02}, +{6639.15, 5.01392, 0.626329E-02}, +{6746.54, 5.01351, 0.604440E-02}, +{6855.65, 5.01311, 0.583287E-02}, +{6966.54, 5.01271, 0.562839E-02}, +{7079.22, 5.01233, 0.543100E-02}, +{7193.72, 5.01196, 0.524026E-02}, +{7310.07, 5.01160, 0.505601E-02}, +{7428.31, 5.01124, 0.487800E-02}, +{7548.45, 5.01090, 0.470595E-02}, +{7670.54, 5.01056, 0.453990E-02}, +{7794.61, 5.01024, 0.437949E-02}, +{7920.68, 5.00992, 0.422456E-02}, +{8048.79, 5.00961, 0.407489E-02}, +{8178.98, 5.00931, 0.393020E-02}, +{8311.26, 5.00902, 0.379062E-02}, +{8445.69, 5.00873, 0.365578E-02}, +{8582.29, 5.00845, 0.352547E-02}, +{8721.11, 5.00818, 0.339979E-02}, +{8862.16, 5.00792, 0.327838E-02}, +{9005.50, 5.00766, 0.316109E-02}, +{9151.16, 5.00741, 0.304783E-02}, +{9299.17, 5.00717, 0.293857E-02}, +{9449.58, 5.00693, 0.283291E-02}, +{9602.42, 5.00670, 0.273103E-02}, +{9757.73, 5.00648, 0.263256E-02}, +{9915.55, 5.00626, 0.253775E-02}, +{10075.9, 5.00605, 0.244607E-02}, +{10238.9, 5.00584, 0.235757E-02}, +{10404.5, 5.00564, 0.227215E-02}, +{10572.8, 5.00545, 0.218970E-02}, +{10743.8, 5.00526, 0.211014E-02}, +{10917.6, 5.00507, 0.203335E-02}, +{11094.2, 5.00489, 0.195925E-02}, +{11273.6, 5.00472, 0.188774E-02}, +{11455.9, 5.00455, 0.181875E-02}, +{11641.2, 5.00438, 0.175219E-02}, +{11829.5, 5.00422, 0.168796E-02}, +{12020.8, 5.00406, 0.162601E-02}, +{12215.3, 5.00391, 0.156625E-02}, +{12412.8, 5.00376, 0.150860E-02}, +{12613.6, 5.00362, 0.145300E-02}, +{12817.6, 5.00348, 0.139938E-02}, +{13025.0, 5.00334, 0.134766E-02}, +{13235.6, 5.00321, 0.129780E-02}, +{13449.7, 5.00308, 0.124972E-02}, +{13667.2, 5.00295, 0.120336E-02}, +{13888.3, 5.00283, 0.115867E-02}, +{14112.9, 5.00271, 0.111559E-02}, +{14341.2, 5.00259, 0.107406E-02}, +{14573.1, 5.00248, 0.103404E-02}, +{14808.9, 5.00237, 0.995465E-03}, +{15048.4, 5.00227, 0.958296E-03}, +{15291.8, 5.00216, 0.922482E-03}, +{15539.1, 5.00206, 0.887977E-03}, +{15790.4, 5.00196, 0.854736E-03}, +{16045.8, 5.00187, 0.822718E-03}, +{16305.4, 5.00178, 0.791879E-03}, +{16569.1, 5.00169, 0.762180E-03}, +{16837.1, 5.00160, 0.733582E-03}, +{17109.4, 5.00152, 0.706047E-03}, +{17386.1, 5.00143, 0.679540E-03}, +{17667.4, 5.00135, 0.654024E-03}, +{17953.1, 5.00128, 0.629466E-03}, +{18243.5, 5.00120, 0.605832E-03}, +{18538.6, 5.00113, 0.583093E-03}, +{18838.4, 5.00105, 0.561215E-03}, +{19143.1, 5.00099, 0.540171E-03}, +{19452.7, 5.00092, 0.519930E-03}, +{19767.4, 5.00085, 0.500466E-03}, +{20087.1, 5.00079, 0.481560E-03}, +{20412.0, 5.00073, 0.463572E-03}, +{20742.1, 5.00067, 0.446275E-03}, +{21077.6, 5.00061, 0.429641E-03}, +{21418.5, 5.00055, 0.413645E-03}, +{21765.0, 5.00050, 0.398260E-03}, +{22117.0, 5.00044, 0.383463E-03}, +{22474.7, 5.00039, 0.369231E-03}, +{22838.2, 5.00034, 0.355541E-03}, +{23207.6, 5.00029, 0.342372E-03}, +{23583.0, 5.00025, 0.329702E-03}, +{23964.4, 5.00020, 0.317515E-03}, +{24352.0, 5.00015, 0.305788E-03}, +{24745.9, 5.00011, 0.294506E-03}, +{25146.2, 5.00007, 0.283650E-03}, +{25552.9, 5.00003, 0.273204E-03}, +{25966.2, 4.99999, 0.263151E-03}, +{26386.1, 4.99995, 0.253477E-03}, +{26812.9, 4.99991, 0.244167E-03}, +{27246.6, 4.99988, 0.235206E-03}, +{27687.3, 4.99984, 0.226582E-03}, +{28135.1, 4.99981, 0.218281E-03}, +{28590.2, 4.99977, 0.210290E-03}, +{29052.6, 4.99974, 0.202598E-03}, +{29522.5, 4.99971, 0.195192E-03}, +{30000.0, 4.99968, 0.188063E-03}, +{0, 0, 0} +}; + +e_fp_fdp c[] = { /* Z = 6 */ +{10.0000, -9999.00, 0.806885}, +{10.1617, -9999.00, 0.851522}, +{10.3261, -9999.00, 0.898628}, +{10.4931, -9999.00, 0.948341}, +{10.6628, -9999.00, 1.00080}, +{10.8353, -9999.00, 1.05755}, +{11.0106, -9999.00, 1.12167}, +{11.1886, -9999.00, 1.18968}, +{11.3696, -9999.00, 1.26181}, +{11.5535, -9999.00, 1.33832}, +{11.7404, -9999.00, 1.41946}, +{11.9303, -9999.00, 1.50553}, +{12.1232, -9999.00, 1.58971}, +{12.3193, -9999.00, 1.67820}, +{12.5186, -9999.00, 1.77161}, +{12.7210, -9999.00, 1.87023}, +{12.9268, -9999.00, 1.97433}, +{13.1359, -9999.00, 2.08423}, +{13.3483, -9999.00, 2.20025}, +{13.5642, -9999.00, 2.29235}, +{13.7836, -9999.00, 2.38287}, +{14.0066, -9999.00, 2.47696}, +{14.2331, -9999.00, 2.57477}, +{14.4633, -9999.00, 2.67645}, +{14.6973, -9999.00, 2.77114}, +{14.9350, -9999.00, 2.84605}, +{15.1765, -9999.00, 2.92298}, +{15.4220, -9999.00, 3.00199}, +{15.6714, -9999.00, 3.08313}, +{15.9249, -9999.00, 3.16647}, +{16.1825, -9999.00, 3.24213}, +{16.4442, -9999.00, 3.28778}, +{16.7102, -9999.00, 3.33408}, +{16.9805, -9999.00, 3.38103}, +{17.2551, -9999.00, 3.42863}, +{17.5342, -9999.00, 3.47691}, +{17.8178, -9999.00, 3.52041}, +{18.1060, -9999.00, 3.54277}, +{18.3989, -9999.00, 3.56528}, +{18.6964, -9999.00, 3.58793}, +{18.9988, -9999.00, 3.61072}, +{19.3061, -9999.00, 3.63366}, +{19.6184, -9999.00, 3.65674}, +{19.9357, -9999.00, 3.67997}, +{20.2582, -9999.00, 3.70335}, +{20.5858, -9999.00, 3.69489}, +{20.9188, -9999.00, 3.67204}, +{21.2571, -9999.00, 3.64934}, +{21.6009, -9999.00, 3.62677}, +{21.9503, -9999.00, 3.60434}, +{22.3053, -9999.00, 3.58205}, +{22.6661, -9999.00, 3.55990}, +{23.0327, -9999.00, 3.53320}, +{23.4053, -9999.00, 3.47892}, +{23.7838, -9999.00, 3.42547}, +{24.1685, -9999.00, 3.37285}, +{24.5594, -9999.00, 3.32103}, +{24.9566, -9999.00, 3.27000}, +{25.3603, -9999.00, 3.21977}, +{25.7705, -9999.00, 3.17030}, +{26.1873, -9999.00, 3.12096}, +{26.6109, -9999.00, 3.06350}, +{27.0413, -9999.00, 3.00708}, +{27.4786, -9999.00, 2.95171}, +{27.9231, -9999.00, 2.89736}, +{28.3747, -9999.00, 2.84401}, +{28.8337, -9999.00, 2.79164}, +{29.3000, 3.63318, 2.74024}, +{29.7739, 3.67378, 2.68978}, +{30.2555, 3.71270, 2.63618}, +{30.7449, 3.74753, 2.58360}, +{31.2421, 3.77973, 2.53206}, +{31.7475, 3.80969, 2.48155}, +{32.2609, 3.83764, 2.43205}, +{32.7827, 3.86374, 2.38354}, +{33.3130, 3.88807, 2.33599}, +{33.8518, 3.91071, 2.28940}, +{34.3993, 3.93156, 2.24373}, +{34.9557, 3.95026, 2.19898}, +{35.5211, 3.96709, 2.15799}, +{36.0956, 3.98488, 2.11827}, +{36.6794, 4.00253, 2.07928}, +{37.2727, 4.01992, 2.04101}, +{37.8755, 4.03712, 2.00344}, +{38.4882, 4.05432, 1.96657}, +{39.1107, 4.07360, 1.93037}, +{39.7432, 4.09449, 1.89011}, +{40.3861, 4.11010, 1.84650}, +{41.0393, 4.12229, 1.80390}, +{41.7031, 4.13211, 1.76228}, +{42.3776, 4.13985, 1.72163}, +{43.0630, 4.14559, 1.68191}, +{43.7595, 4.14925, 1.64310}, +{44.4673, 4.14955, 1.60520}, +{45.1865, 4.14584, 1.56917}, +{45.9174, 4.14175, 1.54376}, +{46.6600, 4.14174, 1.51876}, +{47.4147, 4.14300, 1.49417}, +{48.1816, 4.14486, 1.46998}, +{48.9609, 4.14698, 1.44618}, +{49.7528, 4.14913, 1.42276}, +{50.5576, 4.15113, 1.39972}, +{51.3753, 4.15277, 1.37705}, +{52.2062, 4.15371, 1.35475}, +{53.0506, 4.15307, 1.33282}, +{53.9087, 4.14960, 1.31546}, +{54.7806, 4.14997, 1.30168}, +{55.6667, 4.15270, 1.28804}, +{56.5670, 4.15681, 1.27454}, +{57.4820, 4.16209, 1.26118}, +{58.4117, 4.16851, 1.24797}, +{59.3564, 4.17625, 1.23489}, +{60.3165, 4.18600, 1.22195}, +{61.2921, 4.19949, 1.20654}, +{62.2834, 4.21096, 1.18498}, +{63.2908, 4.21910, 1.16381}, +{64.3145, 4.22582, 1.14301}, +{65.3547, 4.23161, 1.12258}, +{66.4118, 4.23666, 1.10252}, +{67.4859, 4.24111, 1.08282}, +{68.5775, 4.24504, 1.06347}, +{69.6867, 4.24852, 1.04447}, +{70.8138, 4.25160, 1.02580}, +{71.9591, 4.25430, 1.00747}, +{73.1230, 4.25667, 0.989470}, +{74.3057, 4.25872, 0.971788}, +{75.5076, 4.26047, 0.954423}, +{76.7289, 4.26194, 0.937369}, +{77.9699, 4.26314, 0.920617}, +{79.2310, 4.26408, 0.904167}, +{80.5125, 4.26478, 0.888009}, +{81.8147, 4.26524, 0.872141}, +{83.1380, 4.26546, 0.856556}, +{84.4827, 4.26547, 0.841250}, +{85.8491, 4.26525, 0.826217}, +{87.2377, 4.26481, 0.811453}, +{88.6487, 4.26417, 0.796952}, +{90.0825, 4.26332, 0.782711}, +{91.5395, 4.26226, 0.768724}, +{93.0201, 4.26100, 0.754987}, +{94.5246, 4.25953, 0.741496}, +{96.0535, 4.25787, 0.728246}, +{97.6071, 4.25600, 0.715232}, +{99.1858, 4.25393, 0.702451}, +{100.790, 4.25166, 0.689898}, +{102.420, 4.24919, 0.677570}, +{104.077, 4.24651, 0.665462}, +{105.760, 4.24363, 0.653570}, +{107.471, 4.24054, 0.641891}, +{109.209, 4.23724, 0.630421}, +{110.975, 4.23373, 0.619156}, +{112.770, 4.23000, 0.608091}, +{114.594, 4.22606, 0.597224}, +{116.448, 4.22189, 0.586552}, +{118.331, 4.21751, 0.576071}, +{120.245, 4.21289, 0.565777}, +{122.190, 4.20806, 0.555666}, +{124.166, 4.20299, 0.545737}, +{126.175, 4.19772, 0.535985}, +{128.215, 4.19225, 0.526406}, +{130.289, 4.18666, 0.517000}, +{132.397, 4.18122, 0.507761}, +{134.538, 4.17533, 0.497457}, +{136.714, 4.16860, 0.487361}, +{138.925, 4.16122, 0.477469}, +{141.172, 4.15329, 0.467777}, +{143.456, 4.14484, 0.458283}, +{145.776, 4.13587, 0.448981}, +{148.134, 4.12638, 0.439868}, +{150.530, 4.11636, 0.430941}, +{152.964, 4.10578, 0.422193}, +{155.439, 4.09464, 0.413624}, +{157.953, 4.08290, 0.405229}, +{160.507, 4.07054, 0.397004}, +{163.103, 4.05754, 0.388946}, +{165.742, 4.04385, 0.381052}, +{168.422, 4.02945, 0.373318}, +{171.146, 4.01429, 0.365741}, +{173.915, 3.99834, 0.358317}, +{176.727, 3.98158, 0.351045}, +{179.586, 3.96398, 0.343919}, +{182.491, 3.94558, 0.336939}, +{185.442, 3.92716, 0.330100}, +{188.442, 3.90705, 0.320995}, +{191.489, 3.88443, 0.312096}, +{194.587, 3.85977, 0.303443}, +{197.734, 3.83308, 0.295031}, +{200.932, 3.80428, 0.286851}, +{204.182, 3.77323, 0.278898}, +{207.485, 3.73972, 0.271166}, +{210.840, 3.70351, 0.263648}, +{214.251, 3.66428, 0.256338}, +{217.716, 3.62164, 0.249231}, +{221.237, 3.57499, 0.242516}, +{224.816, 3.52435, 0.236381}, +{228.452, 3.46902, 0.230402}, +{232.147, 3.40812, 0.224573}, +{235.902, 3.34061, 0.218892}, +{239.717, 3.26522, 0.213355}, +{243.595, 3.18027, 0.207958}, +{247.535, 3.08474, 0.202179}, +{251.538, 2.97293, 0.194683}, +{255.607, 2.84002, 0.187465}, +{259.741, 2.67985, 0.180514}, +{263.942, 2.48138, 0.173821}, +{268.211, 2.22505, 0.167377}, +{272.549, 1.87159, 0.161171}, +{276.957, 1.32192, 0.155195}, +{281.437, 0.158573, 0.149441}, +{284.100, -4.04882, 0.146163}, +{284.300, -4.04031, 4.18872}, +{285.989, -0.283330, 4.15857}, +{290.615, 1.43967, 4.07798}, +{295.315, 2.20576, 3.99896}, +{300.092, 2.71286, 3.92146}, +{304.945, 3.09475, 3.84546}, +{309.878, 3.40186, 3.77095}, +{314.890, 3.65884, 3.69787}, +{319.983, 3.87969, 3.62620}, +{325.158, 4.07315, 3.55593}, +{330.418, 4.24510, 3.48703}, +{335.762, 4.39967, 3.41945}, +{341.192, 4.53993, 3.35318}, +{346.711, 4.66823, 3.28820}, +{352.319, 4.78642, 3.22448}, +{358.017, 4.89606, 3.16200}, +{363.808, 4.99852, 3.10072}, +{369.692, 5.09524, 3.04063}, +{375.672, 5.18910, 2.98170}, +{381.748, 5.27926, 2.91649}, +{387.922, 5.36049, 2.84817}, +{394.197, 5.43267, 2.78144}, +{400.573, 5.49897, 2.71628}, +{407.052, 5.56010, 2.65264}, +{413.635, 5.61669, 2.59050}, +{420.326, 5.66920, 2.52981}, +{427.124, 5.71803, 2.47054}, +{434.032, 5.76351, 2.41266}, +{441.052, 5.80593, 2.35614}, +{448.186, 5.84557, 2.30094}, +{455.435, 5.88264, 2.24703}, +{462.802, 5.91737, 2.19439}, +{470.287, 5.94998, 2.14298}, +{477.894, 5.98074, 2.09278}, +{485.623, 6.01022, 2.04367}, +{493.478, 6.03767, 1.99418}, +{501.459, 6.06268, 1.94589}, +{509.570, 6.08579, 1.89876}, +{517.812, 6.10721, 1.85278}, +{526.187, 6.12709, 1.80791}, +{534.698, 6.14556, 1.76412}, +{543.346, 6.16271, 1.72140}, +{552.134, 6.17864, 1.67971}, +{561.065, 6.19344, 1.63903}, +{570.139, 6.20717, 1.59933}, +{579.361, 6.21992, 1.56060}, +{588.732, 6.23174, 1.52281}, +{598.254, 6.24271, 1.48593}, +{607.930, 6.25287, 1.44994}, +{617.763, 6.26227, 1.41483}, +{627.755, 6.27097, 1.38056}, +{637.908, 6.27900, 1.34713}, +{648.226, 6.28639, 1.31450}, +{658.711, 6.29312, 1.28267}, +{669.365, 6.29901, 1.25160}, +{680.191, 6.30406, 1.22249}, +{691.193, 6.30972, 1.19523}, +{702.372, 6.31822, 1.16897}, +{713.733, 6.32783, 1.13958}, +{725.277, 6.33449, 1.10844}, +{737.008, 6.33933, 1.07816}, +{748.928, 6.34306, 1.04871}, +{761.042, 6.34594, 1.02006}, +{773.351, 6.34813, 0.992182}, +{785.859, 6.34973, 0.965046}, +{798.570, 6.35080, 0.938635}, +{811.486, 6.35140, 0.912939}, +{824.611, 6.35160, 0.887954}, +{837.949, 6.35148, 0.863661}, +{851.502, 6.35111, 0.839923}, +{865.274, 6.35042, 0.816714}, +{879.269, 6.34934, 0.794041}, +{893.491, 6.34793, 0.772006}, +{907.943, 6.34628, 0.750584}, +{922.628, 6.34445, 0.729761}, +{937.551, 6.34244, 0.709358}, +{952.715, 6.34016, 0.689500}, +{968.124, 6.33768, 0.670177}, +{983.783, 6.33503, 0.651378}, +{999.695, 6.33222, 0.633116}, +{1015.86, 6.32930, 0.615377}, +{1032.29, 6.32643, 0.598194}, +{1048.99, 6.32362, 0.581226}, +{1065.96, 6.32048, 0.564459}, +{1083.20, 6.31710, 0.548198}, +{1100.72, 6.31359, 0.532391}, +{1118.52, 6.30996, 0.517020}, +{1136.61, 6.30622, 0.502116}, +{1155.00, 6.30242, 0.487640}, +{1173.68, 6.29857, 0.473579}, +{1192.66, 6.29469, 0.459933}, +{1211.95, 6.29081, 0.446675}, +{1231.55, 6.28694, 0.433794}, +{1251.47, 6.28313, 0.421175}, +{1271.72, 6.27931, 0.408804}, +{1292.29, 6.27534, 0.396652}, +{1313.19, 6.27127, 0.384872}, +{1334.43, 6.26716, 0.373439}, +{1356.01, 6.26302, 0.362342}, +{1377.94, 6.25886, 0.351578}, +{1400.23, 6.25469, 0.341132}, +{1422.88, 6.25054, 0.330994}, +{1445.89, 6.24640, 0.321159}, +{1469.28, 6.24230, 0.311605}, +{1493.04, 6.23822, 0.302316}, +{1517.19, 6.23418, 0.293230}, +{1541.73, 6.23010, 0.284407}, +{1566.67, 6.22604, 0.275847}, +{1592.01, 6.22200, 0.267545}, +{1617.76, 6.21798, 0.259493}, +{1643.92, 6.21400, 0.251684}, +{1670.51, 6.21005, 0.244110}, +{1697.53, 6.20616, 0.236764}, +{1724.99, 6.20233, 0.229642}, +{1752.89, 6.19857, 0.222665}, +{1781.24, 6.19480, 0.215877}, +{1810.05, 6.19106, 0.209279}, +{1839.32, 6.18734, 0.202884}, +{1869.07, 6.18366, 0.196685}, +{1899.30, 6.18003, 0.190676}, +{1930.02, 6.17643, 0.184850}, +{1961.24, 6.17288, 0.179202}, +{1992.96, 6.16938, 0.173726}, +{2025.20, 6.16594, 0.168474}, +{2057.95, 6.16261, 0.163292}, +{2091.24, 6.15928, 0.158263}, +{2125.06, 6.15600, 0.153384}, +{2159.43, 6.15276, 0.148648}, +{2194.36, 6.14957, 0.144053}, +{2229.85, 6.14643, 0.139593}, +{2265.92, 6.14334, 0.135267}, +{2302.57, 6.14028, 0.131069}, +{2339.81, 6.13729, 0.126998}, +{2377.66, 6.13433, 0.123042}, +{2416.11, 6.13143, 0.119210}, +{2455.19, 6.12857, 0.115492}, +{2494.90, 6.12576, 0.111882}, +{2535.26, 6.12300, 0.108383}, +{2576.26, 6.12028, 0.104990}, +{2617.93, 6.11762, 0.101694}, +{2660.27, 6.11500, 0.985042E-01}, +{2703.30, 6.11243, 0.954028E-01}, +{2747.03, 6.10990, 0.923971E-01}, +{2791.46, 6.10742, 0.894832E-01}, +{2836.61, 6.10498, 0.866617E-01}, +{2882.49, 6.10259, 0.839148E-01}, +{2929.11, 6.10024, 0.812599E-01}, +{2976.48, 6.09794, 0.786821E-01}, +{3024.63, 6.09569, 0.761825E-01}, +{3073.55, 6.09347, 0.737584E-01}, +{3123.26, 6.09130, 0.714080E-01}, +{3173.78, 6.08917, 0.691288E-01}, +{3225.11, 6.08708, 0.669194E-01}, +{3277.27, 6.08503, 0.647767E-01}, +{3330.28, 6.08302, 0.626991E-01}, +{3384.15, 6.08105, 0.606853E-01}, +{3438.88, 6.07912, 0.587327E-01}, +{3494.50, 6.07723, 0.568396E-01}, +{3551.02, 6.07538, 0.550042E-01}, +{3608.46, 6.07357, 0.532244E-01}, +{3666.82, 6.07179, 0.514997E-01}, +{3726.13, 6.07005, 0.498278E-01}, +{3786.40, 6.06834, 0.482071E-01}, +{3847.64, 6.06667, 0.466352E-01}, +{3909.87, 6.06504, 0.451127E-01}, +{3973.11, 6.06343, 0.436367E-01}, +{4037.38, 6.06186, 0.422212E-01}, +{4102.68, 6.06033, 0.408351E-01}, +{4169.03, 6.05883, 0.394919E-01}, +{4236.46, 6.05736, 0.381921E-01}, +{4304.98, 6.05592, 0.369324E-01}, +{4374.62, 6.05451, 0.357130E-01}, +{4445.37, 6.05313, 0.345329E-01}, +{4517.27, 6.05178, 0.333896E-01}, +{4590.33, 6.05046, 0.322825E-01}, +{4664.58, 6.04917, 0.312100E-01}, +{4740.03, 6.04791, 0.301723E-01}, +{4816.69, 6.04667, 0.291678E-01}, +{4894.60, 6.04547, 0.281953E-01}, +{4973.77, 6.04429, 0.272539E-01}, +{5054.21, 6.04313, 0.263428E-01}, +{5135.96, 6.04200, 0.254606E-01}, +{5219.03, 6.04090, 0.246074E-01}, +{5303.44, 6.03983, 0.237810E-01}, +{5389.22, 6.03877, 0.229809E-01}, +{5476.39, 6.03774, 0.222063E-01}, +{5564.97, 6.03674, 0.214569E-01}, +{5654.98, 6.03576, 0.207329E-01}, +{5746.44, 6.03480, 0.200314E-01}, +{5839.39, 6.03386, 0.193522E-01}, +{5933.83, 6.03295, 0.186948E-01}, +{6029.81, 6.03205, 0.180595E-01}, +{6127.33, 6.03118, 0.174453E-01}, +{6226.44, 6.03033, 0.168501E-01}, +{6327.15, 6.02950, 0.162746E-01}, +{6429.48, 6.02869, 0.157180E-01}, +{6533.48, 6.02789, 0.151795E-01}, +{6639.15, 6.02712, 0.146587E-01}, +{6746.54, 6.02637, 0.141549E-01}, +{6855.65, 6.02563, 0.136678E-01}, +{6966.54, 6.02491, 0.131966E-01}, +{7079.22, 6.02421, 0.127407E-01}, +{7193.72, 6.02352, 0.123000E-01}, +{7310.07, 6.02285, 0.118738E-01}, +{7428.31, 6.02220, 0.114619E-01}, +{7548.45, 6.02156, 0.110634E-01}, +{7670.54, 6.02094, 0.106782E-01}, +{7794.61, 6.02034, 0.103059E-01}, +{7920.68, 6.01975, 0.994583E-02}, +{8048.79, 6.01917, 0.959775E-02}, +{8178.98, 6.01861, 0.926134E-02}, +{8311.26, 6.01806, 0.893624E-02}, +{8445.69, 6.01753, 0.862190E-02}, +{8582.29, 6.01700, 0.831820E-02}, +{8721.11, 6.01650, 0.802475E-02}, +{8862.16, 6.01600, 0.774104E-02}, +{9005.50, 6.01552, 0.746686E-02}, +{9151.16, 6.01505, 0.720204E-02}, +{9299.17, 6.01459, 0.694614E-02}, +{9449.58, 6.01414, 0.669902E-02}, +{9602.42, 6.01370, 0.646026E-02}, +{9757.73, 6.01328, 0.622938E-02}, +{9915.55, 6.01286, 0.600659E-02}, +{10075.9, 6.01246, 0.579136E-02}, +{10238.9, 6.01206, 0.558350E-02}, +{10404.5, 6.01168, 0.538276E-02}, +{10572.8, 6.01131, 0.518891E-02}, +{10743.8, 6.01094, 0.500173E-02}, +{10917.6, 6.01059, 0.482101E-02}, +{11094.2, 6.01024, 0.464654E-02}, +{11273.6, 6.00991, 0.447810E-02}, +{11455.9, 6.00958, 0.431552E-02}, +{11641.2, 6.00926, 0.415859E-02}, +{11829.5, 6.00895, 0.400712E-02}, +{12020.8, 6.00864, 0.386096E-02}, +{12215.3, 6.00835, 0.371991E-02}, +{12412.8, 6.00806, 0.358382E-02}, +{12613.6, 6.00778, 0.345251E-02}, +{12817.6, 6.00751, 0.332584E-02}, +{13025.0, 6.00724, 0.320365E-02}, +{13235.6, 6.00698, 0.308580E-02}, +{13449.7, 6.00673, 0.297213E-02}, +{13667.2, 6.00648, 0.286252E-02}, +{13888.3, 6.00625, 0.275683E-02}, +{14112.9, 6.00601, 0.265492E-02}, +{14341.2, 6.00579, 0.255668E-02}, +{14573.1, 6.00557, 0.246198E-02}, +{14808.9, 6.00535, 0.237071E-02}, +{15048.4, 6.00514, 0.228275E-02}, +{15291.8, 6.00494, 0.219799E-02}, +{15539.1, 6.00474, 0.211632E-02}, +{15790.4, 6.00455, 0.203764E-02}, +{16045.8, 6.00436, 0.196186E-02}, +{16305.4, 6.00418, 0.188887E-02}, +{16569.1, 6.00400, 0.181858E-02}, +{16837.1, 6.00383, 0.175089E-02}, +{17109.4, 6.00366, 0.168574E-02}, +{17386.1, 6.00350, 0.162301E-02}, +{17667.4, 6.00334, 0.156265E-02}, +{17953.1, 6.00319, 0.150455E-02}, +{18243.5, 6.00304, 0.144866E-02}, +{18538.6, 6.00289, 0.139489E-02}, +{18838.4, 6.00275, 0.134317E-02}, +{19143.1, 6.00261, 0.129343E-02}, +{19452.7, 6.00248, 0.124561E-02}, +{19767.4, 6.00235, 0.119964E-02}, +{20087.1, 6.00222, 0.116295E-02}, +{20412.0, 6.00211, 0.111818E-02}, +{20742.1, 6.00199, 0.107519E-02}, +{21077.6, 6.00187, 0.103391E-02}, +{21418.5, 6.00176, 0.994268E-03}, +{21765.0, 6.00165, 0.956195E-03}, +{22117.0, 6.00154, 0.919629E-03}, +{22474.7, 6.00144, 0.884508E-03}, +{22838.2, 6.00134, 0.850771E-03}, +{23207.6, 6.00124, 0.818364E-03}, +{23583.0, 6.00115, 0.787230E-03}, +{23964.4, 6.00105, 0.757320E-03}, +{24352.0, 6.00096, 0.728582E-03}, +{24745.9, 6.00088, 0.700971E-03}, +{25146.2, 6.00079, 0.674438E-03}, +{25552.9, 6.00071, 0.648942E-03}, +{25966.2, 6.00063, 0.624439E-03}, +{26386.1, 6.00055, 0.600890E-03}, +{26812.9, 6.00048, 0.578257E-03}, +{27246.6, 6.00040, 0.556501E-03}, +{27687.3, 6.00033, 0.535590E-03}, +{28135.1, 6.00026, 0.515487E-03}, +{28590.2, 6.00020, 0.496161E-03}, +{29052.6, 6.00013, 0.477581E-03}, +{29522.5, 6.00007, 0.459716E-03}, +{30000.0, 6.00000, 0.442540E-03}, +{0, 0, 0} +}; + +e_fp_fdp n[] = { /* Z = 7 */ +{10.0000, -9999.00, 0.677847}, +{10.1617, -9999.00, 0.689631}, +{10.3261, -9999.00, 0.701620}, +{10.4931, -9999.00, 0.713817}, +{10.6628, -9999.00, 0.726227}, +{10.8353, -9999.00, 0.738852}, +{11.0106, -9999.00, 0.751697}, +{11.1886, -9999.00, 0.765839}, +{11.3696, -9999.00, 0.786026}, +{11.5535, -9999.00, 0.806743}, +{11.7404, -9999.00, 0.828008}, +{11.9303, -9999.00, 0.849833}, +{12.1232, -9999.00, 0.872233}, +{12.3193, -9999.00, 0.895223}, +{12.5186, -9999.00, 0.919280}, +{12.7210, -9999.00, 0.954622}, +{12.9268, -9999.00, 0.991323}, +{13.1359, -9999.00, 1.02943}, +{13.3483, -9999.00, 1.06901}, +{13.5642, -9999.00, 1.11011}, +{13.7836, -9999.00, 1.15279}, +{14.0066, -9999.00, 1.22432}, +{14.2331, -9999.00, 1.30424}, +{14.4633, -9999.00, 1.38938}, +{14.6973, -9999.00, 1.48008}, +{14.9350, -9999.00, 1.57670}, +{15.1765, -9999.00, 1.68655}, +{15.4220, -9999.00, 1.80625}, +{15.6714, -9999.00, 1.93445}, +{15.9249, -9999.00, 2.07175}, +{16.1825, -9999.00, 2.21879}, +{16.4442, -9999.00, 2.37627}, +{16.7102, -9999.00, 2.54492}, +{16.9805, -9999.00, 2.68091}, +{17.2551, -9999.00, 2.82044}, +{17.5342, -9999.00, 2.96724}, +{17.8178, -9999.00, 3.12169}, +{18.1060, -9999.00, 3.28417}, +{18.3989, -9999.00, 3.45511}, +{18.6964, -9999.00, 3.63494}, +{18.9988, -9999.00, 3.79196}, +{19.3061, -9999.00, 3.94069}, +{19.6184, -9999.00, 4.09526}, +{19.9357, -9999.00, 4.25588}, +{20.2582, -9999.00, 4.42281}, +{20.5858, -9999.00, 4.54192}, +{20.9188, -9999.00, 4.62172}, +{21.2571, -9999.00, 4.70292}, +{21.6009, -9999.00, 4.78554}, +{21.9503, -9999.00, 4.86963}, +{22.3053, -9999.00, 4.92315}, +{22.6661, -9999.00, 4.94757}, +{23.0327, -9999.00, 4.97211}, +{23.4053, -9999.00, 4.99678}, +{23.7838, -9999.00, 5.02156}, +{24.1685, -9999.00, 5.02138}, +{24.5594, -9999.00, 4.99215}, +{24.9566, -9999.00, 4.96309}, +{25.3603, -9999.00, 4.93420}, +{25.7705, -9999.00, 4.90547}, +{26.1873, -9999.00, 4.87692}, +{26.6109, -9999.00, 4.84853}, +{27.0413, -9999.00, 4.82030}, +{27.4786, -9999.00, 4.77252}, +{27.9231, -9999.00, 4.69687}, +{28.3747, -9999.00, 4.62241}, +{28.8337, -9999.00, 4.54913}, +{29.3000, 3.09670, 4.47701}, +{29.7739, 3.18574, 4.40604}, +{30.2555, 3.26861, 4.33619}, +{30.7449, 3.34589, 4.26745}, +{31.2421, 3.41793, 4.19980}, +{31.7475, 3.48497, 4.13322}, +{32.2609, 3.54521, 4.06770}, +{32.7827, 3.60004, 4.00711}, +{33.3130, 3.65406, 3.95223}, +{33.8518, 3.70766, 3.89810}, +{34.3993, 3.75942, 3.84471}, +{34.9557, 3.80887, 3.79205}, +{35.5211, 3.85551, 3.74012}, +{36.0956, 3.89834, 3.68889}, +{36.6794, 3.93428, 3.63837}, +{37.2000, 3.93988, 3.59457}, +{37.4000, 3.95594, 3.64104}, +{37.8755, 4.02773, 3.60150}, +{38.4882, 4.08710, 3.55191}, +{39.1107, 4.13881, 3.50300}, +{39.7432, 4.18663, 3.45476}, +{40.3861, 4.23179, 3.40719}, +{41.0393, 4.27486, 3.36027}, +{41.7031, 4.31619, 3.31400}, +{42.3776, 4.35601, 3.26836}, +{43.0630, 4.39451, 3.22336}, +{43.7595, 4.43188, 3.17897}, +{44.4673, 4.46832, 3.13520}, +{45.1865, 4.50400, 3.09203}, +{45.9174, 4.54124, 3.04945}, +{46.6600, 4.57806, 3.00283}, +{47.4147, 4.61022, 2.95442}, +{48.1816, 4.63910, 2.90678}, +{48.9609, 4.66531, 2.85992}, +{49.7528, 4.68891, 2.81381}, +{50.5576, 4.70963, 2.76844}, +{51.3753, 4.72672, 2.72381}, +{52.2062, 4.73743, 2.67989}, +{53.0506, 4.72873, 2.63668}, +{53.9087, 4.74381, 2.65841}, +{54.7806, 4.79551, 2.63101}, +{55.6667, 4.82377, 2.59803}, +{56.5670, 4.85174, 2.56546}, +{57.4820, 4.87868, 2.53328}, +{58.4117, 4.90536, 2.50150}, +{59.3564, 4.93244, 2.46913}, +{60.3165, 4.95892, 2.43557}, +{61.2921, 4.98466, 2.40164}, +{62.2834, 5.00922, 2.36630}, +{63.2908, 5.03169, 2.33146}, +{64.3145, 5.05325, 2.29710}, +{65.3547, 5.07398, 2.26327}, +{66.4118, 5.09412, 2.22997}, +{67.4859, 5.11385, 2.19716}, +{68.5775, 5.13350, 2.16482}, +{69.6867, 5.15315, 2.13196}, +{70.8138, 5.17222, 2.09899}, +{71.9591, 5.19044, 2.06521}, +{73.1230, 5.20726, 2.03172}, +{74.3057, 5.22311, 1.99878}, +{75.5076, 5.23827, 1.96635}, +{76.7289, 5.25289, 1.93446}, +{77.9699, 5.26721, 1.90309}, +{79.2310, 5.28116, 1.87156}, +{80.5125, 5.29458, 1.84053}, +{81.8147, 5.30767, 1.80919}, +{83.1380, 5.31977, 1.77788}, +{84.4827, 5.33090, 1.74711}, +{85.8491, 5.34142, 1.71687}, +{87.2377, 5.35147, 1.68715}, +{88.6487, 5.36108, 1.65784}, +{90.0825, 5.37030, 1.62891}, +{91.5395, 5.37913, 1.60031}, +{93.0201, 5.38740, 1.57190}, +{94.5246, 5.39514, 1.54400}, +{96.0535, 5.40250, 1.51661}, +{97.6071, 5.40957, 1.48969}, +{99.1858, 5.41689, 1.46326}, +{100.790, 5.42415, 1.43628}, +{102.420, 5.43019, 1.40887}, +{104.077, 5.43530, 1.38222}, +{105.760, 5.43994, 1.35606}, +{107.471, 5.44406, 1.33039}, +{109.209, 5.44773, 1.30519}, +{110.975, 5.45099, 1.28048}, +{112.770, 5.45389, 1.25624}, +{114.594, 5.45644, 1.23245}, +{116.448, 5.45866, 1.20914}, +{118.331, 5.46061, 1.18627}, +{120.245, 5.46230, 1.16381}, +{122.190, 5.46373, 1.14177}, +{124.166, 5.46493, 1.12014}, +{126.175, 5.46595, 1.09894}, +{128.215, 5.46695, 1.07815}, +{130.289, 5.46801, 1.05760}, +{132.397, 5.46877, 1.03651}, +{134.538, 5.46881, 1.01582}, +{136.714, 5.46841, 0.995549}, +{138.925, 5.46766, 0.975693}, +{141.172, 5.46663, 0.956241}, +{143.456, 5.46534, 0.937174}, +{145.776, 5.46382, 0.918471}, +{148.134, 5.46208, 0.900155}, +{150.530, 5.46020, 0.882212}, +{152.964, 5.45820, 0.864610}, +{155.439, 5.45616, 0.847362}, +{157.953, 5.45421, 0.830458}, +{160.507, 5.45304, 0.813567}, +{163.103, 5.45202, 0.795548}, +{165.742, 5.44957, 0.776260}, +{168.422, 5.44577, 0.757438}, +{171.146, 5.44112, 0.739074}, +{173.915, 5.43580, 0.721154}, +{176.727, 5.42989, 0.703670}, +{179.586, 5.42343, 0.686608}, +{182.491, 5.41647, 0.669961}, +{185.442, 5.40903, 0.653718}, +{188.442, 5.40111, 0.637868}, +{191.489, 5.39274, 0.622402}, +{194.587, 5.38392, 0.607312}, +{197.734, 5.37465, 0.592587}, +{200.932, 5.36494, 0.578219}, +{204.182, 5.35477, 0.564200}, +{207.485, 5.34415, 0.550521}, +{210.840, 5.33308, 0.537173}, +{214.251, 5.32155, 0.524149}, +{217.716, 5.30957, 0.511440}, +{221.237, 5.29733, 0.498997}, +{224.816, 5.28450, 0.486268}, +{228.452, 5.27067, 0.473865}, +{232.147, 5.25612, 0.461778}, +{235.902, 5.24084, 0.449999}, +{239.717, 5.22480, 0.438521}, +{243.595, 5.20796, 0.427335}, +{247.535, 5.19029, 0.416435}, +{251.538, 5.17175, 0.405812}, +{255.607, 5.15227, 0.395461}, +{259.741, 5.13178, 0.385374}, +{263.942, 5.11023, 0.375544}, +{268.211, 5.08753, 0.365965}, +{272.549, 5.06357, 0.356630}, +{276.957, 5.03826, 0.347533}, +{281.437, 5.01147, 0.338668}, +{285.989, 4.98307, 0.330030}, +{290.615, 4.95292, 0.321611}, +{295.315, 4.92083, 0.313408}, +{300.092, 4.88664, 0.305413}, +{304.945, 4.85017, 0.297623}, +{309.878, 4.81152, 0.290032}, +{314.890, 4.77024, 0.280969}, +{319.983, 4.72420, 0.271097}, +{325.158, 4.67285, 0.261571}, +{330.418, 4.61616, 0.252380}, +{335.762, 4.55339, 0.243512}, +{341.192, 4.48353, 0.234956}, +{346.711, 4.40525, 0.226700}, +{352.319, 4.31681, 0.218734}, +{358.017, 4.21577, 0.211049}, +{363.808, 4.09877, 0.203644}, +{369.692, 3.96099, 0.196614}, +{375.672, 3.79504, 0.189827}, +{381.748, 3.58874, 0.183275}, +{387.922, 3.32035, 0.176948}, +{394.197, 2.94481, 0.170840}, +{400.573, 2.34175, 0.164943}, +{407.052, 0.902755, 0.159249}, +{409.800, -3.34729, 0.156919}, +{410.000, -3.34070, 4.19145}, +{413.635, 1.37475, 4.14308}, +{420.326, 2.76993, 4.05657}, +{427.124, 3.47180, 3.97187}, +{434.032, 3.95030, 3.88894}, +{441.052, 4.31518, 3.80774}, +{448.186, 4.61038, 3.72824}, +{455.435, 4.85808, 3.65039}, +{462.802, 5.07115, 3.57417}, +{470.287, 5.25773, 3.49954}, +{477.894, 5.42335, 3.42648}, +{485.623, 5.57192, 3.35493}, +{493.478, 5.70635, 3.28488}, +{501.459, 5.82888, 3.21629}, +{509.570, 5.94124, 3.14914}, +{517.812, 6.04487, 3.08339}, +{526.187, 6.14095, 3.01901}, +{534.698, 6.23051, 2.95597}, +{543.346, 6.31452, 2.89425}, +{552.134, 6.39405, 2.83382}, +{561.065, 6.47106, 2.77465}, +{570.139, 6.54609, 2.71065}, +{579.361, 6.61317, 2.64396}, +{588.732, 6.67262, 2.57890}, +{598.254, 6.72717, 2.51545}, +{607.930, 6.77737, 2.45355}, +{617.763, 6.82373, 2.39319}, +{627.755, 6.86664, 2.33430}, +{637.908, 6.90643, 2.27687}, +{648.226, 6.94337, 2.22084}, +{658.711, 6.97771, 2.16620}, +{669.365, 7.00967, 2.11290}, +{680.191, 7.03943, 2.06091}, +{691.193, 7.06718, 2.01021}, +{702.372, 7.09308, 1.96074}, +{713.733, 7.11728, 1.91250}, +{725.277, 7.13995, 1.86544}, +{737.008, 7.16124, 1.81954}, +{748.928, 7.18132, 1.77478}, +{761.042, 7.20082, 1.73111}, +{773.351, 7.21973, 1.68755}, +{785.859, 7.23710, 1.64348}, +{798.570, 7.25230, 1.59980}, +{811.486, 7.26550, 1.55727}, +{824.611, 7.27724, 1.51588}, +{837.949, 7.28754, 1.47559}, +{851.502, 7.29659, 1.43672}, +{865.274, 7.30472, 1.39924}, +{879.269, 7.31226, 1.36305}, +{893.491, 7.31934, 1.32778}, +{907.943, 7.32586, 1.29344}, +{922.628, 7.33212, 1.26000}, +{937.551, 7.33793, 1.22669}, +{952.715, 7.34274, 1.19410}, +{968.124, 7.34685, 1.16223}, +{983.783, 7.35026, 1.13121}, +{999.695, 7.35311, 1.10104}, +{1015.86, 7.35545, 1.07169}, +{1032.29, 7.35753, 1.04340}, +{1048.99, 7.35965, 1.01539}, +{1065.96, 7.36113, 0.987635}, +{1083.20, 7.36187, 0.960644}, +{1100.72, 7.36219, 0.934382}, +{1118.52, 7.36212, 0.908828}, +{1136.61, 7.36171, 0.883967}, +{1155.00, 7.36099, 0.859792}, +{1173.68, 7.36002, 0.836289}, +{1192.66, 7.35885, 0.813426}, +{1211.95, 7.35751, 0.791189}, +{1231.55, 7.35616, 0.769561}, +{1251.47, 7.35479, 0.748220}, +{1271.72, 7.35321, 0.727154}, +{1292.29, 7.35124, 0.706299}, +{1313.19, 7.34877, 0.686031}, +{1334.43, 7.34603, 0.666348}, +{1356.01, 7.34309, 0.647237}, +{1377.94, 7.33996, 0.628640}, +{1400.23, 7.33664, 0.610591}, +{1422.88, 7.33321, 0.593089}, +{1445.89, 7.32971, 0.576061}, +{1469.28, 7.32611, 0.559505}, +{1493.04, 7.32250, 0.543407}, +{1517.19, 7.31883, 0.527586}, +{1541.73, 7.31491, 0.512213}, +{1566.67, 7.31092, 0.497310}, +{1592.01, 7.30688, 0.482831}, +{1617.76, 7.30279, 0.468772}, +{1643.92, 7.29866, 0.455120}, +{1670.51, 7.29452, 0.441867}, +{1697.53, 7.29037, 0.429000}, +{1724.99, 7.28628, 0.416509}, +{1752.89, 7.28224, 0.404201}, +{1781.24, 7.27808, 0.392198}, +{1810.05, 7.27386, 0.380508}, +{1839.32, 7.26959, 0.369169}, +{1869.07, 7.26530, 0.358167}, +{1899.30, 7.26101, 0.347492}, +{1930.02, 7.25672, 0.337134}, +{1961.24, 7.25245, 0.327086}, +{1992.96, 7.24817, 0.317340}, +{2025.20, 7.24396, 0.307997}, +{2057.95, 7.23990, 0.298733}, +{2091.24, 7.23578, 0.289725}, +{2125.06, 7.23167, 0.280975}, +{2159.43, 7.22757, 0.272469}, +{2194.36, 7.22350, 0.264210}, +{2229.85, 7.21945, 0.256185}, +{2265.92, 7.21543, 0.248394}, +{2302.57, 7.21145, 0.240822}, +{2339.81, 7.20750, 0.233471}, +{2377.66, 7.20358, 0.226326}, +{2416.11, 7.19970, 0.219390}, +{2455.19, 7.19586, 0.212656}, +{2494.90, 7.19206, 0.206120}, +{2535.26, 7.18831, 0.199772}, +{2576.26, 7.18459, 0.193608}, +{2617.93, 7.18093, 0.187630}, +{2660.27, 7.17730, 0.181816}, +{2703.30, 7.17372, 0.176182}, +{2747.03, 7.17019, 0.170711}, +{2791.46, 7.16670, 0.165399}, +{2836.61, 7.16327, 0.160250}, +{2882.49, 7.15988, 0.155248}, +{2929.11, 7.15654, 0.150389}, +{2976.48, 7.15324, 0.145680}, +{3024.63, 7.15000, 0.141110}, +{3073.55, 7.14680, 0.136673}, +{3123.26, 7.14365, 0.132370}, +{3173.78, 7.14055, 0.128195}, +{3225.11, 7.13750, 0.124153}, +{3277.27, 7.13451, 0.120219}, +{3330.28, 7.13155, 0.116411}, +{3384.15, 7.12865, 0.112717}, +{3438.88, 7.12579, 0.109134}, +{3494.50, 7.12299, 0.105658}, +{3551.02, 7.12023, 0.102286}, +{3608.46, 7.11752, 0.990161E-01}, +{3666.82, 7.11486, 0.958453E-01}, +{3726.13, 7.11224, 0.927710E-01}, +{3786.40, 7.10967, 0.897890E-01}, +{3847.64, 7.10714, 0.868981E-01}, +{3909.87, 7.10467, 0.840951E-01}, +{3973.11, 7.10224, 0.813777E-01}, +{4037.38, 7.09985, 0.787312E-01}, +{4102.68, 7.09749, 0.761794E-01}, +{4169.03, 7.09518, 0.737062E-01}, +{4236.46, 7.09292, 0.713120E-01}, +{4304.98, 7.09070, 0.689915E-01}, +{4374.62, 7.08853, 0.667440E-01}, +{4445.37, 7.08640, 0.645673E-01}, +{4517.27, 7.08430, 0.624588E-01}, +{4590.33, 7.08226, 0.604167E-01}, +{4664.58, 7.08025, 0.584390E-01}, +{4740.03, 7.07828, 0.565230E-01}, +{4816.69, 7.07635, 0.546688E-01}, +{4894.60, 7.07446, 0.528719E-01}, +{4973.77, 7.07262, 0.511327E-01}, +{5054.21, 7.07081, 0.494484E-01}, +{5135.96, 7.06903, 0.478178E-01}, +{5219.03, 7.06730, 0.462392E-01}, +{5303.44, 7.06560, 0.447096E-01}, +{5389.22, 7.06394, 0.432299E-01}, +{5476.39, 7.06231, 0.417965E-01}, +{5564.97, 7.06072, 0.404085E-01}, +{5654.98, 7.05916, 0.390665E-01}, +{5746.44, 7.05764, 0.377663E-01}, +{5839.39, 7.05615, 0.365079E-01}, +{5933.83, 7.05470, 0.352890E-01}, +{6029.81, 7.05327, 0.341103E-01}, +{6127.33, 7.05188, 0.329685E-01}, +{6226.44, 7.05052, 0.318640E-01}, +{6327.15, 7.04918, 0.307956E-01}, +{6429.48, 7.04788, 0.297618E-01}, +{6533.48, 7.04661, 0.287609E-01}, +{6639.15, 7.04537, 0.277916E-01}, +{6746.54, 7.04415, 0.268536E-01}, +{6855.65, 7.04296, 0.259475E-01}, +{6966.54, 7.04181, 0.250700E-01}, +{7079.22, 7.04067, 0.242218E-01}, +{7193.72, 7.03957, 0.234003E-01}, +{7310.07, 7.03848, 0.226054E-01}, +{7428.31, 7.03743, 0.218367E-01}, +{7548.45, 7.03640, 0.210932E-01}, +{7670.54, 7.03539, 0.203739E-01}, +{7794.61, 7.03441, 0.196782E-01}, +{7920.68, 7.03345, 0.190053E-01}, +{8048.79, 7.03251, 0.183546E-01}, +{8178.98, 7.03159, 0.177251E-01}, +{8311.26, 7.03070, 0.171163E-01}, +{8445.69, 7.02983, 0.165279E-01}, +{8582.29, 7.02898, 0.159585E-01}, +{8721.11, 7.02814, 0.154081E-01}, +{8862.16, 7.02733, 0.148760E-01}, +{9005.50, 7.02654, 0.143614E-01}, +{9151.16, 7.02577, 0.138640E-01}, +{9299.17, 7.02502, 0.133831E-01}, +{9449.58, 7.02428, 0.129181E-01}, +{9602.42, 7.02356, 0.124689E-01}, +{9757.73, 7.02286, 0.120344E-01}, +{9915.55, 7.02218, 0.116146E-01}, +{10075.9, 7.02152, 0.112088E-01}, +{10238.9, 7.02087, 0.108166E-01}, +{10404.5, 7.02023, 0.104376E-01}, +{10572.8, 7.01962, 0.100714E-01}, +{10743.8, 7.01901, 0.971753E-02}, +{10917.6, 7.01843, 0.937560E-02}, +{11094.2, 7.01785, 0.904524E-02}, +{11273.6, 7.01730, 0.872607E-02}, +{11455.9, 7.01675, 0.841776E-02}, +{11641.2, 7.01622, 0.811993E-02}, +{11829.5, 7.01570, 0.783223E-02}, +{12020.8, 7.01520, 0.755438E-02}, +{12215.3, 7.01471, 0.728601E-02}, +{12412.8, 7.01423, 0.702685E-02}, +{12613.6, 7.01376, 0.677659E-02}, +{12817.6, 7.01331, 0.653494E-02}, +{13025.0, 7.01287, 0.630162E-02}, +{13235.6, 7.01243, 0.607636E-02}, +{13449.7, 7.01201, 0.585890E-02}, +{13667.2, 7.01160, 0.564898E-02}, +{13888.3, 7.01120, 0.544636E-02}, +{14112.9, 7.01082, 0.525080E-02}, +{14341.2, 7.01044, 0.506207E-02}, +{14573.1, 7.01007, 0.487994E-02}, +{14808.9, 7.00971, 0.470421E-02}, +{15048.4, 7.00936, 0.453465E-02}, +{15291.8, 7.00902, 0.437107E-02}, +{15539.1, 7.00868, 0.421328E-02}, +{15790.4, 7.00836, 0.406106E-02}, +{16045.8, 7.00805, 0.391426E-02}, +{16305.4, 7.00774, 0.377268E-02}, +{16569.1, 7.00744, 0.363616E-02}, +{16837.1, 7.00715, 0.350453E-02}, +{17109.4, 7.00687, 0.337762E-02}, +{17386.1, 7.00659, 0.325528E-02}, +{17667.4, 7.00632, 0.313736E-02}, +{17953.1, 7.00606, 0.302370E-02}, +{18243.5, 7.00581, 0.291418E-02}, +{18538.6, 7.00556, 0.280864E-02}, +{18838.4, 7.00532, 0.270697E-02}, +{19143.1, 7.00509, 0.260902E-02}, +{19452.7, 7.00486, 0.251467E-02}, +{19767.4, 7.00464, 0.242380E-02}, +{20087.1, 7.00442, 0.233706E-02}, +{20412.0, 7.00422, 0.225277E-02}, +{20742.1, 7.00401, 0.217158E-02}, +{21077.6, 7.00381, 0.209337E-02}, +{21418.5, 7.00362, 0.201803E-02}, +{21765.0, 7.00344, 0.194545E-02}, +{22117.0, 7.00325, 0.187552E-02}, +{22474.7, 7.00308, 0.180815E-02}, +{22838.2, 7.00291, 0.174324E-02}, +{23207.6, 7.00274, 0.168069E-02}, +{23583.0, 7.00258, 0.162043E-02}, +{23964.4, 7.00242, 0.156235E-02}, +{24352.0, 7.00227, 0.150639E-02}, +{24745.9, 7.00212, 0.145246E-02}, +{25146.2, 7.00197, 0.140048E-02}, +{25552.9, 7.00183, 0.135039E-02}, +{25966.2, 7.00170, 0.130212E-02}, +{26386.1, 7.00156, 0.125559E-02}, +{26812.9, 7.00143, 0.121074E-02}, +{27246.6, 7.00131, 0.116751E-02}, +{27687.3, 7.00119, 0.112584E-02}, +{28135.1, 7.00107, 0.108567E-02}, +{28590.2, 7.00095, 0.104695E-02}, +{29052.6, 7.00084, 0.100962E-02}, +{29522.5, 7.00073, 0.973629E-03}, +{30000.0, 7.00063, 0.938934E-03}, +{0, 0, 0} +}; + +e_fp_fdp o[] = { /* Z = 8 */ +{10.0000, -9999.00, 0.703280}, +{10.1617, -9999.00, 0.707226}, +{10.3261, -9999.00, 0.707377}, +{10.4931, -9999.00, 0.707528}, +{10.6628, -9999.00, 0.707678}, +{10.8353, -9999.00, 0.707830}, +{11.0106, -9999.00, 0.707980}, +{11.1886, -9999.00, 0.708131}, +{11.3696, -9999.00, 0.708282}, +{11.5535, -9999.00, 0.708433}, +{11.7404, -9999.00, 0.708584}, +{11.9303, -9999.00, 0.710169}, +{12.1232, -9999.00, 0.712421}, +{12.3193, -9999.00, 0.714680}, +{12.5186, -9999.00, 0.716947}, +{12.7210, -9999.00, 0.719221}, +{12.9268, -9999.00, 0.721502}, +{13.1359, -9999.00, 0.723790}, +{13.3483, -9999.00, 0.726085}, +{13.5642, -9999.00, 0.733640}, +{13.7836, -9999.00, 0.746066}, +{14.0066, -9999.00, 0.758702}, +{14.2331, -9999.00, 0.771553}, +{14.4633, -9999.00, 0.784622}, +{14.6973, -9999.00, 0.801406}, +{14.9350, -9999.00, 0.832915}, +{15.1765, -9999.00, 0.865663}, +{15.4220, -9999.00, 0.899699}, +{15.6714, -9999.00, 0.973496}, +{15.9249, -9999.00, 1.07691}, +{16.1825, -9999.00, 1.19131}, +{16.4442, -9999.00, 1.31787}, +{16.7102, -9999.00, 1.45787}, +{16.9805, -9999.00, 1.61274}, +{17.2551, -9999.00, 1.78407}, +{17.5342, -9999.00, 1.97359}, +{17.8178, -9999.00, 2.19084}, +{18.1060, -9999.00, 2.44589}, +{18.3989, -9999.00, 2.73065}, +{18.6964, -9999.00, 3.04856}, +{18.9988, -9999.00, 3.31541}, +{19.3061, -9999.00, 3.47952}, +{19.6184, -9999.00, 3.65175}, +{19.9357, -9999.00, 3.77879}, +{20.2582, -9999.00, 3.83650}, +{20.5858, -9999.00, 3.89509}, +{20.9188, -9999.00, 3.95457}, +{21.2571, -9999.00, 4.01497}, +{21.6009, -9999.00, 4.07078}, +{21.9503, -9999.00, 4.11386}, +{22.3053, -9999.00, 4.15739}, +{22.6661, -9999.00, 4.20138}, +{23.0327, -9999.00, 4.24585}, +{23.4053, -9999.00, 4.29077}, +{23.7838, -9999.00, 4.33618}, +{24.1685, -9999.00, 4.37108}, +{24.5594, -9999.00, 4.39198}, +{24.9566, -9999.00, 4.41297}, +{25.3603, -9999.00, 4.43407}, +{25.7705, -9999.00, 4.45527}, +{26.1873, -9999.00, 4.47657}, +{26.6109, -9999.00, 4.49797}, +{27.0413, -9999.00, 4.51948}, +{27.4786, -9999.00, 4.54108}, +{27.9231, -9999.00, 4.56280}, +{28.3747, -9999.00, 4.58461}, +{28.8337, -9999.00, 4.60653}, +{29.3000, 1.29108, 4.62855}, +{29.7739, 1.37530, 4.65068}, +{30.2555, 1.45987, 4.67292}, +{30.7449, 1.54500, 4.69526}, +{31.2421, 1.63089, 4.71770}, +{31.7475, 1.71782, 4.74026}, +{32.2609, 1.80604, 4.76292}, +{32.7827, 1.89591, 4.78569}, +{33.3130, 1.98784, 4.80857}, +{33.8518, 2.08240, 4.83156}, +{34.3993, 2.18037, 4.85466}, +{34.9557, 2.28303, 4.87787}, +{35.5211, 2.39360, 4.90119}, +{36.0956, 2.51838, 4.92462}, +{36.6794, 2.65940, 4.90853}, +{37.2727, 2.77356, 4.88177}, +{37.8755, 2.87789, 4.85515}, +{38.4882, 2.97620, 4.82868}, +{39.1107, 3.07020, 4.80235}, +{39.7432, 3.16085, 4.77617}, +{40.3861, 3.24882, 4.75012}, +{41.0393, 3.33461, 4.72423}, +{41.7031, 3.41860, 4.69846}, +{42.3776, 3.50113, 4.67285}, +{43.0630, 3.58251, 4.64737}, +{43.7595, 3.66302, 4.62203}, +{44.4673, 3.74299, 4.59683}, +{45.1865, 3.82277, 4.57176}, +{45.9174, 3.90281, 4.54683}, +{46.6600, 3.98375, 4.52204}, +{47.4147, 4.06668, 4.49738}, +{48.1816, 4.15435, 4.47286}, +{48.9609, 4.25303, 4.43924}, +{49.7528, 4.34278, 4.38530}, +{50.5576, 4.42066, 4.33201}, +{51.3753, 4.49260, 4.27937}, +{52.2062, 4.56033, 4.22737}, +{53.0506, 4.62460, 4.17601}, +{53.9087, 4.68591, 4.12526}, +{54.7806, 4.74464, 4.07514}, +{55.6667, 4.80103, 4.02562}, +{56.5670, 4.85533, 3.97670}, +{57.4820, 4.90769, 3.92838}, +{58.4117, 4.95827, 3.88065}, +{59.3564, 5.00720, 3.83349}, +{60.3165, 5.05457, 3.78691}, +{61.2921, 5.10049, 3.74090}, +{62.2834, 5.14504, 3.69544}, +{63.2908, 5.18829, 3.65054}, +{64.3145, 5.23031, 3.60618}, +{65.3547, 5.27115, 3.56236}, +{66.4118, 5.31086, 3.51907}, +{67.4859, 5.34947, 3.47631}, +{68.5775, 5.38698, 3.43407}, +{69.6867, 5.42322, 3.39234}, +{70.8138, 5.45837, 3.35206}, +{71.9591, 5.49332, 3.31248}, +{73.1230, 5.52779, 3.27336}, +{74.3057, 5.56170, 3.23470}, +{75.5076, 5.59505, 3.19651}, +{76.7289, 5.62788, 3.15877}, +{77.9699, 5.66020, 3.12146}, +{79.2310, 5.69205, 3.08460}, +{80.5125, 5.72347, 3.04818}, +{81.8147, 5.75450, 3.01218}, +{83.1380, 5.78519, 2.97661}, +{84.4827, 5.81559, 2.94146}, +{85.8491, 5.84576, 2.90673}, +{87.2377, 5.87577, 2.87240}, +{88.6487, 5.90572, 2.83848}, +{90.0825, 5.93570, 2.80496}, +{91.5395, 5.96588, 2.77184}, +{93.0201, 5.99646, 2.73911}, +{94.5246, 6.02776, 2.70676}, +{96.0535, 6.06038, 2.67480}, +{97.6071, 6.09575, 2.64321}, +{99.1858, 6.13917, 2.60698}, +{100.790, 6.17528, 2.55821}, +{102.420, 6.20520, 2.51035}, +{104.077, 6.23136, 2.46339}, +{105.760, 6.25498, 2.41730}, +{107.471, 6.27656, 2.37208}, +{109.209, 6.29640, 2.32770}, +{110.975, 6.31474, 2.28416}, +{112.770, 6.33175, 2.24143}, +{114.594, 6.34755, 2.19949}, +{116.448, 6.36224, 2.15834}, +{118.331, 6.37593, 2.11797}, +{120.245, 6.38867, 2.07834}, +{122.190, 6.40053, 2.03946}, +{124.166, 6.41155, 2.00131}, +{126.175, 6.42176, 1.96387}, +{128.215, 6.43119, 1.92713}, +{130.289, 6.43983, 1.89108}, +{132.397, 6.44761, 1.85570}, +{134.538, 6.45377, 1.82102}, +{136.714, 6.45983, 1.78919}, +{138.925, 6.46640, 1.75791}, +{141.172, 6.47299, 1.72717}, +{143.456, 6.47949, 1.69698}, +{145.776, 6.48585, 1.66731}, +{148.134, 6.49207, 1.63816}, +{150.530, 6.49816, 1.60952}, +{152.964, 6.50413, 1.58138}, +{155.439, 6.51001, 1.55374}, +{157.953, 6.51583, 1.52657}, +{160.507, 6.52164, 1.49989}, +{163.103, 6.52749, 1.47366}, +{165.742, 6.53347, 1.44790}, +{168.422, 6.53968, 1.42259}, +{171.146, 6.54628, 1.39772}, +{173.915, 6.55353, 1.37328}, +{176.727, 6.56188, 1.34927}, +{179.586, 6.57285, 1.32568}, +{182.491, 6.59062, 1.29775}, +{185.442, 6.60126, 1.25985}, +{188.442, 6.60656, 1.22306}, +{191.489, 6.60890, 1.18734}, +{194.587, 6.60909, 1.15266}, +{197.734, 6.60756, 1.11900}, +{200.932, 6.60459, 1.08632}, +{204.182, 6.60037, 1.05459}, +{207.485, 6.59504, 1.02379}, +{210.840, 6.58869, 0.993894}, +{214.251, 6.58141, 0.964869}, +{217.716, 6.57324, 0.936690}, +{221.237, 6.56421, 0.909335}, +{224.816, 6.55434, 0.882777}, +{228.452, 6.54358, 0.856997}, +{232.147, 6.53186, 0.831968}, +{235.902, 6.51910, 0.807672}, +{239.717, 6.50289, 0.785141}, +{243.595, 6.48780, 0.767050}, +{247.535, 6.47469, 0.749377}, +{251.538, 6.46187, 0.732111}, +{255.607, 6.44917, 0.715246}, +{259.741, 6.43647, 0.698766}, +{263.942, 6.42370, 0.682666}, +{268.211, 6.41077, 0.666936}, +{272.549, 6.39774, 0.651568}, +{276.957, 6.38453, 0.636390}, +{281.437, 6.37093, 0.621360}, +{285.989, 6.35684, 0.606567}, +{290.615, 6.34223, 0.592106}, +{295.315, 6.32710, 0.577987}, +{300.092, 6.31143, 0.564206}, +{304.945, 6.29521, 0.550756}, +{309.878, 6.27839, 0.537625}, +{314.890, 6.26093, 0.524809}, +{319.983, 6.24279, 0.512296}, +{325.158, 6.22392, 0.500078}, +{330.418, 6.20424, 0.488156}, +{335.762, 6.18372, 0.476518}, +{341.192, 6.16227, 0.465160}, +{346.711, 6.13982, 0.454068}, +{352.319, 6.11627, 0.443240}, +{358.017, 6.09153, 0.432677}, +{363.808, 6.06550, 0.422359}, +{369.692, 6.03805, 0.412287}, +{375.672, 6.00904, 0.402455}, +{381.748, 5.97834, 0.392859}, +{387.922, 5.94581, 0.383399}, +{394.197, 5.91108, 0.373965}, +{400.573, 5.87378, 0.364734}, +{407.052, 5.83371, 0.355718}, +{413.635, 5.79051, 0.346911}, +{420.326, 5.74378, 0.338332}, +{427.124, 5.69301, 0.329966}, +{434.032, 5.63760, 0.321805}, +{441.052, 5.57677, 0.313842}, +{448.186, 5.50955, 0.306078}, +{455.435, 5.43473, 0.298525}, +{462.802, 5.35075, 0.291171}, +{470.287, 5.25548, 0.284004}, +{477.894, 5.14604, 0.277005}, +{485.623, 5.01831, 0.270184}, +{493.478, 4.86623, 0.263535}, +{501.459, 4.68029, 0.257056}, +{509.570, 4.44433, 0.250722}, +{517.812, 4.12757, 0.244542}, +{526.187, 3.65977, 0.238528}, +{534.698, 2.81057, 0.232662}, +{543.000, -2.97417, 0.227165}, +{543.200, -2.96820, 4.41017}, +{543.346, -1.76427, 4.40843}, +{552.134, 3.14873, 4.30605}, +{561.065, 4.13655, 4.20603}, +{570.139, 4.73493, 4.10874}, +{579.361, 5.16768, 4.01631}, +{588.732, 5.50836, 3.92668}, +{598.254, 5.78966, 3.83948}, +{607.930, 6.02905, 3.75417}, +{617.763, 6.23761, 3.67071}, +{627.755, 6.42270, 3.58878}, +{637.908, 6.59031, 3.50519}, +{648.226, 6.74023, 3.41851}, +{658.711, 6.87017, 3.33072}, +{669.365, 6.98234, 3.24518}, +{680.191, 7.07900, 3.17061}, +{691.193, 7.17176, 3.10440}, +{702.372, 7.26537, 3.04097}, +{713.733, 7.35632, 2.97253}, +{725.277, 7.43725, 2.90138}, +{737.008, 7.51096, 2.83210}, +{748.928, 7.57923, 2.76441}, +{761.042, 7.64278, 2.69824}, +{773.351, 7.70301, 2.63299}, +{785.859, 7.75952, 2.56707}, +{798.570, 7.81002, 2.50097}, +{811.486, 7.85560, 2.43656}, +{824.611, 7.89685, 2.37381}, +{837.949, 7.93400, 2.31267}, +{851.502, 7.96689, 2.25490}, +{865.274, 7.99727, 2.20048}, +{879.269, 8.02738, 2.14904}, +{893.491, 8.05676, 2.09880}, +{907.943, 8.08546, 2.04974}, +{922.628, 8.11385, 2.00183}, +{937.551, 8.14164, 1.95125}, +{952.715, 8.16639, 1.90102}, +{968.124, 8.18822, 1.85129}, +{983.783, 8.20773, 1.80284}, +{999.695, 8.22524, 1.75575}, +{1015.86, 8.24110, 1.71001}, +{1032.29, 8.25591, 1.66625}, +{1048.99, 8.27017, 1.62304}, +{1065.96, 8.28286, 1.58035}, +{1083.20, 8.29421, 1.53877}, +{1100.72, 8.30443, 1.49828}, +{1118.52, 8.31363, 1.45885}, +{1136.61, 8.32191, 1.42048}, +{1155.00, 8.32937, 1.38311}, +{1173.68, 8.33606, 1.34671}, +{1192.66, 8.34205, 1.31127}, +{1211.95, 8.34741, 1.27676}, +{1231.55, 8.35226, 1.24316}, +{1251.47, 8.35670, 1.21022}, +{1271.72, 8.36065, 1.17789}, +{1292.29, 8.36377, 1.14609}, +{1313.19, 8.36620, 1.11516}, +{1334.43, 8.36809, 1.08507}, +{1356.01, 8.36949, 1.05579}, +{1377.94, 8.37047, 1.02732}, +{1400.23, 8.37109, 0.999604}, +{1422.88, 8.37136, 0.972611}, +{1445.89, 8.37135, 0.946380}, +{1469.28, 8.37123, 0.920766}, +{1493.04, 8.37088, 0.895701}, +{1517.19, 8.37025, 0.870806}, +{1541.73, 8.36901, 0.846549}, +{1566.67, 8.36742, 0.822997}, +{1592.01, 8.36555, 0.800062}, +{1617.76, 8.36340, 0.777767}, +{1643.92, 8.36104, 0.756111}, +{1670.51, 8.35851, 0.735037}, +{1697.53, 8.35582, 0.714548}, +{1724.99, 8.35305, 0.694627}, +{1752.89, 8.35021, 0.675030}, +{1781.24, 8.34710, 0.655908}, +{1810.05, 8.34378, 0.637270}, +{1839.32, 8.34028, 0.619158}, +{1869.07, 8.33665, 0.601560}, +{1899.30, 8.33291, 0.584462}, +{1930.02, 8.32907, 0.567849}, +{1961.24, 8.32516, 0.551708}, +{1992.96, 8.32116, 0.536027}, +{2025.20, 8.31719, 0.520980}, +{2057.95, 8.31332, 0.506059}, +{2091.24, 8.30931, 0.491524}, +{2125.06, 8.30523, 0.477384}, +{2159.43, 8.30109, 0.463634}, +{2194.36, 8.29692, 0.450251}, +{2229.85, 8.29272, 0.437232}, +{2265.92, 8.28851, 0.424568}, +{2302.57, 8.28427, 0.412245}, +{2339.81, 8.28002, 0.400261}, +{2377.66, 8.27576, 0.388605}, +{2416.11, 8.27151, 0.377269}, +{2455.19, 8.26726, 0.366239}, +{2494.90, 8.26301, 0.355523}, +{2535.26, 8.25878, 0.345085}, +{2576.26, 8.25456, 0.334943}, +{2617.93, 8.25035, 0.325079}, +{2660.27, 8.24617, 0.315489}, +{2703.30, 8.24200, 0.306159}, +{2747.03, 8.23786, 0.297084}, +{2791.46, 8.23375, 0.288266}, +{2836.61, 8.22967, 0.279693}, +{2882.49, 8.22562, 0.271352}, +{2929.11, 8.22161, 0.263238}, +{2976.48, 8.21762, 0.255349}, +{3024.63, 8.21367, 0.247687}, +{3073.55, 8.20976, 0.240232}, +{3123.26, 8.20589, 0.232981}, +{3173.78, 8.20205, 0.225931}, +{3225.11, 8.19826, 0.219077}, +{3277.27, 8.19450, 0.212417}, +{3330.28, 8.19079, 0.205937}, +{3384.15, 8.18711, 0.199644}, +{3438.88, 8.18349, 0.193525}, +{3494.50, 8.17991, 0.187574}, +{3551.02, 8.17636, 0.181787}, +{3608.46, 8.17287, 0.176160}, +{3666.82, 8.16942, 0.170681}, +{3726.13, 8.16599, 0.165363}, +{3786.40, 8.16262, 0.160196}, +{3847.64, 8.15929, 0.155167}, +{3909.87, 8.15601, 0.150282}, +{3973.11, 8.15276, 0.145531}, +{4037.38, 8.14954, 0.140899}, +{4102.68, 8.14635, 0.136421}, +{4169.03, 8.14321, 0.132079}, +{4236.46, 8.14011, 0.127871}, +{4304.98, 8.13705, 0.123789}, +{4374.62, 8.13404, 0.119833}, +{4445.37, 8.13108, 0.115998}, +{4517.27, 8.12816, 0.112280}, +{4590.33, 8.12529, 0.108678}, +{4664.58, 8.12246, 0.105185}, +{4740.03, 8.11969, 0.101800}, +{4816.69, 8.11695, 0.985193E-01}, +{4894.60, 8.11427, 0.953398E-01}, +{4973.77, 8.11163, 0.922592E-01}, +{5054.21, 8.10904, 0.892732E-01}, +{5135.96, 8.10649, 0.863801E-01}, +{5219.03, 8.10400, 0.835779E-01}, +{5303.44, 8.10154, 0.808620E-01}, +{5389.22, 8.09913, 0.782309E-01}, +{5476.39, 8.09677, 0.756813E-01}, +{5564.97, 8.09445, 0.732117E-01}, +{5654.98, 8.09218, 0.708205E-01}, +{5746.44, 8.08995, 0.685040E-01}, +{5839.39, 8.08776, 0.662596E-01}, +{5933.83, 8.08562, 0.640857E-01}, +{6029.81, 8.08351, 0.619792E-01}, +{6127.33, 8.08146, 0.599416E-01}, +{6226.44, 8.07944, 0.579659E-01}, +{6327.15, 8.07746, 0.560545E-01}, +{6429.48, 8.07552, 0.542032E-01}, +{6533.48, 8.07362, 0.524097E-01}, +{6639.15, 8.07176, 0.506725E-01}, +{6746.54, 8.06994, 0.489916E-01}, +{6855.65, 8.06816, 0.473650E-01}, +{6966.54, 8.06642, 0.457894E-01}, +{7079.22, 8.06471, 0.442644E-01}, +{7193.72, 8.06304, 0.427875E-01}, +{7310.07, 8.06140, 0.413582E-01}, +{7428.31, 8.05980, 0.399759E-01}, +{7548.45, 8.05824, 0.386359E-01}, +{7670.54, 8.05670, 0.373402E-01}, +{7794.61, 8.05521, 0.360851E-01}, +{7920.68, 8.05374, 0.348710E-01}, +{8048.79, 8.05231, 0.336980E-01}, +{8178.98, 8.05091, 0.325612E-01}, +{8311.26, 8.04954, 0.314612E-01}, +{8445.69, 8.04820, 0.303967E-01}, +{8582.29, 8.04689, 0.293670E-01}, +{8721.11, 8.04561, 0.283707E-01}, +{8862.16, 8.04436, 0.274070E-01}, +{9005.50, 8.04313, 0.264746E-01}, +{9151.16, 8.04194, 0.255728E-01}, +{9299.17, 8.04077, 0.247005E-01}, +{9449.58, 8.03963, 0.238566E-01}, +{9602.42, 8.03852, 0.230406E-01}, +{9757.73, 8.03743, 0.222513E-01}, +{9915.55, 8.03637, 0.214883E-01}, +{10075.9, 8.03533, 0.207501E-01}, +{10238.9, 8.03432, 0.200363E-01}, +{10404.5, 8.03333, 0.193461E-01}, +{10572.8, 8.03236, 0.186788E-01}, +{10743.8, 8.03142, 0.180336E-01}, +{10917.6, 8.03049, 0.174099E-01}, +{11094.2, 8.02960, 0.168069E-01}, +{11273.6, 8.02872, 0.162240E-01}, +{11455.9, 8.02786, 0.156607E-01}, +{11641.2, 8.02703, 0.151161E-01}, +{11829.5, 8.02621, 0.145898E-01}, +{12020.8, 8.02541, 0.140812E-01}, +{12215.3, 8.02464, 0.135897E-01}, +{12412.8, 8.02388, 0.131147E-01}, +{12613.6, 8.02314, 0.126558E-01}, +{12817.6, 8.02242, 0.122124E-01}, +{13025.0, 8.02172, 0.117841E-01}, +{13235.6, 8.02103, 0.113702E-01}, +{13449.7, 8.02036, 0.109705E-01}, +{13667.2, 8.01971, 0.105844E-01}, +{13888.3, 8.01907, 0.102115E-01}, +{14112.9, 8.01845, 0.985132E-02}, +{14341.2, 8.01785, 0.950352E-02}, +{14573.1, 8.01726, 0.916766E-02}, +{14808.9, 8.01668, 0.884339E-02}, +{15048.4, 8.01612, 0.853030E-02}, +{15291.8, 8.01557, 0.822805E-02}, +{15539.1, 8.01504, 0.793628E-02}, +{15790.4, 8.01452, 0.765465E-02}, +{16045.8, 8.01402, 0.738283E-02}, +{16305.4, 8.01352, 0.712049E-02}, +{16569.1, 8.01304, 0.686735E-02}, +{16837.1, 8.01257, 0.662308E-02}, +{17109.4, 8.01212, 0.638742E-02}, +{17386.1, 8.01167, 0.616006E-02}, +{17667.4, 8.01124, 0.594073E-02}, +{17953.1, 8.01082, 0.572919E-02}, +{18243.5, 8.01041, 0.552516E-02}, +{18538.6, 8.01001, 0.532841E-02}, +{18838.4, 8.00962, 0.513869E-02}, +{19143.1, 8.00924, 0.495577E-02}, +{19452.7, 8.00887, 0.477943E-02}, +{19767.4, 8.00851, 0.460945E-02}, +{20087.1, 8.00816, 0.444652E-02}, +{20412.0, 8.00782, 0.428858E-02}, +{20742.1, 8.00749, 0.413632E-02}, +{21077.6, 8.00717, 0.398954E-02}, +{21418.5, 8.00686, 0.384804E-02}, +{21765.0, 8.00655, 0.371162E-02}, +{22117.0, 8.00626, 0.358009E-02}, +{22474.7, 8.00597, 0.345328E-02}, +{22838.2, 8.00569, 0.333100E-02}, +{23207.6, 8.00541, 0.321310E-02}, +{23583.0, 8.00515, 0.309941E-02}, +{23964.4, 8.00489, 0.298978E-02}, +{24352.0, 8.00464, 0.288407E-02}, +{24745.9, 8.00439, 0.278212E-02}, +{25146.2, 8.00416, 0.268380E-02}, +{25552.9, 8.00393, 0.258899E-02}, +{25966.2, 8.00370, 0.249755E-02}, +{26386.1, 8.00348, 0.240935E-02}, +{26812.9, 8.00327, 0.232429E-02}, +{27246.6, 8.00307, 0.224225E-02}, +{27687.3, 8.00286, 0.216311E-02}, +{28135.1, 8.00267, 0.208678E-02}, +{28590.2, 8.00248, 0.201316E-02}, +{29052.6, 8.00230, 0.194214E-02}, +{29522.5, 8.00212, 0.187363E-02}, +{30000.0, 8.00194, 0.180754E-02}, +{0, 0, 0} +}; + +e_fp_fdp f[] = { /* Z = 9 */ +{10.0000, -9999.00, 0.516473E-01}, +{10.1617, -9999.00, 0.564796E-01}, +{10.3261, -9999.00, 0.617639E-01}, +{10.4931, -9999.00, 0.675427E-01}, +{10.6628, -9999.00, 0.738623E-01}, +{10.8353, -9999.00, 0.807729E-01}, +{11.0106, -9999.00, 0.883303E-01}, +{11.1886, -9999.00, 0.965947E-01}, +{11.3696, -9999.00, 0.108313}, +{11.5535, -9999.00, 0.124621}, +{11.7404, -9999.00, 0.147675}, +{11.9303, -9999.00, 0.182934}, +{12.1232, -9999.00, 0.286819}, +{12.3193, -9999.00, 0.427324}, +{12.5186, -9999.00, 0.526258}, +{12.7210, -9999.00, 0.597229}, +{12.9268, -9999.00, 0.676277}, +{13.1359, -9999.00, 0.758009}, +{13.3483, -9999.00, 0.849618}, +{13.5642, -9999.00, 0.921830}, +{13.7836, -9999.00, 0.987157}, +{14.0066, -9999.00, 1.05711}, +{14.2331, -9999.00, 1.13203}, +{14.4633, -9999.00, 1.21042}, +{14.6973, -9999.00, 1.29408}, +{14.9350, -9999.00, 1.38352}, +{15.1765, -9999.00, 1.47159}, +{15.4220, -9999.00, 1.55088}, +{15.6714, -9999.00, 1.63444}, +{15.9249, -9999.00, 1.72250}, +{16.1825, -9999.00, 1.80568}, +{16.4442, -9999.00, 1.89012}, +{16.7102, -9999.00, 1.97852}, +{16.9805, -9999.00, 2.07103}, +{17.2551, -9999.00, 2.15963}, +{17.5342, -9999.00, 2.25202}, +{17.8178, -9999.00, 2.34836}, +{18.1060, -9999.00, 2.44883}, +{18.3989, -9999.00, 2.54900}, +{18.6964, -9999.00, 2.64222}, +{18.9988, -9999.00, 2.73886}, +{19.3061, -9999.00, 2.83903}, +{19.6184, -9999.00, 2.94287}, +{19.9357, -9999.00, 3.00878}, +{20.2582, -9999.00, 3.07304}, +{20.5858, -9999.00, 3.13868}, +{20.9188, -9999.00, 3.20572}, +{21.2571, -9999.00, 3.27419}, +{21.6009, -9999.00, 3.34589}, +{21.9503, -9999.00, 3.42018}, +{22.3053, -9999.00, 3.49611}, +{22.6661, -9999.00, 3.57373}, +{23.0327, -9999.00, 3.65342}, +{23.4053, -9999.00, 3.73752}, +{23.7838, -9999.00, 3.82355}, +{24.1685, -9999.00, 3.91157}, +{24.5594, -9999.00, 4.00163}, +{24.9566, -9999.00, 4.09386}, +{25.3603, -9999.00, 4.18821}, +{25.7705, -9999.00, 4.28474}, +{26.1873, -9999.00, 4.37975}, +{26.6109, -9999.00, 4.45994}, +{27.0413, -9999.00, 4.54160}, +{27.4786, -9999.00, 4.62477}, +{27.9231, -9999.00, 4.70945}, +{28.3747, -9999.00, 4.78193}, +{28.8337, -9999.00, 4.84730}, +{29.3000, 0.226996, 4.91356}, +{29.7739, 0.384977, 4.95547}, +{30.2555, 0.517012, 4.96088}, +{30.7449, 0.632930, 4.96630}, +{31.2421, 0.741702, 4.97169}, +{31.7475, 0.843041, 4.96961}, +{32.2609, 0.935161, 4.96752}, +{32.7827, 1.01869, 4.96544}, +{33.3130, 1.09087, 4.96877}, +{33.8518, 1.16564, 4.98028}, +{34.3993, 1.24090, 4.99181}, +{34.9557, 1.31432, 5.00336}, +{35.5211, 1.38409, 5.01495}, +{36.0956, 1.44517, 5.03487}, +{36.6794, 1.51571, 5.06402}, +{37.2727, 1.59158, 5.09333}, +{37.8755, 1.67171, 5.12282}, +{38.4882, 1.75846, 5.15247}, +{39.1107, 1.85565, 5.17148}, +{39.7432, 1.94343, 5.18208}, +{40.3861, 2.02685, 5.19270}, +{41.0393, 2.10858, 5.20335}, +{41.7031, 2.18907, 5.21402}, +{42.3776, 2.26852, 5.22471}, +{43.0630, 2.34674, 5.23542}, +{43.7595, 2.42403, 5.24813}, +{44.4673, 2.50254, 5.26164}, +{45.1865, 2.58173, 5.27519}, +{45.9174, 2.66148, 5.28879}, +{46.6600, 2.74181, 5.30241}, +{47.4147, 2.82280, 5.31607}, +{48.1816, 2.90450, 5.32976}, +{48.9609, 2.98703, 5.34349}, +{49.7528, 3.07048, 5.35725}, +{50.5576, 3.15497, 5.37106}, +{51.3753, 3.24062, 5.38489}, +{52.2062, 3.32756, 5.39876}, +{53.0506, 3.41588, 5.41267}, +{53.9087, 3.50572, 5.42661}, +{54.7806, 3.59394, 5.44059}, +{55.6667, 3.66975, 5.47877}, +{56.5670, 3.80894, 5.50844}, +{57.4820, 3.93129, 5.50408}, +{58.4117, 4.04771, 5.49978}, +{59.3564, 4.16932, 5.49039}, +{60.3165, 4.28507, 5.47242}, +{61.2921, 4.40251, 5.45038}, +{62.2834, 4.51175, 5.41870}, +{63.2908, 4.61445, 5.38722}, +{64.3145, 4.71396, 5.35596}, +{65.3547, 4.81148, 5.32485}, +{66.4118, 4.90780, 5.29387}, +{67.4859, 5.00390, 5.26314}, +{68.5775, 5.10210, 5.23266}, +{69.6867, 5.20433, 5.19583}, +{70.8138, 5.30366, 5.15523}, +{71.9591, 5.40026, 5.10646}, +{73.1230, 5.49039, 5.05650}, +{74.3057, 5.57643, 5.00700}, +{75.5076, 5.66011, 4.95790}, +{76.7289, 5.74238, 4.90928}, +{77.9699, 5.82490, 4.86112}, +{79.2310, 5.90640, 4.80893}, +{80.5125, 5.98696, 4.75718}, +{81.8147, 6.06832, 4.70000}, +{83.1380, 6.14317, 4.63995}, +{84.4827, 6.21375, 4.58088}, +{85.8491, 6.28211, 4.52256}, +{87.2377, 6.34916, 4.46501}, +{88.6487, 6.41631, 4.40662}, +{90.0825, 6.48102, 4.34714}, +{91.5395, 6.54638, 4.28615}, +{93.0201, 6.60671, 4.22208}, +{94.5246, 6.66374, 4.15894}, +{96.0535, 6.71854, 4.09670}, +{97.6071, 6.77197, 4.03538}, +{99.1858, 6.82552, 3.97497}, +{100.790, 6.88114, 3.91047}, +{102.420, 6.92943, 3.84210}, +{104.077, 6.97366, 3.77553}, +{105.760, 7.01511, 3.71011}, +{107.471, 7.05418, 3.64583}, +{109.209, 7.09118, 3.58268}, +{110.975, 7.12636, 3.52060}, +{112.770, 7.15983, 3.45959}, +{114.594, 7.19182, 3.39966}, +{116.448, 7.22246, 3.34076}, +{118.331, 7.25186, 3.28287}, +{120.245, 7.28017, 3.22601}, +{122.190, 7.30755, 3.17011}, +{124.166, 7.33412, 3.11517}, +{126.175, 7.36015, 3.06119}, +{128.215, 7.38610, 3.00816}, +{130.289, 7.41380, 2.95521}, +{132.397, 7.43894, 2.89798}, +{134.538, 7.46113, 2.84188}, +{136.714, 7.48123, 2.78686}, +{138.925, 7.49981, 2.73290}, +{141.172, 7.51710, 2.67999}, +{143.456, 7.53325, 2.62810}, +{145.776, 7.54838, 2.57722}, +{148.134, 7.56260, 2.52734}, +{150.530, 7.57606, 2.47844}, +{152.964, 7.58883, 2.43047}, +{155.439, 7.60109, 2.38340}, +{157.953, 7.61317, 2.33722}, +{160.507, 7.62467, 2.29077}, +{163.103, 7.63562, 2.24467}, +{165.742, 7.64500, 2.19877}, +{168.422, 7.65329, 2.15387}, +{171.146, 7.66076, 2.10987}, +{173.915, 7.66750, 2.06676}, +{176.727, 7.67358, 2.02450}, +{179.586, 7.67908, 1.98311}, +{182.491, 7.68406, 1.94258}, +{185.442, 7.68870, 1.90291}, +{188.442, 7.69322, 1.86384}, +{191.489, 7.69756, 1.82515}, +{194.587, 7.70097, 1.78639}, +{197.734, 7.70356, 1.74843}, +{200.932, 7.70552, 1.71126}, +{204.182, 7.70701, 1.67487}, +{207.485, 7.70817, 1.63917}, +{210.840, 7.70909, 1.60412}, +{214.251, 7.70941, 1.56903}, +{217.716, 7.70899, 1.53468}, +{221.237, 7.70797, 1.50109}, +{224.816, 7.70649, 1.46825}, +{228.452, 7.70463, 1.43613}, +{232.147, 7.70242, 1.40471}, +{235.902, 7.70000, 1.37397}, +{239.717, 7.69747, 1.34363}, +{243.595, 7.69442, 1.31361}, +{247.535, 7.69085, 1.28406}, +{251.538, 7.68679, 1.25513}, +{255.607, 7.68229, 1.22683}, +{259.741, 7.67744, 1.19923}, +{263.942, 7.67232, 1.17223}, +{268.211, 7.66701, 1.14583}, +{272.549, 7.66142, 1.11977}, +{276.957, 7.65544, 1.09423}, +{281.437, 7.64914, 1.06924}, +{285.989, 7.64258, 1.04483}, +{290.615, 7.63584, 1.02097}, +{295.315, 7.62913, 0.997652}, +{300.092, 7.62289, 0.974426}, +{304.945, 7.61565, 0.950230}, +{309.878, 7.60745, 0.926635}, +{314.890, 7.59852, 0.903624}, +{319.983, 7.58904, 0.881185}, +{325.158, 7.57904, 0.859304}, +{330.418, 7.56858, 0.837966}, +{335.762, 7.55766, 0.817158}, +{341.192, 7.54631, 0.796866}, +{346.711, 7.53454, 0.777080}, +{352.319, 7.52236, 0.757783}, +{358.017, 7.50977, 0.738966}, +{363.808, 7.49680, 0.720616}, +{369.692, 7.48346, 0.702721}, +{375.672, 7.46981, 0.685272}, +{381.748, 7.45597, 0.668255}, +{387.922, 7.44250, 0.651661}, +{394.197, 7.42885, 0.633203}, +{400.573, 7.41329, 0.614319}, +{407.052, 7.39596, 0.595997}, +{413.635, 7.37744, 0.578222}, +{420.326, 7.35778, 0.560977}, +{427.124, 7.33701, 0.544246}, +{434.032, 7.31510, 0.528014}, +{441.052, 7.29202, 0.512267}, +{448.186, 7.26769, 0.496989}, +{455.435, 7.24189, 0.482202}, +{462.802, 7.21490, 0.468296}, +{470.287, 7.18665, 0.454791}, +{477.894, 7.15697, 0.441676}, +{485.623, 7.12566, 0.428938}, +{493.478, 7.09257, 0.416567}, +{501.459, 7.05748, 0.404554}, +{509.570, 7.02018, 0.392888}, +{517.812, 6.98039, 0.381557}, +{526.187, 6.93783, 0.370553}, +{534.698, 6.89211, 0.359867}, +{543.346, 6.84283, 0.349489}, +{552.134, 6.78953, 0.339410}, +{561.065, 6.73141, 0.329269}, +{570.139, 6.66747, 0.319340}, +{579.361, 6.59672, 0.309710}, +{588.732, 6.51789, 0.300371}, +{598.254, 6.42927, 0.291313}, +{607.930, 6.32851, 0.282529}, +{617.763, 6.21291, 0.274009}, +{627.755, 6.07690, 0.264419}, +{637.908, 5.91248, 0.254836}, +{648.226, 5.70824, 0.245599}, +{658.711, 5.44338, 0.236698}, +{669.365, 5.07493, 0.228119}, +{680.191, 4.49043, 0.219851}, +{691.193, 3.15666, 0.211882}, +{696.600, -1.94772, 0.208117}, +{696.800, -1.94318, 4.25895}, +{702.372, 3.32349, 4.21271}, +{713.733, 4.82037, 4.12109}, +{725.277, 5.54534, 4.03145}, +{737.008, 6.03412, 3.94377}, +{748.928, 6.40462, 3.85800}, +{761.042, 6.70309, 3.77409}, +{773.351, 6.95272, 3.69201}, +{785.859, 7.16683, 3.61170}, +{798.570, 7.35385, 3.53315}, +{811.486, 7.51947, 3.45631}, +{824.611, 7.66774, 3.38114}, +{837.949, 7.80166, 3.30760}, +{851.502, 7.92355, 3.23567}, +{865.274, 8.03528, 3.16529}, +{879.269, 8.13844, 3.09645}, +{893.491, 8.23477, 3.02910}, +{907.943, 8.32638, 2.96067}, +{922.628, 8.40972, 2.89030}, +{937.551, 8.48485, 2.82159}, +{952.715, 8.55409, 2.75453}, +{968.124, 8.61813, 2.68905}, +{983.783, 8.67783, 2.62525}, +{999.695, 8.73399, 2.56216}, +{1015.86, 8.78586, 2.49961}, +{1032.29, 8.83342, 2.43829}, +{1048.99, 8.87741, 2.37845}, +{1065.96, 8.91817, 2.32006}, +{1083.20, 8.95607, 2.26315}, +{1100.72, 8.99143, 2.20754}, +{1118.52, 9.02433, 2.15315}, +{1136.61, 9.05493, 2.10007}, +{1155.00, 9.08348, 2.04828}, +{1173.68, 9.11025, 1.99776}, +{1192.66, 9.13541, 1.94833}, +{1211.95, 9.15924, 1.89964}, +{1231.55, 9.18115, 1.85150}, +{1251.47, 9.20115, 1.80462}, +{1271.72, 9.21971, 1.75892}, +{1292.29, 9.23745, 1.71436}, +{1313.19, 9.25383, 1.66995}, +{1334.43, 9.26857, 1.62652}, +{1356.01, 9.28196, 1.58407}, +{1377.94, 9.29416, 1.54272}, +{1400.23, 9.30537, 1.50232}, +{1422.88, 9.31553, 1.46279}, +{1445.89, 9.32471, 1.42423}, +{1469.28, 9.33307, 1.38668}, +{1493.04, 9.34101, 1.35014}, +{1517.19, 9.34812, 1.31361}, +{1541.73, 9.35415, 1.27789}, +{1566.67, 9.35919, 1.24306}, +{1592.01, 9.36343, 1.20914}, +{1617.76, 9.36691, 1.17615}, +{1643.92, 9.36981, 1.14412}, +{1670.51, 9.37220, 1.11293}, +{1697.53, 9.37408, 1.08257}, +{1724.99, 9.37567, 1.05302}, +{1752.89, 9.37681, 1.02396}, +{1781.24, 9.37738, 0.995586}, +{1810.05, 9.37745, 0.967927}, +{1839.32, 9.37707, 0.941048}, +{1869.07, 9.37632, 0.914906}, +{1899.30, 9.37523, 0.889466}, +{1930.02, 9.37382, 0.864740}, +{1961.24, 9.37213, 0.840703}, +{1992.96, 9.37009, 0.817335}, +{2025.20, 9.36817, 0.794916}, +{2057.95, 9.36612, 0.772632}, +{2091.24, 9.36371, 0.750928}, +{2125.06, 9.36107, 0.729789}, +{2159.43, 9.35823, 0.709212}, +{2194.36, 9.35523, 0.689181}, +{2229.85, 9.35205, 0.669677}, +{2265.92, 9.34874, 0.650699}, +{2302.57, 9.34530, 0.632218}, +{2339.81, 9.34174, 0.614237}, +{2377.66, 9.33807, 0.596729}, +{2416.11, 9.33430, 0.579696}, +{2455.19, 9.33045, 0.563120}, +{2494.90, 9.32652, 0.546979}, +{2535.26, 9.32252, 0.531280}, +{2576.26, 9.31846, 0.516004}, +{2617.93, 9.31435, 0.501142}, +{2660.27, 9.31019, 0.486672}, +{2703.30, 9.30599, 0.472600}, +{2747.03, 9.30177, 0.458907}, +{2791.46, 9.29751, 0.445585}, +{2836.61, 9.29324, 0.432617}, +{2882.49, 9.28894, 0.420009}, +{2929.11, 9.28464, 0.407744}, +{2976.48, 9.28033, 0.395808}, +{3024.63, 9.27602, 0.384190}, +{3073.55, 9.27171, 0.372905}, +{3123.26, 9.26741, 0.361916}, +{3173.78, 9.26311, 0.351220}, +{3225.11, 9.25882, 0.340826}, +{3277.27, 9.25455, 0.330716}, +{3330.28, 9.25030, 0.320869}, +{3384.15, 9.24606, 0.311308}, +{3438.88, 9.24185, 0.302003}, +{3494.50, 9.23767, 0.292948}, +{3551.02, 9.23351, 0.284136}, +{3608.46, 9.22937, 0.275569}, +{3666.82, 9.22526, 0.267242}, +{3726.13, 9.22119, 0.259143}, +{3786.40, 9.21715, 0.251250}, +{3847.64, 9.21313, 0.243587}, +{3909.87, 9.20915, 0.236125}, +{3973.11, 9.20519, 0.228872}, +{4037.38, 9.20127, 0.221828}, +{4102.68, 9.19738, 0.214980}, +{4169.03, 9.19352, 0.208329}, +{4236.46, 9.18969, 0.201871}, +{4304.98, 9.18590, 0.195620}, +{4374.62, 9.18217, 0.189531}, +{4445.37, 9.17846, 0.183630}, +{4517.27, 9.17481, 0.177901}, +{4590.33, 9.17120, 0.172344}, +{4664.58, 9.16764, 0.166950}, +{4740.03, 9.16412, 0.161717}, +{4816.69, 9.16065, 0.156639}, +{4894.60, 9.15723, 0.151715}, +{4973.77, 9.15386, 0.146934}, +{5054.21, 9.15054, 0.142300}, +{5135.96, 9.14726, 0.137803}, +{5219.03, 9.14404, 0.133443}, +{5303.44, 9.14087, 0.129212}, +{5389.22, 9.13774, 0.125110}, +{5476.39, 9.13467, 0.121133}, +{5564.97, 9.13165, 0.117276}, +{5654.98, 9.12867, 0.113536}, +{5746.44, 9.12575, 0.109908}, +{5839.39, 9.12287, 0.106394}, +{5933.83, 9.12005, 0.102985}, +{6029.81, 9.11727, 0.996809E-01}, +{6127.33, 9.11454, 0.964772E-01}, +{6226.44, 9.11187, 0.933711E-01}, +{6327.15, 9.10923, 0.903615E-01}, +{6429.48, 9.10665, 0.874446E-01}, +{6533.48, 9.10411, 0.846192E-01}, +{6639.15, 9.10162, 0.818799E-01}, +{6746.54, 9.09918, 0.792250E-01}, +{6855.65, 9.09679, 0.766529E-01}, +{6966.54, 9.09444, 0.741586E-01}, +{7079.22, 9.09213, 0.717451E-01}, +{7193.72, 9.08987, 0.694045E-01}, +{7310.07, 9.08765, 0.671388E-01}, +{7428.31, 9.08548, 0.649421E-01}, +{7548.45, 9.08335, 0.628154E-01}, +{7670.54, 9.08126, 0.607550E-01}, +{7794.61, 9.07922, 0.587594E-01}, +{7920.68, 9.07722, 0.568259E-01}, +{8048.79, 9.07525, 0.549528E-01}, +{8178.98, 9.07333, 0.531394E-01}, +{8311.26, 9.07145, 0.513851E-01}, +{8445.69, 9.06961, 0.496838E-01}, +{8582.29, 9.06780, 0.480370E-01}, +{8721.11, 9.06603, 0.464430E-01}, +{8862.16, 9.06430, 0.448991E-01}, +{9005.50, 9.06261, 0.434069E-01}, +{9151.16, 9.06096, 0.419581E-01}, +{9299.17, 9.05933, 0.405582E-01}, +{9449.58, 9.05775, 0.392026E-01}, +{9602.42, 9.05620, 0.378903E-01}, +{9757.73, 9.05468, 0.366203E-01}, +{9915.55, 9.05319, 0.353915E-01}, +{10075.9, 9.05174, 0.342018E-01}, +{10238.9, 9.05032, 0.330505E-01}, +{10404.5, 9.04894, 0.319365E-01}, +{10572.8, 9.04758, 0.308584E-01}, +{10743.8, 9.04625, 0.298153E-01}, +{10917.6, 9.04496, 0.288060E-01}, +{11094.2, 9.04369, 0.278296E-01}, +{11273.6, 9.04245, 0.268849E-01}, +{11455.9, 9.04124, 0.259711E-01}, +{11641.2, 9.04006, 0.250872E-01}, +{11829.5, 9.03890, 0.242321E-01}, +{12020.8, 9.03777, 0.234051E-01}, +{12215.3, 9.03667, 0.226052E-01}, +{12412.8, 9.03560, 0.218317E-01}, +{12613.6, 9.03454, 0.210836E-01}, +{12817.6, 9.03352, 0.203602E-01}, +{13025.0, 9.03251, 0.196608E-01}, +{13235.6, 9.03153, 0.189845E-01}, +{13449.7, 9.03058, 0.183307E-01}, +{13667.2, 9.02965, 0.176985E-01}, +{13888.3, 9.02873, 0.170875E-01}, +{14112.9, 9.02785, 0.164968E-01}, +{14341.2, 9.02698, 0.159259E-01}, +{14573.1, 9.02613, 0.153741E-01}, +{14808.9, 9.02530, 0.148408E-01}, +{15048.4, 9.02450, 0.143254E-01}, +{15291.8, 9.02371, 0.138274E-01}, +{15539.1, 9.02294, 0.133462E-01}, +{15790.4, 9.02219, 0.128813E-01}, +{16045.8, 9.02146, 0.124321E-01}, +{16305.4, 9.02075, 0.119982E-01}, +{16569.1, 9.02005, 0.115791E-01}, +{16837.1, 9.01937, 0.111742E-01}, +{17109.4, 9.01871, 0.107832E-01}, +{17386.1, 9.01807, 0.104056E-01}, +{17667.4, 9.01744, 0.100409E-01}, +{17953.1, 9.01683, 0.968875E-02}, +{18243.5, 9.01623, 0.934876E-02}, +{18538.6, 9.01565, 0.902052E-02}, +{18838.4, 9.01508, 0.870365E-02}, +{19143.1, 9.01453, 0.839779E-02}, +{19452.7, 9.01399, 0.810257E-02}, +{19767.4, 9.01346, 0.781765E-02}, +{20087.1, 9.01295, 0.754257E-02}, +{20412.0, 9.01245, 0.727735E-02}, +{20742.1, 9.01196, 0.702156E-02}, +{21077.6, 9.01149, 0.677484E-02}, +{21418.5, 9.01103, 0.653687E-02}, +{21765.0, 9.01058, 0.630733E-02}, +{22117.0, 9.01014, 0.608592E-02}, +{22474.7, 9.00972, 0.587235E-02}, +{22838.2, 9.00930, 0.566631E-02}, +{23207.6, 9.00890, 0.546756E-02}, +{23583.0, 9.00851, 0.527582E-02}, +{23964.4, 9.00812, 0.509084E-02}, +{24352.0, 9.00775, 0.491238E-02}, +{24745.9, 9.00739, 0.474021E-02}, +{25146.2, 9.00704, 0.457410E-02}, +{25552.9, 9.00669, 0.441383E-02}, +{25966.2, 9.00636, 0.425919E-02}, +{26386.1, 9.00604, 0.410999E-02}, +{26812.9, 9.00572, 0.396602E-02}, +{27246.6, 9.00541, 0.382710E-02}, +{27687.3, 9.00511, 0.369306E-02}, +{28135.1, 9.00482, 0.356371E-02}, +{28590.2, 9.00454, 0.343889E-02}, +{29052.6, 9.00427, 0.331845E-02}, +{29522.5, 9.00401, 0.320221E-02}, +{30000.0, 9.00371, 0.309004E-02}, +{0, 0, 0} +}; + +e_fp_fdp ne[] = { /* Z = 10 */ +{10.0000, -9999.00, 0.479576E-15}, +{10.1617, -9999.00, 0.487333E-15}, +{10.3261, -9999.00, 0.495215E-15}, +{10.4931, -9999.00, 0.503225E-15}, +{10.6628, -9999.00, 0.511364E-15}, +{10.8353, -9999.00, 0.519635E-15}, +{11.0106, -9999.00, 0.528040E-15}, +{11.1886, -9999.00, 0.536580E-15}, +{11.3696, -9999.00, 0.545259E-15}, +{11.5535, -9999.00, 0.554078E-15}, +{11.7404, -9999.00, 0.563040E-15}, +{11.9303, -9999.00, 0.572147E-15}, +{12.1232, -9999.00, 0.581401E-15}, +{12.3193, -9999.00, 0.590805E-15}, +{12.5186, -9999.00, 0.600361E-15}, +{12.7210, -9999.00, 0.610071E-15}, +{12.9268, -9999.00, 0.619938E-15}, +{13.1359, -9999.00, 0.629965E-15}, +{13.3483, -9999.00, 0.640155E-15}, +{13.5642, -9999.00, 0.650509E-15}, +{13.7836, -9999.00, 0.661030E-15}, +{14.0066, -9999.00, 0.671722E-15}, +{14.2331, -9999.00, 0.682586E-15}, +{14.4633, -9999.00, 0.693627E-15}, +{14.6973, -9999.00, 0.704846E-15}, +{14.9350, -9999.00, 0.716246E-15}, +{15.1765, -9999.00, 0.727831E-15}, +{15.4220, -9999.00, 0.739603E-15}, +{15.6714, -9999.00, 0.751565E-15}, +{15.9249, -9999.00, 0.763721E-15}, +{16.1825, -9999.00, 0.776074E-15}, +{16.4442, -9999.00, 0.788626E-15}, +{16.7102, -9999.00, 0.801382E-15}, +{16.9805, -9999.00, 0.814343E-15}, +{17.2551, -9999.00, 0.827515E-15}, +{17.5342, -9999.00, 0.840899E-15}, +{17.8178, -9999.00, 0.854500E-15}, +{18.1060, -9999.00, 0.868321E-15}, +{18.3989, -9999.00, 0.882365E-15}, +{18.6964, -9999.00, 0.896637E-15}, +{18.9988, -9999.00, 0.911139E-15}, +{19.3061, -9999.00, 0.925876E-15}, +{19.6184, -9999.00, 0.940852E-15}, +{19.9357, -9999.00, 0.956069E-15}, +{20.2582, -9999.00, 0.971533E-15}, +{20.5858, -9999.00, 0.987247E-15}, +{20.9188, -9999.00, 0.100321E-14}, +{21.2571, -9999.00, 0.101944E-14}, +{21.5000, -9999.00, 0.103109E-14}, +{21.7000, -9999.00, 1.79139}, +{21.9503, -9999.00, 1.95643}, +{22.3053, -9999.00, 2.21315}, +{22.6661, -9999.00, 2.50079}, +{23.0327, -9999.00, 2.64889}, +{23.4053, -9999.00, 2.78606}, +{23.7838, -9999.00, 2.90136}, +{24.1685, -9999.00, 3.01168}, +{24.5594, -9999.00, 3.10817}, +{24.9566, -9999.00, 3.20074}, +{25.3603, -9999.00, 3.28061}, +{25.7705, -9999.00, 3.36247}, +{26.1873, -9999.00, 3.44638}, +{26.6109, -9999.00, 3.51648}, +{27.0413, -9999.00, 3.57443}, +{27.4786, -9999.00, 3.63332}, +{27.9231, -9999.00, 3.69319}, +{28.3747, -9999.00, 3.72541}, +{28.8337, -9999.00, 3.75454}, +{29.3000, -0.722786, 3.78390}, +{29.7739, -0.638325, 3.80667}, +{30.2555, -0.572576, 3.80777}, +{30.7449, -0.547169, 3.80887}, +{31.2421, -0.527238, 3.86953}, +{31.7475, -0.488279, 3.93403}, +{32.2609, -0.439885, 4.00099}, +{32.7827, -0.385659, 4.06909}, +{33.3130, -0.321160, 4.13833}, +{33.8518, -0.252235, 4.19845}, +{34.3993, -0.186891, 4.25469}, +{34.9557, -0.122622, 4.31170}, +{35.5211, -0.582012E-01, 4.36946}, +{36.0956, 0.674596E-02, 4.42800}, +{36.6794, 0.716378E-01, 4.48853}, +{37.2727, 0.139639, 4.55288}, +{37.8755, 0.212833, 4.61816}, +{38.4882, 0.291005, 4.68437}, +{39.1107, 0.377165, 4.75153}, +{39.7432, 0.479881, 4.81744}, +{40.3861, 0.583162, 4.85348}, +{41.0393, 0.675584, 4.88980}, +{41.7031, 0.785214, 4.92638}, +{42.3776, 0.886627, 4.92330}, +{43.0630, 0.950661, 4.91981}, +{43.7595, 0.995369, 4.92915}, +{44.4673, 1.04260, 4.96679}, +{45.1865, 1.09860, 5.00472}, +{45.9174, 1.15509, 5.04294}, +{46.6600, 1.21056, 5.08375}, +{47.4147, 1.26770, 5.12979}, +{48.1816, 1.32690, 5.17624}, +{48.9609, 1.38098, 5.22312}, +{49.7528, 1.43043, 5.27991}, +{50.5576, 1.49011, 5.35683}, +{51.3753, 1.56422, 5.43488}, +{52.2062, 1.65650, 5.51407}, +{53.0506, 1.75929, 5.57909}, +{53.9087, 1.85924, 5.63469}, +{54.7806, 1.95960, 5.69085}, +{55.6667, 2.06458, 5.74756}, +{56.5670, 2.18172, 5.80484}, +{57.4820, 2.30444, 5.83933}, +{58.4117, 2.41966, 5.86771}, +{59.3564, 2.53134, 5.89623}, +{60.3165, 2.65269, 5.92489}, +{61.2921, 2.76610, 5.91786}, +{62.2834, 2.84275, 5.90994}, +{63.2908, 2.91410, 5.95107}, +{64.3145, 3.00481, 5.99250}, +{65.3547, 3.10324, 6.03421}, +{66.4118, 3.20810, 6.07621}, +{67.4859, 3.31970, 6.11849}, +{68.5775, 3.43868, 6.16108}, +{69.6867, 3.58000, 6.20396}, +{70.8138, 3.73593, 6.22061}, +{71.9591, 3.87602, 6.20429}, +{73.1230, 3.99693, 6.18801}, +{74.3057, 4.10545, 6.17671}, +{75.5076, 4.21230, 6.17497}, +{76.7289, 4.32332, 6.17323}, +{77.9699, 4.43449, 6.17149}, +{79.2310, 4.54643, 6.16951}, +{80.5125, 4.65930, 6.16729}, +{81.8147, 4.77363, 6.16507}, +{83.1380, 4.89047, 6.16286}, +{84.4827, 5.01150, 6.16065}, +{85.8491, 5.14335, 6.15843}, +{87.2377, 5.27923, 6.13190}, +{88.6487, 5.40393, 6.09959}, +{90.0825, 5.52126, 6.06745}, +{91.5395, 5.63579, 6.03548}, +{93.0201, 5.74841, 6.00367}, +{94.5246, 5.86002, 5.97204}, +{96.0535, 5.96754, 5.94057}, +{97.6071, 6.07102, 5.91640}, +{99.1858, 6.21026, 5.91586}, +{100.790, 6.36239, 5.86022}, +{102.420, 6.49005, 5.80511}, +{104.077, 6.62335, 5.74533}, +{105.760, 6.74851, 5.66045}, +{107.471, 6.85669, 5.57681}, +{109.209, 6.95637, 5.49442}, +{110.975, 7.04990, 5.41324}, +{112.770, 7.13870, 5.33326}, +{114.594, 7.22406, 5.25446}, +{116.448, 7.30822, 5.17522}, +{118.331, 7.38800, 5.09217}, +{120.245, 7.46106, 5.01045}, +{122.190, 7.53053, 4.93005}, +{124.166, 7.59679, 4.85093}, +{126.175, 7.66034, 4.77309}, +{128.215, 7.72164, 4.69648}, +{130.289, 7.78103, 4.62112}, +{132.397, 7.84246, 4.54697}, +{134.538, 7.90168, 4.46606}, +{136.714, 7.95319, 4.38620}, +{138.925, 8.00152, 4.30777}, +{141.172, 8.04685, 4.23074}, +{143.456, 8.08951, 4.15509}, +{145.776, 8.12971, 4.08079}, +{148.134, 8.16754, 4.00782}, +{150.530, 8.20301, 3.93615}, +{152.964, 8.23612, 3.86577}, +{155.439, 8.26330, 3.79664}, +{157.953, 8.28781, 3.73619}, +{160.507, 8.31714, 3.68212}, +{163.103, 8.35015, 3.62882}, +{165.742, 8.38588, 3.57630}, +{168.422, 8.42488, 3.52453}, +{171.146, 8.46918, 3.47352}, +{173.915, 8.52709, 3.42324}, +{176.727, 8.60566, 3.33971}, +{179.586, 8.63273, 3.18737}, +{182.491, 8.60965, 3.12893}, +{185.442, 8.61713, 3.06989}, +{188.442, 8.62845, 3.01163}, +{191.489, 8.64103, 2.95426}, +{194.587, 8.65396, 2.89868}, +{197.734, 8.66744, 2.84434}, +{200.932, 8.68132, 2.79115}, +{204.182, 8.69565, 2.73904}, +{207.485, 8.71077, 2.68788}, +{210.840, 8.72822, 2.63765}, +{214.251, 8.74635, 2.58158}, +{217.716, 8.76064, 2.52530}, +{221.237, 8.77223, 2.46916}, +{224.816, 8.78174, 2.41430}, +{228.452, 8.78979, 2.36065}, +{232.147, 8.79661, 2.30819}, +{235.902, 8.80235, 2.25686}, +{239.717, 8.80715, 2.20669}, +{243.595, 8.81111, 2.15765}, +{247.535, 8.81436, 2.10972}, +{251.538, 8.81697, 2.06282}, +{255.607, 8.81896, 2.01694}, +{259.741, 8.82046, 1.97218}, +{263.942, 8.82164, 1.92836}, +{268.211, 8.82249, 1.88543}, +{272.549, 8.82346, 1.84358}, +{276.957, 8.82493, 1.80142}, +{281.437, 8.82552, 1.75865}, +{285.989, 8.82447, 1.71610}, +{290.615, 8.82217, 1.67444}, +{295.315, 8.81886, 1.63373}, +{300.092, 8.81476, 1.59405}, +{304.945, 8.81001, 1.55535}, +{309.878, 8.80468, 1.51761}, +{314.890, 8.79880, 1.48071}, +{319.983, 8.79238, 1.44471}, +{325.158, 8.78549, 1.40962}, +{330.418, 8.77817, 1.37537}, +{335.762, 8.77043, 1.34195}, +{341.192, 8.76232, 1.30936}, +{346.711, 8.75385, 1.27755}, +{352.319, 8.74505, 1.24651}, +{358.017, 8.73594, 1.21623}, +{363.808, 8.72656, 1.18669}, +{369.692, 8.71694, 1.15786}, +{375.672, 8.70715, 1.12973}, +{381.748, 8.69761, 1.10229}, +{387.922, 8.68824, 1.07477}, +{394.197, 8.67788, 1.04635}, +{400.573, 8.66621, 1.01886}, +{407.052, 8.65390, 0.992161}, +{413.635, 8.64100, 0.966161}, +{420.326, 8.62755, 0.940839}, +{427.124, 8.61357, 0.916181}, +{434.032, 8.59908, 0.892172}, +{441.052, 8.58410, 0.868792}, +{448.186, 8.56866, 0.846004}, +{455.435, 8.55270, 0.823712}, +{462.802, 8.53615, 0.801953}, +{470.287, 8.51899, 0.780739}, +{477.894, 8.50122, 0.760082}, +{485.623, 8.48282, 0.739973}, +{493.478, 8.46377, 0.720396}, +{501.459, 8.44404, 0.701336}, +{509.570, 8.42359, 0.682789}, +{517.812, 8.40239, 0.664740}, +{526.187, 8.38037, 0.647177}, +{534.698, 8.35750, 0.630129}, +{543.346, 8.33378, 0.613550}, +{552.134, 8.30914, 0.597392}, +{561.065, 8.28343, 0.581446}, +{570.139, 8.25634, 0.565869}, +{579.361, 8.22785, 0.550989}, +{588.732, 8.19810, 0.536590}, +{598.254, 8.16694, 0.522623}, +{607.930, 8.13419, 0.509022}, +{617.763, 8.09971, 0.495782}, +{627.755, 8.06333, 0.482858}, +{637.908, 8.02490, 0.469866}, +{648.226, 7.98369, 0.456687}, +{658.711, 7.93886, 0.443532}, +{669.365, 7.88993, 0.430757}, +{680.191, 7.83651, 0.419564}, +{691.193, 7.77932, 0.409597}, +{702.372, 7.71813, 0.400185}, +{713.733, 7.65152, 0.390453}, +{725.277, 7.57766, 0.380595}, +{737.008, 7.49521, 0.370963}, +{748.928, 7.40231, 0.361591}, +{761.042, 7.29647, 0.352460}, +{773.351, 7.17415, 0.343481}, +{785.859, 7.03000, 0.334490}, +{798.570, 6.85573, 0.325538}, +{811.486, 6.63820, 0.316826}, +{824.611, 6.35358, 0.308346}, +{837.949, 5.95155, 0.300094}, +{851.502, 5.29351, 0.292063}, +{865.274, 3.59708, 0.284248}, +{870.100, -1.59786, 0.281588}, +{870.300, -1.59368, 4.51161}, +{879.269, 4.56045, 4.44449}, +{893.491, 5.91462, 4.34146}, +{907.943, 6.62676, 4.24078}, +{922.628, 7.11804, 4.14240}, +{937.551, 7.49445, 4.04632}, +{952.715, 7.79960, 3.95247}, +{968.124, 8.05596, 3.86078}, +{983.783, 8.27687, 3.77122}, +{999.695, 8.47121, 3.68310}, +{1015.86, 8.64476, 3.59637}, +{1032.29, 8.79982, 3.50583}, +{1048.99, 8.93632, 3.41781}, +{1065.96, 9.05890, 3.33231}, +{1083.20, 9.16978, 3.24896}, +{1100.72, 9.27054, 3.16769}, +{1118.52, 9.36245, 3.08843}, +{1136.61, 9.44655, 3.01119}, +{1155.00, 9.52375, 2.93587}, +{1173.68, 9.59478, 2.86243}, +{1192.66, 9.66028, 2.79083}, +{1211.95, 9.72084, 2.72102}, +{1231.55, 9.77699, 2.65295}, +{1251.47, 9.82924, 2.58624}, +{1271.72, 9.87761, 2.52088}, +{1292.29, 9.92223, 2.45679}, +{1313.19, 9.96338, 2.39428}, +{1334.43, 10.0014, 2.33337}, +{1356.01, 10.0366, 2.27403}, +{1377.94, 10.0693, 2.21618}, +{1400.23, 10.0997, 2.15980}, +{1422.88, 10.1279, 2.10484}, +{1445.89, 10.1543, 2.05128}, +{1469.28, 10.1790, 1.99890}, +{1493.04, 10.2023, 1.94758}, +{1517.19, 10.2240, 1.89639}, +{1541.73, 10.2432, 1.84637}, +{1566.67, 10.2607, 1.79766}, +{1592.01, 10.2767, 1.75022}, +{1617.76, 10.2912, 1.70405}, +{1643.92, 10.3045, 1.65912}, +{1670.51, 10.3167, 1.61535}, +{1697.53, 10.3278, 1.57273}, +{1724.99, 10.3383, 1.53124}, +{1752.89, 10.3480, 1.49017}, +{1781.24, 10.3563, 1.44996}, +{1810.05, 10.3636, 1.41060}, +{1839.32, 10.3699, 1.37235}, +{1869.07, 10.3753, 1.33513}, +{1899.30, 10.3800, 1.29892}, +{1930.02, 10.3840, 1.26371}, +{1961.24, 10.3874, 1.22944}, +{1992.96, 10.3901, 1.19608}, +{2025.20, 10.3926, 1.16410}, +{2057.95, 10.3950, 1.13218}, +{2091.24, 10.3964, 1.10097}, +{2125.06, 10.3973, 1.07062}, +{2159.43, 10.3978, 1.04110}, +{2194.36, 10.3979, 1.01223}, +{2229.85, 10.3976, 0.984136}, +{2265.92, 10.3969, 0.956770}, +{2302.57, 10.3958, 0.930103}, +{2339.81, 10.3944, 0.904127}, +{2377.66, 10.3927, 0.878825}, +{2416.11, 10.3907, 0.854188}, +{2455.19, 10.3885, 0.830187}, +{2494.90, 10.3860, 0.806817}, +{2535.26, 10.3833, 0.784061}, +{2576.26, 10.3804, 0.761901}, +{2617.93, 10.3774, 0.740321}, +{2660.27, 10.3741, 0.719320}, +{2703.30, 10.3707, 0.698870}, +{2747.03, 10.3671, 0.678965}, +{2791.46, 10.3634, 0.659589}, +{2836.61, 10.3596, 0.640726}, +{2882.49, 10.3557, 0.622378}, +{2929.11, 10.3516, 0.604504}, +{2976.48, 10.3475, 0.587115}, +{3024.63, 10.3433, 0.570193}, +{3073.55, 10.3390, 0.553728}, +{3123.26, 10.3347, 0.537703}, +{3173.78, 10.3303, 0.522116}, +{3225.11, 10.3259, 0.506956}, +{3277.27, 10.3214, 0.492196}, +{3330.28, 10.3169, 0.477824}, +{3384.15, 10.3124, 0.463861}, +{3438.88, 10.3078, 0.450268}, +{3494.50, 10.3032, 0.437039}, +{3551.02, 10.2986, 0.424180}, +{3608.46, 10.2940, 0.411660}, +{3666.82, 10.2894, 0.399495}, +{3726.13, 10.2848, 0.387646}, +{3786.40, 10.2802, 0.376136}, +{3847.64, 10.2756, 0.364929}, +{3909.87, 10.2711, 0.354038}, +{3973.11, 10.2665, 0.343434}, +{4037.38, 10.2620, 0.333068}, +{4102.68, 10.2574, 0.323058}, +{4169.03, 10.2529, 0.313321}, +{4236.46, 10.2483, 0.303851}, +{4304.98, 10.2439, 0.294663}, +{4374.62, 10.2394, 0.285729}, +{4445.37, 10.2350, 0.277040}, +{4517.27, 10.2306, 0.268603}, +{4590.33, 10.2263, 0.260404}, +{4664.58, 10.2220, 0.252455}, +{4740.03, 10.2177, 0.244712}, +{4816.69, 10.2135, 0.237208}, +{4894.60, 10.2093, 0.229920}, +{4973.77, 10.2052, 0.222838}, +{5054.21, 10.2011, 0.215963}, +{5135.96, 10.1970, 0.209289}, +{5219.03, 10.1930, 0.202809}, +{5303.44, 10.1891, 0.196519}, +{5389.22, 10.1852, 0.190412}, +{5476.39, 10.1813, 0.184485}, +{5564.97, 10.1775, 0.178735}, +{5654.98, 10.1738, 0.173151}, +{5746.44, 10.1701, 0.167735}, +{5839.39, 10.1664, 0.162478}, +{5933.83, 10.1628, 0.157379}, +{6029.81, 10.1593, 0.152431}, +{6127.33, 10.1558, 0.147632}, +{6226.44, 10.1524, 0.142974}, +{6327.15, 10.1490, 0.138457}, +{6429.48, 10.1457, 0.134077}, +{6533.48, 10.1424, 0.129827}, +{6639.15, 10.1392, 0.125706}, +{6746.54, 10.1360, 0.121709}, +{6855.65, 10.1329, 0.117834}, +{6966.54, 10.1298, 0.114074}, +{7079.22, 10.1268, 0.110431}, +{7193.72, 10.1239, 0.106898}, +{7310.07, 10.1210, 0.103474}, +{7428.31, 10.1181, 0.100154}, +{7548.45, 10.1153, 0.969350E-01}, +{7670.54, 10.1126, 0.938140E-01}, +{7794.61, 10.1099, 0.907908E-01}, +{7920.68, 10.1072, 0.878584E-01}, +{8048.79, 10.1046, 0.850180E-01}, +{8178.98, 10.1021, 0.822656E-01}, +{8311.26, 10.0996, 0.795985E-01}, +{8445.69, 10.0971, 0.770135E-01}, +{8582.29, 10.0947, 0.745080E-01}, +{8721.11, 10.0923, 0.720825E-01}, +{8862.16, 10.0900, 0.697322E-01}, +{9005.50, 10.0878, 0.674551E-01}, +{9151.16, 10.0855, 0.652458E-01}, +{9299.17, 10.0834, 0.631096E-01}, +{9449.58, 10.0812, 0.610392E-01}, +{9602.42, 10.0791, 0.590324E-01}, +{9757.73, 10.0771, 0.570907E-01}, +{9915.55, 10.0751, 0.552107E-01}, +{10075.9, 10.0731, 0.533891E-01}, +{10238.9, 10.0712, 0.516251E-01}, +{10404.5, 10.0693, 0.499169E-01}, +{10572.8, 10.0675, 0.482630E-01}, +{10743.8, 10.0657, 0.466616E-01}, +{10917.6, 10.0639, 0.451112E-01}, +{11094.2, 10.0622, 0.436103E-01}, +{11273.6, 10.0605, 0.421572E-01}, +{11455.9, 10.0588, 0.407507E-01}, +{11641.2, 10.0572, 0.393893E-01}, +{11829.5, 10.0556, 0.380715E-01}, +{12020.8, 10.0541, 0.367961E-01}, +{12215.3, 10.0526, 0.355617E-01}, +{12412.8, 10.0511, 0.343672E-01}, +{12613.6, 10.0496, 0.332113E-01}, +{12817.6, 10.0482, 0.320928E-01}, +{13025.0, 10.0468, 0.310105E-01}, +{13235.6, 10.0455, 0.299634E-01}, +{13449.7, 10.0442, 0.289504E-01}, +{13667.2, 10.0429, 0.279703E-01}, +{13888.3, 10.0416, 0.270223E-01}, +{14112.9, 10.0404, 0.261052E-01}, +{14341.2, 10.0392, 0.252182E-01}, +{14573.1, 10.0380, 0.243603E-01}, +{14808.9, 10.0369, 0.235306E-01}, +{15048.4, 10.0357, 0.227282E-01}, +{15291.8, 10.0346, 0.219522E-01}, +{15539.1, 10.0336, 0.212020E-01}, +{15790.4, 10.0325, 0.204765E-01}, +{16045.8, 10.0315, 0.197751E-01}, +{16305.4, 10.0305, 0.190970E-01}, +{16569.1, 10.0295, 0.184415E-01}, +{16837.1, 10.0286, 0.178078E-01}, +{17109.4, 10.0277, 0.171953E-01}, +{17386.1, 10.0268, 0.166034E-01}, +{17667.4, 10.0259, 0.160312E-01}, +{17953.1, 10.0250, 0.154784E-01}, +{18243.5, 10.0242, 0.149441E-01}, +{18538.6, 10.0234, 0.144279E-01}, +{18838.4, 10.0226, 0.139291E-01}, +{19143.1, 10.0218, 0.134472E-01}, +{19452.7, 10.0210, 0.129817E-01}, +{19767.4, 10.0203, 0.125320E-01}, +{20087.1, 10.0195, 0.121005E-01}, +{20412.0, 10.0188, 0.116811E-01}, +{20742.1, 10.0182, 0.112763E-01}, +{21077.6, 10.0175, 0.108855E-01}, +{21418.5, 10.0168, 0.105083E-01}, +{21765.0, 10.0162, 0.101442E-01}, +{22117.0, 10.0156, 0.979270E-02}, +{22474.7, 10.0150, 0.945338E-02}, +{22838.2, 10.0144, 0.912581E-02}, +{23207.6, 10.0138, 0.880958E-02}, +{23583.0, 10.0132, 0.850428E-02}, +{23964.4, 10.0127, 0.820956E-02}, +{24352.0, 10.0122, 0.792501E-02}, +{24745.9, 10.0117, 0.765031E-02}, +{25146.2, 10.0112, 0.738508E-02}, +{25552.9, 10.0107, 0.712903E-02}, +{25966.2, 10.0102, 0.688181E-02}, +{26386.1, 10.0097, 0.664311E-02}, +{26812.9, 10.0093, 0.641266E-02}, +{27246.6, 10.0088, 0.619014E-02}, +{27687.3, 10.0084, 0.597531E-02}, +{28135.1, 10.0080, 0.576787E-02}, +{28590.2, 10.0076, 0.556759E-02}, +{29052.6, 10.0072, 0.537420E-02}, +{29522.5, 10.0068, 0.518748E-02}, +{30000.0, 10.0064, 0.500718E-02}, +{0, 0, 0} +}; + +e_fp_fdp na[] = { /* Z = 11 */ +{10.0000, -9999.00, 0.147534E-01}, +{10.1617, -9999.00, 0.151684E-01}, +{10.3261, -9999.00, 0.155950E-01}, +{10.4931, -9999.00, 0.160337E-01}, +{10.6628, -9999.00, 0.164847E-01}, +{10.8353, -9999.00, 0.169485E-01}, +{11.0106, -9999.00, 0.174252E-01}, +{11.1886, -9999.00, 0.179154E-01}, +{11.3696, -9999.00, 0.184193E-01}, +{11.5535, -9999.00, 0.189374E-01}, +{11.7404, -9999.00, 0.194701E-01}, +{11.9303, -9999.00, 0.200178E-01}, +{12.1232, -9999.00, 0.205809E-01}, +{12.3193, -9999.00, 0.211598E-01}, +{12.5186, -9999.00, 0.217550E-01}, +{12.7210, -9999.00, 0.223670E-01}, +{12.9268, -9999.00, 0.229962E-01}, +{13.1359, -9999.00, 0.236430E-01}, +{13.3483, -9999.00, 0.243081E-01}, +{13.5642, -9999.00, 0.249919E-01}, +{13.7836, -9999.00, 0.255150E-01}, +{14.0066, -9999.00, 0.259862E-01}, +{14.2331, -9999.00, 0.264661E-01}, +{14.4633, -9999.00, 0.269549E-01}, +{14.6973, -9999.00, 0.274527E-01}, +{14.9350, -9999.00, 0.279597E-01}, +{15.1765, -9999.00, 0.284761E-01}, +{15.4220, -9999.00, 0.290020E-01}, +{15.6714, -9999.00, 0.294125E-01}, +{15.9249, -9999.00, 0.297985E-01}, +{16.1825, -9999.00, 0.301895E-01}, +{16.4442, -9999.00, 0.305857E-01}, +{16.7102, -9999.00, 0.309870E-01}, +{16.9805, -9999.00, 0.313936E-01}, +{17.2551, -9999.00, 0.318055E-01}, +{17.5342, -9999.00, 0.322229E-01}, +{17.8178, -9999.00, 0.325671E-01}, +{18.1060, -9999.00, 0.328178E-01}, +{18.3989, -9999.00, 0.330704E-01}, +{18.6964, -9999.00, 0.333250E-01}, +{18.9988, -9999.00, 0.335815E-01}, +{19.3061, -9999.00, 0.338400E-01}, +{19.6184, -9999.00, 0.341004E-01}, +{19.9357, -9999.00, 0.343629E-01}, +{20.2582, -9999.00, 0.346274E-01}, +{20.5858, -9999.00, 0.348264E-01}, +{20.9188, -9999.00, 0.349017E-01}, +{21.2571, -9999.00, 0.349772E-01}, +{21.6009, -9999.00, 0.350529E-01}, +{21.9503, -9999.00, 0.351287E-01}, +{22.3053, -9999.00, 0.352047E-01}, +{22.6661, -9999.00, 0.352808E-01}, +{23.0327, -9999.00, 0.353571E-01}, +{23.4053, -9999.00, 0.354336E-01}, +{23.7838, -9999.00, 0.355102E-01}, +{24.1685, -9999.00, 0.355870E-01}, +{24.5594, -9999.00, 0.358675E-01}, +{24.9566, -9999.00, 0.361683E-01}, +{25.3603, -9999.00, 0.364716E-01}, +{25.7705, -9999.00, 0.367775E-01}, +{26.1873, -9999.00, 0.370860E-01}, +{26.6109, -9999.00, 0.372048E-01}, +{27.0413, -9999.00, 0.370648E-01}, +{27.4786, -9999.00, 0.369253E-01}, +{27.9231, -9999.00, 0.367864E-01}, +{28.3747, -9999.00, 0.366479E-01}, +{28.8337, -9999.00, 0.365100E-01}, +{29.3000, -2.03950, 0.363726E-01}, +{29.7739, -2.47455, 0.362357E-01}, +{30.2555, -3.36315, 0.360994E-01}, +{30.4000, -4.05942, 0.360590E-01}, +{30.6000, -4.11461, 2.39177}, +{30.7449, -3.47735, 2.41235}, +{31.2421, -2.73139, 2.48359}, +{31.7475, -2.40933, 2.55694}, +{32.2609, -2.20846, 2.63245}, +{32.7827, -2.06454, 2.71019}, +{33.3130, -1.95293, 2.79022}, +{33.8518, -1.86154, 2.87263}, +{34.3993, -1.78343, 2.95746}, +{34.9557, -1.71413, 3.04480}, +{35.5211, -1.65048, 3.13471}, +{36.0956, -1.58983, 3.22729}, +{36.6794, -1.52916, 3.32259}, +{37.2727, -1.46249, 3.41755}, +{37.8755, -1.39993, 3.49959}, +{38.4882, -1.34414, 3.58360}, +{39.1107, -1.29174, 3.66962}, +{39.7432, -1.24091, 3.75771}, +{40.3861, -1.19080, 3.84791}, +{41.0393, -1.14068, 3.94028}, +{41.7031, -1.08995, 4.03487}, +{42.3776, -1.03796, 4.13172}, +{43.0630, -0.984050, 4.23091}, +{43.7595, -0.927363, 4.33247}, +{44.4673, -0.866628, 4.43647}, +{45.1865, -0.797934, 4.54297}, +{45.9174, -0.720079, 4.63804}, +{46.6600, -0.649149, 4.72878}, +{47.4147, -0.580495, 4.82129}, +{48.1816, -0.511218, 4.91562}, +{48.9609, -0.440371, 5.01178}, +{49.7528, -0.366996, 5.10983}, +{50.5576, -0.289843, 5.20980}, +{51.3753, -0.205353, 5.31172}, +{52.2062, -0.113753, 5.40276}, +{53.0506, -0.274963E-01, 5.49076}, +{53.9087, 0.570975E-01, 5.58020}, +{54.7806, 0.142480, 5.67110}, +{55.6667, 0.229379, 5.76347}, +{56.5670, 0.318413, 5.85735}, +{57.4820, 0.410163, 5.95276}, +{58.4117, 0.505472, 6.04972}, +{59.3564, 0.605953, 6.14826}, +{60.3165, 0.710711, 6.24351}, +{61.2921, 0.816965, 6.33921}, +{62.2834, 0.926526, 6.43637}, +{63.2908, 1.04047, 6.53502}, +{64.3145, 1.15981, 6.63519}, +{65.3547, 1.28571, 6.73689}, +{66.4118, 1.41983, 6.84014}, +{67.4859, 1.56454, 6.94499}, +{68.5775, 1.72804, 7.05143}, +{69.6867, 1.93808, 7.13276}, +{70.8138, 2.11892, 7.16815}, +{71.9591, 2.28017, 7.20372}, +{73.1230, 2.43538, 7.23946}, +{74.3057, 2.58724, 7.27537}, +{75.5076, 2.73746, 7.31147}, +{76.7289, 2.88729, 7.34775}, +{77.9699, 3.03778, 7.38420}, +{79.2310, 3.18994, 7.42084}, +{80.5125, 3.34487, 7.45766}, +{81.8147, 3.50402, 7.49465}, +{83.1380, 3.66963, 7.53184}, +{84.4827, 3.84659, 7.56921}, +{85.8491, 4.05244, 7.59160}, +{87.2377, 4.24012, 7.57278}, +{88.6487, 4.41270, 7.55402}, +{90.0825, 4.57752, 7.53529}, +{91.5395, 4.73855, 7.51662}, +{93.0201, 4.89770, 7.49799}, +{94.5246, 5.05663, 7.47941}, +{96.0535, 5.21722, 7.46088}, +{97.6071, 5.38272, 7.44238}, +{99.1858, 5.56287, 7.42395}, +{100.790, 5.76027, 7.36974}, +{102.420, 5.92746, 7.29136}, +{104.077, 6.07806, 7.21382}, +{105.760, 6.21847, 7.13710}, +{107.471, 6.35123, 7.06120}, +{109.209, 6.47782, 6.98610}, +{110.975, 6.59919, 6.91181}, +{112.770, 6.71608, 6.83830}, +{114.594, 6.82905, 6.76558}, +{116.448, 6.93857, 6.69362}, +{118.331, 7.04510, 6.62244}, +{120.245, 7.14905, 6.55202}, +{122.190, 7.25111, 6.48233}, +{124.166, 7.35243, 6.41171}, +{126.175, 7.44995, 6.34007}, +{128.215, 7.54438, 6.26925}, +{130.289, 7.63664, 6.19922}, +{132.397, 7.72710, 6.12997}, +{134.538, 7.81608, 6.06149}, +{136.714, 7.90397, 5.99377}, +{138.925, 7.99117, 5.92682}, +{141.172, 8.07824, 5.86061}, +{143.456, 8.16605, 5.79514}, +{145.776, 8.25638, 5.73040}, +{148.134, 8.35595, 5.66639}, +{150.530, 8.45437, 5.57644}, +{152.964, 8.53980, 5.48463}, +{155.439, 8.61598, 5.39434}, +{157.953, 8.68701, 5.30552}, +{160.507, 8.75383, 5.21817}, +{163.103, 8.81713, 5.13226}, +{165.742, 8.87736, 5.04777}, +{168.422, 8.93490, 4.96465}, +{171.146, 8.99006, 4.88292}, +{173.915, 9.04309, 4.80253}, +{176.727, 9.09424, 4.72346}, +{179.586, 9.14374, 4.64569}, +{182.491, 9.19183, 4.56920}, +{185.442, 9.23877, 4.49398}, +{188.442, 9.28488, 4.41999}, +{191.489, 9.33065, 4.34722}, +{194.587, 9.37694, 4.27564}, +{197.734, 9.42700, 4.20525}, +{200.932, 9.47721, 4.12344}, +{204.182, 9.51989, 4.03997}, +{207.485, 9.55672, 3.95818}, +{210.840, 9.59030, 3.87805}, +{214.251, 9.62118, 3.79954}, +{217.716, 9.64978, 3.72262}, +{221.237, 9.67639, 3.64726}, +{224.816, 9.70123, 3.57342}, +{228.452, 9.72450, 3.50108}, +{232.147, 9.74638, 3.43020}, +{235.902, 9.76703, 3.36076}, +{239.717, 9.78660, 3.29272}, +{243.595, 9.80525, 3.22606}, +{247.535, 9.82320, 3.16075}, +{251.538, 9.84068, 3.09676}, +{255.607, 9.85812, 3.03407}, +{259.741, 9.87783, 2.97265}, +{263.942, 9.89789, 2.90618}, +{268.211, 9.91284, 2.83824}, +{272.549, 9.92460, 2.77188}, +{276.957, 9.93420, 2.70708}, +{281.437, 9.94206, 2.64379}, +{285.989, 9.94845, 2.58198}, +{290.615, 9.95356, 2.52162}, +{295.315, 9.95754, 2.46267}, +{300.092, 9.96050, 2.40509}, +{304.945, 9.96254, 2.34887}, +{309.878, 9.96376, 2.29396}, +{314.890, 9.96422, 2.24033}, +{319.983, 9.96402, 2.18795}, +{325.158, 9.96323, 2.13680}, +{330.418, 9.96195, 2.08684}, +{335.762, 9.96028, 2.03805}, +{341.192, 9.95838, 1.99041}, +{346.711, 9.95734, 1.94388}, +{352.319, 9.95588, 1.89573}, +{358.017, 9.95232, 1.84798}, +{363.808, 9.94743, 1.80144}, +{369.692, 9.94158, 1.75607}, +{375.672, 9.93492, 1.71184}, +{381.748, 9.92757, 1.66873}, +{387.922, 9.91958, 1.62670}, +{394.197, 9.91101, 1.58573}, +{400.573, 9.90191, 1.54579}, +{407.052, 9.89231, 1.50686}, +{413.635, 9.88223, 1.46890}, +{420.326, 9.87171, 1.43191}, +{427.124, 9.86076, 1.39584}, +{434.032, 9.84939, 1.36069}, +{441.052, 9.83762, 1.32642}, +{448.186, 9.82544, 1.29301}, +{455.435, 9.81287, 1.26045}, +{462.802, 9.79988, 1.22870}, +{470.287, 9.78647, 1.19775}, +{477.894, 9.77233, 1.16759}, +{485.623, 9.75786, 1.13889}, +{493.478, 9.74347, 1.11108}, +{501.459, 9.72898, 1.08395}, +{509.570, 9.71428, 1.05744}, +{517.812, 9.69932, 1.03155}, +{526.187, 9.68408, 1.00629}, +{534.698, 9.66853, 0.981590}, +{543.346, 9.65271, 0.957444}, +{552.134, 9.63644, 0.933713}, +{561.065, 9.61965, 0.910558}, +{570.139, 9.60243, 0.887949}, +{579.361, 9.58457, 0.865735}, +{588.732, 9.56605, 0.844073}, +{598.254, 9.54575, 0.823237}, +{607.930, 9.52566, 0.804790}, +{617.763, 9.50632, 0.787093}, +{627.755, 9.48803, 0.769875}, +{637.908, 9.47032, 0.751284}, +{648.226, 9.45186, 0.730662}, +{658.711, 9.43025, 0.709016}, +{669.365, 9.40579, 0.688027}, +{680.191, 9.37895, 0.669590}, +{691.193, 9.35176, 0.653119}, +{702.372, 9.32520, 0.637470}, +{713.733, 9.29807, 0.621030}, +{725.277, 9.26898, 0.604227}, +{737.008, 9.23798, 0.587853}, +{748.928, 9.20514, 0.571943}, +{761.042, 9.17037, 0.556473}, +{773.351, 9.13354, 0.541370}, +{785.859, 9.09436, 0.526506}, +{798.570, 9.05237, 0.511915}, +{811.486, 9.00730, 0.497760}, +{824.611, 8.95881, 0.483985}, +{837.949, 8.90639, 0.470581}, +{851.502, 8.84948, 0.457646}, +{865.274, 8.78742, 0.445154}, +{879.269, 8.71942, 0.433081}, +{893.491, 8.64432, 0.421336}, +{907.943, 8.56067, 0.409910}, +{922.628, 8.46670, 0.398795}, +{937.551, 8.35944, 0.387375}, +{952.715, 8.23504, 0.376134}, +{968.124, 8.08800, 0.365090}, +{983.783, 7.91008, 0.354370}, +{999.695, 7.68757, 0.343972}, +{1015.86, 7.39535, 0.333887}, +{1032.29, 6.97970, 0.324144}, +{1048.99, 6.28827, 0.314686}, +{1065.96, 4.35430, 0.305505}, +{1070.70, -0.861678, 0.303012}, +{1070.90, -0.858176, 4.56315}, +{1083.20, 5.77584, 4.48199}, +{1100.72, 7.05429, 4.37039}, +{1118.52, 7.74835, 4.26157}, +{1136.61, 8.23083, 4.15551}, +{1155.00, 8.60108, 4.05207}, +{1173.68, 8.90076, 3.95118}, +{1192.66, 9.15156, 3.85283}, +{1211.95, 9.36631, 3.75692}, +{1231.55, 9.55317, 3.66337}, +{1251.47, 9.71780, 3.57219}, +{1271.72, 9.86424, 3.48328}, +{1292.29, 9.99550, 3.39658}, +{1313.19, 10.1139, 3.31201}, +{1334.43, 10.2211, 3.22955}, +{1356.01, 10.3186, 3.14913}, +{1377.94, 10.4077, 3.07076}, +{1400.23, 10.4894, 2.99433}, +{1422.88, 10.5643, 2.91977}, +{1445.89, 10.6333, 2.84711}, +{1469.28, 10.6969, 2.77625}, +{1493.04, 10.7556, 2.70714}, +{1517.19, 10.8099, 2.63981}, +{1541.73, 10.8602, 2.57417}, +{1566.67, 10.9070, 2.51017}, +{1592.01, 10.9504, 2.44775}, +{1617.76, 10.9908, 2.38689}, +{1643.92, 11.0286, 2.32756}, +{1670.51, 11.0639, 2.26967}, +{1697.53, 11.0970, 2.21324}, +{1724.99, 11.1289, 2.15824}, +{1752.89, 11.1588, 2.10256}, +{1781.24, 11.1861, 2.04765}, +{1810.05, 11.2107, 1.99371}, +{1839.32, 11.2329, 1.94119}, +{1869.07, 11.2533, 1.89005}, +{1899.30, 11.2719, 1.84025}, +{1930.02, 11.2890, 1.79176}, +{1961.24, 11.3047, 1.74456}, +{1992.96, 11.3189, 1.69862}, +{2025.20, 11.3327, 1.65480}, +{2057.95, 11.3459, 1.61025}, +{2091.24, 11.3574, 1.56664}, +{2125.06, 11.3676, 1.52408}, +{2159.43, 11.3766, 1.48254}, +{2194.36, 11.3847, 1.44197}, +{2229.85, 11.3918, 1.40236}, +{2265.92, 11.3981, 1.36373}, +{2302.57, 11.4035, 1.32597}, +{2339.81, 11.4080, 1.28918}, +{2377.66, 11.4119, 1.25329}, +{2416.11, 11.4151, 1.21828}, +{2455.19, 11.4176, 1.18414}, +{2494.90, 11.4196, 1.15087}, +{2535.26, 11.4209, 1.11842}, +{2576.26, 11.4217, 1.08680}, +{2617.93, 11.4221, 1.05600}, +{2660.27, 11.4220, 1.02598}, +{2703.30, 11.4214, 0.996722}, +{2747.03, 11.4204, 0.968234}, +{2791.46, 11.4191, 0.940485}, +{2836.61, 11.4173, 0.913468}, +{2882.49, 11.4153, 0.887163}, +{2929.11, 11.4130, 0.861554}, +{2976.48, 11.4103, 0.836624}, +{3024.63, 11.4074, 0.812351}, +{3073.55, 11.4043, 0.788746}, +{3123.26, 11.4010, 0.765755}, +{3173.78, 11.3974, 0.743395}, +{3225.11, 11.3937, 0.721644}, +{3277.27, 11.3897, 0.700476}, +{3330.28, 11.3856, 0.679893}, +{3384.15, 11.3814, 0.659883}, +{3438.88, 11.3771, 0.640411}, +{3494.50, 11.3726, 0.621488}, +{3551.02, 11.3680, 0.603067}, +{3608.46, 11.3633, 0.585176}, +{3666.82, 11.3586, 0.567775}, +{3726.13, 11.3537, 0.550867}, +{3786.40, 11.3488, 0.534432}, +{3847.64, 11.3439, 0.518461}, +{3909.87, 11.3389, 0.502941}, +{3973.11, 11.3339, 0.487859}, +{4037.38, 11.3288, 0.473204}, +{4102.68, 11.3237, 0.458952}, +{4169.03, 11.3186, 0.445127}, +{4236.46, 11.3135, 0.431680}, +{4304.98, 11.3083, 0.418640}, +{4374.62, 11.3032, 0.405953}, +{4445.37, 11.2981, 0.393637}, +{4517.27, 11.2930, 0.381676}, +{4590.33, 11.2879, 0.370061}, +{4664.58, 11.2828, 0.358789}, +{4740.03, 11.2777, 0.347849}, +{4816.69, 11.2727, 0.337226}, +{4894.60, 11.2677, 0.326910}, +{4973.77, 11.2628, 0.316871}, +{5054.21, 11.2578, 0.307154}, +{5135.96, 11.2529, 0.297721}, +{5219.03, 11.2481, 0.288568}, +{5303.44, 11.2433, 0.279665}, +{5389.22, 11.2386, 0.271038}, +{5476.39, 11.2338, 0.262663}, +{5564.97, 11.2292, 0.254539}, +{5654.98, 11.2246, 0.246653}, +{5746.44, 11.2200, 0.239003}, +{5839.39, 11.2155, 0.231581}, +{5933.83, 11.2111, 0.224381}, +{6029.81, 11.2067, 0.217395}, +{6127.33, 11.2023, 0.210617}, +{6226.44, 11.1981, 0.204045}, +{6327.15, 11.1938, 0.197670}, +{6429.48, 11.1897, 0.191485}, +{6533.48, 11.1856, 0.185487}, +{6639.15, 11.1815, 0.179670}, +{6746.54, 11.1776, 0.174028}, +{6855.65, 11.1736, 0.168557}, +{6966.54, 11.1698, 0.163253}, +{7079.22, 11.1660, 0.158110}, +{7193.72, 11.1622, 0.153120}, +{7310.07, 11.1586, 0.148287}, +{7428.31, 11.1550, 0.143596}, +{7548.45, 11.1514, 0.139051}, +{7670.54, 11.1479, 0.134644}, +{7794.61, 11.1445, 0.130374}, +{7920.68, 11.1411, 0.126234}, +{8048.79, 11.1378, 0.122218}, +{8178.98, 11.1345, 0.118330}, +{8311.26, 11.1313, 0.114557}, +{8445.69, 11.1282, 0.110903}, +{8582.29, 11.1251, 0.107363}, +{8721.11, 11.1221, 0.103929}, +{8862.16, 11.1191, 0.100602}, +{9005.50, 11.1162, 0.973804E-01}, +{9151.16, 11.1133, 0.942536E-01}, +{9299.17, 11.1105, 0.912268E-01}, +{9449.58, 11.1078, 0.882941E-01}, +{9602.42, 11.1051, 0.854530E-01}, +{9757.73, 11.1024, 0.827005E-01}, +{9915.55, 11.0999, 0.800322E-01}, +{10075.9, 11.0973, 0.774482E-01}, +{10238.9, 11.0948, 0.749450E-01}, +{10404.5, 11.0924, 0.725201E-01}, +{10572.8, 11.0900, 0.701711E-01}, +{10743.8, 11.0877, 0.678958E-01}, +{10917.6, 11.0854, 0.656919E-01}, +{11094.2, 11.0831, 0.635572E-01}, +{11273.6, 11.0810, 0.614898E-01}, +{11455.9, 11.0788, 0.594875E-01}, +{11641.2, 11.0767, 0.575483E-01}, +{11829.5, 11.0746, 0.556703E-01}, +{12020.8, 11.0726, 0.538517E-01}, +{12215.3, 11.0707, 0.520907E-01}, +{12412.8, 11.0687, 0.503855E-01}, +{12613.6, 11.0668, 0.487343E-01}, +{12817.6, 11.0650, 0.471356E-01}, +{13025.0, 11.0632, 0.455877E-01}, +{13235.6, 11.0614, 0.440890E-01}, +{13449.7, 11.0597, 0.426382E-01}, +{13667.2, 11.0580, 0.412335E-01}, +{13888.3, 11.0564, 0.398738E-01}, +{14112.9, 11.0548, 0.385575E-01}, +{14341.2, 11.0532, 0.372834E-01}, +{14573.1, 11.0516, 0.360501E-01}, +{14808.9, 11.0501, 0.348564E-01}, +{15048.4, 11.0487, 0.337010E-01}, +{15291.8, 11.0472, 0.325828E-01}, +{15539.1, 11.0458, 0.315006E-01}, +{15790.4, 11.0445, 0.304532E-01}, +{16045.8, 11.0431, 0.294397E-01}, +{16305.4, 11.0418, 0.284589E-01}, +{16569.1, 11.0405, 0.275099E-01}, +{16837.1, 11.0393, 0.265915E-01}, +{17109.4, 11.0381, 0.257030E-01}, +{17386.1, 11.0369, 0.248433E-01}, +{17667.4, 11.0357, 0.240116E-01}, +{17953.1, 11.0346, 0.232069E-01}, +{18243.5, 11.0335, 0.224285E-01}, +{18538.6, 11.0324, 0.216755E-01}, +{18838.4, 11.0313, 0.209470E-01}, +{19143.1, 11.0303, 0.202424E-01}, +{19452.7, 11.0293, 0.195609E-01}, +{19767.4, 11.0283, 0.189017E-01}, +{20087.1, 11.0273, 0.182679E-01}, +{20412.0, 11.0264, 0.176514E-01}, +{20742.1, 11.0255, 0.170554E-01}, +{21077.6, 11.0246, 0.164792E-01}, +{21418.5, 11.0237, 0.159221E-01}, +{21765.0, 11.0229, 0.153835E-01}, +{22117.0, 11.0221, 0.148628E-01}, +{22474.7, 11.0213, 0.143595E-01}, +{22838.2, 11.0205, 0.138729E-01}, +{23207.6, 11.0197, 0.134024E-01}, +{23583.0, 11.0190, 0.129476E-01}, +{23964.4, 11.0182, 0.125080E-01}, +{24352.0, 11.0175, 0.120830E-01}, +{24745.9, 11.0168, 0.116721E-01}, +{25146.2, 11.0162, 0.112749E-01}, +{25552.9, 11.0155, 0.108910E-01}, +{25966.2, 11.0149, 0.105198E-01}, +{26386.1, 11.0142, 0.101610E-01}, +{26812.9, 11.0136, 0.981422E-02}, +{27246.6, 11.0130, 0.947897E-02}, +{27687.3, 11.0125, 0.915492E-02}, +{28135.1, 11.0119, 0.884169E-02}, +{28590.2, 11.0113, 0.853893E-02}, +{29052.6, 11.0108, 0.824628E-02}, +{29522.5, 11.0103, 0.796342E-02}, +{30000.0, 11.0098, 0.769003E-02}, +{0, 0, 0} +}; + +e_fp_fdp mg[] = { /* Z = 12 */ +{10.0000, -9999.00, 0.925044}, +{10.1617, -9999.00, 0.793444}, +{10.3261, -9999.00, 0.680567}, +{10.4931, -9999.00, 0.583747}, +{10.6628, -9999.00, 0.500699}, +{10.8353, -9999.00, 0.429469}, +{11.0106, -9999.00, 0.368371}, +{11.1886, -9999.00, 0.315965}, +{11.3696, -9999.00, 0.271014}, +{11.5535, -9999.00, 0.232459}, +{11.7404, -9999.00, 0.211041}, +{11.9303, -9999.00, 0.201813}, +{12.1232, -9999.00, 0.192988}, +{12.3193, -9999.00, 0.184549}, +{12.5186, -9999.00, 0.176479}, +{12.7210, -9999.00, 0.168762}, +{12.9268, -9999.00, 0.161383}, +{13.1359, -9999.00, 0.154326}, +{13.3483, -9999.00, 0.147578}, +{13.5642, -9999.00, 0.141125}, +{13.7836, -9999.00, 0.134954}, +{14.0066, -9999.00, 0.129053}, +{14.2331, -9999.00, 0.123410}, +{14.4633, -9999.00, 0.118013}, +{14.6973, -9999.00, 0.112853}, +{14.9350, -9999.00, 0.107918}, +{15.1765, -9999.00, 0.103199}, +{15.4220, -9999.00, 0.986868E-01}, +{15.6714, -9999.00, 0.943715E-01}, +{15.9249, -9999.00, 0.902449E-01}, +{16.1825, -9999.00, 0.862988E-01}, +{16.4442, -9999.00, 0.859980E-01}, +{16.7102, -9999.00, 0.862263E-01}, +{16.9805, -9999.00, 0.864552E-01}, +{17.2551, -9999.00, 0.866847E-01}, +{17.5342, -9999.00, 0.869148E-01}, +{17.8178, -9999.00, 0.871455E-01}, +{18.1060, -9999.00, 0.873768E-01}, +{18.3989, -9999.00, 0.876087E-01}, +{18.6964, -9999.00, 0.878412E-01}, +{18.9988, -9999.00, 0.880745E-01}, +{19.3061, -9999.00, 0.883082E-01}, +{19.6184, -9999.00, 0.899293E-01}, +{19.9357, -9999.00, 0.917246E-01}, +{20.2582, -9999.00, 0.935558E-01}, +{20.5858, -9999.00, 0.954235E-01}, +{20.9188, -9999.00, 0.973285E-01}, +{21.2571, -9999.00, 0.992715E-01}, +{21.6009, -9999.00, 0.101253}, +{21.9503, -9999.00, 0.103275}, +{22.3053, -9999.00, 0.105337}, +{22.6661, -9999.00, 0.107439}, +{23.0327, -9999.00, 0.109584}, +{23.4053, -9999.00, 0.111772}, +{23.7838, -9999.00, 0.114003}, +{24.1685, -9999.00, 0.116279}, +{24.5594, -9999.00, 0.118601}, +{24.9566, -9999.00, 0.120969}, +{25.3603, -9999.00, 0.123384}, +{25.7705, -9999.00, 0.125847}, +{26.1873, -9999.00, 0.127326}, +{26.6109, -9999.00, 0.128800}, +{27.0413, -9999.00, 0.130291}, +{27.4786, -9999.00, 0.131798}, +{27.9231, -9999.00, 0.133324}, +{28.3747, -9999.00, 0.134867}, +{28.8337, -9999.00, 0.136428}, +{29.3000, 1.28306, 0.138006}, +{29.7739, 1.26035, 0.139604}, +{30.2555, 1.23660, 0.141219}, +{30.7449, 1.21176, 0.142854}, +{31.2421, 1.18579, 0.144507}, +{31.7475, 1.15865, 0.146179}, +{32.2609, 1.13051, 0.147871}, +{32.7827, 1.10145, 0.149152}, +{33.3130, 1.07038, 0.149283}, +{33.8518, 1.03704, 0.149415}, +{34.3993, 1.00158, 0.149547}, +{34.9557, 0.963920, 0.149679}, +{35.5211, 0.923943, 0.149811}, +{36.0956, 0.881497, 0.149943}, +{36.6794, 0.836407, 0.150076}, +{37.2727, 0.788491, 0.150208}, +{37.8755, 0.737595, 0.150341}, +{38.4882, 0.683992, 0.150473}, +{39.1107, 0.626607, 0.148531}, +{39.7432, 0.563719, 0.145775}, +{40.3861, 0.494750, 0.143069}, +{41.0393, 0.419553, 0.140414}, +{41.7031, 0.337346, 0.137808}, +{42.3776, 0.247091, 0.135250}, +{43.0630, 0.147466, 0.132794}, +{43.7595, 0.366648E-01, 0.130386}, +{44.4673, -0.878440E-01, 0.128021}, +{45.1865, -0.229706, 0.125699}, +{45.9174, -0.394682, 0.123419}, +{46.6600, -0.592764, 0.121619}, +{47.4147, -0.838664, 0.123035}, +{48.1816, -1.17162, 0.124468}, +{48.9609, -1.74178, 0.125918}, +{49.4000, -2.66223, 0.126731}, +{49.6000, -2.72520, 1.67475}, +{49.7528, -2.31057, 1.69596}, +{50.5576, -1.77151, 1.81096}, +{51.3753, -1.62590, 1.93377}, +{52.2062, -1.56726, 2.06490}, +{53.0506, -1.54554, 2.20492}, +{53.9087, -1.54170, 2.35444}, +{54.7806, -1.54710, 2.51410}, +{55.6667, -1.55512, 2.68459}, +{56.5670, -1.56166, 2.86663}, +{57.4820, -1.56114, 3.06103}, +{58.4117, -1.54510, 3.26859}, +{59.3564, -1.49011, 3.48238}, +{60.3165, -1.43611, 3.64316}, +{61.2921, -1.39939, 3.81136}, +{62.2834, -1.36536, 3.98732}, +{63.2908, -1.32880, 4.17141}, +{64.3145, -1.28667, 4.36400}, +{65.3547, -1.23542, 4.56548}, +{66.4118, -1.16176, 4.77626}, +{67.4859, -1.06036, 4.97750}, +{68.5775, -0.964643, 5.14266}, +{69.6867, -0.881115, 5.31329}, +{70.8138, -0.800267, 5.48959}, +{71.9591, -0.723011, 5.67174}, +{73.1230, -0.649063, 5.88066}, +{74.3057, -0.551523, 6.12027}, +{75.5076, -0.385048, 6.36964}, +{76.7289, -0.190817, 6.56452}, +{77.9699, -0.134145E-01, 6.73571}, +{79.2310, 0.162804, 6.91135}, +{80.5125, 0.357263, 7.09158}, +{81.8147, 0.569237, 7.26009}, +{83.1380, 0.800413, 7.41951}, +{84.4827, 1.06871, 7.56137}, +{85.8491, 1.32247, 7.62538}, +{87.2377, 1.54667, 7.68993}, +{88.6487, 1.76303, 7.75136}, +{90.0825, 1.97522, 7.80845}, +{91.5395, 2.18356, 7.85861}, +{93.0201, 2.38810, 7.90391}, +{94.5246, 2.59042, 7.94441}, +{96.0535, 2.79106, 7.97987}, +{97.6071, 2.98884, 8.00922}, +{99.1858, 3.18419, 8.03453}, +{100.790, 3.37764, 8.05500}, +{102.420, 3.56993, 8.07185}, +{104.077, 3.75994, 8.08214}, +{105.760, 3.94730, 8.08897}, +{107.471, 4.13343, 8.09198}, +{109.209, 4.31733, 8.08993}, +{110.975, 4.49878, 8.08436}, +{112.770, 4.67860, 8.07520}, +{114.594, 4.85678, 8.06173}, +{116.448, 5.03231, 8.04380}, +{118.331, 5.20502, 8.02275}, +{120.245, 5.37577, 7.99874}, +{122.190, 5.54459, 7.97099}, +{124.166, 5.71065, 7.93965}, +{126.175, 5.87427, 7.90585}, +{128.215, 6.03605, 7.86914}, +{130.289, 6.19570, 7.82887}, +{132.397, 6.35269, 7.78561}, +{134.538, 6.50692, 7.73949}, +{136.714, 6.65859, 7.69090}, +{138.925, 6.80781, 7.63976}, +{141.172, 6.95448, 7.58619}, +{143.456, 7.09862, 7.53029}, +{145.776, 7.24023, 7.47213}, +{148.134, 7.37940, 7.41176}, +{150.530, 7.51594, 7.34912}, +{152.964, 7.64976, 7.28448}, +{155.439, 7.78099, 7.21797}, +{157.953, 7.90960, 7.14950}, +{160.507, 8.03551, 7.07932}, +{163.103, 8.15884, 7.00745}, +{165.742, 8.27957, 6.93394}, +{168.422, 8.39759, 6.85870}, +{171.146, 8.51283, 6.78202}, +{173.915, 8.62529, 6.70394}, +{176.727, 8.73505, 6.62468}, +{179.586, 8.84210, 6.54414}, +{182.491, 8.94655, 6.46261}, +{185.442, 9.04811, 6.37969}, +{188.442, 9.14704, 6.29627}, +{191.489, 9.24355, 6.21157}, +{194.587, 9.33722, 6.12593}, +{197.734, 9.42817, 6.03952}, +{200.932, 9.51635, 5.95227}, +{204.182, 9.60172, 5.86444}, +{207.485, 9.68419, 5.77596}, +{210.840, 9.76407, 5.68749}, +{214.251, 9.84144, 5.59833}, +{217.716, 9.91588, 5.50887}, +{221.237, 9.98777, 5.41942}, +{224.816, 10.0573, 5.32966}, +{228.452, 10.1241, 5.23957}, +{232.147, 10.1881, 5.14959}, +{235.902, 10.2496, 5.05976}, +{239.717, 10.3087, 4.97009}, +{243.595, 10.3653, 4.88051}, +{247.535, 10.4194, 4.79106}, +{251.538, 10.4708, 4.70203}, +{255.607, 10.5202, 4.61364}, +{259.741, 10.5672, 4.52525}, +{263.942, 10.6116, 4.43749}, +{268.211, 10.6538, 4.35040}, +{272.549, 10.6938, 4.26396}, +{276.957, 10.7316, 4.17818}, +{281.437, 10.7673, 4.09312}, +{285.989, 10.8009, 4.00888}, +{290.615, 10.8325, 3.92543}, +{295.315, 10.8622, 3.84289}, +{300.092, 10.8899, 3.76097}, +{304.945, 10.9156, 3.68008}, +{309.878, 10.9397, 3.60052}, +{314.890, 10.9621, 3.52132}, +{319.983, 10.9823, 3.44358}, +{325.158, 11.0013, 3.36695}, +{330.418, 11.0185, 3.29090}, +{335.762, 11.0339, 3.21632}, +{341.192, 11.0481, 3.14293}, +{346.711, 11.0609, 3.07051}, +{352.319, 11.0721, 2.99906}, +{358.017, 11.0819, 2.92891}, +{363.808, 11.0905, 2.85991}, +{369.692, 11.0978, 2.79206}, +{375.672, 11.1038, 2.72528}, +{381.748, 11.1085, 2.65960}, +{387.922, 11.1121, 2.59553}, +{394.197, 11.1147, 2.53231}, +{400.573, 11.1162, 2.47064}, +{407.052, 11.1169, 2.40995}, +{413.635, 11.1166, 2.35039}, +{420.326, 11.1154, 2.29197}, +{427.124, 11.1132, 2.23451}, +{434.032, 11.1100, 2.17832}, +{441.052, 11.1060, 2.12336}, +{448.186, 11.1013, 2.06943}, +{455.435, 11.0956, 2.01670}, +{462.802, 11.0892, 1.96521}, +{470.287, 11.0823, 1.91498}, +{477.894, 11.0748, 1.86558}, +{485.623, 11.0665, 1.81746}, +{493.478, 11.0577, 1.77036}, +{501.459, 11.0482, 1.72415}, +{509.570, 11.0382, 1.67908}, +{517.812, 11.0275, 1.63494}, +{526.187, 11.0162, 1.59213}, +{534.698, 11.0048, 1.55011}, +{543.346, 10.9927, 1.50875}, +{552.134, 10.9797, 1.46845}, +{561.065, 10.9662, 1.42970}, +{570.139, 10.9529, 1.39167}, +{579.361, 10.9388, 1.35382}, +{588.732, 10.9241, 1.31794}, +{598.254, 10.9094, 1.28214}, +{607.930, 10.8934, 1.24710}, +{617.763, 10.8772, 1.21386}, +{627.755, 10.8610, 1.18073}, +{637.908, 10.8441, 1.14872}, +{648.226, 10.8267, 1.11698}, +{658.711, 10.8088, 1.08685}, +{669.365, 10.7904, 1.05629}, +{680.191, 10.7712, 1.02794}, +{691.193, 10.7521, 0.999157}, +{702.372, 10.7321, 0.971770}, +{713.733, 10.7116, 0.944684}, +{725.277, 10.6907, 0.918818}, +{737.008, 10.6690, 0.892689}, +{748.928, 10.6465, 0.868305}, +{761.042, 10.6239, 0.843442}, +{773.351, 10.5998, 0.819702}, +{785.859, 10.5753, 0.796849}, +{798.570, 10.5500, 0.774110}, +{811.486, 10.5236, 0.752512}, +{824.611, 10.4966, 0.730864}, +{837.949, 10.4678, 0.710001}, +{851.502, 10.4383, 0.690546}, +{865.274, 10.4080, 0.670220}, +{879.269, 10.3756, 0.651105}, +{893.491, 10.3423, 0.632241}, +{907.943, 10.3069, 0.613651}, +{922.628, 10.2693, 0.595822}, +{937.551, 10.2301, 0.578832}, +{952.715, 10.1879, 0.561041}, +{968.124, 10.1426, 0.545052}, +{983.783, 10.0906, 0.529008}, +{999.695, 10.0380, 0.525262}, +{1015.86, 9.99147, 0.510831}, +{1032.29, 9.93634, 0.496893}, +{1048.99, 9.87582, 0.483246}, +{1065.96, 9.80931, 0.469879}, +{1083.20, 9.73584, 0.456885}, +{1100.72, 9.65419, 0.444252}, +{1118.52, 9.56260, 0.431968}, +{1136.61, 9.45870, 0.420021}, +{1155.00, 9.33916, 0.408405}, +{1173.68, 9.19918, 0.397112}, +{1192.66, 9.03146, 0.386127}, +{1211.95, 8.82413, 0.375447}, +{1231.55, 8.55613, 0.365066}, +{1251.47, 8.18440, 0.355016}, +{1271.72, 7.59699, 0.345289}, +{1292.29, 6.27650, 0.335885}, +{1302.90, 0.193487, 0.331189}, +{1303.10, 0.196396, 4.46720}, +{1313.19, 6.34747, 4.41667}, +{1334.43, 7.91579, 4.31336}, +{1356.01, 8.66482, 4.21247}, +{1377.94, 9.16725, 4.11397}, +{1400.23, 9.54661, 4.01774}, +{1422.88, 9.85105, 3.92374}, +{1445.89, 10.1046, 3.83197}, +{1469.28, 10.3212, 3.74241}, +{1493.04, 10.5095, 3.65503}, +{1517.19, 10.6755, 3.56991}, +{1541.73, 10.8236, 3.48680}, +{1566.67, 10.9567, 3.40561}, +{1592.01, 11.0772, 3.32632}, +{1617.76, 11.1869, 3.24889}, +{1643.92, 11.2874, 3.17328}, +{1670.51, 11.3800, 3.09941}, +{1697.53, 11.4658, 3.02727}, +{1724.99, 11.5464, 2.95683}, +{1752.89, 11.6222, 2.88462}, +{1781.24, 11.6909, 2.81304}, +{1810.05, 11.7536, 2.74243}, +{1839.32, 11.8109, 2.67357}, +{1869.07, 11.8637, 2.60642}, +{1899.30, 11.9124, 2.54098}, +{1930.02, 11.9575, 2.47719}, +{1961.24, 11.9995, 2.41499}, +{1992.96, 12.0381, 2.35432}, +{2025.20, 12.0748, 2.29660}, +{2057.95, 12.1106, 2.23733}, +{2091.24, 12.1426, 2.17918}, +{2125.06, 12.1719, 2.12232}, +{2159.43, 12.1989, 2.06667}, +{2194.36, 12.2237, 2.01221}, +{2229.85, 12.2465, 1.95898}, +{2265.92, 12.2675, 1.90689}, +{2302.57, 12.2866, 1.85598}, +{2339.81, 12.3042, 1.80623}, +{2377.66, 12.3201, 1.75758}, +{2416.11, 12.3346, 1.71015}, +{2455.19, 12.3479, 1.66379}, +{2494.90, 12.3597, 1.61844}, +{2535.26, 12.3704, 1.57425}, +{2576.26, 12.3799, 1.53110}, +{2617.93, 12.3884, 1.48903}, +{2660.27, 12.3960, 1.44797}, +{2703.30, 12.4026, 1.40788}, +{2747.03, 12.4083, 1.36879}, +{2791.46, 12.4133, 1.33067}, +{2836.61, 12.4174, 1.29350}, +{2882.49, 12.4208, 1.25727}, +{2929.11, 12.4235, 1.22195}, +{2976.48, 12.4256, 1.18753}, +{3024.63, 12.4272, 1.15400}, +{3073.55, 12.4281, 1.12132}, +{3123.26, 12.4285, 1.08948}, +{3173.78, 12.4285, 1.05847}, +{3225.11, 12.4280, 1.02828}, +{3277.27, 12.4271, 0.998862}, +{3330.28, 12.4257, 0.970228}, +{3384.15, 12.4240, 0.942357}, +{3438.88, 12.4220, 0.915219}, +{3494.50, 12.4196, 0.888815}, +{3551.02, 12.4170, 0.863111}, +{3608.46, 12.4141, 0.838088}, +{3666.82, 12.4109, 0.813743}, +{3726.13, 12.4075, 0.790079}, +{3786.40, 12.4039, 0.767030}, +{3847.64, 12.4001, 0.744627}, +{3909.87, 12.3961, 0.722839}, +{3973.11, 12.3919, 0.701651}, +{4037.38, 12.3876, 0.681040}, +{4102.68, 12.3832, 0.660987}, +{4169.03, 12.3786, 0.641500}, +{4236.46, 12.3740, 0.622564}, +{4304.98, 12.3692, 0.604156}, +{4374.62, 12.3644, 0.586252}, +{4445.37, 12.3594, 0.568843}, +{4517.27, 12.3544, 0.551929}, +{4590.33, 12.3494, 0.535513}, +{4664.58, 12.3443, 0.519538}, +{4740.03, 12.3391, 0.504023}, +{4816.69, 12.3340, 0.488957}, +{4894.60, 12.3288, 0.474312}, +{4973.77, 12.3236, 0.460073}, +{5054.21, 12.3184, 0.446257}, +{5135.96, 12.3131, 0.432841}, +{5219.03, 12.3079, 0.419788}, +{5303.44, 12.3027, 0.407142}, +{5389.22, 12.2975, 0.394823}, +{5476.39, 12.2923, 0.382882}, +{5564.97, 12.2871, 0.371283}, +{5654.98, 12.2820, 0.360049}, +{5746.44, 12.2768, 0.349097}, +{5839.39, 12.2718, 0.338494}, +{5933.83, 12.2667, 0.328186}, +{6029.81, 12.2617, 0.318185}, +{6127.33, 12.2567, 0.308475}, +{6226.44, 12.2518, 0.299050}, +{6327.15, 12.2469, 0.289903}, +{6429.48, 12.2420, 0.281025}, +{6533.48, 12.2372, 0.272409}, +{6639.15, 12.2325, 0.264045}, +{6746.54, 12.2278, 0.255930}, +{6855.65, 12.2231, 0.248059}, +{6966.54, 12.2186, 0.240419}, +{7079.22, 12.2140, 0.233003}, +{7193.72, 12.2096, 0.225810}, +{7310.07, 12.2051, 0.218830}, +{7428.31, 12.2008, 0.212064}, +{7548.45, 12.1965, 0.205494}, +{7670.54, 12.1923, 0.199123}, +{7794.61, 12.1881, 0.192944}, +{7920.68, 12.1840, 0.186949}, +{8048.79, 12.1799, 0.181132}, +{8178.98, 12.1759, 0.175491}, +{8311.26, 12.1720, 0.170021}, +{8445.69, 12.1681, 0.164716}, +{8582.29, 12.1643, 0.159573}, +{8721.11, 12.1606, 0.154583}, +{8862.16, 12.1569, 0.149745}, +{9005.50, 12.1533, 0.145051}, +{9151.16, 12.1497, 0.140504}, +{9299.17, 12.1462, 0.136089}, +{9449.58, 12.1428, 0.131812}, +{9602.42, 12.1394, 0.127666}, +{9757.73, 12.1361, 0.123644}, +{9915.55, 12.1329, 0.119748}, +{10075.9, 12.1297, 0.115968}, +{10238.9, 12.1265, 0.112305}, +{10404.5, 12.1234, 0.108753}, +{10572.8, 12.1204, 0.105310}, +{10743.8, 12.1175, 0.101972}, +{10917.6, 12.1146, 0.987374E-01}, +{11094.2, 12.1117, 0.956017E-01}, +{11273.6, 12.1089, 0.925624E-01}, +{11455.9, 12.1062, 0.896166E-01}, +{11641.2, 12.1035, 0.867616E-01}, +{11829.5, 12.1008, 0.839945E-01}, +{12020.8, 12.0983, 0.813128E-01}, +{12215.3, 12.0957, 0.787139E-01}, +{12412.8, 12.0932, 0.761954E-01}, +{12613.6, 12.0908, 0.737547E-01}, +{12817.6, 12.0884, 0.713897E-01}, +{13025.0, 12.0861, 0.690979E-01}, +{13235.6, 12.0838, 0.668773E-01}, +{13449.7, 12.0816, 0.647256E-01}, +{13667.2, 12.0794, 0.626407E-01}, +{13888.3, 12.0773, 0.606208E-01}, +{14112.9, 12.0752, 0.586636E-01}, +{14341.2, 12.0731, 0.567674E-01}, +{14573.1, 12.0711, 0.549303E-01}, +{14808.9, 12.0691, 0.531506E-01}, +{15048.4, 12.0672, 0.514265E-01}, +{15291.8, 12.0653, 0.497562E-01}, +{15539.1, 12.0635, 0.481382E-01}, +{15790.4, 12.0617, 0.465708E-01}, +{16045.8, 12.0599, 0.450526E-01}, +{16305.4, 12.0582, 0.435819E-01}, +{16569.1, 12.0565, 0.421575E-01}, +{16837.1, 12.0549, 0.407777E-01}, +{17109.4, 12.0533, 0.394413E-01}, +{17386.1, 12.0517, 0.381470E-01}, +{17667.4, 12.0502, 0.368933E-01}, +{17953.1, 12.0487, 0.356792E-01}, +{18243.5, 12.0472, 0.345034E-01}, +{18538.6, 12.0458, 0.333647E-01}, +{18838.4, 12.0443, 0.322619E-01}, +{19143.1, 12.0430, 0.311940E-01}, +{19452.7, 12.0416, 0.301599E-01}, +{19767.4, 12.0403, 0.291585E-01}, +{20087.1, 12.0390, 0.281917E-01}, +{20412.0, 12.0378, 0.272533E-01}, +{20742.1, 12.0366, 0.263454E-01}, +{21077.6, 12.0354, 0.254671E-01}, +{21418.5, 12.0342, 0.246174E-01}, +{21765.0, 12.0331, 0.237953E-01}, +{22117.0, 12.0320, 0.230000E-01}, +{22474.7, 12.0309, 0.222307E-01}, +{22838.2, 12.0298, 0.214865E-01}, +{23207.6, 12.0288, 0.207665E-01}, +{23583.0, 12.0278, 0.200701E-01}, +{23964.4, 12.0268, 0.193964E-01}, +{24352.0, 12.0258, 0.187448E-01}, +{24745.9, 12.0249, 0.181145E-01}, +{25146.2, 12.0240, 0.175048E-01}, +{25552.9, 12.0231, 0.169151E-01}, +{25966.2, 12.0222, 0.163447E-01}, +{26386.1, 12.0213, 0.157930E-01}, +{26812.9, 12.0205, 0.152594E-01}, +{27246.6, 12.0197, 0.147434E-01}, +{27687.3, 12.0189, 0.142443E-01}, +{28135.1, 12.0181, 0.137616E-01}, +{28590.2, 12.0174, 0.132949E-01}, +{29052.6, 12.0167, 0.128435E-01}, +{29522.5, 12.0159, 0.124069E-01}, +{30000.0, 12.0152, 0.119848E-01}, +{0, 0, 0} +}; + +} // namespace table_data + +}}} // namespace cctbx::eltbx::henke diff --git a/extern/cctbx/cctbx/eltbx/henke_tables_13_24.cpp b/extern/cctbx/cctbx/eltbx/henke_tables_13_24.cpp new file mode 100644 index 00000000..edde81ad --- /dev/null +++ b/extern/cctbx/cctbx/eltbx/henke_tables_13_24.cpp @@ -0,0 +1,6116 @@ +/* ***************************************************** + THIS IS AN AUTOMATICALLY GENERATED FILE. DO NOT EDIT. + ***************************************************** + + Generated by: + cctbx.source_generators.eltbx.generate_henke_cpp + */ + +#include + +namespace cctbx { namespace eltbx { namespace henke { + +namespace table_data { + +using anomalous::e_fp_fdp; + +e_fp_fdp al[] = { /* Z = 13 */ +{10.0000, -9999.00, 3.11990}, +{10.1617, -9999.00, 3.05822}, +{10.3261, -9999.00, 2.99776}, +{10.4931, -9999.00, 2.93850}, +{10.6628, -9999.00, 2.88041}, +{10.8353, -9999.00, 2.82347}, +{11.0106, -9999.00, 2.76766}, +{11.1886, -9999.00, 2.72200}, +{11.3696, -9999.00, 2.69148}, +{11.5535, -9999.00, 2.66129}, +{11.7404, -9999.00, 2.63145}, +{11.9303, -9999.00, 2.60195}, +{12.1232, -9999.00, 2.57277}, +{12.3193, -9999.00, 2.54392}, +{12.5186, -9999.00, 2.51539}, +{12.7210, -9999.00, 2.46668}, +{12.9268, -9999.00, 2.41373}, +{13.1359, -9999.00, 2.36192}, +{13.3483, -9999.00, 2.30898}, +{13.5642, -9999.00, 2.23405}, +{13.7836, -9999.00, 2.15356}, +{14.0066, -9999.00, 2.06069}, +{14.2331, -9999.00, 1.96756}, +{14.4633, -9999.00, 1.81305}, +{14.6973, -9999.00, 1.35947}, +{14.9350, -9999.00, 0.902011}, +{15.1765, -9999.00, 0.609172}, +{15.4220, -9999.00, 0.439681}, +{15.6714, -9999.00, 0.372037}, +{15.9249, -9999.00, 0.326005}, +{16.1825, -9999.00, 0.285669}, +{16.4442, -9999.00, 0.247205}, +{16.7102, -9999.00, 0.213520}, +{16.9805, -9999.00, 0.196522}, +{17.2551, -9999.00, 0.181095}, +{17.5342, -9999.00, 0.168385}, +{17.8178, -9999.00, 0.160808}, +{18.1060, -9999.00, 0.153573}, +{18.3989, -9999.00, 0.146663}, +{18.6964, -9999.00, 0.140063}, +{18.9988, -9999.00, 0.133164}, +{19.3061, -9999.00, 0.126575}, +{19.6184, -9999.00, 0.120312}, +{19.9357, -9999.00, 0.114360}, +{20.2582, -9999.00, 0.109752}, +{20.5858, -9999.00, 0.111010}, +{20.9188, -9999.00, 0.112282}, +{21.2571, -9999.00, 0.113569}, +{21.6009, -9999.00, 0.114870}, +{21.9503, -9999.00, 0.116186}, +{22.3053, -9999.00, 0.117518}, +{22.6661, -9999.00, 0.118864}, +{23.0327, -9999.00, 0.120227}, +{23.4053, -9999.00, 0.122751}, +{23.7838, -9999.00, 0.126315}, +{24.1685, -9999.00, 0.129984}, +{24.5594, -9999.00, 0.133759}, +{24.9566, -9999.00, 0.137643}, +{25.3603, -9999.00, 0.141640}, +{25.7705, -9999.00, 0.145495}, +{26.1873, -9999.00, 0.148244}, +{26.6109, -9999.00, 0.151045}, +{27.0413, -9999.00, 0.153898}, +{27.4786, -9999.00, 0.156806}, +{27.9231, -9999.00, 0.159768}, +{28.3747, -9999.00, 0.162787}, +{28.8337, -9999.00, 0.165863}, +{29.3000, 2.34285, 0.168996}, +{29.7739, 2.32717, 0.172189}, +{30.2555, 2.31139, 0.175442}, +{30.7449, 2.29552, 0.178757}, +{31.2421, 2.27956, 0.182134}, +{31.7475, 2.26350, 0.185575}, +{32.2609, 2.24754, 0.189081}, +{32.7827, 2.23175, 0.192378}, +{33.3130, 2.21555, 0.194561}, +{33.8518, 2.19843, 0.196767}, +{34.3993, 2.18068, 0.198999}, +{34.9557, 2.16235, 0.201256}, +{35.5211, 2.14342, 0.203539}, +{36.0956, 2.12388, 0.205847}, +{36.6794, 2.10371, 0.208182}, +{37.2727, 2.08287, 0.210544}, +{37.8755, 2.06135, 0.212932}, +{38.4882, 2.03911, 0.215347}, +{39.1107, 2.01612, 0.217789}, +{39.7432, 1.99237, 0.220259}, +{40.3861, 1.96797, 0.222758}, +{41.0393, 1.94295, 0.225068}, +{41.7031, 1.91682, 0.226470}, +{42.3776, 1.88912, 0.227880}, +{43.0630, 1.86007, 0.229299}, +{43.7595, 1.82966, 0.230727}, +{44.4673, 1.79787, 0.232164}, +{45.1865, 1.76466, 0.233610}, +{45.9174, 1.73005, 0.235064}, +{46.6600, 1.69399, 0.236528}, +{47.4147, 1.65814, 0.238001}, +{48.1816, 1.62074, 0.235842}, +{48.9609, 1.57843, 0.232104}, +{49.7528, 1.53229, 0.228425}, +{50.5576, 1.48252, 0.224805}, +{51.3753, 1.42904, 0.221242}, +{52.2062, 1.37159, 0.217735}, +{53.0506, 1.30972, 0.214284}, +{53.9087, 1.24315, 0.211759}, +{54.7806, 1.17229, 0.209829}, +{55.6667, 1.09675, 0.207917}, +{56.5670, 1.01559, 0.206022}, +{57.4820, 0.928103, 0.204145}, +{58.4117, 0.833427, 0.202284}, +{59.3564, 0.729805, 0.200441}, +{60.3165, 0.616720, 0.200207}, +{61.2921, 0.494009, 0.200602}, +{62.2834, 0.359171, 0.200998}, +{63.2908, 0.206766, 0.201394}, +{64.3145, 0.367838E-01, 0.208215}, +{65.3547, -0.150100, 0.215821}, +{66.4118, -0.363400, 0.223705}, +{67.4859, -0.612251, 0.231878}, +{68.5775, -0.913185, 0.239512}, +{69.6867, -1.29772, 0.247287}, +{70.8138, -1.83916, 0.255315}, +{71.9591, -2.82640, 0.263603}, +{72.6000, -4.71870, 0.268298}, +{72.8000, -4.77865, 3.05391}, +{73.1230, -3.57738, 3.10106}, +{74.3057, -2.58986, 3.27808}, +{75.5076, -2.24498, 3.46521}, +{76.7289, -2.04974, 3.66301}, +{77.9699, -1.91658, 3.87212}, +{79.2310, -1.81173, 4.09316}, +{80.5125, -1.71207, 4.32681}, +{81.8147, -1.61278, 4.55877}, +{83.1380, -1.51695, 4.80227}, +{84.4827, -1.40821, 5.05877}, +{85.8491, -1.24639, 5.32897}, +{87.2377, -1.04412, 5.54566}, +{88.6487, -0.869623, 5.69070}, +{90.0825, -0.729715, 5.83953}, +{91.5395, -0.602517, 5.99225}, +{93.0201, -0.481649, 6.14897}, +{94.5246, -0.363849, 6.30978}, +{96.0535, -0.246485, 6.47480}, +{97.6071, -0.127798, 6.64413}, +{99.1858, -0.572152E-02, 6.81790}, +{100.790, 0.121587, 6.99620}, +{102.420, 0.257648, 7.17918}, +{104.077, 0.408417, 7.36022}, +{105.760, 0.563135, 7.52866}, +{107.471, 0.713525, 7.70096}, +{109.209, 0.869599, 7.87720}, +{110.975, 1.03257, 8.05748}, +{112.770, 1.20465, 8.24188}, +{114.594, 1.38785, 8.43050}, +{116.448, 1.58511, 8.62344}, +{118.331, 1.79993, 8.82080}, +{120.245, 2.03832, 9.02267}, +{122.190, 2.31105, 9.22916}, +{124.166, 2.65726, 9.44037}, +{126.175, 3.05450, 9.49754}, +{128.215, 3.37636, 9.51114}, +{130.289, 3.65455, 9.52475}, +{132.397, 3.91635, 9.53840}, +{134.538, 4.16654, 9.55206}, +{136.714, 4.40886, 9.56573}, +{138.925, 4.64594, 9.57943}, +{141.172, 4.87987, 9.59315}, +{143.456, 5.11258, 9.60689}, +{145.776, 5.34618, 9.62064}, +{148.134, 5.58438, 9.63443}, +{150.530, 5.83549, 9.64822}, +{152.964, 6.09089, 9.62310}, +{155.439, 6.32655, 9.59689}, +{157.953, 6.55613, 9.57075}, +{160.507, 6.78302, 9.54468}, +{163.103, 7.00948, 9.51868}, +{165.742, 7.23759, 9.49275}, +{168.422, 7.46980, 9.46689}, +{171.146, 7.70942, 9.44111}, +{173.915, 7.96219, 9.41540}, +{176.727, 8.24313, 9.38975}, +{179.586, 8.57964, 9.31472}, +{182.491, 8.88946, 9.13115}, +{185.442, 9.11623, 8.95119}, +{188.442, 9.32069, 8.77477}, +{191.489, 9.50496, 8.60184}, +{194.587, 9.67311, 8.43231}, +{197.734, 9.82798, 8.26612}, +{200.932, 9.97197, 8.10317}, +{204.182, 10.1053, 7.93953}, +{207.485, 10.2265, 7.77920}, +{210.840, 10.3376, 7.62210}, +{214.251, 10.4388, 7.46817}, +{217.716, 10.5299, 7.31736}, +{221.237, 10.6083, 7.16959}, +{224.816, 10.6680, 7.03532}, +{228.452, 10.7284, 6.92993}, +{232.147, 10.8042, 6.82611}, +{235.902, 10.8811, 6.72384}, +{239.717, 10.9592, 6.62312}, +{243.595, 11.0380, 6.52389}, +{247.535, 11.1176, 6.42616}, +{251.538, 11.1983, 6.32988}, +{255.607, 11.2808, 6.23505}, +{259.741, 11.3664, 6.14164}, +{263.942, 11.4630, 6.04964}, +{268.211, 11.5725, 5.94856}, +{272.549, 11.6747, 5.80523}, +{276.957, 11.7511, 5.66535}, +{281.437, 11.8159, 5.52884}, +{285.989, 11.8724, 5.39563}, +{290.615, 11.9222, 5.26561}, +{295.315, 11.9664, 5.13874}, +{300.092, 12.0058, 5.01492}, +{304.945, 12.0408, 4.89409}, +{309.878, 12.0718, 4.77616}, +{314.890, 12.0993, 4.66108}, +{319.983, 12.1235, 4.54877}, +{325.158, 12.1445, 4.43917}, +{330.418, 12.1625, 4.33221}, +{335.762, 12.1777, 4.22782}, +{341.192, 12.1900, 4.12595}, +{346.711, 12.1992, 4.02654}, +{352.319, 12.2049, 3.92952}, +{358.017, 12.2045, 3.83484}, +{363.808, 12.1998, 3.75388}, +{369.692, 12.2008, 3.67818}, +{375.672, 12.2048, 3.60400}, +{381.748, 12.2097, 3.53133}, +{387.922, 12.2152, 3.46011}, +{394.197, 12.2210, 3.39034}, +{400.573, 12.2270, 3.32197}, +{407.052, 12.2333, 3.25498}, +{413.635, 12.2399, 3.18934}, +{420.326, 12.2470, 3.12502}, +{427.124, 12.2549, 3.06201}, +{434.032, 12.2652, 3.00026}, +{441.052, 12.2773, 2.93296}, +{448.186, 12.2849, 2.86424}, +{455.435, 12.2892, 2.79730}, +{462.802, 12.2920, 2.73189}, +{470.287, 12.2937, 2.66798}, +{477.894, 12.2943, 2.60559}, +{485.623, 12.2945, 2.54463}, +{493.478, 12.2942, 2.48490}, +{501.459, 12.2939, 2.42570}, +{509.570, 12.2928, 2.36643}, +{517.812, 12.2896, 2.30801}, +{526.187, 12.2852, 2.25125}, +{534.698, 12.2801, 2.19625}, +{543.346, 12.2748, 2.14277}, +{552.134, 12.2700, 2.09062}, +{561.065, 12.2653, 2.03805}, +{570.139, 12.2592, 1.98589}, +{579.361, 12.2522, 1.93406}, +{588.732, 12.2437, 1.88338}, +{598.254, 12.2344, 1.83389}, +{607.930, 12.2243, 1.78571}, +{617.763, 12.2138, 1.73879}, +{627.755, 12.2034, 1.69298}, +{637.908, 12.1929, 1.64704}, +{648.226, 12.1814, 1.60038}, +{658.711, 12.1674, 1.55377}, +{669.365, 12.1491, 1.50856}, +{680.191, 12.1287, 1.46882}, +{691.193, 12.1108, 1.43328}, +{702.372, 12.0954, 1.39941}, +{713.733, 12.0820, 1.36380}, +{725.277, 12.0674, 1.32737}, +{737.008, 12.0514, 1.29193}, +{748.928, 12.0350, 1.25742}, +{761.042, 12.0181, 1.22382}, +{773.351, 12.0009, 1.19100}, +{785.859, 11.9834, 1.15872}, +{798.570, 11.9652, 1.12705}, +{811.486, 11.9463, 1.09624}, +{824.611, 11.9269, 1.06625}, +{837.949, 11.9070, 1.03708}, +{851.502, 11.8866, 1.00870}, +{865.274, 11.8656, 0.981035}, +{879.269, 11.8441, 0.954065}, +{893.491, 11.8220, 0.927842}, +{907.943, 11.7992, 0.902346}, +{922.628, 11.7759, 0.877557}, +{937.551, 11.7519, 0.853321}, +{952.715, 11.7270, 0.829761}, +{968.124, 11.7013, 0.806859}, +{983.783, 11.6747, 0.784555}, +{999.695, 11.6472, 0.762967}, +{1015.86, 11.6184, 0.742081}, +{1032.29, 11.5888, 0.722661}, +{1048.99, 11.5591, 0.703173}, +{1065.96, 11.5278, 0.683588}, +{1083.20, 11.4947, 0.664537}, +{1100.72, 11.4600, 0.646018}, +{1118.52, 11.4234, 0.628015}, +{1136.61, 11.3849, 0.610519}, +{1155.00, 11.3440, 0.593506}, +{1173.68, 11.3007, 0.576965}, +{1192.66, 11.2544, 0.560888}, +{1211.95, 11.2049, 0.545258}, +{1231.55, 11.1516, 0.530064}, +{1251.47, 11.0938, 0.515441}, +{1271.72, 11.0310, 0.501380}, +{1292.29, 10.9622, 0.487892}, +{1313.19, 10.8865, 0.474763}, +{1334.43, 10.8021, 0.461987}, +{1356.01, 10.7069, 0.449555}, +{1377.94, 10.5980, 0.437459}, +{1400.23, 10.4713, 0.425689}, +{1422.88, 10.3206, 0.414239}, +{1445.89, 10.1361, 0.403093}, +{1469.28, 9.90068, 0.392100}, +{1493.04, 9.58044, 0.381187}, +{1517.19, 9.09216, 0.369680}, +{1541.73, 8.11537, 0.358399}, +{1559.50, 1.89396, 0.350553}, +{1559.70, 1.89589, 4.16629}, +{1566.67, 7.10441, 4.14105}, +{1592.01, 9.03572, 4.05144}, +{1617.76, 9.80337, 3.96379}, +{1643.92, 10.2995, 3.87809}, +{1670.51, 10.6690, 3.79420}, +{1697.53, 10.9642, 3.71213}, +{1724.99, 11.2121, 3.63182}, +{1752.89, 11.4254, 3.54896}, +{1781.24, 11.6086, 3.46653}, +{1810.05, 11.7695, 3.38494}, +{1839.32, 11.9117, 3.30527}, +{1869.07, 12.0391, 3.22747}, +{1899.30, 12.1540, 3.15148}, +{1930.02, 12.2583, 3.07731}, +{1961.24, 12.3536, 3.00489}, +{1992.96, 12.4408, 2.93417}, +{2025.20, 12.5226, 2.86696}, +{2057.95, 12.6001, 2.79699}, +{2091.24, 12.6695, 2.72803}, +{2125.06, 12.7334, 2.66035}, +{2159.43, 12.7923, 2.59405}, +{2194.36, 12.8467, 2.52881}, +{2229.85, 12.8969, 2.46498}, +{2265.92, 12.9433, 2.40235}, +{2302.57, 12.9861, 2.34101}, +{2339.81, 13.0257, 2.28095}, +{2377.66, 13.0622, 2.22204}, +{2416.11, 13.0960, 2.16445}, +{2455.19, 13.1272, 2.10810}, +{2494.90, 13.1560, 2.05284}, +{2535.26, 13.1825, 1.99885}, +{2576.26, 13.2068, 1.94606}, +{2617.93, 13.2292, 1.89447}, +{2660.27, 13.2498, 1.84400}, +{2703.30, 13.2687, 1.79474}, +{2747.03, 13.2859, 1.74651}, +{2791.46, 13.3016, 1.69945}, +{2836.61, 13.3159, 1.65350}, +{2882.49, 13.3288, 1.60862}, +{2929.11, 13.3405, 1.56481}, +{2976.48, 13.3510, 1.52204}, +{3024.63, 13.3604, 1.48033}, +{3073.55, 13.3688, 1.43961}, +{3123.26, 13.3762, 1.39989}, +{3173.78, 13.3827, 1.36116}, +{3225.11, 13.3883, 1.32339}, +{3277.27, 13.3932, 1.28657}, +{3330.28, 13.3973, 1.25064}, +{3384.15, 13.4007, 1.21564}, +{3438.88, 13.4034, 1.18154}, +{3494.50, 13.4055, 1.14831}, +{3551.02, 13.4070, 1.11591}, +{3608.46, 13.4080, 1.08436}, +{3666.82, 13.4085, 1.05363}, +{3726.13, 13.4085, 1.02369}, +{3786.40, 13.4081, 0.994542}, +{3847.64, 13.4072, 0.966167}, +{3909.87, 13.4060, 0.938535}, +{3973.11, 13.4044, 0.911645}, +{4037.38, 13.4025, 0.885448}, +{4102.68, 13.4003, 0.859966}, +{4169.03, 13.3978, 0.835163}, +{4236.46, 13.3950, 0.811033}, +{4304.98, 13.3920, 0.787559}, +{4374.62, 13.3888, 0.764708}, +{4445.37, 13.3853, 0.742491}, +{4517.27, 13.3817, 0.720878}, +{4590.33, 13.3779, 0.699839}, +{4664.58, 13.3739, 0.679399}, +{4740.03, 13.3698, 0.659516}, +{4816.69, 13.3656, 0.640176}, +{4894.60, 13.3612, 0.621389}, +{4973.77, 13.3568, 0.603106}, +{5054.21, 13.3522, 0.585342}, +{5135.96, 13.3476, 0.568080}, +{5219.03, 13.3429, 0.551279}, +{5303.44, 13.3381, 0.534968}, +{5389.22, 13.3332, 0.519116}, +{5476.39, 13.3284, 0.503715}, +{5564.97, 13.3235, 0.488726}, +{5654.98, 13.3185, 0.474187}, +{5746.44, 13.3135, 0.460062}, +{5839.39, 13.3086, 0.446336}, +{5933.83, 13.3036, 0.433003}, +{6029.81, 13.2986, 0.420026}, +{6127.33, 13.2936, 0.407459}, +{6226.44, 13.2886, 0.395224}, +{6327.15, 13.2836, 0.383348}, +{6429.48, 13.2786, 0.371815}, +{6533.48, 13.2737, 0.360616}, +{6639.15, 13.2687, 0.349739}, +{6746.54, 13.2638, 0.339182}, +{6855.65, 13.2590, 0.328927}, +{6966.54, 13.2541, 0.318973}, +{7079.22, 13.2493, 0.309309}, +{7193.72, 13.2446, 0.299926}, +{7310.07, 13.2398, 0.290817}, +{7428.31, 13.2352, 0.281974}, +{7548.45, 13.2305, 0.273391}, +{7670.54, 13.2259, 0.265058}, +{7794.61, 13.2214, 0.256972}, +{7920.68, 13.2169, 0.249121}, +{8048.79, 13.2124, 0.241506}, +{8178.98, 13.2081, 0.234114}, +{8311.26, 13.2037, 0.226938}, +{8445.69, 13.1994, 0.219978}, +{8582.29, 13.1952, 0.213218}, +{8721.11, 13.1910, 0.206663}, +{8862.16, 13.1869, 0.200304}, +{9005.50, 13.1829, 0.194131}, +{9151.16, 13.1789, 0.188140}, +{9299.17, 13.1749, 0.182331}, +{9449.58, 13.1711, 0.176693}, +{9602.42, 13.1672, 0.171229}, +{9757.73, 13.1635, 0.165921}, +{9915.55, 13.1598, 0.160780}, +{10075.9, 13.1561, 0.155788}, +{10238.9, 13.1526, 0.150945}, +{10404.5, 13.1490, 0.146248}, +{10572.8, 13.1456, 0.141693}, +{10743.8, 13.1422, 0.137274}, +{10917.6, 13.1388, 0.132988}, +{11094.2, 13.1355, 0.128831}, +{11273.6, 13.1323, 0.124800}, +{11455.9, 13.1291, 0.120890}, +{11641.2, 13.1260, 0.117099}, +{11829.5, 13.1229, 0.113422}, +{12020.8, 13.1199, 0.109856}, +{12215.3, 13.1170, 0.106398}, +{12412.8, 13.1141, 0.103045}, +{12613.6, 13.1112, 0.997941E-01}, +{12817.6, 13.1084, 0.966416E-01}, +{13025.0, 13.1057, 0.935848E-01}, +{13235.6, 13.1030, 0.906209E-01}, +{13449.7, 13.1004, 0.877473E-01}, +{13667.2, 13.0978, 0.849611E-01}, +{13888.3, 13.0953, 0.822598E-01}, +{14112.9, 13.0928, 0.796408E-01}, +{14341.2, 13.0903, 0.771018E-01}, +{14573.1, 13.0880, 0.746402E-01}, +{14808.9, 13.0856, 0.722539E-01}, +{15048.4, 13.0833, 0.699405E-01}, +{15291.8, 13.0811, 0.676979E-01}, +{15539.1, 13.0789, 0.655240E-01}, +{15790.4, 13.0768, 0.634165E-01}, +{16045.8, 13.0746, 0.613737E-01}, +{16305.4, 13.0726, 0.593935E-01}, +{16569.1, 13.0706, 0.574741E-01}, +{16837.1, 13.0686, 0.556136E-01}, +{17109.4, 13.0667, 0.538102E-01}, +{17386.1, 13.0648, 0.520623E-01}, +{17667.4, 13.0629, 0.503681E-01}, +{17953.1, 13.0611, 0.487260E-01}, +{18243.5, 13.0593, 0.471345E-01}, +{18538.6, 13.0576, 0.455920E-01}, +{18838.4, 13.0559, 0.440970E-01}, +{19143.1, 13.0542, 0.426482E-01}, +{19452.7, 13.0526, 0.412440E-01}, +{19767.4, 13.0510, 0.398831E-01}, +{20087.1, 13.0494, 0.385533E-01}, +{20412.0, 13.0479, 0.372771E-01}, +{20742.1, 13.0464, 0.360423E-01}, +{21077.6, 13.0449, 0.348475E-01}, +{21418.5, 13.0435, 0.336915E-01}, +{21765.0, 13.0421, 0.325731E-01}, +{22117.0, 13.0407, 0.314909E-01}, +{22474.7, 13.0394, 0.304440E-01}, +{22838.2, 13.0381, 0.294311E-01}, +{23207.6, 13.0368, 0.284511E-01}, +{23583.0, 13.0356, 0.275030E-01}, +{23964.4, 13.0343, 0.265858E-01}, +{24352.0, 13.0331, 0.256985E-01}, +{24745.9, 13.0320, 0.248401E-01}, +{25146.2, 13.0308, 0.240097E-01}, +{25552.9, 13.0297, 0.232064E-01}, +{25966.2, 13.0287, 0.224293E-01}, +{26386.1, 13.0276, 0.216776E-01}, +{26812.9, 13.0266, 0.209505E-01}, +{27246.6, 13.0256, 0.202471E-01}, +{27687.3, 13.0246, 0.195668E-01}, +{28135.1, 13.0236, 0.189087E-01}, +{28590.2, 13.0227, 0.182722E-01}, +{29052.6, 13.0218, 0.176565E-01}, +{29522.5, 13.0209, 0.170611E-01}, +{30000.0, 13.0198, 0.164852E-01}, +{0, 0, 0} +}; + +e_fp_fdp si[] = { /* Z = 14 */ +{10.0000, -9999.00, 4.00688}, +{10.1617, -9999.00, 4.00859}, +{10.3261, -9999.00, 4.01031}, +{10.4931, -9999.00, 4.01202}, +{10.6628, -9999.00, 4.01374}, +{10.8353, -9999.00, 4.01545}, +{11.0106, -9999.00, 4.01717}, +{11.1886, -9999.00, 4.01889}, +{11.3696, -9999.00, 4.02061}, +{11.5535, -9999.00, 4.02233}, +{11.7404, -9999.00, 4.02405}, +{11.9303, -9999.00, 4.02577}, +{12.1232, -9999.00, 4.00013}, +{12.3193, -9999.00, 3.95924}, +{12.5186, -9999.00, 3.91877}, +{12.7210, -9999.00, 3.87870}, +{12.9268, -9999.00, 3.83905}, +{13.1359, -9999.00, 3.79981}, +{13.3483, -9999.00, 3.76096}, +{13.5642, -9999.00, 3.72251}, +{13.7836, -9999.00, 3.68446}, +{14.0066, -9999.00, 3.64507}, +{14.2331, -9999.00, 3.55014}, +{14.4633, -9999.00, 3.45769}, +{14.6973, -9999.00, 3.36763}, +{14.9350, -9999.00, 3.27993}, +{15.1765, -9999.00, 3.19451}, +{15.4220, -9999.00, 3.11132}, +{15.6714, -9999.00, 3.03029}, +{15.9249, -9999.00, 2.95136}, +{16.1825, -9999.00, 2.83110}, +{16.4442, -9999.00, 2.69866}, +{16.7102, -9999.00, 2.57241}, +{16.9805, -9999.00, 2.45207}, +{17.2551, -9999.00, 2.33736}, +{17.5342, -9999.00, 2.22801}, +{17.8178, -9999.00, 2.12378}, +{18.1060, -9999.00, 1.97551}, +{18.3989, -9999.00, 1.76134}, +{18.6964, -9999.00, 1.57040}, +{18.9988, -9999.00, 1.40015}, +{19.3061, -9999.00, 1.24837}, +{19.6184, -9999.00, 1.11303}, +{19.9357, -9999.00, 0.992371}, +{20.2582, -9999.00, 0.862309}, +{20.5858, -9999.00, 0.753545}, +{20.9188, -9999.00, 0.698853}, +{21.2571, -9999.00, 0.648131}, +{21.6009, -9999.00, 0.602534}, +{21.9503, -9999.00, 0.561517}, +{22.3053, -9999.00, 0.523292}, +{22.6661, -9999.00, 0.496905}, +{23.0327, -9999.00, 0.478083}, +{23.4053, -9999.00, 0.459974}, +{23.7838, -9999.00, 0.442552}, +{24.1685, -9999.00, 0.425789}, +{24.5594, -9999.00, 0.413106}, +{24.9566, -9999.00, 0.403049}, +{25.3603, -9999.00, 0.393236}, +{25.7705, -9999.00, 0.383663}, +{26.1873, -9999.00, 0.374323}, +{26.6109, -9999.00, 0.365209}, +{27.0413, -9999.00, 0.366284}, +{27.4786, -9999.00, 0.367369}, +{27.9231, -9999.00, 0.368458}, +{28.3747, -9999.00, 0.369549}, +{28.8337, -9999.00, 0.370644}, +{29.3000, 4.04139, 0.371742}, +{29.7739, 4.01454, 0.372844}, +{30.2555, 3.98864, 0.373949}, +{30.7449, 3.96353, 0.375057}, +{31.2421, 3.93824, 0.376168}, +{31.7475, 3.91330, 0.378082}, +{32.2609, 3.88933, 0.381990}, +{32.7827, 3.86697, 0.385940}, +{33.3130, 3.84562, 0.389930}, +{33.8518, 3.82508, 0.393962}, +{34.3993, 3.80523, 0.398035}, +{34.9557, 3.78598, 0.402151}, +{35.5211, 3.76728, 0.406309}, +{36.0956, 3.74907, 0.410510}, +{36.6794, 3.73131, 0.414754}, +{37.2727, 3.71400, 0.419042}, +{37.8755, 3.69713, 0.423375}, +{38.4882, 3.68075, 0.427752}, +{39.1107, 3.66515, 0.432175}, +{39.7432, 3.65075, 0.435542}, +{40.3861, 3.63600, 0.437140}, +{41.0393, 3.61975, 0.438744}, +{41.7031, 3.60317, 0.440353}, +{42.3776, 3.58620, 0.441968}, +{43.0630, 3.56885, 0.443589}, +{43.7595, 3.55113, 0.445216}, +{44.4673, 3.53304, 0.446849}, +{45.1865, 3.51458, 0.448488}, +{45.9174, 3.49586, 0.450133}, +{46.6600, 3.47671, 0.451191}, +{47.4147, 3.45675, 0.451973}, +{48.1816, 3.43573, 0.452756}, +{48.9609, 3.41387, 0.453540}, +{49.7528, 3.39107, 0.454326}, +{50.5576, 3.36726, 0.455112}, +{51.3753, 3.34236, 0.455901}, +{52.2062, 3.31547, 0.456691}, +{53.0506, 3.28696, 0.458296}, +{53.9087, 3.25789, 0.461941}, +{54.7806, 3.22860, 0.465616}, +{55.6667, 3.19848, 0.469319}, +{56.5670, 3.16724, 0.473052}, +{57.4820, 3.13464, 0.476815}, +{58.4117, 3.09985, 0.480608}, +{59.3564, 3.06106, 0.484431}, +{60.3165, 3.02161, 0.494934}, +{61.2921, 2.98391, 0.506494}, +{62.2834, 2.94697, 0.518325}, +{63.2908, 2.91044, 0.530432}, +{64.3145, 2.87467, 0.542822}, +{65.3547, 2.84253, 0.554883}, +{66.4118, 2.80778, 0.558960}, +{67.4859, 2.76948, 0.563068}, +{68.5775, 2.72973, 0.567206}, +{69.6867, 2.69075, 0.571374}, +{70.8138, 2.65359, 0.566787}, +{71.9591, 2.60604, 0.552950}, +{73.1230, 2.54939, 0.539453}, +{74.3057, 2.48874, 0.526284}, +{75.5076, 2.42506, 0.504753}, +{76.7289, 2.34452, 0.477393}, +{77.9699, 2.24588, 0.451516}, +{79.2310, 2.13308, 0.427357}, +{80.5125, 2.00763, 0.422615}, +{81.8147, 1.87992, 0.417925}, +{83.1380, 1.74284, 0.413288}, +{84.4827, 1.58757, 0.409319}, +{85.8491, 1.41949, 0.415940}, +{87.2377, 1.24204, 0.422667}, +{88.6487, 1.04516, 0.429504}, +{90.0825, 0.823388, 0.436451}, +{91.5395, 0.567875, 0.444919}, +{93.0201, 0.269396, 0.456522}, +{94.5246, -0.903649E-01, 0.468427}, +{96.0535, -0.553028, 0.480642}, +{97.6071, -1.22076, 0.493176}, +{99.1858, -2.61173, 0.506036}, +{99.7000, -4.36195, 0.510252}, +{99.9000, -4.42226, 3.36544}, +{100.790, -2.52757, 3.48839}, +{102.420, -1.89095, 3.72231}, +{104.077, -1.65223, 3.97192}, +{105.760, -1.53188, 4.23827}, +{107.471, -1.46339, 4.52248}, +{109.209, -1.42872, 4.82575}, +{110.975, -1.40389, 5.16049}, +{112.770, -1.37428, 5.52407}, +{114.594, -1.33243, 5.91327}, +{116.448, -1.27205, 6.32988}, +{118.331, -1.20547, 6.78138}, +{120.245, -1.08948, 7.30531}, +{122.190, -0.832441, 7.86971}, +{124.166, -0.419940, 8.38835}, +{126.175, -0.149922E-01, 8.75826}, +{128.215, 0.463892, 9.14448}, +{130.289, 0.980470, 9.40977}, +{132.397, 1.46277, 9.52408}, +{134.538, 1.87540, 9.63977}, +{136.714, 2.28508, 9.75686}, +{138.925, 2.73049, 9.81468}, +{141.172, 3.13306, 9.78032}, +{143.456, 3.44155, 9.74609}, +{145.776, 3.72300, 9.71197}, +{148.134, 3.97029, 9.65439}, +{150.530, 4.12976, 9.58865}, +{152.964, 4.21870, 9.57811}, +{155.439, 4.30732, 9.75261}, +{157.953, 4.49148, 9.93028}, +{160.507, 4.71640, 10.1112}, +{163.103, 4.97350, 10.3054}, +{165.742, 5.28403, 10.5171}, +{168.422, 5.71179, 10.7332}, +{171.146, 6.19378, 10.7766}, +{173.915, 6.64140, 10.8012}, +{176.727, 7.05872, 10.7479}, +{179.586, 7.47284, 10.6948}, +{182.491, 7.89655, 10.5963}, +{185.442, 8.28845, 10.3962}, +{188.442, 8.59635, 10.1999}, +{191.489, 8.86152, 10.0113}, +{194.587, 9.10569, 9.83461}, +{197.734, 9.33495, 9.66100}, +{200.932, 9.54801, 9.49045}, +{204.182, 9.74711, 9.32291}, +{207.485, 9.93385, 9.15833}, +{210.840, 10.1095, 8.99666}, +{214.251, 10.2752, 8.83784}, +{217.716, 10.4318, 8.68182}, +{221.237, 10.5801, 8.52856}, +{224.816, 10.7209, 8.37800}, +{228.452, 10.8546, 8.23010}, +{232.147, 10.9818, 8.08481}, +{235.902, 11.1031, 7.94208}, +{239.717, 11.2188, 7.80188}, +{243.595, 11.3294, 7.66415}, +{247.535, 11.4352, 7.52885}, +{251.538, 11.5366, 7.39594}, +{255.607, 11.6340, 7.26538}, +{259.741, 11.7276, 7.13712}, +{263.942, 11.8178, 7.01113}, +{268.211, 11.9051, 6.88736}, +{272.549, 11.9896, 6.76577}, +{276.957, 12.0721, 6.64634}, +{281.437, 12.1530, 6.52900}, +{285.989, 12.2334, 6.41375}, +{290.615, 12.3167, 6.30052}, +{295.315, 12.4047, 6.17775}, +{300.092, 12.4852, 6.04345}, +{304.945, 12.5494, 5.91207}, +{309.878, 12.6085, 5.78356}, +{314.890, 12.6624, 5.65783}, +{319.983, 12.7119, 5.53483}, +{325.158, 12.7575, 5.41451}, +{330.418, 12.7995, 5.29681}, +{335.762, 12.8383, 5.18166}, +{341.192, 12.8742, 5.06902}, +{346.711, 12.9073, 4.95882}, +{352.319, 12.9378, 4.85102}, +{358.017, 12.9658, 4.74557}, +{363.808, 12.9915, 4.64240}, +{369.692, 13.0149, 4.54148}, +{375.672, 13.0357, 4.44276}, +{381.748, 13.0537, 4.34688}, +{387.922, 13.0707, 4.25572}, +{394.197, 13.0875, 4.16648}, +{400.573, 13.1036, 4.07911}, +{407.052, 13.1187, 3.99357}, +{413.635, 13.1328, 3.90983}, +{420.326, 13.1461, 3.82784}, +{427.124, 13.1584, 3.74757}, +{434.032, 13.1699, 3.66899}, +{441.052, 13.1806, 3.59205}, +{448.186, 13.1906, 3.51673}, +{455.435, 13.1999, 3.44298}, +{462.802, 13.2086, 3.37078}, +{470.287, 13.2168, 3.30010}, +{477.894, 13.2245, 3.23090}, +{485.623, 13.2319, 3.16315}, +{493.478, 13.2392, 3.09681}, +{501.459, 13.2464, 3.03188}, +{509.570, 13.2548, 2.96830}, +{517.812, 13.2653, 2.90606}, +{526.187, 13.2757, 2.83752}, +{534.698, 13.2816, 2.76872}, +{543.346, 13.2847, 2.70158}, +{552.134, 13.2860, 2.63607}, +{561.065, 13.2858, 2.57215}, +{570.139, 13.2844, 2.50978}, +{579.361, 13.2820, 2.44892}, +{588.732, 13.2787, 2.38954}, +{598.254, 13.2746, 2.33160}, +{607.930, 13.2698, 2.27507}, +{617.763, 13.2644, 2.21990}, +{627.755, 13.2585, 2.16607}, +{637.908, 13.2523, 2.11355}, +{648.226, 13.2457, 2.06230}, +{658.711, 13.2392, 2.01229}, +{669.365, 13.2335, 1.96350}, +{680.191, 13.2269, 1.91232}, +{691.193, 13.2188, 1.86218}, +{702.372, 13.2089, 1.81336}, +{713.733, 13.1982, 1.76582}, +{725.277, 13.1866, 1.71952}, +{737.008, 13.1743, 1.67444}, +{748.928, 13.1614, 1.63053}, +{761.042, 13.1479, 1.58779}, +{773.351, 13.1338, 1.54615}, +{785.859, 13.1190, 1.50562}, +{798.570, 13.1032, 1.46614}, +{811.486, 13.0870, 1.42894}, +{824.611, 13.0711, 1.39288}, +{837.949, 13.0551, 1.35772}, +{851.502, 13.0390, 1.32346}, +{865.274, 13.0226, 1.29006}, +{879.269, 13.0060, 1.25750}, +{893.491, 12.9893, 1.22577}, +{907.943, 12.9723, 1.19483}, +{922.628, 12.9557, 1.16468}, +{937.551, 12.9384, 1.13279}, +{952.715, 12.9191, 1.10153}, +{968.124, 12.8974, 1.07112}, +{983.783, 12.8721, 1.04156}, +{999.695, 12.8413, 1.02154}, +{1015.86, 12.8267, 1.01556}, +{1032.29, 12.8151, 0.989441}, +{1048.99, 12.7990, 0.963824}, +{1065.96, 12.7807, 0.938869}, +{1083.20, 12.7610, 0.914561}, +{1100.72, 12.7404, 0.890814}, +{1118.52, 12.7187, 0.867595}, +{1136.61, 12.6960, 0.844924}, +{1155.00, 12.6723, 0.822849}, +{1173.68, 12.6476, 0.801358}, +{1192.66, 12.6219, 0.780403}, +{1211.95, 12.5951, 0.759950}, +{1231.55, 12.5671, 0.739972}, +{1251.47, 12.5377, 0.720520}, +{1271.72, 12.5069, 0.701583}, +{1292.29, 12.4746, 0.683145}, +{1313.19, 12.4406, 0.665035}, +{1334.43, 12.4046, 0.647377}, +{1356.01, 12.3663, 0.630164}, +{1377.94, 12.3257, 0.613411}, +{1400.23, 12.2824, 0.597063}, +{1422.88, 12.2359, 0.581081}, +{1445.89, 12.1858, 0.565493}, +{1469.28, 12.1317, 0.550319}, +{1493.04, 12.0729, 0.535553}, +{1517.19, 12.0084, 0.520574}, +{1541.73, 11.9368, 0.505900}, +{1566.67, 11.8567, 0.491586}, +{1592.01, 11.7663, 0.477683}, +{1617.76, 11.6631, 0.464172}, +{1643.92, 11.5433, 0.451037}, +{1670.51, 11.4015, 0.438275}, +{1697.53, 11.2291, 0.425876}, +{1724.99, 11.0117, 0.413830}, +{1752.89, 10.7215, 0.401672}, +{1781.24, 10.2954, 0.389718}, +{1810.05, 9.52841, 0.378002}, +{1838.80, 2.79347, 0.366838}, +{1839.00, 2.79516, 4.15734}, +{1839.32, 4.53985, 4.15632}, +{1869.07, 9.78497, 4.06452}, +{1899.30, 10.6846, 3.97475}, +{1930.02, 11.2284, 3.88688}, +{1961.24, 11.6218, 3.80093}, +{1992.96, 11.9302, 3.71688}, +{2025.20, 12.1875, 3.63698}, +{2057.95, 12.4066, 3.55385}, +{2091.24, 12.5951, 3.47181}, +{2125.06, 12.7607, 3.39095}, +{2159.43, 12.9076, 3.31123}, +{2194.36, 13.0391, 3.23274}, +{2229.85, 13.1577, 3.15553}, +{2265.92, 13.2651, 3.07956}, +{2302.57, 13.3630, 3.00498}, +{2339.81, 13.4523, 2.93157}, +{2377.66, 13.5341, 2.85938}, +{2416.11, 13.6092, 2.78864}, +{2455.19, 13.6782, 2.71913}, +{2494.90, 13.7417, 2.65099}, +{2535.26, 13.8002, 2.58417}, +{2576.26, 13.8543, 2.51869}, +{2617.93, 13.9042, 2.45445}, +{2660.27, 13.9503, 2.39148}, +{2703.30, 13.9928, 2.32994}, +{2747.03, 14.0321, 2.26955}, +{2791.46, 14.0682, 2.21044}, +{2836.61, 14.1017, 2.15277}, +{2882.49, 14.1326, 2.09620}, +{2929.11, 14.1610, 2.04085}, +{2976.48, 14.1871, 1.98681}, +{3024.63, 14.2112, 1.93399}, +{3073.55, 14.2332, 1.88234}, +{3123.26, 14.2535, 1.83187}, +{3173.78, 14.2720, 1.78256}, +{3225.11, 14.2889, 1.73442}, +{3277.27, 14.3043, 1.68741}, +{3330.28, 14.3182, 1.64150}, +{3384.15, 14.3309, 1.59669}, +{3438.88, 14.3423, 1.55296}, +{3494.50, 14.3525, 1.51031}, +{3551.02, 14.3616, 1.46867}, +{3608.46, 14.3698, 1.42807}, +{3666.82, 14.3769, 1.38848}, +{3726.13, 14.3831, 1.34989}, +{3786.40, 14.3886, 1.31225}, +{3847.64, 14.3932, 1.27555}, +{3909.87, 14.3970, 1.23979}, +{3973.11, 14.4002, 1.20495}, +{4037.38, 14.4027, 1.17100}, +{4102.68, 14.4046, 1.13791}, +{4169.03, 14.4060, 1.10569}, +{4236.46, 14.4068, 1.07432}, +{4304.98, 14.4071, 1.04375}, +{4374.62, 14.4069, 1.01398}, +{4445.37, 14.4064, 0.985008}, +{4517.27, 14.4054, 0.956808}, +{4590.33, 14.4040, 0.929335}, +{4664.58, 14.4023, 0.902611}, +{4740.03, 14.4002, 0.876592}, +{4816.69, 14.3979, 0.851289}, +{4894.60, 14.3953, 0.826671}, +{4973.77, 14.3924, 0.802700}, +{5054.21, 14.3893, 0.779406}, +{5135.96, 14.3860, 0.756713}, +{5219.03, 14.3824, 0.734648}, +{5303.44, 14.3787, 0.713218}, +{5389.22, 14.3748, 0.692353}, +{5476.39, 14.3708, 0.672068}, +{5564.97, 14.3666, 0.652358}, +{5654.98, 14.3623, 0.633172}, +{5746.44, 14.3579, 0.614532}, +{5839.39, 14.3533, 0.596422}, +{5933.83, 14.3487, 0.578825}, +{6029.81, 14.3441, 0.561692}, +{6127.33, 14.3393, 0.545062}, +{6226.44, 14.3345, 0.528895}, +{6327.15, 14.3296, 0.513197}, +{6429.48, 14.3247, 0.497896}, +{6533.48, 14.3198, 0.483093}, +{6639.15, 14.3148, 0.468675}, +{6746.54, 14.3098, 0.454668}, +{6855.65, 14.3048, 0.441069}, +{6966.54, 14.2998, 0.427861}, +{7079.22, 14.2948, 0.415029}, +{7193.72, 14.2898, 0.402564}, +{7310.07, 14.2847, 0.390462}, +{7428.31, 14.2798, 0.378704}, +{7548.45, 14.2748, 0.367289}, +{7670.54, 14.2698, 0.356207}, +{7794.61, 14.2649, 0.345446}, +{7920.68, 14.2600, 0.334993}, +{8048.79, 14.2551, 0.324848}, +{8178.98, 14.2503, 0.314994}, +{8311.26, 14.2455, 0.305432}, +{8445.69, 14.2407, 0.296153}, +{8582.29, 14.2360, 0.287138}, +{8721.11, 14.2313, 0.278388}, +{8862.16, 14.2267, 0.269899}, +{9005.50, 14.2221, 0.261658}, +{9151.16, 14.2176, 0.253660}, +{9299.17, 14.2131, 0.245895}, +{9449.58, 14.2086, 0.238363}, +{9602.42, 14.2043, 0.231050}, +{9757.73, 14.1999, 0.223956}, +{9915.55, 14.1957, 0.217070}, +{10075.9, 14.1914, 0.210390}, +{10238.9, 14.1873, 0.203909}, +{10404.5, 14.1832, 0.197620}, +{10572.8, 14.1792, 0.191518}, +{10743.8, 14.1752, 0.185598}, +{10917.6, 14.1712, 0.179855}, +{11094.2, 14.1674, 0.174283}, +{11273.6, 14.1636, 0.168878}, +{11455.9, 14.1598, 0.163634}, +{11641.2, 14.1561, 0.158548}, +{11829.5, 14.1525, 0.153614}, +{12020.8, 14.1489, 0.148828}, +{12215.3, 14.1454, 0.144186}, +{12412.8, 14.1420, 0.139684}, +{12613.6, 14.1386, 0.135317}, +{12817.6, 14.1353, 0.131082}, +{13025.0, 14.1320, 0.126975}, +{13235.6, 14.1288, 0.122991}, +{13449.7, 14.1256, 0.119128}, +{13667.2, 14.1225, 0.115381}, +{13888.3, 14.1194, 0.111748}, +{14112.9, 14.1165, 0.108225}, +{14341.2, 14.1135, 0.104809}, +{14573.1, 14.1106, 0.101496}, +{14808.9, 14.1078, 0.982836E-01}, +{15048.4, 14.1050, 0.951689E-01}, +{15291.8, 14.1023, 0.921489E-01}, +{15539.1, 14.0996, 0.892208E-01}, +{15790.4, 14.0970, 0.863817E-01}, +{16045.8, 14.0945, 0.836291E-01}, +{16305.4, 14.0919, 0.809604E-01}, +{16569.1, 14.0895, 0.783731E-01}, +{16837.1, 14.0870, 0.758647E-01}, +{17109.4, 14.0847, 0.734330E-01}, +{17386.1, 14.0824, 0.710755E-01}, +{17667.4, 14.0801, 0.687901E-01}, +{17953.1, 14.0779, 0.665747E-01}, +{18243.5, 14.0757, 0.644270E-01}, +{18538.6, 14.0735, 0.623451E-01}, +{18838.4, 14.0714, 0.603270E-01}, +{19143.1, 14.0694, 0.583708E-01}, +{19452.7, 14.0674, 0.564747E-01}, +{19767.4, 14.0654, 0.546367E-01}, +{20087.1, 14.0635, 0.528536E-01}, +{20412.0, 14.0616, 0.511283E-01}, +{20742.1, 14.0597, 0.494580E-01}, +{21077.6, 14.0579, 0.478407E-01}, +{21418.5, 14.0561, 0.462752E-01}, +{21765.0, 14.0544, 0.447595E-01}, +{22117.0, 14.0527, 0.432922E-01}, +{22474.7, 14.0510, 0.418718E-01}, +{22838.2, 14.0494, 0.404967E-01}, +{23207.6, 14.0478, 0.391657E-01}, +{23583.0, 14.0463, 0.378772E-01}, +{23964.4, 14.0448, 0.366301E-01}, +{24352.0, 14.0433, 0.354228E-01}, +{24745.9, 14.0418, 0.342544E-01}, +{25146.2, 14.0404, 0.331234E-01}, +{25552.9, 14.0390, 0.320287E-01}, +{25966.2, 14.0377, 0.309693E-01}, +{26386.1, 14.0363, 0.299439E-01}, +{26812.9, 14.0351, 0.289515E-01}, +{27246.6, 14.0338, 0.279911E-01}, +{27687.3, 14.0326, 0.270617E-01}, +{28135.1, 14.0314, 0.261622E-01}, +{28590.2, 14.0302, 0.252918E-01}, +{29052.6, 14.0290, 0.244496E-01}, +{29522.5, 14.0282, 0.236345E-01}, +{30000.0, 14.0266, 0.228459E-01}, +{0, 0, 0} +}; + +e_fp_fdp p[] = { /* Z = 15 */ +{10.0000, -9999.00, 8.47738}, +{10.1617, -9999.00, 8.27092}, +{10.3261, -9999.00, 8.06949}, +{10.4931, -9999.00, 7.87297}, +{10.6628, -9999.00, 7.68123}, +{10.8353, -9999.00, 7.49416}, +{11.0106, -9999.00, 7.31165}, +{11.1886, -9999.00, 7.13359}, +{11.3696, -9999.00, 6.95985}, +{11.5535, -9999.00, 6.79035}, +{11.7404, -9999.00, 6.62498}, +{11.9303, -9999.00, 6.46364}, +{12.1232, -9999.00, 6.30623}, +{12.3193, -9999.00, 6.14279}, +{12.5186, -9999.00, 5.96938}, +{12.7210, -9999.00, 5.80087}, +{12.9268, -9999.00, 5.63711}, +{13.1359, -9999.00, 5.47797}, +{13.3483, -9999.00, 5.32059}, +{13.5642, -9999.00, 5.10232}, +{13.7836, -9999.00, 4.89300}, +{14.0066, -9999.00, 4.69227}, +{14.2331, -9999.00, 4.49977}, +{14.4633, -9999.00, 4.31517}, +{14.6973, -9999.00, 4.13815}, +{14.9350, -9999.00, 3.96838}, +{15.1765, -9999.00, 3.80558}, +{15.4220, -9999.00, 3.64946}, +{15.6714, -9999.00, 3.49498}, +{15.9249, -9999.00, 3.33559}, +{16.1825, -9999.00, 3.18347}, +{16.4442, -9999.00, 3.03828}, +{16.7102, -9999.00, 2.89419}, +{16.9805, -9999.00, 2.69318}, +{17.2551, -9999.00, 2.50614}, +{17.5342, -9999.00, 2.31986}, +{17.8178, -9999.00, 2.10076}, +{18.1060, -9999.00, 1.90237}, +{18.3989, -9999.00, 1.70008}, +{18.6964, -9999.00, 1.51572}, +{18.9988, -9999.00, 1.37184}, +{19.3061, -9999.00, 1.24320}, +{19.6184, -9999.00, 1.12494}, +{19.9357, -9999.00, 1.01574}, +{20.2582, -9999.00, 0.914288}, +{20.5858, -9999.00, 0.816119}, +{20.9188, -9999.00, 0.731590}, +{21.2571, -9999.00, 0.661629}, +{21.6009, -9999.00, 0.597179}, +{21.9503, -9999.00, 0.537266}, +{22.3053, -9999.00, 0.483365}, +{22.6661, -9999.00, 0.438116}, +{23.0327, -9999.00, 0.397524}, +{23.4053, -9999.00, 0.362656}, +{23.7838, -9999.00, 0.334441}, +{24.1685, -9999.00, 0.308421}, +{24.5594, -9999.00, 0.282182}, +{24.9566, -9999.00, 0.257009}, +{25.3603, -9999.00, 0.236594}, +{25.7705, -9999.00, 0.222772}, +{26.1873, -9999.00, 0.209917}, +{26.6109, -9999.00, 0.206460}, +{27.0413, -9999.00, 0.203059}, +{27.4786, -9999.00, 0.204255}, +{27.9231, -9999.00, 0.209753}, +{28.3747, -9999.00, 0.215399}, +{28.8337, -9999.00, 0.221196}, +{29.3000, 4.97805, 0.229708}, +{29.7739, 4.94245, 0.238708}, +{30.2555, 4.90915, 0.248061}, +{30.7449, 4.87753, 0.258073}, +{31.2421, 4.84809, 0.268995}, +{31.7475, 4.82071, 0.280380}, +{32.2609, 4.79531, 0.292247}, +{32.7827, 4.77233, 0.304615}, +{33.3130, 4.75285, 0.316307}, +{33.8518, 4.73345, 0.325368}, +{34.3993, 4.71416, 0.334688}, +{34.9557, 4.69575, 0.343738}, +{35.5211, 4.67746, 0.352639}, +{36.0956, 4.65958, 0.361769}, +{36.6794, 4.64218, 0.371136}, +{37.2727, 4.62528, 0.380746}, +{37.8755, 4.60889, 0.390605}, +{38.4882, 4.59301, 0.400718}, +{39.1107, 4.57763, 0.411094}, +{39.7432, 4.56276, 0.421739}, +{40.3861, 4.54841, 0.432658}, +{41.0393, 4.53459, 0.443861}, +{41.7031, 4.52133, 0.455354}, +{42.3776, 4.50872, 0.467145}, +{43.0630, 4.49696, 0.479240}, +{43.7595, 4.48618, 0.490690}, +{44.4673, 4.47517, 0.501872}, +{45.1865, 4.46431, 0.513308}, +{45.9174, 4.45372, 0.525005}, +{46.6600, 4.44348, 0.536968}, +{47.4147, 4.43366, 0.549204}, +{48.1816, 4.42433, 0.561719}, +{48.9609, 4.41557, 0.574519}, +{49.7528, 4.40751, 0.587610}, +{50.5576, 4.40035, 0.601000}, +{51.3753, 4.39447, 0.614695}, +{52.2062, 4.39076, 0.628703}, +{53.0506, 4.39223, 0.639288}, +{53.9087, 4.38977, 0.644138}, +{54.7806, 4.38494, 0.649026}, +{55.6667, 4.37881, 0.653950}, +{56.5670, 4.37180, 0.658911}, +{57.4820, 4.36411, 0.663911}, +{58.4117, 4.35588, 0.668948}, +{59.3564, 4.34726, 0.674023}, +{60.3165, 4.33842, 0.679137}, +{61.2921, 4.32979, 0.684290}, +{62.2834, 4.32275, 0.688005}, +{63.2908, 4.31322, 0.688515}, +{64.3145, 4.30156, 0.689024}, +{65.3547, 4.28832, 0.689535}, +{66.4118, 4.27373, 0.690045}, +{67.4859, 4.25786, 0.690556}, +{68.5775, 4.24072, 0.691067}, +{69.6867, 4.22231, 0.691579}, +{70.8138, 4.20263, 0.692091}, +{71.9591, 4.18164, 0.692603}, +{73.1230, 4.15933, 0.693116}, +{74.3057, 4.13568, 0.693629}, +{75.5076, 4.11073, 0.694143}, +{76.7289, 4.08472, 0.694657}, +{77.9699, 4.05772, 0.693818}, +{79.2310, 4.02776, 0.692060}, +{80.5125, 3.99527, 0.690306}, +{81.8147, 3.96034, 0.688558}, +{83.1380, 3.92293, 0.686813}, +{84.4827, 3.88292, 0.685073}, +{85.8491, 3.84018, 0.683337}, +{87.2377, 3.79457, 0.681605}, +{88.6487, 3.74590, 0.679879}, +{90.0825, 3.69399, 0.678156}, +{91.5395, 3.63867, 0.676438}, +{93.0201, 3.57976, 0.674723}, +{94.5246, 3.51745, 0.673014}, +{96.0535, 3.45338, 0.669023}, +{97.6071, 3.38116, 0.661918}, +{99.1858, 3.30117, 0.654888}, +{100.790, 3.21387, 0.647932}, +{102.420, 3.11870, 0.641051}, +{104.077, 3.01492, 0.634243}, +{105.760, 2.90159, 0.627507}, +{107.471, 2.77760, 0.620842}, +{109.209, 2.64162, 0.614248}, +{110.975, 2.49249, 0.607725}, +{112.770, 2.32708, 0.598330}, +{114.594, 2.14049, 0.588439}, +{116.448, 1.92932, 0.578712}, +{118.331, 1.68884, 0.569145}, +{120.245, 1.41189, 0.559736}, +{122.190, 1.08814, 0.550483}, +{124.166, 0.701791, 0.541383}, +{126.175, 0.227104, 0.532433}, +{128.215, -0.382396, 0.523631}, +{130.289, -1.22512, 0.514975}, +{132.397, -2.58099, 0.506462}, +{134.538, -6.42991, 0.498089}, +{134.900, -9.75036, 0.496701}, +{135.100, -9.78040, 7.24821}, +{136.714, -3.80688, 7.37624}, +{138.925, -2.11871, 7.55281}, +{141.172, -1.19700, 7.73360}, +{143.456, -0.541382, 7.91872}, +{145.776, -0.141602E-01, 8.10828}, +{148.134, 0.444985, 8.30236}, +{150.530, 0.872470, 8.50110}, +{152.964, 1.31326, 8.70460}, +{155.439, 1.73013, 8.80797}, +{157.953, 2.10106, 8.91101}, +{160.507, 2.44414, 9.01526}, +{163.103, 2.77746, 9.12073}, +{165.742, 3.11313, 9.22744}, +{168.422, 3.48135, 9.33539}, +{171.146, 3.90962, 9.32404}, +{173.915, 4.22455, 9.22128}, +{176.727, 4.43798, 9.11966}, +{179.586, 4.57084, 9.01915}, +{182.491, 4.48835, 8.91977}, +{185.442, 4.43827, 9.23234}, +{188.442, 4.56813, 9.57278}, +{191.489, 4.81079, 9.92577}, +{194.587, 5.17514, 10.2918}, +{197.734, 5.79093, 10.6365}, +{200.932, 6.36132, 10.5513}, +{204.182, 6.81058, 10.4668}, +{207.485, 7.18838, 10.3830}, +{210.840, 7.53860, 10.2999}, +{214.251, 7.89918, 10.2010}, +{217.716, 8.21430, 10.0610}, +{221.237, 8.48864, 9.92281}, +{224.816, 8.73923, 9.78655}, +{228.452, 8.96913, 9.65218}, +{232.147, 9.17702, 9.51964}, +{235.902, 9.36814, 9.40594}, +{239.717, 9.55750, 9.30022}, +{243.595, 9.74455, 9.19568}, +{247.535, 9.92636, 9.09233}, +{251.538, 10.1032, 8.99012}, +{255.607, 10.2756, 8.88907}, +{259.741, 10.4440, 8.78916}, +{263.942, 10.6092, 8.69037}, +{268.211, 10.7723, 8.59270}, +{272.549, 10.9346, 8.49611}, +{276.957, 11.0992, 8.40062}, +{281.437, 11.2799, 8.29784}, +{285.989, 11.4420, 8.16494}, +{290.615, 11.5876, 8.03417}, +{295.315, 11.7225, 7.90550}, +{300.092, 11.8494, 7.77888}, +{304.945, 11.9696, 7.65429}, +{309.878, 12.0840, 7.53171}, +{314.890, 12.1932, 7.41108}, +{319.983, 12.2978, 7.29238}, +{325.158, 12.3980, 7.17559}, +{330.418, 12.4944, 7.06067}, +{335.762, 12.5873, 6.94758}, +{341.192, 12.6769, 6.83631}, +{346.711, 12.7636, 6.72682}, +{352.319, 12.8477, 6.61909}, +{358.017, 12.9295, 6.51308}, +{363.808, 13.0092, 6.40876}, +{369.692, 13.0874, 6.30612}, +{375.672, 13.1645, 6.20512}, +{381.748, 13.2415, 6.10575}, +{387.922, 13.3212, 6.00635}, +{394.197, 13.4025, 5.90391}, +{400.573, 13.4811, 5.79178}, +{407.052, 13.5497, 5.67735}, +{413.635, 13.6120, 5.56536}, +{420.326, 13.6701, 5.45550}, +{427.124, 13.7248, 5.34777}, +{434.032, 13.7766, 5.24210}, +{441.052, 13.8263, 5.13855}, +{448.186, 13.8765, 5.03630}, +{455.435, 13.9240, 4.93239}, +{462.802, 13.9681, 4.82790}, +{470.287, 14.0080, 4.72416}, +{477.894, 14.0439, 4.62251}, +{485.623, 14.0772, 4.52320}, +{493.478, 14.1082, 4.42610}, +{501.459, 14.1376, 4.33116}, +{509.570, 14.1656, 4.23809}, +{517.812, 14.1929, 4.14664}, +{526.187, 14.2195, 4.05603}, +{534.698, 14.2448, 3.96511}, +{543.346, 14.2676, 3.87511}, +{552.134, 14.2909, 3.78720}, +{561.065, 14.3127, 3.69300}, +{570.139, 14.3245, 3.59832}, +{579.361, 14.3322, 3.51289}, +{588.732, 14.3394, 3.43156}, +{598.254, 14.3476, 3.35339}, +{607.930, 14.3561, 3.27701}, +{617.763, 14.3652, 3.20235}, +{627.755, 14.3764, 3.12899}, +{637.908, 14.3889, 3.05264}, +{648.226, 14.3997, 2.97138}, +{658.711, 14.4026, 2.88794}, +{669.365, 14.3978, 2.80681}, +{680.191, 14.3872, 2.73538}, +{691.193, 14.3787, 2.67141}, +{702.372, 14.3760, 2.61054}, +{713.733, 14.3752, 2.54730}, +{725.277, 14.3721, 2.48306}, +{737.008, 14.3676, 2.42045}, +{748.928, 14.3622, 2.35942}, +{761.042, 14.3564, 2.29987}, +{773.351, 14.3508, 2.24135}, +{785.859, 14.3448, 2.18267}, +{798.570, 14.3367, 2.12420}, +{811.486, 14.3271, 2.06731}, +{824.611, 14.3164, 2.01193}, +{837.949, 14.3048, 1.95803}, +{851.502, 14.2922, 1.90579}, +{865.274, 14.2790, 1.85517}, +{879.269, 14.2654, 1.80610}, +{893.491, 14.2514, 1.75835}, +{907.943, 14.2370, 1.71185}, +{922.628, 14.2224, 1.66658}, +{937.551, 14.2073, 1.62225}, +{952.715, 14.1917, 1.57906}, +{968.124, 14.1756, 1.53698}, +{983.783, 14.1592, 1.49604}, +{999.695, 14.1423, 1.45621}, +{1015.86, 14.1251, 1.41747}, +{1032.29, 14.1079, 1.37983}, +{1048.99, 14.0905, 1.34273}, +{1065.96, 14.0724, 1.30615}, +{1083.20, 14.0535, 1.27056}, +{1100.72, 14.0341, 1.23596}, +{1118.52, 14.0142, 1.20232}, +{1136.61, 13.9939, 1.16956}, +{1155.00, 13.9730, 1.13770}, +{1173.68, 13.9516, 1.10673}, +{1192.66, 13.9297, 1.07657}, +{1211.95, 13.9072, 1.04723}, +{1231.55, 13.8841, 1.01867}, +{1251.47, 13.8604, 0.990996}, +{1271.72, 13.8360, 0.964146}, +{1292.29, 13.8110, 0.938107}, +{1313.19, 13.7854, 0.912775}, +{1334.43, 13.7591, 0.888128}, +{1356.01, 13.7319, 0.864145}, +{1377.94, 13.7039, 0.840814}, +{1400.23, 13.6748, 0.818112}, +{1422.88, 13.6447, 0.796024}, +{1445.89, 13.6134, 0.774530}, +{1469.28, 13.5807, 0.753673}, +{1493.04, 13.5465, 0.733458}, +{1517.19, 13.5108, 0.714144}, +{1541.73, 13.4736, 0.695386}, +{1566.67, 13.4345, 0.677114}, +{1592.01, 13.3933, 0.659332}, +{1617.76, 13.3497, 0.642015}, +{1643.92, 13.3032, 0.625148}, +{1670.51, 13.2536, 0.608723}, +{1697.53, 13.2004, 0.592732}, +{1724.99, 13.1430, 0.577164}, +{1752.89, 13.0806, 0.561479}, +{1781.24, 13.0118, 0.546048}, +{1810.05, 12.9355, 0.530917}, +{1839.32, 12.8501, 0.516200}, +{1869.07, 12.7535, 0.501889}, +{1899.30, 12.6426, 0.487977}, +{1930.02, 12.5132, 0.474448}, +{1961.24, 12.3588, 0.461296}, +{1992.96, 12.1687, 0.448513}, +{2025.20, 11.9249, 0.436361}, +{2057.95, 11.5895, 0.423895}, +{2091.24, 11.0676, 0.411665}, +{2125.06, 9.95415, 0.399700}, +{2145.40, 3.54595, 0.392762}, +{2145.60, 3.54765, 4.22284}, +{2159.43, 9.60959, 4.18509}, +{2194.36, 11.2187, 4.09233}, +{2229.85, 11.9423, 4.00067}, +{2265.92, 12.4219, 3.91021}, +{2302.57, 12.7826, 3.82100}, +{2339.81, 13.0719, 3.73293}, +{2377.66, 13.3127, 3.64605}, +{2416.11, 13.5186, 3.56055}, +{2455.19, 13.6976, 3.47630}, +{2494.90, 13.8553, 3.39339}, +{2535.26, 13.9957, 3.31185}, +{2576.26, 14.1216, 3.23175}, +{2617.93, 14.2352, 3.15296}, +{2660.27, 14.3383, 3.07576}, +{2703.30, 14.4321, 2.99968}, +{2747.03, 14.5177, 2.92512}, +{2791.46, 14.5961, 2.85195}, +{2836.61, 14.6679, 2.78022}, +{2882.49, 14.7340, 2.70992}, +{2929.11, 14.7947, 2.64091}, +{2976.48, 14.8506, 2.57341}, +{3024.63, 14.9020, 2.50731}, +{3073.55, 14.9496, 2.44270}, +{3123.26, 14.9935, 2.37924}, +{3173.78, 15.0339, 2.31715}, +{3225.11, 15.0710, 2.25649}, +{3277.27, 15.1053, 2.19715}, +{3330.28, 15.1369, 2.13910}, +{3384.15, 15.1660, 2.08237}, +{3438.88, 15.1927, 2.02691}, +{3494.50, 15.2172, 1.97273}, +{3551.02, 15.2397, 1.91981}, +{3608.46, 15.2603, 1.86811}, +{3666.82, 15.2791, 1.81762}, +{3726.13, 15.2962, 1.76833}, +{3786.40, 15.3118, 1.72021}, +{3847.64, 15.3259, 1.67325}, +{3909.87, 15.3387, 1.62743}, +{3973.11, 15.3502, 1.58274}, +{4037.38, 15.3605, 1.53914}, +{4102.68, 15.3697, 1.49661}, +{4169.03, 15.3778, 1.45515}, +{4236.46, 15.3850, 1.41472}, +{4304.98, 15.3912, 1.37529}, +{4374.62, 15.3966, 1.33687}, +{4445.37, 15.4011, 1.29943}, +{4517.27, 15.4049, 1.26295}, +{4590.33, 15.4080, 1.22742}, +{4664.58, 15.4105, 1.19278}, +{4740.03, 15.4123, 1.15906}, +{4816.69, 15.4135, 1.12621}, +{4894.60, 15.4142, 1.09423}, +{4973.77, 15.4144, 1.06306}, +{5054.21, 15.4141, 1.03274}, +{5135.96, 15.4134, 1.00323}, +{5219.03, 15.4123, 0.974505}, +{5303.44, 15.4108, 0.946528}, +{5389.22, 15.4090, 0.919310}, +{5476.39, 15.4068, 0.892828}, +{5564.97, 15.4043, 0.867047}, +{5654.98, 15.4016, 0.841986}, +{5746.44, 15.3985, 0.817583}, +{5839.39, 15.3953, 0.793881}, +{5933.83, 15.3918, 0.770795}, +{6029.81, 15.3882, 0.748323}, +{6127.33, 15.3843, 0.726532}, +{6226.44, 15.3803, 0.705292}, +{6327.15, 15.3761, 0.684670}, +{6429.48, 15.3718, 0.664605}, +{6533.48, 15.3674, 0.645071}, +{6639.15, 15.3628, 0.626122}, +{6746.54, 15.3582, 0.607680}, +{6855.65, 15.3534, 0.589768}, +{6966.54, 15.3486, 0.572384}, +{7079.22, 15.3437, 0.555427}, +{7193.72, 15.3388, 0.539000}, +{7310.07, 15.3338, 0.523022}, +{7428.31, 15.3288, 0.507494}, +{7548.45, 15.3237, 0.492406}, +{7670.54, 15.3186, 0.477750}, +{7794.61, 15.3135, 0.463515}, +{7920.68, 15.3084, 0.449684}, +{8048.79, 15.3033, 0.436244}, +{8178.98, 15.2981, 0.423194}, +{8311.26, 15.2930, 0.410515}, +{8445.69, 15.2879, 0.398208}, +{8582.29, 15.2828, 0.386248}, +{8721.11, 15.2777, 0.374638}, +{8862.16, 15.2727, 0.363359}, +{9005.50, 15.2676, 0.352411}, +{9151.16, 15.2626, 0.341780}, +{9299.17, 15.2577, 0.331457}, +{9449.58, 15.2527, 0.321431}, +{9602.42, 15.2478, 0.311700}, +{9757.73, 15.2430, 0.302254}, +{9915.55, 15.2382, 0.293089}, +{10075.9, 15.2334, 0.284185}, +{10238.9, 15.2287, 0.275543}, +{10404.5, 15.2240, 0.267153}, +{10572.8, 15.2194, 0.259010}, +{10743.8, 15.2148, 0.251106}, +{10917.6, 15.2103, 0.243435}, +{11094.2, 15.2059, 0.235989}, +{11273.6, 15.2015, 0.228764}, +{11455.9, 15.1971, 0.221751}, +{11641.2, 15.1928, 0.214946}, +{11829.5, 15.1886, 0.208342}, +{12020.8, 15.1844, 0.201934}, +{12215.3, 15.1803, 0.195715}, +{12412.8, 15.1763, 0.189681}, +{12613.6, 15.1723, 0.183827}, +{12817.6, 15.1684, 0.178146}, +{13025.0, 15.1645, 0.172634}, +{13235.6, 15.1607, 0.167287}, +{13449.7, 15.1569, 0.162099}, +{13667.2, 15.1532, 0.157065}, +{13888.3, 15.1496, 0.152182}, +{14112.9, 15.1460, 0.147445}, +{14341.2, 15.1425, 0.142849}, +{14573.1, 15.1391, 0.138391}, +{14808.9, 15.1357, 0.134067}, +{15048.4, 15.1324, 0.129871}, +{15291.8, 15.1291, 0.125802}, +{15539.1, 15.1259, 0.121855}, +{15790.4, 15.1227, 0.118027}, +{16045.8, 15.1196, 0.114313}, +{16305.4, 15.1166, 0.110711}, +{16569.1, 15.1136, 0.107218}, +{16837.1, 15.1106, 0.103829}, +{17109.4, 15.1078, 0.100543}, +{17386.1, 15.1049, 0.973559E-01}, +{17667.4, 15.1022, 0.942647E-01}, +{17953.1, 15.0994, 0.912668E-01}, +{18243.5, 15.0968, 0.883594E-01}, +{18538.6, 15.0942, 0.855399E-01}, +{18838.4, 15.0916, 0.828055E-01}, +{19143.1, 15.0891, 0.801538E-01}, +{19452.7, 15.0866, 0.775824E-01}, +{19767.4, 15.0842, 0.750886E-01}, +{20087.1, 15.0818, 0.726802E-01}, +{20412.0, 15.0795, 0.703366E-01}, +{20742.1, 15.0772, 0.680665E-01}, +{21077.6, 15.0750, 0.658673E-01}, +{21418.5, 15.0728, 0.637371E-01}, +{21765.0, 15.0706, 0.616736E-01}, +{22117.0, 15.0685, 0.596750E-01}, +{22474.7, 15.0665, 0.577392E-01}, +{22838.2, 15.0645, 0.558643E-01}, +{23207.6, 15.0625, 0.540484E-01}, +{23583.0, 15.0606, 0.522897E-01}, +{23964.4, 15.0587, 0.505865E-01}, +{24352.0, 15.0568, 0.489371E-01}, +{24745.9, 15.0550, 0.473398E-01}, +{25146.2, 15.0532, 0.457930E-01}, +{25552.9, 15.0515, 0.442953E-01}, +{25966.2, 15.0498, 0.428450E-01}, +{26386.1, 15.0482, 0.414407E-01}, +{26812.9, 15.0465, 0.400810E-01}, +{27246.6, 15.0450, 0.387645E-01}, +{27687.3, 15.0434, 0.374899E-01}, +{28135.1, 15.0419, 0.362558E-01}, +{28590.2, 15.0404, 0.350612E-01}, +{29052.6, 15.0390, 0.339046E-01}, +{29522.5, 15.0377, 0.327849E-01}, +{30000.0, 15.0359, 0.317011E-01}, +{0, 0, 0} +}; + +e_fp_fdp s[] = { /* Z = 16 */ +{10.0000, -9999.00, 4.05213}, +{10.1617, -9999.00, 4.23511}, +{10.3261, -9999.00, 4.42637}, +{10.4931, -9999.00, 4.62625}, +{10.6628, -9999.00, 4.83517}, +{10.8353, -9999.00, 5.05351}, +{11.0106, -9999.00, 5.28172}, +{11.1886, -9999.00, 5.52024}, +{11.3696, -9999.00, 5.79892}, +{11.5535, -9999.00, 6.15554}, +{11.7404, -9999.00, 6.53409}, +{11.9303, -9999.00, 6.93593}, +{12.1232, -9999.00, 7.22812}, +{12.3193, -9999.00, 7.48421}, +{12.5186, -9999.00, 7.74937}, +{12.7210, -9999.00, 8.02394}, +{12.9268, -9999.00, 8.17420}, +{13.1359, -9999.00, 8.32106}, +{13.3483, -9999.00, 8.47056}, +{13.5642, -9999.00, 8.62275}, +{13.7836, -9999.00, 8.77767}, +{14.0066, -9999.00, 8.93538}, +{14.2331, -9999.00, 9.09591}, +{14.4633, -9999.00, 9.21163}, +{14.6973, -9999.00, 9.25783}, +{14.9350, -9999.00, 9.30427}, +{15.1765, -9999.00, 9.35094}, +{15.4220, -9999.00, 9.39784}, +{15.6714, -9999.00, 9.44462}, +{15.9249, -9999.00, 9.49048}, +{16.1825, -9999.00, 9.53657}, +{16.4442, -9999.00, 9.58288}, +{16.7102, -9999.00, 9.62942}, +{16.9805, -9999.00, 9.50147}, +{17.2551, -9999.00, 9.35391}, +{17.5342, -9999.00, 9.20865}, +{17.8178, -9999.00, 9.06563}, +{18.1060, -9999.00, 8.92484}, +{18.3989, -9999.00, 8.78624}, +{18.6964, -9999.00, 8.64978}, +{18.9988, -9999.00, 8.48051}, +{19.3061, -9999.00, 8.31413}, +{19.6184, -9999.00, 8.15102}, +{19.9357, -9999.00, 7.99112}, +{20.2582, -9999.00, 7.75370}, +{20.5858, -9999.00, 7.52228}, +{20.9188, -9999.00, 7.29778}, +{21.2571, -9999.00, 7.07996}, +{21.6009, -9999.00, 6.86866}, +{21.9503, -9999.00, 6.66366}, +{22.3053, -9999.00, 6.46478}, +{22.6661, -9999.00, 6.27183}, +{23.0327, -9999.00, 5.98866}, +{23.4053, -9999.00, 5.71188}, +{23.7838, -9999.00, 5.44790}, +{24.1685, -9999.00, 5.19886}, +{24.5594, -9999.00, 5.01355}, +{24.9566, -9999.00, 4.83485}, +{25.3603, -9999.00, 4.66253}, +{25.7705, -9999.00, 4.40278}, +{26.1873, -9999.00, 4.13630}, +{26.6109, -9999.00, 3.88165}, +{27.0413, -9999.00, 3.60480}, +{27.4786, -9999.00, 3.34769}, +{27.9231, -9999.00, 3.10893}, +{28.3747, -9999.00, 2.85215}, +{28.8337, -9999.00, 2.60780}, +{29.3000, 8.51351, 2.38439}, +{29.7739, 8.44725, 2.09574}, +{30.2555, 8.29906, 1.83145}, +{30.7449, 8.13067, 1.66396}, +{31.2421, 7.98940, 1.51922}, +{31.7475, 7.85582, 1.38707}, +{32.2609, 7.72619, 1.26987}, +{32.7827, 7.60201, 1.16348}, +{33.3130, 7.48047, 1.06627}, +{33.8518, 7.36315, 0.981115}, +{34.3993, 7.25066, 0.902758}, +{34.9557, 7.14165, 0.830572}, +{35.5211, 7.03504, 0.763654}, +{36.0956, 6.92984, 0.702128}, +{36.6794, 6.82470, 0.647333}, +{37.2727, 6.72385, 0.599198}, +{37.8755, 6.62556, 0.554642}, +{38.4882, 6.52782, 0.514725}, +{39.1107, 6.43270, 0.478994}, +{39.7432, 6.33771, 0.445743}, +{40.3861, 6.24212, 0.418298}, +{41.0393, 6.14581, 0.393527}, +{41.7031, 6.04020, 0.380101}, +{42.3776, 5.94784, 0.378917}, +{43.0630, 5.86050, 0.377737}, +{43.7595, 5.76832, 0.384183}, +{44.4673, 5.68774, 0.401995}, +{45.1865, 5.61473, 0.420633}, +{45.9174, 5.54671, 0.440135}, +{46.6600, 5.48225, 0.460541}, +{47.4147, 5.42013, 0.481893}, +{48.1816, 5.35746, 0.504235}, +{48.9609, 5.29561, 0.538194}, +{49.7528, 5.24242, 0.576927}, +{50.5576, 5.19491, 0.622344}, +{51.3753, 5.17182, 0.669662}, +{52.2062, 5.14872, 0.696659}, +{53.0506, 5.12362, 0.724745}, +{53.9087, 5.10178, 0.752298}, +{54.7806, 5.07915, 0.775832}, +{55.6667, 5.05564, 0.800102}, +{56.5670, 5.03138, 0.826360}, +{57.4820, 5.01164, 0.858063}, +{58.4117, 5.00074, 0.890982}, +{59.3564, 4.99665, 0.910304}, +{60.3165, 4.98520, 0.925492}, +{61.2921, 4.96711, 0.943357}, +{62.2834, 4.95248, 0.967418}, +{63.2908, 4.94227, 0.992091}, +{64.3145, 4.93805, 1.01502}, +{65.3547, 4.93294, 1.03213}, +{66.4118, 4.92760, 1.04954}, +{67.4859, 4.92457, 1.06724}, +{68.5775, 4.92255, 1.07944}, +{69.6867, 4.91853, 1.09081}, +{70.8138, 4.91463, 1.10230}, +{71.9591, 4.91341, 1.11391}, +{73.1230, 4.91433, 1.11708}, +{74.3057, 4.90801, 1.11624}, +{75.5076, 4.89540, 1.11682}, +{76.7289, 4.88296, 1.12301}, +{77.9699, 4.87191, 1.12923}, +{79.2310, 4.86320, 1.13470}, +{80.5125, 4.85318, 1.13629}, +{81.8147, 4.84143, 1.13659}, +{83.1380, 4.82715, 1.13612}, +{84.4827, 4.81086, 1.13564}, +{85.8491, 4.79301, 1.13515}, +{87.2377, 4.77379, 1.13467}, +{88.6487, 4.75353, 1.13375}, +{90.0825, 4.73147, 1.13231}, +{91.5395, 4.70840, 1.13018}, +{93.0201, 4.68254, 1.12687}, +{94.5246, 4.65429, 1.12357}, +{96.0535, 4.62388, 1.12027}, +{97.6071, 4.59160, 1.11697}, +{99.1858, 4.55828, 1.11367}, +{100.790, 4.52523, 1.10632}, +{102.420, 4.48460, 1.09492}, +{104.077, 4.43814, 1.08385}, +{105.760, 4.38622, 1.07289}, +{107.471, 4.32764, 1.06302}, +{109.209, 4.26493, 1.05583}, +{110.975, 4.19746, 1.05069}, +{112.770, 4.12808, 1.04662}, +{114.594, 4.05442, 1.04175}, +{116.448, 3.97530, 1.03485}, +{118.331, 3.88873, 1.02741}, +{120.245, 3.79426, 1.01996}, +{122.190, 3.69141, 1.01259}, +{124.166, 3.57932, 1.00529}, +{126.175, 3.45687, 0.998037}, +{128.215, 3.32271, 0.990826}, +{130.289, 3.17524, 0.983650}, +{132.397, 3.01263, 0.976453}, +{134.538, 2.83201, 0.968314}, +{136.714, 2.62925, 0.959853}, +{138.925, 2.40036, 0.951466}, +{141.172, 2.13977, 0.943150}, +{143.456, 1.83971, 0.934907}, +{145.776, 1.48907, 0.926742}, +{148.134, 1.07131, 0.919198}, +{150.530, 0.561128, 0.912640}, +{152.964, -0.843296E-01, 0.907303}, +{155.439, -0.950596, 0.901995}, +{157.953, -2.24181, 0.896719}, +{160.507, -4.70752, 0.891477}, +{162.400, -13.8158, 0.887668}, +{162.600, -13.8089, 10.5007}, +{163.103, -8.29501, 10.4970}, +{165.742, -3.08659, 10.4779}, +{168.422, -1.18127, 10.4589}, +{171.146, 0.371599E-01, 10.4399}, +{173.915, 0.947915, 10.4209}, +{176.727, 1.68407, 10.4020}, +{179.586, 2.30886, 10.3831}, +{182.491, 2.86291, 10.3618}, +{185.442, 3.35538, 10.3284}, +{188.442, 3.80080, 10.2927}, +{191.489, 4.21172, 10.2520}, +{194.587, 4.58576, 10.1994}, +{197.734, 4.92845, 10.1435}, +{200.932, 5.23991, 10.0848}, +{204.182, 5.52406, 10.0264}, +{207.485, 5.78106, 9.96826}, +{210.840, 5.99942, 9.91052}, +{214.251, 6.20343, 9.90441}, +{217.716, 6.40874, 9.90935}, +{221.237, 6.62506, 9.92307}, +{224.816, 6.84443, 9.93675}, +{228.452, 7.06465, 9.95050}, +{232.147, 7.28532, 9.96431}, +{235.902, 7.50644, 9.97806}, +{239.717, 7.72837, 9.99183}, +{243.595, 7.95161, 10.0056}, +{247.535, 8.17701, 10.0195}, +{251.538, 8.40565, 10.0334}, +{255.607, 8.63866, 10.0472}, +{259.741, 8.87785, 10.0611}, +{263.942, 9.12600, 10.0750}, +{268.211, 9.38764, 10.0889}, +{272.549, 9.67488, 10.1029}, +{276.957, 10.0210, 10.0678}, +{281.437, 10.3391, 9.97128}, +{285.989, 10.6154, 9.83735}, +{290.615, 10.8603, 9.69980}, +{295.315, 11.0810, 9.56415}, +{300.092, 11.2862, 9.43052}, +{304.945, 11.4789, 9.29874}, +{309.878, 11.6610, 9.16871}, +{314.890, 11.8338, 9.04043}, +{319.983, 11.9985, 8.91401}, +{325.158, 12.1563, 8.78950}, +{330.418, 12.3078, 8.66660}, +{335.762, 12.4535, 8.54541}, +{341.192, 12.5942, 8.42596}, +{346.711, 12.7303, 8.30812}, +{352.319, 12.8624, 8.19192}, +{358.017, 12.9910, 8.07738}, +{363.808, 13.1167, 7.96445}, +{369.692, 13.2401, 7.85308}, +{375.672, 13.3622, 7.74329}, +{381.748, 13.4848, 7.63506}, +{387.922, 13.6120, 7.52476}, +{394.197, 13.7405, 7.40820}, +{400.573, 13.8645, 7.27689}, +{407.052, 13.9737, 7.14150}, +{413.635, 14.0737, 7.00886}, +{420.326, 14.1672, 6.87860}, +{427.124, 14.2557, 6.75076}, +{434.032, 14.3401, 6.62527}, +{441.052, 14.4212, 6.50207}, +{448.186, 14.5032, 6.37999}, +{455.435, 14.5811, 6.25453}, +{462.802, 14.6535, 6.12761}, +{470.287, 14.7197, 6.00121}, +{477.894, 14.7800, 5.87733}, +{485.623, 14.8363, 5.75601}, +{493.478, 14.8890, 5.63719}, +{501.459, 14.9384, 5.52078}, +{509.570, 14.9850, 5.40686}, +{517.812, 15.0290, 5.29540}, +{526.187, 15.0710, 5.18647}, +{534.698, 15.1114, 5.08007}, +{543.346, 15.1510, 4.97602}, +{552.134, 15.1921, 4.87423}, +{561.065, 15.2330, 4.76649}, +{570.139, 15.2670, 4.65762}, +{579.361, 15.2959, 4.55280}, +{588.732, 15.3223, 4.45093}, +{598.254, 15.3471, 4.35170}, +{607.930, 15.3706, 4.25473}, +{617.763, 15.3933, 4.15991}, +{627.755, 15.4167, 4.06689}, +{637.908, 15.4403, 3.97208}, +{648.226, 15.4617, 3.87388}, +{658.711, 15.4755, 3.77450}, +{669.365, 15.4819, 3.67766}, +{680.191, 15.4824, 3.59184}, +{691.193, 15.4865, 3.51441}, +{702.372, 15.4999, 3.43951}, +{713.733, 15.5163, 3.35698}, +{725.277, 15.5262, 3.27020}, +{737.008, 15.5315, 3.18561}, +{748.928, 15.5341, 3.10323}, +{761.042, 15.5345, 3.02302}, +{773.351, 15.5329, 2.94500}, +{785.859, 15.5299, 2.86954}, +{798.570, 15.5260, 2.79646}, +{811.486, 15.5214, 2.72524}, +{824.611, 15.5161, 2.65581}, +{837.949, 15.5103, 2.58813}, +{851.502, 15.5041, 2.52161}, +{865.274, 15.4971, 2.45613}, +{879.269, 15.4888, 2.39175}, +{893.491, 15.4795, 2.32905}, +{907.943, 15.4693, 2.26801}, +{922.628, 15.4585, 2.20860}, +{937.551, 15.4470, 2.15060}, +{952.715, 15.4349, 2.09410}, +{968.124, 15.4223, 2.03908}, +{983.783, 15.4093, 1.98547}, +{999.695, 15.3959, 1.93318}, +{1015.86, 15.3823, 1.88216}, +{1032.29, 15.3682, 1.83173}, +{1048.99, 15.3534, 1.78246}, +{1065.96, 15.3378, 1.73434}, +{1083.20, 15.3216, 1.68751}, +{1100.72, 15.3049, 1.64194}, +{1118.52, 15.2877, 1.59758}, +{1136.61, 15.2701, 1.55445}, +{1155.00, 15.2520, 1.51246}, +{1173.68, 15.2335, 1.47158}, +{1192.66, 15.2145, 1.43186}, +{1211.95, 15.1952, 1.39320}, +{1231.55, 15.1755, 1.35557}, +{1251.47, 15.1553, 1.31901}, +{1271.72, 15.1347, 1.28354}, +{1292.29, 15.1138, 1.24914}, +{1313.19, 15.0925, 1.21564}, +{1334.43, 15.0709, 1.18306}, +{1356.01, 15.0488, 1.15136}, +{1377.94, 15.0263, 1.12050}, +{1400.23, 15.0034, 1.09046}, +{1422.88, 14.9798, 1.06119}, +{1445.89, 14.9556, 1.03274}, +{1469.28, 14.9308, 1.00515}, +{1493.04, 14.9051, 0.978445}, +{1517.19, 14.8790, 0.953045}, +{1541.73, 14.8524, 0.928391}, +{1566.67, 14.8254, 0.904380}, +{1592.01, 14.7976, 0.880984}, +{1617.76, 14.7690, 0.858192}, +{1643.92, 14.7396, 0.835993}, +{1670.51, 14.7091, 0.814372}, +{1697.53, 14.6776, 0.793309}, +{1724.99, 14.6452, 0.772787}, +{1752.89, 14.6112, 0.752090}, +{1781.24, 14.5753, 0.731711}, +{1810.05, 14.5373, 0.711709}, +{1839.32, 14.4969, 0.692248}, +{1869.07, 14.4539, 0.673319}, +{1899.30, 14.4080, 0.654911}, +{1930.02, 14.3589, 0.637010}, +{1961.24, 14.3061, 0.619597}, +{1992.96, 14.2488, 0.602653}, +{2025.20, 14.1870, 0.586572}, +{2057.95, 14.1192, 0.570029}, +{2091.24, 14.0437, 0.553800}, +{2125.06, 13.9591, 0.537916}, +{2159.43, 13.8633, 0.522383}, +{2194.36, 13.7531, 0.507156}, +{2229.85, 13.6240, 0.492240}, +{2265.92, 13.4692, 0.477643}, +{2302.57, 13.2776, 0.463355}, +{2339.81, 13.0290, 0.449353}, +{2377.66, 12.6820, 0.435640}, +{2416.11, 12.1250, 0.422216}, +{2455.19, 10.7868, 0.409077}, +{2471.90, 4.79408, 0.403647}, +{2472.10, 4.79536, 4.10969}, +{2494.90, 11.2689, 4.05625}, +{2535.26, 12.5388, 3.96452}, +{2576.26, 13.1810, 3.87387}, +{2617.93, 13.6189, 3.78454}, +{2660.27, 13.9525, 3.69661}, +{2703.30, 14.2218, 3.60994}, +{2747.03, 14.4470, 3.52449}, +{2791.46, 14.6397, 3.44043}, +{2836.61, 14.8077, 3.35790}, +{2882.49, 14.9558, 3.27664}, +{2929.11, 15.0876, 3.19691}, +{2976.48, 15.2060, 3.11856}, +{3024.63, 15.3126, 3.04154}, +{3073.55, 15.4092, 2.96610}, +{3123.26, 15.4972, 2.89204}, +{3173.78, 15.5775, 2.81947}, +{3225.11, 15.6508, 2.74818}, +{3277.27, 15.7180, 2.67844}, +{3330.28, 15.7798, 2.61019}, +{3384.15, 15.8366, 2.54323}, +{3438.88, 15.8888, 2.47766}, +{3494.50, 15.9368, 2.41352}, +{3551.02, 15.9810, 2.35074}, +{3608.46, 16.0217, 2.28932}, +{3666.82, 16.0592, 2.22927}, +{3726.13, 16.0937, 2.17055}, +{3786.40, 16.1254, 2.11314}, +{3847.64, 16.1546, 2.05704}, +{3909.87, 16.1814, 2.00221}, +{3973.11, 16.2060, 1.94865}, +{4037.38, 16.2285, 1.89634}, +{4102.68, 16.2492, 1.84526}, +{4169.03, 16.2680, 1.79538}, +{4236.46, 16.2851, 1.74670}, +{4304.98, 16.3007, 1.69919}, +{4374.62, 16.3148, 1.65283}, +{4445.37, 16.3276, 1.60760}, +{4517.27, 16.3391, 1.56348}, +{4590.33, 16.3494, 1.52046}, +{4664.58, 16.3586, 1.47849}, +{4740.03, 16.3667, 1.43757}, +{4816.69, 16.3739, 1.39767}, +{4894.60, 16.3801, 1.35880}, +{4973.77, 16.3855, 1.32090}, +{5054.21, 16.3901, 1.28397}, +{5135.96, 16.3939, 1.24800}, +{5219.03, 16.3971, 1.21295}, +{5303.44, 16.3995, 1.17879}, +{5389.22, 16.4014, 1.14554}, +{5476.39, 16.4027, 1.11313}, +{5564.97, 16.4034, 1.08161}, +{5654.98, 16.4037, 1.05088}, +{5746.44, 16.4035, 1.02099}, +{5839.39, 16.4028, 0.991891}, +{5933.83, 16.4018, 0.963576}, +{6029.81, 16.4004, 0.935981}, +{6127.33, 16.3986, 0.909174}, +{6226.44, 16.3965, 0.883064}, +{6327.15, 16.3941, 0.857636}, +{6429.48, 16.3914, 0.832928}, +{6533.48, 16.3885, 0.808893}, +{6639.15, 16.3854, 0.785501}, +{6746.54, 16.3820, 0.762743}, +{6855.65, 16.3784, 0.740610}, +{6966.54, 16.3746, 0.719113}, +{7079.22, 16.3707, 0.698179}, +{7193.72, 16.3667, 0.677835}, +{7310.07, 16.3625, 0.658029}, +{7428.31, 16.3581, 0.638795}, +{7548.45, 16.3537, 0.620084}, +{7670.54, 16.3491, 0.601904}, +{7794.61, 16.3445, 0.584254}, +{7920.68, 16.3398, 0.567084}, +{8048.79, 16.3351, 0.550385}, +{8178.98, 16.3302, 0.534162}, +{8311.26, 16.3254, 0.518394}, +{8445.69, 16.3205, 0.503077}, +{8582.29, 16.3155, 0.488186}, +{8721.11, 16.3105, 0.473719}, +{8862.16, 16.3055, 0.459664}, +{9005.50, 16.3005, 0.446005}, +{9151.16, 16.2955, 0.432739}, +{9299.17, 16.2905, 0.419853}, +{9449.58, 16.2855, 0.407331}, +{9602.42, 16.2805, 0.395174}, +{9757.73, 16.2755, 0.383362}, +{9915.55, 16.2705, 0.371890}, +{10075.9, 16.2656, 0.360746}, +{10238.9, 16.2607, 0.349924}, +{10404.5, 16.2558, 0.339414}, +{10572.8, 16.2509, 0.329206}, +{10743.8, 16.2461, 0.319295}, +{10917.6, 16.2413, 0.309670}, +{11094.2, 16.2366, 0.300324}, +{11273.6, 16.2318, 0.291249}, +{11455.9, 16.2272, 0.282438}, +{11641.2, 16.2226, 0.273883}, +{11829.5, 16.2180, 0.265578}, +{12020.8, 16.2135, 0.257514}, +{12215.3, 16.2090, 0.249686}, +{12412.8, 16.2046, 0.242086}, +{12613.6, 16.2002, 0.234709}, +{12817.6, 16.1959, 0.227547}, +{13025.0, 16.1917, 0.220595}, +{13235.6, 16.1875, 0.213847}, +{13449.7, 16.1833, 0.207297}, +{13667.2, 16.1792, 0.200939}, +{13888.3, 16.1752, 0.194769}, +{14112.9, 16.1712, 0.188779}, +{14341.2, 16.1673, 0.182966}, +{14573.1, 16.1634, 0.177324}, +{14808.9, 16.1596, 0.171849}, +{15048.4, 16.1559, 0.166535}, +{15291.8, 16.1522, 0.161378}, +{15539.1, 16.1486, 0.156373}, +{15790.4, 16.1450, 0.151516}, +{16045.8, 16.1415, 0.146803}, +{16305.4, 16.1381, 0.142229}, +{16569.1, 16.1347, 0.137791}, +{16837.1, 16.1314, 0.133484}, +{17109.4, 16.1281, 0.129305}, +{17386.1, 16.1249, 0.125250}, +{17667.4, 16.1217, 0.121315}, +{17953.1, 16.1186, 0.117497}, +{18243.5, 16.1155, 0.113792}, +{18538.6, 16.1125, 0.110197}, +{18838.4, 16.1096, 0.106709}, +{19143.1, 16.1067, 0.103325}, +{19452.7, 16.1039, 0.100042}, +{19767.4, 16.1011, 0.968557E-01}, +{20087.1, 16.0983, 0.937472E-01}, +{20412.0, 16.0956, 0.907512E-01}, +{20742.1, 16.0930, 0.878477E-01}, +{21077.6, 16.0904, 0.850338E-01}, +{21418.5, 16.0878, 0.823070E-01}, +{21765.0, 16.0853, 0.796646E-01}, +{22117.0, 16.0829, 0.771043E-01}, +{22474.7, 16.0805, 0.746235E-01}, +{22838.2, 16.0781, 0.722196E-01}, +{23207.6, 16.0758, 0.698907E-01}, +{23583.0, 16.0735, 0.676342E-01}, +{23964.4, 16.0713, 0.654482E-01}, +{24352.0, 16.0692, 0.633304E-01}, +{24745.9, 16.0670, 0.612789E-01}, +{25146.2, 16.0649, 0.592915E-01}, +{25552.9, 16.0629, 0.573665E-01}, +{25966.2, 16.0609, 0.555018E-01}, +{26386.1, 16.0589, 0.536957E-01}, +{26812.9, 16.0570, 0.519464E-01}, +{27246.6, 16.0552, 0.502521E-01}, +{27687.3, 16.0533, 0.486112E-01}, +{28135.1, 16.0515, 0.470220E-01}, +{28590.2, 16.0498, 0.454831E-01}, +{29052.6, 16.0481, 0.439928E-01}, +{29522.5, 16.0464, 0.425497E-01}, +{30000.0, 16.0447, 0.411523E-01}, +{0, 0, 0} +}; + +e_fp_fdp cl[] = { /* Z = 17 */ +{10.0000, -9999.00, 1.46938}, +{10.1617, -9999.00, 1.69220}, +{10.3261, -9999.00, 1.94880}, +{10.4931, -9999.00, 2.24432}, +{10.6628, -9999.00, 2.51303}, +{10.8353, -9999.00, 2.73153}, +{11.0106, -9999.00, 2.95549}, +{11.1886, -9999.00, 3.19416}, +{11.3696, -9999.00, 3.48881}, +{11.5535, -9999.00, 3.87618}, +{11.7404, -9999.00, 4.14416}, +{11.9303, -9999.00, 4.41407}, +{12.1232, -9999.00, 4.70156}, +{12.3193, -9999.00, 4.91582}, +{12.5186, -9999.00, 5.13087}, +{12.7210, -9999.00, 5.35533}, +{12.9268, -9999.00, 5.57204}, +{13.1359, -9999.00, 5.78353}, +{13.3483, -9999.00, 6.00304}, +{13.5642, -9999.00, 6.22540}, +{13.7836, -9999.00, 6.42563}, +{14.0066, -9999.00, 6.63229}, +{14.2331, -9999.00, 6.84561}, +{14.4633, -9999.00, 7.06523}, +{14.6973, -9999.00, 7.25268}, +{14.9350, -9999.00, 7.44510}, +{15.1765, -9999.00, 7.64264}, +{15.4220, -9999.00, 7.82750}, +{15.6714, -9999.00, 7.96238}, +{15.9249, -9999.00, 8.09958}, +{16.1825, -9999.00, 8.23914}, +{16.4442, -9999.00, 8.37683}, +{16.7102, -9999.00, 8.51461}, +{16.9805, -9999.00, 8.65466}, +{17.2551, -9999.00, 8.79701}, +{17.5342, -9999.00, 8.94170}, +{17.8178, -9999.00, 9.08877}, +{18.1060, -9999.00, 9.23827}, +{18.3989, -9999.00, 9.39023}, +{18.6964, -9999.00, 9.54467}, +{18.9988, -9999.00, 9.70167}, +{19.3061, -9999.00, 9.86124}, +{19.6184, -9999.00, 9.92421}, +{19.9357, -9999.00, 9.89076}, +{20.2582, -9999.00, 9.85742}, +{20.5858, -9999.00, 9.82420}, +{20.9188, -9999.00, 9.79108}, +{21.2571, -9999.00, 9.75807}, +{21.6009, -9999.00, 9.72518}, +{21.9503, -9999.00, 9.69240}, +{22.3053, -9999.00, 9.65973}, +{22.6661, -9999.00, 9.62716}, +{23.0327, -9999.00, 9.57623}, +{23.4053, -9999.00, 9.33842}, +{23.7838, -9999.00, 9.10653}, +{24.1685, -9999.00, 8.88038}, +{24.5594, -9999.00, 8.65986}, +{24.9566, -9999.00, 8.44481}, +{25.3603, -9999.00, 8.13178}, +{25.7705, -9999.00, 7.76956}, +{26.1873, -9999.00, 7.42345}, +{26.6109, -9999.00, 7.09277}, +{27.0413, -9999.00, 6.77682}, +{27.4786, -9999.00, 6.47493}, +{27.9231, -9999.00, 6.18650}, +{28.3747, -9999.00, 5.91091}, +{28.8337, -9999.00, 5.58156}, +{29.3000, 9.94411, 5.20522}, +{29.7739, 9.99265, 4.85425}, +{30.2555, 10.0178, 4.52694}, +{30.7449, 10.0328, 4.22171}, +{31.2421, 10.0544, 3.93705}, +{31.7475, 10.1253, 3.66007}, +{32.2609, 10.1438, 3.22012}, +{32.7827, 10.0587, 2.83305}, +{33.3130, 9.92498, 2.49251}, +{33.8518, 9.76783, 2.19290}, +{34.3993, 9.59654, 1.92930}, +{34.9557, 9.41675, 1.70061}, +{35.5211, 9.23839, 1.50120}, +{36.0956, 9.06224, 1.32517}, +{36.6794, 8.89042, 1.16979}, +{37.2727, 8.72973, 1.03262}, +{37.8755, 8.58277, 0.882572}, +{38.4882, 8.40510, 0.739600}, +{39.1107, 8.21396, 0.619793}, +{39.7432, 8.01658, 0.530227}, +{40.3861, 7.82891, 0.460211}, +{41.0393, 7.63232, 0.406707}, +{41.7031, 7.45700, 0.403132}, +{42.3776, 7.30842, 0.399590}, +{43.0630, 7.17379, 0.394518}, +{43.7595, 7.04043, 0.388766}, +{44.4673, 6.91370, 0.403715}, +{45.1865, 6.80125, 0.419899}, +{45.9174, 6.69754, 0.436731}, +{46.6600, 6.59760, 0.456765}, +{47.4147, 6.50635, 0.482148}, +{48.1816, 6.42237, 0.508941}, +{48.9609, 6.34452, 0.537223}, +{49.7528, 6.27232, 0.567077}, +{50.5576, 6.20586, 0.598591}, +{51.3753, 6.14666, 0.630882}, +{52.2062, 6.09073, 0.659237}, +{53.0506, 6.03667, 0.688866}, +{53.9087, 5.98520, 0.719826}, +{54.7806, 5.93669, 0.752177}, +{55.6667, 5.89126, 0.785984}, +{56.5670, 5.84909, 0.821309}, +{57.4820, 5.81041, 0.858222}, +{58.4117, 5.77576, 0.896794}, +{59.3564, 5.74638, 0.937099}, +{60.3165, 5.72492, 0.974146}, +{61.2921, 5.70206, 1.00751}, +{62.2834, 5.68014, 1.04202}, +{63.2908, 5.66026, 1.07771}, +{64.3145, 5.64307, 1.11463}, +{65.3547, 5.62920, 1.15281}, +{66.4118, 5.61957, 1.19229}, +{67.4859, 5.61600, 1.23313}, +{68.5775, 5.62469, 1.27537}, +{69.6867, 5.63561, 1.29388}, +{70.8138, 5.64002, 1.31261}, +{71.9591, 5.64157, 1.33160}, +{73.1230, 5.64279, 1.35088}, +{74.3057, 5.64451, 1.37042}, +{75.5076, 5.64760, 1.39026}, +{76.7289, 5.65370, 1.41038}, +{77.9699, 5.66715, 1.42454}, +{79.2310, 5.67395, 1.43088}, +{80.5125, 5.67739, 1.43726}, +{81.8147, 5.67907, 1.44366}, +{83.1380, 5.67961, 1.45009}, +{84.4827, 5.67939, 1.45655}, +{85.8491, 5.67883, 1.46304}, +{87.2377, 5.67884, 1.46956}, +{88.6487, 5.67918, 1.47311}, +{90.0825, 5.67685, 1.47525}, +{91.5395, 5.67283, 1.47739}, +{93.0201, 5.66756, 1.47953}, +{94.5246, 5.66122, 1.48168}, +{96.0535, 5.65393, 1.48383}, +{97.6071, 5.64579, 1.48598}, +{99.1858, 5.63692, 1.48814}, +{100.790, 5.62752, 1.49030}, +{102.420, 5.61796, 1.49246}, +{104.077, 5.60976, 1.49462}, +{105.760, 5.60269, 1.49039}, +{107.471, 5.59010, 1.48328}, +{109.209, 5.57321, 1.47620}, +{110.975, 5.55340, 1.46915}, +{112.770, 5.53084, 1.46214}, +{114.594, 5.50558, 1.45516}, +{116.448, 5.47760, 1.44821}, +{118.331, 5.44686, 1.44130}, +{120.245, 5.41327, 1.43442}, +{122.190, 5.37671, 1.42758}, +{124.166, 5.33706, 1.42076}, +{126.175, 5.29416, 1.41398}, +{128.215, 5.24787, 1.40723}, +{130.289, 5.19815, 1.40051}, +{132.397, 5.14586, 1.39296}, +{134.538, 5.08787, 1.38370}, +{136.714, 5.02406, 1.37449}, +{138.925, 4.95459, 1.36535}, +{141.172, 4.87907, 1.35626}, +{143.456, 4.79704, 1.34724}, +{145.776, 4.70792, 1.33827}, +{148.134, 4.61105, 1.32937}, +{150.530, 4.50569, 1.32053}, +{152.964, 4.39108, 1.31174}, +{155.439, 4.26771, 1.30301}, +{157.953, 4.13122, 1.28921}, +{160.507, 3.97786, 1.27520}, +{163.103, 3.80660, 1.26134}, +{165.742, 3.61506, 1.24763}, +{168.422, 3.39989, 1.23407}, +{171.146, 3.15662, 1.22066}, +{173.915, 2.87929, 1.20741}, +{176.727, 2.55971, 1.19429}, +{179.586, 2.18624, 1.18132}, +{182.491, 1.74165, 1.16849}, +{185.442, 1.19875, 1.15580}, +{188.442, 0.510952, 1.14325}, +{191.489, -0.412386, 1.13083}, +{194.587, -1.78902, 1.11855}, +{197.734, -4.44567, 1.10640}, +{199.900, -13.8452, 1.09822}, +{200.100, -13.8680, 10.4682}, +{200.932, -7.26444, 10.5209}, +{204.182, -2.86107, 10.7273}, +{207.485, -1.11739, 10.9378}, +{210.840, 0.542504E-01, 11.1524}, +{214.251, 1.01005, 11.3712}, +{217.716, 1.91454, 11.4950}, +{221.237, 2.65192, 11.5179}, +{224.816, 3.26308, 11.5409}, +{228.452, 3.80792, 11.5639}, +{232.147, 4.30391, 11.5868}, +{235.902, 4.76334, 11.6099}, +{239.717, 5.19489, 11.6330}, +{243.595, 5.60502, 11.6563}, +{247.535, 5.99886, 11.6795}, +{251.538, 6.38069, 11.7027}, +{255.607, 6.75433, 11.7260}, +{259.741, 7.12375, 11.7494}, +{263.942, 7.49351, 11.7728}, +{268.211, 7.86961, 11.7962}, +{272.549, 8.27133, 11.8197}, +{276.957, 8.71665, 11.7925}, +{281.437, 9.12886, 11.7015}, +{285.989, 9.50259, 11.5712}, +{290.615, 9.83486, 11.4367}, +{295.315, 10.1410, 11.3038}, +{300.092, 10.4278, 11.1726}, +{304.945, 10.6989, 11.0428}, +{309.878, 10.9566, 10.9145}, +{314.890, 11.2029, 10.7877}, +{319.983, 11.4390, 10.6624}, +{325.158, 11.6664, 10.5385}, +{330.418, 11.8860, 10.4162}, +{335.762, 12.0989, 10.2952}, +{341.192, 12.3058, 10.1756}, +{346.711, 12.5076, 10.0574}, +{352.319, 12.7050, 9.94051}, +{358.017, 12.8993, 9.82514}, +{363.808, 13.0917, 9.71102}, +{369.692, 13.2836, 9.59816}, +{375.672, 13.4771, 9.48652}, +{381.748, 13.6767, 9.37632}, +{387.922, 13.9158, 9.24352}, +{394.197, 14.1180, 9.06027}, +{400.573, 14.2829, 8.88851}, +{407.052, 14.4382, 8.72306}, +{413.635, 14.5896, 8.56070}, +{420.326, 14.7332, 8.39399}, +{427.124, 14.8698, 8.22747}, +{434.032, 14.9953, 8.05822}, +{441.052, 15.1105, 7.89234}, +{448.186, 15.2189, 7.72948}, +{455.435, 15.3204, 7.56838}, +{462.802, 15.4155, 7.41007}, +{470.287, 15.5050, 7.25479}, +{477.894, 15.5907, 7.10271}, +{485.623, 15.6720, 6.95011}, +{493.478, 15.7471, 6.79940}, +{501.459, 15.8171, 6.65193}, +{509.570, 15.8828, 6.50656}, +{517.812, 15.9446, 6.36357}, +{526.187, 16.0019, 6.22270}, +{534.698, 16.0553, 6.08451}, +{543.346, 16.1056, 5.94889}, +{552.134, 16.1518, 5.81481}, +{561.065, 16.1943, 5.68384}, +{570.139, 16.2344, 5.55569}, +{579.361, 16.2713, 5.42920}, +{588.732, 16.3051, 5.30562}, +{598.254, 16.3366, 5.18474}, +{607.930, 16.3654, 5.06583}, +{617.763, 16.3919, 4.94954}, +{627.755, 16.4165, 4.83576}, +{637.908, 16.4390, 4.72373}, +{648.226, 16.4592, 4.61412}, +{658.711, 16.4779, 4.50688}, +{669.365, 16.4946, 4.40115}, +{680.191, 16.5093, 4.29780}, +{691.193, 16.5227, 4.19667}, +{702.372, 16.5343, 4.09694}, +{713.733, 16.5439, 3.99951}, +{725.277, 16.5520, 3.90435}, +{737.008, 16.5589, 3.81139}, +{748.928, 16.5647, 3.72021}, +{761.042, 16.5692, 3.63085}, +{773.351, 16.5724, 3.54315}, +{785.859, 16.5742, 3.45748}, +{798.570, 16.5751, 3.37378}, +{811.486, 16.5749, 3.29172}, +{824.611, 16.5738, 3.21132}, +{837.949, 16.5712, 3.13255}, +{851.502, 16.5678, 3.05628}, +{865.274, 16.5641, 2.98154}, +{879.269, 16.5598, 2.90833}, +{893.491, 16.5543, 2.83610}, +{907.943, 16.5478, 2.76591}, +{922.628, 16.5414, 2.69771}, +{937.551, 16.5342, 2.62978}, +{952.715, 16.5257, 2.56347}, +{968.124, 16.5160, 2.49876}, +{983.783, 16.5061, 2.43663}, +{999.695, 16.4962, 2.37544}, +{1015.86, 16.4853, 2.31518}, +{1032.29, 16.4738, 2.25657}, +{1048.99, 16.4618, 2.19941}, +{1065.96, 16.4493, 2.14367}, +{1083.20, 16.4365, 2.08937}, +{1100.72, 16.4234, 2.03624}, +{1118.52, 16.4098, 1.98418}, +{1136.61, 16.3958, 1.93325}, +{1155.00, 16.3812, 1.88364}, +{1173.68, 16.3662, 1.83532}, +{1192.66, 16.3511, 1.78817}, +{1211.95, 16.3357, 1.74200}, +{1231.55, 16.3197, 1.69670}, +{1251.47, 16.3032, 1.65259}, +{1271.72, 16.2863, 1.60964}, +{1292.29, 16.2692, 1.56781}, +{1313.19, 16.2516, 1.52683}, +{1334.43, 16.2336, 1.48690}, +{1356.01, 16.2152, 1.44802}, +{1377.94, 16.1964, 1.41017}, +{1400.23, 16.1774, 1.37324}, +{1422.88, 16.1578, 1.33716}, +{1445.89, 16.1378, 1.30207}, +{1469.28, 16.1173, 1.26789}, +{1493.04, 16.0960, 1.23458}, +{1517.19, 16.0743, 1.20298}, +{1541.73, 16.0526, 1.17234}, +{1566.67, 16.0307, 1.14255}, +{1592.01, 16.0086, 1.11352}, +{1617.76, 15.9862, 1.08522}, +{1643.92, 15.9633, 1.05765}, +{1670.51, 15.9401, 1.03077}, +{1697.53, 15.9163, 1.00458}, +{1724.99, 15.8922, 0.979056}, +{1752.89, 15.8675, 0.953791}, +{1781.24, 15.8420, 0.929050}, +{1810.05, 15.8156, 0.904856}, +{1839.32, 15.7883, 0.881295}, +{1869.07, 15.7600, 0.858348}, +{1899.30, 15.7307, 0.836001}, +{1930.02, 15.7004, 0.814232}, +{1961.24, 15.6688, 0.793030}, +{1992.96, 15.6400, 0.772376}, +{2025.20, 15.6045, 0.742744}, +{2057.95, 15.5631, 0.722827}, +{2091.24, 15.5215, 0.703634}, +{2125.06, 15.4784, 0.684894}, +{2159.43, 15.4329, 0.666586}, +{2194.36, 15.3845, 0.648702}, +{2229.85, 15.3326, 0.631215}, +{2265.92, 15.2766, 0.614141}, +{2302.57, 15.2157, 0.597456}, +{2339.81, 15.1491, 0.581146}, +{2377.66, 15.0756, 0.565200}, +{2416.11, 14.9936, 0.549622}, +{2455.19, 14.9010, 0.534411}, +{2494.90, 14.7952, 0.519541}, +{2535.26, 14.6719, 0.505004}, +{2576.26, 14.5253, 0.490797}, +{2617.93, 14.3455, 0.476902}, +{2660.27, 14.1156, 0.463341}, +{2703.30, 13.8020, 0.450062}, +{2747.03, 13.3219, 0.437092}, +{2791.46, 12.3484, 0.424409}, +{2822.30, 5.68102, 0.415937}, +{2822.50, 5.68236, 4.11507}, +{2836.61, 11.5499, 4.08546}, +{2882.49, 13.3286, 3.99160}, +{2929.11, 14.0620, 3.89901}, +{2976.48, 14.5387, 3.80795}, +{3024.63, 14.8940, 3.71842}, +{3073.55, 15.1772, 3.63008}, +{3123.26, 15.4119, 3.54327}, +{3173.78, 15.6117, 3.45790}, +{3225.11, 15.7849, 3.37405}, +{3277.27, 15.9371, 3.29165}, +{3330.28, 16.0722, 3.21065}, +{3384.15, 16.1930, 3.13124}, +{3438.88, 16.3018, 3.05337}, +{3494.50, 16.4002, 2.97701}, +{3551.02, 16.4896, 2.90215}, +{3608.46, 16.5711, 2.82872}, +{3666.82, 16.6454, 2.75678}, +{3726.13, 16.7135, 2.68634}, +{3786.40, 16.7760, 2.61735}, +{3847.64, 16.8333, 2.54981}, +{3909.87, 16.8859, 2.48372}, +{3973.11, 16.9343, 2.41907}, +{4037.38, 16.9789, 2.35580}, +{4102.68, 17.0199, 2.29396}, +{4169.03, 17.0575, 2.23348}, +{4236.46, 17.0922, 2.17440}, +{4304.98, 17.1241, 2.11664}, +{4374.62, 17.1534, 2.06020}, +{4445.37, 17.1802, 2.00508}, +{4517.27, 17.2048, 1.95125}, +{4590.33, 17.2274, 1.89871}, +{4664.58, 17.2481, 1.84738}, +{4740.03, 17.2669, 1.79729}, +{4816.69, 17.2840, 1.74840}, +{4894.60, 17.2996, 1.70074}, +{4973.77, 17.3137, 1.65419}, +{5054.21, 17.3264, 1.60881}, +{5135.96, 17.3378, 1.56455}, +{5219.03, 17.3481, 1.52142}, +{5303.44, 17.3572, 1.47931}, +{5389.22, 17.3653, 1.43831}, +{5476.39, 17.3724, 1.39832}, +{5564.97, 17.3786, 1.35936}, +{5654.98, 17.3839, 1.32139}, +{5746.44, 17.3884, 1.28442}, +{5839.39, 17.3922, 1.24835}, +{5933.83, 17.3953, 1.21326}, +{6029.81, 17.3977, 1.17905}, +{6127.33, 17.3995, 1.14578}, +{6226.44, 17.4007, 1.11333}, +{6327.15, 17.4014, 1.08177}, +{6429.48, 17.4016, 1.05104}, +{6533.48, 17.4014, 1.02114}, +{6639.15, 17.4007, 0.991990}, +{6746.54, 17.3996, 0.963658}, +{6855.65, 17.3981, 0.936072}, +{6966.54, 17.3963, 0.909242}, +{7079.22, 17.3942, 0.883124}, +{7193.72, 17.3917, 0.857693}, +{7310.07, 17.3890, 0.832967}, +{7428.31, 17.3861, 0.808936}, +{7548.45, 17.3829, 0.785542}, +{7670.54, 17.3795, 0.762805}, +{7794.61, 17.3759, 0.740674}, +{7920.68, 17.3721, 0.719133}, +{8048.79, 17.3682, 0.698207}, +{8178.98, 17.3641, 0.677863}, +{8311.26, 17.3598, 0.658099}, +{8445.69, 17.3555, 0.638867}, +{8582.29, 17.3510, 0.620175}, +{8721.11, 17.3465, 0.601998}, +{8862.16, 17.3419, 0.584334}, +{9005.50, 17.3371, 0.567166}, +{9151.16, 17.3324, 0.550470}, +{9299.17, 17.3275, 0.534254}, +{9449.58, 17.3226, 0.518495}, +{9602.42, 17.3177, 0.503175}, +{9757.73, 17.3128, 0.488293}, +{9915.55, 17.3078, 0.473831}, +{10075.9, 17.3028, 0.459779}, +{10238.9, 17.2978, 0.446128}, +{10404.5, 17.2928, 0.432865}, +{10572.8, 17.2877, 0.419979}, +{10743.8, 17.2827, 0.407462}, +{10917.6, 17.2777, 0.395303}, +{11094.2, 17.2727, 0.383492}, +{11273.6, 17.2678, 0.372020}, +{11455.9, 17.2628, 0.360877}, +{11641.2, 17.2579, 0.350055}, +{11829.5, 17.2530, 0.339544}, +{12020.8, 17.2481, 0.329336}, +{12215.3, 17.2433, 0.319422}, +{12412.8, 17.2385, 0.309795}, +{12613.6, 17.2338, 0.300447}, +{12817.6, 17.2291, 0.291369}, +{13025.0, 17.2244, 0.282554}, +{13235.6, 17.2198, 0.273995}, +{13449.7, 17.2152, 0.265684}, +{13667.2, 17.2107, 0.257615}, +{13888.3, 17.2062, 0.249780}, +{14112.9, 17.2018, 0.242174}, +{14341.2, 17.1975, 0.234790}, +{14573.1, 17.1932, 0.227620}, +{14808.9, 17.1889, 0.220660}, +{15048.4, 17.1847, 0.213904}, +{15291.8, 17.1806, 0.207345}, +{15539.1, 17.1765, 0.200977}, +{15790.4, 17.1724, 0.194796}, +{16045.8, 17.1685, 0.188797}, +{16305.4, 17.1646, 0.182973}, +{16569.1, 17.1607, 0.177320}, +{16837.1, 17.1569, 0.171833}, +{17109.4, 17.1532, 0.166507}, +{17386.1, 17.1495, 0.161337}, +{17667.4, 17.1458, 0.156320}, +{17953.1, 17.1423, 0.151450}, +{18243.5, 17.1388, 0.146723}, +{18538.6, 17.1353, 0.142136}, +{18838.4, 17.1319, 0.137683}, +{19143.1, 17.1286, 0.133362}, +{19452.7, 17.1253, 0.129168}, +{19767.4, 17.1221, 0.125098}, +{20087.1, 17.1189, 0.121156}, +{20412.0, 17.1157, 0.117324}, +{20742.1, 17.1127, 0.113609}, +{21077.6, 17.1097, 0.110007}, +{21418.5, 17.1067, 0.106515}, +{21765.0, 17.1038, 0.103129}, +{22117.0, 17.1009, 0.998466E-01}, +{22474.7, 17.0981, 0.966649E-01}, +{22838.2, 17.0953, 0.935805E-01}, +{23207.6, 17.0926, 0.905909E-01}, +{23583.0, 17.0900, 0.876930E-01}, +{23964.4, 17.0874, 0.848845E-01}, +{24352.0, 17.0848, 0.821624E-01}, +{24745.9, 17.0823, 0.795244E-01}, +{25146.2, 17.0799, 0.769679E-01}, +{25552.9, 17.0775, 0.744905E-01}, +{25966.2, 17.0751, 0.720900E-01}, +{26386.1, 17.0728, 0.697638E-01}, +{26812.9, 17.0705, 0.675100E-01}, +{27246.6, 17.0683, 0.653262E-01}, +{27687.3, 17.0661, 0.632106E-01}, +{28135.1, 17.0640, 0.611608E-01}, +{28590.2, 17.0619, 0.591751E-01}, +{29052.6, 17.0599, 0.572516E-01}, +{29522.5, 17.0579, 0.553882E-01}, +{30000.0, 17.0559, 0.535833E-01}, +{0, 0, 0} +}; + +e_fp_fdp ar[] = { /* Z = 18 */ +{10.0000, -9999.00, 0.949375E-15}, +{10.1617, -9999.00, 0.964731E-15}, +{10.3261, -9999.00, 0.980335E-15}, +{10.4931, -9999.00, 0.996191E-15}, +{10.6628, -9999.00, 0.101230E-14}, +{10.8353, -9999.00, 0.102868E-14}, +{11.0106, -9999.00, 0.104531E-14}, +{11.1886, -9999.00, 0.106222E-14}, +{11.3696, -9999.00, 0.107940E-14}, +{11.5535, -9999.00, 0.109686E-14}, +{11.7404, -9999.00, 0.111460E-14}, +{11.9303, -9999.00, 0.113263E-14}, +{12.1232, -9999.00, 0.115095E-14}, +{12.3193, -9999.00, 0.116956E-14}, +{12.5186, -9999.00, 0.118848E-14}, +{12.7210, -9999.00, 0.120770E-14}, +{12.9268, -9999.00, 0.122724E-14}, +{13.1359, -9999.00, 0.124709E-14}, +{13.3483, -9999.00, 0.126726E-14}, +{13.5642, -9999.00, 0.128776E-14}, +{13.7836, -9999.00, 0.130858E-14}, +{14.0066, -9999.00, 0.132975E-14}, +{14.2331, -9999.00, 0.135126E-14}, +{14.4633, -9999.00, 0.137311E-14}, +{14.6973, -9999.00, 0.139532E-14}, +{14.9350, -9999.00, 0.141789E-14}, +{15.1765, -9999.00, 0.144082E-14}, +{15.4220, -9999.00, 0.146413E-14}, +{15.6714, -9999.00, 0.148781E-14}, +{15.7000, -9999.00, 0.149052E-14}, +{15.9000, -9999.00, 7.37780}, +{15.9249, -9999.00, 7.40169}, +{16.1825, -9999.00, 7.65097}, +{16.4442, -9999.00, 7.90865}, +{16.7102, -9999.00, 8.17500}, +{16.9805, -9999.00, 8.45033}, +{17.2551, -9999.00, 8.71866}, +{17.5342, -9999.00, 8.99489}, +{17.8178, -9999.00, 9.27988}, +{18.1060, -9999.00, 9.57390}, +{18.3989, -9999.00, 9.87722}, +{18.6964, -9999.00, 10.0769}, +{18.9988, -9999.00, 10.2212}, +{19.3061, -9999.00, 10.3675}, +{19.6184, -9999.00, 10.5159}, +{19.9357, -9999.00, 10.6665}, +{20.2582, -9999.00, 10.8167}, +{20.5858, -9999.00, 10.9668}, +{20.9188, -9999.00, 11.1189}, +{21.2571, -9999.00, 11.2731}, +{21.6009, -9999.00, 11.4295}, +{21.9503, -9999.00, 11.5880}, +{22.3053, -9999.00, 11.7097}, +{22.6661, -9999.00, 11.8098}, +{23.0327, -9999.00, 11.9107}, +{23.4053, -9999.00, 12.0125}, +{23.7838, -9999.00, 12.1152}, +{24.1685, -9999.00, 12.2187}, +{24.5594, -9999.00, 12.3231}, +{24.9566, -9999.00, 12.4285}, +{25.3603, -9999.00, 12.5068}, +{25.7705, -9999.00, 12.5003}, +{26.1873, -9999.00, 12.4939}, +{26.6109, -9999.00, 12.4875}, +{27.0413, -9999.00, 12.4811}, +{27.4786, -9999.00, 12.4746}, +{27.9231, -9999.00, 12.4276}, +{28.3747, -9999.00, 12.2749}, +{28.8337, -9999.00, 12.1241}, +{29.3000, 7.16821, 11.9752}, +{29.7739, 7.66932, 11.8280}, +{30.2555, 8.27340, 11.6127}, +{30.7449, 8.81707, 11.2069}, +{31.2421, 9.21762, 10.8152}, +{31.7475, 9.58113, 10.4373}, +{32.2609, 9.92024, 10.0726}, +{32.7827, 10.2556, 9.72056}, +{33.3130, 10.6109, 9.33987}, +{33.8518, 10.9293, 8.90509}, +{34.3993, 11.1937, 8.49054}, +{34.9557, 11.4568, 8.09529}, +{35.5211, 11.7510, 7.71845}, +{36.0956, 12.2163, 7.34539}, +{36.6794, 12.5658, 6.53408}, +{37.2727, 12.6642, 5.81238}, +{37.8755, 12.8040, 5.17039}, +{38.4882, 12.8512, 4.33445}, +{39.1107, 12.6252, 3.54127}, +{39.7432, 12.2858, 2.89324}, +{40.3861, 11.9060, 2.36379}, +{41.0393, 11.5048, 1.93122}, +{41.7031, 11.1027, 1.57782}, +{42.3776, 10.6932, 1.29078}, +{43.0630, 10.3090, 1.08938}, +{43.7595, 9.95151, 0.919409}, +{44.4673, 9.59508, 0.791494}, +{45.1865, 9.27243, 0.726839}, +{45.9174, 8.98249, 0.667465}, +{46.6600, 8.71430, 0.649193}, +{47.4147, 8.48849, 0.640955}, +{48.1816, 8.28327, 0.632821}, +{48.9609, 8.09455, 0.631336}, +{49.7528, 7.92147, 0.630701}, +{50.5576, 7.75016, 0.630240}, +{51.3753, 7.58985, 0.648426}, +{52.2062, 7.44897, 0.667137}, +{53.0506, 7.31746, 0.686388}, +{53.9087, 7.19018, 0.706194}, +{54.7806, 7.06923, 0.733531}, +{55.6667, 6.95878, 0.765241}, +{56.5670, 6.85645, 0.798322}, +{57.4820, 6.76046, 0.832833}, +{58.4117, 6.66879, 0.868956}, +{59.3564, 6.58314, 0.911925}, +{60.3165, 6.50575, 0.957020}, +{61.2921, 6.43529, 1.00435}, +{62.2834, 6.37198, 1.05401}, +{63.2908, 6.31643, 1.10613}, +{64.3145, 6.27180, 1.16083}, +{65.3547, 6.23924, 1.20753}, +{66.4118, 6.20776, 1.24560}, +{67.4859, 6.17389, 1.28488}, +{68.5775, 6.14316, 1.32538}, +{69.6867, 6.11609, 1.36717}, +{70.8138, 6.09323, 1.41027}, +{71.9591, 6.08226, 1.45474}, +{73.1230, 6.07497, 1.48590}, +{74.3057, 6.06240, 1.51689}, +{75.5076, 6.05142, 1.54853}, +{76.7289, 6.04256, 1.58083}, +{77.9699, 6.03653, 1.61381}, +{79.2310, 6.03851, 1.64747}, +{80.5125, 6.04560, 1.67290}, +{81.8147, 6.04912, 1.69023}, +{83.1380, 6.04944, 1.70773}, +{84.4827, 6.04895, 1.72541}, +{85.8491, 6.04836, 1.74328}, +{87.2377, 6.04807, 1.76133}, +{88.6487, 6.04839, 1.77957}, +{90.0825, 6.04957, 1.79800}, +{91.5395, 6.05193, 1.81661}, +{93.0201, 6.05584, 1.83542}, +{94.5246, 6.06176, 1.85443}, +{96.0535, 6.07318, 1.87363}, +{97.6071, 6.08987, 1.88746}, +{99.1858, 6.10379, 1.88943}, +{100.790, 6.11193, 1.89139}, +{102.420, 6.11769, 1.89336}, +{104.077, 6.12192, 1.89533}, +{105.760, 6.12506, 1.89730}, +{107.471, 6.12741, 1.89927}, +{109.209, 6.12922, 1.90125}, +{110.975, 6.13075, 1.90322}, +{112.770, 6.13235, 1.90520}, +{114.594, 6.13454, 1.90718}, +{116.448, 6.13837, 1.90917}, +{118.331, 6.14800, 1.91115}, +{120.245, 6.16044, 1.89697}, +{122.190, 6.16324, 1.87609}, +{124.166, 6.15710, 1.85544}, +{126.175, 6.14634, 1.83502}, +{128.215, 6.13128, 1.81482}, +{130.289, 6.11218, 1.79485}, +{132.397, 6.08908, 1.77509}, +{134.538, 6.06191, 1.75556}, +{136.714, 6.02858, 1.73624}, +{138.925, 5.99005, 1.72085}, +{141.172, 5.95064, 1.71079}, +{143.456, 5.91085, 1.70079}, +{145.776, 5.86902, 1.69085}, +{148.134, 5.82462, 1.68096}, +{150.530, 5.77726, 1.67114}, +{152.964, 5.72664, 1.66137}, +{155.439, 5.67245, 1.65166}, +{157.953, 5.61440, 1.64200}, +{160.507, 5.55217, 1.63240}, +{163.103, 5.48546, 1.62286}, +{165.742, 5.41393, 1.61338}, +{168.422, 5.33729, 1.60394}, +{171.146, 5.25537, 1.59457}, +{173.915, 5.16880, 1.58525}, +{176.727, 5.07676, 1.57121}, +{179.586, 4.97400, 1.55385}, +{182.491, 4.85905, 1.53667}, +{185.442, 4.73316, 1.51969}, +{188.442, 4.59581, 1.50289}, +{191.489, 4.44851, 1.48628}, +{194.587, 4.28600, 1.45771}, +{197.734, 4.09797, 1.42787}, +{200.932, 3.88473, 1.39864}, +{204.182, 3.64426, 1.37000}, +{207.485, 3.37229, 1.34195}, +{210.840, 3.06290, 1.31448}, +{214.251, 2.70742, 1.28885}, +{217.716, 2.29824, 1.26755}, +{221.237, 1.82289, 1.24660}, +{224.816, 1.25779, 1.22600}, +{228.452, 0.569782, 1.20574}, +{232.147, -0.296219, 1.18581}, +{235.902, -1.44089, 1.16544}, +{239.717, -3.08671, 1.14206}, +{243.595, -5.87741, 1.11916}, +{247.535, -14.4571, 1.09671}, +{248.300, -25.6896, 1.09244}, +{248.500, -25.6342, 17.6290}, +{251.538, -7.08366, 17.2582}, +{255.607, -2.40344, 16.7805}, +{259.741, 0.166927, 16.3161}, +{263.942, 1.91869, 15.8748}, +{268.211, 3.24484, 15.5141}, +{272.549, 4.33175, 15.1615}, +{276.957, 5.26029, 14.8160}, +{281.437, 6.03813, 14.4164}, +{285.989, 6.64307, 14.0275}, +{290.615, 7.11879, 13.6491}, +{295.315, 7.33982, 13.2901}, +{300.092, 7.50143, 13.3049}, +{304.945, 7.86258, 13.3197}, +{309.878, 8.23435, 13.3345}, +{314.890, 8.62413, 13.3493}, +{319.983, 9.03010, 13.3642}, +{325.158, 9.45508, 13.3790}, +{330.418, 9.90596, 13.3939}, +{335.762, 10.4258, 13.4088}, +{341.192, 11.0469, 13.3775}, +{346.711, 11.6410, 13.0326}, +{352.319, 12.0564, 12.6966}, +{358.017, 12.3689, 12.3760}, +{363.808, 12.6364, 12.1308}, +{369.692, 12.9140, 11.8904}, +{375.672, 13.1707, 11.6549}, +{381.748, 13.4117, 11.4239}, +{387.922, 13.6365, 11.1939}, +{394.197, 13.8435, 10.9685}, +{400.573, 14.0357, 10.7477}, +{407.052, 14.2135, 10.5313}, +{413.635, 14.3773, 10.3192}, +{420.326, 14.5262, 10.1114}, +{427.124, 14.6550, 9.90786}, +{434.032, 14.7656, 9.73331}, +{441.052, 14.8826, 9.57749}, +{448.186, 15.0071, 9.42417}, +{455.435, 15.1301, 9.27330}, +{462.802, 15.2514, 9.12484}, +{470.287, 15.3706, 8.97876}, +{477.894, 15.4874, 8.83502}, +{485.623, 15.6020, 8.69358}, +{493.478, 15.7147, 8.55440}, +{501.459, 15.8258, 8.41746}, +{509.570, 15.9359, 8.28271}, +{517.812, 16.0459, 8.15012}, +{526.187, 16.1633, 8.01964}, +{534.698, 16.2826, 7.87579}, +{543.346, 16.3899, 7.72696}, +{552.134, 16.4946, 7.58076}, +{561.065, 16.5968, 7.42279}, +{570.139, 16.6841, 7.26194}, +{579.361, 16.7596, 7.10867}, +{588.732, 16.8307, 6.96006}, +{598.254, 16.8983, 6.81547}, +{607.930, 16.9630, 6.67401}, +{617.763, 17.0256, 6.53542}, +{627.755, 17.0871, 6.39920}, +{637.908, 17.1496, 6.26039}, +{648.226, 17.2072, 6.11657}, +{658.711, 17.2530, 5.97087}, +{669.365, 17.2871, 5.82850}, +{680.191, 17.3113, 5.70225}, +{691.193, 17.3398, 5.58839}, +{702.372, 17.3800, 5.47890}, +{713.733, 17.4241, 5.36137}, +{725.277, 17.4608, 5.23948}, +{737.008, 17.4930, 5.12039}, +{748.928, 17.5228, 5.00401}, +{761.042, 17.5514, 4.89010}, +{773.351, 17.5813, 4.77704}, +{785.859, 17.6101, 4.66057}, +{798.570, 17.6318, 4.54207}, +{811.486, 17.6481, 4.42661}, +{824.611, 17.6607, 4.31405}, +{837.949, 17.6700, 4.20431}, +{851.502, 17.6761, 4.09843}, +{865.274, 17.6804, 3.99624}, +{879.269, 17.6839, 3.89751}, +{893.491, 17.6866, 3.80119}, +{907.943, 17.6884, 3.70726}, +{922.628, 17.6898, 3.61567}, +{937.551, 17.6906, 3.52431}, +{952.715, 17.6894, 3.43478}, +{968.124, 17.6866, 3.34712}, +{983.783, 17.6823, 3.26168}, +{999.695, 17.6768, 3.17849}, +{1015.86, 17.6705, 3.09750}, +{1032.29, 17.6641, 3.01914}, +{1048.99, 17.6578, 2.94133}, +{1065.96, 17.6497, 2.86399}, +{1083.20, 17.6400, 2.78871}, +{1100.72, 17.6292, 2.71542}, +{1118.52, 17.6175, 2.64404}, +{1136.61, 17.6050, 2.57458}, +{1155.00, 17.5919, 2.50691}, +{1173.68, 17.5781, 2.44096}, +{1192.66, 17.5637, 2.37684}, +{1211.95, 17.5491, 2.31438}, +{1231.55, 17.5341, 2.25354}, +{1251.47, 17.5191, 2.19371}, +{1271.72, 17.5035, 2.13496}, +{1292.29, 17.4869, 2.07717}, +{1313.19, 17.4695, 2.02085}, +{1334.43, 17.4513, 1.96606}, +{1356.01, 17.4325, 1.91276}, +{1377.94, 17.4131, 1.86093}, +{1400.23, 17.3932, 1.81053}, +{1422.88, 17.3728, 1.76153}, +{1445.89, 17.3518, 1.71377}, +{1469.28, 17.3298, 1.66758}, +{1493.04, 17.3071, 1.62309}, +{1517.19, 17.2841, 1.58151}, +{1541.73, 17.2620, 1.54126}, +{1566.67, 17.2402, 1.50205}, +{1592.01, 17.2184, 1.46378}, +{1617.76, 17.1965, 1.42649}, +{1643.92, 17.1745, 1.39017}, +{1670.51, 17.1524, 1.35477}, +{1697.53, 17.1301, 1.32027}, +{1724.99, 17.1078, 1.28665}, +{1752.89, 17.0853, 1.25347}, +{1781.24, 17.0622, 1.22101}, +{1810.05, 17.0386, 1.18927}, +{1839.32, 17.0145, 1.15836}, +{1869.07, 16.9898, 1.12826}, +{1899.30, 16.9646, 1.09895}, +{1930.02, 16.9389, 1.07039}, +{1961.24, 16.9126, 1.04257}, +{1992.96, 16.8855, 1.01548}, +{2025.20, 16.8579, 0.989487}, +{2057.95, 16.8299, 0.963460}, +{2091.24, 16.8006, 0.938054}, +{2125.06, 16.7703, 0.913249}, +{2159.43, 16.7389, 0.889031}, +{2194.36, 16.7062, 0.865379}, +{2229.85, 16.6721, 0.842275}, +{2265.92, 16.6364, 0.819728}, +{2302.57, 16.5990, 0.797721}, +{2339.81, 16.5597, 0.776210}, +{2377.66, 16.5182, 0.755213}, +{2416.11, 16.4743, 0.734715}, +{2455.19, 16.4275, 0.714694}, +{2494.90, 16.3775, 0.695152}, +{2535.26, 16.3237, 0.676050}, +{2576.26, 16.2657, 0.657392}, +{2617.93, 16.2025, 0.639191}, +{2660.27, 16.1334, 0.621397}, +{2703.30, 16.0570, 0.604026}, +{2747.03, 15.9718, 0.587067}, +{2791.46, 15.8756, 0.570498}, +{2836.61, 15.7656, 0.554313}, +{2882.49, 15.6374, 0.538497}, +{2929.11, 15.4846, 0.523033}, +{2976.48, 15.2971, 0.507955}, +{3024.63, 15.0567, 0.493219}, +{3073.55, 14.7273, 0.478818}, +{3123.26, 14.2181, 0.464732}, +{3173.78, 13.1521, 0.450984}, +{3205.80, 6.24201, 0.442589}, +{3206.00, 6.24309, 4.24427}, +{3225.11, 12.6536, 4.20735}, +{3277.27, 14.3229, 4.10923}, +{3330.28, 15.0526, 4.01218}, +{3384.15, 15.5322, 3.91705}, +{3438.88, 15.8911, 3.82343}, +{3494.50, 16.1776, 3.73159}, +{3551.02, 16.4157, 3.64110}, +{3608.46, 16.6183, 3.55206}, +{3666.82, 16.7938, 3.46483}, +{3726.13, 16.9480, 3.37927}, +{3786.40, 17.0849, 3.29525}, +{3847.64, 17.2072, 3.21288}, +{3909.87, 17.3173, 3.13212}, +{3973.11, 17.4169, 3.05299}, +{4037.38, 17.5072, 2.97543}, +{4102.68, 17.5894, 2.89946}, +{4169.03, 17.6644, 2.82509}, +{4236.46, 17.7330, 2.75230}, +{4304.98, 17.7959, 2.68108}, +{4374.62, 17.8535, 2.61138}, +{4445.37, 17.9064, 2.54318}, +{4517.27, 17.9550, 2.47653}, +{4590.33, 17.9997, 2.41134}, +{4664.58, 18.0407, 2.34763}, +{4740.03, 18.0784, 2.28537}, +{4816.69, 18.1131, 2.22455}, +{4894.60, 18.1449, 2.16515}, +{4973.77, 18.1741, 2.10711}, +{5054.21, 18.2008, 2.05046}, +{5135.96, 18.2253, 1.99516}, +{5219.03, 18.2476, 1.94116}, +{5303.44, 18.2681, 1.88845}, +{5389.22, 18.2866, 1.83704}, +{5476.39, 18.3035, 1.78690}, +{5564.97, 18.3189, 1.73800}, +{5654.98, 18.3327, 1.69026}, +{5746.44, 18.3451, 1.64375}, +{5839.39, 18.3563, 1.59839}, +{5933.83, 18.3663, 1.55414}, +{6029.81, 18.3751, 1.51105}, +{6127.33, 18.3829, 1.46904}, +{6226.44, 18.3897, 1.42808}, +{6327.15, 18.3955, 1.38820}, +{6429.48, 18.4005, 1.34935}, +{6533.48, 18.4047, 1.31151}, +{6639.15, 18.4082, 1.27461}, +{6746.54, 18.4110, 1.23868}, +{6855.65, 18.4130, 1.20370}, +{6966.54, 18.4145, 1.16969}, +{7079.22, 18.4155, 1.13651}, +{7193.72, 18.4158, 1.10426}, +{7310.07, 18.4158, 1.07281}, +{7428.31, 18.4152, 1.04224}, +{7548.45, 18.4142, 1.01248}, +{7670.54, 18.4128, 0.983540}, +{7794.61, 18.4110, 0.955338}, +{7920.68, 18.4089, 0.927890}, +{8048.79, 18.4065, 0.901226}, +{8178.98, 18.4037, 0.875280}, +{8311.26, 18.4007, 0.850058}, +{8445.69, 18.3975, 0.825508}, +{8582.29, 18.3941, 0.801583}, +{8721.11, 18.3904, 0.778350}, +{8862.16, 18.3865, 0.755755}, +{9005.50, 18.3825, 0.733792}, +{9151.16, 18.3783, 0.712424}, +{9299.17, 18.3739, 0.691653}, +{9449.58, 18.3695, 0.671457}, +{9602.42, 18.3649, 0.651829}, +{9757.73, 18.3602, 0.632741}, +{9915.55, 18.3554, 0.614198}, +{10075.9, 18.3505, 0.596163}, +{10238.9, 18.3456, 0.578635}, +{10404.5, 18.3406, 0.561599}, +{10572.8, 18.3355, 0.545041}, +{10743.8, 18.3304, 0.528950}, +{10917.6, 18.3253, 0.513313}, +{11094.2, 18.3201, 0.498118}, +{11273.6, 18.3149, 0.483353}, +{11455.9, 18.3097, 0.469007}, +{11641.2, 18.3045, 0.455068}, +{11829.5, 18.2993, 0.441525}, +{12020.8, 18.2941, 0.428368}, +{12215.3, 18.2889, 0.415586}, +{12412.8, 18.2837, 0.403169}, +{12613.6, 18.2786, 0.391107}, +{12817.6, 18.2734, 0.379390}, +{13025.0, 18.2683, 0.368008}, +{13235.6, 18.2632, 0.356953}, +{13449.7, 18.2581, 0.346216}, +{13667.2, 18.2531, 0.335787}, +{13888.3, 18.2481, 0.325658}, +{14112.9, 18.2432, 0.315820}, +{14341.2, 18.2382, 0.306267}, +{14573.1, 18.2334, 0.296989}, +{14808.9, 18.2286, 0.287979}, +{15048.4, 18.2238, 0.279229}, +{15291.8, 18.2191, 0.270732}, +{15539.1, 18.2144, 0.262482}, +{15790.4, 18.2098, 0.254470}, +{16045.8, 18.2053, 0.246691}, +{16305.4, 18.2007, 0.239137}, +{16569.1, 18.1963, 0.231803}, +{16837.1, 18.1919, 0.224681}, +{17109.4, 18.1876, 0.217767}, +{17386.1, 18.1833, 0.211054}, +{17667.4, 18.1791, 0.204536}, +{17953.1, 18.1749, 0.198208}, +{18243.5, 18.1708, 0.192065}, +{18538.6, 18.1668, 0.186100}, +{18838.4, 18.1628, 0.180310}, +{19143.1, 18.1589, 0.174688}, +{19452.7, 18.1550, 0.169231}, +{19767.4, 18.1512, 0.163932}, +{20087.1, 18.1474, 0.158795}, +{20412.0, 18.1437, 0.153805}, +{20742.1, 18.1401, 0.148966}, +{21077.6, 18.1365, 0.144273}, +{21418.5, 18.1330, 0.139723}, +{21765.0, 18.1295, 0.135309}, +{22117.0, 18.1261, 0.131031}, +{22474.7, 18.1227, 0.126882}, +{22838.2, 18.1194, 0.122859}, +{23207.6, 18.1162, 0.118959}, +{23583.0, 18.1130, 0.115178}, +{23964.4, 18.1099, 0.111513}, +{24352.0, 18.1068, 0.107960}, +{24745.9, 18.1038, 0.104516}, +{25146.2, 18.1008, 0.101178}, +{25552.9, 18.0979, 0.979421E-01}, +{25966.2, 18.0951, 0.948062E-01}, +{26386.1, 18.0923, 0.917669E-01}, +{26812.9, 18.0895, 0.888216E-01}, +{27246.6, 18.0868, 0.859672E-01}, +{27687.3, 18.0842, 0.832013E-01}, +{28135.1, 18.0816, 0.805211E-01}, +{28590.2, 18.0791, 0.779241E-01}, +{29052.6, 18.0766, 0.754079E-01}, +{29522.5, 18.0742, 0.729699E-01}, +{30000.0, 18.0718, 0.706080E-01}, +{0, 0, 0} +}; + +e_fp_fdp k[] = { /* Z = 19 */ +{10.0000, -9999.00, 0.342643E-01}, +{10.1617, -9999.00, 0.352921E-01}, +{10.3261, -9999.00, 0.363507E-01}, +{10.4931, -9999.00, 0.374410E-01}, +{10.6628, -9999.00, 0.385641E-01}, +{10.8353, -9999.00, 0.397209E-01}, +{11.0106, -9999.00, 0.409123E-01}, +{11.1886, -9999.00, 0.421395E-01}, +{11.3696, -9999.00, 0.434035E-01}, +{11.5535, -9999.00, 0.447054E-01}, +{11.7404, -9999.00, 0.458918E-01}, +{11.9303, -9999.00, 0.467761E-01}, +{12.1232, -9999.00, 0.476775E-01}, +{12.3193, -9999.00, 0.485962E-01}, +{12.5186, -9999.00, 0.495326E-01}, +{12.7210, -9999.00, 0.505034E-01}, +{12.9268, -9999.00, 0.515183E-01}, +{13.1359, -9999.00, 0.525536E-01}, +{13.3483, -9999.00, 0.536097E-01}, +{13.5642, -9999.00, 0.547076E-01}, +{13.7836, -9999.00, 0.558610E-01}, +{14.0066, -9999.00, 0.570387E-01}, +{14.2331, -9999.00, 0.582413E-01}, +{14.4633, -9999.00, 0.594692E-01}, +{14.6973, -9999.00, 0.608386E-01}, +{14.9350, -9999.00, 0.623585E-01}, +{15.1765, -9999.00, 0.639162E-01}, +{15.4220, -9999.00, 0.655129E-01}, +{15.6714, -9999.00, 0.667297E-01}, +{15.9249, -9999.00, 0.698655E-01}, +{16.1825, -9999.00, 0.778034E-01}, +{16.4442, -9999.00, 0.927407E-01}, +{16.7102, -9999.00, 0.101038}, +{16.9805, -9999.00, 0.100077}, +{17.2551, -9999.00, 0.991247E-01}, +{17.5342, -9999.00, 0.972030E-01}, +{17.8178, -9999.00, 0.101597}, +{18.1060, -9999.00, 0.125934}, +{18.3989, -9999.00, 0.169815}, +{18.6964, -9999.00, 0.232685}, +{18.9988, -9999.00, 0.316999}, +{19.3061, -9999.00, 0.445772}, +{19.6184, -9999.00, 0.695715}, +{19.9357, -9999.00, 1.36743}, +{20.2582, -9999.00, 4.67523}, +{20.5858, -9999.00, 5.53876}, +{20.9188, -9999.00, 6.01936}, +{21.2571, -9999.00, 6.54165}, +{21.6009, -9999.00, 7.10926}, +{21.9503, -9999.00, 7.72612}, +{22.3053, -9999.00, 8.21083}, +{22.6661, -9999.00, 8.65970}, +{23.0327, -9999.00, 9.13312}, +{23.4053, -9999.00, 9.63242}, +{23.7838, -9999.00, 10.1590}, +{24.1685, -9999.00, 10.7136}, +{24.5594, -9999.00, 11.2607}, +{24.9566, -9999.00, 11.8358}, +{25.3603, -9999.00, 12.4402}, +{25.7705, -9999.00, 13.0756}, +{26.1873, -9999.00, 13.6526}, +{26.6109, -9999.00, 13.9461}, +{27.0413, -9999.00, 14.2459}, +{27.4786, -9999.00, 14.5521}, +{27.9231, -9999.00, 14.8649}, +{28.3747, -9999.00, 15.1844}, +{28.8337, -9999.00, 15.4706}, +{29.3000, 2.17828, 15.5477}, +{29.7739, 2.89939, 15.6251}, +{30.2555, 3.60817, 15.7029}, +{30.7449, 4.33571, 15.7812}, +{31.2421, 5.11707, 15.8598}, +{31.7475, 6.03373, 15.8136}, +{32.2609, 6.83119, 15.6376}, +{32.7827, 7.59044, 15.4635}, +{33.3130, 8.35387, 15.2914}, +{33.8518, 9.18461, 15.1212}, +{34.3993, 10.1988, 14.9437}, +{34.9557, 11.1641, 14.2499}, +{35.5211, 11.9451, 13.5883}, +{36.0956, 12.6035, 12.7896}, +{36.6794, 13.1354, 12.0324}, +{37.2727, 13.6803, 11.2669}, +{37.8755, 14.0504, 10.2831}, +{38.4882, 14.2223, 9.38513}, +{39.1107, 14.2816, 8.58297}, +{39.7432, 14.2982, 7.85498}, +{40.3861, 14.3079, 7.15591}, +{41.0393, 14.2245, 6.45992}, +{41.7031, 14.0687, 5.83162}, +{42.3776, 13.8619, 5.30530}, +{43.0630, 13.6892, 4.85617}, +{43.7595, 13.5444, 4.44507}, +{44.4673, 13.4567, 4.02366}, +{45.1865, 13.3321, 3.58281}, +{45.9174, 13.2702, 3.08053}, +{46.6600, 12.9741, 2.51309}, +{47.4147, 12.6173, 2.14018}, +{48.1816, 12.2824, 1.81928}, +{48.9609, 11.9613, 1.54490}, +{49.7528, 11.6417, 1.28830}, +{50.5576, 11.3082, 1.07234}, +{51.3753, 10.9768, 0.896454}, +{52.2062, 10.6439, 0.757394}, +{53.0506, 10.3154, 0.680178}, +{53.9087, 10.0364, 0.632986}, +{54.7806, 9.78031, 0.595014}, +{55.6667, 9.52988, 0.567394}, +{56.5670, 9.30251, 0.563239}, +{57.4820, 9.08725, 0.559115}, +{58.4117, 8.88646, 0.580718}, +{59.3564, 8.70392, 0.603395}, +{60.3165, 8.53101, 0.632560}, +{61.2921, 8.36576, 0.665632}, +{62.2834, 8.21156, 0.717531}, +{63.2908, 8.07110, 0.775782}, +{64.3145, 7.95287, 0.845525}, +{65.3547, 7.85046, 0.900273}, +{66.4118, 7.75086, 0.956547}, +{67.4859, 7.65588, 1.01634}, +{68.5775, 7.56768, 1.08251}, +{69.6867, 7.49048, 1.15442}, +{70.8138, 7.42753, 1.22789}, +{71.9591, 7.37201, 1.30013}, +{73.1230, 7.32952, 1.37551}, +{74.3057, 7.29481, 1.44167}, +{75.5076, 7.26818, 1.51100}, +{76.7289, 7.25548, 1.57080}, +{77.9699, 7.23965, 1.62391}, +{79.2310, 7.22539, 1.67882}, +{80.5125, 7.21927, 1.73393}, +{81.8147, 7.21605, 1.78266}, +{83.1380, 7.21683, 1.83276}, +{84.4827, 7.22962, 1.87923}, +{85.8491, 7.23996, 1.91557}, +{87.2377, 7.24975, 1.95261}, +{88.6487, 7.26385, 1.99038}, +{90.0825, 7.28835, 2.02887}, +{91.5395, 7.32647, 2.04612}, +{93.0201, 7.34617, 2.04724}, +{94.5246, 7.35113, 2.05287}, +{96.0535, 7.35863, 2.06874}, +{97.6071, 7.36896, 2.08473}, +{99.1858, 7.38203, 2.10085}, +{100.790, 7.40104, 2.11708}, +{102.420, 7.42005, 2.11875}, +{104.077, 7.43219, 2.11934}, +{105.760, 7.44000, 2.12303}, +{107.471, 7.44795, 2.12778}, +{109.209, 7.45588, 2.13254}, +{110.975, 7.46350, 2.13731}, +{112.770, 7.47092, 2.14210}, +{114.594, 7.47826, 2.14689}, +{116.448, 7.48564, 2.15169}, +{118.331, 7.49328, 2.15651}, +{120.245, 7.50143, 2.16134}, +{122.190, 7.51077, 2.16617}, +{124.166, 7.52417, 2.17102}, +{126.175, 7.53841, 2.16638}, +{128.215, 7.54694, 2.15912}, +{130.289, 7.55225, 2.15189}, +{132.397, 7.55533, 2.14468}, +{134.538, 7.55656, 2.13750}, +{136.714, 7.55614, 2.13034}, +{138.925, 7.55417, 2.12321}, +{141.172, 7.55074, 2.11610}, +{143.456, 7.54589, 2.10901}, +{145.776, 7.53966, 2.10195}, +{148.134, 7.53209, 2.09491}, +{150.530, 7.52324, 2.08789}, +{152.964, 7.51323, 2.08090}, +{155.439, 7.50233, 2.07393}, +{157.953, 7.49164, 2.06698}, +{160.507, 7.48139, 2.05512}, +{163.103, 7.46576, 2.04042}, +{165.742, 7.44542, 2.02582}, +{168.422, 7.42167, 2.01133}, +{171.146, 7.39460, 1.99694}, +{173.915, 7.36422, 1.98265}, +{176.727, 7.33048, 1.96847}, +{179.586, 7.29328, 1.95439}, +{182.491, 7.25250, 1.94040}, +{185.442, 7.20801, 1.92652}, +{188.442, 7.15973, 1.91274}, +{191.489, 7.10773, 1.89906}, +{194.587, 7.05416, 1.88350}, +{197.734, 6.99268, 1.86442}, +{200.932, 6.92322, 1.84554}, +{204.182, 6.84662, 1.82685}, +{207.485, 6.76249, 1.80835}, +{210.840, 6.67029, 1.79004}, +{214.251, 6.56932, 1.77191}, +{217.716, 6.45876, 1.75396}, +{221.237, 6.33761, 1.73620}, +{224.816, 6.20474, 1.71862}, +{228.452, 6.05931, 1.70121}, +{232.147, 5.89900, 1.68210}, +{235.902, 5.71985, 1.66224}, +{239.717, 5.51965, 1.64263}, +{243.595, 5.29526, 1.62324}, +{247.535, 5.04239, 1.60408}, +{251.538, 4.75543, 1.58514}, +{255.607, 4.42684, 1.56643}, +{259.741, 4.04630, 1.54794}, +{263.942, 3.59913, 1.52967}, +{268.211, 3.06355, 1.51162}, +{272.549, 2.40521, 1.49378}, +{276.957, 1.56542, 1.47615}, +{281.437, 0.431087, 1.45872}, +{285.989, -1.26306, 1.44151}, +{290.615, -4.44727, 1.42449}, +{294.500, -20.3956, 1.41056}, +{294.700, -20.3757, 15.1908}, +{295.315, -11.6988, 15.1664}, +{300.092, -2.52151, 14.9798}, +{304.945, 0.431010, 14.7956}, +{309.878, 2.28661, 14.6136}, +{314.890, 3.65714, 14.4338}, +{319.983, 4.77056, 14.2533}, +{325.158, 5.67861, 14.0256}, +{330.418, 6.38330, 13.8016}, +{335.762, 6.97894, 13.6815}, +{341.192, 7.55127, 13.5912}, +{346.711, 8.09103, 13.5014}, +{352.319, 8.59859, 13.4122}, +{358.017, 9.07834, 13.3237}, +{363.808, 9.53481, 13.2357}, +{369.692, 9.97229, 13.1483}, +{375.672, 10.3950, 13.0614}, +{381.748, 10.8073, 12.9752}, +{387.922, 11.2153, 12.8895}, +{394.197, 11.6332, 12.8044}, +{400.573, 12.0738, 12.6680}, +{407.052, 12.4681, 12.4871}, +{413.635, 12.8177, 12.3088}, +{420.326, 13.1462, 12.1331}, +{427.124, 13.4581, 11.9598}, +{434.032, 13.7573, 11.7891}, +{441.052, 14.0477, 11.6208}, +{448.186, 14.3341, 11.4549}, +{455.435, 14.6450, 11.2717}, +{462.802, 14.9211, 11.0479}, +{470.287, 15.1597, 10.8286}, +{477.894, 15.3801, 10.6137}, +{485.623, 15.5850, 10.4030}, +{493.478, 15.7769, 10.1965}, +{501.459, 15.9574, 9.99408}, +{509.570, 16.1280, 9.79571}, +{517.812, 16.2904, 9.60126}, +{526.187, 16.4479, 9.41067}, +{534.698, 16.5981, 9.21457}, +{543.346, 16.7364, 9.01953}, +{552.134, 16.8636, 8.82863}, +{561.065, 16.9827, 8.64175}, +{570.139, 17.0945, 8.45884}, +{579.361, 17.1996, 8.27979}, +{588.732, 17.2986, 8.10455}, +{598.254, 17.3921, 7.93301}, +{607.930, 17.4804, 7.76509}, +{617.763, 17.5642, 7.60074}, +{627.755, 17.6437, 7.43986}, +{637.908, 17.7194, 7.28238}, +{648.226, 17.7918, 7.12825}, +{658.711, 17.8615, 6.97737}, +{669.365, 17.9291, 6.82968}, +{680.191, 17.9954, 6.68513}, +{691.193, 18.0704, 6.54362}, +{702.372, 18.1410, 6.38391}, +{713.733, 18.1966, 6.22354}, +{725.277, 18.2431, 6.06719}, +{737.008, 18.2830, 5.91477}, +{748.928, 18.3173, 5.76619}, +{761.042, 18.3467, 5.62133}, +{773.351, 18.3715, 5.48011}, +{785.859, 18.3921, 5.34244}, +{798.570, 18.4085, 5.20823}, +{811.486, 18.4208, 5.07739}, +{824.611, 18.4287, 4.94984}, +{837.949, 18.4316, 4.82549}, +{851.502, 18.4291, 4.70427}, +{865.274, 18.4042, 4.59328}, +{879.269, 18.3888, 4.51185}, +{893.491, 18.3893, 4.43187}, +{907.943, 18.3943, 4.35330}, +{922.628, 18.4029, 4.27613}, +{937.551, 18.4148, 4.20032}, +{952.715, 18.4300, 4.12586}, +{968.124, 18.4482, 4.05272}, +{983.783, 18.4883, 3.97264}, +{999.695, 18.5140, 3.87209}, +{1015.86, 18.5248, 3.77870}, +{1032.29, 18.5338, 3.68757}, +{1048.99, 18.5404, 3.59863}, +{1065.96, 18.5450, 3.51184}, +{1083.20, 18.5478, 3.42714}, +{1100.72, 18.5491, 3.34449}, +{1118.52, 18.5492, 3.26383}, +{1136.61, 18.5481, 3.18511}, +{1155.00, 18.5462, 3.10829}, +{1173.68, 18.5434, 3.03333}, +{1192.66, 18.5401, 2.96017}, +{1211.95, 18.5365, 2.88878}, +{1231.55, 18.5339, 2.81779}, +{1251.47, 18.5294, 2.74598}, +{1271.72, 18.5225, 2.67600}, +{1292.29, 18.5143, 2.60781}, +{1313.19, 18.5050, 2.54135}, +{1334.43, 18.4949, 2.47659}, +{1356.01, 18.4840, 2.41347}, +{1377.94, 18.4724, 2.35197}, +{1400.23, 18.4602, 2.29203}, +{1422.88, 18.4473, 2.23362}, +{1445.89, 18.4340, 2.17669}, +{1469.28, 18.4201, 2.12122}, +{1493.04, 18.4059, 2.06717}, +{1517.19, 18.3912, 2.01449}, +{1541.73, 18.3761, 1.96315}, +{1566.67, 18.3607, 1.91312}, +{1592.01, 18.3450, 1.86437}, +{1617.76, 18.3291, 1.81685}, +{1643.92, 18.3130, 1.77055}, +{1670.51, 18.2970, 1.72543}, +{1697.53, 18.2816, 1.68055}, +{1724.99, 18.2652, 1.63522}, +{1752.89, 18.2472, 1.59110}, +{1781.24, 18.2285, 1.54818}, +{1810.05, 18.2091, 1.50641}, +{1839.32, 18.1892, 1.46577}, +{1869.07, 18.1687, 1.42623}, +{1899.30, 18.1476, 1.38775}, +{1930.02, 18.1260, 1.35032}, +{1961.24, 18.1039, 1.31389}, +{1992.96, 18.0813, 1.27844}, +{2025.20, 18.0581, 1.24395}, +{2057.95, 18.0344, 1.21039}, +{2091.24, 18.0101, 1.17774}, +{2125.06, 17.9852, 1.14597}, +{2159.43, 17.9596, 1.11505}, +{2194.36, 17.9335, 1.08497}, +{2229.85, 17.9066, 1.05570}, +{2265.92, 17.8791, 1.02722}, +{2302.57, 17.8510, 0.999227}, +{2339.81, 17.8216, 0.971618}, +{2377.66, 17.7910, 0.944773}, +{2416.11, 17.7592, 0.918669}, +{2455.19, 17.7260, 0.893287}, +{2494.90, 17.6915, 0.868606}, +{2535.26, 17.6553, 0.844607}, +{2576.26, 17.6175, 0.821271}, +{2617.93, 17.5778, 0.798579}, +{2660.27, 17.5359, 0.776515}, +{2703.30, 17.4916, 0.755060}, +{2747.03, 17.4445, 0.734198}, +{2791.46, 17.3944, 0.713912}, +{2836.61, 17.3406, 0.694188}, +{2882.49, 17.2827, 0.675007}, +{2929.11, 17.2199, 0.656357}, +{2976.48, 17.1511, 0.638223}, +{3024.63, 17.0755, 0.621143}, +{3073.55, 16.9919, 0.604654}, +{3123.26, 16.8983, 0.588601}, +{3173.78, 16.7918, 0.572976}, +{3225.11, 16.6688, 0.557765}, +{3277.27, 16.5236, 0.542959}, +{3330.28, 16.3475, 0.528544}, +{3384.15, 16.1255, 0.514513}, +{3438.88, 15.8296, 0.500854}, +{3494.50, 15.3954, 0.487557}, +{3551.02, 14.6156, 0.474616}, +{3608.30, 6.76821, 0.462049}, +{3608.50, 6.76945, 4.40540}, +{3666.82, 14.8853, 4.28666}, +{3726.13, 15.8359, 4.17104}, +{3786.40, 16.4059, 4.05853}, +{3847.64, 16.8151, 3.94907}, +{3909.87, 17.1335, 3.84255}, +{3973.11, 17.3929, 3.73891}, +{4037.38, 17.6105, 3.63805}, +{4102.68, 17.7967, 3.53994}, +{4169.03, 17.9585, 3.44445}, +{4236.46, 18.1006, 3.35155}, +{4304.98, 18.2265, 3.26115}, +{4374.62, 18.3388, 3.17319}, +{4445.37, 18.4395, 3.08760}, +{4517.27, 18.5302, 3.00431}, +{4590.33, 18.6121, 2.92328}, +{4664.58, 18.6865, 2.84443}, +{4740.03, 18.7541, 2.76771}, +{4816.69, 18.8156, 2.69306}, +{4894.60, 18.8717, 2.62042}, +{4973.77, 18.9230, 2.54974}, +{5054.21, 18.9699, 2.48097}, +{5135.96, 19.0128, 2.41405}, +{5219.03, 19.0521, 2.34893}, +{5303.44, 19.0881, 2.28558}, +{5389.22, 19.1212, 2.22393}, +{5476.39, 19.1516, 2.16370}, +{5564.97, 19.1793, 2.10490}, +{5654.98, 19.2046, 2.04770}, +{5746.44, 19.2275, 1.99206}, +{5839.39, 19.2485, 1.93793}, +{5933.83, 19.2675, 1.88526}, +{6029.81, 19.2848, 1.83403}, +{6127.33, 19.3006, 1.78419}, +{6226.44, 19.3148, 1.73571}, +{6327.15, 19.3277, 1.68854}, +{6429.48, 19.3393, 1.64266}, +{6533.48, 19.3498, 1.59802}, +{6639.15, 19.3593, 1.55459}, +{6746.54, 19.3677, 1.51235}, +{6855.65, 19.3753, 1.47125}, +{6966.54, 19.3821, 1.43127}, +{7079.22, 19.3881, 1.39237}, +{7193.72, 19.3936, 1.35453}, +{7310.07, 19.3987, 1.31772}, +{7428.31, 19.4041, 1.28192}, +{7548.45, 19.4094, 1.24556}, +{7670.54, 19.4131, 1.20849}, +{7794.61, 19.4150, 1.17252}, +{7920.68, 19.4159, 1.13763}, +{8048.79, 19.4158, 1.10377}, +{8178.98, 19.4151, 1.07092}, +{8311.26, 19.4136, 1.03905}, +{8445.69, 19.4115, 1.00813}, +{8582.29, 19.4087, 0.978123}, +{8721.11, 19.4052, 0.949014}, +{8862.16, 19.4010, 0.921145}, +{9005.50, 19.3966, 0.894684}, +{9151.16, 19.3921, 0.868973}, +{9299.17, 19.3872, 0.843999}, +{9449.58, 19.3818, 0.819666}, +{9602.42, 19.3746, 0.796023}, +{9757.73, 19.3633, 0.773049}, +{9915.55, 19.3598, 0.768755}, +{10075.9, 19.3678, 0.746466}, +{10238.9, 19.3646, 0.724791}, +{10404.5, 19.3619, 0.703714}, +{10572.8, 19.3588, 0.683220}, +{10743.8, 19.3553, 0.663294}, +{10917.6, 19.3515, 0.643921}, +{11094.2, 19.3475, 0.625088}, +{11273.6, 19.3432, 0.606779}, +{11455.9, 19.3389, 0.588981}, +{11641.2, 19.3344, 0.571681}, +{11829.5, 19.3298, 0.554865}, +{12020.8, 19.3251, 0.538520}, +{12215.3, 19.3203, 0.522634}, +{12412.8, 19.3154, 0.507196}, +{12613.6, 19.3106, 0.492191}, +{12817.6, 19.3056, 0.477610}, +{13025.0, 19.3007, 0.463440}, +{13235.6, 19.2957, 0.449671}, +{13449.7, 19.2907, 0.436292}, +{13667.2, 19.2857, 0.423291}, +{13888.3, 19.2807, 0.410659}, +{14112.9, 19.2756, 0.398386}, +{14341.2, 19.2706, 0.386461}, +{14573.1, 19.2657, 0.374876}, +{14808.9, 19.2607, 0.363621}, +{15048.4, 19.2557, 0.352686}, +{15291.8, 19.2508, 0.342063}, +{15539.1, 19.2459, 0.331743}, +{15790.4, 19.2411, 0.321718}, +{16045.8, 19.2362, 0.311980}, +{16305.4, 19.2314, 0.302520}, +{16569.1, 19.2267, 0.293331}, +{16837.1, 19.2220, 0.284406}, +{17109.4, 19.2173, 0.275736}, +{17386.1, 19.2127, 0.267315}, +{17667.4, 19.2081, 0.259135}, +{17953.1, 19.2036, 0.251191}, +{18243.5, 19.1991, 0.243474}, +{18538.6, 19.1947, 0.235980}, +{18838.4, 19.1903, 0.228701}, +{19143.1, 19.1860, 0.221631}, +{19452.7, 19.1817, 0.214765}, +{19767.4, 19.1775, 0.208096}, +{20087.1, 19.1733, 0.201622}, +{20412.0, 19.1692, 0.195337}, +{20742.1, 19.1652, 0.189239}, +{21077.6, 19.1611, 0.183324}, +{21418.5, 19.1572, 0.177585}, +{21765.0, 19.1533, 0.172019}, +{22117.0, 19.1494, 0.166620}, +{22474.7, 19.1457, 0.161384}, +{22838.2, 19.1419, 0.156305}, +{23207.6, 19.1382, 0.151379}, +{23583.0, 19.1346, 0.146603}, +{23964.4, 19.1311, 0.141971}, +{24352.0, 19.1276, 0.137480}, +{24745.9, 19.1241, 0.133125}, +{25146.2, 19.1208, 0.128903}, +{25552.9, 19.1174, 0.124809}, +{25966.2, 19.1142, 0.120840}, +{26386.1, 19.1109, 0.116993}, +{26812.9, 19.1078, 0.113263}, +{27246.6, 19.1047, 0.109648}, +{27687.3, 19.1017, 0.106144}, +{28135.1, 19.0987, 0.102747}, +{28590.2, 19.0957, 0.994554E-01}, +{29052.6, 19.0929, 0.962650E-01}, +{29522.5, 19.0900, 0.931731E-01}, +{30000.0, 19.0873, 0.901768E-01}, +{0, 0, 0} +}; + +e_fp_fdp ca[] = { /* Z = 20 */ +{10.0000, -9999.00, 0.428047E-01}, +{10.1617, -9999.00, 0.452690E-01}, +{10.3261, -9999.00, 0.478750E-01}, +{10.4931, -9999.00, 0.506311E-01}, +{10.6628, -9999.00, 0.535459E-01}, +{10.8353, -9999.00, 0.566284E-01}, +{11.0106, -9999.00, 0.598885E-01}, +{11.1886, -9999.00, 0.633362E-01}, +{11.3696, -9999.00, 0.663412E-01}, +{11.5535, -9999.00, 0.692222E-01}, +{11.7404, -9999.00, 0.722284E-01}, +{11.9303, -9999.00, 0.753652E-01}, +{12.1232, -9999.00, 0.786381E-01}, +{12.3193, -9999.00, 0.812905E-01}, +{12.5186, -9999.00, 0.837847E-01}, +{12.7210, -9999.00, 0.863555E-01}, +{12.9268, -9999.00, 0.890052E-01}, +{13.1359, -9999.00, 0.915234E-01}, +{13.3483, -9999.00, 0.937972E-01}, +{13.5642, -9999.00, 0.961275E-01}, +{13.7836, -9999.00, 0.985158E-01}, +{14.0066, -9999.00, 0.100963}, +{14.2331, -9999.00, 0.103551}, +{14.4633, -9999.00, 0.106682}, +{14.6973, -9999.00, 0.109908}, +{14.9350, -9999.00, 0.113231}, +{15.1765, -9999.00, 0.116655}, +{15.4220, -9999.00, 0.120178}, +{15.6714, -9999.00, 0.123377}, +{15.9249, -9999.00, 0.126661}, +{16.1825, -9999.00, 0.130033}, +{16.4442, -9999.00, 0.133493}, +{16.7102, -9999.00, 0.137047}, +{16.9805, -9999.00, 0.140739}, +{17.2551, -9999.00, 0.144546}, +{17.5342, -9999.00, 0.148456}, +{17.8178, -9999.00, 0.152472}, +{18.1060, -9999.00, 0.156196}, +{18.3989, -9999.00, 0.159707}, +{18.6964, -9999.00, 0.163297}, +{18.9988, -9999.00, 0.166967}, +{19.3061, -9999.00, 0.170969}, +{19.6184, -9999.00, 0.176222}, +{19.9357, -9999.00, 0.181636}, +{20.2582, -9999.00, 0.187217}, +{20.5858, -9999.00, 0.192970}, +{20.9188, -9999.00, 0.198638}, +{21.2571, -9999.00, 0.204419}, +{21.6009, -9999.00, 0.210369}, +{21.9503, -9999.00, 0.216493}, +{22.3053, -9999.00, 0.222794}, +{22.6661, -9999.00, 0.229765}, +{23.0327, -9999.00, 0.236992}, +{23.4053, -9999.00, 0.244446}, +{23.7838, -9999.00, 0.252134}, +{24.1685, -9999.00, 0.260064}, +{24.5594, -9999.00, 0.270130}, +{24.9566, -9999.00, 0.281711}, +{25.3603, -9999.00, 0.293788}, +{25.7705, -9999.00, 0.306383}, +{26.1873, -9999.00, 0.319519}, +{26.6109, -9999.00, 0.331878}, +{27.0413, -9999.00, 0.344558}, +{27.4786, -9999.00, 0.370025}, +{27.9231, -9999.00, 0.413990}, +{28.3747, -9999.00, 0.482245}, +{28.8337, -9999.00, 0.576340}, +{29.3000, -9.81985, 0.795476}, +{29.7739, -13.0943, 1.15137}, +{30.2555, -19.4672, 9.48002}, +{30.7449, -16.1536, 13.6832}, +{31.2421, -13.2939, 15.8974}, +{31.7475, -10.9389, 17.4478}, +{32.2609, -9.11316, 18.8180}, +{32.7827, -7.05417, 20.1634}, +{33.3130, -5.09631, 20.7429}, +{33.8518, -3.39714, 21.3391}, +{34.3993, -1.71411, 21.9524}, +{34.9557, 0.166864, 22.3549}, +{35.5211, 1.86790, 22.5540}, +{36.0956, 3.60786, 22.7549}, +{36.6794, 5.61642, 22.7044}, +{37.2727, 7.39788, 22.3977}, +{37.8755, 9.20752, 21.9303}, +{38.4882, 10.9363, 21.3439}, +{39.1107, 12.9679, 20.7272}, +{39.7432, 14.6370, 18.8602}, +{40.3861, 15.5985, 17.1613}, +{41.0393, 16.2190, 15.6155}, +{41.7031, 16.6240, 14.2089}, +{42.3776, 16.8847, 12.9290}, +{43.0630, 17.0628, 11.7644}, +{43.7595, 17.1584, 10.5988}, +{44.4673, 17.1064, 9.52074}, +{45.1865, 16.9704, 8.55240}, +{45.9174, 16.7803, 7.68253}, +{46.6600, 16.5539, 6.90115}, +{47.4147, 16.3046, 6.19922}, +{48.1816, 16.0429, 5.56870}, +{48.9609, 15.7789, 5.00232}, +{49.7528, 15.5360, 4.49352}, +{50.5576, 15.3720, 3.95561}, +{51.3753, 15.0786, 3.38987}, +{52.2062, 14.7242, 2.90505}, +{53.0506, 14.3556, 2.48957}, +{53.9087, 13.9877, 2.13310}, +{54.7806, 13.6194, 1.81772}, +{55.6667, 13.2532, 1.54896}, +{56.5670, 12.8928, 1.31994}, +{57.4820, 12.5365, 1.12478}, +{58.4117, 12.1858, 0.979792}, +{59.3564, 11.8664, 0.864375}, +{60.3165, 11.5595, 0.762549}, +{61.2921, 11.2440, 0.688384}, +{62.2834, 10.9612, 0.651390}, +{63.2908, 10.6900, 0.625921}, +{64.3145, 10.4391, 0.622006}, +{65.3547, 10.2103, 0.632067}, +{66.4118, 9.98744, 0.646203}, +{67.4859, 9.78272, 0.689684}, +{68.5775, 9.59673, 0.736089}, +{69.6867, 9.42721, 0.797350}, +{70.8138, 9.27910, 0.865022}, +{71.9591, 9.15684, 0.935019}, +{73.1230, 9.04395, 0.992043}, +{74.3057, 8.93687, 1.05255}, +{75.5076, 8.84042, 1.11674}, +{76.7289, 8.76073, 1.17782}, +{77.9699, 8.68187, 1.23344}, +{79.2310, 8.60637, 1.29168}, +{80.5125, 8.53698, 1.35268}, +{81.8147, 8.47454, 1.41655}, +{83.1380, 8.42135, 1.48345}, +{84.4827, 8.38243, 1.54587}, +{85.8491, 8.34265, 1.60273}, +{87.2377, 8.30463, 1.66167}, +{88.6487, 8.27133, 1.72278}, +{90.0825, 8.24374, 1.78614}, +{91.5395, 8.22330, 1.85183}, +{93.0201, 8.21278, 1.91994}, +{94.5246, 8.22206, 1.98514}, +{96.0535, 8.22931, 2.02511}, +{97.6071, 8.23148, 2.06588}, +{99.1858, 8.23251, 2.10748}, +{100.790, 8.23508, 2.14991}, +{102.420, 8.24044, 2.19320}, +{104.077, 8.25097, 2.23736}, +{105.760, 8.26937, 2.27478}, +{107.471, 8.28438, 2.30697}, +{109.209, 8.29816, 2.33960}, +{110.975, 8.31345, 2.37270}, +{112.770, 8.33124, 2.40627}, +{114.594, 8.35359, 2.44032}, +{116.448, 8.38916, 2.47286}, +{118.331, 8.42091, 2.48265}, +{120.245, 8.44360, 2.49246}, +{122.190, 8.46205, 2.50232}, +{124.166, 8.47682, 2.51222}, +{126.175, 8.48499, 2.52570}, +{128.215, 8.49735, 2.54638}, +{130.289, 8.51262, 2.56723}, +{132.397, 8.52985, 2.58825}, +{134.538, 8.54891, 2.60945}, +{136.714, 8.56995, 2.63081}, +{138.925, 8.59340, 2.65235}, +{141.172, 8.61994, 2.67407}, +{143.456, 8.65160, 2.69597}, +{145.776, 8.69855, 2.70908}, +{148.134, 8.73543, 2.70734}, +{150.530, 8.76472, 2.70561}, +{152.964, 8.79176, 2.70387}, +{155.439, 8.81743, 2.70214}, +{157.953, 8.84250, 2.70041}, +{160.507, 8.86779, 2.69868}, +{163.103, 8.89443, 2.69695}, +{165.742, 8.92490, 2.69523}, +{168.422, 8.96945, 2.68714}, +{171.146, 9.00182, 2.65286}, +{173.915, 9.02207, 2.61901}, +{176.727, 9.03418, 2.58560}, +{179.586, 9.04043, 2.55261}, +{182.491, 9.04135, 2.52004}, +{185.442, 9.03703, 2.48860}, +{188.442, 9.02924, 2.45854}, +{191.489, 9.01779, 2.42885}, +{194.587, 9.00247, 2.39951}, +{197.734, 8.98314, 2.37052}, +{200.932, 8.95956, 2.34189}, +{204.182, 8.93127, 2.31360}, +{207.485, 8.89581, 2.28566}, +{210.840, 8.85518, 2.26502}, +{214.251, 8.81520, 2.24761}, +{217.716, 8.77382, 2.23033}, +{221.237, 8.72999, 2.21318}, +{224.816, 8.68336, 2.19616}, +{228.452, 8.63404, 2.17928}, +{232.147, 8.58410, 2.16253}, +{235.902, 8.52827, 2.13639}, +{239.717, 8.46348, 2.11017}, +{243.595, 8.39038, 2.08427}, +{247.535, 8.30987, 2.05869}, +{251.538, 8.22485, 2.03343}, +{255.607, 8.13039, 1.99907}, +{259.741, 8.01918, 1.96241}, +{263.942, 7.89229, 1.92642}, +{268.211, 7.74878, 1.89110}, +{272.549, 7.58446, 1.85642}, +{276.957, 7.40314, 1.83340}, +{281.437, 7.20557, 1.81133}, +{285.989, 6.98745, 1.78953}, +{290.615, 6.74326, 1.76799}, +{295.315, 6.46735, 1.74670}, +{300.092, 6.15239, 1.72565}, +{304.945, 5.78847, 1.70485}, +{309.878, 5.36165, 1.68430}, +{314.890, 4.85004, 1.66427}, +{319.983, 4.22442, 1.64761}, +{325.158, 3.43116, 1.63111}, +{330.418, 2.36577, 1.61477}, +{335.762, 0.788583, 1.59860}, +{341.192, -2.11054, 1.58259}, +{346.100, -18.3346, 1.56848}, +{346.300, -18.3167, 14.7778}, +{346.711, -11.4294, 14.7630}, +{352.319, -0.749394, 14.5644}, +{358.017, 2.18437, 14.3685}, +{363.808, 3.99194, 14.1752}, +{369.692, 5.30882, 13.9845}, +{375.672, 6.34355, 13.7963}, +{381.748, 7.18918, 13.6107}, +{387.922, 7.88686, 13.4310}, +{394.197, 8.45186, 13.2614}, +{400.573, 8.93036, 13.2006}, +{407.052, 9.41020, 13.1824}, +{413.635, 9.89672, 13.1643}, +{420.326, 10.3730, 13.1463}, +{427.124, 10.8436, 13.1283}, +{434.032, 11.3148, 13.1103}, +{441.052, 11.7985, 13.0921}, +{448.186, 12.3388, 13.0547}, +{455.435, 12.8690, 12.9209}, +{462.802, 13.3660, 12.7214}, +{470.287, 13.7886, 12.4894}, +{477.894, 14.1630, 12.2616}, +{485.623, 14.5041, 12.0382}, +{493.478, 14.8192, 11.8189}, +{501.459, 15.1124, 11.6034}, +{509.570, 15.3869, 11.3918}, +{517.812, 15.6464, 11.1837}, +{526.187, 15.8915, 10.9780}, +{534.698, 16.1236, 10.7734}, +{543.346, 16.3426, 10.5715}, +{552.134, 16.5539, 10.3733}, +{561.065, 16.7552, 10.1692}, +{570.139, 16.9376, 9.96500}, +{579.361, 17.1080, 9.76824}, +{588.732, 17.2695, 9.57651}, +{598.254, 17.4232, 9.38927}, +{607.930, 17.5705, 9.20588}, +{617.763, 17.7120, 9.02611}, +{627.755, 17.8530, 8.84923}, +{637.908, 17.9895, 8.66800}, +{648.226, 18.1185, 8.47907}, +{658.711, 18.2318, 8.28687}, +{669.365, 18.3214, 8.09890}, +{680.191, 18.3985, 7.93432}, +{691.193, 18.4838, 7.78757}, +{702.372, 18.5811, 7.64623}, +{713.733, 18.6864, 7.48881}, +{725.277, 18.7798, 7.32197}, +{737.008, 18.8601, 7.15885}, +{748.928, 18.9342, 6.99956}, +{761.042, 19.0043, 6.84384}, +{773.351, 19.0708, 6.69039}, +{785.859, 19.1339, 6.53689}, +{798.570, 19.1905, 6.38407}, +{811.486, 19.2408, 6.23484}, +{824.611, 19.2865, 6.08911}, +{837.949, 19.3280, 5.94678}, +{851.502, 19.3658, 5.80823}, +{865.274, 19.4004, 5.67337}, +{879.269, 19.4324, 5.54207}, +{893.491, 19.4622, 5.41383}, +{907.943, 19.4897, 5.28854}, +{922.628, 19.5152, 5.16613}, +{937.551, 19.5387, 5.04619}, +{952.715, 19.5602, 4.92895}, +{968.124, 19.5800, 4.81435}, +{983.783, 19.5985, 4.70236}, +{999.695, 19.6156, 4.59264}, +{1015.86, 19.6331, 4.48513}, +{1032.29, 19.6485, 4.37666}, +{1048.99, 19.6611, 4.26994}, +{1065.96, 19.6710, 4.16493}, +{1083.20, 19.6784, 4.06252}, +{1100.72, 19.6839, 3.96262}, +{1118.52, 19.6878, 3.86515}, +{1136.61, 19.6902, 3.77011}, +{1155.00, 19.6912, 3.67743}, +{1173.68, 19.6911, 3.58707}, +{1192.66, 19.6899, 3.49887}, +{1211.95, 19.6876, 3.41282}, +{1231.55, 19.6844, 3.32887}, +{1251.47, 19.6802, 3.24704}, +{1271.72, 19.6753, 3.16725}, +{1292.29, 19.6697, 3.08942}, +{1313.19, 19.6635, 3.01351}, +{1334.43, 19.6567, 2.93946}, +{1356.01, 19.6495, 2.86723}, +{1377.94, 19.6418, 2.79677}, +{1400.23, 19.6338, 2.72802}, +{1422.88, 19.6256, 2.66095}, +{1445.89, 19.6176, 2.59555}, +{1469.28, 19.6099, 2.53114}, +{1493.04, 19.6036, 2.46739}, +{1517.19, 19.5959, 2.40126}, +{1541.73, 19.5853, 2.33638}, +{1566.67, 19.5732, 2.27327}, +{1592.01, 19.5599, 2.21180}, +{1617.76, 19.5457, 2.15203}, +{1643.92, 19.5307, 2.09397}, +{1670.51, 19.5152, 2.03740}, +{1697.53, 19.4991, 1.98233}, +{1724.99, 19.4825, 1.92870}, +{1752.89, 19.4654, 1.87622}, +{1781.24, 19.4477, 1.82508}, +{1810.05, 19.4294, 1.77527}, +{1839.32, 19.4106, 1.72680}, +{1869.07, 19.3913, 1.67964}, +{1899.30, 19.3716, 1.63377}, +{1930.02, 19.3514, 1.58915}, +{1961.24, 19.3309, 1.54576}, +{1992.96, 19.3098, 1.50354}, +{2025.20, 19.2885, 1.46286}, +{2057.95, 19.2670, 1.42285}, +{2091.24, 19.2450, 1.38393}, +{2125.06, 19.2226, 1.34608}, +{2159.43, 19.1997, 1.30926}, +{2194.36, 19.1764, 1.27345}, +{2229.85, 19.1527, 1.23863}, +{2265.92, 19.1285, 1.20478}, +{2302.57, 19.1038, 1.17188}, +{2339.81, 19.0786, 1.13988}, +{2377.66, 19.0529, 1.10878}, +{2416.11, 19.0266, 1.07855}, +{2455.19, 18.9997, 1.04917}, +{2494.90, 18.9721, 1.02060}, +{2535.26, 18.9438, 0.992854}, +{2576.26, 18.9148, 0.965882}, +{2617.93, 18.8849, 0.939678}, +{2660.27, 18.8540, 0.914199}, +{2703.30, 18.8222, 0.889467}, +{2747.03, 18.7892, 0.865431}, +{2791.46, 18.7550, 0.842065}, +{2836.61, 18.7194, 0.819391}, +{2882.49, 18.6823, 0.797340}, +{2929.11, 18.6435, 0.775935}, +{2976.48, 18.6026, 0.755129}, +{3024.63, 18.5596, 0.734931}, +{3073.55, 18.5141, 0.715317}, +{3123.26, 18.4657, 0.696280}, +{3173.78, 18.4140, 0.677776}, +{3225.11, 18.3585, 0.659801}, +{3277.27, 18.2984, 0.642368}, +{3330.28, 18.2330, 0.625422}, +{3384.15, 18.1612, 0.608977}, +{3438.88, 18.0817, 0.593003}, +{3494.50, 17.9925, 0.577487}, +{3551.02, 17.8914, 0.562452}, +{3608.46, 17.7746, 0.547825}, +{3666.82, 17.6369, 0.533643}, +{3726.13, 17.4703, 0.519879}, +{3786.40, 17.2609, 0.506491}, +{3847.64, 16.9825, 0.493516}, +{3909.87, 16.5760, 0.480935}, +{3973.11, 15.8521, 0.468705}, +{4037.38, 11.1907, 0.456802}, +{4038.40, 8.35517, 0.456616}, +{4038.60, 8.35607, 4.14301}, +{4102.68, 16.0437, 4.04411}, +{4169.03, 16.9411, 3.94571}, +{4236.46, 17.4778, 3.84925}, +{4304.98, 17.8639, 3.75455}, +{4374.62, 18.1653, 3.66168}, +{4445.37, 18.4118, 3.57061}, +{4517.27, 18.6196, 3.48133}, +{4590.33, 18.7983, 3.39388}, +{4664.58, 18.9543, 3.30818}, +{4740.03, 19.0920, 3.22426}, +{4816.69, 19.2145, 3.14211}, +{4894.60, 19.3243, 3.06169}, +{4973.77, 19.4233, 2.98298}, +{5054.21, 19.5127, 2.90601}, +{5135.96, 19.5940, 2.83071}, +{5219.03, 19.6680, 2.75710}, +{5303.44, 19.7354, 2.68509}, +{5389.22, 19.7971, 2.61472}, +{5476.39, 19.8535, 2.54597}, +{5564.97, 19.9052, 2.47878}, +{5654.98, 19.9526, 2.41316}, +{5746.44, 19.9961, 2.34907}, +{5839.39, 20.0360, 2.28651}, +{5933.83, 20.0726, 2.22539}, +{6029.81, 20.1061, 2.16573}, +{6127.33, 20.1369, 2.10752}, +{6226.44, 20.1651, 2.05070}, +{6327.15, 20.1908, 1.99527}, +{6429.48, 20.2144, 1.94124}, +{6533.48, 20.2360, 1.88847}, +{6639.15, 20.2556, 1.83703}, +{6746.54, 20.2734, 1.78686}, +{6855.65, 20.2896, 1.73794}, +{6966.54, 20.3042, 1.69029}, +{7079.22, 20.3174, 1.64379}, +{7193.72, 20.3293, 1.59850}, +{7310.07, 20.3399, 1.55433}, +{7428.31, 20.3494, 1.51134}, +{7548.45, 20.3578, 1.46942}, +{7670.54, 20.3651, 1.42857}, +{7794.61, 20.3715, 1.38881}, +{7920.68, 20.3771, 1.35008}, +{8048.79, 20.3818, 1.31232}, +{8178.98, 20.3857, 1.27556}, +{8311.26, 20.3889, 1.23981}, +{8445.69, 20.3915, 1.20498}, +{8582.29, 20.3935, 1.17103}, +{8721.11, 20.3948, 1.13797}, +{8862.16, 20.3956, 1.10581}, +{9005.50, 20.3959, 1.07458}, +{9151.16, 20.3957, 1.04409}, +{9299.17, 20.3951, 1.01443}, +{9449.58, 20.3941, 0.985622}, +{9602.42, 20.3927, 0.957533}, +{9757.73, 20.3909, 0.930181}, +{9915.55, 20.3888, 0.903640}, +{10075.9, 20.3865, 0.877781}, +{10238.9, 20.3839, 0.852624}, +{10404.5, 20.3810, 0.828151}, +{10572.8, 20.3778, 0.804344}, +{10743.8, 20.3745, 0.781188}, +{10917.6, 20.3709, 0.758665}, +{11094.2, 20.3672, 0.736760}, +{11273.6, 20.3633, 0.715455}, +{11455.9, 20.3592, 0.694737}, +{11641.2, 20.3551, 0.674589}, +{11829.5, 20.3507, 0.654996}, +{12020.8, 20.3463, 0.635945}, +{12215.3, 20.3418, 0.617421}, +{12412.8, 20.3372, 0.599410}, +{12613.6, 20.3325, 0.581898}, +{12817.6, 20.3278, 0.564874}, +{13025.0, 20.3230, 0.548322}, +{13235.6, 20.3181, 0.532231}, +{13449.7, 20.3132, 0.516589}, +{13667.2, 20.3083, 0.501383}, +{13888.3, 20.3034, 0.486602}, +{14112.9, 20.2984, 0.472235}, +{14341.2, 20.2934, 0.458269}, +{14573.1, 20.2884, 0.444694}, +{14808.9, 20.2834, 0.431501}, +{15048.4, 20.2784, 0.418677}, +{15291.8, 20.2734, 0.406214}, +{15539.1, 20.2684, 0.394101}, +{15790.4, 20.2635, 0.382329}, +{16045.8, 20.2585, 0.370888}, +{16305.4, 20.2536, 0.359769}, +{16569.1, 20.2487, 0.348963}, +{16837.1, 20.2438, 0.338462}, +{17109.4, 20.2390, 0.328258}, +{17386.1, 20.2342, 0.318341}, +{17667.4, 20.2294, 0.308705}, +{17953.1, 20.2247, 0.299340}, +{18243.5, 20.2200, 0.290240}, +{18538.6, 20.2153, 0.281398}, +{18838.4, 20.2107, 0.272806}, +{19143.1, 20.2061, 0.264456}, +{19452.7, 20.2016, 0.256343}, +{19767.4, 20.1971, 0.248460}, +{20087.1, 20.1926, 0.240866}, +{20412.0, 20.1883, 0.233426}, +{20742.1, 20.1840, 0.226205}, +{21077.6, 20.1797, 0.219196}, +{21418.5, 20.1754, 0.212394}, +{21765.0, 20.1712, 0.205792}, +{22117.0, 20.1671, 0.199386}, +{22474.7, 20.1630, 0.193171}, +{22838.2, 20.1590, 0.187139}, +{23207.6, 20.1550, 0.181288}, +{23583.0, 20.1511, 0.175611}, +{23964.4, 20.1472, 0.170104}, +{24352.0, 20.1434, 0.164761}, +{24745.9, 20.1397, 0.159580}, +{25146.2, 20.1360, 0.154553}, +{25552.9, 20.1324, 0.149679}, +{25966.2, 20.1288, 0.144951}, +{26386.1, 20.1253, 0.140366}, +{26812.9, 20.1218, 0.135920}, +{27246.6, 20.1184, 0.131609}, +{27687.3, 20.1150, 0.127429}, +{28135.1, 20.1118, 0.123376}, +{28590.2, 20.1085, 0.119447}, +{29052.6, 20.1054, 0.115638}, +{29522.5, 20.1026, 0.111945}, +{30000.0, 20.0981, 0.108365}, +{0, 0, 0} +}; + +e_fp_fdp sc[] = { /* Z = 21 */ +{10.0000, -9999.00, 0.718390}, +{10.1617, -9999.00, 0.721028}, +{10.3261, -9999.00, 0.723674}, +{10.4931, -9999.00, 0.726332}, +{10.6628, -9999.00, 0.728998}, +{10.8353, -9999.00, 0.731674}, +{11.0106, -9999.00, 0.734361}, +{11.1886, -9999.00, 0.737057}, +{11.3696, -9999.00, 0.739762}, +{11.5535, -9999.00, 0.742479}, +{11.7404, -9999.00, 0.745204}, +{11.9303, -9999.00, 0.747941}, +{12.1232, -9999.00, 0.750686}, +{12.3193, -9999.00, 0.753442}, +{12.5186, -9999.00, 0.757071}, +{12.7210, -9999.00, 0.764374}, +{12.9268, -9999.00, 0.771748}, +{13.1359, -9999.00, 0.779191}, +{13.3483, -9999.00, 0.786707}, +{13.5642, -9999.00, 0.794296}, +{13.7836, -9999.00, 0.801957}, +{14.0066, -9999.00, 0.808912}, +{14.2331, -9999.00, 0.814411}, +{14.4633, -9999.00, 0.819947}, +{14.6973, -9999.00, 0.825521}, +{14.9350, -9999.00, 0.831133}, +{15.1765, -9999.00, 0.836783}, +{15.4220, -9999.00, 0.838413}, +{15.6714, -9999.00, 0.837940}, +{15.9249, -9999.00, 0.837469}, +{16.1825, -9999.00, 0.836997}, +{16.4442, -9999.00, 0.836526}, +{16.7102, -9999.00, 0.835620}, +{16.9805, -9999.00, 0.834687}, +{17.2551, -9999.00, 0.833756}, +{17.5342, -9999.00, 0.832825}, +{17.8178, -9999.00, 0.832470}, +{18.1060, -9999.00, 0.833061}, +{18.3989, -9999.00, 0.833651}, +{18.6964, -9999.00, 0.834242}, +{18.9988, -9999.00, 0.834834}, +{19.3061, -9999.00, 0.832440}, +{19.6184, -9999.00, 0.829454}, +{19.9357, -9999.00, 0.826479}, +{20.2582, -9999.00, 0.823514}, +{20.5858, -9999.00, 0.819048}, +{20.9188, -9999.00, 0.814321}, +{21.2571, -9999.00, 0.809622}, +{21.6009, -9999.00, 0.803856}, +{21.9503, -9999.00, 0.795100}, +{22.3053, -9999.00, 0.786439}, +{22.6661, -9999.00, 0.777873}, +{23.0327, -9999.00, 0.769399}, +{23.4053, -9999.00, 0.761018}, +{23.7838, -9999.00, 0.757563}, +{24.1685, -9999.00, 0.755529}, +{24.5594, -9999.00, 0.753501}, +{24.9566, -9999.00, 0.751478}, +{25.3603, -9999.00, 0.744207}, +{25.7705, -9999.00, 0.733462}, +{26.1873, -9999.00, 0.722873}, +{26.6109, -9999.00, 0.712436}, +{27.0413, -9999.00, 0.702150}, +{27.4786, -9999.00, 0.692012}, +{27.9231, -9999.00, 0.682021}, +{28.3747, -9999.00, 0.670874}, +{28.8337, -9999.00, 0.659558}, +{29.3000, -1.03670, 0.648433}, +{29.7739, -1.41804, 0.639876}, +{30.2555, -1.85352, 0.635538}, +{30.7449, -2.36056, 0.632347}, +{31.2421, -2.95389, 0.640375}, +{31.7475, -3.66154, 0.648505}, +{32.2609, -4.53664, 0.664896}, +{32.7827, -5.64255, 0.693025}, +{33.3130, -7.12157, 0.753797}, +{33.8518, -9.33431, 0.858911}, +{34.3993, -13.4259, 1.12517}, +{34.9557, -20.3771, 2.27399}, +{35.5211, -13.1226, 16.7055}, +{36.0956, -9.32270, 18.4001}, +{36.6794, -6.68263, 19.2468}, +{37.2727, -4.56713, 19.9561}, +{37.8755, -2.57290, 20.6915}, +{38.4882, -0.285373, 21.1216}, +{39.1107, 1.64931, 21.1561}, +{39.7432, 3.53583, 21.1907}, +{40.3861, 5.71979, 20.8812}, +{41.0393, 7.39816, 20.1306}, +{41.7031, 8.79766, 19.4069}, +{42.3776, 10.0854, 18.6806}, +{43.0630, 11.3680, 17.9803}, +{43.7595, 12.9326, 17.3063}, +{44.4673, 13.7965, 15.1369}, +{45.1865, 14.1346, 14.0797}, +{45.9174, 14.4929, 13.0963}, +{46.6600, 14.8574, 12.1816}, +{47.4147, 15.2691, 11.1563}, +{48.1816, 15.4202, 10.0938}, +{48.9609, 15.4187, 9.13432}, +{49.7528, 15.3468, 8.28012}, +{50.5576, 15.2363, 7.50582}, +{51.3753, 15.1248, 6.74857}, +{52.2062, 14.8805, 6.00911}, +{53.0506, 14.5463, 5.40855}, +{53.9087, 14.2418, 4.91012}, +{54.7806, 13.9331, 4.46054}, +{55.6667, 13.6019, 4.05496}, +{56.5670, 13.2719, 3.77227}, +{57.4820, 13.0195, 3.53316}, +{58.4117, 12.8489, 3.28322}, +{59.3564, 12.5902, 2.87835}, +{60.3165, 12.1522, 2.62473}, +{61.2921, 11.8258, 2.52642}, +{62.2834, 11.5465, 2.43178}, +{63.2908, 11.2619, 2.36643}, +{64.3145, 11.0317, 2.34323}, +{65.3547, 10.8375, 2.32026}, +{66.4118, 10.6605, 2.29752}, +{67.4859, 10.4895, 2.27568}, +{68.5775, 10.3303, 2.27375}, +{69.6867, 10.1783, 2.27183}, +{70.8138, 10.0407, 2.29948}, +{71.9591, 9.92786, 2.32958}, +{73.1230, 9.83303, 2.36007}, +{74.3057, 9.75043, 2.38398}, +{75.5076, 9.67418, 2.40742}, +{76.7289, 9.60232, 2.43153}, +{77.9699, 9.53929, 2.46221}, +{79.2310, 9.48789, 2.49328}, +{80.5125, 9.44594, 2.51611}, +{81.8147, 9.39639, 2.53431}, +{83.1380, 9.35177, 2.56806}, +{84.4827, 9.31713, 2.60227}, +{85.8491, 9.28963, 2.63692}, +{87.2377, 9.26861, 2.67204}, +{88.6487, 9.25394, 2.70786}, +{90.0825, 9.24674, 2.74449}, +{91.5395, 9.25043, 2.78163}, +{93.0201, 9.28333, 2.81085}, +{94.5246, 9.27792, 2.79769}, +{96.0535, 9.27449, 2.81938}, +{97.6071, 9.27931, 2.84123}, +{99.1858, 9.29196, 2.86323}, +{100.790, 9.31514, 2.87591}, +{102.420, 9.33092, 2.87894}, +{104.077, 9.34377, 2.88242}, +{105.760, 9.35555, 2.88592}, +{107.471, 9.36635, 2.88981}, +{109.209, 9.37756, 2.89472}, +{110.975, 9.38932, 2.90052}, +{112.770, 9.40358, 2.90639}, +{114.594, 9.41893, 2.91140}, +{116.448, 9.43501, 2.91420}, +{118.331, 9.45042, 2.91638}, +{120.245, 9.46559, 2.91857}, +{122.190, 9.48093, 2.92071}, +{124.166, 9.49644, 2.92283}, +{126.175, 9.51226, 2.92503}, +{128.215, 9.52847, 2.92720}, +{130.289, 9.54505, 2.92936}, +{132.397, 9.56198, 2.93153}, +{134.538, 9.57940, 2.93396}, +{136.714, 9.59766, 2.93645}, +{138.925, 9.61668, 2.93887}, +{141.172, 9.63658, 2.94132}, +{143.456, 9.65766, 2.94379}, +{145.776, 9.68033, 2.94628}, +{148.134, 9.70558, 2.94875}, +{150.530, 9.73928, 2.94823}, +{152.964, 9.76953, 2.93711}, +{155.439, 9.79638, 2.92307}, +{157.953, 9.81876, 2.90696}, +{160.507, 9.83767, 2.89085}, +{163.103, 9.85428, 2.87487}, +{165.742, 9.86901, 2.85904}, +{168.422, 9.88172, 2.84313}, +{171.146, 9.89151, 2.82840}, +{173.915, 9.90083, 2.81529}, +{176.727, 9.91047, 2.80386}, +{179.586, 9.92074, 2.79252}, +{182.491, 9.93397, 2.78024}, +{185.442, 9.94504, 2.76315}, +{188.442, 9.95388, 2.74521}, +{191.489, 9.96025, 2.72621}, +{194.587, 9.96401, 2.70671}, +{197.734, 9.96572, 2.68715}, +{200.932, 9.96539, 2.66756}, +{204.182, 9.96325, 2.64804}, +{207.485, 9.95964, 2.62871}, +{210.840, 9.95600, 2.60957}, +{214.251, 9.95013, 2.58571}, +{217.716, 9.94061, 2.56104}, +{221.237, 9.92664, 2.53584}, +{224.816, 9.90906, 2.51095}, +{228.452, 9.88815, 2.48623}, +{232.147, 9.86374, 2.46166}, +{235.902, 9.83582, 2.43740}, +{239.717, 9.80434, 2.41339}, +{243.595, 9.76916, 2.38961}, +{247.535, 9.73011, 2.36608}, +{251.538, 9.68701, 2.34277}, +{255.607, 9.63962, 2.31969}, +{259.741, 9.58769, 2.29684}, +{263.942, 9.53099, 2.27422}, +{268.211, 9.46929, 2.25181}, +{272.549, 9.40260, 2.22963}, +{276.957, 9.33177, 2.20565}, +{281.437, 9.25257, 2.17938}, +{285.989, 9.16375, 2.15185}, +{290.615, 9.06495, 2.12446}, +{295.315, 8.95552, 2.09741}, +{300.092, 8.83472, 2.07071}, +{304.945, 8.70134, 2.04435}, +{309.878, 8.55389, 2.01831}, +{314.890, 8.39051, 1.99261}, +{319.983, 8.20895, 1.96724}, +{325.158, 8.00639, 1.94219}, +{330.418, 7.77925, 1.91748}, +{335.762, 7.52301, 1.89306}, +{341.192, 7.23166, 1.86895}, +{346.711, 6.89727, 1.84516}, +{352.319, 6.50888, 1.82167}, +{358.017, 6.05087, 1.79849}, +{363.808, 5.49980, 1.77560}, +{369.692, 4.81839, 1.75298}, +{375.672, 3.94191, 1.73064}, +{381.748, 2.74289, 1.70860}, +{387.922, 0.910264, 1.68648}, +{394.197, -2.76301, 1.66385}, +{398.600, -19.5732, 1.64836}, +{398.800, -19.5551, 15.6990}, +{400.573, -6.34604, 15.6350}, +{407.052, 0.592564, 15.4058}, +{413.635, 3.37939, 15.1799}, +{420.326, 5.18735, 14.9575}, +{427.124, 6.53794, 14.7383}, +{434.032, 7.61943, 14.5221}, +{441.052, 8.52266, 14.3091}, +{448.186, 9.30505, 14.0949}, +{455.435, 9.97548, 13.8626}, +{462.802, 10.5464, 13.6278}, +{470.287, 11.0165, 13.3936}, +{477.894, 11.3394, 13.1636}, +{485.623, 11.5895, 13.1716}, +{493.478, 11.9337, 13.2692}, +{501.459, 12.3764, 13.3676}, +{509.570, 12.8741, 13.4667}, +{517.812, 13.6313, 13.4823}, +{526.187, 14.2491, 13.2005}, +{534.698, 14.6907, 12.9476}, +{543.346, 15.0918, 12.7107}, +{552.134, 15.4683, 12.4782}, +{561.065, 15.8174, 12.2392}, +{570.139, 16.1350, 11.9999}, +{579.361, 16.4277, 11.7658}, +{588.732, 16.7003, 11.5372}, +{598.254, 16.9562, 11.3134}, +{607.930, 17.1977, 11.0938}, +{617.763, 17.4265, 10.8785}, +{627.755, 17.6502, 10.6668}, +{637.908, 17.8640, 10.4494}, +{648.226, 18.0651, 10.2229}, +{658.711, 18.2439, 9.99254}, +{669.365, 18.3917, 9.76701}, +{680.191, 18.5215, 9.56857}, +{691.193, 18.6570, 9.39095}, +{702.372, 18.8029, 9.22064}, +{713.733, 18.9552, 9.03461}, +{725.277, 19.0934, 8.83959}, +{737.008, 19.2168, 8.64923}, +{748.928, 19.3325, 8.46290}, +{761.042, 19.4428, 8.28040}, +{773.351, 19.5483, 8.10035}, +{785.859, 19.6495, 7.91903}, +{798.570, 19.7415, 7.73757}, +{811.486, 19.8246, 7.56020}, +{824.611, 19.9015, 7.38693}, +{837.949, 19.9729, 7.21764}, +{851.502, 20.0394, 7.05186}, +{865.274, 20.1012, 6.88953}, +{879.269, 20.1585, 6.73063}, +{893.491, 20.2116, 6.57546}, +{907.943, 20.2611, 6.42385}, +{922.628, 20.3080, 6.27571}, +{937.551, 20.3516, 6.12927}, +{952.715, 20.3913, 5.98577}, +{968.124, 20.4276, 5.84522}, +{983.783, 20.4607, 5.70808}, +{999.695, 20.4912, 5.57411}, +{1015.86, 20.5194, 5.44326}, +{1032.29, 20.5457, 5.31516}, +{1048.99, 20.5704, 5.18876}, +{1065.96, 20.5920, 5.06396}, +{1083.20, 20.6103, 4.94211}, +{1100.72, 20.6263, 4.82322}, +{1118.52, 20.6403, 4.70721}, +{1136.61, 20.6523, 4.59395}, +{1155.00, 20.6626, 4.48343}, +{1173.68, 20.6712, 4.37560}, +{1192.66, 20.6785, 4.27040}, +{1211.95, 20.6845, 4.16768}, +{1231.55, 20.6895, 4.06736}, +{1251.47, 20.6934, 3.96901}, +{1271.72, 20.6964, 3.87241}, +{1292.29, 20.6977, 3.77740}, +{1313.19, 20.6973, 3.68477}, +{1334.43, 20.6958, 3.59443}, +{1356.01, 20.6933, 3.50629}, +{1377.94, 20.6897, 3.42031}, +{1400.23, 20.6854, 3.33644}, +{1422.88, 20.6803, 3.25460}, +{1445.89, 20.6746, 3.17482}, +{1469.28, 20.6685, 3.09675}, +{1493.04, 20.6623, 3.02021}, +{1517.19, 20.6552, 2.94422}, +{1541.73, 20.6465, 2.86997}, +{1566.67, 20.6370, 2.79758}, +{1592.01, 20.6266, 2.72695}, +{1617.76, 20.6155, 2.65811}, +{1643.92, 20.6038, 2.59105}, +{1670.51, 20.5916, 2.52564}, +{1697.53, 20.5789, 2.46190}, +{1724.99, 20.5661, 2.39982}, +{1752.89, 20.5529, 2.33857}, +{1781.24, 20.5390, 2.27868}, +{1810.05, 20.5244, 2.22021}, +{1839.32, 20.5092, 2.16319}, +{1869.07, 20.4935, 2.10764}, +{1899.30, 20.4774, 2.05356}, +{1930.02, 20.4609, 2.00080}, +{1961.24, 20.4440, 1.94938}, +{1992.96, 20.4266, 1.89933}, +{2025.20, 20.4093, 1.85117}, +{2057.95, 20.3919, 1.80329}, +{2091.24, 20.3740, 1.75656}, +{2125.06, 20.3556, 1.71097}, +{2159.43, 20.3368, 1.66650}, +{2194.36, 20.3177, 1.62311}, +{2229.85, 20.2982, 1.58078}, +{2265.92, 20.2783, 1.53949}, +{2302.57, 20.2580, 1.49923}, +{2339.81, 20.2373, 1.45995}, +{2377.66, 20.2162, 1.42162}, +{2416.11, 20.1947, 1.38425}, +{2455.19, 20.1728, 1.34779}, +{2494.90, 20.1504, 1.31223}, +{2535.26, 20.1276, 1.27756}, +{2576.26, 20.1042, 1.24373}, +{2617.93, 20.0803, 1.21073}, +{2660.27, 20.0558, 1.17854}, +{2703.30, 20.0306, 1.14715}, +{2747.03, 20.0049, 1.11654}, +{2791.46, 19.9784, 1.08667}, +{2836.61, 19.9511, 1.05756}, +{2882.49, 19.9230, 1.02915}, +{2929.11, 19.8939, 1.00143}, +{2976.48, 19.8639, 0.974409}, +{3024.63, 19.8327, 0.948070}, +{3073.55, 19.8003, 0.922364}, +{3123.26, 19.7666, 0.897277}, +{3173.78, 19.7314, 0.872817}, +{3225.11, 19.6945, 0.848979}, +{3277.27, 19.6557, 0.825708}, +{3330.28, 19.6149, 0.802998}, +{3384.15, 19.5716, 0.780866}, +{3438.88, 19.5257, 0.759259}, +{3494.50, 19.4767, 0.738188}, +{3551.02, 19.4241, 0.717638}, +{3608.46, 19.3674, 0.697584}, +{3666.82, 19.3058, 0.678031}, +{3726.13, 19.2385, 0.658943}, +{3786.40, 19.1642, 0.640333}, +{3847.64, 19.0816, 0.622187}, +{3909.87, 18.9885, 0.604462}, +{3973.11, 18.8822, 0.587165}, +{4037.38, 18.7586, 0.570323}, +{4102.68, 18.6117, 0.553858}, +{4169.03, 18.4319, 0.537783}, +{4236.46, 18.2021, 0.522133}, +{4304.98, 17.8887, 0.506841}, +{4374.62, 17.4077, 0.491903}, +{4445.37, 16.4209, 0.477359}, +{4492.70, 9.35814, 0.467995}, +{4492.90, 9.35887, 4.10565}, +{4517.27, 15.7678, 4.07429}, +{4590.33, 17.4448, 3.98268}, +{4664.58, 18.1544, 3.89221}, +{4740.03, 18.6180, 3.80297}, +{4816.69, 18.9642, 3.71494}, +{4894.60, 19.2405, 3.62822}, +{4973.77, 19.4699, 3.54268}, +{5054.21, 19.6654, 3.45845}, +{5135.96, 19.8349, 3.37558}, +{5219.03, 19.9840, 3.29407}, +{5303.44, 20.1164, 3.21390}, +{5389.22, 20.2349, 3.13511}, +{5476.39, 20.3416, 3.05774}, +{5564.97, 20.4382, 2.98179}, +{5654.98, 20.5259, 2.90722}, +{5746.44, 20.6059, 2.83406}, +{5839.39, 20.6789, 2.76230}, +{5933.83, 20.7458, 2.69197}, +{6029.81, 20.8070, 2.62301}, +{6127.33, 20.8633, 2.55550}, +{6226.44, 20.9149, 2.48934}, +{6327.15, 20.9624, 2.42460}, +{6429.48, 21.0060, 2.36120}, +{6533.48, 21.0462, 2.29916}, +{6639.15, 21.0830, 2.23843}, +{6746.54, 21.1169, 2.17910}, +{6855.65, 21.1480, 2.12111}, +{6966.54, 21.1766, 2.06435}, +{7079.22, 21.2028, 2.00893}, +{7193.72, 21.2267, 1.95474}, +{7310.07, 21.2486, 1.90184}, +{7428.31, 21.2685, 1.85021}, +{7548.45, 21.2867, 1.79973}, +{7670.54, 21.3032, 1.75051}, +{7794.61, 21.3182, 1.70247}, +{7920.68, 21.3317, 1.65552}, +{8048.79, 21.3437, 1.60978}, +{8178.98, 21.3546, 1.56514}, +{8311.26, 21.3643, 1.52157}, +{8445.69, 21.3727, 1.47910}, +{8582.29, 21.3802, 1.43775}, +{8721.11, 21.3868, 1.39737}, +{8862.16, 21.3923, 1.35800}, +{9005.50, 21.3971, 1.31974}, +{9151.16, 21.4010, 1.28234}, +{9299.17, 21.4042, 1.24595}, +{9449.58, 21.4067, 1.21053}, +{9602.42, 21.4085, 1.17600}, +{9757.73, 21.4098, 1.14241}, +{9915.55, 21.4105, 1.10962}, +{10075.9, 21.4106, 1.07774}, +{10238.9, 21.4102, 1.04671}, +{10404.5, 21.4094, 1.01650}, +{10572.8, 21.4082, 0.987098}, +{10743.8, 21.4065, 0.958486}, +{10917.6, 21.4045, 0.930645}, +{11094.2, 21.4021, 0.903557}, +{11273.6, 21.3995, 0.877203}, +{11455.9, 21.3965, 0.851568}, +{11641.2, 21.3933, 0.826633}, +{11829.5, 21.3898, 0.802382}, +{12020.8, 21.3861, 0.778799}, +{12215.3, 21.3822, 0.755866}, +{12412.8, 21.3781, 0.733569}, +{12613.6, 21.3738, 0.711891}, +{12817.6, 21.3694, 0.690817}, +{13025.0, 21.3648, 0.670332}, +{13235.6, 21.3601, 0.650421}, +{13449.7, 21.3553, 0.631070}, +{13667.2, 21.3504, 0.612264}, +{13888.3, 21.3453, 0.593990}, +{14112.9, 21.3402, 0.576232}, +{14341.2, 21.3351, 0.558980}, +{14573.1, 21.3299, 0.542218}, +{14808.9, 21.3246, 0.525936}, +{15048.4, 21.3193, 0.510118}, +{15291.8, 21.3139, 0.494755}, +{15539.1, 21.3086, 0.479833}, +{15790.4, 21.3032, 0.465340}, +{16045.8, 21.2978, 0.451266}, +{16305.4, 21.2924, 0.437599}, +{16569.1, 21.2870, 0.424328}, +{16837.1, 21.2816, 0.411443}, +{17109.4, 21.2762, 0.398932}, +{17386.1, 21.2708, 0.386787}, +{17667.4, 21.2655, 0.374996}, +{17953.1, 21.2602, 0.363550}, +{18243.5, 21.2549, 0.352440}, +{18538.6, 21.2496, 0.341656}, +{18838.4, 21.2444, 0.331189}, +{19143.1, 21.2392, 0.321031}, +{19452.7, 21.2341, 0.311173}, +{19767.4, 21.2290, 0.301607}, +{20087.1, 21.2240, 0.292323}, +{20412.0, 21.2190, 0.283316}, +{20742.1, 21.2140, 0.274576}, +{21077.6, 21.2091, 0.266095}, +{21418.5, 21.2043, 0.257868}, +{21765.0, 21.1995, 0.249887}, +{22117.0, 21.1948, 0.242144}, +{22474.7, 21.1901, 0.234633}, +{22838.2, 21.1855, 0.227347}, +{23207.6, 21.1810, 0.220280}, +{23583.0, 21.1765, 0.213425}, +{23964.4, 21.1721, 0.206777}, +{24352.0, 21.1677, 0.200329}, +{24745.9, 21.1634, 0.194075}, +{25146.2, 21.1592, 0.188011}, +{25552.9, 21.1550, 0.182130}, +{25966.2, 21.1509, 0.176428}, +{26386.1, 21.1469, 0.170898}, +{26812.9, 21.1429, 0.165537}, +{27246.6, 21.1390, 0.160338}, +{27687.3, 21.1351, 0.155298}, +{28135.1, 21.1314, 0.150412}, +{28590.2, 21.1277, 0.145674}, +{29052.6, 21.1241, 0.141082}, +{29522.5, 21.1209, 0.136630}, +{30000.0, 21.1157, 0.132314}, +{0, 0, 0} +}; + +e_fp_fdp ti[] = { /* Z = 22 */ +{10.0000, -9999.00, 2.38456}, +{10.1617, -9999.00, 2.37555}, +{10.3261, -9999.00, 2.36658}, +{10.4931, -9999.00, 2.35765}, +{10.6628, -9999.00, 2.34874}, +{10.8353, -9999.00, 2.33987}, +{11.0106, -9999.00, 2.33104}, +{11.1886, -9999.00, 2.32572}, +{11.3696, -9999.00, 2.32484}, +{11.5535, -9999.00, 2.32396}, +{11.7404, -9999.00, 2.32308}, +{11.9303, -9999.00, 2.32221}, +{12.1232, -9999.00, 2.32133}, +{12.3193, -9999.00, 2.32045}, +{12.5186, -9999.00, 2.31958}, +{12.7210, -9999.00, 2.31870}, +{12.9268, -9999.00, 2.31783}, +{13.1359, -9999.00, 2.31695}, +{13.3483, -9999.00, 2.31608}, +{13.5642, -9999.00, 2.31824}, +{13.7836, -9999.00, 2.32115}, +{14.0066, -9999.00, 2.32406}, +{14.2331, -9999.00, 2.32697}, +{14.4633, -9999.00, 2.32989}, +{14.6973, -9999.00, 2.33281}, +{14.9350, -9999.00, 2.33573}, +{15.1765, -9999.00, 2.34122}, +{15.4220, -9999.00, 2.34677}, +{15.6714, -9999.00, 2.35234}, +{15.9249, -9999.00, 2.35791}, +{16.1825, -9999.00, 2.36351}, +{16.4442, -9999.00, 2.37618}, +{16.7102, -9999.00, 2.39319}, +{16.9805, -9999.00, 2.41032}, +{17.2551, -9999.00, 2.42885}, +{17.5342, -9999.00, 2.46979}, +{17.8178, -9999.00, 2.51143}, +{18.1060, -9999.00, 2.55377}, +{18.3989, -9999.00, 2.59682}, +{18.6964, -9999.00, 2.64495}, +{18.9988, -9999.00, 2.70692}, +{19.3061, -9999.00, 2.77035}, +{19.6184, -9999.00, 2.83526}, +{19.9357, -9999.00, 2.93286}, +{20.2582, -9999.00, 3.04925}, +{20.5858, -9999.00, 3.17025}, +{20.9188, -9999.00, 3.30828}, +{21.2571, -9999.00, 3.46104}, +{21.6009, -9999.00, 3.62084}, +{21.9503, -9999.00, 3.78803}, +{22.3053, -9999.00, 3.96294}, +{22.6661, -9999.00, 4.14592}, +{23.0327, -9999.00, 4.26843}, +{23.4053, -9999.00, 4.37668}, +{23.7838, -9999.00, 4.48768}, +{24.1685, -9999.00, 4.60150}, +{24.5594, -9999.00, 4.71819}, +{24.9566, -9999.00, 4.83786}, +{25.3603, -9999.00, 4.91587}, +{25.7705, -9999.00, 4.95342}, +{26.1873, -9999.00, 4.99126}, +{26.6109, -9999.00, 5.02939}, +{27.0413, -9999.00, 5.06781}, +{27.4786, -9999.00, 5.05289}, +{27.9231, -9999.00, 4.99747}, +{28.3747, -9999.00, 4.94266}, +{28.8337, -9999.00, 4.88845}, +{29.3000, 2.27863, 4.83484}, +{29.7739, 2.26302, 4.77767}, +{30.2555, 2.21560, 4.72068}, +{30.7449, 2.12534, 4.66438}, +{31.2421, 1.96940, 4.65287}, +{31.7475, 1.81449, 4.72636}, +{32.2609, 1.69655, 4.80102}, +{32.7827, 1.55941, 4.87685}, +{33.3130, 1.36802, 4.98488}, +{33.8518, 1.18440, 5.19195}, +{34.3993, 1.05557, 5.40762}, +{34.9557, 0.923268, 5.63225}, +{35.5211, 0.776736, 5.90198}, +{36.0956, 0.656309, 6.22897}, +{36.6794, 0.575787, 6.57407}, +{37.2727, 0.508507, 6.93830}, +{37.8755, 0.448347, 7.34882}, +{38.4882, 0.429323, 7.81476}, +{39.1107, 0.465914, 8.31024}, +{39.7432, 0.551386, 8.83714}, +{40.3861, 0.705481, 9.39744}, +{41.0393, 0.926428, 9.96367}, +{41.7031, 1.20569, 10.5594}, +{42.3776, 1.57864, 11.1907}, +{43.0630, 2.17717, 11.8410}, +{43.7595, 2.86386, 12.2348}, +{44.4673, 3.53030, 12.6416}, +{45.1865, 4.27191, 12.9275}, +{45.9174, 4.99547, 13.1541}, +{46.6600, 5.81039, 13.3846}, +{47.4147, 6.66221, 13.3404}, +{48.1816, 7.41583, 13.2926}, +{48.9609, 8.21005, 13.2134}, +{49.7528, 8.99189, 13.0142}, +{50.5576, 9.87913, 12.8180}, +{51.3753, 10.7654, 12.2500}, +{52.2062, 11.3311, 11.5830}, +{53.0506, 11.7574, 10.9523}, +{53.9087, 12.0921, 10.3560}, +{54.7806, 12.3673, 9.79211}, +{55.6667, 12.5843, 9.21805}, +{56.5670, 12.7330, 8.67767}, +{57.4820, 12.8383, 8.16894}, +{58.4117, 12.9183, 7.69006}, +{59.3564, 12.9794, 7.20058}, +{60.3165, 12.9818, 6.70340}, +{61.2921, 12.9157, 6.24055}, +{62.2834, 12.7967, 5.80968}, +{63.2908, 12.6495, 5.46644}, +{64.3145, 12.5124, 5.14676}, +{65.3547, 12.3638, 4.84578}, +{66.4118, 12.1983, 4.56240}, +{67.4859, 11.9609, 4.29559}, +{68.5775, 11.7093, 4.16251}, +{69.6867, 11.5432, 4.05894}, +{70.8138, 11.3955, 3.95795}, +{71.9591, 11.2499, 3.85948}, +{73.1230, 11.1054, 3.78039}, +{74.3057, 10.9646, 3.71807}, +{75.5076, 10.8366, 3.68632}, +{76.7289, 10.7337, 3.65484}, +{77.9699, 10.6313, 3.62362}, +{79.2310, 10.5320, 3.61766}, +{80.5125, 10.4529, 3.61860}, +{81.8147, 10.3870, 3.61953}, +{83.1380, 10.3284, 3.62046}, +{84.4827, 10.2655, 3.62139}, +{85.8491, 10.2071, 3.64392}, +{87.2377, 10.1702, 3.67029}, +{88.6487, 10.1433, 3.69685}, +{90.0825, 10.1254, 3.72360}, +{91.5395, 10.1157, 3.75055}, +{93.0201, 10.1143, 3.77769}, +{94.5246, 10.1212, 3.80503}, +{96.0535, 10.1464, 3.83256}, +{97.6071, 10.1807, 3.83855}, +{99.1858, 10.2045, 3.83573}, +{100.790, 10.2259, 3.83291}, +{102.420, 10.2471, 3.83010}, +{104.077, 10.2690, 3.82728}, +{105.760, 10.2924, 3.82447}, +{107.471, 10.3179, 3.82166}, +{109.209, 10.3491, 3.81886}, +{110.975, 10.3868, 3.81121}, +{112.770, 10.4222, 3.78556}, +{114.594, 10.4479, 3.76009}, +{116.448, 10.4690, 3.73479}, +{118.331, 10.4863, 3.70966}, +{120.245, 10.4999, 3.68471}, +{122.190, 10.5095, 3.65991}, +{124.166, 10.5041, 3.63529}, +{126.175, 10.4947, 3.63501}, +{128.215, 10.5022, 3.63961}, +{130.289, 10.5141, 3.64421}, +{132.397, 10.5296, 3.64882}, +{134.538, 10.5480, 3.65343}, +{136.714, 10.5692, 3.65805}, +{138.925, 10.5937, 3.66267}, +{141.172, 10.6209, 3.66357}, +{143.456, 10.6477, 3.66345}, +{145.776, 10.6748, 3.66334}, +{148.134, 10.7029, 3.66322}, +{150.530, 10.7323, 3.66310}, +{152.964, 10.7632, 3.66299}, +{155.439, 10.7961, 3.66288}, +{157.953, 10.8314, 3.66276}, +{160.507, 10.8775, 3.66264}, +{163.103, 10.9258, 3.64366}, +{165.742, 10.9604, 3.62325}, +{168.422, 10.9926, 3.60297}, +{171.146, 11.0223, 3.58279}, +{173.915, 11.0499, 3.56273}, +{176.727, 11.0755, 3.54278}, +{179.586, 11.0988, 3.52294}, +{182.491, 11.1173, 3.50489}, +{185.442, 11.1363, 3.49521}, +{188.442, 11.1613, 3.48556}, +{191.489, 11.1884, 3.47593}, +{194.587, 11.2187, 3.46633}, +{197.734, 11.2562, 3.45676}, +{200.932, 11.2995, 3.43062}, +{204.182, 11.3335, 3.39642}, +{207.485, 11.3593, 3.36256}, +{210.840, 11.3821, 3.32903}, +{214.251, 11.4033, 3.29584}, +{217.716, 11.4256, 3.26298}, +{221.237, 11.4459, 3.21703}, +{224.816, 11.4556, 3.17140}, +{228.452, 11.4592, 3.12641}, +{232.147, 11.4573, 3.08207}, +{235.902, 11.4450, 3.03835}, +{239.717, 11.4278, 3.00748}, +{243.595, 11.4170, 2.97875}, +{247.535, 11.4055, 2.95030}, +{251.538, 11.3936, 2.92212}, +{255.607, 11.3819, 2.89421}, +{259.741, 11.3704, 2.86151}, +{263.942, 11.3535, 2.82532}, +{268.211, 11.3305, 2.78959}, +{272.549, 11.3035, 2.75431}, +{276.957, 11.2727, 2.71947}, +{281.437, 11.2378, 2.68422}, +{285.989, 11.1979, 2.64929}, +{290.615, 11.1532, 2.61481}, +{295.315, 11.1037, 2.58078}, +{300.092, 11.0490, 2.54719}, +{304.945, 10.9891, 2.51404}, +{309.878, 10.9234, 2.48110}, +{314.890, 10.8513, 2.44781}, +{319.983, 10.7718, 2.41497}, +{325.158, 10.6848, 2.38257}, +{330.418, 10.5895, 2.35061}, +{335.762, 10.4852, 2.31907}, +{341.192, 10.3714, 2.28796}, +{346.711, 10.2475, 2.25726}, +{352.319, 10.1146, 2.22698}, +{358.017, 9.96989, 2.18470}, +{363.808, 9.79951, 2.13812}, +{369.692, 9.60261, 2.09252}, +{375.672, 9.37848, 2.04790}, +{381.748, 9.12070, 2.00423}, +{387.922, 8.82370, 1.96503}, +{394.197, 8.48753, 1.93947}, +{400.573, 8.10598, 1.91164}, +{407.052, 7.65755, 1.88318}, +{413.635, 7.12029, 1.85515}, +{420.326, 6.45861, 1.82754}, +{427.124, 5.61123, 1.80033}, +{434.032, 4.45863, 1.77351}, +{441.052, 2.71435, 1.74711}, +{448.186, -0.679332, 1.72112}, +{453.700, -18.2884, 1.70156}, +{453.900, -18.2691, 15.6456}, +{455.435, -5.76893, 15.5845}, +{462.802, 2.08580, 15.2973}, +{470.287, 4.96679, 15.0155}, +{477.894, 6.79840, 14.7389}, +{485.623, 8.14683, 14.4673}, +{493.478, 9.21100, 14.2007}, +{501.459, 10.0843, 13.9392}, +{509.570, 10.8175, 13.6824}, +{517.812, 11.4398, 13.4303}, +{526.187, 11.9676, 13.1825}, +{534.698, 12.4079, 12.9397}, +{543.346, 12.7632, 12.7014}, +{552.134, 12.8659, 12.4676}, +{561.065, 12.8684, 12.6328}, +{570.139, 13.2025, 12.9952}, +{579.361, 13.8081, 13.3681}, +{588.732, 14.6565, 13.3580}, +{598.254, 15.3266, 13.1020}, +{607.930, 15.8140, 12.8510}, +{617.763, 16.2476, 12.6048}, +{627.755, 16.6407, 12.3626}, +{637.908, 17.0021, 12.1171}, +{648.226, 17.3325, 11.8653}, +{658.711, 17.6283, 11.6115}, +{669.365, 17.8818, 11.3625}, +{680.191, 18.1077, 11.1436}, +{691.193, 18.3374, 10.9478}, +{702.372, 18.5732, 10.7585}, +{713.733, 18.8142, 10.5467}, +{725.277, 19.0312, 10.3216}, +{737.008, 19.2245, 10.1014}, +{748.928, 19.4045, 9.88576}, +{761.042, 19.5731, 9.67465}, +{773.351, 19.7319, 9.46726}, +{785.859, 19.8817, 9.26165}, +{798.570, 20.0208, 9.05835}, +{811.486, 20.1500, 8.85950}, +{824.611, 20.2710, 8.66501}, +{837.949, 20.3849, 8.47477}, +{851.502, 20.4923, 8.28800}, +{865.274, 20.5933, 8.10458}, +{879.269, 20.6881, 7.92455}, +{893.491, 20.7770, 7.74846}, +{907.943, 20.8610, 7.57631}, +{922.628, 20.9425, 7.40802}, +{937.551, 21.0200, 7.23839}, +{952.715, 21.0900, 7.07142}, +{968.124, 21.1545, 6.90723}, +{983.783, 21.2135, 6.74687}, +{999.695, 21.2681, 6.59037}, +{1015.86, 21.3185, 6.43766}, +{1032.29, 21.3663, 6.28968}, +{1048.99, 21.4127, 6.14293}, +{1065.96, 21.4546, 5.99728}, +{1083.20, 21.4919, 5.85509}, +{1100.72, 21.5258, 5.71630}, +{1118.52, 21.5567, 5.58081}, +{1136.61, 21.5849, 5.44849}, +{1155.00, 21.6106, 5.31932}, +{1173.68, 21.6341, 5.19325}, +{1192.66, 21.6555, 5.07013}, +{1211.95, 21.6751, 4.94992}, +{1231.55, 21.6935, 4.83257}, +{1251.47, 21.7108, 4.71682}, +{1271.72, 21.7263, 4.60264}, +{1292.29, 21.7394, 4.48977}, +{1313.19, 21.7496, 4.37967}, +{1334.43, 21.7581, 4.27224}, +{1356.01, 21.7648, 4.16739}, +{1377.94, 21.7700, 4.06517}, +{1400.23, 21.7740, 3.96544}, +{1422.88, 21.7769, 3.86813}, +{1445.89, 21.7791, 3.77327}, +{1469.28, 21.7807, 3.68030}, +{1493.04, 21.7824, 3.58895}, +{1517.19, 21.7832, 3.49695}, +{1541.73, 21.7803, 3.40693}, +{1566.67, 21.7760, 3.31928}, +{1592.01, 21.7705, 3.23386}, +{1617.76, 21.7638, 3.15062}, +{1643.92, 21.7560, 3.06952}, +{1670.51, 21.7474, 2.99060}, +{1697.53, 21.7383, 2.91366}, +{1724.99, 21.7286, 2.83861}, +{1752.89, 21.7184, 2.76463}, +{1781.24, 21.7071, 2.69230}, +{1810.05, 21.6947, 2.62170}, +{1839.32, 21.6816, 2.55294}, +{1869.07, 21.6678, 2.48596}, +{1899.30, 21.6534, 2.42070}, +{1930.02, 21.6384, 2.35715}, +{1961.24, 21.6229, 2.29528}, +{1992.96, 21.6068, 2.23505}, +{2025.20, 21.5904, 2.17710}, +{2057.95, 21.5744, 2.11960}, +{2091.24, 21.5575, 2.06352}, +{2125.06, 21.5401, 2.00886}, +{2159.43, 21.5223, 1.95557}, +{2194.36, 21.5040, 1.90367}, +{2229.85, 21.4853, 1.85306}, +{2265.92, 21.4663, 1.80376}, +{2302.57, 21.4469, 1.75573}, +{2339.81, 21.4272, 1.70892}, +{2377.66, 21.4071, 1.66332}, +{2416.11, 21.3866, 1.61889}, +{2455.19, 21.3658, 1.57563}, +{2494.90, 21.3447, 1.53346}, +{2535.26, 21.3232, 1.49241}, +{2576.26, 21.3013, 1.45241}, +{2617.93, 21.2791, 1.41345}, +{2660.27, 21.2565, 1.37554}, +{2703.30, 21.2335, 1.33858}, +{2747.03, 21.2100, 1.30261}, +{2791.46, 21.1862, 1.26756}, +{2836.61, 21.1619, 1.23344}, +{2882.49, 21.1370, 1.20024}, +{2929.11, 21.1117, 1.16787}, +{2976.48, 21.0858, 1.13638}, +{3024.63, 21.0593, 1.10572}, +{3073.55, 21.0322, 1.07587}, +{3123.26, 21.0043, 1.04678}, +{3173.78, 20.9757, 1.01846}, +{3225.11, 20.9462, 0.990907}, +{3277.27, 20.9158, 0.964074}, +{3330.28, 20.8844, 0.937973}, +{3384.15, 20.8519, 0.912540}, +{3438.88, 20.8181, 0.887797}, +{3494.50, 20.7829, 0.863676}, +{3551.02, 20.7462, 0.840234}, +{3608.46, 20.7078, 0.817394}, +{3666.82, 20.6674, 0.795143}, +{3726.13, 20.6248, 0.773490}, +{3786.40, 20.5797, 0.752444}, +{3847.64, 20.5317, 0.731915}, +{3909.87, 20.4804, 0.711976}, +{3973.11, 20.4253, 0.692548}, +{4037.38, 20.3657, 0.673609}, +{4102.68, 20.3007, 0.655204}, +{4169.03, 20.2293, 0.637274}, +{4236.46, 20.1502, 0.619807}, +{4304.98, 20.0614, 0.602855}, +{4374.62, 19.9606, 0.586299}, +{4445.37, 19.8440, 0.570202}, +{4517.27, 19.7064, 0.554551}, +{4590.33, 19.5394, 0.539289}, +{4664.58, 19.3287, 0.524429}, +{4740.03, 19.0468, 0.509971}, +{4816.69, 18.6300, 0.495901}, +{4894.60, 17.8613, 0.482202}, +{4966.30, 10.4859, 0.470113}, +{4966.50, 10.4865, 4.03728}, +{4973.77, 15.3814, 4.02875}, +{5054.21, 18.2832, 3.93636}, +{5135.96, 19.0881, 3.84571}, +{5219.03, 19.5850, 3.75632}, +{5303.44, 19.9471, 3.66816}, +{5389.22, 20.2321, 3.58137}, +{5476.39, 20.4667, 3.49596}, +{5564.97, 20.6654, 3.41191}, +{5654.98, 20.8369, 3.32924}, +{5746.44, 20.9871, 3.24793}, +{5839.39, 21.1201, 3.16813}, +{5933.83, 21.2389, 3.08973}, +{6029.81, 21.3456, 3.01276}, +{6127.33, 21.4420, 2.93722}, +{6226.44, 21.5294, 2.86314}, +{6327.15, 21.6089, 2.79051}, +{6429.48, 21.6815, 2.71928}, +{6533.48, 21.7478, 2.64947}, +{6639.15, 21.8084, 2.58115}, +{6746.54, 21.8641, 2.51425}, +{6855.65, 21.9152, 2.44870}, +{6966.54, 21.9620, 2.38459}, +{7079.22, 22.0051, 2.32187}, +{7193.72, 22.0446, 2.26050}, +{7310.07, 22.0809, 2.20051}, +{7428.31, 22.1143, 2.14182}, +{7548.45, 22.1448, 2.08447}, +{7670.54, 22.1728, 2.02842}, +{7794.61, 22.1985, 1.97371}, +{7920.68, 22.2219, 1.92025}, +{8048.79, 22.2433, 1.86808}, +{8178.98, 22.2629, 1.81708}, +{8311.26, 22.2806, 1.76730}, +{8445.69, 22.2967, 1.71874}, +{8582.29, 22.3112, 1.67137}, +{8721.11, 22.3243, 1.62515}, +{8862.16, 22.3361, 1.58010}, +{9005.50, 22.3467, 1.53610}, +{9151.16, 22.3559, 1.49323}, +{9299.17, 22.3642, 1.45146}, +{9449.58, 22.3714, 1.41072}, +{9602.42, 22.3777, 1.37098}, +{9757.73, 22.3830, 1.33230}, +{9915.55, 22.3875, 1.29456}, +{10075.9, 22.3913, 1.25783}, +{10238.9, 22.3943, 1.22206}, +{10404.5, 22.3966, 1.18721}, +{10572.8, 22.3983, 1.15327}, +{10743.8, 22.3993, 1.12023}, +{10917.6, 22.3999, 1.08806}, +{11094.2, 22.3999, 1.05675}, +{11273.6, 22.3994, 1.02627}, +{11455.9, 22.3985, 0.996600}, +{11641.2, 22.3972, 0.967731}, +{11829.5, 22.3954, 0.939640}, +{12020.8, 22.3934, 0.912310}, +{12215.3, 22.3910, 0.885721}, +{12412.8, 22.3882, 0.859858}, +{12613.6, 22.3852, 0.834702}, +{12817.6, 22.3820, 0.810237}, +{13025.0, 22.3785, 0.786445}, +{13235.6, 22.3748, 0.763310}, +{13449.7, 22.3709, 0.740817}, +{13667.2, 22.3668, 0.718948}, +{13888.3, 22.3625, 0.697690}, +{14112.9, 22.3581, 0.677025}, +{14341.2, 22.3535, 0.656940}, +{14573.1, 22.3488, 0.637420}, +{14808.9, 22.3440, 0.618450}, +{15048.4, 22.3391, 0.600015}, +{15291.8, 22.3342, 0.582103}, +{15539.1, 22.3291, 0.564700}, +{15790.4, 22.3240, 0.547792}, +{16045.8, 22.3188, 0.531367}, +{16305.4, 22.3136, 0.515411}, +{16569.1, 22.3084, 0.499913}, +{16837.1, 22.3031, 0.484860}, +{17109.4, 22.2978, 0.470241}, +{17386.1, 22.2924, 0.456043}, +{17667.4, 22.2871, 0.442256}, +{17953.1, 22.2818, 0.428868}, +{18243.5, 22.2765, 0.415869}, +{18538.6, 22.2711, 0.403248}, +{18838.4, 22.2658, 0.390995}, +{19143.1, 22.2605, 0.379099}, +{19452.7, 22.2553, 0.367551}, +{19767.4, 22.2500, 0.356342}, +{20087.1, 22.2448, 0.345462}, +{20412.0, 22.2396, 0.334901}, +{20742.1, 22.2345, 0.324652}, +{21077.6, 22.2294, 0.314704}, +{21418.5, 22.2243, 0.305051}, +{21765.0, 22.2193, 0.295684}, +{22117.0, 22.2144, 0.286594}, +{22474.7, 22.2094, 0.277774}, +{22838.2, 22.2046, 0.269216}, +{23207.6, 22.1998, 0.260913}, +{23583.0, 22.1950, 0.252857}, +{23964.4, 22.1903, 0.245042}, +{24352.0, 22.1857, 0.237461}, +{24745.9, 22.1811, 0.230107}, +{25146.2, 22.1766, 0.222973}, +{25552.9, 22.1721, 0.216053}, +{25966.2, 22.1677, 0.209342}, +{26386.1, 22.1634, 0.202832}, +{26812.9, 22.1591, 0.196518}, +{27246.6, 22.1549, 0.190395}, +{27687.3, 22.1507, 0.184457}, +{28135.1, 22.1466, 0.178699}, +{28590.2, 22.1426, 0.173115}, +{29052.6, 22.1387, 0.167700}, +{29522.5, 22.1353, 0.162450}, +{30000.0, 22.1294, 0.157359}, +{0, 0, 0} +}; + +e_fp_fdp v[] = { /* Z = 23 */ +{10.0000, -9999.00, 1.06459}, +{10.1617, -9999.00, 1.11805}, +{10.3261, -9999.00, 1.17419}, +{10.4931, -9999.00, 1.23315}, +{10.6628, -9999.00, 1.29507}, +{10.8353, -9999.00, 1.36010}, +{11.0106, -9999.00, 1.42839}, +{11.1886, -9999.00, 1.50012}, +{11.3696, -9999.00, 1.57258}, +{11.5535, -9999.00, 1.63780}, +{11.7404, -9999.00, 1.70572}, +{11.9303, -9999.00, 1.77646}, +{12.1232, -9999.00, 1.85014}, +{12.3193, -9999.00, 1.92687}, +{12.5186, -9999.00, 1.99571}, +{12.7210, -9999.00, 2.05265}, +{12.9268, -9999.00, 2.11121}, +{13.1359, -9999.00, 2.17145}, +{13.3483, -9999.00, 2.23341}, +{13.5642, -9999.00, 2.29713}, +{13.7836, -9999.00, 2.36165}, +{14.0066, -9999.00, 2.42627}, +{14.2331, -9999.00, 2.49265}, +{14.4633, -9999.00, 2.55876}, +{14.6973, -9999.00, 2.59175}, +{14.9350, -9999.00, 2.62517}, +{15.1765, -9999.00, 2.65901}, +{15.4220, -9999.00, 2.72656}, +{15.6714, -9999.00, 2.80790}, +{15.9249, -9999.00, 2.89168}, +{16.1825, -9999.00, 2.97795}, +{16.4442, -9999.00, 3.02748}, +{16.7102, -9999.00, 3.07315}, +{16.9805, -9999.00, 3.11950}, +{17.2551, -9999.00, 3.16654}, +{17.5342, -9999.00, 3.21430}, +{17.8178, -9999.00, 3.26278}, +{18.1060, -9999.00, 3.27138}, +{18.3989, -9999.00, 3.25767}, +{18.6964, -9999.00, 3.24402}, +{18.9988, -9999.00, 3.23042}, +{19.3061, -9999.00, 3.21688}, +{19.6184, -9999.00, 3.20340}, +{19.9357, -9999.00, 3.18998}, +{20.2582, -9999.00, 3.16157}, +{20.5858, -9999.00, 3.09935}, +{20.9188, -9999.00, 3.03835}, +{21.2571, -9999.00, 2.97856}, +{21.6009, -9999.00, 2.91994}, +{21.9503, -9999.00, 2.85252}, +{22.3053, -9999.00, 2.77514}, +{22.6661, -9999.00, 2.70011}, +{23.0327, -9999.00, 2.63220}, +{23.4053, -9999.00, 2.56600}, +{23.7838, -9999.00, 2.50147}, +{24.1685, -9999.00, 2.45410}, +{24.5594, -9999.00, 2.41143}, +{24.9566, -9999.00, 2.36950}, +{25.3603, -9999.00, 2.32636}, +{25.7705, -9999.00, 2.28436}, +{26.1873, -9999.00, 2.24311}, +{26.6109, -9999.00, 2.20261}, +{27.0413, -9999.00, 2.16284}, +{27.4786, -9999.00, 2.10127}, +{27.9231, -9999.00, 2.03232}, +{28.3747, -9999.00, 1.96563}, +{28.8337, -9999.00, 1.90113}, +{29.3000, 5.34593, 1.85597}, +{29.7739, 5.25702, 1.83279}, +{30.2555, 5.17173, 1.80990}, +{30.7449, 5.07046, 1.78835}, +{31.2421, 4.96377, 1.80095}, +{31.7475, 4.86692, 1.81365}, +{32.2609, 4.76006, 1.82643}, +{32.7827, 4.64394, 1.85448}, +{33.3130, 4.53278, 1.90243}, +{33.8518, 4.42660, 1.95162}, +{34.3993, 4.31744, 2.00208}, +{34.9557, 4.20105, 2.05384}, +{35.5211, 4.05589, 2.10860}, +{36.0956, 3.90249, 2.20934}, +{36.6794, 3.76549, 2.31489}, +{37.2727, 3.62047, 2.42549}, +{37.8755, 3.43543, 2.54136}, +{38.4882, 3.22796, 2.72027}, +{39.1107, 3.03960, 2.94825}, +{39.7432, 2.84620, 3.19535}, +{40.3861, 2.62105, 3.53118}, +{41.0393, 2.45167, 3.98741}, +{41.7031, 2.41724, 4.50259}, +{42.3776, 2.46188, 4.99383}, +{43.0630, 2.61901, 5.53762}, +{43.7595, 2.88305, 5.98055}, +{44.4673, 3.16390, 6.37082}, +{45.1865, 3.48900, 6.72872}, +{45.9174, 3.82533, 7.01991}, +{46.6600, 4.18153, 7.32370}, +{47.4147, 4.63608, 7.59502}, +{48.1816, 5.15312, 7.76336}, +{48.9609, 5.61764, 7.74378}, +{49.7528, 5.98795, 7.72426}, +{50.5576, 6.32329, 7.70479}, +{51.3753, 6.64216, 7.68537}, +{52.2062, 6.95383, 7.65587}, +{53.0506, 7.25710, 7.61964}, +{53.9087, 7.56202, 7.58357}, +{54.7806, 7.90577, 7.54768}, +{55.6667, 8.26579, 7.38536}, +{56.5670, 8.54688, 7.18592}, +{57.4820, 8.77045, 6.99185}, +{58.4117, 8.96621, 6.80303}, +{59.3564, 9.15533, 6.61931}, +{60.3165, 9.32005, 6.39919}, +{61.2921, 9.43236, 6.18624}, +{62.2834, 9.51170, 5.98039}, +{63.2908, 9.55780, 5.80479}, +{64.3145, 9.59663, 5.65760}, +{65.3547, 9.63381, 5.52309}, +{66.4118, 9.66939, 5.40679}, +{67.4859, 9.71030, 5.29293}, +{68.5775, 9.74740, 5.18148}, +{69.6867, 9.78008, 5.07237}, +{70.8138, 9.80759, 4.96556}, +{71.9591, 9.82938, 4.86100}, +{73.1230, 9.84564, 4.75864}, +{74.3057, 9.85380, 4.65361}, +{75.5076, 9.84883, 4.55006}, +{76.7289, 9.81599, 4.44882}, +{77.9699, 9.76180, 4.37791}, +{79.2310, 9.72161, 4.35426}, +{80.5125, 9.70329, 4.33074}, +{81.8147, 9.69256, 4.30734}, +{83.1380, 9.68539, 4.28407}, +{84.4827, 9.67917, 4.26093}, +{85.8491, 9.67205, 4.23790}, +{87.2377, 9.65019, 4.21501}, +{88.6487, 9.62458, 4.21946}, +{90.0825, 9.61894, 4.23455}, +{91.5395, 9.62209, 4.24969}, +{93.0201, 9.63112, 4.26488}, +{94.5246, 9.64460, 4.28013}, +{96.0535, 9.66165, 4.29543}, +{97.6071, 9.68165, 4.31079}, +{99.1858, 9.70413, 4.32621}, +{100.790, 9.72866, 4.34167}, +{102.420, 9.75481, 4.35720}, +{104.077, 9.78221, 4.37277}, +{105.760, 9.80685, 4.38841}, +{107.471, 9.83196, 4.41221}, +{109.209, 9.86498, 4.43993}, +{110.975, 9.90322, 4.46783}, +{112.770, 9.94598, 4.49590}, +{114.594, 9.99333, 4.52415}, +{116.448, 10.0459, 4.55258}, +{118.331, 10.1049, 4.58118}, +{120.245, 10.1805, 4.60766}, +{122.190, 10.2585, 4.60580}, +{124.166, 10.3197, 4.60394}, +{126.175, 10.3791, 4.60208}, +{128.215, 10.4367, 4.60023}, +{130.289, 10.4930, 4.59837}, +{132.397, 10.5487, 4.59652}, +{134.538, 10.6040, 4.59466}, +{136.714, 10.6596, 4.59275}, +{138.925, 10.7150, 4.58968}, +{141.172, 10.7697, 4.58662}, +{143.456, 10.8244, 4.58356}, +{145.776, 10.8793, 4.58050}, +{148.134, 10.9344, 4.57744}, +{150.530, 10.9899, 4.57438}, +{152.964, 11.0462, 4.57133}, +{155.439, 11.1034, 4.56828}, +{157.953, 11.1618, 4.56523}, +{160.507, 11.2222, 4.56218}, +{163.103, 11.2850, 4.55914}, +{165.742, 11.3586, 4.55609}, +{168.422, 11.4339, 4.53222}, +{171.146, 11.4954, 4.50800}, +{173.915, 11.5545, 4.48391}, +{176.727, 11.6115, 4.45996}, +{179.586, 11.6670, 4.43612}, +{182.491, 11.7216, 4.41242}, +{185.442, 11.7757, 4.38884}, +{188.442, 11.8302, 4.36539}, +{191.489, 11.8867, 4.34207}, +{194.587, 11.9496, 4.31460}, +{197.734, 12.0096, 4.27240}, +{200.932, 12.0578, 4.23059}, +{204.182, 12.1025, 4.18920}, +{207.485, 12.1439, 4.14821}, +{210.840, 12.1825, 4.10762}, +{214.251, 12.2185, 4.06744}, +{217.716, 12.2524, 4.02764}, +{221.237, 12.2843, 3.98823}, +{224.816, 12.3143, 3.94921}, +{228.452, 12.3428, 3.91057}, +{232.147, 12.3700, 3.87231}, +{235.902, 12.3967, 3.83442}, +{239.717, 12.4245, 3.79691}, +{243.595, 12.4511, 3.75039}, +{247.535, 12.4708, 3.70425}, +{251.538, 12.4866, 3.65866}, +{255.607, 12.4992, 3.61365}, +{259.741, 12.5088, 3.56918}, +{263.942, 12.5157, 3.52526}, +{268.211, 12.5200, 3.48188}, +{272.549, 12.5217, 3.43904}, +{276.957, 12.5211, 3.39672}, +{281.437, 12.5183, 3.35492}, +{285.989, 12.5138, 3.31365}, +{290.615, 12.5093, 3.27287}, +{295.315, 12.5041, 3.22483}, +{300.092, 12.4909, 3.17394}, +{304.945, 12.4706, 3.12385}, +{309.878, 12.4451, 3.07454}, +{314.890, 12.4146, 3.02602}, +{319.983, 12.3790, 2.97826}, +{325.158, 12.3383, 2.93126}, +{330.418, 12.2925, 2.88500}, +{335.762, 12.2412, 2.83947}, +{341.192, 12.1844, 2.79466}, +{346.711, 12.1218, 2.75056}, +{352.319, 12.0537, 2.70715}, +{358.017, 11.9797, 2.66177}, +{363.808, 11.8963, 2.61498}, +{369.692, 11.8026, 2.56900}, +{375.672, 11.6989, 2.52384}, +{381.748, 11.5844, 2.47947}, +{387.922, 11.4581, 2.43588}, +{394.197, 11.3189, 2.39306}, +{400.573, 11.1652, 2.35099}, +{407.052, 10.9955, 2.30966}, +{413.635, 10.8088, 2.26906}, +{420.326, 10.6004, 2.22163}, +{427.124, 10.3608, 2.17464}, +{434.032, 10.0876, 2.12864}, +{441.052, 9.77452, 2.08362}, +{448.186, 9.41175, 2.03955}, +{455.435, 8.98640, 1.99770}, +{462.802, 8.48336, 1.96436}, +{470.287, 7.87842, 1.93158}, +{477.894, 7.12309, 1.89934}, +{485.623, 6.13361, 1.86794}, +{493.478, 4.73516, 1.84039}, +{501.459, 2.43847, 1.81326}, +{509.570, -3.72361, 1.78653}, +{512.000, -18.0914, 1.77867}, +{512.200, -18.0749, 15.8717}, +{517.812, 0.321069, 15.6628}, +{526.187, 4.59015, 15.3600}, +{534.698, 6.85921, 15.0633}, +{543.346, 8.41194, 14.7722}, +{552.134, 9.58295, 14.4866}, +{561.065, 10.4908, 14.1915}, +{570.139, 11.1288, 13.9247}, +{579.361, 11.6369, 13.8658}, +{588.732, 12.1773, 13.8610}, +{598.254, 12.7201, 13.8909}, +{607.930, 13.2814, 13.9210}, +{617.763, 13.8571, 13.9511}, +{627.755, 14.4884, 13.9736}, +{637.908, 15.1664, 13.9009}, +{648.226, 15.8290, 13.6893}, +{658.711, 16.3808, 13.3909}, +{669.365, 16.8128, 13.0991}, +{680.191, 17.1886, 12.8422}, +{691.193, 17.5478, 12.6122}, +{702.372, 17.8961, 12.3914}, +{713.733, 18.2364, 12.1551}, +{725.277, 18.5471, 11.9101}, +{737.008, 18.8300, 11.6697}, +{748.928, 19.0941, 11.4339}, +{761.042, 19.3418, 11.2027}, +{773.351, 19.5762, 10.9754}, +{785.859, 19.7987, 10.7472}, +{798.570, 20.0049, 10.5194}, +{811.486, 20.1955, 10.2965}, +{824.611, 20.3743, 10.0786}, +{837.949, 20.5431, 9.86543}, +{851.502, 20.7027, 9.65540}, +{865.274, 20.8530, 9.44854}, +{879.269, 20.9942, 9.24501}, +{893.491, 21.1268, 9.04578}, +{907.943, 21.2524, 8.85086}, +{922.628, 21.3737, 8.66015}, +{937.551, 21.4894, 8.46752}, +{952.715, 21.5953, 8.27764}, +{968.124, 21.6937, 8.09071}, +{983.783, 21.7850, 7.90796}, +{999.695, 21.8705, 7.72935}, +{1015.86, 21.9508, 7.55481}, +{1032.29, 22.0272, 7.38414}, +{1048.99, 22.1004, 7.21460}, +{1065.96, 22.1675, 7.04604}, +{1083.20, 22.2279, 6.88141}, +{1100.72, 22.2836, 6.72063}, +{1118.52, 22.3351, 6.56361}, +{1136.61, 22.3827, 6.41028}, +{1155.00, 22.4268, 6.26051}, +{1173.68, 22.4676, 6.11422}, +{1192.66, 22.5054, 5.97140}, +{1211.95, 22.5407, 5.83188}, +{1231.55, 22.5740, 5.69560}, +{1251.47, 22.6055, 5.56125}, +{1271.72, 22.6344, 5.42881}, +{1292.29, 22.6602, 5.29799}, +{1313.19, 22.6825, 5.17025}, +{1334.43, 22.7024, 5.04557}, +{1356.01, 22.7199, 4.92388}, +{1377.94, 22.7355, 4.80517}, +{1400.23, 22.7493, 4.68929}, +{1422.88, 22.7615, 4.57614}, +{1445.89, 22.7726, 4.46588}, +{1469.28, 22.7829, 4.35772}, +{1493.04, 22.7928, 4.25132}, +{1517.19, 22.8013, 4.14452}, +{1541.73, 22.8058, 4.04004}, +{1566.67, 22.8084, 3.93824}, +{1592.01, 22.8095, 3.83887}, +{1617.76, 22.8090, 3.74202}, +{1643.92, 22.8072, 3.64769}, +{1670.51, 22.8044, 3.55565}, +{1697.53, 22.8006, 3.46595}, +{1724.99, 22.7961, 3.37856}, +{1752.89, 22.7912, 3.29215}, +{1781.24, 22.7847, 3.20755}, +{1810.05, 22.7769, 3.12482}, +{1839.32, 22.7680, 3.04420}, +{1869.07, 22.7581, 2.96563}, +{1899.30, 22.7474, 2.88906}, +{1930.02, 22.7359, 2.81448}, +{1961.24, 22.7237, 2.74185}, +{1992.96, 22.7108, 2.67118}, +{2025.20, 22.6976, 2.60304}, +{2057.95, 22.6847, 2.53546}, +{2091.24, 22.6708, 2.46935}, +{2125.06, 22.6562, 2.40491}, +{2159.43, 22.6410, 2.34206}, +{2194.36, 22.6253, 2.28078}, +{2229.85, 22.6091, 2.22100}, +{2265.92, 22.5924, 2.16273}, +{2302.57, 22.5754, 2.10592}, +{2339.81, 22.5579, 2.05053}, +{2377.66, 22.5400, 1.99651}, +{2416.11, 22.5217, 1.94386}, +{2455.19, 22.5031, 1.89256}, +{2494.90, 22.4841, 1.84254}, +{2535.26, 22.4647, 1.79378}, +{2576.26, 22.4450, 1.74627}, +{2617.93, 22.4249, 1.69998}, +{2660.27, 22.4045, 1.65485}, +{2703.30, 22.3838, 1.61086}, +{2747.03, 22.3627, 1.56802}, +{2791.46, 22.3413, 1.52627}, +{2836.61, 22.3195, 1.48559}, +{2882.49, 22.2974, 1.44595}, +{2929.11, 22.2749, 1.40731}, +{2976.48, 22.2519, 1.36968}, +{3024.63, 22.2286, 1.33303}, +{3073.55, 22.2048, 1.29730}, +{3123.26, 22.1805, 1.26250}, +{3173.78, 22.1558, 1.22862}, +{3225.11, 22.1306, 1.19561}, +{3277.27, 22.1048, 1.16346}, +{3330.28, 22.0783, 1.13209}, +{3384.15, 22.0512, 1.10158}, +{3438.88, 22.0235, 1.07186}, +{3494.50, 21.9949, 1.04289}, +{3551.02, 21.9655, 1.01467}, +{3608.46, 21.9352, 0.987196}, +{3666.82, 21.9038, 0.960439}, +{3726.13, 21.8714, 0.934373}, +{3786.40, 21.8377, 0.908980}, +{3847.64, 21.8026, 0.884244}, +{3909.87, 21.7659, 0.860151}, +{3973.11, 21.7275, 0.836701}, +{4037.38, 21.6872, 0.813824}, +{4102.68, 21.6447, 0.791591}, +{4169.03, 21.5997, 0.769884}, +{4236.46, 21.5517, 0.748762}, +{4304.98, 21.5005, 0.728215}, +{4374.62, 21.4455, 0.708158}, +{4445.37, 21.3859, 0.688645}, +{4517.27, 21.3210, 0.669615}, +{4590.33, 21.2497, 0.651120}, +{4664.58, 21.1706, 0.633056}, +{4740.03, 21.0819, 0.615488}, +{4816.69, 20.9811, 0.598402}, +{4894.60, 20.8645, 0.581709}, +{4973.77, 20.7269, 0.565464}, +{5054.21, 20.5597, 0.549642}, +{5135.96, 20.3484, 0.534231}, +{5219.03, 20.0652, 0.519220}, +{5303.44, 19.6446, 0.504591}, +{5389.22, 18.8588, 0.490341}, +{5465.00, 11.4907, 0.478268}, +{5465.20, 11.4913, 4.00981}, +{5476.39, 16.8218, 3.99813}, +{5564.97, 19.3555, 3.90769}, +{5654.98, 20.1337, 3.81866}, +{5746.44, 20.6185, 3.73073}, +{5839.39, 20.9733, 3.64405}, +{5933.83, 21.2532, 3.55863}, +{6029.81, 21.4838, 3.47450}, +{6127.33, 21.6793, 3.39162}, +{6226.44, 21.8483, 3.31010}, +{6327.15, 21.9965, 3.22992}, +{6429.48, 22.1277, 3.15113}, +{6533.48, 22.2450, 3.07367}, +{6639.15, 22.3504, 2.99756}, +{6746.54, 22.4456, 2.92291}, +{6855.65, 22.5321, 2.84969}, +{6966.54, 22.6108, 2.77778}, +{7079.22, 22.6825, 2.70728}, +{7193.72, 22.7482, 2.63821}, +{7310.07, 22.8083, 2.57047}, +{7428.31, 22.8634, 2.50417}, +{7548.45, 22.9140, 2.43925}, +{7670.54, 22.9604, 2.37565}, +{7794.61, 23.0031, 2.31346}, +{7920.68, 23.0424, 2.25257}, +{8048.79, 23.0784, 2.19300}, +{8178.98, 23.1115, 2.13478}, +{8311.26, 23.1418, 2.07784}, +{8445.69, 23.1697, 2.02216}, +{8582.29, 23.1951, 1.96779}, +{8721.11, 23.2184, 1.91465}, +{8862.16, 23.2397, 1.86275}, +{9005.50, 23.2591, 1.81215}, +{9151.16, 23.2767, 1.76262}, +{9299.17, 23.2927, 1.71434}, +{9449.58, 23.3072, 1.66719}, +{9602.42, 23.3202, 1.62121}, +{9757.73, 23.3319, 1.57638}, +{9915.55, 23.3423, 1.53265}, +{10075.9, 23.3517, 1.48997}, +{10238.9, 23.3599, 1.44835}, +{10404.5, 23.3670, 1.40777}, +{10572.8, 23.3733, 1.36822}, +{10743.8, 23.3786, 1.32967}, +{10917.6, 23.3831, 1.29210}, +{11094.2, 23.3868, 1.25550}, +{11273.6, 23.3898, 1.21984}, +{11455.9, 23.3921, 1.18511}, +{11641.2, 23.3938, 1.15128}, +{11829.5, 23.3949, 1.11834}, +{12020.8, 23.3954, 1.08626}, +{12215.3, 23.3954, 1.05503}, +{12412.8, 23.3949, 1.02463}, +{12613.6, 23.3940, 0.995038}, +{12817.6, 23.3927, 0.966240}, +{13025.0, 23.3910, 0.938214}, +{13235.6, 23.3889, 0.910946}, +{13449.7, 23.3865, 0.884416}, +{13667.2, 23.3838, 0.858606}, +{13888.3, 23.3808, 0.833500}, +{14112.9, 23.3775, 0.809081}, +{14341.2, 23.3740, 0.785334}, +{14573.1, 23.3703, 0.762239}, +{14808.9, 23.3664, 0.739784}, +{15048.4, 23.3623, 0.717951}, +{15291.8, 23.3580, 0.696726}, +{15539.1, 23.3536, 0.676092}, +{15790.4, 23.3490, 0.656036}, +{16045.8, 23.3444, 0.636542}, +{16305.4, 23.3396, 0.617596}, +{16569.1, 23.3347, 0.599186}, +{16837.1, 23.3297, 0.581295}, +{17109.4, 23.3247, 0.563912}, +{17386.1, 23.3195, 0.547023}, +{17667.4, 23.3144, 0.530616}, +{17953.1, 23.3091, 0.514677}, +{18243.5, 23.3039, 0.499194}, +{18538.6, 23.2986, 0.484155}, +{18838.4, 23.2933, 0.469549}, +{19143.1, 23.2880, 0.455364}, +{19452.7, 23.2826, 0.441589}, +{19767.4, 23.2773, 0.428212}, +{20087.1, 23.2720, 0.415224}, +{20412.0, 23.2666, 0.402612}, +{20742.1, 23.2613, 0.390369}, +{21077.6, 23.2560, 0.378481}, +{21418.5, 23.2508, 0.366942}, +{21765.0, 23.2455, 0.355741}, +{22117.0, 23.2403, 0.344868}, +{22474.7, 23.2351, 0.334315}, +{22838.2, 23.2300, 0.324072}, +{23207.6, 23.2249, 0.314131}, +{23583.0, 23.2198, 0.304484}, +{23964.4, 23.2148, 0.295123}, +{24352.0, 23.2098, 0.286038}, +{24745.9, 23.2049, 0.277224}, +{25146.2, 23.2000, 0.268672}, +{25552.9, 23.1952, 0.260374}, +{25966.2, 23.1904, 0.252324}, +{26386.1, 23.1857, 0.244513}, +{26812.9, 23.1811, 0.236937}, +{27246.6, 23.1765, 0.229588}, +{27687.3, 23.1720, 0.222459}, +{28135.1, 23.1675, 0.215544}, +{28590.2, 23.1631, 0.208837}, +{29052.6, 23.1588, 0.202332}, +{29522.5, 23.1551, 0.196023}, +{30000.0, 23.1485, 0.189905}, +{0, 0, 0} +}; + +e_fp_fdp cr[] = { /* Z = 24 */ +{10.0000, -9999.00, 1.05700}, +{10.1617, -9999.00, 1.10362}, +{10.3261, -9999.00, 1.15229}, +{10.4931, -9999.00, 1.20311}, +{10.6628, -9999.00, 1.25618}, +{10.8353, -9999.00, 1.31158}, +{11.0106, -9999.00, 1.36943}, +{11.1886, -9999.00, 1.42916}, +{11.3696, -9999.00, 1.48789}, +{11.5535, -9999.00, 1.54903}, +{11.7404, -9999.00, 1.61268}, +{11.9303, -9999.00, 1.67895}, +{12.1232, -9999.00, 1.74794}, +{12.3193, -9999.00, 1.81977}, +{12.5186, -9999.00, 1.89455}, +{12.7210, -9999.00, 1.97240}, +{12.9268, -9999.00, 2.05236}, +{13.1359, -9999.00, 2.13557}, +{13.3483, -9999.00, 2.22215}, +{13.5642, -9999.00, 2.31224}, +{13.7836, -9999.00, 2.40598}, +{14.0066, -9999.00, 2.50733}, +{14.2331, -9999.00, 2.62058}, +{14.4633, -9999.00, 2.73896}, +{14.6973, -9999.00, 2.86268}, +{14.9350, -9999.00, 2.99199}, +{15.1765, -9999.00, 3.08350}, +{15.4220, -9999.00, 3.16751}, +{15.6714, -9999.00, 3.25382}, +{15.9249, -9999.00, 3.34248}, +{16.1825, -9999.00, 3.43354}, +{16.4442, -9999.00, 3.52710}, +{16.7102, -9999.00, 3.59513}, +{16.9805, -9999.00, 3.66139}, +{17.2551, -9999.00, 3.72887}, +{17.5342, -9999.00, 3.79760}, +{17.8178, -9999.00, 3.86759}, +{18.1060, -9999.00, 3.92324}, +{18.3989, -9999.00, 3.95920}, +{18.6964, -9999.00, 3.99549}, +{18.9988, -9999.00, 4.03212}, +{19.3061, -9999.00, 4.06908}, +{19.6184, -9999.00, 4.09684}, +{19.9357, -9999.00, 4.11996}, +{20.2582, -9999.00, 4.14321}, +{20.5858, -9999.00, 4.16660}, +{20.9188, -9999.00, 4.19012}, +{21.2571, -9999.00, 4.21377}, +{21.6009, -9999.00, 4.22197}, +{21.9503, -9999.00, 4.21016}, +{22.3053, -9999.00, 4.19839}, +{22.6661, -9999.00, 4.18665}, +{23.0327, -9999.00, 4.17494}, +{23.4053, -9999.00, 4.16326}, +{23.7838, -9999.00, 4.09688}, +{24.1685, -9999.00, 4.02779}, +{24.5594, -9999.00, 3.95986}, +{24.9566, -9999.00, 3.89307}, +{25.3603, -9999.00, 3.82742}, +{25.7705, -9999.00, 3.76287}, +{26.1873, -9999.00, 3.69941}, +{26.6109, -9999.00, 3.60958}, +{27.0413, -9999.00, 3.49735}, +{27.4786, -9999.00, 3.38860}, +{27.9231, -9999.00, 3.28324}, +{28.3747, -9999.00, 3.18115}, +{28.8337, -9999.00, 3.08224}, +{29.3000, 5.94228, 2.99004}, +{29.7739, 5.92909, 2.90494}, +{30.2555, 5.91066, 2.82226}, +{30.7449, 5.88584, 2.74194}, +{31.2421, 5.85426, 2.66391}, +{31.7475, 5.81498, 2.58809}, +{32.2609, 5.76680, 2.51723}, +{32.7827, 5.71465, 2.45041}, +{33.3130, 5.65654, 2.38537}, +{33.8518, 5.59119, 2.32205}, +{34.3993, 5.51781, 2.26041}, +{34.9557, 5.43535, 2.19986}, +{35.5211, 5.34156, 2.14059}, +{36.0956, 5.23454, 2.08292}, +{36.6794, 5.11068, 2.02681}, +{37.2727, 4.95964, 1.97220}, +{37.8755, 4.78766, 1.95578}, +{38.4882, 4.61222, 1.94496}, +{39.1107, 4.41976, 1.95116}, +{39.7432, 4.20694, 1.96248}, +{40.3861, 3.97362, 2.02151}, +{41.0393, 3.73477, 2.08911}, +{41.7031, 3.45148, 2.17520}, +{42.3776, 3.15242, 2.32257}, +{43.0630, 2.79750, 2.47993}, +{43.7595, 2.38498, 2.84366}, +{44.4673, 2.08271, 3.32968}, +{45.1865, 1.87212, 3.89876}, +{45.9174, 1.78945, 4.56510}, +{46.6600, 1.99022, 5.31171}, +{47.4147, 2.28007, 5.65963}, +{48.1816, 2.49180, 6.03034}, +{48.9609, 2.71114, 6.42532}, +{49.7528, 3.03331, 6.79536}, +{50.5576, 3.33199, 7.05016}, +{51.3753, 3.61502, 7.31451}, +{52.2062, 3.92170, 7.58878}, +{53.0506, 4.31249, 7.82634}, +{53.9087, 4.66887, 7.96298}, +{54.7806, 5.00459, 8.10200}, +{55.6667, 5.34916, 8.24346}, +{56.5670, 5.74622, 8.38738}, +{57.4820, 6.19199, 8.39766}, +{58.4117, 6.56095, 8.36152}, +{59.3564, 6.89643, 8.32554}, +{60.3165, 7.24600, 8.28970}, +{61.2921, 7.57809, 8.15699}, +{62.2834, 7.85549, 8.02193}, +{63.2908, 8.09935, 7.88911}, +{64.3145, 8.32623, 7.75848}, +{65.3547, 8.55190, 7.63002}, +{66.4118, 8.76200, 7.45443}, +{67.4859, 8.92629, 7.27327}, +{68.5775, 9.05755, 7.09652}, +{69.6867, 9.15240, 6.92522}, +{70.8138, 9.23368, 6.79165}, +{71.9591, 9.31173, 6.66065}, +{73.1230, 9.37710, 6.53218}, +{74.3057, 9.41811, 6.40618}, +{75.5076, 9.44981, 6.32254}, +{76.7289, 9.49426, 6.24629}, +{77.9699, 9.54040, 6.17096}, +{79.2310, 9.58365, 6.09654}, +{80.5125, 9.61905, 6.02301}, +{81.8147, 9.63156, 5.96361}, +{83.1380, 9.65991, 5.92864}, +{84.4827, 9.69895, 5.89387}, +{85.8491, 9.74104, 5.85932}, +{87.2377, 9.78465, 5.82496}, +{88.6487, 9.82892, 5.79081}, +{90.0825, 9.87370, 5.75585}, +{91.5395, 9.91600, 5.71998}, +{93.0201, 9.95535, 5.68432}, +{94.5246, 9.99094, 5.64889}, +{96.0535, 10.0205, 5.61369}, +{97.6071, 10.0356, 5.57869}, +{99.1858, 10.0506, 5.57753}, +{100.790, 10.0773, 5.57754}, +{102.420, 10.1105, 5.57756}, +{104.077, 10.1454, 5.57757}, +{105.760, 10.1797, 5.57758}, +{107.471, 10.2062, 5.57760}, +{109.209, 10.2353, 5.60496}, +{110.975, 10.2786, 5.63469}, +{112.770, 10.3327, 5.66458}, +{114.594, 10.3946, 5.69462}, +{116.448, 10.4646, 5.72483}, +{118.331, 10.5453, 5.75519}, +{120.245, 10.6527, 5.77467}, +{122.190, 10.7479, 5.76624}, +{124.166, 10.8324, 5.75783}, +{126.175, 10.9144, 5.74942}, +{128.215, 10.9957, 5.74103}, +{130.289, 11.0781, 5.73265}, +{132.397, 11.1672, 5.72428}, +{134.538, 11.2537, 5.69934}, +{136.714, 11.3329, 5.67447}, +{138.925, 11.4084, 5.64972}, +{141.172, 11.4814, 5.62507}, +{143.456, 11.5523, 5.60052}, +{145.776, 11.6210, 5.57609}, +{148.134, 11.6855, 5.55414}, +{150.530, 11.7530, 5.53664}, +{152.964, 11.8225, 5.51919}, +{155.439, 11.8936, 5.50180}, +{157.953, 11.9667, 5.48446}, +{160.507, 12.0425, 5.46718}, +{163.103, 12.1227, 5.44995}, +{165.742, 12.2154, 5.43278}, +{168.422, 12.3185, 5.38959}, +{171.146, 12.4014, 5.32982}, +{173.915, 12.4721, 5.27070}, +{176.727, 12.5352, 5.21224}, +{179.586, 12.5919, 5.15443}, +{182.491, 12.6427, 5.09727}, +{185.442, 12.6869, 5.04073}, +{188.442, 12.7182, 4.98483}, +{191.489, 12.7453, 4.94959}, +{194.587, 12.7813, 4.92015}, +{197.734, 12.8212, 4.89088}, +{200.932, 12.8632, 4.86178}, +{204.182, 12.9066, 4.83286}, +{207.485, 12.9513, 4.80412}, +{210.840, 12.9977, 4.77554}, +{214.251, 13.0468, 4.74713}, +{217.716, 13.1045, 4.71436}, +{221.237, 13.1547, 4.66923}, +{224.816, 13.1992, 4.62453}, +{228.452, 13.2403, 4.58026}, +{232.147, 13.2787, 4.53640}, +{235.902, 13.3151, 4.49297}, +{239.717, 13.3497, 4.44996}, +{243.595, 13.3826, 4.40736}, +{247.535, 13.4142, 4.36517}, +{251.538, 13.4455, 4.32337}, +{255.607, 13.4751, 4.27973}, +{259.741, 13.5024, 4.23643}, +{263.942, 13.5281, 4.19356}, +{268.211, 13.5526, 4.15114}, +{272.549, 13.5762, 4.10913}, +{276.957, 13.5998, 4.06757}, +{281.437, 13.6254, 4.02641}, +{285.989, 13.6546, 3.97627}, +{290.615, 13.6753, 3.91967}, +{295.315, 13.6883, 3.86388}, +{300.092, 13.6971, 3.80888}, +{304.945, 13.7024, 3.75467}, +{309.878, 13.7052, 3.70108}, +{314.890, 13.7041, 3.64593}, +{319.983, 13.6990, 3.59160}, +{325.158, 13.6904, 3.53808}, +{330.418, 13.6788, 3.48536}, +{335.762, 13.6649, 3.43342}, +{341.192, 13.6502, 3.38225}, +{346.711, 13.6403, 3.32358}, +{352.319, 13.6177, 3.25457}, +{358.017, 13.5822, 3.18699}, +{363.808, 13.5385, 3.12082}, +{369.692, 13.4868, 3.05602}, +{375.672, 13.4271, 2.99257}, +{381.748, 13.3567, 2.93128}, +{387.922, 13.2802, 2.87576}, +{394.197, 13.1979, 2.82130}, +{400.573, 13.1076, 2.76786}, +{407.052, 13.0080, 2.71544}, +{413.635, 12.8961, 2.66401}, +{420.326, 12.7722, 2.62216}, +{427.124, 12.6426, 2.58535}, +{434.032, 12.5059, 2.54906}, +{441.052, 12.3581, 2.51328}, +{448.186, 12.1973, 2.47800}, +{455.435, 12.0211, 2.44321}, +{462.802, 11.8276, 2.40891}, +{470.287, 11.6128, 2.37331}, +{477.894, 11.3718, 2.33783}, +{485.623, 11.0998, 2.30288}, +{493.478, 10.7910, 2.26845}, +{501.459, 10.4372, 2.23369}, +{509.570, 10.0234, 2.19700}, +{517.812, 9.53189, 2.16092}, +{526.187, 8.93605, 2.12543}, +{534.698, 8.19279, 2.09052}, +{543.346, 7.22049, 2.05073}, +{552.134, 5.84898, 2.00951}, +{561.065, 3.63220, 1.96911}, +{570.139, -1.71588, 1.92952}, +{574.000, -19.0823, 1.91311}, +{574.200, -19.0554, 16.9731}, +{579.361, 0.236457, 16.6980}, +{588.732, 5.44090, 16.2158}, +{598.254, 8.01928, 15.7475}, +{607.930, 9.72452, 15.2927}, +{617.763, 10.9633, 14.8511}, +{627.755, 11.8856, 14.4222}, +{637.908, 12.5022, 14.0840}, +{648.226, 13.0405, 13.8947}, +{658.711, 13.5209, 13.7079}, +{669.365, 13.8513, 13.6002}, +{680.191, 14.2408, 13.6681}, +{691.193, 14.6876, 13.7363}, +{702.372, 15.1652, 13.8049}, +{713.733, 15.6739, 13.8739}, +{725.277, 16.2705, 13.9432}, +{737.008, 16.9638, 13.8818}, +{748.928, 17.5409, 13.6463}, +{761.042, 18.0269, 13.4147}, +{773.351, 18.4647, 13.1871}, +{785.859, 18.8693, 12.9633}, +{798.570, 19.2504, 12.7434}, +{811.486, 19.6154, 12.5271}, +{824.611, 19.9809, 12.3146}, +{837.949, 20.3728, 12.0750}, +{851.502, 20.7046, 11.7601}, +{865.274, 20.9807, 11.4535}, +{879.269, 21.2197, 11.1548}, +{893.491, 21.4210, 10.8640}, +{907.943, 21.5985, 10.6084}, +{922.628, 21.7721, 10.3697}, +{937.551, 21.9447, 10.1364}, +{952.715, 22.1159, 9.90832}, +{968.124, 22.2784, 9.66533}, +{983.783, 22.4209, 9.42121}, +{999.695, 22.5383, 9.18323}, +{1015.86, 22.6403, 8.96464}, +{1032.29, 22.7442, 8.76097}, +{1048.99, 22.8470, 8.55910}, +{1065.96, 22.9426, 8.35889}, +{1083.20, 23.0314, 8.16331}, +{1100.72, 23.1142, 7.97230}, +{1118.52, 23.1916, 7.78577}, +{1136.61, 23.2639, 7.60367}, +{1155.00, 23.3314, 7.42578}, +{1173.68, 23.3946, 7.25203}, +{1192.66, 23.4538, 7.08232}, +{1211.95, 23.5092, 6.91659}, +{1231.55, 23.5617, 6.75476}, +{1251.47, 23.6115, 6.59544}, +{1271.72, 23.6583, 6.43840}, +{1292.29, 23.7003, 6.28328}, +{1313.19, 23.7383, 6.13203}, +{1334.43, 23.7731, 5.98442}, +{1356.01, 23.8049, 5.84031}, +{1377.94, 23.8341, 5.69960}, +{1400.23, 23.8609, 5.56231}, +{1422.88, 23.8859, 5.42842}, +{1445.89, 23.9094, 5.29766}, +{1469.28, 23.9323, 5.16918}, +{1493.04, 23.9549, 5.04252}, +{1517.19, 23.9742, 4.91365}, +{1541.73, 23.9892, 4.78734}, +{1566.67, 24.0007, 4.66424}, +{1592.01, 24.0097, 4.54428}, +{1617.76, 24.0164, 4.42741}, +{1643.92, 24.0213, 4.31358}, +{1670.51, 24.0246, 4.20273}, +{1697.53, 24.0266, 4.09471}, +{1724.99, 24.0284, 3.98944}, +{1752.89, 24.0289, 3.88464}, +{1781.24, 24.0271, 3.78189}, +{1810.05, 24.0233, 3.68136}, +{1839.32, 24.0177, 3.58346}, +{1869.07, 24.0108, 3.48813}, +{1899.30, 24.0025, 3.39529}, +{1930.02, 23.9931, 3.30503}, +{1961.24, 23.9828, 3.21715}, +{1992.96, 23.9712, 3.13149}, +{2025.20, 23.9602, 3.04953}, +{2057.95, 23.9489, 2.96747}, +{2091.24, 23.9360, 2.88736}, +{2125.06, 23.9221, 2.80927}, +{2159.43, 23.9075, 2.73328}, +{2194.36, 23.8922, 2.65900}, +{2229.85, 23.8761, 2.58670}, +{2265.92, 23.8594, 2.51626}, +{2302.57, 23.8422, 2.44764}, +{2339.81, 23.8244, 2.38074}, +{2377.66, 23.8061, 2.31562}, +{2416.11, 23.7873, 2.25217}, +{2455.19, 23.7680, 2.19040}, +{2494.90, 23.7484, 2.13022}, +{2535.26, 23.7283, 2.07164}, +{2576.26, 23.7078, 2.01462}, +{2617.93, 23.6870, 1.95910}, +{2660.27, 23.6658, 1.90508}, +{2703.30, 23.6443, 1.85248}, +{2747.03, 23.6225, 1.80129}, +{2791.46, 23.6003, 1.75148}, +{2836.61, 23.5779, 1.70302}, +{2882.49, 23.5551, 1.65585}, +{2929.11, 23.5321, 1.60998}, +{2976.48, 23.5087, 1.56538}, +{3024.63, 23.4851, 1.52199}, +{3073.55, 23.4612, 1.47977}, +{3123.26, 23.4370, 1.43872}, +{3173.78, 23.4125, 1.39879}, +{3225.11, 23.3876, 1.35997}, +{3277.27, 23.3625, 1.32222}, +{3330.28, 23.3369, 1.28553}, +{3384.15, 23.3110, 1.24984}, +{3438.88, 23.2848, 1.21514}, +{3494.50, 23.2580, 1.18141}, +{3551.02, 23.2309, 1.14865}, +{3608.46, 23.2032, 1.11679}, +{3666.82, 23.1750, 1.08584}, +{3726.13, 23.1462, 1.05572}, +{3786.40, 23.1168, 1.02652}, +{3847.64, 23.0868, 0.998083}, +{3909.87, 23.0559, 0.970477}, +{3973.11, 23.0242, 0.943626}, +{4037.38, 22.9916, 0.917573}, +{4102.68, 22.9579, 0.892240}, +{4169.03, 22.9230, 0.867643}, +{4236.46, 22.8869, 0.843758}, +{4304.98, 22.8493, 0.820552}, +{4374.62, 22.8101, 0.797991}, +{4445.37, 22.7690, 0.776062}, +{4517.27, 22.7258, 0.754774}, +{4590.33, 22.6802, 0.734148}, +{4664.58, 22.6318, 0.714069}, +{4740.03, 22.5801, 0.694568}, +{4816.69, 22.5247, 0.675635}, +{4894.60, 22.4649, 0.657233}, +{4973.77, 22.3997, 0.639384}, +{5054.21, 22.3282, 0.622042}, +{5135.96, 22.2489, 0.605222}, +{5219.03, 22.1598, 0.588872}, +{5303.44, 22.0584, 0.573005}, +{5389.22, 21.9407, 0.557598}, +{5476.39, 21.8010, 0.542637}, +{5564.97, 21.6299, 0.528113}, +{5654.98, 21.4109, 0.514006}, +{5746.44, 21.1106, 0.500319}, +{5839.39, 20.6438, 0.487031}, +{5933.83, 19.6430, 0.474127}, +{5989.10, 12.9181, 0.466827}, +{5989.30, 12.9188, 3.84485}, +{6029.81, 19.4157, 3.80769}, +{6127.33, 20.8006, 3.72069}, +{6226.44, 21.4313, 3.63494}, +{6327.15, 21.8497, 3.55039}, +{6429.48, 22.1641, 3.46704}, +{6533.48, 22.4157, 3.38494}, +{6639.15, 22.6249, 3.30411}, +{6746.54, 22.8033, 3.22458}, +{6855.65, 22.9580, 3.14646}, +{6966.54, 23.0941, 3.06960}, +{7079.22, 23.2149, 2.99403}, +{7193.72, 23.3229, 2.91988}, +{7310.07, 23.4201, 2.84713}, +{7428.31, 23.5080, 2.77573}, +{7548.45, 23.5878, 2.70561}, +{7670.54, 23.6604, 2.63695}, +{7794.61, 23.7267, 2.56957}, +{7920.68, 23.7872, 2.50359}, +{8048.79, 23.8426, 2.43897}, +{8178.98, 23.8935, 2.37572}, +{8311.26, 23.9401, 2.31377}, +{8445.69, 23.9829, 2.25320}, +{8582.29, 24.0222, 2.19383}, +{8721.11, 24.0582, 2.13579}, +{8862.16, 24.0913, 2.07909}, +{9005.50, 24.1217, 2.02361}, +{9151.16, 24.1495, 1.96941}, +{9299.17, 24.1750, 1.91639}, +{9449.58, 24.1982, 1.86463}, +{9602.42, 24.2194, 1.81416}, +{9757.73, 24.2388, 1.76483}, +{9915.55, 24.2564, 1.71658}, +{10075.9, 24.2724, 1.66954}, +{10238.9, 24.2868, 1.62365}, +{10404.5, 24.2999, 1.57886}, +{10572.8, 24.3116, 1.53517}, +{10743.8, 24.3220, 1.49256}, +{10917.6, 24.3313, 1.45100}, +{11094.2, 24.3396, 1.41047}, +{11273.6, 24.3468, 1.37097}, +{11455.9, 24.3530, 1.33246}, +{11641.2, 24.3584, 1.29493}, +{11829.5, 24.3630, 1.25835}, +{12020.8, 24.3668, 1.22272}, +{12215.3, 24.3698, 1.18800}, +{12412.8, 24.3722, 1.15419}, +{12613.6, 24.3740, 1.12126}, +{12817.6, 24.3751, 1.08919}, +{13025.0, 24.3758, 1.05796}, +{13235.6, 24.3759, 1.02756}, +{13449.7, 24.3755, 0.997965}, +{13667.2, 24.3748, 0.969160}, +{13888.3, 24.3735, 0.941126}, +{14112.9, 24.3720, 0.913845}, +{14341.2, 24.3700, 0.887300}, +{14573.1, 24.3678, 0.861474}, +{14808.9, 24.3652, 0.836350}, +{15048.4, 24.3623, 0.811911}, +{15291.8, 24.3592, 0.788142}, +{15539.1, 24.3559, 0.765025}, +{15790.4, 24.3523, 0.742545}, +{16045.8, 24.3486, 0.720686}, +{16305.4, 24.3446, 0.699433}, +{16569.1, 24.3405, 0.678772}, +{16837.1, 24.3363, 0.658686}, +{17109.4, 24.3319, 0.639163}, +{17386.1, 24.3274, 0.620187}, +{17667.4, 24.3228, 0.601744}, +{17953.1, 24.3180, 0.583822}, +{18243.5, 24.3132, 0.566407}, +{18538.6, 24.3084, 0.549485}, +{18838.4, 24.3034, 0.533044}, +{19143.1, 24.2984, 0.517072}, +{19452.7, 24.2934, 0.501556}, +{19767.4, 24.2883, 0.486483}, +{20087.1, 24.2832, 0.471843}, +{20412.0, 24.2780, 0.457624}, +{20742.1, 24.2729, 0.443815}, +{21077.6, 24.2677, 0.430403}, +{21418.5, 24.2626, 0.417381}, +{21765.0, 24.2574, 0.404735}, +{22117.0, 24.2522, 0.392457}, +{22474.7, 24.2471, 0.380537}, +{22838.2, 24.2419, 0.368964}, +{23207.6, 24.2368, 0.357729}, +{23583.0, 24.2318, 0.346822}, +{23964.4, 24.2267, 0.336236}, +{24352.0, 24.2217, 0.325960}, +{24745.9, 24.2167, 0.315987}, +{25146.2, 24.2117, 0.306308}, +{25552.9, 24.2068, 0.296914}, +{25966.2, 24.2020, 0.287798}, +{26386.1, 24.1971, 0.278952}, +{26812.9, 24.1924, 0.270369}, +{27246.6, 24.1876, 0.262040}, +{27687.3, 24.1830, 0.253960}, +{28135.1, 24.1784, 0.246119}, +{28590.2, 24.1738, 0.238513}, +{29052.6, 24.1694, 0.231135}, +{29522.5, 24.1656, 0.223976}, +{30000.0, 24.1584, 0.217033}, +{0, 0, 0} +}; + +} // namespace table_data + +}}} // namespace cctbx::eltbx::henke diff --git a/extern/cctbx/cctbx/eltbx/henke_tables_25_36.cpp b/extern/cctbx/cctbx/eltbx/henke_tables_25_36.cpp new file mode 100644 index 00000000..df8e5786 --- /dev/null +++ b/extern/cctbx/cctbx/eltbx/henke_tables_25_36.cpp @@ -0,0 +1,6130 @@ +/* ***************************************************** + THIS IS AN AUTOMATICALLY GENERATED FILE. DO NOT EDIT. + ***************************************************** + + Generated by: + cctbx.source_generators.eltbx.generate_henke_cpp + */ + +#include + +namespace cctbx { namespace eltbx { namespace henke { + +namespace table_data { + +using anomalous::e_fp_fdp; + +e_fp_fdp mn[] = { /* Z = 25 */ +{10.0000, -9999.00, 1.88990}, +{10.1617, -9999.00, 1.92644}, +{10.3261, -9999.00, 1.96368}, +{10.4931, -9999.00, 2.00165}, +{10.6628, -9999.00, 2.04035}, +{10.8353, -9999.00, 2.07980}, +{11.0106, -9999.00, 2.12001}, +{11.1886, -9999.00, 2.16100}, +{11.3696, -9999.00, 2.20278}, +{11.5535, -9999.00, 2.24537}, +{11.7404, -9999.00, 2.28879}, +{11.9303, -9999.00, 2.33304}, +{12.1232, -9999.00, 2.37676}, +{12.3193, -9999.00, 2.42130}, +{12.5186, -9999.00, 2.46667}, +{12.7210, -9999.00, 2.51289}, +{12.9268, -9999.00, 2.55998}, +{13.1359, -9999.00, 2.60796}, +{13.3483, -9999.00, 2.65683}, +{13.5642, -9999.00, 2.70662}, +{13.7836, -9999.00, 2.75734}, +{14.0066, -9999.00, 2.80901}, +{14.2331, -9999.00, 2.86165}, +{14.4633, -9999.00, 2.91527}, +{14.6973, -9999.00, 2.96991}, +{14.9350, -9999.00, 3.02556}, +{15.1765, -9999.00, 3.08226}, +{15.4220, -9999.00, 3.14002}, +{15.6714, -9999.00, 3.19886}, +{15.9249, -9999.00, 3.25880}, +{16.1825, -9999.00, 3.31987}, +{16.4442, -9999.00, 3.38209}, +{16.7102, -9999.00, 3.44217}, +{16.9805, -9999.00, 3.48884}, +{17.2551, -9999.00, 3.53615}, +{17.5342, -9999.00, 3.58409}, +{17.8178, -9999.00, 3.63268}, +{18.1060, -9999.00, 3.68194}, +{18.3989, -9999.00, 3.73186}, +{18.6964, -9999.00, 3.78246}, +{18.9988, -9999.00, 3.83374}, +{19.3061, -9999.00, 3.85544}, +{19.6184, -9999.00, 3.87253}, +{19.9357, -9999.00, 3.88970}, +{20.2582, -9999.00, 3.90694}, +{20.5858, -9999.00, 3.92427}, +{20.9188, -9999.00, 3.94166}, +{21.2571, -9999.00, 3.95914}, +{21.6009, -9999.00, 3.97669}, +{21.9503, -9999.00, 3.99432}, +{22.3053, -9999.00, 4.01203}, +{22.6661, -9999.00, 4.00030}, +{23.0327, -9999.00, 3.97304}, +{23.4053, -9999.00, 3.94596}, +{23.7838, -9999.00, 3.91906}, +{24.1685, -9999.00, 3.89235}, +{24.5594, -9999.00, 3.86582}, +{24.9566, -9999.00, 3.83947}, +{25.3603, -9999.00, 3.81330}, +{25.7705, -9999.00, 3.78323}, +{26.1873, -9999.00, 3.72987}, +{26.6109, -9999.00, 3.67726}, +{27.0413, -9999.00, 3.62539}, +{27.4786, -9999.00, 3.57425}, +{27.9231, -9999.00, 3.52383}, +{28.3747, -9999.00, 3.47413}, +{28.8337, -9999.00, 3.42513}, +{29.3000, 6.50240, 3.37693}, +{29.7739, 6.52171, 3.32983}, +{30.2555, 6.53714, 3.28339}, +{30.7449, 6.54862, 3.23759}, +{31.2421, 6.55611, 3.19243}, +{31.7475, 6.55952, 3.14791}, +{32.2609, 6.55870, 3.10400}, +{32.7827, 6.55342, 3.06070}, +{33.3130, 6.54314, 3.01801}, +{33.8518, 6.52639, 2.97690}, +{34.3993, 6.50655, 2.94108}, +{34.9557, 6.48445, 2.90568}, +{35.5211, 6.45900, 2.87072}, +{36.0956, 6.42978, 2.83618}, +{36.6794, 6.39724, 2.80205}, +{37.2727, 6.36467, 2.76833}, +{37.8755, 6.32496, 2.71646}, +{38.4882, 6.26729, 2.66435}, +{39.1107, 6.19462, 2.61324}, +{39.7432, 6.10733, 2.56311}, +{40.3861, 6.00368, 2.51394}, +{41.0393, 5.88056, 2.46597}, +{41.7031, 5.73569, 2.42140}, +{42.3776, 5.56396, 2.37764}, +{43.0630, 5.35416, 2.33467}, +{43.7595, 5.07923, 2.30245}, +{44.4673, 4.77170, 2.33906}, +{45.1865, 4.41786, 2.37625}, +{45.9174, 3.93173, 2.41403}, +{46.6600, 3.29552, 2.74470}, +{47.4147, 2.77858, 3.25644}, +{48.1816, 2.27583, 3.86359}, +{48.9609, 1.63500, 4.58393}, +{49.7528, 1.15257, 6.20992}, +{50.5576, 2.00701, 8.36740}, +{51.3753, 3.27730, 8.94377}, +{52.2062, 4.50051, 9.43837}, +{53.0506, 5.54117, 9.46000}, +{53.9087, 6.51927, 9.37570}, +{54.7806, 7.24311, 9.05133}, +{55.6667, 7.77471, 8.73819}, +{56.5670, 8.20129, 8.43393}, +{57.4820, 8.54735, 8.13930}, +{58.4117, 8.82762, 7.85497}, +{59.3564, 9.04566, 7.58057}, +{60.3165, 9.19693, 7.35293}, +{61.2921, 9.35392, 7.16484}, +{62.2834, 9.50102, 6.98157}, +{63.2908, 9.63326, 6.80299}, +{64.3145, 9.74965, 6.62897}, +{65.3547, 9.84953, 6.45940}, +{66.4118, 9.92971, 6.29418}, +{67.4859, 9.99262, 6.14892}, +{68.5775, 10.0529, 6.01221}, +{69.6867, 10.1062, 5.87852}, +{70.8138, 10.1490, 5.74781}, +{71.9591, 10.1789, 5.62000}, +{73.1230, 10.1882, 5.49504}, +{74.3057, 10.1626, 5.40548}, +{75.5076, 10.1630, 5.34635}, +{76.7289, 10.1765, 5.28786}, +{77.9699, 10.1918, 5.23001}, +{79.2310, 10.2061, 5.17280}, +{80.5125, 10.2159, 5.11620}, +{81.8147, 10.2108, 5.06786}, +{83.1380, 10.2151, 5.03821}, +{84.4827, 10.2270, 5.00872}, +{85.8491, 10.2406, 4.97940}, +{87.2377, 10.2544, 4.95026}, +{88.6487, 10.2672, 4.92129}, +{90.0825, 10.2779, 4.89248}, +{91.5395, 10.2851, 4.86385}, +{93.0201, 10.2872, 4.83538}, +{94.5246, 10.2798, 4.80708}, +{96.0535, 10.2462, 4.77895}, +{97.6071, 10.2127, 4.80833}, +{99.1858, 10.2050, 4.84354}, +{100.790, 10.2096, 4.87899}, +{102.420, 10.2222, 4.91472}, +{104.077, 10.2407, 4.95070}, +{105.760, 10.2640, 4.98695}, +{107.471, 10.2914, 5.02345}, +{109.209, 10.3222, 5.06023}, +{110.975, 10.3557, 5.09728}, +{112.770, 10.3922, 5.13662}, +{114.594, 10.4327, 5.17671}, +{116.448, 10.4770, 5.21712}, +{118.331, 10.5246, 5.25785}, +{120.245, 10.5756, 5.29889}, +{122.190, 10.6300, 5.34025}, +{124.166, 10.6880, 5.38194}, +{126.175, 10.7501, 5.42395}, +{128.215, 10.8173, 5.46629}, +{130.289, 10.8934, 5.50660}, +{132.397, 10.9691, 5.53684}, +{134.538, 11.0440, 5.56727}, +{136.714, 11.1200, 5.59785}, +{138.925, 11.1983, 5.62860}, +{141.172, 11.2796, 5.65952}, +{143.456, 11.3650, 5.69061}, +{145.776, 11.4562, 5.72187}, +{148.134, 11.5578, 5.75331}, +{150.530, 11.6820, 5.76483}, +{152.964, 11.7888, 5.75371}, +{155.439, 11.8822, 5.74262}, +{157.953, 11.9713, 5.73156}, +{160.507, 12.0571, 5.72051}, +{163.103, 12.1406, 5.70948}, +{165.742, 12.2225, 5.69848}, +{168.422, 12.3032, 5.68750}, +{171.146, 12.3832, 5.67653}, +{173.915, 12.4631, 5.66559}, +{176.727, 12.5456, 5.65301}, +{179.586, 12.6252, 5.63644}, +{182.491, 12.7020, 5.61993}, +{185.442, 12.7777, 5.60345}, +{188.442, 12.8524, 5.58703}, +{191.489, 12.9267, 5.57066}, +{194.587, 13.0006, 5.55434}, +{197.734, 13.0749, 5.53806}, +{200.932, 13.1493, 5.52017}, +{204.182, 13.2229, 5.50172}, +{207.485, 13.2958, 5.48333}, +{210.840, 13.3688, 5.46500}, +{214.251, 13.4421, 5.44674}, +{217.716, 13.5160, 5.42853}, +{221.237, 13.5909, 5.41039}, +{224.816, 13.6674, 5.39230}, +{228.452, 13.7462, 5.37429}, +{232.147, 13.8285, 5.35632}, +{235.902, 13.9169, 5.33842}, +{239.717, 14.0201, 5.32057}, +{243.595, 14.1372, 5.26706}, +{247.535, 14.2320, 5.19443}, +{251.538, 14.3082, 5.12280}, +{255.607, 14.3761, 5.05216}, +{259.741, 14.4375, 4.98249}, +{263.942, 14.4935, 4.91378}, +{268.211, 14.5450, 4.84602}, +{272.549, 14.5924, 4.77920}, +{276.957, 14.6364, 4.71329}, +{281.437, 14.6775, 4.64830}, +{285.989, 14.7164, 4.58420}, +{290.615, 14.7552, 4.52098}, +{295.315, 14.7921, 4.45086}, +{300.092, 14.8219, 4.37922}, +{304.945, 14.8455, 4.30873}, +{309.878, 14.8647, 4.23938}, +{314.890, 14.8799, 4.17114}, +{319.983, 14.8912, 4.10400}, +{325.158, 14.8990, 4.03795}, +{330.418, 14.9032, 3.97296}, +{335.762, 14.9039, 3.90901}, +{341.192, 14.9012, 3.84609}, +{346.711, 14.8952, 3.78419}, +{352.319, 14.8859, 3.72328}, +{358.017, 14.8731, 3.66298}, +{363.808, 14.8567, 3.60350}, +{369.692, 14.8364, 3.54499}, +{375.672, 14.8125, 3.48742}, +{381.748, 14.7847, 3.43080}, +{387.922, 14.7531, 3.37508}, +{394.197, 14.7176, 3.32028}, +{400.573, 14.6781, 3.26636}, +{407.052, 14.6348, 3.21332}, +{413.635, 14.5880, 3.16114}, +{420.326, 14.5430, 3.10587}, +{427.124, 14.4869, 3.04259}, +{434.032, 14.4186, 2.98059}, +{441.052, 14.3412, 2.91986}, +{448.186, 14.2546, 2.86037}, +{455.435, 14.1583, 2.80209}, +{462.802, 14.0517, 2.74500}, +{470.287, 13.9336, 2.68907}, +{477.894, 13.8010, 2.63428}, +{485.623, 13.6546, 2.58600}, +{493.478, 13.4977, 2.54166}, +{501.459, 13.3272, 2.49807}, +{509.570, 13.1399, 2.45524}, +{517.812, 12.9329, 2.41314}, +{526.187, 12.7025, 2.37176}, +{534.698, 12.4439, 2.33115}, +{543.346, 12.1526, 2.29292}, +{552.134, 11.8220, 2.25534}, +{561.065, 11.4414, 2.21646}, +{570.139, 10.9950, 2.17739}, +{579.361, 10.4620, 2.13934}, +{588.732, 9.81100, 2.10212}, +{598.254, 8.98789, 2.06565}, +{607.930, 7.89160, 2.02981}, +{617.763, 6.29719, 1.99460}, +{627.755, 3.50844, 1.95999}, +{637.908, -8.42761, 1.92599}, +{638.600, -18.0574, 1.92371}, +{638.800, -18.0426, 16.5984}, +{648.226, 3.56736, 16.3194}, +{658.711, 7.25819, 16.0192}, +{669.365, 9.41955, 15.7245}, +{680.191, 10.9601, 15.4352}, +{691.193, 12.1550, 15.1512}, +{702.372, 13.1261, 14.8725}, +{713.733, 13.9327, 14.5870}, +{725.277, 14.6093, 14.2976}, +{737.008, 15.0046, 13.9670}, +{748.928, 15.2444, 13.9671}, +{761.042, 15.6958, 14.2068}, +{773.351, 16.3817, 14.4506}, +{785.859, 17.2721, 14.3998}, +{798.570, 18.0296, 14.1050}, +{811.486, 18.5918, 13.7795}, +{824.611, 19.0745, 13.4617}, +{837.949, 19.4896, 13.1513}, +{851.502, 19.8572, 12.8610}, +{865.274, 20.1883, 12.5903}, +{879.269, 20.4999, 12.3369}, +{893.491, 20.7973, 12.0887}, +{907.943, 21.0774, 11.8456}, +{922.628, 21.3469, 11.6073}, +{937.551, 21.6002, 11.3636}, +{952.715, 21.8356, 11.1225}, +{968.124, 22.0546, 10.8843}, +{983.783, 22.2591, 10.6513}, +{999.695, 22.4516, 10.4227}, +{1015.86, 22.6350, 10.1985}, +{1032.29, 22.8080, 9.97462}, +{1048.99, 22.9709, 9.75224}, +{1065.96, 23.1213, 9.53120}, +{1083.20, 23.2594, 9.31505}, +{1100.72, 23.3881, 9.10383}, +{1118.52, 23.5081, 8.89743}, +{1136.61, 23.6204, 8.69577}, +{1155.00, 23.7256, 8.49864}, +{1173.68, 23.8242, 8.30594}, +{1192.66, 23.9168, 8.11769}, +{1211.95, 24.0040, 7.93370}, +{1231.55, 24.0872, 7.75385}, +{1251.47, 24.1660, 7.57626}, +{1271.72, 24.2403, 7.40089}, +{1292.29, 24.3087, 7.22735}, +{1313.19, 24.3709, 7.05785}, +{1334.43, 24.4285, 6.89231}, +{1356.01, 24.4820, 6.73065}, +{1377.94, 24.5316, 6.57273}, +{1400.23, 24.5777, 6.41852}, +{1422.88, 24.6208, 6.26798}, +{1445.89, 24.6616, 6.12099}, +{1469.28, 24.7002, 5.97676}, +{1493.04, 24.7380, 5.83489}, +{1517.19, 24.7721, 5.69216}, +{1541.73, 24.8012, 5.55236}, +{1566.67, 24.8268, 5.41601}, +{1592.01, 24.8496, 5.28314}, +{1617.76, 24.8700, 5.15347}, +{1643.92, 24.8881, 5.02684}, +{1670.51, 24.9043, 4.90343}, +{1697.53, 24.9191, 4.78310}, +{1724.99, 24.9338, 4.66575}, +{1752.89, 24.9470, 4.54758}, +{1781.24, 24.9573, 4.43117}, +{1810.05, 24.9644, 4.31685}, +{1839.32, 24.9690, 4.20548}, +{1869.07, 24.9715, 4.09702}, +{1899.30, 24.9723, 3.99146}, +{1930.02, 24.9718, 3.88854}, +{1961.24, 24.9700, 3.78823}, +{1992.96, 24.9662, 3.69045}, +{2025.20, 24.9631, 3.59707}, +{2057.95, 24.9596, 3.50268}, +{2091.24, 24.9542, 3.41037}, +{2125.06, 24.9471, 3.32011}, +{2159.43, 24.9388, 3.23221}, +{2194.36, 24.9296, 3.14640}, +{2229.85, 24.9194, 3.06252}, +{2265.92, 24.9081, 2.98070}, +{2302.57, 24.8960, 2.90088}, +{2339.81, 24.8831, 2.82302}, +{2377.66, 24.8693, 2.74705}, +{2416.11, 24.8548, 2.67300}, +{2455.19, 24.8397, 2.60077}, +{2494.90, 24.8238, 2.53038}, +{2535.26, 24.8074, 2.46175}, +{2576.26, 24.7903, 2.39486}, +{2617.93, 24.7728, 2.32969}, +{2660.27, 24.7547, 2.26618}, +{2703.30, 24.7361, 2.20433}, +{2747.03, 24.7170, 2.14406}, +{2791.46, 24.6975, 2.08536}, +{2836.61, 24.6776, 2.02820}, +{2882.49, 24.6573, 1.97256}, +{2929.11, 24.6366, 1.91837}, +{2976.48, 24.6155, 1.86562}, +{3024.63, 24.5941, 1.81427}, +{3073.55, 24.5724, 1.76427}, +{3123.26, 24.5503, 1.71563}, +{3173.78, 24.5278, 1.66829}, +{3225.11, 24.5050, 1.62224}, +{3277.27, 24.4820, 1.57744}, +{3330.28, 24.4585, 1.53385}, +{3384.15, 24.4348, 1.49147}, +{3438.88, 24.4107, 1.45022}, +{3494.50, 24.3863, 1.41011}, +{3551.02, 24.3616, 1.37110}, +{3608.46, 24.3364, 1.33316}, +{3666.82, 24.3109, 1.29628}, +{3726.13, 24.2850, 1.26044}, +{3786.40, 24.2586, 1.22557}, +{3847.64, 24.2318, 1.19169}, +{3909.87, 24.2045, 1.15878}, +{3973.11, 24.1767, 1.12676}, +{4037.38, 24.1483, 1.09562}, +{4102.68, 24.1192, 1.06540}, +{4169.03, 24.0895, 1.03601}, +{4236.46, 24.0590, 1.00747}, +{4304.98, 24.0278, 0.979721}, +{4374.62, 23.9956, 0.952745}, +{4445.37, 23.9624, 0.926585}, +{4517.27, 23.9281, 0.901138}, +{4590.33, 23.8925, 0.876412}, +{4664.58, 23.8556, 0.852412}, +{4740.03, 23.8171, 0.829086}, +{4816.69, 23.7768, 0.806453}, +{4894.60, 23.7345, 0.784456}, +{4973.77, 23.6900, 0.763123}, +{5054.21, 23.6428, 0.742345}, +{5135.96, 23.5925, 0.722213}, +{5219.03, 23.5388, 0.702659}, +{5303.44, 23.4810, 0.683674}, +{5389.22, 23.4182, 0.665236}, +{5476.39, 23.3496, 0.647339}, +{5564.97, 23.2739, 0.629964}, +{5654.98, 23.1894, 0.613093}, +{5746.44, 23.0938, 0.596717}, +{5839.39, 22.9840, 0.580824}, +{5933.83, 22.8551, 0.565389}, +{6029.81, 22.6997, 0.550414}, +{6127.33, 22.5053, 0.535881}, +{6226.44, 22.2484, 0.521775}, +{6327.15, 21.8761, 0.508081}, +{6429.48, 21.2225, 0.494788}, +{6533.48, 18.0825, 0.481891}, +{6538.90, 13.7573, 0.481234}, +{6539.10, 13.7578, 3.87590}, +{6639.15, 21.3097, 3.79170}, +{6746.54, 22.1537, 3.70472}, +{6855.65, 22.6533, 3.61897}, +{6966.54, 23.0114, 3.53438}, +{7079.22, 23.2908, 3.45107}, +{7193.72, 23.5195, 3.36899}, +{7310.07, 23.7123, 3.28831}, +{7428.31, 23.8785, 3.20892}, +{7548.45, 24.0236, 3.13076}, +{7670.54, 24.1519, 3.05404}, +{7794.61, 24.2663, 2.97871}, +{7920.68, 24.3690, 2.90471}, +{8048.79, 24.4617, 2.83205}, +{8178.98, 24.5456, 2.76082}, +{8311.26, 24.6219, 2.69094}, +{8445.69, 24.6915, 2.62248}, +{8582.29, 24.7550, 2.55531}, +{8721.11, 24.8132, 2.48948}, +{8862.16, 24.8664, 2.42505}, +{9005.50, 24.9152, 2.36203}, +{9151.16, 24.9600, 2.30031}, +{9299.17, 25.0011, 2.23986}, +{9449.58, 25.0389, 2.18076}, +{9602.42, 25.0735, 2.12295}, +{9757.73, 25.1052, 2.06653}, +{9915.55, 25.1344, 2.01123}, +{10075.9, 25.1611, 1.95725}, +{10238.9, 25.1855, 1.90452}, +{10404.5, 25.2078, 1.85300}, +{10572.8, 25.2281, 1.80269}, +{10743.8, 25.2466, 1.75357}, +{10917.6, 25.2634, 1.70562}, +{11094.2, 25.2786, 1.65882}, +{11273.6, 25.2924, 1.61315}, +{11455.9, 25.3048, 1.56859}, +{11641.2, 25.3158, 1.52512}, +{11829.5, 25.3257, 1.48273}, +{12020.8, 25.3345, 1.44138}, +{12215.3, 25.3422, 1.40108}, +{12412.8, 25.3489, 1.36178}, +{12613.6, 25.3547, 1.32349}, +{12817.6, 25.3597, 1.28616}, +{13025.0, 25.3638, 1.24980}, +{13235.6, 25.3672, 1.21436}, +{13449.7, 25.3699, 1.17985}, +{13667.2, 25.3719, 1.14623}, +{13888.3, 25.3734, 1.11349}, +{14112.9, 25.3742, 1.08161}, +{14341.2, 25.3746, 1.05057}, +{14573.1, 25.3744, 1.02036}, +{14808.9, 25.3738, 0.990942}, +{15048.4, 25.3728, 0.962313}, +{15291.8, 25.3713, 0.934454}, +{15539.1, 25.3695, 0.907344}, +{15790.4, 25.3674, 0.880966}, +{16045.8, 25.3649, 0.855305}, +{16305.4, 25.3622, 0.830341}, +{16569.1, 25.3591, 0.806060}, +{16837.1, 25.3559, 0.782444}, +{17109.4, 25.3524, 0.759478}, +{17386.1, 25.3486, 0.737146}, +{17667.4, 25.3447, 0.715431}, +{17953.1, 25.3407, 0.694320}, +{18243.5, 25.3364, 0.673796}, +{18538.6, 25.3321, 0.653846}, +{18838.4, 25.3276, 0.634455}, +{19143.1, 25.3229, 0.615608}, +{19452.7, 25.3182, 0.597292}, +{19767.4, 25.3134, 0.579493}, +{20087.1, 25.3085, 0.562198}, +{20412.0, 25.3036, 0.545393}, +{20742.1, 25.2985, 0.529067}, +{21077.6, 25.2935, 0.513206}, +{21418.5, 25.2883, 0.497799}, +{21765.0, 25.2832, 0.482833}, +{22117.0, 25.2780, 0.468296}, +{22474.7, 25.2728, 0.454179}, +{22838.2, 25.2676, 0.440468}, +{23207.6, 25.2624, 0.427153}, +{23583.0, 25.2572, 0.414224}, +{23964.4, 25.2520, 0.401670}, +{24352.0, 25.2468, 0.389481}, +{24745.9, 25.2416, 0.377647}, +{25146.2, 25.2364, 0.366158}, +{25552.9, 25.2313, 0.355006}, +{25966.2, 25.2262, 0.344180}, +{26386.1, 25.2211, 0.333671}, +{26812.9, 25.2160, 0.323471}, +{27246.6, 25.2110, 0.313572}, +{27687.3, 25.2060, 0.303965}, +{28135.1, 25.2011, 0.294641}, +{28590.2, 25.1962, 0.285593}, +{29052.6, 25.1915, 0.276814}, +{29522.5, 25.1875, 0.268295}, +{30000.0, 25.1795, 0.260029}, +{0, 0, 0} +}; + +e_fp_fdp fe[] = { /* Z = 26 */ +{10.0000, -9999.00, 1.37852}, +{10.1617, -9999.00, 1.42961}, +{10.3261, -9999.00, 1.48259}, +{10.4931, -9999.00, 1.53754}, +{10.6628, -9999.00, 1.59453}, +{10.8353, -9999.00, 1.65362}, +{11.0106, -9999.00, 1.71491}, +{11.1886, -9999.00, 1.77847}, +{11.3696, -9999.00, 1.84438}, +{11.5535, -9999.00, 1.91274}, +{11.7404, -9999.00, 1.97402}, +{11.9303, -9999.00, 2.01044}, +{12.1232, -9999.00, 2.04752}, +{12.3193, -9999.00, 2.08529}, +{12.5186, -9999.00, 2.12375}, +{12.7210, -9999.00, 2.16292}, +{12.9268, -9999.00, 2.20282}, +{13.1359, -9999.00, 2.24345}, +{13.3483, -9999.00, 2.28484}, +{13.5642, -9999.00, 2.32698}, +{13.7836, -9999.00, 2.36990}, +{14.0066, -9999.00, 2.41362}, +{14.2331, -9999.00, 2.45814}, +{14.4633, -9999.00, 2.50348}, +{14.6973, -9999.00, 2.54966}, +{14.9350, -9999.00, 2.59669}, +{15.1765, -9999.00, 2.64458}, +{15.4220, -9999.00, 2.69337}, +{15.6714, -9999.00, 2.73188}, +{15.9249, -9999.00, 2.75688}, +{16.1825, -9999.00, 2.78211}, +{16.4442, -9999.00, 2.80756}, +{16.7102, -9999.00, 2.83325}, +{16.9805, -9999.00, 2.85918}, +{17.2551, -9999.00, 2.88534}, +{17.5342, -9999.00, 2.91174}, +{17.8178, -9999.00, 2.93838}, +{18.1060, -9999.00, 2.96261}, +{18.3989, -9999.00, 2.97951}, +{18.6964, -9999.00, 2.99650}, +{18.9988, -9999.00, 3.01359}, +{19.3061, -9999.00, 3.03078}, +{19.6184, -9999.00, 3.04806}, +{19.9357, -9999.00, 3.06544}, +{20.2582, -9999.00, 3.08293}, +{20.5858, -9999.00, 3.10051}, +{20.9188, -9999.00, 3.11819}, +{21.2571, -9999.00, 3.13597}, +{21.6009, -9999.00, 3.15386}, +{21.9503, -9999.00, 3.17184}, +{22.3053, -9999.00, 3.18993}, +{22.6661, -9999.00, 3.19901}, +{23.0327, -9999.00, 3.20529}, +{23.4053, -9999.00, 3.21159}, +{23.7838, -9999.00, 3.21789}, +{24.1685, -9999.00, 3.22421}, +{24.5594, -9999.00, 3.23054}, +{24.9566, -9999.00, 3.23689}, +{25.3603, -9999.00, 3.24324}, +{25.7705, -9999.00, 3.24961}, +{26.1873, -9999.00, 3.25599}, +{26.6109, -9999.00, 3.26239}, +{27.0413, -9999.00, 3.26879}, +{27.4786, -9999.00, 3.27521}, +{27.9231, -9999.00, 3.28164}, +{28.3747, -9999.00, 3.28184}, +{28.8337, -9999.00, 3.26361}, +{29.3000, 4.73140, 3.24547}, +{29.7739, 4.76263, 3.22745}, +{30.2555, 4.78979, 3.20951}, +{30.7449, 4.81343, 3.19168}, +{31.2421, 4.83386, 3.17395}, +{31.7475, 4.85127, 3.15632}, +{32.2609, 4.86580, 3.13878}, +{32.7827, 4.87752, 3.12135}, +{33.3130, 4.88653, 3.10401}, +{33.8518, 4.89324, 3.08676}, +{34.3993, 4.89852, 3.06821}, +{34.9557, 4.89884, 3.04783}, +{35.5211, 4.89474, 3.02759}, +{36.0956, 4.88660, 3.00747}, +{36.6794, 4.87437, 2.98750}, +{37.2727, 4.85791, 2.96765}, +{37.8755, 4.83702, 2.94794}, +{38.4882, 4.81148, 2.92835}, +{39.1107, 4.78106, 2.90891}, +{39.7432, 4.74557, 2.88958}, +{40.3861, 4.70512, 2.87039}, +{41.0393, 4.66135, 2.85002}, +{41.7031, 4.60787, 2.82162}, +{42.3776, 4.54183, 2.79349}, +{43.0630, 4.46363, 2.76565}, +{43.7595, 4.37257, 2.73809}, +{44.4673, 4.26705, 2.71079}, +{45.1865, 4.14492, 2.68377}, +{45.9174, 4.00326, 2.65703}, +{46.6600, 3.83823, 2.63054}, +{47.4147, 3.64451, 2.60433}, +{48.1816, 3.41471, 2.57837}, +{48.9609, 3.13811, 2.55267}, +{49.7528, 2.79878, 2.52664}, +{50.5576, 2.36452, 2.49588}, +{51.3753, 1.77210, 2.46550}, +{52.2062, 0.912549, 2.49950}, +{53.0506, -0.656558, 2.57469}, +{53.9087, -3.31836, 4.80517}, +{54.7806, -2.11636, 9.28509}, +{55.6667, -0.865987E-01, 9.98238}, +{56.5670, 1.46441, 10.4549}, +{57.4820, 2.56945, 10.7076}, +{58.4117, 3.70844, 10.9275}, +{59.3564, 4.70545, 10.6850}, +{60.3165, 5.49638, 10.4478}, +{61.2921, 6.20435, 10.1122}, +{62.2834, 6.72079, 9.71669}, +{63.2908, 7.10635, 9.33663}, +{64.3145, 7.40227, 8.97142}, +{65.3547, 7.61967, 8.62050}, +{66.4118, 7.75313, 8.28332}, +{67.4859, 7.75552, 7.97015}, +{68.5775, 7.75758, 7.86267}, +{69.6867, 7.81285, 7.75663}, +{70.8138, 7.87693, 7.65203}, +{71.9591, 7.93651, 7.54883}, +{73.1230, 7.98331, 7.44703}, +{74.3057, 8.00539, 7.34660}, +{75.5076, 7.96529, 7.28864}, +{76.7289, 7.97299, 7.30616}, +{77.9699, 8.00949, 7.32372}, +{79.2310, 8.06067, 7.34133}, +{80.5125, 8.12052, 7.35898}, +{81.8147, 8.18632, 7.37667}, +{83.1380, 8.25638, 7.39440}, +{84.4827, 8.32950, 7.41218}, +{85.8491, 8.40471, 7.43000}, +{87.2377, 8.48093, 7.44786}, +{88.6487, 8.55559, 7.46624}, +{90.0825, 8.63299, 7.49275}, +{91.5395, 8.71497, 7.51936}, +{93.0201, 8.80025, 7.54607}, +{94.5246, 8.88793, 7.57286}, +{96.0535, 8.97777, 7.59976}, +{97.6071, 9.06962, 7.62675}, +{99.1858, 9.16341, 7.65383}, +{100.790, 9.25914, 7.68101}, +{102.420, 9.35691, 7.70829}, +{104.077, 9.45696, 7.73567}, +{105.760, 9.56033, 7.76314}, +{107.471, 9.66593, 7.78722}, +{109.209, 9.77152, 7.81049}, +{110.975, 9.87812, 7.83383}, +{112.770, 9.98624, 7.85724}, +{114.594, 10.0963, 7.88073}, +{116.448, 10.2085, 7.90428}, +{118.331, 10.3236, 7.92791}, +{120.245, 10.4422, 7.95160}, +{122.190, 10.5657, 7.97537}, +{124.166, 10.6988, 7.99921}, +{126.175, 10.8449, 8.00625}, +{128.215, 10.9780, 7.99853}, +{130.289, 11.1045, 7.99083}, +{132.397, 11.2280, 7.98313}, +{134.538, 11.3498, 7.97544}, +{136.714, 11.4708, 7.96776}, +{138.925, 11.5917, 7.96008}, +{141.172, 11.7132, 7.95241}, +{143.456, 11.8364, 7.94475}, +{145.776, 11.9635, 7.93710}, +{148.134, 12.1008, 7.92106}, +{150.530, 12.2280, 7.89217}, +{152.964, 12.3494, 7.86339}, +{155.439, 12.4675, 7.83471}, +{157.953, 12.5835, 7.80615}, +{160.507, 12.6981, 7.77768}, +{163.103, 12.8116, 7.74932}, +{165.742, 12.9246, 7.72106}, +{168.422, 13.0373, 7.69290}, +{171.146, 13.1502, 7.66485}, +{173.915, 13.2637, 7.63690}, +{176.727, 13.3785, 7.60905}, +{179.586, 13.4951, 7.58130}, +{182.491, 13.6149, 7.55366}, +{185.442, 13.7397, 7.52611}, +{188.442, 13.8743, 7.49867}, +{191.489, 14.0386, 7.46087}, +{194.587, 14.1827, 7.36866}, +{197.734, 14.3045, 7.27760}, +{200.932, 14.4119, 7.18766}, +{204.182, 14.5099, 7.09884}, +{207.485, 14.6001, 7.01111}, +{210.840, 14.6831, 6.92446}, +{214.251, 14.7592, 6.83889}, +{217.716, 14.8280, 6.75437}, +{221.237, 14.8877, 6.67090}, +{224.816, 14.9288, 6.58963}, +{228.452, 14.9729, 6.54414}, +{232.147, 15.0268, 6.49896}, +{235.902, 15.0868, 6.45410}, +{239.717, 15.1493, 6.40954}, +{243.595, 15.2138, 6.36529}, +{247.535, 15.2799, 6.32135}, +{251.538, 15.3475, 6.27771}, +{255.607, 15.4168, 6.23437}, +{259.741, 15.4881, 6.19133}, +{263.942, 15.5620, 6.14859}, +{268.211, 15.6397, 6.10615}, +{272.549, 15.7233, 6.06399}, +{276.957, 15.8359, 6.01084}, +{281.437, 15.9299, 5.92255}, +{285.989, 16.0035, 5.83556}, +{290.615, 16.0695, 5.74984}, +{295.315, 16.1296, 5.66539}, +{300.092, 16.1850, 5.58217}, +{304.945, 16.2366, 5.50018}, +{309.878, 16.2851, 5.41940}, +{314.890, 16.3312, 5.33979}, +{319.983, 16.3755, 5.26136}, +{325.158, 16.4191, 5.18408}, +{330.418, 16.4632, 5.10794}, +{335.762, 16.5225, 5.03291}, +{341.192, 16.5727, 4.92380}, +{346.711, 16.6036, 4.81616}, +{352.319, 16.6237, 4.71086}, +{358.017, 16.6354, 4.60787}, +{363.808, 16.6397, 4.50713}, +{369.692, 16.6370, 4.40859}, +{375.672, 16.6270, 4.31221}, +{381.748, 16.6026, 4.21793}, +{387.922, 16.5737, 4.14490}, +{394.197, 16.5552, 4.07954}, +{400.573, 16.5454, 4.00915}, +{407.052, 16.5275, 3.92917}, +{413.635, 16.5026, 3.85080}, +{420.326, 16.4725, 3.77398}, +{427.124, 16.4376, 3.69870}, +{434.032, 16.3980, 3.62491}, +{441.052, 16.3537, 3.55260}, +{448.186, 16.3045, 3.48174}, +{455.435, 16.2503, 3.41228}, +{462.802, 16.1908, 3.34421}, +{470.287, 16.1258, 3.27750}, +{477.894, 16.0550, 3.21212}, +{485.623, 15.9780, 3.14804}, +{493.478, 15.8948, 3.08503}, +{501.459, 15.8039, 3.02269}, +{509.570, 15.7048, 2.96160}, +{517.812, 15.5969, 2.90175}, +{526.187, 15.4794, 2.84310}, +{534.698, 15.3514, 2.78564}, +{543.346, 15.2116, 2.72935}, +{552.134, 15.0586, 2.67418}, +{561.065, 14.8907, 2.62014}, +{570.139, 14.7058, 2.56719}, +{579.361, 14.5009, 2.51530}, +{588.732, 14.2719, 2.46447}, +{598.254, 14.0146, 2.41999}, +{607.930, 13.7300, 2.37973}, +{617.763, 13.4118, 2.34017}, +{627.755, 13.0502, 2.30104}, +{637.908, 12.6319, 2.25957}, +{648.226, 12.1369, 2.21452}, +{658.711, 11.5336, 2.16757}, +{669.365, 10.7767, 2.12164}, +{680.191, 9.78537, 2.08255}, +{691.193, 8.39043, 2.04854}, +{702.372, 6.05999, 2.01509}, +{706.700, 4.42734, 2.00242}, +{706.900, 4.29418, 2.02012}, +{713.733, 0.566866, 4.43192}, +{725.277, 1.64962, 16.4340}, +{737.008, 6.85206, 16.0756}, +{748.928, 10.1184, 15.7252}, +{761.042, 11.7939, 15.3828}, +{773.351, 13.0461, 15.0480}, +{785.859, 13.9867, 14.7261}, +{798.570, 14.5897, 14.4327}, +{811.486, 15.1663, 14.5066}, +{824.611, 15.8037, 14.5809}, +{837.949, 16.4896, 14.6555}, +{851.502, 17.2602, 14.7305}, +{865.274, 18.1378, 14.5915}, +{879.269, 18.8722, 14.2652}, +{893.491, 19.4399, 13.9465}, +{907.943, 19.9397, 13.6347}, +{922.628, 20.3797, 13.3297}, +{937.551, 20.7770, 13.0418}, +{952.715, 21.1421, 12.7630}, +{968.124, 21.4803, 12.4928}, +{983.783, 21.7957, 12.2280}, +{999.695, 22.0897, 11.9685}, +{1015.86, 22.3660, 11.7140}, +{1032.29, 22.6253, 11.4617}, +{1048.99, 22.8693, 11.2106}, +{1065.96, 23.0947, 10.9604}, +{1083.20, 23.3021, 10.7157}, +{1100.72, 23.4953, 10.4765}, +{1118.52, 23.6756, 10.2426}, +{1136.61, 23.8442, 10.0139}, +{1155.00, 24.0021, 9.79036}, +{1173.68, 24.1504, 9.57181}, +{1192.66, 24.2900, 9.35813}, +{1211.95, 24.4216, 9.14919}, +{1231.55, 24.5475, 8.94492}, +{1251.47, 24.6669, 8.74240}, +{1271.72, 24.7801, 8.54142}, +{1292.29, 24.8843, 8.34135}, +{1313.19, 24.9792, 8.14613}, +{1334.43, 25.0673, 7.95544}, +{1356.01, 25.1493, 7.76913}, +{1377.94, 25.2257, 7.58714}, +{1400.23, 25.2969, 7.40943}, +{1422.88, 25.3635, 7.23595}, +{1445.89, 25.4263, 7.06656}, +{1469.28, 25.4857, 6.90047}, +{1493.04, 25.5429, 6.73728}, +{1517.19, 25.5954, 6.57391}, +{1541.73, 25.6419, 6.41399}, +{1566.67, 25.6841, 6.25803}, +{1592.01, 25.7225, 6.10583}, +{1617.76, 25.7576, 5.95731}, +{1643.92, 25.7897, 5.81239}, +{1670.51, 25.8193, 5.67104}, +{1697.53, 25.8467, 5.53311}, +{1724.99, 25.8734, 5.39847}, +{1752.89, 25.8979, 5.26344}, +{1781.24, 25.9190, 5.13051}, +{1810.05, 25.9362, 4.99990}, +{1839.32, 25.9503, 4.87266}, +{1869.07, 25.9618, 4.74866}, +{1899.30, 25.9712, 4.62785}, +{1930.02, 25.9787, 4.51012}, +{1961.24, 25.9845, 4.39537}, +{1992.96, 25.9880, 4.28350}, +{2025.20, 25.9918, 4.17638}, +{2057.95, 25.9949, 4.06827}, +{2091.24, 25.9956, 3.96272}, +{2125.06, 25.9945, 3.85956}, +{2159.43, 25.9919, 3.75885}, +{2194.36, 25.9878, 3.66043}, +{2229.85, 25.9825, 3.56442}, +{2265.92, 25.9759, 3.47073}, +{2302.57, 25.9683, 3.37928}, +{2339.81, 25.9596, 3.28988}, +{2377.66, 25.9497, 3.20281}, +{2416.11, 25.9391, 3.11785}, +{2455.19, 25.9275, 3.03494}, +{2494.90, 25.9151, 2.95409}, +{2535.26, 25.9019, 2.87525}, +{2576.26, 25.8880, 2.79837}, +{2617.93, 25.8733, 2.72340}, +{2660.27, 25.8581, 2.65034}, +{2703.30, 25.8422, 2.57909}, +{2747.03, 25.8257, 2.50966}, +{2791.46, 25.8086, 2.44201}, +{2836.61, 25.7911, 2.37611}, +{2882.49, 25.7730, 2.31186}, +{2929.11, 25.7545, 2.24928}, +{2976.48, 25.7356, 2.18831}, +{3024.63, 25.7162, 2.12895}, +{3073.55, 25.6965, 2.07110}, +{3123.26, 25.6764, 2.01476}, +{3173.78, 25.6559, 1.95990}, +{3225.11, 25.6350, 1.90650}, +{3277.27, 25.6138, 1.85449}, +{3330.28, 25.5923, 1.80385}, +{3384.15, 25.5705, 1.75456}, +{3438.88, 25.5484, 1.70657}, +{3494.50, 25.5259, 1.65983}, +{3551.02, 25.5032, 1.61438}, +{3608.46, 25.4801, 1.57013}, +{3666.82, 25.4567, 1.52704}, +{3726.13, 25.4330, 1.48515}, +{3786.40, 25.4090, 1.44434}, +{3847.64, 25.3846, 1.40465}, +{3909.87, 25.3598, 1.36603}, +{3973.11, 25.3347, 1.32847}, +{4037.38, 25.3092, 1.29190}, +{4102.68, 25.2833, 1.25636}, +{4169.03, 25.2569, 1.22173}, +{4236.46, 25.2300, 1.18809}, +{4304.98, 25.2026, 1.15533}, +{4374.62, 25.1747, 1.12346}, +{4445.37, 25.1461, 1.09249}, +{4517.27, 25.1168, 1.06239}, +{4590.33, 25.0869, 1.03305}, +{4664.58, 25.0561, 1.00457}, +{4740.03, 25.0244, 0.976873}, +{4816.69, 24.9918, 0.949891}, +{4894.60, 24.9581, 0.923701}, +{4973.77, 24.9231, 0.898161}, +{5054.21, 24.8868, 0.873392}, +{5135.96, 24.8490, 0.849294}, +{5219.03, 24.8094, 0.825838}, +{5303.44, 24.7679, 0.803057}, +{5389.22, 24.7242, 0.780872}, +{5476.39, 24.6779, 0.759346}, +{5564.97, 24.6287, 0.738385}, +{5654.98, 24.5762, 0.718011}, +{5746.44, 24.5196, 0.698203}, +{5839.39, 24.4584, 0.678946}, +{5933.83, 24.3916, 0.660221}, +{6029.81, 24.3180, 0.642017}, +{6127.33, 24.2361, 0.624321}, +{6226.44, 24.1438, 0.607117}, +{6327.15, 24.0381, 0.590390}, +{6429.48, 23.9147, 0.574125}, +{6533.48, 23.7671, 0.558319}, +{6639.15, 23.5842, 0.542948}, +{6746.54, 23.3462, 0.528004}, +{6855.65, 23.0106, 0.513483}, +{6966.54, 22.4573, 0.499359}, +{7079.22, 20.9327, 0.485638}, +{7111.90, 14.7496, 0.481770}, +{7112.10, 14.7501, 3.85592}, +{7193.72, 22.0180, 3.79269}, +{7310.07, 23.0295, 3.70552}, +{7428.31, 23.5773, 3.61951}, +{7548.45, 23.9580, 3.53462}, +{7670.54, 24.2503, 3.45114}, +{7794.61, 24.4874, 3.36893}, +{7920.68, 24.6860, 3.28802}, +{8048.79, 24.8562, 3.20844}, +{8178.98, 25.0045, 3.13021}, +{8311.26, 25.1352, 3.05334}, +{8445.69, 25.2515, 2.97792}, +{8582.29, 25.3557, 2.90374}, +{8721.11, 25.4495, 2.83104}, +{8862.16, 25.5344, 2.75967}, +{9005.50, 25.6116, 2.68982}, +{9151.16, 25.6818, 2.62115}, +{9299.17, 25.7459, 2.55398}, +{9449.58, 25.8044, 2.48817}, +{9602.42, 25.8581, 2.42376}, +{9757.73, 25.9073, 2.36063}, +{9915.55, 25.9523, 2.29898}, +{10075.9, 25.9938, 2.23854}, +{10238.9, 26.0317, 2.17943}, +{10404.5, 26.0665, 2.12163}, +{10572.8, 26.0984, 2.06511}, +{10743.8, 26.1277, 2.00987}, +{10917.6, 26.1545, 1.95589}, +{11094.2, 26.1790, 1.90315}, +{11273.6, 26.2014, 1.85164}, +{11455.9, 26.2218, 1.80133}, +{11641.2, 26.2403, 1.75222}, +{11829.5, 26.2572, 1.70428}, +{12020.8, 26.2725, 1.65749}, +{12215.3, 26.2862, 1.61183}, +{12412.8, 26.2986, 1.56728}, +{12613.6, 26.3097, 1.52383}, +{12817.6, 26.3196, 1.48146}, +{13025.0, 26.3284, 1.44014}, +{13235.6, 26.3361, 1.39985}, +{13449.7, 26.3429, 1.36058}, +{13667.2, 26.3487, 1.32231}, +{13888.3, 26.3536, 1.28501}, +{14112.9, 26.3578, 1.24866}, +{14341.2, 26.3612, 1.21326}, +{14573.1, 26.3638, 1.17877}, +{14808.9, 26.3659, 1.14518}, +{15048.4, 26.3673, 1.11246}, +{15291.8, 26.3682, 1.08061}, +{15539.1, 26.3685, 1.04960}, +{15790.4, 26.3683, 1.01941}, +{16045.8, 26.3677, 0.990019}, +{16305.4, 26.3667, 0.961418}, +{16569.1, 26.3652, 0.933585}, +{16837.1, 26.3634, 0.906501}, +{17109.4, 26.3613, 0.880150}, +{17386.1, 26.3588, 0.854515}, +{17667.4, 26.3560, 0.829578}, +{17953.1, 26.3530, 0.805322}, +{18243.5, 26.3497, 0.781732}, +{18538.6, 26.3462, 0.758791}, +{18838.4, 26.3425, 0.736483}, +{19143.1, 26.3386, 0.714793}, +{19452.7, 26.3345, 0.693706}, +{19767.4, 26.3303, 0.673206}, +{20087.1, 26.3259, 0.653279}, +{20412.0, 26.3214, 0.633910}, +{20742.1, 26.3168, 0.615086}, +{21077.6, 26.3121, 0.596791}, +{21418.5, 26.3073, 0.579014}, +{21765.0, 26.3024, 0.561739}, +{22117.0, 26.2974, 0.544955}, +{22474.7, 26.2924, 0.528649}, +{22838.2, 26.2873, 0.512808}, +{23207.6, 26.2822, 0.497420}, +{23583.0, 26.2771, 0.482472}, +{23964.4, 26.2719, 0.467954}, +{24352.0, 26.2667, 0.453854}, +{24745.9, 26.2615, 0.440160}, +{25146.2, 26.2563, 0.426862}, +{25552.9, 26.2511, 0.413949}, +{25966.2, 26.2458, 0.401411}, +{26386.1, 26.2407, 0.389237}, +{26812.9, 26.2355, 0.377418}, +{27246.6, 26.2303, 0.365944}, +{27687.3, 26.2252, 0.354805}, +{28135.1, 26.2201, 0.343992}, +{28590.2, 26.2150, 0.333497}, +{29052.6, 26.2099, 0.323310}, +{29522.5, 26.2049, 0.313422}, +{30000.0, 26.1999, 0.303827}, +{0, 0, 0} +}; + +e_fp_fdp co[] = { /* Z = 27 */ +{10.0000, -9999.00, 1.42071}, +{10.1617, -9999.00, 1.45925}, +{10.3261, -9999.00, 1.49884}, +{10.4931, -9999.00, 1.53949}, +{10.6628, -9999.00, 1.58125}, +{10.8353, -9999.00, 1.62415}, +{11.0106, -9999.00, 1.66820}, +{11.1886, -9999.00, 1.71345}, +{11.3696, -9999.00, 1.75993}, +{11.5535, -9999.00, 1.80767}, +{11.7404, -9999.00, 1.85671}, +{11.9303, -9999.00, 1.90707}, +{12.1232, -9999.00, 1.94682}, +{12.3193, -9999.00, 1.98600}, +{12.5186, -9999.00, 2.02596}, +{12.7210, -9999.00, 2.06674}, +{12.9268, -9999.00, 2.10833}, +{13.1359, -9999.00, 2.15076}, +{13.3483, -9999.00, 2.19404}, +{13.5642, -9999.00, 2.23819}, +{13.7836, -9999.00, 2.28323}, +{14.0066, -9999.00, 2.32918}, +{14.2331, -9999.00, 2.37605}, +{14.4633, -9999.00, 2.42371}, +{14.6973, -9999.00, 2.47199}, +{14.9350, -9999.00, 2.52123}, +{15.1765, -9999.00, 2.57146}, +{15.4220, -9999.00, 2.62268}, +{15.6714, -9999.00, 2.67492}, +{15.9249, -9999.00, 2.72821}, +{16.1825, -9999.00, 2.78255}, +{16.4442, -9999.00, 2.83798}, +{16.7102, -9999.00, 2.89452}, +{16.9805, -9999.00, 2.95217}, +{17.2551, -9999.00, 3.00203}, +{17.5342, -9999.00, 3.04455}, +{17.8178, -9999.00, 3.08768}, +{18.1060, -9999.00, 3.13142}, +{18.3989, -9999.00, 3.17578}, +{18.6964, -9999.00, 3.22076}, +{18.9988, -9999.00, 3.26639}, +{19.3061, -9999.00, 3.31266}, +{19.6184, -9999.00, 3.35958}, +{19.9357, -9999.00, 3.40700}, +{20.2582, -9999.00, 3.45166}, +{20.5858, -9999.00, 3.49690}, +{20.9188, -9999.00, 3.54274}, +{21.2571, -9999.00, 3.58917}, +{21.6009, -9999.00, 3.63622}, +{21.9503, -9999.00, 3.68388}, +{22.3053, -9999.00, 3.73217}, +{22.6661, -9999.00, 3.78109}, +{23.0327, -9999.00, 3.83065}, +{23.4053, -9999.00, 3.88086}, +{23.7838, -9999.00, 3.93173}, +{24.1685, -9999.00, 3.98327}, +{24.5594, -9999.00, 4.02721}, +{24.9566, -9999.00, 4.06435}, +{25.3603, -9999.00, 4.10183}, +{25.7705, -9999.00, 4.13966}, +{26.1873, -9999.00, 4.17784}, +{26.6109, -9999.00, 4.21637}, +{27.0413, -9999.00, 4.25526}, +{27.4786, -9999.00, 4.29450}, +{27.9231, -9999.00, 4.33411}, +{28.3747, -9999.00, 4.36366}, +{28.8337, -9999.00, 4.35857}, +{29.3000, 3.98251, 4.35348}, +{29.7739, 4.05081, 4.34840}, +{30.2555, 4.11438, 4.34333}, +{30.7449, 4.17442, 4.33826}, +{31.2421, 4.23178, 4.33320}, +{31.7475, 4.28723, 4.32814}, +{32.2609, 4.34162, 4.32308}, +{32.7827, 4.39819, 4.31804}, +{33.3130, 4.46159, 4.30200}, +{33.8518, 4.51057, 4.27710}, +{34.3993, 4.55107, 4.25234}, +{34.9557, 4.58579, 4.22773}, +{35.5211, 4.61516, 4.20326}, +{36.0956, 4.63925, 4.17893}, +{36.6794, 4.65765, 4.15473}, +{37.2727, 4.66840, 4.13069}, +{37.8755, 4.67446, 4.11592}, +{38.4882, 4.68060, 4.10181}, +{39.1107, 4.68468, 4.08775}, +{39.7432, 4.68556, 4.07374}, +{40.3861, 4.68276, 4.05977}, +{41.0393, 4.67585, 4.04586}, +{41.7031, 4.66434, 4.03199}, +{42.3776, 4.64780, 4.01853}, +{43.0630, 4.62611, 4.00528}, +{43.7595, 4.59855, 3.99206}, +{44.4673, 4.56440, 3.97889}, +{45.1865, 4.52280, 3.96576}, +{45.9174, 4.47271, 3.95268}, +{46.6600, 4.41279, 3.93968}, +{47.4147, 4.34177, 3.92725}, +{48.1816, 4.25782, 3.91487}, +{48.9609, 4.15820, 3.90252}, +{49.7528, 4.03870, 3.89021}, +{50.5576, 3.89204, 3.87794}, +{51.3753, 3.71361, 3.87930}, +{52.2062, 3.50455, 3.88547}, +{53.0506, 3.23145, 3.89869}, +{53.9087, 2.92456, 3.99062}, +{54.7806, 2.57871, 4.08473}, +{55.6667, 2.12007, 4.21666}, +{56.5670, 1.50781, 4.40344}, +{57.4820, 0.481044, 5.04650}, +{58.4117, -0.135500, 6.26867}, +{59.3564, -0.348010, 7.78683}, +{60.3165, 0.174934, 9.67273}, +{61.2921, 1.78564, 10.6537}, +{62.2834, 3.05037, 11.0491}, +{63.2908, 4.17887, 10.9440}, +{64.3145, 4.94120, 10.6950}, +{65.3547, 5.47262, 10.4722}, +{66.4118, 5.92047, 10.2757}, +{67.4859, 6.30138, 10.0828}, +{68.5775, 6.62307, 9.89349}, +{69.6867, 6.89114, 9.70777}, +{70.8138, 7.09757, 9.54202}, +{71.9591, 7.29107, 9.40958}, +{73.1230, 7.46632, 9.27899}, +{74.3057, 7.61756, 9.15020}, +{75.5076, 7.73533, 9.02321}, +{76.7289, 7.78707, 8.89986}, +{77.9699, 7.84123, 8.89839}, +{79.2310, 7.93430, 8.89692}, +{80.5125, 8.04089, 8.89545}, +{81.8147, 8.15364, 8.89397}, +{83.1380, 8.26945, 8.89251}, +{84.4827, 8.38656, 8.89103}, +{85.8491, 8.50380, 8.88957}, +{87.2377, 8.62013, 8.88810}, +{88.6487, 8.73391, 8.88663}, +{90.0825, 8.84008, 8.88516}, +{91.5395, 8.94302, 8.90185}, +{93.0201, 9.05732, 8.92456}, +{94.5246, 9.17802, 8.94731}, +{96.0535, 9.30336, 8.97014}, +{97.6071, 9.43302, 8.99301}, +{99.1858, 9.56727, 9.01595}, +{100.790, 9.70715, 9.03894}, +{102.420, 9.85558, 9.06199}, +{104.077, 10.0244, 9.07617}, +{105.760, 10.1821, 9.05984}, +{107.471, 10.3289, 9.04353}, +{109.209, 10.4696, 9.02726}, +{110.975, 10.6070, 9.01102}, +{112.770, 10.7419, 8.99479}, +{114.594, 10.8751, 8.97860}, +{116.448, 11.0068, 8.96245}, +{118.331, 11.1375, 8.94633}, +{120.245, 11.2674, 8.93022}, +{122.190, 11.3967, 8.91415}, +{124.166, 11.5256, 8.89811}, +{126.175, 11.6533, 8.88210}, +{128.215, 11.7689, 8.87660}, +{130.289, 11.9243, 8.88791}, +{132.397, 12.0791, 8.85118}, +{134.538, 12.2209, 8.81453}, +{136.714, 12.3553, 8.77804}, +{138.925, 12.4862, 8.74172}, +{141.172, 12.6147, 8.70559}, +{143.456, 12.7416, 8.66963}, +{145.776, 12.8674, 8.63379}, +{148.134, 12.9926, 8.59804}, +{150.530, 13.1175, 8.56240}, +{152.964, 13.2430, 8.52710}, +{155.439, 13.3705, 8.49188}, +{157.953, 13.5036, 8.45677}, +{160.507, 13.6377, 8.40911}, +{163.103, 13.7723, 8.35600}, +{165.742, 13.8973, 8.29584}, +{168.422, 14.0167, 8.23602}, +{171.146, 14.1323, 8.17663}, +{173.915, 14.2453, 8.11767}, +{176.727, 14.3562, 8.05921}, +{179.586, 14.4657, 8.00118}, +{182.491, 14.5745, 7.94357}, +{185.442, 14.6835, 7.88632}, +{188.442, 14.7947, 7.82754}, +{191.489, 14.9086, 7.76516}, +{194.587, 15.0162, 7.69306}, +{197.734, 15.1183, 7.62172}, +{200.932, 15.2170, 7.55110}, +{204.182, 15.3136, 7.48100}, +{207.485, 15.4098, 7.41066}, +{210.840, 15.5060, 7.33987}, +{214.251, 15.5988, 7.26183}, +{217.716, 15.6864, 7.18423}, +{221.237, 15.7700, 7.10747}, +{224.816, 15.8510, 7.03172}, +{228.452, 15.9300, 6.95670}, +{232.147, 16.0073, 6.88236}, +{235.902, 16.0840, 6.80889}, +{239.717, 16.1614, 6.73346}, +{243.595, 16.2354, 6.65550}, +{247.535, 16.3059, 6.57587}, +{251.538, 16.3725, 6.49690}, +{255.607, 16.4364, 6.41891}, +{259.741, 16.4982, 6.34175}, +{263.942, 16.5584, 6.26551}, +{268.211, 16.6191, 6.19016}, +{272.549, 16.6779, 6.11070}, +{276.957, 16.7327, 6.03070}, +{281.437, 16.7839, 5.95119}, +{285.989, 16.8323, 5.87252}, +{290.615, 16.8782, 5.79487}, +{295.315, 16.9227, 5.71831}, +{300.092, 16.9655, 5.64128}, +{304.945, 17.0068, 5.56394}, +{309.878, 17.0446, 5.48605}, +{314.890, 17.0793, 5.40904}, +{319.983, 17.1115, 5.33316}, +{325.158, 17.1425, 5.25852}, +{330.418, 17.1715, 5.18298}, +{335.762, 17.1982, 5.10762}, +{341.192, 17.2218, 5.03229}, +{346.711, 17.2424, 4.95793}, +{352.319, 17.2606, 4.88464}, +{358.017, 17.2774, 4.81243}, +{363.808, 17.2919, 4.73913}, +{369.692, 17.3031, 4.66642}, +{375.672, 17.3113, 4.59458}, +{381.748, 17.3170, 4.52385}, +{387.922, 17.3207, 4.45374}, +{394.197, 17.3215, 4.38367}, +{400.573, 17.3194, 4.31398}, +{407.052, 17.3140, 4.24510}, +{413.635, 17.3059, 4.17733}, +{420.326, 17.2949, 4.10964}, +{427.124, 17.2809, 4.04263}, +{434.032, 17.2631, 3.97590}, +{441.052, 17.2417, 3.91023}, +{448.186, 17.2172, 3.84546}, +{455.435, 17.1889, 3.78090}, +{462.802, 17.1565, 3.71717}, +{470.287, 17.1200, 3.65438}, +{477.894, 17.0800, 3.59262}, +{485.623, 17.0355, 3.53009}, +{493.478, 16.9852, 3.46797}, +{501.459, 16.9291, 3.40695}, +{509.570, 16.8673, 3.34701}, +{517.812, 16.7990, 3.28828}, +{526.187, 16.7243, 3.23115}, +{534.698, 16.6431, 3.17612}, +{543.346, 16.5558, 3.12257}, +{552.134, 16.4622, 3.06998}, +{561.065, 16.3607, 3.01558}, +{570.139, 16.2478, 2.96112}, +{579.361, 16.1236, 2.90927}, +{588.732, 15.9881, 2.85882}, +{598.254, 15.8401, 2.80954}, +{607.930, 15.6779, 2.76106}, +{617.763, 15.4994, 2.71346}, +{627.755, 15.3028, 2.66656}, +{637.908, 15.0847, 2.61848}, +{648.226, 14.8396, 2.56838}, +{658.711, 14.5596, 2.51737}, +{669.365, 14.2376, 2.46741}, +{680.191, 13.8651, 2.42381}, +{691.193, 13.4352, 2.38506}, +{702.372, 12.9326, 2.34779}, +{713.733, 12.3259, 2.30698}, +{725.277, 11.5647, 2.26406}, +{737.008, 10.5677, 2.22189}, +{748.928, 9.16323, 2.18051}, +{761.042, 6.88403, 2.13989}, +{773.351, 1.20092, 2.10004}, +{778.000, -16.6697, 2.08534}, +{778.200, -16.6574, 16.7554}, +{785.859, 3.90051, 16.5665}, +{798.570, 8.67726, 16.2618}, +{811.486, 11.1424, 15.9628}, +{824.611, 12.8290, 15.6692}, +{837.949, 14.1115, 15.3809}, +{851.502, 15.1447, 15.0988}, +{865.274, 16.0019, 14.7991}, +{879.269, 16.6975, 14.4850}, +{893.491, 17.1236, 14.1650}, +{907.943, 17.3570, 14.1281}, +{922.628, 17.8034, 14.3979}, +{937.551, 18.5118, 14.6728}, +{952.715, 19.4683, 14.6303}, +{968.124, 20.2571, 14.2814}, +{983.783, 20.8180, 13.9412}, +{999.695, 21.3022, 13.6122}, +{1015.86, 21.7151, 13.2943}, +{1032.29, 22.0920, 13.0136}, +{1048.99, 22.4506, 12.7340}, +{1065.96, 22.7802, 12.4548}, +{1083.20, 23.0822, 12.1819}, +{1100.72, 23.3617, 11.9149}, +{1118.52, 23.6214, 11.6539}, +{1136.61, 23.8631, 11.3984}, +{1155.00, 24.0885, 11.1486}, +{1173.68, 24.2994, 10.9043}, +{1192.66, 24.4972, 10.6653}, +{1211.95, 24.6830, 10.4315}, +{1231.55, 24.8598, 10.2029}, +{1251.47, 25.0270, 9.97641}, +{1271.72, 25.1851, 9.75168}, +{1292.29, 25.3313, 9.52808}, +{1313.19, 25.4657, 9.30975}, +{1334.43, 25.5910, 9.09640}, +{1356.01, 25.7080, 8.88787}, +{1377.94, 25.8174, 8.68415}, +{1400.23, 25.9200, 8.48511}, +{1422.88, 26.0164, 8.29065}, +{1445.89, 26.1075, 8.10059}, +{1469.28, 26.1938, 7.91422}, +{1493.04, 26.2768, 7.73112}, +{1517.19, 26.3539, 7.54775}, +{1541.73, 26.4236, 7.36808}, +{1566.67, 26.4877, 7.19261}, +{1592.01, 26.5469, 7.02142}, +{1617.76, 26.6019, 6.85430}, +{1643.92, 26.6530, 6.69118}, +{1670.51, 26.7009, 6.53201}, +{1697.53, 26.7462, 6.37659}, +{1724.99, 26.7908, 6.22480}, +{1752.89, 26.8324, 6.07119}, +{1781.24, 26.8694, 5.91959}, +{1810.05, 26.9010, 5.77049}, +{1839.32, 26.9286, 5.62517}, +{1869.07, 26.9528, 5.48347}, +{1899.30, 26.9741, 5.34528}, +{1930.02, 26.9926, 5.21058}, +{1961.24, 27.0089, 5.07932}, +{1992.96, 27.0223, 4.95148}, +{2025.20, 27.0361, 4.82906}, +{2057.95, 27.0488, 4.70487}, +{2091.24, 27.0585, 4.58352}, +{2125.06, 27.0657, 4.46456}, +{2159.43, 27.0705, 4.34837}, +{2194.36, 27.0737, 4.23509}, +{2229.85, 27.0751, 4.12425}, +{2265.92, 27.0748, 4.01592}, +{2302.57, 27.0729, 3.91018}, +{2339.81, 27.0695, 3.80684}, +{2377.66, 27.0647, 3.70609}, +{2416.11, 27.0586, 3.60755}, +{2455.19, 27.0513, 3.51169}, +{2494.90, 27.0429, 3.41789}, +{2535.26, 27.0333, 3.32645}, +{2576.26, 27.0227, 3.23728}, +{2617.93, 27.0112, 3.15031}, +{2660.27, 26.9987, 3.06547}, +{2703.30, 26.9854, 2.98278}, +{2747.03, 26.9713, 2.90213}, +{2791.46, 26.9564, 2.82354}, +{2836.61, 26.9409, 2.74695}, +{2882.49, 26.9247, 2.67229}, +{2929.11, 26.9078, 2.59956}, +{2976.48, 26.8904, 2.52868}, +{3024.63, 26.8724, 2.45962}, +{3073.55, 26.8539, 2.39238}, +{3123.26, 26.8349, 2.32686}, +{3173.78, 26.8155, 2.26306}, +{3225.11, 26.7956, 2.20096}, +{3277.27, 26.7753, 2.14049}, +{3330.28, 26.7546, 2.08160}, +{3384.15, 26.7336, 2.02426}, +{3438.88, 26.7122, 1.96845}, +{3494.50, 26.6904, 1.91417}, +{3551.02, 26.6684, 1.86131}, +{3608.46, 26.6460, 1.80987}, +{3666.82, 26.6233, 1.75983}, +{3726.13, 26.6004, 1.71112}, +{3786.40, 26.5771, 1.66373}, +{3847.64, 26.5535, 1.61763}, +{3909.87, 26.5297, 1.57278}, +{3973.11, 26.5055, 1.52914}, +{4037.38, 26.4810, 1.48672}, +{4102.68, 26.4563, 1.44546}, +{4169.03, 26.4312, 1.40533}, +{4236.46, 26.4058, 1.36631}, +{4304.98, 26.3800, 1.32838}, +{4374.62, 26.3539, 1.29145}, +{4445.37, 26.3273, 1.25560}, +{4517.27, 26.3004, 1.22069}, +{4590.33, 26.2730, 1.18682}, +{4664.58, 26.2451, 1.15383}, +{4740.03, 26.2166, 1.12178}, +{4816.69, 26.1876, 1.09064}, +{4894.60, 26.1580, 1.06035}, +{4973.77, 26.1276, 1.03091}, +{5054.21, 26.0965, 1.00235}, +{5135.96, 26.0646, 0.974532}, +{5219.03, 26.0317, 0.947518}, +{5303.44, 25.9978, 0.921275}, +{5389.22, 25.9627, 0.895781}, +{5476.39, 25.9263, 0.871002}, +{5564.97, 25.8884, 0.846905}, +{5654.98, 25.8489, 0.823513}, +{5746.44, 25.8075, 0.800730}, +{5839.39, 25.7639, 0.778663}, +{5933.83, 25.7179, 0.757205}, +{6029.81, 25.6691, 0.736352}, +{6127.33, 25.6170, 0.716096}, +{6226.44, 25.5610, 0.696420}, +{6327.15, 25.5005, 0.677309}, +{6429.48, 25.4345, 0.658738}, +{6533.48, 25.3619, 0.640705}, +{6639.15, 25.2813, 0.623185}, +{6746.54, 25.1905, 0.606170}, +{6855.65, 25.0868, 0.589643}, +{6966.54, 24.9658, 0.573591}, +{7079.22, 24.8212, 0.557998}, +{7193.72, 24.6425, 0.542853}, +{7310.07, 24.4103, 0.528143}, +{7428.31, 24.0838, 0.513866}, +{7548.45, 23.5486, 0.499994}, +{7670.54, 22.1136, 0.486510}, +{7708.80, 15.8795, 0.482403}, +{7709.00, 15.8799, 3.79398}, +{7794.61, 23.0649, 3.73339}, +{7920.68, 24.0784, 3.64708}, +{8048.79, 24.6213, 3.56198}, +{8178.98, 24.9974, 3.47810}, +{8311.26, 25.2857, 3.39547}, +{8445.69, 25.5190, 3.31428}, +{8582.29, 25.7143, 3.23428}, +{8721.11, 25.8816, 3.15569}, +{8862.16, 26.0272, 3.07841}, +{9005.50, 26.1555, 3.00255}, +{9151.16, 26.2696, 2.92811}, +{9299.17, 26.3717, 2.85496}, +{9449.58, 26.4637, 2.78322}, +{9602.42, 26.5469, 2.71287}, +{9757.73, 26.6223, 2.64382}, +{9915.55, 26.6909, 2.57631}, +{10075.9, 26.7536, 2.51007}, +{10238.9, 26.8109, 2.44521}, +{10404.5, 26.8633, 2.38169}, +{10572.8, 26.9113, 2.31952}, +{10743.8, 26.9553, 2.25869}, +{10917.6, 26.9956, 2.19918}, +{11094.2, 27.0326, 2.14098}, +{11273.6, 27.0665, 2.08407}, +{11455.9, 27.0976, 2.02844}, +{11641.2, 27.1260, 1.97408}, +{11829.5, 27.1520, 1.92096}, +{12020.8, 27.1758, 1.86907}, +{12215.3, 27.1975, 1.81839}, +{12412.8, 27.2173, 1.76891}, +{12613.6, 27.2353, 1.72060}, +{12817.6, 27.2516, 1.67345}, +{13025.0, 27.2664, 1.62744}, +{13235.6, 27.2797, 1.58255}, +{13449.7, 27.2916, 1.53876}, +{13667.2, 27.3023, 1.49604}, +{13888.3, 27.3118, 1.45439}, +{14112.9, 27.3203, 1.41378}, +{14341.2, 27.3276, 1.37419}, +{14573.1, 27.3341, 1.33560}, +{14808.9, 27.3396, 1.29799}, +{15048.4, 27.3443, 1.26134}, +{15291.8, 27.3482, 1.22564}, +{15539.1, 27.3513, 1.19085}, +{15790.4, 27.3538, 1.15697}, +{16045.8, 27.3557, 1.12398}, +{16305.4, 27.3569, 1.09185}, +{16569.1, 27.3576, 1.06056}, +{16837.1, 27.3578, 1.03011}, +{17109.4, 27.3575, 1.00046}, +{17386.1, 27.3568, 0.971604}, +{17667.4, 27.3556, 0.943521}, +{17953.1, 27.3541, 0.916193}, +{18243.5, 27.3522, 0.889602}, +{18538.6, 27.3500, 0.863733}, +{18838.4, 27.3474, 0.838566}, +{19143.1, 27.3446, 0.814087}, +{19452.7, 27.3416, 0.790277}, +{19767.4, 27.3382, 0.767122}, +{20087.1, 27.3347, 0.744605}, +{20412.0, 27.3310, 0.722710}, +{20742.1, 27.3271, 0.701422}, +{21077.6, 27.3230, 0.680726}, +{21418.5, 27.3188, 0.660608}, +{21765.0, 27.3144, 0.641052}, +{22117.0, 27.3099, 0.622045}, +{22474.7, 27.3053, 0.603573}, +{22838.2, 27.3006, 0.585621}, +{23207.6, 27.2958, 0.568177}, +{23583.0, 27.2909, 0.551227}, +{23964.4, 27.2860, 0.534759}, +{24352.0, 27.2810, 0.518759}, +{24745.9, 27.2760, 0.503217}, +{25146.2, 27.2709, 0.488119}, +{25552.9, 27.2658, 0.473454}, +{25966.2, 27.2607, 0.459210}, +{26386.1, 27.2555, 0.445376}, +{26812.9, 27.2504, 0.431942}, +{27246.6, 27.2452, 0.418896}, +{27687.3, 27.2401, 0.406228}, +{28135.1, 27.2349, 0.393927}, +{28590.2, 27.2298, 0.381985}, +{29052.6, 27.2248, 0.370390}, +{29522.5, 27.2208, 0.359134}, +{30000.0, 27.2113, 0.348207}, +{0, 0, 0} +}; + +e_fp_fdp ni[] = { /* Z = 28 */ +{10.0000, -9999.00, 1.37727}, +{10.1617, -9999.00, 1.38064}, +{10.3261, -9999.00, 1.38401}, +{10.4931, -9999.00, 1.38740}, +{10.6628, -9999.00, 1.39079}, +{10.8353, -9999.00, 1.39419}, +{11.0106, -9999.00, 1.39982}, +{11.1886, -9999.00, 1.44104}, +{11.3696, -9999.00, 1.48347}, +{11.5535, -9999.00, 1.52716}, +{11.7404, -9999.00, 1.57212}, +{11.9303, -9999.00, 1.61841}, +{12.1232, -9999.00, 1.66663}, +{12.3193, -9999.00, 1.71662}, +{12.5186, -9999.00, 1.76810}, +{12.7210, -9999.00, 1.82113}, +{12.9268, -9999.00, 1.87575}, +{13.1359, -9999.00, 1.93142}, +{13.3483, -9999.00, 1.98842}, +{13.5642, -9999.00, 2.04710}, +{13.7836, -9999.00, 2.10752}, +{14.0066, -9999.00, 2.16971}, +{14.2331, -9999.00, 2.23204}, +{14.4633, -9999.00, 2.28582}, +{14.6973, -9999.00, 2.34091}, +{14.9350, -9999.00, 2.39732}, +{15.1765, -9999.00, 2.45509}, +{15.4220, -9999.00, 2.51425}, +{15.6714, -9999.00, 2.57140}, +{15.9249, -9999.00, 2.62103}, +{16.1825, -9999.00, 2.67162}, +{16.4442, -9999.00, 2.72318}, +{16.7102, -9999.00, 2.77574}, +{16.9805, -9999.00, 2.82931}, +{17.2551, -9999.00, 2.88392}, +{17.5342, -9999.00, 2.93007}, +{17.8178, -9999.00, 2.97110}, +{18.1060, -9999.00, 3.01271}, +{18.3989, -9999.00, 3.05491}, +{18.6964, -9999.00, 3.09769}, +{18.9988, -9999.00, 3.14107}, +{19.3061, -9999.00, 3.11470}, +{19.6184, -9999.00, 3.09192}, +{19.9357, -9999.00, 3.09990}, +{20.2582, -9999.00, 3.10790}, +{20.5858, -9999.00, 3.11592}, +{20.9188, -9999.00, 3.12491}, +{21.2571, -9999.00, 3.16974}, +{21.6009, -9999.00, 3.21521}, +{21.9503, -9999.00, 3.26133}, +{22.3053, -9999.00, 3.34677}, +{22.6661, -9999.00, 3.44429}, +{23.0327, -9999.00, 3.54465}, +{23.4053, -9999.00, 3.64793}, +{23.7838, -9999.00, 3.75422}, +{24.1685, -9999.00, 3.80593}, +{24.5594, -9999.00, 3.83313}, +{24.9566, -9999.00, 3.86051}, +{25.3603, -9999.00, 3.88809}, +{25.7705, -9999.00, 3.91587}, +{26.1873, -9999.00, 3.90685}, +{26.6109, -9999.00, 3.88468}, +{27.0413, -9999.00, 3.86263}, +{27.4786, -9999.00, 3.84070}, +{27.9231, -9999.00, 3.81412}, +{28.3747, -9999.00, 3.77863}, +{28.8337, -9999.00, 3.74347}, +{29.3000, 4.07489, 3.70864}, +{29.7739, 4.11878, 3.67413}, +{30.2555, 4.15559, 3.63994}, +{30.7449, 4.18799, 3.60945}, +{31.2421, 4.21844, 3.57991}, +{31.7475, 4.24569, 3.55062}, +{32.2609, 4.26954, 3.52157}, +{32.7827, 4.28991, 3.49275}, +{33.3130, 4.30665, 3.46417}, +{33.8518, 4.31936, 3.43582}, +{34.3993, 4.32706, 3.40771}, +{34.9557, 4.33038, 3.38228}, +{35.5211, 4.33103, 3.36017}, +{36.0956, 4.32965, 3.33819}, +{36.6794, 4.32479, 3.31636}, +{37.2727, 4.31550, 3.29467}, +{37.8755, 4.30020, 3.27312}, +{38.4882, 4.27468, 3.25172}, +{39.1107, 4.24425, 3.25034}, +{39.7432, 4.21830, 3.25005}, +{40.3861, 4.19406, 3.24976}, +{41.0393, 4.16743, 3.24947}, +{41.7031, 4.13541, 3.24918}, +{42.3776, 4.09414, 3.24888}, +{43.0630, 4.04770, 3.26499}, +{43.7595, 4.00654, 3.28972}, +{44.4673, 3.96885, 3.31464}, +{45.1865, 3.93122, 3.33976}, +{45.9174, 3.89203, 3.36506}, +{46.6600, 3.85034, 3.39055}, +{47.4147, 3.79831, 3.41624}, +{48.1816, 3.73782, 3.44854}, +{48.9609, 3.68007, 3.50082}, +{49.7528, 3.62828, 3.55389}, +{50.5576, 3.57767, 3.60778}, +{51.3753, 3.52588, 3.66247}, +{52.2062, 3.47153, 3.71800}, +{53.0506, 3.41420, 3.77753}, +{53.9087, 3.35497, 3.83910}, +{54.7806, 3.29249, 3.90168}, +{55.6667, 3.22528, 3.96528}, +{56.5670, 3.15250, 4.02991}, +{57.4820, 3.07820, 4.09444}, +{58.4117, 2.98535, 4.14027}, +{59.3564, 2.86335, 4.18662}, +{60.3165, 2.70077, 4.23349}, +{61.2921, 2.45011, 4.30894}, +{62.2834, 2.18829, 4.47415}, +{63.2908, 1.90363, 4.64568}, +{64.3145, 1.52278, 4.82379}, +{65.3547, 1.00050, 5.35920}, +{66.4118, 0.712900, 6.16858}, +{67.4859, 0.694467, 7.10021}, +{68.5775, 1.10772, 8.17252}, +{69.6867, 1.75751, 8.50016}, +{70.8138, 2.26228, 8.79611}, +{71.9591, 2.71469, 9.08103}, +{73.1230, 3.15797, 9.20206}, +{74.3057, 3.49643, 9.32471}, +{75.5076, 3.81415, 9.44899}, +{76.7289, 4.14091, 9.57493}, +{77.9699, 4.46124, 9.64899}, +{79.2310, 4.75594, 9.70549}, +{80.5125, 5.03118, 9.76232}, +{81.8147, 5.30150, 9.81950}, +{83.1380, 5.58627, 9.87699}, +{84.4827, 5.88145, 9.86813}, +{85.8491, 6.12735, 9.84309}, +{87.2377, 6.34846, 9.81811}, +{88.6487, 6.55119, 9.79320}, +{90.0825, 6.73894, 9.76835}, +{91.5395, 6.90617, 9.74356}, +{93.0201, 7.04896, 9.73075}, +{94.5246, 7.19681, 9.74377}, +{96.0535, 7.35361, 9.75681}, +{97.6071, 7.51027, 9.76987}, +{99.1858, 7.66641, 9.78295}, +{100.790, 7.82189, 9.79605}, +{102.420, 7.97682, 9.80915}, +{104.077, 8.13160, 9.82228}, +{105.760, 8.28712, 9.83543}, +{107.471, 8.44647, 9.84860}, +{109.209, 8.60494, 9.84981}, +{110.975, 8.75933, 9.84820}, +{112.770, 8.90703, 9.84660}, +{114.594, 9.05240, 9.84499}, +{116.448, 9.19571, 9.84339}, +{118.331, 9.33813, 9.84179}, +{120.245, 9.48087, 9.84019}, +{122.190, 9.62523, 9.82776}, +{124.166, 9.75819, 9.81204}, +{126.175, 9.88397, 9.79634}, +{128.215, 10.0028, 9.78065}, +{130.289, 10.1138, 9.76501}, +{132.397, 10.2099, 9.74938}, +{134.538, 10.2682, 9.73377}, +{136.714, 10.3327, 9.79365}, +{138.925, 10.4316, 9.86007}, +{141.172, 10.5474, 9.92692}, +{143.456, 10.6757, 9.99425}, +{145.776, 10.8152, 10.0620}, +{148.134, 10.9657, 10.1303}, +{150.530, 11.1282, 10.1990}, +{152.964, 11.3049, 10.2681}, +{155.439, 11.4992, 10.3378}, +{157.953, 11.7511, 10.3978}, +{160.507, 12.0042, 10.3668}, +{163.103, 12.2017, 10.3359}, +{165.742, 12.3889, 10.3051}, +{168.422, 12.5688, 10.2744}, +{171.146, 12.7435, 10.2438}, +{173.915, 12.9142, 10.2133}, +{176.727, 13.0823, 10.1829}, +{179.586, 13.2484, 10.1525}, +{182.491, 13.4134, 10.1223}, +{185.442, 13.5780, 10.0921}, +{188.442, 13.7429, 10.0621}, +{191.489, 13.9091, 10.0321}, +{194.587, 14.0776, 10.0022}, +{197.734, 14.2497, 9.97242}, +{200.932, 14.4351, 9.94271}, +{204.182, 14.6388, 9.91308}, +{207.485, 14.8440, 9.82709}, +{210.840, 15.0233, 9.73137}, +{214.251, 15.1866, 9.63658}, +{217.716, 15.3400, 9.54272}, +{221.237, 15.4860, 9.44977}, +{224.816, 15.6259, 9.35773}, +{228.452, 15.7608, 9.26659}, +{232.147, 15.8913, 9.17632}, +{235.902, 16.0179, 9.08694}, +{239.717, 16.1412, 8.99844}, +{243.595, 16.2616, 8.91079}, +{247.535, 16.3794, 8.82399}, +{251.538, 16.4950, 8.73804}, +{255.607, 16.6088, 8.65294}, +{259.741, 16.7212, 8.56865}, +{263.942, 16.8328, 8.48520}, +{268.211, 16.9440, 8.40255}, +{272.549, 17.0559, 8.32070}, +{276.957, 17.1684, 8.23966}, +{281.437, 17.2961, 8.15940}, +{285.989, 17.4280, 8.06947}, +{290.615, 17.5535, 7.94306}, +{295.315, 17.6582, 7.81865}, +{300.092, 17.7522, 7.69617}, +{304.945, 17.8383, 7.57562}, +{309.878, 17.9182, 7.45695}, +{314.890, 17.9926, 7.34015}, +{319.983, 18.0622, 7.22517}, +{325.158, 18.1275, 7.11199}, +{330.418, 18.1890, 7.00059}, +{335.762, 18.2469, 6.89094}, +{341.192, 18.3016, 6.78300}, +{346.711, 18.3535, 6.67675}, +{352.319, 18.4028, 6.57216}, +{358.017, 18.4502, 6.46922}, +{363.808, 18.4964, 6.36788}, +{369.692, 18.5455, 6.26813}, +{375.672, 18.5909, 6.15792}, +{381.748, 18.6295, 6.04599}, +{387.922, 18.6603, 5.93609}, +{394.197, 18.6861, 5.82819}, +{400.573, 18.7075, 5.72225}, +{407.052, 18.7250, 5.61823}, +{413.635, 18.7389, 5.51611}, +{420.326, 18.7492, 5.41584}, +{427.124, 18.7562, 5.31740}, +{434.032, 18.7599, 5.22074}, +{441.052, 18.7606, 5.12584}, +{448.186, 18.7582, 5.03267}, +{455.435, 18.7530, 4.94119}, +{462.802, 18.7451, 4.85137}, +{470.287, 18.7346, 4.76319}, +{477.894, 18.7219, 4.67661}, +{485.623, 18.7078, 4.59160}, +{493.478, 18.6944, 4.50813}, +{501.459, 18.6841, 4.41984}, +{509.570, 18.6676, 4.31530}, +{517.812, 18.6345, 4.21322}, +{526.187, 18.5923, 4.11356}, +{534.698, 18.5425, 4.01626}, +{543.346, 18.4853, 3.92125}, +{552.134, 18.4207, 3.82850}, +{561.065, 18.3488, 3.73793}, +{570.139, 18.2691, 3.64952}, +{579.361, 18.1812, 3.56319}, +{588.732, 18.0845, 3.47890}, +{598.254, 17.9775, 3.39661}, +{607.930, 17.8558, 3.31626}, +{617.763, 17.7261, 3.25118}, +{627.755, 17.5904, 3.19090}, +{637.908, 17.4496, 3.13174}, +{648.226, 17.2992, 3.07368}, +{658.711, 17.1372, 3.01669}, +{669.365, 16.9618, 2.96076}, +{680.191, 16.7709, 2.90587}, +{691.193, 16.5627, 2.85199}, +{702.372, 16.3354, 2.79911}, +{713.733, 16.0924, 2.74722}, +{725.277, 15.8265, 2.66726}, +{737.008, 15.4916, 2.54699}, +{748.928, 15.0476, 2.43214}, +{761.042, 14.5541, 2.40333}, +{773.351, 13.9833, 2.35520}, +{785.859, 13.2954, 2.31346}, +{798.570, 12.4407, 2.27693}, +{811.486, 11.3146, 2.24149}, +{824.611, 9.68933, 2.20661}, +{837.949, 6.86521, 2.17229}, +{851.502, -4.77850, 2.13850}, +{852.600, -16.5847, 2.13581}, +{852.800, -16.5694, 17.1612}, +{865.274, 6.89208, 16.8200}, +{879.269, 10.6978, 16.4508}, +{893.491, 12.9007, 16.0897}, +{907.943, 14.4482, 15.7365}, +{922.628, 15.6208, 15.3911}, +{937.551, 16.5503, 15.0686}, +{952.715, 17.2837, 14.7422}, +{968.124, 17.7758, 14.4139}, +{983.783, 18.0717, 14.2733}, +{999.695, 18.1198, 14.5442}, +{1015.86, 19.1887, 15.2836}, +{1032.29, 20.4147, 14.9622}, +{1048.99, 21.0748, 14.6335}, +{1065.96, 21.6619, 14.3064}, +{1083.20, 22.1779, 13.9864}, +{1100.72, 22.6378, 13.6735}, +{1118.52, 23.0529, 13.3675}, +{1136.61, 23.4306, 13.0684}, +{1155.00, 23.7764, 12.7760}, +{1173.68, 24.0946, 12.4902}, +{1192.66, 24.3887, 12.2108}, +{1211.95, 24.6617, 11.9376}, +{1231.55, 24.9164, 11.6705}, +{1251.47, 25.1548, 11.4073}, +{1271.72, 25.3771, 11.1477}, +{1292.29, 25.5830, 10.8913}, +{1313.19, 25.7736, 10.6408}, +{1334.43, 25.9511, 10.3960}, +{1356.01, 26.1167, 10.1568}, +{1377.94, 26.2716, 9.92318}, +{1400.23, 26.4168, 9.69489}, +{1422.88, 26.5534, 9.47183}, +{1445.89, 26.6824, 9.25396}, +{1469.28, 26.8062, 9.03977}, +{1493.04, 26.9235, 8.82853}, +{1517.19, 27.0337, 8.61410}, +{1541.73, 27.1321, 8.40382}, +{1566.67, 27.2219, 8.19876}, +{1592.01, 27.3047, 7.99863}, +{1617.76, 27.3809, 7.80334}, +{1643.92, 27.4513, 7.61278}, +{1670.51, 27.5164, 7.42691}, +{1697.53, 27.5768, 7.24564}, +{1724.99, 27.6340, 7.06889}, +{1752.89, 27.6875, 6.89317}, +{1781.24, 27.7356, 6.72078}, +{1810.05, 27.7780, 6.55195}, +{1839.32, 27.8161, 6.38739}, +{1869.07, 27.8503, 6.22694}, +{1899.30, 27.8808, 6.07048}, +{1930.02, 27.9082, 5.91807}, +{1961.24, 27.9323, 5.76947}, +{1992.96, 27.9538, 5.62449}, +{2025.20, 27.9735, 5.48525}, +{2057.95, 27.9917, 5.34614}, +{2091.24, 28.0074, 5.21021}, +{2125.06, 28.0198, 5.07749}, +{2159.43, 28.0301, 4.94801}, +{2194.36, 28.0381, 4.82139}, +{2229.85, 28.0443, 4.69811}, +{2265.92, 28.0487, 4.57759}, +{2302.57, 28.0512, 4.45991}, +{2339.81, 28.0520, 4.34528}, +{2377.66, 28.0512, 4.23335}, +{2416.11, 28.0492, 4.12431}, +{2455.19, 28.0457, 4.01774}, +{2494.90, 28.0409, 3.91381}, +{2535.26, 28.0351, 3.81264}, +{2576.26, 28.0280, 3.71371}, +{2617.93, 28.0198, 3.61737}, +{2660.27, 28.0107, 3.52337}, +{2703.30, 28.0006, 3.43174}, +{2747.03, 27.9897, 3.34237}, +{2791.46, 27.9780, 3.25525}, +{2836.61, 27.9654, 3.17028}, +{2882.49, 27.9522, 3.08748}, +{2929.11, 27.9383, 3.00673}, +{2976.48, 27.9237, 2.92803}, +{3024.63, 27.9086, 2.85132}, +{3073.55, 27.8929, 2.77654}, +{3123.26, 27.8767, 2.70362}, +{3173.78, 27.8600, 2.63256}, +{3225.11, 27.8428, 2.56329}, +{3277.27, 27.8251, 2.49582}, +{3330.28, 27.8071, 2.43004}, +{3384.15, 27.7887, 2.36592}, +{3438.88, 27.7699, 2.30341}, +{3494.50, 27.7507, 2.24255}, +{3551.02, 27.7313, 2.18319}, +{3608.46, 27.7115, 2.12538}, +{3666.82, 27.6914, 2.06903}, +{3726.13, 27.6710, 2.01410}, +{3786.40, 27.6503, 1.96060}, +{3847.64, 27.6293, 1.90848}, +{3909.87, 27.6081, 1.85767}, +{3973.11, 27.5866, 1.80819}, +{4037.38, 27.5648, 1.75993}, +{4102.68, 27.5427, 1.71294}, +{4169.03, 27.5203, 1.66712}, +{4236.46, 27.4977, 1.62253}, +{4304.98, 27.4748, 1.57905}, +{4374.62, 27.4516, 1.53665}, +{4445.37, 27.4281, 1.49540}, +{4517.27, 27.4043, 1.45514}, +{4590.33, 27.3801, 1.41597}, +{4664.58, 27.3555, 1.37776}, +{4740.03, 27.3305, 1.34054}, +{4816.69, 27.3052, 1.30428}, +{4894.60, 27.2794, 1.26897}, +{4973.77, 27.2531, 1.23452}, +{5054.21, 27.2262, 1.20094}, +{5135.96, 27.1988, 1.16828}, +{5219.03, 27.1708, 1.13642}, +{5303.44, 27.1421, 1.10536}, +{5389.22, 27.1127, 1.07511}, +{5476.39, 27.0824, 1.04560}, +{5564.97, 27.0512, 1.01693}, +{5654.98, 27.0190, 0.988877}, +{5746.44, 26.9857, 0.961612}, +{5839.39, 26.9511, 0.935044}, +{5933.83, 26.9152, 0.909130}, +{6029.81, 26.8777, 0.883844}, +{6127.33, 26.8384, 0.859254}, +{6226.44, 26.7972, 0.835240}, +{6327.15, 26.7536, 0.811858}, +{6429.48, 26.7075, 0.789069}, +{6533.48, 26.6584, 0.766841}, +{6639.15, 26.6058, 0.745185}, +{6746.54, 26.5492, 0.724075}, +{6855.65, 26.4878, 0.703492}, +{6966.54, 26.4206, 0.683436}, +{7079.22, 26.3466, 0.663872}, +{7193.72, 26.2639, 0.644803}, +{7310.07, 26.1706, 0.626209}, +{7428.31, 26.0635, 0.608093}, +{7548.45, 25.9382, 0.590415}, +{7670.54, 25.7876, 0.573185}, +{7794.61, 25.6001, 0.556386}, +{7920.68, 25.3543, 0.540007}, +{8048.79, 25.0030, 0.524024}, +{8178.98, 24.4098, 0.508444}, +{8311.26, 22.3857, 0.493285}, +{8332.70, 16.7028, 0.490893}, +{8332.90, 16.7033, 3.83905}, +{8445.69, 24.2527, 3.76427}, +{8582.29, 25.1541, 3.67693}, +{8721.11, 25.6675, 3.59086}, +{8862.16, 26.0303, 3.50611}, +{9005.50, 26.3112, 3.42271}, +{9151.16, 26.5399, 3.34062}, +{9299.17, 26.7321, 3.25979}, +{9449.58, 26.8971, 3.18038}, +{9602.42, 27.0410, 3.10241}, +{9757.73, 27.1679, 3.02575}, +{9915.55, 27.2808, 2.95068}, +{10075.9, 27.3820, 2.87686}, +{10238.9, 27.4733, 2.80444}, +{10404.5, 27.5558, 2.73343}, +{10572.8, 27.6307, 2.66382}, +{10743.8, 27.6989, 2.59560}, +{10917.6, 27.7611, 2.52878}, +{11094.2, 27.8180, 2.46334}, +{11273.6, 27.8700, 2.39927}, +{11455.9, 27.9176, 2.33657}, +{11641.2, 27.9613, 2.27521}, +{11829.5, 28.0013, 2.21519}, +{12020.8, 28.0380, 2.15650}, +{12215.3, 28.0716, 2.09912}, +{12412.8, 28.1024, 2.04303}, +{12613.6, 28.1306, 1.98822}, +{12817.6, 28.1564, 1.93467}, +{13025.0, 28.1800, 1.88237}, +{13235.6, 28.2014, 1.83129}, +{13449.7, 28.2210, 1.78141}, +{13667.2, 28.2388, 1.73273}, +{13888.3, 28.2549, 1.68521}, +{14112.9, 28.2694, 1.63884}, +{14341.2, 28.2826, 1.59361}, +{14573.1, 28.2943, 1.54948}, +{14808.9, 28.3048, 1.50644}, +{15048.4, 28.3141, 1.46447}, +{15291.8, 28.3224, 1.42356}, +{15539.1, 28.3296, 1.38367}, +{15790.4, 28.3358, 1.34480}, +{16045.8, 28.3412, 1.30691}, +{16305.4, 28.3457, 1.26999}, +{16569.1, 28.3494, 1.23403}, +{16837.1, 28.3524, 1.19899}, +{17109.4, 28.3547, 1.16487}, +{17386.1, 28.3564, 1.13164}, +{17667.4, 28.3575, 1.09928}, +{17953.1, 28.3581, 1.06777}, +{18243.5, 28.3581, 1.03710}, +{18538.6, 28.3577, 1.00725}, +{18838.4, 28.3568, 0.978188}, +{19143.1, 28.3555, 0.949909}, +{19452.7, 28.3539, 0.922391}, +{19767.4, 28.3518, 0.895616}, +{20087.1, 28.3495, 0.869567}, +{20412.0, 28.3468, 0.844228}, +{20742.1, 28.3439, 0.819580}, +{21077.6, 28.3407, 0.795607}, +{21418.5, 28.3373, 0.772295}, +{21765.0, 28.3336, 0.749624}, +{22117.0, 28.3298, 0.727581}, +{22474.7, 28.3257, 0.706150}, +{22838.2, 28.3216, 0.685315}, +{23207.6, 28.3172, 0.665061}, +{23583.0, 28.3127, 0.645374}, +{23964.4, 28.3081, 0.626241}, +{24352.0, 28.3034, 0.607644}, +{24745.9, 28.2986, 0.589574}, +{25146.2, 28.2937, 0.572013}, +{25552.9, 28.2888, 0.554951}, +{25966.2, 28.2838, 0.538374}, +{26386.1, 28.2787, 0.522269}, +{26812.9, 28.2736, 0.506624}, +{27246.6, 28.2684, 0.491427}, +{27687.3, 28.2632, 0.476665}, +{28135.1, 28.2581, 0.462328}, +{28590.2, 28.2529, 0.448404}, +{29052.6, 28.2480, 0.434882}, +{29522.5, 28.2436, 0.421750}, +{30000.0, 28.2337, 0.408999}, +{0, 0, 0} +}; + +e_fp_fdp cu[] = { /* Z = 29 */ +{10.0000, -9999.00, 1.30088}, +{10.1617, -9999.00, 1.33374}, +{10.3261, -9999.00, 1.36743}, +{10.4931, -9999.00, 1.40197}, +{10.6628, -9999.00, 1.43738}, +{10.8353, -9999.00, 1.47369}, +{11.0106, -9999.00, 1.51091}, +{11.1886, -9999.00, 1.54908}, +{11.3696, -9999.00, 1.58821}, +{11.5535, -9999.00, 1.62833}, +{11.7404, -9999.00, 1.66946}, +{11.9303, -9999.00, 1.71163}, +{12.1232, -9999.00, 1.75487}, +{12.3193, -9999.00, 1.79920}, +{12.5186, -9999.00, 1.84464}, +{12.7210, -9999.00, 1.89124}, +{12.9268, -9999.00, 1.93901}, +{13.1359, -9999.00, 1.98799}, +{13.3483, -9999.00, 2.03821}, +{13.5642, -9999.00, 2.08970}, +{13.7836, -9999.00, 2.14248}, +{14.0066, -9999.00, 2.19660}, +{14.2331, -9999.00, 2.25209}, +{14.4633, -9999.00, 2.30779}, +{14.6973, -9999.00, 2.36382}, +{14.9350, -9999.00, 2.42121}, +{15.1765, -9999.00, 2.47999}, +{15.4220, -9999.00, 2.54019}, +{15.6714, -9999.00, 2.59824}, +{15.9249, -9999.00, 2.65520}, +{16.1825, -9999.00, 2.71341}, +{16.4442, -9999.00, 2.77289}, +{16.7102, -9999.00, 2.83368}, +{16.9805, -9999.00, 2.89580}, +{17.2551, -9999.00, 2.93918}, +{17.5342, -9999.00, 2.97486}, +{17.8178, -9999.00, 3.01098}, +{18.1060, -9999.00, 3.04754}, +{18.3989, -9999.00, 3.08454}, +{18.6964, -9999.00, 3.10571}, +{18.9988, -9999.00, 3.12696}, +{19.3061, -9999.00, 3.14835}, +{19.6184, -9999.00, 3.16989}, +{19.9357, -9999.00, 3.19158}, +{20.2582, -9999.00, 3.20066}, +{20.5858, -9999.00, 3.19641}, +{20.9188, -9999.00, 3.19218}, +{21.2571, -9999.00, 3.18794}, +{21.6009, -9999.00, 3.18372}, +{21.9503, -9999.00, 3.20429}, +{22.3053, -9999.00, 3.23365}, +{22.6661, -9999.00, 3.26327}, +{23.0327, -9999.00, 3.29317}, +{23.4053, -9999.00, 3.33041}, +{23.7838, -9999.00, 3.39669}, +{24.1685, -9999.00, 3.46428}, +{24.5594, -9999.00, 3.53322}, +{24.9566, -9999.00, 3.60353}, +{25.3603, -9999.00, 3.67524}, +{25.7705, -9999.00, 3.77578}, +{26.1873, -9999.00, 3.89227}, +{26.6109, -9999.00, 4.01236}, +{27.0413, -9999.00, 4.13615}, +{27.4786, -9999.00, 4.26376}, +{27.9231, -9999.00, 4.39530}, +{28.3747, -9999.00, 4.53091}, +{28.8337, -9999.00, 4.62195}, +{29.3000, 1.55250, 4.70800}, +{29.7739, 1.65095, 4.79565}, +{30.2555, 1.75782, 4.88494}, +{30.7449, 1.88491, 4.97588}, +{31.2421, 2.05397, 5.06606}, +{31.7475, 2.22143, 5.05780}, +{32.2609, 2.35311, 5.04955}, +{32.7827, 2.47607, 5.04132}, +{33.3130, 2.60841, 5.03052}, +{33.8518, 2.72325, 4.96290}, +{34.3993, 2.80297, 4.89618}, +{34.9557, 2.86036, 4.83037}, +{35.5211, 2.89811, 4.76544}, +{36.0956, 2.91457, 4.70138}, +{36.6794, 2.90141, 4.63818}, +{37.2727, 2.84272, 4.62331}, +{37.8755, 2.82023, 4.64620}, +{38.4882, 2.81008, 4.66919}, +{39.1107, 2.80357, 4.69231}, +{39.7432, 2.79650, 4.71553}, +{40.3861, 2.78488, 4.73888}, +{41.0393, 2.75809, 4.76233}, +{41.7031, 2.71601, 4.82518}, +{42.3776, 2.70061, 4.90395}, +{43.0630, 2.69952, 4.98400}, +{43.7595, 2.70614, 5.06536}, +{44.4673, 2.71923, 5.14805}, +{45.1865, 2.73822, 5.23209}, +{45.9174, 2.76319, 5.31749}, +{46.6600, 2.79640, 5.40430}, +{47.4147, 2.84070, 5.48239}, +{48.1816, 2.87937, 5.55441}, +{48.9609, 2.91623, 5.62737}, +{49.7528, 2.95358, 5.70128}, +{50.5576, 2.99171, 5.77617}, +{51.3753, 3.03082, 5.85204}, +{52.2062, 3.07096, 5.92891}, +{53.0506, 3.11182, 6.00680}, +{53.9087, 3.15229, 6.08718}, +{54.7806, 3.19626, 6.17057}, +{55.6667, 3.24312, 6.25510}, +{56.5670, 3.29248, 6.34079}, +{57.4820, 3.34450, 6.42765}, +{58.4117, 3.39947, 6.51570}, +{59.3564, 3.45809, 6.60496}, +{60.3165, 3.52267, 6.69510}, +{61.2921, 3.58913, 6.77770}, +{62.2834, 3.65483, 6.86131}, +{63.2908, 3.72132, 6.94594}, +{64.3145, 3.78974, 7.03163}, +{65.3547, 3.86074, 7.11837}, +{66.4118, 3.93519, 7.20618}, +{67.4859, 4.01481, 7.29507}, +{68.5775, 4.10554, 7.38506}, +{69.6867, 4.19980, 7.45157}, +{70.8138, 4.28440, 7.51585}, +{71.9591, 4.36355, 7.58068}, +{73.1230, 4.44021, 7.64608}, +{74.3057, 4.51487, 7.71204}, +{75.5076, 4.58764, 7.77857}, +{76.7289, 4.65810, 7.84568}, +{77.9699, 4.72419, 7.91545}, +{79.2310, 4.79179, 7.99051}, +{80.5125, 4.86006, 8.06628}, +{81.8147, 4.92776, 8.14276}, +{83.1380, 4.99337, 8.21997}, +{84.4827, 5.05290, 8.29791}, +{85.8491, 5.10538, 8.39171}, +{87.2377, 5.16992, 8.49627}, +{88.6487, 5.24128, 8.60214}, +{90.0825, 5.31708, 8.70932}, +{91.5395, 5.39635, 8.81783}, +{93.0201, 5.47815, 8.92770}, +{94.5246, 5.56026, 9.03894}, +{96.0535, 5.64431, 9.16033}, +{97.6071, 5.73687, 9.28568}, +{99.1858, 5.83662, 9.41273}, +{100.790, 5.94242, 9.54153}, +{102.420, 6.05439, 9.67210}, +{104.077, 6.17308, 9.80444}, +{105.760, 6.29976, 9.93860}, +{107.471, 6.43882, 10.0698}, +{109.209, 6.57818, 10.1951}, +{110.975, 6.72074, 10.3219}, +{112.770, 6.86839, 10.4503}, +{114.594, 7.02241, 10.5803}, +{116.448, 7.18406, 10.7120}, +{118.331, 7.35528, 10.8452}, +{120.245, 7.53972, 10.9802}, +{122.190, 7.75079, 11.1146}, +{124.166, 7.96258, 11.2038}, +{126.175, 8.16451, 11.2938}, +{128.215, 8.36282, 11.3845}, +{130.289, 8.56273, 11.4759}, +{132.397, 8.76607, 11.5681}, +{134.538, 8.97450, 11.6609}, +{136.714, 9.18969, 11.7546}, +{138.925, 9.41378, 11.8490}, +{141.172, 9.64975, 11.9441}, +{143.456, 9.90432, 12.0400}, +{145.776, 10.2133, 12.1294}, +{148.134, 10.5082, 12.1290}, +{150.530, 10.7700, 12.1285}, +{152.964, 11.0196, 12.1281}, +{155.439, 11.2631, 12.1277}, +{157.953, 11.5037, 12.1273}, +{160.507, 11.7441, 12.1269}, +{163.103, 11.9864, 12.1264}, +{165.742, 12.2338, 12.1260}, +{168.422, 12.4914, 12.1256}, +{171.146, 12.7849, 12.1252}, +{173.915, 13.0838, 12.0498}, +{176.727, 13.3422, 11.9562}, +{179.586, 13.5797, 11.8633}, +{182.491, 13.8046, 11.7711}, +{185.442, 14.0205, 11.6797}, +{188.442, 14.2300, 11.5890}, +{191.489, 14.4352, 11.4989}, +{194.587, 14.6390, 11.4096}, +{197.734, 14.8493, 11.3210}, +{200.932, 15.0630, 11.2039}, +{204.182, 15.2549, 11.0754}, +{207.485, 15.4288, 10.9484}, +{210.840, 15.5918, 10.8229}, +{214.251, 15.7413, 10.6988}, +{217.716, 15.8852, 10.5875}, +{221.237, 16.0285, 10.4783}, +{224.816, 16.1694, 10.3702}, +{228.452, 16.3074, 10.2632}, +{232.147, 16.4429, 10.1573}, +{235.902, 16.5762, 10.0525}, +{239.717, 16.7082, 9.94883}, +{243.595, 16.8443, 9.84619}, +{247.535, 16.9763, 9.73053}, +{251.538, 17.0989, 9.61505}, +{255.607, 17.2157, 9.50095}, +{259.741, 17.3280, 9.38819}, +{263.942, 17.4364, 9.27677}, +{268.211, 17.5414, 9.16669}, +{272.549, 17.6433, 9.05790}, +{276.957, 17.7423, 8.95041}, +{281.437, 17.8389, 8.84419}, +{285.989, 17.9333, 8.73923}, +{290.615, 18.0260, 8.63551}, +{295.315, 18.1173, 8.53304}, +{300.092, 18.2081, 8.43177}, +{304.945, 18.3060, 8.32868}, +{309.878, 18.3963, 8.21445}, +{314.890, 18.4777, 8.10177}, +{319.983, 18.5545, 7.99065}, +{325.158, 18.6275, 7.88105}, +{330.418, 18.6971, 7.77296}, +{335.762, 18.7639, 7.66634}, +{341.192, 18.8279, 7.56119}, +{346.711, 18.8896, 7.45749}, +{352.319, 18.9493, 7.35519}, +{358.017, 19.0082, 7.25432}, +{363.808, 19.0655, 7.15219}, +{369.692, 19.1193, 7.05012}, +{375.672, 19.1703, 6.94953}, +{381.748, 19.2194, 6.85037}, +{387.922, 19.2671, 6.75262}, +{394.197, 19.3142, 6.65627}, +{400.573, 19.3616, 6.56129}, +{407.052, 19.4153, 6.46767}, +{413.635, 19.4783, 6.35980}, +{420.326, 19.5225, 6.23335}, +{427.124, 19.5525, 6.10942}, +{434.032, 19.5728, 5.98794}, +{441.052, 19.5846, 5.86890}, +{448.186, 19.5880, 5.75221}, +{455.435, 19.5829, 5.63784}, +{462.802, 19.5496, 5.53428}, +{470.287, 19.5269, 5.46085}, +{477.894, 19.5179, 5.38839}, +{485.623, 19.5118, 5.31688}, +{493.478, 19.5081, 5.24633}, +{501.459, 19.5065, 5.17672}, +{509.570, 19.5176, 5.10273}, +{517.812, 19.5193, 5.01342}, +{526.187, 19.5094, 4.92566}, +{534.698, 19.4943, 4.83945}, +{543.346, 19.4746, 4.75473}, +{552.134, 19.4507, 4.67152}, +{561.065, 19.4230, 4.58974}, +{570.139, 19.3917, 4.50941}, +{579.361, 19.3608, 4.43048}, +{588.732, 19.3260, 4.34393}, +{598.254, 19.2803, 4.25521}, +{607.930, 19.2260, 4.16831}, +{617.763, 19.1641, 4.08318}, +{627.755, 19.0949, 3.99979}, +{637.908, 19.0192, 3.91810}, +{648.226, 18.9384, 3.83581}, +{658.711, 18.8451, 3.74932}, +{669.365, 18.7389, 3.66477}, +{680.191, 18.6199, 3.58213}, +{691.193, 18.4873, 3.50135}, +{702.372, 18.3346, 3.42240}, +{713.733, 18.1634, 3.35770}, +{725.277, 17.9871, 3.30516}, +{737.008, 17.8009, 3.25344}, +{748.928, 17.5999, 3.20253}, +{761.042, 17.3802, 3.15242}, +{773.351, 17.1401, 3.10310}, +{785.859, 16.8765, 3.04912}, +{798.570, 16.5705, 2.98532}, +{811.486, 16.2143, 2.92286}, +{824.611, 15.7988, 2.86170}, +{837.949, 15.3072, 2.80183}, +{851.502, 14.7270, 2.74321}, +{865.274, 13.9964, 2.65809}, +{879.269, 13.0270, 2.57208}, +{893.491, 11.6745, 2.49603}, +{907.943, 9.63107, 2.43609}, +{922.628, 5.28471, 2.25909}, +{932.400, -18.0747, 2.14991}, +{932.600, -18.0552, 18.4786}, +{937.551, 2.42254, 18.2953}, +{952.715, 9.96436, 17.7508}, +{968.124, 13.1149, 17.2224}, +{983.783, 15.1297, 16.7102}, +{999.695, 16.5865, 16.2132}, +{1015.86, 17.6966, 15.7311}, +{1032.29, 18.4996, 15.2631}, +{1048.99, 19.0803, 14.9435}, +{1065.96, 19.6526, 14.7764}, +{1083.20, 20.2159, 14.6112}, +{1100.72, 20.7495, 14.4479}, +{1118.52, 21.2540, 14.2865}, +{1136.61, 21.7327, 14.1267}, +{1155.00, 22.1900, 13.9688}, +{1173.68, 22.6303, 13.8127}, +{1192.66, 23.0589, 13.6583}, +{1211.95, 23.4828, 13.5056}, +{1231.55, 23.9199, 13.3547}, +{1251.47, 24.3712, 13.1591}, +{1271.72, 24.8206, 12.9133}, +{1292.29, 25.2016, 12.6075}, +{1313.19, 25.5284, 12.3091}, +{1334.43, 25.8205, 12.0178}, +{1356.01, 26.0853, 11.7333}, +{1377.94, 26.3272, 11.4555}, +{1400.23, 26.5493, 11.1844}, +{1422.88, 26.7542, 10.9196}, +{1445.89, 26.9437, 10.6611}, +{1469.28, 27.1195, 10.4085}, +{1493.04, 27.2830, 10.1616}, +{1517.19, 27.4346, 9.91926}, +{1541.73, 27.5749, 9.68255}, +{1566.67, 27.7052, 9.45157}, +{1592.01, 27.8263, 9.22606}, +{1617.76, 27.9391, 9.00590}, +{1643.92, 28.0442, 8.79103}, +{1670.51, 28.1425, 8.58125}, +{1697.53, 28.2344, 8.37649}, +{1724.99, 28.3230, 8.17659}, +{1752.89, 28.4058, 7.97676}, +{1781.24, 28.4810, 7.78017}, +{1810.05, 28.5492, 7.58711}, +{1839.32, 28.6108, 7.39897}, +{1869.07, 28.6671, 7.21555}, +{1899.30, 28.7187, 7.03672}, +{1930.02, 28.7658, 6.86213}, +{1961.24, 28.8086, 6.69190}, +{1992.96, 28.8468, 6.52606}, +{2025.20, 28.8850, 6.36699}, +{2057.95, 28.9205, 6.20664}, +{2091.24, 28.9508, 6.05001}, +{2125.06, 28.9777, 5.89702}, +{2159.43, 29.0016, 5.74751}, +{2194.36, 29.0224, 5.60115}, +{2229.85, 29.0402, 5.45834}, +{2265.92, 29.0554, 5.31903}, +{2302.57, 29.0685, 5.18292}, +{2339.81, 29.0790, 5.04977}, +{2377.66, 29.0874, 4.92010}, +{2416.11, 29.0938, 4.79321}, +{2455.19, 29.0982, 4.66959}, +{2494.90, 29.1008, 4.54872}, +{2535.26, 29.1016, 4.43093}, +{2576.26, 29.1009, 4.31615}, +{2617.93, 29.0987, 4.20392}, +{2660.27, 29.0950, 4.09434}, +{2703.30, 29.0900, 3.98775}, +{2747.03, 29.0838, 3.88362}, +{2791.46, 29.0763, 3.78207}, +{2836.61, 29.0678, 3.68302}, +{2882.49, 29.0582, 3.58644}, +{2929.11, 29.0477, 3.49224}, +{2976.48, 29.0362, 3.40040}, +{3024.63, 29.0238, 3.31086}, +{3073.55, 29.0107, 3.22358}, +{3123.26, 28.9968, 3.13847}, +{3173.78, 28.9822, 3.05553}, +{3225.11, 28.9669, 2.97464}, +{3277.27, 28.9510, 2.89585}, +{3330.28, 28.9345, 2.81902}, +{3384.15, 28.9174, 2.74417}, +{3438.88, 28.8999, 2.67122}, +{3494.50, 28.8818, 2.60014}, +{3551.02, 28.8633, 2.53085}, +{3608.46, 28.8444, 2.46334}, +{3666.82, 28.8251, 2.39757}, +{3726.13, 28.8053, 2.33346}, +{3786.40, 28.7852, 2.27105}, +{3847.64, 28.7648, 2.21020}, +{3909.87, 28.7440, 2.15092}, +{3973.11, 28.7230, 2.09321}, +{4037.38, 28.7016, 2.03696}, +{4102.68, 28.6799, 1.98216}, +{4169.03, 28.6580, 1.92878}, +{4236.46, 28.6357, 1.87677}, +{4304.98, 28.6132, 1.82613}, +{4374.62, 28.5903, 1.77679}, +{4445.37, 28.5673, 1.72877}, +{4517.27, 28.5440, 1.68197}, +{4590.33, 28.5203, 1.63632}, +{4664.58, 28.4963, 1.59195}, +{4740.03, 28.4721, 1.54870}, +{4816.69, 28.4476, 1.50655}, +{4894.60, 28.4227, 1.46552}, +{4973.77, 28.3975, 1.42555}, +{5054.21, 28.3718, 1.38663}, +{5135.96, 28.3459, 1.34873}, +{5219.03, 28.3195, 1.31182}, +{5303.44, 28.2926, 1.27581}, +{5389.22, 28.2652, 1.24083}, +{5476.39, 28.2374, 1.20670}, +{5564.97, 28.2089, 1.17344}, +{5654.98, 28.1798, 1.14113}, +{5746.44, 28.1500, 1.10956}, +{5839.39, 28.1194, 1.07891}, +{5933.83, 28.0880, 1.04895}, +{6029.81, 28.0556, 1.01985}, +{6127.33, 28.0223, 0.991530}, +{6226.44, 27.9878, 0.963866}, +{6327.15, 27.9520, 0.936946}, +{6429.48, 27.9147, 0.910741}, +{6533.48, 27.8759, 0.885194}, +{6639.15, 27.8352, 0.860322}, +{6746.54, 27.7924, 0.836094}, +{6855.65, 27.7473, 0.812505}, +{6966.54, 27.6995, 0.789511}, +{7079.22, 27.6485, 0.767114}, +{7193.72, 27.5939, 0.745298}, +{7310.07, 27.5350, 0.724043}, +{7428.31, 27.4710, 0.703338}, +{7548.45, 27.4009, 0.683167}, +{7670.54, 27.3233, 0.663518}, +{7794.61, 27.2366, 0.644376}, +{7920.68, 27.1381, 0.625722}, +{8048.79, 27.0246, 0.607548}, +{8178.98, 26.8906, 0.589836}, +{8311.26, 26.7281, 0.572588}, +{8445.69, 26.5227, 0.555773}, +{8582.29, 26.2467, 0.539391}, +{8721.11, 25.8345, 0.523425}, +{8862.16, 25.0487, 0.507876}, +{8978.80, 17.5735, 0.495545}, +{8979.00, 17.5739, 3.85305}, +{9005.50, 23.5690, 3.83652}, +{9151.16, 25.6405, 3.74771}, +{9299.17, 26.3539, 3.66034}, +{9449.58, 26.8037, 3.57419}, +{9602.42, 27.1340, 3.48938}, +{9757.73, 27.3949, 3.40592}, +{9915.55, 27.6099, 3.32398}, +{10075.9, 27.7922, 3.24324}, +{10238.9, 27.9495, 3.16389}, +{10404.5, 28.0873, 3.08595}, +{10572.8, 28.2092, 3.00942}, +{10743.8, 28.3179, 2.93430}, +{10917.6, 28.4155, 2.86061}, +{11094.2, 28.5035, 2.78833}, +{11273.6, 28.5832, 2.71747}, +{11455.9, 28.6557, 2.64802}, +{11641.2, 28.7216, 2.57999}, +{11829.5, 28.7818, 2.51335}, +{12020.8, 28.8368, 2.44811}, +{12215.3, 28.8872, 2.38424}, +{12412.8, 28.9333, 2.32175}, +{12613.6, 28.9756, 2.26061}, +{12817.6, 29.0143, 2.20082}, +{13025.0, 29.0497, 2.14236}, +{13235.6, 29.0822, 2.08521}, +{13449.7, 29.1120, 2.02936}, +{13667.2, 29.1392, 1.97479}, +{13888.3, 29.1641, 1.92148}, +{14112.9, 29.1868, 1.86942}, +{14341.2, 29.2074, 1.81858}, +{14573.1, 29.2262, 1.76895}, +{14808.9, 29.2433, 1.72051}, +{15048.4, 29.2587, 1.67324}, +{15291.8, 29.2726, 1.62712}, +{15539.1, 29.2851, 1.58213}, +{15790.4, 29.2963, 1.53824}, +{16045.8, 29.3063, 1.49545}, +{16305.4, 29.3151, 1.45372}, +{16569.1, 29.3229, 1.41304}, +{16837.1, 29.3296, 1.37339}, +{17109.4, 29.3354, 1.33475}, +{17386.1, 29.3404, 1.29710}, +{17667.4, 29.3445, 1.26041}, +{17953.1, 29.3479, 1.22467}, +{18243.5, 29.3505, 1.18985}, +{18538.6, 29.3526, 1.15595}, +{18838.4, 29.3539, 1.12294}, +{19143.1, 29.3547, 1.09079}, +{19452.7, 29.3550, 1.05949}, +{19767.4, 29.3548, 1.02903}, +{20087.1, 29.3541, 0.999375}, +{20412.0, 29.3530, 0.970516}, +{20742.1, 29.3515, 0.942433}, +{21077.6, 29.3496, 0.915106}, +{21418.5, 29.3474, 0.888521}, +{21765.0, 29.3449, 0.862657}, +{22117.0, 29.3420, 0.837500}, +{22474.7, 29.3389, 0.813031}, +{22838.2, 29.3356, 0.789233}, +{23207.6, 29.3320, 0.766091}, +{23583.0, 29.3282, 0.743588}, +{23964.4, 29.3242, 0.721709}, +{24352.0, 29.3201, 0.700438}, +{24745.9, 29.3157, 0.679760}, +{25146.2, 29.3113, 0.659660}, +{25552.9, 29.3067, 0.640123}, +{25966.2, 29.3020, 0.621136}, +{26386.1, 29.2972, 0.602683}, +{26812.9, 29.2923, 0.584752}, +{27246.6, 29.2873, 0.567329}, +{27687.3, 29.2823, 0.550400}, +{28135.1, 29.2772, 0.533953}, +{28590.2, 29.2721, 0.517976}, +{29052.6, 29.2669, 0.502455}, +{29522.5, 29.2617, 0.487378}, +{30000.0, 29.2564, 0.472735}, +{0, 0, 0} +}; + +e_fp_fdp zn[] = { /* Z = 30 */ +{10.0000, -9999.00, 2.21675}, +{10.1617, -9999.00, 2.11915}, +{10.3261, -9999.00, 2.02585}, +{10.4931, -9999.00, 1.93665}, +{10.6628, -9999.00, 1.85138}, +{10.8353, -9999.00, 1.76986}, +{11.0106, -9999.00, 1.69194}, +{11.1886, -9999.00, 1.63293}, +{11.3696, -9999.00, 1.57784}, +{11.5535, -9999.00, 1.52460}, +{11.7404, -9999.00, 1.47317}, +{11.9303, -9999.00, 1.41678}, +{12.1232, -9999.00, 1.35880}, +{12.3193, -9999.00, 1.30320}, +{12.5186, -9999.00, 1.29898}, +{12.7210, -9999.00, 1.30061}, +{12.9268, -9999.00, 1.30258}, +{13.1359, -9999.00, 1.31477}, +{13.3483, -9999.00, 1.32707}, +{13.5642, -9999.00, 1.33949}, +{13.7836, -9999.00, 1.35171}, +{14.0066, -9999.00, 1.36387}, +{14.2331, -9999.00, 1.37615}, +{14.4633, -9999.00, 1.38853}, +{14.6973, -9999.00, 1.40102}, +{14.9350, -9999.00, 1.41363}, +{15.1765, -9999.00, 1.42635}, +{15.4220, -9999.00, 1.43918}, +{15.6714, -9999.00, 1.45213}, +{15.9249, -9999.00, 1.46519}, +{16.1825, -9999.00, 1.49662}, +{16.4442, -9999.00, 1.52989}, +{16.7102, -9999.00, 1.56390}, +{16.9805, -9999.00, 1.59867}, +{17.2551, -9999.00, 1.63422}, +{17.5342, -9999.00, 1.67055}, +{17.8178, -9999.00, 1.70769}, +{18.1060, -9999.00, 1.74565}, +{18.3989, -9999.00, 1.78446}, +{18.6964, -9999.00, 1.82414}, +{18.9988, -9999.00, 1.86469}, +{19.3061, -9999.00, 1.90615}, +{19.6184, -9999.00, 1.94852}, +{19.9357, -9999.00, 1.99185}, +{20.2582, -9999.00, 2.04253}, +{20.5858, -9999.00, 2.09481}, +{20.9188, -9999.00, 2.14843}, +{21.2571, -9999.00, 2.20343}, +{21.6009, -9999.00, 2.25983}, +{21.9503, -9999.00, 2.31768}, +{22.3053, -9999.00, 2.37700}, +{22.6661, -9999.00, 2.43784}, +{23.0327, -9999.00, 2.50025}, +{23.4053, -9999.00, 2.56425}, +{23.7838, -9999.00, 2.62988}, +{24.1685, -9999.00, 2.69720}, +{24.5594, -9999.00, 2.76624}, +{24.9566, -9999.00, 2.83705}, +{25.3603, -9999.00, 2.90967}, +{25.7705, -9999.00, 2.98415}, +{26.1873, -9999.00, 3.06053}, +{26.6109, -9999.00, 3.14002}, +{27.0413, -9999.00, 3.22160}, +{27.4786, -9999.00, 3.30531}, +{27.9231, -9999.00, 3.39119}, +{28.3747, -9999.00, 3.47930}, +{28.8337, -9999.00, 3.56970}, +{29.3000, -0.776021, 3.66245}, +{29.7739, -0.773223, 3.75761}, +{30.2555, -0.768501, 3.85525}, +{30.7449, -0.761632, 3.95541}, +{31.2421, -0.752332, 4.05818}, +{31.7475, -0.740234, 4.16363}, +{32.2609, -0.724803, 4.27181}, +{32.7827, -0.705148, 4.38280}, +{33.3130, -0.679227, 4.49668}, +{33.8518, -0.641458, 4.60456}, +{34.3993, -0.610078, 4.70598}, +{34.9557, -0.580116, 4.80963}, +{35.5211, -0.549776, 4.91556}, +{36.0956, -0.518270, 5.02382}, +{36.6794, -0.485088, 5.13448}, +{37.2727, -0.449802, 5.24757}, +{37.8755, -0.412036, 5.36314}, +{38.4882, -0.371393, 5.48127}, +{39.1107, -0.327445, 5.60199}, +{39.7432, -0.279697, 5.72538}, +{40.3861, -0.227567, 5.85148}, +{41.0393, -0.170310, 5.98036}, +{41.7031, -0.106943, 6.11208}, +{42.3776, -0.360293E-01, 6.24670}, +{43.0630, 0.445447E-01, 6.38429}, +{43.7595, 0.142962, 6.52490}, +{44.4673, 0.279376, 6.64850}, +{45.1865, 0.395691, 6.72805}, +{45.9174, 0.494574, 6.80854}, +{46.6600, 0.587305, 6.89000}, +{47.4147, 0.676510, 6.97243}, +{48.1816, 0.763621, 7.05586}, +{48.9609, 0.849518, 7.14028}, +{49.7528, 0.934855, 7.22570}, +{50.5576, 1.02011, 7.31215}, +{51.3753, 1.10570, 7.39964}, +{52.2062, 1.19198, 7.48817}, +{53.0506, 1.27933, 7.57775}, +{53.9087, 1.36810, 7.66842}, +{54.7806, 1.45870, 7.76017}, +{55.6667, 1.55164, 7.85301}, +{56.5670, 1.64759, 7.94696}, +{57.4820, 1.74753, 8.04204}, +{58.4117, 1.85504, 8.13826}, +{59.3564, 1.98045, 8.22295}, +{60.3165, 2.09242, 8.29284}, +{61.2921, 2.19732, 8.36333}, +{62.2834, 2.29996, 8.43442}, +{63.2908, 2.40119, 8.50610}, +{64.3145, 2.50160, 8.57840}, +{65.3547, 2.60157, 8.65132}, +{66.4118, 2.70142, 8.72484}, +{67.4859, 2.80139, 8.79900}, +{68.5775, 2.90170, 8.87380}, +{69.6867, 3.00257, 8.94922}, +{70.8138, 3.10427, 9.02528}, +{71.9591, 3.20713, 9.10200}, +{73.1230, 3.31207, 9.17936}, +{74.3057, 3.42206, 9.25724}, +{75.5076, 3.53130, 9.32497}, +{76.7289, 3.63643, 9.39320}, +{77.9699, 3.73952, 9.46193}, +{79.2310, 3.84104, 9.53116}, +{80.5125, 3.94093, 9.60090}, +{81.8147, 4.03877, 9.67114}, +{83.1380, 4.13273, 9.74191}, +{84.4827, 4.21540, 9.81362}, +{85.8491, 4.30144, 9.91179}, +{87.2377, 4.39863, 10.0109}, +{88.6487, 4.50187, 10.1111}, +{90.0825, 4.60971, 10.2122}, +{91.5395, 4.72168, 10.3144}, +{93.0201, 4.83756, 10.4176}, +{94.5246, 4.95735, 10.5218}, +{96.0535, 5.08112, 10.6270}, +{97.6071, 5.20911, 10.7333}, +{99.1858, 5.34159, 10.8407}, +{100.790, 5.47905, 10.9491}, +{102.420, 5.62221, 11.0587}, +{104.077, 5.77232, 11.1693}, +{105.760, 5.93214, 11.2810}, +{107.471, 6.11215, 11.3867}, +{109.209, 6.28638, 11.4667}, +{110.975, 6.45467, 11.5474}, +{112.770, 6.62137, 11.6286}, +{114.594, 6.78920, 11.7104}, +{116.448, 6.95957, 11.7927}, +{118.331, 7.13395, 11.8757}, +{120.245, 7.31437, 11.9592}, +{122.190, 7.50484, 12.0433}, +{124.166, 7.71899, 12.1280}, +{126.175, 7.97487, 12.1589}, +{128.215, 8.17143, 12.1318}, +{130.289, 8.32718, 12.1048}, +{132.397, 8.44808, 12.0779}, +{134.538, 8.52180, 12.0510}, +{136.714, 8.46565, 12.0242}, +{138.925, 8.38133, 12.2805}, +{141.172, 8.47360, 12.6256}, +{143.456, 8.69958, 12.9805}, +{145.776, 9.17969, 13.2730}, +{148.134, 9.58846, 13.2870}, +{150.530, 9.89741, 13.3010}, +{152.964, 10.1781, 13.3150}, +{155.439, 10.4431, 13.3290}, +{157.953, 10.6986, 13.3430}, +{160.507, 10.9483, 13.3571}, +{163.103, 11.1947, 13.3712}, +{165.742, 11.4399, 13.3853}, +{168.422, 11.6854, 13.3993}, +{171.146, 11.9331, 13.4135}, +{173.915, 12.1849, 13.4276}, +{176.727, 12.4440, 13.4417}, +{179.586, 12.7177, 13.4559}, +{182.491, 13.0284, 13.4390}, +{185.442, 13.3103, 13.3832}, +{188.442, 13.5693, 13.3275}, +{191.489, 13.8214, 13.2721}, +{194.587, 14.0695, 13.2170}, +{197.734, 14.3163, 13.1621}, +{200.932, 14.5642, 13.1074}, +{204.182, 14.8169, 13.0529}, +{207.485, 15.0804, 12.9986}, +{210.840, 15.3763, 12.9446}, +{214.251, 15.6953, 12.8045}, +{217.716, 15.9603, 12.6274}, +{221.237, 16.1810, 12.4527}, +{224.816, 16.3781, 12.2804}, +{228.452, 16.5425, 12.1105}, +{232.147, 16.6996, 11.9778}, +{235.902, 16.8612, 11.8471}, +{239.717, 17.0205, 11.7177}, +{243.595, 17.1762, 11.5898}, +{247.535, 17.3281, 11.4633}, +{251.538, 17.4762, 11.3382}, +{255.607, 17.6206, 11.2144}, +{259.741, 17.7616, 11.0920}, +{263.942, 17.8993, 10.9709}, +{268.211, 18.0341, 10.8511}, +{272.549, 18.1661, 10.7327}, +{276.957, 18.2957, 10.6155}, +{281.437, 18.4232, 10.4996}, +{285.989, 18.5490, 10.3850}, +{290.615, 18.6737, 10.2717}, +{295.315, 18.7983, 10.1595}, +{300.092, 18.9256, 10.0486}, +{304.945, 19.0576, 9.92718}, +{309.878, 19.1795, 9.79825}, +{314.890, 19.2922, 9.67098}, +{319.983, 19.4002, 9.54537}, +{325.158, 19.5045, 9.42140}, +{330.418, 19.6055, 9.29903}, +{335.762, 19.7039, 9.17825}, +{341.192, 19.8001, 9.05904}, +{346.711, 19.8946, 8.94138}, +{352.319, 19.9879, 8.82525}, +{358.017, 20.0807, 8.71063}, +{363.808, 20.1741, 8.59749}, +{369.692, 20.2694, 8.48582}, +{375.672, 20.3696, 8.37561}, +{381.748, 20.4961, 8.25075}, +{387.922, 20.6004, 8.09404}, +{394.197, 20.6813, 7.94030}, +{400.573, 20.7527, 7.78948}, +{407.052, 20.8164, 7.64153}, +{413.635, 20.8739, 7.49639}, +{420.326, 20.9260, 7.35400}, +{427.124, 20.9737, 7.21433}, +{434.032, 21.0176, 7.07729}, +{441.052, 21.0586, 6.94287}, +{448.186, 21.0978, 6.81100}, +{455.435, 21.1375, 6.68163}, +{462.802, 21.1887, 6.54388}, +{470.287, 21.2241, 6.38945}, +{477.894, 21.2422, 6.23865}, +{485.623, 21.2519, 6.09142}, +{493.478, 21.2541, 5.94765}, +{501.459, 21.2495, 5.80729}, +{509.570, 21.2387, 5.67023}, +{517.812, 21.2218, 5.53642}, +{526.187, 21.1988, 5.40575}, +{534.698, 21.1695, 5.27817}, +{543.346, 21.1327, 5.15360}, +{552.134, 21.0828, 5.03197}, +{561.065, 21.0327, 4.93231}, +{570.139, 20.9823, 4.83383}, +{579.361, 20.9323, 4.74119}, +{588.732, 20.8817, 4.65153}, +{598.254, 20.8305, 4.56431}, +{607.930, 20.7776, 4.47866}, +{617.763, 20.7226, 4.39466}, +{627.755, 20.6662, 4.31200}, +{637.908, 20.6073, 4.22781}, +{648.226, 20.5433, 4.14084}, +{658.711, 20.4695, 4.05279}, +{669.365, 20.3844, 3.96658}, +{680.191, 20.2884, 3.89183}, +{691.193, 20.1910, 3.82593}, +{702.372, 20.0962, 3.76353}, +{713.733, 19.9984, 3.69825}, +{725.277, 19.8926, 3.63144}, +{737.008, 19.7785, 3.56582}, +{748.928, 19.6559, 3.50143}, +{761.042, 19.5248, 3.43806}, +{773.351, 19.3853, 3.37406}, +{785.859, 19.2341, 3.30526}, +{798.570, 19.0629, 3.23298}, +{811.486, 18.8712, 3.16227}, +{824.611, 18.6577, 3.09309}, +{837.949, 18.4196, 3.02541}, +{851.502, 18.1529, 2.95935}, +{865.274, 17.8525, 2.89479}, +{879.269, 17.5114, 2.83170}, +{893.491, 17.1200, 2.77006}, +{907.943, 16.6648, 2.70974}, +{922.628, 16.1244, 2.65071}, +{937.551, 15.4734, 2.60046}, +{952.715, 14.6664, 2.55306}, +{968.124, 13.6188, 2.50819}, +{983.783, 12.1504, 2.46410}, +{999.695, 9.77174, 2.42102}, +{1015.86, 3.76919, 2.37892}, +{1021.70, -15.4199, 2.36407}, +{1021.90, -15.4118, 17.2327}, +{1032.29, 6.78343, 17.1037}, +{1048.99, 11.5047, 16.9012}, +{1065.96, 13.9824, 16.7012}, +{1083.20, 15.7067, 16.5025}, +{1100.72, 17.0460, 16.3064}, +{1118.52, 18.1518, 16.1129}, +{1136.61, 19.1008, 15.9216}, +{1155.00, 19.9384, 15.7325}, +{1173.68, 20.6939, 15.5457}, +{1192.66, 21.3889, 15.3612}, +{1211.95, 22.0414, 15.1788}, +{1231.55, 22.6773, 14.9985}, +{1251.47, 23.3018, 14.7734}, +{1271.72, 23.9032, 14.5006}, +{1292.29, 24.4216, 14.1709}, +{1313.19, 24.8733, 13.8488}, +{1334.43, 25.2792, 13.5340}, +{1356.01, 25.6482, 13.2265}, +{1377.94, 25.9862, 12.9259}, +{1400.23, 26.2971, 12.6321}, +{1422.88, 26.5843, 12.3449}, +{1445.89, 26.8507, 12.0644}, +{1469.28, 27.0988, 11.7896}, +{1493.04, 27.3304, 11.5203}, +{1517.19, 27.5455, 11.2544}, +{1541.73, 27.7449, 10.9942}, +{1566.67, 27.9302, 10.7400}, +{1592.01, 28.1031, 10.4916}, +{1617.76, 28.2645, 10.2490}, +{1643.92, 28.4157, 10.0120}, +{1670.51, 28.5577, 9.78048}, +{1697.53, 28.6913, 9.55431}, +{1724.99, 28.8210, 9.33336}, +{1752.89, 28.9428, 9.11024}, +{1781.24, 29.0539, 8.89009}, +{1810.05, 29.1556, 8.67363}, +{1839.32, 29.2485, 8.46234}, +{1869.07, 29.3341, 8.25614}, +{1899.30, 29.4130, 8.05493}, +{1930.02, 29.4859, 7.85868}, +{1961.24, 29.5532, 7.66730}, +{1992.96, 29.6146, 7.48068}, +{2025.20, 29.6757, 7.30176}, +{2057.95, 29.7333, 7.12066}, +{2091.24, 29.7840, 6.94307}, +{2125.06, 29.8299, 6.76946}, +{2159.43, 29.8714, 6.59974}, +{2194.36, 29.9092, 6.43388}, +{2229.85, 29.9429, 6.27136}, +{2265.92, 29.9731, 6.11279}, +{2302.57, 30.0002, 5.95786}, +{2339.81, 30.0241, 5.80606}, +{2377.66, 30.0449, 5.65807}, +{2416.11, 30.0630, 5.51334}, +{2455.19, 30.0783, 5.37202}, +{2494.90, 30.0912, 5.23407}, +{2535.26, 30.1019, 5.09933}, +{2576.26, 30.1103, 4.96775}, +{2617.93, 30.1165, 4.83924}, +{2660.27, 30.1208, 4.71406}, +{2703.30, 30.1233, 4.59161}, +{2747.03, 30.1241, 4.47218}, +{2791.46, 30.1231, 4.35568}, +{2836.61, 30.1207, 4.24205}, +{2882.49, 30.1168, 4.13114}, +{2929.11, 30.1116, 4.02294}, +{2976.48, 30.1051, 3.91741}, +{3024.63, 30.0973, 3.81450}, +{3073.55, 30.0885, 3.71411}, +{3123.26, 30.0785, 3.61621}, +{3173.78, 30.0676, 3.52074}, +{3225.11, 30.0557, 3.42769}, +{3277.27, 30.0429, 3.33695}, +{3330.28, 30.0294, 3.24849}, +{3384.15, 30.0150, 3.16229}, +{3438.88, 29.9999, 3.07827}, +{3494.50, 29.9841, 2.99636}, +{3551.02, 29.9678, 2.91654}, +{3608.46, 29.9507, 2.83873}, +{3666.82, 29.9332, 2.76294}, +{3726.13, 29.9151, 2.68908}, +{3786.40, 29.8965, 2.61709}, +{3847.64, 29.8775, 2.54695}, +{3909.87, 29.8580, 2.47863}, +{3973.11, 29.8381, 2.41202}, +{4037.38, 29.8178, 2.34720}, +{4102.68, 29.7971, 2.28400}, +{4169.03, 29.7761, 2.22246}, +{4236.46, 29.7547, 2.16251}, +{4304.98, 29.7331, 2.10414}, +{4374.62, 29.7111, 2.04722}, +{4445.37, 29.6888, 1.99183}, +{4517.27, 29.6662, 1.93789}, +{4590.33, 29.6434, 1.88530}, +{4664.58, 29.6202, 1.83415}, +{4740.03, 29.5968, 1.78428}, +{4816.69, 29.5731, 1.73575}, +{4894.60, 29.5491, 1.68848}, +{4973.77, 29.5248, 1.64246}, +{5054.21, 29.5002, 1.59766}, +{5135.96, 29.4753, 1.55398}, +{5219.03, 29.4501, 1.51146}, +{5303.44, 29.4246, 1.47005}, +{5389.22, 29.3987, 1.42974}, +{5476.39, 29.3724, 1.39045}, +{5564.97, 29.3456, 1.35225}, +{5654.98, 29.3185, 1.31507}, +{5746.44, 29.2910, 1.27882}, +{5839.39, 29.2628, 1.24350}, +{5933.83, 29.2342, 1.20914}, +{6029.81, 29.2049, 1.17569}, +{6127.33, 29.1750, 1.14312}, +{6226.44, 29.1443, 1.11136}, +{6327.15, 29.1129, 1.08048}, +{6429.48, 29.0806, 1.05044}, +{6533.48, 29.0473, 1.02112}, +{6639.15, 29.0129, 0.992600}, +{6746.54, 28.9773, 0.964826}, +{6855.65, 28.9404, 0.937786}, +{6966.54, 28.9019, 0.911450}, +{7079.22, 28.8618, 0.885808}, +{7193.72, 28.8197, 0.860833}, +{7310.07, 28.7754, 0.836517}, +{7428.31, 28.7285, 0.812835}, +{7548.45, 28.6788, 0.789772}, +{7670.54, 28.6257, 0.767321}, +{7794.61, 28.5687, 0.745456}, +{7920.68, 28.5070, 0.724156}, +{8048.79, 28.4398, 0.703408}, +{8178.98, 28.3659, 0.683209}, +{8311.26, 28.2838, 0.663533}, +{8445.69, 28.1913, 0.644378}, +{8582.29, 28.0858, 0.625712}, +{8721.11, 27.9628, 0.607531}, +{8862.16, 27.8162, 0.589828}, +{9005.50, 27.6352, 0.572591}, +{9151.16, 27.4010, 0.555792}, +{9299.17, 27.0735, 0.539425}, +{9449.58, 26.5430, 0.523484}, +{9602.42, 25.1991, 0.507960}, +{9658.50, 18.4095, 0.502440}, +{9658.70, 18.4099, 3.89191}, +{9757.73, 25.9194, 3.83265}, +{9915.55, 27.0089, 3.74123}, +{10075.9, 27.5766, 3.65173}, +{10238.9, 27.9665, 3.56370}, +{10404.5, 28.2638, 3.47717}, +{10572.8, 28.5036, 3.39214}, +{10743.8, 28.7037, 3.30863}, +{10917.6, 28.8747, 3.22663}, +{11094.2, 29.0231, 3.14617}, +{11273.6, 29.1537, 3.06723}, +{11455.9, 29.2695, 2.98982}, +{11641.2, 29.3730, 2.91394}, +{11829.5, 29.4660, 2.83957}, +{12020.8, 29.5500, 2.76672}, +{12215.3, 29.6261, 2.69537}, +{12412.8, 29.6952, 2.62552}, +{12613.6, 29.7582, 2.55716}, +{12817.6, 29.8156, 2.49026}, +{13025.0, 29.8681, 2.42482}, +{13235.6, 29.9160, 2.36082}, +{13449.7, 29.9599, 2.29824}, +{13667.2, 30.0001, 2.23707}, +{13888.3, 30.0368, 2.17730}, +{14112.9, 30.0705, 2.11889}, +{14341.2, 30.1012, 2.06184}, +{14573.1, 30.1293, 2.00612}, +{14808.9, 30.1550, 1.95172}, +{15048.4, 30.1784, 1.89861}, +{15291.8, 30.1997, 1.84677}, +{15539.1, 30.2191, 1.79618}, +{15790.4, 30.2366, 1.74682}, +{16045.8, 30.2525, 1.69867}, +{16305.4, 30.2668, 1.65170}, +{16569.1, 30.2796, 1.60590}, +{16837.1, 30.2911, 1.56124}, +{17109.4, 30.3014, 1.51771}, +{17386.1, 30.3104, 1.47527}, +{17667.4, 30.3184, 1.43391}, +{17953.1, 30.3253, 1.39361}, +{18243.5, 30.3313, 1.35434}, +{18538.6, 30.3364, 1.31608}, +{18838.4, 30.3406, 1.27882}, +{19143.1, 30.3441, 1.24252}, +{19452.7, 30.3469, 1.20718}, +{19767.4, 30.3490, 1.17276}, +{20087.1, 30.3504, 1.13926}, +{20412.0, 30.3513, 1.10664}, +{20742.1, 30.3516, 1.07489}, +{21077.6, 30.3514, 1.04398}, +{21418.5, 30.3507, 1.01391}, +{21765.0, 30.3496, 0.984646}, +{22117.0, 30.3481, 0.956173}, +{22474.7, 30.3463, 0.928472}, +{22838.2, 30.3440, 0.901523}, +{23207.6, 30.3415, 0.875310}, +{23583.0, 30.3386, 0.849815}, +{23964.4, 30.3355, 0.825020}, +{24352.0, 30.3322, 0.800908}, +{24745.9, 30.3286, 0.777463}, +{25146.2, 30.3248, 0.754667}, +{25552.9, 30.3207, 0.732505}, +{25966.2, 30.3166, 0.710960}, +{26386.1, 30.3122, 0.690017}, +{26812.9, 30.3078, 0.669660}, +{27246.6, 30.3032, 0.649875}, +{27687.3, 30.2984, 0.630648}, +{28135.1, 30.2936, 0.611962}, +{28590.2, 30.2887, 0.593805}, +{29052.6, 30.2839, 0.576163}, +{29522.5, 30.2805, 0.559022}, +{30000.0, 30.2686, 0.542369}, +{0, 0, 0} +}; + +e_fp_fdp ga[] = { /* Z = 31 */ +{10.0000, -9999.00, 2.98527}, +{10.1617, -9999.00, 2.98141}, +{10.3261, -9999.00, 2.97756}, +{10.4931, -9999.00, 2.97370}, +{10.6628, -9999.00, 2.96986}, +{10.8353, -9999.00, 2.96602}, +{11.0106, -9999.00, 2.95695}, +{11.1886, -9999.00, 2.90859}, +{11.3696, -9999.00, 2.86103}, +{11.5535, -9999.00, 2.81425}, +{11.7404, -9999.00, 2.76823}, +{11.9303, -9999.00, 2.66636}, +{12.1232, -9999.00, 2.55394}, +{12.3193, -9999.00, 2.44626}, +{12.5186, -9999.00, 2.34311}, +{12.7210, -9999.00, 2.24432}, +{12.9268, -9999.00, 2.14969}, +{13.1359, -9999.00, 2.02163}, +{13.3483, -9999.00, 1.89458}, +{13.5642, -9999.00, 1.70752}, +{13.7836, -9999.00, 1.44713}, +{14.0066, -9999.00, 1.24110}, +{14.2331, -9999.00, 1.07107}, +{14.4633, -9999.00, 0.920747}, +{14.6973, -9999.00, 0.773401}, +{14.9350, -9999.00, 0.650876}, +{15.1765, -9999.00, 0.599352}, +{15.4220, -9999.00, 0.551909}, +{15.6714, -9999.00, 0.508220}, +{15.9249, -9999.00, 0.472778}, +{16.1825, -9999.00, 0.439966}, +{16.4442, -9999.00, 0.433950}, +{16.7102, -9999.00, 0.432236}, +{16.9805, -9999.00, 0.430552}, +{17.2551, -9999.00, 0.442783}, +{17.5342, -9999.00, 0.455362}, +{17.8178, -9999.00, 0.468298}, +{18.1060, -9999.00, 0.488631}, +{18.3989, -9999.00, 0.535543}, +{18.6964, -9999.00, 0.586959}, +{18.9988, -9999.00, 0.671684}, +{19.3061, -9999.00, 0.792094}, +{19.6184, -9999.00, 0.911933}, +{19.9357, -9999.00, 1.00319}, +{20.2582, -9999.00, 1.10359}, +{20.5858, -9999.00, 1.18802}, +{20.9188, -9999.00, 1.25195}, +{21.2571, -9999.00, 1.31932}, +{21.6009, -9999.00, 1.34907}, +{21.9503, -9999.00, 1.35917}, +{22.3053, -9999.00, 1.36934}, +{22.6661, -9999.00, 1.37959}, +{23.0327, -9999.00, 1.38992}, +{23.4053, -9999.00, 1.38942}, +{23.7838, -9999.00, 1.38002}, +{24.1685, -9999.00, 1.37069}, +{24.5594, -9999.00, 1.36143}, +{24.9566, -9999.00, 1.36635}, +{25.3603, -9999.00, 1.39605}, +{25.7705, -9999.00, 1.42639}, +{26.1873, -9999.00, 1.45740}, +{26.6109, -9999.00, 1.48908}, +{27.0413, -9999.00, 1.52145}, +{27.4786, -9999.00, 1.56001}, +{27.9231, -9999.00, 1.61325}, +{28.3747, -9999.00, 1.66830}, +{28.8337, -9999.00, 1.72524}, +{29.3000, 1.32710, 1.78411}, +{29.7739, 1.29434, 1.84500}, +{30.2555, 1.26276, 1.90796}, +{30.7449, 1.23223, 1.97307}, +{31.2421, 1.20263, 2.04041}, +{31.7475, 1.17370, 2.11039}, +{32.2609, 1.14626, 2.18330}, +{32.7827, 1.12028, 2.25873}, +{33.3130, 1.09579, 2.33677}, +{33.8518, 1.07289, 2.41750}, +{34.3993, 1.05177, 2.50102}, +{34.9557, 1.03270, 2.58742}, +{35.5211, 1.01600, 2.67682}, +{36.0956, 1.00218, 2.76930}, +{36.6794, 0.991934, 2.86497}, +{37.2727, 0.987219, 2.96395}, +{37.8755, 0.992342, 3.06635}, +{38.4882, 1.00331, 3.15305}, +{39.1107, 1.00729, 3.23858}, +{39.7432, 1.00928, 3.32644}, +{40.3861, 1.01098, 3.41667}, +{41.0393, 1.01317, 3.50936}, +{41.7031, 1.01640, 3.60456}, +{42.3776, 1.02117, 3.70234}, +{43.0630, 1.02796, 3.80277}, +{43.7595, 1.03740, 3.90593}, +{44.4673, 1.05032, 4.01189}, +{45.1865, 1.06945, 4.12072}, +{45.9174, 1.10145, 4.22650}, +{46.6600, 1.12842, 4.31941}, +{47.4147, 1.15058, 4.41435}, +{48.1816, 1.17169, 4.51138}, +{48.9609, 1.19271, 4.61054}, +{49.7528, 1.21422, 4.71189}, +{50.5576, 1.23663, 4.81545}, +{51.3753, 1.26035, 4.92130}, +{52.2062, 1.28574, 5.02947}, +{53.0506, 1.31348, 5.14003}, +{53.9087, 1.34493, 5.25301}, +{54.7806, 1.37899, 5.36368}, +{55.6667, 1.41287, 5.47581}, +{56.5670, 1.44803, 5.59028}, +{57.4820, 1.48515, 5.70715}, +{58.4117, 1.52477, 5.82646}, +{59.3564, 1.56740, 5.94826}, +{60.3165, 1.61373, 6.07261}, +{61.2921, 1.66466, 6.19957}, +{62.2834, 1.72239, 6.32917}, +{63.2908, 1.79299, 6.46148}, +{64.3145, 1.87125, 6.57308}, +{65.3547, 1.94010, 6.68044}, +{66.4118, 2.00598, 6.78956}, +{67.4859, 2.07133, 6.90045}, +{68.5775, 2.13739, 7.01316}, +{69.6867, 2.20506, 7.12770}, +{70.8138, 2.27544, 7.24412}, +{71.9591, 2.35039, 7.36243}, +{73.1230, 2.43607, 7.48088}, +{74.3057, 2.52023, 7.57994}, +{75.5076, 2.59758, 7.68030}, +{76.7289, 2.67119, 7.78200}, +{77.9699, 2.74299, 7.88504}, +{79.2310, 2.81326, 7.98945}, +{80.5125, 2.88199, 8.09524}, +{81.8147, 2.94853, 8.20243}, +{83.1380, 3.00986, 8.31104}, +{84.4827, 3.06677, 8.43420}, +{85.8491, 3.13203, 8.56433}, +{87.2377, 3.20293, 8.69646}, +{88.6487, 3.27700, 8.83063}, +{90.0825, 3.35367, 8.96688}, +{91.5395, 3.43237, 9.10522}, +{93.0201, 3.51169, 9.24571}, +{94.5246, 3.59012, 9.39145}, +{96.0535, 3.66777, 9.54948}, +{97.6071, 3.75804, 9.71719}, +{99.1858, 3.85869, 9.88785}, +{100.790, 3.96758, 10.0615}, +{102.420, 4.08488, 10.2382}, +{104.077, 4.21120, 10.4180}, +{105.760, 4.34745, 10.6010}, +{107.471, 4.49520, 10.7871}, +{109.209, 4.65675, 10.9766}, +{110.975, 4.83802, 11.1694}, +{112.770, 5.06362, 11.3655}, +{114.594, 5.29532, 11.4855}, +{116.448, 5.50090, 11.6006}, +{118.331, 5.69762, 11.7168}, +{120.245, 5.89150, 11.8342}, +{122.190, 6.08532, 11.9527}, +{124.166, 6.28088, 12.0725}, +{126.175, 6.47967, 12.1934}, +{128.215, 6.68306, 12.3156}, +{130.289, 6.89260, 12.4390}, +{132.397, 7.11019, 12.5636}, +{134.538, 7.33864, 12.6894}, +{136.714, 7.58301, 12.8166}, +{138.925, 7.86035, 12.9450}, +{141.172, 8.17319, 13.0064}, +{143.456, 8.44711, 13.0318}, +{145.776, 8.69366, 13.0573}, +{148.134, 8.93038, 13.0828}, +{150.530, 9.16028, 13.1084}, +{152.964, 9.38539, 13.1340}, +{155.439, 9.60708, 13.1597}, +{157.953, 9.82645, 13.1854}, +{160.507, 10.0444, 13.2112}, +{163.103, 10.2616, 13.2370}, +{165.742, 10.4790, 13.2629}, +{168.422, 10.6974, 13.2888}, +{171.146, 10.9179, 13.3148}, +{173.915, 11.1420, 13.3408}, +{176.727, 11.3732, 13.3669}, +{179.586, 11.6249, 13.3872}, +{182.491, 11.8660, 13.3696}, +{185.442, 12.0934, 13.3520}, +{188.442, 12.3126, 13.3345}, +{191.489, 12.5271, 13.3170}, +{194.587, 12.7383, 13.2995}, +{197.734, 12.9470, 13.2821}, +{200.932, 13.1537, 13.2646}, +{204.182, 13.3592, 13.2472}, +{207.485, 13.5637, 13.2298}, +{210.840, 13.7677, 13.2124}, +{214.251, 13.9716, 13.1951}, +{217.716, 14.1758, 13.1777}, +{221.237, 14.3808, 13.1604}, +{224.816, 14.5871, 13.1431}, +{228.452, 14.7952, 13.1259}, +{232.147, 15.0059, 13.1087}, +{235.902, 15.2202, 13.0914}, +{239.717, 15.4398, 13.0742}, +{243.595, 15.6675, 13.0571}, +{247.535, 15.9120, 13.0399}, +{251.538, 16.1840, 12.9860}, +{255.607, 16.4295, 12.9000}, +{259.741, 16.6519, 12.8147}, +{263.942, 16.8658, 12.7299}, +{268.211, 17.0737, 12.6457}, +{272.549, 17.2771, 12.5620}, +{276.957, 17.4775, 12.4789}, +{281.437, 17.6757, 12.3963}, +{285.989, 17.8730, 12.3143}, +{290.615, 18.0706, 12.2328}, +{295.315, 18.2699, 12.1518}, +{300.092, 18.4732, 12.0714}, +{304.945, 18.6851, 11.9916}, +{309.878, 18.9226, 11.9122}, +{314.890, 19.1684, 11.7685}, +{319.983, 19.3807, 11.6058}, +{325.158, 19.5654, 11.4453}, +{330.418, 19.7368, 11.2870}, +{335.762, 19.8977, 11.1310}, +{341.192, 20.0500, 10.9770}, +{346.711, 20.1949, 10.8253}, +{352.319, 20.3335, 10.6756}, +{358.017, 20.4666, 10.5280}, +{363.808, 20.5950, 10.3824}, +{369.692, 20.7193, 10.2388}, +{375.672, 20.8404, 10.0972}, +{381.748, 20.9593, 9.95761}, +{387.922, 21.0771, 9.81992}, +{394.197, 21.2069, 9.68322}, +{400.573, 21.3269, 9.52024}, +{407.052, 21.4304, 9.35999}, +{413.635, 21.5248, 9.20246}, +{420.326, 21.6123, 9.04756}, +{427.124, 21.6937, 8.89528}, +{434.032, 21.7699, 8.74556}, +{441.052, 21.8413, 8.59835}, +{448.186, 21.9084, 8.45363}, +{455.435, 21.9714, 8.31134}, +{462.802, 22.0307, 8.17145}, +{470.287, 22.0867, 8.03391}, +{477.894, 22.1395, 7.89869}, +{485.623, 22.1895, 7.76574}, +{493.478, 22.2370, 7.63503}, +{501.459, 22.2824, 7.50653}, +{509.570, 22.3264, 7.38018}, +{517.812, 22.3696, 7.25597}, +{526.187, 22.4216, 7.13384}, +{534.698, 22.4676, 6.99252}, +{543.346, 22.5005, 6.85265}, +{552.134, 22.5260, 6.71559}, +{561.065, 22.5456, 6.58127}, +{570.139, 22.5604, 6.44963}, +{579.361, 22.5708, 6.32062}, +{588.732, 22.5771, 6.19420}, +{598.254, 22.5798, 6.07031}, +{607.930, 22.5792, 5.94889}, +{617.763, 22.5755, 5.82990}, +{627.755, 22.5693, 5.71330}, +{637.908, 22.5611, 5.59902}, +{648.226, 22.5518, 5.48703}, +{658.711, 22.5438, 5.37728}, +{669.365, 22.5459, 5.26972}, +{680.191, 22.5496, 5.13025}, +{691.193, 22.5304, 4.97901}, +{702.372, 22.4890, 4.83223}, +{713.733, 22.4349, 4.68978}, +{725.277, 22.3697, 4.55152}, +{737.008, 22.2939, 4.41734}, +{748.928, 22.2079, 4.28711}, +{761.042, 22.1117, 4.16073}, +{773.351, 22.0047, 4.03807}, +{785.859, 21.8861, 3.91903}, +{798.570, 21.7541, 3.80350}, +{811.486, 21.6009, 3.69137}, +{824.611, 21.4381, 3.60783}, +{837.949, 21.2746, 3.53097}, +{851.502, 21.1073, 3.45531}, +{865.274, 20.9301, 3.38059}, +{879.269, 20.7394, 3.30688}, +{893.491, 20.5327, 3.23494}, +{907.943, 20.3074, 3.16450}, +{922.628, 20.0595, 3.09553}, +{937.551, 19.7850, 3.02848}, +{952.715, 19.4782, 2.96292}, +{968.124, 19.1317, 2.89882}, +{983.783, 18.7352, 2.83615}, +{999.695, 18.2744, 2.77532}, +{1015.86, 17.7277, 2.71630}, +{1032.29, 17.0656, 2.66264}, +{1048.99, 16.2329, 2.60963}, +{1065.96, 15.1233, 2.55721}, +{1083.20, 13.4922, 2.50580}, +{1100.72, 10.5124, 2.45541}, +{1116.60, -10.6725, 2.41128}, +{1116.80, -10.6678, 15.6268}, +{1118.52, 1.56871, 15.6115}, +{1136.61, 11.7921, 15.4531}, +{1155.00, 14.6652, 15.2962}, +{1173.68, 16.4368, 15.1410}, +{1192.66, 17.7288, 14.9873}, +{1211.95, 18.7442, 14.8352}, +{1231.55, 19.5700, 14.6846}, +{1251.47, 20.2418, 14.5368}, +{1271.72, 20.7413, 14.3906}, +{1292.29, 20.7723, 14.2458}, +{1298.90, 18.7899, 14.2001}, +{1299.10, 18.8011, 15.8852}, +{1313.19, 21.9927, 15.6365}, +{1334.43, 23.1209, 15.2738}, +{1356.01, 23.9234, 14.9194}, +{1377.94, 24.5811, 14.5734}, +{1400.23, 25.1467, 14.2353}, +{1422.88, 25.6448, 13.9051}, +{1445.89, 26.0897, 13.5824}, +{1469.28, 26.4909, 13.2674}, +{1493.04, 26.8552, 12.9599}, +{1517.19, 27.1881, 12.6606}, +{1541.73, 27.4943, 12.3682}, +{1566.67, 27.7766, 12.0826}, +{1592.01, 28.0376, 11.8036}, +{1617.76, 28.2797, 11.5311}, +{1643.92, 28.5048, 11.2649}, +{1670.51, 28.7148, 11.0048}, +{1697.53, 28.9117, 10.7507}, +{1724.99, 29.0990, 10.5025}, +{1752.89, 29.2746, 10.2521}, +{1781.24, 29.4364, 10.0052}, +{1810.05, 29.5842, 9.76228}, +{1839.32, 29.7201, 9.52519}, +{1869.07, 29.8457, 9.29382}, +{1899.30, 29.9619, 9.06803}, +{1930.02, 30.0697, 8.84787}, +{1961.24, 30.1700, 8.63307}, +{1992.96, 30.2620, 8.42343}, +{2025.20, 30.3509, 8.22260}, +{2057.95, 30.4352, 8.01944}, +{2091.24, 30.5116, 7.82020}, +{2125.06, 30.5812, 7.62565}, +{2159.43, 30.6452, 7.43531}, +{2194.36, 30.7036, 7.24887}, +{2229.85, 30.7570, 7.06688}, +{2265.92, 30.8057, 6.88880}, +{2302.57, 30.8499, 6.71491}, +{2339.81, 30.8900, 6.54485}, +{2377.66, 30.9261, 6.37861}, +{2416.11, 30.9584, 6.21644}, +{2455.19, 30.9873, 6.05785}, +{2494.90, 31.0130, 5.90315}, +{2535.26, 31.0356, 5.75194}, +{2576.26, 31.0552, 5.60422}, +{2617.93, 31.0720, 5.46015}, +{2660.27, 31.0864, 5.31950}, +{2703.30, 31.0983, 5.18207}, +{2747.03, 31.1077, 5.04796}, +{2791.46, 31.1152, 4.91733}, +{2836.61, 31.1205, 4.78938}, +{2882.49, 31.1238, 4.66502}, +{2929.11, 31.1255, 4.54352}, +{2976.48, 31.1254, 4.42500}, +{3024.63, 31.1237, 4.30940}, +{3073.55, 31.1205, 4.19667}, +{3123.26, 31.1160, 4.08670}, +{3173.78, 31.1101, 3.97946}, +{3225.11, 31.1029, 3.87493}, +{3277.27, 31.0946, 3.77296}, +{3330.28, 31.0852, 3.67355}, +{3384.15, 31.0748, 3.57666}, +{3438.88, 31.0634, 3.48218}, +{3494.50, 31.0512, 3.39009}, +{3551.02, 31.0380, 3.30032}, +{3608.46, 31.0241, 3.21283}, +{3666.82, 31.0094, 3.12755}, +{3726.13, 30.9941, 3.04450}, +{3786.40, 30.9781, 2.96347}, +{3847.64, 30.9614, 2.88455}, +{3909.87, 30.9442, 2.80767}, +{3973.11, 30.9265, 2.73275}, +{4037.38, 30.9083, 2.65973}, +{4102.68, 30.8896, 2.58859}, +{4169.03, 30.8704, 2.51925}, +{4236.46, 30.8508, 2.45171}, +{4304.98, 30.8309, 2.38597}, +{4374.62, 30.8106, 2.32185}, +{4445.37, 30.7898, 2.25940}, +{4517.27, 30.7688, 2.19861}, +{4590.33, 30.7475, 2.13936}, +{4664.58, 30.7258, 2.08162}, +{4740.03, 30.7038, 2.02540}, +{4816.69, 30.6815, 1.97063}, +{4894.60, 30.6590, 1.91730}, +{4973.77, 30.6362, 1.86534}, +{5054.21, 30.6130, 1.81472}, +{5135.96, 30.5896, 1.76543}, +{5219.03, 30.5660, 1.71743}, +{5303.44, 30.5420, 1.67060}, +{5389.22, 30.5177, 1.62508}, +{5476.39, 30.4932, 1.58067}, +{5564.97, 30.4683, 1.53750}, +{5654.98, 30.4431, 1.49538}, +{5746.44, 30.4175, 1.45443}, +{5839.39, 30.3916, 1.41448}, +{5933.83, 30.3652, 1.37561}, +{6029.81, 30.3385, 1.33772}, +{6127.33, 30.3113, 1.30087}, +{6226.44, 30.2836, 1.26495}, +{6327.15, 30.2554, 1.22995}, +{6429.48, 30.2266, 1.19587}, +{6533.48, 30.1972, 1.16263}, +{6639.15, 30.1670, 1.13029}, +{6746.54, 30.1361, 1.09881}, +{6855.65, 30.1044, 1.06813}, +{6966.54, 30.0717, 1.03825}, +{7079.22, 30.0380, 1.00914}, +{7193.72, 30.0031, 0.980786}, +{7310.07, 29.9670, 0.953177}, +{7428.31, 29.9294, 0.926276}, +{7548.45, 29.8902, 0.900071}, +{7670.54, 29.8492, 0.874545}, +{7794.61, 29.8061, 0.849687}, +{7920.68, 29.7606, 0.825458}, +{8048.79, 29.7124, 0.801857}, +{8178.98, 29.6611, 0.778864}, +{8311.26, 29.6061, 0.756468}, +{8445.69, 29.5468, 0.734664}, +{8582.29, 29.4824, 0.713390}, +{8721.11, 29.4118, 0.692675}, +{8862.16, 29.3338, 0.672497}, +{9005.50, 29.2465, 0.652833}, +{9151.16, 29.1474, 0.633681}, +{9299.17, 29.0331, 0.615009}, +{9449.58, 28.8982, 0.596807}, +{9602.42, 28.7342, 0.579077}, +{9757.73, 28.5268, 0.561816}, +{9915.55, 28.2473, 0.544992}, +{10075.9, 27.8273, 0.528583}, +{10238.9, 27.0132, 0.512592}, +{10367.0, 19.4428, 0.500533}, +{10367.2, 19.4432, 3.85480}, +{10404.5, 25.8007, 3.83433}, +{10572.8, 27.6942, 3.74426}, +{10743.8, 28.3901, 3.65556}, +{10917.6, 28.8326, 3.56828}, +{11094.2, 29.1586, 3.48242}, +{11273.6, 29.4164, 3.39800}, +{11455.9, 29.6290, 3.31505}, +{11641.2, 29.8091, 3.23357}, +{11829.5, 29.9646, 3.15356}, +{12020.8, 30.1007, 3.07503}, +{12215.3, 30.2210, 2.99799}, +{12412.8, 30.3283, 2.92244}, +{12613.6, 30.4245, 2.84837}, +{12817.6, 30.5113, 2.77577}, +{13025.0, 30.5898, 2.70465}, +{13235.6, 30.6611, 2.63499}, +{13449.7, 30.7259, 2.56679}, +{13667.2, 30.7851, 2.50002}, +{13888.3, 30.8391, 2.43470}, +{14112.9, 30.8884, 2.37078}, +{14341.2, 30.9336, 2.30828}, +{14573.1, 30.9750, 2.24716}, +{14808.9, 31.0128, 2.18741}, +{15048.4, 31.0475, 2.12902}, +{15291.8, 31.0792, 2.07196}, +{15539.1, 31.1082, 2.01623}, +{15790.4, 31.1346, 1.96179}, +{16045.8, 31.1588, 1.90863}, +{16305.4, 31.1809, 1.85674}, +{16569.1, 31.2009, 1.80608}, +{16837.1, 31.2191, 1.75665}, +{17109.4, 31.2356, 1.70841}, +{17386.1, 31.2505, 1.66136}, +{17667.4, 31.2639, 1.61546}, +{17953.1, 31.2759, 1.57069}, +{18243.5, 31.2866, 1.52704}, +{18538.6, 31.2961, 1.48449}, +{18838.4, 31.3045, 1.44301}, +{19143.1, 31.3119, 1.40258}, +{19452.7, 31.3182, 1.36318}, +{19767.4, 31.3237, 1.32480}, +{20087.1, 31.3283, 1.28740}, +{20412.0, 31.3321, 1.25096}, +{20742.1, 31.3352, 1.21548}, +{21077.6, 31.3376, 1.18092}, +{21418.5, 31.3393, 1.14727}, +{21765.0, 31.3404, 1.11451}, +{22117.0, 31.3410, 1.08262}, +{22474.7, 31.3411, 1.05157}, +{22838.2, 31.3407, 1.02135}, +{23207.6, 31.3398, 0.991945}, +{23583.0, 31.3385, 0.963326}, +{23964.4, 31.3368, 0.935481}, +{24352.0, 31.3348, 0.908389}, +{24745.9, 31.3324, 0.882035}, +{25146.2, 31.3297, 0.856398}, +{25552.9, 31.3268, 0.831463}, +{25966.2, 31.3236, 0.807212}, +{26386.1, 31.3201, 0.783629}, +{26812.9, 31.3164, 0.760696}, +{27246.6, 31.3126, 0.738399}, +{27687.3, 31.3085, 0.716721}, +{28135.1, 31.3043, 0.695645}, +{28590.2, 31.3000, 0.675159}, +{29052.6, 31.2956, 0.655246}, +{29522.5, 31.2930, 0.635891}, +{30000.0, 31.2806, 0.617081}, +{0, 0, 0} +}; + +e_fp_fdp ge[] = { /* Z = 32 */ +{10.0000, -9999.00, 3.01183}, +{10.1617, -9999.00, 3.05548}, +{10.3261, -9999.00, 3.09976}, +{10.4931, -9999.00, 3.14468}, +{10.6628, -9999.00, 3.19025}, +{10.8353, -9999.00, 3.21825}, +{11.0106, -9999.00, 3.20755}, +{11.1886, -9999.00, 3.19689}, +{11.3696, -9999.00, 3.18626}, +{11.5535, -9999.00, 3.17568}, +{11.7404, -9999.00, 3.16687}, +{11.9303, -9999.00, 3.15816}, +{12.1232, -9999.00, 3.14947}, +{12.3193, -9999.00, 3.14080}, +{12.5186, -9999.00, 3.13216}, +{12.7210, -9999.00, 3.11421}, +{12.9268, -9999.00, 3.01683}, +{13.1359, -9999.00, 2.92250}, +{13.3483, -9999.00, 2.83112}, +{13.5642, -9999.00, 2.74260}, +{13.7836, -9999.00, 2.65685}, +{14.0066, -9999.00, 2.57378}, +{14.2331, -9999.00, 2.49330}, +{14.4633, -9999.00, 2.41534}, +{14.6973, -9999.00, 2.33982}, +{14.9350, -9999.00, 2.26666}, +{15.1765, -9999.00, 2.18698}, +{15.4220, -9999.00, 2.10697}, +{15.6714, -9999.00, 2.02987}, +{15.9249, -9999.00, 1.95560}, +{16.1825, -9999.00, 1.88405}, +{16.4442, -9999.00, 1.81511}, +{16.7102, -9999.00, 1.74870}, +{16.9805, -9999.00, 1.68472}, +{17.2551, -9999.00, 1.62308}, +{17.5342, -9999.00, 1.56369}, +{17.8178, -9999.00, 1.50648}, +{18.1060, -9999.00, 1.45136}, +{18.3989, -9999.00, 1.39825}, +{18.6964, -9999.00, 1.34406}, +{18.9988, -9999.00, 1.28586}, +{19.3061, -9999.00, 1.23018}, +{19.6184, -9999.00, 1.17690}, +{19.9357, -9999.00, 1.12594}, +{20.2582, -9999.00, 1.07718}, +{20.5858, -9999.00, 1.03054}, +{20.9188, -9999.00, 0.982739}, +{21.2571, -9999.00, 0.923062}, +{21.6009, -9999.00, 0.867009}, +{21.9503, -9999.00, 0.814359}, +{22.3053, -9999.00, 0.764906}, +{22.6661, -9999.00, 0.718458}, +{23.0327, -9999.00, 0.674829}, +{23.4053, -9999.00, 0.633850}, +{23.7838, -9999.00, 0.591594}, +{24.1685, -9999.00, 0.548427}, +{24.5594, -9999.00, 0.508410}, +{24.9566, -9999.00, 0.473964}, +{25.3603, -9999.00, 0.461030}, +{25.7705, -9999.00, 0.448450}, +{26.1873, -9999.00, 0.444589}, +{26.6109, -9999.00, 0.450264}, +{27.0413, -9999.00, 0.456011}, +{27.4786, -9999.00, 0.461832}, +{27.9231, -9999.00, 0.483682}, +{28.3747, -9999.00, 0.538895}, +{28.8337, -9999.00, 0.698676}, +{29.3000, 0.440124, 0.905829}, +{29.7739, 0.272233, 1.17440}, +{30.2555, 0.162958, 1.52262}, +{30.7449, 0.217163, 1.97406}, +{31.2421, 0.453769, 2.22141}, +{31.7475, 0.682046, 2.38416}, +{32.2609, 0.882264, 2.50492}, +{32.7827, 1.13720, 2.51621}, +{33.3130, 1.28150, 2.45219}, +{33.8518, 1.37051, 2.39089}, +{34.3993, 1.42861, 2.33813}, +{34.9557, 1.46459, 2.28654}, +{35.5211, 1.47891, 2.23706}, +{36.0956, 1.47827, 2.19667}, +{36.6794, 1.46483, 2.15701}, +{37.2727, 1.43153, 2.11806}, +{37.8755, 1.36477, 2.09638}, +{38.4882, 1.30954, 2.10723}, +{39.1107, 1.26061, 2.11814}, +{39.7432, 1.20727, 2.12910}, +{40.3861, 1.14217, 2.14324}, +{41.0393, 1.07603, 2.17356}, +{41.7031, 1.00925, 2.20431}, +{42.3776, 0.930394, 2.23549}, +{43.0630, 0.827077, 2.29344}, +{43.7595, 0.745990, 2.37463}, +{44.4673, 0.674834, 2.45869}, +{45.1865, 0.604867, 2.54573}, +{45.9174, 0.529002, 2.63585}, +{46.6600, 0.452626, 2.75745}, +{47.4147, 0.398433, 2.89179}, +{48.1816, 0.367368, 3.03269}, +{48.9609, 0.368932, 3.15118}, +{49.7528, 0.351783, 3.25097}, +{50.5576, 0.326497, 3.35393}, +{51.3753, 0.299997, 3.46014}, +{52.2062, 0.273877, 3.56893}, +{53.0506, 0.246499, 3.67975}, +{53.9087, 0.218209, 3.79400}, +{54.7806, 0.188729, 3.91180}, +{55.6667, 0.155599, 4.03326}, +{56.5670, 0.124148, 4.16976}, +{57.4820, 0.986014E-01, 4.31092}, +{58.4117, 0.772277E-01, 4.45687}, +{59.3564, 0.597239E-01, 4.60775}, +{60.3165, 0.461093E-01, 4.76374}, +{61.2921, 0.361662E-01, 4.92594}, +{62.2834, 0.326300E-01, 5.09471}, +{63.2908, 0.359316E-01, 5.26925}, +{64.3145, 0.470171E-01, 5.44978}, +{65.3547, 0.674639E-01, 5.63649}, +{66.4118, 0.998144E-01, 5.82960}, +{67.4859, 0.148377, 6.02932}, +{68.5775, 0.234250, 6.24339}, +{69.6867, 0.348107, 6.38321}, +{70.8138, 0.430821, 6.50992}, +{71.9591, 0.497067, 6.63914}, +{73.1230, 0.558261, 6.77093}, +{74.3057, 0.616580, 6.90534}, +{75.5076, 0.673491, 7.04241}, +{76.7289, 0.729977, 7.18220}, +{77.9699, 0.786845, 7.32477}, +{79.2310, 0.844725, 7.47017}, +{80.5125, 0.904338, 7.61845}, +{81.8147, 0.966540, 7.76968}, +{83.1380, 1.03362, 7.92391}, +{84.4827, 1.10337, 8.07343}, +{85.8491, 1.17220, 8.22490}, +{87.2377, 1.24154, 8.37922}, +{88.6487, 1.31266, 8.53643}, +{90.0825, 1.38605, 8.69659}, +{91.5395, 1.46219, 8.85976}, +{93.0201, 1.54154, 9.02599}, +{94.5246, 1.62469, 9.19533}, +{96.0535, 1.71230, 9.36786}, +{97.6071, 1.80605, 9.54362}, +{99.1858, 1.91220, 9.71828}, +{100.790, 2.01653, 9.88541}, +{102.420, 2.11982, 10.0554}, +{104.077, 2.22529, 10.2283}, +{105.760, 2.33371, 10.4042}, +{107.471, 2.44578, 10.5831}, +{109.209, 2.56195, 10.7651}, +{110.975, 2.68284, 10.9503}, +{112.770, 2.80893, 11.1386}, +{114.594, 2.94092, 11.3301}, +{116.448, 3.07946, 11.5250}, +{118.331, 3.22554, 11.7232}, +{120.245, 3.38036, 11.9248}, +{122.190, 3.54595, 12.1298}, +{124.166, 3.72626, 12.3384}, +{126.175, 3.93605, 12.5441}, +{128.215, 4.14322, 12.7108}, +{130.289, 4.34297, 12.8798}, +{132.397, 4.54134, 13.0510}, +{134.538, 4.74284, 13.2244}, +{136.714, 4.94919, 13.4002}, +{138.925, 5.16203, 13.5784}, +{141.172, 5.38294, 13.7589}, +{143.456, 5.61394, 13.9417}, +{145.776, 5.85763, 14.1271}, +{148.134, 6.11865, 14.3149}, +{150.530, 6.40872, 14.5052}, +{152.964, 6.75914, 14.6551}, +{155.439, 7.06766, 14.7403}, +{157.953, 7.35360, 14.8260}, +{160.507, 7.63003, 14.9123}, +{163.103, 7.90170, 14.9990}, +{165.742, 8.17130, 15.0862}, +{168.422, 8.44065, 15.1739}, +{171.146, 8.71121, 15.2621}, +{173.915, 8.98432, 15.3509}, +{176.727, 9.26121, 15.4401}, +{179.586, 9.54331, 15.5299}, +{182.491, 9.83225, 15.6202}, +{185.442, 10.1302, 15.7110}, +{188.442, 10.4402, 15.8024}, +{191.489, 10.7677, 15.8943}, +{194.587, 11.1270, 15.9867}, +{197.734, 11.5612, 16.0281}, +{200.932, 11.9347, 15.9773}, +{204.182, 12.2704, 15.9267}, +{207.485, 12.5866, 15.8763}, +{210.840, 12.8900, 15.8260}, +{214.251, 13.1838, 15.7759}, +{217.716, 13.4704, 15.7259}, +{221.237, 13.7513, 15.6762}, +{224.816, 14.0278, 15.6265}, +{228.452, 14.3010, 15.5771}, +{232.147, 14.5718, 15.5277}, +{235.902, 14.8411, 15.4785}, +{239.717, 15.1099, 15.4295}, +{243.595, 15.3791, 15.3807}, +{247.535, 15.6498, 15.3320}, +{251.538, 15.9236, 15.2834}, +{255.607, 16.2024, 15.2350}, +{259.741, 16.4890, 15.1868}, +{263.942, 16.7887, 15.1387}, +{268.211, 17.1284, 15.0908}, +{272.549, 17.5025, 14.9669}, +{276.957, 17.8168, 14.7856}, +{281.437, 18.0944, 14.6064}, +{285.989, 18.3504, 14.4295}, +{290.615, 18.5905, 14.2547}, +{295.315, 18.8179, 14.0820}, +{300.092, 19.0344, 13.9114}, +{304.945, 19.2417, 13.7428}, +{309.878, 19.4409, 13.5764}, +{314.890, 19.6328, 13.4119}, +{319.983, 19.8182, 13.2494}, +{325.158, 19.9977, 13.0889}, +{330.418, 20.1721, 12.9303}, +{335.762, 20.3417, 12.7737}, +{341.192, 20.5073, 12.6189}, +{346.711, 20.6694, 12.4660}, +{352.319, 20.8287, 12.3150}, +{358.017, 20.9862, 12.1658}, +{363.808, 21.1439, 12.0184}, +{369.692, 21.3099, 11.8645}, +{375.672, 21.4642, 11.6986}, +{381.748, 21.6066, 11.5351}, +{387.922, 21.7434, 11.3738}, +{394.197, 21.8757, 11.2148}, +{400.573, 22.0044, 11.0580}, +{407.052, 22.1305, 10.9034}, +{413.635, 22.2551, 10.7510}, +{420.326, 22.3795, 10.6007}, +{427.124, 22.5055, 10.4525}, +{434.032, 22.6486, 10.3064}, +{441.052, 22.7953, 10.1255}, +{448.186, 22.9146, 9.92938}, +{455.435, 23.0164, 9.73703}, +{462.802, 23.1067, 9.54840}, +{470.287, 23.1881, 9.36343}, +{477.894, 23.2619, 9.18205}, +{485.623, 23.3290, 9.00417}, +{493.478, 23.3902, 8.82973}, +{501.459, 23.4461, 8.65869}, +{509.570, 23.4971, 8.49095}, +{517.812, 23.5436, 8.32647}, +{526.187, 23.5860, 8.16517}, +{534.698, 23.6248, 8.00700}, +{543.346, 23.6604, 7.85188}, +{552.134, 23.6934, 7.69978}, +{561.065, 23.7248, 7.55061}, +{570.139, 23.7577, 7.40434}, +{579.361, 23.7926, 7.24878}, +{588.732, 23.8162, 7.08750}, +{598.254, 23.8284, 6.92980}, +{607.930, 23.8342, 6.77561}, +{617.763, 23.8342, 6.62486}, +{627.755, 23.8290, 6.47746}, +{637.908, 23.8189, 6.33334}, +{648.226, 23.8043, 6.19242}, +{658.711, 23.7854, 6.05464}, +{669.365, 23.7622, 5.91992}, +{680.191, 23.7350, 5.78821}, +{691.193, 23.7038, 5.65942}, +{702.372, 23.6690, 5.53350}, +{713.733, 23.6304, 5.41038}, +{725.277, 23.5922, 5.29000}, +{737.008, 23.5481, 5.16382}, +{748.928, 23.4950, 5.04011}, +{761.042, 23.4351, 4.91936}, +{773.351, 23.3689, 4.80150}, +{785.859, 23.2965, 4.68647}, +{798.570, 23.2177, 4.57419}, +{811.486, 23.1325, 4.46460}, +{824.611, 23.0406, 4.35764}, +{837.949, 22.9417, 4.25324}, +{851.502, 22.8355, 4.15134}, +{865.274, 22.7219, 4.05188}, +{879.269, 22.6038, 3.95175}, +{893.491, 22.4717, 3.84724}, +{907.943, 22.3231, 3.74549}, +{922.628, 22.1594, 3.64643}, +{937.551, 21.9777, 3.54999}, +{952.715, 21.7725, 3.46040}, +{968.124, 21.5556, 3.38610}, +{983.783, 21.3242, 3.31343}, +{999.695, 21.0720, 3.24258}, +{1015.86, 20.7937, 3.17352}, +{1032.29, 20.4853, 3.10813}, +{1048.99, 20.1397, 3.04357}, +{1065.96, 19.7462, 2.97979}, +{1083.20, 19.2915, 2.91735}, +{1100.72, 18.7562, 2.85623}, +{1118.52, 18.1109, 2.79642}, +{1136.61, 17.3071, 2.73776}, +{1155.00, 16.2561, 2.68034}, +{1173.68, 14.7694, 2.62413}, +{1192.66, 12.3113, 2.56910}, +{1211.95, 5.36147, 2.51522}, +{1216.90, -12.3949, 2.50172}, +{1217.10, -12.3903, 16.7824}, +{1231.55, 10.4277, 16.6482}, +{1251.47, 14.5274, 16.4675}, +{1271.72, 16.7825, 16.2902}, +{1292.29, 18.3764, 16.1167}, +{1313.19, 19.6267, 15.9451}, +{1334.43, 20.6657, 15.7754}, +{1356.01, 21.5628, 15.6075}, +{1377.94, 22.3592, 15.4412}, +{1400.23, 23.0821, 15.2767}, +{1414.50, 23.5101, 15.1736}, +{1414.70, 23.5159, 15.1726}, +{1422.88, 23.7522, 15.1143}, +{1445.89, 24.3891, 14.9533}, +{1469.28, 25.0164, 14.7768}, +{1493.04, 25.6447, 14.5762}, +{1517.19, 26.2152, 14.2699}, +{1541.73, 26.7087, 13.9552}, +{1566.67, 27.1411, 13.6474}, +{1592.01, 27.5330, 13.3465}, +{1617.76, 27.8914, 13.0523}, +{1643.92, 28.2214, 12.7644}, +{1670.51, 28.5271, 12.4830}, +{1697.53, 28.8116, 12.2078}, +{1724.99, 29.0840, 11.9387}, +{1752.89, 29.3384, 11.6634}, +{1781.24, 29.5711, 11.3904}, +{1810.05, 29.7845, 11.1208}, +{1839.32, 29.9801, 10.8575}, +{1869.07, 30.1611, 10.6004}, +{1899.30, 30.3289, 10.3494}, +{1930.02, 30.4849, 10.1046}, +{1961.24, 30.6304, 9.86546}, +{1992.96, 30.7643, 9.63179}, +{2025.20, 30.8964, 9.40909}, +{2057.95, 31.0213, 9.18062}, +{2091.24, 31.1339, 8.95641}, +{2125.06, 31.2378, 8.73680}, +{2159.43, 31.3336, 8.52180}, +{2194.36, 31.4223, 8.31139}, +{2229.85, 31.5040, 8.10488}, +{2265.92, 31.5791, 7.90307}, +{2302.57, 31.6482, 7.70557}, +{2339.81, 31.7117, 7.51231}, +{2377.66, 31.7697, 7.32319}, +{2416.11, 31.8229, 7.13839}, +{2455.19, 31.8712, 6.95735}, +{2494.90, 31.9148, 6.78052}, +{2535.26, 31.9543, 6.60779}, +{2576.26, 31.9898, 6.43898}, +{2617.93, 32.0217, 6.27408}, +{2660.27, 32.0501, 6.11297}, +{2703.30, 32.0750, 5.95529}, +{2747.03, 32.0967, 5.80156}, +{2791.46, 32.1155, 5.65125}, +{2836.61, 32.1313, 5.50473}, +{2882.49, 32.1447, 5.36177}, +{2929.11, 32.1558, 5.22209}, +{2976.48, 32.1644, 5.08564}, +{3024.63, 32.1707, 4.95248}, +{3073.55, 32.1749, 4.82268}, +{3123.26, 32.1772, 4.69599}, +{3173.78, 32.1777, 4.57240}, +{3225.11, 32.1764, 4.45185}, +{3277.27, 32.1735, 4.33429}, +{3330.28, 32.1691, 4.21963}, +{3384.15, 32.1633, 4.10784}, +{3438.88, 32.1561, 3.99882}, +{3494.50, 32.1476, 3.89254}, +{3551.02, 32.1380, 3.78896}, +{3608.46, 32.1273, 3.68797}, +{3666.82, 32.1155, 3.58952}, +{3726.13, 32.1027, 3.49358}, +{3786.40, 32.0890, 3.40010}, +{3847.64, 32.0745, 3.30901}, +{3909.87, 32.0592, 3.22022}, +{3973.11, 32.0431, 3.13369}, +{4037.38, 32.0263, 3.04945}, +{4102.68, 32.0089, 2.96733}, +{4169.03, 31.9909, 2.88735}, +{4236.46, 31.9723, 2.80945}, +{4304.98, 31.9532, 2.73350}, +{4374.62, 31.9335, 2.65960}, +{4445.37, 31.9134, 2.58763}, +{4517.27, 31.8929, 2.51751}, +{4590.33, 31.8719, 2.44916}, +{4664.58, 31.8505, 2.38268}, +{4740.03, 31.8288, 2.31789}, +{4816.69, 31.8067, 2.25489}, +{4894.60, 31.7843, 2.19350}, +{4973.77, 31.7616, 2.13369}, +{5054.21, 31.7385, 2.07546}, +{5135.96, 31.7152, 2.01882}, +{5219.03, 31.6916, 1.96364}, +{5303.44, 31.6677, 1.90987}, +{5389.22, 31.6434, 1.85762}, +{5476.39, 31.6190, 1.80674}, +{5564.97, 31.5943, 1.75713}, +{5654.98, 31.5693, 1.70888}, +{5746.44, 31.5440, 1.66195}, +{5839.39, 31.5184, 1.61620}, +{5933.83, 31.4925, 1.57174}, +{6029.81, 31.4664, 1.52841}, +{6127.33, 31.4399, 1.48627}, +{6226.44, 31.4130, 1.44521}, +{6327.15, 31.3857, 1.40529}, +{6429.48, 31.3581, 1.36645}, +{6533.48, 31.3301, 1.32852}, +{6639.15, 31.3015, 1.29169}, +{6746.54, 31.2724, 1.25590}, +{6855.65, 31.2429, 1.22103}, +{6966.54, 31.2127, 1.18703}, +{7079.22, 31.1818, 1.15398}, +{7193.72, 31.1503, 1.12181}, +{7310.07, 31.1179, 1.09049}, +{7428.31, 31.0846, 1.06002}, +{7548.45, 31.0503, 1.03036}, +{7670.54, 31.0150, 1.00150}, +{7794.61, 30.9784, 0.973404}, +{7920.68, 30.9404, 0.946056}, +{8048.79, 30.9009, 0.919435}, +{8178.98, 30.8596, 0.893531}, +{8311.26, 30.8164, 0.868318}, +{8445.69, 30.7708, 0.843783}, +{8582.29, 30.7227, 0.819886}, +{8721.11, 30.6715, 0.796635}, +{8862.16, 30.6168, 0.774005}, +{9005.50, 30.5581, 0.751970}, +{9151.16, 30.4944, 0.730529}, +{9299.17, 30.4249, 0.709655}, +{9449.58, 30.3484, 0.689338}, +{9602.42, 30.2630, 0.669557}, +{9757.73, 30.1666, 0.650313}, +{9915.55, 30.0560, 0.631568}, +{10075.9, 29.9265, 0.613322}, +{10238.9, 29.7705, 0.595560}, +{10404.5, 29.5756, 0.578268}, +{10572.8, 29.3184, 0.561433}, +{10743.8, 28.9463, 0.545044}, +{10917.6, 28.2956, 0.529086}, +{11094.2, 25.1168, 0.513550}, +{11103.0, 20.2986, 0.512790}, +{11103.2, 20.2990, 3.89712}, +{11273.6, 28.3851, 3.80828}, +{11455.9, 29.2238, 3.71689}, +{11641.2, 29.7193, 3.62704}, +{11829.5, 30.0738, 3.53874}, +{12020.8, 30.3497, 3.45199}, +{12215.3, 30.5748, 3.36682}, +{12412.8, 30.7642, 3.28322}, +{12613.6, 30.9268, 3.20119}, +{12817.6, 31.0685, 3.12074}, +{13025.0, 31.1934, 3.04186}, +{13235.6, 31.3045, 2.96456}, +{13449.7, 31.4039, 2.88881}, +{13667.2, 31.4933, 2.81462}, +{13888.3, 31.5740, 2.74198}, +{14112.9, 31.6472, 2.67087}, +{14341.2, 31.7137, 2.60128}, +{14573.1, 31.7743, 2.53320}, +{14808.9, 31.8295, 2.46661}, +{15048.4, 31.8800, 2.40149}, +{15291.8, 31.9260, 2.33783}, +{15539.1, 31.9682, 2.27562}, +{15790.4, 32.0067, 2.21482}, +{16045.8, 32.0420, 2.15542}, +{16305.4, 32.0742, 2.09741}, +{16569.1, 32.1037, 2.04076}, +{16837.1, 32.1306, 1.98544}, +{17109.4, 32.1551, 1.93145}, +{17386.1, 32.1774, 1.87875}, +{17667.4, 32.1977, 1.82733}, +{17953.1, 32.2161, 1.77716}, +{18243.5, 32.2328, 1.72823}, +{18538.6, 32.2478, 1.68050}, +{18838.4, 32.2613, 1.63396}, +{19143.1, 32.2734, 1.58858}, +{19452.7, 32.2842, 1.54434}, +{19767.4, 32.2938, 1.50122}, +{20087.1, 32.3022, 1.45920}, +{20412.0, 32.3096, 1.41825}, +{20742.1, 32.3160, 1.37836}, +{21077.6, 32.3214, 1.33949}, +{21418.5, 32.3260, 1.30163}, +{21765.0, 32.3298, 1.26476}, +{22117.0, 32.3329, 1.22885}, +{22474.7, 32.3352, 1.19389}, +{22838.2, 32.3369, 1.15985}, +{23207.6, 32.3380, 1.12672}, +{23583.0, 32.3385, 1.09446}, +{23964.4, 32.3385, 1.06307}, +{24352.0, 32.3381, 1.03252}, +{24745.9, 32.3371, 1.00279}, +{25146.2, 32.3358, 0.973864}, +{25552.9, 32.3340, 0.945722}, +{25966.2, 32.3319, 0.918345}, +{26386.1, 32.3295, 0.891714}, +{26812.9, 32.3268, 0.865812}, +{27246.6, 32.3238, 0.840620}, +{27687.3, 32.3205, 0.816123}, +{28135.1, 32.3170, 0.792300}, +{28590.2, 32.3133, 0.769138}, +{29052.6, 32.3095, 0.746618}, +{29522.5, 32.3076, 0.724724}, +{30000.0, 32.2946, 0.703442}, +{0, 0, 0} +}; + +e_fp_fdp as[] = { /* Z = 33 */ +{10.0000, -9999.00, 4.62596}, +{10.1617, -9999.00, 4.67742}, +{10.3261, -9999.00, 4.72945}, +{10.4931, -9999.00, 4.78206}, +{10.6628, -9999.00, 4.83525}, +{10.8353, -9999.00, 4.88904}, +{11.0106, -9999.00, 4.94342}, +{11.1886, -9999.00, 4.99841}, +{11.3696, -9999.00, 5.05401}, +{11.5535, -9999.00, 5.11023}, +{11.7404, -9999.00, 5.16708}, +{11.9303, -9999.00, 5.22456}, +{12.1232, -9999.00, 5.28267}, +{12.3193, -9999.00, 5.31932}, +{12.5186, -9999.00, 5.31541}, +{12.7210, -9999.00, 5.31150}, +{12.9268, -9999.00, 5.30759}, +{13.1359, -9999.00, 5.30369}, +{13.3483, -9999.00, 5.29978}, +{13.5642, -9999.00, 5.29589}, +{13.7836, -9999.00, 5.29199}, +{14.0066, -9999.00, 5.28751}, +{14.2331, -9999.00, 5.28080}, +{14.4633, -9999.00, 5.27410}, +{14.6973, -9999.00, 5.26741}, +{14.9350, -9999.00, 5.26072}, +{15.1765, -9999.00, 5.25404}, +{15.4220, -9999.00, 5.24738}, +{15.6714, -9999.00, 5.24072}, +{15.9249, -9999.00, 5.23407}, +{16.1825, -9999.00, 5.22742}, +{16.4442, -9999.00, 5.15507}, +{16.7102, -9999.00, 5.06546}, +{16.9805, -9999.00, 4.97741}, +{17.2551, -9999.00, 4.89090}, +{17.5342, -9999.00, 4.80588}, +{17.8178, -9999.00, 4.72235}, +{18.1060, -9999.00, 4.64026}, +{18.3989, -9999.00, 4.53714}, +{18.6964, -9999.00, 4.37679}, +{18.9988, -9999.00, 4.22210}, +{19.3061, -9999.00, 4.07288}, +{19.6184, -9999.00, 3.92893}, +{19.9357, -9999.00, 3.79007}, +{20.2582, -9999.00, 3.65612}, +{20.5858, -9999.00, 3.52329}, +{20.9188, -9999.00, 3.39393}, +{21.2571, -9999.00, 3.26932}, +{21.6009, -9999.00, 3.14929}, +{21.9503, -9999.00, 3.03366}, +{22.3053, -9999.00, 2.88009}, +{22.6661, -9999.00, 2.71399}, +{23.0327, -9999.00, 2.55747}, +{23.4053, -9999.00, 2.40998}, +{23.7838, -9999.00, 2.27099}, +{24.1685, -9999.00, 2.14002}, +{24.5594, -9999.00, 2.01335}, +{24.9566, -9999.00, 1.89149}, +{25.3603, -9999.00, 1.77702}, +{25.7705, -9999.00, 1.66947}, +{26.1873, -9999.00, 1.56843}, +{26.6109, -9999.00, 1.47351}, +{27.0413, -9999.00, 1.37723}, +{27.4786, -9999.00, 1.28202}, +{27.9231, -9999.00, 1.19340}, +{28.3747, -9999.00, 1.11090}, +{28.8337, -9999.00, 1.03411}, +{29.3000, 6.58480, 0.968319}, +{29.7739, 6.50149, 0.916166}, +{30.2555, 6.42175, 0.866823}, +{30.7449, 6.34270, 0.820138}, +{31.2421, 6.26381, 0.775967}, +{31.7475, 6.18643, 0.734175}, +{32.2609, 6.10805, 0.684550}, +{32.7827, 6.01692, 0.635642}, +{33.3130, 5.91271, 0.590347}, +{33.8518, 5.80605, 0.567907}, +{34.3993, 5.70259, 0.546319}, +{34.9557, 5.59388, 0.527579}, +{35.5211, 5.48400, 0.517980}, +{36.0956, 5.36967, 0.508556}, +{36.6794, 5.24292, 0.508966}, +{37.2727, 5.11497, 0.517035}, +{37.8755, 4.97518, 0.539057}, +{38.4882, 4.82707, 0.569786}, +{39.1107, 4.64548, 0.643758}, +{39.7432, 4.50161, 0.766203}, +{40.3861, 4.38743, 0.911940}, +{41.0393, 4.31305, 1.07785}, +{41.7031, 4.28570, 1.26123}, +{42.3776, 4.33582, 1.39611}, +{43.0630, 4.39229, 1.49928}, +{43.7595, 4.44656, 1.51243}, +{44.4673, 4.45697, 1.51714}, +{45.1865, 4.44758, 1.52187}, +{45.9174, 4.42836, 1.52316}, +{46.6600, 4.39149, 1.51765}, +{47.4147, 4.33769, 1.51216}, +{48.1816, 4.26228, 1.50669}, +{48.9609, 4.14655, 1.52291}, +{49.7528, 4.04859, 1.57707}, +{50.5576, 3.96047, 1.63316}, +{51.3753, 3.86962, 1.69125}, +{52.2062, 3.76530, 1.76089}, +{53.0506, 3.67160, 1.84975}, +{53.9087, 3.58491, 1.94308}, +{54.7806, 3.50091, 2.04112}, +{55.6667, 3.41812, 2.14411}, +{56.5670, 3.33371, 2.25553}, +{57.4820, 3.25526, 2.37750}, +{58.4117, 3.18186, 2.50606}, +{59.3564, 3.11345, 2.64157}, +{60.3165, 3.05149, 2.78441}, +{61.2921, 3.00010, 2.93498}, +{62.2834, 2.95565, 3.07900}, +{63.2908, 2.91053, 3.22779}, +{64.3145, 2.86898, 3.38378}, +{65.3547, 2.83353, 3.54730}, +{66.4118, 2.80821, 3.71872}, +{67.4859, 2.80285, 3.89844}, +{68.5775, 2.81237, 4.05153}, +{69.6867, 2.80932, 4.19949}, +{70.8138, 2.80338, 4.35284}, +{71.9591, 2.79878, 4.51180}, +{73.1230, 2.79918, 4.67657}, +{74.3057, 2.81233, 4.84610}, +{75.5076, 2.82603, 4.99971}, +{76.7289, 2.83488, 5.15819}, +{77.9699, 2.84378, 5.32169}, +{79.2310, 2.85452, 5.49038}, +{80.5125, 2.86840, 5.66441}, +{81.8147, 2.88654, 5.84396}, +{83.1380, 2.91036, 6.02920}, +{84.4827, 2.94172, 6.22031}, +{85.8491, 2.98592, 6.41748}, +{87.2377, 3.05109, 6.60275}, +{88.6487, 3.10712, 6.77774}, +{90.0825, 3.15965, 6.95736}, +{91.5395, 3.21489, 7.14175}, +{93.0201, 3.27457, 7.33102}, +{94.5246, 3.34070, 7.52530}, +{96.0535, 3.41590, 7.72473}, +{97.6071, 3.50767, 7.92946}, +{99.1858, 3.62493, 8.11231}, +{100.790, 3.72675, 8.27853}, +{102.420, 3.82010, 8.44815}, +{104.077, 3.91329, 8.62126}, +{105.760, 4.00796, 8.79790}, +{107.471, 4.10573, 8.97817}, +{109.209, 4.20869, 9.16212}, +{110.975, 4.31860, 9.34518}, +{112.770, 4.42924, 9.52799}, +{114.594, 4.54308, 9.71439}, +{116.448, 4.66181, 9.90442}, +{118.331, 4.78694, 10.0982}, +{120.245, 4.92034, 10.2957}, +{122.190, 5.06696, 10.4971}, +{124.166, 5.23418, 10.6848}, +{126.175, 5.39362, 10.8604}, +{128.215, 5.54958, 11.0388}, +{130.289, 5.70858, 11.2202}, +{132.397, 5.87214, 11.4045}, +{134.538, 6.04173, 11.5919}, +{136.714, 6.21878, 11.7824}, +{138.925, 6.40509, 11.9760}, +{141.172, 6.60296, 12.1727}, +{143.456, 6.81677, 12.3728}, +{145.776, 7.06119, 12.5761}, +{148.134, 7.34059, 12.7351}, +{150.530, 7.59109, 12.8589}, +{152.964, 7.82849, 12.9840}, +{155.439, 8.06178, 13.1103}, +{157.953, 8.29471, 13.2378}, +{160.507, 8.52977, 13.3666}, +{163.103, 8.76980, 13.4965}, +{165.742, 9.02503, 13.6241}, +{168.422, 9.27761, 13.7343}, +{171.146, 9.52616, 13.8454}, +{173.915, 9.77643, 13.9574}, +{176.727, 10.0305, 14.0703}, +{179.586, 10.2902, 14.1841}, +{182.491, 10.5577, 14.2988}, +{185.442, 10.8369, 14.4145}, +{188.442, 11.1542, 14.5311}, +{191.489, 11.4492, 14.5715}, +{194.587, 11.7208, 14.6486}, +{197.734, 11.9934, 14.7407}, +{200.932, 12.2903, 14.8454}, +{204.182, 12.6107, 14.9511}, +{207.485, 12.9626, 15.0574}, +{210.840, 13.3850, 15.1643}, +{214.251, 13.8167, 15.1280}, +{217.716, 14.2179, 15.0612}, +{221.237, 14.5657, 14.9705}, +{224.816, 14.8858, 14.8805}, +{228.452, 15.1880, 14.7910}, +{232.147, 15.4764, 14.7019}, +{235.902, 15.7541, 14.6134}, +{239.717, 16.0230, 14.5256}, +{243.595, 16.2850, 14.4384}, +{247.535, 16.5412, 14.3515}, +{251.538, 16.7926, 14.2651}, +{255.607, 17.0403, 14.1791}, +{259.741, 17.2856, 14.0939}, +{263.942, 17.5302, 14.0092}, +{268.211, 17.7762, 13.9249}, +{272.549, 18.0286, 13.8410}, +{276.957, 18.3009, 13.7377}, +{281.437, 18.5585, 13.6104}, +{285.989, 18.7960, 13.4683}, +{290.615, 19.0174, 13.3255}, +{295.315, 19.2265, 13.1846}, +{300.092, 19.4268, 13.0448}, +{304.945, 19.6193, 12.9066}, +{309.878, 19.8054, 12.7700}, +{314.890, 19.9857, 12.6346}, +{319.983, 20.1606, 12.5006}, +{325.158, 20.3306, 12.3680}, +{330.418, 20.4964, 12.2373}, +{335.762, 20.6587, 12.1079}, +{341.192, 20.8176, 11.9796}, +{346.711, 20.9733, 11.8526}, +{352.319, 21.1263, 11.7270}, +{358.017, 21.2774, 11.6029}, +{363.808, 21.4268, 11.4798}, +{369.692, 21.5749, 11.3580}, +{375.672, 21.7232, 11.2377}, +{381.748, 21.8737, 11.1186}, +{387.922, 22.0309, 10.9970}, +{394.197, 22.1945, 10.8686}, +{400.573, 22.3552, 10.7162}, +{407.052, 22.4965, 10.5560}, +{413.635, 22.6253, 10.3978}, +{420.326, 22.7456, 10.2422}, +{427.124, 22.8592, 10.0890}, +{434.032, 22.9680, 9.93846}, +{441.052, 23.0726, 9.78966}, +{448.186, 23.1759, 9.64207}, +{455.435, 23.2745, 9.49261}, +{462.802, 23.3679, 9.34204}, +{470.287, 23.4550, 9.19197}, +{477.894, 23.5359, 9.04395}, +{485.623, 23.6122, 8.89855}, +{493.478, 23.6847, 8.75560}, +{501.459, 23.7539, 8.61510}, +{509.570, 23.8205, 8.47678}, +{517.812, 23.8859, 8.34005}, +{526.187, 23.9495, 8.20331}, +{534.698, 24.0101, 8.06476}, +{543.346, 24.0653, 7.92655}, +{552.134, 24.1184, 7.79076}, +{561.065, 24.1686, 7.65049}, +{570.139, 24.2101, 7.50992}, +{579.361, 24.2453, 7.37433}, +{588.732, 24.2768, 7.24206}, +{598.254, 24.3057, 7.11270}, +{607.930, 24.3320, 6.98562}, +{617.763, 24.3564, 6.86082}, +{627.755, 24.3809, 6.73778}, +{637.908, 24.4047, 6.61126}, +{648.226, 24.4239, 6.47875}, +{658.711, 24.4306, 6.34346}, +{669.365, 24.4238, 6.21097}, +{680.191, 24.4056, 6.09532}, +{691.193, 24.3908, 5.99258}, +{702.372, 24.3872, 5.89425}, +{713.733, 24.3863, 5.78824}, +{725.277, 24.3780, 5.67781}, +{737.008, 24.3640, 5.56959}, +{748.928, 24.3461, 5.46339}, +{761.042, 24.3249, 5.35912}, +{773.351, 24.3012, 5.25587}, +{785.859, 24.2740, 5.15157}, +{798.570, 24.2402, 5.04684}, +{811.486, 24.2004, 4.94425}, +{824.611, 24.1553, 4.84371}, +{837.949, 24.1051, 4.74520}, +{851.502, 24.0495, 4.64821}, +{865.274, 23.9884, 4.55276}, +{879.269, 23.9210, 4.45888}, +{893.491, 23.8472, 4.36687}, +{907.943, 23.7667, 4.27681}, +{922.628, 23.6798, 4.18867}, +{937.551, 23.5850, 4.10056}, +{952.715, 23.4813, 4.01395}, +{968.124, 23.3677, 3.92886}, +{983.783, 23.2435, 3.84551}, +{999.695, 23.1077, 3.76402}, +{1015.86, 22.9591, 3.68437}, +{1032.29, 22.7970, 3.60698}, +{1048.99, 22.6193, 3.53036}, +{1065.96, 22.4225, 3.45446}, +{1083.20, 22.2040, 3.38029}, +{1100.72, 21.9601, 3.30767}, +{1118.52, 21.6863, 3.23656}, +{1136.61, 21.3764, 3.16708}, +{1155.00, 21.0221, 3.09908}, +{1173.68, 20.6118, 3.03254}, +{1192.66, 20.1289, 2.96728}, +{1211.95, 19.5479, 2.90349}, +{1231.55, 18.8281, 2.84117}, +{1251.47, 17.8969, 2.78039}, +{1271.72, 16.6060, 2.72110}, +{1292.29, 14.5682, 2.66332}, +{1313.19, 9.94240, 2.60676}, +{1323.50, -10.3277, 2.57963}, +{1323.70, -10.3191, 16.4311}, +{1334.43, 10.4900, 16.2725}, +{1356.01, 15.5371, 15.9618}, +{1377.94, 17.9553, 15.6569}, +{1400.23, 19.5599, 15.3578}, +{1422.88, 20.7456, 15.0644}, +{1445.89, 21.6596, 14.7768}, +{1469.28, 22.3592, 14.4951}, +{1493.04, 22.8321, 14.2193}, +{1517.19, 22.7982, 13.9488}, +{1526.90, 20.2859, 13.8426}, +{1527.10, 20.2925, 15.7546}, +{1541.73, 23.7309, 15.5518}, +{1566.67, 24.9157, 15.2164}, +{1592.01, 25.7310, 14.8881}, +{1617.76, 26.3969, 14.5669}, +{1643.92, 26.9712, 14.2527}, +{1670.51, 27.4804, 13.9452}, +{1697.53, 27.9401, 13.6443}, +{1724.99, 28.3637, 13.3500}, +{1752.89, 28.7528, 13.0487}, +{1781.24, 29.1071, 12.7497}, +{1810.05, 29.4284, 12.4541}, +{1839.32, 29.7222, 12.1653}, +{1869.07, 29.9926, 11.8833}, +{1899.30, 30.2427, 11.6080}, +{1930.02, 30.4745, 11.3387}, +{1961.24, 30.6901, 11.0758}, +{1992.96, 30.8892, 10.8192}, +{2025.20, 31.0814, 10.5744}, +{2057.95, 31.2636, 10.3223}, +{2091.24, 31.4305, 10.0742}, +{2125.06, 31.5841, 9.83089}, +{2159.43, 31.7266, 9.59263}, +{2194.36, 31.8585, 9.35857}, +{2229.85, 31.9808, 9.12957}, +{2265.92, 32.0942, 8.90515}, +{2302.57, 32.1993, 8.68526}, +{2339.81, 32.2962, 8.46975}, +{2377.66, 32.3858, 8.25918}, +{2416.11, 32.4686, 8.05289}, +{2455.19, 32.5449, 7.85100}, +{2494.90, 32.6151, 7.65350}, +{2535.26, 32.6795, 7.46014}, +{2576.26, 32.7383, 7.27115}, +{2617.93, 32.7920, 7.08633}, +{2660.27, 32.8407, 6.90567}, +{2703.30, 32.8851, 6.72950}, +{2747.03, 32.9253, 6.55696}, +{2791.46, 32.9615, 6.38852}, +{2836.61, 32.9936, 6.22360}, +{2882.49, 33.0222, 6.06320}, +{2929.11, 33.0476, 5.90606}, +{2976.48, 33.0698, 5.75282}, +{3024.63, 33.0888, 5.60288}, +{3073.55, 33.1050, 5.45711}, +{3123.26, 33.1187, 5.31436}, +{3173.78, 33.1298, 5.17522}, +{3225.11, 33.1386, 5.03945}, +{3277.27, 33.1451, 4.90699}, +{3330.28, 33.1496, 4.77772}, +{3384.15, 33.1521, 4.65164}, +{3438.88, 33.1527, 4.52871}, +{3494.50, 33.1516, 4.40881}, +{3551.02, 33.1488, 4.29189}, +{3608.46, 33.1445, 4.17785}, +{3666.82, 33.1388, 4.06672}, +{3726.13, 33.1317, 3.95841}, +{3786.40, 33.1234, 3.85275}, +{3847.64, 33.1138, 3.74982}, +{3909.87, 33.1032, 3.64949}, +{3973.11, 33.0915, 3.55169}, +{4037.38, 33.0788, 3.45642}, +{4102.68, 33.0652, 3.36358}, +{4169.03, 33.0507, 3.27315}, +{4236.46, 33.0355, 3.18503}, +{4304.98, 33.0195, 3.09915}, +{4374.62, 33.0028, 3.01551}, +{4445.37, 32.9854, 2.93405}, +{4517.27, 32.9674, 2.85471}, +{4590.33, 32.9488, 2.77744}, +{4664.58, 32.9297, 2.70218}, +{4740.03, 32.9101, 2.62882}, +{4816.69, 32.8900, 2.55745}, +{4894.60, 32.8694, 2.48796}, +{4973.77, 32.8484, 2.42027}, +{5054.21, 32.8271, 2.35440}, +{5135.96, 32.8054, 2.29024}, +{5219.03, 32.7833, 2.22777}, +{5303.44, 32.7609, 2.16689}, +{5389.22, 32.7381, 2.10769}, +{5476.39, 32.7150, 2.05008}, +{5564.97, 32.6916, 1.99396}, +{5654.98, 32.6680, 1.93929}, +{5746.44, 32.6440, 1.88612}, +{5839.39, 32.6197, 1.83437}, +{5933.83, 32.5952, 1.78399}, +{6029.81, 32.5703, 1.73491}, +{6127.33, 32.5452, 1.68727}, +{6226.44, 32.5198, 1.64080}, +{6327.15, 32.4940, 1.59559}, +{6429.48, 32.4680, 1.55160}, +{6533.48, 32.4416, 1.50872}, +{6639.15, 32.4149, 1.46703}, +{6746.54, 32.3877, 1.42647}, +{6855.65, 32.3602, 1.38698}, +{6966.54, 32.3323, 1.34861}, +{7079.22, 32.3039, 1.31117}, +{7193.72, 32.2750, 1.27479}, +{7310.07, 32.2455, 1.23936}, +{7428.31, 32.2154, 1.20490}, +{7548.45, 32.1847, 1.17136}, +{7670.54, 32.1533, 1.13871}, +{7794.61, 32.1211, 1.10695}, +{7920.68, 32.0880, 1.07604}, +{8048.79, 32.0539, 1.04595}, +{8178.98, 32.0188, 1.01667}, +{8311.26, 31.9824, 0.988193}, +{8445.69, 31.9447, 0.960474}, +{8582.29, 31.9055, 0.933474}, +{8721.11, 31.8645, 0.907218}, +{8862.16, 31.8216, 0.881665}, +{9005.50, 31.7765, 0.856803}, +{9151.16, 31.7289, 0.832600}, +{9299.17, 31.6782, 0.809046}, +{9449.58, 31.6242, 0.786113}, +{9602.42, 31.5662, 0.763808}, +{9757.73, 31.5034, 0.742093}, +{9915.55, 31.4350, 0.720972}, +{10075.9, 31.3597, 0.700403}, +{10238.9, 31.2760, 0.680383}, +{10404.5, 31.1816, 0.660898}, +{10572.8, 31.0736, 0.641932}, +{10743.8, 30.9475, 0.623472}, +{10917.6, 30.7963, 0.605504}, +{11094.2, 30.6087, 0.588014}, +{11273.6, 30.3635, 0.570989}, +{11455.9, 30.0146, 0.554417}, +{11641.2, 29.4268, 0.538285}, +{11829.5, 27.5708, 0.522580}, +{11866.6, 21.2382, 0.519571}, +{11866.8, 21.2385, 3.89295}, +{12020.8, 29.2007, 3.81789}, +{12215.3, 30.1347, 3.72654}, +{12412.8, 30.6593, 3.63671}, +{12613.6, 31.0279, 3.54840}, +{12817.6, 31.3121, 3.46164}, +{13025.0, 31.5428, 3.37642}, +{13235.6, 31.7361, 3.29277}, +{13449.7, 31.9017, 3.21069}, +{13667.2, 32.0458, 3.13016}, +{13888.3, 32.1726, 3.05120}, +{14112.9, 32.2852, 2.97380}, +{14341.2, 32.3859, 2.89796}, +{14573.1, 32.4764, 2.82366}, +{14808.9, 32.5581, 2.75090}, +{15048.4, 32.6321, 2.67966}, +{15291.8, 32.6994, 2.60995}, +{15539.1, 32.7606, 2.54173}, +{15790.4, 32.8165, 2.47500}, +{16045.8, 32.8675, 2.40974}, +{16305.4, 32.9140, 2.34594}, +{16569.1, 32.9566, 2.28358}, +{16837.1, 32.9956, 2.22263}, +{17109.4, 33.0312, 2.16308}, +{17386.1, 33.0638, 2.10492}, +{17667.4, 33.0936, 2.04811}, +{17953.1, 33.1207, 1.99264}, +{18243.5, 33.1455, 1.93849}, +{18538.6, 33.1681, 1.88564}, +{18838.4, 33.1886, 1.83407}, +{19143.1, 33.2072, 1.78375}, +{19452.7, 33.2241, 1.73466}, +{19767.4, 33.2393, 1.68678}, +{20087.1, 33.2530, 1.64008}, +{20412.0, 33.2652, 1.59455}, +{20742.1, 33.2762, 1.55017}, +{21077.6, 33.2859, 1.50690}, +{21418.5, 33.2945, 1.46474}, +{21765.0, 33.3019, 1.42364}, +{22117.0, 33.3084, 1.38361}, +{22474.7, 33.3140, 1.34460}, +{22838.2, 33.3187, 1.30661}, +{23207.6, 33.3225, 1.26960}, +{23583.0, 33.3257, 1.23356}, +{23964.4, 33.3281, 1.19847}, +{24352.0, 33.3298, 1.16430}, +{24745.9, 33.3310, 1.13104}, +{25146.2, 33.3316, 1.09866}, +{25552.9, 33.3316, 1.06715}, +{25966.2, 33.3312, 1.03648}, +{26386.1, 33.3303, 1.00664}, +{26812.9, 33.3290, 0.977596}, +{27246.6, 33.3273, 0.949343}, +{27687.3, 33.3252, 0.921857}, +{28135.1, 33.3228, 0.895120}, +{28590.2, 33.3201, 0.869114}, +{29052.6, 33.3171, 0.843822}, +{29522.5, 33.3138, 0.819225}, +{30000.0, 33.3103, 0.795307}, +{0, 0, 0} +}; + +e_fp_fdp se[] = { /* Z = 34 */ +{10.0000, -9999.00, 5.20241}, +{10.1617, -9999.00, 5.36005}, +{10.3261, -9999.00, 5.52247}, +{10.4931, -9999.00, 5.63017}, +{10.6628, -9999.00, 5.66221}, +{10.8353, -9999.00, 5.69443}, +{11.0106, -9999.00, 5.71762}, +{11.1886, -9999.00, 5.72709}, +{11.3696, -9999.00, 5.73659}, +{11.5535, -9999.00, 5.74610}, +{11.7404, -9999.00, 5.75558}, +{11.9303, -9999.00, 5.74367}, +{12.1232, -9999.00, 5.73179}, +{12.3193, -9999.00, 5.71993}, +{12.5186, -9999.00, 5.70809}, +{12.7210, -9999.00, 5.69116}, +{12.9268, -9999.00, 5.66798}, +{13.1359, -9999.00, 5.64489}, +{13.3483, -9999.00, 5.62190}, +{13.5642, -9999.00, 5.59899}, +{13.7836, -9999.00, 5.57619}, +{14.0066, -9999.00, 5.55347}, +{14.2331, -9999.00, 5.53085}, +{14.4633, -9999.00, 5.50832}, +{14.6973, -9999.00, 5.48588}, +{14.9350, -9999.00, 5.46416}, +{15.1765, -9999.00, 5.47179}, +{15.4220, -9999.00, 5.47945}, +{15.6714, -9999.00, 5.48710}, +{15.9249, -9999.00, 5.49477}, +{16.1825, -9999.00, 5.50245}, +{16.4442, -9999.00, 5.51014}, +{16.7102, -9999.00, 5.48519}, +{16.9805, -9999.00, 5.45830}, +{17.2551, -9999.00, 5.43154}, +{17.5342, -9999.00, 5.40491}, +{17.8178, -9999.00, 5.37840}, +{18.1060, -9999.00, 5.35997}, +{18.3989, -9999.00, 5.34380}, +{18.6964, -9999.00, 5.32768}, +{18.9988, -9999.00, 5.31161}, +{19.3061, -9999.00, 5.29558}, +{19.6184, -9999.00, 5.27674}, +{19.9357, -9999.00, 5.22931}, +{20.2582, -9999.00, 5.18230}, +{20.5858, -9999.00, 5.13572}, +{20.9188, -9999.00, 5.08955}, +{21.2571, -9999.00, 5.04380}, +{21.6009, -9999.00, 4.97976}, +{21.9503, -9999.00, 4.85658}, +{22.3053, -9999.00, 4.73645}, +{22.6661, -9999.00, 4.61930}, +{23.0327, -9999.00, 4.50120}, +{23.4053, -9999.00, 4.28248}, +{23.7838, -9999.00, 4.07439}, +{24.1685, -9999.00, 3.87642}, +{24.5594, -9999.00, 3.68806}, +{24.9566, -9999.00, 3.50886}, +{25.3603, -9999.00, 3.33836}, +{25.7705, -9999.00, 3.17615}, +{26.1873, -9999.00, 3.02182}, +{26.6109, -9999.00, 2.87499}, +{27.0413, -9999.00, 2.73530}, +{27.4786, -9999.00, 2.60239}, +{27.9231, -9999.00, 2.47594}, +{28.3747, -9999.00, 2.35563}, +{28.8337, -9999.00, 2.24117}, +{29.3000, 7.81210, 2.13227}, +{29.7739, 7.77264, 2.02867}, +{30.2555, 7.73078, 1.93009}, +{30.7449, 7.68731, 1.83631}, +{31.2421, 7.64329, 1.74503}, +{31.7475, 7.59476, 1.65666}, +{32.2609, 7.54326, 1.57276}, +{32.7827, 7.48954, 1.49311}, +{33.3130, 7.43389, 1.41750}, +{33.8518, 7.37649, 1.34571}, +{34.3993, 7.31752, 1.27756}, +{34.9557, 7.25709, 1.21287}, +{35.5211, 7.19532, 1.15144}, +{36.0956, 7.13248, 1.09313}, +{36.6794, 7.06867, 1.03679}, +{37.2727, 7.00248, 0.982849}, +{37.8755, 6.93433, 0.931714}, +{38.4882, 6.86438, 0.883238}, +{39.1107, 6.79256, 0.837286}, +{39.7432, 6.71871, 0.793723}, +{40.3861, 6.64258, 0.752427}, +{41.0393, 6.56315, 0.713280}, +{41.7031, 6.47810, 0.678280}, +{42.3776, 6.39431, 0.651254}, +{43.0630, 6.31141, 0.625303}, +{43.7595, 6.22705, 0.600387}, +{44.4673, 6.13977, 0.576630}, +{45.1865, 6.05017, 0.556066}, +{45.9174, 5.95778, 0.536235}, +{46.6600, 5.85925, 0.517111}, +{47.4147, 5.75263, 0.507983}, +{48.1816, 5.65006, 0.504227}, +{48.9609, 5.54687, 0.500499}, +{49.7528, 5.43915, 0.496798}, +{50.5576, 5.32589, 0.496344}, +{51.3753, 5.20726, 0.496500}, +{52.2062, 5.07947, 0.496658}, +{53.0506, 4.93771, 0.499383}, +{53.9087, 4.77801, 0.503749}, +{54.7806, 4.58914, 0.516424}, +{55.6667, 4.33738, 0.531435}, +{56.5670, 3.96589, 0.711860}, +{57.4820, 3.76831, 1.14783}, +{58.4117, 3.91120, 1.47960}, +{59.3564, 4.02255, 1.60918}, +{60.3165, 4.11620, 1.64922}, +{61.2921, 4.16779, 1.65907}, +{62.2834, 4.10086, 1.55870}, +{63.2908, 3.98540, 1.58412}, +{64.3145, 3.85329, 1.60996}, +{65.3547, 3.71941, 1.70211}, +{66.4118, 3.60305, 1.80064}, +{67.4859, 3.49493, 1.90700}, +{68.5775, 3.39162, 2.02051}, +{69.6867, 3.29206, 2.14079}, +{70.8138, 3.19656, 2.26823}, +{71.9591, 3.10795, 2.40325}, +{73.1230, 3.02786, 2.53434}, +{74.3057, 2.94133, 2.66485}, +{75.5076, 2.85209, 2.80208}, +{76.7289, 2.76166, 2.94638}, +{77.9699, 2.67068, 3.09810}, +{79.2310, 2.57929, 3.25764}, +{80.5125, 2.48724, 3.42540}, +{81.8147, 2.39199, 3.60179}, +{83.1380, 2.29482, 3.79869}, +{84.4827, 2.20835, 4.01211}, +{85.8491, 2.13130, 4.23751}, +{87.2377, 2.06442, 4.47559}, +{88.6487, 2.01156, 4.72704}, +{90.0825, 1.98340, 4.99261}, +{91.5395, 1.98281, 5.23688}, +{93.0201, 1.96942, 5.47150}, +{94.5246, 1.95483, 5.71661}, +{96.0535, 1.94508, 5.97271}, +{97.6071, 1.94410, 6.24029}, +{99.1858, 1.95559, 6.51984}, +{100.790, 1.98647, 6.81193}, +{102.420, 2.05687, 7.11710}, +{104.077, 2.15896, 7.37029}, +{105.760, 2.23502, 7.60472}, +{107.471, 2.30298, 7.84660}, +{109.209, 2.37114, 8.09618}, +{110.975, 2.44374, 8.35369}, +{112.770, 2.52391, 8.61940}, +{114.594, 2.61557, 8.89355}, +{116.448, 2.72500, 9.17644}, +{118.331, 2.87341, 9.45712}, +{120.245, 3.01602, 9.69210}, +{122.190, 3.14924, 9.93291}, +{124.166, 3.28130, 10.1797}, +{126.175, 3.41817, 10.4327}, +{128.215, 3.56279, 10.6919}, +{130.289, 3.71854, 10.9575}, +{132.397, 3.89005, 11.2298}, +{134.538, 4.09069, 11.5088}, +{136.714, 4.32489, 11.7464}, +{138.925, 4.53966, 11.9622}, +{141.172, 4.74380, 12.1819}, +{143.456, 4.95076, 12.4056}, +{145.776, 5.16419, 12.6335}, +{148.134, 5.38908, 12.8656}, +{150.530, 5.64366, 13.1013}, +{152.964, 5.89986, 13.2929}, +{155.439, 6.14556, 13.4874}, +{157.953, 6.39191, 13.6847}, +{160.507, 6.64329, 13.8849}, +{163.103, 6.90320, 14.0880}, +{165.742, 7.17585, 14.2941}, +{168.422, 7.47221, 14.5032}, +{171.146, 7.79913, 14.6762}, +{173.915, 8.10884, 14.8250}, +{176.727, 8.40802, 14.9753}, +{179.586, 8.70975, 15.1271}, +{182.491, 9.01757, 15.2805}, +{185.442, 9.33525, 15.4355}, +{188.442, 9.66739, 15.5920}, +{191.489, 10.0225, 15.7501}, +{194.587, 10.4583, 15.8792}, +{197.734, 10.8558, 15.9185}, +{200.932, 11.2145, 15.9579}, +{204.182, 11.5646, 15.9973}, +{207.485, 11.9143, 16.0369}, +{210.840, 12.2802, 16.0751}, +{214.251, 12.6402, 16.0661}, +{217.716, 12.9846, 16.0491}, +{221.237, 13.3097, 16.0256}, +{224.816, 13.6240, 16.0020}, +{228.452, 13.9308, 15.9785}, +{232.147, 14.2323, 15.9551}, +{235.902, 14.5299, 15.9315}, +{239.717, 14.8248, 15.9081}, +{243.595, 15.1184, 15.8849}, +{247.535, 15.4118, 15.8615}, +{251.538, 15.7061, 15.8381}, +{255.607, 16.0025, 15.8146}, +{259.741, 16.3030, 15.7914}, +{263.942, 16.6102, 15.7682}, +{268.211, 16.9286, 15.7453}, +{272.549, 17.2691, 15.7222}, +{276.957, 17.6616, 15.6548}, +{281.437, 18.0279, 15.5322}, +{285.989, 18.3558, 15.3759}, +{290.615, 18.6547, 15.2162}, +{295.315, 18.9311, 15.0580}, +{300.092, 19.1928, 14.9015}, +{304.945, 19.4423, 14.7465}, +{309.878, 19.6816, 14.5932}, +{314.890, 19.9120, 14.4416}, +{319.983, 20.1346, 14.2917}, +{325.158, 20.3505, 14.1433}, +{330.418, 20.5602, 13.9963}, +{335.762, 20.7641, 13.8508}, +{341.192, 20.9634, 13.7073}, +{346.711, 21.1585, 13.5647}, +{352.319, 21.3494, 13.4235}, +{358.017, 21.5370, 13.2841}, +{363.808, 21.7223, 13.1463}, +{369.692, 21.9060, 13.0098}, +{375.672, 22.0892, 12.8746}, +{381.748, 22.2738, 12.7407}, +{387.922, 22.4642, 12.6049}, +{394.197, 22.6642, 12.4637}, +{400.573, 22.8618, 12.2932}, +{407.052, 23.0364, 12.1128}, +{413.635, 23.1962, 11.9347}, +{420.326, 23.3462, 11.7599}, +{427.124, 23.4891, 11.5878}, +{434.032, 23.6255, 11.4175}, +{441.052, 23.7567, 11.2501}, +{448.186, 23.8874, 11.0842}, +{455.435, 24.0123, 10.9150}, +{462.802, 24.1307, 10.7448}, +{470.287, 24.2415, 10.5754}, +{477.894, 24.3458, 10.4089}, +{485.623, 24.4452, 10.2448}, +{493.478, 24.5401, 10.0832}, +{501.459, 24.6310, 9.92421}, +{509.570, 24.7187, 9.76800}, +{517.812, 24.8051, 9.61373}, +{526.187, 24.8893, 9.45967}, +{534.698, 24.9704, 9.30428}, +{543.346, 25.0465, 9.14959}, +{552.134, 25.1209, 8.99757}, +{561.065, 25.1928, 8.83996}, +{570.139, 25.2558, 8.68154}, +{579.361, 25.3117, 8.52741}, +{588.732, 25.3632, 8.37670}, +{598.254, 25.4116, 8.22908}, +{607.930, 25.4572, 8.08404}, +{617.763, 25.5009, 7.94153}, +{627.755, 25.5453, 7.80096}, +{637.908, 25.5894, 7.65600}, +{648.226, 25.6287, 7.50350}, +{658.711, 25.6534, 7.34742}, +{669.365, 25.6628, 7.19460}, +{680.191, 25.6596, 7.06113}, +{691.193, 25.6608, 6.94248}, +{702.372, 25.6757, 6.82881}, +{713.733, 25.6945, 6.70560}, +{725.277, 25.7048, 6.57686}, +{737.008, 25.7089, 6.45050}, +{748.928, 25.7087, 6.32662}, +{761.042, 25.7053, 6.20507}, +{773.351, 25.6994, 6.08515}, +{785.859, 25.6906, 5.96488}, +{798.570, 25.6759, 5.84480}, +{811.486, 25.6561, 5.72708}, +{824.611, 25.6319, 5.61178}, +{837.949, 25.6037, 5.49887}, +{851.502, 25.5715, 5.38761}, +{865.274, 25.5350, 5.27801}, +{879.269, 25.4936, 5.17013}, +{893.491, 25.4475, 5.06442}, +{907.943, 25.3969, 4.96093}, +{922.628, 25.3428, 4.85961}, +{937.551, 25.2832, 4.75681}, +{952.715, 25.2169, 4.65526}, +{968.124, 25.1430, 4.55507}, +{983.783, 25.0617, 4.45706}, +{999.695, 24.9729, 4.36118}, +{1015.86, 24.8762, 4.26740}, +{1032.29, 24.7714, 4.17564}, +{1048.99, 24.6578, 4.08507}, +{1065.96, 24.5334, 3.99563}, +{1083.20, 24.3972, 3.90798}, +{1100.72, 24.2482, 3.82225}, +{1118.52, 24.0848, 3.73840}, +{1136.61, 23.9053, 3.65645}, +{1155.00, 23.7075, 3.57632}, +{1173.68, 23.4885, 3.49798}, +{1192.66, 23.2446, 3.42124}, +{1211.95, 22.9710, 3.34624}, +{1231.55, 22.6617, 3.27298}, +{1251.47, 22.3083, 3.20135}, +{1271.72, 21.8995, 3.13149}, +{1292.29, 21.4189, 3.06339}, +{1313.19, 20.8413, 2.99669}, +{1334.43, 20.1259, 2.93141}, +{1356.01, 19.2002, 2.86751}, +{1377.94, 17.9159, 2.80518}, +{1400.23, 15.8838, 2.74413}, +{1422.88, 11.2425, 2.68425}, +{1433.80, -9.16067, 2.65616}, +{1434.00, -9.15379, 16.4055}, +{1445.89, 11.9859, 16.2342}, +{1469.28, 16.9350, 15.9067}, +{1493.04, 19.3189, 15.5857}, +{1517.19, 20.8997, 15.2740}, +{1541.73, 22.0662, 14.9689}, +{1566.67, 22.9617, 14.6699}, +{1592.01, 23.6407, 14.3768}, +{1617.76, 24.0830, 14.0897}, +{1643.92, 23.9200, 13.8082}, +{1651.90, 21.5003, 13.7244}, +{1652.10, 21.5059, 15.6001}, +{1670.51, 25.0654, 15.3744}, +{1697.53, 26.1650, 15.0534}, +{1724.99, 26.9569, 14.7391}, +{1752.89, 27.6121, 14.4185}, +{1781.24, 28.1758, 14.1004}, +{1810.05, 28.6722, 13.7862}, +{1839.32, 29.1154, 13.4790}, +{1869.07, 29.5163, 13.1787}, +{1899.30, 29.8817, 12.8849}, +{1930.02, 30.2170, 12.5980}, +{1961.24, 30.5263, 12.3174}, +{1992.96, 30.8102, 12.0429}, +{2025.20, 31.0855, 11.7824}, +{2057.95, 31.3440, 11.5096}, +{2091.24, 31.5785, 11.2412}, +{2125.06, 31.7954, 10.9772}, +{2159.43, 31.9963, 10.7179}, +{2194.36, 32.1827, 10.4632}, +{2229.85, 32.3557, 10.2132}, +{2265.92, 32.5165, 9.96774}, +{2302.57, 32.6655, 9.72676}, +{2339.81, 32.8040, 9.49082}, +{2377.66, 32.9325, 9.25902}, +{2416.11, 33.0515, 9.03199}, +{2455.19, 33.1616, 8.80949}, +{2494.90, 33.2639, 8.59185}, +{2535.26, 33.3582, 8.37818}, +{2576.26, 33.4453, 8.16932}, +{2617.93, 33.5257, 7.96484}, +{2660.27, 33.5997, 7.76451}, +{2703.30, 33.6677, 7.56869}, +{2747.03, 33.7299, 7.37695}, +{2791.46, 33.7867, 7.18953}, +{2836.61, 33.8385, 7.00650}, +{2882.49, 33.8858, 6.82741}, +{2929.11, 33.9286, 6.65222}, +{2976.48, 33.9669, 6.48092}, +{3024.63, 34.0012, 6.31378}, +{3073.55, 34.0319, 6.15069}, +{3123.26, 34.0593, 5.99126}, +{3173.78, 34.0831, 5.83532}, +{3225.11, 34.1038, 5.68325}, +{3277.27, 34.1216, 5.53479}, +{3330.28, 34.1366, 5.38979}, +{3384.15, 34.1490, 5.24833}, +{3438.88, 34.1589, 5.11032}, +{3494.50, 34.1665, 4.97558}, +{3551.02, 34.1719, 4.84418}, +{3608.46, 34.1752, 4.71598}, +{3666.82, 34.1766, 4.59096}, +{3726.13, 34.1762, 4.46898}, +{3786.40, 34.1741, 4.35005}, +{3847.64, 34.1703, 4.23413}, +{3909.87, 34.1651, 4.12106}, +{3973.11, 34.1585, 4.01086}, +{4037.38, 34.1505, 3.90339}, +{4102.68, 34.1412, 3.79871}, +{4169.03, 34.1308, 3.69664}, +{4236.46, 34.1194, 3.59721}, +{4304.98, 34.1068, 3.50029}, +{4374.62, 34.0933, 3.40589}, +{4445.37, 34.0790, 3.31390}, +{4517.27, 34.0637, 3.22426}, +{4590.33, 34.0477, 3.13699}, +{4664.58, 34.0310, 3.05195}, +{4740.03, 34.0136, 2.96915}, +{4816.69, 33.9955, 2.88846}, +{4894.60, 33.9768, 2.80987}, +{4973.77, 33.9576, 2.73340}, +{5054.21, 33.9378, 2.65895}, +{5135.96, 33.9176, 2.58640}, +{5219.03, 33.8969, 2.51575}, +{5303.44, 33.8757, 2.44699}, +{5389.22, 33.8541, 2.38004}, +{5476.39, 33.8322, 2.31490}, +{5564.97, 33.8099, 2.25139}, +{5654.98, 33.7872, 2.18962}, +{5746.44, 33.7641, 2.12952}, +{5839.39, 33.7408, 2.07105}, +{5933.83, 33.7172, 2.01411}, +{6029.81, 33.6933, 1.95872}, +{6127.33, 33.6690, 1.90474}, +{6226.44, 33.6445, 1.85226}, +{6327.15, 33.6197, 1.80112}, +{6429.48, 33.5946, 1.75142}, +{6533.48, 33.5692, 1.70309}, +{6639.15, 33.5436, 1.65594}, +{6746.54, 33.5175, 1.61012}, +{6855.65, 33.4912, 1.56560}, +{6966.54, 33.4646, 1.52219}, +{7079.22, 33.4377, 1.48005}, +{7193.72, 33.4104, 1.43895}, +{7310.07, 33.3826, 1.39897}, +{7428.31, 33.3545, 1.36011}, +{7548.45, 33.3259, 1.32229}, +{7670.54, 33.2968, 1.28550}, +{7794.61, 33.2672, 1.24970}, +{7920.68, 33.2370, 1.21487}, +{8048.79, 33.2061, 1.18098}, +{8178.98, 33.1746, 1.14801}, +{8311.26, 33.1423, 1.11595}, +{8445.69, 33.1091, 1.08475}, +{8582.29, 33.0750, 1.05439}, +{8721.11, 33.0399, 1.02486}, +{8862.16, 33.0035, 0.996119}, +{9005.50, 32.9659, 0.968173}, +{9151.16, 32.9267, 0.940974}, +{9299.17, 32.8859, 0.914524}, +{9449.58, 32.8431, 0.888791}, +{9602.42, 32.7982, 0.863753}, +{9757.73, 32.7508, 0.839401}, +{9915.55, 32.7005, 0.815708}, +{10075.9, 32.6469, 0.792654}, +{10238.9, 32.5893, 0.770227}, +{10404.5, 32.5271, 0.748408}, +{10572.8, 32.4593, 0.727180}, +{10743.8, 32.3848, 0.706528}, +{10917.6, 32.3020, 0.686435}, +{11094.2, 32.2088, 0.666886}, +{11273.6, 32.1023, 0.647866}, +{11455.9, 31.9779, 0.629361}, +{11641.2, 31.8291, 0.611357}, +{11829.5, 31.6446, 0.593839}, +{12020.8, 31.4039, 0.576795}, +{12215.3, 31.0623, 0.560210}, +{12412.8, 30.4902, 0.544073}, +{12613.6, 28.7508, 0.528371}, +{12657.7, 22.3125, 0.525017}, +{12657.9, 22.3128, 3.85811}, +{12817.6, 30.2182, 3.78519}, +{13025.0, 31.1582, 3.69390}, +{13235.6, 31.6814, 3.60420}, +{13449.7, 32.0478, 3.51608}, +{13667.2, 32.3297, 3.42956}, +{13888.3, 32.5582, 3.34463}, +{14112.9, 32.7495, 3.26132}, +{14341.2, 32.9132, 3.17960}, +{14573.1, 33.0555, 3.09948}, +{14808.9, 33.1806, 3.02096}, +{15048.4, 33.2917, 2.94403}, +{15291.8, 33.3909, 2.86868}, +{15539.1, 33.4800, 2.79490}, +{15790.4, 33.5605, 2.72267}, +{16045.8, 33.6333, 2.65199}, +{16305.4, 33.6994, 2.58283}, +{16569.1, 33.7596, 2.51520}, +{16837.1, 33.8144, 2.44905}, +{17109.4, 33.8645, 2.38439}, +{17386.1, 33.9102, 2.32119}, +{17667.4, 33.9520, 2.25943}, +{17953.1, 33.9901, 2.19909}, +{18243.5, 34.0250, 2.14015}, +{18538.6, 34.0569, 2.08259}, +{18838.4, 34.0861, 2.02640}, +{19143.1, 34.1126, 1.97154}, +{19452.7, 34.1369, 1.91799}, +{19767.4, 34.1589, 1.86574}, +{20087.1, 34.1789, 1.81476}, +{20412.0, 34.1971, 1.76502}, +{20742.1, 34.2135, 1.71652}, +{21077.6, 34.2284, 1.66921}, +{21418.5, 34.2417, 1.62308}, +{21765.0, 34.2536, 1.57811}, +{22117.0, 34.2643, 1.53428}, +{22474.7, 34.2737, 1.49155}, +{22838.2, 34.2820, 1.44992}, +{23207.6, 34.2893, 1.40935}, +{23583.0, 34.2955, 1.36982}, +{23964.4, 34.3009, 1.33132}, +{24352.0, 34.3054, 1.29382}, +{24745.9, 34.3091, 1.25729}, +{25146.2, 34.3121, 1.22173}, +{25552.9, 34.3144, 1.18709}, +{25966.2, 34.3161, 1.15338}, +{26386.1, 34.3172, 1.12055}, +{26812.9, 34.3177, 1.08860}, +{27246.6, 34.3177, 1.05750}, +{27687.3, 34.3172, 1.02724}, +{28135.1, 34.3163, 0.997790}, +{28590.2, 34.3149, 0.969135}, +{29052.6, 34.3132, 0.941255}, +{29522.5, 34.3111, 0.914132}, +{30000.0, 34.3087, 0.887748}, +{0, 0, 0} +}; + +e_fp_fdp br[] = { /* Z = 35 */ +{10.0000, -9999.00, 5.16199}, +{10.1617, -9999.00, 5.31855}, +{10.3261, -9999.00, 5.47986}, +{10.4931, -9999.00, 5.64606}, +{10.6628, -9999.00, 5.81730}, +{10.8353, -9999.00, 5.99373}, +{11.0106, -9999.00, 6.17552}, +{11.1886, -9999.00, 6.36281}, +{11.3696, -9999.00, 6.55580}, +{11.5535, -9999.00, 6.75463}, +{11.7404, -9999.00, 6.95949}, +{11.9303, -9999.00, 7.17057}, +{12.1232, -9999.00, 7.38804}, +{12.3193, -9999.00, 7.58343}, +{12.5186, -9999.00, 7.77469}, +{12.7210, -9999.00, 7.97079}, +{12.9268, -9999.00, 8.15805}, +{13.1359, -9999.00, 8.33656}, +{13.3483, -9999.00, 8.51899}, +{13.5642, -9999.00, 8.70540}, +{13.7836, -9999.00, 8.85695}, +{14.0066, -9999.00, 9.00806}, +{14.2331, -9999.00, 9.16174}, +{14.4633, -9999.00, 9.31805}, +{14.6973, -9999.00, 9.47702}, +{14.9350, -9999.00, 9.54582}, +{15.1765, -9999.00, 9.60017}, +{15.4220, -9999.00, 9.65483}, +{15.6714, -9999.00, 9.70981}, +{15.9249, -9999.00, 9.76508}, +{16.1825, -9999.00, 9.82068}, +{16.4442, -9999.00, 9.87659}, +{16.7102, -9999.00, 9.93283}, +{16.9805, -9999.00, 9.98937}, +{17.2551, -9999.00, 9.99258}, +{17.5342, -9999.00, 9.97751}, +{17.8178, -9999.00, 9.96245}, +{18.1060, -9999.00, 9.94743}, +{18.3989, -9999.00, 9.93243}, +{18.6964, -9999.00, 9.91745}, +{18.9988, -9999.00, 9.90249}, +{19.3061, -9999.00, 9.82616}, +{19.6184, -9999.00, 9.72846}, +{19.9357, -9999.00, 9.63175}, +{20.2582, -9999.00, 9.53599}, +{20.5858, -9999.00, 9.44119}, +{20.9188, -9999.00, 9.34434}, +{21.2571, -9999.00, 9.13918}, +{21.6009, -9999.00, 8.93851}, +{21.9503, -9999.00, 8.74225}, +{22.3053, -9999.00, 8.55031}, +{22.6661, -9999.00, 8.36258}, +{23.0327, -9999.00, 8.17896}, +{23.4053, -9999.00, 7.99939}, +{23.7838, -9999.00, 7.82375}, +{24.1685, -9999.00, 7.65197}, +{24.5594, -9999.00, 7.48396}, +{24.9566, -9999.00, 7.31964}, +{25.3603, -9999.00, 7.15499}, +{25.7705, -9999.00, 6.84731}, +{26.1873, -9999.00, 6.55286}, +{26.6109, -9999.00, 6.27107}, +{27.0413, -9999.00, 6.00140}, +{27.4786, -9999.00, 5.74332}, +{27.9231, -9999.00, 5.49634}, +{28.3747, -9999.00, 5.25999}, +{28.8337, -9999.00, 5.03379}, +{29.3000, 10.3082, 4.81733}, +{29.7739, 10.3170, 4.61018}, +{30.2555, 10.3222, 4.41193}, +{30.7449, 10.3268, 4.22220}, +{31.2421, 10.3374, 4.04064}, +{31.7475, 10.3725, 3.84576}, +{32.2609, 10.3733, 3.60661}, +{32.7827, 10.3417, 3.38232}, +{33.3130, 10.2919, 3.17199}, +{33.8518, 10.2304, 2.97474}, +{34.3993, 10.1602, 2.78975}, +{34.9557, 10.0832, 2.61626}, +{35.5211, 10.0011, 2.45357}, +{36.0956, 9.91476, 2.30099}, +{36.6794, 9.82528, 2.15790}, +{37.2727, 9.73335, 2.02370}, +{37.8755, 9.63964, 1.89786}, +{38.4882, 9.54522, 1.77983}, +{39.1107, 9.45197, 1.66750}, +{39.7432, 9.35472, 1.55775}, +{40.3861, 9.25390, 1.45522}, +{41.0393, 9.15104, 1.35945}, +{41.7031, 9.04651, 1.26997}, +{42.3776, 8.93986, 1.18639}, +{43.0630, 8.82982, 1.11133}, +{43.7595, 8.72291, 1.04371}, +{44.4673, 8.61713, 0.980199}, +{45.1865, 8.51107, 0.920558}, +{45.9174, 8.40366, 0.864544}, +{46.6600, 8.29610, 0.815397}, +{47.4147, 8.18957, 0.769296}, +{48.1816, 8.08253, 0.725801}, +{48.9609, 7.97365, 0.684766}, +{49.7528, 7.85998, 0.647698}, +{50.5576, 7.74794, 0.621275}, +{51.3753, 7.63802, 0.595928}, +{52.2062, 7.52717, 0.571616}, +{53.0506, 7.41120, 0.549811}, +{53.9087, 7.29633, 0.538688}, +{54.7806, 7.18307, 0.527790}, +{55.6667, 7.06722, 0.519232}, +{56.5670, 6.95124, 0.513192}, +{57.4820, 6.83022, 0.510186}, +{58.4117, 6.71055, 0.512216}, +{59.3564, 6.58978, 0.514254}, +{60.3165, 6.46503, 0.516291}, +{61.2921, 6.33410, 0.518279}, +{62.2834, 6.19362, 0.520274}, +{63.2908, 6.03782, 0.526423}, +{64.3145, 5.87086, 0.537133}, +{65.3547, 5.68301, 0.548060}, +{66.4118, 5.44005, 0.558161}, +{67.4859, 5.01881, 0.654814}, +{68.5775, 4.70397, 1.05610}, +{69.6867, 4.78236, 1.53791}, +{70.8138, 4.94458, 1.80131}, +{71.9591, 5.10409, 1.85264}, +{73.1230, 5.28662, 1.90543}, +{74.3057, 5.17992, 1.59532}, +{75.5076, 5.00758, 1.62740}, +{76.7289, 4.87591, 1.67037}, +{77.9699, 4.73650, 1.71446}, +{79.2310, 4.58138, 1.79608}, +{80.5125, 4.44235, 1.89596}, +{81.8147, 4.31084, 2.00140}, +{83.1380, 4.17885, 2.11271}, +{84.4827, 4.04002, 2.23270}, +{85.8491, 3.90447, 2.37166}, +{87.2377, 3.77359, 2.51927}, +{88.6487, 3.64515, 2.67606}, +{90.0825, 3.51865, 2.84262}, +{91.5395, 3.39434, 3.01954}, +{93.0201, 3.27238, 3.20747}, +{94.5246, 3.15339, 3.40710}, +{96.0535, 3.03751, 3.61915}, +{97.6071, 2.92520, 3.84635}, +{99.1858, 2.82119, 4.08996}, +{100.790, 2.72718, 4.34901}, +{102.420, 2.64538, 4.62445}, +{104.077, 2.58033, 4.91735}, +{105.760, 2.53929, 5.22879}, +{107.471, 2.54628, 5.55997}, +{109.209, 2.60514, 5.82589}, +{110.975, 2.63093, 6.06508}, +{112.770, 2.63820, 6.31409}, +{114.594, 2.64529, 6.57333}, +{116.448, 2.65608, 6.84321}, +{118.331, 2.67457, 7.12417}, +{120.245, 2.70524, 7.41667}, +{122.190, 2.75992, 7.72117}, +{124.166, 2.83661, 7.99945}, +{126.175, 2.90459, 8.27373}, +{128.215, 2.97084, 8.55742}, +{130.289, 3.04474, 8.85084}, +{132.397, 3.12990, 9.15431}, +{134.538, 3.23125, 9.46820}, +{136.714, 3.35636, 9.79285}, +{138.925, 3.53026, 10.1286}, +{141.172, 3.73627, 10.3839}, +{143.456, 3.91159, 10.6203}, +{145.776, 4.06866, 10.8620}, +{148.134, 4.22427, 11.1093}, +{150.530, 4.38223, 11.3621}, +{152.964, 4.54667, 11.6208}, +{155.439, 4.72856, 11.8853}, +{157.953, 4.91473, 12.1279}, +{160.507, 5.09557, 12.3736}, +{163.103, 5.27781, 12.6242}, +{165.742, 5.46392, 12.8799}, +{168.422, 5.65508, 13.1408}, +{171.146, 5.84792, 13.4070}, +{173.915, 6.04807, 13.6943}, +{176.727, 6.27170, 13.9949}, +{179.586, 6.51812, 14.3021}, +{182.491, 6.78961, 14.6161}, +{185.442, 7.09257, 14.9370}, +{188.442, 7.44074, 15.2649}, +{191.489, 7.88928, 15.5943}, +{194.587, 8.33263, 15.7401}, +{197.734, 8.73032, 15.8873}, +{200.932, 9.10381, 16.0359}, +{204.182, 9.47423, 16.1858}, +{207.485, 9.84936, 16.3371}, +{210.840, 10.2387, 16.4899}, +{214.251, 10.6965, 16.6195}, +{217.716, 11.1175, 16.6621}, +{221.237, 11.4972, 16.7047}, +{224.816, 11.8630, 16.7475}, +{228.452, 12.2205, 16.7904}, +{232.147, 12.5732, 16.8334}, +{235.902, 12.9238, 16.8765}, +{239.717, 13.2751, 16.9197}, +{243.595, 13.6305, 16.9630}, +{247.535, 13.9997, 17.0041}, +{251.538, 14.3663, 17.0202}, +{255.607, 14.7286, 17.0363}, +{259.741, 15.0923, 17.0523}, +{263.942, 15.4627, 17.0685}, +{268.211, 15.8465, 17.0848}, +{272.549, 16.2576, 17.1008}, +{276.957, 16.7337, 17.0615}, +{281.437, 17.1778, 16.9530}, +{285.989, 17.5746, 16.8014}, +{290.615, 17.9352, 16.6453}, +{295.315, 18.2686, 16.4908}, +{300.092, 18.5842, 16.3374}, +{304.945, 18.8852, 16.1853}, +{309.878, 19.1737, 16.0347}, +{314.890, 19.4517, 15.8857}, +{319.983, 19.7208, 15.7381}, +{325.158, 19.9815, 15.5915}, +{330.418, 20.2349, 15.4466}, +{335.762, 20.4822, 15.3030}, +{341.192, 20.7237, 15.1606}, +{346.711, 20.9603, 15.0198}, +{352.319, 21.1930, 14.8803}, +{358.017, 21.4222, 14.7419}, +{363.808, 21.6486, 14.6046}, +{369.692, 21.8730, 14.4687}, +{375.672, 22.0977, 14.3345}, +{381.748, 22.3249, 14.2009}, +{387.922, 22.5591, 14.0653}, +{394.197, 22.8086, 13.9238}, +{400.573, 23.0567, 13.7416}, +{407.052, 23.2741, 13.5455}, +{413.635, 23.4736, 13.3527}, +{420.326, 23.6612, 13.1620}, +{427.124, 23.8391, 12.9740}, +{434.032, 24.0092, 12.7887}, +{441.052, 24.1730, 12.6061}, +{448.186, 24.3351, 12.4250}, +{455.435, 24.4908, 12.2407}, +{462.802, 24.6393, 12.0545}, +{470.287, 24.7788, 11.8687}, +{477.894, 24.9102, 11.6857}, +{485.623, 25.0356, 11.5059}, +{493.478, 25.1560, 11.3289}, +{501.459, 25.2719, 11.1544}, +{509.570, 25.3840, 10.9830}, +{517.812, 25.4946, 10.8134}, +{526.187, 25.6020, 10.6437}, +{534.698, 25.7057, 10.4730}, +{543.346, 25.8038, 10.3033}, +{552.134, 25.9004, 10.1366}, +{561.065, 25.9943, 9.96328}, +{570.139, 26.0778, 9.78887}, +{579.361, 26.1535, 9.61983}, +{588.732, 26.2247, 9.45455}, +{598.254, 26.2927, 9.29263}, +{607.930, 26.3579, 9.13351}, +{617.763, 26.4211, 8.97713}, +{627.755, 26.4854, 8.82280}, +{637.908, 26.5496, 8.66345}, +{648.226, 26.6088, 8.49574}, +{658.711, 26.6523, 8.32399}, +{669.365, 26.6794, 8.15581}, +{680.191, 26.6930, 8.00884}, +{691.193, 26.7124, 7.87810}, +{702.372, 26.7481, 7.75250}, +{713.733, 26.7890, 7.61430}, +{725.277, 26.8194, 7.46864}, +{737.008, 26.8425, 7.32583}, +{748.928, 26.8608, 7.18574}, +{761.042, 26.8758, 7.04823}, +{773.351, 26.8886, 6.91233}, +{785.859, 26.8985, 6.77544}, +{798.570, 26.9017, 6.63833}, +{811.486, 26.8992, 6.50390}, +{824.611, 26.8920, 6.37222}, +{837.949, 26.8802, 6.24321}, +{851.502, 26.8642, 6.11717}, +{865.274, 26.8443, 5.99398}, +{879.269, 26.8208, 5.87352}, +{893.491, 26.7936, 5.75539}, +{907.943, 26.7627, 5.63967}, +{922.628, 26.7284, 5.52634}, +{937.551, 26.6901, 5.41402}, +{952.715, 26.6474, 5.30367}, +{968.124, 26.6000, 5.19529}, +{983.783, 26.5481, 5.08921}, +{999.695, 26.4921, 4.98481}, +{1015.86, 26.4323, 4.88204}, +{1032.29, 26.3662, 4.77730}, +{1048.99, 26.2927, 4.67393}, +{1065.96, 26.2110, 4.57191}, +{1083.20, 26.1212, 4.47206}, +{1100.72, 26.0230, 4.37440}, +{1118.52, 25.9160, 4.27890}, +{1136.61, 25.7995, 4.18557}, +{1155.00, 25.6727, 4.09423}, +{1173.68, 25.5345, 4.00483}, +{1192.66, 25.3836, 3.91747}, +{1211.95, 25.2186, 3.83198}, +{1231.55, 25.0377, 3.74829}, +{1251.47, 24.8383, 3.66604}, +{1271.72, 24.6174, 3.58518}, +{1292.29, 24.3707, 3.50559}, +{1313.19, 24.0935, 3.42786}, +{1334.43, 23.7797, 3.35181}, +{1356.01, 23.4205, 3.27736}, +{1377.94, 23.0039, 3.20470}, +{1400.23, 22.5125, 3.13364}, +{1422.88, 21.9194, 3.06414}, +{1445.89, 21.1806, 2.99614}, +{1469.28, 20.2158, 2.93108}, +{1493.04, 18.8585, 2.86962}, +{1517.19, 16.6528, 2.81872}, +{1541.73, 10.8963, 2.77001}, +{1549.80, -8.00939, 2.75434}, +{1550.00, -8.00155, 16.3564}, +{1566.67, 14.3906, 16.1344}, +{1592.01, 18.5751, 15.8069}, +{1617.76, 20.7653, 15.4860}, +{1643.92, 22.2477, 15.1717}, +{1670.51, 23.3454, 14.8636}, +{1697.53, 24.1806, 14.5619}, +{1724.99, 24.7915, 14.2664}, +{1752.89, 25.1151, 13.9766}, +{1781.24, 23.4156, 13.6927}, +{1781.90, 22.0893, 13.6862}, +{1782.10, 22.0949, 15.7617}, +{1810.05, 26.4421, 15.4199}, +{1839.32, 27.4629, 15.0753}, +{1869.07, 28.2262, 14.7383}, +{1899.30, 28.8609, 14.4087}, +{1930.02, 29.4112, 14.0865}, +{1961.24, 29.8997, 13.7716}, +{1992.96, 30.3367, 13.4637}, +{2025.20, 30.7417, 13.1705}, +{2057.95, 31.1155, 12.8665}, +{2091.24, 31.4551, 12.5672}, +{2125.06, 31.7653, 12.2728}, +{2159.43, 32.0507, 11.9839}, +{2194.36, 32.3138, 11.6995}, +{2229.85, 32.5565, 11.4205}, +{2265.92, 32.7811, 11.1469}, +{2302.57, 32.9891, 10.8783}, +{2339.81, 33.1818, 10.6147}, +{2377.66, 33.3601, 10.3561}, +{2416.11, 33.5253, 10.1027}, +{2455.19, 33.6783, 9.85422}, +{2494.90, 33.8199, 9.61099}, +{2535.26, 33.9512, 9.37299}, +{2576.26, 34.0727, 9.13942}, +{2617.93, 34.1848, 8.91091}, +{2660.27, 34.2884, 8.68762}, +{2703.30, 34.3844, 8.46894}, +{2747.03, 34.4724, 8.25470}, +{2791.46, 34.5536, 8.04560}, +{2836.61, 34.6279, 7.84066}, +{2882.49, 34.6961, 7.64096}, +{2929.11, 34.7588, 7.44520}, +{2976.48, 34.8156, 7.25383}, +{3024.63, 34.8674, 7.06723}, +{3073.55, 34.9143, 6.88467}, +{3123.26, 34.9566, 6.70639}, +{3173.78, 34.9945, 6.53229}, +{3225.11, 35.0286, 6.36274}, +{3277.27, 35.0590, 6.19664}, +{3330.28, 35.0856, 6.03460}, +{3384.15, 35.1088, 5.87652}, +{3438.88, 35.1289, 5.72225}, +{3494.50, 35.1461, 5.57163}, +{3551.02, 35.1603, 5.42476}, +{3608.46, 35.1720, 5.28146}, +{3666.82, 35.1812, 5.14165}, +{3726.13, 35.1880, 5.00538}, +{3786.40, 35.1927, 4.87240}, +{3847.64, 35.1953, 4.74275}, +{3909.87, 35.1959, 4.61636}, +{3973.11, 35.1948, 4.49313}, +{4037.38, 35.1919, 4.37301}, +{4102.68, 35.1874, 4.25594}, +{4169.03, 35.1815, 4.14184}, +{4236.46, 35.1741, 4.03063}, +{4304.98, 35.1654, 3.92231}, +{4374.62, 35.1555, 3.81666}, +{4445.37, 35.1444, 3.71380}, +{4517.27, 35.1323, 3.61361}, +{4590.33, 35.1191, 3.51593}, +{4664.58, 35.1049, 3.42088}, +{4740.03, 35.0900, 3.32825}, +{4816.69, 35.0742, 3.23800}, +{4894.60, 35.0576, 3.15011}, +{4973.77, 35.0402, 3.06455}, +{5054.21, 35.0222, 2.98128}, +{5135.96, 35.0037, 2.90015}, +{5219.03, 34.9845, 2.82110}, +{5303.44, 34.9647, 2.74416}, +{5389.22, 34.9444, 2.66931}, +{5476.39, 34.9237, 2.59642}, +{5564.97, 34.9025, 2.52550}, +{5654.98, 34.8809, 2.45641}, +{5746.44, 34.8589, 2.38918}, +{5839.39, 34.8366, 2.32373}, +{5933.83, 34.8139, 2.25999}, +{6029.81, 34.7908, 2.19793}, +{6127.33, 34.7673, 2.13764}, +{6226.44, 34.7437, 2.07891}, +{6327.15, 34.7197, 2.02176}, +{6429.48, 34.6954, 1.96608}, +{6533.48, 34.6708, 1.91204}, +{6639.15, 34.6460, 1.85931}, +{6746.54, 34.6209, 1.80808}, +{6855.65, 34.5955, 1.75823}, +{6966.54, 34.5699, 1.70968}, +{7079.22, 34.5439, 1.66245}, +{7193.72, 34.5177, 1.61655}, +{7310.07, 34.4911, 1.57178}, +{7428.31, 34.4642, 1.52832}, +{7548.45, 34.4370, 1.48603}, +{7670.54, 34.4094, 1.44482}, +{7794.61, 34.3815, 1.40479}, +{7920.68, 34.3531, 1.36582}, +{8048.79, 34.3243, 1.32790}, +{8178.98, 34.2950, 1.29101}, +{8311.26, 34.2652, 1.25513}, +{8445.69, 34.2348, 1.22022}, +{8582.29, 34.2037, 1.18625}, +{8721.11, 34.1720, 1.15322}, +{8862.16, 34.1395, 1.12107}, +{9005.50, 34.1061, 1.08980}, +{9151.16, 34.0718, 1.05937}, +{9299.17, 34.0364, 1.02978}, +{9449.58, 33.9998, 1.00099}, +{9602.42, 33.9620, 0.972971}, +{9757.73, 33.9226, 0.945717}, +{9915.55, 33.8815, 0.919210}, +{10075.9, 33.8385, 0.893416}, +{10238.9, 33.7932, 0.868322}, +{10404.5, 33.7455, 0.843909}, +{10572.8, 33.6948, 0.820157}, +{10743.8, 33.6408, 0.797050}, +{10917.6, 33.5827, 0.774568}, +{11094.2, 33.5200, 0.752695}, +{11273.6, 33.4516, 0.731414}, +{11455.9, 33.3763, 0.710710}, +{11641.2, 33.2925, 0.690565}, +{11829.5, 33.1981, 0.670965}, +{12020.8, 33.0899, 0.651895}, +{12215.3, 32.9635, 0.633339}, +{12412.8, 32.8116, 0.615284}, +{12613.6, 32.6225, 0.597716}, +{12817.6, 32.3740, 0.580621}, +{13025.0, 32.0171, 0.563987}, +{13235.6, 31.4020, 0.547800}, +{13449.7, 29.0525, 0.532049}, +{13473.6, 23.2529, 0.530333}, +{13473.8, 23.2532, 3.86204}, +{13667.2, 31.3642, 3.77868}, +{13888.3, 32.2279, 3.68700}, +{14112.9, 32.7278, 3.59694}, +{14341.2, 33.0826, 3.50852}, +{14573.1, 33.3575, 3.42173}, +{14808.9, 33.5811, 3.33658}, +{15048.4, 33.7688, 3.25306}, +{15291.8, 33.9297, 3.17118}, +{15539.1, 34.0697, 3.09092}, +{15790.4, 34.1929, 3.01229}, +{16045.8, 34.3023, 2.93528}, +{16305.4, 34.4001, 2.85986}, +{16569.1, 34.4880, 2.78604}, +{16837.1, 34.5672, 2.71379}, +{17109.4, 34.6390, 2.64311}, +{17386.1, 34.7042, 2.57397}, +{17667.4, 34.7635, 2.50636}, +{17953.1, 34.8175, 2.44026}, +{18243.5, 34.8668, 2.37565}, +{18538.6, 34.9118, 2.31251}, +{18838.4, 34.9529, 2.25083}, +{19143.1, 34.9905, 2.19058}, +{19452.7, 35.0248, 2.13174}, +{19767.4, 35.0562, 2.07429}, +{20087.1, 35.0848, 2.01820}, +{20412.0, 35.1109, 1.96345}, +{20742.1, 35.1347, 1.91003}, +{21077.6, 35.1563, 1.85791}, +{21418.5, 35.1759, 1.80706}, +{21765.0, 35.1937, 1.75746}, +{22117.0, 35.2098, 1.70909}, +{22474.7, 35.2243, 1.66192}, +{22838.2, 35.2373, 1.61594}, +{23207.6, 35.2489, 1.57111}, +{23583.0, 35.2593, 1.52742}, +{23964.4, 35.2684, 1.48484}, +{24352.0, 35.2765, 1.44335}, +{24745.9, 35.2835, 1.40293}, +{25146.2, 35.2896, 1.36355}, +{25552.9, 35.2947, 1.32520}, +{25966.2, 35.2990, 1.28784}, +{26386.1, 35.3026, 1.25146}, +{26812.9, 35.3054, 1.21604}, +{27246.6, 35.3075, 1.18155}, +{27687.3, 35.3090, 1.14797}, +{28135.1, 35.3100, 1.11529}, +{28590.2, 35.3104, 1.08348}, +{29052.6, 35.3105, 1.05252}, +{29522.5, 35.3130, 1.02239}, +{30000.0, 35.2999, 0.993072}, +{0, 0, 0} +}; + +e_fp_fdp kr[] = { /* Z = 36 */ +{10.0000, -9999.00, 0.199153E-14}, +{10.1617, -9999.00, 0.202374E-14}, +{10.3261, -9999.00, 0.205647E-14}, +{10.4931, -9999.00, 0.208974E-14}, +{10.6628, -9999.00, 0.212354E-14}, +{10.8353, -9999.00, 0.215788E-14}, +{11.0106, -9999.00, 0.219278E-14}, +{11.1886, -9999.00, 0.222825E-14}, +{11.3696, -9999.00, 0.226429E-14}, +{11.5535, -9999.00, 0.230091E-14}, +{11.7404, -9999.00, 0.233813E-14}, +{11.9303, -9999.00, 0.237595E-14}, +{12.1232, -9999.00, 0.241438E-14}, +{12.3193, -9999.00, 0.245343E-14}, +{12.5186, -9999.00, 0.249311E-14}, +{12.7210, -9999.00, 0.253343E-14}, +{12.9268, -9999.00, 0.257441E-14}, +{13.1359, -9999.00, 0.261605E-14}, +{13.3483, -9999.00, 0.265836E-14}, +{13.5642, -9999.00, 0.270136E-14}, +{13.7836, -9999.00, 0.274505E-14}, +{14.0000, -9999.00, 0.278814E-14}, +{14.2000, -9999.00, 6.40385}, +{14.2331, -9999.00, 6.46967}, +{14.4633, -9999.00, 6.94182}, +{14.6973, -9999.00, 7.44844}, +{14.9350, -9999.00, 7.89396}, +{15.1765, -9999.00, 8.34952}, +{15.4220, -9999.00, 8.79845}, +{15.6714, -9999.00, 9.10398}, +{15.9249, -9999.00, 9.42012}, +{16.1825, -9999.00, 9.74725}, +{16.4442, -9999.00, 10.0254}, +{16.7102, -9999.00, 10.2012}, +{16.9805, -9999.00, 10.3801}, +{17.2551, -9999.00, 10.5621}, +{17.5342, -9999.00, 10.6206}, +{17.8178, -9999.00, 10.6327}, +{18.1060, -9999.00, 10.6448}, +{18.3989, -9999.00, 10.6624}, +{18.6964, -9999.00, 10.7073}, +{18.9988, -9999.00, 10.7525}, +{19.3061, -9999.00, 10.7979}, +{19.6184, -9999.00, 10.8398}, +{19.9357, -9999.00, 10.8691}, +{20.2582, -9999.00, 10.8984}, +{20.5858, -9999.00, 10.9277}, +{20.9188, -9999.00, 10.9496}, +{21.2571, -9999.00, 10.9467}, +{21.6009, -9999.00, 10.9439}, +{21.9503, -9999.00, 10.9410}, +{22.3053, -9999.00, 10.9382}, +{22.6661, -9999.00, 10.9049}, +{23.0327, -9999.00, 10.8149}, +{23.4053, -9999.00, 10.7257}, +{23.7838, -9999.00, 10.6372}, +{24.1685, -9999.00, 10.5420}, +{24.5594, -9999.00, 10.3024}, +{24.9566, -9999.00, 10.0683}, +{25.3603, -9999.00, 9.83943}, +{25.7705, -9999.00, 9.61581}, +{26.1873, -9999.00, 9.39726}, +{26.6109, -9999.00, 9.18368}, +{27.0413, -9999.00, 8.97496}, +{27.4786, -9999.00, 8.76542}, +{27.9231, -9999.00, 8.53924}, +{28.3747, -9999.00, 8.31891}, +{28.8337, -9999.00, 8.10425}, +{29.3000, 10.8394, 7.78196}, +{29.7739, 11.0262, 7.41784}, +{30.2555, 11.1588, 7.07074}, +{30.7449, 11.2578, 6.73990}, +{31.2421, 11.3317, 6.42453}, +{31.7475, 11.3863, 6.12392}, +{32.2609, 11.4255, 5.83737}, +{32.7827, 11.4529, 5.56424}, +{33.3130, 11.4714, 5.30389}, +{33.8518, 11.4885, 5.05571}, +{34.3993, 11.5152, 4.81209}, +{34.9557, 11.5210, 4.53378}, +{35.5211, 11.4951, 4.27156}, +{36.0956, 11.4528, 4.02451}, +{36.6794, 11.3986, 3.79174}, +{37.2727, 11.3354, 3.57244}, +{37.8755, 11.2649, 3.36583}, +{38.4882, 11.1887, 3.17116}, +{39.1107, 11.1078, 2.98775}, +{39.7432, 11.0234, 2.81495}, +{40.3861, 10.9362, 2.65214}, +{41.0393, 10.8474, 2.49875}, +{41.7031, 10.7597, 2.35423}, +{42.3776, 10.6689, 2.20946}, +{43.0630, 10.5721, 2.07338}, +{43.7595, 10.4721, 1.94569}, +{44.4673, 10.3700, 1.82585}, +{45.1865, 10.2662, 1.71340}, +{45.9174, 10.1611, 1.60787}, +{46.6600, 10.0550, 1.50884}, +{47.4147, 9.94785, 1.41592}, +{48.1816, 9.83975, 1.32871}, +{48.9609, 9.73071, 1.24688}, +{49.7528, 9.61786, 1.17008}, +{50.5576, 9.50454, 1.10368}, +{51.3753, 9.39488, 1.04268}, +{52.2062, 9.28617, 0.985056}, +{53.0506, 9.17754, 0.930615}, +{53.9087, 9.06830, 0.879182}, +{54.7806, 8.95776, 0.830593}, +{55.6667, 8.84475, 0.784687}, +{56.5670, 8.72502, 0.744512}, +{57.4820, 8.60680, 0.717395}, +{58.4117, 8.49511, 0.691267}, +{59.3564, 8.38327, 0.666091}, +{60.3165, 8.26621, 0.641831}, +{61.2921, 8.14684, 0.626536}, +{62.2834, 8.03206, 0.617524}, +{63.2908, 7.91946, 0.608641}, +{64.3145, 7.80632, 0.599885}, +{65.3547, 7.69072, 0.591540}, +{66.4118, 7.57325, 0.586506}, +{67.4859, 7.45430, 0.581515}, +{68.5775, 7.32952, 0.576566}, +{69.6867, 7.20083, 0.576809}, +{70.8138, 7.07047, 0.577702}, +{71.9591, 6.93454, 0.578596}, +{73.1230, 6.79191, 0.581373}, +{74.3057, 6.64226, 0.585022}, +{75.5076, 6.48352, 0.588694}, +{76.7289, 6.31207, 0.592390}, +{77.9699, 6.12486, 0.599113}, +{79.2310, 5.92098, 0.608538}, +{80.5125, 5.69417, 0.618111}, +{81.8147, 5.43659, 0.631125}, +{83.1380, 5.13991, 0.647678}, +{84.4827, 4.78512, 0.664665}, +{85.8491, 4.33656, 0.682097}, +{87.2377, 3.72833, 0.700901}, +{88.6487, 2.70469, 0.726307}, +{90.0825, 0.289705, 0.921521}, +{91.5395, -0.957579, 5.96658}, +{93.0201, 1.05818, 10.5187}, +{93.7000, 8.54865, 13.6057}, +{93.9000, 9.28653, 7.23264}, +{94.5246, 7.55698, 6.71549}, +{96.0535, 7.64770, 5.61185}, +{97.6071, 7.79766, 4.68955}, +{99.1858, 7.86211, 3.91886}, +{100.790, 7.45947, 2.90898}, +{102.420, 6.79340, 2.62988}, +{104.077, 6.39007, 2.37755}, +{105.760, 5.82447, 2.14943}, +{107.471, 5.21766, 2.29029}, +{109.209, 4.77435, 2.50720}, +{110.975, 4.41724, 2.74464}, +{112.770, 4.10060, 3.00458}, +{114.594, 3.81458, 3.28914}, +{116.448, 3.55724, 3.60064}, +{118.331, 3.33856, 3.94164}, +{120.245, 3.15294, 4.28982}, +{122.190, 2.98237, 4.65401}, +{124.166, 2.83666, 5.04912}, +{126.175, 2.76626, 5.47778}, +{128.215, 2.73919, 5.85185}, +{130.289, 2.69105, 6.21786}, +{132.397, 2.65291, 6.60676}, +{134.538, 2.63849, 7.01999}, +{136.714, 2.67067, 7.45906}, +{138.925, 2.78840, 7.87309}, +{141.172, 2.90982, 8.19678}, +{143.456, 2.98108, 8.53379}, +{145.776, 3.06023, 8.88464}, +{148.134, 3.15101, 9.24992}, +{150.530, 3.26068, 9.63023}, +{152.964, 3.43776, 10.0262}, +{155.439, 3.64212, 10.3457}, +{157.953, 3.80711, 10.6549}, +{160.507, 3.97342, 10.9734}, +{163.103, 4.14864, 11.3014}, +{165.742, 4.33952, 11.6392}, +{168.422, 4.59171, 11.9871}, +{171.146, 4.86869, 12.2584}, +{173.915, 5.10268, 12.5063}, +{176.727, 5.32626, 12.7593}, +{179.586, 5.54767, 13.0173}, +{182.491, 5.77214, 13.2806}, +{185.442, 6.00366, 13.5491}, +{188.442, 6.24921, 13.8231}, +{191.489, 6.51217, 14.0862}, +{194.587, 6.77744, 14.3388}, +{197.734, 7.04232, 14.5959}, +{200.932, 7.31834, 14.8577}, +{204.182, 7.61031, 15.1241}, +{207.485, 7.93279, 15.3953}, +{210.840, 8.28447, 15.6229}, +{214.251, 8.62423, 15.8259}, +{217.716, 8.95157, 16.0315}, +{221.237, 9.28463, 16.2397}, +{224.816, 9.62716, 16.4507}, +{228.452, 9.98370, 16.6644}, +{232.147, 10.3767, 16.8809}, +{235.902, 10.7988, 17.0634}, +{239.717, 11.2124, 17.2027}, +{243.595, 11.6170, 17.3431}, +{247.535, 12.0297, 17.4848}, +{251.538, 12.4590, 17.6275}, +{255.607, 12.9563, 17.7714}, +{259.741, 13.5018, 17.8289}, +{263.942, 13.9959, 17.7655}, +{268.211, 14.4236, 17.7023}, +{272.549, 14.8207, 17.6394}, +{276.957, 15.1968, 17.5766}, +{281.437, 15.5569, 17.5141}, +{285.989, 15.9042, 17.4518}, +{290.615, 16.2410, 17.3898}, +{295.315, 16.5689, 17.3279}, +{300.092, 16.8893, 17.2663}, +{304.945, 17.2032, 17.2049}, +{309.878, 17.5117, 17.1437}, +{314.890, 17.8155, 17.0827}, +{319.983, 18.1153, 17.0220}, +{325.158, 18.4120, 16.9614}, +{330.418, 18.7061, 16.9011}, +{335.762, 18.9984, 16.8410}, +{341.192, 19.2895, 16.7811}, +{346.711, 19.5802, 16.7214}, +{352.319, 19.8713, 16.6619}, +{358.017, 20.1638, 16.6027}, +{363.808, 20.4589, 16.5436}, +{369.692, 20.7582, 16.4848}, +{375.672, 21.0638, 16.4261}, +{381.748, 21.3793, 16.3677}, +{387.922, 21.7112, 16.3095}, +{394.197, 22.0815, 16.2515}, +{400.573, 22.4950, 16.1096}, +{407.052, 22.8621, 15.8945}, +{413.635, 23.1645, 15.6822}, +{420.326, 23.4456, 15.4728}, +{427.124, 23.7081, 15.2661}, +{434.032, 23.9559, 15.0623}, +{441.052, 24.1912, 14.8611}, +{448.186, 24.4158, 14.6626}, +{455.435, 24.6312, 14.4668}, +{462.802, 24.8384, 14.2736}, +{470.287, 25.0385, 14.0830}, +{477.894, 25.2324, 13.8949}, +{485.623, 25.4208, 13.7093}, +{493.478, 25.6048, 13.5263}, +{501.459, 25.7853, 13.3456}, +{509.570, 25.9639, 13.1674}, +{517.812, 26.1428, 12.9916}, +{526.187, 26.3280, 12.8180}, +{534.698, 26.5275, 12.6261}, +{543.346, 26.7112, 12.4012}, +{552.134, 26.8628, 12.1802}, +{561.065, 27.0027, 11.9632}, +{570.139, 27.1319, 11.7500}, +{579.361, 27.2521, 11.5407}, +{588.732, 27.3644, 11.3351}, +{598.254, 27.4695, 11.1331}, +{607.930, 27.5681, 10.9348}, +{617.763, 27.6606, 10.7399}, +{627.755, 27.7476, 10.5486}, +{637.908, 27.8292, 10.3606}, +{648.226, 27.9059, 10.1760}, +{658.711, 27.9778, 9.99473}, +{669.365, 28.0448, 9.81665}, +{680.191, 28.1059, 9.64174}, +{691.193, 28.1626, 9.47575}, +{702.372, 28.2198, 9.31367}, +{713.733, 28.2760, 9.15437}, +{725.277, 28.3308, 8.99778}, +{737.008, 28.3845, 8.84388}, +{748.928, 28.4379, 8.69260}, +{761.042, 28.4920, 8.54392}, +{773.351, 28.5508, 8.39778}, +{785.859, 28.6142, 8.23913}, +{798.570, 28.6680, 8.07410}, +{811.486, 28.7136, 7.91237}, +{824.611, 28.7575, 7.75389}, +{837.949, 28.8231, 7.59857}, +{851.502, 28.8857, 7.38934}, +{865.274, 28.8974, 7.18259}, +{879.269, 28.8929, 6.98164}, +{893.491, 28.8580, 6.78630}, +{907.943, 28.8088, 6.62975}, +{922.628, 28.7774, 6.48274}, +{937.551, 28.7441, 6.33898}, +{952.715, 28.7084, 6.19842}, +{968.124, 28.6686, 6.06097}, +{983.783, 28.6237, 5.92976}, +{999.695, 28.5774, 5.80528}, +{1015.86, 28.5313, 5.68331}, +{1032.29, 28.4827, 5.56282}, +{1048.99, 28.4308, 5.44350}, +{1065.96, 28.3741, 5.32525}, +{1083.20, 28.3117, 5.20963}, +{1100.72, 28.2444, 5.09652}, +{1118.52, 28.1719, 4.98588}, +{1136.61, 28.0937, 4.87750}, +{1155.00, 28.0094, 4.77150}, +{1173.68, 27.9187, 4.66785}, +{1192.66, 27.8211, 4.56656}, +{1211.95, 27.7161, 4.46740}, +{1231.55, 27.6032, 4.37029}, +{1251.47, 27.4815, 4.27450}, +{1271.72, 27.3493, 4.17976}, +{1292.29, 27.2048, 4.08583}, +{1313.19, 27.0460, 3.99420}, +{1334.43, 26.8719, 3.90460}, +{1356.01, 26.6802, 3.81693}, +{1377.94, 26.4683, 3.73116}, +{1400.23, 26.2325, 3.64734}, +{1422.88, 25.9685, 3.56549}, +{1445.89, 25.6705, 3.48534}, +{1469.28, 25.3302, 3.40650}, +{1493.04, 24.9372, 3.32874}, +{1517.19, 24.4731, 3.24928}, +{1541.73, 23.9095, 3.17129}, +{1566.67, 23.2068, 3.09524}, +{1592.01, 22.2886, 3.02097}, +{1617.76, 20.9931, 2.94847}, +{1643.92, 18.8648, 2.87773}, +{1670.51, 13.0823, 2.80869}, +{1678.30, -4.63584, 2.78898}, +{1678.50, -4.62919, 15.6136}, +{1697.53, 17.0270, 15.3883}, +{1724.99, 20.8321, 15.0732}, +{1752.89, 22.8532, 14.7646}, +{1781.24, 24.2250, 14.4623}, +{1810.05, 25.2396, 14.1664}, +{1839.32, 26.0064, 13.8762}, +{1869.07, 26.5511, 13.5920}, +{1899.30, 26.7802, 13.3139}, +{1920.90, 24.2882, 13.1213}, +{1921.10, 24.2985, 14.9155}, +{1930.02, 26.9138, 14.8244}, +{1961.24, 28.3254, 14.5131}, +{1992.96, 29.1554, 14.2083}, +{2025.20, 29.8180, 13.9160}, +{2057.95, 30.3918, 13.6174}, +{2091.24, 30.8934, 13.3218}, +{2125.06, 31.3415, 13.0295}, +{2159.43, 31.7464, 12.7411}, +{2194.36, 32.1150, 12.4559}, +{2229.85, 32.4520, 12.1748}, +{2265.92, 32.7615, 11.8976}, +{2302.57, 33.0465, 11.6247}, +{2339.81, 33.3097, 11.3558}, +{2377.66, 33.5529, 11.0912}, +{2416.11, 33.7781, 10.8307}, +{2455.19, 33.9866, 10.5747}, +{2494.90, 34.1801, 10.3230}, +{2535.26, 34.3593, 10.0756}, +{2576.26, 34.5255, 9.83282}, +{2617.93, 34.6797, 9.59460}, +{2660.27, 34.8230, 9.36072}, +{2703.30, 34.9555, 9.13092}, +{2747.03, 35.0780, 8.90593}, +{2791.46, 35.1916, 8.68546}, +{2836.61, 35.2968, 8.46952}, +{2882.49, 35.3941, 8.25728}, +{2929.11, 35.4833, 8.04995}, +{2976.48, 35.5657, 7.84690}, +{3024.63, 35.6416, 7.64801}, +{3073.55, 35.7112, 7.45348}, +{3123.26, 35.7749, 7.26281}, +{3173.78, 35.8329, 7.07654}, +{3225.11, 35.8856, 6.89435}, +{3277.27, 35.9335, 6.71681}, +{3330.28, 35.9771, 6.54248}, +{3384.15, 36.0161, 6.37239}, +{3438.88, 36.0511, 6.20619}, +{3494.50, 36.0822, 6.04386}, +{3551.02, 36.1096, 5.88526}, +{3608.46, 36.1336, 5.73038}, +{3666.82, 36.1544, 5.57916}, +{3726.13, 36.1722, 5.43160}, +{3786.40, 36.1871, 5.28752}, +{3847.64, 36.1993, 5.14690}, +{3909.87, 36.2090, 5.00974}, +{3973.11, 36.2163, 4.87588}, +{4037.38, 36.2214, 4.74538}, +{4102.68, 36.2243, 4.61805}, +{4169.03, 36.2253, 4.49384}, +{4236.46, 36.2244, 4.37277}, +{4304.98, 36.2218, 4.25480}, +{4374.62, 36.2175, 4.13972}, +{4445.37, 36.2117, 4.02756}, +{4517.27, 36.2045, 3.91828}, +{4590.33, 36.1959, 3.81176}, +{4664.58, 36.1860, 3.70796}, +{4740.03, 36.1750, 3.60688}, +{4816.69, 36.1628, 3.50840}, +{4894.60, 36.1496, 3.41247}, +{4973.77, 36.1355, 3.31899}, +{5054.21, 36.1204, 3.22800}, +{5135.96, 36.1046, 3.13937}, +{5219.03, 36.0878, 3.05306}, +{5303.44, 36.0704, 2.96911}, +{5389.22, 36.0523, 2.88729}, +{5476.39, 36.0335, 2.80768}, +{5564.97, 36.0142, 2.73020}, +{5654.98, 35.9943, 2.65474}, +{5746.44, 35.9739, 2.58136}, +{5839.39, 35.9530, 2.50992}, +{5933.83, 35.9317, 2.44042}, +{6029.81, 35.9099, 2.37272}, +{6127.33, 35.8877, 2.30688}, +{6226.44, 35.8652, 2.24288}, +{6327.15, 35.8423, 2.18063}, +{6429.48, 35.8191, 2.12003}, +{6533.48, 35.7956, 2.06099}, +{6639.15, 35.7717, 2.00370}, +{6746.54, 35.7476, 1.94791}, +{6855.65, 35.7232, 1.89369}, +{6966.54, 35.6986, 1.84086}, +{7079.22, 35.6737, 1.78961}, +{7193.72, 35.6485, 1.73966}, +{7310.07, 35.6230, 1.69116}, +{7428.31, 35.5973, 1.64394}, +{7548.45, 35.5713, 1.59812}, +{7670.54, 35.5451, 1.55357}, +{7794.61, 35.5186, 1.51016}, +{7920.68, 35.4917, 1.46798}, +{8048.79, 35.4646, 1.42699}, +{8178.98, 35.4371, 1.38714}, +{8311.26, 35.4093, 1.34841}, +{8445.69, 35.3810, 1.31076}, +{8582.29, 35.3524, 1.27415}, +{8721.11, 35.3233, 1.23858}, +{8862.16, 35.2938, 1.20400}, +{9005.50, 35.2636, 1.17038}, +{9151.16, 35.2329, 1.13772}, +{9299.17, 35.2015, 1.10596}, +{9449.58, 35.1694, 1.07511}, +{9602.42, 35.1365, 1.04512}, +{9757.73, 35.1027, 1.01597}, +{9915.55, 35.0679, 0.987623}, +{10075.9, 35.0319, 0.960095}, +{10238.9, 34.9947, 0.933343}, +{10404.5, 34.9560, 0.907347}, +{10572.8, 34.9157, 0.882083}, +{10743.8, 34.8735, 0.857534}, +{10917.6, 34.8292, 0.833678}, +{11094.2, 34.7824, 0.810496}, +{11273.6, 34.7329, 0.787970}, +{11455.9, 34.6800, 0.766083}, +{11641.2, 34.6231, 0.744814}, +{11829.5, 34.5617, 0.724147}, +{12020.8, 34.4947, 0.704066}, +{12215.3, 34.4209, 0.684553}, +{12412.8, 34.3387, 0.665594}, +{12613.6, 34.2459, 0.647172}, +{12817.6, 34.1393, 0.629272}, +{13025.0, 34.0141, 0.611880}, +{13235.6, 33.8631, 0.594980}, +{13449.7, 33.6737, 0.578561}, +{13667.2, 33.4217, 0.562606}, +{13888.3, 33.0515, 0.547104}, +{14112.9, 32.3765, 0.532041}, +{14325.5, 24.6680, 0.518379}, +{14325.7, 24.6682, 3.71186}, +{14341.2, 29.8148, 3.70575}, +{14573.1, 32.7062, 3.61611}, +{14808.9, 33.4370, 3.52804}, +{15048.4, 33.8836, 3.44154}, +{15291.8, 34.2071, 3.35662}, +{15539.1, 34.4605, 3.27328}, +{15790.4, 34.6679, 3.19153}, +{16045.8, 34.8428, 3.11136}, +{16305.4, 34.9931, 3.03277}, +{16569.1, 35.1241, 2.95576}, +{16837.1, 35.2397, 2.88030}, +{17109.4, 35.3423, 2.80641}, +{17386.1, 35.4342, 2.73407}, +{17667.4, 35.5168, 2.66326}, +{17953.1, 35.5913, 2.59397}, +{18243.5, 35.6589, 2.52618}, +{18538.6, 35.7202, 2.45989}, +{18838.4, 35.7759, 2.39507}, +{19143.1, 35.8268, 2.33171}, +{19452.7, 35.8731, 2.26978}, +{19767.4, 35.9154, 2.20927}, +{20087.1, 35.9541, 2.15016}, +{20412.0, 35.9894, 2.09242}, +{20742.1, 36.0216, 2.03604}, +{21077.6, 36.0510, 1.98100}, +{21418.5, 36.0779, 1.92727}, +{21765.0, 36.1023, 1.87484}, +{22117.0, 36.1246, 1.82367}, +{22474.7, 36.1448, 1.77375}, +{22838.2, 36.1632, 1.72506}, +{23207.6, 36.1798, 1.67757}, +{23583.0, 36.1947, 1.63126}, +{23964.4, 36.2082, 1.58611}, +{24352.0, 36.2203, 1.54209}, +{24745.9, 36.2311, 1.49919}, +{25146.2, 36.2406, 1.45737}, +{25552.9, 36.2491, 1.41663}, +{25966.2, 36.2565, 1.37693}, +{26386.1, 36.2629, 1.33825}, +{26812.9, 36.2684, 1.30058}, +{27246.6, 36.2730, 1.26388}, +{27687.3, 36.2769, 1.22815}, +{28135.1, 36.2801, 1.19335}, +{28590.2, 36.2826, 1.15948}, +{29052.6, 36.2846, 1.12649}, +{29522.5, 36.2891, 1.09439}, +{30000.0, 36.2768, 1.06314}, +{0, 0, 0} +}; + +} // namespace table_data + +}}} // namespace cctbx::eltbx::henke diff --git a/extern/cctbx/cctbx/eltbx/henke_tables_37_48.cpp b/extern/cctbx/cctbx/eltbx/henke_tables_37_48.cpp new file mode 100644 index 00000000..44cb37c8 --- /dev/null +++ b/extern/cctbx/cctbx/eltbx/henke_tables_37_48.cpp @@ -0,0 +1,6164 @@ +/* ***************************************************** + THIS IS AN AUTOMATICALLY GENERATED FILE. DO NOT EDIT. + ***************************************************** + + Generated by: + cctbx.source_generators.eltbx.generate_henke_cpp + */ + +#include + +namespace cctbx { namespace eltbx { namespace henke { + +namespace table_data { + +using anomalous::e_fp_fdp; + +e_fp_fdp rb[] = { /* Z = 37 */ +{10.0000, -9999.00, 0.696833E-01}, +{10.1617, -9999.00, 0.710428E-01}, +{10.3261, -9999.00, 0.725292E-01}, +{10.4931, -9999.00, 0.744146E-01}, +{10.6628, -9999.00, 0.763490E-01}, +{10.8353, -9999.00, 0.783337E-01}, +{11.0106, -9999.00, 0.803700E-01}, +{11.1886, -9999.00, 0.829975E-01}, +{11.3696, -9999.00, 0.859930E-01}, +{11.5535, -9999.00, 0.890967E-01}, +{11.7404, -9999.00, 0.923123E-01}, +{11.9303, -9999.00, 0.956440E-01}, +{12.1232, -9999.00, 0.992070E-01}, +{12.3193, -9999.00, 0.103755}, +{12.5186, -9999.00, 0.108511}, +{12.7210, -9999.00, 0.113485}, +{12.9268, -9999.00, 0.118687}, +{13.1359, -9999.00, 0.125355}, +{13.3483, -9999.00, 0.132968}, +{13.5642, -9999.00, 0.141044}, +{13.7836, -9999.00, 0.150192}, +{14.0066, -9999.00, 0.160776}, +{14.2331, -9999.00, 0.172105}, +{14.4633, -9999.00, 0.184233}, +{14.6973, -9999.00, 0.199124}, +{14.9350, -9999.00, 0.218760}, +{15.1765, -9999.00, 0.414294}, +{15.4220, -9999.00, 0.889737}, +{15.6714, -9999.00, 1.91082}, +{15.9249, -9999.00, 4.10371}, +{16.1825, -9999.00, 8.81322}, +{16.4442, -9999.00, 9.74157}, +{16.7102, -9999.00, 10.2630}, +{16.9805, -9999.00, 10.8124}, +{17.2551, -9999.00, 11.3911}, +{17.5342, -9999.00, 12.0009}, +{17.8178, -9999.00, 12.6432}, +{18.1060, -9999.00, 13.2106}, +{18.3989, -9999.00, 13.6342}, +{18.6964, -9999.00, 14.0713}, +{18.9988, -9999.00, 14.5225}, +{19.3061, -9999.00, 14.9881}, +{19.6184, -9999.00, 15.4687}, +{19.9357, -9999.00, 15.9304}, +{20.2582, -9999.00, 16.3239}, +{20.5858, -9999.00, 16.7272}, +{20.9188, -9999.00, 17.1404}, +{21.2571, -9999.00, 17.5637}, +{21.6009, -9999.00, 17.9976}, +{21.9503, -9999.00, 18.4422}, +{22.3053, -9999.00, 18.8977}, +{22.6661, -9999.00, 19.3645}, +{23.0327, -9999.00, 19.7441}, +{23.4053, -9999.00, 19.9536}, +{23.7838, -9999.00, 20.1653}, +{24.1685, -9999.00, 20.3793}, +{24.5594, -9999.00, 20.5955}, +{24.9566, -9999.00, 20.8140}, +{25.3603, -9999.00, 21.0349}, +{25.7705, -9999.00, 21.2581}, +{26.1873, -9999.00, 20.9385}, +{26.6109, -9999.00, 20.6113}, +{27.0413, -9999.00, 20.2892}, +{27.4786, -9999.00, 19.9721}, +{27.9231, -9999.00, 19.6179}, +{28.3747, -9999.00, 18.8853}, +{28.8337, -9999.00, 18.1801}, +{29.3000, 13.0655, 17.5013}, +{29.7739, 13.6343, 16.8478}, +{30.2555, 14.1644, 16.2187}, +{30.7449, 14.6787, 15.6131}, +{31.2421, 15.2658, 15.0301}, +{31.7475, 16.0401, 14.2168}, +{32.2609, 16.4451, 13.1815}, +{32.7827, 16.6505, 12.2216}, +{33.3130, 16.7498, 11.3316}, +{33.8518, 16.7722, 10.5064}, +{34.3993, 16.7367, 9.74125}, +{34.9557, 16.6564, 9.03186}, +{35.5211, 16.5409, 8.37413}, +{36.0956, 16.3974, 7.76430}, +{36.6794, 16.2315, 7.19888}, +{37.2727, 16.0477, 6.67464}, +{37.8755, 15.8489, 6.18858}, +{38.4882, 15.6362, 5.73789}, +{39.1107, 15.4056, 5.32174}, +{39.7432, 15.1759, 4.96640}, +{40.3861, 14.9581, 4.63479}, +{41.0393, 14.7460, 4.32532}, +{41.7031, 14.5368, 4.03651}, +{42.3776, 14.3302, 3.76699}, +{43.0630, 14.1263, 3.51546}, +{43.7595, 13.9249, 3.28074}, +{44.4673, 13.7264, 3.06168}, +{45.1865, 13.5308, 2.85725}, +{45.9174, 13.3382, 2.66646}, +{46.6600, 13.1488, 2.48842}, +{47.4147, 12.9628, 2.32227}, +{48.1816, 12.7805, 2.16721}, +{48.9609, 12.6031, 2.02250}, +{49.7528, 12.4304, 1.88159}, +{50.5576, 12.2554, 1.74799}, +{51.3753, 12.0804, 1.62386}, +{52.2062, 11.9066, 1.50856}, +{53.0506, 11.7342, 1.40144}, +{53.9087, 11.5629, 1.30193}, +{54.7806, 11.3924, 1.20948}, +{55.6667, 11.2210, 1.12360}, +{56.5670, 11.0428, 1.04381}, +{57.4820, 10.8677, 0.992020}, +{58.4117, 10.7075, 0.946484}, +{59.3564, 10.5550, 0.903038}, +{60.3165, 10.4070, 0.861585}, +{61.2921, 10.2619, 0.822035}, +{62.2834, 10.1182, 0.784302}, +{63.2908, 9.97388, 0.748301}, +{64.3145, 9.82197, 0.713951}, +{65.3547, 9.67225, 0.702303}, +{66.4118, 9.53431, 0.693770}, +{67.4859, 9.40176, 0.685340}, +{68.5775, 9.27079, 0.677013}, +{69.6867, 9.14135, 0.673057}, +{70.8138, 9.01567, 0.670594}, +{71.9591, 8.89149, 0.668139}, +{73.1230, 8.76606, 0.665693}, +{74.3057, 8.64030, 0.667955}, +{75.5076, 8.51619, 0.671485}, +{76.7289, 8.39057, 0.676306}, +{77.9699, 8.26585, 0.683734}, +{79.2310, 8.13956, 0.691245}, +{80.5125, 8.01101, 0.703644}, +{81.8147, 7.88388, 0.718507}, +{83.1380, 7.75719, 0.733684}, +{84.4827, 7.62983, 0.749181}, +{85.8491, 7.49986, 0.762427}, +{87.2377, 7.36527, 0.775589}, +{88.6487, 7.22519, 0.788978}, +{90.0825, 7.07858, 0.802598}, +{91.5395, 6.92010, 0.817667}, +{93.0201, 6.75599, 0.840922}, +{94.5246, 6.58566, 0.864837}, +{96.0535, 6.40438, 0.889432}, +{97.6071, 6.19894, 0.914728}, +{99.1858, 5.98093, 0.965974}, +{100.790, 5.75257, 1.02160}, +{102.420, 5.48986, 1.08341}, +{104.077, 5.19676, 1.19999}, +{105.760, 4.88690, 1.35034}, +{107.471, 4.51152, 1.61097}, +{109.209, 4.21037, 2.10889}, +{110.975, 4.36298, 2.61845}, +{112.770, 4.65202, 2.77437}, +{114.594, 4.75819, 2.54704}, +{116.448, 4.39079, 2.25945}, +{118.331, 3.94565, 2.46738}, +{120.245, 3.62949, 2.72927}, +{122.190, 3.36364, 2.98313}, +{124.166, 3.10166, 3.26059}, +{126.175, 2.84250, 3.58013}, +{128.215, 2.60752, 3.94302}, +{130.289, 2.40451, 4.34268}, +{132.397, 2.26196, 4.78285}, +{134.538, 2.14884, 5.17940}, +{136.714, 2.04269, 5.59880}, +{138.925, 1.98300, 6.05217}, +{141.172, 1.95945, 6.47463}, +{143.456, 1.93517, 6.89553}, +{145.776, 1.95321, 7.34379}, +{148.134, 1.97937, 7.73205}, +{150.530, 1.99933, 8.13780}, +{152.964, 2.02702, 8.56484}, +{155.439, 2.09596, 9.01429}, +{157.953, 2.18310, 9.41778}, +{160.507, 2.26421, 9.82508}, +{163.103, 2.34471, 10.2500}, +{165.742, 2.44090, 10.6933}, +{168.422, 2.56045, 11.1557}, +{171.146, 2.72589, 11.6382}, +{173.915, 2.92074, 12.0874}, +{176.727, 3.12733, 12.5423}, +{179.586, 3.38713, 13.0143}, +{182.491, 3.67567, 13.4378}, +{185.442, 3.96717, 13.8580}, +{188.442, 4.31301, 14.2914}, +{191.489, 4.68970, 14.6314}, +{194.587, 5.04039, 14.9385}, +{197.734, 5.36986, 15.2520}, +{200.932, 5.70947, 15.5657}, +{204.182, 6.04802, 15.8651}, +{207.485, 6.38746, 16.1703}, +{210.840, 6.73667, 16.4813}, +{214.251, 7.10220, 16.7983}, +{217.716, 7.49079, 17.1214}, +{221.237, 7.91300, 17.4507}, +{224.816, 8.38822, 17.7864}, +{228.452, 9.00708, 18.1285}, +{232.147, 9.63664, 18.1769}, +{235.902, 10.1463, 18.1785}, +{239.717, 10.5526, 18.1802}, +{243.595, 10.8904, 18.2109}, +{247.535, 11.2292, 18.3272}, +{251.538, 11.5939, 18.4443}, +{255.607, 11.9673, 18.5621}, +{259.741, 12.3476, 18.6807}, +{263.942, 12.7356, 18.8000}, +{268.211, 13.1336, 18.9200}, +{272.549, 13.5457, 19.0409}, +{276.957, 13.9826, 19.1625}, +{281.437, 14.4580, 19.2504}, +{285.989, 14.9247, 19.2836}, +{290.615, 15.3598, 19.3168}, +{295.315, 15.7953, 19.3501}, +{300.092, 16.2355, 19.3835}, +{304.945, 16.6871, 19.4169}, +{309.878, 17.1613, 19.4504}, +{314.890, 17.6935, 19.4839}, +{319.983, 18.2749, 19.3816}, +{325.158, 18.7838, 19.1986}, +{330.418, 19.2141, 19.0172}, +{335.762, 19.6151, 18.8376}, +{341.192, 19.9905, 18.6596}, +{346.711, 20.3441, 18.4834}, +{352.319, 20.6766, 18.3088}, +{358.017, 20.9803, 18.1358}, +{363.808, 21.2635, 18.0096}, +{369.692, 21.5671, 17.8997}, +{375.672, 21.8864, 17.7908}, +{381.748, 22.2173, 17.6823}, +{387.922, 22.5675, 17.5660}, +{394.197, 22.9378, 17.4319}, +{400.573, 23.3133, 17.2334}, +{407.052, 23.6436, 17.0118}, +{413.635, 23.9421, 16.7935}, +{420.326, 24.2245, 16.5778}, +{427.124, 24.4937, 16.3648}, +{434.032, 24.7524, 16.1544}, +{441.052, 25.0043, 15.9467}, +{448.186, 25.2513, 15.7395}, +{455.435, 25.4931, 15.5245}, +{462.802, 25.7240, 15.3058}, +{470.287, 25.9407, 15.0864}, +{477.894, 26.1470, 14.8695}, +{485.623, 26.3446, 14.6563}, +{493.478, 26.5357, 14.4462}, +{501.459, 26.7214, 14.2389}, +{509.570, 26.9028, 14.0344}, +{517.812, 27.0825, 13.8312}, +{526.187, 27.2601, 13.6255}, +{534.698, 27.4337, 13.4129}, +{543.346, 27.5954, 13.1986}, +{552.134, 27.7532, 12.9874}, +{561.065, 27.9064, 12.7670}, +{570.139, 28.0388, 12.5456}, +{579.361, 28.1613, 12.3350}, +{588.732, 28.2799, 12.1293}, +{598.254, 28.3943, 11.9280}, +{607.930, 28.5052, 11.7304}, +{617.763, 28.6138, 11.5360}, +{627.755, 28.7228, 11.3441}, +{637.908, 28.8315, 11.1464}, +{648.226, 28.9355, 10.9388}, +{658.711, 29.0213, 10.7266}, +{669.365, 29.0831, 10.5184}, +{680.191, 29.1278, 10.3368}, +{691.193, 29.1887, 10.1753}, +{702.372, 29.2612, 10.0199}, +{713.733, 29.3471, 9.84877}, +{725.277, 29.4192, 9.66818}, +{737.008, 29.4819, 9.49079}, +{748.928, 29.5398, 9.31666}, +{761.042, 29.5945, 9.14561}, +{773.351, 29.6473, 8.97615}, +{785.859, 29.6989, 8.80413}, +{798.570, 29.7419, 8.63078}, +{811.486, 29.7782, 8.46096}, +{824.611, 29.8098, 8.29442}, +{837.949, 29.8375, 8.13111}, +{851.502, 29.8618, 7.96977}, +{865.274, 29.8826, 7.81015}, +{879.269, 29.8983, 7.65243}, +{893.491, 29.9096, 7.49794}, +{907.943, 29.9175, 7.34652}, +{922.628, 29.9228, 7.19811}, +{937.551, 29.9249, 7.04944}, +{952.715, 29.9220, 6.90302}, +{968.124, 29.9142, 6.75894}, +{983.783, 29.9019, 6.61784}, +{999.695, 29.8852, 6.48002}, +{1015.86, 29.8647, 6.34543}, +{1032.29, 29.8414, 6.21593}, +{1048.99, 29.8173, 6.08696}, +{1065.96, 29.7881, 5.95837}, +{1083.20, 29.7539, 5.83239}, +{1100.72, 29.7154, 5.70906}, +{1118.52, 29.6725, 5.58831}, +{1136.61, 29.6254, 5.47018}, +{1155.00, 29.5738, 5.35450}, +{1173.68, 29.5177, 5.24123}, +{1192.66, 29.4570, 5.13040}, +{1211.95, 29.3915, 5.02195}, +{1231.55, 29.3217, 4.91584}, +{1251.47, 29.2469, 4.81004}, +{1271.72, 29.1664, 4.70463}, +{1292.29, 29.0768, 4.59924}, +{1313.19, 28.9781, 4.49628}, +{1334.43, 28.8706, 4.39564}, +{1356.01, 28.7535, 4.29725}, +{1377.94, 28.6262, 4.20103}, +{1400.23, 28.4875, 4.10688}, +{1422.88, 28.3361, 4.01473}, +{1445.89, 28.1710, 3.92486}, +{1469.28, 27.9912, 3.83577}, +{1493.04, 27.7927, 3.74682}, +{1517.19, 27.5710, 3.65225}, +{1541.73, 27.3160, 3.55898}, +{1566.67, 27.0247, 3.46804}, +{1592.01, 26.6900, 3.37944}, +{1617.76, 26.3007, 3.29312}, +{1643.92, 25.8405, 3.20902}, +{1670.51, 25.2835, 3.12708}, +{1697.53, 24.5866, 3.04723}, +{1724.99, 23.6678, 2.96942}, +{1752.89, 22.3359, 2.88900}, +{1781.24, 19.9255, 2.80978}, +{1804.30, 4.47116, 2.74784}, +{1804.50, 4.47535, 11.5981}, +{1810.05, 15.7986, 11.5078}, +{1839.32, 20.1284, 11.0470}, +{1863.80, 14.3771, 10.6813}, +{1864.00, 14.3918, 14.8890}, +{1869.07, 19.8218, 14.8370}, +{1899.30, 23.4852, 14.5339}, +{1930.02, 25.1074, 14.2370}, +{1961.24, 26.2065, 13.9462}, +{1992.96, 26.9961, 13.6613}, +{2025.20, 27.5089, 13.3855}, +{2057.95, 27.2104, 13.1122}, +{2065.00, 25.3302, 13.0547}, +{2065.20, 25.3402, 14.7486}, +{2091.24, 28.6552, 14.5089}, +{2125.06, 29.6640, 14.2077}, +{2159.43, 30.4102, 13.9092}, +{2194.36, 31.0317, 13.6132}, +{2229.85, 31.5718, 13.3199}, +{2265.92, 32.0512, 13.0301}, +{2302.57, 32.4820, 12.7435}, +{2339.81, 32.8724, 12.4606}, +{2377.66, 33.2287, 12.1813}, +{2416.11, 33.5552, 11.9056}, +{2455.19, 33.8550, 11.6340}, +{2494.90, 34.1313, 11.3665}, +{2535.26, 34.3867, 11.1030}, +{2576.26, 34.6226, 10.8435}, +{2617.93, 34.8413, 10.5885}, +{2660.27, 35.0438, 10.3374}, +{2703.30, 35.2314, 10.0908}, +{2747.03, 35.4053, 9.84833}, +{2791.46, 35.5667, 9.61038}, +{2836.61, 35.7162, 9.37689}, +{2882.49, 35.8548, 9.14757}, +{2929.11, 35.9832, 8.92274}, +{2976.48, 36.1022, 8.70231}, +{3024.63, 36.2121, 8.48616}, +{3073.55, 36.3139, 8.27444}, +{3123.26, 36.4074, 8.06675}, +{3173.78, 36.4943, 7.86361}, +{3225.11, 36.5738, 7.66477}, +{3277.27, 36.6470, 7.46990}, +{3330.28, 36.7138, 7.27916}, +{3384.15, 36.7752, 7.09288}, +{3438.88, 36.8312, 6.91044}, +{3494.50, 36.8820, 6.73207}, +{3551.02, 36.9280, 6.55772}, +{3608.46, 36.9696, 6.38730}, +{3666.82, 37.0069, 6.22078}, +{3726.13, 37.0402, 6.05806}, +{3786.40, 37.0697, 5.89908}, +{3847.64, 37.0957, 5.74385}, +{3909.87, 37.1184, 5.59227}, +{3973.11, 37.1379, 5.44433}, +{4037.38, 37.1545, 5.29984}, +{4102.68, 37.1683, 5.15888}, +{4169.03, 37.1795, 5.02129}, +{4236.46, 37.1882, 4.88707}, +{4304.98, 37.1945, 4.75612}, +{4374.62, 37.1988, 4.62845}, +{4445.37, 37.2009, 4.50384}, +{4517.27, 37.2011, 4.38241}, +{4590.33, 37.1995, 4.26401}, +{4664.58, 37.1962, 4.14860}, +{4740.03, 37.1914, 4.03608}, +{4816.69, 37.1850, 3.92644}, +{4894.60, 37.1772, 3.81954}, +{4973.77, 37.1682, 3.71546}, +{5054.21, 37.1579, 3.61397}, +{5135.96, 37.1464, 3.51519}, +{5219.03, 37.1338, 3.41889}, +{5303.44, 37.1203, 3.32518}, +{5389.22, 37.1058, 3.23389}, +{5476.39, 37.0905, 3.14492}, +{5564.97, 37.0743, 3.05839}, +{5654.98, 37.0573, 2.97409}, +{5746.44, 37.0396, 2.89202}, +{5839.39, 37.0213, 2.81217}, +{5933.83, 37.0024, 2.73438}, +{6029.81, 36.9828, 2.65871}, +{6127.33, 36.9627, 2.58503}, +{6226.44, 36.9421, 2.51341}, +{6327.15, 36.9211, 2.44369}, +{6429.48, 36.8995, 2.37584}, +{6533.48, 36.8777, 2.30986}, +{6639.15, 36.8553, 2.24561}, +{6746.54, 36.8327, 2.18316}, +{6855.65, 36.8096, 2.12231}, +{6966.54, 36.7862, 2.06320}, +{7079.22, 36.7626, 2.00574}, +{7193.72, 36.7387, 1.94981}, +{7310.07, 36.7144, 1.89537}, +{7428.31, 36.6898, 1.84250}, +{7548.45, 36.6649, 1.79110}, +{7670.54, 36.6398, 1.74111}, +{7794.61, 36.6145, 1.69249}, +{7920.68, 36.5888, 1.64523}, +{8048.79, 36.5629, 1.59926}, +{8178.98, 36.5367, 1.55456}, +{8311.26, 36.5102, 1.51113}, +{8445.69, 36.4834, 1.46891}, +{8582.29, 36.4563, 1.42785}, +{8721.11, 36.4288, 1.38795}, +{8862.16, 36.4009, 1.34918}, +{9005.50, 36.3727, 1.31147}, +{9151.16, 36.3440, 1.27485}, +{9299.17, 36.3149, 1.23924}, +{9449.58, 36.2852, 1.20463}, +{9602.42, 36.2550, 1.17100}, +{9757.73, 36.2242, 1.13833}, +{9915.55, 36.1927, 1.10655}, +{10075.9, 36.1604, 1.07569}, +{10238.9, 36.1273, 1.04570}, +{10404.5, 36.0933, 1.01656}, +{10572.8, 36.0583, 0.988242}, +{10743.8, 36.0221, 0.960729}, +{10917.6, 35.9846, 0.933996}, +{11094.2, 35.9455, 0.908023}, +{11273.6, 35.9049, 0.882786}, +{11455.9, 35.8622, 0.858268}, +{11641.2, 35.8174, 0.834447}, +{11829.5, 35.7701, 0.811303}, +{12020.8, 35.7198, 0.788819}, +{12215.3, 35.6660, 0.766974}, +{12412.8, 35.6082, 0.745753}, +{12613.6, 35.5455, 0.725136}, +{12817.6, 35.4770, 0.705108}, +{13025.0, 35.4013, 0.685651}, +{13235.6, 35.3167, 0.666749}, +{13449.7, 35.2206, 0.648388}, +{13667.2, 35.1097, 0.630550}, +{13888.3, 34.9786, 0.613223}, +{14112.9, 34.8187, 0.596390}, +{14341.2, 34.6151, 0.580039}, +{14573.1, 34.3376, 0.564155}, +{14808.9, 33.9105, 0.548725}, +{15048.4, 33.0208, 0.533737}, +{15199.6, 25.7196, 0.524605}, +{15199.8, 25.7199, 3.68556}, +{15291.8, 32.6205, 3.65214}, +{15539.1, 33.9981, 3.56470}, +{15790.4, 34.6009, 3.47872}, +{16045.8, 34.9964, 3.39422}, +{16305.4, 35.2915, 3.31121}, +{16569.1, 35.5265, 3.22968}, +{16837.1, 35.7210, 3.14966}, +{17109.4, 35.8862, 3.07115}, +{17386.1, 36.0289, 2.99414}, +{17667.4, 36.1539, 2.91862}, +{17953.1, 36.2644, 2.84461}, +{18243.5, 36.3629, 2.77209}, +{18538.6, 36.4512, 2.70105}, +{18838.4, 36.5308, 2.63149}, +{19143.1, 36.6027, 2.56340}, +{19452.7, 36.6679, 2.49675}, +{19767.4, 36.7272, 2.43155}, +{20087.1, 36.7813, 2.36777}, +{20412.0, 36.8305, 2.30540}, +{20742.1, 36.8755, 2.24442}, +{21077.6, 36.9165, 2.18482}, +{21418.5, 36.9541, 2.12658}, +{21765.0, 36.9884, 2.06967}, +{22117.0, 37.0197, 2.01409}, +{22474.7, 37.0483, 1.95981}, +{22838.2, 37.0744, 1.90681}, +{23207.6, 37.0982, 1.85507}, +{23583.0, 37.1199, 1.80457}, +{23964.4, 37.1396, 1.75529}, +{24352.0, 37.1574, 1.70721}, +{24745.9, 37.1736, 1.66030}, +{25146.2, 37.1881, 1.61456}, +{25552.9, 37.2012, 1.56994}, +{25966.2, 37.2130, 1.52644}, +{26386.1, 37.2235, 1.48403}, +{26812.9, 37.2327, 1.44270}, +{27246.6, 37.2409, 1.40241}, +{27687.3, 37.2481, 1.36314}, +{28135.1, 37.2543, 1.32489}, +{28590.2, 37.2597, 1.28762}, +{29052.6, 37.2645, 1.25131}, +{29522.5, 37.2718, 1.21595}, +{30000.0, 37.2605, 1.18152}, +{0, 0, 0} +}; + +e_fp_fdp sr[] = { /* Z = 38 */ +{10.0000, -9999.00, 0.171262}, +{10.1617, -9999.00, 0.174896}, +{10.3261, -9999.00, 0.178608}, +{10.4931, -9999.00, 0.182398}, +{10.6628, -9999.00, 0.186269}, +{10.8353, -9999.00, 0.190614}, +{11.0106, -9999.00, 0.195136}, +{11.1886, -9999.00, 0.199766}, +{11.3696, -9999.00, 0.204505}, +{11.5535, -9999.00, 0.209357}, +{11.7404, -9999.00, 0.214324}, +{11.9303, -9999.00, 0.219410}, +{12.1232, -9999.00, 0.225385}, +{12.3193, -9999.00, 0.231522}, +{12.5186, -9999.00, 0.237827}, +{12.7210, -9999.00, 0.244303}, +{12.9268, -9999.00, 0.250955}, +{13.1359, -9999.00, 0.258014}, +{13.3483, -9999.00, 0.266925}, +{13.5642, -9999.00, 0.276144}, +{13.7836, -9999.00, 0.285681}, +{14.0066, -9999.00, 0.295547}, +{14.2331, -9999.00, 0.305755}, +{14.4633, -9999.00, 0.316410}, +{14.6973, -9999.00, 0.329067}, +{14.9350, -9999.00, 0.342230}, +{15.1765, -9999.00, 0.355920}, +{15.4220, -9999.00, 0.370157}, +{15.6714, -9999.00, 0.384964}, +{15.9249, -9999.00, 0.400363}, +{16.1825, -9999.00, 0.416922}, +{16.4442, -9999.00, 0.434177}, +{16.7102, -9999.00, 0.452147}, +{16.9805, -9999.00, 0.470860}, +{17.2551, -9999.00, 0.490347}, +{17.5342, -9999.00, 0.510641}, +{17.8178, -9999.00, 0.532703}, +{18.1060, -9999.00, 0.560547}, +{18.3989, -9999.00, 0.589847}, +{18.6964, -9999.00, 0.620679}, +{18.9988, -9999.00, 0.653122}, +{19.3061, -9999.00, 0.687261}, +{19.6184, -9999.00, 0.723863}, +{19.9357, -9999.00, 0.769653}, +{20.2582, -9999.00, 0.818341}, +{20.5858, -9999.00, 0.870107}, +{20.9188, -9999.00, 0.925148}, +{21.2571, -9999.00, 0.983672}, +{21.6009, -9999.00, 1.06431}, +{21.9503, -9999.00, 1.16788}, +{22.3053, -9999.00, 1.28153}, +{22.6661, -9999.00, 2.58184}, +{23.0327, -9999.00, 5.67161}, +{23.4053, -9999.00, 12.3368}, +{23.7838, -9999.00, 13.4118}, +{24.1685, -9999.00, 14.5585}, +{24.5594, -9999.00, 15.7782}, +{24.9566, -9999.00, 16.8964}, +{25.3603, -9999.00, 17.7614}, +{25.7705, -9999.00, 18.6706}, +{26.1873, -9999.00, 19.2298}, +{26.6109, -9999.00, 19.7747}, +{27.0413, -9999.00, 20.3350}, +{27.4786, -9999.00, 20.4560}, +{27.9231, -9999.00, 20.3882}, +{28.3747, -9999.00, 20.3207}, +{28.8337, -9999.00, 20.0875}, +{29.3000, 5.58141, 19.7809}, +{29.7739, 6.60730, 19.4790}, +{30.2555, 7.63084, 19.1817}, +{30.7449, 8.77090, 18.7445}, +{31.2421, 9.69125, 18.0643}, +{31.7475, 10.4429, 17.4087}, +{32.2609, 11.0918, 16.7769}, +{32.7827, 11.6698, 16.1681}, +{33.3130, 12.1950, 15.5813}, +{33.8518, 12.6843, 15.0159}, +{34.3993, 13.1613, 14.4709}, +{34.9557, 13.6862, 13.9292}, +{35.5211, 14.1362, 13.1751}, +{36.0956, 14.4427, 12.4618}, +{36.6794, 14.6643, 11.7872}, +{37.2727, 14.8303, 11.1491}, +{37.8755, 14.9522, 10.5455}, +{38.4882, 15.0386, 9.97465}, +{39.1107, 15.0958, 9.43467}, +{39.7432, 15.1291, 8.92392}, +{40.3861, 15.1431, 8.44081}, +{41.0393, 15.1421, 7.98386}, +{41.7031, 15.1304, 7.55165}, +{42.3776, 15.1160, 7.14284}, +{43.0630, 15.1154, 6.75616}, +{43.7595, 15.1207, 6.31630}, +{44.4673, 15.0583, 5.87774}, +{45.1865, 14.9620, 5.46965}, +{45.9174, 14.8447, 5.08988}, +{46.6600, 14.7127, 4.73648}, +{47.4147, 14.5698, 4.40762}, +{48.1816, 14.4189, 4.10159}, +{48.9609, 14.2619, 3.81682}, +{49.7528, 14.1006, 3.55181}, +{50.5576, 13.9359, 3.30520}, +{51.3753, 13.7683, 3.07572}, +{52.2062, 13.5982, 2.86507}, +{53.0506, 13.4305, 2.67044}, +{53.9087, 13.2643, 2.48903}, +{54.7806, 13.0991, 2.31994}, +{55.6667, 12.9350, 2.16233}, +{56.5670, 12.7720, 2.01544}, +{57.4820, 12.6102, 1.87852}, +{58.4117, 12.4493, 1.75091}, +{59.3564, 12.2889, 1.63196}, +{60.3165, 12.1294, 1.52330}, +{61.2921, 11.9724, 1.42235}, +{62.2834, 11.8166, 1.32810}, +{63.2908, 11.6612, 1.24010}, +{64.3145, 11.5054, 1.15792}, +{65.3547, 11.3472, 1.08119}, +{66.4118, 11.1805, 1.00955}, +{67.4859, 11.0136, 0.969212}, +{68.5775, 10.8617, 0.934670}, +{69.6867, 10.7174, 0.901357}, +{70.8138, 10.5746, 0.869234}, +{71.9591, 10.4313, 0.842044}, +{73.1230, 10.2820, 0.823873}, +{74.3057, 10.1443, 0.817443}, +{75.5076, 10.0094, 0.811064}, +{76.7289, 9.87887, 0.816739}, +{77.9699, 9.75628, 0.823115}, +{79.2310, 9.63849, 0.829541}, +{80.5125, 9.52258, 0.836017}, +{81.8147, 9.40891, 0.845842}, +{83.1380, 9.29799, 0.855911}, +{84.4827, 9.18864, 0.866099}, +{85.8491, 9.07960, 0.876409}, +{87.2377, 8.96870, 0.887895}, +{88.6487, 8.85941, 0.903027}, +{90.0825, 8.75147, 0.918415}, +{91.5395, 8.64363, 0.934067}, +{93.0201, 8.53538, 0.949985}, +{94.5246, 8.42636, 0.966175}, +{96.0535, 8.31675, 0.982639}, +{97.6071, 8.20536, 0.997154}, +{99.1858, 8.09019, 1.01132}, +{100.790, 7.97126, 1.02569}, +{102.420, 7.84816, 1.04026}, +{104.077, 7.72030, 1.05505}, +{105.760, 7.58691, 1.07004}, +{107.471, 7.44686, 1.08524}, +{109.209, 7.29903, 1.10190}, +{110.975, 7.14368, 1.11954}, +{112.770, 6.97897, 1.13746}, +{114.594, 6.80222, 1.15567}, +{116.448, 6.60827, 1.17417}, +{118.331, 6.39577, 1.20264}, +{120.245, 6.16448, 1.23546}, +{122.190, 5.91059, 1.28442}, +{124.166, 5.62348, 1.33915}, +{126.175, 5.29974, 1.44541}, +{128.215, 4.90059, 1.57652}, +{130.289, 4.60439, 1.99485}, +{132.397, 4.56325, 2.21466}, +{134.538, 4.37806, 2.28553}, +{136.714, 4.07743, 2.41905}, +{138.925, 3.71998, 2.57557}, +{141.172, 3.34108, 2.86818}, +{143.456, 2.97861, 3.20328}, +{145.776, 2.61650, 3.62092}, +{148.134, 2.32405, 4.12550}, +{150.530, 2.12973, 4.62736}, +{152.964, 1.93804, 5.13125}, +{155.439, 1.77018, 5.68999}, +{157.953, 1.69456, 6.30959}, +{160.507, 1.72149, 6.83708}, +{163.103, 1.72234, 7.33910}, +{165.742, 1.72733, 7.87796}, +{168.422, 1.82247, 8.41780}, +{171.146, 1.89822, 8.89448}, +{173.915, 1.97473, 9.39816}, +{176.727, 2.08111, 9.93035}, +{179.586, 2.27211, 10.4927}, +{182.491, 2.49029, 10.9233}, +{185.442, 2.68376, 11.3608}, +{188.442, 2.87596, 11.8157}, +{191.489, 3.11275, 12.2889}, +{194.587, 3.36572, 12.6906}, +{197.734, 3.60571, 13.0968}, +{200.932, 3.85244, 13.5161}, +{204.182, 4.11125, 13.9288}, +{207.485, 4.38289, 14.3528}, +{210.840, 4.68302, 14.7898}, +{214.251, 5.07149, 15.2400}, +{217.716, 5.46285, 15.5540}, +{221.237, 5.81390, 15.8709}, +{224.816, 6.15796, 16.1942}, +{228.452, 6.50922, 16.5241}, +{232.147, 6.89036, 16.8511}, +{235.902, 7.26412, 17.1427}, +{239.717, 7.63325, 17.4393}, +{243.595, 8.00630, 17.7410}, +{247.535, 8.38948, 18.0480}, +{251.538, 8.78673, 18.3602}, +{255.607, 9.20100, 18.6789}, +{259.741, 9.64337, 19.0088}, +{263.942, 10.1235, 19.3444}, +{268.211, 10.6582, 19.6860}, +{272.549, 11.3146, 20.0229}, +{276.957, 11.9672, 20.1598}, +{281.437, 12.5906, 20.2977}, +{285.989, 13.2334, 20.4364}, +{290.615, 14.0056, 20.4847}, +{295.315, 14.6405, 20.3331}, +{300.092, 15.1737, 20.1826}, +{304.945, 15.6327, 20.0332}, +{309.878, 16.0272, 19.9267}, +{314.890, 16.4314, 19.8652}, +{319.983, 16.8373, 19.8038}, +{325.158, 17.2385, 19.7428}, +{330.418, 17.6346, 19.6821}, +{335.762, 18.0262, 19.6215}, +{341.192, 18.4138, 19.5610}, +{346.711, 18.7988, 19.5008}, +{352.319, 19.1826, 19.4408}, +{358.017, 19.5664, 19.3808}, +{363.808, 19.9521, 19.3209}, +{369.692, 20.3424, 19.2612}, +{375.672, 20.7408, 19.2016}, +{381.748, 21.1555, 19.1424}, +{387.922, 21.6053, 19.0674}, +{394.197, 22.0816, 18.9573}, +{400.573, 22.5518, 18.7584}, +{407.052, 22.9583, 18.5266}, +{413.635, 23.3271, 18.2977}, +{420.326, 23.6718, 18.0717}, +{427.124, 23.9986, 17.8485}, +{434.032, 24.3106, 17.6276}, +{441.052, 24.6107, 17.4097}, +{448.186, 24.9071, 17.1928}, +{455.435, 25.1924, 16.9694}, +{462.802, 25.4653, 16.7419}, +{470.287, 25.7235, 16.5139}, +{477.894, 25.9699, 16.2899}, +{485.623, 26.2072, 16.0682}, +{493.478, 26.4361, 15.8493}, +{501.459, 26.6580, 15.6334}, +{509.570, 26.8746, 15.4206}, +{517.812, 27.0894, 15.2094}, +{526.187, 27.3017, 14.9961}, +{534.698, 27.5082, 14.7755}, +{543.346, 27.7025, 14.5532}, +{552.134, 27.8907, 14.3345}, +{561.065, 28.0731, 14.1104}, +{570.139, 28.2444, 13.8856}, +{579.361, 28.4049, 13.6640}, +{588.732, 28.5581, 13.4465}, +{598.254, 28.7055, 13.2328}, +{607.930, 28.8485, 13.0226}, +{617.763, 28.9883, 12.8156}, +{627.755, 29.1294, 12.6110}, +{637.908, 29.2702, 12.3991}, +{648.226, 29.4042, 12.1753}, +{658.711, 29.5167, 11.9455}, +{669.365, 29.6073, 11.7201}, +{680.191, 29.6800, 11.5229}, +{691.193, 29.7612, 11.3473}, +{702.372, 29.8662, 11.1775}, +{713.733, 29.9787, 10.9875}, +{725.277, 30.0751, 10.7852}, +{737.008, 30.1603, 10.5865}, +{748.928, 30.2386, 10.3916}, +{761.042, 30.3123, 10.2002}, +{773.351, 30.3828, 10.0109}, +{785.859, 30.4496, 9.82093}, +{798.570, 30.5085, 9.63106}, +{811.486, 30.5610, 9.44480}, +{824.611, 30.6083, 9.26218}, +{837.949, 30.6515, 9.08311}, +{851.502, 30.6907, 8.90671}, +{865.274, 30.7260, 8.73301}, +{879.269, 30.7571, 8.56208}, +{893.491, 30.7843, 8.39438}, +{907.943, 30.8085, 8.22998}, +{922.628, 30.8312, 8.06880}, +{937.551, 30.8504, 7.90588}, +{952.715, 30.8648, 7.74494}, +{968.124, 30.8736, 7.58616}, +{983.783, 30.8779, 7.43076}, +{999.695, 30.8781, 7.27860}, +{1015.86, 30.8742, 7.12964}, +{1032.29, 30.8688, 6.98536}, +{1048.99, 30.8616, 6.84129}, +{1065.96, 30.8490, 6.69726}, +{1083.20, 30.8313, 6.55634}, +{1100.72, 30.8094, 6.41842}, +{1118.52, 30.7835, 6.28342}, +{1136.61, 30.7536, 6.15110}, +{1155.00, 30.7197, 6.02166}, +{1173.68, 30.6822, 5.89509}, +{1192.66, 30.6408, 5.77091}, +{1211.95, 30.5954, 5.64946}, +{1231.55, 30.5470, 5.53074}, +{1251.47, 30.4951, 5.41229}, +{1271.72, 30.4385, 5.29437}, +{1292.29, 30.3746, 5.17661}, +{1313.19, 30.3037, 5.06127}, +{1334.43, 30.2258, 4.94853}, +{1356.01, 30.1410, 4.83838}, +{1377.94, 30.0489, 4.73070}, +{1400.23, 29.9491, 4.62544}, +{1422.88, 29.8410, 4.52258}, +{1445.89, 29.7237, 4.42190}, +{1469.28, 29.5963, 4.32351}, +{1493.04, 29.4578, 4.22743}, +{1517.19, 29.3069, 4.13383}, +{1541.73, 29.1421, 4.04241}, +{1566.67, 28.9615, 3.95307}, +{1592.01, 28.7625, 3.86580}, +{1617.76, 28.5422, 3.78045}, +{1643.92, 28.2964, 3.69695}, +{1670.51, 28.0198, 3.61520}, +{1697.53, 27.7056, 3.53527}, +{1724.99, 27.3422, 3.45713}, +{1752.89, 26.9184, 3.38438}, +{1781.24, 26.4154, 3.31443}, +{1810.05, 25.8000, 3.24684}, +{1839.32, 25.0138, 3.18064}, +{1869.07, 23.9363, 3.11578}, +{1899.30, 22.2438, 3.05223}, +{1930.02, 18.0503, 2.98998}, +{1939.50, 5.28010, 2.97123}, +{1939.70, 5.28403, 11.7640}, +{1961.24, 20.0566, 11.4624}, +{1992.96, 21.0943, 11.0379}, +{2006.70, 15.2358, 10.8609}, +{2006.90, 15.2501, 15.1320}, +{2025.20, 22.8854, 14.9479}, +{2057.95, 25.2033, 14.6279}, +{2091.24, 26.5585, 14.3148}, +{2125.06, 27.4987, 14.0082}, +{2159.43, 28.1344, 13.7083}, +{2194.36, 28.3227, 13.4144}, +{2216.20, 25.5952, 13.2361}, +{2216.40, 25.6051, 15.2077}, +{2229.85, 28.7670, 15.0779}, +{2265.92, 30.1929, 14.7390}, +{2302.57, 31.0805, 14.4054}, +{2339.81, 31.7865, 14.0767}, +{2377.66, 32.3848, 13.7529}, +{2416.11, 32.9074, 13.4348}, +{2455.19, 33.3715, 13.1219}, +{2494.90, 33.7884, 12.8145}, +{2535.26, 34.1654, 12.5121}, +{2576.26, 34.5082, 12.2152}, +{2617.93, 34.8211, 11.9238}, +{2660.27, 35.1081, 11.6383}, +{2703.30, 35.3718, 11.3575}, +{2747.03, 35.6143, 11.0821}, +{2791.46, 35.8373, 10.8123}, +{2836.61, 36.0434, 10.5483}, +{2882.49, 36.2339, 10.2890}, +{2929.11, 36.4097, 10.0350}, +{2976.48, 36.5718, 9.78634}, +{3024.63, 36.7218, 9.54315}, +{3073.55, 36.8604, 9.30473}, +{3123.26, 36.9884, 9.07165}, +{3173.78, 37.1064, 8.84328}, +{3225.11, 37.2152, 8.62019}, +{3277.27, 37.3154, 8.40194}, +{3330.28, 37.4079, 8.18871}, +{3384.15, 37.4929, 7.98001}, +{3438.88, 37.5709, 7.77603}, +{3494.50, 37.6422, 7.57647}, +{3551.02, 37.7072, 7.38193}, +{3608.46, 37.7668, 7.19179}, +{3666.82, 37.8210, 7.00602}, +{3726.13, 37.8701, 6.82458}, +{3786.40, 37.9145, 6.64742}, +{3847.64, 37.9544, 6.47440}, +{3909.87, 37.9901, 6.30553}, +{3973.11, 38.0218, 6.14074}, +{4037.38, 38.0499, 5.97991}, +{4102.68, 38.0746, 5.82298}, +{4169.03, 38.0959, 5.66985}, +{4236.46, 38.1142, 5.52048}, +{4304.98, 38.1297, 5.37480}, +{4374.62, 38.1424, 5.23270}, +{4445.37, 38.1527, 5.09411}, +{4517.27, 38.1605, 4.95892}, +{4590.33, 38.1660, 4.82720}, +{4664.58, 38.1696, 4.69872}, +{4740.03, 38.1711, 4.57351}, +{4816.69, 38.1707, 4.45143}, +{4894.60, 38.1687, 4.33245}, +{4973.77, 38.1650, 4.21654}, +{5054.21, 38.1598, 4.10354}, +{5135.96, 38.1532, 3.99345}, +{5219.03, 38.1452, 3.88617}, +{5303.44, 38.1360, 3.78168}, +{5389.22, 38.1256, 3.67982}, +{5476.39, 38.1141, 3.58062}, +{5564.97, 38.1017, 3.48401}, +{5654.98, 38.0882, 3.38985}, +{5746.44, 38.0738, 3.29825}, +{5839.39, 38.0586, 3.20894}, +{5933.83, 38.0426, 3.12199}, +{6029.81, 38.0259, 3.03733}, +{6127.33, 38.0085, 2.95494}, +{6226.44, 37.9905, 2.87467}, +{6327.15, 37.9719, 2.79654}, +{6429.48, 37.9527, 2.72044}, +{6533.48, 37.9330, 2.64635}, +{6639.15, 37.9129, 2.57425}, +{6746.54, 37.8923, 2.50402}, +{6855.65, 37.8712, 2.43567}, +{6966.54, 37.8497, 2.36917}, +{7079.22, 37.8279, 2.30441}, +{7193.72, 37.8056, 2.24132}, +{7310.07, 37.7831, 2.18004}, +{7428.31, 37.7602, 2.12035}, +{7548.45, 37.7370, 2.06216}, +{7670.54, 37.7135, 2.00563}, +{7794.61, 37.6897, 1.95054}, +{7920.68, 37.6655, 1.89697}, +{8048.79, 37.6411, 1.84490}, +{8178.98, 37.6165, 1.79419}, +{8311.26, 37.5916, 1.74478}, +{8445.69, 37.5663, 1.69672}, +{8582.29, 37.5407, 1.64997}, +{8721.11, 37.5148, 1.60447}, +{8862.16, 37.4886, 1.56020}, +{9005.50, 37.4621, 1.51713}, +{9151.16, 37.4352, 1.47520}, +{9299.17, 37.4079, 1.43441}, +{9449.58, 37.3803, 1.39472}, +{9602.42, 37.3522, 1.35611}, +{9757.73, 37.3236, 1.31853}, +{9915.55, 37.2945, 1.28195}, +{10075.9, 37.2648, 1.24638}, +{10238.9, 37.2345, 1.21176}, +{10404.5, 37.2036, 1.17808}, +{10572.8, 37.1719, 1.14530}, +{10743.8, 37.1394, 1.11341}, +{10917.6, 37.1059, 1.08238}, +{11094.2, 37.0715, 1.05219}, +{11273.6, 37.0359, 1.02281}, +{11455.9, 36.9990, 0.994222}, +{11641.2, 36.9607, 0.966406}, +{11829.5, 36.9208, 0.939339}, +{12020.8, 36.8791, 0.913002}, +{12215.3, 36.8352, 0.887374}, +{12412.8, 36.7890, 0.862436}, +{12613.6, 36.7399, 0.838169}, +{12817.6, 36.6877, 0.814555}, +{13025.0, 36.6316, 0.791575}, +{13235.6, 36.5711, 0.769214}, +{13449.7, 36.5053, 0.747453}, +{13667.2, 36.4329, 0.726275}, +{13888.3, 36.3526, 0.705667}, +{14112.9, 36.2622, 0.685610}, +{14341.2, 36.1589, 0.666091}, +{14573.1, 36.0385, 0.647094}, +{14808.9, 35.8946, 0.628606}, +{15048.4, 35.7164, 0.610611}, +{15291.8, 35.4841, 0.593098}, +{15539.1, 35.1551, 0.576052}, +{15790.4, 34.6058, 0.559459}, +{16045.8, 32.9628, 0.543310}, +{16104.5, 26.4571, 0.539702}, +{16104.7, 26.4573, 3.75733}, +{16305.4, 34.3200, 3.68752}, +{16569.1, 35.2344, 3.59899}, +{16837.1, 35.7413, 3.51194}, +{17109.4, 36.0956, 3.42639}, +{17386.1, 36.3681, 3.34234}, +{17667.4, 36.5889, 3.25981}, +{17953.1, 36.7737, 3.17880}, +{18243.5, 36.9318, 3.09932}, +{18538.6, 37.0692, 3.02136}, +{18838.4, 37.1900, 2.94492}, +{19143.1, 37.2972, 2.87000}, +{19452.7, 37.3930, 2.79660}, +{19767.4, 37.4790, 2.72469}, +{20087.1, 37.5566, 2.65429}, +{20412.0, 37.6268, 2.58537}, +{20742.1, 37.6906, 2.51793}, +{21077.6, 37.7486, 2.45194}, +{21418.5, 37.8014, 2.38740}, +{21765.0, 37.8496, 2.32429}, +{22117.0, 37.8936, 2.26259}, +{22474.7, 37.9338, 2.20229}, +{22838.2, 37.9705, 2.14336}, +{23207.6, 38.0040, 2.08580}, +{23583.0, 38.0346, 2.02957}, +{23964.4, 38.0625, 1.97466}, +{24352.0, 38.0880, 1.92105}, +{24745.9, 38.1112, 1.86873}, +{25146.2, 38.1323, 1.81766}, +{25552.9, 38.1514, 1.76782}, +{25966.2, 38.1687, 1.71920}, +{26386.1, 38.1843, 1.67178}, +{26812.9, 38.1984, 1.62553}, +{27246.6, 38.2110, 1.58043}, +{27687.3, 38.2223, 1.53645}, +{28135.1, 38.2324, 1.49359}, +{28590.2, 38.2413, 1.45181}, +{29052.6, 38.2494, 1.41109}, +{29522.5, 38.2602, 1.37142}, +{30000.0, 38.2499, 1.33276}, +{0, 0, 0} +}; + +e_fp_fdp y[] = { /* Z = 39 */ +{10.0000, -9999.00, 1.91773}, +{10.1617, -9999.00, 1.94593}, +{10.3261, -9999.00, 1.97456}, +{10.4931, -9999.00, 2.00360}, +{10.6628, -9999.00, 2.03307}, +{10.8353, -9999.00, 2.06298}, +{11.0106, -9999.00, 2.08995}, +{11.1886, -9999.00, 2.09147}, +{11.3696, -9999.00, 2.09299}, +{11.5535, -9999.00, 2.09452}, +{11.7404, -9999.00, 2.09604}, +{11.9303, -9999.00, 2.09757}, +{12.1232, -9999.00, 2.09910}, +{12.3193, -9999.00, 2.07380}, +{12.5186, -9999.00, 2.04269}, +{12.7210, -9999.00, 2.01204}, +{12.9268, -9999.00, 1.98186}, +{13.1359, -9999.00, 1.95212}, +{13.3483, -9999.00, 1.92283}, +{13.5642, -9999.00, 1.89326}, +{13.7836, -9999.00, 1.82864}, +{14.0066, -9999.00, 1.76622}, +{14.2331, -9999.00, 1.70594}, +{14.4633, -9999.00, 1.64771}, +{14.6973, -9999.00, 1.58943}, +{14.9350, -9999.00, 1.53225}, +{15.1765, -9999.00, 1.47713}, +{15.4220, -9999.00, 1.42399}, +{15.6714, -9999.00, 1.37276}, +{15.9249, -9999.00, 1.32265}, +{16.1825, -9999.00, 1.27374}, +{16.4442, -9999.00, 1.22665}, +{16.7102, -9999.00, 1.18129}, +{16.9805, -9999.00, 1.13761}, +{17.2551, -9999.00, 1.10152}, +{17.5342, -9999.00, 1.07044}, +{17.8178, -9999.00, 1.04024}, +{18.1060, -9999.00, 1.01089}, +{18.3989, -9999.00, 0.982368}, +{18.6964, -9999.00, 0.954653}, +{18.9988, -9999.00, 0.942543}, +{19.3061, -9999.00, 0.937272}, +{19.6184, -9999.00, 0.932031}, +{19.9357, -9999.00, 0.926820}, +{20.2582, -9999.00, 0.921637}, +{20.5858, -9999.00, 0.922103}, +{20.9188, -9999.00, 0.936428}, +{21.2571, -9999.00, 0.950975}, +{21.6009, -9999.00, 0.965748}, +{21.9503, -9999.00, 0.987730}, +{22.3053, -9999.00, 1.02598}, +{22.6661, -9999.00, 1.06571}, +{23.0327, -9999.00, 1.10698}, +{23.4053, -9999.00, 1.15127}, +{23.7838, -9999.00, 1.23259}, +{24.1685, -9999.00, 1.31966}, +{24.5594, -9999.00, 1.41288}, +{24.9566, -9999.00, 1.51268}, +{25.3603, -9999.00, 1.65754}, +{25.7705, -9999.00, 1.93279}, +{26.1873, -9999.00, 2.25377}, +{26.6109, -9999.00, 2.62804}, +{27.0413, -9999.00, 3.30060}, +{27.4786, -9999.00, 4.83125}, +{27.9231, -9999.00, 7.07175}, +{28.3747, -9999.00, 10.3513}, +{28.8337, -9999.00, 14.3124}, +{29.3000, -5.81131, 15.2941}, +{29.7739, -4.33537, 16.3432}, +{30.2555, -2.91511, 17.4642}, +{30.7449, -1.09221, 18.2054}, +{31.2421, 0.362823, 18.5804}, +{31.7475, 1.73328, 18.9631}, +{32.2609, 3.19011, 19.3538}, +{32.7827, 4.75193, 19.3689}, +{33.3130, 6.09217, 19.2585}, +{33.8518, 7.42152, 19.1487}, +{34.3993, 8.94012, 18.9752}, +{34.9557, 10.2630, 18.1654}, +{35.5211, 11.2402, 17.3902}, +{36.0956, 12.0398, 16.6480}, +{36.6794, 12.7167, 15.9376}, +{37.2727, 13.3002, 15.2574}, +{37.8755, 13.8095, 14.6063}, +{38.4882, 14.2590, 13.9830}, +{39.1107, 14.6605, 13.3863}, +{39.7432, 15.0245, 12.8150}, +{40.3861, 15.3620, 12.2681}, +{41.0393, 15.6867, 11.7446}, +{41.7031, 16.0259, 11.2434}, +{42.3776, 16.4604, 10.7039}, +{43.0630, 16.7656, 9.92317}, +{43.7595, 16.9142, 9.19944}, +{44.4673, 16.9731, 8.52848}, +{45.1865, 16.9764, 7.90646}, +{45.9174, 16.9383, 7.32981}, +{46.6600, 16.8684, 6.79521}, +{47.4147, 16.7738, 6.29961}, +{48.1816, 16.6598, 5.84014}, +{48.9609, 16.5309, 5.41421}, +{49.7528, 16.3904, 5.01931}, +{50.5576, 16.2413, 4.65324}, +{51.3753, 16.0863, 4.31385}, +{52.2062, 15.9287, 3.99923}, +{53.0506, 15.7749, 3.70474}, +{53.9087, 15.6115, 3.41263}, +{54.7806, 15.4366, 3.14356}, +{55.6667, 15.2555, 2.89569}, +{56.5670, 15.0712, 2.66738}, +{57.4820, 14.8850, 2.45706}, +{58.4117, 14.6976, 2.26333}, +{59.3564, 14.5090, 2.08488}, +{60.3165, 14.3187, 1.92049}, +{61.2921, 14.1240, 1.76906}, +{62.2834, 13.9138, 1.64162}, +{63.2908, 13.7254, 1.55336}, +{64.3145, 13.5542, 1.46983}, +{65.3547, 13.3930, 1.39080}, +{66.4118, 13.2381, 1.31602}, +{67.4859, 13.0874, 1.24525}, +{68.5775, 12.9395, 1.17830}, +{69.6867, 12.7928, 1.11494}, +{70.8138, 12.6433, 1.05499}, +{71.9591, 12.4902, 1.01148}, +{73.1230, 12.3483, 0.976329}, +{74.3057, 12.2124, 0.942397}, +{75.5076, 12.0764, 0.909647}, +{76.7289, 11.9309, 0.881537}, +{77.9699, 11.7946, 0.877539}, +{79.2310, 11.6706, 0.873560}, +{80.5125, 11.5522, 0.869598}, +{81.8147, 11.4370, 0.865655}, +{83.1380, 11.3231, 0.861730}, +{84.4827, 11.2069, 0.857822}, +{85.8491, 11.0864, 0.864246}, +{87.2377, 10.9755, 0.878229}, +{88.6487, 10.8698, 0.892439}, +{90.0825, 10.7671, 0.906879}, +{91.5395, 10.6664, 0.921552}, +{93.0201, 10.5667, 0.936463}, +{94.5246, 10.4668, 0.951615}, +{96.0535, 10.3651, 0.970106}, +{97.6071, 10.2665, 0.991478}, +{99.1858, 10.1698, 1.01332}, +{100.790, 10.0739, 1.03565}, +{102.420, 9.97899, 1.05846}, +{104.077, 9.88635, 1.08108}, +{105.760, 9.79160, 1.09817}, +{107.471, 9.69320, 1.11553}, +{109.209, 9.59148, 1.13316}, +{110.975, 9.48646, 1.15107}, +{112.770, 9.37724, 1.16950}, +{114.594, 9.26462, 1.18957}, +{116.448, 9.14829, 1.20998}, +{118.331, 9.02732, 1.23074}, +{120.245, 8.90084, 1.25186}, +{122.190, 8.76750, 1.27334}, +{124.166, 8.62502, 1.29756}, +{126.175, 8.47683, 1.32478}, +{128.215, 8.32065, 1.35258}, +{130.289, 8.15178, 1.38153}, +{132.397, 7.97311, 1.41935}, +{134.538, 7.78327, 1.45820}, +{136.714, 7.57191, 1.49812}, +{138.925, 7.34255, 1.56207}, +{141.172, 7.10432, 1.63525}, +{143.456, 6.83081, 1.72469}, +{145.776, 6.55359, 1.86657}, +{148.134, 6.32371, 2.05420}, +{150.530, 6.11114, 2.19636}, +{152.964, 5.87024, 2.29515}, +{155.439, 5.54845, 2.38907}, +{157.953, 5.16028, 2.55826}, +{160.507, 4.75829, 2.80212}, +{163.103, 4.34515, 3.08702}, +{165.742, 3.86740, 3.47201}, +{168.422, 3.45308, 3.98833}, +{171.146, 3.13702, 4.57353}, +{173.915, 2.85995, 5.16459}, +{176.727, 2.62273, 5.83202}, +{179.586, 2.50523, 6.58572}, +{182.491, 2.46748, 7.24273}, +{185.442, 2.45511, 7.94585}, +{188.442, 2.53544, 8.71724}, +{191.489, 2.82368, 9.41805}, +{194.587, 3.07377, 9.97403}, +{197.734, 3.31658, 10.5119}, +{200.932, 3.59031, 11.0702}, +{204.182, 4.00603, 11.5651}, +{207.485, 4.32951, 11.9037}, +{210.840, 4.59975, 12.2521}, +{214.251, 4.85185, 12.6108}, +{217.716, 5.10083, 12.9799}, +{221.237, 5.35835, 13.3599}, +{224.816, 5.64865, 13.7484}, +{228.452, 5.94021, 14.0861}, +{232.147, 6.22556, 14.4322}, +{235.902, 6.51712, 14.7867}, +{239.717, 6.83829, 15.1499}, +{243.595, 7.19041, 15.4625}, +{247.535, 7.51985, 15.7510}, +{251.538, 7.83364, 16.0449}, +{255.607, 8.14976, 16.3443}, +{259.741, 8.48081, 16.6485}, +{263.942, 8.81499, 16.9372}, +{268.211, 9.14971, 17.2309}, +{272.549, 9.49260, 17.5297}, +{276.957, 9.84803, 17.8337}, +{281.437, 10.2212, 18.1429}, +{285.989, 10.6383, 18.4547}, +{290.615, 11.0614, 18.7182}, +{295.315, 11.4812, 18.9854}, +{300.092, 11.9151, 19.2565}, +{304.945, 12.3785, 19.5314}, +{309.878, 12.9082, 19.7745}, +{314.890, 13.4052, 19.9436}, +{319.983, 13.8835, 20.1140}, +{325.158, 14.3605, 20.2859}, +{330.418, 14.8441, 20.4593}, +{335.762, 15.3409, 20.6342}, +{341.192, 15.8581, 20.8106}, +{346.711, 16.4535, 20.9667}, +{352.319, 17.0262, 21.0384}, +{358.017, 17.5702, 21.1104}, +{363.808, 18.1182, 21.1827}, +{369.692, 18.6803, 21.2551}, +{375.672, 19.2673, 21.3279}, +{381.748, 19.9808, 21.3658}, +{387.922, 20.6426, 21.2475}, +{394.197, 21.2373, 21.1299}, +{400.573, 21.8245, 21.0130}, +{407.052, 22.4716, 20.8967}, +{413.635, 23.1403, 20.6341}, +{420.326, 23.6932, 20.2882}, +{427.124, 24.1712, 19.9481}, +{434.032, 24.6012, 19.6137}, +{441.052, 24.9932, 19.2849}, +{448.186, 25.3528, 18.9617}, +{455.435, 25.6829, 18.6438}, +{462.802, 25.9690, 18.3313}, +{470.287, 26.2407, 18.0647}, +{477.894, 26.5150, 17.8055}, +{485.623, 26.7830, 17.5500}, +{493.478, 27.0431, 17.2982}, +{501.459, 27.2950, 17.0500}, +{509.570, 27.5391, 16.8053}, +{517.812, 27.7760, 16.5642}, +{526.187, 28.0067, 16.3265}, +{534.698, 28.2350, 16.0923}, +{543.346, 28.4544, 15.8501}, +{552.134, 28.6635, 15.6116}, +{561.065, 28.8639, 15.3766}, +{570.139, 29.0573, 15.1453}, +{579.361, 29.2445, 14.9174}, +{588.732, 29.4262, 14.6929}, +{598.254, 29.6032, 14.4718}, +{607.930, 29.7762, 14.2540}, +{617.763, 29.9462, 14.0395}, +{627.755, 30.1143, 13.8282}, +{637.908, 30.2823, 13.6202}, +{648.226, 30.4512, 13.4152}, +{658.711, 30.6555, 13.2036}, +{669.365, 30.8356, 12.9426}, +{680.191, 30.9810, 12.6867}, +{691.193, 31.1121, 12.4359}, +{702.372, 31.2316, 12.1900}, +{713.733, 31.3413, 11.9490}, +{725.277, 31.4425, 11.7128}, +{737.008, 31.5361, 11.4812}, +{748.928, 31.6228, 11.2542}, +{761.042, 31.7032, 11.0317}, +{773.351, 31.7778, 10.8136}, +{785.859, 31.8470, 10.6000}, +{798.570, 31.9115, 10.3907}, +{811.486, 31.9714, 10.1856}, +{824.611, 32.0273, 9.98451}, +{837.949, 32.0795, 9.78739}, +{851.502, 32.1282, 9.59417}, +{865.274, 32.1740, 9.40476}, +{879.269, 32.2176, 9.21909}, +{893.491, 32.2594, 9.03709}, +{907.943, 32.3080, 8.85868}, +{922.628, 32.3539, 8.66626}, +{937.551, 32.3856, 8.47165}, +{952.715, 32.4079, 8.28141}, +{968.124, 32.4233, 8.09544}, +{983.783, 32.4328, 7.91365}, +{999.695, 32.4369, 7.73593}, +{1015.86, 32.4360, 7.56222}, +{1032.29, 32.4302, 7.39240}, +{1048.99, 32.4193, 7.22179}, +{1065.96, 32.4014, 7.06587}, +{1083.20, 32.3815, 6.91330}, +{1100.72, 32.3608, 6.76403}, +{1118.52, 32.3375, 6.61799}, +{1136.61, 32.3113, 6.47510}, +{1155.00, 32.2822, 6.33529}, +{1173.68, 32.2499, 6.19850}, +{1192.66, 32.2146, 6.06467}, +{1211.95, 32.1759, 5.93372}, +{1231.55, 32.1340, 5.80561}, +{1251.47, 32.0885, 5.68025}, +{1271.72, 32.0395, 5.55761}, +{1292.29, 31.9867, 5.43761}, +{1313.19, 31.9300, 5.32021}, +{1334.43, 31.8692, 5.20534}, +{1356.01, 31.8041, 5.09295}, +{1377.94, 31.7342, 4.98299}, +{1400.23, 31.6594, 4.87539}, +{1422.88, 31.5792, 4.77013}, +{1445.89, 31.4931, 4.66713}, +{1469.28, 31.4004, 4.56636}, +{1493.04, 31.2998, 4.46777}, +{1517.19, 31.1896, 4.37444}, +{1541.73, 31.0740, 4.28732}, +{1566.67, 30.9531, 4.20193}, +{1592.01, 30.8238, 4.11824}, +{1617.76, 30.6848, 4.03622}, +{1643.92, 30.5345, 3.95583}, +{1670.51, 30.3711, 3.87704}, +{1697.53, 30.1924, 3.79982}, +{1724.99, 29.9958, 3.72414}, +{1752.89, 29.7781, 3.64997}, +{1781.24, 29.5350, 3.57727}, +{1810.05, 29.2608, 3.50602}, +{1839.32, 28.9523, 3.43619}, +{1869.07, 28.5942, 3.35901}, +{1899.30, 28.1623, 3.27801}, +{1930.02, 27.6327, 3.19896}, +{1961.24, 26.9634, 3.12181}, +{1992.96, 26.0698, 3.04653}, +{2025.20, 24.7492, 2.97306}, +{2057.95, 22.2099, 2.90137}, +{2079.90, 7.98032, 2.85492}, +{2080.10, 7.98382, 11.1239}, +{2091.24, 20.3061, 10.9941}, +{2125.06, 23.2493, 10.6130}, +{2155.40, 18.1013, 10.2874}, +{2155.60, 18.1127, 14.0289}, +{2159.43, 22.3519, 14.0069}, +{2194.36, 25.9700, 13.8098}, +{2229.85, 27.4629, 13.6156}, +{2265.92, 28.5215, 13.4240}, +{2302.57, 29.3144, 13.1476}, +{2339.81, 29.7635, 12.8233}, +{2372.40, 27.7086, 12.5501}, +{2372.60, 27.7169, 14.1143}, +{2377.66, 29.5078, 14.0784}, +{2416.11, 31.0850, 13.8104}, +{2455.19, 31.9055, 13.5475}, +{2494.90, 32.5559, 13.2896}, +{2535.26, 33.1126, 13.0367}, +{2576.26, 33.6054, 12.7885}, +{2617.93, 34.0506, 12.5451}, +{2660.27, 34.4590, 12.3063}, +{2703.30, 34.8386, 12.0720}, +{2747.03, 35.1952, 11.8422}, +{2791.46, 35.5539, 11.6168}, +{2836.61, 35.9049, 11.3588}, +{2882.49, 36.2085, 11.0670}, +{2929.11, 36.4707, 10.7827}, +{2976.48, 36.7046, 10.5058}, +{3024.63, 36.9155, 10.2359}, +{3073.55, 37.1066, 9.97297}, +{3123.26, 37.2803, 9.71678}, +{3173.78, 37.4384, 9.46718}, +{3225.11, 37.5824, 9.22400}, +{3277.27, 37.7130, 8.98707}, +{3330.28, 37.8300, 8.75619}, +{3384.15, 37.9362, 8.53690}, +{3438.88, 38.0358, 8.32518}, +{3494.50, 38.1294, 8.11869}, +{3551.02, 38.2163, 7.91736}, +{3608.46, 38.2969, 7.72099}, +{3666.82, 38.3718, 7.52950}, +{3726.13, 38.4416, 7.34276}, +{3786.40, 38.5081, 7.16064}, +{3847.64, 38.5712, 6.97781}, +{3909.87, 38.6261, 6.79509}, +{3973.11, 38.6717, 6.61716}, +{4037.38, 38.7106, 6.44388}, +{4102.68, 38.7425, 6.27517}, +{4169.03, 38.7635, 6.11086}, +{4236.46, 38.7817, 5.96692}, +{4304.98, 38.8043, 5.82638}, +{4374.62, 38.8269, 5.68915}, +{4445.37, 38.8487, 5.55515}, +{4517.27, 38.8695, 5.42429}, +{4590.33, 38.8892, 5.29653}, +{4664.58, 38.9080, 5.17178}, +{4740.03, 38.9261, 5.04996}, +{4816.69, 38.9442, 4.93102}, +{4894.60, 38.9643, 4.81486}, +{4973.77, 38.9854, 4.69328}, +{5054.21, 39.0006, 4.57003}, +{5135.96, 39.0096, 4.45001}, +{5219.03, 39.0157, 4.33313}, +{5303.44, 39.0192, 4.21934}, +{5389.22, 39.0205, 4.10853}, +{5476.39, 39.0199, 4.00062}, +{5564.97, 39.0175, 3.89556}, +{5654.98, 39.0136, 3.79325}, +{5746.44, 39.0082, 3.69363}, +{5839.39, 39.0016, 3.59663}, +{5933.83, 38.9938, 3.50217}, +{6029.81, 38.9849, 3.41020}, +{6127.33, 38.9751, 3.32064}, +{6226.44, 38.9643, 3.23343}, +{6327.15, 38.9528, 3.14852}, +{6429.48, 38.9405, 3.06583}, +{6533.48, 38.9277, 2.98531}, +{6639.15, 38.9143, 2.90651}, +{6746.54, 38.9000, 2.82978}, +{6855.65, 38.8851, 2.75509}, +{6966.54, 38.8697, 2.68236}, +{7079.22, 38.8539, 2.61155}, +{7193.72, 38.8376, 2.54261}, +{7310.07, 38.8210, 2.47549}, +{7428.31, 38.8041, 2.41015}, +{7548.45, 38.7871, 2.34653}, +{7670.54, 38.7699, 2.28459}, +{7794.61, 38.7529, 2.22428}, +{7920.68, 38.7361, 2.16557}, +{8048.79, 38.7215, 2.10841}, +{8178.98, 38.7081, 2.04884}, +{8311.26, 38.6912, 1.98689}, +{8445.69, 38.6714, 1.92681}, +{8582.29, 38.6499, 1.86854}, +{8721.11, 38.6271, 1.81204}, +{8862.16, 38.6031, 1.75725}, +{9005.50, 38.5783, 1.70412}, +{9151.16, 38.5525, 1.65258}, +{9299.17, 38.5258, 1.60262}, +{9449.58, 38.4983, 1.55415}, +{9602.42, 38.4699, 1.50716}, +{9757.73, 38.4398, 1.46159}, +{9915.55, 38.4085, 1.41895}, +{10075.9, 38.3778, 1.37929}, +{10238.9, 38.3476, 1.34073}, +{10404.5, 38.3173, 1.30324}, +{10572.8, 38.2867, 1.26678}, +{10743.8, 38.2558, 1.23133}, +{10917.6, 38.2243, 1.19687}, +{11094.2, 38.1923, 1.16336}, +{11273.6, 38.1596, 1.13079}, +{11455.9, 38.1260, 1.09912}, +{11641.2, 38.0916, 1.06833}, +{11829.5, 38.0562, 1.03839}, +{12020.8, 38.0196, 1.00929}, +{12215.3, 37.9818, 0.981004}, +{12412.8, 37.9424, 0.953504}, +{12613.6, 37.9014, 0.926771}, +{12817.6, 37.8585, 0.900784}, +{13025.0, 37.8134, 0.875521}, +{13235.6, 37.7657, 0.850965}, +{13449.7, 37.7151, 0.827094}, +{13667.2, 37.6611, 0.803890}, +{13888.3, 37.6031, 0.781334}, +{14112.9, 37.5402, 0.759408}, +{14341.2, 37.4716, 0.738096}, +{14573.1, 37.3959, 0.717378}, +{14808.9, 37.3113, 0.697241}, +{15048.4, 37.2156, 0.677666}, +{15291.8, 37.1053, 0.658639}, +{15539.1, 36.9754, 0.640144}, +{15790.4, 36.8176, 0.622165}, +{16045.8, 36.6180, 0.604690}, +{16305.4, 36.3486, 0.587703}, +{16569.1, 35.9421, 0.571190}, +{16837.1, 35.1423, 0.555139}, +{17038.3, 27.4822, 0.543547}, +{17038.5, 27.4824, 3.73384}, +{17109.4, 34.1839, 3.71062}, +{17386.1, 35.8664, 3.62228}, +{17667.4, 36.5150, 3.53536}, +{17953.1, 36.9304, 3.44989}, +{18243.5, 37.2372, 3.36588}, +{18538.6, 37.4801, 3.28334}, +{18838.4, 37.6803, 3.20228}, +{19143.1, 37.8499, 3.12271}, +{19452.7, 37.9963, 3.04464}, +{19767.4, 38.1243, 2.96805}, +{20087.1, 38.2374, 2.89296}, +{20412.0, 38.3381, 2.81936}, +{20742.1, 38.4284, 2.74724}, +{21077.6, 38.5096, 2.67659}, +{21418.5, 38.5831, 2.60741}, +{21765.0, 38.6497, 2.53969}, +{22117.0, 38.7102, 2.47341}, +{22474.7, 38.7653, 2.40857}, +{22838.2, 38.8155, 2.34514}, +{23207.6, 38.8614, 2.28312}, +{23583.0, 38.9032, 2.22248}, +{23964.4, 38.9415, 2.16321}, +{24352.0, 38.9765, 2.10530}, +{24745.9, 39.0084, 2.04872}, +{25146.2, 39.0375, 1.99345}, +{25552.9, 39.0641, 1.93948}, +{25966.2, 39.0883, 1.88679}, +{26386.1, 39.1104, 1.83536}, +{26812.9, 39.1304, 1.78516}, +{27246.6, 39.1486, 1.73617}, +{27687.3, 39.1650, 1.68839}, +{28135.1, 39.1798, 1.64177}, +{28590.2, 39.1931, 1.59631}, +{29052.6, 39.2050, 1.55197}, +{29522.5, 39.2156, 1.50875}, +{30000.0, 39.2250, 1.46662}, +{0, 0, 0} +}; + +e_fp_fdp zr[] = { /* Z = 40 */ +{10.0000, -9999.00, 4.11366}, +{10.1617, -9999.00, 4.27349}, +{10.3261, -9999.00, 4.43952}, +{10.4931, -9999.00, 4.61201}, +{10.6628, -9999.00, 4.74395}, +{10.8353, -9999.00, 4.82880}, +{11.0106, -9999.00, 4.91516}, +{11.1886, -9999.00, 4.99989}, +{11.3696, -9999.00, 5.02257}, +{11.5535, -9999.00, 5.04535}, +{11.7404, -9999.00, 5.06822}, +{11.9303, -9999.00, 5.09121}, +{12.1232, -9999.00, 5.11430}, +{12.3193, -9999.00, 5.10752}, +{12.5186, -9999.00, 5.09966}, +{12.7210, -9999.00, 5.09182}, +{12.9268, -9999.00, 5.08399}, +{13.1359, -9999.00, 5.07618}, +{13.3483, -9999.00, 5.06837}, +{13.5642, -9999.00, 5.06058}, +{13.7836, -9999.00, 5.01779}, +{14.0066, -9999.00, 4.97265}, +{14.2331, -9999.00, 4.92792}, +{14.4633, -9999.00, 4.88360}, +{14.6973, -9999.00, 4.83968}, +{14.9350, -9999.00, 4.79615}, +{15.1765, -9999.00, 4.74155}, +{15.4220, -9999.00, 4.67537}, +{15.6714, -9999.00, 4.61010}, +{15.9249, -9999.00, 4.54575}, +{16.1825, -9999.00, 4.48229}, +{16.4442, -9999.00, 4.41972}, +{16.7102, -9999.00, 4.35801}, +{16.9805, -9999.00, 4.27943}, +{17.2551, -9999.00, 4.20227}, +{17.5342, -9999.00, 4.12650}, +{17.8178, -9999.00, 4.05210}, +{18.1060, -9999.00, 3.97904}, +{18.3989, -9999.00, 3.90729}, +{18.6964, -9999.00, 3.85160}, +{18.9988, -9999.00, 3.79727}, +{19.3061, -9999.00, 3.74371}, +{19.6184, -9999.00, 3.69090}, +{19.9357, -9999.00, 3.63884}, +{20.2582, -9999.00, 3.58751}, +{20.5858, -9999.00, 3.53691}, +{20.9188, -9999.00, 3.48702}, +{21.2571, -9999.00, 3.45137}, +{21.6009, -9999.00, 3.43602}, +{21.9503, -9999.00, 3.42073}, +{22.3053, -9999.00, 3.40551}, +{22.6661, -9999.00, 3.39036}, +{23.0327, -9999.00, 3.39101}, +{23.4053, -9999.00, 3.39979}, +{23.7838, -9999.00, 3.40859}, +{24.1685, -9999.00, 3.41742}, +{24.5594, -9999.00, 3.44217}, +{24.9566, -9999.00, 3.50412}, +{25.3603, -9999.00, 3.56718}, +{25.7705, -9999.00, 3.63944}, +{26.1873, -9999.00, 3.81808}, +{26.6109, -9999.00, 4.00548}, +{27.0413, -9999.00, 4.20207}, +{27.4786, -9999.00, 4.43607}, +{27.9231, -9999.00, 4.69840}, +{28.3747, -9999.00, 4.97623}, +{28.8337, -9999.00, 5.27049}, +{29.3000, 1.76014, 5.58215}, +{29.7739, 1.61517, 5.91225}, +{30.2555, 1.47939, 6.30096}, +{30.7449, 1.37491, 6.72713}, +{31.2421, 1.29869, 7.18213}, +{31.7475, 1.24888, 7.66790}, +{32.2609, 1.22997, 8.18654}, +{32.7827, 1.24389, 8.74033}, +{33.3130, 1.29976, 9.33285}, +{33.8518, 1.40403, 9.96557}, +{34.3993, 1.56987, 10.6412}, +{34.9557, 1.81082, 11.3626}, +{35.5211, 2.14354, 12.1329}, +{36.0956, 2.74928, 12.9554}, +{36.6794, 3.41151, 13.4923}, +{37.2727, 4.03161, 14.0425}, +{37.8755, 4.70672, 14.6152}, +{38.4882, 5.54489, 15.2112}, +{39.1107, 6.56575, 15.6674}, +{39.7432, 7.55569, 15.9184}, +{40.3861, 8.54689, 16.1735}, +{41.0393, 9.76853, 16.4327}, +{41.7031, 11.2119, 16.3602}, +{42.3776, 12.4356, 15.8715}, +{43.0630, 13.6131, 15.3974}, +{43.7595, 14.6432, 14.5006}, +{44.4673, 15.3768, 13.5473}, +{45.1865, 15.8686, 12.6566}, +{45.9174, 16.2319, 11.8245}, +{46.6600, 16.4974, 11.0471}, +{47.4147, 16.6860, 10.3208}, +{48.1816, 16.8137, 9.64227}, +{48.9609, 16.8912, 9.00834}, +{49.7528, 16.9281, 8.41608}, +{50.5576, 16.9310, 7.86277}, +{51.3753, 16.9060, 7.34583}, +{52.2062, 16.8577, 6.86288}, +{53.0506, 16.7902, 6.41168}, +{53.9087, 16.7068, 5.99014}, +{54.7806, 16.6108, 5.59632}, +{55.6667, 16.5065, 5.22799}, +{56.5670, 16.3909, 4.87718}, +{57.4820, 16.2643, 4.54990}, +{58.4117, 16.1301, 4.24460}, +{59.3564, 15.9899, 3.95978}, +{60.3165, 15.8452, 3.69406}, +{61.2921, 15.6968, 3.44618}, +{62.2834, 15.5457, 3.21493}, +{63.2908, 15.3923, 2.99920}, +{64.3145, 15.2372, 2.79795}, +{65.3547, 15.0806, 2.61020}, +{66.4118, 14.9227, 2.43505}, +{67.4859, 14.7633, 2.27165}, +{68.5775, 14.6020, 2.11922}, +{69.6867, 14.4387, 1.97701}, +{70.8138, 14.2604, 1.84435}, +{71.9591, 14.0775, 1.74393}, +{73.1230, 13.9148, 1.67027}, +{74.3057, 13.7671, 1.59971}, +{75.5076, 13.6270, 1.53214}, +{76.7289, 13.4918, 1.46742}, +{77.9699, 13.3596, 1.40544}, +{79.2310, 13.2290, 1.34607}, +{80.5125, 13.0940, 1.28921}, +{81.8147, 12.9581, 1.24456}, +{83.1380, 12.8303, 1.20936}, +{84.4827, 12.7077, 1.17516}, +{85.8491, 12.5870, 1.14192}, +{87.2377, 12.4664, 1.10962}, +{88.6487, 12.3379, 1.07824}, +{90.0825, 12.2052, 1.06091}, +{91.5395, 12.0817, 1.05803}, +{93.0201, 11.9663, 1.05516}, +{94.5246, 11.8538, 1.05229}, +{96.0535, 11.7420, 1.04944}, +{97.6071, 11.6216, 1.04659}, +{99.1858, 11.5016, 1.06408}, +{100.790, 11.3950, 1.08191}, +{102.420, 11.2903, 1.10003}, +{104.077, 11.1870, 1.12083}, +{105.760, 11.0866, 1.14370}, +{107.471, 10.9885, 1.16704}, +{109.209, 10.8906, 1.19088}, +{110.975, 10.7934, 1.21937}, +{112.770, 10.6993, 1.24854}, +{114.594, 10.6069, 1.27841}, +{116.448, 10.5166, 1.30900}, +{118.331, 10.4289, 1.33689}, +{120.245, 10.3392, 1.36092}, +{122.190, 10.2454, 1.38539}, +{124.166, 10.1495, 1.41030}, +{126.175, 10.0512, 1.43565}, +{128.215, 9.95067, 1.46147}, +{130.289, 9.84739, 1.48636}, +{132.397, 9.73975, 1.51124}, +{134.538, 9.62760, 1.53654}, +{136.714, 9.51062, 1.56227}, +{138.925, 9.38978, 1.58842}, +{141.172, 9.26265, 1.61080}, +{143.456, 9.11866, 1.63263}, +{145.776, 8.96368, 1.66773}, +{148.134, 8.80982, 1.70676}, +{150.530, 8.64886, 1.74670}, +{152.964, 8.47911, 1.78758}, +{155.439, 8.29854, 1.82941}, +{157.953, 8.10460, 1.87223}, +{160.507, 7.89421, 1.91604}, +{163.103, 7.65177, 1.96088}, +{165.742, 7.38371, 2.03945}, +{168.422, 7.11814, 2.12622}, +{171.146, 6.83062, 2.21668}, +{173.915, 6.49747, 2.31099}, +{176.727, 6.12426, 2.45858}, +{179.586, 5.73925, 2.62210}, +{182.491, 5.29144, 2.79649}, +{185.442, 4.76362, 3.11715}, +{188.442, 4.24519, 3.50225}, +{191.489, 3.72585, 4.06736}, +{194.587, 3.29345, 4.72367}, +{197.734, 2.93631, 5.45302}, +{200.932, 2.64959, 6.27694}, +{204.182, 2.56052, 7.22531}, +{207.485, 2.70454, 8.10752}, +{210.840, 2.85045, 8.77518}, +{214.251, 2.97018, 9.49780}, +{217.716, 3.23747, 10.2800}, +{221.237, 3.65394, 10.8933}, +{224.816, 3.96735, 11.4221}, +{228.452, 4.30639, 11.9699}, +{232.147, 4.67136, 12.4037}, +{235.902, 5.00907, 12.8532}, +{239.717, 5.39430, 13.2861}, +{243.595, 5.77109, 13.6140}, +{247.535, 6.08306, 13.9500}, +{251.538, 6.38364, 14.3013}, +{255.607, 6.69489, 14.6750}, +{259.741, 7.03551, 15.0585}, +{263.942, 7.43199, 15.4252}, +{268.211, 7.82938, 15.7013}, +{272.549, 8.18212, 15.9824}, +{276.957, 8.53227, 16.2685}, +{281.437, 8.88649, 16.5503}, +{285.989, 9.23891, 16.8342}, +{290.615, 9.59781, 17.1230}, +{295.315, 9.96867, 17.4169}, +{300.092, 10.3662, 17.7165}, +{304.945, 10.7972, 18.0026}, +{309.878, 11.2316, 18.2484}, +{314.890, 11.6665, 18.4976}, +{319.983, 12.1376, 18.7502}, +{325.158, 12.6570, 18.9677}, +{330.418, 13.1542, 19.0906}, +{335.762, 13.6141, 19.2143}, +{341.192, 14.0646, 19.3388}, +{346.711, 14.5162, 19.4641}, +{352.319, 14.9698, 19.5681}, +{358.017, 15.4165, 19.6718}, +{363.808, 15.8675, 19.7761}, +{369.692, 16.3345, 19.8810}, +{375.672, 16.8331, 19.9530}, +{381.748, 17.3161, 19.9913}, +{387.922, 17.7986, 20.0079}, +{394.197, 18.2580, 20.0044}, +{400.573, 18.7048, 20.0009}, +{407.052, 19.1497, 19.9975}, +{413.635, 19.6109, 19.9940}, +{420.326, 20.1009, 19.9719}, +{427.124, 20.5687, 19.8575}, +{434.032, 20.9862, 19.7437}, +{441.052, 21.3741, 19.6306}, +{448.186, 21.7343, 19.5181}, +{455.435, 22.0738, 19.4455}, +{462.802, 22.4287, 19.3803}, +{470.287, 22.7874, 19.3154}, +{477.894, 23.1483, 19.2507}, +{485.623, 23.5120, 19.1861}, +{493.478, 23.8799, 19.1218}, +{501.459, 24.2543, 19.0578}, +{509.570, 24.6388, 18.9939}, +{517.812, 25.0448, 18.9302}, +{526.187, 25.4909, 18.8668}, +{534.698, 25.9722, 18.6823}, +{543.346, 26.3741, 18.4693}, +{552.134, 26.7427, 18.2588}, +{561.065, 27.0905, 18.0506}, +{570.139, 27.4235, 17.8448}, +{579.361, 27.7452, 17.6414}, +{588.732, 28.0586, 17.4402}, +{598.254, 28.3663, 17.2414}, +{607.930, 28.6712, 17.0448}, +{617.763, 28.9771, 16.8505}, +{627.755, 29.2971, 16.6584}, +{637.908, 29.6490, 16.4649}, +{648.226, 29.9874, 16.1602}, +{658.711, 30.2683, 15.8612}, +{669.365, 30.5200, 15.5676}, +{680.191, 30.7510, 15.2796}, +{691.193, 30.9655, 14.9968}, +{702.372, 31.1661, 14.7193}, +{713.733, 31.3546, 14.4469}, +{725.277, 31.5326, 14.1796}, +{737.008, 31.7011, 13.9172}, +{748.928, 31.8608, 13.6596}, +{761.042, 32.0111, 13.4086}, +{773.351, 32.1584, 13.1684}, +{785.859, 32.3054, 12.9325}, +{798.570, 32.4526, 12.7008}, +{811.486, 32.6024, 12.4732}, +{824.611, 32.7593, 12.2498}, +{837.949, 32.9475, 12.0303}, +{851.502, 33.1940, 11.7256}, +{865.274, 33.3379, 11.3663}, +{879.269, 33.4296, 11.0180}, +{893.491, 33.4903, 10.6804}, +{907.943, 33.5242, 10.3531}, +{922.628, 33.5327, 10.0359}, +{937.551, 33.5149, 9.72833}, +{952.715, 33.4552, 9.43024}, +{968.124, 33.3160, 9.17791}, +{983.783, 33.2234, 9.05465}, +{999.695, 33.1853, 8.93304}, +{1015.86, 33.1719, 8.81307}, +{1032.29, 33.1770, 8.69471}, +{1048.99, 33.2060, 8.57794}, +{1065.96, 33.2727, 8.42326}, +{1083.20, 33.3002, 8.24679}, +{1100.72, 33.3126, 8.07470}, +{1118.52, 33.3187, 7.90624}, +{1136.61, 33.3196, 7.74122}, +{1155.00, 33.3158, 7.57973}, +{1173.68, 33.3083, 7.42173}, +{1192.66, 33.2973, 7.26689}, +{1211.95, 33.2832, 7.11522}, +{1231.55, 33.2664, 6.96667}, +{1251.47, 33.2469, 6.81944}, +{1271.72, 33.2251, 6.67330}, +{1292.29, 33.1969, 6.52785}, +{1313.19, 33.1636, 6.38547}, +{1334.43, 33.1256, 6.24623}, +{1356.01, 33.0833, 6.11010}, +{1377.94, 33.0367, 5.97686}, +{1400.23, 32.9857, 5.84649}, +{1422.88, 32.9301, 5.71890}, +{1445.89, 32.8699, 5.59425}, +{1469.28, 32.8054, 5.47214}, +{1493.04, 32.7358, 5.35237}, +{1517.19, 32.6606, 5.23414}, +{1541.73, 32.5790, 5.11833}, +{1566.67, 32.4908, 5.00499}, +{1592.01, 32.3955, 4.89416}, +{1617.76, 32.2926, 4.78584}, +{1643.92, 32.1817, 4.68006}, +{1670.51, 32.0620, 4.57642}, +{1697.53, 31.9323, 4.47512}, +{1724.99, 31.7921, 4.37621}, +{1752.89, 31.6395, 4.27826}, +{1781.24, 31.4723, 4.18206}, +{1810.05, 31.2881, 4.08765}, +{1839.32, 31.0844, 3.99533}, +{1869.07, 30.8579, 3.90512}, +{1899.30, 30.6045, 3.81700}, +{1930.02, 30.3183, 3.73084}, +{1961.24, 29.9917, 3.64663}, +{1992.96, 29.6135, 3.56432}, +{2025.20, 29.1687, 3.48519}, +{2057.95, 28.6318, 3.40559}, +{2091.24, 27.9597, 3.32752}, +{2125.06, 27.0726, 3.25102}, +{2159.43, 25.7863, 3.17610}, +{2194.36, 23.4506, 3.10260}, +{2222.20, 8.16786, 3.04605}, +{2222.40, 8.16893, 11.4966}, +{2229.85, 19.7621, 11.4305}, +{2265.92, 23.8842, 11.1191}, +{2302.57, 22.6537, 10.8162}, +{2306.60, 18.1276, 10.7837}, +{2306.80, 18.1394, 14.8501}, +{2339.81, 26.5177, 14.5624}, +{2377.66, 28.2828, 14.2442}, +{2416.11, 29.4030, 13.9332}, +{2455.19, 30.1668, 13.6291}, +{2494.90, 30.5725, 13.3314}, +{2531.50, 27.7888, 13.0668}, +{2531.70, 27.7965, 14.9250}, +{2535.26, 29.9524, 14.8957}, +{2576.26, 32.0720, 14.5653}, +{2617.93, 33.0175, 14.2407}, +{2660.27, 33.7454, 13.9207}, +{2703.30, 34.3559, 13.6051}, +{2747.03, 34.8861, 13.2942}, +{2791.46, 35.3552, 12.9882}, +{2836.61, 35.7751, 12.6872}, +{2882.49, 36.1548, 12.3913}, +{2929.11, 36.4994, 12.0999}, +{2976.48, 36.8138, 11.8143}, +{3024.63, 37.1019, 11.5333}, +{3073.55, 37.3664, 11.2576}, +{3123.26, 37.6094, 10.9867}, +{3173.78, 37.8336, 10.7213}, +{3225.11, 38.0401, 10.4605}, +{3277.27, 38.2308, 10.2053}, +{3330.28, 38.4068, 9.95452}, +{3384.15, 38.5692, 9.70940}, +{3438.88, 38.7199, 9.46932}, +{3494.50, 38.8585, 9.23316}, +{3551.02, 38.9871, 9.00309}, +{3608.46, 39.1052, 8.77713}, +{3666.82, 39.2143, 8.55651}, +{3726.13, 39.3149, 8.34033}, +{3786.40, 39.4075, 8.12889}, +{3847.64, 39.4925, 7.92213}, +{3909.87, 39.5705, 7.71996}, +{3973.11, 39.6420, 7.52237}, +{4037.38, 39.7074, 7.32919}, +{4102.68, 39.7669, 7.14039}, +{4169.03, 39.8211, 6.95599}, +{4236.46, 39.8702, 6.77583}, +{4304.98, 39.9145, 6.59984}, +{4374.62, 39.9544, 6.42800}, +{4445.37, 39.9901, 6.26019}, +{4517.27, 40.0218, 6.09641}, +{4590.33, 40.0498, 5.93656}, +{4664.58, 40.0744, 5.78053}, +{4740.03, 40.0956, 5.62823}, +{4816.69, 40.1138, 5.47966}, +{4894.60, 40.1291, 5.33471}, +{4973.77, 40.1416, 5.19335}, +{5054.21, 40.1517, 5.05549}, +{5135.96, 40.1593, 4.92100}, +{5219.03, 40.1647, 4.78980}, +{5303.44, 40.1679, 4.66199}, +{5389.22, 40.1692, 4.53734}, +{5476.39, 40.1686, 4.41583}, +{5564.97, 40.1663, 4.29738}, +{5654.98, 40.1624, 4.18198}, +{5746.44, 40.1569, 4.06940}, +{5839.39, 40.1499, 3.95983}, +{5933.83, 40.1416, 3.85307}, +{6029.81, 40.1321, 3.74900}, +{6127.33, 40.1214, 3.64763}, +{6226.44, 40.1096, 3.54889}, +{6327.15, 40.0967, 3.45266}, +{6429.48, 40.0828, 3.35894}, +{6533.48, 40.0682, 3.26775}, +{6639.15, 40.0526, 3.17881}, +{6746.54, 40.0362, 3.09232}, +{6855.65, 40.0191, 3.00807}, +{6966.54, 40.0013, 2.92602}, +{7079.22, 39.9829, 2.84615}, +{7193.72, 39.9639, 2.76841}, +{7310.07, 39.9442, 2.69268}, +{7428.31, 39.9242, 2.61907}, +{7548.45, 39.9036, 2.54727}, +{7670.54, 39.8825, 2.47744}, +{7794.61, 39.8610, 2.40948}, +{7920.68, 39.8391, 2.34342}, +{8048.79, 39.8169, 2.27901}, +{8178.98, 39.7942, 2.21629}, +{8311.26, 39.7711, 2.15533}, +{8445.69, 39.7478, 2.09610}, +{8582.29, 39.7241, 2.03829}, +{8721.11, 39.7001, 1.98207}, +{8862.16, 39.6757, 1.92742}, +{9005.50, 39.6511, 1.87425}, +{9151.16, 39.6262, 1.82248}, +{9299.17, 39.6010, 1.77214}, +{9449.58, 39.5755, 1.72314}, +{9602.42, 39.5497, 1.67549}, +{9757.73, 39.5235, 1.62913}, +{9915.55, 39.4971, 1.58400}, +{10075.9, 39.4703, 1.54012}, +{10238.9, 39.4431, 1.49743}, +{10404.5, 39.4155, 1.45590}, +{10572.8, 39.3876, 1.41551}, +{10743.8, 39.3592, 1.37621}, +{10917.6, 39.3303, 1.33798}, +{11094.2, 39.3009, 1.30080}, +{11273.6, 39.2710, 1.26462}, +{11455.9, 39.2404, 1.22944}, +{11641.2, 39.2092, 1.19521}, +{11829.5, 39.1772, 1.16192}, +{12020.8, 39.1444, 1.12954}, +{12215.3, 39.1107, 1.09804}, +{12412.8, 39.0760, 1.06741}, +{12613.6, 39.0402, 1.03761}, +{12817.6, 39.0031, 1.00862}, +{13025.0, 38.9645, 0.980427}, +{13235.6, 38.9244, 0.953003}, +{13449.7, 38.8824, 0.926328}, +{13667.2, 38.8383, 0.900381}, +{13888.3, 38.7918, 0.875144}, +{14112.9, 38.7426, 0.850595}, +{14341.2, 38.6901, 0.826717}, +{14573.1, 38.6338, 0.803490}, +{14808.9, 38.5730, 0.780897}, +{15048.4, 38.5068, 0.758920}, +{15291.8, 38.4341, 0.737544}, +{15539.1, 38.3534, 0.716749}, +{15790.4, 38.2625, 0.696522}, +{16045.8, 38.1585, 0.676845}, +{16305.4, 38.0372, 0.657705}, +{16569.1, 37.8918, 0.639085}, +{16837.1, 37.7113, 0.620971}, +{17109.4, 37.4749, 0.603351}, +{17386.1, 37.1373, 0.586209}, +{17667.4, 36.5626, 0.569532}, +{17953.1, 34.5939, 0.553309}, +{17997.5, 28.3840, 0.550852}, +{17997.7, 28.3842, 3.75901}, +{18243.5, 36.4374, 3.68092}, +{18538.6, 37.2968, 3.59064}, +{18838.4, 37.7867, 3.50200}, +{19143.1, 38.1322, 3.41501}, +{19452.7, 38.3989, 3.32966}, +{19767.4, 38.6155, 3.24596}, +{20087.1, 38.7968, 3.16391}, +{20412.0, 38.9521, 3.08349}, +{20742.1, 39.0869, 3.00471}, +{21077.6, 39.2055, 2.92754}, +{21418.5, 39.3106, 2.85199}, +{21765.0, 39.4045, 2.77804}, +{22117.0, 39.4887, 2.70568}, +{22474.7, 39.5645, 2.63488}, +{22838.2, 39.6332, 2.56564}, +{23207.6, 39.6954, 2.49794}, +{23583.0, 39.7519, 2.43176}, +{23964.4, 39.8033, 2.36708}, +{24352.0, 39.8502, 2.30387}, +{24745.9, 39.8929, 2.24213}, +{25146.2, 39.9319, 2.18183}, +{25552.9, 39.9674, 2.12294}, +{25966.2, 39.9998, 2.06545}, +{26386.1, 40.0293, 2.00933}, +{26812.9, 40.0562, 1.95456}, +{27246.6, 40.0807, 1.90112}, +{27687.3, 40.1030, 1.84899}, +{28135.1, 40.1231, 1.79813}, +{28590.2, 40.1414, 1.74853}, +{29052.6, 40.1579, 1.70017}, +{29522.5, 40.1727, 1.65302}, +{30000.0, 40.1860, 1.60705}, +{0, 0, 0} +}; + +e_fp_fdp nb[] = { /* Z = 41 */ +{10.0000, -9999.00, 2.56685}, +{10.1617, -9999.00, 2.66209}, +{10.3261, -9999.00, 2.76087}, +{10.4931, -9999.00, 2.86331}, +{10.6628, -9999.00, 2.96956}, +{10.8353, -9999.00, 3.07974}, +{11.0106, -9999.00, 3.19401}, +{11.1886, -9999.00, 3.31252}, +{11.3696, -9999.00, 3.42326}, +{11.5535, -9999.00, 3.51200}, +{11.7404, -9999.00, 3.60305}, +{11.9303, -9999.00, 3.69645}, +{12.1232, -9999.00, 3.79228}, +{12.3193, -9999.00, 3.89059}, +{12.5186, -9999.00, 3.99145}, +{12.7210, -9999.00, 4.09492}, +{12.9268, -9999.00, 4.19732}, +{13.1359, -9999.00, 4.29578}, +{13.3483, -9999.00, 4.39654}, +{13.5642, -9999.00, 4.49967}, +{13.7836, -9999.00, 4.60521}, +{14.0066, -9999.00, 4.71323}, +{14.2331, -9999.00, 4.82379}, +{14.4633, -9999.00, 4.92204}, +{14.6973, -9999.00, 4.99540}, +{14.9350, -9999.00, 5.06985}, +{15.1765, -9999.00, 5.14542}, +{15.4220, -9999.00, 5.22211}, +{15.6714, -9999.00, 5.29994}, +{15.9249, -9999.00, 5.36144}, +{16.1825, -9999.00, 5.40803}, +{16.4442, -9999.00, 5.45502}, +{16.7102, -9999.00, 5.50243}, +{16.9805, -9999.00, 5.55024}, +{17.2551, -9999.00, 5.52629}, +{17.5342, -9999.00, 5.49985}, +{17.8178, -9999.00, 5.47353}, +{18.1060, -9999.00, 5.44735}, +{18.3989, -9999.00, 5.42129}, +{18.6964, -9999.00, 5.35934}, +{18.9988, -9999.00, 5.22402}, +{19.3061, -9999.00, 5.09212}, +{19.6184, -9999.00, 4.96355}, +{19.9357, -9999.00, 4.83823}, +{20.2582, -9999.00, 4.71607}, +{20.5858, -9999.00, 4.57132}, +{20.9188, -9999.00, 4.42631}, +{21.2571, -9999.00, 4.28590}, +{21.6009, -9999.00, 4.14994}, +{21.9503, -9999.00, 4.01830}, +{22.3053, -9999.00, 3.89083}, +{22.6661, -9999.00, 3.78365}, +{23.0327, -9999.00, 3.68358}, +{23.4053, -9999.00, 3.58615}, +{23.7838, -9999.00, 3.49131}, +{24.1685, -9999.00, 3.39896}, +{24.5594, -9999.00, 3.32114}, +{24.9566, -9999.00, 3.26923}, +{25.3603, -9999.00, 3.21814}, +{25.7705, -9999.00, 3.16785}, +{26.1873, -9999.00, 3.11835}, +{26.6109, -9999.00, 3.09552}, +{27.0413, -9999.00, 3.08913}, +{27.4786, -9999.00, 3.08276}, +{27.9231, -9999.00, 3.07640}, +{28.3747, -9999.00, 3.08935}, +{28.8337, -9999.00, 3.16044}, +{29.3000, 3.65589, 3.23316}, +{29.7739, 3.28421, 3.35858}, +{30.2555, 2.94113, 3.56089}, +{30.7449, 2.58333, 3.77537}, +{31.2421, 2.15063, 4.06135}, +{31.7475, 1.77528, 4.47181}, +{32.2609, 1.44276, 4.92376}, +{32.7827, 1.13375, 5.42138}, +{33.3130, 0.845374, 5.96928}, +{33.8518, 0.574920, 6.57256}, +{34.3993, 0.312846, 7.23682}, +{34.9557, 0.309060E-01, 8.04643}, +{35.5211, -0.116685, 9.01917}, +{36.0956, -0.107686, 10.1095}, +{36.6794, 0.146301, 11.3037}, +{37.2727, 0.570445, 12.4075}, +{37.8755, 1.20021, 13.6192}, +{38.4882, 2.35458, 14.7266}, +{39.1107, 3.52583, 15.3002}, +{39.7432, 4.78554, 15.6547}, +{40.3861, 5.88594, 15.7420}, +{41.0393, 6.78429, 15.7278}, +{41.7031, 7.57706, 15.7135}, +{42.3776, 8.31831, 15.6993}, +{43.0630, 9.03042, 15.6850}, +{43.7595, 9.73071, 15.6708}, +{44.4673, 10.4357, 15.6566}, +{45.1865, 11.1732, 15.6424}, +{45.9174, 12.0028, 15.6283}, +{46.6600, 12.9126, 15.3674}, +{47.4147, 13.6599, 15.0138}, +{48.1816, 14.3473, 14.6684}, +{48.9609, 15.0367, 14.3309}, +{49.7528, 15.8417, 13.9371}, +{50.5576, 16.5048, 13.2171}, +{51.3753, 16.9841, 12.5343}, +{52.2062, 17.3605, 11.8868}, +{53.0506, 17.6940, 11.2590}, +{53.9087, 17.9449, 10.5992}, +{54.7806, 18.1179, 9.97803}, +{55.6667, 18.2359, 9.39326}, +{56.5670, 18.3131, 8.84278}, +{57.4820, 18.3575, 8.32454}, +{58.4117, 18.3756, 7.83669}, +{59.3564, 18.3729, 7.37744}, +{60.3165, 18.3550, 6.94508}, +{61.2921, 18.3297, 6.53806}, +{62.2834, 18.3166, 6.12911}, +{63.2908, 18.2548, 5.71452}, +{64.3145, 18.1655, 5.32795}, +{65.3547, 18.0587, 4.96755}, +{66.4118, 17.9394, 4.63153}, +{67.4859, 17.8108, 4.31822}, +{68.5775, 17.6756, 4.02612}, +{69.6867, 17.5360, 3.75377}, +{70.8138, 17.3953, 3.49985}, +{71.9591, 17.2616, 3.26310}, +{73.1230, 17.1216, 3.01378}, +{74.3057, 16.9629, 2.78071}, +{75.5076, 16.7949, 2.56567}, +{76.7289, 16.6212, 2.36726}, +{77.9699, 16.4427, 2.18419}, +{79.2310, 16.2576, 2.01528}, +{80.5125, 16.0707, 1.87098}, +{81.8147, 15.8902, 1.73976}, +{83.1380, 15.7116, 1.61773}, +{84.4827, 15.5328, 1.50427}, +{85.8491, 15.3504, 1.39877}, +{87.2377, 15.1543, 1.30066}, +{88.6487, 14.9611, 1.24613}, +{90.0825, 14.7885, 1.19890}, +{91.5395, 14.6243, 1.15346}, +{93.0201, 14.4625, 1.10975}, +{94.5246, 14.2959, 1.07194}, +{96.0535, 14.1335, 1.04477}, +{97.6071, 13.9637, 1.01829}, +{99.1858, 13.7936, 1.02779}, +{100.790, 13.6424, 1.04439}, +{102.420, 13.4997, 1.06431}, +{104.077, 13.3678, 1.08972}, +{105.760, 13.2437, 1.11574}, +{107.471, 13.1230, 1.14238}, +{109.209, 13.0075, 1.17622}, +{110.975, 12.8987, 1.21118}, +{112.770, 12.7956, 1.24718}, +{114.594, 12.6984, 1.28425}, +{116.448, 12.6072, 1.31759}, +{118.331, 12.5154, 1.34875}, +{120.245, 12.4237, 1.38065}, +{122.190, 12.3329, 1.41329}, +{124.166, 12.2430, 1.44671}, +{126.175, 12.1540, 1.48092}, +{128.215, 12.0657, 1.51594}, +{130.289, 11.9784, 1.55179}, +{132.397, 11.8938, 1.58849}, +{134.538, 11.8089, 1.62010}, +{136.714, 11.7208, 1.65170}, +{138.925, 11.6305, 1.68392}, +{141.172, 11.5384, 1.71676}, +{143.456, 11.4443, 1.75025}, +{145.776, 11.3483, 1.78439}, +{148.134, 11.2507, 1.81919}, +{150.530, 11.1544, 1.85352}, +{152.964, 11.0523, 1.88106}, +{155.439, 10.9427, 1.90901}, +{157.953, 10.8270, 1.93737}, +{160.507, 10.7050, 1.96616}, +{163.103, 10.5773, 1.99521}, +{165.742, 10.4406, 2.02065}, +{168.422, 10.2929, 2.04629}, +{171.146, 10.1329, 2.07219}, +{173.915, 9.95887, 2.09843}, +{176.727, 9.76589, 2.12499}, +{179.586, 9.55397, 2.16023}, +{182.491, 9.32097, 2.19828}, +{185.442, 9.05806, 2.25268}, +{188.442, 8.78371, 2.32435}, +{191.489, 8.48045, 2.39830}, +{194.587, 8.13659, 2.50013}, +{197.734, 7.77283, 2.64962}, +{200.932, 7.38003, 2.80911}, +{204.182, 6.96546, 3.03219}, +{207.485, 6.52531, 3.26360}, +{210.840, 5.98241, 3.51267}, +{214.251, 5.40330, 3.99318}, +{217.716, 4.82148, 4.57096}, +{221.237, 4.31803, 5.33099}, +{224.816, 3.91986, 6.21889}, +{228.452, 3.73787, 7.25768}, +{232.147, 3.80764, 8.17174}, +{235.902, 3.83946, 8.98427}, +{239.717, 3.91127, 9.87761}, +{243.595, 4.21271, 10.8251}, +{247.535, 4.56163, 11.5923}, +{251.538, 5.03425, 12.4139}, +{255.607, 5.61515, 12.9857}, +{259.741, 6.09081, 13.4529}, +{263.942, 6.56845, 13.9370}, +{268.211, 7.02385, 14.3084}, +{272.549, 7.44485, 14.6892}, +{276.957, 7.85801, 15.0802}, +{281.437, 8.30906, 15.4815}, +{285.989, 8.77446, 15.7975}, +{290.615, 9.21280, 16.1001}, +{295.315, 9.63811, 16.4085}, +{300.092, 10.0750, 16.7228}, +{304.945, 10.5708, 17.0174}, +{309.878, 11.0473, 17.2581}, +{314.890, 11.5107, 17.5022}, +{319.983, 11.9935, 17.7497}, +{325.158, 12.5784, 18.0007}, +{330.418, 13.1951, 18.0465}, +{335.762, 13.6628, 17.9948}, +{341.192, 13.9951, 17.9432}, +{346.711, 14.2543, 18.0412}, +{352.319, 14.5586, 18.1968}, +{358.017, 14.9060, 18.3538}, +{363.808, 15.2672, 18.5122}, +{369.692, 15.6413, 18.6719}, +{375.672, 16.0291, 18.8330}, +{381.748, 16.4333, 18.9955}, +{387.922, 16.8592, 19.1594}, +{394.197, 17.3206, 19.3247}, +{400.573, 17.8734, 19.4494}, +{407.052, 18.3710, 19.4552}, +{413.635, 18.8265, 19.4610}, +{420.326, 19.2638, 19.4669}, +{427.124, 19.6917, 19.4727}, +{434.032, 20.1153, 19.4786}, +{441.052, 20.5395, 19.4844}, +{448.186, 20.9707, 19.4903}, +{455.435, 21.4280, 19.4961}, +{462.802, 21.8985, 19.4360}, +{470.287, 22.3359, 19.3486}, +{477.894, 22.7438, 19.2615}, +{485.623, 23.1399, 19.1749}, +{493.478, 23.5281, 19.0886}, +{501.459, 23.9115, 19.0027}, +{509.570, 24.2929, 18.9172}, +{517.812, 24.6755, 18.8321}, +{526.187, 25.0637, 18.7474}, +{534.698, 25.4610, 18.6630}, +{543.346, 25.9374, 18.5671}, +{552.134, 26.3759, 18.3448}, +{561.065, 26.7474, 18.1252}, +{570.139, 27.0915, 17.9082}, +{579.361, 27.4151, 17.6938}, +{588.732, 27.7223, 17.4820}, +{598.254, 28.0158, 17.2727}, +{607.930, 28.2974, 17.0659}, +{617.763, 28.5686, 16.8616}, +{627.755, 28.8307, 16.6597}, +{637.908, 29.0846, 16.4602}, +{648.226, 29.3312, 16.2632}, +{658.711, 29.5715, 16.0685}, +{669.365, 29.8061, 15.8761}, +{680.191, 30.0359, 15.6860}, +{691.193, 30.2618, 15.4982}, +{702.372, 30.4850, 15.3127}, +{713.733, 30.7068, 15.1294}, +{725.277, 30.9299, 14.9483}, +{737.008, 31.1654, 14.7693}, +{748.928, 31.3946, 14.5570}, +{761.042, 31.6082, 14.3442}, +{773.351, 31.8099, 14.1345}, +{785.859, 32.0061, 13.9279}, +{798.570, 32.1994, 13.7243}, +{811.486, 32.3926, 13.5236}, +{824.611, 32.5905, 13.3260}, +{837.949, 32.8033, 13.1311}, +{851.502, 33.0668, 12.8911}, +{865.274, 33.2802, 12.5746}, +{879.269, 33.4278, 12.2659}, +{893.491, 33.5442, 11.9647}, +{907.943, 33.6361, 11.6805}, +{922.628, 33.7036, 11.4059}, +{937.551, 33.7564, 11.1668}, +{952.715, 33.8143, 10.9462}, +{968.124, 33.8779, 10.7294}, +{983.783, 33.9396, 10.5171}, +{999.695, 33.9992, 10.3084}, +{1015.86, 34.0568, 10.1034}, +{1032.29, 34.1117, 9.89893}, +{1048.99, 34.1629, 9.69527}, +{1065.96, 34.2066, 9.49228}, +{1083.20, 34.2439, 9.29351}, +{1100.72, 34.2759, 9.09891}, +{1118.52, 34.3031, 8.90840}, +{1136.61, 34.3260, 8.72189}, +{1155.00, 34.3447, 8.53934}, +{1173.68, 34.3598, 8.36071}, +{1192.66, 34.3712, 8.18562}, +{1211.95, 34.3792, 8.01420}, +{1231.55, 34.3846, 7.84637}, +{1251.47, 34.3875, 7.68037}, +{1271.72, 34.3872, 7.51584}, +{1292.29, 34.3813, 7.35234}, +{1313.19, 34.3703, 7.19247}, +{1334.43, 34.3550, 7.03610}, +{1356.01, 34.3357, 6.88313}, +{1377.94, 34.3126, 6.73349}, +{1400.23, 34.2860, 6.58711}, +{1422.88, 34.2562, 6.44390}, +{1445.89, 34.2235, 6.30366}, +{1469.28, 34.1891, 6.16506}, +{1493.04, 34.1534, 6.02740}, +{1517.19, 34.1106, 5.88320}, +{1541.73, 34.0584, 5.74116}, +{1566.67, 33.9977, 5.60259}, +{1592.01, 33.9299, 5.46757}, +{1617.76, 33.8552, 5.33575}, +{1643.92, 33.7733, 5.20694}, +{1670.51, 33.6838, 5.08124}, +{1697.53, 33.5864, 4.95865}, +{1724.99, 33.4796, 4.83916}, +{1752.89, 33.3641, 4.72470}, +{1781.24, 33.2402, 4.61365}, +{1810.05, 33.1066, 4.50565}, +{1839.32, 32.9623, 4.40039}, +{1869.07, 32.8057, 4.29760}, +{1899.30, 32.6348, 4.19716}, +{1930.02, 32.4475, 4.09906}, +{1961.24, 32.2412, 4.00326}, +{1992.96, 32.0125, 3.90969}, +{2025.20, 31.7556, 3.81809}, +{2057.95, 31.4665, 3.73130}, +{2091.24, 31.1387, 3.64707}, +{2125.06, 30.7610, 3.56538}, +{2159.43, 30.3175, 3.48606}, +{2194.36, 29.7840, 3.40925}, +{2229.85, 29.1199, 3.33475}, +{2265.92, 28.2479, 3.26250}, +{2302.57, 26.9916, 3.19248}, +{2339.81, 24.7379, 3.12463}, +{2370.40, 9.50284, 3.07077}, +{2370.60, 9.50482, 11.3846}, +{2377.66, 20.7176, 11.3328}, +{2416.11, 25.0802, 11.0570}, +{2455.19, 24.7669, 10.7876}, +{2464.60, 19.2062, 10.7244}, +{2464.80, 19.2131, 14.7781}, +{2494.90, 27.4023, 14.5323}, +{2535.26, 29.2837, 14.2136}, +{2576.26, 30.4376, 13.9019}, +{2617.93, 31.2162, 13.5973}, +{2660.27, 31.6238, 13.2990}, +{2697.60, 28.8304, 13.0452}, +{2697.80, 28.8341, 14.8700}, +{2703.30, 31.2653, 14.8276}, +{2747.03, 33.1711, 14.4982}, +{2791.46, 34.1005, 14.1751}, +{2836.61, 34.8210, 13.8565}, +{2882.49, 35.4269, 13.5426}, +{2929.11, 35.9539, 13.2330}, +{2976.48, 36.4204, 12.9281}, +{3024.63, 36.8385, 12.6280}, +{3073.55, 37.2161, 12.3327}, +{3123.26, 37.5592, 12.0423}, +{3173.78, 37.8722, 11.7569}, +{3225.11, 38.1588, 11.4767}, +{3277.27, 38.4218, 11.2013}, +{3330.28, 38.6637, 10.9311}, +{3384.15, 38.8865, 10.6660}, +{3438.88, 39.0920, 10.4060}, +{3494.50, 39.2820, 10.1508}, +{3551.02, 39.4572, 9.90020}, +{3608.46, 39.6185, 9.65484}, +{3666.82, 39.7674, 9.41477}, +{3726.13, 39.9053, 9.17987}, +{3786.40, 40.0329, 8.94941}, +{3847.64, 40.1502, 8.72360}, +{3909.87, 40.2582, 8.50283}, +{3973.11, 40.3577, 8.28684}, +{4037.38, 40.4492, 8.07553}, +{4102.68, 40.5333, 7.86887}, +{4169.03, 40.6103, 7.66678}, +{4236.46, 40.6808, 7.46921}, +{4304.98, 40.7452, 7.27619}, +{4374.62, 40.8037, 7.08744}, +{4445.37, 40.8569, 6.90311}, +{4517.27, 40.9050, 6.72304}, +{4590.33, 40.9484, 6.54715}, +{4664.58, 40.9873, 6.37543}, +{4740.03, 41.0220, 6.20773}, +{4816.69, 41.0527, 6.04409}, +{4894.60, 41.0798, 5.88433}, +{4973.77, 41.1033, 5.72842}, +{5054.21, 41.1236, 5.57623}, +{5135.96, 41.1408, 5.42782}, +{5219.03, 41.1551, 5.28304}, +{5303.44, 41.1667, 5.14184}, +{5389.22, 41.1757, 5.00413}, +{5476.39, 41.1823, 4.86990}, +{5564.97, 41.1868, 4.73899}, +{5654.98, 41.1891, 4.61144}, +{5746.44, 41.1895, 4.48701}, +{5839.39, 41.1879, 4.36576}, +{5933.83, 41.1847, 4.24757}, +{6029.81, 41.1798, 4.13246}, +{6127.33, 41.1734, 4.02024}, +{6226.44, 41.1655, 3.91095}, +{6327.15, 41.1563, 3.80448}, +{6429.48, 41.1459, 3.70072}, +{6533.48, 41.1342, 3.59976}, +{6639.15, 41.1215, 3.50134}, +{6746.54, 41.1078, 3.40554}, +{6855.65, 41.0931, 3.31225}, +{6966.54, 41.0776, 3.22140}, +{7079.22, 41.0612, 3.13295}, +{7193.72, 41.0440, 3.04680}, +{7310.07, 41.0261, 2.96296}, +{7428.31, 41.0074, 2.88131}, +{7548.45, 40.9882, 2.80200}, +{7670.54, 40.9684, 2.72467}, +{7794.61, 40.9480, 2.64944}, +{7920.68, 40.9271, 2.57624}, +{8048.79, 40.9058, 2.50498}, +{8178.98, 40.8840, 2.43560}, +{8311.26, 40.8617, 2.36808}, +{8445.69, 40.8390, 2.30247}, +{8582.29, 40.8160, 2.23858}, +{8721.11, 40.7925, 2.17642}, +{8862.16, 40.7687, 2.11602}, +{9005.50, 40.7447, 2.05730}, +{9151.16, 40.7203, 2.00004}, +{9299.17, 40.6956, 1.94440}, +{9449.58, 40.6706, 1.89027}, +{9602.42, 40.6453, 1.83763}, +{9757.73, 40.6197, 1.78644}, +{9915.55, 40.5938, 1.73664}, +{10075.9, 40.5676, 1.68821}, +{10238.9, 40.5411, 1.64112}, +{10404.5, 40.5143, 1.59532}, +{10572.8, 40.4871, 1.55078}, +{10743.8, 40.4596, 1.50747}, +{10917.6, 40.4317, 1.46535}, +{11094.2, 40.4035, 1.42439}, +{11273.6, 40.3748, 1.38457}, +{11455.9, 40.3457, 1.34585}, +{11641.2, 40.3161, 1.30820}, +{11829.5, 40.2859, 1.27159}, +{12020.8, 40.2552, 1.23600}, +{12215.3, 40.2239, 1.20139}, +{12412.8, 40.1918, 1.16775}, +{12613.6, 40.1590, 1.13504}, +{12817.6, 40.1253, 1.10323}, +{13025.0, 40.0906, 1.07231}, +{13235.6, 40.0549, 1.04225}, +{13449.7, 40.0180, 1.01303}, +{13667.2, 39.9797, 0.984615}, +{13888.3, 39.9399, 0.956994}, +{14112.9, 39.8983, 0.930141}, +{14341.2, 39.8548, 0.904036}, +{14573.1, 39.8090, 0.878656}, +{14808.9, 39.7605, 0.853984}, +{15048.4, 39.7091, 0.829999}, +{15291.8, 39.6540, 0.806682}, +{15539.1, 39.5948, 0.784015}, +{15790.4, 39.5305, 0.761978}, +{16045.8, 39.4602, 0.740555}, +{16305.4, 39.3824, 0.719728}, +{16569.1, 39.2953, 0.699482}, +{16837.1, 39.1963, 0.679799}, +{17109.4, 39.0816, 0.660665}, +{17386.1, 38.9456, 0.642062}, +{17667.4, 38.7789, 0.623977}, +{17953.1, 38.5651, 0.606396}, +{18243.5, 38.2701, 0.589303}, +{18538.6, 37.8046, 0.572686}, +{18838.4, 36.7415, 0.556530}, +{18985.5, 29.3743, 0.548862}, +{18985.7, 29.3745, 3.74502}, +{19143.1, 36.9155, 3.69724}, +{19452.7, 38.0837, 3.60610}, +{19767.4, 38.6510, 3.51666}, +{20087.1, 39.0322, 3.42892}, +{20412.0, 39.3196, 3.34287}, +{20742.1, 39.5496, 3.25853}, +{21077.6, 39.7404, 3.17587}, +{21418.5, 39.9026, 3.09489}, +{21765.0, 40.0429, 3.01558}, +{22117.0, 40.1657, 2.93793}, +{22474.7, 40.2742, 2.86193}, +{22838.2, 40.3709, 2.78755}, +{23207.6, 40.4574, 2.71480}, +{23583.0, 40.5353, 2.64364}, +{23964.4, 40.6056, 2.57406}, +{24352.0, 40.6693, 2.50604}, +{24745.9, 40.7271, 2.43957}, +{25146.2, 40.7797, 2.37462}, +{25552.9, 40.8275, 2.31116}, +{25966.2, 40.8711, 2.24919}, +{26386.1, 40.9108, 2.18867}, +{26812.9, 40.9470, 2.12958}, +{27246.6, 40.9801, 2.07190}, +{27687.3, 41.0102, 2.01561}, +{28135.1, 41.0376, 1.96069}, +{28590.2, 41.0627, 1.90710}, +{29052.6, 41.0858, 1.85482}, +{29522.5, 41.1116, 1.80384}, +{30000.0, 41.1094, 1.75412}, +{0, 0, 0} +}; + +e_fp_fdp mo[] = { /* Z = 42 */ +{10.0000, -9999.00, 2.05457}, +{10.1617, -9999.00, 2.09151}, +{10.3261, -9999.00, 2.12912}, +{10.4931, -9999.00, 2.16740}, +{10.6628, -9999.00, 2.20637}, +{10.8353, -9999.00, 2.24604}, +{11.0106, -9999.00, 2.28643}, +{11.1886, -9999.00, 2.32754}, +{11.3696, -9999.00, 2.37202}, +{11.5535, -9999.00, 2.46593}, +{11.7404, -9999.00, 2.56357}, +{11.9303, -9999.00, 2.66508}, +{12.1232, -9999.00, 2.77060}, +{12.3193, -9999.00, 2.88030}, +{12.5186, -9999.00, 2.99435}, +{12.7210, -9999.00, 3.11291}, +{12.9268, -9999.00, 3.23616}, +{13.1359, -9999.00, 3.36203}, +{13.3483, -9999.00, 3.48762}, +{13.5642, -9999.00, 3.61789}, +{13.7836, -9999.00, 3.75304}, +{14.0066, -9999.00, 3.89324}, +{14.2331, -9999.00, 4.03867}, +{14.4633, -9999.00, 4.18954}, +{14.6973, -9999.00, 4.34604}, +{14.9350, -9999.00, 4.50839}, +{15.1765, -9999.00, 4.67121}, +{15.4220, -9999.00, 4.83613}, +{15.6714, -9999.00, 5.00686}, +{15.9249, -9999.00, 5.18363}, +{16.1825, -9999.00, 5.36663}, +{16.4442, -9999.00, 5.55610}, +{16.7102, -9999.00, 5.75226}, +{16.9805, -9999.00, 5.95257}, +{17.2551, -9999.00, 6.08877}, +{17.5342, -9999.00, 6.22809}, +{17.8178, -9999.00, 6.37059}, +{18.1060, -9999.00, 6.51635}, +{18.3989, -9999.00, 6.66545}, +{18.6964, -9999.00, 6.81797}, +{18.9988, -9999.00, 6.97397}, +{19.3061, -9999.00, 7.09743}, +{19.6184, -9999.00, 7.12882}, +{19.9357, -9999.00, 7.16034}, +{20.2582, -9999.00, 7.19201}, +{20.5858, -9999.00, 7.22381}, +{20.9188, -9999.00, 7.25576}, +{21.2571, -9999.00, 7.28785}, +{21.6009, -9999.00, 7.26216}, +{21.9503, -9999.00, 7.20440}, +{22.3053, -9999.00, 7.14711}, +{22.6661, -9999.00, 7.09027}, +{23.0327, -9999.00, 7.03388}, +{23.4053, -9999.00, 6.97794}, +{23.7838, -9999.00, 6.89925}, +{24.1685, -9999.00, 6.72686}, +{24.5594, -9999.00, 6.55877}, +{24.9566, -9999.00, 6.39489}, +{25.3603, -9999.00, 6.23510}, +{25.7705, -9999.00, 6.06197}, +{26.1873, -9999.00, 5.68613}, +{26.6109, -9999.00, 5.33358}, +{27.0413, -9999.00, 5.00289}, +{27.4786, -9999.00, 4.69271}, +{27.9231, -9999.00, 4.40128}, +{28.3747, -9999.00, 4.12778}, +{28.8337, -9999.00, 3.87127}, +{29.3000, 7.14109, 3.63071}, +{29.7739, 6.72533, 3.52811}, +{30.2555, 6.41082, 3.52740}, +{30.7449, 6.12012, 3.52668}, +{31.2421, 5.81619, 3.52597}, +{31.7475, 5.44999, 3.55299}, +{32.2609, 5.10177, 3.70055}, +{32.7827, 4.78663, 3.85423}, +{33.3130, 4.46675, 4.01430}, +{33.8518, 4.08977, 4.18441}, +{34.3993, 3.70630, 4.52399}, +{34.9557, 3.37468, 4.89112}, +{35.5211, 3.05200, 5.28805}, +{36.0956, 2.73509, 5.79166}, +{36.6794, 2.48204, 6.36260}, +{37.2727, 2.28115, 6.98982}, +{37.8755, 2.13539, 7.67888}, +{38.4882, 2.05422, 8.43889}, +{39.1107, 2.06392, 9.27839}, +{39.7432, 2.19777, 10.2014}, +{40.3861, 2.52791, 11.2163}, +{41.0393, 3.26794, 12.1550}, +{41.7031, 3.96550, 12.6741}, +{42.3776, 4.59642, 13.2155}, +{43.0630, 5.25938, 13.7799}, +{43.7595, 6.06673, 14.3685}, +{44.4673, 7.15541, 14.7247}, +{45.1865, 8.06647, 14.8731}, +{45.9174, 8.95055, 15.0230}, +{46.6600, 9.98348, 15.0570}, +{47.4147, 10.8760, 14.8457}, +{48.1816, 11.6865, 14.6375}, +{48.9609, 12.5301, 14.4321}, +{49.7528, 13.3208, 13.9515}, +{50.5576, 13.9335, 13.4612}, +{51.3753, 14.4517, 12.9882}, +{52.2062, 14.9074, 12.5318}, +{53.0506, 15.3195, 12.0914}, +{53.9087, 15.7050, 11.6666}, +{54.7806, 16.1001, 11.2566}, +{55.6667, 16.5038, 10.7337}, +{56.5670, 16.7820, 10.1849}, +{57.4820, 16.9823, 9.66409}, +{58.4117, 17.1365, 9.16995}, +{59.3564, 17.2544, 8.70107}, +{60.3165, 17.3434, 8.25615}, +{61.2921, 17.4092, 7.83399}, +{62.2834, 17.4566, 7.43342}, +{63.2908, 17.4906, 7.05334}, +{64.3145, 17.5177, 6.69268}, +{65.3547, 17.5522, 6.35047}, +{66.4118, 17.6114, 5.96761}, +{67.4859, 17.5947, 5.55969}, +{68.5775, 17.5375, 5.17967}, +{69.6867, 17.4554, 4.82561}, +{70.8138, 17.3554, 4.49577}, +{71.9591, 17.2420, 4.18845}, +{73.1230, 17.1181, 3.90216}, +{74.3057, 16.9860, 3.63543}, +{75.5076, 16.8475, 3.38693}, +{76.7289, 16.7039, 3.15543}, +{77.9699, 16.5562, 2.93974}, +{79.2310, 16.4052, 2.73880}, +{80.5125, 16.2514, 2.55158}, +{81.8147, 16.0948, 2.37718}, +{83.1380, 15.9365, 2.21690}, +{84.4827, 15.7779, 2.06768}, +{85.8491, 15.6181, 1.92850}, +{87.2377, 15.4565, 1.79868}, +{88.6487, 15.2920, 1.67761}, +{90.0825, 15.1220, 1.56468}, +{91.5395, 14.9363, 1.46227}, +{93.0201, 14.7601, 1.40457}, +{94.5246, 14.5998, 1.34915}, +{96.0535, 14.4478, 1.29591}, +{97.6071, 14.2981, 1.24477}, +{99.1858, 14.1438, 1.19777}, +{100.790, 13.9945, 1.16430}, +{102.420, 13.8498, 1.13176}, +{104.077, 13.7032, 1.10013}, +{105.760, 13.5437, 1.06939}, +{107.471, 13.3816, 1.07218}, +{109.209, 13.2370, 1.08333}, +{110.975, 13.0987, 1.09459}, +{112.770, 12.9532, 1.11384}, +{114.594, 12.8221, 1.14709}, +{116.448, 12.7017, 1.18133}, +{118.331, 12.5868, 1.21660}, +{120.245, 12.4764, 1.25291}, +{122.190, 12.3698, 1.29031}, +{124.166, 12.2667, 1.32867}, +{126.175, 12.1658, 1.36708}, +{128.215, 12.0663, 1.40659}, +{130.289, 11.9683, 1.44725}, +{132.397, 11.8712, 1.48908}, +{134.538, 11.7749, 1.53212}, +{136.714, 11.6787, 1.57641}, +{138.925, 11.5811, 1.62198}, +{141.172, 11.4842, 1.67427}, +{143.456, 11.3900, 1.72873}, +{145.776, 11.2983, 1.78495}, +{148.134, 11.2085, 1.84301}, +{150.530, 11.1211, 1.90295}, +{152.964, 11.0376, 1.96484}, +{155.439, 10.9673, 2.02402}, +{157.953, 10.8910, 2.06823}, +{160.507, 10.8084, 2.11340}, +{163.103, 10.7276, 2.15555}, +{165.742, 10.6383, 2.19107}, +{168.422, 10.5431, 2.22718}, +{171.146, 10.4453, 2.26003}, +{173.915, 10.3376, 2.28923}, +{176.727, 10.2207, 2.31881}, +{179.586, 10.0957, 2.34876}, +{182.491, 9.96418, 2.37833}, +{185.442, 9.82172, 2.40462}, +{188.442, 9.66765, 2.43120}, +{191.489, 9.50593, 2.45405}, +{194.587, 9.32174, 2.46796}, +{197.734, 9.11382, 2.48195}, +{200.932, 8.87904, 2.49599}, +{204.182, 8.60621, 2.51017}, +{207.485, 8.29996, 2.55152}, +{210.840, 7.96033, 2.60936}, +{214.251, 7.58484, 2.68466}, +{217.716, 7.17890, 2.78788}, +{221.237, 6.72273, 2.89582}, +{224.816, 6.13684, 3.05103}, +{228.452, 5.46449, 3.34436}, +{232.147, 4.98261, 3.86531}, +{235.902, 4.38764, 4.21362}, +{239.717, 3.52232, 4.62653}, +{243.595, 2.71932, 5.79938}, +{247.535, 2.36222, 7.04256}, +{251.538, 2.24801, 8.24308}, +{255.607, 2.28168, 9.40395}, +{259.741, 2.52620, 10.5460}, +{263.942, 3.08531, 11.6008}, +{268.211, 3.58823, 12.3003}, +{272.549, 4.04744, 12.9392}, +{276.957, 4.53703, 13.5292}, +{281.437, 4.96971, 14.0442}, +{285.989, 5.40775, 14.5843}, +{290.615, 5.92008, 15.0301}, +{295.315, 6.32717, 15.3597}, +{300.092, 6.63434, 15.6965}, +{304.945, 6.87952, 16.1973}, +{309.878, 7.35390, 16.7693}, +{314.890, 7.82277, 17.1064}, +{319.983, 8.23404, 17.4502}, +{325.158, 8.61637, 17.8009}, +{330.418, 8.96402, 18.1587}, +{335.762, 9.35833, 18.6361}, +{341.192, 9.87946, 19.0571}, +{346.711, 10.3664, 19.3710}, +{352.319, 10.8277, 19.6901}, +{358.017, 11.2871, 20.0145}, +{363.808, 11.7541, 20.3441}, +{369.692, 12.2357, 20.6793}, +{375.672, 12.7393, 21.0199}, +{381.748, 13.2757, 21.3661}, +{387.922, 13.8763, 21.7181}, +{394.197, 14.5141, 21.9808}, +{400.573, 15.1508, 22.2255}, +{407.052, 15.8718, 22.4729}, +{413.635, 16.5789, 22.5438}, +{420.326, 17.2186, 22.6054}, +{427.124, 17.8387, 22.6671}, +{434.032, 18.4869, 22.7290}, +{441.052, 19.1433, 22.7086}, +{448.186, 19.7381, 22.6427}, +{455.435, 20.2941, 22.5770}, +{462.802, 20.8257, 22.5115}, +{470.287, 21.3387, 22.4462}, +{477.894, 21.8112, 22.3811}, +{485.623, 22.2891, 22.3789}, +{493.478, 22.8033, 22.3835}, +{501.459, 23.3452, 22.3880}, +{509.570, 23.9799, 22.3913}, +{517.812, 24.6022, 22.2496}, +{526.187, 25.1768, 22.1088}, +{534.698, 25.7472, 21.9689}, +{543.346, 26.3720, 21.8299}, +{552.134, 27.0518, 21.5715}, +{561.065, 27.6165, 21.1880}, +{570.139, 28.0979, 20.8114}, +{579.361, 28.5302, 20.4415}, +{588.732, 28.9301, 20.0746}, +{598.254, 29.2899, 19.7025}, +{607.930, 29.6135, 19.3373}, +{617.763, 29.9047, 18.9789}, +{627.755, 30.1654, 18.6271}, +{637.908, 30.3480, 18.2925}, +{648.226, 30.5404, 18.0496}, +{658.711, 30.7638, 17.8099}, +{669.365, 30.9905, 17.5734}, +{680.191, 31.2172, 17.3400}, +{691.193, 31.4428, 17.1097}, +{702.372, 31.6667, 16.8825}, +{713.733, 31.8890, 16.6583}, +{725.277, 32.1104, 16.4371}, +{737.008, 32.3318, 16.2188}, +{748.928, 32.5550, 16.0035}, +{761.042, 32.7821, 15.7909}, +{773.351, 33.0308, 15.5813}, +{785.859, 33.2961, 15.3381}, +{798.570, 33.5361, 15.0640}, +{811.486, 33.7736, 14.7948}, +{824.611, 34.0024, 14.4768}, +{837.949, 34.1897, 14.1424}, +{851.502, 34.3366, 13.8157}, +{865.274, 34.4592, 13.4965}, +{879.269, 34.5342, 13.1848}, +{893.491, 34.5958, 12.9371}, +{907.943, 34.6928, 12.7188}, +{922.628, 34.8570, 12.5041}, +{937.551, 34.9257, 12.1555}, +{952.715, 34.9654, 11.8986}, +{968.124, 34.9741, 11.6472}, +{983.783, 34.9950, 11.4876}, +{999.695, 35.0943, 11.3353}, +{1015.86, 35.2017, 11.1200}, +{1032.29, 35.2839, 10.8972}, +{1048.99, 35.3556, 10.6752}, +{1065.96, 35.4160, 10.4537}, +{1083.20, 35.4677, 10.2369}, +{1100.72, 35.5128, 10.0246}, +{1118.52, 35.5522, 9.81674}, +{1136.61, 35.5866, 9.61307}, +{1155.00, 35.6163, 9.41366}, +{1173.68, 35.6418, 9.21848}, +{1192.66, 35.6635, 9.02723}, +{1211.95, 35.6816, 8.83994}, +{1231.55, 35.6972, 8.65656}, +{1251.47, 35.7102, 8.47506}, +{1271.72, 35.7200, 8.29514}, +{1292.29, 35.7240, 8.11632}, +{1313.19, 35.7228, 7.94141}, +{1334.43, 35.7173, 7.77029}, +{1356.01, 35.7079, 7.60290}, +{1377.94, 35.6948, 7.43905}, +{1400.23, 35.6781, 7.27870}, +{1422.88, 35.6580, 7.12177}, +{1445.89, 35.6350, 6.96833}, +{1469.28, 35.6096, 6.81748}, +{1493.04, 35.5820, 6.66877}, +{1517.19, 35.5493, 6.51861}, +{1541.73, 35.5106, 6.37117}, +{1566.67, 35.4662, 6.22706}, +{1592.01, 35.4169, 6.08625}, +{1617.76, 35.3628, 5.94857}, +{1643.92, 35.3036, 5.81385}, +{1670.51, 35.2393, 5.68241}, +{1697.53, 35.1700, 5.55395}, +{1724.99, 35.0963, 5.42832}, +{1752.89, 35.0166, 5.30368}, +{1781.24, 34.9297, 5.18132}, +{1810.05, 34.8355, 5.06139}, +{1839.32, 34.7331, 4.94403}, +{1869.07, 34.6223, 4.82942}, +{1899.30, 34.5023, 4.71761}, +{1930.02, 34.3724, 4.60846}, +{1961.24, 34.2314, 4.50180}, +{1992.96, 34.0775, 4.39749}, +{2025.20, 33.9109, 4.29715}, +{2057.95, 33.7284, 4.19672}, +{2091.24, 33.5261, 4.09845}, +{2125.06, 33.3013, 4.00232}, +{2159.43, 33.0497, 3.90828}, +{2194.36, 32.7655, 3.81630}, +{2229.85, 32.4408, 3.72636}, +{2265.92, 32.0646, 3.63842}, +{2302.57, 31.6204, 3.55241}, +{2339.81, 31.0823, 3.46834}, +{2377.66, 30.4063, 3.38614}, +{2416.11, 29.5065, 3.30575}, +{2455.19, 28.1757, 3.22718}, +{2494.90, 25.5859, 3.15040}, +{2520.10, 11.2625, 3.10325}, +{2520.30, 11.2642, 11.2040}, +{2535.26, 24.0587, 11.1085}, +{2576.26, 26.8680, 10.8536}, +{2617.93, 26.0422, 10.6044}, +{2625.00, 20.8981, 10.5631}, +{2625.20, 20.9044, 14.4992}, +{2660.27, 29.0866, 14.2329}, +{2703.30, 30.8118, 13.9174}, +{2747.03, 31.8814, 13.6091}, +{2791.46, 32.5876, 13.3074}, +{2836.61, 32.8679, 13.0125}, +{2865.40, 30.1655, 12.8303}, +{2865.60, 30.1688, 14.5800}, +{2882.49, 33.2789, 14.4619}, +{2929.11, 34.6192, 14.1444}, +{2976.48, 35.4578, 13.8306}, +{3024.63, 36.1273, 13.5216}, +{3073.55, 36.6961, 13.2160}, +{3123.26, 37.1931, 12.9152}, +{3173.78, 37.6349, 12.6192}, +{3225.11, 38.0318, 12.3278}, +{3277.27, 38.3913, 12.0411}, +{3330.28, 38.7182, 11.7583}, +{3384.15, 39.0164, 11.4808}, +{3438.88, 39.2896, 11.2081}, +{3494.50, 39.5404, 10.9403}, +{3551.02, 39.7714, 10.6777}, +{3608.46, 39.9842, 10.4195}, +{3666.82, 40.1806, 10.1664}, +{3726.13, 40.3615, 9.91778}, +{3786.40, 40.5288, 9.67476}, +{3847.64, 40.6834, 9.43567}, +{3909.87, 40.8259, 9.20177}, +{3973.11, 40.9575, 8.97269}, +{4037.38, 41.0791, 8.74823}, +{4102.68, 41.1911, 8.52848}, +{4169.03, 41.2943, 8.31339}, +{4236.46, 41.3893, 8.10299}, +{4304.98, 41.4767, 7.89703}, +{4374.62, 41.5569, 7.69556}, +{4445.37, 41.6302, 7.49855}, +{4517.27, 41.6974, 7.30603}, +{4590.33, 41.7587, 7.11781}, +{4664.58, 41.8144, 6.93374}, +{4740.03, 41.8649, 6.75402}, +{4816.69, 41.9105, 6.57842}, +{4894.60, 41.9517, 6.40683}, +{4973.77, 41.9884, 6.23928}, +{5054.21, 42.0212, 6.07566}, +{5135.96, 42.0501, 5.91595}, +{5219.03, 42.0755, 5.76013}, +{5303.44, 42.0975, 5.60790}, +{5389.22, 42.1164, 5.45944}, +{5476.39, 42.1323, 5.31458}, +{5564.97, 42.1454, 5.17329}, +{5654.98, 42.1560, 5.03544}, +{5746.44, 42.1641, 4.90096}, +{5839.39, 42.1699, 4.76981}, +{5933.83, 42.1735, 4.64199}, +{6029.81, 42.1751, 4.51733}, +{6127.33, 42.1747, 4.39583}, +{6226.44, 42.1726, 4.27741}, +{6327.15, 42.1689, 4.16196}, +{6429.48, 42.1635, 4.04943}, +{6533.48, 42.1566, 3.93987}, +{6639.15, 42.1485, 3.83309}, +{6746.54, 42.1391, 3.72901}, +{6855.65, 42.1284, 3.62760}, +{6966.54, 42.1165, 3.52884}, +{7079.22, 42.1037, 3.43266}, +{7193.72, 42.0898, 3.33892}, +{7310.07, 42.0750, 3.24771}, +{7428.31, 42.0593, 3.15890}, +{7548.45, 42.0429, 3.07241}, +{7670.54, 42.0257, 2.98818}, +{7794.61, 42.0078, 2.90621}, +{7920.68, 41.9892, 2.82643}, +{8048.79, 41.9701, 2.74870}, +{8178.98, 41.9504, 2.67295}, +{8311.26, 41.9300, 2.59939}, +{8445.69, 41.9093, 2.52772}, +{8582.29, 41.8880, 2.45790}, +{8721.11, 41.8662, 2.39011}, +{8862.16, 41.8441, 2.32416}, +{9005.50, 41.8217, 2.25988}, +{9151.16, 41.7988, 2.19726}, +{9299.17, 41.7755, 2.13639}, +{9449.58, 41.7519, 2.07724}, +{9602.42, 41.7279, 2.01966}, +{9757.73, 41.7037, 1.96363}, +{9915.55, 41.6792, 1.90914}, +{10075.9, 41.6543, 1.85612}, +{10238.9, 41.6292, 1.80455}, +{10404.5, 41.6037, 1.75438}, +{10572.8, 41.5779, 1.70558}, +{10743.8, 41.5519, 1.65812}, +{10917.6, 41.5255, 1.61196}, +{11094.2, 41.4988, 1.56706}, +{11273.6, 41.4717, 1.52340}, +{11455.9, 41.4443, 1.48093}, +{11641.2, 41.4165, 1.43963}, +{11829.5, 41.3882, 1.39947}, +{12020.8, 41.3596, 1.36041}, +{12215.3, 41.3304, 1.32243}, +{12412.8, 41.3008, 1.28549}, +{12613.6, 41.2706, 1.24958}, +{12817.6, 41.2397, 1.21465}, +{13025.0, 41.2082, 1.18069}, +{13235.6, 41.1759, 1.14767}, +{13449.7, 41.1428, 1.11556}, +{13667.2, 41.1088, 1.08434}, +{13888.3, 41.0737, 1.05399}, +{14112.9, 41.0375, 1.02447}, +{14341.2, 41.0000, 0.995771}, +{14573.1, 40.9610, 0.967867}, +{14808.9, 40.9203, 0.940736}, +{15048.4, 40.8777, 0.914356}, +{15291.8, 40.8330, 0.888708}, +{15539.1, 40.7858, 0.863772}, +{15790.4, 40.7356, 0.839525}, +{16045.8, 40.6821, 0.815952}, +{16305.4, 40.6246, 0.793031}, +{16569.1, 40.5623, 0.770747}, +{16837.1, 40.4944, 0.749079}, +{17109.4, 40.4194, 0.728013}, +{17386.1, 40.3357, 0.707531}, +{17667.4, 40.2409, 0.687616}, +{17953.1, 40.1317, 0.668253}, +{18243.5, 40.0030, 0.649426}, +{18538.6, 39.8467, 0.631122}, +{18838.4, 39.6487, 0.613324}, +{19143.1, 39.3813, 0.596019}, +{19452.7, 38.9768, 0.579192}, +{19767.4, 38.1753, 0.562831}, +{19999.4, 30.4363, 0.551223}, +{19999.6, 30.4365, 3.71537}, +{20087.1, 37.2967, 3.68993}, +{20412.0, 38.9275, 3.59790}, +{20742.1, 39.5664, 3.50767}, +{21077.6, 39.9762, 3.41921}, +{21418.5, 40.2786, 3.33253}, +{21765.0, 40.5177, 3.24761}, +{22117.0, 40.7145, 3.16445}, +{22474.7, 40.8808, 3.08304}, +{22838.2, 41.0239, 3.00335}, +{23207.6, 41.1488, 2.92538}, +{23583.0, 41.2589, 2.84910}, +{23964.4, 41.3568, 2.77450}, +{24352.0, 41.4442, 2.70156}, +{24745.9, 41.5227, 2.63027}, +{25146.2, 41.5935, 2.56058}, +{25552.9, 41.6574, 2.49250}, +{25966.2, 41.7154, 2.42599}, +{26386.1, 41.7681, 2.36102}, +{26812.9, 41.8160, 2.29759}, +{27246.6, 41.8596, 2.23565}, +{27687.3, 41.8992, 2.17520}, +{28135.1, 41.9354, 2.11620}, +{28590.2, 41.9683, 2.05863}, +{29052.6, 41.9983, 2.00246}, +{29522.5, 42.0256, 1.94767}, +{30000.0, 42.0503, 1.89423}, +{0, 0, 0} +}; + +e_fp_fdp tc[] = { /* Z = 43 */ +{10.0000, -9999.00, 1.16890}, +{10.1617, -9999.00, 1.22630}, +{10.3261, -9999.00, 1.28651}, +{10.4931, -9999.00, 1.34968}, +{10.6628, -9999.00, 1.41595}, +{10.8353, -9999.00, 1.48547}, +{11.0106, -9999.00, 1.55841}, +{11.1886, -9999.00, 1.63493}, +{11.3696, -9999.00, 1.71520}, +{11.5535, -9999.00, 1.79060}, +{11.7404, -9999.00, 1.85821}, +{11.9303, -9999.00, 1.92837}, +{12.1232, -9999.00, 2.00119}, +{12.3193, -9999.00, 2.07675}, +{12.5186, -9999.00, 2.15643}, +{12.7210, -9999.00, 2.24083}, +{12.9268, -9999.00, 2.32854}, +{13.1359, -9999.00, 2.41967}, +{13.3483, -9999.00, 2.51072}, +{13.5642, -9999.00, 2.59715}, +{13.7836, -9999.00, 2.68656}, +{14.0066, -9999.00, 2.77904}, +{14.2331, -9999.00, 2.87471}, +{14.4633, -9999.00, 2.97073}, +{14.6973, -9999.00, 3.06680}, +{14.9350, -9999.00, 3.16598}, +{15.1765, -9999.00, 3.26836}, +{15.4220, -9999.00, 3.37406}, +{15.6714, -9999.00, 3.46886}, +{15.9249, -9999.00, 3.54805}, +{16.1825, -9999.00, 3.62904}, +{16.4442, -9999.00, 3.71188}, +{16.7102, -9999.00, 3.79661}, +{16.9805, -9999.00, 3.88292}, +{17.2551, -9999.00, 3.96908}, +{17.5342, -9999.00, 4.05715}, +{17.8178, -9999.00, 4.14718}, +{18.1060, -9999.00, 4.23920}, +{18.3989, -9999.00, 4.33326}, +{18.6964, -9999.00, 4.42942}, +{18.9988, -9999.00, 4.52770}, +{19.3061, -9999.00, 4.58174}, +{19.6184, -9999.00, 4.63623}, +{19.9357, -9999.00, 4.69149}, +{20.2582, -9999.00, 4.74862}, +{20.5858, -9999.00, 4.80646}, +{20.9188, -9999.00, 4.86499}, +{21.2571, -9999.00, 4.92424}, +{21.6009, -9999.00, 4.98421}, +{21.9503, -9999.00, 5.04491}, +{22.3053, -9999.00, 5.10635}, +{22.6661, -9999.00, 5.16504}, +{23.0327, -9999.00, 5.19243}, +{23.4053, -9999.00, 5.21996}, +{23.7838, -9999.00, 5.24765}, +{24.1685, -9999.00, 5.27548}, +{24.5594, -9999.00, 5.30345}, +{24.9566, -9999.00, 5.30974}, +{25.3603, -9999.00, 5.29950}, +{25.7705, -9999.00, 5.28929}, +{26.1873, -9999.00, 5.27909}, +{26.6109, -9999.00, 5.26892}, +{27.0413, -9999.00, 5.25876}, +{27.4786, -9999.00, 5.22652}, +{27.9231, -9999.00, 5.16540}, +{28.3747, -9999.00, 5.10500}, +{28.8337, -9999.00, 5.04531}, +{29.3000, 7.37166, 4.98631}, +{29.7739, 7.43509, 4.92525}, +{30.2555, 7.48267, 4.81345}, +{30.7449, 7.49547, 4.70419}, +{31.2421, 7.48578, 4.59741}, +{31.7475, 7.46206, 4.48968}, +{32.2609, 7.41243, 4.36859}, +{32.7827, 7.33520, 4.25077}, +{33.3130, 7.23723, 4.12859}, +{33.8518, 7.08784, 3.99000}, +{34.3993, 6.87034, 3.86322}, +{34.9557, 6.61076, 3.78904}, +{35.5211, 6.29120, 3.73288}, +{36.0956, 5.94067, 3.75422}, +{36.6794, 5.51899, 3.83128}, +{37.2727, 5.09533, 3.97773}, +{37.8755, 4.58341, 4.26742}, +{38.4882, 4.18756, 4.68469}, +{39.1107, 3.85000, 5.14275}, +{39.7432, 3.52904, 5.64560}, +{40.3861, 3.18421, 6.22739}, +{41.0393, 2.92130, 6.99385}, +{41.7031, 2.78250, 7.85463}, +{42.3776, 2.81406, 8.82136}, +{43.0630, 3.15931, 9.80863}, +{43.7595, 3.57313, 10.5860}, +{44.4673, 4.11858, 11.3361}, +{45.1865, 4.67136, 12.0004}, +{45.9174, 5.35619, 12.7037}, +{46.6600, 6.10311, 13.1431}, +{47.4147, 6.84115, 13.5966}, +{48.1816, 7.72059, 13.9698}, +{48.9609, 8.53817, 14.1836}, +{49.7528, 9.36473, 14.4007}, +{50.5576, 10.3179, 14.6211}, +{51.3753, 11.3579, 14.4911}, +{52.2062, 12.1996, 14.2552}, +{53.0506, 12.9725, 14.0231}, +{53.9087, 13.7587, 13.7948}, +{54.7806, 14.7200, 13.4012}, +{55.6667, 15.3820, 12.6585}, +{56.5670, 15.7699, 11.9812}, +{57.4820, 16.0790, 11.4817}, +{58.4117, 16.3730, 11.0031}, +{59.3564, 16.6473, 10.5443}, +{60.3165, 16.8862, 10.0809}, +{61.2921, 17.0869, 9.63785}, +{62.2834, 17.2599, 9.21431}, +{63.2908, 17.4121, 8.80939}, +{64.3145, 17.5505, 8.42224}, +{65.3547, 17.6871, 8.05212}, +{66.4118, 17.8566, 7.65887}, +{67.4859, 17.9548, 7.21569}, +{68.5775, 18.0080, 6.79817}, +{69.6867, 18.0407, 6.40480}, +{70.8138, 18.0880, 5.99628}, +{71.9591, 18.0544, 5.56111}, +{73.1230, 17.9623, 5.15754}, +{74.3057, 17.8236, 4.82222}, +{75.5076, 17.7002, 4.53199}, +{76.7289, 17.5808, 4.25922}, +{77.9699, 17.4518, 4.00287}, +{79.2310, 17.2983, 3.78562}, +{80.5125, 17.1776, 3.60675}, +{81.8147, 17.0829, 3.43634}, +{83.1380, 17.0235, 3.26444}, +{84.4827, 16.9418, 3.02963}, +{85.8491, 16.8264, 2.81171}, +{87.2377, 16.6882, 2.61612}, +{88.6487, 16.5482, 2.43998}, +{90.0825, 16.4067, 2.27569}, +{91.5395, 16.2646, 2.12247}, +{93.0201, 16.1165, 1.96821}, +{94.5246, 15.9571, 1.82456}, +{96.0535, 15.7841, 1.69140}, +{97.6071, 15.6045, 1.58592}, +{99.1858, 15.4315, 1.49249}, +{100.790, 15.2549, 1.40456}, +{102.420, 15.0546, 1.33154}, +{104.077, 14.8707, 1.30103}, +{105.760, 14.6982, 1.27522}, +{107.471, 14.5376, 1.26046}, +{109.209, 14.3801, 1.24587}, +{110.975, 14.2249, 1.24819}, +{112.770, 14.0799, 1.25535}, +{114.594, 13.9359, 1.27065}, +{116.448, 13.8044, 1.29476}, +{118.331, 13.6800, 1.31933}, +{120.245, 13.5563, 1.34512}, +{122.190, 13.4387, 1.38077}, +{124.166, 13.3280, 1.41738}, +{126.175, 13.2213, 1.45495}, +{128.215, 13.1149, 1.49352}, +{130.289, 13.0121, 1.54153}, +{132.397, 12.9165, 1.59194}, +{134.538, 12.8263, 1.64400}, +{136.714, 12.7415, 1.69776}, +{138.925, 12.6648, 1.75328}, +{141.172, 12.5929, 1.79879}, +{143.456, 12.5184, 1.84304}, +{145.776, 12.4431, 1.88838}, +{148.134, 12.3683, 1.93426}, +{150.530, 12.2939, 1.98095}, +{152.964, 12.2204, 2.02877}, +{155.439, 12.1481, 2.07774}, +{157.953, 12.0781, 2.12790}, +{160.507, 12.0151, 2.17926}, +{163.103, 11.9537, 2.21750}, +{165.742, 11.8853, 2.25297}, +{168.422, 11.8136, 2.28901}, +{171.146, 11.7411, 2.32562}, +{173.915, 11.6743, 2.35799}, +{176.727, 11.5967, 2.37664}, +{179.586, 11.5091, 2.39544}, +{182.491, 11.4135, 2.41439}, +{185.442, 11.3103, 2.43358}, +{188.442, 11.1999, 2.45303}, +{191.489, 11.0817, 2.47264}, +{194.587, 10.9557, 2.49239}, +{197.734, 10.8223, 2.51232}, +{200.932, 10.6781, 2.52681}, +{204.182, 10.5201, 2.54117}, +{207.485, 10.3473, 2.55562}, +{210.840, 10.1584, 2.57015}, +{214.251, 9.95073, 2.58566}, +{217.716, 9.72317, 2.60238}, +{221.237, 9.47149, 2.61921}, +{224.816, 9.18736, 2.63637}, +{228.452, 8.86388, 2.66524}, +{232.147, 8.50599, 2.70937}, +{235.902, 8.06419, 2.76557}, +{239.717, 7.60929, 2.91946}, +{243.595, 7.14670, 3.08193}, +{247.535, 6.61980, 3.25343}, +{251.538, 6.05436, 3.53883}, +{255.607, 5.47050, 3.83335}, +{259.741, 4.70238, 4.19080}, +{263.942, 3.87048, 4.73985}, +{268.211, 3.08638, 5.62785}, +{272.549, 2.42175, 6.68223}, +{276.957, 1.92526, 7.92684}, +{281.437, 1.74073, 9.37968}, +{285.989, 1.78665, 10.6247}, +{290.615, 2.10913, 11.9587}, +{295.315, 2.46263, 12.9300}, +{300.092, 2.86646, 13.9802}, +{304.945, 3.37108, 14.9000}, +{309.878, 3.87091, 15.7829}, +{314.890, 4.54441, 16.6537}, +{319.983, 5.19136, 17.3545}, +{325.158, 5.95551, 18.0167}, +{330.418, 6.63523, 18.4930}, +{335.762, 7.24587, 18.9772}, +{341.192, 7.84397, 19.4489}, +{346.711, 8.44774, 19.9324}, +{352.319, 9.09472, 20.4280}, +{358.017, 9.90055, 20.8365}, +{363.808, 10.6174, 21.0751}, +{369.692, 11.2407, 21.3163}, +{375.672, 11.8406, 21.5604}, +{381.748, 12.4293, 21.8145}, +{387.922, 13.0240, 22.0754}, +{394.197, 13.6347, 22.3394}, +{400.573, 14.2715, 22.6065}, +{407.052, 15.0272, 22.8768}, +{413.635, 15.7847, 22.9370}, +{420.326, 16.4398, 22.9562}, +{427.124, 17.0414, 22.9755}, +{434.032, 17.5885, 22.9948}, +{441.052, 18.0684, 23.0874}, +{448.186, 18.6886, 23.3023}, +{455.435, 19.5037, 23.3851}, +{462.802, 20.1795, 23.2504}, +{470.287, 20.7707, 23.1337}, +{477.894, 21.3262, 23.0176}, +{485.623, 21.8514, 22.9022}, +{493.478, 22.3522, 22.7873}, +{501.459, 22.8295, 22.6726}, +{509.570, 23.2798, 22.5590}, +{517.812, 23.6778, 22.4631}, +{526.187, 24.0509, 22.4272}, +{534.698, 24.4514, 22.5047}, +{543.346, 24.9815, 22.6391}, +{552.134, 25.6947, 22.7740}, +{561.065, 26.5180, 22.6037}, +{570.139, 27.2204, 22.2880}, +{579.361, 27.7809, 21.9535}, +{588.732, 28.2829, 21.6284}, +{598.254, 28.7466, 21.3108}, +{607.930, 29.1808, 20.9975}, +{617.763, 29.5917, 20.6889}, +{627.755, 29.9881, 20.3837}, +{637.908, 30.3714, 20.0701}, +{648.226, 30.7344, 19.7407}, +{658.711, 31.0588, 19.4033}, +{669.365, 31.3427, 19.0713}, +{680.191, 31.5923, 18.7840}, +{691.193, 31.8512, 18.5308}, +{702.372, 32.1444, 18.2862}, +{713.733, 32.4463, 18.0080}, +{725.277, 32.7185, 17.7091}, +{737.008, 32.9702, 17.4161}, +{748.928, 33.2089, 17.1277}, +{761.042, 33.4378, 16.8439}, +{773.351, 33.6602, 16.5626}, +{785.859, 33.8749, 16.2787}, +{798.570, 34.0751, 15.9937}, +{811.486, 34.2637, 15.7137}, +{824.611, 34.4433, 15.4387}, +{837.949, 34.6160, 15.1684}, +{851.502, 34.7824, 14.9002}, +{865.274, 34.9422, 14.6336}, +{879.269, 35.0929, 14.3691}, +{893.491, 35.2364, 14.1094}, +{907.943, 35.3747, 13.8543}, +{922.628, 35.5128, 13.6038}, +{937.551, 35.6445, 13.3446}, +{952.715, 35.7670, 13.0870}, +{968.124, 35.8789, 12.8314}, +{983.783, 35.9830, 12.5809}, +{999.695, 36.0816, 12.3345}, +{1015.86, 36.1768, 12.0919}, +{1032.29, 36.2652, 11.8464}, +{1048.99, 36.3460, 11.6034}, +{1065.96, 36.4173, 11.3628}, +{1083.20, 36.4809, 11.1272}, +{1100.72, 36.5380, 10.8965}, +{1118.52, 36.5893, 10.6705}, +{1136.61, 36.6350, 10.4491}, +{1155.00, 36.6756, 10.2323}, +{1173.68, 36.7115, 10.0201}, +{1192.66, 36.7429, 9.81229}, +{1211.95, 36.7699, 9.60876}, +{1231.55, 36.7927, 9.40949}, +{1251.47, 36.8116, 9.21458}, +{1271.72, 36.8267, 9.02398}, +{1292.29, 36.8386, 8.83764}, +{1313.19, 36.8472, 8.65498}, +{1334.43, 36.8526, 8.47613}, +{1356.01, 36.8549, 8.30103}, +{1377.94, 36.8542, 8.12948}, +{1400.23, 36.8505, 7.96152}, +{1422.88, 36.8444, 7.79715}, +{1445.89, 36.8361, 7.63613}, +{1469.28, 36.8264, 7.47744}, +{1493.04, 36.8155, 7.32056}, +{1517.19, 36.7998, 7.16085}, +{1541.73, 36.7780, 7.00379}, +{1566.67, 36.7505, 6.85016}, +{1592.01, 36.7187, 6.70009}, +{1617.76, 36.6827, 6.55328}, +{1643.92, 36.6427, 6.40959}, +{1670.51, 36.5983, 6.26893}, +{1697.53, 36.5498, 6.13145}, +{1724.99, 36.4984, 5.99714}, +{1752.89, 36.4425, 5.86328}, +{1781.24, 36.3807, 5.73151}, +{1810.05, 36.3129, 5.60197}, +{1839.32, 36.2387, 5.47539}, +{1869.07, 36.1582, 5.35178}, +{1899.30, 36.0715, 5.23118}, +{1930.02, 35.9779, 5.11290}, +{1961.24, 35.8765, 4.99737}, +{1992.96, 35.7666, 4.88481}, +{2025.20, 35.6501, 4.77624}, +{2057.95, 35.5241, 4.66695}, +{2091.24, 35.3858, 4.55979}, +{2125.06, 35.2346, 4.45478}, +{2159.43, 35.0688, 4.35192}, +{2194.36, 34.8864, 4.25115}, +{2229.85, 34.6844, 4.15241}, +{2265.92, 34.4595, 4.05568}, +{2302.57, 34.2072, 3.96096}, +{2339.81, 33.9212, 3.86811}, +{2377.66, 33.5934, 3.77722}, +{2416.11, 33.2118, 3.68816}, +{2455.19, 32.7585, 3.60095}, +{2494.90, 32.2052, 3.51552}, +{2535.26, 31.5020, 3.43186}, +{2576.26, 30.5482, 3.34994}, +{2617.93, 29.0794, 3.26969}, +{2660.27, 25.7283, 3.19110}, +{2676.80, 12.8319, 3.16127}, +{2677.00, 12.8336, 11.0693}, +{2703.30, 26.6708, 10.9097}, +{2747.03, 28.4483, 10.6527}, +{2791.46, 25.6981, 10.4016}, +{2793.10, 22.1757, 10.3925}, +{2793.30, 22.1803, 14.3074}, +{2836.61, 30.6058, 14.0749}, +{2882.49, 32.1711, 13.8366}, +{2929.11, 33.1956, 13.6029}, +{2976.48, 33.9061, 13.3728}, +{3024.63, 34.1676, 13.1468}, +{3042.40, 32.2661, 13.0652}, +{3042.60, 32.2700, 14.3922}, +{3073.55, 35.1555, 14.1871}, +{3123.26, 36.1763, 13.8680}, +{3173.78, 36.9158, 13.5539}, +{3225.11, 37.5266, 13.2442}, +{3277.27, 38.0531, 12.9395}, +{3330.28, 38.5172, 12.6397}, +{3384.15, 38.9310, 12.3443}, +{3438.88, 39.3038, 12.0547}, +{3494.50, 39.6418, 11.7696}, +{3551.02, 39.9493, 11.4895}, +{3608.46, 40.2303, 11.2147}, +{3666.82, 40.4876, 10.9448}, +{3726.13, 40.7241, 10.6805}, +{3786.40, 40.9421, 10.4208}, +{3847.64, 41.1421, 10.1656}, +{3909.87, 41.3263, 9.91610}, +{3973.11, 41.4964, 9.67151}, +{4037.38, 41.6533, 9.43192}, +{4102.68, 41.7980, 9.19719}, +{4169.03, 41.9315, 8.96736}, +{4236.46, 42.0546, 8.74243}, +{4304.98, 42.1681, 8.52225}, +{4374.62, 42.2725, 8.30675}, +{4445.37, 42.3686, 8.09594}, +{4517.27, 42.4568, 7.88983}, +{4590.33, 42.5378, 7.68828}, +{4664.58, 42.6119, 7.49120}, +{4740.03, 42.6797, 7.29860}, +{4816.69, 42.7415, 7.11047}, +{4894.60, 42.7978, 6.92660}, +{4973.77, 42.8488, 6.74687}, +{5054.21, 42.8948, 6.57146}, +{5135.96, 42.9363, 6.40008}, +{5219.03, 42.9734, 6.23282}, +{5303.44, 43.0065, 6.06949}, +{5389.22, 43.0358, 5.91010}, +{5476.39, 43.0616, 5.75450}, +{5564.97, 43.0839, 5.60265}, +{5654.98, 43.1031, 5.45455}, +{5746.44, 43.1194, 5.30998}, +{5839.39, 43.1329, 5.16904}, +{5933.83, 43.1437, 5.03150}, +{6029.81, 43.1521, 4.89738}, +{6127.33, 43.1582, 4.76666}, +{6226.44, 43.1621, 4.63916}, +{6327.15, 43.1640, 4.51495}, +{6429.48, 43.1641, 4.39381}, +{6533.48, 43.1623, 4.27569}, +{6639.15, 43.1589, 4.16057}, +{6746.54, 43.1539, 4.04840}, +{6855.65, 43.1474, 3.93912}, +{6966.54, 43.1395, 3.83261}, +{7079.22, 43.1304, 3.72891}, +{7193.72, 43.1201, 3.62786}, +{7310.07, 43.1086, 3.52934}, +{7428.31, 43.0961, 3.43356}, +{7548.45, 43.0827, 3.34007}, +{7670.54, 43.0683, 3.24908}, +{7794.61, 43.0530, 3.16052}, +{7920.68, 43.0370, 3.07424}, +{8048.79, 43.0201, 2.99023}, +{8178.98, 43.0026, 2.90849}, +{8311.26, 42.9844, 2.82887}, +{8445.69, 42.9657, 2.75144}, +{8582.29, 42.9464, 2.67584}, +{8721.11, 42.9265, 2.60243}, +{8862.16, 42.9061, 2.53091}, +{9005.50, 42.8853, 2.46127}, +{9151.16, 42.8639, 2.39355}, +{9299.17, 42.8422, 2.32769}, +{9449.58, 42.8201, 2.26360}, +{9602.42, 42.7977, 2.20111}, +{9757.73, 42.7749, 2.14033}, +{9915.55, 42.7517, 2.08123}, +{10075.9, 42.7282, 2.02369}, +{10238.9, 42.7044, 1.96771}, +{10404.5, 42.6803, 1.91324}, +{10572.8, 42.6559, 1.86024}, +{10743.8, 42.6312, 1.80868}, +{10917.6, 42.6062, 1.75851}, +{11094.2, 42.5808, 1.70970}, +{11273.6, 42.5552, 1.66222}, +{11455.9, 42.5293, 1.61603}, +{11641.2, 42.5030, 1.57109}, +{11829.5, 42.4764, 1.52737}, +{12020.8, 42.4494, 1.48485}, +{12215.3, 42.4221, 1.44348}, +{12412.8, 42.3943, 1.40324}, +{12613.6, 42.3661, 1.36410}, +{12817.6, 42.3375, 1.32603}, +{13025.0, 42.3083, 1.28899}, +{13235.6, 42.2786, 1.25297}, +{13449.7, 42.2483, 1.21793}, +{13667.2, 42.2173, 1.18385}, +{13888.3, 42.1856, 1.15070}, +{14112.9, 42.1531, 1.11846}, +{14341.2, 42.1196, 1.08709}, +{14573.1, 42.0852, 1.05659}, +{14808.9, 42.0496, 1.02692}, +{15048.4, 42.0128, 0.998065}, +{15291.8, 41.9745, 0.969997}, +{15539.1, 41.9347, 0.942699}, +{15790.4, 41.8930, 0.916146}, +{16045.8, 41.8492, 0.890320}, +{16305.4, 41.8029, 0.865201}, +{16569.1, 41.7539, 0.840769}, +{16837.1, 41.7017, 0.817006}, +{17109.4, 41.6456, 0.793892}, +{17386.1, 41.5849, 0.771411}, +{17667.4, 41.5188, 0.749543}, +{17953.1, 41.4460, 0.728274}, +{18243.5, 41.3650, 0.707585}, +{18538.6, 41.2735, 0.687461}, +{18838.4, 41.1685, 0.667887}, +{19143.1, 41.0452, 0.648847}, +{19452.7, 40.8965, 0.630327}, +{19767.4, 40.7097, 0.612310}, +{20087.1, 40.4610, 0.594786}, +{20412.0, 40.0945, 0.577738}, +{20742.1, 39.4202, 0.561154}, +{21043.9, 31.5802, 0.546632}, +{21044.1, 31.5804, 3.65633}, +{21077.6, 37.3416, 3.64736}, +{21418.5, 39.8013, 3.55820}, +{21765.0, 40.4975, 3.47064}, +{22117.0, 40.9262, 3.38468}, +{22474.7, 41.2375, 3.30033}, +{22838.2, 41.4815, 3.21759}, +{23207.6, 41.6813, 3.13646}, +{23583.0, 41.8496, 3.05694}, +{23964.4, 41.9943, 2.97901}, +{24352.0, 42.1203, 2.90268}, +{24745.9, 42.2314, 2.82793}, +{25146.2, 42.3300, 2.75475}, +{25552.9, 42.4181, 2.68313}, +{25966.2, 42.4972, 2.61305}, +{26386.1, 42.5686, 2.54450}, +{26812.9, 42.6331, 2.47747}, +{27246.6, 42.6917, 2.41193}, +{27687.3, 42.7449, 2.34787}, +{28135.1, 42.7933, 2.28527}, +{28590.2, 42.8375, 2.22410}, +{29052.6, 42.8782, 2.16436}, +{29522.5, 42.9209, 2.10602}, +{30000.0, 42.9302, 2.04905}, +{0, 0, 0} +}; + +e_fp_fdp ru[] = { /* Z = 44 */ +{10.0000, -9999.00, 1.22049}, +{10.1617, -9999.00, 1.25073}, +{10.3261, -9999.00, 1.28171}, +{10.4931, -9999.00, 1.31346}, +{10.6628, -9999.00, 1.34600}, +{10.8353, -9999.00, 1.37935}, +{11.0106, -9999.00, 1.42229}, +{11.1886, -9999.00, 1.47192}, +{11.3696, -9999.00, 1.52329}, +{11.5535, -9999.00, 1.59057}, +{11.7404, -9999.00, 1.68339}, +{11.9303, -9999.00, 1.78163}, +{12.1232, -9999.00, 1.88560}, +{12.3193, -9999.00, 1.99786}, +{12.5186, -9999.00, 2.12029}, +{12.7210, -9999.00, 2.25023}, +{12.9268, -9999.00, 2.38813}, +{13.1359, -9999.00, 2.53184}, +{13.3483, -9999.00, 2.65009}, +{13.5642, -9999.00, 2.77386}, +{13.7836, -9999.00, 2.90341}, +{14.0066, -9999.00, 3.03901}, +{14.2331, -9999.00, 3.18095}, +{14.4633, -9999.00, 3.32888}, +{14.6973, -9999.00, 3.48250}, +{14.9350, -9999.00, 3.64322}, +{15.1765, -9999.00, 3.81135}, +{15.4220, -9999.00, 3.98725}, +{15.6714, -9999.00, 4.15723}, +{15.9249, -9999.00, 4.31628}, +{16.1825, -9999.00, 4.48141}, +{16.4442, -9999.00, 4.65286}, +{16.7102, -9999.00, 4.83087}, +{16.9805, -9999.00, 5.01570}, +{17.2551, -9999.00, 5.19593}, +{17.5342, -9999.00, 5.35977}, +{17.8178, -9999.00, 5.52878}, +{18.1060, -9999.00, 5.70311}, +{18.3989, -9999.00, 5.88294}, +{18.6964, -9999.00, 6.06844}, +{18.9988, -9999.00, 6.21829}, +{19.3061, -9999.00, 6.34963}, +{19.6184, -9999.00, 6.48376}, +{19.9357, -9999.00, 6.62071}, +{20.2582, -9999.00, 6.76055}, +{20.5858, -9999.00, 6.90335}, +{20.9188, -9999.00, 7.04917}, +{21.2571, -9999.00, 7.16467}, +{21.6009, -9999.00, 7.24280}, +{21.9503, -9999.00, 7.32178}, +{22.3053, -9999.00, 7.40162}, +{22.6661, -9999.00, 7.48233}, +{23.0327, -9999.00, 7.56393}, +{23.4053, -9999.00, 7.64641}, +{23.7838, -9999.00, 7.70867}, +{24.1685, -9999.00, 7.75957}, +{24.5594, -9999.00, 7.81082}, +{24.9566, -9999.00, 7.86241}, +{25.3603, -9999.00, 7.91434}, +{25.7705, -9999.00, 7.96660}, +{26.1873, -9999.00, 7.89952}, +{26.6109, -9999.00, 7.79585}, +{27.0413, -9999.00, 7.69353}, +{27.4786, -9999.00, 7.59255}, +{27.9231, -9999.00, 7.48280}, +{28.3747, -9999.00, 7.33688}, +{28.8337, -9999.00, 7.19381}, +{29.3000, 8.45909, 7.05352}, +{29.7739, 8.56641, 6.91598}, +{30.2555, 8.66459, 6.78110}, +{30.7449, 8.76478, 6.64213}, +{31.2421, 8.84165, 6.46924}, +{31.7475, 8.88697, 6.30086}, +{32.2609, 8.90905, 6.13686}, +{32.7827, 8.91115, 5.97713}, +{33.3130, 8.89379, 5.82156}, +{33.8518, 8.85649, 5.67017}, +{34.3993, 8.79830, 5.52303}, +{34.9557, 8.71404, 5.37970}, +{35.5211, 8.59289, 5.24993}, +{36.0956, 8.46054, 5.14765}, +{36.6794, 8.30817, 5.04736}, +{37.2727, 8.10895, 4.96509}, +{37.8755, 7.89910, 4.93040}, +{38.4882, 7.65162, 4.89595}, +{39.1107, 7.36500, 4.96882}, +{39.7432, 7.12198, 5.07262}, +{40.3861, 6.87059, 5.17860}, +{41.0393, 6.59610, 5.36587}, +{41.7031, 6.35916, 5.58786}, +{42.3776, 6.10741, 5.82740}, +{43.0630, 5.87799, 6.17225}, +{43.7595, 5.69663, 6.53751}, +{44.4673, 5.54257, 6.92439}, +{45.1865, 5.39286, 7.35884}, +{45.9174, 5.29993, 7.84911}, +{46.6600, 5.25617, 8.37205}, +{47.4147, 5.26340, 8.92984}, +{48.1816, 5.33373, 9.52478}, +{48.9609, 5.48780, 10.1368}, +{49.7528, 5.69892, 10.7677}, +{50.5576, 6.00173, 11.4379}, +{51.3753, 6.48784, 12.1497}, +{52.2062, 7.16031, 12.5909}, +{53.0506, 7.71625, 12.9354}, +{53.9087, 8.24076, 13.2893}, +{54.7806, 8.79587, 13.6529}, +{55.6667, 9.41783, 14.0265}, +{56.5670, 10.1989, 14.3414}, +{57.4820, 10.9343, 14.4423}, +{58.4117, 11.6218, 14.5438}, +{59.3564, 12.3100, 14.6461}, +{60.3165, 13.0421, 14.7491}, +{61.2921, 13.8859, 14.8529}, +{62.2834, 14.8262, 14.7379}, +{63.2908, 15.7055, 14.5475}, +{64.3145, 16.7294, 14.3595}, +{65.3547, 17.7142, 13.5803}, +{66.4118, 18.3622, 12.7811}, +{67.4859, 18.8099, 12.0288}, +{68.5775, 19.1495, 11.3208}, +{69.6867, 19.4079, 10.6545}, +{70.8138, 19.6038, 10.0275}, +{71.9591, 19.7507, 9.43726}, +{73.1230, 19.8597, 8.88182}, +{74.3057, 19.9403, 8.35907}, +{75.5076, 20.0035, 7.86709}, +{76.7289, 20.0676, 7.40407}, +{77.9699, 20.1902, 6.89499}, +{79.2310, 20.1803, 6.31685}, +{80.5125, 20.0944, 5.78716}, +{81.8147, 19.9595, 5.30191}, +{83.1380, 19.7785, 4.87648}, +{84.4827, 19.6056, 4.50819}, +{85.8491, 19.4337, 4.16771}, +{87.2377, 19.2689, 3.85294}, +{88.6487, 19.0943, 3.52690}, +{90.0825, 18.8903, 3.22273}, +{91.5395, 18.6669, 2.94481}, +{93.0201, 18.4191, 2.69085}, +{94.5246, 18.1386, 2.50568}, +{96.0535, 17.9099, 2.37549}, +{97.6071, 17.7070, 2.25205}, +{99.1858, 17.5186, 2.13504}, +{100.790, 17.3439, 2.02409}, +{102.420, 17.1736, 1.90057}, +{104.077, 16.9921, 1.78053}, +{105.760, 16.7936, 1.66807}, +{107.471, 16.5962, 1.59027}, +{109.209, 16.4054, 1.51673}, +{110.975, 16.2017, 1.45329}, +{112.770, 16.0133, 1.42802}, +{114.594, 15.8397, 1.40318}, +{116.448, 15.6695, 1.38020}, +{118.331, 15.5052, 1.36672}, +{120.245, 15.3415, 1.35338}, +{122.190, 15.1757, 1.35434}, +{124.166, 15.0187, 1.36263}, +{126.175, 14.8580, 1.37479}, +{128.215, 14.7047, 1.40417}, +{130.289, 14.5536, 1.43416}, +{132.397, 14.3918, 1.48576}, +{134.538, 14.2546, 1.55966}, +{136.714, 14.1406, 1.63723}, +{138.925, 14.0460, 1.70690}, +{141.172, 13.9507, 1.76768}, +{143.456, 13.8578, 1.83062}, +{145.776, 13.7693, 1.89581}, +{148.134, 13.6865, 1.96332}, +{150.530, 13.6149, 2.03323}, +{152.964, 13.5462, 2.08993}, +{155.439, 13.4753, 2.14772}, +{157.953, 13.4054, 2.20712}, +{160.507, 13.3382, 2.26816}, +{163.103, 13.2765, 2.33088}, +{165.742, 13.2201, 2.38544}, +{168.422, 13.1601, 2.43686}, +{171.146, 13.0978, 2.48939}, +{173.915, 13.0362, 2.54305}, +{176.727, 12.9780, 2.59787}, +{179.586, 12.9234, 2.64606}, +{182.491, 12.8630, 2.68957}, +{185.442, 12.7994, 2.73381}, +{188.442, 12.7343, 2.77877}, +{191.489, 12.6693, 2.82447}, +{194.587, 12.6150, 2.86470}, +{197.734, 12.5487, 2.88972}, +{200.932, 12.4704, 2.91495}, +{204.182, 12.3850, 2.94040}, +{207.485, 12.2930, 2.96608}, +{210.840, 12.1946, 2.99197}, +{214.251, 12.0911, 3.01810}, +{217.716, 11.9832, 3.03957}, +{221.237, 11.8624, 3.05616}, +{224.816, 11.7301, 3.07283}, +{228.452, 11.5911, 3.08960}, +{232.147, 11.4374, 3.09264}, +{235.902, 11.2600, 3.09303}, +{239.717, 11.0594, 3.09342}, +{243.595, 10.8300, 3.09381}, +{247.535, 10.5731, 3.10694}, +{251.538, 10.2956, 3.12577}, +{255.607, 9.99034, 3.14472}, +{259.741, 9.64617, 3.15794}, +{263.942, 9.24487, 3.17006}, +{268.211, 8.75082, 3.19797}, +{272.549, 8.17081, 3.25799}, +{276.957, 7.47039, 3.42250}, +{281.437, 6.62940, 3.73181}, +{285.989, 5.89113, 4.29274}, +{290.615, 5.19242, 4.88214}, +{295.315, 4.41234, 5.54384}, +{300.092, 3.51362, 6.49129}, +{304.945, 2.85377, 7.85531}, +{309.878, 2.55650, 9.32033}, +{314.890, 2.44189, 10.8268}, +{319.983, 2.78367, 12.3634}, +{325.158, 3.18266, 13.6579}, +{330.418, 3.91435, 15.0880}, +{335.762, 4.78865, 15.8893}, +{341.192, 5.59785, 16.6479}, +{346.711, 6.35428, 17.2611}, +{352.319, 7.15027, 17.8034}, +{358.017, 7.83107, 18.2077}, +{363.808, 8.47480, 18.6212}, +{369.692, 9.08606, 18.9616}, +{375.672, 9.65431, 19.2990}, +{381.748, 10.1990, 19.6424}, +{387.922, 10.7509, 19.9901}, +{394.197, 11.2985, 20.3106}, +{400.573, 11.8490, 20.6363}, +{407.052, 12.4502, 20.9322}, +{413.635, 13.0168, 21.1658}, +{420.326, 13.5479, 21.4020}, +{427.124, 14.0734, 21.6409}, +{434.032, 14.6004, 21.8824}, +{441.052, 15.1351, 22.1266}, +{448.186, 15.7614, 22.3736}, +{455.435, 16.3295, 22.2322}, +{462.802, 16.6646, 22.5567}, +{470.287, 17.0802, 22.8860}, +{477.894, 17.6281, 23.2201}, +{485.623, 18.2469, 23.5208}, +{493.478, 18.8824, 23.7808}, +{501.459, 19.5493, 24.0427}, +{509.570, 20.2771, 24.3082}, +{517.812, 21.1443, 24.5382}, +{526.187, 22.1064, 24.6309}, +{534.698, 23.0670, 24.4652}, +{543.346, 23.8432, 24.1736}, +{552.134, 24.5065, 23.8852}, +{561.065, 25.0879, 23.5843}, +{570.139, 25.5466, 23.2968}, +{579.361, 25.9875, 23.1319}, +{588.732, 26.4397, 22.9992}, +{598.254, 26.9207, 22.8875}, +{607.930, 27.4233, 22.7776}, +{617.763, 27.9502, 22.6677}, +{627.755, 28.5296, 22.5518}, +{637.908, 29.1515, 22.3590}, +{648.226, 29.7686, 22.0543}, +{658.711, 30.2792, 21.6799}, +{669.365, 30.7091, 21.3122}, +{680.191, 31.0829, 20.9923}, +{691.193, 31.4530, 20.7087}, +{702.372, 31.8505, 20.4349}, +{713.733, 32.2499, 20.1247}, +{725.277, 32.6112, 19.7921}, +{737.008, 32.9453, 19.4659}, +{748.928, 33.2615, 19.1448}, +{761.042, 33.5643, 18.8283}, +{773.351, 33.8582, 18.5136}, +{785.859, 34.1414, 18.1924}, +{798.570, 34.4029, 17.8673}, +{811.486, 34.6469, 17.5479}, +{824.611, 34.8769, 17.2342}, +{837.949, 35.0952, 16.9261}, +{851.502, 35.3030, 16.6226}, +{865.274, 35.5010, 16.3234}, +{879.269, 35.6889, 16.0286}, +{893.491, 35.8681, 15.7393}, +{907.943, 36.0401, 15.4550}, +{922.628, 36.2076, 15.1759}, +{937.551, 36.3680, 14.8950}, +{952.715, 36.5201, 14.6177}, +{968.124, 36.6641, 14.3441}, +{983.783, 36.8022, 14.0756}, +{999.695, 36.9368, 13.8101}, +{1015.86, 37.0715, 13.5478}, +{1032.29, 37.1968, 13.2730}, +{1048.99, 37.3102, 13.0010}, +{1065.96, 37.4113, 12.7317}, +{1083.20, 37.5026, 12.4680}, +{1100.72, 37.5858, 12.2097}, +{1118.52, 37.6618, 11.9568}, +{1136.61, 37.7313, 11.7091}, +{1155.00, 37.7948, 11.4665}, +{1173.68, 37.8525, 11.2289}, +{1192.66, 37.9050, 10.9964}, +{1211.95, 37.9527, 10.7687}, +{1231.55, 37.9955, 10.5456}, +{1251.47, 38.0337, 10.3273}, +{1271.72, 38.0678, 10.1140}, +{1292.29, 38.0983, 9.90555}, +{1313.19, 38.1256, 9.70136}, +{1334.43, 38.1496, 9.50137}, +{1356.01, 38.1706, 9.30551}, +{1377.94, 38.1888, 9.11350}, +{1400.23, 38.2044, 8.92553}, +{1422.88, 38.2182, 8.74160}, +{1445.89, 38.2311, 8.56130}, +{1469.28, 38.2451, 8.38230}, +{1493.04, 38.2608, 8.20345}, +{1517.19, 38.2692, 8.01344}, +{1541.73, 38.2673, 7.82582}, +{1566.67, 38.2568, 7.64264}, +{1592.01, 38.2404, 7.46374}, +{1617.76, 38.2186, 7.28900}, +{1643.92, 38.1918, 7.11831}, +{1670.51, 38.1603, 6.95145}, +{1697.53, 38.1241, 6.78855}, +{1724.99, 38.0842, 6.62960}, +{1752.89, 38.0398, 6.47301}, +{1781.24, 37.9903, 6.31966}, +{1810.05, 37.9357, 6.16955}, +{1839.32, 37.8758, 6.02288}, +{1869.07, 37.8107, 5.87968}, +{1899.30, 37.7401, 5.73989}, +{1930.02, 37.6641, 5.60370}, +{1961.24, 37.5826, 5.47064}, +{1992.96, 37.4944, 5.34037}, +{2025.20, 37.4005, 5.21492}, +{2057.95, 37.3000, 5.09104}, +{2091.24, 37.1916, 4.97019}, +{2125.06, 37.0749, 4.85219}, +{2159.43, 36.9490, 4.73716}, +{2194.36, 36.8130, 4.62497}, +{2229.85, 36.6657, 4.51564}, +{2265.92, 36.5056, 4.40908}, +{2302.57, 36.3311, 4.30521}, +{2339.81, 36.1398, 4.20394}, +{2377.66, 35.9288, 4.10534}, +{2416.11, 35.6945, 4.00928}, +{2455.19, 35.4321, 3.91570}, +{2494.90, 35.1350, 3.82456}, +{2535.26, 34.7942, 3.73581}, +{2576.26, 34.3965, 3.64940}, +{2617.93, 33.9217, 3.56527}, +{2660.27, 33.3367, 3.48339}, +{2703.30, 32.5806, 3.40370}, +{2747.03, 31.5202, 3.32613}, +{2791.46, 29.7470, 3.25063}, +{2836.61, 20.7864, 3.17693}, +{2837.80, 14.4852, 3.17502}, +{2838.00, 14.4865, 10.9151}, +{2882.49, 29.2224, 10.6711}, +{2929.11, 30.2058, 10.4251}, +{2966.80, 24.1828, 10.2331}, +{2967.00, 24.1914, 14.0216}, +{2976.48, 29.7040, 13.9577}, +{3024.63, 32.6557, 13.6407}, +{3073.55, 33.9653, 13.3313}, +{3123.26, 34.8110, 13.0283}, +{3173.78, 35.2977, 12.7320}, +{3223.90, 32.8590, 12.4492}, +{3224.10, 32.8623, 14.0287}, +{3225.11, 34.0876, 14.0228}, +{3277.27, 36.6481, 13.7202}, +{3330.28, 37.5256, 13.4224}, +{3384.15, 38.2012, 13.1273}, +{3438.88, 38.7678, 12.8363}, +{3494.50, 39.2604, 12.5491}, +{3551.02, 39.6970, 12.2660}, +{3608.46, 40.0878, 11.9863}, +{3666.82, 40.4408, 11.7115}, +{3726.13, 40.7621, 11.4409}, +{3786.40, 41.0553, 11.1740}, +{3847.64, 41.3235, 10.9119}, +{3909.87, 41.5701, 10.6543}, +{3973.11, 41.7966, 10.4006}, +{4037.38, 42.0051, 10.1518}, +{4102.68, 42.1978, 9.90781}, +{4169.03, 42.3757, 9.66771}, +{4236.46, 42.5397, 9.43240}, +{4304.98, 42.6914, 9.20154}, +{4374.62, 42.8313, 8.97513}, +{4445.37, 42.9606, 8.75325}, +{4517.27, 43.0799, 8.53579}, +{4590.33, 43.1900, 8.32284}, +{4664.58, 43.2914, 8.11409}, +{4740.03, 43.3848, 7.90981}, +{4816.69, 43.4706, 7.70982}, +{4894.60, 43.5494, 7.51418}, +{4973.77, 43.6217, 7.32266}, +{5054.21, 43.6877, 7.13546}, +{5135.96, 43.7480, 6.95224}, +{5219.03, 43.8028, 6.77324}, +{5303.44, 43.8526, 6.59823}, +{5389.22, 43.8976, 6.42708}, +{5476.39, 43.9380, 6.25994}, +{5564.97, 43.9743, 6.09668}, +{5654.98, 44.0065, 5.93714}, +{5746.44, 44.0350, 5.78143}, +{5839.39, 44.0600, 5.62929}, +{5933.83, 44.0818, 5.48090}, +{6029.81, 44.1005, 5.33596}, +{6127.33, 44.1162, 5.19451}, +{6226.44, 44.1292, 5.05640}, +{6327.15, 44.1395, 4.92176}, +{6429.48, 44.1475, 4.79046}, +{6533.48, 44.1533, 4.66227}, +{6639.15, 44.1568, 4.53731}, +{6746.54, 44.1583, 4.41549}, +{6855.65, 44.1580, 4.29678}, +{6966.54, 44.1561, 4.18088}, +{7079.22, 44.1523, 4.06791}, +{7193.72, 44.1469, 3.95786}, +{7310.07, 44.1402, 3.85070}, +{7428.31, 44.1322, 3.74610}, +{7548.45, 44.1228, 3.64436}, +{7670.54, 44.1123, 3.54506}, +{7794.61, 44.1006, 3.44848}, +{7920.68, 44.0879, 3.35424}, +{8048.79, 44.0741, 3.26252}, +{8178.98, 44.0595, 3.17322}, +{8311.26, 44.0440, 3.08630}, +{8445.69, 44.0278, 3.00160}, +{8582.29, 44.0107, 2.91902}, +{8721.11, 43.9929, 2.83878}, +{8862.16, 43.9746, 2.76060}, +{9005.50, 43.9556, 2.68445}, +{9151.16, 43.9360, 2.61040}, +{9299.17, 43.9159, 2.53839}, +{9449.58, 43.8953, 2.46820}, +{9602.42, 43.8743, 2.39993}, +{9757.73, 43.8528, 2.33339}, +{9915.55, 43.8309, 2.26871}, +{10075.9, 43.8085, 2.20577}, +{10238.9, 43.7858, 2.14453}, +{10404.5, 43.7628, 2.08495}, +{10572.8, 43.7394, 2.02698}, +{10743.8, 43.7156, 1.97059}, +{10917.6, 43.6916, 1.91573}, +{11094.2, 43.6672, 1.86236}, +{11273.6, 43.6425, 1.81045}, +{11455.9, 43.6175, 1.75995}, +{11641.2, 43.5922, 1.71084}, +{11829.5, 43.5666, 1.66307}, +{12020.8, 43.5407, 1.61661}, +{12215.3, 43.5145, 1.57143}, +{12412.8, 43.4879, 1.52749}, +{12613.6, 43.4610, 1.48476}, +{12817.6, 43.4337, 1.44321}, +{13025.0, 43.4060, 1.40280}, +{13235.6, 43.3778, 1.36351}, +{13449.7, 43.3493, 1.32531}, +{13667.2, 43.3202, 1.28816}, +{13888.3, 43.2906, 1.25205}, +{14112.9, 43.2604, 1.21693}, +{14341.2, 43.2295, 1.18278}, +{14573.1, 43.1980, 1.14959}, +{14808.9, 43.1657, 1.11732}, +{15048.4, 43.1325, 1.08594}, +{15291.8, 43.0983, 1.05543}, +{15539.1, 43.0630, 1.02578}, +{15790.4, 43.0266, 0.996951}, +{16045.8, 42.9887, 0.968925}, +{16305.4, 42.9493, 0.941679}, +{16569.1, 42.9082, 0.915194}, +{16837.1, 42.8650, 0.889447}, +{17109.4, 42.8195, 0.864419}, +{17386.1, 42.7713, 0.840089}, +{17667.4, 42.7199, 0.816439}, +{17953.1, 42.6649, 0.793449}, +{18243.5, 42.6055, 0.771100}, +{18538.6, 42.5409, 0.749377}, +{18838.4, 42.4699, 0.728260}, +{19143.1, 42.3909, 0.707734}, +{19452.7, 42.3020, 0.687781}, +{19767.4, 42.2002, 0.668385}, +{20087.1, 42.0810, 0.649532}, +{20412.0, 41.9378, 0.631205}, +{20742.1, 41.7589, 0.613391}, +{21077.6, 41.5225, 0.596074}, +{21418.5, 41.1789, 0.579241}, +{21765.0, 40.5674, 0.562878}, +{22117.0, 33.4540, 0.546973}, +{22117.1, 32.7264, 0.546968}, +{22117.3, 32.7266, 3.59443}, +{22474.7, 40.7465, 3.50692}, +{22838.2, 41.4752, 3.42146}, +{23207.6, 41.9118, 3.33752}, +{23583.0, 42.2253, 3.25510}, +{23964.4, 42.4697, 3.17421}, +{24352.0, 42.6692, 3.09485}, +{24745.9, 42.8370, 3.01702}, +{25146.2, 42.9809, 2.94072}, +{25552.9, 43.1062, 2.86595}, +{25966.2, 43.2165, 2.79269}, +{26386.1, 43.3145, 2.72094}, +{26812.9, 43.4020, 2.65069}, +{27246.6, 43.4806, 2.58193}, +{27687.3, 43.5514, 2.51464}, +{28135.1, 43.6155, 2.44881}, +{28590.2, 43.6737, 2.38443}, +{29052.6, 43.7265, 2.32148}, +{29522.5, 43.7746, 2.25994}, +{30000.0, 43.8184, 2.19980}, +{0, 0, 0} +}; + +e_fp_fdp rh[] = { /* Z = 45 */ +{10.0000, -9999.00, 1.17537}, +{10.1617, -9999.00, 1.24044}, +{10.3261, -9999.00, 1.30912}, +{10.4931, -9999.00, 1.38160}, +{10.6628, -9999.00, 1.45810}, +{10.8353, -9999.00, 1.53883}, +{11.0106, -9999.00, 1.62403}, +{11.1886, -9999.00, 1.71394}, +{11.3696, -9999.00, 1.80884}, +{11.5535, -9999.00, 1.90899}, +{11.7404, -9999.00, 2.00042}, +{11.9303, -9999.00, 2.09375}, +{12.1232, -9999.00, 2.19144}, +{12.3193, -9999.00, 2.29369}, +{12.5186, -9999.00, 2.40070}, +{12.7210, -9999.00, 2.51271}, +{12.9268, -9999.00, 2.62995}, +{13.1359, -9999.00, 2.75265}, +{13.3483, -9999.00, 2.88108}, +{13.5642, -9999.00, 3.01551}, +{13.7836, -9999.00, 3.15235}, +{14.0066, -9999.00, 3.28289}, +{14.2331, -9999.00, 3.41884}, +{14.4633, -9999.00, 3.56042}, +{14.6973, -9999.00, 3.70786}, +{14.9350, -9999.00, 3.86141}, +{15.1765, -9999.00, 4.02132}, +{15.4220, -9999.00, 4.18785}, +{15.6714, -9999.00, 4.36127}, +{15.9249, -9999.00, 4.52458}, +{16.1825, -9999.00, 4.66392}, +{16.4442, -9999.00, 4.80756}, +{16.7102, -9999.00, 4.95562}, +{16.9805, -9999.00, 5.10824}, +{17.2551, -9999.00, 5.26556}, +{17.5342, -9999.00, 5.42772}, +{17.8178, -9999.00, 5.59488}, +{18.1060, -9999.00, 5.76719}, +{18.3989, -9999.00, 5.94481}, +{18.6964, -9999.00, 6.12789}, +{18.9988, -9999.00, 6.31661}, +{19.3061, -9999.00, 6.49918}, +{19.6184, -9999.00, 6.66358}, +{19.9357, -9999.00, 6.83213}, +{20.2582, -9999.00, 7.00494}, +{20.5858, -9999.00, 7.18213}, +{20.9188, -9999.00, 7.36379}, +{21.2571, -9999.00, 7.55005}, +{21.6009, -9999.00, 7.74103}, +{21.9503, -9999.00, 7.93683}, +{22.3053, -9999.00, 8.09281}, +{22.6661, -9999.00, 8.23857}, +{23.0327, -9999.00, 8.38711}, +{23.4053, -9999.00, 8.53836}, +{23.7838, -9999.00, 8.69235}, +{24.1685, -9999.00, 8.84910}, +{24.5594, -9999.00, 9.00869}, +{24.9566, -9999.00, 9.17115}, +{25.3603, -9999.00, 9.28547}, +{25.7705, -9999.00, 9.35804}, +{26.1873, -9999.00, 9.43118}, +{26.6109, -9999.00, 9.50487}, +{27.0413, -9999.00, 9.52837}, +{27.4786, -9999.00, 9.51188}, +{27.9231, -9999.00, 9.49541}, +{28.3747, -9999.00, 9.47898}, +{28.8337, -9999.00, 9.46258}, +{29.3000, 4.70534, 9.41310}, +{29.7739, 4.90676, 9.35740}, +{30.2555, 5.09755, 9.30204}, +{30.7449, 5.28621, 9.24700}, +{31.2421, 5.48290, 9.19228}, +{31.7475, 5.71977, 9.13789}, +{32.2609, 5.94722, 8.93847}, +{32.7827, 6.09107, 8.73686}, +{33.3130, 6.18463, 8.53981}, +{33.8518, 6.24108, 8.34719}, +{34.3993, 6.25941, 8.15893}, +{34.9557, 6.22758, 7.99834}, +{35.5211, 6.19669, 7.86634}, +{36.0956, 6.15184, 7.73651}, +{36.6794, 6.08461, 7.60883}, +{37.2727, 5.98379, 7.48325}, +{37.8755, 5.84548, 7.38742}, +{38.4882, 5.68807, 7.30257}, +{39.1107, 5.47854, 7.21869}, +{39.7432, 5.20762, 7.23081}, +{40.3861, 4.96732, 7.28432}, +{41.0393, 4.68621, 7.33823}, +{41.7031, 4.33155, 7.51913}, +{42.3776, 4.04527, 7.77047}, +{43.0630, 3.73775, 8.03370}, +{43.7595, 3.46975, 8.49636}, +{44.4673, 3.30893, 8.98568}, +{45.1865, 3.23882, 9.50317}, +{45.9174, 3.22355, 9.96912}, +{46.6600, 3.22567, 10.4563}, +{47.4147, 3.25853, 10.9673}, +{48.1816, 3.33232, 11.5033}, +{48.9609, 3.45444, 12.0655}, +{49.7528, 3.64368, 12.6551}, +{50.5576, 3.93160, 13.2250}, +{51.3753, 4.23391, 13.7757}, +{52.2062, 4.58169, 14.3492}, +{53.0506, 5.02262, 14.9467}, +{53.9087, 5.65139, 15.5181}, +{54.7806, 6.26532, 15.8599}, +{55.6667, 6.83131, 16.2092}, +{56.5670, 7.41151, 16.5663}, +{57.4820, 8.03415, 16.9311}, +{58.4117, 8.75145, 17.3041}, +{59.3564, 9.59027, 17.5205}, +{60.3165, 10.3563, 17.6548}, +{61.2921, 11.1122, 17.7902}, +{62.2834, 11.9314, 17.9266}, +{63.2908, 12.9363, 18.0641}, +{64.3145, 13.9383, 17.7449}, +{65.3547, 14.7331, 17.3938}, +{66.4118, 15.4356, 17.0496}, +{67.4859, 16.0881, 16.7123}, +{68.5775, 16.7147, 16.3816}, +{69.6867, 17.3417, 16.0575}, +{70.8138, 18.0070, 15.6833}, +{71.9591, 18.6141, 15.2606}, +{73.1230, 19.2168, 14.8493}, +{74.3057, 19.8821, 14.4490}, +{75.5076, 20.8097, 13.8376}, +{76.7289, 21.3726, 12.8289}, +{77.9699, 21.6948, 11.8937}, +{79.2310, 21.8777, 11.0267}, +{80.5125, 21.9707, 10.2228}, +{81.8147, 21.9994, 9.47763}, +{83.1380, 21.9867, 8.78672}, +{84.4827, 21.9557, 8.11257}, +{85.8491, 21.8537, 7.46249}, +{87.2377, 21.7029, 6.86448}, +{88.6487, 21.5223, 6.31442}, +{90.0825, 21.3191, 5.80840}, +{91.5395, 21.0980, 5.34296}, +{93.0201, 20.8618, 4.91481}, +{94.5246, 20.6069, 4.52097}, +{96.0535, 20.3512, 4.18740}, +{97.6071, 20.1050, 3.87926}, +{99.1858, 19.8643, 3.59380}, +{100.790, 19.6264, 3.32935}, +{102.420, 19.3919, 3.08435}, +{104.077, 19.1643, 2.85738}, +{105.760, 18.9469, 2.62759}, +{107.471, 18.7094, 2.40272}, +{109.209, 18.4583, 2.19710}, +{110.975, 18.1987, 2.00908}, +{112.770, 17.9230, 1.83715}, +{114.594, 17.6442, 1.71000}, +{116.448, 17.3783, 1.59796}, +{118.331, 17.1048, 1.49325}, +{120.245, 16.8137, 1.43689}, +{122.190, 16.5569, 1.41034}, +{124.166, 16.3114, 1.38428}, +{126.175, 16.0806, 1.39160}, +{128.215, 15.8707, 1.39953}, +{130.289, 15.6696, 1.40751}, +{132.397, 15.4605, 1.42143}, +{134.538, 15.2679, 1.46169}, +{136.714, 15.0927, 1.50309}, +{138.925, 14.9268, 1.54566}, +{141.172, 14.7674, 1.58944}, +{143.456, 14.6112, 1.63446}, +{145.776, 14.4476, 1.68696}, +{148.134, 14.2973, 1.75697}, +{150.530, 14.1595, 1.82989}, +{152.964, 14.0298, 1.90583}, +{155.439, 13.9078, 1.98492}, +{157.953, 13.7945, 2.06556}, +{160.507, 13.6854, 2.14647}, +{163.103, 13.5814, 2.23055}, +{165.742, 13.4830, 2.31793}, +{168.422, 13.3912, 2.40873}, +{171.146, 13.3072, 2.50309}, +{173.915, 13.2340, 2.60114}, +{176.727, 13.1881, 2.70303}, +{179.586, 13.1431, 2.76147}, +{182.491, 13.0837, 2.81991}, +{185.442, 13.0190, 2.87959}, +{188.442, 12.9519, 2.94053}, +{191.489, 12.8835, 3.00276}, +{194.587, 12.8147, 3.06631}, +{197.734, 12.7467, 3.13120}, +{200.932, 12.6841, 3.19331}, +{204.182, 12.6161, 3.24985}, +{207.485, 12.5434, 3.30739}, +{210.840, 12.4684, 3.36595}, +{214.251, 12.3917, 3.42555}, +{217.716, 12.3140, 3.48620}, +{221.237, 12.2367, 3.54793}, +{224.816, 12.1661, 3.61075}, +{228.452, 12.0911, 3.65164}, +{232.147, 12.0053, 3.69210}, +{235.902, 11.9121, 3.73301}, +{239.717, 11.8207, 3.77438}, +{243.595, 11.7185, 3.78814}, +{247.535, 11.5944, 3.79930}, +{251.538, 11.4492, 3.81049}, +{255.607, 11.2864, 3.82461}, +{259.741, 11.1086, 3.84037}, +{263.942, 10.9182, 3.85619}, +{268.211, 10.7022, 3.85408}, +{272.549, 10.4528, 3.85196}, +{276.957, 10.1665, 3.84985}, +{281.437, 9.83651, 3.84774}, +{285.989, 9.44174, 3.86052}, +{290.615, 9.00533, 3.89716}, +{295.315, 8.51429, 3.94893}, +{300.092, 7.94682, 4.00866}, +{304.945, 7.24429, 4.11110}, +{309.878, 6.40671, 4.27135}, +{314.890, 5.36277, 4.63441}, +{319.983, 4.24320, 5.34224}, +{325.158, 3.04666, 6.31104}, +{330.418, 2.21694, 8.05634}, +{335.762, 1.85085, 9.54134}, +{341.192, 1.69962, 11.1689}, +{346.711, 1.73459, 12.7512}, +{352.319, 2.17710, 14.4137}, +{358.017, 2.80549, 15.8486}, +{363.808, 3.74771, 17.0674}, +{369.692, 4.59280, 17.9578}, +{375.672, 5.43720, 18.7673}, +{381.748, 6.35355, 19.4919}, +{387.922, 7.17439, 19.9322}, +{394.197, 7.83964, 20.3823}, +{400.573, 8.47001, 20.8930}, +{407.052, 9.12111, 21.4226}, +{413.635, 9.81859, 21.9657}, +{420.326, 10.6382, 22.4405}, +{427.124, 11.4240, 22.8025}, +{434.032, 12.2421, 23.1160}, +{441.052, 12.9902, 23.3204}, +{448.186, 13.6668, 23.5265}, +{455.435, 14.3250, 23.7329}, +{462.802, 14.9671, 23.9349}, +{470.287, 15.6012, 24.1385}, +{477.894, 16.2286, 24.3440}, +{485.623, 16.8630, 24.5677}, +{493.478, 17.5299, 24.8033}, +{501.459, 18.2364, 25.0412}, +{509.570, 19.1154, 25.2814}, +{517.812, 19.9685, 25.2284}, +{526.187, 20.6976, 25.1592}, +{534.698, 21.3753, 25.0903}, +{543.346, 22.0410, 25.0159}, +{552.134, 22.6711, 24.9115}, +{561.065, 23.2599, 24.7988}, +{570.139, 23.7926, 24.6911}, +{579.361, 24.3221, 24.6442}, +{588.732, 24.8650, 24.6133}, +{598.254, 25.4331, 24.5928}, +{607.930, 26.0274, 24.5733}, +{617.763, 26.6579, 24.5531}, +{627.755, 27.3664, 24.5237}, +{637.908, 28.1409, 24.3859}, +{648.226, 28.9159, 24.0889}, +{658.711, 29.5498, 23.6912}, +{669.365, 30.0802, 23.2991}, +{680.191, 30.5409, 22.9575}, +{691.193, 30.9912, 22.6541}, +{702.372, 31.4645, 22.3598}, +{713.733, 31.9351, 22.0278}, +{725.277, 32.3631, 21.6724}, +{737.008, 32.7591, 21.3222}, +{748.928, 33.1330, 20.9779}, +{761.042, 33.4909, 20.6390}, +{773.351, 33.8377, 20.3015}, +{785.859, 34.1717, 19.9576}, +{798.570, 34.4820, 19.6096}, +{811.486, 34.7728, 19.2675}, +{824.611, 35.0485, 18.9313}, +{837.949, 35.3126, 18.6011}, +{851.502, 35.5660, 18.2730}, +{865.274, 35.8083, 17.9466}, +{879.269, 36.0367, 17.6226}, +{893.491, 36.2535, 17.3044}, +{907.943, 36.4614, 16.9919}, +{922.628, 36.6651, 16.6850}, +{937.551, 36.8595, 16.3720}, +{952.715, 37.0427, 16.0618}, +{968.124, 37.2136, 15.7549}, +{983.783, 37.3754, 15.4539}, +{999.695, 37.5307, 15.1573}, +{1015.86, 37.6826, 14.8649}, +{1032.29, 37.8247, 14.5653}, +{1048.99, 37.9555, 14.2689}, +{1065.96, 38.0737, 13.9758}, +{1083.20, 38.1816, 13.6886}, +{1100.72, 38.2809, 13.4074}, +{1118.52, 38.3724, 13.1320}, +{1136.61, 38.4569, 12.8622}, +{1155.00, 38.5347, 12.5980}, +{1173.68, 38.6064, 12.3392}, +{1192.66, 38.6722, 12.0857}, +{1211.95, 38.7326, 11.8374}, +{1231.55, 38.7876, 11.5943}, +{1251.47, 38.8376, 11.3564}, +{1271.72, 38.8829, 11.1238}, +{1292.29, 38.9244, 10.8965}, +{1313.19, 38.9621, 10.6737}, +{1334.43, 38.9960, 10.4556}, +{1356.01, 39.0265, 10.2420}, +{1377.94, 39.0538, 10.0325}, +{1400.23, 39.0779, 9.82741}, +{1422.88, 39.0993, 9.62653}, +{1445.89, 39.1187, 9.42979}, +{1469.28, 39.1373, 9.23574}, +{1493.04, 39.1557, 9.04366}, +{1517.19, 39.1686, 8.84678}, +{1541.73, 39.1742, 8.65307}, +{1566.67, 39.1737, 8.46373}, +{1592.01, 39.1687, 8.27858}, +{1617.76, 39.1597, 8.09740}, +{1643.92, 39.1468, 7.92001}, +{1670.51, 39.1303, 7.74668}, +{1697.53, 39.1105, 7.57712}, +{1724.99, 39.0898, 7.41119}, +{1752.89, 39.0654, 7.24435}, +{1781.24, 39.0353, 7.07977}, +{1810.05, 38.9998, 6.91787}, +{1839.32, 38.9589, 6.75946}, +{1869.07, 38.9131, 6.60472}, +{1899.30, 38.8627, 6.45372}, +{1930.02, 38.8079, 6.30611}, +{1961.24, 38.7484, 6.16183}, +{1992.96, 38.6833, 6.02076}, +{2025.20, 38.6169, 5.88555}, +{2057.95, 38.5457, 5.74787}, +{2091.24, 38.4669, 5.61290}, +{2125.06, 38.3815, 5.48022}, +{2159.43, 38.2888, 5.34989}, +{2194.36, 38.1884, 5.22230}, +{2229.85, 38.0799, 5.09695}, +{2265.92, 37.9622, 4.97401}, +{2302.57, 37.8346, 4.85347}, +{2339.81, 37.6958, 4.73513}, +{2377.66, 37.5444, 4.61907}, +{2416.11, 37.3788, 4.50526}, +{2455.19, 37.1970, 4.39365}, +{2494.90, 36.9962, 4.28412}, +{2535.26, 36.7732, 4.17669}, +{2576.26, 36.5237, 4.07135}, +{2617.93, 36.2419, 3.96804}, +{2660.27, 35.9202, 3.86678}, +{2703.30, 35.5474, 3.76736}, +{2747.03, 35.1074, 3.66990}, +{2791.46, 34.5743, 3.57434}, +{2836.61, 33.9039, 3.48060}, +{2882.49, 33.0094, 3.38869}, +{2929.11, 31.6760, 3.29847}, +{2976.48, 28.9958, 3.21011}, +{3003.70, 14.7330, 3.16103}, +{3003.90, 14.7337, 11.1098}, +{3024.63, 28.1608, 10.9941}, +{3073.55, 30.7488, 10.7290}, +{3123.26, 30.8088, 10.4714}, +{3146.00, 24.6198, 10.3570}, +{3146.20, 24.6245, 14.2279}, +{3173.78, 32.0599, 14.0392}, +{3225.11, 34.0375, 13.6990}, +{3277.27, 35.1250, 13.3669}, +{3330.28, 35.7872, 13.0426}, +{3384.15, 35.9073, 12.7262}, +{3411.80, 32.7294, 12.5687}, +{3412.00, 32.7321, 14.5451}, +{3438.88, 36.5794, 14.3814}, +{3494.50, 37.8695, 14.0524}, +{3551.02, 38.7086, 13.7287}, +{3608.46, 39.3773, 13.4097}, +{3666.82, 39.9425, 13.0962}, +{3726.13, 40.4344, 12.7884}, +{3786.40, 40.8701, 12.4860}, +{3847.64, 41.2600, 12.1887}, +{3909.87, 41.6115, 11.8969}, +{3973.11, 41.9299, 11.6099}, +{4037.38, 42.2195, 11.3291}, +{4102.68, 42.4845, 11.0535}, +{4169.03, 42.7267, 10.7828}, +{4236.46, 42.9489, 10.5180}, +{4304.98, 43.1532, 10.2582}, +{4374.62, 43.3409, 10.0037}, +{4445.37, 43.5136, 9.75445}, +{4517.27, 43.6726, 9.51041}, +{4590.33, 43.8190, 9.27164}, +{4664.58, 43.9538, 9.03778}, +{4740.03, 44.0778, 8.80902}, +{4816.69, 44.1918, 8.58531}, +{4894.60, 44.2966, 8.36644}, +{4973.77, 44.3929, 8.15253}, +{5054.21, 44.4811, 7.94330}, +{5135.96, 44.5619, 7.73887}, +{5219.03, 44.6357, 7.53908}, +{5303.44, 44.7030, 7.34400}, +{5389.22, 44.7644, 7.15330}, +{5476.39, 44.8200, 6.96707}, +{5564.97, 44.8703, 6.78518}, +{5654.98, 44.9156, 6.60763}, +{5746.44, 44.9563, 6.43436}, +{5839.39, 44.9926, 6.26516}, +{5933.83, 45.0248, 6.10007}, +{6029.81, 45.0532, 5.93892}, +{6127.33, 45.0779, 5.78179}, +{6226.44, 45.0993, 5.62841}, +{6327.15, 45.1175, 5.47883}, +{6429.48, 45.1328, 5.33298}, +{6533.48, 45.1452, 5.19070}, +{6639.15, 45.1551, 5.05201}, +{6746.54, 45.1625, 4.91679}, +{6855.65, 45.1676, 4.78490}, +{6966.54, 45.1705, 4.65638}, +{7079.22, 45.1714, 4.53119}, +{7193.72, 45.1704, 4.40910}, +{7310.07, 45.1677, 4.29011}, +{7428.31, 45.1632, 4.17426}, +{7548.45, 45.1573, 4.06138}, +{7670.54, 45.1499, 3.95138}, +{7794.61, 45.1412, 3.84422}, +{7920.68, 45.1311, 3.73970}, +{8048.79, 45.1198, 3.63812}, +{8178.98, 45.1075, 3.53903}, +{8311.26, 45.0941, 3.44265}, +{8445.69, 45.0797, 3.34870}, +{8582.29, 45.0644, 3.25735}, +{8721.11, 45.0484, 3.16834}, +{8862.16, 45.0316, 3.08161}, +{9005.50, 45.0140, 2.99718}, +{9151.16, 44.9956, 2.91501}, +{9299.17, 44.9766, 2.83505}, +{9449.58, 44.9571, 2.75725}, +{9602.42, 44.9370, 2.68147}, +{9757.73, 44.9163, 2.60772}, +{9915.55, 44.8952, 2.53606}, +{10075.9, 44.8737, 2.46622}, +{10238.9, 44.8517, 2.39825}, +{10404.5, 44.8293, 2.33211}, +{10572.8, 44.8065, 2.26775}, +{10743.8, 44.7833, 2.20513}, +{10917.6, 44.7598, 2.14420}, +{11094.2, 44.7360, 2.08492}, +{11273.6, 44.7118, 2.02724}, +{11455.9, 44.6873, 1.97112}, +{11641.2, 44.6625, 1.91653}, +{11829.5, 44.6374, 1.86342}, +{12020.8, 44.6120, 1.81175}, +{12215.3, 44.5864, 1.76149}, +{12412.8, 44.5604, 1.71260}, +{12613.6, 44.5340, 1.66504}, +{12817.6, 44.5074, 1.61878}, +{13025.0, 44.4805, 1.57378}, +{13235.6, 44.4531, 1.53001}, +{13449.7, 44.4254, 1.48744}, +{13667.2, 44.3974, 1.44603}, +{13888.3, 44.3689, 1.40575}, +{14112.9, 44.3399, 1.36658}, +{14341.2, 44.3104, 1.32848}, +{14573.1, 44.2804, 1.29142}, +{14808.9, 44.2498, 1.25539}, +{15048.4, 44.2186, 1.22033}, +{15291.8, 44.1866, 1.18624}, +{15539.1, 44.1539, 1.15309}, +{15790.4, 44.1202, 1.12085}, +{16045.8, 44.0856, 1.08949}, +{16305.4, 44.0499, 1.05899}, +{16569.1, 44.0129, 1.02933}, +{16837.1, 43.9746, 1.00048}, +{17109.4, 43.9347, 0.972425}, +{17386.1, 43.8930, 0.945141}, +{17667.4, 43.8492, 0.918606}, +{17953.1, 43.8031, 0.892800}, +{18243.5, 43.7543, 0.867702}, +{18538.6, 43.7023, 0.843293}, +{18838.4, 43.6466, 0.819554}, +{19143.1, 43.5864, 0.796466}, +{19452.7, 43.5210, 0.774012}, +{19767.4, 43.4491, 0.752173}, +{20087.1, 43.3692, 0.730933}, +{20412.0, 43.2792, 0.710275}, +{20742.1, 43.1763, 0.690183}, +{21077.6, 43.0559, 0.670641}, +{21418.5, 42.9113, 0.651635}, +{21765.0, 42.7309, 0.633147}, +{22117.0, 42.4931, 0.615166}, +{22474.7, 42.1488, 0.597677}, +{22838.2, 41.5423, 0.580664}, +{23207.6, 38.2348, 0.564117}, +{23219.8, 33.4904, 0.563583}, +{23220.0, 33.4905, 3.66324}, +{23583.0, 41.6618, 3.57592}, +{23964.4, 42.4200, 3.48779}, +{24352.0, 42.8696, 3.40131}, +{24745.9, 43.1911, 3.31648}, +{25146.2, 43.4411, 3.23330}, +{25552.9, 43.6448, 3.15178}, +{25966.2, 43.8158, 3.07189}, +{26386.1, 43.9624, 2.99363}, +{26812.9, 44.0899, 2.91700}, +{27246.6, 44.2020, 2.84197}, +{27687.3, 44.3015, 2.76854}, +{28135.1, 44.3903, 2.69669}, +{28590.2, 44.4701, 2.62640}, +{29052.6, 44.5424, 2.55767}, +{29522.5, 44.6144, 2.49046}, +{30000.0, 44.6452, 2.42477}, +{0, 0, 0} +}; + +e_fp_fdp pd[] = { /* Z = 46 */ +{10.0000, -9999.00, 1.15058}, +{10.1617, -9999.00, 1.20950}, +{10.3261, -9999.00, 1.27144}, +{10.4931, -9999.00, 1.33655}, +{10.6628, -9999.00, 1.40499}, +{10.8353, -9999.00, 1.47694}, +{11.0106, -9999.00, 1.54695}, +{11.1886, -9999.00, 1.61473}, +{11.3696, -9999.00, 1.68548}, +{11.5535, -9999.00, 1.75934}, +{11.7404, -9999.00, 1.83643}, +{11.9303, -9999.00, 1.91689}, +{12.1232, -9999.00, 2.00089}, +{12.3193, -9999.00, 2.08948}, +{12.5186, -9999.00, 2.18421}, +{12.7210, -9999.00, 2.28325}, +{12.9268, -9999.00, 2.38677}, +{13.1359, -9999.00, 2.49498}, +{13.3483, -9999.00, 2.60810}, +{13.5642, -9999.00, 2.72635}, +{13.7836, -9999.00, 2.84283}, +{14.0066, -9999.00, 2.96107}, +{14.2331, -9999.00, 3.08423}, +{14.4633, -9999.00, 3.21251}, +{14.6973, -9999.00, 3.34613}, +{14.9350, -9999.00, 3.48531}, +{15.1765, -9999.00, 3.61751}, +{15.4220, -9999.00, 3.73784}, +{15.6714, -9999.00, 3.86218}, +{15.9249, -9999.00, 3.99066}, +{16.1825, -9999.00, 4.12341}, +{16.4442, -9999.00, 4.26057}, +{16.7102, -9999.00, 4.40230}, +{16.9805, -9999.00, 4.54875}, +{17.2551, -9999.00, 4.69059}, +{17.5342, -9999.00, 4.83211}, +{17.8178, -9999.00, 4.97790}, +{18.1060, -9999.00, 5.12808}, +{18.3989, -9999.00, 5.28280}, +{18.6964, -9999.00, 5.44219}, +{18.9988, -9999.00, 5.60638}, +{19.3061, -9999.00, 5.75266}, +{19.6184, -9999.00, 5.88940}, +{19.9357, -9999.00, 6.02939}, +{20.2582, -9999.00, 6.17270}, +{20.5858, -9999.00, 6.31942}, +{20.9188, -9999.00, 6.46962}, +{21.2571, -9999.00, 6.62340}, +{21.6009, -9999.00, 6.76795}, +{21.9503, -9999.00, 6.90829}, +{22.3053, -9999.00, 7.05155}, +{22.6661, -9999.00, 7.19776}, +{23.0327, -9999.00, 7.34702}, +{23.4053, -9999.00, 7.49937}, +{23.7838, -9999.00, 7.65487}, +{24.1685, -9999.00, 7.80737}, +{24.5594, -9999.00, 7.94154}, +{24.9566, -9999.00, 8.07801}, +{25.3603, -9999.00, 8.21683}, +{25.7705, -9999.00, 8.35803}, +{26.1873, -9999.00, 8.50167}, +{26.6109, -9999.00, 8.64777}, +{27.0413, -9999.00, 8.77838}, +{27.4786, -9999.00, 8.88318}, +{27.9231, -9999.00, 8.98924}, +{28.3747, -9999.00, 9.09656}, +{28.8337, -9999.00, 9.20517}, +{29.3000, 1.54728, 9.31507}, +{29.7739, 1.68191, 9.41939}, +{30.2555, 1.80849, 9.51027}, +{30.7449, 1.92773, 9.60203}, +{31.2421, 2.04259, 9.69467}, +{31.7475, 2.15374, 9.78821}, +{32.2609, 2.26086, 9.88265}, +{32.7827, 2.36175, 9.97801}, +{33.3130, 2.45390, 10.0842}, +{33.8518, 2.55068, 10.2026}, +{34.3993, 2.65431, 10.3223}, +{34.9557, 2.75947, 10.4435}, +{35.5211, 2.86507, 10.5661}, +{36.0956, 2.96999, 10.6901}, +{36.6794, 3.06759, 10.8156}, +{37.2727, 3.15221, 10.9541}, +{37.8755, 3.25131, 11.1255}, +{38.4882, 3.36839, 11.2995}, +{39.1107, 3.49690, 11.4763}, +{39.7432, 3.63564, 11.6559}, +{40.3861, 3.78429, 11.8382}, +{41.0393, 3.94343, 12.0234}, +{41.7031, 4.11395, 12.2116}, +{42.3776, 4.29793, 12.4026}, +{43.0630, 4.49925, 12.5966}, +{43.7595, 4.73652, 12.7937}, +{44.4673, 4.98501, 12.9330}, +{45.1865, 5.21655, 13.0611}, +{45.9174, 5.43655, 13.1905}, +{46.6600, 5.65494, 13.3211}, +{47.4147, 5.87331, 13.4531}, +{48.1816, 6.09288, 13.5863}, +{48.9609, 6.31409, 13.7209}, +{49.7528, 6.53706, 13.8568}, +{50.5576, 6.76072, 13.9940}, +{51.3753, 6.97936, 14.1326}, +{52.2062, 7.19439, 14.2972}, +{53.0506, 7.42998, 14.4824}, +{53.9087, 7.69204, 14.6700}, +{54.7806, 7.97198, 14.8601}, +{55.6667, 8.27205, 15.0526}, +{56.5670, 8.59953, 15.2476}, +{57.4820, 8.95274, 15.4188}, +{58.4117, 9.31093, 15.5794}, +{59.3564, 9.67671, 15.7417}, +{60.3165, 10.0600, 15.9057}, +{61.2921, 10.4650, 16.0714}, +{62.2834, 10.8979, 16.2388}, +{63.2908, 11.3689, 16.4079}, +{64.3145, 11.9115, 16.5788}, +{65.3547, 12.5064, 16.6155}, +{66.4118, 13.0495, 16.6350}, +{67.4859, 13.5961, 16.6546}, +{68.5775, 14.1718, 16.6743}, +{69.6867, 14.8297, 16.6679}, +{70.8138, 15.4959, 16.5029}, +{71.9591, 16.0761, 16.3395}, +{73.1230, 16.6625, 16.1777}, +{74.3057, 17.3141, 16.0175}, +{75.5076, 17.9868, 15.7013}, +{76.7289, 18.5638, 15.3840}, +{77.9699, 19.1489, 15.0731}, +{79.2310, 19.8604, 14.7684}, +{80.5125, 20.6699, 14.2592}, +{81.8147, 21.3079, 13.4450}, +{83.1380, 21.7471, 12.6117}, +{84.4827, 22.0123, 11.7998}, +{85.8491, 22.1785, 11.0402}, +{87.2377, 22.2740, 10.3295}, +{88.6487, 22.3160, 9.66450}, +{90.0825, 22.3177, 9.04232}, +{91.5395, 22.2892, 8.46021}, +{93.0201, 22.2542, 7.91556}, +{94.5246, 22.2132, 7.37038}, +{96.0535, 22.1152, 6.81841}, +{97.6071, 21.9737, 6.30776}, +{99.1858, 21.8074, 5.83537}, +{100.790, 21.6238, 5.39834}, +{102.420, 21.4290, 4.99406}, +{104.077, 21.2277, 4.62004}, +{105.760, 21.0284, 4.27404}, +{107.471, 20.8437, 3.95395}, +{109.209, 20.6693, 3.57216}, +{110.975, 20.4177, 3.20927}, +{112.770, 20.1303, 2.88323}, +{114.594, 19.8166, 2.59807}, +{116.448, 19.5046, 2.37804}, +{118.331, 19.2058, 2.17665}, +{120.245, 18.9069, 1.99231}, +{122.190, 18.5989, 1.82358}, +{124.166, 18.2778, 1.70309}, +{126.175, 17.9801, 1.60183}, +{128.215, 17.6774, 1.51630}, +{130.289, 17.3804, 1.46311}, +{132.397, 17.0840, 1.43291}, +{134.538, 16.8050, 1.42282}, +{136.714, 16.5328, 1.44663}, +{138.925, 16.2850, 1.47786}, +{141.172, 16.0365, 1.52489}, +{143.456, 15.8119, 1.60388}, +{145.776, 15.6137, 1.68697}, +{148.134, 15.4329, 1.77342}, +{150.530, 15.2666, 1.86419}, +{152.964, 15.1153, 1.95962}, +{155.439, 14.9777, 2.05160}, +{157.953, 14.8474, 2.14652}, +{160.507, 14.7271, 2.24584}, +{163.103, 14.6188, 2.34976}, +{165.742, 14.5317, 2.45848}, +{168.422, 14.4757, 2.54546}, +{171.146, 14.3999, 2.61446}, +{173.915, 14.3202, 2.68532}, +{176.727, 14.2412, 2.75811}, +{179.586, 14.1640, 2.83287}, +{182.491, 14.0904, 2.90965}, +{185.442, 14.0224, 2.98517}, +{188.442, 13.9533, 3.05947}, +{191.489, 13.8854, 3.13562}, +{194.587, 13.8199, 3.21367}, +{197.734, 13.7575, 3.29366}, +{200.932, 13.6998, 3.37565}, +{204.182, 13.6503, 3.45967}, +{207.485, 13.6103, 3.52937}, +{210.840, 13.5608, 3.59298}, +{214.251, 13.5081, 3.65772}, +{217.716, 13.4542, 3.72364}, +{221.237, 13.4004, 3.79075}, +{224.816, 13.3478, 3.85907}, +{228.452, 13.3003, 3.92861}, +{232.147, 13.2669, 3.99075}, +{235.902, 13.2217, 4.03150}, +{239.717, 13.1651, 4.07267}, +{243.595, 13.1029, 4.11368}, +{247.535, 13.0360, 4.15465}, +{251.538, 12.9685, 4.19602}, +{255.607, 12.9117, 4.23068}, +{259.741, 12.8371, 4.23599}, +{263.942, 12.7418, 4.24130}, +{268.211, 12.6358, 4.24663}, +{272.549, 12.5155, 4.23541}, +{276.957, 12.3687, 4.22070}, +{281.437, 12.1968, 4.20605}, +{285.989, 11.9988, 4.19311}, +{290.615, 11.7768, 4.18333}, +{295.315, 11.5255, 4.17356}, +{300.092, 11.2344, 4.16914}, +{304.945, 10.9093, 4.17285}, +{309.878, 10.5229, 4.17656}, +{314.890, 10.0920, 4.24602}, +{319.983, 9.63853, 4.32807}, +{325.158, 9.11353, 4.41976}, +{330.418, 8.54787, 4.59013}, +{335.762, 7.92781, 4.76707}, +{341.192, 7.19761, 4.97110}, +{346.711, 6.26083, 5.20196}, +{352.319, 5.13398, 5.81284}, +{358.017, 3.94907, 6.76628}, +{363.808, 2.88486, 8.08133}, +{369.692, 2.01484, 9.88670}, +{375.672, 2.07770, 11.9362}, +{381.748, 2.23414, 13.5957}, +{387.922, 2.81952, 15.3743}, +{394.197, 3.48331, 16.7201}, +{400.573, 4.43753, 18.1839}, +{407.052, 5.45854, 19.0507}, +{413.635, 6.52308, 19.8902}, +{420.326, 7.46246, 20.3621}, +{427.124, 8.23898, 20.8451}, +{434.032, 8.99365, 21.3314}, +{441.052, 9.70207, 21.7520}, +{448.186, 10.3764, 22.1809}, +{455.435, 11.0414, 22.6182}, +{462.802, 11.7178, 23.0642}, +{470.287, 12.5083, 23.4911}, +{477.894, 13.2552, 23.7729}, +{485.623, 13.9364, 24.0582}, +{493.478, 14.6063, 24.3469}, +{501.459, 15.2777, 24.6391}, +{509.570, 15.9716, 24.9323}, +{517.812, 16.6705, 25.1937}, +{526.187, 17.3791, 25.4578}, +{534.698, 18.1157, 25.7247}, +{543.346, 18.9230, 25.9943}, +{552.134, 19.8177, 26.1282}, +{561.065, 20.6488, 26.1468}, +{570.139, 21.4066, 26.1654}, +{579.361, 22.1528, 26.1840}, +{588.732, 22.9600, 26.2026}, +{598.254, 23.7710, 26.0913}, +{607.930, 24.4911, 25.9169}, +{617.763, 25.1519, 25.7437}, +{627.755, 25.7721, 25.5717}, +{637.908, 26.3405, 25.4008}, +{648.226, 26.9051, 25.3047}, +{658.711, 27.4954, 25.2167}, +{669.365, 28.1418, 25.1291}, +{680.191, 28.8295, 24.9808}, +{691.193, 29.4775, 24.7535}, +{702.372, 30.0909, 24.5283}, +{713.733, 30.7639, 24.3052}, +{725.277, 31.4196, 23.9481}, +{737.008, 31.9759, 23.5530}, +{748.928, 32.4762, 23.1645}, +{761.042, 32.9200, 22.7823}, +{773.351, 33.3473, 22.4450}, +{785.859, 33.7918, 22.0922}, +{798.570, 34.2082, 21.7092}, +{811.486, 34.5821, 21.3311}, +{824.611, 34.9332, 20.9601}, +{837.949, 35.2658, 20.5959}, +{851.502, 35.5817, 20.2361}, +{865.274, 35.8817, 19.8809}, +{879.269, 36.1664, 19.5302}, +{893.491, 36.4372, 19.1859}, +{907.943, 36.6961, 18.8475}, +{922.628, 36.9480, 18.5151}, +{937.551, 37.1902, 18.1814}, +{952.715, 37.4192, 17.8520}, +{968.124, 37.6386, 17.5271}, +{983.783, 37.8511, 17.2081}, +{999.695, 38.0578, 16.8916}, +{1015.86, 38.2687, 16.5776}, +{1032.29, 38.4705, 16.2403}, +{1048.99, 38.6446, 15.9060}, +{1065.96, 38.8044, 15.5747}, +{1083.20, 38.9490, 15.2502}, +{1100.72, 39.0822, 14.9324}, +{1118.52, 39.2049, 14.6212}, +{1136.61, 39.3183, 14.3168}, +{1155.00, 39.4232, 14.0186}, +{1173.68, 39.5202, 13.7266}, +{1192.66, 39.6098, 13.4406}, +{1211.95, 39.6924, 13.1606}, +{1231.55, 39.7681, 12.8863}, +{1251.47, 39.8375, 12.6181}, +{1271.72, 39.9012, 12.3559}, +{1292.29, 39.9596, 12.0994}, +{1313.19, 40.0131, 11.8483}, +{1334.43, 40.0619, 11.6026}, +{1356.01, 40.1062, 11.3619}, +{1377.94, 40.1461, 11.1260}, +{1400.23, 40.1818, 10.8951}, +{1422.88, 40.2136, 10.6690}, +{1445.89, 40.2416, 10.4475}, +{1469.28, 40.2661, 10.2304}, +{1493.04, 40.2872, 10.0175}, +{1517.19, 40.3050, 9.80804}, +{1541.73, 40.3184, 9.60281}, +{1566.67, 40.3284, 9.40189}, +{1592.01, 40.3352, 9.20504}, +{1617.76, 40.3387, 9.01229}, +{1643.92, 40.3394, 8.82359}, +{1670.51, 40.3374, 8.63894}, +{1697.53, 40.3335, 8.45820}, +{1724.99, 40.3288, 8.28132}, +{1752.89, 40.3238, 8.10126}, +{1781.24, 40.3114, 7.92277}, +{1810.05, 40.2932, 7.74642}, +{1839.32, 40.2696, 7.57420}, +{1869.07, 40.2417, 7.40586}, +{1899.30, 40.2097, 7.24131}, +{1930.02, 40.1739, 7.08028}, +{1961.24, 40.1341, 6.92281}, +{1992.96, 40.0902, 6.76886}, +{2025.20, 40.0435, 6.62217}, +{2057.95, 39.9975, 6.47064}, +{2091.24, 39.9435, 6.32088}, +{2125.06, 39.8833, 6.17393}, +{2159.43, 39.8174, 6.02983}, +{2194.36, 39.7458, 5.88782}, +{2229.85, 39.6676, 5.74790}, +{2265.92, 39.5825, 5.61058}, +{2302.57, 39.4902, 5.47561}, +{2339.81, 39.3898, 5.34289}, +{2377.66, 39.2808, 5.21235}, +{2416.11, 39.1622, 5.08409}, +{2455.19, 39.0332, 4.95804}, +{2494.90, 38.8921, 4.83414}, +{2535.26, 38.7377, 4.71230}, +{2576.26, 38.5680, 4.59257}, +{2617.93, 38.3809, 4.47494}, +{2660.27, 38.1732, 4.35936}, +{2703.30, 37.9412, 4.24569}, +{2747.03, 37.6801, 4.13399}, +{2791.46, 37.3833, 4.02424}, +{2836.61, 37.0413, 3.91646}, +{2882.49, 36.6409, 3.81048}, +{2929.11, 36.1614, 3.70628}, +{2976.48, 35.5691, 3.60401}, +{3024.63, 34.8015, 3.50349}, +{3073.55, 33.7207, 3.40473}, +{3123.26, 31.8949, 3.30764}, +{3173.20, 16.3951, 3.21438}, +{3173.40, 16.3958, 10.9859}, +{3173.78, 20.2530, 10.9839}, +{3225.11, 31.5760, 10.7176}, +{3277.27, 32.5883, 10.4575}, +{3330.20, 26.0278, 10.2043}, +{3330.40, 26.0320, 14.0589}, +{3384.15, 34.5501, 13.7240}, +{3438.88, 35.9648, 13.3964}, +{3494.50, 36.8336, 13.0763}, +{3551.02, 37.3079, 12.7644}, +{3604.20, 34.7592, 12.4820}, +{3604.40, 34.7614, 14.0806}, +{3608.46, 36.7045, 14.0598}, +{3666.82, 38.6802, 13.7658}, +{3726.13, 39.5432, 13.4765}, +{3786.40, 40.2126, 13.1884}, +{3847.64, 40.7757, 12.9036}, +{3909.87, 41.2672, 12.6220}, +{3973.11, 41.7024, 12.3439}, +{4037.38, 42.0935, 12.0690}, +{4102.68, 42.4474, 11.7972}, +{4169.03, 42.7695, 11.5290}, +{4236.46, 43.0634, 11.2648}, +{4304.98, 43.3333, 11.0052}, +{4374.62, 43.5813, 10.7482}, +{4445.37, 43.8097, 10.4957}, +{4517.27, 44.0202, 10.2475}, +{4590.33, 44.2144, 10.0034}, +{4664.58, 44.3940, 9.76322}, +{4740.03, 44.5598, 9.52728}, +{4816.69, 44.7130, 9.29577}, +{4894.60, 44.8547, 9.06847}, +{4973.77, 44.9855, 8.84528}, +{5054.21, 45.1063, 8.62641}, +{5135.96, 45.2178, 8.41177}, +{5219.03, 45.3205, 8.20146}, +{5303.44, 45.4150, 7.99517}, +{5389.22, 45.5019, 7.79324}, +{5476.39, 45.5817, 7.59548}, +{5564.97, 45.6548, 7.40188}, +{5654.98, 45.7217, 7.21234}, +{5746.44, 45.7826, 7.02677}, +{5839.39, 45.8380, 6.84535}, +{5933.83, 45.8881, 6.66786}, +{6029.81, 45.9333, 6.49442}, +{6127.33, 45.9741, 6.32485}, +{6226.44, 46.0104, 6.15900}, +{6327.15, 46.0427, 5.99712}, +{6429.48, 46.0712, 5.83885}, +{6533.48, 46.0960, 5.68428}, +{6639.15, 46.1175, 5.53335}, +{6746.54, 46.1357, 5.38604}, +{6855.65, 46.1511, 5.24231}, +{6966.54, 46.1636, 5.10187}, +{7079.22, 46.1734, 4.96486}, +{7193.72, 46.1808, 4.83124}, +{7310.07, 46.1858, 4.70079}, +{7428.31, 46.1886, 4.57368}, +{7548.45, 46.1893, 4.44963}, +{7670.54, 46.1881, 4.32883}, +{7794.61, 46.1851, 4.21098}, +{7920.68, 46.1803, 4.09600}, +{8048.79, 46.1741, 3.98408}, +{8178.98, 46.1662, 3.87492}, +{8311.26, 46.1570, 3.76863}, +{8445.69, 46.1465, 3.66501}, +{8582.29, 46.1348, 3.56415}, +{8721.11, 46.1219, 3.46582}, +{8862.16, 46.1079, 3.37009}, +{9005.50, 46.0929, 3.27674}, +{9151.16, 46.0769, 3.18607}, +{9299.17, 46.0601, 3.09768}, +{9449.58, 46.0426, 3.01168}, +{9602.42, 46.0242, 2.92782}, +{9757.73, 46.0050, 2.84634}, +{9915.55, 45.9853, 2.76702}, +{10075.9, 45.9649, 2.68981}, +{10238.9, 45.9439, 2.61468}, +{10404.5, 45.9224, 2.54158}, +{10572.8, 45.9004, 2.47046}, +{10743.8, 45.8779, 2.40127}, +{10917.6, 45.8549, 2.33397}, +{11094.2, 45.8315, 2.26851}, +{11273.6, 45.8078, 2.20485}, +{11455.9, 45.7836, 2.14293}, +{11641.2, 45.7591, 2.08272}, +{11829.5, 45.7342, 2.02417}, +{12020.8, 45.7091, 1.96724}, +{12215.3, 45.6835, 1.91189}, +{12412.8, 45.6577, 1.85808}, +{12613.6, 45.6316, 1.80577}, +{12817.6, 45.6051, 1.75493}, +{13025.0, 45.5784, 1.70550}, +{13235.6, 45.5513, 1.65746}, +{13449.7, 45.5239, 1.61077}, +{13667.2, 45.4962, 1.56539}, +{13888.3, 45.4682, 1.52129}, +{14112.9, 45.4397, 1.47844}, +{14341.2, 45.4109, 1.43680}, +{14573.1, 45.3817, 1.39634}, +{14808.9, 45.3521, 1.35703}, +{15048.4, 45.3219, 1.31884}, +{15291.8, 45.2913, 1.28174}, +{15539.1, 45.2600, 1.24569}, +{15790.4, 45.2282, 1.21067}, +{16045.8, 45.1957, 1.17666}, +{16305.4, 45.1624, 1.14361}, +{16569.1, 45.1282, 1.11152}, +{16837.1, 45.0931, 1.08035}, +{17109.4, 45.0570, 1.05007}, +{17386.1, 45.0196, 1.02067}, +{17667.4, 44.9809, 0.992113}, +{17953.1, 44.9407, 0.964380}, +{18243.5, 44.8988, 0.937448}, +{18538.6, 44.8548, 0.911296}, +{18838.4, 44.8086, 0.885900}, +{19143.1, 44.7597, 0.861240}, +{19452.7, 44.7077, 0.837296}, +{19767.4, 44.6520, 0.814046}, +{20087.1, 44.5920, 0.791473}, +{20412.0, 44.5268, 0.769556}, +{20742.1, 44.4553, 0.748277}, +{21077.6, 44.3758, 0.727617}, +{21418.5, 44.2865, 0.707561}, +{21765.0, 44.1842, 0.688089}, +{22117.0, 44.0647, 0.669186}, +{22474.7, 43.9211, 0.650836}, +{22838.2, 43.7419, 0.633022}, +{23207.6, 43.5051, 0.615730}, +{23583.0, 43.1610, 0.598944}, +{23964.4, 42.5497, 0.582650}, +{24350.2, 34.6455, 0.566870}, +{24350.4, 34.6456, 3.61141}, +{24352.0, 37.4012, 3.61104}, +{24745.9, 42.7370, 3.52351}, +{25146.2, 43.4626, 3.43753}, +{25552.9, 43.8977, 3.35311}, +{25966.2, 44.2104, 3.27026}, +{26386.1, 44.4542, 3.18896}, +{26812.9, 44.6531, 3.10924}, +{27246.6, 44.8204, 3.03108}, +{27687.3, 44.9638, 2.95447}, +{28135.1, 45.0887, 2.87941}, +{28590.2, 45.1986, 2.80589}, +{29052.6, 45.2962, 2.73391}, +{29522.5, 45.3833, 2.66344}, +{30000.0, 45.4616, 2.59448}, +{0, 0, 0} +}; + +e_fp_fdp ag[] = { /* Z = 47 */ +{10.0000, -9999.00, 1.18566}, +{10.1617, -9999.00, 1.22941}, +{10.3261, -9999.00, 1.27478}, +{10.4931, -9999.00, 1.32182}, +{10.6628, -9999.00, 1.38215}, +{10.8353, -9999.00, 1.45541}, +{11.0106, -9999.00, 1.53256}, +{11.1886, -9999.00, 1.61379}, +{11.3696, -9999.00, 1.69933}, +{11.5535, -9999.00, 1.78755}, +{11.7404, -9999.00, 1.87996}, +{11.9303, -9999.00, 1.97715}, +{12.1232, -9999.00, 2.07936}, +{12.3193, -9999.00, 2.18686}, +{12.5186, -9999.00, 2.29992}, +{12.7210, -9999.00, 2.41824}, +{12.9268, -9999.00, 2.53197}, +{13.1359, -9999.00, 2.65105}, +{13.3483, -9999.00, 2.77572}, +{13.5642, -9999.00, 2.90627}, +{13.7836, -9999.00, 3.04294}, +{14.0066, -9999.00, 3.18605}, +{14.2331, -9999.00, 3.33589}, +{14.4633, -9999.00, 3.47681}, +{14.6973, -9999.00, 3.60644}, +{14.9350, -9999.00, 3.74092}, +{15.1765, -9999.00, 3.88040}, +{15.4220, -9999.00, 4.02509}, +{15.6714, -9999.00, 4.17517}, +{15.9249, -9999.00, 4.29713}, +{16.1825, -9999.00, 4.41441}, +{16.4442, -9999.00, 4.53488}, +{16.7102, -9999.00, 4.65865}, +{16.9805, -9999.00, 4.78579}, +{17.2551, -9999.00, 4.90106}, +{17.5342, -9999.00, 4.98937}, +{17.8178, -9999.00, 5.07926}, +{18.1060, -9999.00, 5.17077}, +{18.3989, -9999.00, 5.29055}, +{18.6964, -9999.00, 5.45984}, +{18.9988, -9999.00, 5.63455}, +{19.3061, -9999.00, 5.81485}, +{19.6184, -9999.00, 6.00091}, +{19.9357, -9999.00, 6.19293}, +{20.2582, -9999.00, 6.42631}, +{20.5858, -9999.00, 6.67287}, +{20.9188, -9999.00, 6.92890}, +{21.2571, -9999.00, 7.19476}, +{21.6009, -9999.00, 7.47081}, +{21.9503, -9999.00, 7.69770}, +{22.3053, -9999.00, 7.91341}, +{22.6661, -9999.00, 8.13517}, +{23.0327, -9999.00, 8.36313}, +{23.4053, -9999.00, 8.59750}, +{23.7838, -9999.00, 8.81679}, +{24.1685, -9999.00, 8.87260}, +{24.5594, -9999.00, 8.92877}, +{24.9566, -9999.00, 8.98530}, +{25.3603, -9999.00, 9.04218}, +{25.7705, -9999.00, 9.09949}, +{26.1873, -9999.00, 9.21817}, +{26.6109, -9999.00, 9.33838}, +{27.0413, -9999.00, 9.46018}, +{27.4786, -9999.00, 9.58355}, +{27.9231, -9999.00, 9.70853}, +{28.3747, -9999.00, 9.84446}, +{28.8337, -9999.00, 10.0304}, +{29.3000, -1.81922, 10.2199}, +{29.7739, -1.72868, 10.4130}, +{30.2555, -1.62587, 10.6097}, +{30.7449, -1.50683, 10.8101}, +{31.2421, -1.36942, 10.9964}, +{31.7475, -1.23794, 11.1767}, +{32.2609, -1.10469, 11.3600}, +{32.7827, -0.965780, 11.5464}, +{33.3130, -0.819277, 11.7358}, +{33.8518, -0.660791, 11.9283}, +{34.3993, -0.480585, 12.1239}, +{34.9557, -0.289667, 12.2800}, +{35.5211, -0.115068, 12.4307}, +{36.0956, 0.544224E-01, 12.5832}, +{36.6794, 0.222635, 12.7376}, +{37.2727, 0.391268, 12.8939}, +{37.8755, 0.561365, 13.0521}, +{38.4882, 0.733759, 13.2123}, +{39.1107, 0.909163, 13.3744}, +{39.7432, 1.08835, 13.5385}, +{40.3861, 1.27236, 13.7046}, +{41.0393, 1.46409, 13.8728}, +{41.7031, 1.66062, 14.0329}, +{42.3776, 1.85709, 14.1936}, +{43.0630, 2.05539, 14.3561}, +{43.7595, 2.25726, 14.5206}, +{44.4673, 2.46333, 14.6868}, +{45.1865, 2.67431, 14.8550}, +{45.9174, 2.89086, 15.0252}, +{46.6600, 3.11409, 15.1972}, +{47.4147, 3.34752, 15.3713}, +{48.1816, 3.58781, 15.5375}, +{48.9609, 3.82940, 15.7033}, +{49.7528, 4.07512, 15.8707}, +{50.5576, 4.32632, 16.0400}, +{51.3753, 4.58400, 16.2111}, +{52.2062, 4.84891, 16.3840}, +{53.0506, 5.12192, 16.5588}, +{53.9087, 5.40394, 16.7354}, +{54.7806, 5.69619, 16.9139}, +{55.6667, 6.00013, 17.0943}, +{56.5670, 6.31814, 17.2766}, +{57.4820, 6.65965, 17.4609}, +{58.4117, 7.02554, 17.6230}, +{59.3564, 7.38425, 17.7648}, +{60.3165, 7.74300, 17.9077}, +{61.2921, 8.10773, 18.0518}, +{62.2834, 8.48132, 18.1971}, +{63.2908, 8.86597, 18.3435}, +{64.3145, 9.26387, 18.4911}, +{65.3547, 9.67727, 18.6400}, +{66.4118, 10.1095, 18.7903}, +{67.4859, 10.5644, 18.9419}, +{68.5775, 11.0481, 19.0946}, +{69.6867, 11.5723, 19.2486}, +{70.8138, 12.1880, 19.3916}, +{71.9591, 12.7928, 19.3995}, +{73.1230, 13.3763, 19.4073}, +{74.3057, 13.9659, 19.4152}, +{75.5076, 14.6042, 19.4231}, +{76.7289, 15.2716, 19.3269}, +{77.9699, 15.9027, 19.1837}, +{79.2310, 16.5022, 19.0416}, +{80.5125, 17.1136, 18.9006}, +{81.8147, 17.7380, 18.7252}, +{83.1380, 18.3594, 18.5330}, +{84.4827, 18.9875, 18.3428}, +{85.8491, 19.6399, 18.1546}, +{87.2377, 20.4515, 17.9682}, +{88.6487, 21.2684, 17.5449}, +{90.0825, 21.9898, 17.0948}, +{91.5395, 22.6998, 16.6562}, +{93.0201, 23.6518, 16.2288}, +{94.5246, 24.6488, 15.3958}, +{96.0535, 25.3798, 14.3678}, +{97.6071, 26.1748, 13.3588}, +{99.1858, 26.6170, 11.8096}, +{100.790, 26.6486, 10.4401}, +{102.420, 26.4945, 9.22940}, +{104.077, 26.2218, 8.15907}, +{105.760, 25.8908, 7.21290}, +{107.471, 25.5212, 6.35320}, +{109.209, 25.0855, 5.54204}, +{110.975, 24.5909, 4.83444}, +{112.770, 24.0706, 4.21718}, +{114.594, 23.5321, 3.67872}, +{116.448, 22.9483, 3.20904}, +{118.331, 22.3497, 2.87080}, +{120.245, 21.8285, 2.65218}, +{122.190, 21.3696, 2.45021}, +{124.166, 20.9391, 2.26363}, +{126.175, 20.5186, 2.09125}, +{128.215, 20.1081, 1.95934}, +{130.289, 19.7224, 1.84480}, +{132.397, 19.3282, 1.73695}, +{134.538, 18.9417, 1.68905}, +{136.714, 18.5939, 1.64838}, +{138.925, 18.2518, 1.62622}, +{141.172, 17.9193, 1.61766}, +{143.456, 17.6017, 1.64747}, +{145.776, 17.3166, 1.67547}, +{148.134, 17.0300, 1.70176}, +{150.530, 16.7386, 1.76394}, +{152.964, 16.4735, 1.84444}, +{155.439, 16.2253, 1.92861}, +{157.953, 15.9759, 2.01662}, +{160.507, 15.7193, 2.15015}, +{163.103, 15.5017, 2.32060}, +{165.742, 15.3307, 2.50385}, +{168.422, 15.1938, 2.68031}, +{171.146, 15.0960, 2.86721}, +{173.915, 15.0271, 3.00223}, +{176.727, 14.9482, 3.14361}, +{179.586, 14.8947, 3.29165}, +{182.491, 14.8627, 3.39185}, +{185.442, 14.8146, 3.49172}, +{188.442, 14.7762, 3.59453}, +{191.489, 14.7499, 3.68459}, +{194.587, 14.7181, 3.75705}, +{197.734, 14.6829, 3.82883}, +{200.932, 14.6452, 3.89043}, +{204.182, 14.6015, 3.95302}, +{207.485, 14.5557, 4.01661}, +{210.840, 14.5090, 4.08124}, +{214.251, 14.4622, 4.14690}, +{217.716, 14.4159, 4.21361}, +{221.237, 14.3705, 4.28140}, +{224.816, 14.3266, 4.35028}, +{228.452, 14.2852, 4.42028}, +{232.147, 14.2474, 4.49139}, +{235.902, 14.2232, 4.56365}, +{239.717, 14.2123, 4.61085}, +{243.595, 14.1768, 4.64794}, +{247.535, 14.1347, 4.68533}, +{251.538, 14.0882, 4.72301}, +{255.607, 14.0396, 4.76100}, +{259.741, 13.9916, 4.79115}, +{263.942, 13.9328, 4.81758}, +{268.211, 13.8683, 4.84415}, +{272.549, 13.8013, 4.87086}, +{276.957, 13.7407, 4.89747}, +{281.437, 13.6733, 4.88211}, +{285.989, 13.5744, 4.86682}, +{290.615, 13.4568, 4.85156}, +{295.315, 13.3227, 4.83621}, +{300.092, 13.1727, 4.82077}, +{304.945, 13.0140, 4.80537}, +{309.878, 12.8412, 4.75691}, +{314.890, 12.6115, 4.70031}, +{319.983, 12.3330, 4.65850}, +{325.158, 12.0432, 4.63031}, +{330.418, 11.7364, 4.56246}, +{335.762, 11.2984, 4.47942}, +{341.192, 10.7574, 4.45994}, +{346.711, 10.1946, 4.52242}, +{352.319, 9.55395, 4.58117}, +{358.017, 8.84431, 4.72932}, +{363.808, 8.04906, 4.94624}, +{369.692, 7.15775, 5.19718}, +{375.672, 6.09691, 5.58879}, +{381.748, 4.70109, 6.30297}, +{387.922, 3.39440, 7.40671}, +{394.197, 2.22553, 9.23062}, +{400.573, 1.55570, 11.3138}, +{407.052, 1.60279, 13.4510}, +{413.635, 1.87385, 15.5235}, +{420.326, 2.55047, 17.4481}, +{427.124, 3.76452, 18.9749}, +{434.032, 4.89407, 20.2222}, +{441.052, 5.94640, 21.0287}, +{448.186, 6.91953, 21.8673}, +{455.435, 7.85548, 22.5317}, +{462.802, 8.74241, 23.2092}, +{470.287, 9.68918, 23.9071}, +{477.894, 10.6742, 24.4322}, +{485.623, 11.6983, 24.9566}, +{493.478, 12.6891, 25.2194}, +{501.459, 13.5625, 25.4740}, +{509.570, 14.3886, 25.7312}, +{517.812, 15.2012, 25.9911}, +{526.187, 16.0277, 26.2212}, +{534.698, 16.8194, 26.4202}, +{543.346, 17.6000, 26.6207}, +{552.134, 18.3874, 26.8227}, +{561.065, 19.2024, 27.0262}, +{570.139, 20.1066, 27.2313}, +{579.361, 21.0903, 27.2392}, +{588.732, 21.9318, 27.1301}, +{598.254, 22.6965, 27.0214}, +{607.930, 23.4171, 26.9132}, +{617.763, 24.1080, 26.8054}, +{627.755, 24.7766, 26.6944}, +{637.908, 25.4254, 26.5824}, +{648.226, 26.0594, 26.4708}, +{658.711, 26.6836, 26.3597}, +{669.365, 27.3020, 26.2491}, +{680.191, 27.9192, 26.1389}, +{691.193, 28.5409, 26.0293}, +{702.372, 29.1756, 25.9200}, +{713.733, 29.8411, 25.8113}, +{725.277, 30.6134, 25.7029}, +{737.008, 31.3386, 25.3172}, +{748.928, 31.9433, 24.9300}, +{761.042, 32.4292, 24.6050}, +{773.351, 32.9405, 24.3539}, +{785.859, 33.5328, 24.1054}, +{798.570, 34.1735, 23.7375}, +{811.486, 34.6808, 23.2537}, +{824.611, 35.0357, 22.7837}, +{837.949, 35.3960, 22.5089}, +{851.502, 35.8062, 22.2374}, +{865.274, 36.3619, 21.9692}, +{879.269, 36.8862, 21.4603}, +{893.491, 37.2638, 20.9270}, +{907.943, 37.5380, 20.4070}, +{922.628, 37.7337, 19.9845}, +{937.551, 37.9488, 19.6336}, +{952.715, 38.2020, 19.2806}, +{968.124, 38.4445, 18.9190}, +{983.783, 38.6732, 18.5649}, +{999.695, 38.8941, 18.2156}, +{1015.86, 39.1139, 17.8710}, +{1032.29, 39.3218, 17.5164}, +{1048.99, 39.5138, 17.1648}, +{1065.96, 39.6909, 16.8161}, +{1083.20, 39.8538, 16.4746}, +{1100.72, 40.0057, 16.1400}, +{1118.52, 40.1474, 15.8122}, +{1136.61, 40.2799, 15.4912}, +{1155.00, 40.4042, 15.1767}, +{1173.68, 40.5204, 14.8685}, +{1192.66, 40.6291, 14.5665}, +{1211.95, 40.7309, 14.2706}, +{1231.55, 40.8257, 13.9807}, +{1251.47, 40.9144, 13.6972}, +{1271.72, 40.9974, 13.4198}, +{1292.29, 41.0752, 13.1483}, +{1313.19, 41.1485, 12.8825}, +{1334.43, 41.2173, 12.6221}, +{1356.01, 41.2821, 12.3669}, +{1377.94, 41.3431, 12.1169}, +{1400.23, 41.4009, 11.8719}, +{1422.88, 41.4560, 11.6319}, +{1445.89, 41.5107, 11.3967}, +{1469.28, 41.5644, 11.1634}, +{1493.04, 41.6226, 10.9306}, +{1517.19, 41.6749, 10.6850}, +{1541.73, 41.7100, 10.4425}, +{1566.67, 41.7373, 10.2055}, +{1592.01, 41.7580, 9.97405}, +{1617.76, 41.7731, 9.74780}, +{1643.92, 41.7832, 9.52656}, +{1670.51, 41.7887, 9.31021}, +{1697.53, 41.7901, 9.09884}, +{1724.99, 41.7888, 8.89242}, +{1752.89, 41.7847, 8.68657}, +{1781.24, 41.7746, 8.48395}, +{1810.05, 41.7586, 8.28470}, +{1839.32, 41.7374, 8.09055}, +{1869.07, 41.7120, 7.90089}, +{1899.30, 41.6823, 7.71539}, +{1930.02, 41.6482, 7.53446}, +{1961.24, 41.6103, 7.35786}, +{1992.96, 41.5679, 7.18545}, +{2025.20, 41.5225, 7.01915}, +{2057.95, 41.4755, 6.85339}, +{2091.24, 41.4228, 6.69071}, +{2125.06, 41.3651, 6.53174}, +{2159.43, 41.3027, 6.37653}, +{2194.36, 41.2356, 6.22489}, +{2229.85, 41.1637, 6.07701}, +{2265.92, 41.0868, 5.93230}, +{2302.57, 41.0046, 5.79105}, +{2339.81, 40.9166, 5.65313}, +{2377.66, 40.8226, 5.51848}, +{2416.11, 40.7221, 5.38707}, +{2455.19, 40.6147, 5.25884}, +{2494.90, 40.4997, 5.13370}, +{2535.26, 40.3763, 5.01163}, +{2576.26, 40.2437, 4.89256}, +{2617.93, 40.1008, 4.77642}, +{2660.27, 39.9462, 4.66311}, +{2703.30, 39.7784, 4.55267}, +{2747.03, 39.5953, 4.44501}, +{2791.46, 39.3945, 4.33998}, +{2836.61, 39.1727, 4.23759}, +{2882.49, 38.9257, 4.13785}, +{2929.11, 38.6479, 4.04062}, +{2976.48, 38.3318, 3.94587}, +{3024.63, 37.9662, 3.85353}, +{3073.55, 37.5349, 3.76361}, +{3123.26, 37.0115, 3.67596}, +{3173.78, 36.3499, 3.59056}, +{3225.11, 35.4564, 3.50738}, +{3277.27, 34.0841, 3.42637}, +{3330.28, 30.9467, 3.34743}, +{3351.00, 18.1610, 3.31742}, +{3351.20, 18.1618, 10.8260}, +{3384.15, 31.9201, 10.6678}, +{3438.88, 33.8150, 10.4135}, +{3494.50, 33.8391, 10.1657}, +{3523.60, 27.6385, 10.0399}, +{3523.80, 27.6422, 13.7502}, +{3551.02, 34.6661, 13.5923}, +{3608.46, 36.6213, 13.2689}, +{3666.82, 37.6552, 12.9532}, +{3726.13, 38.2768, 12.6444}, +{3786.40, 38.0760, 12.3435}, +{3805.70, 35.7476, 12.2496}, +{3805.90, 35.7534, 14.0388}, +{3847.64, 39.3005, 13.8258}, +{3909.87, 40.3636, 13.5182}, +{3973.11, 41.1148, 13.2155}, +{4037.38, 41.7267, 12.9155}, +{4102.68, 42.2492, 12.6208}, +{4169.03, 42.7075, 12.3301}, +{4236.46, 43.1144, 12.0439}, +{4304.98, 43.4794, 11.7626}, +{4374.62, 43.8101, 11.4863}, +{4445.37, 44.1104, 11.2136}, +{4517.27, 44.3840, 10.9460}, +{4590.33, 44.6343, 10.6833}, +{4664.58, 44.8638, 10.4251}, +{4740.03, 45.0746, 10.1717}, +{4816.69, 45.2684, 9.92324}, +{4894.60, 45.4468, 9.67948}, +{4973.77, 45.6110, 9.44039}, +{5054.21, 45.7624, 9.20601}, +{5135.96, 45.9017, 8.97641}, +{5219.03, 46.0301, 8.75149}, +{5303.44, 46.1482, 8.53119}, +{5389.22, 46.2569, 8.31557}, +{5476.39, 46.3569, 8.10442}, +{5564.97, 46.4485, 7.89794}, +{5654.98, 46.5325, 7.69578}, +{5746.44, 46.6094, 7.49817}, +{5839.39, 46.6798, 7.30492}, +{5933.83, 46.7438, 7.11596}, +{6029.81, 46.8020, 6.93126}, +{6127.33, 46.8547, 6.75079}, +{6226.44, 46.9023, 6.57444}, +{6327.15, 46.9451, 6.40224}, +{6429.48, 46.9834, 6.23409}, +{6533.48, 47.0175, 6.06975}, +{6639.15, 47.0476, 5.90945}, +{6746.54, 47.0741, 5.75290}, +{6855.65, 47.0971, 5.60018}, +{6966.54, 47.1167, 5.45094}, +{7079.22, 47.1332, 5.30552}, +{7193.72, 47.1469, 5.16361}, +{7310.07, 47.1578, 5.02523}, +{7428.31, 47.1663, 4.89031}, +{7548.45, 47.1724, 4.75869}, +{7670.54, 47.1763, 4.63026}, +{7794.61, 47.1779, 4.50510}, +{7920.68, 47.1777, 4.38327}, +{8048.79, 47.1755, 4.26427}, +{8178.98, 47.1718, 4.14847}, +{8311.26, 47.1663, 4.03554}, +{8445.69, 47.1593, 3.92563}, +{8582.29, 47.1509, 3.81844}, +{8721.11, 47.1413, 3.71407}, +{8862.16, 47.1303, 3.61232}, +{9005.50, 47.1181, 3.51332}, +{9151.16, 47.1050, 3.41702}, +{9299.17, 47.0910, 3.32309}, +{9449.58, 47.0758, 3.23157}, +{9602.42, 47.0597, 3.14262}, +{9757.73, 47.0430, 3.05603}, +{9915.55, 47.0254, 2.97157}, +{10075.9, 47.0071, 2.88946}, +{10238.9, 46.9881, 2.80955}, +{10404.5, 46.9685, 2.73178}, +{10572.8, 46.9483, 2.65609}, +{10743.8, 46.9276, 2.58245}, +{10917.6, 46.9064, 2.51078}, +{11094.2, 46.8847, 2.44106}, +{11273.6, 46.8626, 2.37322}, +{11455.9, 46.8401, 2.30723}, +{11641.2, 46.8171, 2.24304}, +{11829.5, 46.7938, 2.18059}, +{12020.8, 46.7702, 2.11985}, +{12215.3, 46.7462, 2.06077}, +{12412.8, 46.7218, 2.00331}, +{12613.6, 46.6972, 1.94743}, +{12817.6, 46.6723, 1.89309}, +{13025.0, 46.6470, 1.84024}, +{13235.6, 46.6215, 1.78885}, +{13449.7, 46.5957, 1.73889}, +{13667.2, 46.5696, 1.69030}, +{13888.3, 46.5431, 1.64307}, +{14112.9, 46.5164, 1.59714}, +{14341.2, 46.4894, 1.55249}, +{14573.1, 46.4620, 1.50908}, +{14808.9, 46.4342, 1.46688}, +{15048.4, 46.4061, 1.42586}, +{15291.8, 46.3776, 1.38599}, +{15539.1, 46.3486, 1.34723}, +{15790.4, 46.3192, 1.30955}, +{16045.8, 46.2892, 1.27293}, +{16305.4, 46.2587, 1.23733}, +{16569.1, 46.2276, 1.20274}, +{16837.1, 46.1957, 1.16911}, +{17109.4, 46.1632, 1.13643}, +{17386.1, 46.1297, 1.10467}, +{17667.4, 46.0954, 1.07380}, +{17953.1, 46.0599, 1.04381}, +{18243.5, 46.0233, 1.01465}, +{18538.6, 45.9853, 0.986325}, +{18838.4, 45.9458, 0.958794}, +{19143.1, 45.9046, 0.932041}, +{19452.7, 45.8614, 0.906044}, +{19767.4, 45.8159, 0.880780}, +{20087.1, 45.7677, 0.856231}, +{20412.0, 45.7164, 0.832377}, +{20742.1, 45.6615, 0.809197}, +{21077.6, 45.6022, 0.786673}, +{21418.5, 45.5377, 0.764788}, +{21765.0, 45.4668, 0.743521}, +{22117.0, 45.3880, 0.722858}, +{22474.7, 45.2991, 0.702780}, +{22838.2, 45.1973, 0.683270}, +{23207.6, 45.0780, 0.664314}, +{23583.0, 44.9342, 0.645895}, +{23964.4, 44.7539, 0.627998}, +{24352.0, 44.5141, 0.610608}, +{24745.9, 44.1612, 0.593712}, +{25146.2, 43.5138, 0.577294}, +{25513.9, 35.7672, 0.562829}, +{25514.1, 35.7674, 3.56169}, +{25552.9, 41.4593, 3.55330}, +{25966.2, 43.8729, 3.46583}, +{26386.1, 44.5460, 3.38000}, +{26812.9, 44.9598, 3.29582}, +{27246.6, 45.2599, 3.21329}, +{27687.3, 45.4949, 3.13240}, +{28135.1, 45.6872, 3.05314}, +{28590.2, 45.8492, 2.97550}, +{29052.6, 45.9888, 2.89948}, +{29522.5, 46.1180, 2.82506}, +{30000.0, 46.1929, 2.75222}, +{0, 0, 0} +}; + +e_fp_fdp cd[] = { /* Z = 48 */ +{10.0000, -9999.00, 0.400039}, +{10.1617, -9999.00, 0.418419}, +{10.3261, -9999.00, 0.437644}, +{10.4931, -9999.00, 0.457752}, +{10.6628, -9999.00, 0.493615}, +{10.8353, -9999.00, 0.536851}, +{11.0106, -9999.00, 0.592578}, +{11.1886, -9999.00, 0.663282}, +{11.3696, -9999.00, 0.742420}, +{11.5535, -9999.00, 0.861255}, +{11.7404, -9999.00, 0.993746}, +{11.9303, -9999.00, 1.04408}, +{12.1232, -9999.00, 1.09696}, +{12.3193, -9999.00, 1.15252}, +{12.5186, -9999.00, 1.21090}, +{12.7210, -9999.00, 1.27223}, +{12.9268, -9999.00, 1.31700}, +{13.1359, -9999.00, 1.35518}, +{13.3483, -9999.00, 1.39447}, +{13.5642, -9999.00, 1.43490}, +{13.7836, -9999.00, 1.46675}, +{14.0066, -9999.00, 1.49503}, +{14.2331, -9999.00, 1.52386}, +{14.4633, -9999.00, 1.55324}, +{14.6973, -9999.00, 1.58319}, +{14.9350, -9999.00, 1.61386}, +{15.1765, -9999.00, 1.65189}, +{15.4220, -9999.00, 1.69082}, +{15.6714, -9999.00, 1.73068}, +{15.9249, -9999.00, 1.77146}, +{16.1825, -9999.00, 1.81322}, +{16.4442, -9999.00, 1.85595}, +{16.7102, -9999.00, 1.89969}, +{16.9805, -9999.00, 1.94447}, +{17.2551, -9999.00, 1.99030}, +{17.5342, -9999.00, 2.03720}, +{17.8178, -9999.00, 2.08522}, +{18.1060, -9999.00, 2.13437}, +{18.3989, -9999.00, 2.18467}, +{18.6964, -9999.00, 2.23616}, +{18.9988, -9999.00, 2.30335}, +{19.3061, -9999.00, 2.38300}, +{19.6184, -9999.00, 2.46541}, +{19.9357, -9999.00, 2.55067}, +{20.2582, -9999.00, 2.63888}, +{20.5858, -9999.00, 2.73013}, +{20.9188, -9999.00, 2.82455}, +{21.2571, -9999.00, 2.93634}, +{21.6009, -9999.00, 3.06457}, +{21.9503, -9999.00, 3.19841}, +{22.3053, -9999.00, 3.33808}, +{22.6661, -9999.00, 3.48385}, +{23.0327, -9999.00, 3.63599}, +{23.4053, -9999.00, 3.79478}, +{23.7838, -9999.00, 3.96050}, +{24.1685, -9999.00, 4.10362}, +{24.5594, -9999.00, 4.24965}, +{24.9566, -9999.00, 4.40088}, +{25.3603, -9999.00, 4.55749}, +{25.7705, -9999.00, 4.71967}, +{26.1873, -9999.00, 4.88762}, +{26.6109, -9999.00, 5.06155}, +{27.0413, -9999.00, 5.21645}, +{27.4786, -9999.00, 5.37271}, +{27.9231, -9999.00, 5.53366}, +{28.3747, -9999.00, 5.69942}, +{28.8337, -9999.00, 5.87016}, +{29.3000, 1.92132, 6.04600}, +{29.7739, 1.95870, 6.22712}, +{30.2555, 2.00347, 6.41366}, +{30.7449, 2.05887, 6.60579}, +{31.2421, 2.13188, 6.80368}, +{31.7475, 2.22995, 6.97608}, +{32.2609, 2.30955, 7.13371}, +{32.7827, 2.38386, 7.29491}, +{33.3130, 2.45750, 7.45974}, +{33.8518, 2.53262, 7.62830}, +{34.3993, 2.61077, 7.80067}, +{34.9557, 2.69354, 7.97693}, +{35.5211, 2.78329, 8.15718}, +{36.0956, 2.88673, 8.34150}, +{36.6794, 2.99810, 8.50370}, +{37.2727, 3.10092, 8.66572}, +{37.8755, 3.20155, 8.83082}, +{38.4882, 3.30326, 8.99907}, +{39.1107, 3.40710, 9.17052}, +{39.7432, 3.51390, 9.34524}, +{40.3861, 3.62436, 9.52329}, +{41.0393, 3.73938, 9.70474}, +{41.7031, 3.85954, 9.88864}, +{42.3776, 3.98448, 10.0757}, +{43.0630, 4.11523, 10.2662}, +{43.7595, 4.25280, 10.4604}, +{44.4673, 4.39831, 10.6583}, +{45.1865, 4.55323, 10.8599}, +{45.9174, 4.71968, 11.0653}, +{46.6600, 4.90458, 11.2746}, +{47.4147, 5.12536, 11.4757}, +{48.1816, 5.33801, 11.6323}, +{48.9609, 5.53753, 11.7910}, +{49.7528, 5.73522, 11.9518}, +{50.5576, 5.93432, 12.1149}, +{51.3753, 6.13673, 12.2802}, +{52.2062, 6.34396, 12.4478}, +{53.0506, 6.55752, 12.6176}, +{53.9087, 6.77962, 12.7898}, +{54.7806, 7.01556, 12.9599}, +{55.6667, 7.25391, 13.1213}, +{56.5670, 7.49600, 13.2847}, +{57.4820, 7.74478, 13.4501}, +{58.4117, 8.00243, 13.6176}, +{59.3564, 8.27088, 13.7872}, +{60.3165, 8.55256, 13.9589}, +{61.2921, 8.85083, 14.1327}, +{62.2834, 9.17288, 14.3087}, +{63.2908, 9.53797, 14.4869}, +{64.3145, 9.95094, 14.5893}, +{65.3547, 10.3170, 14.6480}, +{66.4118, 10.6651, 14.7069}, +{67.4859, 11.0074, 14.7660}, +{68.5775, 11.3503, 14.8254}, +{69.6867, 11.7005, 14.8850}, +{70.8138, 12.0630, 14.9281}, +{71.9591, 12.4157, 14.9596}, +{73.1230, 12.7672, 14.9911}, +{74.3057, 13.1222, 15.0227}, +{75.5076, 13.4842, 15.0544}, +{76.7289, 13.8580, 15.0861}, +{77.9699, 14.2558, 15.1179}, +{79.2310, 14.6616, 15.1063}, +{80.5125, 15.0612, 15.0932}, +{81.8147, 15.4642, 15.0801}, +{83.1380, 15.8791, 15.0671}, +{84.4827, 16.3126, 15.0540}, +{85.8491, 16.7804, 15.0410}, +{87.2377, 17.3388, 14.9809}, +{88.6487, 17.8510, 14.8342}, +{90.0825, 18.3398, 14.6890}, +{91.5395, 18.8475, 14.5451}, +{93.0201, 19.4316, 14.4027}, +{94.5246, 20.0338, 14.0815}, +{96.0535, 20.5494, 13.7289}, +{97.6071, 21.0436, 13.3852}, +{99.1858, 21.5688, 13.0501}, +{100.790, 22.2626, 12.6636}, +{102.420, 22.7938, 11.8623}, +{104.077, 23.1195, 11.1116}, +{105.760, 23.3209, 10.4085}, +{107.471, 23.4530, 9.74983}, +{109.209, 23.5384, 9.13287}, +{110.975, 23.6002, 8.55495}, +{112.770, 23.6927, 8.01359}, +{114.594, 23.7887, 7.33221}, +{116.448, 23.7072, 6.62555}, +{118.331, 23.5298, 5.98701}, +{120.245, 23.2935, 5.40999}, +{122.190, 23.0109, 4.88859}, +{124.166, 22.6816, 4.41745}, +{126.175, 22.2585, 4.05148}, +{128.215, 21.9290, 3.82757}, +{130.289, 21.6526, 3.61604}, +{132.397, 21.4053, 3.41620}, +{134.538, 21.1833, 3.22739}, +{136.714, 21.0226, 3.04903}, +{138.925, 20.8329, 2.74069}, +{141.172, 20.5504, 2.45221}, +{143.456, 20.1828, 2.22983}, +{145.776, 19.8503, 2.09547}, +{148.134, 19.5098, 1.97671}, +{150.530, 19.1967, 1.93078}, +{152.964, 18.9087, 1.88592}, +{155.439, 18.6126, 1.85429}, +{157.953, 18.3385, 1.85193}, +{160.507, 18.0729, 1.84957}, +{163.103, 17.7711, 1.87250}, +{165.742, 17.5124, 1.96692}, +{168.422, 17.2849, 2.07018}, +{171.146, 17.0891, 2.18710}, +{173.915, 16.9210, 2.31063}, +{176.727, 16.7910, 2.44113}, +{179.586, 16.6867, 2.53742}, +{182.491, 16.5750, 2.62155}, +{185.442, 16.4641, 2.70847}, +{188.442, 16.3579, 2.79827}, +{191.489, 16.2576, 2.89105}, +{194.587, 16.1642, 2.98691}, +{197.734, 16.0787, 3.08594}, +{200.932, 16.0030, 3.18826}, +{204.182, 15.9445, 3.29397}, +{207.485, 15.8913, 3.37628}, +{210.840, 15.8354, 3.45963}, +{214.251, 15.7794, 3.54503}, +{217.716, 15.7269, 3.63255}, +{221.237, 15.6790, 3.72222}, +{224.816, 15.6375, 3.81410}, +{228.452, 15.6054, 3.90825}, +{232.147, 15.5936, 4.00473}, +{235.902, 15.5913, 4.06298}, +{239.717, 15.5744, 4.11172}, +{243.595, 15.5467, 4.16105}, +{247.535, 15.5156, 4.21097}, +{251.538, 15.4826, 4.26148}, +{255.607, 15.4491, 4.31260}, +{259.741, 15.4169, 4.36434}, +{263.942, 15.3884, 4.41670}, +{268.211, 15.3902, 4.45524}, +{272.549, 15.3677, 4.45725}, +{276.957, 15.3205, 4.45925}, +{281.437, 15.2616, 4.46126}, +{285.989, 15.1920, 4.46327}, +{290.615, 15.1123, 4.46528}, +{295.315, 15.0227, 4.46729}, +{300.092, 14.9234, 4.46931}, +{304.945, 14.8146, 4.47132}, +{309.878, 14.6990, 4.47314}, +{314.890, 14.5684, 4.46266}, +{319.983, 14.4194, 4.45221}, +{325.158, 14.2517, 4.44178}, +{330.418, 14.0649, 4.43137}, +{335.762, 13.8570, 4.42099}, +{341.192, 13.6247, 4.41063}, +{346.711, 13.3650, 4.40440}, +{352.319, 13.0786, 4.40091}, +{358.017, 12.7606, 4.39743}, +{363.808, 12.4025, 4.39396}, +{369.692, 11.9930, 4.39048}, +{375.672, 11.4980, 4.39609}, +{381.748, 10.9667, 4.47478}, +{387.922, 10.3913, 4.55488}, +{394.197, 9.74172, 4.63641}, +{400.573, 8.98721, 4.71940}, +{405.100, 8.68686, 4.77842}, +{405.300, 8.62236, 4.32288}, +{407.052, 7.79045, 4.52168}, +{413.635, 6.36909, 5.34514}, +{420.326, 5.18791, 6.31858}, +{427.124, 4.09315, 7.46926}, +{434.032, 3.05345, 8.82954}, +{441.052, 2.10524, 10.4375}, +{448.186, 1.27547, 12.3383}, +{455.435, 0.664412, 14.5700}, +{462.802, 0.351553, 17.1909}, +{470.287, 0.601950, 20.2831}, +{477.894, 2.21338, 23.6835}, +{485.623, 4.91570, 26.0154}, +{493.478, 7.88153, 26.9206}, +{501.459, 10.1460, 27.0075}, +{509.570, 11.8344, 27.0947}, +{517.812, 13.4846, 27.1821}, +{526.187, 14.9340, 26.8391}, +{534.698, 16.0908, 26.4624}, +{543.346, 17.0042, 26.0910}, +{552.134, 17.7134, 25.7248}, +{561.065, 18.1179, 25.5428}, +{570.139, 18.6004, 25.6342}, +{579.361, 19.2047, 25.7259}, +{588.732, 19.8241, 25.8179}, +{598.254, 20.4560, 25.9103}, +{607.930, 21.1062, 26.0029}, +{617.763, 21.7794, 26.0606}, +{627.755, 22.4329, 26.0875}, +{637.908, 23.0654, 26.1144}, +{648.226, 23.6940, 26.1413}, +{658.711, 24.3233, 26.1683}, +{669.365, 24.9584, 26.1952}, +{680.191, 25.6242, 26.2222}, +{691.193, 26.3133, 26.2000}, +{702.372, 26.9713, 26.1349}, +{713.733, 27.6117, 26.0700}, +{725.277, 28.2499, 26.0052}, +{737.008, 28.8935, 25.9406}, +{748.928, 29.5995, 25.8762}, +{761.042, 30.2999, 25.7016}, +{773.351, 30.9503, 25.5118}, +{785.859, 31.5858, 25.3234}, +{798.570, 32.2274, 25.1364}, +{811.486, 32.9195, 24.9507}, +{824.611, 33.6579, 24.6144}, +{837.949, 34.2929, 24.1751}, +{851.502, 34.8168, 23.7519}, +{865.274, 35.2937, 23.3468}, +{879.269, 35.7447, 22.9583}, +{893.491, 36.1738, 22.5762}, +{907.943, 36.5842, 22.2003}, +{922.628, 36.9847, 21.8306}, +{937.551, 37.3674, 21.4466}, +{952.715, 37.7296, 21.0642}, +{968.124, 38.0705, 20.6841}, +{983.783, 38.3970, 20.3109}, +{999.695, 38.7153, 19.9399}, +{1015.86, 39.0343, 19.5709}, +{1032.29, 39.3302, 19.1670}, +{1048.99, 39.5983, 18.7666}, +{1065.96, 39.8394, 18.3698}, +{1083.20, 40.0597, 17.9813}, +{1100.72, 40.2627, 17.6012}, +{1118.52, 40.4507, 17.2292}, +{1136.61, 40.6249, 16.8649}, +{1155.00, 40.7866, 16.5083}, +{1173.68, 40.9366, 16.1592}, +{1192.66, 41.0758, 15.8176}, +{1211.95, 41.2048, 15.4831}, +{1231.55, 41.3242, 15.1557}, +{1251.47, 41.4343, 14.8357}, +{1271.72, 41.5360, 14.5231}, +{1292.29, 41.6305, 14.2179}, +{1313.19, 41.7180, 13.9188}, +{1334.43, 41.7984, 13.6260}, +{1356.01, 41.8720, 13.3394}, +{1377.94, 41.9390, 13.0589}, +{1400.23, 41.9995, 12.7843}, +{1422.88, 42.0533, 12.5155}, +{1445.89, 42.1000, 12.2524}, +{1469.28, 42.1378, 11.9969}, +{1493.04, 42.1666, 11.7499}, +{1517.19, 42.1947, 11.5219}, +{1541.73, 42.2253, 11.3002}, +{1566.67, 42.2571, 11.0828}, +{1592.01, 42.2882, 10.8697}, +{1617.76, 42.3185, 10.6606}, +{1643.92, 42.3476, 10.4554}, +{1670.51, 42.3759, 10.2544}, +{1697.53, 42.4036, 10.0571}, +{1724.99, 42.4379, 9.86351}, +{1752.89, 42.4701, 9.66015}, +{1781.24, 42.4943, 9.45640}, +{1810.05, 42.5113, 9.25350}, +{1839.32, 42.5211, 9.05474}, +{1869.07, 42.5262, 8.86031}, +{1899.30, 42.5272, 8.67031}, +{1930.02, 42.5247, 8.48435}, +{1961.24, 42.5191, 8.30235}, +{1992.96, 42.5084, 8.12413}, +{2025.20, 42.5055, 7.95651}, +{2057.95, 42.5010, 7.77577}, +{2091.24, 42.4867, 7.59693}, +{2125.06, 42.4672, 7.42037}, +{2159.43, 42.4425, 7.24551}, +{2194.36, 42.4127, 7.07294}, +{2229.85, 42.3777, 6.90212}, +{2265.92, 42.3374, 6.73347}, +{2302.57, 42.2914, 6.56637}, +{2339.81, 42.2393, 6.40135}, +{2377.66, 42.1813, 6.23853}, +{2416.11, 42.1168, 6.07751}, +{2455.19, 42.0453, 5.91851}, +{2494.90, 41.9667, 5.76148}, +{2535.26, 41.8803, 5.60617}, +{2576.26, 41.7852, 5.45285}, +{2617.93, 41.6811, 5.30151}, +{2660.27, 41.5670, 5.15212}, +{2703.30, 41.4420, 5.00438}, +{2747.03, 41.3048, 4.85853}, +{2791.46, 41.1540, 4.71465}, +{2836.61, 40.9880, 4.57268}, +{2882.49, 40.8048, 4.43238}, +{2929.11, 40.6017, 4.29386}, +{2976.48, 40.3752, 4.15725}, +{3024.63, 40.1214, 4.02248}, +{3073.55, 39.8348, 3.88941}, +{3123.26, 39.5076, 3.75791}, +{3173.78, 39.1292, 3.62831}, +{3225.11, 38.6842, 3.50057}, +{3277.27, 38.1488, 3.37448}, +{3330.28, 37.4821, 3.24981}, +{3384.15, 36.6063, 3.12696}, +{3438.88, 35.3409, 3.00594}, +{3494.50, 33.0285, 2.88655}, +{3537.40, 17.0228, 2.79895}, +{3537.60, 17.0232, 11.0389}, +{3551.02, 29.8592, 10.9769}, +{3608.46, 33.8701, 10.7176}, +{3666.82, 34.7193, 10.4648}, +{3726.13, 30.6730, 10.2180}, +{3726.90, 28.0714, 10.2148}, +{3727.10, 28.0766, 14.0187}, +{3786.40, 36.5710, 13.6680}, +{3847.64, 37.9410, 13.3205}, +{3909.87, 38.7346, 12.9812}, +{3973.11, 39.2115, 12.6508}, +{4017.90, 35.8107, 12.4250}, +{4018.10, 35.8164, 14.4626}, +{4037.38, 39.2057, 14.3611}, +{4102.68, 40.7582, 14.0258}, +{4169.03, 41.6577, 13.6966}, +{4236.46, 42.3572, 13.3730}, +{4304.98, 42.9426, 13.0563}, +{4374.62, 43.4487, 12.7442}, +{4445.37, 43.8935, 12.4379}, +{4517.27, 44.2898, 12.1378}, +{4590.33, 44.6459, 11.8430}, +{4664.58, 44.9676, 11.5539}, +{4740.03, 45.2595, 11.2705}, +{4816.69, 45.5254, 10.9927}, +{4894.60, 45.7682, 10.7205}, +{4973.77, 45.9904, 10.4537}, +{5054.21, 46.1939, 10.1926}, +{5135.96, 46.3807, 9.93705}, +{5219.03, 46.5522, 9.68676}, +{5303.44, 46.7098, 9.44205}, +{5389.22, 46.8545, 9.20244}, +{5476.39, 46.9874, 8.96818}, +{5564.97, 47.1097, 8.73917}, +{5654.98, 47.2218, 8.51506}, +{5746.44, 47.3246, 8.29613}, +{5839.39, 47.4188, 8.08211}, +{5933.83, 47.5049, 7.87307}, +{6029.81, 47.5836, 7.66898}, +{6127.33, 47.6555, 7.46934}, +{6226.44, 47.7208, 7.27449}, +{6327.15, 47.7800, 7.08413}, +{6429.48, 47.8335, 6.89861}, +{6533.48, 47.8819, 6.71713}, +{6639.15, 47.9252, 6.54022}, +{6746.54, 47.9640, 6.36756}, +{6855.65, 47.9985, 6.19912}, +{6966.54, 48.0288, 6.03463}, +{7079.22, 48.0553, 5.87430}, +{7193.72, 48.0783, 5.71804}, +{7310.07, 48.0981, 5.56564}, +{7428.31, 48.1148, 5.41673}, +{7548.45, 48.1284, 5.27177}, +{7670.54, 48.1392, 5.13036}, +{7794.61, 48.1476, 4.99278}, +{7920.68, 48.1536, 4.85838}, +{8048.79, 48.1573, 4.72739}, +{8178.98, 48.1589, 4.59991}, +{8311.26, 48.1585, 4.47548}, +{8445.69, 48.1561, 4.35458}, +{8582.29, 48.1523, 4.23661}, +{8721.11, 48.1468, 4.12167}, +{8862.16, 48.1397, 4.00959}, +{9005.50, 48.1310, 3.90067}, +{9151.16, 48.1213, 3.79455}, +{9299.17, 48.1104, 3.69100}, +{9449.58, 48.0980, 3.59015}, +{9602.42, 48.0847, 3.49233}, +{9757.73, 48.0707, 3.39687}, +{9915.55, 48.0555, 3.30356}, +{10075.9, 48.0392, 3.21306}, +{10238.9, 48.0222, 3.12496}, +{10404.5, 48.0045, 3.03921}, +{10572.8, 47.9861, 2.95573}, +{10743.8, 47.9671, 2.87448}, +{10917.6, 47.9474, 2.79540}, +{11094.2, 47.9271, 2.71844}, +{11273.6, 47.9063, 2.64354}, +{11455.9, 47.8851, 2.57066}, +{11641.2, 47.8633, 2.49973}, +{11829.5, 47.8411, 2.43072}, +{12020.8, 47.8185, 2.36357}, +{12215.3, 47.7955, 2.29823}, +{12412.8, 47.7721, 2.23466}, +{12613.6, 47.7483, 2.17281}, +{12817.6, 47.7242, 2.11264}, +{13025.0, 47.6998, 2.05410}, +{13235.6, 47.6751, 1.99716}, +{13449.7, 47.6500, 1.94176}, +{13667.2, 47.6247, 1.88787}, +{13888.3, 47.5990, 1.83545}, +{14112.9, 47.5731, 1.78447}, +{14341.2, 47.5468, 1.73487}, +{14573.1, 47.5202, 1.68663}, +{14808.9, 47.4933, 1.63971}, +{15048.4, 47.4661, 1.59407}, +{15291.8, 47.4384, 1.54968}, +{15539.1, 47.4105, 1.50651}, +{15790.4, 47.3821, 1.46452}, +{16045.8, 47.3533, 1.42369}, +{16305.4, 47.3240, 1.38397}, +{16569.1, 47.2942, 1.34535}, +{16837.1, 47.2639, 1.30778}, +{17109.4, 47.2330, 1.27125}, +{17386.1, 47.2014, 1.23572}, +{17667.4, 47.1691, 1.20117}, +{17953.1, 47.1360, 1.16757}, +{18243.5, 47.1020, 1.13489}, +{18538.6, 47.0670, 1.10311}, +{18838.4, 47.0308, 1.07221}, +{19143.1, 46.9934, 1.04216}, +{19452.7, 46.9546, 1.01293}, +{19767.4, 46.9142, 0.984506}, +{20087.1, 46.8720, 0.956865}, +{20412.0, 46.8276, 0.929983}, +{20742.1, 46.7808, 0.903842}, +{21077.6, 46.7313, 0.878419}, +{21418.5, 46.6784, 0.853696}, +{21765.0, 46.6217, 0.829651}, +{22117.0, 46.5604, 0.806268}, +{22474.7, 46.4936, 0.783528}, +{22838.2, 46.4200, 0.761412}, +{23207.6, 46.3380, 0.739903}, +{23583.0, 46.2453, 0.718984}, +{23964.4, 46.1387, 0.698640}, +{24352.0, 46.0133, 0.678853}, +{24745.9, 45.8615, 0.659610}, +{25146.2, 45.6697, 0.640893}, +{25552.9, 45.4117, 0.622689}, +{25966.2, 45.0240, 0.604983}, +{26386.1, 44.2697, 0.587761}, +{26711.1, 36.4239, 0.574954}, +{26711.3, 36.4240, 3.65393}, +{26812.9, 43.2295, 3.63215}, +{27246.6, 44.9251, 3.54155}, +{27687.3, 45.5586, 3.45277}, +{28135.1, 45.9614, 3.36578}, +{28590.2, 46.2575, 3.28058}, +{29052.6, 46.4909, 3.19715}, +{29522.5, 46.6827, 3.11548}, +{30000.0, 46.8446, 3.03556}, +{0, 0, 0} +}; + +} // namespace table_data + +}}} // namespace cctbx::eltbx::henke diff --git a/extern/cctbx/cctbx/eltbx/henke_tables_49_60.cpp b/extern/cctbx/cctbx/eltbx/henke_tables_49_60.cpp new file mode 100644 index 00000000..29a7a26b --- /dev/null +++ b/extern/cctbx/cctbx/eltbx/henke_tables_49_60.cpp @@ -0,0 +1,6168 @@ +/* ***************************************************** + THIS IS AN AUTOMATICALLY GENERATED FILE. DO NOT EDIT. + ***************************************************** + + Generated by: + cctbx.source_generators.eltbx.generate_henke_cpp + */ + +#include + +namespace cctbx { namespace eltbx { namespace henke { + +namespace table_data { + +using anomalous::e_fp_fdp; + +e_fp_fdp in[] = { /* Z = 49 */ +{10.0000, -9999.00, 2.16244}, +{10.1617, -9999.00, 2.07002}, +{10.3261, -9999.00, 1.98155}, +{10.4931, -9999.00, 1.89686}, +{10.6628, -9999.00, 1.81579}, +{10.8353, -9999.00, 1.72844}, +{11.0106, -9999.00, 1.54985}, +{11.1886, -9999.00, 1.35731}, +{11.3696, -9999.00, 0.993252}, +{11.5535, -9999.00, 0.742018}, +{11.7404, -9999.00, 0.658180}, +{11.9303, -9999.00, 0.612667}, +{12.1232, -9999.00, 0.573696}, +{12.3193, -9999.00, 0.537374}, +{12.5186, -9999.00, 0.509773}, +{12.7210, -9999.00, 0.491373}, +{12.9268, -9999.00, 0.473638}, +{13.1359, -9999.00, 0.456589}, +{13.3483, -9999.00, 0.440370}, +{13.5642, -9999.00, 0.424728}, +{13.7836, -9999.00, 0.414034}, +{14.0066, -9999.00, 0.404843}, +{14.2331, -9999.00, 0.396113}, +{14.4633, -9999.00, 0.388198}, +{14.6973, -9999.00, 0.385980}, +{14.9350, -9999.00, 0.387391}, +{15.1765, -9999.00, 0.396152}, +{15.4220, -9999.00, 0.410419}, +{15.6714, -9999.00, 0.431951}, +{15.9249, -9999.00, 0.455912}, +{16.1825, -9999.00, 0.489651}, +{16.4442, -9999.00, 0.691634}, +{16.7102, -9999.00, 1.08283}, +{16.9805, -9999.00, 1.49226}, +{17.2551, -9999.00, 1.78423}, +{17.5342, -9999.00, 1.92144}, +{17.8178, -9999.00, 1.94167}, +{18.1060, -9999.00, 1.95766}, +{18.3989, -9999.00, 1.96600}, +{18.6964, -9999.00, 1.95605}, +{18.9988, -9999.00, 1.92465}, +{19.3061, -9999.00, 1.90352}, +{19.6184, -9999.00, 1.88557}, +{19.9357, -9999.00, 1.82853}, +{20.2582, -9999.00, 1.76749}, +{20.5858, -9999.00, 1.75409}, +{20.9188, -9999.00, 1.74106}, +{21.2571, -9999.00, 1.72812}, +{21.6009, -9999.00, 1.73515}, +{21.9503, -9999.00, 1.77156}, +{22.3053, -9999.00, 1.80874}, +{22.6661, -9999.00, 1.86471}, +{23.0327, -9999.00, 1.95371}, +{23.4053, -9999.00, 2.04696}, +{23.7838, -9999.00, 2.14466}, +{24.1685, -9999.00, 2.25579}, +{24.5594, -9999.00, 2.37578}, +{24.9566, -9999.00, 2.50216}, +{25.3603, -9999.00, 2.63526}, +{25.7705, -9999.00, 2.76576}, +{26.1873, -9999.00, 2.93943}, +{26.6109, -9999.00, 3.13348}, +{27.0413, -9999.00, 3.34034}, +{27.4786, -9999.00, 3.50223}, +{27.9231, -9999.00, 3.66764}, +{28.3747, -9999.00, 3.84087}, +{28.8337, -9999.00, 4.06669}, +{29.3000, -1.51987, 4.32792}, +{29.7739, -1.54706, 4.56695}, +{30.2555, -1.58334, 4.75454}, +{30.7449, -1.64752, 4.94983}, +{31.2421, -1.74136, 5.16036}, +{31.7475, -1.83332, 5.42475}, +{32.2609, -1.89419, 5.70269}, +{32.7827, -1.93995, 5.99488}, +{33.3130, -1.96255, 6.30145}, +{33.8518, -1.94319, 6.62114}, +{34.3993, -1.90687, 6.87184}, +{34.9557, -1.89740, 7.13204}, +{35.5211, -1.89168, 7.40209}, +{36.0956, -1.88415, 7.68236}, +{36.6794, -1.87242, 7.97325}, +{37.2727, -1.85346, 8.27515}, +{37.8755, -1.82528, 8.58848}, +{38.4882, -1.78472, 8.91368}, +{39.1107, -1.71506, 9.25118}, +{39.7432, -1.62506, 9.57113}, +{40.3861, -1.54115, 9.88020}, +{41.0393, -1.45722, 10.1993}, +{41.7031, -1.36657, 10.5286}, +{42.3776, -1.26484, 10.8686}, +{43.0630, -1.14874, 11.2196}, +{43.7595, -1.01435, 11.5819}, +{44.4673, -0.827350, 11.9559}, +{45.1865, -0.617621, 12.2735}, +{45.9174, -0.436164, 12.5863}, +{46.6600, -0.250289, 12.9071}, +{47.4147, -0.550070E-01, 13.2361}, +{48.1816, 0.157037, 13.5734}, +{48.9609, 0.408463, 13.9094}, +{49.7528, 0.668244, 14.1975}, +{50.5576, 0.903882, 14.4915}, +{51.3753, 1.14556, 14.7916}, +{52.2062, 1.39512, 15.0980}, +{53.0506, 1.65814, 15.4106}, +{53.9087, 1.93838, 15.7207}, +{54.7806, 2.22861, 16.0272}, +{55.6667, 2.52847, 16.3396}, +{56.5670, 2.84821, 16.6582}, +{57.4820, 3.19594, 16.9829}, +{58.4117, 3.59613, 17.3140}, +{59.3564, 4.07115, 17.5669}, +{60.3165, 4.51316, 17.7093}, +{61.2921, 4.87293, 17.8528}, +{62.2834, 5.20917, 17.9975}, +{63.2908, 5.47784, 18.1434}, +{64.3145, 5.71312, 18.3801}, +{65.3547, 6.01602, 18.7146}, +{66.4118, 6.39303, 19.0551}, +{67.4859, 6.96027, 19.4018}, +{68.5775, 7.55437, 19.4426}, +{69.6867, 7.89693, 19.4471}, +{70.8138, 8.09900, 19.4661}, +{71.9591, 8.25154, 19.7810}, +{73.1230, 8.51743, 20.1009}, +{74.3057, 8.68780, 20.4261}, +{75.5076, 8.85727, 21.0189}, +{76.7289, 9.27382, 21.7901}, +{77.9699, 9.89802, 22.5897}, +{79.2310, 10.8442, 23.4186}, +{80.5125, 12.0436, 24.0119}, +{81.8147, 13.2334, 24.3235}, +{83.1380, 14.4128, 24.6392}, +{84.4827, 15.9636, 24.9589}, +{85.8491, 17.6504, 24.6610}, +{87.2377, 18.9234, 24.0900}, +{88.6487, 20.0231, 23.5323}, +{90.0825, 21.0400, 22.9874}, +{91.5395, 22.0277, 22.4552}, +{93.0201, 23.0747, 21.9352}, +{94.5246, 24.3349, 21.4124}, +{96.0535, 25.5304, 20.0346}, +{97.6071, 26.2006, 18.7454}, +{99.1858, 26.6544, 17.5392}, +{100.790, 26.9621, 16.4105}, +{102.420, 27.1630, 15.3546}, +{104.077, 27.2812, 14.3665}, +{105.760, 27.3359, 13.4421}, +{107.471, 27.3408, 12.5771}, +{109.209, 27.3287, 11.7675}, +{110.975, 27.2772, 10.9499}, +{112.770, 27.1511, 10.1891}, +{114.594, 26.9928, 9.48115}, +{116.448, 26.8092, 8.82241}, +{118.331, 26.6063, 8.20945}, +{120.245, 26.3905, 7.63905}, +{122.190, 26.1664, 7.10830}, +{124.166, 25.9399, 6.61442}, +{126.175, 25.7178, 6.15485}, +{128.215, 25.5129, 5.72721}, +{130.289, 25.3659, 5.32929}, +{132.397, 25.2858, 4.79050}, +{134.538, 25.0639, 4.10820}, +{136.714, 24.6395, 3.52310}, +{138.925, 24.1500, 3.02132}, +{141.172, 23.6030, 2.63553}, +{143.456, 23.0693, 2.37563}, +{145.776, 22.5780, 2.15004}, +{148.134, 22.0825, 1.97681}, +{150.530, 21.5930, 1.86588}, +{152.964, 21.1290, 1.81419}, +{155.439, 20.7009, 1.81256}, +{157.953, 20.3192, 1.84702}, +{160.507, 19.9783, 1.88800}, +{163.103, 19.6640, 1.94576}, +{165.742, 19.3783, 2.00529}, +{168.422, 19.1071, 2.06792}, +{171.146, 18.8516, 2.14723}, +{173.915, 18.6169, 2.22959}, +{176.727, 18.3966, 2.31511}, +{179.586, 18.1872, 2.40391}, +{182.491, 17.9882, 2.50249}, +{185.442, 17.8035, 2.60565}, +{188.442, 17.6302, 2.71306}, +{191.489, 17.4678, 2.82490}, +{194.587, 17.3171, 2.94135}, +{197.734, 17.1771, 3.05935}, +{200.932, 17.0445, 3.18022}, +{204.182, 16.9205, 3.30587}, +{207.485, 16.8059, 3.43648}, +{210.840, 16.7019, 3.57226}, +{214.251, 16.6106, 3.71340}, +{217.716, 16.5397, 3.86012}, +{221.237, 16.4849, 3.98186}, +{224.816, 16.4229, 4.10237}, +{228.452, 16.3626, 4.22653}, +{232.147, 16.3079, 4.35445}, +{235.902, 16.2606, 4.48624}, +{239.717, 16.2224, 4.62201}, +{243.595, 16.2096, 4.76190}, +{247.535, 16.2092, 4.87200}, +{251.538, 16.1923, 4.97950}, +{255.607, 16.1785, 5.08938}, +{259.741, 16.1693, 5.20168}, +{263.942, 16.1677, 5.31645}, +{268.211, 16.1855, 5.43376}, +{272.549, 16.2257, 5.53876}, +{276.957, 16.2643, 5.59146}, +{281.437, 16.2791, 5.64465}, +{285.989, 16.2866, 5.69836}, +{290.615, 16.2914, 5.75257}, +{295.315, 16.2977, 5.80731}, +{300.092, 16.3144, 5.86256}, +{304.945, 16.3509, 5.88879}, +{309.878, 16.3676, 5.87070}, +{314.890, 16.3456, 5.85266}, +{319.983, 16.3086, 5.83467}, +{325.158, 16.2580, 5.81675}, +{330.418, 16.1986, 5.79887}, +{335.762, 16.1290, 5.76451}, +{341.192, 16.0338, 5.72340}, +{346.711, 15.9148, 5.68258}, +{352.319, 15.7748, 5.64204}, +{358.017, 15.6134, 5.60180}, +{363.808, 15.4305, 5.56184}, +{369.692, 15.2236, 5.51516}, +{375.672, 14.9827, 5.46471}, +{381.748, 14.7037, 5.41473}, +{387.922, 14.3835, 5.36520}, +{394.197, 14.0088, 5.31613}, +{400.573, 13.5727, 5.27970}, +{407.052, 13.0832, 5.27535}, +{413.635, 12.5374, 5.27101}, +{420.326, 11.8846, 5.26666}, +{427.124, 11.1169, 5.31364}, +{434.032, 10.2736, 5.41613}, +{441.052, 9.47596, 5.52059}, +{443.800, 10.6734, 5.56157}, +{444.000, 10.5639, 3.58563}, +{448.186, 6.68163, 4.49251}, +{455.435, 3.96074, 6.60583}, +{462.802, 2.52924, 9.71329}, +{470.287, 2.21022, 12.5187}, +{477.894, 1.97589, 15.3206}, +{485.623, 2.71371, 18.7498}, +{493.478, 4.82660, 20.8571}, +{501.459, 6.67054, 22.3283}, +{509.570, 8.30000, 23.2112}, +{517.812, 9.80035, 24.1291}, +{526.187, 11.4742, 24.7386}, +{534.698, 12.9700, 24.9583}, +{543.346, 14.3294, 25.1800}, +{552.134, 15.6461, 25.0704}, +{561.065, 16.6175, 24.8845}, +{570.139, 17.4461, 24.6999}, +{579.361, 18.1230, 24.5167}, +{588.732, 18.6809, 24.3966}, +{598.254, 19.2051, 24.3595}, +{607.930, 19.7052, 24.3223}, +{617.763, 20.2164, 24.2853}, +{627.755, 20.6751, 24.1094}, +{637.908, 20.6129, 23.7562}, +{648.226, 20.1002, 23.9302}, +{658.711, 19.8932, 25.1601}, +{669.365, 20.3338, 26.4532}, +{680.191, 21.4247, 27.8128}, +{691.193, 23.1840, 28.8952}, +{702.372, 25.0064, 28.6033}, +{713.733, 26.2436, 28.3143}, +{725.277, 27.3650, 28.0282}, +{737.008, 28.3850, 27.5828}, +{748.928, 29.1658, 27.0982}, +{761.042, 29.7932, 26.6222}, +{773.351, 30.1958, 26.2179}, +{785.859, 30.5723, 26.1563}, +{798.570, 31.1509, 26.0949}, +{811.486, 31.7727, 26.0337}, +{824.611, 32.5186, 25.9725}, +{837.949, 33.2978, 25.6803}, +{851.502, 33.9336, 25.3864}, +{865.274, 34.5536, 25.0957}, +{879.269, 35.2118, 24.8084}, +{893.491, 35.8707, 24.4025}, +{907.943, 36.4108, 23.9705}, +{922.628, 36.9053, 23.5460}, +{937.551, 37.3634, 23.1322}, +{952.715, 37.7949, 22.7266}, +{968.124, 38.2053, 22.3289}, +{983.783, 38.6003, 21.9382}, +{999.695, 38.9878, 21.5485}, +{1015.86, 39.3699, 21.1599}, +{1032.29, 39.7347, 20.7214}, +{1048.99, 40.0516, 20.2914}, +{1065.96, 40.3410, 19.8702}, +{1083.20, 40.6079, 19.4578}, +{1100.72, 40.8556, 19.0539}, +{1118.52, 41.0860, 18.6584}, +{1136.61, 41.3008, 18.2712}, +{1155.00, 41.5014, 17.8919}, +{1173.68, 41.6887, 17.5204}, +{1192.66, 41.8637, 17.1569}, +{1211.95, 42.0276, 16.8008}, +{1231.55, 42.1810, 16.4521}, +{1251.47, 42.3243, 16.1105}, +{1271.72, 42.4582, 15.7760}, +{1292.29, 42.5833, 15.4486}, +{1313.19, 42.7002, 15.1281}, +{1334.43, 42.8094, 14.8142}, +{1356.01, 42.9113, 14.5067}, +{1377.94, 43.0062, 14.2056}, +{1400.23, 43.0945, 13.9107}, +{1422.88, 43.1765, 13.6219}, +{1445.89, 43.2525, 13.3392}, +{1469.28, 43.3231, 13.0623}, +{1493.04, 43.3883, 12.7911}, +{1517.19, 43.4485, 12.5254}, +{1541.73, 43.5038, 12.2650}, +{1566.67, 43.5544, 12.0100}, +{1592.01, 43.6006, 11.7604}, +{1617.76, 43.6427, 11.5159}, +{1643.92, 43.6811, 11.2766}, +{1670.51, 43.7160, 11.0421}, +{1697.53, 43.7477, 10.8125}, +{1724.99, 43.7788, 10.5876}, +{1752.89, 43.8079, 10.3619}, +{1781.24, 43.8295, 10.1389}, +{1810.05, 43.8460, 9.91898}, +{1839.32, 43.8570, 9.70402}, +{1869.07, 43.8638, 9.49377}, +{1899.30, 43.8668, 9.28813}, +{1930.02, 43.8662, 9.08683}, +{1961.24, 43.8620, 8.88990}, +{1992.96, 43.8541, 8.69729}, +{2025.20, 43.8453, 8.51216}, +{2057.95, 43.8364, 8.32445}, +{2091.24, 43.8207, 8.13978}, +{2125.06, 43.8010, 7.95855}, +{2159.43, 43.7774, 7.78050}, +{2194.36, 43.7497, 7.60617}, +{2229.85, 43.7185, 7.43484}, +{2265.92, 43.6831, 7.26657}, +{2302.57, 43.6436, 7.10168}, +{2339.81, 43.6001, 6.93958}, +{2377.66, 43.5521, 6.78093}, +{2416.11, 43.4998, 6.62507}, +{2455.19, 43.4429, 6.47223}, +{2494.90, 43.3812, 6.32231}, +{2535.26, 43.3143, 6.17519}, +{2576.26, 43.2420, 6.03090}, +{2617.93, 43.1641, 5.88943}, +{2660.27, 43.0800, 5.75061}, +{2703.30, 42.9892, 5.61447}, +{2747.03, 42.8913, 5.48100}, +{2791.46, 42.7855, 5.35007}, +{2836.61, 42.6710, 5.22170}, +{2882.49, 42.5469, 5.09578}, +{2929.11, 42.4121, 4.97234}, +{2976.48, 42.2651, 4.85124}, +{3024.63, 42.1043, 4.73253}, +{3073.55, 41.9276, 4.61615}, +{3123.26, 41.7323, 4.50194}, +{3173.78, 41.5150, 4.39002}, +{3225.11, 41.2712, 4.28029}, +{3277.27, 40.9951, 4.17270}, +{3330.28, 40.6781, 4.06717}, +{3384.15, 40.3084, 3.96369}, +{3438.88, 39.8676, 3.86230}, +{3494.50, 39.3256, 3.76282}, +{3551.02, 38.6274, 3.66533}, +{3608.46, 37.6541, 3.56968}, +{3666.82, 36.0539, 3.47592}, +{3726.13, 29.5173, 3.38402}, +{3730.00, 21.0532, 3.37816}, +{3730.20, 21.0550, 10.6791}, +{3786.40, 35.5004, 10.4378}, +{3847.64, 36.7290, 10.1850}, +{3909.87, 36.4537, 9.93807}, +{3937.90, 30.3105, 9.83012}, +{3938.10, 30.3160, 13.5004}, +{3973.11, 37.5132, 13.3113}, +{4037.38, 39.2653, 12.9752}, +{4102.68, 40.1923, 12.6475}, +{4169.03, 40.7033, 12.3288}, +{4236.46, 39.0790, 12.0185}, +{4237.40, 37.9036, 12.0143}, +{4237.60, 37.9089, 13.8395}, +{4304.98, 41.9828, 13.5217}, +{4374.62, 42.9091, 13.2059}, +{4445.37, 43.6018, 12.8955}, +{4517.27, 44.1731, 12.5906}, +{4590.33, 44.6635, 12.2910}, +{4664.58, 45.0929, 11.9967}, +{4740.03, 45.4743, 11.7078}, +{4816.69, 45.8161, 11.4243}, +{4894.60, 46.1245, 11.1464}, +{4973.77, 46.4040, 10.8737}, +{5054.21, 46.6582, 10.6064}, +{5135.96, 46.8902, 10.3445}, +{5219.03, 47.1024, 10.0879}, +{5303.44, 47.2967, 9.83652}, +{5389.22, 47.4747, 9.59033}, +{5476.39, 47.6380, 9.34942}, +{5564.97, 47.7881, 9.11368}, +{5654.98, 47.9259, 8.88285}, +{5746.44, 48.0522, 8.65718}, +{5839.39, 48.1683, 8.43646}, +{5933.83, 48.2747, 8.22062}, +{6029.81, 48.3723, 8.00956}, +{6127.33, 48.4615, 7.80330}, +{6226.44, 48.5431, 7.60180}, +{6327.15, 48.6177, 7.40489}, +{6429.48, 48.6855, 7.21256}, +{6533.48, 48.7471, 7.02470}, +{6639.15, 48.8030, 6.84120}, +{6746.54, 48.8535, 6.66207}, +{6855.65, 48.8989, 6.48721}, +{6966.54, 48.9397, 6.31649}, +{7079.22, 48.9759, 6.14986}, +{7193.72, 49.0080, 5.98724}, +{7310.07, 49.0362, 5.82870}, +{7428.31, 49.0609, 5.67408}, +{7548.45, 49.0822, 5.52315}, +{7670.54, 49.1003, 5.37591}, +{7794.61, 49.1154, 5.23241}, +{7920.68, 49.1277, 5.09244}, +{8048.79, 49.1374, 4.95604}, +{8178.98, 49.1446, 4.82305}, +{8311.26, 49.1497, 4.69338}, +{8445.69, 49.1525, 4.56687}, +{8582.29, 49.1532, 4.44387}, +{8721.11, 49.1522, 4.32375}, +{8862.16, 49.1493, 4.20679}, +{9005.50, 49.1447, 4.09286}, +{9151.16, 49.1386, 3.98194}, +{9299.17, 49.1312, 3.87390}, +{9449.58, 49.1224, 3.76859}, +{9602.42, 49.1124, 3.66588}, +{9757.73, 49.1009, 3.56601}, +{9915.55, 49.0885, 3.46895}, +{10075.9, 49.0753, 3.37423}, +{10238.9, 49.0610, 3.28199}, +{10404.5, 49.0458, 3.19219}, +{10572.8, 49.0298, 3.10476}, +{10743.8, 49.0130, 3.01965}, +{10917.6, 48.9955, 2.93680}, +{11094.2, 48.9773, 2.85615}, +{11273.6, 48.9585, 2.77765}, +{11455.9, 48.9391, 2.70125}, +{11641.2, 48.9191, 2.62689}, +{11829.5, 48.8987, 2.55452}, +{12020.8, 48.8777, 2.48410}, +{12215.3, 48.8563, 2.41557}, +{12412.8, 48.8345, 2.34889}, +{12613.6, 48.8123, 2.28400}, +{12817.6, 48.7898, 2.22087}, +{13025.0, 48.7668, 2.15945}, +{13235.6, 48.7436, 2.09969}, +{13449.7, 48.7200, 2.04155}, +{13667.2, 48.6961, 1.98498}, +{13888.3, 48.6719, 1.92996}, +{14112.9, 48.6474, 1.87643}, +{14341.2, 48.6226, 1.82436}, +{14573.1, 48.5976, 1.77371}, +{14808.9, 48.5722, 1.72444}, +{15048.4, 48.5465, 1.67652}, +{15291.8, 48.5206, 1.62990}, +{15539.1, 48.4943, 1.58457}, +{15790.4, 48.4677, 1.54047}, +{16045.8, 48.4408, 1.49758}, +{16305.4, 48.4135, 1.45587}, +{16569.1, 48.3858, 1.41530}, +{16837.1, 48.3577, 1.37585}, +{17109.4, 48.3292, 1.33747}, +{17386.1, 48.3002, 1.30016}, +{17667.4, 48.2706, 1.26386}, +{17953.1, 48.2405, 1.22857}, +{18243.5, 48.2097, 1.19424}, +{18538.6, 48.1782, 1.16086}, +{18838.4, 48.1459, 1.12840}, +{19143.1, 48.1128, 1.09683}, +{19452.7, 48.0786, 1.06613}, +{19767.4, 48.0434, 1.03628}, +{20087.1, 48.0069, 1.00725}, +{20412.0, 47.9691, 0.979015}, +{20742.1, 47.9297, 0.951560}, +{21077.6, 47.8884, 0.924860}, +{21418.5, 47.8451, 0.898896}, +{21765.0, 47.7994, 0.873646}, +{22117.0, 47.7509, 0.849092}, +{22474.7, 47.6992, 0.825214}, +{22838.2, 47.6437, 0.801993}, +{23207.6, 47.5835, 0.779411}, +{23583.0, 47.5179, 0.757449}, +{23964.4, 47.4455, 0.736093}, +{24352.0, 47.3646, 0.715322}, +{24745.9, 47.2730, 0.695124}, +{25146.2, 47.1672, 0.675479}, +{25552.9, 47.0422, 0.656375}, +{25966.2, 46.8897, 0.637795}, +{26386.1, 46.6953, 0.619724}, +{26812.9, 46.4295, 0.602150}, +{27246.6, 46.0168, 0.585057}, +{27687.3, 45.1261, 0.568432}, +{27939.8, 37.8125, 0.559235}, +{27940.0, 37.8127, 3.51485}, +{28135.1, 44.9797, 3.47697}, +{28590.2, 46.1704, 3.39119}, +{29052.6, 46.7166, 3.30702}, +{29522.5, 47.0865, 3.22447}, +{30000.0, 47.3215, 3.14355}, +{0, 0, 0} +}; + +e_fp_fdp sn[] = { /* Z = 50 */ +{10.0000, -9999.00, 3.97344}, +{10.1617, -9999.00, 3.94095}, +{10.3261, -9999.00, 3.90871}, +{10.4931, -9999.00, 3.87675}, +{10.6628, -9999.00, 3.84504}, +{10.8353, -9999.00, 3.81359}, +{11.0106, -9999.00, 3.78240}, +{11.1886, -9999.00, 3.75146}, +{11.3696, -9999.00, 3.72078}, +{11.5535, -9999.00, 3.64688}, +{11.7404, -9999.00, 3.57189}, +{11.9303, -9999.00, 3.49845}, +{12.1232, -9999.00, 3.42652}, +{12.3193, -9999.00, 3.30574}, +{12.5186, -9999.00, 3.15089}, +{12.7210, -9999.00, 3.00330}, +{12.9268, -9999.00, 2.86262}, +{13.1359, -9999.00, 2.72511}, +{13.3483, -9999.00, 2.48316}, +{13.5642, -9999.00, 2.26270}, +{13.7836, -9999.00, 2.06181}, +{14.0066, -9999.00, 1.89987}, +{14.2331, -9999.00, 1.75449}, +{14.4633, -9999.00, 1.62024}, +{14.6973, -9999.00, 1.49626}, +{14.9350, -9999.00, 1.38177}, +{15.1765, -9999.00, 1.27604}, +{15.4220, -9999.00, 1.18242}, +{15.6714, -9999.00, 1.10196}, +{15.9249, -9999.00, 1.02698}, +{16.1825, -9999.00, 0.957105}, +{16.4442, -9999.00, 0.892970}, +{16.7102, -9999.00, 0.849459}, +{16.9805, -9999.00, 0.808068}, +{17.2551, -9999.00, 0.768695}, +{17.5342, -9999.00, 0.736073}, +{17.8178, -9999.00, 0.710695}, +{18.1060, -9999.00, 0.686194}, +{18.3989, -9999.00, 0.662536}, +{18.6964, -9999.00, 0.646280}, +{18.9988, -9999.00, 0.633782}, +{19.3061, -9999.00, 0.621526}, +{19.6184, -9999.00, 0.609507}, +{19.9357, -9999.00, 0.602556}, +{20.2582, -9999.00, 0.600727}, +{20.5858, -9999.00, 0.598903}, +{20.9188, -9999.00, 0.598391}, +{21.2571, -9999.00, 0.611967}, +{21.6009, -9999.00, 0.625852}, +{21.9503, -9999.00, 0.640967}, +{22.3053, -9999.00, 0.671939}, +{22.6661, -9999.00, 0.704407}, +{23.0327, -9999.00, 0.759304}, +{23.4053, -9999.00, 0.855339}, +{23.7838, -9999.00, 1.13890}, +{24.1685, -9999.00, 1.85247}, +{24.5594, -9999.00, 3.05677}, +{24.9566, -9999.00, 3.71424}, +{25.3603, -9999.00, 4.00664}, +{25.7705, -9999.00, 4.16638}, +{26.1873, -9999.00, 4.33249}, +{26.6109, -9999.00, 4.50523}, +{27.0413, -9999.00, 4.64204}, +{27.4786, -9999.00, 4.71650}, +{27.9231, -9999.00, 4.79216}, +{28.3747, -9999.00, 4.86903}, +{28.8337, -9999.00, 4.94188}, +{29.3000, -0.617521, 4.84384}, +{29.7739, -0.530603, 4.74774}, +{30.2555, -0.493238, 4.65354}, +{30.7449, -0.504236, 4.53693}, +{31.2421, -0.579138, 4.42302}, +{31.7475, -0.740259, 4.35143}, +{32.2609, -0.891436, 4.35427}, +{32.7827, -1.04661, 4.35711}, +{33.3130, -1.23597, 4.35995}, +{33.8518, -1.49552, 4.43789}, +{34.3993, -1.69890, 4.57867}, +{34.9557, -1.88562, 4.72392}, +{35.5211, -2.07385, 4.87378}, +{36.0956, -2.28420, 5.04642}, +{36.6794, -2.47739, 5.25911}, +{37.2727, -2.65929, 5.48077}, +{37.8755, -2.83839, 5.71177}, +{38.4882, -3.02366, 5.95251}, +{39.1107, -3.23022, 6.20530}, +{39.7432, -3.43246, 6.52769}, +{40.3861, -3.61050, 6.86683}, +{41.0393, -3.77494, 7.22358}, +{41.7031, -3.92842, 7.59887}, +{42.3776, -4.07153, 7.99366}, +{43.0630, -4.20419, 8.40895}, +{43.7595, -4.32668, 8.84582}, +{44.4673, -4.44102, 9.30963}, +{45.1865, -4.53474, 9.80363}, +{45.9174, -4.60691, 10.3239}, +{46.6600, -4.65499, 10.8717}, +{47.4147, -4.67411, 11.4486}, +{48.1816, -4.65234, 12.0561}, +{48.9609, -4.56273, 12.6958}, +{49.7528, -4.43830, 13.2701}, +{50.5576, -4.31588, 13.8664}, +{51.3753, -4.17074, 14.4895}, +{52.2062, -3.98944, 15.1406}, +{53.0506, -3.74917, 15.8210}, +{53.9087, -3.39804, 16.4976}, +{54.7806, -3.04284, 17.0915}, +{55.6667, -2.68217, 17.7067}, +{56.5670, -2.27866, 18.3441}, +{57.4820, -1.80131, 19.0045}, +{58.4117, -1.16270, 19.6886}, +{59.3564, -0.460873, 20.0565}, +{60.3165, 0.129707, 20.4000}, +{61.2921, 0.670513, 20.7493}, +{62.2834, 1.20275, 21.1046}, +{63.2908, 1.73961, 21.4660}, +{64.3145, 2.29963, 21.8321}, +{65.3547, 2.86725, 22.1597}, +{66.4118, 3.43340, 22.4921}, +{67.4859, 4.00987, 22.8296}, +{68.5775, 4.60720, 23.1721}, +{69.6867, 5.23614, 23.5197}, +{70.8138, 5.92357, 23.8726}, +{71.9591, 6.64032, 24.1389}, +{73.1230, 7.35628, 24.4043}, +{74.3057, 8.09902, 24.6726}, +{75.5076, 8.91923, 24.9438}, +{76.7289, 9.76309, 25.0654}, +{77.9699, 10.5832, 25.1833}, +{79.2310, 11.4212, 25.3018}, +{80.5125, 12.3556, 25.4208}, +{81.8147, 13.2865, 25.2904}, +{83.1380, 14.1304, 25.1553}, +{84.4827, 14.9303, 25.0209}, +{85.8491, 15.7199, 24.8872}, +{87.2377, 16.5145, 24.7543}, +{88.6487, 17.3428, 24.6220}, +{90.0825, 18.3032, 24.4095}, +{91.5395, 19.1538, 24.0449}, +{93.0201, 19.9274, 23.6857}, +{94.5246, 20.6797, 23.3319}, +{96.0535, 21.4286, 22.9834}, +{97.6071, 22.1926, 22.6400}, +{99.1858, 22.9954, 22.3018}, +{100.790, 23.8941, 21.9687}, +{102.420, 25.1183, 21.6405}, +{104.077, 26.3331, 20.5085}, +{105.760, 27.0621, 19.2823}, +{107.471, 27.5490, 18.1295}, +{109.209, 27.8883, 17.0456}, +{110.975, 28.1232, 16.0265}, +{112.770, 28.2816, 15.0683}, +{114.594, 28.3843, 14.1673}, +{116.448, 28.4516, 13.3203}, +{118.331, 28.5212, 12.5239}, +{120.245, 28.6342, 11.6421}, +{122.190, 28.5830, 10.7199}, +{124.166, 28.4188, 9.87078}, +{126.175, 28.2007, 9.08886}, +{128.215, 27.9444, 8.36888}, +{130.289, 27.6604, 7.70596}, +{132.397, 27.3575, 7.09555}, +{134.538, 27.0417, 6.53348}, +{136.714, 26.7199, 6.01594}, +{138.925, 26.3990, 5.53939}, +{141.172, 26.0924, 5.10060}, +{143.456, 25.8509, 4.69656}, +{145.776, 25.5731, 4.10482}, +{148.134, 25.1581, 3.55493}, +{150.530, 24.6499, 3.07869}, +{152.964, 24.0595, 2.66626}, +{155.439, 23.4721, 2.45191}, +{157.953, 22.9265, 2.26918}, +{160.507, 22.3905, 2.14900}, +{163.103, 21.8667, 2.06322}, +{165.742, 21.3828, 2.08757}, +{168.422, 20.9480, 2.12123}, +{171.146, 20.5514, 2.19082}, +{173.915, 20.1926, 2.27062}, +{176.727, 19.8502, 2.35332}, +{179.586, 19.5147, 2.47643}, +{182.491, 19.2290, 2.63391}, +{185.442, 18.9866, 2.80141}, +{188.442, 18.8102, 2.95840}, +{191.489, 18.6334, 3.08230}, +{194.587, 18.4567, 3.21138}, +{197.734, 18.2923, 3.34587}, +{200.932, 18.1414, 3.48600}, +{204.182, 18.0055, 3.63199}, +{207.485, 17.8878, 3.78409}, +{210.840, 17.8000, 3.94257}, +{214.251, 17.7252, 4.06524}, +{217.716, 17.6481, 4.18812}, +{221.237, 17.5727, 4.31471}, +{224.816, 17.5048, 4.44513}, +{228.452, 17.4462, 4.57949}, +{232.147, 17.3993, 4.71791}, +{235.902, 17.3679, 4.86052}, +{239.717, 17.3628, 5.00743}, +{243.595, 17.3941, 5.11627}, +{247.535, 17.4057, 5.19413}, +{251.538, 17.4007, 5.27318}, +{255.607, 17.3938, 5.35343}, +{259.741, 17.3872, 5.43490}, +{263.942, 17.3830, 5.51761}, +{268.211, 17.3833, 5.60158}, +{272.549, 17.3935, 5.68683}, +{276.957, 17.4160, 5.75534}, +{281.437, 17.4310, 5.81259}, +{285.989, 17.4409, 5.87041}, +{290.615, 17.4531, 5.92880}, +{295.315, 17.4733, 5.98777}, +{300.092, 17.5238, 6.03117}, +{304.945, 17.5480, 6.03085}, +{309.878, 17.5522, 6.03053}, +{314.890, 17.5453, 6.03020}, +{319.983, 17.5306, 6.02988}, +{325.158, 17.5113, 6.02956}, +{330.418, 17.4967, 6.02923}, +{335.762, 17.4742, 5.99582}, +{341.192, 17.4281, 5.95607}, +{346.711, 17.3609, 5.91657}, +{352.319, 17.2779, 5.87733}, +{358.017, 17.1797, 5.83836}, +{363.808, 17.0666, 5.79964}, +{369.692, 16.9412, 5.76118}, +{375.672, 16.8043, 5.71383}, +{381.748, 16.6377, 5.65477}, +{387.922, 16.4418, 5.59631}, +{394.197, 16.2164, 5.53847}, +{400.573, 15.9588, 5.48122}, +{407.052, 15.6587, 5.42457}, +{413.635, 15.3143, 5.38633}, +{420.326, 14.9415, 5.36289}, +{427.124, 14.5275, 5.33955}, +{434.032, 14.0569, 5.31631}, +{441.052, 13.5023, 5.29318}, +{448.186, 12.8642, 5.32243}, +{455.435, 12.1419, 5.36541}, +{462.802, 11.2473, 5.45708}, +{470.287, 10.2553, 5.64796}, +{477.894, 9.09164, 5.84552}, +{484.800, 7.97502, 6.02804}, +{485.000, 7.87726, 5.61713}, +{485.623, 7.37798, 5.73466}, +{493.478, 4.97250, 7.42813}, +{501.459, 3.21411, 9.62162}, +{509.570, 1.78526, 12.4628}, +{517.812, 0.935425, 16.1431}, +{526.187, 2.94277, 20.5203}, +{534.698, 5.10761, 22.2248}, +{543.346, 7.30398, 23.8532}, +{552.134, 9.17847, 24.6222}, +{561.065, 10.7540, 25.4160}, +{570.139, 12.5226, 25.9913}, +{579.361, 13.9927, 26.1106}, +{588.732, 15.2416, 26.2303}, +{598.254, 16.4342, 26.3507}, +{607.930, 17.6582, 26.3487}, +{617.763, 18.6768, 26.1323}, +{627.755, 19.5244, 25.9177}, +{637.908, 20.2437, 25.7049}, +{648.226, 20.8447, 25.5233}, +{658.711, 21.3958, 25.3932}, +{669.365, 21.8923, 25.2638}, +{680.191, 22.3550, 25.1350}, +{691.193, 22.7845, 24.8825}, +{702.372, 22.4190, 24.4398}, +{713.733, 21.8164, 25.1689}, +{725.277, 21.9609, 26.5068}, +{737.008, 22.7980, 27.9157}, +{748.928, 24.5054, 28.7472}, +{761.042, 25.9928, 28.7866}, +{773.351, 27.2082, 28.8260}, +{785.859, 28.3562, 28.6369}, +{798.570, 29.3355, 28.3879}, +{811.486, 30.2241, 28.1411}, +{824.611, 31.0892, 27.8964}, +{837.949, 31.9210, 27.5869}, +{851.502, 32.6694, 27.2397}, +{865.274, 33.3558, 26.8968}, +{879.269, 33.9932, 26.5583}, +{893.491, 34.5632, 26.2241}, +{907.943, 35.1278, 25.9951}, +{922.628, 35.7312, 25.7818}, +{937.551, 36.3806, 25.5701}, +{952.715, 37.0694, 25.3603}, +{968.124, 38.0719, 25.1521}, +{983.783, 39.1540, 24.3413}, +{999.695, 39.3529, 23.2912}, +{1015.86, 39.5068, 22.8698}, +{1032.29, 39.8687, 22.4083}, +{1048.99, 40.2083, 21.9512}, +{1065.96, 40.5260, 21.4987}, +{1083.20, 40.8244, 21.0554}, +{1100.72, 41.1048, 20.6212}, +{1118.52, 41.3681, 20.1961}, +{1136.61, 41.6155, 19.7796}, +{1155.00, 41.8479, 19.3717}, +{1173.68, 42.0660, 18.9723}, +{1192.66, 42.2707, 18.5810}, +{1211.95, 42.4628, 18.1979}, +{1231.55, 42.6431, 17.8228}, +{1251.47, 42.8122, 17.4556}, +{1271.72, 42.9705, 17.0964}, +{1292.29, 43.1196, 16.7452}, +{1313.19, 43.2597, 16.4010}, +{1334.43, 43.3910, 16.0639}, +{1356.01, 43.5140, 15.7338}, +{1377.94, 43.6292, 15.4103}, +{1400.23, 43.7368, 15.0936}, +{1422.88, 43.8371, 14.7834}, +{1445.89, 43.9303, 14.4796}, +{1469.28, 44.0166, 14.1825}, +{1493.04, 44.0960, 13.8921}, +{1517.19, 44.1704, 13.6104}, +{1541.73, 44.2408, 13.3349}, +{1566.67, 44.3072, 13.0649}, +{1592.01, 44.3693, 12.8004}, +{1617.76, 44.4276, 12.5411}, +{1643.92, 44.4818, 12.2869}, +{1670.51, 44.5325, 12.0383}, +{1697.53, 44.5803, 11.7946}, +{1724.99, 44.6287, 11.5556}, +{1752.89, 44.6734, 11.3146}, +{1781.24, 44.7115, 11.0762}, +{1810.05, 44.7435, 10.8411}, +{1839.32, 44.7697, 10.6111}, +{1869.07, 44.7916, 10.3860}, +{1899.30, 44.8093, 10.1654}, +{1930.02, 44.8230, 9.94960}, +{1961.24, 44.8332, 9.73846}, +{1992.96, 44.8388, 9.53185}, +{2025.20, 44.8470, 9.33397}, +{2057.95, 44.8534, 9.13169}, +{2091.24, 44.8532, 8.93205}, +{2125.06, 44.8487, 8.73611}, +{2159.43, 44.8402, 8.54320}, +{2194.36, 44.8278, 8.35387}, +{2229.85, 44.8112, 8.16753}, +{2265.92, 44.7909, 7.98494}, +{2302.57, 44.7670, 7.80508}, +{2339.81, 44.7388, 7.62824}, +{2377.66, 44.7066, 7.45474}, +{2416.11, 44.6703, 7.28406}, +{2455.19, 44.6298, 7.11654}, +{2494.90, 44.5850, 6.95170}, +{2535.26, 44.5355, 6.78984}, +{2576.26, 44.4813, 6.63078}, +{2617.93, 44.4221, 6.47454}, +{2660.27, 44.3577, 6.32104}, +{2703.30, 44.2877, 6.17018}, +{2747.03, 44.2119, 6.02202}, +{2791.46, 44.1297, 5.87647}, +{2836.61, 44.0409, 5.73352}, +{2882.49, 43.9447, 5.59303}, +{2929.11, 43.8405, 5.45502}, +{2976.48, 43.7274, 5.31947}, +{3024.63, 43.6047, 5.18631}, +{3073.55, 43.4712, 5.05555}, +{3123.26, 43.3255, 4.92704}, +{3173.78, 43.1659, 4.80082}, +{3225.11, 42.9905, 4.67688}, +{3277.27, 42.7967, 4.55512}, +{3330.28, 42.5811, 4.43544}, +{3384.15, 42.3396, 4.31794}, +{3438.88, 42.0664, 4.20252}, +{3494.50, 41.7538, 4.08922}, +{3551.02, 41.3906, 3.97787}, +{3608.46, 40.9597, 3.86841}, +{3666.82, 40.4342, 3.76105}, +{3726.13, 39.7661, 3.65559}, +{3786.40, 38.8555, 3.55191}, +{3847.64, 37.4303, 3.45004}, +{3909.87, 33.8781, 3.35003}, +{3928.70, 21.3670, 3.32065}, +{3928.90, 21.3687, 10.8165}, +{3973.11, 35.7824, 10.6258}, +{4037.38, 37.5436, 10.3581}, +{4102.68, 37.8216, 10.0972}, +{4156.00, 31.1452, 9.89191}, +{4156.20, 31.1480, 13.5880}, +{4169.03, 37.0202, 13.5233}, +{4236.46, 39.7808, 13.1917}, +{4304.98, 40.9163, 12.8690}, +{4374.62, 41.5729, 12.5550}, +{4445.37, 41.5607, 12.2471}, +{4464.60, 39.1491, 12.1656}, +{4464.80, 39.1509, 13.7097}, +{4517.27, 42.6724, 13.4942}, +{4590.33, 43.6361, 13.2039}, +{4664.58, 44.3357, 12.9168}, +{4740.03, 44.9116, 12.6326}, +{4816.69, 45.4069, 12.3519}, +{4894.60, 45.8429, 12.0747}, +{4973.77, 46.2318, 11.8010}, +{5054.21, 46.5818, 11.5311}, +{5135.96, 46.8989, 11.2652}, +{5219.03, 47.1876, 11.0033}, +{5303.44, 47.4516, 10.7455}, +{5389.22, 47.6934, 10.4916}, +{5476.39, 47.9153, 10.2420}, +{5564.97, 48.1194, 9.99683}, +{5654.98, 48.3075, 9.75571}, +{5746.44, 48.4807, 9.51892}, +{5839.39, 48.6403, 9.28642}, +{5933.83, 48.7875, 9.05831}, +{6029.81, 48.9233, 8.83453}, +{6127.33, 49.0484, 8.61505}, +{6226.44, 49.1635, 8.39981}, +{6327.15, 49.2695, 8.18894}, +{6429.48, 49.3670, 7.98243}, +{6533.48, 49.4566, 7.78004}, +{6639.15, 49.5386, 7.58182}, +{6746.54, 49.6136, 7.38798}, +{6855.65, 49.6823, 7.19822}, +{6966.54, 49.7448, 7.01252}, +{7079.22, 49.8015, 6.83093}, +{7193.72, 49.8529, 6.65333}, +{7310.07, 49.8993, 6.47986}, +{7428.31, 49.9410, 6.31012}, +{7548.45, 49.9782, 6.14438}, +{7670.54, 50.0113, 5.98237}, +{7794.61, 50.0404, 5.82412}, +{7920.68, 50.0658, 5.66971}, +{8048.79, 50.0879, 5.51872}, +{8178.98, 50.1065, 5.37147}, +{8311.26, 50.1223, 5.22782}, +{8445.69, 50.1352, 5.08748}, +{8582.29, 50.1453, 4.95070}, +{8721.11, 50.1530, 4.81718}, +{8862.16, 50.1582, 4.68692}, +{9005.50, 50.1612, 4.56000}, +{9151.16, 50.1622, 4.43604}, +{9299.17, 50.1611, 4.31531}, +{9449.58, 50.1583, 4.19766}, +{9602.42, 50.1537, 4.08290}, +{9757.73, 50.1474, 3.97106}, +{9915.55, 50.1396, 3.86235}, +{10075.9, 50.1306, 3.75621}, +{10238.9, 50.1202, 3.65281}, +{10404.5, 50.1086, 3.55209}, +{10572.8, 50.0957, 3.45399}, +{10743.8, 50.0818, 3.35846}, +{10917.6, 50.0669, 3.26544}, +{11094.2, 50.0510, 3.17486}, +{11273.6, 50.0342, 3.08668}, +{11455.9, 50.0167, 3.00085}, +{11641.2, 49.9983, 2.91730}, +{11829.5, 49.9792, 2.83598}, +{12020.8, 49.9595, 2.75684}, +{12215.3, 49.9391, 2.67984}, +{12412.8, 49.9182, 2.60491}, +{12613.6, 49.8967, 2.53201}, +{12817.6, 49.8746, 2.46109}, +{13025.0, 49.8522, 2.39210}, +{13235.6, 49.8292, 2.32499}, +{13449.7, 49.8058, 2.25973}, +{13667.2, 49.7821, 2.19625}, +{13888.3, 49.7579, 2.13452}, +{14112.9, 49.7334, 2.07449}, +{14341.2, 49.7086, 2.01612}, +{14573.1, 49.6834, 1.95937}, +{14808.9, 49.6579, 1.90420}, +{15048.4, 49.6320, 1.85056}, +{15291.8, 49.6059, 1.79842}, +{15539.1, 49.5794, 1.74774}, +{15790.4, 49.5527, 1.69848}, +{16045.8, 49.5256, 1.65060}, +{16305.4, 49.4982, 1.60406}, +{16569.1, 49.4704, 1.55884}, +{16837.1, 49.4423, 1.51489}, +{17109.4, 49.4138, 1.47218}, +{17386.1, 49.3850, 1.43069}, +{17667.4, 49.3557, 1.39037}, +{17953.1, 49.3259, 1.35119}, +{18243.5, 49.2957, 1.31313}, +{18538.6, 49.2649, 1.27616}, +{18838.4, 49.2335, 1.24024}, +{19143.1, 49.2015, 1.20535}, +{19452.7, 49.1688, 1.17145}, +{19767.4, 49.1353, 1.13853}, +{20087.1, 49.1009, 1.10655}, +{20412.0, 49.0654, 1.07549}, +{20742.1, 49.0289, 1.04532}, +{21077.6, 48.9911, 1.01602}, +{21418.5, 48.9520, 0.987571}, +{21765.0, 48.9111, 0.959938}, +{22117.0, 48.8685, 0.933104}, +{22474.7, 48.8237, 0.907047}, +{22838.2, 48.7764, 0.881743}, +{23207.6, 48.7263, 0.857173}, +{23583.0, 48.6728, 0.833315}, +{23964.4, 48.6153, 0.810150}, +{24352.0, 48.5531, 0.787658}, +{24745.9, 48.4850, 0.765820}, +{25146.2, 48.4098, 0.744618}, +{25552.9, 48.3257, 0.724034}, +{25966.2, 48.2300, 0.704050}, +{26386.1, 48.1191, 0.684648}, +{26812.9, 47.9872, 0.665814}, +{27246.6, 47.8249, 0.647529}, +{27687.3, 47.6150, 0.629780}, +{28135.1, 47.3212, 0.612549}, +{28590.2, 46.8413, 0.595823}, +{29052.6, 45.5641, 0.579586}, +{29200.0, 38.6877, 0.574557}, +{29200.2, 38.6878, 3.54851}, +{29522.5, 46.4003, 3.48783}, +{30000.0, 47.3136, 3.40099}, +{0, 0, 0} +}; + +e_fp_fdp sb[] = { /* Z = 51 */ +{10.0000, -9999.00, 9.95091}, +{10.1617, -9999.00, 10.0681}, +{10.3261, -9999.00, 9.92927}, +{10.4931, -9999.00, 9.42377}, +{10.6628, -9999.00, 8.92685}, +{10.8353, -9999.00, 8.35287}, +{11.0106, -9999.00, 7.84004}, +{11.1886, -9999.00, 7.46780}, +{11.3696, -9999.00, 7.10503}, +{11.5535, -9999.00, 6.73907}, +{11.7404, -9999.00, 6.40578}, +{11.9303, -9999.00, 6.13726}, +{12.1232, -9999.00, 5.87998}, +{12.3193, -9999.00, 5.66684}, +{12.5186, -9999.00, 5.46446}, +{12.7210, -9999.00, 5.25911}, +{12.9268, -9999.00, 5.02274}, +{13.1359, -9999.00, 4.80646}, +{13.3483, -9999.00, 4.66469}, +{13.5642, -9999.00, 4.51586}, +{13.7836, -9999.00, 4.35766}, +{14.0066, -9999.00, 4.20500}, +{14.2331, -9999.00, 4.06056}, +{14.4633, -9999.00, 3.93297}, +{14.6973, -9999.00, 3.80939}, +{14.9350, -9999.00, 3.62391}, +{15.1765, -9999.00, 3.43609}, +{15.4220, -9999.00, 3.23897}, +{15.6714, -9999.00, 3.06763}, +{15.9249, -9999.00, 2.91292}, +{16.1825, -9999.00, 2.76180}, +{16.4442, -9999.00, 2.61527}, +{16.7102, -9999.00, 2.47518}, +{16.9805, -9999.00, 2.33906}, +{17.2551, -9999.00, 2.21043}, +{17.5342, -9999.00, 2.09822}, +{17.8178, -9999.00, 1.99221}, +{18.1060, -9999.00, 1.88825}, +{18.3989, -9999.00, 1.78917}, +{18.6964, -9999.00, 1.69529}, +{18.9988, -9999.00, 1.61194}, +{19.3061, -9999.00, 1.53594}, +{19.6184, -9999.00, 1.47000}, +{19.9357, -9999.00, 1.39159}, +{20.2582, -9999.00, 1.31536}, +{20.5858, -9999.00, 1.24508}, +{20.9188, -9999.00, 1.19852}, +{21.2571, -9999.00, 1.15370}, +{21.6009, -9999.00, 1.11056}, +{21.9503, -9999.00, 1.06114}, +{22.3053, -9999.00, 0.992411}, +{22.6661, -9999.00, 0.932795}, +{23.0327, -9999.00, 0.901114}, +{23.4053, -9999.00, 0.870507}, +{23.7838, -9999.00, 0.826812}, +{24.1685, -9999.00, 0.771225}, +{24.5594, -9999.00, 0.746881}, +{24.9566, -9999.00, 0.722726}, +{25.3603, -9999.00, 0.680521}, +{25.7705, -9999.00, 0.651550}, +{26.1873, -9999.00, 0.632894}, +{26.6109, -9999.00, 0.614773}, +{27.0413, -9999.00, 0.592995}, +{27.4786, -9999.00, 0.570475}, +{27.9231, -9999.00, 0.550972}, +{28.3747, -9999.00, 0.536739}, +{28.8337, -9999.00, 0.536378}, +{29.3000, 3.11232, 0.536018}, +{29.7739, 2.91467, 0.539936}, +{30.2555, 2.69318, 0.550310}, +{30.7449, 2.44794, 0.568891}, +{31.2421, 2.15345, 0.609553}, +{31.7475, 1.81575, 0.681588}, +{32.2609, 1.35756, 0.810752}, +{32.7827, 0.735966, 1.00978}, +{33.3130, 0.770183, 2.16656}, +{33.8518, 1.27244, 2.62215}, +{34.3993, 1.55994, 2.68626}, +{34.9557, 1.81873, 2.64591}, +{35.5211, 1.78895, 2.42602}, +{36.0956, 1.71294, 2.32507}, +{36.6794, 1.58647, 2.22857}, +{37.2727, 1.39552, 2.14272}, +{37.8755, 1.14676, 2.07332}, +{38.4882, 0.816139, 2.05692}, +{39.1107, 0.446830, 2.07505}, +{39.7432, 0.408244E-01, 2.22673}, +{40.3861, -0.354905, 2.42288}, +{41.0393, -0.721592, 2.69851}, +{41.7031, -1.05425, 2.99500}, +{42.3776, -1.39748, 3.31311}, +{43.0630, -1.73562, 3.72083}, +{43.7595, -2.00062, 4.15517}, +{44.4673, -2.26444, 4.60258}, +{45.1865, -2.50699, 5.11024}, +{45.9174, -2.66702, 5.73693}, +{46.6600, -2.63556, 6.16547}, +{47.4147, -2.76076, 6.63601}, +{48.1816, -2.85350, 7.14244}, +{48.9609, -2.87141, 7.68753}, +{49.7528, -2.84324, 8.12142}, +{50.5576, -2.87755, 8.54249}, +{51.3753, -2.94937, 8.98539}, +{52.2062, -3.08385, 9.49949}, +{53.0506, -3.14115, 10.1154}, +{53.9087, -3.10333, 10.7713}, +{54.7806, -2.99901, 11.3445}, +{55.6667, -2.92468, 11.9112}, +{56.5670, -2.84380, 12.5062}, +{57.4820, -2.73144, 13.1234}, +{58.4117, -2.60980, 13.7389}, +{59.3564, -2.48184, 14.3834}, +{60.3165, -2.35449, 15.0838}, +{61.2921, -2.14611, 15.8667}, +{62.2834, -1.81911, 16.6902}, +{63.2908, -1.37197, 17.4104}, +{64.3145, -0.944269, 18.1038}, +{65.3547, -0.491782, 18.8248}, +{66.4118, 0.452285E-01, 19.5746}, +{67.4859, 0.779790, 20.2752}, +{68.5775, 1.45834, 20.7754}, +{69.6867, 2.08365, 21.2879}, +{70.8138, 2.71545, 21.8130}, +{71.9591, 3.37550, 22.3511}, +{73.1230, 4.09686, 22.8834}, +{74.3057, 4.83237, 23.3753}, +{75.5076, 5.59229, 23.8735}, +{76.7289, 6.39113, 24.3803}, +{77.9699, 7.24912, 24.8978}, +{79.2310, 8.19351, 25.4264}, +{80.5125, 9.29709, 25.9435}, +{81.8147, 10.4496, 26.2710}, +{83.1380, 11.6471, 26.6026}, +{84.4827, 13.0396, 26.8722}, +{85.8491, 14.5129, 26.9077}, +{87.2377, 15.8818, 26.7069}, +{88.6487, 17.2457, 26.5036}, +{90.0825, 18.9441, 26.1428}, +{91.5395, 20.1893, 25.0337}, +{93.0201, 20.5647, 24.3959}, +{94.5246, 21.6919, 24.1491}, +{96.0535, 22.7399, 23.4454}, +{97.6071, 23.6561, 22.7621}, +{99.1858, 24.5290, 22.0987}, +{100.790, 25.4136, 21.4524}, +{102.420, 26.3790, 20.8238}, +{104.077, 27.6863, 20.1695}, +{105.760, 28.7748, 18.6095}, +{107.471, 29.5455, 17.0947}, +{109.209, 29.9169, 15.5205}, +{110.975, 30.0612, 14.0914}, +{112.770, 30.0748, 12.7939}, +{114.594, 30.0350, 11.6157}, +{116.448, 29.9706, 10.4575}, +{118.331, 29.9619, 9.30487}, +{120.245, 29.6502, 7.92116}, +{122.190, 29.1148, 6.74314}, +{124.166, 28.4629, 5.74124}, +{126.175, 27.7589, 4.89736}, +{128.215, 27.0307, 4.18751}, +{130.289, 26.2933, 3.58683}, +{132.397, 25.5291, 3.07449}, +{134.538, 24.7569, 2.71807}, +{136.714, 23.9711, 2.49281}, +{138.925, 23.3300, 2.40463}, +{141.172, 22.7896, 2.31957}, +{143.456, 22.2892, 2.23751}, +{145.776, 21.8044, 2.15837}, +{148.134, 21.3099, 2.10893}, +{150.530, 20.8024, 2.11239}, +{152.964, 20.3549, 2.19888}, +{155.439, 19.9568, 2.31069}, +{157.953, 19.6117, 2.44492}, +{160.507, 19.3104, 2.58697}, +{163.103, 19.0445, 2.73727}, +{165.742, 18.8131, 2.89630}, +{168.422, 18.6214, 3.06457}, +{171.146, 18.4930, 3.21825}, +{173.915, 18.3824, 3.34443}, +{176.727, 18.2720, 3.43047}, +{179.586, 18.1583, 3.51727}, +{182.491, 18.0451, 3.60679}, +{185.442, 17.9410, 3.70138}, +{188.442, 17.8489, 3.79901}, +{191.489, 17.7783, 3.89594}, +{194.587, 17.7132, 3.97422}, +{197.734, 17.6525, 4.04740}, +{200.932, 17.5900, 4.11634}, +{204.182, 17.5298, 4.18643}, +{207.485, 17.4746, 4.25772}, +{210.840, 17.4298, 4.33022}, +{214.251, 17.3887, 4.38731}, +{217.716, 17.3469, 4.44154}, +{221.237, 17.3015, 4.49357}, +{224.816, 17.2554, 4.54615}, +{228.452, 17.2094, 4.59937}, +{232.147, 17.1640, 4.65326}, +{235.902, 17.1194, 4.70774}, +{239.717, 17.0759, 4.76285}, +{243.595, 17.0334, 4.81859}, +{247.535, 16.9921, 4.87502}, +{251.538, 16.9523, 4.93209}, +{255.607, 16.9140, 4.98981}, +{259.741, 16.8776, 5.04825}, +{263.942, 16.8438, 5.10738}, +{268.211, 16.8137, 5.16719}, +{272.549, 16.7906, 5.22768}, +{276.957, 16.7838, 5.27517}, +{281.437, 16.7691, 5.30568}, +{285.989, 16.7421, 5.32524}, +{290.615, 16.7050, 5.34329}, +{295.315, 16.6592, 5.36140}, +{300.092, 16.6067, 5.37960}, +{304.945, 16.5480, 5.39784}, +{309.878, 16.4829, 5.41610}, +{314.890, 16.4114, 5.43449}, +{319.983, 16.3333, 5.45293}, +{325.158, 16.2483, 5.47142}, +{330.418, 16.1560, 5.48995}, +{335.762, 16.0558, 5.50855}, +{341.192, 15.9474, 5.52726}, +{346.711, 15.8300, 5.54599}, +{352.319, 15.7030, 5.56477}, +{358.017, 15.5655, 5.58363}, +{363.808, 15.4168, 5.60260}, +{369.692, 15.2561, 5.62162}, +{375.672, 15.0826, 5.64068}, +{381.748, 14.8962, 5.65983}, +{387.922, 14.6983, 5.67652}, +{394.197, 14.4904, 5.68764}, +{400.573, 14.2592, 5.67224}, +{407.052, 13.9832, 5.64638}, +{413.635, 13.6652, 5.62063}, +{420.326, 13.3040, 5.59499}, +{427.124, 12.8949, 5.56947}, +{434.032, 12.4314, 5.54417}, +{441.052, 11.9043, 5.51890}, +{448.186, 11.3037, 5.49311}, +{455.435, 10.6104, 5.46440}, +{462.802, 9.80154, 5.43372}, +{470.287, 8.84525, 5.40207}, +{477.894, 7.69600, 5.37055}, +{485.623, 6.28402, 5.33922}, +{493.478, 4.49258, 5.30810}, +{501.459, 2.10701, 5.27718}, +{509.570, -1.33553, 5.24644}, +{517.812, -7.17167, 5.21587}, +{526.187, -24.6468, 5.18548}, +{528.100, -58.0467, 5.17863}, +{528.300, -57.9911, 40.4663}, +{534.698, -10.2272, 39.7857}, +{543.346, 0.993204E-02, 38.8962}, +{552.134, 5.68486, 38.0259}, +{561.065, 9.65438, 37.1750}, +{570.139, 12.6811, 36.3487}, +{579.361, 15.1372, 35.5788}, +{588.732, 17.2058, 34.8346}, +{598.254, 18.9860, 34.1121}, +{607.930, 20.5435, 33.4051}, +{617.763, 21.9195, 32.7122}, +{627.755, 23.1583, 32.0313}, +{637.908, 24.2681, 31.3408}, +{648.226, 25.2546, 30.6303}, +{658.711, 26.1016, 29.9134}, +{669.365, 26.7845, 29.2143}, +{680.191, 27.3469, 28.6102}, +{691.193, 27.8631, 28.0800}, +{702.372, 28.3423, 27.5863}, +{713.733, 28.7764, 27.1086}, +{725.277, 29.1553, 26.6443}, +{737.008, 29.4679, 26.1881}, +{748.928, 29.6966, 25.7396}, +{761.042, 29.7412, 25.3105}, +{773.351, 29.6111, 25.0125}, +{785.859, 29.3095, 25.1554}, +{798.570, 29.2974, 25.6701}, +{811.486, 29.6297, 26.1947}, +{824.611, 30.1441, 26.7304}, +{837.949, 31.0027, 27.2772}, +{851.502, 32.0514, 27.5181}, +{865.274, 33.2219, 27.4078}, +{879.269, 34.1736, 26.9858}, +{893.491, 34.8706, 26.5715}, +{907.943, 35.4734, 26.1640}, +{922.628, 35.9247, 25.7630}, +{937.551, 36.3469, 25.5229}, +{952.715, 36.7995, 25.3245}, +{968.124, 37.2921, 25.1620}, +{983.783, 37.8463, 25.0006}, +{999.695, 38.4406, 24.8111}, +{1015.86, 39.1722, 24.5919}, +{1032.29, 39.8409, 24.1034}, +{1048.99, 40.3666, 23.6181}, +{1065.96, 40.8285, 23.1379}, +{1083.20, 41.2421, 22.6673}, +{1100.72, 41.6191, 22.2063}, +{1118.52, 41.9653, 21.7546}, +{1136.61, 42.2852, 21.3122}, +{1155.00, 42.5820, 20.8787}, +{1173.68, 42.8582, 20.4541}, +{1192.66, 43.1157, 20.0381}, +{1211.95, 43.3563, 19.6306}, +{1231.55, 43.5811, 19.2314}, +{1251.47, 43.7915, 18.8408}, +{1271.72, 43.9888, 18.4587}, +{1292.29, 44.1743, 18.0848}, +{1313.19, 44.3492, 17.7188}, +{1334.43, 44.5141, 17.3600}, +{1356.01, 44.6693, 17.0084}, +{1377.94, 44.8157, 16.6640}, +{1400.23, 44.9542, 16.3266}, +{1422.88, 45.0852, 15.9959}, +{1445.89, 45.2103, 15.6722}, +{1469.28, 45.3301, 15.3534}, +{1493.04, 45.4472, 15.0386}, +{1517.19, 45.5555, 14.7210}, +{1541.73, 45.6518, 14.4089}, +{1566.67, 45.7397, 14.1035}, +{1592.01, 45.8203, 13.8043}, +{1617.76, 45.8941, 13.5115}, +{1643.92, 45.9621, 13.2251}, +{1670.51, 46.0248, 12.9447}, +{1697.53, 46.0829, 12.6702}, +{1724.99, 46.1381, 12.4016}, +{1752.89, 46.1889, 12.1337}, +{1781.24, 46.2335, 11.8698}, +{1810.05, 46.2712, 11.6103}, +{1839.32, 46.3032, 11.3568}, +{1869.07, 46.3304, 11.1087}, +{1899.30, 46.3532, 10.8659}, +{1930.02, 46.3716, 10.6284}, +{1961.24, 46.3864, 10.3962}, +{1992.96, 46.3960, 10.1692}, +{2025.20, 46.4060, 9.95145}, +{2057.95, 46.4146, 9.73074}, +{2091.24, 46.4177, 9.51375}, +{2125.06, 46.4161, 9.30114}, +{2159.43, 46.4106, 9.09249}, +{2194.36, 46.4018, 8.88830}, +{2229.85, 46.3892, 8.68723}, +{2265.92, 46.3730, 8.49054}, +{2302.57, 46.3530, 8.29714}, +{2339.81, 46.3297, 8.10810}, +{2377.66, 46.3030, 7.92205}, +{2416.11, 46.2724, 7.73973}, +{2455.19, 46.2385, 7.56087}, +{2494.90, 46.2005, 7.38506}, +{2535.26, 46.1587, 7.21297}, +{2576.26, 46.1131, 7.04407}, +{2617.93, 46.0635, 6.87843}, +{2660.27, 46.0098, 6.71593}, +{2703.30, 45.9518, 6.55647}, +{2747.03, 45.8892, 6.40002}, +{2791.46, 45.8218, 6.24657}, +{2836.61, 45.7495, 6.09612}, +{2882.49, 45.6718, 5.94841}, +{2929.11, 45.5882, 5.80354}, +{2976.48, 45.4986, 5.66146}, +{3024.63, 45.4021, 5.52205}, +{3073.55, 45.2985, 5.38534}, +{3123.26, 45.1867, 5.25113}, +{3173.78, 45.0661, 5.11949}, +{3225.11, 44.9355, 4.99039}, +{3277.27, 44.7938, 4.86368}, +{3330.28, 44.6395, 4.73933}, +{3384.15, 44.4705, 4.61737}, +{3438.88, 44.2846, 4.49774}, +{3494.50, 44.0790, 4.38040}, +{3551.02, 43.8496, 4.26514}, +{3608.46, 43.5912, 4.15211}, +{3666.82, 43.2971, 4.04124}, +{3726.13, 42.9570, 3.93245}, +{3786.40, 42.5562, 3.82567}, +{3847.64, 42.0709, 3.72091}, +{3909.87, 41.4596, 3.61811}, +{3973.11, 40.6392, 3.51726}, +{4037.38, 39.3939, 3.41825}, +{4102.68, 36.7362, 3.32140}, +{4132.10, 23.9024, 3.27915}, +{4132.30, 23.9039, 10.3431}, +{4169.03, 37.0855, 10.2034}, +{4236.46, 39.1169, 9.95490}, +{4304.98, 39.6096, 9.71245}, +{4374.62, 37.5446, 9.47607}, +{4380.30, 33.0068, 9.45719}, +{4380.50, 33.0110, 13.0236}, +{4445.37, 40.9183, 12.7180}, +{4517.27, 42.1683, 12.3926}, +{4590.33, 42.8546, 12.0757}, +{4664.58, 43.0260, 11.7667}, +{4698.20, 40.1599, 11.6310}, +{4698.40, 40.1643, 13.3768}, +{4740.03, 43.7255, 13.2023}, +{4816.69, 44.8387, 12.8907}, +{4894.60, 45.5823, 12.5846}, +{4973.77, 46.1761, 12.2838}, +{5054.21, 46.6772, 11.9886}, +{5135.96, 47.1120, 11.6989}, +{5219.03, 47.4956, 11.4149}, +{5303.44, 47.8376, 11.1361}, +{5389.22, 48.1446, 10.8629}, +{5476.39, 48.4219, 10.5952}, +{5564.97, 48.6734, 10.3328}, +{5654.98, 48.9023, 10.0759}, +{5746.44, 49.1111, 9.82416}, +{5839.39, 49.3017, 9.57780}, +{5933.83, 49.4761, 9.33672}, +{6029.81, 49.6359, 9.10089}, +{6127.33, 49.7823, 8.87002}, +{6226.44, 49.9164, 8.64429}, +{6327.15, 50.0394, 8.42356}, +{6429.48, 50.1520, 8.20770}, +{6533.48, 50.2551, 7.99676}, +{6639.15, 50.3495, 7.79056}, +{6746.54, 50.4356, 7.58921}, +{6855.65, 50.5144, 7.39245}, +{6966.54, 50.5860, 7.20018}, +{7079.22, 50.6511, 7.01252}, +{7193.72, 50.7102, 6.82920}, +{7310.07, 50.7636, 6.65031}, +{7428.31, 50.8118, 6.47568}, +{7548.45, 50.8551, 6.30508}, +{7670.54, 50.8936, 6.13881}, +{7794.61, 50.9279, 5.97654}, +{7920.68, 50.9583, 5.81823}, +{8048.79, 50.9849, 5.66370}, +{8178.98, 51.0079, 5.51302}, +{8311.26, 51.0275, 5.36603}, +{8445.69, 51.0442, 5.22294}, +{8582.29, 51.0581, 5.08311}, +{8721.11, 51.0690, 4.94687}, +{8862.16, 51.0775, 4.81417}, +{9005.50, 51.0836, 4.68483}, +{9151.16, 51.0876, 4.55874}, +{9299.17, 51.0894, 4.43583}, +{9449.58, 51.0893, 4.31615}, +{9602.42, 51.0875, 4.19954}, +{9757.73, 51.0840, 4.08576}, +{9915.55, 51.0788, 3.97516}, +{10075.9, 51.0723, 3.86730}, +{10238.9, 51.0643, 3.76223}, +{10404.5, 51.0550, 3.65991}, +{10572.8, 51.0445, 3.56025}, +{10743.8, 51.0329, 3.46320}, +{10917.6, 51.0202, 3.36871}, +{11094.2, 51.0066, 3.27669}, +{11273.6, 50.9920, 3.18711}, +{11455.9, 50.9766, 3.09989}, +{11641.2, 50.9604, 3.01499}, +{11829.5, 50.9434, 2.93234}, +{12020.8, 50.9258, 2.85188}, +{12215.3, 50.9075, 2.77357}, +{12412.8, 50.8886, 2.69735}, +{12613.6, 50.8692, 2.62317}, +{12817.6, 50.8492, 2.55098}, +{13025.0, 50.8287, 2.48072}, +{13235.6, 50.8078, 2.41235}, +{13449.7, 50.7865, 2.34582}, +{13667.2, 50.7647, 2.28108}, +{13888.3, 50.7426, 2.21810}, +{14112.9, 50.7201, 2.15681}, +{14341.2, 50.6973, 2.09718}, +{14573.1, 50.6741, 2.03916}, +{14808.9, 50.6506, 1.98272}, +{15048.4, 50.6268, 1.92781}, +{15291.8, 50.6027, 1.87439}, +{15539.1, 50.5783, 1.82243}, +{15790.4, 50.5536, 1.77188}, +{16045.8, 50.5287, 1.72271}, +{16305.4, 50.5034, 1.67487}, +{16569.1, 50.4778, 1.62835}, +{16837.1, 50.4519, 1.58309}, +{17109.4, 50.4257, 1.53907}, +{17386.1, 50.3992, 1.49625}, +{17667.4, 50.3723, 1.45461}, +{17953.1, 50.3450, 1.41410}, +{18243.5, 50.3173, 1.37470}, +{18538.6, 50.2891, 1.33639}, +{18838.4, 50.2605, 1.29912}, +{19143.1, 50.2314, 1.26287}, +{19452.7, 50.2017, 1.22762}, +{19767.4, 50.1714, 1.19334}, +{20087.1, 50.1404, 1.15999}, +{20412.0, 50.1086, 1.12756}, +{20742.1, 50.0760, 1.09603}, +{21077.6, 50.0424, 1.06535}, +{21418.5, 50.0078, 1.03552}, +{21765.0, 49.9720, 1.00651}, +{22117.0, 49.9348, 0.978292}, +{22474.7, 49.8962, 0.950852}, +{22838.2, 49.8558, 0.924163}, +{23207.6, 49.8134, 0.898208}, +{23583.0, 49.7688, 0.872965}, +{23964.4, 49.7215, 0.848415}, +{24352.0, 49.6712, 0.824537}, +{24745.9, 49.6173, 0.801315}, +{25146.2, 49.5592, 0.778730}, +{25552.9, 49.4959, 0.756764}, +{25966.2, 49.4263, 0.735400}, +{26386.1, 49.3491, 0.714620}, +{26812.9, 49.2621, 0.694410}, +{27246.6, 49.1625, 0.674753}, +{27687.3, 49.0460, 0.655634}, +{28135.1, 48.9060, 0.637037}, +{28590.2, 48.7313, 0.618949}, +{29052.6, 48.5005, 0.601355}, +{29522.5, 48.1654, 0.584241}, +{30000.0, 47.5711, 0.567594}, +{0, 0, 0} +}; + +e_fp_fdp te[] = { /* Z = 52 */ +{10.0000, -9999.00, 9.70237}, +{10.1617, -9999.00, 9.72653}, +{10.3261, -9999.00, 9.75076}, +{10.4931, -9999.00, 9.77506}, +{10.6628, -9999.00, 9.79940}, +{10.8353, -9999.00, 9.77638}, +{11.0106, -9999.00, 9.72308}, +{11.1886, -9999.00, 9.67008}, +{11.3696, -9999.00, 9.61736}, +{11.5535, -9999.00, 9.54395}, +{11.7404, -9999.00, 9.46085}, +{11.9303, -9999.00, 9.37848}, +{12.1232, -9999.00, 9.29150}, +{12.3193, -9999.00, 9.19140}, +{12.5186, -9999.00, 9.09238}, +{12.7210, -9999.00, 8.99443}, +{12.9268, -9999.00, 8.90490}, +{13.1359, -9999.00, 8.81998}, +{13.3483, -9999.00, 8.73588}, +{13.5642, -9999.00, 8.65256}, +{13.7836, -9999.00, 8.32120}, +{14.0066, -9999.00, 7.97096}, +{14.2331, -9999.00, 7.65865}, +{14.4633, -9999.00, 7.37439}, +{14.6973, -9999.00, 7.07333}, +{14.9350, -9999.00, 6.76248}, +{15.1765, -9999.00, 6.46529}, +{15.4220, -9999.00, 6.20847}, +{15.6714, -9999.00, 5.96465}, +{15.9249, -9999.00, 5.75268}, +{16.1825, -9999.00, 5.61163}, +{16.4442, -9999.00, 5.47404}, +{16.7102, -9999.00, 5.33982}, +{16.9805, -9999.00, 5.19298}, +{17.2551, -9999.00, 5.01356}, +{17.5342, -9999.00, 4.84034}, +{17.8178, -9999.00, 4.67310}, +{18.1060, -9999.00, 4.51347}, +{18.3989, -9999.00, 4.36101}, +{18.6964, -9999.00, 4.21371}, +{18.9988, -9999.00, 4.07139}, +{19.3061, -9999.00, 3.93243}, +{19.6184, -9999.00, 3.79030}, +{19.9357, -9999.00, 3.65331}, +{20.2582, -9999.00, 3.44444}, +{20.5858, -9999.00, 3.21816}, +{20.9188, -9999.00, 3.02493}, +{21.2571, -9999.00, 2.84787}, +{21.6009, -9999.00, 2.71658}, +{21.9503, -9999.00, 2.59134}, +{22.3053, -9999.00, 2.45805}, +{22.6661, -9999.00, 2.32492}, +{23.0327, -9999.00, 2.14513}, +{23.4053, -9999.00, 1.97252}, +{23.7838, -9999.00, 1.88535}, +{24.1685, -9999.00, 1.80203}, +{24.5594, -9999.00, 1.71319}, +{24.9566, -9999.00, 1.60315}, +{25.3603, -9999.00, 1.49563}, +{25.7705, -9999.00, 1.38815}, +{26.1873, -9999.00, 1.29731}, +{26.6109, -9999.00, 1.23174}, +{27.0413, -9999.00, 1.16940}, +{27.4786, -9999.00, 1.10701}, +{27.9231, -9999.00, 1.04796}, +{28.3747, -9999.00, 0.977697}, +{28.8337, -9999.00, 0.901840}, +{29.3000, 4.66549, 0.844635}, +{29.7739, 4.51435, 0.819874}, +{30.2555, 4.37442, 0.795837}, +{30.7449, 4.23907, 0.769363}, +{31.2421, 4.09926, 0.740463}, +{31.7475, 3.95604, 0.711461}, +{32.2609, 3.80382, 0.679349}, +{32.7827, 3.63674, 0.651564}, +{33.3130, 3.46693, 0.642369}, +{33.8518, 3.29761, 0.633303}, +{34.3993, 3.12308, 0.624365}, +{34.9557, 2.94210, 0.620165}, +{35.5211, 2.75495, 0.616361}, +{36.0956, 2.55765, 0.612579}, +{36.6794, 2.34757, 0.612202}, +{37.2727, 2.12557, 0.613164}, +{37.8755, 1.88656, 0.614129}, +{38.4882, 1.62431, 0.615267}, +{39.1107, 1.33139, 0.617596}, +{39.7432, 0.993601, 0.619936}, +{40.3861, 0.583056, 0.627144}, +{41.0393, 0.143339E-01, 0.639935}, +{41.7031, -0.929514, 0.819245}, +{42.3776, -1.92937, 1.82459}, +{43.0630, -0.626741, 3.56658}, +{43.7595, 0.121031, 3.24620}, +{44.4673, 0.202208, 2.84244}, +{45.1865, -0.384846E-01, 2.52394}, +{45.9174, -0.434534, 2.29379}, +{46.6600, -1.16650, 2.30390}, +{47.4147, -1.71905, 2.65964}, +{48.1816, -2.07132, 3.04134}, +{48.9609, -2.42488, 3.37898}, +{49.7528, -2.77063, 3.74833}, +{50.5576, -3.11558, 4.14647}, +{51.3753, -3.46176, 4.58690}, +{52.2062, -3.79519, 5.11915}, +{53.0506, -4.00432, 5.73446}, +{53.9087, -4.16388, 6.19007}, +{54.7806, -4.37055, 6.67913}, +{55.6667, -4.59082, 7.20044}, +{56.5670, -4.82099, 7.75616}, +{57.4820, -5.06818, 8.35480}, +{58.4117, -5.29783, 9.07518}, +{59.3564, -5.44403, 9.86977}, +{60.3165, -5.44933, 10.7339}, +{61.2921, -5.35417, 11.4165}, +{62.2834, -5.33990, 12.0916}, +{63.2908, -5.37272, 12.8499}, +{64.3145, -5.34097, 13.6901}, +{65.3547, -5.23072, 14.5851}, +{66.4118, -4.98193, 15.5387}, +{67.4859, -4.63444, 16.3146}, +{68.5775, -4.33613, 17.0857}, +{69.6867, -4.03957, 17.8933}, +{70.8138, -3.70316, 18.7391}, +{71.9591, -3.29868, 19.6248}, +{73.1230, -2.75174, 20.4734}, +{74.3057, -2.24552, 21.2461}, +{75.5076, -1.74216, 22.0480}, +{76.7289, -1.22224, 22.9240}, +{77.9699, -0.590245, 23.8649}, +{79.2310, 0.220840, 24.8127}, +{80.5125, 1.07313, 25.6337}, +{81.8147, 1.95946, 26.4817}, +{83.1380, 2.95256, 27.3386}, +{84.4827, 4.04183, 28.1851}, +{85.8491, 5.34082, 29.0579}, +{87.2377, 6.76500, 29.5799}, +{88.6487, 8.11641, 30.0536}, +{90.0825, 9.47543, 30.5348}, +{91.5395, 10.9340, 31.0238}, +{93.0201, 12.6284, 31.5207}, +{94.5246, 14.4792, 31.6132}, +{96.0535, 16.1942, 31.5762}, +{97.6071, 17.9369, 31.5391}, +{99.1858, 19.8977, 31.5022}, +{100.790, 22.1452, 30.9673}, +{102.420, 24.0618, 30.1064}, +{104.077, 25.9762, 29.2695}, +{105.760, 28.5945, 27.8425}, +{107.471, 30.2059, 25.5986}, +{109.209, 31.1504, 23.5356}, +{110.975, 31.8342, 21.6388}, +{112.770, 32.3748, 19.8949}, +{114.594, 32.9718, 18.2915}, +{116.448, 33.5739, 16.1379}, +{118.331, 33.5231, 13.9535}, +{120.245, 33.0690, 12.0647}, +{122.190, 32.4406, 10.4316}, +{124.166, 31.6745, 9.03391}, +{126.175, 30.8947, 7.90432}, +{128.215, 30.1341, 6.91598}, +{130.289, 29.3754, 6.05125}, +{132.397, 28.6234, 5.29464}, +{134.538, 27.8788, 4.63261}, +{136.714, 27.1440, 4.05337}, +{138.925, 26.4146, 3.54654}, +{141.172, 25.6791, 3.10310}, +{143.456, 24.9069, 2.77197}, +{145.776, 24.2260, 2.54912}, +{148.134, 23.5780, 2.34418}, +{150.530, 22.8673, 2.22832}, +{152.964, 22.2811, 2.23271}, +{155.439, 21.7876, 2.23711}, +{157.953, 21.3333, 2.24152}, +{160.507, 20.8875, 2.25635}, +{163.103, 20.4837, 2.30549}, +{165.742, 20.1167, 2.35571}, +{168.422, 19.7704, 2.40703}, +{171.146, 19.4298, 2.45946}, +{173.915, 19.0971, 2.54273}, +{176.727, 18.7943, 2.64275}, +{179.586, 18.5077, 2.74670}, +{182.491, 18.2378, 2.87381}, +{185.442, 17.9924, 3.01015}, +{188.442, 17.7687, 3.15297}, +{191.489, 17.5641, 3.30256}, +{194.587, 17.3793, 3.45926}, +{197.734, 17.2212, 3.62338}, +{200.932, 17.0783, 3.76835}, +{204.182, 16.9417, 3.91758}, +{207.485, 16.8142, 4.07273}, +{210.840, 16.6998, 4.23402}, +{214.251, 16.6011, 4.40169}, +{217.716, 16.5255, 4.57601}, +{221.237, 16.4843, 4.73000}, +{224.816, 16.4354, 4.86332}, +{228.452, 16.3813, 5.00038}, +{232.147, 16.3330, 5.14132}, +{235.902, 16.2926, 5.28623}, +{239.717, 16.2631, 5.43521}, +{243.595, 16.2532, 5.58840}, +{247.535, 16.2667, 5.72257}, +{251.538, 16.2704, 5.83748}, +{255.607, 16.2716, 5.95471}, +{259.741, 16.2763, 6.07429}, +{263.942, 16.2881, 6.19626}, +{268.211, 16.3124, 6.32069}, +{272.549, 16.3690, 6.44260}, +{276.957, 16.4173, 6.50829}, +{281.437, 16.4493, 6.57465}, +{285.989, 16.4719, 6.64169}, +{290.615, 16.4908, 6.70941}, +{295.315, 16.5075, 6.77782}, +{300.092, 16.5236, 6.84693}, +{304.945, 16.5401, 6.91674}, +{309.878, 16.5584, 6.98727}, +{314.890, 16.5802, 7.05852}, +{319.983, 16.6084, 7.13049}, +{325.158, 16.6672, 7.20319}, +{330.418, 16.7215, 7.21670}, +{335.762, 16.7469, 7.22331}, +{341.192, 16.7570, 7.22993}, +{346.711, 16.7567, 7.23657}, +{352.319, 16.7481, 7.24320}, +{358.017, 16.7328, 7.24984}, +{363.808, 16.7126, 7.25649}, +{369.692, 16.6896, 7.26314}, +{375.672, 16.6670, 7.26980}, +{381.748, 16.6929, 7.27196}, +{387.922, 16.6825, 7.16808}, +{394.197, 16.6085, 7.06571}, +{400.573, 16.4966, 6.96479}, +{407.052, 16.3510, 6.86530}, +{413.635, 16.1716, 6.76725}, +{420.326, 15.9554, 6.67059}, +{427.124, 15.6874, 6.57686}, +{434.032, 15.3957, 6.52987}, +{441.052, 15.0843, 6.48322}, +{448.186, 14.7445, 6.43691}, +{455.435, 14.3667, 6.39093}, +{462.802, 13.9434, 6.34527}, +{470.287, 13.4659, 6.29995}, +{477.894, 12.9230, 6.25495}, +{485.623, 12.3007, 6.21026}, +{493.478, 11.5506, 6.17379}, +{501.459, 10.7071, 6.19347}, +{509.570, 9.75004, 6.21321}, +{517.812, 8.61606, 6.23302}, +{526.187, 7.19534, 6.25289}, +{534.698, 5.40571, 6.37474}, +{543.346, 3.15720, 6.57361}, +{552.134, -0.113654E-01, 6.77867}, +{561.065, -5.23200, 7.25851}, +{570.139, -18.5842, 8.01168}, +{572.900, -52.3115, 8.25338}, +{573.100, -52.2341, 40.3200}, +{579.361, -8.43237, 39.5620}, +{588.732, 1.87282, 38.4686}, +{598.254, 7.39573, 37.4054}, +{607.930, 11.1658, 36.3717}, +{617.763, 13.9686, 35.3665}, +{627.755, 16.1006, 34.3891}, +{637.908, 17.6092, 33.6322}, +{648.226, 18.9882, 33.1867}, +{658.711, 20.3429, 32.7472}, +{669.365, 21.5864, 32.3134}, +{680.191, 22.7433, 31.8854}, +{691.193, 23.8722, 31.4631}, +{702.372, 24.8919, 30.8824}, +{713.733, 25.7608, 30.2964}, +{725.277, 26.4947, 29.7216}, +{737.008, 27.1146, 29.1576}, +{748.928, 27.5810, 28.6044}, +{761.042, 27.8845, 28.1608}, +{773.351, 28.1829, 27.8626}, +{785.859, 28.4565, 27.5675}, +{798.570, 28.2572, 27.2803}, +{811.486, 28.2393, 27.8616}, +{824.611, 28.6851, 28.4553}, +{837.949, 29.3900, 29.0617}, +{851.502, 30.7858, 29.4727}, +{865.274, 31.9964, 29.1527}, +{879.269, 32.8390, 28.8362}, +{893.491, 33.6140, 28.5232}, +{907.943, 34.3351, 28.1796}, +{922.628, 34.9868, 27.8200}, +{937.551, 35.5695, 27.4650}, +{952.715, 36.0543, 27.1145}, +{968.124, 36.5342, 26.9431}, +{983.783, 37.1002, 26.8099}, +{999.695, 37.7876, 26.6442}, +{1015.86, 38.5881, 26.4217}, +{1032.29, 39.3056, 25.9082}, +{1048.99, 39.9085, 25.3964}, +{1065.96, 40.4270, 24.8883}, +{1083.20, 40.8939, 24.3903}, +{1100.72, 41.3203, 23.9023}, +{1118.52, 41.7132, 23.4240}, +{1136.61, 42.0773, 22.9555}, +{1155.00, 42.4162, 22.4962}, +{1173.68, 42.7323, 22.0460}, +{1192.66, 43.0281, 21.6051}, +{1211.95, 43.3055, 21.1729}, +{1231.55, 43.5656, 20.7492}, +{1251.47, 43.8099, 20.3347}, +{1271.72, 44.0399, 19.9290}, +{1292.29, 44.2573, 19.5319}, +{1313.19, 44.4628, 19.1427}, +{1334.43, 44.6572, 18.7613}, +{1356.01, 44.8414, 18.3876}, +{1377.94, 45.0163, 18.0214}, +{1400.23, 45.1828, 17.6624}, +{1422.88, 45.3416, 17.3105}, +{1445.89, 45.4945, 16.9656}, +{1469.28, 45.6439, 16.6252}, +{1493.04, 45.7907, 16.2879}, +{1517.19, 45.9264, 15.9423}, +{1541.73, 46.0481, 15.6020}, +{1566.67, 46.1584, 15.2691}, +{1592.01, 46.2599, 14.9432}, +{1617.76, 46.3538, 14.6242}, +{1643.92, 46.4409, 14.3119}, +{1670.51, 46.5222, 14.0063}, +{1697.53, 46.5981, 13.7073}, +{1724.99, 46.6750, 13.4147}, +{1752.89, 46.7465, 13.1176}, +{1781.24, 46.8082, 12.8234}, +{1810.05, 46.8607, 12.5328}, +{1839.32, 46.9045, 12.2487}, +{1869.07, 46.9417, 11.9710}, +{1899.30, 46.9728, 11.6995}, +{1930.02, 46.9986, 11.4343}, +{1961.24, 47.0195, 11.1752}, +{1992.96, 47.0339, 10.9220}, +{2025.20, 47.0514, 10.6800}, +{2057.95, 47.0659, 10.4326}, +{2091.24, 47.0720, 10.1900}, +{2125.06, 47.0728, 9.95209}, +{2159.43, 47.0690, 9.71947}, +{2194.36, 47.0609, 9.49115}, +{2229.85, 47.0480, 9.26714}, +{2265.92, 47.0307, 9.04814}, +{2302.57, 47.0090, 8.83346}, +{2339.81, 46.9835, 8.62396}, +{2377.66, 46.9542, 8.41836}, +{2416.11, 46.9204, 8.21687}, +{2455.19, 46.8830, 8.02045}, +{2494.90, 46.8413, 7.82754}, +{2535.26, 46.7959, 7.63953}, +{2576.26, 46.7465, 7.45519}, +{2617.93, 46.6929, 7.27509}, +{2660.27, 46.6353, 7.09909}, +{2703.30, 46.5736, 6.92695}, +{2747.03, 46.5075, 6.75870}, +{2791.46, 46.4371, 6.59429}, +{2836.61, 46.3622, 6.43359}, +{2882.49, 46.2825, 6.27661}, +{2929.11, 46.1977, 6.12319}, +{2976.48, 46.1077, 5.97338}, +{3024.63, 46.0121, 5.82702}, +{3073.55, 45.9106, 5.68416}, +{3123.26, 45.8026, 5.54454}, +{3173.78, 45.6875, 5.40824}, +{3225.11, 45.5649, 5.27515}, +{3277.27, 45.4338, 5.14520}, +{3330.28, 45.2934, 5.01833}, +{3384.15, 45.1426, 4.89453}, +{3438.88, 44.9800, 4.77363}, +{3494.50, 44.8040, 4.65571}, +{3551.02, 44.6127, 4.54053}, +{3608.46, 44.4033, 4.42815}, +{3666.82, 44.1728, 4.31851}, +{3726.13, 43.9170, 4.21152}, +{3786.40, 43.6303, 4.10716}, +{3847.64, 43.3051, 4.00531}, +{3909.87, 42.9306, 3.90593}, +{3973.11, 42.4907, 3.80893}, +{4037.38, 41.9598, 3.71440}, +{4102.68, 41.2938, 3.62216}, +{4169.03, 40.4045, 3.53212}, +{4236.46, 39.0689, 3.44428}, +{4304.98, 36.3202, 3.35866}, +{4341.30, 21.2235, 3.31469}, +{4341.50, 21.2252, 11.3604}, +{4374.62, 36.0199, 11.2248}, +{4445.37, 38.6748, 10.9438}, +{4517.27, 39.4443, 10.6700}, +{4590.33, 38.6508, 10.4029}, +{4611.90, 32.3643, 10.3262}, +{4612.10, 32.3691, 14.1634}, +{4664.58, 40.4554, 13.9109}, +{4740.03, 42.0405, 13.5604}, +{4816.69, 42.9005, 13.2188}, +{4894.60, 43.2781, 12.8855}, +{4939.10, 40.4125, 12.7013}, +{4939.30, 40.4171, 14.4492}, +{4973.77, 43.7779, 14.3075}, +{5054.21, 45.0467, 13.9858}, +{5135.96, 45.8702, 13.6686}, +{5219.03, 46.5284, 13.3558}, +{5303.44, 47.0861, 13.0477}, +{5389.22, 47.5719, 12.7443}, +{5476.39, 48.0020, 12.4458}, +{5564.97, 48.3871, 12.1521}, +{5654.98, 48.7342, 11.8635}, +{5746.44, 49.0489, 11.5798}, +{5839.39, 49.3354, 11.3010}, +{5933.83, 49.5970, 11.0274}, +{6029.81, 49.8365, 10.7586}, +{6127.33, 50.0560, 10.4950}, +{6226.44, 50.2576, 10.2364}, +{6327.15, 50.4430, 9.98292}, +{6429.48, 50.6134, 9.73437}, +{6533.48, 50.7700, 9.49083}, +{6639.15, 50.9142, 9.25244}, +{6746.54, 51.0469, 9.01886}, +{6855.65, 51.1689, 8.79031}, +{6966.54, 51.2812, 8.56648}, +{7079.22, 51.3840, 8.34731}, +{7193.72, 51.4782, 8.13295}, +{7310.07, 51.5645, 7.92342}, +{7428.31, 51.6434, 7.71862}, +{7548.45, 51.7154, 7.51829}, +{7670.54, 51.7809, 7.32240}, +{7794.61, 51.8401, 7.13101}, +{7920.68, 51.8938, 6.94428}, +{8048.79, 51.9423, 6.76162}, +{8178.98, 51.9856, 6.58325}, +{8311.26, 52.0244, 6.40927}, +{8445.69, 52.0589, 6.23916}, +{8582.29, 52.0889, 6.07317}, +{8721.11, 52.1152, 5.91143}, +{8862.16, 52.1381, 5.75344}, +{9005.50, 52.1575, 5.59935}, +{9151.16, 52.1738, 5.44897}, +{9299.17, 52.1870, 5.30225}, +{9449.58, 52.1975, 5.15935}, +{9602.42, 52.2054, 5.01995}, +{9757.73, 52.2108, 4.88385}, +{9915.55, 52.2139, 4.75128}, +{10075.9, 52.2148, 4.62211}, +{10238.9, 52.2136, 4.49623}, +{10404.5, 52.2106, 4.37356}, +{10572.8, 52.2058, 4.25403}, +{10743.8, 52.1994, 4.13759}, +{10917.6, 52.1914, 4.02415}, +{11094.2, 52.1820, 3.91366}, +{11273.6, 52.1712, 3.80605}, +{11455.9, 52.1591, 3.70125}, +{11641.2, 52.1459, 3.59921}, +{11829.5, 52.1316, 3.49984}, +{12020.8, 52.1162, 3.40311}, +{12215.3, 52.0998, 3.30894}, +{12412.8, 52.0826, 3.21727}, +{12613.6, 52.0645, 3.12804}, +{12817.6, 52.0457, 3.04120}, +{13025.0, 52.0261, 2.95669}, +{13235.6, 52.0059, 2.87445}, +{13449.7, 51.9850, 2.79443}, +{13667.2, 51.9635, 2.71657}, +{13888.3, 51.9415, 2.64082}, +{14112.9, 51.9189, 2.56713}, +{14341.2, 51.8959, 2.49544}, +{14573.1, 51.8724, 2.42570}, +{14808.9, 51.8485, 2.35788}, +{15048.4, 51.8242, 2.29191}, +{15291.8, 51.7995, 2.22775}, +{15539.1, 51.7745, 2.16535}, +{15790.4, 51.7491, 2.10468}, +{16045.8, 51.7233, 2.04568}, +{16305.4, 51.6973, 1.98830}, +{16569.1, 51.6709, 1.93252}, +{16837.1, 51.6441, 1.87829}, +{17109.4, 51.6171, 1.82556}, +{17386.1, 51.5898, 1.77430}, +{17667.4, 51.5621, 1.72447}, +{17953.1, 51.5341, 1.67603}, +{18243.5, 51.5058, 1.62894}, +{18538.6, 51.4771, 1.58317}, +{18838.4, 51.4480, 1.53868}, +{19143.1, 51.4185, 1.49544}, +{19452.7, 51.3886, 1.45342}, +{19767.4, 51.3582, 1.41257}, +{20087.1, 51.3272, 1.37288}, +{20412.0, 51.2958, 1.33430}, +{20742.1, 51.2637, 1.29681}, +{21077.6, 51.2309, 1.26038}, +{21418.5, 51.1974, 1.22498}, +{21765.0, 51.1631, 1.19058}, +{22117.0, 51.1278, 1.15716}, +{22474.7, 51.0915, 1.12468}, +{22838.2, 51.0539, 1.09312}, +{23207.6, 51.0151, 1.06246}, +{23583.0, 50.9748, 1.03267}, +{23964.4, 50.9327, 1.00373}, +{24352.0, 50.8886, 0.975603}, +{24745.9, 50.8422, 0.948281}, +{25146.2, 50.7932, 0.921736}, +{25552.9, 50.7411, 0.895949}, +{25966.2, 50.6853, 0.870896}, +{26386.1, 50.6250, 0.846556}, +{26812.9, 50.5595, 0.822911}, +{27246.6, 50.4875, 0.799940}, +{27687.3, 50.4074, 0.777626}, +{28135.1, 50.3169, 0.755948}, +{28590.2, 50.2129, 0.734890}, +{29052.6, 50.0908, 0.714433}, +{29522.5, 49.9444, 0.694560}, +{30000.0, 49.7483, 0.675257}, +{0, 0, 0} +}; + +e_fp_fdp i[] = { /* Z = 53 */ +{10.0000, -9999.00, 7.81670}, +{10.1617, -9999.00, 7.56781}, +{10.3261, -9999.00, 7.32685}, +{10.4931, -9999.00, 7.08081}, +{10.6628, -9999.00, 6.83320}, +{10.8353, -9999.00, 6.78435}, +{11.0106, -9999.00, 6.80888}, +{11.1886, -9999.00, 7.27334}, +{11.3696, -9999.00, 7.86775}, +{11.5535, -9999.00, 8.52786}, +{11.7404, -9999.00, 9.24335}, +{11.9303, -9999.00, 10.0092}, +{12.1232, -9999.00, 10.7896}, +{12.3193, -9999.00, 11.0623}, +{12.5186, -9999.00, 11.3418}, +{12.7210, -9999.00, 11.4253}, +{12.9268, -9999.00, 11.3727}, +{13.1359, -9999.00, 11.3203}, +{13.3483, -9999.00, 11.2681}, +{13.5642, -9999.00, 11.2095}, +{13.7836, -9999.00, 11.1155}, +{14.0066, -9999.00, 11.0223}, +{14.2331, -9999.00, 10.9300}, +{14.4633, -9999.00, 10.8383}, +{14.6973, -9999.00, 10.7475}, +{14.9350, -9999.00, 10.6574}, +{15.1765, -9999.00, 10.4573}, +{15.4220, -9999.00, 10.1905}, +{15.6714, -9999.00, 9.93056}, +{15.9249, -9999.00, 9.67721}, +{16.1825, -9999.00, 9.43034}, +{16.4442, -9999.00, 9.18976}, +{16.7102, -9999.00, 8.95532}, +{16.9805, -9999.00, 8.72686}, +{17.2551, -9999.00, 8.50423}, +{17.5342, -9999.00, 8.28728}, +{17.8178, -9999.00, 8.07586}, +{18.1060, -9999.00, 7.86984}, +{18.3989, -9999.00, 7.66907}, +{18.6964, -9999.00, 7.42175}, +{18.9988, -9999.00, 7.14799}, +{19.3061, -9999.00, 6.88433}, +{19.6184, -9999.00, 6.63039}, +{19.9357, -9999.00, 6.38583}, +{20.2582, -9999.00, 6.15028}, +{20.5858, -9999.00, 5.92343}, +{20.9188, -9999.00, 5.70494}, +{21.2571, -9999.00, 5.49451}, +{21.6009, -9999.00, 5.29184}, +{21.9503, -9999.00, 5.09665}, +{22.3053, -9999.00, 4.90865}, +{22.6661, -9999.00, 4.68919}, +{23.0327, -9999.00, 4.44107}, +{23.4053, -9999.00, 4.20609}, +{23.7838, -9999.00, 3.98353}, +{24.1685, -9999.00, 3.77276}, +{24.5594, -9999.00, 3.57313}, +{24.9566, -9999.00, 3.38407}, +{25.3603, -9999.00, 3.20501}, +{25.7705, -9999.00, 3.03543}, +{26.1873, -9999.00, 2.87482}, +{26.6109, -9999.00, 2.72270}, +{27.0413, -9999.00, 2.57864}, +{27.4786, -9999.00, 2.44220}, +{27.9231, -9999.00, 2.31298}, +{28.3747, -9999.00, 2.19332}, +{28.8337, -9999.00, 2.08206}, +{29.3000, 8.60390, 1.97645}, +{29.7739, 8.48945, 1.87619}, +{30.2555, 8.37226, 1.78101}, +{30.7449, 8.25130, 1.69067}, +{31.2421, 8.12476, 1.60815}, +{31.7475, 7.99986, 1.53269}, +{32.2609, 7.87412, 1.46076}, +{32.7827, 7.74628, 1.39221}, +{33.3130, 7.61584, 1.32688}, +{33.8518, 7.48238, 1.26462}, +{34.3993, 7.34562, 1.20527}, +{34.9557, 7.20568, 1.14784}, +{35.5211, 7.05951, 1.09115}, +{36.0956, 6.90638, 1.03727}, +{36.6794, 6.74544, 0.986041}, +{37.2727, 6.57312, 0.937347}, +{37.8755, 6.38740, 0.903753}, +{38.4882, 6.20463, 0.877899}, +{39.1107, 6.01751, 0.852786}, +{39.7432, 5.81973, 0.828390}, +{40.3861, 5.60378, 0.804693}, +{41.0393, 5.37609, 0.806253}, +{41.7031, 5.14580, 0.810089}, +{42.3776, 4.90062, 0.813942}, +{43.0630, 4.62757, 0.823425}, +{43.7595, 4.33466, 0.847795}, +{44.4673, 4.00705, 0.872888}, +{45.1865, 3.60324, 0.902866}, +{45.9174, 3.07850, 0.977345}, +{46.6600, 2.35422, 1.31670}, +{47.4147, 1.73260, 2.00134}, +{48.1816, 1.27760, 3.04198}, +{48.9609, 1.29574, 4.62369}, +{49.7528, 3.17649, 7.02792}, +{50.5576, 5.89873, 4.83265}, +{51.3753, 5.93686, 2.81967}, +{52.2062, 4.95233, 1.64518}, +{53.0506, 3.76698, 1.34657}, +{53.9087, 2.97006, 1.36268}, +{54.7806, 2.13977, 1.43819}, +{55.6667, 1.44322, 1.93061}, +{56.5670, 1.19607, 2.59163}, +{57.4820, 1.23617, 2.49683}, +{58.4117, 0.800734, 2.24931}, +{59.3564, -0.147580, 2.19230}, +{60.3165, -0.995416, 2.58873}, +{61.2921, -1.73890, 3.05686}, +{62.2834, -2.46034, 3.60962}, +{63.2908, -3.16539, 4.26232}, +{64.3145, -3.82932, 5.03308}, +{65.3547, -4.40672, 5.87252}, +{66.4118, -4.98989, 6.78790}, +{67.4859, -5.54052, 7.84598}, +{68.5775, -5.99773, 9.06897}, +{69.6867, -6.26717, 10.4826}, +{70.8138, -6.04553, 11.8131}, +{71.9591, -5.98907, 12.8675}, +{73.1230, -5.96129, 14.0160}, +{74.3057, -5.86799, 15.2670}, +{75.5076, -5.61508, 16.5375}, +{76.7289, -5.34793, 17.8058}, +{77.9699, -4.99390, 19.1713}, +{79.2310, -4.47498, 20.6415}, +{80.5125, -3.59753, 22.2245}, +{81.8147, -2.56194, 23.2596}, +{83.1380, -1.62484, 24.3108}, +{84.4827, -0.675598, 25.4095}, +{85.8491, 0.421517, 26.5578}, +{87.2377, 1.71087, 27.5394}, +{88.6487, 2.98865, 28.4517}, +{90.0825, 4.35036, 29.3941}, +{91.5395, 5.98692, 30.3677}, +{93.0201, 7.74100, 30.8583}, +{94.5246, 9.44366, 31.3227}, +{96.0535, 11.3136, 31.7941}, +{97.6071, 13.2351, 31.8194}, +{99.1858, 15.0560, 31.7940}, +{100.790, 17.0547, 31.7686}, +{102.420, 18.9728, 31.0869}, +{104.077, 20.6491, 30.4158}, +{105.760, 22.2140, 29.7593}, +{107.471, 23.8175, 29.1169}, +{109.209, 25.7738, 28.4884}, +{110.975, 27.8087, 26.8173}, +{112.770, 29.0270, 24.8686}, +{114.594, 29.8169, 23.0614}, +{116.448, 30.3470, 21.3857}, +{118.331, 30.6920, 19.8317}, +{120.245, 30.8990, 18.3906}, +{122.190, 30.9995, 17.0543}, +{124.166, 31.0194, 15.8151}, +{126.175, 30.9796, 14.6658}, +{128.215, 30.9057, 13.6001}, +{130.289, 30.8581, 12.5697}, +{132.397, 30.6890, 11.4908}, +{134.538, 30.4278, 10.5045}, +{136.714, 30.1107, 9.60285}, +{138.925, 29.7580, 8.77859}, +{141.172, 29.3817, 8.02511}, +{143.456, 28.9896, 7.33627}, +{145.776, 28.5894, 6.70659}, +{148.134, 28.1879, 6.13095}, +{150.530, 27.7972, 5.60470}, +{152.964, 27.4579, 5.12362}, +{155.439, 27.0954, 4.50919}, +{157.953, 26.6200, 3.93609}, +{160.507, 26.0686, 3.43468}, +{163.103, 25.4568, 2.99581}, +{165.742, 24.7464, 2.71715}, +{168.422, 24.1357, 2.57603}, +{171.146, 23.5918, 2.48845}, +{173.915, 23.1039, 2.42940}, +{176.727, 22.6237, 2.38967}, +{179.586, 22.1910, 2.39376}, +{182.491, 21.7807, 2.39786}, +{185.442, 21.3868, 2.44337}, +{188.442, 21.0176, 2.50095}, +{191.489, 20.6681, 2.59423}, +{194.587, 20.3584, 2.70521}, +{197.734, 20.0769, 2.82093}, +{200.932, 19.8169, 2.94182}, +{204.182, 19.5761, 3.06831}, +{207.485, 19.3522, 3.20023}, +{210.840, 19.1441, 3.33783}, +{214.251, 18.9508, 3.48134}, +{217.716, 18.7722, 3.63102}, +{221.237, 18.6083, 3.78714}, +{224.816, 18.4606, 3.94997}, +{228.452, 18.3375, 4.11247}, +{232.147, 18.2198, 4.26871}, +{235.902, 18.1080, 4.43088}, +{239.717, 18.0073, 4.59922}, +{243.595, 17.9190, 4.77395}, +{247.535, 17.8453, 4.95531}, +{251.538, 17.7897, 5.14357}, +{255.607, 17.7647, 5.33898}, +{259.741, 17.7640, 5.49854}, +{263.942, 17.7565, 5.64678}, +{268.211, 17.7464, 5.79902}, +{272.549, 17.7440, 5.95538}, +{276.957, 17.7528, 6.11594}, +{281.437, 17.7777, 6.28084}, +{285.989, 17.8472, 6.45017}, +{290.615, 17.9205, 6.55562}, +{295.315, 17.9794, 6.66107}, +{300.092, 18.0464, 6.76823}, +{304.945, 18.1297, 6.84572}, +{309.878, 18.1940, 6.90162}, +{314.890, 18.2423, 6.95797}, +{319.983, 18.2860, 7.01478}, +{325.158, 18.3282, 7.07206}, +{330.418, 18.3717, 7.12981}, +{335.762, 18.4219, 7.18802}, +{341.192, 18.5004, 7.23740}, +{346.711, 18.5575, 7.23201}, +{352.319, 18.5910, 7.22663}, +{358.017, 18.6087, 7.22125}, +{363.808, 18.6154, 7.21587}, +{369.692, 18.6124, 7.21050}, +{375.672, 18.6009, 7.20513}, +{381.748, 18.5816, 7.19977}, +{387.922, 18.5557, 7.19441}, +{394.197, 18.5253, 7.18905}, +{400.573, 18.5011, 7.18158}, +{407.052, 18.4584, 7.13971}, +{413.635, 18.3921, 7.09809}, +{420.326, 18.3053, 7.05671}, +{427.124, 18.2007, 7.01558}, +{434.032, 18.0782, 6.97468}, +{441.052, 17.9373, 6.93402}, +{448.186, 17.7774, 6.89360}, +{455.435, 17.5976, 6.85341}, +{462.802, 17.4026, 6.81346}, +{470.287, 17.1876, 6.75741}, +{477.894, 16.9291, 6.68752}, +{485.623, 16.6273, 6.61836}, +{493.478, 16.2811, 6.54990}, +{501.459, 15.8858, 6.48216}, +{509.570, 15.4349, 6.41513}, +{517.812, 14.9191, 6.34833}, +{526.187, 14.3260, 6.28195}, +{534.698, 13.6396, 6.21627}, +{543.346, 12.8378, 6.15128}, +{552.134, 11.8894, 6.08696}, +{561.065, 10.7484, 6.02332}, +{570.139, 9.34070, 5.96034}, +{579.361, 7.55512, 5.91282}, +{588.732, 5.18532, 5.87023}, +{598.254, 1.76651, 5.82814}, +{607.930, -4.05496, 5.78634}, +{617.763, -21.9139, 5.74484}, +{619.900, -56.4870, 5.73595}, +{620.100, -56.4286, 41.0545}, +{627.755, -6.49421, 40.1753}, +{637.908, 3.68249, 39.0540}, +{648.226, 9.30876, 37.9640}, +{658.711, 13.1979, 36.9043}, +{669.365, 16.0906, 35.8732}, +{680.191, 18.3507, 34.9667}, +{691.193, 20.2378, 34.1577}, +{702.372, 21.8610, 33.3985}, +{713.733, 23.2741, 32.6604}, +{725.277, 24.5079, 31.9415}, +{737.008, 25.5853, 31.2364}, +{748.928, 26.5221, 30.5481}, +{761.042, 27.3222, 29.8770}, +{773.351, 27.9945, 29.2340}, +{785.859, 28.5448, 28.6540}, +{798.570, 29.0214, 28.1256}, +{811.486, 29.4208, 27.6085}, +{824.611, 29.7105, 27.0998}, +{837.949, 29.6802, 26.5996}, +{851.502, 29.5116, 26.4824}, +{865.274, 29.2739, 26.7842}, +{879.269, 29.3738, 27.4750}, +{893.491, 29.8774, 28.1846}, +{907.943, 30.6169, 28.9130}, +{922.628, 32.0426, 29.6607}, +{937.551, 33.5319, 29.5134}, +{952.715, 34.7961, 29.1400}, +{968.124, 35.8226, 28.5769}, +{983.783, 36.6192, 28.0236}, +{999.695, 37.3058, 27.4875}, +{1015.86, 37.8835, 26.9684}, +{1032.29, 38.4062, 26.5169}, +{1048.99, 38.8978, 26.0924}, +{1065.96, 39.3726, 25.6951}, +{1083.20, 39.8370, 25.3041}, +{1100.72, 40.2830, 24.9191}, +{1118.52, 40.7121, 24.5398}, +{1136.61, 41.1257, 24.1663}, +{1155.00, 41.5258, 23.7984}, +{1173.68, 41.9141, 23.4360}, +{1192.66, 42.2934, 23.0794}, +{1211.95, 42.6661, 22.7281}, +{1231.55, 43.0512, 22.3822}, +{1251.47, 43.4350, 22.0112}, +{1271.72, 43.8164, 21.6137}, +{1292.29, 44.1595, 21.1837}, +{1313.19, 44.4581, 20.7624}, +{1334.43, 44.7336, 20.3494}, +{1356.01, 44.9897, 19.9446}, +{1377.94, 45.2288, 19.5476}, +{1400.23, 45.4530, 19.1587}, +{1422.88, 45.6641, 18.7776}, +{1445.89, 45.8646, 18.4040}, +{1469.28, 46.0551, 18.0362}, +{1493.04, 46.2392, 17.6733}, +{1517.19, 46.4111, 17.3080}, +{1541.73, 46.5673, 16.9489}, +{1566.67, 46.7120, 16.5972}, +{1592.01, 46.8464, 16.2527}, +{1617.76, 46.9717, 15.9154}, +{1643.92, 47.0888, 15.5853}, +{1670.51, 47.1984, 15.2617}, +{1697.53, 47.3012, 14.9449}, +{1724.99, 47.3994, 14.6348}, +{1752.89, 47.4913, 14.3258}, +{1781.24, 47.5752, 14.0217}, +{1810.05, 47.6509, 13.7229}, +{1839.32, 47.7196, 13.4301}, +{1869.07, 47.7816, 13.1435}, +{1899.30, 47.8377, 12.8632}, +{1930.02, 47.8886, 12.5888}, +{1961.24, 47.9346, 12.3204}, +{1992.96, 47.9745, 12.0579}, +{2025.20, 48.0140, 11.8050}, +{2057.95, 48.0509, 11.5499}, +{2091.24, 48.0815, 11.2994}, +{2125.06, 48.1068, 11.0536}, +{2159.43, 48.1277, 10.8127}, +{2194.36, 48.1444, 10.5763}, +{2229.85, 48.1569, 10.3440}, +{2265.92, 48.1650, 10.1165}, +{2302.57, 48.1694, 9.89337}, +{2339.81, 48.1699, 9.67430}, +{2377.66, 48.1667, 9.45950}, +{2416.11, 48.1596, 9.24862}, +{2455.19, 48.1488, 9.04206}, +{2494.90, 48.1342, 8.83919}, +{2535.26, 48.1161, 8.64043}, +{2576.26, 48.0943, 8.44526}, +{2617.93, 48.0688, 8.25386}, +{2660.27, 48.0393, 8.06607}, +{2703.30, 48.0062, 7.88234}, +{2747.03, 47.9695, 7.70179}, +{2791.46, 47.9288, 7.52474}, +{2836.61, 47.8842, 7.35110}, +{2882.49, 47.8354, 7.18070}, +{2929.11, 47.7823, 7.01362}, +{2976.48, 47.7248, 6.84971}, +{3024.63, 47.6626, 6.68903}, +{3073.55, 47.5956, 6.53139}, +{3123.26, 47.5234, 6.37671}, +{3173.78, 47.4457, 6.22507}, +{3225.11, 47.3622, 6.07632}, +{3277.27, 47.2723, 5.93040}, +{3330.28, 47.1756, 5.78727}, +{3384.15, 47.0715, 5.64690}, +{3438.88, 46.9592, 5.50920}, +{3494.50, 46.8379, 5.37413}, +{3551.02, 46.7065, 5.24167}, +{3608.46, 46.5638, 5.11168}, +{3666.82, 46.4082, 4.98418}, +{3726.13, 46.2379, 4.85918}, +{3786.40, 46.0506, 4.73645}, +{3847.64, 45.8431, 4.61609}, +{3909.87, 45.6118, 4.49810}, +{3973.11, 45.3515, 4.38229}, +{4037.38, 45.0551, 4.26868}, +{4102.68, 44.7128, 4.15724}, +{4169.03, 44.3099, 4.04789}, +{4236.46, 43.8230, 3.94061}, +{4304.98, 43.2119, 3.83546}, +{4374.62, 42.3967, 3.73217}, +{4445.37, 41.1771, 3.63082}, +{4517.27, 38.7032, 3.53148}, +{4557.00, 24.5846, 3.47842}, +{4557.20, 24.5863, 10.8948}, +{4590.33, 38.2162, 10.7676}, +{4664.58, 40.7492, 10.4912}, +{4740.03, 41.5098, 10.2219}, +{4816.69, 41.1320, 9.95960}, +{4852.00, 34.8390, 9.84242}, +{4852.20, 34.8434, 13.4276}, +{4894.60, 41.9824, 13.2369}, +{4973.77, 43.6261, 12.8921}, +{5054.21, 44.4398, 12.5565}, +{5135.96, 44.7661, 12.2295}, +{5188.00, 41.4945, 12.0285}, +{5188.20, 41.4989, 13.9623}, +{5219.03, 45.0657, 13.8381}, +{5303.44, 46.4440, 13.5072}, +{5389.22, 47.2785, 13.1822}, +{5476.39, 47.9296, 12.8636}, +{5564.97, 48.4736, 12.5511}, +{5654.98, 48.9426, 12.2445}, +{5746.44, 49.3542, 11.9440}, +{5839.39, 49.7198, 11.6495}, +{5933.83, 50.0472, 11.3610}, +{6029.81, 50.3423, 11.0785}, +{6127.33, 50.6095, 10.8017}, +{6226.44, 50.8520, 10.5308}, +{6327.15, 51.0729, 10.2657}, +{6429.48, 51.2745, 10.0063}, +{6533.48, 51.4587, 9.75257}, +{6639.15, 51.6272, 9.50438}, +{6746.54, 51.7814, 9.26173}, +{6855.65, 51.9226, 9.02454}, +{6966.54, 52.0520, 8.79265}, +{7079.22, 52.1703, 8.56596}, +{7193.72, 52.2786, 8.34462}, +{7310.07, 52.3776, 8.12824}, +{7428.31, 52.4679, 7.91697}, +{7548.45, 52.5502, 7.71078}, +{7670.54, 52.6253, 7.50938}, +{7794.61, 52.6935, 7.31274}, +{7920.68, 52.7553, 7.12084}, +{8048.79, 52.8112, 6.93336}, +{8178.98, 52.8613, 6.75046}, +{8311.26, 52.9063, 6.57225}, +{8445.69, 52.9468, 6.39830}, +{8582.29, 52.9826, 6.22836}, +{8721.11, 53.0140, 6.06286}, +{8862.16, 53.0416, 5.90149}, +{9005.50, 53.0657, 5.74410}, +{9151.16, 53.0862, 5.59036}, +{9299.17, 53.1034, 5.44083}, +{9449.58, 53.1177, 5.29493}, +{9602.42, 53.1292, 5.15276}, +{9757.73, 53.1381, 5.01412}, +{9915.55, 53.1444, 4.87897}, +{10075.9, 53.1484, 4.74737}, +{10238.9, 53.1502, 4.61915}, +{10404.5, 53.1501, 4.49423}, +{10572.8, 53.1481, 4.37252}, +{10743.8, 53.1443, 4.25397}, +{10917.6, 53.1389, 4.13850}, +{11094.2, 53.1319, 4.02603}, +{11273.6, 53.1235, 3.91650}, +{11455.9, 53.1138, 3.80983}, +{11641.2, 53.1028, 3.70596}, +{11829.5, 53.0907, 3.60482}, +{12020.8, 53.0775, 3.50635}, +{12215.3, 53.0633, 3.41047}, +{12412.8, 53.0481, 3.31714}, +{12613.6, 53.0321, 3.22627}, +{12817.6, 53.0152, 3.13782}, +{13025.0, 52.9976, 3.05172}, +{13235.6, 52.9792, 2.96792}, +{13449.7, 52.9602, 2.88636}, +{13667.2, 52.9406, 2.80698}, +{13888.3, 52.9204, 2.72972}, +{14112.9, 52.8997, 2.65454}, +{14341.2, 52.8785, 2.58138}, +{14573.1, 52.8568, 2.51018}, +{14808.9, 52.8346, 2.44090}, +{15048.4, 52.8121, 2.37349}, +{15291.8, 52.7892, 2.30791}, +{15539.1, 52.7658, 2.24409}, +{15790.4, 52.7422, 2.18200}, +{16045.8, 52.7182, 2.12160}, +{16305.4, 52.6939, 2.06283}, +{16569.1, 52.6692, 2.00566}, +{16837.1, 52.6443, 1.95003}, +{17109.4, 52.6191, 1.89593}, +{17386.1, 52.5935, 1.84329}, +{17667.4, 52.5677, 1.79209}, +{17953.1, 52.5416, 1.74228}, +{18243.5, 52.5151, 1.69383}, +{18538.6, 52.4884, 1.64670}, +{18838.4, 52.4613, 1.60086}, +{19143.1, 52.4338, 1.55626}, +{19452.7, 52.4060, 1.51289}, +{19767.4, 52.3778, 1.47070}, +{20087.1, 52.3492, 1.42967}, +{20412.0, 52.3201, 1.38975}, +{20742.1, 52.2905, 1.35093}, +{21077.6, 52.2604, 1.31317}, +{21418.5, 52.2297, 1.27645}, +{21765.0, 52.1983, 1.24073}, +{22117.0, 52.1662, 1.20598}, +{22474.7, 52.1334, 1.17219}, +{22838.2, 52.0996, 1.13932}, +{23207.6, 52.0648, 1.10735}, +{23583.0, 52.0289, 1.07626}, +{23964.4, 51.9917, 1.04602}, +{24352.0, 51.9531, 1.01660}, +{24745.9, 51.9129, 0.987992}, +{25146.2, 51.8708, 0.960164}, +{25552.9, 51.8266, 0.933098}, +{25966.2, 51.7799, 0.906772}, +{26386.1, 51.7304, 0.881165}, +{26812.9, 51.6775, 0.856258}, +{27246.6, 51.6205, 0.832031}, +{27687.3, 51.5588, 0.808466}, +{28135.1, 51.4913, 0.785544}, +{28590.2, 51.4167, 0.763247}, +{29052.6, 51.3331, 0.741559}, +{29522.5, 51.2379, 0.720461}, +{30000.0, 51.1274, 0.699939}, +{0, 0, 0} +}; + +e_fp_fdp xe[] = { /* Z = 54 */ +{10.0000, -9999.00, 0.312014E-14}, +{10.1617, -9999.00, 0.317061E-14}, +{10.3261, -9999.00, 0.322189E-14}, +{10.4931, -9999.00, 0.327400E-14}, +{10.6628, -9999.00, 0.332696E-14}, +{10.8353, -9999.00, 0.338077E-14}, +{11.0106, -9999.00, 0.343545E-14}, +{11.1886, -9999.00, 0.349102E-14}, +{11.3696, -9999.00, 0.354748E-14}, +{11.5535, -9999.00, 0.360486E-14}, +{11.7404, -9999.00, 0.366316E-14}, +{11.9303, -9999.00, 0.372241E-14}, +{12.0000, -9999.00, 0.374417E-14}, +{12.2000, -9999.00, 0.307739E-04}, +{12.3193, -9999.00, 1.78551}, +{12.5186, -9999.00, 1.86163}, +{12.7210, -9999.00, 7.89998}, +{12.9268, -9999.00, 9.28777}, +{13.1359, -9999.00, 10.1806}, +{13.3483, -9999.00, 10.8450}, +{13.5642, -9999.00, 11.4783}, +{13.7836, -9999.00, 11.9987}, +{14.0066, -9999.00, 12.5503}, +{14.2331, -9999.00, 13.1464}, +{14.4633, -9999.00, 13.3356}, +{14.6973, -9999.00, 13.4705}, +{14.9350, -9999.00, 13.6068}, +{15.1765, -9999.00, 13.7445}, +{15.4220, -9999.00, 13.7867}, +{15.6714, -9999.00, 13.6926}, +{15.9249, -9999.00, 13.5991}, +{16.1825, -9999.00, 13.5063}, +{16.4442, -9999.00, 13.4141}, +{16.7102, -9999.00, 13.2302}, +{16.9805, -9999.00, 12.9384}, +{17.2551, -9999.00, 12.6530}, +{17.5342, -9999.00, 12.3738}, +{17.8178, -9999.00, 12.1009}, +{18.1060, -9999.00, 11.8340}, +{18.3989, -9999.00, 11.5597}, +{18.6964, -9999.00, 11.2620}, +{18.9988, -9999.00, 10.9720}, +{19.3061, -9999.00, 10.6895}, +{19.6184, -9999.00, 10.4142}, +{19.9357, -9999.00, 10.1460}, +{20.2582, -9999.00, 9.88472}, +{20.5858, -9999.00, 9.63017}, +{20.9188, -9999.00, 9.38218}, +{21.2571, -9999.00, 9.14057}, +{21.6009, -9999.00, 8.90518}, +{21.9503, -9999.00, 8.65326}, +{22.3053, -9999.00, 8.24073}, +{22.6661, -9999.00, 7.84788}, +{23.0327, -9999.00, 7.47375}, +{23.4053, -9999.00, 7.11745}, +{23.7838, -9999.00, 6.77814}, +{24.1685, -9999.00, 6.45500}, +{24.5594, -9999.00, 6.14727}, +{24.9566, -9999.00, 5.85421}, +{25.3603, -9999.00, 5.57512}, +{25.7705, -9999.00, 5.30934}, +{26.1873, -9999.00, 5.05623}, +{26.6109, -9999.00, 4.81518}, +{27.0413, -9999.00, 4.58563}, +{27.4786, -9999.00, 4.35879}, +{27.9231, -9999.00, 4.14242}, +{28.3747, -9999.00, 3.93679}, +{28.8337, -9999.00, 3.74136}, +{29.3000, 9.24787, 3.55564}, +{29.7739, 9.15401, 3.37914}, +{30.2555, 9.05665, 3.21139}, +{30.7449, 8.95659, 3.05198}, +{31.2421, 8.85495, 2.90047}, +{31.7475, 8.75252, 2.75649}, +{32.2609, 8.66863, 2.61117}, +{32.7827, 8.56578, 2.44432}, +{33.3130, 8.43921, 2.28813}, +{33.8518, 8.30286, 2.14192}, +{34.3993, 8.15845, 2.00505}, +{34.9557, 8.00686, 1.87693}, +{35.5211, 7.84855, 1.75699}, +{36.0956, 7.68358, 1.64472}, +{36.6794, 7.50428, 1.53963}, +{37.2727, 7.32127, 1.45808}, +{37.8755, 7.14335, 1.38499}, +{38.4882, 6.96445, 1.31556}, +{39.1107, 6.77222, 1.24961}, +{39.7432, 6.57704, 1.20822}, +{40.3861, 6.39261, 1.17650}, +{41.0393, 6.21168, 1.14562}, +{41.7031, 6.02982, 1.11554}, +{42.3776, 5.84214, 1.08702}, +{43.0630, 5.65382, 1.06731}, +{43.7595, 5.46429, 1.04795}, +{44.4673, 5.27081, 1.02894}, +{45.1865, 5.07147, 1.01028}, +{45.9174, 4.85931, 0.991962}, +{46.6600, 4.64081, 0.985351}, +{47.4147, 4.41909, 0.980027}, +{48.1816, 4.18957, 0.974732}, +{48.9609, 3.94228, 0.970576}, +{49.7528, 3.68733, 0.979680}, +{50.5576, 3.42626, 0.988870}, +{51.3753, 3.15172, 0.998145}, +{52.2062, 2.85945, 1.01157}, +{53.0506, 2.55235, 1.02998}, +{53.9087, 2.22780, 1.04873}, +{54.7806, 1.87892, 1.06781}, +{55.6667, 1.49957, 1.09067}, +{56.5670, 1.08790, 1.11783}, +{57.4820, 0.635603, 1.14567}, +{58.4117, 0.128885, 1.17420}, +{59.3564, -0.469527, 1.20343}, +{60.3165, -1.17074, 1.27189}, +{61.2921, -2.01898, 1.35847}, +{62.2834, -3.32953, 1.54840}, +{63.2908, -4.78492, 2.60003}, +{64.3145, -6.07324, 4.36594}, +{65.3547, -4.99111, 7.33114}, +{66.4118, -3.14174, 7.31205}, +{67.4859, -2.75421, 6.32607}, +{68.5775, -3.33890, 5.47306}, +{69.6867, -4.96733, 5.26332}, +{70.8138, -6.42927, 6.13015}, +{71.9591, -7.44364, 7.13975}, +{73.1230, -8.36901, 8.31560}, +{74.3057, -9.20709, 9.68514}, +{75.5076, -9.88767, 11.2802}, +{76.7289, -10.2734, 12.9916}, +{77.9699, -10.5619, 14.7116}, +{79.2310, -10.5638, 16.6594}, +{80.5125, -10.3859, 18.4108}, +{81.8147, -10.1979, 20.2492}, +{83.1380, -9.86862, 22.2711}, +{84.4827, -8.89494, 24.3769}, +{85.8491, -7.87394, 25.9997}, +{87.2377, -6.97134, 27.7306}, +{88.6487, -5.91492, 29.5766}, +{90.0825, -4.32097, 31.5456}, +{91.5395, -2.54196, 32.9879}, +{93.0201, -0.817933, 34.3950}, +{94.5246, 1.09180, 35.8621}, +{96.0535, 3.61712, 37.0881}, +{97.6071, 6.04274, 37.6383}, +{99.1858, 8.20609, 38.1965}, +{100.790, 10.4756, 38.7631}, +{102.420, 13.1326, 39.1040}, +{104.077, 15.6864, 38.9448}, +{105.760, 18.0665, 38.7863}, +{107.471, 20.7633, 38.6284}, +{109.209, 23.4217, 37.6772}, +{110.975, 25.7865, 36.6323}, +{112.770, 28.6833, 35.6163}, +{114.594, 31.1490, 33.2117}, +{116.448, 32.7183, 30.9479}, +{118.331, 33.9623, 28.8384}, +{120.245, 35.1408, 26.8726}, +{122.190, 36.4739, 24.7408}, +{124.166, 37.1409, 21.9711}, +{126.175, 37.2229, 19.5113}, +{128.215, 37.0163, 17.3269}, +{130.289, 36.6180, 15.3871}, +{132.397, 36.0981, 13.6645}, +{134.538, 35.4897, 12.1347}, +{136.714, 34.8270, 10.7762}, +{138.925, 34.1190, 9.56974}, +{141.172, 33.3983, 8.51687}, +{143.456, 32.6755, 7.58211}, +{145.776, 31.9591, 6.74997}, +{148.134, 31.2477, 6.00916}, +{150.530, 30.5484, 5.34963}, +{152.964, 29.8693, 4.75853}, +{155.439, 29.1829, 4.20373}, +{157.953, 28.4795, 3.71361}, +{160.507, 27.7506, 3.30996}, +{163.103, 27.0554, 3.00803}, +{165.742, 26.3968, 2.73365}, +{168.422, 25.7007, 2.50814}, +{171.146, 25.0692, 2.42290}, +{173.915, 24.5010, 2.34056}, +{176.727, 23.9171, 2.29085}, +{179.586, 23.3883, 2.32877}, +{182.491, 22.9277, 2.36731}, +{185.442, 22.4983, 2.42192}, +{188.442, 22.0995, 2.48194}, +{191.489, 21.7114, 2.54345}, +{194.587, 21.3291, 2.64107}, +{197.734, 20.9806, 2.76930}, +{200.932, 20.6692, 2.90375}, +{204.182, 20.3805, 3.04473}, +{207.485, 20.1117, 3.19362}, +{210.840, 19.8625, 3.35046}, +{214.251, 19.6316, 3.51500}, +{217.716, 19.4184, 3.68762}, +{221.237, 19.2267, 3.86872}, +{224.816, 19.0517, 4.05053}, +{228.452, 18.8896, 4.24019}, +{232.147, 18.7442, 4.43874}, +{235.902, 18.6171, 4.64658}, +{239.717, 18.5106, 4.86416}, +{243.595, 18.4460, 5.09193}, +{247.535, 18.4112, 5.29354}, +{251.538, 18.3738, 5.47387}, +{255.607, 18.3395, 5.66034}, +{259.741, 18.3173, 5.85316}, +{263.942, 18.3114, 6.05255}, +{268.211, 18.3514, 6.25872}, +{272.549, 18.4216, 6.42272}, +{276.957, 18.4756, 6.54819}, +{281.437, 18.5193, 6.67611}, +{285.989, 18.5652, 6.80654}, +{290.615, 18.6195, 6.93951}, +{295.315, 18.6897, 7.07508}, +{300.092, 18.8057, 7.21331}, +{304.945, 18.9234, 7.26060}, +{309.878, 19.0080, 7.29716}, +{314.890, 19.0713, 7.33392}, +{319.983, 19.1248, 7.37085}, +{325.158, 19.1713, 7.40797}, +{330.418, 19.2124, 7.44529}, +{335.762, 19.2493, 7.48278}, +{341.192, 19.2829, 7.52047}, +{346.711, 19.3138, 7.55835}, +{352.319, 19.3426, 7.59641}, +{358.017, 19.3701, 7.63467}, +{363.808, 19.3974, 7.67313}, +{369.692, 19.4263, 7.71177}, +{375.672, 19.4655, 7.75061}, +{381.748, 19.5031, 7.76071}, +{387.922, 19.5253, 7.76418}, +{394.197, 19.5345, 7.76765}, +{400.573, 19.5356, 7.77112}, +{407.052, 19.5294, 7.77460}, +{413.635, 19.5164, 7.77807}, +{420.326, 19.4972, 7.78154}, +{427.124, 19.4722, 7.78503}, +{434.032, 19.4422, 7.78850}, +{441.052, 19.4082, 7.79198}, +{448.186, 19.3783, 7.79547}, +{455.435, 19.3645, 7.78776}, +{462.802, 19.3252, 7.71960}, +{470.287, 19.2438, 7.65206}, +{477.894, 19.1344, 7.58510}, +{485.623, 18.9992, 7.51873}, +{493.478, 18.8383, 7.45294}, +{501.459, 18.6506, 7.38772}, +{509.570, 18.4343, 7.32308}, +{517.812, 18.1867, 7.25901}, +{526.187, 17.9046, 7.19549}, +{534.698, 17.5839, 7.13252}, +{543.346, 17.2149, 7.07011}, +{552.134, 16.7959, 7.01671}, +{561.065, 16.3253, 6.96779}, +{570.139, 15.7908, 6.91921}, +{579.361, 15.1775, 6.87097}, +{588.732, 14.4668, 6.82307}, +{598.254, 13.6367, 6.77550}, +{607.930, 12.6493, 6.72163}, +{617.763, 11.4392, 6.65668}, +{627.755, 9.91544, 6.59235}, +{637.908, 7.92458, 6.52865}, +{648.226, 5.15405, 6.46555}, +{658.711, 0.823389, 6.40307}, +{669.365, -8.21883, 6.34119}, +{676.300, -53.1265, 6.30176}, +{676.500, -53.0765, 40.0443}, +{680.191, -13.5912, 39.7162}, +{691.193, 1.88287, 38.7644}, +{702.372, 8.50978, 37.8355}, +{713.733, 12.8348, 36.9287}, +{725.277, 16.0447, 36.0437}, +{737.008, 18.5805, 35.1800}, +{748.928, 20.6559, 34.3369}, +{761.042, 22.3906, 33.5140}, +{773.351, 23.8460, 32.7108}, +{785.859, 25.0739, 31.9493}, +{798.570, 26.1402, 31.2468}, +{811.486, 27.0729, 30.5598}, +{824.611, 27.8731, 29.8878}, +{837.949, 28.5435, 29.2306}, +{851.502, 29.0794, 28.5879}, +{865.274, 29.4623, 27.9593}, +{879.269, 29.6403, 27.3445}, +{893.491, 29.3691, 26.7433}, +{907.943, 28.8453, 27.1220}, +{922.628, 28.8239, 27.9663}, +{937.551, 29.3445, 28.8369}, +{952.715, 30.2131, 29.7346}, +{968.124, 31.8753, 30.4358}, +{983.783, 33.5306, 29.9975}, +{999.695, 34.5075, 29.5656}, +{1015.86, 35.3891, 29.1399}, +{1032.29, 36.1745, 28.7203}, +{1048.99, 36.8886, 28.3081}, +{1065.96, 37.5503, 27.9085}, +{1083.20, 38.1725, 27.5145}, +{1100.72, 38.7608, 27.1261}, +{1118.52, 39.3204, 26.7430}, +{1136.61, 39.8555, 26.3655}, +{1155.00, 40.3704, 25.9932}, +{1173.68, 40.8685, 25.6260}, +{1192.66, 41.3542, 25.2644}, +{1211.95, 41.8336, 24.9077}, +{1231.55, 42.3199, 24.5560}, +{1251.47, 42.8247, 24.1689}, +{1271.72, 43.3132, 23.7415}, +{1292.29, 43.7480, 23.2653}, +{1313.19, 44.1298, 22.7985}, +{1334.43, 44.4783, 22.3412}, +{1356.01, 44.7999, 21.8932}, +{1377.94, 45.0988, 21.4540}, +{1400.23, 45.3774, 21.0235}, +{1422.88, 45.6376, 20.6017}, +{1445.89, 45.8813, 20.1883}, +{1469.28, 46.1096, 19.7834}, +{1493.04, 46.3237, 19.3868}, +{1517.19, 46.5250, 18.9992}, +{1541.73, 46.7150, 18.6195}, +{1566.67, 46.8945, 18.2476}, +{1592.01, 47.0641, 17.8828}, +{1617.76, 47.2240, 17.5254}, +{1643.92, 47.3755, 17.1753}, +{1670.51, 47.5192, 16.8318}, +{1697.53, 47.6555, 16.4953}, +{1724.99, 47.7891, 16.1656}, +{1752.89, 47.9166, 15.8343}, +{1781.24, 48.0323, 15.5070}, +{1810.05, 48.1391, 15.1843}, +{1839.32, 48.2365, 14.8680}, +{1869.07, 48.3262, 14.5584}, +{1899.30, 48.4094, 14.2557}, +{1930.02, 48.4866, 13.9588}, +{1961.24, 48.5576, 13.6681}, +{1992.96, 48.6218, 13.3835}, +{2025.20, 48.6862, 13.1109}, +{2057.95, 48.7501, 12.8333}, +{2091.24, 48.8033, 12.5599}, +{2125.06, 48.8512, 12.2914}, +{2159.43, 48.8936, 12.0278}, +{2194.36, 48.9308, 11.7689}, +{2229.85, 48.9633, 11.5149}, +{2265.92, 48.9913, 11.2654}, +{2302.57, 49.0146, 11.0201}, +{2339.81, 49.0333, 10.7797}, +{2377.66, 49.0480, 10.5433}, +{2416.11, 49.0581, 10.3112}, +{2455.19, 49.0642, 10.0837}, +{2494.90, 49.0663, 9.85962}, +{2535.26, 49.0639, 9.64058}, +{2576.26, 49.0580, 9.42503}, +{2617.93, 49.0477, 9.21347}, +{2660.27, 49.0335, 9.00620}, +{2703.30, 49.0155, 8.80231}, +{2747.03, 48.9935, 8.60254}, +{2791.46, 48.9675, 8.40617}, +{2836.61, 48.9373, 8.21365}, +{2882.49, 48.9032, 8.02469}, +{2929.11, 48.8648, 7.83922}, +{2976.48, 48.8221, 7.65729}, +{3024.63, 48.7751, 7.47879}, +{3073.55, 48.7236, 7.30363}, +{3123.26, 48.6674, 7.13165}, +{3173.78, 48.6062, 6.96295}, +{3225.11, 48.5400, 6.79748}, +{3277.27, 48.4683, 6.63504}, +{3330.28, 48.3909, 6.47567}, +{3384.15, 48.3073, 6.31930}, +{3438.88, 48.2172, 6.16590}, +{3494.50, 48.1200, 6.01544}, +{3551.02, 48.0151, 5.86774}, +{3608.46, 47.9017, 5.72276}, +{3666.82, 47.7789, 5.58056}, +{3726.13, 47.6459, 5.44120}, +{3786.40, 47.5013, 5.30424}, +{3847.64, 47.3434, 5.16996}, +{3909.87, 47.1705, 5.03820}, +{3973.11, 46.9802, 4.90890}, +{4037.38, 46.7695, 4.78203}, +{4102.68, 46.5345, 4.65756}, +{4169.03, 46.2700, 4.53550}, +{4236.46, 45.9693, 4.41575}, +{4304.98, 45.6222, 4.29816}, +{4374.62, 45.2140, 4.18271}, +{4445.37, 44.7217, 4.06953}, +{4517.27, 44.1057, 3.95854}, +{4590.33, 43.2884, 3.84952}, +{4664.58, 42.0783, 3.74260}, +{4740.03, 39.6979, 3.63771}, +{4787.10, 24.7370, 3.57457}, +{4787.30, 24.7388, 11.2300}, +{4816.69, 38.5346, 11.1152}, +{4894.60, 41.4727, 10.8198}, +{4973.77, 42.3694, 10.5324}, +{5054.21, 42.2444, 10.2525}, +{5107.10, 35.5416, 10.0749}, +{5107.30, 35.5459, 13.7396}, +{5135.96, 42.2243, 13.6172}, +{5219.03, 44.2811, 13.2720}, +{5303.44, 45.2083, 12.9357}, +{5389.22, 45.6040, 12.6079}, +{5452.70, 42.4369, 12.3739}, +{5452.90, 42.4412, 14.2726}, +{5476.39, 45.7152, 14.1809}, +{5564.97, 47.2510, 13.8442}, +{5654.98, 48.1223, 13.5140}, +{5746.44, 48.7967, 13.1897}, +{5839.39, 49.3585, 12.8715}, +{5933.83, 49.8423, 12.5592}, +{6029.81, 50.2667, 12.2530}, +{6127.33, 50.6436, 11.9527}, +{6226.44, 50.9812, 11.6584}, +{6327.15, 51.2854, 11.3700}, +{6429.48, 51.5609, 11.0876}, +{6533.48, 51.8112, 10.8106}, +{6639.15, 52.0390, 10.5397}, +{6746.54, 52.2471, 10.2746}, +{6855.65, 52.4372, 10.0151}, +{6966.54, 52.6112, 9.76125}, +{7079.22, 52.7706, 9.51281}, +{7193.72, 52.9165, 9.26990}, +{7310.07, 53.0501, 9.03234}, +{7428.31, 53.1725, 8.80037}, +{7548.45, 53.2846, 8.57347}, +{7670.54, 53.3871, 8.35171}, +{7794.61, 53.4806, 8.13507}, +{7920.68, 53.5660, 7.92366}, +{8048.79, 53.6438, 7.71695}, +{8178.98, 53.7145, 7.51516}, +{8311.26, 53.7786, 7.31810}, +{8445.69, 53.8364, 7.12583}, +{8582.29, 53.8887, 6.93824}, +{8721.11, 53.9356, 6.75508}, +{8862.16, 53.9776, 6.57633}, +{9005.50, 54.0148, 6.40187}, +{9151.16, 54.0477, 6.23183}, +{9299.17, 54.0765, 6.06593}, +{9449.58, 54.1015, 5.90408}, +{9602.42, 54.1229, 5.74633}, +{9757.73, 54.1409, 5.59257}, +{9915.55, 54.1559, 5.44270}, +{10075.9, 54.1681, 5.29650}, +{10238.9, 54.1775, 5.15401}, +{10404.5, 54.1843, 5.01514}, +{10572.8, 54.1888, 4.87979}, +{10743.8, 54.1910, 4.74792}, +{10917.6, 54.1911, 4.61942}, +{11094.2, 54.1892, 4.49423}, +{11273.6, 54.1856, 4.37228}, +{11455.9, 54.1802, 4.25349}, +{11641.2, 54.1732, 4.13778}, +{11829.5, 54.1648, 4.02508}, +{12020.8, 54.1549, 3.91534}, +{12215.3, 54.1438, 3.80846}, +{12412.8, 54.1315, 3.70439}, +{12613.6, 54.1180, 3.60307}, +{12817.6, 54.1035, 3.50441}, +{13025.0, 54.0880, 3.40837}, +{13235.6, 54.0716, 3.31487}, +{13449.7, 54.0543, 3.22386}, +{13667.2, 54.0363, 3.13527}, +{13888.3, 54.0175, 3.04904}, +{14112.9, 53.9980, 2.96511}, +{14341.2, 53.9779, 2.88344}, +{14573.1, 53.9572, 2.80395}, +{14808.9, 53.9360, 2.72660}, +{15048.4, 53.9142, 2.65133}, +{15291.8, 53.8919, 2.57808}, +{15539.1, 53.8692, 2.50682}, +{15790.4, 53.8461, 2.43748}, +{16045.8, 53.8225, 2.37001}, +{16305.4, 53.7986, 2.30437}, +{16569.1, 53.7743, 2.24052}, +{16837.1, 53.7497, 2.17840}, +{17109.4, 53.7247, 2.11796}, +{17386.1, 53.6995, 2.05918}, +{17667.4, 53.6739, 2.00199}, +{17953.1, 53.6480, 1.94636}, +{18243.5, 53.6218, 1.89225}, +{18538.6, 53.5952, 1.83962}, +{18838.4, 53.5684, 1.78843}, +{19143.1, 53.5413, 1.73864}, +{19452.7, 53.5138, 1.69021}, +{19767.4, 53.4861, 1.64311}, +{20087.1, 53.4579, 1.59730}, +{20412.0, 53.4294, 1.55275}, +{20742.1, 53.4005, 1.50942}, +{21077.6, 53.3711, 1.46727}, +{21418.5, 53.3413, 1.42629}, +{21765.0, 53.3110, 1.38643}, +{22117.0, 53.2801, 1.34767}, +{22474.7, 53.2486, 1.30998}, +{22838.2, 53.2165, 1.27332}, +{23207.6, 53.1836, 1.23767}, +{23583.0, 53.1499, 1.20300}, +{23964.4, 53.1153, 1.16929}, +{24352.0, 53.0796, 1.13650}, +{24745.9, 53.0428, 1.10462}, +{25146.2, 53.0047, 1.07361}, +{25552.9, 52.9651, 1.04346}, +{25966.2, 52.9238, 1.01414}, +{26386.1, 52.8805, 0.985625}, +{26812.9, 52.8350, 0.957896}, +{27246.6, 52.7870, 0.930929}, +{27687.3, 52.7358, 0.904706}, +{28135.1, 52.6812, 0.879202}, +{28590.2, 52.6223, 0.854402}, +{29052.6, 52.5584, 0.830283}, +{29522.5, 52.4904, 0.806827}, +{30000.0, 52.4028, 0.784016}, +{0, 0, 0} +}; + +e_fp_fdp cs[] = { /* Z = 55 */ +{10.0000, -9999.00, 0.429437E-01}, +{10.1617, -9999.00, 0.419900E-01}, +{10.3261, -9999.00, 0.410574E-01}, +{10.4931, -9999.00, 0.401456E-01}, +{10.6628, -9999.00, 0.392540E-01}, +{10.8353, -9999.00, 0.383822E-01}, +{11.0106, -9999.00, 0.418579E-01}, +{11.1886, -9999.00, 0.498688E-01}, +{11.3696, -9999.00, 0.629069E-01}, +{11.5535, -9999.00, 0.682259E-01}, +{11.7404, -9999.00, 0.698775E-01}, +{11.9303, -9999.00, 0.810036E-01}, +{12.1232, -9999.00, 0.106648}, +{12.3193, -9999.00, 0.151212}, +{12.5186, -9999.00, 0.230476}, +{12.7210, -9999.00, 0.366991}, +{12.9268, -9999.00, 0.528355}, +{13.1359, -9999.00, 0.818153}, +{13.3483, -9999.00, 1.02400}, +{13.5642, -9999.00, 1.26872}, +{13.7836, -9999.00, 1.55155}, +{14.0066, -9999.00, 1.87715}, +{14.2331, -9999.00, 2.37324}, +{14.4633, -9999.00, 2.92150}, +{14.6973, -9999.00, 3.66589}, +{14.9350, -9999.00, 4.75148}, +{15.1765, -9999.00, 6.96885}, +{15.4220, -9999.00, 8.91684}, +{15.6714, -9999.00, 10.5004}, +{15.9249, -9999.00, 11.2155}, +{16.1825, -9999.00, 11.9793}, +{16.4442, -9999.00, 12.6671}, +{16.7102, -9999.00, 13.3472}, +{16.9805, -9999.00, 13.9057}, +{17.2551, -9999.00, 14.0264}, +{17.5342, -9999.00, 14.1482}, +{17.8178, -9999.00, 14.2710}, +{18.1060, -9999.00, 14.3949}, +{18.3989, -9999.00, 14.5199}, +{18.6964, -9999.00, 14.3427}, +{18.9988, -9999.00, 14.1328}, +{19.3061, -9999.00, 13.9259}, +{19.6184, -9999.00, 13.7221}, +{19.9357, -9999.00, 13.4458}, +{20.2582, -9999.00, 13.1638}, +{20.5858, -9999.00, 12.8878}, +{20.9188, -9999.00, 12.6141}, +{21.2571, -9999.00, 12.2232}, +{21.6009, -9999.00, 11.8445}, +{21.9503, -9999.00, 11.4775}, +{22.3053, -9999.00, 11.0553}, +{22.6661, -9999.00, 10.6269}, +{23.0327, -9999.00, 10.2151}, +{23.4053, -9999.00, 9.81922}, +{23.7838, -9999.00, 9.44774}, +{24.1685, -9999.00, 9.11072}, +{24.5594, -9999.00, 8.78571}, +{24.9566, -9999.00, 8.47230}, +{25.3603, -9999.00, 8.06786}, +{25.7705, -9999.00, 7.56290}, +{26.1873, -9999.00, 7.08954}, +{26.6109, -9999.00, 6.74479}, +{27.0413, -9999.00, 6.45590}, +{27.4786, -9999.00, 6.17940}, +{27.9231, -9999.00, 5.91473}, +{28.3747, -9999.00, 5.65465}, +{28.8337, -9999.00, 5.39884}, +{29.3000, 12.6617, 5.15460}, +{29.7739, 12.6085, 4.92141}, +{30.2555, 12.5481, 4.70819}, +{30.7449, 12.4926, 4.50744}, +{31.2421, 12.4400, 4.31525}, +{31.7475, 12.3960, 4.13125}, +{32.2609, 12.3757, 3.95510}, +{32.7827, 12.3515, 3.69912}, +{33.3130, 12.2583, 3.44456}, +{33.8518, 12.1353, 3.23730}, +{34.3993, 12.0145, 3.04858}, +{34.9557, 11.8895, 2.87087}, +{35.5211, 11.7594, 2.70351}, +{36.0956, 11.6244, 2.54592}, +{36.6794, 11.4846, 2.39750}, +{37.2727, 11.3401, 2.25774}, +{37.8755, 11.1910, 2.12613}, +{38.4882, 11.0361, 2.00219}, +{39.1107, 10.8723, 1.88836}, +{39.7432, 10.7096, 1.79032}, +{40.3861, 10.5479, 1.69738}, +{41.0393, 10.3834, 1.60926}, +{41.7031, 10.2132, 1.52572}, +{42.3776, 10.0391, 1.45651}, +{43.0630, 9.86795, 1.39266}, +{43.7595, 9.69529, 1.33162}, +{44.4673, 9.51862, 1.27324}, +{45.1865, 9.33379, 1.21743}, +{45.9174, 9.14415, 1.17795}, +{46.6600, 8.95660, 1.14149}, +{47.4147, 8.76513, 1.10795}, +{48.1816, 8.57129, 1.07846}, +{48.9609, 8.37109, 1.04975}, +{49.7528, 8.16028, 1.03140}, +{50.5576, 7.95248, 1.02037}, +{51.3753, 7.74148, 1.00945}, +{52.2062, 7.52514, 1.00071}, +{53.0506, 7.30218, 0.992083}, +{53.9087, 7.06993, 0.983527}, +{54.7806, 6.82665, 0.977322}, +{55.6667, 6.57189, 0.971924}, +{56.5670, 6.29978, 0.966556}, +{57.4820, 6.00707, 0.975651}, +{58.4117, 5.70957, 0.992222}, +{59.3564, 5.40057, 1.00899}, +{60.3165, 5.07420, 1.02599}, +{61.2921, 4.72660, 1.04328}, +{62.2834, 4.35218, 1.06087}, +{63.2908, 3.94035, 1.08365}, +{64.3145, 3.50225, 1.12115}, +{65.3547, 3.03170, 1.15994}, +{66.4118, 2.51696, 1.20007}, +{67.4859, 1.94558, 1.24160}, +{68.5775, 1.29762, 1.28456}, +{69.6867, 0.533614, 1.34315}, +{70.8138, -0.357045, 1.42961}, +{71.9591, -1.49468, 1.53626}, +{73.1230, -3.24563, 1.89574}, +{74.3057, -4.95726, 4.03416}, +{75.5076, -3.71900, 5.53633}, +{76.7289, -4.13781, 5.32920}, +{77.9699, -5.36837, 5.60660}, +{79.2310, -6.80368, 6.49975}, +{80.5125, -8.07423, 7.81229}, +{81.8147, -9.23883, 9.38984}, +{83.1380, -10.2860, 11.2583}, +{84.4827, -11.2161, 13.4515}, +{85.8491, -11.8243, 16.0721}, +{87.2377, -11.7699, 18.7350}, +{88.6487, -11.6737, 21.3926}, +{90.0825, -11.2789, 24.4273}, +{91.5395, -9.91843, 27.8924}, +{93.0201, -7.98196, 29.9593}, +{94.5246, -6.31012, 31.9914}, +{96.0535, -4.61550, 34.1614}, +{97.6071, -2.47873, 36.4785}, +{99.1858, 0.546025, 38.1738}, +{100.790, 3.14912, 39.2258}, +{102.420, 5.57355, 40.3068}, +{104.077, 8.15483, 41.4176}, +{105.760, 11.2353, 42.5591}, +{107.471, 14.5234, 42.7886}, +{109.209, 17.5569, 42.8428}, +{110.975, 20.7369, 42.8970}, +{112.770, 24.2991, 42.4777}, +{114.594, 28.2226, 41.8125}, +{116.448, 31.7939, 39.1374}, +{118.331, 34.2941, 36.4271}, +{120.245, 36.1991, 33.8804}, +{122.190, 37.7155, 31.3247}, +{124.166, 39.0530, 28.9619}, +{126.175, 40.3599, 26.2516}, +{128.215, 40.9448, 23.4092}, +{130.289, 41.1769, 20.7702}, +{132.397, 41.0458, 18.3249}, +{134.538, 40.7658, 16.1611}, +{136.714, 40.2659, 14.0101}, +{138.925, 39.5810, 12.1454}, +{141.172, 38.7677, 10.4602}, +{143.456, 37.8558, 8.99985}, +{145.776, 36.8901, 7.74341}, +{148.134, 35.9047, 6.67657}, +{150.530, 34.8971, 5.75697}, +{152.964, 33.8709, 5.06500}, +{155.439, 32.9803, 4.53271}, +{157.953, 32.1580, 4.05932}, +{160.507, 31.3883, 3.64909}, +{163.103, 30.6523, 3.28031}, +{165.742, 29.9134, 2.94880}, +{168.422, 29.2027, 2.72906}, +{171.146, 28.5437, 2.54023}, +{173.915, 27.8820, 2.41181}, +{176.727, 27.3045, 2.35284}, +{179.586, 26.7726, 2.29531}, +{182.491, 26.2275, 2.24818}, +{185.442, 25.7256, 2.28677}, +{188.442, 25.2774, 2.34777}, +{191.489, 24.8794, 2.42120}, +{194.587, 24.5306, 2.49692}, +{197.734, 24.1959, 2.53716}, +{200.932, 23.8552, 2.61356}, +{204.182, 23.5401, 2.69082}, +{207.485, 23.2313, 2.77954}, +{210.840, 22.9354, 2.88360}, +{214.251, 22.6597, 3.01518}, +{217.716, 22.4061, 3.15657}, +{221.237, 22.1754, 3.30736}, +{224.816, 21.9646, 3.46563}, +{228.452, 21.7737, 3.63057}, +{232.147, 21.6024, 3.80168}, +{235.902, 21.4490, 3.97494}, +{239.717, 21.3154, 4.15147}, +{243.595, 21.1979, 4.32988}, +{247.535, 21.0960, 4.50746}, +{251.538, 21.0146, 4.68555}, +{255.607, 20.9457, 4.86103}, +{259.741, 20.8884, 5.03213}, +{263.942, 20.8454, 5.20297}, +{268.211, 20.8168, 5.37346}, +{272.549, 20.7998, 5.53261}, +{276.957, 20.7908, 5.68956}, +{281.437, 20.7940, 5.84707}, +{285.989, 20.8066, 5.99112}, +{290.615, 20.8281, 6.13181}, +{295.315, 20.8548, 6.26754}, +{300.092, 20.8875, 6.39575}, +{304.945, 20.9301, 6.51839}, +{309.878, 20.9742, 6.63359}, +{314.890, 21.0221, 6.74434}, +{319.983, 21.0784, 6.84843}, +{325.158, 21.1334, 6.94355}, +{330.418, 21.1893, 7.03462}, +{335.762, 21.2543, 7.12044}, +{341.192, 21.3166, 7.19610}, +{346.711, 21.3765, 7.26781}, +{352.319, 21.4426, 7.33591}, +{358.017, 21.5057, 7.39315}, +{363.808, 21.5653, 7.44458}, +{369.692, 21.6252, 7.49296}, +{375.672, 21.6830, 7.53641}, +{381.748, 21.7376, 7.57213}, +{387.922, 21.7882, 7.60520}, +{394.197, 21.8396, 7.63714}, +{400.573, 21.8890, 7.65692}, +{407.052, 21.9288, 7.67186}, +{413.635, 21.9642, 7.68692}, +{420.326, 21.9958, 7.69656}, +{427.124, 22.0239, 7.70399}, +{434.032, 22.0461, 7.70723}, +{441.052, 22.0645, 7.71053}, +{448.186, 22.1160, 7.70170}, +{455.435, 22.1252, 7.63186}, +{462.802, 22.0850, 7.58868}, +{470.287, 22.0383, 7.55972}, +{477.894, 21.9869, 7.53078}, +{485.623, 21.9243, 7.50204}, +{493.478, 21.8500, 7.47342}, +{501.459, 21.7633, 7.44489}, +{509.570, 21.6639, 7.41643}, +{517.812, 21.5531, 7.38681}, +{526.187, 21.4280, 7.35286}, +{534.698, 21.2839, 7.31054}, +{543.346, 21.1132, 7.26427}, +{552.134, 20.9172, 7.21831}, +{561.065, 20.6937, 7.16823}, +{570.139, 20.4376, 7.11603}, +{579.361, 20.1426, 7.06148}, +{588.732, 19.8048, 7.00682}, +{598.254, 19.4177, 6.95222}, +{607.930, 18.9737, 6.89799}, +{617.763, 18.4626, 6.84424}, +{627.755, 17.8722, 6.79051}, +{637.908, 17.1818, 6.73162}, +{648.226, 16.3598, 6.66508}, +{658.711, 15.3572, 6.59388}, +{669.365, 14.1097, 6.52347}, +{680.191, 12.5113, 6.46370}, +{691.193, 10.3716, 6.41210}, +{702.372, 7.25142, 6.36288}, +{713.733, 1.78667, 6.30731}, +{725.277, -19.3132, 6.24759}, +{726.500, -44.1428, 6.24135}, +{726.700, -44.1051, 36.6267}, +{737.008, 1.69243, 35.8734}, +{748.928, 9.66949, 35.0340}, +{761.042, 14.2840, 34.2143}, +{773.351, 17.5447, 33.4138}, +{785.859, 20.0496, 32.6319}, +{798.570, 22.0606, 31.8685}, +{811.486, 23.6900, 31.1228}, +{824.611, 25.0563, 30.4500}, +{837.949, 26.2365, 29.8010}, +{851.502, 27.2476, 29.1659}, +{865.274, 28.1037, 28.5443}, +{879.269, 28.8116, 27.9360}, +{893.491, 29.3411, 27.3406}, +{907.943, 29.6849, 26.8236}, +{922.628, 29.8885, 26.3937}, +{937.551, 29.6445, 25.9706}, +{952.715, 29.5170, 26.5817}, +{968.124, 29.7900, 27.2755}, +{983.783, 30.3994, 27.9873}, +{999.695, 31.2384, 28.7178}, +{1015.86, 32.9409, 29.4672}, +{1032.29, 34.5490, 28.9334}, +{1048.99, 35.5854, 28.3585}, +{1065.96, 36.3974, 27.7951}, +{1083.20, 36.9666, 27.3143}, +{1100.72, 37.5261, 27.0159}, +{1118.52, 38.1425, 26.7207}, +{1136.61, 38.7507, 26.4288}, +{1155.00, 39.4146, 26.1401}, +{1173.68, 40.0574, 25.7310}, +{1192.66, 40.6102, 25.2960}, +{1211.95, 41.1080, 24.8684}, +{1231.55, 41.5644, 24.4481}, +{1251.47, 41.9852, 24.0348}, +{1271.72, 42.3545, 23.6285}, +{1292.29, 42.6929, 23.2687}, +{1313.19, 43.0382, 22.9399}, +{1334.43, 43.3837, 22.6158}, +{1356.01, 43.7236, 22.2962}, +{1377.94, 44.0570, 21.9812}, +{1400.23, 44.3847, 21.6706}, +{1422.88, 44.7091, 21.3644}, +{1445.89, 45.0289, 21.0550}, +{1469.28, 45.3407, 20.7468}, +{1493.04, 45.6459, 20.4431}, +{1517.19, 45.9493, 20.1439}, +{1541.73, 46.2556, 19.8490}, +{1566.67, 46.5774, 19.5585}, +{1592.01, 46.9337, 19.2238}, +{1617.76, 47.2497, 18.8266}, +{1643.92, 47.5078, 18.4385}, +{1670.51, 47.7435, 18.0585}, +{1697.53, 47.9613, 17.6864}, +{1724.99, 48.1674, 17.3218}, +{1752.89, 48.3598, 16.9544}, +{1781.24, 48.5359, 16.5912}, +{1810.05, 48.6952, 16.2329}, +{1839.32, 48.8406, 15.8826}, +{1869.07, 48.9744, 15.5398}, +{1899.30, 49.0977, 15.2042}, +{1930.02, 49.2112, 14.8759}, +{1961.24, 49.3162, 14.5548}, +{1992.96, 49.4112, 14.2410}, +{2025.20, 49.5045, 13.9396}, +{2057.95, 49.5930, 13.6336}, +{2091.24, 49.6719, 13.3331}, +{2125.06, 49.7422, 13.0379}, +{2159.43, 49.8052, 12.7488}, +{2194.36, 49.8617, 12.4651}, +{2229.85, 49.9117, 12.1869}, +{2265.92, 49.9558, 11.9145}, +{2302.57, 49.9941, 11.6470}, +{2339.81, 50.0264, 11.3850}, +{2377.66, 50.0538, 11.1288}, +{2416.11, 50.0761, 10.8770}, +{2455.19, 50.0934, 10.6306}, +{2494.90, 50.1056, 10.3889}, +{2535.26, 50.1132, 10.1526}, +{2576.26, 50.1164, 9.92095}, +{2617.93, 50.1154, 9.69413}, +{2660.27, 50.1097, 9.47150}, +{2703.30, 50.0996, 9.25397}, +{2747.03, 50.0856, 9.04112}, +{2791.46, 50.0676, 8.83255}, +{2836.61, 50.0454, 8.62823}, +{2882.49, 50.0192, 8.42832}, +{2929.11, 49.9889, 8.23261}, +{2976.48, 49.9546, 8.04107}, +{3024.63, 49.9162, 7.85355}, +{3073.55, 49.8737, 7.67011}, +{3123.26, 49.8270, 7.49050}, +{3173.78, 49.7761, 7.31476}, +{3225.11, 49.7208, 7.14282}, +{3277.27, 49.6610, 6.97451}, +{3330.28, 49.5964, 6.80979}, +{3384.15, 49.5269, 6.64868}, +{3438.88, 49.4522, 6.49101}, +{3494.50, 49.3720, 6.33676}, +{3551.02, 49.2860, 6.18586}, +{3608.46, 49.1937, 6.03824}, +{3666.82, 49.0946, 5.89376}, +{3726.13, 48.9882, 5.75255}, +{3786.40, 48.8738, 5.61427}, +{3847.64, 48.7504, 5.47904}, +{3909.87, 48.6171, 5.34672}, +{3973.11, 48.4726, 5.21726}, +{4037.38, 48.3154, 5.09063}, +{4102.68, 48.1436, 4.96680}, +{4169.03, 47.9550, 4.84569}, +{4236.46, 47.7465, 4.72718}, +{4304.98, 47.5142, 4.61127}, +{4374.62, 47.2531, 4.49790}, +{4445.37, 46.9559, 4.38689}, +{4517.27, 46.6127, 4.27843}, +{4590.33, 46.2084, 4.17237}, +{4664.58, 45.7191, 4.06846}, +{4740.03, 45.1028, 3.96690}, +{4816.69, 44.2754, 3.86754}, +{4894.60, 43.0196, 3.77031}, +{4973.77, 40.3216, 3.67525}, +{5011.80, 26.1858, 3.63096}, +{5012.00, 26.1877, 11.1294}, +{5054.21, 40.5758, 10.9592}, +{5135.96, 42.9330, 10.6406}, +{5219.03, 43.7015, 10.3315}, +{5303.44, 43.5450, 10.0313}, +{5359.30, 36.6044, 9.84000}, +{5359.50, 36.6083, 13.5720}, +{5389.22, 43.3943, 13.4535}, +{5476.39, 45.4612, 13.1154}, +{5564.97, 46.3919, 12.7860}, +{5654.98, 46.8301, 12.4647}, +{5714.20, 44.0976, 12.2605}, +{5714.40, 44.1015, 13.9099}, +{5746.44, 47.1490, 13.7992}, +{5839.39, 48.4385, 13.4862}, +{5933.83, 49.2361, 13.1777}, +{6029.81, 49.8667, 12.8739}, +{6127.33, 50.3980, 12.5747}, +{6226.44, 50.8590, 12.2802}, +{6327.15, 51.2660, 11.9907}, +{6429.48, 51.6294, 11.7061}, +{6533.48, 51.9564, 11.4262}, +{6639.15, 52.2522, 11.1512}, +{6746.54, 52.5209, 10.8813}, +{6855.65, 52.7660, 10.6164}, +{6966.54, 52.9899, 10.3565}, +{7079.22, 53.1950, 10.1016}, +{7193.72, 53.3829, 9.85157}, +{7310.07, 53.5554, 9.60657}, +{7428.31, 53.7138, 9.36658}, +{7548.45, 53.8593, 9.13130}, +{7670.54, 53.9928, 8.90105}, +{7794.61, 54.1155, 8.67569}, +{7920.68, 54.2281, 8.45495}, +{8048.79, 54.3313, 8.23890}, +{8178.98, 54.4257, 8.02767}, +{8311.26, 54.5122, 7.82114}, +{8445.69, 54.5912, 7.61911}, +{8582.29, 54.6632, 7.42144}, +{8721.11, 54.7285, 7.22849}, +{8862.16, 54.7878, 7.03987}, +{9005.50, 54.8415, 6.85567}, +{9151.16, 54.8899, 6.67543}, +{9299.17, 54.9330, 6.49972}, +{9449.58, 54.9717, 6.32808}, +{9602.42, 55.0059, 6.16049}, +{9757.73, 55.0361, 5.99698}, +{9915.55, 55.0625, 5.83732}, +{10075.9, 55.0853, 5.68151}, +{10238.9, 55.1046, 5.52950}, +{10404.5, 55.1208, 5.38122}, +{10572.8, 55.1340, 5.23658}, +{10743.8, 55.1445, 5.09553}, +{10917.6, 55.1524, 4.95799}, +{11094.2, 55.1578, 4.82390}, +{11273.6, 55.1609, 4.69317}, +{11455.9, 55.1619, 4.56575}, +{11641.2, 55.1608, 4.44157}, +{11829.5, 55.1579, 4.32055}, +{12020.8, 55.1533, 4.20263}, +{12215.3, 55.1469, 4.08774}, +{12412.8, 55.1391, 3.97582}, +{12613.6, 55.1298, 3.86680}, +{12817.6, 55.1192, 3.76061}, +{13025.0, 55.1073, 3.65720}, +{13235.6, 55.0942, 3.55649}, +{13449.7, 55.0801, 3.45843}, +{13667.2, 55.0649, 3.36296}, +{13888.3, 55.0487, 3.27001}, +{14112.9, 55.0317, 3.17953}, +{14341.2, 55.0139, 3.09145}, +{14573.1, 54.9952, 3.00572}, +{14808.9, 54.9759, 2.92229}, +{15048.4, 54.9559, 2.84110}, +{15291.8, 54.9352, 2.76209}, +{15539.1, 54.9140, 2.68521}, +{15790.4, 54.8922, 2.61040}, +{16045.8, 54.8699, 2.53763}, +{16305.4, 54.8472, 2.46683}, +{16569.1, 54.8239, 2.39795}, +{16837.1, 54.8003, 2.33095}, +{17109.4, 54.7762, 2.26579}, +{17386.1, 54.7518, 2.20241}, +{17667.4, 54.7270, 2.14076}, +{17953.1, 54.7018, 2.08081}, +{18243.5, 54.6763, 2.02251}, +{18538.6, 54.6505, 1.96581}, +{18838.4, 54.6244, 1.91068}, +{19143.1, 54.5979, 1.85708}, +{19452.7, 54.5711, 1.80496}, +{19767.4, 54.5440, 1.75429}, +{20087.1, 54.5166, 1.70502}, +{20412.0, 54.4888, 1.65713}, +{20742.1, 54.4607, 1.61057}, +{21077.6, 54.4322, 1.56530}, +{21418.5, 54.4033, 1.52131}, +{21765.0, 54.3740, 1.47854}, +{22117.0, 54.3443, 1.43697}, +{22474.7, 54.3141, 1.39656}, +{22838.2, 54.2834, 1.35729}, +{23207.6, 54.2520, 1.31912}, +{23583.0, 54.2201, 1.28202}, +{23964.4, 54.1875, 1.24596}, +{24352.0, 54.1541, 1.21092}, +{24745.9, 54.1198, 1.17687}, +{25146.2, 54.0846, 1.14378}, +{25552.9, 54.0483, 1.11162}, +{25966.2, 54.0108, 1.08038}, +{26386.1, 53.9719, 1.05001}, +{26812.9, 53.9314, 1.02050}, +{27246.6, 53.8892, 0.991829}, +{27687.3, 53.8449, 0.963968}, +{28135.1, 53.7983, 0.936897}, +{28590.2, 53.7489, 0.910593}, +{29052.6, 53.6962, 0.885035}, +{29522.5, 53.6397, 0.860201}, +{30000.0, 53.5787, 0.836073}, +{0, 0, 0} +}; + +e_fp_fdp ba[] = { /* Z = 56 */ +{10.0000, -9999.00, 0.102582}, +{10.1617, -9999.00, 0.107605}, +{10.3261, -9999.00, 0.112874}, +{10.4931, -9999.00, 0.118401}, +{10.6628, -9999.00, 0.124198}, +{10.8353, -9999.00, 0.130280}, +{11.0106, -9999.00, 0.136659}, +{11.1886, -9999.00, 0.143350}, +{11.3696, -9999.00, 0.150369}, +{11.5535, -9999.00, 0.157732}, +{11.7404, -9999.00, 0.165455}, +{11.9303, -9999.00, 0.173557}, +{12.1232, -9999.00, 0.183338}, +{12.3193, -9999.00, 0.194288}, +{12.5186, -9999.00, 0.205891}, +{12.7210, -9999.00, 0.218187}, +{12.9268, -9999.00, 0.231218}, +{13.1359, -9999.00, 0.247615}, +{13.3483, -9999.00, 0.265218}, +{13.5642, -9999.00, 0.284072}, +{13.7836, -9999.00, 0.304267}, +{14.0066, -9999.00, 0.362677}, +{14.2331, -9999.00, 0.420004}, +{14.4633, -9999.00, 0.474092}, +{14.6973, -9999.00, 0.533738}, +{14.9350, -9999.00, 0.599553}, +{15.1765, -9999.00, 0.666927}, +{15.4220, -9999.00, 0.730960}, +{15.6714, -9999.00, 0.693144}, +{15.9249, -9999.00, 0.654676}, +{16.1825, -9999.00, 0.627532}, +{16.4442, -9999.00, 0.743404}, +{16.7102, -9999.00, 1.51055}, +{16.9805, -9999.00, 2.31632}, +{17.2551, -9999.00, 5.82720}, +{17.5342, -9999.00, 9.18758}, +{17.8178, -9999.00, 11.0651}, +{18.1060, -9999.00, 12.1706}, +{18.3989, -9999.00, 13.3866}, +{18.6964, -9999.00, 16.2715}, +{18.9988, -9999.00, 20.8311}, +{19.3061, -9999.00, 25.5391}, +{19.6184, -9999.00, 26.1763}, +{19.9357, -9999.00, 26.8294}, +{20.2582, -9999.00, 26.9725}, +{20.5858, -9999.00, 26.6972}, +{20.9188, -9999.00, 26.1269}, +{21.2571, -9999.00, 24.8556}, +{21.6009, -9999.00, 23.6461}, +{21.9503, -9999.00, 22.4955}, +{22.3053, -9999.00, 21.4008}, +{22.6661, -9999.00, 20.3594}, +{23.0327, -9999.00, 19.3687}, +{23.4053, -9999.00, 18.4262}, +{23.7838, -9999.00, 17.5296}, +{24.1685, -9999.00, 16.6625}, +{24.5594, -9999.00, 15.8365}, +{24.9566, -9999.00, 15.0515}, +{25.3603, -9999.00, 14.3054}, +{25.7705, -9999.00, 13.5963}, +{26.1873, -9999.00, 12.9224}, +{26.6109, -9999.00, 12.2818}, +{27.0413, -9999.00, 11.6730}, +{27.4786, -9999.00, 11.0944}, +{27.9231, -9999.00, 10.5444}, +{28.3747, -9999.00, 10.0018}, +{28.8337, -9999.00, 9.47953}, +{29.3000, 16.4471, 8.98449}, +{29.7739, 16.4118, 8.51529}, +{30.2555, 16.3610, 8.07059}, +{30.7449, 16.2972, 7.64914}, +{31.2421, 16.2223, 7.24967}, +{31.7475, 16.1385, 6.87108}, +{32.2609, 16.0473, 6.51225}, +{32.7827, 15.9507, 6.17216}, +{33.3130, 15.8511, 5.84984}, +{33.8518, 15.7525, 5.54435}, +{34.3993, 15.6642, 5.25481}, +{34.9557, 15.5952, 4.93304}, +{35.5211, 15.4733, 4.60153}, +{36.0956, 15.3260, 4.29229}, +{36.6794, 15.1632, 4.00384}, +{37.2727, 14.9892, 3.73477}, +{37.8755, 14.8063, 3.48379}, +{38.4882, 14.6162, 3.24967}, +{39.1107, 14.4192, 3.03129}, +{39.7432, 14.2124, 2.82758}, +{40.3861, 13.9867, 2.65078}, +{41.0393, 13.7788, 2.50671}, +{41.7031, 13.5820, 2.37048}, +{42.3776, 13.3893, 2.24165}, +{43.0630, 13.1988, 2.11982}, +{43.7595, 13.0094, 2.00461}, +{44.4673, 12.8201, 1.89566}, +{45.1865, 12.6304, 1.79264}, +{45.9174, 12.4395, 1.69521}, +{46.6600, 12.2468, 1.60308}, +{47.4147, 12.0515, 1.51596}, +{48.1816, 11.8526, 1.43357}, +{48.9609, 11.6481, 1.35565}, +{49.7528, 11.4328, 1.28517}, +{50.5576, 11.2181, 1.23309}, +{51.3753, 11.0025, 1.18311}, +{52.2062, 10.7750, 1.13822}, +{53.0506, 10.5511, 1.11996}, +{53.9087, 10.3328, 1.10248}, +{54.7806, 10.1173, 1.09259}, +{55.6667, 9.90343, 1.08279}, +{56.5670, 9.68751, 1.07307}, +{57.4820, 9.46682, 1.06344}, +{58.4117, 9.23752, 1.05467}, +{59.3564, 9.00202, 1.05299}, +{60.3165, 8.75803, 1.05131}, +{61.2921, 8.49452, 1.05807}, +{62.2834, 8.23364, 1.08111}, +{63.2908, 7.97118, 1.10465}, +{64.3145, 7.70083, 1.12871}, +{65.3547, 7.41884, 1.15329}, +{66.4118, 7.11976, 1.18423}, +{67.4859, 6.81304, 1.22252}, +{68.5775, 6.49324, 1.26205}, +{69.6867, 6.15469, 1.30286}, +{70.8138, 5.79502, 1.35385}, +{71.9591, 5.41993, 1.41089}, +{73.1230, 5.02291, 1.47033}, +{74.3057, 4.59965, 1.53540}, +{75.5076, 4.14695, 1.60409}, +{76.7289, 3.65522, 1.67585}, +{77.9699, 3.12021, 1.76771}, +{79.2310, 2.55199, 1.87205}, +{80.5125, 1.94112, 1.98004}, +{81.8147, 1.26884, 2.08822}, +{83.1380, 0.523413, 2.20232}, +{84.4827, -0.303533, 2.32265}, +{85.8491, -1.25651, 2.40436}, +{87.2377, -2.42703, 2.47714}, +{88.6487, -3.91150, 2.62019}, +{90.0825, -6.30092, 2.67983}, +{91.5395, -8.68491, 4.95387}, +{93.0201, -7.44126, 9.15779}, +{94.5246, -7.78417, 3.46252}, +{96.0535, -12.8572, 4.27233}, +{97.6071, -18.3425, 5.81709}, +{99.1858, -25.3014, 9.46539}, +{100.790, -32.3295, 17.3378}, +{102.420, -36.7988, 35.0848}, +{104.077, -31.1338, 48.0307}, +{105.760, -16.7618, 57.2602}, +{107.471, -4.90253, 58.1327}, +{109.209, 2.58636, 56.7582}, +{110.975, 7.60516, 54.9013}, +{112.770, 11.1029, 54.0482}, +{114.594, 14.0726, 56.8675}, +{116.448, 24.3891, 59.2316}, +{118.331, 33.0949, 54.9399}, +{120.245, 38.4962, 49.1254}, +{122.190, 41.6121, 43.2060}, +{124.166, 43.2132, 38.2524}, +{126.175, 44.2136, 33.9584}, +{128.215, 44.9841, 30.1464}, +{130.289, 45.2608, 26.1964}, +{132.397, 44.9648, 22.7133}, +{134.538, 44.2934, 19.5972}, +{136.714, 43.2137, 16.9951}, +{138.925, 42.2342, 15.0150}, +{141.172, 41.5073, 13.1863}, +{143.456, 40.6208, 11.3566}, +{145.776, 39.6145, 9.78092}, +{148.134, 38.5811, 8.39900}, +{150.530, 37.5278, 7.20139}, +{152.964, 36.4787, 6.17454}, +{155.439, 35.4563, 5.29133}, +{157.953, 34.4445, 4.52320}, +{160.507, 33.4428, 3.88064}, +{163.103, 32.4402, 3.32555}, +{165.742, 31.5095, 3.00542}, +{168.422, 30.6674, 2.71610}, +{171.146, 29.8982, 2.48691}, +{173.915, 29.1737, 2.27878}, +{176.727, 28.4485, 2.11933}, +{179.586, 27.7783, 2.01565}, +{182.491, 27.1356, 1.95126}, +{185.442, 26.5163, 1.93172}, +{188.442, 25.9294, 1.95618}, +{191.489, 25.4055, 2.05346}, +{194.587, 24.9470, 2.15559}, +{197.734, 24.5310, 2.25890}, +{200.932, 24.1441, 2.36442}, +{204.182, 23.7817, 2.47486}, +{207.485, 23.4388, 2.59047}, +{210.840, 23.1069, 2.71217}, +{214.251, 22.7953, 2.86120}, +{217.716, 22.5081, 3.01842}, +{221.237, 22.2424, 3.18428}, +{224.816, 21.9976, 3.35926}, +{228.452, 21.7713, 3.53807}, +{232.147, 21.5604, 3.72516}, +{235.902, 21.3654, 3.92214}, +{239.717, 21.1886, 4.12954}, +{243.595, 21.0323, 4.34790}, +{247.535, 20.9066, 4.57454}, +{251.538, 20.7944, 4.78890}, +{255.607, 20.6951, 5.01330}, +{259.741, 20.6137, 5.24822}, +{263.942, 20.5574, 5.49414}, +{268.211, 20.5506, 5.75159}, +{272.549, 20.5807, 5.95964}, +{276.957, 20.5977, 6.14489}, +{281.437, 20.6217, 6.33590}, +{285.989, 20.6661, 6.50912}, +{290.615, 20.7040, 6.66816}, +{295.315, 20.7385, 6.83109}, +{300.092, 20.7802, 6.99799}, +{304.945, 20.8328, 7.16898}, +{309.878, 20.9009, 7.34414}, +{314.890, 21.0096, 7.52358}, +{319.983, 21.1348, 7.64774}, +{325.158, 21.2399, 7.75537}, +{330.418, 21.3401, 7.86453}, +{335.762, 21.4441, 7.97523}, +{341.192, 21.5579, 8.08748}, +{346.711, 21.7159, 8.20132}, +{352.319, 21.8753, 8.23661}, +{358.017, 21.9984, 8.25766}, +{363.808, 22.1041, 8.27877}, +{369.692, 22.2001, 8.29992}, +{375.672, 22.2901, 8.32114}, +{381.748, 22.3825, 8.33827}, +{387.922, 22.4646, 8.34540}, +{394.197, 22.5363, 8.35254}, +{400.573, 22.6023, 8.35969}, +{407.052, 22.6634, 8.36685}, +{413.635, 22.7205, 8.37400}, +{420.326, 22.7743, 8.38117}, +{427.124, 22.8257, 8.38835}, +{434.032, 22.8802, 8.39552}, +{441.052, 22.9354, 8.39010}, +{448.186, 22.9773, 8.37524}, +{455.435, 23.0091, 8.36041}, +{462.802, 23.0333, 8.34559}, +{470.287, 23.0508, 8.33081}, +{477.894, 23.0620, 8.31606}, +{485.623, 23.0674, 8.30132}, +{493.478, 23.0676, 8.28662}, +{501.459, 23.0634, 8.27194}, +{509.570, 23.0562, 8.25728}, +{517.812, 23.0473, 8.24266}, +{526.187, 23.0779, 8.21598}, +{534.698, 23.0726, 8.12164}, +{543.346, 23.0178, 8.02838}, +{552.134, 22.9356, 7.93619}, +{561.065, 22.8277, 7.84506}, +{570.139, 22.6941, 7.75498}, +{579.361, 22.5340, 7.66593}, +{588.732, 22.3455, 7.57790}, +{598.254, 22.1161, 7.49307}, +{607.930, 21.8618, 7.42815}, +{617.763, 21.5839, 7.36380}, +{627.755, 21.2722, 7.30001}, +{637.908, 20.9212, 7.23676}, +{648.226, 20.5237, 7.17406}, +{658.711, 20.0871, 7.10649}, +{669.365, 19.5704, 7.01580}, +{680.191, 18.9535, 6.92626}, +{691.193, 18.2240, 6.83786}, +{702.372, 17.3616, 6.74705}, +{713.733, 16.3003, 6.64215}, +{725.277, 14.9607, 6.53888}, +{737.008, 13.2144, 6.43722}, +{748.928, 10.7898, 6.33714}, +{761.042, 6.99366, 6.23862}, +{773.351, -1.23942, 6.14162}, +{780.100, -36.0464, 6.08973}, +{780.300, -36.0387, 32.0919}, +{785.859, -2.48177, 32.0024}, +{798.570, 7.54594, 31.8010}, +{811.486, 12.2086, 31.6009}, +{824.611, 15.3487, 31.4021}, +{837.949, 17.7528, 31.2046}, +{851.502, 19.7210, 31.0083}, +{865.274, 21.4009, 30.8132}, +{879.269, 22.8765, 30.6193}, +{893.491, 24.2016, 30.4267}, +{907.943, 25.4196, 30.2353}, +{922.628, 26.5386, 30.0149}, +{937.551, 27.5674, 29.7930}, +{952.715, 28.5218, 29.5728}, +{968.124, 29.4164, 29.3541}, +{983.783, 30.2603, 29.1371}, +{999.695, 31.0607, 28.9217}, +{1015.86, 31.8235, 28.7079}, +{1032.29, 32.5537, 28.4957}, +{1048.99, 33.2555, 28.2850}, +{1065.96, 33.9328, 28.0759}, +{1083.20, 34.5928, 27.8683}, +{1100.72, 35.2364, 27.6539}, +{1118.52, 35.8555, 27.4321}, +{1136.61, 36.4535, 27.2122}, +{1155.00, 37.0349, 26.9940}, +{1173.68, 37.6023, 26.7776}, +{1192.66, 38.1582, 26.5629}, +{1211.95, 38.7048, 26.3499}, +{1231.55, 39.2445, 26.1386}, +{1251.47, 39.7803, 25.9291}, +{1271.72, 40.3155, 25.7211}, +{1292.29, 40.8552, 25.5149}, +{1313.19, 41.4079, 25.3103}, +{1334.43, 41.9972, 25.1074}, +{1356.01, 42.6608, 24.8140}, +{1377.94, 43.2544, 24.3966}, +{1400.23, 43.7468, 23.9862}, +{1422.88, 44.2015, 23.5827}, +{1445.89, 44.6256, 23.1860}, +{1469.28, 45.0252, 22.7960}, +{1493.04, 45.4048, 22.4125}, +{1517.19, 45.7683, 22.0355}, +{1541.73, 46.1205, 21.6648}, +{1566.67, 46.4742, 21.3003}, +{1592.01, 46.8200, 20.9032}, +{1617.76, 47.1331, 20.4947}, +{1643.92, 47.4136, 20.0941}, +{1670.51, 47.6743, 19.7014}, +{1697.53, 47.9178, 19.3164}, +{1724.99, 48.1461, 18.9389}, +{1752.89, 48.3609, 18.5687}, +{1781.24, 48.5636, 18.2059}, +{1810.05, 48.7554, 17.8500}, +{1839.32, 48.9372, 17.5012}, +{1869.07, 49.1149, 17.1580}, +{1899.30, 49.2814, 16.8133}, +{1930.02, 49.4340, 16.4754}, +{1961.24, 49.5778, 16.1444}, +{1992.96, 49.7102, 15.8199}, +{2025.20, 49.8429, 15.5102}, +{2057.95, 49.9708, 15.1902}, +{2091.24, 50.0873, 14.8756}, +{2125.06, 50.1945, 14.5658}, +{2159.43, 50.2937, 14.2614}, +{2194.36, 50.3858, 13.9618}, +{2229.85, 50.4707, 13.6668}, +{2265.92, 50.5487, 13.3770}, +{2302.57, 50.6202, 13.0919}, +{2339.81, 50.6853, 12.8117}, +{2377.66, 50.7445, 12.5365}, +{2416.11, 50.7978, 12.2656}, +{2455.19, 50.8451, 11.9996}, +{2494.90, 50.8876, 11.7387}, +{2535.26, 50.9246, 11.4817}, +{2576.26, 50.9561, 11.2295}, +{2617.93, 50.9825, 10.9817}, +{2660.27, 51.0045, 10.7388}, +{2703.30, 51.0214, 10.4995}, +{2747.03, 51.0334, 10.2650}, +{2791.46, 51.0407, 10.0347}, +{2836.61, 51.0441, 9.80897}, +{2882.49, 51.0426, 9.58613}, +{2929.11, 51.0363, 9.36838}, +{2976.48, 51.0258, 9.15433}, +{3024.63, 51.0109, 8.94429}, +{3073.55, 50.9914, 8.73803}, +{3123.26, 50.9675, 8.53562}, +{3173.78, 50.9390, 8.33696}, +{3225.11, 50.9060, 8.14208}, +{3277.27, 50.8684, 7.95075}, +{3330.28, 50.8259, 7.76298}, +{3384.15, 50.7786, 7.57878}, +{3438.88, 50.7262, 7.39806}, +{3494.50, 50.6686, 7.22064}, +{3551.02, 50.6055, 7.04664}, +{3608.46, 50.5367, 6.87590}, +{3666.82, 50.4618, 6.70833}, +{3726.13, 50.3805, 6.54405}, +{3786.40, 50.2923, 6.38282}, +{3847.64, 50.1967, 6.22461}, +{3909.87, 50.0930, 6.06941}, +{3973.11, 49.9805, 5.91715}, +{4037.38, 49.8584, 5.76780}, +{4102.68, 49.7255, 5.62134}, +{4169.03, 49.5806, 5.47759}, +{4236.46, 49.4221, 5.33659}, +{4304.98, 49.2480, 5.19832}, +{4374.62, 49.0559, 5.06265}, +{4445.37, 48.8425, 4.92952}, +{4517.27, 48.6038, 4.79903}, +{4590.33, 48.3344, 4.67103}, +{4664.58, 48.0266, 4.54529}, +{4740.03, 47.6696, 4.42211}, +{4816.69, 47.2473, 4.30125}, +{4894.60, 46.7334, 4.18269}, +{4973.77, 46.0814, 4.06638}, +{5054.21, 45.1951, 3.95224}, +{5135.96, 43.8132, 3.84030}, +{5219.03, 40.4393, 3.73058}, +{5246.90, 26.8164, 3.69486}, +{5247.10, 26.8174, 11.3018}, +{5303.44, 42.1310, 11.0891}, +{5389.22, 44.1362, 10.7771}, +{5476.39, 44.8272, 10.4740}, +{5564.97, 44.6340, 10.1793}, +{5623.50, 37.6496, 9.99166}, +{5623.70, 37.6535, 13.7185}, +{5654.98, 44.4926, 13.5917}, +{5746.44, 46.5402, 13.2315}, +{5839.39, 47.4390, 12.8809}, +{5933.83, 47.7822, 12.5394}, +{5988.70, 44.8521, 12.3476}, +{5988.90, 44.8558, 14.0776}, +{6029.81, 48.2474, 13.9432}, +{6127.33, 49.4817, 13.6314}, +{6226.44, 50.2716, 13.3239}, +{6327.15, 50.8992, 13.0205}, +{6429.48, 51.4293, 12.7216}, +{6533.48, 51.8900, 12.4269}, +{6639.15, 52.2971, 12.1367}, +{6746.54, 52.6609, 11.8513}, +{6855.65, 52.9885, 11.5704}, +{6966.54, 53.2853, 11.2943}, +{7079.22, 53.5550, 11.0228}, +{7193.72, 53.8011, 10.7562}, +{7310.07, 54.0262, 10.4945}, +{7428.31, 54.2325, 10.2375}, +{7548.45, 54.4216, 9.98525}, +{7670.54, 54.5951, 9.73791}, +{7794.61, 54.7545, 9.49546}, +{7920.68, 54.9009, 9.25799}, +{8048.79, 55.0356, 9.02501}, +{8178.98, 55.1592, 8.79689}, +{8311.26, 55.2725, 8.57343}, +{8445.69, 55.3764, 8.35485}, +{8582.29, 55.4717, 8.14094}, +{8721.11, 55.5589, 7.93140}, +{8862.16, 55.6383, 7.72653}, +{9005.50, 55.7107, 7.52636}, +{9151.16, 55.7766, 7.33034}, +{9299.17, 55.8363, 7.13886}, +{9449.58, 55.8901, 6.95164}, +{9602.42, 55.9385, 6.76883}, +{9757.73, 55.9819, 6.59020}, +{9915.55, 56.0205, 6.41580}, +{10075.9, 56.0548, 6.24546}, +{10238.9, 56.0848, 6.07915}, +{10404.5, 56.1110, 5.91682}, +{10572.8, 56.1335, 5.75838}, +{10743.8, 56.1526, 5.60379}, +{10917.6, 56.1684, 5.45295}, +{11094.2, 56.1813, 5.30582}, +{11273.6, 56.1913, 5.16231}, +{11455.9, 56.1986, 5.02236}, +{11641.2, 56.2035, 4.88591}, +{11829.5, 56.2060, 4.75287}, +{12020.8, 56.2064, 4.62320}, +{12215.3, 56.2047, 4.49681}, +{12412.8, 56.2011, 4.37364}, +{12613.6, 56.1957, 4.25362}, +{12817.6, 56.1887, 4.13669}, +{13025.0, 56.1800, 4.02278}, +{13235.6, 56.1699, 3.91182}, +{13449.7, 56.1585, 3.80376}, +{13667.2, 56.1457, 3.69851}, +{13888.3, 56.1318, 3.59604}, +{14112.9, 56.1167, 3.49626}, +{14341.2, 56.1007, 3.39912}, +{14573.1, 56.0836, 3.30456}, +{14808.9, 56.0656, 3.21252}, +{15048.4, 56.0468, 3.12293}, +{15291.8, 56.0273, 3.03575}, +{15539.1, 56.0070, 2.95091}, +{15790.4, 55.9860, 2.86836}, +{16045.8, 55.9643, 2.78805}, +{16305.4, 55.9421, 2.70991}, +{16569.1, 55.9193, 2.63389}, +{16837.1, 55.8961, 2.55995}, +{17109.4, 55.8723, 2.48804}, +{17386.1, 55.8481, 2.41809}, +{17667.4, 55.8234, 2.35006}, +{17953.1, 55.7984, 2.28391}, +{18243.5, 55.7729, 2.21959}, +{18538.6, 55.7471, 2.15704}, +{18838.4, 55.7210, 2.09623}, +{19143.1, 55.6945, 2.03711}, +{19452.7, 55.6677, 1.97964}, +{19767.4, 55.6406, 1.92377}, +{20087.1, 55.6131, 1.86946}, +{20412.0, 55.5853, 1.81667}, +{20742.1, 55.5573, 1.76536}, +{21077.6, 55.5288, 1.71549}, +{21418.5, 55.5001, 1.66703}, +{21765.0, 55.4710, 1.61993}, +{22117.0, 55.4415, 1.57417}, +{22474.7, 55.4117, 1.52970}, +{22838.2, 55.3814, 1.48648}, +{23207.6, 55.3507, 1.44450}, +{23583.0, 55.3195, 1.40371}, +{23964.4, 55.2877, 1.36407}, +{24352.0, 55.2554, 1.32557}, +{24745.9, 55.2224, 1.28817}, +{25146.2, 55.1887, 1.25183}, +{25552.9, 55.1543, 1.21653}, +{25966.2, 55.1189, 1.18224}, +{26386.1, 55.0826, 1.14894}, +{26812.9, 55.0451, 1.11659}, +{27246.6, 55.0064, 1.08517}, +{27687.3, 54.9662, 1.05465}, +{28135.1, 54.9244, 1.02501}, +{28590.2, 54.8808, 0.996231}, +{29052.6, 54.8351, 0.968276}, +{29522.5, 54.7895, 0.941128}, +{30000.0, 54.7272, 0.914765}, +{0, 0, 0} +}; + +e_fp_fdp la[] = { /* Z = 57 */ +{10.0000, -9999.00, 1.29323}, +{10.1617, -9999.00, 1.27127}, +{10.3261, -9999.00, 1.24969}, +{10.4931, -9999.00, 1.22847}, +{10.6628, -9999.00, 1.20761}, +{10.8353, -9999.00, 1.18710}, +{11.0106, -9999.00, 1.16695}, +{11.1886, -9999.00, 1.14713}, +{11.3696, -9999.00, 1.12765}, +{11.5535, -9999.00, 1.10850}, +{11.7404, -9999.00, 1.08967}, +{11.9303, -9999.00, 1.06501}, +{12.1232, -9999.00, 1.04091}, +{12.3193, -9999.00, 1.01736}, +{12.5186, -9999.00, 0.994334}, +{12.7210, -9999.00, 0.971392}, +{12.9268, -9999.00, 0.948329}, +{13.1359, -9999.00, 0.925815}, +{13.3483, -9999.00, 0.903834}, +{13.5642, -9999.00, 0.882376}, +{13.7836, -9999.00, 0.858075}, +{14.0066, -9999.00, 0.833326}, +{14.2331, -9999.00, 0.809291}, +{14.4633, -9999.00, 0.785949}, +{14.6973, -9999.00, 0.758558}, +{14.9350, -9999.00, 0.727577}, +{15.1765, -9999.00, 0.697862}, +{15.4220, -9999.00, 0.669361}, +{15.6714, -9999.00, 0.648001}, +{15.9249, -9999.00, 0.628378}, +{16.1825, -9999.00, 0.609348}, +{16.4442, -9999.00, 0.589580}, +{16.7102, -9999.00, 0.564186}, +{16.9805, -9999.00, 0.539887}, +{17.2551, -9999.00, 0.516635}, +{17.5342, -9999.00, 0.507396}, +{17.8178, -9999.00, 0.500191}, +{18.1060, -9999.00, 0.493089}, +{18.3989, -9999.00, 0.515045}, +{18.6964, -9999.00, 0.570681}, +{18.9988, -9999.00, 0.636214}, +{19.3061, -9999.00, 0.806622}, +{19.6184, -9999.00, 1.19775}, +{19.9357, -9999.00, 1.64037}, +{20.2582, -9999.00, 2.21590}, +{20.5858, -9999.00, 2.99331}, +{20.9188, -9999.00, 4.04349}, +{21.2571, -9999.00, 5.46210}, +{21.6009, -9999.00, 7.37843}, +{21.9503, -9999.00, 9.96709}, +{22.3053, -9999.00, 13.4639}, +{22.6661, -9999.00, 16.0721}, +{23.0327, -9999.00, 17.2793}, +{23.4053, -9999.00, 17.9528}, +{23.7838, -9999.00, 18.5360}, +{24.1685, -9999.00, 19.1382}, +{24.5594, -9999.00, 18.9836}, +{24.9566, -9999.00, 18.6309}, +{25.3603, -9999.00, 18.5651}, +{25.7705, -9999.00, 18.5428}, +{26.1873, -9999.00, 18.5205}, +{26.6109, -9999.00, 18.4982}, +{27.0413, -9999.00, 18.4760}, +{27.4786, -9999.00, 18.0980}, +{27.9231, -9999.00, 17.5668}, +{28.3747, -9999.00, 17.0512}, +{28.8337, -9999.00, 16.5507}, +{29.3000, 12.2701, 16.0650}, +{29.7739, 13.0334, 15.4720}, +{30.2555, 13.6018, 14.7705}, +{30.7449, 14.0550, 14.1007}, +{31.2421, 14.4307, 13.4614}, +{31.7475, 14.7392, 12.8510}, +{32.2609, 15.0251, 12.3363}, +{32.7827, 15.4119, 11.7504}, +{33.3130, 15.6487, 11.0744}, +{33.8518, 15.7960, 10.4374}, +{34.3993, 15.8851, 9.83696}, +{34.9557, 15.9304, 9.27108}, +{35.5211, 15.9406, 8.73775}, +{36.0956, 15.9215, 8.23511}, +{36.6794, 15.8778, 7.76137}, +{37.2727, 15.8131, 7.31489}, +{37.8755, 15.7305, 6.89410}, +{38.4882, 15.6322, 6.49750}, +{39.1107, 15.5202, 6.12374}, +{39.7432, 15.3961, 5.77146}, +{40.3861, 15.2610, 5.43945}, +{41.0393, 15.1145, 5.12654}, +{41.7031, 14.9536, 4.83582}, +{42.3776, 14.7929, 4.57317}, +{43.0630, 14.6327, 4.32478}, +{43.7595, 14.4700, 4.08989}, +{44.4673, 14.3043, 3.86775}, +{45.1865, 14.1354, 3.65768}, +{45.9174, 13.9633, 3.45902}, +{46.6600, 13.7881, 3.27115}, +{47.4147, 13.6096, 3.09348}, +{48.1816, 13.4278, 2.92546}, +{48.9609, 13.2427, 2.76657}, +{49.7528, 13.0540, 2.61630}, +{50.5576, 12.8618, 2.47420}, +{51.3753, 12.6655, 2.33982}, +{52.2062, 12.4651, 2.21273}, +{53.0506, 12.2600, 2.09255}, +{53.9087, 12.0496, 1.97890}, +{54.7806, 11.8333, 1.87142}, +{55.6667, 11.6100, 1.76977}, +{56.5670, 11.3782, 1.67365}, +{57.4820, 11.1353, 1.58275}, +{58.4117, 10.8717, 1.49678}, +{59.3564, 10.5754, 1.45351}, +{60.3165, 10.3104, 1.44062}, +{61.2921, 10.0598, 1.42784}, +{62.2834, 9.81066, 1.41518}, +{63.2908, 9.55949, 1.40263}, +{64.3145, 9.30265, 1.39019}, +{65.3547, 9.03841, 1.38138}, +{66.4118, 8.76670, 1.37340}, +{67.4859, 8.48340, 1.36546}, +{68.5775, 8.18017, 1.35757}, +{69.6867, 7.85300, 1.37455}, +{70.8138, 7.53010, 1.40484}, +{71.9591, 7.20254, 1.43580}, +{73.1230, 6.86236, 1.46745}, +{74.3057, 6.50554, 1.49978}, +{75.5076, 6.12609, 1.53283}, +{76.7289, 5.71123, 1.57742}, +{77.9699, 5.28411, 1.63776}, +{79.2310, 4.83613, 1.70041}, +{80.5125, 4.35765, 1.76546}, +{81.8147, 3.83975, 1.83299}, +{83.1380, 3.26467, 1.91755}, +{84.4827, 2.65904, 2.02702}, +{85.8491, 2.00731, 2.14273}, +{87.2377, 1.29392, 2.26506}, +{88.6487, 0.499922, 2.39436}, +{90.0825, -0.408110, 2.53105}, +{91.5395, -1.52650, 2.73963}, +{93.0201, -2.69079, 3.15201}, +{94.5246, -3.91986, 3.62646}, +{96.0535, -5.24821, 4.19968}, +{97.6071, -6.70603, 4.81068}, +{99.1858, -8.65030, 5.46061}, +{100.790, -11.2771, 8.28138}, +{102.420, -8.92030, 6.47146}, +{104.077, -12.9360, 6.31925}, +{105.760, -16.8325, 8.55669}, +{107.471, -20.9245, 10.1241}, +{109.209, -27.1776, 11.7941}, +{110.975, -37.3157, 17.1579}, +{112.770, -50.3150, 28.8243}, +{114.594, -58.1661, 58.8276}, +{116.448, -36.4565, 98.2235}, +{118.331, 5.61103, 105.854}, +{120.245, 25.6449, 85.3741}, +{122.190, 34.6392, 73.3901}, +{124.166, 39.6429, 65.1873}, +{126.175, 43.9370, 58.2094}, +{128.215, 47.1318, 51.7276}, +{130.289, 49.5293, 45.9677}, +{132.397, 52.7684, 39.5454}, +{134.538, 52.2198, 32.0874}, +{136.714, 50.8749, 28.2097}, +{138.925, 50.1751, 24.8005}, +{141.172, 49.3929, 20.9538}, +{143.456, 48.0311, 17.6289}, +{145.776, 46.4816, 15.1315}, +{148.134, 45.0232, 13.0275}, +{150.530, 43.6421, 11.2160}, +{152.964, 42.2981, 9.65640}, +{155.439, 41.0016, 8.31370}, +{157.953, 39.7501, 7.15771}, +{160.507, 38.5432, 6.16323}, +{163.103, 37.3932, 5.32598}, +{165.742, 36.3055, 4.60249}, +{168.422, 35.2687, 3.97726}, +{171.146, 34.2796, 3.42696}, +{173.915, 33.3114, 2.94524}, +{176.727, 32.3389, 2.54071}, +{179.586, 31.3713, 2.24278}, +{182.491, 30.4798, 2.08287}, +{185.442, 29.6547, 1.98528}, +{188.442, 28.9052, 1.95091}, +{191.489, 28.2011, 1.93894}, +{194.587, 27.5685, 1.98565}, +{197.734, 26.9857, 2.03937}, +{200.932, 26.4448, 2.10432}, +{204.182, 25.9113, 2.18579}, +{207.485, 25.4193, 2.31217}, +{210.840, 24.9588, 2.46386}, +{214.251, 24.5463, 2.64295}, +{217.716, 24.1760, 2.83505}, +{221.237, 23.8578, 3.04111}, +{224.816, 23.5719, 3.21983}, +{228.452, 23.2951, 3.40086}, +{232.147, 23.0349, 3.59207}, +{235.902, 22.7942, 3.79403}, +{239.717, 22.5759, 4.00734}, +{243.595, 22.3891, 4.23266}, +{247.535, 22.2349, 4.44623}, +{251.538, 22.0846, 4.65118}, +{255.607, 21.9448, 4.86557}, +{259.741, 21.8206, 5.08984}, +{263.942, 21.7161, 5.32444}, +{268.211, 21.6352, 5.56986}, +{272.549, 21.5850, 5.82660}, +{276.957, 21.6199, 6.07867}, +{281.437, 21.6450, 6.24358}, +{285.989, 21.6451, 6.41295}, +{290.615, 21.6463, 6.58693}, +{295.315, 21.6541, 6.76563}, +{300.092, 21.6730, 6.94917}, +{304.945, 21.7083, 7.13769}, +{309.878, 21.7737, 7.33132}, +{314.890, 21.8791, 7.48015}, +{319.983, 21.9628, 7.59348}, +{325.158, 22.0271, 7.70852}, +{330.418, 22.0896, 7.82531}, +{335.762, 22.1531, 7.94387}, +{341.192, 22.2204, 8.06422}, +{346.711, 22.2938, 8.18640}, +{352.319, 22.3762, 8.31043}, +{358.017, 22.4949, 8.42562}, +{363.808, 22.6005, 8.50177}, +{369.692, 22.6890, 8.57860}, +{375.672, 22.7742, 8.65614}, +{381.748, 22.8585, 8.73438}, +{387.922, 22.9433, 8.81332}, +{394.197, 23.0304, 8.89297}, +{400.573, 23.1212, 8.97334}, +{407.052, 23.2269, 9.05313}, +{413.635, 23.3305, 9.11175}, +{420.326, 23.4275, 9.17075}, +{427.124, 23.5242, 9.23013}, +{434.032, 23.6231, 9.28990}, +{441.052, 23.7262, 9.35005}, +{448.186, 23.8366, 9.41059}, +{455.435, 23.9572, 9.47152}, +{462.802, 24.1393, 9.51290}, +{470.287, 24.2896, 9.48149}, +{477.894, 24.3995, 9.45018}, +{485.623, 24.4967, 9.41898}, +{493.478, 24.5853, 9.38789}, +{501.459, 24.6687, 9.35689}, +{509.570, 24.7704, 9.32599}, +{517.812, 24.8614, 9.24469}, +{526.187, 24.9168, 9.15360}, +{534.698, 24.9494, 9.06343}, +{543.346, 24.9645, 8.97413}, +{552.134, 24.9646, 8.88571}, +{561.065, 24.9523, 8.79817}, +{570.139, 24.9366, 8.71149}, +{579.361, 24.9038, 8.59360}, +{588.732, 24.8385, 8.47001}, +{598.254, 24.7418, 8.34819}, +{607.930, 24.6180, 8.22812}, +{617.763, 24.4659, 8.10979}, +{627.755, 24.2818, 7.99315}, +{637.908, 24.0572, 7.89071}, +{648.226, 23.8127, 7.80658}, +{658.711, 23.5475, 7.72334}, +{669.365, 23.2503, 7.64099}, +{680.191, 22.9159, 7.55953}, +{691.193, 22.5376, 7.47893}, +{702.372, 22.1289, 7.39358}, +{713.733, 21.6399, 7.27357}, +{725.277, 21.0473, 7.15550}, +{737.008, 20.3438, 7.03935}, +{748.928, 19.5012, 6.92509}, +{761.042, 18.4767, 6.81268}, +{773.351, 17.2016, 6.70209}, +{785.859, 15.5572, 6.59330}, +{798.570, 13.3135, 6.48628}, +{811.486, 9.92764, 6.38099}, +{824.611, 3.48958, 6.27742}, +{835.900, -39.4339, 6.19096}, +{836.100, -39.3987, 35.2147}, +{837.949, -11.7601, 35.0835}, +{851.502, 8.18508, 34.1450}, +{865.274, 14.5157, 33.2315}, +{879.269, 18.4107, 32.3425}, +{893.491, 21.1915, 31.4772}, +{907.943, 23.3049, 30.6351}, +{922.628, 24.9502, 29.8155}, +{937.551, 26.2164, 29.0179}, +{952.715, 27.0509, 28.2416}, +{968.124, 27.6376, 27.9285}, +{983.783, 28.2841, 27.8022}, +{999.695, 29.0099, 27.6764}, +{1015.86, 29.7133, 27.5511}, +{1032.29, 30.3863, 27.4265}, +{1048.99, 31.0171, 27.3023}, +{1065.96, 31.5838, 27.2233}, +{1083.20, 32.1645, 27.2093}, +{1100.72, 32.7761, 27.1952}, +{1118.52, 33.3916, 27.1813}, +{1136.61, 34.0111, 27.1673}, +{1155.00, 34.6359, 27.1534}, +{1173.68, 35.2691, 27.1396}, +{1192.66, 35.9153, 27.1255}, +{1211.95, 36.5836, 27.1115}, +{1231.55, 37.3029, 27.0977}, +{1251.47, 38.0723, 27.0038}, +{1271.72, 38.8633, 26.8227}, +{1292.29, 39.5669, 26.5356}, +{1313.19, 40.2028, 26.2516}, +{1334.43, 40.8015, 25.9705}, +{1356.01, 41.3743, 25.6923}, +{1377.94, 41.9286, 25.4173}, +{1400.23, 42.4707, 25.1453}, +{1422.88, 43.0074, 24.8761}, +{1445.89, 43.5492, 24.6098}, +{1469.28, 44.1158, 24.3257}, +{1493.04, 44.7133, 24.0136}, +{1517.19, 45.2658, 23.5751}, +{1541.73, 45.7461, 23.1269}, +{1566.67, 46.1702, 22.6876}, +{1592.01, 46.5601, 22.2563}, +{1617.76, 46.9213, 21.8331}, +{1643.92, 47.2583, 21.4180}, +{1670.51, 47.5746, 21.0108}, +{1697.53, 47.8723, 20.6115}, +{1724.99, 48.1588, 20.2200}, +{1752.89, 48.4295, 19.8264}, +{1781.24, 48.6814, 19.4374}, +{1810.05, 48.9163, 19.0536}, +{1839.32, 49.1353, 18.6777}, +{1869.07, 49.3413, 18.3092}, +{1899.30, 49.5349, 17.9478}, +{1930.02, 49.7174, 17.5936}, +{1961.24, 49.8896, 17.2464}, +{1992.96, 50.0497, 16.9057}, +{2025.20, 50.2093, 16.5790}, +{2057.95, 50.3625, 16.2462}, +{2091.24, 50.5028, 15.9183}, +{2125.06, 50.6342, 15.5962}, +{2159.43, 50.7573, 15.2789}, +{2194.36, 50.8723, 14.9670}, +{2229.85, 50.9798, 14.6605}, +{2265.92, 51.0802, 14.3589}, +{2302.57, 51.1735, 14.0622}, +{2339.81, 51.2601, 13.7707}, +{2377.66, 51.3404, 13.4841}, +{2416.11, 51.4146, 13.2023}, +{2455.19, 51.4825, 12.9252}, +{2494.90, 51.5451, 12.6535}, +{2535.26, 51.6024, 12.3855}, +{2576.26, 51.6542, 12.1223}, +{2617.93, 51.7003, 11.8630}, +{2660.27, 51.7411, 11.6086}, +{2703.30, 51.7770, 11.3585}, +{2747.03, 51.8078, 11.1129}, +{2791.46, 51.8343, 10.8718}, +{2836.61, 51.8564, 10.6345}, +{2882.49, 51.8732, 10.4004}, +{2929.11, 51.8851, 10.1713}, +{2976.48, 51.8932, 9.94604}, +{3024.63, 51.8966, 9.72412}, +{3073.55, 51.8952, 9.50635}, +{3123.26, 51.8895, 9.29219}, +{3173.78, 51.8791, 9.08180}, +{3225.11, 51.8643, 8.87508}, +{3277.27, 51.8450, 8.67190}, +{3330.28, 51.8210, 8.47207}, +{3384.15, 51.7922, 8.27576}, +{3438.88, 51.7587, 8.08291}, +{3494.50, 51.7202, 7.89329}, +{3551.02, 51.6766, 7.70698}, +{3608.46, 51.6277, 7.52382}, +{3666.82, 51.5733, 7.34391}, +{3726.13, 51.5133, 7.16708}, +{3786.40, 51.4471, 6.99326}, +{3847.64, 51.3745, 6.82239}, +{3909.87, 51.2951, 6.65458}, +{3973.11, 51.2084, 6.48964}, +{4037.38, 51.1139, 6.32746}, +{4102.68, 51.0108, 6.16808}, +{4169.03, 50.8982, 6.01145}, +{4236.46, 50.7754, 5.85768}, +{4304.98, 50.6411, 5.70636}, +{4374.62, 50.4939, 5.55774}, +{4445.37, 50.3321, 5.41157}, +{4517.27, 50.1536, 5.26805}, +{4590.33, 49.9557, 5.12701}, +{4664.58, 49.7348, 4.98827}, +{4740.03, 49.4866, 4.85203}, +{4816.69, 49.2048, 4.71808}, +{4894.60, 48.8812, 4.58659}, +{4973.77, 48.5034, 4.45712}, +{5054.21, 48.0527, 4.32993}, +{5135.96, 47.4981, 4.20491}, +{5219.03, 46.7832, 4.08217}, +{5303.44, 45.7841, 3.96142}, +{5389.22, 44.1227, 3.84274}, +{5476.39, 37.4001, 3.72662}, +{5482.60, 27.0890, 3.71856}, +{5482.80, 27.0900, 11.5444}, +{5564.97, 43.7526, 11.2370}, +{5654.98, 45.3258, 10.9146}, +{5746.44, 45.8683, 10.6014}, +{5839.39, 45.4520, 10.2972}, +{5890.50, 38.3752, 10.1356}, +{5890.70, 38.3789, 13.9401}, +{5933.83, 45.8379, 13.7639}, +{6029.81, 47.6529, 13.3842}, +{6127.33, 48.4750, 13.0149}, +{6226.44, 48.6009, 12.6557}, +{6266.20, 45.4692, 12.5159}, +{6266.40, 45.4727, 14.3563}, +{6327.15, 49.4936, 14.1531}, +{6429.48, 50.6357, 13.8215}, +{6533.48, 51.4133, 13.4950}, +{6639.15, 52.0367, 13.1744}, +{6746.54, 52.5639, 12.8594}, +{6855.65, 53.0219, 12.5501}, +{6966.54, 53.4262, 12.2465}, +{7079.22, 53.7866, 11.9484}, +{7193.72, 54.1105, 11.6561}, +{7310.07, 54.4032, 11.3693}, +{7428.31, 54.6686, 11.0883}, +{7548.45, 54.9101, 10.8129}, +{7670.54, 55.1304, 10.5432}, +{7794.61, 55.3317, 10.2789}, +{7920.68, 55.5159, 10.0202}, +{8048.79, 55.6845, 9.76690}, +{8178.98, 55.8389, 9.51901}, +{8311.26, 55.9805, 9.27660}, +{8445.69, 56.1102, 9.03940}, +{8582.29, 56.2290, 8.80741}, +{8721.11, 56.3377, 8.58056}, +{8862.16, 56.4371, 8.35871}, +{9005.50, 56.5277, 8.14201}, +{9151.16, 56.6103, 7.93032}, +{9299.17, 56.6856, 7.72354}, +{9449.58, 56.7539, 7.52137}, +{9602.42, 56.8156, 7.32410}, +{9757.73, 56.8714, 7.13152}, +{9915.55, 56.9216, 6.94348}, +{10075.9, 56.9666, 6.75989}, +{10238.9, 57.0066, 6.58072}, +{10404.5, 57.0421, 6.40588}, +{10572.8, 57.0733, 6.23530}, +{10743.8, 57.1004, 6.06890}, +{10917.6, 57.1238, 5.90660}, +{11094.2, 57.1437, 5.74831}, +{11273.6, 57.1603, 5.59395}, +{11455.9, 57.1738, 5.44347}, +{11641.2, 57.1844, 5.29675}, +{11829.5, 57.1923, 5.15374}, +{12020.8, 57.1977, 5.01435}, +{12215.3, 57.2008, 4.87851}, +{12412.8, 57.2016, 4.74614}, +{12613.6, 57.2004, 4.61716}, +{12817.6, 57.1972, 4.49151}, +{13025.0, 57.1922, 4.36910}, +{13235.6, 57.1856, 4.24986}, +{13449.7, 57.1774, 4.13373}, +{13667.2, 57.1677, 4.02063}, +{13888.3, 57.1566, 3.91049}, +{14112.9, 57.1442, 3.80324}, +{14341.2, 57.1307, 3.69882}, +{14573.1, 57.1160, 3.59715}, +{14808.9, 57.1003, 3.49818}, +{15048.4, 57.0837, 3.40184}, +{15291.8, 57.0661, 3.30806}, +{15539.1, 57.0477, 3.21679}, +{15790.4, 57.0286, 3.12796}, +{16045.8, 57.0087, 3.04151}, +{16305.4, 56.9881, 2.95739}, +{16569.1, 56.9669, 2.87553}, +{16837.1, 56.9451, 2.79588}, +{17109.4, 56.9227, 2.71839}, +{17386.1, 56.8999, 2.64299}, +{17667.4, 56.8765, 2.56964}, +{17953.1, 56.8528, 2.49829}, +{18243.5, 56.8286, 2.42888}, +{18538.6, 56.8040, 2.36137}, +{18838.4, 56.7790, 2.29570}, +{19143.1, 56.7537, 2.23183}, +{19452.7, 56.7280, 2.16971}, +{19767.4, 56.7020, 2.10930}, +{20087.1, 56.6756, 2.05055}, +{20412.0, 56.6490, 1.99341}, +{20742.1, 56.6220, 1.93785}, +{21077.6, 56.5948, 1.88382}, +{21418.5, 56.5672, 1.83129}, +{21765.0, 56.5393, 1.78021}, +{22117.0, 56.5111, 1.73055}, +{22474.7, 56.4825, 1.68226}, +{22838.2, 56.4536, 1.63531}, +{23207.6, 56.4243, 1.58966}, +{23583.0, 56.3946, 1.54529}, +{23964.4, 56.3644, 1.50215}, +{24352.0, 56.3338, 1.46020}, +{24745.9, 56.3027, 1.41943}, +{25146.2, 56.2710, 1.37980}, +{25552.9, 56.2387, 1.34127}, +{25966.2, 56.2057, 1.30382}, +{26386.1, 56.1720, 1.26741}, +{26812.9, 56.1374, 1.23202}, +{27246.6, 56.1019, 1.19762}, +{27687.3, 56.0653, 1.16418}, +{28135.1, 56.0275, 1.13168}, +{28590.2, 55.9883, 1.10009}, +{29052.6, 55.9476, 1.06938}, +{29522.5, 55.9052, 1.03954}, +{30000.0, 55.8606, 1.01053}, +{0, 0, 0} +}; + +e_fp_fdp ce[] = { /* Z = 58 */ +{10.0000, -9999.00, 1.28369}, +{10.1617, -9999.00, 1.26389}, +{10.3261, -9999.00, 1.24441}, +{10.4931, -9999.00, 1.22522}, +{10.6628, -9999.00, 1.20632}, +{10.8353, -9999.00, 1.18772}, +{11.0106, -9999.00, 1.16941}, +{11.1886, -9999.00, 1.15138}, +{11.3696, -9999.00, 1.13362}, +{11.5535, -9999.00, 1.11614}, +{11.7404, -9999.00, 1.09893}, +{11.9303, -9999.00, 1.08199}, +{12.1232, -9999.00, 1.06530}, +{12.3193, -9999.00, 1.04888}, +{12.5186, -9999.00, 1.03270}, +{12.7210, -9999.00, 1.01678}, +{12.9268, -9999.00, 1.00676}, +{13.1359, -9999.00, 1.00038}, +{13.3483, -9999.00, 0.994040}, +{13.5642, -9999.00, 0.987739}, +{13.7836, -9999.00, 0.981479}, +{14.0066, -9999.00, 0.956007}, +{14.2331, -9999.00, 0.926295}, +{14.4633, -9999.00, 0.897506}, +{14.6973, -9999.00, 0.869612}, +{14.9350, -9999.00, 0.847175}, +{15.1765, -9999.00, 0.826038}, +{15.4220, -9999.00, 0.805430}, +{15.6714, -9999.00, 0.785336}, +{15.9249, -9999.00, 0.768039}, +{16.1825, -9999.00, 0.751660}, +{16.4442, -9999.00, 0.743108}, +{16.7102, -9999.00, 0.738426}, +{16.9805, -9999.00, 0.733773}, +{17.2551, -9999.00, 0.730488}, +{17.5342, -9999.00, 0.732590}, +{17.8178, -9999.00, 0.734698}, +{18.1060, -9999.00, 0.738342}, +{18.3989, -9999.00, 0.752939}, +{18.6964, -9999.00, 0.767824}, +{18.9988, -9999.00, 0.783004}, +{19.3061, -9999.00, 0.802333}, +{19.6184, -9999.00, 0.830937}, +{19.9357, -9999.00, 0.860562}, +{20.2582, -9999.00, 0.896253}, +{20.5858, -9999.00, 0.947545}, +{20.9188, -9999.00, 1.02453}, +{21.2571, -9999.00, 1.16405}, +{21.6009, -9999.00, 1.39197}, +{21.9503, -9999.00, 1.74286}, +{22.3053, -9999.00, 2.28855}, +{22.6661, -9999.00, 4.30971}, +{23.0327, -9999.00, 9.11122}, +{23.4053, -9999.00, 14.5318}, +{23.7838, -9999.00, 16.0458}, +{24.1685, -9999.00, 16.5067}, +{24.5594, -9999.00, 16.9807}, +{24.9566, -9999.00, 17.2142}, +{25.3603, -9999.00, 17.3637}, +{25.7705, -9999.00, 17.3370}, +{26.1873, -9999.00, 17.2087}, +{26.6109, -9999.00, 17.0812}, +{27.0413, -9999.00, 16.7834}, +{27.4786, -9999.00, 16.3590}, +{27.9231, -9999.00, 15.9484}, +{28.3747, -9999.00, 15.6504}, +{28.8337, -9999.00, 15.3579}, +{29.3000, 6.50335, 14.8611}, +{29.7739, 7.10772, 14.3580}, +{30.2555, 7.61895, 13.8174}, +{30.7449, 8.02179, 13.2928}, +{31.2421, 8.31620, 12.8326}, +{31.7475, 8.63469, 12.4573}, +{32.2609, 8.97915, 12.0929}, +{32.7827, 9.38161, 11.6884}, +{33.3130, 9.69364, 11.1537}, +{33.8518, 9.91000, 10.6435}, +{34.3993, 10.0639, 10.1566}, +{34.9557, 10.1627, 9.69192}, +{35.5211, 10.2173, 9.28777}, +{36.0956, 10.2739, 8.91349}, +{36.6794, 10.3212, 8.55430}, +{37.2727, 10.3548, 8.20959}, +{37.8755, 10.3763, 7.88064}, +{38.4882, 10.3880, 7.56485}, +{39.1107, 10.3923, 7.26173}, +{39.7432, 10.3976, 6.97075}, +{40.3861, 10.4049, 6.65688}, +{41.0393, 10.3737, 6.34253}, +{41.7031, 10.3210, 6.04304}, +{42.3776, 10.2584, 5.74055}, +{43.0630, 10.1567, 5.44034}, +{43.7595, 10.0158, 5.15583}, +{44.4673, 9.81063, 4.92603}, +{45.1865, 9.64935, 4.76665}, +{45.9174, 9.51254, 4.61243}, +{46.6600, 9.38009, 4.46320}, +{47.4147, 9.24814, 4.32622}, +{48.1816, 9.12409, 4.19684}, +{48.9609, 9.00556, 4.07133}, +{49.7528, 8.89692, 3.94432}, +{50.5576, 8.77542, 3.79592}, +{51.3753, 8.63525, 3.65311}, +{52.2062, 8.47691, 3.51567}, +{53.0506, 8.28851, 3.39671}, +{53.9087, 8.11200, 3.32109}, +{54.7806, 7.94671, 3.24716}, +{55.6667, 7.78404, 3.17488}, +{56.5670, 7.61756, 3.10420}, +{57.4820, 7.44291, 3.04472}, +{58.4117, 7.27496, 2.99326}, +{59.3564, 7.10899, 2.94085}, +{60.3165, 6.93875, 2.88830}, +{61.2921, 6.76334, 2.83668}, +{62.2834, 6.58184, 2.78599}, +{63.2908, 6.39292, 2.73621}, +{64.3145, 6.19492, 2.68731}, +{65.3547, 5.98497, 2.63929}, +{66.4118, 5.75503, 2.59902}, +{67.4859, 5.52492, 2.57732}, +{68.5775, 5.29235, 2.55580}, +{69.6867, 5.05292, 2.53446}, +{70.8138, 4.80378, 2.51330}, +{71.9591, 4.54302, 2.49231}, +{73.1230, 4.26911, 2.47150}, +{74.3057, 3.98183, 2.44907}, +{75.5076, 3.67324, 2.42325}, +{76.7289, 3.34083, 2.39770}, +{77.9699, 2.98068, 2.37242}, +{79.2310, 2.58111, 2.34741}, +{80.5125, 2.15135, 2.35757}, +{81.8147, 1.70930, 2.37468}, +{83.1380, 1.24169, 2.39192}, +{84.4827, 0.740091, 2.40928}, +{85.8491, 0.196062, 2.42677}, +{87.2377, -0.403368, 2.44439}, +{88.6487, -1.07043, 2.48602}, +{90.0825, -1.78002, 2.54704}, +{91.5395, -2.55276, 2.60955}, +{93.0201, -3.40814, 2.67360}, +{94.5246, -4.36862, 2.73922}, +{96.0535, -5.46622, 2.80645}, +{97.6071, -6.76345, 2.87533}, +{99.1858, -8.30804, 3.05961}, +{100.790, -10.1154, 3.30269}, +{102.420, -12.6727, 3.76703}, +{104.077, -15.5564, 4.90637}, +{105.760, -15.5814, 7.99694}, +{107.471, -18.1102, 6.24227}, +{109.209, -22.3317, 9.00118}, +{110.975, -24.1257, 11.5426}, +{112.770, -28.6290, 11.5388}, +{114.594, -37.9832, 13.7904}, +{116.448, -49.6006, 23.7825}, +{118.331, -57.9189, 43.3983}, +{120.245, -53.9566, 68.7867}, +{122.190, -33.7369, 93.1156}, +{124.166, -9.00118, 98.0932}, +{126.175, 12.2736, 95.0335}, +{128.215, 29.4122, 87.0895}, +{130.289, 39.1517, 75.2961}, +{132.397, 43.9352, 65.6724}, +{134.538, 46.9576, 58.2625}, +{136.714, 49.4896, 52.0451}, +{138.925, 52.2876, 45.7895}, +{141.172, 53.2541, 38.8770}, +{143.456, 53.1098, 32.5996}, +{145.776, 51.4669, 27.0090}, +{148.134, 49.3648, 23.3210}, +{150.530, 47.7809, 20.3879}, +{152.964, 46.2356, 17.6445}, +{155.439, 44.5231, 15.2704}, +{157.953, 42.7963, 13.5541}, +{160.507, 41.4034, 12.1804}, +{163.103, 40.2236, 10.9459}, +{165.742, 39.0982, 9.65548}, +{168.422, 37.9165, 8.49304}, +{171.146, 36.5982, 7.53994}, +{173.915, 35.4502, 6.88520}, +{176.727, 34.4729, 6.28735}, +{179.586, 33.5430, 5.69091}, +{182.491, 32.6204, 5.15087}, +{185.442, 31.7132, 4.68219}, +{188.442, 30.7682, 4.25721}, +{191.489, 29.8576, 4.03762}, +{194.587, 29.0651, 3.86686}, +{197.734, 28.3105, 3.70334}, +{200.932, 27.5924, 3.61478}, +{204.182, 26.8981, 3.53602}, +{207.485, 26.2512, 3.54711}, +{210.840, 25.6349, 3.55900}, +{214.251, 25.0457, 3.65161}, +{217.716, 24.5274, 3.77563}, +{221.237, 24.0647, 3.90386}, +{224.816, 23.6340, 4.03644}, +{228.452, 23.2130, 4.17353}, +{232.147, 22.8177, 4.35787}, +{235.902, 22.4642, 4.55720}, +{239.717, 22.1409, 4.76566}, +{243.595, 21.8261, 4.99190}, +{247.535, 21.5531, 5.25598}, +{251.538, 21.3244, 5.53405}, +{255.607, 21.1385, 5.82681}, +{259.741, 20.9942, 6.12237}, +{263.942, 20.8921, 6.43040}, +{268.211, 20.8783, 6.74348}, +{272.549, 20.8894, 6.98933}, +{276.957, 20.9663, 7.24415}, +{281.437, 21.0423, 7.36660}, +{285.989, 21.0779, 7.48640}, +{290.615, 21.1092, 7.60815}, +{295.315, 21.1566, 7.69196}, +{300.092, 21.1265, 7.76522}, +{304.945, 21.1082, 7.90299}, +{309.878, 21.1116, 8.04320}, +{314.890, 21.1284, 8.18591}, +{319.983, 21.1584, 8.33114}, +{325.158, 21.2030, 8.47894}, +{330.418, 21.2655, 8.62938}, +{335.762, 21.3830, 8.76771}, +{341.192, 21.4871, 8.85153}, +{346.711, 21.5728, 8.93616}, +{352.319, 21.6601, 9.02160}, +{358.017, 21.7551, 9.10785}, +{363.808, 21.8743, 9.19492}, +{369.692, 22.0011, 9.22717}, +{375.672, 22.1050, 9.24453}, +{381.748, 22.1899, 9.26192}, +{387.922, 22.2672, 9.27934}, +{394.197, 22.3386, 9.29679}, +{400.573, 22.4056, 9.31428}, +{407.052, 22.4691, 9.33179}, +{413.635, 22.5296, 9.34934}, +{420.326, 22.5877, 9.36788}, +{427.124, 22.6451, 9.38702}, +{434.032, 22.7023, 9.40618}, +{441.052, 22.7602, 9.42539}, +{448.186, 22.8201, 9.44464}, +{455.435, 22.8836, 9.46393}, +{462.802, 22.9807, 9.47220}, +{470.287, 23.0562, 9.43558}, +{477.894, 23.1038, 9.39909}, +{485.623, 23.1395, 9.36275}, +{493.478, 23.1650, 9.32654}, +{501.459, 23.1815, 9.29048}, +{509.570, 23.1898, 9.25455}, +{517.812, 23.1904, 9.21877}, +{526.187, 23.1838, 9.18312}, +{534.698, 23.1705, 9.14762}, +{543.346, 23.1615, 9.11163}, +{552.134, 23.1382, 9.05222}, +{561.065, 23.0938, 8.99318}, +{570.139, 23.0341, 8.93453}, +{579.361, 22.9599, 8.87626}, +{588.732, 22.8711, 8.81838}, +{598.254, 22.7675, 8.76087}, +{607.930, 22.6484, 8.70373}, +{617.763, 22.5134, 8.64697}, +{627.755, 22.3619, 8.59058}, +{637.908, 22.1938, 8.53456}, +{648.226, 22.0097, 8.47890}, +{658.711, 21.8139, 8.42361}, +{669.365, 21.6391, 8.35664}, +{680.191, 21.3980, 8.19468}, +{691.193, 21.0793, 8.03585}, +{702.372, 20.6934, 7.88010}, +{713.733, 20.2415, 7.72738}, +{725.277, 19.7209, 7.57761}, +{737.008, 19.1187, 7.42369}, +{748.928, 18.4171, 7.27026}, +{761.042, 17.5998, 7.11999}, +{773.351, 16.6430, 6.97282}, +{785.859, 15.5116, 6.82871}, +{798.570, 14.1541, 6.68756}, +{811.486, 12.4911, 6.54934}, +{824.611, 10.3916, 6.41397}, +{837.949, 7.61762, 6.28140}, +{851.502, 3.66553, 6.15157}, +{865.274, -2.86705, 6.02442}, +{879.269, -20.2880, 5.89991}, +{883.700, -69.4070, 5.86143}, +{883.900, -69.3767, 46.6439}, +{893.491, -9.26426, 46.0804}, +{907.943, 3.31586, 45.2553}, +{922.628, 10.0534, 44.4449}, +{937.551, 14.7446, 43.6490}, +{952.715, 18.3661, 42.8674}, +{968.124, 21.3225, 42.0998}, +{983.783, 23.8217, 41.3459}, +{999.695, 25.9859, 40.6055}, +{1015.86, 27.8956, 39.8784}, +{1032.29, 29.6384, 39.1467}, +{1048.99, 31.0836, 38.3723}, +{1065.96, 32.3957, 37.7379}, +{1083.20, 33.6505, 37.1140}, +{1100.72, 34.8152, 36.5005}, +{1118.52, 35.9013, 35.8970}, +{1136.61, 36.9177, 35.3036}, +{1155.00, 37.8726, 34.7199}, +{1173.68, 38.7733, 34.1459}, +{1192.66, 39.6264, 33.5814}, +{1211.95, 40.4388, 33.0262}, +{1231.55, 41.2175, 32.4802}, +{1251.47, 41.9711, 31.9433}, +{1271.72, 42.7116, 31.4152}, +{1292.29, 43.3973, 30.8958}, +{1313.19, 44.7145, 30.3850}, +{1334.43, 44.9431, 28.5651}, +{1356.01, 44.8518, 28.2390}, +{1377.94, 45.1037, 27.9164}, +{1400.23, 45.4502, 27.5975}, +{1422.88, 45.8466, 27.2824}, +{1445.89, 46.2903, 26.9709}, +{1469.28, 46.7715, 26.6401}, +{1493.04, 47.3242, 26.2787}, +{1517.19, 47.8475, 25.7796}, +{1541.73, 48.2809, 25.2704}, +{1566.67, 48.6716, 24.7714}, +{1592.01, 49.0318, 24.2818}, +{1617.76, 49.3673, 23.8020}, +{1643.92, 49.6827, 23.3321}, +{1670.51, 49.9808, 22.8710}, +{1697.53, 50.2645, 22.4191}, +{1724.99, 50.5406, 21.9761}, +{1752.89, 50.8036, 21.5248}, +{1781.24, 51.0479, 21.0769}, +{1810.05, 51.2715, 20.6340}, +{1839.32, 51.4785, 20.2003}, +{1869.07, 51.6713, 19.7759}, +{1899.30, 51.8518, 19.3605}, +{1930.02, 52.0210, 18.9536}, +{1961.24, 52.1803, 18.5552}, +{1992.96, 52.3270, 18.1651}, +{2025.20, 52.4731, 17.7917}, +{2057.95, 52.6139, 17.4091}, +{2091.24, 52.7418, 17.0331}, +{2125.06, 52.8594, 16.6637}, +{2159.43, 52.9678, 16.3004}, +{2194.36, 53.0677, 15.9439}, +{2229.85, 53.1595, 15.5937}, +{2265.92, 53.2435, 15.2500}, +{2302.57, 53.3205, 14.9130}, +{2339.81, 53.3899, 14.5813}, +{2377.66, 53.4527, 14.2569}, +{2416.11, 53.5094, 13.9384}, +{2455.19, 53.5600, 13.6259}, +{2494.90, 53.6042, 13.3192}, +{2535.26, 53.6429, 13.0191}, +{2576.26, 53.6764, 12.7245}, +{2617.93, 53.7045, 12.4357}, +{2660.27, 53.7275, 12.1524}, +{2703.30, 53.7452, 11.8746}, +{2747.03, 53.7583, 11.6030}, +{2791.46, 53.7671, 11.3365}, +{2836.61, 53.7709, 11.0751}, +{2882.49, 53.7703, 10.8196}, +{2929.11, 53.7658, 10.5689}, +{2976.48, 53.7570, 10.3233}, +{3024.63, 53.7440, 10.0829}, +{3073.55, 53.7269, 9.84732}, +{3123.26, 53.7060, 9.61666}, +{3173.78, 53.6811, 9.39077}, +{3225.11, 53.6523, 9.16965}, +{3277.27, 53.6197, 8.95317}, +{3330.28, 53.5833, 8.74107}, +{3384.15, 53.5430, 8.53343}, +{3438.88, 53.4987, 8.33018}, +{3494.50, 53.4506, 8.13124}, +{3551.02, 53.3985, 7.93647}, +{3608.46, 53.3422, 7.74576}, +{3666.82, 53.2818, 7.55916}, +{3726.13, 53.2170, 7.37646}, +{3786.40, 53.1476, 7.19771}, +{3847.64, 53.0737, 7.02272}, +{3909.87, 52.9947, 6.85137}, +{3973.11, 52.9104, 6.68377}, +{4037.38, 52.8207, 6.51974}, +{4102.68, 52.7250, 6.35914}, +{4169.03, 52.6227, 6.20199}, +{4236.46, 52.5134, 6.04830}, +{4304.98, 52.3966, 5.89782}, +{4374.62, 52.2713, 5.75045}, +{4445.37, 52.1364, 5.60634}, +{4517.27, 51.9911, 5.46530}, +{4590.33, 51.8338, 5.32730}, +{4664.58, 51.6628, 5.19224}, +{4740.03, 51.4761, 5.06011}, +{4816.69, 51.2708, 4.93075}, +{4894.60, 51.0434, 4.80425}, +{4973.77, 50.7894, 4.68043}, +{5054.21, 50.5022, 4.55917}, +{5135.96, 50.1731, 4.44062}, +{5219.03, 49.7890, 4.32457}, +{5303.44, 49.3293, 4.21090}, +{5389.22, 48.7590, 4.09981}, +{5476.39, 48.0111, 3.99101}, +{5564.97, 46.9260, 3.88462}, +{5654.98, 44.9343, 3.78047}, +{5723.30, 29.5430, 3.70435}, +{5723.50, 29.5449, 11.1538}, +{5746.44, 42.3851, 11.0714}, +{5839.39, 46.1015, 10.7472}, +{5933.83, 47.2177, 10.4327}, +{6029.81, 47.5422, 10.1274}, +{6127.33, 46.7219, 9.83095}, +{6164.10, 40.0416, 9.72267}, +{6164.30, 40.0430, 13.3925}, +{6226.44, 47.8728, 13.1669}, +{6327.15, 49.3360, 12.8140}, +{6429.48, 50.0300, 12.4702}, +{6533.48, 49.7640, 12.1360}, +{6548.70, 47.3953, 12.0882}, +{6548.90, 47.3980, 13.6362}, +{6639.15, 51.2345, 13.3773}, +{6746.54, 52.1353, 13.0801}, +{6855.65, 52.8021, 12.7868}, +{6966.54, 53.3514, 12.4970}, +{7079.22, 53.8228, 12.2113}, +{7193.72, 54.2364, 11.9297}, +{7310.07, 54.6043, 11.6524}, +{7428.31, 54.9346, 11.3793}, +{7548.45, 55.2328, 11.1106}, +{7670.54, 55.5036, 10.8462}, +{7794.61, 55.7502, 10.5863}, +{7920.68, 55.9755, 10.3309}, +{8048.79, 56.1816, 10.0801}, +{8178.98, 56.3706, 9.83382}, +{8311.26, 56.5440, 9.59208}, +{8445.69, 56.7032, 9.35493}, +{8582.29, 56.8493, 9.12244}, +{8721.11, 56.9836, 8.89437}, +{8862.16, 57.1068, 8.67092}, +{9005.50, 57.2199, 8.45212}, +{9151.16, 57.3236, 8.23760}, +{9299.17, 57.4185, 8.02776}, +{9449.58, 57.5053, 7.82223}, +{9602.42, 57.5847, 7.62125}, +{9757.73, 57.6569, 7.42436}, +{9915.55, 57.7225, 7.23194}, +{10075.9, 57.7820, 7.04378}, +{10238.9, 57.8357, 6.85985}, +{10404.5, 57.8840, 6.68007}, +{10572.8, 57.9273, 6.50440}, +{10743.8, 57.9659, 6.33278}, +{10917.6, 58.0001, 6.16515}, +{11094.2, 58.0301, 6.00146}, +{11273.6, 58.0562, 5.84163}, +{11455.9, 58.0787, 5.68562}, +{11641.2, 58.0977, 5.53335}, +{11829.5, 58.1136, 5.38476}, +{12020.8, 58.1265, 5.23980}, +{12215.3, 58.1365, 5.09838}, +{12412.8, 58.1439, 4.96045}, +{12613.6, 58.1488, 4.82594}, +{12817.6, 58.1514, 4.69480}, +{13025.0, 58.1518, 4.56694}, +{13235.6, 58.1501, 4.44232}, +{13449.7, 58.1466, 4.32086}, +{13667.2, 58.1413, 4.20249}, +{13888.3, 58.1343, 4.08717}, +{14112.9, 58.1258, 3.97481}, +{14341.2, 58.1157, 3.86536}, +{14573.1, 58.1044, 3.75876}, +{14808.9, 58.0917, 3.65494}, +{15048.4, 58.0779, 3.55384}, +{15291.8, 58.0629, 3.45541}, +{15539.1, 58.0469, 3.35958}, +{15790.4, 58.0300, 3.26629}, +{16045.8, 58.0121, 3.17549}, +{16305.4, 57.9935, 3.08711}, +{16569.1, 57.9740, 3.00111}, +{16837.1, 57.9538, 2.91742}, +{17109.4, 57.9329, 2.83599}, +{17386.1, 57.9114, 2.75676}, +{17667.4, 57.8893, 2.67969}, +{17953.1, 57.8667, 2.60472}, +{18243.5, 57.8435, 2.53180}, +{18538.6, 57.8199, 2.46088}, +{18838.4, 57.7958, 2.39191}, +{19143.1, 57.7713, 2.32484}, +{19452.7, 57.7464, 2.25963}, +{19767.4, 57.7211, 2.19622}, +{20087.1, 57.6955, 2.13457}, +{20412.0, 57.6695, 2.07464}, +{20742.1, 57.6432, 2.01639}, +{21077.6, 57.6165, 1.95976}, +{21418.5, 57.5896, 1.90472}, +{21765.0, 57.5623, 1.85122}, +{22117.0, 57.5347, 1.79923}, +{22474.7, 57.5068, 1.74871}, +{22838.2, 57.4785, 1.69962}, +{23207.6, 57.4499, 1.65191}, +{23583.0, 57.4210, 1.60556}, +{23964.4, 57.3917, 1.56053}, +{24352.0, 57.3621, 1.51678}, +{24745.9, 57.3320, 1.47428}, +{25146.2, 57.3014, 1.43299}, +{25552.9, 57.2704, 1.39289}, +{25966.2, 57.2388, 1.35393}, +{26386.1, 57.2067, 1.31609}, +{26812.9, 57.1739, 1.27934}, +{27246.6, 57.1404, 1.24365}, +{27687.3, 57.1061, 1.20899}, +{28135.1, 57.0710, 1.17533}, +{28590.2, 57.0349, 1.14264}, +{29052.6, 56.9978, 1.11090}, +{29522.5, 56.9624, 1.08008}, +{30000.0, 56.9098, 1.05015}, +{0, 0, 0} +}; + +e_fp_fdp pr[] = { /* Z = 59 */ +{10.0000, -9999.00, 1.26325}, +{10.1617, -9999.00, 1.25455}, +{10.3261, -9999.00, 1.24591}, +{10.4931, -9999.00, 1.23732}, +{10.6628, -9999.00, 1.22879}, +{10.8353, -9999.00, 1.22033}, +{11.0106, -9999.00, 1.21192}, +{11.1886, -9999.00, 1.20357}, +{11.3696, -9999.00, 1.19528}, +{11.5535, -9999.00, 1.18704}, +{11.7404, -9999.00, 1.17886}, +{11.9303, -9999.00, 1.17022}, +{12.1232, -9999.00, 1.16019}, +{12.3193, -9999.00, 1.15025}, +{12.5186, -9999.00, 1.14040}, +{12.7210, -9999.00, 1.13063}, +{12.9268, -9999.00, 1.12094}, +{13.1359, -9999.00, 1.10453}, +{13.3483, -9999.00, 1.08708}, +{13.5642, -9999.00, 1.06991}, +{13.7836, -9999.00, 1.05301}, +{14.0066, -9999.00, 1.01549}, +{14.2331, -9999.00, 0.995923}, +{14.4633, -9999.00, 0.976736}, +{14.6973, -9999.00, 0.957920}, +{14.9350, -9999.00, 0.934994}, +{15.1765, -9999.00, 0.910276}, +{15.4220, -9999.00, 0.886214}, +{15.6714, -9999.00, 0.862786}, +{15.9249, -9999.00, 0.839978}, +{16.1825, -9999.00, 0.817772}, +{16.4442, -9999.00, 0.797256}, +{16.7102, -9999.00, 0.778139}, +{16.9805, -9999.00, 0.759481}, +{17.2551, -9999.00, 0.741270}, +{17.5342, -9999.00, 0.723495}, +{17.8178, -9999.00, 0.706146}, +{18.1060, -9999.00, 0.689214}, +{18.3989, -9999.00, 0.672688}, +{18.6964, -9999.00, 0.659987}, +{18.9988, -9999.00, 0.648801}, +{19.3061, -9999.00, 0.638260}, +{19.6184, -9999.00, 0.650404}, +{19.9357, -9999.00, 0.679953}, +{20.2582, -9999.00, 0.797032}, +{20.5858, -9999.00, 1.13127}, +{20.9188, -9999.00, 1.44463}, +{21.2571, -9999.00, 1.68469}, +{21.6009, -9999.00, 1.79339}, +{21.9503, -9999.00, 1.78379}, +{22.3053, -9999.00, 1.78873}, +{22.6661, -9999.00, 1.85314}, +{23.0327, -9999.00, 2.02518}, +{23.4053, -9999.00, 2.32098}, +{23.7838, -9999.00, 2.81683}, +{24.1685, -9999.00, 4.27386}, +{24.5594, -9999.00, 12.2025}, +{24.9566, -9999.00, 14.1414}, +{25.3603, -9999.00, 15.0203}, +{25.7705, -9999.00, 15.3932}, +{26.1873, -9999.00, 15.7493}, +{26.6109, -9999.00, 15.9969}, +{27.0413, -9999.00, 16.0100}, +{27.4786, -9999.00, 15.9703}, +{27.9231, -9999.00, 15.9306}, +{28.3747, -9999.00, 15.8911}, +{28.8337, -9999.00, 15.8517}, +{29.3000, 9.51277, 15.3555}, +{29.7739, 10.3093, 14.8658}, +{30.2555, 10.9704, 14.3917}, +{30.7449, 11.5511, 13.9328}, +{31.2421, 12.0779, 13.4885}, +{31.7475, 12.5508, 13.0114}, +{32.2609, 12.9459, 12.5426}, +{32.7827, 13.2853, 12.0908}, +{33.3130, 13.5794, 11.6552}, +{33.8518, 13.8347, 11.2353}, +{34.3993, 14.0561, 10.8306}, +{34.9557, 14.2474, 10.4404}, +{35.5211, 14.4118, 10.0643}, +{36.0956, 14.5519, 9.70173}, +{36.6794, 14.6700, 9.35222}, +{37.2727, 14.7679, 9.01531}, +{37.8755, 14.8471, 8.69053}, +{38.4882, 14.9089, 8.37745}, +{39.1107, 14.9543, 8.07567}, +{39.7432, 14.9832, 7.78473}, +{40.3861, 14.9936, 7.50429}, +{41.0393, 14.9888, 7.24826}, +{41.7031, 14.9824, 7.00541}, +{42.3776, 14.9695, 6.77070}, +{43.0630, 14.9489, 6.54385}, +{43.7595, 14.9199, 6.32461}, +{44.4673, 14.8824, 6.11270}, +{45.1865, 14.8357, 5.90790}, +{45.9174, 14.7792, 5.70996}, +{46.6600, 14.7091, 5.51866}, +{47.4147, 14.6155, 5.34218}, +{48.1816, 14.5285, 5.19977}, +{48.9609, 14.4491, 5.06116}, +{49.7528, 14.3693, 4.92623}, +{50.5576, 14.2867, 4.79491}, +{51.3753, 14.1995, 4.66709}, +{52.2062, 14.1061, 4.54267}, +{53.0506, 14.0027, 4.42158}, +{53.9087, 13.8793, 4.30371}, +{54.7806, 13.7492, 4.23031}, +{55.6667, 13.6381, 4.16580}, +{56.5670, 13.5340, 4.10227}, +{57.4820, 13.4323, 4.03971}, +{58.4117, 13.3311, 3.97811}, +{59.3564, 13.2293, 3.91744}, +{60.3165, 13.1274, 3.85770}, +{61.2921, 13.0239, 3.79195}, +{62.2834, 12.9105, 3.72467}, +{63.2908, 12.7880, 3.65860}, +{64.3145, 12.6550, 3.59369}, +{65.3547, 12.5050, 3.52994}, +{66.4118, 12.3473, 3.49273}, +{67.4859, 12.1947, 3.45927}, +{68.5775, 12.0398, 3.42614}, +{69.6867, 11.8792, 3.39332}, +{70.8138, 11.7099, 3.36082}, +{71.9591, 11.5263, 3.32862}, +{73.1230, 11.3266, 3.31436}, +{74.3057, 11.1320, 3.31088}, +{75.5076, 10.9348, 3.30740}, +{76.7289, 10.7312, 3.30392}, +{77.9699, 10.5189, 3.30045}, +{79.2310, 10.2965, 3.29698}, +{80.5125, 10.0629, 3.29351}, +{81.8147, 9.81941, 3.29005}, +{83.1380, 9.56546, 3.27223}, +{84.4827, 9.27794, 3.24426}, +{85.8491, 8.95921, 3.21654}, +{87.2377, 8.60781, 3.18905}, +{88.6487, 8.21876, 3.16179}, +{90.0825, 7.77969, 3.14031}, +{91.5395, 7.30552, 3.13585}, +{93.0201, 6.78959, 3.13139}, +{94.5246, 6.21876, 3.12694}, +{96.0535, 5.58112, 3.12250}, +{97.6071, 4.86185, 3.11807}, +{99.1858, 4.04143, 3.11364}, +{100.790, 3.09272, 3.10921}, +{102.420, 1.97565, 3.10480}, +{104.077, 0.621654, 3.10039}, +{105.760, -1.12214, 3.10472}, +{107.471, -3.66291, 3.21631}, +{109.209, -7.18093, 7.64026}, +{110.975, -6.23020, 7.41665}, +{112.770, -9.00006, 7.09828}, +{114.594, -12.6272, 8.41926}, +{116.448, -16.9216, 10.0512}, +{118.331, -23.5851, 12.1216}, +{120.245, -39.2241, 21.9328}, +{122.190, -51.7708, 44.1119}, +{124.166, -19.7356, 77.7003}, +{126.175, 8.11330, 77.7355}, +{128.215, 23.7668, 67.1861}, +{130.289, 30.1202, 56.6110}, +{132.397, 33.3569, 50.3933}, +{134.538, 35.4313, 44.8583}, +{136.714, 36.7197, 40.7266}, +{138.925, 37.8197, 37.1906}, +{141.172, 38.6968, 33.9618}, +{143.456, 39.2228, 31.0132}, +{145.776, 39.5635, 28.5342}, +{148.134, 39.8373, 26.2695}, +{150.530, 40.0722, 24.1845}, +{152.964, 40.4028, 22.2456}, +{155.439, 40.4547, 19.8981}, +{157.953, 40.1564, 17.7984}, +{160.507, 39.5523, 15.9420}, +{163.103, 38.9137, 14.4725}, +{165.742, 38.2985, 13.1384}, +{168.422, 37.6418, 11.9310}, +{171.146, 36.9960, 10.9058}, +{173.915, 36.3736, 9.96875}, +{176.727, 35.8086, 9.11221}, +{179.586, 35.2097, 8.14682}, +{182.491, 34.3256, 7.36251}, +{185.442, 33.5005, 6.81011}, +{188.442, 32.7879, 6.43012}, +{191.489, 32.1674, 6.08629}, +{194.587, 31.6025, 5.72861}, +{197.734, 31.0204, 5.37495}, +{200.932, 30.3668, 5.04311}, +{204.182, 29.6587, 4.88899}, +{207.485, 29.0851, 4.85298}, +{210.840, 28.5802, 4.81723}, +{214.251, 28.0751, 4.78175}, +{217.716, 27.5909, 4.84427}, +{221.237, 27.1879, 4.94149}, +{224.816, 26.8333, 5.04071}, +{228.452, 26.5173, 5.15228}, +{232.147, 26.2347, 5.26633}, +{235.902, 25.9799, 5.38289}, +{239.717, 25.7482, 5.50204}, +{243.595, 25.5369, 5.62382}, +{247.535, 25.3436, 5.74830}, +{251.538, 25.1664, 5.87554}, +{255.607, 25.0036, 6.00559}, +{259.741, 24.8536, 6.13852}, +{263.942, 24.7146, 6.27439}, +{268.211, 24.5811, 6.41774}, +{272.549, 24.4632, 6.57150}, +{276.957, 24.3599, 6.72895}, +{281.437, 24.2674, 6.89017}, +{285.989, 24.1832, 7.05524}, +{290.615, 24.0969, 7.22463}, +{295.315, 24.0291, 7.43554}, +{300.092, 23.9895, 7.65262}, +{304.945, 23.9770, 7.87602}, +{309.878, 23.9919, 8.10594}, +{314.890, 24.0547, 8.34259}, +{319.983, 24.1511, 8.53385}, +{325.158, 24.2394, 8.70421}, +{330.418, 24.3346, 8.87796}, +{335.762, 24.4505, 9.05520}, +{341.192, 24.6205, 9.23597}, +{346.711, 24.7899, 9.31083}, +{352.319, 24.9317, 9.38263}, +{358.017, 25.0564, 9.45497}, +{363.808, 25.1773, 9.52788}, +{369.692, 25.2981, 9.60133}, +{375.672, 25.4225, 9.67537}, +{381.748, 25.5680, 9.74044}, +{387.922, 25.7027, 9.78223}, +{394.197, 25.8262, 9.82419}, +{400.573, 25.9484, 9.86634}, +{407.052, 26.0719, 9.90866}, +{413.635, 26.1994, 9.95117}, +{420.326, 26.3361, 9.99386}, +{427.124, 26.5026, 10.0367}, +{434.032, 26.6592, 10.0091}, +{441.052, 26.7916, 9.98048}, +{448.186, 26.9064, 9.95198}, +{455.435, 27.0116, 9.92355}, +{462.802, 27.1092, 9.89521}, +{470.287, 27.2004, 9.86695}, +{477.894, 27.2860, 9.83877}, +{485.623, 27.3667, 9.81067}, +{493.478, 27.4433, 9.78264}, +{501.459, 27.5159, 9.75447}, +{509.570, 27.5852, 9.72639}, +{517.812, 27.6517, 9.69838}, +{526.187, 27.7161, 9.67045}, +{534.698, 27.7797, 9.64262}, +{543.346, 27.8442, 9.61485}, +{552.134, 27.9122, 9.58717}, +{561.065, 28.0026, 9.55957}, +{570.139, 28.1207, 9.48629}, +{579.361, 28.1888, 9.35343}, +{588.732, 28.2168, 9.22244}, +{598.254, 28.2184, 9.09328}, +{607.930, 28.1973, 8.96593}, +{617.763, 28.1544, 8.84036}, +{627.755, 28.0865, 8.71655}, +{637.908, 27.9998, 8.60905}, +{648.226, 27.9011, 8.50652}, +{658.711, 27.7892, 8.40522}, +{669.365, 27.6606, 8.30512}, +{680.191, 27.5142, 8.20622}, +{691.193, 27.3492, 8.10849}, +{702.372, 27.1659, 8.01193}, +{713.733, 26.9730, 7.91652}, +{725.277, 26.7546, 7.78071}, +{737.008, 26.4807, 7.63111}, +{748.928, 26.1473, 7.48439}, +{761.042, 25.7588, 7.34049}, +{773.351, 25.3091, 7.19935}, +{785.859, 24.7893, 7.06093}, +{798.570, 24.1867, 6.92517}, +{811.486, 23.4837, 6.79202}, +{824.611, 22.6556, 6.66143}, +{837.949, 21.6648, 6.53335}, +{851.502, 20.4572, 6.41502}, +{865.274, 18.9522, 6.30445}, +{879.269, 16.9924, 6.19579}, +{893.491, 14.2483, 6.08900}, +{907.943, 9.84705, 5.98405}, +{922.628, -0.721609, 5.88091}, +{928.700, -37.3246, 5.83926}, +{928.900, -37.3125, 33.9113}, +{937.551, 2.83807, 33.7762}, +{952.715, 12.1674, 33.5436}, +{968.124, 16.9393, 33.3126}, +{983.783, 20.2583, 33.0832}, +{999.695, 22.8595, 32.8554}, +{1015.86, 25.0416, 32.6291}, +{1032.29, 26.9661, 32.4044}, +{1048.99, 28.7601, 32.1812}, +{1065.96, 30.5668, 31.7713}, +{1083.20, 32.0995, 31.0986}, +{1100.72, 33.3236, 30.4402}, +{1118.52, 34.3850, 29.7956}, +{1136.61, 35.3086, 29.1647}, +{1155.00, 36.1117, 28.5472}, +{1173.68, 36.8039, 27.9427}, +{1192.66, 37.3873, 27.3511}, +{1211.95, 37.8531, 26.7721}, +{1231.55, 38.1461, 26.2053}, +{1251.47, 38.2810, 25.8316}, +{1271.72, 38.3271, 25.6620}, +{1292.29, 38.5379, 25.7403}, +{1313.19, 38.8755, 25.8189}, +{1334.43, 39.2785, 25.8977}, +{1356.01, 39.7286, 25.9765}, +{1377.94, 40.2186, 26.0556}, +{1400.23, 40.7467, 26.1350}, +{1422.88, 41.3163, 26.2148}, +{1445.89, 41.9399, 26.2946}, +{1469.28, 42.6417, 26.3156}, +{1493.04, 43.2456, 26.2462}, +{1517.19, 44.0383, 26.4812}, +{1541.73, 45.1981, 26.4663}, +{1566.67, 46.1732, 25.9204}, +{1592.01, 46.9180, 25.3856}, +{1617.76, 47.5561, 24.8619}, +{1643.92, 48.1225, 24.3488}, +{1670.51, 48.6352, 23.8466}, +{1697.53, 49.1048, 23.3547}, +{1724.99, 49.5469, 22.8728}, +{1752.89, 49.9568, 22.3852}, +{1781.24, 50.3315, 21.9028}, +{1810.05, 50.6753, 21.4268}, +{1839.32, 50.9907, 20.9609}, +{1869.07, 51.2825, 20.5051}, +{1899.30, 51.5533, 20.0595}, +{1930.02, 51.8053, 19.6236}, +{1961.24, 52.0402, 19.1971}, +{1992.96, 52.2566, 18.7796}, +{2025.20, 52.4693, 18.3800}, +{2057.95, 52.6707, 17.9729}, +{2091.24, 52.8528, 17.5726}, +{2125.06, 53.0210, 17.1804}, +{2159.43, 53.1769, 16.7958}, +{2194.36, 53.3210, 16.4183}, +{2229.85, 53.4536, 16.0483}, +{2265.92, 53.5756, 15.6859}, +{2302.57, 53.6882, 15.3308}, +{2339.81, 53.7916, 14.9827}, +{2377.66, 53.8855, 14.6412}, +{2416.11, 53.9713, 14.3077}, +{2455.19, 54.0490, 13.9802}, +{2494.90, 54.1192, 13.6603}, +{2535.26, 54.1821, 13.3466}, +{2576.26, 54.2382, 13.0399}, +{2617.93, 54.2877, 12.7392}, +{2660.27, 54.3310, 12.4456}, +{2703.30, 54.3684, 12.1576}, +{2747.03, 54.3998, 11.8758}, +{2791.46, 54.4255, 11.6003}, +{2836.61, 54.4460, 11.3311}, +{2882.49, 54.4617, 11.0677}, +{2929.11, 54.4724, 10.8098}, +{2976.48, 54.4782, 10.5576}, +{3024.63, 54.4795, 10.3112}, +{3073.55, 54.4764, 10.0701}, +{3123.26, 54.4689, 9.83430}, +{3173.78, 54.4573, 9.60393}, +{3225.11, 54.4415, 9.37871}, +{3277.27, 54.4218, 9.15858}, +{3330.28, 54.3981, 8.94336}, +{3384.15, 54.3706, 8.73296}, +{3438.88, 54.3391, 8.52741}, +{3494.50, 54.3039, 8.32653}, +{3551.02, 54.2649, 8.13021}, +{3608.46, 54.2220, 7.93831}, +{3666.82, 54.1753, 7.75086}, +{3726.13, 54.1246, 7.56763}, +{3786.40, 54.0699, 7.38873}, +{3847.64, 54.0113, 7.21381}, +{3909.87, 53.9482, 7.04290}, +{3973.11, 53.8808, 6.87600}, +{4037.38, 53.8088, 6.71291}, +{4102.68, 53.7321, 6.55372}, +{4169.03, 53.6502, 6.39807}, +{4236.46, 53.5629, 6.24610}, +{4304.98, 53.4698, 6.09758}, +{4374.62, 53.3703, 5.95244}, +{4445.37, 53.2639, 5.81071}, +{4517.27, 53.1499, 5.67233}, +{4590.33, 53.0276, 5.53715}, +{4664.58, 52.8959, 5.40507}, +{4740.03, 52.7536, 5.27606}, +{4816.69, 52.5994, 5.15015}, +{4894.60, 52.4315, 5.02710}, +{4973.77, 52.2474, 4.90683}, +{5054.21, 52.0443, 4.78939}, +{5135.96, 51.8185, 4.67474}, +{5219.03, 51.5649, 4.56270}, +{5303.44, 51.2765, 4.45330}, +{5389.22, 50.9431, 4.34640}, +{5476.39, 50.5498, 4.24207}, +{5564.97, 50.0721, 4.14014}, +{5654.98, 49.4662, 4.04057}, +{5746.44, 48.6413, 3.94324}, +{5839.39, 47.3479, 3.84822}, +{5933.83, 44.1222, 3.75541}, +{5964.20, 31.0525, 3.72637}, +{5964.40, 31.0543, 10.9378}, +{6029.81, 45.9299, 10.7127}, +{6127.33, 47.8575, 10.3900}, +{6226.44, 48.5951, 10.0768}, +{6327.15, 48.6512, 9.77311}, +{6429.48, 46.5127, 9.47860}, +{6440.30, 41.0686, 9.44825}, +{6440.50, 41.0699, 13.1333}, +{6533.48, 49.4856, 12.8076}, +{6639.15, 50.6339, 12.4524}, +{6746.54, 51.1353, 12.1071}, +{6834.70, 48.3462, 11.8346}, +{6834.90, 48.3472, 13.3832}, +{6855.65, 51.0931, 13.3270}, +{6966.54, 52.5597, 13.0330}, +{7079.22, 53.3485, 12.7425}, +{7193.72, 53.9617, 12.4557}, +{7310.07, 54.4756, 12.1731}, +{7428.31, 54.9208, 11.8942}, +{7548.45, 55.3132, 11.6195}, +{7670.54, 55.6634, 11.3489}, +{7794.61, 55.9786, 11.0826}, +{7920.68, 56.2640, 10.8207}, +{8048.79, 56.5233, 10.5630}, +{8178.98, 56.7599, 10.3097}, +{8311.26, 56.9761, 10.0610}, +{8445.69, 57.1744, 9.81692}, +{8582.29, 57.3564, 9.57696}, +{8721.11, 57.5233, 9.34149}, +{8862.16, 57.6767, 9.11078}, +{9005.50, 57.8179, 8.88448}, +{9151.16, 57.9475, 8.66245}, +{9299.17, 58.0664, 8.44494}, +{9449.58, 58.1756, 8.23199}, +{9602.42, 58.2759, 8.02349}, +{9757.73, 58.3677, 7.81913}, +{9915.55, 58.4516, 7.61956}, +{10075.9, 58.5287, 7.42395}, +{10238.9, 58.5987, 7.23260}, +{10404.5, 58.6624, 7.04544}, +{10572.8, 58.7202, 6.86244}, +{10743.8, 58.7724, 6.68356}, +{10917.6, 58.8194, 6.50872}, +{11094.2, 58.8616, 6.33787}, +{11273.6, 58.8992, 6.17097}, +{11455.9, 58.9325, 6.00795}, +{11641.2, 58.9619, 5.84876}, +{11829.5, 58.9874, 5.69332}, +{12020.8, 59.0095, 5.54159}, +{12215.3, 59.0282, 5.39349}, +{12412.8, 59.0439, 5.24897}, +{12613.6, 59.0566, 5.10797}, +{12817.6, 59.0666, 4.97041}, +{13025.0, 59.0740, 4.83624}, +{13235.6, 59.0791, 4.70539}, +{13449.7, 59.0818, 4.57780}, +{13667.2, 59.0825, 4.45341}, +{13888.3, 59.0812, 4.33214}, +{14112.9, 59.0780, 4.21395}, +{14341.2, 59.0731, 4.09876}, +{14573.1, 59.0666, 3.98651}, +{14808.9, 59.0586, 3.87714}, +{15048.4, 59.0491, 3.77060}, +{15291.8, 59.0383, 3.66681}, +{15539.1, 59.0262, 3.56572}, +{15790.4, 59.0130, 3.46727}, +{16045.8, 58.9987, 3.37140}, +{16305.4, 58.9834, 3.27805}, +{16569.1, 58.9671, 3.18717}, +{16837.1, 58.9500, 3.09870}, +{17109.4, 58.9320, 3.01258}, +{17386.1, 58.9133, 2.92875}, +{17667.4, 58.8938, 2.84717}, +{17953.1, 58.8737, 2.76778}, +{18243.5, 58.8529, 2.69053}, +{18538.6, 58.8315, 2.61536}, +{18838.4, 58.8096, 2.54223}, +{19143.1, 58.7872, 2.47109}, +{19452.7, 58.7643, 2.40188}, +{19767.4, 58.7409, 2.33456}, +{20087.1, 58.7171, 2.26909}, +{20412.0, 58.6929, 2.20541}, +{20742.1, 58.6683, 2.14348}, +{21077.6, 58.6433, 2.08326}, +{21418.5, 58.6179, 2.02471}, +{21765.0, 58.5922, 1.96777}, +{22117.0, 58.5662, 1.91241}, +{22474.7, 58.5398, 1.85860}, +{22838.2, 58.5131, 1.80628}, +{23207.6, 58.4860, 1.75542}, +{23583.0, 58.4586, 1.70599}, +{23964.4, 58.4308, 1.65794}, +{24352.0, 58.4027, 1.61124}, +{24745.9, 58.3742, 1.56585}, +{25146.2, 58.3453, 1.52174}, +{25552.9, 58.3160, 1.47887}, +{25966.2, 58.2862, 1.43722}, +{26386.1, 58.2559, 1.39674}, +{26812.9, 58.2250, 1.35741}, +{27246.6, 58.1936, 1.31919}, +{27687.3, 58.1616, 1.28206}, +{28135.1, 58.1288, 1.24599}, +{28590.2, 58.0954, 1.21094}, +{29052.6, 58.0612, 1.17689}, +{29522.5, 58.0292, 1.14382}, +{30000.0, 57.9793, 1.11169}, +{0, 0, 0} +}; + +e_fp_fdp nd[] = { /* Z = 60 */ +{10.0000, -9999.00, 0.244484}, +{10.1617, -9999.00, 0.251766}, +{10.3261, -9999.00, 0.259264}, +{10.4931, -9999.00, 0.266985}, +{10.6628, -9999.00, 0.274936}, +{10.8353, -9999.00, 0.283124}, +{11.0106, -9999.00, 0.291556}, +{11.1886, -9999.00, 0.300239}, +{11.3696, -9999.00, 0.309181}, +{11.5535, -9999.00, 0.318389}, +{11.7404, -9999.00, 0.327872}, +{11.9303, -9999.00, 0.337636}, +{12.1232, -9999.00, 0.347692}, +{12.3193, -9999.00, 0.357177}, +{12.5186, -9999.00, 0.366207}, +{12.7210, -9999.00, 0.375466}, +{12.9268, -9999.00, 0.384959}, +{13.1359, -9999.00, 0.394692}, +{13.3483, -9999.00, 0.404671}, +{13.5642, -9999.00, 0.414903}, +{13.7836, -9999.00, 0.424290}, +{14.0066, -9999.00, 0.433803}, +{14.2331, -9999.00, 0.443529}, +{14.4633, -9999.00, 0.453472}, +{14.6973, -9999.00, 0.463640}, +{14.9350, -9999.00, 0.474034}, +{15.1765, -9999.00, 0.485487}, +{15.4220, -9999.00, 0.498133}, +{15.6714, -9999.00, 0.511107}, +{15.9249, -9999.00, 0.524420}, +{16.1825, -9999.00, 0.538079}, +{16.4442, -9999.00, 0.552094}, +{16.7102, -9999.00, 0.566475}, +{16.9805, -9999.00, 0.580606}, +{17.2551, -9999.00, 0.594768}, +{17.5342, -9999.00, 0.609276}, +{17.8178, -9999.00, 0.624137}, +{18.1060, -9999.00, 0.646684}, +{18.3989, -9999.00, 0.671013}, +{18.6964, -9999.00, 0.709249}, +{18.9988, -9999.00, 0.758040}, +{19.3061, -9999.00, 0.848453}, +{19.6184, -9999.00, 1.06744}, +{19.9357, -9999.00, 1.27332}, +{20.2582, -9999.00, 1.46377}, +{20.5858, -9999.00, 1.64680}, +{20.9188, -9999.00, 1.81237}, +{21.2571, -9999.00, 1.99459}, +{21.6009, -9999.00, 2.33527}, +{21.9503, -9999.00, 3.04612}, +{22.3053, -9999.00, 3.49011}, +{22.6661, -9999.00, 4.14142}, +{23.0327, -9999.00, 5.17605}, +{23.4053, -9999.00, 6.16114}, +{23.7838, -9999.00, 7.15928}, +{24.1685, -9999.00, 7.85158}, +{24.5594, -9999.00, 8.61083}, +{24.9566, -9999.00, 9.82334}, +{25.3603, -9999.00, 11.0464}, +{25.7705, -9999.00, 11.7224}, +{26.1873, -9999.00, 12.3365}, +{26.6109, -9999.00, 12.8042}, +{27.0413, -9999.00, 13.2404}, +{27.4786, -9999.00, 13.3190}, +{27.9231, -9999.00, 13.3981}, +{28.3747, -9999.00, 13.3420}, +{28.8337, -9999.00, 12.8943}, +{29.3000, 9.38600, 12.4615}, +{29.7739, 9.92147, 12.0196}, +{30.2555, 10.3493, 11.5894}, +{30.7449, 10.6922, 11.1779}, +{31.2421, 10.9616, 10.7826}, +{31.7475, 11.1396, 10.4013}, +{32.2609, 11.2595, 10.1485}, +{32.7827, 11.4084, 9.92065}, +{33.3130, 11.5515, 9.69789}, +{33.8518, 11.6623, 9.48734}, +{34.3993, 11.7735, 9.33629}, +{34.9557, 11.9008, 9.18765}, +{35.5211, 12.0344, 9.04138}, +{36.0956, 12.1723, 8.88657}, +{36.6794, 12.2960, 8.72676}, +{37.2727, 12.4115, 8.56983}, +{37.8755, 12.5214, 8.41250}, +{38.4882, 12.6266, 8.25626}, +{39.1107, 12.7408, 8.08883}, +{39.7432, 12.8214, 7.89087}, +{40.3861, 12.8685, 7.69774}, +{41.0393, 12.8849, 7.50934}, +{41.7031, 12.8713, 7.34780}, +{42.3776, 12.8431, 7.19795}, +{43.0630, 12.7673, 7.05117}, +{43.7595, 12.6944, 7.02900}, +{44.4673, 12.6718, 7.00998}, +{45.1865, 12.6724, 6.99101}, +{45.9174, 12.6906, 6.97211}, +{46.6600, 12.7209, 6.93785}, +{47.4147, 12.7460, 6.89798}, +{48.1816, 12.7695, 6.85834}, +{48.9609, 12.7922, 6.81893}, +{49.7528, 12.8136, 6.77974}, +{50.5576, 12.8330, 6.74078}, +{51.3753, 12.8486, 6.70509}, +{52.2062, 12.8662, 6.67271}, +{53.0506, 12.8841, 6.64049}, +{53.9087, 12.9015, 6.60842}, +{54.7806, 12.9180, 6.57633}, +{55.6667, 12.9328, 6.54395}, +{56.5670, 12.9458, 6.51174}, +{57.4820, 12.9567, 6.47968}, +{58.4117, 12.9654, 6.44778}, +{59.3564, 12.9716, 6.41605}, +{60.3165, 12.9753, 6.38446}, +{61.2921, 12.9761, 6.35303}, +{62.2834, 12.9738, 6.32176}, +{63.2908, 12.9684, 6.29064}, +{64.3145, 12.9594, 6.25967}, +{65.3547, 12.9468, 6.22886}, +{66.4118, 12.9302, 6.19820}, +{67.4859, 12.9094, 6.16769}, +{68.5775, 12.8840, 6.13732}, +{69.6867, 12.8537, 6.10711}, +{70.8138, 12.8184, 6.07750}, +{71.9591, 12.7779, 6.04806}, +{73.1230, 12.7317, 6.01877}, +{74.3057, 12.6796, 5.98962}, +{75.5076, 12.6209, 5.96062}, +{76.7289, 12.5555, 5.93176}, +{77.9699, 12.4829, 5.90303}, +{79.2310, 12.4029, 5.87444}, +{80.5125, 12.3158, 5.84599}, +{81.8147, 12.2237, 5.81768}, +{83.1380, 12.1331, 5.77593}, +{84.4827, 12.0138, 5.71854}, +{85.8491, 11.8713, 5.66173}, +{87.2377, 11.7075, 5.60548}, +{88.6487, 11.5218, 5.54979}, +{90.0825, 11.3128, 5.49464}, +{91.5395, 11.0804, 5.44005}, +{93.0201, 10.8322, 5.37899}, +{94.5246, 10.5314, 5.29125}, +{96.0535, 10.1552, 5.21216}, +{97.6071, 9.74159, 5.17421}, +{99.1858, 9.28917, 5.13654}, +{100.790, 8.77535, 5.10169}, +{102.420, 8.19357, 5.07562}, +{104.077, 7.52319, 5.04969}, +{105.760, 6.72969, 5.02390}, +{107.471, 5.77393, 5.01946}, +{109.209, 4.58498, 5.02246}, +{110.975, 2.83310, 5.02546}, +{112.770, 0.857600, 6.34994}, +{114.594, 0.349530E-01, 7.47349}, +{116.448, -0.675786, 7.69357}, +{118.331, -4.04398, 7.12416}, +{120.245, -10.2082, 10.0028}, +{122.190, -14.3529, 16.5170}, +{124.166, -15.9152, 25.8729}, +{126.175, -11.6855, 35.7180}, +{128.215, -6.26161, 40.4469}, +{130.289, 0.382138, 45.8018}, +{132.397, 8.66970, 47.3493}, +{134.538, 16.2755, 46.2231}, +{136.714, 21.6282, 43.8851}, +{138.925, 26.1873, 40.9195}, +{141.172, 29.2001, 37.5134}, +{143.456, 31.2653, 34.3906}, +{145.776, 32.6920, 31.5279}, +{148.134, 33.6528, 28.9762}, +{150.530, 34.3414, 26.6744}, +{152.964, 34.7930, 24.5554}, +{155.439, 35.0428, 22.6048}, +{157.953, 35.1084, 20.8092}, +{160.507, 35.0143, 19.2228}, +{163.103, 34.8648, 17.7999}, +{165.742, 34.6587, 16.4823}, +{168.422, 34.3782, 15.2622}, +{171.146, 34.0138, 14.1325}, +{173.915, 33.5219, 13.1544}, +{176.727, 33.0844, 12.3516}, +{179.586, 32.6523, 11.5978}, +{182.491, 32.1819, 10.8900}, +{185.442, 31.5751, 10.2892}, +{188.442, 31.0838, 9.94334}, +{191.489, 30.6804, 9.60909}, +{194.587, 30.3183, 9.28607}, +{197.734, 29.9697, 8.97391}, +{200.932, 29.6163, 8.67225}, +{204.182, 29.2257, 8.38072}, +{207.485, 28.7266, 8.22025}, +{210.840, 28.3514, 8.20320}, +{214.251, 28.0789, 8.18619}, +{217.716, 27.8481, 8.16921}, +{221.237, 27.6486, 8.15227}, +{224.816, 27.4731, 8.13536}, +{228.452, 27.3165, 8.11849}, +{232.147, 27.1748, 8.10165}, +{235.902, 27.0448, 8.08485}, +{239.717, 26.9237, 8.06808}, +{243.595, 26.8088, 8.05134}, +{247.535, 26.6972, 8.03465}, +{251.538, 26.5856, 8.01799}, +{255.607, 26.4686, 8.00136}, +{259.741, 26.3096, 7.98856}, +{263.942, 26.1707, 8.05993}, +{268.211, 26.0713, 8.13192}, +{272.549, 25.9910, 8.20457}, +{276.957, 25.9240, 8.27786}, +{281.437, 25.8672, 8.35180}, +{285.989, 25.8179, 8.42641}, +{290.615, 25.7734, 8.50168}, +{295.315, 25.7198, 8.57762}, +{300.092, 25.6718, 8.68811}, +{304.945, 25.6498, 8.80960}, +{309.878, 25.6460, 8.93279}, +{314.890, 25.6573, 9.05771}, +{319.983, 25.6830, 9.18437}, +{325.158, 25.7233, 9.31280}, +{330.418, 25.7800, 9.44303}, +{335.762, 25.8572, 9.57508}, +{341.192, 25.9758, 9.69649}, +{346.711, 26.0862, 9.77427}, +{352.319, 26.1919, 9.85266}, +{358.017, 26.3027, 9.93169}, +{363.808, 26.4281, 10.0113}, +{369.692, 26.5967, 10.0604}, +{375.672, 26.7369, 10.0599}, +{381.748, 26.8468, 10.0594}, +{387.922, 26.9463, 10.0589}, +{394.197, 27.0374, 10.0584}, +{400.573, 27.1210, 10.0578}, +{407.052, 27.1970, 10.0573}, +{413.635, 27.2634, 10.0568}, +{420.326, 27.3005, 10.0718}, +{427.124, 27.3546, 10.1197}, +{434.032, 27.4290, 10.1678}, +{441.052, 27.5121, 10.2162}, +{448.186, 27.6042, 10.2647}, +{455.435, 27.7062, 10.3136}, +{462.802, 27.8456, 10.3608}, +{470.287, 27.9763, 10.3491}, +{477.894, 28.0829, 10.3375}, +{485.623, 28.1802, 10.3258}, +{493.478, 28.2715, 10.3142}, +{501.459, 28.3583, 10.3025}, +{509.570, 28.4416, 10.2909}, +{517.812, 28.5222, 10.2794}, +{526.187, 28.6010, 10.2678}, +{534.698, 28.6787, 10.2562}, +{543.346, 28.7642, 10.2439}, +{552.134, 28.8435, 10.2138}, +{561.065, 28.9121, 10.1838}, +{570.139, 28.9752, 10.1538}, +{579.361, 29.0341, 10.1239}, +{588.732, 29.0899, 10.0942}, +{598.254, 29.1441, 10.0645}, +{607.930, 29.1988, 10.0349}, +{617.763, 29.2629, 10.0053}, +{627.755, 29.3541, 9.95322}, +{637.908, 29.4087, 9.84658}, +{648.226, 29.4301, 9.74109}, +{658.711, 29.4299, 9.63673}, +{669.365, 29.4114, 9.53348}, +{680.191, 29.3763, 9.43135}, +{691.193, 29.3255, 9.33031}, +{702.372, 29.2636, 9.23034}, +{713.733, 29.1962, 9.12004}, +{725.277, 29.0937, 8.98659}, +{737.008, 28.9565, 8.85510}, +{748.928, 28.7880, 8.72553}, +{761.042, 28.5873, 8.59787}, +{773.351, 28.3520, 8.47206}, +{785.859, 28.0785, 8.34810}, +{798.570, 27.7613, 8.22595}, +{811.486, 27.3907, 8.10559}, +{824.611, 26.9618, 8.00244}, +{837.949, 26.4780, 7.90943}, +{851.502, 25.9263, 7.81610}, +{865.274, 25.2829, 7.72213}, +{879.269, 24.5191, 7.62775}, +{893.491, 23.5963, 7.53470}, +{907.943, 22.4533, 7.44273}, +{922.628, 20.9847, 7.35182}, +{937.551, 18.9853, 7.26190}, +{952.715, 15.9668, 7.17320}, +{968.124, 10.1461, 7.08567}, +{980.300, -25.8273, 7.01823}, +{980.500, -25.8174, 30.7219}, +{983.783, 0.859304, 30.6554}, +{999.695, 14.3488, 30.3385}, +{1015.86, 19.2163, 30.0249}, +{1032.29, 22.3241, 29.7144}, +{1048.99, 24.6368, 29.4026}, +{1065.96, 26.4843, 29.0894}, +{1083.20, 28.0232, 28.7791}, +{1100.72, 29.3419, 28.4723}, +{1118.52, 30.4927, 28.1687}, +{1136.61, 31.5091, 27.8684}, +{1155.00, 32.4129, 27.5713}, +{1173.68, 33.2178, 27.2773}, +{1192.66, 33.9308, 26.9865}, +{1211.95, 34.5560, 26.6988}, +{1231.55, 35.0253, 26.4141}, +{1251.47, 35.4044, 26.2596}, +{1271.72, 35.7000, 26.2460}, +{1292.29, 36.0786, 26.4066}, +{1313.19, 36.5792, 26.5685}, +{1334.43, 37.1219, 26.7313}, +{1356.01, 37.7021, 26.8951}, +{1377.94, 38.3188, 27.0598}, +{1400.23, 38.9752, 27.2255}, +{1422.88, 39.6786, 27.3925}, +{1445.89, 40.4682, 27.5602}, +{1469.28, 41.3426, 27.6703}, +{1493.04, 42.4056, 27.6910}, +{1517.19, 43.3936, 27.3355}, +{1541.73, 44.1311, 26.9327}, +{1566.67, 44.5910, 26.5355}, +{1592.01, 45.2242, 26.6854}, +{1617.76, 46.2797, 26.6496}, +{1643.92, 47.2114, 26.0927}, +{1670.51, 47.9308, 25.5476}, +{1697.53, 48.5550, 25.0139}, +{1724.99, 49.1179, 24.4911}, +{1752.89, 49.6298, 23.9680}, +{1781.24, 50.0955, 23.4524}, +{1810.05, 50.5201, 22.9454}, +{1839.32, 50.9101, 22.4491}, +{1869.07, 51.2701, 21.9636}, +{1899.30, 51.6038, 21.4888}, +{1930.02, 51.9139, 21.0240}, +{1961.24, 52.2032, 20.5692}, +{1992.96, 52.4700, 20.1243}, +{2025.20, 52.7263, 19.6972}, +{2057.95, 52.9696, 19.2645}, +{2091.24, 53.1932, 18.8393}, +{2125.06, 53.3999, 18.4230}, +{2159.43, 53.5920, 18.0145}, +{2194.36, 53.7704, 17.6142}, +{2229.85, 53.9359, 17.2215}, +{2265.92, 54.0892, 16.8368}, +{2302.57, 54.2311, 16.4598}, +{2339.81, 54.3625, 16.0907}, +{2377.66, 54.4839, 15.7286}, +{2416.11, 54.5951, 15.3739}, +{2455.19, 54.6974, 15.0270}, +{2494.90, 54.7909, 14.6870}, +{2535.26, 54.8765, 14.3546}, +{2576.26, 54.9545, 14.0286}, +{2617.93, 55.0249, 13.7097}, +{2660.27, 55.0883, 13.3972}, +{2703.30, 55.1450, 13.0916}, +{2747.03, 55.1951, 12.7922}, +{2791.46, 55.2391, 12.4994}, +{2836.61, 55.2772, 12.2128}, +{2882.49, 55.3096, 11.9324}, +{2929.11, 55.3365, 11.6580}, +{2976.48, 55.3583, 11.3898}, +{3024.63, 55.3751, 11.1271}, +{3073.55, 55.3871, 10.8703}, +{3123.26, 55.3946, 10.6191}, +{3173.78, 55.3974, 10.3730}, +{3225.11, 55.3957, 10.1325}, +{3277.27, 55.3897, 9.89734}, +{3330.28, 55.3796, 9.66730}, +{3384.15, 55.3654, 9.44227}, +{3438.88, 55.3471, 9.22229}, +{3494.50, 55.3249, 9.00711}, +{3551.02, 55.2987, 8.79672}, +{3608.46, 55.2687, 8.59094}, +{3666.82, 55.2348, 8.38972}, +{3726.13, 55.1969, 8.19303}, +{3786.40, 55.1552, 8.00057}, +{3847.64, 55.1095, 7.81246}, +{3909.87, 55.0596, 7.62852}, +{3973.11, 55.0057, 7.44875}, +{4037.38, 54.9476, 7.27286}, +{4102.68, 54.8850, 7.10092}, +{4169.03, 54.8178, 6.93282}, +{4236.46, 54.7458, 6.76845}, +{4304.98, 54.6687, 6.60781}, +{4374.62, 54.5863, 6.45068}, +{4445.37, 54.4981, 6.29709}, +{4517.27, 54.4036, 6.14683}, +{4590.33, 54.3024, 6.00002}, +{4664.58, 54.1939, 5.85642}, +{4740.03, 54.0771, 5.71608}, +{4816.69, 53.9515, 5.57886}, +{4894.60, 53.8157, 5.44470}, +{4973.77, 53.6686, 5.31339}, +{5054.21, 53.5083, 5.18514}, +{5135.96, 53.3329, 5.05973}, +{5219.03, 53.1399, 4.93713}, +{5303.44, 52.9259, 4.81724}, +{5389.22, 52.6865, 4.69991}, +{5476.39, 52.4157, 4.58522}, +{5564.97, 52.1050, 4.47313}, +{5654.98, 51.7422, 4.36354}, +{5746.44, 51.3081, 4.25634}, +{5839.39, 50.7700, 4.15152}, +{5933.83, 50.0657, 4.04902}, +{6029.81, 49.0497, 3.94875}, +{6127.33, 47.2044, 3.85081}, +{6207.80, 31.7487, 3.77297}, +{6208.00, 31.7498, 11.0531}, +{6226.44, 43.8759, 10.9923}, +{6327.15, 48.1261, 10.6691}, +{6429.48, 49.3300, 10.3557}, +{6533.48, 49.7840, 10.0514}, +{6639.15, 49.5221, 9.75605}, +{6721.40, 42.2022, 9.53530}, +{6721.60, 42.2035, 13.1642}, +{6746.54, 48.7031, 13.0766}, +{6855.65, 51.0062, 12.7039}, +{6966.54, 51.8556, 12.3419}, +{7079.22, 52.0080, 11.9902}, +{7125.90, 49.0533, 11.8491}, +{7126.10, 49.0562, 13.5465}, +{7193.72, 52.8043, 13.3659}, +{7310.07, 53.8693, 13.0645}, +{7428.31, 54.5943, 12.7674}, +{7548.45, 55.1767, 12.4744}, +{7670.54, 55.6703, 12.1855}, +{7794.61, 56.0998, 11.9013}, +{7920.68, 56.4798, 11.6218}, +{8048.79, 56.8197, 11.3465}, +{8178.98, 57.1254, 11.0758}, +{8311.26, 57.4023, 10.8099}, +{8445.69, 57.6540, 10.5490}, +{8582.29, 57.8837, 10.2925}, +{8721.11, 58.0935, 10.0406}, +{8862.16, 58.2855, 9.79365}, +{9005.50, 58.4615, 9.55146}, +{9151.16, 58.6230, 9.31408}, +{9299.17, 58.7712, 9.08115}, +{9449.58, 58.9072, 8.85304}, +{9602.42, 59.0320, 8.62965}, +{9757.73, 59.1464, 8.41092}, +{9915.55, 59.2514, 8.19703}, +{10075.9, 59.3478, 7.98739}, +{10238.9, 59.4357, 7.78227}, +{10404.5, 59.5160, 7.58162}, +{10572.8, 59.5891, 7.38539}, +{10743.8, 59.6556, 7.19353}, +{10917.6, 59.7160, 7.00599}, +{11094.2, 59.7705, 6.82271}, +{11273.6, 59.8196, 6.64362}, +{11455.9, 59.8637, 6.46868}, +{11641.2, 59.9030, 6.29781}, +{11829.5, 59.9378, 6.13096}, +{12020.8, 59.9685, 5.96805}, +{12215.3, 59.9954, 5.80903}, +{12412.8, 60.0185, 5.65384}, +{12613.6, 60.0382, 5.50239}, +{12817.6, 60.0548, 5.35463}, +{13025.0, 60.0683, 5.21049}, +{13235.6, 60.0790, 5.06991}, +{13449.7, 60.0870, 4.93281}, +{13667.2, 60.0926, 4.79912}, +{13888.3, 60.0958, 4.66879}, +{14112.9, 60.0969, 4.54173}, +{14341.2, 60.0959, 4.41790}, +{14573.1, 60.0931, 4.29722}, +{14808.9, 60.0884, 4.17962}, +{15048.4, 60.0821, 4.06505}, +{15291.8, 60.0742, 3.95343}, +{15539.1, 60.0648, 3.84470}, +{15790.4, 60.0541, 3.73880}, +{16045.8, 60.0421, 3.63566}, +{16305.4, 60.0290, 3.53523}, +{16569.1, 60.0147, 3.43744}, +{16837.1, 59.9993, 3.34224}, +{17109.4, 59.9830, 3.24956}, +{17386.1, 59.9658, 3.15934}, +{17667.4, 59.9478, 3.07153}, +{17953.1, 59.9289, 2.98607}, +{18243.5, 59.9094, 2.90290}, +{18538.6, 59.8891, 2.82197}, +{18838.4, 59.8682, 2.74323}, +{19143.1, 59.8468, 2.66662}, +{19452.7, 59.8247, 2.59209}, +{19767.4, 59.8022, 2.51959}, +{20087.1, 59.7791, 2.44907}, +{20412.0, 59.7556, 2.38048}, +{20742.1, 59.7317, 2.31377}, +{21077.6, 59.7073, 2.24889}, +{21418.5, 59.6826, 2.18580}, +{21765.0, 59.6574, 2.12446}, +{22117.0, 59.6320, 2.06481}, +{22474.7, 59.6061, 2.00681}, +{22838.2, 59.5800, 1.95043}, +{23207.6, 59.5535, 1.89562}, +{23583.0, 59.5267, 1.84233}, +{23964.4, 59.4995, 1.79053}, +{24352.0, 59.4720, 1.74019}, +{24745.9, 59.4442, 1.69125}, +{25146.2, 59.4160, 1.64369}, +{25552.9, 59.3875, 1.59747}, +{25966.2, 59.3585, 1.55255}, +{26386.1, 59.3292, 1.50889}, +{26812.9, 59.2994, 1.46647}, +{27246.6, 59.2691, 1.42525}, +{27687.3, 59.2384, 1.38520}, +{28135.1, 59.2070, 1.34629}, +{28590.2, 59.1751, 1.30848}, +{29052.6, 59.1425, 1.27175}, +{29522.5, 59.1091, 1.23606}, +{30000.0, 59.0749, 1.20139}, +{0, 0, 0} +}; + +} // namespace table_data + +}}} // namespace cctbx::eltbx::henke diff --git a/extern/cctbx/cctbx/eltbx/henke_tables_61_72.cpp b/extern/cctbx/cctbx/eltbx/henke_tables_61_72.cpp new file mode 100644 index 00000000..24cee71a --- /dev/null +++ b/extern/cctbx/cctbx/eltbx/henke_tables_61_72.cpp @@ -0,0 +1,6223 @@ +/* ***************************************************** + THIS IS AN AUTOMATICALLY GENERATED FILE. DO NOT EDIT. + ***************************************************** + + Generated by: + cctbx.source_generators.eltbx.generate_henke_cpp + */ + +#include + +namespace cctbx { namespace eltbx { namespace henke { + +namespace table_data { + +using anomalous::e_fp_fdp; + +e_fp_fdp pm[] = { /* Z = 61 */ +{10.0000, -9999.00, 0.216409}, +{10.1617, -9999.00, 0.224290}, +{10.3261, -9999.00, 0.232458}, +{10.4931, -9999.00, 0.240924}, +{10.6628, -9999.00, 0.249698}, +{10.8353, -9999.00, 0.258791}, +{11.0106, -9999.00, 0.268216}, +{11.1886, -9999.00, 0.277984}, +{11.3696, -9999.00, 0.288107}, +{11.5535, -9999.00, 0.298599}, +{11.7404, -9999.00, 0.309474}, +{11.9303, -9999.00, 0.320744}, +{12.1232, -9999.00, 0.332425}, +{12.3193, -9999.00, 0.342577}, +{12.5186, -9999.00, 0.351995}, +{12.7210, -9999.00, 0.361672}, +{12.9268, -9999.00, 0.371615}, +{13.1359, -9999.00, 0.381831}, +{13.3483, -9999.00, 0.392328}, +{13.5642, -9999.00, 0.403114}, +{13.7836, -9999.00, 0.413580}, +{14.0066, -9999.00, 0.422763}, +{14.2331, -9999.00, 0.432149}, +{14.4633, -9999.00, 0.441745}, +{14.6973, -9999.00, 0.454608}, +{14.9350, -9999.00, 0.467940}, +{15.1765, -9999.00, 0.481663}, +{15.4220, -9999.00, 0.495789}, +{15.6714, -9999.00, 0.510328}, +{15.9249, -9999.00, 0.525294}, +{16.1825, -9999.00, 0.540699}, +{16.4442, -9999.00, 0.557512}, +{16.7102, -9999.00, 0.575659}, +{16.9805, -9999.00, 0.594396}, +{17.2551, -9999.00, 0.613743}, +{17.5342, -9999.00, 0.635334}, +{17.8178, -9999.00, 0.669871}, +{18.1060, -9999.00, 0.706284}, +{18.3989, -9999.00, 0.744677}, +{18.6964, -9999.00, 0.797210}, +{18.9988, -9999.00, 0.886072}, +{19.3061, -9999.00, 0.984840}, +{19.6184, -9999.00, 1.11359}, +{19.9357, -9999.00, 1.35765}, +{20.2582, -9999.00, 1.65520}, +{20.5858, -9999.00, 2.03967}, +{20.9188, -9999.00, 2.62362}, +{21.2571, -9999.00, 3.22731}, +{21.6009, -9999.00, 3.82803}, +{21.9503, -9999.00, 4.54056}, +{22.3053, -9999.00, 5.39840}, +{22.6661, -9999.00, 6.42938}, +{23.0327, -9999.00, 7.59968}, +{23.4053, -9999.00, 8.88775}, +{23.7838, -9999.00, 10.3218}, +{24.1685, -9999.00, 11.9352}, +{24.5594, -9999.00, 12.9530}, +{24.9566, -9999.00, 13.6096}, +{25.3603, -9999.00, 14.2995}, +{25.7705, -9999.00, 14.6770}, +{26.1873, -9999.00, 14.9654}, +{26.6109, -9999.00, 15.2594}, +{27.0413, -9999.00, 15.4623}, +{27.4786, -9999.00, 15.1782}, +{27.9231, -9999.00, 14.8994}, +{28.3747, -9999.00, 14.6256}, +{28.8337, -9999.00, 14.3569}, +{29.3000, 8.45615, 14.0932}, +{29.7739, 9.08674, 13.7903}, +{30.2555, 9.62563, 13.4041}, +{30.7449, 10.0872, 13.0287}, +{31.2421, 10.4990, 12.6638}, +{31.7475, 10.8837, 12.3092}, +{32.2609, 11.2703, 11.9645}, +{32.7827, 11.6222, 11.5060}, +{33.3130, 11.8689, 11.0499}, +{33.8518, 12.0472, 10.6119}, +{34.3993, 12.1621, 10.1913}, +{34.9557, 12.1930, 9.82892}, +{35.5211, 12.2432, 9.54370}, +{36.0956, 12.2969, 9.26675}, +{36.6794, 12.3407, 8.99784}, +{37.2727, 12.3646, 8.73673}, +{37.8755, 12.3543, 8.48321}, +{38.4882, 12.3351, 8.30142}, +{39.1107, 12.3359, 8.12735}, +{39.7432, 12.3395, 7.95692}, +{40.3861, 12.3397, 7.79007}, +{41.0393, 12.3331, 7.62671}, +{41.7031, 12.3160, 7.46678}, +{42.3776, 12.2767, 7.31020}, +{43.0630, 12.1873, 7.19367}, +{43.7595, 12.1414, 7.13115}, +{44.4673, 12.1209, 7.06918}, +{45.1865, 12.1102, 7.00775}, +{45.9174, 12.1063, 6.94686}, +{46.6600, 12.1090, 6.88559}, +{47.4147, 12.1123, 6.81833}, +{48.1816, 12.1138, 6.75173}, +{48.9609, 12.1138, 6.68578}, +{49.7528, 12.1123, 6.62047}, +{50.5576, 12.1090, 6.55580}, +{51.3753, 12.1038, 6.49176}, +{52.2062, 12.0970, 6.42675}, +{53.0506, 12.0846, 6.36093}, +{53.9087, 12.0665, 6.29579}, +{54.7806, 12.0411, 6.23133}, +{55.6667, 12.0031, 6.16750}, +{56.5670, 11.9579, 6.12616}, +{57.4820, 11.9206, 6.09029}, +{58.4117, 11.8836, 6.05465}, +{59.3564, 11.8412, 6.01921}, +{60.3165, 11.7976, 5.99766}, +{61.2921, 11.7590, 5.97768}, +{62.2834, 11.7215, 5.95777}, +{63.2908, 11.6833, 5.93793}, +{64.3145, 11.6437, 5.91815}, +{65.3547, 11.6018, 5.89843}, +{66.4118, 11.5571, 5.87879}, +{67.4859, 11.5088, 5.85920}, +{68.5775, 11.4556, 5.83969}, +{69.6867, 11.3958, 5.82396}, +{70.8138, 11.3352, 5.81106}, +{71.9591, 11.2719, 5.79819}, +{73.1230, 11.2046, 5.78535}, +{74.3057, 11.1325, 5.77254}, +{75.5076, 11.0551, 5.75976}, +{76.7289, 10.9718, 5.74701}, +{77.9699, 10.8822, 5.73427}, +{79.2310, 10.7859, 5.72158}, +{80.5125, 10.6825, 5.70890}, +{81.8147, 10.5726, 5.69627}, +{83.1380, 10.4605, 5.68365}, +{84.4827, 10.3360, 5.64880}, +{85.8491, 10.1889, 5.61309}, +{87.2377, 10.0212, 5.57760}, +{88.6487, 9.83378, 5.54234}, +{90.0825, 9.62541, 5.50730}, +{91.5395, 9.39424, 5.47248}, +{93.0201, 9.13798, 5.43788}, +{94.5246, 8.85386, 5.40350}, +{96.0535, 8.53861, 5.36934}, +{97.6071, 8.18845, 5.33539}, +{99.1858, 7.79915, 5.30166}, +{100.790, 7.36771, 5.26814}, +{102.420, 6.90213, 5.23483}, +{104.077, 6.37205, 5.14058}, +{105.760, 5.71711, 5.03015}, +{107.471, 4.93525, 4.92209}, +{109.209, 4.00708, 4.81635}, +{110.975, 2.89932, 4.70689}, +{112.770, 1.53841, 4.59202}, +{114.594, -0.187683, 4.51662}, +{116.448, -2.29892, 4.51673}, +{118.331, -5.05465, 4.51684}, +{120.245, -9.05336, 4.57800}, +{122.190, -15.5338, 4.99732}, +{124.166, -27.3019, 10.2291}, +{126.175, -38.8972, 26.5721}, +{128.215, -22.7101, 57.1104}, +{130.289, -4.71095, 56.8664}, +{132.397, 7.37775, 54.5017}, +{134.538, 14.8744, 50.2126}, +{136.714, 19.5442, 46.2611}, +{138.925, 22.6048, 42.6859}, +{141.172, 24.9585, 40.0198}, +{143.456, 26.9095, 37.5202}, +{145.776, 28.5041, 35.1767}, +{148.134, 29.7677, 32.9797}, +{150.530, 30.7368, 30.9198}, +{152.964, 31.4670, 29.0538}, +{155.439, 32.0637, 27.3351}, +{157.953, 32.5279, 25.7179}, +{160.507, 32.8699, 24.1965}, +{163.103, 33.1022, 22.7650}, +{165.742, 33.2365, 21.4183}, +{168.422, 33.2810, 20.1511}, +{171.146, 33.2415, 18.9590}, +{173.915, 33.1172, 17.8374}, +{176.727, 32.8936, 16.7822}, +{179.586, 32.4733, 15.8826}, +{182.491, 32.1736, 15.2489}, +{185.442, 31.9417, 14.6406}, +{188.442, 31.7317, 14.0564}, +{191.489, 31.5248, 13.4956}, +{194.587, 31.3114, 12.9571}, +{197.734, 31.0838, 12.4402}, +{200.932, 30.8342, 11.9438}, +{204.182, 30.5489, 11.4673}, +{207.485, 30.1287, 11.0440}, +{210.840, 29.7770, 10.8367}, +{214.251, 29.5185, 10.6332}, +{217.716, 29.2917, 10.4336}, +{221.237, 29.0816, 10.2377}, +{224.816, 28.8784, 10.0455}, +{228.452, 28.6735, 9.85694}, +{232.147, 28.4565, 9.67188}, +{235.902, 28.1793, 9.49030}, +{239.717, 27.8855, 9.43913}, +{243.595, 27.6702, 9.43755}, +{247.535, 27.4975, 9.43598}, +{251.538, 27.3493, 9.43439}, +{255.607, 27.2174, 9.43282}, +{259.741, 27.0960, 9.43124}, +{263.942, 26.9801, 9.42967}, +{268.211, 26.8635, 9.42810}, +{272.549, 26.7317, 9.42652}, +{276.957, 26.5625, 9.47945}, +{281.437, 26.4420, 9.58710}, +{285.989, 26.3664, 9.69597}, +{290.615, 26.3123, 9.80607}, +{295.315, 26.2762, 9.91744}, +{300.092, 26.2559, 10.0301}, +{304.945, 26.2498, 10.1440}, +{309.878, 26.2572, 10.2591}, +{314.890, 26.2774, 10.3756}, +{319.983, 26.3101, 10.4935}, +{325.158, 26.3555, 10.6126}, +{330.418, 26.4139, 10.7332}, +{335.762, 26.4861, 10.8550}, +{341.192, 26.5740, 10.9783}, +{346.711, 26.6814, 11.1030}, +{352.319, 26.8260, 11.2224}, +{358.017, 26.9696, 11.2973}, +{363.808, 27.1102, 11.3728}, +{369.692, 27.2560, 11.4487}, +{375.672, 27.4145, 11.5251}, +{381.748, 27.5954, 11.6020}, +{387.922, 27.8375, 11.6794}, +{394.197, 28.0709, 11.6206}, +{400.573, 28.2572, 11.5534}, +{407.052, 28.4085, 11.4865}, +{413.635, 28.5414, 11.4200}, +{420.326, 28.6587, 11.3539}, +{427.124, 28.7616, 11.2882}, +{434.032, 28.8314, 11.2230}, +{441.052, 28.9023, 11.2044}, +{448.186, 28.9877, 11.1857}, +{455.435, 29.0773, 11.1671}, +{462.802, 29.1689, 11.1485}, +{470.287, 29.2621, 11.1300}, +{477.894, 29.3567, 11.1114}, +{485.623, 29.4535, 11.0929}, +{493.478, 29.5539, 11.0745}, +{501.459, 29.6632, 11.0560}, +{509.570, 29.7807, 11.0183}, +{517.812, 29.8915, 10.9676}, +{526.187, 29.9937, 10.9115}, +{534.698, 30.0897, 10.8456}, +{543.346, 30.1737, 10.7751}, +{552.134, 30.2509, 10.7052}, +{561.065, 30.3220, 10.6290}, +{570.139, 30.3830, 10.5501}, +{579.361, 30.4340, 10.4711}, +{588.732, 30.4770, 10.3925}, +{598.254, 30.5125, 10.3145}, +{607.930, 30.5412, 10.2372}, +{617.763, 30.5640, 10.1604}, +{627.755, 30.5835, 10.0836}, +{637.908, 30.5985, 10.0001}, +{648.226, 30.6040, 9.90672}, +{658.711, 30.5898, 9.80720}, +{669.365, 30.5551, 9.70863}, +{680.191, 30.5019, 9.62524}, +{691.193, 30.4457, 9.55332}, +{702.372, 30.3959, 9.48314}, +{713.733, 30.3410, 9.39624}, +{725.277, 30.2625, 9.29832}, +{737.008, 30.1630, 9.20140}, +{748.928, 30.0444, 9.10546}, +{761.042, 29.9068, 9.01035}, +{773.351, 29.7502, 8.91471}, +{785.859, 29.5710, 8.81474}, +{798.570, 29.3613, 8.71151}, +{811.486, 29.1193, 8.60958}, +{824.611, 28.8427, 8.50874}, +{837.949, 28.5276, 8.40898}, +{851.502, 28.1681, 8.30883}, +{865.274, 27.7560, 8.20775}, +{879.269, 27.2792, 8.10604}, +{893.491, 26.7251, 8.00569}, +{907.943, 26.0762, 7.90664}, +{922.628, 25.3084, 7.80888}, +{937.551, 24.3802, 7.70707}, +{952.715, 23.2288, 7.60544}, +{968.124, 21.7470, 7.50418}, +{983.783, 19.7266, 7.40404}, +{999.695, 16.6575, 7.30526}, +{1015.86, 10.4971, 7.20783}, +{1026.80, -21.7185, 7.14352}, +{1027.00, -21.7164, 28.7355}, +{1032.29, 5.61243, 28.7481}, +{1048.99, 15.3585, 28.7874}, +{1065.96, 19.3789, 28.8269}, +{1083.20, 22.0202, 28.8662}, +{1100.72, 24.0292, 28.9056}, +{1118.52, 25.6767, 28.9450}, +{1136.61, 27.0919, 28.9844}, +{1155.00, 28.3467, 29.0239}, +{1173.68, 29.4853, 29.0635}, +{1192.66, 30.5373, 29.1032}, +{1211.95, 31.5232, 29.1429}, +{1231.55, 32.4583, 29.1829}, +{1251.47, 33.3542, 29.2227}, +{1271.72, 34.2203, 29.2624}, +{1292.29, 35.0641, 29.3022}, +{1313.19, 35.8931, 29.3423}, +{1334.43, 36.7142, 29.3824}, +{1356.01, 37.5335, 29.4221}, +{1377.94, 38.3587, 29.4624}, +{1400.23, 39.1997, 29.5027}, +{1422.88, 40.0705, 29.5429}, +{1445.89, 41.0000, 29.5832}, +{1469.28, 42.0467, 29.5578}, +{1493.04, 43.2259, 29.4322}, +{1517.19, 44.2904, 28.8901}, +{1541.73, 45.1410, 28.3009}, +{1566.67, 45.8092, 27.7236}, +{1592.01, 46.3196, 27.1582}, +{1617.76, 46.5234, 26.8739}, +{1643.92, 47.1862, 27.1221}, +{1670.51, 48.1538, 26.6954}, +{1697.53, 48.9244, 26.1554}, +{1724.99, 49.5444, 25.6264}, +{1752.89, 50.1026, 25.0944}, +{1781.24, 50.6061, 24.5687}, +{1810.05, 51.0648, 24.0502}, +{1839.32, 51.4851, 23.5429}, +{1869.07, 51.8739, 23.0464}, +{1899.30, 52.2351, 22.5603}, +{1930.02, 52.5718, 22.0844}, +{1961.24, 52.8862, 21.6187}, +{1992.96, 53.1777, 21.1629}, +{2025.20, 53.4649, 20.7267}, +{2057.95, 53.7374, 20.2788}, +{2091.24, 53.9859, 19.8383}, +{2125.06, 54.2171, 19.4056}, +{2159.43, 54.4321, 18.9804}, +{2194.36, 54.6325, 18.5634}, +{2229.85, 54.8190, 18.1537}, +{2265.92, 54.9924, 17.7520}, +{2302.57, 55.1538, 17.3576}, +{2339.81, 55.3033, 16.9707}, +{2377.66, 55.4419, 16.5915}, +{2416.11, 55.5701, 16.2196}, +{2455.19, 55.6887, 15.8552}, +{2494.90, 55.7976, 15.4973}, +{2535.26, 55.8975, 15.1473}, +{2576.26, 55.9892, 14.8043}, +{2617.93, 56.0730, 14.4680}, +{2660.27, 56.1490, 14.1383}, +{2703.30, 56.2172, 13.8154}, +{2747.03, 56.2784, 13.4997}, +{2791.46, 56.3333, 13.1904}, +{2836.61, 56.3814, 12.8873}, +{2882.49, 56.4238, 12.5913}, +{2929.11, 56.4606, 12.3008}, +{2976.48, 56.4911, 12.0163}, +{3024.63, 56.5162, 11.7387}, +{3073.55, 56.5365, 11.4666}, +{3123.26, 56.5516, 11.2001}, +{3173.78, 56.5617, 10.9398}, +{3225.11, 56.5673, 10.6851}, +{3277.27, 56.5684, 10.4359}, +{3330.28, 56.5650, 10.1922}, +{3384.15, 56.5575, 9.95373}, +{3438.88, 56.5457, 9.72056}, +{3494.50, 56.5299, 9.49256}, +{3551.02, 56.5101, 9.26961}, +{3608.46, 56.4864, 9.05160}, +{3666.82, 56.4589, 8.83845}, +{3726.13, 56.4274, 8.63000}, +{3786.40, 56.3922, 8.42630}, +{3847.64, 56.3532, 8.22715}, +{3909.87, 56.3103, 8.03236}, +{3973.11, 56.2635, 7.84205}, +{4037.38, 56.2128, 7.65602}, +{4102.68, 56.1582, 7.47420}, +{4169.03, 56.0994, 7.29641}, +{4236.46, 56.0364, 7.12277}, +{4304.98, 55.9690, 6.95294}, +{4374.62, 55.8969, 6.78696}, +{4445.37, 55.8200, 6.62483}, +{4517.27, 55.7380, 6.46631}, +{4590.33, 55.6505, 6.31138}, +{4664.58, 55.5572, 6.16008}, +{4740.03, 55.4575, 6.01213}, +{4816.69, 55.3509, 5.86756}, +{4894.60, 55.2367, 5.72638}, +{4973.77, 55.1141, 5.58828}, +{5054.21, 54.9821, 5.45343}, +{5135.96, 54.8396, 5.32159}, +{5219.03, 54.6851, 5.19278}, +{5303.44, 54.5167, 5.06681}, +{5389.22, 54.3322, 4.94382}, +{5476.39, 54.1287, 4.82361}, +{5564.97, 53.9024, 4.70617}, +{5654.98, 53.6483, 4.59137}, +{5746.44, 53.3593, 4.47929}, +{5839.39, 53.0254, 4.36970}, +{5933.83, 52.6315, 4.26247}, +{6029.81, 52.1527, 4.15778}, +{6127.33, 51.5453, 4.05558}, +{6226.44, 50.7172, 3.95562}, +{6327.15, 49.4124, 3.85796}, +{6429.48, 46.0453, 3.76244}, +{6459.20, 33.1901, 3.73542}, +{6459.40, 33.1911, 10.8415}, +{6533.48, 48.1440, 10.6158}, +{6639.15, 49.9780, 10.3062}, +{6746.54, 50.6958, 10.0055}, +{6855.65, 50.7949, 9.71357}, +{6966.54, 49.7355, 9.43029}, +{7012.70, 41.0760, 9.31608}, +{7012.90, 41.0789, 13.9235}, +{7079.22, 51.0072, 13.5142}, +{7193.72, 52.7798, 12.8441}, +{7310.07, 53.4313, 12.2070}, +{7427.80, 49.6437, 11.6041}, +{7428.00, 49.6436, 13.5704}, +{7428.31, 50.5195, 13.5694}, +{7548.45, 54.5514, 13.2272}, +{7670.54, 55.4394, 12.8932}, +{7794.61, 56.0965, 12.5669}, +{7920.68, 56.6337, 12.2479}, +{8048.79, 57.0905, 11.9359}, +{8178.98, 57.4874, 11.6311}, +{8311.26, 57.8369, 11.3333}, +{8445.69, 58.1473, 11.0425}, +{8582.29, 58.4247, 10.7585}, +{8721.11, 58.6738, 10.4811}, +{8862.16, 58.8980, 10.2103}, +{9005.50, 59.1000, 9.94601}, +{9151.16, 59.2818, 9.68785}, +{9299.17, 59.4449, 9.43598}, +{9449.58, 59.5893, 9.19003}, +{9602.42, 59.7129, 8.95034}, +{9757.73, 59.7927, 8.71623}, +{9915.55, 59.9187, 8.59018}, +{10075.9, 60.1180, 8.36483}, +{10238.9, 60.2096, 8.14506}, +{10404.5, 60.3070, 7.93073}, +{10572.8, 60.3951, 7.72172}, +{10743.8, 60.4746, 7.51793}, +{10917.6, 60.5461, 7.31925}, +{11094.2, 60.6104, 7.12556}, +{11273.6, 60.6682, 6.93675}, +{11455.9, 60.7199, 6.75273}, +{11641.2, 60.7661, 6.57337}, +{11829.5, 60.8071, 6.39857}, +{12020.8, 60.8434, 6.22823}, +{12215.3, 60.8753, 6.06225}, +{12412.8, 60.9031, 5.90053}, +{12613.6, 60.9271, 5.74296}, +{12817.6, 60.9476, 5.58946}, +{13025.0, 60.9648, 5.43992}, +{13235.6, 60.9790, 5.29425}, +{13449.7, 60.9903, 5.15237}, +{13667.2, 60.9989, 5.01416}, +{13888.3, 61.0051, 4.87956}, +{14112.9, 61.0090, 4.74847}, +{14341.2, 61.0108, 4.62080}, +{14573.1, 61.0105, 4.49647}, +{14808.9, 61.0084, 4.37541}, +{15048.4, 61.0046, 4.25752}, +{15291.8, 60.9991, 4.14273}, +{15539.1, 60.9921, 4.03096}, +{15790.4, 60.9838, 3.92214}, +{16045.8, 60.9741, 3.81619}, +{16305.4, 60.9632, 3.71304}, +{16569.1, 60.9512, 3.61262}, +{16837.1, 60.9381, 3.51486}, +{17109.4, 60.9240, 3.41969}, +{17386.1, 60.9090, 3.32705}, +{17667.4, 60.8932, 3.23686}, +{17953.1, 60.8765, 3.14907}, +{18243.5, 60.8592, 3.06362}, +{18538.6, 60.8411, 2.98044}, +{18838.4, 60.8224, 2.89947}, +{19143.1, 60.8031, 2.82066}, +{19452.7, 60.7832, 2.74395}, +{19767.4, 60.7629, 2.66929}, +{20087.1, 60.7420, 2.59662}, +{20412.0, 60.7206, 2.52589}, +{20742.1, 60.6989, 2.45704}, +{21077.6, 60.6767, 2.39004}, +{21418.5, 60.6541, 2.32482}, +{21765.0, 60.6312, 2.26135}, +{22117.0, 60.6079, 2.19957}, +{22474.7, 60.5842, 2.13945}, +{22838.2, 60.5602, 2.08093}, +{23207.6, 60.5359, 2.02397}, +{23583.0, 60.5113, 1.96854}, +{23964.4, 60.4863, 1.91458}, +{24352.0, 60.4611, 1.86207}, +{24745.9, 60.4355, 1.81096}, +{25146.2, 60.4095, 1.76122}, +{25552.9, 60.3832, 1.71281}, +{25966.2, 60.3566, 1.66568}, +{26386.1, 60.3296, 1.61982}, +{26812.9, 60.3022, 1.57518}, +{27246.6, 60.2743, 1.53173}, +{27687.3, 60.2460, 1.48943}, +{28135.1, 60.2173, 1.44827}, +{28590.2, 60.1879, 1.40820}, +{29052.6, 60.1580, 1.36919}, +{29522.5, 60.1275, 1.33123}, +{30000.0, 60.0962, 1.29427}, +{0, 0, 0} +}; + +e_fp_fdp sm[] = { /* Z = 62 */ +{10.0000, -9999.00, 0.187643}, +{10.1617, -9999.00, 0.195336}, +{10.3261, -9999.00, 0.203345}, +{10.4931, -9999.00, 0.211681}, +{10.6628, -9999.00, 0.220360}, +{10.8353, -9999.00, 0.229394}, +{11.0106, -9999.00, 0.238799}, +{11.1886, -9999.00, 0.248589}, +{11.3696, -9999.00, 0.258781}, +{11.5535, -9999.00, 0.269391}, +{11.7404, -9999.00, 0.280435}, +{11.9303, -9999.00, 0.291933}, +{12.1232, -9999.00, 0.303902}, +{12.3193, -9999.00, 0.315122}, +{12.5186, -9999.00, 0.326091}, +{12.7210, -9999.00, 0.337442}, +{12.9268, -9999.00, 0.349187}, +{13.1359, -9999.00, 0.361342}, +{13.3483, -9999.00, 0.373919}, +{13.5642, -9999.00, 0.386934}, +{13.7836, -9999.00, 0.399806}, +{14.0066, -9999.00, 0.411591}, +{14.2331, -9999.00, 0.423723}, +{14.4633, -9999.00, 0.436213}, +{14.6973, -9999.00, 0.449071}, +{14.9350, -9999.00, 0.462308}, +{15.1765, -9999.00, 0.475936}, +{15.4220, -9999.00, 0.488902}, +{15.6714, -9999.00, 0.501112}, +{15.9249, -9999.00, 0.513626}, +{16.1825, -9999.00, 0.526453}, +{16.4442, -9999.00, 0.539600}, +{16.7102, -9999.00, 0.553075}, +{16.9805, -9999.00, 0.566841}, +{17.2551, -9999.00, 0.579760}, +{17.5342, -9999.00, 0.592972}, +{17.8178, -9999.00, 0.606486}, +{18.1060, -9999.00, 0.620308}, +{18.3989, -9999.00, 0.634445}, +{18.6964, -9999.00, 0.653063}, +{18.9988, -9999.00, 0.676143}, +{19.3061, -9999.00, 0.700039}, +{19.6184, -9999.00, 0.724780}, +{19.9357, -9999.00, 0.784056}, +{20.2582, -9999.00, 0.883332}, +{20.5858, -9999.00, 1.09093}, +{20.9188, -9999.00, 1.46853}, +{21.2571, -9999.00, 1.67010}, +{21.6009, -9999.00, 1.69471}, +{21.9503, -9999.00, 1.71967}, +{22.3053, -9999.00, 1.86242}, +{22.6661, -9999.00, 2.36732}, +{23.0327, -9999.00, 2.78527}, +{23.4053, -9999.00, 2.93280}, +{23.7838, -9999.00, 2.76046}, +{24.1685, -9999.00, 3.25280}, +{24.5594, -9999.00, 6.09720}, +{24.9566, -9999.00, 6.85931}, +{25.3603, -9999.00, 8.39557}, +{25.7705, -9999.00, 9.52920}, +{26.1873, -9999.00, 10.4409}, +{26.6109, -9999.00, 11.0802}, +{27.0413, -9999.00, 11.4150}, +{27.4786, -9999.00, 11.6261}, +{27.9231, -9999.00, 11.8410}, +{28.3747, -9999.00, 12.0600}, +{28.8337, -9999.00, 12.1251}, +{29.3000, 3.67989, 12.1732}, +{29.7739, 4.48481, 12.2215}, +{30.2555, 5.29747, 11.8462}, +{30.7449, 5.78823, 11.4180}, +{31.2421, 6.13025, 11.1392}, +{31.7475, 6.45226, 10.8773}, +{32.2609, 6.72631, 10.6236}, +{32.7827, 6.97408, 10.4245}, +{33.3130, 7.21595, 10.2292}, +{33.8518, 7.45001, 10.0374}, +{34.3993, 7.66944, 9.81508}, +{34.9557, 7.83314, 9.58734}, +{35.5211, 7.95815, 9.39447}, +{36.0956, 8.06517, 9.21136}, +{36.6794, 8.12784, 9.05710}, +{37.2727, 8.21301, 8.95389}, +{37.8755, 8.31454, 8.85188}, +{38.4882, 8.42555, 8.75100}, +{39.1107, 8.53469, 8.62261}, +{39.7432, 8.62101, 8.49238}, +{40.3861, 8.68864, 8.36412}, +{41.0393, 8.73853, 8.24511}, +{41.7031, 8.77940, 8.13213}, +{42.3776, 8.80390, 8.02070}, +{43.0630, 8.79972, 7.91079}, +{43.7595, 8.75345, 7.85618}, +{44.4673, 8.74672, 7.83991}, +{45.1865, 8.75021, 7.82365}, +{45.9174, 8.74685, 7.82414}, +{46.6600, 8.76634, 7.83959}, +{47.4147, 8.79872, 7.85506}, +{48.1816, 8.83798, 7.87056}, +{48.9609, 8.88246, 7.88610}, +{49.7528, 8.93104, 7.90166}, +{50.5576, 8.98296, 7.91726}, +{51.3753, 9.03769, 7.93289}, +{52.2062, 9.09488, 7.94854}, +{53.0506, 9.15429, 7.96424}, +{53.9087, 9.21576, 7.97995}, +{54.7806, 9.27926, 7.99571}, +{55.6667, 9.34485, 8.01149}, +{56.5670, 9.41271, 8.02730}, +{57.4820, 9.48317, 8.04314}, +{58.4117, 9.55682, 8.05902}, +{59.3564, 9.63468, 8.07493}, +{60.3165, 9.71869, 8.09086}, +{61.2921, 9.81342, 8.10683}, +{62.2834, 9.93583, 8.12258}, +{63.2908, 10.0538, 8.06486}, +{64.3145, 10.1420, 8.00755}, +{65.3547, 10.2121, 7.95066}, +{66.4118, 10.2712, 7.89416}, +{67.4859, 10.3210, 7.83806}, +{68.5775, 10.3626, 7.78237}, +{69.6867, 10.3965, 7.72707}, +{70.8138, 10.4231, 7.67216}, +{71.9591, 10.4424, 7.61765}, +{73.1230, 10.4545, 7.56352}, +{74.3057, 10.4592, 7.50977}, +{75.5076, 10.4560, 7.45641}, +{76.7289, 10.4442, 7.40343}, +{77.9699, 10.4206, 7.35082}, +{79.2310, 10.3904, 7.31125}, +{80.5125, 10.3583, 7.27231}, +{81.8147, 10.3221, 7.23357}, +{83.1380, 10.2803, 7.19505}, +{84.4827, 10.2327, 7.15672}, +{85.8491, 10.1803, 7.11861}, +{87.2377, 10.1288, 7.08069}, +{88.6487, 10.0658, 7.02009}, +{90.0825, 9.98247, 6.95914}, +{91.5395, 9.88342, 6.89871}, +{93.0201, 9.77015, 6.83880}, +{94.5246, 9.64395, 6.77942}, +{96.0535, 9.50854, 6.72055}, +{97.6071, 9.38136, 6.65219}, +{99.1858, 9.21400, 6.52657}, +{100.790, 8.99910, 6.40332}, +{102.420, 8.74616, 6.28240}, +{104.077, 8.46619, 6.16376}, +{105.760, 8.18923, 6.04736}, +{107.471, 7.98315, 5.76749}, +{109.209, 7.47769, 5.31242}, +{110.975, 6.74254, 4.89326}, +{112.770, 5.78224, 4.56480}, +{114.594, 4.68996, 4.31173}, +{116.448, 3.39911, 4.08331}, +{118.331, 1.84323, 3.88138}, +{120.245, -0.126763, 3.68942}, +{122.190, -2.69754, 3.61752}, +{124.166, -6.66110, 3.60649}, +{126.175, -11.9181, 5.74129}, +{128.215, -17.7288, 10.0510}, +{130.289, -24.0933, 17.7139}, +{132.397, -29.4826, 40.6437}, +{134.538, -14.4932, 61.6573}, +{136.714, 11.3596, 48.3033}, +{138.925, 13.4249, 38.5673}, +{141.172, 13.1399, 39.2774}, +{143.456, 18.5220, 38.9314}, +{145.776, 20.9031, 34.8056}, +{148.134, 21.9813, 32.8474}, +{150.530, 23.1756, 31.1344}, +{152.964, 24.2213, 29.5108}, +{155.439, 25.0857, 27.9718}, +{157.953, 25.7767, 26.5131}, +{160.507, 26.3055, 25.1305}, +{163.103, 26.6707, 23.8199}, +{165.742, 26.7506, 22.6759}, +{168.422, 26.8924, 21.7892}, +{171.146, 27.0758, 20.9373}, +{173.915, 27.2272, 20.1186}, +{176.727, 27.3378, 19.3320}, +{179.586, 27.3986, 18.5761}, +{182.491, 27.3767, 17.8498}, +{185.442, 27.2860, 17.2560}, +{188.442, 27.2475, 16.7480}, +{191.489, 27.2237, 16.2550}, +{194.587, 27.1940, 15.7765}, +{197.734, 27.1491, 15.3120}, +{200.932, 27.0809, 14.8613}, +{204.182, 26.9758, 14.4238}, +{207.485, 26.7704, 14.0581}, +{210.840, 26.6234, 13.7991}, +{214.251, 26.5218, 13.5450}, +{217.716, 26.4233, 13.2955}, +{221.237, 26.3171, 13.0506}, +{224.816, 26.1873, 12.8102}, +{228.452, 25.9581, 12.6363}, +{232.147, 25.8060, 12.5773}, +{235.902, 25.7218, 12.5186}, +{239.717, 25.6607, 12.4602}, +{243.595, 25.6159, 12.4020}, +{247.535, 25.5822, 12.3441}, +{251.538, 25.5558, 12.2865}, +{255.607, 25.5329, 12.2292}, +{259.741, 25.5085, 12.1721}, +{263.942, 25.4668, 12.1228}, +{268.211, 25.4417, 12.1103}, +{272.549, 25.4323, 12.0977}, +{276.957, 25.4318, 12.0852}, +{281.437, 25.4356, 12.0726}, +{285.989, 25.4406, 12.0601}, +{290.615, 25.4434, 12.0476}, +{295.315, 25.4377, 12.0351}, +{300.092, 25.4022, 12.0226}, +{304.945, 25.3565, 12.0903}, +{309.878, 25.3530, 12.1845}, +{314.890, 25.3857, 12.2794}, +{319.983, 25.4379, 12.3750}, +{325.158, 25.5074, 12.4714}, +{330.418, 25.5936, 12.5686}, +{335.762, 25.6974, 12.6665}, +{341.192, 25.8259, 12.7651}, +{346.711, 25.9744, 12.8353}, +{352.319, 26.1169, 12.8938}, +{358.017, 26.2625, 12.9592}, +{363.808, 26.4205, 13.0250}, +{369.692, 26.6021, 13.0911}, +{375.672, 26.8053, 13.1317}, +{381.748, 27.0028, 13.1524}, +{387.922, 27.2045, 13.1731}, +{394.197, 27.4602, 13.1938}, +{400.573, 27.7017, 13.1095}, +{407.052, 27.8954, 13.0206}, +{413.635, 28.0665, 12.9322}, +{420.326, 28.2227, 12.8444}, +{427.124, 28.3670, 12.7573}, +{434.032, 28.5013, 12.6707}, +{441.052, 28.6266, 12.5847}, +{448.186, 28.7414, 12.4993}, +{455.435, 28.8451, 12.4204}, +{462.802, 28.9490, 12.3501}, +{470.287, 29.0520, 12.2801}, +{477.894, 29.1526, 12.2106}, +{485.623, 29.2505, 12.1415}, +{493.478, 29.3457, 12.0728}, +{501.459, 29.4384, 12.0045}, +{509.570, 29.5288, 11.9365}, +{517.812, 29.6172, 11.8690}, +{526.187, 29.7048, 11.8018}, +{534.698, 29.7945, 11.7350}, +{543.346, 29.8858, 11.6573}, +{552.134, 29.9705, 11.5735}, +{561.065, 30.0471, 11.4825}, +{570.139, 30.1124, 11.3886}, +{579.361, 30.1681, 11.2969}, +{588.732, 30.2169, 11.2063}, +{598.254, 30.2598, 11.1169}, +{607.930, 30.2970, 11.0282}, +{617.763, 30.3294, 10.9402}, +{627.755, 30.3597, 10.8523}, +{637.908, 30.3863, 10.7576}, +{648.226, 30.4044, 10.6529}, +{658.711, 30.4035, 10.5422}, +{669.365, 30.3827, 10.4327}, +{680.191, 30.3440, 10.3400}, +{691.193, 30.3044, 10.2601}, +{702.372, 30.2741, 10.1827}, +{713.733, 30.2414, 10.0891}, +{725.277, 30.1884, 9.98484}, +{737.008, 30.1177, 9.88152}, +{748.928, 30.0316, 9.77931}, +{761.042, 29.9310, 9.67802}, +{773.351, 29.8166, 9.57598}, +{785.859, 29.6854, 9.46862}, +{798.570, 29.5290, 9.35722}, +{811.486, 29.3476, 9.24738}, +{824.611, 29.1406, 9.13867}, +{837.949, 28.9064, 9.03111}, +{851.502, 28.6417, 8.92277}, +{865.274, 28.3419, 8.81322}, +{879.269, 27.9994, 8.70279}, +{893.491, 27.6092, 8.59372}, +{907.943, 27.1642, 8.48604}, +{922.628, 26.6564, 8.37975}, +{937.551, 26.0696, 8.26918}, +{952.715, 25.3843, 8.15848}, +{968.124, 24.5735, 8.04787}, +{983.783, 23.6009, 7.93903}, +{999.695, 22.4089, 7.83112}, +{1015.86, 20.9003, 7.72409}, +{1032.29, 18.8895, 7.61393}, +{1048.99, 15.9650, 7.50411}, +{1065.96, 10.8265, 7.39460}, +{1083.20, -23.6926, 7.28668}, +{1083.30, -29.0953, 7.28606}, +{1083.50, -29.0928, 31.6445}, +{1100.72, 10.9604, 31.6276}, +{1118.52, 16.5827, 31.6104}, +{1136.61, 19.9638, 31.5930}, +{1155.00, 22.4386, 31.5757}, +{1173.68, 24.4225, 31.5585}, +{1192.66, 26.0997, 31.5410}, +{1211.95, 27.5683, 31.5236}, +{1231.55, 28.8870, 31.5063}, +{1251.47, 30.0941, 31.4896}, +{1271.72, 31.2161, 31.4732}, +{1292.29, 32.2725, 31.4573}, +{1313.19, 33.2781, 31.4416}, +{1334.43, 34.2445, 31.4259}, +{1356.01, 35.1815, 31.4100}, +{1377.94, 36.0981, 31.3941}, +{1400.23, 37.0040, 31.3783}, +{1422.88, 37.9111, 31.3624}, +{1445.89, 38.8430, 31.3469}, +{1469.28, 39.8460, 31.2682}, +{1493.04, 40.9287, 31.0935}, +{1517.19, 41.6229, 30.5206}, +{1541.73, 41.7905, 30.3890}, +{1566.67, 43.0125, 31.1611}, +{1592.01, 44.5181, 30.6883}, +{1617.76, 45.4958, 30.0368}, +{1643.92, 46.2652, 29.3991}, +{1670.51, 46.7543, 28.7751}, +{1697.53, 46.9732, 28.4528}, +{1724.99, 47.8102, 28.6694}, +{1752.89, 48.8525, 28.2188}, +{1781.24, 49.6129, 27.6305}, +{1810.05, 50.2561, 27.0516}, +{1839.32, 50.8268, 26.4846}, +{1869.07, 51.3445, 25.9293}, +{1899.30, 51.8191, 25.3856}, +{1930.02, 52.2577, 24.8536}, +{1961.24, 52.6651, 24.3327}, +{1992.96, 53.0410, 23.8226}, +{2025.20, 53.4090, 23.3356}, +{2057.95, 53.7569, 22.8334}, +{2091.24, 54.0741, 22.3398}, +{2125.06, 54.3695, 21.8549}, +{2159.43, 54.6444, 21.3780}, +{2194.36, 54.9009, 20.9102}, +{2229.85, 55.1397, 20.4501}, +{2265.92, 55.3619, 19.9990}, +{2302.57, 55.5692, 19.5565}, +{2339.81, 55.7624, 19.1221}, +{2377.66, 55.9418, 18.6956}, +{2416.11, 56.1082, 18.2774}, +{2455.19, 56.2624, 17.8675}, +{2494.90, 56.4051, 17.4655}, +{2535.26, 56.5370, 17.0716}, +{2576.26, 56.6586, 16.6856}, +{2617.93, 56.7703, 16.3072}, +{2660.27, 56.8730, 15.9367}, +{2703.30, 56.9664, 15.5733}, +{2747.03, 57.0515, 15.2180}, +{2791.46, 57.1286, 14.8694}, +{2836.61, 57.1981, 14.5287}, +{2882.49, 57.2599, 14.1944}, +{2929.11, 57.3150, 13.8681}, +{2976.48, 57.3638, 13.5481}, +{3024.63, 57.4061, 13.2349}, +{3073.55, 57.4420, 12.9279}, +{3123.26, 57.4716, 12.6279}, +{3173.78, 57.4960, 12.3348}, +{3225.11, 57.5151, 12.0476}, +{3277.27, 57.5288, 11.7668}, +{3330.28, 57.5375, 11.4920}, +{3384.15, 57.5414, 11.2232}, +{3438.88, 57.5405, 10.9603}, +{3494.50, 57.5350, 10.7033}, +{3551.02, 57.5251, 10.4519}, +{3608.46, 57.5108, 10.2060}, +{3666.82, 57.4923, 9.96565}, +{3726.13, 57.4696, 9.73066}, +{3786.40, 57.4428, 9.50083}, +{3847.64, 57.4119, 9.27620}, +{3909.87, 57.3770, 9.05659}, +{3973.11, 57.3380, 8.84191}, +{4037.38, 57.2951, 8.63210}, +{4102.68, 57.2482, 8.42703}, +{4169.03, 57.1972, 8.22642}, +{4236.46, 57.1420, 8.03052}, +{4304.98, 57.0826, 7.83891}, +{4374.62, 57.0188, 7.65174}, +{4445.37, 56.9505, 7.46877}, +{4517.27, 56.8774, 7.28994}, +{4590.33, 56.7995, 7.11527}, +{4664.58, 56.7164, 6.94441}, +{4740.03, 56.6277, 6.77752}, +{4816.69, 56.5331, 6.61443}, +{4894.60, 56.4322, 6.45499}, +{4973.77, 56.3244, 6.29934}, +{5054.21, 56.2091, 6.14716}, +{5135.96, 56.0854, 5.99837}, +{5219.03, 55.9525, 5.85303}, +{5303.44, 55.8092, 5.71104}, +{5389.22, 55.6542, 5.57232}, +{5476.39, 55.4858, 5.43666}, +{5564.97, 55.3018, 5.30422}, +{5654.98, 55.0996, 5.17468}, +{5746.44, 54.8757, 5.04828}, +{5839.39, 54.6255, 4.92457}, +{5933.83, 54.3427, 4.80378}, +{6029.81, 54.0184, 4.68575}, +{6127.33, 53.6395, 4.57018}, +{6226.44, 53.1852, 4.45744}, +{6327.15, 52.6205, 4.34728}, +{6429.48, 51.8768, 4.23965}, +{6533.48, 50.7892, 4.13439}, +{6639.15, 48.7285, 4.03168}, +{6716.10, 32.8682, 3.95950}, +{6716.30, 32.8693, 11.4876}, +{6746.54, 46.6005, 11.3890}, +{6855.65, 50.1964, 11.0435}, +{6966.54, 51.3796, 10.7083}, +{7079.22, 51.8655, 10.3833}, +{7193.72, 51.7456, 10.0681}, +{7310.07, 47.2296, 9.76239}, +{7311.70, 43.8229, 9.75823}, +{7311.90, 43.8242, 13.5243}, +{7428.31, 52.6752, 13.1281}, +{7548.45, 53.6945, 12.7375}, +{7670.54, 53.9953, 12.3584}, +{7736.70, 50.8676, 12.1601}, +{7736.90, 50.8705, 13.9217}, +{7794.61, 54.5294, 13.7754}, +{7920.68, 55.7174, 13.4646}, +{8048.79, 56.4843, 13.1578}, +{8178.98, 57.0922, 12.8558}, +{8311.26, 57.6046, 12.5583}, +{8445.69, 58.0492, 12.2654}, +{8582.29, 58.4413, 11.9768}, +{8721.11, 58.7910, 11.6931}, +{8862.16, 59.1056, 11.4145}, +{9005.50, 59.3903, 11.1405}, +{9151.16, 59.6486, 10.8712}, +{9299.17, 59.8838, 10.6069}, +{9449.58, 60.0988, 10.3477}, +{9602.42, 60.2955, 10.0933}, +{9757.73, 60.4757, 9.84361}, +{9915.55, 60.6408, 9.59912}, +{10075.9, 60.7925, 9.35927}, +{10238.9, 60.9315, 9.12426}, +{10404.5, 61.0589, 8.89408}, +{10572.8, 61.1758, 8.66866}, +{10743.8, 61.2829, 8.44800}, +{10917.6, 61.3808, 8.23204}, +{11094.2, 61.4704, 8.02074}, +{11273.6, 61.5521, 7.81405}, +{11455.9, 61.6264, 7.61192}, +{11641.2, 61.6940, 7.41429}, +{11829.5, 61.7552, 7.22111}, +{12020.8, 61.8105, 7.03231}, +{12215.3, 61.8603, 6.84785}, +{12412.8, 61.9049, 6.66765}, +{12613.6, 61.9446, 6.49165}, +{12817.6, 61.9798, 6.31979}, +{13025.0, 62.0107, 6.15199}, +{13235.6, 62.0376, 5.98820}, +{13449.7, 62.0608, 5.82834}, +{13667.2, 62.0805, 5.67235}, +{13888.3, 62.0969, 5.52016}, +{14112.9, 62.1103, 5.37169}, +{14341.2, 62.1208, 5.22688}, +{14573.1, 62.1285, 5.08566}, +{14808.9, 62.1338, 4.94796}, +{15048.4, 62.1366, 4.81371}, +{15291.8, 62.1373, 4.68284}, +{15539.1, 62.1359, 4.55528}, +{15790.4, 62.1325, 4.43097}, +{16045.8, 62.1273, 4.30984}, +{16305.4, 62.1204, 4.19181}, +{16569.1, 62.1119, 4.07683}, +{16837.1, 62.1020, 3.96482}, +{17109.4, 62.0906, 3.85573}, +{17386.1, 62.0780, 3.74949}, +{17667.4, 62.0641, 3.64602}, +{17953.1, 62.0491, 3.54528}, +{18243.5, 62.0331, 3.44720}, +{18538.6, 62.0161, 3.35172}, +{18838.4, 61.9981, 3.25877}, +{19143.1, 61.9794, 3.16830}, +{19452.7, 61.9598, 3.08025}, +{19767.4, 61.9394, 2.99456}, +{20087.1, 61.9184, 2.91118}, +{20412.0, 61.8968, 2.83004}, +{20742.1, 61.8745, 2.75110}, +{21077.6, 61.8517, 2.67430}, +{21418.5, 61.8283, 2.59960}, +{21765.0, 61.8045, 2.52692}, +{22117.0, 61.7802, 2.45624}, +{22474.7, 61.7555, 2.38749}, +{22838.2, 61.7303, 2.32063}, +{23207.6, 61.7048, 2.25561}, +{23583.0, 61.6789, 2.19238}, +{23964.4, 61.6526, 2.13090}, +{24352.0, 61.6260, 2.07112}, +{24745.9, 61.5990, 2.01300}, +{25146.2, 61.5718, 1.95650}, +{25552.9, 61.5441, 1.90157}, +{25966.2, 61.5162, 1.84817}, +{26386.1, 61.4879, 1.79627}, +{26812.9, 61.4593, 1.74582}, +{27246.6, 61.4304, 1.69678}, +{27687.3, 61.4010, 1.64912}, +{28135.1, 61.3713, 1.60281}, +{28590.2, 61.3413, 1.55779}, +{29052.6, 61.3111, 1.51405}, +{29522.5, 61.2843, 1.47154}, +{30000.0, 61.2356, 1.43024}, +{0, 0, 0} +}; + +e_fp_fdp eu[] = { /* Z = 63 */ +{10.0000, -9999.00, 0.185834}, +{10.1617, -9999.00, 0.194890}, +{10.3261, -9999.00, 0.204387}, +{10.4931, -9999.00, 0.214346}, +{10.6628, -9999.00, 0.224791}, +{10.8353, -9999.00, 0.235293}, +{11.0106, -9999.00, 0.245981}, +{11.1886, -9999.00, 0.257155}, +{11.3696, -9999.00, 0.268172}, +{11.5535, -9999.00, 0.278545}, +{11.7404, -9999.00, 0.289319}, +{11.9303, -9999.00, 0.300510}, +{12.1232, -9999.00, 0.310819}, +{12.3193, -9999.00, 0.321127}, +{12.5186, -9999.00, 0.331777}, +{12.7210, -9999.00, 0.343044}, +{12.9268, -9999.00, 0.355778}, +{13.1359, -9999.00, 0.368984}, +{13.3483, -9999.00, 0.382680}, +{13.5642, -9999.00, 0.396727}, +{13.7836, -9999.00, 0.408295}, +{14.0066, -9999.00, 0.421248}, +{14.2331, -9999.00, 0.434613}, +{14.4633, -9999.00, 0.448402}, +{14.6973, -9999.00, 0.462407}, +{14.9350, -9999.00, 0.476622}, +{15.1765, -9999.00, 0.491273}, +{15.4220, -9999.00, 0.506375}, +{15.6714, -9999.00, 0.520948}, +{15.9249, -9999.00, 0.533821}, +{16.1825, -9999.00, 0.547013}, +{16.4442, -9999.00, 0.560531}, +{16.7102, -9999.00, 0.575321}, +{16.9805, -9999.00, 0.592399}, +{17.2551, -9999.00, 0.609983}, +{17.5342, -9999.00, 0.628090}, +{17.8178, -9999.00, 0.646792}, +{18.1060, -9999.00, 0.666166}, +{18.3989, -9999.00, 0.686121}, +{18.6964, -9999.00, 0.706672}, +{18.9988, -9999.00, 0.729930}, +{19.3061, -9999.00, 0.757327}, +{19.6184, -9999.00, 0.785752}, +{19.9357, -9999.00, 0.828093}, +{20.2582, -9999.00, 0.883875}, +{20.5858, -9999.00, 0.969026}, +{20.9188, -9999.00, 1.13042}, +{21.2571, -9999.00, 1.32975}, +{21.6009, -9999.00, 1.70929}, +{21.9503, -9999.00, 2.05425}, +{22.3053, -9999.00, 2.56963}, +{22.6661, -9999.00, 3.13395}, +{23.0327, -9999.00, 3.66446}, +{23.4053, -9999.00, 4.52170}, +{23.7838, -9999.00, 5.20343}, +{24.1685, -9999.00, 7.07901}, +{24.5594, -9999.00, 9.05336}, +{24.9566, -9999.00, 10.2633}, +{25.3603, -9999.00, 11.5457}, +{25.7705, -9999.00, 12.7844}, +{26.1873, -9999.00, 13.8159}, +{26.6109, -9999.00, 14.4928}, +{27.0413, -9999.00, 15.1669}, +{27.4786, -9999.00, 15.7859}, +{27.9231, -9999.00, 16.4302}, +{28.3747, -9999.00, 16.6264}, +{28.8337, -9999.00, 16.7421}, +{29.3000, 2.90775, 16.6530}, +{29.7739, 3.78453, 16.4964}, +{30.2555, 4.56983, 16.3413}, +{30.7449, 5.32570, 16.1876}, +{31.2421, 6.10863, 16.0354}, +{31.7475, 6.84178, 15.6642}, +{32.2609, 7.43599, 15.2938}, +{32.7827, 7.94986, 14.9321}, +{33.3130, 8.40654, 14.5857}, +{33.8518, 8.82127, 14.2480}, +{34.3993, 9.20011, 13.9181}, +{34.9557, 9.54888, 13.5958}, +{35.5211, 9.87542, 13.2810}, +{36.0956, 10.1961, 12.9544}, +{36.6794, 10.4654, 12.6023}, +{37.2727, 10.6860, 12.2597}, +{37.8755, 10.8538, 11.9337}, +{38.4882, 11.0174, 11.6753}, +{39.1107, 11.2016, 11.4225}, +{39.7432, 11.4252, 11.1436}, +{40.3861, 11.5809, 10.7662}, +{41.0393, 11.6367, 10.4016}, +{41.7031, 11.5785, 10.1419}, +{42.3776, 11.5956, 9.96463}, +{43.0630, 11.6444, 9.79047}, +{43.7595, 11.7056, 9.61347}, +{44.4673, 11.7590, 9.42618}, +{45.1865, 11.8043, 9.24253}, +{45.9174, 11.8464, 9.05803}, +{46.6600, 11.8683, 8.86355}, +{47.4147, 11.8631, 8.67326}, +{48.1816, 11.8132, 8.50177}, +{48.9609, 11.7755, 8.40426}, +{49.7528, 11.7612, 8.30787}, +{50.5576, 11.7572, 8.21258}, +{51.3753, 11.7588, 8.11839}, +{52.2062, 11.7586, 8.01433}, +{53.0506, 11.7493, 7.91129}, +{53.9087, 11.7292, 7.80956}, +{54.7806, 11.6884, 7.70914}, +{55.6667, 11.6316, 7.65364}, +{56.5670, 11.5979, 7.61209}, +{57.4820, 11.5750, 7.57077}, +{58.4117, 11.5539, 7.52968}, +{59.3564, 11.5292, 7.48880}, +{60.3165, 11.5057, 7.46055}, +{61.2921, 11.4858, 7.43243}, +{62.2834, 11.4646, 7.40444}, +{63.2908, 11.4362, 7.37655}, +{64.3145, 11.4042, 7.36661}, +{65.3547, 11.3799, 7.36103}, +{66.4118, 11.3561, 7.35546}, +{67.4859, 11.3245, 7.34990}, +{68.5775, 11.2826, 7.37037}, +{69.6867, 11.2639, 7.40702}, +{70.8138, 11.2595, 7.44385}, +{71.9591, 11.2684, 7.48088}, +{73.1230, 11.2940, 7.50884}, +{74.3057, 11.3207, 7.51287}, +{75.5076, 11.3358, 7.51134}, +{76.7289, 11.3441, 7.50981}, +{77.9699, 11.3490, 7.50827}, +{79.2310, 11.3511, 7.50674}, +{80.5125, 11.3511, 7.50521}, +{81.8147, 11.3494, 7.50368}, +{83.1380, 11.3469, 7.50215}, +{84.4827, 11.3461, 7.50062}, +{85.8491, 11.3566, 7.49192}, +{87.2377, 11.3523, 7.45646}, +{88.6487, 11.3321, 7.42116}, +{90.0825, 11.3003, 7.38603}, +{91.5395, 11.2594, 7.35106}, +{93.0201, 11.2107, 7.31626}, +{94.5246, 11.1571, 7.28162}, +{96.0535, 11.1097, 7.24715}, +{97.6071, 11.0573, 7.17081}, +{99.1858, 10.9660, 7.08146}, +{100.790, 10.8486, 6.99321}, +{102.420, 10.7122, 6.90606}, +{104.077, 10.5721, 6.82000}, +{105.760, 10.4533, 6.66635}, +{107.471, 10.2345, 6.45642}, +{109.209, 9.94351, 6.25310}, +{110.975, 9.61061, 6.00472}, +{112.770, 9.14243, 5.71920}, +{114.594, 8.55879, 5.44726}, +{116.448, 7.88923, 5.15714}, +{118.331, 7.01640, 4.83137}, +{120.245, 5.91495, 4.52616}, +{122.190, 4.55296, 4.26457}, +{124.166, 2.88315, 4.03482}, +{126.175, 0.763467, 3.80646}, +{128.215, -2.11010, 3.55452}, +{130.289, -6.48000, 3.31927}, +{132.397, -16.3328, 4.36314}, +{134.538, -25.7024, 15.0485}, +{136.714, -34.6364, 41.3611}, +{138.925, -9.71490, 66.1748}, +{141.172, 17.1208, 57.8027}, +{143.456, 28.5644, 42.0620}, +{145.776, 26.1723, 31.4923}, +{148.134, 24.3442, 27.9775}, +{150.530, 22.8147, 25.5125}, +{152.964, 22.2303, 24.7059}, +{155.439, 22.3370, 23.9248}, +{157.953, 22.5457, 23.1832}, +{160.507, 22.7928, 22.4887}, +{163.103, 23.0568, 21.8747}, +{165.742, 23.3321, 21.2873}, +{168.422, 23.6035, 20.7449}, +{171.146, 23.8749, 20.2226}, +{173.915, 24.1306, 19.7134}, +{176.727, 24.3501, 19.2170}, +{179.586, 24.5553, 18.7763}, +{182.491, 24.7634, 18.3503}, +{185.442, 24.9633, 17.9339}, +{188.442, 25.1520, 17.5269}, +{191.489, 25.3303, 17.1292}, +{194.587, 25.5182, 16.7323}, +{197.734, 25.6693, 16.3019}, +{200.932, 25.7772, 15.8825}, +{204.182, 25.8526, 15.4740}, +{207.485, 25.8948, 15.0759}, +{210.840, 25.8979, 14.6881}, +{214.251, 25.8144, 14.3103}, +{217.716, 25.7065, 14.0807}, +{221.237, 25.6614, 13.8923}, +{224.816, 25.6414, 13.7065}, +{228.452, 25.6302, 13.5231}, +{232.147, 25.6202, 13.3421}, +{235.902, 25.6061, 13.1636}, +{239.717, 25.5827, 12.9875}, +{243.595, 25.5417, 12.8137}, +{247.535, 25.4560, 12.6423}, +{251.538, 25.3512, 12.5737}, +{255.607, 25.2920, 12.5365}, +{259.741, 25.2671, 12.4993}, +{263.942, 25.2544, 12.4622}, +{268.211, 25.2487, 12.4253}, +{272.549, 25.2454, 12.3884}, +{276.957, 25.2256, 12.3588}, +{281.437, 25.2210, 12.3571}, +{285.989, 25.2324, 12.3553}, +{290.615, 25.2497, 12.3535}, +{295.315, 25.2696, 12.3517}, +{300.092, 25.2888, 12.3500}, +{304.945, 25.3029, 12.3482}, +{309.878, 25.2986, 12.3464}, +{314.890, 25.2656, 12.3965}, +{319.983, 25.2716, 12.4887}, +{325.158, 25.3142, 12.5817}, +{330.418, 25.3746, 12.6753}, +{335.762, 25.4507, 12.7696}, +{341.192, 25.5415, 12.8646}, +{346.711, 25.6489, 12.9604}, +{352.319, 25.7761, 13.0493}, +{358.017, 25.9077, 13.1270}, +{363.808, 26.0461, 13.2045}, +{369.692, 26.1943, 13.2825}, +{375.672, 26.3558, 13.3611}, +{381.748, 26.5368, 13.4402}, +{387.922, 26.7512, 13.5078}, +{394.197, 26.9917, 13.5488}, +{400.573, 27.2348, 13.5255}, +{407.052, 27.4392, 13.4768}, +{413.635, 27.6223, 13.4281}, +{420.326, 27.7934, 13.3796}, +{427.124, 27.9563, 13.3313}, +{434.032, 28.1134, 13.2832}, +{441.052, 28.2665, 13.2353}, +{448.186, 28.4219, 13.1859}, +{455.435, 28.5726, 13.1286}, +{462.802, 28.7173, 13.0657}, +{470.287, 28.8539, 13.0000}, +{477.894, 28.9836, 12.9348}, +{485.623, 29.1086, 12.8698}, +{493.478, 29.2298, 12.8051}, +{501.459, 29.3480, 12.7408}, +{509.570, 29.4645, 12.6767}, +{517.812, 29.5828, 12.6113}, +{526.187, 29.7012, 12.5402}, +{534.698, 29.8158, 12.4582}, +{543.346, 29.9191, 12.3710}, +{552.134, 30.0165, 12.2844}, +{561.065, 30.1084, 12.1913}, +{570.139, 30.1912, 12.0953}, +{579.361, 30.2637, 11.9980}, +{588.732, 30.3280, 11.9013}, +{598.254, 30.3849, 11.8053}, +{607.930, 30.4351, 11.7099}, +{617.763, 30.4795, 11.6153}, +{627.755, 30.5216, 11.5208}, +{637.908, 30.5599, 11.4188}, +{648.226, 30.5890, 11.3052}, +{658.711, 30.5966, 11.1846}, +{669.365, 30.5820, 11.0654}, +{680.191, 30.5477, 10.9646}, +{691.193, 30.5121, 10.8780}, +{702.372, 30.4858, 10.7945}, +{713.733, 30.4568, 10.6954}, +{725.277, 30.4078, 10.5862}, +{737.008, 30.3412, 10.4781}, +{748.928, 30.2594, 10.3712}, +{761.042, 30.1634, 10.2652}, +{773.351, 30.0540, 10.1580}, +{785.859, 29.9281, 10.0448}, +{798.570, 29.7766, 9.92691}, +{811.486, 29.5999, 9.81049}, +{824.611, 29.3979, 9.69536}, +{837.949, 29.1694, 9.58149}, +{851.502, 28.9116, 9.46671}, +{865.274, 28.6204, 9.35064}, +{879.269, 28.2890, 9.23366}, +{893.491, 27.9133, 9.11807}, +{907.943, 27.4882, 9.00396}, +{922.628, 27.0080, 8.89133}, +{937.551, 26.4599, 8.77388}, +{952.715, 25.8295, 8.65656}, +{968.124, 25.0996, 8.53960}, +{983.783, 24.2482, 8.42397}, +{999.695, 23.2445, 8.30953}, +{1015.86, 22.0436, 8.19626}, +{1032.29, 20.5739, 8.08056}, +{1048.99, 18.7214, 7.96537}, +{1065.96, 16.2836, 7.85065}, +{1083.20, 12.8470, 7.73760}, +{1100.72, 7.32983, 7.62607}, +{1118.52, -5.39855, 7.51600}, +{1127.40, -60.8489, 7.46236}, +{1127.60, -60.8139, 46.7448}, +{1136.61, -3.74857, 46.2262}, +{1155.00, 10.9622, 45.1984}, +{1173.68, 18.1065, 44.1936}, +{1192.66, 22.9318, 43.2107}, +{1211.95, 26.5900, 42.2498}, +{1231.55, 29.5332, 41.3103}, +{1251.47, 31.9878, 40.3930}, +{1271.72, 34.0845, 39.4981}, +{1292.29, 35.9081, 38.6253}, +{1313.19, 37.5131, 37.7714}, +{1334.43, 38.9375, 36.9366}, +{1356.01, 40.2099, 36.1206}, +{1377.94, 41.3509, 35.3220}, +{1400.23, 42.3757, 34.5411}, +{1422.88, 43.2957, 33.7777}, +{1445.89, 44.1185, 33.0315}, +{1469.28, 44.8462, 32.3017}, +{1480.50, 45.1712, 31.9613}, +{1480.70, 45.1755, 31.9376}, +{1493.04, 45.4535, 31.6043}, +{1517.19, 46.0088, 30.9697}, +{1541.73, 46.4885, 30.3478}, +{1566.67, 46.8487, 29.7381}, +{1592.01, 46.9510, 29.1409}, +{1613.80, 43.8244, 28.6442}, +{1614.00, 43.8307, 30.7759}, +{1617.76, 46.4120, 30.6755}, +{1643.92, 48.3734, 29.9915}, +{1670.51, 49.2885, 29.3227}, +{1697.53, 49.9729, 28.6688}, +{1724.99, 50.5175, 28.0296}, +{1752.89, 50.9311, 27.4043}, +{1781.24, 51.1210, 26.7929}, +{1799.90, 49.5256, 26.4030}, +{1800.10, 49.5288, 27.5459}, +{1810.05, 51.3717, 27.3432}, +{1839.32, 52.3119, 26.7616}, +{1869.07, 52.9269, 26.1926}, +{1899.30, 53.4405, 25.6365}, +{1930.02, 53.8945, 25.0915}, +{1961.24, 54.3056, 24.5580}, +{1992.96, 54.6787, 24.0358}, +{2025.20, 55.0321, 23.5345}, +{2057.95, 55.3645, 23.0259}, +{2091.24, 55.6700, 22.5261}, +{2125.06, 55.9525, 22.0353}, +{2159.43, 56.2150, 21.5532}, +{2194.36, 56.4584, 21.0798}, +{2229.85, 56.6848, 20.6160}, +{2265.92, 56.8955, 20.1606}, +{2302.57, 57.0914, 19.7144}, +{2339.81, 57.2734, 19.2766}, +{2377.66, 57.4427, 18.8477}, +{2416.11, 57.5999, 18.4269}, +{2455.19, 57.7455, 18.0144}, +{2494.90, 57.8801, 17.6097}, +{2535.26, 58.0039, 17.2131}, +{2576.26, 58.1180, 16.8251}, +{2617.93, 58.2230, 16.4449}, +{2660.27, 58.3189, 16.0723}, +{2703.30, 58.4065, 15.7077}, +{2747.03, 58.4865, 15.3506}, +{2791.46, 58.5587, 15.0003}, +{2836.61, 58.6233, 14.6580}, +{2882.49, 58.6815, 14.3232}, +{2929.11, 58.7331, 13.9948}, +{2976.48, 58.7781, 13.6737}, +{3024.63, 58.8175, 13.3595}, +{3073.55, 58.8511, 13.0517}, +{3123.26, 58.8789, 12.7507}, +{3173.78, 58.9014, 12.4564}, +{3225.11, 58.9195, 12.1688}, +{3277.27, 58.9325, 11.8866}, +{3330.28, 58.9406, 11.6112}, +{3384.15, 58.9446, 11.3417}, +{3438.88, 58.9442, 11.0780}, +{3494.50, 58.9395, 10.8200}, +{3551.02, 58.9308, 10.5678}, +{3608.46, 58.9181, 10.3211}, +{3666.82, 58.9016, 10.0799}, +{3726.13, 58.8814, 9.84401}, +{3786.40, 58.8575, 9.61340}, +{3847.64, 58.8300, 9.38791}, +{3909.87, 58.7989, 9.16739}, +{3973.11, 58.7643, 8.95182}, +{4037.38, 58.7262, 8.74108}, +{4102.68, 58.6847, 8.53495}, +{4169.03, 58.6395, 8.33350}, +{4236.46, 58.5908, 8.13652}, +{4304.98, 58.5386, 7.94408}, +{4374.62, 58.4827, 7.75585}, +{4445.37, 58.4230, 7.57179}, +{4517.27, 58.3594, 7.39196}, +{4590.33, 58.2920, 7.21626}, +{4664.58, 58.2204, 7.04436}, +{4740.03, 58.1442, 6.87623}, +{4816.69, 58.0634, 6.71209}, +{4894.60, 57.9777, 6.55165}, +{4973.77, 57.8868, 6.39478}, +{5054.21, 57.7903, 6.24144}, +{5135.96, 57.6875, 6.09153}, +{5219.03, 57.5780, 5.94493}, +{5303.44, 57.4610, 5.80163}, +{5389.22, 57.3357, 5.66158}, +{5476.39, 57.2011, 5.52484}, +{5564.97, 57.0562, 5.39105}, +{5654.98, 56.8993, 5.26031}, +{5746.44, 56.7287, 5.13247}, +{5839.39, 56.5419, 5.00739}, +{5933.83, 56.3358, 4.88519}, +{6029.81, 56.1068, 4.76602}, +{6127.33, 55.8496, 4.64917}, +{6226.44, 55.5566, 4.53504}, +{6327.15, 55.2173, 4.42351}, +{6429.48, 54.8153, 4.31442}, +{6533.48, 54.3236, 4.20782}, +{6639.15, 53.6924, 4.10352}, +{6746.54, 52.8128, 4.00161}, +{6855.65, 51.3533, 3.90188}, +{6966.54, 45.8022, 3.80449}, +{6976.80, 35.2494, 3.79567}, +{6977.00, 35.2505, 10.9555}, +{7079.22, 51.0728, 10.6501}, +{7193.72, 52.6410, 10.3230}, +{7310.07, 53.3299, 10.0056}, +{7428.31, 53.5054, 9.69811}, +{7548.45, 52.8957, 9.40022}, +{7617.00, 45.6503, 9.23642}, +{7617.20, 45.6514, 12.8525}, +{7670.54, 53.0633, 12.6847}, +{7794.61, 54.7024, 12.3073}, +{7920.68, 55.3366, 11.9407}, +{8048.79, 54.0591, 11.5853}, +{8051.90, 52.2193, 11.5768}, +{8052.10, 52.2201, 13.2566}, +{8178.98, 56.5824, 12.9561}, +{8311.26, 57.4448, 12.6548}, +{8445.69, 58.0852, 12.3585}, +{8582.29, 58.6108, 12.0670}, +{8721.11, 59.0601, 11.7804}, +{8862.16, 59.4524, 11.4988}, +{9005.50, 59.8000, 11.2226}, +{9151.16, 60.1108, 10.9507}, +{9299.17, 60.3901, 10.6844}, +{9449.58, 60.6431, 10.4233}, +{9602.42, 60.8728, 10.1669}, +{9757.73, 61.0817, 9.91573}, +{9915.55, 61.2724, 9.66983}, +{10075.9, 61.4469, 9.42856}, +{10238.9, 61.6063, 9.19224}, +{10404.5, 61.7523, 8.96083}, +{10572.8, 61.8858, 8.73430}, +{10743.8, 62.0081, 8.51260}, +{10917.6, 62.1200, 8.29567}, +{11094.2, 62.2223, 8.08347}, +{11273.6, 62.3158, 7.87595}, +{11455.9, 62.4010, 7.67304}, +{11641.2, 62.4787, 7.47469}, +{11829.5, 62.5494, 7.28082}, +{12020.8, 62.6134, 7.09139}, +{12215.3, 62.6714, 6.90632}, +{12412.8, 62.7237, 6.72555}, +{12613.6, 62.7706, 6.54901}, +{12817.6, 62.8126, 6.37663}, +{13025.0, 62.8500, 6.20834}, +{13235.6, 62.8830, 6.04408}, +{13449.7, 62.9120, 5.88376}, +{13667.2, 62.9372, 5.72732}, +{13888.3, 62.9588, 5.57469}, +{14112.9, 62.9772, 5.42580}, +{14341.2, 62.9924, 5.28057}, +{14573.1, 63.0047, 5.13893}, +{14808.9, 63.0143, 5.00082}, +{15048.4, 63.0213, 4.86616}, +{15291.8, 63.0260, 4.73488}, +{15539.1, 63.0284, 4.60692}, +{15790.4, 63.0287, 4.48220}, +{16045.8, 63.0271, 4.36065}, +{16305.4, 63.0236, 4.24221}, +{16569.1, 63.0185, 4.12680}, +{16837.1, 63.0117, 4.01437}, +{17109.4, 63.0035, 3.90485}, +{17386.1, 62.9938, 3.79817}, +{17667.4, 62.9829, 3.69426}, +{17953.1, 62.9707, 3.59307}, +{18243.5, 62.9574, 3.49453}, +{18538.6, 62.9430, 3.39858}, +{18838.4, 62.9277, 3.30515}, +{19143.1, 62.9114, 3.21420}, +{19452.7, 62.8943, 3.12567}, +{19767.4, 62.8764, 3.03948}, +{20087.1, 62.8577, 2.95559}, +{20412.0, 62.8383, 2.87394}, +{20742.1, 62.8183, 2.79449}, +{21077.6, 62.7977, 2.71716}, +{21418.5, 62.7765, 2.64191}, +{21765.0, 62.7548, 2.56870}, +{22117.0, 62.7325, 2.49746}, +{22474.7, 62.7098, 2.42815}, +{22838.2, 62.6867, 2.36073}, +{23207.6, 62.6632, 2.29513}, +{23583.0, 62.6392, 2.23133}, +{23964.4, 62.6149, 2.16926}, +{24352.0, 62.5902, 2.10889}, +{24745.9, 62.5652, 2.05017}, +{25146.2, 62.5398, 1.99307}, +{25552.9, 62.5141, 1.93753}, +{25966.2, 62.4881, 1.88352}, +{26386.1, 62.4618, 1.83100}, +{26812.9, 62.4351, 1.77992}, +{27246.6, 62.4081, 1.73026}, +{27687.3, 62.3807, 1.68197}, +{28135.1, 62.3531, 1.63502}, +{28590.2, 62.3251, 1.58936}, +{29052.6, 62.2970, 1.54498}, +{29522.5, 62.2725, 1.50183}, +{30000.0, 62.2257, 1.45987}, +{0, 0, 0} +}; + +e_fp_fdp gd[] = { /* Z = 64 */ +{10.0000, -9999.00, 2.08082}, +{10.1617, -9999.00, 1.95184}, +{10.3261, -9999.00, 1.83085}, +{10.4931, -9999.00, 1.71736}, +{10.6628, -9999.00, 1.61441}, +{10.8353, -9999.00, 1.55876}, +{11.0106, -9999.00, 1.50503}, +{11.1886, -9999.00, 1.45051}, +{11.3696, -9999.00, 1.39724}, +{11.5535, -9999.00, 1.34593}, +{11.7404, -9999.00, 1.29650}, +{11.9303, -9999.00, 1.24889}, +{12.1232, -9999.00, 1.21967}, +{12.3193, -9999.00, 1.20557}, +{12.5186, -9999.00, 1.19164}, +{12.7210, -9999.00, 1.17786}, +{12.9268, -9999.00, 1.16425}, +{13.1359, -9999.00, 1.16057}, +{13.3483, -9999.00, 1.16657}, +{13.5642, -9999.00, 1.17260}, +{13.7836, -9999.00, 1.17867}, +{14.0066, -9999.00, 1.18476}, +{14.2331, -9999.00, 1.20099}, +{14.4633, -9999.00, 1.19353}, +{14.6973, -9999.00, 1.18611}, +{14.9350, -9999.00, 1.17874}, +{15.1765, -9999.00, 1.17142}, +{15.4220, -9999.00, 1.16565}, +{15.6714, -9999.00, 1.16015}, +{15.9249, -9999.00, 1.15468}, +{16.1825, -9999.00, 1.14924}, +{16.4442, -9999.00, 1.14382}, +{16.7102, -9999.00, 1.13842}, +{16.9805, -9999.00, 1.14709}, +{17.2551, -9999.00, 1.15990}, +{17.5342, -9999.00, 1.17285}, +{17.8178, -9999.00, 1.18594}, +{18.1060, -9999.00, 1.19919}, +{18.3989, -9999.00, 1.21310}, +{18.6964, -9999.00, 1.24435}, +{18.9988, -9999.00, 1.27640}, +{19.3061, -9999.00, 1.30927}, +{19.6184, -9999.00, 1.34532}, +{19.9357, -9999.00, 1.42138}, +{20.2582, -9999.00, 1.50173}, +{20.5858, -9999.00, 1.58663}, +{20.9188, -9999.00, 1.68236}, +{21.2571, -9999.00, 1.80173}, +{21.6009, -9999.00, 1.92956}, +{21.9503, -9999.00, 2.09847}, +{22.3053, -9999.00, 2.29089}, +{22.6661, -9999.00, 2.49294}, +{23.0327, -9999.00, 2.70543}, +{23.4053, -9999.00, 2.93604}, +{23.7838, -9999.00, 3.25803}, +{24.1685, -9999.00, 3.62622}, +{24.5594, -9999.00, 4.16607}, +{24.9566, -9999.00, 4.75364}, +{25.3603, -9999.00, 5.26298}, +{25.7705, -9999.00, 5.84591}, +{26.1873, -9999.00, 6.91208}, +{26.6109, -9999.00, 7.90552}, +{27.0413, -9999.00, 8.56029}, +{27.4786, -9999.00, 9.26928}, +{27.9231, -9999.00, 9.84883}, +{28.3747, -9999.00, 10.2852}, +{28.8337, -9999.00, 10.7408}, +{29.3000, 1.61714, 11.2166}, +{29.7739, 2.25008, 11.5635}, +{30.2555, 2.82561, 11.7878}, +{30.7449, 3.36098, 12.0164}, +{31.2421, 3.90478, 12.2494}, +{31.7475, 4.49161, 12.4870}, +{32.2609, 5.21040, 12.6664}, +{32.7827, 5.91336, 12.6181}, +{33.3130, 6.47805, 12.5699}, +{33.8518, 7.03846, 12.5220}, +{34.3993, 7.63656, 12.4490}, +{34.9557, 8.21802, 12.2756}, +{35.5211, 8.79008, 12.1046}, +{36.0956, 9.39410, 11.8322}, +{36.6794, 9.89898, 11.3706}, +{37.2727, 10.2677, 10.9089}, +{37.8755, 10.5227, 10.4057}, +{38.4882, 10.6245, 9.92566}, +{39.1107, 10.6590, 9.62909}, +{39.7432, 10.7345, 9.35283}, +{40.3861, 10.7938, 9.08450}, +{41.0393, 10.8369, 8.84579}, +{41.7031, 10.8760, 8.61653}, +{42.3776, 10.8884, 8.39321}, +{43.0630, 10.8756, 8.21373}, +{43.7595, 10.8708, 8.06293}, +{44.4673, 10.8700, 7.91489}, +{45.1865, 10.8539, 7.77724}, +{45.9174, 10.8393, 7.68139}, +{46.6600, 10.8413, 7.58672}, +{47.4147, 10.8465, 7.49322}, +{48.1816, 10.8512, 7.40087}, +{48.9609, 10.8519, 7.30966}, +{49.7528, 10.8480, 7.22189}, +{50.5576, 10.8395, 7.13571}, +{51.3753, 10.8226, 7.05057}, +{52.2062, 10.7925, 6.96644}, +{53.0506, 10.7315, 6.88331}, +{53.9087, 10.6567, 6.87159}, +{54.7806, 10.6165, 6.87255}, +{55.6667, 10.5931, 6.87350}, +{56.5670, 10.5766, 6.87446}, +{57.4820, 10.5638, 6.87542}, +{58.4117, 10.5510, 6.87637}, +{59.3564, 10.5395, 6.88692}, +{60.3165, 10.5347, 6.89812}, +{61.2921, 10.5327, 6.90935}, +{62.2834, 10.5321, 6.92059}, +{63.2908, 10.5318, 6.93185}, +{64.3145, 10.5300, 6.94312}, +{65.3547, 10.5272, 6.95944}, +{66.4118, 10.5265, 6.97691}, +{67.4859, 10.5262, 6.99441}, +{68.5775, 10.5247, 7.01197}, +{69.6867, 10.5208, 7.02956}, +{70.8138, 10.5116, 7.04720}, +{71.9591, 10.4922, 7.07401}, +{73.1230, 10.4769, 7.11892}, +{74.3057, 10.4744, 7.16412}, +{75.5076, 10.4754, 7.20960}, +{76.7289, 10.4797, 7.25538}, +{77.9699, 10.4874, 7.30144}, +{79.2310, 10.5041, 7.34780}, +{80.5125, 10.5288, 7.38400}, +{81.8147, 10.5424, 7.39458}, +{83.1380, 10.5366, 7.41089}, +{84.4827, 10.5265, 7.43971}, +{85.8491, 10.5172, 7.46864}, +{87.2377, 10.5054, 7.49768}, +{88.6487, 10.4906, 7.52684}, +{90.0825, 10.4724, 7.55612}, +{91.5395, 10.4509, 7.58550}, +{93.0201, 10.4258, 7.61294}, +{94.5246, 10.3945, 7.63888}, +{96.0535, 10.3564, 7.66491}, +{97.6071, 10.3120, 7.69103}, +{99.1858, 10.2610, 7.71724}, +{100.790, 10.2034, 7.74354}, +{102.420, 10.1396, 7.76993}, +{104.077, 10.0731, 7.79640}, +{105.760, 10.0048, 7.80766}, +{107.471, 9.91759, 7.80415}, +{109.209, 9.80847, 7.80065}, +{110.975, 9.69292, 7.79715}, +{112.770, 9.57775, 7.76001}, +{114.594, 9.41891, 7.67835}, +{116.448, 9.23473, 7.59757}, +{118.331, 9.01946, 7.43854}, +{120.245, 8.68793, 7.18519}, +{122.190, 8.20607, 6.90143}, +{124.166, 7.54570, 6.60975}, +{126.175, 6.70058, 6.32999}, +{128.215, 5.63631, 6.06207}, +{130.289, 4.28758, 5.80550}, +{132.397, 2.53971, 5.56657}, +{134.538, 0.207075, 5.35179}, +{136.714, -3.39847, 5.27329}, +{138.925, -8.66782, 5.84978}, +{141.172, -16.4319, 10.3240}, +{143.456, -25.7377, 19.1704}, +{145.776, -31.4923, 40.4382}, +{148.134, -8.67966, 79.0764}, +{150.530, 28.2039, 58.4450}, +{152.964, 34.0959, 40.5585}, +{155.439, 32.2495, 29.8237}, +{157.953, 28.4436, 24.6593}, +{160.507, 26.2653, 23.0483}, +{163.103, 25.0742, 21.8142}, +{165.742, 24.4024, 21.2364}, +{168.422, 24.1813, 20.6677}, +{171.146, 24.1129, 20.0737}, +{173.915, 24.0788, 19.4967}, +{176.727, 24.0215, 18.9810}, +{179.586, 24.0014, 18.5924}, +{182.491, 24.0667, 18.2117}, +{185.442, 24.1443, 17.8388}, +{188.442, 24.2259, 17.4736}, +{191.489, 24.3021, 17.1158}, +{194.587, 24.3649, 16.7654}, +{197.734, 24.4079, 16.4221}, +{200.932, 24.3633, 16.0859}, +{204.182, 24.2979, 15.9096}, +{207.485, 24.3405, 15.7464}, +{210.840, 24.3952, 15.5848}, +{214.251, 24.4609, 15.4248}, +{217.716, 24.5319, 15.2665}, +{221.237, 24.6035, 15.1099}, +{224.816, 24.6695, 14.9548}, +{228.452, 24.7226, 14.8161}, +{232.147, 24.7832, 14.7047}, +{235.902, 24.8625, 14.5940}, +{239.717, 24.9452, 14.4843}, +{243.595, 25.0303, 14.3753}, +{247.535, 25.1161, 14.2672}, +{251.538, 25.2007, 14.1598}, +{255.607, 25.2834, 14.0550}, +{259.741, 25.3654, 13.9532}, +{263.942, 25.4463, 13.8522}, +{268.211, 25.5246, 13.7518}, +{272.549, 25.5991, 13.6523}, +{276.957, 25.6687, 13.5534}, +{281.437, 25.7316, 13.4553}, +{285.989, 25.7852, 13.3578}, +{290.615, 25.8228, 13.2611}, +{295.315, 25.8311, 13.1850}, +{300.092, 25.8445, 13.1589}, +{304.945, 25.8884, 13.1329}, +{309.878, 25.9347, 13.1068}, +{314.890, 25.9789, 13.0809}, +{319.983, 26.0050, 13.0550}, +{325.158, 26.0249, 13.0969}, +{330.418, 26.0927, 13.1473}, +{335.762, 26.1981, 13.1978}, +{341.192, 26.3269, 13.2203}, +{346.711, 26.4464, 13.2179}, +{352.319, 26.5593, 13.2155}, +{358.017, 26.6715, 13.2131}, +{363.808, 26.7843, 13.2107}, +{369.692, 26.8986, 13.2083}, +{375.672, 27.0149, 13.2059}, +{381.748, 27.1337, 13.2035}, +{387.922, 27.2560, 13.2010}, +{394.197, 27.3891, 13.1983}, +{400.573, 27.5240, 13.1737}, +{407.052, 27.6450, 13.1491}, +{413.635, 27.7633, 13.1245}, +{420.326, 27.8786, 13.1000}, +{427.124, 27.9911, 13.0756}, +{434.032, 28.1003, 13.0511}, +{441.052, 28.2057, 13.0268}, +{448.186, 28.2930, 13.0025}, +{455.435, 28.3752, 13.0113}, +{462.802, 28.4847, 13.0289}, +{470.287, 28.6049, 13.0466}, +{477.894, 28.7360, 13.0643}, +{485.623, 28.8787, 13.0820}, +{493.478, 29.0595, 13.0997}, +{501.459, 29.2551, 13.0561}, +{509.570, 29.4066, 12.9981}, +{517.812, 29.5480, 12.9404}, +{526.187, 29.6817, 12.8829}, +{534.698, 29.8103, 12.8257}, +{543.346, 29.9353, 12.7688}, +{552.134, 30.0586, 12.7121}, +{561.065, 30.1844, 12.6556}, +{570.139, 30.3174, 12.5980}, +{579.361, 30.4494, 12.5046}, +{588.732, 30.5595, 12.4110}, +{598.254, 30.6585, 12.3174}, +{607.930, 30.7493, 12.2245}, +{617.763, 30.8347, 12.1324}, +{627.755, 30.9167, 12.0402}, +{637.908, 30.9995, 11.9388}, +{648.226, 31.0727, 11.8237}, +{658.711, 31.1227, 11.7003}, +{669.365, 31.1510, 11.5783}, +{680.191, 31.1598, 11.4758}, +{691.193, 31.1702, 11.3879}, +{702.372, 31.1933, 11.3032}, +{713.733, 31.2173, 11.2004}, +{725.277, 31.2208, 11.0857}, +{737.008, 31.2086, 10.9724}, +{748.928, 31.1840, 10.8601}, +{761.042, 31.1476, 10.7487}, +{773.351, 31.1020, 10.6367}, +{785.859, 31.0440, 10.5192}, +{798.570, 30.9661, 10.3977}, +{811.486, 30.8693, 10.2777}, +{824.611, 30.7545, 10.1590}, +{837.949, 30.6210, 10.0415}, +{851.502, 30.4684, 9.92374}, +{865.274, 30.2935, 9.80533}, +{879.269, 30.0928, 9.68655}, +{893.491, 29.8647, 9.56910}, +{907.943, 29.6071, 9.45308}, +{922.628, 29.3180, 9.33848}, +{937.551, 28.9926, 9.21895}, +{952.715, 28.6213, 9.09921}, +{968.124, 28.1979, 8.97950}, +{983.783, 27.7155, 8.86170}, +{999.695, 27.1650, 8.74463}, +{1015.86, 26.5329, 8.62824}, +{1032.29, 25.7998, 8.50656}, +{1048.99, 24.9364, 8.38533}, +{1065.96, 23.9079, 8.26456}, +{1083.20, 22.6611, 8.14550}, +{1100.72, 21.1120, 8.02816}, +{1118.52, 19.1152, 7.91251}, +{1136.61, 16.3888, 7.79868}, +{1155.00, 12.2664, 7.68644}, +{1173.68, 4.38473, 7.57573}, +{1189.50, -50.9821, 7.48456}, +{1189.70, -50.9570, 42.3406}, +{1192.66, -12.7603, 42.1966}, +{1211.95, 10.1739, 41.2793}, +{1231.55, 17.7389, 40.3820}, +{1251.47, 22.4771, 39.5065}, +{1271.72, 25.9380, 38.6533}, +{1292.29, 28.6560, 37.8223}, +{1313.19, 30.8796, 37.0092}, +{1334.43, 32.7423, 36.2135}, +{1356.01, 34.3250, 35.4348}, +{1377.94, 35.6789, 34.6727}, +{1400.23, 36.8359, 33.9271}, +{1422.88, 37.8138, 33.1974}, +{1445.89, 38.6179, 32.4837}, +{1469.28, 39.2321, 31.7827}, +{1493.04, 39.6038, 31.0928}, +{1517.19, 39.6186, 30.4023}, +{1541.73, 36.6250, 29.7251}, +{1543.90, 32.7823, 29.6664}, +{1544.10, 32.8061, 34.2371}, +{1566.67, 40.6907, 33.6129}, +{1592.01, 42.3335, 32.9358}, +{1617.76, 43.4144, 32.2723}, +{1643.92, 43.7584, 31.6220}, +{1670.51, 43.9654, 32.1788}, +{1688.20, 45.0624, 32.5496}, +{1688.40, 45.0902, 32.6806}, +{1697.53, 45.8366, 32.4414}, +{1724.99, 47.1124, 31.7399}, +{1752.89, 48.0608, 31.0536}, +{1781.24, 48.8386, 30.3820}, +{1810.05, 49.4808, 29.7243}, +{1839.32, 49.9724, 29.0812}, +{1869.07, 50.1184, 28.4522}, +{1880.70, 48.4670, 28.2127}, +{1880.90, 48.4714, 29.4562}, +{1899.30, 50.9058, 29.0700}, +{1930.02, 51.8421, 28.4445}, +{1961.24, 52.5400, 27.8325}, +{1992.96, 53.1353, 27.2335}, +{2025.20, 53.6693, 26.6561}, +{2057.95, 54.1618, 26.0788}, +{2091.24, 54.6076, 25.5111}, +{2125.06, 55.0180, 24.9546}, +{2159.43, 55.3972, 24.4086}, +{2194.36, 55.7484, 23.8730}, +{2229.85, 56.0743, 23.3478}, +{2265.92, 56.3771, 22.8328}, +{2302.57, 56.6584, 22.3283}, +{2339.81, 56.9202, 21.8331}, +{2377.66, 57.1638, 21.3496}, +{2416.11, 57.3910, 20.8740}, +{2455.19, 57.6017, 20.4093}, +{2494.90, 57.7985, 19.9523}, +{2535.26, 57.9798, 19.5064}, +{2576.26, 58.1489, 19.0687}, +{2617.93, 58.3051, 18.6398}, +{2660.27, 58.4490, 18.2205}, +{2703.30, 58.5832, 17.8107}, +{2747.03, 58.7071, 17.4079}, +{2791.46, 58.8202, 17.0139}, +{2836.61, 58.9241, 16.6283}, +{2882.49, 59.0188, 16.2510}, +{2929.11, 59.1055, 15.8823}, +{2976.48, 59.1844, 15.5207}, +{3024.63, 59.2554, 15.1669}, +{3073.55, 59.3192, 14.8209}, +{3123.26, 59.3763, 14.4820}, +{3173.78, 59.4262, 14.1500}, +{3225.11, 59.4693, 13.8261}, +{3277.27, 59.5077, 13.5092}, +{3330.28, 59.5400, 13.1982}, +{3384.15, 59.5663, 12.8943}, +{3438.88, 59.5871, 12.5971}, +{3494.50, 59.6031, 12.3065}, +{3551.02, 59.6140, 12.0221}, +{3608.46, 59.6202, 11.7439}, +{3666.82, 59.6217, 11.4718}, +{3726.13, 59.6188, 11.2056}, +{3786.40, 59.6114, 10.9452}, +{3847.64, 59.5997, 10.6905}, +{3909.87, 59.5839, 10.4415}, +{3973.11, 59.5642, 10.1980}, +{4037.38, 59.5403, 9.95962}, +{4102.68, 59.5125, 9.72657}, +{4169.03, 59.4807, 9.49859}, +{4236.46, 59.4449, 9.27565}, +{4304.98, 59.4053, 9.05766}, +{4374.62, 59.3617, 8.84453}, +{4445.37, 59.3143, 8.63594}, +{4517.27, 59.2627, 8.43192}, +{4590.33, 59.2070, 8.23247}, +{4664.58, 59.1471, 8.03739}, +{4740.03, 59.0828, 7.84656}, +{4816.69, 59.0140, 7.65993}, +{4894.60, 58.9405, 7.47742}, +{4973.77, 58.8620, 7.29889}, +{5054.21, 58.7782, 7.12426}, +{5135.96, 58.6889, 6.95345}, +{5219.03, 58.5934, 6.78638}, +{5303.44, 58.4915, 6.62317}, +{5389.22, 58.3826, 6.46343}, +{5476.39, 58.2660, 6.30704}, +{5564.97, 58.1407, 6.15433}, +{5654.98, 58.0061, 6.00451}, +{5746.44, 57.8604, 5.85833}, +{5839.39, 57.7028, 5.71526}, +{5933.83, 57.5312, 5.57525}, +{6029.81, 57.3433, 5.43840}, +{6127.33, 57.1363, 5.30452}, +{6226.44, 56.9066, 5.17352}, +{6327.15, 56.6490, 5.04537}, +{6429.48, 56.3568, 4.92003}, +{6533.48, 56.0200, 4.79726}, +{6639.15, 55.6238, 4.67723}, +{6746.54, 55.1447, 4.55972}, +{6855.65, 54.5406, 4.44486}, +{6966.54, 53.7261, 4.33248}, +{7079.22, 52.4742, 4.22248}, +{7193.72, 49.6320, 4.11493}, +{7242.70, 34.9712, 4.07027}, +{7242.90, 34.9728, 11.5429}, +{7310.07, 50.4736, 11.3460}, +{7428.31, 52.7873, 11.0117}, +{7548.45, 53.7385, 10.6875}, +{7670.54, 54.1252, 10.3725}, +{7794.61, 53.9646, 10.0670}, +{7920.68, 51.2168, 9.77051}, +{7930.20, 45.6221, 9.74865}, +{7930.40, 45.6233, 13.6270}, +{8048.79, 54.7086, 13.2418}, +{8178.98, 55.7713, 12.8369}, +{8311.26, 56.0165, 12.4442}, +{8375.50, 52.7709, 12.2600}, +{8375.70, 52.7735, 14.0470}, +{8445.69, 56.7057, 13.8757}, +{8582.29, 57.8654, 13.5512}, +{8721.11, 58.6277, 13.2322}, +{8862.16, 59.2326, 12.9188}, +{9005.50, 59.7415, 12.6107}, +{9151.16, 60.1816, 12.3079}, +{9299.17, 60.5686, 12.0108}, +{9449.58, 60.9131, 11.7195}, +{9602.42, 61.2224, 11.4337}, +{9757.73, 61.5011, 11.1533}, +{9915.55, 61.7537, 10.8789}, +{10075.9, 61.9839, 10.6094}, +{10238.9, 62.1930, 10.3454}, +{10404.5, 62.3839, 10.0868}, +{10572.8, 62.5584, 9.83363}, +{10743.8, 62.7180, 9.58574}, +{10917.6, 62.8639, 9.34313}, +{11094.2, 62.9975, 9.10575}, +{11273.6, 63.1197, 8.87352}, +{11455.9, 63.2314, 8.64641}, +{11641.2, 63.3335, 8.42435}, +{11829.5, 63.4266, 8.20725}, +{12020.8, 63.5115, 7.99507}, +{12215.3, 63.5887, 7.78772}, +{12412.8, 63.6587, 7.58514}, +{12613.6, 63.7222, 7.38725}, +{12817.6, 63.7794, 7.19399}, +{13025.0, 63.8310, 7.00527}, +{13235.6, 63.8771, 6.82102}, +{13449.7, 63.9182, 6.64116}, +{13667.2, 63.9547, 6.46561}, +{13888.3, 63.9868, 6.29430}, +{14112.9, 64.0147, 6.12715}, +{14341.2, 64.0389, 5.96408}, +{14573.1, 64.0594, 5.80501}, +{14808.9, 64.0767, 5.64986}, +{15048.4, 64.0908, 5.49856}, +{15291.8, 64.1019, 5.35103}, +{15539.1, 64.1103, 5.20720}, +{15790.4, 64.1162, 5.06698}, +{16045.8, 64.1196, 4.93030}, +{16305.4, 64.1208, 4.79709}, +{16569.1, 64.1199, 4.66727}, +{16837.1, 64.1170, 4.54077}, +{17109.4, 64.1123, 4.41752}, +{17386.1, 64.1059, 4.29744}, +{17667.4, 64.0979, 4.18046}, +{17953.1, 64.0884, 4.06651}, +{18243.5, 64.0775, 3.95553}, +{18538.6, 64.0653, 3.84744}, +{18838.4, 64.0518, 3.74219}, +{19143.1, 64.0373, 3.63969}, +{19452.7, 64.0217, 3.53990}, +{19767.4, 64.0051, 3.44274}, +{20087.1, 63.9875, 3.34815}, +{20412.0, 63.9692, 3.25607}, +{20742.1, 63.9500, 3.16643}, +{21077.6, 63.9301, 3.07919}, +{21418.5, 63.9095, 2.99428}, +{21765.0, 63.8882, 2.91164}, +{22117.0, 63.8664, 2.83122}, +{22474.7, 63.8440, 2.75297}, +{22838.2, 63.8211, 2.67681}, +{23207.6, 63.7977, 2.60272}, +{23583.0, 63.7738, 2.53063}, +{23964.4, 63.7495, 2.46049}, +{24352.0, 63.7248, 2.39226}, +{24745.9, 63.6997, 2.32588}, +{25146.2, 63.6742, 2.26131}, +{25552.9, 63.6483, 2.19849}, +{25966.2, 63.6222, 2.13740}, +{26386.1, 63.5956, 2.07797}, +{26812.9, 63.5688, 2.02017}, +{27246.6, 63.5416, 1.96395}, +{27687.3, 63.5141, 1.90928}, +{28135.1, 63.4863, 1.85611}, +{28590.2, 63.4581, 1.80440}, +{29052.6, 63.4296, 1.75412}, +{29522.5, 63.4008, 1.70522}, +{30000.0, 63.3715, 1.65767}, +{0, 0, 0} +}; + +e_fp_fdp tb[] = { /* Z = 65 */ +{10.0000, -9999.00, 0.159742}, +{10.1617, -9999.00, 0.166245}, +{10.3261, -9999.00, 0.173012}, +{10.4931, -9999.00, 0.180055}, +{10.6628, -9999.00, 0.187385}, +{10.8353, -9999.00, 0.195013}, +{11.0106, -9999.00, 0.202952}, +{11.1886, -9999.00, 0.211214}, +{11.3696, -9999.00, 0.219812}, +{11.5535, -9999.00, 0.228226}, +{11.7404, -9999.00, 0.236751}, +{11.9303, -9999.00, 0.245594}, +{12.1232, -9999.00, 0.254768}, +{12.3193, -9999.00, 0.264285}, +{12.5186, -9999.00, 0.273910}, +{12.7210, -9999.00, 0.283712}, +{12.9268, -9999.00, 0.293864}, +{13.1359, -9999.00, 0.304379}, +{13.3483, -9999.00, 0.315270}, +{13.5642, -9999.00, 0.326552}, +{13.7836, -9999.00, 0.337737}, +{14.0066, -9999.00, 0.348276}, +{14.2331, -9999.00, 0.359144}, +{14.4633, -9999.00, 0.370352}, +{14.6973, -9999.00, 0.381909}, +{14.9350, -9999.00, 0.393826}, +{15.1765, -9999.00, 0.405719}, +{15.4220, -9999.00, 0.417451}, +{15.6714, -9999.00, 0.429521}, +{15.9249, -9999.00, 0.441941}, +{16.1825, -9999.00, 0.454720}, +{16.4442, -9999.00, 0.467868}, +{16.7102, -9999.00, 0.481745}, +{16.9805, -9999.00, 0.496359}, +{17.2551, -9999.00, 0.511416}, +{17.5342, -9999.00, 0.526930}, +{17.8178, -9999.00, 0.542915}, +{18.1060, -9999.00, 0.559384}, +{18.3989, -9999.00, 0.576354}, +{18.6964, -9999.00, 0.593148}, +{18.9988, -9999.00, 0.608687}, +{19.3061, -9999.00, 0.624634}, +{19.6184, -9999.00, 0.640999}, +{19.9357, -9999.00, 0.657792}, +{20.2582, -9999.00, 0.675025}, +{20.5858, -9999.00, 0.692710}, +{20.9188, -9999.00, 0.724043}, +{21.2571, -9999.00, 0.776670}, +{21.6009, -9999.00, 0.833122}, +{21.9503, -9999.00, 0.893678}, +{22.3053, -9999.00, 0.979492}, +{22.6661, -9999.00, 1.10391}, +{23.0327, -9999.00, 1.24412}, +{23.4053, -9999.00, 1.40705}, +{23.7838, -9999.00, 1.59497}, +{24.1685, -9999.00, 1.81469}, +{24.5594, -9999.00, 2.08010}, +{24.9566, -9999.00, 2.39091}, +{25.3603, -9999.00, 2.75770}, +{25.7705, -9999.00, 3.19423}, +{26.1873, -9999.00, 3.69098}, +{26.6109, -9999.00, 4.10723}, +{27.0413, -9999.00, 4.57043}, +{27.4786, -9999.00, 5.24241}, +{27.9231, -9999.00, 6.01694}, +{28.3747, -9999.00, 6.60161}, +{28.8337, -9999.00, 7.20507}, +{29.3000, 0.651582, 7.86585}, +{29.7739, 0.948041, 8.62195}, +{30.2555, 1.55893, 9.28488}, +{30.7449, 2.08510, 9.66368}, +{31.2421, 2.56789, 10.0579}, +{31.7475, 3.13073, 10.4175}, +{32.2609, 3.68079, 10.6738}, +{32.7827, 4.28397, 10.9364}, +{33.3130, 4.92504, 10.9587}, +{33.8518, 5.42173, 10.9326}, +{34.3993, 5.84829, 10.9065}, +{34.9557, 6.24186, 10.8776}, +{35.5211, 6.60670, 10.8443}, +{36.0956, 6.95255, 10.8111}, +{36.6794, 7.29092, 10.7780}, +{37.2727, 7.64482, 10.7177}, +{37.8755, 7.95242, 10.6153}, +{38.4882, 8.22692, 10.5139}, +{39.1107, 8.48003, 10.4123}, +{39.7432, 8.71062, 10.3046}, +{40.3861, 8.91904, 10.1981}, +{41.0393, 9.10497, 10.0926}, +{41.7031, 9.26303, 10.0016}, +{42.3776, 9.42216, 9.92379}, +{43.0630, 9.57536, 9.84662}, +{43.7595, 9.71641, 9.77007}, +{44.4673, 9.83881, 9.70466}, +{45.1865, 9.96488, 9.65008}, +{45.9174, 10.0877, 9.59580}, +{46.6600, 10.1980, 9.54183}, +{47.4147, 10.2943, 9.51503}, +{48.1816, 10.4103, 9.50090}, +{48.9609, 10.5395, 9.48681}, +{49.7528, 10.6853, 9.47067}, +{50.5576, 10.8281, 9.41852}, +{51.3753, 10.9560, 9.36665}, +{52.2062, 11.0748, 9.31505}, +{53.0506, 11.1879, 9.26375}, +{53.9087, 11.2960, 9.21273}, +{54.7806, 11.3997, 9.16199}, +{55.6667, 11.4992, 9.11154}, +{56.5670, 11.5953, 9.06136}, +{57.4820, 11.6888, 9.01146}, +{58.4117, 11.7830, 8.95721}, +{59.3564, 11.8669, 8.89748}, +{60.3165, 11.9431, 8.83814}, +{61.2921, 12.0125, 8.77920}, +{62.2834, 12.0753, 8.72066}, +{63.2908, 12.1311, 8.66251}, +{64.3145, 12.1794, 8.60473}, +{65.3547, 12.2190, 8.54736}, +{66.4118, 12.2466, 8.49036}, +{67.4859, 12.2514, 8.43388}, +{68.5775, 12.2487, 8.42013}, +{69.6867, 12.2626, 8.41337}, +{70.8138, 12.2822, 8.40662}, +{71.9591, 12.3032, 8.39986}, +{73.1230, 12.3237, 8.39312}, +{74.3057, 12.3423, 8.38639}, +{75.5076, 12.3564, 8.37966}, +{76.7289, 12.3608, 8.37945}, +{77.9699, 12.3696, 8.38679}, +{79.2310, 12.3796, 8.39413}, +{80.5125, 12.3871, 8.40148}, +{81.8147, 12.3907, 8.40884}, +{83.1380, 12.3865, 8.41620}, +{84.4827, 12.3626, 8.42425}, +{85.8491, 12.3414, 8.47264}, +{87.2377, 12.3344, 8.52130}, +{88.6487, 12.3329, 8.57025}, +{90.0825, 12.3340, 8.61947}, +{91.5395, 12.3359, 8.66899}, +{93.0201, 12.3363, 8.71878}, +{94.5246, 12.3285, 8.76885}, +{96.0535, 12.3263, 8.84827}, +{97.6071, 12.3402, 8.92850}, +{99.1858, 12.3698, 9.00947}, +{100.790, 12.4237, 9.09117}, +{102.420, 12.5446, 9.12287}, +{104.077, 12.6061, 9.08698}, +{105.760, 12.6262, 9.05122}, +{107.471, 12.6310, 9.01560}, +{109.209, 12.6419, 8.96983}, +{110.975, 12.6146, 8.88177}, +{112.770, 12.5455, 8.79458}, +{114.594, 12.4456, 8.70825}, +{116.448, 12.3175, 8.62277}, +{118.331, 12.1643, 8.53812}, +{120.245, 11.9969, 8.45430}, +{122.190, 11.8745, 8.31163}, +{124.166, 11.5952, 8.02328}, +{126.175, 11.1709, 7.74493}, +{128.215, 10.6144, 7.47623}, +{130.289, 9.92880, 7.21686}, +{132.397, 9.08448, 6.89601}, +{134.538, 7.97678, 6.55137}, +{136.714, 6.46892, 5.94455}, +{138.925, 4.06168, 5.45334}, +{141.172, 0.388114, 5.10897}, +{143.456, -6.29039, 5.19253}, +{145.776, -16.6894, 12.8836}, +{148.134, -20.6146, 33.5857}, +{150.530, 0.144398E-02, 46.5790}, +{152.964, 14.1930, 42.5670}, +{155.439, 21.5318, 36.3238}, +{157.953, 23.6132, 29.9094}, +{160.507, 22.7550, 25.9582}, +{163.103, 22.0993, 24.5422}, +{165.742, 22.1845, 23.6741}, +{168.422, 22.3931, 22.8367}, +{171.146, 22.6604, 22.1813}, +{173.915, 22.9563, 21.5515}, +{176.727, 23.2307, 20.9397}, +{179.586, 23.4066, 20.3905}, +{182.491, 23.6184, 19.9507}, +{185.442, 23.8346, 19.5204}, +{188.442, 24.0288, 19.0993}, +{191.489, 24.1720, 18.6873}, +{194.587, 24.2966, 18.3677}, +{197.734, 24.4312, 18.0626}, +{200.932, 24.5559, 17.7625}, +{204.182, 24.6523, 17.4953}, +{207.485, 24.7626, 17.2606}, +{210.840, 24.8736, 17.0290}, +{214.251, 24.9794, 16.7996}, +{217.716, 25.0632, 16.5628}, +{221.237, 25.1112, 16.3294}, +{224.816, 25.0856, 16.0993}, +{228.452, 25.0021, 16.0346}, +{232.147, 25.0119, 16.0485}, +{235.902, 25.1024, 16.0624}, +{239.717, 25.2504, 16.0764}, +{243.595, 25.4363, 16.0110}, +{247.535, 25.5902, 15.9135}, +{251.538, 25.7147, 15.8167}, +{255.607, 25.8244, 15.7245}, +{259.741, 25.9255, 15.6375}, +{263.942, 26.0134, 15.5510}, +{268.211, 26.0694, 15.4649}, +{272.549, 26.0766, 15.4347}, +{276.957, 26.1377, 15.4750}, +{281.437, 26.2352, 15.5154}, +{285.989, 26.3550, 15.5559}, +{290.615, 26.4938, 15.5965}, +{295.315, 26.6610, 15.6373}, +{300.092, 26.8530, 15.6447}, +{304.945, 27.0261, 15.6246}, +{309.878, 27.1885, 15.6046}, +{314.890, 27.3458, 15.5846}, +{319.983, 27.4994, 15.5647}, +{325.158, 27.6484, 15.5447}, +{330.418, 27.7868, 15.5248}, +{335.762, 27.9239, 15.5305}, +{341.192, 28.0736, 15.5421}, +{346.711, 28.2344, 15.5537}, +{352.319, 28.4028, 15.5653}, +{358.017, 28.5815, 15.5769}, +{363.808, 28.7773, 15.5787}, +{369.692, 28.9649, 15.5610}, +{375.672, 29.1472, 15.5434}, +{381.748, 29.3287, 15.5257}, +{387.922, 29.5113, 15.5081}, +{394.197, 29.6976, 15.4906}, +{400.573, 29.8973, 15.4682}, +{407.052, 30.0878, 15.4231}, +{413.635, 30.2691, 15.3782}, +{420.326, 30.4453, 15.3334}, +{427.124, 30.6180, 15.2887}, +{434.032, 30.7880, 15.2442}, +{441.052, 30.9557, 15.1998}, +{448.186, 31.1193, 15.1555}, +{455.435, 31.2824, 15.1168}, +{462.802, 31.4481, 15.0791}, +{470.287, 31.6155, 15.0415}, +{477.894, 31.7851, 15.0040}, +{485.623, 31.9576, 14.9665}, +{493.478, 32.1428, 14.9292}, +{501.459, 32.3270, 14.8701}, +{509.570, 32.5022, 14.8090}, +{517.812, 32.6744, 14.7482}, +{526.187, 32.8525, 14.6876}, +{534.698, 33.0278, 14.6120}, +{543.346, 33.1947, 14.5346}, +{552.134, 33.3580, 14.4576}, +{561.065, 33.5202, 14.3810}, +{570.139, 33.6839, 14.3048}, +{579.361, 33.8537, 14.2291}, +{588.732, 34.0492, 14.1537}, +{598.254, 34.2377, 14.0114}, +{607.930, 34.3961, 13.8611}, +{617.763, 34.5297, 13.7124}, +{627.755, 34.6490, 13.5653}, +{637.908, 34.7563, 13.4198}, +{648.226, 34.8530, 13.2759}, +{658.711, 34.9401, 13.1335}, +{669.365, 35.0181, 12.9926}, +{680.191, 35.0902, 12.8525}, +{691.193, 35.1520, 12.7099}, +{702.372, 35.2030, 12.5689}, +{713.733, 35.2446, 12.4295}, +{725.277, 35.2774, 12.2916}, +{737.008, 35.3015, 12.1552}, +{748.928, 35.3175, 12.0203}, +{761.042, 35.3283, 11.8870}, +{773.351, 35.3294, 11.7447}, +{785.859, 35.3153, 11.6011}, +{798.570, 35.2862, 11.4593}, +{811.486, 35.2437, 11.3191}, +{824.611, 35.1878, 11.1808}, +{837.949, 35.1187, 11.0440}, +{851.502, 35.0356, 10.9070}, +{865.274, 34.9366, 10.7695}, +{879.269, 34.8184, 10.6317}, +{893.491, 34.6806, 10.4957}, +{907.943, 34.5224, 10.3613}, +{922.628, 34.3442, 10.2287}, +{937.551, 34.1406, 10.0912}, +{952.715, 33.9072, 9.95386}, +{968.124, 33.6395, 9.81685}, +{983.783, 33.3352, 9.68203}, +{999.695, 32.9904, 9.54793}, +{1015.86, 32.6002, 9.41447}, +{1032.29, 32.1508, 9.27440}, +{1048.99, 31.6311, 9.13631}, +{1065.96, 31.0283, 9.00026}, +{1083.20, 30.3249, 8.86615}, +{1100.72, 29.4953, 8.73396}, +{1118.52, 28.5020, 8.60365}, +{1136.61, 27.2887, 8.47560}, +{1155.00, 25.7630, 8.34937}, +{1173.68, 23.7598, 8.22492}, +{1192.66, 20.9402, 8.10249}, +{1211.95, 16.4119, 7.98186}, +{1231.55, 5.86091, 7.86299}, +{1241.00, -39.6154, 7.80701}, +{1241.20, -39.5880, 39.5864}, +{1251.47, 7.88700, 39.1186}, +{1271.72, 19.5288, 38.2240}, +{1292.29, 25.2158, 37.3498}, +{1313.19, 29.0414, 36.4957}, +{1334.43, 31.9206, 35.6610}, +{1356.01, 34.2140, 34.8454}, +{1377.94, 36.1013, 34.0484}, +{1400.23, 37.6850, 33.2696}, +{1422.88, 39.0278, 32.5088}, +{1445.89, 40.1696, 31.7655}, +{1469.28, 41.1342, 31.0390}, +{1493.04, 41.9325, 30.3289}, +{1517.19, 42.5611, 29.6352}, +{1541.73, 42.9931, 28.9575}, +{1566.67, 43.1453, 28.2955}, +{1592.01, 42.5693, 27.6483}, +{1611.20, 35.9249, 27.1746}, +{1611.40, 35.9465, 31.7793}, +{1617.76, 41.7756, 31.6085}, +{1643.92, 44.6986, 30.9220}, +{1670.51, 46.0603, 30.2504}, +{1697.53, 46.9951, 29.5936}, +{1724.99, 47.6333, 28.9514}, +{1752.89, 47.7067, 28.3231}, +{1767.60, 45.3081, 28.0012}, +{1767.80, 45.3277, 30.0151}, +{1781.24, 48.5041, 29.7007}, +{1810.05, 49.8811, 29.0454}, +{1839.32, 50.7855, 28.4047}, +{1869.07, 51.4981, 27.7782}, +{1899.30, 52.0712, 27.1660}, +{1930.02, 52.4890, 26.5667}, +{1961.24, 52.4352, 25.9806}, +{1967.40, 51.1135, 25.8676}, +{1967.60, 51.1167, 26.9456}, +{1992.96, 53.4307, 26.5000}, +{2025.20, 54.1982, 25.9522}, +{2057.95, 54.8065, 25.4023}, +{2091.24, 55.3334, 24.8609}, +{2125.06, 55.8051, 24.3287}, +{2159.43, 56.2347, 23.8055}, +{2194.36, 56.6289, 23.2910}, +{2229.85, 56.9927, 22.7855}, +{2265.92, 57.3293, 22.2889}, +{2302.57, 57.6417, 21.8012}, +{2339.81, 57.9317, 21.3222}, +{2377.66, 58.2015, 20.8519}, +{2416.11, 58.4518, 20.3900}, +{2455.19, 58.6846, 19.9375}, +{2494.90, 58.9013, 19.4933}, +{2535.26, 59.1028, 19.0576}, +{2576.26, 59.2895, 18.6302}, +{2617.93, 59.4629, 18.2116}, +{2660.27, 59.6237, 17.8009}, +{2703.30, 59.7722, 17.3984}, +{2747.03, 59.9099, 17.0047}, +{2791.46, 60.0370, 16.6181}, +{2836.61, 60.1535, 16.2398}, +{2882.49, 60.2607, 15.8694}, +{2929.11, 60.3589, 15.5064}, +{2976.48, 60.4487, 15.1511}, +{3024.63, 60.5297, 14.8027}, +{3073.55, 60.6033, 14.4626}, +{3123.26, 60.6698, 14.1289}, +{3173.78, 60.7289, 13.8021}, +{3225.11, 60.7808, 13.4830}, +{3277.27, 60.8272, 13.1711}, +{3330.28, 60.8672, 12.8647}, +{3384.15, 60.9011, 12.5658}, +{3438.88, 60.9299, 12.2733}, +{3494.50, 60.9532, 11.9870}, +{3551.02, 60.9713, 11.7071}, +{3608.46, 60.9846, 11.4332}, +{3666.82, 60.9930, 11.1654}, +{3726.13, 60.9970, 10.9036}, +{3786.40, 60.9966, 10.6476}, +{3847.64, 60.9919, 10.3973}, +{3909.87, 60.9831, 10.1525}, +{3973.11, 60.9704, 9.91329}, +{4037.38, 60.9537, 9.67927}, +{4102.68, 60.9333, 9.45067}, +{4169.03, 60.9091, 9.22709}, +{4236.46, 60.8812, 9.00870}, +{4304.98, 60.8498, 8.79506}, +{4374.62, 60.8147, 8.58635}, +{4445.37, 60.7761, 8.38237}, +{4517.27, 60.7339, 8.18299}, +{4590.33, 60.6882, 7.98821}, +{4664.58, 60.6389, 7.79767}, +{4740.03, 60.5858, 7.61156}, +{4816.69, 60.5289, 7.42979}, +{4894.60, 60.4682, 7.25208}, +{4973.77, 60.4036, 7.07853}, +{5054.21, 60.3348, 6.90880}, +{5135.96, 60.2616, 6.74299}, +{5219.03, 60.1838, 6.58095}, +{5303.44, 60.1011, 6.42274}, +{5389.22, 60.0133, 6.26796}, +{5476.39, 59.9198, 6.11675}, +{5564.97, 59.8201, 5.96912}, +{5654.98, 59.7139, 5.82484}, +{5746.44, 59.6004, 5.68387}, +{5839.39, 59.4787, 5.54609}, +{5933.83, 59.3477, 5.41143}, +{6029.81, 59.2065, 5.28005}, +{6127.33, 59.0536, 5.15149}, +{6226.44, 58.8868, 5.02586}, +{6327.15, 58.7040, 4.90319}, +{6429.48, 58.5021, 4.78328}, +{6533.48, 58.2771, 4.66619}, +{6639.15, 58.0235, 4.55177}, +{6746.54, 57.7334, 4.43979}, +{6855.65, 57.3954, 4.33054}, +{6966.54, 56.9917, 4.22382}, +{7079.22, 56.4915, 4.11929}, +{7193.72, 55.8351, 4.01741}, +{7310.07, 54.8793, 3.91758}, +{7428.31, 53.0769, 3.82042}, +{7513.90, 39.2329, 3.75252}, +{7514.10, 39.2334, 10.2014}, +{7548.45, 51.2377, 10.1318}, +{7670.54, 54.2723, 9.89089}, +{7794.61, 55.2962, 9.65587}, +{7920.68, 55.7667, 9.42627}, +{8048.79, 55.8349, 9.20232}, +{8178.98, 55.1954, 8.98365}, +{8251.50, 48.1279, 8.86556}, +{8251.70, 48.1303, 12.4114}, +{8311.26, 55.4242, 12.2418}, +{8445.69, 57.0018, 11.8720}, +{8582.29, 57.5979, 11.5134}, +{8707.90, 54.7474, 11.1982}, +{8708.10, 54.7481, 12.7208}, +{8721.11, 57.1654, 12.6934}, +{8862.16, 58.8928, 12.4030}, +{9005.50, 59.6695, 12.1180}, +{9151.16, 60.2602, 11.8371}, +{9299.17, 60.7491, 11.5607}, +{9449.58, 61.1689, 11.2890}, +{9602.42, 61.5370, 11.0219}, +{9757.73, 61.8636, 10.7592}, +{9915.55, 62.1560, 10.5019}, +{10075.9, 62.4202, 10.2486}, +{10238.9, 62.6589, 10.0001}, +{10404.5, 62.8760, 9.75621}, +{10572.8, 63.0738, 9.51700}, +{10743.8, 63.2544, 9.28247}, +{10917.6, 63.4195, 9.05258}, +{11094.2, 63.5707, 8.82732}, +{11273.6, 63.7091, 8.60665}, +{11455.9, 63.8360, 8.39055}, +{11641.2, 63.9521, 8.17898}, +{11829.5, 64.0584, 7.97189}, +{12020.8, 64.1557, 7.76925}, +{12215.3, 64.2447, 7.57100}, +{12412.8, 64.3259, 7.37710}, +{12613.6, 64.3999, 7.18749}, +{12817.6, 64.4672, 7.00213}, +{13025.0, 64.5283, 6.82094}, +{13235.6, 64.5835, 6.64387}, +{13449.7, 64.6334, 6.47088}, +{13667.2, 64.6782, 6.30188}, +{13888.3, 64.7184, 6.13682}, +{14112.9, 64.7540, 5.97564}, +{14341.2, 64.7856, 5.81828}, +{14573.1, 64.8133, 5.66465}, +{14808.9, 64.8374, 5.51472}, +{15048.4, 64.8581, 5.36839}, +{15291.8, 64.8756, 5.22562}, +{15539.1, 64.8902, 5.08634}, +{15790.4, 64.9020, 4.95047}, +{16045.8, 64.9111, 4.81795}, +{16305.4, 64.9179, 4.68872}, +{16569.1, 64.9223, 4.56272}, +{16837.1, 64.9246, 4.43986}, +{17109.4, 64.9249, 4.32011}, +{17386.1, 64.9233, 4.20337}, +{17667.4, 64.9200, 4.08960}, +{17953.1, 64.9150, 3.97873}, +{18243.5, 64.9085, 3.87070}, +{18538.6, 64.9005, 3.76544}, +{18838.4, 64.8912, 3.66289}, +{19143.1, 64.8807, 3.56301}, +{19452.7, 64.8689, 3.46571}, +{19767.4, 64.8561, 3.37095}, +{20087.1, 64.8422, 3.27867}, +{20412.0, 64.8274, 3.18880}, +{20742.1, 64.8117, 3.10130}, +{21077.6, 64.7952, 3.01611}, +{21418.5, 64.7778, 2.93317}, +{21765.0, 64.7598, 2.85243}, +{22117.0, 64.7410, 2.77384}, +{22474.7, 64.7217, 2.69734}, +{22838.2, 64.7017, 2.62289}, +{23207.6, 64.6812, 2.55043}, +{23583.0, 64.6601, 2.47992}, +{23964.4, 64.6385, 2.41131}, +{24352.0, 64.6165, 2.34454}, +{24745.9, 64.5940, 2.27958}, +{25146.2, 64.5712, 2.21638}, +{25552.9, 64.5479, 2.15489}, +{25966.2, 64.5242, 2.09508}, +{26386.1, 64.5002, 2.03689}, +{26812.9, 64.4758, 1.98029}, +{27246.6, 64.4510, 1.92524}, +{27687.3, 64.4260, 1.87169}, +{28135.1, 64.4005, 1.81961}, +{28590.2, 64.3748, 1.76896}, +{29052.6, 64.3486, 1.71970}, +{29522.5, 64.3222, 1.67180}, +{30000.0, 64.2953, 1.62522}, +{0, 0, 0} +}; + +e_fp_fdp dy[] = { /* Z = 66 */ +{10.0000, -9999.00, 0.156345}, +{10.1617, -9999.00, 0.162099}, +{10.3261, -9999.00, 0.168065}, +{10.4931, -9999.00, 0.174250}, +{10.6628, -9999.00, 0.180663}, +{10.8353, -9999.00, 0.187312}, +{11.0106, -9999.00, 0.194206}, +{11.1886, -9999.00, 0.201353}, +{11.3696, -9999.00, 0.208763}, +{11.5535, -9999.00, 0.216541}, +{11.7404, -9999.00, 0.225052}, +{11.9303, -9999.00, 0.233897}, +{12.1232, -9999.00, 0.243090}, +{12.3193, -9999.00, 0.252644}, +{12.5186, -9999.00, 0.262574}, +{12.7210, -9999.00, 0.272830}, +{12.9268, -9999.00, 0.282908}, +{13.1359, -9999.00, 0.293358}, +{13.3483, -9999.00, 0.304194}, +{13.5642, -9999.00, 0.315431}, +{13.7836, -9999.00, 0.327082}, +{14.0066, -9999.00, 0.338746}, +{14.2331, -9999.00, 0.350598}, +{14.4633, -9999.00, 0.362864}, +{14.6973, -9999.00, 0.375560}, +{14.9350, -9999.00, 0.388700}, +{15.1765, -9999.00, 0.402300}, +{15.4220, -9999.00, 0.415498}, +{15.6714, -9999.00, 0.425747}, +{15.9249, -9999.00, 0.436249}, +{16.1825, -9999.00, 0.447010}, +{16.4442, -9999.00, 0.458036}, +{16.7102, -9999.00, 0.469334}, +{16.9805, -9999.00, 0.480911}, +{17.2551, -9999.00, 0.497649}, +{17.5342, -9999.00, 0.515360}, +{17.8178, -9999.00, 0.533703}, +{18.1060, -9999.00, 0.549374}, +{18.3989, -9999.00, 0.564746}, +{18.6964, -9999.00, 0.580548}, +{18.9988, -9999.00, 0.596792}, +{19.3061, -9999.00, 0.613491}, +{19.6184, -9999.00, 0.630657}, +{19.9357, -9999.00, 0.651601}, +{20.2582, -9999.00, 0.674639}, +{20.5858, -9999.00, 0.698491}, +{20.9188, -9999.00, 0.728655}, +{21.2571, -9999.00, 0.776166}, +{21.6009, -9999.00, 0.826776}, +{21.9503, -9999.00, 0.880685}, +{22.3053, -9999.00, 0.938109}, +{22.6661, -9999.00, 1.02212}, +{23.0327, -9999.00, 1.14378}, +{23.4053, -9999.00, 1.27993}, +{23.7838, -9999.00, 1.43228}, +{24.1685, -9999.00, 1.60276}, +{24.5594, -9999.00, 1.79354}, +{24.9566, -9999.00, 2.00703}, +{25.3603, -9999.00, 2.25646}, +{25.7705, -9999.00, 2.68871}, +{26.1873, -9999.00, 3.20377}, +{26.6109, -9999.00, 3.81749}, +{27.0413, -9999.00, 4.54878}, +{27.4786, -9999.00, 5.42016}, +{27.9231, -9999.00, 6.36575}, +{28.3747, -9999.00, 7.43996}, +{28.8337, -9999.00, 8.69544}, +{29.3000, -6.57672, 10.1628}, +{29.7739, -5.87270, 11.6252}, +{30.2555, -5.13610, 12.5089}, +{30.7449, -4.39984, 13.4597}, +{31.2421, -3.39838, 14.2200}, +{31.7475, -2.54856, 14.7955}, +{32.2609, -1.67540, 15.2859}, +{32.7827, -0.825969, 15.7306}, +{33.3130, 0.123986, 16.0512}, +{33.8518, 0.951176, 16.2649}, +{34.3993, 1.75178, 16.4792}, +{34.9557, 2.56563, 16.6664}, +{35.5211, 3.43631, 16.8557}, +{36.0956, 4.50730, 16.9295}, +{36.6794, 5.43657, 16.6234}, +{37.2727, 6.20595, 16.3228}, +{37.8755, 6.92833, 15.9806}, +{38.4882, 7.52113, 15.5783}, +{39.1107, 8.02132, 15.1861}, +{39.7432, 8.45802, 14.8038}, +{40.3861, 8.84224, 14.4310}, +{41.0393, 9.18139, 14.0677}, +{41.7031, 9.48073, 13.7136}, +{42.3776, 9.74408, 13.3683}, +{43.0630, 9.97417, 13.0317}, +{43.7595, 10.1729, 12.7036}, +{44.4673, 10.3411, 12.3838}, +{45.1865, 10.4783, 12.0720}, +{45.9174, 10.5816, 11.7681}, +{46.6600, 10.6338, 11.4718}, +{47.4147, 10.6237, 11.2592}, +{48.1816, 10.6623, 11.0953}, +{48.9609, 10.7198, 10.9338}, +{49.7528, 10.7781, 10.7746}, +{50.5576, 10.8334, 10.6178}, +{51.3753, 10.8833, 10.4632}, +{52.2062, 10.9256, 10.3109}, +{53.0506, 10.9587, 10.1608}, +{53.9087, 10.9804, 10.0129}, +{54.7806, 10.9878, 9.86711}, +{55.6667, 10.9763, 9.72346}, +{56.5670, 10.9279, 9.58192}, +{57.4820, 10.8148, 9.51264}, +{58.4117, 10.7639, 9.50207}, +{59.3564, 10.7457, 9.49152}, +{60.3165, 10.7388, 9.48097}, +{61.2921, 10.7389, 9.47043}, +{62.2834, 10.7428, 9.45992}, +{63.2908, 10.7478, 9.44940}, +{64.3145, 10.7497, 9.43890}, +{65.3547, 10.7383, 9.43421}, +{66.4118, 10.7358, 9.45333}, +{67.4859, 10.7436, 9.47248}, +{68.5775, 10.7549, 9.49168}, +{69.6867, 10.7669, 9.51092}, +{70.8138, 10.7753, 9.53020}, +{71.9591, 10.7686, 9.55419}, +{73.1230, 10.7715, 9.60986}, +{74.3057, 10.7894, 9.66586}, +{75.5076, 10.8149, 9.72219}, +{76.7289, 10.8461, 9.77884}, +{77.9699, 10.8827, 9.83579}, +{79.2310, 10.9223, 9.88975}, +{80.5125, 10.9634, 9.94401}, +{81.8147, 11.0062, 9.99856}, +{83.1380, 11.0506, 10.0534}, +{84.4827, 11.0967, 10.1085}, +{85.8491, 11.1440, 10.1636}, +{87.2377, 11.1923, 10.2189}, +{88.6487, 11.2418, 10.2745}, +{90.0825, 11.2926, 10.3305}, +{91.5395, 11.3455, 10.3862}, +{93.0201, 11.3984, 10.4394}, +{94.5246, 11.4508, 10.4929}, +{96.0535, 11.5031, 10.5467}, +{97.6071, 11.5553, 10.6007}, +{99.1858, 11.6036, 10.6551}, +{100.790, 11.6601, 10.7273}, +{102.420, 11.7453, 10.8012}, +{104.077, 11.8403, 10.8313}, +{105.760, 11.9188, 10.8520}, +{107.471, 11.9958, 10.8727}, +{109.209, 12.0918, 10.8934}, +{110.975, 12.2277, 10.8472}, +{112.770, 12.2875, 10.7360}, +{114.594, 12.2998, 10.6260}, +{116.448, 12.2814, 10.5172}, +{118.331, 12.2522, 10.3963}, +{120.245, 12.1652, 10.2341}, +{122.190, 12.0202, 10.0744}, +{124.166, 11.8211, 9.91722}, +{126.175, 11.5665, 9.76248}, +{128.215, 11.2517, 9.61015}, +{130.289, 10.8697, 9.46021}, +{132.397, 10.4156, 9.31261}, +{134.538, 9.91001, 9.13024}, +{136.714, 9.21241, 8.86574}, +{138.925, 8.35458, 8.58595}, +{141.172, 7.27634, 7.92982}, +{143.456, 5.15563, 7.19569}, +{145.776, 2.08340, 6.63203}, +{148.134, -3.41601, 6.36699}, +{150.530, -24.0330, 10.6109}, +{152.964, -8.99081, 43.0103}, +{155.439, 5.66997, 42.3561}, +{157.953, 14.2604, 38.6166}, +{160.507, 19.2231, 34.1930}, +{163.103, 22.0495, 30.0280}, +{165.742, 21.8588, 25.1011}, +{168.422, 20.7116, 24.0887}, +{171.146, 20.6063, 23.5993}, +{173.915, 20.8282, 23.1198}, +{176.727, 21.1427, 22.6501}, +{179.586, 21.4764, 22.1899}, +{182.491, 21.7965, 21.7391}, +{185.442, 22.0818, 21.2974}, +{188.442, 22.2931, 20.8647}, +{191.489, 22.4148, 20.5495}, +{194.587, 22.6124, 20.3399}, +{197.734, 22.8459, 20.1324}, +{200.932, 23.0913, 19.9271}, +{204.182, 23.3406, 19.7238}, +{207.485, 23.5904, 19.5226}, +{210.840, 23.8402, 19.3235}, +{214.251, 24.1031, 19.1264}, +{217.716, 24.3587, 18.8891}, +{221.237, 24.5805, 18.6442}, +{224.816, 24.7780, 18.4024}, +{228.452, 24.9547, 18.1638}, +{232.147, 25.1108, 17.9283}, +{235.902, 25.2449, 17.6958}, +{239.717, 25.3544, 17.4664}, +{243.595, 25.4341, 17.2399}, +{247.535, 25.4732, 17.0164}, +{251.538, 25.3686, 16.8597}, +{255.607, 25.3449, 16.8517}, +{259.741, 25.3976, 16.8436}, +{263.942, 25.4719, 16.8355}, +{268.211, 25.5610, 16.8275}, +{272.549, 25.6599, 16.8194}, +{276.957, 25.7650, 16.8113}, +{281.437, 25.8727, 16.8033}, +{285.989, 25.9774, 16.7953}, +{290.615, 26.0620, 16.8020}, +{295.315, 26.1719, 16.8434}, +{300.092, 26.3010, 16.8849}, +{304.945, 26.4420, 16.9265}, +{309.878, 26.5926, 16.9682}, +{314.890, 26.7516, 17.0100}, +{319.983, 26.9182, 17.0519}, +{325.158, 27.0920, 17.0939}, +{330.418, 27.2730, 17.1360}, +{335.762, 27.4614, 17.1782}, +{341.192, 27.6576, 17.2205}, +{346.711, 27.8625, 17.2629}, +{352.319, 28.0778, 17.3054}, +{358.017, 28.3169, 17.3480}, +{363.808, 28.5684, 17.3575}, +{369.692, 28.8049, 17.3508}, +{375.672, 29.0348, 17.3442}, +{381.748, 29.2632, 17.3376}, +{387.922, 29.4925, 17.3310}, +{394.197, 29.7244, 17.3243}, +{400.573, 29.9607, 17.3177}, +{407.052, 30.2036, 17.3111}, +{413.635, 30.4565, 17.3045}, +{420.326, 30.7360, 17.2979}, +{427.124, 31.0525, 17.2485}, +{434.032, 31.3288, 17.1415}, +{441.052, 31.5763, 17.0351}, +{448.186, 31.8083, 16.9294}, +{455.435, 32.0291, 16.8243}, +{462.802, 32.2411, 16.7199}, +{470.287, 32.4458, 16.6162}, +{477.894, 32.6442, 16.5131}, +{485.623, 32.8373, 16.4106}, +{493.478, 33.0255, 16.3087}, +{501.459, 33.2095, 16.2075}, +{509.570, 33.3898, 16.1069}, +{517.812, 33.5669, 16.0070}, +{526.187, 33.7414, 15.9077}, +{534.698, 33.9147, 15.8089}, +{543.346, 34.0854, 15.7078}, +{552.134, 34.2537, 15.6072}, +{561.065, 34.4207, 15.5073}, +{570.139, 34.5880, 15.4080}, +{579.361, 34.7583, 15.3093}, +{588.732, 34.9379, 15.2113}, +{598.254, 35.1425, 15.0849}, +{607.930, 35.3201, 14.9213}, +{617.763, 35.4665, 14.7593}, +{627.755, 35.5992, 14.5992}, +{637.908, 35.7201, 14.4408}, +{648.226, 35.8307, 14.2841}, +{658.711, 35.9320, 14.1291}, +{669.365, 36.0245, 13.9757}, +{680.191, 36.1087, 13.8241}, +{691.193, 36.1848, 13.6741}, +{702.372, 36.2533, 13.5257}, +{713.733, 36.3142, 13.3789}, +{725.277, 36.3677, 13.2338}, +{737.008, 36.4140, 13.0902}, +{748.928, 36.4535, 12.9481}, +{761.042, 36.4868, 12.8076}, +{773.351, 36.5153, 12.6686}, +{785.859, 36.5488, 12.5312}, +{798.570, 36.5619, 12.3619}, +{811.486, 36.5553, 12.2042}, +{824.611, 36.5355, 12.0485}, +{837.949, 36.5034, 11.8947}, +{851.502, 36.4586, 11.7409}, +{865.274, 36.3999, 11.5867}, +{879.269, 36.3243, 11.4324}, +{893.491, 36.2318, 11.2802}, +{907.943, 36.1226, 11.1300}, +{922.628, 35.9973, 10.9816}, +{937.551, 35.8517, 10.8296}, +{952.715, 35.6829, 10.6781}, +{968.124, 35.4879, 10.5273}, +{983.783, 35.2654, 10.3785}, +{999.695, 35.0135, 10.2311}, +{1015.86, 34.7301, 10.0850}, +{1032.29, 34.4069, 9.93350}, +{1048.99, 34.0370, 9.78211}, +{1065.96, 33.6114, 9.63075}, +{1083.20, 33.1223, 9.48189}, +{1100.72, 32.5588, 9.33537}, +{1118.52, 31.9053, 9.19114}, +{1136.61, 31.1405, 9.04900}, +{1155.00, 30.2339, 8.90909}, +{1173.68, 29.1403, 8.77139}, +{1192.66, 27.7890, 8.63578}, +{1211.95, 26.0605, 8.50233}, +{1231.55, 23.7284, 8.37101}, +{1251.47, 20.2814, 8.24241}, +{1271.72, 14.0795, 8.11584}, +{1292.29, -27.4577, 7.99120}, +{1292.50, -39.0629, 7.98992}, +{1292.70, -39.0403, 39.8247}, +{1313.19, 15.8866, 38.9272}, +{1334.43, 23.6486, 38.0323}, +{1356.01, 28.2848, 37.1579}, +{1377.94, 31.6049, 36.3032}, +{1400.23, 34.1792, 35.4682}, +{1422.88, 36.2638, 34.6527}, +{1445.89, 37.9953, 33.8557}, +{1469.28, 39.4545, 33.0775}, +{1493.04, 40.6915, 32.3179}, +{1517.19, 41.7397, 31.5782}, +{1541.73, 42.6173, 30.8559}, +{1566.67, 43.3278, 30.1501}, +{1592.01, 43.8561, 29.4603}, +{1617.76, 44.1493, 28.7863}, +{1643.92, 44.0281, 28.1277}, +{1670.51, 41.9749, 27.4841}, +{1675.50, 36.5794, 27.3661}, +{1675.70, 36.5970, 31.9284}, +{1697.53, 44.8155, 31.3940}, +{1724.99, 46.5352, 30.7439}, +{1752.89, 47.6399, 30.1069}, +{1781.24, 48.4403, 29.4832}, +{1810.05, 48.9492, 28.8729}, +{1839.32, 48.2011, 28.2752}, +{1841.70, 46.4804, 28.2277}, +{1841.90, 46.4965, 30.0747}, +{1869.07, 50.4083, 29.4647}, +{1899.30, 51.4658, 28.8106}, +{1930.02, 52.2505, 28.1710}, +{1961.24, 52.8789, 27.5456}, +{1992.96, 53.3658, 26.9339}, +{2025.20, 53.5881, 26.3425}, +{2046.70, 52.4843, 25.9604}, +{2046.90, 52.4989, 27.0616}, +{2057.95, 53.9357, 26.8737}, +{2091.24, 54.8910, 26.3215}, +{2125.06, 55.5483, 25.7762}, +{2159.43, 56.1056, 25.2390}, +{2194.36, 56.6024, 24.7089}, +{2229.85, 57.0532, 24.1860}, +{2265.92, 57.4664, 23.6712}, +{2302.57, 57.8475, 23.1642}, +{2339.81, 58.2007, 22.6656}, +{2377.66, 58.5287, 22.1746}, +{2416.11, 58.8332, 21.6918}, +{2455.19, 59.1168, 21.2174}, +{2494.90, 59.3806, 20.7505}, +{2535.26, 59.6258, 20.2921}, +{2576.26, 59.8544, 19.8421}, +{2617.93, 60.0671, 19.3998}, +{2660.27, 60.2645, 18.9655}, +{2703.30, 60.4477, 18.5393}, +{2747.03, 60.6173, 18.1213}, +{2791.46, 60.7745, 17.7115}, +{2836.61, 60.9203, 17.3097}, +{2882.49, 61.0545, 16.9151}, +{2929.11, 61.1782, 16.5291}, +{2976.48, 61.2919, 16.1501}, +{3024.63, 61.3962, 15.7791}, +{3073.55, 61.4911, 15.4147}, +{3123.26, 61.5768, 15.0586}, +{3173.78, 61.6548, 14.7102}, +{3225.11, 61.7255, 14.3687}, +{3277.27, 61.7882, 14.0334}, +{3330.28, 61.8434, 13.7063}, +{3384.15, 61.8923, 13.3861}, +{3438.88, 61.9347, 13.0725}, +{3494.50, 61.9709, 12.7657}, +{3551.02, 62.0012, 12.4656}, +{3608.46, 62.0260, 12.1720}, +{3666.82, 62.0452, 11.8848}, +{3726.13, 62.0594, 11.6040}, +{3786.40, 62.0685, 11.3293}, +{3847.64, 62.0729, 11.0607}, +{3909.87, 62.0726, 10.7981}, +{3973.11, 62.0678, 10.5415}, +{4037.38, 62.0589, 10.2906}, +{4102.68, 62.0458, 10.0454}, +{4169.03, 62.0285, 9.80560}, +{4236.46, 62.0072, 9.57138}, +{4304.98, 61.9822, 9.34258}, +{4374.62, 61.9535, 9.11884}, +{4445.37, 61.9208, 8.90030}, +{4517.27, 61.8845, 8.68689}, +{4590.33, 61.8447, 8.47839}, +{4664.58, 61.8013, 8.27464}, +{4740.03, 61.7541, 8.07557}, +{4816.69, 61.7033, 7.88121}, +{4894.60, 61.6488, 7.69137}, +{4973.77, 61.5905, 7.50588}, +{5054.21, 61.5283, 7.32483}, +{5135.96, 61.4622, 7.14799}, +{5219.03, 61.3920, 6.97523}, +{5303.44, 61.3174, 6.80651}, +{5389.22, 61.2382, 6.64187}, +{5476.39, 61.1543, 6.48109}, +{5564.97, 61.0652, 6.32400}, +{5654.98, 60.9706, 6.17080}, +{5746.44, 60.8701, 6.02107}, +{5839.39, 60.7631, 5.87494}, +{5933.83, 60.6489, 5.73228}, +{6029.81, 60.5268, 5.59303}, +{6127.33, 60.3959, 5.45695}, +{6226.44, 60.2548, 5.32415}, +{6327.15, 60.1023, 5.19454}, +{6429.48, 59.9367, 5.06807}, +{6533.48, 59.7555, 4.94443}, +{6639.15, 59.5560, 4.82389}, +{6746.54, 59.3343, 4.70604}, +{6855.65, 59.0852, 4.59115}, +{6966.54, 58.8016, 4.47901}, +{7079.22, 58.4729, 4.36943}, +{7193.72, 58.0828, 4.26249}, +{7310.07, 57.6038, 4.15807}, +{7428.31, 56.9849, 4.05627}, +{7548.45, 56.1101, 3.95668}, +{7670.54, 54.6014, 3.85952}, +{7790.00, 39.4034, 3.76820}, +{7790.20, 39.4042, 10.5382}, +{7794.61, 47.6200, 10.5272}, +{7920.68, 54.8897, 10.2205}, +{8048.79, 56.2386, 9.92265}, +{8178.98, 56.8777, 9.63359}, +{8311.26, 57.1090, 9.35297}, +{8445.69, 56.9093, 9.08041}, +{8580.50, 49.6117, 8.81917}, +{8580.70, 49.6140, 12.2874}, +{8582.29, 52.5864, 12.2831}, +{8721.11, 57.6088, 11.9235}, +{8862.16, 58.4433, 11.5744}, +{9005.50, 58.4008, 11.2353}, +{9045.70, 55.4366, 11.1429}, +{9045.90, 55.4388, 12.8122}, +{9151.16, 59.4861, 12.5914}, +{9299.17, 60.4375, 12.2916}, +{9449.58, 61.1011, 11.9972}, +{9602.42, 61.6335, 11.7082}, +{9757.73, 62.0826, 11.4246}, +{9915.55, 62.4717, 11.1469}, +{10075.9, 62.8144, 10.8742}, +{10238.9, 63.1190, 10.6070}, +{10404.5, 63.3920, 10.3452}, +{10572.8, 63.6380, 10.0887}, +{10743.8, 63.8606, 9.83754}, +{10917.6, 64.0626, 9.59162}, +{11094.2, 64.2465, 9.35091}, +{11273.6, 64.4140, 9.11536}, +{11455.9, 64.5669, 8.88491}, +{11641.2, 64.7065, 8.65950}, +{11829.5, 64.8340, 8.43906}, +{12020.8, 64.9505, 8.22354}, +{12215.3, 65.0569, 8.01285}, +{12412.8, 65.1540, 7.80695}, +{12613.6, 65.2425, 7.60574}, +{12817.6, 65.3232, 7.40918}, +{13025.0, 65.3965, 7.21716}, +{13235.6, 65.4630, 7.02963}, +{13449.7, 65.5233, 6.84651}, +{13667.2, 65.5777, 6.66772}, +{13888.3, 65.6266, 6.49319}, +{14112.9, 65.6705, 6.32283}, +{14341.2, 65.7097, 6.15658}, +{14573.1, 65.7444, 5.99435}, +{14808.9, 65.7751, 5.83608}, +{15048.4, 65.8019, 5.68167}, +{15291.8, 65.8251, 5.53107}, +{15539.1, 65.8449, 5.38418}, +{15790.4, 65.8616, 5.24094}, +{16045.8, 65.8754, 5.10127}, +{16305.4, 65.8865, 4.96509}, +{16569.1, 65.8950, 4.83233}, +{16837.1, 65.9011, 4.70292}, +{17109.4, 65.9049, 4.57680}, +{17386.1, 65.9067, 4.45387}, +{17667.4, 65.9065, 4.33408}, +{17953.1, 65.9044, 4.21735}, +{18243.5, 65.9007, 4.10362}, +{18538.6, 65.8953, 3.99281}, +{18838.4, 65.8885, 3.88487}, +{19143.1, 65.8802, 3.77972}, +{19452.7, 65.8707, 3.67731}, +{19767.4, 65.8599, 3.57755}, +{20087.1, 65.8480, 3.48041}, +{20412.0, 65.8351, 3.38580}, +{20742.1, 65.8212, 3.29368}, +{21077.6, 65.8063, 3.20397}, +{21418.5, 65.7906, 3.11663}, +{21765.0, 65.7740, 3.03159}, +{22117.0, 65.7567, 2.94881}, +{22474.7, 65.7388, 2.86822}, +{22838.2, 65.7201, 2.78977}, +{23207.6, 65.7009, 2.71340}, +{23583.0, 65.6810, 2.63907}, +{23964.4, 65.6607, 2.56672}, +{24352.0, 65.6398, 2.49631}, +{24745.9, 65.6185, 2.42778}, +{25146.2, 65.5967, 2.36109}, +{25552.9, 65.5745, 2.29619}, +{25966.2, 65.5519, 2.23304}, +{26386.1, 65.5289, 2.17158}, +{26812.9, 65.5055, 2.11178}, +{27246.6, 65.4818, 2.05360}, +{27687.3, 65.4577, 1.99698}, +{28135.1, 65.4334, 1.94190}, +{28590.2, 65.4088, 1.88830}, +{29052.6, 65.3841, 1.83616}, +{29522.5, 65.3639, 1.78543}, +{30000.0, 65.3175, 1.73608}, +{0, 0, 0} +}; + +e_fp_fdp ho[] = { /* Z = 67 */ +{10.0000, -9999.00, 0.167624}, +{10.1617, -9999.00, 0.171642}, +{10.3261, -9999.00, 0.175757}, +{10.4931, -9999.00, 0.179971}, +{10.6628, -9999.00, 0.184286}, +{10.8353, -9999.00, 0.188704}, +{11.0106, -9999.00, 0.193658}, +{11.1886, -9999.00, 0.200859}, +{11.3696, -9999.00, 0.208329}, +{11.5535, -9999.00, 0.216076}, +{11.7404, -9999.00, 0.223826}, +{11.9303, -9999.00, 0.231364}, +{12.1232, -9999.00, 0.239156}, +{12.3193, -9999.00, 0.247210}, +{12.5186, -9999.00, 0.255856}, +{12.7210, -9999.00, 0.265033}, +{12.9268, -9999.00, 0.274538}, +{13.1359, -9999.00, 0.284211}, +{13.3483, -9999.00, 0.293582}, +{13.5642, -9999.00, 0.303262}, +{13.7836, -9999.00, 0.313261}, +{14.0066, -9999.00, 0.323589}, +{14.2331, -9999.00, 0.333375}, +{14.4633, -9999.00, 0.343298}, +{14.6973, -9999.00, 0.353517}, +{14.9350, -9999.00, 0.364353}, +{15.1765, -9999.00, 0.375936}, +{15.4220, -9999.00, 0.387886}, +{15.6714, -9999.00, 0.400031}, +{15.9249, -9999.00, 0.408584}, +{16.1825, -9999.00, 0.417320}, +{16.4442, -9999.00, 0.426243}, +{16.7102, -9999.00, 0.437477}, +{16.9805, -9999.00, 0.455184}, +{17.2551, -9999.00, 0.473608}, +{17.5342, -9999.00, 0.486864}, +{17.8178, -9999.00, 0.499004}, +{18.1060, -9999.00, 0.511445}, +{18.3989, -9999.00, 0.524229}, +{18.6964, -9999.00, 0.538388}, +{18.9988, -9999.00, 0.552929}, +{19.3061, -9999.00, 0.567862}, +{19.6184, -9999.00, 0.584048}, +{19.9357, -9999.00, 0.600706}, +{20.2582, -9999.00, 0.617839}, +{20.5858, -9999.00, 0.638919}, +{20.9188, -9999.00, 0.661735}, +{21.2571, -9999.00, 0.685366}, +{21.6009, -9999.00, 0.713229}, +{21.9503, -9999.00, 0.748039}, +{22.3053, -9999.00, 0.790689}, +{22.6661, -9999.00, 0.881858}, +{23.0327, -9999.00, 0.970660}, +{23.4053, -9999.00, 1.06118}, +{23.7838, -9999.00, 1.30727}, +{24.1685, -9999.00, 1.44952}, +{24.5594, -9999.00, 1.61295}, +{24.9566, -9999.00, 1.86820}, +{25.3603, -9999.00, 2.28008}, +{25.7705, -9999.00, 2.56526}, +{26.1873, -9999.00, 2.97313}, +{26.6109, -9999.00, 3.47041}, +{27.0413, -9999.00, 4.00771}, +{27.4786, -9999.00, 4.57972}, +{27.9231, -9999.00, 5.13553}, +{28.3747, -9999.00, 5.65403}, +{28.8337, -9999.00, 6.19349}, +{29.3000, -3.12960, 6.78490}, +{29.7739, -3.14392, 7.45822}, +{30.2555, -3.07757, 8.19836}, +{30.7449, -2.86773, 9.01194}, +{31.2421, -2.52286, 9.71268}, +{31.7475, -2.09761, 10.4420}, +{32.2609, -1.41577, 11.0399}, +{32.7827, -0.856388, 11.4515}, +{33.3130, -0.293774, 11.8785}, +{33.8518, 0.306621, 12.1795}, +{34.3993, 0.872409, 12.4602}, +{34.9557, 1.49192, 12.6984}, +{35.5211, 2.07923, 12.8560}, +{36.0956, 2.69930, 13.0155}, +{36.6794, 3.31575, 12.9818}, +{37.2727, 3.82927, 12.9322}, +{37.8755, 4.29050, 12.8828}, +{38.4882, 4.72734, 12.8335}, +{39.1107, 5.15670, 12.7844}, +{39.7432, 5.61256, 12.6901}, +{40.3861, 5.99779, 12.5442}, +{41.0393, 6.34077, 12.3999}, +{41.7031, 6.65443, 12.2572}, +{42.3776, 6.94492, 12.1163}, +{43.0630, 7.21658, 11.9769}, +{43.7595, 7.47201, 11.8351}, +{44.4673, 7.70805, 11.6928}, +{45.1865, 7.92774, 11.5523}, +{45.9174, 8.13273, 11.4135}, +{46.6600, 8.32411, 11.2764}, +{47.4147, 8.50262, 11.1409}, +{48.1816, 8.66877, 11.0070}, +{48.9609, 8.82274, 10.8747}, +{49.7528, 8.96378, 10.7440}, +{50.5576, 9.08877, 10.6149}, +{51.3753, 9.20409, 10.5025}, +{52.2062, 9.31703, 10.3925}, +{53.0506, 9.42389, 10.2836}, +{53.9087, 9.52333, 10.1759}, +{54.7806, 9.61449, 10.0693}, +{55.6667, 9.69640, 9.96382}, +{56.5670, 9.76752, 9.85946}, +{57.4820, 9.82431, 9.75618}, +{58.4117, 9.85440, 9.65936}, +{59.3564, 9.88623, 9.60720}, +{60.3165, 9.92935, 9.55532}, +{61.2921, 9.97592, 9.50373}, +{62.2834, 10.0212, 9.45241}, +{63.2908, 10.0634, 9.40138}, +{64.3145, 10.1007, 9.35062}, +{65.3547, 10.1312, 9.30013}, +{66.4118, 10.1488, 9.24992}, +{67.4859, 10.1348, 9.21580}, +{68.5775, 10.1393, 9.22008}, +{69.6867, 10.1595, 9.22434}, +{70.8138, 10.1846, 9.22862}, +{71.9591, 10.2122, 9.23289}, +{73.1230, 10.2406, 9.23717}, +{74.3057, 10.2684, 9.24146}, +{75.5076, 10.2945, 9.24574}, +{76.7289, 10.3175, 9.25003}, +{77.9699, 10.3354, 9.25431}, +{79.2310, 10.3439, 9.25861}, +{80.5125, 10.3281, 9.27368}, +{81.8147, 10.3258, 9.32917}, +{83.1380, 10.3388, 9.38501}, +{84.4827, 10.3604, 9.44117}, +{85.8491, 10.3871, 9.49767}, +{87.2377, 10.4176, 9.55451}, +{88.6487, 10.4510, 9.61169}, +{90.0825, 10.4869, 9.66921}, +{91.5395, 10.5250, 9.72708}, +{93.0201, 10.5651, 9.78529}, +{94.5246, 10.6072, 9.84385}, +{96.0535, 10.6515, 9.90276}, +{97.6071, 10.6988, 9.96202}, +{99.1858, 10.7509, 10.0216}, +{100.790, 10.8153, 10.0816}, +{102.420, 10.8817, 10.1098}, +{104.077, 10.9326, 10.1333}, +{105.760, 10.9726, 10.1569}, +{107.471, 11.0063, 10.1805}, +{109.209, 11.0346, 10.2041}, +{110.975, 11.0587, 10.2278}, +{112.770, 11.0806, 10.2516}, +{114.594, 11.1081, 10.2691}, +{116.448, 11.1208, 10.2686}, +{118.331, 11.1213, 10.2681}, +{120.245, 11.1147, 10.2676}, +{122.190, 11.1126, 10.2671}, +{124.166, 11.1766, 10.2500}, +{126.175, 11.1696, 10.0642}, +{128.215, 11.0535, 9.88183}, +{130.289, 10.8645, 9.70275}, +{132.397, 10.6159, 9.52691}, +{134.538, 10.2843, 9.31956}, +{136.714, 9.84480, 9.11352}, +{138.925, 9.29614, 8.91203}, +{141.172, 8.68411, 8.71501}, +{143.456, 7.84485, 8.24218}, +{145.776, 6.42588, 7.70452}, +{148.134, 4.40734, 7.30426}, +{150.530, 1.61720, 6.92494}, +{152.964, -3.88245, 6.31943}, +{155.439, -26.3497, 11.4015}, +{157.953, -5.66441, 49.4228}, +{160.507, 12.1987, 41.0236}, +{163.103, 18.9197, 33.0111}, +{165.742, 19.1029, 26.5826}, +{168.422, 18.5942, 25.1963}, +{171.146, 18.9623, 23.8824}, +{173.915, 19.2737, 22.6370}, +{176.727, 19.0917, 21.5454}, +{179.586, 19.0393, 21.2141}, +{182.491, 19.2310, 20.8879}, +{185.442, 19.4731, 20.5668}, +{188.442, 19.7225, 20.2506}, +{191.489, 19.9575, 19.9392}, +{194.587, 20.1615, 19.6327}, +{197.734, 20.3028, 19.3308}, +{200.932, 20.3399, 19.1531}, +{204.182, 20.4603, 19.0853}, +{207.485, 20.6470, 19.0178}, +{210.840, 20.8529, 18.9504}, +{214.251, 21.0717, 18.8834}, +{217.716, 21.2995, 18.8165}, +{221.237, 21.5347, 18.7499}, +{224.816, 21.7777, 18.6835}, +{228.452, 22.0320, 18.6174}, +{232.147, 22.3192, 18.5502}, +{235.902, 22.5911, 18.4014}, +{239.717, 22.8300, 18.2538}, +{243.595, 23.0434, 18.1074}, +{247.535, 23.2389, 17.9621}, +{251.538, 23.4165, 17.8180}, +{255.607, 23.5741, 17.6751}, +{259.741, 23.7032, 17.5333}, +{263.942, 23.7734, 17.4249}, +{268.211, 23.8784, 17.3847}, +{272.549, 24.0046, 17.3445}, +{276.957, 24.1383, 17.3044}, +{281.437, 24.2743, 17.2645}, +{285.989, 24.4089, 17.2246}, +{290.615, 24.5387, 17.1848}, +{295.315, 24.6410, 17.1450}, +{300.092, 24.7510, 17.1600}, +{304.945, 24.8841, 17.1759}, +{309.878, 25.0276, 17.1918}, +{314.890, 25.1777, 17.2078}, +{319.983, 25.3323, 17.2237}, +{325.158, 25.4899, 17.2397}, +{330.418, 25.6491, 17.2557}, +{335.762, 25.8025, 17.2717}, +{341.192, 25.9565, 17.3052}, +{346.711, 26.1242, 17.3459}, +{352.319, 26.3014, 17.3867}, +{358.017, 26.4858, 17.4276}, +{363.808, 26.6768, 17.4686}, +{369.692, 26.8744, 17.5096}, +{375.672, 27.0789, 17.5508}, +{381.748, 27.2911, 17.5921}, +{387.922, 27.5123, 17.6335}, +{394.197, 27.7601, 17.6736}, +{400.573, 28.0052, 17.6757}, +{407.052, 28.2382, 17.6778}, +{413.635, 28.4690, 17.6799}, +{420.326, 28.7000, 17.6820}, +{427.124, 28.9330, 17.6841}, +{434.032, 29.1693, 17.6863}, +{441.052, 29.4112, 17.6884}, +{448.186, 29.6620, 17.6905}, +{455.435, 29.9364, 17.6926}, +{462.802, 30.2112, 17.6447}, +{470.287, 30.4692, 17.5904}, +{477.894, 30.7148, 17.5362}, +{485.623, 30.9559, 17.4822}, +{493.478, 31.1949, 17.4284}, +{501.459, 31.4335, 17.3747}, +{509.570, 31.6734, 17.3213}, +{517.812, 31.9170, 17.2680}, +{526.187, 32.1672, 17.2148}, +{534.698, 32.4273, 17.1618}, +{543.346, 32.7462, 17.1090}, +{552.134, 33.0555, 16.9488}, +{561.065, 33.3095, 16.7753}, +{570.139, 33.5354, 16.6035}, +{579.361, 33.7423, 16.4335}, +{588.732, 33.9343, 16.2652}, +{598.254, 34.1138, 16.0987}, +{607.930, 34.2823, 15.9339}, +{617.763, 34.4408, 15.7707}, +{627.755, 34.5894, 15.6092}, +{637.908, 34.7348, 15.4536}, +{648.226, 34.8762, 15.2891}, +{658.711, 35.0003, 15.1178}, +{669.365, 35.1043, 14.9486}, +{680.191, 35.1910, 14.8033}, +{691.193, 35.2857, 14.6761}, +{702.372, 35.4048, 14.5510}, +{713.733, 35.5302, 14.3965}, +{725.277, 35.6307, 14.2227}, +{737.008, 35.7130, 14.0511}, +{748.928, 35.7828, 13.8816}, +{761.042, 35.8424, 13.7139}, +{773.351, 35.8935, 13.5467}, +{785.859, 35.9351, 13.3766}, +{798.570, 35.9622, 13.2048}, +{811.486, 35.9761, 13.0353}, +{824.611, 35.9782, 12.8678}, +{837.949, 35.9687, 12.7023}, +{851.502, 35.9474, 12.5379}, +{865.274, 35.9139, 12.3741}, +{879.269, 35.8662, 12.2113}, +{893.491, 35.8044, 12.0505}, +{907.943, 35.7286, 11.8918}, +{922.628, 35.6409, 11.7354}, +{937.551, 35.5363, 11.5727}, +{952.715, 35.4117, 11.4102}, +{968.124, 35.2644, 11.2481}, +{983.783, 35.0945, 11.0881}, +{999.695, 34.9016, 10.9294}, +{1015.86, 34.6855, 10.7719}, +{1032.29, 34.4376, 10.6061}, +{1048.99, 34.1529, 10.4408}, +{1065.96, 33.8260, 10.2761}, +{1083.20, 33.4531, 10.1136}, +{1100.72, 33.0286, 9.95392}, +{1118.52, 32.5450, 9.79687}, +{1136.61, 31.9920, 9.64205}, +{1155.00, 31.3560, 9.48972}, +{1173.68, 30.6192, 9.33987}, +{1192.66, 29.7561, 9.19220}, +{1211.95, 28.7310, 9.04699}, +{1231.55, 27.4903, 8.90430}, +{1251.47, 25.9489, 8.76416}, +{1271.72, 23.9597, 8.62668}, +{1292.29, 21.2354, 8.49190}, +{1313.19, 17.0871, 8.35957}, +{1334.43, 8.98271, 8.22934}, +{1351.30, -46.1470, 8.12876}, +{1351.50, -46.1240, 42.3878}, +{1356.01, -4.04580, 42.1847}, +{1377.94, 15.9027, 41.2201}, +{1400.23, 23.1187, 40.2775}, +{1422.88, 27.6897, 39.3565}, +{1445.89, 31.0397, 38.4564}, +{1469.28, 33.6685, 37.5774}, +{1493.04, 35.8122, 36.7194}, +{1517.19, 37.6013, 35.8824}, +{1541.73, 39.1139, 35.0647}, +{1566.67, 40.3977, 34.2654}, +{1592.01, 41.4821, 33.4848}, +{1617.76, 42.3812, 32.7219}, +{1643.92, 43.0910, 31.9759}, +{1670.51, 43.5796, 31.2471}, +{1697.53, 43.7409, 30.5353}, +{1724.99, 42.9718, 29.8402}, +{1741.10, 36.1969, 29.4446}, +{1741.30, 36.2186, 34.2020}, +{1752.89, 43.3580, 33.8881}, +{1781.24, 45.8694, 33.1406}, +{1810.05, 47.2454, 32.4095}, +{1839.32, 48.2316, 31.6952}, +{1869.07, 48.9462, 30.9967}, +{1899.30, 49.2404, 30.3136}, +{1922.70, 46.8679, 29.8025}, +{1922.90, 46.8880, 31.8540}, +{1930.02, 49.3636, 31.6870}, +{1961.24, 51.1004, 30.9726}, +{1992.96, 52.0849, 30.2743}, +{2025.20, 52.8428, 29.5980}, +{2057.95, 53.4437, 28.9312}, +{2091.24, 53.8621, 28.2786}, +{2125.06, 53.5480, 27.6414}, +{2128.20, 52.3233, 27.5836}, +{2128.40, 52.3261, 28.7312}, +{2159.43, 54.9001, 28.1975}, +{2194.36, 55.6749, 27.6175}, +{2229.85, 56.3016, 27.0453}, +{2265.92, 56.8517, 26.4812}, +{2302.57, 57.3493, 25.9259}, +{2339.81, 57.8051, 25.3775}, +{2377.66, 58.2244, 24.8373}, +{2416.11, 58.6129, 24.3062}, +{2455.19, 58.9736, 23.7827}, +{2494.90, 59.3091, 23.2682}, +{2535.26, 59.6212, 22.7618}, +{2576.26, 59.9123, 22.2642}, +{2617.93, 60.1830, 21.7746}, +{2660.27, 60.4357, 21.2945}, +{2703.30, 60.6708, 20.8213}, +{2747.03, 60.8892, 20.3575}, +{2791.46, 61.0919, 19.9021}, +{2836.61, 61.2817, 19.4567}, +{2882.49, 61.4566, 19.0159}, +{2929.11, 61.6176, 18.5862}, +{2976.48, 61.7678, 18.1647}, +{3024.63, 61.9063, 17.7506}, +{3073.55, 62.0336, 17.3452}, +{3123.26, 62.1503, 16.9473}, +{3173.78, 62.2575, 16.5583}, +{3225.11, 62.3555, 16.1759}, +{3277.27, 62.4433, 15.8014}, +{3330.28, 62.5230, 15.4359}, +{3384.15, 62.5951, 15.0770}, +{3438.88, 62.6590, 14.7258}, +{3494.50, 62.7155, 14.3823}, +{3551.02, 62.7656, 14.0466}, +{3608.46, 62.8092, 13.7166}, +{3666.82, 62.8457, 13.3940}, +{3726.13, 62.8759, 13.0785}, +{3786.40, 62.9004, 12.7699}, +{3847.64, 62.9191, 12.4680}, +{3909.87, 62.9325, 12.1728}, +{3973.11, 62.9406, 11.8841}, +{4037.38, 62.9437, 11.6017}, +{4102.68, 62.9419, 11.3256}, +{4169.03, 62.9355, 11.0557}, +{4236.46, 62.9246, 10.7918}, +{4304.98, 62.9092, 10.5338}, +{4374.62, 62.8895, 10.2816}, +{4445.37, 62.8655, 10.0351}, +{4517.27, 62.8374, 9.79422}, +{4590.33, 62.8055, 9.55897}, +{4664.58, 62.7695, 9.32871}, +{4740.03, 62.7293, 9.10391}, +{4816.69, 62.6854, 8.88447}, +{4894.60, 62.6377, 8.66984}, +{4973.77, 62.5859, 8.46002}, +{5054.21, 62.5301, 8.25528}, +{5135.96, 62.4702, 8.05510}, +{5219.03, 62.4061, 7.85980}, +{5303.44, 62.3380, 7.66888}, +{5389.22, 62.2654, 7.48225}, +{5476.39, 62.1880, 7.30013}, +{5564.97, 62.1059, 7.12237}, +{5654.98, 62.0189, 6.94875}, +{5746.44, 61.9266, 6.77900}, +{5839.39, 61.8282, 6.61311}, +{5933.83, 61.7234, 6.45123}, +{6029.81, 61.6121, 6.29348}, +{6127.33, 61.4935, 6.13907}, +{6226.44, 61.3664, 5.98829}, +{6327.15, 61.2302, 5.84119}, +{6429.48, 61.0836, 5.69737}, +{6533.48, 60.9250, 5.55712}, +{6639.15, 60.7531, 5.42016}, +{6746.54, 60.5653, 5.28628}, +{6855.65, 60.3587, 5.15571}, +{6966.54, 60.1297, 5.02842}, +{7079.22, 59.8731, 4.90361}, +{7193.72, 59.5817, 4.78220}, +{7310.07, 59.2456, 4.66342}, +{7428.31, 58.8486, 4.54724}, +{7548.45, 58.3651, 4.43426}, +{7670.54, 57.7484, 4.32377}, +{7794.61, 56.8966, 4.21560}, +{7920.68, 55.5111, 4.11014}, +{8048.79, 51.1934, 4.00761}, +{8071.00, 38.8400, 3.99026}, +{8071.20, 38.8409, 11.1883}, +{8178.98, 54.8890, 10.9134}, +{8311.26, 56.6276, 10.5900}, +{8445.69, 57.4368, 10.2757}, +{8582.29, 57.7983, 9.97106}, +{8721.11, 57.7456, 9.67521}, +{8862.16, 56.7304, 9.38827}, +{8917.70, 49.5830, 9.27885}, +{8917.90, 49.5851, 12.9497}, +{9005.50, 57.6303, 12.7105}, +{9151.16, 58.9313, 12.3273}, +{9299.17, 59.3281, 11.9554}, +{9394.10, 56.0601, 11.7257}, +{9394.30, 56.0608, 13.4166}, +{9449.58, 59.6769, 13.3031}, +{9602.42, 60.9199, 12.9977}, +{9757.73, 61.6743, 12.6979}, +{9915.55, 62.2640, 12.4034}, +{10075.9, 62.7575, 12.1129}, +{10238.9, 63.1827, 11.8273}, +{10404.5, 63.5564, 11.5465}, +{10572.8, 63.8886, 11.2706}, +{10743.8, 64.1864, 10.9997}, +{10917.6, 64.4551, 10.7337}, +{11094.2, 64.6985, 10.4726}, +{11273.6, 64.9198, 10.2165}, +{11455.9, 65.1215, 9.96535}, +{11641.2, 65.3056, 9.71913}, +{11829.5, 65.4740, 9.47781}, +{12020.8, 65.6281, 9.24138}, +{12215.3, 65.7691, 9.00979}, +{12412.8, 65.8983, 8.78303}, +{12613.6, 66.0165, 8.56104}, +{12817.6, 66.1247, 8.34378}, +{13025.0, 66.2236, 8.13120}, +{13235.6, 66.3139, 7.92326}, +{13449.7, 66.3962, 7.71990}, +{13667.2, 66.4712, 7.52105}, +{13888.3, 66.5393, 7.32668}, +{14112.9, 66.6010, 7.13670}, +{14341.2, 66.6568, 6.95107}, +{14573.1, 66.7070, 6.76971}, +{14808.9, 66.7520, 6.59257}, +{15048.4, 66.7921, 6.41956}, +{15291.8, 66.8277, 6.25064}, +{15539.1, 66.8591, 6.08573}, +{15790.4, 66.8865, 5.92475}, +{16045.8, 66.9102, 5.76765}, +{16305.4, 66.9304, 5.61435}, +{16569.1, 66.9474, 5.46478}, +{16837.1, 66.9613, 5.31887}, +{17109.4, 66.9723, 5.17656}, +{17386.1, 66.9807, 5.03776}, +{17667.4, 66.9866, 4.90242}, +{17953.1, 66.9901, 4.77047}, +{18243.5, 66.9914, 4.64182}, +{18538.6, 66.9907, 4.51643}, +{18838.4, 66.9881, 4.39421}, +{19143.1, 66.9836, 4.27510}, +{19452.7, 66.9775, 4.15904}, +{19767.4, 66.9698, 4.04595}, +{20087.1, 66.9606, 3.93578}, +{20412.0, 66.9501, 3.82845}, +{20742.1, 66.9383, 3.72392}, +{21077.6, 66.9253, 3.62209}, +{21418.5, 66.9111, 3.52294}, +{21765.0, 66.8960, 3.42638}, +{22117.0, 66.8798, 3.33236}, +{22474.7, 66.8627, 3.24082}, +{22838.2, 66.8448, 3.15169}, +{23207.6, 66.8262, 3.06494}, +{23583.0, 66.8067, 2.98048}, +{23964.4, 66.7866, 2.89829}, +{24352.0, 66.7658, 2.81828}, +{24745.9, 66.7445, 2.74042}, +{25146.2, 66.7226, 2.66465}, +{25552.9, 66.7001, 2.59092}, +{25966.2, 66.6772, 2.51918}, +{26386.1, 66.6538, 2.44938}, +{26812.9, 66.6299, 2.38147}, +{27246.6, 66.6057, 2.31541}, +{27687.3, 66.5810, 2.25114}, +{28135.1, 66.5560, 2.18862}, +{28590.2, 66.5307, 2.12780}, +{29052.6, 66.5055, 2.06865}, +{29522.5, 66.4852, 2.01112}, +{30000.0, 66.4355, 1.95517}, +{0, 0, 0} +}; + +e_fp_fdp er[] = { /* Z = 68 */ +{10.0000, -9999.00, 0.183326}, +{10.1617, -9999.00, 0.186265}, +{10.3261, -9999.00, 0.189251}, +{10.4931, -9999.00, 0.192286}, +{10.6628, -9999.00, 0.195368}, +{10.8353, -9999.00, 0.198501}, +{11.0106, -9999.00, 0.201683}, +{11.1886, -9999.00, 0.207387}, +{11.3696, -9999.00, 0.213987}, +{11.5535, -9999.00, 0.220796}, +{11.7404, -9999.00, 0.227823}, +{11.9303, -9999.00, 0.235072}, +{12.1232, -9999.00, 0.242553}, +{12.3193, -9999.00, 0.250432}, +{12.5186, -9999.00, 0.258593}, +{12.7210, -9999.00, 0.267020}, +{12.9268, -9999.00, 0.275721}, +{13.1359, -9999.00, 0.284706}, +{13.3483, -9999.00, 0.293984}, +{13.5642, -9999.00, 0.303546}, +{13.7836, -9999.00, 0.312450}, +{14.0066, -9999.00, 0.321615}, +{14.2331, -9999.00, 0.331050}, +{14.4633, -9999.00, 0.340761}, +{14.6973, -9999.00, 0.350757}, +{14.9350, -9999.00, 0.361227}, +{15.1765, -9999.00, 0.372211}, +{15.4220, -9999.00, 0.383528}, +{15.6714, -9999.00, 0.395190}, +{15.9249, -9999.00, 0.407206}, +{16.1825, -9999.00, 0.419588}, +{16.4442, -9999.00, 0.432346}, +{16.7102, -9999.00, 0.445503}, +{16.9805, -9999.00, 0.459197}, +{17.2551, -9999.00, 0.473311}, +{17.5342, -9999.00, 0.487860}, +{17.8178, -9999.00, 0.502855}, +{18.1060, -9999.00, 0.518312}, +{18.3989, -9999.00, 0.534244}, +{18.6964, -9999.00, 0.550665}, +{18.9988, -9999.00, 0.565831}, +{19.3061, -9999.00, 0.581023}, +{19.6184, -9999.00, 0.596622}, +{19.9357, -9999.00, 0.612641}, +{20.2582, -9999.00, 0.629090}, +{20.5858, -9999.00, 0.647086}, +{20.9188, -9999.00, 0.668378}, +{21.2571, -9999.00, 0.690372}, +{21.6009, -9999.00, 0.713088}, +{21.9503, -9999.00, 0.736552}, +{22.3053, -9999.00, 0.760789}, +{22.6661, -9999.00, 0.808368}, +{23.0327, -9999.00, 0.866467}, +{23.4053, -9999.00, 0.928741}, +{23.7838, -9999.00, 1.01712}, +{24.1685, -9999.00, 1.12317}, +{24.5594, -9999.00, 1.25529}, +{24.9566, -9999.00, 1.46146}, +{25.3603, -9999.00, 1.84167}, +{25.7705, -9999.00, 2.76004}, +{26.1873, -9999.00, 5.13353}, +{26.6109, -9999.00, 6.94578}, +{27.0413, -9999.00, 7.87961}, +{27.4786, -9999.00, 8.83283}, +{27.9231, -9999.00, 9.83569}, +{28.3747, -9999.00, 10.9384}, +{28.8337, -9999.00, 11.6621}, +{29.3000, -2.73063, 12.2610}, +{29.7739, -1.95191, 13.0525}, +{30.2555, -0.742260, 13.5835}, +{30.7449, 0.250293, 13.8024}, +{31.2421, 1.12926, 13.8277}, +{31.7475, 1.88863, 13.8468}, +{32.2609, 2.59966, 13.8659}, +{32.7827, 3.34200, 13.8851}, +{33.3130, 4.23651, 13.8898}, +{33.8518, 4.98066, 13.3269}, +{34.3993, 5.32013, 12.8719}, +{34.9557, 5.62060, 12.6044}, +{35.5211, 5.87936, 12.3461}, +{36.0956, 6.11641, 12.1890}, +{36.6794, 6.35647, 12.0340}, +{37.2727, 6.58638, 11.9191}, +{37.8755, 6.84161, 11.8171}, +{38.4882, 7.12835, 11.7060}, +{39.1107, 7.39132, 11.5161}, +{39.7432, 7.60185, 11.3294}, +{40.3861, 7.76097, 11.1457}, +{41.0393, 7.90517, 11.0421}, +{41.7031, 8.09098, 10.9494}, +{42.3776, 8.33547, 10.8236}, +{43.0630, 8.51915, 10.5795}, +{43.7595, 8.60912, 10.3410}, +{44.4673, 8.57795, 10.1455}, +{45.1865, 8.58166, 10.1096}, +{45.9174, 8.64159, 10.0738}, +{46.6600, 8.72478, 10.0382}, +{47.4147, 8.83138, 9.99634}, +{48.1816, 8.93235, 9.92770}, +{48.9609, 9.02207, 9.85955}, +{49.7528, 9.10524, 9.79185}, +{50.5576, 9.18206, 9.72462}, +{51.3753, 9.25183, 9.65786}, +{52.2062, 9.31316, 9.59154}, +{53.0506, 9.36055, 9.52569}, +{53.9087, 9.37819, 9.47149}, +{54.7806, 9.40829, 9.46039}, +{55.6667, 9.45442, 9.44931}, +{56.5670, 9.50604, 9.43825}, +{57.4820, 9.56055, 9.42719}, +{58.4117, 9.61741, 9.41615}, +{59.3564, 9.67422, 9.40065}, +{60.3165, 9.72739, 9.38457}, +{61.2921, 9.77693, 9.36853}, +{62.2834, 9.82234, 9.35251}, +{63.2908, 9.86234, 9.33653}, +{64.3145, 9.89288, 9.32056}, +{65.3547, 9.90107, 9.31397}, +{66.4118, 9.91942, 9.33646}, +{67.4859, 9.94805, 9.35900}, +{68.5775, 9.97884, 9.38160}, +{69.6867, 10.0089, 9.40425}, +{70.8138, 10.0339, 9.42696}, +{71.9591, 10.0419, 9.44972}, +{73.1230, 10.0528, 9.51613}, +{74.3057, 10.0835, 9.58503}, +{75.5076, 10.1246, 9.65443}, +{76.7289, 10.1732, 9.72434}, +{77.9699, 10.2282, 9.79475}, +{79.2310, 10.2895, 9.86567}, +{80.5125, 10.3576, 9.93711}, +{81.8147, 10.4338, 10.0091}, +{83.1380, 10.5243, 10.0815}, +{84.4827, 10.6548, 10.1356}, +{85.8491, 10.7585, 10.1360}, +{87.2377, 10.8350, 10.1365}, +{88.6487, 10.8977, 10.1370}, +{90.0825, 10.9484, 10.1375}, +{91.5395, 10.9869, 10.1380}, +{93.0201, 11.0113, 10.1384}, +{94.5246, 11.0127, 10.1389}, +{96.0535, 10.9665, 10.1773}, +{97.6071, 10.9543, 10.2588}, +{99.1858, 10.9633, 10.3410}, +{100.790, 10.9784, 10.4238}, +{102.420, 10.9970, 10.5073}, +{104.077, 11.0171, 10.5914}, +{105.760, 11.0367, 10.6762}, +{107.471, 11.0521, 10.7617}, +{109.209, 11.0472, 10.8593}, +{110.975, 11.0606, 10.9856}, +{112.770, 11.0915, 11.1134}, +{114.594, 11.1345, 11.2428}, +{116.448, 11.2007, 11.3719}, +{118.331, 11.2648, 11.4649}, +{120.245, 11.3165, 11.5586}, +{122.190, 11.3634, 11.6530}, +{124.166, 11.4081, 11.7483}, +{126.175, 11.4521, 11.8443}, +{128.215, 11.4978, 11.9411}, +{130.289, 11.5501, 12.0386}, +{132.397, 11.6208, 12.1370}, +{134.538, 11.7631, 12.2362}, +{136.714, 11.8961, 12.1120}, +{138.925, 11.9053, 11.9560}, +{141.172, 11.8264, 11.8020}, +{143.456, 11.7493, 11.6248}, +{145.776, 11.4824, 11.2123}, +{148.134, 10.9788, 10.8145}, +{150.530, 10.4106, 10.4307}, +{152.964, 9.24113, 9.33994}, +{155.439, 6.60109, 7.97383}, +{157.953, 0.699302, 7.46300}, +{160.507, -18.0091, 18.4903}, +{163.103, 11.6185, 41.4954}, +{165.742, 17.9520, 26.9251}, +{168.422, 16.7470, 23.7117}, +{171.146, 16.5718, 21.6199}, +{173.915, 16.3940, 21.2039}, +{176.727, 16.6261, 20.8436}, +{179.586, 16.8618, 20.4894}, +{182.491, 17.0784, 20.3337}, +{185.442, 17.3628, 20.2227}, +{188.442, 17.6820, 20.1123}, +{191.489, 17.9978, 20.0026}, +{194.587, 18.3018, 19.8934}, +{197.734, 18.5863, 19.7849}, +{200.932, 18.8199, 19.6769}, +{204.182, 19.0536, 19.6529}, +{207.485, 19.3125, 19.6307}, +{210.840, 19.5784, 19.6085}, +{214.251, 19.8459, 19.5864}, +{217.716, 20.1130, 19.5643}, +{221.237, 20.3786, 19.5422}, +{224.816, 20.6422, 19.5201}, +{228.452, 20.9034, 19.4981}, +{232.147, 21.1624, 19.4761}, +{235.902, 21.4192, 19.4541}, +{239.717, 21.6747, 19.4321}, +{243.595, 21.9369, 19.4079}, +{247.535, 22.1896, 19.3668}, +{251.538, 22.4293, 19.3258}, +{255.607, 22.6601, 19.2848}, +{259.741, 22.8818, 19.2440}, +{263.942, 23.0937, 19.2032}, +{268.211, 23.2935, 19.1625}, +{272.549, 23.4771, 19.1219}, +{276.957, 23.6234, 19.0814}, +{281.437, 23.7205, 19.1038}, +{285.989, 23.8736, 19.1976}, +{290.615, 24.0642, 19.2920}, +{295.315, 24.2775, 19.3868}, +{300.092, 24.5094, 19.4821}, +{304.945, 24.7587, 19.5778}, +{309.878, 25.0266, 19.6741}, +{314.890, 25.3157, 19.7707}, +{319.983, 25.6317, 19.8679}, +{325.158, 26.0484, 19.9431}, +{330.418, 26.4271, 19.8845}, +{335.762, 26.7457, 19.8261}, +{341.192, 27.0433, 19.7679}, +{346.711, 27.3262, 19.7098}, +{352.319, 27.5978, 19.6519}, +{358.017, 27.8597, 19.5942}, +{363.808, 28.1127, 19.5366}, +{369.692, 28.3561, 19.4792}, +{375.672, 28.5845, 19.4220}, +{381.748, 28.8014, 19.3892}, +{387.922, 29.0283, 19.3686}, +{394.197, 29.2645, 19.3480}, +{400.573, 29.5038, 19.3275}, +{407.052, 29.7456, 19.3069}, +{413.635, 29.9896, 19.2864}, +{420.326, 30.2362, 19.2659}, +{427.124, 30.4853, 19.2454}, +{434.032, 30.7377, 19.2250}, +{441.052, 30.9939, 19.2046}, +{448.186, 31.2550, 19.1842}, +{455.435, 31.5226, 19.1638}, +{462.802, 31.7995, 19.1434}, +{470.287, 32.0909, 19.1231}, +{477.894, 32.4336, 19.0746}, +{485.623, 32.7461, 18.9661}, +{493.478, 33.0228, 18.8582}, +{501.459, 33.2881, 18.7509}, +{509.570, 33.5452, 18.6443}, +{517.812, 33.7965, 18.5382}, +{526.187, 34.0436, 18.4327}, +{534.698, 34.2885, 18.3279}, +{543.346, 34.5332, 18.2237}, +{552.134, 34.7796, 18.1200}, +{561.065, 35.0527, 18.0169}, +{570.139, 35.3183, 17.8598}, +{579.361, 35.5546, 17.6997}, +{588.732, 35.7765, 17.5392}, +{598.254, 35.9876, 17.3791}, +{607.930, 36.1907, 17.2204}, +{617.763, 36.3888, 17.0632}, +{627.755, 36.5887, 16.9062}, +{637.908, 36.7889, 16.7355}, +{648.226, 36.9801, 16.5443}, +{658.711, 37.1417, 16.3408}, +{669.365, 37.2741, 16.1398}, +{680.191, 37.3823, 15.9689}, +{691.193, 37.4969, 15.8208}, +{702.372, 37.6359, 15.6781}, +{713.733, 37.7810, 15.5108}, +{725.277, 37.9056, 15.3277}, +{737.008, 38.0150, 15.1470}, +{748.928, 38.1141, 14.9684}, +{761.042, 38.2051, 14.7916}, +{773.351, 38.2905, 14.6150}, +{785.859, 38.3687, 14.4335}, +{798.570, 38.4324, 14.2485}, +{811.486, 38.4835, 14.0659}, +{824.611, 38.5238, 13.8856}, +{837.949, 38.5546, 13.7075}, +{851.502, 38.5757, 13.5298}, +{865.274, 38.5865, 13.3520}, +{879.269, 38.5843, 13.1746}, +{893.491, 38.5701, 12.9997}, +{907.943, 38.5448, 12.8270}, +{922.628, 38.5108, 12.6565}, +{937.551, 38.4632, 12.4790}, +{952.715, 38.3992, 12.3014}, +{968.124, 38.3162, 12.1241}, +{983.783, 38.2158, 11.9497}, +{999.695, 38.0987, 11.7763}, +{1015.86, 37.9658, 11.6039}, +{1032.29, 37.8084, 11.4213}, +{1048.99, 37.6226, 11.2393}, +{1065.96, 37.4050, 11.0578}, +{1083.20, 37.1543, 10.8793}, +{1100.72, 36.8681, 10.7037}, +{1118.52, 36.5425, 10.5308}, +{1136.61, 36.1727, 10.3608}, +{1155.00, 35.7521, 10.1936}, +{1173.68, 35.2724, 10.0290}, +{1192.66, 34.7229, 9.86702}, +{1211.95, 34.0892, 9.70770}, +{1231.55, 33.3520, 9.55095}, +{1251.47, 32.4843, 9.39710}, +{1271.72, 31.4471, 9.24621}, +{1292.29, 30.1812, 9.09833}, +{1313.19, 28.5886, 8.95259}, +{1334.43, 26.4926, 8.80930}, +{1356.01, 23.5260, 8.66848}, +{1377.94, 18.6945, 8.52971}, +{1400.23, 6.71894, 8.39314}, +{1409.20, -38.9950, 8.33940}, +{1409.40, -38.9702, 40.5887}, +{1422.88, 12.0296, 40.0367}, +{1445.89, 22.8727, 39.1231}, +{1469.28, 28.4128, 38.2306}, +{1493.04, 32.1810, 37.3590}, +{1517.19, 35.0307, 36.5107}, +{1541.73, 37.3061, 35.6821}, +{1566.67, 39.1804, 34.8723}, +{1592.01, 40.7524, 34.0811}, +{1617.76, 42.0826, 33.3076}, +{1643.92, 43.2077, 32.5514}, +{1670.51, 44.1483, 31.8125}, +{1697.53, 44.9099, 31.0907}, +{1724.99, 45.4772, 30.3855}, +{1752.89, 45.7895, 29.6961}, +{1781.24, 45.6264, 29.0223}, +{1810.05, 42.0381, 28.3638}, +{1811.70, 37.8317, 28.3268}, +{1811.90, 37.8489, 33.0892}, +{1839.32, 47.0044, 32.3649}, +{1869.07, 48.7071, 31.6088}, +{1899.30, 49.8324, 30.8705}, +{1930.02, 50.6519, 30.1494}, +{1961.24, 51.1967, 29.4453}, +{1992.96, 51.0989, 28.7576}, +{2005.70, 48.6219, 28.4891}, +{2005.90, 48.6389, 30.4855}, +{2025.20, 52.1298, 30.0719}, +{2057.95, 53.3485, 29.3915}, +{2091.24, 54.1709, 28.7264}, +{2125.06, 54.8029, 28.0763}, +{2159.43, 55.2620, 27.4414}, +{2194.36, 55.2803, 26.8202}, +{2206.40, 53.9070, 26.6116}, +{2206.60, 53.9201, 27.7968}, +{2229.85, 56.1185, 27.4134}, +{2265.92, 56.9651, 26.8368}, +{2302.57, 57.6084, 26.2695}, +{2339.81, 58.1614, 25.7109}, +{2377.66, 58.6554, 25.1620}, +{2416.11, 59.1039, 24.6217}, +{2455.19, 59.5152, 24.0912}, +{2494.90, 59.8945, 23.5691}, +{2535.26, 60.2448, 23.0561}, +{2576.26, 60.5696, 22.5527}, +{2617.93, 60.8714, 22.0580}, +{2660.27, 61.1516, 21.5720}, +{2703.30, 61.4121, 21.0955}, +{2747.03, 61.6543, 20.6275}, +{2791.46, 61.8794, 20.1689}, +{2836.61, 62.0892, 19.7190}, +{2882.49, 62.2837, 19.2769}, +{2929.11, 62.4636, 18.8439}, +{2976.48, 62.6312, 18.4201}, +{3024.63, 62.7865, 18.0035}, +{3073.55, 62.9290, 17.5956}, +{3123.26, 63.0612, 17.1967}, +{3173.78, 63.1830, 16.8048}, +{3225.11, 63.2947, 16.4215}, +{3277.27, 63.3968, 16.0456}, +{3330.28, 63.4902, 15.6781}, +{3384.15, 63.5753, 15.3177}, +{3438.88, 63.6518, 14.9649}, +{3494.50, 63.7213, 14.6202}, +{3551.02, 63.7838, 14.2821}, +{3608.46, 63.8388, 13.9507}, +{3666.82, 63.8869, 13.6268}, +{3726.13, 63.9288, 13.3099}, +{3786.40, 63.9648, 12.9998}, +{3847.64, 63.9950, 12.6964}, +{3909.87, 64.0197, 12.3997}, +{3973.11, 64.0390, 12.1093}, +{4037.38, 64.0533, 11.8252}, +{4102.68, 64.0627, 11.5473}, +{4169.03, 64.0673, 11.2755}, +{4236.46, 64.0674, 11.0098}, +{4304.98, 64.0631, 10.7499}, +{4374.62, 64.0545, 10.4956}, +{4445.37, 64.0417, 10.2471}, +{4517.27, 64.0249, 10.0040}, +{4590.33, 64.0041, 9.76644}, +{4664.58, 63.9796, 9.53405}, +{4740.03, 63.9511, 9.30684}, +{4816.69, 63.9188, 9.08480}, +{4894.60, 63.8829, 8.86763}, +{4973.77, 63.8432, 8.65548}, +{5054.21, 63.7999, 8.44800}, +{5135.96, 63.7528, 8.24524}, +{5219.03, 63.7019, 8.04688}, +{5303.44, 63.6471, 7.85317}, +{5389.22, 63.5884, 7.66372}, +{5476.39, 63.5257, 7.47864}, +{5564.97, 63.4588, 7.29775}, +{5654.98, 63.3877, 7.12095}, +{5746.44, 63.3120, 6.94801}, +{5839.39, 63.2313, 6.77909}, +{5933.83, 63.1457, 6.61398}, +{6029.81, 63.0545, 6.45254}, +{6127.33, 62.9574, 6.29492}, +{6226.44, 62.8540, 6.14069}, +{6327.15, 62.7435, 5.99012}, +{6429.48, 62.6252, 5.84282}, +{6533.48, 62.4984, 5.69901}, +{6639.15, 62.3618, 5.55832}, +{6746.54, 62.2143, 5.42089}, +{6855.65, 62.0540, 5.28650}, +{6966.54, 61.8791, 5.15530}, +{7079.22, 61.6868, 5.02685}, +{7193.72, 61.4737, 4.90141}, +{7310.07, 61.2351, 4.77871}, +{7428.31, 60.9648, 4.65904}, +{7548.45, 60.6537, 4.54189}, +{7670.54, 60.2878, 4.42752}, +{7794.61, 59.8448, 4.31558}, +{7920.68, 59.2846, 4.20616}, +{8048.79, 58.5238, 4.09925}, +{8178.98, 57.3345, 3.99475}, +{8311.26, 54.4278, 3.89259}, +{8357.80, 40.9938, 3.85766}, +{8358.00, 40.9947, 10.7476}, +{8445.69, 55.9215, 10.5401}, +{8582.29, 57.9179, 10.2289}, +{8721.11, 58.8085, 9.92690}, +{8862.16, 59.2467, 9.63385}, +{9005.50, 59.3315, 9.34914}, +{9151.16, 58.8895, 9.07307}, +{9264.20, 51.5037, 8.86737}, +{9264.40, 51.5058, 12.3854}, +{9299.17, 57.9459, 12.2981}, +{9449.58, 60.0307, 11.9309}, +{9602.42, 60.6958, 11.5751}, +{9751.20, 57.5653, 11.2441}, +{9751.40, 57.5668, 12.9154}, +{9757.73, 59.8201, 12.8932}, +{9915.55, 62.0647, 12.3549}, +{10075.9, 62.7355, 12.0806}, +{10238.9, 63.3073, 11.8099}, +{10404.5, 63.7777, 11.5428}, +{10572.8, 64.1848, 11.2794}, +{10743.8, 64.5429, 11.0199}, +{10917.6, 64.8618, 10.7643}, +{11094.2, 65.1482, 10.5126}, +{11273.6, 65.4071, 10.2650}, +{11455.9, 65.6420, 10.0216}, +{11641.2, 65.8561, 9.78223}, +{11829.5, 66.0515, 9.54707}, +{12020.8, 66.2304, 9.31613}, +{12215.3, 66.3942, 9.08939}, +{12412.8, 66.5445, 8.86689}, +{12613.6, 66.6823, 8.64860}, +{12817.6, 66.8088, 8.43455}, +{13025.0, 66.9248, 8.22470}, +{13235.6, 67.0312, 8.01905}, +{13449.7, 67.1287, 7.81757}, +{13667.2, 67.2179, 7.62024}, +{13888.3, 67.2995, 7.42703}, +{14112.9, 67.3740, 7.23791}, +{14341.2, 67.4417, 7.05283}, +{14573.1, 67.5034, 6.87176}, +{14808.9, 67.5592, 6.69466}, +{15048.4, 67.6096, 6.52147}, +{15291.8, 67.6549, 6.35216}, +{15539.1, 67.6956, 6.18667}, +{15790.4, 67.7318, 6.02494}, +{16045.8, 67.7638, 5.86694}, +{16305.4, 67.7919, 5.71260}, +{16569.1, 67.8164, 5.56187}, +{16837.1, 67.8375, 5.41468}, +{17109.4, 67.8554, 5.27099}, +{17386.1, 67.8702, 5.13074}, +{17667.4, 67.8822, 4.99385}, +{17953.1, 67.8916, 4.86029}, +{18243.5, 67.8985, 4.72998}, +{18538.6, 67.9031, 4.60287}, +{18838.4, 67.9054, 4.47889}, +{19143.1, 67.9058, 4.35800}, +{19452.7, 67.9042, 4.24012}, +{19767.4, 67.9008, 4.12520}, +{20087.1, 67.8957, 4.01317}, +{20412.0, 67.8891, 3.90399}, +{20742.1, 67.8809, 3.79758}, +{21077.6, 67.8714, 3.69390}, +{21418.5, 67.8606, 3.59288}, +{21765.0, 67.8486, 3.49447}, +{22117.0, 67.8355, 3.39861}, +{22474.7, 67.8213, 3.30524}, +{22838.2, 67.8061, 3.21431}, +{23207.6, 67.7900, 3.12577}, +{23583.0, 67.7730, 3.03955}, +{23964.4, 67.7552, 2.95561}, +{24352.0, 67.7367, 2.87390}, +{24745.9, 67.7175, 2.79435}, +{25146.2, 67.6976, 2.71693}, +{25552.9, 67.6771, 2.64158}, +{25966.2, 67.6560, 2.56826}, +{26386.1, 67.6343, 2.49690}, +{26812.9, 67.6122, 2.42747}, +{27246.6, 67.5896, 2.35992}, +{27687.3, 67.5665, 2.29420}, +{28135.1, 67.5431, 2.23027}, +{28590.2, 67.5193, 2.16808}, +{29052.6, 67.4955, 2.10759}, +{29522.5, 67.4768, 2.04876}, +{30000.0, 67.4279, 1.99154}, +{0, 0, 0} +}; + +e_fp_fdp tm[] = { /* Z = 69 */ +{10.0000, -9999.00, 0.179178}, +{10.1617, -9999.00, 0.183562}, +{10.3261, -9999.00, 0.188053}, +{10.4931, -9999.00, 0.192655}, +{10.6628, -9999.00, 0.197369}, +{10.8353, -9999.00, 0.202198}, +{11.0106, -9999.00, 0.207145}, +{11.1886, -9999.00, 0.212214}, +{11.3696, -9999.00, 0.217406}, +{11.5535, -9999.00, 0.222726}, +{11.7404, -9999.00, 0.228032}, +{11.9303, -9999.00, 0.233362}, +{12.1232, -9999.00, 0.238816}, +{12.3193, -9999.00, 0.244398}, +{12.5186, -9999.00, 0.252465}, +{12.7210, -9999.00, 0.260938}, +{12.9268, -9999.00, 0.269695}, +{13.1359, -9999.00, 0.278956}, +{13.3483, -9999.00, 0.288750}, +{13.5642, -9999.00, 0.298888}, +{13.7836, -9999.00, 0.309381}, +{14.0066, -9999.00, 0.320243}, +{14.2331, -9999.00, 0.330785}, +{14.4633, -9999.00, 0.341628}, +{14.6973, -9999.00, 0.352827}, +{14.9350, -9999.00, 0.363367}, +{15.1765, -9999.00, 0.371920}, +{15.4220, -9999.00, 0.380674}, +{15.6714, -9999.00, 0.389635}, +{15.9249, -9999.00, 0.401388}, +{16.1825, -9999.00, 0.414494}, +{16.4442, -9999.00, 0.428028}, +{16.7102, -9999.00, 0.442004}, +{16.9805, -9999.00, 0.454906}, +{17.2551, -9999.00, 0.467522}, +{17.5342, -9999.00, 0.480488}, +{17.8178, -9999.00, 0.493146}, +{18.1060, -9999.00, 0.504313}, +{18.3989, -9999.00, 0.515734}, +{18.6964, -9999.00, 0.528157}, +{18.9988, -9999.00, 0.543557}, +{19.3061, -9999.00, 0.559407}, +{19.6184, -9999.00, 0.576219}, +{19.9357, -9999.00, 0.596380}, +{20.2582, -9999.00, 0.617248}, +{20.5858, -9999.00, 0.634307}, +{20.9188, -9999.00, 0.649729}, +{21.2571, -9999.00, 0.665525}, +{21.6009, -9999.00, 0.681582}, +{21.9503, -9999.00, 0.697862}, +{22.3053, -9999.00, 0.714532}, +{22.6661, -9999.00, 0.731985}, +{23.0327, -9999.00, 0.773361}, +{23.4053, -9999.00, 0.817076}, +{23.7838, -9999.00, 0.877890}, +{24.1685, -9999.00, 0.973146}, +{24.5594, -9999.00, 1.07964}, +{24.9566, -9999.00, 1.21408}, +{25.3603, -9999.00, 1.36749}, +{25.7705, -9999.00, 1.71606}, +{26.1873, -9999.00, 2.52512}, +{26.6109, -9999.00, 2.89514}, +{27.0413, -9999.00, 3.63391}, +{27.4786, -9999.00, 4.25061}, +{27.9231, -9999.00, 4.80946}, +{28.3747, -9999.00, 5.47785}, +{28.8337, -9999.00, 6.19755}, +{29.3000, -1.83272, 6.87100}, +{29.7739, -1.59375, 7.58570}, +{30.2555, -1.18278, 8.34892}, +{30.7449, -0.632699, 8.77946}, +{31.2421, -0.176010, 9.16803}, +{31.7475, 0.264100, 9.49109}, +{32.2609, 0.701096, 9.82237}, +{32.7827, 1.22228, 10.0759}, +{33.3130, 1.65537, 10.2386}, +{33.8518, 2.05797, 10.4039}, +{34.3993, 2.45219, 10.5534}, +{34.9557, 2.84079, 10.7009}, +{35.5211, 3.25342, 10.8505}, +{36.0956, 3.68788, 10.9113}, +{36.6794, 4.06430, 10.9433}, +{37.2727, 4.41214, 10.9805}, +{37.8755, 4.76201, 11.0320}, +{38.4882, 5.14352, 11.0836}, +{39.1107, 5.61211, 11.0591}, +{39.7432, 5.97827, 10.9286}, +{40.3861, 6.28050, 10.7983}, +{41.0393, 6.54689, 10.6669}, +{41.7031, 6.78875, 10.5366}, +{42.3776, 6.98948, 10.3804}, +{43.0630, 7.12303, 10.2265}, +{43.7595, 7.23244, 10.1678}, +{44.4673, 7.36725, 10.1178}, +{45.1865, 7.50368, 10.0680}, +{45.9174, 7.62885, 10.0185}, +{46.6600, 7.75385, 10.0042}, +{47.4147, 7.89935, 9.99430}, +{48.1816, 8.06663, 9.98443}, +{48.9609, 8.28215, 9.93439}, +{49.7528, 8.44301, 9.83561}, +{50.5576, 8.56713, 9.73780}, +{51.3753, 8.65773, 9.64968}, +{52.2062, 8.74739, 9.59672}, +{53.0506, 8.84136, 9.54405}, +{53.9087, 8.93477, 9.49166}, +{54.7806, 9.02552, 9.43641}, +{55.6667, 9.10763, 9.37913}, +{56.5670, 9.18133, 9.32220}, +{57.4820, 9.24507, 9.26561}, +{58.4117, 9.29896, 9.21499}, +{59.3564, 9.34608, 9.16647}, +{60.3165, 9.37880, 9.11820}, +{61.2921, 9.39554, 9.09211}, +{62.2834, 9.41863, 9.07559}, +{63.2908, 9.43804, 9.05911}, +{64.3145, 9.43618, 9.04593}, +{65.3547, 9.43900, 9.08196}, +{66.4118, 9.45926, 9.11814}, +{67.4859, 9.48843, 9.15447}, +{68.5775, 9.52063, 9.19135}, +{69.6867, 9.55534, 9.22974}, +{70.8138, 9.59099, 9.26830}, +{71.9591, 9.62532, 9.30701}, +{73.1230, 9.65283, 9.34589}, +{74.3057, 9.67811, 9.40529}, +{75.5076, 9.71422, 9.46895}, +{76.7289, 9.75728, 9.53304}, +{77.9699, 9.80552, 9.59756}, +{79.2310, 9.85852, 9.65567}, +{80.5125, 9.90645, 9.71026}, +{81.8147, 9.94973, 9.76516}, +{83.1380, 9.98655, 9.82038}, +{84.4827, 10.0048, 9.88424}, +{85.8491, 10.0338, 9.97333}, +{87.2377, 10.0731, 10.0632}, +{88.6487, 10.1146, 10.1539}, +{90.0825, 10.1497, 10.2454}, +{91.5395, 10.1822, 10.3684}, +{93.0201, 10.2482, 10.5080}, +{94.5246, 10.3566, 10.6373}, +{96.0535, 10.4566, 10.7170}, +{97.6071, 10.5431, 10.7973}, +{99.1858, 10.6226, 10.8782}, +{100.790, 10.6984, 10.9598}, +{102.420, 10.7708, 11.0419}, +{104.077, 10.8395, 11.1247}, +{105.760, 10.9029, 11.2080}, +{107.471, 10.9577, 11.2920}, +{109.209, 10.9939, 11.3767}, +{110.975, 10.9653, 11.5042}, +{112.770, 11.0177, 11.7511}, +{114.594, 11.1815, 12.0033}, +{116.448, 11.4096, 12.1045}, +{118.331, 11.5757, 12.1624}, +{120.245, 11.6972, 12.2269}, +{122.190, 11.8114, 12.2982}, +{124.166, 11.9192, 12.3699}, +{126.175, 12.0152, 12.4420}, +{128.215, 12.1006, 12.5419}, +{130.289, 12.2141, 12.6580}, +{132.397, 12.3833, 12.7751}, +{134.538, 12.5585, 12.7857}, +{136.714, 12.6685, 12.7713}, +{138.925, 12.7218, 12.7568}, +{141.172, 12.6274, 12.9099}, +{143.456, 12.8543, 13.0743}, +{145.776, 13.0431, 13.0593}, +{148.134, 13.2282, 13.0442}, +{150.530, 13.3649, 12.8550}, +{152.964, 13.4070, 12.6556}, +{155.439, 13.4969, 12.4593}, +{157.953, 13.4463, 11.8315}, +{160.507, 12.8937, 11.0929}, +{163.103, 11.9686, 10.4729}, +{165.742, 10.3912, 9.56704}, +{168.422, 7.25855, 8.83252}, +{171.146, -2.39426, 12.5076}, +{173.915, 0.125351, 31.9669}, +{176.727, 11.1046, 29.0638}, +{179.586, 16.7436, 25.5757}, +{182.491, 18.1993, 22.6301}, +{185.442, 18.6800, 20.5774}, +{188.442, 18.2749, 19.3155}, +{191.489, 18.0141, 18.8170}, +{194.587, 18.0556, 18.5739}, +{197.734, 18.1419, 18.3337}, +{200.932, 18.1449, 18.0964}, +{204.182, 18.1549, 18.0687}, +{207.485, 18.1959, 18.0902}, +{210.840, 18.3088, 18.1670}, +{214.251, 18.4722, 18.2445}, +{217.716, 18.6575, 18.3236}, +{221.237, 18.8606, 18.4046}, +{224.816, 19.0780, 18.4865}, +{228.452, 19.3082, 18.5687}, +{232.147, 19.5532, 18.6510}, +{235.902, 19.8099, 18.7246}, +{239.717, 20.0799, 18.7874}, +{243.595, 20.3438, 18.8366}, +{247.535, 20.6065, 18.8860}, +{251.538, 20.8726, 18.9356}, +{255.607, 21.1475, 18.9855}, +{259.741, 21.4357, 19.0266}, +{263.942, 21.7402, 19.0426}, +{268.211, 22.0199, 19.0303}, +{272.549, 22.2844, 19.0185}, +{276.957, 22.5413, 19.0066}, +{281.437, 22.7950, 18.9947}, +{285.989, 23.0432, 18.9735}, +{290.615, 23.2841, 18.9492}, +{295.315, 23.5145, 18.9216}, +{300.092, 23.7357, 18.8932}, +{304.945, 23.9476, 18.8650}, +{309.878, 24.1512, 18.8375}, +{314.890, 24.3454, 18.8099}, +{319.983, 24.5283, 18.7822}, +{325.158, 24.6965, 18.7545}, +{330.418, 24.8422, 18.7263}, +{335.762, 24.9104, 18.7397}, +{341.192, 25.0249, 18.8387}, +{346.711, 25.1894, 18.9393}, +{352.319, 25.3723, 19.0405}, +{358.017, 25.5698, 19.1419}, +{363.808, 25.7798, 19.2433}, +{369.692, 26.0021, 19.3447}, +{375.672, 26.2352, 19.4453}, +{381.748, 26.4795, 19.5445}, +{387.922, 26.7378, 19.6400}, +{394.197, 26.9998, 19.7273}, +{400.573, 27.2677, 19.8152}, +{407.052, 27.5442, 19.9036}, +{413.635, 27.8340, 19.9934}, +{420.326, 28.1393, 20.0777}, +{427.124, 28.4736, 20.1532}, +{434.032, 28.7997, 20.1898}, +{441.052, 29.1194, 20.2266}, +{448.186, 29.4413, 20.2637}, +{455.435, 29.7757, 20.3014}, +{462.802, 30.1234, 20.3172}, +{470.287, 30.4716, 20.3188}, +{477.894, 30.8107, 20.3085}, +{485.623, 31.1492, 20.2983}, +{493.478, 31.4984, 20.2860}, +{501.459, 31.8567, 20.2652}, +{509.570, 32.2248, 20.2274}, +{517.812, 32.6084, 20.1740}, +{526.187, 32.9995, 20.0933}, +{534.698, 33.3853, 19.9619}, +{543.346, 33.7319, 19.8061}, +{552.134, 34.0579, 19.6517}, +{561.065, 34.3706, 19.4860}, +{570.139, 34.6663, 19.3153}, +{579.361, 34.9442, 19.1416}, +{588.732, 35.2090, 18.9688}, +{598.254, 35.4628, 18.7970}, +{607.930, 35.7081, 18.6268}, +{617.763, 35.9477, 18.4582}, +{627.755, 36.1882, 18.2898}, +{637.908, 36.4281, 18.1083}, +{648.226, 36.6585, 17.9069}, +{658.711, 36.8594, 17.6937}, +{669.365, 37.0310, 17.4829}, +{680.191, 37.1786, 17.3031}, +{691.193, 37.3345, 17.1468}, +{702.372, 37.5188, 16.9948}, +{713.733, 37.7109, 16.8118}, +{725.277, 37.8782, 16.6085}, +{737.008, 38.0273, 16.4073}, +{748.928, 38.1645, 16.2085}, +{761.042, 38.2934, 16.0118}, +{773.351, 38.4172, 15.8143}, +{785.859, 38.5336, 15.6087}, +{798.570, 38.6319, 15.3973}, +{811.486, 38.7151, 15.1887}, +{824.611, 38.7857, 14.9827}, +{837.949, 38.8452, 14.7795}, +{851.502, 38.8938, 14.5775}, +{865.274, 38.9310, 14.3770}, +{879.269, 38.9560, 14.1781}, +{893.491, 38.9690, 13.9817}, +{907.943, 38.9707, 13.7878}, +{922.628, 38.9621, 13.5966}, +{937.551, 38.9410, 13.4036}, +{952.715, 38.9061, 13.2123}, +{968.124, 38.8571, 13.0228}, +{983.783, 38.7945, 12.8354}, +{999.695, 38.7193, 12.6484}, +{1015.86, 38.6340, 12.4619}, +{1032.29, 38.5258, 12.2584}, +{1048.99, 38.3905, 12.0560}, +{1065.96, 38.2265, 11.8547}, +{1083.20, 38.0344, 11.6566}, +{1100.72, 37.8130, 11.4615}, +{1118.52, 37.5602, 11.2694}, +{1136.61, 37.2723, 11.0800}, +{1155.00, 36.9458, 10.8937}, +{1173.68, 36.5761, 10.7106}, +{1192.66, 36.1568, 10.5299}, +{1211.95, 35.6800, 10.3522}, +{1231.55, 35.1361, 10.1773}, +{1251.47, 34.5117, 10.0049}, +{1271.72, 33.7895, 9.83530}, +{1292.29, 32.9456, 9.66836}, +{1313.19, 31.9460, 9.50400}, +{1334.43, 30.7402, 9.34231}, +{1356.01, 29.2490, 9.18320}, +{1377.94, 27.3369, 9.02628}, +{1400.23, 24.7448, 8.87195}, +{1422.88, 20.8755, 8.72024}, +{1445.89, 13.7238, 8.57096}, +{1467.60, -44.2153, 8.43460}, +{1467.80, -44.1931, 42.8257}, +{1469.28, -13.8820, 42.7609}, +{1493.04, 17.4885, 41.7396}, +{1517.19, 25.4206, 40.7427}, +{1541.73, 30.2635, 39.7697}, +{1566.67, 33.7576, 38.8199}, +{1592.01, 36.4746, 37.8923}, +{1617.76, 38.6758, 36.9864}, +{1643.92, 40.5020, 36.1017}, +{1670.51, 42.0367, 35.2376}, +{1697.53, 43.3311, 34.3941}, +{1724.99, 44.4168, 33.5707}, +{1752.89, 45.3076, 32.7667}, +{1781.24, 45.9987, 31.9821}, +{1810.05, 46.4533, 31.2164}, +{1839.32, 46.5451, 30.4691}, +{1869.07, 45.6404, 29.7395}, +{1884.40, 37.8613, 29.3749}, +{1884.60, 37.8683, 34.4908}, +{1899.30, 46.4076, 34.0785}, +{1930.02, 48.9110, 33.2426}, +{1961.24, 50.3126, 32.4274}, +{1992.96, 51.3072, 31.6324}, +{2025.20, 52.0236, 30.8646}, +{2057.95, 52.4012, 30.1089}, +{2089.70, 49.2357, 29.4051}, +{2089.90, 49.2403, 31.5216}, +{2091.24, 51.0690, 31.4912}, +{2125.06, 53.8878, 30.7384}, +{2159.43, 54.9073, 30.0041}, +{2194.36, 55.6496, 29.2878}, +{2229.85, 56.2642, 28.5900}, +{2265.92, 56.2643, 27.9089}, +{2302.57, 56.6238, 28.3473}, +{2306.70, 56.7380, 28.3967}, +{2306.90, 56.7542, 28.4207}, +{2339.81, 57.8031, 27.8706}, +{2377.66, 58.5099, 27.2604}, +{2416.11, 59.0979, 26.6619}, +{2455.19, 59.6158, 26.0750}, +{2494.90, 60.0814, 25.4984}, +{2535.26, 60.5051, 24.9339}, +{2576.26, 60.8941, 24.3806}, +{2617.93, 61.2520, 23.8378}, +{2660.27, 61.5830, 23.3065}, +{2703.30, 61.8888, 22.7846}, +{2747.03, 62.1716, 22.2745}, +{2791.46, 62.4341, 21.7748}, +{2836.61, 62.6779, 21.2854}, +{2882.49, 62.9040, 20.8060}, +{2929.11, 63.1140, 20.3364}, +{2976.48, 63.3084, 19.8763}, +{3024.63, 63.4880, 19.4261}, +{3073.55, 63.6546, 18.9860}, +{3123.26, 63.8095, 18.5549}, +{3173.78, 63.9523, 18.1320}, +{3225.11, 64.0832, 17.7186}, +{3277.27, 64.2041, 17.3143}, +{3330.28, 64.3153, 16.9181}, +{3384.15, 64.4172, 16.5306}, +{3438.88, 64.5096, 16.1507}, +{3494.50, 64.5937, 15.7799}, +{3551.02, 64.6706, 15.4167}, +{3608.46, 64.7392, 15.0605}, +{3666.82, 64.8008, 14.7131}, +{3726.13, 64.8558, 14.3723}, +{3786.40, 64.9037, 14.0390}, +{3847.64, 64.9454, 13.7130}, +{3909.87, 64.9812, 13.3940}, +{3973.11, 65.0113, 13.0819}, +{4037.38, 65.0358, 12.7766}, +{4102.68, 65.0550, 12.4779}, +{4169.03, 65.0691, 12.1856}, +{4236.46, 65.0783, 11.8999}, +{4304.98, 65.0828, 11.6202}, +{4374.62, 65.0827, 11.3469}, +{4445.37, 65.0783, 11.0793}, +{4517.27, 65.0695, 10.8176}, +{4590.33, 65.0565, 10.5619}, +{4664.58, 65.0395, 10.3118}, +{4740.03, 65.0185, 10.0671}, +{4816.69, 64.9935, 9.82784}, +{4894.60, 64.9648, 9.59393}, +{4973.77, 64.9324, 9.36514}, +{5054.21, 64.8961, 9.14144}, +{5135.96, 64.8560, 8.92270}, +{5219.03, 64.8121, 8.70875}, +{5303.44, 64.7645, 8.49979}, +{5389.22, 64.7131, 8.29526}, +{5476.39, 64.6578, 8.09544}, +{5564.97, 64.5986, 7.90005}, +{5654.98, 64.5352, 7.70899}, +{5746.44, 64.4677, 7.52232}, +{5839.39, 64.3958, 7.33972}, +{5933.83, 64.3193, 7.16126}, +{6029.81, 64.2380, 6.98675}, +{6127.33, 64.1514, 6.81608}, +{6226.44, 64.0594, 6.64936}, +{6327.15, 63.9615, 6.48626}, +{6429.48, 63.8571, 6.32692}, +{6533.48, 63.7457, 6.17090}, +{6639.15, 63.6264, 6.01861}, +{6746.54, 63.4986, 5.86965}, +{6855.65, 63.3610, 5.72401}, +{6966.54, 63.2124, 5.58163}, +{7079.22, 63.0512, 5.44249}, +{7193.72, 62.8754, 5.30649}, +{7310.07, 62.6824, 5.17342}, +{7428.31, 62.4687, 5.04336}, +{7548.45, 62.2300, 4.91617}, +{7670.54, 61.9600, 4.79183}, +{7794.61, 61.6498, 4.67022}, +{7920.68, 61.2862, 4.55132}, +{8048.79, 60.8480, 4.43505}, +{8178.98, 60.2973, 4.32141}, +{8311.26, 59.5582, 4.21043}, +{8445.69, 58.4313, 4.10195}, +{8582.29, 55.9647, 3.99560}, +{8647.90, 41.5787, 3.94610}, +{8648.10, 41.5800, 10.9583}, +{8721.11, 56.3180, 10.7878}, +{8862.16, 58.6756, 10.4698}, +{9005.50, 59.6751, 10.1611}, +{9151.16, 60.1876, 9.86135}, +{9299.17, 60.3598, 9.57055}, +{9449.58, 60.1034, 9.28846}, +{9602.42, 57.7059, 9.01460}, +{9616.80, 52.0592, 8.98948}, +{9617.00, 52.0600, 12.5751}, +{9757.73, 60.6046, 12.2326}, +{9915.55, 61.5434, 11.8652}, +{10075.9, 61.5694, 11.5113}, +{10115.6, 58.9955, 11.4263}, +{10115.8, 58.9961, 12.8521}, +{10238.9, 62.6389, 12.6349}, +{10404.5, 63.5029, 12.3524}, +{10572.8, 64.1240, 12.0738}, +{10743.8, 64.6296, 11.7992}, +{10917.6, 65.0605, 11.5285}, +{11094.2, 65.4367, 11.2621}, +{11273.6, 65.7699, 10.9998}, +{11455.9, 66.0681, 10.7418}, +{11641.2, 66.3368, 10.4881}, +{11829.5, 66.5801, 10.2387}, +{12020.8, 66.8013, 9.99374}, +{12215.3, 67.0030, 9.75315}, +{12412.8, 67.1873, 9.51697}, +{12613.6, 67.3560, 9.28521}, +{12817.6, 67.5105, 9.05787}, +{13025.0, 67.6522, 8.83492}, +{13235.6, 67.7820, 8.61636}, +{13449.7, 67.9011, 8.40218}, +{13667.2, 68.0103, 8.19233}, +{13888.3, 68.1103, 7.98681}, +{14112.9, 68.2018, 7.78557}, +{14341.2, 68.2854, 7.58858}, +{14573.1, 68.3617, 7.39579}, +{14808.9, 68.4313, 7.20717}, +{15048.4, 68.4944, 7.02267}, +{15291.8, 68.5517, 6.84224}, +{15539.1, 68.6035, 6.66583}, +{15790.4, 68.6500, 6.49338}, +{16045.8, 68.6918, 6.32485}, +{16305.4, 68.7291, 6.16017}, +{16569.1, 68.7621, 5.99929}, +{16837.1, 68.7911, 5.84215}, +{17109.4, 68.8165, 5.68870}, +{17386.1, 68.8383, 5.53886}, +{17667.4, 68.8569, 5.39259}, +{17953.1, 68.8725, 5.24981}, +{18243.5, 68.8851, 5.11047}, +{18538.6, 68.8951, 4.97451}, +{18838.4, 68.9026, 4.84185}, +{19143.1, 68.9077, 4.71245}, +{19452.7, 68.9106, 4.58624}, +{19767.4, 68.9114, 4.46315}, +{20087.1, 68.9102, 4.34313}, +{20412.0, 68.9073, 4.22611}, +{20742.1, 68.9026, 4.11203}, +{21077.6, 68.8964, 4.00082}, +{21418.5, 68.8886, 3.89245}, +{21765.0, 68.8794, 3.78682}, +{22117.0, 68.8690, 3.68391}, +{22474.7, 68.8573, 3.58363}, +{22838.2, 68.8444, 3.48594}, +{23207.6, 68.8305, 3.39077}, +{23583.0, 68.8156, 3.29807}, +{23964.4, 68.7997, 3.20779}, +{24352.0, 68.7830, 3.11987}, +{24745.9, 68.7654, 3.03425}, +{25146.2, 68.7471, 2.95088}, +{25552.9, 68.7281, 2.86972}, +{25966.2, 68.7084, 2.79070}, +{26386.1, 68.6881, 2.71377}, +{26812.9, 68.6672, 2.63889}, +{27246.6, 68.6457, 2.56601}, +{27687.3, 68.6237, 2.49507}, +{28135.1, 68.6012, 2.42604}, +{28590.2, 68.5783, 2.35886}, +{29052.6, 68.5549, 2.29348}, +{29522.5, 68.5311, 2.22987}, +{30000.0, 68.5069, 2.16799}, +{0, 0, 0} +}; + +e_fp_fdp yb[] = { /* Z = 70 */ +{10.0000, -9999.00, 0.217342}, +{10.1617, -9999.00, 0.218636}, +{10.3261, -9999.00, 0.219937}, +{10.4931, -9999.00, 0.221246}, +{10.6628, -9999.00, 0.222563}, +{10.8353, -9999.00, 0.223887}, +{11.0106, -9999.00, 0.225220}, +{11.1886, -9999.00, 0.226560}, +{11.3696, -9999.00, 0.228863}, +{11.5535, -9999.00, 0.233785}, +{11.7404, -9999.00, 0.238813}, +{11.9303, -9999.00, 0.243949}, +{12.1232, -9999.00, 0.249195}, +{12.3193, -9999.00, 0.255924}, +{12.5186, -9999.00, 0.264222}, +{12.7210, -9999.00, 0.272790}, +{12.9268, -9999.00, 0.281636}, +{13.1359, -9999.00, 0.290768}, +{13.3483, -9999.00, 0.300196}, +{13.5642, -9999.00, 0.309930}, +{13.7836, -9999.00, 0.319980}, +{14.0066, -9999.00, 0.330356}, +{14.2331, -9999.00, 0.340404}, +{14.4633, -9999.00, 0.350428}, +{14.6973, -9999.00, 0.360747}, +{14.9350, -9999.00, 0.371369}, +{15.1765, -9999.00, 0.382305}, +{15.4220, -9999.00, 0.393563}, +{15.6714, -9999.00, 0.405092}, +{15.9249, -9999.00, 0.416304}, +{16.1825, -9999.00, 0.427825}, +{16.4442, -9999.00, 0.439666}, +{16.7102, -9999.00, 0.451834}, +{16.9805, -9999.00, 0.464340}, +{17.2551, -9999.00, 0.477190}, +{17.5342, -9999.00, 0.490641}, +{17.8178, -9999.00, 0.504601}, +{18.1060, -9999.00, 0.518958}, +{18.3989, -9999.00, 0.533723}, +{18.6964, -9999.00, 0.548909}, +{18.9988, -9999.00, 0.564527}, +{19.3061, -9999.00, 0.580206}, +{19.6184, -9999.00, 0.592067}, +{19.9357, -9999.00, 0.604170}, +{20.2582, -9999.00, 0.616521}, +{20.5858, -9999.00, 0.629124}, +{20.9188, -9999.00, 0.641985}, +{21.2571, -9999.00, 0.655109}, +{21.6009, -9999.00, 0.671889}, +{21.9503, -9999.00, 0.691055}, +{22.3053, -9999.00, 0.710768}, +{22.6661, -9999.00, 0.731122}, +{23.0327, -9999.00, 0.753819}, +{23.4053, -9999.00, 0.777220}, +{23.7838, -9999.00, 0.801348}, +{24.1685, -9999.00, 0.858733}, +{24.5594, -9999.00, 0.942698}, +{24.9566, -9999.00, 1.04941}, +{25.3603, -9999.00, 1.19421}, +{25.7705, -9999.00, 1.35899}, +{26.1873, -9999.00, 1.87353}, +{26.6109, -9999.00, 2.26245}, +{27.0413, -9999.00, 3.32280}, +{27.4786, -9999.00, 4.88216}, +{27.9231, -9999.00, 6.60420}, +{28.3747, -9999.00, 8.21357}, +{28.8337, -9999.00, 9.79776}, +{29.3000, -7.21765, 10.9300}, +{29.7739, -6.31581, 11.4763}, +{30.2555, -5.62496, 12.0459}, +{30.7449, -4.91262, 12.6379}, +{31.2421, -4.17366, 13.1291}, +{31.7475, -3.40908, 13.6321}, +{32.2609, -2.57554, 14.0106}, +{32.7827, -1.68872, 14.3371}, +{33.3130, -0.753729, 14.4480}, +{33.8518, 0.553145E-01, 14.4160}, +{34.3993, 0.803437, 14.3264}, +{34.9557, 1.40798, 14.0979}, +{35.5211, 1.88638, 13.9801}, +{36.0956, 2.40036, 13.8724}, +{36.6794, 2.89561, 13.7401}, +{37.2727, 3.36949, 13.5908}, +{37.8755, 3.84796, 13.4360}, +{38.4882, 4.29509, 13.1244}, +{39.1107, 4.62161, 12.8200}, +{39.7432, 4.83909, 12.5226}, +{40.3861, 4.99178, 12.3279}, +{41.0393, 5.19168, 12.1784}, +{41.7031, 5.40153, 12.0307}, +{42.3776, 5.62132, 11.8556}, +{43.0630, 5.80016, 11.6363}, +{43.7595, 5.90350, 11.4364}, +{44.4673, 5.98688, 11.2962}, +{45.1865, 6.08046, 11.1576}, +{45.9174, 6.14512, 11.0208}, +{46.6600, 6.18050, 10.9407}, +{47.4147, 6.24312, 10.8850}, +{48.1816, 6.31779, 10.8295}, +{48.9609, 6.39083, 10.7743}, +{49.7528, 6.45032, 10.7208}, +{50.5576, 6.50755, 10.7024}, +{51.3753, 6.58577, 10.6840}, +{52.2062, 6.66766, 10.6656}, +{53.0506, 6.75706, 10.6473}, +{53.9087, 6.84959, 10.6172}, +{54.7806, 6.92873, 10.5790}, +{55.6667, 6.99692, 10.5409}, +{56.5670, 7.03893, 10.5030}, +{57.4820, 7.06138, 10.5007}, +{58.4117, 7.11139, 10.5323}, +{59.3564, 7.18152, 10.5639}, +{60.3165, 7.27755, 10.5956}, +{61.2921, 7.38628, 10.5865}, +{62.2834, 7.46321, 10.5709}, +{63.2908, 7.52990, 10.5553}, +{64.3145, 7.58340, 10.5473}, +{65.3547, 7.63544, 10.5515}, +{66.4118, 7.69063, 10.5558}, +{67.4859, 7.74192, 10.5571}, +{68.5775, 7.78038, 10.5515}, +{69.6867, 7.79514, 10.5459}, +{70.8138, 7.74345, 10.5410}, +{71.9591, 7.68596, 10.7236}, +{73.1230, 7.76202, 10.9094}, +{74.3057, 7.92332, 11.0983}, +{75.5076, 8.19139, 11.1446}, +{76.7289, 8.37015, 11.0890}, +{77.9699, 8.48327, 11.0336}, +{79.2310, 8.56571, 10.9786}, +{80.5125, 8.62044, 10.9238}, +{81.8147, 8.64233, 10.8693}, +{83.1380, 8.62841, 10.8541}, +{84.4827, 8.62358, 10.8470}, +{85.8491, 8.59253, 10.8399}, +{87.2377, 8.51996, 10.8328}, +{88.6487, 8.42516, 10.9606}, +{90.0825, 8.39519, 11.0952}, +{91.5395, 8.38922, 11.2315}, +{93.0201, 8.39842, 11.3695}, +{94.5246, 8.41879, 11.5092}, +{96.0535, 8.44813, 11.6505}, +{97.6071, 8.48497, 11.7936}, +{99.1858, 8.52842, 11.9385}, +{100.790, 8.57769, 12.0852}, +{102.420, 8.63234, 12.2336}, +{104.077, 8.69192, 12.3839}, +{105.760, 8.75617, 12.5360}, +{107.471, 8.82482, 12.6900}, +{109.209, 8.89772, 12.8459}, +{110.975, 8.97468, 13.0037}, +{112.770, 9.05562, 13.1634}, +{114.594, 9.14029, 13.3251}, +{116.448, 9.22855, 13.4888}, +{118.331, 9.32050, 13.6557}, +{120.245, 9.41705, 13.8248}, +{122.190, 9.51780, 13.9960}, +{124.166, 9.62275, 14.1693}, +{126.175, 9.73187, 14.3448}, +{128.215, 9.84527, 14.5224}, +{130.289, 9.96298, 14.7022}, +{132.397, 10.0852, 14.8842}, +{134.538, 10.2118, 15.0685}, +{136.714, 10.3433, 15.2551}, +{138.925, 10.4796, 15.4440}, +{141.172, 10.6210, 15.6353}, +{143.456, 10.7677, 15.8289}, +{145.776, 10.9201, 16.0248}, +{148.134, 11.0784, 16.2233}, +{150.530, 11.2433, 16.4242}, +{152.964, 11.4150, 16.6275}, +{155.439, 11.5945, 16.8334}, +{157.953, 11.7827, 17.0419}, +{160.507, 11.9812, 17.2529}, +{163.103, 12.1935, 17.4665}, +{165.742, 12.4270, 17.6828}, +{168.422, 12.6882, 17.8602}, +{171.146, 12.9249, 18.0227}, +{173.915, 13.1558, 18.1867}, +{176.727, 13.3855, 18.3522}, +{179.586, 13.6160, 18.5192}, +{182.491, 13.8488, 18.6877}, +{185.442, 14.0848, 18.8577}, +{188.442, 14.3246, 19.0293}, +{191.489, 14.5691, 19.2025}, +{194.587, 14.8190, 19.3772}, +{197.734, 15.0749, 19.5535}, +{200.932, 15.3379, 19.7314}, +{204.182, 15.6089, 19.9110}, +{207.485, 15.8892, 20.0921}, +{210.840, 16.1803, 20.2750}, +{214.251, 16.4846, 20.4595}, +{217.716, 16.8054, 20.6456}, +{221.237, 17.1478, 20.8335}, +{224.816, 17.5435, 21.0230}, +{228.452, 18.0216, 21.1229}, +{232.147, 18.4073, 21.1519}, +{235.902, 18.7589, 21.1810}, +{239.717, 19.0935, 21.2101}, +{243.595, 19.4158, 21.2393}, +{247.535, 19.7287, 21.2685}, +{251.538, 20.0340, 21.2978}, +{255.607, 20.3328, 21.3270}, +{259.741, 20.6256, 21.3564}, +{263.942, 20.9119, 21.3857}, +{268.211, 21.1898, 21.4151}, +{272.549, 21.4597, 21.4598}, +{276.957, 21.7381, 21.5097}, +{281.437, 22.0196, 21.5597}, +{285.989, 22.3031, 21.6099}, +{290.615, 22.5881, 21.6601}, +{295.315, 22.8748, 21.7105}, +{300.092, 23.1632, 21.7610}, +{304.945, 23.4536, 21.8116}, +{309.878, 23.7462, 21.8623}, +{314.890, 24.0415, 21.9131}, +{319.983, 24.3398, 21.9641}, +{325.158, 24.6417, 22.0151}, +{330.418, 24.9480, 22.0663}, +{335.762, 25.2594, 22.1176}, +{341.192, 25.5775, 22.1691}, +{346.711, 25.9044, 22.2206}, +{352.319, 26.2472, 22.2723}, +{358.017, 26.6204, 22.3241}, +{363.808, 26.9992, 22.3006}, +{369.692, 27.3455, 22.2717}, +{375.672, 27.6781, 22.2430}, +{381.748, 28.0027, 22.2142}, +{387.922, 28.3221, 22.1855}, +{394.197, 28.6379, 22.1568}, +{400.573, 28.9511, 22.1281}, +{407.052, 29.2629, 22.0995}, +{413.635, 29.5740, 22.0709}, +{420.326, 29.8854, 22.0424}, +{427.124, 30.1982, 22.0139}, +{434.032, 30.5136, 21.9854}, +{441.052, 30.8339, 21.9570}, +{448.186, 31.1636, 21.9286}, +{455.435, 31.5177, 21.8919}, +{462.802, 31.8616, 21.8047}, +{470.287, 32.1843, 21.7178}, +{477.894, 32.4957, 21.6313}, +{485.623, 32.8007, 21.5451}, +{493.478, 33.1013, 21.4592}, +{501.459, 33.3987, 21.3737}, +{509.570, 33.6941, 21.2886}, +{517.812, 33.9885, 21.2037}, +{526.187, 34.2831, 21.1193}, +{534.698, 34.5792, 21.0351}, +{543.346, 34.8785, 20.9513}, +{552.134, 35.1838, 20.8678}, +{561.065, 35.5003, 20.7847}, +{570.139, 35.8462, 20.7019}, +{579.361, 36.2174, 20.5444}, +{588.732, 36.5404, 20.3594}, +{598.254, 36.8341, 20.1750}, +{607.930, 37.1142, 19.9921}, +{617.763, 37.3859, 19.8111}, +{627.755, 37.6578, 19.6303}, +{637.908, 37.9265, 19.4338}, +{648.226, 38.1901, 19.2142}, +{658.711, 38.4167, 18.9808}, +{669.365, 38.6116, 18.7499}, +{680.191, 38.7715, 18.5536}, +{691.193, 38.9505, 18.3836}, +{702.372, 39.1502, 18.2197}, +{713.733, 39.3658, 18.0278}, +{725.277, 39.5555, 17.8177}, +{737.008, 39.7305, 17.6101}, +{748.928, 39.8964, 17.4047}, +{761.042, 40.0568, 17.2010}, +{773.351, 40.2134, 16.9954}, +{785.859, 40.3687, 16.7784}, +{798.570, 40.5027, 16.5529}, +{811.486, 40.6218, 16.3299}, +{824.611, 40.7295, 16.1099}, +{837.949, 40.8281, 15.8926}, +{851.502, 40.9176, 15.6745}, +{865.274, 40.9986, 15.4554}, +{879.269, 41.0655, 15.2358}, +{893.491, 41.1208, 15.0189}, +{907.943, 41.1660, 14.8049}, +{922.628, 41.2038, 14.5939}, +{937.551, 41.2308, 14.3768}, +{952.715, 41.2449, 14.1605}, +{968.124, 41.2441, 13.9455}, +{983.783, 41.2307, 13.7332}, +{999.695, 41.2067, 13.5224}, +{1015.86, 41.1727, 13.3129}, +{1032.29, 41.1219, 13.0917}, +{1048.99, 41.0514, 12.8710}, +{1065.96, 40.9572, 12.6508}, +{1083.20, 40.8412, 12.4341}, +{1100.72, 40.7036, 12.2208}, +{1118.52, 40.5430, 12.0108}, +{1136.61, 40.3582, 11.8042}, +{1155.00, 40.1476, 11.6010}, +{1173.68, 39.9086, 11.4011}, +{1192.66, 39.6382, 11.2039}, +{1211.95, 39.3328, 11.0101}, +{1231.55, 38.9880, 10.8195}, +{1251.47, 38.5984, 10.6321}, +{1271.72, 38.1570, 10.4482}, +{1292.29, 37.6557, 10.2678}, +{1313.19, 37.0827, 10.0902}, +{1334.43, 36.4228, 9.91559}, +{1356.01, 35.6549, 9.74396}, +{1377.94, 34.7492, 9.57481}, +{1400.23, 33.6611, 9.40837}, +{1422.88, 32.3197, 9.24456}, +{1445.89, 30.6023, 9.08349}, +{1469.28, 28.2649, 8.92356}, +{1493.04, 24.6755, 8.76393}, +{1517.19, 16.8146, 8.60715}, +{1527.70, -12.2656, 8.54057}, +{1527.90, -12.2632, 27.9673}, +{1541.73, 17.6863, 27.5146}, +{1566.67, 20.7066, 26.7267}, +{1592.01, 21.1665, 32.7737}, +{1617.76, 28.0058, 38.1199}, +{1643.92, 33.0863, 37.2924}, +{1670.51, 36.2941, 36.4825}, +{1697.53, 38.7124, 35.6898}, +{1724.99, 40.6462, 34.9138}, +{1752.89, 42.2350, 34.1552}, +{1781.24, 43.5534, 33.4131}, +{1810.05, 44.6397, 32.6868}, +{1839.32, 45.5061, 31.9766}, +{1869.07, 46.1309, 31.2819}, +{1899.30, 46.4147, 30.6022}, +{1930.02, 45.8822, 29.9371}, +{1949.70, 37.9874, 29.5242}, +{1949.90, 37.9959, 34.5861}, +{1961.24, 45.9966, 34.2777}, +{1992.96, 48.9427, 33.4388}, +{2025.20, 50.5083, 32.6289}, +{2057.95, 51.6357, 31.8316}, +{2091.24, 52.4820, 31.0545}, +{2125.06, 53.0551, 30.2966}, +{2159.43, 53.0529, 29.5580}, +{2172.90, 50.2206, 29.2767}, +{2173.10, 50.2250, 31.2685}, +{2194.36, 54.0527, 30.8226}, +{2229.85, 55.2904, 30.1017}, +{2265.92, 56.1324, 29.3987}, +{2302.57, 56.7874, 28.7127}, +{2339.81, 57.2337, 28.0441}, +{2377.66, 57.2892, 27.7995}, +{2398.00, 56.5232, 27.6706}, +{2398.20, 56.5371, 28.2347}, +{2416.11, 58.0660, 27.9491}, +{2455.19, 58.9589, 27.3430}, +{2494.90, 59.6138, 26.7486}, +{2535.26, 60.1734, 26.1654}, +{2576.26, 60.6707, 25.5926}, +{2617.93, 61.1210, 25.0311}, +{2660.27, 61.5322, 24.4800}, +{2703.30, 61.9113, 23.9401}, +{2747.03, 62.2605, 23.4098}, +{2791.46, 62.5836, 22.8906}, +{2836.61, 62.8830, 22.3812}, +{2882.49, 63.1611, 21.8823}, +{2929.11, 63.4188, 21.3930}, +{2976.48, 63.6585, 20.9139}, +{3024.63, 63.8806, 20.4440}, +{3073.55, 64.0870, 19.9843}, +{3123.26, 64.2782, 19.5336}, +{3173.78, 64.4557, 19.0928}, +{3225.11, 64.6209, 18.6608}, +{3277.27, 64.7730, 18.2366}, +{3330.28, 64.9135, 17.8221}, +{3384.15, 65.0427, 17.4160}, +{3438.88, 65.1617, 17.0190}, +{3494.50, 65.2714, 16.6303}, +{3551.02, 65.3719, 16.2490}, +{3608.46, 65.4628, 15.8758}, +{3666.82, 65.5461, 15.5113}, +{3726.13, 65.6212, 15.1532}, +{3786.40, 65.6881, 14.8035}, +{3847.64, 65.7483, 14.4618}, +{3909.87, 65.8018, 14.1268}, +{3973.11, 65.8487, 13.7990}, +{4037.38, 65.8892, 13.4781}, +{4102.68, 65.9237, 13.1644}, +{4169.03, 65.9525, 12.8573}, +{4236.46, 65.9757, 12.5568}, +{4304.98, 65.9937, 12.2629}, +{4374.62, 66.0065, 11.9754}, +{4445.37, 66.0144, 11.6942}, +{4517.27, 66.0176, 11.4193}, +{4590.33, 66.0162, 11.1501}, +{4664.58, 66.0103, 10.8872}, +{4740.03, 66.0002, 10.6299}, +{4816.69, 65.9858, 10.3783}, +{4894.60, 65.9674, 10.1322}, +{4973.77, 65.9449, 9.89160}, +{5054.21, 65.9185, 9.65646}, +{5135.96, 65.8882, 9.42647}, +{5219.03, 65.8540, 9.20169}, +{5303.44, 65.8161, 8.98187}, +{5389.22, 65.7743, 8.76690}, +{5476.39, 65.7287, 8.55681}, +{5564.97, 65.6792, 8.35148}, +{5654.98, 65.6259, 8.15069}, +{5746.44, 65.5685, 7.95443}, +{5839.39, 65.5070, 7.76255}, +{5933.83, 65.4413, 7.57506}, +{6029.81, 65.3713, 7.39164}, +{6127.33, 65.2965, 7.21242}, +{6226.44, 65.2169, 7.03740}, +{6327.15, 65.1324, 6.86626}, +{6429.48, 65.0423, 6.69891}, +{6533.48, 64.9464, 6.53528}, +{6639.15, 64.8440, 6.37539}, +{6746.54, 64.7347, 6.21916}, +{6855.65, 64.6178, 6.06658}, +{6966.54, 64.4925, 5.91726}, +{7079.22, 64.3576, 5.77125}, +{7193.72, 64.2120, 5.62873}, +{7310.07, 64.0540, 5.48919}, +{7428.31, 63.8817, 5.35295}, +{7548.45, 63.6927, 5.21985}, +{7670.54, 63.4836, 5.08953}, +{7794.61, 63.2501, 4.96237}, +{7920.68, 62.9867, 4.83811}, +{8048.79, 62.6846, 4.71641}, +{8178.98, 62.3311, 4.59745}, +{8311.26, 61.9065, 4.48134}, +{8445.69, 61.3757, 4.36767}, +{8582.29, 60.6689, 4.25673}, +{8721.11, 59.6096, 4.14817}, +{8862.16, 57.4628, 4.04219}, +{8943.50, 42.7846, 3.98306}, +{8943.70, 42.7860, 10.9084}, +{9005.50, 56.9482, 10.7698}, +{9151.16, 59.5880, 10.4537}, +{9299.17, 60.6463, 10.1470}, +{9449.58, 61.1980, 9.84905}, +{9602.42, 61.4217, 9.55964}, +{9757.73, 61.2884, 9.27924}, +{9915.55, 60.2409, 9.00674}, +{9978.10, 53.0959, 8.90217}, +{9978.30, 53.0966, 12.4525}, +{10075.9, 61.0503, 12.2317}, +{10238.9, 62.2606, 11.8764}, +{10404.5, 62.5320, 11.5313}, +{10486.3, 59.2909, 11.3666}, +{10486.5, 59.2916, 13.0348}, +{10572.8, 63.1842, 12.8757}, +{10743.8, 64.2747, 12.5699}, +{10917.6, 64.9814, 12.2696}, +{11094.2, 65.5375, 11.9750}, +{11273.6, 66.0022, 11.6859}, +{11455.9, 66.4025, 11.4025}, +{11641.2, 66.7533, 11.1246}, +{11829.5, 67.0645, 10.8522}, +{12020.8, 67.3428, 10.5854}, +{12215.3, 67.5933, 10.3240}, +{12412.8, 67.8195, 10.0680}, +{12613.6, 68.0247, 9.81737}, +{12817.6, 68.2113, 9.57207}, +{13025.0, 68.3811, 9.33202}, +{13235.6, 68.5360, 9.09717}, +{13449.7, 68.6774, 8.86745}, +{13667.2, 68.8065, 8.64279}, +{13888.3, 68.9244, 8.42314}, +{14112.9, 69.0321, 8.20841}, +{14341.2, 69.1303, 7.99854}, +{14573.1, 69.2198, 7.79345}, +{14808.9, 69.3013, 7.59308}, +{15048.4, 69.3754, 7.39733}, +{15291.8, 69.4427, 7.20615}, +{15539.1, 69.5036, 7.01945}, +{15790.4, 69.5585, 6.83714}, +{16045.8, 69.6080, 6.65917}, +{16305.4, 69.6523, 6.48544}, +{16569.1, 69.6919, 6.31587}, +{16837.1, 69.7270, 6.15040}, +{17109.4, 69.7579, 5.98894}, +{17386.1, 69.7850, 5.83141}, +{17667.4, 69.8084, 5.67773}, +{17953.1, 69.8285, 5.52783}, +{18243.5, 69.8454, 5.38163}, +{18538.6, 69.8593, 5.23906}, +{18838.4, 69.8705, 5.10004}, +{19143.1, 69.8791, 4.96449}, +{19452.7, 69.8852, 4.83234}, +{19767.4, 69.8891, 4.70351}, +{20087.1, 69.8909, 4.57794}, +{20412.0, 69.8907, 4.45555}, +{20742.1, 69.8887, 4.33627}, +{21077.6, 69.8849, 4.22003}, +{21418.5, 69.8795, 4.10677}, +{21765.0, 69.8726, 3.99640}, +{22117.0, 69.8643, 3.88888}, +{22474.7, 69.8547, 3.78413}, +{22838.2, 69.8438, 3.68208}, +{23207.6, 69.8318, 3.58268}, +{23583.0, 69.8188, 3.48586}, +{23964.4, 69.8047, 3.39156}, +{24352.0, 69.7897, 3.29971}, +{24745.9, 69.7738, 3.21027}, +{25146.2, 69.7571, 3.12317}, +{25552.9, 69.7397, 3.03835}, +{25966.2, 69.7215, 2.95576}, +{26386.1, 69.7027, 2.87534}, +{26812.9, 69.6833, 2.79705}, +{27246.6, 69.6632, 2.72082}, +{27687.3, 69.6427, 2.64661}, +{28135.1, 69.6216, 2.57436}, +{28590.2, 69.6000, 2.50403}, +{29052.6, 69.5780, 2.43557}, +{29522.5, 69.5555, 2.36892}, +{30000.0, 69.5327, 2.30405}, +{0, 0, 0} +}; + +e_fp_fdp lu[] = { /* Z = 71 */ +{10.0000, -9999.00, 1.67493}, +{10.1617, -9999.00, 1.63824}, +{10.3261, -9999.00, 1.60236}, +{10.4931, -9999.00, 1.56726}, +{10.6628, -9999.00, 1.53293}, +{10.8353, -9999.00, 1.49935}, +{11.0106, -9999.00, 1.46651}, +{11.1886, -9999.00, 1.43538}, +{11.3696, -9999.00, 1.42424}, +{11.5535, -9999.00, 1.41319}, +{11.7404, -9999.00, 1.40223}, +{11.9303, -9999.00, 1.38963}, +{12.1232, -9999.00, 1.36815}, +{12.3193, -9999.00, 1.34699}, +{12.5186, -9999.00, 1.32616}, +{12.7210, -9999.00, 1.30108}, +{12.9268, -9999.00, 1.27644}, +{13.1359, -9999.00, 1.25227}, +{13.3483, -9999.00, 1.22856}, +{13.5642, -9999.00, 1.20529}, +{13.7836, -9999.00, 1.18260}, +{14.0066, -9999.00, 1.16139}, +{14.2331, -9999.00, 1.14057}, +{14.4633, -9999.00, 1.12012}, +{14.6973, -9999.00, 1.10004}, +{14.9350, -9999.00, 1.08087}, +{15.1765, -9999.00, 1.06523}, +{15.4220, -9999.00, 1.04981}, +{15.6714, -9999.00, 1.03462}, +{15.9249, -9999.00, 1.01964}, +{16.1825, -9999.00, 1.00020}, +{16.4442, -9999.00, 0.975191}, +{16.7102, -9999.00, 0.950806}, +{16.9805, -9999.00, 0.927030}, +{17.2551, -9999.00, 0.903850}, +{17.5342, -9999.00, 0.881514}, +{17.8178, -9999.00, 0.862480}, +{18.1060, -9999.00, 0.843858}, +{18.3989, -9999.00, 0.825637}, +{18.6964, -9999.00, 0.807810}, +{18.9988, -9999.00, 0.790368}, +{19.3061, -9999.00, 0.774573}, +{19.6184, -9999.00, 0.759473}, +{19.9357, -9999.00, 0.744668}, +{20.2582, -9999.00, 0.730150}, +{20.5858, -9999.00, 0.715945}, +{20.9188, -9999.00, 0.703634}, +{21.2571, -9999.00, 0.691534}, +{21.6009, -9999.00, 0.679642}, +{21.9503, -9999.00, 0.667955}, +{22.3053, -9999.00, 0.656062}, +{22.6661, -9999.00, 0.644332}, +{23.0327, -9999.00, 0.633762}, +{23.4053, -9999.00, 0.630564}, +{23.7838, -9999.00, 0.627382}, +{24.1685, -9999.00, 0.624398}, +{24.5594, -9999.00, 0.622140}, +{24.9566, -9999.00, 0.619890}, +{25.3603, -9999.00, 0.617835}, +{25.7705, -9999.00, 0.617480}, +{26.1873, -9999.00, 0.617126}, +{26.6109, -9999.00, 0.620682}, +{27.0413, -9999.00, 0.641341}, +{27.4786, -9999.00, 0.669383}, +{27.9231, -9999.00, 0.705770}, +{28.3747, -9999.00, 0.786806}, +{28.8337, -9999.00, 0.945780}, +{29.3000, -5.13090, 2.22990}, +{29.7739, -6.18539, 3.36209}, +{30.2555, -6.32453, 6.12834}, +{30.7449, -5.77834, 8.07995}, +{31.2421, -5.04485, 9.73344}, +{31.7475, -3.74155, 10.7388}, +{32.2609, -2.59986, 11.3775}, +{32.7827, -1.70248, 11.7607}, +{33.3130, -0.887875, 12.1117}, +{33.8518, -0.189434, 12.3588}, +{34.3993, 0.413745, 12.6108}, +{34.9557, 1.01706, 12.9595}, +{35.5211, 1.71157, 13.3180}, +{36.0956, 2.60518, 13.5384}, +{36.6794, 3.35352, 13.5136}, +{37.2727, 4.02103, 13.5029}, +{37.8755, 4.69810, 13.4923}, +{38.4882, 5.49659, 13.2747}, +{39.1107, 5.95621, 12.8612}, +{39.7432, 6.27972, 12.6620}, +{40.3861, 6.62276, 12.4867}, +{41.0393, 6.95088, 12.3139}, +{41.7031, 7.25824, 12.1448}, +{42.3776, 7.55134, 11.9803}, +{43.0630, 7.83909, 11.8180}, +{43.7595, 8.12548, 11.6127}, +{44.4673, 8.34838, 11.3849}, +{45.1865, 8.51864, 11.1616}, +{45.9174, 8.62024, 10.9753}, +{46.6600, 8.73057, 10.8280}, +{47.4147, 8.82007, 10.6827}, +{48.1816, 8.85247, 10.6053}, +{48.9609, 8.95232, 10.5888}, +{49.7528, 9.09655, 10.5724}, +{50.5576, 9.30515, 10.5139}, +{51.3753, 9.46366, 10.3977}, +{52.2062, 9.58880, 10.2828}, +{53.0506, 9.69055, 10.1691}, +{53.9087, 9.75948, 10.0789}, +{54.7806, 9.84273, 10.0107}, +{55.6667, 9.93033, 9.94298}, +{56.5670, 10.0153, 9.87570}, +{57.4820, 10.0965, 9.80901}, +{58.4117, 10.1725, 9.74277}, +{59.3564, 10.2411, 9.67698}, +{60.3165, 10.2983, 9.61959}, +{61.2921, 10.3596, 9.57064}, +{62.2834, 10.4219, 9.52195}, +{63.2908, 10.4881, 9.47349}, +{64.3145, 10.5430, 9.40084}, +{65.3547, 10.5733, 9.32876}, +{66.4118, 10.5656, 9.25723}, +{67.4859, 10.5449, 9.26438}, +{68.5775, 10.5570, 9.28227}, +{69.6867, 10.5875, 9.30021}, +{70.8138, 10.6274, 9.31817}, +{71.9591, 10.6792, 9.33294}, +{73.1230, 10.7303, 9.33764}, +{74.3057, 10.7803, 9.34233}, +{75.5076, 10.8335, 9.34703}, +{76.7289, 10.8992, 9.35174}, +{77.9699, 10.9802, 9.31416}, +{79.2310, 11.0158, 9.24810}, +{80.5125, 11.0182, 9.18251}, +{81.8147, 10.9865, 9.11739}, +{83.1380, 10.8933, 9.05273}, +{84.4827, 10.6856, 9.11605}, +{85.8491, 10.5999, 9.29614}, +{87.2377, 10.6094, 9.47978}, +{88.6487, 10.6968, 9.61217}, +{90.0825, 10.7548, 9.68953}, +{91.5395, 10.8041, 9.76751}, +{93.0201, 10.8570, 9.84612}, +{94.5246, 10.9312, 9.91122}, +{96.0535, 10.9818, 9.93913}, +{97.6071, 11.0099, 9.96712}, +{99.1858, 11.0168, 9.99519}, +{100.790, 10.9868, 10.0373}, +{102.420, 10.9672, 10.1237}, +{104.077, 10.9556, 10.2108}, +{105.760, 10.9421, 10.2987}, +{107.471, 10.9112, 10.3873}, +{109.209, 10.8722, 10.5245}, +{110.975, 10.8563, 10.6750}, +{112.770, 10.8545, 10.8277}, +{114.594, 10.8554, 10.9825}, +{116.448, 10.8554, 11.1528}, +{118.331, 10.8703, 11.3341}, +{120.245, 10.8966, 11.5184}, +{122.190, 10.9298, 11.7056}, +{124.166, 10.9682, 11.8959}, +{126.175, 11.0064, 12.0936}, +{128.215, 11.0575, 12.3054}, +{130.289, 11.1205, 12.5209}, +{132.397, 11.1940, 12.7402}, +{134.538, 11.2779, 12.9633}, +{136.714, 11.3730, 13.1899}, +{138.925, 11.4792, 13.4198}, +{141.172, 11.5982, 13.6536}, +{143.456, 11.7343, 13.8915}, +{145.776, 11.9052, 14.1335}, +{148.134, 12.0929, 14.3249}, +{150.530, 12.2603, 14.5029}, +{152.964, 12.4213, 14.6831}, +{155.439, 12.5826, 14.8655}, +{157.953, 12.7498, 15.0502}, +{160.507, 12.9268, 15.2228}, +{163.103, 13.0951, 15.3871}, +{165.742, 13.2571, 15.5533}, +{168.422, 13.4173, 15.7212}, +{171.146, 13.5759, 15.8909}, +{173.915, 13.7312, 16.0625}, +{176.727, 13.8831, 16.2452}, +{179.586, 14.0419, 16.4348}, +{182.491, 14.2080, 16.6250}, +{185.442, 14.3708, 16.8112}, +{188.442, 14.5235, 16.9981}, +{191.489, 14.6361, 17.2002}, +{194.587, 14.7714, 17.4824}, +{197.734, 14.9368, 17.7937}, +{200.932, 15.1601, 18.1311}, +{204.182, 15.4360, 18.4747}, +{207.485, 15.7752, 18.8251}, +{210.840, 16.2410, 19.1824}, +{214.251, 16.7362, 19.3133}, +{217.716, 17.1946, 19.3954}, +{221.237, 17.5776, 19.4386}, +{224.816, 17.9243, 19.4816}, +{228.452, 18.2486, 19.5246}, +{232.147, 18.5567, 19.5675}, +{235.902, 18.8522, 19.6106}, +{239.717, 19.1376, 19.6537}, +{243.595, 19.4138, 19.6968}, +{247.535, 19.6825, 19.7406}, +{251.538, 19.9450, 19.7842}, +{255.607, 20.1999, 19.8272}, +{259.741, 20.4478, 19.8713}, +{263.942, 20.6887, 19.9153}, +{268.211, 20.9203, 19.9590}, +{272.549, 21.1380, 20.0034}, +{276.957, 21.3278, 20.0690}, +{281.437, 21.5270, 20.1618}, +{285.989, 21.7424, 20.2728}, +{290.615, 21.9708, 20.3867}, +{295.315, 22.2089, 20.5010}, +{300.092, 22.4541, 20.6167}, +{304.945, 22.7062, 20.7326}, +{309.878, 22.9636, 20.8483}, +{314.890, 23.2261, 20.9654}, +{319.983, 23.4944, 21.0834}, +{325.158, 23.7689, 21.2020}, +{330.418, 24.0494, 21.3212}, +{335.762, 24.3364, 21.4412}, +{341.192, 24.6308, 21.5622}, +{346.711, 24.9331, 21.6830}, +{352.319, 25.2433, 21.8044}, +{358.017, 25.5634, 21.9272}, +{363.808, 25.8949, 22.0504}, +{369.692, 26.2398, 22.1746}, +{375.672, 26.6027, 22.2999}, +{381.748, 26.9918, 22.4254}, +{387.922, 27.4250, 22.5363}, +{394.197, 27.9048, 22.6140}, +{400.573, 28.3898, 22.5829}, +{407.052, 28.8070, 22.5089}, +{413.635, 29.1859, 22.4360}, +{420.326, 29.5409, 22.3627}, +{427.124, 29.8762, 22.2895}, +{434.032, 30.1931, 22.2165}, +{441.052, 30.4916, 22.1437}, +{448.186, 30.7405, 22.0809}, +{455.435, 30.9877, 22.0675}, +{462.802, 31.2466, 22.0891}, +{470.287, 31.5326, 22.1297}, +{477.894, 31.8457, 22.1711}, +{485.623, 32.1759, 22.2115}, +{493.478, 32.5224, 22.2518}, +{501.459, 32.8900, 22.2935}, +{509.570, 33.2859, 22.3342}, +{517.812, 33.7360, 22.3605}, +{526.187, 34.2243, 22.3366}, +{534.698, 34.7161, 22.2171}, +{543.346, 35.1450, 22.0511}, +{552.134, 35.5407, 21.8864}, +{561.065, 35.9175, 21.7108}, +{570.139, 36.2747, 21.5299}, +{579.361, 36.6117, 21.3446}, +{588.732, 36.9335, 21.1599}, +{598.254, 37.2430, 20.9760}, +{607.930, 37.5433, 20.7936}, +{617.763, 37.8376, 20.6129}, +{627.755, 38.1335, 20.4324}, +{637.908, 38.4295, 20.2370}, +{648.226, 38.7158, 20.0195}, +{658.711, 38.9707, 19.7886}, +{669.365, 39.1944, 19.5602}, +{680.191, 39.3930, 19.3652}, +{691.193, 39.6018, 19.1954}, +{702.372, 39.8433, 19.0299}, +{713.733, 40.0948, 18.8287}, +{725.277, 40.3189, 18.6043}, +{737.008, 40.5237, 18.3823}, +{748.928, 40.7167, 18.1627}, +{761.042, 40.9019, 17.9453}, +{773.351, 41.0831, 17.7267}, +{785.859, 41.2576, 17.4989}, +{798.570, 41.4140, 17.2644}, +{811.486, 41.5554, 17.0327}, +{824.611, 41.6851, 16.8039}, +{837.949, 41.8049, 16.5780}, +{851.502, 41.9152, 16.3533}, +{865.274, 42.0159, 16.1299}, +{879.269, 42.1059, 15.9079}, +{893.491, 42.1860, 15.6886}, +{907.943, 42.2574, 15.4721}, +{922.628, 42.3222, 15.2584}, +{937.551, 42.3774, 15.0407}, +{952.715, 42.4216, 14.8243}, +{968.124, 42.4542, 14.6096}, +{983.783, 42.4772, 14.3977}, +{999.695, 42.4929, 14.1863}, +{1015.86, 42.5046, 13.9753}, +{1032.29, 42.4993, 13.7453}, +{1048.99, 42.4733, 13.5159}, +{1065.96, 42.4251, 13.2872}, +{1083.20, 42.3571, 13.0623}, +{1100.72, 42.2702, 12.8409}, +{1118.52, 42.1640, 12.6231}, +{1136.61, 42.0372, 12.4082}, +{1155.00, 41.8890, 12.1969}, +{1173.68, 41.7182, 11.9892}, +{1192.66, 41.5228, 11.7846}, +{1211.95, 41.3007, 11.5832}, +{1231.55, 41.0489, 11.3850}, +{1251.47, 40.7641, 11.1899}, +{1271.72, 40.4423, 10.9985}, +{1292.29, 40.0791, 10.8105}, +{1313.19, 39.6681, 10.6257}, +{1334.43, 39.2016, 10.4437}, +{1356.01, 38.6688, 10.2643}, +{1377.94, 38.0560, 10.0881}, +{1400.23, 37.3454, 9.91473}, +{1422.88, 36.5112, 9.74406}, +{1445.89, 35.5162, 9.57594}, +{1469.28, 34.3037, 9.40860}, +{1493.04, 32.7767, 9.24109}, +{1517.19, 30.7470, 9.06467}, +{1541.73, 27.8052, 8.88992}, +{1566.67, 22.6054, 8.71842}, +{1588.40, -11.0350, 8.57380}, +{1588.60, -11.0358, 27.8270}, +{1592.01, 10.6573, 27.7312}, +{1617.76, 21.1871, 27.0244}, +{1643.92, 21.3360, 33.6891}, +{1670.51, 27.1492, 38.9425}, +{1697.53, 33.6220, 38.0218}, +{1724.99, 37.3082, 37.1222}, +{1752.89, 40.0322, 36.2450}, +{1781.24, 42.2005, 35.3891}, +{1810.05, 43.9919, 34.5539}, +{1839.32, 45.5033, 33.7381}, +{1869.07, 46.7930, 32.9417}, +{1899.30, 47.8986, 32.1644}, +{1930.02, 48.8428, 31.4056}, +{1961.24, 49.6339, 30.6649}, +{1992.96, 50.2505, 29.9421}, +{2023.50, 49.7726, 29.2728}, +{2023.70, 49.7823, 29.8668}, +{2025.20, 50.3349, 29.8340}, +{2057.95, 51.4536, 29.1309}, +{2091.24, 51.9947, 28.4444}, +{2125.06, 52.3492, 27.7751}, +{2159.43, 52.5086, 27.1212}, +{2194.36, 52.3886, 26.4838}, +{2229.85, 51.6716, 25.8614}, +{2263.40, 41.7649, 25.2953}, +{2263.60, 41.7809, 31.2651}, +{2265.92, 47.4270, 31.2188}, +{2302.57, 53.0895, 30.5012}, +{2339.81, 54.8089, 29.8010}, +{2377.66, 55.9543, 29.1172}, +{2416.11, 56.8167, 28.4501}, +{2455.19, 57.5144, 27.7995}, +{2491.10, 58.3502, 27.2237}, +{2491.30, 58.3518, 27.1902}, +{2494.90, 57.7334, 27.2302}, +{2535.26, 58.3627, 27.6794}, +{2576.26, 59.3614, 27.0947}, +{2617.93, 60.0663, 26.5195}, +{2660.27, 60.6685, 25.9537}, +{2703.30, 61.2036, 25.3966}, +{2747.03, 61.6869, 24.8491}, +{2791.46, 62.1281, 24.3114}, +{2836.61, 62.5332, 23.7832}, +{2882.49, 62.9071, 23.2646}, +{2929.11, 63.2528, 22.7548}, +{2976.48, 63.5728, 22.2545}, +{3024.63, 63.8694, 21.7633}, +{3073.55, 64.1447, 21.2818}, +{3123.26, 64.4009, 20.8093}, +{3173.78, 64.6385, 20.3450}, +{3225.11, 64.8594, 19.8904}, +{3277.27, 65.0642, 19.4433}, +{3330.28, 65.2535, 19.0058}, +{3384.15, 65.4294, 18.5773}, +{3438.88, 65.5923, 18.1567}, +{3494.50, 65.7431, 17.7444}, +{3551.02, 65.8814, 17.3399}, +{3608.46, 66.0090, 16.9448}, +{3666.82, 66.1263, 16.5564}, +{3726.13, 66.2340, 16.1772}, +{3786.40, 66.3320, 15.8041}, +{3847.64, 66.4208, 15.4399}, +{3909.87, 66.5016, 15.0828}, +{3973.11, 66.5742, 14.7332}, +{4037.38, 66.6391, 14.3909}, +{4102.68, 66.6967, 14.0558}, +{4169.03, 66.7472, 13.7278}, +{4236.46, 66.7911, 13.4067}, +{4304.98, 66.8286, 13.0926}, +{4374.62, 66.8600, 12.7851}, +{4445.37, 66.8855, 12.4842}, +{4517.27, 66.9055, 12.1899}, +{4590.33, 66.9199, 11.9018}, +{4664.58, 66.9291, 11.6202}, +{4740.03, 66.9333, 11.3447}, +{4816.69, 66.9326, 11.0752}, +{4894.60, 66.9272, 10.8117}, +{4973.77, 66.9174, 10.5540}, +{5054.21, 66.9029, 10.3021}, +{5135.96, 66.8842, 10.0558}, +{5219.03, 66.8613, 9.81492}, +{5303.44, 66.8342, 9.57942}, +{5389.22, 66.8028, 9.34921}, +{5476.39, 66.7675, 9.12429}, +{5564.97, 66.7281, 8.90436}, +{5654.98, 66.6847, 8.68944}, +{5746.44, 66.6372, 8.47941}, +{5839.39, 66.5856, 8.27411}, +{5933.83, 66.5298, 8.07350}, +{6029.81, 66.4699, 7.87744}, +{6127.33, 66.4055, 7.68578}, +{6226.44, 66.3365, 7.49854}, +{6327.15, 66.2630, 7.31572}, +{6429.48, 66.1845, 7.13682}, +{6533.48, 66.1007, 6.96224}, +{6639.15, 66.0115, 6.79158}, +{6746.54, 65.9163, 6.62485}, +{6855.65, 65.8147, 6.46193}, +{6966.54, 65.7061, 6.30288}, +{7079.22, 65.5899, 6.14739}, +{7193.72, 65.4652, 5.99556}, +{7310.07, 65.3312, 5.84730}, +{7428.31, 65.1864, 5.70214}, +{7548.45, 65.0292, 5.56064}, +{7670.54, 64.8581, 5.42233}, +{7794.61, 64.6703, 5.28719}, +{7920.68, 64.4628, 5.15507}, +{8048.79, 64.2312, 5.02608}, +{8178.98, 63.9699, 4.90014}, +{8311.26, 63.6707, 4.77710}, +{8445.69, 63.3212, 4.65693}, +{8582.29, 62.9023, 4.53947}, +{8721.11, 62.3797, 4.42456}, +{8862.16, 61.6870, 4.31254}, +{9005.50, 60.6582, 4.20291}, +{9151.16, 58.6159, 4.09594}, +{9244.00, 43.6076, 4.03005}, +{9244.20, 43.6089, 10.9885}, +{9299.17, 57.5817, 10.8681}, +{9449.58, 60.4875, 10.5486}, +{9602.42, 61.6079, 10.2388}, +{9757.73, 62.2026, 9.93831}, +{9915.55, 62.4764, 9.64646}, +{10075.9, 62.4335, 9.36312}, +{10238.9, 61.7797, 9.08811}, +{10348.5, 53.9601, 8.91010}, +{10348.7, 53.9608, 12.5239}, +{10404.5, 61.3525, 12.3978}, +{10572.8, 63.1231, 12.0292}, +{10743.8, 63.6827, 11.6715}, +{10870.3, 60.9431, 11.4173}, +{10870.5, 60.9436, 12.8327}, +{10917.6, 63.8694, 12.7567}, +{11094.2, 65.0852, 12.4786}, +{11273.6, 65.7922, 12.2037}, +{11455.9, 66.3442, 11.9322}, +{11641.2, 66.8065, 11.6642}, +{11829.5, 67.2065, 11.3998}, +{12020.8, 67.5588, 11.1392}, +{12215.3, 67.8731, 10.8825}, +{12412.8, 68.1557, 10.6296}, +{12613.6, 68.4113, 10.3808}, +{12817.6, 68.6435, 10.1361}, +{13025.0, 68.8553, 9.89540}, +{13235.6, 69.0488, 9.65887}, +{13449.7, 69.2260, 9.42651}, +{13667.2, 69.3884, 9.19833}, +{13888.3, 69.5374, 8.97436}, +{14112.9, 69.6741, 8.75458}, +{14341.2, 69.7997, 8.53901}, +{14573.1, 69.9149, 8.32763}, +{14808.9, 70.0206, 8.12043}, +{15048.4, 70.1174, 7.91739}, +{15291.8, 70.2061, 7.71850}, +{15539.1, 70.2872, 7.52372}, +{15790.4, 70.3612, 7.33301}, +{16045.8, 70.4286, 7.14635}, +{16305.4, 70.4899, 6.96370}, +{16569.1, 70.5454, 6.78502}, +{16837.1, 70.5956, 6.61026}, +{17109.4, 70.6407, 6.43937}, +{17386.1, 70.6811, 6.27232}, +{17667.4, 70.7171, 6.10904}, +{17953.1, 70.7489, 5.94949}, +{18243.5, 70.7768, 5.79361}, +{18538.6, 70.8012, 5.64136}, +{18838.4, 70.8220, 5.49266}, +{19143.1, 70.8397, 5.34747}, +{19452.7, 70.8544, 5.20573}, +{19767.4, 70.8663, 5.06738}, +{20087.1, 70.8755, 4.93236}, +{20412.0, 70.8822, 4.80061}, +{20742.1, 70.8866, 4.67207}, +{21077.6, 70.8888, 4.54669}, +{21418.5, 70.8890, 4.42441}, +{21765.0, 70.8872, 4.30515}, +{22117.0, 70.8836, 4.18888}, +{22474.7, 70.8784, 4.07552}, +{22838.2, 70.8715, 3.96502}, +{23207.6, 70.8632, 3.85731}, +{23583.0, 70.8535, 3.75235}, +{23964.4, 70.8425, 3.65007}, +{24352.0, 70.8303, 3.55042}, +{24745.9, 70.8170, 3.45333}, +{25146.2, 70.8025, 3.35876}, +{25552.9, 70.7871, 3.26665}, +{25966.2, 70.7708, 3.17694}, +{26386.1, 70.7536, 3.08957}, +{26812.9, 70.7356, 3.00451}, +{27246.6, 70.7168, 2.92168}, +{27687.3, 70.6973, 2.84105}, +{28135.1, 70.6772, 2.76255}, +{28590.2, 70.6564, 2.68615}, +{29052.6, 70.6350, 2.61178}, +{29522.5, 70.6131, 2.53941}, +{30000.0, 70.5907, 2.46898}, +{0, 0, 0} +}; + +e_fp_fdp hf[] = { /* Z = 72 */ +{10.0000, -9999.00, 2.62338}, +{10.1617, -9999.00, 2.71485}, +{10.3261, -9999.00, 2.80951}, +{10.4931, -9999.00, 2.90326}, +{10.6628, -9999.00, 2.98247}, +{10.8353, -9999.00, 3.06384}, +{11.0106, -9999.00, 3.14744}, +{11.1886, -9999.00, 3.21346}, +{11.3696, -9999.00, 3.27509}, +{11.5535, -9999.00, 3.33789}, +{11.7404, -9999.00, 3.40189}, +{11.9303, -9999.00, 3.44372}, +{12.1232, -9999.00, 3.48479}, +{12.3193, -9999.00, 3.52634}, +{12.5186, -9999.00, 3.56167}, +{12.7210, -9999.00, 3.59271}, +{12.9268, -9999.00, 3.62402}, +{13.1359, -9999.00, 3.65560}, +{13.3483, -9999.00, 3.68534}, +{13.5642, -9999.00, 3.66296}, +{13.7836, -9999.00, 3.64071}, +{14.0066, -9999.00, 3.61861}, +{14.2331, -9999.00, 3.59964}, +{14.4633, -9999.00, 3.58379}, +{14.6973, -9999.00, 3.56801}, +{14.9350, -9999.00, 3.55230}, +{15.1765, -9999.00, 3.52965}, +{15.4220, -9999.00, 3.49460}, +{15.6714, -9999.00, 3.45989}, +{15.9249, -9999.00, 3.42552}, +{16.1825, -9999.00, 3.39150}, +{16.4442, -9999.00, 3.34535}, +{16.7102, -9999.00, 3.29249}, +{16.9805, -9999.00, 3.24047}, +{17.2551, -9999.00, 3.18926}, +{17.5342, -9999.00, 3.13887}, +{17.8178, -9999.00, 3.08551}, +{18.1060, -9999.00, 3.03194}, +{18.3989, -9999.00, 2.97930}, +{18.6964, -9999.00, 2.92757}, +{18.9988, -9999.00, 2.87674}, +{19.3061, -9999.00, 2.82679}, +{19.6184, -9999.00, 2.78143}, +{19.9357, -9999.00, 2.73922}, +{20.2582, -9999.00, 2.69766}, +{20.5858, -9999.00, 2.65672}, +{20.9188, -9999.00, 2.61641}, +{21.2571, -9999.00, 2.57671}, +{21.6009, -9999.00, 2.54242}, +{21.9503, -9999.00, 2.51547}, +{22.3053, -9999.00, 2.48881}, +{22.6661, -9999.00, 2.46243}, +{23.0327, -9999.00, 2.43633}, +{23.4053, -9999.00, 2.41051}, +{23.7838, -9999.00, 2.37896}, +{24.1685, -9999.00, 2.34635}, +{24.5594, -9999.00, 2.31419}, +{24.9566, -9999.00, 2.28247}, +{25.3603, -9999.00, 2.25223}, +{25.7705, -9999.00, 2.22355}, +{26.1873, -9999.00, 2.19523}, +{26.6109, -9999.00, 2.17072}, +{27.0413, -9999.00, 2.17899}, +{27.4786, -9999.00, 2.18728}, +{27.9231, -9999.00, 2.19560}, +{28.3747, -9999.00, 2.25787}, +{28.8337, -9999.00, 2.32848}, +{29.3000, 0.444621, 2.40129}, +{29.7739, 0.136828, 2.48223}, +{30.2555, -0.175772, 2.62642}, +{30.7449, -0.489729, 2.77897}, +{31.2421, -0.830563, 2.94039}, +{31.7475, -1.20335, 3.13207}, +{32.2609, -1.61428, 3.34849}, +{32.7827, -2.15398, 3.61110}, +{33.3130, -2.66961, 4.11070}, +{33.8518, -3.11582, 4.67942}, +{34.3993, -3.52368, 5.32683}, +{34.9557, -3.88103, 6.06380}, +{35.5211, -4.15032, 6.90274}, +{36.0956, -4.33237, 7.79922}, +{36.6794, -4.38125, 8.80157}, +{37.2727, -4.20669, 9.83051}, +{37.8755, -3.95876, 10.7254}, +{38.4882, -3.54368, 11.7018}, +{39.1107, -3.07773, 12.4003}, +{39.7432, -2.63696, 13.1330}, +{40.3861, -2.12652, 13.9090}, +{41.0393, -1.42390, 14.6792}, +{41.7031, -0.705816, 15.1893}, +{42.3776, -0.307145E-01, 15.7172}, +{43.0630, 0.756410, 16.2633}, +{43.7595, 1.67962, 16.6980}, +{44.4673, 2.55865, 16.8896}, +{45.1865, 3.38604, 17.0834}, +{45.9174, 4.28753, 17.1928}, +{46.6600, 5.12897, 17.1213}, +{47.4147, 5.84506, 17.0502}, +{48.1816, 6.53590, 16.9793}, +{48.9609, 7.32181, 16.9088}, +{49.7528, 8.09054, 16.6215}, +{50.5576, 8.69181, 16.2898}, +{51.3753, 9.22398, 15.9647}, +{52.2062, 9.72145, 15.6432}, +{53.0506, 10.1736, 15.2898}, +{53.9087, 10.5636, 14.9443}, +{54.7806, 10.9189, 14.6067}, +{55.6667, 11.2450, 14.2767}, +{56.5670, 11.5490, 13.9542}, +{57.4820, 11.8398, 13.6390}, +{58.4117, 12.1419, 13.3308}, +{59.3564, 12.4529, 12.9371}, +{60.3165, 12.6828, 12.4922}, +{61.2921, 12.8271, 12.0625}, +{62.2834, 12.9247, 11.6477}, +{63.2908, 12.9781, 11.2471}, +{64.3145, 12.9888, 10.8603}, +{65.3547, 12.9397, 10.4868}, +{66.4118, 12.8262, 10.1476}, +{67.4859, 12.6986, 9.94532}, +{68.5775, 12.6164, 9.74703}, +{69.6867, 12.5379, 9.55270}, +{70.8138, 12.4526, 9.36225}, +{71.9591, 12.3530, 9.17558}, +{73.1230, 12.2320, 8.99264}, +{74.3057, 12.0512, 8.81335}, +{75.5076, 11.8132, 8.69542}, +{76.7289, 11.6039, 8.72200}, +{77.9699, 11.4632, 8.74866}, +{79.2310, 11.3477, 8.77540}, +{80.5125, 11.2453, 8.80223}, +{81.8147, 11.1478, 8.82913}, +{83.1380, 11.0428, 8.85611}, +{84.4827, 10.9246, 8.92483}, +{85.8491, 10.8390, 9.01283}, +{87.2377, 10.7717, 9.10170}, +{88.6487, 10.7137, 9.19145}, +{90.0825, 10.6579, 9.28207}, +{91.5395, 10.6014, 9.37946}, +{93.0201, 10.5539, 9.50007}, +{94.5246, 10.5225, 9.62221}, +{96.0535, 10.5006, 9.74594}, +{97.6071, 10.4861, 9.87125}, +{99.1858, 10.4778, 9.99817}, +{100.790, 10.4749, 10.1267}, +{102.420, 10.4764, 10.2569}, +{104.077, 10.4817, 10.3888}, +{105.760, 10.4898, 10.5224}, +{107.471, 10.4989, 10.6577}, +{109.209, 10.5051, 10.7988}, +{110.975, 10.5172, 10.9554}, +{112.770, 10.5406, 11.1143}, +{114.594, 10.5705, 11.2755}, +{116.448, 10.6061, 11.4390}, +{118.331, 10.6469, 11.6049}, +{120.245, 10.6928, 11.7732}, +{122.190, 10.7435, 11.9439}, +{124.166, 10.7991, 12.1171}, +{126.175, 10.8595, 12.2929}, +{128.215, 10.9248, 12.4711}, +{130.289, 10.9950, 12.6520}, +{132.397, 11.0703, 12.8355}, +{134.538, 11.1511, 13.0216}, +{136.714, 11.2388, 13.2105}, +{138.925, 11.3345, 13.4010}, +{141.172, 11.4345, 13.5850}, +{143.456, 11.5352, 13.7715}, +{145.776, 11.6390, 13.9605}, +{148.134, 11.7465, 14.1522}, +{150.530, 11.8582, 14.3465}, +{152.964, 11.9744, 14.5434}, +{155.439, 12.0953, 14.7431}, +{157.953, 12.2213, 14.9455}, +{160.507, 12.3531, 15.1506}, +{163.103, 12.4911, 15.3576}, +{165.742, 12.6340, 15.5667}, +{168.422, 12.7829, 15.7788}, +{171.146, 12.9384, 15.9937}, +{173.915, 13.1012, 16.2115}, +{176.727, 13.2722, 16.4323}, +{179.586, 13.4527, 16.6562}, +{182.491, 13.6460, 16.8830}, +{185.442, 13.8585, 17.1130}, +{188.442, 14.0881, 17.3137}, +{191.489, 14.3058, 17.5074}, +{194.587, 14.5229, 17.7034}, +{197.734, 14.7430, 17.9015}, +{200.932, 14.9682, 18.1018}, +{204.182, 15.2004, 18.3044}, +{207.485, 15.4420, 18.5093}, +{210.840, 15.6977, 18.7164}, +{214.251, 15.9811, 18.9126}, +{217.716, 16.2564, 19.0757}, +{221.237, 16.5231, 19.2403}, +{224.816, 16.7883, 19.4063}, +{228.452, 17.0555, 19.5738}, +{232.147, 17.3265, 19.7427}, +{235.902, 17.6030, 19.9130}, +{239.717, 17.8867, 20.0848}, +{243.595, 18.1821, 20.2581}, +{247.535, 18.5011, 20.4246}, +{251.538, 18.8152, 20.5652}, +{255.607, 19.1240, 20.7067}, +{259.741, 19.4351, 20.8493}, +{263.942, 19.7514, 20.9928}, +{268.211, 20.0754, 21.1373}, +{272.549, 20.4101, 21.2828}, +{276.957, 20.7600, 21.4293}, +{281.437, 21.1338, 21.5768}, +{285.989, 21.5626, 21.7254}, +{290.615, 22.0191, 21.7478}, +{295.315, 22.4143, 21.7390}, +{300.092, 22.7696, 21.7302}, +{304.945, 23.1066, 21.7213}, +{309.878, 23.4290, 21.7125}, +{314.890, 23.7388, 21.7037}, +{319.983, 24.0361, 21.6948}, +{325.158, 24.3152, 21.6860}, +{330.418, 24.5872, 21.7043}, +{335.762, 24.8654, 21.7265}, +{341.192, 25.1473, 21.7486}, +{346.711, 25.4291, 21.7708}, +{352.319, 25.7106, 21.7930}, +{358.017, 25.9914, 21.8152}, +{363.808, 26.2713, 21.8374}, +{369.692, 26.5492, 21.8597}, +{375.672, 26.8250, 21.8863}, +{381.748, 27.1038, 21.9158}, +{387.922, 27.3856, 21.9454}, +{394.197, 27.6690, 21.9750}, +{400.573, 27.9542, 22.0047}, +{407.052, 28.2410, 22.0344}, +{413.635, 28.5300, 22.0652}, +{420.326, 28.8223, 22.0965}, +{427.124, 29.1185, 22.1278}, +{434.032, 29.4190, 22.1591}, +{441.052, 29.7252, 22.1905}, +{448.186, 30.0389, 22.2219}, +{455.435, 30.3750, 22.2534}, +{462.802, 30.7244, 22.2492}, +{470.287, 31.0507, 22.2209}, +{477.894, 31.3621, 22.1925}, +{485.623, 31.6644, 22.1643}, +{493.478, 31.9585, 22.1360}, +{501.459, 32.2424, 22.1078}, +{509.570, 32.5006, 22.0796}, +{517.812, 32.7595, 22.1109}, +{526.187, 33.0463, 22.1548}, +{534.698, 33.3598, 22.1987}, +{543.346, 33.6922, 22.2428}, +{552.134, 34.0461, 22.2870}, +{561.065, 34.4258, 22.3312}, +{570.139, 34.8928, 22.3444}, +{579.361, 35.3327, 22.2563}, +{588.732, 35.7209, 22.1686}, +{598.254, 36.1021, 22.0811}, +{607.930, 36.4832, 21.9941}, +{617.763, 36.8676, 21.9073}, +{627.755, 37.3257, 21.8165}, +{637.908, 37.7646, 21.6054}, +{648.226, 38.1403, 21.3754}, +{658.711, 38.4779, 21.1340}, +{669.365, 38.7649, 20.8953}, +{680.191, 39.0275, 20.6906}, +{691.193, 39.3011, 20.5117}, +{702.372, 39.5959, 20.3357}, +{713.733, 39.9013, 20.1177}, +{725.277, 40.1795, 19.8723}, +{737.008, 40.4248, 19.6297}, +{748.928, 40.6544, 19.3900}, +{761.042, 40.8715, 19.1529}, +{773.351, 41.0781, 18.9172}, +{785.859, 41.2741, 18.6793}, +{798.570, 41.4567, 18.4402}, +{811.486, 41.6257, 18.2041}, +{824.611, 41.7841, 17.9709}, +{837.949, 41.9338, 17.7407}, +{851.502, 42.0748, 17.5112}, +{865.274, 42.2063, 17.2825}, +{879.269, 42.3278, 17.0547}, +{893.491, 42.4394, 16.8298}, +{907.943, 42.5428, 16.6078}, +{922.628, 42.6458, 16.3886}, +{937.551, 42.7408, 16.1574}, +{952.715, 42.8183, 15.9254}, +{968.124, 42.8831, 15.6933}, +{983.783, 42.9358, 15.4646}, +{999.695, 42.9783, 15.2369}, +{1015.86, 43.0169, 15.0102}, +{1032.29, 43.0425, 14.7673}, +{1048.99, 43.0423, 14.5251}, +{1065.96, 43.0237, 14.2837}, +{1083.20, 42.9855, 14.0463}, +{1100.72, 42.9294, 13.8125}, +{1118.52, 42.8552, 13.5824}, +{1136.61, 42.7623, 13.3560}, +{1155.00, 42.6502, 13.1332}, +{1173.68, 42.5177, 12.9140}, +{1192.66, 42.3636, 12.6982}, +{1211.95, 42.1863, 12.4860}, +{1231.55, 41.9839, 12.2773}, +{1251.47, 41.7541, 12.0718}, +{1271.72, 41.4939, 11.8698}, +{1292.29, 41.2003, 11.6715}, +{1313.19, 40.8694, 11.4765}, +{1334.43, 40.4959, 11.2846}, +{1356.01, 40.0734, 11.0956}, +{1377.94, 39.5939, 10.9097}, +{1400.23, 39.0473, 10.7269}, +{1422.88, 38.4203, 10.5469}, +{1445.89, 37.6961, 10.3695}, +{1469.28, 36.8494, 10.1923}, +{1493.04, 35.8461, 10.0139}, +{1517.19, 34.6260, 9.82077}, +{1541.73, 33.0844, 9.62888}, +{1566.67, 31.0787, 9.44066}, +{1592.01, 28.3031, 9.25604}, +{1617.76, 23.9987, 9.07494}, +{1643.92, 15.1224, 8.89728}, +{1661.60, -39.1499, 8.78076}, +{1661.80, -39.1317, 42.1283}, +{1670.51, 8.82000, 41.8085}, +{1697.53, 24.4693, 40.8422}, +{1724.99, 31.0186, 39.8982}, +{1752.89, 35.2660, 38.9760}, +{1781.24, 38.4069, 38.0751}, +{1810.05, 40.8814, 37.1949}, +{1839.32, 42.9009, 36.3345}, +{1869.07, 44.5822, 35.4936}, +{1899.30, 45.9949, 34.6715}, +{1930.02, 47.1807, 33.8685}, +{1961.24, 48.1606, 33.0838}, +{1992.96, 48.9349, 32.3171}, +{2025.20, 49.4740, 31.5755}, +{2057.95, 49.6651, 30.8439}, +{2091.24, 48.8733, 30.1281}, +{2107.50, 41.5636, 29.7885}, +{2107.70, 41.5701, 34.5581}, +{2125.06, 49.8487, 34.1337}, +{2159.43, 52.2226, 33.3186}, +{2194.36, 53.6142, 32.5246}, +{2229.85, 54.6430, 31.7482}, +{2265.92, 55.4335, 30.9911}, +{2302.57, 55.9999, 30.2522}, +{2339.81, 56.1951, 29.5308}, +{2365.30, 53.2227, 29.0536}, +{2365.50, 53.2264, 30.9997}, +{2377.66, 56.4192, 30.7670}, +{2416.11, 57.8893, 30.0500}, +{2455.19, 58.7481, 29.3500}, +{2494.90, 59.3913, 28.6664}, +{2535.26, 59.8598, 27.9999}, +{2576.26, 60.0311, 27.3485}, +{2600.80, 57.9226, 26.9707}, +{2601.00, 57.9340, 28.4250}, +{2617.93, 60.4478, 28.1514}, +{2660.27, 61.5416, 27.4859}, +{2703.30, 62.2551, 26.8371}, +{2747.03, 62.8372, 26.2043}, +{2791.46, 63.3404, 25.5865}, +{2836.61, 63.7856, 24.9850}, +{2882.49, 64.1862, 24.3974}, +{2929.11, 64.5482, 23.8242}, +{2976.48, 64.8781, 23.2658}, +{3024.63, 65.1794, 22.7206}, +{3073.55, 65.4555, 22.1893}, +{3123.26, 65.7090, 21.6703}, +{3173.78, 65.9411, 21.1647}, +{3225.11, 66.1556, 20.6707}, +{3277.27, 66.3519, 20.1898}, +{3330.28, 66.5326, 19.7199}, +{3384.15, 66.6993, 19.2620}, +{3438.88, 66.8524, 18.8142}, +{3494.50, 66.9924, 18.3779}, +{3551.02, 67.1210, 17.9519}, +{3608.46, 67.2386, 17.5362}, +{3666.82, 67.3461, 17.1310}, +{3726.13, 67.4445, 16.7341}, +{3786.40, 67.5334, 16.3479}, +{3847.64, 67.6144, 15.9706}, +{3909.87, 67.6881, 15.6017}, +{3973.11, 67.7536, 15.2415}, +{4037.38, 67.8122, 14.8898}, +{4102.68, 67.8643, 14.5463}, +{4169.03, 67.9101, 14.2107}, +{4236.46, 67.9500, 13.8830}, +{4304.98, 67.9844, 13.5626}, +{4374.62, 68.0133, 13.2495}, +{4445.37, 68.0371, 12.9435}, +{4517.27, 68.0560, 12.6445}, +{4590.33, 68.0703, 12.3523}, +{4664.58, 68.0800, 12.0664}, +{4740.03, 68.0854, 11.7871}, +{4816.69, 68.0867, 11.5139}, +{4894.60, 68.0839, 11.2468}, +{4973.77, 68.0771, 10.9854}, +{5054.21, 68.0666, 10.7299}, +{5135.96, 68.0523, 10.4800}, +{5219.03, 68.0343, 10.2354}, +{5303.44, 68.0126, 9.99621}, +{5389.22, 67.9874, 9.76219}, +{5476.39, 67.9587, 9.53315}, +{5564.97, 67.9264, 9.30914}, +{5654.98, 67.8905, 9.08989}, +{5746.44, 67.8513, 8.87535}, +{5839.39, 67.8083, 8.66531}, +{5933.83, 67.7618, 8.45977}, +{6029.81, 67.7115, 8.25876}, +{6127.33, 67.6574, 8.06172}, +{6226.44, 67.5995, 7.86908}, +{6327.15, 67.5374, 7.68027}, +{6429.48, 67.4711, 7.49571}, +{6533.48, 67.4004, 7.31465}, +{6639.15, 67.3249, 7.13757}, +{6746.54, 67.2444, 6.96430}, +{6855.65, 67.1586, 6.79446}, +{6966.54, 67.0669, 6.62820}, +{7079.22, 66.9693, 6.46550}, +{7193.72, 66.8647, 6.30591}, +{7310.07, 66.7525, 6.14973}, +{7428.31, 66.6319, 5.99681}, +{7548.45, 66.5021, 5.84708}, +{7670.54, 66.3618, 5.70037}, +{7794.61, 66.2095, 5.55671}, +{7920.68, 66.0433, 5.41588}, +{8048.79, 65.8607, 5.27766}, +{8178.98, 65.6587, 5.14266}, +{8311.26, 65.4334, 5.01013}, +{8445.69, 65.1790, 4.88046}, +{8582.29, 64.8879, 4.75328}, +{8721.11, 64.5482, 4.62863}, +{8862.16, 64.1419, 4.50669}, +{9005.50, 63.6376, 4.38709}, +{9151.16, 62.9744, 4.26994}, +{9299.17, 62.0057, 4.15494}, +{9449.58, 60.1331, 4.04230}, +{9560.60, 45.0829, 3.96223}, +{9560.80, 45.0842, 10.8083}, +{9602.42, 58.1544, 10.7228}, +{9757.73, 61.5285, 10.4129}, +{9915.55, 62.7092, 10.1118}, +{10075.9, 63.3372, 9.81947}, +{10238.9, 63.6503, 9.53559}, +{10404.5, 63.6830, 9.25992}, +{10572.8, 63.2845, 8.99220}, +{10739.3, 55.3780, 8.73891}, +{10739.5, 55.3795, 12.2261}, +{10743.8, 59.5710, 12.2172}, +{10917.6, 63.8637, 11.8640}, +{11094.2, 64.5662, 11.5210}, +{11270.6, 61.1117, 11.1934}, +{11270.8, 61.1124, 12.9423}, +{11273.6, 62.9999, 12.9374}, +{11455.9, 65.8754, 12.6256}, +{11641.2, 66.7244, 12.3198}, +{11829.5, 67.3476, 12.0198}, +{12020.8, 67.8535, 11.7258}, +{12215.3, 68.2819, 11.4377}, +{12412.8, 68.6534, 11.1554}, +{12613.6, 68.9803, 10.8789}, +{12817.6, 69.2708, 10.6082}, +{13025.0, 69.5309, 10.3432}, +{13235.6, 69.7650, 10.0838}, +{13449.7, 69.9765, 9.83001}, +{13667.2, 70.1682, 9.58173}, +{13888.3, 70.3423, 9.33890}, +{14112.9, 70.5007, 9.10144}, +{14341.2, 70.6448, 8.86930}, +{14573.1, 70.7762, 8.64238}, +{14808.9, 70.8959, 8.42063}, +{15048.4, 71.0050, 8.20395}, +{15291.8, 71.1043, 7.99227}, +{15539.1, 71.1947, 7.78552}, +{15790.4, 71.2769, 7.58359}, +{16045.8, 71.3514, 7.38642}, +{16305.4, 71.4189, 7.19392}, +{16569.1, 71.4799, 7.00601}, +{16837.1, 71.5349, 6.82260}, +{17109.4, 71.5842, 6.64362}, +{17386.1, 71.6283, 6.46897}, +{17667.4, 71.6676, 6.29857}, +{17953.1, 71.7023, 6.13235}, +{18243.5, 71.7328, 5.97021}, +{18538.6, 71.7594, 5.81208}, +{18838.4, 71.7824, 5.65787}, +{19143.1, 71.8019, 5.50751}, +{19452.7, 71.8182, 5.36091}, +{19767.4, 71.8316, 5.21799}, +{20087.1, 71.8421, 5.07867}, +{20412.0, 71.8501, 4.94287}, +{20742.1, 71.8556, 4.81053}, +{21077.6, 71.8589, 4.68155}, +{21418.5, 71.8600, 4.55587}, +{21765.0, 71.8592, 4.43341}, +{22117.0, 71.8565, 4.31410}, +{22474.7, 71.8521, 4.19787}, +{22838.2, 71.8461, 4.08464}, +{23207.6, 71.8386, 3.97435}, +{23583.0, 71.8297, 3.86692}, +{23964.4, 71.8195, 3.76229}, +{24352.0, 71.8081, 3.66039}, +{24745.9, 71.7955, 3.56116}, +{25146.2, 71.7819, 3.46453}, +{25552.9, 71.7673, 3.37045}, +{25966.2, 71.7518, 3.27884}, +{26386.1, 71.7354, 3.18965}, +{26812.9, 71.7182, 3.10281}, +{27246.6, 71.7003, 3.01828}, +{27687.3, 71.6818, 2.93599}, +{28135.1, 71.6626, 2.85588}, +{28590.2, 71.6429, 2.77791}, +{29052.6, 71.6231, 2.70201}, +{29522.5, 71.6099, 2.62814}, +{30000.0, 71.5581, 2.55624}, +{0, 0, 0} +}; + +} // namespace table_data + +}}} // namespace cctbx::eltbx::henke diff --git a/extern/cctbx/cctbx/eltbx/henke_tables_73_84.cpp b/extern/cctbx/cctbx/eltbx/henke_tables_73_84.cpp new file mode 100644 index 00000000..91a309ca --- /dev/null +++ b/extern/cctbx/cctbx/eltbx/henke_tables_73_84.cpp @@ -0,0 +1,6246 @@ +/* ***************************************************** + THIS IS AN AUTOMATICALLY GENERATED FILE. DO NOT EDIT. + ***************************************************** + + Generated by: + cctbx.source_generators.eltbx.generate_henke_cpp + */ + +#include + +namespace cctbx { namespace eltbx { namespace henke { + +namespace table_data { + +using anomalous::e_fp_fdp; + +e_fp_fdp ta[] = { /* Z = 73 */ +{10.0000, -9999.00, 3.13720}, +{10.1617, -9999.00, 3.25228}, +{10.3261, -9999.00, 3.37159}, +{10.4931, -9999.00, 3.49517}, +{10.6628, -9999.00, 3.62199}, +{10.8353, -9999.00, 3.75342}, +{11.0106, -9999.00, 3.88962}, +{11.1886, -9999.00, 4.03075}, +{11.3696, -9999.00, 4.17701}, +{11.5535, -9999.00, 4.32468}, +{11.7404, -9999.00, 4.46988}, +{11.9303, -9999.00, 4.61995}, +{12.1232, -9999.00, 4.77507}, +{12.3193, -9999.00, 4.93539}, +{12.5186, -9999.00, 5.10109}, +{12.7210, -9999.00, 5.24026}, +{12.9268, -9999.00, 5.37713}, +{13.1359, -9999.00, 5.51759}, +{13.3483, -9999.00, 5.66171}, +{13.5642, -9999.00, 5.80960}, +{13.7836, -9999.00, 5.96135}, +{14.0066, -9999.00, 6.07338}, +{14.2331, -9999.00, 6.15358}, +{14.4633, -9999.00, 6.23483}, +{14.6973, -9999.00, 6.31717}, +{14.9350, -9999.00, 6.40058}, +{15.1765, -9999.00, 6.48280}, +{15.4220, -9999.00, 6.55992}, +{15.6714, -9999.00, 6.63795}, +{15.9249, -9999.00, 6.71691}, +{16.1825, -9999.00, 6.79680}, +{16.4442, -9999.00, 6.86154}, +{16.7102, -9999.00, 6.84686}, +{16.9805, -9999.00, 6.83221}, +{17.2551, -9999.00, 6.81760}, +{17.5342, -9999.00, 6.80302}, +{17.8178, -9999.00, 6.73782}, +{18.1060, -9999.00, 6.66358}, +{18.3989, -9999.00, 6.59014}, +{18.6964, -9999.00, 6.51752}, +{18.9988, -9999.00, 6.44570}, +{19.3061, -9999.00, 6.37067}, +{19.6184, -9999.00, 6.29552}, +{19.9357, -9999.00, 6.22126}, +{20.2582, -9999.00, 6.14788}, +{20.5858, -9999.00, 6.07537}, +{20.9188, -9999.00, 6.00371}, +{21.2571, -9999.00, 5.93288}, +{21.6009, -9999.00, 5.86290}, +{21.9503, -9999.00, 5.79375}, +{22.3053, -9999.00, 5.72541}, +{22.6661, -9999.00, 5.64529}, +{23.0327, -9999.00, 5.54004}, +{23.4053, -9999.00, 5.43674}, +{23.7838, -9999.00, 5.33538}, +{24.1685, -9999.00, 5.23590}, +{24.5594, -9999.00, 5.15222}, +{24.9566, -9999.00, 5.07690}, +{25.3603, -9999.00, 5.00269}, +{25.7705, -9999.00, 4.92956}, +{26.1873, -9999.00, 4.85750}, +{26.6109, -9999.00, 4.78650}, +{27.0413, -9999.00, 4.71985}, +{27.4786, -9999.00, 4.67861}, +{27.9231, -9999.00, 4.63772}, +{28.3747, -9999.00, 4.59720}, +{28.8337, -9999.00, 4.55590}, +{29.3000, 1.97824, 4.50988}, +{29.7739, 1.67726, 4.46433}, +{30.2555, 1.33733, 4.55361}, +{30.7449, 1.01580, 4.65269}, +{31.2421, 0.647242, 4.75393}, +{31.7475, 0.214456, 5.02013}, +{32.2609, -0.119069, 5.36774}, +{32.7827, -0.405135, 5.73941}, +{33.3130, -0.659484, 6.13681}, +{33.8518, -0.887586, 6.56174}, +{34.3993, -1.09200, 7.01697}, +{34.9557, -1.26731, 7.51043}, +{35.5211, -1.40818, 8.03858}, +{36.0956, -1.50978, 8.60389}, +{36.6794, -1.56306, 9.20893}, +{37.2727, -1.53669, 9.85654}, +{37.8755, -1.36993, 10.4630}, +{38.4882, -1.24061, 11.0174}, +{39.1107, -1.09937, 11.6011}, +{39.7432, -0.909361, 12.2157}, +{40.3861, -0.635268, 12.8629}, +{41.0393, -0.267859, 13.4251}, +{41.7031, 0.819637E-01, 13.9630}, +{42.3776, 0.463006, 14.5224}, +{43.0630, 0.911653, 15.1042}, +{43.7595, 1.50220, 15.6787}, +{44.4673, 2.11311, 16.0596}, +{45.1865, 2.70208, 16.4497}, +{45.9174, 3.33137, 16.8493}, +{46.6600, 4.09616, 17.1763}, +{47.4147, 4.79686, 17.3444}, +{48.1816, 5.46219, 17.5141}, +{48.9609, 6.13445, 17.6855}, +{49.7528, 6.85896, 17.8585}, +{50.5576, 7.72304, 18.0333}, +{51.3753, 8.62639, 17.8674}, +{52.2062, 9.37180, 17.6491}, +{53.0506, 10.0708, 17.4336}, +{53.9087, 10.8099, 17.2206}, +{54.7806, 11.5646, 16.7637}, +{55.6667, 12.1136, 16.2323}, +{56.5670, 12.5479, 15.7179}, +{57.4820, 12.9007, 15.2197}, +{58.4117, 13.1791, 14.7373}, +{59.3564, 13.4077, 14.3109}, +{60.3165, 13.6136, 13.9004}, +{61.2921, 13.7931, 13.5017}, +{62.2834, 13.9443, 13.1144}, +{63.2908, 14.0686, 12.7383}, +{64.3145, 14.1669, 12.3729}, +{65.3547, 14.2401, 12.0180}, +{66.4118, 14.2883, 11.6733}, +{67.4859, 14.3109, 11.3385}, +{68.5775, 14.3059, 11.0133}, +{69.6867, 14.2671, 10.6973}, +{70.8138, 14.1701, 10.3937}, +{71.9591, 14.0672, 10.1993}, +{73.1230, 13.9852, 10.0086}, +{74.3057, 13.9001, 9.82835}, +{75.5076, 13.8176, 9.66050}, +{76.7289, 13.7282, 9.49552}, +{77.9699, 13.6173, 9.33334}, +{79.2310, 13.4489, 9.17394}, +{80.5125, 13.2834, 9.14489}, +{81.8147, 13.1704, 9.12327}, +{83.1380, 13.0792, 9.10170}, +{84.4827, 12.9990, 9.08018}, +{85.8491, 12.9243, 9.05872}, +{87.2377, 12.8505, 9.03731}, +{88.6487, 12.7705, 9.01881}, +{90.0825, 12.6935, 9.01381}, +{91.5395, 12.6187, 9.00882}, +{93.0201, 12.5413, 9.00383}, +{94.5246, 12.4568, 8.99884}, +{96.0535, 12.3601, 8.99386}, +{97.6071, 12.2371, 8.98888}, +{99.1858, 12.0351, 9.03862}, +{100.790, 11.8965, 9.16727}, +{102.420, 11.8005, 9.29776}, +{104.077, 11.7206, 9.43010}, +{105.760, 11.6522, 9.56433}, +{107.471, 11.5920, 9.70046}, +{109.209, 11.5371, 9.83853}, +{110.975, 11.4834, 9.97857}, +{112.770, 11.4187, 10.1206}, +{114.594, 11.3497, 10.3038}, +{116.448, 11.3112, 10.5067}, +{118.331, 11.2928, 10.7137}, +{120.245, 11.2903, 10.9247}, +{122.190, 11.3038, 11.1399}, +{124.166, 11.3357, 11.3594}, +{126.175, 11.4011, 11.5702}, +{128.215, 11.4589, 11.7520}, +{130.289, 11.5128, 11.9366}, +{132.397, 11.5679, 12.1242}, +{134.538, 11.6267, 12.3147}, +{136.714, 11.6904, 12.5081}, +{138.925, 11.7612, 12.7046}, +{141.172, 11.8481, 12.9023}, +{143.456, 11.9327, 13.0791}, +{145.776, 12.0063, 13.2584}, +{148.134, 12.0765, 13.4522}, +{150.530, 12.1558, 13.6543}, +{152.964, 12.2419, 13.8594}, +{155.439, 12.3340, 14.0677}, +{157.953, 12.4322, 14.2790}, +{160.507, 12.5374, 14.4936}, +{163.103, 12.6532, 14.7114}, +{165.742, 12.7899, 14.9132}, +{168.422, 12.9049, 15.0953}, +{171.146, 12.9848, 15.2970}, +{173.915, 13.0711, 15.5258}, +{176.727, 13.1768, 15.7888}, +{179.586, 13.3044, 16.0575}, +{182.491, 13.4519, 16.3307}, +{185.442, 13.6176, 16.6080}, +{188.442, 13.8050, 16.8898}, +{191.489, 14.0305, 17.1683}, +{194.587, 14.2621, 17.4096}, +{197.734, 14.4986, 17.6412}, +{200.932, 14.7289, 17.8649}, +{204.182, 14.9616, 18.0913}, +{207.485, 15.2031, 18.3208}, +{210.840, 15.4670, 18.5535}, +{214.251, 15.7375, 18.7488}, +{217.716, 16.0041, 18.9378}, +{221.237, 16.2616, 19.1222}, +{224.816, 16.5170, 19.3079}, +{228.452, 16.7730, 19.4957}, +{232.147, 17.0316, 19.6854}, +{235.902, 17.2945, 19.8774}, +{239.717, 17.5627, 20.0710}, +{243.595, 17.8372, 20.2662}, +{247.535, 18.1188, 20.4629}, +{251.538, 18.4086, 20.6618}, +{255.607, 18.7089, 20.8630}, +{259.741, 19.0223, 21.0663}, +{263.942, 19.3521, 21.2713}, +{268.211, 19.7031, 21.4780}, +{272.549, 20.0898, 21.6869}, +{276.957, 20.5517, 21.8418}, +{281.437, 20.9902, 21.9268}, +{285.989, 21.3890, 21.9666}, +{290.615, 21.7581, 22.0002}, +{295.315, 22.1050, 22.0338}, +{300.092, 22.4393, 22.0677}, +{304.945, 22.7639, 22.1017}, +{309.878, 23.0806, 22.1355}, +{314.890, 23.3905, 22.1694}, +{319.983, 23.6948, 22.2032}, +{325.158, 23.9937, 22.2369}, +{330.418, 24.2880, 22.2711}, +{335.762, 24.5782, 22.3053}, +{341.192, 24.8642, 22.3392}, +{346.711, 25.1457, 22.3733}, +{352.319, 25.4227, 22.4076}, +{358.017, 25.6955, 22.4424}, +{363.808, 25.9630, 22.4769}, +{369.692, 26.2242, 22.5112}, +{375.672, 26.4759, 22.5451}, +{381.748, 26.7145, 22.5802}, +{387.922, 26.9332, 22.6188}, +{394.197, 27.0923, 22.6646}, +{400.573, 27.2409, 22.8306}, +{407.052, 27.4655, 23.0463}, +{413.635, 27.7411, 23.2654}, +{420.326, 28.0552, 23.4852}, +{427.124, 28.4045, 23.7069}, +{434.032, 28.7933, 23.9315}, +{441.052, 29.2281, 24.1581}, +{448.186, 29.7977, 24.3604}, +{455.435, 30.3773, 24.4309}, +{462.802, 30.9341, 24.4070}, +{470.287, 31.4285, 24.3326}, +{477.894, 31.8690, 24.2592}, +{485.623, 32.2864, 24.1856}, +{493.478, 32.6867, 24.1118}, +{501.459, 33.0730, 24.0375}, +{509.570, 33.4492, 23.9639}, +{517.812, 33.8243, 23.8861}, +{526.187, 34.1903, 23.7917}, +{534.698, 34.5275, 23.6650}, +{543.346, 34.7921, 23.5229}, +{552.134, 34.8901, 23.3826}, +{561.065, 34.9467, 23.7024}, +{570.139, 35.5102, 24.1839}, +{579.361, 36.2270, 24.1955}, +{588.732, 36.8945, 24.0659}, +{598.254, 37.4335, 23.8475}, +{607.930, 37.9034, 23.6311}, +{617.763, 38.3363, 23.4165}, +{627.755, 38.7489, 23.2027}, +{637.908, 39.1456, 22.9781}, +{648.226, 39.5222, 22.7368}, +{658.711, 39.8637, 22.4858}, +{669.365, 40.1695, 22.2374}, +{680.191, 40.4459, 22.0257}, +{691.193, 40.7325, 21.8417}, +{702.372, 41.0553, 21.6614}, +{713.733, 41.3883, 21.4386}, +{725.277, 41.6874, 21.1880}, +{737.008, 41.9626, 20.9402}, +{748.928, 42.2228, 20.6951}, +{761.042, 42.4721, 20.4527}, +{773.351, 42.7141, 20.2104}, +{785.859, 42.9476, 19.9629}, +{798.570, 43.1653, 19.7119}, +{811.486, 43.3700, 19.4637}, +{824.611, 43.5643, 19.2185}, +{837.949, 43.7513, 18.9765}, +{851.502, 43.9311, 18.7330}, +{865.274, 44.1027, 18.4878}, +{879.269, 44.2619, 18.2416}, +{893.491, 44.4111, 17.9985}, +{907.943, 44.5529, 17.7586}, +{922.628, 44.6941, 17.5219}, +{937.551, 44.8257, 17.2695}, +{952.715, 44.9436, 17.0158}, +{968.124, 45.0449, 16.7615}, +{983.783, 45.1335, 16.5109}, +{999.695, 45.2119, 16.2627}, +{1015.86, 45.2830, 16.0170}, +{1032.29, 45.3414, 15.7633}, +{1048.99, 45.3852, 15.5100}, +{1065.96, 45.4114, 15.2568}, +{1083.20, 45.4218, 15.0076}, +{1100.72, 45.4174, 14.7623}, +{1118.52, 45.3986, 14.5209}, +{1136.61, 45.3655, 14.2833}, +{1155.00, 45.3179, 14.0494}, +{1173.68, 45.2555, 13.8193}, +{1192.66, 45.1779, 13.5924}, +{1211.95, 45.0845, 13.3693}, +{1231.55, 44.9767, 13.1499}, +{1251.47, 44.8529, 12.9282}, +{1271.72, 44.7095, 12.7043}, +{1292.29, 44.5375, 12.4769}, +{1313.19, 44.3361, 12.2532}, +{1334.43, 44.1049, 12.0334}, +{1356.01, 43.8418, 11.8176}, +{1377.94, 43.5436, 11.6053}, +{1400.23, 43.2061, 11.3968}, +{1422.88, 42.8246, 11.1921}, +{1445.89, 42.3922, 10.9904}, +{1469.28, 41.9004, 10.7918}, +{1493.04, 41.3389, 10.5961}, +{1517.19, 40.6902, 10.3998}, +{1541.73, 39.9330, 10.2065}, +{1566.67, 39.0388, 10.0168}, +{1592.01, 37.9653, 9.83048}, +{1617.76, 36.6451, 9.64752}, +{1643.92, 34.9623, 9.46783}, +{1670.51, 32.6905, 9.29154}, +{1697.53, 29.2697, 9.11830}, +{1724.99, 22.0968, 8.94782}, +{1735.00, 4.24359, 8.88710}, +{1735.20, 4.15165, 19.7275}, +{1752.89, 19.0016, 23.0041}, +{1781.24, 20.1406, 29.3353}, +{1810.05, 26.4010, 37.4091}, +{1839.32, 33.8200, 38.2464}, +{1869.07, 38.0706, 37.3684}, +{1899.30, 41.0410, 36.5105}, +{1930.02, 43.3374, 35.6714}, +{1961.24, 45.1885, 34.8515}, +{1992.96, 46.7053, 34.0503}, +{2025.20, 47.9578, 33.2750}, +{2057.95, 48.9736, 32.5099}, +{2091.24, 49.7460, 31.7623}, +{2125.06, 50.2181, 31.0313}, +{2159.43, 50.1454, 30.3178}, +{2193.90, 41.8841, 29.6298}, +{2194.10, 41.8914, 34.5927}, +{2194.36, 43.9311, 34.5862}, +{2229.85, 52.0931, 33.7286}, +{2265.92, 53.9219, 32.8926}, +{2302.57, 55.1844, 32.0767}, +{2339.81, 56.1508, 31.2817}, +{2377.66, 56.8921, 30.5072}, +{2416.11, 57.3862, 29.7511}, +{2455.19, 57.2830, 29.0142}, +{2468.60, 54.4774, 28.7682}, +{2468.80, 54.4810, 30.7128}, +{2494.90, 58.3585, 30.2252}, +{2535.26, 59.5054, 29.4962}, +{2576.26, 60.2863, 28.7842}, +{2617.93, 60.8784, 28.0897}, +{2660.27, 61.2837, 27.4133}, +{2703.30, 60.9856, 26.7526}, +{2707.90, 59.8129, 26.6835}, +{2708.10, 59.8221, 27.7560}, +{2747.03, 62.2261, 27.2313}, +{2791.46, 62.9476, 26.6532}, +{2836.61, 63.5314, 26.0836}, +{2882.49, 64.0434, 25.5214}, +{2929.11, 64.5045, 24.9680}, +{2976.48, 64.9260, 24.4237}, +{3024.63, 65.3131, 23.8872}, +{3073.55, 65.6705, 23.3605}, +{3123.26, 66.0014, 22.8422}, +{3173.78, 66.3080, 22.3330}, +{3225.11, 66.5922, 21.8327}, +{3277.27, 66.8559, 21.3416}, +{3330.28, 67.1003, 20.8592}, +{3384.15, 67.3272, 20.3867}, +{3438.88, 67.5376, 19.9224}, +{3494.50, 67.7322, 19.4673}, +{3551.02, 67.9126, 19.0213}, +{3608.46, 68.0793, 18.5836}, +{3666.82, 68.2327, 18.1547}, +{3726.13, 68.3743, 17.7348}, +{3786.40, 68.5039, 17.3227}, +{3847.64, 68.6226, 16.9200}, +{3909.87, 68.7314, 16.5253}, +{3973.11, 68.8304, 16.1388}, +{4037.38, 68.9202, 15.7604}, +{4102.68, 69.0012, 15.3901}, +{4169.03, 69.0739, 15.0276}, +{4236.46, 69.1387, 14.6729}, +{4304.98, 69.1961, 14.3258}, +{4374.62, 69.2463, 13.9862}, +{4445.37, 69.2897, 13.6539}, +{4517.27, 69.3265, 13.3289}, +{4590.33, 69.3573, 13.0113}, +{4664.58, 69.3822, 12.7004}, +{4740.03, 69.4013, 12.3965}, +{4816.69, 69.4150, 12.0994}, +{4894.60, 69.4235, 11.8088}, +{4973.77, 69.4271, 11.5248}, +{5054.21, 69.4258, 11.2471}, +{5135.96, 69.4198, 10.9758}, +{5219.03, 69.4094, 10.7105}, +{5303.44, 69.3946, 10.4515}, +{5389.22, 69.3756, 10.1981}, +{5476.39, 69.3525, 9.95074}, +{5564.97, 69.3256, 9.70905}, +{5654.98, 69.2946, 9.47265}, +{5746.44, 69.2597, 9.24197}, +{5839.39, 69.2210, 9.01663}, +{5933.83, 69.1786, 8.79649}, +{6029.81, 69.1324, 8.58146}, +{6127.33, 69.0824, 8.37138}, +{6226.44, 69.0286, 8.16637}, +{6327.15, 68.9711, 7.96623}, +{6429.48, 68.9097, 7.77072}, +{6533.48, 68.8443, 7.57977}, +{6639.15, 68.7747, 7.39339}, +{6746.54, 68.7010, 7.21144}, +{6855.65, 68.6227, 7.03362}, +{6966.54, 68.5396, 6.86032}, +{7079.22, 68.4517, 6.69110}, +{7193.72, 68.3584, 6.52574}, +{7310.07, 68.2593, 6.36455}, +{7428.31, 68.1541, 6.20713}, +{7548.45, 68.0419, 6.05341}, +{7670.54, 67.9222, 5.90358}, +{7794.61, 67.7940, 5.75720}, +{7920.68, 67.6562, 5.61435}, +{8048.79, 67.5074, 5.47501}, +{8178.98, 67.3461, 5.33911}, +{8311.26, 67.1701, 5.20646}, +{8445.69, 66.9767, 5.07705}, +{8582.29, 66.7618, 4.95039}, +{8721.11, 66.5205, 4.82720}, +{8862.16, 66.2459, 4.70686}, +{9005.50, 65.9271, 4.58942}, +{9151.16, 65.5475, 4.47489}, +{9299.17, 65.0790, 4.36318}, +{9449.58, 64.4664, 4.25404}, +{9602.42, 63.5787, 4.14765}, +{9757.73, 61.9472, 4.04384}, +{9881.00, 47.4734, 3.96442}, +{9881.20, 47.4747, 10.4207}, +{9915.55, 59.4412, 10.3542}, +{10075.9, 63.0151, 10.0527}, +{10238.9, 64.1843, 9.75991}, +{10404.5, 64.8094, 9.47567}, +{10572.8, 65.1371, 9.19970}, +{10743.8, 65.2157, 8.93178}, +{10917.6, 64.9575, 8.67165}, +{11094.2, 63.4845, 8.41911}, +{11136.0, 57.0506, 8.36092}, +{11136.2, 57.0520, 11.7588}, +{11273.6, 65.0180, 11.4902}, +{11455.9, 65.9758, 11.1481}, +{11641.2, 65.9661, 10.8162}, +{11681.4, 63.5302, 10.7462}, +{11681.6, 63.5307, 12.0831}, +{11829.5, 67.0386, 11.8723}, +{12020.8, 67.8327, 11.6088}, +{12215.3, 68.4049, 11.3488}, +{12412.8, 68.8701, 11.0923}, +{12613.6, 69.2660, 10.8395}, +{12817.6, 69.6112, 10.5905}, +{13025.0, 69.9168, 10.3453}, +{13235.6, 70.1900, 10.1039}, +{13449.7, 70.4360, 9.86656}, +{13667.2, 70.6588, 9.63316}, +{13888.3, 70.8612, 9.40379}, +{14112.9, 71.0457, 9.17846}, +{14341.2, 71.2142, 8.95720}, +{14573.1, 71.3683, 8.74000}, +{14808.9, 71.5094, 8.52689}, +{15048.4, 71.6387, 8.31784}, +{15291.8, 71.7572, 8.11286}, +{15539.1, 71.8657, 7.91194}, +{15790.4, 71.9652, 7.71503}, +{16045.8, 72.0562, 7.52215}, +{16305.4, 72.1393, 7.33323}, +{16569.1, 72.2153, 7.14827}, +{16837.1, 72.2845, 6.96723}, +{17109.4, 72.3474, 6.79006}, +{17386.1, 72.4045, 6.61673}, +{17667.4, 72.4562, 6.44719}, +{17953.1, 72.5027, 6.28140}, +{18243.5, 72.5446, 6.11931}, +{18538.6, 72.5819, 5.96088}, +{18838.4, 72.6151, 5.80605}, +{19143.1, 72.6444, 5.65477}, +{19452.7, 72.6701, 5.50699}, +{19767.4, 72.6923, 5.36265}, +{20087.1, 72.7113, 5.22170}, +{20412.0, 72.7273, 5.08408}, +{20742.1, 72.7405, 4.94974}, +{21077.6, 72.7510, 4.81861}, +{21418.5, 72.7590, 4.69065}, +{21765.0, 72.7647, 4.56580}, +{22117.0, 72.7683, 4.44399}, +{22474.7, 72.7698, 4.32517}, +{22838.2, 72.7693, 4.20929}, +{23207.6, 72.7671, 4.09628}, +{23583.0, 72.7632, 3.98608}, +{23964.4, 72.7577, 3.87865}, +{24352.0, 72.7507, 3.77392}, +{24745.9, 72.7424, 3.67185}, +{25146.2, 72.7327, 3.57236}, +{25552.9, 72.7219, 3.47541}, +{25966.2, 72.7099, 3.38095}, +{26386.1, 72.6968, 3.28891}, +{26812.9, 72.6828, 3.19925}, +{27246.6, 72.6678, 3.11191}, +{27687.3, 72.6520, 3.02684}, +{28135.1, 72.6354, 2.94399}, +{28590.2, 72.6182, 2.86331}, +{29052.6, 72.6007, 2.78475}, +{29522.5, 72.5898, 2.70825}, +{30000.0, 72.5392, 2.63378}, +{0, 0, 0} +}; + +e_fp_fdp w[] = { /* Z = 74 */ +{10.0000, -9999.00, 1.92561}, +{10.1617, -9999.00, 2.00960}, +{10.3261, -9999.00, 2.09726}, +{10.4931, -9999.00, 2.18440}, +{10.6628, -9999.00, 2.26770}, +{10.8353, -9999.00, 2.35418}, +{11.0106, -9999.00, 2.44395}, +{11.1886, -9999.00, 2.53715}, +{11.3696, -9999.00, 2.63390}, +{11.5535, -9999.00, 2.73433}, +{11.7404, -9999.00, 2.83114}, +{11.9303, -9999.00, 2.91038}, +{12.1232, -9999.00, 2.99182}, +{12.3193, -9999.00, 3.07555}, +{12.5186, -9999.00, 3.16163}, +{12.7210, -9999.00, 3.25011}, +{12.9268, -9999.00, 3.34107}, +{13.1359, -9999.00, 3.43457}, +{13.3483, -9999.00, 3.53069}, +{13.5642, -9999.00, 3.62951}, +{13.7836, -9999.00, 3.73108}, +{14.0066, -9999.00, 3.83550}, +{14.2331, -9999.00, 3.94284}, +{14.4633, -9999.00, 4.05319}, +{14.6973, -9999.00, 4.16662}, +{14.9350, -9999.00, 4.28323}, +{15.1765, -9999.00, 4.40310}, +{15.4220, -9999.00, 4.52632}, +{15.6714, -9999.00, 4.62599}, +{15.9249, -9999.00, 4.72570}, +{16.1825, -9999.00, 4.82756}, +{16.4442, -9999.00, 4.93161}, +{16.7102, -9999.00, 5.03791}, +{16.9805, -9999.00, 5.13492}, +{17.2551, -9999.00, 5.19275}, +{17.5342, -9999.00, 5.25124}, +{17.8178, -9999.00, 5.31039}, +{18.1060, -9999.00, 5.37020}, +{18.3989, -9999.00, 5.43069}, +{18.6964, -9999.00, 5.49185}, +{18.9988, -9999.00, 5.55277}, +{19.3061, -9999.00, 5.58261}, +{19.6184, -9999.00, 5.61262}, +{19.9357, -9999.00, 5.64279}, +{20.2582, -9999.00, 5.67312}, +{20.5858, -9999.00, 5.70361}, +{20.9188, -9999.00, 5.70699}, +{21.2571, -9999.00, 5.66109}, +{21.6009, -9999.00, 5.61556}, +{21.9503, -9999.00, 5.57040}, +{22.3053, -9999.00, 5.52610}, +{22.6661, -9999.00, 5.51486}, +{23.0327, -9999.00, 5.50363}, +{23.4053, -9999.00, 5.49243}, +{23.7838, -9999.00, 5.48126}, +{24.1685, -9999.00, 5.39224}, +{24.5594, -9999.00, 5.26283}, +{24.9566, -9999.00, 5.13652}, +{25.3603, -9999.00, 5.01679}, +{25.7705, -9999.00, 4.93146}, +{26.1873, -9999.00, 4.84757}, +{26.6109, -9999.00, 4.76511}, +{27.0413, -9999.00, 4.68406}, +{27.4786, -9999.00, 4.61341}, +{27.9231, -9999.00, 4.55817}, +{28.3747, -9999.00, 4.50359}, +{28.8337, -9999.00, 4.44966}, +{29.3000, 4.76736, 4.37517}, +{29.7739, 4.70963, 4.27410}, +{30.2555, 4.62152, 4.17536}, +{30.7449, 4.50424, 4.07891}, +{31.2421, 4.35845, 3.99307}, +{31.7475, 4.19553, 3.92790}, +{32.2609, 4.01451, 3.86379}, +{32.7827, 3.79803, 3.81342}, +{33.3130, 3.56442, 3.79440}, +{33.8518, 3.32101, 3.77546}, +{34.3993, 3.02863, 3.75662}, +{34.9557, 2.67905, 3.80998}, +{35.5211, 2.34050, 3.93028}, +{36.0956, 2.02452, 4.05437}, +{36.6794, 1.68082, 4.18238}, +{37.2727, 1.27743, 4.34596}, +{37.8755, 0.856621, 4.59104}, +{38.4882, 0.434937, 4.84995}, +{39.1107, -0.949553E-01, 5.12346}, +{39.7432, -0.696808, 5.69267}, +{40.3861, -1.16494, 6.37829}, +{41.0393, -1.54965, 7.14649}, +{41.7031, -1.85297, 8.00721}, +{42.3776, -2.05779, 8.97159}, +{43.0630, -2.08736, 10.0521}, +{43.7595, -1.84901, 11.0776}, +{44.4673, -1.55224, 11.9242}, +{45.1865, -1.28175, 12.8355}, +{45.9174, -0.896568, 13.7693}, +{46.6600, -0.403206, 14.7236}, +{47.4147, 0.325271, 15.7439}, +{48.1816, 1.32982, 16.4035}, +{48.9609, 2.21172, 16.8280}, +{49.7528, 2.96832, 17.2634}, +{50.5576, 3.74874, 17.7101}, +{51.3753, 4.62257, 18.1601}, +{52.2062, 5.55363, 18.4770}, +{53.0506, 6.47528, 18.7994}, +{53.9087, 7.50881, 19.1275}, +{54.7806, 8.93020, 19.4206}, +{55.6667, 10.3933, 18.8848}, +{56.5670, 11.3591, 18.3639}, +{57.4820, 12.2645, 17.8005}, +{58.4117, 13.0228, 17.0824}, +{59.3564, 13.6007, 16.3933}, +{60.3165, 14.0834, 15.7289}, +{61.2921, 14.4734, 15.0448}, +{62.2834, 14.7503, 14.3905}, +{63.2908, 14.9414, 13.7646}, +{64.3145, 15.0519, 13.2054}, +{65.3547, 15.1342, 12.7038}, +{66.4118, 15.1954, 12.2214}, +{67.4859, 15.2170, 11.7572}, +{68.5775, 15.1576, 11.3107}, +{69.6867, 15.0465, 10.9783}, +{70.8138, 14.9964, 10.7041}, +{71.9591, 14.9571, 10.4368}, +{73.1230, 14.9162, 10.1761}, +{74.3057, 14.8673, 9.92198}, +{75.5076, 14.7943, 9.67419}, +{76.7289, 14.7038, 9.46429}, +{77.9699, 14.6286, 9.26478}, +{79.2310, 14.5430, 9.06949}, +{80.5125, 14.4375, 8.87831}, +{81.8147, 14.2986, 8.69117}, +{83.1380, 14.1395, 8.60239}, +{84.4827, 14.0256, 8.51942}, +{85.8491, 13.9224, 8.43727}, +{87.2377, 13.8213, 8.35590}, +{88.6487, 13.7141, 8.27532}, +{90.0825, 13.5958, 8.19883}, +{91.5395, 13.4726, 8.15100}, +{93.0201, 13.3553, 8.10343}, +{94.5246, 13.2319, 8.05615}, +{96.0535, 13.0940, 8.00914}, +{97.6071, 12.9178, 7.96330}, +{99.1858, 12.7250, 7.99865}, +{100.790, 12.5662, 8.03416}, +{102.420, 12.3901, 8.06982}, +{104.077, 12.1831, 8.16647}, +{105.760, 12.0194, 8.30774}, +{107.471, 11.8864, 8.45144}, +{109.209, 11.7627, 8.59763}, +{110.975, 11.6350, 8.75625}, +{112.770, 11.5230, 8.95557}, +{114.594, 11.4452, 9.15942}, +{116.448, 11.3883, 9.36791}, +{118.331, 11.3541, 9.57067}, +{120.245, 11.3257, 9.76418}, +{122.190, 11.3000, 9.96159}, +{124.166, 11.2815, 10.1630}, +{126.175, 11.2701, 10.3685}, +{128.215, 11.2669, 10.5793}, +{130.289, 11.2727, 10.7944}, +{132.397, 11.2881, 11.0139}, +{134.538, 11.3138, 11.2378}, +{136.714, 11.3520, 11.4663}, +{138.925, 11.4080, 11.6994}, +{141.172, 11.4928, 11.9373}, +{143.456, 11.6078, 12.1077}, +{145.776, 11.6772, 12.2637}, +{148.134, 11.7261, 12.4216}, +{150.530, 11.7506, 12.5815}, +{152.964, 11.7384, 12.7863}, +{155.439, 11.7575, 13.0425}, +{157.953, 11.8090, 13.3037}, +{160.507, 11.8802, 13.5702}, +{163.103, 11.9778, 13.8421}, +{165.742, 12.0957, 14.0876}, +{168.422, 12.2059, 14.3333}, +{171.146, 12.3252, 14.5833}, +{173.915, 12.4657, 14.8377}, +{176.727, 12.6200, 15.0544}, +{179.586, 12.7520, 15.2693}, +{182.491, 12.8796, 15.4874}, +{185.442, 12.9996, 15.7085}, +{188.442, 13.1131, 15.9497}, +{191.489, 13.2453, 16.2015}, +{194.587, 13.3866, 16.4574}, +{197.734, 13.5366, 16.7172}, +{200.932, 13.6963, 16.9812}, +{204.182, 13.8705, 17.2493}, +{207.485, 14.0572, 17.5050}, +{210.840, 14.2404, 17.7612}, +{214.251, 14.4282, 18.0213}, +{217.716, 14.6222, 18.2851}, +{221.237, 14.8234, 18.5528}, +{224.816, 15.0326, 18.8244}, +{228.452, 15.2508, 19.1000}, +{232.147, 15.4788, 19.3796}, +{235.902, 15.7179, 19.6633}, +{239.717, 15.9692, 19.9512}, +{243.595, 16.2344, 20.2433}, +{247.535, 16.5154, 20.5397}, +{251.538, 16.8150, 20.8404}, +{255.607, 17.1371, 21.1455}, +{259.741, 17.4878, 21.4551}, +{263.942, 17.8898, 21.7692}, +{268.211, 18.3714, 22.0879}, +{272.549, 18.8842, 22.1997}, +{276.957, 19.3100, 22.3023}, +{281.437, 19.7042, 22.4054}, +{285.989, 20.0815, 22.5090}, +{290.615, 20.4487, 22.6131}, +{295.315, 20.8100, 22.7176}, +{300.092, 21.1728, 22.8226}, +{304.945, 21.5433, 22.9170}, +{309.878, 21.8986, 22.9934}, +{314.890, 22.2423, 23.0700}, +{319.983, 22.5796, 23.1469}, +{325.158, 22.9125, 23.2241}, +{330.418, 23.2422, 23.3015}, +{335.762, 23.5708, 23.3791}, +{341.192, 23.9016, 23.4498}, +{346.711, 24.2214, 23.5152}, +{352.319, 24.5335, 23.5808}, +{358.017, 24.8379, 23.6465}, +{363.808, 25.1275, 23.7125}, +{369.692, 25.3913, 23.7833}, +{375.672, 25.6611, 23.9214}, +{381.748, 25.9614, 24.0604}, +{387.922, 26.2775, 24.2001}, +{394.197, 26.6058, 24.3406}, +{400.573, 26.9450, 24.4820}, +{407.052, 27.2942, 24.6242}, +{413.635, 27.6505, 24.7672}, +{420.326, 28.0193, 24.9279}, +{427.124, 28.4154, 25.0919}, +{434.032, 28.8381, 25.2570}, +{441.052, 29.2986, 25.4232}, +{448.186, 29.8199, 25.5904}, +{455.435, 30.3876, 25.6527}, +{462.802, 30.9599, 25.6361}, +{470.287, 31.4572, 25.5805}, +{477.894, 31.9205, 25.5241}, +{485.623, 32.3668, 25.4677}, +{493.478, 32.8019, 25.4117}, +{501.459, 33.2318, 25.3568}, +{509.570, 33.6622, 25.3012}, +{517.812, 34.1038, 25.2389}, +{526.187, 34.5469, 25.1542}, +{534.698, 34.9914, 25.0262}, +{543.346, 35.3873, 24.8776}, +{552.134, 35.7561, 24.7316}, +{561.065, 36.0968, 24.5729}, +{570.139, 36.3634, 24.4244}, +{579.361, 36.6288, 24.3871}, +{588.732, 36.9215, 24.3792}, +{598.254, 37.2672, 24.3902}, +{607.930, 37.6490, 24.4012}, +{617.763, 38.0700, 24.4120}, +{627.755, 38.5570, 24.4162}, +{637.908, 39.0892, 24.3402}, +{648.226, 39.6619, 24.1461}, +{658.711, 40.1160, 23.8760}, +{669.365, 40.5020, 23.6088}, +{680.191, 40.8301, 23.3816}, +{691.193, 41.1747, 23.1848}, +{702.372, 41.5367, 22.9935}, +{713.733, 41.9174, 22.7630}, +{725.277, 42.2569, 22.5068}, +{737.008, 42.5736, 22.2536}, +{748.928, 42.8760, 22.0030}, +{761.042, 43.1696, 21.7546}, +{773.351, 43.4571, 21.5038}, +{785.859, 43.7435, 21.2386}, +{798.570, 44.0021, 20.9624}, +{811.486, 44.2425, 20.6895}, +{824.611, 44.4693, 20.4201}, +{837.949, 44.6854, 20.1541}, +{851.502, 44.8915, 19.8876}, +{865.274, 45.0885, 19.6204}, +{879.269, 45.2709, 19.3532}, +{893.491, 45.4418, 19.0895}, +{907.943, 45.6037, 18.8291}, +{922.628, 45.7590, 18.5720}, +{937.551, 45.9051, 18.3094}, +{952.715, 46.0403, 18.0479}, +{968.124, 46.1626, 17.7879}, +{983.783, 46.2750, 17.5316}, +{999.695, 46.3805, 17.2773}, +{1015.86, 46.4801, 17.0251}, +{1032.29, 46.5686, 16.7615}, +{1048.99, 46.6436, 16.4981}, +{1065.96, 46.7003, 16.2346}, +{1083.20, 46.7420, 15.9750}, +{1100.72, 46.7702, 15.7194}, +{1118.52, 46.7853, 15.4677}, +{1136.61, 46.7875, 15.2195}, +{1155.00, 46.7766, 14.9753}, +{1173.68, 46.7528, 14.7350}, +{1192.66, 46.7162, 14.4983}, +{1211.95, 46.6670, 14.2653}, +{1231.55, 46.6066, 14.0359}, +{1251.47, 46.5332, 13.8032}, +{1271.72, 46.4469, 13.5668}, +{1292.29, 46.3323, 13.3251}, +{1313.19, 46.1925, 13.0880}, +{1334.43, 46.0286, 12.8548}, +{1356.01, 45.8390, 12.6253}, +{1377.94, 45.6219, 12.3998}, +{1400.23, 45.3753, 12.1782}, +{1422.88, 45.0960, 11.9604}, +{1445.89, 44.7805, 11.7465}, +{1469.28, 44.4253, 11.5356}, +{1493.04, 44.0231, 11.3271}, +{1517.19, 43.5648, 11.1185}, +{1541.73, 43.0395, 10.9133}, +{1566.67, 42.4349, 10.7118}, +{1592.01, 41.7339, 10.5136}, +{1617.76, 40.9118, 10.3190}, +{1643.92, 39.9337, 10.1279}, +{1670.51, 38.7448, 9.93981}, +{1697.53, 37.2555, 9.75518}, +{1724.99, 35.3035, 9.57416}, +{1752.89, 32.5285, 9.39237}, +{1781.24, 27.8215, 9.21314}, +{1809.10, -5.97034, 9.04302}, +{1809.30, -5.97236, 27.4067}, +{1810.05, 6.47795, 27.3957}, +{1839.32, 25.3867, 26.9718}, +{1869.07, 19.6862, 26.5545}, +{1871.50, 7.05247, 26.5210}, +{1871.70, 7.09116, 39.3058}, +{1899.30, 32.6271, 38.4917}, +{1930.02, 37.8064, 37.6188}, +{1961.24, 41.1866, 36.7657}, +{1992.96, 43.7210, 35.9316}, +{2025.20, 45.7388, 35.1245}, +{2057.95, 47.3887, 34.3268}, +{2091.24, 48.7483, 33.5474}, +{2125.06, 49.8613, 32.7861}, +{2159.43, 50.7406, 32.0413}, +{2194.36, 51.3595, 31.3139}, +{2229.85, 51.5954, 30.6028}, +{2265.92, 50.4472, 29.9073}, +{2280.90, 43.6931, 29.6262}, +{2281.10, 43.7125, 34.5265}, +{2302.57, 52.2358, 34.0187}, +{2339.81, 54.5830, 33.1663}, +{2377.66, 56.0179, 32.3350}, +{2416.11, 57.0906, 31.5253}, +{2455.19, 57.9235, 30.7352}, +{2494.90, 58.5425, 29.9666}, +{2535.26, 58.8681, 29.2162}, +{2574.80, 55.8913, 28.5102}, +{2575.00, 55.9033, 30.4563}, +{2576.26, 57.4730, 30.4338}, +{2617.93, 60.1862, 29.7070}, +{2660.27, 61.1190, 28.9986}, +{2703.30, 61.7965, 28.3088}, +{2747.03, 62.2947, 27.6345}, +{2791.46, 62.5276, 26.9766}, +{2819.50, 60.7185, 26.5747}, +{2819.70, 60.7205, 27.7635}, +{2836.61, 62.8540, 27.5365}, +{2882.49, 63.8348, 26.9362}, +{2929.11, 64.4967, 26.3459}, +{2976.48, 65.0523, 25.7661}, +{3024.63, 65.5432, 25.1969}, +{3073.55, 65.9864, 24.6371}, +{3123.26, 66.3897, 24.0864}, +{3173.78, 66.7594, 23.5467}, +{3225.11, 67.0995, 23.0165}, +{3277.27, 67.4136, 22.4971}, +{3330.28, 67.7037, 21.9869}, +{3384.15, 67.9723, 21.4872}, +{3438.88, 68.2205, 20.9967}, +{3494.50, 68.4508, 20.5170}, +{3551.02, 68.6634, 20.0454}, +{3608.46, 68.8598, 19.5841}, +{3666.82, 69.0413, 19.1323}, +{3726.13, 69.2090, 18.6901}, +{3786.40, 69.3635, 18.2564}, +{3847.64, 69.5054, 17.8322}, +{3909.87, 69.6361, 17.4172}, +{3973.11, 69.7559, 17.0105}, +{4037.38, 69.8651, 16.6123}, +{4102.68, 69.9646, 16.2229}, +{4169.03, 70.0547, 15.8417}, +{4236.46, 70.1362, 15.4689}, +{4304.98, 70.2094, 15.1040}, +{4374.62, 70.2748, 14.7470}, +{4445.37, 70.3326, 14.3978}, +{4517.27, 70.3833, 14.0563}, +{4590.33, 70.4273, 13.7222}, +{4664.58, 70.4649, 13.3956}, +{4740.03, 70.4963, 13.0762}, +{4816.69, 70.5219, 12.7638}, +{4894.60, 70.5418, 12.4582}, +{4973.77, 70.5563, 12.1595}, +{5054.21, 70.5657, 11.8676}, +{5135.96, 70.5703, 11.5823}, +{5219.03, 70.5700, 11.3031}, +{5303.44, 70.5651, 11.0303}, +{5389.22, 70.5558, 10.7638}, +{5476.39, 70.5421, 10.5032}, +{5564.97, 70.5244, 10.2487}, +{5654.98, 70.5026, 9.99963}, +{5746.44, 70.4768, 9.75652}, +{5839.39, 70.4471, 9.51885}, +{5933.83, 70.4136, 9.28670}, +{6029.81, 70.3763, 9.05985}, +{6127.33, 70.3354, 8.83832}, +{6226.44, 70.2908, 8.62177}, +{6327.15, 70.2424, 8.41019}, +{6429.48, 70.1903, 8.20363}, +{6533.48, 70.1344, 8.00161}, +{6639.15, 70.0746, 7.80458}, +{6746.54, 70.0110, 7.61195}, +{6855.65, 69.9433, 7.42381}, +{6966.54, 69.8712, 7.24003}, +{7079.22, 69.7948, 7.06071}, +{7193.72, 69.7140, 6.88554}, +{7310.07, 69.6281, 6.71427}, +{7428.31, 69.5370, 6.54723}, +{7548.45, 69.4403, 6.38389}, +{7670.54, 69.3374, 6.22459}, +{7794.61, 69.2277, 6.06886}, +{7920.68, 69.1107, 5.91705}, +{8048.79, 68.9856, 5.76854}, +{8178.98, 68.8508, 5.62347}, +{8311.26, 68.7055, 5.48197}, +{8445.69, 68.5479, 5.34367}, +{8582.29, 68.3758, 5.20867}, +{8721.11, 68.1867, 5.07700}, +{8862.16, 67.9770, 4.94849}, +{9005.50, 67.7419, 4.82274}, +{9151.16, 67.4743, 4.70000}, +{9299.17, 67.1641, 4.58005}, +{9449.58, 66.7953, 4.46309}, +{9602.42, 66.3410, 4.34892}, +{9757.73, 65.7488, 4.23751}, +{9915.55, 64.8932, 4.12834}, +{10075.9, 63.3691, 4.02661}, +{10206.7, 49.2764, 3.94668}, +{10206.9, 49.2776, 10.1744}, +{10238.9, 60.6612, 10.1167}, +{10404.5, 64.2746, 9.82605}, +{10572.8, 65.4185, 9.54373}, +{10743.8, 66.0305, 9.26953}, +{10917.6, 66.3584, 9.00320}, +{11094.2, 66.4581, 8.74453}, +{11273.6, 66.2772, 8.49329}, +{11455.9, 65.4112, 8.24927}, +{11543.9, 58.5923, 8.13540}, +{11544.1, 58.5936, 11.3916}, +{11641.2, 65.7073, 11.2321}, +{11829.5, 66.8700, 10.9328}, +{12020.8, 67.0581, 10.6414}, +{12099.7, 64.0252, 10.5249}, +{12099.9, 64.0259, 12.0732}, +{12215.3, 67.8337, 11.9003}, +{12412.8, 68.7935, 11.6137}, +{12613.6, 69.4293, 11.3325}, +{12817.6, 69.9296, 11.0568}, +{13025.0, 70.3469, 10.7866}, +{13235.6, 70.7053, 10.5219}, +{13449.7, 71.0187, 10.2626}, +{13667.2, 71.2959, 10.0086}, +{13888.3, 71.5432, 9.75988}, +{14112.9, 71.7652, 9.51645}, +{14341.2, 71.9653, 9.27824}, +{14573.1, 72.1463, 9.04516}, +{14808.9, 72.3104, 8.81717}, +{15048.4, 72.4594, 8.59420}, +{15291.8, 72.5950, 8.37618}, +{15539.1, 72.7183, 8.16305}, +{15790.4, 72.8306, 7.95472}, +{16045.8, 72.9329, 7.75114}, +{16305.4, 73.0259, 7.55222}, +{16569.1, 73.1104, 7.35791}, +{16837.1, 73.1872, 7.16810}, +{17109.4, 73.2568, 6.98274}, +{17386.1, 73.3198, 6.80175}, +{17667.4, 73.3767, 6.62504}, +{17953.1, 73.4279, 6.45255}, +{18243.5, 73.4738, 6.28419}, +{18538.6, 73.5148, 6.11989}, +{18838.4, 73.5512, 5.95956}, +{19143.1, 73.5834, 5.80314}, +{19452.7, 73.6117, 5.65054}, +{19767.4, 73.6363, 5.50169}, +{20087.1, 73.6574, 5.35651}, +{20412.0, 73.6754, 5.21493}, +{20742.1, 73.6903, 5.07687}, +{21077.6, 73.7025, 4.94225}, +{21418.5, 73.7120, 4.81102}, +{21765.0, 73.7191, 4.68308}, +{22117.0, 73.7240, 4.55837}, +{22474.7, 73.7267, 4.43683}, +{22838.2, 73.7274, 4.31836}, +{23207.6, 73.7263, 4.20292}, +{23583.0, 73.7235, 4.09042}, +{23964.4, 73.7190, 3.98082}, +{24352.0, 73.7130, 3.87402}, +{24745.9, 73.7057, 3.76999}, +{25146.2, 73.6970, 3.66863}, +{25552.9, 73.6871, 3.56991}, +{25966.2, 73.6760, 3.47374}, +{26386.1, 73.6639, 3.38008}, +{26812.9, 73.6508, 3.28886}, +{27246.6, 73.6368, 3.20002}, +{27687.3, 73.6219, 3.11351}, +{28135.1, 73.6063, 3.02926}, +{28590.2, 73.5900, 2.94724}, +{29052.6, 73.5735, 2.86736}, +{29522.5, 73.5638, 2.78960}, +{30000.0, 73.5135, 2.71389}, +{0, 0, 0} +}; + +e_fp_fdp re[] = { /* Z = 75 */ +{10.0000, -9999.00, 1.82090}, +{10.1617, -9999.00, 1.91145}, +{10.3261, -9999.00, 2.00650}, +{10.4931, -9999.00, 2.10629}, +{10.6628, -9999.00, 2.21103}, +{10.8353, -9999.00, 2.28753}, +{11.0106, -9999.00, 2.36020}, +{11.1886, -9999.00, 2.43518}, +{11.3696, -9999.00, 2.51255}, +{11.5535, -9999.00, 2.59237}, +{11.7404, -9999.00, 2.67598}, +{11.9303, -9999.00, 2.76272}, +{12.1232, -9999.00, 2.85227}, +{12.3193, -9999.00, 2.94472}, +{12.5186, -9999.00, 3.04017}, +{12.7210, -9999.00, 3.14012}, +{12.9268, -9999.00, 3.24361}, +{13.1359, -9999.00, 3.35052}, +{13.3483, -9999.00, 3.46095}, +{13.5642, -9999.00, 3.57622}, +{13.7836, -9999.00, 3.70512}, +{14.0066, -9999.00, 3.83867}, +{14.2331, -9999.00, 3.97703}, +{14.4633, -9999.00, 4.12039}, +{14.6973, -9999.00, 4.25838}, +{14.9350, -9999.00, 4.38565}, +{15.1765, -9999.00, 4.51673}, +{15.4220, -9999.00, 4.65171}, +{15.6714, -9999.00, 4.79073}, +{15.9249, -9999.00, 4.93463}, +{16.1825, -9999.00, 5.08974}, +{16.4442, -9999.00, 5.24972}, +{16.7102, -9999.00, 5.41472}, +{16.9805, -9999.00, 5.58491}, +{17.2551, -9999.00, 5.76046}, +{17.5342, -9999.00, 5.94151}, +{17.8178, -9999.00, 6.12826}, +{18.1060, -9999.00, 6.29907}, +{18.3989, -9999.00, 6.46564}, +{18.6964, -9999.00, 6.63662}, +{18.9988, -9999.00, 6.81211}, +{19.3061, -9999.00, 6.97707}, +{19.6184, -9999.00, 7.07637}, +{19.9357, -9999.00, 7.17708}, +{20.2582, -9999.00, 7.27922}, +{20.5858, -9999.00, 7.38281}, +{20.9188, -9999.00, 7.48788}, +{21.2571, -9999.00, 7.59445}, +{21.6009, -9999.00, 7.63348}, +{21.9503, -9999.00, 7.66776}, +{22.3053, -9999.00, 7.70219}, +{22.6661, -9999.00, 7.73678}, +{23.0327, -9999.00, 7.77151}, +{23.4053, -9999.00, 7.76601}, +{23.7838, -9999.00, 7.70976}, +{24.1685, -9999.00, 7.65392}, +{24.5594, -9999.00, 7.59849}, +{24.9566, -9999.00, 7.53039}, +{25.3603, -9999.00, 7.28378}, +{25.7705, -9999.00, 7.04524}, +{26.1873, -9999.00, 6.81452}, +{26.6109, -9999.00, 6.56817}, +{27.0413, -9999.00, 6.30065}, +{27.4786, -9999.00, 6.04402}, +{27.9231, -9999.00, 5.79784}, +{28.3747, -9999.00, 5.57090}, +{28.8337, -9999.00, 5.35297}, +{29.3000, 7.45980, 5.14357}, +{29.7739, 7.36294, 4.94237}, +{30.2555, 7.24678, 4.74037}, +{30.7449, 7.08314, 4.53441}, +{31.2421, 6.85861, 4.33739}, +{31.7475, 6.53946, 4.24252}, +{32.2609, 6.29668, 4.22705}, +{32.7827, 6.07314, 4.21164}, +{33.3130, 5.84367, 4.20238}, +{33.8518, 5.61474, 4.20700}, +{34.3993, 5.37524, 4.21161}, +{34.9557, 5.10146, 4.21624}, +{35.5211, 4.80331, 4.28453}, +{36.0956, 4.51157, 4.36092}, +{36.6794, 4.19978, 4.43867}, +{37.2727, 3.83503, 4.51781}, +{37.8755, 3.36519, 4.63632}, +{38.4882, 2.75414, 4.79723}, +{39.1107, 2.13477, 5.41405}, +{39.7432, 1.69354, 6.11019}, +{40.3861, 1.38324, 6.89584}, +{41.0393, 1.22726, 7.78251}, +{41.7031, 1.34224, 8.78319}, +{42.3776, 1.59985, 9.45488}, +{43.0630, 1.85372, 10.1729}, +{43.7595, 2.28214, 10.9454}, +{44.4673, 3.01143, 11.4042}, +{45.1865, 3.50293, 11.6465}, +{45.9174, 3.89620, 11.8940}, +{46.6600, 4.29832, 12.1467}, +{47.4147, 4.74159, 12.2778}, +{48.1816, 5.05566, 12.3389}, +{48.9609, 5.22197, 12.3364}, +{49.7528, 5.26170, 12.5160}, +{50.5576, 5.31147, 12.7507}, +{51.3753, 5.20956, 13.0680}, +{52.2062, 5.31433, 13.8097}, +{53.0506, 5.64480, 14.5261}, +{53.9087, 6.25013, 15.1355}, +{54.7806, 6.83899, 15.6271}, +{55.6667, 7.50407, 16.1347}, +{56.5670, 8.29623, 16.4858}, +{57.4820, 9.41298, 16.7915}, +{58.4117, 10.2776, 16.7223}, +{59.3564, 11.0242, 16.6439}, +{60.3165, 11.7455, 16.5603}, +{61.2921, 12.4985, 16.4772}, +{62.2834, 13.3278, 16.2475}, +{63.2908, 14.0455, 15.9197}, +{64.3145, 14.7858, 15.5411}, +{65.3547, 15.4539, 15.0453}, +{66.4118, 16.0988, 14.3684}, +{67.4859, 16.4551, 13.5908}, +{68.5775, 16.5875, 12.8554}, +{69.6867, 16.6272, 12.3754}, +{70.8138, 16.7019, 11.9348}, +{71.9591, 16.7789, 11.5100}, +{73.1230, 16.8356, 11.1003}, +{74.3057, 16.8700, 10.7051}, +{75.5076, 16.8811, 10.3240}, +{76.7289, 16.8676, 9.95654}, +{77.9699, 16.8241, 9.60382}, +{79.2310, 16.7642, 9.28503}, +{80.5125, 16.6924, 8.97680}, +{81.8147, 16.6041, 8.67882}, +{83.1380, 16.4953, 8.39071}, +{84.4827, 16.3626, 8.11219}, +{85.8491, 16.1946, 7.84291}, +{87.2377, 15.9457, 7.62633}, +{88.6487, 15.7402, 7.48414}, +{90.0825, 15.5550, 7.34460}, +{91.5395, 15.3607, 7.20767}, +{93.0201, 15.1389, 7.07328}, +{94.5246, 14.8493, 6.99964}, +{96.0535, 14.6210, 7.00289}, +{97.6071, 14.4195, 7.00615}, +{99.1858, 14.2247, 7.00940}, +{100.790, 14.0204, 7.01266}, +{102.420, 13.7606, 7.03196}, +{104.077, 13.5319, 7.15594}, +{105.760, 13.3488, 7.28210}, +{107.471, 13.1840, 7.41049}, +{109.209, 13.0257, 7.54114}, +{110.975, 12.8519, 7.69441}, +{112.770, 12.7141, 7.88463}, +{114.594, 12.6012, 8.07956}, +{116.448, 12.5065, 8.27930}, +{118.331, 12.4288, 8.48398}, +{120.245, 12.3724, 8.69373}, +{122.190, 12.3276, 8.89018}, +{124.166, 12.2861, 9.08942}, +{126.175, 12.2514, 9.29313}, +{128.215, 12.2247, 9.50141}, +{130.289, 12.2067, 9.71434}, +{132.397, 12.1982, 9.93206}, +{134.538, 12.2004, 10.1547}, +{136.714, 12.2159, 10.3822}, +{138.925, 12.2541, 10.6054}, +{141.172, 12.2903, 10.8169}, +{143.456, 12.3301, 11.0325}, +{145.776, 12.3779, 11.2525}, +{148.134, 12.4386, 11.4769}, +{150.530, 12.5335, 11.7058}, +{152.964, 12.6324, 11.8759}, +{155.439, 12.7057, 12.0404}, +{157.953, 12.7661, 12.2072}, +{160.507, 12.8162, 12.3763}, +{163.103, 12.8500, 12.5478}, +{165.742, 12.8618, 12.7545}, +{168.422, 12.8971, 12.9888}, +{171.146, 12.9518, 13.2273}, +{173.915, 13.0169, 13.4703}, +{176.727, 13.0923, 13.7177}, +{179.586, 13.1791, 13.9696}, +{182.491, 13.2894, 14.2222}, +{185.442, 13.3994, 14.4535}, +{188.442, 13.5046, 14.6886}, +{191.489, 13.6115, 14.9274}, +{194.587, 13.7213, 15.1702}, +{197.734, 13.8349, 15.4169}, +{200.932, 13.9524, 15.6676}, +{204.182, 14.0739, 15.9224}, +{207.485, 14.1973, 16.1813}, +{210.840, 14.3239, 16.4521}, +{214.251, 14.4627, 16.7324}, +{217.716, 14.6124, 17.0174}, +{221.237, 14.7723, 17.3074}, +{224.816, 14.9433, 17.6022}, +{228.452, 15.1261, 17.9021}, +{232.147, 15.3222, 18.2071}, +{235.902, 15.5338, 18.5173}, +{239.717, 15.7648, 18.8328}, +{243.595, 16.0435, 19.1445}, +{247.535, 16.3183, 19.4092}, +{251.538, 16.5826, 19.6775}, +{255.607, 16.8515, 19.9496}, +{259.741, 17.1292, 20.2255}, +{263.942, 17.4196, 20.5051}, +{268.211, 17.7270, 20.7886}, +{272.549, 18.0584, 21.0761}, +{276.957, 18.4741, 21.3438}, +{281.437, 18.8598, 21.5149}, +{285.989, 19.2050, 21.6874}, +{290.615, 19.5405, 21.8613}, +{295.315, 19.8713, 22.0366}, +{300.092, 20.2016, 22.2133}, +{304.945, 20.5331, 22.3878}, +{309.878, 20.8646, 22.5621}, +{314.890, 21.1978, 22.7378}, +{319.983, 21.5352, 22.9148}, +{325.158, 21.8786, 23.0932}, +{330.418, 22.2308, 23.2730}, +{335.762, 22.5968, 23.4542}, +{341.192, 22.9968, 23.6302}, +{346.711, 23.3874, 23.7522}, +{352.319, 23.7643, 23.8750}, +{358.017, 24.1353, 23.9983}, +{363.808, 24.5065, 24.1223}, +{369.692, 24.8812, 24.2469}, +{375.672, 25.2628, 24.3722}, +{381.748, 25.6680, 24.4981}, +{387.922, 26.0957, 24.5830}, +{394.197, 26.4900, 24.6296}, +{400.573, 26.8605, 24.6763}, +{407.052, 27.2136, 24.7231}, +{413.635, 27.5410, 24.7700}, +{420.326, 27.8423, 24.8657}, +{427.124, 28.1745, 24.9964}, +{434.032, 28.5410, 25.1279}, +{441.052, 28.9352, 25.2600}, +{448.186, 29.3532, 25.3572}, +{455.435, 29.7620, 25.4347}, +{462.802, 30.1624, 25.5126}, +{470.287, 30.5653, 25.5906}, +{477.894, 30.9729, 25.6689}, +{485.623, 31.3875, 25.7475}, +{493.478, 31.8115, 25.8262}, +{501.459, 32.2480, 25.9052}, +{509.570, 32.7016, 25.9845}, +{517.812, 33.1808, 26.0640}, +{526.187, 33.7056, 26.1437}, +{534.698, 34.3880, 26.2237}, +{543.346, 34.9114, 25.9053}, +{552.134, 35.3291, 25.7609}, +{561.065, 35.7132, 25.5951}, +{570.139, 35.9858, 25.4415}, +{579.361, 36.2664, 25.4409}, +{588.732, 36.5881, 25.4819}, +{598.254, 36.9733, 25.5498}, +{607.930, 37.4087, 25.6176}, +{617.763, 37.8968, 25.6857}, +{627.755, 38.4785, 25.7451}, +{637.908, 39.1403, 25.6942}, +{648.226, 39.8137, 25.4805}, +{658.711, 40.3530, 25.1622}, +{669.365, 40.7949, 24.8477}, +{680.191, 41.1718, 24.5812}, +{691.193, 41.5404, 24.3515}, +{702.372, 41.9310, 24.1329}, +{713.733, 42.3223, 23.8872}, +{725.277, 42.6855, 23.6240}, +{737.008, 43.0276, 23.3636}, +{748.928, 43.3557, 23.1059}, +{761.042, 43.6744, 22.8507}, +{773.351, 43.9889, 22.5938}, +{785.859, 44.2960, 22.3246}, +{798.570, 44.5807, 22.0462}, +{811.486, 44.8478, 21.7710}, +{824.611, 45.1015, 21.4993}, +{837.949, 45.3451, 21.2309}, +{851.502, 45.5792, 20.9625}, +{865.274, 45.8035, 20.6942}, +{879.269, 46.0157, 20.4264}, +{893.491, 46.2176, 20.1617}, +{907.943, 46.4114, 19.9003}, +{922.628, 46.6017, 19.6421}, +{937.551, 46.7830, 19.3751}, +{952.715, 46.9532, 19.1085}, +{968.124, 47.1112, 18.8430}, +{983.783, 47.2604, 18.5809}, +{999.695, 47.4039, 18.3197}, +{1015.86, 47.5462, 18.0594}, +{1032.29, 47.6742, 17.7795}, +{1048.99, 47.7849, 17.5004}, +{1065.96, 47.8771, 17.2218}, +{1083.20, 47.9538, 16.9475}, +{1100.72, 48.0169, 16.6773}, +{1118.52, 48.0672, 16.4113}, +{1136.61, 48.1051, 16.1493}, +{1155.00, 48.1309, 15.8912}, +{1173.68, 48.1447, 15.6368}, +{1192.66, 48.1467, 15.3864}, +{1211.95, 48.1376, 15.1398}, +{1231.55, 48.1191, 14.8966}, +{1251.47, 48.0902, 14.6505}, +{1271.72, 48.0481, 14.4009}, +{1292.29, 47.9828, 14.1463}, +{1313.19, 47.8951, 13.8959}, +{1334.43, 47.7866, 13.6500}, +{1356.01, 47.6571, 13.4082}, +{1377.94, 47.5057, 13.1704}, +{1400.23, 47.3311, 12.9364}, +{1422.88, 47.1310, 12.7062}, +{1445.89, 46.9034, 12.4800}, +{1469.28, 46.6460, 12.2575}, +{1493.04, 46.3552, 12.0384}, +{1517.19, 46.0262, 11.8219}, +{1541.73, 45.6534, 11.6088}, +{1566.67, 45.2301, 11.3992}, +{1592.01, 44.7479, 11.1931}, +{1617.76, 44.1959, 10.9908}, +{1643.92, 43.5597, 10.7923}, +{1670.51, 42.8192, 10.5969}, +{1697.53, 41.9453, 10.4048}, +{1724.99, 40.8978, 10.2160}, +{1752.89, 39.6055, 10.0254}, +{1781.24, 37.9487, 9.83648}, +{1810.05, 35.6943, 9.64957}, +{1839.32, 32.2559, 9.46627}, +{1869.07, 24.8946, 9.28645}, +{1882.80, -4.11723, 9.20558}, +{1883.00, -4.11373, 27.5469}, +{1899.30, 24.9187, 27.1608}, +{1930.02, 27.7689, 26.4565}, +{1948.80, 9.56707, 26.0404}, +{1949.00, 9.60336, 38.6032}, +{1961.24, 29.6735, 38.2684}, +{1992.96, 37.1125, 37.4235}, +{2025.20, 41.0748, 36.6057}, +{2057.95, 43.8955, 35.7970}, +{2091.24, 46.0814, 35.0057}, +{2125.06, 47.8452, 34.2322}, +{2159.43, 49.2941, 33.4759}, +{2194.36, 50.4846, 32.7360}, +{2229.85, 51.4402, 32.0125}, +{2265.92, 52.1516, 31.3054}, +{2302.57, 52.5422, 30.6139}, +{2339.81, 52.2342, 29.9379}, +{2367.20, 44.7619, 29.4570}, +{2367.40, 44.7808, 34.3317}, +{2377.66, 51.7677, 34.1010}, +{2416.11, 54.9882, 33.2582}, +{2455.19, 56.6051, 32.4363}, +{2494.90, 57.7790, 31.6363}, +{2535.26, 58.6950, 30.8552}, +{2576.26, 59.4071, 30.0946}, +{2617.93, 59.9011, 29.3531}, +{2660.27, 59.9434, 28.6306}, +{2681.50, 57.4114, 28.2793}, +{2681.70, 57.4246, 30.1472}, +{2703.30, 60.5813, 29.7953}, +{2747.03, 61.7713, 29.1041}, +{2791.46, 62.5421, 28.4292}, +{2836.61, 63.1215, 27.7712}, +{2882.49, 63.5096, 27.1290}, +{2929.11, 62.9627, 26.5027}, +{2931.60, 61.8486, 26.4700}, +{2931.80, 61.8568, 27.6198}, +{2976.48, 64.5461, 27.0504}, +{3024.63, 65.2865, 26.4593}, +{3073.55, 65.8790, 25.8763}, +{3123.26, 66.3935, 25.3044}, +{3173.78, 66.8538, 24.7425}, +{3225.11, 67.2722, 24.1914}, +{3277.27, 67.6541, 23.6489}, +{3330.28, 68.0051, 23.1180}, +{3384.15, 68.3296, 22.5964}, +{3438.88, 68.6285, 22.0841}, +{3494.50, 68.9050, 21.5827}, +{3551.02, 69.1612, 21.0906}, +{3608.46, 69.3980, 20.6082}, +{3666.82, 69.6173, 20.1354}, +{3726.13, 69.8199, 19.6716}, +{3786.40, 70.0072, 19.2179}, +{3847.64, 70.1797, 18.7726}, +{3909.87, 70.3391, 18.3379}, +{3973.11, 70.4860, 17.9106}, +{4037.38, 70.6205, 17.4931}, +{4102.68, 70.7441, 17.0842}, +{4169.03, 70.8571, 16.6839}, +{4236.46, 70.9601, 16.2921}, +{4304.98, 71.0537, 15.9084}, +{4374.62, 71.1382, 15.5331}, +{4445.37, 71.2143, 15.1656}, +{4517.27, 71.2821, 14.8061}, +{4590.33, 71.3423, 14.4545}, +{4664.58, 71.3952, 14.1105}, +{4740.03, 71.4411, 13.7739}, +{4816.69, 71.4804, 13.4449}, +{4894.60, 71.5135, 13.1231}, +{4973.77, 71.5404, 12.8082}, +{5054.21, 71.5615, 12.5005}, +{5135.96, 71.5772, 12.1997}, +{5219.03, 71.5876, 11.9055}, +{5303.44, 71.5928, 11.6179}, +{5389.22, 71.5931, 11.3369}, +{5476.39, 71.5889, 11.0623}, +{5564.97, 71.5800, 10.7938}, +{5654.98, 71.5668, 10.5317}, +{5746.44, 71.5494, 10.2753}, +{5839.39, 71.5278, 10.0249}, +{5933.83, 71.5022, 9.78027}, +{6029.81, 71.4726, 9.54130}, +{6127.33, 71.4392, 9.30781}, +{6226.44, 71.4020, 9.07985}, +{6327.15, 71.3611, 8.85715}, +{6429.48, 71.3164, 8.63970}, +{6533.48, 71.2680, 8.42721}, +{6639.15, 71.2159, 8.21985}, +{6746.54, 71.1601, 8.01723}, +{6855.65, 71.1003, 7.81951}, +{6966.54, 71.0368, 7.62649}, +{7079.22, 70.9692, 7.43771}, +{7193.72, 70.8973, 7.25378}, +{7310.07, 70.8213, 7.07410}, +{7428.31, 70.7407, 6.89862}, +{7548.45, 70.6552, 6.72730}, +{7670.54, 70.5646, 6.56016}, +{7794.61, 70.4685, 6.39686}, +{7920.68, 70.3662, 6.23731}, +{8048.79, 70.2573, 6.08181}, +{8178.98, 70.1411, 5.93007}, +{8311.26, 70.0169, 5.78176}, +{8445.69, 69.8834, 5.63701}, +{8582.29, 69.7394, 5.49584}, +{8721.11, 69.5833, 5.35806}, +{8862.16, 69.4132, 5.22357}, +{9005.50, 69.2262, 5.09239}, +{9151.16, 69.0189, 4.96399}, +{9299.17, 68.7863, 4.83903}, +{9449.58, 68.5217, 4.71695}, +{9602.42, 68.2149, 4.59788}, +{9757.73, 67.8499, 4.48159}, +{9915.55, 67.3984, 4.36798}, +{10075.9, 66.8090, 4.26243}, +{10238.9, 65.9610, 4.15988}, +{10404.5, 64.3927, 4.06024}, +{10535.2, 50.4485, 3.98438}, +{10535.4, 50.4491, 10.1214}, +{10572.8, 62.0723, 10.0561}, +{10743.8, 65.4465, 9.76527}, +{10917.6, 66.5624, 9.48290}, +{11094.2, 67.1677, 9.20870}, +{11273.6, 67.5007, 8.94242}, +{11455.9, 67.6198, 8.68385}, +{11641.2, 67.4915, 8.43276}, +{11829.5, 66.8576, 8.18892}, +{11958.6, 59.8386, 8.02801}, +{11958.8, 59.8398, 11.2380}, +{12020.8, 66.3192, 11.1407}, +{12215.3, 67.8397, 10.8442}, +{12412.8, 68.2098, 10.5556}, +{12526.6, 65.3210, 10.3949}, +{12526.8, 65.3216, 11.8411}, +{12613.6, 68.6737, 11.7233}, +{12817.6, 69.6977, 11.4540}, +{13025.0, 70.3371, 11.1890}, +{13235.6, 70.8356, 10.9283}, +{13449.7, 71.2506, 10.6719}, +{13667.2, 71.6073, 10.4198}, +{13888.3, 71.9197, 10.1722}, +{14112.9, 72.1967, 9.92895}, +{14341.2, 72.4443, 9.69017}, +{14573.1, 72.6673, 9.45581}, +{14808.9, 72.8688, 9.22590}, +{15048.4, 73.0516, 9.00041}, +{15291.8, 73.2178, 8.77935}, +{15539.1, 73.3692, 8.56267}, +{15790.4, 73.5074, 8.35037}, +{16045.8, 73.6335, 8.14240}, +{16305.4, 73.7487, 7.93875}, +{16569.1, 73.8539, 7.73937}, +{16837.1, 73.9499, 7.54422}, +{17109.4, 74.0374, 7.35326}, +{17386.1, 74.1172, 7.16645}, +{17667.4, 74.1899, 6.98372}, +{17953.1, 74.2558, 6.80505}, +{18243.5, 74.3156, 6.63036}, +{18538.6, 74.3696, 6.45962}, +{18838.4, 74.4183, 6.29275}, +{19143.1, 74.4620, 6.12971}, +{19452.7, 74.5011, 5.97044}, +{19767.4, 74.5358, 5.81487}, +{20087.1, 74.5665, 5.66295}, +{20412.0, 74.5934, 5.51461}, +{20742.1, 74.6168, 5.36980}, +{21077.6, 74.6368, 5.22844}, +{21418.5, 74.6538, 5.09049}, +{21765.0, 74.6679, 4.95587}, +{22117.0, 74.6793, 4.82453}, +{22474.7, 74.6881, 4.69641}, +{22838.2, 74.6946, 4.57142}, +{23207.6, 74.6988, 4.44953}, +{23583.0, 74.7010, 4.33067}, +{23964.4, 74.7012, 4.21477}, +{24352.0, 74.6996, 4.10177}, +{24745.9, 74.6963, 3.99161}, +{25146.2, 74.6915, 3.88424}, +{25552.9, 74.6851, 3.77959}, +{25966.2, 74.6773, 3.67761}, +{26386.1, 74.6682, 3.57823}, +{26812.9, 74.6580, 3.48141}, +{27246.6, 74.6465, 3.38707}, +{27687.3, 74.6341, 3.29517}, +{28135.1, 74.6207, 3.20565}, +{28590.2, 74.6065, 3.11845}, +{29052.6, 74.5919, 3.03353}, +{29522.5, 74.5843, 2.95083}, +{30000.0, 74.5337, 2.87030}, +{0, 0, 0} +}; + +e_fp_fdp os[] = { /* Z = 76 */ +{10.0000, -9999.00, 1.88117}, +{10.1617, -9999.00, 1.93789}, +{10.3261, -9999.00, 1.99632}, +{10.4931, -9999.00, 2.05652}, +{10.6628, -9999.00, 2.13032}, +{10.8353, -9999.00, 2.20812}, +{11.0106, -9999.00, 2.28877}, +{11.1886, -9999.00, 2.37237}, +{11.3696, -9999.00, 2.45796}, +{11.5535, -9999.00, 2.53755}, +{11.7404, -9999.00, 2.61972}, +{11.9303, -9999.00, 2.70455}, +{12.1232, -9999.00, 2.79265}, +{12.3193, -9999.00, 2.88764}, +{12.5186, -9999.00, 2.98586}, +{12.7210, -9999.00, 3.08742}, +{12.9268, -9999.00, 3.18938}, +{13.1359, -9999.00, 3.27352}, +{13.3483, -9999.00, 3.35989}, +{13.5642, -9999.00, 3.44854}, +{13.7836, -9999.00, 3.53952}, +{14.0066, -9999.00, 3.63291}, +{14.2331, -9999.00, 3.72876}, +{14.4633, -9999.00, 3.85803}, +{14.6973, -9999.00, 3.99605}, +{14.9350, -9999.00, 4.13902}, +{15.1765, -9999.00, 4.28709}, +{15.4220, -9999.00, 4.44047}, +{15.6714, -9999.00, 4.59933}, +{15.9249, -9999.00, 4.74683}, +{16.1825, -9999.00, 4.88583}, +{16.4442, -9999.00, 5.02890}, +{16.7102, -9999.00, 5.17615}, +{16.9805, -9999.00, 5.32771}, +{17.2551, -9999.00, 5.48372}, +{17.5342, -9999.00, 5.64981}, +{17.8178, -9999.00, 5.82342}, +{18.1060, -9999.00, 6.00238}, +{18.3989, -9999.00, 6.18683}, +{18.6964, -9999.00, 6.37696}, +{18.9988, -9999.00, 6.57292}, +{19.3061, -9999.00, 6.77240}, +{19.6184, -9999.00, 6.93116}, +{19.9357, -9999.00, 7.09364}, +{20.2582, -9999.00, 7.25993}, +{20.5858, -9999.00, 7.43012}, +{20.9188, -9999.00, 7.60429}, +{21.2571, -9999.00, 7.78255}, +{21.6009, -9999.00, 7.90657}, +{21.9503, -9999.00, 8.03206}, +{22.3053, -9999.00, 8.15954}, +{22.6661, -9999.00, 8.28905}, +{23.0327, -9999.00, 8.42062}, +{23.4053, -9999.00, 8.54747}, +{23.7838, -9999.00, 8.61003}, +{24.1685, -9999.00, 8.67305}, +{24.5594, -9999.00, 8.73653}, +{24.9566, -9999.00, 8.80047}, +{25.3603, -9999.00, 8.80932}, +{25.7705, -9999.00, 8.77179}, +{26.1873, -9999.00, 8.73442}, +{26.6109, -9999.00, 8.69721}, +{27.0413, -9999.00, 8.66016}, +{27.4786, -9999.00, 8.61796}, +{27.9231, -9999.00, 8.52126}, +{28.3747, -9999.00, 8.42565}, +{28.8337, -9999.00, 8.33111}, +{29.3000, 8.30011, 8.23764}, +{29.7739, 8.46473, 8.14521}, +{30.2555, 8.63796, 8.05382}, +{30.7449, 8.82533, 7.91400}, +{31.2421, 8.96486, 7.75190}, +{31.7475, 9.07920, 7.59314}, +{32.2609, 9.17666, 7.43762}, +{32.7827, 9.26315, 7.28529}, +{33.3130, 9.34599, 7.13549}, +{33.8518, 9.41616, 6.96557}, +{34.3993, 9.46870, 6.79969}, +{34.9557, 9.51340, 6.63776}, +{35.5211, 9.55919, 6.47969}, +{36.0956, 9.64713, 6.32538}, +{36.6794, 9.83850, 6.01324}, +{37.2727, 9.81542, 5.59144}, +{37.8755, 9.67760, 5.19925}, +{38.4882, 9.47666, 4.80283}, +{39.1107, 9.16386, 4.41435}, +{39.7432, 8.73078, 4.02078}, +{40.3861, 8.05795, 3.81918}, +{41.0393, 7.47199, 3.76150}, +{41.7031, 6.82659, 3.79178}, +{42.3776, 6.22162, 3.90690}, +{43.0630, 5.52323, 4.08295}, +{43.7595, 4.86151, 4.46673}, +{44.4673, 4.20301, 4.95063}, +{45.1865, 3.63012, 5.55802}, +{45.9174, 3.08782, 6.23996}, +{46.6600, 2.60760, 7.11975}, +{47.4147, 2.25412, 8.12406}, +{48.1816, 2.06738, 9.25093}, +{48.9609, 2.05441, 10.4803}, +{49.7528, 2.36027, 11.8200}, +{50.5576, 2.90469, 13.0355}, +{51.3753, 3.89401, 14.3258}, +{52.2062, 4.99879, 14.8253}, +{53.0506, 6.00564, 15.3422}, +{53.9087, 6.96794, 15.6000}, +{54.7806, 7.87184, 15.8485}, +{55.6667, 8.75760, 15.9634}, +{56.5670, 9.60952, 16.0575}, +{57.4820, 10.5680, 16.0828}, +{58.4117, 11.4106, 15.8633}, +{59.3564, 12.1479, 15.6467}, +{60.3165, 12.9033, 15.3642}, +{61.2921, 13.5281, 14.9819}, +{62.2834, 14.0943, 14.6090}, +{63.2908, 14.6607, 14.1379}, +{64.3145, 15.0549, 13.6021}, +{65.3547, 15.3173, 13.0867}, +{66.4118, 15.4420, 12.6485}, +{67.4859, 15.5892, 12.3170}, +{68.5775, 15.7324, 11.9942}, +{69.6867, 15.8512, 11.6799}, +{70.8138, 15.9181, 11.4066}, +{71.9591, 16.0131, 11.1827}, +{73.1230, 16.1162, 10.9631}, +{74.3057, 16.2191, 10.7479}, +{75.5076, 16.3199, 10.5370}, +{76.7289, 16.4188, 10.3301}, +{77.9699, 16.5184, 10.1273}, +{79.2310, 16.6260, 9.92852}, +{80.5125, 16.7724, 9.71818}, +{81.8147, 16.8780, 9.40813}, +{83.1380, 16.9272, 9.10796}, +{84.4827, 16.9373, 8.81738}, +{85.8491, 16.9185, 8.53606}, +{87.2377, 16.8731, 8.26371}, +{88.6487, 16.8014, 8.00007}, +{90.0825, 16.7015, 7.74481}, +{91.5395, 16.5651, 7.49773}, +{93.0201, 16.3560, 7.25851}, +{94.5246, 16.1386, 7.15794}, +{96.0535, 15.9682, 7.07017}, +{97.6071, 15.8106, 6.98347}, +{99.1858, 15.6520, 6.89783}, +{100.790, 15.4792, 6.81324}, +{102.420, 15.2626, 6.76245}, +{104.077, 15.0766, 6.75365}, +{105.760, 14.9056, 6.74487}, +{107.471, 14.7268, 6.73610}, +{109.209, 14.5069, 6.74813}, +{110.975, 14.3123, 6.81111}, +{112.770, 14.1356, 6.87469}, +{114.594, 13.9525, 6.93885}, +{116.448, 13.7175, 7.03657}, +{118.331, 13.5297, 7.19876}, +{120.245, 13.3782, 7.36469}, +{122.190, 13.2424, 7.53445}, +{124.166, 13.1186, 7.70811}, +{126.175, 13.0038, 7.88579}, +{128.215, 12.8957, 8.06755}, +{130.289, 12.7909, 8.25351}, +{132.397, 12.6765, 8.44814}, +{134.538, 12.5765, 8.67514}, +{136.714, 12.4952, 8.90823}, +{138.925, 12.4261, 9.14759}, +{141.172, 12.3679, 9.39337}, +{143.456, 12.3202, 9.64577}, +{145.776, 12.2829, 9.90494}, +{148.134, 12.2565, 10.1711}, +{150.530, 12.2430, 10.4429}, +{152.964, 12.2391, 10.7194}, +{155.439, 12.2460, 11.0033}, +{157.953, 12.2663, 11.2948}, +{160.507, 12.3030, 11.5939}, +{163.103, 12.3660, 11.9010}, +{165.742, 12.4462, 12.1821}, +{168.422, 12.5275, 12.4636}, +{171.146, 12.6160, 12.7517}, +{173.915, 12.7232, 13.0464}, +{176.727, 12.8916, 13.3202}, +{179.586, 13.0304, 13.5421}, +{182.491, 13.1451, 13.7676}, +{185.442, 13.2550, 13.9969}, +{188.442, 13.3624, 14.2300}, +{191.489, 13.4688, 14.4669}, +{194.587, 13.5748, 14.7079}, +{197.734, 13.6804, 14.9528}, +{200.932, 13.7788, 15.2018}, +{204.182, 13.8823, 15.4751}, +{207.485, 13.9983, 15.7545}, +{210.840, 14.1236, 16.0389}, +{214.251, 14.2570, 16.3284}, +{217.716, 14.3986, 16.6232}, +{221.237, 14.5407, 16.9233}, +{224.816, 14.7054, 17.2553}, +{228.452, 14.9089, 17.5676}, +{232.147, 15.1102, 17.8649}, +{235.902, 15.3106, 18.1672}, +{239.717, 15.5196, 18.4746}, +{243.595, 15.7390, 18.7872}, +{247.535, 15.9710, 19.1051}, +{251.538, 16.2179, 19.4284}, +{255.607, 16.4834, 19.7572}, +{259.741, 16.7801, 20.0915}, +{263.942, 17.0982, 20.4037}, +{268.211, 17.4288, 20.7152}, +{272.549, 17.7918, 21.0315}, +{276.957, 18.2271, 21.3000}, +{281.437, 18.6435, 21.5050}, +{285.989, 19.0271, 21.6704}, +{290.615, 19.3876, 21.8307}, +{295.315, 19.7315, 21.9916}, +{300.092, 20.0676, 22.1539}, +{304.945, 20.3990, 22.3176}, +{309.878, 20.7284, 22.4830}, +{314.890, 21.0571, 22.6491}, +{319.983, 21.3858, 22.8164}, +{325.158, 21.7164, 22.9854}, +{330.418, 22.0494, 23.1549}, +{335.762, 22.3852, 23.3258}, +{341.192, 22.7253, 23.4983}, +{346.711, 23.0711, 23.6723}, +{352.319, 23.4238, 23.8475}, +{358.017, 23.7841, 24.0236}, +{363.808, 24.1542, 24.2013}, +{369.692, 24.5368, 24.3804}, +{375.672, 24.9355, 24.5606}, +{381.748, 25.3583, 24.7422}, +{387.922, 25.8224, 24.9123}, +{394.197, 26.3422, 25.0548}, +{400.573, 26.8700, 25.0755}, +{407.052, 27.3217, 25.0477}, +{413.635, 27.7278, 25.0203}, +{420.326, 28.1038, 24.9933}, +{427.124, 28.4540, 24.9664}, +{434.032, 28.7764, 24.9384}, +{441.052, 29.0680, 24.9111}, +{448.186, 29.2623, 24.9046}, +{455.435, 29.4579, 25.0013}, +{462.802, 29.6805, 25.1714}, +{470.287, 29.9620, 25.3824}, +{477.894, 30.3002, 25.5955}, +{485.623, 30.6740, 25.8094}, +{493.478, 31.0818, 26.0249}, +{501.459, 31.5292, 26.2435}, +{509.570, 32.0271, 26.4632}, +{517.812, 32.6164, 26.6627}, +{526.187, 33.2724, 26.7855}, +{534.698, 33.9416, 26.7616}, +{543.346, 34.5211, 26.6647}, +{552.134, 35.0551, 26.5680}, +{561.065, 35.5655, 26.4551}, +{570.139, 36.0567, 26.3319}, +{579.361, 36.5170, 26.1883}, +{588.732, 36.9502, 26.0406}, +{598.254, 37.3561, 25.8907}, +{607.930, 37.7365, 25.7416}, +{617.763, 38.0871, 25.5935}, +{627.755, 38.3808, 25.4527}, +{637.908, 38.6309, 25.3914}, +{648.226, 38.8914, 25.4475}, +{658.711, 39.2793, 25.5818}, +{669.365, 39.8099, 25.7167}, +{680.191, 40.4717, 25.6782}, +{691.193, 41.0949, 25.5018}, +{702.372, 41.6194, 25.2659}, +{713.733, 42.0997, 25.0169}, +{725.277, 42.5374, 24.7597}, +{737.008, 42.9464, 24.5053}, +{748.928, 43.3352, 24.2534}, +{761.042, 43.7102, 24.0036}, +{773.351, 44.0779, 23.7521}, +{785.859, 44.4360, 23.4881}, +{798.570, 44.7705, 23.2146}, +{811.486, 45.0867, 22.9443}, +{824.611, 45.3897, 22.6769}, +{837.949, 45.6840, 22.4124}, +{851.502, 45.9705, 22.1443}, +{865.274, 46.2476, 21.8718}, +{879.269, 46.5087, 21.5959}, +{893.491, 46.7574, 21.3232}, +{907.943, 46.9980, 21.0538}, +{922.628, 47.2384, 20.7875}, +{937.551, 47.4686, 20.5020}, +{952.715, 47.6838, 20.2146}, +{968.124, 47.8814, 19.9261}, +{983.783, 48.0660, 19.6414}, +{999.695, 48.2416, 19.3586}, +{1015.86, 48.4119, 19.0776}, +{1032.29, 48.5690, 18.7836}, +{1048.99, 48.7106, 18.4894}, +{1065.96, 48.8334, 18.1949}, +{1083.20, 48.9403, 17.9048}, +{1100.72, 49.0335, 17.6191}, +{1118.52, 49.1139, 17.3378}, +{1136.61, 49.1818, 17.0603}, +{1155.00, 49.2376, 16.7870}, +{1173.68, 49.2815, 16.5179}, +{1192.66, 49.3138, 16.2529}, +{1211.95, 49.3351, 15.9918}, +{1231.55, 49.3459, 15.7343}, +{1251.47, 49.3460, 15.4774}, +{1271.72, 49.3340, 15.2204}, +{1292.29, 49.3043, 14.9624}, +{1313.19, 49.2572, 14.7084}, +{1334.43, 49.1935, 14.4584}, +{1356.01, 49.1130, 14.2123}, +{1377.94, 49.0148, 13.9700}, +{1400.23, 48.8981, 13.7317}, +{1422.88, 48.7623, 13.4974}, +{1445.89, 48.6059, 13.2663}, +{1469.28, 48.4273, 13.0384}, +{1493.04, 48.2251, 12.8136}, +{1517.19, 47.9942, 12.5879}, +{1541.73, 47.7305, 12.3656}, +{1566.67, 47.4309, 12.1471}, +{1592.01, 47.0914, 11.9319}, +{1617.76, 46.7060, 11.7204}, +{1643.92, 46.2680, 11.5126}, +{1670.51, 45.7678, 11.3081}, +{1697.53, 45.1931, 11.1069}, +{1724.99, 44.5300, 10.9091}, +{1752.89, 43.7514, 10.7088}, +{1781.24, 42.8208, 10.5100}, +{1810.05, 41.6859, 10.3130}, +{1839.32, 40.2606, 10.1196}, +{1869.07, 38.3881, 9.92978}, +{1899.30, 35.7236, 9.74376}, +{1930.02, 31.1911, 9.56069}, +{1960.00, -1.98025, 9.38809}, +{1960.20, -1.98254, 27.2515}, +{1961.24, 11.8393, 27.2332}, +{1992.96, 29.2638, 26.6867}, +{2025.20, 26.2824, 26.1511}, +{2030.70, 11.3960, 26.0616}, +{2030.90, 11.4284, 38.2496}, +{2057.95, 35.3998, 37.5516}, +{2091.24, 40.5370, 36.7223}, +{2125.06, 43.8181, 35.9116}, +{2159.43, 46.2639, 35.1185}, +{2194.36, 48.1990, 34.3429}, +{2229.85, 49.7737, 33.5850}, +{2265.92, 51.0658, 32.8439}, +{2302.57, 52.1137, 32.1200}, +{2339.81, 52.9230, 31.4120}, +{2377.66, 53.4462, 30.7196}, +{2416.11, 53.4741, 30.0439}, +{2455.19, 49.8736, 29.3835}, +{2457.10, 45.4669, 29.3519}, +{2457.30, 45.4811, 34.0900}, +{2494.90, 55.2587, 33.3130}, +{2535.26, 57.1055, 32.5112}, +{2576.26, 58.3803, 31.7290}, +{2617.93, 59.3702, 30.9661}, +{2660.27, 60.1587, 30.2234}, +{2703.30, 60.7601, 29.4980}, +{2747.03, 61.1059, 28.7916}, +{2791.46, 59.4194, 28.1032}, +{2792.10, 58.3216, 28.0934}, +{2792.30, 58.3305, 29.8666}, +{2836.61, 62.3282, 29.1908}, +{2882.49, 63.2281, 28.5177}, +{2929.11, 63.8798, 27.8603}, +{2976.48, 64.3562, 27.2200}, +{3024.63, 64.5395, 26.5947}, +{3048.40, 62.7987, 26.2948}, +{3048.60, 62.8009, 27.4437}, +{3073.55, 65.0879, 27.1357}, +{3123.26, 65.9748, 26.5392}, +{3173.78, 66.6126, 25.9541}, +{3225.11, 67.1525, 25.3787}, +{3277.27, 67.6292, 24.8139}, +{3330.28, 68.0594, 24.2603}, +{3384.15, 68.4519, 23.7169}, +{3438.88, 68.8114, 23.1832}, +{3494.50, 69.1422, 22.6601}, +{3551.02, 69.4469, 22.1465}, +{3608.46, 69.7283, 21.6442}, +{3666.82, 69.9891, 21.1514}, +{3726.13, 70.2302, 20.6681}, +{3786.40, 70.4535, 20.1946}, +{3847.64, 70.6594, 19.7302}, +{3909.87, 70.8496, 19.2760}, +{3973.11, 71.0260, 18.8312}, +{4037.38, 71.1891, 18.3950}, +{4102.68, 71.3384, 17.9671}, +{4169.03, 71.4754, 17.5490}, +{4236.46, 71.6016, 17.1396}, +{4304.98, 71.7170, 16.7386}, +{4374.62, 71.8221, 16.3462}, +{4445.37, 71.9177, 15.9619}, +{4517.27, 72.0041, 15.5860}, +{4590.33, 72.0820, 15.2181}, +{4664.58, 72.1516, 14.8581}, +{4740.03, 72.2135, 14.5059}, +{4816.69, 72.2680, 14.1613}, +{4894.60, 72.3154, 13.8242}, +{4973.77, 72.3561, 13.4946}, +{5054.21, 72.3904, 13.1722}, +{5135.96, 72.4186, 12.8569}, +{5219.03, 72.4410, 12.5487}, +{5303.44, 72.4578, 12.2473}, +{5389.22, 72.4693, 11.9526}, +{5476.39, 72.4755, 11.6646}, +{5564.97, 72.4770, 11.3831}, +{5654.98, 72.4737, 11.1078}, +{5746.44, 72.4657, 10.8389}, +{5839.39, 72.4532, 10.5760}, +{5933.83, 72.4365, 10.3192}, +{6029.81, 72.4157, 10.0684}, +{6127.33, 72.3908, 9.82320}, +{6226.44, 72.3619, 9.58373}, +{6327.15, 72.3292, 9.34973}, +{6429.48, 72.2926, 9.12121}, +{6533.48, 72.2523, 8.89782}, +{6639.15, 72.2081, 8.67966}, +{6746.54, 72.1601, 8.46669}, +{6855.65, 72.1084, 8.25845}, +{6966.54, 72.0527, 8.05531}, +{7079.22, 71.9933, 7.85688}, +{7193.72, 71.9300, 7.66294}, +{7310.07, 71.8623, 7.47358}, +{7428.31, 71.7905, 7.28887}, +{7548.45, 71.7143, 7.10827}, +{7670.54, 71.6335, 6.93217}, +{7794.61, 71.5477, 6.76002}, +{7920.68, 71.4567, 6.59216}, +{8048.79, 71.3601, 6.42788}, +{8178.98, 71.2571, 6.26762}, +{8311.26, 71.1475, 6.11119}, +{8445.69, 71.0303, 5.95852}, +{8582.29, 70.9049, 5.80942}, +{8721.11, 70.7702, 5.66397}, +{8862.16, 70.6248, 5.52170}, +{9005.50, 70.4669, 5.38297}, +{9151.16, 70.2946, 5.24744}, +{9299.17, 70.1052, 5.11523}, +{9449.58, 69.8950, 4.98608}, +{9602.42, 69.6592, 4.86006}, +{9757.73, 69.3909, 4.73670}, +{9915.55, 69.0803, 4.61647}, +{10075.9, 68.7099, 4.49461}, +{10238.9, 68.2477, 4.37581}, +{10404.5, 67.6403, 4.25999}, +{10572.8, 66.7528, 4.14707}, +{10743.8, 65.0731, 4.03701}, +{10870.8, 50.7973, 3.95824}, +{10871.0, 50.7979, 10.2630}, +{10917.6, 63.1798, 10.1836}, +{11094.2, 66.3357, 9.89108}, +{11273.6, 67.4493, 9.60696}, +{11455.9, 68.0632, 9.33101}, +{11641.2, 68.4090, 9.06299}, +{11829.5, 68.5474, 8.80266}, +{12020.8, 68.4566, 8.54982}, +{12215.3, 67.9632, 8.30424}, +{12384.9, 60.6457, 8.09878}, +{12385.1, 60.6470, 11.3583}, +{12412.8, 66.3113, 11.3152}, +{12613.6, 68.5697, 11.0114}, +{12817.6, 69.0675, 10.7157}, +{12967.9, 65.8850, 10.5059}, +{12968.1, 65.8856, 12.0780}, +{13025.0, 69.2207, 11.9986}, +{13235.6, 70.4931, 11.7120}, +{13449.7, 71.1982, 11.4307}, +{13667.2, 71.7342, 11.1548}, +{13888.3, 72.1746, 10.8842}, +{14112.9, 72.5498, 10.6189}, +{14341.2, 72.8763, 10.3589}, +{14573.1, 73.1641, 10.1041}, +{14808.9, 73.4204, 9.85458}, +{15048.4, 73.6500, 9.61021}, +{15291.8, 73.8568, 9.37098}, +{15539.1, 74.0438, 9.13682}, +{15790.4, 74.2132, 8.90768}, +{16045.8, 74.3671, 8.68351}, +{16305.4, 74.5071, 8.46424}, +{16569.1, 74.6345, 8.24981}, +{16837.1, 74.7505, 8.04015}, +{17109.4, 74.8562, 7.83521}, +{17386.1, 74.9524, 7.63491}, +{17667.4, 75.0399, 7.43917}, +{17953.1, 75.1195, 7.24794}, +{18243.5, 75.1917, 7.06114}, +{18538.6, 75.2571, 6.87869}, +{18838.4, 75.3163, 6.70052}, +{19143.1, 75.3696, 6.52656}, +{19452.7, 75.4174, 6.35673}, +{19767.4, 75.4603, 6.19095}, +{20087.1, 75.4985, 6.02916}, +{20412.0, 75.5324, 5.87127}, +{20742.1, 75.5622, 5.71723}, +{21077.6, 75.5882, 5.56693}, +{21418.5, 75.6107, 5.42032}, +{21765.0, 75.6299, 5.27731}, +{22117.0, 75.6460, 5.13785}, +{22474.7, 75.6593, 5.00185}, +{22838.2, 75.6699, 4.86923}, +{23207.6, 75.6780, 4.73994}, +{23583.0, 75.6837, 4.61389}, +{23964.4, 75.6873, 4.49102}, +{24352.0, 75.6888, 4.37126}, +{24745.9, 75.6884, 4.25454}, +{25146.2, 75.6863, 4.14079}, +{25552.9, 75.6825, 4.02994}, +{25966.2, 75.6771, 3.92194}, +{26386.1, 75.6703, 3.81671}, +{26812.9, 75.6621, 3.71419}, +{27246.6, 75.6527, 3.61431}, +{27687.3, 75.6421, 3.51703}, +{28135.1, 75.6305, 3.42226}, +{28590.2, 75.6179, 3.32997}, +{29052.6, 75.6050, 3.24008}, +{29522.5, 75.5995, 3.15253}, +{30000.0, 75.5481, 3.06728}, +{0, 0, 0} +}; + +e_fp_fdp ir[] = { /* Z = 77 */ +{10.0000, -9999.00, 2.22753}, +{10.1617, -9999.00, 2.30683}, +{10.3261, -9999.00, 2.38895}, +{10.4931, -9999.00, 2.47400}, +{10.6628, -9999.00, 2.56207}, +{10.8353, -9999.00, 2.65417}, +{11.0106, -9999.00, 2.75003}, +{11.1886, -9999.00, 2.84935}, +{11.3696, -9999.00, 2.94781}, +{11.5535, -9999.00, 3.01180}, +{11.7404, -9999.00, 3.07717}, +{11.9303, -9999.00, 3.14397}, +{12.1232, -9999.00, 3.21221}, +{12.3193, -9999.00, 3.26205}, +{12.5186, -9999.00, 3.30439}, +{12.7210, -9999.00, 3.34729}, +{12.9268, -9999.00, 3.39074}, +{13.1359, -9999.00, 3.43476}, +{13.3483, -9999.00, 3.47696}, +{13.5642, -9999.00, 3.51962}, +{13.7836, -9999.00, 3.56281}, +{14.0066, -9999.00, 3.61496}, +{14.2331, -9999.00, 3.70069}, +{14.4633, -9999.00, 3.78846}, +{14.6973, -9999.00, 3.87831}, +{14.9350, -9999.00, 3.97029}, +{15.1765, -9999.00, 4.07172}, +{15.4220, -9999.00, 4.19560}, +{15.6714, -9999.00, 4.32325}, +{15.9249, -9999.00, 4.45478}, +{16.1825, -9999.00, 4.60711}, +{16.4442, -9999.00, 4.77331}, +{16.7102, -9999.00, 4.94550}, +{16.9805, -9999.00, 5.12391}, +{17.2551, -9999.00, 5.30875}, +{17.5342, -9999.00, 5.50602}, +{17.8178, -9999.00, 5.74269}, +{18.1060, -9999.00, 5.98954}, +{18.3989, -9999.00, 6.24699}, +{18.6964, -9999.00, 6.51552}, +{18.9988, -9999.00, 6.74800}, +{19.3061, -9999.00, 6.97561}, +{19.6184, -9999.00, 7.21091}, +{19.9357, -9999.00, 7.45414}, +{20.2582, -9999.00, 7.68496}, +{20.5858, -9999.00, 7.89057}, +{20.9188, -9999.00, 8.10168}, +{21.2571, -9999.00, 8.31844}, +{21.6009, -9999.00, 8.52534}, +{21.9503, -9999.00, 8.68506}, +{22.3053, -9999.00, 8.84777}, +{22.6661, -9999.00, 9.01353}, +{23.0327, -9999.00, 9.18240}, +{23.4053, -9999.00, 9.26201}, +{23.7838, -9999.00, 9.32872}, +{24.1685, -9999.00, 9.39591}, +{24.5594, -9999.00, 9.46360}, +{24.9566, -9999.00, 9.52948}, +{25.3603, -9999.00, 9.59091}, +{25.7705, -9999.00, 9.65272}, +{26.1873, -9999.00, 9.71494}, +{26.6109, -9999.00, 9.77755}, +{27.0413, -9999.00, 9.79801}, +{27.4786, -9999.00, 9.75976}, +{27.9231, -9999.00, 9.72165}, +{28.3747, -9999.00, 9.68369}, +{28.8337, -9999.00, 9.64587}, +{29.3000, 6.72334, 9.60821}, +{29.7739, 6.99072, 9.55265}, +{30.2555, 7.24352, 9.41385}, +{30.7449, 7.45180, 9.27707}, +{31.2421, 7.64444, 9.14228}, +{31.7475, 7.84077, 9.00945}, +{32.2609, 8.06846, 8.83057}, +{32.7827, 8.23692, 8.54247}, +{33.3130, 8.30087, 8.26376}, +{33.8518, 8.29295, 7.99415}, +{34.3993, 8.20921, 7.81682}, +{34.9557, 8.16140, 7.67421}, +{35.5211, 8.10373, 7.53419}, +{36.0956, 8.01446, 7.39673}, +{36.6794, 7.87488, 7.32637}, +{37.2727, 7.77655, 7.30348}, +{37.8755, 7.69669, 7.28067}, +{38.4882, 7.61697, 7.25791}, +{39.1107, 7.52223, 7.23524}, +{39.7432, 7.40242, 7.22018}, +{40.3861, 7.28098, 7.27384}, +{41.0393, 7.18442, 7.32791}, +{41.7031, 7.09193, 7.38238}, +{42.3776, 6.99550, 7.43725}, +{43.0630, 6.88132, 7.49253}, +{43.7595, 6.74127, 7.57126}, +{44.4673, 6.60653, 7.66543}, +{45.1865, 6.45295, 7.76077}, +{45.9174, 6.25263, 7.85729}, +{46.6600, 5.97893, 7.98694}, +{47.4147, 5.48975, 8.13775}, +{48.1816, 4.66401, 8.82385}, +{48.9609, 4.55534, 10.0722}, +{49.7528, 5.15089, 11.5471}, +{50.5576, 6.13179, 11.6384}, +{51.3753, 6.66397, 11.7304}, +{52.2062, 7.05904, 11.8232}, +{53.0506, 7.38759, 11.9167}, +{53.9087, 7.67541, 12.0109}, +{54.7806, 7.93458, 12.1059}, +{55.6667, 8.17061, 12.2016}, +{56.5670, 8.38449, 12.2980}, +{57.4820, 8.57160, 12.3953}, +{58.4117, 8.71295, 12.4933}, +{59.3564, 8.75019, 12.6564}, +{60.3165, 8.84789, 13.0205}, +{61.2921, 9.03126, 13.3950}, +{62.2834, 9.23405, 13.8208}, +{63.2908, 9.58538, 14.4146}, +{64.3145, 10.1685, 15.0340}, +{65.3547, 11.0860, 15.4537}, +{66.4118, 11.9541, 15.6977}, +{67.4859, 13.0309, 15.8904}, +{68.5775, 14.0673, 15.5224}, +{69.6867, 14.9278, 15.1628}, +{70.8138, 15.8426, 14.6264}, +{71.9591, 16.4360, 13.8968}, +{73.1230, 16.8343, 13.2036}, +{74.3057, 17.1096, 12.5450}, +{75.5076, 17.2948, 11.9467}, +{76.7289, 17.4220, 11.3800}, +{77.9699, 17.4918, 10.8402}, +{79.2310, 17.5039, 10.3259}, +{80.5125, 17.4509, 9.83611}, +{81.8147, 17.2939, 9.38831}, +{83.1380, 17.1432, 9.13335}, +{84.4827, 17.0462, 8.88532}, +{85.8491, 16.9673, 8.64404}, +{87.2377, 16.8886, 8.40929}, +{88.6487, 16.8042, 8.18092}, +{90.0825, 16.7060, 7.95875}, +{91.5395, 16.5772, 7.74263}, +{93.0201, 16.4456, 7.59762}, +{94.5246, 16.3386, 7.45957}, +{96.0535, 16.2389, 7.32402}, +{97.6071, 16.1407, 7.19093}, +{99.1858, 16.0410, 7.06026}, +{100.790, 15.9382, 6.93197}, +{102.420, 15.8332, 6.80446}, +{104.077, 15.7165, 6.66951}, +{105.760, 15.5842, 6.53724}, +{107.471, 15.4346, 6.40758}, +{109.209, 15.2603, 6.28051}, +{110.975, 15.0366, 6.18486}, +{112.770, 14.8316, 6.12755}, +{114.594, 14.6295, 6.07076}, +{116.448, 14.4061, 6.01451}, +{118.331, 14.1093, 5.99740}, +{120.245, 13.8573, 6.05809}, +{122.190, 13.6358, 6.11939}, +{124.166, 13.4142, 6.18130}, +{126.175, 13.1651, 6.24385}, +{128.215, 12.9041, 6.37948}, +{130.289, 12.6851, 6.54412}, +{132.397, 12.4878, 6.71301}, +{134.538, 12.3018, 6.88626}, +{136.714, 12.1216, 7.06398}, +{138.925, 11.9399, 7.24629}, +{141.172, 11.7345, 7.45043}, +{143.456, 11.5582, 7.70210}, +{145.776, 11.4050, 7.96227}, +{148.134, 11.2679, 8.23123}, +{150.530, 11.1449, 8.50927}, +{152.964, 11.0376, 8.79571}, +{155.439, 10.9412, 9.08733}, +{157.953, 10.8554, 9.38862}, +{160.507, 10.7827, 9.69990}, +{163.103, 10.7248, 10.0215}, +{165.742, 10.6856, 10.3538}, +{168.422, 10.6978, 10.6887}, +{171.146, 10.7035, 10.9707}, +{173.915, 10.6900, 11.2602}, +{176.727, 10.6726, 11.5573}, +{179.586, 10.6520, 11.8622}, +{182.491, 10.6221, 12.1752}, +{185.442, 10.5812, 12.5300}, +{188.442, 10.5699, 12.9193}, +{191.489, 10.5947, 13.3208}, +{194.587, 10.6559, 13.7199}, +{197.734, 10.7189, 14.1025}, +{200.932, 10.7874, 14.4957}, +{204.182, 10.8674, 14.8999}, +{207.485, 10.9628, 15.3154}, +{210.840, 11.0766, 15.7425}, +{214.251, 11.2129, 16.1815}, +{217.716, 11.3904, 16.6328}, +{221.237, 11.6075, 17.0582}, +{224.816, 11.8192, 17.4581}, +{228.452, 12.0354, 17.8674}, +{232.147, 12.2671, 18.2863}, +{235.902, 12.5226, 18.7150}, +{239.717, 12.8111, 19.1538}, +{243.595, 13.1472, 19.6029}, +{247.535, 13.6293, 19.9962}, +{251.538, 14.0632, 20.2299}, +{255.607, 14.4124, 20.4664}, +{259.741, 14.7453, 20.7057}, +{263.942, 15.0683, 20.9477}, +{268.211, 15.3871, 21.1925}, +{272.549, 15.7120, 21.4371}, +{276.957, 16.0338, 21.6732}, +{281.437, 16.3522, 21.9118}, +{285.989, 16.6780, 22.1530}, +{290.615, 17.0212, 22.3776}, +{295.315, 17.3511, 22.5766}, +{300.092, 17.6603, 22.7774}, +{304.945, 17.9606, 22.9800}, +{309.878, 18.2496, 23.1844}, +{314.890, 18.5087, 23.3906}, +{319.983, 18.7731, 23.6654}, +{325.158, 19.0664, 23.9509}, +{330.418, 19.3837, 24.2400}, +{335.762, 19.7185, 24.5325}, +{341.192, 20.0713, 24.8285}, +{346.711, 20.4447, 25.1281}, +{352.319, 20.8441, 25.4313}, +{358.017, 21.2946, 25.7382}, +{363.808, 21.7691, 25.9671}, +{369.692, 22.2230, 26.1695}, +{375.672, 22.6578, 26.3735}, +{381.748, 23.0929, 26.5790}, +{387.922, 23.5321, 26.7862}, +{394.197, 23.9789, 26.9950}, +{400.573, 24.4367, 27.2053}, +{407.052, 24.9102, 27.4174}, +{413.635, 25.4067, 27.6311}, +{420.326, 25.9490, 27.8464}, +{427.124, 26.5448, 27.9861}, +{434.032, 27.1105, 28.0449}, +{441.052, 27.6193, 28.1038}, +{448.186, 28.1155, 28.1628}, +{455.435, 28.6025, 28.2219}, +{462.802, 29.0838, 28.2811}, +{470.287, 29.5622, 28.3405}, +{477.894, 30.0397, 28.4000}, +{485.623, 30.5183, 28.4596}, +{493.478, 30.9996, 28.5193}, +{501.459, 31.4855, 28.5792}, +{509.570, 31.9782, 28.6392}, +{517.812, 32.4801, 28.6994}, +{526.187, 32.9947, 28.7596}, +{534.698, 33.5267, 28.8200}, +{543.346, 34.0827, 28.8805}, +{552.134, 34.7042, 28.9411}, +{561.065, 35.3983, 28.9457}, +{570.139, 36.0692, 28.7507}, +{579.361, 36.6365, 28.5570}, +{588.732, 37.1613, 28.3645}, +{598.254, 37.6574, 28.1734}, +{607.930, 38.1314, 27.9835}, +{617.763, 38.5876, 27.7950}, +{627.755, 39.0286, 27.6077}, +{637.908, 39.4568, 27.4217}, +{648.226, 39.8737, 27.2369}, +{658.711, 40.2807, 27.0534}, +{669.365, 40.6791, 26.8711}, +{680.191, 41.0696, 26.6900}, +{691.193, 41.4534, 26.5101}, +{702.372, 41.8313, 26.3315}, +{713.733, 42.2041, 26.1541}, +{725.277, 42.5727, 25.9778}, +{737.008, 42.9380, 25.8028}, +{748.928, 43.3010, 25.6289}, +{761.042, 43.6627, 25.4562}, +{773.351, 44.0245, 25.2847}, +{785.859, 44.3881, 25.1143}, +{798.570, 44.7555, 24.9451}, +{811.486, 45.1300, 24.7770}, +{824.611, 45.5162, 24.6100}, +{837.949, 45.9217, 24.4442}, +{851.502, 46.3525, 24.2795}, +{865.274, 47.0374, 24.1159}, +{879.269, 47.7299, 23.1760}, +{893.491, 47.6502, 22.8917}, +{907.943, 47.8377, 22.6104}, +{922.628, 48.0699, 22.3323}, +{937.551, 48.3145, 22.0307}, +{952.715, 48.5452, 21.7261}, +{968.124, 48.7641, 21.4195}, +{983.783, 48.9726, 21.1168}, +{999.695, 49.1744, 20.8156}, +{1015.86, 49.3725, 20.5158}, +{1032.29, 49.5617, 20.1959}, +{1048.99, 49.7269, 19.8775}, +{1065.96, 49.8750, 19.5605}, +{1083.20, 50.0074, 19.2482}, +{1100.72, 50.1261, 18.9404}, +{1118.52, 50.2318, 18.6372}, +{1136.61, 50.3254, 18.3388}, +{1155.00, 50.4077, 18.0448}, +{1173.68, 50.4785, 17.7550}, +{1192.66, 50.5384, 17.4697}, +{1211.95, 50.5880, 17.1886}, +{1231.55, 50.6283, 16.9115}, +{1251.47, 50.6593, 16.6345}, +{1271.72, 50.6793, 16.3572}, +{1292.29, 50.6826, 16.0786}, +{1313.19, 50.6692, 15.8041}, +{1334.43, 50.6405, 15.5341}, +{1356.01, 50.5968, 15.2685}, +{1377.94, 50.5379, 15.0070}, +{1400.23, 50.4632, 14.7497}, +{1422.88, 50.3721, 14.4967}, +{1445.89, 50.2644, 14.2476}, +{1469.28, 50.1392, 14.0016}, +{1493.04, 49.9948, 13.7584}, +{1517.19, 49.8288, 13.5142}, +{1541.73, 49.6354, 13.2737}, +{1566.67, 49.4148, 13.0375}, +{1592.01, 49.1647, 12.8046}, +{1617.76, 48.8815, 12.5757}, +{1643.92, 48.5614, 12.3508}, +{1670.51, 48.1997, 12.1300}, +{1697.53, 47.7910, 11.9127}, +{1724.99, 47.3275, 11.6986}, +{1752.89, 46.7982, 11.4807}, +{1781.24, 46.1826, 11.2642}, +{1810.05, 45.4617, 11.0495}, +{1839.32, 44.6082, 10.8384}, +{1869.07, 43.5809, 10.6314}, +{1899.30, 42.3152, 10.4286}, +{1930.02, 40.6977, 10.2293}, +{1961.24, 38.5034, 10.0336}, +{1992.96, 35.1665, 9.84134}, +{2025.20, 28.0964, 9.65784}, +{2040.30, -0.661999, 9.57403}, +{2040.50, -0.662121, 27.3304}, +{2057.95, 27.9204, 27.0332}, +{2091.24, 31.1926, 26.4821}, +{2116.00, 12.3218, 26.0849}, +{2116.20, 12.3531, 38.4468}, +{2125.06, 30.7428, 38.2183}, +{2159.43, 39.3349, 37.3539}, +{2194.36, 43.4216, 36.5093}, +{2229.85, 46.2669, 35.6836}, +{2265.92, 48.4512, 34.8774}, +{2302.57, 50.1998, 34.0887}, +{2339.81, 51.6236, 33.3195}, +{2377.66, 52.7806, 32.5676}, +{2416.11, 53.6903, 31.8326}, +{2455.19, 54.3294, 31.1154}, +{2494.90, 54.5727, 30.4148}, +{2535.26, 53.6177, 29.7302}, +{2550.60, 46.3715, 29.4768}, +{2550.80, 46.3776, 34.2272}, +{2576.26, 55.3436, 33.7198}, +{2617.93, 57.5958, 32.9158}, +{2660.27, 59.0087, 32.1309}, +{2703.30, 60.0854, 31.3671}, +{2747.03, 60.9473, 30.6217}, +{2791.46, 61.6302, 29.8949}, +{2836.61, 62.1188, 29.1861}, +{2882.49, 62.2280, 28.4950}, +{2908.60, 59.4369, 28.1138}, +{2908.80, 59.4396, 29.8860}, +{2929.11, 62.6994, 29.5896}, +{2976.48, 63.9144, 28.9171}, +{3024.63, 64.6814, 28.2609}, +{3073.55, 65.2621, 27.6210}, +{3123.26, 65.6628, 26.9958}, +{3173.60, 64.2909, 26.3869}, +{3173.80, 64.2928, 27.3502}, +{3225.11, 66.7040, 26.7731}, +{3277.27, 67.3825, 26.2048}, +{3330.28, 67.9414, 25.6446}, +{3384.15, 68.4346, 25.0927}, +{3438.88, 68.8797, 24.5489}, +{3494.50, 69.2867, 24.0139}, +{3551.02, 69.6604, 23.4860}, +{3608.46, 70.0058, 22.9681}, +{3666.82, 70.3260, 22.4579}, +{3726.13, 70.6223, 21.9572}, +{3786.40, 70.8967, 21.4634}, +{3847.64, 71.1510, 20.9795}, +{3909.87, 71.3872, 20.5046}, +{3973.11, 71.6066, 20.0382}, +{4037.38, 71.8088, 19.5793}, +{4102.68, 71.9969, 19.1308}, +{4169.03, 72.1711, 18.6892}, +{4236.46, 72.3310, 18.2562}, +{4304.98, 72.4781, 17.8316}, +{4374.62, 72.6135, 17.4155}, +{4445.37, 72.7374, 17.0075}, +{4517.27, 72.8504, 16.6077}, +{4590.33, 72.9533, 16.2161}, +{4664.58, 73.0465, 15.8322}, +{4740.03, 73.1304, 15.4564}, +{4816.69, 73.2056, 15.0885}, +{4894.60, 73.2725, 14.7282}, +{4973.77, 73.3314, 14.3754}, +{5054.21, 73.3829, 14.0303}, +{5135.96, 73.4270, 13.6926}, +{5219.03, 73.4644, 13.3622}, +{5303.44, 73.4951, 13.0389}, +{5389.22, 73.5196, 12.7228}, +{5476.39, 73.5380, 12.4137}, +{5564.97, 73.5507, 12.1116}, +{5654.98, 73.5580, 11.8162}, +{5746.44, 73.5601, 11.5274}, +{5839.39, 73.5570, 11.2452}, +{5933.83, 73.5491, 10.9694}, +{6029.81, 73.5363, 10.6999}, +{6127.33, 73.5191, 10.4367}, +{6226.44, 73.4974, 10.1796}, +{6327.15, 73.4714, 9.92852}, +{6429.48, 73.4413, 9.68345}, +{6533.48, 73.4071, 9.44395}, +{6639.15, 73.3690, 9.21018}, +{6746.54, 73.3269, 8.98196}, +{6855.65, 73.2810, 8.75918}, +{6966.54, 73.2310, 8.54146}, +{7079.22, 73.1772, 8.32915}, +{7193.72, 73.1194, 8.12195}, +{7310.07, 73.0577, 7.91989}, +{7428.31, 72.9920, 7.72256}, +{7548.45, 72.9222, 7.53009}, +{7670.54, 72.8481, 7.34241}, +{7794.61, 72.7697, 7.15912}, +{7920.68, 72.6866, 6.98032}, +{8048.79, 72.5986, 6.80599}, +{8178.98, 72.5052, 6.63582}, +{8311.26, 72.4063, 6.46999}, +{8445.69, 72.3011, 6.30817}, +{8582.29, 72.1896, 6.15055}, +{8721.11, 72.0705, 5.99655}, +{8862.16, 71.9433, 5.84659}, +{9005.50, 71.8067, 5.70018}, +{9151.16, 71.6597, 5.55755}, +{9299.17, 71.5003, 5.41839}, +{9449.58, 71.3267, 5.28280}, +{9602.42, 71.1361, 5.15050}, +{9757.73, 70.9248, 5.02171}, +{9915.55, 70.6895, 4.89611}, +{10075.9, 70.4205, 4.77048}, +{10238.9, 70.1059, 4.64835}, +{10404.5, 69.7302, 4.52961}, +{10572.8, 69.2641, 4.41418}, +{10743.8, 68.6503, 4.30200}, +{10917.6, 67.7469, 4.19296}, +{11094.2, 65.9800, 4.08700}, +{11215.1, 51.9627, 4.01691}, +{11215.3, 51.9638, 10.3030}, +{11273.6, 64.6650, 10.2052}, +{11455.9, 67.5139, 9.90830}, +{11641.2, 68.5918, 9.62008}, +{11829.5, 69.1967, 9.34025}, +{12020.8, 69.5442, 9.06856}, +{12215.3, 69.6942, 8.80476}, +{12412.8, 69.6329, 8.54866}, +{12613.6, 69.2139, 8.29999}, +{12817.6, 65.8472, 8.05857}, +{12824.0, 61.5660, 8.05120}, +{12824.2, 61.5663, 11.2792}, +{13025.0, 69.5017, 11.0047}, +{13235.6, 70.2243, 10.7282}, +{13418.4, 67.7144, 10.4973}, +{13418.6, 67.7161, 11.9016}, +{13449.7, 70.0605, 11.8614}, +{13667.2, 71.4638, 11.5862}, +{13888.3, 72.1629, 11.3157}, +{14112.9, 72.6906, 11.0499}, +{14341.2, 73.1237, 10.7889}, +{14573.1, 73.4929, 10.5326}, +{14808.9, 73.8143, 10.2810}, +{15048.4, 74.0982, 10.0342}, +{15291.8, 74.3512, 9.79217}, +{15539.1, 74.5783, 9.55482}, +{15790.4, 74.7832, 9.32215}, +{16045.8, 74.9687, 9.09416}, +{16305.4, 75.1372, 8.87080}, +{16569.1, 75.2905, 8.65203}, +{16837.1, 75.4303, 8.43782}, +{17109.4, 75.5577, 8.22812}, +{17386.1, 75.6740, 8.02289}, +{17667.4, 75.7802, 7.82207}, +{17953.1, 75.8771, 7.62561}, +{18243.5, 75.9654, 7.43346}, +{18538.6, 76.0459, 7.24557}, +{18838.4, 76.1192, 7.06186}, +{19143.1, 76.1858, 6.88229}, +{19452.7, 76.2462, 6.70679}, +{19767.4, 76.3008, 6.53530}, +{20087.1, 76.3500, 6.36775}, +{20412.0, 76.3943, 6.20408}, +{20742.1, 76.4339, 6.04423}, +{21077.6, 76.4692, 5.88813}, +{21418.5, 76.5005, 5.73571}, +{21765.0, 76.5280, 5.58691}, +{22117.0, 76.5519, 5.44167}, +{22474.7, 76.5726, 5.29991}, +{22838.2, 76.5902, 5.16156}, +{23207.6, 76.6049, 5.02658}, +{23583.0, 76.6170, 4.89487}, +{23964.4, 76.6265, 4.76639}, +{24352.0, 76.6337, 4.64107}, +{24745.9, 76.6386, 4.51884}, +{25146.2, 76.6415, 4.39963}, +{25552.9, 76.6425, 4.28340}, +{25966.2, 76.6417, 4.17006}, +{26386.1, 76.6391, 4.05956}, +{26812.9, 76.6350, 3.95184}, +{27246.6, 76.6295, 3.84683}, +{27687.3, 76.6226, 3.74448}, +{28135.1, 76.6144, 3.64473}, +{28590.2, 76.6051, 3.54751}, +{29052.6, 76.5953, 3.45278}, +{29522.5, 76.5935, 3.36047}, +{30000.0, 76.5426, 3.27053}, +{0, 0, 0} +}; + +e_fp_fdp pt[] = { /* Z = 78 */ +{10.0000, -9999.00, 2.24140}, +{10.1617, -9999.00, 2.28104}, +{10.3261, -9999.00, 2.32138}, +{10.4931, -9999.00, 2.36244}, +{10.6628, -9999.00, 2.40955}, +{10.8353, -9999.00, 2.45863}, +{11.0106, -9999.00, 2.50871}, +{11.1886, -9999.00, 2.55981}, +{11.3696, -9999.00, 2.61195}, +{11.5535, -9999.00, 2.66515}, +{11.7404, -9999.00, 2.73690}, +{11.9303, -9999.00, 2.81125}, +{12.1232, -9999.00, 2.88761}, +{12.3193, -9999.00, 2.96604}, +{12.5186, -9999.00, 3.04661}, +{12.7210, -9999.00, 3.12936}, +{12.9268, -9999.00, 3.21436}, +{13.1359, -9999.00, 3.30167}, +{13.3483, -9999.00, 3.40249}, +{13.5642, -9999.00, 3.50943}, +{13.7836, -9999.00, 3.61972}, +{14.0066, -9999.00, 3.73349}, +{14.2331, -9999.00, 3.85083}, +{14.4633, -9999.00, 3.97132}, +{14.6973, -9999.00, 4.09410}, +{14.9350, -9999.00, 4.22068}, +{15.1765, -9999.00, 4.35118}, +{15.4220, -9999.00, 4.48570}, +{15.6714, -9999.00, 4.62439}, +{15.9249, -9999.00, 4.76737}, +{16.1825, -9999.00, 4.92382}, +{16.4442, -9999.00, 5.11493}, +{16.7102, -9999.00, 5.31346}, +{16.9805, -9999.00, 5.51971}, +{17.2551, -9999.00, 5.73395}, +{17.5342, -9999.00, 5.95651}, +{17.8178, -9999.00, 6.18771}, +{18.1060, -9999.00, 6.42869}, +{18.3989, -9999.00, 6.67959}, +{18.6964, -9999.00, 6.94029}, +{18.9988, -9999.00, 7.21116}, +{19.3061, -9999.00, 7.49261}, +{19.6184, -9999.00, 7.78504}, +{19.9357, -9999.00, 8.10865}, +{20.2582, -9999.00, 8.44803}, +{20.5858, -9999.00, 8.80160}, +{20.9188, -9999.00, 9.16997}, +{21.2571, -9999.00, 9.55375}, +{21.6009, -9999.00, 9.82617}, +{21.9503, -9999.00, 10.0018}, +{22.3053, -9999.00, 10.1805}, +{22.6661, -9999.00, 10.3254}, +{23.0327, -9999.00, 10.2686}, +{23.4053, -9999.00, 10.2122}, +{23.7838, -9999.00, 10.1561}, +{24.1685, -9999.00, 10.0908}, +{24.5594, -9999.00, 10.0179}, +{24.9566, -9999.00, 9.94547}, +{25.3603, -9999.00, 9.87360}, +{25.7705, -9999.00, 9.80225}, +{26.1873, -9999.00, 9.75550}, +{26.6109, -9999.00, 9.77906}, +{27.0413, -9999.00, 9.80267}, +{27.4786, -9999.00, 9.82634}, +{27.9231, -9999.00, 9.85007}, +{28.3747, -9999.00, 9.87386}, +{28.8337, -9999.00, 9.90002}, +{29.3000, 4.75018, 10.0030}, +{29.7739, 4.91917, 10.1070}, +{30.2555, 5.12383, 10.2122}, +{30.7449, 5.36757, 10.3184}, +{31.2421, 5.67195, 10.4257}, +{31.7475, 6.10734, 10.4885}, +{32.2609, 6.50682, 10.2993}, +{32.7827, 6.82274, 10.1135}, +{33.3130, 7.14517, 9.85999}, +{33.8518, 7.33606, 9.54738}, +{34.3993, 7.44601, 9.24468}, +{34.9557, 7.48468, 8.95158}, +{35.5211, 7.46476, 8.73033}, +{36.0956, 7.45388, 8.53382}, +{36.6794, 7.43034, 8.34171}, +{37.2727, 7.38290, 8.15394}, +{37.8755, 7.30634, 7.97582}, +{38.4882, 7.20433, 7.80507}, +{39.1107, 7.06494, 7.63798}, +{39.7432, 6.85001, 7.47446}, +{40.3861, 6.54186, 7.45605}, +{41.0393, 6.33144, 7.51117}, +{41.7031, 6.15713, 7.56671}, +{42.3776, 5.98580, 7.62266}, +{43.0630, 5.79969, 7.67901}, +{43.7595, 5.56187, 7.77408}, +{44.4673, 5.35913, 7.94085}, +{45.1865, 5.17514, 8.11118}, +{45.9174, 4.98604, 8.28516}, +{46.6600, 4.74494, 8.46288}, +{47.4147, 4.41022, 8.79591}, +{48.1816, 4.21243, 9.24247}, +{48.9609, 4.09750, 9.71171}, +{49.7528, 4.04225, 10.2048}, +{50.5576, 4.05666, 10.7091}, +{51.3753, 4.11036, 11.2192}, +{52.2062, 4.21627, 11.7535}, +{53.0506, 4.40240, 12.3134}, +{53.9087, 4.72657, 12.8908}, +{54.7806, 5.09679, 13.2937}, +{55.6667, 5.46446, 13.7093}, +{56.5670, 5.92082, 14.1378}, +{57.4820, 6.52755, 14.3866}, +{58.4117, 7.01573, 14.5169}, +{59.3564, 7.49860, 14.6483}, +{60.3165, 7.96723, 14.5679}, +{61.2921, 8.22797, 14.4274}, +{62.2834, 8.29224, 14.4108}, +{63.2908, 8.40443, 14.5101}, +{64.3145, 8.47961, 14.6100}, +{65.3547, 8.39545, 14.7107}, +{66.4118, 8.30658, 15.2458}, +{67.4859, 8.39631, 15.8407}, +{68.5775, 8.58111, 16.6268}, +{69.6867, 9.09594, 17.5532}, +{70.8138, 10.0659, 18.5311}, +{71.9591, 11.2504, 18.8555}, +{73.1230, 12.4248, 19.1557}, +{74.3057, 13.8941, 19.1313}, +{75.5076, 15.1220, 18.7341}, +{76.7289, 16.0616, 18.1156}, +{77.9699, 16.8175, 17.5132}, +{79.2310, 17.4571, 16.9264}, +{80.5125, 18.0563, 16.3521}, +{81.8147, 18.5549, 15.6601}, +{83.1380, 18.9250, 14.9974}, +{84.4827, 19.1709, 14.3878}, +{85.8491, 19.4255, 13.8863}, +{87.2377, 19.7460, 13.4023}, +{88.6487, 20.1246, 12.7254}, +{90.0825, 20.2642, 11.9476}, +{91.5395, 20.2451, 11.2173}, +{93.0201, 20.0327, 10.6215}, +{94.5246, 19.8880, 10.1774}, +{96.0535, 19.7710, 9.75193}, +{97.6071, 19.6371, 9.34422}, +{99.1858, 19.4634, 8.95357}, +{100.790, 19.2828, 8.64946}, +{102.420, 19.1247, 8.36195}, +{104.077, 18.9691, 8.08400}, +{105.760, 18.8081, 7.81529}, +{107.471, 18.6342, 7.56036}, +{109.209, 18.4578, 7.32109}, +{110.975, 18.2735, 7.08939}, +{112.770, 18.0757, 6.86502}, +{114.594, 17.8623, 6.65472}, +{116.448, 17.6370, 6.45444}, +{118.331, 17.3889, 6.26053}, +{120.245, 17.1226, 6.09217}, +{122.190, 16.8304, 5.92833}, +{124.166, 16.4548, 5.77458}, +{126.175, 16.0976, 5.78754}, +{128.215, 15.7977, 5.80054}, +{130.289, 15.5124, 5.81356}, +{132.397, 15.2068, 5.83960}, +{134.538, 14.9243, 5.90864}, +{136.714, 14.6606, 5.97849}, +{138.925, 14.3974, 6.04917}, +{141.172, 14.1173, 6.12068}, +{143.456, 13.8031, 6.23732}, +{145.776, 13.5254, 6.40088}, +{148.134, 13.2633, 6.56873}, +{150.530, 12.9932, 6.74099}, +{152.964, 12.7167, 6.95984}, +{155.439, 12.4699, 7.20614}, +{157.953, 12.2388, 7.46117}, +{160.507, 12.0125, 7.72521}, +{163.103, 11.7683, 8.01646}, +{165.742, 11.5592, 8.36053}, +{168.422, 11.3806, 8.71938}, +{171.146, 11.2286, 9.09362}, +{173.915, 11.1116, 9.48043}, +{176.727, 11.0097, 9.85501}, +{179.586, 10.9203, 10.2444}, +{182.491, 10.8491, 10.6492}, +{185.442, 10.8049, 11.0699}, +{188.442, 10.8191, 11.5073}, +{191.489, 10.8582, 11.8722}, +{194.587, 10.8698, 12.2278}, +{197.734, 10.8731, 12.5940}, +{200.932, 10.8742, 12.9712}, +{204.182, 10.8686, 13.3597}, +{207.485, 10.8587, 13.7959}, +{210.840, 10.8854, 14.2654}, +{214.251, 10.9492, 14.7510}, +{217.716, 11.0495, 15.2531}, +{221.237, 11.2246, 15.7509}, +{224.816, 11.4022, 16.2117}, +{228.452, 11.5882, 16.6860}, +{232.147, 11.8082, 17.1742}, +{235.902, 12.0863, 17.6767}, +{239.717, 12.4937, 18.1211}, +{243.595, 12.8355, 18.4349}, +{247.535, 13.1425, 18.7542}, +{251.538, 13.4452, 19.0789}, +{255.607, 13.7679, 19.4094}, +{259.741, 14.1204, 19.6839}, +{263.942, 14.4351, 19.9230}, +{268.211, 14.7189, 20.1650}, +{272.549, 14.9906, 20.4099}, +{276.957, 15.2515, 20.6577}, +{281.437, 15.4963, 20.9164}, +{285.989, 15.7495, 21.1951}, +{290.615, 16.0096, 21.4776}, +{295.315, 16.2743, 21.7638}, +{300.092, 16.5434, 22.0538}, +{304.945, 16.8140, 22.3507}, +{309.878, 17.0949, 22.6567}, +{314.890, 17.3866, 22.9664}, +{319.983, 17.6879, 23.2798}, +{325.158, 17.9985, 23.5970}, +{330.418, 18.3201, 23.9196}, +{335.762, 18.6547, 24.2466}, +{341.192, 19.0029, 24.5777}, +{346.711, 19.3661, 24.9135}, +{352.319, 19.7469, 25.2539}, +{358.017, 20.1472, 25.5986}, +{363.808, 20.5705, 25.9480}, +{369.692, 21.0211, 26.3024}, +{375.672, 21.5068, 26.6619}, +{381.748, 22.0427, 27.0267}, +{387.922, 22.6642, 27.3705}, +{394.197, 23.3752, 27.6596}, +{400.573, 24.1070, 27.7573}, +{407.052, 24.7286, 27.7781}, +{413.635, 25.2907, 27.7993}, +{420.326, 25.8200, 27.8201}, +{427.124, 26.3268, 27.8410}, +{434.032, 26.8182, 27.8624}, +{441.052, 27.2991, 27.8840}, +{448.186, 27.7883, 27.9008}, +{455.435, 28.2640, 27.8929}, +{462.802, 28.7210, 27.8663}, +{470.287, 29.1500, 27.8300}, +{477.894, 29.5538, 27.7952}, +{485.623, 29.9358, 27.7593}, +{493.478, 30.2920, 27.7233}, +{501.459, 30.6169, 27.6882}, +{509.570, 30.8943, 27.6530}, +{517.812, 31.0540, 27.6565}, +{526.187, 31.1498, 27.7985}, +{534.698, 31.2847, 28.2058}, +{543.346, 31.6762, 28.7535}, +{552.134, 32.3536, 29.3103}, +{561.065, 33.2344, 29.5372}, +{570.139, 34.0865, 29.5857}, +{579.361, 34.8060, 29.5097}, +{588.732, 35.4652, 29.4124}, +{598.254, 36.0729, 29.3017}, +{607.930, 36.6519, 29.1908}, +{617.763, 37.2176, 29.0813}, +{627.755, 37.7944, 28.9693}, +{637.908, 38.3790, 28.8129}, +{648.226, 38.9469, 28.5927}, +{658.711, 39.4391, 28.3318}, +{669.365, 39.8651, 28.0733}, +{680.191, 40.2342, 27.8554}, +{691.193, 40.5811, 27.6713}, +{702.372, 40.9019, 27.5165}, +{713.733, 41.2118, 27.4391}, +{725.277, 41.5850, 27.4150}, +{737.008, 42.0065, 27.3909}, +{748.928, 42.4696, 27.3668}, +{761.042, 42.9901, 27.3389}, +{773.351, 43.5984, 27.2699}, +{785.859, 44.2542, 27.0584}, +{798.570, 44.8036, 26.7316}, +{811.486, 45.2814, 26.4088}, +{824.611, 45.7200, 26.0895}, +{837.949, 46.1321, 25.7739}, +{851.502, 46.5234, 25.4571}, +{865.274, 46.8962, 25.1385}, +{879.269, 47.2475, 24.8189}, +{893.491, 47.5817, 24.5032}, +{907.943, 47.9035, 24.1913}, +{922.628, 48.2204, 23.8831}, +{937.551, 48.5246, 23.5590}, +{952.715, 48.8124, 23.2341}, +{968.124, 49.0820, 22.9091}, +{983.783, 49.3386, 22.5882}, +{999.695, 49.5866, 22.2688}, +{1015.86, 49.8314, 21.9509}, +{1032.29, 50.0596, 21.6119}, +{1048.99, 50.2681, 21.2739}, +{1065.96, 50.4555, 20.9370}, +{1083.20, 50.6261, 20.6052}, +{1100.72, 50.7823, 20.2783}, +{1118.52, 50.9249, 19.9561}, +{1136.61, 51.0546, 19.6386}, +{1155.00, 51.1722, 19.3259}, +{1173.68, 51.2785, 19.0180}, +{1192.66, 51.3738, 18.7143}, +{1211.95, 51.4588, 18.4152}, +{1231.55, 51.5349, 18.1203}, +{1251.47, 51.6021, 17.8255}, +{1271.72, 51.6590, 17.5301}, +{1292.29, 51.6991, 17.2330}, +{1313.19, 51.7230, 16.9402}, +{1334.43, 51.7324, 16.6523}, +{1356.01, 51.7279, 16.3691}, +{1377.94, 51.7096, 16.0903}, +{1400.23, 51.6773, 15.8158}, +{1422.88, 51.6305, 15.5454}, +{1445.89, 51.5690, 15.2793}, +{1469.28, 51.4933, 15.0167}, +{1493.04, 51.4028, 14.7568}, +{1517.19, 51.2925, 14.4942}, +{1541.73, 51.1597, 14.2353}, +{1566.67, 51.0039, 13.9809}, +{1592.01, 50.8243, 13.7306}, +{1617.76, 50.6192, 13.4844}, +{1643.92, 50.3861, 13.2421}, +{1670.51, 50.1221, 13.0041}, +{1697.53, 49.8239, 12.7702}, +{1724.99, 49.4914, 12.5404}, +{1752.89, 49.1134, 12.3058}, +{1781.24, 48.6789, 12.0724}, +{1810.05, 48.1781, 11.8407}, +{1839.32, 47.5988, 11.6137}, +{1869.07, 46.9256, 11.3910}, +{1899.30, 46.1355, 11.1724}, +{1930.02, 45.1937, 10.9576}, +{1961.24, 44.0470, 10.7469}, +{1992.96, 42.6065, 10.5407}, +{2025.20, 40.7193, 10.3435}, +{2057.95, 38.0172, 10.1385}, +{2091.24, 33.3254, 9.93584}, +{2121.50, 0.537214, 9.75786}, +{2121.70, 0.535749, 27.4284}, +{2125.06, 20.3955, 27.3696}, +{2159.43, 32.1554, 26.7804}, +{2194.36, 29.5656, 26.2046}, +{2201.80, 13.1232, 26.0848}, +{2202.00, 13.1439, 38.5454}, +{2229.85, 37.6075, 37.8534}, +{2265.92, 42.8686, 36.9881}, +{2302.57, 46.1724, 36.1431}, +{2339.81, 48.6155, 35.3172}, +{2377.66, 50.5369, 34.5116}, +{2416.11, 52.0890, 33.7242}, +{2455.19, 53.3494, 32.9558}, +{2494.90, 54.3527, 32.2050}, +{2535.26, 55.0928, 31.4720}, +{2576.26, 55.4892, 30.7570}, +{2617.93, 55.1214, 30.0583}, +{2645.30, 47.4320, 29.6139}, +{2645.50, 47.4376, 34.2684}, +{2660.27, 55.1840, 33.9885}, +{2703.30, 58.0215, 33.1949}, +{2747.03, 59.5605, 32.4207}, +{2791.46, 60.7071, 31.6658}, +{2836.61, 61.6255, 30.9297}, +{2882.49, 62.3688, 30.2110}, +{2929.11, 62.9433, 29.5107}, +{2976.48, 63.2825, 28.8275}, +{3024.63, 62.1169, 28.1599}, +{3026.40, 60.5309, 28.1358}, +{3026.60, 60.5336, 29.8585}, +{3073.55, 64.4574, 29.2107}, +{3123.26, 65.3424, 28.5503}, +{3173.78, 65.9810, 27.9062}, +{3225.11, 66.4411, 27.2770}, +{3277.27, 66.5489, 26.6641}, +{3295.90, 64.8614, 26.4510}, +{3296.10, 64.8636, 27.5800}, +{3330.28, 67.3053, 27.1880}, +{3384.15, 68.1329, 26.5894}, +{3438.88, 68.7545, 26.0011}, +{3494.50, 69.2856, 25.4237}, +{3551.02, 69.7561, 24.8552}, +{3608.46, 70.1805, 24.2985}, +{3666.82, 70.5679, 23.7519}, +{3726.13, 70.9235, 23.2156}, +{3786.40, 71.2497, 22.6878}, +{3847.64, 71.5499, 22.1718}, +{3909.87, 71.8275, 21.6655}, +{3973.11, 72.0845, 21.1695}, +{4037.38, 72.3218, 20.6818}, +{4102.68, 72.5401, 20.2043}, +{4169.03, 72.7424, 19.7372}, +{4236.46, 72.9290, 19.2783}, +{4304.98, 73.1006, 18.8298}, +{4374.62, 73.2589, 18.3901}, +{4445.37, 73.4040, 17.9594}, +{4517.27, 73.5370, 17.5375}, +{4590.33, 73.6585, 17.1247}, +{4664.58, 73.7693, 16.7204}, +{4740.03, 73.8698, 16.3247}, +{4816.69, 73.9605, 15.9376}, +{4894.60, 74.0423, 15.5587}, +{4973.77, 74.1154, 15.1879}, +{5054.21, 74.1800, 14.8252}, +{5135.96, 74.2369, 14.4704}, +{5219.03, 74.2863, 14.1236}, +{5303.44, 74.3288, 13.7843}, +{5389.22, 74.3644, 13.4525}, +{5476.39, 74.3937, 13.1282}, +{5564.97, 74.4168, 12.8110}, +{5654.98, 74.4341, 12.5011}, +{5746.44, 74.4456, 12.1981}, +{5839.39, 74.4519, 11.9022}, +{5933.83, 74.4531, 11.6129}, +{6029.81, 74.4493, 11.3302}, +{6127.33, 74.4407, 11.0542}, +{6226.44, 74.4275, 10.7843}, +{6327.15, 74.4100, 10.5209}, +{6429.48, 74.3881, 10.2634}, +{6533.48, 74.3620, 10.0121}, +{6639.15, 74.3319, 9.76641}, +{6746.54, 74.2976, 9.52668}, +{6855.65, 74.2595, 9.29264}, +{6966.54, 74.2175, 9.06404}, +{7079.22, 74.1718, 8.84084}, +{7193.72, 74.1221, 8.62279}, +{7310.07, 74.0686, 8.41010}, +{7428.31, 74.0113, 8.20221}, +{7548.45, 73.9499, 7.99961}, +{7670.54, 73.8846, 7.80150}, +{7794.61, 73.8152, 7.60841}, +{7920.68, 73.7415, 7.41965}, +{8048.79, 73.6633, 7.23560}, +{8178.98, 73.5806, 7.05599}, +{8311.26, 73.4929, 6.88054}, +{8445.69, 73.3998, 6.70940}, +{8582.29, 73.3010, 6.54238}, +{8721.11, 73.1963, 6.37954}, +{8862.16, 73.0849, 6.22024}, +{9005.50, 72.9658, 6.06517}, +{9151.16, 72.8388, 5.91366}, +{9299.17, 72.7023, 5.76585}, +{9449.58, 72.5554, 5.62157}, +{9602.42, 72.3965, 5.48071}, +{9757.73, 72.2235, 5.34339}, +{9915.55, 72.0389, 5.20926}, +{10075.9, 71.8332, 5.06622}, +{10238.9, 71.5903, 4.92680}, +{10404.5, 71.3112, 4.79093}, +{10572.8, 70.9841, 4.65851}, +{10743.8, 70.5910, 4.52948}, +{10917.6, 70.1000, 4.40374}, +{11094.2, 69.4473, 4.28123}, +{11273.6, 68.4707, 4.16186}, +{11455.9, 66.4777, 4.04556}, +{11563.6, 52.2359, 3.97926}, +{11563.8, 52.2369, 10.4400}, +{11641.2, 65.9142, 10.3166}, +{11829.5, 68.4505, 10.0256}, +{12020.8, 69.4959, 9.74292}, +{12215.3, 70.0966, 9.46818}, +{12412.8, 70.4504, 9.20119}, +{12613.6, 70.6151, 8.94172}, +{12817.6, 70.5821, 8.68958}, +{13025.0, 70.2352, 8.44455}, +{13235.6, 68.5077, 8.20643}, +{13272.5, 62.4930, 8.16585}, +{13272.7, 62.4933, 11.3782}, +{13449.7, 70.2552, 11.1468}, +{13667.2, 71.0704, 10.8729}, +{13879.8, 68.8067, 10.6158}, +{13880.0, 68.8083, 11.9295}, +{13888.3, 70.4412, 11.9199}, +{14112.9, 72.2655, 11.6637}, +{14341.2, 72.9742, 11.4102}, +{14573.1, 73.5068, 11.1595}, +{14808.9, 73.9451, 10.9118}, +{15048.4, 74.3205, 10.6672}, +{15291.8, 74.6489, 10.4259}, +{15539.1, 74.9405, 10.1880}, +{15790.4, 75.2017, 9.95343}, +{16045.8, 75.4374, 9.72244}, +{16305.4, 75.6511, 9.49503}, +{16569.1, 75.8456, 9.27128}, +{16837.1, 76.0230, 9.05122}, +{17109.4, 76.1853, 8.83491}, +{17386.1, 76.3338, 8.62236}, +{17667.4, 76.4699, 8.41361}, +{17953.1, 76.5946, 8.20866}, +{18243.5, 76.7090, 8.00753}, +{18538.6, 76.8139, 7.81022}, +{18838.4, 76.9099, 7.61672}, +{19143.1, 76.9978, 7.42703}, +{19452.7, 77.0781, 7.24113}, +{19767.4, 77.1514, 7.05901}, +{20087.1, 77.2182, 6.88064}, +{20412.0, 77.2790, 6.70599}, +{20742.1, 77.3340, 6.53504}, +{21077.6, 77.3837, 6.36774}, +{21418.5, 77.4285, 6.20408}, +{21765.0, 77.4686, 6.04401}, +{22117.0, 77.5043, 5.88748}, +{22474.7, 77.5360, 5.73447}, +{22838.2, 77.5639, 5.58490}, +{23207.6, 77.5881, 5.43876}, +{23583.0, 77.6090, 5.29597}, +{23964.4, 77.6268, 5.15651}, +{24352.0, 77.6416, 5.02031}, +{24745.9, 77.6536, 4.88733}, +{25146.2, 77.6630, 4.75751}, +{25552.9, 77.6699, 4.63080}, +{25966.2, 77.6746, 4.50716}, +{26386.1, 77.6771, 4.38651}, +{26812.9, 77.6776, 4.26881}, +{27246.6, 77.6762, 4.15401}, +{27687.3, 77.6731, 4.04206}, +{28135.1, 77.6684, 3.93288}, +{28590.2, 77.6622, 3.82645}, +{29052.6, 77.6552, 3.72269}, +{29522.5, 77.6565, 3.62156}, +{30000.0, 77.6045, 3.52300}, +{0, 0, 0} +}; + +e_fp_fdp au[] = { /* Z = 79 */ +{10.0000, -9999.00, 1.73645}, +{10.1617, -9999.00, 1.81425}, +{10.3261, -9999.00, 1.89553}, +{10.4931, -9999.00, 1.98045}, +{10.6628, -9999.00, 2.06919}, +{10.8353, -9999.00, 2.16029}, +{11.0106, -9999.00, 2.25522}, +{11.1886, -9999.00, 2.35433}, +{11.3696, -9999.00, 2.45698}, +{11.5535, -9999.00, 2.56237}, +{11.7404, -9999.00, 2.67227}, +{11.9303, -9999.00, 2.78521}, +{12.1232, -9999.00, 2.88817}, +{12.3193, -9999.00, 2.99494}, +{12.5186, -9999.00, 3.10132}, +{12.7210, -9999.00, 3.19752}, +{12.9268, -9999.00, 3.29669}, +{13.1359, -9999.00, 3.39894}, +{13.3483, -9999.00, 3.50437}, +{13.5642, -9999.00, 3.61306}, +{13.7836, -9999.00, 3.73152}, +{14.0066, -9999.00, 3.85438}, +{14.2331, -9999.00, 3.98129}, +{14.4633, -9999.00, 4.11238}, +{14.6973, -9999.00, 4.24778}, +{14.9350, -9999.00, 4.38725}, +{15.1765, -9999.00, 4.51173}, +{15.4220, -9999.00, 4.63973}, +{15.6714, -9999.00, 4.77138}, +{15.9249, -9999.00, 4.90700}, +{16.1825, -9999.00, 5.04723}, +{16.4442, -9999.00, 5.19146}, +{16.7102, -9999.00, 5.33982}, +{16.9805, -9999.00, 5.49242}, +{17.2551, -9999.00, 5.68629}, +{17.5342, -9999.00, 5.92705}, +{17.8178, -9999.00, 6.17800}, +{18.1060, -9999.00, 6.43958}, +{18.3989, -9999.00, 6.70137}, +{18.6964, -9999.00, 6.96844}, +{18.9988, -9999.00, 7.24614}, +{19.3061, -9999.00, 7.53492}, +{19.6184, -9999.00, 7.83520}, +{19.9357, -9999.00, 8.12303}, +{20.2582, -9999.00, 8.41958}, +{20.5858, -9999.00, 8.72696}, +{20.9188, -9999.00, 9.04555}, +{21.2571, -9999.00, 9.37578}, +{21.6009, -9999.00, 9.65639}, +{21.9503, -9999.00, 9.85393}, +{22.3053, -9999.00, 10.0555}, +{22.6661, -9999.00, 10.1353}, +{23.0327, -9999.00, 10.0079}, +{23.4053, -9999.00, 9.88212}, +{23.7838, -9999.00, 9.66742}, +{24.1685, -9999.00, 9.44840}, +{24.5594, -9999.00, 9.19934}, +{24.9566, -9999.00, 8.91210}, +{25.3603, -9999.00, 8.80138}, +{25.7705, -9999.00, 8.83333}, +{26.1873, -9999.00, 8.86539}, +{26.6109, -9999.00, 8.89756}, +{27.0413, -9999.00, 9.16016}, +{27.4786, -9999.00, 9.45786}, +{27.9231, -9999.00, 9.76523}, +{28.3747, -9999.00, 10.2659}, +{28.8337, -9999.00, 10.8106}, +{29.3000, 2.78186, 11.3841}, +{29.7739, 3.12197, 11.9461}, +{30.2555, 3.70915, 12.3765}, +{30.7449, 4.20738, 12.6184}, +{31.2421, 4.73090, 12.8652}, +{31.7475, 5.46023, 12.8839}, +{32.2609, 5.87616, 12.6294}, +{32.7827, 6.08759, 12.5189}, +{33.3130, 6.32748, 12.4795}, +{33.8518, 6.56094, 12.4401}, +{34.3993, 6.77999, 12.4009}, +{34.9557, 6.98361, 12.3612}, +{35.5211, 7.16960, 12.3210}, +{36.0956, 7.33501, 12.2809}, +{36.6794, 7.47047, 12.2410}, +{37.2727, 7.56618, 12.2520}, +{37.8755, 7.69660, 12.2957}, +{38.4882, 7.83947, 12.3395}, +{39.1107, 7.98680, 12.3835}, +{39.7432, 8.13188, 12.4276}, +{40.3861, 8.26647, 12.4883}, +{41.0393, 8.42254, 12.5633}, +{41.7031, 8.59265, 12.6389}, +{42.3776, 8.77385, 12.7149}, +{43.0630, 8.96787, 12.7913}, +{43.7595, 9.18641, 12.8683}, +{44.4673, 9.46044, 12.9155}, +{45.1865, 9.69558, 12.8825}, +{45.9174, 9.89174, 12.8495}, +{46.6600, 10.0695, 12.8166}, +{47.4147, 10.2373, 12.7764}, +{48.1816, 10.3747, 12.7253}, +{48.9609, 10.4803, 12.6743}, +{49.7528, 10.5325, 12.6236}, +{50.5576, 10.4820, 12.6684}, +{51.3753, 10.5236, 12.8041}, +{52.2062, 10.6116, 12.9412}, +{53.0506, 10.7140, 13.0799}, +{53.9087, 10.8153, 13.2200}, +{54.7806, 10.8726, 13.4192}, +{55.6667, 11.0212, 13.6953}, +{56.5670, 11.2340, 13.9771}, +{57.4820, 11.5042, 14.2647}, +{58.4117, 11.8496, 14.5582}, +{59.3564, 12.3324, 14.7951}, +{60.3165, 12.7858, 14.9282}, +{61.2921, 13.2429, 15.0626}, +{62.2834, 13.7797, 15.1981}, +{63.2908, 14.5113, 15.1516}, +{64.3145, 15.0559, 14.9190}, +{65.3547, 15.5212, 14.6802}, +{66.4118, 15.9070, 14.3628}, +{67.4859, 16.2049, 14.0523}, +{68.5775, 16.4318, 13.7485}, +{69.6867, 16.5634, 13.4513}, +{70.8138, 16.6399, 13.3031}, +{71.9591, 16.7793, 13.2003}, +{73.1230, 16.9357, 13.0984}, +{74.3057, 17.0724, 13.0206}, +{75.5076, 17.2580, 12.9864}, +{76.7289, 17.4936, 12.9523}, +{77.9699, 17.8101, 12.8622}, +{79.2310, 18.0550, 12.6853}, +{80.5125, 18.2473, 12.5107}, +{81.8147, 18.3659, 12.3386}, +{83.1380, 18.2599, 12.4097}, +{84.4827, 18.8505, 12.9523}, +{85.8491, 19.5657, 12.5874}, +{87.2377, 20.0820, 12.2174}, +{88.6487, 20.4581, 11.7345}, +{90.0825, 20.7202, 11.2706}, +{91.5395, 20.9355, 10.8251}, +{93.0201, 21.0795, 10.3143}, +{94.5246, 21.1195, 9.82493}, +{96.0535, 21.0563, 9.43000}, +{97.6071, 21.0251, 9.10771}, +{99.1858, 21.0098, 8.79644}, +{100.790, 20.9978, 8.49581}, +{102.420, 20.9828, 8.16706}, +{104.077, 20.9254, 7.83561}, +{105.760, 20.8316, 7.51761}, +{107.471, 20.6981, 7.21250}, +{109.209, 20.5315, 6.97495}, +{110.975, 20.3879, 6.76890}, +{112.770, 20.2552, 6.56893}, +{114.594, 20.1193, 6.37486}, +{116.448, 19.9745, 6.18654}, +{118.331, 19.8219, 6.01704}, +{120.245, 19.6733, 5.85800}, +{122.190, 19.5238, 5.70317}, +{124.166, 19.3717, 5.55244}, +{126.175, 19.2194, 5.40568}, +{128.215, 19.0962, 5.24101}, +{130.289, 18.9163, 5.02374}, +{132.397, 18.6716, 4.81547}, +{134.538, 18.3368, 4.65529}, +{136.714, 18.0408, 4.59490}, +{138.925, 17.7643, 4.53529}, +{141.172, 17.4858, 4.47645}, +{143.456, 17.1848, 4.41838}, +{145.776, 16.8355, 4.41238}, +{148.134, 16.5220, 4.45484}, +{150.530, 16.2294, 4.49770}, +{152.964, 15.9331, 4.54099}, +{155.439, 15.6201, 4.58468}, +{157.953, 15.2536, 4.64434}, +{160.507, 14.9046, 4.79736}, +{163.103, 14.5783, 4.95542}, +{165.742, 14.2575, 5.11868}, +{168.422, 13.9229, 5.28732}, +{171.146, 13.5181, 5.50617}, +{173.915, 13.1645, 5.81309}, +{176.727, 12.8542, 6.13711}, +{179.586, 12.5629, 6.47920}, +{182.491, 12.2870, 6.84035}, +{185.442, 12.0260, 7.22425}, +{188.442, 11.7828, 7.63159}, +{191.489, 11.5587, 8.06187}, +{194.587, 11.3549, 8.51642}, +{197.734, 11.1765, 8.99660}, +{200.932, 11.0418, 9.49633}, +{204.182, 10.9248, 9.99704}, +{207.485, 10.8286, 10.5242}, +{210.840, 10.7719, 11.0791}, +{214.251, 10.8188, 11.6556}, +{217.716, 10.8711, 12.1153}, +{221.237, 10.8959, 12.5931}, +{224.816, 10.9268, 13.0897}, +{228.452, 10.9771, 13.6060}, +{232.147, 11.0689, 14.1426}, +{235.902, 11.2035, 14.6377}, +{239.717, 11.3288, 15.1200}, +{243.595, 11.4535, 15.6181}, +{247.535, 11.5993, 16.1327}, +{251.538, 11.8006, 16.6642}, +{255.607, 12.0193, 17.1345}, +{259.741, 12.2277, 17.6098}, +{263.942, 12.4476, 18.0983}, +{268.211, 12.6922, 18.6004}, +{272.549, 12.9864, 19.1164}, +{276.957, 13.3576, 19.5628}, +{281.437, 13.6892, 19.9461}, +{285.989, 13.9869, 20.3369}, +{290.615, 14.2836, 20.7353}, +{295.315, 14.5851, 21.1416}, +{300.092, 14.8975, 21.5558}, +{304.945, 15.2276, 21.9781}, +{309.878, 15.5942, 22.4087}, +{314.890, 15.9831, 22.7880}, +{319.983, 16.3610, 23.1566}, +{325.158, 16.7341, 23.5311}, +{330.418, 17.1169, 23.9117}, +{335.762, 17.5147, 24.2985}, +{341.192, 17.9349, 24.6915}, +{346.711, 18.3896, 25.0908}, +{352.319, 18.9274, 25.4931}, +{358.017, 19.4563, 25.7443}, +{363.808, 19.9485, 25.9981}, +{369.692, 20.4207, 26.2543}, +{375.672, 20.8904, 26.5131}, +{381.748, 21.3637, 26.7745}, +{387.922, 21.8467, 27.0384}, +{394.197, 22.3477, 27.3049}, +{400.573, 22.8913, 27.5740}, +{407.052, 23.4689, 27.7588}, +{413.635, 24.0088, 27.9017}, +{420.326, 24.5150, 28.0452}, +{427.124, 25.0126, 28.1895}, +{434.032, 25.5070, 28.3345}, +{441.052, 26.0028, 28.4802}, +{448.186, 26.5151, 28.6268}, +{455.435, 27.0441, 28.7421}, +{462.802, 27.5482, 28.8269}, +{470.287, 28.0361, 28.9120}, +{477.894, 28.5159, 28.9974}, +{485.623, 28.9911, 29.0829}, +{493.478, 29.4640, 29.1688}, +{501.459, 29.9364, 29.2549}, +{509.570, 30.4139, 29.3412}, +{517.812, 30.8927, 29.4178}, +{526.187, 31.3674, 29.4913}, +{534.698, 31.8415, 29.5649}, +{543.346, 32.3172, 29.6387}, +{552.134, 32.7965, 29.7127}, +{561.065, 33.2820, 29.7869}, +{570.139, 33.7827, 29.8571}, +{579.361, 34.2806, 29.9096}, +{588.732, 34.7773, 29.9623}, +{598.254, 35.2774, 30.0150}, +{607.930, 35.7840, 30.0678}, +{617.763, 36.3004, 30.1207}, +{627.755, 36.8307, 30.1737}, +{637.908, 37.3825, 30.2268}, +{648.226, 37.9798, 30.2800}, +{658.711, 38.6353, 30.2414}, +{669.365, 39.2385, 30.1231}, +{680.191, 39.7825, 30.0054}, +{691.193, 40.3066, 29.8880}, +{702.372, 40.8159, 29.7712}, +{713.733, 41.3141, 29.6548}, +{725.277, 41.7984, 29.5389}, +{737.008, 42.2802, 29.4357}, +{748.928, 42.7658, 29.3333}, +{761.042, 43.2546, 29.2313}, +{773.351, 43.7488, 29.1296}, +{785.859, 44.2504, 29.0283}, +{798.570, 44.7971, 28.9271}, +{811.486, 45.3349, 28.7522}, +{824.611, 45.8436, 28.5783}, +{837.949, 46.3465, 28.4055}, +{851.502, 46.8517, 28.2338}, +{865.274, 47.3632, 28.0631}, +{879.269, 47.9574, 27.8881}, +{893.491, 48.5208, 27.5753}, +{907.943, 49.0146, 27.2660}, +{922.628, 49.4847, 26.9602}, +{937.551, 49.9423, 26.6578}, +{952.715, 50.4046, 26.3588}, +{968.124, 50.8667, 26.0207}, +{983.783, 51.3012, 25.6649}, +{999.695, 51.7118, 25.3140}, +{1015.86, 52.1155, 24.9678}, +{1032.29, 52.5732, 24.6265}, +{1048.99, 53.0314, 24.1729}, +{1065.96, 53.3975, 23.6661}, +{1083.20, 53.7017, 23.1699}, +{1100.72, 53.9644, 22.6841}, +{1118.52, 54.1937, 22.2085}, +{1136.61, 54.3940, 21.7429}, +{1155.00, 54.5679, 21.2865}, +{1173.68, 54.7162, 20.8396}, +{1192.66, 54.8395, 20.4021}, +{1211.95, 54.9309, 19.9738}, +{1231.55, 54.9750, 19.5719}, +{1251.47, 55.0316, 19.2376}, +{1271.72, 55.1057, 18.9090}, +{1292.29, 55.1874, 18.5860}, +{1313.19, 55.2905, 18.2686}, +{1334.43, 55.3836, 17.8978}, +{1356.01, 55.4438, 17.5237}, +{1377.94, 55.4747, 17.1576}, +{1400.23, 55.4872, 16.7990}, +{1422.88, 55.4558, 16.4480}, +{1445.89, 55.4250, 16.1608}, +{1469.28, 55.4335, 15.8860}, +{1493.04, 55.5196, 15.6136}, +{1517.19, 55.5549, 15.1441}, +{1541.73, 55.4733, 14.6844}, +{1566.67, 55.2816, 14.2743}, +{1592.01, 55.0795, 13.9739}, +{1617.76, 54.9140, 13.6880}, +{1643.92, 54.7664, 13.4012}, +{1670.51, 54.5596, 13.0479}, +{1697.53, 54.2812, 12.7438}, +{1724.99, 54.0229, 12.5024}, +{1752.89, 53.7265, 12.2124}, +{1781.24, 53.3700, 12.0078}, +{1810.05, 53.0811, 11.8536}, +{1839.32, 52.7486, 11.5811}, +{1869.07, 52.3208, 11.3598}, +{1899.30, 51.9272, 11.2040}, +{1930.02, 51.5156, 10.9604}, +{1961.24, 50.9557, 10.6709}, +{1992.96, 50.2863, 10.4467}, +{2025.20, 49.5537, 10.2451}, +{2057.95, 48.6938, 10.0148}, +{2091.24, 47.6322, 9.77178}, +{2125.06, 46.2727, 9.52110}, +{2159.43, 44.4424, 9.28256}, +{2194.36, 41.7216, 9.02538}, +{2229.85, 35.6915, 11.1037}, +{2265.92, 35.3992, 20.1927}, +{2302.57, 35.5671, 21.3357}, +{2339.81, 37.0803, 28.3053}, +{2377.66, 41.8200, 29.9292}, +{2416.11, 45.3451, 30.3415}, +{2455.19, 47.4191, 30.1195}, +{2494.90, 49.1365, 30.0334}, +{2535.26, 50.6780, 29.7928}, +{2576.26, 51.8730, 29.3224}, +{2617.93, 52.4894, 28.9273}, +{2660.27, 53.2607, 29.0345}, +{2703.30, 52.9018, 28.6207}, +{2747.03, 52.9705, 30.9060}, +{2791.46, 55.2863, 31.8683}, +{2836.61, 57.3598, 31.4084}, +{2882.49, 58.6589, 31.0756}, +{2929.11, 59.9227, 30.6543}, +{2976.48, 60.9171, 30.0478}, +{3024.63, 61.7019, 29.5033}, +{3073.55, 62.3899, 29.0031}, +{3123.26, 62.7192, 28.4478}, +{3173.78, 63.1577, 28.7221}, +{3225.11, 64.2194, 28.8967}, +{3277.27, 65.2597, 28.3262}, +{3330.28, 66.0183, 27.8026}, +{3384.15, 66.5074, 27.2710}, +{3438.88, 66.9385, 27.1058}, +{3494.50, 67.9305, 26.9648}, +{3551.02, 68.8464, 26.2268}, +{3608.46, 69.3468, 25.6241}, +{3666.82, 69.8352, 25.0676}, +{3726.13, 70.2945, 24.5340}, +{3786.40, 70.7409, 24.0263}, +{3847.64, 71.1653, 23.4825}, +{3909.87, 71.5408, 22.9482}, +{3973.11, 71.8852, 22.4317}, +{4037.38, 72.2193, 21.9280}, +{4102.68, 72.5193, 21.4029}, +{4169.03, 72.8465, 20.9204}, +{4236.46, 72.9783, 20.2638}, +{4304.98, 73.0919, 19.9740}, +{4374.62, 73.3624, 19.5013}, +{4445.37, 73.5614, 19.0807}, +{4517.27, 73.7577, 18.6347}, +{4590.33, 73.9253, 18.2079}, +{4664.58, 74.0788, 17.7819}, +{4740.03, 74.2121, 17.3679}, +{4816.69, 74.3252, 16.9656}, +{4894.60, 74.4302, 16.5884}, +{4973.77, 74.5183, 16.2132}, +{5054.21, 74.6031, 15.8827}, +{5135.96, 74.7209, 15.5418}, +{5219.03, 74.7789, 15.1636}, +{5303.44, 74.9028, 14.9574}, +{5389.22, 75.0765, 14.5361}, +{5476.39, 75.1224, 14.1854}, +{5564.97, 75.1809, 13.8440}, +{5654.98, 75.2285, 13.5168}, +{5746.44, 75.2638, 13.2024}, +{5839.39, 75.3322, 12.9222}, +{5933.83, 75.3935, 12.5542}, +{6029.81, 75.4192, 12.2989}, +{6127.33, 75.4657, 11.9837}, +{6226.44, 75.4815, 11.6782}, +{6327.15, 75.4910, 11.3838}, +{6429.48, 75.4957, 11.0963}, +{6533.48, 75.4938, 10.8152}, +{6639.15, 75.4857, 10.5407}, +{6746.54, 75.4719, 10.2725}, +{6855.65, 75.4525, 10.0108}, +{6966.54, 75.4279, 9.75519}, +{7079.22, 75.3981, 9.50568}, +{7193.72, 75.3633, 9.26191}, +{7310.07, 75.3233, 9.02427}, +{7428.31, 75.2786, 8.79262}, +{7548.45, 75.2295, 8.56658}, +{7670.54, 75.1756, 8.34582}, +{7794.61, 75.1167, 8.13073}, +{7920.68, 75.0532, 7.92114}, +{8048.79, 74.9851, 7.71688}, +{8178.98, 74.9122, 7.51777}, +{8311.26, 74.8344, 7.32368}, +{8445.69, 74.7514, 7.13442}, +{8582.29, 74.6629, 6.95007}, +{8721.11, 74.5687, 6.77055}, +{8862.16, 74.4684, 6.59582}, +{9005.50, 74.3618, 6.42578}, +{9151.16, 74.2482, 6.26015}, +{9299.17, 74.1271, 6.09888}, +{9449.58, 73.9974, 5.94179}, +{9602.42, 73.8580, 5.78882}, +{9757.73, 73.7077, 5.63995}, +{9915.55, 73.5448, 5.49507}, +{10075.9, 73.3671, 5.35422}, +{10238.9, 73.1719, 5.21720}, +{10404.5, 72.9555, 5.08390}, +{10572.8, 72.7124, 4.95425}, +{10743.8, 72.4353, 4.82815}, +{10917.6, 72.1127, 4.70552}, +{11094.2, 71.7263, 4.58628}, +{11273.6, 71.2436, 4.47034}, +{11455.9, 70.5981, 4.35762}, +{11641.2, 69.6151, 4.24804}, +{11829.5, 67.4461, 4.14153}, +{11918.6, 54.2731, 4.09265}, +{11918.8, 54.2736, 10.2075}, +{12020.8, 67.8226, 10.0588}, +{12215.3, 69.8923, 9.78487}, +{12412.8, 70.8160, 9.51839}, +{12613.6, 71.3557, 9.25916}, +{12817.6, 71.6745, 9.00701}, +{13025.0, 71.8212, 8.76171}, +{13235.6, 71.7884, 8.52311}, +{13449.7, 71.4804, 8.29101}, +{13667.2, 70.2234, 8.06522}, +{13733.5, 63.7471, 7.99837}, +{13733.7, 63.7474, 11.1563}, +{13888.3, 71.2206, 10.9501}, +{14112.9, 72.1012, 10.6611}, +{14341.2, 71.3028, 10.3797}, +{14352.7, 69.3284, 10.3658}, +{14352.9, 69.3299, 11.9146}, +{14573.1, 73.2440, 11.6510}, +{14808.9, 74.0231, 11.3795}, +{15048.4, 74.5877, 11.1126}, +{15291.8, 75.0435, 10.8502}, +{15539.1, 75.4285, 10.5924}, +{15790.4, 75.7620, 10.3391}, +{16045.8, 76.0552, 10.0905}, +{16305.4, 76.3159, 9.84646}, +{16569.1, 76.5494, 9.60705}, +{16837.1, 76.7597, 9.37224}, +{17109.4, 76.9499, 9.14202}, +{17386.1, 77.1223, 8.91638}, +{17667.4, 77.2791, 8.69527}, +{17953.1, 77.4218, 8.47869}, +{18243.5, 77.5519, 8.26660}, +{18538.6, 77.6705, 8.05895}, +{18838.4, 77.7786, 7.85571}, +{19143.1, 77.8772, 7.65684}, +{19452.7, 77.9670, 7.46228}, +{19767.4, 78.0487, 7.27198}, +{20087.1, 78.1230, 7.08590}, +{20412.0, 78.1904, 6.90398}, +{20742.1, 78.2514, 6.72616}, +{21077.6, 78.3065, 6.55238}, +{21418.5, 78.3561, 6.38260}, +{21765.0, 78.4006, 6.21673}, +{22117.0, 78.4403, 6.05473}, +{22474.7, 78.4756, 5.89654}, +{22838.2, 78.5067, 5.74207}, +{23207.6, 78.5339, 5.59129}, +{23583.0, 78.5576, 5.44410}, +{23964.4, 78.5778, 5.30047}, +{24352.0, 78.5949, 5.16031}, +{24745.9, 78.6091, 5.02357}, +{25146.2, 78.6204, 4.89018}, +{25552.9, 78.6292, 4.76008}, +{25966.2, 78.6356, 4.63319}, +{26386.1, 78.6398, 4.50946}, +{26812.9, 78.6418, 4.38882}, +{27246.6, 78.6418, 4.27121}, +{27687.3, 78.6401, 4.15657}, +{28135.1, 78.6366, 4.04482}, +{28590.2, 78.6317, 3.93592}, +{29052.6, 78.6259, 3.82980}, +{29522.5, 78.6286, 3.72639}, +{30000.0, 78.5768, 3.62565}, +{0, 0, 0} +}; + +e_fp_fdp hg[] = { /* Z = 80 */ +{10.0000, -9999.00, 3.07253}, +{10.1617, -9999.00, 3.05926}, +{10.3261, -9999.00, 3.04605}, +{10.4931, -9999.00, 3.03290}, +{10.6628, -9999.00, 3.01980}, +{10.8353, -9999.00, 3.00676}, +{11.0106, -9999.00, 3.02448}, +{11.1886, -9999.00, 3.04517}, +{11.3696, -9999.00, 3.06600}, +{11.5535, -9999.00, 3.08698}, +{11.7404, -9999.00, 3.10809}, +{11.9303, -9999.00, 3.12935}, +{12.1232, -9999.00, 3.15076}, +{12.3193, -9999.00, 3.17232}, +{12.5186, -9999.00, 3.19402}, +{12.7210, -9999.00, 3.21587}, +{12.9268, -9999.00, 3.23787}, +{13.1359, -9999.00, 3.26085}, +{13.3483, -9999.00, 3.31333}, +{13.5642, -9999.00, 3.36666}, +{13.7836, -9999.00, 3.42084}, +{14.0066, -9999.00, 3.47590}, +{14.2331, -9999.00, 3.53184}, +{14.4633, -9999.00, 3.58869}, +{14.6973, -9999.00, 3.65454}, +{14.9350, -9999.00, 3.73332}, +{15.1765, -9999.00, 3.81379}, +{15.4220, -9999.00, 3.89600}, +{15.6714, -9999.00, 3.97997}, +{15.9249, -9999.00, 4.06576}, +{16.1825, -9999.00, 4.15340}, +{16.4442, -9999.00, 4.24293}, +{16.7102, -9999.00, 4.33519}, +{16.9805, -9999.00, 4.45018}, +{17.2551, -9999.00, 4.56822}, +{17.5342, -9999.00, 4.68938}, +{17.8178, -9999.00, 4.81377}, +{18.1060, -9999.00, 4.94145}, +{18.3989, -9999.00, 5.07252}, +{18.6964, -9999.00, 5.20707}, +{18.9988, -9999.00, 5.34518}, +{19.3061, -9999.00, 5.51386}, +{19.6184, -9999.00, 5.69102}, +{19.9357, -9999.00, 5.87388}, +{20.2582, -9999.00, 6.06261}, +{20.5858, -9999.00, 6.25741}, +{20.9188, -9999.00, 6.45846}, +{21.2571, -9999.00, 6.66597}, +{21.6009, -9999.00, 6.87867}, +{21.9503, -9999.00, 7.08674}, +{22.3053, -9999.00, 7.30111}, +{22.6661, -9999.00, 7.52194}, +{23.0327, -9999.00, 7.74947}, +{23.4053, -9999.00, 7.98388}, +{23.7838, -9999.00, 8.22538}, +{24.1685, -9999.00, 8.47418}, +{24.5594, -9999.00, 8.70989}, +{24.9566, -9999.00, 8.94366}, +{25.3603, -9999.00, 9.18369}, +{25.7705, -9999.00, 9.43017}, +{26.1873, -9999.00, 9.68326}, +{26.6109, -9999.00, 9.94314}, +{27.0413, -9999.00, 10.2100}, +{27.4786, -9999.00, 10.4840}, +{27.9231, -9999.00, 10.6960}, +{28.3747, -9999.00, 10.8885}, +{28.8337, -9999.00, 11.0844}, +{29.3000, -2.93636, 11.2839}, +{29.7739, -2.82752, 11.4869}, +{30.2555, -2.72514, 11.6937}, +{30.7449, -2.63802, 11.9041}, +{31.2421, -2.55260, 12.1628}, +{31.7475, -2.44187, 12.4307}, +{32.2609, -2.31430, 12.7044}, +{32.7827, -2.17221, 12.9842}, +{33.3130, -2.01396, 13.2702}, +{33.8518, -1.83052, 13.5624}, +{34.3993, -1.60296, 13.8400}, +{34.9557, -1.38915, 14.0749}, +{35.5211, -1.18659, 14.3138}, +{36.0956, -0.983485, 14.5567}, +{36.6794, -0.776467, 14.8038}, +{37.2727, -0.563204, 15.0550}, +{37.8755, -0.341447, 15.3105}, +{38.4882, -0.106965, 15.5704}, +{39.1107, 0.137915, 15.8220}, +{39.7432, 0.387243, 16.0766}, +{40.3861, 0.645140, 16.3352}, +{41.0393, 0.914610, 16.5980}, +{41.7031, 1.19814, 16.8650}, +{42.3776, 1.49891, 17.1363}, +{43.0630, 1.82133, 17.4120}, +{43.7595, 2.18172, 17.6921}, +{44.4673, 2.61967, 17.9286}, +{45.1865, 3.01355, 18.0966}, +{45.9174, 3.38479, 18.2661}, +{46.6600, 3.75367, 18.4373}, +{47.4147, 4.12552, 18.6101}, +{48.1816, 4.50445, 18.7845}, +{48.9609, 4.89454, 18.9605}, +{49.7528, 5.30093, 19.1381}, +{50.5576, 5.73231, 19.3175}, +{51.3753, 6.21753, 19.4985}, +{52.2062, 6.74634, 19.5662}, +{53.0506, 7.21448, 19.5987}, +{53.9087, 7.65316, 19.6312}, +{54.7806, 8.08237, 19.6638}, +{55.6667, 8.50732, 19.6964}, +{56.5670, 8.93235, 19.7291}, +{57.4820, 9.36215, 19.7618}, +{58.4117, 9.80141, 19.7869}, +{59.3564, 10.2413, 19.8062}, +{60.3165, 10.6888, 19.8256}, +{61.2921, 11.1503, 19.8450}, +{62.2834, 11.6344, 19.8644}, +{63.2908, 12.1598, 19.8838}, +{64.3145, 12.7887, 19.8664}, +{65.3547, 13.3718, 19.6566}, +{66.4118, 13.8844, 19.4490}, +{67.4859, 14.3651, 19.2436}, +{68.5775, 14.8534, 19.0404}, +{69.6867, 15.3342, 18.7511}, +{70.8138, 15.7500, 18.4478}, +{71.9591, 16.1220, 18.1495}, +{73.1230, 16.4617, 17.8608}, +{74.3057, 16.7907, 17.5907}, +{75.5076, 17.1141, 17.3247}, +{76.7289, 17.4366, 17.0627}, +{77.9699, 17.7770, 16.8047}, +{79.2310, 18.1279, 16.4741}, +{80.5125, 18.4198, 16.1232}, +{81.8147, 18.6727, 15.7799}, +{83.1380, 18.9035, 15.4438}, +{84.4827, 19.1171, 15.1149}, +{85.8491, 19.3178, 14.7930}, +{87.2377, 19.5115, 14.4779}, +{88.6487, 19.7142, 14.1521}, +{90.0825, 19.8816, 13.8075}, +{91.5395, 20.0262, 13.4713}, +{93.0201, 20.1549, 13.1433}, +{94.5246, 20.2718, 12.8233}, +{96.0535, 20.3804, 12.5110}, +{97.6071, 20.4879, 12.2064}, +{99.1858, 20.6145, 11.8844}, +{100.790, 20.7020, 11.5402}, +{102.420, 20.7619, 11.2059}, +{104.077, 20.8080, 10.8813}, +{105.760, 20.8450, 10.5661}, +{107.471, 20.8787, 10.2601}, +{109.209, 20.9207, 9.96286}, +{110.975, 21.0150, 9.65744}, +{112.770, 21.0519, 9.21341}, +{114.594, 21.0107, 8.78980}, +{116.448, 20.9153, 8.38567}, +{118.331, 20.7797, 8.00013}, +{120.245, 20.5986, 7.63230}, +{122.190, 20.3655, 7.32570}, +{124.166, 20.1586, 7.07301}, +{126.175, 19.9579, 6.82902}, +{128.215, 19.7529, 6.59344}, +{130.289, 19.5389, 6.36601}, +{132.397, 19.3067, 6.15042}, +{134.538, 19.0705, 5.95480}, +{136.714, 18.8285, 5.76540}, +{138.925, 18.5740, 5.58202}, +{141.172, 18.3009, 5.40449}, +{143.456, 18.0078, 5.24183}, +{145.776, 17.6951, 5.08750}, +{148.134, 17.3370, 4.93772}, +{150.530, 16.9642, 4.87215}, +{152.964, 16.5968, 4.81343}, +{155.439, 16.1891, 4.75541}, +{157.953, 15.7585, 4.80074}, +{160.507, 15.3789, 4.88434}, +{163.103, 15.0170, 4.96941}, +{165.742, 14.6506, 5.05595}, +{168.422, 14.2446, 5.14401}, +{171.146, 13.8178, 5.34539}, +{173.915, 13.4428, 5.58662}, +{176.727, 13.1055, 5.83872}, +{179.586, 12.7850, 6.10221}, +{182.491, 12.4721, 6.38004}, +{185.442, 12.1747, 6.67888}, +{188.442, 11.8911, 6.99172}, +{191.489, 11.6185, 7.31920}, +{194.587, 11.3553, 7.66203}, +{197.734, 11.1006, 8.02090}, +{200.932, 10.8491, 8.39660}, +{204.182, 10.6018, 8.80498}, +{207.485, 10.3776, 9.24485}, +{210.840, 10.1755, 9.70670}, +{214.251, 9.99568, 10.1916}, +{217.716, 9.84241, 10.7008}, +{221.237, 9.72237, 11.2353}, +{224.816, 9.65744, 11.7966}, +{228.452, 9.67730, 12.3066}, +{232.147, 9.66648, 12.7670}, +{235.902, 9.63102, 13.2447}, +{239.717, 9.60004, 13.7403}, +{243.595, 9.57798, 14.2544}, +{247.535, 9.56982, 14.7877}, +{251.538, 9.57959, 15.3410}, +{255.607, 9.61587, 15.9149}, +{259.741, 9.68755, 16.4896}, +{263.942, 9.76880, 17.0667}, +{268.211, 9.86372, 17.6640}, +{272.549, 9.98487, 18.2821}, +{276.957, 10.1389, 18.9220}, +{281.437, 10.3368, 19.5842}, +{285.989, 10.6552, 20.2337}, +{290.615, 10.9558, 20.7994}, +{295.315, 11.2374, 21.3809}, +{300.092, 11.5394, 21.9786}, +{304.945, 11.8723, 22.5931}, +{309.878, 12.2504, 23.2247}, +{314.890, 12.7374, 23.8741}, +{319.983, 13.2999, 24.3855}, +{325.158, 13.7962, 24.8196}, +{330.418, 14.2648, 25.2616}, +{335.762, 14.7313, 25.7113}, +{341.192, 15.2081, 26.1691}, +{346.711, 15.7048, 26.6351}, +{352.319, 16.2323, 27.1093}, +{358.017, 16.8589, 27.5920}, +{363.808, 17.4985, 27.9279}, +{369.692, 18.0880, 28.2467}, +{375.672, 18.6661, 28.5691}, +{381.748, 19.2505, 28.8953}, +{387.922, 19.8580, 29.2252}, +{394.197, 20.5309, 29.5132}, +{400.573, 21.1741, 29.7341}, +{407.052, 21.7883, 29.9566}, +{413.635, 22.4086, 30.1808}, +{420.326, 23.0509, 30.4067}, +{427.124, 23.7740, 30.6163}, +{434.032, 24.4563, 30.6744}, +{441.052, 25.0869, 30.7327}, +{448.186, 25.6884, 30.7910}, +{455.435, 26.2794, 30.8495}, +{462.802, 26.8671, 30.8918}, +{470.287, 27.4354, 30.9212}, +{477.894, 27.9875, 30.9511}, +{485.623, 28.5320, 30.9803}, +{493.478, 29.0712, 31.0094}, +{501.459, 29.6101, 31.0394}, +{509.570, 30.1554, 31.0701}, +{517.812, 30.7290, 31.0901}, +{526.187, 31.3162, 31.0700}, +{534.698, 31.8882, 30.9759}, +{543.346, 32.3903, 30.8452}, +{552.134, 32.8361, 30.7141}, +{561.065, 33.2198, 30.5774}, +{570.139, 33.4591, 30.4685}, +{579.361, 33.7198, 30.5723}, +{588.732, 34.0402, 30.7373}, +{598.254, 34.4509, 30.9423}, +{607.930, 34.9281, 31.1481}, +{617.763, 35.4674, 31.3552}, +{627.755, 36.0980, 31.5566}, +{637.908, 36.8035, 31.6736}, +{648.226, 37.5388, 31.6805}, +{658.711, 38.2116, 31.6143}, +{669.365, 38.8603, 31.5474}, +{680.191, 39.5124, 31.4605}, +{691.193, 40.1714, 31.3544}, +{702.372, 40.8575, 31.2131}, +{713.733, 41.5432, 30.9675}, +{725.277, 42.1324, 30.6518}, +{737.008, 42.6508, 30.3390}, +{748.928, 43.1150, 30.0291}, +{761.042, 43.5166, 29.7256}, +{773.351, 43.8360, 29.4628}, +{785.859, 44.1141, 29.3232}, +{798.570, 44.4848, 29.2847}, +{811.486, 44.9270, 29.2459}, +{824.611, 45.4263, 29.2069}, +{837.949, 46.0113, 29.1677}, +{851.502, 46.6760, 29.0223}, +{865.274, 47.3675, 28.7464}, +{879.269, 47.9452, 28.3570}, +{893.491, 48.4459, 27.9725}, +{907.943, 48.9030, 27.5928}, +{922.628, 49.3287, 27.2178}, +{937.551, 49.7291, 26.8459}, +{952.715, 50.1088, 26.4782}, +{968.124, 50.4715, 26.1148}, +{983.783, 50.8222, 25.7560}, +{999.695, 51.1671, 25.3966}, +{1015.86, 51.5171, 25.0362}, +{1032.29, 51.8379, 24.6260}, +{1048.99, 52.1235, 24.2223}, +{1065.96, 52.3824, 23.8254}, +{1083.20, 52.6210, 23.4346}, +{1100.72, 52.8415, 23.0498}, +{1118.52, 53.0454, 22.6709}, +{1136.61, 53.2341, 22.2982}, +{1155.00, 53.4086, 21.9311}, +{1173.68, 53.5691, 21.5694}, +{1192.66, 53.7165, 21.2137}, +{1211.95, 53.8517, 20.8634}, +{1231.55, 53.9746, 20.5183}, +{1251.47, 54.0854, 20.1785}, +{1271.72, 54.1847, 19.8441}, +{1292.29, 54.2724, 19.5146}, +{1313.19, 54.3488, 19.1907}, +{1334.43, 54.4145, 18.8717}, +{1356.01, 54.4691, 18.5574}, +{1377.94, 54.5127, 18.2481}, +{1400.23, 54.5456, 17.9437}, +{1422.88, 54.5678, 17.6439}, +{1445.89, 54.5800, 17.3489}, +{1469.28, 54.5839, 17.0567}, +{1493.04, 54.5797, 16.7661}, +{1517.19, 54.5589, 16.4667}, +{1541.73, 54.5183, 16.1707}, +{1566.67, 54.4587, 15.8797}, +{1592.01, 54.3815, 15.5938}, +{1617.76, 54.2865, 15.3129}, +{1643.92, 54.1734, 15.0371}, +{1670.51, 54.0415, 14.7659}, +{1697.53, 53.8893, 14.4994}, +{1724.99, 53.7206, 14.2373}, +{1752.89, 53.5270, 13.9699}, +{1781.24, 53.3017, 13.7038}, +{1810.05, 53.0420, 13.4398}, +{1839.32, 52.7442, 13.1809}, +{1869.07, 52.4057, 12.9270}, +{1899.30, 52.0210, 12.6778}, +{1930.02, 51.5831, 12.4336}, +{1961.24, 51.0832, 12.1941}, +{1992.96, 50.5065, 11.9589}, +{2025.20, 49.8471, 11.7349}, +{2057.95, 49.0744, 11.5020}, +{2091.24, 48.1461, 11.2713}, +{2125.06, 47.0124, 11.0446}, +{2159.43, 45.5838, 10.8203}, +{2194.36, 43.6910, 10.5992}, +{2229.85, 40.9486, 10.3814}, +{2265.92, 36.0137, 10.1666}, +{2294.80, 4.47859, 10.0002}, +{2295.00, 4.48259, 27.3119}, +{2302.57, 28.0765, 27.1770}, +{2339.81, 36.1542, 26.5292}, +{2377.66, 33.2392, 25.8985}, +{2384.80, 17.9606, 25.7823}, +{2385.00, 17.9772, 37.4002}, +{2416.11, 41.1985, 36.7442}, +{2455.19, 46.0133, 35.9479}, +{2494.90, 49.0628, 35.1690}, +{2535.26, 51.3245, 34.4084}, +{2576.26, 53.1038, 33.6654}, +{2617.93, 54.5369, 32.9389}, +{2660.27, 55.6914, 32.2297}, +{2703.30, 56.5898, 31.5355}, +{2747.03, 57.2059, 30.8580}, +{2791.46, 57.3883, 30.1958}, +{2836.61, 55.9116, 29.5479}, +{2847.00, 49.2960, 29.4022}, +{2847.20, 49.3010, 34.0195}, +{2882.49, 58.6253, 33.4451}, +{2929.11, 60.6396, 32.7114}, +{2976.48, 61.9905, 31.9945}, +{3024.63, 63.0513, 31.2940}, +{3073.55, 63.9245, 30.6098}, +{3123.26, 64.6466, 29.9407}, +{3173.78, 65.2194, 29.2878}, +{3225.11, 65.5799, 28.6498}, +{3277.27, 64.3315, 28.0253}, +{3278.40, 63.0838, 28.0121}, +{3278.60, 63.0866, 29.5921}, +{3330.28, 66.8045, 28.9393}, +{3384.15, 67.6547, 28.2846}, +{3438.88, 68.2680, 27.6458}, +{3494.50, 68.6972, 27.0222}, +{3551.02, 68.6258, 26.4112}, +{3561.50, 67.1150, 26.3005}, +{3561.70, 67.1168, 27.3823}, +{3608.46, 69.6498, 26.9033}, +{3666.82, 70.4013, 26.3256}, +{3726.13, 70.9957, 25.7572}, +{3786.40, 71.5108, 25.1948}, +{3847.64, 71.9710, 24.6429}, +{3909.87, 72.3896, 24.0991}, +{3973.11, 72.7736, 23.5643}, +{4037.38, 73.1265, 23.0364}, +{4102.68, 73.4511, 22.5185}, +{4169.03, 73.7511, 22.0090}, +{4236.46, 74.0282, 21.5088}, +{4304.98, 74.2847, 21.0175}, +{4374.62, 74.5222, 20.5352}, +{4445.37, 74.7416, 20.0608}, +{4517.27, 74.9438, 19.5963}, +{4590.33, 75.1308, 19.1400}, +{4664.58, 75.3026, 18.6925}, +{4740.03, 75.4606, 18.2538}, +{4816.69, 75.6054, 17.8237}, +{4894.60, 75.7379, 17.4022}, +{4973.77, 75.8587, 16.9891}, +{5054.21, 75.9684, 16.5845}, +{5135.96, 76.0676, 16.1884}, +{5219.03, 76.1570, 15.8005}, +{5303.44, 76.2369, 15.4207}, +{5389.22, 76.3078, 15.0491}, +{5476.39, 76.3703, 14.6855}, +{5564.97, 76.4249, 14.3298}, +{5654.98, 76.4716, 13.9818}, +{5746.44, 76.5112, 13.6416}, +{5839.39, 76.5438, 13.3089}, +{5933.83, 76.5699, 12.9836}, +{6029.81, 76.5896, 12.6656}, +{6127.33, 76.6032, 12.3550}, +{6226.44, 76.6112, 12.0514}, +{6327.15, 76.6137, 11.7549}, +{6429.48, 76.6109, 11.4651}, +{6533.48, 76.6029, 11.1820}, +{6639.15, 76.5902, 10.9058}, +{6746.54, 76.5728, 10.6360}, +{6855.65, 76.5509, 10.3725}, +{6966.54, 76.5245, 10.1153}, +{7079.22, 76.4940, 9.86417}, +{7193.72, 76.4592, 9.61900}, +{7310.07, 76.4203, 9.37981}, +{7428.31, 76.3774, 9.14631}, +{7548.45, 76.3304, 8.91864}, +{7670.54, 76.2797, 8.69658}, +{7794.61, 76.2251, 8.47975}, +{7920.68, 76.1665, 8.26849}, +{8048.79, 76.1041, 8.06206}, +{8178.98, 76.0374, 7.86075}, +{8311.26, 75.9666, 7.66473}, +{8445.69, 75.8919, 7.47362}, +{8582.29, 75.8126, 7.28674}, +{8721.11, 75.7284, 7.10497}, +{8862.16, 75.6398, 6.92776}, +{9005.50, 75.5459, 6.75475}, +{9151.16, 75.4463, 6.58634}, +{9299.17, 75.3410, 6.42200}, +{9449.58, 75.2289, 6.26186}, +{9602.42, 75.1098, 6.10574}, +{9757.73, 74.9829, 5.95350}, +{9915.55, 74.8478, 5.80493}, +{10075.9, 74.7019, 5.65634}, +{10238.9, 74.5409, 5.51188}, +{10404.5, 74.3644, 5.37147}, +{10572.8, 74.1699, 5.23498}, +{10743.8, 73.9534, 5.10236}, +{10917.6, 73.7098, 4.97348}, +{11094.2, 73.4312, 4.84827}, +{11273.6, 73.1060, 4.72664}, +{11455.9, 72.7147, 4.60849}, +{11641.2, 72.2226, 4.49375}, +{11829.5, 71.5569, 4.38232}, +{12020.8, 70.5173, 4.27413}, +{12215.3, 67.9670, 4.16909}, +{12283.8, 55.3552, 4.13308}, +{12284.0, 55.3557, 10.2207}, +{12412.8, 69.3063, 10.0367}, +{12613.6, 71.1192, 9.76032}, +{12817.6, 71.9849, 9.49152}, +{13025.0, 72.5012, 9.23011}, +{13235.6, 72.8108, 8.97592}, +{13449.7, 72.9582, 8.72873}, +{13667.2, 72.9382, 8.48834}, +{13888.3, 72.6709, 8.25459}, +{14112.9, 71.6735, 8.02726}, +{14208.6, 64.9078, 7.93341}, +{14208.8, 64.9081, 11.0648}, +{14341.2, 72.1631, 10.9036}, +{14573.1, 73.2426, 10.6301}, +{14808.9, 73.3770, 10.3636}, +{14839.2, 73.7230, 10.3301}, +{14839.4, 73.7211, 11.8309}, +{15048.4, 73.5579, 11.5967}, +{15291.8, 74.7972, 11.3337}, +{15539.1, 75.4312, 11.0746}, +{15790.4, 75.9158, 10.8193}, +{16045.8, 76.3168, 10.5681}, +{16305.4, 76.6606, 10.3209}, +{16569.1, 76.9613, 10.0778}, +{16837.1, 77.2279, 9.83877}, +{17109.4, 77.4663, 9.60395}, +{17386.1, 77.6809, 9.37331}, +{17667.4, 77.8749, 9.14687}, +{17953.1, 78.0509, 8.92464}, +{18243.5, 78.2111, 8.70661}, +{18538.6, 78.3570, 8.49278}, +{18838.4, 78.4901, 8.28314}, +{19143.1, 78.6116, 8.07768}, +{19452.7, 78.7225, 7.87637}, +{19767.4, 78.8238, 7.67918}, +{20087.1, 78.9162, 7.48608}, +{20412.0, 79.0005, 7.29705}, +{20742.1, 79.0772, 7.11204}, +{21077.6, 79.1469, 6.93101}, +{21418.5, 79.2102, 6.75393}, +{21765.0, 79.2675, 6.58074}, +{22117.0, 79.3192, 6.41141}, +{22474.7, 79.3657, 6.24587}, +{22838.2, 79.4073, 6.08408}, +{23207.6, 79.4444, 5.92598}, +{23583.0, 79.4773, 5.77152}, +{23964.4, 79.5062, 5.62065}, +{24352.0, 79.5315, 5.47331}, +{24745.9, 79.5533, 5.32944}, +{25146.2, 79.5718, 5.18898}, +{25552.9, 79.5873, 5.05189}, +{25966.2, 79.6000, 4.91808}, +{26386.1, 79.6100, 4.78752}, +{26812.9, 79.6176, 4.66013}, +{27246.6, 79.6228, 4.53586}, +{27687.3, 79.6259, 4.41466}, +{28135.1, 79.6270, 4.29645}, +{28590.2, 79.6264, 4.18118}, +{29052.6, 79.6246, 4.06880}, +{29522.5, 79.6317, 3.95924}, +{30000.0, 79.5807, 3.85244}, +{0, 0, 0} +}; + +e_fp_fdp tl[] = { /* Z = 81 */ +{10.0000, -9999.00, 1.80392}, +{10.1617, -9999.00, 1.75555}, +{10.3261, -9999.00, 1.69589}, +{10.4931, -9999.00, 1.59546}, +{10.6628, -9999.00, 1.46625}, +{10.8353, -9999.00, 1.39341}, +{11.0106, -9999.00, 1.31349}, +{11.1886, -9999.00, 1.20783}, +{11.3696, -9999.00, 1.13261}, +{11.5535, -9999.00, 1.07387}, +{11.7404, -9999.00, 1.03850}, +{11.9303, -9999.00, 1.04678}, +{12.1232, -9999.00, 1.05513}, +{12.3193, -9999.00, 1.09785}, +{12.5186, -9999.00, 1.15076}, +{12.7210, -9999.00, 1.28282}, +{12.9268, -9999.00, 1.45410}, +{13.1359, -9999.00, 1.64367}, +{13.3483, -9999.00, 1.87325}, +{13.5642, -9999.00, 2.14093}, +{13.7836, -9999.00, 2.33822}, +{14.0066, -9999.00, 2.53817}, +{14.2331, -9999.00, 2.75523}, +{14.4633, -9999.00, 2.89712}, +{14.6973, -9999.00, 2.99769}, +{14.9350, -9999.00, 3.10175}, +{15.1765, -9999.00, 3.18064}, +{15.4220, -9999.00, 3.25475}, +{15.6714, -9999.00, 3.25438}, +{15.9249, -9999.00, 3.24810}, +{16.1825, -9999.00, 3.24403}, +{16.4442, -9999.00, 3.26317}, +{16.7102, -9999.00, 3.28242}, +{16.9805, -9999.00, 3.30178}, +{17.2551, -9999.00, 3.32126}, +{17.5342, -9999.00, 3.36412}, +{17.8178, -9999.00, 3.41627}, +{18.1060, -9999.00, 3.46924}, +{18.3989, -9999.00, 3.52303}, +{18.6964, -9999.00, 3.57765}, +{18.9988, -9999.00, 3.63312}, +{19.3061, -9999.00, 3.68945}, +{19.6184, -9999.00, 3.74665}, +{19.9357, -9999.00, 3.83874}, +{20.2582, -9999.00, 3.95506}, +{20.5858, -9999.00, 4.07491}, +{20.9188, -9999.00, 4.19839}, +{21.2571, -9999.00, 4.32562}, +{21.6009, -9999.00, 4.45669}, +{21.9503, -9999.00, 4.59256}, +{22.3053, -9999.00, 4.76042}, +{22.6661, -9999.00, 4.93442}, +{23.0327, -9999.00, 5.11478}, +{23.4053, -9999.00, 5.30173}, +{23.7838, -9999.00, 5.49551}, +{24.1685, -9999.00, 5.69638}, +{24.5594, -9999.00, 5.90459}, +{24.9566, -9999.00, 6.12041}, +{25.3603, -9999.00, 6.34412}, +{25.7705, -9999.00, 6.57600}, +{26.1873, -9999.00, 6.82627}, +{26.6109, -9999.00, 7.09248}, +{27.0413, -9999.00, 7.36908}, +{27.4786, -9999.00, 7.65647}, +{27.9231, -9999.00, 7.95507}, +{28.3747, -9999.00, 8.26531}, +{28.8337, -9999.00, 8.58765}, +{29.3000, -3.60735, 8.90399}, +{29.7739, -3.59085, 9.22126}, +{30.2555, -3.57211, 9.54983}, +{30.7449, -3.54353, 9.89012}, +{31.2421, -3.50301, 10.2425}, +{31.7475, -3.44740, 10.6075}, +{32.2609, -3.36083, 10.9854}, +{32.7827, -3.24606, 11.3505}, +{33.3130, -3.13365, 11.6961}, +{33.8518, -3.02081, 12.0522}, +{34.3993, -2.89864, 12.4192}, +{34.9557, -2.76144, 12.7973}, +{35.5211, -2.60355, 13.1870}, +{36.0956, -2.40940, 13.5885}, +{36.6794, -2.16997, 13.9552}, +{37.2727, -1.93767, 14.2824}, +{37.8755, -1.72466, 14.6172}, +{38.4882, -1.50558, 14.9600}, +{39.1107, -1.27642, 15.3107}, +{39.7432, -1.03422, 15.6697}, +{40.3861, -0.744304, 16.0340}, +{41.0393, -0.449328, 16.3523}, +{41.7031, -0.169505, 16.6771}, +{42.3776, 0.118504, 17.0082}, +{43.0630, 0.418172, 17.3459}, +{43.7595, 0.734388, 17.6904}, +{44.4673, 1.07312, 18.0416}, +{45.1865, 1.45427, 18.3999}, +{45.9174, 1.86445, 18.7064}, +{46.6600, 2.26842, 18.9914}, +{47.4147, 2.66665, 19.2808}, +{48.1816, 3.07847, 19.5746}, +{48.9609, 3.51206, 19.8729}, +{49.7528, 3.99169, 20.1757}, +{50.5576, 4.50584, 20.4109}, +{51.3753, 5.00380, 20.6080}, +{52.2062, 5.48214, 20.8071}, +{53.0506, 5.96683, 21.0081}, +{53.9087, 6.46576, 21.2110}, +{54.7806, 7.00078, 21.4159}, +{55.6667, 7.55170, 21.5627}, +{56.5670, 8.09178, 21.6939}, +{57.4820, 8.62719, 21.8258}, +{58.4117, 9.17350, 21.9586}, +{59.3564, 9.73749, 22.0922}, +{60.3165, 10.3276, 22.2266}, +{61.2921, 10.9554, 22.3618}, +{62.2834, 11.6212, 22.4979}, +{63.2908, 12.5465, 22.6348}, +{64.3145, 13.4545, 22.3675}, +{65.3547, 14.1420, 22.0606}, +{66.4118, 14.7531, 21.7578}, +{67.4859, 15.3127, 21.4592}, +{68.5775, 15.8349, 21.1647}, +{69.6867, 16.3290, 20.8742}, +{70.8138, 16.8019, 20.5878}, +{71.9591, 17.2597, 20.3052}, +{73.1230, 17.7091, 20.0266}, +{74.3057, 18.1600, 19.7517}, +{75.5076, 18.6433, 19.4807}, +{76.7289, 19.1508, 19.1099}, +{77.9699, 19.5891, 18.6648}, +{79.2310, 19.9416, 18.2301}, +{80.5125, 20.2554, 17.8055}, +{81.8147, 20.5357, 17.3908}, +{83.1380, 20.7813, 16.9873}, +{84.4827, 21.0108, 16.6140}, +{85.8491, 21.2329, 16.2488}, +{87.2377, 21.4457, 15.8917}, +{88.6487, 21.6507, 15.5425}, +{90.0825, 21.8638, 15.2009}, +{91.5395, 22.0822, 14.8415}, +{93.0201, 22.2700, 14.4509}, +{94.5246, 22.4279, 14.0706}, +{96.0535, 22.5694, 13.7003}, +{97.6071, 22.7012, 13.3397}, +{99.1858, 22.8316, 12.9886}, +{100.790, 22.9928, 12.6467}, +{102.420, 23.1302, 12.2105}, +{104.077, 23.2093, 11.7820}, +{105.760, 23.2520, 11.3685}, +{107.471, 23.2720, 10.9696}, +{109.209, 23.2754, 10.5846}, +{110.975, 23.2643, 10.2132}, +{112.770, 23.2870, 9.85479}, +{114.594, 23.2899, 9.42251}, +{116.448, 23.2141, 8.98371}, +{118.331, 23.0911, 8.56533}, +{120.245, 22.9277, 8.16642}, +{122.190, 22.7129, 7.78611}, +{124.166, 22.4420, 7.48454}, +{126.175, 22.1940, 7.27114}, +{128.215, 21.9951, 7.06382}, +{130.289, 21.8033, 6.86241}, +{132.397, 21.6158, 6.66676}, +{134.538, 21.4332, 6.47667}, +{136.714, 21.2503, 6.27829}, +{138.925, 21.0540, 6.07720}, +{141.172, 20.8415, 5.88257}, +{143.456, 20.6164, 5.69416}, +{145.776, 20.3759, 5.51179}, +{148.134, 20.1201, 5.33834}, +{150.530, 19.8483, 5.17084}, +{152.964, 19.5576, 5.00858}, +{155.439, 19.2086, 4.85142}, +{157.953, 18.8428, 4.76902}, +{160.507, 18.4990, 4.69974}, +{163.103, 18.1467, 4.63145}, +{165.742, 17.7107, 4.56417}, +{168.422, 17.2654, 4.62458}, +{171.146, 16.8776, 4.69982}, +{173.915, 16.4750, 4.77628}, +{176.727, 16.0604, 4.91457}, +{179.586, 15.6700, 5.08598}, +{182.491, 15.2707, 5.26337}, +{185.442, 14.8614, 5.50079}, +{188.442, 14.4953, 5.80892}, +{191.489, 14.1826, 6.13429}, +{194.587, 13.9044, 6.44786}, +{197.734, 13.6338, 6.75972}, +{200.932, 13.3647, 7.08668}, +{204.182, 13.1055, 7.42943}, +{207.485, 12.8554, 7.79000}, +{210.840, 12.6175, 8.16932}, +{214.251, 12.3921, 8.56710}, +{217.716, 12.1811, 8.98426}, +{221.237, 11.9901, 9.42171}, +{224.816, 11.8202, 9.87125}, +{228.452, 11.6607, 10.3273}, +{232.147, 11.5119, 10.8045}, +{235.902, 11.3790, 11.3037}, +{239.717, 11.2675, 11.8260}, +{243.595, 11.1829, 12.3724}, +{247.535, 11.1481, 12.9441}, +{251.538, 11.1393, 13.4744}, +{255.607, 11.1295, 14.0252}, +{259.741, 11.1382, 14.5985}, +{263.942, 11.1758, 15.1953}, +{268.211, 11.2756, 15.8164}, +{272.549, 11.4408, 16.4144}, +{276.957, 11.6071, 16.9342}, +{281.437, 11.7525, 17.4704}, +{285.989, 11.9056, 18.0236}, +{290.615, 12.0781, 18.5943}, +{295.315, 12.2799, 19.1830}, +{300.092, 12.5409, 19.7905}, +{304.945, 12.8358, 20.3246}, +{309.878, 13.1172, 20.8619}, +{314.890, 13.4081, 21.4135}, +{319.983, 13.7261, 21.9796}, +{325.158, 14.0897, 22.5607}, +{330.418, 14.5435, 23.1497}, +{335.762, 15.0219, 23.5754}, +{341.192, 15.4426, 24.0090}, +{346.711, 15.8571, 24.4505}, +{352.319, 16.2792, 24.9002}, +{358.017, 16.7193, 25.3581}, +{363.808, 17.1989, 25.8245}, +{369.692, 17.7166, 26.2369}, +{375.672, 18.2225, 26.6180}, +{381.748, 18.7144, 27.0045}, +{387.922, 19.2187, 27.3968}, +{394.197, 19.7421, 27.7947}, +{400.573, 20.2933, 28.1984}, +{407.052, 20.9142, 28.6079}, +{413.635, 21.6132, 28.9645}, +{420.326, 22.2959, 29.1579}, +{427.124, 22.9090, 29.3526}, +{434.032, 23.5025, 29.5486}, +{441.052, 24.0902, 29.7459}, +{448.186, 24.6886, 29.9446}, +{455.435, 25.3113, 30.1325}, +{462.802, 25.9345, 30.2524}, +{470.287, 26.5249, 30.3622}, +{477.894, 27.0982, 30.4723}, +{485.623, 27.6670, 30.5837}, +{493.478, 28.2373, 30.6957}, +{501.459, 28.8140, 30.8076}, +{509.570, 29.4095, 30.9188}, +{517.812, 30.0299, 31.0181}, +{526.187, 30.6984, 31.0744}, +{534.698, 31.3615, 31.0423}, +{543.346, 31.9556, 30.9666}, +{552.134, 32.5154, 30.8929}, +{561.065, 33.0585, 30.8085}, +{570.139, 33.5839, 30.7141}, +{579.361, 34.0825, 30.5851}, +{588.732, 34.5372, 30.4485}, +{598.254, 34.9478, 30.3071}, +{607.930, 35.3107, 30.1654}, +{617.763, 35.6012, 30.0245}, +{627.755, 35.7849, 29.9009}, +{637.908, 35.8054, 29.9840}, +{648.226, 35.8843, 30.3415}, +{658.711, 36.2366, 30.8886}, +{669.365, 36.8620, 31.4453}, +{680.191, 37.7399, 31.7899}, +{691.193, 38.6649, 31.9466}, +{702.372, 39.5971, 31.9118}, +{713.733, 40.4693, 31.7198}, +{725.277, 41.1881, 31.4210}, +{737.008, 41.8012, 31.1249}, +{748.928, 42.3386, 30.8313}, +{761.042, 42.8057, 30.5443}, +{773.351, 43.1592, 30.3009}, +{785.859, 43.4750, 30.1925}, +{798.570, 43.8815, 30.1950}, +{811.486, 44.3649, 30.1972}, +{824.611, 44.9071, 30.1989}, +{837.949, 45.5249, 30.2004}, +{851.502, 46.2524, 30.0957}, +{865.274, 46.9821, 29.8592}, +{879.269, 47.6098, 29.5075}, +{893.491, 48.1566, 29.1594}, +{907.943, 48.6578, 28.8151}, +{922.628, 49.1211, 28.4746}, +{937.551, 49.5578, 28.1606}, +{952.715, 49.9893, 27.8559}, +{968.124, 50.4199, 27.5597}, +{983.783, 50.8563, 27.2661}, +{999.695, 51.3089, 26.9625}, +{1015.86, 51.7871, 26.6483}, +{1032.29, 52.2509, 26.2064}, +{1048.99, 52.6318, 25.7701}, +{1065.96, 52.9733, 25.3402}, +{1083.20, 53.2848, 24.9165}, +{1100.72, 53.5706, 24.4998}, +{1118.52, 53.8348, 24.0898}, +{1136.61, 54.0793, 23.6859}, +{1155.00, 54.3055, 23.2886}, +{1173.68, 54.5151, 22.8976}, +{1192.66, 54.7091, 22.5126}, +{1211.95, 54.8880, 22.1336}, +{1231.55, 55.0528, 21.7607}, +{1251.47, 55.2039, 21.3936}, +{1271.72, 55.3419, 21.0325}, +{1292.29, 55.4674, 20.6770}, +{1313.19, 55.5807, 20.3271}, +{1334.43, 55.6819, 19.9828}, +{1356.01, 55.7714, 19.6440}, +{1377.94, 55.8494, 19.3102}, +{1400.23, 55.9158, 18.9821}, +{1422.88, 55.9717, 18.6594}, +{1445.89, 56.0172, 18.3412}, +{1469.28, 56.0524, 18.0271}, +{1493.04, 56.0781, 17.7164}, +{1517.19, 56.0915, 17.4018}, +{1541.73, 56.0865, 17.0916}, +{1566.67, 56.0662, 16.7867}, +{1592.01, 56.0312, 16.4868}, +{1617.76, 55.9809, 16.1920}, +{1643.92, 55.9156, 15.9023}, +{1670.51, 55.8349, 15.6177}, +{1697.53, 55.7384, 15.3379}, +{1724.99, 55.6305, 15.0625}, +{1752.89, 55.5052, 14.7797}, +{1781.24, 55.3505, 14.4978}, +{1810.05, 55.1690, 14.2176}, +{1839.32, 54.9571, 13.9426}, +{1869.07, 54.7146, 13.6730}, +{1899.30, 54.4389, 13.4088}, +{1930.02, 54.1264, 13.1494}, +{1961.24, 53.7719, 12.8948}, +{1992.96, 53.3683, 12.6450}, +{2025.20, 52.9154, 12.4076}, +{2057.95, 52.4022, 12.1587}, +{2091.24, 51.7986, 11.9122}, +{2125.06, 51.0927, 11.6688}, +{2159.43, 50.2560, 11.4290}, +{2194.36, 49.2467, 11.1920}, +{2229.85, 47.9971, 10.9583}, +{2265.92, 46.3885, 10.7275}, +{2302.57, 44.1789, 10.5001}, +{2339.81, 40.7209, 10.2756}, +{2377.66, 32.2804, 10.0544}, +{2389.20, 6.21254, 9.98852}, +{2389.40, 6.21245, 27.0870}, +{2416.11, 35.9075, 26.6392}, +{2455.19, 38.2467, 26.0060}, +{2485.00, 19.5355, 25.5397}, +{2485.20, 19.5618, 37.3682}, +{2494.90, 37.1323, 37.1569}, +{2535.26, 45.3925, 36.2991}, +{2576.26, 49.2219, 35.4615}, +{2617.93, 51.8694, 34.6441}, +{2660.27, 53.8871, 33.8466}, +{2703.30, 55.4864, 33.0684}, +{2747.03, 56.7668, 32.3086}, +{2791.46, 57.7734, 31.5684}, +{2836.61, 58.5050, 30.8453}, +{2882.49, 58.8741, 30.1398}, +{2929.11, 58.4015, 29.4506}, +{2956.50, 50.7116, 29.0581}, +{2956.70, 50.7162, 33.6655}, +{2976.48, 58.8603, 33.3492}, +{3024.63, 61.4660, 32.6002}, +{3073.55, 62.9593, 31.8677}, +{3123.26, 64.0906, 31.1518}, +{3173.78, 65.0109, 30.4543}, +{3225.11, 65.7745, 29.7718}, +{3277.27, 66.3968, 29.1070}, +{3330.28, 66.8588, 28.4563}, +{3384.15, 66.9995, 27.8221}, +{3415.60, 64.4586, 27.4628}, +{3415.80, 64.4611, 29.0411}, +{3438.88, 67.4463, 28.7615}, +{3494.50, 68.5738, 28.1061}, +{3551.02, 69.2768, 27.4677}, +{3608.46, 69.7929, 26.8441}, +{3666.82, 70.0800, 26.2344}, +{3704.00, 68.6135, 25.8581}, +{3704.20, 68.6150, 26.8044}, +{3726.13, 70.4213, 26.5959}, +{3786.40, 71.2870, 26.0374}, +{3847.64, 71.8933, 25.4847}, +{3909.87, 72.4094, 24.9406}, +{3973.11, 72.8708, 24.4042}, +{4037.38, 73.2900, 23.8741}, +{4102.68, 73.6726, 23.3509}, +{4169.03, 74.0245, 22.8368}, +{4236.46, 74.3506, 22.3311}, +{4304.98, 74.6528, 21.8323}, +{4374.62, 74.9313, 21.3413}, +{4445.37, 75.1893, 20.8595}, +{4517.27, 75.4286, 20.3855}, +{4590.33, 75.6503, 19.9198}, +{4664.58, 75.8549, 19.4621}, +{4740.03, 76.0440, 19.0128}, +{4816.69, 76.2183, 18.5718}, +{4894.60, 76.3788, 18.1391}, +{4973.77, 76.5261, 17.7143}, +{5054.21, 76.6609, 17.2980}, +{5135.96, 76.7841, 16.8898}, +{5219.03, 76.8962, 16.4898}, +{5303.44, 76.9979, 16.0979}, +{5389.22, 77.0896, 15.7138}, +{5476.39, 77.1716, 15.3376}, +{5564.97, 77.2448, 14.9696}, +{5654.98, 77.3096, 14.6092}, +{5746.44, 77.3661, 14.2564}, +{5839.39, 77.4149, 13.9112}, +{5933.83, 77.4563, 13.5736}, +{6029.81, 77.4908, 13.2434}, +{6127.33, 77.5186, 12.9206}, +{6226.44, 77.5400, 12.6048}, +{6327.15, 77.5553, 12.2964}, +{6429.48, 77.5650, 11.9949}, +{6533.48, 77.5690, 11.7000}, +{6639.15, 77.5675, 11.4121}, +{6746.54, 77.5610, 11.1309}, +{6855.65, 77.5496, 10.8563}, +{6966.54, 77.5335, 10.5881}, +{7079.22, 77.5128, 10.3260}, +{7193.72, 77.4874, 10.0702}, +{7310.07, 77.4579, 9.82072}, +{7428.31, 77.4243, 9.57694}, +{7548.45, 77.3862, 9.33922}, +{7670.54, 77.3443, 9.10735}, +{7794.61, 77.2986, 8.88107}, +{7920.68, 77.2489, 8.66026}, +{8048.79, 77.1952, 8.44462}, +{8178.98, 77.1374, 8.23456}, +{8311.26, 77.0759, 8.02967}, +{8445.69, 77.0103, 7.82977}, +{8582.29, 76.9405, 7.63486}, +{8721.11, 76.8665, 7.44478}, +{8862.16, 76.7882, 7.25975}, +{9005.50, 76.7055, 7.07902}, +{9151.16, 76.6178, 6.90326}, +{9299.17, 76.5254, 6.73167}, +{9449.58, 76.4274, 6.56427}, +{9602.42, 76.3237, 6.40131}, +{9757.73, 76.2141, 6.24246}, +{9915.55, 76.0991, 6.08778}, +{10075.9, 75.9771, 5.93012}, +{10238.9, 75.8404, 5.77671}, +{10404.5, 75.6919, 5.62747}, +{10572.8, 75.5296, 5.48228}, +{10743.8, 75.3517, 5.34106}, +{10917.6, 75.1552, 5.20372}, +{11094.2, 74.9362, 5.07016}, +{11273.6, 74.6890, 4.94029}, +{11455.9, 74.4056, 4.81403}, +{11641.2, 74.0733, 4.69128}, +{11829.5, 73.6713, 4.57196}, +{12020.8, 73.1616, 4.45600}, +{12215.3, 72.4622, 4.34329}, +{12412.8, 71.3355, 4.23377}, +{12613.6, 68.0599, 4.12734}, +{12657.4, 56.2604, 4.10472}, +{12657.6, 56.2610, 10.2136}, +{12817.6, 70.6878, 9.98918}, +{13025.0, 72.2894, 9.70969}, +{13235.6, 73.0984, 9.43803}, +{13449.7, 73.5876, 9.17398}, +{13667.2, 73.8811, 8.91731}, +{13888.3, 74.0185, 8.66783}, +{14112.9, 73.9944, 8.42533}, +{14341.2, 73.7373, 8.18962}, +{14573.1, 72.8677, 7.96050}, +{14697.8, 65.8290, 7.84150}, +{14698.0, 65.8291, 10.9738}, +{14808.9, 72.8684, 10.8572}, +{15048.4, 73.9928, 10.6124}, +{15291.8, 73.9654, 10.3730}, +{15346.6, 71.1617, 10.3204}, +{15346.8, 71.1623, 11.7869}, +{15539.1, 75.1270, 11.5714}, +{15790.4, 75.9626, 11.2996}, +{16045.8, 76.5449, 11.0325}, +{16305.4, 77.0086, 10.7702}, +{16569.1, 77.3971, 10.5127}, +{16837.1, 77.7320, 10.2599}, +{17109.4, 78.0253, 10.0119}, +{17386.1, 78.2854, 9.76875}, +{17667.4, 78.5178, 9.53030}, +{17953.1, 78.7266, 9.29659}, +{18243.5, 78.9152, 9.06757}, +{18538.6, 79.0859, 8.84324}, +{18838.4, 79.2410, 8.62354}, +{19143.1, 79.3819, 8.40844}, +{19452.7, 79.5102, 8.19790}, +{19767.4, 79.6271, 7.99185}, +{20087.1, 79.7336, 7.79027}, +{20412.0, 79.8305, 7.59309}, +{20742.1, 79.9188, 7.40026}, +{21077.6, 79.9991, 7.21172}, +{21418.5, 80.0720, 7.02741}, +{21765.0, 80.1382, 6.84728}, +{22117.0, 80.1980, 6.67126}, +{22474.7, 80.2520, 6.49929}, +{22838.2, 80.3005, 6.33130}, +{23207.6, 80.3441, 6.16723}, +{23583.0, 80.3829, 6.00701}, +{23964.4, 80.4174, 5.85059}, +{24352.0, 80.4478, 5.69788}, +{24745.9, 80.4744, 5.54882}, +{25146.2, 80.4974, 5.40336}, +{25552.9, 80.5172, 5.26141}, +{25966.2, 80.5339, 5.12292}, +{26386.1, 80.5476, 4.98780}, +{26812.9, 80.5587, 4.85602}, +{27246.6, 80.5672, 4.72748}, +{27687.3, 80.5734, 4.60213}, +{28135.1, 80.5774, 4.47990}, +{28590.2, 80.5793, 4.36072}, +{29052.6, 80.5793, 4.24454}, +{29522.5, 80.5775, 4.13129}, +{30000.0, 80.5740, 4.02090}, +{0, 0, 0} +}; + +e_fp_fdp pb[] = { /* Z = 82 */ +{10.0000, -9999.00, 4.66990}, +{10.1617, -9999.00, 4.72735}, +{10.3261, -9999.00, 4.78551}, +{10.4931, -9999.00, 4.84439}, +{10.6628, -9999.00, 4.83957}, +{10.8353, -9999.00, 4.83203}, +{11.0106, -9999.00, 4.82451}, +{11.1886, -9999.00, 4.81700}, +{11.3696, -9999.00, 4.78890}, +{11.5535, -9999.00, 4.75960}, +{11.7404, -9999.00, 4.73047}, +{11.9303, -9999.00, 4.70302}, +{12.1232, -9999.00, 4.68370}, +{12.3193, -9999.00, 4.66446}, +{12.5186, -9999.00, 4.64530}, +{12.7210, -9999.00, 4.62536}, +{12.9268, -9999.00, 4.44257}, +{13.1359, -9999.00, 4.26699}, +{13.3483, -9999.00, 4.09837}, +{13.5642, -9999.00, 3.88200}, +{13.7836, -9999.00, 3.63921}, +{14.0066, -9999.00, 3.41159}, +{14.2331, -9999.00, 3.17766}, +{14.4633, -9999.00, 2.94365}, +{14.6973, -9999.00, 2.72688}, +{14.9350, -9999.00, 2.47076}, +{15.1765, -9999.00, 2.21678}, +{15.4220, -9999.00, 2.01143}, +{15.6714, -9999.00, 1.90378}, +{15.9249, -9999.00, 1.80189}, +{16.1825, -9999.00, 1.70546}, +{16.4442, -9999.00, 1.63656}, +{16.7102, -9999.00, 1.58570}, +{16.9805, -9999.00, 1.55533}, +{17.2551, -9999.00, 1.57052}, +{17.5342, -9999.00, 1.60673}, +{17.8178, -9999.00, 1.71786}, +{18.1060, -9999.00, 1.98335}, +{18.3989, -9999.00, 3.14900}, +{18.6964, -9999.00, 3.91298}, +{18.9988, -9999.00, 4.10506}, +{19.3061, -9999.00, 4.30658}, +{19.6184, -9999.00, 4.47521}, +{19.9357, -9999.00, 4.62493}, +{20.2582, -9999.00, 4.77966}, +{20.5858, -9999.00, 4.87039}, +{20.9188, -9999.00, 4.91556}, +{21.2571, -9999.00, 4.96116}, +{21.6009, -9999.00, 5.00718}, +{21.9503, -9999.00, 4.96749}, +{22.3053, -9999.00, 4.90712}, +{22.6661, -9999.00, 4.84749}, +{23.0327, -9999.00, 4.80021}, +{23.4053, -9999.00, 4.77166}, +{23.7838, -9999.00, 4.74329}, +{24.1685, -9999.00, 4.71508}, +{24.5594, -9999.00, 4.69254}, +{24.9566, -9999.00, 4.67400}, +{25.3603, -9999.00, 4.65553}, +{25.7705, -9999.00, 4.66380}, +{26.1873, -9999.00, 4.71894}, +{26.6109, -9999.00, 4.77472}, +{27.0413, -9999.00, 4.85873}, +{27.4786, -9999.00, 5.00257}, +{27.9231, -9999.00, 5.15068}, +{28.3747, -9999.00, 5.30316}, +{28.8337, -9999.00, 5.46017}, +{29.3000, -0.190469E-01, 5.62182}, +{29.7739, -0.197996, 5.81943}, +{30.2555, -0.350369, 6.06052}, +{30.7449, -0.484374, 6.31159}, +{31.2421, -0.607477, 6.57307}, +{31.7475, -0.721675, 6.84538}, +{32.2609, -0.828426, 7.12897}, +{32.7827, -0.928105, 7.42430}, +{33.3130, -1.02446, 7.73187}, +{33.8518, -1.11200, 8.06111}, +{34.3993, -1.18669, 8.40549}, +{34.9557, -1.24877, 8.76457}, +{35.5211, -1.29792, 9.13900}, +{36.0956, -1.33196, 9.52942}, +{36.6794, -1.34888, 9.93651}, +{37.2727, -1.34422, 10.3610}, +{37.8755, -1.29478, 10.8036}, +{38.4882, -1.22953, 11.2102}, +{39.1107, -1.16711, 11.6277}, +{39.7432, -1.09395, 12.0606}, +{40.3861, -1.00394, 12.5097}, +{41.0393, -0.890645, 12.9755}, +{41.7031, -0.745923, 13.4587}, +{42.3776, -0.543576, 13.9598}, +{43.0630, -0.296529, 14.3933}, +{43.7595, -0.633823E-01, 14.8078}, +{44.4673, 0.162851, 15.2343}, +{45.1865, 0.404636, 15.6730}, +{45.9174, 0.670428, 16.1244}, +{46.6600, 0.977847, 16.5888}, +{47.4147, 1.35655, 17.0083}, +{48.1816, 1.71333, 17.3743}, +{48.9609, 2.04922, 17.7481}, +{49.7528, 2.39283, 18.1300}, +{50.5576, 2.74979, 18.5201}, +{51.3753, 3.12624, 18.9186}, +{52.2062, 3.52846, 19.3257}, +{53.0506, 3.96465, 19.7416}, +{53.9087, 4.49624, 20.1664}, +{54.7806, 5.03778, 20.4618}, +{55.6667, 5.54640, 20.7546}, +{56.5670, 6.05597, 21.0516}, +{57.4820, 6.57968, 21.3528}, +{58.4117, 7.12846, 21.6584}, +{59.3564, 7.71713, 21.9683}, +{60.3165, 8.39292, 22.2826}, +{61.2921, 9.11791, 22.4414}, +{62.2834, 9.79515, 22.5474}, +{63.2908, 10.4385, 22.6540}, +{64.3145, 11.0902, 22.7611}, +{65.3547, 11.8141, 22.8686}, +{66.4118, 12.5747, 22.8385}, +{67.4859, 13.2446, 22.7256}, +{68.5775, 13.8601, 22.6134}, +{69.6867, 14.4464, 22.5016}, +{70.8138, 15.0129, 22.3905}, +{71.9591, 15.5674, 22.2836}, +{73.1230, 16.1181, 22.1787}, +{74.3057, 16.6702, 22.0744}, +{75.5076, 17.2288, 21.9706}, +{76.7289, 17.8016, 21.8673}, +{77.9699, 18.3972, 21.7644}, +{79.2310, 19.1184, 21.6620}, +{80.5125, 19.8246, 21.3316}, +{81.8147, 20.4169, 20.9720}, +{83.1380, 20.9561, 20.6185}, +{84.4827, 21.4659, 20.2709}, +{85.8491, 21.9597, 19.9292}, +{87.2377, 22.4493, 19.5933}, +{88.6487, 22.9445, 19.2630}, +{90.0825, 23.5796, 18.9170}, +{91.5395, 24.1311, 18.3324}, +{93.0201, 24.5460, 17.7658}, +{94.5246, 24.9067, 17.2168}, +{96.0535, 25.2341, 16.6847}, +{97.6071, 25.5494, 16.1691}, +{99.1858, 25.9016, 15.6111}, +{100.790, 26.1721, 14.9817}, +{102.420, 26.3580, 14.3776}, +{104.077, 26.5099, 13.7979}, +{105.760, 26.6449, 13.2416}, +{107.471, 26.8026, 12.7078}, +{109.209, 26.9990, 12.0481}, +{110.975, 27.0515, 11.2957}, +{112.770, 26.9562, 10.5903}, +{114.594, 26.7866, 9.92901}, +{116.448, 26.4624, 9.33377}, +{118.331, 26.1632, 8.92792}, +{120.245, 25.9252, 8.53970}, +{122.190, 25.6884, 8.16837}, +{124.166, 25.4441, 7.81320}, +{126.175, 25.1874, 7.47345}, +{128.215, 24.8457, 7.15676}, +{130.289, 24.5382, 6.98801}, +{132.397, 24.2996, 6.82325}, +{134.538, 24.0848, 6.66236}, +{136.714, 23.8864, 6.50527}, +{138.925, 23.7011, 6.35188}, +{141.172, 23.5300, 6.20212}, +{143.456, 23.3925, 6.05588}, +{145.776, 23.2499, 5.83434}, +{148.134, 23.0656, 5.60294}, +{150.530, 22.8410, 5.38071}, +{152.964, 22.5782, 5.16729}, +{155.439, 22.3000, 5.00637}, +{157.953, 22.0239, 4.85968}, +{160.507, 21.7449, 4.71729}, +{163.103, 21.4528, 4.57907}, +{165.742, 21.1114, 4.44490}, +{168.422, 20.7659, 4.38366}, +{171.146, 20.4408, 4.33065}, +{173.915, 20.1123, 4.27828}, +{176.727, 19.7458, 4.22654}, +{179.586, 19.3527, 4.23214}, +{182.491, 18.9888, 4.28425}, +{185.442, 18.6393, 4.33701}, +{188.442, 18.2782, 4.39229}, +{191.489, 17.9117, 4.46330}, +{194.587, 17.5069, 4.53545}, +{197.734, 17.0794, 4.67279}, +{200.932, 16.6730, 4.85109}, +{204.182, 16.2564, 5.03619}, +{207.485, 15.8217, 5.29026}, +{210.840, 15.4172, 5.59582}, +{214.251, 15.0443, 5.91903}, +{217.716, 14.6842, 6.26091}, +{221.237, 14.3222, 6.62253}, +{224.816, 13.9619, 7.02794}, +{228.452, 13.6286, 7.48200}, +{232.147, 13.3246, 7.96542}, +{235.902, 13.0473, 8.48005}, +{239.717, 12.8034, 9.02793}, +{243.595, 12.6029, 9.61123}, +{247.535, 12.4964, 10.2322}, +{251.538, 12.4204, 10.7417}, +{255.607, 12.3243, 11.2556}, +{259.741, 12.2171, 11.7942}, +{263.942, 12.1223, 12.3584}, +{268.211, 12.0466, 12.9497}, +{272.549, 12.0081, 13.5693}, +{276.957, 11.9950, 14.1793}, +{281.437, 11.9967, 14.8084}, +{285.989, 12.0186, 15.4653}, +{290.615, 12.0755, 16.1514}, +{295.315, 12.1774, 16.8680}, +{300.092, 12.3313, 17.6163}, +{304.945, 12.6954, 18.3951}, +{309.878, 13.0611, 18.9175}, +{314.890, 13.3331, 19.4547}, +{319.983, 13.5960, 20.0072}, +{325.158, 13.8628, 20.5753}, +{330.418, 14.1441, 21.1596}, +{335.762, 14.4475, 21.7604}, +{341.192, 14.7887, 22.3784}, +{346.711, 15.1596, 22.9883}, +{352.319, 15.5648, 23.6148}, +{358.017, 16.0206, 24.2584}, +{363.808, 16.5521, 24.9196}, +{369.692, 17.2953, 25.5065}, +{375.672, 17.9936, 25.8526}, +{381.748, 18.5700, 26.2034}, +{387.922, 19.1362, 26.5590}, +{394.197, 19.7123, 26.9193}, +{400.573, 20.3436, 27.2651}, +{407.052, 20.9434, 27.5050}, +{413.635, 21.4993, 27.7470}, +{420.326, 22.0373, 27.9911}, +{427.124, 22.5667, 28.2373}, +{434.032, 23.0830, 28.4857}, +{441.052, 23.6030, 28.7548}, +{448.186, 24.1409, 29.0301}, +{455.435, 24.6970, 29.3081}, +{462.802, 25.2767, 29.5887}, +{470.287, 25.8826, 29.8720}, +{477.894, 26.6174, 30.1581}, +{485.623, 27.3693, 30.2584}, +{493.478, 28.0247, 30.3011}, +{501.459, 28.6345, 30.3439}, +{509.570, 29.2198, 30.3867}, +{517.812, 29.7900, 30.4296}, +{526.187, 30.3535, 30.4726}, +{534.698, 30.9248, 30.5098}, +{543.346, 31.4781, 30.5114}, +{552.134, 32.0088, 30.5130}, +{561.065, 32.5266, 30.5146}, +{570.139, 33.0349, 30.5162}, +{579.361, 33.5360, 30.5178}, +{588.732, 34.0325, 30.5194}, +{598.254, 34.5296, 30.5161}, +{607.930, 35.0171, 30.5018}, +{617.763, 35.4915, 30.4876}, +{627.755, 35.9573, 30.4733}, +{637.908, 36.4129, 30.4591}, +{648.226, 36.8461, 30.4449}, +{658.711, 37.2768, 30.4754}, +{669.365, 37.7271, 30.5171}, +{680.191, 38.1957, 30.5589}, +{691.193, 38.6759, 30.6007}, +{702.372, 39.1686, 30.6426}, +{713.733, 39.6763, 30.6846}, +{725.277, 40.2046, 30.7266}, +{737.008, 40.7789, 30.7687}, +{748.928, 41.3642, 30.7284}, +{761.042, 41.9263, 30.6716}, +{773.351, 42.4766, 30.6148}, +{785.859, 43.0405, 30.5581}, +{798.570, 43.6263, 30.4589}, +{811.486, 44.1861, 30.3133}, +{824.611, 44.7075, 30.1684}, +{837.949, 45.2161, 30.0242}, +{851.502, 45.7079, 29.8708}, +{865.274, 46.1576, 29.7313}, +{879.269, 46.6299, 29.6754}, +{893.491, 47.1570, 29.6188}, +{907.943, 47.7334, 29.5621}, +{922.628, 48.4206, 29.5053}, +{937.551, 49.1309, 29.2356}, +{952.715, 49.7778, 28.9114}, +{968.124, 50.3491, 28.5412}, +{983.783, 50.8717, 28.1749}, +{999.695, 51.3693, 27.8069}, +{1015.86, 51.8629, 27.4369}, +{1032.29, 52.3204, 27.0066}, +{1048.99, 52.7278, 26.5799}, +{1065.96, 53.0993, 26.1572}, +{1083.20, 53.4421, 25.7403}, +{1100.72, 53.7600, 25.3299}, +{1118.52, 54.0566, 24.9258}, +{1136.61, 54.3335, 24.5275}, +{1155.00, 54.5921, 24.1351}, +{1173.68, 54.8337, 23.7486}, +{1192.66, 55.0592, 23.3680}, +{1211.95, 55.2695, 22.9932}, +{1231.55, 55.4648, 22.6243}, +{1251.47, 55.6456, 22.2625}, +{1271.72, 55.8136, 21.9081}, +{1292.29, 55.9712, 21.5614}, +{1313.19, 56.1187, 21.2198}, +{1334.43, 56.2559, 20.8834}, +{1356.01, 56.3829, 20.5520}, +{1377.94, 56.5001, 20.2255}, +{1400.23, 56.6079, 19.9039}, +{1422.88, 56.7069, 19.5870}, +{1445.89, 56.7988, 19.2751}, +{1469.28, 56.8859, 18.9645}, +{1493.04, 56.9697, 18.6533}, +{1517.19, 57.0382, 18.3246}, +{1541.73, 57.0835, 17.9986}, +{1566.67, 57.1098, 17.6781}, +{1592.01, 57.1202, 17.3633}, +{1617.76, 57.1157, 17.0540}, +{1643.92, 57.0962, 16.7496}, +{1670.51, 57.0618, 16.4507}, +{1697.53, 57.0125, 16.1571}, +{1724.99, 56.9534, 15.8686}, +{1752.89, 56.8780, 15.5744}, +{1781.24, 56.7787, 15.2820}, +{1810.05, 56.6564, 14.9920}, +{1839.32, 56.5093, 14.7078}, +{1869.07, 56.3380, 14.4290}, +{1899.30, 56.1407, 14.1553}, +{1930.02, 55.9154, 13.8869}, +{1961.24, 55.6592, 13.6235}, +{1992.96, 55.3668, 13.3650}, +{2025.20, 55.0434, 13.1185}, +{2057.95, 54.6797, 12.8632}, +{2091.24, 54.2571, 12.6103}, +{2125.06, 53.7720, 12.3611}, +{2159.43, 53.2117, 12.1153}, +{2194.36, 52.5593, 11.8730}, +{2229.85, 51.7911, 11.6340}, +{2265.92, 50.8725, 11.3989}, +{2302.57, 49.7492, 11.1668}, +{2339.81, 48.3300, 10.9385}, +{2377.66, 46.4421, 10.7132}, +{2416.11, 43.6817, 10.4912}, +{2455.19, 38.5802, 10.2727}, +{2483.90, 7.55536, 10.1172}, +{2484.10, 7.55545, 27.1005}, +{2494.90, 32.7224, 26.9285}, +{2535.26, 39.4912, 26.3021}, +{2576.26, 36.9488, 25.6922}, +{2585.50, 20.8428, 25.5580}, +{2585.70, 20.8582, 37.1626}, +{2617.93, 44.0586, 36.5035}, +{2660.27, 48.9258, 35.6671}, +{2703.30, 51.9651, 34.8512}, +{2747.03, 54.2035, 34.0545}, +{2791.46, 55.9517, 33.2771}, +{2836.61, 57.3468, 32.5188}, +{2882.49, 58.4533, 31.7787}, +{2929.11, 59.2865, 31.0559}, +{2976.48, 59.7967, 30.3501}, +{3024.63, 59.8782, 29.6607}, +{3066.30, 52.2055, 29.0851}, +{3066.50, 52.2198, 33.7226}, +{3073.55, 58.1504, 33.6102}, +{3123.26, 61.9965, 32.8347}, +{3173.78, 63.6676, 32.0774}, +{3225.11, 64.8856, 31.3389}, +{3277.27, 65.8627, 30.6172}, +{3330.28, 66.6690, 29.9126}, +{3384.15, 67.3318, 29.2257}, +{3438.88, 67.8473, 28.5547}, +{3494.50, 68.1485, 27.8995}, +{3551.02, 67.1984, 27.2592}, +{3554.10, 65.4185, 27.2250}, +{3554.30, 65.4207, 28.8681}, +{3608.46, 69.2095, 28.2577}, +{3666.82, 70.0404, 27.6241}, +{3726.13, 70.6325, 27.0039}, +{3786.40, 71.2018, 26.3988}, +{3847.64, 70.5957, 25.8082}, +{3850.60, 70.0014, 25.7802}, +{3850.80, 70.0105, 26.9029}, +{3909.87, 72.0749, 26.3307}, +{3973.11, 72.7886, 25.7409}, +{4037.38, 73.3590, 25.1637}, +{4102.68, 73.8532, 24.5952}, +{4169.03, 74.2923, 24.0380}, +{4236.46, 74.6888, 23.4915}, +{4304.98, 75.0501, 22.9555}, +{4374.62, 75.3804, 22.4299}, +{4445.37, 75.6838, 21.9144}, +{4517.27, 75.9624, 21.4086}, +{4590.33, 76.2187, 20.9140}, +{4664.58, 76.4553, 20.4285}, +{4740.03, 76.6730, 19.9531}, +{4816.69, 76.8734, 19.4874}, +{4894.60, 77.0577, 19.0313}, +{4973.77, 77.2271, 18.5848}, +{5054.21, 77.3825, 18.1474}, +{5135.96, 77.5246, 17.7195}, +{5219.03, 77.6546, 17.3007}, +{5303.44, 77.7730, 16.8908}, +{5389.22, 77.8805, 16.4899}, +{5476.39, 77.9778, 16.0974}, +{5564.97, 78.0653, 15.7138}, +{5654.98, 78.1437, 15.3386}, +{5746.44, 78.2137, 14.9716}, +{5839.39, 78.2753, 14.6127}, +{5933.83, 78.3291, 14.2620}, +{6029.81, 78.3757, 13.9191}, +{6127.33, 78.4153, 13.5837}, +{6226.44, 78.4481, 13.2562}, +{6327.15, 78.4748, 12.9361}, +{6429.48, 78.4954, 12.6231}, +{6533.48, 78.5102, 12.3174}, +{6639.15, 78.5196, 12.0188}, +{6746.54, 78.5237, 11.7269}, +{6855.65, 78.5227, 11.4420}, +{6966.54, 78.5171, 11.1635}, +{7079.22, 78.5066, 10.8916}, +{7193.72, 78.4918, 10.6259}, +{7310.07, 78.4724, 10.3665}, +{7428.31, 78.4489, 10.1134}, +{7548.45, 78.4215, 9.86598}, +{7670.54, 78.3900, 9.62445}, +{7794.61, 78.3545, 9.38862}, +{7920.68, 78.3152, 9.15857}, +{8048.79, 78.2721, 8.93357}, +{8178.98, 78.2250, 8.71414}, +{8311.26, 78.1742, 8.50001}, +{8445.69, 78.1198, 8.29100}, +{8582.29, 78.0614, 8.08675}, +{8721.11, 77.9992, 7.88755}, +{8862.16, 77.9328, 7.69289}, +{9005.50, 77.8622, 7.50323}, +{9151.16, 77.7877, 7.31784}, +{9299.17, 77.7086, 7.13700}, +{9449.58, 77.6250, 6.96041}, +{9602.42, 77.5366, 6.78811}, +{9757.73, 77.4434, 6.61995}, +{9915.55, 77.3469, 6.45597}, +{10075.9, 77.2448, 6.28685}, +{10238.9, 77.1286, 6.12209}, +{10404.5, 77.0024, 5.96160}, +{10572.8, 76.8651, 5.80528}, +{10743.8, 76.7155, 5.65305}, +{10917.6, 76.5520, 5.50481}, +{11094.2, 76.3724, 5.36048}, +{11273.6, 76.1736, 5.21995}, +{11455.9, 75.9513, 5.08316}, +{11641.2, 75.6997, 4.95001}, +{11829.5, 75.4099, 4.82040}, +{12020.8, 75.0682, 4.69427}, +{12215.3, 74.6520, 4.57153}, +{12412.8, 74.1185, 4.45209}, +{12613.6, 73.3727, 4.33588}, +{12817.6, 72.1273, 4.22282}, +{13025.0, 66.2656, 4.11283}, +{13035.1, 57.3925, 4.10756}, +{13035.3, 57.3934, 10.2182}, +{13235.6, 72.1211, 9.94988}, +{13449.7, 73.5107, 9.67521}, +{13667.2, 74.2555, 9.40812}, +{13888.3, 74.7157, 9.14841}, +{14112.9, 74.9955, 8.89587}, +{14341.2, 75.1292, 8.65032}, +{14573.1, 75.1116, 8.41153}, +{14808.9, 74.8802, 8.17935}, +{15048.4, 74.1340, 7.95357}, +{15199.9, 67.1548, 7.81578}, +{15200.1, 67.1557, 10.8971}, +{15291.8, 73.7601, 10.8014}, +{15539.1, 75.0244, 10.5499}, +{15790.4, 75.0876, 10.3043}, +{15860.7, 72.1981, 10.2374}, +{15860.9, 72.1987, 11.7048}, +{16045.8, 76.1119, 11.5060}, +{16305.4, 76.9637, 11.2365}, +{16569.1, 77.5480, 10.9716}, +{16837.1, 78.0109, 10.7114}, +{17109.4, 78.3979, 10.4559}, +{17386.1, 78.7308, 10.2051}, +{17667.4, 79.0223, 9.95896}, +{17953.1, 79.2805, 9.71754}, +{18243.5, 79.5111, 9.48079}, +{18538.6, 79.7183, 9.24872}, +{18838.4, 79.9053, 9.02127}, +{19143.1, 80.0746, 8.79845}, +{19452.7, 80.2283, 8.58020}, +{19767.4, 80.3680, 8.36648}, +{20087.1, 80.4952, 8.15726}, +{20412.0, 80.6110, 7.95250}, +{20742.1, 80.7165, 7.75215}, +{21077.6, 80.8126, 7.55615}, +{21418.5, 80.9001, 7.36446}, +{21765.0, 80.9796, 7.17701}, +{22117.0, 81.0518, 6.99377}, +{22474.7, 81.1173, 6.81465}, +{22838.2, 81.1765, 6.63961}, +{23207.6, 81.2299, 6.46858}, +{23583.0, 81.2779, 6.30150}, +{23964.4, 81.3210, 6.13832}, +{24352.0, 81.3594, 5.97895}, +{24745.9, 81.3934, 5.82334}, +{25146.2, 81.4234, 5.67142}, +{25552.9, 81.4497, 5.52314}, +{25966.2, 81.4724, 5.37841}, +{26386.1, 81.4918, 5.23718}, +{26812.9, 81.5082, 5.09938}, +{27246.6, 81.5217, 4.96494}, +{27687.3, 81.5325, 4.83380}, +{28135.1, 81.5408, 4.70590}, +{28590.2, 81.5468, 4.58116}, +{29052.6, 81.5506, 4.45953}, +{29522.5, 81.5523, 4.34093}, +{30000.0, 81.5521, 4.22531}, +{0, 0, 0} +}; + +e_fp_fdp bi[] = { /* Z = 83 */ +{10.0000, -9999.00, 5.59475}, +{10.1617, -9999.00, 5.63587}, +{10.3261, -9999.00, 5.67729}, +{10.4931, -9999.00, 5.71901}, +{10.6628, -9999.00, 5.74574}, +{10.8353, -9999.00, 5.75640}, +{11.0106, -9999.00, 5.76707}, +{11.1886, -9999.00, 5.77776}, +{11.3696, -9999.00, 5.78847}, +{11.5535, -9999.00, 5.78340}, +{11.7404, -9999.00, 5.77387}, +{11.9303, -9999.00, 5.76434}, +{12.1232, -9999.00, 5.75484}, +{12.3193, -9999.00, 5.74534}, +{12.5186, -9999.00, 5.73586}, +{12.7210, -9999.00, 5.72406}, +{12.9268, -9999.00, 5.67153}, +{13.1359, -9999.00, 5.61948}, +{13.3483, -9999.00, 5.56792}, +{13.5642, -9999.00, 5.51682}, +{13.7836, -9999.00, 5.46620}, +{14.0066, -9999.00, 5.41060}, +{14.2331, -9999.00, 5.28850}, +{14.4633, -9999.00, 5.16914}, +{14.6973, -9999.00, 5.05248}, +{14.9350, -9999.00, 4.93846}, +{15.1765, -9999.00, 4.82700}, +{15.4220, -9999.00, 4.68707}, +{15.6714, -9999.00, 4.53829}, +{15.9249, -9999.00, 4.39424}, +{16.1825, -9999.00, 4.25475}, +{16.4442, -9999.00, 4.07125}, +{16.7102, -9999.00, 3.87241}, +{16.9805, -9999.00, 3.68328}, +{17.2551, -9999.00, 3.50388}, +{17.5342, -9999.00, 3.33365}, +{17.8178, -9999.00, 3.17167}, +{18.1060, -9999.00, 3.01758}, +{18.3989, -9999.00, 2.86324}, +{18.6964, -9999.00, 2.71582}, +{18.9988, -9999.00, 2.57599}, +{19.3061, -9999.00, 2.43805}, +{19.6184, -9999.00, 2.28909}, +{19.9357, -9999.00, 2.14923}, +{20.2582, -9999.00, 2.02042}, +{20.5858, -9999.00, 1.90047}, +{20.9188, -9999.00, 1.80769}, +{21.2571, -9999.00, 1.75975}, +{21.6009, -9999.00, 1.71309}, +{21.9503, -9999.00, 1.66769}, +{22.3053, -9999.00, 1.66217}, +{22.6661, -9999.00, 1.65667}, +{23.0327, -9999.00, 1.66869}, +{23.4053, -9999.00, 1.70941}, +{23.7838, -9999.00, 1.83603}, +{24.1685, -9999.00, 3.17679}, +{24.5594, -9999.00, 5.26044}, +{24.9566, -9999.00, 5.65001}, +{25.3603, -9999.00, 6.01014}, +{25.7705, -9999.00, 6.20781}, +{26.1873, -9999.00, 6.41200}, +{26.6109, -9999.00, 6.59613}, +{27.0413, -9999.00, 6.66920}, +{27.4786, -9999.00, 6.74309}, +{27.9231, -9999.00, 6.71156}, +{28.3747, -9999.00, 6.48194}, +{28.8337, -9999.00, 6.22131}, +{29.3000, 1.10812, 5.95383}, +{29.7739, 1.19940, 5.61307}, +{30.2555, 0.997764, 5.11160}, +{30.7449, 0.643630, 4.99396}, +{31.2421, 0.385943, 4.92255}, +{31.7475, 0.136393, 4.85011}, +{32.2609, -0.159706, 4.75922}, +{32.7827, -0.573403, 4.74686}, +{33.3130, -0.938828, 4.84900}, +{33.8518, -1.30834, 4.96323}, +{34.3993, -1.67153, 5.14702}, +{34.9557, -2.04133, 5.33761}, +{35.5211, -2.45032, 5.61053}, +{36.0956, -2.80879, 5.93962}, +{36.6794, -3.15893, 6.28799}, +{37.2727, -3.54026, 6.71997}, +{37.8755, -3.84686, 7.23537}, +{38.4882, -4.09238, 7.79031}, +{39.1107, -4.25810, 8.38453}, +{39.7432, -4.38532, 8.92134}, +{40.3861, -4.50436, 9.49251}, +{41.0393, -4.58313, 10.1003}, +{41.7031, -4.58321, 10.7469}, +{42.3776, -4.50672, 11.2982}, +{43.0630, -4.47206, 11.8304}, +{43.7595, -4.43658, 12.3877}, +{44.4673, -4.37824, 12.9713}, +{45.1865, -4.26689, 13.5588}, +{45.9174, -4.15603, 14.1222}, +{46.6600, -4.03678, 14.7091}, +{47.4147, -3.89408, 15.3203}, +{48.1816, -3.70865, 15.9570}, +{48.9609, -3.44316, 16.6201}, +{49.7528, -3.14637, 17.1727}, +{50.5576, -2.87072, 17.7383}, +{51.3753, -2.58320, 18.3224}, +{52.2062, -2.26703, 18.9258}, +{53.0506, -1.89308, 19.5491}, +{53.9087, -1.43548, 20.1059}, +{54.7806, -1.01662, 20.6226}, +{55.6667, -0.603289, 21.1526}, +{56.5670, -0.167429, 21.6961}, +{57.4820, 0.314131, 22.2508}, +{58.4117, 0.813452, 22.7585}, +{59.3564, 1.31789, 23.2777}, +{60.3165, 1.84630, 23.8087}, +{61.2921, 2.41282, 24.3519}, +{62.2834, 3.04049, 24.8796}, +{63.2908, 3.67879, 25.3875}, +{64.3145, 4.34984, 25.9057}, +{65.3547, 5.07097, 26.4345}, +{66.4118, 5.87280, 26.9741}, +{67.4859, 6.83904, 27.5247}, +{68.5775, 7.83757, 27.7893}, +{69.6867, 8.77022, 28.0497}, +{70.8138, 9.71685, 28.3124}, +{71.9591, 10.7503, 28.5777}, +{73.1230, 11.8257, 28.6580}, +{74.3057, 12.8413, 28.7016}, +{75.5076, 13.8748, 28.7452}, +{76.7289, 15.0291, 28.7890}, +{77.9699, 16.2721, 28.5065}, +{79.2310, 17.2923, 28.0891}, +{80.5125, 18.2075, 27.6778}, +{81.8147, 19.0627, 27.2486}, +{83.1380, 19.8566, 26.8172}, +{84.4827, 20.6099, 26.3925}, +{85.8491, 21.3448, 25.9746}, +{87.2377, 22.0742, 25.5314}, +{88.6487, 22.7660, 25.0774}, +{90.0825, 23.4398, 24.6314}, +{91.5395, 24.1183, 24.1934}, +{93.0201, 24.8288, 23.7631}, +{94.5246, 25.6622, 23.3405}, +{96.0535, 26.6134, 22.5488}, +{97.6071, 27.2743, 21.6101}, +{99.1858, 27.7446, 20.7107}, +{100.790, 28.1233, 19.8486}, +{102.420, 28.4341, 19.0224}, +{104.077, 28.6957, 18.2306}, +{105.760, 28.9276, 17.4717}, +{107.471, 29.1749, 16.7444}, +{109.209, 29.3953, 15.8866}, +{110.975, 29.4902, 15.0370}, +{112.770, 29.4978, 14.2328}, +{114.594, 29.4539, 13.4716}, +{116.448, 29.3717, 12.7511}, +{118.331, 29.2688, 12.0692}, +{120.245, 29.1271, 11.3780}, +{122.190, 28.9363, 10.7249}, +{124.166, 28.7068, 10.1092}, +{126.175, 28.4459, 9.52883}, +{128.215, 28.1550, 8.98179}, +{130.289, 27.8310, 8.46617}, +{132.397, 27.4613, 7.98016}, +{134.538, 26.9804, 7.58635}, +{136.714, 26.5968, 7.35935}, +{138.925, 26.2764, 7.13913}, +{141.172, 25.9899, 6.92551}, +{143.456, 25.7252, 6.71828}, +{145.776, 25.4798, 6.51725}, +{148.134, 25.2663, 6.32225}, +{150.530, 25.0556, 6.06358}, +{152.964, 24.8090, 5.80346}, +{155.439, 24.5354, 5.55451}, +{157.953, 24.2446, 5.31624}, +{160.507, 23.9365, 5.08829}, +{163.103, 23.6106, 4.87127}, +{165.742, 23.2641, 4.66351}, +{168.422, 22.8888, 4.46460}, +{171.146, 22.4382, 4.28088}, +{173.915, 21.9971, 4.22036}, +{176.727, 21.5792, 4.16070}, +{179.586, 21.1385, 4.13836}, +{182.491, 20.7351, 4.16129}, +{185.442, 20.3458, 4.18435}, +{188.442, 19.9362, 4.21782}, +{191.489, 19.5378, 4.28349}, +{194.587, 19.1282, 4.35020}, +{197.734, 18.7200, 4.46653}, +{200.932, 18.3185, 4.58786}, +{204.182, 17.8843, 4.72224}, +{207.485, 17.4668, 4.93718}, +{210.840, 17.0713, 5.16189}, +{214.251, 16.6743, 5.40210}, +{217.716, 16.2889, 5.67319}, +{221.237, 15.9097, 5.95788}, +{224.816, 15.5149, 6.25686}, +{228.452, 15.0854, 6.63646}, +{232.147, 14.7159, 7.09375}, +{235.902, 14.4218, 7.56174}, +{239.717, 14.1425, 8.03066}, +{243.595, 13.8802, 8.52868}, +{247.535, 13.6524, 9.05756}, +{251.538, 13.5101, 9.61926}, +{255.607, 13.3842, 10.0879}, +{259.741, 13.2343, 10.5737}, +{263.942, 13.0861, 11.0830}, +{268.211, 12.9484, 11.6168}, +{272.549, 12.8282, 12.1763}, +{276.957, 12.7321, 12.7628}, +{281.437, 12.6801, 13.3680}, +{285.989, 12.6404, 13.9689}, +{290.615, 12.6197, 14.5968}, +{295.315, 12.6284, 15.2530}, +{300.092, 12.6791, 15.9386}, +{304.945, 12.7897, 16.6550}, +{309.878, 13.0255, 17.4037}, +{314.890, 13.3084, 17.9677}, +{319.983, 13.5510, 18.5180}, +{325.158, 13.7720, 19.0851}, +{330.418, 14.0083, 19.6696}, +{335.762, 14.2750, 20.2720}, +{341.192, 14.6115, 20.8928}, +{346.711, 14.9897, 21.4105}, +{352.319, 15.3421, 21.9057}, +{358.017, 15.6803, 22.4124}, +{363.808, 16.0345, 22.9308}, +{369.692, 16.4353, 23.4612}, +{375.672, 16.8986, 23.9359}, +{381.748, 17.3179, 24.3396}, +{387.922, 17.7114, 24.7501}, +{394.197, 18.0973, 25.1675}, +{400.573, 18.4826, 25.5919}, +{407.052, 18.8630, 26.0235}, +{413.635, 19.2563, 26.4833}, +{420.326, 19.6729, 26.9520}, +{427.124, 20.1128, 27.4290}, +{434.032, 20.5800, 27.9145}, +{441.052, 21.0809, 28.4085}, +{448.186, 21.6619, 28.9113}, +{455.435, 22.2816, 29.3194}, +{462.802, 22.8700, 29.6927}, +{470.287, 23.4535, 30.0707}, +{477.894, 24.0485, 30.4535}, +{485.623, 24.6663, 30.8412}, +{493.478, 25.3211, 31.2338}, +{501.459, 26.0639, 31.6181}, +{509.570, 26.7985, 31.8778}, +{517.812, 27.5174, 32.1397}, +{526.187, 28.2460, 32.4037}, +{534.698, 29.0050, 32.6699}, +{543.346, 29.9153, 32.9383}, +{552.134, 30.8341, 32.9523}, +{561.065, 31.6373, 32.9118}, +{570.139, 32.4095, 32.8642}, +{579.361, 33.1353, 32.7636}, +{588.732, 33.8173, 32.6485}, +{598.254, 34.4572, 32.5242}, +{607.930, 35.0647, 32.3983}, +{617.763, 35.6477, 32.2744}, +{627.755, 36.2197, 32.1503}, +{637.908, 36.7777, 32.0059}, +{648.226, 37.3103, 31.8363}, +{658.711, 37.7937, 31.6506}, +{669.365, 38.2328, 31.4662}, +{680.191, 38.6227, 31.2764}, +{691.193, 38.9316, 31.0889}, +{702.372, 39.0790, 30.9528}, +{713.733, 39.1629, 31.0932}, +{725.277, 39.4522, 31.4277}, +{737.008, 39.8959, 31.7660}, +{748.928, 40.4608, 32.1078}, +{761.042, 41.1751, 32.4447}, +{773.351, 42.0989, 32.6938}, +{785.859, 43.1424, 32.6485}, +{798.570, 43.9905, 32.3598}, +{811.486, 44.7087, 32.0735}, +{824.611, 45.3623, 31.7899}, +{837.949, 45.9784, 31.5088}, +{851.502, 46.5668, 31.2124}, +{865.274, 47.1247, 30.8973}, +{879.269, 47.6319, 30.5664}, +{893.491, 48.0938, 30.2391}, +{907.943, 48.5095, 29.9153}, +{922.628, 48.8364, 29.5949}, +{937.551, 49.1540, 29.4329}, +{952.715, 49.5087, 29.3138}, +{968.124, 49.9373, 29.2321}, +{983.783, 50.4325, 29.1508}, +{999.695, 51.0058, 29.0409}, +{1015.86, 51.7037, 28.9006}, +{1032.29, 52.3369, 28.4669}, +{1048.99, 52.8628, 28.0364}, +{1065.96, 53.3168, 27.6114}, +{1083.20, 53.7294, 27.1925}, +{1100.72, 54.1093, 26.7795}, +{1118.52, 54.4619, 26.3723}, +{1136.61, 54.7906, 25.9709}, +{1155.00, 55.0983, 25.5756}, +{1173.68, 55.3878, 25.1862}, +{1192.66, 55.6599, 24.8017}, +{1211.95, 55.9159, 24.4228}, +{1231.55, 56.1570, 24.0494}, +{1251.47, 56.3839, 23.6812}, +{1271.72, 56.5976, 23.3185}, +{1292.29, 56.7993, 22.9612}, +{1313.19, 56.9891, 22.6085}, +{1334.43, 57.1674, 22.2610}, +{1356.01, 57.3354, 21.9187}, +{1377.94, 57.4931, 21.5806}, +{1400.23, 57.6413, 21.2474}, +{1422.88, 57.7809, 20.9192}, +{1445.89, 57.9138, 20.5955}, +{1469.28, 58.0434, 20.2726}, +{1493.04, 58.1707, 19.9485}, +{1517.19, 58.2811, 19.6048}, +{1541.73, 58.3695, 19.2634}, +{1566.67, 58.4392, 18.9277}, +{1592.01, 58.4936, 18.5967}, +{1617.76, 58.5331, 18.2711}, +{1643.92, 58.5589, 17.9511}, +{1670.51, 58.5716, 17.6363}, +{1697.53, 58.5714, 17.3265}, +{1724.99, 58.5652, 17.0214}, +{1752.89, 58.5439, 16.7074}, +{1781.24, 58.5009, 16.3939}, +{1810.05, 58.4357, 16.0819}, +{1839.32, 58.3477, 15.7758}, +{1869.07, 58.2387, 15.4754}, +{1899.30, 58.1082, 15.1805}, +{1930.02, 57.9548, 14.8906}, +{1961.24, 57.7769, 14.6058}, +{1992.96, 57.5695, 14.3258}, +{2025.20, 57.3450, 14.0599}, +{2057.95, 57.0898, 13.7800}, +{2091.24, 56.7907, 13.5035}, +{2125.06, 56.4472, 13.2301}, +{2159.43, 56.0535, 12.9601}, +{2194.36, 55.6001, 12.6921}, +{2229.85, 55.0762, 12.4287}, +{2265.92, 54.4678, 12.1683}, +{2302.57, 53.7528, 11.9106}, +{2339.81, 52.9020, 11.6568}, +{2377.66, 51.8689, 11.4055}, +{2416.11, 50.5794, 11.1583}, +{2455.19, 48.8991, 10.9141}, +{2494.90, 46.5395, 10.6732}, +{2535.26, 42.6488, 10.4354}, +{2576.26, 28.1189, 10.2018}, +{2579.50, 9.13918, 10.1838}, +{2579.70, 9.14246, 27.1839}, +{2617.93, 40.3363, 26.5725}, +{2660.27, 41.4670, 25.9213}, +{2687.50, 23.2248, 25.5164}, +{2687.70, 23.2489, 37.0195}, +{2703.30, 42.2812, 36.6982}, +{2747.03, 49.1143, 35.8220}, +{2791.46, 52.6339, 34.9676}, +{2836.61, 55.1051, 34.1335}, +{2882.49, 56.9928, 33.3201}, +{2929.11, 58.4818, 32.5276}, +{2976.48, 59.6577, 31.7549}, +{3024.63, 60.5490, 31.0012}, +{3073.55, 61.1241, 30.2668}, +{3123.26, 61.1824, 29.5496}, +{3173.78, 57.8803, 28.8501}, +{3176.80, 52.7624, 28.8092}, +{3177.00, 52.7669, 33.5350}, +{3225.11, 62.8945, 32.7897}, +{3277.27, 64.7491, 32.0124}, +{3330.28, 66.0397, 31.2547}, +{3384.15, 67.0599, 30.5161}, +{3438.88, 67.8991, 29.7951}, +{3494.50, 68.5932, 29.0920}, +{3551.02, 69.1500, 28.4073}, +{3608.46, 69.5418, 27.7403}, +{3666.82, 69.5695, 27.0886}, +{3696.20, 66.9359, 26.7703}, +{3696.40, 66.9379, 28.3750}, +{3726.13, 70.1110, 28.0453}, +{3786.40, 71.1324, 27.3966}, +{3847.64, 71.7773, 26.7648}, +{3909.87, 72.2333, 26.1474}, +{3973.11, 72.3902, 25.5451}, +{3999.00, 70.8760, 25.3053}, +{3999.20, 70.8774, 26.2702}, +{4037.38, 72.9817, 25.9350}, +{4102.68, 73.7290, 25.3787}, +{4169.03, 74.2927, 24.8312}, +{4236.46, 74.7772, 24.2907}, +{4304.98, 75.2085, 23.7588}, +{4374.62, 75.6002, 23.2360}, +{4445.37, 75.9584, 22.7203}, +{4517.27, 76.2872, 22.2137}, +{4590.33, 76.5910, 21.7155}, +{4664.58, 76.8712, 21.2252}, +{4740.03, 77.1296, 20.7437}, +{4816.69, 77.3686, 20.2709}, +{4894.60, 77.5896, 19.8067}, +{4973.77, 77.7937, 19.3506}, +{5054.21, 77.9818, 18.9033}, +{5135.96, 78.1552, 18.4643}, +{5219.03, 78.3146, 18.0338}, +{5303.44, 78.4610, 17.6115}, +{5389.22, 78.5948, 17.1975}, +{5476.39, 78.7170, 16.7919}, +{5564.97, 78.8282, 16.3946}, +{5654.98, 78.9290, 16.0053}, +{5746.44, 79.0199, 15.6238}, +{5839.39, 79.1013, 15.2503}, +{5933.83, 79.1738, 14.8848}, +{6029.81, 79.2380, 14.5272}, +{6127.33, 79.2940, 14.1769}, +{6226.44, 79.3423, 13.8345}, +{6327.15, 79.3834, 13.4995}, +{6429.48, 79.4176, 13.1719}, +{6533.48, 79.4452, 12.8515}, +{6639.15, 79.4665, 12.5383}, +{6746.54, 79.4818, 12.2323}, +{6855.65, 79.4914, 11.9329}, +{6966.54, 79.4953, 11.6407}, +{7079.22, 79.4941, 11.3551}, +{7193.72, 79.4878, 11.0760}, +{7310.07, 79.4765, 10.8033}, +{7428.31, 79.4605, 10.5373}, +{7548.45, 79.4401, 10.2774}, +{7670.54, 79.4151, 10.0236}, +{7794.61, 79.3859, 9.77602}, +{7920.68, 79.3527, 9.53421}, +{8048.79, 79.3153, 9.29804}, +{8178.98, 79.2737, 9.06776}, +{8311.26, 79.2283, 8.84305}, +{8445.69, 79.1792, 8.62377}, +{8582.29, 79.1259, 8.40951}, +{8721.11, 79.0686, 8.20086}, +{8862.16, 79.0075, 7.99743}, +{9005.50, 78.9424, 7.79859}, +{9151.16, 78.8731, 7.60504}, +{9299.17, 78.7998, 7.41595}, +{9449.58, 78.7220, 7.23172}, +{9602.42, 78.6397, 7.05212}, +{9757.73, 78.5529, 6.87721}, +{9915.55, 78.4638, 6.70650}, +{10075.9, 78.3690, 6.53426}, +{10238.9, 78.2629, 6.36673}, +{10404.5, 78.1491, 6.20381}, +{10572.8, 78.0268, 6.04538}, +{10743.8, 77.8953, 5.89136}, +{10917.6, 77.7535, 5.74164}, +{11094.2, 77.6000, 5.59611}, +{11273.6, 77.4329, 5.45469}, +{11455.9, 77.2500, 5.31727}, +{11641.2, 77.0479, 5.18377}, +{11829.5, 76.8221, 5.05407}, +{12020.8, 76.5665, 4.92810}, +{12215.3, 76.2715, 4.80576}, +{12412.8, 75.9224, 4.68697}, +{12613.6, 75.4940, 4.57162}, +{12817.6, 74.9378, 4.45965}, +{13025.0, 74.1399, 4.35095}, +{13235.6, 72.7017, 4.24546}, +{13418.5, 58.2887, 4.15727}, +{13418.7, 58.2892, 10.2218}, +{13449.7, 69.4057, 10.1806}, +{13667.2, 73.4755, 9.89838}, +{13888.3, 74.6788, 9.62401}, +{14112.9, 75.3581, 9.35725}, +{14341.2, 75.7850, 9.09789}, +{14573.1, 76.0453, 8.84571}, +{14808.9, 76.1675, 8.60054}, +{15048.4, 76.1447, 8.36215}, +{15291.8, 75.9175, 8.13039}, +{15539.1, 75.2196, 7.90505}, +{15711.0, 68.0671, 7.75415}, +{15711.2, 68.0679, 10.8698}, +{15790.4, 74.5726, 10.7894}, +{16045.8, 75.9945, 10.5370}, +{16305.4, 76.1589, 10.2906}, +{16387.4, 73.4280, 10.2147}, +{16387.6, 73.4285, 11.5832}, +{16569.1, 77.0720, 11.4028}, +{16837.1, 77.9083, 11.1451}, +{17109.4, 78.4815, 10.8912}, +{17386.1, 78.9368, 10.6412}, +{17667.4, 79.3186, 10.3950}, +{17953.1, 79.6481, 10.1528}, +{18243.5, 79.9373, 9.91464}, +{18538.6, 80.1944, 9.68053}, +{18838.4, 80.4245, 9.45049}, +{19143.1, 80.6320, 9.22457}, +{19452.7, 80.8196, 9.00276}, +{19767.4, 80.9901, 8.78506}, +{20087.1, 81.1452, 8.57149}, +{20412.0, 81.2866, 8.36203}, +{20742.1, 81.4156, 8.15668}, +{21077.6, 81.5334, 7.95540}, +{21418.5, 81.6411, 7.75819}, +{21765.0, 81.7394, 7.56501}, +{22117.0, 81.8291, 7.37584}, +{22474.7, 81.9110, 7.19065}, +{22838.2, 81.9855, 7.00938}, +{23207.6, 82.0533, 6.83202}, +{23583.0, 82.1148, 6.65850}, +{23964.4, 82.1705, 6.48879}, +{24352.0, 82.2208, 6.32284}, +{24745.9, 82.2661, 6.16061}, +{25146.2, 82.3066, 6.00204}, +{25552.9, 82.3428, 5.84708}, +{25966.2, 82.3748, 5.69568}, +{26386.1, 82.4030, 5.54777}, +{26812.9, 82.4277, 5.40332}, +{27246.6, 82.4489, 5.26226}, +{27687.3, 82.4671, 5.12453}, +{28135.1, 82.4823, 4.99008}, +{28590.2, 82.4947, 4.85885}, +{29052.6, 82.5046, 4.73079}, +{29522.5, 82.5120, 4.60582}, +{30000.0, 82.5172, 4.48391}, +{0, 0, 0} +}; + +e_fp_fdp po[] = { /* Z = 84 */ +{10.0000, -9999.00, 4.92763}, +{10.1617, -9999.00, 4.95784}, +{10.3261, -9999.00, 4.98823}, +{10.4931, -9999.00, 5.01881}, +{10.6628, -9999.00, 5.04957}, +{10.8353, -9999.00, 5.10634}, +{11.0106, -9999.00, 5.17368}, +{11.1886, -9999.00, 5.24191}, +{11.3696, -9999.00, 5.31104}, +{11.5535, -9999.00, 5.38108}, +{11.7404, -9999.00, 5.41889}, +{11.9303, -9999.00, 5.44883}, +{12.1232, -9999.00, 5.47894}, +{12.3193, -9999.00, 5.50922}, +{12.5186, -9999.00, 5.53966}, +{12.7210, -9999.00, 5.52245}, +{12.9268, -9999.00, 5.48902}, +{13.1359, -9999.00, 5.45580}, +{13.3483, -9999.00, 5.42278}, +{13.5642, -9999.00, 5.38984}, +{13.7836, -9999.00, 5.35112}, +{14.0066, -9999.00, 5.31267}, +{14.2331, -9999.00, 5.27449}, +{14.4633, -9999.00, 5.23660}, +{14.6973, -9999.00, 5.19897}, +{14.9350, -9999.00, 5.17213}, +{15.1765, -9999.00, 5.14602}, +{15.4220, -9999.00, 5.12004}, +{15.6714, -9999.00, 5.09419}, +{15.9249, -9999.00, 5.06848}, +{16.1825, -9999.00, 5.04289}, +{16.4442, -9999.00, 5.01793}, +{16.7102, -9999.00, 4.99641}, +{16.9805, -9999.00, 4.97498}, +{17.2551, -9999.00, 4.95363}, +{17.5342, -9999.00, 4.93239}, +{17.8178, -9999.00, 4.84446}, +{18.1060, -9999.00, 4.71919}, +{18.3989, -9999.00, 4.59717}, +{18.6964, -9999.00, 4.47829}, +{18.9988, -9999.00, 4.36091}, +{19.3061, -9999.00, 4.24339}, +{19.6184, -9999.00, 4.12903}, +{19.9357, -9999.00, 4.01776}, +{20.2582, -9999.00, 3.90948}, +{20.5858, -9999.00, 3.78132}, +{20.9188, -9999.00, 3.65318}, +{21.2571, -9999.00, 3.52938}, +{21.6009, -9999.00, 3.39749}, +{21.9503, -9999.00, 3.18359}, +{22.3053, -9999.00, 2.98315}, +{22.6661, -9999.00, 2.79534}, +{23.0327, -9999.00, 2.63800}, +{23.4053, -9999.00, 2.50103}, +{23.7838, -9999.00, 2.37117}, +{24.1685, -9999.00, 2.24361}, +{24.5594, -9999.00, 2.11749}, +{24.9566, -9999.00, 1.99846}, +{25.3603, -9999.00, 1.89902}, +{25.7705, -9999.00, 1.81138}, +{26.1873, -9999.00, 1.72779}, +{26.6109, -9999.00, 1.71417}, +{27.0413, -9999.00, 1.71027}, +{27.4786, -9999.00, 1.69468}, +{27.9231, -9999.00, 1.66248}, +{28.3747, -9999.00, 1.65659}, +{28.8337, -9999.00, 1.69668}, +{29.3000, -0.327474, 1.73976}, +{29.7739, -0.805751, 1.80621}, +{30.2555, -1.43387, 1.87520}, +{30.7449, -2.38848, 2.31378}, +{31.2421, -3.05800, 3.36804}, +{31.7475, -2.95232, 4.85098}, +{32.2609, -2.42557, 5.18313}, +{32.7827, -2.15657, 5.50492}, +{33.3130, -1.99161, 5.81193}, +{33.8518, -1.77401, 6.13534}, +{34.3993, -1.56068, 6.24756}, +{34.9557, -1.42888, 6.36182}, +{35.5211, -1.31019, 6.44993}, +{36.0956, -1.26070, 6.48306}, +{36.6794, -1.27061, 6.51636}, +{37.2727, -1.32712, 6.54968}, +{37.8755, -1.43392, 6.58315}, +{38.4882, -1.61752, 6.61680}, +{39.1107, -1.85359, 6.76708}, +{39.7432, -2.06699, 6.93913}, +{40.3861, -2.29738, 7.11555}, +{41.0393, -2.59566, 7.34485}, +{41.7031, -2.86185, 7.64536}, +{42.3776, -3.13525, 7.95816}, +{43.0630, -3.46763, 8.28449}, +{43.7595, -3.79179, 8.80056}, +{44.4673, -4.04438, 9.34878}, +{45.1865, -4.25659, 9.93114}, +{45.9174, -4.43704, 10.5573}, +{46.6600, -4.56956, 11.2294}, +{47.4147, -4.64949, 11.9442}, +{48.1816, -4.65522, 12.7045}, +{48.9609, -4.52965, 13.5132}, +{49.7528, -4.34402, 14.1494}, +{50.5576, -4.19653, 14.8000}, +{51.3753, -4.03750, 15.4805}, +{52.2062, -3.84489, 16.1923}, +{53.0506, -3.59161, 16.9368}, +{53.9087, -3.22109, 17.7156}, +{54.7806, -2.81138, 18.3309}, +{55.6667, -2.42303, 18.9672}, +{56.5670, -2.00624, 19.6255}, +{57.4820, -1.52233, 20.3068}, +{58.4117, -0.879052, 20.9032}, +{59.3564, -0.325593, 21.3700}, +{60.3165, 0.196990, 21.8473}, +{61.2921, 0.718284, 22.3352}, +{62.2834, 1.25234, 22.8340}, +{63.2908, 1.80921, 23.3439}, +{64.3145, 2.39899, 23.8653}, +{65.3547, 3.03383, 24.3982}, +{66.4118, 3.73253, 24.9431}, +{67.4859, 4.53599, 25.5002}, +{68.5775, 5.58237, 25.9171}, +{69.6867, 6.47825, 26.0704}, +{70.8138, 7.28794, 26.2245}, +{71.9591, 8.06114, 26.3795}, +{73.1230, 8.82059, 26.5355}, +{74.3057, 9.57830, 26.6924}, +{75.5076, 10.3441, 26.8501}, +{76.7289, 11.1279, 27.0089}, +{77.9699, 11.9438, 27.1686}, +{79.2310, 12.8232, 27.3292}, +{80.5125, 13.8009, 27.3829}, +{81.8147, 14.7083, 27.3444}, +{83.1380, 15.5997, 27.3059}, +{84.4827, 16.5087, 27.2675}, +{85.8491, 17.4657, 27.2291}, +{87.2377, 18.5275, 27.1908}, +{88.6487, 19.8967, 27.0619}, +{90.0825, 21.0884, 26.2733}, +{91.5395, 21.9944, 25.5076}, +{93.0201, 22.6838, 24.7826}, +{94.5246, 23.3378, 24.1931}, +{96.0535, 24.0121, 23.6176}, +{97.6071, 24.7595, 23.0557}, +{99.1858, 25.6429, 22.1924}, +{100.790, 26.1814, 21.1428}, +{102.420, 26.4173, 20.1430}, +{104.077, 26.5325, 19.4083}, +{105.760, 26.7127, 18.7638}, +{107.471, 26.9059, 18.1408}, +{109.209, 27.1002, 17.5384}, +{110.975, 27.3057, 16.9561}, +{112.770, 27.5824, 16.3930}, +{114.594, 27.8933, 15.6178}, +{116.448, 27.9881, 14.7636}, +{118.331, 27.9509, 13.9562}, +{120.245, 27.8092, 13.1928}, +{122.190, 27.5257, 12.4713}, +{124.166, 27.1079, 12.0324}, +{126.175, 26.8467, 11.7436}, +{128.215, 26.6900, 11.4618}, +{130.289, 26.5711, 11.1867}, +{132.397, 26.4807, 10.9182}, +{134.538, 26.4151, 10.6562}, +{136.714, 26.3753, 10.4005}, +{138.925, 26.3711, 10.1509}, +{141.172, 26.4587, 9.90726}, +{143.456, 26.6053, 9.46653}, +{145.776, 26.5873, 8.93611}, +{148.134, 26.4798, 8.43540}, +{150.530, 26.3180, 7.96273}, +{152.964, 26.1150, 7.51656}, +{155.439, 25.8761, 7.09539}, +{157.953, 25.5938, 6.70403}, +{160.507, 25.3046, 6.37063}, +{163.103, 25.0110, 6.05380}, +{165.742, 24.7073, 5.75274}, +{168.422, 24.3887, 5.46663}, +{171.146, 24.0517, 5.19477}, +{173.915, 23.6892, 4.93642}, +{176.727, 23.2560, 4.69093}, +{179.586, 22.8275, 4.58996}, +{182.491, 22.4577, 4.50514}, +{185.442, 22.1118, 4.42190}, +{188.442, 21.7855, 4.33665}, +{191.489, 21.4508, 4.23282}, +{194.587, 21.0987, 4.13148}, +{197.734, 20.7266, 4.03256}, +{200.932, 20.3288, 3.94910}, +{204.182, 19.9121, 3.87586}, +{207.485, 19.4357, 3.83258}, +{210.840, 18.9677, 3.84129}, +{214.251, 18.4789, 3.88100}, +{217.716, 18.0052, 3.95929}, +{221.237, 17.5250, 4.03917}, +{224.816, 16.9986, 4.15828}, +{228.452, 16.4894, 4.33461}, +{232.147, 15.9546, 4.51842}, +{235.902, 15.4208, 4.81145}, +{239.717, 14.9168, 5.13299}, +{243.595, 14.4371, 5.48218}, +{247.535, 13.9687, 5.85511}, +{251.538, 13.4978, 6.25343}, +{255.607, 13.0316, 6.70406}, +{259.741, 12.5866, 7.19681}, +{263.942, 12.1604, 7.72577}, +{268.211, 11.7503, 8.29361}, +{272.549, 11.3548, 8.90874}, +{276.957, 10.9943, 9.58276}, +{281.437, 10.6797, 10.3078}, +{285.989, 10.4559, 11.0877}, +{290.615, 10.2855, 11.8188}, +{295.315, 10.1199, 12.5736}, +{300.092, 9.99330, 13.3766}, +{304.945, 9.98481, 14.2309}, +{309.878, 10.0378, 14.9726}, +{314.890, 10.0615, 15.7051}, +{319.983, 10.0997, 16.4735}, +{325.158, 10.1972, 17.2794}, +{330.418, 10.4086, 18.0490}, +{335.762, 10.5784, 18.7253}, +{341.192, 10.7303, 19.4270}, +{346.711, 10.8932, 20.1550}, +{352.319, 11.0837, 20.9103}, +{358.017, 11.3585, 21.6939}, +{363.808, 11.6586, 22.3856}, +{369.692, 11.9331, 23.0797}, +{375.672, 12.2118, 23.7953}, +{381.748, 12.5081, 24.5331}, +{387.922, 12.8319, 25.2937}, +{394.197, 13.1919, 26.0780}, +{400.573, 13.5993, 26.8865}, +{407.052, 14.1289, 27.7121}, +{413.635, 14.6723, 28.4175}, +{420.326, 15.1989, 29.1408}, +{427.124, 15.7502, 29.8825}, +{434.032, 16.3413, 30.6431}, +{441.052, 16.9892, 31.4231}, +{448.186, 17.7201, 32.2229}, +{455.435, 18.6394, 32.9905}, +{462.802, 19.5263, 33.5574}, +{470.287, 20.3925, 34.1340}, +{477.894, 21.2885, 34.7205}, +{485.623, 22.2494, 35.3171}, +{493.478, 23.4623, 35.8233}, +{501.459, 24.5879, 36.0698}, +{509.570, 25.6047, 36.3181}, +{517.812, 26.6263, 36.5681}, +{526.187, 27.8029, 36.8198}, +{534.698, 28.9439, 36.7701}, +{543.346, 29.9487, 36.6969}, +{552.134, 30.9003, 36.6238}, +{561.065, 31.8344, 36.5509}, +{570.139, 32.7962, 36.4781}, +{579.361, 33.8521, 36.2570}, +{588.732, 34.7681, 35.8649}, +{598.254, 35.5303, 35.4769}, +{607.930, 36.2207, 35.0932}, +{617.763, 36.8617, 34.7002}, +{627.755, 37.4200, 34.2844}, +{637.908, 37.8729, 33.8737}, +{648.226, 38.1981, 33.5221}, +{658.711, 38.5267, 33.2940}, +{669.365, 38.8480, 33.0786}, +{680.191, 39.1292, 32.8968}, +{691.193, 39.3636, 32.7478}, +{702.372, 39.4881, 32.6614}, +{713.733, 39.5770, 32.8294}, +{725.277, 39.8730, 33.1766}, +{737.008, 40.3270, 33.5274}, +{748.928, 40.9084, 33.8819}, +{761.042, 41.6486, 34.2312}, +{773.351, 42.6107, 34.4875}, +{785.859, 43.7001, 34.4328}, +{798.570, 44.5834, 34.1208}, +{811.486, 45.3299, 33.8119}, +{824.611, 46.0085, 33.5057}, +{837.949, 46.6466, 33.2022}, +{851.502, 47.2551, 32.8852}, +{865.274, 47.8317, 32.5504}, +{879.269, 48.3569, 32.2006}, +{893.491, 48.8358, 31.8547}, +{907.943, 49.2663, 31.5123}, +{922.628, 49.6009, 31.1735}, +{937.551, 49.9270, 31.0086}, +{952.715, 50.2952, 30.8906}, +{968.124, 50.7455, 30.8134}, +{983.783, 51.2693, 30.7363}, +{999.695, 51.8785, 30.6289}, +{1015.86, 52.6224, 30.4894}, +{1032.29, 53.3038, 30.0388}, +{1048.99, 53.8761, 29.5846}, +{1065.96, 54.3682, 29.1290}, +{1083.20, 54.8130, 28.6797}, +{1100.72, 55.2218, 28.2371}, +{1118.52, 55.6010, 27.8010}, +{1136.61, 55.9547, 27.3710}, +{1155.00, 56.2860, 26.9475}, +{1173.68, 56.5974, 26.5303}, +{1192.66, 56.8904, 26.1191}, +{1211.95, 57.1670, 25.7138}, +{1231.55, 57.4281, 25.3143}, +{1251.47, 57.6742, 24.9202}, +{1271.72, 57.9065, 24.5319}, +{1292.29, 58.1258, 24.1495}, +{1313.19, 58.3330, 23.7726}, +{1334.43, 58.5289, 23.4011}, +{1356.01, 58.7137, 23.0347}, +{1377.94, 58.8879, 22.6736}, +{1400.23, 59.0524, 22.3178}, +{1422.88, 59.2084, 21.9672}, +{1445.89, 59.3573, 21.6213}, +{1469.28, 59.5020, 21.2770}, +{1493.04, 59.6434, 20.9325}, +{1517.19, 59.7692, 20.5721}, +{1541.73, 59.8751, 20.2146}, +{1566.67, 59.9635, 19.8626}, +{1592.01, 60.0377, 19.5159}, +{1617.76, 60.0984, 19.1751}, +{1643.92, 60.1471, 18.8402}, +{1670.51, 60.1840, 18.5102}, +{1697.53, 60.2093, 18.1855}, +{1724.99, 60.2303, 17.8660}, +{1752.89, 60.2379, 17.5376}, +{1781.24, 60.2257, 17.2103}, +{1810.05, 60.1944, 16.8856}, +{1839.32, 60.1435, 16.5660}, +{1869.07, 60.0744, 16.2521}, +{1899.30, 59.9869, 15.9440}, +{1930.02, 59.8809, 15.6417}, +{1961.24, 59.7556, 15.3446}, +{1992.96, 59.6066, 15.0522}, +{2025.20, 59.4467, 14.7741}, +{2057.95, 59.2648, 14.4832}, +{2091.24, 59.0486, 14.1946}, +{2125.06, 58.8002, 13.9102}, +{2159.43, 58.5156, 13.6284}, +{2194.36, 58.1909, 13.3511}, +{2229.85, 57.8201, 13.0765}, +{2265.92, 57.3956, 12.8056}, +{2302.57, 56.9078, 12.5382}, +{2339.81, 56.3440, 12.2743}, +{2377.66, 55.6866, 12.0140}, +{2416.11, 54.9108, 11.7570}, +{2455.19, 53.9795, 11.5034}, +{2494.90, 52.8351, 11.2535}, +{2535.26, 51.3782, 11.0069}, +{2576.26, 49.4135, 10.7638}, +{2617.93, 46.4589, 10.5242}, +{2660.27, 40.4245, 10.2882}, +{2682.90, 11.5045, 10.1658}, +{2683.10, 11.5085, 26.8291}, +{2703.30, 39.2086, 26.5271}, +{2747.03, 43.5900, 25.8925}, +{2791.46, 39.4607, 25.2737}, +{2797.90, 24.7540, 25.1860}, +{2798.10, 24.7677, 36.5361}, +{2836.61, 48.2036, 35.7868}, +{2882.49, 52.6811, 34.9267}, +{2929.11, 55.5306, 34.0870}, +{2976.48, 57.6344, 33.2690}, +{3024.63, 59.2715, 32.4710}, +{3073.55, 60.5651, 31.6942}, +{3123.26, 61.5688, 30.9367}, +{3173.78, 62.2817, 30.1984}, +{3225.11, 62.6053, 29.4775}, +{3277.27, 61.9786, 28.7754}, +{3301.80, 54.6179, 28.4548}, +{3302.00, 54.6305, 33.0509}, +{3330.28, 63.0588, 32.6336}, +{3384.15, 65.3936, 31.8630}, +{3438.88, 66.8185, 31.1118}, +{3494.50, 67.9090, 30.3785}, +{3551.02, 68.7983, 29.6648}, +{3608.46, 69.5384, 28.9684}, +{3666.82, 70.1482, 28.2890}, +{3726.13, 70.6219, 27.6263}, +{3786.40, 70.8995, 26.9810}, +{3847.64, 70.2648, 26.3516}, +{3854.00, 68.2326, 26.2876}, +{3854.20, 68.2397, 27.8834}, +{3909.87, 71.8501, 27.2931}, +{3973.11, 72.6400, 26.6474}, +{4037.38, 73.1707, 26.0168}, +{4102.68, 74.1366, 25.4011}, +{4149.30, 72.2509, 24.9761}, +{4149.50, 72.2586, 26.0075}, +{4169.03, 73.6831, 25.8385}, +{4236.46, 74.5992, 25.2697}, +{4304.98, 75.2045, 24.7094}, +{4374.62, 75.7079, 24.1576}, +{4445.37, 76.1492, 23.6172}, +{4517.27, 76.5459, 23.0865}, +{4590.33, 76.9068, 22.5654}, +{4664.58, 77.2366, 22.0529}, +{4740.03, 77.5381, 21.5497}, +{4816.69, 77.8151, 21.0566}, +{4894.60, 78.0704, 20.5730}, +{4973.77, 78.3056, 20.0985}, +{5054.21, 78.5221, 19.6335}, +{5135.96, 78.7215, 19.1776}, +{5219.03, 78.9051, 18.7307}, +{5303.44, 79.0737, 18.2927}, +{5389.22, 79.2283, 17.8637}, +{5476.39, 79.3700, 17.4435}, +{5564.97, 79.4994, 17.0320}, +{5654.98, 79.6172, 16.6290}, +{5746.44, 79.7242, 16.2346}, +{5839.39, 79.8208, 15.8486}, +{5933.83, 79.9079, 15.4709}, +{6029.81, 79.9859, 15.1013}, +{6127.33, 80.0551, 14.7396}, +{6226.44, 80.1160, 14.3858}, +{6327.15, 80.1693, 14.0401}, +{6429.48, 80.2153, 13.7017}, +{6533.48, 80.2540, 13.3709}, +{6639.15, 80.2861, 13.0476}, +{6746.54, 80.3117, 12.7316}, +{6855.65, 80.3314, 12.4229}, +{6966.54, 80.3454, 12.1211}, +{7079.22, 80.3537, 11.8259}, +{7193.72, 80.3567, 11.5380}, +{7310.07, 80.3548, 11.2564}, +{7428.31, 80.3478, 10.9814}, +{7548.45, 80.3360, 10.7130}, +{7670.54, 80.3201, 10.4509}, +{7794.61, 80.2997, 10.1948}, +{7920.68, 80.2750, 9.94471}, +{8048.79, 80.2462, 9.70051}, +{8178.98, 80.2133, 9.46218}, +{8311.26, 80.1766, 9.22946}, +{8445.69, 80.1360, 9.00226}, +{8582.29, 80.0916, 8.78071}, +{8721.11, 80.0435, 8.56415}, +{8862.16, 79.9916, 8.35312}, +{9005.50, 79.9361, 8.14686}, +{9151.16, 79.8767, 7.94577}, +{9299.17, 79.8139, 7.74959}, +{9449.58, 79.7475, 7.55800}, +{9602.42, 79.6775, 7.37103}, +{9757.73, 79.6040, 7.18894}, +{9915.55, 79.5339, 7.01103}, +{10075.9, 79.4592, 6.82141}, +{10238.9, 79.3650, 6.63738}, +{10404.5, 79.2631, 6.45881}, +{10572.8, 79.1523, 6.28558}, +{10743.8, 79.0327, 6.11759}, +{10917.6, 78.9037, 5.95472}, +{11094.2, 78.7646, 5.79685}, +{11273.6, 78.6143, 5.64388}, +{11455.9, 78.4514, 5.49569}, +{11641.2, 78.2740, 5.35217}, +{11829.5, 78.0796, 5.21320}, +{12020.8, 77.8646, 5.07869}, +{12215.3, 77.6243, 4.94851}, +{12412.8, 77.3516, 4.82258}, +{12613.6, 77.0362, 4.70077}, +{12817.6, 76.6614, 4.58300}, +{13025.0, 76.1980, 4.46915}, +{13235.6, 75.5884, 4.35912}, +{13449.7, 74.6896, 4.25282}, +{13667.2, 72.9266, 4.15014}, +{13813.7, 58.4901, 4.08331}, +{13813.9, 58.4906, 10.3379}, +{13888.3, 71.7171, 10.2428}, +{14112.9, 74.5226, 9.96377}, +{14341.2, 75.6213, 9.69240}, +{14573.1, 76.2694, 9.42841}, +{14808.9, 76.6856, 9.17163}, +{15048.4, 76.9440, 8.92183}, +{15291.8, 77.0699, 8.67885}, +{15539.1, 77.0567, 8.44250}, +{15790.4, 76.8501, 8.21257}, +{16045.8, 76.2243, 7.98892}, +{16244.2, 68.9899, 7.82179}, +{16244.4, 68.9907, 10.9274}, +{16305.4, 75.1850, 10.8688}, +{16569.1, 76.8432, 10.6218}, +{16837.1, 77.1094, 10.3803}, +{16939.2, 74.4097, 10.2908}, +{16939.4, 74.4102, 11.6210}, +{17109.4, 77.9036, 11.4616}, +{17386.1, 78.7621, 11.2101}, +{17667.4, 79.3429, 10.9617}, +{17953.1, 79.8037, 10.7164}, +{18243.5, 80.1906, 10.4745}, +{18538.6, 80.5249, 10.2360}, +{18838.4, 80.8191, 10.0009}, +{19143.1, 81.0811, 9.76948}, +{19452.7, 81.3161, 9.54166}, +{19767.4, 81.5284, 9.31752}, +{20087.1, 81.7209, 9.09713}, +{20412.0, 81.8961, 8.88050}, +{20742.1, 82.0559, 8.66767}, +{21077.6, 82.2019, 8.45865}, +{21418.5, 82.3354, 8.25346}, +{21765.0, 82.4576, 8.05211}, +{22117.0, 82.5694, 7.85460}, +{22474.7, 82.6718, 7.66092}, +{22838.2, 82.7655, 7.47105}, +{23207.6, 82.8511, 7.28499}, +{23583.0, 82.9293, 7.10271}, +{23964.4, 83.0006, 6.92419}, +{24352.0, 83.0654, 6.74939}, +{24745.9, 83.1243, 6.57830}, +{25146.2, 83.1776, 6.41087}, +{25552.9, 83.2258, 6.24708}, +{25966.2, 83.2691, 6.08687}, +{26386.1, 83.3078, 5.93021}, +{26812.9, 83.3423, 5.77705}, +{27246.6, 83.3728, 5.62735}, +{27687.3, 83.3997, 5.48107}, +{28135.1, 83.4230, 5.33814}, +{28590.2, 83.4430, 5.19853}, +{29052.6, 83.4600, 5.06218}, +{29522.5, 83.4742, 4.92904}, +{30000.0, 83.4856, 4.79906}, +{0, 0, 0} +}; + +} // namespace table_data + +}}} // namespace cctbx::eltbx::henke diff --git a/extern/cctbx/cctbx/eltbx/henke_tables_85_92.cpp b/extern/cctbx/cctbx/eltbx/henke_tables_85_92.cpp new file mode 100644 index 00000000..84cc507b --- /dev/null +++ b/extern/cctbx/cctbx/eltbx/henke_tables_85_92.cpp @@ -0,0 +1,4177 @@ +/* ***************************************************** + THIS IS AN AUTOMATICALLY GENERATED FILE. DO NOT EDIT. + ***************************************************** + + Generated by: + cctbx.source_generators.eltbx.generate_henke_cpp + */ + +#include + +namespace cctbx { namespace eltbx { namespace henke { + +namespace table_data { + +using anomalous::e_fp_fdp; + +e_fp_fdp at[] = { /* Z = 85 */ +{10.0000, -9999.00, 8.78144}, +{10.1617, -9999.00, 8.87321}, +{10.3261, -9999.00, 8.96593}, +{10.4931, -9999.00, 9.04836}, +{10.6628, -9999.00, 9.08532}, +{10.8353, -9999.00, 9.12244}, +{11.0106, -9999.00, 9.15970}, +{11.1886, -9999.00, 9.19330}, +{11.3696, -9999.00, 9.15142}, +{11.5535, -9999.00, 9.10973}, +{11.7404, -9999.00, 9.06823}, +{11.9303, -9999.00, 9.02692}, +{12.1232, -9999.00, 8.98581}, +{12.3193, -9999.00, 8.94487}, +{12.5186, -9999.00, 8.90413}, +{12.7210, -9999.00, 8.86060}, +{12.9268, -9999.00, 8.81284}, +{13.1359, -9999.00, 8.76533}, +{13.3483, -9999.00, 8.71808}, +{13.5642, -9999.00, 8.67108}, +{13.7836, -9999.00, 8.62434}, +{14.0066, -9999.00, 8.57785}, +{14.2331, -9999.00, 8.53090}, +{14.4633, -9999.00, 8.48417}, +{14.6973, -9999.00, 8.43768}, +{14.9350, -9999.00, 8.39145}, +{15.1765, -9999.00, 8.34548}, +{15.4220, -9999.00, 8.29976}, +{15.6714, -9999.00, 8.25429}, +{15.9249, -9999.00, 8.20906}, +{16.1825, -9999.00, 8.16198}, +{16.4442, -9999.00, 8.11444}, +{16.7102, -9999.00, 8.06719}, +{16.9805, -9999.00, 8.02021}, +{17.2551, -9999.00, 7.97351}, +{17.5342, -9999.00, 7.92707}, +{17.8178, -9999.00, 7.87530}, +{18.1060, -9999.00, 7.77246}, +{18.3989, -9999.00, 7.67096}, +{18.6964, -9999.00, 7.57079}, +{18.9988, -9999.00, 7.47192}, +{19.3061, -9999.00, 7.37434}, +{19.6184, -9999.00, 7.27804}, +{19.9357, -9999.00, 7.12095}, +{20.2582, -9999.00, 6.95257}, +{20.5858, -9999.00, 6.78818}, +{20.9188, -9999.00, 6.62767}, +{21.2571, -9999.00, 6.46967}, +{21.6009, -9999.00, 6.25684}, +{21.9503, -9999.00, 6.05101}, +{22.3053, -9999.00, 5.85195}, +{22.6661, -9999.00, 5.65944}, +{23.0327, -9999.00, 5.47326}, +{23.4053, -9999.00, 5.29321}, +{23.7838, -9999.00, 5.09702}, +{24.1685, -9999.00, 4.86437}, +{24.5594, -9999.00, 4.64233}, +{24.9566, -9999.00, 4.43042}, +{25.3603, -9999.00, 4.22819}, +{25.7705, -9999.00, 4.03519}, +{26.1873, -9999.00, 3.85100}, +{26.6109, -9999.00, 3.61598}, +{27.0413, -9999.00, 3.36080}, +{27.4786, -9999.00, 3.12362}, +{27.9231, -9999.00, 2.90318}, +{28.3747, -9999.00, 2.69830}, +{28.8337, -9999.00, 2.54915}, +{29.3000, 5.49962, 2.43523}, +{29.7739, 5.27913, 2.32640}, +{30.2555, 5.05622, 2.25148}, +{30.7449, 4.84579, 2.18201}, +{31.2421, 4.63754, 2.11410}, +{31.7475, 4.42351, 2.04636}, +{32.2609, 4.19951, 1.98079}, +{32.7827, 3.96287, 1.92159}, +{33.3130, 3.71232, 1.86568}, +{33.8518, 3.43123, 1.81485}, +{34.3993, 3.14421, 1.82042}, +{34.9557, 2.86521, 1.82600}, +{35.5211, 2.57343, 1.83756}, +{36.0956, 2.28104, 1.87157}, +{36.6794, 1.98418, 1.90621}, +{37.2727, 1.66379, 1.94150}, +{37.8755, 1.33234, 2.02616}, +{38.4882, 1.00725, 2.11514}, +{39.1107, 0.674212, 2.20804}, +{39.7432, 0.322010, 2.31810}, +{40.3861, -0.340927E-01, 2.44332}, +{41.0393, -0.407025, 2.57531}, +{41.7031, -0.813161, 2.72667}, +{42.3776, -1.22845, 2.90695}, +{43.0630, -1.66735, 3.09915}, +{43.7595, -2.16488, 3.30550}, +{44.4673, -2.68641, 3.63941}, +{45.1865, -3.18944, 4.00704}, +{45.9174, -3.69481, 4.41182}, +{46.6600, -4.22642, 4.88002}, +{47.4147, -4.73564, 5.42624}, +{48.1816, -5.22429, 6.03359}, +{48.9609, -5.67958, 6.70891}, +{49.7528, -6.09790, 7.40624}, +{50.5576, -6.52062, 8.15609}, +{51.3753, -6.92777, 8.98187}, +{52.2062, -7.30629, 9.89126}, +{53.0506, -7.64532, 10.8951}, +{53.9087, -7.90647, 12.0296}, +{54.7806, -8.01747, 13.2822}, +{55.6667, -7.82666, 14.6653}, +{56.5670, -7.47546, 15.6298}, +{57.4820, -7.24516, 16.5891}, +{58.4117, -7.01197, 17.6072}, +{59.3564, -6.70400, 18.6879}, +{60.3165, -6.26379, 19.7160}, +{61.2921, -5.84568, 20.7093}, +{62.2834, -5.38508, 21.7526}, +{63.2908, -4.82824, 22.8485}, +{64.3145, -4.06262, 23.9808}, +{65.3547, -3.24069, 24.8170}, +{66.4118, -2.45145, 25.6823}, +{67.4859, -1.61431, 26.5778}, +{68.5775, -0.600281, 27.4743}, +{69.6867, 0.421181, 28.0817}, +{70.8138, 1.38149, 28.7026}, +{71.9591, 2.33903, 29.3372}, +{73.1230, 3.34521, 29.9858}, +{74.3057, 4.46677, 30.6042}, +{75.5076, 5.59524, 31.1541}, +{76.7289, 6.76935, 31.7138}, +{77.9699, 8.06059, 32.2836}, +{79.2310, 9.61324, 32.8636}, +{80.5125, 11.4548, 32.9161}, +{81.8147, 12.9277, 32.6485}, +{83.1380, 14.2299, 32.3831}, +{84.4827, 15.4488, 32.1155}, +{85.8491, 16.6209, 31.8486}, +{87.2377, 17.7774, 31.5839}, +{88.6487, 18.9640, 31.3214}, +{90.0825, 20.3132, 31.0611}, +{91.5395, 21.6748, 30.3481}, +{93.0201, 22.7549, 29.5469}, +{94.5246, 23.6896, 28.7669}, +{96.0535, 24.5352, 28.0075}, +{97.6071, 25.3221, 27.2681}, +{99.1858, 26.0808, 26.5483}, +{100.790, 26.8830, 25.8200}, +{102.420, 27.5851, 24.9127}, +{104.077, 28.1711, 24.0372}, +{105.760, 28.6850, 23.1926}, +{107.471, 29.1645, 22.3776}, +{109.209, 29.6503, 21.5912}, +{110.975, 30.2792, 20.7333}, +{112.770, 30.6737, 19.5574}, +{114.594, 30.8537, 18.4482}, +{116.448, 30.8846, 17.4020}, +{118.331, 30.7869, 16.4151}, +{120.245, 30.4646, 15.4841}, +{122.190, 30.1578, 14.9842}, +{124.166, 29.9957, 14.5113}, +{126.175, 29.8880, 14.0533}, +{128.215, 29.8092, 13.6097}, +{130.289, 29.7505, 13.1802}, +{132.397, 29.7091, 12.7642}, +{134.538, 29.6874, 12.3613}, +{136.714, 29.6966, 11.9712}, +{138.925, 29.7900, 11.5933}, +{141.172, 29.8542, 11.0062}, +{143.456, 29.8260, 10.4415}, +{145.776, 29.7409, 9.90586}, +{148.134, 29.6328, 9.39767}, +{150.530, 29.5202, 8.91553}, +{152.964, 29.4531, 8.45814}, +{155.439, 29.3617, 7.83226}, +{157.953, 29.1431, 7.21498}, +{160.507, 28.8335, 6.64635}, +{163.103, 28.4666, 6.12251}, +{165.742, 28.0177, 5.68111}, +{168.422, 27.6008, 5.33105}, +{171.146, 27.2058, 5.00258}, +{173.915, 26.8070, 4.69433}, +{176.727, 26.4002, 4.40277}, +{179.586, 25.9758, 4.12749}, +{182.491, 25.5226, 3.86942}, +{185.442, 24.9913, 3.67032}, +{188.442, 24.5258, 3.58621}, +{191.489, 24.0995, 3.50403}, +{194.587, 23.6860, 3.42373}, +{197.734, 23.2604, 3.34891}, +{200.932, 22.8479, 3.32075}, +{204.182, 22.4488, 3.29282}, +{207.485, 22.0467, 3.26513}, +{210.840, 21.6259, 3.26093}, +{214.251, 21.2242, 3.28454}, +{217.716, 20.8280, 3.30833}, +{221.237, 20.4234, 3.33229}, +{224.816, 19.9830, 3.37397}, +{228.452, 19.5611, 3.46177}, +{232.147, 19.1472, 3.55186}, +{235.902, 18.7279, 3.64429}, +{239.717, 18.2865, 3.74271}, +{243.595, 17.8398, 3.87411}, +{247.535, 17.3860, 4.01013}, +{251.538, 16.9138, 4.15092}, +{255.607, 16.4088, 4.29666}, +{259.741, 15.8314, 4.44751}, +{263.942, 15.1353, 4.70722}, +{268.211, 14.5041, 5.12724}, +{272.549, 13.9158, 5.58476}, +{276.957, 13.3402, 6.08308}, +{281.437, 12.7759, 6.63591}, +{285.989, 12.2168, 7.24017}, +{290.615, 11.6290, 7.89948}, +{295.315, 11.0699, 8.76865}, +{300.092, 10.6326, 9.75296}, +{304.945, 10.4210, 10.8477}, +{309.878, 10.4563, 11.7921}, +{314.890, 10.4129, 12.5719}, +{319.983, 10.3487, 13.4032}, +{325.158, 10.3991, 14.2617}, +{330.418, 10.4353, 15.0265}, +{335.762, 10.4454, 15.8322}, +{341.192, 10.4813, 16.6812}, +{346.711, 10.5777, 17.5683}, +{352.319, 10.7235, 18.4748}, +{358.017, 10.9468, 19.4282}, +{363.808, 11.3809, 20.3708}, +{369.692, 11.7767, 21.0935}, +{375.672, 12.1389, 21.8418}, +{381.748, 12.5165, 22.6166}, +{387.922, 12.9458, 23.4189}, +{394.197, 13.5828, 24.1665}, +{400.573, 14.1469, 24.7236}, +{407.052, 14.6249, 25.2936}, +{413.635, 15.0986, 25.8767}, +{420.326, 15.5817, 26.4732}, +{427.124, 16.0870, 27.0834}, +{434.032, 16.7007, 27.6758}, +{441.052, 17.2814, 28.1657}, +{448.186, 17.8187, 28.6644}, +{455.435, 18.3566, 29.1718}, +{462.802, 18.9024, 29.6883}, +{470.287, 19.4631, 30.2138}, +{477.894, 20.0448, 30.7487}, +{485.623, 20.6543, 31.2926}, +{493.478, 21.2997, 31.8462}, +{501.459, 21.9936, 32.4096}, +{509.570, 22.7576, 32.9830}, +{517.812, 23.6683, 33.5665}, +{526.187, 24.6918, 33.8865}, +{534.698, 25.6081, 34.0714}, +{543.346, 26.4216, 34.2573}, +{552.134, 27.2100, 34.4426}, +{561.065, 27.9856, 34.6279}, +{570.139, 28.7610, 34.8141}, +{579.361, 29.5523, 35.0014}, +{588.732, 30.4166, 35.1655}, +{598.254, 31.2148, 35.2113}, +{607.930, 31.9885, 35.2934}, +{617.763, 32.7778, 35.3744}, +{627.755, 33.6099, 35.4487}, +{637.908, 34.4772, 35.4480}, +{648.226, 35.3418, 35.3458}, +{658.711, 36.1191, 35.1771}, +{669.365, 36.8442, 35.0094}, +{680.191, 37.5407, 34.8310}, +{691.193, 38.2129, 34.6426}, +{702.372, 38.8700, 34.4358}, +{713.733, 39.4986, 34.1792}, +{725.277, 40.0502, 33.8896}, +{737.008, 40.5326, 33.6024}, +{748.928, 40.9432, 33.3174}, +{761.042, 41.2448, 33.0433}, +{773.351, 41.3801, 32.8619}, +{785.859, 41.4377, 32.9725}, +{798.570, 41.7326, 33.3278}, +{811.486, 42.2143, 33.6869}, +{824.611, 42.8443, 34.0497}, +{837.949, 43.6805, 34.4165}, +{851.502, 44.7134, 34.5665}, +{865.274, 45.8313, 34.4416}, +{879.269, 46.7373, 34.0727}, +{893.491, 47.5042, 33.7077}, +{907.943, 48.2005, 33.3466}, +{922.628, 48.8578, 32.9893}, +{937.551, 49.4744, 32.6073}, +{952.715, 50.0505, 32.2220}, +{968.124, 50.5861, 31.8346}, +{983.783, 51.0901, 31.4522}, +{999.695, 51.5685, 31.0722}, +{1015.86, 52.0270, 30.6946}, +{1032.29, 52.4395, 30.3008}, +{1048.99, 52.8107, 29.9430}, +{1065.96, 53.1859, 29.6232}, +{1083.20, 53.5632, 29.3064}, +{1100.72, 53.9359, 28.9925}, +{1118.52, 54.3027, 28.6816}, +{1136.61, 54.6635, 28.3735}, +{1155.00, 55.0191, 28.0685}, +{1173.68, 55.3710, 27.7665}, +{1192.66, 55.7205, 27.4668}, +{1211.95, 56.0711, 27.1702}, +{1231.55, 56.4336, 26.8765}, +{1251.47, 56.8078, 26.5555}, +{1271.72, 57.1829, 26.2038}, +{1292.29, 57.5158, 25.8144}, +{1313.19, 57.8145, 25.4303}, +{1334.43, 58.0911, 25.0515}, +{1356.01, 58.3500, 24.6777}, +{1377.94, 58.5936, 24.3091}, +{1400.23, 58.8242, 23.9455}, +{1422.88, 59.0437, 23.5868}, +{1445.89, 59.2546, 23.2329}, +{1469.28, 59.4614, 22.8796}, +{1493.04, 59.6655, 22.5248}, +{1517.19, 59.8514, 22.1478}, +{1541.73, 60.0135, 21.7731}, +{1566.67, 60.1556, 21.4043}, +{1592.01, 60.2820, 21.0410}, +{1617.76, 60.3944, 20.6834}, +{1643.92, 60.4935, 20.3312}, +{1670.51, 60.5802, 19.9845}, +{1697.53, 60.6552, 19.6434}, +{1724.99, 60.7277, 19.3077}, +{1752.89, 60.7871, 18.9605}, +{1781.24, 60.8260, 18.6138}, +{1810.05, 60.8455, 18.2689}, +{1839.32, 60.8453, 17.9297}, +{1869.07, 60.8277, 17.5963}, +{1899.30, 60.7931, 17.2688}, +{1930.02, 60.7413, 16.9469}, +{1961.24, 60.6718, 16.6309}, +{1992.96, 60.5815, 16.3207}, +{2025.20, 60.4858, 16.0248}, +{2057.95, 60.3721, 15.7138}, +{2091.24, 60.2280, 15.4053}, +{2125.06, 60.0572, 15.1003}, +{2159.43, 59.8574, 14.7985}, +{2194.36, 59.6265, 14.5003}, +{2229.85, 59.3603, 14.2049}, +{2265.92, 59.0545, 13.9133}, +{2302.57, 58.7040, 13.6255}, +{2339.81, 58.3022, 13.3412}, +{2377.66, 57.8406, 13.0605}, +{2416.11, 57.3065, 12.7822}, +{2455.19, 56.6838, 12.5081}, +{2494.90, 55.9517, 12.2379}, +{2535.26, 55.0777, 11.9706}, +{2576.26, 54.0126, 11.7071}, +{2617.93, 52.6751, 11.4470}, +{2660.27, 50.9144, 11.1906}, +{2703.30, 48.3944, 10.9375}, +{2747.03, 44.0472, 10.6879}, +{2786.60, 11.6247, 10.4701}, +{2786.80, 11.6296, 27.3828}, +{2791.46, 32.1753, 27.3091}, +{2836.61, 43.6129, 26.6110}, +{2882.49, 43.8762, 25.9342}, +{2908.60, 24.9818, 25.5614}, +{2908.80, 24.9946, 37.1148}, +{2929.11, 45.5963, 36.7255}, +{2976.48, 51.8626, 35.8432}, +{3024.63, 55.2297, 34.9824}, +{3073.55, 57.6117, 34.1450}, +{3123.26, 59.4357, 33.3279}, +{3173.78, 60.8715, 32.5311}, +{3225.11, 61.9952, 31.7540}, +{3277.27, 62.8277, 30.9978}, +{3330.28, 63.3155, 30.2600}, +{3384.15, 63.3226, 29.5414}, +{3425.90, 55.5262, 29.0037}, +{3426.10, 55.5393, 33.6509}, +{3438.88, 62.3990, 33.4646}, +{3494.50, 65.6704, 32.6731}, +{3551.02, 67.2840, 31.9004}, +{3608.46, 68.4765, 31.1472}, +{3666.82, 69.4405, 30.4138}, +{3726.13, 70.2425, 29.6967}, +{3786.40, 70.9105, 28.9985}, +{3847.64, 71.4515, 28.3176}, +{3909.87, 71.8407, 27.6540}, +{3973.11, 72.1859, 27.0061}, +{4007.90, 69.6976, 26.6604}, +{4008.10, 69.7062, 28.1891}, +{4037.38, 72.3479, 27.8875}, +{4102.68, 73.3463, 27.2338}, +{4169.03, 73.9560, 26.5970}, +{4236.46, 74.3595, 25.9761}, +{4304.98, 74.2630, 25.3693}, +{4316.90, 72.8024, 25.2662}, +{4317.10, 72.8036, 26.2751}, +{4374.62, 75.2216, 25.8091}, +{4445.37, 75.9083, 25.2551}, +{4517.27, 76.4509, 24.7065}, +{4590.33, 76.9216, 24.1678}, +{4664.58, 77.3433, 23.6346}, +{4740.03, 77.7251, 23.1104}, +{4816.69, 78.0747, 22.5946}, +{4894.60, 78.3962, 22.0867}, +{4973.77, 78.6920, 21.5868}, +{5054.21, 78.9646, 21.0954}, +{5135.96, 79.2161, 20.6124}, +{5219.03, 79.4482, 20.1379}, +{5303.44, 79.6621, 19.6718}, +{5389.22, 79.8591, 19.2143}, +{5476.39, 80.0403, 18.7651}, +{5564.97, 80.2067, 18.3245}, +{5654.98, 80.3591, 17.8925}, +{5746.44, 80.4985, 17.4689}, +{5839.39, 80.6255, 17.0536}, +{5933.83, 80.7407, 16.6467}, +{6029.81, 80.8449, 16.2481}, +{6127.33, 80.9387, 15.8578}, +{6226.44, 81.0225, 15.4756}, +{6327.15, 81.0970, 15.1015}, +{6429.48, 81.1625, 14.7355}, +{6533.48, 81.2196, 14.3775}, +{6639.15, 81.2687, 14.0273}, +{6746.54, 81.3102, 13.6849}, +{6855.65, 81.3445, 13.3499}, +{6966.54, 81.3717, 13.0228}, +{7079.22, 81.3927, 12.7031}, +{7193.72, 81.4074, 12.3904}, +{7310.07, 81.4159, 12.0851}, +{7428.31, 81.4188, 11.7870}, +{7548.45, 81.4163, 11.4961}, +{7670.54, 81.4087, 11.2119}, +{7794.61, 81.3961, 10.9345}, +{7920.68, 81.3788, 10.6635}, +{8048.79, 81.3566, 10.3993}, +{8178.98, 81.3301, 10.1414}, +{8311.26, 81.2994, 9.88984}, +{8445.69, 81.2645, 9.64442}, +{8582.29, 81.2255, 9.40521}, +{8721.11, 81.1829, 9.17201}, +{8862.16, 81.1366, 8.94433}, +{9005.50, 81.0864, 8.72233}, +{9151.16, 81.0327, 8.50599}, +{9299.17, 80.9756, 8.29518}, +{9449.58, 80.9152, 8.08979}, +{9602.42, 80.8523, 7.88976}, +{9757.73, 80.7874, 7.69440}, +{9915.55, 80.7245, 7.50457}, +{10075.9, 80.6591, 7.29997}, +{10238.9, 80.5761, 7.10111}, +{10404.5, 80.4845, 6.90784}, +{10572.8, 80.3845, 6.72005}, +{10743.8, 80.2763, 6.53762}, +{10917.6, 80.1597, 6.36045}, +{11094.2, 80.0344, 6.18840}, +{11273.6, 79.8995, 6.02136}, +{11455.9, 79.7543, 5.85923}, +{11641.2, 79.5975, 5.70188}, +{11829.5, 79.4275, 5.54919}, +{12020.8, 79.2421, 5.40107}, +{12215.3, 79.0385, 5.25740}, +{12412.8, 78.8129, 5.11807}, +{12613.6, 78.5598, 4.98297}, +{12817.6, 78.2716, 4.85201}, +{13025.0, 77.9362, 4.72507}, +{13235.6, 77.5346, 4.60206}, +{13449.7, 77.0323, 4.48288}, +{13667.2, 76.3585, 4.36742}, +{13888.3, 75.3248, 4.25560}, +{14112.9, 72.9881, 4.14730}, +{14213.4, 58.9552, 4.10030}, +{14213.6, 58.9560, 10.5209}, +{14341.2, 73.6127, 10.3582}, +{14573.1, 75.7472, 10.0723}, +{14808.9, 76.7353, 9.79428}, +{15048.4, 77.3385, 9.52394}, +{15291.8, 77.7295, 9.26107}, +{15539.1, 77.9706, 9.00546}, +{15790.4, 78.0824, 8.75690}, +{16045.8, 78.0566, 8.51522}, +{16305.4, 77.8385, 8.28020}, +{16569.1, 77.2116, 8.05168}, +{16784.6, 69.6774, 7.87221}, +{16784.8, 69.6782, 11.0740}, +{16837.1, 75.8949, 11.0220}, +{17109.4, 77.7424, 10.7576}, +{17386.1, 77.9924, 10.4996}, +{17492.9, 74.9652, 10.4027}, +{17493.1, 74.9656, 11.8776}, +{17667.4, 78.8223, 11.7076}, +{17953.1, 79.7395, 11.4375}, +{18243.5, 80.3500, 11.1718}, +{18538.6, 80.8299, 10.9105}, +{18838.4, 81.2298, 10.6537}, +{19143.1, 81.5733, 10.4013}, +{19452.7, 81.8739, 10.1534}, +{19767.4, 82.1402, 9.91001}, +{20087.1, 82.3781, 9.67113}, +{20412.0, 82.5921, 9.43676}, +{20742.1, 82.7852, 9.20691}, +{21077.6, 82.9604, 8.98153}, +{21418.5, 83.1194, 8.76064}, +{21765.0, 83.2642, 8.54418}, +{22117.0, 83.3961, 8.33216}, +{22474.7, 83.5164, 8.12452}, +{22838.2, 83.6261, 7.92122}, +{23207.6, 83.7262, 7.72224}, +{23583.0, 83.8174, 7.52752}, +{23964.4, 83.9004, 7.33703}, +{24352.0, 83.9760, 7.15070}, +{24745.9, 84.0446, 6.96850}, +{25146.2, 84.1067, 6.79036}, +{25552.9, 84.1629, 6.61623}, +{25966.2, 84.2135, 6.44606}, +{26386.1, 84.2590, 6.27979}, +{26812.9, 84.2997, 6.11735}, +{27246.6, 84.3359, 5.95869}, +{27687.3, 84.3679, 5.80375}, +{28135.1, 84.3961, 5.65245}, +{28590.2, 84.4205, 5.50476}, +{29052.6, 84.4416, 5.36059}, +{29522.5, 84.4595, 5.21988}, +{30000.0, 84.4744, 5.08258}, +{0, 0, 0} +}; + +e_fp_fdp rn[] = { /* Z = 86 */ +{10.0000, -9999.00, 2.83964}, +{10.1617, -9999.00, 3.21791}, +{10.3261, -9999.00, 3.64656}, +{10.4931, -9999.00, 4.05083}, +{10.6628, -9999.00, 4.42880}, +{10.8353, -9999.00, 4.83437}, +{11.0106, -9999.00, 5.24445}, +{11.1886, -9999.00, 5.68932}, +{11.3696, -9999.00, 6.15277}, +{11.5535, -9999.00, 6.62072}, +{11.7404, -9999.00, 7.12424}, +{11.9303, -9999.00, 7.66606}, +{12.1232, -9999.00, 8.11012}, +{12.3193, -9999.00, 8.55317}, +{12.5186, -9999.00, 9.02044}, +{12.7210, -9999.00, 9.51322}, +{12.9268, -9999.00, 9.95229}, +{13.1359, -9999.00, 10.2962}, +{13.3483, -9999.00, 10.6520}, +{13.5642, -9999.00, 11.0201}, +{13.7836, -9999.00, 11.2657}, +{14.0066, -9999.00, 11.5131}, +{14.2331, -9999.00, 11.7660}, +{14.4633, -9999.00, 12.0243}, +{14.6973, -9999.00, 12.1707}, +{14.9350, -9999.00, 12.3154}, +{15.1765, -9999.00, 12.4618}, +{15.4220, -9999.00, 12.5727}, +{15.6714, -9999.00, 12.6219}, +{15.9249, -9999.00, 12.6713}, +{16.1825, -9999.00, 12.7208}, +{16.4442, -9999.00, 12.6598}, +{16.7102, -9999.00, 12.5958}, +{16.9805, -9999.00, 12.5321}, +{17.2551, -9999.00, 12.3059}, +{17.5342, -9999.00, 12.0486}, +{17.8178, -9999.00, 11.7966}, +{18.1060, -9999.00, 11.6013}, +{18.3989, -9999.00, 11.4664}, +{18.6964, -9999.00, 11.3331}, +{18.9988, -9999.00, 11.2014}, +{19.3061, -9999.00, 11.0386}, +{19.6184, -9999.00, 10.7611}, +{19.9357, -9999.00, 10.4905}, +{20.2582, -9999.00, 10.2267}, +{20.5858, -9999.00, 9.96957}, +{20.9188, -9999.00, 9.76665}, +{21.2571, -9999.00, 9.56995}, +{21.6009, -9999.00, 9.37722}, +{21.9503, -9999.00, 9.18836}, +{22.3053, -9999.00, 9.00331}, +{22.6661, -9999.00, 8.82199}, +{23.0327, -9999.00, 8.64433}, +{23.4053, -9999.00, 8.45422}, +{23.7838, -9999.00, 8.26705}, +{24.1685, -9999.00, 8.08401}, +{24.5594, -9999.00, 7.90503}, +{24.9566, -9999.00, 7.62325}, +{25.3603, -9999.00, 7.30120}, +{25.7705, -9999.00, 6.99277}, +{26.1873, -9999.00, 6.69736}, +{26.6109, -9999.00, 6.45507}, +{27.0413, -9999.00, 6.26164}, +{27.4786, -9999.00, 6.07400}, +{27.9231, -9999.00, 5.89200}, +{28.3747, -9999.00, 5.71544}, +{28.8337, -9999.00, 5.52859}, +{29.3000, 8.71518, 5.26907}, +{29.7739, 8.68786, 5.02173}, +{30.2555, 8.64741, 4.77351}, +{30.7449, 8.57159, 4.52153}, +{31.2421, 8.47077, 4.28284}, +{31.7475, 8.35198, 4.05676}, +{32.2609, 8.21766, 3.84298}, +{32.7827, 8.07020, 3.64090}, +{33.3130, 7.90989, 3.44945}, +{33.8518, 7.73436, 3.26807}, +{34.3993, 7.54790, 3.11098}, +{34.9557, 7.36247, 2.96418}, +{35.5211, 7.17397, 2.82430}, +{36.0956, 6.98331, 2.69102}, +{36.6794, 6.79713, 2.56030}, +{37.2727, 6.59211, 2.40456}, +{37.8755, 6.36070, 2.25829}, +{38.4882, 6.11128, 2.12091}, +{39.1107, 5.84709, 1.99031}, +{39.7432, 5.55914, 1.85893}, +{40.3861, 5.24123, 1.73624}, +{41.0393, 4.88127, 1.64247}, +{41.7031, 4.52196, 1.57759}, +{42.3776, 4.13369, 1.52976}, +{43.0630, 3.75063, 1.52376}, +{43.7595, 3.36519, 1.51778}, +{44.4673, 2.95721, 1.51865}, +{45.1865, 2.53922, 1.53884}, +{45.9174, 2.10206, 1.55930}, +{46.6600, 1.62296, 1.58981}, +{47.4147, 1.12102, 1.65273}, +{48.1816, 0.582067, 1.72522}, +{48.9609, 0.204921E-02, 1.81628}, +{49.7528, -0.665324, 1.93386}, +{50.5576, -1.36470, 2.15938}, +{51.3753, -2.09833, 2.41121}, +{52.2062, -2.92688, 2.69241}, +{53.0506, -3.95070, 3.18367}, +{53.9087, -4.88860, 3.95012}, +{54.7806, -5.70961, 4.92716}, +{55.6667, -6.17281, 5.92273}, +{56.5670, -6.77305, 6.81127}, +{57.4820, -7.46413, 7.85980}, +{58.4117, -8.05313, 9.18750}, +{59.3564, -8.40836, 10.7395}, +{60.3165, -8.18939, 12.2923}, +{61.2921, -8.04823, 13.3509}, +{62.2834, -7.99704, 14.5006}, +{63.2908, -7.92450, 15.7494}, +{64.3145, -7.72538, 17.1057}, +{65.3547, -7.21237, 18.5788}, +{66.4118, -6.59142, 19.5560}, +{67.4859, -6.12019, 20.5418}, +{68.5775, -5.67451, 21.5773}, +{69.6867, -5.20633, 22.6650}, +{70.8138, -4.68647, 23.8076}, +{71.9591, -4.08977, 25.0077}, +{73.1230, -3.38598, 26.2683}, +{74.3057, -2.53645, 27.5925}, +{75.5076, -1.44969, 28.9834}, +{76.7289, 0.152436, 30.4445}, +{77.9699, 1.93962, 30.9909}, +{79.2310, 3.38144, 31.3986}, +{80.5125, 4.71369, 31.8098}, +{81.8147, 5.99553, 32.1798}, +{83.1380, 7.25237, 32.5541}, +{84.4827, 8.51783, 32.9328}, +{85.8491, 9.82230, 33.3160}, +{87.2377, 11.1968, 33.7035}, +{88.6487, 12.7123, 34.0956}, +{90.0825, 14.6236, 34.3390}, +{91.5395, 16.3676, 34.0743}, +{93.0201, 17.9622, 33.8116}, +{94.5246, 19.6635, 33.5510}, +{96.0535, 21.3491, 32.8091}, +{97.6071, 22.8005, 32.0143}, +{99.1858, 24.2188, 31.1591}, +{100.790, 25.4116, 30.1406}, +{102.420, 26.3911, 29.2328}, +{104.077, 27.5281, 28.4480}, +{105.760, 28.8444, 27.1952}, +{107.471, 29.7067, 25.7244}, +{109.209, 30.2528, 24.3331}, +{110.975, 30.6285, 23.0171}, +{112.770, 30.8546, 21.7722}, +{114.594, 30.9005, 20.6611}, +{116.448, 30.9643, 19.7104}, +{118.331, 31.0109, 18.8036}, +{120.245, 31.0207, 17.9384}, +{122.190, 30.9729, 17.1130}, +{124.166, 30.8688, 16.4124}, +{126.175, 30.8127, 15.7877}, +{128.215, 30.7879, 15.1868}, +{130.289, 30.7742, 14.6088}, +{132.397, 30.7745, 14.0528}, +{134.538, 30.8057, 13.5179}, +{136.714, 30.9845, 12.9318}, +{138.925, 31.0212, 12.1505}, +{141.172, 30.9204, 11.4164}, +{143.456, 30.7583, 10.7267}, +{145.776, 30.5515, 10.0787}, +{148.134, 30.3088, 9.46978}, +{150.530, 30.0342, 8.89766}, +{152.964, 29.7196, 8.36010}, +{155.439, 29.3910, 7.90731}, +{157.953, 29.0750, 7.48689}, +{160.507, 28.7644, 7.08882}, +{163.103, 28.4512, 6.71190}, +{165.742, 28.1341, 6.35504}, +{168.422, 27.8125, 6.01714}, +{171.146, 27.4875, 5.69722}, +{173.915, 27.1543, 5.38870}, +{176.727, 26.8086, 5.09680}, +{179.586, 26.4485, 4.82845}, +{182.491, 26.0886, 4.58333}, +{185.442, 25.7228, 4.35065}, +{188.442, 25.3360, 4.13024}, +{191.489, 24.9484, 3.95315}, +{194.587, 24.5649, 3.78365}, +{197.734, 24.1692, 3.62142}, +{200.932, 23.7505, 3.49189}, +{204.182, 23.3420, 3.38833}, +{207.485, 22.9278, 3.28784}, +{210.840, 22.4818, 3.22228}, +{214.251, 22.0648, 3.20049}, +{217.716, 21.6581, 3.17885}, +{221.237, 21.2314, 3.16623}, +{224.816, 20.8148, 3.18242}, +{228.452, 20.4031, 3.19869}, +{232.147, 19.9770, 3.21504}, +{235.902, 19.5170, 3.25895}, +{239.717, 19.0670, 3.33416}, +{243.595, 18.6177, 3.41110}, +{247.535, 18.1401, 3.49227}, +{251.538, 17.6519, 3.61572}, +{255.607, 17.1509, 3.74352}, +{259.741, 16.6081, 3.87585}, +{263.942, 15.9842, 4.07493}, +{268.211, 15.3962, 4.37886}, +{272.549, 14.8251, 4.70546}, +{276.957, 14.2453, 5.05641}, +{281.437, 13.6234, 5.43354}, +{285.989, 12.9825, 5.93628}, +{290.615, 12.3619, 6.50085}, +{295.315, 11.6689, 7.11910}, +{300.092, 11.0352, 8.03985}, +{304.945, 10.7351, 9.11153}, +{309.878, 10.5694, 9.89810}, +{314.890, 10.3316, 10.6700}, +{319.983, 10.0979, 11.5021}, +{325.158, 9.95347, 12.3693}, +{330.418, 9.82344, 13.2271}, +{335.762, 9.74872, 14.1445}, +{341.192, 9.76120, 15.0322}, +{346.711, 9.76794, 15.9005}, +{352.319, 9.80347, 16.8191}, +{358.017, 9.96594, 17.7552}, +{363.808, 10.1391, 18.6401}, +{369.692, 10.3366, 19.5690}, +{375.672, 10.6608, 20.5442}, +{381.748, 11.0676, 21.3535}, +{387.922, 11.4434, 22.1321}, +{394.197, 11.8087, 22.9392}, +{400.573, 12.2192, 23.7756}, +{407.052, 12.7857, 24.6426}, +{413.635, 13.4076, 25.3037}, +{420.326, 13.9530, 25.9136}, +{427.124, 14.4821, 26.5382}, +{434.032, 15.0356, 27.1779}, +{441.052, 15.6994, 27.7914}, +{448.186, 16.3045, 28.2550}, +{455.435, 16.8588, 28.7264}, +{462.802, 17.3930, 29.2056}, +{470.287, 17.9198, 29.6928}, +{477.894, 18.4397, 30.1882}, +{485.623, 18.9601, 30.7083}, +{493.478, 19.5074, 31.2529}, +{501.459, 20.0845, 31.8072}, +{509.570, 20.6946, 32.3713}, +{517.812, 21.3453, 32.9454}, +{526.187, 22.0980, 33.5298}, +{534.698, 22.8835, 33.9949}, +{543.346, 23.6434, 34.4402}, +{552.134, 24.4148, 34.8914}, +{561.065, 25.2205, 35.3484}, +{570.139, 26.0891, 35.8115}, +{579.361, 27.1306, 36.1768}, +{588.732, 28.0992, 36.3534}, +{598.254, 28.9735, 36.5309}, +{607.930, 29.8383, 36.7092}, +{617.763, 30.7108, 36.8885}, +{627.755, 31.6068, 37.0686}, +{637.908, 32.6575, 37.2411}, +{648.226, 33.7422, 37.1532}, +{658.711, 34.6475, 36.9291}, +{669.365, 35.4324, 36.7094}, +{680.191, 36.1392, 36.5368}, +{691.193, 36.8340, 36.3991}, +{702.372, 37.5614, 36.2594}, +{713.733, 38.2796, 36.0378}, +{725.277, 38.9047, 35.7610}, +{737.008, 39.4486, 35.4866}, +{748.928, 39.9120, 35.2142}, +{761.042, 40.2557, 34.9528}, +{773.351, 40.4064, 34.7905}, +{785.859, 40.4669, 34.9683}, +{798.570, 40.8070, 35.4327}, +{811.486, 41.3720, 35.9030}, +{824.611, 42.1227, 36.3798}, +{837.949, 43.1486, 36.8632}, +{851.502, 44.4170, 37.0292}, +{865.274, 45.7746, 36.8375}, +{879.269, 46.8380, 36.3299}, +{893.491, 47.7038, 35.8290}, +{907.943, 48.4569, 35.3350}, +{922.628, 49.1144, 34.8479}, +{937.551, 49.7152, 34.4123}, +{952.715, 50.2811, 33.9935}, +{968.124, 50.8263, 33.5895}, +{983.783, 51.3499, 33.1906}, +{999.695, 51.8533, 32.7929}, +{1015.86, 52.3407, 32.3962}, +{1032.29, 52.7738, 31.9739}, +{1048.99, 53.1575, 31.5981}, +{1065.96, 53.5512, 31.2717}, +{1083.20, 53.9523, 30.9483}, +{1100.72, 54.3515, 30.6278}, +{1118.52, 54.7466, 30.3103}, +{1136.61, 55.1373, 29.9954}, +{1155.00, 55.5243, 29.6835}, +{1173.68, 55.9087, 29.3745}, +{1192.66, 56.2926, 29.0680}, +{1211.95, 56.6801, 28.7642}, +{1231.55, 57.0837, 28.4630}, +{1251.47, 57.5020, 28.1279}, +{1271.72, 57.9221, 27.7564}, +{1292.29, 58.2941, 27.3406}, +{1313.19, 58.6273, 26.9302}, +{1334.43, 58.9357, 26.5257}, +{1356.01, 59.2247, 26.1268}, +{1377.94, 59.4969, 25.7329}, +{1400.23, 59.7546, 25.3445}, +{1422.88, 60.0003, 24.9618}, +{1445.89, 60.2364, 24.5838}, +{1469.28, 60.4671, 24.2071}, +{1493.04, 60.6945, 23.8297}, +{1517.19, 60.9034, 23.4310}, +{1541.73, 61.0886, 23.0350}, +{1566.67, 61.2536, 22.6453}, +{1592.01, 61.4029, 22.2615}, +{1617.76, 61.5381, 21.8836}, +{1643.92, 61.6600, 21.5114}, +{1670.51, 61.7696, 21.1451}, +{1697.53, 61.8676, 20.7848}, +{1724.99, 61.9624, 20.4300}, +{1752.89, 62.0446, 20.0658}, +{1781.24, 62.1076, 19.7028}, +{1810.05, 62.1524, 19.3423}, +{1839.32, 62.1791, 18.9878}, +{1869.07, 62.1901, 18.6395}, +{1899.30, 62.1855, 18.2971}, +{1930.02, 62.1655, 17.9607}, +{1961.24, 62.1303, 17.6301}, +{1992.96, 62.0763, 17.3049}, +{2025.20, 62.0180, 16.9943}, +{2057.95, 61.9445, 16.6704}, +{2091.24, 61.8454, 16.3499}, +{2125.06, 61.7244, 16.0332}, +{2159.43, 61.5794, 15.7197}, +{2194.36, 61.4099, 15.4108}, +{2229.85, 61.2125, 15.1045}, +{2265.92, 60.9850, 14.8032}, +{2302.57, 60.7251, 14.5052}, +{2339.81, 60.4274, 14.2105}, +{2377.66, 60.0871, 13.9203}, +{2416.11, 59.6984, 13.6340}, +{2455.19, 59.2530, 13.3511}, +{2494.90, 58.7400, 13.0721}, +{2535.26, 58.1454, 12.7969}, +{2576.26, 57.4497, 12.5256}, +{2617.93, 56.6247, 12.2581}, +{2660.27, 55.6285, 11.9946}, +{2703.30, 54.3930, 11.7345}, +{2747.03, 52.7969, 11.4782}, +{2791.46, 50.5883, 11.2258}, +{2836.61, 47.0662, 10.9772}, +{2882.49, 37.3615, 10.7322}, +{2892.30, 12.7018, 10.6811}, +{2892.50, 12.7027, 27.4800}, +{2929.11, 43.5982, 26.9458}, +{2976.48, 46.0494, 26.2794}, +{3021.40, 26.8888, 25.6723}, +{3021.60, 26.9105, 37.2030}, +{3024.63, 39.2073, 37.1459}, +{3073.55, 51.4175, 36.2406}, +{3123.26, 55.3706, 35.3578}, +{3173.78, 57.9959, 34.4985}, +{3225.11, 59.9471, 33.6602}, +{3277.27, 61.4497, 32.8441}, +{3330.28, 62.6008, 32.0498}, +{3384.15, 63.4216, 31.2751}, +{3438.88, 63.8418, 30.5200}, +{3494.50, 63.6808, 29.7836}, +{3537.90, 53.5558, 29.2294}, +{3538.10, 53.5701, 35.1080}, +{3551.02, 62.3809, 34.8928}, +{3608.46, 66.4487, 33.9612}, +{3666.82, 68.3655, 33.0556}, +{3726.13, 69.7459, 32.1739}, +{3786.40, 70.8369, 31.3174}, +{3847.64, 71.7292, 30.4854}, +{3909.87, 72.4640, 29.6768}, +{3973.11, 73.0557, 28.8899}, +{4037.38, 73.4946, 28.1241}, +{4102.68, 74.6490, 27.3793}, +{4158.90, 71.6893, 26.7628}, +{4159.10, 71.6979, 28.2788}, +{4169.03, 73.3843, 28.1783}, +{4236.46, 74.6942, 27.5123}, +{4304.98, 75.3390, 26.8609}, +{4374.62, 75.7730, 26.2245}, +{4445.37, 75.9174, 25.6045}, +{4481.90, 74.0424, 25.2940}, +{4482.10, 74.0437, 26.4222}, +{4517.27, 76.3774, 26.1301}, +{4590.33, 77.2118, 25.5406}, +{4664.58, 77.7952, 24.9627}, +{4740.03, 78.2832, 24.3951}, +{4816.69, 78.7108, 23.8381}, +{4894.60, 79.0940, 23.2924}, +{4973.77, 79.4415, 22.7568}, +{5054.21, 79.7580, 22.2317}, +{5135.96, 80.0475, 21.7170}, +{5219.03, 80.3132, 21.2126}, +{5303.44, 80.5571, 20.7180}, +{5389.22, 80.7810, 20.2336}, +{5476.39, 80.9867, 19.7593}, +{5564.97, 81.1757, 19.2945}, +{5654.98, 81.3489, 18.8395}, +{5746.44, 81.5076, 18.3942}, +{5839.39, 81.6526, 17.9580}, +{5933.83, 81.7848, 17.5313}, +{6029.81, 81.9052, 17.1138}, +{6127.33, 82.0142, 16.7052}, +{6226.44, 82.1126, 16.3056}, +{6327.15, 82.2011, 15.9147}, +{6429.48, 82.2802, 15.5325}, +{6533.48, 82.3505, 15.1588}, +{6639.15, 82.4123, 14.7932}, +{6746.54, 82.4661, 14.4361}, +{6855.65, 82.5125, 14.0869}, +{6966.54, 82.5518, 13.7457}, +{7079.22, 82.5843, 13.4122}, +{7193.72, 82.6103, 13.0862}, +{7310.07, 82.6301, 12.7678}, +{7428.31, 82.6442, 12.4570}, +{7548.45, 82.6527, 12.1531}, +{7670.54, 82.6559, 11.8564}, +{7794.61, 82.6540, 11.5667}, +{7920.68, 82.6474, 11.2836}, +{8048.79, 82.6360, 11.0073}, +{8178.98, 82.6202, 10.7374}, +{8311.26, 82.6000, 10.4739}, +{8445.69, 82.5757, 10.2168}, +{8582.29, 82.5474, 9.96574}, +{8721.11, 82.5152, 9.72060}, +{8862.16, 82.4793, 9.48135}, +{9005.50, 82.4397, 9.24773}, +{9151.16, 82.3964, 9.01989}, +{9299.17, 82.3498, 8.79744}, +{9449.58, 82.2998, 8.58041}, +{9602.42, 82.2470, 8.36876}, +{9757.73, 82.1918, 8.16199}, +{9915.55, 82.1369, 7.96051}, +{10075.9, 82.0793, 7.75074}, +{10238.9, 82.0088, 7.54634}, +{10404.5, 81.9315, 7.34721}, +{10572.8, 81.8475, 7.15324}, +{10743.8, 81.7568, 6.96434}, +{10917.6, 81.6595, 6.78040}, +{11094.2, 81.5552, 6.60133}, +{11273.6, 81.4435, 6.42703}, +{11455.9, 81.3238, 6.25739}, +{11641.2, 81.1953, 6.09232}, +{11829.5, 81.0570, 5.93172}, +{12020.8, 80.9078, 5.77549}, +{12215.3, 80.7458, 5.62353}, +{12412.8, 80.5690, 5.47575}, +{12613.6, 80.3745, 5.33206}, +{12817.6, 80.1583, 5.19236}, +{13025.0, 79.9150, 5.05655}, +{13235.6, 79.6366, 4.92456}, +{13449.7, 79.3107, 4.79628}, +{13667.2, 78.9168, 4.67163}, +{13888.3, 78.4174, 4.55052}, +{14112.9, 77.7312, 4.43287}, +{14341.2, 76.6198, 4.31859}, +{14573.1, 73.2783, 4.20760}, +{14619.3, 61.6456, 4.18607}, +{14619.5, 61.6463, 10.1584}, +{14808.9, 76.0695, 9.93452}, +{15048.4, 77.6219, 9.66231}, +{15291.8, 78.4254, 9.39757}, +{15539.1, 78.9296, 9.14010}, +{15790.4, 79.2576, 8.88967}, +{16045.8, 79.4561, 8.64612}, +{16305.4, 79.5396, 8.40923}, +{16569.1, 79.4977, 8.17885}, +{16837.1, 79.2783, 7.95478}, +{17109.4, 78.6814, 7.73686}, +{17337.0, 71.4663, 7.56187}, +{17337.2, 71.4670, 10.6049}, +{17386.1, 77.3018, 10.5605}, +{17667.4, 79.1262, 10.3114}, +{17953.1, 79.3376, 10.0681}, +{18048.9, 76.5977, 9.98863}, +{18049.1, 76.5981, 11.3352}, +{18243.5, 80.2027, 11.1628}, +{18538.6, 81.0296, 10.9095}, +{18838.4, 81.5899, 10.6600}, +{19143.1, 82.0324, 10.4144}, +{19452.7, 82.4020, 10.1727}, +{19767.4, 82.7200, 9.93500}, +{20087.1, 82.9984, 9.70131}, +{20412.0, 83.2453, 9.47165}, +{20742.1, 83.4661, 9.24608}, +{21077.6, 83.6646, 9.02457}, +{21418.5, 83.8440, 8.80717}, +{21765.0, 84.0067, 8.59385}, +{22117.0, 84.1545, 8.38462}, +{22474.7, 84.2891, 8.17946}, +{22838.2, 84.4117, 7.97836}, +{23207.6, 84.5235, 7.78130}, +{23583.0, 84.6255, 7.58825}, +{23964.4, 84.7185, 7.39919}, +{24352.0, 84.8033, 7.21407}, +{24745.9, 84.8804, 7.03288}, +{25146.2, 84.9505, 6.85556}, +{25552.9, 85.0142, 6.68208}, +{25966.2, 85.0718, 6.51239}, +{26386.1, 85.1239, 6.34644}, +{26812.9, 85.1707, 6.18420}, +{27246.6, 85.2127, 6.02560}, +{27687.3, 85.2502, 5.87061}, +{28135.1, 85.2836, 5.71915}, +{28590.2, 85.3129, 5.57119}, +{29052.6, 85.3387, 5.42667}, +{29522.5, 85.3609, 5.28553}, +{30000.0, 85.3800, 5.14772}, +{0, 0, 0} +}; + +e_fp_fdp fr[] = { /* Z = 87 */ +{10.0000, -9999.00, 0.504421E-01}, +{10.1617, -9999.00, 0.605877E-01}, +{10.3261, -9999.00, 0.727738E-01}, +{10.4931, -9999.00, 0.893847E-01}, +{10.6628, -9999.00, 0.117123}, +{10.8353, -9999.00, 0.153468}, +{11.0106, -9999.00, 0.201091}, +{11.1886, -9999.00, 0.263493}, +{11.3696, -9999.00, 0.403215}, +{11.5535, -9999.00, 0.637593}, +{11.7404, -9999.00, 1.00820}, +{11.9303, -9999.00, 1.59425}, +{12.1232, -9999.00, 2.49402}, +{12.3193, -9999.00, 3.36797}, +{12.5186, -9999.00, 4.54817}, +{12.7210, -9999.00, 6.14193}, +{12.9268, -9999.00, 6.92048}, +{13.1359, -9999.00, 7.24654}, +{13.3483, -9999.00, 7.58796}, +{13.5642, -9999.00, 7.88271}, +{13.7836, -9999.00, 8.17329}, +{14.0066, -9999.00, 8.47458}, +{14.2331, -9999.00, 8.76458}, +{14.4633, -9999.00, 8.92935}, +{14.6973, -9999.00, 9.09722}, +{14.9350, -9999.00, 9.26824}, +{15.1765, -9999.00, 9.44249}, +{15.4220, -9999.00, 9.62001}, +{15.6714, -9999.00, 9.74189}, +{15.9249, -9999.00, 9.83268}, +{16.1825, -9999.00, 9.92431}, +{16.4442, -9999.00, 10.0168}, +{16.7102, -9999.00, 10.1101}, +{16.9805, -9999.00, 10.2043}, +{17.2551, -9999.00, 10.3012}, +{17.5342, -9999.00, 10.4303}, +{17.8178, -9999.00, 10.5610}, +{18.1060, -9999.00, 10.6933}, +{18.3989, -9999.00, 10.8272}, +{18.6964, -9999.00, 10.9268}, +{18.9988, -9999.00, 10.9941}, +{19.3061, -9999.00, 11.0620}, +{19.6184, -9999.00, 11.1302}, +{19.9357, -9999.00, 11.1988}, +{20.2582, -9999.00, 11.2458}, +{20.5858, -9999.00, 11.2666}, +{20.9188, -9999.00, 11.2875}, +{21.2571, -9999.00, 11.3085}, +{21.6009, -9999.00, 11.3294}, +{21.9503, -9999.00, 11.3504}, +{22.3053, -9999.00, 11.2709}, +{22.6661, -9999.00, 11.1410}, +{23.0327, -9999.00, 11.0127}, +{23.4053, -9999.00, 10.8858}, +{23.7838, -9999.00, 10.7603}, +{24.1685, -9999.00, 10.6363}, +{24.5594, -9999.00, 10.3907}, +{24.9566, -9999.00, 10.1364}, +{25.3603, -9999.00, 9.88839}, +{25.7705, -9999.00, 9.64642}, +{26.1873, -9999.00, 9.41037}, +{26.6109, -9999.00, 9.18010}, +{27.0413, -9999.00, 8.95545}, +{27.4786, -9999.00, 8.73631}, +{27.9231, -9999.00, 8.36961}, +{28.3747, -9999.00, 8.01786}, +{28.8337, -9999.00, 7.68089}, +{29.3000, 8.20151, 7.35808}, +{29.7739, 8.23441, 7.04884}, +{30.2555, 8.24724, 6.75259}, +{30.7449, 8.24326, 6.46880}, +{31.2421, 8.22521, 6.19693}, +{31.7475, 8.19569, 5.93649}, +{32.2609, 8.15753, 5.68699}, +{32.7827, 8.11852, 5.44798}, +{33.3130, 8.09379, 5.21574}, +{33.8518, 8.04513, 4.92411}, +{34.3993, 7.95254, 4.64877}, +{34.9557, 7.83510, 4.38884}, +{35.5211, 7.69907, 4.14344}, +{36.0956, 7.54766, 3.91176}, +{36.6794, 7.38289, 3.69303}, +{37.2727, 7.20616, 3.48654}, +{37.8755, 7.01849, 3.29159}, +{38.4882, 6.82067, 3.10754}, +{39.1107, 6.61351, 2.93378}, +{39.7432, 6.39861, 2.76918}, +{40.3861, 6.17244, 2.60801}, +{41.0393, 5.93336, 2.45622}, +{41.7031, 5.68251, 2.31327}, +{42.3776, 5.42014, 2.17863}, +{43.0630, 5.14591, 2.05184}, +{43.7595, 4.85917, 1.93242}, +{44.4673, 4.55899, 1.81995}, +{45.1865, 4.24399, 1.71403}, +{45.9174, 3.91179, 1.61427}, +{46.6600, 3.55697, 1.52420}, +{47.4147, 3.18975, 1.45074}, +{48.1816, 2.80584, 1.38083}, +{48.9609, 2.39436, 1.32098}, +{49.7528, 1.96878, 1.27596}, +{50.5576, 1.51783, 1.23537}, +{51.3753, 1.04624, 1.21125}, +{52.2062, 0.548511, 1.18759}, +{53.0506, 0.670946E-02, 1.17509}, +{53.9087, -0.561414, 1.17949}, +{54.7806, -1.17372, 1.18619}, +{55.6667, -1.83459, 1.20744}, +{56.5670, -2.56196, 1.22906}, +{57.4820, -3.37803, 1.28161}, +{58.4117, -4.28019, 1.35180}, +{59.3564, -5.34996, 1.44648}, +{60.3165, -6.58169, 1.67507}, +{61.2921, -7.95180, 2.20927}, +{62.2834, -9.30353, 2.82885}, +{63.2908, -10.7475, 3.62220}, +{64.3145, -12.2909, 4.63807}, +{65.3547, -13.9294, 5.93880}, +{66.4118, -15.6401, 7.60433}, +{67.4859, -17.4392, 9.73701}, +{68.5775, -19.3935, 13.0209}, +{69.6867, -18.9220, 16.9540}, +{70.8138, -18.4113, 20.1567}, +{71.9591, -17.4802, 23.1402}, +{73.1230, -15.6951, 26.0543}, +{74.3057, -14.0159, 27.7573}, +{75.5076, -12.4719, 29.5716}, +{76.7289, -10.4841, 31.2632}, +{77.9699, -8.74043, 32.3030}, +{79.2310, -7.21406, 33.3775}, +{80.5125, -5.65142, 34.4876}, +{81.8147, -3.93848, 35.4116}, +{83.1380, -2.35099, 36.2088}, +{84.4827, -0.785691, 37.0239}, +{85.8491, 0.916632, 37.8574}, +{87.2377, 2.63936, 38.3688}, +{88.6487, 4.29564, 38.8845}, +{90.0825, 5.96767, 39.4071}, +{91.5395, 7.77770, 39.8552}, +{93.0201, 9.55404, 40.1866}, +{94.5246, 11.3939, 40.5207}, +{96.0535, 13.4668, 40.8575}, +{97.6071, 15.7734, 40.7079}, +{99.1858, 17.7984, 40.2947}, +{100.790, 19.7665, 39.8856}, +{102.420, 21.9487, 39.4807}, +{104.077, 24.4055, 38.3227}, +{105.760, 26.1375, 36.6917}, +{107.471, 27.4660, 35.1300}, +{109.209, 28.5434, 33.6349}, +{110.975, 29.4335, 32.2034}, +{112.770, 30.1739, 30.8328}, +{114.594, 30.7890, 29.5205}, +{116.448, 31.2958, 28.2641}, +{118.331, 31.7036, 27.0612}, +{120.245, 32.0015, 25.9095}, +{122.190, 32.2052, 24.8924}, +{124.166, 32.4282, 23.9679}, +{126.175, 32.6437, 23.0778}, +{128.215, 32.8428, 22.2207}, +{130.289, 33.0262, 21.3954}, +{132.397, 33.1984, 20.6008}, +{134.538, 33.3676, 19.8357}, +{136.714, 33.5520, 19.0991}, +{138.925, 33.8206, 18.3897}, +{141.172, 34.0583, 17.4253}, +{143.456, 34.1392, 16.4744}, +{145.776, 34.1129, 15.5753}, +{148.134, 34.0295, 14.7254}, +{150.530, 33.9034, 13.9217}, +{152.964, 33.7450, 13.1620}, +{155.439, 33.5652, 12.4437}, +{157.953, 33.3868, 11.7474}, +{160.507, 33.1577, 11.0518}, +{163.103, 32.8917, 10.3974}, +{165.742, 32.6006, 9.78179}, +{168.422, 32.2902, 9.20258}, +{171.146, 31.9647, 8.65768}, +{173.915, 31.6272, 8.14504}, +{176.727, 31.2834, 7.66276}, +{179.586, 30.9323, 7.19660}, +{182.491, 30.5613, 6.75174}, +{185.442, 30.1761, 6.33440}, +{188.442, 29.7797, 5.94283}, +{191.489, 29.3739, 5.57548}, +{194.587, 28.9708, 5.22303}, +{197.734, 28.5364, 4.87132}, +{200.932, 28.0645, 4.54327}, +{204.182, 27.5334, 4.23733}, +{207.485, 26.9664, 4.08256}, +{210.840, 26.4795, 3.99129}, +{214.251, 26.0727, 3.88848}, +{217.716, 25.6600, 3.75850}, +{221.237, 25.2354, 3.63287}, +{224.816, 24.8024, 3.50930}, +{228.452, 24.3491, 3.38833}, +{232.147, 23.8617, 3.28584}, +{235.902, 23.3420, 3.20832}, +{239.717, 22.8109, 3.21316}, +{243.595, 22.3185, 3.24731}, +{247.535, 21.8371, 3.28183}, +{251.538, 21.3433, 3.31222}, +{255.607, 20.7913, 3.34244}, +{259.741, 20.2516, 3.52247}, +{263.942, 19.7531, 3.67600}, +{268.211, 19.2610, 3.83622}, +{272.549, 18.7511, 4.00466}, +{276.957, 18.2392, 4.21675}, +{281.437, 17.7280, 4.44009}, +{285.989, 17.2042, 4.67525}, +{290.615, 16.6569, 4.93749}, +{295.315, 16.0981, 5.23003}, +{300.092, 15.5105, 5.53991}, +{304.945, 14.7850, 5.93425}, +{309.878, 14.1313, 6.51216}, +{314.890, 13.5958, 7.14638}, +{319.983, 13.0852, 7.74686}, +{325.158, 12.5592, 8.39106}, +{330.418, 12.0135, 9.10047}, +{335.762, 11.5074, 9.93026}, +{341.192, 11.0627, 10.8357}, +{346.711, 10.7325, 11.8029}, +{352.319, 10.4466, 12.7834}, +{358.017, 10.2398, 13.8453}, +{363.808, 10.1713, 14.9043}, +{369.692, 10.1183, 15.9324}, +{375.672, 10.1230, 17.0314}, +{381.748, 10.3144, 18.2062}, +{387.922, 10.6910, 19.2109}, +{394.197, 10.9882, 20.0720}, +{400.573, 11.2682, 20.9717}, +{407.052, 11.6032, 21.9118}, +{413.635, 12.1193, 22.8152}, +{420.326, 12.5619, 23.5265}, +{427.124, 12.9540, 24.2599}, +{434.032, 13.3424, 25.0161}, +{441.052, 13.7491, 25.7960}, +{448.186, 14.1936, 26.6001}, +{455.435, 14.7291, 27.4040}, +{462.802, 15.2640, 28.1419}, +{470.287, 15.8142, 28.8996}, +{477.894, 16.4128, 29.6778}, +{485.623, 17.1107, 30.4769}, +{493.478, 17.9839, 31.1245}, +{501.459, 18.7684, 31.5948}, +{509.570, 19.4516, 32.0722}, +{517.812, 20.1179, 32.5568}, +{526.187, 20.7795, 33.0487}, +{534.698, 21.4467, 33.5481}, +{543.346, 22.1514, 34.0550}, +{552.134, 22.8749, 34.5069}, +{561.065, 23.5618, 34.9290}, +{570.139, 24.2220, 35.3562}, +{579.361, 24.7993, 35.7886}, +{588.732, 25.2954, 36.3997}, +{598.254, 25.9975, 37.2383}, +{607.930, 26.9086, 38.0962}, +{617.763, 28.0481, 38.9739}, +{627.755, 29.7023, 39.7894}, +{637.908, 31.2485, 39.8286}, +{648.226, 32.6112, 39.8678}, +{658.711, 34.1322, 39.8011}, +{669.365, 35.4298, 39.3794}, +{680.191, 36.4527, 38.9622}, +{691.193, 37.3235, 38.5495}, +{702.372, 38.1307, 38.2563}, +{713.733, 38.9185, 37.9709}, +{725.277, 39.6908, 37.6876}, +{737.008, 40.4639, 37.4065}, +{748.928, 41.2133, 37.0405}, +{761.042, 41.8831, 36.6436}, +{773.351, 42.4664, 36.2509}, +{785.859, 42.9837, 35.8804}, +{798.570, 43.4592, 35.5360}, +{811.486, 43.8874, 35.1995}, +{824.611, 44.2473, 34.8663}, +{837.949, 44.4649, 34.5362}, +{851.502, 44.5618, 34.4281}, +{865.274, 44.6398, 34.5656}, +{879.269, 44.9663, 34.9261}, +{893.491, 45.4932, 35.2900}, +{907.943, 46.1977, 35.6579}, +{922.628, 47.2259, 36.0296}, +{937.551, 48.3156, 35.8739}, +{952.715, 49.3199, 35.5848}, +{968.124, 50.1449, 35.1819}, +{983.783, 50.8674, 34.7837}, +{999.695, 51.5308, 34.3849}, +{1015.86, 52.1576, 33.9853}, +{1032.29, 52.7043, 33.5441}, +{1048.99, 53.1798, 33.1564}, +{1065.96, 53.6578, 32.8253}, +{1083.20, 54.1379, 32.4967}, +{1100.72, 54.6110, 32.1711}, +{1118.52, 55.0763, 31.8486}, +{1136.61, 55.5343, 31.5285}, +{1155.00, 55.9863, 31.2112}, +{1173.68, 56.4345, 30.8968}, +{1192.66, 56.8817, 30.5849}, +{1211.95, 57.3335, 30.2759}, +{1231.55, 57.8066, 29.9695}, +{1251.47, 58.2990, 29.6183}, +{1271.72, 58.7939, 29.2201}, +{1292.29, 59.2283, 28.7649}, +{1313.19, 59.6140, 28.3156}, +{1334.43, 59.9686, 27.8729}, +{1356.01, 60.2988, 27.4366}, +{1377.94, 60.6084, 27.0065}, +{1400.23, 60.9004, 26.5826}, +{1422.88, 61.1767, 26.1646}, +{1445.89, 61.4402, 25.7530}, +{1469.28, 61.6951, 25.3439}, +{1493.04, 61.9423, 24.9356}, +{1517.19, 62.1706, 24.5136}, +{1541.73, 62.3769, 24.0956}, +{1566.67, 62.5642, 23.6843}, +{1592.01, 62.7360, 23.2790}, +{1617.76, 62.8933, 22.8801}, +{1643.92, 63.0373, 22.4873}, +{1670.51, 63.1687, 22.1008}, +{1697.53, 63.2886, 21.7206}, +{1724.99, 63.4035, 21.3460}, +{1752.89, 63.5059, 20.9654}, +{1781.24, 63.5910, 20.5871}, +{1810.05, 63.6593, 20.2120}, +{1839.32, 63.7108, 19.8430}, +{1869.07, 63.7476, 19.4805}, +{1899.30, 63.7705, 19.1242}, +{1930.02, 63.7792, 18.7736}, +{1961.24, 63.7735, 18.4293}, +{1992.96, 63.7511, 18.0909}, +{2025.20, 63.7249, 17.7664}, +{2057.95, 63.6857, 17.4314}, +{2091.24, 63.6247, 17.1003}, +{2125.06, 63.5448, 16.7728}, +{2159.43, 63.4451, 16.4500}, +{2194.36, 63.3248, 16.1310}, +{2229.85, 63.1824, 15.8168}, +{2265.92, 63.0164, 15.5068}, +{2302.57, 62.8247, 15.2013}, +{2339.81, 62.6053, 14.9002}, +{2377.66, 62.3546, 14.6024}, +{2416.11, 62.0682, 14.3086}, +{2455.19, 61.7416, 14.0198}, +{2494.90, 61.3702, 13.7357}, +{2535.26, 60.9460, 13.4550}, +{2576.26, 60.4591, 13.1785}, +{2617.93, 59.8965, 12.9062}, +{2660.27, 59.2412, 12.6381}, +{2703.30, 58.4682, 12.3739}, +{2747.03, 57.5406, 12.1139}, +{2791.46, 56.4004, 11.8581}, +{2836.61, 54.9474, 11.6062}, +{2882.49, 52.9829, 11.3581}, +{2929.11, 50.0080, 11.1141}, +{2976.48, 43.7571, 10.8739}, +{2999.80, 14.7588, 10.7590}, +{3000.00, 14.7598, 27.3411}, +{3024.63, 43.5016, 26.9988}, +{3073.55, 47.7068, 26.3394}, +{3123.26, 45.2210, 25.6965}, +{3136.10, 28.3985, 25.5346}, +{3136.30, 28.4101, 36.8344}, +{3173.78, 51.3460, 36.1758}, +{3225.11, 56.0636, 35.3049}, +{3277.27, 58.9599, 34.4576}, +{3330.28, 61.0702, 33.6308}, +{3384.15, 62.6955, 32.8259}, +{3438.88, 63.9602, 32.0403}, +{3494.50, 64.9104, 31.2760}, +{3551.02, 65.5147, 30.5293}, +{3608.46, 65.5359, 29.8028}, +{3662.90, 57.1638, 29.1403}, +{3663.10, 57.1679, 33.7873}, +{3666.82, 62.6257, 33.7358}, +{3726.13, 67.6779, 32.9324}, +{3786.40, 69.4397, 32.1506}, +{3847.64, 70.7093, 31.3878}, +{3909.87, 71.7279, 30.6440}, +{3973.11, 72.5770, 29.9189}, +{4037.38, 73.2932, 29.2121}, +{4102.68, 73.8913, 28.5227}, +{4169.03, 74.3660, 27.8490}, +{4236.46, 74.6756, 27.1939}, +{4304.98, 74.5157, 26.5536}, +{4326.90, 72.0670, 26.3542}, +{4327.10, 72.0685, 27.8702}, +{4374.62, 75.3603, 27.4310}, +{4445.37, 76.1956, 26.7982}, +{4517.27, 76.7376, 26.1794}, +{4590.33, 77.3433, 25.5745}, +{4651.90, 75.8060, 25.0829}, +{4652.10, 75.8133, 26.1797}, +{4664.58, 77.0697, 26.0793}, +{4740.03, 78.1543, 25.4862}, +{4816.69, 78.7891, 24.9064}, +{4894.60, 79.3065, 24.3360}, +{4973.77, 79.7544, 23.7768}, +{5054.21, 80.1531, 23.2285}, +{5135.96, 80.5125, 22.6908}, +{5219.03, 80.8390, 22.1636}, +{5303.44, 81.1369, 21.6469}, +{5389.22, 81.4093, 21.1404}, +{5476.39, 81.6587, 20.6442}, +{5564.97, 81.8874, 20.1584}, +{5654.98, 82.0973, 19.6826}, +{5746.44, 82.2897, 19.2165}, +{5839.39, 82.4657, 18.7603}, +{5933.83, 82.6265, 18.3138}, +{6029.81, 82.7736, 17.8771}, +{6127.33, 82.9076, 17.4494}, +{6226.44, 83.0291, 17.0313}, +{6327.15, 83.1393, 16.6224}, +{6429.48, 83.2387, 16.2224}, +{6533.48, 83.3279, 15.8312}, +{6639.15, 83.4075, 15.4488}, +{6746.54, 83.4782, 15.0752}, +{6855.65, 83.5403, 14.7097}, +{6966.54, 83.5943, 14.3529}, +{7079.22, 83.6410, 14.0041}, +{7193.72, 83.6805, 13.6631}, +{7310.07, 83.7129, 13.3301}, +{7428.31, 83.7389, 13.0049}, +{7548.45, 83.7589, 12.6874}, +{7670.54, 83.7733, 12.3772}, +{7794.61, 83.7820, 12.0743}, +{7920.68, 83.7854, 11.7785}, +{8048.79, 83.7837, 11.4897}, +{8178.98, 83.7773, 11.2077}, +{8311.26, 83.7664, 10.9328}, +{8445.69, 83.7512, 10.6640}, +{8582.29, 83.7317, 10.4022}, +{8721.11, 83.7084, 10.1462}, +{8862.16, 83.6811, 9.89667}, +{9005.50, 83.6502, 9.65290}, +{9151.16, 83.6157, 9.41525}, +{9299.17, 83.5780, 9.18341}, +{9449.58, 83.5369, 8.95697}, +{9602.42, 83.4931, 8.73654}, +{9757.73, 83.4476, 8.52126}, +{9915.55, 83.4018, 8.31068}, +{10075.9, 83.3538, 8.09597}, +{10238.9, 83.2965, 7.88559}, +{10404.5, 83.2338, 7.67944}, +{10572.8, 83.1655, 7.47743}, +{10743.8, 83.0916, 7.27948}, +{10917.6, 83.0118, 7.08550}, +{11094.2, 82.9259, 6.89542}, +{11273.6, 82.8335, 6.70915}, +{11455.9, 82.7340, 6.52662}, +{11641.2, 82.6268, 6.34774}, +{11829.5, 82.5112, 6.17244}, +{12020.8, 82.3862, 6.00065}, +{12215.3, 82.2506, 5.83228}, +{12412.8, 82.1030, 5.66728}, +{12613.6, 81.9414, 5.50556}, +{12817.6, 81.7633, 5.34707}, +{13025.0, 81.5655, 5.19173}, +{13235.6, 81.3437, 5.03948}, +{13449.7, 81.0914, 4.89026}, +{13667.2, 80.7995, 4.74399}, +{13888.3, 80.4537, 4.60062}, +{14112.9, 80.0295, 4.46009}, +{14341.2, 79.4808, 4.32234}, +{14573.1, 78.7013, 4.18730}, +{14808.9, 77.3355, 4.05493}, +{15031.1, 62.5967, 3.93578}, +{15031.3, 62.5970, 9.97013}, +{15048.4, 72.5037, 9.95030}, +{15291.8, 77.7719, 9.67449}, +{15539.1, 79.0260, 9.40633}, +{15790.4, 79.7286, 9.14560}, +{16045.8, 80.1794, 8.89211}, +{16305.4, 80.4733, 8.64564}, +{16569.1, 80.6477, 8.40601}, +{16837.1, 80.7135, 8.17303}, +{17109.4, 80.6586, 7.94651}, +{17386.1, 80.4305, 7.72627}, +{17667.4, 79.8216, 7.51213}, +{17906.4, 72.4356, 7.33736}, +{17906.6, 72.4357, 10.3520}, +{17953.1, 78.3486, 10.3123}, +{18243.5, 80.2277, 10.0704}, +{18538.6, 80.4351, 9.83412}, +{18638.9, 77.6556, 9.75589}, +{18639.1, 77.6561, 11.1125}, +{18838.4, 81.2916, 10.9408}, +{19143.1, 82.1175, 10.6867}, +{19452.7, 82.6729, 10.4370}, +{19767.4, 83.1094, 10.1915}, +{20087.1, 83.4726, 9.95041}, +{20412.0, 83.7840, 9.71366}, +{20742.1, 84.0559, 9.48127}, +{21077.6, 84.2964, 9.25323}, +{21418.5, 84.5108, 9.02956}, +{21765.0, 84.7032, 8.81022}, +{22117.0, 84.8766, 8.59521}, +{22474.7, 85.0335, 8.38450}, +{22838.2, 85.1758, 8.17805}, +{23207.6, 85.3050, 7.97585}, +{23583.0, 85.4225, 7.77785}, +{23964.4, 85.5295, 7.58403}, +{24352.0, 85.6268, 7.39432}, +{24745.9, 85.7154, 7.20869}, +{25146.2, 85.7959, 7.02710}, +{25552.9, 85.8690, 6.84950}, +{25966.2, 85.9353, 6.67583}, +{26386.1, 85.9954, 6.50603}, +{26812.9, 86.0496, 6.34007}, +{27246.6, 86.0985, 6.17787}, +{27687.3, 86.1423, 6.01939}, +{28135.1, 86.1815, 5.86455}, +{28590.2, 86.2164, 5.71332}, +{29052.6, 86.2472, 5.56562}, +{29522.5, 86.2743, 5.42140}, +{30000.0, 86.2979, 5.28059}, +{0, 0, 0} +}; + +e_fp_fdp ra[] = { /* Z = 88 */ +{10.0000, -9999.00, 0.416155E-01}, +{10.1617, -9999.00, 0.447891E-01}, +{10.3261, -9999.00, 0.482047E-01}, +{10.4931, -9999.00, 0.518808E-01}, +{10.6628, -9999.00, 0.558373E-01}, +{10.8353, -9999.00, 0.600954E-01}, +{11.0106, -9999.00, 0.646784E-01}, +{11.1886, -9999.00, 0.696108E-01}, +{11.3696, -9999.00, 0.749193E-01}, +{11.5535, -9999.00, 0.810239E-01}, +{11.7404, -9999.00, 0.895658E-01}, +{11.9303, -9999.00, 0.983588E-01}, +{12.1232, -9999.00, 0.106042}, +{12.3193, -9999.00, 0.114325}, +{12.5186, -9999.00, 0.123256}, +{12.7210, -9999.00, 0.134144}, +{12.9268, -9999.00, 0.146005}, +{13.1359, -9999.00, 0.159223}, +{13.3483, -9999.00, 0.177830}, +{13.5642, -9999.00, 0.198612}, +{13.7836, -9999.00, 0.218147}, +{14.0066, -9999.00, 0.238232}, +{14.2331, -9999.00, 0.261404}, +{14.4633, -9999.00, 0.310039}, +{14.6973, -9999.00, 0.346301}, +{14.9350, -9999.00, 0.394322}, +{15.1765, -9999.00, 0.450738}, +{15.4220, -9999.00, 0.507685}, +{15.6714, -9999.00, 0.601651}, +{15.9249, -9999.00, 0.774102}, +{16.1825, -9999.00, 1.02488}, +{16.4442, -9999.00, 1.51883}, +{16.7102, -9999.00, 2.21984}, +{16.9805, -9999.00, 3.07294}, +{17.2551, -9999.00, 3.83627}, +{17.5342, -9999.00, 4.65683}, +{17.8178, -9999.00, 5.53903}, +{18.1060, -9999.00, 6.33654}, +{18.3989, -9999.00, 7.24889}, +{18.6964, -9999.00, 7.79441}, +{18.9988, -9999.00, 8.37895}, +{19.3061, -9999.00, 9.00733}, +{19.6184, -9999.00, 9.34882}, +{19.9357, -9999.00, 9.66155}, +{20.2582, -9999.00, 9.94611}, +{20.5858, -9999.00, 10.2140}, +{20.9188, -9999.00, 10.4890}, +{21.2571, -9999.00, 10.6666}, +{21.6009, -9999.00, 10.7906}, +{21.9503, -9999.00, 10.9161}, +{22.3053, -9999.00, 10.9629}, +{22.6661, -9999.00, 10.9902}, +{23.0327, -9999.00, 11.0176}, +{23.4053, -9999.00, 11.0451}, +{23.7838, -9999.00, 11.0788}, +{24.1685, -9999.00, 11.1201}, +{24.5594, -9999.00, 11.1615}, +{24.9566, -9999.00, 11.2030}, +{25.3603, -9999.00, 11.2447}, +{25.7705, -9999.00, 11.2654}, +{26.1873, -9999.00, 11.1628}, +{26.6109, -9999.00, 11.0612}, +{27.0413, -9999.00, 10.9606}, +{27.4786, -9999.00, 10.8608}, +{27.9231, -9999.00, 10.6947}, +{28.3747, -9999.00, 10.3380}, +{28.8337, -9999.00, 9.99321}, +{29.3000, 10.0231, 9.65993}, +{29.7739, 10.3869, 9.31387}, +{30.2555, 10.6731, 8.80151}, +{30.7449, 10.8378, 8.31736}, +{31.2421, 10.9276, 7.85982}, +{31.7475, 10.9564, 7.42746}, +{32.2609, 10.9156, 7.03794}, +{32.7827, 10.8750, 6.72826}, +{33.3130, 10.8401, 6.43221}, +{33.8518, 10.7975, 6.14918}, +{34.3993, 10.7449, 5.87861}, +{34.9557, 10.6821, 5.61994}, +{35.5211, 10.6094, 5.37266}, +{36.0956, 10.5275, 5.13626}, +{36.6794, 10.4378, 4.91025}, +{37.2727, 10.3440, 4.69356}, +{37.8755, 10.2388, 4.47125}, +{38.4882, 10.1175, 4.25945}, +{39.1107, 9.98372, 4.05770}, +{39.7432, 9.83946, 3.86549}, +{40.3861, 9.68548, 3.68239}, +{41.0393, 9.52230, 3.50797}, +{41.7031, 9.35041, 3.34181}, +{42.3776, 9.17094, 3.18351}, +{43.0630, 8.98657, 3.03210}, +{43.7595, 8.79012, 2.87624}, +{44.4673, 8.57817, 2.72839}, +{45.1865, 8.35357, 2.58814}, +{45.9174, 8.11693, 2.45510}, +{46.6600, 7.86833, 2.32890}, +{47.4147, 7.60777, 2.20918}, +{48.1816, 7.33637, 2.09562}, +{48.9609, 7.05586, 1.98010}, +{49.7528, 6.75056, 1.86495}, +{50.5576, 6.42306, 1.75650}, +{51.3753, 6.07239, 1.65436}, +{52.2062, 5.69115, 1.55978}, +{53.0506, 5.29561, 1.49693}, +{53.9087, 4.89295, 1.43661}, +{54.7806, 4.48402, 1.36656}, +{55.6667, 4.01550, 1.26162}, +{56.5670, 3.47459, 1.20005}, +{57.4820, 2.92314, 1.16970}, +{58.4117, 2.33601, 1.14011}, +{59.3564, 1.70094, 1.12369}, +{60.3165, 1.00897, 1.12144}, +{61.2921, 0.254754, 1.12785}, +{62.2834, -0.582389, 1.17308}, +{63.2908, -1.49577, 1.23717}, +{64.3145, -2.51051, 1.34964}, +{65.3547, -3.65452, 1.52064}, +{66.4118, -4.93668, 1.75547}, +{67.4859, -6.34632, 2.14859}, +{68.5775, -7.89092, 2.62972}, +{69.6867, -9.63515, 3.21861}, +{70.8138, -11.7133, 3.93935}, +{71.9591, -14.5297, 4.85418}, +{73.1230, -17.7766, 7.24885}, +{74.3057, -20.9928, 10.8250}, +{75.5076, -23.6066, 16.1657}, +{76.7289, -23.4843, 24.1976}, +{77.9699, -20.0133, 28.9189}, +{79.2310, -16.5771, 32.5597}, +{80.5125, -13.5652, 34.3912}, +{81.8147, -11.1454, 36.3257}, +{83.1380, -8.67461, 38.3690}, +{84.4827, -5.52921, 40.0268}, +{85.8491, -2.79682, 41.0978}, +{87.2377, -0.162060, 42.1976}, +{88.6487, 2.91758, 42.9495}, +{90.0825, 5.57233, 43.1639}, +{91.5395, 8.06484, 43.3795}, +{93.0201, 10.6009, 43.5961}, +{94.5246, 13.5527, 43.5507}, +{96.0535, 16.0787, 42.7158}, +{97.6071, 18.2453, 41.8968}, +{99.1858, 20.2158, 41.0936}, +{100.790, 22.1117, 40.3057}, +{102.420, 24.1283, 39.5330}, +{104.077, 26.1022, 38.1953}, +{105.760, 27.6229, 36.7367}, +{107.471, 28.8848, 35.3337}, +{109.209, 29.9720, 33.9843}, +{110.975, 30.9262, 32.6865}, +{112.770, 31.7765, 31.4381}, +{114.594, 32.5480, 30.2375}, +{116.448, 33.2715, 29.0828}, +{118.331, 34.0274, 27.9721}, +{120.245, 34.6812, 26.6142}, +{122.190, 35.1513, 25.3119}, +{124.166, 35.4919, 24.0733}, +{126.175, 35.7489, 22.8954}, +{128.215, 35.9395, 21.7750}, +{130.289, 36.0776, 20.7095}, +{132.397, 36.1776, 19.6962}, +{134.538, 36.2690, 18.7324}, +{136.714, 36.3179, 17.7215}, +{138.925, 36.2870, 16.7527}, +{141.172, 36.1973, 15.8370}, +{143.456, 36.0688, 14.9713}, +{145.776, 35.9094, 14.1530}, +{148.134, 35.7246, 13.3793}, +{150.530, 35.5195, 12.6480}, +{152.964, 35.2980, 11.9566}, +{155.439, 35.0644, 11.3030}, +{157.953, 34.8235, 10.6852}, +{160.507, 34.5833, 10.1011}, +{163.103, 34.3723, 9.54898}, +{165.742, 34.1356, 8.91629}, +{168.422, 33.8375, 8.31716}, +{171.146, 33.4970, 7.75831}, +{173.915, 33.1315, 7.23700}, +{176.727, 32.7449, 6.75072}, +{179.586, 32.3366, 6.29711}, +{182.491, 31.8869, 5.87399}, +{185.442, 31.4117, 5.55237}, +{188.442, 30.9927, 5.29072}, +{191.489, 30.6014, 5.04142}, +{194.587, 30.2239, 4.80385}, +{197.734, 29.8543, 4.57749}, +{200.932, 29.4892, 4.36178}, +{204.182, 29.1262, 4.15625}, +{207.485, 28.7663, 3.95829}, +{210.840, 28.3997, 3.76496}, +{214.251, 28.0244, 3.58108}, +{217.716, 27.6387, 3.40618}, +{221.237, 27.2334, 3.23983}, +{224.816, 26.7960, 3.10925}, +{228.452, 26.3817, 3.02074}, +{232.147, 25.9740, 2.93474}, +{235.902, 25.5567, 2.85120}, +{239.717, 25.0991, 2.77943}, +{243.595, 24.6586, 2.78581}, +{247.535, 24.2377, 2.79221}, +{251.538, 23.8098, 2.80553}, +{255.607, 23.3916, 2.83898}, +{259.741, 22.9769, 2.87283}, +{263.942, 22.5456, 2.90890}, +{268.211, 22.1124, 2.97595}, +{272.549, 21.6778, 3.04455}, +{276.957, 21.2322, 3.11473}, +{281.437, 20.7612, 3.18653}, +{285.989, 20.2453, 3.29183}, +{290.615, 19.7284, 3.43372}, +{295.315, 19.1783, 3.58172}, +{300.092, 18.6095, 3.80575}, +{304.945, 18.0515, 4.06095}, +{309.878, 17.4869, 4.33803}, +{314.890, 16.9013, 4.63597}, +{319.983, 16.2499, 4.96135}, +{325.158, 15.6030, 5.43912}, +{330.418, 14.9969, 5.96290}, +{335.762, 14.4018, 6.49923}, +{341.192, 13.7838, 7.08147}, +{346.711, 13.1411, 7.77906}, +{352.319, 12.5476, 8.58257}, +{358.017, 12.0247, 9.46906}, +{363.808, 11.6020, 10.3980}, +{369.692, 11.1848, 11.3303}, +{375.672, 10.7944, 12.3461}, +{381.748, 10.4584, 13.4531}, +{387.922, 10.2266, 14.6593}, +{394.197, 10.1049, 15.8895}, +{400.573, 10.1194, 17.1995}, +{407.052, 10.2404, 18.4517}, +{413.635, 10.4488, 19.7691}, +{420.326, 11.0632, 21.0697}, +{427.124, 11.6124, 22.0221}, +{434.032, 12.0595, 23.0176}, +{441.052, 12.5900, 24.0580}, +{448.186, 13.2449, 24.9877}, +{455.435, 13.8724, 25.8376}, +{462.802, 14.4901, 26.7163}, +{470.287, 15.1720, 27.6250}, +{477.894, 16.2130, 28.4596}, +{485.623, 17.1215, 28.9117}, +{493.478, 17.8451, 29.3711}, +{501.459, 18.5299, 29.8377}, +{509.570, 19.1979, 30.3115}, +{517.812, 19.8600, 30.7870}, +{526.187, 20.5593, 31.2700}, +{534.698, 21.2792, 31.6738}, +{543.346, 21.9355, 32.0236}, +{552.134, 22.5468, 32.3773}, +{561.065, 23.0884, 32.7349}, +{570.139, 23.5985, 33.1946}, +{579.361, 24.1779, 33.7250}, +{588.732, 24.8134, 34.2638}, +{598.254, 25.5185, 34.8112}, +{607.930, 26.2651, 35.3151}, +{617.763, 27.0307, 35.8136}, +{627.755, 27.8331, 36.3192}, +{637.908, 28.7748, 36.7994}, +{648.226, 29.6993, 37.1517}, +{658.711, 30.5880, 37.5074}, +{669.365, 31.4948, 37.8700}, +{680.191, 32.4583, 38.2553}, +{691.193, 33.4979, 38.6446}, +{702.372, 34.8668, 39.0378}, +{713.733, 36.2559, 38.9004}, +{725.277, 37.3795, 38.6317}, +{737.008, 38.3693, 38.3637}, +{748.928, 39.2816, 38.0976}, +{761.042, 40.1441, 37.8324}, +{773.351, 40.9783, 37.5578}, +{785.859, 41.7807, 37.2463}, +{798.570, 42.5152, 36.9052}, +{811.486, 43.1949, 36.5670}, +{824.611, 43.8316, 36.2320}, +{837.949, 44.4339, 35.9004}, +{851.502, 45.0013, 35.5572}, +{865.274, 45.5254, 35.2014}, +{879.269, 45.9834, 34.8349}, +{893.491, 46.3682, 34.4723}, +{907.943, 46.6538, 34.1136}, +{922.628, 46.6919, 33.7588}, +{937.551, 46.7277, 33.9054}, +{952.715, 46.9005, 34.1821}, +{968.124, 47.3131, 34.5759}, +{983.783, 47.9325, 34.9740}, +{999.695, 48.7780, 35.3026}, +{1015.86, 49.9482, 35.5540}, +{1032.29, 50.9565, 35.0996}, +{1048.99, 51.7078, 34.7124}, +{1065.96, 52.3732, 34.4027}, +{1083.20, 53.0112, 34.0952}, +{1100.72, 53.6216, 33.7902}, +{1118.52, 54.2104, 33.4874}, +{1136.61, 54.7824, 33.1867}, +{1155.00, 55.3425, 32.8883}, +{1173.68, 55.8951, 32.5921}, +{1192.66, 56.4454, 32.2981}, +{1211.95, 57.0020, 32.0062}, +{1231.55, 57.5883, 31.7162}, +{1251.47, 58.2024, 31.3633}, +{1271.72, 58.8217, 30.9430}, +{1292.29, 59.3575, 30.4415}, +{1313.19, 59.8269, 29.9474}, +{1334.43, 60.2549, 29.4610}, +{1356.01, 60.6504, 28.9817}, +{1377.94, 61.0183, 28.5094}, +{1400.23, 61.3626, 28.0444}, +{1422.88, 61.6859, 27.5864}, +{1445.89, 61.9903, 27.1348}, +{1469.28, 62.2784, 26.6891}, +{1493.04, 62.5522, 26.2487}, +{1517.19, 62.8080, 25.8066}, +{1541.73, 63.0449, 25.3706}, +{1566.67, 63.2650, 24.9417}, +{1592.01, 63.4701, 24.5191}, +{1617.76, 63.6613, 24.1032}, +{1643.92, 63.8395, 23.6936}, +{1670.51, 64.0053, 23.2902}, +{1697.53, 64.1594, 22.8933}, +{1724.99, 64.3104, 22.5029}, +{1752.89, 64.4491, 22.1040}, +{1781.24, 64.5696, 21.7068}, +{1810.05, 64.6727, 21.3127}, +{1839.32, 64.7585, 20.9250}, +{1869.07, 64.8298, 20.5440}, +{1899.30, 64.8870, 20.1696}, +{1930.02, 64.9307, 19.8017}, +{1961.24, 64.9614, 19.4400}, +{1992.96, 64.9752, 19.0837}, +{2025.20, 64.9885, 18.7442}, +{2057.95, 64.9902, 18.3904}, +{2091.24, 64.9704, 18.0409}, +{2125.06, 64.9330, 17.6952}, +{2159.43, 64.8778, 17.3543}, +{2194.36, 64.8048, 17.0176}, +{2229.85, 64.7122, 16.6848}, +{2265.92, 64.5989, 16.3565}, +{2302.57, 64.4642, 16.0332}, +{2339.81, 64.3066, 15.7140}, +{2377.66, 64.1236, 15.3986}, +{2416.11, 63.9123, 15.0873}, +{2455.19, 63.6705, 14.7807}, +{2494.90, 63.3941, 14.4777}, +{2535.26, 63.0783, 14.1794}, +{2576.26, 62.7184, 13.8857}, +{2617.93, 62.3070, 13.5960}, +{2660.27, 61.8350, 13.3107}, +{2703.30, 61.2902, 13.0294}, +{2747.03, 60.6561, 12.7523}, +{2791.46, 59.9093, 12.4794}, +{2836.61, 59.0157, 12.2108}, +{2882.49, 57.9218, 11.9461}, +{2929.11, 56.5362, 11.6854}, +{2976.48, 54.6827, 11.4288}, +{3024.63, 51.9383, 11.1763}, +{3073.55, 46.6276, 10.9277}, +{3104.80, 16.1960, 10.7738}, +{3105.00, 16.1974, 27.2762}, +{3123.26, 43.3843, 27.0160}, +{3173.78, 49.0242, 26.3167}, +{3225.11, 48.2405, 25.6368}, +{3248.30, 29.9784, 25.3389}, +{3248.50, 29.9890, 36.5230}, +{3277.27, 51.3536, 36.0381}, +{3330.28, 56.7290, 35.1722}, +{3384.15, 59.7922, 34.3284}, +{3438.88, 61.9810, 33.5050}, +{3494.50, 63.6549, 32.7040}, +{3551.02, 64.9580, 31.9228}, +{3608.46, 65.9457, 31.1615}, +{3666.82, 66.6031, 30.4195}, +{3726.13, 66.7500, 29.6946}, +{3786.40, 64.0895, 28.9895}, +{3791.70, 58.3484, 28.9288}, +{3791.90, 58.3579, 33.5490}, +{3847.64, 68.4614, 32.8159}, +{3909.87, 70.3455, 32.0283}, +{3973.11, 71.6560, 31.2592}, +{4037.38, 72.6958, 30.5114}, +{4102.68, 73.5590, 29.7810}, +{4169.03, 74.2847, 29.0689}, +{4236.46, 74.8927, 28.3754}, +{4304.98, 75.3823, 27.6967}, +{4374.62, 75.7272, 27.0372}, +{4445.37, 76.0083, 26.3919}, +{4489.40, 73.4397, 26.0032}, +{4489.60, 73.4472, 27.5684}, +{4517.27, 76.0202, 27.3223}, +{4590.33, 77.0475, 26.6901}, +{4664.58, 77.6398, 26.0751}, +{4740.03, 78.0128, 25.4745}, +{4816.69, 77.5927, 24.8874}, +{4821.90, 76.2492, 24.8483}, +{4822.10, 76.2506, 25.9373}, +{4894.60, 78.9790, 25.3852}, +{4973.77, 79.6603, 24.8047}, +{5054.21, 80.1946, 24.2344}, +{5135.96, 80.6516, 23.6752}, +{5219.03, 81.0556, 23.1268}, +{5303.44, 81.4183, 22.5894}, +{5389.22, 81.7465, 22.0623}, +{5476.39, 82.0451, 21.5460}, +{5564.97, 82.3178, 21.0404}, +{5654.98, 82.5674, 20.5453}, +{5746.44, 82.7959, 20.0601}, +{5839.39, 83.0051, 19.5851}, +{5933.83, 83.1966, 19.1202}, +{6029.81, 83.3720, 18.6652}, +{6127.33, 83.5320, 18.2198}, +{6226.44, 83.6781, 17.7842}, +{6327.15, 83.8110, 17.3580}, +{6429.48, 83.9317, 16.9412}, +{6533.48, 84.0409, 16.5334}, +{6639.15, 84.1393, 16.1346}, +{6746.54, 84.2275, 15.7449}, +{6855.65, 84.3063, 15.3639}, +{6966.54, 84.3759, 14.9913}, +{7079.22, 84.4371, 14.6275}, +{7193.72, 84.4904, 14.2716}, +{7310.07, 84.5359, 13.9240}, +{7428.31, 84.5744, 13.5847}, +{7548.45, 84.6064, 13.2529}, +{7670.54, 84.6318, 12.9289}, +{7794.61, 84.6511, 12.6123}, +{7920.68, 84.6645, 12.3031}, +{8048.79, 84.6723, 12.0015}, +{8178.98, 84.6754, 11.7068}, +{8311.26, 84.6732, 11.4188}, +{8445.69, 84.6663, 11.1382}, +{8582.29, 84.6552, 10.8637}, +{8721.11, 84.6394, 10.5959}, +{8862.16, 84.6195, 10.3347}, +{9005.50, 84.5961, 10.0798}, +{9151.16, 84.5691, 9.83055}, +{9299.17, 84.5384, 9.58769}, +{9449.58, 84.5047, 9.35053}, +{9602.42, 84.4684, 9.11929}, +{9757.73, 84.4301, 8.89365}, +{9915.55, 84.3979, 8.67329}, +{10075.9, 84.3631, 8.43869}, +{10238.9, 84.3081, 8.21020}, +{10404.5, 84.2470, 7.98771}, +{10572.8, 84.1792, 7.77110}, +{10743.8, 84.1049, 7.56029}, +{10917.6, 84.0244, 7.35517}, +{11094.2, 83.9377, 7.15562}, +{11273.6, 83.8448, 6.96154}, +{11455.9, 83.7455, 6.77283}, +{11641.2, 83.6395, 6.58937}, +{11829.5, 83.5264, 6.41106}, +{12020.8, 83.4056, 6.23779}, +{12215.3, 83.2766, 6.06945}, +{12412.8, 83.1383, 5.90594}, +{12613.6, 82.9896, 5.74715}, +{12817.6, 82.8292, 5.59299}, +{13025.0, 82.6549, 5.44332}, +{13235.6, 82.4644, 5.29808}, +{13449.7, 82.2542, 5.15714}, +{13667.2, 82.0196, 5.02040}, +{13888.3, 81.7537, 4.88777}, +{14112.9, 81.4464, 4.75915}, +{14341.2, 81.0811, 4.63445}, +{14573.1, 80.6292, 4.51355}, +{14808.9, 80.0330, 4.39638}, +{15048.4, 79.1480, 4.28284}, +{15291.8, 77.3730, 4.17283}, +{15444.3, 63.4445, 4.10618}, +{15444.5, 63.4453, 10.1333}, +{15539.1, 76.5895, 10.0254}, +{15790.4, 79.1100, 9.74735}, +{16045.8, 80.1454, 9.47701}, +{16305.4, 80.7672, 9.21417}, +{16569.1, 81.1762, 8.95863}, +{16837.1, 81.4442, 8.71017}, +{17109.4, 81.6003, 8.46861}, +{17386.1, 81.6513, 8.23376}, +{17667.4, 81.5826, 8.00542}, +{17953.1, 81.3385, 7.78342}, +{18243.5, 80.7011, 7.56758}, +{18484.2, 73.2421, 7.39570}, +{18484.4, 73.2422, 10.4324}, +{18538.6, 79.3439, 10.3877}, +{18838.4, 81.1169, 10.1461}, +{19143.1, 81.2455, 9.91006}, +{19236.6, 78.2514, 9.83947}, +{19236.8, 78.2519, 11.3016}, +{19452.7, 82.2057, 11.1140}, +{19767.4, 83.0544, 10.8497}, +{20087.1, 83.6255, 10.5903}, +{20412.0, 84.0732, 10.3358}, +{20742.1, 84.4447, 10.0862}, +{21077.6, 84.7626, 9.84149}, +{21418.5, 85.0396, 9.60163}, +{21765.0, 85.2840, 9.36658}, +{22117.0, 85.5015, 9.13633}, +{22474.7, 85.6963, 8.91083}, +{22838.2, 85.8716, 8.69003}, +{23207.6, 86.0299, 8.47390}, +{23583.0, 86.1732, 8.26238}, +{23964.4, 86.3031, 8.05543}, +{24352.0, 86.4211, 7.85298}, +{24745.9, 86.5283, 7.65499}, +{25146.2, 86.6256, 7.46139}, +{25552.9, 86.7141, 7.27213}, +{25966.2, 86.7943, 7.08714}, +{26386.1, 86.8671, 6.90635}, +{26812.9, 86.9329, 6.72972}, +{27246.6, 86.9925, 6.55715}, +{27687.3, 87.0461, 6.38860}, +{28135.1, 87.0943, 6.22398}, +{28590.2, 87.1375, 6.06325}, +{29052.6, 87.1760, 5.90632}, +{29522.5, 87.2101, 5.75313}, +{30000.0, 87.2402, 5.60361}, +{0, 0, 0} +}; + +e_fp_fdp ac[] = { /* Z = 89 */ +{10.0000, -9999.00, 1.19484}, +{10.1617, -9999.00, 1.15672}, +{10.3261, -9999.00, 1.11982}, +{10.4931, -9999.00, 1.08410}, +{10.6628, -9999.00, 1.04952}, +{10.8353, -9999.00, 1.01604}, +{11.0106, -9999.00, 0.982343}, +{11.1886, -9999.00, 0.946689}, +{11.3696, -9999.00, 0.912330}, +{11.5535, -9999.00, 0.881524}, +{11.7404, -9999.00, 0.859053}, +{11.9303, -9999.00, 0.837152}, +{12.1232, -9999.00, 0.815811}, +{12.3193, -9999.00, 0.794970}, +{12.5186, -9999.00, 0.773794}, +{12.7210, -9999.00, 0.753182}, +{12.9268, -9999.00, 0.733119}, +{13.1359, -9999.00, 0.713591}, +{13.3483, -9999.00, 0.687995}, +{13.5642, -9999.00, 0.662100}, +{13.7836, -9999.00, 0.637180}, +{14.0066, -9999.00, 0.619840}, +{14.2331, -9999.00, 0.613379}, +{14.4633, -9999.00, 0.606984}, +{14.6973, -9999.00, 0.597514}, +{14.9350, -9999.00, 0.589582}, +{15.1765, -9999.00, 0.593095}, +{15.4220, -9999.00, 0.605186}, +{15.6714, -9999.00, 0.639248}, +{15.9249, -9999.00, 0.736397}, +{16.1825, -9999.00, 0.901612}, +{16.4442, -9999.00, 1.08234}, +{16.7102, -9999.00, 1.33842}, +{16.9805, -9999.00, 1.62334}, +{17.2551, -9999.00, 1.96852}, +{17.5342, -9999.00, 2.46480}, +{17.8178, -9999.00, 2.86404}, +{18.1060, -9999.00, 3.23904}, +{18.3989, -9999.00, 3.73116}, +{18.6964, -9999.00, 4.29807}, +{18.9988, -9999.00, 4.76244}, +{19.3061, -9999.00, 5.27453}, +{19.6184, -9999.00, 5.84167}, +{19.9357, -9999.00, 6.47315}, +{20.2582, -9999.00, 7.17382}, +{20.5858, -9999.00, 7.88646}, +{20.9188, -9999.00, 8.33334}, +{21.2571, -9999.00, 8.80555}, +{21.6009, -9999.00, 9.29141}, +{21.9503, -9999.00, 9.77487}, +{22.3053, -9999.00, 10.2835}, +{22.6661, -9999.00, 10.8186}, +{23.0327, -9999.00, 11.0979}, +{23.4053, -9999.00, 11.3550}, +{23.7838, -9999.00, 11.6181}, +{24.1685, -9999.00, 11.8873}, +{24.5594, -9999.00, 12.1627}, +{24.9566, -9999.00, 12.3644}, +{25.3603, -9999.00, 12.5672}, +{25.7705, -9999.00, 12.6684}, +{26.1873, -9999.00, 12.6700}, +{26.6109, -9999.00, 12.6715}, +{27.0413, -9999.00, 12.6731}, +{27.4786, -9999.00, 12.6121}, +{27.9231, -9999.00, 12.5434}, +{28.3747, -9999.00, 12.4752}, +{28.8337, -9999.00, 12.4073}, +{29.3000, 12.4245, 12.0941}, +{29.7739, 12.9268, 11.6800}, +{30.2555, 13.3157, 11.2806}, +{30.7449, 13.6584, 10.9279}, +{31.2421, 13.9870, 10.5862}, +{31.7475, 14.3327, 10.2552}, +{32.2609, 14.6844, 9.79875}, +{32.7827, 14.9076, 9.32203}, +{33.3130, 15.0551, 8.86851}, +{33.8518, 15.1417, 8.43705}, +{34.3993, 15.1810, 8.08192}, +{34.9557, 15.2439, 7.76168}, +{35.5211, 15.3216, 7.45413}, +{36.0956, 15.4359, 7.12481}, +{36.6794, 15.4948, 6.72992}, +{37.2727, 15.5134, 6.35692}, +{37.8755, 15.4911, 5.95761}, +{38.4882, 15.4129, 5.58207}, +{39.1107, 15.2842, 5.23526}, +{39.7432, 15.1457, 4.95437}, +{40.3861, 15.0107, 4.68855}, +{41.0393, 14.8686, 4.43700}, +{41.7031, 14.7171, 4.20324}, +{42.3776, 14.5621, 3.98413}, +{43.0630, 14.4017, 3.77644}, +{43.7595, 14.2347, 3.57975}, +{44.4673, 14.0618, 3.39405}, +{45.1865, 13.8834, 3.21800}, +{45.9174, 13.7004, 3.05106}, +{46.6600, 13.5172, 2.89279}, +{47.4147, 13.3232, 2.71994}, +{48.1816, 13.1085, 2.55684}, +{48.9609, 12.8768, 2.40351}, +{49.7528, 12.6248, 2.25938}, +{50.5576, 12.3447, 2.14838}, +{51.3753, 12.0809, 2.06175}, +{52.2062, 11.8203, 1.97862}, +{53.0506, 11.5528, 1.89883}, +{53.9087, 11.2713, 1.82477}, +{54.7806, 10.9865, 1.76874}, +{55.6667, 10.6988, 1.71443}, +{56.5670, 10.4019, 1.66179}, +{57.4820, 10.0928, 1.61393}, +{58.4117, 9.77245, 1.56876}, +{59.3564, 9.43719, 1.52485}, +{60.3165, 9.08338, 1.48305}, +{61.2921, 8.70821, 1.44287}, +{62.2834, 8.30415, 1.40378}, +{63.2908, 7.87360, 1.38238}, +{64.3145, 7.41514, 1.36193}, +{65.3547, 6.92040, 1.35982}, +{66.4118, 6.40075, 1.36644}, +{67.4859, 5.83314, 1.38985}, +{68.5775, 5.24931, 1.42283}, +{69.6867, 4.61876, 1.45087}, +{70.8138, 3.92783, 1.48080}, +{71.9591, 3.16375, 1.51197}, +{73.1230, 2.30143, 1.54380}, +{74.3057, 1.32718, 1.61195}, +{75.5076, 0.231366, 1.68979}, +{76.7289, -1.03035, 1.79026}, +{77.9699, -2.51345, 1.90280}, +{79.2310, -4.35667, 2.05900}, +{80.5125, -6.65942, 2.31287}, +{81.8147, -9.96555, 2.88991}, +{83.1380, -14.0760, 4.53099}, +{84.4827, -19.4477, 7.43494}, +{85.8491, -27.1953, 18.5978}, +{87.2377, -19.3023, 28.8378}, +{88.6487, -13.1090, 31.7133}, +{90.0825, -9.83729, 33.5326}, +{91.5395, -6.75249, 35.3832}, +{93.0201, -3.95562, 36.5484}, +{94.5246, -1.43201, 37.7519}, +{96.0535, 1.10684, 38.9950}, +{97.6071, 3.96560, 39.8900}, +{99.1858, 6.49034, 40.3877}, +{100.790, 8.92850, 40.8916}, +{102.420, 11.6171, 41.2553}, +{104.077, 14.0894, 41.1960}, +{105.760, 16.4150, 41.1369}, +{107.471, 18.8600, 40.9401}, +{109.209, 21.1317, 40.5311}, +{110.975, 23.4116, 40.1262}, +{112.770, 26.1403, 39.7253}, +{114.594, 28.6178, 38.0711}, +{116.448, 30.4916, 36.4661}, +{118.331, 32.1412, 34.9287}, +{120.245, 33.6060, 33.1579}, +{122.190, 34.7065, 31.3848}, +{124.166, 35.5408, 29.7066}, +{126.175, 36.2010, 28.1180}, +{128.215, 36.7211, 26.6144}, +{130.289, 37.1257, 25.1912}, +{132.397, 37.4337, 23.8442}, +{134.538, 37.6600, 22.5691}, +{136.714, 37.8170, 21.3623}, +{138.925, 37.9147, 20.2200}, +{141.172, 37.9621, 19.1387}, +{143.456, 37.9667, 18.1153}, +{145.776, 37.9357, 17.1466}, +{148.134, 37.8754, 16.2297}, +{150.530, 37.7930, 15.3618}, +{152.964, 37.6967, 14.5404}, +{155.439, 37.6007, 13.7629}, +{157.953, 37.5543, 13.0269}, +{160.507, 37.4680, 12.1385}, +{163.103, 37.2728, 11.2915}, +{165.742, 37.0036, 10.5036}, +{168.422, 36.6944, 9.77065}, +{171.146, 36.3556, 9.08888}, +{173.915, 35.9936, 8.45466}, +{176.727, 35.6131, 7.86472}, +{179.586, 35.2167, 7.31592}, +{182.491, 34.8061, 6.80544}, +{185.442, 34.3805, 6.33057}, +{188.442, 33.9356, 5.88883}, +{191.489, 33.4436, 5.47793}, +{194.587, 32.9726, 5.20869}, +{197.734, 32.5446, 4.95307}, +{200.932, 32.1427, 4.70998}, +{204.182, 31.7512, 4.47883}, +{207.485, 31.3648, 4.25903}, +{210.840, 30.9781, 4.05000}, +{214.251, 30.5687, 3.86342}, +{217.716, 30.1804, 3.71588}, +{221.237, 29.8093, 3.57398}, +{224.816, 29.4407, 3.43750}, +{228.452, 29.0633, 3.30623}, +{232.147, 28.6859, 3.20132}, +{235.902, 28.3148, 3.10263}, +{239.717, 27.9394, 3.00698}, +{243.595, 27.5283, 2.92899}, +{247.535, 27.1376, 2.89535}, +{251.538, 26.7648, 2.86210}, +{255.607, 26.3908, 2.82922}, +{259.741, 26.0005, 2.79672}, +{263.942, 25.5992, 2.79482}, +{268.211, 25.2100, 2.80759}, +{272.549, 24.8209, 2.82042}, +{276.957, 24.4150, 2.83331}, +{281.437, 24.0021, 2.87205}, +{285.989, 23.5894, 2.91497}, +{290.615, 23.1663, 2.95854}, +{295.315, 22.7135, 3.00275}, +{300.092, 22.2462, 3.08284}, +{304.945, 21.7739, 3.16921}, +{309.878, 21.2835, 3.25799}, +{314.890, 20.7645, 3.34927}, +{319.983, 20.2046, 3.44310}, +{325.158, 19.5557, 3.53955}, +{330.418, 18.8307, 3.74168}, +{335.762, 18.0955, 4.01578}, +{341.192, 17.2960, 4.36634}, +{346.711, 16.5177, 4.84028}, +{352.319, 15.7294, 5.36568}, +{358.017, 14.9454, 6.02678}, +{363.808, 14.1973, 6.77229}, +{369.692, 13.4888, 7.58577}, +{375.672, 12.7910, 8.47388}, +{381.748, 12.0779, 9.48334}, +{387.922, 11.4377, 10.6580}, +{394.197, 10.9324, 11.9781}, +{400.573, 10.5661, 13.3610}, +{407.052, 10.3194, 14.8519}, +{413.635, 10.2624, 16.4588}, +{420.326, 10.7157, 18.0072}, +{427.124, 11.1225, 19.2218}, +{434.032, 11.5054, 20.5184}, +{441.052, 12.1715, 21.7418}, +{448.186, 12.7374, 22.6794}, +{455.435, 13.2505, 23.6574}, +{462.802, 13.8303, 24.6776}, +{470.287, 14.5762, 25.6178}, +{477.894, 15.2317, 26.3638}, +{485.623, 15.8288, 27.1314}, +{493.478, 16.4208, 27.9215}, +{501.459, 17.0332, 28.7345}, +{509.570, 17.6861, 29.5711}, +{517.812, 18.4023, 30.4322}, +{526.187, 19.2982, 31.3183}, +{534.698, 20.3257, 31.9799}, +{543.346, 21.2352, 32.4755}, +{552.134, 22.0841, 32.9787}, +{561.065, 22.9243, 33.4898}, +{570.139, 23.7800, 34.0088}, +{579.361, 24.7516, 34.5358}, +{588.732, 25.7287, 34.8784}, +{598.254, 26.6408, 35.1989}, +{607.930, 27.5462, 35.5223}, +{617.763, 28.5160, 35.8486}, +{627.755, 29.6126, 36.0451}, +{637.908, 30.5504, 35.9998}, +{648.226, 31.3470, 35.9546}, +{658.711, 32.0087, 35.9095}, +{669.365, 32.5085, 35.9817}, +{680.191, 33.1119, 36.2717}, +{691.193, 33.8159, 36.5641}, +{702.372, 34.5943, 36.8589}, +{713.733, 35.5019, 37.1560}, +{725.277, 36.4549, 37.2292}, +{737.008, 37.3360, 37.2373}, +{748.928, 38.1547, 37.2454}, +{761.042, 38.9597, 37.2536}, +{773.351, 39.7891, 37.2611}, +{785.859, 40.6090, 37.2116}, +{798.570, 41.4147, 37.1623}, +{811.486, 42.2472, 37.1130}, +{824.611, 43.1805, 36.9595}, +{837.949, 44.0169, 36.6430}, +{851.502, 44.7238, 36.3162}, +{865.274, 45.3666, 35.9784}, +{879.269, 45.9323, 35.6313}, +{893.491, 46.4188, 35.2876}, +{907.943, 46.8046, 34.9471}, +{922.628, 46.9513, 34.6098}, +{937.551, 47.0935, 34.7477}, +{952.715, 47.3650, 35.0086}, +{968.124, 47.8655, 35.3800}, +{983.783, 48.5662, 35.7551}, +{999.695, 49.4897, 36.0629}, +{1015.86, 50.7351, 36.2959}, +{1032.29, 51.8667, 35.8451}, +{1048.99, 52.7803, 35.3878}, +{1065.96, 53.5486, 34.9295}, +{1083.20, 54.2395, 34.4760}, +{1100.72, 54.8724, 34.0283}, +{1118.52, 55.4595, 33.5864}, +{1136.61, 56.0075, 33.1489}, +{1155.00, 56.5212, 32.7169}, +{1173.68, 57.0039, 32.2902}, +{1192.66, 57.4571, 31.8683}, +{1211.95, 57.8805, 31.4516}, +{1231.55, 58.2666, 31.0398}, +{1251.47, 58.6182, 30.6610}, +{1271.72, 58.9473, 30.3175}, +{1292.29, 59.2950, 30.0155}, +{1313.19, 59.6552, 29.7150}, +{1334.43, 60.0185, 29.4173}, +{1356.01, 60.3839, 29.1225}, +{1377.94, 60.7509, 28.8293}, +{1400.23, 61.1207, 28.5386}, +{1422.88, 61.4969, 28.2506}, +{1445.89, 61.8861, 27.9642}, +{1469.28, 62.3036, 27.6625}, +{1493.04, 62.7537, 27.3367}, +{1517.19, 63.1705, 26.9020}, +{1541.73, 63.5296, 26.4584}, +{1566.67, 63.8441, 26.0215}, +{1592.01, 64.1313, 25.5904}, +{1617.76, 64.3959, 25.1661}, +{1643.92, 64.6415, 24.7484}, +{1670.51, 64.8707, 24.3369}, +{1697.53, 65.0852, 23.9319}, +{1724.99, 65.2964, 23.5333}, +{1752.89, 65.4935, 23.1220}, +{1781.24, 65.6688, 22.7112}, +{1810.05, 65.8239, 22.3023}, +{1839.32, 65.9593, 21.9000}, +{1869.07, 66.0785, 21.5047}, +{1899.30, 66.1831, 21.1163}, +{1930.02, 66.2735, 20.7340}, +{1961.24, 66.3501, 20.3583}, +{1992.96, 66.4096, 19.9889}, +{2025.20, 66.4718, 19.6373}, +{2057.95, 66.5237, 19.2680}, +{2091.24, 66.5526, 18.9019}, +{2125.06, 66.5650, 18.5402}, +{2159.43, 66.5601, 18.1819}, +{2194.36, 66.5387, 17.8286}, +{2229.85, 66.4997, 17.4785}, +{2265.92, 66.4420, 17.1327}, +{2302.57, 66.3651, 16.7915}, +{2339.81, 66.2685, 16.4546}, +{2377.66, 66.1503, 16.1213}, +{2416.11, 66.0088, 15.7926}, +{2455.19, 65.8429, 15.4680}, +{2494.90, 65.6495, 15.1470}, +{2535.26, 65.4258, 14.8306}, +{2576.26, 65.1689, 14.5184}, +{2617.93, 64.8744, 14.2107}, +{2660.27, 64.5379, 13.9078}, +{2703.30, 64.1527, 13.6082}, +{2747.03, 63.7099, 13.3130}, +{2791.46, 63.1989, 13.0221}, +{2836.61, 62.6048, 12.7354}, +{2882.49, 61.9070, 12.4527}, +{2929.11, 61.0750, 12.1740}, +{2976.48, 60.0626, 11.8996}, +{3024.63, 58.7929, 11.6293}, +{3073.55, 57.1227, 11.3630}, +{3123.26, 54.7300, 11.1005}, +{3173.78, 50.5497, 10.8419}, +{3218.90, 18.9273, 10.6195}, +{3219.10, 18.9283, 26.6901}, +{3225.11, 39.9248, 26.6132}, +{3277.27, 50.4875, 25.9599}, +{3330.28, 51.3354, 25.3260}, +{3370.10, 32.7822, 24.8664}, +{3370.30, 32.7924, 35.5979}, +{3384.15, 50.2369, 35.3752}, +{3438.88, 57.4454, 34.5167}, +{3494.50, 60.7790, 33.6814}, +{3551.02, 63.0653, 32.8693}, +{3608.46, 64.7813, 32.0769}, +{3666.82, 66.0985, 31.3042}, +{3726.13, 67.0830, 30.5520}, +{3786.40, 67.7152, 29.8169}, +{3847.64, 67.7823, 29.1024}, +{3908.90, 59.2419, 28.4156}, +{3909.10, 59.2458, 33.0886}, +{3909.87, 62.4831, 33.0787}, +{3973.11, 69.7932, 32.2807}, +{4037.38, 71.6019, 31.5030}, +{4102.68, 72.8901, 30.7446}, +{4169.03, 73.9194, 30.0047}, +{4236.46, 74.7774, 29.2841}, +{4304.98, 75.5028, 28.5799}, +{4374.62, 76.1136, 27.8941}, +{4445.37, 76.6145, 27.2255}, +{4517.27, 76.9886, 26.5736}, +{4590.33, 77.1475, 25.9364}, +{4655.90, 74.4943, 25.3859}, +{4656.10, 74.4955, 26.8664}, +{4664.58, 76.6445, 26.7960}, +{4740.03, 78.1197, 26.1838}, +{4816.69, 78.7580, 25.5873}, +{4894.60, 79.1867, 25.0064}, +{4973.77, 79.3039, 24.4380}, +{5001.90, 77.8048, 24.2412}, +{5002.10, 77.8060, 25.1673}, +{5054.21, 79.9437, 24.8079}, +{5135.96, 80.6378, 24.2616}, +{5219.03, 81.1632, 23.7233}, +{5303.44, 81.6124, 23.1931}, +{5389.22, 82.0105, 22.6710}, +{5476.39, 82.3697, 22.1577}, +{5564.97, 82.6965, 21.6527}, +{5654.98, 82.9953, 21.1564}, +{5746.44, 83.2692, 20.6687}, +{5839.39, 83.5208, 20.1898}, +{5933.83, 83.7519, 19.7194}, +{6029.81, 83.9644, 19.2577}, +{6127.33, 84.1593, 18.8046}, +{6226.44, 84.3380, 18.3604}, +{6327.15, 84.5017, 17.9248}, +{6429.48, 84.6514, 17.4979}, +{6533.48, 84.7880, 17.0794}, +{6639.15, 84.9121, 16.6693}, +{6746.54, 85.0244, 16.2678}, +{6855.65, 85.1257, 15.8747}, +{6966.54, 85.2168, 15.4902}, +{7079.22, 85.2983, 15.1135}, +{7193.72, 85.3703, 14.7450}, +{7310.07, 85.4335, 14.3845}, +{7428.31, 85.4886, 14.0323}, +{7548.45, 85.5359, 13.6874}, +{7670.54, 85.5756, 13.3507}, +{7794.61, 85.6086, 13.0214}, +{7920.68, 85.6347, 12.6994}, +{8048.79, 85.6545, 12.3851}, +{8178.98, 85.6682, 12.0778}, +{8311.26, 85.6762, 11.7781}, +{8445.69, 85.6792, 11.4854}, +{8582.29, 85.6771, 11.1993}, +{8721.11, 85.6700, 10.9201}, +{8862.16, 85.6582, 10.6474}, +{9005.50, 85.6422, 10.3817}, +{9151.16, 85.6223, 10.1218}, +{9299.17, 85.5985, 9.86891}, +{9449.58, 85.5716, 9.62176}, +{9602.42, 85.5419, 9.38093}, +{9757.73, 85.5102, 9.14603}, +{9915.55, 85.4854, 8.91641}, +{10075.9, 85.4578, 8.67087}, +{10238.9, 85.4081, 8.43204}, +{10404.5, 85.3520, 8.19981}, +{10572.8, 85.2888, 7.97408}, +{10743.8, 85.2192, 7.75475}, +{10917.6, 85.1434, 7.54171}, +{11094.2, 85.0617, 7.33486}, +{11273.6, 84.9741, 7.13407}, +{11455.9, 84.8806, 6.93925}, +{11641.2, 84.7811, 6.75028}, +{11829.5, 84.6754, 6.56703}, +{12020.8, 84.5633, 6.38940}, +{12215.3, 84.4442, 6.21726}, +{12412.8, 84.3176, 6.05052}, +{12613.6, 84.1829, 5.88904}, +{12817.6, 84.0391, 5.73273}, +{13025.0, 83.8850, 5.58145}, +{13235.6, 83.7191, 5.43509}, +{13449.7, 83.5393, 5.29356}, +{13667.2, 83.3431, 5.15672}, +{13888.3, 83.1266, 5.02447}, +{14112.9, 82.8848, 4.89670}, +{14341.2, 82.6102, 4.77329}, +{14573.1, 82.2913, 4.65415}, +{14808.9, 81.9091, 4.53916}, +{15048.4, 81.4294, 4.42822}, +{15291.8, 80.7795, 4.32122}, +{15539.1, 79.7564, 4.21807}, +{15790.4, 77.1453, 4.11865}, +{15870.9, 64.5247, 4.08765}, +{15871.1, 64.5254, 10.0440}, +{16045.8, 78.7522, 9.85468}, +{16305.4, 80.4992, 9.58369}, +{16569.1, 81.3693, 9.32016}, +{16837.1, 81.9175, 9.06388}, +{17109.4, 82.2851, 8.81466}, +{17386.1, 82.5272, 8.57229}, +{17667.4, 82.6662, 8.33659}, +{17953.1, 82.7060, 8.10738}, +{18243.5, 82.6304, 7.88447}, +{18538.6, 82.3829, 7.66770}, +{18838.4, 81.7432, 7.45689}, +{19083.1, 74.3577, 7.29152}, +{19083.3, 74.3578, 10.2918}, +{19143.1, 80.4818, 10.2449}, +{19452.7, 82.1804, 10.0079}, +{19767.4, 82.2526, 9.77636}, +{19839.9, 79.6212, 9.72425}, +{19840.1, 79.6216, 11.0444}, +{20087.1, 83.3101, 10.8520}, +{20412.0, 84.0784, 10.6075}, +{20742.1, 84.6127, 10.3664}, +{21077.6, 85.0374, 10.1289}, +{21418.5, 85.3932, 9.89502}, +{21765.0, 85.6998, 9.66483}, +{22117.0, 85.9687, 9.43841}, +{22474.7, 86.2074, 9.21577}, +{22838.2, 86.4209, 8.99695}, +{23207.6, 86.6132, 8.78198}, +{23583.0, 86.7869, 8.57088}, +{23964.4, 86.9446, 8.36366}, +{24352.0, 87.0879, 8.16031}, +{24745.9, 87.2185, 7.96085}, +{25146.2, 87.3375, 7.76526}, +{25552.9, 87.4460, 7.57354}, +{25966.2, 87.5450, 7.38566}, +{26386.1, 87.6353, 7.20160}, +{26812.9, 87.7176, 7.02134}, +{27246.6, 87.7925, 6.84485}, +{27687.3, 87.8606, 6.67210}, +{28135.1, 87.9224, 6.50304}, +{28590.2, 87.9783, 6.33766}, +{29052.6, 88.0288, 6.17589}, +{29522.5, 88.0742, 6.01770}, +{30000.0, 88.1149, 5.86306}, +{0, 0, 0} +}; + +e_fp_fdp th[] = { /* Z = 90 */ +{10.0000, -9999.00, 3.14769}, +{10.1617, -9999.00, 3.10070}, +{10.3261, -9999.00, 3.05442}, +{10.4931, -9999.00, 3.00883}, +{10.6628, -9999.00, 2.96392}, +{10.8353, -9999.00, 2.91968}, +{11.0106, -9999.00, 2.87611}, +{11.1886, -9999.00, 2.83318}, +{11.3696, -9999.00, 2.79089}, +{11.5535, -9999.00, 2.74024}, +{11.7404, -9999.00, 2.66201}, +{11.9303, -9999.00, 2.58600}, +{12.1232, -9999.00, 2.51217}, +{12.3193, -9999.00, 2.44044}, +{12.5186, -9999.00, 2.37457}, +{12.7210, -9999.00, 2.32610}, +{12.9268, -9999.00, 2.27863}, +{13.1359, -9999.00, 2.23212}, +{13.3483, -9999.00, 2.18656}, +{13.5642, -9999.00, 2.13358}, +{13.7836, -9999.00, 2.08142}, +{14.0066, -9999.00, 2.03053}, +{14.2331, -9999.00, 1.97588}, +{14.4633, -9999.00, 1.91003}, +{14.6973, -9999.00, 1.84637}, +{14.9350, -9999.00, 1.78484}, +{15.1765, -9999.00, 1.74404}, +{15.4220, -9999.00, 1.70965}, +{15.6714, -9999.00, 1.67593}, +{15.9249, -9999.00, 1.68899}, +{16.1825, -9999.00, 1.70819}, +{16.4442, -9999.00, 1.72797}, +{16.7102, -9999.00, 1.78318}, +{16.9805, -9999.00, 1.84220}, +{17.2551, -9999.00, 1.92527}, +{17.5342, -9999.00, 2.02413}, +{17.8178, -9999.00, 2.14532}, +{18.1060, -9999.00, 2.27377}, +{18.3989, -9999.00, 2.56475}, +{18.6964, -9999.00, 3.05030}, +{18.9988, -9999.00, 3.71448}, +{19.3061, -9999.00, 4.55803}, +{19.6184, -9999.00, 5.59314}, +{19.9357, -9999.00, 6.60440}, +{20.2582, -9999.00, 7.28920}, +{20.5858, -9999.00, 8.02534}, +{20.9188, -9999.00, 8.41645}, +{21.2571, -9999.00, 8.82663}, +{21.6009, -9999.00, 9.25680}, +{21.9503, -9999.00, 9.70794}, +{22.3053, -9999.00, 10.0376}, +{22.6661, -9999.00, 10.2934}, +{23.0327, -9999.00, 10.5556}, +{23.4053, -9999.00, 10.8246}, +{23.7838, -9999.00, 11.1004}, +{24.1685, -9999.00, 11.3250}, +{24.5594, -9999.00, 11.5480}, +{24.9566, -9999.00, 11.7754}, +{25.3603, -9999.00, 12.0073}, +{25.7705, -9999.00, 12.2437}, +{26.1873, -9999.00, 12.3447}, +{26.6109, -9999.00, 12.4022}, +{27.0413, -9999.00, 12.4599}, +{27.4786, -9999.00, 12.5179}, +{27.9231, -9999.00, 12.5762}, +{28.3747, -9999.00, 12.6348}, +{28.8337, -9999.00, 12.6732}, +{29.3000, 13.2132, 12.6709}, +{29.7739, 13.5854, 12.6685}, +{30.2555, 13.9532, 12.6662}, +{30.7449, 14.3235, 12.6638}, +{31.2421, 14.7028, 12.6615}, +{31.7475, 15.0997, 12.6591}, +{32.2609, 15.5313, 12.6568}, +{32.7827, 16.0567, 12.6544}, +{33.3130, 16.6210, 12.3973}, +{33.8518, 17.0372, 12.1030}, +{34.3993, 17.3790, 11.8156}, +{34.9557, 17.6808, 11.5351}, +{35.5211, 17.9530, 11.2613}, +{36.0956, 18.2054, 10.9939}, +{36.6794, 18.4508, 10.7329}, +{37.2727, 18.6772, 10.4363}, +{37.8755, 18.8660, 10.1440}, +{38.4882, 19.0317, 9.85986}, +{39.1107, 19.1812, 9.58372}, +{39.7432, 19.3251, 9.31531}, +{40.3861, 19.4837, 9.04597}, +{41.0393, 19.6081, 8.71266}, +{41.7031, 19.6836, 8.39163}, +{42.3776, 19.7294, 8.08243}, +{43.0630, 19.7518, 7.78462}, +{43.7595, 19.7543, 7.49779}, +{44.4673, 19.7388, 7.22152}, +{45.1865, 19.7068, 6.95544}, +{45.9174, 19.6589, 6.69915}, +{46.6600, 19.5931, 6.45232}, +{47.4147, 19.5152, 6.22680}, +{48.1816, 19.4311, 6.00983}, +{48.9609, 19.3386, 5.80043}, +{49.7528, 19.2363, 5.59831}, +{50.5576, 19.1238, 5.40325}, +{51.3753, 19.0007, 5.21498}, +{52.2062, 18.8664, 5.03327}, +{53.0506, 18.7199, 4.85789}, +{53.9087, 18.5596, 4.68862}, +{54.7806, 18.3794, 4.52525}, +{55.6667, 18.1609, 4.38531}, +{56.5670, 17.9588, 4.29022}, +{57.4820, 17.7684, 4.19718}, +{58.4117, 17.5773, 4.10616}, +{59.3564, 17.3820, 4.01712}, +{60.3165, 17.1802, 3.93000}, +{61.2921, 16.9699, 3.84478}, +{62.2834, 16.7496, 3.76141}, +{63.2908, 16.5175, 3.67984}, +{64.3145, 16.2718, 3.60004}, +{65.3547, 16.0104, 3.52197}, +{66.4118, 15.7297, 3.44698}, +{67.4859, 15.4324, 3.37842}, +{68.5775, 15.1162, 3.31123}, +{69.6867, 14.7776, 3.24537}, +{70.8138, 14.4129, 3.18083}, +{71.9591, 14.0181, 3.11756}, +{73.1230, 13.5888, 3.05556}, +{74.3057, 13.1193, 2.99479}, +{75.5076, 12.6029, 2.93506}, +{76.7289, 12.0304, 2.87620}, +{77.9699, 11.3902, 2.81851}, +{79.2310, 10.6650, 2.76199}, +{80.5125, 9.83938, 2.71774}, +{81.8147, 8.90003, 2.67394}, +{83.1380, 7.75320, 2.59535}, +{84.4827, 6.34578, 2.59967}, +{85.8491, 4.49988, 2.64646}, +{87.2377, 1.73152, 3.05615}, +{88.6487, -1.71762, 5.14780}, +{90.0825, -4.45996, 9.81732}, +{91.5395, -1.34486, 18.7222}, +{93.0201, 7.03967, 11.9522}, +{94.5246, 2.65975, 4.89822}, +{96.0535, -4.99629, 4.83257}, +{97.6071, -13.7597, 7.70272}, +{99.1858, -22.8361, 14.7427}, +{100.790, -31.0722, 28.2176}, +{102.420, -29.8439, 54.0075}, +{104.077, -10.0772, 67.7876}, +{105.760, 6.22173, 71.2667}, +{107.471, 22.1569, 70.8206}, +{109.209, 36.0201, 61.6804}, +{110.975, 42.3187, 51.0300}, +{112.770, 43.1115, 42.2184}, +{114.594, 42.5829, 37.7589}, +{116.448, 42.6353, 34.1549}, +{118.331, 42.2321, 31.2204}, +{120.245, 42.2281, 29.1424}, +{122.190, 42.3772, 27.2027}, +{124.166, 42.5633, 25.3922}, +{126.175, 42.8301, 23.6692}, +{128.215, 42.9109, 21.7419}, +{130.289, 42.7596, 19.9716}, +{132.397, 42.4052, 18.3454}, +{134.538, 41.7283, 16.9753}, +{136.714, 41.2559, 16.1644}, +{138.925, 40.9691, 15.3923}, +{141.172, 40.8214, 14.6570}, +{143.456, 40.7473, 13.8323}, +{145.776, 40.5986, 12.9870}, +{148.134, 40.4210, 12.1934}, +{150.530, 40.2409, 11.4483}, +{152.964, 40.0864, 10.7487}, +{155.439, 40.1246, 9.98505}, +{157.953, 39.9420, 8.99408}, +{160.507, 39.5664, 8.10146}, +{163.103, 39.1087, 7.29740}, +{165.742, 38.5928, 6.59466}, +{168.422, 38.0564, 5.97352}, +{171.146, 37.4922, 5.41091}, +{173.915, 36.8414, 4.92550}, +{176.727, 36.2629, 4.66099}, +{179.586, 35.7623, 4.41068}, +{182.491, 35.3072, 4.17382}, +{185.442, 34.8743, 3.94968}, +{188.442, 34.4544, 3.73757}, +{191.489, 34.0365, 3.53685}, +{194.587, 33.6150, 3.36901}, +{197.734, 33.2107, 3.22282}, +{200.932, 32.8109, 3.08297}, +{204.182, 32.3793, 2.94919}, +{207.485, 31.9570, 2.92693}, +{210.840, 31.5873, 2.92049}, +{214.251, 31.2551, 2.91406}, +{217.716, 30.9408, 2.90764}, +{221.237, 30.6385, 2.90124}, +{224.816, 30.3429, 2.89485}, +{228.452, 30.0408, 2.88848}, +{232.147, 29.7384, 2.91151}, +{235.902, 29.4589, 2.94828}, +{239.717, 29.1935, 2.98552}, +{243.595, 28.9381, 3.02323}, +{247.535, 28.6897, 3.05696}, +{251.538, 28.4398, 3.08723}, +{255.607, 28.1868, 3.11780}, +{259.741, 27.9271, 3.14868}, +{263.942, 27.6464, 3.18699}, +{268.211, 27.3759, 3.25991}, +{272.549, 27.1158, 3.33450}, +{276.957, 26.8607, 3.41079}, +{281.437, 26.6073, 3.48884}, +{285.989, 26.3551, 3.56866}, +{290.615, 26.1079, 3.65032}, +{295.315, 25.8595, 3.71100}, +{300.092, 25.5901, 3.76393}, +{304.945, 25.2976, 3.81761}, +{309.878, 24.9806, 3.87206}, +{314.890, 24.6145, 3.94683}, +{319.983, 24.2490, 4.05944}, +{325.158, 23.8804, 4.17526}, +{330.418, 23.4858, 4.29439}, +{335.762, 23.0628, 4.44011}, +{341.192, 22.6186, 4.59923}, +{346.711, 22.1357, 4.76406}, +{352.319, 21.5504, 4.95455}, +{358.017, 20.9646, 5.29574}, +{363.808, 20.3843, 5.66044}, +{369.692, 19.6738, 6.09833}, +{375.672, 19.0320, 6.74145}, +{381.748, 18.4807, 7.45237}, +{387.922, 17.9892, 8.23830}, +{394.197, 17.5964, 9.10709}, +{400.573, 17.3692, 9.96364}, +{407.052, 17.1081, 10.7223}, +{413.635, 16.8322, 11.5388}, +{420.326, 16.5744, 12.4174}, +{427.124, 16.3567, 13.3629}, +{434.032, 16.1948, 14.3804}, +{441.052, 16.1167, 15.4754}, +{448.186, 16.2427, 16.5978}, +{455.435, 16.4046, 17.6458}, +{462.802, 16.6183, 18.7601}, +{470.287, 17.0773, 19.8822}, +{477.894, 17.5251, 20.7810}, +{485.623, 17.9774, 21.7204}, +{493.478, 18.5592, 22.7023}, +{501.459, 19.3878, 23.5348}, +{509.570, 20.0710, 24.0582}, +{517.812, 20.6459, 24.5933}, +{526.187, 21.1832, 25.1402}, +{534.698, 21.7102, 25.6993}, +{543.346, 22.2516, 26.2709}, +{552.134, 22.8431, 26.8239}, +{561.065, 23.4059, 27.3139}, +{570.139, 23.9502, 27.8128}, +{579.361, 24.4958, 28.3208}, +{588.732, 25.0527, 28.8381}, +{598.254, 25.6596, 29.3648}, +{607.930, 26.2715, 29.8296}, +{617.763, 26.8710, 30.3007}, +{627.755, 27.4802, 30.7792}, +{637.908, 28.1085, 31.2652}, +{648.226, 28.7699, 31.7589}, +{658.711, 29.4665, 32.2344}, +{669.365, 30.1872, 32.7043}, +{680.191, 30.9428, 33.1810}, +{691.193, 31.7564, 33.6648}, +{702.372, 32.7088, 34.1555}, +{713.733, 33.8649, 34.4772}, +{725.277, 34.8705, 34.4907}, +{737.008, 35.7512, 34.5040}, +{748.928, 36.5921, 34.5174}, +{761.042, 37.4042, 34.4960}, +{773.351, 38.1663, 34.4502}, +{785.859, 38.8935, 34.4044}, +{798.570, 39.6382, 34.3587}, +{811.486, 40.3504, 34.2252}, +{824.611, 40.9857, 34.0729}, +{837.949, 41.5646, 33.9212}, +{851.502, 42.0879, 33.7703}, +{865.274, 42.5219, 33.6200}, +{879.269, 42.9075, 33.5996}, +{893.491, 43.3207, 33.6267}, +{907.943, 43.6903, 33.6537}, +{922.628, 44.0661, 33.8284}, +{937.551, 44.5481, 34.0634}, +{952.715, 45.1061, 34.2999}, +{968.124, 45.7302, 34.5381}, +{983.783, 46.3943, 34.7779}, +{999.695, 47.6408, 34.7525}, +{1015.86, 47.5038, 33.6774}, +{1032.29, 47.8184, 35.3195}, +{1048.99, 49.4540, 36.0186}, +{1065.96, 50.8204, 35.5931}, +{1083.20, 51.8150, 35.1715}, +{1100.72, 52.6619, 34.7547}, +{1118.52, 53.4175, 34.3426}, +{1136.61, 54.1068, 33.9345}, +{1155.00, 54.7436, 33.5309}, +{1173.68, 55.3358, 33.1315}, +{1192.66, 55.8882, 32.7364}, +{1211.95, 56.4025, 32.3454}, +{1231.55, 56.8707, 31.9585}, +{1251.47, 57.2976, 31.6084}, +{1271.72, 57.6977, 31.2971}, +{1292.29, 58.1176, 31.0316}, +{1313.19, 58.5515, 30.7677}, +{1334.43, 58.9899, 30.5058}, +{1356.01, 59.4313, 30.2458}, +{1377.94, 59.8758, 29.9868}, +{1400.23, 60.3254, 29.7295}, +{1422.88, 60.7846, 29.4739}, +{1445.89, 61.2629, 29.2194}, +{1469.28, 61.7807, 28.9429}, +{1493.04, 62.3435, 28.6327}, +{1517.19, 62.8643, 28.1765}, +{1541.73, 63.3105, 27.7065}, +{1566.67, 63.6986, 27.2432}, +{1592.01, 64.0524, 26.7866}, +{1617.76, 64.3778, 26.3374}, +{1643.92, 64.6798, 25.8955}, +{1670.51, 64.9616, 25.4601}, +{1697.53, 65.2253, 25.0313}, +{1724.99, 65.4802, 24.6088}, +{1752.89, 65.7182, 24.1779}, +{1781.24, 65.9339, 23.7489}, +{1810.05, 66.1286, 23.3227}, +{1839.32, 66.3028, 22.9037}, +{1869.07, 66.4601, 22.4920}, +{1899.30, 66.6021, 22.0876}, +{1930.02, 66.7292, 21.6894}, +{1961.24, 66.8418, 21.2978}, +{1992.96, 66.9369, 20.9127}, +{2025.20, 67.0323, 20.5447}, +{2057.95, 67.1165, 20.1620}, +{2091.24, 67.1790, 19.7838}, +{2125.06, 67.2258, 19.4107}, +{2159.43, 67.2563, 19.0412}, +{2194.36, 67.2708, 18.6771}, +{2229.85, 67.2692, 18.3171}, +{2265.92, 67.2508, 17.9617}, +{2302.57, 67.2141, 17.6104}, +{2339.81, 67.1599, 17.2651}, +{2377.66, 67.0871, 16.9233}, +{2416.11, 66.9937, 16.5860}, +{2455.19, 66.8793, 16.2539}, +{2494.90, 66.7421, 15.9259}, +{2535.26, 66.5800, 15.6026}, +{2576.26, 66.3913, 15.2842}, +{2617.93, 66.1728, 14.9701}, +{2660.27, 65.9225, 14.6617}, +{2703.30, 65.6358, 14.3563}, +{2747.03, 65.3071, 14.0557}, +{2791.46, 64.9308, 13.7599}, +{2836.61, 64.4989, 13.4686}, +{2882.49, 64.0006, 13.1814}, +{2929.11, 63.4220, 12.8988}, +{2976.48, 62.7432, 12.6205}, +{3024.63, 61.9359, 12.3466}, +{3073.55, 60.9568, 12.0768}, +{3123.26, 59.7346, 11.8112}, +{3173.78, 58.1396, 11.5498}, +{3225.11, 55.8904, 11.2926}, +{3277.27, 52.1296, 11.0393}, +{3330.28, 33.8696, 10.7902}, +{3331.90, 19.1619, 10.7828}, +{3332.10, 19.1655, 27.0414}, +{3384.15, 50.8010, 26.3508}, +{3438.88, 52.7535, 25.6546}, +{3490.70, 34.0551, 25.0221}, +{3490.90, 34.0729, 35.8594}, +{3494.50, 46.1550, 35.8020}, +{3551.02, 57.4700, 34.9213}, +{3608.46, 61.1429, 34.0640}, +{3666.82, 63.5805, 33.2280}, +{3726.13, 65.3867, 32.4142}, +{3786.40, 66.7683, 31.6218}, +{3847.64, 67.8055, 30.8503}, +{3909.87, 68.4935, 30.0973}, +{3973.11, 68.6647, 29.3631}, +{4037.38, 66.5315, 28.6489}, +{4046.00, 59.9057, 28.5553}, +{4046.20, 59.9150, 33.3085}, +{4102.68, 70.2408, 32.6206}, +{4169.03, 72.2070, 31.8418}, +{4236.46, 73.5601, 31.0826}, +{4304.98, 74.6318, 30.3421}, +{4374.62, 75.5223, 29.6196}, +{4445.37, 76.2758, 28.9150}, +{4517.27, 76.9155, 28.2282}, +{4590.33, 77.4462, 27.5554}, +{4664.58, 77.8581, 26.9018}, +{4740.03, 78.0976, 26.2621}, +{4816.69, 77.6797, 25.6400}, +{4830.30, 75.4531, 25.5321}, +{4830.50, 75.4541, 27.0007}, +{4894.60, 78.8115, 26.5061}, +{4973.77, 79.5383, 25.9163}, +{5054.21, 80.0164, 25.3407}, +{5135.96, 80.3499, 24.7778}, +{5182.20, 78.8630, 24.4688}, +{5182.40, 78.8692, 25.4871}, +{5219.03, 80.6756, 25.2322}, +{5303.44, 81.5016, 24.6609}, +{5389.22, 82.0768, 24.0997}, +{5476.39, 82.5565, 23.5485}, +{5564.97, 82.9764, 23.0072}, +{5654.98, 83.3516, 22.4760}, +{5746.44, 83.6906, 21.9544}, +{5839.39, 83.9987, 21.4430}, +{5933.83, 84.2798, 20.9411}, +{6029.81, 84.5370, 20.4495}, +{6127.33, 84.7726, 19.9672}, +{6226.44, 84.9883, 19.4945}, +{6327.15, 85.1857, 19.0315}, +{6429.48, 85.3664, 18.5782}, +{6533.48, 85.5315, 18.1340}, +{6639.15, 85.6821, 17.6993}, +{6746.54, 85.8192, 17.2739}, +{6855.65, 85.9436, 16.8576}, +{6966.54, 86.0564, 16.4502}, +{7079.22, 86.1579, 16.0514}, +{7193.72, 86.2489, 15.6617}, +{7310.07, 86.3302, 15.2804}, +{7428.31, 86.4019, 14.9078}, +{7548.45, 86.4650, 14.5435}, +{7670.54, 86.5199, 14.1876}, +{7794.61, 86.5670, 13.8394}, +{7920.68, 86.6066, 13.4997}, +{8048.79, 86.6394, 13.1674}, +{8178.98, 86.6654, 12.8430}, +{8311.26, 86.6852, 12.5259}, +{8445.69, 86.6988, 12.2164}, +{8582.29, 86.7068, 11.9144}, +{8721.11, 86.7095, 11.6192}, +{8862.16, 86.7070, 11.3314}, +{9005.50, 86.6999, 11.0503}, +{9151.16, 86.6881, 10.7757}, +{9299.17, 86.6719, 10.5081}, +{9449.58, 86.6517, 10.2468}, +{9602.42, 86.6278, 9.99178}, +{9757.73, 86.6006, 9.74298}, +{9915.55, 86.5739, 9.50008}, +{10075.9, 86.5438, 9.25400}, +{10238.9, 86.5022, 9.01400}, +{10404.5, 86.4557, 8.77994}, +{10572.8, 86.4039, 8.55174}, +{10743.8, 86.3470, 8.32931}, +{10917.6, 86.2853, 8.11255}, +{11094.2, 86.2187, 7.90135}, +{11273.6, 86.1472, 7.69561}, +{11455.9, 86.0707, 7.49525}, +{11641.2, 85.9893, 7.30014}, +{11829.5, 85.9026, 7.11019}, +{12020.8, 85.8105, 6.92530}, +{12215.3, 85.7126, 6.74537}, +{12412.8, 85.6085, 6.57029}, +{12613.6, 85.4978, 6.39997}, +{12817.6, 85.3797, 6.23430}, +{13025.0, 85.2535, 6.07318}, +{13235.6, 85.1183, 5.91652}, +{13449.7, 84.9726, 5.76421}, +{13667.2, 84.8148, 5.61616}, +{13888.3, 84.6428, 5.47228}, +{14112.9, 84.4537, 5.33246}, +{14341.2, 84.2436, 5.19661}, +{14573.1, 84.0068, 5.06464}, +{14808.9, 83.7351, 4.93646}, +{15048.4, 83.4155, 4.81198}, +{15291.8, 83.0264, 4.69110}, +{15539.1, 82.5264, 4.57375}, +{15790.4, 81.8214, 4.45982}, +{16045.8, 80.6049, 4.34925}, +{16300.2, 66.5374, 4.24352}, +{16300.4, 66.5378, 9.91722}, +{16305.4, 73.6404, 9.91196}, +{16569.1, 80.8937, 9.63817}, +{16837.1, 82.1404, 9.37194}, +{17109.4, 82.8362, 9.11308}, +{17386.1, 83.2870, 8.86137}, +{17667.4, 83.5886, 8.61661}, +{17953.1, 83.7804, 8.37862}, +{18243.5, 83.8778, 8.14721}, +{18538.6, 83.8804, 7.92220}, +{18838.4, 83.7682, 7.70341}, +{19143.1, 83.4795, 7.49066}, +{19452.7, 82.7837, 7.28380}, +{19693.1, 75.5630, 7.12931}, +{19693.3, 75.5636, 10.1128}, +{19767.4, 81.6750, 10.0579}, +{20087.1, 82.9986, 9.82623}, +{20412.0, 83.3209, 9.59991}, +{20472.0, 83.7022, 9.55906}, +{20472.2, 83.7052, 10.9926}, +{20742.1, 84.6589, 10.7767}, +{21077.6, 85.3344, 10.5181}, +{21418.5, 85.8354, 10.2645}, +{21765.0, 86.2400, 10.0160}, +{22117.0, 86.5802, 9.77259}, +{22474.7, 86.8731, 9.53414}, +{22838.2, 87.1293, 9.30062}, +{23207.6, 87.3559, 9.07200}, +{23583.0, 87.5577, 8.84821}, +{23964.4, 87.7385, 8.62923}, +{24352.0, 87.9013, 8.41496}, +{24745.9, 88.0482, 8.20538}, +{25146.2, 88.1811, 8.00040}, +{25552.9, 88.3015, 7.79997}, +{25966.2, 88.4108, 7.60402}, +{26386.1, 88.5099, 7.41248}, +{26812.9, 88.5999, 7.22529}, +{27246.6, 88.6815, 7.04237}, +{27687.3, 88.7555, 6.86366}, +{28135.1, 88.8225, 6.68909}, +{28590.2, 88.8831, 6.51858}, +{29052.6, 88.9377, 6.35207}, +{29522.5, 88.9868, 6.18948}, +{30000.0, 89.0309, 6.03074}, +{0, 0, 0} +}; + +e_fp_fdp pa[] = { /* Z = 91 */ +{10.0000, -9999.00, 1.75788}, +{10.1617, -9999.00, 1.76101}, +{10.3261, -9999.00, 1.76414}, +{10.4931, -9999.00, 1.76728}, +{10.6628, -9999.00, 1.73466}, +{10.8353, -9999.00, 1.69295}, +{11.0106, -9999.00, 1.65224}, +{11.1886, -9999.00, 1.61457}, +{11.3696, -9999.00, 1.58512}, +{11.5535, -9999.00, 1.55620}, +{11.7404, -9999.00, 1.52780}, +{11.9303, -9999.00, 1.49993}, +{12.1232, -9999.00, 1.47256}, +{12.3193, -9999.00, 1.44569}, +{12.5186, -9999.00, 1.41932}, +{12.7210, -9999.00, 1.39337}, +{12.9268, -9999.00, 1.36694}, +{13.1359, -9999.00, 1.34101}, +{13.3483, -9999.00, 1.31557}, +{13.5642, -9999.00, 1.29062}, +{13.7836, -9999.00, 1.26613}, +{14.0066, -9999.00, 1.24212}, +{14.2331, -9999.00, 1.21856}, +{14.4633, -9999.00, 1.19751}, +{14.6973, -9999.00, 1.17807}, +{14.9350, -9999.00, 1.15894}, +{15.1765, -9999.00, 1.14013}, +{15.4220, -9999.00, 1.12162}, +{15.6714, -9999.00, 1.10769}, +{15.9249, -9999.00, 1.10134}, +{16.1825, -9999.00, 1.09502}, +{16.4442, -9999.00, 1.10166}, +{16.7102, -9999.00, 1.12178}, +{16.9805, -9999.00, 1.16065}, +{17.2551, -9999.00, 1.23959}, +{17.5342, -9999.00, 1.46231}, +{17.8178, -9999.00, 1.77156}, +{18.1060, -9999.00, 2.14619}, +{18.3989, -9999.00, 2.55993}, +{18.6964, -9999.00, 2.86887}, +{18.9988, -9999.00, 3.21508}, +{19.3061, -9999.00, 3.60308}, +{19.6184, -9999.00, 3.95479}, +{19.9357, -9999.00, 4.21245}, +{20.2582, -9999.00, 4.48692}, +{20.5858, -9999.00, 4.77925}, +{20.9188, -9999.00, 5.09063}, +{21.2571, -9999.00, 5.39216}, +{21.6009, -9999.00, 5.68568}, +{21.9503, -9999.00, 5.99517}, +{22.3053, -9999.00, 6.32151}, +{22.6661, -9999.00, 6.66561}, +{23.0327, -9999.00, 7.02845}, +{23.4053, -9999.00, 7.39578}, +{23.7838, -9999.00, 7.75707}, +{24.1685, -9999.00, 8.13601}, +{24.5594, -9999.00, 8.53346}, +{24.9566, -9999.00, 8.95032}, +{25.3603, -9999.00, 9.38755}, +{25.7705, -9999.00, 9.78338}, +{26.1873, -9999.00, 10.1541}, +{26.6109, -9999.00, 10.5389}, +{27.0413, -9999.00, 10.9382}, +{27.4786, -9999.00, 11.3527}, +{27.9231, -9999.00, 11.7828}, +{28.3747, -9999.00, 12.0963}, +{28.8337, -9999.00, 12.3524}, +{29.3000, 5.69681, 12.6139}, +{29.7739, 6.06336, 12.8809}, +{30.2555, 6.44653, 13.1535}, +{30.7449, 6.86048, 13.4320}, +{31.2421, 7.33106, 13.7163}, +{31.7475, 7.87932, 13.8995}, +{32.2609, 8.36798, 14.0259}, +{32.7827, 8.84589, 14.1536}, +{33.3130, 9.33515, 14.2824}, +{33.8518, 9.85791, 14.4123}, +{34.3993, 10.4555, 14.5435}, +{34.9557, 11.1828, 14.4993}, +{35.5211, 11.7980, 14.3241}, +{36.0956, 12.3177, 14.0694}, +{36.6794, 12.7570, 13.8192}, +{37.2727, 13.1475, 13.5734}, +{37.8755, 13.5017, 13.3320}, +{38.4882, 13.8272, 13.0949}, +{39.1107, 14.1290, 12.8621}, +{39.7432, 14.4111, 12.6333}, +{40.3861, 14.6772, 12.4097}, +{41.0393, 14.9324, 12.1904}, +{41.7031, 15.1810, 11.9750}, +{42.3776, 15.4383, 11.7635}, +{43.0630, 15.7411, 11.5211}, +{43.7595, 15.9750, 11.1833}, +{44.4673, 16.1362, 10.8554}, +{45.1865, 16.2354, 10.5372}, +{45.9174, 16.3150, 10.3105}, +{46.6600, 16.4150, 10.0903}, +{47.4147, 16.5258, 9.87476}, +{48.1816, 16.6493, 9.64493}, +{48.9609, 16.7514, 9.40358}, +{49.7528, 16.8462, 9.16827}, +{50.5576, 16.9490, 8.93884}, +{51.3753, 17.1020, 8.67122}, +{52.2062, 17.1733, 8.29968}, +{53.0506, 17.1593, 7.94407}, +{53.9087, 17.0934, 7.65749}, +{54.7806, 17.0364, 7.39714}, +{55.6667, 16.9783, 7.14563}, +{56.5670, 16.9180, 6.90269}, +{57.4820, 16.8733, 6.65806}, +{58.4117, 16.7944, 6.36509}, +{59.3564, 16.6730, 6.08500}, +{60.3165, 16.5241, 5.81735}, +{61.2921, 16.3535, 5.56366}, +{62.2834, 16.1646, 5.32105}, +{63.2908, 15.9611, 5.08742}, +{64.3145, 15.7353, 4.85534}, +{65.3547, 15.4867, 4.63386}, +{66.4118, 15.2199, 4.41995}, +{67.4859, 14.9263, 4.20854}, +{68.5775, 14.6049, 4.00724}, +{69.6867, 14.2548, 3.81873}, +{70.8138, 13.8808, 3.64163}, +{71.9591, 13.4796, 3.47273}, +{73.1230, 13.0481, 3.31138}, +{74.3057, 12.5795, 3.15347}, +{75.5076, 12.0659, 3.00310}, +{76.7289, 11.4926, 2.86924}, +{77.9699, 10.8788, 2.75745}, +{79.2310, 10.2028, 2.65084}, +{80.5125, 9.46612, 2.57996}, +{81.8147, 8.65612, 2.51098}, +{83.1380, 7.75103, 2.46452}, +{84.4827, 6.71093, 2.43997}, +{85.8491, 5.54216, 2.44792}, +{87.2377, 4.17601, 2.47442}, +{88.6487, 2.47095, 2.52226}, +{90.0825, 0.242954, 2.69166}, +{91.5395, -3.03708, 3.19078}, +{93.0201, -7.30723, 6.66410}, +{94.5246, -9.19053, 12.1025}, +{96.0535, -8.64618, 19.4572}, +{97.6071, 3.74738, 21.5624}, +{99.1858, 1.90889, 13.0480}, +{100.790, -2.80788, 10.7145}, +{102.420, -11.0462, 9.98412}, +{104.077, -19.2765, 15.6696}, +{105.760, -27.0710, 24.5923}, +{107.471, -34.3952, 41.0199}, +{109.209, -25.9329, 72.5933}, +{110.975, 1.04438, 82.1200}, +{112.770, 28.6279, 77.2142}, +{114.594, 40.5394, 59.8823}, +{116.448, 41.3985, 49.6453}, +{118.331, 42.2590, 43.3427}, +{120.245, 43.0836, 37.8400}, +{122.190, 43.0491, 33.0361}, +{124.166, 41.8547, 28.8420}, +{126.175, 40.5733, 26.8644}, +{128.215, 40.0477, 25.2383}, +{130.289, 39.7590, 23.7107}, +{132.397, 39.5516, 22.2755}, +{134.538, 39.3685, 20.9272}, +{136.714, 39.1850, 19.6605}, +{138.925, 38.9883, 18.4704}, +{141.172, 38.7730, 17.3524}, +{143.456, 38.5356, 16.3021}, +{145.776, 38.2740, 15.3154}, +{148.134, 37.9791, 14.3889}, +{150.530, 37.6734, 13.5541}, +{152.964, 37.3640, 12.7678}, +{155.439, 37.0452, 12.0272}, +{157.953, 36.7105, 11.3295}, +{160.507, 36.3528, 10.6722}, +{163.103, 35.9425, 10.0531}, +{165.742, 35.5131, 9.60267}, +{168.422, 35.1834, 9.21813}, +{171.146, 34.8897, 8.78432}, +{173.915, 34.5787, 8.37254}, +{176.727, 34.2621, 7.99889}, +{179.586, 33.9222, 7.64191}, +{182.491, 33.6117, 7.40175}, +{185.442, 33.3673, 7.17319}, +{188.442, 33.1999, 6.89638}, +{191.489, 32.9934, 6.57284}, +{194.587, 32.7560, 6.24973}, +{197.734, 32.4825, 5.93075}, +{200.932, 32.1569, 5.66383}, +{204.182, 31.8602, 5.45172}, +{207.485, 31.5719, 5.25357}, +{210.840, 31.3137, 5.09675}, +{214.251, 31.1134, 4.94462}, +{217.716, 30.9732, 4.69581}, +{221.237, 30.6429, 4.37115}, +{224.816, 30.3032, 4.20355}, +{228.452, 30.0013, 4.04239}, +{232.147, 29.7017, 3.88411}, +{235.902, 29.3938, 3.73021}, +{239.717, 29.0677, 3.58957}, +{243.595, 28.7422, 3.46910}, +{247.535, 28.4061, 3.35267}, +{251.538, 28.0407, 3.26395}, +{255.607, 27.6860, 3.20531}, +{259.741, 27.3044, 3.15900}, +{263.942, 26.9465, 3.17519}, +{268.211, 26.6171, 3.19146}, +{272.549, 26.2917, 3.20908}, +{276.957, 25.9733, 3.23796}, +{281.437, 25.6594, 3.26710}, +{285.989, 25.3436, 3.29727}, +{290.615, 25.0250, 3.32995}, +{295.315, 24.6992, 3.36295}, +{300.092, 24.3556, 3.39628}, +{304.945, 24.0017, 3.45841}, +{309.878, 23.6491, 3.52754}, +{314.890, 23.2929, 3.59805}, +{319.983, 22.9252, 3.67020}, +{325.158, 22.5417, 3.74415}, +{330.418, 22.1362, 3.81958}, +{335.762, 21.6944, 3.90448}, +{341.192, 21.2287, 4.00542}, +{346.711, 20.7114, 4.10898}, +{352.319, 20.1471, 4.26868}, +{358.017, 19.5126, 4.45693}, +{363.808, 18.8611, 4.79612}, +{369.692, 18.2957, 5.17279}, +{375.672, 17.7026, 5.51844}, +{381.748, 16.9494, 5.89683}, +{387.922, 16.2422, 6.55048}, +{394.197, 15.6382, 7.20718}, +{400.573, 15.0693, 7.89955}, +{407.052, 14.4629, 8.56930}, +{413.635, 13.7260, 9.33297}, +{420.326, 12.9539, 10.4147}, +{427.124, 12.6306, 11.9210}, +{434.032, 12.4540, 12.9305}, +{441.052, 12.2392, 14.0254}, +{448.186, 12.0270, 15.2127}, +{455.435, 11.8629, 16.5401}, +{462.802, 12.1325, 18.0811}, +{470.287, 12.5808, 19.1598}, +{477.894, 12.8805, 20.1442}, +{485.623, 13.1479, 21.1791}, +{493.478, 13.4455, 22.2675}, +{501.459, 13.8120, 23.4122}, +{509.570, 14.4357, 24.5780}, +{517.812, 15.0639, 25.5104}, +{526.187, 15.6604, 26.4782}, +{534.698, 16.3992, 27.4600}, +{543.346, 17.1328, 28.2504}, +{552.134, 17.8555, 29.0635}, +{561.065, 18.6741, 29.9001}, +{570.139, 19.6137, 30.5966}, +{579.361, 20.4641, 31.1335}, +{588.732, 21.2683, 31.6799}, +{598.254, 22.1286, 32.2358}, +{607.930, 23.0583, 32.6637}, +{617.763, 23.8708, 32.9446}, +{627.755, 24.5940, 33.2278}, +{637.908, 25.2960, 33.5136}, +{648.226, 25.9221, 33.7184}, +{658.711, 26.4054, 33.9113}, +{669.365, 26.6159, 34.1053}, +{680.191, 26.6210, 34.9189}, +{691.193, 27.0026, 36.1366}, +{702.372, 27.9761, 37.3524}, +{713.733, 29.1282, 38.3799}, +{725.277, 30.8761, 39.4357}, +{737.008, 32.6412, 39.5144}, +{748.928, 34.0070, 39.4660}, +{761.042, 35.2190, 39.4131}, +{773.351, 36.3610, 39.3602}, +{785.859, 37.5192, 39.3073}, +{798.570, 38.6119, 39.0733}, +{811.486, 39.6036, 38.8279}, +{824.611, 40.5186, 38.5841}, +{837.949, 41.3905, 38.3455}, +{851.502, 42.2397, 38.1101}, +{865.274, 43.1196, 37.8728}, +{879.269, 43.9249, 37.4780}, +{893.491, 44.6174, 37.0873}, +{907.943, 45.2164, 36.7603}, +{922.628, 45.8050, 36.4864}, +{937.551, 46.3959, 36.2145}, +{952.715, 46.9683, 35.9447}, +{968.124, 47.5162, 35.6691}, +{983.783, 48.0434, 35.3949}, +{999.695, 48.4276, 35.1227}, +{1015.86, 49.0123, 35.1464}, +{1032.29, 49.5467, 34.7117}, +{1048.99, 49.8807, 34.4394}, +{1065.96, 50.2608, 34.3457}, +{1083.20, 50.7013, 34.2519}, +{1100.72, 51.1666, 34.1579}, +{1118.52, 51.6478, 34.0637}, +{1136.61, 52.1415, 33.9690}, +{1155.00, 52.6469, 33.8742}, +{1173.68, 53.1647, 33.7791}, +{1192.66, 53.6968, 33.6836}, +{1211.95, 54.2485, 33.5880}, +{1231.55, 54.8376, 33.4922}, +{1251.47, 55.4628, 33.3448}, +{1271.72, 56.1059, 33.1416}, +{1292.29, 56.6971, 32.8705}, +{1313.19, 57.2487, 32.6007}, +{1334.43, 57.7802, 32.3328}, +{1356.01, 58.2996, 32.0666}, +{1377.94, 58.8114, 31.8012}, +{1400.23, 59.3204, 31.5377}, +{1422.88, 59.8332, 31.2761}, +{1445.89, 60.3601, 31.0153}, +{1469.28, 60.9214, 30.7334}, +{1493.04, 61.5235, 30.4193}, +{1517.19, 62.0832, 29.9644}, +{1541.73, 62.5695, 29.4961}, +{1566.67, 62.9986, 29.0343}, +{1592.01, 63.3939, 28.5788}, +{1617.76, 63.7618, 28.1299}, +{1643.92, 64.1065, 27.6872}, +{1670.51, 64.4314, 27.2509}, +{1697.53, 64.7393, 26.8208}, +{1724.99, 65.0439, 26.3965}, +{1752.89, 65.3319, 25.9550}, +{1781.24, 65.5942, 25.5126}, +{1810.05, 65.8330, 25.0712}, +{1839.32, 66.0490, 24.6363}, +{1869.07, 66.2469, 24.2085}, +{1899.30, 66.4282, 23.7876}, +{1930.02, 66.5939, 23.3733}, +{1961.24, 66.7448, 22.9660}, +{1992.96, 66.8779, 22.5654}, +{2025.20, 67.0164, 22.1842}, +{2057.95, 67.1448, 21.7807}, +{2091.24, 67.2484, 21.3801}, +{2125.06, 67.3347, 20.9837}, +{2159.43, 67.4049, 20.5917}, +{2194.36, 67.4591, 20.2030}, +{2229.85, 67.4964, 19.8179}, +{2265.92, 67.5165, 19.4367}, +{2302.57, 67.5185, 19.0599}, +{2339.81, 67.5035, 18.6882}, +{2377.66, 67.4701, 18.3196}, +{2416.11, 67.4171, 17.9556}, +{2455.19, 67.3438, 17.5957}, +{2494.90, 67.2495, 17.2406}, +{2535.26, 67.1322, 16.8891}, +{2576.26, 66.9906, 16.5425}, +{2617.93, 66.8230, 16.2004}, +{2660.27, 66.6270, 15.8625}, +{2703.30, 66.3995, 15.5286}, +{2747.03, 66.1373, 15.1994}, +{2791.46, 65.8361, 14.8744}, +{2836.61, 65.4907, 14.5542}, +{2882.49, 65.0949, 14.2380}, +{2929.11, 64.6398, 13.9263}, +{2976.48, 64.1144, 13.6190}, +{3024.63, 63.5040, 13.3162}, +{3073.55, 62.7883, 13.0175}, +{3123.26, 61.9371, 12.7228}, +{3173.78, 60.9056, 12.4326}, +{3225.11, 59.6206, 12.1468}, +{3277.27, 57.9495, 11.8649}, +{3330.28, 55.6072, 11.5869}, +{3384.15, 51.7403, 11.3130}, +{3438.88, 35.5703, 11.0445}, +{3441.70, 17.8608, 11.0309}, +{3441.90, 17.8638, 27.5264}, +{3494.50, 49.8414, 26.8431}, +{3551.02, 51.3518, 26.1388}, +{3608.46, 40.7739, 25.4538}, +{3611.10, 26.5659, 25.4230}, +{3611.30, 26.5766, 39.0237}, +{3666.82, 55.9203, 38.0491}, +{3726.13, 60.5736, 37.0506}, +{3786.40, 63.5618, 36.0796}, +{3847.64, 65.7663, 35.1362}, +{3909.87, 67.4736, 34.2195}, +{3973.11, 68.8043, 33.3285}, +{4037.38, 69.7893, 32.4616}, +{4102.68, 70.3285, 31.6203}, +{4169.03, 68.6896, 30.8033}, +{4173.70, 64.9312, 30.7471}, +{4173.90, 64.9340, 33.8557}, +{4236.46, 72.1577, 33.1241}, +{4304.98, 73.7076, 32.3528}, +{4374.62, 74.8572, 31.5984}, +{4445.37, 75.8039, 30.8637}, +{4517.27, 76.6113, 30.1450}, +{4590.33, 77.3072, 29.4446}, +{4664.58, 77.9073, 28.7613}, +{4740.03, 78.4149, 28.0937}, +{4816.69, 78.8211, 27.4418}, +{4894.60, 79.0828, 26.8041}, +{4973.77, 78.9275, 26.1816}, +{5000.80, 76.5532, 25.9746}, +{5001.00, 76.5542, 27.3857}, +{5054.21, 79.6418, 26.9834}, +{5135.96, 80.4144, 26.3848}, +{5219.03, 80.9160, 25.7996}, +{5303.44, 81.3681, 25.2272}, +{5366.80, 80.1518, 24.8117}, +{5367.00, 80.1579, 25.7340}, +{5389.22, 81.4111, 25.5858}, +{5476.39, 82.2860, 25.0184}, +{5564.97, 82.8540, 24.4608}, +{5654.98, 83.3264, 23.9115}, +{5746.44, 83.7406, 23.3701}, +{5839.39, 84.1117, 22.8376}, +{5933.83, 84.4479, 22.3138}, +{6029.81, 84.7545, 21.7986}, +{6127.33, 85.0347, 21.2924}, +{6226.44, 85.2914, 20.7948}, +{6327.15, 85.5265, 20.3064}, +{6429.48, 85.7422, 19.8272}, +{6533.48, 85.9398, 19.3567}, +{6639.15, 86.1207, 18.8953}, +{6746.54, 86.2858, 18.4428}, +{6855.65, 86.4363, 17.9995}, +{6966.54, 86.5732, 17.5648}, +{7079.22, 86.6970, 17.1393}, +{7193.72, 86.8089, 16.7224}, +{7310.07, 86.9094, 16.3145}, +{7428.31, 86.9993, 15.9150}, +{7548.45, 87.0788, 15.5243}, +{7670.54, 87.1490, 15.1423}, +{7794.61, 87.2104, 14.7685}, +{7920.68, 87.2631, 14.4029}, +{8048.79, 87.3078, 14.0459}, +{8178.98, 87.3450, 13.6967}, +{8311.26, 87.3751, 13.3558}, +{8445.69, 87.3987, 13.0226}, +{8582.29, 87.4159, 12.6972}, +{8721.11, 87.4273, 12.3797}, +{8862.16, 87.4335, 12.0697}, +{9005.50, 87.4346, 11.7668}, +{9151.16, 87.4313, 11.4715}, +{9299.17, 87.4242, 11.1832}, +{9449.58, 87.4138, 10.9018}, +{9602.42, 87.4016, 10.6279}, +{9757.73, 87.3887, 10.3603}, +{9915.55, 87.3964, 10.0994}, +{10075.9, 87.4019, 9.79338}, +{10238.9, 87.3583, 9.49798}, +{10404.5, 87.3044, 9.21309}, +{10572.8, 87.2389, 8.93854}, +{10743.8, 87.1637, 8.67422}, +{10917.6, 87.0799, 8.41993}, +{11094.2, 86.9884, 8.17552}, +{11273.6, 86.8899, 7.94082}, +{11455.9, 86.7850, 7.71565}, +{11641.2, 86.6739, 7.49983}, +{11829.5, 86.5570, 7.29317}, +{12020.8, 86.4345, 7.09550}, +{12215.3, 86.3065, 6.90661}, +{12412.8, 86.1729, 6.72632}, +{12613.6, 86.0337, 6.55443}, +{12817.6, 85.8887, 6.39075}, +{13025.0, 85.7374, 6.23509}, +{13235.6, 85.5795, 6.08725}, +{13449.7, 85.4142, 5.94705}, +{13667.2, 85.2404, 5.81427}, +{13888.3, 85.0571, 5.68875}, +{14112.9, 84.8624, 5.57027}, +{14341.2, 84.6540, 5.45866}, +{14573.1, 84.4287, 5.35372}, +{14808.9, 84.1821, 5.25528}, +{15048.4, 83.9075, 5.16314}, +{15291.8, 83.5949, 5.07712}, +{15539.1, 83.2281, 4.99704}, +{15790.4, 82.7785, 4.92273}, +{16045.8, 82.1879, 4.85401}, +{16305.4, 81.3094, 4.79070}, +{16569.1, 79.5209, 4.73264}, +{16733.0, 65.0377, 4.69737}, +{16733.2, 65.0383, 10.8982}, +{16837.1, 78.8509, 10.7825}, +{17109.4, 81.4888, 10.4883}, +{17386.1, 82.6011, 10.2021}, +{17667.4, 83.2849, 9.92377}, +{17953.1, 83.7492, 9.65301}, +{18243.5, 84.0704, 9.38963}, +{18538.6, 84.2820, 9.13346}, +{18838.4, 84.3970, 8.88427}, +{19143.1, 84.4130, 8.64189}, +{19452.7, 84.3077, 8.40613}, +{19767.4, 84.0113, 8.17681}, +{20087.1, 83.2474, 7.95375}, +{20313.6, 75.5413, 7.80148}, +{20313.8, 75.5420, 11.0231}, +{20412.0, 82.4780, 10.9443}, +{20742.1, 83.9576, 10.6860}, +{21077.6, 83.6331, 10.4337}, +{21104.5, 81.7519, 10.4139}, +{21104.7, 81.7530, 11.7091}, +{21418.5, 85.1984, 11.4720}, +{21765.0, 85.9308, 11.2198}, +{22117.0, 86.4627, 10.9707}, +{22474.7, 86.8928, 10.7249}, +{22838.2, 87.2567, 10.4824}, +{23207.6, 87.5725, 10.2433}, +{23583.0, 87.8510, 10.0078}, +{23964.4, 88.0993, 9.77588}, +{24352.0, 88.3224, 9.54764}, +{24745.9, 88.5239, 9.32313}, +{25146.2, 88.7068, 9.10238}, +{25552.9, 88.8731, 8.88544}, +{25966.2, 89.0248, 8.67233}, +{26386.1, 89.1633, 8.46306}, +{26812.9, 89.2899, 8.25765}, +{27246.6, 89.4057, 8.05611}, +{27687.3, 89.5117, 7.85843}, +{28135.1, 89.6086, 7.66460}, +{28590.2, 89.6975, 7.47463}, +{29052.6, 89.7798, 7.28848}, +{29522.5, 89.8730, 7.10613}, +{30000.0, 89.8623, 6.92757}, +{0, 0, 0} +}; + +e_fp_fdp u[] = { /* Z = 92 */ +{10.0000, -9999.00, 1.62700}, +{10.1617, -9999.00, 1.61282}, +{10.3261, -9999.00, 1.59877}, +{10.4931, -9999.00, 1.58416}, +{10.6628, -9999.00, 1.56547}, +{10.8353, -9999.00, 1.54700}, +{11.0106, -9999.00, 1.52874}, +{11.1886, -9999.00, 1.51070}, +{11.3696, -9999.00, 1.49287}, +{11.5535, -9999.00, 1.47526}, +{11.7404, -9999.00, 1.45876}, +{11.9303, -9999.00, 1.44394}, +{12.1232, -9999.00, 1.42927}, +{12.3193, -9999.00, 1.41475}, +{12.5186, -9999.00, 1.40038}, +{12.7210, -9999.00, 1.38615}, +{12.9268, -9999.00, 1.37207}, +{13.1359, -9999.00, 1.35814}, +{13.3483, -9999.00, 1.34434}, +{13.5642, -9999.00, 1.33011}, +{13.7836, -9999.00, 1.31551}, +{14.0066, -9999.00, 1.30107}, +{14.2331, -9999.00, 1.28679}, +{14.4633, -9999.00, 1.27267}, +{14.6973, -9999.00, 1.25871}, +{14.9350, -9999.00, 1.24489}, +{15.1765, -9999.00, 1.23229}, +{15.4220, -9999.00, 1.22013}, +{15.6714, -9999.00, 1.20809}, +{15.9249, -9999.00, 1.19617}, +{16.1825, -9999.00, 1.18436}, +{16.4442, -9999.00, 1.17567}, +{16.7102, -9999.00, 1.17857}, +{16.9805, -9999.00, 1.18147}, +{17.2551, -9999.00, 1.19738}, +{17.5342, -9999.00, 1.22734}, +{17.8178, -9999.00, 1.26351}, +{18.1060, -9999.00, 1.38802}, +{18.3989, -9999.00, 1.54488}, +{18.6964, -9999.00, 1.79483}, +{18.9988, -9999.00, 2.45978}, +{19.3061, -9999.00, 3.52381}, +{19.6184, -9999.00, 5.04811}, +{19.9357, -9999.00, 6.00990}, +{20.2582, -9999.00, 6.93785}, +{20.5858, -9999.00, 7.41969}, +{20.9188, -9999.00, 7.93500}, +{21.2571, -9999.00, 8.38150}, +{21.6009, -9999.00, 8.80602}, +{21.9503, -9999.00, 9.25204}, +{22.3053, -9999.00, 9.66152}, +{22.6661, -9999.00, 9.97607}, +{23.0327, -9999.00, 10.3009}, +{23.4053, -9999.00, 10.6362}, +{23.7838, -9999.00, 10.9825}, +{24.1685, -9999.00, 11.3401}, +{24.5594, -9999.00, 11.6286}, +{24.9566, -9999.00, 11.8448}, +{25.3603, -9999.00, 12.0651}, +{25.7705, -9999.00, 12.2894}, +{26.1873, -9999.00, 12.5180}, +{26.6109, -9999.00, 12.7507}, +{27.0413, -9999.00, 12.9878}, +{27.4786, -9999.00, 13.1712}, +{27.9231, -9999.00, 13.2157}, +{28.3747, -9999.00, 13.2603}, +{28.8337, -9999.00, 13.3051}, +{29.3000, 10.5750, 13.3500}, +{29.7739, 10.8811, 13.3951}, +{30.2555, 11.1801, 13.4403}, +{30.7449, 11.4705, 13.4761}, +{31.2421, 11.7502, 13.5120}, +{31.7475, 12.0226, 13.5479}, +{32.2609, 12.2894, 13.5840}, +{32.7827, 12.5520, 13.6201}, +{33.3130, 12.8112, 13.6564}, +{33.8518, 13.0681, 13.6927}, +{34.3993, 13.3234, 13.7291}, +{34.9557, 13.5780, 13.7654}, +{35.5211, 13.8325, 13.8018}, +{36.0956, 14.0879, 13.8383}, +{36.6794, 14.3452, 13.8749}, +{37.2727, 14.6054, 13.9116}, +{37.8755, 14.8699, 13.9483}, +{38.4882, 15.1405, 13.9852}, +{39.1107, 15.4197, 14.0222}, +{39.7432, 15.7113, 14.0592}, +{40.3861, 16.0222, 14.0964}, +{41.0393, 16.3798, 14.1337}, +{41.7031, 16.7949, 14.0635}, +{42.3776, 17.1277, 13.9402}, +{43.0630, 17.4186, 13.8180}, +{43.7595, 17.6901, 13.6969}, +{44.4673, 17.9475, 13.5768}, +{45.1865, 18.1950, 13.4578}, +{45.9174, 18.4361, 13.3398}, +{46.6600, 18.6771, 13.2229}, +{47.4147, 18.9311, 13.1070}, +{48.1816, 19.1850, 12.9381}, +{48.9609, 19.4019, 12.7600}, +{49.7528, 19.5991, 12.5844}, +{50.5576, 19.7829, 12.4111}, +{51.3753, 19.9574, 12.2402}, +{52.2062, 20.1258, 12.0717}, +{53.0506, 20.2924, 11.9055}, +{53.9087, 20.4646, 11.7416}, +{54.7806, 20.6678, 11.5800}, +{55.6667, 20.8889, 11.3130}, +{56.5670, 21.0308, 11.0195}, +{57.4820, 21.1241, 10.7337}, +{58.4117, 21.1890, 10.4552}, +{59.3564, 21.2305, 10.1841}, +{60.3165, 21.2522, 9.91987}, +{61.2921, 21.2570, 9.66255}, +{62.2834, 21.2480, 9.41192}, +{63.2908, 21.2285, 9.16778}, +{64.3145, 21.2097, 8.92997}, +{65.3547, 21.2274, 8.66886}, +{66.4118, 21.1810, 8.33553}, +{67.4859, 21.0749, 8.01500}, +{68.5775, 20.9334, 7.70682}, +{69.6867, 20.7635, 7.41047}, +{70.8138, 20.5729, 7.12553}, +{71.9591, 20.3794, 6.85153}, +{73.1230, 20.1610, 6.52316}, +{74.3057, 19.8768, 6.19680}, +{75.5076, 19.5503, 5.88679}, +{76.7289, 19.1954, 5.59228}, +{77.9699, 18.8490, 5.31250}, +{79.2310, 18.5765, 4.87428}, +{80.5125, 18.0441, 4.32769}, +{81.8147, 17.3440, 3.84240}, +{83.1380, 16.5116, 3.35902}, +{84.4827, 15.5172, 2.92900}, +{85.8491, 14.3428, 2.57831}, +{87.2377, 13.0798, 2.36876}, +{88.6487, 11.6824, 2.17626}, +{90.0825, 10.0670, 2.05790}, +{91.5395, 8.21023, 1.99914}, +{93.0201, 5.95259, 1.99515}, +{94.5246, 2.91261, 2.12790}, +{96.0535, -1.97819, 3.51635}, +{97.6071, -7.08175, 8.09234}, +{99.1858, -9.58304, 18.6229}, +{100.790, 3.07762, 24.6815}, +{102.420, 6.43030, 18.4389}, +{104.077, 4.15900, 13.7751}, +{105.760, 0.301717, 12.8448}, +{107.471, -4.57170, 12.3641}, +{109.209, -10.6639, 12.3392}, +{110.975, -22.3172, 12.5592}, +{112.770, -67.1152, 85.1494}, +{114.594, -32.1427, 94.4911}, +{116.448, 3.38118, 95.9686}, +{118.331, 28.6729, 87.0976}, +{120.245, 38.7668, 73.8404}, +{122.190, 44.5490, 65.7776}, +{124.166, 49.2497, 58.5187}, +{126.175, 52.1489, 51.3202}, +{128.215, 53.5133, 45.0073}, +{130.289, 53.8094, 39.4711}, +{132.397, 53.1595, 34.6158}, +{134.538, 50.9933, 31.1950}, +{136.714, 49.9722, 29.6174}, +{138.925, 49.4985, 28.1196}, +{141.172, 49.2360, 26.6975}, +{143.456, 49.0708, 25.3473}, +{145.776, 48.9555, 24.0654}, +{148.134, 48.8683, 22.8484}, +{150.530, 48.8065, 21.6929}, +{152.964, 48.8111, 20.5527}, +{155.439, 48.7305, 19.3633}, +{157.953, 48.5873, 18.2427}, +{160.507, 48.4057, 17.1870}, +{163.103, 48.1986, 16.1923}, +{165.742, 47.9748, 15.2552}, +{168.422, 47.7446, 14.3724}, +{171.146, 47.5511, 13.5406}, +{173.915, 47.3422, 12.6314}, +{176.727, 47.0332, 11.7469}, +{179.586, 46.6686, 10.9244}, +{182.491, 46.2678, 10.1595}, +{185.442, 45.8378, 9.44810}, +{188.442, 45.3813, 8.78653}, +{191.489, 44.8938, 8.17131}, +{194.587, 44.3193, 7.59914}, +{197.734, 43.7533, 7.24255}, +{200.932, 43.2896, 6.93603}, +{204.182, 42.8744, 6.64249}, +{207.485, 42.4876, 6.36138}, +{210.840, 42.1198, 6.09215}, +{214.251, 41.7657, 5.83432}, +{217.716, 41.4211, 5.58740}, +{221.237, 41.0829, 5.35094}, +{224.816, 40.7464, 5.12448}, +{228.452, 40.4126, 4.91606}, +{232.147, 40.0836, 4.71802}, +{235.902, 39.7545, 4.52796}, +{239.717, 39.4139, 4.34556}, +{243.595, 39.0661, 4.20612}, +{247.535, 38.7391, 4.08651}, +{251.538, 38.4263, 3.97030}, +{255.607, 38.1152, 3.85740}, +{259.741, 37.7944, 3.74770}, +{263.942, 37.4559, 3.66731}, +{268.211, 37.1436, 3.61890}, +{272.549, 36.8456, 3.57113}, +{276.957, 36.5521, 3.52400}, +{281.437, 36.2571, 3.47749}, +{285.989, 35.9384, 3.43159}, +{290.615, 35.6221, 3.43678}, +{295.315, 35.3296, 3.44981}, +{300.092, 35.0468, 3.46290}, +{304.945, 34.7674, 3.47602}, +{309.878, 34.4870, 3.48920}, +{314.890, 34.1991, 3.50243}, +{319.983, 33.8928, 3.52807}, +{325.158, 33.5969, 3.57732}, +{330.418, 33.3056, 3.62725}, +{335.762, 33.0118, 3.67788}, +{341.192, 32.7110, 3.72922}, +{346.711, 32.3981, 3.78127}, +{352.319, 32.0617, 3.83405}, +{358.017, 31.6867, 3.92494}, +{363.808, 31.3262, 4.05508}, +{369.692, 30.9779, 4.18955}, +{375.672, 30.6235, 4.32847}, +{381.748, 30.2556, 4.47199}, +{387.922, 29.8610, 4.62028}, +{394.197, 29.4184, 4.81395}, +{400.573, 28.9869, 5.05973}, +{407.052, 28.5632, 5.31806}, +{413.635, 28.1237, 5.58958}, +{420.326, 27.6060, 5.87496}, +{427.124, 27.0756, 6.31162}, +{434.032, 26.6000, 6.81207}, +{441.052, 26.1586, 7.35218}, +{448.186, 25.7436, 7.93513}, +{455.435, 25.3591, 8.56083}, +{462.802, 25.0013, 9.23032}, +{470.287, 24.6829, 9.95215}, +{477.894, 24.4242, 10.7076}, +{485.623, 24.1980, 11.4899}, +{493.478, 24.0144, 12.3293}, +{501.459, 23.9346, 13.2301}, +{509.570, 23.9381, 14.0536}, +{517.812, 23.9468, 14.8772}, +{526.187, 23.9723, 15.7491}, +{534.698, 24.0615, 16.6721}, +{543.346, 24.2824, 17.6206}, +{552.134, 24.5668, 18.5457}, +{561.065, 24.9863, 19.5194}, +{570.139, 25.6014, 20.3875}, +{579.361, 26.2416, 21.1154}, +{588.732, 27.1399, 21.8465}, +{598.254, 27.9274, 21.9640}, +{607.930, 28.5050, 22.0820}, +{617.763, 29.1067, 22.1429}, +{627.755, 29.4339, 21.9385}, +{637.908, 29.3660, 21.8888}, +{648.226, 29.2264, 22.0330}, +{658.711, 29.0216, 22.3228}, +{669.365, 28.8388, 22.7453}, +{680.191, 28.5719, 23.1759}, +{691.193, 28.1800, 23.8702}, +{702.372, 27.9802, 24.8543}, +{713.733, 27.9219, 25.8819}, +{725.277, 27.9828, 26.9992}, +{737.008, 28.1625, 28.1647}, +{748.928, 28.4885, 29.3772}, +{761.042, 28.9164, 30.5788}, +{773.351, 29.4417, 31.8296}, +{785.859, 30.1187, 33.1315}, +{798.570, 30.9956, 34.3945}, +{811.486, 31.9794, 35.6068}, +{824.611, 33.1083, 36.8619}, +{837.949, 34.6532, 38.1612}, +{851.502, 36.2827, 38.7940}, +{865.274, 37.8031, 39.3702}, +{879.269, 39.4166, 39.9549}, +{893.491, 41.1724, 40.2501}, +{907.943, 42.7286, 40.2453}, +{922.628, 44.1879, 40.2405}, +{937.551, 45.5672, 40.0917}, +{952.715, 46.8148, 39.9107}, +{968.124, 47.8824, 39.9001}, +{983.783, 49.2008, 40.1576}, +{999.695, 51.0493, 40.4167}, +{1015.86, 54.9983, 40.6774}, +{1032.29, 54.7330, 36.0780}, +{1048.99, 53.7840, 35.8366}, +{1065.96, 54.3136, 35.7773}, +{1083.20, 54.9350, 35.4768}, +{1100.72, 55.5198, 35.1633}, +{1118.52, 56.1044, 34.8526}, +{1136.61, 56.6867, 34.5446}, +{1155.00, 57.2650, 34.2394}, +{1173.68, 57.8384, 33.9369}, +{1192.66, 58.4068, 33.6370}, +{1211.95, 58.9713, 33.3398}, +{1231.55, 59.5334, 33.0451}, +{1251.47, 60.0959, 32.7532}, +{1271.72, 60.6636, 32.4637}, +{1292.29, 61.2463, 32.1769}, +{1313.19, 61.8897, 31.8925}, +{1334.43, 62.5241, 31.4589}, +{1356.01, 63.0875, 30.9981}, +{1377.94, 63.5902, 30.5440}, +{1400.23, 64.0610, 30.0966}, +{1422.88, 64.5058, 29.6558}, +{1445.89, 64.9289, 29.2215}, +{1469.28, 65.3334, 28.7935}, +{1493.04, 65.7218, 28.3717}, +{1517.19, 66.0966, 27.9562}, +{1541.73, 66.4601, 27.5467}, +{1566.67, 66.8149, 27.1432}, +{1592.01, 67.1647, 26.7456}, +{1617.76, 67.5163, 26.3539}, +{1643.92, 67.8971, 25.9679}, +{1670.51, 68.2738, 25.4962}, +{1697.53, 68.5971, 25.0005}, +{1724.99, 68.8692, 24.5143}, +{1752.89, 69.1134, 24.0376}, +{1781.24, 69.3338, 23.5702}, +{1810.05, 69.5334, 23.1119}, +{1839.32, 69.7143, 22.6625}, +{1869.07, 69.8781, 22.2218}, +{1899.30, 70.0260, 21.7897}, +{1930.02, 70.1590, 21.3660}, +{1961.24, 70.2779, 20.9505}, +{1992.96, 70.3834, 20.5431}, +{2025.20, 70.4762, 20.1437}, +{2057.95, 70.5567, 19.7520}, +{2091.24, 70.6254, 19.3679}, +{2125.06, 70.6828, 18.9912}, +{2159.43, 70.7293, 18.6220}, +{2194.36, 70.7657, 18.2598}, +{2229.85, 70.7930, 17.9048}, +{2265.92, 70.8150, 17.5566}, +{2302.57, 70.8319, 17.2011}, +{2339.81, 70.8286, 16.8393}, +{2377.66, 70.8012, 16.4851}, +{2416.11, 70.7570, 16.1383}, +{2455.19, 70.6962, 15.7989}, +{2494.90, 70.6191, 15.4666}, +{2535.26, 70.5254, 15.1412}, +{2576.26, 70.4146, 14.8227}, +{2617.93, 70.2859, 14.5109}, +{2660.27, 70.1383, 14.2057}, +{2703.30, 69.9706, 13.9069}, +{2747.03, 69.7811, 13.6144}, +{2791.46, 69.5678, 13.3280}, +{2836.61, 69.3282, 13.0476}, +{2882.49, 69.0592, 12.7732}, +{2929.11, 68.7569, 12.5045}, +{2976.48, 68.4130, 12.2415}, +{3024.63, 68.0257, 11.9906}, +{3073.55, 67.5920, 11.7473}, +{3123.26, 67.0988, 11.5088}, +{3173.78, 66.5456, 11.2752}, +{3225.11, 65.9045, 11.0188}, +{3277.27, 65.0956, 10.7185}, +{3330.28, 64.0540, 10.4264}, +{3384.15, 62.6818, 10.1423}, +{3438.88, 60.7377, 9.86597}, +{3494.50, 57.4574, 9.59711}, +{3551.02, 36.8481, 9.33562}, +{3551.60, 27.9841, 9.33299}, +{3551.80, 27.9911, 23.9176}, +{3608.46, 57.0764, 22.8503}, +{3666.82, 58.7767, 21.8168}, +{3726.13, 51.9404, 21.1209}, +{3727.50, 45.8434, 21.1052}, +{3727.70, 45.8461, 28.2603}, +{3786.40, 61.4517, 27.8547}, +{3847.64, 63.9774, 27.4443}, +{3909.87, 65.5811, 27.0398}, +{3973.11, 66.7483, 26.7485}, +{4037.38, 67.7374, 26.5462}, +{4102.68, 68.6142, 26.3294}, +{4169.03, 69.2506, 25.9461}, +{4236.46, 69.8091, 25.5685}, +{4303.30, 62.6813, 25.2053}, +{4303.50, 62.6905, 29.1726}, +{4304.98, 65.8913, 29.1600}, +{4374.62, 71.3773, 28.5770}, +{4445.37, 72.9924, 28.0057}, +{4517.27, 74.1697, 27.4457}, +{4590.33, 75.1327, 26.8669}, +{4664.58, 75.9092, 26.2629}, +{4740.03, 76.4810, 25.7150}, +{4816.69, 76.9832, 25.3035}, +{4894.60, 77.4932, 24.8986}, +{4973.77, 77.9429, 24.5001}, +{5054.21, 78.3129, 24.1081}, +{5135.96, 78.5724, 23.7223}, +{5182.10, 76.8897, 23.5099}, +{5182.30, 76.8951, 24.6131}, +{5219.03, 78.9443, 24.4161}, +{5303.44, 79.8351, 23.9744}, +{5389.22, 80.4626, 23.5407}, +{5476.39, 80.9998, 23.1148}, +{5564.97, 81.4878, 22.6966}, +{5654.98, 81.9557, 22.2861}, +{5746.44, 82.4005, 21.8283}, +{5839.39, 82.7861, 21.3608}, +{5933.83, 83.1227, 20.9032}, +{6029.81, 83.4256, 20.4555}, +{6127.33, 83.6978, 20.0174}, +{6226.44, 83.9417, 19.5887}, +{6327.15, 84.1366, 19.1691}, +{6429.48, 84.3059, 18.8064}, +{6533.48, 84.4947, 18.4729}, +{6639.15, 84.6871, 18.1453}, +{6746.54, 84.8782, 17.8236}, +{6855.65, 85.0669, 17.5075}, +{6966.54, 85.2536, 17.1971}, +{7079.22, 85.4394, 16.8921}, +{7193.72, 85.6268, 16.5925}, +{7310.07, 85.8185, 16.2983}, +{7428.31, 86.0525, 16.0093}, +{7548.45, 86.3050, 15.6522}, +{7670.54, 86.4946, 15.2272}, +{7794.61, 86.6260, 14.8138}, +{7920.68, 86.7211, 14.4117}, +{8048.79, 86.7843, 14.0204}, +{8178.98, 86.7944, 13.6433}, +{8311.26, 86.7896, 13.3491}, +{8445.69, 86.8225, 13.0613}, +{8582.29, 86.8541, 12.7797}, +{8721.11, 86.9066, 12.5041}, +{8862.16, 86.9603, 12.1882}, +{9005.50, 86.9525, 11.8288}, +{9151.16, 86.8622, 11.4799}, +{9299.17, 86.6684, 11.1965}, +{9449.58, 86.2926, 10.9951}, +{9602.42, 86.2961, 11.5634}, +{9757.73, 86.8907, 11.3972}, +{9915.55, 87.0112, 11.1148}, +{10075.9, 87.1235, 10.8358}, +{10238.9, 87.2021, 10.5627}, +{10404.5, 87.2582, 10.2954}, +{10572.8, 87.2970, 10.0338}, +{10743.8, 87.3216, 9.77794}, +{10917.6, 87.3343, 9.52764}, +{11094.2, 87.3363, 9.28286}, +{11273.6, 87.3287, 9.04349}, +{11455.9, 87.3121, 8.80948}, +{11641.2, 87.2871, 8.58072}, +{11829.5, 87.2540, 8.35713}, +{12020.8, 87.2130, 8.13863}, +{12215.3, 87.1642, 7.92511}, +{12412.8, 87.1076, 7.71652}, +{12613.6, 87.0431, 7.51273}, +{12817.6, 86.9706, 7.31369}, +{13025.0, 86.8896, 7.11929}, +{13235.6, 86.7997, 6.92944}, +{13449.7, 86.7004, 6.74407}, +{13667.2, 86.5909, 6.56307}, +{13888.3, 86.4701, 6.38638}, +{14112.9, 86.3367, 6.21389}, +{14341.2, 86.1891, 6.04553}, +{14573.1, 86.0250, 5.88120}, +{14808.9, 85.8414, 5.72084}, +{15048.4, 85.6342, 5.56434}, +{15291.8, 85.3978, 5.41164}, +{15539.1, 85.1238, 5.26265}, +{15790.4, 84.7993, 5.11728}, +{16045.8, 84.4028, 4.97547}, +{16305.4, 83.8952, 4.83712}, +{16569.1, 83.1915, 4.70218}, +{16837.1, 82.0438, 4.57055}, +{17109.4, 78.6184, 4.44217}, +{17166.2, 65.9767, 4.41610}, +{17166.4, 65.9770, 10.6918}, +{17386.1, 81.4419, 10.4638}, +{17667.4, 83.1057, 10.1830}, +{17953.1, 83.9805, 9.90984}, +{18243.5, 84.5468, 9.64398}, +{18538.6, 84.9377, 9.38526}, +{18838.4, 85.2071, 9.13348}, +{19143.1, 85.3793, 8.88847}, +{19452.7, 85.4626, 8.65004}, +{19767.4, 85.4514, 8.41801}, +{20087.1, 85.3197, 8.19221}, +{20412.0, 84.9908, 7.97247}, +{20742.1, 84.1388, 7.75864}, +{20947.5, 76.5744, 7.63016}, +{20947.7, 76.5750, 10.8162}, +{21077.6, 83.7482, 10.7130}, +{21418.5, 84.9753, 10.4497}, +{21757.3, 82.4206, 10.1985}, +{21757.5, 82.4216, 11.5813}, +{21765.0, 84.1169, 11.5758}, +{22117.0, 86.2433, 11.3180}, +{22474.7, 86.9581, 11.0638}, +{22838.2, 87.4811, 10.8132}, +{23207.6, 87.9041, 10.5665}, +{23583.0, 88.2616, 10.3235}, +{23964.4, 88.5713, 10.0845}, +{24352.0, 88.8441, 9.84944}, +{24745.9, 89.0869, 9.61834}, +{25146.2, 89.3048, 9.39124}, +{25552.9, 89.5013, 9.16818}, +{25966.2, 89.6793, 8.94915}, +{26386.1, 89.8411, 8.73417}, +{26812.9, 89.9885, 8.52324}, +{27246.6, 90.1230, 8.31635}, +{27687.3, 90.2458, 8.11349}, +{28135.1, 90.3582, 7.91465}, +{28590.2, 90.4611, 7.71980}, +{29052.6, 90.5564, 7.52892}, +{29522.5, 90.6621, 7.34197}, +{30000.0, 90.6603, 7.15894}, +{0, 0, 0} +}; + +} // namespace table_data + +}}} // namespace cctbx::eltbx::henke diff --git a/extern/cctbx/cctbx/eltbx/icsd_radii.cpp b/extern/cctbx/cctbx/eltbx/icsd_radii.cpp new file mode 100644 index 00000000..913a2cd5 --- /dev/null +++ b/extern/cctbx/cctbx/eltbx/icsd_radii.cpp @@ -0,0 +1,531 @@ +#include +#include + +namespace cctbx { namespace eltbx { namespace icsd_radii { + +namespace detail { +namespace { + +/* Table of ionic radii + + Reference: + U s e r ' s M a n u a l + I C S D - C R Y S T I N + ========================= + Inorganic Crystal Structure Database + in conjunction with + Crystal Structure Information System + and its application to + CCDF - Cambridge Crystallographic Data File + and + MDF - Metal Data File + G.Bergerhoff, B.Kilger, C.Witthauer, + R.Hundt, R.Sievers + Bonn + 1986 + Institut fuer Anorganische Chemie der Universitaet + ------------------------------------------------------------- + ICSD/CRYSTIN User's Manual. + English Version. Translated by Ruth Schubert. + Updated Dec. 1986. + + + These radii are also the basis of the distance tests, which are + routinely carried out when collecting data in the ICSD system. + In this connection, negative increments are obtained for the + specially small atoms C+4, D+1, H+1 and N+5. + + + Radii "not in ICSD manual" were taken from Xtal 3.2 routine SX20 + */ + + const raw_record table[] = { +// BEGIN_COMPILED_IN_REFERENCE_DATA + {"H", 0.78}, + {"H1+", -0.38}, + {"H1-", 1.40}, + {"D", 0.78}, + {"D1+", -0.24}, + {"D1-", 1.40}, + {"He", 1.00}, + {"Li", 1.56}, + {"Li1+", 0.59}, + {"Be", 1.13}, + {"Be2+", 0.17}, + {"B", 0.95}, + {"B1+", 0.58}, + {"B2+", 0.40}, + {"B3+", 0.02}, + {"B2-", 1.06}, + {"B3-", 1.22}, + {"C", 0.86}, + {"C1+", 0.79}, + {"C2+", 0.60}, + {"C3+", 0.55}, + {"C4+", -0.08}, + {"C1-", 1.10}, + {"C2-", 1.38}, + {"C4-", 1.77}, + {"N", 0.80}, + {"N1+", 0.59}, + {"N2+", 0.37}, + {"N3+", 0.16}, + {"N4+", 0.15}, + {"N5+", -0.12}, + {"N1-", 1.10}, + {"N2-", 1.29}, + {"N3-", 1.48}, + {"O", 0.66}, + {"O1-", 0.93}, + {"O2-", 1.21}, + {"F", 0.64}, + {"F7+", 0.08}, + {"F1-", 1.15}, + {"Ne", 1.00}, + {"Na", 1.91}, + {"Na1+", 0.97}, + {"Mg", 1.60}, + {"Mg2+", 0.49}, + {"Al", 1.43}, + {"Al3+", 0.39}, + {"Si", 1.34}, + {"Si2+", 1.25}, + {"Si3+", 1.17}, + {"Si4+", 0.26}, + {"Si1-", 1.41}, + {"Si4-", 2.72}, + {"P", 1.30}, + {"P1+", 1.01}, + {"P2+", 0.73}, + {"P3+", 0.44}, + {"P4+", 0.40}, + {"P5+", 0.17}, + {"P1-", 1.59}, + {"P2-", 1.20}, + {"P3-", 2.17}, + {"S", 1.04}, + {"S1+", 1.26}, + {"S2+", 0.87}, + {"S3+", 0.62}, + {"S4+", 0.37}, + {"S5+", 0.34}, + {"S6+", 0.12}, + {"S1-", 1.44}, + {"S2-", 1.84}, + {"Cl", 1.62}, + {"Cl1+", 1.30}, + {"Cl3+", 1.05}, + {"Cl5+", 0.12}, + {"Cl7+", 0.20}, + {"Cl1-", 1.81}, + {"Ar", 1.00}, + {"K", 2.34}, + {"K1+", 1.33}, + {"Ca", 1.97}, + {"Ca1+", 1.70}, + {"Ca2+", 0.99}, + {"Sc", 1.64}, + {"Sc1+", 1.36}, + {"Sc2+", 1.09}, + {"Sc3+", 0.73}, + {"Ti", 1.45}, + {"Ti2+", 0.86}, + {"Ti3+", 0.67}, + {"Ti4+", 0.53}, + {"V", 1.35}, + {"V1+", 1.02}, + {"V2+", 0.79}, + {"V3+", 0.64}, + {"V4+", 0.59}, + {"V5+", 0.36}, + {"Cr", 1.27}, + {"Cr1+", 1.07}, + {"Cr2+", 0.73}, + {"Cr3+", 0.62}, + {"Cr4+", 0.44}, + {"Cr5+", 0.35}, + {"Cr6+", 0.30}, + {"Mn", 1.32}, + {"Mn1+", 0.88}, + {"Mn2+", 0.67}, + {"Mn3+", 0.58}, + {"Mn4+", 0.54}, + {"Mn5+", 0.55}, + {"Mn6+", 0.27}, + {"Mn7+", 0.26}, + {"Mn1-", 1.06}, + {"Fe", 1.27}, + {"Fe1+", 0.84}, + {"Fe2+", 0.61}, + {"Fe3+", 0.49}, + {"Fe4+", 0.54}, + {"Fe6+", 0.30}, + {"Co", 1.26}, + {"Co1+", 0.80}, + {"Co2+", 0.65}, + {"Co3+", 0.52}, + {"Co4+", 0.54}, + {"Co1-", 1.30}, + {"Ni", 1.24}, + {"Ni1+", 0.68}, + {"Ni2+", 0.69}, + {"Ni3+", 0.60}, + {"Ni4+", 0.56}, + {"Cu", 1.28}, + {"Cu1+", 0.46}, + {"Cu2+", 0.62}, + {"Cu3+", 0.60}, + {"Zn", 1.39}, + {"Zn2+", 0.60}, + {"Ga", 1.40}, + {"Ga1+", 1.14}, + {"Ga2+", 0.88}, + {"Ga3+", 0.47}, + {"Ge", 1.40}, + {"Ge2+", 0.73}, + {"Ge3+", 0.63}, + {"Ge4+", 0.40}, + {"Ge4-", 2.72}, + {"As", 1.50}, + {"As2+", 0.52}, + {"As3+", 0.58}, + {"As4+", 0.64}, + {"As5+", 0.33}, + {"As1-", 1.59}, + {"As2-", 1.85}, + {"As3-", 2.11}, + {"Se", 1.60}, + {"Se1+", 1.39}, + {"Se2+", 1.08}, + {"Se4+", 0.50}, + {"Se6+", 0.29}, + {"Se1-", 1.77}, + {"Se2-", 1.98}, + {"Br", 1.11}, + {"Br1+", 1.06}, + {"Br3+", 0.82}, + {"Br5+", 0.59}, + {"Br7+", 0.39}, + {"Br1-", 1.96}, + {"Kr", 1.14}, /* not in ICSD manual */ + {"Kr2+", 0.74}, + {"Rb", 2.50}, + {"Rb1+", 1.47}, + {"Sr", 2.15}, + {"Sr2+", 1.12}, + {"Y", 1.80}, + {"Y1+", 1.11}, + {"Y2+", 1.30}, + {"Y3+", 0.89}, + {"Zr", 1.60}, + {"Zr1+", 1.42}, + {"Zr2+", 1.21}, + {"Zr3+", 0.89}, + {"Zr4+", 0.72}, + {"Nb", 1.48}, + {"Nb1+", 1.00}, + {"Nb2+", 0.71}, + {"Nb3+", 0.70}, + {"Nb4+", 0.69}, + {"Nb5+", 0.32}, + {"Mo", 1.40}, + {"Mo1+", 1.00}, + {"Mo2+", 0.92}, + {"Mo3+", 0.67}, + {"Mo4+", 0.65}, + {"Mo5+", 0.63}, + {"Mo6+", 0.42}, + {"Tc", 1.35}, + {"Tc2+", 1.00}, + {"Tc3+", 0.80}, + {"Tc4+", 0.64}, + {"Tc6+", 0.56}, + {"Tc7+", 0.98}, + {"Ru", 1.32}, + {"Ru2+", 0.90}, + {"Ru3+", 0.68}, + {"Ru4+", 0.62}, + {"Ru5+", 0.52}, + {"Ru6+", 0.37}, + {"Ru7+", 0.54}, + {"Rh", 1.34}, + {"Rh1+", 0.82}, + {"Rh2+", 0.75}, + {"Rh3+", 0.67}, + {"Rh4+", 0.62}, + {"Rh5+", 0.55}, + {"Rh1-", 1.54}, + {"Pd", 1.37}, + {"Pd1+", 0.59}, + {"Pd2+", 0.64}, + {"Pd3+", 0.76}, + {"Pd4+", 0.62}, + {"Ag", 1.44}, + {"Ag1+", 0.67}, + {"Ag2+", 0.89}, + {"Ag3+", 0.65}, + {"Cd", 1.57}, + {"Cd2+", 0.84}, + {"In", 1.66}, + {"In1+", 1.35}, + {"In2+", 1.08}, + {"In3+", 0.79}, + {"Sn", 1.58}, + {"Sn2+", 0.93}, + {"Sn3+", 0.82}, + {"Sn4+", 0.69}, + {"Sb", 1.60}, + {"Sb2+", 0.83}, + {"Sb3+", 0.76}, + {"Sb4+", 0.69}, + {"Sb5+", 0.61}, + {"Sb6+", 0.75}, + {"Sb2-", 2.16}, + {"Sb3-", 2.44}, + {"Te", 1.70}, + {"Te1+", 1.45}, + {"Te2+", 1.20}, + {"Te4+", 0.52}, + {"Te6+", 0.56}, + {"Te1-", 1.95}, + {"Te2-", 2.21}, + {"I", 1.95}, + {"I1+", 1.70}, + {"I3+", 1.39}, + {"I5+", 0.62}, + {"I7+", 0.50}, + {"I1-", 2.20}, + {"Xe", 1.33}, /* not in ICSD manual */ + {"Xe2+", 1.10}, + {"Xe4+", 0.83}, + {"Xe6+", 0.55}, + {"Xe8+", 0.40}, + {"Cs", 2.71}, + {"Cs1+", 1.67}, + {"Ba", 2.24}, + {"Ba2+", 1.34}, + {"La", 1.87}, + {"La1+", 1.40}, + {"La2+", 1.27}, + {"La3+", 1.06}, + {"La4+", 1.01}, + {"Ce", 1.82}, + {"Ce2+", 1.30}, + {"Ce3+", 1.03}, + {"Ce4+", 0.80}, + {"Pr", 1.83}, + {"Pr2+", 1.00}, + {"Pr3+", 1.01}, + {"Pr4+", 0.78}, + {"Nd", 1.82}, + {"Nd2+", 1.30}, + {"Nd3+", 1.00}, + {"Nd4+", 0.90}, + {"Pm", 1.63}, /* not in ICSD manual */ + {"Pm3+", 0.98}, + {"Sm", 1.80}, + {"Sm2+", 1.10}, + {"Sm3+", 0.96}, + {"Eu", 2.04}, + {"Eu2+", 1.17}, + {"Eu3+", 0.95}, + {"Eu4+", 0.65}, + {"Gd", 1.80}, + {"Gd1+", 0.91}, + {"Gd2+", 0.94}, + {"Gd3+", 0.94}, + {"Gd4+", 1.00}, + {"Tb", 1.78}, + {"Tb1+", 1.50}, + {"Tb2+", 1.22}, + {"Tb3+", 0.92}, + {"Tb4+", 0.76}, + {"Dy", 1.77}, + {"Dy2+", 1.10}, + {"Dy3+", 0.91}, + {"Ho", 1.77}, + {"Ho2+", 1.10}, + {"Ho3+", 0.89}, + {"Er", 1.76}, + {"Er1+", 1.50}, + {"Er2+", 1.20}, + {"Er3+", 0.88}, + {"Tm", 1.75}, + {"Tm2+", 1.16}, + {"Tm3+", 0.87}, + {"Yb", 1.94}, + {"Yb2+", 0.90}, + {"Yb3+", 0.86}, + {"Lu", 1.73}, + {"Lu2+", 1.20}, + {"Lu3+", 0.85}, + {"Hf", 1.59}, + {"Hf2+", 1.10}, + {"Hf3+", 0.97}, + {"Hf4+", 0.71}, + {"Ta", 1.48}, + {"Ta1+", 0.88}, + {"Ta2+", 0.83}, + {"Ta3+", 0.67}, + {"Ta4+", 0.66}, + {"Ta5+", 0.64}, + {"W", 1.41}, + {"W2+", 0.80}, + {"W3+", 0.75}, + {"W4+", 0.65}, + {"W5+", 0.66}, + {"W6+", 0.41}, + {"Re", 1.46}, + {"Re1+", 1.23}, + {"Re2+", 1.00}, + {"Re3+", 0.77}, + {"Re4+", 0.63}, + {"Re5+", 0.52}, + {"Re6+", 0.52}, + {"Re7+", 0.40}, + {"Os", 1.34}, + {"Os1+", 1.20}, + {"Os2+", 1.05}, + {"Os4+", 0.63}, + {"Os5+", 0.51}, + {"Os6+", 0.33}, + {"Os7+", 0.27}, + {"Os8+", 0.20}, + {"Ir", 1.36}, + {"Ir1+", 1.37}, + {"Ir2+", 1.00}, + {"Ir3+", 0.73}, + {"Ir4+", 0.63}, + {"Ir5+", 0.68}, + {"Pt", 1.39}, + {"Pt2+", 0.80}, + {"Pt3+", 0.73}, + {"Pt4+", 0.63}, + {"Pt5+", 0.58}, + {"Pt6+", 0.50}, + {"Au", 1.44}, + {"Au1+", 1.37}, + {"Au2+", 1.11}, + {"Au3+", 0.70}, + {"Au5+", 0.70}, + {"Hg", 1.62}, + {"Hg1+", 0.97}, + {"Hg2+", 0.69}, + {"Tl", 1.73}, + {"Tl1+", 1.47}, + {"Tl3+", 0.88}, + {"Pb", 1.75}, + {"Pb2+", 0.94}, + {"Pb4+", 0.77}, + {"Bi", 1.70}, + {"Bi1+", 1.45}, + {"Bi2+", 1.16}, + {"Bi3+", 0.96}, + {"Bi5+", 0.74}, + {"Bi2-", 1.70}, + {"Po", 1.70}, + {"Po2+", 1.40}, + {"Po4+", 1.10}, + {"Po6+", 0.67}, + {"At", 1.53}, /* not in ICSD manual */ + {"At7+", 0.62}, + {"Rn", 1.53}, /* not in ICSD manual */ + {"Fr", 1.53}, /* not in ICSD manual */ + {"Fr1+", 1.80}, + {"Ra", 1.53}, /* not in ICSD manual */ + {"Ra2+", 1.43}, + {"Ac", 1.88}, + {"Ac3+", 1.18}, + {"Th", 1.80}, + {"Th2+", 0.80}, + {"Th3+", 0.90}, + {"Th4+", 1.00}, + {"Pa", 1.61}, + {"Pa3+", 1.13}, + {"Pa4+", 0.98}, + {"Pa5+", 0.89}, + {"U", 1.55}, + {"U1+", 1.40}, + {"U2+", 1.30}, + {"U3+", 1.06}, + {"U4+", 0.97}, + {"U5+", 0.76}, + {"U6+", 0.45}, + {"Np", 1.58}, + {"Np2+", 1.10}, + {"Np3+", 1.04}, + {"Np4+", 0.95}, + {"Np5+", 0.80}, + {"Np6+", 0.80}, + {"Np7+", 0.71}, + {"Pu", 1.64}, + {"Pu2+", 0.90}, + {"Pu3+", 1.00}, + {"Pu4+", 0.80}, + {"Pu5+", 0.70}, + {"Pu6+", 0.60}, + {"Am", 1.73}, + {"Am2+", 1.20}, + {"Am3+", 1.01}, + {"Am4+", 0.92}, + {"Am5+", 0.69}, + {"Am6+", 0.50}, + {"Cm", 1.42}, /* was 0.00 in ICSD manual */ + {"Cm3+", 0.98}, + {"Cm4+", 0.95}, + {"Bk", 1.42}, /* not in ICSD manual */ + {"Bk3+", 0.96}, + {"Bk4+", 0.93}, + {"Cf", 1.42}, /* not in ICSD manual */ + {"Cf3+", 0.95}, + {"Es", 1.42}, /* not in ICSD manual */ + {"Fm", 1.42}, /* not in ICSD manual */ + {"Md", 1.42}, /* not in ICSD manual */ + {"No", 1.42}, /* not in ICSD manual */ + {"Lr", 1.42}, /* not in ICSD manual */ + {0, 0} +// END_COMPILED_IN_REFERENCE_DATA + }; + + const raw_record* + find_record(std::string const& work_label, bool exact) + { + int m = 0; + const raw_record* matching_record = 0; + for (const raw_record* record = table; record->label; record++) { + int i = basic::match_labels(work_label, record->label); + if (i < 0) return record; + if (i > m) { + m = i; + matching_record = record; + } + } + if (exact || !matching_record) { + throw error("Unknown ion label."); + } + return matching_record; + } + +} // namespace +} // namespace detail + + table::table(std::string const& label, bool exact) + { + std::string work_label = basic::strip_label(label, exact); + record_ = detail::find_record(work_label, exact); + } + + table_iterator::table_iterator() + : + current_("H", true) + {} + + table + table_iterator::next() + { + table result = current_; + if (current_.is_valid()) current_.record_++; + return result; + } + +}}} // namespace cctbx::eltbx::icsd_radii diff --git a/extern/cctbx/cctbx/eltbx/neutron.cpp b/extern/cctbx/cctbx/eltbx/neutron.cpp new file mode 100644 index 00000000..7505b07f --- /dev/null +++ b/extern/cctbx/cctbx/eltbx/neutron.cpp @@ -0,0 +1,256 @@ +#include +#include + +namespace cctbx { namespace eltbx { namespace neutron { + +namespace detail { +namespace { + + /* + Neutron bound scattering lengths & cross-sections + + Data from: http://www.ncnr.nist.gov/resources/n-lengths/list.html + + All of this data was taken from the Special Feature section of + neutron scattering lengths and cross sections of the elements and + their isotopes in Neutron News, Vol. 3, No. 3, 1992, pp. 29-37. + */ + const raw_record_neutron_news_1992 table[] = + { +// BEGIN_COMPILED_IN_REFERENCE_DATA + {"H", -3.7390, 0, 0.3326}, + {"D", 6.671, 0, 0.000519}, + {"He", 3.26, 0, 0.00747}, + {"Li", -1.90, 0, 70.5}, + {"Li1+", -1.90, 0, 70.5}, // copy + {"Be", 7.79, 0, 0.0076}, + {"Be2+", 7.79, 0, 0.0076}, // copy + {"B", 5.30, -0.213, 767.}, + {"C", 6.6460, 0, 0.0035}, + {"N", 9.36, 0, 1.9}, + {"O", 5.803, 0, 0.00019}, + {"O1-", 5.803, 0, 0.00019}, // copy + {"O2-", 5.803, 0, 0.00019}, // copy + {"F", 5.654, 0, 0.0096}, + {"F1-", 5.654, 0, 0.0096}, // copy + {"Ne", 4.566, 0, 0.039}, + {"Na", 3.63, 0, 0.53}, + {"Na1+", 3.63, 0, 0.53}, // copy + {"Mg", 5.375, 0, 0.063}, + {"Mg2+", 5.375, 0, 0.063}, // copy + {"Al", 3.449, 0, 0.231}, + {"Al3+", 3.449, 0, 0.231}, // copy + {"Si", 4.1491, 0, 0.171}, + {"Si4+", 4.1491, 0, 0.171}, // copy + {"P", 5.13, 0, 0.172}, + {"S", 2.847, 0, 0.53}, + {"Cl", 9.5770, 0, 33.5}, + {"Cl1-", 9.5770, 0, 33.5}, // copy + {"Ar", 1.909, 0, 0.675}, + {"K", 3.67, 0, 2.1}, + {"K1+", 3.67, 0, 2.1}, // copy + {"Ca", 4.70, 0, 0.43}, + {"Ca2+", 4.70, 0, 0.43}, // copy + {"Sc", 12.29, 0, 27.5}, + {"Sc3+", 12.29, 0, 27.5}, // copy + {"Ti", -3.438, 0, 6.09}, + {"Ti2+", -3.438, 0, 6.09}, // copy + {"Ti3+", -3.438, 0, 6.09}, // copy + {"Ti4+", -3.438, 0, 6.09}, // copy + {"V", -0.3824, 0, 5.08}, + {"V2+", -0.3824, 0, 5.08}, // copy + {"V3+", -0.3824, 0, 5.08}, // copy + {"V5+", -0.3824, 0, 5.08}, // copy + {"Cr", 3.635, 0, 3.05}, + {"Cr2+", 3.635, 0, 3.05}, // copy + {"Cr3+", 3.635, 0, 3.05}, // copy + {"Mn", -3.73, 0, 13.3}, + {"Mn2+", -3.73, 0, 13.3}, // copy + {"Mn3+", -3.73, 0, 13.3}, // copy + {"Mn4+", -3.73, 0, 13.3}, // copy + {"Fe", 9.45, 0, 2.56}, + {"Fe2+", 9.45, 0, 2.56}, // copy + {"Fe3+", 9.45, 0, 2.56}, // copy + {"Co", 2.49, 0, 37.18}, + {"Co2+", 2.49, 0, 37.18}, // copy + {"Co3+", 2.49, 0, 37.18}, // copy + {"Ni", 10.3, 0, 4.49}, + {"Ni2+", 10.3, 0, 4.49}, // copy + {"Ni3+", 10.3, 0, 4.49}, // copy + {"Cu", 7.718, 0, 3.78}, + {"Cu1+", 7.718, 0, 3.78}, // copy + {"Cu2+", 7.718, 0, 3.78}, // copy + {"Zn", 5.680, 0, 1.11}, + {"Zn2+", 5.680, 0, 1.11}, // copy + {"Ga", 7.288, 0, 2.75}, + {"Ga3+", 7.288, 0, 2.75}, // copy + {"Ge", 8.185, 0, 2.2}, + {"Ge4+", 8.185, 0, 2.2}, // copy + {"As", 6.58, 0, 4.5}, + {"Se", 7.970, 0, 11.7}, + {"Br", 6.795, 0, 6.9}, + {"Br1-", 6.795, 0, 6.9}, // copy + {"Kr", 7.81, 0, 25.}, + {"Rb", 7.09, 0, 0.38}, + {"Rb1+", 7.09, 0, 0.38}, // copy + {"Sr", 7.02, 0, 1.28}, + {"Sr2+", 7.02, 0, 1.28}, // copy + {"Y", 7.75, 0, 1.28}, + {"Y3+", 7.75, 0, 1.28}, // copy + {"Zr", 7.16, 0, 0.185}, + {"Zr4+", 7.16, 0, 0.185}, // copy + {"Nb", 7.054, 0, 1.15}, + {"Nb3+", 7.054, 0, 1.15}, // copy + {"Nb5+", 7.054, 0, 1.15}, // copy + {"Mo", 6.715, 0, 2.48}, + {"Mo3+", 6.715, 0, 2.48}, // copy + {"Mo5+", 6.715, 0, 2.48}, // copy + {"Mo6+", 6.715, 0, 2.48}, // copy + {"Tc", 6.8, 0, 20.}, + {"Ru", 7.03, 0, 2.56}, + {"Ru3+", 7.03, 0, 2.56}, // copy + {"Ru4+", 7.03, 0, 2.56}, // copy + {"Rh", 5.88, 0, 144.8}, + {"Rh3+", 5.88, 0, 144.8}, // copy + {"Rh4+", 5.88, 0, 144.8}, // copy + {"Pd", 5.91, 0, 6.9}, + {"Pd2+", 5.91, 0, 6.9}, // copy + {"Pd4+", 5.91, 0, 6.9}, // copy + {"Ag", 5.922, 0, 63.3}, + {"Ag1+", 5.922, 0, 63.3}, // copy + {"Ag2+", 5.922, 0, 63.3}, // copy + {"Cd", 4.87, -0.70, 2520.}, + {"Cd2+", 4.87, -0.70, 2520.}, // copy + {"In", 4.065, -0.0539, 193.8}, + {"In3+", 4.065, -0.0539, 193.8}, // copy + {"Sn", 6.225, 0, 0.626}, + {"Sn2+", 6.225, 0, 0.626}, // copy + {"Sn4+", 6.225, 0, 0.626}, // copy + {"Sb", 5.57, 0, 4.91}, + {"Sb3+", 5.57, 0, 4.91}, + {"Sb5+", 5.57, 0, 4.91}, + {"Te", 5.80, 0, 4.7}, + {"I", 5.28, 0, 6.15}, + {"I1-", 5.28, 0, 6.15}, // copy + {"Xe", 4.92, 0, 23.9}, + {"Cs", 5.42, 0, 29.0}, + {"Cs1+", 5.42, 0, 29.0}, // copy + {"Ba", 5.07, 0, 1.1}, + {"Ba2+", 5.07, 0, 1.1}, // copy + {"La", 8.24, 0, 8.97}, + {"La3+", 8.24, 0, 8.97}, // copy + {"Ce", 4.84, 0, 0.63}, + {"Ce3+", 4.84, 0, 0.63}, // copy + {"Ce4+", 4.84, 0, 0.63}, // copy + {"Pr", 4.58, 0, 11.5}, + {"Pr3+", 4.58, 0, 11.5}, // copy + {"Pr4+", 4.58, 0, 11.5}, // copy + {"Nd", 7.69, 0, 50.5}, + {"Nd3+", 7.69, 0, 50.5}, // copy + {"Pm", 12.6, 0, 168.4}, + {"Pm3+", 12.6, 0, 168.4}, // copy + {"Sm", 0.80, -1.65, 5922.}, + {"Sm3+", 0.80, -1.65, 5922.}, // copy + {"Eu", 7.22, -1.26, 4530.}, + {"Eu2+", 7.22, -1.26, 4530.}, // copy + {"Eu3+", 7.22, -1.26, 4530.}, // copy + {"Gd", 6.5, -13.82, 49700.}, + {"Gd3+", 6.5, -13.82, 49700.}, // copy + {"Tb", 7.38, 0, 23.4}, + {"Tb3+", 7.38, 0, 23.4}, // copy + {"Dy", 16.9, -0.276, 994.}, + {"Dy3+", 16.9, -0.276, 994.}, // copy + {"Ho", 8.01, 0, 64.7}, + {"Ho3+", 8.01, 0, 64.7}, // copy + {"Er", 7.79, 0, 159.}, + {"Er3+", 7.79, 0, 159.}, // copy + {"Tm", 7.07, 0, 100.}, + {"Tm3+", 7.07, 0, 100.}, // copy + {"Yb", 12.43, 0, 34.8}, + {"Yb2+", 12.43, 0, 34.8}, // copy + {"Yb3+", 12.43, 0, 34.8}, // copy + {"Lu", 7.21, 0, 74.}, + {"Lu3+", 7.21, 0, 74.}, // copy + {"Hf", 7.7, 0, 104.1}, + {"Hf4+", 7.7, 0, 104.1}, // copy + {"Ta", 6.91, 0, 20.6}, + {"Ta5+", 6.91, 0, 20.6}, // copy + {"W", 4.86, 0, 18.3}, + {"W6+", 4.86, 0, 18.3}, // copy + {"Re", 9.2, 0, 89.7}, + {"Os", 10.7, 0, 16}, + {"Os4+", 10.7, 0, 16}, // copy + {"Ir", 10.6, 0, 425.}, + {"Ir3+", 10.6, 0, 425.}, // copy + {"Ir4+", 10.6, 0, 425.}, // copy + {"Pt", 9.60, 0, 10.3}, + {"Pt2+", 9.60, 0, 10.3}, // copy + {"Pt4+", 9.60, 0, 10.3}, // copy + {"Au", 7.63, 0, 98.65}, + {"Au1+", 7.63, 0, 98.65}, // copy + {"Au3+", 7.63, 0, 98.65}, // copy + {"Hg", 12.692, 0, 372.3}, + {"Hg1+", 12.692, 0, 372.3}, // copy + {"Hg2+", 12.692, 0, 372.3}, // copy + {"Tl", 8.776, 0, 3.43}, + {"Tl1+", 8.776, 0, 3.43}, // copy + {"Tl3+", 8.776, 0, 3.43}, // copy + {"Pb", 9.405, 0, 0.171}, + {"Pb2+", 9.405, 0, 0.171}, // copy + {"Pb4+", 9.405, 0, 0.171}, // copy + {"Bi", 8.532, 0, 0.0338}, + {"Bi3+", 8.532, 0, 0.0338}, // copy + {"Bi5+", 8.532, 0, 0.0338}, // copy + {"Th", 10.31, 0, 7.37}, + {"Th4+", 10.31, 0, 7.37}, // copy + {"U", 8.417, 0, 7.57}, + {"U3+", 8.417, 0, 7.57}, // copy + {"U4+", 8.417, 0, 7.57}, // copy + {"U6+", 8.417, 0, 7.57}, // copy + {0, 0, 0, 0} +// END_COMPILED_IN_REFERENCE_DATA + }; + + const raw_record_neutron_news_1992* + find_record(std::string const& work_label, bool exact) + { + int m = 0; + const raw_record_neutron_news_1992* matching_record = 0; + for (const raw_record_neutron_news_1992* r=table; r->label; r++) { + int i = basic::match_labels(work_label, r->label); + if (i < 0) return r; + if (i > m) { + m = i; + matching_record = r; + } + } + if (exact || !matching_record) { + throw std::invalid_argument("Unknown element label:" + work_label); + } + return matching_record; + } + +} // namespace +} // namespace detail + + neutron_news_1992_table::neutron_news_1992_table(std::string const& label, + bool exact) + { + std::string work_label = basic::strip_label(label, exact); + record_ = detail::find_record(work_label, exact); + } + + neutron_news_1992_table_iterator::neutron_news_1992_table_iterator() + : + current_("H", true) + {} + + neutron_news_1992_table + neutron_news_1992_table_iterator::next() + { + neutron_news_1992_table result = current_; + if (current_.is_valid()) current_.record_++; + return result; + } + +}}} // namespace cctbx::eltbx::neutron diff --git a/extern/cctbx/cctbx/eltbx/tiny_pse.cpp b/extern/cctbx/cctbx/eltbx/tiny_pse.cpp new file mode 100644 index 00000000..8795821e --- /dev/null +++ b/extern/cctbx/cctbx/eltbx/tiny_pse.cpp @@ -0,0 +1,173 @@ +#include +#include + +namespace cctbx { namespace eltbx { namespace tiny_pse { + +namespace detail { +namespace { + + /* + CRC Handbook of Chemistry & Physics, 63rd edition, 1982-1983 + CRC Handbook of Chemistry & Physics, 70th edition, 1989-1990 + */ + const raw_record table[] = + { +// BEGIN_COMPILED_IN_REFERENCE_DATA + { 1, "H", "hydrogen", 1.008 }, + { 1, "D", "deuterium", 2.000 }, + { 2, "He", "helium", 4.003 }, + { 3, "Li", "lithium", 6.941 }, + { 4, "Be", "beryllium", 9.012 }, + { 5, "B", "boron", 10.811 }, + { 6, "C", "carbon", 12.011 }, + { 7, "N", "nitrogen", 14.007 }, + { 8, "O", "oxygen", 15.999 }, + { 9, "F", "fluorine", 18.998 }, + { 10, "Ne", "neon", 20.180 }, + { 11, "Na", "sodium", 22.990 }, + { 12, "Mg", "magnesium", 24.305 }, + { 13, "Al", "aluminium", 26.982 }, + { 14, "Si", "silicon", 28.086 }, + { 15, "P", "phosphorus", 30.974 }, + { 16, "S", "sulphur", 32.066 }, + { 17, "Cl", "chlorine", 35.452 }, + { 18, "Ar", "argon", 39.948 }, + { 19, "K", "potassium", 39.098 }, + { 20, "Ca", "calcium", 40.078 }, + { 21, "Sc", "scandium", 44.956 }, + { 22, "Ti", "titanium", 47.883 }, + { 23, "V", "vanadium", 50.941 }, + { 24, "Cr", "chromium", 51.996 }, + { 25, "Mn", "manganese", 54.938 }, + { 26, "Fe", "iron", 55.847 }, + { 27, "Co", "cobalt", 58.933 }, + { 28, "Ni", "nickel", 58.691 }, + { 29, "Cu", "copper", 63.546 }, + { 30, "Zn", "zinc", 65.392 }, + { 31, "Ga", "gallium", 69.723 }, + { 32, "Ge", "germanium", 72.612 }, + { 33, "As", "arsenic", 74.922 }, + { 34, "Se", "selenium", 78.963 }, + { 35, "Br", "bromine", 79.904 }, + { 36, "Kr", "krypton", 83.801 }, + { 37, "Rb", "rubidium", 85.468 }, + { 38, "Sr", "strontium", 87.621 }, + { 39, "Y", "yttrium", 88.906 }, + { 40, "Zr", "zirconium", 91.224 }, + { 41, "Nb", "niobium", 92.906 }, + { 42, "Mo", "molybdenum", 95.941 }, + { 43, "Tc", "technetium", 98.000 }, + { 44, "Ru", "ruthenium", 101.072 }, + { 45, "Rh", "rhodium", 102.905 }, + { 46, "Pd", "palladium", 106.421 }, + { 47, "Ag", "silver", 107.868 }, + { 48, "Cd", "cadmium", 112.411 }, + { 49, "In", "indium", 114.821 }, + { 50, "Sn", "tin", 118.710 }, + { 51, "Sb", "antimony", 121.753 }, + { 52, "Te", "tellurium", 127.603 }, + { 53, "I", "iodine", 126.904 }, + { 54, "Xe", "xenon", 131.292 }, + { 55, "Cs", "caesium", 132.905 }, + { 56, "Ba", "barium", 137.327 }, + { 57, "La", "lanthanum", 138.906 }, + { 58, "Ce", "cerium", 140.115 }, + { 59, "Pr", "praseodymium", 140.908 }, + { 60, "Nd", "neodymium", 144.243 }, + { 61, "Pm", "promethium", 145.000 }, + { 62, "Sm", "samarium", 150.363 }, + { 63, "Eu", "europium", 151.965 }, + { 64, "Gd", "gadolinium", 157.253 }, + { 65, "Tb", "terbium", 158.925 }, + { 66, "Dy", "dysprosium", 162.503 }, + { 67, "Ho", "holmium", 164.930 }, + { 68, "Er", "erbium", 167.263 }, + { 69, "Tm", "thulium", 168.934 }, + { 70, "Yb", "ytterbium", 173.043 }, + { 71, "Lu", "lutetium", 174.967 }, + { 72, "Hf", "hafnium", 178.492 }, + { 73, "Ta", "tantalum", 180.948 }, + { 74, "W", "tungsten", 183.853 }, + { 75, "Re", "rhenium", 186.207 }, + { 76, "Os", "osmium", 190.210 }, + { 77, "Ir", "iridium", 192.223 }, + { 78, "Pt", "platinum", 195.083 }, + { 79, "Au", "gold", 196.967 }, + { 80, "Hg", "mercury", 200.593 }, + { 81, "Tl", "thallium", 204.383 }, + { 82, "Pb", "lead", 207.210 }, + { 83, "Bi", "bismuth", 208.980 }, + { 84, "Po", "polonium", 209.000 }, + { 85, "At", "astatine", 210.000 }, + { 86, "Rn", "radon", 222.000 }, + { 87, "Fr", "francium", 223.000 }, + { 88, "Ra", "radium", 226.025 }, + { 89, "Ac", "actinium", 227.028 }, + { 90, "Th", "thorium", 232.038 }, + { 91, "Pa", "protactinium", 231.035 }, + { 92, "U", "uranium", 238.028 }, + { 93, "Np", "neptunium", 237.048 }, + { 94, "Pu", "plutonium", 244.000 }, + { 95, "Am", "americium", 243.000 }, + { 96, "Cm", "curium", 247.000 }, + { 97, "Bk", "berkelium", 247.000 }, + { 98, "Cf", "californium", 251.000 }, + { 99, "Es", "einsteinium", 254.000 }, + { 100, "Fm", "fermium", 257.000 }, + { 101, "Md", "mendelevium", 258.000 }, + { 102, "No", "nobelium", 259.000 }, + { 103, "Lr", "lawrencium", 260.000 }, + { 0, 0, 0, 0. } +// END_COMPILED_IN_REFERENCE_DATA + }; + + const raw_record* + find_record(std::string const& work_label, bool exact) + { + int m = 0; + const raw_record* matching_record = 0; + for (const raw_record* r=table; r->symbol; r++) { + int i = basic::match_labels(work_label, r->symbol); + if (i < 0) return r; + if (i > m) { + m = i; + matching_record = r; + } + } + if (exact || !matching_record) { + throw error("Unknown element symbol."); + } + return matching_record; + } + +} // namespace +} // namespace detail + + table::table(std::string const& label, bool exact) + { + std::string work_label = basic::strip_label(label, exact); + record_ = detail::find_record(work_label, exact); + } + + table::table(int atomic_number) + { + for (record_=detail::table; record_->symbol; record_++) { + if (record_->z == atomic_number) return; + } + throw error_index("Atomic number out of range."); + } + + table_iterator::table_iterator() + : + current_(1) + {} + + table + table_iterator::next() + { + table result = current_; + if (current_.is_valid()) current_.record_++; + return result; + } + +}}} // namespace cctbx::eltbx::tiny_pse diff --git a/extern/cctbx/cctbx/eltbx/wavelengths.cpp b/extern/cctbx/cctbx/eltbx/wavelengths.cpp new file mode 100644 index 00000000..cc5177f4 --- /dev/null +++ b/extern/cctbx/cctbx/eltbx/wavelengths.cpp @@ -0,0 +1,49 @@ +#include +#include +#include // cannot use cctype b/o non-conforming compilers + +namespace cctbx { namespace eltbx { namespace wavelengths { + +namespace detail { +namespace { + + const raw table[] = { +// BEGIN_COMPILED_IN_REFERENCE_DATA + {"CrA1", 2.28970}, {"CrA2", 2.29361}, {"Cr", 2.2909}, + {"FeA1", 1.93604}, {"FeA2", 1.93998}, {"Fe", 1.9373}, + {"CuA1", 1.54056}, {"CuA2", 1.54439}, {"Cu", 1.5418}, + {"MoA1", 0.70930}, {"MoA2", 0.71359}, {"Mo", 0.7107}, + {"AgA1", 0.55941}, {"AgA2", 0.56380}, {"Ag", 0.5608}, + {"", 0} +// END_COMPILED_IN_REFERENCE_DATA + }; + +} // namespace +} // namespace detail + + characteristic::characteristic(std::string const& label) + { + std::string lbl = label; + if (lbl.size() > 0) lbl[0] = toupper(lbl[0]); + if (lbl.size() > 1) lbl[1] = tolower(lbl[1]); + if (lbl.size() > 2) lbl[2] = toupper(lbl[2]); + for (raw_ = detail::table; raw_->value; raw_++) { + if (lbl == std::string(raw_->label)) return; + } + throw error("Unknown label for characteristic wavelength."); + } + + characteristic_iterator::characteristic_iterator() + : + current_("CrA1") + {} + + characteristic + characteristic_iterator::next() + { + characteristic result = current_; + if (current_.is_valid()) current_.raw_++; + return result; + } + +}}} // namespace cctbx::eltbx::wavelengths diff --git a/extern/cctbx/cctbx/eltbx/xray_scattering/wk1995.cpp b/extern/cctbx/cctbx/eltbx/xray_scattering/wk1995.cpp new file mode 100644 index 00000000..d75a1058 --- /dev/null +++ b/extern/cctbx/cctbx/eltbx/xray_scattering/wk1995.cpp @@ -0,0 +1,692 @@ +#include + +namespace cctbx { namespace eltbx { namespace xray_scattering { + + namespace { + + /* + wk1995_raw_table contains the reformatted data found in + + ftp://wrzx02.rz.uni-wuerzburg.de/pub/local/Crystallography/sfac.dat + + File picked up Jul 4, 1995. + File verified Sep 12, 2001. + */ + + static const detail::raw_table_entry<5> wk1995_raw_table[] = + { +// BEGIN_COMPILED_IN_REFERENCE_DATA + { "H", // added entry, not part of original sfac.dat + // 5-Gaussian fit based on ITC 2006 Table 6.1.1.2. + // Data point added for fit: stol=6, y=0, with sigma=0.0005 for + // all data points. + // max(gaussian_fit.significant_relative_errors()): 0.00991125937956 + { -0.117103661459, 0.00934859438867, 0.270068598623, + 0.284341399492, 0.552871721265 }, + { 3.05984661463, 0.746557743911, 3.29178616951, + 32.6456509125, 11.5463566492 }, + 0. }, // SDS + { "Hiso", { 0.413048, 0.294953, 0.187491, 0.080701, 0.023736 }, + { 15.569946, 32.398468, 5.711404, 61.889874, 1.334118 }, + 0.000049 }, // isolated atom + { "He", { 0.732354, 0.753896, 0.283819, 0.190003, 0.039139 }, + { 11.553918, 4.595831, 1.546299, 26.463964, 0.377523 }, + 0.000487 }, + { "Li", { 0.974637, 0.158472, 0.811855, 0.262416, 0.790108 }, + { 4.334946, 0.342451, 97.102966, 201.363831, 1.409234 }, + 0.002542 }, + { "Be", { 1.533712, 0.638283, 0.601052, 0.106139, 1.118414 }, + { 42.662079, 0.595420, 99.106499, 0.151340, 1.843093 }, + 0.002511 }, + { "B", { 2.085185, 1.064580, 1.062788, 0.140515, 0.641784 }, + { 23.494068, 1.137894, 61.238976, 0.114886, 0.399036 }, + 0.003823 }, + { "C", { 2.657506, 1.078079, 1.490909, -4.241070, 0.713791 }, + { 14.780758, 0.776775, 42.086842, -0.000294, 0.239535 }, + 4.297983 }, + { "N", { 11.893780, 3.277479, 1.858092, 0.858927, 0.912985 }, + { 0.000158, 10.232723, 30.344690, 0.656065, 0.217287 }, + -11.804902 }, + { "O", { 2.960427, 2.508818, 0.637853, 0.722838, 1.142756 }, + { 14.182259, 5.936858, 0.112726, 34.958481, 0.390240 }, + 0.027014 }, + { "F", { 3.511943, 2.772244, 0.678385, 0.915159, 1.089261 }, + { 10.687859, 4.380466, 0.093982, 27.255203, 0.313066 }, + 0.032557 }, + { "Ne", { 4.183749, 2.905726, 0.520513, 1.135641, 1.228065 }, + { 8.175457, 3.252536, 0.063295, 21.813910, 0.224952 }, + 0.025576 }, + { "Na", { 4.910127, 3.081783, 1.262067, 1.098938, 0.560991 }, + { 3.281434, 9.119178, 0.102763, 132.013947, 0.405878 }, + 0.079712 }, + { "Mg", { 4.708971, 1.194814, 1.558157, 1.170413, 3.239403 }, + { 4.875207, 108.506081, 0.111516, 48.292408, 1.928171 }, + 0.126842 }, + { "Al", { 4.730796, 2.313951, 1.541980, 1.117564, 3.154754 }, + { 3.628931, 43.051167, 0.095960, 108.932388, 1.555918 }, + 0.139509 }, + { "Si", { 5.275329, 3.191038, 1.511514, 1.356849, 2.519114 }, + { 2.631338, 33.730728, 0.081119, 86.288643, 1.170087 }, + 0.145073 }, + { "P", { 1.950541, 4.146930, 1.494560, 1.522042, 5.729711 }, + { 0.908139, 27.044952, 0.071280, 67.520187, 1.981173 }, + 0.155233 }, + { "S", { 6.372157, 5.154568, 1.473732, 1.635073, 1.209372 }, + { 1.514347, 22.092527, 0.061373, 55.445175, 0.646925 }, + 0.154722 }, + { "Cl", { 1.446071, 6.870609, 6.151801, 1.750347, 0.634168 }, + { 0.052357, 1.193165, 18.343416, 46.398396, 0.401005 }, + 0.146773 }, + { "Ar", { 7.188004, 6.638454, 0.454180, 1.929593, 1.523654 }, + { 0.956221, 15.339877, 15.339862, 39.043823, 0.062409 }, + 0.265954 }, + { "K", { 8.163991, 7.146945, 1.070140, 0.877316, 1.486434 }, + { 12.816323, 0.808945, 210.327011, 39.597652, 0.052821 }, + 0.253614 }, + { "Ca", { 8.593655, 1.477324, 1.436254, 1.182839, 7.113258 }, + { 10.460644, 0.041891, 81.390381, 169.847839, 0.688098 }, + 0.196255 }, + { "Sc", { 1.476566, 1.487278, 1.600187, 9.177463, 7.099750 }, + { 53.131023, 0.035325, 137.319489, 9.098031, 0.602102 }, + 0.157765 }, + { "Ti", { 9.818524, 1.522646, 1.703101, 1.768774, 7.082555 }, + { 8.001879, 0.029763, 39.885422, 120.157997, 0.532405 }, + 0.102473 }, + { "V", { 10.473575, 1.547881, 1.986381, 1.865616, 7.056250 }, + { 7.081940, 0.026040, 31.909672, 108.022842, 0.474882 }, + 0.067744 }, + { "Cr", { 11.007069, 1.555477, 2.985293, 1.347855, 7.034779 }, + { 6.366281, 0.023987, 23.244839, 105.774498, 0.429369 }, + 0.065510 }, + { "Mn", { 11.709542, 1.733414, 2.673141, 2.023368, 7.003180 }, + { 5.597120, 0.017800, 21.788420, 89.517914, 0.383054 }, + -0.147293 }, + { "Fe", { 12.311098, 1.876623, 3.066177, 2.070451, 6.975185 }, + { 5.009415, 0.014461, 18.743040, 82.767876, 0.346506 }, + -0.304931 }, + { "Co", { 12.914510, 2.481908, 3.466894, 2.106351, 6.960892 }, + { 4.507138, 0.009126, 16.438129, 76.987320, 0.314418 }, + -0.936572 }, + { "Ni", { 13.521865, 6.947285, 3.866028, 2.135900, 4.284731 }, + { 4.077277, 0.286763, 14.622634, 71.966080, 0.004437 }, + -2.762697 }, + { "Cu", { 14.014192, 4.784577, 5.056806, 1.457971, 6.932996 }, + { 3.738280, 0.003744, 13.034982, 72.554794, 0.265666 }, + -3.254477 }, + { "Zn", { 14.741002, 6.907748, 4.642337, 2.191766, 38.424042 }, + { 3.388232, 0.243315, 11.903689, 63.312130, 0.000397 }, + -36.915829 }, + { "Ga", { 15.758946, 6.841123, 4.121016, 2.714681, 2.395246 }, + { 3.121754, 0.226057, 12.482196, 66.203621, 0.007238 }, + -0.847395 }, + { "Ge", { 16.540613, 1.567900, 3.727829, 3.345098, 6.785079 }, + { 2.866618, 0.012198, 13.432163, 58.866047, 0.210974 }, + 0.018726 }, + { "As", { 17.025642, 4.503441, 3.715904, 3.937200, 6.790175 }, + { 2.597739, 0.003012, 14.272119, 50.437996, 0.193015 }, + -2.984117 }, + { "Se", { 17.354071, 4.653248, 4.259489, 4.136455, 6.749163 }, + { 2.349787, 0.002550, 15.579460, 45.181202, 0.177432 }, + -3.160982 }, + { "Br", { 17.550570, 5.411882, 3.937180, 3.880645, 6.707793 }, + { 2.119226, 16.557184, 0.002481, 42.164009, 0.162121 }, + -2.492088 }, + { "Kr", { 17.655279, 6.848105, 4.171004, 3.446760, 6.685200 }, + { 1.908231, 16.606236, 0.001598, 39.917473, 0.146896 }, + -2.810592 }, + { "Rb", { 8.123134, 2.138042, 6.761702, 1.156051, 17.679546 }, + { 15.142385, 33.542667, 0.129372, 224.132507, 1.713368 }, + 1.139548 }, + { "Sr", { 17.730219, 9.795867, 6.099763, 2.620025, 0.600053 }, + { 1.563060, 14.310868, 0.120574, 135.771317, 0.120574 }, + 1.140251 }, + { "Y", { 17.792040, 10.253252, 5.714949, 3.170516, 0.918251 }, + { 1.429691, 13.132816, 0.112173, 108.197029, 0.112173 }, + 1.131787 }, + { "Zr", { 17.859772, 10.911038, 5.821115, 3.512513, 0.746965 }, + { 1.310692, 12.319285, 0.104353, 91.777542, 0.104353 }, + 1.124859 }, + { "Nb", { 17.958399, 12.063054, 5.007015, 3.287667, 1.531019 }, + { 1.211590, 12.246687, 0.098615, 75.011948, 0.098615 }, + 1.123452 }, + { "Mo", { 6.236218, 17.987711, 12.973127, 3.451426, 0.210899 }, + { 0.090780, 1.108310, 11.468720, 66.684151, 0.090780 }, + 1.108770 }, + { "Tc", { 17.840963, 3.428236, 1.373012, 12.947364, 6.335469 }, + { 1.005729, 41.901382, 119.320541, 9.781542, 0.083391 }, + 1.074784 }, + { "Ru", { 6.271624, 17.906738, 14.123269, 3.746008, 0.908235 }, + { 0.077040, 0.928222, 9.555345, 35.860680, 123.552246 }, + 1.043992 }, + { "Rh", { 6.216648, 17.919739, 3.854252, 0.840326, 15.173498 }, + { 0.070789, 0.856121, 33.889484, 121.686691, 9.029517 }, + 0.995452 }, + { "Pd", { 6.121511, 4.784063, 16.631683, 4.318258, 13.246773 }, + { 0.062549, 0.784031, 8.751391, 34.489983, 0.784031 }, + 0.883099 }, + { "Ag", { 6.073874, 17.155437, 4.173344, 0.852238, 17.988686 }, + { 0.055333, 7.896512, 28.443739, 110.376106, 0.716809 }, + 0.756603 }, + { "Cd", { 6.080986, 18.019468, 4.018197, 1.303510, 17.974669 }, + { 0.048990, 7.273646, 29.119284, 95.831207, 0.661231 }, + 0.603504 }, + { "In", { 6.196477, 18.816183, 4.050479, 1.638929, 17.962912 }, + { 0.042072, 6.695665, 31.009790, 103.284348, 0.610714 }, + 0.333097 }, + { "Sn", { 19.325171, 6.281571, 4.498866, 1.856934, 17.917318 }, + { 6.118104, 0.036915, 32.529045, 95.037186, 0.565651 }, + 0.119024 }, + { "Sb", { 5.394956, 6.549570, 19.650681, 1.827820, 17.867832 }, + { 33.326523, 0.030974, 5.564929, 87.130966, 0.523992 }, + -0.290506 }, + { "Te", { 6.660302, 6.940756, 19.847015, 1.557175, 17.802427 }, + { 33.031654, 0.025750, 5.065547, 84.101616, 0.487660 }, + -0.806668 }, + { "I", { 19.884502, 6.736593, 8.110516, 1.170953, 17.548716 }, + { 4.628591, 0.027754, 31.849096, 84.406387, 0.463550 }, + -0.448811 }, + { "Xe", { 19.978920, 11.774945, 9.332182, 1.244749, 17.737501 }, + { 4.143356, 0.010142, 28.796200, 75.280685, 0.413616 }, + -6.065902 }, + { "Cs", { 17.418674, 8.314444, 10.323193, 1.383834, 19.876251 }, + { 0.399828, 0.016872, 25.605827, 233.339676, 3.826915 }, + -2.322802 }, + { "Ba", { 19.747343, 17.368477, 10.465718, 2.592602, 11.003653 }, + { 3.481823, 0.371224, 21.226641, 173.834274, 0.010719 }, + -5.183497 }, + { "La", { 19.966019, 27.329655, 11.018425, 3.086696, 17.335455 }, + { 3.197408, 0.003446, 19.955492, 141.381973, 0.341817 }, + -21.745489 }, + { "Ce", { 17.355122, 43.988499, 20.546650, 3.130670, 11.353665 }, + { 0.328369, 0.002047, 3.088196, 134.907654, 18.832960 }, + -38.386017 }, + { "Pr", { 21.551311, 17.161730, 11.903859, 2.679103, 9.564197 }, + { 2.995675, 0.312491, 17.716705, 152.192825, 0.010468 }, + -3.871068 }, + { "Nd", { 17.331244, 62.783924, 12.160097, 2.663483, 22.239950 }, + { 0.300269, 0.001320, 17.026001, 148.748993, 2.910268 }, + -57.189842 }, + { "Pm", { 17.286388, 51.560162, 12.478557, 2.675515, 22.960947 }, + { 0.286620, 0.001550, 16.223755, 143.984512, 2.796480 }, + -45.973682 }, + { "Sm", { 23.700363, 23.072214, 12.777782, 2.684217, 17.204367 }, + { 2.689539, 0.003491, 15.495437, 139.862473, 0.274536 }, + -17.452166 }, + { "Eu", { 17.186195, 37.156837, 13.103387, 2.707246, 24.419271 }, + { 0.261678, 0.001995, 14.787360, 134.816299, 2.581883 }, + -31.586687 }, + { "Gd", { 24.898117, 17.104952, 13.222581, 3.266152, 48.995213 }, + { 2.435028, 0.246961, 13.996325, 110.863091, 0.001383 }, + -43.505684 }, + { "Tb", { 25.910013, 32.344139, 13.765117, 2.751404, 17.064405 }, + { 2.373912, 0.002034, 13.481969, 125.836510, 0.236916 }, + -26.851971 }, + { "Dy", { 26.671785, 88.687576, 14.065445, 2.768497, 17.067781 }, + { 2.282593, 0.000665, 12.920230, 121.937187, 0.225531 }, + -83.279831 }, + { "Ho", { 27.150190, 16.999819, 14.059334, 3.386979, 46.546471 }, + { 2.169660, 0.215414, 12.213148, 100.506783, 0.001211 }, + -41.165253 }, + { "Er", { 28.174887, 82.493271, 14.624002, 2.802756, 17.018515 }, + { 2.120995, 0.000640, 11.915256, 114.529938, 0.207519 }, + -77.135223 }, + { "Tm", { 28.925894, 76.173798, 14.904704, 2.814812, 16.998117 }, + { 2.046203, 0.000656, 11.465375, 111.411980, 0.199376 }, + -70.839813 }, + { "Yb", { 29.676760, 65.624069, 15.160854, 2.830288, 16.997850 }, + { 1.977630, 0.000720, 11.044622, 108.139153, 0.192110 }, + -60.313812 }, + { "Lu", { 30.122866, 15.099346, 56.314899, 3.540980, 16.943729 }, + { 1.883090, 10.342764, 0.000780, 89.559250, 0.183849 }, + -51.049416 }, + { "Hf", { 30.617033, 15.145351, 54.933548, 4.096253, 16.896156 }, + { 1.795613, 9.934469, 0.000739, 76.189705, 0.175914 }, + -49.719837 }, + { "Ta", { 31.066359, 15.341823, 49.278297, 4.577665, 16.828321 }, + { 1.708732, 9.618455, 0.000760, 66.346199, 0.168002 }, + -44.119026 }, + { "W", { 31.507900, 15.682498, 37.960129, 4.885509, 16.792112 }, + { 1.629485, 9.446448, 0.000898, 59.980675, 0.160798 }, + -32.864574 }, + { "Re", { 31.888456, 16.117104, 42.390297, 5.211669, 16.767591 }, + { 1.549238, 9.233474, 0.000689, 54.516373, 0.152815 }, + -37.412682 }, + { "Os", { 32.210297, 16.678440, 48.559906, 5.455839, 16.735533 }, + { 1.473531, 9.049695, 0.000519, 50.210201, 0.145771 }, + -43.677956 }, + { "Ir", { 32.004436, 1.975454, 17.070105, 15.939454, 5.990003 }, + { 1.353767, 81.014175, 0.128093, 7.661196, 26.659403 }, + 4.018893 }, + { "Pt", { 31.273891, 18.445440, 17.063745, 5.555933, 1.575270 }, + { 1.316992, 8.797154, 0.124741, 40.177994, 1.316997 }, + 4.050394 }, + { "Au", { 16.777390, 19.317156, 32.979683, 5.595453, 10.576854 }, + { 0.122737, 8.621570, 1.256902, 38.008820, 0.000601 }, + -6.279078 }, + { "Hg", { 16.839890, 20.023823, 28.428564, 5.881564, 4.714706 }, + { 0.115905, 8.256927, 1.195250, 39.247227, 1.195250 }, + 4.076478 }, + { "Tl", { 16.630795, 19.386616, 32.808571, 1.747191, 6.356862 }, + { 0.110704, 7.181401, 1.119730, 90.660263, 26.014978 }, + 4.066939 }, + { "Pb", { 16.419567, 32.738590, 6.530247, 2.342742, 19.916475 }, + { 0.105499, 1.055049, 25.025890, 80.906593, 6.664449 }, + 4.049824 }, + { "Bi", { 16.282274, 32.725136, 6.678302, 2.694750, 20.576559 }, + { 0.101180, 1.002287, 25.714146, 77.057549, 6.291882 }, + 4.040914 }, + { "Po", { 16.289164, 32.807171, 21.095163, 2.505901, 7.254589 }, + { 0.098121, 0.966265, 6.046622, 76.598068, 28.096128 }, + 4.046556 }, + { "At", { 16.011461, 32.615547, 8.113899, 2.884082, 21.377867 }, + { 0.092639, 0.904416, 26.543257, 68.372963, 5.499512 }, + 3.995684 }, + { "Rn", { 16.070229, 32.641106, 21.489658, 2.299218, 9.480184 }, + { 0.090437, 0.876409, 5.239687, 69.188477, 27.632641 }, + 4.020977 }, + { "Fr", { 16.007385, 32.663830, 21.594351, 1.598497, 11.121192 }, + { 0.087031, 0.840187, 4.954467, 199.805801, 26.905106 }, + 4.003472 }, + { "Ra", { 32.563690, 21.396671, 11.298093, 2.834688, 15.914965 }, + { 0.801980, 4.590666, 22.758972, 160.404388, 0.083544 }, + 3.981773 }, + { "Ac", { 15.914053, 32.535042, 21.553976, 11.433394, 3.612409 }, + { 0.080511, 0.770669, 4.352206, 21.381622, 130.500748 }, + 3.939212 }, + { "Th", { 15.784024, 32.454899, 21.849222, 4.239077, 11.736191 }, + { 0.077067, 0.735137, 4.097976, 109.464111, 20.512138 }, + 3.922533 }, + { "Pa", { 32.740208, 21.973675, 12.957398, 3.683832, 15.744058 }, + { 0.709545, 4.050881, 19.231543, 117.255005, 0.074040 }, + 3.886066 }, + { "U", { 15.679275, 32.824306, 13.660459, 3.687261, 22.279434 }, + { 0.071206, 0.681177, 18.236156, 112.500038, 3.930325 }, + 3.854444 }, + { "Np", { 32.999901, 22.638077, 14.219973, 3.672950, 15.683245 }, + { 0.657086, 3.854918, 17.435474, 109.464485, 0.068033 }, + 3.769391 }, + { "Pu", { 33.281178, 23.148544, 15.153755, 3.031492, 15.704215 }, + { 0.634999, 3.856168, 16.849735, 121.292038, 0.064857 }, + 3.664200 }, + { "Am", { 33.435162, 23.657259, 15.576339, 3.027023, 15.746100 }, + { 0.612785, 3.792942, 16.195778, 117.757004, 0.061755 }, + 3.541160 }, + { "Cm", { 15.804837, 33.480801, 24.150198, 3.655563, 15.499866 }, + { 0.058619, 0.590160, 3.674720, 100.736191, 15.408296 }, + 3.390840 }, + { "Bk", { 15.889072, 33.625286, 24.710381, 3.707139, 15.839268 }, + { 0.055503, 0.569571, 3.615472, 97.694786, 14.754303 }, + 3.213169 }, + { "Cf", { 33.794075, 25.467693, 16.048487, 3.657525, 16.008982 }, + { 0.550447, 3.581973, 14.357388, 96.064972, 0.052450 }, + 3.005326 }, + { "H1-", { 0.702260, 0.763666, 0.248678, 0.261323, 0.023017 }, + { 23.945604, 74.897919, 6.773289, 233.583450, 1.337531 }, + 0.000425 }, + { "Li1+", { 0.432724, 0.549257, 0.376575, -0.336481, 0.976060 }, + { 0.260367, 1.042836, 7.885294, 0.260368, 3.042539 }, + 0.001764 }, + { "Be2+", { 3.055430, -2.372617, 1.044914, 0.544233, 0.381737 }, + { 0.001226, 0.001227, 1.542106, 0.456279, 4.047479 }, + -0.653773 }, + { "Cval", { 1.258489, 0.728215, 1.119856, 2.168133, 0.705239 }, + { 10.683769, 0.208177, 0.836097, 24.603704, 58.954273 }, + 0.019722 }, + { "O1-", { 3.106934, 3.235142, 1.148886, 0.783981, 0.676953 }, + { 19.868080, 6.960252, 0.170043, 65.693512, 0.630757 }, + 0.046136 }, + { "O2-", { 3.990247, 2.300563, 0.607200, 1.907882, 1.167080 }, + { 16.639956, 5.636819, 0.108493, 47.299709, 0.379984 }, + 0.025429 }, + { "F1-", { 0.457649, 3.841561, 1.432771, 0.801876, 3.395041 }, + { 0.917243, 5.507803, 0.164955, 51.076206, 15.821679 }, + 0.069525 }, + { "Na1+", { 3.148690, 4.073989, 0.767888, 0.995612, 0.968249 }, + { 2.594987, 6.046925, 0.070139, 14.122657, 0.217037 }, + 0.045300 }, + { "Mg2+", { 3.062918, 4.135106, 0.853742, 1.036792, 0.852520 }, + { 2.015803, 4.417941, 0.065307, 9.669710, 0.187818 }, + 0.058851 }, + { "Al3+", { 4.132015, 0.912049, 1.102425, 0.614876, 3.219136 }, + { 3.528641, 7.378344, 0.133708, 0.039065, 1.644728 }, + 0.019397 }, + { "Sival", { 2.879033, 3.072960, 1.515981, 1.390030, 4.995051 }, + { 1.239713, 38.706276, 0.081481, 93.616333, 2.770293 }, + 0.146030 }, + /* was "Siva" */ + { "Si4+", { 3.676722, 3.828496, 1.258033, 0.419024, 0.720421 }, + { 1.446851, 3.013144, 0.064397, 0.206254, 5.970222 }, + 0.097266 }, + { "Cl1-", { 1.061802, 7.139886, 6.524271, 2.355626, 35.829403 }, + { 0.144727, 1.171795, 19.467655, 60.320301, 0.000436 }, + -34.916603 }, + { "K1+", { -17.609339, 1.494873, 7.150305, 10.899569, 15.808228 }, + { 18.840979, 0.053453, 0.812940, 22.264105, 14.351593 }, + 0.257164 }, + { "Ca2+", { 8.501441, 12.880483, 9.765095, 7.156669, 0.711160 }, + { 10.525848, -0.004033, 0.010692, 0.684443, 27.231771 }, + -21.013187 }, + { "Sc3+", { 7.104348, 1.511488, -53.669773, 38.404816, 24.532240 }, + { 0.601957, 0.033386, 12.572138, 10.859736, 14.125230 }, + 0.118642 }, + { "Ti2+", { 7.040119, 1.496285, 9.657304, 0.006534, 1.649561 }, + { 0.537072, 0.031914, 8.009958, 201.800293, 24.039482 }, + 0.150362 }, + { "Ti3+", { 36.587933, 7.230255, -9.086077, 2.084594, 17.294008 }, + { 0.000681, 0.522262, 5.262317, 15.881716, 6.149805 }, + -35.111282 }, + { "Ti4+", { 45.355537, 7.092900, 7.483858, -43.498817, 1.678915 }, + { 9.252186, 0.523046, 13.082852, 10.193876, 0.023064 }, + -0.110628 }, + { "V2+", { 7.754356, 2.064100, 2.576998, 2.011404, 7.126177 }, + { 7.066315, 0.014993, 7.066308, 22.055786, 0.467568 }, + -0.533379 }, + { "V3+", { 9.958480, 1.596350, 1.483442, -10.846044, 17.332867 }, + { 6.763041, 0.056895, 17.750029, 0.328826, 0.388013 }, + 0.474921 }, + { "V5+", { 15.575018, 8.448095, 1.612040, -9.721855, 1.534029 }, + { 0.682708, 5.566640, 10.527077, 0.907961, 0.066667 }, + 0.552676 }, + { "Cr2+", { 10.598877, 1.565858, 2.728280, 0.098064, 6.959321 }, + { 6.151846, 0.023519, 17.432816, 54.002388, 0.426301 }, + 0.049870 }, + { "Cr3+", { 7.989310, 1.765079, 2.627125, 1.829380, 6.980908 }, + { 6.068867, 0.018342, 6.068887, 16.309284, 0.420864 }, + -0.192123 }, + { "Mn2+", { 11.287712, 26.042414, 3.058096, 0.090258, 7.088306 }, + { 5.506225, 0.000774, 16.158575, 54.766354, 0.375580 }, + -24.566132 }, + { "Mn3+", { 6.926972, 2.081342, 11.128379, 2.375107, -0.419287 }, + { 0.378315, 0.015054, 5.379957, 14.429586, 0.004939 }, + -0.093713 }, + { "Mn4+", { 12.409131, 7.466993, 1.809947, -12.138477, 10.780248 }, + { 0.300400, 0.112814, 12.520756, 0.168653, 5.173237 }, + 0.672146 }, + { "Fe2+", { 11.776765, 11.165097, 3.533495, 0.165345, 7.036932 }, + { 4.912232, 0.001748, 14.166556, 42.381958, 0.341324 }, + -9.676919 }, + { "Fe3+", { 9.721638, 63.403847, 2.141347, 2.629274, 7.033846 }, + { 4.869297, 0.000293, 4.867602, 13.539076, 0.338520 }, + -61.930725 }, + { "Co2+", { 6.993840, 26.285812, 12.254289, 0.246114, 4.017407 }, + { 0.310779, 0.000684, 4.400528, 35.741447, 12.536393 }, + -24.796852 }, + { "Co3+", { 6.861739, 2.678570, 12.281889, 3.501741, -0.179384 }, + { 0.309794, 0.008142, 4.331703, 11.914167, 11.914167 }, + -1.147345 }, + { "Ni2+", { 12.519017, 37.832058, 4.387257, 0.661552, 6.949072 }, + { 3.933053, 0.000442, 10.449184, 23.860998, 0.283723 }, + -36.344471 }, + { "Ni3+", { 13.579366, 1.902844, 12.859268, 3.811005, -6.838595 }, + { 0.313140, 0.012621, 3.906407, 10.894311, 0.344379 }, + -0.317618 }, + { "Cu1+", { 12.960763, 16.342150, 1.110102, 5.520682, 6.915452 }, + { 3.576010, 0.000975, 29.523218, 10.114283, 0.261326 }, + -14.849320 }, + { "Cu2+", { 11.895569, 16.344978, 5.799817, 1.048804, 6.789088 }, + { 3.378519, 0.000924, 8.133653, 20.526524, 0.254741 }, + -14.878383 }, + { "Zn2+", { 13.340772, 10.428857, 5.544489, 0.762295, 6.869172 }, + { 3.215913, 0.001413, 8.542680, 21.891756, 0.239215 }, + -8.945248 }, + { "Ga3+", { 13.123875, 35.288189, 6.126979, 0.611551, 6.724807 }, + { 2.809960, 0.000323, 6.831534, 16.784311, 0.212002 }, + -33.875122 }, + { "Ge4+", { 6.876636, 6.779091, 9.969591, 3.135857, 0.152389 }, + { 2.025174, 0.176650, 3.573822, 7.685848, 16.677574 }, + 1.086542 }, + { "Br1-", { 17.714310, 6.466926, 6.947385, 4.402674, -0.697279 }, + { 2.122554, 19.050768, 0.152708, 58.690361, 58.690372 }, + 1.152674 }, + { "Rb1+", { 17.684320, 7.761588, 6.680874, 2.668883, 0.070974 }, + { 1.710209, 14.919863, 0.128542, 31.654478, 0.128543 }, + 1.133263 }, + { "Sr2+", { 17.694973, 1.275762, 6.154252, 9.234786, 0.515995 }, + { 1.550888, 30.133041, 0.118774, 13.821799, 0.118774 }, + 1.125309 }, + { "Y3+", { 46.660366, 10.369686, 4.623042, -62.170834, 17.471146 }, + { -0.019971, 13.180257, 0.176398, -0.016727, 1.467348 }, + 19.023842 }, + { "Zr4+", { 6.802956, 17.699253, 10.650647, -0.248108, 0.250338 }, + { 0.096228, 1.296127, 11.240715, -0.219259, -0.219021 }, + 0.827902 }, + { "Nb3+", { 17.714323, 1.675213, 7.483963, 8.322464, 11.143573 }, + { 1.172419, 30.102791, 0.080255, -0.002983, 10.456687 }, + -8.339573 }, + { "Nb5+", { 17.580206, 7.633277, 10.793497, 0.180884, 67.837921 }, + { 1.165852, 0.078558, 9.507652, 31.621656, -0.000438 }, + -68.024780 }, + { "Mo3+", { 7.447050, 17.778122, 11.886068, 1.997905, 1.789626 }, + { 0.072000, 1.073145, 9.834720, 28.221746, -0.011674 }, + -1.898764 }, + { "Mo5+", { 7.929879, 17.667669, 11.515987, 0.500402, 77.444084 }, + { 0.068856, 1.068064, 9.046229, 26.558945, -0.000473 }, + -78.056595 }, + { "Mo6+", { 34.757683, 9.653037, 6.584769, -18.628115, 2.490594 }, + { 1.301770, 7.123843, 0.094097, 1.617443, 12.335434 }, + 1.141916 }, + { "Ru3+", { 17.894758, 13.579529, 10.729251, 2.474095, 48.227997 }, + { 0.902827, 8.740579, 0.045125, 24.764954, -0.001699 }, + -51.905243 }, + { "Ru4+", { 17.845776, 13.455084, 10.229087, 1.653524, 14.059795 }, + { 0.901070, 8.482392, 0.045972, 23.015272, -0.004889 }, + -17.241762 }, + { "Rh3+", { 17.758621, 14.569813, 5.298320, 2.533579, 0.879753 }, + { 0.841779, 8.319533, 0.069050, 23.709131, 0.069050 }, + 0.960843 }, + { "Rh4+", { 17.716188, 14.446654, 5.185801, 1.703448, 0.989992 }, + { 0.840572, 8.100647, 0.068995, 22.357307, 0.068995 }, + 0.959941 }, + { "Pd2+", { 6.122282, 15.651012, 3.513508, 9.060790, 8.771199 }, + { 0.062424, 8.018296, 24.784275, 0.776457, 0.776457 }, + 0.879336 }, + { "Pd4+", { 6.152421, -96.069023, 31.622141, 81.578255, 17.801403 }, + { 0.063951, 11.090354, 13.466152, 9.758302, 0.783014 }, + 0.915874 }, + { "Ag1+", { 6.091192, 4.019526, 16.948174, 4.258638, 13.889437 }, + { 0.056305, 0.719340, 7.758938, 27.368349, 0.719340 }, + 0.785127 }, + { "Ag2+", { 6.401808, 48.699802, 4.799859, -32.332523, 16.356710 }, + { 0.068167, 0.942270, 20.639496, 1.100365, 6.883131 }, + 1.068247 }, + { "Cd2+", { 6.093711, 43.909691, 17.041306, -39.675117, 17.958918 }, + { 0.050624, 8.654143, 15.621396, 11.082067, 0.667591 }, + 0.664795 }, + { "In3+", { 6.206277, 18.497746, 3.078131, 10.524613, 7.401234 }, + { 0.041357, 6.605563, 18.792250, 0.608082, 0.608082 }, + 0.293677 }, + { "Sn2+", { 6.353672, 4.770377, 14.672025, 4.235959, 18.002131 }, + { 0.034720, 6.167891, 6.167879, 29.006456, 0.561774 }, + -0.042519 }, + { "Sn4+", { 15.445732, 6.420892, 4.562980, 1.713385, 18.033537 }, + { 6.280898, 0.033144, 6.280899, 17.983601, 0.557980 }, + -0.172219 }, + { "Sb3+", { 10.189171, 57.461918, 19.356573, 4.862206, -45.394096 }, + { 0.089485, 0.375256, 5.357987, 22.153736, 0.297768 }, + 1.516108 }, + { "Sb5+", { 17.920622, 6.647932, 12.724075, 1.555545, 7.600591 }, + { 0.522315, 0.029487, 5.718210, 16.433775, 5.718204 }, + -0.445371 }, + { "I1-", { 20.010330, 17.835524, 8.104130, 2.231118, 9.158548 }, + { 4.565931, 0.444266, 32.430672, 95.149040, 0.014906 }, + -3.341004 }, + { "Cs1+", { 19.939056, 24.967621, 10.375884, 0.454243, 17.660248 }, + { 3.770511, 0.004040, 25.311275, 76.537766, 0.384730 }, + -19.394306 }, + { "Ba2+", { 19.750200, 17.513683, 10.884892, 0.321585, 65.149834 }, + { 3.430748, 0.361590, 21.358307, 70.309402, 0.001418 }, + -59.618172 }, + { "La3+", { 19.688887, 17.345703, 11.356296, 0.099418, 82.358124 }, + { 3.146211, 0.339586, 18.753832, 90.345459, 0.001072 }, + -76.846909 }, + { "Ce3+", { 26.593231, 85.866432, -6.677695, 12.111847, 17.401903 }, + { 3.280381, 0.001012, 4.313575, 17.868504, 0.326962 }, + -80.313423 }, + { "Ce4+", { 17.457533, 25.659941, 11.691037, 19.695251, -16.994749 }, + { 0.311812, -0.003793, 16.568687, 2.886395, -0.008931 }, + -3.515096 }, + { "Pr3+", { 20.879841, 36.035797, 12.135341, 0.283103, 17.167803 }, + { 2.870897, 0.002364, 16.615236, 53.909359, 0.306993 }, + -30.500784 }, + { "Pr4+", { 17.496082, 21.538509, 20.403114, 12.062211, -7.492043 }, + { 0.294457, -0.002742, 2.772886, 15.804613, -0.013556 }, + -9.016722 }, + { "Nd3+", { 17.120077, 56.038139, 21.468307, 10.000671, 2.905866 }, + { 0.291295, 0.001421, 2.743681, 14.581367, 22.485098 }, + -50.541992 }, + { "Pm3+", { 22.221066, 17.068142, 12.805423, 0.435687, 52.238770 }, + { 2.635767, 0.277039, 14.927315, 45.768017, 0.001455 }, + -46.767181 }, + { "Sm3+", { 15.618565, 19.538092, 13.398946, -4.358811, 24.490461 }, + { 0.006001, 0.306379, 14.979594, 0.748825, 2.454492 }, + -9.714854 }, + { "Eu2+", { 23.899035, 31.657497, 12.955752, 1.700576, 16.992199 }, + { 2.467332, 0.002230, 13.625002, 35.089481, 0.253136 }, + -26.204315 }, + { "Eu3+", { 17.758327, 33.498665, 24.067188, 13.436883, -9.019134 }, + { 0.244474, -0.003901, 2.487526, 14.568011, -0.015628 }, + -19.768026 }, + { "Gd3+", { 24.344999, 16.945311, 13.866931, 0.481674, 93.506378 }, + { 2.333971, 0.239215, 12.982995, 43.876347, 0.000673 }, + -88.147179 }, + { "Tb3+", { 24.878252, 16.856016, 13.663937, 1.279671, 39.271294 }, + { 2.223301, 0.227290, 11.812528, 29.910065, 0.001527 }, + -33.950317 }, + { "Dy3+", { 16.864344, 90.383461, 13.675473, 1.687078, 25.540651 }, + { 0.216275, 0.000593, 11.121207, 26.250975, 2.135930 }, + -85.150650 }, + { "Ho3+", { 16.837524, 63.221336, 13.703766, 2.061602, 26.202621 }, + { 0.206873, 0.000796, 10.500283, 24.031883, 2.055060 }, + -58.026505 }, + { "Er3+", { 16.810127, 22.681061, 13.864114, 2.294506, 26.864477 }, + { 0.198293, 0.002126, 9.973341, 22.836388, 1.979442 }, + -17.513460 }, + { "Tm3+", { 16.787500, 15.350905, 14.182357, 2.299111, 27.573771 }, + { 0.190852, 0.003036, 9.602934, 22.526880, 1.912862 }, + -10.192087 }, + { "Yb2+", { 28.443794, 16.849527, 14.165081, 3.445311, 28.308853 }, + { 1.863896, 0.183811, 9.225469, 23.691355, 0.001463 }, + -23.214935 }, + { "Yb3+", { 28.191629, 16.828087, 14.167848, 2.744962, 23.171774 }, + { 1.842889, 0.182788, 9.045957, 20.799847, 0.001759 }, + -18.103676 }, + { "Lu3+", { 28.828693, 16.823227, 14.247617, 3.079559, 25.647667 }, + { 1.776641, 0.175560, 8.575531, 19.693701, 0.001453 }, + -20.626528 }, + { "Hf4+", { 29.267378, 16.792543, 14.785310, 2.184128, 23.791996 }, + { 1.697911, 0.168313, 8.190025, 18.277578, 0.001431 }, + -18.820383 }, + { "Ta5+", { 29.539469, 16.741854, 15.182070, 1.642916, 16.437447 }, + { 1.612934, 0.160460, 7.654408, 17.070732, 0.001858 }, + -11.542459 }, + { "W6+", { 29.729357, 17.247808, 15.184488, 1.154652, 0.739335 }, + { 1.501648, 0.140803, 6.880573, 14.299601, 14.299618 }, + 3.945157 }, + { "Os4+", { 17.113485, 15.792370, 23.342392, 4.090271, 7.671292 }, + { 0.131850, 7.288542, 1.389307, 19.629425, 1.389307 }, + 3.988390 }, + { "Ir3+", { 31.537575, 16.363338, 15.597141, 5.051404, 1.436935 }, + { 1.334144, 7.451918, 0.127514, 21.705648, 0.127515 }, + 4.009459 }, + { "Ir4+", { 30.391249, 16.146996, 17.019068, 4.458904, 0.975372 }, + { 1.328519, 7.181766, 0.127337, 19.060146, 1.328519 }, + 4.006865 }, + { "Pt2+", { 31.986849, 17.249048, 15.269374, 5.760234, 1.694079 }, + { 1.281143, 7.625512, 0.123571, 24.190826, 0.123571 }, + 4.032512 }, + { "Pt4+", { 41.932713, 16.339224, 17.653894, 6.012420, -12.036877 }, + { 1.111409, 6.466086, 0.128917, 16.954155, 0.778721 }, + 4.094551 }, + { "Au1+", { 32.124306, 16.716476, 16.814100, 7.311565, 0.993064 }, + { 1.216073, 7.165378, 0.118715, 20.442486, 53.095985 }, + 4.040792 }, + { "Au3+", { 31.704271, 17.545767, 16.819551, 5.522640, 0.361725 }, + { 1.215561, 7.220506, 0.118812, 20.050970, 1.215562 }, + 4.042679 }, + { "Hg1+", { 28.866837, 19.277540, 16.776051, 6.281459, 3.710289 }, + { 1.173967, 7.583842, 0.115351, 29.055994, 1.173968 }, + 4.068430 }, + { "Hg2+", { 32.411079, 18.690371, 16.711773, 9.974835, -3.847611 }, + { 1.162980, 7.329806, 0.114518, 22.009489, 22.009493 }, + 4.052869 }, + { "Tl1+", { 32.295044, 16.570049, 17.991013, 1.535355, 7.554591 }, + { 1.101544, 0.110020, 6.528559, 52.495068, 20.338634 }, + 4.054030 }, + { "Tl3+", { 32.525639, 19.139185, 17.100321, 5.891115, 12.599463 }, + { 1.094966, 6.900992, 0.103667, 18.489614, -0.001401 }, + -9.256075 }, + { "Pb2+", { 27.392647, 16.496822, 19.984501, 6.813923, 5.233910 }, + { 1.058874, 0.106305, 6.708123, 24.395554, 1.058874 }, + 4.065623 }, + { "Pb4+", { 32.505657, 20.014240, 14.645661, 5.029499, 1.760138 }, + { 1.047035, 6.670321, 0.105279, 16.525040, 0.105279 }, + 4.044678 }, + { "Bi3+", { 32.461437, 19.438683, 16.302486, 7.322662, 0.431704 }, + { 0.997930, 6.038867, 0.101338, 18.371586, 46.361046 }, + 4.043703 }, + { "Bi5+", { 16.734028, 20.580494, 9.452623, 61.155834, -34.041023 }, + { 0.105076, 4.773282, 11.762162, 1.211775, 1.619408 }, + 4.113663 }, + { "Ra2+", { 4.986228, 32.474945, 21.947443, 11.800013, 10.807292 }, + { 0.082597, 0.791468, 4.608034, 24.792431, 0.082597 }, + 3.956572 }, + { "Ac3+", { 15.584983, 32.022125, 21.456327, 0.757593, 12.341252 }, + { 0.077438, 0.739963, 4.040735, 47.525002, 19.406845 }, + 3.838984 }, + { "Th4+", { 15.515445, 32.090691, 13.996399, 12.918157, 7.635514 }, + { 0.074499, 0.711663, 3.871044, 18.596891, 3.871044 }, + 3.831122 }, + { "U3+", { 15.360309, 32.395657, 21.961290, 1.325894, 14.251453 }, + { 0.067815, 0.654643, 3.643409, 39.604965, 16.330570 }, + 3.706622 }, + { "U4+", { 15.355091, 32.235306, 0.557745, 14.396367, 21.751173 }, + { 0.067789, 0.652613, 42.354237, 15.908239, 3.553231 }, + 3.705863 }, + { "U6+", { 15.333844, 31.770849, 21.274414, 13.872636, 0.048519 }, + { 0.067644, 0.646384, 3.317894, 14.650250, 75.339699 }, + 3.700591 }, + { "Np3+", { 15.378152, 32.572132, 22.206125, 1.413295, 14.828381 }, + { 0.064613, 0.631420, 3.561936, 37.875511, 15.546129 }, + 3.603370 }, + { "Np4+", { 15.373926, 32.423019, 21.969994, 0.662078, 14.969350 }, + { 0.064597, 0.629658, 3.476389, 39.438942, 15.135764 }, + 3.603039 }, + { "Np6+", { 15.359986, 31.992825, 21.412458, 0.066574, 14.568174 }, + { 0.064528, 0.624505, 3.253441, 67.658318, 13.980832 }, + 3.600942 }, + { "Pu3+", { 15.356004, 32.769127, 22.680210, 1.351055, 15.416232 }, + { 0.060590, 0.604663, 3.491509, 37.260635, 14.981921 }, + 3.428895 }, + { "Pu4+", { 15.416219, 32.610569, 22.256662, 0.719495, 15.518152 }, + { 0.061456, 0.607938, 3.411848, 37.628792, 14.464360 }, + 3.480408 }, + { "Pu6+", { 15.436506, 32.289719, 14.726737, 15.012391, 7.024677 }, + { 0.061815, 0.606541, 3.245363, 13.616438, 3.245364 }, + 3.502325 }, + { 0, { 0., 0., 0., 0., 0. }, + { 0., 0., 0., 0., 0. }, + 0. } +// END_COMPILED_IN_REFERENCE_DATA + }; + + } // namespace + + wk1995::wk1995(std::string const& label, bool exact) + : + base<5>(wk1995_raw_table, "WK1995", label, exact) + {} + + wk1995_iterator::wk1995_iterator() + : + current_("H", true) + {} + + wk1995 + wk1995_iterator::next() + { + wk1995 result = current_; + current_.next_entry(); + return result; + } + +}}} // namespace cctbx::eltbx::xray_scattering diff --git a/extern/cctbx/cctbx/miller/index_generator.cpp b/extern/cctbx/cctbx/miller/index_generator.cpp new file mode 100644 index 00000000..190f236a --- /dev/null +++ b/extern/cctbx/cctbx/miller/index_generator.cpp @@ -0,0 +1,128 @@ +#include +#include + +namespace cctbx { namespace miller { + + void + index_generator::initialize_loop(index<> const& reference_h_max) + { + af::int3 cut = asu_.reference()->cut_parameters(); + index<> reference_h_begin; + index<> reference_h_end; + for(std::size_t i=0;i<3;i++) { + reference_h_begin[i] = reference_h_max[i] * cut[i]; + reference_h_end[i] = reference_h_max[i] + 1; + } + loop_ = af::nested_loop >(reference_h_begin, reference_h_end); + next_is_minus_previous_ = false; + } + + index_generator::index_generator(uctbx::unit_cell const& unit_cell, + sgtbx::space_group_type const& sg_type, + bool anomalous_flag, + double resolution_d_min) + : unit_cell_(unit_cell), + sg_type_(sg_type), + anomalous_flag_(anomalous_flag), + asu_(sg_type) + { + if (resolution_d_min <= 0.) { + throw error("Resolution limit must be greater than zero."); + } + d_star_sq_max_ = 1. / (resolution_d_min * resolution_d_min); + uctbx::unit_cell + reference_unit_cell = unit_cell_.change_basis(sg_type_.cb_op()); + initialize_loop(reference_unit_cell.max_miller_indices(resolution_d_min)); + } + + index_generator::index_generator(sgtbx::space_group_type const& sg_type, + bool anomalous_flag, + index<> const& max_index) + : sg_type_(sg_type), + anomalous_flag_(anomalous_flag), + asu_(sg_type), + d_star_sq_max_(-1.) + { + initialize_loop(index<>(af::absolute(max_index.as_tiny()))); + } + + bool + index_generator::set_phase_info(index<> const& h) + { + phase_info_ = sgtbx::phase_info(sg_type_.group(), h, false); + return phase_info_.is_sys_absent(); + } + + index<> + index_generator::next_under_friedel_symmetry() + { + int r_den = asu_.cb_op().c().r().den(); + for (; loop_.over() == 0;) { + index<> reference_h = loop_(); + loop_.incr(); + if (asu_.reference()->is_inside(reference_h)) { + if (asu_.is_reference()) { + if (d_star_sq_max_ < 0.) { + if (!reference_h.is_zero() && !set_phase_info(reference_h)) { + return reference_h; + } + } + else { + double d_star_sq = unit_cell_.d_star_sq(reference_h); + if (d_star_sq != 0 && d_star_sq <= d_star_sq_max_ + && !set_phase_info(reference_h)) { + return reference_h; + } + } + } + else { + sgtbx::tr_vec hr(reference_h * asu_.cb_op().c().r(), r_den); + hr = hr.cancel(); + if (hr.den() == 1) { + index<> h(hr.num()); + if (d_star_sq_max_ < 0.) { + if (!h.is_zero() && !set_phase_info(h)) { + return h; + } + } + else { + double d_star_sq = unit_cell_.d_star_sq(h); + if (d_star_sq != 0 && d_star_sq <= d_star_sq_max_ + && !set_phase_info(h)) { + return h; + } + } + } + } + } + } + return index<>(0,0,0); + } + + index<> + index_generator::next() + { + if (!anomalous_flag_) return next_under_friedel_symmetry(); + if (next_is_minus_previous_) { + next_is_minus_previous_ = false; + return -previous_; + } + previous_ = next_under_friedel_symmetry(); + if (previous_.is_zero()) return previous_; + next_is_minus_previous_ = !phase_info_.is_centric(); + return previous_; + } + + af::shared > + index_generator::to_array() + { + af::shared > result; + for (;;) { + index<> h = next(); + if (h.is_zero()) break; + result.push_back(h); + } + return result; + } + +}} // namespace cctbx::miller diff --git a/extern/cctbx/cctbx/miller/sym_equiv.cpp b/extern/cctbx/cctbx/miller/sym_equiv.cpp new file mode 100644 index 00000000..483a4266 --- /dev/null +++ b/extern/cctbx/cctbx/miller/sym_equiv.cpp @@ -0,0 +1,103 @@ +#include +#include +#include + +namespace cctbx { namespace miller { + + sym_equiv_indices::sym_equiv_indices( + sgtbx::space_group const& space_group, + index<> const& h_in) + : + t_den_(space_group.t_den()), + order_p_(space_group.order_p()), + ht_restriction_(-1) + { + using namespace sgtbx; + for(std::size_t i_inv=0;i_inv hr = h_in * s.r(); + bool found = false; + for(std::size_t i=0;i= f_mates(false) || i_indices >= indices_.size()) { + throw error_index(); + } + return indices_[i_indices].mate(i_mate); + } + + sym_equiv_indices::index_mate_indices_decomposition + sym_equiv_indices::decompose_index_mate_indices(std::size_t i) const + { + // i = i_mate * indices_.size() + i_indices + if (i >= multiplicity(false)) { + throw error_index(); + } + return index_mate_indices_decomposition(i / indices_.size(), + i % indices_.size()); + } + + sym_equiv_index + sym_equiv_indices::operator()(std::size_t i) const + { + index_mate_indices_decomposition d = decompose_index_mate_indices(i); + return operator()(d.i_mate, d.i_indices); + } + + af::shared + sym_equiv_indices::p1_listing(bool anomalous_flag) const + { + af::shared result; + if (anomalous_flag) { + result.assign(indices_.begin(), indices_.end()); + } + else { + if (is_centric()) result.reserve(indices_.size() / 2); + else result.reserve(indices_.size()); + for(std::size_t i=0;i + +namespace cctbx { namespace sgtbx { + + namespace raw_bricks { + namespace { + + struct entry + { + int sg_number; + const char *hall_symbol; + int points[3][2]; + }; + + static const entry table[] = { +// BEGIN_COMPILED_IN_REFERENCE_DATA +{ 1," P 1",{{0,49},{0,49},{0,49}}}, // P 1 +{ 2,"-P 1",{{0,49},{0,24},{0,49}}}, // P -1 +{ 3," P 2y",{{0,24},{0,49},{0,49}}}, // P 1 2 1 +{ 3," P 2",{{0,49},{0,24},{0,49}}}, // P 1 1 2 +{ 3," P 2x",{{0,49},{0,24},{0,49}}}, // P 2 1 1 +{ 4," P 2yb",{{0,49},{0,25},{0,49}}}, // P 1 21 1 +{ 4," P 2c",{{0,49},{0,24},{0,49}}}, // P 1 1 21 +{ 4," P 2xa",{{0,49},{0,24},{0,49}}}, // P 21 1 1 +{ 5," C 2y",{{0,24},{0,25},{0,49}}}, // C 1 2 1 +{ 5," C 2y (x-y,x+y,z)",{{0,49},{0,49},{0,24}}}, +{ 5," A 2y",{{0,24},{0,25},{0,49}}}, // A 1 2 1 +{ 5," C 2y (z,x-y,x+y)",{{0,24},{0,49},{0,49}}}, +{ 5," I 2y",{{0,24},{0,25},{0,49}}}, // I 1 2 1 +{ 5," C 2y (-x+y,z,x+y+z)",{{0,49},{0,24},{0,49}}}, +{ 5," A 2",{{0,49},{0,12},{0,49}}}, // A 1 1 2 +{ 5," C 2y (z,x+y,-x+y)",{{0,24},{0,49},{0,49}}}, +{ 5," B 2",{{0,25},{0,24},{0,49}}}, // B 1 1 2 +{ 5," C 2y (-x+y,z,x+y)",{{0,49},{0,24},{0,49}}}, +{ 5," I 2",{{0,49},{0,12},{0,49}}}, // I 1 1 2 +{ 5," C 2y (x+y,-x+y+z,z)",{{0,49},{0,49},{0,24}}}, +{ 5," B 2x",{{0,25},{0,24},{0,49}}}, // B 2 1 1 +{ 5," C 2y (x+y,z,x-y)",{{0,49},{0,24},{0,49}}}, +{ 5," C 2x",{{0,49},{0,12},{0,49}}}, // C 2 1 1 +{ 5," C 2y (x+y,-x+y,z)",{{0,49},{0,49},{0,24}}}, +{ 5," I 2x",{{0,49},{0,12},{0,49}}}, // I 2 1 1 +{ 5," C 2y (z,x+y,-x+y+z)",{{0,24},{0,49},{0,49}}}, +{ 6," P -2y",{{0,49},{0,24},{0,49}}}, // P 1 m 1 +{ 6," P -2",{{0,49},{0,49},{0,24}}}, // P 1 1 m +{ 6," P -2x",{{0,24},{0,49},{0,49}}}, // P m 1 1 +{ 7," P -2yc",{{0,49},{0,24},{0,49}}}, // P 1 c 1 +{ 7," P -2yac",{{0,49},{0,24},{0,49}}}, // P 1 n 1 +{ 7," P -2ya",{{0,49},{0,24},{0,49}}}, // P 1 a 1 +{ 7," P -2a",{{0,25},{0,49},{0,49}}}, // P 1 1 a +{ 7," P -2ab",{{0,49},{0,25},{0,49}}}, // P 1 1 n +{ 7," P -2b",{{0,49},{0,25},{0,49}}}, // P 1 1 b +{ 7," P -2xb",{{0,49},{0,25},{0,49}}}, // P b 1 1 +{ 7," P -2xbc",{{0,49},{0,25},{0,49}}}, // P n 1 1 +{ 7," P -2xc",{{0,24},{0,49},{0,49}}}, // P c 1 1 +{ 8," C -2y",{{0,49},{0,12},{0,49}}}, // C 1 m 1 +{ 8," C -2y (x-y,x+y,z)",{{0,49},{0,49},{0,49}}}, +{ 8," A -2y",{{0,49},{0,12},{0,49}}}, // A 1 m 1 +{ 8," C -2y (z,x-y,x+y)",{{0,49},{0,49},{0,49}}}, +{ 8," I -2y",{{0,49},{0,12},{0,49}}}, // I 1 m 1 +{ 8," C -2y (-x+y,z,x+y+z)",{{0,49},{0,49},{0,49}}}, +{ 8," A -2",{{0,49},{0,25},{0,24}}}, // A 1 1 m +{ 8," C -2y (z,x+y,-x+y)",{{0,49},{0,49},{0,49}}}, +{ 8," B -2",{{0,25},{0,49},{0,24}}}, // B 1 1 m +{ 8," C -2y (-x+y,z,x+y)",{{0,49},{0,49},{0,49}}}, +{ 8," I -2",{{0,49},{0,25},{0,24}}}, // I 1 1 m +{ 8," C -2y (x+y,-x+y+z,z)",{{0,49},{0,49},{0,49}}}, +{ 8," B -2x",{{0,12},{0,49},{0,49}}}, // B m 1 1 +{ 8," C -2y (x+y,z,x-y)",{{0,49},{0,49},{0,49}}}, +{ 8," C -2x",{{0,24},{0,25},{0,49}}}, // C m 1 1 +{ 8," C -2y (x+y,-x+y,z)",{{0,49},{0,49},{0,49}}}, +{ 8," I -2x",{{0,24},{0,25},{0,49}}}, // I m 1 1 +{ 8," C -2y (z,x+y,-x+y+z)",{{0,49},{0,49},{0,49}}}, +{ 9," C -2yc",{{0,49},{0,12},{0,49}}}, // C 1 c 1 +{ 9," C -2yc (x-y,x+y,z)",{{0,49},{0,49},{0,25}}}, +{ 9," A -2yab",{{0,49},{0,12},{0,49}}}, // A 1 n 1 +{ 9," C -2yc (z,x-y+z,x+y+z)",{{0,25},{0,49},{0,49}}}, +{ 9," I -2ya",{{0,49},{0,12},{0,49}}}, // I 1 a 1 +{ 9," C -2yc (-x+y,z,x+y+z)",{{0,49},{0,25},{0,49}}}, +{ 9," A -2ya",{{0,49},{0,12},{0,49}}}, // A 1 a 1 +{ 9," C -2yc (z,x-y,x+y)",{{0,25},{0,49},{0,49}}}, +{ 9," C -2yac",{{0,49},{0,12},{0,49}}}, // C 1 n 1 +{ 9," C -2yc (x-y+z,x+y+z,z)",{{0,49},{0,49},{0,25}}}, +{ 9," I -2yc",{{0,49},{0,12},{0,49}}}, // I 1 c 1 +{ 9," C -2yc (-x+y+z,z,x+y)",{{0,49},{0,25},{0,49}}}, +{ 9," A -2a",{{0,25},{0,25},{0,49}}}, // A 1 1 a +{ 9," C -2yc (z,x+y,-x+y)",{{0,25},{0,49},{0,49}}}, +{ 9," B -2ab",{{0,25},{0,25},{0,49}}}, // B 1 1 n +{ 9," C -2yc (-x+y-z,z,x+y+z)",{{0,49},{0,25},{0,49}}}, +{ 9," I -2b",{{0,25},{0,25},{0,49}}}, // I 1 1 b +{ 9," C -2yc (x+y+z,-x+y,z)",{{0,49},{0,49},{0,25}}}, +{ 9," B -2b",{{0,25},{0,25},{0,49}}}, // B 1 1 b +{ 9," C -2yc (-x+y,z,x+y)",{{0,49},{0,25},{0,49}}}, +{ 9," A -2ab",{{0,25},{0,25},{0,49}}}, // A 1 1 n +{ 9," C -2yc (z,x+y-z,-x+y+z)",{{0,25},{0,49},{0,49}}}, +{ 9," I -2a",{{0,25},{0,25},{0,49}}}, // I 1 1 a +{ 9," C -2yc (x+y,-x+y+z,z)",{{0,49},{0,49},{0,25}}}, +{ 9," B -2xb",{{0,25},{0,25},{0,49}}}, // B b 1 1 +{ 9," C -2yc (x+y,z,x-y)",{{0,49},{0,25},{0,49}}}, +{ 9," C -2xac",{{0,12},{0,49},{0,49}}}, // C n 1 1 +{ 9," C -2yc (x+y-z,-x+y+z,z)",{{0,49},{0,49},{0,25}}}, +{ 9," I -2xc",{{0,24},{0,25},{0,49}}}, // I c 1 1 +{ 9," C -2yc (z,x+y+z,-x+y)",{{0,25},{0,49},{0,49}}}, +{ 9," C -2xc",{{0,24},{0,25},{0,49}}}, // C c 1 1 +{ 9," C -2yc (x+y,-x+y,z)",{{0,49},{0,49},{0,25}}}, +{ 9," B -2xab",{{0,25},{0,25},{0,49}}}, // B n 1 1 +{ 9," C -2yc (x+y+z,z,x-y+z)",{{0,49},{0,25},{0,49}}}, +{ 9," I -2xb",{{0,12},{0,49},{0,49}}}, // I b 1 1 +{ 9," C -2yc (z,x+y,-x+y+z)",{{0,25},{0,49},{0,49}}}, +{ 10,"-P 2y",{{0,24},{0,24},{0,49}}}, // P 1 2/m 1 +{ 10,"-P 2",{{0,49},{0,24},{0,24}}}, // P 1 1 2/m +{ 10,"-P 2x",{{0,24},{0,24},{0,49}}}, // P 2/m 1 1 +{ 11,"-P 2yb",{{0,49},{0,12},{0,49}}}, // P 1 21/m 1 +{ 11,"-P 2c",{{0,49},{0,24},{12,36}}}, // P 1 1 21/m +{ 11,"-P 2xa",{{0,12},{0,49},{0,49}}}, // P 21/m 1 1 +{ 12,"-C 2y",{{0,24},{0,12},{0,49}}}, // C 1 2/m 1 +{ 12,"-C 2y (x-y,x+y,z)",{{0,49},{0,24},{0,49}}}, +{ 12,"-A 2y",{{0,24},{0,12},{0,49}}}, // A 1 2/m 1 +{ 12,"-C 2y (z,x-y,x+y)",{{0,49},{0,24},{0,49}}}, +{ 12,"-I 2y",{{0,24},{0,12},{0,49}}}, // I 1 2/m 1 +{ 12,"-C 2y (-x+y,z,x+y+z)",{{0,49},{0,24},{0,49}}}, +{ 12,"-A 2",{{0,49},{0,12},{0,24}}}, // A 1 1 2/m +{ 12,"-C 2y (z,x+y,-x+y)",{{0,49},{0,24},{0,49}}}, +{ 12,"-B 2",{{0,25},{0,24},{0,24}}}, // B 1 1 2/m +{ 12,"-C 2y (-x+y,z,x+y)",{{0,49},{0,24},{0,49}}}, +{ 12,"-I 2",{{0,49},{0,12},{0,24}}}, // I 1 1 2/m +{ 12,"-C 2y (x+y,-x+y+z,z)",{{0,49},{0,24},{0,49}}}, +{ 12,"-B 2x",{{0,12},{0,24},{0,49}}}, // B 2/m 1 1 +{ 12,"-C 2y (x+y,z,x-y)",{{0,49},{0,24},{0,49}}}, +{ 12,"-C 2x",{{0,24},{0,12},{0,49}}}, // C 2/m 1 1 +{ 12,"-C 2y (x+y,-x+y,z)",{{0,49},{0,24},{0,49}}}, +{ 12,"-I 2x",{{0,24},{0,12},{0,49}}}, // I 2/m 1 1 +{ 12,"-C 2y (z,x+y,-x+y+z)",{{0,49},{0,24},{0,49}}}, +{ 13,"-P 2yc",{{0,24},{0,24},{0,49}}}, // P 1 2/c 1 +{ 13,"-P 2yac",{{0,12},{0,49},{0,49}}}, // P 1 2/n 1 +{ 13,"-P 2ya",{{0,12},{0,49},{0,49}}}, // P 1 2/a 1 +{ 13,"-P 2a",{{0,25},{0,24},{0,49}}}, // P 1 1 2/a +{ 13,"-P 2ab",{{0,49},{0,12},{0,49}}}, // P 1 1 2/n +{ 13,"-P 2b",{{0,49},{0,12},{0,49}}}, // P 1 1 2/b +{ 13,"-P 2xb",{{0,49},{0,12},{0,49}}}, // P 2/b 1 1 +{ 13,"-P 2xbc",{{0,49},{0,12},{0,49}}}, // P 2/n 1 1 +{ 13,"-P 2xc",{{0,24},{0,24},{0,49}}}, // P 2/c 1 1 +{ 14,"-P 2ybc",{{0,49},{0,12},{0,49}}}, // P 1 21/c 1 +{ 14,"-P 2yn",{{0,49},{0,12},{0,49}}}, // P 1 21/n 1 +{ 14,"-P 2yab",{{0,49},{0,12},{0,49}}}, // P 1 21/a 1 +{ 14,"-P 2ac",{{0,25},{0,24},{0,49}}}, // P 1 1 21/a +{ 14,"-P 2n",{{0,49},{0,12},{0,49}}}, // P 1 1 21/n +{ 14,"-P 2bc",{{0,49},{0,12},{0,49}}}, // P 1 1 21/b +{ 14,"-P 2xab",{{0,49},{0,12},{0,49}}}, // P 21/b 1 1 +{ 14,"-P 2xn",{{0,49},{0,12},{0,49}}}, // P 21/n 1 1 +{ 14,"-P 2xac",{{0,12},{0,49},{0,49}}}, // P 21/c 1 1 +{ 15,"-C 2yc",{{0,24},{0,12},{0,49}}}, // C 1 2/c 1 +{ 15,"-C 2yc (x-y,x+y,z)",{{0,49},{0,24},{12,36}}}, +{ 15,"-A 2yab",{{0,12},{0,25},{0,49}}}, // A 1 2/n 1 +{ 15,"-C 2yc (z,x-y+z,x+y+z)",{{0,12},{0,49},{0,49}}}, +{ 15,"-I 2ya",{{0,12},{12,36},{0,49}}}, // I 1 2/a 1 +{ 15,"-C 2yc (-x+y,z,x+y+z)",{{0,49},{0,12},{0,49}}}, +{ 15,"-A 2ya",{{0,12},{0,25},{0,49}}}, // A 1 2/a 1 +{ 15,"-C 2yc (z,x-y,x+y)",{{0,12},{0,49},{0,49}}}, +{ 15,"-C 2yac",{{0,12},{12,36},{0,49}}}, // C 1 2/n 1 +{ 15,"-C 2yc (x-y+z,x+y+z,z)",{{0,49},{0,24},{12,36}}}, +{ 15,"-I 2yc",{{0,24},{0,12},{0,49}}}, // I 1 2/c 1 +{ 15,"-C 2yc (-x+y+z,z,x+y)",{{0,49},{0,12},{0,49}}}, +{ 15,"-A 2a",{{0,25},{0,12},{0,49}}}, // A 1 1 2/a +{ 15,"-C 2yc (z,x+y,-x+y)",{{0,12},{0,49},{0,49}}}, +{ 15,"-B 2ab",{{0,25},{0,12},{0,49}}}, // B 1 1 2/n +{ 15,"-C 2yc (-x+y-z,z,x+y+z)",{{0,49},{0,12},{0,49}}}, +{ 15,"-I 2b",{{0,25},{0,12},{0,49}}}, // I 1 1 2/b +{ 15,"-C 2yc (x+y+z,-x+y,z)",{{0,24},{-8,41},{-12,12}}}, +{ 15,"-B 2b",{{0,25},{0,12},{0,49}}}, // B 1 1 2/b +{ 15,"-C 2yc (-x+y,z,x+y)",{{0,49},{0,12},{0,49}}}, +{ 15,"-A 2ab",{{0,25},{0,12},{0,49}}}, // A 1 1 2/n +{ 15,"-C 2yc (z,x+y-z,-x+y+z)",{{0,12},{0,49},{0,49}}}, +{ 15,"-I 2a",{{0,25},{0,12},{0,49}}}, // I 1 1 2/a +{ 15,"-C 2yc (x+y,-x+y+z,z)",{{0,24},{-8,41},{-12,12}}}, +{ 15,"-B 2xb",{{0,25},{0,12},{0,49}}}, // B 2/b 1 1 +{ 15,"-C 2yc (x+y,z,x-y)",{{0,49},{0,12},{0,49}}}, +{ 15,"-C 2xac",{{0,12},{12,36},{0,49}}}, // C 2/n 1 1 +{ 15,"-C 2yc (x+y-z,-x+y+z,z)",{{-8,41},{0,24},{12,36}}}, +{ 15,"-I 2xc",{{0,24},{0,12},{0,49}}}, // I 2/c 1 1 +{ 15,"-C 2yc (z,x+y+z,-x+y)",{{0,12},{0,49},{0,49}}}, +{ 15,"-C 2xc",{{0,24},{0,12},{0,49}}}, // C 2/c 1 1 +{ 15,"-C 2yc (x+y,-x+y,z)",{{-8,41},{0,24},{12,36}}}, +{ 15,"-B 2xab",{{0,25},{0,12},{0,49}}}, // B 2/n 1 1 +{ 15,"-C 2yc (x+y+z,z,x-y+z)",{{0,49},{0,12},{0,49}}}, +{ 15,"-I 2xb",{{12,36},{0,12},{0,49}}}, // I 2/b 1 1 +{ 15,"-C 2yc (z,x+y,-x+y+z)",{{0,12},{0,49},{0,49}}}, +{ 16," P 2 2",{{0,24},{0,24},{0,49}}}, // P 2 2 2 +{ 17," P 2c 2",{{0,24},{0,24},{0,49}}}, // P 2 2 21 +{ 17," P 2a 2a",{{0,24},{0,24},{0,49}}}, // P 21 2 2 +{ 17," P 2 2b",{{0,49},{0,12},{0,49}}}, // P 2 21 2 +{ 18," P 2 2ab",{{0,49},{0,12},{0,49}}}, // P 21 21 2 +{ 18," P 2bc 2",{{0,49},{0,12},{0,49}}}, // P 2 21 21 +{ 18," P 2ac 2ac",{{0,24},{0,24},{0,49}}}, // P 21 2 21 +{ 19," P 2ac 2ab",{{0,49},{0,12},{0,49}}}, // P 21 21 21 +{ 20," C 2c 2",{{0,24},{0,12},{0,49}}}, // C 2 2 21 +{ 20," C 2c 2 (x-y,x+y,z)",{{0,49},{0,49},{0,12}}}, +{ 20," A 2a 2a",{{0,24},{0,12},{0,49}}}, // A 21 2 2 +{ 20," C 2c 2 (z,x+y,-x+y)",{{0,12},{0,49},{0,49}}}, +{ 20," B 2 2b",{{0,25},{0,12},{0,49}}}, // B 2 21 2 +{ 20," C 2c 2 (x+y,z,x-y)",{{0,49},{0,12},{0,49}}}, +{ 21," C 2 2",{{0,24},{0,12},{0,49}}}, // C 2 2 2 +{ 21," C 2 2 (x-y,x+y,z)",{{0,49},{0,24},{0,24}}}, +{ 21," A 2 2",{{0,24},{0,12},{0,49}}}, // A 2 2 2 +{ 21," C 2 2 (z,x-y,x+y)",{{0,24},{0,24},{0,49}}}, +{ 21," B 2 2",{{0,12},{0,24},{0,49}}}, // B 2 2 2 +{ 21," C 2 2 (-x+y,z,x+y)",{{0,24},{0,24},{0,49}}}, +{ 22," F 2 2",{{0,12},{0,12},{0,49}}}, // F 2 2 2 +{ 22," F 2 2 (-x+y+z,x-y+z,x+y-z)",{{-12,24},{12,48},{-4,45}}}, +{ 23," I 2 2",{{0,24},{0,12},{0,49}}}, // I 2 2 2 +{ 23," I 2 2 (y+z,x+z,x+y)",{{0,36},{0,36},{0,37}}}, +{ 24," I 2b 2c",{{0,12},{0,24},{0,49}}}, // I 21 21 21 +{ 24," I 2b 2c (y+z,x+z,x+y)",{{-6,43},{-12,12},{-6,43}}}, +{ 25," P 2 -2",{{0,24},{0,24},{0,49}}}, // P m m 2 +{ 25," P -2 2",{{0,49},{0,24},{0,24}}}, // P 2 m m +{ 25," P -2 -2",{{0,24},{0,49},{0,24}}}, // P m 2 m +{ 26," P 2c -2",{{0,24},{0,24},{0,49}}}, // P m c 21 +{ 26," P 2c -2c",{{0,24},{0,24},{0,49}}}, // P c m 21 +{ 26," P -2a 2a",{{0,25},{0,24},{0,49}}}, // P 21 m a +{ 26," P -2 2a",{{0,49},{0,24},{0,24}}}, // P 21 a m +{ 26," P -2 -2b",{{0,49},{0,25},{0,24}}}, // P b 21 m +{ 26," P -2b -2",{{0,24},{0,25},{0,49}}}, // P m 21 b +{ 27," P 2 -2c",{{0,24},{0,24},{0,49}}}, // P c c 2 +{ 27," P -2a 2",{{0,25},{0,24},{0,49}}}, // P 2 a a +{ 27," P -2b -2b",{{0,24},{0,25},{0,49}}}, // P b 2 b +{ 28," P 2 -2a",{{0,12},{0,49},{0,49}}}, // P m a 2 +{ 28," P 2 -2b",{{0,49},{0,12},{0,49}}}, // P b m 2 +{ 28," P -2b 2",{{0,49},{0,12},{0,49}}}, // P 2 m b +{ 28," P -2c 2",{{0,49},{0,24},{12,36}}}, // P 2 c m +{ 28," P -2c -2c",{{0,24},{0,49},{12,36}}}, // P c 2 m +{ 28," P -2a -2a",{{0,12},{0,49},{0,49}}}, // P m 2 a +{ 29," P 2c -2ac",{{0,12},{0,49},{0,49}}}, // P c a 21 +{ 29," P 2c -2b",{{0,49},{0,12},{0,49}}}, // P b c 21 +{ 29," P -2b 2a",{{0,49},{0,12},{0,49}}}, // P 21 a b +{ 29," P -2ac 2a",{{0,25},{0,24},{0,49}}}, // P 21 c a +{ 29," P -2bc -2c",{{0,24},{0,25},{0,49}}}, // P c 21 b +{ 29," P -2a -2ab",{{0,25},{0,25},{0,49}}}, // P b 21 a +{ 30," P 2 -2bc",{{0,49},{0,12},{0,49}}}, // P n c 2 +{ 30," P 2 -2ac",{{0,12},{0,49},{0,49}}}, // P c n 2 +{ 30," P -2ac 2",{{0,25},{0,24},{0,49}}}, // P 2 n a +{ 30," P -2ab 2",{{0,49},{0,12},{0,49}}}, // P 2 a n +{ 30," P -2ab -2ab",{{0,24},{0,25},{0,49}}}, // P b 2 n +{ 30," P -2bc -2bc",{{0,24},{0,25},{0,49}}}, // P n 2 b +{ 31," P 2ac -2",{{0,24},{0,24},{0,49}}}, // P m n 21 +{ 31," P 2bc -2bc",{{0,49},{0,12},{0,49}}}, // P n m 21 +{ 31," P -2ab 2ab",{{0,49},{0,12},{0,49}}}, // P 21 m n +{ 31," P -2 2ac",{{0,49},{0,24},{0,24}}}, // P 21 n m +{ 31," P -2 -2bc",{{0,49},{0,25},{0,24}}}, // P n 21 m +{ 31," P -2ab -2",{{0,24},{0,25},{0,49}}}, // P m 21 n +{ 32," P 2 -2ab",{{0,49},{0,12},{0,49}}}, // P b a 2 +{ 32," P -2bc 2",{{0,49},{0,12},{0,49}}}, // P 2 c b +{ 32," P -2ac -2ac",{{0,12},{0,49},{0,49}}}, // P c 2 a +{ 33," P 2c -2n",{{0,49},{0,12},{0,49}}}, // P n a 21 +{ 33," P 2c -2ab",{{0,49},{0,12},{0,49}}}, // P b n 21 +{ 33," P -2bc 2a",{{0,49},{0,12},{0,49}}}, // P 21 n b +{ 33," P -2n 2a",{{0,49},{0,12},{0,49}}}, // P 21 c n +{ 33," P -2n -2ac",{{0,12},{0,49},{0,49}}}, // P c 21 n +{ 33," P -2ac -2n",{{0,25},{0,25},{0,49}}}, // P n 21 a +{ 34," P 2 -2n",{{0,49},{0,12},{0,49}}}, // P n n 2 +{ 34," P -2n 2",{{0,49},{0,12},{0,49}}}, // P 2 n n +{ 34," P -2n -2n",{{0,24},{0,25},{0,49}}}, // P n 2 n +{ 35," C 2 -2",{{0,24},{0,12},{0,49}}}, // C m m 2 +{ 35," C 2 -2 (x-y,x+y,z)",{{0,49},{0,24},{0,49}}}, +{ 35," A -2 2",{{0,49},{0,12},{0,24}}}, // A 2 m m +{ 35," C 2 -2 (z,x-y,x+y)",{{0,49},{0,24},{0,49}}}, +{ 35," B -2 -2",{{0,12},{0,49},{0,24}}}, // B m 2 m +{ 35," C 2 -2 (-x+y,z,x+y)",{{0,24},{0,49},{0,49}}}, +{ 36," C 2c -2",{{0,24},{0,12},{0,49}}}, // C m c 21 +{ 36," C 2c -2 (x-y,x+y,z)",{{0,49},{0,24},{0,49}}}, +{ 36," C 2c -2c",{{0,24},{0,12},{0,49}}}, // C c m 21 +{ 36," C 2c -2 (x+y,-x+y,z)",{{0,49},{0,24},{0,49}}}, +{ 36," A -2a 2a",{{0,25},{0,12},{0,49}}}, // A 21 m a +{ 36," C 2c -2 (z,x+y,-x+y)",{{0,49},{0,24},{0,49}}}, +{ 36," A -2 2a",{{0,49},{0,12},{0,24}}}, // A 21 a m +{ 36," C 2c -2 (z,x-y,x+y)",{{0,49},{0,24},{0,49}}}, +{ 36," B -2 -2b",{{0,25},{0,25},{0,24}}}, // B b 21 m +{ 36," C 2c -2 (x+y,z,x-y)",{{0,49},{0,25},{0,49}}}, +{ 36," B -2b -2",{{0,12},{0,25},{0,49}}}, // B m 21 b +{ 36," C 2c -2 (-x+y,z,x+y)",{{0,49},{0,25},{0,49}}}, +{ 37," C 2 -2c",{{0,24},{0,12},{0,49}}}, // C c c 2 +{ 37," C 2 -2c (x-y,x+y,z)",{{0,49},{0,24},{0,25}}}, +{ 37," A -2a 2",{{0,25},{0,12},{0,49}}}, // A 2 a a +{ 37," C 2 -2c (z,x-y,x+y)",{{0,25},{0,24},{0,49}}}, +{ 37," B -2b -2b",{{0,12},{0,25},{0,49}}}, // B b 2 b +{ 37," C 2 -2c (-x+y,z,x+y)",{{0,24},{0,25},{0,49}}}, +{ 38," A 2 -2",{{0,24},{0,12},{0,49}}}, // A m m 2 +{ 38," A 2 -2 (x,y+z,-y+z)",{{0,24},{0,49},{0,49}}}, +{ 38," B 2 -2",{{0,12},{0,24},{0,49}}}, // B m m 2 +{ 38," A 2 -2 (-y+z,x,y+z)",{{0,49},{0,24},{0,49}}}, +{ 38," B -2 2",{{0,25},{0,24},{0,24}}}, // B 2 m m +{ 38," A 2 -2 (y+z,x,y-z)",{{0,49},{0,24},{0,49}}}, +{ 38," C -2 2",{{0,49},{0,12},{0,24}}}, // C 2 m m +{ 38," A 2 -2 (y+z,-y+z,x)",{{0,49},{0,49},{0,24}}}, +{ 38," C -2 -2",{{0,24},{0,25},{0,24}}}, // C m 2 m +{ 38," A 2 -2 (y-z,y+z,x)",{{0,49},{0,49},{0,24}}}, +{ 38," A -2 -2",{{0,24},{0,25},{0,24}}}, // A m 2 m +{ 38," A 2 -2 (x,y-z,y+z)",{{0,24},{0,49},{0,49}}}, +{ 39," A 2 -2b",{{0,24},{0,12},{0,49}}}, // A b m 2 +{ 39," A 2 -2b (x,y+z,-y+z)",{{0,49},{0,25},{0,49}}}, +{ 39," B 2 -2a",{{0,12},{0,24},{0,49}}}, // B m a 2 +{ 39," A 2 -2b (-y+z,x,y+z)",{{0,49},{0,24},{0,49}}}, +{ 39," B -2a 2",{{0,25},{0,24},{12,36}}}, // B 2 c m +{ 39," A 2 -2b (y+z,x,y-z)",{{0,49},{0,24},{0,49}}}, +{ 39," C -2a 2",{{0,25},{0,12},{0,49}}}, // C 2 m b +{ 39," A 2 -2b (y+z,-y+z,x)",{{0,49},{0,25},{0,49}}}, +{ 39," C -2a -2a",{{0,12},{0,25},{0,49}}}, // C m 2 a +{ 39," A 2 -2b (y-z,y+z,x)",{{0,49},{0,25},{0,49}}}, +{ 39," A -2b -2b",{{0,24},{0,25},{12,36}}}, // A c 2 m +{ 39," A 2 -2b (x,y-z,y+z)",{{0,49},{0,25},{0,49}}}, +{ 40," A 2 -2a",{{0,12},{0,25},{0,49}}}, // A m a 2 +{ 40," A 2 -2a (x,y+z,-y+z)",{{0,12},{0,49},{0,49}}}, +{ 40," B 2 -2b",{{0,25},{0,12},{0,49}}}, // B b m 2 +{ 40," A 2 -2a (-y+z,x,y+z)",{{0,49},{0,12},{0,49}}}, +{ 40," B -2b 2",{{0,25},{0,12},{0,49}}}, // B 2 m b +{ 40," A 2 -2a (y+z,x,y-z)",{{0,49},{0,12},{0,49}}}, +{ 40," C -2c 2",{{0,49},{0,12},{12,36}}}, // C 2 c m +{ 40," A 2 -2a (y+z,-y+z,x)",{{0,49},{0,49},{0,12}}}, +{ 40," C -2c -2c",{{0,24},{0,25},{12,36}}}, // C c 2 m +{ 40," A 2 -2a (y-z,y+z,x)",{{0,49},{0,49},{0,12}}}, +{ 40," A -2a -2a",{{0,12},{0,25},{0,49}}}, // A m 2 a +{ 40," A 2 -2a (x,y-z,y+z)",{{0,12},{0,49},{0,49}}}, +{ 41," A 2 -2ab",{{0,12},{0,25},{0,49}}}, // A b a 2 +{ 41," A 2 -2ab (x,y+z,-y+z)",{{0,24},{0,25},{0,49}}}, +{ 41," B 2 -2ab",{{0,25},{0,12},{0,49}}}, // B b a 2 +{ 41," A 2 -2ab (-y+z,x,y+z)",{{0,49},{0,12},{0,49}}}, +{ 41," B -2ab 2",{{0,25},{0,12},{0,49}}}, // B 2 c b +{ 41," A 2 -2ab (y+z,x,y-z)",{{0,49},{0,12},{0,49}}}, +{ 41," C -2ac 2",{{0,25},{0,12},{0,49}}}, // C 2 c b +{ 41," A 2 -2ab (y+z,-y+z,x)",{{0,49},{0,25},{0,24}}}, +{ 41," C -2ac -2ac",{{0,12},{0,25},{0,49}}}, // C c 2 a +{ 41," A 2 -2ab (y-z,y+z,x)",{{0,49},{0,25},{0,24}}}, +{ 41," A -2ab -2ab",{{0,12},{0,25},{0,49}}}, // A c 2 a +{ 41," A 2 -2ab (x,y-z,y+z)",{{0,24},{0,25},{0,49}}}, +{ 42," F 2 -2",{{0,12},{0,12},{0,49}}}, // F m m 2 +{ 42," F 2 -2 (-x+y+z,x-y+z,x+y-z)",{{0,49},{0,49},{0,49}}}, +{ 42," F -2 2",{{0,25},{0,12},{0,24}}}, // F 2 m m +{ 42," F 2 -2 (x+y-z,-x+y+z,x-y+z)",{{0,49},{0,49},{0,49}}}, +{ 42," F -2 -2",{{0,12},{0,25},{0,24}}}, // F m 2 m +{ 42," F 2 -2 (x-y+z,x+y-z,-x+y+z)",{{0,49},{0,49},{0,49}}}, +{ 43," F 2 -2d",{{0,25},{0,6},{0,49}}}, // F d d 2 +{ 43," F 2 -2d (-x+y+z,x-y+z,x+y-z)",{{-12,25},{12,49},{1,36}}}, +{ 43," F -2d 2",{{0,25},{0,6},{0,49}}}, // F 2 d d +{ 43," F 2 -2d (x+y-z,-x+y+z,x-y+z)",{{0,37},{-13,24},{13,48}}}, +{ 43," F -2d -2d",{{0,12},{0,13},{0,49}}}, // F d 2 d +{ 43," F 2 -2d (x-y+z,x+y-z,-x+y+z)",{{-12,25},{1,36},{12,49}}}, +{ 44," I 2 -2",{{0,24},{0,12},{0,49}}}, // I m m 2 +{ 44," I 2 -2 (y+z,x+z,x+y)",{{0,49},{0,49},{0,24}}}, +{ 44," I -2 2",{{0,49},{0,12},{0,24}}}, // I 2 m m +{ 44," I 2 -2 (x+y,y+z,x+z)",{{0,24},{0,49},{0,49}}}, +{ 44," I -2 -2",{{0,24},{0,25},{0,24}}}, // I m 2 m +{ 44," I 2 -2 (x+z,x+y,y+z)",{{0,49},{0,24},{0,49}}}, +{ 45," I 2 -2c",{{0,24},{0,12},{0,49}}}, // I b a 2 +{ 45," I 2 -2c (y+z,x+z,x+y)",{{0,49},{0,25},{0,49}}}, +{ 45," I -2a 2",{{0,25},{0,12},{0,49}}}, // I 2 c b +{ 45," I 2 -2c (x+y,y+z,x+z)",{{0,49},{0,25},{0,49}}}, +{ 45," I -2b -2b",{{0,12},{0,25},{0,49}}}, // I c 2 a +{ 45," I 2 -2c (x+z,x+y,y+z)",{{0,49},{0,24},{1,49}}}, +{ 46," I 2 -2a",{{0,12},{12,36},{0,49}}}, // I m a 2 +{ 46," I 2 -2a (y+z,x+z,x+y)",{{0,49},{0,25},{0,49}}}, +{ 46," I 2 -2b",{{0,12},{12,36},{0,49}}}, // I b m 2 +{ 46," I 2 -2a (-x+z,y+z,-x+y)",{{0,25},{0,49},{0,49}}}, +{ 46," I -2b 2",{{0,25},{0,12},{0,49}}}, // I 2 m b +{ 46," I 2 -2a (x+y,y+z,x+z)",{{0,24},{0,49},{0,49}}}, +{ 46," I -2c 2",{{0,49},{0,12},{12,36}}}, // I 2 c m +{ 46," I 2 -2a (-x+y,-x+z,y+z)",{{0,49},{0,25},{0,49}}}, +{ 46," I -2c -2c",{{0,24},{0,25},{12,36}}}, // I c 2 m +{ 46," I 2 -2a (x+z,x+y,y+z)",{{0,49},{0,24},{0,49}}}, +{ 46," I -2a -2a",{{0,12},{0,25},{0,49}}}, // I m 2 a +{ 46," I 2 -2a (-y+z,x-y,x+z)",{{0,49},{0,24},{0,49}}}, +{ 47,"-P 2 2",{{0,24},{0,24},{0,24}}}, // P m m m +{ 48," P 2 2 -1n",{{0,24},{0,12},{0,49}}}, // P n n n :1 +{ 48,"-P 2ab 2bc",{{0,12},{12,36},{0,49}}}, // P n n n :2 +{ 49,"-P 2 2c",{{0,24},{0,24},{0,24}}}, // P c c m +{ 49,"-P 2a 2",{{0,12},{0,24},{0,49}}}, // P m a a +{ 49,"-P 2b 2b",{{0,24},{0,12},{0,49}}}, // P b m b +{ 50," P 2 2 -1ab",{{0,24},{0,12},{0,49}}}, // P b a n :1 +{ 50,"-P 2ab 2b",{{0,12},{12,36},{0,49}}}, // P b a n :2 +{ 50," P 2 2 -1bc",{{0,24},{0,12},{0,49}}}, // P n c b :1 +{ 50,"-P 2b 2bc",{{0,24},{0,12},{0,49}}}, // P n c b :2 +{ 50," P 2 2 -1ac",{{0,12},{0,24},{0,49}}}, // P c n a :1 +{ 50,"-P 2a 2c",{{0,12},{0,24},{0,49}}}, // P c n a :2 +{ 51,"-P 2a 2a",{{0,12},{0,24},{0,49}}}, // P m m a +{ 51,"-P 2b 2",{{0,24},{0,12},{0,49}}}, // P m m b +{ 51,"-P 2 2b",{{0,49},{0,12},{0,24}}}, // P b m m +{ 51,"-P 2c 2c",{{0,24},{0,24},{12,36}}}, // P c m m +{ 51,"-P 2c 2",{{0,24},{0,24},{12,36}}}, // P m c m +{ 51,"-P 2 2a",{{0,12},{0,49},{0,24}}}, // P m a m +{ 52,"-P 2a 2bc",{{0,25},{0,12},{0,49}}}, // P n n a +{ 52,"-P 2b 2n",{{0,12},{0,25},{0,49}}}, // P n n b +{ 52,"-P 2n 2b",{{0,12},{12,36},{0,49}}}, // P b n n +{ 52,"-P 2ab 2c",{{0,24},{0,12},{0,49}}}, // P c n n +{ 52,"-P 2ab 2n",{{0,24},{0,12},{0,49}}}, // P n c n +{ 52,"-P 2n 2bc",{{0,12},{12,36},{0,49}}}, // P n a n +{ 53,"-P 2ac 2",{{0,12},{0,24},{0,49}}}, // P m n a +{ 53,"-P 2bc 2bc",{{0,24},{0,12},{0,49}}}, // P n m b +{ 53,"-P 2ab 2ab",{{0,24},{0,12},{0,49}}}, // P b m n +{ 53,"-P 2 2ac",{{0,12},{0,49},{0,24}}}, // P c n m +{ 53,"-P 2 2bc",{{0,49},{0,12},{0,24}}}, // P n c m +{ 53,"-P 2ab 2",{{0,24},{0,12},{0,49}}}, // P m a n +{ 54,"-P 2a 2ac",{{0,12},{0,24},{0,49}}}, // P c c a +{ 54,"-P 2b 2c",{{0,24},{0,12},{0,49}}}, // P c c b +{ 54,"-P 2a 2b",{{0,25},{0,12},{0,49}}}, // P b a a +{ 54,"-P 2ac 2c",{{0,12},{0,24},{0,49}}}, // P c a a +{ 54,"-P 2bc 2b",{{0,24},{0,12},{0,49}}}, // P b c b +{ 54,"-P 2b 2ab",{{0,12},{0,25},{0,49}}}, // P b a b +{ 55,"-P 2 2ab",{{0,49},{0,12},{0,24}}}, // P b a m +{ 55,"-P 2bc 2",{{0,24},{0,12},{0,49}}}, // P m c b +{ 55,"-P 2ac 2ac",{{0,12},{0,24},{0,49}}}, // P c m a +{ 56,"-P 2ab 2ac",{{0,12},{12,36},{0,49}}}, // P c c n +{ 56,"-P 2ac 2bc",{{0,25},{0,12},{0,49}}}, // P n a a +{ 56,"-P 2bc 2ab",{{0,12},{0,25},{0,49}}}, // P b n b +{ 57,"-P 2c 2b",{{0,49},{0,12},{12,36}}}, // P b c m +{ 57,"-P 2c 2ac",{{0,12},{0,49},{12,36}}}, // P c a m +{ 57,"-P 2ac 2a",{{0,12},{0,24},{0,49}}}, // P m c a +{ 57,"-P 2b 2a",{{0,12},{0,25},{0,49}}}, // P m a b +{ 57,"-P 2a 2ab",{{0,25},{0,12},{0,49}}}, // P b m a +{ 57,"-P 2bc 2c",{{0,24},{0,12},{0,49}}}, // P c m b +{ 58,"-P 2 2n",{{0,49},{0,12},{0,24}}}, // P n n m +{ 58,"-P 2n 2",{{0,24},{0,12},{0,49}}}, // P m n n +{ 58,"-P 2n 2n",{{0,24},{0,12},{0,49}}}, // P n m n +{ 59," P 2 2ab -1ab",{{0,24},{0,12},{0,49}}}, // P m m n :1 +{ 59,"-P 2ab 2a",{{0,12},{12,36},{0,49}}}, // P m m n :2 +{ 59," P 2bc 2 -1bc",{{0,49},{0,12},{0,24}}}, // P n m m :1 +{ 59,"-P 2c 2bc",{{0,49},{0,12},{12,36}}}, // P n m m :2 +{ 59," P 2ac 2ac -1ac",{{0,24},{0,24},{0,24}}}, // P m n m :1 +{ 59,"-P 2c 2a",{{0,12},{0,49},{12,36}}}, // P m n m :2 +{ 60,"-P 2n 2ab",{{0,24},{0,12},{0,49}}}, // P b c n +{ 60,"-P 2n 2c",{{0,24},{0,12},{0,49}}}, // P c a n +{ 60,"-P 2a 2n",{{0,25},{0,12},{0,49}}}, // P n c a +{ 60,"-P 2bc 2n",{{0,12},{0,25},{0,49}}}, // P n a b +{ 60,"-P 2ac 2b",{{0,25},{0,12},{0,49}}}, // P b n a +{ 60,"-P 2b 2ac",{{0,12},{0,25},{0,49}}}, // P c n b +{ 61,"-P 2ac 2ab",{{0,25},{0,12},{0,49}}}, // P b c a +{ 61,"-P 2bc 2ac",{{0,12},{0,25},{0,49}}}, // P c a b +{ 62,"-P 2ac 2n",{{0,25},{0,12},{0,49}}}, // P n m a +{ 62,"-P 2bc 2a",{{0,12},{0,25},{0,49}}}, // P m n b +{ 62,"-P 2c 2ab",{{0,49},{0,12},{12,36}}}, // P b n m +{ 62,"-P 2n 2ac",{{0,12},{12,36},{0,49}}}, // P c m n +{ 62,"-P 2n 2a",{{0,12},{12,36},{0,49}}}, // P m c n +{ 62,"-P 2c 2n",{{0,49},{0,12},{12,36}}}, // P n a m +{ 63,"-C 2c 2",{{0,24},{0,12},{12,36}}}, // C m c m +{ 63,"-C 2c 2 (x-y,x+y,z)",{{0,49},{0,24},{12,36}}}, +{ 63,"-C 2c 2c",{{0,24},{0,12},{12,36}}}, // C c m m +{ 63,"-C 2c 2 (x+y,-x+y,z)",{{0,49},{0,24},{12,36}}}, +{ 63,"-A 2a 2a",{{0,12},{0,12},{0,49}}}, // A m m a +{ 63,"-C 2c 2 (z,x+y,-x+y)",{{0,12},{0,49},{0,49}}}, +{ 63,"-A 2 2a",{{0,12},{0,25},{0,24}}}, // A m a m +{ 63,"-C 2c 2 (z,x-y,x+y)",{{0,12},{0,49},{0,49}}}, +{ 63,"-B 2 2b",{{0,25},{0,12},{0,24}}}, // B b m m +{ 63,"-C 2c 2 (x+y,z,x-y)",{{0,49},{0,12},{0,49}}}, +{ 63,"-B 2b 2",{{0,12},{0,12},{0,49}}}, // B m m b +{ 63,"-C 2c 2 (-x+y,z,x+y)",{{0,49},{0,12},{0,49}}}, +{ 64,"-C 2ac 2",{{0,12},{0,12},{0,49}}}, // C m c a +{ 64,"-C 2ac 2 (x-y,x+y,z)",{{0,49},{0,12},{0,49}}}, +{ 64,"-C 2ac 2ac",{{0,12},{0,12},{0,49}}}, // C c m b +{ 64,"-C 2ac 2 (x+y,-x+y,z)",{{0,49},{0,12},{0,49}}}, +{ 64,"-A 2ab 2ab",{{0,12},{0,12},{0,49}}}, // A b m a +{ 64,"-C 2ac 2 (z,x+y,-x+y)",{{0,49},{0,12},{0,49}}}, +{ 64,"-A 2 2ab",{{0,12},{0,25},{0,24}}}, // A c a m +{ 64,"-C 2ac 2 (z,x-y,x+y)",{{0,49},{0,12},{0,49}}}, +{ 64,"-B 2 2ab",{{0,25},{0,12},{0,24}}}, // B b c m +{ 64,"-C 2ac 2 (x+y,z,x-y)",{{0,49},{0,12},{0,49}}}, +{ 64,"-B 2ab 2",{{0,12},{0,12},{0,49}}}, // B m a b +{ 64,"-C 2ac 2 (-x+y,z,x+y)",{{0,49},{0,12},{0,49}}}, +{ 65,"-C 2 2",{{0,24},{0,12},{0,24}}}, // C m m m +{ 65,"-C 2 2 (x-y,x+y,z)",{{0,49},{0,24},{0,24}}}, +{ 65,"-A 2 2",{{0,24},{0,12},{0,24}}}, // A m m m +{ 65,"-C 2 2 (z,x-y,x+y)",{{0,24},{0,24},{0,49}}}, +{ 65,"-B 2 2",{{0,12},{0,24},{0,24}}}, // B m m m +{ 65,"-C 2 2 (-x+y,z,x+y)",{{0,24},{0,24},{0,49}}}, +{ 66,"-C 2 2c",{{0,24},{0,12},{0,24}}}, // C c c m +{ 66,"-C 2 2c (x-y,x+y,z)",{{0,49},{0,24},{0,12}}}, +{ 66,"-A 2a 2",{{0,12},{0,12},{0,49}}}, // A m a a +{ 66,"-C 2 2c (z,x-y,x+y)",{{0,12},{0,24},{0,49}}}, +{ 66,"-B 2b 2b",{{0,12},{0,12},{0,49}}}, // B b m b +{ 66,"-C 2 2c (-x+y,z,x+y)",{{0,24},{0,12},{0,49}}}, +{ 67,"-C 2a 2",{{0,12},{0,12},{0,49}}}, // C m m a +{ 67,"-C 2a 2 (x-y,x+y,z)",{{0,49},{0,12},{0,49}}}, +{ 67,"-C 2a 2a",{{0,12},{0,12},{0,49}}}, // C m m b +{ 67,"-C 2a 2 (x+y,-x+y,z)",{{0,49},{0,12},{0,49}}}, +{ 67,"-A 2b 2b",{{0,24},{0,12},{12,36}}}, // A b m m +{ 67,"-C 2a 2 (z,x+y,-x+y)",{{0,49},{0,12},{0,49}}}, +{ 67,"-A 2 2b",{{0,24},{0,12},{0,24}}}, // A c m m +{ 67,"-C 2a 2 (z,x-y,x+y)",{{0,49},{0,12},{0,49}}}, +{ 67,"-B 2 2a",{{0,12},{0,24},{0,24}}}, // B m c m +{ 67,"-C 2a 2 (x+y,z,x-y)",{{0,12},{0,49},{0,49}}}, +{ 67,"-B 2a 2",{{0,12},{0,24},{12,36}}}, // B m a m +{ 67,"-C 2a 2 (-x+y,z,x+y)",{{0,12},{0,49},{0,49}}}, +{ 68," C 2 2 -1ac",{{0,12},{0,12},{0,49}}}, // C c c a :1 +{ 68,"-C 2a 2ac (x-y-1/4,x+y-3/4,z+1/4)",{{0,49},{0,12},{0,24}}}, +{ 68,"-C 2a 2ac",{{0,12},{0,12},{0,49}}}, // C c c a :2 +{ 68,"-C 2a 2ac (x-y,x+y,z)",{{0,49},{0,12},{12,36}}}, +{ 68," C 2 2 -1ac",{{0,12},{0,12},{0,49}}}, // C c c a :1 +{ 68,"-C 2a 2ac (x-y-1/4,x+y-3/4,z+1/4)",{{0,49},{0,12},{0,24}}}, +{ 68,"-C 2a 2c",{{0,12},{0,12},{0,49}}}, // C c c b :2 +{ 68,"-C 2a 2ac (x+y,-x+y,z)",{{0,49},{0,12},{12,36}}}, +{ 68," A 2 2 -1ab",{{0,12},{0,12},{0,49}}}, // A b a a :1 +{ 68,"-C 2a 2ac (z+1/4,x-y-1/4,x+y-3/4)",{{0,24},{0,12},{0,49}}}, +{ 68,"-A 2a 2b",{{0,12},{0,12},{0,49}}}, // A b a a :2 +{ 68,"-C 2a 2ac (z,x+y,-x+y)",{{0,12},{12,36},{0,49}}}, +{ 68," A 2 2 -1ab",{{0,12},{0,12},{0,49}}}, // A b a a :1 +{ 68,"-C 2a 2ac (z+1/4,x-y-1/4,x+y-3/4)",{{0,24},{0,12},{0,49}}}, +{ 68,"-A 2ab 2b",{{0,12},{0,12},{0,49}}}, // A c a a :2 +{ 68,"-C 2a 2ac (z,x-y,x+y)",{{0,12},{12,36},{0,49}}}, +{ 68," B 2 2 -1ab",{{0,12},{0,12},{0,49}}}, // B b c b :1 +{ 68,"-C 2a 2ac (-x+y+1/4,z+1/4,x+y-3/4)",{{0,24},{0,12},{0,49}}}, +{ 68,"-B 2ab 2b",{{0,12},{0,12},{0,49}}}, // B b c b :2 +{ 68,"-C 2a 2ac (x+y,z,x-y)",{{12,36},{0,12},{0,49}}}, +{ 68," B 2 2 -1ab",{{0,12},{0,12},{0,49}}}, // B b c b :1 +{ 68,"-C 2a 2ac (-x+y+1/4,z+1/4,x+y-3/4)",{{0,24},{0,12},{0,49}}}, +{ 68,"-B 2b 2ab",{{0,12},{0,12},{0,49}}}, // B b a b :2 +{ 68,"-C 2a 2ac (-x+y,z,x+y)",{{12,36},{0,12},{0,49}}}, +{ 69,"-F 2 2",{{0,12},{0,12},{0,24}}}, // F m m m +{ 69,"-F 2 2 (-x+y+z,x-y+z,x+y-z)",{{0,49},{0,24},{0,49}}}, +{ 70," F 2 2 -1d",{{0,12},{0,6},{0,49}}}, // F d d d :1 +{ 70,"-F 2uv 2vw (-x+y+z+1/8,x-y+z+1/8,x+y-z+1/8)",{{-7,24},{12,30},{-6,43}}}, +{ 70,"-F 2uv 2vw",{{0,6},{6,18},{0,49}}}, // F d d d :2 +{ 70,"-F 2uv 2vw (-x+y+z,x-y+z,x+y-z)",{{0,18},{6,37},{0,49}}}, +{ 71,"-I 2 2",{{0,24},{0,12},{0,24}}}, // I m m m +{ 71,"-I 2 2 (y+z,x+z,x+y)",{{0,36},{0,36},{0,37}}}, +{ 72,"-I 2 2c",{{0,24},{0,12},{0,24}}}, // I b a m +{ 72,"-I 2 2c (y+z,x+z,x+y)",{{0,49},{0,12},{0,49}}}, +{ 72,"-I 2a 2",{{0,12},{0,12},{0,49}}}, // I m c b +{ 72,"-I 2 2c (x+y,y+z,x+z)",{{0,49},{0,12},{0,49}}}, +{ 72,"-I 2b 2b",{{0,12},{0,12},{0,49}}}, // I c m a +{ 72,"-I 2 2c (x+z,x+y,y+z)",{{0,12},{0,49},{0,49}}}, +{ 73,"-I 2b 2c",{{0,12},{0,12},{0,49}}}, // I b c a +{ 73,"-I 2b 2c (y+z,x+z,x+y)",{{1,36},{-12,0},{-6,43}}}, +{ 73,"-I 2a 2b",{{0,12},{0,12},{0,49}}}, // I c a b +{ 73,"-I 2b 2c (-y+z,x-y,x+z)",{{1,36},{-12,0},{-6,43}}}, +{ 74,"-I 2b 2",{{0,12},{0,12},{0,49}}}, // I m m a +{ 74,"-I 2b 2 (y+z,x+z,x+y)",{{0,24},{-6,43},{-12,12}}}, +{ 74,"-I 2a 2a",{{0,12},{0,12},{0,49}}}, // I m m b +{ 74,"-I 2b 2 (-x+z,y+z,-x+y)",{{0,24},{-6,43},{-12,12}}}, +{ 74,"-I 2c 2c",{{0,24},{0,12},{12,36}}}, // I b m m +{ 74,"-I 2b 2 (x+y,y+z,x+z)",{{0,12},{0,49},{0,49}}}, +{ 74,"-I 2 2b",{{0,12},{12,36},{0,24}}}, // I c m m +{ 74,"-I 2b 2 (-x+y,-x+z,y+z)",{{0,12},{0,49},{0,49}}}, +{ 74,"-I 2 2a",{{0,12},{12,36},{0,24}}}, // I m c m +{ 74,"-I 2b 2 (x+z,x+y,y+z)",{{0,49},{0,12},{0,49}}}, +{ 74,"-I 2c 2",{{0,24},{0,12},{12,36}}}, // I m a m +{ 74,"-I 2b 2 (-y+z,x-y,x+z)",{{0,49},{0,12},{0,49}}}, +{ 75," P 4",{{0,24},{0,24},{0,49}}}, // P 4 +{ 76," P 4w",{{0,24},{0,24},{0,49}}}, // P 41 +{ 77," P 4c",{{0,24},{0,24},{0,49}}}, // P 42 +{ 78," P 4cw",{{0,24},{0,24},{0,49}}}, // P 43 +{ 79," I 4",{{0,24},{0,12},{0,49}}}, // I 4 +{ 79," I 4 (y+z,x+z,x+y)",{{0,49},{0,49},{0,24}}}, +{ 80," I 4bw",{{0,12},{12,36},{0,49}}}, // I 41 +{ 80," I 4bw (y+z,x+z,x+y)",{{0,37},{0,49},{0,24}}}, +{ 81," P -4",{{0,24},{0,24},{0,49}}}, // P -4 +{ 82," I -4",{{0,24},{0,12},{0,49}}}, // I -4 +{ 82," I -4 (y+z,x+z,x+y)",{{0,49},{0,36},{0,24}}}, +{ 83,"-P 4",{{0,24},{0,24},{0,24}}}, // P 4/m +{ 84,"-P 4c",{{0,24},{0,24},{0,24}}}, // P 42/m +{ 85," P 4ab -1ab",{{0,24},{0,12},{0,49}}}, // P 4/n :1 +{ 85,"-P 4a",{{0,12},{12,36},{0,49}}}, // P 4/n :2 +{ 86," P 4n -1n",{{0,24},{0,12},{0,49}}}, // P 42/n :1 +{ 86,"-P 4bc",{{0,12},{12,36},{0,49}}}, // P 42/n :2 +{ 87,"-I 4",{{0,24},{0,12},{0,24}}}, // I 4/m +{ 87,"-I 4 (y+z,x+z,x+y)",{{0,36},{-24,13},{0,24}}}, +{ 88," I 4bw -1bw",{{0,12},{0,12},{0,49}}}, // I 41/a :1 +{ 88,"-I 4ad (y+z+3/8,x+z+1/8,x+y+1/4)",{{0,18},{0,43},{0,24}}}, +{ 88,"-I 4ad",{{0,12},{0,12},{0,49}}}, // I 41/a :2 +{ 88,"-I 4ad (y+z,x+z,x+y)",{{-13,30},{24,42},{12,36}}}, +{ 89," P 4 2",{{0,24},{0,24},{0,24}}}, // P 4 2 2 +{ 90," P 4ab 2ab",{{0,24},{0,24},{0,24}}}, // P 4 21 2 +{ 91," P 4w 2c",{{0,24},{0,24},{-6,18}}}, // P 41 2 2 +{ 92," P 4abw 2nw",{{0,24},{0,25},{0,24}}}, // P 41 21 2 +{ 93," P 4c 2",{{0,24},{0,24},{12,36}}}, // P 42 2 2 +{ 94," P 4n 2n",{{0,49},{0,12},{0,24}}}, // P 42 21 2 +{ 95," P 4cw 2c",{{0,24},{0,24},{6,30}}}, // P 43 2 2 +{ 96," P 4nw 2abw",{{0,24},{0,25},{0,24}}}, // P 43 21 2 +{ 97," I 4 2",{{0,24},{0,24},{0,12}}}, // I 4 2 2 +{ 97," I 4 2 (y+z,x+z,x+y)",{{0,49},{0,24},{0,24}}}, +{ 98," I 4bw 2bw",{{0,12},{-12,12},{0,24}}}, // I 41 2 2 +{ 98," I 4bw 2bw (y+z,x+z,x+y)",{{7,43},{6,30},{0,24}}}, +{ 99," P 4 -2",{{0,24},{0,24},{0,49}}}, // P 4 m m +{100," P 4 -2ab",{{0,37},{0,12},{0,49}}}, // P 4 b m +{101," P 4c -2c",{{0,24},{0,24},{0,49}}}, // P 42 c m +{102," P 4n -2n",{{0,37},{12,24},{0,49}}}, // P 42 n m +{103," P 4 -2c",{{0,24},{0,24},{0,25}}}, // P 4 c c +{104," P 4 -2n",{{0,24},{0,24},{0,25}}}, // P 4 n c +{105," P 4c -2",{{0,24},{0,24},{0,25}}}, // P 42 m c +{106," P 4c -2ab",{{0,49},{0,12},{0,25}}}, // P 42 b c +{107," I 4 -2",{{0,24},{0,12},{0,49}}}, // I 4 m m +{107," I 4 -2 (y+z,x+z,x+y)",{{0,49},{0,49},{0,24}}}, +{108," I 4 -2c",{{0,37},{0,12},{0,25}}}, // I 4 c m +{108," I 4 -2c (y+z,x+z,x+y)",{{0,49},{0,25},{0,24}}}, +{109," I 4bw -2",{{0,12},{0,12},{0,49}}}, // I 41 m d +{109," I 4bw -2 (y+z,x+z,x+y)",{{0,49},{0,49},{0,12}}}, +{110," I 4bw -2c",{{0,12},{0,12},{0,49}}}, // I 41 c d +{110," I 4bw -2c (y+z,x+z,x+y)",{{0,37},{0,25},{0,25}}}, +{111," P -4 2",{{0,24},{0,24},{0,49}}}, // P -4 2 m +{112," P -4 2c",{{0,24},{0,24},{0,25}}}, // P -4 2 c +{113," P -4 2ab",{{0,37},{0,12},{0,49}}}, // P -4 21 m +{114," P -4 2n",{{0,49},{0,12},{0,24}}}, // P -4 21 c +{115," P -4 -2",{{0,24},{0,24},{0,24}}}, // P -4 m 2 +{116," P -4 -2c",{{0,24},{0,24},{12,36}}}, // P -4 c 2 +{117," P -4 -2ab",{{0,49},{0,12},{0,24}}}, // P -4 b 2 +{118," P -4 -2n",{{0,24},{0,24},{12,36}}}, // P -4 n 2 +{119," I -4 -2",{{0,24},{0,24},{0,12}}}, // I -4 m 2 +{119," I -4 -2 (y+z,x+z,x+y)",{{0,49},{0,36},{0,24}}}, +{120," I -4 -2c",{{0,49},{0,12},{0,12}}}, // I -4 c 2 +{120," I -4 -2c (y+z,x+z,x+y)",{{0,36},{0,25},{0,24}}}, +{121," I -4 2",{{0,37},{12,24},{0,24}}}, // I -4 2 m +{121," I -4 2 (y+z,x+z,x+y)",{{0,49},{0,24},{0,24}}}, +{122," I -4 2bw",{{0,12},{0,12},{0,49}}}, // I -4 2 d +{122," I -4 2bw (y+z,x+z,x+y)",{{-6,18},{0,36},{0,24}}}, +{123,"-P 4 2",{{0,24},{0,24},{0,24}}}, // P 4/m m m +{124,"-P 4 2c",{{0,24},{0,24},{0,12}}}, // P 4/m c c +{125," P 4 2 -1ab",{{0,37},{0,12},{0,24}}}, // P 4/n b m :1 +{125,"-P 4a 2b",{{0,12},{12,49},{0,24}}}, // P 4/n b m :2 +{126," P 4 2 -1n",{{0,24},{0,12},{0,24}}}, // P 4/n n c :1 +{126,"-P 4a 2bc",{{0,12},{12,36},{12,36}}}, // P 4/n n c :2 +{127,"-P 4 2ab",{{0,37},{0,12},{0,24}}}, // P 4/m b m +{128,"-P 4 2n",{{0,24},{0,24},{0,12}}}, // P 4/m n c +{129," P 4ab 2ab -1ab",{{0,24},{0,12},{0,49}}}, // P 4/n m m :1 +{129,"-P 4a 2a",{{0,12},{12,36},{0,49}}}, // P 4/n m m :2 +{130," P 4ab 2n -1ab",{{0,24},{0,12},{12,36}}}, // P 4/n c c :1 +{130,"-P 4a 2ac",{{0,12},{12,36},{12,36}}}, // P 4/n c c :2 +{131,"-P 4c 2",{{0,24},{0,24},{0,12}}}, // P 42/m m c +{132,"-P 4c 2c",{{0,24},{0,24},{0,24}}}, // P 42/m c m +{133," P 4n 2c -1n",{{0,24},{0,12},{0,24}}}, // P 42/n b c :1 +{133,"-P 4ac 2b",{{0,12},{12,36},{12,36}}}, // P 42/n b c :2 +{134," P 4n 2 -1n",{{0,24},{0,12},{0,49}}}, // P 42/n n m :1 +{134,"-P 4ac 2bc",{{0,12},{12,36},{0,49}}}, // P 42/n n m :2 +{135,"-P 4c 2ab",{{0,49},{0,12},{0,12}}}, // P 42/m b c +{136,"-P 4n 2n",{{0,37},{12,24},{0,24}}}, // P 42/m n m +{137," P 4n 2n -1n",{{0,24},{0,12},{0,24}}}, // P 42/n m c :1 +{137,"-P 4ac 2a",{{0,12},{12,36},{12,36}}}, // P 42/n m c :2 +{138," P 4n 2ab -1n",{{0,37},{0,12},{12,36}}}, // P 42/n c m :1 +{138,"-P 4ac 2ac",{{1,36},{0,12},{0,24}}}, // P 42/n c m :2 +{139,"-I 4 2",{{0,24},{0,12},{0,24}}}, // I 4/m m m +{139,"-I 4 2 (y+z,x+z,x+y)",{{0,49},{0,24},{0,24}}}, +{140,"-I 4 2c",{{0,37},{0,12},{0,12}}}, // I 4/m c m +{140,"-I 4 2c (y+z,x+z,x+y)",{{0,24},{-12,12},{0,24}}}, +{141," I 4bw 2bw -1bw",{{0,12},{0,12},{0,24}}}, // I 41/a m d :1 +{141,"-I 4bd 2 (y+z+3/8,x+z-3/8,x+y-1/4)",{{0,43},{0,30},{0,12}}}, +{141,"-I 4bd 2",{{0,12},{0,12},{-6,18}}}, // I 41/a m d :2 +{141,"-I 4bd 2 (y+z,x+z,x+y)",{{6,49},{-6,24},{12,24}}}, +{142," I 4bw 2aw -1bw",{{0,12},{0,12},{12,36}}}, // I 41/a c d :1 +{142,"-I 4bd 2c (y+z-1/8,x+z-7/8,x+y-1/4)",{{0,18},{0,18},{0,24}}}, +{142,"-I 4bd 2c",{{0,12},{0,12},{6,30}}}, // I 41/a c d :2 +{142,"-I 4bd 2c (y+z,x+z,x+y)",{{0,18},{12,30},{12,36}}}, +{143," P 3",{{0,32},{0,32},{0,49}}}, // P 3 +{144," P 31",{{0,49},{0,49},{0,17}}}, // P 31 +{145," P 32",{{0,49},{0,49},{0,17}}}, // P 32 +{146," R 3",{{0,16},{0,16},{0,49}}}, // R 3 :H +{146," P 3*",{{0,49},{0,49},{0,49}}}, // R 3 :R +{147,"-P 3",{{0,32},{0,16},{0,49}}}, // P -3 +{148,"-R 3",{{0,16},{-8,0},{0,49}}}, // R -3 :H +{148,"-P 3*",{{0,24},{0,24},{0,49}}}, // R -3 :R +{149," P 3 2",{{0,32},{0,32},{0,24}}}, // P 3 1 2 +{150," P 3 2\"",{{0,32},{0,16},{0,49}}}, // P 3 2 1 +{151," P 31 2 (0 0 4)",{{0,49},{0,49},{0,8}}}, // P 31 1 2 +{152," P 31 2\"",{{0,24},{0,49},{0,16}}}, // P 31 2 1 +{153," P 32 2 (0 0 2)",{{0,49},{0,49},{0,8}}}, // P 32 1 2 +{154," P 32 2\"",{{0,49},{0,24},{0,16}}}, // P 32 2 1 +{155," R 3 2\"",{{0,16},{0,16},{0,24}}}, // R 3 2 :H +{155," P 3* 2",{{0,24},{0,24},{0,49}}}, // R 3 2 :R +{156," P 3 -2\"",{{0,32},{0,32},{0,49}}}, // P 3 m 1 +{157," P 3 -2",{{0,32},{0,16},{0,49}}}, // P 3 1 m +{158," P 3 -2\"c",{{0,32},{0,32},{0,25}}}, // P 3 c 1 +{159," P 3 -2c",{{0,32},{0,16},{0,49}}}, // P 3 1 c +{160," R 3 -2\"",{{0,20},{0,13},{0,49}}}, // R 3 m :H +{160," P 3* -2",{{0,49},{0,49},{0,49}}}, // R 3 m :R +{161," R 3 -2\"c",{{0,16},{0,17},{0,25}}}, // R 3 c :H +{161," P 3* -2n",{{0,25},{0,25},{0,49}}}, // R 3 c :R +{162,"-P 3 2",{{0,32},{0,16},{0,24}}}, // P -3 1 m +{163,"-P 3 2c",{{0,32},{0,16},{12,36}}}, // P -3 1 c +{164,"-P 3 2\"",{{0,24},{-16,0},{0,49}}}, // P -3 m 1 +{165,"-P 3 2\"c",{{0,32},{0,16},{0,25}}}, // P -3 c 1 +{166,"-R 3 2\"",{{0,16},{0,8},{0,49}}}, // R -3 m :H +{166,"-P 3* 2",{{0,24},{0,24},{0,49}}}, // R -3 m :R +{167,"-R 3 2\"c",{{0,16},{-8,0},{4,28}}}, // R -3 c :H +{167,"-P 3* 2n",{{0,12},{-12,12},{0,37}}}, // R -3 c :R +{168," P 6",{{0,32},{0,16},{0,49}}}, // P 6 +{169," P 61",{{0,49},{0,49},{0,9}}}, // P 61 +{170," P 65",{{0,49},{0,49},{0,9}}}, // P 65 +{171," P 62",{{0,49},{0,24},{0,17}}}, // P 62 +{172," P 64",{{0,49},{0,24},{0,17}}}, // P 64 +{173," P 6c",{{0,32},{0,16},{0,49}}}, // P 63 +{174," P -6",{{0,32},{0,32},{0,24}}}, // P -6 +{175,"-P 6",{{0,32},{0,16},{0,24}}}, // P 6/m +{176,"-P 6c",{{0,32},{0,16},{12,36}}}, // P 63/m +{177," P 6 2",{{0,32},{0,16},{0,24}}}, // P 6 2 2 +{178," P 61 2 (0 0 5)",{{0,49},{0,24},{-4,4}}}, // P 61 2 2 +{179," P 65 2 (0 0 1)",{{0,24},{0,49},{4,12}}}, // P 65 2 2 +{180," P 62 2 (0 0 4)",{{0,49},{0,24},{0,8}}}, // P 62 2 2 +{181," P 64 2 (0 0 2)",{{0,49},{0,24},{0,8}}}, // P 64 2 2 +{182," P 6c 2c",{{0,32},{0,16},{12,36}}}, // P 63 2 2 +{183," P 6 -2",{{0,24},{-16,0},{0,49}}}, // P 6 m m +{184," P 6 -2c",{{0,32},{0,16},{0,25}}}, // P 6 c c +{185," P 6c -2",{{0,32},{0,16},{0,25}}}, // P 63 c m +{186," P 6c -2c",{{0,24},{-16,0},{0,49}}}, // P 63 m c +{187," P -6 2",{{0,32},{0,32},{0,24}}}, // P -6 m 2 +{188," P -6c 2",{{0,32},{0,32},{0,12}}}, // P -6 c 2 +{189," P -6 -2",{{0,32},{0,16},{0,24}}}, // P -6 2 m +{190," P -6c -2c",{{0,32},{0,16},{12,36}}}, // P -6 2 c +{191,"-P 6 2",{{0,24},{-16,0},{0,24}}}, // P 6/m m m +{192,"-P 6 2c",{{0,32},{0,16},{0,12}}}, // P 6/m c c +{193,"-P 6c 2",{{0,32},{0,16},{0,12}}}, // P 63/m c m +{194,"-P 6c 2c",{{0,24},{-16,0},{12,36}}}, // P 63/m m c +{195," P 2 2 3",{{0,24},{0,24},{0,49}}}, // P 2 3 +{196," F 2 2 3",{{0,12},{0,12},{0,49}}}, // F 2 3 +{196," F 2 2 3 (-x+y+z,x-y+z,x+y-z)",{{0,36},{12,48},{-12,24}}}, +{197," I 2 2 3",{{0,12},{0,12},{0,49}}}, // I 2 3 +{197," I 2 2 3 (y+z,x+z,x+y)",{{0,24},{0,25},{24,48}}}, +{198," P 2ac 2ab 3",{{-12,13},{0,25},{0,36}}}, // P 21 3 +{199," I 2b 2c 3",{{0,12},{0,25},{1,37}}}, // I 21 3 +{199," I 2b 2c 3 (y+z,x+z,x+y)",{{12,37},{0,12},{0,49}}}, +{200,"-P 2 2 3",{{0,24},{0,24},{0,24}}}, // P m -3 +{201," P 2 2 3 -1n",{{0,12},{0,12},{0,49}}}, // P n -3 :1 +{201,"-P 2ab 2bc 3",{{0,12},{0,12},{0,49}}}, // P n -3 :2 +{202,"-F 2 2 3",{{0,12},{0,12},{0,24}}}, // F m -3 +{202,"-F 2 2 3 (-x+y+z,x-y+z,x+y-z)",{{0,24},{0,24},{12,48}}}, +{203," F 2 2 3 -1d",{{0,6},{0,6},{0,49}}}, // F d -3 :1 +{203,"-F 2uv 2vw 3 (-x+y+z+1/8,x-y+z+1/8,x+y-z+1/8)",{{6,24},{12,30},{0,37}}}, +{203,"-F 2uv 2vw 3",{{0,6},{0,6},{0,49}}}, // F d -3 :2 +{203,"-F 2uv 2vw 3 (-x+y+z,x-y+z,x+y-z)",{{-18,0},{24,42},{-6,30}}}, +{204,"-I 2 2 3",{{0,12},{0,12},{0,24}}}, // I m -3 +{204,"-I 2 2 3 (y+z,x+z,x+y)",{{0,24},{-16,0},{0,24}}}, +{205,"-P 2ac 2ab 3",{{0,24},{0,12},{-12,13}}}, // P a -3 +{206,"-I 2b 2c 3",{{0,12},{0,12},{0,25}}}, // I a -3 +{206,"-I 2b 2c 3 (y+z,x+z,x+y)",{{6,24},{12,24},{19,48}}}, +{207," P 4 2 3",{{0,24},{0,24},{0,24}}}, // P 4 3 2 +{208," P 4n 2 3",{{0,12},{0,12},{0,49}}}, // P 42 3 2 +{209," F 4 2 3",{{0,12},{0,12},{0,24}}}, // F 4 3 2 +{209," F 4 2 3 (-x+y+z,x-y+z,x+y-z)",{{0,24},{0,24},{12,48}}}, +{210," F 4d 2 3",{{0,6},{0,6},{0,49}}}, // F 41 3 2 +{210," F 4d 2 3 (-x+y+z,x-y+z,x+y-z)",{{6,24},{12,30},{-24,12}}}, +{211," I 4 2 3",{{0,12},{0,12},{0,24}}}, // I 4 3 2 +{211," I 4 2 3 (y+z,x+z,x+y)",{{0,24},{-16,0},{0,24}}}, +{212," P 4acd 2ab 3",{{6,18},{6,18},{0,49}}}, // P 43 3 2 +{213," P 4bd 2ab 3",{{6,18},{6,18},{0,49}}}, // P 41 3 2 +{214," I 4bd 2c 3",{{-6,6},{0,6},{1,43}}}, // I 41 3 2 +{214," I 4bd 2c 3 (y+z,x+z,x+y)",{{0,12},{-12,12},{12,37}}}, +{215," P -4 2 3",{{0,24},{0,24},{0,49}}}, // P -4 3 m +{216," F -4 2 3",{{0,12},{0,12},{0,49}}}, // F -4 3 m +{216," F -4 2 3 (-x+y+z,x-y+z,x+y-z)",{{0,36},{12,48},{-12,24}}}, +{217," I -4 2 3",{{0,12},{0,12},{0,49}}}, // I -4 3 m +{217," I -4 2 3 (y+z,x+z,x+y)",{{0,24},{0,12},{0,36}}}, +{218," P -4n 2 3",{{0,12},{0,12},{0,49}}}, // P -4 3 n +{219," F -4a 2 3",{{0,12},{0,12},{0,25}}}, // F -4 3 c +{219," F -4a 2 3 (-x+y+z,x-y+z,x+y-z)",{{-6,12},{0,18},{12,48}}}, +{220," I -4bd 2c 3",{{-6,6},{0,6},{1,43}}}, // I -4 3 d +{220," I -4bd 2c 3 (y+z,x+z,x+y)",{{24,36},{0,18},{7,30}}}, +{221,"-P 4 2 3",{{0,24},{0,24},{0,24}}}, // P m -3 m +{222," P 4 2 3 -1n",{{0,12},{0,12},{0,24}}}, // P n -3 n :1 +{222,"-P 4a 2bc 3",{{0,12},{0,12},{12,36}}}, // P n -3 n :2 +{223,"-P 4n 2 3",{{0,12},{0,12},{0,24}}}, // P m -3 n +{224," P 4n 2 3 -1n",{{0,12},{0,12},{0,49}}}, // P n -3 m :1 +{224,"-P 4bc 2bc 3",{{0,12},{0,12},{0,49}}}, // P n -3 m :2 +{225,"-F 4 2 3",{{0,12},{0,12},{0,24}}}, // F m -3 m +{225,"-F 4 2 3 (-x+y+z,x-y+z,x+y-z)",{{0,24},{0,24},{12,48}}}, +{226,"-F 4a 2 3",{{0,12},{0,12},{0,12}}}, // F m -3 c +{226,"-F 4a 2 3 (-x+y+z,x-y+z,x+y-z)",{{0,24},{0,12},{-12,12}}}, +{227," F 4d 2 3 -1d",{{0,6},{0,6},{0,49}}}, // F d -3 m :1 +{227,"-F 4vw 2vw 3 (-x+y+z+1/8,x-y+z+1/8,x+y-z+1/8)",{{6,24},{12,30},{0,37}}}, +{227,"-F 4vw 2vw 3",{{0,6},{0,6},{0,49}}}, // F d -3 m :2 +{227,"-F 4vw 2vw 3 (-x+y+z,x-y+z,x+y-z)",{{-18,0},{24,42},{-6,30}}}, +{228," F 4d 2 3 -1ad",{{0,6},{0,6},{0,25}}}, // F d -3 c :1 +{228,"-F 4ud 2vw 3 (-x+y+z-1/8,x-y+z-1/8,x+y-z-1/8)",{{6,18},{6,18},{-19,12}}}, +{228,"-F 4ud 2vw 3",{{0,6},{0,6},{0,25}}}, // F d -3 c :2 +{228,"-F 4ud 2vw 3 (-x+y+z,x-y+z,x+y-z)",{{12,24},{12,24},{-13,18}}}, +{229,"-I 4 2 3",{{0,12},{0,12},{0,24}}}, // I m -3 m +{229,"-I 4 2 3 (y+z,x+z,x+y)",{{0,24},{-16,0},{0,24}}}, +{230,"-I 4bd 2c 3",{{0,6},{-6,0},{7,43}}}, // I a -3 d +{230,"-I 4bd 2c 3 (y+z,x+z,x+y)",{{-12,0},{0,12},{1,24}}}, +{0, 0, {{0,0},{0,0},{0,0}}} +// END_COMPILED_IN_REFERENCE_DATA + }; + + } // namespace + } // namespace raw_bricks + + brick_point::brick_point(int raw_point) + { + value_ = rat(raw_point / 2, 24); + off_ = raw_point % 2; + } + + namespace { + + const raw_bricks::entry* + find_raw_brick(sgtbx::space_group_type const& space_group_type) + { + int sg_number = space_group_type.number(); + for (const raw_bricks::entry* b = raw_bricks::table; b->sg_number; b++) { + if (b->sg_number > sg_number) break; + if (b->sg_number == sg_number) { + space_group tab_sg(b->hall_symbol, false, false, false, + space_group_type.group().t_den()); + if (space_group_type.group() == tab_sg) return b; + } + } + return 0; + } + + } + + brick::brick(sgtbx::space_group_type const& space_group_type) + { + const raw_bricks::entry* raw_brick = find_raw_brick(space_group_type); + if (raw_brick == 0) { + throw error( + "Brick is not available for the given space group representation."); + } + for(std::size_t i=0;i<3;i++) { + for(std::size_t j=0;j<2;j++) { + points_[i][j] = brick_point(raw_brick->points[i][j]); + } + } + } + + brick_point + brick::operator()(std::size_t i_axis, std::size_t i_min_max) const + { + CCTBX_ASSERT(i_axis < 3); + CCTBX_ASSERT(i_min_max < 2); + return points_[i_axis][i_min_max]; + } + + std::string + brick::as_string() const + { + std::string result; + for(std::size_t i=0;i<3;i++) { + result += scitbx::format(points_[i][0].value()); + result += "<"; + if (!points_[i][0].off()) result += "="; + result += "xyz"[i]; + result += "<"; + if (!points_[i][1].off()) result += "="; + result += scitbx::format(points_[i][1].value()); + if (i < 2) result += "; "; + } + return result; + } + + bool + brick::is_inside(vec3_rat const& point) const + { + for(std::size_t i=0;i<3;i++) { + if (!points_[i][0].off()) { + if (!(points_[i][0].value() <= point[i])) return false; + } + else { + if (!(points_[i][0].value() < point[i])) return false; + } + if (!points_[i][1].off()) { + if (!(point[i] <= points_[i][1].value())) return false; + } + else { + if (!(point[i] < points_[i][1].value())) return false; + } + } + return true; + } + + bool + brick::is_inside(tr_vec const& point) const + { + int den = point.den(); + return is_inside(vec3_rat( + rat(point[0], den), + rat(point[1], den), + rat(point[2], den))); + } + +}} // namespace cctbx::sgtbx diff --git a/extern/cctbx/cctbx/sgtbx/change_of_basis_op.cpp b/extern/cctbx/cctbx/sgtbx/change_of_basis_op.cpp new file mode 100644 index 00000000..9e04b9cb --- /dev/null +++ b/extern/cctbx/cctbx/sgtbx/change_of_basis_op.cpp @@ -0,0 +1,117 @@ +#include + +namespace cctbx { namespace sgtbx { + + change_of_basis_op::change_of_basis_op( + parse_string& symbol, + const char* stop_chars, + int r_den, + int t_den) + : + c_(0, 0), + c_inv_(0, 0) + { + rt_mx_from_string result( + symbol, stop_chars, r_den, t_den, + /* enable_xyz */ true, + /* enable_hkl */ true, + /* enable_abc */ true); + if (result.have_hkl) { + CCTBX_ASSERT(result.t().is_zero()); + c_inv_ = rt_mx(result.r().transpose(), result.t()); + c_ = c_inv_.inverse(); + } + else if (result.have_abc) { + c_inv_ = rt_mx(result.r().transpose(), result.t()); + c_ = c_inv_.inverse(); + } + else { + c_ = rt_mx(result); + c_inv_ = c_.inverse(); + } + } + + change_of_basis_op::change_of_basis_op( + std::string const& symbol, + const char* stop_chars, + int r_den, + int t_den) + : + c_(0, 0), + c_inv_(0, 0) + { + parse_string parse_symbol(symbol); + *this = change_of_basis_op(parse_symbol, stop_chars, r_den, t_den); + } + + tr_vec change_of_basis_op::operator()( + tr_vec const& t, + int sign_identity) const + { + // (C|V)( I|T)(C^-1|W)=( C|CT+V)(C^-1|W)=( I|CT+V+CW)=( I|C(T+W)+V) + // (C|V)(-I|T)(C^-1|W)=(-C|CT+V)(C^-1|W)=(-I|CT+V-CW)=(-I|C(T-W)+V) + tr_vec tf = t.new_denominator(c_inv_.t().den()); + tr_vec tw; + if (sign_identity >= 0) tw = tf + c_inv_.t(); + else tw = tf - c_inv_.t(); + return ( c_.r() * tw + + c_.t().scale(c_.r().den())).new_denominator(t.den()); + } + + rot_mx change_of_basis_op::operator()(rot_mx const& r) const + { + CCTBX_ASSERT(r.den() == 1); + return (c_.r() * r * c_inv_.r()).new_denominator(1); + } + + rt_mx change_of_basis_op::operator()(rt_mx const& s) const + { + CCTBX_ASSERT(s.r().den() == 1); + CCTBX_ASSERT(c_.t().den() % s.t().den() == 0); + return (c_ * (s.scale(1, c_.t().den() / s.t().den()) * c_inv_)) + .new_denominators(s); + } + + rt_mx change_of_basis_op::apply(rt_mx const& s) const + { + return c_.multiply(s.multiply(c_inv_)); + } + + miller::index<> + change_of_basis_op::apply(miller::index<> const& miller_index) const + { + miller::index<> hr = miller_index * c_inv_.r().num(); + if (utils::change_denominator( + hr.begin(), c_inv_.r().den(), hr.begin(), 1, 3) != 0) { + throw error("Change of basis yields non-integral Miller index."); + } + return hr; + } + + af::shared > + change_of_basis_op::apply( + af::const_ref > const& miller_indices) const + { + af::shared > result((af::reserve(miller_indices.size()))); + for(std::size_t i=0;i + change_of_basis_op::apply_results_in_non_integral_indices( + af::const_ref > const& miller_indices) const + { + af::shared result; + for(std::size_t i=0;i hr = miller_indices[i] * c_inv_.r().num(); + if (utils::change_denominator( + hr.begin(), c_inv_.r().den(), hr.begin(), 1, 3) != 0) { + result.push_back(i); + } + } + return result; + } + +}} // namespace cctbx::sgtbx diff --git a/extern/cctbx/cctbx/sgtbx/hall_in.cpp b/extern/cctbx/cctbx/sgtbx/hall_in.cpp new file mode 100644 index 00000000..a8167d79 --- /dev/null +++ b/extern/cctbx/cctbx/sgtbx/hall_in.cpp @@ -0,0 +1,445 @@ +#include +#include +#include +#include +#include + +namespace cctbx { namespace sgtbx { + + namespace { + + namespace hall { + + bool is_space(char c) + { + if (c == '\0') return false; + if (c == '_') return true; + return isspace(c); + } + + bool is_char(char c) + { + if (c == '\0') return false; + return !is_space(c); + } + + } // namespace hall + + int get_abs_order(char c) + { + if (c == '1') return 1; + if (c == '2') return 2; + if (c == '3') return 3; + if (c == '4') return 4; + if (c == '6') return 6; + return 0; + } + + int get_screw(char c) + { + if (c == '1') return 1; + if (c == '2') return 2; + if (c == '3') return 3; + if (c == '4') return 4; + if (c == '5') return 5; + return 0; + } + + char get_reference_axis(char c) + { + c = tolower(c); + if ( c == 'x' + || c == 'y' + || c == 'z') return c; + return '\0'; + } + + char get_direction_code(char c) + { + if ( c == '\'' + || c == '"' + || c == '*') return c; + if ( c == ',' + || c == '.') return '\''; + if ( c == ';' + || c == ':') return '"'; + return '\0'; + } + + tr_vec const& get_translation(char symbol) + { + struct tr_map + { + tr_map(char s, tr_vec const& v) : symbol(s), vec(v) {} + char symbol; + tr_vec vec; + }; + static const tr_map hall_translations[] = + { + tr_map('a', tr_vec_12(6, 0, 0)), + tr_map('b', tr_vec_12(0, 6, 0)), + tr_map('c', tr_vec_12(0, 0, 6)), + tr_map('n', tr_vec_12(6, 6, 6)), + tr_map('u', tr_vec_12(3, 0, 0)), + tr_map('v', tr_vec_12(0, 3, 0)), + tr_map('w', tr_vec_12(0, 0, 3)), + tr_map('d', tr_vec_12(3, 3, 3)), + }; + const std::size_t n_hall_translations = + sizeof hall_translations / sizeof (*hall_translations); + symbol = tolower(symbol); + for(std::size_t i=0;i + + std::size_t + space_group::parse_hall_symbol_cb_op( + parse_string& hall_symbol, + change_of_basis_op& cb_op, + bool pedantic, + bool no_centring_type_symbol) + { + std::size_t n_added_mx = 0; + + // Interpret the lattice type code. + if (!no_centring_type_symbol) { + while (hall::is_space(hall_symbol())) hall_symbol.skip(); + if (hall_symbol() == '-') { + expand_inv(tr_vec(t_den())); + hall_symbol.skip(); + n_added_mx++; + } + if (hall_symbol() == '\0') throw error("Lattice type not specified."); + n_added_mx += expand_conventional_centring_type(hall_symbol()); + hall_symbol.skip(); + } + + const char char_after_lattice_type_symbol = hall_symbol(); + while (hall::is_space(hall_symbol())) hall_symbol.skip(); + if (hall_symbol() == '\0' || hall_symbol() == '(') { + if (pedantic) throw error("Matrix symbol expected."); + if (hall_symbol() == '\0') return n_added_mx; + } + if ( !no_centring_type_symbol + && pedantic + && !hall::is_space(char_after_lattice_type_symbol)) + throw error("Space expected after lattice type symbol."); + + // Loop over the matrix symbols. + int i_mx_symbol = 0; + int first_abs_order = 0; + char first_reference_axis = '\0'; + while (hall_symbol() != '\0' && hall_symbol() != '(') + { + bool improper = false; + int abs_order = 0; + int screw = 0; + char reference_axis = '\0'; + char direction_code = '\0'; + rot_mx smx_r; + tr_vec smx_t(t_den()); + + if (hall_symbol() == '-') { + improper = true; + hall_symbol.skip(); + if (!hall::is_char(hall_symbol())) { + throw error("Incomplete matrix symbol."); + } + } + abs_order = get_abs_order(hall_symbol()); + if (!abs_order) { + throw error("Improper symbol for rotational order."); + } + hall_symbol.skip(); + + screw = get_screw(hall_symbol()); + if (screw) { + if (screw >= abs_order) { + throw error("Improper screw translation."); + } + hall_symbol.skip(); + } + + while (hall::is_char(hall_symbol())) + { + if ( reference_axis == '\0') { + reference_axis = get_reference_axis(hall_symbol()); + if (reference_axis != '\0') { + if ( abs_order == 1 + || (abs_order == 3 && direction_code == '*')) { + throw error("Inconsistent matrix symbol."); + } + hall_symbol.skip(); + continue; + } + } + else if (get_reference_axis(hall_symbol()) != '\0') { + throw error("Multiple axis symbols."); + } + + if ( direction_code == '\0') { + direction_code = get_direction_code(hall_symbol()); + if (direction_code != '\0') { + if ( !(abs_order == 2 && ( direction_code == '"' + || direction_code == '\'')) + && !(abs_order == 3 && direction_code == '*')) { + throw error("Inconsistent matrix symbol."); + } + if (screw) { + throw error("Screw translation for non-principal direction."); + } + hall_symbol.skip(); + continue; + } + } + else if (get_direction_code(hall_symbol()) != '\0') { + throw error("Multiple axis symbols."); + } + + tr_vec const& hall_translation = get_translation(hall_symbol()); + if (hall_translation.is_valid()) { + smx_t = (smx_t + + hall_translation.new_denominator(t_den())).mod_positive(); + hall_symbol.skip(); + continue; + } + + if (hall_symbol() == '(') { + if (pedantic) { + throw error("Space expected before change-of-basis operator."); + } + break; + } + + throw error("Malformed matrix symbol."); + } + + if (reference_axis == '\0') { + if (i_mx_symbol == 0) { + if ( abs_order != 1 + && !(abs_order == 3 && direction_code == '*')) + reference_axis = 'z'; + } + else if (i_mx_symbol == 1) { + if (abs_order == 2) { + if (first_abs_order == 2 || first_abs_order == 4) { + if (direction_code == '\0') { + reference_axis = 'x'; + } + } + else if (first_abs_order == 3 || first_abs_order == 6) { + if (direction_code == '\0') { + direction_code = '\''; + } + reference_axis = first_reference_axis; + } + } + else if ( abs_order == 3 + && (first_abs_order == 2 || first_abs_order == 4) + && direction_code == '\0') { + direction_code = '*'; + } + } + else if (i_mx_symbol == 2) { + if (abs_order == 3 && direction_code == '\0') { + direction_code = '*'; + } + } + } + + if (reference_axis == '\0' && ( direction_code == '"' + || direction_code == '\'')) { + reference_axis = 'z'; + } + + if (reference_axis == '\0' && abs_order != 1 && direction_code != '*') { + throw error("Need explicit axis symbol."); + } + + smx_r = get_rot_mx(improper, abs_order, reference_axis, direction_code); + + if (screw) { + std::size_t i; + switch (reference_axis) { + case 'x': i = 0; break; + case 'y': i = 1; break; + default: i = 2; break; + } + CCTBX_ASSERT(smx_t.den() * screw % abs_order == 0); + smx_t[i] += smx_t.den() * screw / abs_order; + } + + expand_smx(rt_mx(smx_r, smx_t)); + + if (i_mx_symbol == 0) { + first_abs_order = abs_order; + first_reference_axis = reference_axis; + } + i_mx_symbol++; + + if (improper || abs_order != 1) { + n_added_mx++; + } + + while (hall::is_space(hall_symbol())) hall_symbol.skip(); + } + + // Interpret the change-of-basis operator. + if (hall_symbol() == '(') { + hall_symbol.skip(); + hall_symbol.set_mark(); + rt_mx v = rt_mx(parse_short_cb_op(hall_symbol, ")", cb_t_den), cb_r_den); + if (v.is_valid()) { + cb_op = change_of_basis_op(v); + } + else { + hall_symbol.go_to_mark(); + cb_op = change_of_basis_op(hall_symbol, ")", cb_r_den, cb_t_den); + } + while (hall::is_space(hall_symbol())) hall_symbol.skip(); + if (hall_symbol() != ')') { + throw error( + "Closing parenthesis expected after change-of-basis operator"); + } + hall_symbol.skip(); + } + + while (hall::is_space(hall_symbol())) hall_symbol.skip(); + if (hall_symbol() != '\0') { + throw error("Unexpected extra character."); + } + + return n_added_mx; + } + + std::size_t + space_group::parse_hall_symbol( + parse_string& hall_symbol, + bool pedantic, + bool no_centring_type_symbol) + { + change_of_basis_op cb_op(0, 0); + std::size_t n_added_mx = parse_hall_symbol_cb_op( + hall_symbol, cb_op, pedantic, no_centring_type_symbol); + if (cb_op.is_valid()) { + space_group new_sg = change_basis(cb_op); + *this = new_sg; + } + return n_added_mx; + } + + space_group::space_group( + parse_string& hall_symbol, + bool pedantic, + bool no_centring_type_symbol, + bool no_expand, + int t_den) + : no_expand_(no_expand) + { + reset(t_den); + parse_hall_symbol(hall_symbol, pedantic, no_centring_type_symbol); + } + + space_group::space_group( + std::string const& hall_symbol, + bool pedantic, + bool no_centring_type_symbol, + bool no_expand, + int t_den) + : no_expand_(no_expand) + { + reset(t_den); + parse_string hall_symbol_ps(hall_symbol); + parse_hall_symbol(hall_symbol_ps, pedantic, no_centring_type_symbol); + } + + space_group::space_group( + const char* hall_symbol, + bool pedantic, + bool no_centring_type_symbol, + bool no_expand, + int t_den) + : no_expand_(no_expand) + { + reset(t_den); + parse_string hall_symbol_ps(hall_symbol); + parse_hall_symbol(hall_symbol_ps, pedantic, no_centring_type_symbol); + } + + space_group::space_group( + sgtbx::space_group_symbols const& space_group_symbols, + int t_den) + : no_expand_(false) + { + reset(t_den); + parse_string hall_symbol_ps(space_group_symbols.hall()); + parse_hall_symbol(hall_symbol_ps, true); + } + +}} // namespace cctbx::sgtbx diff --git a/extern/cctbx/cctbx/sgtbx/lattice_tr.cpp b/extern/cctbx/cctbx/sgtbx/lattice_tr.cpp new file mode 100644 index 00000000..77857813 --- /dev/null +++ b/extern/cctbx/cctbx/sgtbx/lattice_tr.cpp @@ -0,0 +1,133 @@ +#include +#include + +namespace cctbx { namespace sgtbx { namespace lattice_tr { + + namespace conventional_centring_types { + + namespace { + + static const tr_vec p[] = { tr_vec_12(0, 0, 0), + }; + static const tr_vec a[] = { tr_vec_12(0, 0, 0), + tr_vec_12(0, 6, 6), + }; + static const tr_vec b[] = { tr_vec_12(0, 0, 0), + tr_vec_12(6, 0, 6), + }; + static const tr_vec c[] = { tr_vec_12(0, 0, 0), + tr_vec_12(6, 6, 0), + }; + static const tr_vec i[] = { tr_vec_12(0, 0, 0), + tr_vec_12(6, 6, 6), + }; + static const tr_vec r[] = { tr_vec_12(0, 0, 0), + tr_vec_12(8, 4, 4), + tr_vec_12(4, 8, 8), + }; + static const tr_vec q[] = { tr_vec_12(0, 0, 0), // reverse setting + tr_vec_12(4, 8, 4), // for internal use + tr_vec_12(8, 4, 8), // only + }; + static const tr_vec h[] = { tr_vec_12(0, 0, 0), + tr_vec_12(8, 4, 0), + tr_vec_12(4, 8, 0), + }; + static const tr_vec f[] = { tr_vec_12(0, 0, 0), + tr_vec_12(0, 6, 6), + tr_vec_12(6, 0, 6), + tr_vec_12(6, 6, 0), + }; + + } // namespace + + const table_entry* table() + { + static const table_entry table_[] = { + { 'P', 1, p }, + { 'A', 2, a }, + { 'B', 2, b }, + { 'C', 2, c }, + { 'I', 2, i }, + { 'R', 3, r }, + { 'Q', 3, q }, // reverse setting + { 'H', 3, h }, + { 'F', 4, f }, + { '\0', 0, 0 }, + }; + return table_; + } + + const table_entry* get(char symbol) + { + symbol = toupper(symbol); + if (symbol == 'Q') return 0; + for (const table_entry* e = table(); e->symbol != '\0'; e++) { + if (e->symbol == symbol) return e; + } + return 0; + } + + } // namespace conventional_centring_types + + namespace conventional_z2p_matrices { + + namespace { + + // change-of-basis matrices (coordinate transformations) + + static const rot_mx pp( + 1, 0, 0, + 0, 1, 0, + 0, 0, 1 ); + static const rot_mx ap( + -1, 0, 0, + 0, -1, 1, + 0, 1, 1 ); + static const rot_mx bp( + -1, 0, 1, + 0, -1, 0, + 1, 0, 1 ); + static const rot_mx cp( + 1, 1, 0, + 1, -1, 0, + 0, 0, -1 ); + static const rot_mx ip( + 0, 1, 1, + 1, 0, 1, + 1, 1, 0 ); + static const rot_mx rp( + 1, 0, 1, + -1, 1, 1, + 0, -1, 1 ); + static const rot_mx hp( + 1, 1, 0, + -1, 2, 0, + 0, 0, 1 ); + static const rot_mx fp( + -1, 1, 1, + 1, -1, 1, + 1, 1, -1 ); + + } // namespace + + rot_mx const& get(char symbol) + { + switch (symbol) { + case 'P': return pp; + case 'A': return ap; + case 'B': return bp; + case 'C': return cp; + case 'I': return ip; + case 'R': return rp; + case 'H': return hp; + case 'F': return fp; + default: break; + } + static rot_mx null(0); + return null; + } + + } // namespace conventional_z2p_matrices + +}}} // namespace cctbx::sgtbx::lattice_tr diff --git a/extern/cctbx/cctbx/sgtbx/miller.cpp b/extern/cctbx/cctbx/sgtbx/miller.cpp new file mode 100644 index 00000000..ea161435 --- /dev/null +++ b/extern/cctbx/cctbx/sgtbx/miller.cpp @@ -0,0 +1,191 @@ +#include +#include +#include + +namespace cctbx { namespace sgtbx { + + phase_info::phase_info( + sgtbx::space_group const& space_group, + miller::index<> const& miller_index, + bool no_test_sys_absent) + : + ht_(-1), + t_den_(space_group.t_den()), + sys_abs_was_tested_(!no_test_sys_absent) + { + miller::index<> const& h = miller_index; + // systematically absent reflection: if hr == h and ht != 0 mod 1 + // restricted phase: if hr == -h: phi(h) = pi*ht + n*pi + if (no_test_sys_absent) { + // Fast determination of phase restriction without considering + // conditions for systematically absent reflections. + if (space_group.is_centric()) { + ht_ = ht_mod_1(h, space_group.inv_t()); + } + else { + for(std::size_t i=0;i hr = h * r; + if (h == hr) { + ts = t; + if (space_group.is_centric()) tr = space_group.inv_t() - t; + } + else if (h == -hr) { + tr = t; + if (space_group.is_centric()) ts = space_group.inv_t() - t; + } + if (ts.is_valid()) { + for(std::size_t i_ltr=0;i_ltr tolerance) delta -= pi_u; + if (delta < -tolerance) delta += pi_u; + if (delta <= tolerance) return true; + return false; + } + + double + phase_info::nearest_valid_phase(double phi, bool deg) const + { + if (!is_centric()) return phi; + double pi_u = pi_unit(deg); + double phi_restr = ht_angle(deg); + double delta = scitbx::math::fmod_short(phi - phi_restr, 2*pi_u); + if (delta <= -pi_u/2 || delta > pi_u/2) return phi_restr + pi_u; + return phi_restr; + } + + af::shared + space_group::is_sys_absent( + af::const_ref > const& miller_indices) const + { + af::shared result( + miller_indices.size(), af::init_functor_null()); + for(std::size_t i=0;i const& miller_index) const + { + if (is_centric()) return true; + if (n_smx() > 1) { + miller::index<> minus_miller_index = -miller_index; + if (miller_index * smx_[1].r() == minus_miller_index) return true; + for(std::size_t i=2;i + space_group::is_centric( + af::const_ref > const& miller_indices) const + { + af::shared result( + miller_indices.size(), af::init_functor_null()); + for(std::size_t i=0;i const& miller_index) const + { + int result = 1; + for(std::size_t i=1;i hr = miller_index * smx_[i].r(); + if (hr == miller_index || (is_centric() && hr == -miller_index)) + result++; + } + CCTBX_ASSERT(n_smx() % result == 0); + return result; + } + + af::shared + space_group::epsilon( + af::const_ref > const& miller_indices) const + { + af::shared result( + miller_indices.size(), af::init_functor_null()); + for(std::size_t i=0;i const& miller_index, + bool anomalous_flag) const + { + if (miller_index.is_zero()) return 1; + int centro = (is_centric() || !anomalous_flag); + int m = 1; + int r = 0; + for(std::size_t i=1;i hr = miller_index * smx_[i].r(); + if (hr == miller_index) m++; + else if (hr == -miller_index) r++; + } + CCTBX_ASSERT(n_smx() % m == 0 && (r == 0 || r == m)); + m = n_smx() / m; + if (centro && r == 0) m *= 2; + return m; + } + + af::shared + space_group + ::multiplicity( + af::const_ref > const& miller_indices, + bool anomalous_flag) const + { + af::shared result( + miller_indices.size(), af::init_functor_null()); + for(std::size_t i=0;i +#include + +namespace cctbx { namespace sgtbx { namespace reciprocal_space { + + asu::asu(space_group_type const& sg_type) + : cb_op_(sg_type.cb_op()), + is_reference_(sg_type.cb_op().is_identity_op()), + reference_(lookup_reference_asu( + reference_settings::matrix_group_code_table(sg_type.number()))) + {} + +}}} // namespace cctbx::sgtbx::reciprocal_space diff --git a/extern/cctbx/cctbx/sgtbx/reciprocal_space_ref_asu.cpp b/extern/cctbx/cctbx/sgtbx/reciprocal_space_ref_asu.cpp new file mode 100644 index 00000000..42535ad4 --- /dev/null +++ b/extern/cctbx/cctbx/sgtbx/reciprocal_space_ref_asu.cpp @@ -0,0 +1,243 @@ +#include + +namespace cctbx { namespace sgtbx { namespace reciprocal_space { + + namespace reference_asu_definitions { + namespace { + + struct asu_1b : reference_asu + { + virtual matrix_group::code laue_group() const { + return matrix_group::code_1b; + } + virtual bool is_inside(miller::index<> const& h) const { + return (h[2]>0 || (h[2]==0 && (h[0]>0 || (h[0]==0 && h[1]>=0)))); + } + virtual const char* as_string() const { + return "l>0 or (l==0 and (h>0 or (h==0 and k>=0)))"; + } + virtual af::int3 const& cut_parameters() const { + static const af::int3 result(-1, -1, 0); + return result; + } + }; + + struct asu_2_m : reference_asu + { + virtual matrix_group::code laue_group() const { + return matrix_group::code_2_m; + } + virtual bool is_inside(miller::index<> const& h) const { + return (h[1]>=0 && (h[2]>0 || (h[2]==0 && h[0]>=0))); + } + virtual const char* as_string() const { + return "k>=0 and (l>0 or (l==0 and h>=0))"; + } + virtual af::int3 const& cut_parameters() const { + static const af::int3 result(-1, 0, 0); + return result; + } + }; + + struct asu_mmm : reference_asu + { + virtual matrix_group::code laue_group() const { + return matrix_group::code_mmm; + } + virtual bool is_inside(miller::index<> const& h) const { + return (h[0]>=0 && h[1]>=0 && h[2]>=0); + } + virtual const char* as_string() const { + return "h>=0 and k>=0 and l>=0"; + } + virtual af::int3 const& cut_parameters() const { + static const af::int3 result(0, 0, 0); + return result; + } + }; + + struct asu_4_m : reference_asu + { + virtual matrix_group::code laue_group() const { + return matrix_group::code_4_m; + } + virtual bool is_inside(miller::index<> const& h) const { + return (h[2]>=0 && ((h[0]>=0 && h[1]>0) || (h[0]==0 && h[1]==0))); + } + virtual const char* as_string() const { + return "l>=0 and ((h>=0 and k>0) or (h==0 and k==0))"; + } + virtual af::int3 const& cut_parameters() const { + static const af::int3 result(0, 0, 0); + return result; + } + }; + + struct asu_4_mmm : reference_asu + { + virtual matrix_group::code laue_group() const { + return matrix_group::code_4_mmm; + } + virtual bool is_inside(miller::index<> const& h) const { + return (h[0]>=h[1] && h[1]>=0 && h[2]>=0); + } + virtual const char* as_string() const { + return "h>=k and k>=0 and l>=0"; + } + virtual af::int3 const& cut_parameters() const { + static const af::int3 result(0, 0, 0); + return result; + } + }; + + struct asu_3b : reference_asu + { + virtual matrix_group::code laue_group() const { + return matrix_group::code_3b; + } + virtual bool is_inside(miller::index<> const& h) const { + return (h[0]>=0 && h[1]>0) || (h[0]==0 && h[1]==0 && h[2]>=0); + } + virtual const char* as_string() const { + return "(h>=0 and k>0) or (h==0 and k==0 and l>=0)"; + } + virtual af::int3 const& cut_parameters() const { + static const af::int3 result(0, 0, -1); + return result; + } + }; + + struct asu_3b1m : reference_asu + { + virtual matrix_group::code laue_group() const { + return matrix_group::code_3b1m; + } + virtual bool is_inside(miller::index<> const& h) const { + return (h[0]>=h[1] && h[1]>=0 && (h[1]>0 || h[2]>=0)); + } + virtual const char* as_string() const { + return "h>=k and k>=0 and (k>0 or l>=0)"; + } + virtual af::int3 const& cut_parameters() const { + static const af::int3 result(0, 0, -1); + return result; + } + }; + + struct asu_3bm1 : reference_asu + { + virtual matrix_group::code laue_group() const { + return matrix_group::code_3bm1; + } + virtual bool is_inside(miller::index<> const& h) const { + return (h[0]>=h[1] && h[1]>=0 && (h[0]>h[1] || h[2]>=0)); + } + virtual const char* as_string() const { + return "h>=k and k>=0 and (h>k or l>=0)"; + } + virtual af::int3 const& cut_parameters() const { + static const af::int3 result(0, 0, -1); + return result; + } + }; + + struct asu_6_m : asu_4_m + { + virtual matrix_group::code laue_group() const { + return matrix_group::code_6_m; + } + }; + + struct asu_6_mmm : asu_4_mmm + { + virtual matrix_group::code laue_group() const { + return matrix_group::code_6_mmm; + } + }; + + struct asu_m3b : reference_asu + { + virtual matrix_group::code laue_group() const { + return matrix_group::code_m3b; + } + virtual bool is_inside(miller::index<> const& h) const { + return (h[0]>=0 && ( (h[2]>=h[0] && h[1]>h[0]) + || (h[2]==h[0] && h[1]==h[0]))); + } + virtual const char* as_string() const { + return "h>=0 and ((l>=h and k>h) or (l==h and k==h))"; + } + virtual af::int3 const& cut_parameters() const { + static const af::int3 result(0, 0, 0); + return result; + } + }; + + struct asu_m3bm : reference_asu + { + virtual matrix_group::code laue_group() const { + return matrix_group::code_m3bm; + } + virtual bool is_inside(miller::index<> const& h) const { + return (h[1]>=h[2] && h[2]>=h[0] && h[0]>=0); + } + virtual const char* as_string() const { + return "k>=l and l>=h and h>=0"; + } + virtual af::int3 const& cut_parameters() const { + static const af::int3 result(0, 0, 0); + return result; + } + }; + + static const asu_1b asu_instance_1b = asu_1b(); + static const asu_2_m asu_instance_2_m = asu_2_m(); + static const asu_mmm asu_instance_mmm = asu_mmm(); + static const asu_4_m asu_instance_4_m = asu_4_m(); + static const asu_4_mmm asu_instance_4_mmm = asu_4_mmm(); + static const asu_3b asu_instance_3b = asu_3b(); + static const asu_3b1m asu_instance_3b1m = asu_3b1m(); + static const asu_3bm1 asu_instance_3bm1 = asu_3bm1(); + static const asu_6_m asu_instance_6_m = asu_6_m(); + static const asu_6_mmm asu_instance_6_mmm = asu_6_mmm(); + static const asu_m3b asu_instance_m3b = asu_m3b(); + static const asu_m3bm asu_instance_m3bm = asu_m3bm(); + + static const reference_asu* table[] = { + &asu_instance_1b, + &asu_instance_2_m, + &asu_instance_mmm, + &asu_instance_4_m, &asu_instance_4_mmm, + &asu_instance_3b, &asu_instance_3b1m, &asu_instance_3bm1, + &asu_instance_6_m, &asu_instance_6_mmm, + &asu_instance_m3b, &asu_instance_m3bm, + 0, + }; + + } // namespace + } // namespace reference_asu_definitions + + bool is_in_reference_asu_1b(miller::index<> const& h) + { + return reference_asu_definitions::asu_instance_1b.is_inside(h); + } + + const reference_asu* + lookup_reference_asu(matrix_group::code const& group) + { + using namespace matrix_group; + code laue_group = group.laue_group_type(); + if (laue_group == code_3bm) { + if ( group == code_312 + || group == code_31m + || group == code_3b1m) laue_group = code_3b1m; + else laue_group = code_3bm1; + } + for(std::size_t i=0;; i++) { + const reference_asu* ref_asu = reference_asu_definitions::table[i]; + if (ref_asu == 0) throw CCTBX_INTERNAL_ERROR(); + if (ref_asu->laue_group() == laue_group) return ref_asu; + } + } + +}}} // namespace cctbx::sgtbx::reciprocal_space diff --git a/extern/cctbx/cctbx/sgtbx/reference_settings/hall_symbol_table.cpp b/extern/cctbx/cctbx/sgtbx/reference_settings/hall_symbol_table.cpp new file mode 100644 index 00000000..a683cc9c --- /dev/null +++ b/extern/cctbx/cctbx/sgtbx/reference_settings/hall_symbol_table.cpp @@ -0,0 +1,487 @@ +#include + +namespace cctbx { namespace sgtbx { namespace reference_settings { + + const char* + hall_symbol_table(std::size_t i) + { + static const char* table[] = { + 0, +// BEGIN_COMPILED_IN_REFERENCE_DATA + /* 001 */ " P 1", /* P 1 */ + /* 002 */ "-P 1", /* P -1 */ + /* 003 */ " P 2y", /* P 1 2 1 */ + /* 004 */ " P 2yb", /* P 1 21 1 */ + /* 005 */ " C 2y", /* C 1 2 1 */ + /* 006 */ " P -2y", /* P 1 m 1 */ + /* 007 */ " P -2yc", /* P 1 c 1 */ + /* 008 */ " C -2y", /* C 1 m 1 */ + /* 009 */ " C -2yc", /* C 1 c 1 */ + /* 010 */ "-P 2y", /* P 1 2/m 1 */ + /* 011 */ "-P 2yb", /* P 1 21/m 1 */ + /* 012 */ "-C 2y", /* C 1 2/m 1 */ + /* 013 */ "-P 2yc", /* P 1 2/c 1 */ + /* 014 */ "-P 2ybc", /* P 1 21/c 1 */ + /* 015 */ "-C 2yc", /* C 1 2/c 1 */ + /* 016 */ " P 2 2", /* P 2 2 2 */ + /* 017 */ " P 2c 2", /* P 2 2 21 */ + /* 018 */ " P 2 2ab", /* P 21 21 2 */ + /* 019 */ " P 2ac 2ab", /* P 21 21 21 */ + /* 020 */ " C 2c 2", /* C 2 2 21 */ + /* 021 */ " C 2 2", /* C 2 2 2 */ + /* 022 */ " F 2 2", /* F 2 2 2 */ + /* 023 */ " I 2 2", /* I 2 2 2 */ + /* 024 */ " I 2b 2c", /* I 21 21 21 */ + /* 025 */ " P 2 -2", /* P m m 2 */ + /* 026 */ " P 2c -2", /* P m c 21 */ + /* 027 */ " P 2 -2c", /* P c c 2 */ + /* 028 */ " P 2 -2a", /* P m a 2 */ + /* 029 */ " P 2c -2ac", /* P c a 21 */ + /* 030 */ " P 2 -2bc", /* P n c 2 */ + /* 031 */ " P 2ac -2", /* P m n 21 */ + /* 032 */ " P 2 -2ab", /* P b a 2 */ + /* 033 */ " P 2c -2n", /* P n a 21 */ + /* 034 */ " P 2 -2n", /* P n n 2 */ + /* 035 */ " C 2 -2", /* C m m 2 */ + /* 036 */ " C 2c -2", /* C m c 21 */ + /* 037 */ " C 2 -2c", /* C c c 2 */ + /* 038 */ " A 2 -2", /* A m m 2 */ + /* 039 */ " A 2 -2b", /* A b m 2 */ + /* 040 */ " A 2 -2a", /* A m a 2 */ + /* 041 */ " A 2 -2ab", /* A b a 2 */ + /* 042 */ " F 2 -2", /* F m m 2 */ + /* 043 */ " F 2 -2d", /* F d d 2 */ + /* 044 */ " I 2 -2", /* I m m 2 */ + /* 045 */ " I 2 -2c", /* I b a 2 */ + /* 046 */ " I 2 -2a", /* I m a 2 */ + /* 047 */ "-P 2 2", /* P m m m */ + /* 048 */ "-P 2ab 2bc", /* P n n n :2 */ + /* 049 */ "-P 2 2c", /* P c c m */ + /* 050 */ "-P 2ab 2b", /* P b a n :2 */ + /* 051 */ "-P 2a 2a", /* P m m a */ + /* 052 */ "-P 2a 2bc", /* P n n a */ + /* 053 */ "-P 2ac 2", /* P m n a */ + /* 054 */ "-P 2a 2ac", /* P c c a */ + /* 055 */ "-P 2 2ab", /* P b a m */ + /* 056 */ "-P 2ab 2ac", /* P c c n */ + /* 057 */ "-P 2c 2b", /* P b c m */ + /* 058 */ "-P 2 2n", /* P n n m */ + /* 059 */ "-P 2ab 2a", /* P m m n :2 */ + /* 060 */ "-P 2n 2ab", /* P b c n */ + /* 061 */ "-P 2ac 2ab", /* P b c a */ + /* 062 */ "-P 2ac 2n", /* P n m a */ + /* 063 */ "-C 2c 2", /* C m c m */ + /* 064 */ "-C 2ac 2", /* C m c a */ + /* 065 */ "-C 2 2", /* C m m m */ + /* 066 */ "-C 2 2c", /* C c c m */ + /* 067 */ "-C 2a 2", /* C m m a */ + /* 068 */ "-C 2a 2ac", /* C c c a :2 */ + /* 069 */ "-F 2 2", /* F m m m */ + /* 070 */ "-F 2uv 2vw", /* F d d d :2 */ + /* 071 */ "-I 2 2", /* I m m m */ + /* 072 */ "-I 2 2c", /* I b a m */ + /* 073 */ "-I 2b 2c", /* I b c a */ + /* 074 */ "-I 2b 2", /* I m m a */ + /* 075 */ " P 4", /* P 4 */ + /* 076 */ " P 4w", /* P 41 */ + /* 077 */ " P 4c", /* P 42 */ + /* 078 */ " P 4cw", /* P 43 */ + /* 079 */ " I 4", /* I 4 */ + /* 080 */ " I 4bw", /* I 41 */ + /* 081 */ " P -4", /* P -4 */ + /* 082 */ " I -4", /* I -4 */ + /* 083 */ "-P 4", /* P 4/m */ + /* 084 */ "-P 4c", /* P 42/m */ + /* 085 */ "-P 4a", /* P 4/n :2 */ + /* 086 */ "-P 4bc", /* P 42/n :2 */ + /* 087 */ "-I 4", /* I 4/m */ + /* 088 */ "-I 4ad", /* I 41/a :2 */ + /* 089 */ " P 4 2", /* P 4 2 2 */ + /* 090 */ " P 4ab 2ab", /* P 4 21 2 */ + /* 091 */ " P 4w 2c", /* P 41 2 2 */ + /* 092 */ " P 4abw 2nw", /* P 41 21 2 */ + /* 093 */ " P 4c 2", /* P 42 2 2 */ + /* 094 */ " P 4n 2n", /* P 42 21 2 */ + /* 095 */ " P 4cw 2c", /* P 43 2 2 */ + /* 096 */ " P 4nw 2abw", /* P 43 21 2 */ + /* 097 */ " I 4 2", /* I 4 2 2 */ + /* 098 */ " I 4bw 2bw", /* I 41 2 2 */ + /* 099 */ " P 4 -2", /* P 4 m m */ + /* 100 */ " P 4 -2ab", /* P 4 b m */ + /* 101 */ " P 4c -2c", /* P 42 c m */ + /* 102 */ " P 4n -2n", /* P 42 n m */ + /* 103 */ " P 4 -2c", /* P 4 c c */ + /* 104 */ " P 4 -2n", /* P 4 n c */ + /* 105 */ " P 4c -2", /* P 42 m c */ + /* 106 */ " P 4c -2ab", /* P 42 b c */ + /* 107 */ " I 4 -2", /* I 4 m m */ + /* 108 */ " I 4 -2c", /* I 4 c m */ + /* 109 */ " I 4bw -2", /* I 41 m d */ + /* 110 */ " I 4bw -2c", /* I 41 c d */ + /* 111 */ " P -4 2", /* P -4 2 m */ + /* 112 */ " P -4 2c", /* P -4 2 c */ + /* 113 */ " P -4 2ab", /* P -4 21 m */ + /* 114 */ " P -4 2n", /* P -4 21 c */ + /* 115 */ " P -4 -2", /* P -4 m 2 */ + /* 116 */ " P -4 -2c", /* P -4 c 2 */ + /* 117 */ " P -4 -2ab", /* P -4 b 2 */ + /* 118 */ " P -4 -2n", /* P -4 n 2 */ + /* 119 */ " I -4 -2", /* I -4 m 2 */ + /* 120 */ " I -4 -2c", /* I -4 c 2 */ + /* 121 */ " I -4 2", /* I -4 2 m */ + /* 122 */ " I -4 2bw", /* I -4 2 d */ + /* 123 */ "-P 4 2", /* P 4/m m m */ + /* 124 */ "-P 4 2c", /* P 4/m c c */ + /* 125 */ "-P 4a 2b", /* P 4/n b m :2 */ + /* 126 */ "-P 4a 2bc", /* P 4/n n c :2 */ + /* 127 */ "-P 4 2ab", /* P 4/m b m */ + /* 128 */ "-P 4 2n", /* P 4/m n c */ + /* 129 */ "-P 4a 2a", /* P 4/n m m :2 */ + /* 130 */ "-P 4a 2ac", /* P 4/n c c :2 */ + /* 131 */ "-P 4c 2", /* P 42/m m c */ + /* 132 */ "-P 4c 2c", /* P 42/m c m */ + /* 133 */ "-P 4ac 2b", /* P 42/n b c :2 */ + /* 134 */ "-P 4ac 2bc", /* P 42/n n m :2 */ + /* 135 */ "-P 4c 2ab", /* P 42/m b c */ + /* 136 */ "-P 4n 2n", /* P 42/m n m */ + /* 137 */ "-P 4ac 2a", /* P 42/n m c :2 */ + /* 138 */ "-P 4ac 2ac", /* P 42/n c m :2 */ + /* 139 */ "-I 4 2", /* I 4/m m m */ + /* 140 */ "-I 4 2c", /* I 4/m c m */ + /* 141 */ "-I 4bd 2", /* I 41/a m d :2 */ + /* 142 */ "-I 4bd 2c", /* I 41/a c d :2 */ + /* 143 */ " P 3", /* P 3 */ + /* 144 */ " P 31", /* P 31 */ + /* 145 */ " P 32", /* P 32 */ + /* 146 */ " R 3", /* R 3 :h */ + /* 147 */ "-P 3", /* P -3 */ + /* 148 */ "-R 3", /* R -3 :h */ + /* 149 */ " P 3 2", /* P 3 1 2 */ + /* 150 */ " P 3 2\"", /* P 3 2 1 */ + /* 151 */ " P 31 2 (0 0 4)", /* P 31 1 2 */ + /* 152 */ " P 31 2\"", /* P 31 2 1 */ + /* 153 */ " P 32 2 (0 0 2)", /* P 32 1 2 */ + /* 154 */ " P 32 2\"", /* P 32 2 1 */ + /* 155 */ " R 3 2\"", /* R 3 2 :h */ + /* 156 */ " P 3 -2\"", /* P 3 m 1 */ + /* 157 */ " P 3 -2", /* P 3 1 m */ + /* 158 */ " P 3 -2\"c", /* P 3 c 1 */ + /* 159 */ " P 3 -2c", /* P 3 1 c */ + /* 160 */ " R 3 -2\"", /* R 3 m :h */ + /* 161 */ " R 3 -2\"c", /* R 3 c :h */ + /* 162 */ "-P 3 2", /* P -3 1 m */ + /* 163 */ "-P 3 2c", /* P -3 1 c */ + /* 164 */ "-P 3 2\"", /* P -3 m 1 */ + /* 165 */ "-P 3 2\"c", /* P -3 c 1 */ + /* 166 */ "-R 3 2\"", /* R -3 m :h */ + /* 167 */ "-R 3 2\"c", /* R -3 c :h */ + /* 168 */ " P 6", /* P 6 */ + /* 169 */ " P 61", /* P 61 */ + /* 170 */ " P 65", /* P 65 */ + /* 171 */ " P 62", /* P 62 */ + /* 172 */ " P 64", /* P 64 */ + /* 173 */ " P 6c", /* P 63 */ + /* 174 */ " P -6", /* P -6 */ + /* 175 */ "-P 6", /* P 6/m */ + /* 176 */ "-P 6c", /* P 63/m */ + /* 177 */ " P 6 2", /* P 6 2 2 */ + /* 178 */ " P 61 2 (0 0 5)", /* P 61 2 2 */ + /* 179 */ " P 65 2 (0 0 1)", /* P 65 2 2 */ + /* 180 */ " P 62 2 (0 0 4)", /* P 62 2 2 */ + /* 181 */ " P 64 2 (0 0 2)", /* P 64 2 2 */ + /* 182 */ " P 6c 2c", /* P 63 2 2 */ + /* 183 */ " P 6 -2", /* P 6 m m */ + /* 184 */ " P 6 -2c", /* P 6 c c */ + /* 185 */ " P 6c -2", /* P 63 c m */ + /* 186 */ " P 6c -2c", /* P 63 m c */ + /* 187 */ " P -6 2", /* P -6 m 2 */ + /* 188 */ " P -6c 2", /* P -6 c 2 */ + /* 189 */ " P -6 -2", /* P -6 2 m */ + /* 190 */ " P -6c -2c", /* P -6 2 c */ + /* 191 */ "-P 6 2", /* P 6/m m m */ + /* 192 */ "-P 6 2c", /* P 6/m c c */ + /* 193 */ "-P 6c 2", /* P 63/m c m */ + /* 194 */ "-P 6c 2c", /* P 63/m m c */ + /* 195 */ " P 2 2 3", /* P 2 3 */ + /* 196 */ " F 2 2 3", /* F 2 3 */ + /* 197 */ " I 2 2 3", /* I 2 3 */ + /* 198 */ " P 2ac 2ab 3", /* P 21 3 */ + /* 199 */ " I 2b 2c 3", /* I 21 3 */ + /* 200 */ "-P 2 2 3", /* P m -3 */ + /* 201 */ "-P 2ab 2bc 3", /* P n -3 :2 */ + /* 202 */ "-F 2 2 3", /* F m -3 */ + /* 203 */ "-F 2uv 2vw 3", /* F d -3 :2 */ + /* 204 */ "-I 2 2 3", /* I m -3 */ + /* 205 */ "-P 2ac 2ab 3", /* P a -3 */ + /* 206 */ "-I 2b 2c 3", /* I a -3 */ + /* 207 */ " P 4 2 3", /* P 4 3 2 */ + /* 208 */ " P 4n 2 3", /* P 42 3 2 */ + /* 209 */ " F 4 2 3", /* F 4 3 2 */ + /* 210 */ " F 4d 2 3", /* F 41 3 2 */ + /* 211 */ " I 4 2 3", /* I 4 3 2 */ + /* 212 */ " P 4acd 2ab 3", /* P 43 3 2 */ + /* 213 */ " P 4bd 2ab 3", /* P 41 3 2 */ + /* 214 */ " I 4bd 2c 3", /* I 41 3 2 */ + /* 215 */ " P -4 2 3", /* P -4 3 m */ + /* 216 */ " F -4 2 3", /* F -4 3 m */ + /* 217 */ " I -4 2 3", /* I -4 3 m */ + /* 218 */ " P -4n 2 3", /* P -4 3 n */ + /* 219 */ " F -4a 2 3", /* F -4 3 c */ + /* 220 */ " I -4bd 2c 3", /* I -4 3 d */ + /* 221 */ "-P 4 2 3", /* P m -3 m */ + /* 222 */ "-P 4a 2bc 3", /* P n -3 n :2 */ + /* 223 */ "-P 4n 2 3", /* P m -3 n */ + /* 224 */ "-P 4bc 2bc 3", /* P n -3 m :2 */ + /* 225 */ "-F 4 2 3", /* F m -3 m */ + /* 226 */ "-F 4a 2 3", /* F m -3 c */ + /* 227 */ "-F 4vw 2vw 3", /* F d -3 m :2 */ + /* 228 */ "-F 4ud 2vw 3", /* F d -3 c :2 */ + /* 229 */ "-I 4 2 3", /* I m -3 m */ + /* 230 */ "-I 4bd 2c 3" /* I a -3 d */ +// END_COMPILED_IN_REFERENCE_DATA + }; + return table[i]; + } + + const char* + hermann_mauguin_symbol_table(std::size_t i) + { + static const char* table[] = { + 0, +// BEGIN_COMPILED_IN_REFERENCE_DATA + /* 001 */ "P 1", + /* 002 */ "P -1", + /* 003 */ "P 1 2 1", + /* 004 */ "P 1 21 1", + /* 005 */ "C 1 2 1", + /* 006 */ "P 1 m 1", + /* 007 */ "P 1 c 1", + /* 008 */ "C 1 m 1", + /* 009 */ "C 1 c 1", + /* 010 */ "P 1 2/m 1", + /* 011 */ "P 1 21/m 1", + /* 012 */ "C 1 2/m 1", + /* 013 */ "P 1 2/c 1", + /* 014 */ "P 1 21/c 1", + /* 015 */ "C 1 2/c 1", + /* 016 */ "P 2 2 2", + /* 017 */ "P 2 2 21", + /* 018 */ "P 21 21 2", + /* 019 */ "P 21 21 21", + /* 020 */ "C 2 2 21", + /* 021 */ "C 2 2 2", + /* 022 */ "F 2 2 2", + /* 023 */ "I 2 2 2", + /* 024 */ "I 21 21 21", + /* 025 */ "P m m 2", + /* 026 */ "P m c 21", + /* 027 */ "P c c 2", + /* 028 */ "P m a 2", + /* 029 */ "P c a 21", + /* 030 */ "P n c 2", + /* 031 */ "P m n 21", + /* 032 */ "P b a 2", + /* 033 */ "P n a 21", + /* 034 */ "P n n 2", + /* 035 */ "C m m 2", + /* 036 */ "C m c 21", + /* 037 */ "C c c 2", + /* 038 */ "A m m 2", + /* 039 */ "A b m 2", + /* 040 */ "A m a 2", + /* 041 */ "A b a 2", + /* 042 */ "F m m 2", + /* 043 */ "F d d 2", + /* 044 */ "I m m 2", + /* 045 */ "I b a 2", + /* 046 */ "I m a 2", + /* 047 */ "P m m m", + /* 048 */ "P n n n :2", + /* 049 */ "P c c m", + /* 050 */ "P b a n :2", + /* 051 */ "P m m a", + /* 052 */ "P n n a", + /* 053 */ "P m n a", + /* 054 */ "P c c a", + /* 055 */ "P b a m", + /* 056 */ "P c c n", + /* 057 */ "P b c m", + /* 058 */ "P n n m", + /* 059 */ "P m m n :2", + /* 060 */ "P b c n", + /* 061 */ "P b c a", + /* 062 */ "P n m a", + /* 063 */ "C m c m", + /* 064 */ "C m c a", + /* 065 */ "C m m m", + /* 066 */ "C c c m", + /* 067 */ "C m m a", + /* 068 */ "C c c a :2", + /* 069 */ "F m m m", + /* 070 */ "F d d d :2", + /* 071 */ "I m m m", + /* 072 */ "I b a m", + /* 073 */ "I b c a", + /* 074 */ "I m m a", + /* 075 */ "P 4", + /* 076 */ "P 41", + /* 077 */ "P 42", + /* 078 */ "P 43", + /* 079 */ "I 4", + /* 080 */ "I 41", + /* 081 */ "P -4", + /* 082 */ "I -4", + /* 083 */ "P 4/m", + /* 084 */ "P 42/m", + /* 085 */ "P 4/n :2", + /* 086 */ "P 42/n :2", + /* 087 */ "I 4/m", + /* 088 */ "I 41/a :2", + /* 089 */ "P 4 2 2", + /* 090 */ "P 4 21 2", + /* 091 */ "P 41 2 2", + /* 092 */ "P 41 21 2", + /* 093 */ "P 42 2 2", + /* 094 */ "P 42 21 2", + /* 095 */ "P 43 2 2", + /* 096 */ "P 43 21 2", + /* 097 */ "I 4 2 2", + /* 098 */ "I 41 2 2", + /* 099 */ "P 4 m m", + /* 100 */ "P 4 b m", + /* 101 */ "P 42 c m", + /* 102 */ "P 42 n m", + /* 103 */ "P 4 c c", + /* 104 */ "P 4 n c", + /* 105 */ "P 42 m c", + /* 106 */ "P 42 b c", + /* 107 */ "I 4 m m", + /* 108 */ "I 4 c m", + /* 109 */ "I 41 m d", + /* 110 */ "I 41 c d", + /* 111 */ "P -4 2 m", + /* 112 */ "P -4 2 c", + /* 113 */ "P -4 21 m", + /* 114 */ "P -4 21 c", + /* 115 */ "P -4 m 2", + /* 116 */ "P -4 c 2", + /* 117 */ "P -4 b 2", + /* 118 */ "P -4 n 2", + /* 119 */ "I -4 m 2", + /* 120 */ "I -4 c 2", + /* 121 */ "I -4 2 m", + /* 122 */ "I -4 2 d", + /* 123 */ "P 4/m m m", + /* 124 */ "P 4/m c c", + /* 125 */ "P 4/n b m :2", + /* 126 */ "P 4/n n c :2", + /* 127 */ "P 4/m b m", + /* 128 */ "P 4/m n c", + /* 129 */ "P 4/n m m :2", + /* 130 */ "P 4/n c c :2", + /* 131 */ "P 42/m m c", + /* 132 */ "P 42/m c m", + /* 133 */ "P 42/n b c :2", + /* 134 */ "P 42/n n m :2", + /* 135 */ "P 42/m b c", + /* 136 */ "P 42/m n m", + /* 137 */ "P 42/n m c :2", + /* 138 */ "P 42/n c m :2", + /* 139 */ "I 4/m m m", + /* 140 */ "I 4/m c m", + /* 141 */ "I 41/a m d :2", + /* 142 */ "I 41/a c d :2", + /* 143 */ "P 3", + /* 144 */ "P 31", + /* 145 */ "P 32", + /* 146 */ "R 3 :h", + /* 147 */ "P -3", + /* 148 */ "R -3 :h", + /* 149 */ "P 3 1 2", + /* 150 */ "P 3 2 1", + /* 151 */ "P 31 1 2", + /* 152 */ "P 31 2 1", + /* 153 */ "P 32 1 2", + /* 154 */ "P 32 2 1", + /* 155 */ "R 3 2 :h", + /* 156 */ "P 3 m 1", + /* 157 */ "P 3 1 m", + /* 158 */ "P 3 c 1", + /* 159 */ "P 3 1 c", + /* 160 */ "R 3 m :h", + /* 161 */ "R 3 c :h", + /* 162 */ "P -3 1 m", + /* 163 */ "P -3 1 c", + /* 164 */ "P -3 m 1", + /* 165 */ "P -3 c 1", + /* 166 */ "R -3 m :h", + /* 167 */ "R -3 c :h", + /* 168 */ "P 6", + /* 169 */ "P 61", + /* 170 */ "P 65", + /* 171 */ "P 62", + /* 172 */ "P 64", + /* 173 */ "P 63", + /* 174 */ "P -6", + /* 175 */ "P 6/m", + /* 176 */ "P 63/m", + /* 177 */ "P 6 2 2", + /* 178 */ "P 61 2 2", + /* 179 */ "P 65 2 2", + /* 180 */ "P 62 2 2", + /* 181 */ "P 64 2 2", + /* 182 */ "P 63 2 2", + /* 183 */ "P 6 m m", + /* 184 */ "P 6 c c", + /* 185 */ "P 63 c m", + /* 186 */ "P 63 m c", + /* 187 */ "P -6 m 2", + /* 188 */ "P -6 c 2", + /* 189 */ "P -6 2 m", + /* 190 */ "P -6 2 c", + /* 191 */ "P 6/m m m", + /* 192 */ "P 6/m c c", + /* 193 */ "P 63/m c m", + /* 194 */ "P 63/m m c", + /* 195 */ "P 2 3", + /* 196 */ "F 2 3", + /* 197 */ "I 2 3", + /* 198 */ "P 21 3", + /* 199 */ "I 21 3", + /* 200 */ "P m -3", + /* 201 */ "P n -3 :2", + /* 202 */ "F m -3", + /* 203 */ "F d -3 :2", + /* 204 */ "I m -3", + /* 205 */ "P a -3", + /* 206 */ "I a -3", + /* 207 */ "P 4 3 2", + /* 208 */ "P 42 3 2", + /* 209 */ "F 4 3 2", + /* 210 */ "F 41 3 2", + /* 211 */ "I 4 3 2", + /* 212 */ "P 43 3 2", + /* 213 */ "P 41 3 2", + /* 214 */ "I 41 3 2", + /* 215 */ "P -4 3 m", + /* 216 */ "F -4 3 m", + /* 217 */ "I -4 3 m", + /* 218 */ "P -4 3 n", + /* 219 */ "F -4 3 c", + /* 220 */ "I -4 3 d", + /* 221 */ "P m -3 m", + /* 222 */ "P n -3 n :2", + /* 223 */ "P m -3 n", + /* 224 */ "P n -3 m :2", + /* 225 */ "F m -3 m", + /* 226 */ "F m -3 c", + /* 227 */ "F d -3 m :2", + /* 228 */ "F d -3 c :2", + /* 229 */ "I m -3 m", + /* 230 */ "I a -3 d", +// END_COMPILED_IN_REFERENCE_DATA + }; + return table[i]; + } + +}}} // namespace cctbx::sgtbx::reference_settings diff --git a/extern/cctbx/cctbx/sgtbx/reference_settings/matrix_group_code_table.cpp b/extern/cctbx/cctbx/sgtbx/reference_settings/matrix_group_code_table.cpp new file mode 100644 index 00000000..c606f8cc --- /dev/null +++ b/extern/cctbx/cctbx/sgtbx/reference_settings/matrix_group_code_table.cpp @@ -0,0 +1,246 @@ +#include + +namespace cctbx { namespace sgtbx { namespace reference_settings { + + matrix_group::code const& + matrix_group_code_table(std::size_t i) + { + static const matrix_group::code table[] = { + matrix_group::unknown, +// BEGIN_COMPILED_IN_REFERENCE_DATA + matrix_group::code_1, + matrix_group::code_1b, + matrix_group::code_2, + matrix_group::code_2, + matrix_group::code_2, + matrix_group::code_m, + matrix_group::code_m, + matrix_group::code_m, + matrix_group::code_m, + matrix_group::code_2_m, + matrix_group::code_2_m, + matrix_group::code_2_m, + matrix_group::code_2_m, + matrix_group::code_2_m, + matrix_group::code_2_m, + matrix_group::code_222, + matrix_group::code_222, + matrix_group::code_222, + matrix_group::code_222, + matrix_group::code_222, + matrix_group::code_222, + matrix_group::code_222, + matrix_group::code_222, + matrix_group::code_222, + matrix_group::code_mm2, + matrix_group::code_mm2, + matrix_group::code_mm2, + matrix_group::code_mm2, + matrix_group::code_mm2, + matrix_group::code_mm2, + matrix_group::code_mm2, + matrix_group::code_mm2, + matrix_group::code_mm2, + matrix_group::code_mm2, + matrix_group::code_mm2, + matrix_group::code_mm2, + matrix_group::code_mm2, + matrix_group::code_mm2, + matrix_group::code_mm2, + matrix_group::code_mm2, + matrix_group::code_mm2, + matrix_group::code_mm2, + matrix_group::code_mm2, + matrix_group::code_mm2, + matrix_group::code_mm2, + matrix_group::code_mm2, + matrix_group::code_mmm, + matrix_group::code_mmm, + matrix_group::code_mmm, + matrix_group::code_mmm, + matrix_group::code_mmm, + matrix_group::code_mmm, + matrix_group::code_mmm, + matrix_group::code_mmm, + matrix_group::code_mmm, + matrix_group::code_mmm, + matrix_group::code_mmm, + matrix_group::code_mmm, + matrix_group::code_mmm, + matrix_group::code_mmm, + matrix_group::code_mmm, + matrix_group::code_mmm, + matrix_group::code_mmm, + matrix_group::code_mmm, + matrix_group::code_mmm, + matrix_group::code_mmm, + matrix_group::code_mmm, + matrix_group::code_mmm, + matrix_group::code_mmm, + matrix_group::code_mmm, + matrix_group::code_mmm, + matrix_group::code_mmm, + matrix_group::code_mmm, + matrix_group::code_mmm, + matrix_group::code_4, + matrix_group::code_4, + matrix_group::code_4, + matrix_group::code_4, + matrix_group::code_4, + matrix_group::code_4, + matrix_group::code_4b, + matrix_group::code_4b, + matrix_group::code_4_m, + matrix_group::code_4_m, + matrix_group::code_4_m, + matrix_group::code_4_m, + matrix_group::code_4_m, + matrix_group::code_4_m, + matrix_group::code_422, + matrix_group::code_422, + matrix_group::code_422, + matrix_group::code_422, + matrix_group::code_422, + matrix_group::code_422, + matrix_group::code_422, + matrix_group::code_422, + matrix_group::code_422, + matrix_group::code_422, + matrix_group::code_4mm, + matrix_group::code_4mm, + matrix_group::code_4mm, + matrix_group::code_4mm, + matrix_group::code_4mm, + matrix_group::code_4mm, + matrix_group::code_4mm, + matrix_group::code_4mm, + matrix_group::code_4mm, + matrix_group::code_4mm, + matrix_group::code_4mm, + matrix_group::code_4mm, + matrix_group::code_4b2m, + matrix_group::code_4b2m, + matrix_group::code_4b2m, + matrix_group::code_4b2m, + matrix_group::code_4bm2, + matrix_group::code_4bm2, + matrix_group::code_4bm2, + matrix_group::code_4bm2, + matrix_group::code_4bm2, + matrix_group::code_4bm2, + matrix_group::code_4b2m, + matrix_group::code_4b2m, + matrix_group::code_4_mmm, + matrix_group::code_4_mmm, + matrix_group::code_4_mmm, + matrix_group::code_4_mmm, + matrix_group::code_4_mmm, + matrix_group::code_4_mmm, + matrix_group::code_4_mmm, + matrix_group::code_4_mmm, + matrix_group::code_4_mmm, + matrix_group::code_4_mmm, + matrix_group::code_4_mmm, + matrix_group::code_4_mmm, + matrix_group::code_4_mmm, + matrix_group::code_4_mmm, + matrix_group::code_4_mmm, + matrix_group::code_4_mmm, + matrix_group::code_4_mmm, + matrix_group::code_4_mmm, + matrix_group::code_4_mmm, + matrix_group::code_4_mmm, + matrix_group::code_3, + matrix_group::code_3, + matrix_group::code_3, + matrix_group::code_3, + matrix_group::code_3b, + matrix_group::code_3b, + matrix_group::code_312, + matrix_group::code_321, + matrix_group::code_312, + matrix_group::code_321, + matrix_group::code_312, + matrix_group::code_321, + matrix_group::code_32, + matrix_group::code_3m1, + matrix_group::code_31m, + matrix_group::code_3m1, + matrix_group::code_31m, + matrix_group::code_3m, + matrix_group::code_3m, + matrix_group::code_3b1m, + matrix_group::code_3b1m, + matrix_group::code_3bm1, + matrix_group::code_3bm1, + matrix_group::code_3bm, + matrix_group::code_3bm, + matrix_group::code_6, + matrix_group::code_6, + matrix_group::code_6, + matrix_group::code_6, + matrix_group::code_6, + matrix_group::code_6, + matrix_group::code_6b, + matrix_group::code_6_m, + matrix_group::code_6_m, + matrix_group::code_622, + matrix_group::code_622, + matrix_group::code_622, + matrix_group::code_622, + matrix_group::code_622, + matrix_group::code_622, + matrix_group::code_6mm, + matrix_group::code_6mm, + matrix_group::code_6mm, + matrix_group::code_6mm, + matrix_group::code_6bm2, + matrix_group::code_6bm2, + matrix_group::code_6b2m, + matrix_group::code_6b2m, + matrix_group::code_6_mmm, + matrix_group::code_6_mmm, + matrix_group::code_6_mmm, + matrix_group::code_6_mmm, + matrix_group::code_23, + matrix_group::code_23, + matrix_group::code_23, + matrix_group::code_23, + matrix_group::code_23, + matrix_group::code_m3b, + matrix_group::code_m3b, + matrix_group::code_m3b, + matrix_group::code_m3b, + matrix_group::code_m3b, + matrix_group::code_m3b, + matrix_group::code_m3b, + matrix_group::code_432, + matrix_group::code_432, + matrix_group::code_432, + matrix_group::code_432, + matrix_group::code_432, + matrix_group::code_432, + matrix_group::code_432, + matrix_group::code_432, + matrix_group::code_4b3m, + matrix_group::code_4b3m, + matrix_group::code_4b3m, + matrix_group::code_4b3m, + matrix_group::code_4b3m, + matrix_group::code_4b3m, + matrix_group::code_m3bm, + matrix_group::code_m3bm, + matrix_group::code_m3bm, + matrix_group::code_m3bm, + matrix_group::code_m3bm, + matrix_group::code_m3bm, + matrix_group::code_m3bm, + matrix_group::code_m3bm, + matrix_group::code_m3bm, + matrix_group::code_m3bm +// END_COMPILED_IN_REFERENCE_DATA + }; + return table[i]; + } + +}}} // namespace cctbx::sgtbx::reference_settings diff --git a/extern/cctbx/cctbx/sgtbx/reference_settings/normalizer.cpp b/extern/cctbx/cctbx/sgtbx/reference_settings/normalizer.cpp new file mode 100644 index 00000000..0bab0b5e --- /dev/null +++ b/extern/cctbx/cctbx/sgtbx/reference_settings/normalizer.cpp @@ -0,0 +1,360 @@ +#include +#include + +namespace cctbx { namespace sgtbx { namespace reference_settings { + +namespace normalizer { + + addl_generators const& + addl_generators_table(std::size_t i) + { + static const addl_generators table[] = { + { 0, 0 }, +// BEGIN_COMPILED_IN_REFERENCE_DATA + /* 1 */ { "-1", 0 }, // Note: the affine normalizers for + /* 2 */ { 0, 0 }, // space groups 1 to 15 CANNOT be + /* 3 */ { "-1", 0 }, // represented by rotation symbols. + /* 4 */ { "-1", 0 }, + /* 5 */ { "-1", 0 }, + /* 6 */ { "-1", 0 }, + /* 7 */ { "-1", 0 }, + /* 8 */ { "-1", 0 }, + /* 9 */ { "-1", 0 }, + /* 10 */ { 0, 0 }, + /* 11 */ { 0, 0 }, + /* 12 */ { 0, 0 }, + /* 13 */ { 0, 0 }, + /* 14 */ { 0, 0 }, + /* 15 */ { 0, 0 }, + /* 16 */ { "-1", "3* -2'" }, // Space groups 16 to 74: + /* 17 */ { "-1", "-2'w" }, // the L2N column is for the + /* 18 */ { "-1", "-2'" }, // affine normalizer only + /* 19 */ { "-1", "3* -2'd" }, + /* 20 */ { "-1", "-2'w" }, + /* 21 */ { "-1", "-2'" }, + /* 22 */ { "-1", "3* -2'" }, + /* 23 */ { "-1", "3* -2'" }, + /* 24 */ { "-1", "3* -2'd" }, + /* 25 */ { "-1", "-2'" }, + /* 26 */ { "-1", 0 }, + /* 27 */ { "-1", "-2'" }, + /* 28 */ { "-1", 0 }, + /* 29 */ { "-1", 0 }, + /* 30 */ { "-1", 0 }, + /* 31 */ { "-1", 0 }, + /* 32 */ { "-1", "-2'" }, + /* 33 */ { "-1", 0 }, + /* 34 */ { "-1", "-2'" }, + /* 35 */ { "-1", "-2'" }, + /* 36 */ { "-1", 0 }, + /* 37 */ { "-1", "-2'" }, + /* 38 */ { "-1", 0 }, + /* 39 */ { "-1", 0 }, + /* 40 */ { "-1", 0 }, + /* 41 */ { "-1", 0 }, + /* 42 */ { "-1", "-2'" }, + /* 43 */ { "-1uv", "-2'" }, + /* 44 */ { "-1", "-2'" }, + /* 45 */ { "-1", "-2'" }, + /* 46 */ { "-1", 0 }, + /* 47 */ { 0, "3* -2'" }, + /* 48 */ { 0, "3* -2'" }, + /* 49 */ { 0, "-2'" }, + /* 50 */ { 0, "-2'" }, + /* 51 */ { 0, 0 }, + /* 52 */ { 0, 0 }, + /* 53 */ { 0, 0 }, + /* 54 */ { 0, 0 }, + /* 55 */ { 0, "-2'" }, + /* 56 */ { 0, "-2'" }, + /* 57 */ { 0, 0 }, + /* 58 */ { 0, "-2'" }, + /* 59 */ { 0, "-2'" }, + /* 60 */ { 0, 0 }, + /* 61 */ { 0, "3*" }, + /* 62 */ { 0, 0 }, + /* 63 */ { 0, 0 }, + /* 64 */ { 0, 0 }, + /* 65 */ { 0, "-2'" }, + /* 66 */ { 0, "-2'" }, + /* 67 */ { 0, "-2'buv" }, + /* 68 */ { 0, "-2'buv" }, + /* 69 */ { 0, "3* -2'" }, + /* 70 */ { 0, "3* -2'" }, + /* 71 */ { 0, "3* -2'" }, + /* 72 */ { 0, "-2'" }, + /* 73 */ { 0, "3* -2'd" }, + /* 74 */ { 0, "-2'bd" }, + /* 75 */ { "-1", "-2'" }, + /* 76 */ { 0, "2\"" }, + /* 77 */ { "-1", "-2'" }, + /* 78 */ { 0, "2\"" }, + /* 79 */ { "-1", "-2'" }, + /* 80 */ { "-1a", "2\"" }, + /* 81 */ { "-1", "-2'" }, + /* 82 */ { "-1", "-2'" }, + /* 83 */ { 0, "-2'" }, + /* 84 */ { 0, "-2'" }, + /* 85 */ { 0, "-2'" }, + /* 86 */ { 0, "-2'" }, + /* 87 */ { 0, "-2'" }, + /* 88 */ { 0, "-2'd" }, // Space group 88 is the only space + /* 89 */ { "-1", 0 }, // group where the L2N column is + /* 90 */ { "-1", 0 }, // different for the two origin choices. + /* 91 */ { 0, 0 }, + /* 92 */ { 0, 0 }, + /* 93 */ { "-1", 0 }, + /* 94 */ { "-1", 0 }, + /* 95 */ { 0, 0 }, + /* 96 */ { 0, 0 }, + /* 97 */ { "-1", 0 }, + /* 98 */ { "-1aw", 0 }, + /* 99 */ { "-1", 0 }, + /* 100 */ { "-1", 0 }, + /* 101 */ { "-1", 0 }, + /* 102 */ { "-1", 0 }, + /* 103 */ { "-1", 0 }, + /* 104 */ { "-1", 0 }, + /* 105 */ { "-1", 0 }, + /* 106 */ { "-1", 0 }, + /* 107 */ { "-1", 0 }, + /* 108 */ { "-1", 0 }, + /* 109 */ { "-1a", 0 }, + /* 110 */ { "-1a", 0 }, + /* 111 */ { "-1", 0 }, + /* 112 */ { "-1", 0 }, + /* 113 */ { "-1", 0 }, + /* 114 */ { "-1", 0 }, + /* 115 */ { "-1", 0 }, + /* 116 */ { "-1", 0 }, + /* 117 */ { "-1", 0 }, + /* 118 */ { "-1", 0 }, + /* 119 */ { "-1", 0 }, + /* 120 */ { "-1", 0 }, + /* 121 */ { "-1", 0 }, + /* 122 */ { "-1aw", 0 }, + /* 123 */ { 0, 0 }, + /* 124 */ { 0, 0 }, + /* 125 */ { 0, 0 }, + /* 126 */ { 0, 0 }, + /* 127 */ { 0, 0 }, + /* 128 */ { 0, 0 }, + /* 129 */ { 0, 0 }, + /* 130 */ { 0, 0 }, + /* 131 */ { 0, 0 }, + /* 132 */ { 0, 0 }, + /* 133 */ { 0, 0 }, + /* 134 */ { 0, 0 }, + /* 135 */ { 0, 0 }, + /* 136 */ { 0, 0 }, + /* 137 */ { 0, 0 }, + /* 138 */ { 0, 0 }, + /* 139 */ { 0, 0 }, + /* 140 */ { 0, 0 }, + /* 141 */ { 0, 0 }, + /* 142 */ { 0, 0 }, + /* 143 */ { "-1", "2 -2'" }, + /* 144 */ { 0, "2 2\"" }, + /* 145 */ { 0, "2 2\"" }, + /* 146 */ { "-1", "-2\"" }, + /* 147 */ { 0, "2 -2'" }, + /* 148 */ { 0, "-2\"" }, + /* 149 */ { "-1", "2" }, + /* 150 */ { "-1", "2" }, + /* 151 */ { 0, "2" }, + /* 152 */ { 0, "2" }, + /* 153 */ { 0, "2" }, + /* 154 */ { 0, "2" }, + /* 155 */ { "-1", 0 }, + /* 156 */ { "-1", "2" }, + /* 157 */ { "-1", "2" }, + /* 158 */ { "-1", "2" }, + /* 159 */ { "-1", "2" }, + /* 160 */ { "-1", 0 }, + /* 161 */ { "-1", 0 }, + /* 162 */ { 0, "2" }, + /* 163 */ { 0, "2" }, + /* 164 */ { 0, "2" }, + /* 165 */ { 0, "2" }, + /* 166 */ { 0, 0 }, + /* 167 */ { 0, 0 }, + /* 168 */ { "-1", "-2'" }, + /* 169 */ { 0, "2\"" }, + /* 170 */ { 0, "2\"" }, + /* 171 */ { 0, "2\"" }, + /* 172 */ { 0, "2\"" }, + /* 173 */ { "-1", "-2'" }, + /* 174 */ { "-1", "-2'" }, + /* 175 */ { 0, "-2'" }, + /* 176 */ { 0, "-2'" }, + /* 177 */ { "-1", 0 }, + /* 178 */ { 0, 0 }, + /* 179 */ { 0, 0 }, + /* 180 */ { 0, 0 }, + /* 181 */ { 0, 0 }, + /* 182 */ { "-1", 0 }, + /* 183 */ { "-1", 0 }, + /* 184 */ { "-1", 0 }, + /* 185 */ { "-1", 0 }, + /* 186 */ { "-1", 0 }, + /* 187 */ { "-1", 0 }, + /* 188 */ { "-1", 0 }, + /* 189 */ { "-1", 0 }, + /* 190 */ { "-1", 0 }, + /* 191 */ { 0, 0 }, + /* 192 */ { 0, 0 }, + /* 193 */ { 0, 0 }, + /* 194 */ { 0, 0 }, + /* 195 */ { "-1", "-2'" }, + /* 196 */ { "-1", "-2'" }, + /* 197 */ { "-1", "-2'" }, + /* 198 */ { "-1", "-2'd" }, + /* 199 */ { "-1", "-2'd" }, + /* 200 */ { 0, "-2'" }, + /* 201 */ { 0, "-2'" }, + /* 202 */ { 0, "-2'" }, + /* 203 */ { 0, "-2'" }, + /* 204 */ { 0, "-2'" }, + /* 205 */ { 0, 0 }, + /* 206 */ { 0, "-2'd" }, + /* 207 */ { "-1", 0 }, + /* 208 */ { "-1", 0 }, + /* 209 */ { "-1", 0 }, + /* 210 */ { "-1d", 0 }, + /* 211 */ { "-1", 0 }, + /* 212 */ { 0, 0 }, + /* 213 */ { 0, 0 }, + /* 214 */ { "-1", 0 }, + /* 215 */ { "-1", 0 }, + /* 216 */ { "-1", 0 }, + /* 217 */ { "-1", 0 }, + /* 218 */ { "-1", 0 }, + /* 219 */ { "-1", 0 }, + /* 220 */ { "-1", 0 }, + /* 221 */ { 0, 0 }, + /* 222 */ { 0, 0 }, + /* 223 */ { 0, 0 }, + /* 224 */ { 0, 0 }, + /* 225 */ { 0, 0 }, + /* 226 */ { 0, 0 }, + /* 227 */ { 0, 0 }, + /* 228 */ { 0, 0 }, + /* 229 */ { 0, 0 }, + /* 230 */ { 0, 0 } +// END_COMPILED_IN_REFERENCE_DATA + }; + return table[i]; + } + + af::shared + get_addl_generators( + int sg_number, + bool flag_affine, + bool flag_k2l, + bool flag_l2n) + { + CCTBX_ASSERT(0 < sg_number && sg_number <= 230); + af::shared result; + for(int i_type=0;i_type<2;i_type++) { + const char* hall_mx_symbol = 0; + if (i_type == 0 && flag_k2l) + hall_mx_symbol = addl_generators_table(sg_number).k2l; + else if (i_type == 1 && flag_l2n && (sg_number >= 75 || flag_affine)) + hall_mx_symbol = addl_generators_table(sg_number).l2n; + if (hall_mx_symbol) { + space_group sg_addl_g(true); // no_expand: no group multiplication + parse_string ps(hall_mx_symbol); + std::size_t n_added_mx = sg_addl_g.parse_hall_symbol(ps, true, true); + CCTBX_ASSERT(n_added_mx > 0); + CCTBX_ASSERT(sg_addl_g.n_ltr() == 1); + if (sg_addl_g.is_centric()) { + result.push_back(sg_addl_g(0, 1, 0)); + } + for (std::size_t i=1;i +#include +#include + +namespace cctbx { namespace sgtbx { + + void throw_unsuitable_rot_mx(const char* file, long line) + { + throw error_rational_vector(file, line, + "Unsuitable value for rational rotation matrix."); + } + + rot_mx rot_mx::new_denominator(int new_den) const + { + rot_mx result(new_den); + if (utils::change_denominator(num_.begin(), den(), + result.num_.begin(), new_den, + num_.size()) != 0) { + throw_unsuitable_rot_mx(__FILE__, __LINE__); + } + return result; + } + + rot_mx rot_mx::inverse() const + { + int det_den3 = num_.determinant(); + if (det_den3 == 0) throw error("Rotation matrix is not invertible."); + return rot_mx( + num_.co_factor_matrix_transposed() * (den_*den_), den_) / det_den3; + } + + rot_mx operator/(rot_mx const& lhs, int rhs) + { + sg_mat3 new_num; + for(std::size_t i=0;i<9;i++) { + if (lhs.num_[i] % rhs) throw_unsuitable_rot_mx(__FILE__, __LINE__); + new_num[i] = lhs.num_[i] / rhs; + } + return rot_mx(new_num, lhs.den_); + } + + rot_mx rot_mx::cancel() const + { + int g = den(); + for(std::size_t i=0;i<9;i++) g = scitbx::math::gcd_int(g, num_[i]); + if (g == 0) return *this; + return rot_mx(num_ / g, den() / g); + } + + rot_mx rot_mx::inverse_cancel() const + { + int det_den3 = num_.determinant(); + if (det_den3 == 0) throw error("Rotation matrix is not invertible."); + rat d(det_den3, den_); + return rot_mx(num_.co_factor_matrix_transposed() * d.denominator(), 1) + .divide(d.numerator()); + } + + rot_mx rot_mx::divide(int rhs) const + { + sg_mat3 new_num; + if (rhs < 0) { + new_num = -num_; + rhs = -rhs; + } + else { + new_num = num_; + } + return rot_mx(new_num, den_ * rhs).cancel(); + } + + int rot_mx::type() const + { + int det = num_.determinant(); + if (det == -1 || det == 1) { + switch (num_.trace()) { + case -3: return -1; + case -2: return -6; + case -1: if (det == -1) return -4; + else return 2; + case 0: if (det == -1) return -3; + else return 3; + case 1: if (det == -1) return -2; + else return 4; + case 2: return 6; + case 3: return 1; + } + } + return 0; + } + + int rot_mx::order(int type) const + { + if (type == 0) type = rot_mx::type(); + if (type > 0) return type; + if (type % 2) return -type * 2; + return -type; + } + + rot_mx rot_mx::accumulate(int type) const + { + CCTBX_ASSERT(den_ == 1); + int ord = order(type); + if (ord == 1) return *this; + CCTBX_ASSERT(ord != 0); + sg_mat3 result(1); + sg_mat3 a(num_); + result += a; + for(int i=2; i < ord; ++i) { + a = a*num_; + result += a; + } + return rot_mx(result, 1); + } + +}} // namespace cctbx::sgtbx diff --git a/extern/cctbx/cctbx/sgtbx/rot_mx_info.cpp b/extern/cctbx/cctbx/sgtbx/rot_mx_info.cpp new file mode 100644 index 00000000..072bd8b1 --- /dev/null +++ b/extern/cctbx/cctbx/sgtbx/rot_mx_info.cpp @@ -0,0 +1,59 @@ +#include +#include + +namespace cctbx { namespace sgtbx { + + namespace { + + int sense_of_rotation(rot_mx const& r, int type, sg_vec3 const& ev) + { + // M.B. Boisen, Jr. & G.V. Gibbs + // Mathematical Crystallography, Revised Edition 1990 + // pp. 348-349, 354-356 + + int f = 1; if (type < 0) f = -1; + int trace = f * r.num().trace(); + if (trace == 3 || trace == -1) return 0; /* 1-fold or 2-fold */ + if (ev[1] == 0 && ev[2] == 0) { + if (ev[0] * f * r[7] > 0) + return 1; + } + else { + if (f * (r[3] * ev[2] - r[6] * ev[1]) > 0) + return 1; + } + return -1; + } + + } // namespace + + rot_mx_info::rot_mx_info(rot_mx const& r) + : type_(r.type()), ev_(0,0,0), sense_(0) + { + CCTBX_ASSERT(r.den() == 1); + if (type_ == 0) { + throw error("Cannot determine type of rotation matrix."); + } + rot_mx proper_r = r; + int proper_order = type_; + if (proper_order < 0) { + proper_order *= -1; + proper_r = -proper_r; + } + if (proper_order > 1) { + rot_mx rmi = proper_r.minus_unit_mx(); + af::ref re_mx(rmi.num().begin(), 3, 3); + if (scitbx::matrix::row_echelon::form(re_mx) != 2) { + throw error("Cannot determine Eigenvector of rotation matrix."); + } + ev_ = row_echelon::solve::homog_rank_2(re_mx); + sense_ = sense_of_rotation(r, type_, ev_); + } + } + + rot_mx_info rot_mx::info() const + { + return rot_mx_info(*this); + } + +}} // namespace cctbx::sgtbx diff --git a/extern/cctbx/cctbx/sgtbx/row_echelon_solve.cpp b/extern/cctbx/cctbx/sgtbx/row_echelon_solve.cpp new file mode 100644 index 00000000..3de04c66 --- /dev/null +++ b/extern/cctbx/cctbx/sgtbx/row_echelon_solve.cpp @@ -0,0 +1,70 @@ +#include + +namespace cctbx { namespace sgtbx { namespace row_echelon { namespace solve { + + af::tiny + homog_rank_1(af::const_ref const& re_mx, + scitbx::matrix::row_echelon::independent const& indep) + { + CCTBX_ASSERT(re_mx.n_rows() == 1); + CCTBX_ASSERT(indep.indices.size() == 2); + const int trial_v[4][2] = + {{ 1, 0 }, + { 0, 1 }, + { 1, 1 }, + { 1, -1 }, + }; + af::tiny sol; + for(std::size_t i_tv=0;i_tv<4;i_tv++) { + sol[i_tv].fill(0); + for(std::size_t i=0;i<2;i++) { + sol[i_tv][indep.indices[i]] = trial_v[i_tv][i]; + } + int* n_a = 0; + CCTBX_ASSERT(scitbx::matrix::row_echelon::back_substitution_int( + re_mx, n_a, sol[i_tv].begin()) > 0); + } + return sol; + } + + af::tiny + homog_rank_1(af::const_ref const& re_mx) + { + scitbx::matrix::row_echelon::independent indep(re_mx); + return homog_rank_1(re_mx, indep); + } + + namespace { + + int sign_hemisphere(sg_vec3 const& v) + { + if (v[2] > 0) return 1; + if (v[2] == 0) { + if (v[1] > 0) return 1; + if (v[1] == 0) { + if (v[0] > 0) return 1; + if (v[0] == 0) + return 0; + } + } + return -1; + } + + } // namespace + + sg_vec3 + homog_rank_2(af::const_ref const& re_mx) + { + CCTBX_ASSERT(re_mx.n_rows() == 2); + scitbx::matrix::row_echelon::independent indep(re_mx); + CCTBX_ASSERT(indep.indices.size() == 1); + sg_vec3 ev(0,0,0); + ev[indep.indices[0]] = 1; + int* n_a = 0; + CCTBX_ASSERT(scitbx::matrix::row_echelon::back_substitution_int( + re_mx, n_a, ev.begin()) >= 1); + if (sign_hemisphere(ev) < 0) ev *= -1; + return ev; + } + +}}}} // namespace cctbx::sgtbx::row_echelon::solve diff --git a/extern/cctbx/cctbx/sgtbx/rt_mx.cpp b/extern/cctbx/cctbx/sgtbx/rt_mx.cpp new file mode 100644 index 00000000..8dc5b825 --- /dev/null +++ b/extern/cctbx/cctbx/sgtbx/rt_mx.cpp @@ -0,0 +1,379 @@ +#include +#include +#include +#include + +namespace cctbx { namespace sgtbx { + + rt_mx rt_mx::new_denominators(int r_den, int t_den) const + { + rt_mx result(*this); + if (r_den) result.r_ = result.r_.new_denominator(r_den); + if (t_den) result.t_ = result.t_.new_denominator(t_den); + return result; + } + + rt_mx rt_mx::scale(int factor_r, int factor_t) const + { + if (factor_t == 0) factor_t = factor_r; + return rt_mx(r_.scale(factor_r), t_.scale(factor_t)); + } + + rt_mx rt_mx::inverse() const + { + rot_mx r_inv = r_.inverse(); + tr_vec t_inv = (-r_inv * t_).new_denominator(t_.den()); + return rt_mx(r_inv, t_inv); + } + + rt_mx rt_mx::inverse_cancel() const + { + rot_mx r_inv = r_.inverse_cancel(); + tr_vec t_inv = -r_inv.multiply(t_); + return rt_mx(r_inv, t_inv); + } + + rt_mx rt_mx::operator+(rt_mx const& rhs) const + { + return rt_mx(r_ + rhs.r_, t_ + rhs.t_); + } + + rt_mx rt_mx::operator*(rt_mx const& rhs) const + { + CCTBX_ASSERT(t_.den() == rhs.t_.den()); + return rt_mx(r_ * rhs.r_, r_ * rhs.t_ + t_.scale(r_.den())); + } + + rt_mx rt_mx::operator+(tr_vec const& rhs) const + { + return rt_mx(r_, t_ + rhs); + } + + namespace { + + void + throw_parse_error( + parse_string const& input, + std::string const& info=": unexpected character") + { + throw std::invalid_argument( + "Parse error" + info + ":\n" + + input.format_where_message(/* prefix */ " ")); + } + + int rationalize(double fVal, int& iVal, int den) + { + if (den == 0) return -1; + fVal *= den; + if (fVal < 0.) iVal = int(fVal - .5); + else iVal = int(fVal + .5); + fVal -= iVal; + fVal /= den; + if (fVal < 0.) fVal = -fVal; + if (fVal > .0005) return -1; + return 0; + } + + } // namespace + + rt_mx_from_string::rt_mx_from_string( + parse_string& input, + const char* stop_chars, + int r_den, + int t_den, + bool enable_xyz, + bool enable_hkl, + bool enable_abc) + : + rt_mx(r_den, t_den), + have_xyz(false), + have_hkl(false), + have_abc(false) + { + int Row = 0; + int Column = -1; + int Sign = 1; + int Mult = 0; + double ValR[3]; + int i; + for(i=0;i<3;i++) ValR[i] = 0.; + double ValT = 0.; + double Value = 0.; + bool have_value = false; + const unsigned int P_Add = 0x01u; + const unsigned int P_Mult = 0x02u; + const unsigned int P_Value = 0x04u; + const unsigned int P_XYZ = 0x08u; + const unsigned int P_Comma = 0x10u; + unsigned int P_mode = P_Add | P_Value | P_XYZ; + for (;; input.skip()) + { + if (strchr(stop_chars, input()) || !isspace(input())) + { + switch (strchr(stop_chars, input()) ? '\0' : input()) + { + case '_': + break; + case '+': Sign = 1; goto ProcessAdd; + case '-': Sign = -1; + ProcessAdd: + if ((P_mode & P_Add) == 0) throw_parse_error(input); + if (Column >= 0) ValR[Column] += Value; + else ValT += Value; + Value = 0.; + have_value = false; + Column = -1; + Mult = 0; + P_mode = P_Value | P_XYZ; + break; + case '*': + if ((P_mode & P_Mult) == 0) throw_parse_error(input); + Mult = 1; + P_mode = P_Value | P_XYZ; + break; + case '/': + case ':': + if ((P_mode & P_Mult) == 0) throw_parse_error(input); + Mult = -1; + P_mode = P_Value; + break; + case '.': + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if ((P_mode & P_Value) == 0) throw_parse_error(input); + { + const char *beginptr = input.peek(); + char *endptr; + double V = std::strtod(beginptr, &endptr); + if (endptr == beginptr) { + throw_parse_error(input); + } + input.skip((endptr-beginptr)-1); + if (Sign == -1) { V = -V; Sign = 1; } + if (Mult == 1) + Value *= V; + else if (Mult == -1) { + if (V != 0.) Value /= V; + else if (Value != 0.) throw_parse_error(input); + } + else + Value = V; + } + have_value = true; + P_mode = P_Comma | P_Add | P_Mult | P_XYZ; + break; + case 'X': + case 'x': Column = 0; have_xyz = true; goto Process_XYZ; + case 'Y': + case 'y': Column = 1; have_xyz = true; goto Process_XYZ; + case 'Z': + case 'z': Column = 2; have_xyz = true; goto Process_XYZ; + case 'H': + case 'h': Column = 0; have_hkl = true; goto Process_XYZ; + case 'K': + case 'k': Column = 1; have_hkl = true; goto Process_XYZ; + case 'L': + case 'l': Column = 2; have_hkl = true; goto Process_XYZ; + case 'A': + case 'a': Column = 0; have_abc = true; goto Process_XYZ; + case 'B': + case 'b': Column = 1; have_abc = true; goto Process_XYZ; + case 'C': + case 'c': Column = 2; have_abc = true; goto Process_XYZ; + Process_XYZ: + if (have_xyz && !enable_xyz) { + throw_parse_error( + input, ": x,y,z notation not supported in this context"); + } + if (have_hkl && !enable_hkl) { + throw_parse_error( + input, ": h,k,l notation not supported in this context"); + } + if (have_abc && !enable_abc) { + throw_parse_error( + input, ": a,b,c notation not supported in this context"); + } + if (have_xyz && have_hkl) { + throw_parse_error(input, ": mix of x,y,z and h,k,l notation"); + } + if (have_xyz && have_abc) { + throw_parse_error(input, ": mix of x,y,z and a,b,c notation"); + } + if (have_hkl && have_abc) { + throw_parse_error(input, ": mix of h,k,l and a,b,c notation"); + } + if ((P_mode & P_XYZ) == 0) throw_parse_error(input); + if (!have_value) { Value = Sign; Sign = 1; } + P_mode = P_Comma | P_Add | P_Mult; + break; + case ',': + case ';': + if (Row == 2) { + throw_parse_error(input, ": too many row expressions"); + } + case '\0': + if ((P_mode & P_Comma) == 0) { + throw_parse_error(input, ": unexpected end of input"); + } + if (Column >= 0) ValR[Column] += Value; + else ValT += Value; + for(i=0;i<3;i++) { + if (rationalize(ValR[i], r()(Row, i), r_den) != 0) { + throw_unsuitable_rot_mx(__FILE__, __LINE__); + } + } + if (rationalize(ValT, t()[Row], t_den) != 0) { + throw_unsuitable_tr_vec(__FILE__, __LINE__); + } + Row++; + Column = -1; + Sign = 1; + Mult = 0; + for(i=0;i<3;i++) ValR[i] = 0.; + ValT = 0.; + Value = 0.; + have_value = false; + P_mode = P_Add | P_Value | P_XYZ; + break; + default: + throw_parse_error(input); + } + } + if (strchr(stop_chars, input())) { + break; + } + } + if (Row != 3) throw_parse_error(input, ": not enough row expressions"); + } + + rt_mx::rt_mx(parse_string& symbol, const char* stop_chars, + int r_den, int t_den) + : r_(0), t_(0) + { + rt_mx_from_string result( + symbol, stop_chars, r_den, t_den, + /* enable_xyz */ true, + /* enable_hkl */ true, + /* enable_abc */ false); + if (result.have_hkl) { + if (!result.t().is_zero()) { + std::ostringstream o; + o << "h,k,l matrix symbol must not include a translation part:\n" + << " input symbol: \"" << symbol.string() << "\"\n" + << " translation part: (" + << result.t().as_string(/*decimal*/ false, /*seperator*/ ", ") + << ")"; + throw std::invalid_argument(o.str()); + } + r_ = result.r().transpose(); + } + else r_ = result.r(); + t_ = result.t(); + } + + rt_mx::rt_mx(std::string const& symbol, const char* stop_chars, + int r_den, int t_den) + : r_(0), t_(0) + { + parse_string parse_symbol(symbol); + *this = rt_mx(parse_symbol, stop_chars, r_den, t_den); + } + + rt_mx::rt_mx(scitbx::mat3 const& r, + scitbx::vec3 const& t, + int r_den, int t_den) + : r_(0), t_(0) + { + rt_mx result(r_den, t_den); + for(std::size_t i=0;i<9;i++) { + if (rationalize(r[i], result.r_[i], r_den) != 0) { + throw_unsuitable_rot_mx(__FILE__, __LINE__); + } + } + for(std::size_t i=0;i<3;i++) { + if (rationalize(t[i], result.t_[i], t_den) != 0) { + throw_unsuitable_tr_vec(__FILE__, __LINE__); + } + } + r_ = result.r_; + t_ = result.t_; + } + + af::tiny rt_mx::as_int_array() const + { + af::tiny result; + for(std::size_t i=0;i<9;i++) result[i ] = r_[i]; + for(std::size_t i=0;i<3;i++) result[i + 9] = t_[i]; + return result; + } + + bool rt_mx::is_perpendicular(sg_vec3 const& v) const + { + return (r().accumulate() * v).is_zero(); + } + + tr_vec rt_mx::t_intrinsic_part() const + { + int type = r_.type(); + return r_.accumulate(type) * t_ / r_.order(type); + } + + tr_vec rt_mx::t_location_part(tr_vec const& wi) const + { + return wi - t(); + } + + tr_vec rt_mx::t_origin_shift(tr_vec const& wl) const + { + rot_mx rmi = r_.minus_unit_mx(); + rot_mx p(1); + af::ref ref_rmi(rmi.num().begin(), 3, 3); + af::ref ref_p(p.num().begin(), 3, 3); + scitbx::matrix::row_echelon::form_t(ref_rmi, ref_p); + tr_vec pwl = p * wl; + tr_vec sh(0); + sh.den() = scitbx::matrix::row_echelon::back_substitution_int( + ref_rmi, pwl.num().begin(), sh.num().begin()); + CCTBX_ASSERT(sh.den() > 0); + sh.den() *= pwl.den(); + return sh; + } + + rt_mx rt_mx::cancel() const + { + return rt_mx(r_.cancel(), t_.cancel()); + } + + rt_mx rt_mx::multiply(rt_mx const& rhs) const + { + if (t().den() == rhs.t().den()) { + return rt_mx( + (r_ * rhs.r()), + (r_ * rhs.t() + t_.scale(r().den()))).cancel(); + } + else { + int f = boost::lcm(t().den(), rhs.t().den()); + int l = f / t().den() * r().den(); + int r = f / rhs.t().den(); + return rt_mx( + (r_ * rhs.r()), + (r_ * rhs.t().scale(r) + t_.scale(l))).cancel(); + } + } + + translation_part_info::translation_part_info(rt_mx const& s) + { + ip_ = s.t_intrinsic_part(); + lp_ = s.t_location_part(ip_); + os_ = s.t_origin_shift(lp_); + } + +}} // namespace cctbx::sgtbx diff --git a/extern/cctbx/cctbx/sgtbx/select_generators.cpp b/extern/cctbx/cctbx/sgtbx/select_generators.cpp new file mode 100644 index 00000000..02b70617 --- /dev/null +++ b/extern/cctbx/cctbx/sgtbx/select_generators.cpp @@ -0,0 +1,238 @@ +#include +#include + +namespace cctbx { namespace sgtbx { namespace select_generators { + + any::any(space_group const& sg, + int z2p_r_den, + int z2p_t_den) + : n_gen(0) + { + using namespace crystal_system; + using scitbx::fn::absolute; + + z2p_op = sg.z2p_op(z2p_r_den, z2p_t_den); + + z_inv_t = sg.inv_t(true); + p_inv_t = tr_vec(0); + for(std::size_t i=0;i<2;i++) z_gen[i] = rt_mx(0, 0); + for(std::size_t i=0;i<2;i++) p_gen[i] = rt_mx(0, 0); + + int principal_proper_order = 0; + + matrix_group::code point_group_mx_group_code = sg.point_group_type(); + switch (point_group_mx_group_code.crystal_system()) + { + case triclinic: + break; + + case monoclinic: + z_gen[0] = sg.smx(1); + n_gen = 1; + break; + + case orthorhombic: + z_gen[0] = sg.smx(1); + z_gen[1] = sg.smx(2); + n_gen = 2; + break; + + case tetragonal: + principal_proper_order = 4; + case trigonal: + if (!principal_proper_order) principal_proper_order = 3; + case hexagonal: + if (!principal_proper_order) principal_proper_order = 6; + { + rot_mx_info principal_ri; + std::size_t i=1; + for(;i 0) { + z_gen[0] = sg.smx(i); + n_gen++; + break; + } + } + } + CCTBX_ASSERT(n_gen == 1); + std::size_t i_principal = i; + for(i=1;i 0) { + if (!z_gen[0].is_valid()) { + z_gen[0] = sg.smx(i); + n_gen++; + if (n_gen == 2) break; + } + } + } + else if (absolute(ri.type()) == sg.n_smx() / 6) { + if (ri.sense() >= 0) { + if (!z_gen[1].is_valid()) { + z_gen[1] = sg.smx(i); + n_gen++; + if (n_gen == 2) break; + } + } + } + } + CCTBX_ASSERT(n_gen == 2); + break; + + default: + throw CCTBX_INTERNAL_ERROR(); + } + } + + void any::set_primitive() + { + for (std::size_t i=0;i 0) { + z_gen[0] = work_sg.smx(i); n_gen++; + } + } + else if (principal_proper_order == 4) { + if (ri.ev() == ev_100) { + z_gen[1] = work_sg.smx(i); n_gen++; + } + } + else if (principal_proper_order == 3) { + if (ri.ev() == ev_m10) { + z_gen[1] = work_sg.smx(i); n_gen++; + } + else if (ri.ev() == ev_110) { + z_gen[1] = work_sg.smx(i); n_gen++; + } + } + else { // principal_proper_order == 6 + if (ri.ev() == ev_m10) { + z_gen[1] = work_sg.smx(i); n_gen++; + } + } + } + CCTBX_ASSERT(n_gen == 1 || n_gen == 2); + for (std::size_t i=0;i 0 && ri.ev() == ev_001) { + if (!z_gen[0].is_valid()) n_gen++; + z_gen[0] = work_sg.smx(i); + } + } + else if (absolute(ri.type()) == 2) { + if (!z_gen[0].is_valid() && ri.ev() == ev_001) { + z_gen[0] = work_sg.smx(i); n_gen++; + } + } + else if (absolute(ri.type()) == 3) { + if (ri.sense() > 0 && ri.ev() == ev_111) { + CCTBX_ASSERT(!z_gen[1].is_valid()); + z_gen[1] = work_sg.smx(i); n_gen++; + } + } + } + CCTBX_ASSERT(n_gen == 1 || n_gen == 2); + for (std::size_t i=0;i +#include +#include +#include +#include + +namespace cctbx { namespace sgtbx { + + void + space_group::reset(int t_den) + { + n_lsl_ = 1; + n_ssl_ = 1; + f_inv_ = 1; + ltr_.reset(t_den); + inv_t_ = tr_vec(0); + smx_.clear(); + smx_.push_back(rt_mx(1, t_den)); + is_tidy_ = false; + } + + void + space_group::add_inv(tr_vec const& new_inv_t) + { + if (is_centric()) { + if (ltr_.add(inv_t_ - new_inv_t)) is_tidy_ = false; + return; + } + inv_t_ = new_inv_t.mod_positive(); + f_inv_ = 2; + is_tidy_ = false; + if (!no_expand_) { + for(std::size_t i=1;i= smx_.capacity() || (d != -1 && d != 1)) + throw error_non_crystallographic_rotation_matrix_encountered(); + CCTBX_ASSERT(new_smx.t().den() == smx_[0].t().den()); + smx_.push_back(new_smx.mod_positive()); + rt_mx const& s = smx_.back(); + if (!no_expand_ && is_centric()) { + ltr_.add( s.r() * inv_t_ + + 2 * s.t() - inv_t_); + } + is_tidy_ = false; + } + + space_group& + space_group::expand_ltr(tr_vec const& new_ltr) + { + if (no_expand_) { + if (ltr_.add(new_ltr)) is_tidy_ = false; + return *this; + } + for (std::size_t i_smx=n_ssl_;i_smx i) { + i++; + j = 1; + } + if (i == ltr_.size()) break; + trial_ltr = ltr_[j] + ltr_[i]; + j++; + } + return *this; + } + + space_group& + space_group::expand_inv(tr_vec const& new_inv_t) + { + add_inv(new_inv_t); + expand_ltr(tr_vec(0)); + return *this; + } + + space_group& + space_group::expand_smx(rt_mx const& new_smx) + { + if (new_smx.r().den() != 1) { + throw error( + "sgtbx::space_group::expand_smx():" + " rotation-part denominator must be 1 (implementation limitation)."); + } + if (new_smx.t().den() != smx_[0].t().den()) { + throw error( + "sgtbx::space_group::expand_smx():" + " incompatible translation-part denominator."); + } + if (no_expand_) { + add_smx(new_smx); + return *this; + } + const rt_mx *pnew_smx = &new_smx; // XXX avoid pointer stuff + rt_mx trial_smx; + std::size_t i = n_smx(); + std::size_t j = 1; + for (;;) { + add_smx(*pnew_smx); + if (j > i) { + i++; + j = 1; + } + if (i == n_smx()) break; + trial_smx = smx_[j] * smx_[i]; + pnew_smx = &trial_smx; + j++; + } + expand_ltr(tr_vec(0)); + return *this; + } + + std::size_t + space_group::expand_conventional_centring_type(char symbol) + { + using namespace lattice_tr::conventional_centring_types; + const table_entry *e = get(symbol); + if (e == 0) { + throw error("Illegal symbol for centring type of cell."); + } + for(std::size_t i=0;in_translations;i++) { + expand_ltr(e->t[i].new_denominator(t_den())); + } + return e->n_translations; + } + + rt_mx + space_group::operator()( + std::size_t i_ltr, + std::size_t i_inv, + std::size_t i_smx) const + { + if ( i_ltr >= ltr_.size() + || i_inv >= f_inv_ + || i_smx >= n_smx()) { + throw error_index(); + } + if (i_inv == 0) return smx_[i_smx] + ltr_[i_ltr]; + return -smx_[i_smx] + inv_t_ + ltr_[i_ltr]; + } + + rt_mx + space_group::operator()(std::size_t i_op) const + { + // i_op = ((i_ltr * f_inv()) + i_inv) * n_smx() + i_smx + if (i_op >= order_z()) { + throw error_index(); + } + std::size_t i_smx = i_op % n_smx(); + std::size_t i_inv = (i_op / n_smx()) % f_inv_; + std::size_t i_ltr = i_op / (f_inv_ * n_smx()); + return operator()(i_ltr, i_inv, i_smx); + } + + bool + space_group::contains(rt_mx const& smx) const + { + CCTBX_ASSERT(smx.r().den() == r_den()); + CCTBX_ASSERT(smx.t().den() == t_den()); + rot_mx const& r = smx.r(); + for(std::size_t i=0;i absolute(b[i])) return false; + return true; + } + } + return true; + } + + af::shared + build_list_tot_tr(tr_group const& ltr, int t_den) + { + af::shared tlt; + for (std::size_t i_ltr=1;i_ltr + + change_of_basis_op + space_group::construct_z2p_op(int r_den, int t_den) const + { + change_of_basis_op result; + space_group primitive_sg(false, this->t_den()); + const int r_den_3 = r_den * r_den * r_den; + af::shared tlt = build_list_tot_tr(ltr_, r_den); + std::size_t i_tlt[3]; + sg_mat3 basis; + for (i_tlt[0] = 0; i_tlt[0] < tlt.size() - 2; i_tlt[0]++) { + basis.set_column(0, tlt[i_tlt[0]].num()); + for (i_tlt[1] = i_tlt[0] + 1; i_tlt[1] < tlt.size() - 1; i_tlt[1]++) { + basis.set_column(1, tlt[i_tlt[1]].num()); + for (i_tlt[2] = i_tlt[1] + 1; i_tlt[2] < tlt.size(); i_tlt[2]++) { + basis.set_column(2, tlt[i_tlt[2]].num()); + int f = basis.determinant() * n_ltr(); + if (f == r_den_3 || -f == r_den_3) { + if (f < 0) for(std::size_t i=0;i<3;i++) basis[i * 3] *= -1; + try { + result = change_of_basis_op( + rt_mx(rot_mx(basis, r_den), t_den)).inverse(); + primitive_sg = change_basis(result); + } + catch (error const&) { + continue; + } + if (primitive_sg.n_ltr() == 1) { + CCTBX_ASSERT( + result.c().r().num().determinant() == n_ltr() * r_den_3); + return result; + } + } + }}} + throw CCTBX_INTERNAL_ERROR(); + } + + change_of_basis_op + space_group::z2p_op(int r_den, int t_den) const + { + change_of_basis_op cb_op = ltr_.conventional_z2p_op(r_den, t_den); + if (cb_op.is_valid()) return cb_op; + return construct_z2p_op(r_den, t_den); + } + + std::map + space_group::count_rotation_part_types() const + { + std::map result; + for(std::size_t i=0;i counter = count_rotation_part_types(); + + if (counter[-3] + counter[3] == 8) { + if (n_smx() == 12) { + if (!is_centric()) return code_23; + else return code_m3b; + } + else if (n_smx() == 24) { + if (!is_centric()) { + if (counter[ 4] == 6) return code_432; + if (counter[-4] == 6) return code_4b3m; + } + else return code_m3bm; + } + } + else if (counter[-6] + counter[6] == 2) { + if (n_smx() == 6) { + if (!is_centric()) { + if (counter[ 6] == 2) return code_6; + if (counter[-6] == 2) return code_6b; + } + else return code_6_m; + } + else if (n_smx() == 12) { + if (!is_centric()) { + if (counter[ 6] == 2) { + if (counter[ 2] == 7) return code_622; + if (counter[-2] == 6) return code_6mm; + } + else if (counter[-6] == 2) return code_6bm2; + } + else return code_6_mmm; + } + } + else if (counter[-3] + counter[3] == 2) { + if (n_smx() == 3) { + if (!is_centric()) return code_3; + else return code_3b; + } + else if (n_smx() == 6) { + if (!is_centric()) { + if (counter[ 2] == 3) return code_32; + if (counter[-2] == 3) return code_3m; + } + else return code_3bm; + } + } + else if (counter[-4] + counter[4] == 2) { + if (n_smx() == 4) { + if (!is_centric()) { + if (counter[ 4] == 2) return code_4; + if (counter[-4] == 2) return code_4b; + } + else return code_4_m; + } + else if (n_smx() == 8) { + if (!is_centric()) { + if (counter[ 4] == 2) { + if (counter[ 2] == 5) return code_422; + if (counter[-2] == 4) return code_4mm; + } + else if (counter[-4] == 2) return code_4bm2; + } + else return code_4_mmm; + } + } + else if (counter[-2] + counter[2] == 3) { + if (!is_centric()) { + if (counter[ 2] == 3) return code_222; + if (counter[-2] == 2) return code_mm2; + } + else return code_mmm; + } + else if (counter[-2] + counter[2] == 1) { + if (!is_centric()) { + if (counter[ 2] == 1) return code_2; + if (counter[-2] == 1) return code_m; + } + else return code_2_m; + } + else if (n_smx() == 1) { + if (!is_centric()) return code_1; + else return code_1b; + } + + throw CCTBX_INTERNAL_ERROR(); + } + + namespace { + + struct cmp_ltr + { + bool operator()(tr_vec const& a, tr_vec const& b) + { + for(std::size_t i=0;i<3;i++) { + if (a[i] < b[i]) return true; + if (a[i] > b[i]) return false; + } + return false; + } + }; + + struct cmp_smx + { + bool operator()(rt_mx const& a, rt_mx const& b) + { + using scitbx::fn::absolute; + using utils::cmp_i_vec; + bool cmp_as_symop = ( + a.r().den() == 1 + && b.r().den() == 1 + && a.r().type() != 0 + && b.r().type() != 0); + if (cmp_as_symop) { + rot_mx_info ri_a; + rot_mx_info ri_b; + try { + ri_a = rot_mx_info(a.r()); + ri_b = rot_mx_info(b.r()); + } + catch(error const&) { + cmp_as_symop = false; + } + if (cmp_as_symop) { + if (absolute(ri_a.type()) > absolute(ri_b.type())) return true; + if (absolute(ri_a.type()) < absolute(ri_b.type())) return false; + if (ri_a.type() > ri_b.type()) return true; + if (ri_a.type() < ri_b.type()) return false; + if (cmp_i_vec(3)(ri_a.ev().begin(),ri_b.ev().begin())) return true; + if (cmp_i_vec(3)(ri_b.ev().begin(),ri_a.ev().begin())) return false; + if (ri_a.sense() > ri_b.sense()) return true; + if (ri_a.sense() < ri_b.sense()) return false; + } + } + if (!cmp_as_symop) { + int o = compare_rot_mx(a.r(), b.r()); + if (o < 0) return true; + if (o > 0) return false; + } + if (a.t().den() == b.t().den()) { + if (cmp_i_vec(3)( + a.t().num().begin(), b.t().num().begin())) return true; + if (cmp_i_vec(3)( + b.t().num().begin(), a.t().num().begin())) return false; + } + else { + int den_lcm = boost::lcm(a.t().den(), b.t().den()); + tr_vec al = a.t().new_denominator(den_lcm); + tr_vec bl = b.t().new_denominator(den_lcm); + if (cmp_i_vec(3)( + al.num().begin(), bl.num().begin())) return true; + if (cmp_i_vec(3)( + bl.num().begin(), al.num().begin())) return false; + } + if (cmp_as_symop) { + int o = compare_rot_mx(a.r(), b.r()); + if (o < 0) return true; + if (o > 0) return false; + } + if (a.t().den() == b.t().den()) { + for(std::size_t i=0;i<3;i++) { + if (a.t()[i] < b.t()[i]) return true; + if (a.t()[i] > b.t()[i]) return false; + } + } + else { + int den_lcm = boost::lcm(a.t().den(), b.t().den()); + tr_vec al = a.t().new_denominator(den_lcm); + tr_vec bl = b.t().new_denominator(den_lcm); + for(std::size_t i=0;i<3;i++) { + if (al[i] < bl[i]) return true; + if (al[i] > bl[i]) return false; + } + } + return false; + } + + int + compare_rot_mx( + rot_mx const& a, + rot_mx const& b) + { + if (a.den() == b.den()) { + for(std::size_t i=0;i<9;i++) { + if (a[i] < b[i]) return -1; + if (a[i] > b[i]) return 1; + } + } + else { + int den_lcm = boost::lcm(a.den(), b.den()); + rot_mx al = a.new_denominator(den_lcm); + rot_mx bl = b.new_denominator(den_lcm); + for(std::size_t i=0;i<9;i++) { + if (al[i] < bl[i]) return -1; + if (al[i] > bl[i]) return 1; + } + } + return 0; + } + }; + + } // namespace + + bool + rt_mx::operator<(rt_mx const& rhs) const + { + return cmp_smx()(*this, rhs); + } + + bool + rt_mx::operator>(rt_mx const& rhs) const + { + return cmp_smx()(rhs, *this); + } + + space_group& + space_group::make_tidy() + { + if (is_tidy_) return *this; + if (is_centric()) { + inv_t_ = inv_t(true); + for (std::size_t i=1;i 2) + std::sort(ltr_.elems_.begin() + 1, ltr_.elems_.end(), cmp_ltr()); + if (n_smx() > 2) + std::sort(smx_.begin() + 1, smx_.begin() + n_smx(), cmp_smx()); + is_tidy_ = true; + return *this; + } + + space_group + space_group::change_basis(const change_of_basis_op& cb_op) const + { + space_group result(no_expand_, t_den()); + result.ltr_ = ltr_.change_basis(cb_op); + if (is_centric()) { + result.expand_inv(cb_op(inv_t_, -1)); + } + for (std::size_t i=1;i + space_group::all_ops(int mod, bool cancel) const + { + af::shared result((af::reserve(order_z()))); + for(std::size_t i=0;i 0) s.mod_positive_in_place(); + else if (mod < 0) s.mod_short_in_place(); + result.push_back(s); + } + return result; + } + + af::shared + space_group::unique(rt_mx const& special_op) const + { + if (special_op.is_unit_mx()) return all_ops(1, true); + af::shared result; + for(std::size_t i=0;i + space_group::nearest_valid_phases( + af::const_ref > const& miller_indices, + af::const_ref const& phases, + bool deg) const + { + CCTBX_ASSERT(phases.size() == miller_indices.size()); + af::shared result((af::reserve(miller_indices.size()))); + for(std::size_t i=0;i +#if !defined(CCTBX_SGTBX_PHASE_INFO_APPLE_LLVM2335_WORKAROUND) + const& +#endif + h = miller_indices[i]; + result.push_back( + phase_restriction(h).nearest_valid_phase(phases[i], deg)); + } + return result; + } + + int + space_group::multiplicity( + vec3_rat const& site) const + { + int result = 0; + vec3_rat pivot = site; + ltr_.find_best_equiv_in_place(pivot); + for(unsigned i=0;i +#include +#include +#include +#include +#include +#include +#include +#include + +namespace cctbx { namespace sgtbx { + + namespace construct_cb_op_r { + namespace { + + matrix_group::code + get_matrix_group_type(space_group const& std_sg, + matrix_group::code const& point_group) + { + using namespace matrix_group; + + bool two_fold = false; + bool mirror = false; + + if ( point_group == code_4bm2 + || point_group == code_6bm2) { + two_fold = true; + } + else if (std_sg.n_ltr() == 1) { + if (point_group == code_32) two_fold = true; + else if (point_group == code_3m) mirror = true; + else if (point_group == code_3bm) two_fold = mirror = true; + } + + if (!(two_fold || mirror)) return point_group; + + for(std::size_t i_smx=1;i_smx= 0) { + bool use_this_smx = true; + for (std::size_t j_wtd=0;j_wtd= absolute(r_type)) { + use_this_smx = false; + } + else { + r[j_wtd] = rot_mx(0); + n_found--; + restart = true; + } + break; + } + } + if (use_this_smx) { + ord[i_wtd] = r_type; + r[i_wtd] = raw_sg.smx(i_smx).r(); + n_found++; + if (n_found == n_wtd) + return; + } + } + break; + } + } + } + if (!restart) break; + } + throw CCTBX_INTERNAL_ERROR(); + } + + rot_mx basis_builder::uni_axial_basis() + { + using scitbx::fn::absolute; + if (ord[0] < 0) { + ord[0] *= -1; + r[0] *= -1; + ri[0] = r[0].info(); + } + rot_mx cum_mx = r[0].accumulate(ord[0]); + af::ref re_mx(cum_mx.num().begin(), 3, 3); + CCTBX_ASSERT(scitbx::matrix::row_echelon::form(re_mx) == 1); + af::tiny sol = row_echelon::solve::homog_rank_1(re_mx); + std::size_t n_ix = 1; if (ord[0] == 2) n_ix++; + rot_mx trial_basis; + trial_basis.num().set_column(2, ri[0].ev()); + int min_det = 0; + rot_mx result; + for (math::loop_n_from_m<2> ix(4, n_ix); !ix.over(); ix.incr()) { + for(std::size_t i=0;i absolute(det))) { + min_det = det; + result = trial_basis; + } + } + CCTBX_ASSERT(min_det != 0); + if (min_det < 0) result.num().swap_columns(0, 1); + return result; + } + + rot_mx basis_builder::two_axial_basis() + { + rot_mx result; + result.num().set_column(0, ri[1].ev()); + if (xtal_system == crystal_system::cubic) { + for(std::size_t i=0;i<2;i++) { + result.num().set_column(i + 1, r[0] * result.num().get_column(i)); + } + if (result.num().determinant() < 0) result.num().swap_columns(0, 1); + } + else { + result.num().set_column(2, ri[0].ev()); + if (n_wtd == 3) { + result.num().set_column(1, ri[2].ev()); + if (result.num().determinant() < 0) result.num().swap_columns(0, 1); + } + else { + if (ord[0] > 0) { + result.num().set_column(1, r[0] * result.num().get_column(0)); + } + else { + result.num().set_column(1, -r[0] * result.num().get_column(0)); + } + CCTBX_ASSERT(result.num().determinant() > 0); + } + } + return result; + } + + rot_mx std_basis(space_group const& raw_sg, matrix_group::code const& mgc) + { + basis_builder bb(mgc.laue_group_type()); + if (bb.n_wtd == 0) return rot_mx(); + bb.pick_eigen_vectors(raw_sg); + if (bb.n_wtd == 1) return bb.uni_axial_basis(); + return bb.two_axial_basis(); + } + + bool is_m3b_100_glide(space_group const& work_sg) + { + using scitbx::fn::absolute; + CCTBX_ASSERT(work_sg.is_centric()); + for (std::size_t i_smx=1;i_smx unique b + return rot_mx( 0, 1, 0, + 0, 0, 1, + 1, 0, 0, 1); + } + if ((laue_group == code_4_m || laue_group == code_4_mmm) && Z == 'C') { + // C -> P + return rot_mx( 1, 1, 0, + 1, -1, 0, + 0, 0, -1, 1); + } + if ((laue_group == code_4_m || laue_group == code_4_mmm) && Z == 'F') { + // F -> I + return rot_mx( 1, 1, 0, + -1, 1, 0, + 0, 0, 1, 1); + } + if ((laue_group == code_3b || laue_group == code_3bm) && Z == 'Q') { + // reverse -> obverse + return rot_mx( -1, 0, 0, + 0, -1, 0, + 0, 0, 1, 1); + } + if ((laue_group == code_3bm || laue_group == code_6_mmm) && Z == 'H') { + // H -> P + return rot_mx( 1, 1, 0, + -1, 2, 0, + 0, 0, 1, 1); + } + return rot_mx(0); + } + + } // namespace + } // namespace construct_cb_op_r + + namespace construct_cb_op_t { + namespace { + + bool solve_inhomog_mod_z(int *m, std::size_t nr, std::size_t nc, + int *b, int den, + int *x) + { + const std::size_t maxr = 9; + const std::size_t maxc = 6; + + CCTBX_ASSERT(nr <= maxr); + CCTBX_ASSERT(nc <= maxc); + + int p[maxr * maxr]; + int q[maxc * maxc]; + af::ref m_ref(m, nr, nc); + af::ref p_ref(p, nr, nr); + af::ref q_ref(q, nc, nc); + smith_normal_form(m_ref, p_ref, q_ref); + CCTBX_ASSERT(m_ref.is_square()); + std::size_t nd = m_ref.n_rows(); + CCTBX_ASSERT(nd <= nc); + + int pb[maxr]; + scitbx::matrix::multiply(p, b, nr, nr, 1, pb); + for(std::size_t i=nd;i S=-RK+T+K=-(R-I)K+T + => S=-(R-I)K+T + => (R-I)K=T-S + => (R-I)^-1(T-S)=K + */ + + rot_mx rmi[3]; + tr_vec delta_t[3]; + for(std::size_t i=0;i nb) return true; + if (na < nb) return false; + + na = 0; for(size_t i=0;i<9;i++) if (absolute(ar[i])==ar.den()) na++; + nb = 0; for(size_t i=0;i<9;i++) if (absolute(br[i])==br.den()) nb++; + if (na > nb) return true; + if (na < nb) return false; + + na = 0; for(size_t i=0;i<9;i++) if (ar[i] > 0) na++; + nb = 0; for(size_t i=0;i<9;i++) if (br[i] > 0) nb++; + if (na > nb) return true; + if (na < nb) return false; + + if (cmp_t_(at.num().begin(), bt.num().begin())) return true; + if (cmp_t_(bt.num().begin(), at.num().begin())) return false; + + return cmp_r_(br.num().begin(), ar.num().begin()); + } + private: + const utils::cmp_i_vec cmp_r_; + const utils::cmp_i_vec cmp_t_; + }; + + /* Uses affine normalizer operations to find the "best" + change-of-basis matrix. + For a given space group representation the resulting + change-of-basis matrix should always be identical, + independent of the order of symmetry operations + and indepenent of the raw_cb_op. + */ + change_of_basis_op + find_best_cb_op( + space_group const& given_sg, + matrix_group::code const& point_group, + int sg_number, + change_of_basis_op const& reference_cb_op, + space_group const& target_sg, + select_generators::standard const& target_generators, + change_of_basis_op const& raw_cb_op) + { + af::shared + addl_g = reference_settings::normalizer::get_addl_generators( + sg_number, true, true, true); + change_of_basis_op cb_op = reference_cb_op.inverse(); + space_group norm_sg = target_sg; + std::size_t old_order_p = norm_sg.order_p(); + for(std::size_t i=0;i 15) { + tidy_cb_op_t(target_generators, given_sg, point_group, trial_cb_op); + if (!cmp_cb_mx(best_cb_op.select(cmp_inv), + trial_cb_op.select(cmp_inv))) { + best_cb_op = trial_cb_op; + } + } + else { + int r_den = raw_cb_op.c().r().den(); + int t_den = raw_cb_op.c().t().den(); + int r00, r22; + reference_settings::normalizer::get_monoclinic_affine_trial_ranges( + trial_cb_op.c().r(), r00, r22); + sg_mat3 r, r_inv; + r.fill(0); + r_inv.fill(0); +#define loop(i, rxx) \ + for (r[i] = -rxx * r_den; r[i] <= rxx * r_den; r[i] += r_den) + loop(0, r00) + loop(2, r22) + loop(6, r00) + loop(8, r22) { +#undef loop + if (!reference_settings::normalizer + ::check_monoclinic_affine_restrictions( + sg_number, rot_mx(r, r_den))) { + continue; + } + r[4] = r[0] * r[8] - r[2] * r[6]; + if ( r[4] != -r_den * r_den + && r[4] != r_den * r_den) continue; + r[4] /= r_den; + int f = r[4] / r_den; + r_inv[0] = f * r[8]; + r_inv[2] = -f * r[2]; + r_inv[4] = r[4]; + r_inv[6] = -f * r[6]; + r_inv[8] = f * r[0]; + change_of_basis_op r_trial_cb_op = change_of_basis_op( + rt_mx(rot_mx(r, r_den), t_den), + rt_mx(rot_mx(r_inv, r_den), t_den)) * trial_cb_op; + tidy_cb_op_t( + target_generators, given_sg, point_group, r_trial_cb_op); + if (!cmp_cb_mx(best_cb_op.select(cmp_inv), + r_trial_cb_op.select(cmp_inv))) { + best_cb_op = r_trial_cb_op; + } + } + } + } + return best_cb_op; + } + + } // namespace + } // namespace construct_cb_op_t + + space_group_type::space_group_type( + space_group const& group, + bool tidy_cb_op, + int r_den, int t_den) + : + group_(group), + number_(0), + cb_op_(r_den, t_den), + cb_op_is_tidy_(tidy_cb_op) + { + matrix_group::code point_group = group_.point_group_type(); + matrix_group::code laue_group = point_group.laue_group_type(); + crystal_system::code xtal_system = point_group.crystal_system(); + + space_group z_point_group_sg = group_.build_derived_group(false, false); + space_group work_sg = z_point_group_sg; + char centring_type = '\0'; + std::size_t run_away_counter = 0; + + do // align the point group operations + { + CCTBX_ASSERT(run_away_counter++ < 10); + + change_of_basis_op addl_cb_op = work_sg.z2p_op(r_den, t_den); + cb_op_.update(addl_cb_op); + work_sg = z_point_group_sg.change_basis(cb_op_); + CCTBX_ASSERT(work_sg.n_ltr() == 1); + + rot_mx std_basis = construct_cb_op_r::std_basis(work_sg, laue_group); + std_basis = std_basis.new_denominator(r_den); + addl_cb_op = change_of_basis_op(rt_mx(std_basis, t_den)).inverse(); + cb_op_.update(addl_cb_op); + work_sg = z_point_group_sg.change_basis(cb_op_); + centring_type = work_sg.ltr().conventional_centring_type_symbol(); + + rot_mx adj_rmx = construct_cb_op_r::get_adj_rmx( + laue_group, centring_type); + if (adj_rmx.is_valid()) { + adj_rmx = adj_rmx.new_denominator(r_den); + addl_cb_op = change_of_basis_op(rt_mx(adj_rmx, t_den)); + cb_op_.update(addl_cb_op); + work_sg = z_point_group_sg.change_basis(cb_op_); + centring_type = work_sg.ltr().conventional_centring_type_symbol(); + } + } + while (centring_type == '\0'); + CCTBX_ASSERT(centring_type != 'Q'); + + // transform original symmetry operations + work_sg = group_.change_basis(cb_op_); + + if ( point_group == matrix_group::code_m3b + && centring_type == 'P' + && construct_cb_op_r::is_m3b_100_glide(work_sg)) { + // rotate by 90 degree (4 [0 0 1]) + rot_mx r_4_001( 0, -1, 0, + 1, 0, 0, + 0, 0, 1, 1); + change_of_basis_op addl_cb_op( + rt_mx(r_4_001.new_denominator(r_den), t_den)); + cb_op_.update(addl_cb_op); + work_sg = group_.change_basis(cb_op_); + } + + matrix_group::code + mx_group = construct_cb_op_r::get_matrix_group_type( + work_sg, point_group); + CCTBX_ASSERT(point_group == mx_group.point_group_type()); + + bool match_centring_type_symbol = ( + xtal_system != crystal_system::monoclinic + && ( xtal_system != crystal_system::orthorhombic + || (centring_type == 'I' || centring_type == 'F'))); + + for (number_=1;number_<=230;number_++) + { + const char* + hall_symbol = reference_settings::hall_symbol_table(number_); + + if (match_centring_type_symbol && centring_type != hall_symbol[1]) + continue; + + if ((centring_type == 'P') != (hall_symbol[1] == 'P')) + continue; + + if (reference_settings::matrix_group_code_table(number_) != mx_group) + continue; + + space_group tab_sg; + try { + tab_sg = space_group(hall_symbol, true, false, false, work_sg.t_den()); + } + catch (error const&) { + throw CCTBX_INTERNAL_ERROR(); + } + + if (tab_sg.n_ltr() != work_sg.n_ltr()) + continue; + + select_generators::standard tab_generators( + tab_sg, r_den, t_den, point_group); + tab_generators.set_primitive(); + change_of_basis_op addl_cb_op = construct_cb_op_t::match_generators( + r_den, t_den, work_sg, point_group, hall_symbol[1], tab_generators); + if (addl_cb_op.is_valid()) { + cb_op_.update(addl_cb_op); + if (tidy_cb_op) { + cb_op_ = construct_cb_op_t::find_best_cb_op( + group_, point_group, number_, + change_of_basis_op(r_den, t_den), tab_sg, tab_generators, cb_op_); + } + return; + } + } + throw CCTBX_INTERNAL_ERROR(); + } + + std::string + space_group_type::hall_symbol(bool tidy_cb_op) const + { + if (tidy_cb_op) { + if (hall_symbol_tidy_true_.size()) return hall_symbol_tidy_true_; + } + else { + if (hall_symbol_tidy_false_.size()) return hall_symbol_tidy_false_; + } + std::string hall_symbol(reference_settings::hall_symbol_table(number_)); + parse_string ps(hall_symbol); + space_group target_sg(false, group_.t_den()); + change_of_basis_op reference_cb_op = cb_op_.identity_op(); + target_sg.parse_hall_symbol_cb_op(ps, reference_cb_op, true); + change_of_basis_op cb_op = reference_cb_op; + if (cb_op.is_valid()) { + cb_op = cb_op.inverse() * cb_op_; + } + else { + cb_op = cb_op_; + } + if (tidy_cb_op) { + matrix_group::code point_group = target_sg.point_group_type(); + select_generators::standard target_generators( + target_sg, + cb_op.c().r().den(), + cb_op.c().t().den(), + point_group); + target_generators.set_primitive(); + cb_op = construct_cb_op_t::find_best_cb_op( + group_, point_group, number_, + reference_cb_op, target_sg, target_generators, cb_op); + } + + std::string::size_type par = hall_symbol.find(" ("); + if (par != std::string::npos) { + hall_symbol.resize(par); + } + + if (!cb_op.is_identity_op()) { + hall_symbol += " (" + cb_op.c_inv().mod_short().as_xyz() + ")"; + } + + if (tidy_cb_op) { + hall_symbol_tidy_true_ = hall_symbol; + } + else { + hall_symbol_tidy_false_ = hall_symbol; + } + + return hall_symbol; + } + + namespace { + + std::string + uhm_reference_symbol(std::size_t space_group_number) + { + std::string result( + reference_settings::hermann_mauguin_symbol_table(space_group_number)); + std::size_t i = result.size(); + if (i > 1) { + i--; + std::size_t j = i--; + if (result[i] == ':' && result[j] == 'h') result[j] = 'H'; + } + return result; + } + + std::string + uhm_change_of_basis_symbol(change_of_basis_op const& cb_op) + { + return " (" + cb_op.inverse().mod_short().symbol() + ")"; + } + + } + + std::string + space_group_type::universal_hermann_mauguin_symbol(bool tidy_cb_op) const + { + if (tidy_cb_op) { + if (uhm_symbol_tidy_true_.size() == 0) { + uhm_symbol_tidy_true_ = uhm_reference_symbol(number_); + if (!cb_op_.is_identity_op()) { + if (cb_op_is_tidy_) { + uhm_symbol_tidy_true_ += uhm_change_of_basis_symbol(cb_op_); + } + else { + space_group tab_sg( + reference_settings::hall_symbol_table(number_), + true, false, false, group_.t_den()); + matrix_group::code point_group = tab_sg.point_group_type(); + select_generators::standard target_generators( + tab_sg, + cb_op_.c().r().den(), + cb_op_.c().t().den(), + point_group); + target_generators.set_primitive(); + change_of_basis_op cb_op = construct_cb_op_t::find_best_cb_op( + group_, point_group, number_, + cb_op_.identity_op(), tab_sg, target_generators, cb_op_); + if (!cb_op.is_identity_op()) { + uhm_symbol_tidy_true_ += uhm_change_of_basis_symbol(cb_op); + } + } + } + } + return uhm_symbol_tidy_true_; + } + else { + if (uhm_symbol_tidy_false_.size() == 0) { + uhm_symbol_tidy_false_ = uhm_reference_symbol(number_); + if (!cb_op_.is_identity_op()) { + uhm_symbol_tidy_false_ += uhm_change_of_basis_symbol(cb_op_); + } + } + return uhm_symbol_tidy_false_; + } + } + + std::string + space_group_type::lookup_symbol( + bool ad_hoc_1992) const + { + // simlar table in symbols.cpp, ad_hoc_1992_symbol_as_a1983_symbol() + static char const* adh_a38_pairs[] = { + // No. 39 + "A e m 2", "A b m 2", + "B m e 2", "B m a 2", + "B 2 e m", "B 2 c m", + "C 2 m e", "C 2 m b", + "C m 2 e", "C m 2 a", + "A e 2 m", "A c 2 m", + // No. 41 + "A e a 2", "A b a 2", + "B b e 2", "B b a 2", + "B 2 e b", "B 2 c b", + "C 2 c e", "C 2 c b", + "C c 2 e", "C c 2 a", + "A e 2 a", "A c 2 a", + // No. 64 + "C m c e", "C m c a", + "C c m e", "C c m b", + "A e m a", "A b m a", + "A e a m", "A c a m", + "B b e m", "B b c m", + "B m e b", "B m a b", + // No. 67 + "C m m e", "C m m a", // ambiguous: Cmmb + "A e m m", "A b m m", // ambiguous: Acmm + "B m e m", "B m c m", // ambiguous: Bmam + // No. 68 + "C c c e", "C c c a", // ambiguous: Cccb + "A e a a", "A b a a", // ambiguous: Acaa + "B b e b", "B b c b" // ambiguous: Bbab + }; + if (!lookup_symbol_.size()) { + space_group_symbols symbols = group_.match_tabulated_settings(); + if (symbols.number() != 0) { + lookup_symbol_ = symbols.universal_hermann_mauguin(); + } + else { + lookup_symbol_ = universal_hermann_mauguin_symbol(); + } + } + if ( ad_hoc_1992 + && lookup_symbol_.size() >= 7 + && (lookup_symbol_.size() == 7 || lookup_symbol_[7] == ' ')) { + for(int i=0;i<48;i+=2) { + if (std::strncmp(lookup_symbol_.data(), adh_a38_pairs[i+1], 7) == 0) { + std::string result = lookup_symbol_; + for(int j=0;j<7;j++) { + result[j] = adh_a38_pairs[i][j]; + } + return result; + } + } + } + return lookup_symbol_; + } + + space_group_type + space_group::type() const + { + return space_group_type(*this); + } + + space_group_type::space_group_type( + std::string const& symbol, + std::string const& table_id, + bool tidy_cb_op) + { + *this = space_group_type( + space_group(space_group_symbols(symbol, table_id)), + tidy_cb_op); + } + + af::shared + space_group_type::addl_generators_of_euclidean_normalizer( + bool flag_k2l, + bool flag_l2n) const + { + af::shared + result = reference_settings::normalizer::get_addl_generators( + number_, false, flag_k2l, flag_l2n); + change_of_basis_op cb_op_inv = cb_op_.inverse(); + for(std::size_t i=0;i + addl_g = reference_settings::normalizer::get_addl_generators( + number_, false, true, false); + if (addl_g.size() == 1) return false; + CCTBX_ASSERT(addl_g.size() == 0); + return true; + } + + bool + space_group_type::is_symmorphic() const + { + static const char tab[] = { + 0,1,1,1,0,1,1,0,1,0,1,0,1,0,0,0,1,0,0,0,0,1,1,1,0,1,0,0,0,0,0,0,0,0,0,1, + 0,0,1,0,0,0,1,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,1, + 0,0,0,1,0,0,0,1,0,1,1,1,0,0,0,1,0,1,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,1, + 0,0,0,1,0,0,0,1,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1, + 0,0,1,1,1,1,1,0,0,0,0,1,1,1,0,0,1,0,1,0,1,0,1,0,1,0,0,0,0,0,1,1,0,1,0,0, + 0,0,0,1,0,0,0,1,0,1,0,1,0,0,0,1,1,1,0,0,1,0,1,0,1,0,0,1,0,1,0,1,0,0,0,1, + 1,1,0,0,0,1,0,0,0,1,0,0,0,1,0}; + return (tab[number_] != tab[0]); + } + + change_of_basis_op + space_group_type::change_of_hand_op() const + { + if (group_.is_centric()) return change_of_basis_op(1, group_.t_den()); + af::shared + addl_g = addl_generators_of_euclidean_normalizer(true, false); + if (addl_g.size() == 1) return change_of_basis_op(addl_g[0]); + CCTBX_ASSERT(addl_g.size() == 0); + return change_of_basis_op( + cb_op_.inverse()(rt_mx(rot_mx(1, -1), group_.t_den()))); + } + +}} // namespace cctbx::sgtbx diff --git a/extern/cctbx/cctbx/sgtbx/symbols.cpp b/extern/cctbx/cctbx/sgtbx/symbols.cpp new file mode 100644 index 00000000..35654745 --- /dev/null +++ b/extern/cctbx/cctbx/sgtbx/symbols.cpp @@ -0,0 +1,1256 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using std::string; + +namespace cctbx { namespace sgtbx { + + namespace { + + static const char* not_recognized = "Space group symbol not recognized: "; + + inline + string + to_str(int value) + { + char buf[256]; + sprintf(buf, "%d", value); + return string(buf); + } + + } + + namespace symbols { namespace tables { + + static const char* monoclinic_sg_number_as_hm_list[][2] = { + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + /* 3 */ { "P121", "P112" }, + /* 4 */ { "P1211", "P1121" }, + /* 5 */ { "C121", "B112" }, + /* 6 */ { "P1m1", "P11m" }, + /* 7 */ { "P1c1", "P11b" }, + /* 8 */ { "C1m1", "B11m" }, + /* 9 */ { "C1c1", "B11b" }, + /* 10 */ { "P12/m1", "P112/m" }, + /* 11 */ { "P121/m1", "P1121/m" }, + /* 12 */ { "C12/m1", "B112/m" }, + /* 13 */ { "P12/c1", "P112/b" }, + /* 14 */ { "P121/c1", "P1121/b" }, + /* 15 */ { "C12/c1", "B112/b" }, + }; + + static const char* schoenflies_list[] = { +// BEGIN_COMPILED_IN_REFERENCE_DATA + 0, + "C1^1", "Ci^1", "C2^1", "C2^2", "C2^3", "Cs^1", "Cs^2", "Cs^3", + "Cs^4", "C2h^1", "C2h^2", "C2h^3", "C2h^4", "C2h^5", "C2h^6", + "D2^1", "D2^2", "D2^3", "D2^4", "D2^5", "D2^6", "D2^7", "D2^8", + "D2^9", "C2v^1", "C2v^2", "C2v^3", "C2v^4", "C2v^5", "C2v^6", + "C2v^7", "C2v^8", "C2v^9", "C2v^10", "C2v^11", "C2v^12", + "C2v^13", "C2v^14", "C2v^15", "C2v^16", "C2v^17", "C2v^18", + "C2v^19", "C2v^20", "C2v^21", "C2v^22", "D2h^1", "D2h^2", + "D2h^3", "D2h^4", "D2h^5", "D2h^6", "D2h^7", "D2h^8", "D2h^9", + "D2h^10", "D2h^11", "D2h^12", "D2h^13", "D2h^14", "D2h^15", + "D2h^16", "D2h^17", "D2h^18", "D2h^19", "D2h^20", "D2h^21", + "D2h^22", "D2h^23", "D2h^24", "D2h^25", "D2h^26", "D2h^27", + "D2h^28", "C4^1", "C4^2", "C4^3", "C4^4", "C4^5", "C4^6", + "S4^1", "S4^2", "C4h^1", "C4h^2", "C4h^3", "C4h^4", "C4h^5", + "C4h^6", "D4^1", "D4^2", "D4^3", "D4^4", "D4^5", "D4^6", + "D4^7", "D4^8", "D4^9", "D4^10", "C4v^1", "C4v^2", "C4v^3", + "C4v^4", "C4v^5", "C4v^6", "C4v^7", "C4v^8", "C4v^9", "C4v^10", + "C4v^11", "C4v^12", "D2d^1", "D2d^2", "D2d^3", "D2d^4", + "D2d^5", "D2d^6", "D2d^7", "D2d^8", "D2d^9", "D2d^10", + "D2d^11", "D2d^12", "D4h^1", "D4h^2", "D4h^3", "D4h^4", + "D4h^5", "D4h^6", "D4h^7", "D4h^8", "D4h^9", "D4h^10", + "D4h^11", "D4h^12", "D4h^13", "D4h^14", "D4h^15", "D4h^16", + "D4h^17", "D4h^18", "D4h^19", "D4h^20", "C3^1", "C3^2", "C3^3", + "C3^4", "C3i^1", "C3i^2", "D3^1", "D3^2", "D3^3", "D3^4", + "D3^5", "D3^6", "D3^7", "C3v^1", "C3v^2", "C3v^3", "C3v^4", + "C3v^5", "C3v^6", "D3d^1", "D3d^2", "D3d^3", "D3d^4", "D3d^5", + "D3d^6", "C6^1", "C6^2", "C6^3", "C6^4", "C6^5", "C6^6", + "C3h^1", "C6h^1", "C6h^2", "D6^1", "D6^2", "D6^3", "D6^4", + "D6^5", "D6^6", "C6v^1", "C6v^2", "C6v^3", "C6v^4", "D3h^1", + "D3h^2", "D3h^3", "D3h^4", "D6h^1", "D6h^2", "D6h^3", "D6h^4", + "T^1", "T^2", "T^3", "T^4", "T^5", "Th^1", "Th^2", "Th^3", + "Th^4", "Th^5", "Th^6", "Th^7", "O^1", "O^2", "O^3", "O^4", + "O^5", "O^6", "O^7", "O^8", "Td^1", "Td^2", "Td^3", "Td^4", + "Td^5", "Td^6", "Oh^1", "Oh^2", "Oh^3", "Oh^4", "Oh^5", "Oh^6", + "Oh^7", "Oh^8", "Oh^9", "Oh^10", +// END_COMPILED_IN_REFERENCE_DATA + }; + + struct short_mono_hm_dict_entry + { + const char *shrt; + const char *full; + }; + + static const short_mono_hm_dict_entry vol_i_short_mono_hm_dict[] = { + { "P2", "P112" }, + { "P21", "P1121" }, + { "B2", "B112" }, + { "C2", "C121" }, + { "Pm", "P11m" }, + { "Pb", "P11b" }, + { "Pc", "P1c1" }, + { "Bm", "B11m" }, + { "Cm", "C1m1" }, + { "Bb", "B11b" }, + { "Cc", "C1c1" }, + { "P2/m", "P112/m" }, + { "P21/m", "P1121/m" }, + { "B2/m", "B112/m" }, + { "C2/m", "C12/m1" }, + { "P2/b", "P112/b" }, + { "P2/c", "P12/c1" }, + { "P21/b", "P1121/b" }, + { "P21/c", "P121/c1" }, + { "B2/b", "B112/b" }, + { "C2/c", "C12/c1" }, + { 0, 0 }, + }; + + static const short_mono_hm_dict_entry vol_a_short_mono_hm_dict[] = { + { "P2", "P121" }, + { "P21", "P1211" }, + { "C2", "C121" }, + { "A2", "A121" }, + { "I2", "I121" }, + { "Pm", "P1m1" }, + { "Pc", "P1c1" }, + { "Pn", "P1n1" }, + { "Pa", "P1a1" }, + { "Cm", "C1m1" }, + { "Am", "A1m1" }, + { "Im", "I1m1" }, + { "Cc", "C1c1" }, + { "An", "A1n1" }, + { "Ia", "I1a1" }, + { "Aa", "A1a1" }, + { "Cn", "C1n1" }, + { "Ic", "I1c1" }, + { "P2/m", "P12/m1" }, + { "P21/m", "P121/m1" }, + { "C2/m", "C12/m1" }, + { "A2/m", "A12/m1" }, + { "I2/m", "I12/m1" }, + { "P2/c", "P12/c1" }, + { "P2/n", "P12/n1" }, + { "P2/a", "P12/a1" }, + { "P21/c", "P121/c1" }, + { "P21/n", "P121/n1" }, + { "P21/a", "P121/a1" }, + { "C2/c", "C12/c1" }, + { "A2/n", "A12/n1" }, + { "I2/a", "I12/a1" }, + { "A2/a", "A12/a1" }, + { "C2/n", "C12/n1" }, + { "I2/c", "I12/c1" }, + { 0, 0 }, + }; + + // Qualifiers + namespace qf { + static const char* a = "a"; + static const char* b = "b"; + static const char* c = "c"; + static const char* a1 = "a1"; + static const char* b1 = "b1"; + static const char* c1 = "c1"; + static const char* a2 = "a2"; + static const char* b2 = "b2"; + static const char* c2 = "c2"; + static const char* a3 = "a3"; + static const char* b3 = "b3"; + static const char* c3 = "c3"; + static const char* ma1 = "-a1"; + static const char* mb1 = "-b1"; + static const char* mc1 = "-c1"; + static const char* ma2 = "-a2"; + static const char* mb2 = "-b2"; + static const char* mc2 = "-c2"; + static const char* ma3 = "-a3"; + static const char* mb3 = "-b3"; + static const char* mc3 = "-c3"; + static const char* bamc = "ba-c"; + static const char* cab = "cab"; + static const char* mcba = "-cba"; + static const char* bca = "bca"; + static const char* amcb = "a-cb"; + } + + /* This table corresponds to a table in the + International Tables for Crystallography, Volume B, 2001. + The Hall symbols were generated with the + STARTX module of the Xtal System of Crystallographic Programs, + version 3.7 (http://xtal.crystal.uwa.edu.au/). + */ + static const main_symbol_dict_entry main_symbol_dict[] = { +// BEGIN_COMPILED_IN_REFERENCE_DATA + { 1, 0, "P 1", " P 1\0" }, + { 2, 0, "P -1", "-P 1\0" }, + { 3, qf::b, "P 1 2 1", " P 2y\0" }, + { 3, qf::c, "P 1 1 2", " P 2\0" }, + { 3, qf::a, "P 2 1 1", " P 2x\0" }, + { 4, qf::b, "P 1 21 1", " P 2yb\0" }, + { 4, qf::c, "P 1 1 21", " P 2c\0" }, + { 4, qf::a, "P 21 1 1", " P 2xa\0" }, + { 5, qf::b1, "C 1 2 1", " C 2y\0" }, + { 5, qf::b2, "A 1 2 1", " A 2y\0" }, + { 5, qf::b3, "I 1 2 1", " I 2y\0" }, + { 5, qf::c1, "A 1 1 2", " A 2\0" }, + { 5, qf::c2, "B 1 1 2", " B 2\0" }, + { 5, qf::c3, "I 1 1 2", " I 2\0" }, + { 5, qf::a1, "B 2 1 1", " B 2x\0" }, + { 5, qf::a2, "C 2 1 1", " C 2x\0" }, + { 5, qf::a3, "I 2 1 1", " I 2x\0" }, + { 6, qf::b, "P 1 m 1", " P -2y\0" }, + { 6, qf::c, "P 1 1 m", " P -2\0" }, + { 6, qf::a, "P m 1 1", " P -2x\0" }, + { 7, qf::b1, "P 1 c 1", " P -2yc\0" }, + { 7, qf::b2, "P 1 n 1", " P -2yac\0" }, + { 7, qf::b3, "P 1 a 1", " P -2ya\0" }, + { 7, qf::c1, "P 1 1 a", " P -2a\0" }, + { 7, qf::c2, "P 1 1 n", " P -2ab\0" }, + { 7, qf::c3, "P 1 1 b", " P -2b\0" }, + { 7, qf::a1, "P b 1 1", " P -2xb\0" }, + { 7, qf::a2, "P n 1 1", " P -2xbc\0" }, + { 7, qf::a3, "P c 1 1", " P -2xc\0" }, + { 8, qf::b1, "C 1 m 1", " C -2y\0" }, + { 8, qf::b2, "A 1 m 1", " A -2y\0" }, + { 8, qf::b3, "I 1 m 1", " I -2y\0" }, + { 8, qf::c1, "A 1 1 m", " A -2\0" }, + { 8, qf::c2, "B 1 1 m", " B -2\0" }, + { 8, qf::c3, "I 1 1 m", " I -2\0" }, + { 8, qf::a1, "B m 1 1", " B -2x\0" }, + { 8, qf::a2, "C m 1 1", " C -2x\0" }, + { 8, qf::a3, "I m 1 1", " I -2x\0" }, + { 9, qf::b1, "C 1 c 1", " C -2yc\0" }, + { 9, qf::b2, "A 1 n 1", " A -2yab\0" }, + { 9, qf::b3, "I 1 a 1", " I -2ya\0" }, + { 9, qf::mb1, "A 1 a 1", " A -2ya\0" }, + { 9, qf::mb2, "C 1 n 1", " C -2yac\0" }, + { 9, qf::mb3, "I 1 c 1", " I -2yc\0" }, + { 9, qf::c1, "A 1 1 a", " A -2a\0" }, + { 9, qf::c2, "B 1 1 n", " B -2ab\0" }, + { 9, qf::c3, "I 1 1 b", " I -2b\0" }, + { 9, qf::mc1, "B 1 1 b", " B -2b\0" }, + { 9, qf::mc2, "A 1 1 n", " A -2ab\0" }, + { 9, qf::mc3, "I 1 1 a", " I -2a\0" }, + { 9, qf::a1, "B b 1 1", " B -2xb\0" }, + { 9, qf::a2, "C n 1 1", " C -2xac\0" }, + { 9, qf::a3, "I c 1 1", " I -2xc\0" }, + { 9, qf::ma1, "C c 1 1", " C -2xc\0" }, + { 9, qf::ma2, "B n 1 1", " B -2xab\0" }, + { 9, qf::ma3, "I b 1 1", " I -2xb\0" }, + { 10, qf::b, "P 1 2/m 1", "-P 2y\0" }, + { 10, qf::c, "P 1 1 2/m", "-P 2\0" }, + { 10, qf::a, "P 2/m 1 1", "-P 2x\0" }, + { 11, qf::b, "P 1 21/m 1", "-P 2yb\0" }, + { 11, qf::c, "P 1 1 21/m", "-P 2c\0" }, + { 11, qf::a, "P 21/m 1 1", "-P 2xa\0" }, + { 12, qf::b1, "C 1 2/m 1", "-C 2y\0" }, + { 12, qf::b2, "A 1 2/m 1", "-A 2y\0" }, + { 12, qf::b3, "I 1 2/m 1", "-I 2y\0" }, + { 12, qf::c1, "A 1 1 2/m", "-A 2\0" }, + { 12, qf::c2, "B 1 1 2/m", "-B 2\0" }, + { 12, qf::c3, "I 1 1 2/m", "-I 2\0" }, + { 12, qf::a1, "B 2/m 1 1", "-B 2x\0" }, + { 12, qf::a2, "C 2/m 1 1", "-C 2x\0" }, + { 12, qf::a3, "I 2/m 1 1", "-I 2x\0" }, + { 13, qf::b1, "P 1 2/c 1", "-P 2yc\0" }, + { 13, qf::b2, "P 1 2/n 1", "-P 2yac\0" }, + { 13, qf::b3, "P 1 2/a 1", "-P 2ya\0" }, + { 13, qf::c1, "P 1 1 2/a", "-P 2a\0" }, + { 13, qf::c2, "P 1 1 2/n", "-P 2ab\0" }, + { 13, qf::c3, "P 1 1 2/b", "-P 2b\0" }, + { 13, qf::a1, "P 2/b 1 1", "-P 2xb\0" }, + { 13, qf::a2, "P 2/n 1 1", "-P 2xbc\0" }, + { 13, qf::a3, "P 2/c 1 1", "-P 2xc\0" }, + { 14, qf::b1, "P 1 21/c 1", "-P 2ybc\0" }, + { 14, qf::b2, "P 1 21/n 1", "-P 2yn\0" }, + { 14, qf::b3, "P 1 21/a 1", "-P 2yab\0" }, + { 14, qf::c1, "P 1 1 21/a", "-P 2ac\0" }, + { 14, qf::c2, "P 1 1 21/n", "-P 2n\0" }, + { 14, qf::c3, "P 1 1 21/b", "-P 2bc\0" }, + { 14, qf::a1, "P 21/b 1 1", "-P 2xab\0" }, + { 14, qf::a2, "P 21/n 1 1", "-P 2xn\0" }, + { 14, qf::a3, "P 21/c 1 1", "-P 2xac\0" }, + { 15, qf::b1, "C 1 2/c 1", "-C 2yc\0" }, + { 15, qf::b2, "A 1 2/n 1", "-A 2yab\0" }, + { 15, qf::b3, "I 1 2/a 1", "-I 2ya\0" }, + { 15, qf::mb1, "A 1 2/a 1", "-A 2ya\0" }, + { 15, qf::mb2, "C 1 2/n 1", "-C 2yac\0" }, + { 15, qf::mb3, "I 1 2/c 1", "-I 2yc\0" }, + { 15, qf::c1, "A 1 1 2/a", "-A 2a\0" }, + { 15, qf::c2, "B 1 1 2/n", "-B 2ab\0" }, + { 15, qf::c3, "I 1 1 2/b", "-I 2b\0" }, + { 15, qf::mc1, "B 1 1 2/b", "-B 2b\0" }, + { 15, qf::mc2, "A 1 1 2/n", "-A 2ab\0" }, + { 15, qf::mc3, "I 1 1 2/a", "-I 2a\0" }, + { 15, qf::a1, "B 2/b 1 1", "-B 2xb\0" }, + { 15, qf::a2, "C 2/n 1 1", "-C 2xac\0" }, + { 15, qf::a3, "I 2/c 1 1", "-I 2xc\0" }, + { 15, qf::ma1, "C 2/c 1 1", "-C 2xc\0" }, + { 15, qf::ma2, "B 2/n 1 1", "-B 2xab\0" }, + { 15, qf::ma3, "I 2/b 1 1", "-I 2xb\0" }, + { 16, 0, "P 2 2 2", " P 2 2\0" }, + { 17, 0, "P 2 2 21", " P 2c 2\0" }, + { 17, qf::cab, "P 21 2 2", " P 2a 2a\0" }, + { 17, qf::bca, "P 2 21 2", " P 2 2b\0" }, + { 18, 0, "P 21 21 2", " P 2 2ab\0" }, + { 18, qf::cab, "P 2 21 21", " P 2bc 2\0" }, + { 18, qf::bca, "P 21 2 21", " P 2ac 2ac\0" }, + { 19, 0, "P 21 21 21", " P 2ac 2ab\0" }, + { 20, 0, "C 2 2 21", " C 2c 2\0" }, + { 20, qf::cab, "A 21 2 2", " A 2a 2a\0" }, + { 20, qf::bca, "B 2 21 2", " B 2 2b\0" }, + { 21, 0, "C 2 2 2", " C 2 2\0" }, + { 21, qf::cab, "A 2 2 2", " A 2 2\0" }, + { 21, qf::bca, "B 2 2 2", " B 2 2\0" }, + { 22, 0, "F 2 2 2", " F 2 2\0" }, + { 23, 0, "I 2 2 2", " I 2 2\0" }, + { 24, 0, "I 21 21 21", " I 2b 2c\0" }, + { 25, 0, "P m m 2", " P 2 -2\0" }, + { 25, qf::cab, "P 2 m m", " P -2 2\0" }, + { 25, qf::bca, "P m 2 m", " P -2 -2\0" }, + { 26, 0, "P m c 21", " P 2c -2\0" }, + { 26, qf::bamc, "P c m 21", " P 2c -2c\0" }, + { 26, qf::cab, "P 21 m a", " P -2a 2a\0" }, + { 26, qf::mcba, "P 21 a m", " P -2 2a\0" }, + { 26, qf::bca, "P b 21 m", " P -2 -2b\0" }, + { 26, qf::amcb, "P m 21 b", " P -2b -2\0" }, + { 27, 0, "P c c 2", " P 2 -2c\0" }, + { 27, qf::cab, "P 2 a a", " P -2a 2\0" }, + { 27, qf::bca, "P b 2 b", " P -2b -2b\0" }, + { 28, 0, "P m a 2", " P 2 -2a\0" }, + { 28, qf::bamc, "P b m 2", " P 2 -2b\0" }, + { 28, qf::cab, "P 2 m b", " P -2b 2\0" }, + { 28, qf::mcba, "P 2 c m", " P -2c 2\0" }, + { 28, qf::bca, "P c 2 m", " P -2c -2c\0" }, + { 28, qf::amcb, "P m 2 a", " P -2a -2a\0" }, + { 29, 0, "P c a 21", " P 2c -2ac\0" }, + { 29, qf::bamc, "P b c 21", " P 2c -2b\0" }, + { 29, qf::cab, "P 21 a b", " P -2b 2a\0" }, + { 29, qf::mcba, "P 21 c a", " P -2ac 2a\0" }, + { 29, qf::bca, "P c 21 b", " P -2bc -2c\0" }, + { 29, qf::amcb, "P b 21 a", " P -2a -2ab\0" }, + { 30, 0, "P n c 2", " P 2 -2bc\0" }, + { 30, qf::bamc, "P c n 2", " P 2 -2ac\0" }, + { 30, qf::cab, "P 2 n a", " P -2ac 2\0" }, + { 30, qf::mcba, "P 2 a n", " P -2ab 2\0" }, + { 30, qf::bca, "P b 2 n", " P -2ab -2ab\0" }, + { 30, qf::amcb, "P n 2 b", " P -2bc -2bc\0" }, + { 31, 0, "P m n 21", " P 2ac -2\0" }, + { 31, qf::bamc, "P n m 21", " P 2bc -2bc\0" }, + { 31, qf::cab, "P 21 m n", " P -2ab 2ab\0" }, + { 31, qf::mcba, "P 21 n m", " P -2 2ac\0" }, + { 31, qf::bca, "P n 21 m", " P -2 -2bc\0" }, + { 31, qf::amcb, "P m 21 n", " P -2ab -2\0" }, + { 32, 0, "P b a 2", " P 2 -2ab\0" }, + { 32, qf::cab, "P 2 c b", " P -2bc 2\0" }, + { 32, qf::bca, "P c 2 a", " P -2ac -2ac\0" }, + { 33, 0, "P n a 21", " P 2c -2n\0" }, + { 33, qf::bamc, "P b n 21", " P 2c -2ab\0" }, + { 33, qf::cab, "P 21 n b", " P -2bc 2a\0" }, + { 33, qf::mcba, "P 21 c n", " P -2n 2a\0" }, + { 33, qf::bca, "P c 21 n", " P -2n -2ac\0" }, + { 33, qf::amcb, "P n 21 a", " P -2ac -2n\0" }, + { 34, 0, "P n n 2", " P 2 -2n\0" }, + { 34, qf::cab, "P 2 n n", " P -2n 2\0" }, + { 34, qf::bca, "P n 2 n", " P -2n -2n\0" }, + { 35, 0, "C m m 2", " C 2 -2\0" }, + { 35, qf::cab, "A 2 m m", " A -2 2\0" }, + { 35, qf::bca, "B m 2 m", " B -2 -2\0" }, + { 36, 0, "C m c 21", " C 2c -2\0" }, + { 36, qf::bamc, "C c m 21", " C 2c -2c\0" }, + { 36, qf::cab, "A 21 m a", " A -2a 2a\0" }, + { 36, qf::mcba, "A 21 a m", " A -2 2a\0" }, + { 36, qf::bca, "B b 21 m", " B -2 -2b\0" }, + { 36, qf::amcb, "B m 21 b", " B -2b -2\0" }, + { 37, 0, "C c c 2", " C 2 -2c\0" }, + { 37, qf::cab, "A 2 a a", " A -2a 2\0" }, + { 37, qf::bca, "B b 2 b", " B -2b -2b\0" }, + { 38, 0, "A m m 2", " A 2 -2\0" }, + { 38, qf::bamc, "B m m 2", " B 2 -2\0" }, + { 38, qf::cab, "B 2 m m", " B -2 2\0" }, + { 38, qf::mcba, "C 2 m m", " C -2 2\0" }, + { 38, qf::bca, "C m 2 m", " C -2 -2\0" }, + { 38, qf::amcb, "A m 2 m", " A -2 -2\0" }, + { 39, 0, "A b m 2", " A 2 -2b\0" }, + { 39, qf::bamc, "B m a 2", " B 2 -2a\0" }, + { 39, qf::cab, "B 2 c m", " B -2a 2\0" }, + { 39, qf::mcba, "C 2 m b", " C -2a 2\0" }, + { 39, qf::bca, "C m 2 a", " C -2a -2a\0" }, + { 39, qf::amcb, "A c 2 m", " A -2b -2b\0" }, + { 40, 0, "A m a 2", " A 2 -2a\0" }, + { 40, qf::bamc, "B b m 2", " B 2 -2b\0" }, + { 40, qf::cab, "B 2 m b", " B -2b 2\0" }, + { 40, qf::mcba, "C 2 c m", " C -2c 2\0" }, + { 40, qf::bca, "C c 2 m", " C -2c -2c\0" }, + { 40, qf::amcb, "A m 2 a", " A -2a -2a\0" }, + { 41, 0, "A b a 2", " A 2 -2ab\0" }, + { 41, qf::bamc, "B b a 2", " B 2 -2ab\0" }, + { 41, qf::cab, "B 2 c b", " B -2ab 2\0" }, + { 41, qf::mcba, "C 2 c b", " C -2ac 2\0" }, + { 41, qf::bca, "C c 2 a", " C -2ac -2ac\0" }, + { 41, qf::amcb, "A c 2 a", " A -2ab -2ab\0" }, + { 42, 0, "F m m 2", " F 2 -2\0" }, + { 42, qf::cab, "F 2 m m", " F -2 2\0" }, + { 42, qf::bca, "F m 2 m", " F -2 -2\0" }, + { 43, 0, "F d d 2", " F 2 -2d\0" }, + { 43, qf::cab, "F 2 d d", " F -2d 2\0" }, + { 43, qf::bca, "F d 2 d", " F -2d -2d\0" }, + { 44, 0, "I m m 2", " I 2 -2\0" }, + { 44, qf::cab, "I 2 m m", " I -2 2\0" }, + { 44, qf::bca, "I m 2 m", " I -2 -2\0" }, + { 45, 0, "I b a 2", " I 2 -2c\0" }, + { 45, qf::cab, "I 2 c b", " I -2a 2\0" }, + { 45, qf::bca, "I c 2 a", " I -2b -2b\0" }, + { 46, 0, "I m a 2", " I 2 -2a\0" }, + { 46, qf::bamc, "I b m 2", " I 2 -2b\0" }, + { 46, qf::cab, "I 2 m b", " I -2b 2\0" }, + { 46, qf::mcba, "I 2 c m", " I -2c 2\0" }, + { 46, qf::bca, "I c 2 m", " I -2c -2c\0" }, + { 46, qf::amcb, "I m 2 a", " I -2a -2a\0" }, + { 47, 0, "P m m m", "-P 2 2\0" }, + { 48, 0, "P n n n", " P 2 2 -1n\0-P 2ab 2bc\0" }, + { 49, 0, "P c c m", "-P 2 2c\0" }, + { 49, qf::cab, "P m a a", "-P 2a 2\0" }, + { 49, qf::bca, "P b m b", "-P 2b 2b\0" }, + { 50, 0, "P b a n", " P 2 2 -1ab\0-P 2ab 2b\0" }, + { 50, qf::cab, "P n c b", " P 2 2 -1bc\0-P 2b 2bc\0" }, + { 50, qf::bca, "P c n a", " P 2 2 -1ac\0-P 2a 2c\0" }, + { 51, 0, "P m m a", "-P 2a 2a\0" }, + { 51, qf::bamc, "P m m b", "-P 2b 2\0" }, + { 51, qf::cab, "P b m m", "-P 2 2b\0" }, + { 51, qf::mcba, "P c m m", "-P 2c 2c\0" }, + { 51, qf::bca, "P m c m", "-P 2c 2\0" }, + { 51, qf::amcb, "P m a m", "-P 2 2a\0" }, + { 52, 0, "P n n a", "-P 2a 2bc\0" }, + { 52, qf::bamc, "P n n b", "-P 2b 2n\0" }, + { 52, qf::cab, "P b n n", "-P 2n 2b\0" }, + { 52, qf::mcba, "P c n n", "-P 2ab 2c\0" }, + { 52, qf::bca, "P n c n", "-P 2ab 2n\0" }, + { 52, qf::amcb, "P n a n", "-P 2n 2bc\0" }, + { 53, 0, "P m n a", "-P 2ac 2\0" }, + { 53, qf::bamc, "P n m b", "-P 2bc 2bc\0" }, + { 53, qf::cab, "P b m n", "-P 2ab 2ab\0" }, + { 53, qf::mcba, "P c n m", "-P 2 2ac\0" }, + { 53, qf::bca, "P n c m", "-P 2 2bc\0" }, + { 53, qf::amcb, "P m a n", "-P 2ab 2\0" }, + { 54, 0, "P c c a", "-P 2a 2ac\0" }, + { 54, qf::bamc, "P c c b", "-P 2b 2c\0" }, + { 54, qf::cab, "P b a a", "-P 2a 2b\0" }, + { 54, qf::mcba, "P c a a", "-P 2ac 2c\0" }, + { 54, qf::bca, "P b c b", "-P 2bc 2b\0" }, + { 54, qf::amcb, "P b a b", "-P 2b 2ab\0" }, + { 55, 0, "P b a m", "-P 2 2ab\0" }, + { 55, qf::cab, "P m c b", "-P 2bc 2\0" }, + { 55, qf::bca, "P c m a", "-P 2ac 2ac\0" }, + { 56, 0, "P c c n", "-P 2ab 2ac\0" }, + { 56, qf::cab, "P n a a", "-P 2ac 2bc\0" }, + { 56, qf::bca, "P b n b", "-P 2bc 2ab\0" }, + { 57, 0, "P b c m", "-P 2c 2b\0" }, + { 57, qf::bamc, "P c a m", "-P 2c 2ac\0" }, + { 57, qf::cab, "P m c a", "-P 2ac 2a\0" }, + { 57, qf::mcba, "P m a b", "-P 2b 2a\0" }, + { 57, qf::bca, "P b m a", "-P 2a 2ab\0" }, + { 57, qf::amcb, "P c m b", "-P 2bc 2c\0" }, + { 58, 0, "P n n m", "-P 2 2n\0" }, + { 58, qf::cab, "P m n n", "-P 2n 2\0" }, + { 58, qf::bca, "P n m n", "-P 2n 2n\0" }, + { 59, 0, "P m m n", " P 2 2ab -1ab\0-P 2ab 2a\0" }, + { 59, qf::cab, "P n m m", " P 2bc 2 -1bc\0-P 2c 2bc\0" }, + { 59, qf::bca, "P m n m", " P 2ac 2ac -1ac\0-P 2c 2a\0" }, + { 60, 0, "P b c n", "-P 2n 2ab\0" }, + { 60, qf::bamc, "P c a n", "-P 2n 2c\0" }, + { 60, qf::cab, "P n c a", "-P 2a 2n\0" }, + { 60, qf::mcba, "P n a b", "-P 2bc 2n\0" }, + { 60, qf::bca, "P b n a", "-P 2ac 2b\0" }, + { 60, qf::amcb, "P c n b", "-P 2b 2ac\0" }, + { 61, 0, "P b c a", "-P 2ac 2ab\0" }, + { 61, qf::bamc, "P c a b", "-P 2bc 2ac\0" }, + { 62, 0, "P n m a", "-P 2ac 2n\0" }, + { 62, qf::bamc, "P m n b", "-P 2bc 2a\0" }, + { 62, qf::cab, "P b n m", "-P 2c 2ab\0" }, + { 62, qf::mcba, "P c m n", "-P 2n 2ac\0" }, + { 62, qf::bca, "P m c n", "-P 2n 2a\0" }, + { 62, qf::amcb, "P n a m", "-P 2c 2n\0" }, + { 63, 0, "C m c m", "-C 2c 2\0" }, + { 63, qf::bamc, "C c m m", "-C 2c 2c\0" }, + { 63, qf::cab, "A m m a", "-A 2a 2a\0" }, + { 63, qf::mcba, "A m a m", "-A 2 2a\0" }, + { 63, qf::bca, "B b m m", "-B 2 2b\0" }, + { 63, qf::amcb, "B m m b", "-B 2b 2\0" }, + { 64, 0, "C m c a", "-C 2ac 2\0" }, + { 64, qf::bamc, "C c m b", "-C 2ac 2ac\0" }, + { 64, qf::cab, "A b m a", "-A 2ab 2ab\0" }, + { 64, qf::mcba, "A c a m", "-A 2 2ab\0" }, + { 64, qf::bca, "B b c m", "-B 2 2ab\0" }, + { 64, qf::amcb, "B m a b", "-B 2ab 2\0" }, + { 65, 0, "C m m m", "-C 2 2\0" }, + { 65, qf::cab, "A m m m", "-A 2 2\0" }, + { 65, qf::bca, "B m m m", "-B 2 2\0" }, + { 66, 0, "C c c m", "-C 2 2c\0" }, + { 66, qf::cab, "A m a a", "-A 2a 2\0" }, + { 66, qf::bca, "B b m b", "-B 2b 2b\0" }, + { 67, 0, "C m m a", "-C 2a 2\0" }, + { 67, qf::bamc, "C m m b", "-C 2a 2a\0" }, + { 67, qf::cab, "A b m m", "-A 2b 2b\0" }, + { 67, qf::mcba, "A c m m", "-A 2 2b\0" }, + { 67, qf::bca, "B m c m", "-B 2 2a\0" }, + { 67, qf::amcb, "B m a m", "-B 2a 2\0" }, + { 68, 0, "C c c a", " C 2 2 -1ac\0-C 2a 2ac\0" }, + { 68, qf::bamc, "C c c b", " C 2 2 -1ac\0-C 2a 2c\0" }, + { 68, qf::cab, "A b a a", " A 2 2 -1ab\0-A 2a 2b\0" }, + { 68, qf::mcba, "A c a a", " A 2 2 -1ab\0-A 2ab 2b\0" }, + { 68, qf::bca, "B b c b", " B 2 2 -1ab\0-B 2ab 2b\0" }, + { 68, qf::amcb, "B b a b", " B 2 2 -1ab\0-B 2b 2ab\0" }, + { 69, 0, "F m m m", "-F 2 2\0" }, + { 70, 0, "F d d d", " F 2 2 -1d\0-F 2uv 2vw\0" }, + { 71, 0, "I m m m", "-I 2 2\0" }, + { 72, 0, "I b a m", "-I 2 2c\0" }, + { 72, qf::cab, "I m c b", "-I 2a 2\0" }, + { 72, qf::bca, "I c m a", "-I 2b 2b\0" }, + { 73, 0, "I b c a", "-I 2b 2c\0" }, + { 73, qf::bamc, "I c a b", "-I 2a 2b\0" }, + { 74, 0, "I m m a", "-I 2b 2\0" }, + { 74, qf::bamc, "I m m b", "-I 2a 2a\0" }, + { 74, qf::cab, "I b m m", "-I 2c 2c\0" }, + { 74, qf::mcba, "I c m m", "-I 2 2b\0" }, + { 74, qf::bca, "I m c m", "-I 2 2a\0" }, + { 74, qf::amcb, "I m a m", "-I 2c 2\0" }, + { 75, 0, "P 4", " P 4\0" }, + { 76, 0, "P 41", " P 4w\0" }, + { 77, 0, "P 42", " P 4c\0" }, + { 78, 0, "P 43", " P 4cw\0" }, + { 79, 0, "I 4", " I 4\0" }, + { 80, 0, "I 41", " I 4bw\0" }, + { 81, 0, "P -4", " P -4\0" }, + { 82, 0, "I -4", " I -4\0" }, + { 83, 0, "P 4/m", "-P 4\0" }, + { 84, 0, "P 42/m", "-P 4c\0" }, + { 85, 0, "P 4/n", " P 4ab -1ab\0-P 4a\0" }, + { 86, 0, "P 42/n", " P 4n -1n\0-P 4bc\0" }, + { 87, 0, "I 4/m", "-I 4\0" }, + { 88, 0, "I 41/a", " I 4bw -1bw\0-I 4ad\0" }, + { 89, 0, "P 4 2 2", " P 4 2\0" }, + { 90, 0, "P 4 21 2", " P 4ab 2ab\0" }, + { 91, 0, "P 41 2 2", " P 4w 2c\0" }, + { 92, 0, "P 41 21 2", " P 4abw 2nw\0" }, + { 93, 0, "P 42 2 2", " P 4c 2\0" }, + { 94, 0, "P 42 21 2", " P 4n 2n\0" }, + { 95, 0, "P 43 2 2", " P 4cw 2c\0" }, + { 96, 0, "P 43 21 2", " P 4nw 2abw\0" }, + { 97, 0, "I 4 2 2", " I 4 2\0" }, + { 98, 0, "I 41 2 2", " I 4bw 2bw\0" }, + { 99, 0, "P 4 m m", " P 4 -2\0" }, + { 100, 0, "P 4 b m", " P 4 -2ab\0" }, + { 101, 0, "P 42 c m", " P 4c -2c\0" }, + { 102, 0, "P 42 n m", " P 4n -2n\0" }, + { 103, 0, "P 4 c c", " P 4 -2c\0" }, + { 104, 0, "P 4 n c", " P 4 -2n\0" }, + { 105, 0, "P 42 m c", " P 4c -2\0" }, + { 106, 0, "P 42 b c", " P 4c -2ab\0" }, + { 107, 0, "I 4 m m", " I 4 -2\0" }, + { 108, 0, "I 4 c m", " I 4 -2c\0" }, + { 109, 0, "I 41 m d", " I 4bw -2\0" }, + { 110, 0, "I 41 c d", " I 4bw -2c\0" }, + { 111, 0, "P -4 2 m", " P -4 2\0" }, + { 112, 0, "P -4 2 c", " P -4 2c\0" }, + { 113, 0, "P -4 21 m", " P -4 2ab\0" }, + { 114, 0, "P -4 21 c", " P -4 2n\0" }, + { 115, 0, "P -4 m 2", " P -4 -2\0" }, + { 116, 0, "P -4 c 2", " P -4 -2c\0" }, + { 117, 0, "P -4 b 2", " P -4 -2ab\0" }, + { 118, 0, "P -4 n 2", " P -4 -2n\0" }, + { 119, 0, "I -4 m 2", " I -4 -2\0" }, + { 120, 0, "I -4 c 2", " I -4 -2c\0" }, + { 121, 0, "I -4 2 m", " I -4 2\0" }, + { 122, 0, "I -4 2 d", " I -4 2bw\0" }, + { 123, 0, "P 4/m m m", "-P 4 2\0" }, + { 124, 0, "P 4/m c c", "-P 4 2c\0" }, + { 125, 0, "P 4/n b m", " P 4 2 -1ab\0-P 4a 2b\0" }, + { 126, 0, "P 4/n n c", " P 4 2 -1n\0-P 4a 2bc\0" }, + { 127, 0, "P 4/m b m", "-P 4 2ab\0" }, + { 128, 0, "P 4/m n c", "-P 4 2n\0" }, + { 129, 0, "P 4/n m m", " P 4ab 2ab -1ab\0-P 4a 2a\0" }, + { 130, 0, "P 4/n c c", " P 4ab 2n -1ab\0-P 4a 2ac\0" }, + { 131, 0, "P 42/m m c", "-P 4c 2\0" }, + { 132, 0, "P 42/m c m", "-P 4c 2c\0" }, + { 133, 0, "P 42/n b c", " P 4n 2c -1n\0-P 4ac 2b\0" }, + { 134, 0, "P 42/n n m", " P 4n 2 -1n\0-P 4ac 2bc\0" }, + { 135, 0, "P 42/m b c", "-P 4c 2ab\0" }, + { 136, 0, "P 42/m n m", "-P 4n 2n\0" }, + { 137, 0, "P 42/n m c", " P 4n 2n -1n\0-P 4ac 2a\0" }, + { 138, 0, "P 42/n c m", " P 4n 2ab -1n\0-P 4ac 2ac\0" }, + { 139, 0, "I 4/m m m", "-I 4 2\0" }, + { 140, 0, "I 4/m c m", "-I 4 2c\0" }, + { 141, 0, "I 41/a m d", " I 4bw 2bw -1bw\0-I 4bd 2\0" }, + { 142, 0, "I 41/a c d", " I 4bw 2aw -1bw\0-I 4bd 2c\0" }, + { 143, 0, "P 3", " P 3\0" }, + { 144, 0, "P 31", " P 31\0" }, + { 145, 0, "P 32", " P 32\0" }, + { 146, 0, "R 3", " R 3\0 P 3*\0" }, + { 147, 0, "P -3", "-P 3\0" }, + { 148, 0, "R -3", "-R 3\0-P 3*\0" }, + { 149, 0, "P 3 1 2", " P 3 2\0" }, + { 150, 0, "P 3 2 1", " P 3 2\"\0" }, + { 151, 0, "P 31 1 2", " P 31 2 (0 0 4)\0" }, + { 152, 0, "P 31 2 1", " P 31 2\"\0" }, + { 153, 0, "P 32 1 2", " P 32 2 (0 0 2)\0" }, + { 154, 0, "P 32 2 1", " P 32 2\"\0" }, + { 155, 0, "R 3 2", " R 3 2\"\0 P 3* 2\0" }, + { 156, 0, "P 3 m 1", " P 3 -2\"\0" }, + { 157, 0, "P 3 1 m", " P 3 -2\0" }, + { 158, 0, "P 3 c 1", " P 3 -2\"c\0" }, + { 159, 0, "P 3 1 c", " P 3 -2c\0" }, + { 160, 0, "R 3 m", " R 3 -2\"\0 P 3* -2\0" }, + { 161, 0, "R 3 c", " R 3 -2\"c\0 P 3* -2n\0" }, + { 162, 0, "P -3 1 m", "-P 3 2\0" }, + { 163, 0, "P -3 1 c", "-P 3 2c\0" }, + { 164, 0, "P -3 m 1", "-P 3 2\"\0" }, + { 165, 0, "P -3 c 1", "-P 3 2\"c\0" }, + { 166, 0, "R -3 m", "-R 3 2\"\0-P 3* 2\0" }, + { 167, 0, "R -3 c", "-R 3 2\"c\0-P 3* 2n\0" }, + { 168, 0, "P 6", " P 6\0" }, + { 169, 0, "P 61", " P 61\0" }, + { 170, 0, "P 65", " P 65\0" }, + { 171, 0, "P 62", " P 62\0" }, + { 172, 0, "P 64", " P 64\0" }, + { 173, 0, "P 63", " P 6c\0" }, + { 174, 0, "P -6", " P -6\0" }, + { 175, 0, "P 6/m", "-P 6\0" }, + { 176, 0, "P 63/m", "-P 6c\0" }, + { 177, 0, "P 6 2 2", " P 6 2\0" }, + { 178, 0, "P 61 2 2", " P 61 2 (0 0 5)\0" }, + { 179, 0, "P 65 2 2", " P 65 2 (0 0 1)\0" }, + { 180, 0, "P 62 2 2", " P 62 2 (0 0 4)\0" }, + { 181, 0, "P 64 2 2", " P 64 2 (0 0 2)\0" }, + { 182, 0, "P 63 2 2", " P 6c 2c\0" }, + { 183, 0, "P 6 m m", " P 6 -2\0" }, + { 184, 0, "P 6 c c", " P 6 -2c\0" }, + { 185, 0, "P 63 c m", " P 6c -2\0" }, + { 186, 0, "P 63 m c", " P 6c -2c\0" }, + { 187, 0, "P -6 m 2", " P -6 2\0" }, + { 188, 0, "P -6 c 2", " P -6c 2\0" }, + { 189, 0, "P -6 2 m", " P -6 -2\0" }, + { 190, 0, "P -6 2 c", " P -6c -2c\0" }, + { 191, 0, "P 6/m m m", "-P 6 2\0" }, + { 192, 0, "P 6/m c c", "-P 6 2c\0" }, + { 193, 0, "P 63/m c m", "-P 6c 2\0" }, + { 194, 0, "P 63/m m c", "-P 6c 2c\0" }, + { 195, 0, "P 2 3", " P 2 2 3\0" }, + { 196, 0, "F 2 3", " F 2 2 3\0" }, + { 197, 0, "I 2 3", " I 2 2 3\0" }, + { 198, 0, "P 21 3", " P 2ac 2ab 3\0" }, + { 199, 0, "I 21 3", " I 2b 2c 3\0" }, + { 200, 0, "P m -3", "-P 2 2 3\0" }, + { 201, 0, "P n -3", " P 2 2 3 -1n\0-P 2ab 2bc 3\0" }, + { 202, 0, "F m -3", "-F 2 2 3\0" }, + { 203, 0, "F d -3", " F 2 2 3 -1d\0-F 2uv 2vw 3\0" }, + { 204, 0, "I m -3", "-I 2 2 3\0" }, + { 205, 0, "P a -3", "-P 2ac 2ab 3\0" }, + { 206, 0, "I a -3", "-I 2b 2c 3\0" }, + { 207, 0, "P 4 3 2", " P 4 2 3\0" }, + { 208, 0, "P 42 3 2", " P 4n 2 3\0" }, + { 209, 0, "F 4 3 2", " F 4 2 3\0" }, + { 210, 0, "F 41 3 2", " F 4d 2 3\0" }, + { 211, 0, "I 4 3 2", " I 4 2 3\0" }, + { 212, 0, "P 43 3 2", " P 4acd 2ab 3\0" }, + { 213, 0, "P 41 3 2", " P 4bd 2ab 3\0" }, + { 214, 0, "I 41 3 2", " I 4bd 2c 3\0" }, + { 215, 0, "P -4 3 m", " P -4 2 3\0" }, + { 216, 0, "F -4 3 m", " F -4 2 3\0" }, + { 217, 0, "I -4 3 m", " I -4 2 3\0" }, + { 218, 0, "P -4 3 n", " P -4n 2 3\0" }, + { 219, 0, "F -4 3 c", " F -4a 2 3\0" }, + { 220, 0, "I -4 3 d", " I -4bd 2c 3\0" }, + { 221, 0, "P m -3 m", "-P 4 2 3\0" }, + { 222, 0, "P n -3 n", " P 4 2 3 -1n\0-P 4a 2bc 3\0" }, + { 223, 0, "P m -3 n", "-P 4n 2 3\0" }, + { 224, 0, "P n -3 m", " P 4n 2 3 -1n\0-P 4bc 2bc 3\0" }, + { 225, 0, "F m -3 m", "-F 4 2 3\0" }, + { 226, 0, "F m -3 c", "-F 4a 2 3\0" }, + { 227, 0, "F d -3 m", " F 4d 2 3 -1d\0-F 4vw 2vw 3\0" }, + { 228, 0, "F d -3 c", " F 4d 2 3 -1ad\0-F 4ud 2vw 3\0" }, + { 229, 0, "I m -3 m", "-I 4 2 3\0" }, + { 230, 0, "I a -3 d", "-I 4bd 2c 3\0" }, + { 0, 0, 0, 0 }, +// END_COMPILED_IN_REFERENCE_DATA + }; + + } // namespace tables + + // remove whitespace and underscores, map to lower case + string pre_process_symbol(string const& raw_symbol) + { + string result; + for(std::size_t i=0;i 0) { + string::size_type i = work_symbol.size() - 1; + switch (work_symbol[i]) { + case 's': + case 'z': + case 'r': + case 'h': + ext = work_symbol[i]; + stop = i; + break; + } + // check if last two characters are O1 or O2 + if (ext == '\0' && work_symbol.size() > 1) { + string::size_type i = work_symbol.size() - 2; + string e = work_symbol.substr(i); + if (e == "o1" || e == "o2") { + ext = e[1]; + stop = i; + } + } + } + } + + if (ext != '\0') { + switch (ext) { + case '1': break; + case 's': ext = '1'; break; + case '2': break; + case 'z': ext = '2'; break; + case 'r': ext = 'R'; break; + case 'h': ext = 'H'; break; + default: + ext = '\0'; + } + } + + if (ext != '\0') work_symbol.erase(stop); + + return ext; + } + + // remove parentheses, e.g. "P2(1)2(1)2(1)" -> "P212121" + void remove_screw_component_parentheses(string& work_symbol) + { + static const int rot_numbers[] = { 2, 3, 4, 6 }; + static const char rot_symbols[] = "2346"; + static const char scr_symbols[] = "012345"; + string pat = "r(s)"; + int ir; + for(ir=0;ir<4;ir++) { + pat[0] = rot_symbols[ir]; + int is; + for (is = 1; is < rot_numbers[ir]; is++) { + pat[2] = scr_symbols[is]; + for (;;) { + string::size_type i = work_symbol.find(pat); + if (i == string::npos) break; + work_symbol.erase(i + 3, 1); + work_symbol.erase(i + 1, 1); + } + } + } + } + + string + split_off_cb_symbol(string& work_symbol) + { + string result; + string::size_type sz = work_symbol.size(); + if (sz != 0 && work_symbol[sz-1] == ')') { + string::size_type i = work_symbol.rfind("("); + if (i != string::npos && i >= 2) { + result = work_symbol.substr(i+1, sz-i-2); + work_symbol.resize(i); + } + } + return result; + } + + string remove_spaces(string const& inp) + { + string result; + for(std::size_t i=0;i 0) { + std_table_id[0] = toupper(std_table_id[0]); + if ( std_table_id == "I" + || std_table_id == "I1952" + || std_table_id == "1") + std_table_id = "I1952"; + else if (std_table_id == "A" || std_table_id == "A1983") + std_table_id = "A1983"; + else + throw error("table_id not recognized: " + table_id); + } + return std_table_id; + } + + bool + short_mono_hm_as_full_mono_hm( + string const& std_table_id, + string& work_symbol) + { + const tables::short_mono_hm_dict_entry* entry; + if (std_table_id == "I1952") entry = tables::vol_i_short_mono_hm_dict; + else entry = tables::vol_a_short_mono_hm_dict; + for (int i = 0; entry[i].shrt; i++) { + if (work_symbol == entry[i].shrt) { + work_symbol = entry[i].full; + return true; + } + } + return false; + } + + void + ad_hoc_1992_symbol_as_a1983_symbol( + string& work_symbol) + { + // see documentation of space_group_type::lookup_symbol() + // simlar table in space_group_type.cpp, space_group_type::lookup_symbol() + static char const* adh_a38_pairs[] = { + // No. 39 + "Aem2", "Abm2", + "Bme2", "Bma2", + "B2em", "B2cm", + "C2me", "C2mb", + "Cm2e", "Cm2a", + "Ae2m", "Ac2m", + // No. 41 + "Aea2", "Aba2", + "Bbe2", "Bba2", + "B2eb", "B2cb", + "C2ce", "C2cb", + "Cc2e", "Cc2a", + "Ae2a", "Ac2a", + // No. 64 + "Cmce", "Cmca", + "Ccme", "Ccmb", + "Aema", "Abma", + "Aeam", "Acam", + "Bbem", "Bbcm", + "Bmeb", "Bmab", + // No. 67 + "Cmme", "Cmma", // ambiguous: Cmmb + "Aemm", "Abmm", // ambiguous: Acmm + "Bmem", "Bmcm", // ambiguous: Bmam + // No. 68 + "Ccce", "Ccca", // ambiguous: Cccb + "Aeaa", "Abaa", // ambiguous: Acaa + "Bbeb", "Bbcb" // ambiguous: Bbab + }; + typedef std::map map_t; + static map_t adh_a38_map; + if (adh_a38_map.size() == 0) { + std::size_t n = sizeof(adh_a38_pairs) / sizeof(const char*); + for(int i=0;isecond; + } + + const tables::main_symbol_dict_entry* + find_main_symbol_dict_entry(string const& work_symbol) + { + const tables::main_symbol_dict_entry* entry; + for (entry = tables::main_symbol_dict; entry->sg_number; entry++) { + string hm = remove_spaces(entry->hermann_mauguin); + if (hm == work_symbol) return entry; + string::size_type bar = hm.find('-'); + if (bar != string::npos) { + // reverse "-N" to "N-", e.g. "P -1" -> "P 1-" + hm[bar] = hm[bar + 1]; + hm[bar + 1] = '-'; + if (hm == work_symbol) return entry; + if ( (entry->sg_number >= 200 && entry->sg_number <= 206) + || (entry->sg_number >= 221 && entry->sg_number <= 230)) { + hm.erase(bar + 1, 1); // remove '-', e.g. "P m -3 m" -> "P m 3 m" + if (hm == work_symbol) return entry; + } + } + } + return 0; + } + + const tables::main_symbol_dict_entry* + sg_number_to_main_symbol_dict_entry(int sg_number, + string const& std_table_id) + { + if (sg_number < 1 || sg_number > 230) { + throw error("Space group number out of range: " + to_str(sg_number)); + } + if (sg_number < 3 || sg_number > 15) { + const tables::main_symbol_dict_entry* entry; + for (entry = tables::main_symbol_dict; entry->sg_number; entry++) + if (entry->sg_number == sg_number) + return entry; + throw CCTBX_INTERNAL_ERROR(); + } + int i = 0; + if (std_table_id == "I1952") i = 1; + string mono_hm = tables::monoclinic_sg_number_as_hm_list[sg_number][i]; + const tables::main_symbol_dict_entry* + result = find_main_symbol_dict_entry(mono_hm); + CCTBX_ASSERT(result != 0); + return result; + } + + const char* select_hall(const tables::main_symbol_dict_entry* entry, + char& work_extension, + string const& std_table_id) + { + const char* hall2 = &entry->hall[string(entry->hall).size() + 1]; + if (string(hall2).size() == 0) { + if (work_extension == '\0') return entry->hall; + } + else { + if (entry->hermann_mauguin[0] == 'R') { + if (work_extension == '\0') { + if (std_table_id == "I1952") work_extension = 'R'; + else work_extension = 'H'; + } + if (work_extension == 'H') return entry->hall; + else if (work_extension == 'R') return hall2; + } + else { + if (work_extension == '\0') { + if (std_table_id.size() == 0) work_extension = '2'; + else work_extension = '1'; + } + if (work_extension == '1') return entry->hall; + else if (work_extension == '2') return hall2; + } + } + return 0; + } + + } // namespace symbols + + using namespace symbols; + + bool + space_group_symbols::set_all( + const symbols::tables::main_symbol_dict_entry* entry, + char work_extension, + string const& std_table_id) + { + const char* table_hall = select_hall(entry, work_extension, std_table_id); + if (table_hall == 0) return false; + CCTBX_ASSERT( work_extension == '\0' + || work_extension == '1' || work_extension == '2' + || work_extension == 'H' || work_extension == 'R'); + number_ = entry->sg_number; + schoenflies_ = symbols::tables::schoenflies_list[entry->sg_number]; + qualifier_ = string(entry->qualifier ? entry->qualifier : ""); + hermann_mauguin_ = entry->hermann_mauguin; + extension_ = work_extension; + change_of_basis_symbol_ = ""; + universal_hermann_mauguin_ = hermann_mauguin_; + if (extension_ != '\0') { + universal_hermann_mauguin_ += " :"; + universal_hermann_mauguin_ += extension_; + } + hall_ = table_hall; + return true; + } + + int space_group_symbols::hall_pass_through(string const& symbol) + { + string::const_iterator s; + for (s = symbol.begin(); s != symbol.end(); s++) { + if (!isspace(*s)) break; + } + for (int i = 0; i < 4; i++, s++) { + if (s == symbol.end()) return 0; + if (tolower(*s) != "hall"[i]) return 0; + } + if (*s != ':' && !isspace(*s)) return 0; + for (; s != symbol.end(); s++) if (!isspace(*s)) break; + if (s == symbol.end()) return 0; + if (*s == ':') { + for (s++; s != symbol.end(); s++) if (!isspace(*s)) break; + if (s == symbol.end()) return 0; + } + hall_ = string(s, symbol.end()); + return 1; + } + + void space_group_symbols::clear() + { + number_ = 0; + schoenflies_ = ""; + qualifier_ = ""; + hermann_mauguin_ = ""; + extension_ = '\0'; + change_of_basis_symbol_ = ""; + universal_hermann_mauguin_ = ""; + hall_ = ""; + } + + namespace { + + bool is_hall(string const& table_id) + { + string::const_iterator s; + for (s = table_id.begin(); s != table_id.end(); s++) { + if (!isspace(*s)) break; + } + for (std::size_t i = 0; i < 4; i++, s++) { + if (s == table_id.end()) return false; + if (tolower(*s) != "hall"[i]) return false; + } + for (;; s++) { + if (s == table_id.end()) return true; + if (!isspace(*s)) break; + } + return false; + } + + } + + space_group_symbols::space_group_symbols(string const& symbol, + string const& table_id) + { + clear(); + if (is_hall(table_id)) { + hall_ = symbol; + return; + } + string std_table_id = get_std_table_id(table_id); + if (std_table_id.size() == 0) { + if (hall_pass_through(symbol) != 0) return; + } + string work_symbol = pre_process_symbol(symbol); + work_symbol[0] = toupper(work_symbol[0]); + if (std_table_id.size() == 0 && work_symbol[0] == 'H') { + if (work_symbol == "H3") { + work_symbol = "R3"; + } + else if (work_symbol == "H32") { + work_symbol = "R32"; + } + else if (work_symbol == "H3m") { + work_symbol = "R3m"; + } + else if (work_symbol == "H3c") { + work_symbol = "R3c"; + } + else if (work_symbol == "H-3") { + work_symbol = "R-3"; + } + else if (work_symbol == "H-3m") { + work_symbol = "R-3m"; + } + else if (work_symbol == "H-3c") { + work_symbol = "R-3c"; + } + } + remove_screw_component_parentheses(work_symbol); + change_of_basis_op cb_op(0, 0); + std::string cb_mx_symbol = split_off_cb_symbol(work_symbol); + if (cb_mx_symbol.size() != 0) { + cb_op = change_of_basis_op(cb_mx_symbol); + } + char work_extension = strip_extension(work_symbol); + const symbols::tables::main_symbol_dict_entry* entry = 0; + int sg_no; + char xtrac; + int n = sscanf(work_symbol.c_str(), "%d%c", &sg_no, &xtrac); + if (n == 1) { + entry = sg_number_to_main_symbol_dict_entry(sg_no, std_table_id); + } + else { + sg_no = schoenflies_as_sg_number(work_symbol); + if (sg_no != 0) { + try { + entry = sg_number_to_main_symbol_dict_entry(sg_no, std_table_id); + } + catch (error const&) { + throw CCTBX_INTERNAL_ERROR(); + } + } + } + if (entry == 0) { + if (!short_mono_hm_as_full_mono_hm(std_table_id, work_symbol)) { + ad_hoc_1992_symbol_as_a1983_symbol(work_symbol); + } + entry = find_main_symbol_dict_entry(work_symbol); + if (entry == 0) { + throw error(not_recognized + symbol); + } + } + if (!set_all(entry, work_extension, std_table_id)) { + throw error(not_recognized + symbol); + } + if (cb_op.is_valid()) { + change_of_basis_symbol_ = cb_op.as_xyz(); + universal_hermann_mauguin_ += " (" + change_of_basis_symbol_ + ")"; + cb_mx_symbol = split_off_cb_symbol(hall_); + if (cb_mx_symbol.size() != 0) { + hall_.resize(hall_.size()-1); // strip space + // All tabulated Hall symbol change-of-basis operators are of + // the form (0 0 i), with i = {1,2,4,5} + CCTBX_ASSERT(cb_mx_symbol.size() == 5); + CCTBX_ASSERT(cb_mx_symbol.substr(0, 4) == "0 0 "); + int t12; + switch (cb_mx_symbol[4]) { + case '1': t12 = 1; break; + case '2': t12 = 2; break; + case '4': t12 = 4; break; + case '5': t12 = 5; break; + default: + throw CCTBX_INTERNAL_ERROR(); + } + cb_op = change_of_basis_op(rt_mx( + cb_op.c().r(), + cb_op.c().t().plus(cb_op.c().r().multiply(tr_vec(0,0,t12,12))))); + } + cb_op.mod_short_in_place(); + if (!cb_op.is_identity_op()) { + hall_ += " (" + cb_op.as_xyz() + ")"; + } + } + } + + space_group_symbols::space_group_symbols( + int space_group_number, + string const& extension, + string const& table_id) + { + clear(); + string std_table_id = get_std_table_id(table_id); + string work_symbol = pre_process_symbol(extension); + if (work_symbol.size() != 0 && work_symbol[0] != ':') { + work_symbol.insert(0, ":"); + } + string inp_work_symbol = work_symbol; + char work_extension = strip_extension(work_symbol); + if (work_symbol.size() != 0) { + throw error( + not_recognized + to_str(space_group_number) + inp_work_symbol); + } + const symbols::tables::main_symbol_dict_entry* entry = 0; + entry = sg_number_to_main_symbol_dict_entry( + space_group_number, std_table_id); + if (!set_all(entry, work_extension, std_table_id)) { + throw error( + not_recognized + to_str(space_group_number) + inp_work_symbol); + } + } + + space_group_symbols::space_group_symbols( + const symbols::tables::main_symbol_dict_entry* entry, + char extension) + { + clear(); + if (entry->sg_number) { + CCTBX_ASSERT(set_all(entry, extension, "")); + } + } + + matrix_group::code + space_group_symbols::point_group_type() const + { + std::size_t space_group_number = number(); + CCTBX_ASSERT(space_group_number >= 1); + CCTBX_ASSERT(space_group_number <= 230); + return reference_settings::matrix_group_code_table(space_group_number); + } + + space_group_symbol_iterator::space_group_symbol_iterator() + : entry_(symbols::tables::main_symbol_dict), n_hall_(1), i_hall_(0) + {} + + space_group_symbols space_group_symbol_iterator::next() + { + const symbols::tables::main_symbol_dict_entry* current_entry = entry_; + char extension = '\0'; + if (entry_->sg_number) { + if (n_hall_ == 2) { + if (143 <= entry_->sg_number && entry_->sg_number < 168) { + extension = "HR"[i_hall_]; + } + else { + extension = "12"[i_hall_]; + } + } + i_hall_++; + if (i_hall_ == n_hall_) { + entry_++; + n_hall_ = 0; + i_hall_ = 0; + if (entry_->sg_number) { + n_hall_ = 1; + const char* hall2 = &entry_->hall[string(entry_->hall).size() + 1]; + if (string(hall2).size() != 0) n_hall_ = 2; + } + } + } + return space_group_symbols(current_entry, extension); + } + +}} // namespace cctbx::sgtbx diff --git a/extern/cctbx/cctbx/sgtbx/tr_group.cpp b/extern/cctbx/cctbx/sgtbx/tr_group.cpp new file mode 100644 index 00000000..50c8c42d --- /dev/null +++ b/extern/cctbx/cctbx/sgtbx/tr_group.cpp @@ -0,0 +1,148 @@ +#include +#include +#include + +namespace cctbx { namespace sgtbx { + + bool + tr_group::contains(tr_vec const& t) const + { + if (!t.is_valid()) return false; + return ( std::find(elems_.begin(), elems_.end(), t.mod_positive()) + != elems_.end()); + } + + bool tr_group::add(tr_vec const& new_t) + { + if (!new_t.is_valid()) return false; + tr_vec t = new_t.mod_positive(); + if (std::find(elems_.begin(), elems_.end(), t) != elems_.end()) { + return false; + } + CCTBX_ASSERT(t.den() == elems_[0].den()); + elems_.push_back(t); + return true; + } + + bool tr_group::expand(tr_vec const& new_t) + { + tr_vec const *p_new_t = &new_t; + tr_vec trial_t; // XXX avoid the pointer stuff: trial_t = new_t; + int old_size = size(); + int i = old_size; + int j = 1; + for (;;) { + add(*p_new_t); + if (j > i) { + i++; + j = 1; + } + if (i == size()) break; + trial_t = elems_[j] + elems_[i]; + p_new_t = &trial_t; + j++; + } + return size() != old_size; + } + + tr_group tr_group::change_basis(change_of_basis_op const& cb_op) const + { + int t_den = elems_[0].den(); + tr_group result(t_den); + for(std::size_t i=0;i<3;i++) { + tr_vec bv(t_den); + bv[i] = t_den; + result.expand(cb_op(bv, 1)); + } + for(std::size_t i=1;isymbol != '\0'; e++) { + if (e->n_translations == size()) { + af::small match_flags(size(), false); + std::size_t n_matches = 0; + for(std::size_t i=0;it[i].new_denominator(t_den()) == elems_[j]) { + match_flags[j] = true; + n_matches++; + break; + } + } + } + if (n_matches == size()) return e->symbol; + } + } + return '\0'; + } + + change_of_basis_op + tr_group::conventional_z2p_op(int r_den, int t_den) const + { + char z_symbol = conventional_centring_type_symbol(); + rot_mx const& + z2p_mx = lattice_tr::conventional_z2p_matrices::get(z_symbol); + if (!z2p_mx.is_valid()) return change_of_basis_op(0, 0); + return change_of_basis_op( + rt_mx(z2p_mx.new_denominator(r_den), tr_vec(t_den))); + } + + tr_vec + tr_group::tidy(tr_vec const& t) const + { + int lcm_den = boost::lcm(elems_[0].den(), t.den()); + int f_den = lcm_den / elems_[0].den(); + tr_vec t_lcm = t.scale(lcm_den / t.den()); + tr_vec t_best = t_lcm.mod_short(); + for(std::size_t i=1;i +#include +#include + +namespace cctbx { namespace sgtbx { + + void throw_unsuitable_tr_vec(const char* file, long line) + { + throw error_rational_vector(file, line, + "Unsuitable value for rational translation vector."); + } + + tr_vec tr_vec::new_denominator(int new_den) const + { + tr_vec result(new_den); + if (utils::change_denominator(num_.begin(), den(), + result.num_.begin(), new_den, + num_.size()) != 0) { + throw_unsuitable_tr_vec(__FILE__, __LINE__); + } + return result; + } + + tr_vec operator/(tr_vec const& lhs, int rhs) + { + sg_vec3 new_num; + for(std::size_t i=0;i<3;i++) { + if (lhs.num_[i] % rhs) throw_unsuitable_tr_vec(__FILE__, __LINE__); + new_num[i] = lhs.num_[i] / rhs; + } + return tr_vec(new_num, lhs.den_); + } + + tr_vec tr_vec::cancel() const + { + int g = den(); + for(std::size_t i=0;i<3;i++) g = scitbx::math::gcd_int(g, num_[i]); + if (g == 0) return *this; + return tr_vec(num_ / g, den() / g); + } + + tr_vec tr_vec::plus(tr_vec const& rhs) const + { + tr_vec result(boost::lcm(den(), rhs.den())); + int l = result.den() / den(); + int r = result.den() / rhs.den(); + for(std::size_t i=0;i<3;i++) result[i] = num_[i] * l + rhs[i] * r; + return result.cancel(); + } + + tr_vec tr_vec::minus(tr_vec const& rhs) const + { + tr_vec result(boost::lcm(den(), rhs.den())); + int l = result.den() / den(); + int r = result.den() / rhs.den(); + for(std::size_t i=0;i<3;i++) result[i] = num_[i] * l - rhs[i] * r; + return result.cancel(); + } + + std::string + tr_vec::as_string(bool decimal, const char* separator) const + { + std::string result; + for(int i=0;i<3;i++) { + if (i != 0) result += separator; + rat t_frac((*this)[i], den()); + result += scitbx::format(t_frac, decimal); + } + return result; + } + +}} // namespace cctbx::sgtbx diff --git a/extern/cctbx/cctbx/sgtbx/utils.cpp b/extern/cctbx/cctbx/sgtbx/utils.cpp new file mode 100644 index 00000000..1003af37 --- /dev/null +++ b/extern/cctbx/cctbx/sgtbx/utils.cpp @@ -0,0 +1,42 @@ +#include +#include +#include + +namespace cctbx { namespace sgtbx { namespace utils { + + int change_denominator( + const int *old_num, int old_den, + int *new_num, int new_den, int n) + { + for(std::size_t i=0;i n0b) return true; + if (n0a < n0b) return false; + for(size_t i=0;i absolute(b[i])) return false; + } + for(size_t i=0;i b[i]) return true; + if (a[i] < b[i]) return false; + } + return false; + } + +}}} // namespace cctbx::sgtbx::utils diff --git a/extern/cctbx/cctbx/uctbx/spoil_optimization.cpp b/extern/cctbx/cctbx/uctbx/spoil_optimization.cpp new file mode 100644 index 00000000..eeb0d444 --- /dev/null +++ b/extern/cctbx/cctbx/uctbx/spoil_optimization.cpp @@ -0,0 +1,6 @@ +namespace cctbx { namespace uctbx { + + float spoil_optimization(float value) { return value; } + double spoil_optimization(double value) { return value; } + +}} // namespace cctbx::uctbx diff --git a/extern/cctbx/cctbx/uctbx/uctbx.cpp b/extern/cctbx/cctbx/uctbx/uctbx.cpp new file mode 100644 index 00000000..e1c90394 --- /dev/null +++ b/extern/cctbx/cctbx/uctbx/uctbx.cpp @@ -0,0 +1,558 @@ +#include +#include +#include +#include + +namespace cctbx { namespace uctbx { + + bool + unit_cell_angles_are_feasible( + scitbx::vec3 const& values_deg, + double tolerance) + { + for(unsigned i=0;i<3;i++) { + if (values_deg[i] <= tolerance) return false; + if (values_deg[i] >= 180-tolerance) return false; + } + double a = values_deg[0]; + double b = values_deg[1]; + double g = values_deg[2]; + if ( a+b+g >= 360-tolerance) return false; + if ( a+b-g <= tolerance) return false; + if ( a-b+g <= tolerance) return false; + if (-a+b+g <= tolerance) return false; + return true; + } + + namespace { + + void throw_corrupt_metrical_matrix() + { + throw std::invalid_argument("Corrupt metrical matrix."); + } + + double + dot_g(uc_vec3 const& u, uc_sym_mat3 const& g, uc_vec3 const& v) + { + return u * (g * v); + } + + uc_vec3 + cross_g(double sqrt_det_g, uc_sym_mat3 const& g, + uc_vec3 const& r, uc_vec3 const& s) + { + return sqrt_det_g * (g * r).cross(g * s); + } + + double acos_deg(double x) { return scitbx::rad_as_deg(std::acos(x)); } + + af::double6 + parameters_from_metrical_matrix(const double* metrical_matrix) + { + af::double6 params; + for(std::size_t i=0;i<3;i++) { + if (metrical_matrix[i] <= 0.) throw_corrupt_metrical_matrix(); + params[i] = std::sqrt(metrical_matrix[i]); + } + params[3] = acos_deg(metrical_matrix[5] / params[1] / params[2]); + params[4] = acos_deg(metrical_matrix[4] / params[2] / params[0]); + params[5] = acos_deg(metrical_matrix[3] / params[0] / params[1]); + return params; + } + + uc_sym_mat3 + construct_metrical_matrix( + af::double6 const& params, uc_vec3 const& cos_ang) + { + return uc_sym_mat3( + params[0] * params[0], + params[1] * params[1], + params[2] * params[2], + params[0] * params[1] * cos_ang[2], + params[0] * params[2] * cos_ang[1], + params[1] * params[2] * cos_ang[0]); + } + + } // namespace + + void unit_cell::init_volume() + { + /* V = a * b * c * sqrt(1 - cos(alpha)^2 - cos(beta)^2 - cos(gamma)^2 + + 2 * cos(alpha) * cos(beta) * cos(gamma)) + */ + double d = 1.; + for(std::size_t i=0;i<3;i++) d -= cos_ang_[i] * cos_ang_[i]; + d += 2. * cos_ang_[0] * cos_ang_[1] * cos_ang_[2]; + if (d < 0.) throw std::invalid_argument( + "Square of unit cell volume is negative."); + volume_ = params_[0] * params_[1] * params_[2] * std::sqrt(d); + if (volume_ <= 0.) throw std::invalid_argument( + "Unit cell volume is zero or negative."); + + af::double6 &f = d_volume_d_params_; + using scitbx::constants::pi_180; + double factor + = pi_180 * scitbx::fn::pow2(params_[0] * params_[1] * params_[2])/volume_; + f[0] = volume_/params_[0]; + f[1] = volume_/params_[1]; + f[2] = volume_/params_[2]; + f[3] = factor * sin_ang_[0] * (cos_ang_[0] - cos_ang_[1]*cos_ang_[2]); + f[4] = factor * sin_ang_[1] * (cos_ang_[1] - cos_ang_[0]*cos_ang_[2]); + f[5] = factor * sin_ang_[2] * (cos_ang_[2] - cos_ang_[1]*cos_ang_[0]); + } + + void unit_cell::init_reciprocal() + { + // Transformation Lattice Constants -> Reciprocal Lattice Constants + // after Kleber, W., 17. Aufl., Verlag Technik GmbH Berlin 1990, P.352 + static const char* + error_msg = "Error computing reciprocal unit cell angles."; + for(std::size_t i=0;i<3;i++) r_params_[i] = params_[(i + 1) % 3] + * params_[(i + 2) % 3] + * sin_ang_[i] / volume_; + for(std::size_t i=0;i<3;i++) { + double denom = sin_ang_[(i + 1) % 3] * sin_ang_[(i + 2) % 3]; + if (denom == 0) throw error (error_msg); + r_cos_ang_[i] = ( cos_ang_[(i + 1) % 3] + * cos_ang_[(i + 2) % 3] + - cos_ang_[i]) + / denom; + } + for(std::size_t i=0;i<3;i++) { + if (r_cos_ang_[i] < -1 || r_cos_ang_[i] > 1) { + throw std::invalid_argument(error_msg); + } + double a_rad = std::acos(r_cos_ang_[i]); + r_params_[i+3] = scitbx::rad_as_deg(a_rad); + r_sin_ang_[i] = std::sin(a_rad); + r_cos_ang_[i] = std::cos(a_rad); + } + } + + void unit_cell::init_orth_and_frac_matrices() + { + // Crystallographic Basis: D = {a,b,c} + // Cartesian Basis: C = {i,j,k} + // + // PDB convention: + // i || a + // j is in (a,b) plane + // k = i x j + + double s1rca2 = std::sqrt(1. - r_cos_ang_[0] * r_cos_ang_[0]); + if (s1rca2 == 0.) { + throw std::invalid_argument( + "Reciprocal unit cell alpha angle is zero or extremely close to zero."); + } + + // fractional to cartesian + orth_[0] = params_[0]; + orth_[1] = cos_ang_[2] * params_[1]; + orth_[2] = cos_ang_[1] * params_[2]; + orth_[3] = 0.; + orth_[4] = sin_ang_[2] * params_[1]; + orth_[5] = -sin_ang_[1] * r_cos_ang_[0] * params_[2]; + orth_[6] = 0.; + orth_[7] = 0.; + orth_[8] = sin_ang_[1] * params_[2] * s1rca2; + + // cartesian to fractional + frac_[0] = 1. / params_[0]; + frac_[1] = -cos_ang_[2] / (sin_ang_[2] * params_[0]); + frac_[2] = -( cos_ang_[2] * sin_ang_[1] * r_cos_ang_[0] + + cos_ang_[1] * sin_ang_[2]) + / (sin_ang_[1] * s1rca2 * sin_ang_[2] * params_[0]); + frac_[3] = 0.; + frac_[4] = 1. / (sin_ang_[2] * params_[1]); + frac_[5] = r_cos_ang_[0] / (s1rca2 * sin_ang_[2] * params_[1]); + frac_[6] = 0.; + frac_[7] = 0.; + frac_[8] = 1. / (sin_ang_[1] * s1rca2 * params_[2]); + } + + void unit_cell::init_metrical_matrices() + { + metr_mx_ = construct_metrical_matrix(params_, cos_ang_); + r_metr_mx_ = construct_metrical_matrix(r_params_, r_cos_ang_); + + using scitbx::constants::pi_180; + af::tiny_mat_ref f(d_metrical_matrix_d_params_); + f.fill(0); + f(0,0) = 2*params_[0]; + f(1,1) = 2*params_[1]; + f(2,2) = 2*params_[2]; + f(3,0) = params_[1]*cos_ang_[2]; + f(3,1) = params_[0]*cos_ang_[2]; + f(3,5) = -params_[0]*params_[1]*sin_ang_[2]*pi_180; + f(4,0) = params_[2]*cos_ang_[1]; + f(4,2) = params_[0]*cos_ang_[1]; + f(4,4) = -params_[0]*params_[2]*sin_ang_[1]*pi_180; + f(5,1) = params_[2]*cos_ang_[0]; + f(5,2) = params_[1]*cos_ang_[0]; + f(5,3) = -params_[1]*params_[2]*sin_ang_[0]*pi_180; + } + + void unit_cell::init_tensor_rank_2_orth_and_frac_linear_maps() { + uc_mat3 const &o = orthogonalization_matrix(); + af::double6 &f = u_star_to_u_iso_linear_form_; + f[0] = o[0]*o[0]; + f[1] = o[1]*o[1] + o[4]*o[4]; + f[2] = o[2]*o[2] + o[5]*o[5] + o[8]*o[8]; + f[3] = 2*o[0]*o[1]; + f[4] = 2*o[0]*o[2]; + f[5] = 2*(o[1]*o[2] + o[4]*o[5]); + f *= 1./3; + + af::tiny_mat_ref L(u_star_to_u_cart_linear_map_); + L.fill(0); + L(0,0) = o[0]*o[0]; + L(0,1) = o[1]*o[1]; + L(0,2) = o[2]*o[2]; + L(0,3) = 2*o[0]*o[1]; + L(0,4) = 2*o[0]*o[2]; + L(0,5) = 2*o[1]*o[2]; + L(1,1) = o[4]*o[4]; + L(1,2) = o[5]*o[5]; + L(1,5) = 2*o[4]*o[5]; + L(2,2) = o[8]*o[8]; + L(3,1) = o[1]*o[4]; + L(3,2) = o[2]*o[5]; + L(3,3) = o[0]*o[4]; + L(3,4) = o[0]*o[5]; + L(3,5) = o[2]*o[4] + o[1]*o[5]; + L(4,2) = o[2]*o[8]; + L(4,4) = o[0]*o[8]; + L(4,5) = o[1]*o[8]; + L(5,2) = o[5]*o[8]; + L(5,5) = o[4]*o[8]; + + af::double6 &c = u_star_to_u_cif_linear_map_; + c[0] = 1./(r_params_[0] * r_params_[0]); + c[1] = 1./(r_params_[1] * r_params_[1]); + c[2] = 1./(r_params_[2] * r_params_[2]); + c[3] = 1./(r_params_[0] * r_params_[1]); + c[4] = 1./(r_params_[0] * r_params_[2]); + c[5] = 1./(r_params_[1] * r_params_[2]); + } + + void unit_cell::initialize() + { + std::size_t i; + for(i=0;i<6;i++) { + if (params_[i] <= 0.) { + throw std::invalid_argument("Unit cell parameter is zero or negative."); + } + } + for(i=3;i<6;i++) { + double a_deg = params_[i]; + if (a_deg >= 180.) { + throw std::invalid_argument( + "Unit cell angle is greater than or equal to 180 degrees."); + } + double a_rad = scitbx::deg_as_rad(a_deg); + cos_ang_[i-3] = std::cos(a_rad); + sin_ang_[i-3] = std::sin(a_rad); + if (sin_ang_[i-3] == 0.) { + throw std::invalid_argument( + "Unit cell angle is zero or or extremely close to zero."); + } + } + init_volume(); + init_reciprocal(); + init_metrical_matrices(); + init_orth_and_frac_matrices(); + init_tensor_rank_2_orth_and_frac_linear_maps(); + longest_vector_sq_ = -1.; + shortest_vector_sq_ = -1.; + } + + unit_cell::unit_cell(af::small const& parameters) + : params_(1,1,1,90,90,90) + { + std::copy(parameters.begin(), parameters.end(), params_.begin()); + initialize(); + } + + unit_cell::unit_cell(af::double6 const& parameters) + : params_(parameters) + { + initialize(); + } + + unit_cell::unit_cell(uc_sym_mat3 const& metrical_matrix) + : params_(parameters_from_metrical_matrix(metrical_matrix.begin())) + { + try { + initialize(); + } + catch (error const&) { + throw_corrupt_metrical_matrix(); + } + } + + unit_cell::unit_cell(uc_mat3 const& orthogonalization_matrix) + : params_(parameters_from_metrical_matrix( + orthogonalization_matrix.self_transpose_times_self().begin())) + { + try { + initialize(); + } + catch (error const&) { + throw std::invalid_argument("Corrupt orthogonalization matrix."); + } + } + + // used by reciprocal() + unit_cell::unit_cell( + af::double6 const& params, + af::double3 const& sin_ang, + af::double3 const& cos_ang, + double volume, + uc_sym_mat3 const& metr_mx, + af::double6 const& r_params, + af::double3 const& r_sin_ang, + af::double3 const& r_cos_ang, + uc_sym_mat3 const& r_metr_mx) + : + params_(params), + sin_ang_(sin_ang), + cos_ang_(cos_ang), + volume_(volume), + metr_mx_(metr_mx), + r_params_(r_params), + r_sin_ang_(r_sin_ang), + r_cos_ang_(r_cos_ang), + r_metr_mx_(r_metr_mx), + longest_vector_sq_(-1.), + shortest_vector_sq_(-1.) + { + init_orth_and_frac_matrices(); + } + + unit_cell + unit_cell::reciprocal() const + { + return unit_cell( + r_params_, + r_sin_ang_, + r_cos_ang_, + 1. / volume_, + r_metr_mx_, + params_, + sin_ang_, + cos_ang_, + metr_mx_); + } + + double + unit_cell::longest_vector_sq() const + { + if (longest_vector_sq_ < 0.) { + longest_vector_sq_ = 0.; + int corner[3]; + for (corner[0] = 0; corner[0] <= 1; corner[0]++) + for (corner[1] = 0; corner[1] <= 1; corner[1]++) + for (corner[2] = 0; corner[2] <= 1; corner[2]++) { + fractional<> xf; + for(std::size_t i=0;i<3;i++) xf[i] = corner[i]; + scitbx::math::update_max(longest_vector_sq_, length_sq(xf)); + } + } + return longest_vector_sq_; + } + + double + unit_cell::shortest_vector_sq() const + { + if (shortest_vector_sq_ < 0.) { + af::double6 gruber_params = fast_minimum_reduction<>(*this) + .as_gruber_matrix(); + shortest_vector_sq_ = gruber_params[0]; + for(std::size_t i=1;i<3;i++) { + scitbx::math::update_min(shortest_vector_sq_, gruber_params[i]); + } + } + return shortest_vector_sq_; + } + + bool + unit_cell::is_degenerate(double min_min_length_over_max_length, + double min_volume_over_min_length) + { + if (volume_ == 0) return true; + double min_length = std::min(std::min(params_[0], params_[1]), params_[2]); + if (volume_ < min_length * min_volume_over_min_length) return true; + double max_length = std::max(std::max(params_[0], params_[1]), params_[2]); + if (min_length < max_length * min_min_length_over_max_length) return true; + return false; + } + + bool + unit_cell::is_similar_to(unit_cell const& other, + double relative_length_tolerance, + double absolute_angle_tolerance, + double absolute_length_tolerance) const + { + using scitbx::fn::absolute; + const double* l1 = params_.begin(); + const double* l2 = other.params_.begin(); + if (absolute_length_tolerance > 0.) { + for(std::size_t i=0;i<3;i++) { + if (absolute(l1[i] - l2[i]) > absolute_length_tolerance) { + return false; + } + } + } + else { + for(std::size_t i=0;i<3;i++) { + if (absolute(std::min(l1[i], l2[i]) / std::max(l1[i], l2[i]) - 1) + > relative_length_tolerance) { + return false; + } + } + } + const double* a1 = l1 + 3; + const double* a2 = l2 + 3; + for(std::size_t i=0;i<3;i++) { + if (absolute(a1[i] - a2[i]) > absolute_angle_tolerance) { + return false; + } + } + return true; + } + + af::shared > + unit_cell::similarity_transformations( + unit_cell const& other, + double relative_length_tolerance, + double absolute_angle_tolerance, + int unimodular_generator_range) const + { + af::shared > result; + scitbx::mat3 identity_matrix(1); + if (is_similar_to( + other, relative_length_tolerance, absolute_angle_tolerance)) { + result.push_back(identity_matrix); + } + scitbx::math::unimodular_generator + unimodular_generator(unimodular_generator_range); + while (!unimodular_generator.at_end()) { + scitbx::mat3 c_inv_r = unimodular_generator.next(); + unit_cell other_cb = other.change_basis(uc_mat3(c_inv_r)); + if (is_similar_to( + other_cb, relative_length_tolerance, absolute_angle_tolerance) + && c_inv_r != identity_matrix) { + result.push_back(c_inv_r); + } + } + return result; + } + + uc_mat3 + unit_cell::matrix_cart( + sgtbx::rot_mx const& rot_mx) const + { + return orthogonalization_matrix() + * rot_mx.as_double() + * fractionalization_matrix(); + } + + unit_cell + unit_cell::change_basis(uc_mat3 const& c_inv_r, double r_den) const + { + if (r_den == 0) { + return unit_cell(metr_mx_.tensor_transpose_transform(c_inv_r)); + } + return unit_cell(metr_mx_.tensor_transpose_transform(c_inv_r/r_den)); + } + + unit_cell + unit_cell::change_basis(sgtbx::rot_mx const& c_inv_r) const + { + return change_basis(c_inv_r.as_double(), 0); + } + + unit_cell + unit_cell::change_basis(sgtbx::change_of_basis_op const& cb_op) const + { + return change_basis(cb_op.c_inv().r().as_double(), 0); + } + + miller::index<> + unit_cell::max_miller_indices(double d_min, double tolerance) const + { + CCTBX_ASSERT(d_min > 0); + CCTBX_ASSERT(tolerance >= 0); + miller::index<> max_h; + for(std::size_t i=0;i<3;i++) { + uc_vec3 u(0,0,0); + uc_vec3 v(0,0,0); + u[(i + 1) % 3] = 1.; + v[(i + 2) % 3] = 1.; + // length of uxv is not used => sqrt(det(metr_mx)) is simply set to 1 + uc_vec3 uxv = cross_g(1., r_metr_mx_, u, v); + double uxv2 = dot_g(uxv, r_metr_mx_, uxv); + CCTBX_ASSERT(uxv2 != 0); + double uxv_abs = std::sqrt(uxv2); + CCTBX_ASSERT(uxv_abs != 0); + max_h[i] = static_cast(uxv[i] / uxv_abs / d_min + tolerance); + } + return max_h; + } + + int + unit_cell::compare_orthorhombic( + const unit_cell& other) const + { + af::double6 const& lhs = params_; + af::double6 const& rhs = other.params_; + for(std::size_t i=0;i<3;i++) { + if (lhs[i] < rhs[i]) return -1; + if (lhs[i] > rhs[i]) return 1; + } + return 0; + } + + int + unit_cell::compare_monoclinic( + const unit_cell& other, + unsigned unique_axis, + double angular_tolerance) const + { + CCTBX_ASSERT(unique_axis < 3); + af::double6 const& lhs = params_; + af::double6 const& rhs = other.params_; + double lhs_ang = lhs[unique_axis+3]; + double rhs_ang = rhs[unique_axis+3]; + using scitbx::fn::absolute; + if (absolute(lhs_ang - rhs_ang) < angular_tolerance) { + return compare_orthorhombic(other); + } + double lhs_ang_d90 = absolute(lhs_ang - 90); + double rhs_ang_d90 = absolute(rhs_ang - 90); + if (absolute(lhs_ang_d90 - rhs_ang_d90) > angular_tolerance) { + if (lhs_ang_d90 < rhs_ang_d90) return -1; + if (lhs_ang_d90 > rhs_ang_d90) return 1; + } + else { + if (lhs_ang > 90 && rhs_ang < 90) return -1; + if (lhs_ang < 90 && rhs_ang > 90) return 1; + } + if (lhs_ang > rhs_ang) return -1; + if (lhs_ang < rhs_ang) return 1; + return 0; + } + + sgtbx::change_of_basis_op const& + unit_cell::change_of_basis_op_for_best_monoclinic_beta() const + { + static const sgtbx::change_of_basis_op cb_op_identity; + static const sgtbx::change_of_basis_op cb_op_acbc("a+c,b,c"); + unit_cell alt = change_basis(cb_op_acbc); + double beta = params_[4]; + double beta_alt = alt.params_[4]; + if (beta_alt >= 90 && beta_alt < beta) return cb_op_acbc; + return cb_op_identity; + } + +}} // namespace cctbx::uctbx diff --git a/extern/cctbx/include/cctbx/coordinates.h b/extern/cctbx/include/cctbx/coordinates.h new file mode 100644 index 00000000..9e28db50 --- /dev/null +++ b/extern/cctbx/include/cctbx/coordinates.h @@ -0,0 +1,189 @@ +#ifndef CCTBX_COORDINATES_H +#define CCTBX_COORDINATES_H + +#include +#include + +namespace cctbx { + + template + class fractional; + + template + class grid_point; + + //! Class for cartesian (orthogonal, real) coordinates. + /*! The template parameter FloatType should be a floating point type + (e.g. float or double). +

+ See also: class fractional + */ + template + class cartesian : public scitbx::vec3 + { + public: + typedef scitbx::vec3 base_type; + + //! Default constructor: elements are not initialized! + cartesian() {} + + //! The elements of the coordinate vector are copied from v. + template + cartesian(af::tiny_plain const& v) + { + for(std::size_t i=0;i<3;i++) this->elems[i] = v[i]; + } + + //! The elements of the coordinate vector are copied from xyz. + explicit + cartesian(const FloatType* xyz) + { + for(std::size_t i=0;i<3;i++) this->elems[i] = xyz[i]; + } + + //! The elements of the coordinate vector are initialized with x,y,z. + cartesian(FloatType const& x, FloatType const& y, FloatType const& z) + { + this->elems[0] = x; this->elems[1] = y; this->elems[2] = z; + } + + private: + // disables construction from fractional + template + cartesian(fractional const&); + // disables construction from grid_point + template + cartesian(grid_point const&); + }; + + //! Class for fractional coordinates. + /*! The template parameter FloatType should be a floating point type + (e.g. float or double). +

+ See also: class cartesian + */ + template + class fractional : public scitbx::vec3 + { + public: + typedef scitbx::vec3 base_type; + + //! Default constructor: elements are not initialized! + fractional() {} + + //! The elements of the coordinate vector are copied from v. + template + fractional(af::tiny_plain const& v) + { + for(std::size_t i=0;i<3;i++) this->elems[i] = v[i]; + } + + //! The elements of the coordinate vector are copied from xyz. + template + explicit + fractional(const OtherFloatType* xyz) + { + for(std::size_t i=0;i<3;i++) this->elems[i] = xyz[i]; + } + + //! The elements of the coordinate vector are initialized with x,y,z. + fractional(FloatType const& x, FloatType const& y, FloatType const& z) + { + this->elems[0] = x; this->elems[1] = y; this->elems[2] = z; + } + + /*! \brief Apply modulus operation such that 0.0 <= x < 1.0 + for all elements of the coordinate vector. + */ + fractional mod_positive() const + { + fractional result; + for(std::size_t i=0;i<3;i++) { + result[i] = std::fmod(this->elems[i], 1.); + while (result[i] < 0.) result[i] += 1.; + while (result[i] >= 1.) result[i] -= 1.; + } + return result; + } + + /*! \brief Apply modulus operation such that -0.5 < x <= 0.5 + for all elements of the coordinate vector. + */ + fractional mod_short() const + { + fractional result; + for(std::size_t i=0;i<3;i++) { + result[i] = std::fmod(this->elems[i], 1.); + if (result[i] <= -.5) result[i] += 1.; + else if (result[i] > .5) result[i] -= 1.; + } + return result; + } + + scitbx::vec3 + unit_shifts() const + { + scitbx::vec3 result; + for(std::size_t i=0;i<3;i++) { + if (this->elems[i] >= 0.) result[i] = int(this->elems[i] + 0.5); + else result[i] = int(this->elems[i] - 0.5); + } + return result; + } + + private: + // disables construction from cartesian + template + fractional(cartesian const&); + // disables construction from grid_point + template + fractional(grid_point const&); + }; + + //! Class for grid_point coordinates. + /*! The template parameter IntType should be an integral type + (e.g. signed int or signed long). +

+ See also: class fractional, class cartesian + */ + template + class grid_point : public scitbx::vec3 + { + public: + typedef scitbx::vec3 base_type; + + //! Default constructor: elements are not initialized! + grid_point() {} + + //! The elements of the coordinate vector are copied from v. + template + grid_point(af::tiny_plain const& v) + { + for(std::size_t i=0;i<3;i++) this->elems[i] = v[i]; + } + + //! The elements of the coordinate vector are copied from xyz. + explicit + grid_point(const IntType* xyz) + { + for(std::size_t i=0;i<3;i++) this->elems[i] = xyz[i]; + } + + //! The elements of the coordinate vector are initialized with x,y,z. + grid_point(IntType const& x, IntType const& y, IntType const& z) + { + this->elems[0] = x; this->elems[1] = y; this->elems[2] = z; + } + + private: + // disables construction from fractional + template + grid_point(fractional const&); + // disables construction from cartesian + template + grid_point(cartesian const&); + }; + +} // namespace cctbx + +#endif // CCTBX_COORDINATES_H diff --git a/extern/cctbx/include/cctbx/eltbx/basic.h b/extern/cctbx/include/cctbx/eltbx/basic.h new file mode 100644 index 00000000..26e23b16 --- /dev/null +++ b/extern/cctbx/include/cctbx/eltbx/basic.h @@ -0,0 +1,49 @@ +#ifndef CCTBX_ELTBX_BASIC_H +#define CCTBX_ELTBX_BASIC_H + +#include + +namespace cctbx { + //! Element Toolbox namespace. + /*! The eltbx is a collection of tables of various x-ray and + neutron scattering factors, element names, atomic numbers, + atomic weights, ionic radii, and characteristic x-ray + wavelengths. Associated with each table are procedures for + accessing the tabulated data, e.g. by using interpolation. + */ + namespace eltbx { + namespace basic { + + //! Strips element label, scattering factor label, or ion label. + /*! For internal use only. +

+ Returns leading part of atom label. Ignores leading whitespace. + Copies input label starting at first non-whitespace. Copying + stops at whitespace, second digit, or the characters "+" or "-". + Lower case letters are converted to upper case.
+ "na+" is converted to "NA1+", i.e. "1" is implicit.
+ "Si4+A" is converted to "SI4+". +

+ If exact == true, copying must stop at a whitespace or + end-of-string. Otherwise the empty string is returned. + For example, with exact == true "Si4+A" is converted to "". + */ + std::string + strip_label(std::string const& Label, bool exact = false); + + //! Compares an input label with a label from an internal table. + /*! For internal use only. +

+ Comparison is case-insensitive.
+ If the labels match exactly, the return value is the number + of matching characters multiplied by -1.
+ If only the first characters match and the second character of + tab_label is a letter, the return value is 0.
+ Otherwise the return value is the number of matching characters. + */ + int + match_labels(std::string const& work_label, const char* tab_label); + +}}} // namespace cctbx::eltbx::basic + +#endif // CCTBX_ELTBX_BASIC_H diff --git a/extern/cctbx/include/cctbx/eltbx/covalent_radii.h b/extern/cctbx/include/cctbx/eltbx/covalent_radii.h new file mode 100644 index 00000000..ae1e8641 --- /dev/null +++ b/extern/cctbx/include/cctbx/eltbx/covalent_radii.h @@ -0,0 +1,86 @@ +#ifndef CCTBX_ELTBX_COVALENT_RADII_H +#define CCTBX_ELTBX_COVALENT_RADII_H + +#include + +namespace cctbx { namespace eltbx { namespace covalent_radii { + + namespace detail { + + struct raw_record + { + const char* label; + float radius; + float esd; + }; + + } + + //! Access to table of covalent radii. + /*! Reference:

+      Beatriz Cordero, Verónica Gómez, Ana E. Platero-Prats, Marc Revés,
+      Jorge Echeverría, Eduard Cremades, Flavia Barragán and Santiago Alvarez.
+      Covalent radii revisited. Dalton Trans., 2008, 2832-2838,
+      doi:10.1039/b801115j
+   */
+  class table
+  {
+    public:
+      //! Default constructor. Calling certain methods may cause crashes!
+      table() : record_(0)  {}
+
+      //! Looks up covalent radius for the given atom label.
+      /*! If exact == true, the covalent label must exactly
+          match the tabulated label. However, the lookup is not
+          case-sensitive.
+          See also: eltbx::basic::strip_label()
+       */
+      explicit
+      table(std::string const& label, bool exact=false);
+
+      //! Tests if the instance is constructed properly.
+      /*! Shorthand for: label() != 0
+          

+ Not available in Python. + */ + bool + is_valid() const { return record_->label != 0; } + + //! Label from table. + const char* + label() const { return record_->label; } + + //! Radius [Angstrom] from table. + float + radius() const { return record_->radius; } + + //! E.s.d. [Angstrom] from table. + float + esd() const { return record_->esd; } + + private: + const detail::raw_record* record_; + friend class table_iterator; + }; + + /*! \brief Iterator over table of radii. + */ + class table_iterator + { + public: + //! Initialization of the iterator. + table_iterator(); + + //! Retrieves the next entry from the internal table. + /*! Use table::is_valid() to detect end-of-iteration. + */ + table + next(); + + private: + table current_; + }; + +}}} // cctbx::eltbx::covalent_radii + +#endif // CCTBX_ELTBX_COVALENT_RADII_H diff --git a/extern/cctbx/include/cctbx/eltbx/fp_fdp.h b/extern/cctbx/include/cctbx/eltbx/fp_fdp.h new file mode 100644 index 00000000..e90fd8d5 --- /dev/null +++ b/extern/cctbx/include/cctbx/eltbx/fp_fdp.h @@ -0,0 +1,117 @@ +#ifndef CCTBX_ELTBX_FP_FDP_H +#define CCTBX_ELTBX_FP_FDP_H + +#include +#include +#include + +namespace cctbx { namespace eltbx { + + namespace anomalous { + + struct e_fp_fdp + { + float e; + float fp; + float fdp; + }; + + struct label_z_e_fp_fdp + { + const char* label; + int z; + const e_fp_fdp* data; + }; + + struct iterator_init_tag {}; + + } // namespace anomalous + + //! Indicator for undefined values. + static const float fp_fdp_undefined = -9999.00; + + //! Helper class for passing f' (f-prime) and f" (f-double-prime). + class fp_fdp + { + public: + //! Constructor. + explicit + fp_fdp(float fp = fp_fdp_undefined, + float fdp = fp_fdp_undefined) + : fp_(fp), fdp_(fdp) + {} + + //! Tests if f-prime is defined. + bool is_valid_fp() const { return fp_ != fp_fdp_undefined; } + + //! Tests if f-double-prime is defined. + bool is_valid_fdp() const { return fdp_ != fp_fdp_undefined; } + + //! Tests if f-prime and f-double-prime are defined. + bool is_valid() const { return is_valid_fp() && is_valid_fdp(); } + + //! Returns f-prime (f'). + float fp() const { return fp_; } + + //! Returns f-double-prime (f"). + float fdp() const { return fdp_; } + + //! Returns complex(f-prime, f-double-prime). + /*! Not available in Python. + */ + std::complex as_complex_float() const + { + return std::complex(fp_, fdp_); + } + + //! Returns complex(f-prime, f-double-prime). + /*! Python: as_complex() + */ + std::complex as_complex_double() const + { + return std::complex(fp_, fdp_); + } + + private: + float fp_; + float fdp_; + }; + + namespace anomalous { + + template + const TableType* + find_entry(const TableType* tables, + std::string const& work_label, + bool exact, + bool exception_if_no_match) + { + // map D to H + std::string wl = work_label; + if (wl == "D") wl = "H"; + int m = 0; + const TableType* m_entry = 0; + for (const TableType* entry = tables; entry->label; entry++) + { + int i = basic::match_labels(wl, entry->label); + if (i < 0) return entry; + if (i > m && !isdigit(entry->label[i - 1])) { + m = i; + m_entry = entry; + } + } + if (exception_if_no_match && (exact || !m_entry)) { + throw std::invalid_argument( + "Unknown scattering type label: " + std::string(work_label)); + } + return m_entry; + } + + fp_fdp interpolate(const label_z_e_fp_fdp* m_label_z_e_fp_fdp, + double energy); + + } // namespace anomalous + +}} // cctbx::eltbx + +#endif // CCTBX_ELTBX_FP_FDP_H diff --git a/extern/cctbx/include/cctbx/eltbx/henke.h b/extern/cctbx/include/cctbx/eltbx/henke.h new file mode 100644 index 00000000..91d6dea0 --- /dev/null +++ b/extern/cctbx/include/cctbx/eltbx/henke.h @@ -0,0 +1,131 @@ +#ifndef CCTBX_ELTBX_HENKE_H +#define CCTBX_ELTBX_HENKE_H + +#include +#include + +namespace cctbx { namespace eltbx { namespace henke { + + //! Access to Henke tables. + /*! Henke tables are available for elements with Z=1-92. + Each table contains 500+ points on a uniform logarithmic mesh + from 10 to 30,000 eV with points added 0.1 eV above and below + "sharp" absorption edges. The atomic scattering factors are + based upon experimental measurements of the atomic + photoabsorption cross section. The absorption measurements + provide values for the imaginary part of the atomic scattering + factor. The real part is calculated from the absorption + measurements using the Kramers-Kronig integral relations. +

+ Reference: B. L. Henke, E. M. Gullikson, and J. C. Davis, + Atomic Data and Nuclear Data Tables Vol. 54 No. 2 (July 1993).
+ ftp://grace.lbl.gov/pub/sf/ +

+ See also: + http://www-cxro.lbl.gov/optical_constants/asf.html
+ http://www.esrf.fr/computing/scientific/dabax/ + */ + class table + { + public: + //! Default constructor. Calling certain methods may cause crashes! + table() : label_z_e_fp_fdp_(0) {} + + //! Searches Henke tables for the given scattering factor label. + /*! If exact == true, the scattering factor label must exactly + match the tabulated label. However, the search is not + case-sensitive. +

+ If exception_if_no_match == true, an exception is thrown + if the label cannot be found.
+ If exception_if_no_match == false, use is_valid() to test + if the label was found.
+ exception_if_no_match is not available in Python. Use + try-except instead. +

+ See also: eltbx::basic::strip_label() + */ + explicit + table( + std::string const& label, + bool exact=false, + bool exception_if_no_match=true); + + //! Tests if the instance is constructed properly. + /*! Shorthand for: label() != 0 +

+ Not available in Python. + */ + bool + is_valid() const + { + return label_z_e_fp_fdp_ != 0 && label_z_e_fp_fdp_->label != 0; + } + + //! Returns the scattering factor label. + const char* + label() const { return label_z_e_fp_fdp_->label; } + + //! Returns the atomic number. + int + atomic_number() const { return label_z_e_fp_fdp_->z; } + + //! Computes f-prime (f') and f-double-prime (f") for given energy [eV]. + /*! f-prime and f-double-prime are determined by linear + interpolation. +

+ See also: + at_kev(), + at_angstrom() + */ + fp_fdp + at_ev(double energy) const; + + //! Computes f-prime (f') and f-double-prime (f") for given energy [keV]. + /*! See also: + at_ev() + at_angstrom() + */ + fp_fdp + at_kev(double energy) const { return at_ev(energy * 1000); } + + /*! \brief Computes f-prime (f') and f-double-prime (f") for + given wavelength [Angstrom]. + */ + /*! See also: + at_kev(), + at_ev(), + scitbx::constants::factor_ev_angstrom + */ + fp_fdp + at_angstrom(double wavelength) const + { + return at_ev(scitbx::constants::factor_ev_angstrom / wavelength); + } + + private: + const anomalous::label_z_e_fp_fdp* label_z_e_fp_fdp_; + friend class table_iterator; + }; + + /*! \brief Iterator over Henke tables. + */ + class table_iterator + { + public: + //! Initialization of the iterator. + table_iterator(); + + //! Retrieves the next entry from the internal table. + /*! Use table::is_valid() to detect end-of-iteration. + */ + table + next(); + + private: + table current_; + }; + +}}} // cctbx::eltbx::henke + +#endif // CCTBX_ELTBX_HENKE_H diff --git a/extern/cctbx/include/cctbx/eltbx/icsd_radii.h b/extern/cctbx/include/cctbx/eltbx/icsd_radii.h new file mode 100644 index 00000000..fd87d31e --- /dev/null +++ b/extern/cctbx/include/cctbx/eltbx/icsd_radii.h @@ -0,0 +1,105 @@ +#ifndef CCTBX_ELTBX_ICSD_RADII_H +#define CCTBX_ELTBX_ICSD_RADII_H + +#include + +namespace cctbx { namespace eltbx { namespace icsd_radii { + + namespace detail { + + struct raw_record + { + const char* label; + float radius; + }; + + } + + //! Access to table of ionic radii. + /*! Reference:

+                          U s e r ' s  M a n u a l
+                         I C S D  -  C R Y S T I N
+                         =========================
+                    Inorganic Crystal Structure Database
+                            in conjunction with
+                   Crystal Structure Information System
+                           and its application to
+                CCDF - Cambridge Crystallographic Data File
+                                    and
+                           MDF - Metal Data File
+                    G.Bergerhoff, B.Kilger, C.Witthauer,
+                            R.Hundt, R.Sievers
+                                    Bonn
+                                    1986
+             Institut fuer Anorganische Chemie der Universitaet
+            -------------------------------------------------------------
+            ICSD/CRYSTIN User's Manual.
+            English Version. Translated by Ruth Schubert.
+            Updated Dec. 1986.
+ + These radii are also the basis of the distance tests, which are + routinely carried out when collecting data in the ICSD system. + In this connection, negative increments are obtained for the + specially small atoms C+4, D+1, H+1 and N+5. + */ + class table + { + public: + //! Default constructor. Calling certain methods may cause crashes! + table() : record_(0) {} + + //! Looks up ionic radius for the given ion label. + /*! If exact == true, the ion label must exactly + match the tabulated label. However, the lookup is not + case-sensitive. +

+ E.g., "SI4" will be matched with "Si".
+ "Si4+" and "Si+4" will be matched with "Si4+".
+

+ See also: eltbx::basic::strip_label() + */ + explicit + table(std::string const& label, bool exact=false); + + //! Tests if the instance is constructed properly. + /*! Shorthand for: label() != 0 +

+ Not available in Python. + */ + bool + is_valid() const { return record_->label != 0; } + + //! Label from table. + const char* + label() const { return record_->label; } + + //! Radius [Angstrom] from table. + float + radius() const { return record_->radius; } + + private: + const detail::raw_record* record_; + friend class table_iterator; + }; + + /*! \brief Iterator over table of radii. + */ + class table_iterator + { + public: + //! Initialization of the iterator. + table_iterator(); + + //! Retrieves the next entry from the internal table. + /*! Use table::is_valid() to detect end-of-iteration. + */ + table + next(); + + private: + table current_; + }; + +}}} // cctbx::eltbx::icsd_radii + +#endif // CCTBX_ELTBX_ICSD_RADII_H diff --git a/extern/cctbx/include/cctbx/eltbx/neutron.h b/extern/cctbx/include/cctbx/eltbx/neutron.h new file mode 100644 index 00000000..02d64846 --- /dev/null +++ b/extern/cctbx/include/cctbx/eltbx/neutron.h @@ -0,0 +1,131 @@ +#ifndef CCTBX_ELTBX_NEUTRON_H +#define CCTBX_ELTBX_NEUTRON_H + +#include +#include +#include + +namespace cctbx { namespace eltbx { namespace neutron { + + namespace detail + { + struct raw_record_neutron_news_1992 + { + const char* label; + float bound_coh_scatt_length_real; + float bound_coh_scatt_length_imag; + float abs_cross_sect; // For 2200 m/s neutrons + }; + } + + //! Access to neutron bound scattering lengths & cross-sections. + /*! Reference:
+ Neutron News, Vol. 3, No. 3, 1992, pp. 29-37. +

+ http://www.ncnr.nist.gov/resources/n-lengths/list.html + */ + class neutron_news_1992_table + { + public: + //! Default constructor. Calling certain methods may cause crashes! + neutron_news_1992_table() : record_(0) {} + + //! Search internal table for the given element label. + /*! If exact == true, the element label must exactly + match the tabulated label. However, the lookup is not + case-sensitive. +

+ See also: eltbx::basic::strip_label() + */ + explicit + neutron_news_1992_table(std::string const& label, bool exact=false); + + //! Tests if the instance is constructed properly. + /*! Shorthand for: label() != 0 +

+ Not available in Python. + */ + bool + is_valid() const { return record_->label != 0; } + + //! Element label from internal table. + const char* + label() const + { + return record_->label; + } + + //! Bound coherent scattering length (fm) as a complex number. + /*! 1 fm = 1e-15 m + */ + std::complex + bound_coh_scatt_length() const + { + return std::complex(record_->bound_coh_scatt_length_real, + record_->bound_coh_scatt_length_imag); + } + + //! Real part of bound coherent scattering length (fm). + /*! 1 fm = 1e-15 m +

+ Not available in Python. + */ + float + bound_coh_scatt_length_real() const + { + return record_->bound_coh_scatt_length_real; + } + + //! Imaginary part of bound coherent scattering length (fm). + /*! 1 fm = 1e-15 m +

+ Not available in Python. + */ + float + bound_coh_scatt_length_imag() const + { + return record_->bound_coh_scatt_length_imag; + } + + //! Absorption cross section (barn) for 2200 m/s neutrons. + /*! 1 barn = 1e-24 cm^2 + */ + float + abs_cross_sect() const + { + return record_->abs_cross_sect; + } + + cctbx::eltbx::xray_scattering::gaussian + fetch() const + { + return cctbx::eltbx::xray_scattering::gaussian(record_->bound_coh_scatt_length_real, true); + } + + private: + const detail::raw_record_neutron_news_1992* record_; + friend class neutron_news_1992_table_iterator; + }; + + /*! \brief Iterator over neutron_news_1992_table entries. + */ + class neutron_news_1992_table_iterator + { + public: + //! Initialization of the iterator. + neutron_news_1992_table_iterator(); + + //! Retrieves the next entry from the internal table. + /*! Use neutron_news_1992_table_iterator::is_valid() to detect + end-of-iteration. + */ + neutron_news_1992_table + next(); + + private: + neutron_news_1992_table current_; + }; + +}}} // cctbx::eltbx::neutron + +#endif // CCTBX_ELTBX_NEUTRON_H diff --git a/extern/cctbx/include/cctbx/eltbx/tiny_pse.h b/extern/cctbx/include/cctbx/eltbx/tiny_pse.h new file mode 100644 index 00000000..ec34070c --- /dev/null +++ b/extern/cctbx/include/cctbx/eltbx/tiny_pse.h @@ -0,0 +1,92 @@ +#ifndef CCTBX_ELTBX_TINY_PSE_H +#define CCTBX_ELTBX_TINY_PSE_H + +#include + +namespace cctbx { namespace eltbx { namespace tiny_pse { + + namespace detail + { + struct raw_record { + int z; + const char* symbol; + const char* name; + float weight; + }; + } + + //! Tiny Periodic System of Elements. + /*! Reference:
+ CRC Handbook of Chemistry & Physics, 63rd edition, 1982-1983
+ CRC Handbook of Chemistry & Physics, 70th edition, 1989-1990 + */ + class table + { + public: + //! Default constructor. Calling certain methods may cause crashes! + table() : record_(0) {} + + //! Looks up table entry by element symbol. + /*! If exact == true, the scattering factor label must exactly + match the tabulated label. However, the lookup is not + case-sensitive. +

+ See also: eltbx::basic::strip_label() + */ + explicit + table(std::string const& label, bool exact=false); + + //! Looks up table entry by atomic number. + explicit + table(int atomic_number); + + //! Tests if the instance is constructed properly. + /*! Shorthand for: atomic_number() != 0 +

+ Not available in Python. + */ + bool + is_valid() const { return record_->z != 0; } + + //! Atomic number. + int + atomic_number() const { return record_->z; } + + //! Element symbol. + const char* + symbol() const { return record_->symbol; } + + //! Element name. + const char* + name() const { return record_->name; } + + //! Atomic weight. + float + weight() const { return record_->weight; } + + private: + const detail::raw_record* record_; + friend class table_iterator; + }; + + /*! \brief Iterator over table entries. + */ + class table_iterator + { + public: + //! Initialization of the iterator. + table_iterator(); + + //! Retrieves the next entry from the internal table. + /*! Use table::is_valid() to detect end-of-iteration. + */ + table + next(); + + private: + table current_; + }; + +}}} // cctbx::eltbx::tiny_pse + +#endif // CCTBX_ELTBX_TINY_PSE_H diff --git a/extern/cctbx/include/cctbx/eltbx/wavelengths.h b/extern/cctbx/include/cctbx/eltbx/wavelengths.h new file mode 100644 index 00000000..215ef14e --- /dev/null +++ b/extern/cctbx/include/cctbx/eltbx/wavelengths.h @@ -0,0 +1,96 @@ +#ifndef CCTBX_ELTBX_WAVELENGTHS_H +#define CCTBX_ELTBX_WAVELENGTHS_H + +#include +#include + +namespace cctbx { namespace eltbx { namespace wavelengths { + + namespace detail + { + struct raw + { + const char* label; + float value; + }; + } + + //! Characteristic wavelengths of commonly used x-ray tube target materials. + class characteristic + { + public: + //! Default constructor. Calling certain methods may cause crashes! + characteristic() : raw_(0) {} + + //! Retrieves characteristic wavelength for given label. + /*! The lookup is not case-sensitive. +

+ See also: is_valid() + */ + characteristic(std::string const& label); + + //! Tests if the label passed to the contructor could be matched. + /*! Shorthand for: as_angstrom() != 0 + */ + bool + is_valid() const { return raw_->value != 0; } + + //! Returns label (e.g. Cu or CuA1). + /*! See also: is_valid() + */ + const char* + label() const + { + return raw_->label; + } + + //! Wavelength (Angstrom). + /*! See also: is_valid() + */ + float + as_angstrom() const + { + return raw_->value; + } + + //! Energy [keV]. + /*! See also: is_valid() + */ + float + as_kev() const + { + if (raw_->value == 0.) return 0.; + return scitbx::constants::factor_kev_angstrom / raw_->value; + } + + //! Energy [eV]. + /*! See also: is_valid() + */ + float + as_ev() const { return as_kev() * 1000; } + + private: + const detail::raw* raw_; + friend class characteristic_iterator; + }; + + //! Iterator over characteristic wavelengths. + class characteristic_iterator + { + public: + //! Initialization of the iterator. + characteristic_iterator(); + + //! Retrieves the next entry from the internal table. + /*! Use characteristic::is_valid() to detect end-of-iteration. + */ + characteristic + next(); + + private: + characteristic current_; + }; + +}}} // cctbx::eltbx::wavelengths + +#endif // CCTBX_ELTBX_WAVELENGTHS_H diff --git a/extern/cctbx/include/cctbx/eltbx/xray_scattering.h b/extern/cctbx/include/cctbx/eltbx/xray_scattering.h new file mode 100644 index 00000000..83ea660e --- /dev/null +++ b/extern/cctbx/include/cctbx/eltbx/xray_scattering.h @@ -0,0 +1,353 @@ +#ifndef CCTBX_ELTBX_XRAY_SCATTERING_H +#define CCTBX_ELTBX_XRAY_SCATTERING_H + +#include +#include +#include +#include +#include +#include + +namespace cctbx { namespace eltbx { namespace xray_scattering { + + static const char *standard_labels[] = { + "H", "D", "T", + "Hiso", + "He", "Li", "Be", "B", "C", "N", "O", "F", "Ne", "Na", "Mg", "Al", + "Si", "P", "S", "Cl", "Ar", "K", "Ca", "Sc", "Ti", "V", "Cr", "Mn", + "Fe", "Co", "Ni", "Cu", "Zn", "Ga", "Ge", "As", "Se", "Br", "Kr", + "Rb", "Sr", "Y", "Zr", "Nb", "Mo", "Tc", "Ru", "Rh", "Pd", "Ag", + "Cd", "In", "Sn", "Sb", "Te", "I", "Xe", "Cs", "Ba", "La", "Ce", + "Pr", "Nd", "Pm", "Sm", "Eu", "Gd", "Tb", "Dy", "Ho", "Er", "Tm", + "Yb", "Lu", "Hf", "Ta", "W", "Re", "Os", "Ir", "Pt", "Au", "Hg", + "Tl", "Pb", "Bi", "Po", "At", "Rn", "Fr", "Ra", "Ac", "Th", "Pa", + "U", "Np", "Pu", "Am", "Cm", "Bk", "Cf", + "H1-", "D1-", "T1-", + "Li1+", "Be2+", "Cval", "O1-", "O2-", "F1-", "Na1+", "Mg2+", + "Al3+", "Sival", "Si4+", "Cl1-", "K1+", "Ca2+", "Sc3+", "Ti2+", + "Ti3+", "Ti4+", "V2+", "V3+", "V5+", "Cr2+", "Cr3+", "Mn2+", + "Mn3+", "Mn4+", "Fe2+", "Fe3+", "Co2+", "Co3+", "Ni2+", "Ni3+", + "Cu1+", "Cu2+", "Zn2+", "Ga3+", "Ge4+", "Br1-", "Rb1+", "Sr2+", + "Y3+", "Zr4+", "Nb3+", "Nb5+", "Mo3+", "Mo5+", "Mo6+", "Ru3+", + "Ru4+", "Rh3+", "Rh4+", "Pd2+", "Pd4+", "Ag1+", "Ag2+", "Cd2+", + "In3+", "Sn2+", "Sn4+", "Sb3+", "Sb5+", "I1-", "Cs1+", "Ba2+", + "La3+", "Ce3+", "Ce4+", "Pr3+", "Pr4+", "Nd3+", "Pm3+", "Sm3+", + "Eu2+", "Eu3+", "Gd3+", "Tb3+", "Dy3+", "Ho3+", "Er3+", "Tm3+", + "Yb2+", "Yb3+", "Lu3+", "Hf4+", "Ta5+", "W6+", "Os4+", "Ir3+", + "Ir4+", "Pt2+", "Pt4+", "Au1+", "Au3+", "Hg1+", "Hg2+", "Tl1+", + "Tl3+", "Pb2+", "Pb4+", "Bi3+", "Bi5+", "Ra2+", "Ac3+", "Th4+", + "U3+", "U4+", "U6+", "Np3+", "Np4+", "Np6+", "Pu3+", "Pu4+", + "Pu6+", 0 + }; + + inline + bool + is_reserved_scattering_type_label( + std::string const& label) + { + if (label == "const") return true; + if (label == "TX" || label == "XX") return true; + if (label == "unknown") return true; + return false; + } + + inline + void + throw_if_reserved_scattering_type_label( + std::string const& label) + { + if (is_reserved_scattering_type_label(label)) { + throw std::invalid_argument( + "Reserved scattering type label: \""+label+"\""); + } + } + + inline + boost::optional + get_standard_label( + std::string const& label, + bool exact=false, + bool optional=false) + { + if (label == "const") return boost::optional(label); + if (label == "TX" || label == "XX") return boost::optional(label); + std::string work_label = basic::strip_label(label, exact); + const char* result = 0; + int m = 0; + for (const char **std_lbl = standard_labels; *std_lbl; std_lbl++) { + int i = basic::match_labels(work_label, *std_lbl); + if (i < 0 /* exact match */) { + return boost::optional(*std_lbl); + } + if (i > m && !isdigit((*std_lbl)[i-1])) { + m = i; + result = *std_lbl; + } + } + if (exact || result == 0) { + if (optional) return boost::optional(); + throw std::invalid_argument( + "Unknown scattering type label: \"" + label + "\""); + } + return boost::optional(result); + } + + inline + std::string + replace_hydrogen_isotype_labels(std::string standard_label) + { + if (standard_label == "D" || standard_label == "T" ) return "H"; + else if (standard_label == "D1-" || standard_label == "T1-") return "H1-"; + return standard_label; + } + + namespace detail { + + static const float undefined = -99999.; + + template + struct raw_table_entry + { + const char* label; + float a[N], b[N], c; + }; + + } + + //! Coefficients for the Analytical Approximation to the Scattering Factor. + /*! Used to work with coefficients from the International + Tables Volume C (1992) (template parameter N = 4) and Waasmaier & + Kirfel (1995), Acta Cryst. A51, 416-431 (template parameter N = 5). + */ + template + class base + { + public: + //! Default constructor. Calling certain methods may cause crashes! + base() : table_(0), entry_(0) {} + + //! Constructor. For internal use only. + base(const detail::raw_table_entry* table_raw, + const char* table, + std::string const& label, + bool exact); + + //! Tests if the instance is constructed properly. + /*! Shorthand for: label() != 0 +

+ Not available in Python. + */ + bool + is_valid() const { return entry_->label != 0; } + + //! Label of table. Either "IT1992" or "WK1995". + const char* table() const { return table_; } + + //! Scattering factor label. E.g. "Si4+". + const char* label() const { return entry_->label; } + + //! Fetches the Gaussian terms from the static table. + gaussian + fetch() const + { + typedef af::small small_t; + return gaussian( + small_t(entry_->a, entry_->a+N), + small_t(entry_->b, entry_->b+N), + entry_->c, true); + } + + protected: + const char *table_; + const detail::raw_table_entry* entry_; + void next_entry(); + }; + + // non-inline constructor + template + base::base(const detail::raw_table_entry* table_raw, + const char* table, + std::string const& label, + bool exact) + : + table_(table), entry_(0) + { + throw_if_reserved_scattering_type_label(label); + std::string std_lbl = replace_hydrogen_isotype_labels( + *get_standard_label(label, exact)); + for (const detail::raw_table_entry* entry = table_raw; + entry->label; + entry++) { + if (entry->label == std_lbl) { + entry_ = entry; + break; + } + } + if (entry_ == 0) { + throw std::invalid_argument( + "Unknown scattering type label: \"" + label + "\""); + } + } + + // non-inline member function + template + void + base::next_entry() + { + if (is_valid()) entry_++; + } + + //! Coefficients for the Analytical Approximation to the Scattering Factor. + /*! Coefficients from the International Tables for Crystallography, + Volume C, Mathematical, Physical and Chemical Tables, + Edited by A.J.C. Wilson, Kluwer Academic Publishers, + Dordrecht/Boston/London, 1992. +

+ Table 6.1.1.4 (pp. 500-502): + Coefficients for analytical approximation to the scattering factors + of Tables 6.1.1.1 and 6.1.1.3. +

+ Table 6.1.1.4 is a reprint of Table 2.2B, pp. 99-101, + International Tables for X-ray Crystallography, Volume IV, + The Kynoch Press: Birmingham, England, 1974. + There is just one difference for Tl3+:

+                IT Vol IV 1974: a2 = 18.3841
+                IT Vol C  1992: a2 = 18.3481
+

+ The value from IT Vol IV is presumed to be the correct one + and used here. +

+ If possible, the class xray_scattering::wk1995 should be used + instead of this class. + The coefficients of Waasmaier & Kirfel give more precise + approximations than the coefficients of Volume C + and some errors are corrected. +

+ See also: + xray_scattering::it1992_iterator, + xray_scattering::wk1995, + xray_scattering::base + */ + class it1992: public base<4> + { + public: + //! Facilitates meta-programming. + typedef base<4> base_type; + + //! Default constructor. Calling certain methods may cause crashes! + it1992() {} + + //! Looks up coefficients for the given scattering factor label. + /*! If exact == true, the scattering factor label must exactly + match the tabulated label. However, the lookup is not + case-sensitive.
+ E.g., "SI4" will be matched with "Si".
+ "Si4+" and "Si+4" will be matched with "Si4+".
+ See also: eltbx::basic::strip_label() +

+ Note that the other methods of this class are inherited from + class xray_scattering::base. + */ + it1992(std::string const& label, bool exact=false); + + protected: + friend class it1992_iterator; + }; + + /*! \brief Iterator over table of Coefficients for the Analytical + Approximation to the Scattering Factor, International Tables 1992. + */ + class it1992_iterator + { + public: + //! Initialization of the iterator. + it1992_iterator(); + + //! Retrieves the next entry from the internal table. + /*! Use it1992::is_valid() to detect end-of-iteration. + */ + it1992 + next(); + + private: + it1992 current_; + }; + + //! Coefficients for the Analytical Approximation to the Scattering Factor. + /*! Coefficients from Waasmaier & Kirfel (1995), Acta Cryst. A51, 416-431. +

+ The original data can be found at: +

+      ftp://wrzx02.rz.uni-wuerzburg.de/pub/local/Crystallography/sfac.dat
+      
+ File picked up Jul 4, 1995. + File verified Sep 12, 2001. +

+ Header of "sfac.dat": +

+        - Fitparameters of all atoms/ions (with the excepetion of O1-)
+          from publication "New Analytical Scattering Factor Functions
+          for Free Atoms and Ions", D. Waasmaier & A. Kirfel, Acta Cryst.
+          A 1995, in press)
+
+        - Fit for O1- based on the tabulated values of Table 2 (D.REZ,
+          P.REZ & I.GRANT, Acta Cryst. (1994), A50, 481-497).
+
+        - Fits for all other atoms/ions based on the tabulated values
+          of Table 6.1.1.1 (atoms) and Table 6.1.1.3 (ions)
+          (International Tables for Crystallography, Vol. C, 1992).
+      
+

+ See also: + xray_scattering::wk1995_iterator, + xray_scattering::it1992, + xray_scattering::base + */ + class wk1995: public base<5> + { + public: + //! Facilitates meta-programming. + typedef base<5> base_type; + + //! Default constructor. Calling certain methods may cause crashes! + wk1995() {} + + //! Looks up coefficients for the given scattering factor label. + /*! If exact == true, the scattering factor label must exactly + match the tabulated label. However, the lookup is not + case-sensitive.
+ E.g., "SI4" will be matched with "Si".
+ "Si4+" and "Si+4" will be matched with "Si4+".
+ See also: eltbx::basic::strip_label() +

+ Note that the other methods of this class are inherited from + class base. + */ + wk1995(std::string const& label, bool exact=false); + + protected: + friend class wk1995_iterator; + }; + + /*! \brief Iterator over table of Coefficients for the Analytical + Approximation to the Scattering Factor, Waasmaier & Kirfel 1995. + */ + class wk1995_iterator + { + public: + //! Initialization of the iterator. + wk1995_iterator(); + + //! Retrieves the next entry from the internal table. + /*! Use wk1995::is_valid() to detect end-of-iteration. + */ + wk1995 + next(); + + private: + wk1995 current_; + }; + +}}} // cctbx::eltbx::xray_scattering + +#endif // CCTBX_ELTBX_XRAY_SCATTERING_H diff --git a/extern/cctbx/include/cctbx/eltbx/xray_scattering/form_factor.h b/extern/cctbx/include/cctbx/eltbx/xray_scattering/form_factor.h new file mode 100644 index 00000000..f416bbf4 --- /dev/null +++ b/extern/cctbx/include/cctbx/eltbx/xray_scattering/form_factor.h @@ -0,0 +1,88 @@ +#ifndef CCTBX_ELTBX_XRAY_SCATTERING_FORM_FACTOR_H +#define CCTBX_ELTBX_XRAY_SCATTERING_FORM_FACTOR_H + +#include +#include + +namespace cctbx { namespace eltbx { + +//! X-ray scattering tables. +namespace xray_scattering { + + //! Helper. + template + class isotropic_form_factor_mixin + { + Derived const & heir() const { + return static_cast(*this); + } + + public: + /*! \brief Value at the point stol + (sin-theta-over-lambda), given stol^2. + */ + /*! See also: at_stol(), at_d_star(), at_d_star_sq(), + uctbx::unit_cell::stol() + */ + double + at_stol_sq(double stol_sq) const + { + return heir().at_x_sq(stol_sq); + } + + /*! \brief Value at the point stol + (sin-theta-over-lambda). + */ + /*! See also: at_stol_sq(), at_d_star(), at_d_star_sq(), + */ + double + at_stol(double stol) const + { + return heir().at_x_sq(stol * stol); + } + + /*! \brief Value at the point d_star + (1/d), given d_star^2. + */ + /*! See also: at_stol_sq(), at_stol(), at_d_star(), + uctbx::unit_cell::d_star_sq() + */ + double + at_d_star_sq(double d_star_sq) const + { + return heir().at_x_sq(d_star_sq / 4); + } + + /*! \brief Value at the points d_star + (1/d), given d_star^2. + */ + /*! See also: at_stol_sq(), at_stol(), at_d_star(), + uctbx::unit_cell::d_star_sq() + */ + af::shared + at_d_star_sq(af::const_ref const& d_star_sq) const + { + af::shared + result(d_star_sq.size(), af::init_functor_null()); + for(std::size_t i=0;i +#include +#include + +namespace cctbx { namespace eltbx { namespace xray_scattering { + + class gaussian + : public scitbx::math::gaussian::sum, + public isotropic_form_factor_mixin + { + public: + typedef scitbx::math::gaussian::sum base_t; + + //! Default constructor. Some data members are not initialized! + gaussian() {} + + //! Initialization given an instance of the base type. + gaussian(base_t const& gaussian_sum) + : + base_t(gaussian_sum) + {} + + //! Initialization of the constant. + explicit + gaussian(double c, bool use_c=true) + : + base_t(c, use_c) + {} + + //! Initialization of the terms and optionally the constant. + /*! If c is different from zero use_c will automatically be + set to true. + */ + gaussian( + af::small const& a, + af::small const& b, + double c=0, + bool use_c=false) + : + base_t(a, b, c, use_c) + {} + + //! Initialization of the terms and optionally the constant. + /*! If c is different from zero use_c will automatically be + set to true. + */ + gaussian( + af::const_ref const& ab, + double c=0, + bool use_c=false) + : + base_t(ab, c, use_c) + {} + }; + +}}} // cctbx::eltbx::xray_scattering + +#endif // CCTBX_ELTBX_XRAY_SCATTERING_GAUSSIAN_H diff --git a/extern/cctbx/include/cctbx/error.h b/extern/cctbx/include/cctbx/error.h new file mode 100644 index 00000000..338debf1 --- /dev/null +++ b/extern/cctbx/include/cctbx/error.h @@ -0,0 +1,77 @@ +/* ***************************************************** + THIS IS AN AUTOMATICALLY GENERATED FILE. DO NOT EDIT. + ***************************************************** + + Generated by: + scitbx.generate_error_h + */ + +/*! \file + Declarations and macros for exception handling. + */ + +#ifndef CCTBX_ERROR_H +#define CCTBX_ERROR_H + +#include + +#define CCTBX_CHECK_POINT \ + std::cout << __FILE__ << "(" << __LINE__ << ")" << std::endl << std::flush +#define CCTBX_CHECK_POINT_MSG(msg) \ + std::cout << msg << " @ " __FILE__ << "(" << __LINE__ << ")" << std::endl << std::flush +#define CCTBX_EXAMINE(A) \ + std::cout << "variable " << #A << ": " << A << std::endl << std::flush + +//! Common cctbx namespace. +namespace cctbx { + + //! All cctbx exceptions are derived from this class. + class error : public ::scitbx::error_base + { + public: + + //! General cctbx error message. + explicit + error(std::string const& msg) throw() + : ::scitbx::error_base("cctbx", msg) + {} + + //! Error message with file name and line number. + /*! Used by the macros below. + */ + error(const char* file, long line, std::string const& msg = "", + bool internal = true) throw() + : ::scitbx::error_base("cctbx", file, line, msg, internal) + {} + }; + + //! Special class for "Index out of range." exceptions. + /*! These exceptions are propagated to Python as IndexError. + */ + class error_index : public error + { + public: + //! Default constructor. The message may be customized. + explicit + error_index(std::string const& msg = "Index out of range.") throw() + : error(msg) + {} + }; + +} // namespace cctbx + +//! For throwing an error exception with file name, line number, and message. +#define CCTBX_ERROR(msg) \ + SCITBX_ERROR_UTILS_REPORT(cctbx::error, msg) +//! For throwing an "Internal Error" exception. +#define CCTBX_INTERNAL_ERROR() \ + SCITBX_ERROR_UTILS_REPORT_INTERNAL(cctbx::error) +//! For throwing a "Not implemented" exception. +#define CCTBX_NOT_IMPLEMENTED() \ + SCITBX_ERROR_UTILS_REPORT_NOT_IMPLEMENTED(cctbx::error) + +//! Custom cctbx assertion. +#define CCTBX_ASSERT(assertion) \ + SCITBX_ERROR_UTILS_ASSERT(cctbx::error, CCTBX_ASSERT, assertion) + +#endif // CCTBX_ERROR_H diff --git a/extern/cctbx/include/cctbx/hendrickson_lattman.h b/extern/cctbx/include/cctbx/hendrickson_lattman.h new file mode 100644 index 00000000..98a8ad03 --- /dev/null +++ b/extern/cctbx/include/cctbx/hendrickson_lattman.h @@ -0,0 +1,223 @@ +#ifndef CCTBX_HENDRICKSON_LATTMAN_H +#define CCTBX_HENDRICKSON_LATTMAN_H + +#include +#include +#include +#include +#include +#include +#include + +namespace cctbx { + + //! Grouping of Hendrickson-Lattman coefficients. + /*! Reference: Jan Drenth, + Principles of Protein X-Ray Crystallography, + Second edition, 1999, Chapter 14. + */ + template + class hendrickson_lattman : public af::tiny_plain + { + public: + typedef af::tiny_plain base_type; + + //! Default constructor. The coefficients are not initialized! + hendrickson_lattman() {} + + //! Initializtion from tiny array. + hendrickson_lattman(base_type const& coeff) + : base_type(coeff) + {} + + //! Initializtion from plain pointer to coefficients. + explicit + hendrickson_lattman(const FloatType* coeff) + { + std::copy(coeff, coeff + 4, this->begin()); + } + + //! Initializtion given individual coefficients. + hendrickson_lattman( + FloatType const& a, + FloatType const& b, + FloatType const& c, + FloatType const& d) + { + (*this)[0] = a; + (*this)[1] = b; + (*this)[2] = c; + (*this)[3] = d; + } + + /*! \brief Initialization given a phase integral (complex + representation of centroid phase and figure of merit). + */ + /*! The absolute value of the phase integral is truncated + at max_figure_of_merit to avoid singularities. +

+ See also: cctbx::miller::phase_integrator + */ + hendrickson_lattman( + bool centric_flag, + std::complex const& phase_integral, + FloatType const& max_figure_of_merit) + { + FloatType fom = std::min(std::abs(phase_integral),max_figure_of_merit); + FloatType weight; + if (centric_flag) { + weight = scitbx::math::atanh(fom); + } + else { + weight = scitbx::math::bessel::inverse_i1_over_i0(fom); + } + FloatType angle = std::arg(phase_integral); + this->elems[0] = weight * std::cos(angle); + this->elems[1] = weight * std::sin(angle); + this->elems[2] = 0; + this->elems[3] = 0; + } + + //! Coefficients a,b,c,d as array. + base_type const& + coeff() const { return *this; } + + //! Coefficients a,b,c,d as array. + base_type& + coeff() { return *this; } + + //! Individual coefficient a. + FloatType const& a() const { return (*this)[0]; } + + //! Individual coefficient b. + FloatType const& b() const { return (*this)[1]; } + + //! Individual coefficient c. + FloatType const& c() const { return (*this)[2]; } + + //! Individual coefficient d. + FloatType const& d() const { return (*this)[3]; } + + /*! \brief Coefficients for Friedel opposite (similar to conjugate + complex of structure factor). + */ + /*! Formula used: a, -b, c, -d +

+ See also: cctbx::miller::sym_equiv_index + */ + hendrickson_lattman + conj() const + { + return hendrickson_lattman(a(), -b(), c(), -d()); + } + + //! Coefficients for symmetrically equivalent reflections. + /*! The phase shift delta_phi must be given in radians. +

+ See also: cctbx::miller::sym_equiv_index + */ + hendrickson_lattman + shift_phase(FloatType const& delta_phi) const + { + FloatType c1 = std::cos(delta_phi); + FloatType s1 = std::sin(delta_phi); + FloatType c2 = std::cos(2. * delta_phi); + FloatType s2 = std::sin(2. * delta_phi); + return hendrickson_lattman( + a()*c1 - b()*s1, + a()*s1 + b()*c1, + c()*c2 - d()*s2, + c()*s2 + d()*c2); + } + + //! Phase combination. + hendrickson_lattman + operator+(hendrickson_lattman const& rhs) const + { + hendrickson_lattman result; + for(unsigned i=0;i<4;i++) { + result[i] = this->elems[i] + rhs[i]; + } + return result; + } + + //! In-place phase combination. + hendrickson_lattman& + operator+=(hendrickson_lattman const& rhs) + { + for(unsigned i=0;i<4;i++) { + this->elems[i] += rhs[i]; + } + return *this; + } + + //! Division by integer (for averaging). + hendrickson_lattman + operator/(FloatType const& rhs) const + { + hendrickson_lattman result; + for(unsigned i=0;i<4;i++) { + result[i] = this->elems[i] / rhs; + } + return result; + } + + // multiplication (by request of Tom) + hendrickson_lattman + operator*(FloatType const& rhs) const + { + hendrickson_lattman result; + for(unsigned i=0;i<4;i++) { + result[i] = this->elems[i] * rhs; + } + return result; + } + + //! Test for exact equality. + bool + operator==(hendrickson_lattman const& rhs) const + { + for(unsigned i=0;i<4;i++) { + if (this->elems[i] != rhs[i]) return false; + } + return true; + } + + //! Test for inequality. + bool + operator!=(hendrickson_lattman const& rhs) const + { + return !(*this == rhs); + } + + struct phase_integration_cos_sin_table + { + unsigned n_steps; + FloatType angular_step; + boost::shared_array > data; + + phase_integration_cos_sin_table() {} + + phase_integration_cos_sin_table( + unsigned n_steps_) + : + n_steps(n_steps_), + angular_step(scitbx::constants::two_pi / n_steps), + data(new af::tiny_plain[n_steps]) + { + af::tiny_plain* d = data.get(); + for(unsigned i_step=0;i_step( + std::cos(angle), + std::sin(angle), + std::cos(angle+angle), + std::sin(angle+angle)); + } + } + }; + }; + +} // namespace cctbx + +#endif // CCTBX_HENDRICKSON_LATTMAN_H diff --git a/extern/cctbx/include/cctbx/import_scitbx_af.h b/extern/cctbx/include/cctbx/import_scitbx_af.h new file mode 100644 index 00000000..582d23d3 --- /dev/null +++ b/extern/cctbx/include/cctbx/import_scitbx_af.h @@ -0,0 +1,11 @@ +#ifndef CCTBX_IMPORT_SCITBX_AF_H +#define CCTBX_IMPORT_SCITBX_AF_H + +namespace scitbx { namespace af { +}} + +namespace cctbx { + namespace af = scitbx::af; +} + +#endif // CCTBX_IMPORT_SCITBX_AF_H diff --git a/extern/cctbx/include/cctbx/math/loop_n_from_m.h b/extern/cctbx/include/cctbx/math/loop_n_from_m.h new file mode 100644 index 00000000..1bad55f1 --- /dev/null +++ b/extern/cctbx/include/cctbx/math/loop_n_from_m.h @@ -0,0 +1,67 @@ +#ifndef CCTBX_MATH_LOOP_N_FROM_M_H +#define CCTBX_MATH_LOOP_N_FROM_M_H + +#include +#include +#include + +namespace cctbx { namespace math { + + template + class loop_n_from_m + { + public: + loop_n_from_m() + : m_(0), n_(0), over_(1) + {} + + loop_n_from_m(std::size_t m, std::size_t n) + : m_(m), n_(n), over_(0) + { + CCTBX_ASSERT(m_ >= n_); + CCTBX_ASSERT(MaxN >= n_); + for(std::size_t i=0;i 0) { + std::size_t p, l; + p = l = n_ - 1; + for (;;) { + current_[p]++; + if (current_[p] + l == m_ + p) { + if (p == 0) break; + p--; + } + else if (p < l) { + current_[p + 1] = current_[p]; + p++; + } + else { + return true; + } + } + } + over_++; + return false; + } + + std::size_t m() const { return m_; } + + std::size_t n() const { return n_; } + + std::size_t operator[](std::size_t i) const { return current_[i]; } + + std::size_t over() const { return over_; } + + protected: + std::size_t m_; + std::size_t n_; + std::size_t current_[MaxN]; + std::size_t over_; + }; + +}} // namespace cctbx::math + +#endif // CCTBX_MATH_LOOP_N_FROM_M_H diff --git a/extern/cctbx/include/cctbx/miller.h b/extern/cctbx/include/cctbx/miller.h new file mode 100644 index 00000000..3e77f138 --- /dev/null +++ b/extern/cctbx/include/cctbx/miller.h @@ -0,0 +1,134 @@ +/*! \file + Handling of Miller indices. + */ + +#ifndef CCTBX_MILLER_H +#define CCTBX_MILLER_H + +#include +#include +#include +#include +#include + +namespace cctbx { + //! Miller index namespace. + namespace miller { + + //! Miller index class. + template + class index : public scitbx::vec3 + { + public: + typedef scitbx::vec3 base_type; + + //! Default constructor: (h,k,l) = (0,0,0) + index() : base_type(0,0,0) {} + + //! Construction with an instance of the base type. + index(base_type const& h) : base_type(h) {} + + //! Construction from the highest array type in the inheritance tree. + template + index(af::tiny_plain const& v) + { + for(std::size_t i=0;i<3;i++) this->elems[i] = v[i]; + } + + //! Construction with raw pointer to index elements. + template + explicit + index(const OtherNumType* hkl) + { + for(std::size_t i=0;i<3;i++) this->elems[i] = hkl[i]; + } + + //! Construction from individual h,k,l. + index(NumType const& h, NumType const& k, NumType const& l) + : base_type(h, k, l) + {} + + //! Definition of sort order for human-readable listings. + /*! This comparison is computationally more expensive than + fast_less_than below. + */ + bool operator<(index const& other) const + { + const int P[3] = {2, 0, 1}; + for(std::size_t i=0;i<3;i++) { + if (this->elems[P[i]] >= 0 && other[P[i]] < 0) return true; + if (this->elems[P[i]] < 0 && other[P[i]] >= 0) return false; + } + for(std::size_t i=0;i<3;i++) { + if ( scitbx::fn::absolute(this->elems[P[i]]) + < scitbx::fn::absolute(other[P[i]])) return true; + if ( scitbx::fn::absolute(this->elems[P[i]]) + > scitbx::fn::absolute(other[P[i]])) return false; + } + return false; + } + + //! Test this > other, based on sort order defined by operator<(). + bool operator>(index const& other) const + { + if (*this < other) return false; + for(std::size_t i=0;i<3;i++) { + if (this->elems[i] != other[i]) return true; + } + return false; + } + +#if defined(BOOST_MSVC) && BOOST_MSVC <= 1300 // VC++ 7.0 + // work around compiler bug + index operator-() const + { + return index(-static_cast(*this)); + } +#endif + +#if defined(__GNUC__) \ + && __GNUC__ == 3 \ + && __GNUC_MINOR__ == 2 \ + && __GNUC_PATCHLEVEL__ != 0 // 3 known to fail, 0 OK, others unknown + // work around compiler bug + bool operator!=(index const& other) const + { + return static_cast(*this) != static_cast(other); + } +#endif + + std::string + as_string() const + { + char buf[128]; + buf[127] = '\0'; + std::sprintf(buf, "(%ld,%ld,%ld)", + static_cast(this->elems[0]), + static_cast(this->elems[1]), + static_cast(this->elems[2])); + CCTBX_ASSERT(buf[127] == '\0'); + return std::string(buf); + } + }; + + /*! \brief Definition of fast comparison for use in, + e.g., std::map >. + */ + template + class fast_less_than + { + public: + //! This fast comparison function is implemented as operator(). + bool operator()(index const& h1, index const& h2) const + { + for(std::size_t i=0;i<3;i++) { + if (h1[i] < h2[i]) return true; + if (h1[i] > h2[i]) return false; + } + return false; + } + }; + +}} // namespace cctbx::miller + +#endif // CCTBX_MILLER_H diff --git a/extern/cctbx/include/cctbx/miller/index_generator.h b/extern/cctbx/include/cctbx/miller/index_generator.h new file mode 100644 index 00000000..8d0707d8 --- /dev/null +++ b/extern/cctbx/include/cctbx/miller/index_generator.h @@ -0,0 +1,118 @@ +#ifndef CCTBX_MILLER_INDEX_GENERATOR_H +#define CCTBX_MILLER_INDEX_GENERATOR_H + +#include +#include + +namespace cctbx { namespace miller { + + /*! \brief Efficient, easy-to-use algorithm for building + an asymmetric unit of Miller indices up to a given + high-resolution limit or up to a given maximum Miller + index. + */ + /*! Example (Python syntax):

+        # Given a resolution limit.
+        unit_cell = uctbx.unit_cell((10, 10, 10, 90, 90, 90))
+        sg_type = sgtbx.space_group_type("P 41")
+        mig = sgtbx.miller_index_generator(unit_cell, sg_type, 1, 3.0)
+        for h in mig: print h
+        #
+        # Given a maximum Miller index.
+        sg_type = sgtbx.space_group_type("P 31")
+        mig = sgtbx.miller_index_generator(sg_type, 1, (3,4,5))
+        for h in mig: print h
+      
+ This class is implemented as an iterator. Therefore + the generation of Miller indices does not consume any + significant amounts of memory. The key to efficiency + is cctbx::sgtbx::reciprocal_space::reference_asu . + */ + class index_generator + { + public: + //! Default constructor. + /*! Default-constructed instances will throw exceptions if + some of the member functions are used. + */ + index_generator() {} + + //! Initialization with resolution limit. + /*! Miller indices up to and including resolution_d_min will + be generated. + */ + index_generator(uctbx::unit_cell const& unit_cell, + sgtbx::space_group_type const& sg_type, + bool anomalous_flag, + double resolution_d_min); + + //! Initialization with maximum Miller index. + /*! Miller indices in the range from -max_index to +max_index + will be generated. + */ + index_generator(sgtbx::space_group_type const& sg_type, + bool anomalous_flag, + index<> const& max_index); + + //! Unit cell in use. + uctbx::unit_cell const& + unit_cell() const { return unit_cell_; } + + //! Space group in use. + sgtbx::space_group_type const& + space_group_type() const { return sg_type_; } + + //! Anomalous flag in use. + bool + anomalous_flag() const { return anomalous_flag_; } + + //! Access to the reciprocal space asymmetric unit. + /*! The Miller indices that are generated by this class (member + function next()) are inside this asymmetric unit. + */ + sgtbx::reciprocal_space::asu const& + asu() const { return asu_; } + + //! Iterator over Miller indices. + /*! Each call to this member function will return the next + Miller index in the sequence. The indices are inside + sgtbx::reciprocal_space::asu(). Systematically absent + reflections are automatically filtered out. +

+ The Miller index (0,0,0) indicates the end of the iteration. + */ + index<> + next(); + + //! Returns all Miller indices in an array. + /*! The next() method is called in a loop until the list + of Miller indices is exhausted. + */ + af::shared > + to_array(); + + private: + uctbx::unit_cell unit_cell_; + sgtbx::space_group_type sg_type_; + bool anomalous_flag_; + + sgtbx::reciprocal_space::asu asu_; + double d_star_sq_max_; + af::nested_loop > loop_; + bool next_is_minus_previous_; + sgtbx::phase_info phase_info_; + index<> previous_; + + void + initialize_loop(index<> const& reference_h_max); + + bool + set_phase_info(index<> const& h); + + index<> + next_under_friedel_symmetry(); + }; + +}} // namespace cctbx::miller + +#endif // CCTBX_MILLER_INDEX_GENERATOR_H diff --git a/extern/cctbx/include/cctbx/miller/sym_equiv.h b/extern/cctbx/include/cctbx/miller/sym_equiv.h new file mode 100644 index 00000000..e1c6991b --- /dev/null +++ b/extern/cctbx/include/cctbx/miller/sym_equiv.h @@ -0,0 +1,350 @@ +#ifndef CCTBX_MILLER_SYM_EQUIV_H +#define CCTBX_MILLER_SYM_EQUIV_H + +#include +#include + +namespace cctbx { namespace miller { + + //! Class for symmetrically equivalent Miller indices. + class sym_equiv_index + { + public: + //! Default constructor. Some data members are not initialized! + sym_equiv_index() {} + + //! Constructor. + /*! hr is the product of the input index h and the + rotation part r of a symmetry operation. +

+ ht is the product of the input index h and the + translation part of the symmetry operation, + multiplied by the translation-part denominator t_den + in order to obtain an integer value for ht. +

+ friedel_flag indicates if Friedel's law was applied + to arrive at h(). +

+ Not available in Python. + */ + sym_equiv_index(index<> const& hr, int ht, int t_den, bool friedel_flag) + : hr_(hr), ht_(ht) , t_den_(t_den), friedel_flag_(friedel_flag) + {} + + //! The symmetrically equivalent index. + index<> + h() const + { + if (friedel_flag_) return -hr_; + return hr_; + } + + //! Product of Miller index and rotation part of symmetry operation. + index<> const& + hr() const { return hr_; } + + //! Product of Miller index and translation part of symmetry operation. + int + ht() const { return ht_; } + + //! Translation-part denominator. + /*! This is the factor by which ht() is multiplied. + */ + int + t_den() const { return t_den_; } + + //! Phase shift h*t in radians or degrees. + double + ht_angle(bool deg = false) const + { + if (deg) return ht_angle_(360.); + return ht_angle_(scitbx::constants::two_pi); + } + + //! Flag for application of Friedel's law. + /*! For centric reflections, friedel_flag() is always false. + */ + bool + friedel_flag() const { return friedel_flag_; } + + /*! \brief Returns new sym_equiv_index with flipped + friedel_flag() if i_mate != 0. + */ + sym_equiv_index + mate(std::size_t i_mate=1) const + { + if (i_mate) return sym_equiv_index(hr_, ht_, t_den_, !friedel_flag_); + return *this; + } + + /*! \brief Phase for equivalent index, given phase for + input Miller index. + */ + /*! Formula used:
+ deg == 0: phi_eq = phi_in - (2 * pi * ht()) / t_den();
+ deg != 0: phi_eq = phi_in - (360 * ht()) / t_den();
+ if (friedel_flag()) phi_eq = -phi_eq; + */ + template + FloatType + phase_eq(FloatType const& phi_in, bool deg=false) const + { + FloatType phi_eq = phi_in - ht_angle(deg); + if (friedel_flag_) return -phi_eq; + return phi_eq; + } + + /*! \brief Phase for input index, given phase for + equivalent Miller index. + */ + /*! Formula used:
+ if (friedel_flag()) phi_eq = -phi_eq;
+ deg == 0: phi_in = phi_eq + (2 * pi * ht()) / t_den();
+ deg != 0: phi_in = phi_eq + (360 * ht()) / t_den(); + */ + template + FloatType + phase_in(FloatType phi_eq, bool deg=false) const + { + if (friedel_flag_) phi_eq = -phi_eq; + return phi_eq + ht_angle(deg); + } + + /*! \brief Complex value for equivalent index, given complex + value for input index. + */ + /*! Formula used:
+ f_eq = f_in * exp(-2 * pi * j * ht() / t_den());
+ where j is the imaginary number.
+ if (friedel_flag()) f_eq = conj(f_eq); + */ + template + std::complex + complex_eq(std::complex const& f_in) const + { + std::complex + f_eq = f_in * std::polar(FloatType(1), -ht_angle()); + if (friedel_flag_) return std::conj(f_eq); + return f_eq; + } + + /*! \brief Complex value for input index, given complex + value for equivalent index. + */ + /*! Formula used:
+ if (friedel_flag()) f_eq = conj(f_eq);
+ f_in = f_eq * exp(2 * pi * j * ht() / t_den());
+ where j is the imaginary number. + */ + template + std::complex + complex_in(std::complex const& f_eq) const + { + std::complex shift = std::polar(FloatType(1), ht_angle()); + if (friedel_flag_) return std::conj(f_eq) * shift; + return f_eq * shift; + } + + /*! \brief Hendrickson-Lattman coefficients for equivalent index, + given coefficients for input index. + */ + template + hendrickson_lattman + hendrickson_lattman_eq(hendrickson_lattman const& hl_in) const + { + hendrickson_lattman hl_eq = hl_in.shift_phase(-ht_angle()); + if (friedel_flag_) return hl_eq.conj(); + return hl_eq; + } + + /*! \brief Hendrickson-Lattman coefficients for input index, + given coefficients for equivalent index. + */ + template + hendrickson_lattman + hendrickson_lattman_in(hendrickson_lattman hl_eq) const + { + if (friedel_flag_) hl_eq = hl_eq.conj(); + return hl_eq.shift_phase(ht_angle()); + } + + protected: + double ht_angle_(double period) const + { + return (period * ht_) / t_den_; + } + + index<> hr_; + int ht_; + int t_den_; + bool friedel_flag_; + }; + + //! class for the handling of symmetrically equivalent Miller indices. + class sym_equiv_indices + { + public: + //! Default constructor. Some data members are not initialized! + sym_equiv_indices() {} + + //! Computation of the symmetrically equivalent Miller indices. + /*! The Miller index passed to the constructor is referred + to as the "input Miller index." +

+ The conditions for systematically absent reflections are + NOT tested. + */ + sym_equiv_indices(sgtbx::space_group const& sg, index<> const& h_in); + + //! Phase restriction (if any) for the input Miller index. + sgtbx::phase_info + phase_restriction() const + { + return sgtbx::phase_info(ht_restriction_, t_den_, false); + } + + //! Tests if a reflection with the input Miller index is centric. + /*! A reflection with the Miller index h is "centric" if + there is a symmetry operation with rotation part r such + that h*r = -h.
+ See also: phase_info + */ + bool + is_centric() const { return ht_restriction_ >= 0; } + + //! Raw array of symmetrically equivalent Miller indices. + /*! Note that indices().size() is not in general equal to + multiplicity(). + */ + af::shared const& + indices() const { return indices_; } + + //! Multiplicity of the input Miller index. + /*! For acentric reflections and in the presence of Friedel symmetry + (anomalous_flag == false), multiplicity() is twice the number + of symmetrically equivalent Miller indices().size(). +

+ For centric reflections or in the absence of Friedel symmetry + (anomalous_flag == true), the multiplicity is equal to the + number of symmetrically equivalent Miller indices().size(). + */ + int + multiplicity(bool anomalous_flag) const + { + if (!anomalous_flag && !is_centric()) return 2 * indices_.size(); + return indices_.size(); + } + + //! Factor for loop over Friedel mates. + /*! Useful for looping over all symmetrically equivalent reflections + including Friedel mates (if anomalous_flag == false): +

+ f_mates() == multiplicity(anomalous_flag) / indices().size() +

+ See also: operator() + */ + int + f_mates(bool anomalous_flag) const + { + if (!anomalous_flag && !is_centric()) return 2; + return 1; + } + + //! Determines "epsilon" for the given Miller index. + /*! The factor epsilon counts the number of times a Miller + index h is mapped onto itself by symmetry. This factor + is used for "statistical averaging" and in direct methods + formulae. +

+ Note that epsilon is directly related to the number + of symmetrically equivalent indices().size(): +

+ epsilon == sgtbx::space_group::order_p() / indices().size() + */ + int + epsilon() const { return order_p_ / indices_.size(); } + + //! Medium-level access to the symmetrically equivalent Miller indices. + /*! Intended use:

+       sgtbx::space_group sg = ... // define space group
+       miller::index<> h = ... // define input Miller index.
+       bool anomalous_flag = ...
+       miller::sym_equiv_indices h_eq(sg, h);
+       for(std::size_t i_indices=0;i_indices k = h_eq(i_mate, i_indices).h();
+          
+ Note that it is possible and often more convenient to have a + one-deep loop with multiplicity() iterations. +

+ See also: operator()(std::size_t i) +

+ Not available in Python. + */ + sym_equiv_index + operator()(std::size_t i_mate, std::size_t i_indices) const; + + //! High-level access to the symmetrically equivalent Miller indices. + /*! Intended use:

+          sgtbx::space_group sg = ... // define space group
+          miller::index<> h = ... // define input Miller index.
+          bool anomalous_flag = ...
+          miller::sym_equiv_indices h_eq(sg, h);
+          for(std::size_t i=0;i k = h_eq(i).h();
+          
+ */ + sym_equiv_index + operator()(std::size_t i) const; + + //! Tests if the phase phi is compatible with phase_restriction(). + /*! tolerance compensates for rounding errors. +

+ See also: phase_info + */ + bool + is_valid_phase(double phi, + bool deg=false, + double tolerance=1e-5) const + { + return phase_restriction().is_valid_phase(phi, deg, tolerance); + } + + //! Equivalent indices for a P1 listing. + /*! If anomalous_flag == true the number of + indices in P1 is always equal to indices().size(). + If anomalous_flag == false the number of indices in P1 is + indices().size() for non-centric reflections and + indices().size()/2 for centric reflections. + */ + af::shared + p1_listing(bool anomalous_flag) const; + + protected: + void + add(sym_equiv_index const& eq); + + struct index_mate_indices_decomposition + { + index_mate_indices_decomposition( + std::size_t i_mate_, + std::size_t i_indices_) + : + i_mate(i_mate_), i_indices(i_indices_) + {} + + std::size_t i_mate, i_indices; + }; + + index_mate_indices_decomposition + decompose_index_mate_indices(std::size_t i) const; + + int t_den_; + std::size_t order_p_; + int ht_restriction_; + af::shared indices_; + }; + +}} // namespace cctbx::miller + +#endif // CCTBX_MILLER_SYM_EQUIV_H diff --git a/extern/cctbx/include/cctbx/sgtbx/basic.h b/extern/cctbx/include/cctbx/sgtbx/basic.h new file mode 100644 index 00000000..e3ff0f96 --- /dev/null +++ b/extern/cctbx/include/cctbx/sgtbx/basic.h @@ -0,0 +1,58 @@ +#ifndef CCTBX_SGTBX_BASIC_H +#define CCTBX_SGTBX_BASIC_H + +#include +#include +#include + +namespace cctbx { + + //! Shorthand for default vec3 type in space group toolbox. + typedef scitbx::vec3 sg_vec3; + //! Shorthand for default mat3 type in space group toolbox. + typedef scitbx::mat3 sg_mat3; + + //! Space Group Toolbox namespace. + namespace sgtbx { + + //! Special class for rational vector exceptions. + /*! Used by sgtbx::tr_vec, sgtbx::rot_mx + */ + class error_rational_vector : public error + { + public: + //! Constructor. + error_rational_vector(const char* file, long line, + std::string const& msg = "") throw() + : error(file, line, msg) {} + + //! Virtual destructor. + virtual ~error_rational_vector() throw() {} + }; + + /*! \brief Maximum number of representative rotation matrices for + 3-dimensional crystallographic space groups. + */ + static const std::size_t n_max_repr_rot_mx = 24; + + //! Default space_group translation vector denominator. + const int sg_t_den = 12; + //! Default change_of_basis rotation matrix denominator. + const int cb_r_den = 12; + //! Default change_of_basis translation vector denominator. + const int cb_t_den = 144; + + //! Checks default rotation and translation denominators for consistency. + inline void sanity_check() + { + CCTBX_ASSERT(sg_t_den % 12 == 0); + CCTBX_ASSERT(cb_t_den >= 2 * sg_t_den); + CCTBX_ASSERT(cb_t_den % sg_t_den == 0); + } + + typedef boost::rational rat; + typedef scitbx::vec3 vec3_rat; + +}} // namespace cctbx::sgtbx + +#endif // CCTBX_SGTBX_BASIC_H diff --git a/extern/cctbx/include/cctbx/sgtbx/brick.h b/extern/cctbx/include/cctbx/sgtbx/brick.h new file mode 100644 index 00000000..22d3e686 --- /dev/null +++ b/extern/cctbx/include/cctbx/sgtbx/brick.h @@ -0,0 +1,120 @@ +#ifndef CCTBX_SGTBX_BRICK_H +#define CCTBX_SGTBX_BRICK_H + +#include + +namespace cctbx { namespace sgtbx { + + //! A "point" of a brick. + class brick_point + { + public: + //! Default constructor. Some data members are not initialized. + brick_point() {}; + + //! The point as a rational number. + rat + value() const { return value_; } + + //! Flag to indicate if the point is inside the brick or just outside. + /*! Examples for a min point: +

    +
  • value() == 1/8 and off() == false: 1/8 <= x. +
  • value() == 1/8 and off() == true: 1/8 < x. +
+ For a max point the inequalities would be 1/8 >= x and 1/8 > x, + respectively. + */ + int + off() const { return off_; } + + protected: + friend class brick; + explicit brick_point(int raw_point); + rat value_; + bool off_; + }; + + //! Parallelepiped that contains an asymmetric unit. + /*! A "brick" is a parallelepiped that contains an asymmetric unit + and is optimized for memory allocation. +

+ Bricks for 530 conventional settings (see class + space_group_symbols) and an additional 223 primitive settings of + centred space groups were computed with sginfo2 and + formatted as a table for C++ with a Python script. Currently, the + algorithm for computing the bricks is not available in the + %cctbx. However, given the large number of tabulated bricks, + this should hardly ever be noticeable. +

+ The bricks minimize the memory that has to be allocated for + storing a part of a map (e.g. an electron density map) that + covers an asymmetric unit. However, in general, a brick will + contain more than exactly one asymmetric unit. +

+ A method for refining a brick is to allocate a map that contains + flags indicating whether or not a certain point inside the brick + is in the asymmetric unit or is redundant. It is straightforward + to generate such a map of flags by looping over the symmetry + operations for each grid point. One point is marked as being in + the asymmetric unit, and all symmetry mates are marked as being + outside. +

+ Unfortunately, this simple algorithm does not necessarily lead to + a contiguous asymmetric unit. If this could be achieved, it would + not be necessary to allocate an entire 3-dimensional map of + flags, but a 2-dimensional grid could be used. Each point in the + 2-dimensional grid would contain the indices of the first and the + last grid point in the third dimension that is inside the + asymmetric unit. Attempts to devise an algorithm that produces + bricks with contiguous asymmetric units have not been successful. + Ideas are very welcome. Until then, the bricks provided by this + class are the best solution available. + */ + class brick + { + public: + //! Default constructor. Some data members are not initialized. + brick() {} + + //! Constructor. + explicit + brick(sgtbx::space_group_type const& space_group_type); + + //! Access to the six points of the brick. + /*! i_axis refers to the basis vectors a,b,c of the unit cell. +

+ i_min_max == 0 selects the min point along the selected basis + vector.
+ i_min_max == 1 selects the max point.
+

+ See also: class brick_point +

+ Not available in Python. + */ + brick_point + operator()(std::size_t i_axis, std::size_t i_min_max) const; + + //! Formats the information about the brick as a string. + /*! Example: 0<=x<=1/8; -1/8<=y<=0; 1/8 +#include +#include + +namespace cctbx { namespace sgtbx { + + //! Change-of-basis (transformation) operator. + /*! For ease of use, a change-of-basis matrix c() and its inverse c_inv() + are grouped by this class. + */ + class change_of_basis_op + { + public: + //! Initializes the change-of-basis operator with c and c_inv. + /*! The input matrices are NOT checked for consistency. + */ + change_of_basis_op(rt_mx const& c, rt_mx const& c_inv) + : + c_(c), c_inv_(c_inv) + {} + + //! Initializes the change-of-basis operator with c. + /*! The inverse matrix c_inv() is computed by inverting c. + An exception is thrown if c is not invertible. + */ + explicit + change_of_basis_op(rt_mx const& c) + : + c_(c), c_inv_(c.inverse()) + {} + + /*! \brief Initializes the change-of-basis operator with + matrix given as xyz, hkl, or abc string. + */ + /*! An exception is thrown if the given matrix is not invertible. +

+ See also: constructor of class rt_mx +

+ Not available in Python. + */ + change_of_basis_op( + parse_string& symbol, + const char* stop_chars="", + int r_den=cb_r_den, + int t_den=cb_t_den); + + /*! \brief Initializes the change-of-basis operator with + matrix given as xyz, hkl, or abc string. + */ + /*! An exception is thrown if the given matrix is not invertible. +

+ See also: constructor of class rt_mx + */ + change_of_basis_op( + std::string const& symbol, + const char* stop_chars="", + int r_den=cb_r_den, + int t_den=cb_t_den); + + //! Initializes the change-of-basis operator with unit matrices. + /*! The unit matrices are initialized with the rotation part + denominator r_den and the translation part denominator t_den. + */ + explicit + change_of_basis_op(int r_den=cb_r_den, int t_den=cb_t_den) + : + c_(r_den, t_den), c_inv_(r_den, t_den) + {} + + //! Tests if the change-of-basis operator is valid. + /*! A change_of_basis_op is valid only if the rotation part + denominator and the translation part denominator of both + c() and c_inv() are not zero. + */ + bool + is_valid() const + { + return c_.is_valid() && c_inv_.is_valid(); + } + + //! Returns a new change-of-basis operator with unit matrices. + /*! The new matrices inherit the rotation and translation part + denominators. + */ + change_of_basis_op + identity_op() const + { + return change_of_basis_op(c_.unit_mx(), c_inv_.unit_mx()); + } + + //! Tests if the change-of-basis operator is the identity. + bool + is_identity_op() const + { + return c_.is_unit_mx() && c_inv_.is_unit_mx(); + } + + //! Returns a new copy with the denominators r_den and t_den. + /*! An exception is thrown if the elements cannot be scaled to + the new denominators.
+ r_den or t_den == 0 indicates that the corresponding old + denominator is retained. + */ + change_of_basis_op + new_denominators(int r_den, int t_den) const + { + return change_of_basis_op(c_.new_denominators(r_den, t_den), + c_inv_.new_denominators(r_den, t_den)); + } + + /*! Returns a new copy of the operator, but with the denominators + of other. + */ + /*! An exception is thrown if the elements cannot be scaled to + the new denominators. + */ + change_of_basis_op + new_denominators(change_of_basis_op const& other) const + { + return change_of_basis_op(c_.new_denominators(other.c()), + c_inv_.new_denominators(other.c_inv())); + } + + //! Returns the change-of-basis matrix. + rt_mx const& + c() const { return c_; } + + //! Returns the inverse of the change-of-basis matrix. + rt_mx const& + c_inv() const { return c_inv_; } + + //! Returns c() for inv == false, and c_inv() for inv == true. + rt_mx const& + select(bool inv) const + { + if (inv) return c_inv_; + return c_; + } + + //! Returns a new copy with c() and c_inv() swapped. + change_of_basis_op + inverse() const + { + return change_of_basis_op(c_inv_, c_); + } + + //! Applies modulus operation such that 0 <= x < t_den. + /*! The operation is applied to the elements of the + translation vectors of c() and c_inv(). The vectors are + modified in place. + */ + void + mod_positive_in_place() + { + c_.mod_positive_in_place(); + c_inv_.mod_positive_in_place(); + } + + //! Applies modulus operation such that -t_den/2+1 < x <= t_den/2. + /*! The operation is applied to the elements of the + translation vectors of c() and c_inv(). The vectors are + modified in place. + */ + void + mod_short_in_place() + { + c_.mod_short_in_place(); + c_inv_.mod_short_in_place(); + } + + //! Applies modulus operation such that -t_den/2+1 < x <= t_den/2. + /*! The operation is applied to the elements of the + translation vectors of c() and c_inv(). + */ + change_of_basis_op + mod_short() const + { + return change_of_basis_op(c_.mod_short(), c_inv_.mod_short()); + } + + //! c().r() * r * c_inv().r(), for r with rotation part denominator 1. + /*! The rotation part denominator of the result is 1. +

+ Not available in Python. + */ + rot_mx + operator()(rot_mx const& r) const; + + //! c() * s * c_inv(), for s with rotation part denominator 1. + /*! Similar to apply(s), but faster. The translation denominator + of the result is equal to the translation denominator of s. +

+ Not available in Python. + */ + rt_mx + operator()(rt_mx const& s) const; + + //! c() * s * c_inv(), for s with any rotation part denominator. + /*! Similar to opertor()(). s may have any rotation part denominator + or translation part denominator. The denominators of the result + are made as small as possible. +

+ See also: rt_mx::multiply(), rt_mx::cancel() + */ + rt_mx + apply(rt_mx const& s) const; + + //! Deprecated. Use cctbx::uctbx::unit_cell::change_basis(cb_op) instead. + uctbx::unit_cell + apply(uctbx::unit_cell const& unit_cell) const + { + return unit_cell.change_basis(c_inv().r()); + } + + //! Transforms a Miller index. + /*! result = miller_index * c_inv() + */ + miller::index<> + apply(miller::index<> const& miller_index) const; + + //! Transforms an array of Miller indices. + /*! result = miller_indices * c_inv() + */ + af::shared > + apply(af::const_ref > const& miller_indices) const; + + //! Flags Miller indices for which apply() leads to non-integral indices. + af::shared + apply_results_in_non_integral_indices( + af::const_ref > const& miller_indices) const; + + //! c() * (rt_mx(rot_mx(sign_identity), t)) * c_inv() + /*! Not available in Python. + */ + tr_vec + operator()(tr_vec const& t, int sign_identity) const; + + //! Transform fractional coordinates: c() * site_frac + template + fractional + operator()(fractional const& site_frac) const + { + return c_ * site_frac; + } + + //! c() = other.c() * c(); c_inv() = c_inv() * other.c_inv(); + void + update(change_of_basis_op const& other) + { + c_ = (other.c() * c_).new_denominators(other.c()); + c_inv_ = (c_inv_ * other.c_inv()).new_denominators(other.c_inv()); + } + + //! c() = (I|shift) * c(); c_inv() = c_inv() * (I|-shift); + /*! Not available in Python. + */ + void + update(tr_vec const& shift) + { + // (I|S)*(R|T) = (R|T+S) + c_ = rt_mx(c_.r(), c_.t() + shift); + // (R|T)*(I|-S) = (R|T-R*S) + c_inv_ = rt_mx( + c_inv_.r(), + c_inv_.t() - (c_inv_.r() * shift).new_denominator(c_inv_.t().den())); + } + + //! Multiplication of change-of-basis operators. + change_of_basis_op + operator*(change_of_basis_op const& rhs) + { + return change_of_basis_op( + (c() * rhs.c()).new_denominators(c()), + (rhs.c_inv() * c_inv()).new_denominators(c_inv())); + } + + //! Returns c() in xyz format. + /*! See also: rt_mx::as_xyz() + */ + std::string + as_xyz(bool decimal=false, + bool t_first=false, + const char* symbol_letters="xyz", + const char* separator=",") const + { + return c_.as_xyz(decimal, t_first, symbol_letters, separator); + } + + //! Returns transpose of c_inv() in hkl format. + /*! c_inv.t() must be zero. An exception is thrown otherwise. +

+ See also: rt_mx::as_xyz(), rot_mx::as_hkl() + */ + std::string + as_hkl( + bool decimal=false, + const char* letters_hkl="hkl", + const char* separator=",") const + { + CCTBX_ASSERT(c_inv_.t().is_zero()); + return c_inv_.r().as_hkl(decimal, letters_hkl, separator); + } + + //! Returns transpose of c_inv() in abc format. + /*! See also: rt_mx::as_xyz() + */ + std::string + as_abc(bool decimal=false, + bool t_first=false, + const char* letters_abc="abc", + const char* separator=",") const + { + return rt_mx(c_inv_.r().transpose(), c_inv_.t()) + .as_xyz(decimal, t_first, letters_abc, separator); + } + + //! Returns abc format, or xyz if it is shorter than abc. + /*! See also: as_abc(), as_xyz() + */ + std::string + symbol() const + { + std::string result = as_abc(); + std::string alt = as_xyz(); + if (result.size() > alt.size()) return alt; + return result; + } + + private: + rt_mx c_; + rt_mx c_inv_; + }; + +}} // namespace cctbx::sgtbx + +#endif // CCTBX_SGTBX_CHANGE_OF_BASIS_OP_H diff --git a/extern/cctbx/include/cctbx/sgtbx/group_codes.h b/extern/cctbx/include/cctbx/sgtbx/group_codes.h new file mode 100644 index 00000000..d83111f3 --- /dev/null +++ b/extern/cctbx/include/cctbx/sgtbx/group_codes.h @@ -0,0 +1,119 @@ +#ifndef CCTBX_SGTBX_GROUP_CODES_H +#define CCTBX_SGTBX_GROUP_CODES_H + +namespace cctbx { namespace sgtbx { + + namespace crystal_system { + + enum code + { + undefined, + triclinic, + monoclinic, + orthorhombic, + tetragonal, + trigonal, + hexagonal, + cubic + }; + + const char* label(code const& c); + + } // namespace crystal_system + + namespace matrix_group { + + class code + { + public: + code(crystal_system::code const& x, int l, int p, int m) + : x_(x), l_(l), p_(p), m_(m) + {} + + bool operator==(code const& rhs) const + { + return x_ == rhs.x_ + && l_ == rhs.l_ + && p_ == rhs.p_ + && m_ == rhs.m_; + } + + bool operator!=(code const& rhs) const + { + return !(*this == rhs); + } + + int index() const { return m_; } + + code point_group_type() const + { + return code(x_, l_ - p_, 0, m_ + p_); + } + + code laue_group_type() const + { + return code(x_, 0, 0, m_ + l_); + } + + crystal_system::code crystal_system() const + { + return x_; + } + + const char* label() const; + + private: + crystal_system::code x_; + int l_; + int p_; + int m_; + }; + + static const code undefined (crystal_system::undefined, 0, 0, 0); + static const code unknown (crystal_system::undefined, 0, 0, 1); + static const code code_1 (crystal_system::triclinic, 1, 0, 2); + static const code code_1b (crystal_system::triclinic, 0, 0, 3); + static const code code_2 (crystal_system::monoclinic, 2, 0, 4); + static const code code_m (crystal_system::monoclinic, 1, 0, 5); + static const code code_2_m (crystal_system::monoclinic, 0, 0, 6); + static const code code_222 (crystal_system::orthorhombic, 2, 0, 7); + static const code code_mm2 (crystal_system::orthorhombic, 1, 0, 8); + static const code code_mmm (crystal_system::orthorhombic, 0, 0, 9); + static const code code_4 (crystal_system::tetragonal, 2, 0, 10); + static const code code_4b (crystal_system::tetragonal, 1, 0, 11); + static const code code_4_m (crystal_system::tetragonal, 0, 0, 12); + static const code code_422 (crystal_system::tetragonal, 4, 0, 13); + static const code code_4mm (crystal_system::tetragonal, 3, 0, 14); + static const code code_4b2m (crystal_system::tetragonal, 2, 1, 15); + static const code code_4bm2 (crystal_system::tetragonal, 1, 0, 16); + static const code code_4_mmm (crystal_system::tetragonal, 0, 0, 17); + static const code code_3 (crystal_system::trigonal, 1, 0, 18); + static const code code_3b (crystal_system::trigonal, 0, 0, 19); + static const code code_321 (crystal_system::trigonal, 8, 2, 20); + static const code code_312 (crystal_system::trigonal, 7, 1, 21); + static const code code_32 (crystal_system::trigonal, 6, 0, 22); + static const code code_3m1 (crystal_system::trigonal, 5, 2, 23); + static const code code_31m (crystal_system::trigonal, 4, 1, 24); + static const code code_3m (crystal_system::trigonal, 3, 0, 25); + static const code code_3bm1 (crystal_system::trigonal, 2, 2, 26); + static const code code_3b1m (crystal_system::trigonal, 1, 1, 27); + static const code code_3bm (crystal_system::trigonal, 0, 0, 28); + static const code code_6 (crystal_system::hexagonal, 2, 0, 29); + static const code code_6b (crystal_system::hexagonal, 1, 0, 30); + static const code code_6_m (crystal_system::hexagonal, 0, 0, 31); + static const code code_622 (crystal_system::hexagonal, 4, 0, 32); + static const code code_6mm (crystal_system::hexagonal, 3, 0, 33); + static const code code_6b2m (crystal_system::hexagonal, 2, 1, 34); + static const code code_6bm2 (crystal_system::hexagonal, 1, 0, 35); + static const code code_6_mmm (crystal_system::hexagonal, 0, 0, 36); + static const code code_23 (crystal_system::cubic, 1, 0, 37); + static const code code_m3b (crystal_system::cubic, 0, 0, 38); + static const code code_432 (crystal_system::cubic, 2, 0, 39); + static const code code_4b3m (crystal_system::cubic, 1, 0, 40); + static const code code_m3bm (crystal_system::cubic, 0, 0, 41); + + } // namespace matrix_group + +}} // namespace cctbx::sgtbx + +#endif // CCTBX_SGTBX_GROUP_CODES_H diff --git a/extern/cctbx/include/cctbx/sgtbx/lattice_tr.h b/extern/cctbx/include/cctbx/sgtbx/lattice_tr.h new file mode 100644 index 00000000..79b3d9ea --- /dev/null +++ b/extern/cctbx/include/cctbx/sgtbx/lattice_tr.h @@ -0,0 +1,30 @@ +#ifndef CCTBX_SGTBX_LATTICE_TR_H +#define CCTBX_SGTBX_LATTICE_TR_H + +#include + +namespace cctbx { namespace sgtbx { namespace lattice_tr { + + namespace conventional_centring_types { + + struct table_entry + { + char symbol; + std::size_t n_translations; + const tr_vec* t; + }; + + const table_entry* table(); + + const table_entry* get(char symbol); + } + + namespace conventional_z2p_matrices { + + rot_mx const& get(char symbol); + + } + +}}} // namespace cctbx::sgtbx::lattice_tr + +#endif // CCTBX_SGTBX_LATTICE_TR_H diff --git a/extern/cctbx/include/cctbx/sgtbx/miller_ops.h b/extern/cctbx/include/cctbx/sgtbx/miller_ops.h new file mode 100644 index 00000000..26ce18a7 --- /dev/null +++ b/extern/cctbx/include/cctbx/sgtbx/miller_ops.h @@ -0,0 +1,34 @@ +#ifndef CCTBX_SGTBX_MILLER_OPS_H +#define CCTBX_SGTBX_MILLER_OPS_H + +#include +#include + +namespace cctbx { namespace sgtbx { + + template + inline + miller::index + operator*(miller::index const& h, rot_mx const& r) + { + return miller::index(h * r.num()); + } + + template + inline + NumType + operator*(miller::index const& h, tr_vec const& t) + { + return h * t.num(); + } + + inline + int + ht_mod_1(miller::index<> const& h, tr_vec const& t) + { + return scitbx::math::mod_positive(h * t, t.den()); + } + +}} // namespace cctbx::sgtbx + +#endif // CCTBX_SGTBX_MILLER_OPS_H diff --git a/extern/cctbx/include/cctbx/sgtbx/parse_string.h b/extern/cctbx/include/cctbx/sgtbx/parse_string.h new file mode 100644 index 00000000..8f304eb7 --- /dev/null +++ b/extern/cctbx/include/cctbx/sgtbx/parse_string.h @@ -0,0 +1,115 @@ +#ifndef CCTBX_SGTBX_PARSE_STRING_H +#define CCTBX_SGTBX_PARSE_STRING_H + +#include +#include + +namespace cctbx { namespace sgtbx { + + //! Class for communicating string parsing errors. + /*! This class is used by functions such as + cctbx::sgtbx::space_group::parse_hall_symbol() + or a constructor of class cctbx::sgtbx::rt_mx to communitcate errors + that are detected during the interpretation of an input string.
+ Intended use:

+      using namespace cctbx::sgtbx;
+      parse_string hall_symbol("P x");
+      space_group sg;
+      try {
+        sg.parse_hall_symbol(hall_symbol);
+      }
+      catch (cctbx::error const& e) {
+        std::cout << e.what() << std::endl;
+        std::cout << hall_symbol.string() << std::endl;
+        for (std::size_t i = 0; i < hall_symbol.where(); i++) std::cout << "_";
+        std::cout << "^" << std::endl;
+      }
+      
+ This will produce the output:
+      cctbx Error: Improper symbol for rotational order.
+      P x
+      __^
+      
+ */ + class parse_string + { + public: + //! Initializes the parse_string with the empty string. + parse_string() + : + pos_(0), marked_pos_(0) + {} + + //! Initializes the parse_string with the input string. + explicit + parse_string(std::string const& str) + : + s_(str +#if defined(__GNUC__) && __GNUC__ == 3 \ + && (__GNUC_MINOR__ == 2 || __GNUC_MINOR__ == 3) + +"" // work around gcc 3.2 & 3.3 bug +#endif + ), + pos_(0), + marked_pos_(0) + {} + + //! Returns the input string. + const char* + string() const { return s_.c_str(); } + + //! Index of last character accessed by the parsing algorithm. + std::size_t + where() const { return pos_; } + + //! Support for formatting exceptions. + /*! Produces output of the form: + P x + __^ + */ + std::string + format_where_message(std::string const& prefix) const + { + std::string result = prefix + s_ + "\n" + prefix; + for(std::size_t i=0;i= s_.size()) return '\0'; + return s_[pos_++]; + } + + //! For internal use only. + void + skip(std::size_t n = 1) { pos_ += n; } + + //! For internal use only. + void + set_mark() { marked_pos_ = pos_; } + + //! For internal use only. + void + go_to_mark() { pos_ = marked_pos_; } + + private: + std::string s_; + std::size_t pos_; + std::size_t marked_pos_; + }; + +}} // namespace cctbx::sgtbx + +#endif // CCTBX_SGTBX_PARSE_STRING_H diff --git a/extern/cctbx/include/cctbx/sgtbx/phase_info.h b/extern/cctbx/include/cctbx/sgtbx/phase_info.h new file mode 100644 index 00000000..d11aa41c --- /dev/null +++ b/extern/cctbx/include/cctbx/sgtbx/phase_info.h @@ -0,0 +1,156 @@ +#ifndef CCTBX_SGTBX_PHASE_INFO_H +#define CCTBX_SGTBX_PHASE_INFO_H + +#include + +#if defined(__llvm__) && defined(__APPLE_CC__) && __APPLE_CC__ <= 5658 +#define CCTBX_SGTBX_PHASE_INFO_APPLE_LLVM2335_WORKAROUND +#endif + +namespace cctbx { namespace sgtbx { + + class space_group; // forward declaration + + /*! \brief Handling of phase restrictions and optional evaluation + of conditions for systematically absent reflections. + */ + /*! A reflection with the Miller index h is "centric" if + there is a symmetry operation with rotation part r such that + h*r = -h. The phase of a centric reflection is restricted to + two phase angels (modulo pi). +

+ A reflection with the Miller index h is "systematically absent" + if there is a symmetry operation with the rotation part r and + the translation part t such that h*r = h and h*t != 0 mod 1. + */ + class phase_info + { + public: + //! Default constructor. Some data members are not initialized! + phase_info() {} + + //! Determines the phase restriction for a given Miller index. + /*! If no_test_sys_absent = false, it is also tested if a + reflection with the given Miller index is systematically + absent. If no_test_sys_absent = true, a faster algorithm + is used that only determines the phase restriction. In the + latter case the is_sys_absent() member function must not + be used (an exception is thrown otherwise). + */ + phase_info( + sgtbx::space_group const& space_group, + miller::index<> const& miller_index, + bool no_test_sys_absent=false); + + /*! \brief Initialization with known product h*t and given + translation denominator. + */ + /*! sys_abs_was_tested indicates if it is known if a reflection + with the given Miller index is systematically absent. + The is_sys_absent() member function must not be used + if sys_abs_was_tested = false (an exception is thrown + otherwise). +

+ Not available in Python. + */ + phase_info(int ht, int t_den, bool sys_abs_was_tested) + : + ht_(ht), t_den_(t_den), sys_abs_was_tested_(sys_abs_was_tested) + {} + + //! Tests if is_sys_absent() can be used. + bool + sys_abs_was_tested() const { return sys_abs_was_tested_; } + + //! Tests for systematically absent reflection. + /*! Use sys_abs_was_tested() to determine if this test can be used. + If the result of sys_abs_was_tested() = false, an exception + is thrown if this test is used. + */ + bool + is_sys_absent() const + { + CCTBX_ASSERT(sys_abs_was_tested_); + return ht_ == -2; + } + + //! Tests if there actually is a phase restriction. + /*! See class details. + */ + bool + is_centric() const { return ht_ >= 0; } + + //! Phase shift h*t (mod 1) corresponding to h*r = -h. + /*! Low-level information for computing the restricted phases. + ht() is multiplied by a factor t_den() in order to obtain + an integer value. +

+ See also: ht_angle() + */ + int + ht() const { return ht_; } + + //! Translation part denominator. + /*! This is the factor by which ht() is multiplied. + */ + int + t_den() const { return t_den_; } + + //! Phase restriction in radians or degrees. + /*! The return value is -1 if the phase is not restricted, + and >= 0 and < pi or 180 otherwise. + */ + double + ht_angle(bool deg=false) const + { + if (!is_centric()) return -1.; + return (pi_unit(deg) * ht_) / t_den_; + } + + //! Tests if phase phi is compatible with restriction. + /*! The tolerance compensates for rounding errors. + */ + bool + is_valid_phase( + double phi, + bool deg=false, + double tolerance=1e-5) const; + + //! Nearest valid phase. + /*! For acentric reflections equivalent to the input phase phi. + For centric reflections, the restricted phase which is + nearest to the input phase phi. + */ + double + nearest_valid_phase(double phi, bool deg=false) const; + + //! Projection of structure factor on vector with restricted phase. + /*! For acentric reflections equivalent to input structure factor. + */ + template + std::complex + valid_structure_factor(std::complex const& f) const + { + if (!is_centric()) return f; + double a = ht_angle(); + double c = std::cos(a); + double s = std::sin(a); + double x = f.real() * c + f.imag() * s; + return std::complex(x * c, x * s); + } + + private: + int ht_; + int t_den_; + bool sys_abs_was_tested_; + + double pi_unit(bool deg) const + { + if (deg) return 180.; + return scitbx::constants::pi; + } + }; + +}} // namespace cctbx::sgtbx + +#endif // CCTBX_SGTBX_PHASE_INFO_H diff --git a/extern/cctbx/include/cctbx/sgtbx/reciprocal_space_asu.h b/extern/cctbx/include/cctbx/sgtbx/reciprocal_space_asu.h new file mode 100644 index 00000000..c17d1b45 --- /dev/null +++ b/extern/cctbx/include/cctbx/sgtbx/reciprocal_space_asu.h @@ -0,0 +1,119 @@ +#ifndef CCTBX_SGTBX_RECIPROCAL_SPACE_ASU_H +#define CCTBX_SGTBX_RECIPROCAL_SPACE_ASU_H + +#include +#include +#include + +namespace cctbx { namespace sgtbx { namespace reciprocal_space { + + //! Access to general contiguous reciprocal space asymmetric units. + /*! class reference_reciprocal_space_asu implements 12 contiguous + reciprocal space asymmetric units that cover the 230 + reference settings. The algorithm for the determination of the + space group type (class space_group_type) is used to derive a + change-of-basis matrix for the transformation of the tabulated + asymmetric units. In this way a contiguous asymmetric unit is + available for any arbitrary setting. +

+ Python binding: reciprocal_space_asu + */ + class asu + { + public: + //! Default constructor. + /*! Default-constructed instances will throw exceptions if + some of the member functions are used. + */ + asu() + : + is_reference_(true) + {} + + //! Initialization. + /*! Based on the space group number (space_group_type::number()), + the Laue group class is derived which is in turn used + to select the corresponding tabulated + reference_asu. + */ + asu(sgtbx::space_group_type const& space_group_type); + + //! Access to the selected tabulated reference_asu. + /*! Not available in Python. + */ + const reference_asu* + reference() const { return reference_; } + + /*! \brief Access to the string representation of the selected + tabulated reference_asu. + */ + /*! Equivalent to: reference().as_string() + */ + const char* + reference_as_string() const { return reference_->as_string(); } + + //! Access to the change-of-basis operator. + /*! This operator is a copy of space_group_type.cb_op() as passed to + the constructor. + */ + change_of_basis_op const& + cb_op() const { return cb_op_; } + + //! Tests if the given asymmetric unit is one of the tabulated units. + /*! This test is equivalent to the test cb_op().is_identity_op(). + If this is the case, some optimizations are used. + */ + bool + is_reference() const { return is_reference_; } + + //! Tests if the given Miller index is in the asymmetric unit. + /*! The change-of-basis matrix is used to transform + the Miller index (miller_index * cb_op().c_inv()). It is then + tested if the result is in the tabulated reference + asymmetric unit. + */ + bool + is_inside(miller::index<> const& miller_index) const + { + if (is_reference_) return reference_->is_inside(miller_index); + return reference_->is_inside(miller_index * cb_op_.c_inv().r()); + } + + //! Tests Friedel pair. + /*! Returns 1 if is_inside(miller_index), + -1 if is_inside(minus_miller_index), + 0 otherwise. +

+ Not available in Python. + */ + int + which( + miller::index<> const& miller_index, + miller::index<> const& minus_miller_index) const + { + if (is_reference_) { + return reference_->which(miller_index, minus_miller_index); + } + return reference_->which(miller_index * cb_op_.c_inv().r()); + } + + //! Tests Friedel pair. + /*! Returns 1 if is_inside(miller_index), + -1 if is_inside(-miller_index), 0 otherwise. + */ + int + which(miller::index<> const& miller_index) const + { + if (is_reference_) return reference_->which(miller_index); + return reference_->which(miller_index * cb_op_.c_inv().r()); + } + + private: + change_of_basis_op cb_op_; + bool is_reference_; + const reference_asu* reference_; + }; + +}}} // namespace cctbx::sgtbx::reciprocal_space + +#endif // CCTBX_SGTBX_RECIPROCAL_SPACE_ASU_H diff --git a/extern/cctbx/include/cctbx/sgtbx/reciprocal_space_reference_asu.h b/extern/cctbx/include/cctbx/sgtbx/reciprocal_space_reference_asu.h new file mode 100644 index 00000000..e9d3e39f --- /dev/null +++ b/extern/cctbx/include/cctbx/sgtbx/reciprocal_space_reference_asu.h @@ -0,0 +1,119 @@ +#ifndef CCTBX_SGTBX_RECIPROCAL_SPACE_REFERENCE_ASU_H +#define CCTBX_SGTBX_RECIPROCAL_SPACE_REFERENCE_ASU_H + +#include +#include +#include +#include + +namespace cctbx { namespace sgtbx { namespace reciprocal_space { + + /*! \brief Contiguous reciprocal space asymmetric units for + the 230 reference settings. + */ + /*! 12 contiguous reciprocal space asymmetric units (11 Laue + classes, two settings for Laue class -3m) are + tabulated. The tabulated asymmetric units are + compatible with the asymmetric units of the CCP4 + package. +

+ This implementation is based on work by + Kevin Cowtan. +

+ See also: class asu, class miller_index_generator + */ + class reference_asu + { + public: + //! Returns one of exactly 12 Laue group codes. + /*! The labels of the possible return codes are:
+ -1, 2/m, mmm, 4/m, 4/mmm, -3, -31m, -3m1, 6/m, 6/mmm, m-3, m-3m +

+ For Laue class -3m there are two possible orientations of the + mirror plane with respect to the periodic lattice. + */ + virtual matrix_group::code + laue_group() const + { + throw CCTBX_INTERNAL_ERROR(); + } + + //! Test if given Miller index is in the tabulated asymmetric unit. + virtual bool + is_inside(miller::index<> const& /*h*/) const + { + throw CCTBX_INTERNAL_ERROR(); + } + + //! Tests Friedel pair. + /*! Returns 1 if is_inside(h), -1 if is_inside(minus_h), 0 otherwise. + */ + int + which(miller::index<> const& h, miller::index<> const& minus_h) const + { + if (is_inside( h)) return 1; + else if (is_inside(minus_h)) return -1; + return 0; + } + + /*! Returns 1 if is_inside(h), -1 if is_inside(-h), 0 otherwise. + */ + int + which(miller::index<> const& h) const + { + if (is_inside(h)) return 1; + miller::index<> minus_h = -h; // work around Visual C++ 7.1 bug + if (is_inside(minus_h)) return -1; + return 0; + } + + //! String representation of the tabluated asymmetric unit. + /*! Example: "h>=k and k>=0 and (k>0 or l>=0)" + */ + virtual const char* + as_string() const + { + throw CCTBX_INTERNAL_ERROR(); + } + + //! "Cut parameters" for building Miller indices. + /*! When building (or generating) a large list of Miller indices, + it is useful to restrict the loop over all possible indices + to 1/2, 1/4, or 1/8 of reciprocal space, if possible. +

+ The cut parameters are used in the next() method + of the class miller_index_generator. In general it + should be much more convenient to use that higher-level + class rather than hand-crafting a loop for building + Miller indices. +

+ Each element of cut_parameters() is either -1 or 0. A value + of 0 indicates that the corresponding negative half-space + can be omitted in the loop over possible indices. +

+ Friedel symmetry is implied. If the Friedel mates + are needed explicitly, they have to be added in a + separate step. Note that the Friedel mate appears + explicitly only for acentric reflections (use e.g. + !space_group::is_centric() to determine which reflections + are acentric). + */ + virtual af::int3 + const& cut_parameters() const + { + throw CCTBX_INTERNAL_ERROR(); + } + + virtual ~reference_asu() {} + }; + + bool + is_in_reference_asu_1b(miller::index<> const& h); + + const reference_asu* + lookup_reference_asu(matrix_group::code const& group_code); + +}}} // namespace cctbx::sgtbx::reciprocal_space + +#endif // CCTBX_SGTBX_RECIPROCAL_SPACE_REFERENCE_ASU_H diff --git a/extern/cctbx/include/cctbx/sgtbx/reference_settings.h b/extern/cctbx/include/cctbx/sgtbx/reference_settings.h new file mode 100644 index 00000000..53624997 --- /dev/null +++ b/extern/cctbx/include/cctbx/sgtbx/reference_settings.h @@ -0,0 +1,100 @@ +#ifndef CCTBX_SGTBX_REFERENCE_SETTINGS_H +#define CCTBX_SGTBX_REFERENCE_SETTINGS_H + +#include +#include +#include +#include + +namespace cctbx { namespace sgtbx { + +/*! \brief Tables for the "reference settings" of the + 230 crystallographic space groups. + */ +/*! The reference settings chosen are identical to those listed in + International Tables for Crystallography Vol. A. For the cases + where more than one setting is given in the International Tables, + the following choices have been made: + - For monoclinic space groups: unique axis b and cell choice 1. + - For space groups with two origin choices: origin choice 2. + - Rhombohedral space groups: hexagonal axes. + */ +namespace reference_settings { + + //! Hall symbols for the reference settings. + const char* + hall_symbol_table(std::size_t i); + + //! Hermann-Mauguin symbols for the reference settings. + const char* + hermann_mauguin_symbol_table(std::size_t i); + + /*! \brief Matrix group codes (Boisen & Gibbs, 1990, pp. 225-228) + corresponding to the reference settings. + */ + matrix_group::code + const& matrix_group_code_table(std::size_t i); + + //! Tables for the Euclidean and affine normalizers. + namespace normalizer { + + struct addl_generators + { + const char* k2l; // operations which generate L from K + const char* l2n; // operations which generate N from L + }; + + /*! \brief Table of "additional generators" of the Euclidean and affine + normalizers for to the reference settings. + */ + /*! Reference: Int. Tab. Vol. A Section 15.3 + */ + addl_generators const& + addl_generators_table(std::size_t i); + + af::shared + get_addl_generators( + int sg_number, + bool flag_affine, + bool flag_k2l, + bool flag_l2n); + + bool + check_monoclinic_affine_restrictions( + int sg_number, + rot_mx const& r); + + void + get_monoclinic_affine_trial_ranges( + rot_mx const& cb_mx_r, + int& r00, + int& r22); + + } // namespace normalizer + + //! Wyckoff tables. + namespace wyckoff { + + struct raw_position + { + int m; + const char *xyz; + }; + + struct raw_table + { + int n; + const raw_position *op; + }; + + const raw_table& + raw_tables(std::size_t i); + + int + general_position_multiplicities(std::size_t i); + + } // namespace wyckoff + +}}} // namespace cctbx::sgtbx::reference_settings + +#endif // CCTBX_SGTBX_REFERENCE_SETTINGS_H diff --git a/extern/cctbx/include/cctbx/sgtbx/rot_mx.h b/extern/cctbx/include/cctbx/sgtbx/rot_mx.h new file mode 100644 index 00000000..2ddee05a --- /dev/null +++ b/extern/cctbx/include/cctbx/sgtbx/rot_mx.h @@ -0,0 +1,410 @@ +#ifndef CCTBX_SGTBX_ROT_MX_H +#define CCTBX_SGTBX_ROT_MX_H + +#include +#include +#include + +namespace cctbx { namespace sgtbx { + + void throw_unsuitable_rot_mx(const char* file, long line); + + class rot_mx_info; // forward declaration + + //! 3x3 rotation matrix. + /*! The elements of the matrix are stored as integers and a common + denominator. The actual value of an element is obtained by + dividing the integer number by the denominator. + */ + class rot_mx + { + public: + //! Initialization of a diagonal matrix with the given denominator. + /*! The diagonal elements are defined as diagonal * denominator. + */ + explicit + rot_mx(int denominator=1, int diagonal=1) + : num_(diagonal * denominator), den_(denominator) + {} + + //! Initialization with numerator m and the given denominator. + explicit + rot_mx(sg_mat3 const& m, int denominator=1) + : num_(m), den_(denominator) + {} + + //! Initialization with the given elements and denominator. + rot_mx(int m00, int m01, int m02, + int m10, int m11, int m12, + int m20, int m21, int m22, + int denominator = 1) + : num_(m00,m01,m02, m10,m11,m12, m20,m21, m22), + den_(denominator) + {} + + //! Numerator of the rotation matrix. + sg_mat3 const& + num() const { return num_; } + //! Numerator of the rotation matrix. + sg_mat3& + num() { return num_; } + + //! i'th element of the numerator of the rotation matrix. + int const& + operator[](std::size_t i) const { return num_[i]; } + //! i'th element of the numerator of the rotation matrix. + int& + operator[](std::size_t i) { return num_[i]; } + + //! (r*3+c)'th element of the numerator of the rotation matrix. + int + const& operator()(int r, int c) const { return num_(r, c); } + //! (r*3+c)'th element of the numerator of the rotation matrix. + int& + operator()(int r, int c) { return num_(r, c); } + + //! Denominator of the rotation matrix. + int const& + den() const { return den_; } + //! Denominator of the rotation matrix. + int& + den() { return den_; } + + //! True only if both the numerators and the denominators are equal. + bool + operator==(rot_mx const& rhs) const + { + if (den_ != rhs.den_) return false; + return num_.const_ref().all_eq(rhs.num_.const_ref()); + } + + //! False only if both the numerators and the denominators are equal. + bool + operator!=(rot_mx const& rhs) const + { + return !((*this) == rhs); + } + + //! True only if den() != 0. + bool + is_valid() const { return den_ != 0; } + + /*! \brief True only if this is a diagonal matrix and all diagonal + elements are equal to the denominator. + */ + bool + is_unit_mx() const { return num_ == sg_mat3(den_); } + + //! This minus the unit matrix. + rot_mx + minus_unit_mx() const + { + rot_mx result(*this); + for (std::size_t i=0;i<9;i+=4) result[i] -= den_; + return result; + } + + //! New rotation matrix with denominator new_den. + /*! An exception is thrown if the old rotation matrix + cannot be represented using the new denominator. + */ + rot_mx + new_denominator(int new_den) const; + + //! New rotation matrix with num()*factor and den()*factor. + rot_mx + scale(int factor) const + { + if (factor == 1) return *this; + return rot_mx(num_ * factor, den_ * factor); + } + + //! Determinant as rational number. + /*! An exception is thrown if den() <= 0. + */ + rat + determinant() const + { + CCTBX_ASSERT(den_ > 0); + return rat(num_.determinant(), den_*den_*den_); + } + + //! Inverse of this matrix. + /*! An exception is thrown if the result + cannot be represented using the denominator den(). + */ + rot_mx + inverse() const; + + //! New rotation matrix with num().transpose(), den(). + rot_mx + transpose() const { return rot_mx(num_.transpose(), den_); } + + //! New rotation matrix with -num(), den(). + rot_mx + operator-() const { return rot_mx(-num_, den_); } + + //! Addition of numerators. + /*! An exception is thrown if the denominators are not equal. + */ + friend rot_mx + operator+(rot_mx const& lhs, rot_mx const& rhs) + { + CCTBX_ASSERT(lhs.den_ == rhs.den_); + return rot_mx(lhs.num_ + rhs.num_, lhs.den_); + } + + //! Subtraction of numerators. + /*! An exception is thrown if the denominators are not equal. + */ + friend rot_mx + operator-(rot_mx const& lhs, rot_mx const& rhs) + { + CCTBX_ASSERT(lhs.den_ == rhs.den_); + return rot_mx(lhs.num_ - rhs.num_, lhs.den_); + } + + //! In-place addition of numerators. + /*! An exception is thrown if the denominators are not equal. + */ + rot_mx& + operator+=(rot_mx const& rhs) + { + CCTBX_ASSERT(den_ == rhs.den_); + num_ += rhs.num_; + return *this; + } + + //! Matrix multiplication. + /*! The denominator of the result is the product lhs.den() * rhs.den(). + */ + friend rot_mx + operator*(rot_mx const& lhs, rot_mx const& rhs) + { + return rot_mx(lhs.num_ * rhs.num_, lhs.den_ * rhs.den_); + } + + //! Matrix*vector multiplication. + /*! The denominator of the result is the product lhs.den() * rhs.den(). + */ + friend tr_vec + operator*(rot_mx const& lhs, tr_vec const& rhs) + { + return tr_vec(lhs.num_ * rhs.num(), lhs.den_ * rhs.den()); + } + + //! Vector*matrix multiplication. + /*! The denominator of the result is the product lhs.den() * rhs.den(). + */ + friend tr_vec + operator*(tr_vec const& lhs, rot_mx const& rhs) + { + return tr_vec(lhs.num() * rhs.num_, lhs.den() * rhs.den_); + } + + //! Matrix*vector multiplication, numerator only. + friend sg_vec3 + operator*(rot_mx const& lhs, sg_vec3 const& rhs) + { + return sg_vec3(lhs.num_ * rhs); + } + + //! New rotation matrix with num()*rhs, den(). + friend rot_mx + operator*(rot_mx const& lhs, int rhs) + { + return rot_mx(lhs.num_ * rhs, lhs.den_); + } + + //! New rotation matrix with rhs.num()*lhs, rhs.den(). + friend rot_mx + operator*(int lhs, rot_mx const& rhs) + { + return rhs * lhs; + } + + //! In-place multiplication of numerator with rhs. + rot_mx& + operator*=(int rhs) + { + num_ *= rhs; + return *this; + } + + //! New rotation matrix with num() / rhs, den(). + /*! An exception is thrown if the result cannot be represented + using den(). + */ + friend rot_mx + operator/(rot_mx const& lhs, int rhs); + + //! Cancellation of factors. + /*! The denominator of the new rotation matrix is made + as small as possible. + */ + rot_mx + cancel() const; + + //! Matrix inversion with cancellation of factors. + rot_mx + inverse_cancel() const; + + //! Matrix multiplication with cancellation of factors. + rot_mx + multiply(rot_mx const& rhs) const + { + return ((*this) * rhs).cancel(); + } + + //! Matrix*vector multiplication with cancellation of factors. + tr_vec + multiply(tr_vec const& rhs) const + { + return ((*this) * rhs).cancel(); + } + + //! num()/rhs,den() with cancellation of factors. + rot_mx + divide(int rhs) const; + + //! Rotation-part type (1, 2, 3, 4, 6, -1, -2=m, -3, -4, -6) + /*! See also: cctbx::sgtbx::rot_mx_info + */ + int + type() const; + + //! Rotational order. + /*! Number of times the matrix must be multiplied with itself + in order to obtain the unit matrix. + + See also: cctbx::sgtbx::rot_mx_info + */ + int + order(int type=0) const; + + //! Sum of repeated products of this matrix with itself. + /*! identity + this + this*this + ... + this**(order() - 1) + + Restriction: the denominator must be one. + */ + rot_mx + accumulate(int type=0) const; + + //! Convenience method for constructing a rot_mx_info instance. + rot_mx_info + info() const; + + //! Conversion to a floating-point array. + template + scitbx::mat3 + as_floating_point(scitbx::type_holder) const + { + return scitbx::mat3(num_) / FloatType(den_); + } + + //! Conversion to an array with element type double. + scitbx::mat3 + as_double() const + { + return as_floating_point(scitbx::type_holder()); + } + + //! Conversion to a symbolic expression, e.g. "x,x-y,z". + /*! Constants can be formatted as fractional or decimal numbers.
+ E.g. "1/2*x,y,z" or "0.5*x,y,z".
+ symbol_letters must contain three characters that are used to + represent x, y, and z, respectively. Typical examples are + symbol_letters = "xyz" or symbol_letters = "XYZ".
+ separator is inserted between the terms for two rows. + Typical strings used are separator = "," and separator = ", ". + */ + std::string + as_xyz( + bool decimal=false, + const char* symbol_letters="xyz", + const char* separator=",") const + { + return scitbx::matrix::rational_as_xyz( + 3, 3, num_.begin(), den_, static_cast(0), 0, + decimal, false, symbol_letters, separator); + } + + //! Shorthand for: transpose().as_xyz(decimal, letters_hkl, separator) + std::string + as_hkl( + bool decimal=false, + const char* letters_hkl="hkl", + const char* separator=",") const + { + return transpose().as_xyz(decimal, letters_hkl, separator); + } + + /// Transform the given vector + template + scitbx::vec3 operator()(scitbx::vec3 const &x) const { + return (*this)*x; + } + + /// Transform the given symmetric tensor + template + scitbx::sym_mat3 operator()(scitbx::sym_mat3 const &u) const { + scitbx::sym_mat3 v = u.tensor_transform(num_); + v /= T(den_); + return v; + } + + /// Matrix realising a symmetric tensor transform + template + af::tiny tensor_transform_matrix() const { + return tensor_transform_matrix(scitbx::type_holder()); + } + + /// For compatibility with older compilers. + template + af::tiny + tensor_transform_matrix( + scitbx::type_holder const&) const + { + af::tiny result = num_.tensor_transform_matrix(); + result /= T(den_); + return result; + } + + private: + sg_mat3 num_; + int den_; + }; + + /*! \brief Multiplication of rot_mx with a vector of rational or + floating-point values. + */ + /*! Python: __mul__ + */ + template + scitbx::vec3 + operator*( + rot_mx const& lhs, + scitbx::vec3 const& rhs) + { + scitbx::vec3 result; + sg_mat3 const& l = lhs.num(); + int d = lhs.den(); + for(unsigned i=0;i<3;i++) { + result[i] = (l(i,0)*rhs[0] + l(i,1)*rhs[1] + l(i,2)*rhs[2]) / d; + } + return result; + } + + //! Multiplication of rot_mx with a vector of floating-point values. + /*! Python: __rmul__ + */ + template + scitbx::vec3 + operator*(scitbx::vec3 const& lhs, rot_mx const& rhs) + { + return lhs * rhs.num() / rhs.den(); + } + +}} // namespace cctbx::sgtbx + +#endif // CCTBX_SGTBX_ROT_MX_H diff --git a/extern/cctbx/include/cctbx/sgtbx/rot_mx_info.h b/extern/cctbx/include/cctbx/sgtbx/rot_mx_info.h new file mode 100644 index 00000000..740b2bf3 --- /dev/null +++ b/extern/cctbx/include/cctbx/sgtbx/rot_mx_info.h @@ -0,0 +1,47 @@ +#ifndef CCTBX_SGTBX_ROT_MX_INFO_H +#define CCTBX_SGTBX_ROT_MX_INFO_H + +#include + +namespace cctbx { namespace sgtbx { + + //! Class for grouping information about rotation matrices. + /*! Determing the sense of rotation requires the rotation type + and Eigenvector. Therefore it is most efficient to group + all these properties so that the intermediate results + can also be used. + */ + class rot_mx_info + { + public: + //! Default constructor. Some data members are not initialized! + rot_mx_info() {} + + //! Determination of all properties. + rot_mx_info(rot_mx const& r); + + //! Rotation-part type (1, 2, 3, 4, 6, -1, -2=m, -3, -4, -6) + int type() const { return type_; } + + //! Axis direction (Eigenvector) of the corresponding proper rotation. + /*! Only defined if abs(type()) > 1.
+ For type() > 0, the proper rotation is defined as r.
+ For type() < 0, the proper rotation is defined as -r. + So for type() == -2, this is the normal to the mirror plane. + */ + sg_vec3 const& ev() const { return ev_; } + + //! Sense of rotation with respect to the axis direction. + /*! Only defined if abs(type()) > 1. + */ + int sense() const { return sense_; } + + private: + int type_; + sg_vec3 ev_; + int sense_; + }; + +}} // namespace cctbx::sgtbx + +#endif // CCTBX_SGTBX_ROT_MX_INFO_H diff --git a/extern/cctbx/include/cctbx/sgtbx/rotation_matrices.h b/extern/cctbx/include/cctbx/sgtbx/rotation_matrices.h new file mode 100644 index 00000000..b19858a0 --- /dev/null +++ b/extern/cctbx/include/cctbx/sgtbx/rotation_matrices.h @@ -0,0 +1,54 @@ +#ifndef CCTBX_SGTBX_ROTATION_MATRICES_H +#define CCTBX_SGTBX_ROTATION_MATRICES_H + +#include + +namespace cctbx { namespace sgtbx { namespace tables { + + namespace rotation_matrices + { + static const rot_mx r_1_000( + 1, 0, 0, + 0, 1, 0, + 0, 0, 1 ); + static const rot_mx r_2_001( + -1, 0, 0, + 0, -1, 0, + 0, 0, 1 ); + static const rot_mx r_2_1b0( + 0, -1, 0, + -1, 0, 0, + 0, 0, -1 ); + static const rot_mx r_2_110( + 0, 1, 0, + 1, 0, 0, + 0, 0, -1 ); + static const rot_mx r_3_001( + 0, -1, 0, + 1, -1, 0, + 0, 0, 1 ); + static const rot_mx r_3_111( + 0, 0, 1, + 1, 0, 0, + 0, 1, 0 ); + static const rot_mx r_3i111( + 0, 1, 0, + 0, 0, 1, + 1, 0, 0 ); + static const rot_mx r_4_001( + 0, -1, 0, + 1, 0, 0, + 0, 0, 1 ); + static const rot_mx r_4i001( + 0, 1, 0, + -1, 0, 0, + 0, 0, 1 ); + static const rot_mx r_6_001( + 1, -1, 0, + 1, 0, 0, + 0, 0, 1 ); + } + +}}} // namespace cctbx::sgtbx::tables + +#endif // CCTBX_SGTBX_ROTATION_MATRICES_H diff --git a/extern/cctbx/include/cctbx/sgtbx/row_echelon_solve.h b/extern/cctbx/include/cctbx/sgtbx/row_echelon_solve.h new file mode 100644 index 00000000..d69670e4 --- /dev/null +++ b/extern/cctbx/include/cctbx/sgtbx/row_echelon_solve.h @@ -0,0 +1,22 @@ +#ifndef CCTBX_SGTBX_ROW_ECHELON_SOLVE_H +#define CCTBX_SGTBX_ROW_ECHELON_SOLVE_H + +#include +#include +#include + +namespace cctbx { namespace sgtbx { namespace row_echelon { namespace solve { + + af::tiny + homog_rank_1(af::const_ref const& re_mx, + scitbx::matrix::row_echelon::independent const& indep); + + af::tiny + homog_rank_1(af::const_ref const& re_mx); + + sg_vec3 + homog_rank_2(af::const_ref const& re_mx); + +}}}} // namespace cctbx::sgtbx::row_echelon::solve + +#endif // CCTBX_SGTBX_ROW_ECHELON_SOLVE_H diff --git a/extern/cctbx/include/cctbx/sgtbx/rt_mx.h b/extern/cctbx/include/cctbx/sgtbx/rt_mx.h new file mode 100644 index 00000000..5552011d --- /dev/null +++ b/extern/cctbx/include/cctbx/sgtbx/rt_mx.h @@ -0,0 +1,672 @@ +#ifndef CCTBX_SGTBX_RT_MX_H +#define CCTBX_SGTBX_RT_MX_H + +#include +#include +#include +#include +#include +#include +#include + +namespace cctbx { namespace sgtbx { + + //! Rotation-Translation matrix. + /*! r() is the (3x3) rotation part or rotation matrix and t() + the (3x1) translation part or translation vector of the symmetry + operation. For efficiency, the elements of the matrix and the + vector are stored as integer numbers and denominators. The actual + value of an element is obtained by dividing the integer number by + the corresponding denominator:
+ r()[i] / r().den(), t()[i] / t().den(). + */ + class rt_mx + { + public: + //! Identity rotation matrix and zero translation vector. + /*! The denominators used are r_den and t_den for the rotation part + and the translation part, respectively. + */ + explicit + rt_mx(int r_den=1, int t_den=sg_t_den) + : + r_(r_den), t_(t_den) + {} + + //! Initialization with the given rotation matrix and translation vector. + rt_mx(rot_mx const& r, tr_vec const& t) + : + r_(r), t_(t) + {} + + //! Initialization with the given rotation matrix. + /*! The translation part is initialized as the zero translation + with the supplied denominator t_den. + */ + explicit + rt_mx(rot_mx const& r, int t_den=sg_t_den) + : + r_(r), t_(t_den) + {} + + //! Initialization with the given translation vector. + /*! The rotation part is initialized as the identity matrix + with the supplied denominator r_den. + */ + explicit + rt_mx(tr_vec const& t, int r_den=1) + : + r_(r_den), t_(t) + {} + + //! Initialization with a symbolic expression, e.g. "x+1/2,y,z". + /*! Parsing will stop at any of the characters listed in stop_chars.
+ The denominators of the new rt_mx are r_den and t_den.
+ If an error occurs, an exception is thrown. parse_string can + be investigated to locate the input character that triggered + the error. + */ + rt_mx( + parse_string& symbol, + const char* stop_chars="", + int r_den=1, + int t_den=sg_t_den); + + //! Initialize by parsing a symbolic expression, e.g. "x+1/2,y,z". + /*! Identical to the constructor that takes a parse_string + as the first argument. However, if an exception is thrown + there is no way to locate the input character that triggered + the error. + */ + rt_mx( + std::string const& symbol, + const char* stop_chars="", + int r_den=1, + int t_den=sg_t_den); + + //! Initialize with floating point rotation and translation parts. + rt_mx( + scitbx::mat3 const& r, + scitbx::vec3 const& t, + int r_den=1, + int t_den=sg_t_den); + + //! Access to rotation part. + rot_mx + const& r() const { return r_; }; + + //! Access to rotation part. + rot_mx& + r() { return r_; }; + + //! Access to translation part. + tr_vec const& + t() const { return t_; }; + + //! Access to translation part. + tr_vec& + t() { return t_; }; + + //! Tests equality. + bool + operator==(rt_mx const& rhs) const + { + return !((*this) < rhs) && !(rhs < (*this)); + } + + //! Tests inequality. + bool + operator!=(rt_mx const& rhs) const + { + return !((*this) == rhs); + } + + /*! \brief Tests if lhs "is less than" rhs using the same + ordering as space_group::make_tidy(). + */ + bool + operator<(rt_mx const& rhs) const; + + /*! \brief Tests if lhs "is less than or equal" rhs using the same + ordering as space_group::make_tidy(). + */ + bool + operator<=(rt_mx const& rhs) const + { + return (*this == rhs) || (*this < rhs); + } + + /*! \brief Tests if lhs "is greater than" rhs using the same + ordering as space_group::make_tidy(). + */ + bool + operator>(rt_mx const& rhs) const; + + /*! \brief Tests if lhs "is greater than or equal" rhs using the same + ordering as space_group::make_tidy(). + */ + bool + operator>=(rt_mx const& rhs) const + { + return (*this == rhs) || (*this > rhs); + } + + //! Test if the matrix is valid. + /*! A rt_mx is valid only if both the rotation denominator and the + translation denominator are not zero. + */ + bool + is_valid() const + { + return r_.is_valid() && t_.is_valid(); + } + + //! New unit matrix. + /*! The new matrix inherits r().den() and t().den(). + */ + rt_mx + unit_mx() const + { + return rt_mx(r().den(), t().den()); + } + + //! Test if the matrix is the unit matrix. + bool + is_unit_mx() const + { + return r_.is_unit_mx() && t_.is_zero(); + } + + //! Conversion to a symbolic expression, e.g. "x+1/2,y,z". + /*! Constants can be formatted as fractional or decimal numbers.
+ E.g. "x+1/2,y,z" or "x+0.5,y,z".
+ The translation component can appear last or first.
+ E.g. "x+1/2,y,z" or "1/2+x,y,z".
+ symbol_letters must contain three characters that are used to + represent x, y, and z, respectively. Typical examples are + symbol_letters = "xyz" or symbol_letters = "XYZ". + Other letters could be used, but the resulting symbolic + expression cannot be translated back with the constructors + above.
+ separator is inserted between the terms for two rows. + Typical strings used are separator = "," and separator = ", ". + */ + std::string + as_xyz( + bool decimal=false, + bool t_first=false, + const char* symbol_letters="xyz", + const char* separator=",") const + { + return scitbx::matrix::rational_as_xyz( + 3, 3, r_.num().begin(), r_.den(), t_.num().begin(), t_.den(), + decimal, t_first, symbol_letters, separator); + } + + //! Copy matrix elements to a plain array of int. + /*! The 9 elements of the rotation part are copied to + elements 0..8 of the plain array. + The 3 elements of the translation part are copied to + elements 9..11 of the plain array. + Use r().den() and t().den() to access the denominators + for conversion to floating point representations. +

+ See also: as_double_array(), as_float_array() + */ + af::tiny + as_int_array() const; + + //! Copy matrix elements to a floating point array. + /*! The 9 elements of the rotation part are divided by r().den() + and copied to elements 0..8 of the array. + The 3 elements of the translation part are divided by t().den() + and copied to elements 9..11 of the array. +

+ See also: as_int_array(), as_double_array(), as_float_array() + */ + template + af::tiny + as_array(scitbx::type_holder) const; + + //! Copy matrix elements to a plain array of float. + /*! See also: as_array(), as_int_array(), as_double_array() + */ + af::tiny + as_float_array() const + { + return as_array(scitbx::type_holder()); + } + + //! Copy matrix elements to a plain array of double. + /*! See also: as_array(), as_int_array(), as_float_array() + */ + af::tiny + as_double_array() const + { + return as_array(scitbx::type_holder()); + } + + //! Copy with the denominators r_den and t_den. + /*! An exception is thrown if the elements cannot be scaled to + the new denominators.
+ r_den == 0 or t_den == 0 indicates that the corresponding old + denominator is retained. + */ + rt_mx + new_denominators(int r_den, int t_den=0) const; + + //! Copy of this matrix with the denominators of other. + /*! An exception is thrown if the elements cannot be scaled to + the new denominators. + */ + rt_mx + new_denominators(rt_mx const& other) const + { + return new_denominators(other.r().den(), other.t().den()); + } + + //! Multiplies the elements and the denominators by the given factors. + /*! if (factor_r == 0) factor_t = factor_r; + + Not available in Python. + */ + rt_mx + scale(int factor_r, int factor_t=0) const; + + //! Applies modulus operation such that 0 <= x < t().den(). + /*! The operation is applied to the elements of the + translation vector. The vector is modified in place. + + Not available in Python. + */ + void + mod_positive_in_place() { t_ = t_.mod_positive(); } + + //! Applies modulus operation such that 0 <= x < t().den(). + /*! The operation is applied to the elements of the + translation vector. A new instance of rt_mx is created. + */ + rt_mx + mod_positive() const { return rt_mx(r_, t_.mod_positive()); } + + /*! \brief Applies modulus operation such that + -t().den()/2+1 < x <= t().den()/2. + */ + /*! The operation is applied to the elements of the + translation vector. The vector is modified in place. + + Not available in Python. + */ + void + mod_short_in_place() { t_ = t_.mod_short(); } + + /*! \brief Applies modulus operation such that + -t().den()/2+1 < x <= t().den()/2. + */ + /*! The operation is applied to the elements of the + translation vector. A new instance of rt_mx is created. + */ + rt_mx + mod_short() const { return rt_mx(r_, t_.mod_short()); } + + /*! \brief Tests if the vector v is perpendicular to the axis + direction of the rotation part. + + Not available in Python. + */ + bool + is_perpendicular(sg_vec3 const& v) const; + + //! Computes the intrinsic (screw or glide) part of the translation part. + /*! Let N be the rotation-part type of r(). + Following the procedure given by Fischer & Koch + (International Tables for Crystallography, Volume A, 1983, + Chapter 11), the first step in the analysis of the + translation part t() is the decomposition into the + intrinsic part wi and the location part wl. For this, + (r()|t())^n = (I|t) has to be computed, where the + rotational order n = abs(N), except for N = -1 + and N = -3. For those two cases, n = -2*N. The + intrinsic part is obtained as wi = (1/n)*t.
+ See also: translation_part_info + + Not available in Python. + */ + tr_vec + t_intrinsic_part() const; + + //! Computes the location part given the intrinsic part wi. + /*! wi is the result of intrinsic_part(). The location part + is simply the difference wl = t() - wi.
+ See also: translation_part_info + + Not available in Python. + */ + tr_vec + t_location_part(tr_vec const& wi) const; + + //! Computes the origin shift given the location part wl. + /*! wl is the result of location_part(). The origin shift + is obtained by solving the equation (r()|wl)*x = x + for x (see + Acta Cryst. 1999, A55:383-395). + For rotation-part types N > 1 and N = -2, the combination + with the axis direction of r() is a convenient + description of all fixed points. For the other rotation-part + types, the fixed point is unique.
+ See also: translation_part_info + + Not available in Python. + */ + tr_vec + t_origin_shift(tr_vec const& wl) const; + + //! Efficient computation of (-I|inv_t) * (r|t). + /*! I is the identidy matrix. inv_t is the translation part + of a centre of inversion. + + Not available in Python. + */ + rt_mx + pre_multiply_inv_t(tr_vec const& inv_t) + { + return rt_mx(-r_, -t_ + inv_t); + } + + //! Computes the inverse matrix. + /*! An exception is thrown if the matrix cannot be inverted + or if the result cannot be scaled to the rotation part + denominator or the translation part denominator. + */ + rt_mx + inverse() const; + + /*! \brief Similar to /=, but multiplies denominators instead + of dividing elements. + + Not available in Python. + */ + void + pseudo_divide(int rhs) + { + r_.den() *= rhs; + t_.den() *= rhs; + } + + //! Unary minus. + rt_mx + operator-() const { return rt_mx(-r_, -t_); } + + //! Addition operator. + rt_mx + operator+(rt_mx const& rhs) const; + + //! += operator. + rt_mx& + operator+=(rt_mx const& rhs) + { + r_ += rhs.r_; + t_ += rhs.t_; + return *this; + } + + //! rt_mx + integer vector + rt_mx + operator+(sg_vec3 const& t) const + { + return rt_mx(r_, tr_vec(t_.num() + t*t_.den(), t_.den())); + } + + //! Multiplication of homogeneous rt_mx with r().den()=1. + /*! The rotation denominator of both matrices must be equal to 1. + The translation denominators of the two matrices must be equal. +

+ The denominators of the result are equal to the denominators + of the operands. +

+ operator*() is faster than multiply(). + */ + rt_mx + operator*(rt_mx const& rhs) const; + + //! Addition of translation vector to translation part. + rt_mx + operator+(tr_vec const& rhs) const; + + /*! \brief Refines gridding such that each grid point is + mapped onto another grid point by the symmetry operation. + */ + template + GridTupleType + refine_gridding(GridTupleType const& grid) const; + + //! Reduces denominators by cancellation. + /*! The rotation part denominator and the elements of the rotation + part are divided by their greatest common denominator. + The same procedure is applied to the translation part. + */ + rt_mx + cancel() const; + + //! Computes the inverse matrix. + /*! An exception is thrown if the matrix cannot be inverted. + */ + rt_mx + inverse_cancel() const; + + //! Multiplication with cancellation for general rt_mx. + /*! Similar to opertor*(). However, the operands may have any + rotation denominator or translation denominator. +

+ The denominators of the result are made as small as possible. +

+ See also: cancel() + */ + rt_mx + multiply(rt_mx const& rhs) const; + + template + scitbx::vec3 + operator*(af::tiny_plain const& rhs) const; + + /// Transform the given vector + template + scitbx::vec3 operator()(scitbx::vec3 const &x) const { + return (*this)*x; + } + + /// Transform the given symmetric tensor + template + scitbx::sym_mat3 operator()(scitbx::sym_mat3 const &u) const { + return r_(u); + } + + /*! \brief Determines unit shifts u such that + (r,t+u)*site_frac_2 is closest to site_frac_1. + */ + template + scitbx::vec3 + unit_shifts_minimum_distance( + fractional const& site_frac_1, + fractional const& site_frac_2) const + { + return fractional( + site_frac_1 - (*this) * site_frac_2).unit_shifts(); + } + + /*! \brief Adds unit shifts u such that + (r,t+u)*site_frac_2 is closest to site_frac_1. + */ + template + rt_mx + add_unit_shifts_minimum_distance( + fractional const& site_frac_1, + fractional const& site_frac_2) const + { + return rt_mx(r_, + t_ + tr_vec(unit_shifts_minimum_distance( + site_frac_1, site_frac_2) * t_.den(), t_.den())); + } + + private: + rot_mx r_; + tr_vec t_; + }; + + template + af::tiny + rt_mx::as_array(scitbx::type_holder) const + { + af::tiny result; + for(std::size_t i=0;i<9;i++) { + result[i ] = FloatType(r_[i]) / FloatType(r().den()); + } + for(std::size_t i=0;i<3;i++) { + result[i + 9] = FloatType(t_[i]) / FloatType(t().den()); + } + return result; + } + + template + IntType + norm_denominator(IntType numerator, IntType denominator) + { + return denominator / scitbx::math::gcd_int(numerator, denominator); + } + + template + GridTupleType + rt_mx::refine_gridding(GridTupleType const& grid) const + { + GridTupleType result; + for(std::size_t ir=0;ir<3;ir++) { + result[ir] = boost::lcm( + grid[ir], norm_denominator(t_[ir], t_.den())); + for(std::size_t ic=0;ic<3;ic++) { + result[ir] = boost::lcm( + result[ir], norm_denominator(this->r_(ir, ic), grid[ic])); + } + } + return result; + } + + /*! \brief Multiplication of rt_mx with a vector of rational or + floating-point values. + */ + /*! Python: __mul__ + */ + template + scitbx::vec3 + rt_mx::operator*( + af::tiny_plain const& rhs) const + { + scitbx::vec3 result; + int rd = r_.den(); + int td = t_.den(); + for(unsigned i=0;i<3;i++) { + result[i] = ( r_(i,0) * rhs[0] + + r_(i,1) * rhs[1] + + r_(i,2) * rhs[2]) / rd + RatFltType(t_[i]) / td; + } + return result; + } + + //! Parser for xyz expressions. + struct rt_mx_from_string : rt_mx + { + bool have_xyz; + bool have_hkl; + bool have_abc; + + rt_mx_from_string() {} + + rt_mx_from_string( + parse_string& input, + const char* stop_chars, + int r_den, + int t_den, + bool enable_xyz, + bool enable_hkl, + bool enable_abc); + }; + + //! Analysis of the translation part of a rotation-translation matrix. + /*! Grouping of the results of rt_mx::t_intrinsic_part(), + rt_mx::t_location_part() and rt_mx::t_origin_shift(). + */ + class translation_part_info + { + public: + //! Default constructor. Some data members are not initialized! + translation_part_info() + {} + + /*! \brief Determination of intrinsic_part(), location_part() + and origin_shift(). + */ + translation_part_info(rt_mx const& s); + + //! Intrinsic (srew or glide) part. + /*! See rt_mx::t_intrinsic_part() + */ + tr_vec const& + intrinsic_part() const { return ip_; } + + //! Location part. + /*! See rt_mx::t_location_part() + */ + tr_vec const& + location_part() const { return lp_; } + + //! Origin shift. + /*! See rt_mx::t_origin_shift() + */ + tr_vec const& + origin_shift() const { return os_; } + + private: + tr_vec ip_; + tr_vec lp_; + tr_vec os_; + }; + + //! Symmetry-averaged tensor. + /*! reciprocal_space = false: + sum[tensor.tensor_transpose_transform(r)] / matrices.size() + + reciprocal_space = true: + sum[tensor.tensor_transform(r)] / matrices.size() + + over all rotation parts r of matrices. + + See also: + Giacovazzo, Fundamentals of Crystallography 1992, p. 189. + + Not available in Python. + */ + template + scitbx::sym_mat3 + average_tensor( + af::const_ref const& matrices, + scitbx::sym_mat3 const& tensor, + bool reciprocal_space) + { + scitbx::sym_mat3 result(0,0,0,0,0,0); + for (std::size_t i=0;i + r = matrices[i].r() + .as_floating_point(scitbx::type_holder()); + if (reciprocal_space) { + result += tensor.tensor_transform(r); + } + else { + result += tensor.tensor_transpose_transform(r); + } + } + return result / static_cast(matrices.size()); + } + +}} // namespace cctbx::sgtbx + +#endif // CCTBX_SGTBX_RT_MX_H diff --git a/extern/cctbx/include/cctbx/sgtbx/select_generators.h b/extern/cctbx/include/cctbx/sgtbx/select_generators.h new file mode 100644 index 00000000..202f38ec --- /dev/null +++ b/extern/cctbx/include/cctbx/sgtbx/select_generators.h @@ -0,0 +1,40 @@ +#ifndef CCTBX_SGTBX_SELECT_GENERATORS_H +#define CCTBX_SGTBX_SELECT_GENERATORS_H + +#include + +namespace cctbx { namespace sgtbx { namespace select_generators { + + struct any + { + any() : n_gen(0) {} + + any(space_group const& sg, int z2p_r_den, int z2p_t_den); + + std::size_t n_all() const + { + if (z_inv_t.is_valid()) return n_gen + 1; + return n_gen; + } + + void set_primitive(); + + change_of_basis_op z2p_op; + tr_vec z_inv_t; + tr_vec p_inv_t; + std::size_t n_gen; + rt_mx z_gen[2]; + rt_mx p_gen[2]; + }; + + struct standard : any + { + standard(space_group const& work_sg, + int z2p_r_den, + int z2p_t_den, + matrix_group::code const& point_group_mx_group_code); + }; + +}}} // namespace cctbx::sgtbx::select_generators + +#endif // CCTBX_SGTBX_SELECT_GENERATORS_H diff --git a/extern/cctbx/include/cctbx/sgtbx/smith_normal_form.h b/extern/cctbx/include/cctbx/sgtbx/smith_normal_form.h new file mode 100644 index 00000000..ab305560 --- /dev/null +++ b/extern/cctbx/include/cctbx/sgtbx/smith_normal_form.h @@ -0,0 +1,32 @@ +#ifndef CCTBX_SGTBX_SMITH_NORMAL_FORM_H +#define CCTBX_SGTBX_SMITH_NORMAL_FORM_H + +#include + +namespace cctbx { namespace sgtbx { + + template + void + smith_normal_form( + af::ref& m, + af::ref const& p, + af::ref const& q) + { + if (p.begin()) p.set_identity(); + if (q.begin()) q.set_identity(); + for (;;) + { + scitbx::matrix::row_echelon::form_t(m, p); + if (m.is_diagonal()) break; + m.transpose_in_place(); + + scitbx::matrix::row_echelon::form_t(m, q); + if (m.is_diagonal()) break; + m.transpose_in_place(); + } + if (q.begin()) q.transpose_square_in_place(); + } + +}} // namespace cctbx::sgtbx + +#endif // CCTBX_SGTBX_SMITH_NORMAL_FORM_H diff --git a/extern/cctbx/include/cctbx/sgtbx/space_group.h b/extern/cctbx/include/cctbx/sgtbx/space_group.h new file mode 100644 index 00000000..1b071dac --- /dev/null +++ b/extern/cctbx/include/cctbx/sgtbx/space_group.h @@ -0,0 +1,793 @@ +#ifndef CCTBX_SGTBX_SPACE_GROUP_H +#define CCTBX_SGTBX_SPACE_GROUP_H + +#include +#include +#include +#include +#include + +namespace cctbx { namespace sgtbx { + + //! Specific exception to indicate failure of group multiplication. + class error_non_crystallographic_rotation_matrix_encountered : public error + { + public: + error_non_crystallographic_rotation_matrix_encountered() + : + error("Non-crystallographic rotation matrix encountered.") + {} + }; + + class space_group_type; // forward declaration + + //! Space group operations. + /*! This class is composed of the following main components:
+

    +
  1. A list of n_ltr() centring vectors. +
  2. An integer f_inv() and the translation part inv_t() of an inversion + operation, if present. f_inv() = 1 if no inversion operation + exists, f_inv() = 2 otherwise. +
  3. A list of n_smx() = order_z()/(n_ltr()*f_inv()) representative + symmetry matrices. +
+ */ + class space_group + { + public: + //! Type of internal array of Seitz matrices. + typedef af::small smx_array_type; + + //! Default constructor. Symmetry is set to P1. + /*! With no_expand = true, group multiplication will not be + carried out. This option is for internal use only. +

+ Not available in Python. + */ + explicit + space_group( bool no_expand=false, int t_den=sg_t_den) + : + no_expand_(no_expand) + { + reset(t_den); + } + + //! Initialization with symmetry encoded by a Hall symbol. + /*! The Hall symbol parser can be instructed to be more + or less pedantic.
+ With no_centring_type_symbol = true, the parser + can also be used to interpret matrix symbols only. This + option is for internal use only.
+ An exception is thrown if an error occurs. parse_string can + be investigated to locate the input character that triggered + the error. + */ + explicit + space_group( + parse_string& hall_symbol, + bool pedantic=false, + bool no_centring_type_symbol=false, + bool no_expand=false, + int t_den=sg_t_den); + + //! Initialization with symmetry encoded by a Hall symbol. + /*! Identical to the constructor that takes a parse_string + as the first argument. However, if an exception is thrown + it is not possible to locate the input character that + triggered the error. + */ + explicit + space_group( + std::string const& hall_symbol, + bool pedantic=false, + bool no_centring_type_symbol=false, + bool no_expand=false, + int t_den=sg_t_den); + + /*! Identical to the constructor that takes a parse_string + as the first argument. However, if an exception is thrown + it is not possible to locate the input character that + triggered the error. + */ + explicit + space_group( + const char* hall_symbol, + bool pedantic=false, + bool no_centring_type_symbol=false, + bool no_expand=false, + int t_den=sg_t_den); + + /*! \brief Initialization with the Hall symbol of the + space_group_symbols object. + */ + explicit + space_group( + sgtbx::space_group_symbols const& space_group_symbols, + int t_den=sg_t_den); + + //! Resets the symmetry to P1. + void + reset(int t_den=sg_t_den); + + //! Adds a lattice translation vector to the space group. + /*! Group multiplication is automatically performed + (unless no_expand = true). + */ + space_group& + expand_ltr(tr_vec const& new_t); + + //! Adds a centre of inversion to the space group. + /*! The matrix added is (-I, new_inv_t). This is, the rotation part + -I is implied, and the translation part is new_inv_t.
+ Group multiplication is automatically performed + (unless no_expand = true). + */ + space_group& + expand_inv(tr_vec const& new_inv_t); + + //! Adds a Seitz matrix to the space group. + /*! Group multiplication is automatically performed + (unless no_expand = true). + */ + space_group& + expand_smx(rt_mx const& new_smx); + + //! Adds a vector of Seitz matrices to the space group. + /*! See also: overload for individual new_smx. +

+ Not available in Python. + */ + space_group& + expand_smx(af::const_ref const& new_smx) + { + for(std::size_t i=0;i + Group multiplication is automatically performed + (unless no_expand = true). + */ + std::size_t + expand_conventional_centring_type(char symbol); + + //! Parses a Hall Symbol and adds the encoded symmetry matrices. + /*! Similar to the constructors that take a Hall symbol as the + first argument. However, the new symmetry matrices are added + to the existing ones. + */ + std::size_t + parse_hall_symbol( + parse_string& hall_symbol, + bool pedantic=false, + bool no_centring_type_symbol=false); + + //! Parses a Hall Symbol and adds the encoded symmetry matrices. + /*! The change-of-basis operator is parsed but not applied. + For internal use only. +

+ Not available in Python. + */ + std::size_t + parse_hall_symbol_cb_op( + parse_string& hall_symbol, + change_of_basis_op& cb_op, + bool pedantic=false, + bool no_centring_type_symbol=false); + + //! Applies a change-of-basis operator to the symmetry operations. + /*! The transformed space group is returned as a new object.
+ An exception is thrown if the change-of-basis operator is + invalid or if the new symmetry matrices can not be + represented as integer matrices with denominators in use. + */ + space_group + change_basis(change_of_basis_op const& cb_op) const; + + //! The change of origin which moves the inversion centre to the origin + /*! The basis axes are therefore not altered */ + change_of_basis_op + change_of_origin_realising_origin_centricity() const; + + //! Rotation part denominator of the Seitz matrices. + int r_den() const { return smx_[0].r().den(); } + //! Translation part denominator of the Seitz matrices. + int + t_den() const { return smx_[0].t().den(); } + + //! Order of the point group = f_inv() * n_smx(). + std::size_t + order_p() const { return f_inv_ * n_smx(); } + + //! Order of the space group = n_ltr() * f_inv() * n_smx(). + /*! Python: __len__ + */ + std::size_t + order_z() const { return ltr_.size() * f_inv_ * n_smx(); } + + //! Alias for order_z(). + std::size_t + n_equivalent_positions() const { return order_z(); } + + //! Number of lattice translations. + std::size_t + n_ltr() const { return ltr_.size(); } + + //! Access to the group of lattice translation vectors. + /*! Not available in Python. + */ + tr_group + const& ltr() const { return ltr_; } + + //! Access to elements of the group of lattice translation vectors. + /*! Not available in Python. + */ + tr_vec + const& ltr(std::size_t i) const { return ltr_[i]; } + + //! Tests for a centre of inversion. + bool + is_centric() const { return f_inv_ == 2; } + + //! Tests for a centre of inversion at the origin. + bool + is_origin_centric() const + { + return is_centric() && inv_t(true).is_zero(); + } + + //! Flag for centre of inversion. + /*! f_inv() = 1 if no inversion operation exists,
+ f_inv() = 2 otherwise. + */ + std::size_t + f_inv() const { return f_inv_; } + + //! Translation part for centre of inversion. + /*! Not available in Python. + */ + tr_vec + inv_t(bool tidy=false) const + { + if (tidy == false) return inv_t_; + if (!inv_t_.is_valid()) return inv_t_; + return ltr_.tidy(inv_t_); + } + + //! Number of representative Seitz matrices. + std::size_t + n_smx() const { return smx_.size(); } + + //! Access to the list of representative Seitz matrices. + /*! Not available in Python. + */ + smx_array_type + const& smx() const { return smx_; } + + //! Access to elements of the list of representative Seitz matrices. + /*! Not available in Python. + */ + rt_mx + const& smx(std::size_t i) const { return smx_[i]; } + + //! Returns a symmetry operation. + /*! Usage:

+          space_group sg(...);
+          for (std::size_t i_ltr = 0; i_ltr < sg.n_ltr(); i_ltr++)
+            for (std::size_t i_inv = 0; i_inv < sg.f_inv(); i_inv++)
+              for (std::size_t i_smx = 0; i_smx < sg.n_smx(); i_smx++)
+                rt_mx M = sg(i_ltr, i_inv, i_smx);
+ The symmetry operations are generated from the representative + list of Seitz matrices. The lattice translation with the index + i_ltr is added to the translation part. If i_inv = 1, the + representative Seitz matrix is pre-multiplied by (-I, inv_t).
+ Note that the translation part of the returned Seitz matrix + is NOT modified by application of the modulus operation. + */ + rt_mx + operator()( + std::size_t i_ltr, + std::size_t i_inv, + std::size_t i_smx) const; + + //! Returns a symmetry operation. + /*! Usage:
+          space_group sg(...);
+          for (std::size_t i_op = 0; i_op < sg.order_z(); i_op++)
+            rt_mx s = sg(i_op);
+ The symmetry operations are generated from the representative + list of Seitz matrices. Internally i_op is interpreted as:
+ i_op = ((i_ltr * f_inv()) + i_inv) * n_smx() + i_smx
+ The comments for + operator()(std::size_t i_ltr, std::size_t i_inv, std::size_t i_smx) + apply. +

+ Python: __getitem__ + */ + rt_mx + operator()(std::size_t i_op) const; + + //! Tidies the lists of representative symmetry operations in place. + /*! The list of lattice translations is sorted in a certain order. + If there is a centre of inversion, a certain normalized + translation part is selected for inv_t(), and a proper + rotation part is selected for all Seitz matrices in the + representative list. The list of representative Seitz + matrices is sorted, and the translation parts are + normalized. +

+ After application of make_tidy(), a given space group + representation will always result in exactly the same + internal representation. + */ + space_group& + make_tidy(); + + //! True if make_tidy() was called before. + bool + is_tidy() const { return is_tidy_; } + + //! Tests if smx modulo 1 is an operation of the group. + bool + contains(rt_mx const& smx) const; + + //! Tests for equality. + /*! Internally, make_tidy() is used, followed by essentially a + byte-wise comparison of the objects.
+ Each space_group object maintains an internal flag + indicating whether or not make_tidy() was applied already. + If an space_group object is repeatedly used in a test for equality, + the test will therefore be significantly faster if make_tidy() + is applied outside the loop. + */ + bool + operator==(space_group const& rhs) const; + + //! Negation of test for equality. + bool + operator!=(space_group const& rhs) const + { + return !((*this) == rhs); + } + + //! Determines the conventional centring type symbol (P,A,B,C,I,R,H,F). + /*! If the lattice translation vectors do not correspond to + any of the conventional centring types, the null character + is returned. + */ + char + conventional_centring_type_symbol() const + { + return ltr_.conventional_centring_type_symbol(); + } + + //! Determines an operator for centred-to-primitive basis transformation. + /*! Determines a change-of-basis operator that transforms the + symmetry from a centered to a primitive setting.
+ For the conventional lattice centring types (P, A, B, C, I, R, H, F) + a standard change-of-basis operator is determined by a lookup in a + table. For unconventional lattice centring types, a change-of-basis + operator is constructed with the algorithm published in + Acta Cryst. 1999, A55:383-395.
+ The change-of-basis operator can be used as the argument to + the change_basis() member function:

+          space_group centred(...);
+          space_group primitive = centred.change_basis(centred.z2p_op());
+ */ + change_of_basis_op + z2p_op(int r_den=cb_r_den, int t_den=cb_t_den) const; + + //! Constructs an operator for centred->primitive basis transformation. + /*! Similar to z2p_op(), but does not use standard change-of-basis + operators for conventional lattice centring types.
+ For internal use only. + */ + change_of_basis_op + construct_z2p_op(int r_den=cb_r_den, int t_den=cb_t_den) const; + + //! Tests for chirality. + /*! A space group is chiral if all its symmetry operations + have a positive rotation-part type (1, 2, 3, 4, 6).
+ If there are symmetry operations with negative rotation-part + types (-1, -2=m, -3, -4, -6) the space group is not chiral.
+ There are exactly 65 chiral space groups.
+ Note that proteins always crystallize in a chiral space + group. + */ + bool + is_chiral() const; + + /*! \brief Tests if a reflection with given Miller index is + systematically absent. + */ + bool + is_sys_absent(miller::index<> const& miller_index) const + { + return phase_info(*this, miller_index, false).is_sys_absent(); + } + + /*! \brief Tests if a reflection with given Miller index is + systematically absent. + */ + /*! Overload for arrays. + */ + af::shared + is_sys_absent( + af::const_ref > const& miller_indices) const; + + //! Tests if a reflection with given Miller index is centric. + /*! A reflection with the Miller index h is "centric" if + there is a symmetry operation with rotation part r such + that h*r = -h.
+ The phase of a centric reflection is restricted to two phase + angels (modulo pi).
+ If the phase restriction is also needed later in the + calculation it is more efficient to use phase_restriction(). + */ + bool + is_centric(miller::index<> const& miller_index) const; + + //! Tests if a reflection with given Miller index is centric. + /*! Overload for arrays. + */ + af::shared + is_centric( + af::const_ref > const& miller_indices) const; + + //! Determines the phase restriction for the given Miller index. + /*! See class phase_info. The conditions for systematically + absent reflections are NOT tested. + */ + phase_info + phase_restriction(miller::index<> const& miller_index) const + { + return phase_info(*this, miller_index, true); + } + + //! See class phase_info::is_valid_phase(). + bool + is_valid_phase( + miller::index<> const& miller_index, + double phi, + bool deg=false, + double tolerance=1e-5) const + { + return phase_restriction(miller_index) + .is_valid_phase(phi, deg, tolerance); + } + + //! Computes nearest phases compatible with the phase restrictions. + /*! See also: class phase_info::nearest_valid_phase() + */ + af::shared + nearest_valid_phases( + af::const_ref > const& miller_indices, + af::const_ref const& phases, + bool deg=false) const; + + //! Determines the reflection multiplicity for the given Miller index. + /*! The multiplicity is defined as the number of symmetrically + equivalent but distinct reflections.
+ If anomalous_flag == false, a centre of inversion is added to the + list of symmetry matrices considered in the determination of + the multiplicity. + */ + int + multiplicity( + miller::index<> const& miller_index, + bool anomalous_flag) const; + + //! Determines the reflection multiplicity for the given Miller index. + /*! Overload for arrays. + */ + af::shared + multiplicity( + af::const_ref > const& miller_indices, + bool anomalous_flag) const; + + //! Determines "epsilon" for the given Miller index. + /*! The factor epsilon counts the number of times a Miller + index h is mapped onto itself by symmetry. This factor + is used for "statistical averaging" and in direct methods + formulae.
+ See also: miller::sym_equiv_indices::epsilon() + */ + int + epsilon(miller::index<> const& miller_index) const; + + //! Determines "epsilon" for the given Miller index. + /*! Overload for arrays. + */ + af::shared + epsilon(af::const_ref > const& miller_indices) const; + + //! Determines multiplicity of site given rational coordinates. + int + multiplicity( + vec3_rat const& site) const; + + //! Computes a metrical matrix compatible with the space group symmetry. + /*! A metrical matrix g is compatible with a given space group + representation if the following relation holds for all + rotation matrices r of the space group: +

+ r.transposed() * g * r == g +

+ This function returns the average of r.transposed() * g * r. + The result is guaranteed to be compatible with the space + group symmetry. +

+ See also: average_unit_cell(), + uctbx::unit_cell::metrical_matrix() +

+ Not available in Python. + */ + uc_sym_mat3 + average_metrical_matrix(uc_sym_mat3 const& g) const + { + return average_tensor(smx_.const_ref(), g, false); + } + + //! Computes a unit cell compatible with the space group symmetry. + /*! Shorthand for: + uctbx::unit_cell(average_metrical_matrix(ucell.metrical_matrix())); + */ + uctbx::unit_cell + average_unit_cell(uctbx::unit_cell const& unit_cell) const + { + return uctbx::unit_cell( + average_metrical_matrix(unit_cell.metrical_matrix())); + } + + //! Tests if a unit cell is compatible with the symmetry operations. + bool + is_compatible_unit_cell( + uctbx::unit_cell const& unit_cell, + double relative_length_tolerance=0.01, + double absolute_angle_tolerance=1.) const + { + return unit_cell.is_similar_to( + average_unit_cell(unit_cell), + relative_length_tolerance, + absolute_angle_tolerance); + } + + /*! \brief Averages symmetrically equivalent u_star tensors to + obtain a tensor that satisfies the symmetry constraints. + */ + /*! The averaged tensor is equivalent to beta_inv + of Giacovazzo, Fundamentals of Crystallography 1992, + p. 189. + */ + template + scitbx::sym_mat3 + average_u_star(scitbx::sym_mat3 const& u_star) const + { + return average_tensor(smx_.const_ref(), u_star, true); + } + + //! The translation parts of the symmetry operations are set to 0. + /*! If discard_z = false, the lattice translation vectors are not + modified. If add_inv = true, a centre of inversion is added + at the origin. +

+ See also: + build_derived_reflection_intensity_group(), + build_derived_patterson_group(), + build_derived_point_group(), + build_derived_laue_group() +

+ Not available in Python. + */ + space_group + build_derived_group(bool discard_z, bool add_inv) const; + + //! New instance without a centre of inversion. + space_group + build_derived_acentric_group() const; + + //! Builds the symmetry for reflection intensities. + /*! The translation parts of the symmetry operations are set to 0. + However, the lattice translation vectors are not modified. + If anomalous_flag = false a centre of inversion is added at + the origin. + */ + space_group + build_derived_reflection_intensity_group(bool anomalous_flag) const + { + return build_derived_group(false, !anomalous_flag); + } + + //! Builds the corresponding Patterson space group. + /*! The translation parts of the symmetry operations are set to 0. + However, the lattice translation vectors are not modified. + A centre of inversion is added at the origin. + */ + space_group + build_derived_patterson_group() const + { + return build_derived_group(false, true); + } + + //! Builds the corresponding point group. + /*! The translation parts of the symmetry operations are set to 0, + and the lattice translation vectors are discarded. + */ + space_group + build_derived_point_group() const + { + return build_derived_group(true, false); + } + + //! Builds the corresponding Laue group. + /*! The translation parts of the symmetry operations are set to 0, + the lattice translation vectors are discarded, + and a centre of inversion is added at the origin. + */ + space_group + build_derived_laue_group() const + { + return build_derived_group(true, true); + } + + //! Histogram of rotation-part types. + /*! The histogram is accumulated in a std::map. The key + is the rotation-part type (-6,-4,-3,-2,-1,1,2,3,4,6), + and the value is the number of times this rotation-part + type occurs in the list of representative symmetry + matrices.
+ This function is used by the algorithm for the determination + of the space group type and its usefulness is probably + limited to this context. +

+ Not available in Python. + */ + std::map + count_rotation_part_types() const; + + //! Determines the point group type. + /*! The code returned is a matrix group code. There are + exactly 32 possible return values, corresponding to + the 32 crystallographic point group types. +

+ Python: returns a string representing the point group type. + */ + matrix_group::code + point_group_type() const; + + //! Determines the Laue group type. + /*! The code returned is a matrix group code. There are + exactly 11 possible return values, corresponding to + the 11 Laue group types. +

+ Python: returns a string representing the Laue group type. + */ + matrix_group::code + laue_group_type() const + { + return point_group_type().laue_group_type(); + } + + //! Determines the crystal system. + /*! There are exactly 7 possible return values. +

+ Python: returns a string representing the crystal system. + */ + crystal_system::code + crystal_system() const + { + return point_group_type().crystal_system(); + } + + //! Matches given symmetry operations with the 530 tabulated settings. + /*! This is a light-weight alternative to using space_group_type, + but is applicable only to the 530 tabulated settings. +

+ This algorithm is not particularly optimized. Therefore + the runtime for match_tabulated_settings() and the runtime for + instantiating space_group_type are in general comparable. + The main purpose of this algorithm is therefore the + retrieval of conventionally used Hermann-Mauguin symbols. + */ + space_group_symbols + match_tabulated_settings() const; + + //! Refines gridding starting with grid (1,1,1). + /*! See also: refine_gridding() + */ + sg_vec3 + gridding() const + { + return refine_gridding(sg_vec3(1,1,1)); + } + + /*! \brief Refines gridding such that each grid point is + mapped onto another grid point by all symmetry operations. + */ + template + GridTupleType + refine_gridding(GridTupleType const& grid) const; + + //! Returns a straight list of all symmetry operations. + /*! The operations are in the same order as returned by + operator(std::size_t). +

+ If mod > 0, rt_mx::mod_positive() is applied to all operations.
+ If mod < 0, rt_mx::mod_short() is applied to all operations.
+ If mod == 0, the translation parts are not treated in a special way. +

+ If cancel == true, the translation denominators of the + returned operations are made as small as possible by + cancellation of factors. + */ + af::shared + all_ops(int mod=0, bool cancel=false) const; + + /*! \brief Computes the unique symmetry operations given a + special position operator. + */ + /*! special_op is multiplied with all symmetry operations + of the space group. The unique results are returned. +

+ The rotation and translation denominators of the returned + operations are made as small as possible by cancellation + of factors. +

+ See also: site_symmetry::unique_ops(), + wyckoff::position::unique_ops() + */ + af::shared + unique(rt_mx const& special_op) const; + + //! Convenience method for instantiating class space_group_type. + space_group_type type() const; + + private: + bool no_expand_; + std::size_t n_lsl_; + std::size_t n_ssl_; + std::size_t f_inv_; + tr_group ltr_; + tr_vec inv_t_; + bool is_tidy_; + smx_array_type smx_; + + void add_inv(tr_vec const& new_inv_t); + + void add_smx(rt_mx const& new_smx); + }; + + template + GridTupleType + space_group::refine_gridding(GridTupleType const& grid) const + { + GridTupleType prev_grid = grid; + GridTupleType refined_grid = grid; + for (;;) { + for(std::size_t i=0;i + +namespace cctbx { namespace sgtbx { + + //! Computation and use of change-of-basis matrix to reference setting. + /*! A space group type is characterized by the space group number + according to the International Tables for Crystallography, + Volume A, and a change-of-basis matrix that transforms + the coordinates of a given setting to a reference setting. + */ + class space_group_type + { + public: + //! Default constructor. + /*! Equivalent to space_group_type(space_group()) + */ + space_group_type() : number_(1), cb_op_is_tidy_(true) {} + + //! Initializer using space group symbols. + /*! Equivalent to + space_group_type( + space_group(space_group_symbols(symbol, table_id)), + tidy_cb_op) + */ + explicit + space_group_type( + std::string const& symbol, + std::string const& table_id="", + bool tidy_cb_op=true); + + //! Determines the space group type. + /*! The algorithm for the determination of the space group + type is published in + Acta Cryst. 1999, A55:383-395. + The result is the space group number according to the + International Tables for Crystallography, and a + change-of-basis matrix that transforms the given space group + to its reference setting. r_den and t_den are the rotation part + denominator and the translation part denominator, respectively, + for the change-of-basis matrix.

+ In general, there are several change-of-basis matrices that + could be used. If tidy_cb_op == true, the operations of the + affine normalizer are used to determine a "standard" + change-of-basis matrix. This is, the change-of-basis matrix + is independent of the order of the given symmetry operations. + In principle, the space group number and the "standard" + change-of-basis matrix could be used to test for the + equivalence of two groups of symmetry operations (but the + algorithm used for operator== is more efficient). + On average, the additional time required for the + determination of the "standard" change-of-basis matrix + is about 70% of the time for the main determination + of the space group type. This is, the tidy_cb_op == true + option is relatively expensive. However, the absolute + runtime is only a small fraction of a second. + */ + explicit + space_group_type( + space_group const& group, + bool tidy_cb_op=true, + int r_den=cb_r_den, + int t_den=cb_t_den); + + //! Access to space group passed to the constructor. + space_group const& + group() const { return group_; } + + //! Space group number according to the International Tables. + int + number() const { return number_; } + + //! Change-of-basis operator. + change_of_basis_op const& + cb_op() const { return cb_op_; } + + //! Setting as passed to the constructor via tidy_cp_op. + bool + cb_op_is_tidy() const { return cb_op_is_tidy_; } + + //! Gets the additional generators of the Euclidean normalizer. + /*! See International Tables for Crystallography Volume A, + 1983, Table 15.3.2. The generators are tabulated for + reference settings and transformed to the given setting + using cb_op(). +

+ flag_k2l = true requests the additional generator from + column "Inversion through a centre at" of Table 15.3.2. +

+ flag_l2n = true requests the additional generators from + column "Further generators" of Table 15.3.2. +

+ See also: class StructureSeminvariant + */ + af::shared + addl_generators_of_euclidean_normalizer( + bool flag_k2l, + bool flag_l2n) const; + + /*! \brief Adds the additional generators of the Euclidean normalizer + to the space group. + */ + /*! See also: addl_generators_of_euclidean_normalizer(), + space_group::expand_smx() + */ + space_group + expand_addl_generators_of_euclidean_normalizer( + bool flag_k2l, + bool flag_l2n) const + { + space_group result = group_; + result.expand_smx( + addl_generators_of_euclidean_normalizer(flag_k2l, flag_l2n) + .const_ref()); + return result; + } + + //! Tests for the 22 (11 pairs) enantiomorphic space groups. + /*! A space group G is enantiomorphic if G and -I.G.-I have + two different space group types. I is the unit matrix.
+ There are 11 pairs of enantiomorphic space groups, + for example P41 and P43. +

+ The notion of enantiomorphic space groups is connected + to the notion of affine space group types. There + are 219 affine space group types, compared to the + 230 conventional space group types. A pair of + enantiomorphic space groups corresponds to a single + affine space group type. +

+ See also: change_of_hand_op() + */ + bool + is_enantiomorphic() const; + + //! Simple table lookup. + /*! A space group is symmorphic if, apart from the lattice translations, + all symmetry operations leave one common point fixed. This is + true for 73 space group types, e.g. C222. +

+ See also: + http://reference.iucr.org/dictionary/Symmorphic_space_groups + */ + bool + is_symmorphic() const; + + //! Determines a change-of-hand matrix. + /*! If the space group is centro-symmetric, the change-of-hand + matrix is the identity matrix. +

+ If the space group belongs to one of the 22 enantiomorphic + space group types, the change-of-hand matrix is determined as + a centre of inversion that is located at the origin of the + reference setting. +

+ If the space group is not enantiomorphic and not + centro-symmetric, the change-of-hand matrix is determined as + a centre of inversion of the Euclidean normalizer. +

+ The change-of-hand matrix can be used to transform the + symmetry operations to obtain the enantiomorph symmetry + operations (use space_group::change_basis()), and to transform + fractional coordinates. For example:

+          space_group sg = ...;
+          space_group_type sg_type(sg);
+          change_of_basis_op cb_op = sg_type.change_of_hand_op();
+          space_group enantiomorph_sg = sg.change_basis(cb_op);
+          fractional<> x = ...;
+          fractional<> enatiomorph_x = cb_op(x);
+

+ See also: addl_generators_of_euclidean_normalizer(), + is_enantiomorphic(), space_group::change_basis() + */ + change_of_basis_op + change_of_hand_op() const; + + //! Builds a Hall symbol for the given symmetry operations. + /*! For a given group of symmetry operations, there are in + general several plausible choices for a Hall symbol. + The Hall symbol returned by this algorithm is derived + from the Hall symbol for the reference setting. A change-of-basis + operator is attached if necessary (i.e. "P 2 (y,z,x)"). +

+ If tidy_cb_op == true, the returned Hall symbol + is a reproducible representation of a + given setting that is independent of the order of + the symmetry operations. + */ + std::string + hall_symbol(bool tidy_cb_op = true) const; + + /*! \brief Builds a universal Hermann-Mauguin symbol for the given + symmetry operations. + */ + /*! If tidy_cb_op == true, the returned symbol + is a reproducible representation of a + given setting that is independent of the order of + the symmetry operations. + */ + std::string + universal_hermann_mauguin_symbol(bool tidy_cb_op = true) const; + + //! Determines conventional Hermann-Mauguin symbol or Hall symbol. + /*! First, group().match_tabulated_settings() is called. If the given + symmetry operations correspond to one of the 530 tabulated + settings, the extended Hermann-Mauguin symbol is returned + (e.g. "P n n n :2"). Otherwise the string "Hall: " + the + result of hall_symbol() is returned (e.g. "Hall: P 2 2 + -1n"). +

+ The result of lookup_symbol() can be used as the input + for the constructor of class space_group_symbols. +

+ If ad_hoc_1992 is true, symbols for space groups + 39, 41, 64, 67, and 68 will contain the "e" character: +

+ Acta Cryst. (1992). A48, 727-732. + Symbols for symmetry elements and symmetry operations. + Final report of the International Union of Crystallography + Ad-Hoc Committee on the nomenclature of symmetry. +

+ http://www.iucr.org/iucr-top/comm/cnom/symsym/node7.html +

+          Space group No.   39   41   64   67   68
+          Symbol in ITA83: Abm2 Aba2 Cmca Cmma Ccca
+               New symbol: Aem2 Aea2 Cmce Cmme Ccce
+          
+

+ The "e" symbols are ambiguous for space groups 67 and 68: +

+          No. 67:
+            Cmme: Cmma or Cmmb
+            Aemm: Abmm or Acmm
+            Bmem: Bmcm or Bmam
+          No. 68
+            Ccce: Ccca or Cccb
+            Aeaa: Abaa or Acaa
+            Bbeb: Bbcb or Bbab
+          
+ This function produces the first choice, e.g. Cmme = Cmma. + */ + std::string + lookup_symbol( + bool ad_hoc_1992=false) const; + + protected: + space_group group_; + int number_; + change_of_basis_op cb_op_; + bool cb_op_is_tidy_; + mutable std::string hall_symbol_tidy_true_; + mutable std::string hall_symbol_tidy_false_; + mutable std::string uhm_symbol_tidy_true_; + mutable std::string uhm_symbol_tidy_false_; + mutable std::string lookup_symbol_; + }; + +}} // namespace cctbx::sgtbx + +#endif // CCTBX_SGTBX_SPACE_GROUP_TYPE_H diff --git a/extern/cctbx/include/cctbx/sgtbx/symbols.h b/extern/cctbx/include/cctbx/sgtbx/symbols.h new file mode 100644 index 00000000..5b360afd --- /dev/null +++ b/extern/cctbx/include/cctbx/sgtbx/symbols.h @@ -0,0 +1,360 @@ +#ifndef CCTBX_SGTBX_SYMBOLS_H +#define CCTBX_SGTBX_SYMBOLS_H + +#include +#include + +namespace cctbx { namespace sgtbx { + + namespace symbols { + namespace tables { + + struct main_symbol_dict_entry + { + int sg_number; + const char* qualifier; + const char* hermann_mauguin; + const char* hall; + }; + + } // namespace tables + } // namespace symbols + + //! class for the handling of space group symbols of various types. + /*! The purpose of this class is to convert several conventional + space group notations to hall() symbols by using lookup tables. + The Hall symbols can then be used to initialize objects + of class SpaceGroup. +

+ Supported space group notations are: +

    +
  • + Space group numbers as defined in the International Tables for + Crystallography Vol. A (1983). Optionally, the space group numbers + can be followed by a colon and one of the following characters: +

    +

      +
    • 1: Origin choice 1, + for space groups with two origin choices +
    • 2: Origin choice 2, + for space groups with two origin choices +
    • H: Hexagonal basis, + for rhombohedral space groups +
    • R: Rhombohedral basis, + for rhombohedral space groups +
    +

    + By default, origin choice 2 or a hexagonal basis is used. +

    + Examples: +

      +
    • 48 +
    • 48:1 +
    • 155 +
    • 48:R +
    +

    +

  • + Hermann-Mauguin symbols as defined in the International Tables + for Crystallography Vol. A (1983). Subscripts are entered without + formatting. Optionally, subscripts can be surrounded by parentheses. + Spaces are not required. Optionally, the Hermann-Mauguin symbols + can be followed by a colon and one of the characters + 1, + 2, + H, and + R + as explained above. +

    + Examples: +

      +
    • P 21 21 21 +
    • R 3:R +
    +

    +

  • + Schoenflies symbols as defined in the International Tables for + Crystallography Vol. A (1983). Superscripts are entered by + prepending the character '^'. + Optionally, the Schoenflies symbols can be followed by a colon + and one of the characters + 1, + 2, + H, and + R + as explained above. +

    + Examples: +

      +
    • D2^4 +
    • D3^7:R +
    +

    +

  • + Hall symbols as defined in the International Tables for + Crystallography Vol. B (2001). + In contrast to Hermann-Mauguin symbols, Hall symbols can + be used to specify any space group representation. + Hall symbols are entered by prepending 'Hall:'. +

    + Examples: +

      +
    • Hall: P 41 +
    • Hall: C 2y (x,y,-x+z) +
    +

    + When Hall symbols are used, all the lookup algorithms provided + by this class are bypassed. This feature is provided for + generality and convenience. Note that number(), + hermann_mauguin() etc. are not defined if a Hall symbol is + used! +

    +

+

+ See also: \ref page_multiple_cell + */ + class space_group_symbols + { + public: + //! Default constructor. Some data members are not initialized! + space_group_symbols() {} + + //! Lookup space group Symbol. + /*! For a general introduction see class details.
+ table_id is one of "" (the empty string), "I1952", + "A1983", or "Hall".
+

+ The default table lookup preferences are described + in the class details section. +

+ I1952 selects the preferences of the + International Tables for Crystallography, Volume I, 1952:
+ monoclinic unique axis c (example: P 2),
+ origin choice 1 (example: P n n n),
+ rhombohedral axes (example: R 3). +

+ A1983 selects the preferences of the + International Tables for Crystallography, Volume A, 1983:
+ monoclinic unique axis b (example: P 2),
+ origin choice 1 (example: P n n n),
+ hexagonal axes (example: R 3). +

+ Hall signals that Symbol is a Hall symbols + without a leading "Hall: ". The table lookup is bypassed. + Note that number(), hermann_mauguin() etc. are not defined + if a Hall symbol is used! + */ + explicit + space_group_symbols( + std::string const& symbol, + std::string const& table_id=""); + + //! Lookup space group number. + /*! For a general introduction see class details.
+ table_id is one of "", "I1952", "A1983", or "Hall". See the + other constructor for details.
+ See also: Extension() + */ + explicit + space_group_symbols( + int space_group_number, + std::string const& extension="", + std::string const& table_id=""); + + //! For internal use only. + space_group_symbols( + const symbols::tables::main_symbol_dict_entry* entry, + char extension); + + //! Tests if the instance is constructed properly. + /*! Shorthand for: number() != 0 +

+ Not available in Python. + */ + bool + is_valid() const { return number_ != 0; } + + //! Space group number according to the International Tables. + /*! A number in the range 1 - 230. This number uniquely defines + the space group type.
+ Note the distinction between "space group type" and space + group representation" (i.e. setting, origin choice, cell + choice, ...). For many of the 230 space group types there + are multiple space group representations listed in the + International Tables. + */ + int + number() const { return number_; } + + //! Schoenflies symbol. + /*! One of the 230 unique Schoenflies symbols defined in the + International Tables. A Schoenflies symbol uniquely defines + the space group type.
+ Note the distinction between "space group type" and space + group representation" (i.e. setting, origin choice, cell + choice, ...). For many of the 230 space group types there + are multiple space group representations listed in the + International Tables. + */ + std::string const& + schoenflies() const { return schoenflies_; } + + //! A qualifier for the classification of alternative representations. + /*! A qualifier for monoclinic and orthorhombic space groups.
+ For monoclinic space groups, the qualifier takes the + form "x" or "xn", where x is one of {a, b, c, -a, -b, -c}, + and n is one of {1, 2, 3}. + The letters define the "unique axis" according to Table 4.3.1 + in the International Tables Volume A (1983), and the numbers + define the "cell choice."
+ For orthorhombic space groups, the qualifier is one of {abc, + ba-c, cab, -cab, bca, a-cb}, according to Table 4.3.1 in the + International Tables Volume A (1983).
+ Note that this qualifier is purely informational and not + actively used in any of the symbol lookup algorithms. + */ + std::string const& + qualifier() const { return qualifier_; } + + //! Hermann-Mauguin symbol as defined in the International Tables. + /*! Hermann-Mauguin (H-M) symbols were originally designed as a + convenient description of given space-group representations. + While it is natural to derive a H-M symbol for a given list + of symmetry operations, it is problematic to derive the + symmetry operations from a H-M symbol. In particular, for + a number of space groups there is an ambiguity in the + selection of the location of the origin with respect to the + symmetry elements. For the conventional space group + representations listed in the International Tables, the + ambiguity in the origin selection is overcome by using an + Extension(). + */ + std::string const& + hermann_mauguin() const { return hermann_mauguin_; } + + //! Extension to the Hermann-Mauguin symbol. + /*! For some space groups, the extension is used to distinguish + between origin choices, or the choice of hexagonal or + rhombohedral axes:
+ Extension "1": Origin choice 1.
+ Extension "2": Origin choice 2.
+ Extension "H": Hexagonal axes.
+ Extension "R": Rhombohedral axes.
+ The extension is '\0' (the null character) otherwise.
+ See also: hermann_mauguin() + */ + char + extension() const { return extension_; } + + //! Change-of-basis symbol part of universal Hermann-Mauguin symbol. + /*! The parentheses are not included. For example, if the universal + Hermann-Mauguin symbol is "P 3 (y,z,x)", the return value + is "y,z,x". + */ + std::string const& + change_of_basis_symbol() { return change_of_basis_symbol_; } + + /*! Hermann-Mauguin symbol with extension and change-of-basis + symbol appended (if any). + */ + /*! If the extension is '\0' (the null character) + and the change-of-basis operator is the identity matrix, + universal_hermann_mauguin() is equivalent to + hermann_mauguin(). +

+ The universal Hermann-Mauguin symbol uniquely identifies a + tabulated space group representation. + */ + std::string const& + universal_hermann_mauguin() const + { + return universal_hermann_mauguin_; + } + + //! Hall symbol. + /*! The space group notation of Hall was designed to be "computer + adapted". Hall symbols have some similarities with + hermann_mauguin() symbols, but define the space group + representation without ambiguities. Another advantage is that + any 3-dimensional crystallographic space group representation + can be described by a Hall symbol.
+ The most common use of Hall symbols in this implementation + is to initialize objects of class SpaceGroup. + */ + std::string const& + hall() const { return hall_; } + + //! Determines the point group type. + /*! The code returned is a matrix group code. There are + exactly 32 possible return values, corresponding to + the 32 crystallographic point group types. +

+ Python: returns a string representing the point group type. + */ + matrix_group::code + point_group_type() const; + + //! Determines the Laue group type. + /*! The code returned is a matrix group code. There are + exactly 11 possible return values, corresponding to + the 11 Laue group types. +

+ Python: returns a string representing the Laue group type. + */ + matrix_group::code + laue_group_type() const + { + return point_group_type().laue_group_type(); + } + + //! Determines the crystal system. + /*! There are exactly 7 possible return values. +

+ Python: returns a string representing the crystal system. + */ + crystal_system::code + crystal_system() const + { + return point_group_type().crystal_system(); + } + + private: + int number_; + std::string schoenflies_; + std::string qualifier_; + std::string hermann_mauguin_; + char extension_; + std::string change_of_basis_symbol_; + std::string universal_hermann_mauguin_; + std::string hall_; + bool + set_all( + const symbols::tables::main_symbol_dict_entry* entry, + char work_extension, + std::string const& std_table_id); + int hall_pass_through(std::string const& symbol); + void clear(); + }; + + //! Iterator for the 530 tabulated space group representations. + class space_group_symbol_iterator + { + public: + //! Initialize the iterator. + space_group_symbol_iterator(); + + //! Get symbols for next space group representation. + /*! result.number() == 0 signals that the end of the internal + table was reached. + */ + space_group_symbols next(); + + private: + const symbols::tables::main_symbol_dict_entry* entry_; + int n_hall_; + int i_hall_; + }; + +}} // namespace cctbx::sgtbx + +#endif // CCTBX_SGTBX_SYMBOLS_H diff --git a/extern/cctbx/include/cctbx/sgtbx/tr_group.h b/extern/cctbx/include/cctbx/sgtbx/tr_group.h new file mode 100644 index 00000000..caf09fcf --- /dev/null +++ b/extern/cctbx/include/cctbx/sgtbx/tr_group.h @@ -0,0 +1,73 @@ +#ifndef CCTBX_SGTBX_TR_GROUP_H +#define CCTBX_SGTBX_TR_GROUP_H + +#include +#include + +namespace cctbx { namespace sgtbx { + + class tr_group + { + friend class space_group; + + public: + explicit + tr_group(int t_den=sg_t_den) + { + elems_.push_back(tr_vec(t_den)); + } + + void reset(int t_den=sg_t_den) + { + elems_.clear(); + elems_.push_back(tr_vec(t_den)); + } + + std::size_t size() const { return elems_.size(); } + + std::vector const& elems() const { return elems_; } + + std::vector& elems() { return elems_; } + + tr_vec const& operator[](std::size_t i) const { return elems_[i]; } + + tr_vec& operator[](std::size_t i) { return elems_[i]; } + + int t_den() const { return elems_[0].den(); } + + bool + contains(tr_vec const& t) const; + + bool operator==(tr_group const& rhs) + { + return this->elems_ == rhs.elems_; + } + + bool operator!=(tr_group const& rhs) + { + return !((*this) == rhs); + } + + bool expand(tr_vec const& new_t); + + tr_group change_basis(change_of_basis_op const& cb_op) const; + + char conventional_centring_type_symbol() const; + + change_of_basis_op + conventional_z2p_op(int r_den=cb_r_den, int t_den=cb_t_den) const; + + tr_vec tidy(tr_vec const& t) const; + + void + find_best_equiv_in_place( + vec3_rat& t) const; + + private: + std::vector elems_; + bool add(tr_vec const& new_t); + }; + +}} // namespace cctbx::sgtbx + +#endif // CCTBX_SGTBX_TR_GROUP_H diff --git a/extern/cctbx/include/cctbx/sgtbx/tr_vec.h b/extern/cctbx/include/cctbx/sgtbx/tr_vec.h new file mode 100644 index 00000000..e24d64cc --- /dev/null +++ b/extern/cctbx/include/cctbx/sgtbx/tr_vec.h @@ -0,0 +1,235 @@ +#ifndef CCTBX_SGTBX_TR_VEC_H +#define CCTBX_SGTBX_TR_VEC_H + +#include +#include +#include +#include +#include + +namespace cctbx { namespace sgtbx { + + void throw_unsuitable_tr_vec(const char* file, long line); + + //! Translation vector. + /*! The elements of the vector are stored as integers and a common + denominator. The actual value of an element is obtained by + dividing the integer number by the denominator. + */ + class tr_vec + { + public: + /*! \brief Initialization of a 0,0,0-translation with the denominator + tr_den. + */ + explicit + tr_vec(int tr_den=sg_t_den) + : + num_(0,0,0), den_(tr_den) + {} + + /*! \brief Initialization a translation with the integer numerator v + and the denominator tr_den. + */ + explicit + tr_vec(sg_vec3 const& v, int tr_den=sg_t_den) + : + num_(v), den_(tr_den) + {} + + /*! \brief Initialization of a v0,v1,v2-translation with the + denominator tr_den. + */ + tr_vec(int v0, int v1, int v2, int tr_den=sg_t_den) + : + num_(v0,v1,v2), den_(tr_den) + {} + + //! Numerator of the translation vector. + sg_vec3 const& + num() const { return num_; } + //! Numerator of the translation vector. + sg_vec3& + num() { return num_; } + + //! i'th element of the numerator of the translation vector. + int const& + operator[](std::size_t i) const { return num_[i]; } + //! i'th element of the numerator of the translation vector. + int& + operator[](std::size_t i) { return num_[i]; } + + //! Denominator of the translation vector. + int const& + den() const { return den_; } + //! Denominator of the translation vector. + int& + den() { return den_; } + + //! True only if both the numerators and the denominators are equal. + bool + operator==(tr_vec const& rhs) const + { + if (den_ != rhs.den_) return false; + return num_.const_ref().all_eq(rhs.num_.const_ref()); + } + + //! False only if both the numerators and the denominators are equal. + bool + operator!=(tr_vec const& rhs) const + { + return !((*this) == rhs); + } + + //! True only if den() != 0. + bool + is_valid() const { return den_ != 0; } + + //! True only if all elements of the numertor are equal to zero. + bool + is_zero() const { return num_.is_zero(); } + + //! New translation vector with denominator new_den. + /*! An exception is thrown if the old translation vector + cannot be represented using the new denominator. + */ + tr_vec + new_denominator(int new_den) const; + + //! New translation vector with num()*factor and den()*factor. + tr_vec + scale(int factor) const + { + if (factor == 1) return *this; + return tr_vec(num_ * factor, den_ * factor); + } + + //! New translation vector with 0 <= num()[i] < den(). + tr_vec + mod_positive() const + { + tr_vec result(num_, den_); + for(std::size_t i=0;i<3;i++) { + result.num_[i] = scitbx::math::mod_positive(result.num_[i], den_); + } + return result; + } + + //! New translation vector with -den()/2 < num()[i] <= den()/2. + tr_vec + mod_short() const + { + tr_vec result(num_, den_); + for(std::size_t i=0;i<3;i++) { + result.num_[i] = scitbx::math::mod_short(result.num_[i], den_); + } + return result; + } + + //! New translation vector with -num(), den(). + tr_vec + operator-() const { return tr_vec(-num_, den_); } + + //! Addition of numerators. + /*! An exception is thrown if the denominators are not equal. + */ + friend tr_vec + operator+(tr_vec const& lhs, tr_vec const& rhs) + { + CCTBX_ASSERT(lhs.den_ == rhs.den_); + return tr_vec(lhs.num_ + rhs.num_, lhs.den_); + } + + //! Subtraction of numerators. + /*! An exception is thrown if the denominators are not equal. + */ + friend tr_vec + operator-(tr_vec const& lhs, tr_vec const& rhs) + { + CCTBX_ASSERT(lhs.den_ == rhs.den_); + return tr_vec(lhs.num_ - rhs.num_, lhs.den_); + } + + //! In-place addition of numerators. + /*! An exception is thrown if the denominators are not equal. + */ + tr_vec& + operator+=(tr_vec const& rhs) + { + CCTBX_ASSERT(den_ == rhs.den_); + num_ += rhs.num_; + return *this; + } + + //! New translation vector with num() * rhs, den(). + friend tr_vec + operator*(tr_vec const& lhs, int rhs) + { + return tr_vec(lhs.num_ * rhs, lhs.den_); + } + + //! New translation vector with num() / rhs, den(). + /*! An exception is thrown if the result cannot be represented + using den(). + */ + friend tr_vec + operator/(tr_vec const& lhs, int rhs); + + //! New translation vector with rhs.num() * lhs, rhs.den(). + friend tr_vec + operator*(int const& lhs, tr_vec const& rhs) + { + return rhs * lhs; + } + + //! Cancellation of factors. + /*! The denominator of the new translation vector is made + as small as possible. + */ + tr_vec cancel() const; + + //! Addition with cancellation of factors. + tr_vec + plus(tr_vec const& rhs) const; + + //! Subtraction with cancellation of factors. + tr_vec + minus(tr_vec const& rhs) const; + + //! Conversion to a floating-point array. + template + scitbx::vec3 + as_floating_point(scitbx::type_holder) const + { + return scitbx::vec3(num_) / FloatType(den_); + } + + //! Conversion to an array with element type double. + scitbx::vec3 + as_double() const + { + return as_floating_point(scitbx::type_holder()); + } + + //! Conversion to a string with rational or decimal numbers. + /*! Python: str() + */ + std::string + as_string(bool decimal=false, const char* separator=",") const; + + private: + sg_vec3 num_; + int den_; + }; + + //! Constructor for initialization of constants. + struct tr_vec_12 : tr_vec + { + tr_vec_12(int v0, int v1, int v2) + : tr_vec(tr_vec(v0,v1,v2) * (sg_t_den / 12)) + {} + }; + +}} // namespace cctbx::sgtbx + +#endif // CCTBX_SGTBX_TR_VEC_H diff --git a/extern/cctbx/include/cctbx/sgtbx/utils.h b/extern/cctbx/include/cctbx/sgtbx/utils.h new file mode 100644 index 00000000..da848bbc --- /dev/null +++ b/extern/cctbx/include/cctbx/sgtbx/utils.h @@ -0,0 +1,23 @@ +#ifndef CCTBX_SGTBX_UTILS_H +#define CCTBX_SGTBX_UTILS_H + +namespace cctbx { namespace sgtbx { namespace utils { + + int change_denominator( + const int *old_num, int old_den, + int *new_num, int new_den, int n); + + class cmp_i_vec + { + public: + cmp_i_vec(std::size_t n) : n_(n) {} + + bool operator()(const int *a, const int *b) const; + + private: + std::size_t n_; + }; + +}}} // namespace cctbx::sgtbx + +#endif // CCTBX_SGTBX_UTILS_H diff --git a/extern/cctbx/include/cctbx/uctbx.h b/extern/cctbx/include/cctbx/uctbx.h new file mode 100644 index 00000000..9110891d --- /dev/null +++ b/extern/cctbx/include/cctbx/uctbx.h @@ -0,0 +1,1240 @@ +#ifndef CCTBX_UCTBX_H +#define CCTBX_UCTBX_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace cctbx { + + // forward declaration + namespace sgtbx + { + class rot_mx; + class change_of_basis_op; + } + + //! Shorthand for default vec3 type in unit cell toolbox. + typedef scitbx::vec3 uc_vec3; + //! Shorthand for default mat3 type in unit cell toolbox. + typedef scitbx::mat3 uc_mat3; + //! Shorthand for default sym_mat3 type in unit cell toolbox. + typedef scitbx::sym_mat3 uc_sym_mat3; + + //! Unit Cell Toolbox namespace. + namespace uctbx { + + //! Conversion of d-spacing measures. + inline double d_star_sq_as_stol_sq(double d_star_sq) + { + return d_star_sq * .25; + } + + //! Conversion of d-spacing measures. + inline af::shared + d_star_sq_as_stol_sq(af::const_ref const &d_star_sq) + { + af::shared result( + d_star_sq.size(), af::init_functor_null()); + for(std::size_t i=0;i + d_star_sq_as_two_stol(af::const_ref const &d_star_sq) + { + af::shared result( + d_star_sq.size(), af::init_functor_null()); + for(std::size_t i=0;i + d_star_sq_as_stol(af::const_ref const &d_star_sq) + { + af::shared result( + d_star_sq.size(), af::init_functor_null()); + for(std::size_t i=0;i + d_star_sq_as_d(af::const_ref const &d_star_sq) + { + af::shared result( + d_star_sq.size(), af::init_functor_null()); + for(std::size_t i=0;i d_star_sq_as_two_theta( + af::const_ref const &d_star_sq, double wavelength, bool deg=false) + { + af::shared result( + d_star_sq.size(), af::init_functor_null()); + for(std::size_t i=0;i + stol_sq_as_d_star_sq(af::const_ref const &stol_sq) + { + af::shared result( + stol_sq.size(), af::init_functor_null()); + for(std::size_t i=0;i + two_stol_as_d_star_sq(af::const_ref const &two_stol) + { + af::shared result( + two_stol.size(), af::init_functor_null()); + for(std::size_t i=0;i + stol_as_d_star_sq(af::const_ref const &stol) + { + af::shared result( + stol.size(), af::init_functor_null()); + for(std::size_t i=0;i + d_as_d_star_sq(af::const_ref const &d) + { + af::shared result( + d.size(), af::init_functor_null()); + for(std::size_t i=0;i two_theta_as_d_star_sq( + af::const_ref const &two_theta, double wavelength, bool deg=false) + { + af::shared result( + two_theta.size(), af::init_functor_null()); + for(std::size_t i=0;i two_theta_as_d( + af::const_ref const &two_theta, double wavelength, bool deg=false) + { + af::shared result( + two_theta.size(), af::init_functor_null()); + for(std::size_t i=0;i + FloatType + mean_square_difference( + scitbx::mat3 const& a, + scitbx::mat3 const& b) + { + FloatType result = 0; + for(std::size_t i=0;i<9;i++) { + result += scitbx::fn::pow2(a[i] - b[i]); + } + return result; + } + + //! Foadi, J., Evans, G. (2011). Acta Cryst. A67, 93-95. + bool + unit_cell_angles_are_feasible( + scitbx::vec3 const& values_deg, + double tolerance=1e-6); + + //! Class for the handling of unit cell information. + /*! All angles are in degrees. +

+ The PDB convention for orthogonalization and fractionalization + of coordinates is used: +

+      Crystallographic Basis: D = {a,b,c}
+      Cartesian Basis:        C = {i,j,k}
+      i || a
+      j is in (a,b) plane
+      k = i x j
+      
+ */ + class unit_cell + { + public: + //! Default constructor. Some data members are not initialized! + /*! volume() of default constructed instances == 0. + This may be used to test if a unit_cell instance is valid. +

+ Not available in Python. + */ + unit_cell() : volume_(0) {} + + //! Constructor using parameters (a, b, c, alpha, beta, gamma). + /*! Missing lengths are set to 1, missing angles to 90. +

+ See also: paramters() + */ + explicit + unit_cell(af::small const& parameters); + + //! Constructor using parameters (a, b, c, alpha, beta, gamma). + /*! See also: paramters() + */ + explicit + unit_cell(af::double6 const& parameters); + + //! Constructor using parameters derived from a metrical matrix. + /*! The metrical matrix is defined as: +

+         ( a*a,            a*b*cos(gamma), a*c*cos(beta)  )
+         ( a*b*cos(gamma), b*b,            b*c*cos(alpha) )
+         ( a*c*cos(beta),  b*c*cos(alpha), c*c            )
+         
+ See also: metrical_matrix() + */ + explicit + unit_cell(uc_sym_mat3 const& metrical_matrix); + + //! Constructor using an orthogonalization matrix. + /*! See also: orthogonalization_matrix() + */ + explicit + unit_cell(uc_mat3 const& orthogonalization_matrix); + + //! Access to parameters. + af::double6 const& + parameters() const { return params_; } + + //! Access to reciprocal cell parameters. + af::double6 const& + reciprocal_parameters() const { return r_params_; } + + //! Access to metrical matrix. + uc_sym_mat3 const& + metrical_matrix() const { return metr_mx_; } + + //! Access to reciprocal cell metrical matrix. + uc_sym_mat3 const& + reciprocal_metrical_matrix() const { return r_metr_mx_; } + + //! Volume of the unit cell. + double + volume() const { return volume_; } + + af::double6 const& + d_volume_d_params() const { return d_volume_d_params_; } + + //! Corresponding reciprocal cell. + unit_cell + reciprocal() const; + + //! Length^2 of the longest lattice vector in the unit cell. + double + longest_vector_sq() const; + + //! Length^2 of the shortest lattice translation vector. + /*! The fast_minimum_reduction is used to determine the shortest + vector. + */ + double + shortest_vector_sq() const; + + //! Simple test for degenerated unit cell parameters. + bool + is_degenerate(double min_min_length_over_max_length=1.e-10, + double min_volume_over_min_length=1.e-5); + + //! Comparison of unit cell parameters. + bool + is_similar_to(unit_cell const& other, + double relative_length_tolerance=0.01, + double absolute_angle_tolerance=1., + double absolute_length_tolerance=-9999.) const; + + //! Array of c_inv_r matrices compatible with change_basis. + af::shared > + similarity_transformations( + unit_cell const& other, + double relative_length_tolerance=0.02, + double absolute_angle_tolerance=2., + int unimodular_generator_range=1) const; + + //! Matrix for the conversion of cartesian to fractional coordinates. + /*! x(fractional) = matrix * x(cartesian). */ + uc_mat3 const& fractionalization_matrix() const { return frac_; } + + //! Matrix for the conversion of fractional to cartesian coordinates. + /*! x(cartesian) = matrix * x(fractional). */ + uc_mat3 const& orthogonalization_matrix() const { return orth_; } + + //! Matrix for the conversion of grid indices to cartesian coordinates. + /*! x(cartesian) = matrix * grid_index. */ + template + uc_mat3 + grid_index_as_site_cart_matrix( + scitbx::vec3 const& gridding) const + { + uc_mat3 result = orth_; + for(unsigned i=0;i<3;i++) { + CCTBX_ASSERT(gridding[i] > 0); + double f = 1. / boost::numeric_cast(gridding[i]); + for(unsigned j=0;j<9;j+=3) result[i+j] *= f; + } + return result; + } + + //! Conversion of cartesian coordinates to fractional coordinates. + template + scitbx::vec3 + fractionalize(scitbx::vec3 const& site_cart) const + { + // take advantage of the fact that frac_ is upper-triangular. + return fractional( + frac_[0] * site_cart[0] + + frac_[1] * site_cart[1] + + frac_[2] * site_cart[2], + frac_[4] * site_cart[1] + + frac_[5] * site_cart[2], + frac_[8] * site_cart[2]); + } + + //! Conversion of fractional coordinates to cartesian coordinates. + template + scitbx::vec3 + orthogonalize(scitbx::vec3 const& site_frac) const + { + // take advantage of the fact that orth_ is upper-triangular. + return cartesian( + orth_[0] * site_frac[0] + + orth_[1] * site_frac[1] + + orth_[2] * site_frac[2], + orth_[4] * site_frac[1] + + orth_[5] * site_frac[2], + orth_[8] * site_frac[2]); + } + + //! Conversion of cartesian coordinates to fractional coordinates. + template + af::shared > + fractionalize( + af::const_ref > const& sites_cart) const + { + af::shared > result( + sites_cart.size(), + af::init_functor_null >()); + const scitbx::vec3* si = sites_cart.begin(); + scitbx::vec3* ri = result.begin(); + for(std::size_t i=0;i + af::shared > + orthogonalize( + af::const_ref > const& sites_frac) const + { + af::shared > result( + sites_frac.size(), + af::init_functor_null >()); + const scitbx::vec3* si = sites_frac.begin(); + scitbx::vec3* ri = result.begin(); + for(std::size_t i=0;i + scitbx::vec3 + v_times_fractionalization_matrix_transpose( + scitbx::vec3 const& v) const + { + // take advantage of the fact that frac_ is upper-triangular. + return fractional( + frac_[0] * v[0], + frac_[1] * v[0] + + frac_[4] * v[1], + frac_[2] * v[0] + + frac_[5] * v[1] + + frac_[8] * v[2]); + } + + // ! gradient wrt Cartesian coordinates from gradient wrt fractional ones + /*! The formula is \f$\nabla_{x_c} = F^T \nabla_{x_f}\f$ where \f$F\f$ is + the fractionalisation matrix + This is syntactic sugar for the long winded and cryptic + v_times_fractionalization_matrix_transpose. + */ + template + scitbx::vec3 + orthogonalize_gradient (scitbx::vec3 const& v) const + { + return v_times_fractionalization_matrix_transpose(v); + } + + // ! gradient wrt fractional coordinates from gradient wrt Cartesian ones + /*! The formula is \f$\nabla_{x_f} = O^T \nabla_{x_c}\f$ where \f$O\f$ is + the orthogonalisation matrix + */ + template + scitbx::vec3 + fractionalize_gradient (const scitbx::vec3& g) const + { + const uc_mat3& O = orth_; + return fractional(O[0]*g[0], + O[1]*g[0] + O[4]*g[1], + O[2]*g[0] + O[5]*g[1] + O[8]*g[2]); + } + + /// The linear form transforming ADP u* into u_iso + /** If + U = { {u_0, u_3, u_4}, {u_3, u_1, u_5}, {u_4, u_5, u_2} } + + is the layout of u* as per scitbx::sym_mat3 and + + O ={ {o_0, o_1, o_2}, {0, o_4, o_5}, {0, 0, o_8} } + + is the layout of the orthogonalisation matrix as per scitbx::mat3, + + u_iso = 1/3 Tr( O U O^T ) + + = o_0^2 u_0 + (o_1^2 + o_4^2) u_1 + (o_2^2 + o_5^2 + o_8^2) u_2 + + 2 o_0 o_1 u_3 + 2 o_0 o_2 u_4 + 2 (o_1 o_2 + o_4 o_5) u_5 + */ + af::double6 const &u_star_to_u_iso_linear_form() const { + return u_star_to_u_iso_linear_form_; + } + + /// The linear map transforming ADP u* into u_cart + /** If + U = { {u_0, u_3, u_4}, {u_3, u_1, u_5}, {u_4, u_5, u_2} } + + is the layout of u* as per scitbx::sym_mat3 and + + O ={ {o_0, o_1, o_2}, {0, o_4, o_5}, {0, 0, o_8} } + + + is the layout of the orthogonalisation matrix as per scitbx::mat3, + + u_cart = ( O u* O^T ) + + can be alternatively be written as + + u_cart = L u*, where + + L ={ {o_0^2, o_1^2, o_2^2, 2 o_0 o_1, 2 o_0 o_2, 2 o_1 o_2}, + {0, o_4^2, o_5^2, 0, 0, 2 o_4 o_5, + {0, 0, o_8^2, 0, 0, 0}, + {0, o_1 o_4, o_2 o_5, o_0 o_4, o_0 o_5, o_2 o_4+o_1 o_5}, + {0, 0, o_2 o_8, 0, o_0 o_8, o_1 o_8}, + {0, 0, o_5 o_8, 0, 0, o_4 o_8} + } + */ + af::const_ref + u_star_to_u_cart_linear_map() const { + return + af::tiny_mat_const_ref(u_star_to_u_cart_linear_map_); + } + + /// The linear map transforming ADP u* into u_cif + af::double6 const &u_star_to_u_cif_linear_map() const { + return u_star_to_u_cif_linear_map_; + } + + //! The gradient of the elements of the metrical matrix wrt the unit cell params + af::const_ref + d_metrical_matrix_d_params() const { + return + af::tiny_mat_const_ref(d_metrical_matrix_d_params_); + } + //! Length^2 of a vector of fractional coordinates. + /*! Not available in Python. + */ + template + FloatType + length_sq(fractional const& site_frac) const + { + return orthogonalize(site_frac).length_sq(); + } + + //! Length of a vector of fractional coordinates. + template + FloatType + length(fractional const& site_frac) const + { + return std::sqrt(length_sq(site_frac)); + } + + //! Distance^2 between two vectors of fractional coordinates. + /*! Not available in Python. + */ + template + FloatType + distance_sq(fractional const& site_frac_1, + fractional const& site_frac_2) const + { + return length_sq(fractional(site_frac_1 - site_frac_2)); + } + + //! Distance between two vectors of fractional coordinates. + template + FloatType + distance(fractional const& site_frac_1, + fractional const& site_frac_2) const + { + return length(fractional(site_frac_1 - site_frac_2)); + } + + //! Angle in degrees formed by sites 1, 2 and 3 for fractional coordinates. + template + boost::optional + angle(fractional const& site_frac_1, + fractional const& site_frac_2, + fractional const& site_frac_3) const + { + cartesian vec_12 = orthogonalize(site_frac_1 - site_frac_2); + cartesian vec_32 = orthogonalize(site_frac_3 - site_frac_2); + FloatType length_12 = vec_12.length(); + FloatType length_32 = vec_32.length(); + if (length_12 == 0 || length_32 == 0) { + return boost::optional(); + } + const FloatType cos_angle = std::max(-1.,std::min(1., + (vec_12 * vec_32)/(length_12 * length_32))); + return boost::optional( + std::acos(cos_angle) / scitbx::constants::pi_180); + } + + //! Dihedral angle in degrees formed by sites 1, 2, 3 and 4 for fractional coordinates. + /*! angle = acos[(u x v).(v x w)/(|u x v||v x w|)] + The sign of the angle is the sign of (u x v).w + */ + template + boost::optional + dihedral(fractional const& site_frac_1, + fractional const& site_frac_2, + fractional const& site_frac_3, + fractional const& site_frac_4) const + { + cartesian u = orthogonalize(site_frac_1 - site_frac_2); + cartesian v = orthogonalize(site_frac_3 - site_frac_2); + cartesian w = orthogonalize(site_frac_3 - site_frac_4); + cartesian u_cross_v = u.cross(v); + cartesian v_cross_w = v.cross(w); + FloatType norm_u_cross_v = u_cross_v.length_sq(); + if (norm_u_cross_v == 0) return boost::optional(); + FloatType norm_v_cross_w = v_cross_w.length_sq(); + if (norm_v_cross_w == 0) return boost::optional(); + FloatType cos_angle = std::max(-1.,std::min(1., + u_cross_v * v_cross_w / std::sqrt(norm_u_cross_v * norm_v_cross_w))); + FloatType angle = std::acos(cos_angle) / scitbx::constants::pi_180; + if (u_cross_v * w < 0) { + angle *= -1; + } + return boost::optional(angle); + } + + /*! \brief Shortest length^2 of a vector of fractional coordinates + under application of periodicity. */ + /*! Not available in Python. + */ + template + FloatType + mod_short_length_sq(fractional const& site_frac) const + { + return length_sq(site_frac.mod_short()); + } + + /*! \brief Shortest length of a vector of fractional coordinates + under application of periodicity. */ + template + FloatType + mod_short_length(fractional const& site_frac) const + { + return std::sqrt(mod_short_length_sq(site_frac)); + } + + /*! \brief Shortest distance^2 between two vectors of fractional + coordinates under application of periodicity. */ + /*! Not available in Python. + */ + template + FloatType + mod_short_distance_sq(fractional const& site_frac_1, + fractional const& site_frac_2) const + { + return mod_short_length_sq( + fractional(site_frac_1 - site_frac_2)); + } + + /*! \brief Shortest distance between two vectors of fractional + coordinates under application of periodicity. */ + template + FloatType + mod_short_distance(fractional const& site_frac_1, + fractional const& site_frac_2) const + { + return std::sqrt(mod_short_distance_sq(site_frac_1, site_frac_2)); + } + + /*! \brief Shortest distance^2 between all sites in site_frac_1 + and site_frac_2 under application of periodicity. + */ + /*! Not available in Python. + */ + template + FloatType + min_mod_short_distance_sq( + af::const_ref > const& sites_frac_1, + fractional const& site_frac_2) const + { + FloatType + result = mod_short_distance_sq( + fractional(sites_frac_1[0]), site_frac_2); + for(std::size_t i=1;i(sites_frac_1[i]), site_frac_2)); + } + return result; + } + + /*! \brief Shortest distance between all sites in sites_frac_1 + and site_frac_2 under application of periodicity. + */ + template + FloatType + min_mod_short_distance( + af::const_ref > const& sites_frac_1, + fractional const& site_frac_2) const + { + return std::sqrt(min_mod_short_distance_sq(sites_frac_1, site_frac_2)); + } + + //! Conversion of fractional-space rotation matrix to Cartesian space. + /*! orthogonalization_matrix() * rot_mx * fractionalization_matrix() + */ + uc_mat3 + matrix_cart( + sgtbx::rot_mx const& rot_mx) const; + + //! Transformation (change-of-basis) of unit cell parameters. + /*! c_inv_r is the inverse of the 3x3 change-of-basis matrix + that transforms coordinates in the old basis system to + coodinates in the new basis system. + */ + unit_cell + change_basis(uc_mat3 const& c_inv_r, double r_den=1.) const; + + //! Transformation (change-of-basis) of unit cell parameters. + /*! r is the inverse of the 3x3 change-of-basis matrix + that transforms coordinates in the old basis system to + coodinates in the new basis system. +

+ Not available in Python. + */ + unit_cell + change_basis(sgtbx::rot_mx const& c_inv_r) const; + + //! Transformation (change-of-basis) of unit cell parameters. + unit_cell + change_basis(sgtbx::change_of_basis_op const& cb_op) const; + + /*! \brief Computation of the maximum Miller indices for a given + minimum d-spacing. + */ + /*! d_min is the minimum d-spacing. tolerance compensates for + rounding errors. + */ + miller::index<> + max_miller_indices(double d_min, double tolerance=1.e-4) const; + + //! d-spacing measure d_star_sq = 1/d^2 = (2*sin(theta)/lambda)^2. + template + double + d_star_sq(miller::index const& miller_index) const + { + return + (miller_index[0] * miller_index[0]) * r_metr_mx_[0] + + (miller_index[1] * miller_index[1]) * r_metr_mx_[1] + + (miller_index[2] * miller_index[2]) * r_metr_mx_[2] + + (2 * miller_index[0] * miller_index[1]) * r_metr_mx_[3] + + (2 * miller_index[0] * miller_index[2]) * r_metr_mx_[4] + + (2 * miller_index[1] * miller_index[2]) * r_metr_mx_[5]; + } + + //! d-spacing measure d_star_sq = 1/d^2 = (2*sin(theta)/lambda)^2. + template + af::shared + d_star_sq( + af::const_ref > const& miller_indices) const + { + af::shared result( + miller_indices.size(), af::init_functor_null()); + for(std::size_t i=0;i + double + max_d_star_sq( + af::const_ref > const& miller_indices) const + { + double result = 0; + for(std::size_t i=0;i + af::double2 + min_max_d_star_sq( + af::const_ref > const& miller_indices) const + { + af::double2 result(0, 0); + if (miller_indices.size()) { + result.fill(d_star_sq(miller_indices[0])); + for(std::size_t i=1;i + double + stol_sq(miller::index const& miller_index) const + { + return d_star_sq_as_stol_sq(d_star_sq(miller_index)); + } + + //! d-spacing measure (sin(theta)/lambda)^2 = d_star_sq/4. + template + af::shared + stol_sq( + af::const_ref > const& miller_indices) const + { + af::shared result( + miller_indices.size(), af::init_functor_null()); + for(std::size_t i=0;i + double + two_stol(miller::index const& miller_index) const + { + return d_star_sq_as_two_stol(d_star_sq(miller_index)); + } + + //! d-spacing measure 2*sin(theta)/lambda = 1/d = sqrt(d_star_sq). + template + af::shared + two_stol( + af::const_ref > const& miller_indices) const + { + af::shared result( + miller_indices.size(), af::init_functor_null()); + for(std::size_t i=0;i + double + stol(miller::index const& miller_index) const + { + return d_star_sq_as_stol(d_star_sq(miller_index)); + } + + //! d-spacing measure sin(theta)/lambda = 1/(2*d) = sqrt(d_star_sq)/2. + template + af::shared + stol(af::const_ref > const& miller_indices) const + { + af::shared result( + miller_indices.size(), af::init_functor_null()); + for(std::size_t i=0;i + double + d(miller::index const& miller_index) const + { + return d_star_sq_as_d(d_star_sq(miller_index)); + } + + //! d-spacing measure d = 1/(2*sin(theta)/lambda). + template + double + d_frac(scitbx::vec3 const& miller_index) const + { + return d_star_sq_as_d(d_star_sq(miller::index(miller_index))); + } + + //! d-spacing measure d = 1/(2*sin(theta)/lambda). + template + af::shared + d(af::const_ref > const& miller_indices) const + { + af::shared result( + miller_indices.size(), af::init_functor_null()); + for(std::size_t i=0;i + double + two_theta( + miller::index const& miller_index, + double wavelength, + bool deg=false) const + { + return d_star_sq_as_two_theta( + d_star_sq(miller_index), wavelength, deg); + } + + //! Diffraction angle 2-theta, given wavelength. + template + af::shared + two_theta( + af::const_ref > const& miller_indices, + double wavelength, + bool deg=false) const + { + af::shared result( + miller_indices.size(), af::init_functor_null()); + for(std::size_t i=0;i + double + sin_sq_two_theta( + miller::index const& miller_index, + double wavelength) const + { + const double x = d_star_sq_as_stol_sq(d_star_sq(miller_index)) * + std::pow(wavelength, 2.0); + return std::max(0.0, 4*x*(1-x)); + } + + //! Squared sine of the diffraction angle 2-theta, given wavelength. + template + af::shared + sin_sq_two_theta( + af::const_ref > const& miller_indices, + double wavelength) const + { + af::shared result( + miller_indices.size(), af::init_functor_null()); + for(std::size_t i=0;i + double + sin_two_theta( + miller::index const& miller_index, + double wavelength) const + { + const double x = d_star_sq_as_stol_sq(d_star_sq(miller_index)) * + std::pow(wavelength, 2.0); + return 2*std::sqrt(std::max(0.0, x*(1-x))); + } + + //! Sine of the diffraction angle 2-theta, given wavelength. + template + af::shared + sin_two_theta( + af::const_ref > const& miller_indices, + double wavelength) const + { + af::shared result( + miller_indices.size(), af::init_functor_null()); + for(std::size_t i=0;i + scitbx::vec3 + reciprocal_space_vector( + miller::index const& miller_index) const + { + uc_mat3 const& frac_mat = fractionalization_matrix(); + scitbx::vec3 rcv = miller_index * frac_mat; + return rcv; + } + + template + af::shared > + reciprocal_space_vector( + af::const_ref > const& miller_indices) const + { + af::shared > result( + miller_indices.size(), + af::init_functor_null >()); + for (std::size_t i = 0; i < miller_indices.size(); i++) { + result[i] = reciprocal_space_vector(miller_indices[i]); + } + return result; + } + + //! Simple measure for the similarity of two unit cells. + /*! The result is the mean of the squared differences between + basis vectors. The basis vectors are defined by the columns + of this->orthogonalization_matrix() and + other.orthogonalization_matrix(). + */ + double + bases_mean_square_difference(unit_cell const& other) const + { + return mean_square_difference(orth_, other.orth_) / 3; + } + + /*! \brief Sort order for alternative settings of otherwise + identical orthorhombic cells. + */ + /*! The cell with the smaller a-parameter is preferred. + If the a-parameters are equal, the cell with the + smaller b-parameter is preferred. + If the a-parameters and b-parameters are equal, the cell + with the smaller c-parameter is preferred. + + The return value is -1 if this is the preferred cell, + 1 if other is the preferred cell, and 0 otherwise. + + The result is meaningless if the two unit cells are + not alternative settings; i.e. the two cells must be + related to each other by a transformation matrix + with determinant 1. + */ + int + compare_orthorhombic( + const unit_cell& other) const; + + /*! \brief Sort order for alternative settings of otherwise + identical monoclinic cells. + */ + /*! unique_axis must be one of: + 0 for a-unique, + 1 for b-unique, + 2 for c-unique. + + If the absolute value of the difference between the + monoclinic angels is less than angular_tolerance + compare_orthorhombic() is used to determine the return value + (-1, 1, or 0). Otherwise the return value is determined + by evaluating the monoclinic angels. For exact details + refer to the source code of the implementation + ($CCTBX_DIST/cctbx/uctbx/uctbx.cpp). + + The result is meaningless if the two unit cells are + not alternative settings; i.e. the two cells must be + related to each other by a transformation matrix + with determinant 1. + */ + int + compare_monoclinic( + const unit_cell& other, + unsigned unique_axis, + double angular_tolerance) const; + + sgtbx::change_of_basis_op const& + change_of_basis_op_for_best_monoclinic_beta() const; + + protected: + void init_volume(); + void init_reciprocal(); + void init_metrical_matrices(); + void init_orth_and_frac_matrices(); + void init_tensor_rank_2_orth_and_frac_linear_maps(); + void initialize(); + + af::double6 params_; + af::double3 sin_ang_; + af::double3 cos_ang_; + double volume_; + af::double6 d_volume_d_params_; + uc_sym_mat3 metr_mx_; + af::double6 r_params_; + af::double3 r_sin_ang_; + af::double3 r_cos_ang_; + uc_sym_mat3 r_metr_mx_; + uc_mat3 frac_; + uc_mat3 orth_; + af::double6 u_star_to_u_iso_linear_form_; + af::double6 u_star_to_u_cif_linear_map_; + double u_star_to_u_cart_linear_map_[6*6]; + double d_metrical_matrix_d_params_[6*6]; + + mutable double longest_vector_sq_; + mutable double shortest_vector_sq_; + + // used by reciprocal() + unit_cell( + af::double6 const& params, + af::double3 const& sin_ang, + af::double3 const& cos_ang, + double volume, + uc_sym_mat3 const& metr_mx, + af::double6 const& r_params, + af::double3 const& r_sin_ang, + af::double3 const& r_cos_ang, + uc_sym_mat3 const& r_metr_mx); + }; + + /*! \brief Helper class for optimizing d_star_sq computations in + loops over a grid of Miller indices. + */ + template + class incremental_d_star_sq + { + public: + //! Default contructor. Some data members are not initialized! + incremental_d_star_sq() {} + + //! Initialization from unit_cell object. + /*! This copies the elements of the metrical matrix. + */ + incremental_d_star_sq(unit_cell const& ucell) + { + initialize(ucell.reciprocal_metrical_matrix()); + } + + //! Stores h0 and performs computations that only involve h0. + void update0(int h0) + { + h0_ = h0; + im0_ = (h0_ * h0_) * r_g00_; + } + + //! Stores h1 and performs computations that only involve h0 and h1. + void update1(int h1) + { + h1_ = h1; + im1_ = im0_ + (h1_ * h1_) * r_g11_ + + (2 * h0_ * h1_) * r_g01_; + } + + //! Returns d_star_sq using (h0,h1,h2). + FloatType get(int h2) + { + return im1_ + (h2 * h2) * r_g22_ + + (2 * h0_ * h2) * r_g02_ + + (2 * h1_ * h2) * r_g12_; + } + + protected: + FloatType r_g00_, r_g11_, r_g22_, r_g01_, r_g02_, r_g12_; + int h0_, h1_; + FloatType im0_, im1_; + + void initialize(uc_sym_mat3 const& r_g) + { + r_g00_ = r_g[0]; + r_g11_ = r_g[1]; + r_g22_ = r_g[2]; + r_g01_ = r_g[3]; + r_g02_ = r_g[4]; + r_g12_ = r_g[5]; + } + }; + + struct distance_mod_1 + { + fractional<> diff_raw; + fractional<> diff_mod; + double dist_sq; + + distance_mod_1() {} + + distance_mod_1( + uctbx::unit_cell const& unit_cell, + fractional<> const& site_frac_1, + fractional<> const& site_frac_2) + : + diff_raw(site_frac_1 - site_frac_2), + diff_mod(diff_raw.mod_short()), + dist_sq(unit_cell.length_sq(diff_mod)) + {} + + scitbx::vec3 + unit_shifts() const + { + return fractional<>(diff_mod - diff_raw).unit_shifts(); + } + }; + +}} // namespace cctbx::uctbx + +#endif // CCTBX_UCTBX_H diff --git a/extern/cctbx/include/cctbx/uctbx/fast_minimum_reduction.h b/extern/cctbx/include/cctbx/uctbx/fast_minimum_reduction.h new file mode 100644 index 00000000..9421dad2 --- /dev/null +++ b/extern/cctbx/include/cctbx/uctbx/fast_minimum_reduction.h @@ -0,0 +1,400 @@ +#ifndef CCTBX_UCTBX_FAST_MINIMUM_REDUCTION_H +#define CCTBX_UCTBX_FAST_MINIMUM_REDUCTION_H + +#include +#include + +#if !defined(CCTBX_UCTBX_FAST_MINIMUM_REDUCTION_OVERZEALOUS_OPTIMIZER) +# if defined(__GNUC__) && __GNUC__ == 2 && __GNUC_MINOR__ == 96 +# define CCTBX_UCTBX_FAST_MINIMUM_REDUCTION_OVERZEALOUS_OPTIMIZER +# include +# endif +#endif + +namespace cctbx { namespace uctbx { + + //! Specific exception to indicate failure of reduction algorithm. + class error_iteration_limit_exceeded : public error + { + public: + error_iteration_limit_exceeded() + : + error("Iteration limit exceeded.") + {} + }; + + //! Specific exception to indicate failure of reduction algorithm. + class error_degenerate_unit_cell_parameters : public error + { + public: + error_degenerate_unit_cell_parameters() + : + error("Degenerate unit cell parameters.") + {} + }; + + //! Helper function to disable optimization. + float spoil_optimization(float); + //! Helper function to disable optimization. + double spoil_optimization(double); + + //! Fast minimum-lengths cell reduction. + /*! Based on the algorithm of Gruber (1973), Acta Cryst. A29, 433-440. + Tests for equality are removed in order to make the algorithm + numerically more stable. However, in some cases the algorithm + still oscillates. This situation is analyzed in the implementation + below and the cycle is terminated after the action in the false + branch of N3. + + Attention: + If this class is instantiated with a FloatType other than + float or double a corresponding spoil_optimization() helper + function must be defined! + */ + template + class fast_minimum_reduction + { + public: + //! Default contructor. Some data members are not initialized! + fast_minimum_reduction() {} + + //! Executes the reduction algorithm. + fast_minimum_reduction( + uctbx::unit_cell const& unit_cell, + std::size_t iteration_limit=100, + FloatType multiplier_significant_change_test=16, + std::size_t min_n_no_significant_change=2) + : + multiplier_significant_change_test_( + multiplier_significant_change_test), + min_n_no_significant_change_(min_n_no_significant_change), + iteration_limit_(iteration_limit), + r_inv_(scitbx::mat3(1)), + n_iterations_(0), + n_no_significant_change_(0), + termination_due_to_significant_change_test_(false) + { + uc_sym_mat3 const& g = unit_cell.metrical_matrix(); + a_ = g[0]; + b_ = g[1]; + c_ = g[2]; + d_ = 2*g[5]; + e_ = 2*g[4]; + f_ = 2*g[3]; + last_abc_significant_change_test_ = scitbx::vec3( + -a_,-b_,-c_); + while (step()); + } + + //! Parameterization of Gruber (1973). + af::double6 + as_gruber_matrix() const + { + return af::double6(a_, b_, c_, d_, e_, f_); + } + + //! Parameterization of Niggli. + af::double6 + as_niggli_matrix() const + { + return af::double6(a_, b_, c_, d_/2, e_/2, f_/2); + } + + //! Parameterization as used by uctbx::unit_cell::metrical_matrix(). + uc_sym_mat3 + as_sym_mat3() const + { + return uc_sym_mat3(a_, b_, c_, f_/2, e_/2, d_/2); + } + + //! Conversion to uctbx::unit_cell. + uctbx::unit_cell + as_unit_cell() const + { + return uctbx::unit_cell(as_sym_mat3()); + } + + //! Value as passed to the constructor. + std::size_t + iteration_limit() const { return iteration_limit_; } + + //! Value as passed to the constructor. + FloatType + multiplier_significant_change_test() const + { + return multiplier_significant_change_test_; + } + + //! Value as passed to the constructor. + std::size_t + min_n_no_significant_change() const + { + return min_n_no_significant_change_; + } + + //! Change-of-basis matrix. + /*! Compatible with uctbx::unit_cell::change_basis() + */ + scitbx::mat3 const& + r_inv() const { return r_inv_; } + + //! Number of iterations (actions executed). + std::size_t + n_iterations() const { return n_iterations_; } + + /*! \brief Indicates if the reduction was terminated because + it was detected that the unit cell lengths did no longer + change significantly. + */ + bool + termination_due_to_significant_change_test() const + { + return termination_due_to_significant_change_test_; + } + + //! Cell type according to International Tables for Crystallography. + /*! Possible values: 1 or 2. The value 0 is not possible if + the algorithm terminates. + */ + int + type() const + { + int n_positive = def_test()[1]; + if (n_positive == 3) return 1; + if (n_positive == 0) return 2; + return 0; + } + + protected: + // greatest integer which is not greater than x + inline + IntFromFloatType + entier(FloatType const& x) + { + IntFromFloatType result = static_cast(x); + if (x-result < 0) result--; + if (!(x-result < 1)) result++; // work around rounding errors + return result; + } + + af::tiny + def_test() const + { + int n_zero = 0; + int n_positive = 0; + if (0 < d_) n_positive += 1; + else if (!(d_ < 0)) n_zero += 1; + if (0 < e_) n_positive += 1; + else if (!(e_ < 0)) n_zero += 1; + if (0 < f_) n_positive += 1; + else if (!(f_ < 0)) n_zero += 1; + return af::tiny(n_zero, n_positive); + } + + bool + def_gt_0() const + { + af::tiny nz_np = def_test(); + return nz_np[1] == 3 || (nz_np[0] == 0 && nz_np[1] == 1); + } + + bool + step() + { + // N1 + if (b_ < a_) { + n1_action(); + } + // N2 + if (c_ < b_) { + n2_action(); + return true; + } + // N3 + if (def_gt_0()) { + n3_true_action(); + } + else { + n3_false_action(); + if (!significant_change_test()) { + return false; + } + } + if (b2_action()) return true; + if (b3_action()) return true; + if (b4_action()) return true; + if (b5_action()) return true; + return false; + } + + FloatType + significant_change_test(FloatType const& new_value, std::size_t i) const + { + FloatType m_new = multiplier_significant_change_test_ * new_value; + FloatType diff = new_value - last_abc_significant_change_test_[i]; + FloatType m_new_plus_diff = spoil_optimization(m_new + diff); +#if defined(CCTBX_UCTBX_FAST_MINIMUM_REDUCTION_OVERZEALOUS_OPTIMIZER) + { + char buf[4*sizeof(FloatType)]; + scitbx::serialization::base_256::floating_point + ::to_string(buf, m_new_plus_diff); + scitbx::serialization::base_256::floating_point + ::from_string fs(buf); + m_new_plus_diff = fs.value; + } +#endif + FloatType m_new_plus_diff_minus_m_new = m_new_plus_diff - m_new; + return m_new_plus_diff_minus_m_new != 0; + } + + bool + significant_change_test() + { + if ( significant_change_test(a_, 0) + || significant_change_test(b_, 1) + || significant_change_test(c_, 2)) { + n_no_significant_change_ = 0; + } + else { + n_no_significant_change_++; + if (n_no_significant_change_ == min_n_no_significant_change_) { + return false; + } + } + last_abc_significant_change_test_ = scitbx::vec3(a_,b_,c_); + return true; + } + + void + cb_update(scitbx::mat3 const& m) + { + if (n_iterations_ == iteration_limit_) { + throw error_iteration_limit_exceeded(); + } + r_inv_ = r_inv_ * m; + n_iterations_ += 1; + } + + void + n1_action() + { + cb_update(scitbx::mat3(0,-1,0, -1,0,0, 0,0,-1)); + std::swap(a_, b_); + std::swap(d_, e_); + } + + void + n2_action() + { + cb_update(scitbx::mat3(-1,0,0, 0,0,-1, 0,-1,0)); + std::swap(b_, c_); + std::swap(e_, f_); + } + + void + n3_true_action() + { + scitbx::mat3 m(1); + if (d_ < 0) m[0] = -1; + if (e_ < 0) m[4] = -1; + if (f_ < 0) m[8] = -1; + cb_update(m); + d_ = scitbx::fn::absolute(d_); + e_ = scitbx::fn::absolute(e_); + f_ = scitbx::fn::absolute(f_); + } + + void + n3_false_action() + { + scitbx::mat3 m(1); + int z = -1; + if (0 < d_) m[0] = -1; + else if (!(d_ < 0)) z = 0; + if (0 < e_) m[4] = -1; + else if (!(e_ < 0)) z = 4; + if (0 < f_) m[8] = -1; + else if (!(f_ < 0)) z = 8; + if (m[0]*m[4]*m[8] < 0) { + CCTBX_ASSERT(z != -1); + m[z] = -1; + } + cb_update(m); + d_ = -scitbx::fn::absolute(d_); + e_ = -scitbx::fn::absolute(e_); + f_ = -scitbx::fn::absolute(f_); + } + + bool + b2_action() + { + if (!(b_ < scitbx::fn::absolute(d_))) return false; + IntFromFloatType j = entier((d_+b_)/(2*b_)); + if (j == 0) return false; + cb_update(scitbx::mat3(1,0,0,0,1,-j,0,0,1)); + c_ += j*j*b_ - j*d_; + d_ -= 2*j*b_; + e_ -= j*f_; + if (!(0 < c_)) throw error_degenerate_unit_cell_parameters(); + return true; + } + + bool + b3_action() + { + if (!(a_ < scitbx::fn::absolute(e_))) return false; + IntFromFloatType j = entier((e_+a_)/(2*a_)); + if (j == 0) return false; + cb_update(scitbx::mat3(1,0,-j,0,1,0,0,0,1)); + c_ += j*j*a_ - j*e_; + d_ -= j*f_; + e_ -= 2*j*a_; + if (!(0 < c_)) throw error_degenerate_unit_cell_parameters(); + return true; + } + + bool + b4_action() + { + if (!(a_ < scitbx::fn::absolute(f_))) return false; + IntFromFloatType j = entier((f_+a_)/(2*a_)); + if (j == 0) return false; + cb_update(scitbx::mat3(1,-j,0,0,1,0,0,0,1)); + b_ += j*j*a_ - j*f_; + d_ -= j*e_; + f_ -= 2*j*a_; + if (!(0 < b_)) throw error_degenerate_unit_cell_parameters(); + return true; + } + + bool + b5_action() + { + FloatType de = d_ + e_; + FloatType fab = f_ + a_ + b_; + if (!(de+fab < 0)) return false; + IntFromFloatType j = entier((de+fab)/(2*fab)); + if (j == 0) return false; + cb_update(scitbx::mat3(1,0,-j,0,1,-j,0,0,1)); + c_ += j*j*fab-j*de; + d_ -= j*(2*b_+f_); + e_ -= j*(2*a_+f_); + if (!(0 < c_)) throw error_degenerate_unit_cell_parameters(); + return true; + } + + FloatType multiplier_significant_change_test_; + std::size_t min_n_no_significant_change_; + std::size_t iteration_limit_; + scitbx::mat3 r_inv_; + std::size_t n_iterations_; + std::size_t n_no_significant_change_; + bool termination_due_to_significant_change_test_; + FloatType a_, b_, c_, d_, e_, f_; + scitbx::vec3 last_abc_significant_change_test_; + }; + +}} // namespace cctbx::uctbx + +#endif // CCTBX_UCTBX_FAST_MINIMUM_REDUCTION_H diff --git a/extern/cctbx/include/scitbx/array_family/accessors/c_grid.h b/extern/cctbx/include/scitbx/array_family/accessors/c_grid.h new file mode 100644 index 00000000..e37e7d74 --- /dev/null +++ b/extern/cctbx/include/scitbx/array_family/accessors/c_grid.h @@ -0,0 +1,247 @@ +// The implementations in this file are highly redundant in order +// to help the optimizer. + +#ifndef SCITBX_ARRAY_FAMILY_ACCESSORS_C_GRID_H +#define SCITBX_ARRAY_FAMILY_ACCESSORS_C_GRID_H + +#include +#include +#include + +namespace scitbx { namespace af { + + template + class c_grid : public tiny + { + public: + typedef IndexValueType index_value_type; + typedef index_value_type value_type; + typedef tiny index_type; + + c_grid() { for(std::size_t i=0;ielems[i] = 0; } + + c_grid(index_type const& n) : index_type(n) {} + + template + c_grid(flex_grid const& flex_g) + : + index_type(af::adapt(flex_g.all())) + { + SCITBX_ASSERT(flex_g.is_0_based()); + SCITBX_ASSERT(!flex_g.is_padded()); + } + + af::flex_grid<> + as_flex_grid() const + { + return af::flex_grid<>(af::adapt(*this)); + } + + std::size_t + size_1d() const + { + return math::compile_time::product::get(*this); + } + + index_type + index_nd(index_value_type const& i_1d) const + { + index_type i_nd; + i_nd[0] = i_1d; + for(std::size_t j=this->size()-1;j;j--) { + i_nd[j] = i_nd[0] % this->elems[j]; + i_nd[0] /= this->elems[j]; + } + return i_nd; + } + + bool + is_valid_index(index_type const& i) const + { + for(std::size_t j=0;jsize();j++) { + if (i[j] >= this->elems[j]) return false; + } + return true; + } + + std::size_t + operator()(index_type const& i) const + { + return c_index_1d_calculator::get(*this, i); + } + }; + + template + class c_grid<2, IndexValueType> : public tiny + { + public: + typedef IndexValueType index_value_type; + typedef index_value_type value_type; + typedef tiny index_type; + + c_grid() : index_type(0,0) {} + + c_grid(index_type const& n) : index_type(n) {} + + c_grid(index_value_type const& n0, + index_value_type const& n1) + : index_type(n0, n1) + {} + + template + c_grid(flex_grid const& flex_g) + : + index_type(af::adapt(flex_g.all())) + { + SCITBX_ASSERT(flex_g.is_0_based()); + SCITBX_ASSERT(!flex_g.is_padded()); + } + + af::flex_grid<> + as_flex_grid() const + { + return af::flex_grid<>(af::adapt(*this)); + } + + std::size_t + size_1d() const + { + return static_cast(this->elems[0]) + * static_cast(this->elems[1]); + } + + bool + is_square() const { return this->elems[0] == this->elems[1]; } + + std::size_t n_rows() const { return this->elems[0]; } + std::size_t n_columns() const { return this->elems[1]; } + + index_type + index_nd(index_value_type const& i_1d) + { + return index_type(i_1d / this->elems[1], i_1d % this->elems[1]); + } + + bool + is_valid_index(index_type const& i) const + { + if (i[0] >= this->elems[0]) return false; + if (i[1] >= this->elems[1]) return false; + return true; + } + + bool + is_valid_index( + index_value_type const& i0, + index_value_type const& i1) const + { + if (i0 >= this->elems[0]) return false; + if (i1 >= this->elems[1]) return false; + return true; + } + + std::size_t + operator()(index_type const& i) const + { + return i[0] * this->elems[1] + i[1]; + } + + std::size_t + operator()(index_value_type const& i0, + index_value_type const& i1) const + { + return i0 * this->elems[1] + i1; + } + }; + + template + class c_grid<3, IndexValueType> : public tiny + { + public: + typedef IndexValueType index_value_type; + typedef index_value_type value_type; + typedef tiny index_type; + + c_grid() : index_type(0,0,0) {} + + c_grid(index_type const& n) : index_type(n) {} + + c_grid(index_value_type const& n0, + index_value_type const& n1, + index_value_type const& n2) + : index_type(n0, n1, n2) + {} + + template + c_grid(flex_grid const& flex_g) + : + index_type(af::adapt(flex_g.all())) + { + SCITBX_ASSERT(flex_g.is_0_based()); + SCITBX_ASSERT(!flex_g.is_padded()); + } + + af::flex_grid<> + as_flex_grid() const + { + return af::flex_grid<>(af::adapt(*this)); + } + + std::size_t + size_1d() const + { + return static_cast(this->elems[0]) + * static_cast(this->elems[1]) + * static_cast(this->elems[2]); + } + + index_type + index_nd(index_value_type const& i_1d) + { + index_type i_nd; + i_nd[2] = i_1d % this->elems[2]; + i_nd[0] = i_1d / this->elems[2]; + i_nd[1] = i_nd[0] % this->elems[1]; + i_nd[0] /= this->elems[1]; + return i_nd; + } + + bool + is_valid_index(index_type const& i) const + { + if (i[0] >= this->elems[0]) return false; + if (i[1] >= this->elems[1]) return false; + if (i[2] >= this->elems[2]) return false; + return true; + } + + bool + is_valid_index( + index_value_type const& i0, + index_value_type const& i1, + index_value_type const& i2) const + { + if (i0 >= this->elems[0]) return false; + if (i1 >= this->elems[1]) return false; + if (i2 >= this->elems[2]) return false; + return true; + } + + std::size_t + operator()(index_type const& i) const + { + return (i[0] * this->elems[1] + i[1]) * this->elems[2] + i[2]; + } + + std::size_t + operator()(index_value_type const& i0, + index_value_type const& i1, + index_value_type const& i2) const + { + return (i0 * this->elems[1] + i1) * this->elems[2] + i2; + } + }; + +}} // namespace scitbx::af + +#endif // SCITBX_ARRAY_FAMILY_ACCESSORS_C_GRID_H diff --git a/extern/cctbx/include/scitbx/array_family/accessors/c_index_1d_calculator.h b/extern/cctbx/include/scitbx/array_family/accessors/c_index_1d_calculator.h new file mode 100644 index 00000000..edfe68a9 --- /dev/null +++ b/extern/cctbx/include/scitbx/array_family/accessors/c_index_1d_calculator.h @@ -0,0 +1,32 @@ +#ifndef SCITBX_ARRAY_FAMILY_ACCESSORS_C_INDEX_1D_CALCULATOR_H +#define SCITBX_ARRAY_FAMILY_ACCESSORS_C_INDEX_1D_CALCULATOR_H + +#include + +namespace scitbx { namespace af { + + template + struct c_index_1d_calculator + { + template + static std::size_t + get(ExtendArrayType const& e, IndexType const& i) + { + return c_index_1d_calculator::get(e, i) * e[N-1] + i[N-1]; + } + }; + + template<> + struct c_index_1d_calculator<1> + { + template + static std::size_t + get(ExtendArrayType const& /*e*/, IndexType const& i) + { + return i[0]; + } + }; + +}} // namespace scitbx::af + +#endif // SCITBX_ARRAY_FAMILY_ACCESSORS_C_INDEX_1D_CALCULATOR_H diff --git a/extern/cctbx/include/scitbx/array_family/accessors/flex_grid.h b/extern/cctbx/include/scitbx/array_family/accessors/flex_grid.h new file mode 100644 index 00000000..5c682491 --- /dev/null +++ b/extern/cctbx/include/scitbx/array_family/accessors/flex_grid.h @@ -0,0 +1,401 @@ +#ifndef SCITBX_ARRAY_FAMILY_ACCESSORS_FLEX_GRID_H +#define SCITBX_ARRAY_FAMILY_ACCESSORS_FLEX_GRID_H + +#include +#include +#include +#include + +namespace scitbx { namespace af { + + typedef small flex_grid_default_index_type; + + template + class flex_grid + { + public: + typedef IndexType index_type; + typedef typename index_type::value_type index_value_type; + + flex_grid() {} + + flex_grid(index_type const& all) + : all_(all) + {} + + template + flex_grid(array_adaptor const& a_a) + : all_(a_a) + {} + + flex_grid(index_value_type const& all_0) + : + all_(1, all_0) + {} + + flex_grid(index_value_type const& all_0, + index_value_type const& all_1) + : + all_(1, all_0) + { + all_.push_back(all_1); + } + + flex_grid(index_value_type const& all_0, + index_value_type const& all_1, + index_value_type const& all_2) + : + all_(1, all_0) + { + all_.push_back(all_1); + all_.push_back(all_2); + } + + flex_grid(index_value_type const& all_0, + index_value_type const& all_1, + index_value_type const& all_2, + index_value_type const& all_3) + : + all_(1, all_0) + { + all_.push_back(all_1); + all_.push_back(all_2); + all_.push_back(all_3); + } + + flex_grid(index_value_type const& all_0, + index_value_type const& all_1, + index_value_type const& all_2, + index_value_type const& all_3, + index_value_type const& all_4) + : + all_(1, all_0) + { + all_.push_back(all_1); + all_.push_back(all_2); + all_.push_back(all_3); + all_.push_back(all_4); + } + + flex_grid(index_value_type const& all_0, + index_value_type const& all_1, + index_value_type const& all_2, + index_value_type const& all_3, + index_value_type const& all_4, + index_value_type const& all_5) + : + all_(1, all_0) + { + all_.push_back(all_1); + all_.push_back(all_2); + all_.push_back(all_3); + all_.push_back(all_4); + all_.push_back(all_5); + } + + flex_grid(index_type const& origin, + index_type const& last, + bool open_range=true) + : + all_(last), + origin_(origin) + { + all_ -= origin_; + if (!open_range) all_ += index_value_type(1); + if (origin_.all_eq(0)) origin_.clear(); + } + + flex_grid + set_focus(index_type const& focus, bool open_range=true) + { + SCITBX_ASSERT(focus.size() == all_.size()); + focus_ = focus; + if (!open_range && focus_.size() > 0) focus_ += index_value_type(1); + set_focus_finalize(); + return *this; + } + + flex_grid + set_focus(index_value_type const& focus_0) + { + SCITBX_ASSERT(all_.size() == 1); + focus_.clear(); + focus_.push_back(focus_0); + set_focus_finalize(); + return *this; + } + + flex_grid + set_focus(index_value_type const& focus_0, + index_value_type const& focus_1) + { + SCITBX_ASSERT(all_.size() == 2); + focus_.clear(); + focus_.push_back(focus_0); + focus_.push_back(focus_1); + set_focus_finalize(); + return *this; + } + + flex_grid + set_focus(index_value_type const& focus_0, + index_value_type const& focus_1, + index_value_type const& focus_2) + { + SCITBX_ASSERT(all_.size() == 3); + focus_.clear(); + focus_.push_back(focus_0); + focus_.push_back(focus_1); + focus_.push_back(focus_2); + set_focus_finalize(); + return *this; + } + + flex_grid + set_focus(index_value_type const& focus_0, + index_value_type const& focus_1, + index_value_type const& focus_2, + index_value_type const& focus_3) + { + SCITBX_ASSERT(all_.size() == 4); + focus_.clear(); + focus_.push_back(focus_0); + focus_.push_back(focus_1); + focus_.push_back(focus_2); + focus_.push_back(focus_3); + set_focus_finalize(); + return *this; + } + + flex_grid + set_focus(index_value_type const& focus_0, + index_value_type const& focus_1, + index_value_type const& focus_2, + index_value_type const& focus_3, + index_value_type const& focus_4) + { + SCITBX_ASSERT(all_.size() == 5); + focus_.clear(); + focus_.push_back(focus_0); + focus_.push_back(focus_1); + focus_.push_back(focus_2); + focus_.push_back(focus_3); + focus_.push_back(focus_4); + set_focus_finalize(); + return *this; + } + + flex_grid + set_focus(index_value_type const& focus_0, + index_value_type const& focus_1, + index_value_type const& focus_2, + index_value_type const& focus_3, + index_value_type const& focus_4, + index_value_type const& focus_5) + { + SCITBX_ASSERT(all_.size() == 6); + focus_.clear(); + focus_.push_back(focus_0); + focus_.push_back(focus_1); + focus_.push_back(focus_2); + focus_.push_back(focus_3); + focus_.push_back(focus_4); + focus_.push_back(focus_5); + set_focus_finalize(); + return *this; + } + + std::size_t + nd() const { return all_.size(); } + + std::size_t + size_1d() const + { + SCITBX_ASSERT(all_.all_ge(0)); + return af::product(all_); + } + + index_type const& + all() const { return all_; } + + bool + is_0_based() const { return origin_.size() == 0; } + + index_type + origin() const + { + if (!is_0_based()) return origin_; + return index_type(all_.size(), index_value_type(0)); + } + + index_type + last(bool open_range=true) const + { + index_type result = origin(); + result += all_; + if (!open_range) result -= index_value_type(1); + return result; + } + + bool + is_padded() const { return focus_.size() != 0; } + + index_type + focus(bool open_range=true) const + { + if (is_padded()) { + index_type result = focus_; + if (!open_range) result -= index_value_type(1); + return result; + } + return last(open_range); + } + + std::size_t + focus_size_1d() const + { + if (focus_.size() == 0) return size_1d(); + index_type n = focus(); + n -= origin(); + SCITBX_ASSERT(n.all_ge(0)); + return af::product(n); + } + + bool + is_trivial_1d() const + { + if (nd() != 1) return false; + if (!is_0_based()) return false; + if (is_padded()) return false; + return true; + } + + bool + is_square_matrix() const + { + if (nd() != 2) return false; + if (all_[0] != all_[1]) return false; + if (!is_0_based()) return false; + if (is_padded()) return false; + return true; + } + + flex_grid + shift_origin() const + { + if (is_0_based()) return *this; + if (!is_padded()) return flex_grid(all_); + index_type result_focus = focus_; // step-wise to avoid + result_focus -= origin(); // gcc 2.96 internal error + return flex_grid(all_).set_focus(result_focus); + } + + bool + is_valid_index(index_type const& i) const + { + std::size_t n = nd(); + if (i.size() != n) return false; + if (!is_0_based()) { + for(std::size_t j=0;j= (origin_[j] + all_[j])) { + return false; + } + } + } + else { + for(std::size_t j=0;j= all_[j]) { + return false; + } + } + } + return true; + } + + std::size_t + operator()(index_type const& i) const + { + std::size_t n = nd(); + std::size_t result = 0; + if (n) { + if (!is_0_based()) { + for(std::size_t j=0;;) { + result += i[j] - origin_[j]; + j++; + if (j == n) break; + result *= all_[j]; + } + } + else { + for(std::size_t j=0;;) { + result += i[j]; + j++; + if (j == n) break; + result *= all_[j]; + } + } + } + return result; + } + + // No assertions to enable maximum performance. + std::size_t + operator()( + index_value_type const& i, + index_value_type const& j) const + { + if (origin_.size() == 0) { + return i * all_[1] + j; + } + return (i-origin_[0]) * all_[1] + (j-origin_[1]); + } + + // No assertions to enable maximum performance. + std::size_t + operator()( + index_value_type const& i, + index_value_type const& j, + index_value_type const& k) const + { + if (origin_.size() == 0) { + return (i * all_[1] + j) * all_[2] + k; + } + return ((i-origin_[0]) * all_[1] + (j-origin_[1])) + * all_[2] + (k-origin_[2]); + } + + bool + operator==(flex_grid const& other) const + { + if (!all_.all_eq(other.all_)) return false; + if (!origin_.all_eq(other.origin_)) return false; + return focus_.all_eq(other.focus_); + } + + bool + operator!=(flex_grid const& other) const + { + return !(*this == other); + } + + protected: + index_type all_; + index_type origin_; + index_type focus_; + + void + set_focus_finalize() + { + index_type last_ = last(); + if (focus_.all_eq(last_)) { + focus_.clear(); + } + else { + SCITBX_ASSERT(last_.all_ge(focus_)); + } + } + }; + +}} // namespace scitbx::af + +#endif // SCITBX_ARRAY_FAMILY_ACCESSORS_FLEX_GRID_H diff --git a/extern/cctbx/include/scitbx/array_family/accessors/mat_grid.h b/extern/cctbx/include/scitbx/array_family/accessors/mat_grid.h new file mode 100644 index 00000000..2441b7a3 --- /dev/null +++ b/extern/cctbx/include/scitbx/array_family/accessors/mat_grid.h @@ -0,0 +1,13 @@ +#ifndef SCITBX_ARRAY_FAMILY_ACCESSORS_MAT_GRID_H +#define SCITBX_ARRAY_FAMILY_ACCESSORS_MAT_GRID_H + +#include + +namespace scitbx { namespace af { + +/// The grid used for matrices throughout +typedef c_grid<2> mat_grid; + +}} // scitbx::af + +#endif // GUARD diff --git a/extern/cctbx/include/scitbx/array_family/accessors/trivial.h b/extern/cctbx/include/scitbx/array_family/accessors/trivial.h new file mode 100644 index 00000000..6698909b --- /dev/null +++ b/extern/cctbx/include/scitbx/array_family/accessors/trivial.h @@ -0,0 +1,28 @@ +#ifndef SCITBX_ARRAY_FAMILY_ACCESSORS_TRIVIAL_H +#define SCITBX_ARRAY_FAMILY_ACCESSORS_TRIVIAL_H + +#include + +namespace scitbx { namespace af { + + class trivial_accessor + { + public: + typedef std::size_t index_type; + struct index_value_type {}; + + trivial_accessor() : size_(0) {} + + trivial_accessor(std::size_t const& n) : size_(n) {} + + std::size_t size_1d() const { return size_; } + + std::size_t operator()(std::size_t i) const { return i; } + + protected: + std::size_t size_; + }; + +}} // namespace scitbx::af + +#endif // SCITBX_ARRAY_FAMILY_ACCESSORS_TRIVIAL_H diff --git a/extern/cctbx/include/scitbx/array_family/array_adaptor.h b/extern/cctbx/include/scitbx/array_family/array_adaptor.h new file mode 100644 index 00000000..d9e02378 --- /dev/null +++ b/extern/cctbx/include/scitbx/array_family/array_adaptor.h @@ -0,0 +1,38 @@ +#ifndef SCITBX_ARRAY_FAMILY_ARRAY_ADAPTOR_H +#define SCITBX_ARRAY_FAMILY_ARRAY_ADAPTOR_H + +namespace scitbx { namespace af { + + template + struct array_adaptor + { + const T* pointee; + array_adaptor(T const& a) : pointee(&a) {} + }; + + template + inline + array_adaptor + adapt(T const& a) + { + return array_adaptor(a); + } + + template + struct array_adaptor_with_static_cast + { + const T* pointee; + array_adaptor_with_static_cast(T const& a) : pointee(&a) {} + }; + + template + inline + array_adaptor_with_static_cast + adapt_with_static_cast(T const& a) + { + return array_adaptor_with_static_cast(a); + } + +}} // namespace scitbx::af + +#endif // SCITBX_ARRAY_FAMILY_ARRAY_ADAPTOR_H diff --git a/extern/cctbx/include/scitbx/array_family/detail/auto_allocator.h b/extern/cctbx/include/scitbx/array_family/detail/auto_allocator.h new file mode 100644 index 00000000..75fc29a9 --- /dev/null +++ b/extern/cctbx/include/scitbx/array_family/detail/auto_allocator.h @@ -0,0 +1,20 @@ +#ifndef SCITBX_ARRAY_FAMILY_AUTO_ALLOCATOR_H +#define SCITBX_ARRAY_FAMILY_AUTO_ALLOCATOR_H + +#include + +namespace scitbx { namespace af { namespace detail { + + template + union auto_allocator + { + typedef typename boost::type_with_alignment< + (boost::alignment_of::value)>::type + align_t; + align_t dummy_; + char buffer[N * sizeof(T)]; + }; + +}}} // namespace scitbx::af::detail + +#endif // SCITBX_ARRAY_FAMILY_AUTO_ALLOCATOR_H diff --git a/extern/cctbx/include/scitbx/array_family/detail/generic_array_functors.h b/extern/cctbx/include/scitbx/array_family/detail/generic_array_functors.h new file mode 100644 index 00000000..f950743d --- /dev/null +++ b/extern/cctbx/include/scitbx/array_family/detail/generic_array_functors.h @@ -0,0 +1,330 @@ +#ifndef SCITBX_ARRAY_FAMILY_GENERIC_ARRAY_FUNCTORS_H +#define SCITBX_ARRAY_FAMILY_GENERIC_ARRAY_FUNCTORS_H + +#include + +namespace scitbx { namespace af { + + template + class array_functor_a { + public: + array_functor_a(FunctorType const& ftor, const ElementType* a) + : m_ftor(ftor), m_a(a) + {} + void operator()( + ElementTypeResult* result, + std::size_t const& sz) const { + typedef typename has_trivial_destructor::value htd; + array_operation_a(m_ftor, m_a, result, sz, htd()); + } + protected: + FunctorType const& m_ftor; + const ElementType* m_a; + }; + + template + inline + array_functor_a< + FunctorType, + ElementType, + typename FunctorType::result_type> + make_array_functor_a( + FunctorType const& ftor, + const ElementType* a) { + return array_functor_a< + FunctorType, + ElementType, + typename FunctorType::result_type>(ftor, a); + } + + template + class array_functor_a_a { + public: + array_functor_a_a( + FunctorType const& ftor, + const ElementType1* a1, + const ElementType2* a2) + : m_ftor(ftor), m_a1(a1), m_a2(a2) + {} + void operator()( + ElementTypeResult* result, + std::size_t const& sz) const { + typedef typename has_trivial_destructor::value htd; + array_operation_a_a(m_ftor, m_a1, m_a2, result, sz, htd()); + } + protected: + FunctorType const& m_ftor; + const ElementType1* m_a1; + const ElementType2* m_a2; + }; + + template + inline + array_functor_a_a< + FunctorType, + ElementType1, + ElementType2, + typename FunctorType::result_type> + make_array_functor_a_a( + FunctorType const& ftor, + const ElementType1* a1, + const ElementType2* a2) { + return array_functor_a_a< + FunctorType, + ElementType1, + ElementType2, + typename FunctorType::result_type>(ftor, a1, a2); + } + + template + class array_functor_a_s { + public: + array_functor_a_s( + FunctorType const& ftor, + const ElementType1* a1, + ElementType2 const& a2) + : m_ftor(ftor), m_a1(a1), m_a2(a2) + {} + void operator()( + ElementTypeResult* result, + std::size_t const& sz) const { + typedef typename has_trivial_destructor::value htd; + array_operation_a_s(m_ftor, m_a1, m_a2, result, sz, htd()); + } + protected: + FunctorType const& m_ftor; + const ElementType1* m_a1; + ElementType2 m_a2; + }; + + template + inline + array_functor_a_s< + FunctorType, + ElementType1, + ElementType2, + typename FunctorType::result_type> + make_array_functor_a_s( + FunctorType const& ftor, + const ElementType1* a1, + ElementType2 const& a2) { + return array_functor_a_s< + FunctorType, + ElementType1, + ElementType2, + typename FunctorType::result_type>(ftor, a1, a2); + } + + template + class array_functor_s_a { + public: + array_functor_s_a( + FunctorType const& ftor, + ElementType1 const& a1, + const ElementType2* a2) + : m_ftor(ftor), m_a1(a1), m_a2(a2) + {} + void operator()( + ElementTypeResult* result, + std::size_t const& sz) const { + typedef typename has_trivial_destructor::value htd; + array_operation_s_a(m_ftor, m_a1, m_a2, result, sz, htd()); + } + protected: + FunctorType const& m_ftor; + ElementType1 m_a1; + const ElementType2* m_a2; + }; + + template + inline + array_functor_s_a< + FunctorType, + ElementType1, + ElementType2, + typename FunctorType::result_type> + make_array_functor_s_a( + FunctorType const& ftor, + ElementType1 const& a1, + const ElementType2* a2) { + return array_functor_s_a< + FunctorType, + ElementType1, + ElementType2, + typename FunctorType::result_type>(ftor, a1, a2); + } + + template + class array_functor_a_a_s { + public: + array_functor_a_a_s( + FunctorType const& ftor, + const ElementType1* a1, + const ElementType2* a2, + ElementType3 const& a3) + : m_ftor(ftor), m_a1(a1), m_a2(a2), m_a3(a3) + {} + void operator()( + ElementTypeResult* result, + std::size_t const& sz) const { + typedef typename has_trivial_destructor::value htd; + array_operation_a_a_s(m_ftor, m_a1, m_a2, m_a3, result, sz, htd()); + } + protected: + FunctorType const& m_ftor; + const ElementType1* m_a1; + const ElementType2* m_a2; + ElementType3 m_a3; + }; + + template + inline + array_functor_a_a_s< + FunctorType, + ElementType1, + ElementType2, + ElementType3, + typename FunctorType::result_type> + make_array_functor_a_a_s( + FunctorType const& ftor, + const ElementType1* a1, + const ElementType2* a2, + ElementType3 const& a3) { + return array_functor_a_a_s< + FunctorType, + ElementType1, + ElementType2, + ElementType3, + typename FunctorType::result_type>(ftor, a1, a2, a3); + } + + template + class array_functor_a_s_s { + public: + array_functor_a_s_s( + FunctorType const& ftor, + const ElementType1* a1, + ElementType2 const& a2, + ElementType3 const& a3) + : m_ftor(ftor), m_a1(a1), m_a2(a2), m_a3(a3) + {} + void operator()( + ElementTypeResult* result, + std::size_t const& sz) const { + typedef typename has_trivial_destructor::value htd; + array_operation_a_s_s(m_ftor, m_a1, m_a2, m_a3, result, sz, htd()); + } + protected: + FunctorType const& m_ftor; + const ElementType1* m_a1; + ElementType2 m_a2; + ElementType3 m_a3; + }; + + template + inline + array_functor_a_s_s< + FunctorType, + ElementType1, + ElementType2, + ElementType3, + typename FunctorType::result_type> + make_array_functor_a_s_s( + FunctorType const& ftor, + const ElementType1* a1, + ElementType2 const& a2, + ElementType3 const& a3) { + return array_functor_a_s_s< + FunctorType, + ElementType1, + ElementType2, + ElementType3, + typename FunctorType::result_type>(ftor, a1, a2, a3); + } + + template + class array_functor_s_a_s { + public: + array_functor_s_a_s( + FunctorType const& ftor, + ElementType1 const& a1, + const ElementType2* a2, + ElementType3 const& a3) + : m_ftor(ftor), m_a1(a1), m_a2(a2), m_a3(a3) + {} + void operator()( + ElementTypeResult* result, + std::size_t const& sz) const { + typedef typename has_trivial_destructor::value htd; + array_operation_s_a_s(m_ftor, m_a1, m_a2, m_a3, result, sz, htd()); + } + protected: + FunctorType const& m_ftor; + ElementType1 m_a1; + const ElementType2* m_a2; + ElementType3 m_a3; + }; + + template + inline + array_functor_s_a_s< + FunctorType, + ElementType1, + ElementType2, + ElementType3, + typename FunctorType::result_type> + make_array_functor_s_a_s( + FunctorType const& ftor, + ElementType1 const& a1, + const ElementType2* a2, + ElementType3 const& a3) { + return array_functor_s_a_s< + FunctorType, + ElementType1, + ElementType2, + ElementType3, + typename FunctorType::result_type>(ftor, a1, a2, a3); + } + +}} // namespace scitbx::af + +#endif // SCITBX_ARRAY_FAMILY_GENERIC_ARRAY_FUNCTORS_H diff --git a/extern/cctbx/include/scitbx/array_family/detail/generic_array_operators.h b/extern/cctbx/include/scitbx/array_family/detail/generic_array_operators.h new file mode 100644 index 00000000..980a23a9 --- /dev/null +++ b/extern/cctbx/include/scitbx/array_family/detail/generic_array_operators.h @@ -0,0 +1,379 @@ +#ifndef SCITBX_ARRAY_FAMILY_GENERIC_ARRAY_OPERATORS_H +#define SCITBX_ARRAY_FAMILY_GENERIC_ARRAY_OPERATORS_H + +#include + +namespace scitbx { namespace af { + + // functor(array), non-POD result type + template + void // not inline + array_operation_a( + FunctorType const& ftor, + const ElementType* a, + ElementTypeResult* result, + std::size_t const& sz, + false_type) + { + ElementTypeResult* result_start = result; + try { + ElementTypeResult* result_end = result + sz; + for(;result != result_end; a++, result++) { + new (result) ElementTypeResult(ftor(*a)); + } + } + catch (...) { + scitbx::af::detail::destroy_array_elements(result_start, result, + false_type()); + throw; + } + } + + // functor(array), POD result type + template + inline void + array_operation_a( + FunctorType const& ftor, + const ElementType* a, + ElementTypeResult* result, + std::size_t const& sz, + true_type) + { + ElementTypeResult* result_end = result + sz; + for(;result != result_end; a++, result++) { + *result = ftor(*a); + } + } + + // functor(array, array), non-POD result type + template + void // not inline + array_operation_a_a( + FunctorType const& ftor, + const ElementType1* a1, + const ElementType2* a2, + ElementTypeResult* result, + std::size_t const& sz, + false_type) + { + ElementTypeResult* result_start = result; + try { + ElementTypeResult* result_end = result + sz; + for(;result != result_end; a1++, a2++, result++) { + new (result) ElementTypeResult(ftor(*a1, *a2)); + } + } + catch (...) { + scitbx::af::detail::destroy_array_elements(result_start, result, + false_type()); + throw; + } + } + + // functor(array, array), POD result type + template + inline void + array_operation_a_a( + FunctorType const& ftor, + const ElementType1* a1, + const ElementType2* a2, + ElementTypeResult* result, + std::size_t const& sz, + true_type) + { + ElementTypeResult* result_end = result + sz; + for(;result != result_end; a1++, a2++, result++) { + *result = ftor(*a1, *a2); + } + } + + // functor(array, scalar), non-POD result type + template + void // not inline + array_operation_a_s( + FunctorType const& ftor, + const ElementType1* a1, + ElementType2 const& a2, + ElementTypeResult* result, + std::size_t const& sz, + false_type) + { + ElementTypeResult* result_start = result; + try { + ElementTypeResult* result_end = result + sz; + for(;result != result_end; a1++, result++) { + new (result) ElementTypeResult(ftor(*a1, a2)); + } + } + catch (...) { + scitbx::af::detail::destroy_array_elements(result_start, result, + false_type()); + throw; + } + } + + // functor(array, scalar), POD result type + template + inline void + array_operation_a_s( + FunctorType const& ftor, + const ElementType1* a1, + ElementType2 const& a2, + ElementTypeResult* result, + std::size_t const& sz, + true_type) + { + ElementTypeResult* result_end = result + sz; + for(;result != result_end; a1++, result++) { + *result = ftor(*a1, a2); + } + } + + // functor(scalar, array), non-POD result type + template + void // not inline + array_operation_s_a( + FunctorType const& ftor, + ElementType1 const& a1, + const ElementType2* a2, + ElementTypeResult* result, + std::size_t const& sz, + false_type) + { + ElementTypeResult* result_start = result; + try { + ElementTypeResult* result_end = result + sz; + for(;result != result_end; a2++, result++) { + new (result) ElementTypeResult(ftor(a1, *a2)); + } + } + catch (...) { + scitbx::af::detail::destroy_array_elements(result_start, result, + false_type()); + throw; + } + } + + // functor(scalar, array), POD result type + template + inline void + array_operation_s_a( + FunctorType const& ftor, + ElementType1 const& a1, + const ElementType2* a2, + ElementTypeResult* result, + std::size_t const& sz, + true_type) + { + ElementTypeResult* result_end = result + sz; + for(;result != result_end; a2++, result++) { + *result = ftor(a1, *a2); + } + } + + // functor(array, array, scalar), non-POD result type + template + void // not inline + array_operation_a_a_s( + FunctorType const& ftor, + const ElementType1* a1, + const ElementType2* a2, + ElementType3 const& a3, + ElementTypeResult* result, + std::size_t const& sz, + false_type) + { + ElementTypeResult* result_start = result; + try { + ElementTypeResult* result_end = result + sz; + for(;result != result_end; a1++, a2++, result++) { + new (result) ElementTypeResult(ftor(*a1, *a2, a3)); + } + } + catch (...) { + scitbx::af::detail::destroy_array_elements(result_start, result, + false_type()); + throw; + } + } + + // functor(array, array, scalar), POD result type + template + inline void + array_operation_a_a_s( + FunctorType const& ftor, + const ElementType1* a1, + const ElementType2* a2, + ElementType3 const& a3, + ElementTypeResult* result, + std::size_t const& sz, + true_type) + { + ElementTypeResult* result_end = result + sz; + for(;result != result_end; a1++, a2++, result++) { + *result = ftor(*a1, *a2, a3); + } + } + + // functor(array, scalar, scalar), non-POD result type + template + void // not inline + array_operation_a_s_s( + FunctorType const& ftor, + const ElementType* a1, + ElementType const& a2, + ElementType const& a3, + ElementTypeResult* result, + std::size_t const& sz, + false_type) + { + ElementTypeResult* result_start = result; + try { + ElementTypeResult* result_end = result + sz; + for(;result != result_end; a1++, result++) { + new (result) ElementTypeResult(ftor(*a1, a2, a3)); + } + } + catch (...) { + scitbx::af::detail::destroy_array_elements(result_start, result, + false_type()); + throw; + } + } + + // functor(array, scalar, scalar), POD result type + template + inline void + array_operation_a_s_s( + FunctorType const& ftor, + const ElementType* a1, + ElementType const& a2, + ElementType const& a3, + ElementTypeResult* result, + std::size_t const& sz, + true_type) + { + ElementTypeResult* result_end = result + sz; + for(;result != result_end; a1++, result++) { + *result = ftor(*a1, a2, a3); + } + } + + // functor(scalar, array, scalar), non-POD result type + template + void // not inline + array_operation_s_a_s( + FunctorType const& ftor, + ElementType1 const& a1, + const ElementType2* a2, + ElementType3 const& a3, + ElementTypeResult* result, + std::size_t const& sz, + false_type) // non-POD result type + { + ElementTypeResult* result_start = result; + try { + ElementTypeResult* result_end = result + sz; + for(;result != result_end; a2++, result++) { + new (result) ElementTypeResult(ftor(a1, *a2, a3)); + } + } + catch (...) { + scitbx::af::detail::destroy_array_elements(result_start, result, + false_type()); + throw; + } + } + + // functor(scalar, array, scalar), POD result type + template + inline void + array_operation_s_a_s( + FunctorType const& ftor, + ElementType1 const& a1, + const ElementType2* a2, + ElementType3 const& a3, + ElementTypeResult* result, + std::size_t const& sz, + true_type) + { + ElementTypeResult* result_end = result + sz; + for(;result != result_end; a2++, result++) { + *result = ftor(a1, *a2, a3); + } + } + + // functor in_place(array, array) + template + inline void + array_operation_in_place_a_a( + InPlaceFunctorType const& ftor, + ElementType1* a1, + const ElementType2* a2, + std::size_t const& sz) + { + ElementType1* a1_end = a1 + sz; + for(;a1 != a1_end; a1++, a2++) ftor(*a1, *a2); + } + + // functor in_place(array, scalar) + template + inline void + array_operation_in_place_a_s( + InPlaceFunctorType const& ftor, + ElementType* a1, + ElementType const& a2, + std::size_t const& sz) + { + ElementType* a1_end = a1 + sz; + for(;a1 != a1_end; a1++) ftor(*a1, a2); + } + +}} // namespace scitbx::af + +#endif // SCITBX_ARRAY_FAMILY_GENERIC_ARRAY_OPERATORS_H diff --git a/extern/cctbx/include/scitbx/array_family/detail/misc.h b/extern/cctbx/include/scitbx/array_family/detail/misc.h new file mode 100644 index 00000000..d7f7f52d --- /dev/null +++ b/extern/cctbx/include/scitbx/array_family/detail/misc.h @@ -0,0 +1,132 @@ +#ifndef SCITBX_ARRAY_FAMILY_MISC_H +#define SCITBX_ARRAY_FAMILY_MISC_H + +#include +#include + +namespace scitbx { namespace af { + + class reserve + { + public: + reserve(std::size_t size) : size_(size) {} + + std::size_t + operator()() const { return size_; } + + private: + std::size_t size_; + }; + + template + struct init_functor + { + init_functor() : held(0) {} + explicit init_functor(FunctorType const& ftor) : held(&ftor) {} + const FunctorType* held; + }; + + template + inline + init_functor + make_init_functor(FunctorType const& ftor) + { + return init_functor(ftor); + } + + template + struct init_functor_null : init_functor > + { + init_functor_null() { this->held = this; } + + void operator()(ElementType*, std::size_t const&) const + { + SCITBX_ARRAY_FAMILY_STATIC_ASSERT_HAS_TRIVIAL_DESTRUCTOR + } + }; + + namespace detail { + + template + inline + void destroy_array_element(ElementType* elem, false_type) { + elem->~ElementType(); + } + + template + inline + void destroy_array_element(ElementType* /*elem*/, true_type) { + } + + template + inline + void destroy_array_elements(ElementType* first, ElementType* last, + false_type) { + while (first != last) { + first->~ElementType(); + ++first; + } + } + + template + inline + void destroy_array_elements(ElementType*, ElementType*, + true_type) { + } + + } // namespace detail + +#if !defined(__GNUC__) \ + || ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ > 0))) +#define SCITBX_ARRAY_FAMILY_STD_COPY_PERMITS_TYPECONV +#endif + + template + inline + OutputElementType* + copy_typeconv( + const InputElementType* first, + const InputElementType* last, + OutputElementType* result) + { +#ifdef SCITBX_ARRAY_FAMILY_STD_COPY_PERMITS_TYPECONV + return std::copy(first, last, result); +#else + OutputElementType* p = result; + while (first != last) *p++ = OutputElementType(*first++); + return result; +#endif + } + + template +#ifdef SCITBX_ARRAY_FAMILY_STD_COPY_PERMITS_TYPECONV + inline +#endif + OutputElementType* + uninitialized_copy_typeconv( + const InputElementType* first, + const InputElementType* last, + OutputElementType* result) + { +#ifdef SCITBX_ARRAY_FAMILY_STD_COPY_PERMITS_TYPECONV + return std::uninitialized_copy(first, last, result); +#else + OutputElementType* p = result; + try { + for (; first != last; p++, first++) { + new (p) OutputElementType(*first); + } + } + catch (...) { + detail::destroy_array_elements(result, p, false_type()); + throw; + } + return result; +#endif + } + +}} // namespace scitbx::af + +#endif // SCITBX_ARRAY_FAMILY_MISC_H diff --git a/extern/cctbx/include/scitbx/array_family/detail/operator_functors.h b/extern/cctbx/include/scitbx/array_family/detail/operator_functors.h new file mode 100644 index 00000000..cfa961b9 --- /dev/null +++ b/extern/cctbx/include/scitbx/array_family/detail/operator_functors.h @@ -0,0 +1,227 @@ +/* ***************************************************** + THIS IS AN AUTOMATICALLY GENERATED FILE. DO NOT EDIT. + ***************************************************** + + Generated by: + scitbx.source_generators.array_family.generate_operator_functors + */ + +#ifndef SCITBX_ARRAY_FAMILY_OPERATOR_FUNCTORS_H +#define SCITBX_ARRAY_FAMILY_OPERATOR_FUNCTORS_H + +namespace scitbx { namespace fn { + + template + struct functor_logical_not { + typedef ResultType result_type; + ResultType operator()(ArgumentType const& x) const { + return ResultType(!x); + } + }; + + template + struct functor_negate { + typedef ResultType result_type; + ResultType operator()(ArgumentType const& x) const { + return ResultType(-x); + } + }; + + template + struct functor_greater_equal { + typedef ResultType result_type; + ResultType operator()(ArgumentType1 const& x, + ArgumentType2 const& y) const { + return ResultType(x >= y); + } + }; + + template + struct functor_equal_to { + typedef ResultType result_type; + ResultType operator()(ArgumentType1 const& x, + ArgumentType2 const& y) const { + return ResultType(x == y); + } + }; + + template + struct functor_logical_or { + typedef ResultType result_type; + ResultType operator()(ArgumentType1 const& x, + ArgumentType2 const& y) const { + return ResultType(x || y); + } + }; + + template + struct functor_less_equal { + typedef ResultType result_type; + ResultType operator()(ArgumentType1 const& x, + ArgumentType2 const& y) const { + return ResultType(x <= y); + } + }; + + template + struct functor_logical_and { + typedef ResultType result_type; + ResultType operator()(ArgumentType1 const& x, + ArgumentType2 const& y) const { + return ResultType(x && y); + } + }; + + template + struct functor_not_equal_to { + typedef ResultType result_type; + ResultType operator()(ArgumentType1 const& x, + ArgumentType2 const& y) const { + return ResultType(x != y); + } + }; + + template + struct functor_modulus { + typedef ResultType result_type; + ResultType operator()(ArgumentType1 const& x, + ArgumentType2 const& y) const { + return ResultType(x % y); + } + }; + + template + struct functor_plus { + typedef ResultType result_type; + ResultType operator()(ArgumentType1 const& x, + ArgumentType2 const& y) const { + return ResultType(x + y); + } + }; + + template + struct functor_multiplies { + typedef ResultType result_type; + ResultType operator()(ArgumentType1 const& x, + ArgumentType2 const& y) const { + return ResultType(x * y); + } + }; + + template + struct functor_minus { + typedef ResultType result_type; + ResultType operator()(ArgumentType1 const& x, + ArgumentType2 const& y) const { + return ResultType(x - y); + } + }; + + template + struct functor_divides { + typedef ResultType result_type; + ResultType operator()(ArgumentType1 const& x, + ArgumentType2 const& y) const { + return ResultType(x / y); + } + }; + + template + struct functor_less { + typedef ResultType result_type; + ResultType operator()(ArgumentType1 const& x, + ArgumentType2 const& y) const { + return ResultType(x < y); + } + }; + + template + struct functor_greater { + typedef ResultType result_type; + ResultType operator()(ArgumentType1 const& x, + ArgumentType2 const& y) const { + return ResultType(x > y); + } + }; + + template + struct functor_ip_minus { + ArgumentType1& operator()(ArgumentType1& x, + ArgumentType2 const& y) const { + x -= y; + return x; + } + }; + + template + struct functor_ip_multiplies { + ArgumentType1& operator()(ArgumentType1& x, + ArgumentType2 const& y) const { + x *= y; + return x; + } + }; + + template + struct functor_ip_divides { + ArgumentType1& operator()(ArgumentType1& x, + ArgumentType2 const& y) const { + x /= y; + return x; + } + }; + + template + struct functor_ip_modulus { + ArgumentType1& operator()(ArgumentType1& x, + ArgumentType2 const& y) const { + x %= y; + return x; + } + }; + + template + struct functor_ip_plus { + ArgumentType1& operator()(ArgumentType1& x, + ArgumentType2 const& y) const { + x += y; + return x; + } + }; + +}} // namespace scitbx::fn + +#endif // SCITBX_ARRAY_FAMILY_OPERATOR_FUNCTORS_H diff --git a/extern/cctbx/include/scitbx/array_family/detail/push_back_etc.h b/extern/cctbx/include/scitbx/array_family/detail/push_back_etc.h new file mode 100644 index 00000000..2864aa43 --- /dev/null +++ b/extern/cctbx/include/scitbx/array_family/detail/push_back_etc.h @@ -0,0 +1,205 @@ +// Included from small_plain.h and shared_plain.h +// DO NOT INCLUDE THIS FILE DIRECTLY. + + void assign(size_type const& sz, ElementType const& x) { + if (sz > capacity()) { + clear(); + reserve(sz); + std::uninitialized_fill_n(begin(), sz, x); + m_set_size(sz); + } + else if (sz > size()) { + std::fill(begin(), end(), x); + std::uninitialized_fill(end(), begin() + sz, x); + m_set_size(sz); + } + else { + std::fill_n(begin(), sz, x); + erase(begin() + sz, end()); + } + } + + void assign(const ElementType* first, const ElementType* last) + { + size_type sz = last - first; + if (sz > capacity()) { + clear(); + reserve(sz); + std::uninitialized_copy(first, last, begin()); + m_set_size(sz); + } + else if (sz > size()) { + const ElementType* mid = first + size() ; + std::copy(first, mid, begin()); + std::uninitialized_copy(mid, last, end()); + m_set_size(sz); + } + else { + std::copy(first, last, begin()); + erase(begin() + sz, end()); + } + } + + void push_back(ElementType const& x) { + if (size() < capacity()) { + new (end()) ElementType(x); + m_incr_size(1); + } + else { + m_insert_overflow(end(), size_type(1), x, true); + } + } + + void pop_back() { + m_decr_size(1); + typedef typename has_trivial_destructor::value htd; + detail::destroy_array_element(end(), htd()); + } + + ElementType* insert(ElementType* pos, ElementType const& x) { + size_type n = pos - begin(); + if (size() == capacity()) { + m_insert_overflow(pos, size_type(1), x, false); + } + else { + if (pos == end()) { + new (end()) ElementType(x); + m_incr_size(1); + } + else { + new (end()) ElementType(*(end() - 1)); + m_incr_size(1); + ElementType x_copy = x; + std::copy_backward(pos, end() - 2, end() - 1); + *pos = x_copy; + } + } + return begin() + n; + } + + // restricted to ElementType + void insert(ElementType* pos, + const ElementType* first, const ElementType* last) + { + size_type n = last - first; + if (n == 0) return; + if (size() + n > capacity()) { + m_insert_overflow(pos, first, last); + } + else { + size_type n_move_up = end() - pos; + ElementType* old_end = end(); + if (n_move_up > n) { + std::uninitialized_copy(end() - n, end(), end()); + m_incr_size(n); + std::copy_backward(pos, old_end - n, old_end); + std::copy(first, last, pos); + } + else { + const ElementType* mid = first + n_move_up; + std::uninitialized_copy(mid, last, end()); + m_incr_size(n - n_move_up); + std::uninitialized_copy(pos, old_end, end()); + m_incr_size(n_move_up); + std::copy(first, mid, pos); + } + } + } + + // non-std + void extend(const ElementType* first, const ElementType* last) + { + // pos == end(); + size_type n = last - first; + if (n == 0) return; + if (size() + n > capacity()) { + m_insert_overflow(end(), first, last); + } + else { + std::uninitialized_copy(first, last, end()); + m_incr_size(n); + } + } + + void insert(ElementType* pos, size_type const& n, ElementType const& x) { + if (n == 0) return; + if (size() + n > capacity()) { + m_insert_overflow(pos, n, x, false); + } + else { + ElementType x_copy = x; + size_type n_move_up = end() - pos; + ElementType* old_end = end(); + if (n_move_up > n) { + std::uninitialized_copy(end() - n, end(), end()); + m_incr_size(n); + std::copy_backward(pos, old_end - n, old_end); + std::fill_n(pos, n, x_copy); + } + else { + std::uninitialized_fill_n(end(), n - n_move_up, x_copy); + m_incr_size(n - n_move_up); + std::uninitialized_copy(pos, old_end, end()); + m_incr_size(n_move_up); + std::fill(pos, old_end, x_copy); + } + } + } + + ElementType* erase(ElementType* pos) { + if (pos + 1 != end()) { + std::copy(pos + 1, end(), pos); + } + pop_back(); + return pos; + } + + ElementType* erase(ElementType* first, ElementType* last) { + ElementType* i = std::copy(last, end(), first); + typedef typename has_trivial_destructor::value htd; + detail::destroy_array_elements(i, end(), htd()); + m_decr_size(last - first); + return first; + } + + void resize(size_type const& new_size, ElementType const& x) { + if (new_size < size()) { + erase(begin() + new_size, end()); + } + else { + insert(end(), new_size - size(), x); + } + } + + void resize(size_type const& new_size) { + resize(new_size, ElementType()); + } + + void clear() { + erase(begin(), end()); + } + +#if !(defined(BOOST_MSVC) && BOOST_MSVC <= 1200) // VC++ 6.0 + // non-std + template + void + assign(const OtherElementType* first, const OtherElementType* last) { + clear(); + size_type sz = last - first; + reserve(sz); + uninitialized_copy_typeconv(first, last, begin()); + m_set_size(sz); + } +#endif + + // non-std + template + void + assign(OtherArrayType const& other) { + if (other.size() == 0) { + clear(); + } + else { + assign(&*(other.begin()), (&*(other.begin()))+other.size()); + } + } diff --git a/extern/cctbx/include/scitbx/array_family/detail/reducing_boolean_mem_fun.h b/extern/cctbx/include/scitbx/array_family/detail/reducing_boolean_mem_fun.h new file mode 100644 index 00000000..17dbc8da --- /dev/null +++ b/extern/cctbx/include/scitbx/array_family/detail/reducing_boolean_mem_fun.h @@ -0,0 +1,76 @@ +// Included from tiny.h, small.h, shared.h, versa.h +// DO NOT INCLUDE THIS FILE DIRECTLY. + + bool all_eq(base_class const& other) const + { + return this->const_ref().all_eq(other.const_ref()); + } + + bool all_eq(ElementType const& other) const + { + return this->const_ref().all_eq(other); + } + + bool all_ne(base_class const& other) const + { + return this->const_ref().all_ne(other.const_ref()); + } + + bool all_ne(ElementType const& other) const + { + return this->const_ref().all_ne(other); + } + + bool all_lt(base_class const& other) const + { + return this->const_ref().all_lt(other.const_ref()); + } + + bool all_lt(ElementType const& other) const + { + return this->const_ref().all_lt(other); + } + + bool all_gt(base_class const& other) const + { + return this->const_ref().all_gt(other.const_ref()); + } + + bool all_gt(ElementType const& other) const + { + return this->const_ref().all_gt(other); + } + + bool all_le(base_class const& other) const + { + return this->const_ref().all_le(other.const_ref()); + } + + bool all_le(ElementType const& other) const + { + return this->const_ref().all_le(other); + } + + bool all_ge(base_class const& other) const + { + return this->const_ref().all_ge(other.const_ref()); + } + + bool all_ge(ElementType const& other) const + { + return this->const_ref().all_ge(other); + } + + bool all_approx_equal( + base_class const& other, + ElementType const& tolerance) const + { + return this->const_ref().all_approx_equal(other.const_ref(),tolerance); + } + + bool all_approx_equal( + ElementType const& other, + ElementType const& tolerance) const + { + return this->const_ref().all_approx_equal(other, tolerance); + } diff --git a/extern/cctbx/include/scitbx/array_family/detail/ref_helpers.h b/extern/cctbx/include/scitbx/array_family/detail/ref_helpers.h new file mode 100644 index 00000000..7d6365fd --- /dev/null +++ b/extern/cctbx/include/scitbx/array_family/detail/ref_helpers.h @@ -0,0 +1,90 @@ +// Included from ref.h +// DO NOT INCLUDE THIS FILE DIRECTLY. + +#include + +namespace scitbx { namespace af { namespace detail { + + template + class ref_reverse_iterator + : public boost::random_access_iterator_helper, T> + { + T* p; + typedef ref_reverse_iterator self; + typedef std::ptrdiff_t Distance; + public: + ref_reverse_iterator() : p(0) {} + explicit ref_reverse_iterator(T* beg) : p(beg-1) {} + ref_reverse_iterator(self const& i) : p(i.p) {} + self& operator=(self const& x) { p = x.p; return *this; } + T& operator*() const { return *p; } + bool operator==(self const& i) const { return p == i.p; } + bool operator<(self const& i) const { return p > i.p; } + self& operator++() { p--; return *this; } + self& operator--() { p++; return *this; } + self& operator+=(Distance n) { p -= n; return *this; } + self& operator-=(Distance n) { p += n; return *this; } + friend Distance operator-(self const& i, self const& j) { + return j.p - i.p; + } + }; +}}} + +#define SCITBX_ARRAY_FAMILY_TYPEDEFS \ +typedef ElementType value_type; \ +typedef ElementType* iterator; \ +typedef const ElementType* const_iterator; \ +typedef detail::ref_reverse_iterator reverse_iterator; \ +typedef detail::ref_reverse_iterator const_reverse_iterator; \ +typedef ElementType& reference; \ +typedef ElementType const& const_reference; \ +typedef std::size_t size_type; \ +typedef std::ptrdiff_t difference_type; + +#define SCITBX_ARRAY_FAMILY_BEGIN_END_ETC(this_type, beg, sz) \ +ElementType* begin() { return beg; } \ +const ElementType* begin() const { return beg; } \ +ElementType* end() { return beg+sz; } \ +const ElementType* end() const { return beg+sz; } \ +reverse_iterator rbegin() { return reverse_iterator(beg+sz); } \ +const_reverse_iterator rbegin() const { return const_reverse_iterator(beg+sz); } \ +reverse_iterator rend() { return reverse_iterator(beg); } \ +const_reverse_iterator rend() const { return const_reverse_iterator(beg); } \ +ElementType& front() { return beg[0]; } \ +ElementType const& front() const { return beg[0]; } \ +ElementType& back() { return beg[sz-1]; } \ +ElementType const& back() const { return beg[sz-1]; } \ + \ +ElementType& operator[](size_type i) { return beg[i]; } \ +ElementType const& operator[](size_type i) const { return beg[i]; } \ + \ +ElementType& at(size_type i) { \ + if (i >= sz) throw_range_error(); return beg[i]; \ +} \ +ElementType const& at(size_type i) const { \ + if (i >= sz) throw_range_error(); return beg[i]; \ +} \ +this_type& fill(ElementType const& x) { \ + std::fill(this->begin(), this->end(), x); \ + return *this; \ +} + +#define SCITBX_ARRAY_FAMILY_TAKE_REF(beg, sz) \ +af::ref \ +ref() { \ + return af::ref(beg, sz); \ +} \ +af::const_ref \ +const_ref() const { \ + return af::const_ref(beg, sz); \ +} + +#define SCITBX_ARRAY_FAMILY_TAKE_VERSA_REF(beg, ac) \ +af::ref \ +ref() { \ + return af::ref(beg, ac); \ +} \ +af::const_ref \ +const_ref() const { \ + return af::const_ref(beg, ac); \ +} diff --git a/extern/cctbx/include/scitbx/array_family/detail/std_imports.h b/extern/cctbx/include/scitbx/array_family/detail/std_imports.h new file mode 100644 index 00000000..4f13a88e --- /dev/null +++ b/extern/cctbx/include/scitbx/array_family/detail/std_imports.h @@ -0,0 +1,317 @@ +/* ***************************************************** + THIS IS AN AUTOMATICALLY GENERATED FILE. DO NOT EDIT. + ***************************************************** + + Generated by: + scitbx.source_generators.array_family.generate_std_imports + */ + +#ifndef SCITBX_ARRAY_FAMILY_STD_IMPORTS_H +#define SCITBX_ARRAY_FAMILY_STD_IMPORTS_H + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + +#include +#include +#include + +namespace scitbx { namespace fn { + + using std::acos; + using std::cos; + using std::tan; + using std::asin; + using std::cosh; + using std::tanh; + using std::atan; + using std::exp; + using std::sin; + using std::fabs; + using std::log; + using std::sinh; + using std::ceil; + using std::floor; + using std::log10; + using std::sqrt; + using std::fmod; + using std::pow; + using std::atan2; + using std::abs; + using std::min; + using std::max; + using std::conj; + using std::real; + using std::imag; + using std::arg; + using std::norm; + using std::polar; + + template + struct functor_acos { + typedef ResultType result_type; + ResultType operator()(ArgumentType const& x) const { + return ResultType(acos(x)); + } + }; + + template + struct functor_cos { + typedef ResultType result_type; + ResultType operator()(ArgumentType const& x) const { + return ResultType(cos(x)); + } + }; + + template + struct functor_tan { + typedef ResultType result_type; + ResultType operator()(ArgumentType const& x) const { + return ResultType(tan(x)); + } + }; + + template + struct functor_asin { + typedef ResultType result_type; + ResultType operator()(ArgumentType const& x) const { + return ResultType(asin(x)); + } + }; + + template + struct functor_cosh { + typedef ResultType result_type; + ResultType operator()(ArgumentType const& x) const { + return ResultType(cosh(x)); + } + }; + + template + struct functor_tanh { + typedef ResultType result_type; + ResultType operator()(ArgumentType const& x) const { + return ResultType(tanh(x)); + } + }; + + template + struct functor_atan { + typedef ResultType result_type; + ResultType operator()(ArgumentType const& x) const { + return ResultType(atan(x)); + } + }; + + template + struct functor_exp { + typedef ResultType result_type; + ResultType operator()(ArgumentType const& x) const { + return ResultType(exp(x)); + } + }; + + template + struct functor_sin { + typedef ResultType result_type; + ResultType operator()(ArgumentType const& x) const { + return ResultType(sin(x)); + } + }; + + template + struct functor_fabs { + typedef ResultType result_type; + ResultType operator()(ArgumentType const& x) const { + return ResultType(fabs(x)); + } + }; + + template + struct functor_log { + typedef ResultType result_type; + ResultType operator()(ArgumentType const& x) const { + return ResultType(log(x)); + } + }; + + template + struct functor_sinh { + typedef ResultType result_type; + ResultType operator()(ArgumentType const& x) const { + return ResultType(sinh(x)); + } + }; + + template + struct functor_ceil { + typedef ResultType result_type; + ResultType operator()(ArgumentType const& x) const { + return ResultType(ceil(x)); + } + }; + + template + struct functor_floor { + typedef ResultType result_type; + ResultType operator()(ArgumentType const& x) const { + return ResultType(floor(x)); + } + }; + + template + struct functor_log10 { + typedef ResultType result_type; + ResultType operator()(ArgumentType const& x) const { + return ResultType(log10(x)); + } + }; + + template + struct functor_sqrt { + typedef ResultType result_type; + ResultType operator()(ArgumentType const& x) const { + return ResultType(sqrt(x)); + } + }; + + template + struct functor_abs { + typedef ResultType result_type; + ResultType operator()(ArgumentType const& x) const { + return ResultType(abs(x)); + } + }; + + template + struct functor_conj { + typedef ResultType result_type; + ResultType operator()(ArgumentType const& x) const { + return ResultType(conj(x)); + } + }; + + template + struct functor_real { + typedef ResultType result_type; + ResultType operator()(ArgumentType const& x) const { + return ResultType(real(x)); + } + }; + + template + struct functor_imag { + typedef ResultType result_type; + ResultType operator()(ArgumentType const& x) const { + return ResultType(imag(x)); + } + }; + + template + struct functor_arg { + typedef ResultType result_type; + ResultType operator()(ArgumentType const& x) const { + return ResultType(arg(x)); + } + }; + + template + struct functor_norm { + typedef ResultType result_type; + ResultType operator()(ArgumentType const& x) const { + return ResultType(norm(x)); + } + }; + + template + struct functor_fmod { + typedef ResultType result_type; + ResultType operator()(ArgumentType1 const& x, + ArgumentType2 const& y) const { + return ResultType(fmod(x, y)); + } + }; + + template + struct functor_pow { + typedef ResultType result_type; + ResultType operator()(ArgumentType1 const& x, + ArgumentType2 const& y) const { + return ResultType(pow(x, y)); + } + }; + + template + struct functor_atan2 { + typedef ResultType result_type; + ResultType operator()(ArgumentType1 const& x, + ArgumentType2 const& y) const { + return ResultType(atan2(x, y)); + } + }; + + template + struct functor_each_min { + typedef ResultType result_type; + ResultType operator()(ArgumentType1 const& x, + ArgumentType2 const& y) const { + return ResultType(min(x, y)); + } + }; + + template + struct functor_each_max { + typedef ResultType result_type; + ResultType operator()(ArgumentType1 const& x, + ArgumentType2 const& y) const { + return ResultType(max(x, y)); + } + }; + + template + struct functor_polar { + typedef ResultType result_type; + ResultType operator()(ArgumentType1 const& x, + ArgumentType2 const& y) const { + return ResultType(polar(x, y)); + } + }; + +}} // namespace scitbx::af + +#endif // DOXYGEN_SHOULD_SKIP_THIS + +#endif // SCITBX_ARRAY_FAMILY_STD_IMPORTS_H diff --git a/extern/cctbx/include/scitbx/array_family/detail/tiny_helpers.h b/extern/cctbx/include/scitbx/array_family/detail/tiny_helpers.h new file mode 100644 index 00000000..c2ca9f59 --- /dev/null +++ b/extern/cctbx/include/scitbx/array_family/detail/tiny_helpers.h @@ -0,0 +1,162 @@ +// Included from tiny_plain.h +// DO NOT INCLUDE THIS FILE DIRECTLY. + +#define SCITBX_ARRAY_FAMILY_TINY_CONVENIENCE_CONSTRUCTORS(class_name) \ +explicit \ +class_name( \ + value_type const& v0 \ +) { \ + this->elems[0] = v0; \ +} \ +class_name( \ + value_type const& v0, \ + value_type const& v1 \ +) { \ + this->elems[0] = v0; \ + this->elems[1] = v1; \ +} \ +class_name( \ + value_type const& v0, \ + value_type const& v1, \ + value_type const& v2 \ +) { \ + this->elems[0] = v0; \ + this->elems[1] = v1; \ + this->elems[2] = v2; \ +} \ +class_name( \ + value_type const& v0, \ + value_type const& v1, \ + value_type const& v2, \ + value_type const& v3 \ +) { \ + this->elems[0] = v0; \ + this->elems[1] = v1; \ + this->elems[2] = v2; \ + this->elems[3] = v3; \ +} \ +class_name( \ + value_type const& v0, \ + value_type const& v1, \ + value_type const& v2, \ + value_type const& v3, \ + value_type const& v4 \ +) { \ + this->elems[0] = v0; \ + this->elems[1] = v1; \ + this->elems[2] = v2; \ + this->elems[3] = v3; \ + this->elems[4] = v4; \ +} \ +class_name( \ + value_type const& v0, \ + value_type const& v1, \ + value_type const& v2, \ + value_type const& v3, \ + value_type const& v4, \ + value_type const& v5 \ +) { \ + this->elems[0] = v0; \ + this->elems[1] = v1; \ + this->elems[2] = v2; \ + this->elems[3] = v3; \ + this->elems[4] = v4; \ + this->elems[5] = v5; \ +} \ +class_name( \ + value_type const& v0, \ + value_type const& v1, \ + value_type const& v2, \ + value_type const& v3, \ + value_type const& v4, \ + value_type const& v5, \ + value_type const& v6 \ +) { \ + this->elems[0] = v0; \ + this->elems[1] = v1; \ + this->elems[2] = v2; \ + this->elems[3] = v3; \ + this->elems[4] = v4; \ + this->elems[5] = v5; \ + this->elems[6] = v6; \ +} \ +class_name( \ + value_type const& v0, \ + value_type const& v1, \ + value_type const& v2, \ + value_type const& v3, \ + value_type const& v4, \ + value_type const& v5, \ + value_type const& v6, \ + value_type const& v7 \ +) { \ + this->elems[0] = v0; \ + this->elems[1] = v1; \ + this->elems[2] = v2; \ + this->elems[3] = v3; \ + this->elems[4] = v4; \ + this->elems[5] = v5; \ + this->elems[6] = v6; \ + this->elems[7] = v7; \ +} \ +class_name( \ + value_type const& v0, \ + value_type const& v1, \ + value_type const& v2, \ + value_type const& v3, \ + value_type const& v4, \ + value_type const& v5, \ + value_type const& v6, \ + value_type const& v7, \ + value_type const& v8 \ +) { \ + this->elems[0] = v0; \ + this->elems[1] = v1; \ + this->elems[2] = v2; \ + this->elems[3] = v3; \ + this->elems[4] = v4; \ + this->elems[5] = v5; \ + this->elems[6] = v6; \ + this->elems[7] = v7; \ + this->elems[8] = v8; \ +} \ +class_name( \ + value_type const& v0, \ + value_type const& v1, \ + value_type const& v2, \ + value_type const& v3, \ + value_type const& v4, \ + value_type const& v5, \ + value_type const& v6, \ + value_type const& v7, \ + value_type const& v8, \ + value_type const& v9 \ +) { \ + this->elems[0] = v0; \ + this->elems[1] = v1; \ + this->elems[2] = v2; \ + this->elems[3] = v3; \ + this->elems[4] = v4; \ + this->elems[5] = v5; \ + this->elems[6] = v6; \ + this->elems[7] = v7; \ + this->elems[8] = v8; \ + this->elems[9] = v9; \ +} \ +template \ +class_name(const OtherElementType* first, const OtherElementType* last) { \ + if (last - first != this->size()) throw_range_error(); \ + copy_typeconv(first, last, this->begin()); \ +} + +#define SCITBX_ARRAY_FAMILY_TINY_COPY_AND_ASSIGNMENT(class_name) \ +template \ +class_name(tiny_plain const& rhs) { \ + copy_typeconv(rhs.begin(), rhs.end(), this->begin()); \ +} \ +template \ +class_name& \ +operator=(tiny_plain const& rhs) { \ + copy_typeconv(rhs.begin(), rhs.end(), this->begin()); \ + return *this; \ +} diff --git a/extern/cctbx/include/scitbx/array_family/error.h b/extern/cctbx/include/scitbx/array_family/error.h new file mode 100644 index 00000000..28da9c88 --- /dev/null +++ b/extern/cctbx/include/scitbx/array_family/error.h @@ -0,0 +1,19 @@ +#ifndef SCITBX_ARRAY_FAMILY_ERROR_H +#define SCITBX_ARRAY_FAMILY_ERROR_H + +#include + +// FIXES for broken compilers +#include + +namespace scitbx { namespace af { + + inline + void throw_range_error() + { + throw std::range_error("scitbx array_family range error"); + } + +}} // namespace scitbx::af + +#endif // SCITBX_ARRAY_FAMILY_ERROR_H diff --git a/extern/cctbx/include/scitbx/array_family/loops.h b/extern/cctbx/include/scitbx/array_family/loops.h new file mode 100644 index 00000000..11893aa2 --- /dev/null +++ b/extern/cctbx/include/scitbx/array_family/loops.h @@ -0,0 +1,112 @@ +#ifndef SCITBX_ARRAY_FAMILY_LOOPS_H +#define SCITBX_ARRAY_FAMILY_LOOPS_H + +#include +#include +#include + +#include // FIXES for broken compilers + +namespace scitbx { namespace af { + + template + class nested_loop + { + public: + nested_loop() : over_(true) {} + + explicit + nested_loop(typename ArrayType::value_type const& end) + : + over_(end == 0) + { + SCITBX_ASSERT(end >= 0); + std::fill(begin_.begin(), begin_.end(), 0); + std::fill(end_.begin(), end_.end(), end); + current_ = begin_; + } + + nested_loop( + typename ArrayType::value_type const& begin, + typename ArrayType::value_type const& end) + : + over_(end == begin) + { + SCITBX_ASSERT(end >= begin); + std::fill(begin_.begin(), begin_.end(), begin); + std::fill(end_.begin(), end_.end(), end); + current_ = begin_; + } + + explicit + nested_loop( + ArrayType const& end, + bool open_range=true) + : + begin_(end), end_(end), current_(end), over_(true) + { + std::fill(begin_.begin(), begin_.end(), 0); + current_ = begin_; + adjust_end_and_over(open_range); + } + + nested_loop( + ArrayType const& begin, + ArrayType const& end, + bool open_range=true) + : + begin_(begin), end_(end), current_(begin), over_(true) + { + SCITBX_ASSERT(begin_.size() == end_.size()); + adjust_end_and_over(open_range); + } + + bool + incr() + { + for (std::size_t i = current_.size(); i != 0;) { + i--; + current_[i]++; + if (current_[i] < end_[i]) return true; + current_[i] = begin_[i]; + } + over_ = true; + return false; + } + + ArrayType const& + begin() const { return begin_; } + + ArrayType const& + end() const { return end_; } + + ArrayType const& + operator()() const { return current_; } + + bool over() + const { return over_; } + + protected: + ArrayType begin_; + ArrayType end_; + ArrayType current_; + bool over_; + + void + adjust_end_and_over(bool open_range) + { + if (!open_range) { + for(std::size_t i=0;i= begin_[i]); + if (end_[i] > begin_[i]) over_ = false; + } + } + }; + +}} // namespace scitbx::af + +#endif // SCITBX_ARRAY_FAMILY_LOOPS_H diff --git a/extern/cctbx/include/scitbx/array_family/memory.h b/extern/cctbx/include/scitbx/array_family/memory.h new file mode 100644 index 00000000..85a62ea5 --- /dev/null +++ b/extern/cctbx/include/scitbx/array_family/memory.h @@ -0,0 +1,105 @@ +#ifndef SCITBX_ARRAY_FAMILY_MEMORY_H +#define SCITBX_ARRAY_FAMILY_MEMORY_H + +/* + On some platforms std::malloc is 16-byte aligned: + - glibc 2.8 onwards on 64 bit system: + http://www.gnu.org/s/libc/manual/html_node/Aligned-Memory-Blocks.html + the version requirement is lifted from the Eigen library + (c.f. comments in src/Core/util/Memory.h) + - MacOS X + - 64-bit Windows + + POSIX provides posix_memalign if the Advanced Real Time option group is present, + which is detected by looking at _POSIX_ADVISORY_INFO e.g. + as per http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap02.html + POSIX itself is detected with _XOPEN_SOURCE as per the same document. + + */ +#if ( \ +defined(__GLIBC__) \ +&& ((__GLIBC__>= 2 && __GLIBC_MINOR__ >= 8) || __GLIBC__>2) \ +&& defined(__LP64__) \ +) \ +|| \ +defined(__APPLE__) \ +|| \ +defined(_WIN64) + +#define SCITBX_AF_HAS_ALIGNED_MALLOC 1 +#define SCITBX_AF_USE_STD_FOR_ALIGNED_MALLOC 1 + +#elif defined(_MSC_VER) + +#define SCITBX_AF_HAS_ALIGNED_MALLOC 1 +#define SCITBX_AF_USE_WIN32_FOR_ALIGNED_MALLOC 1 + +#elif defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE - 0) >= 600 && defined(_POSIX_ADVISORY_INFO) + +#define SCITBX_AF_HAS_ALIGNED_MALLOC 1 +#define SCITBX_AF_USE_POSIX_FOR_ALIGNED_MALLOC 1 + +#endif + + + +#ifdef SCITBX_AF_USE_STD_FOR_ALIGNED_MALLOC +#include +#endif + +#ifdef SCITBX_AF_USE_POSIX_FOR_ALIGNED_MALLOC +#include +#include +#endif + +namespace scitbx { namespace af { + + /// Like std::malloc but the returned pointer is aligned on 16-byte boundaries + /** This is essential for efficient SSE 2 code on Intel processors */ + void *aligned_malloc(std::size_t n); + + /// Free memory allocated by aligned_malloc + void aligned_free(void *p); + + +#ifdef SCITBX_AF_USE_STD_FOR_ALIGNED_MALLOC + inline + void *aligned_malloc(std::size_t n) { + return std::malloc(n); + } + + inline + void aligned_free(void *p) { + std::free(p); + } +#endif + +#ifdef SCITBX_AF_USE_POSIX_FOR_ALIGNED_MALLOC + inline + void *aligned_malloc(std::size_t n) { + void *result; + if(posix_memalign(&result, 16, n)) throw std::bad_alloc(); + return result; + } + + inline + void aligned_free(void *p) { + std::free(p); + } +#endif + +#ifdef SCITBX_AF_USE_WIN32_FOR_ALIGNED_MALLOC + inline + void *aligned_malloc(std::size_t n) { + return _aligned_malloc(n, 16); + } + + inline + void aligned_free(void *p) { + _aligned_free(p); + } +#endif + +}} + + + +#endif diff --git a/extern/cctbx/include/scitbx/array_family/misc_functions.h b/extern/cctbx/include/scitbx/array_family/misc_functions.h new file mode 100644 index 00000000..32ac8108 --- /dev/null +++ b/extern/cctbx/include/scitbx/array_family/misc_functions.h @@ -0,0 +1,149 @@ +#ifndef SCITBX_ARRAY_FAMILY_MISC_FUNCTIONS_H +#define SCITBX_ARRAY_FAMILY_MISC_FUNCTIONS_H + +#include +#include +#include + +namespace scitbx { namespace fn { + + namespace details { + + template + class absolute + { + public: + NumType operator()(NumType x) { + return (*this)(x, typename boost::is_unsigned::type()); + } + + private: + /* boost::is_unsigned is false by default, which makes + this version the default, and the other one the version used only + for those types explicitly marked as unsigned. + */ + NumType operator()(NumType x, boost::false_type is_unsigned) { + return std::abs(x); + } + + NumType operator()(NumType x, boost::true_type is_unsigned) { + return x; + } + }; + } + + //! Absolute value. + template + inline + NumType + absolute(NumType const& x) + { + return details::absolute()(x); + } + + //! Floating-point modulus with strictly positive result. + template + inline + FloatType1 + fmod_positive(FloatType1 const& x, FloatType2 const& y) + { + FloatType1 result = std::fmod(x, y); + while (result < FloatType1(0)) result += y; + return result; + } + + //! Square of x. + template + inline + NumType + pow2(NumType const& x) + { + return x * x; + } + + //! Cube of x. + // Not available as array function. + template + inline + NumType + pow3(NumType const& x) + { + return x * x * x; + } + + //! Fourth power of x. + // Not available as array function. + template + inline + NumType + pow4(NumType const& x) + { + return pow2(pow2(x)); + } + + //! Tests if abs(a-b) <= tolerance. + template + bool + approx_equal(FloatType const& a, + FloatType const& b, + FloatType const& tolerance) + { + FloatType diff = a - b; + if (diff < 0.) diff = -diff; + if (diff <= tolerance) return true; + return false; + } + + //! Helper function object for array operations. + template + struct functor_absolute + { + typedef ResultType result_type; + ResultType operator()(ArgumentType const& x) const { + return ResultType(absolute(x)); + } + }; + + //! Helper function object for array operations. + template + struct functor_fmod_positive + { + typedef ResultType result_type; + ResultType + operator()(ArgumentType1 const& x, ArgumentType2 const& y) const + { + return ResultType(fmod_positive(x, y)); + } + }; + + //! Helper function object for array operations. + template + struct functor_pow2 + { + typedef ResultType result_type; + ResultType operator()(ArgumentType const& x) const { + return ResultType(pow2(x)); + } + }; + + //! Helper function object for array operations. + template + struct functor_approx_equal + { + typedef ResultType result_type; + ResultType operator()(ArgumentType1 const& x, + ArgumentType2 const& y, + ArgumentType3 const& z) const { + return ResultType(approx_equal(x, y, z)); } + }; + +}} // namespace scitbx::fn + +#endif // SCITBX_ARRAY_FAMILY_MISC_FUNCTIONS_H diff --git a/extern/cctbx/include/scitbx/array_family/operator_traits_builtin.h b/extern/cctbx/include/scitbx/array_family/operator_traits_builtin.h new file mode 100644 index 00000000..ca633759 --- /dev/null +++ b/extern/cctbx/include/scitbx/array_family/operator_traits_builtin.h @@ -0,0 +1,316 @@ +/* ***************************************************** + THIS IS AN AUTOMATICALLY GENERATED FILE. DO NOT EDIT. + ***************************************************** + + Generated by: + scitbx.source_generators.array_family.generate_operator_traits_builtin + */ + +#ifndef SCITBX_ARRAY_FAMILY_OPERATOR_TRAITS_BUILTIN_H +#define SCITBX_ARRAY_FAMILY_OPERATOR_TRAITS_BUILTIN_H + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + +#include + +namespace scitbx { namespace af { + + // The default traits: the result type is the type of the lhs argument. + template + struct binary_operator_traits { + typedef TypeLHS arithmetic; + }; + + // The remainder of this file defines the traits where the + // result type is the type of the rhs argument. + + template<> + struct binary_operator_traits { + typedef short arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef int arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef long arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef long long arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef float arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef double arithmetic; + }; + + template<> + struct binary_operator_traits > { + typedef std::complex arithmetic; + }; + + template<> + struct binary_operator_traits > { + typedef std::complex arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef int arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef long arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef long long arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef float arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef double arithmetic; + }; + + template<> + struct binary_operator_traits > { + typedef std::complex arithmetic; + }; + + template<> + struct binary_operator_traits > { + typedef std::complex arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef long arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef long long arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef float arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef double arithmetic; + }; + + template<> + struct binary_operator_traits > { + typedef std::complex arithmetic; + }; + + template<> + struct binary_operator_traits > { + typedef std::complex arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef long long arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef float arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef double arithmetic; + }; + + template<> + struct binary_operator_traits > { + typedef std::complex arithmetic; + }; + + template<> + struct binary_operator_traits > { + typedef std::complex arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef float arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef double arithmetic; + }; + + template<> + struct binary_operator_traits > { + typedef std::complex arithmetic; + }; + + template<> + struct binary_operator_traits > { + typedef std::complex arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef double arithmetic; + }; + + template<> + struct binary_operator_traits > { + typedef std::complex arithmetic; + }; + + template<> + struct binary_operator_traits > { + typedef std::complex arithmetic; + }; + + template<> + struct binary_operator_traits > { + typedef std::complex arithmetic; + }; + + template<> + struct binary_operator_traits > { + typedef std::complex arithmetic; + }; + + template<> + struct binary_operator_traits, double > { + typedef std::complex arithmetic; + }; + + template<> + struct binary_operator_traits, std::complex > { + typedef std::complex arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef float arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef float arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef double arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef double arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef float arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef float arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef double arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef double arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef float arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef float arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef double arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef double arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef float arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef float arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef double arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef double arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef float arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef float arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef double arithmetic; + }; + + template<> + struct binary_operator_traits { + typedef double arithmetic; + }; + +}} // namespace scitbx::af + +#endif // DOXYGEN_SHOULD_SKIP_THIS + +#endif // SCITBX_ARRAY_FAMILY_OPERATOR_TRAITS_BUILTIN_H diff --git a/extern/cctbx/include/scitbx/array_family/ref.h b/extern/cctbx/include/scitbx/array_family/ref.h new file mode 100644 index 00000000..30c6d8bc --- /dev/null +++ b/extern/cctbx/include/scitbx/array_family/ref.h @@ -0,0 +1,515 @@ +#ifndef SCITBX_ARRAY_FAMILY_REF_H +#define SCITBX_ARRAY_FAMILY_REF_H + +#include +#include +#include +#include +#include +#include +#include + +namespace scitbx { namespace af { + + template + class const_ref + { + public: + SCITBX_ARRAY_FAMILY_TYPEDEFS + + typedef AccessorType accessor_type; + typedef typename accessor_type::index_type index_type; + typedef typename accessor_type::index_value_type index_value_type; + + const_ref() {} + + const_ref(const ElementType* begin, accessor_type const& accessor) + : begin_(begin), accessor_(accessor) + { + init(); + } + + // convenience constructors + const_ref(const ElementType* begin, index_value_type const& n0) + : begin_(begin), accessor_(n0) + { + init(); + } + + const_ref(const ElementType* begin, index_value_type const& n0, + index_value_type const& n1) + : begin_(begin), accessor_(n0, n1) + { + init(); + } + + const_ref(const ElementType* begin, index_value_type const& n0, + index_value_type const& n1, + index_value_type const& n2) + : begin_(begin), accessor_(n0, n1, n2) + { + init(); + } + + accessor_type const& accessor() const { return accessor_; } + size_type size() const { return size_; } + + /// Matrix ref interface (only make sense for relevant accessors) + //@{ + bool is_square() const { return accessor_.is_square(); } + std::size_t n_rows() const { return accessor_.n_rows(); } + std::size_t n_columns() const { return accessor_.n_columns(); } + + bool is_diagonal(bool require_square=true) const; + //@} + + + const ElementType* begin() const { return begin_; } + const ElementType* end() const { return end_; } + const_reverse_iterator rbegin() const { + return const_reverse_iterator(end_); + } + const_reverse_iterator rend() const { + return const_reverse_iterator(begin_); + } + ElementType const& front() const { return begin_[0]; } + ElementType const& back() const { return end_[-1]; } + + ElementType const& + operator[](size_type i) const { return begin_[i]; } + + ElementType const& + at(size_type i) const + { + if (i >= size_) throw_range_error(); + return begin_[i]; + } + + const_ref + as_1d() const + { + return const_ref(begin_, size_); + } + + value_type const& + operator()(index_type const& i) const + { + return begin_[accessor_(i)]; + } + + // Convenience operator() + value_type const& operator()(index_value_type const& i0) const + { + return begin_[accessor_(i0)]; + } + + value_type const& operator()(index_value_type const& i0, + index_value_type const& i1) const + { + return begin_[accessor_(i0, i1)]; + } + + value_type const& operator()(index_value_type const& i0, + index_value_type const& i1, + index_value_type const& i2) const + { + return begin_[accessor_(i0, i1, i2)]; + } + + bool all_eq(const_ref const& other) const; + + bool all_eq(ElementType const& other) const; + + bool all_ne(const_ref const& other) const; + + bool all_ne(ElementType const& other) const; + + bool all_lt(const_ref const& other) const; + + bool all_lt(ElementType const& other) const; + + bool all_gt(const_ref const& other) const; + + bool all_gt(ElementType const& other) const; + + bool all_le(const_ref const& other) const; + + bool all_le(ElementType const& other) const; + + bool all_ge(const_ref const& other) const; + + bool all_ge(ElementType const& other) const; + + bool + all_approx_equal( + const_ref const& other, + typename scitbx::math::abs_traits< + ElementType>::result_type const& tolerance) const; + + bool + all_approx_equal( + ElementType const& other, + typename scitbx::math::abs_traits< + ElementType>::result_type const& tolerance) const; + + bool + all_approx_equal_relatively( + const_ref const& other, + typename scitbx::math::abs_traits< + ElementType>::result_type const& relative_error) const; + + bool + all_approx_equal_relatively( + ElementType const& other, + typename scitbx::math::abs_traits< + ElementType>::result_type const& relative_error) const; + + protected: + void + init() + { + size_ = accessor_.size_1d(); + end_ = begin_ + size_; + } + + const ElementType* begin_; + accessor_type accessor_; + size_type size_; + const ElementType* end_; + }; + + template + bool + const_ref::is_diagonal(bool require_square) const { + if (require_square && !is_square()) return false; + for (index_value_type ir=0;ir class expression; + + + template + class ref : public const_ref + { + public: + SCITBX_ARRAY_FAMILY_TYPEDEFS + + typedef const_ref base_class; + typedef AccessorType accessor_type; + typedef typename accessor_type::index_type index_type; + typedef typename accessor_type::index_value_type index_value_type; + + ref() {} + + ref(ElementType* begin, accessor_type accessor) + : base_class(begin, accessor) + {} + + // convenience constructors + ref(ElementType* begin, index_value_type const& n0) + : base_class(begin, n0) + {} + + ref(ElementType* begin, index_value_type const& n0, + index_value_type const& n1) + : base_class(begin, n0, n1) + {} + + ref(ElementType* begin, index_value_type const& n0, + index_value_type const& n1, + index_value_type const& n2) + : base_class(begin, n0, n1, n2) + {} + + template + ref &operator=(expression const &e); + + template + ref &operator+=(expression const &e); + + template + ref &operator-=(expression const &e); + + template + ref &operator*=(expression const &e); + + ElementType* + begin() const { return const_cast(this->begin_); } + + ElementType* + end() const { return const_cast(this->end_); } + + reverse_iterator rbegin() const { + return reverse_iterator(this->end()); + } + + reverse_iterator rend() const { + return reverse_iterator(this->begin()); + } + + ElementType& + front() const { return begin()[0]; } + + ElementType& + back() const { return end()[-1]; } + + ElementType& + operator[](size_type i) const { return begin()[i]; } + + ElementType& + at(size_type i) const + { + if (i >= this->size_) throw_range_error(); + return begin()[i]; + } + + ref const& + fill(ElementType const& x) const + { + std::fill(begin(), end(), x); + return *this; + } + + ref + as_1d() const + { + return ref(this->begin(), this->size_); + } + + value_type& + operator()(index_type const& i) const + { + return begin()[this->accessor_(i)]; + } + + // Convenience operator() + value_type& + operator()(index_value_type const& i0) const + { + return begin()[this->accessor_(i0)]; + } + + value_type& + operator()(index_value_type const& i0, + index_value_type const& i1) const + { + return begin()[this->accessor_(i0, i1)]; + } + + value_type& + operator()(index_value_type const& i0, + index_value_type const& i1, + index_value_type const& i2) const + { + return begin()[this->accessor_(i0, i1, i2)]; + } + + /// Matrix ref interface (only make sense for relevant accessors) + //@{ + + //! Swaps two rows in place. + void + swap_rows(index_value_type const& i1, index_value_type const& i2) const + { + std::swap_ranges(&(*this)(i1,0), &(*this)(i1+1,0), &(*this)(i2,0)); + } + + //! Swaps two columns in place. + void + swap_columns(index_value_type const& i1, + index_value_type const& i2) const + { + for(index_value_type ir=0;irn_rows();ir++) { + std::swap((*this)(ir,i1), (*this)(ir,i2)); + } + } + + //! Sets diagonal matrix. + /*! Off-diagonal elements are set to zero. + */ + void set_diagonal(ElementType const& d, bool require_square=true) const { + SCITBX_ASSERT(!require_square || this->is_square()); + this->fill(0); + index_value_type m = this->n_rows(), n = this->n_columns(); + for(index_value_type i=0; i < std::min(m,n); i++) (*this)(i,i) = d; + } + + //! Sets diagonal matrix. + /*! Off-diagonal elements are set to zero. + */ + void set_diagonal(af::const_ref const& d, + bool require_square=true) const + { + SCITBX_ASSERT(!require_square || this->is_square()); + SCITBX_ASSERT(this->n_rows() >= d.size()); + SCITBX_ASSERT(this->n_columns() >= d.size()); + this->fill(0); + index_value_type m = this->n_rows(), n = this->n_columns(); + for(index_value_type i=0; i < d.size(); i++) (*this)(i,i) = d[i]; + } + + //! Sets identity matrix. + /*! Off-diagonal elements are set to zero. + */ + void set_identity(bool require_square=true) const { + set_diagonal(1, require_square); + } + + /// Efficiently transpose a square matrix in-place + void transpose_square_in_place() const { + SCITBX_ASSERT(this->is_square()); + for (index_value_type ir=0;irn_rows();ir++) + for (index_value_type ic=ir+1;icn_columns();ic++) + std::swap((*this)(ir, ic), (*this)(ic, ir)); + } + + /// Transpose a matrix in-place. + /** It involves a copy if it is not squared. */ + void transpose_in_place(); + + //@} + }; + + template + void ref::transpose_in_place() { + if (this->is_square()) { + this->transpose_square_in_place(); + } + else { + boost::scoped_array mt_buffer(new ElementType[this->size()]); + ref mt(mt_buffer.get(), this->n_columns(), this->n_rows()); + for (index_value_type ir=0;irn_rows();ir++) + for (index_value_type ic=0;icn_columns();ic++) + mt(ic, ir) = (*this)(ir, ic); + std::copy(mt.begin(), mt.end(), this->begin()); + this->accessor_ = mt.accessor(); + this->init(); + } + } + + template + const_ref + make_const_ref(ArrayType const& a) + { + typedef typename ArrayType::value_type value_type; + typedef const_ref return_type; + typedef typename return_type::accessor_type accessor_type; + return return_type( + (a.size() == 0 ? 0 : &(*(a.begin()))), + accessor_type(a.size())); + } + + template + ref + make_ref(ArrayType& a) + { + typedef typename ArrayType::value_type value_type; + typedef ref return_type; + typedef typename return_type::accessor_type accessor_type; + return return_type( + (a.size() == 0 ? 0 : &(*(a.begin()))), + accessor_type(a.size())); + } + + /// Wrapper for expression template + /** This class is just a wrapper, which shall be inherited using the CRTP: + + class foo : public af::expression; + + Each member function of expression forward to E's member function + with the same name. Thus E shall implement those member functions + which makes sense to its concept. + + See scitbx::sparse::matrix_times_dense_vector for a real-life example + and scitbx/sparse/tests/tst_sparse for the natural syntax made + possible by this mechanism + */ + template + class expression + { + public: + E const &heir() const { return static_cast(*this); } + + /// Total number of elements + std::size_t size() const { return heir().size(); } + + /// Accessor + template + AccessorType accessor(AccessorType const &proto) const { + return heir().expression_accessor(proto); + } + + /// Assign the elements of the expression to the memory referred to by x + template + void assign_to(af::ref const &x) const + { + heir().assign_to(x); + } + + /// Add the elements of the expression to the memory referred to by x + template + void add_to(af::ref const &x) const + { + heir().add_to(x); + } + + /// Substract the elements of the expression from the memory referred to by x + template + void substract_from(af::ref const &x) const + { + heir().substract_from(x); + } + + /// Multiply the elements of the expression to the memory referred to by x + template + void multiply_with(af::ref const &x) const + { + heir().multiply_with(x); + } + }; + + template + template + inline + ref + &ref::operator=(expression const &e) { + e.assign_to(*this); + return *this; + } + + template + template + inline + ref + &ref::operator+=(expression const &e) { + e.add_to(*this); + return *this; + } + + template + template + inline + ref + &ref::operator-=(expression const &e) { + e.substract_from(*this); + return *this; + } + + template + template + inline + ref + &ref::operator*=(expression const &e) { + e.multiply_with(*this); + return *this; + } + + }} // namespace scitbx::af + +#endif // SCITBX_ARRAY_FAMILY_REF_H diff --git a/extern/cctbx/include/scitbx/array_family/ref_reductions.h b/extern/cctbx/include/scitbx/array_family/ref_reductions.h new file mode 100644 index 00000000..0bc1aba4 --- /dev/null +++ b/extern/cctbx/include/scitbx/array_family/ref_reductions.h @@ -0,0 +1,521 @@ +#ifndef SCITBX_ARRAY_FAMILY_REDUCTIONS_H +#define SCITBX_ARRAY_FAMILY_REDUCTIONS_H + +#include +#include +#include +#include +#include +#include + +namespace scitbx { namespace af { + + template + int + order( + const_ref const& a1, + const_ref const& a2) + { + std::size_t sz_min = (a1.size() < a2.size() ? a1.size() : a2.size()); + for(std::size_t i=0;i + std::size_t + max_index(const_ref const& a) + { + if (a.size() == 0) { + throw std::runtime_error("max_index() argument is an empty array"); + } + std::size_t result = 0; + for(std::size_t i=1;i + std::size_t + min_index(const_ref const& a) + { + if (a.size() == 0) { + throw std::runtime_error("min_index() argument is an empty array"); + } + std::size_t result = 0; + for(std::size_t i=1;i a[i]) result = i; + } + return result; + } + + template + boost::optional + first_index(const_ref const& a, + PredicateType p) + { + typedef + typename const_ref::const_iterator + iter; + boost::optional result; + iter i = std::find_if(a.begin(), a.end(), p); + if (i != a.end()) result = i - a.begin(); + return result; + } + + template + boost::optional + last_index(const_ref const& a, + PredicateType p) + { + typedef + typename const_ref::const_reverse_iterator + iter; + boost::optional result; + iter i = std::find_if(a.rbegin(), a.rend(), p); + if (i != a.rend()) result = a.rend() - i - 1; + return result; + } + + template + ElementType + max(const_ref const& a) + { + if (a.size() == 0) { + throw std::runtime_error("max() argument is an empty array"); + } + ElementType result = a[0]; + for(std::size_t i=1;i + ElementType + min(const_ref const& a) + { + if (a.size() == 0) { + throw std::runtime_error("min() argument is an empty array"); + } + ElementType result = a[0]; + for(std::size_t i=1;i a[i]) result = a[i]; + } + return result; + } + + template + ElementType + max_absolute(const_ref const& a) + { + if (a.size() == 0) { + throw std::runtime_error("max_absolute() argument is an empty array"); + } + ElementType result = fn::absolute(a[0]); + for(std::size_t i=1;i 0) { + if (result < ai) result = ai; + } + else { + if (result < -ai) result = -ai; + } + } + return result; + } + + template + ElementType + sum(const_ref const& a) + { + ElementType result = 0; + for(std::size_t i=0;i + ElementType + sum_sq(const_ref const& a) + { + ElementType result = 0; + for(std::size_t i=0;i + ElementType + sum_sq(const_ref, AccessorType> const& a) + { + ElementType result = 0; + for(std::size_t i=0;i + ElementType + norm(const_ref const& a) + { + return std::sqrt(sum_sq(a)); + } + + template + ElementType + product(const_ref const& a) + { + std::size_t sz = a.size(); + if (sz == 0) return 0; + ElementType result = 1; + for(std::size_t i=0;i + ElementType + mean(const_ref const& a) + { + if (a.size() == 0) { + throw std::runtime_error("mean() argument is an empty array"); + } + ElementType result = a[0]; + for(std::size_t i=1;i + ElementType + mean_sq(const_ref const& a) + { + if (a.size() == 0) { + throw std::runtime_error("mean_sq() argument is an empty array"); + } + ElementType result = a[0] * a[0]; + for(std::size_t i=1;i + ElementType + mean_sq(const_ref, AccessorType> const& a) + { + if (a.size() == 0) { + throw std::runtime_error("mean_sq() argument is an empty array"); + } + ElementType result = std::norm(a[0]); + for(std::size_t i=1;i + ElementTypeValues + mean_weighted( + const_ref const& values, + const_ref const& weights) + { + if (values.size() != weights.size()) throw_range_error(); + if (values.size() == 0) { + throw std::runtime_error("mean_weighted() argument is an empty array"); + } + ElementTypeValues sum_vw = values[0] * weights[0]; + ElementTypeWeights sum_w = weights[0]; + for(std::size_t i=1;i + ElementTypeValues + mean_sq_weighted( + const_ref const& values, + const_ref const& weights) + { + if (values.size() != weights.size()) throw_range_error(); + if (values.size() == 0) { + throw std::runtime_error( + "mean_sq_weighted() argument is an empty array"); + } + ElementTypeValues sum_vvw = values[0] * values[0] * weights[0]; + ElementTypeWeights sum_w = weights[0]; + for(std::size_t i=1;i + struct min_max_mean + { + min_max_mean() {} + + template + min_max_mean(const_ref const& values) + : + n(values.size()) + { + if (n == 0) return; + ElementType min_v = values[0]; + ElementType max_v = min_v; + ElementType sum_v = min_v; + for(std::size_t i=1;i min; + boost::optional max; + boost::optional sum; + boost::optional mean; + }; + + template + bool + const_ref + ::all_eq(const_ref const& other) const + { + const ElementType* o = other.begin(); + const ElementType* t = begin(); + const ElementType* e = end(); + if (e-t != other.end()-o) return false; + while (t != e) { + if (!(*t++ == *o++)) return false; + } + return true; + } + + template + bool + const_ref + ::all_eq(ElementType const& other) const + { + const ElementType* t = begin(); + const ElementType* e = end(); + while (t != e) { + if (!(*t++ == other)) return false; + } + return true; + } + + template + bool + const_ref + ::all_ne(const_ref const& other) const + { + const ElementType* o = other.begin(); + const ElementType* t = begin(); + const ElementType* e = end(); + if (e-t != other.end()-o) return false; + while (t != e) { + if (!(*t++ != *o++)) return false; + } + return true; + } + + template + bool + const_ref + ::all_ne(ElementType const& other) const + { + const ElementType* t = begin(); + const ElementType* e = end(); + while (t != e) { + if (!(*t++ != other)) return false; + } + return true; + } + + template + bool + const_ref + ::all_lt(const_ref const& other) const + { + const ElementType* o = other.begin(); + const ElementType* t = begin(); + const ElementType* e = end(); + if (e-t != other.end()-o) throw_range_error(); + while (t != e) { + if (!(*t++ < *o++)) return false; + } + return true; + } + + template + bool + const_ref + ::all_lt(ElementType const& other) const + { + const ElementType* t = begin(); + const ElementType* e = end(); + while (t != e) { + if (!(*t++ < other)) return false; + } + return true; + } + + template + bool + const_ref + ::all_gt(const_ref const& other) const + { + const ElementType* o = other.begin(); + const ElementType* t = begin(); + const ElementType* e = end(); + if (e-t != other.end()-o) throw_range_error(); + while (t != e) { + if (!(*t++ > *o++)) return false; + } + return true; + } + + template + bool + const_ref + ::all_gt(ElementType const& other) const + { + const ElementType* t = begin(); + const ElementType* e = end(); + while (t != e) { + if (!(*t++ > other)) return false; + } + return true; + } + + template + bool + const_ref + ::all_le(const_ref const& other) const + { + const ElementType* o = other.begin(); + const ElementType* t = begin(); + const ElementType* e = end(); + if (e-t != other.end()-o) throw_range_error(); + while (t != e) { + if (!(*t++ <= *o++)) return false; + } + return true; + } + + template + bool + const_ref + ::all_le(ElementType const& other) const + { + const ElementType* t = begin(); + const ElementType* e = end(); + while (t != e) { + if (!(*t++ <= other)) return false; + } + return true; + } + + template + bool + const_ref + ::all_ge(const_ref const& other) const + { + const ElementType* o = other.begin(); + const ElementType* t = begin(); + const ElementType* e = end(); + if (e-t != other.end()-o) throw_range_error(); + while (t != e) { + if (!(*t++ >= *o++)) return false; + } + return true; + } + + template + bool + const_ref + ::all_ge(ElementType const& other) const + { + const ElementType* t = begin(); + const ElementType* e = end(); + while (t != e) { + if (!(*t++ >= other)) return false; + } + return true; + } + + template + bool + const_ref + ::all_approx_equal( + const_ref const& other, + typename scitbx::math::abs_traits< + ElementType>::result_type const& tolerance) const + { + if (size() != other.size()) return false; + scitbx::math::approx_equal_absolutely predicate(tolerance); + for (std::size_t i=0; i + bool + const_ref + ::all_approx_equal( + ElementType const& other, + typename scitbx::math::abs_traits< + ElementType>::result_type const& tolerance) const + { + scitbx::math::approx_equal_absolutely predicate(tolerance); + for (std::size_t i=0; i + bool + const_ref + ::all_approx_equal_relatively( + const_ref const& other, + typename scitbx::math::abs_traits< + ElementType>::result_type const& relative_error) const + { + if (size() != other.size()) return false; + scitbx::math::approx_equal_relatively predicate(relative_error); + for (std::size_t i=0; i + bool + const_ref + ::all_approx_equal_relatively( + ElementType const& other, + typename scitbx::math::abs_traits< + ElementType>::result_type const& relative_error) const + { + scitbx::math::approx_equal_relatively predicate(relative_error); + for (std::size_t i=0; i +#include + +namespace scitbx { namespace af { + + // Dynamic allocation, shared (data and size), standard operators. + template + class shared : public shared_plain + { + public: + SCITBX_ARRAY_FAMILY_TYPEDEFS + + typedef shared_plain base_class; + + shared() + {} + + explicit + shared(size_type const& sz) + : base_class(sz) + {} + + // non-std + shared(af::reserve const& sz) + : base_class(sz) + {} + + shared(size_type const& sz, ElementType const& x) + : base_class(sz, x) + {} + +#if !(defined(BOOST_MSVC) && BOOST_MSVC <= 1200) // VC++ 6.0 + // non-std + template + shared(size_type const& sz, init_functor const& ftor) + : base_class(sz, ftor) + {} +#endif + + shared(const ElementType* first, const ElementType* last) + : base_class(first, last) + {} + +#if !(defined(BOOST_MSVC) && BOOST_MSVC <= 1200) // VC++ 6.0 + template + shared(const OtherElementType* first, const OtherElementType* last) + : base_class(first, last) + {} +#endif + + // non-std + shared(base_class const& other) + : base_class(other) + {} + + // non-std + shared(base_class const& other, weak_ref_flag) + : base_class(other, weak_ref_flag()) + {} + + // non-std + explicit + shared(sharing_handle* other_handle) + : base_class(other_handle) + {} + + // non-std + shared(sharing_handle* other_handle, weak_ref_flag) + : base_class(other_handle, weak_ref_flag()) + {} + + // non-std + template + shared(array_adaptor const& a_a) + : base_class(a_a) + {} + + // non-std + template + shared(expression const &e) + : base_class(e.size(), init_functor_null()) + { + e.assign_to(this->ref()); + } + + // non-std + shared + deep_copy() const { + return shared(this->begin(), this->end()); + } + + // non-std + shared + weak_ref() const { + return shared(*this, weak_ref_flag()); + } + + /// Expression templates + //@{ + template + shared& operator=(expression const &e) { + this->ref() = e; + return *this; + } + + template + shared& operator+=(expression const &e) { + this->ref() += e; + return *this; + } + + template + shared& operator-=(expression const &e) { + this->ref() -= e; + return *this; + } + + template + shared& operator*=(expression const &e) { + this->ref() *= e; + return *this; + } + //@} + +# include + }; + +}} // namespace scitbx::af + +#endif // SCITBX_ARRAY_FAMILY_SHARED_H diff --git a/extern/cctbx/include/scitbx/array_family/shared_plain.h b/extern/cctbx/include/scitbx/array_family/shared_plain.h new file mode 100644 index 00000000..676352fb --- /dev/null +++ b/extern/cctbx/include/scitbx/array_family/shared_plain.h @@ -0,0 +1,381 @@ +/* This code is derived in part from: + * STLport-4.5.3/stlport/stl/_vector.h + * STLport-4.5.3/stlport/stl/_vector.c + * + * Copyright (c) 1994 + * Hewlett-Packard Company + * + * Copyright (c) 1996,1997 + * Silicon Graphics Computer Systems, Inc. + * + * Copyright (c) 1997 + * Moscow Center for SPARC Technology + * + * Copyright (c) 1999 + * Boris Fomitchev + * + * This material is provided "as is", with absolutely no warranty expressed + * or implied. Any use is at your own risk. + * + * Permission to use or copy this software for any purpose is hereby granted + * without fee, provided the above notices are retained on all copies. + * Permission to modify the code and to distribute modified code is granted, + * provided the above notices are retained, and a notice that the code was + * modified is included with the above copyright notice. + * + */ + +#ifndef SCITBX_ARRAY_FAMILY_SHARED_PLAIN_H +#define SCITBX_ARRAY_FAMILY_SHARED_PLAIN_H + +#include +#include +#include + +namespace scitbx { namespace af { + + struct weak_ref_flag {}; + + namespace detail { + const std::size_t global_max_size(static_cast(-1)); + } + + + class sharing_handle { + public: + + static bool const ensures_aligned_memory = +#ifdef SCITBX_AF_HAS_ALIGNED_MALLOC + true; +#else + false; +#endif + + sharing_handle() + : use_count(1), weak_count(0), size(0), capacity(0), + data(0) + {} + + sharing_handle(weak_ref_flag) + : use_count(0), weak_count(1), size(0), capacity(0), + data(0) + {} + + explicit + sharing_handle(std::size_t const& sz) + : use_count(1), weak_count(0), size(0), capacity(sz), +#ifdef SCITBX_AF_HAS_ALIGNED_MALLOC + data(reinterpret_cast(aligned_malloc(sz))) +#else + data(new char[sz]) +#endif + {} + + ~sharing_handle() { +#ifdef SCITBX_AF_HAS_ALIGNED_MALLOC + aligned_free(data); +#else + delete[] data; +#endif + } + + void deallocate() { +#ifdef SCITBX_AF_HAS_ALIGNED_MALLOC + aligned_free(data); +#else + delete[] data; +#endif + capacity = 0; + data = 0; + } + + void swap(sharing_handle& other) { + std::swap(size, other.size); + std::swap(capacity, other.capacity); + std::swap(data, other.data); + } + + std::size_t use_count; + std::size_t weak_count; + std::size_t size; + std::size_t capacity; + char* data; + + private: + sharing_handle(sharing_handle const&); + sharing_handle& operator=(sharing_handle const&); + }; + + template + class shared_plain + { + public: + SCITBX_ARRAY_FAMILY_TYPEDEFS + + static size_type element_size() { return sizeof(ElementType); } + + public: + shared_plain() + : m_is_weak_ref(false), + m_handle(new sharing_handle) + {} + + explicit + shared_plain(size_type const& sz) + : m_is_weak_ref(false), + m_handle(new sharing_handle(sz * element_size())) + { + std::uninitialized_fill_n(begin(), sz, ElementType()); + m_handle->size = m_handle->capacity; + } + + // non-std + shared_plain(af::reserve const& sz) + : m_is_weak_ref(false), + m_handle(new sharing_handle(sz() * element_size())) + {} + + shared_plain(size_type const& sz, ElementType const& x) + : m_is_weak_ref(false), + m_handle(new sharing_handle(sz * element_size())) + { + std::uninitialized_fill_n(begin(), sz, x); + m_handle->size = m_handle->capacity; + } + + // non-std + template + shared_plain(size_type const& sz, init_functor const& ftor) + : m_is_weak_ref(false), + m_handle(new sharing_handle(sz * element_size())) + { + (*ftor.held)(begin(), sz); + m_handle->size = m_handle->capacity; + } + + shared_plain(const ElementType* first, const ElementType* last) + : m_is_weak_ref(false), + m_handle(new sharing_handle((last - first) * element_size())) + { + std::uninitialized_copy(first, last, begin()); + m_handle->size = m_handle->capacity; + } + +#if !(defined(BOOST_MSVC) && BOOST_MSVC <= 1200) // VC++ 6.0 + template + shared_plain(const OtherElementType* first, const OtherElementType* last) + : m_is_weak_ref(false), + m_handle(new sharing_handle((last - first) * element_size())) + { + uninitialized_copy_typeconv(first, last, begin()); + m_handle->size = m_handle->capacity; + } +#endif + + // non-std: shallow copy semantics + shared_plain(shared_plain const& other) + : m_is_weak_ref(other.m_is_weak_ref), + m_handle(other.m_handle) + { + if (m_is_weak_ref) m_handle->weak_count++; + else m_handle->use_count++; + } + + // non-std: shallow copy semantics, weak reference + shared_plain(shared_plain const& other, weak_ref_flag) + : m_is_weak_ref(true), + m_handle(other.m_handle) + { + m_handle->weak_count++; + } + + // non-std + explicit + shared_plain(sharing_handle* other_handle) + : m_is_weak_ref(false), + m_handle(other_handle) + { + SCITBX_ARRAY_FAMILY_STATIC_ASSERT_HAS_TRIVIAL_DESTRUCTOR + m_handle->use_count++; + } + + // non-std + shared_plain(sharing_handle* other_handle, weak_ref_flag) + : m_is_weak_ref(true), + m_handle(other_handle) + { + SCITBX_ARRAY_FAMILY_STATIC_ASSERT_HAS_TRIVIAL_DESTRUCTOR + m_handle->weak_count++; + } + + // non-std + template + shared_plain(array_adaptor const& a_a) + : m_is_weak_ref(false), + m_handle(new sharing_handle) + { + OtherArrayType const& a = *(a_a.pointee); + reserve(a.size()); + for(std::size_t i=0;i& + operator=(shared_plain const& other) + { + if (m_handle != other.m_handle) { + m_dispose(); + m_is_weak_ref = other.m_is_weak_ref; + m_handle = other.m_handle; + if (m_is_weak_ref) m_handle->weak_count++; + else m_handle->use_count++; + } + return *this; + } + + // non-std + std::size_t id() const + { + return reinterpret_cast(m_handle); + } + + // non-std + sharing_handle* handle() { + SCITBX_ARRAY_FAMILY_STATIC_ASSERT_HAS_TRIVIAL_DESTRUCTOR + return m_handle; + } + + size_type size() const { return m_handle->size / element_size(); } + + bool empty() const { if (size() == 0) return true; return false; } + + size_type capacity() const { + return m_handle->capacity / element_size(); + } + + static size_type max_size() { + return detail::global_max_size / element_size(); + } + + // non-std + size_type use_count() const { return m_handle->use_count; } + + // non-std + size_type weak_count() const { return m_handle->weak_count; } + + // non-std + bool is_weak_ref() const { return m_is_weak_ref; } + + SCITBX_ARRAY_FAMILY_BEGIN_END_ETC(shared_plain, + reinterpret_cast(m_handle->data), size()) + + SCITBX_ARRAY_FAMILY_TAKE_REF(begin(), size()) + + void swap(shared_plain& other) { + m_handle->swap(*(other.m_handle)); + } + + void reserve(size_type const& sz) { + if (capacity() < sz) { + shared_plain new_this(((af::reserve(sz)))); + std::uninitialized_copy(begin(), end(), new_this.begin()); + new_this.m_set_size(size()); + new_this.swap(*this); + } + } + + // non-std + shared_plain + deep_copy() const { + return shared_plain(begin(), end()); + } + + // non-std + shared_plain + weak_ref() const { + return shared_plain(*this, weak_ref_flag()); + } + +# include + + protected: + + size_type m_compute_new_capacity(size_type const& old_size, + size_type const& n) { + return old_size + std::max(old_size, n); + } + + void m_insert_overflow(ElementType* pos, + size_type const& n, ElementType const& x, + bool at_end) { + shared_plain + new_this((af::reserve(m_compute_new_capacity(size(), n)))); + std::uninitialized_copy(begin(), pos, new_this.begin()); + new_this.m_set_size(pos - begin()); + if (n == 1) { + new (new_this.end()) ElementType(x); + new_this.m_incr_size(1); + } + else { + // The next call is known to lead to a segmentation fault under + // RedHat 8.0 if there is not enough memory (observed with + // ElementType = std::vector and + // struct vector_element { unsigned i; unsigned j; };). + std::uninitialized_fill_n(new_this.end(), n, x); + new_this.m_incr_size(n); + } + if (!at_end) { + std::uninitialized_copy(pos, end(), new_this.end()); + new_this.m_set_size(size() + n); + } + new_this.swap(*this); + } + + void m_insert_overflow(ElementType* pos, + const ElementType* first, + const ElementType* last) { + size_type n = last - first; + shared_plain + new_this((af::reserve(m_compute_new_capacity(size(), n)))); + std::uninitialized_copy(begin(), pos, new_this.begin()); + new_this.m_set_size(pos - begin()); + std::uninitialized_copy(first, last, new_this.end()); + new_this.m_incr_size(n); + std::uninitialized_copy(pos, end(), new_this.end()); + new_this.m_set_size(size() + n); + new_this.swap(*this); + } + + void m_set_size(size_type const& sz) { + m_handle->size = sz * element_size(); + } + + void m_incr_size(size_type const& n) { + m_handle->size = (size() + n) * element_size(); + } + + void m_decr_size(size_type const& n) { + m_handle->size = (size() - n) * element_size(); + } + + void m_dispose() { + if (m_is_weak_ref) m_handle->weak_count--; + else m_handle->use_count--; + if (m_handle->use_count == 0) { + clear(); + if (m_handle->weak_count == 0) delete m_handle; + else m_handle->deallocate(); + } + } + + bool m_is_weak_ref; + sharing_handle* m_handle; + }; + +}} // namespace scitbx::af + +#endif // SCITBX_ARRAY_FAMILY_SHARED_PLAIN_H diff --git a/extern/cctbx/include/scitbx/array_family/small.h b/extern/cctbx/include/scitbx/array_family/small.h new file mode 100644 index 00000000..a407bc76 --- /dev/null +++ b/extern/cctbx/include/scitbx/array_family/small.h @@ -0,0 +1,64 @@ +#ifndef SCITBX_ARRAY_FAMILY_SMALL_H +#define SCITBX_ARRAY_FAMILY_SMALL_H + +#include +#include + +namespace scitbx { namespace af { + + // Automatic allocation, fixed size, standard operators. + template + class small : public small_plain + { + public: + SCITBX_ARRAY_FAMILY_TYPEDEFS + + typedef small_plain base_class; + + small() + {} + + explicit + small(size_type const& sz) + : base_class(sz) + {} + + // non-std + small(af::reserve const& sz) + : base_class(sz) + {} + + small(size_type const& sz, ElementType const& x) + : base_class(sz, x) + {} + +#if !(defined(BOOST_MSVC) && BOOST_MSVC <= 1200) // VC++ 6.0 + // non-std + template + small(size_type const& sz, init_functor const& ftor) + : base_class(sz, ftor) + {} +#endif + + small(const ElementType* first, const ElementType* last) + : base_class(first, last) + {} + +#if !(defined(BOOST_MSVC) && BOOST_MSVC <= 1200) // VC++ 6.0 + template + small(const OtherElementType* first, const OtherElementType* last) + : base_class(first, last) + {} +#endif + + template + small(array_adaptor const& a_a) + : base_class(a_a) + {} + +# include + }; + +}} // namespace scitbx::af + +#endif // SCITBX_ARRAY_FAMILY_SMALL_H diff --git a/extern/cctbx/include/scitbx/array_family/small_algebra.h b/extern/cctbx/include/scitbx/array_family/small_algebra.h new file mode 100644 index 00000000..00370af1 --- /dev/null +++ b/extern/cctbx/include/scitbx/array_family/small_algebra.h @@ -0,0 +1,1818 @@ +/* ***************************************************** + THIS IS AN AUTOMATICALLY GENERATED FILE. DO NOT EDIT. + ***************************************************** + + Generated by: + scitbx.source_generators.array_family.generate_algebras + */ + +#ifndef SCITBX_ARRAY_FAMILY_SMALL_ALGEBRA_H +#define SCITBX_ARRAY_FAMILY_SMALL_ALGEBRA_H + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + +#include + +#if (defined(BOOST_MSVC) && BOOST_MSVC <= 1300) // VC++ 7.0 +#define SCITBX_ARRAY_FAMILY_SMALL_ALGEBRA_MIN_N1_N2 N1 +#else +#define SCITBX_ARRAY_FAMILY_SMALL_ALGEBRA_MIN_N1_N2 (N1 +#include +#include +#include +#include + +namespace scitbx { namespace af { + + template + inline + small + operator-(small const& a) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a.size(), + make_init_functor(make_array_functor_a( + fn::functor_negate< + return_element_type, + ElementType>(), a.begin()))); + } + + template + inline + small + operator!(small const& a) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a.size(), + make_init_functor(make_array_functor_a( + fn::functor_logical_not< + return_element_type, + ElementType>(), a.begin()))); + } + + template< + typename ElementType1, std::size_t N1, + typename ElementType2, std::size_t N2> + inline + small< + typename binary_operator_traits< + ElementType1, ElementType2>::arithmetic, SCITBX_ARRAY_FAMILY_SMALL_ALGEBRA_MIN_N1_N2> + operator+( + small const& a1, + small const& a2) { + typedef small< + typename binary_operator_traits< + ElementType1, ElementType2>::arithmetic, SCITBX_ARRAY_FAMILY_SMALL_ALGEBRA_MIN_N1_N2> + return_array_type; + typedef typename return_array_type::value_type return_element_type; + if (a1.size() != a2.size()) throw_range_error(); + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_a( + fn::functor_plus< + return_element_type, + ElementType1, + ElementType2>(), a1.begin(), a2.begin()))); + } + + template + inline + small + operator+( + small const& a1, + ElementType const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_s( + fn::functor_plus< + return_element_type, + ElementType, + ElementType>(), a1.begin(), a2))); + } + + template + inline + small + operator+( + ElementType const& a1, + small const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a2.size(), + make_init_functor(make_array_functor_s_a( + fn::functor_plus< + return_element_type, + ElementType, + ElementType>(), a1, a2.begin()))); + } + + template< + typename ElementType1, std::size_t N1, + typename ElementType2, std::size_t N2> + inline + small& + operator+=( + small& a1, + small const& a2) { + if (a1.size() != a2.size()) throw_range_error(); + array_operation_in_place_a_a(fn::functor_ip_plus< + ElementType1, + ElementType2>(), + a1.begin(), a2.begin(), a1.size()); + return a1; + } + + template + inline + small& + operator+=( + small& a1, + ElementType const& a2) { + array_operation_in_place_a_s(fn::functor_ip_plus< + ElementType, + ElementType>(), + a1.begin(), a2, a1.size()); + return a1; + } + + template< + typename ElementType1, std::size_t N1, + typename ElementType2, std::size_t N2> + inline + small< + typename binary_operator_traits< + ElementType1, ElementType2>::arithmetic, SCITBX_ARRAY_FAMILY_SMALL_ALGEBRA_MIN_N1_N2> + operator-( + small const& a1, + small const& a2) { + typedef small< + typename binary_operator_traits< + ElementType1, ElementType2>::arithmetic, SCITBX_ARRAY_FAMILY_SMALL_ALGEBRA_MIN_N1_N2> + return_array_type; + typedef typename return_array_type::value_type return_element_type; + if (a1.size() != a2.size()) throw_range_error(); + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_a( + fn::functor_minus< + return_element_type, + ElementType1, + ElementType2>(), a1.begin(), a2.begin()))); + } + + template + inline + small + operator-( + small const& a1, + ElementType const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_s( + fn::functor_minus< + return_element_type, + ElementType, + ElementType>(), a1.begin(), a2))); + } + + template + inline + small + operator-( + ElementType const& a1, + small const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a2.size(), + make_init_functor(make_array_functor_s_a( + fn::functor_minus< + return_element_type, + ElementType, + ElementType>(), a1, a2.begin()))); + } + + template< + typename ElementType1, std::size_t N1, + typename ElementType2, std::size_t N2> + inline + small& + operator-=( + small& a1, + small const& a2) { + if (a1.size() != a2.size()) throw_range_error(); + array_operation_in_place_a_a(fn::functor_ip_minus< + ElementType1, + ElementType2>(), + a1.begin(), a2.begin(), a1.size()); + return a1; + } + + template + inline + small& + operator-=( + small& a1, + ElementType const& a2) { + array_operation_in_place_a_s(fn::functor_ip_minus< + ElementType, + ElementType>(), + a1.begin(), a2, a1.size()); + return a1; + } + + template< + typename ElementType1, std::size_t N1, + typename ElementType2, std::size_t N2> + inline + small< + typename binary_operator_traits< + ElementType1, ElementType2>::arithmetic, SCITBX_ARRAY_FAMILY_SMALL_ALGEBRA_MIN_N1_N2> + operator*( + small const& a1, + small const& a2) { + typedef small< + typename binary_operator_traits< + ElementType1, ElementType2>::arithmetic, SCITBX_ARRAY_FAMILY_SMALL_ALGEBRA_MIN_N1_N2> + return_array_type; + typedef typename return_array_type::value_type return_element_type; + if (a1.size() != a2.size()) throw_range_error(); + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_a( + fn::functor_multiplies< + return_element_type, + ElementType1, + ElementType2>(), a1.begin(), a2.begin()))); + } + + template + inline + small + operator*( + small const& a1, + ElementType const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_s( + fn::functor_multiplies< + return_element_type, + ElementType, + ElementType>(), a1.begin(), a2))); + } + + template + inline + small + operator*( + ElementType const& a1, + small const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a2.size(), + make_init_functor(make_array_functor_s_a( + fn::functor_multiplies< + return_element_type, + ElementType, + ElementType>(), a1, a2.begin()))); + } + + template< + typename ElementType1, std::size_t N1, + typename ElementType2, std::size_t N2> + inline + small& + operator*=( + small& a1, + small const& a2) { + if (a1.size() != a2.size()) throw_range_error(); + array_operation_in_place_a_a(fn::functor_ip_multiplies< + ElementType1, + ElementType2>(), + a1.begin(), a2.begin(), a1.size()); + return a1; + } + + template + inline + small& + operator*=( + small& a1, + ElementType const& a2) { + array_operation_in_place_a_s(fn::functor_ip_multiplies< + ElementType, + ElementType>(), + a1.begin(), a2, a1.size()); + return a1; + } + + template< + typename ElementType1, std::size_t N1, + typename ElementType2, std::size_t N2> + inline + small< + typename binary_operator_traits< + ElementType1, ElementType2>::arithmetic, SCITBX_ARRAY_FAMILY_SMALL_ALGEBRA_MIN_N1_N2> + operator/( + small const& a1, + small const& a2) { + typedef small< + typename binary_operator_traits< + ElementType1, ElementType2>::arithmetic, SCITBX_ARRAY_FAMILY_SMALL_ALGEBRA_MIN_N1_N2> + return_array_type; + typedef typename return_array_type::value_type return_element_type; + if (a1.size() != a2.size()) throw_range_error(); + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_a( + fn::functor_divides< + return_element_type, + ElementType1, + ElementType2>(), a1.begin(), a2.begin()))); + } + + template + inline + small + operator/( + small const& a1, + ElementType const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_s( + fn::functor_divides< + return_element_type, + ElementType, + ElementType>(), a1.begin(), a2))); + } + + template + inline + small + operator/( + ElementType const& a1, + small const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a2.size(), + make_init_functor(make_array_functor_s_a( + fn::functor_divides< + return_element_type, + ElementType, + ElementType>(), a1, a2.begin()))); + } + + template< + typename ElementType1, std::size_t N1, + typename ElementType2, std::size_t N2> + inline + small& + operator/=( + small& a1, + small const& a2) { + if (a1.size() != a2.size()) throw_range_error(); + array_operation_in_place_a_a(fn::functor_ip_divides< + ElementType1, + ElementType2>(), + a1.begin(), a2.begin(), a1.size()); + return a1; + } + + template + inline + small& + operator/=( + small& a1, + ElementType const& a2) { + array_operation_in_place_a_s(fn::functor_ip_divides< + ElementType, + ElementType>(), + a1.begin(), a2, a1.size()); + return a1; + } + + template< + typename ElementType1, std::size_t N1, + typename ElementType2, std::size_t N2> + inline + small< + typename binary_operator_traits< + ElementType1, ElementType2>::arithmetic, SCITBX_ARRAY_FAMILY_SMALL_ALGEBRA_MIN_N1_N2> + operator%( + small const& a1, + small const& a2) { + typedef small< + typename binary_operator_traits< + ElementType1, ElementType2>::arithmetic, SCITBX_ARRAY_FAMILY_SMALL_ALGEBRA_MIN_N1_N2> + return_array_type; + typedef typename return_array_type::value_type return_element_type; + if (a1.size() != a2.size()) throw_range_error(); + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_a( + fn::functor_modulus< + return_element_type, + ElementType1, + ElementType2>(), a1.begin(), a2.begin()))); + } + + template + inline + small + operator%( + small const& a1, + ElementType const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_s( + fn::functor_modulus< + return_element_type, + ElementType, + ElementType>(), a1.begin(), a2))); + } + + template + inline + small + operator%( + ElementType const& a1, + small const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a2.size(), + make_init_functor(make_array_functor_s_a( + fn::functor_modulus< + return_element_type, + ElementType, + ElementType>(), a1, a2.begin()))); + } + + template< + typename ElementType1, std::size_t N1, + typename ElementType2, std::size_t N2> + inline + small& + operator%=( + small& a1, + small const& a2) { + if (a1.size() != a2.size()) throw_range_error(); + array_operation_in_place_a_a(fn::functor_ip_modulus< + ElementType1, + ElementType2>(), + a1.begin(), a2.begin(), a1.size()); + return a1; + } + + template + inline + small& + operator%=( + small& a1, + ElementType const& a2) { + array_operation_in_place_a_s(fn::functor_ip_modulus< + ElementType, + ElementType>(), + a1.begin(), a2, a1.size()); + return a1; + } + + template< + typename ElementType1, std::size_t N1, + typename ElementType2, std::size_t N2> + inline + small + operator&&( + small const& a1, + small const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + if (a1.size() != a2.size()) throw_range_error(); + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_a( + fn::functor_logical_and< + return_element_type, + ElementType1, + ElementType2>(), a1.begin(), a2.begin()))); + } + + template + inline + small + operator&&( + small const& a1, + ElementType const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_s( + fn::functor_logical_and< + return_element_type, + ElementType, + ElementType>(), a1.begin(), a2))); + } + + template + inline + small + operator&&( + ElementType const& a1, + small const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a2.size(), + make_init_functor(make_array_functor_s_a( + fn::functor_logical_and< + return_element_type, + ElementType, + ElementType>(), a1, a2.begin()))); + } + + template< + typename ElementType1, std::size_t N1, + typename ElementType2, std::size_t N2> + inline + small + operator||( + small const& a1, + small const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + if (a1.size() != a2.size()) throw_range_error(); + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_a( + fn::functor_logical_or< + return_element_type, + ElementType1, + ElementType2>(), a1.begin(), a2.begin()))); + } + + template + inline + small + operator||( + small const& a1, + ElementType const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_s( + fn::functor_logical_or< + return_element_type, + ElementType, + ElementType>(), a1.begin(), a2))); + } + + template + inline + small + operator||( + ElementType const& a1, + small const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a2.size(), + make_init_functor(make_array_functor_s_a( + fn::functor_logical_or< + return_element_type, + ElementType, + ElementType>(), a1, a2.begin()))); + } + + template< + typename ElementType1, std::size_t N1, + typename ElementType2, std::size_t N2> + inline + small + operator==( + small const& a1, + small const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + if (a1.size() != a2.size()) throw_range_error(); + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_a( + fn::functor_equal_to< + return_element_type, + ElementType1, + ElementType2>(), a1.begin(), a2.begin()))); + } + + template + inline + small + operator==( + small const& a1, + ElementType const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_s( + fn::functor_equal_to< + return_element_type, + ElementType, + ElementType>(), a1.begin(), a2))); + } + + template + inline + small + operator==( + ElementType const& a1, + small const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a2.size(), + make_init_functor(make_array_functor_s_a( + fn::functor_equal_to< + return_element_type, + ElementType, + ElementType>(), a1, a2.begin()))); + } + + template< + typename ElementType1, std::size_t N1, + typename ElementType2, std::size_t N2> + inline + small + operator!=( + small const& a1, + small const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + if (a1.size() != a2.size()) throw_range_error(); + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_a( + fn::functor_not_equal_to< + return_element_type, + ElementType1, + ElementType2>(), a1.begin(), a2.begin()))); + } + + template + inline + small + operator!=( + small const& a1, + ElementType const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_s( + fn::functor_not_equal_to< + return_element_type, + ElementType, + ElementType>(), a1.begin(), a2))); + } + + template + inline + small + operator!=( + ElementType const& a1, + small const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a2.size(), + make_init_functor(make_array_functor_s_a( + fn::functor_not_equal_to< + return_element_type, + ElementType, + ElementType>(), a1, a2.begin()))); + } + + template< + typename ElementType1, std::size_t N1, + typename ElementType2, std::size_t N2> + inline + small + operator>( + small const& a1, + small const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + if (a1.size() != a2.size()) throw_range_error(); + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_a( + fn::functor_greater< + return_element_type, + ElementType1, + ElementType2>(), a1.begin(), a2.begin()))); + } + + template + inline + small + operator>( + small const& a1, + ElementType const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_s( + fn::functor_greater< + return_element_type, + ElementType, + ElementType>(), a1.begin(), a2))); + } + + template + inline + small + operator>( + ElementType const& a1, + small const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a2.size(), + make_init_functor(make_array_functor_s_a( + fn::functor_greater< + return_element_type, + ElementType, + ElementType>(), a1, a2.begin()))); + } + + template< + typename ElementType1, std::size_t N1, + typename ElementType2, std::size_t N2> + inline + small + operator<( + small const& a1, + small const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + if (a1.size() != a2.size()) throw_range_error(); + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_a( + fn::functor_less< + return_element_type, + ElementType1, + ElementType2>(), a1.begin(), a2.begin()))); + } + + template + inline + small + operator<( + small const& a1, + ElementType const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_s( + fn::functor_less< + return_element_type, + ElementType, + ElementType>(), a1.begin(), a2))); + } + + template + inline + small + operator<( + ElementType const& a1, + small const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a2.size(), + make_init_functor(make_array_functor_s_a( + fn::functor_less< + return_element_type, + ElementType, + ElementType>(), a1, a2.begin()))); + } + + template< + typename ElementType1, std::size_t N1, + typename ElementType2, std::size_t N2> + inline + small + operator>=( + small const& a1, + small const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + if (a1.size() != a2.size()) throw_range_error(); + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_a( + fn::functor_greater_equal< + return_element_type, + ElementType1, + ElementType2>(), a1.begin(), a2.begin()))); + } + + template + inline + small + operator>=( + small const& a1, + ElementType const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_s( + fn::functor_greater_equal< + return_element_type, + ElementType, + ElementType>(), a1.begin(), a2))); + } + + template + inline + small + operator>=( + ElementType const& a1, + small const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a2.size(), + make_init_functor(make_array_functor_s_a( + fn::functor_greater_equal< + return_element_type, + ElementType, + ElementType>(), a1, a2.begin()))); + } + + template< + typename ElementType1, std::size_t N1, + typename ElementType2, std::size_t N2> + inline + small + operator<=( + small const& a1, + small const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + if (a1.size() != a2.size()) throw_range_error(); + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_a( + fn::functor_less_equal< + return_element_type, + ElementType1, + ElementType2>(), a1.begin(), a2.begin()))); + } + + template + inline + small + operator<=( + small const& a1, + ElementType const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_s( + fn::functor_less_equal< + return_element_type, + ElementType, + ElementType>(), a1.begin(), a2))); + } + + template + inline + small + operator<=( + ElementType const& a1, + small const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a2.size(), + make_init_functor(make_array_functor_s_a( + fn::functor_less_equal< + return_element_type, + ElementType, + ElementType>(), a1, a2.begin()))); + } + + template + inline + small + absolute(small const& a) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a.size(), + make_init_functor(make_array_functor_a( + fn::functor_absolute(), a.begin()))); + } + + template + inline + small + pow2(small const& a) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a.size(), + make_init_functor(make_array_functor_a( + fn::functor_pow2(), a.begin()))); + } + + template + inline + small + acos(small const& a) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a.size(), + make_init_functor(make_array_functor_a( + fn::functor_acos(), a.begin()))); + } + + template + inline + small + cos(small const& a) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a.size(), + make_init_functor(make_array_functor_a( + fn::functor_cos(), a.begin()))); + } + + template + inline + small + tan(small const& a) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a.size(), + make_init_functor(make_array_functor_a( + fn::functor_tan(), a.begin()))); + } + + template + inline + small + asin(small const& a) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a.size(), + make_init_functor(make_array_functor_a( + fn::functor_asin(), a.begin()))); + } + + template + inline + small + cosh(small const& a) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a.size(), + make_init_functor(make_array_functor_a( + fn::functor_cosh(), a.begin()))); + } + + template + inline + small + tanh(small const& a) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a.size(), + make_init_functor(make_array_functor_a( + fn::functor_tanh(), a.begin()))); + } + + template + inline + small + atan(small const& a) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a.size(), + make_init_functor(make_array_functor_a( + fn::functor_atan(), a.begin()))); + } + + template + inline + small + exp(small const& a) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a.size(), + make_init_functor(make_array_functor_a( + fn::functor_exp(), a.begin()))); + } + + template + inline + small + sin(small const& a) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a.size(), + make_init_functor(make_array_functor_a( + fn::functor_sin(), a.begin()))); + } + + template + inline + small + fabs(small const& a) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a.size(), + make_init_functor(make_array_functor_a( + fn::functor_fabs(), a.begin()))); + } + + template + inline + small + log(small const& a) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a.size(), + make_init_functor(make_array_functor_a( + fn::functor_log(), a.begin()))); + } + + template + inline + small + sinh(small const& a) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a.size(), + make_init_functor(make_array_functor_a( + fn::functor_sinh(), a.begin()))); + } + + template + inline + small + ceil(small const& a) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a.size(), + make_init_functor(make_array_functor_a( + fn::functor_ceil(), a.begin()))); + } + + template + inline + small + floor(small const& a) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a.size(), + make_init_functor(make_array_functor_a( + fn::functor_floor(), a.begin()))); + } + + template + inline + small + log10(small const& a) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a.size(), + make_init_functor(make_array_functor_a( + fn::functor_log10(), a.begin()))); + } + + template + inline + small + sqrt(small const& a) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a.size(), + make_init_functor(make_array_functor_a( + fn::functor_sqrt(), a.begin()))); + } + + template + inline + small + abs(small const& a) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a.size(), + make_init_functor(make_array_functor_a( + fn::functor_abs(), a.begin()))); + } + + template + inline + small + conj(small const& a) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a.size(), + make_init_functor(make_array_functor_a( + fn::functor_conj(), a.begin()))); + } + + template< + typename ElementType1, std::size_t N1, + typename ElementType2, std::size_t N2> + inline + small + fmod_positive( + small const& a1, + small const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + if (a1.size() != a2.size()) throw_range_error(); + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_a( + fn::functor_fmod_positive(), + a1.begin(), a2.begin()))); + } + + template + inline + small + fmod_positive( + small const& a1, + ElementType const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_s( + fn::functor_fmod_positive(), + a1.begin(), a2))); + } + + template + inline + small + fmod_positive( + ElementType const& a1, + small const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a2.size(), + make_init_functor(make_array_functor_s_a( + fn::functor_fmod_positive(), + a1, a2.begin()))); + } + + template< + typename ElementType1, std::size_t N1, + typename ElementType2, std::size_t N2> + inline + small + fmod( + small const& a1, + small const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + if (a1.size() != a2.size()) throw_range_error(); + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_a( + fn::functor_fmod(), + a1.begin(), a2.begin()))); + } + + template + inline + small + fmod( + small const& a1, + ElementType const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_s( + fn::functor_fmod(), + a1.begin(), a2))); + } + + template + inline + small + fmod( + ElementType const& a1, + small const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a2.size(), + make_init_functor(make_array_functor_s_a( + fn::functor_fmod(), + a1, a2.begin()))); + } + + template< + typename ElementType1, std::size_t N1, + typename ElementType2, std::size_t N2> + inline + small + pow( + small const& a1, + small const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + if (a1.size() != a2.size()) throw_range_error(); + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_a( + fn::functor_pow(), + a1.begin(), a2.begin()))); + } + + template + inline + small + pow( + small const& a1, + ElementType const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_s( + fn::functor_pow(), + a1.begin(), a2))); + } + + template + inline + small + pow( + ElementType const& a1, + small const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a2.size(), + make_init_functor(make_array_functor_s_a( + fn::functor_pow(), + a1, a2.begin()))); + } + + template< + typename ElementType1, std::size_t N1, + typename ElementType2, std::size_t N2> + inline + small + atan2( + small const& a1, + small const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + if (a1.size() != a2.size()) throw_range_error(); + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_a( + fn::functor_atan2(), + a1.begin(), a2.begin()))); + } + + template + inline + small + atan2( + small const& a1, + ElementType const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_s( + fn::functor_atan2(), + a1.begin(), a2))); + } + + template + inline + small + atan2( + ElementType const& a1, + small const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a2.size(), + make_init_functor(make_array_functor_s_a( + fn::functor_atan2(), + a1, a2.begin()))); + } + + template< + typename ElementType1, std::size_t N1, + typename ElementType2, std::size_t N2> + inline + small + each_min( + small const& a1, + small const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + if (a1.size() != a2.size()) throw_range_error(); + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_a( + fn::functor_each_min(), + a1.begin(), a2.begin()))); + } + + template + inline + small + each_min( + small const& a1, + ElementType const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_s( + fn::functor_each_min(), + a1.begin(), a2))); + } + + template + inline + small + each_min( + ElementType const& a1, + small const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a2.size(), + make_init_functor(make_array_functor_s_a( + fn::functor_each_min(), + a1, a2.begin()))); + } + + template< + typename ElementType1, std::size_t N1, + typename ElementType2, std::size_t N2> + inline + small + each_max( + small const& a1, + small const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + if (a1.size() != a2.size()) throw_range_error(); + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_a( + fn::functor_each_max(), + a1.begin(), a2.begin()))); + } + + template + inline + small + each_max( + small const& a1, + ElementType const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_s( + fn::functor_each_max(), + a1.begin(), a2))); + } + + template + inline + small + each_max( + ElementType const& a1, + small const& a2) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a2.size(), + make_init_functor(make_array_functor_s_a( + fn::functor_each_max(), + a1, a2.begin()))); + } + + template + inline + small + real(small, N> const& a) { + typedef small return_array_type; + return return_array_type(a.size(), + make_init_functor(make_array_functor_a( + fn::functor_real< + ElementType, + std::complex >(), a.begin()))); + } + + template + inline + small + imag(small, N> const& a) { + typedef small return_array_type; + return return_array_type(a.size(), + make_init_functor(make_array_functor_a( + fn::functor_imag< + ElementType, + std::complex >(), a.begin()))); + } + + template + inline + small + abs(small, N> const& a) { + typedef small return_array_type; + return return_array_type(a.size(), + make_init_functor(make_array_functor_a( + fn::functor_abs< + ElementType, + std::complex >(), a.begin()))); + } + + template + inline + small + arg(small, N> const& a) { + typedef small return_array_type; + return return_array_type(a.size(), + make_init_functor(make_array_functor_a( + fn::functor_arg< + ElementType, + std::complex >(), a.begin()))); + } + + template + inline + small + norm(small, N> const& a) { + typedef small return_array_type; + return return_array_type(a.size(), + make_init_functor(make_array_functor_a( + fn::functor_norm< + ElementType, + std::complex >(), a.begin()))); + } + + template + inline + small, N> + pow( + small, N> const& a1, + small const& a2) { + typedef small, N> return_array_type; + if (a1.size() != a2.size()) throw_range_error(); + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_a( + fn::functor_pow< + std::complex, + std::complex, + int >(), a1.begin(), a2.begin()))); + } + + template + inline + small, N> + pow( + small, N> const& a1, + int const& a2) { + typedef small, N> return_array_type; + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_s( + fn::functor_pow< + std::complex, + std::complex, + int >(), a1.begin(), a2))); + } + + template + inline + small, N> + pow( + std::complex const& a1, + small const& a2) { + typedef small, N> return_array_type; + return return_array_type(a2.size(), + make_init_functor(make_array_functor_s_a( + fn::functor_pow< + std::complex, + std::complex, + int >(), a1, a2.begin()))); + } + + template + inline + small, N> + pow( + small, N> const& a1, + small const& a2) { + typedef small, N> return_array_type; + if (a1.size() != a2.size()) throw_range_error(); + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_a( + fn::functor_pow< + std::complex, + std::complex, + ElementType >(), a1.begin(), a2.begin()))); + } + + template + inline + small, N> + pow( + small, N> const& a1, + ElementType const& a2) { + typedef small, N> return_array_type; + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_s( + fn::functor_pow< + std::complex, + std::complex, + ElementType >(), a1.begin(), a2))); + } + + template + inline + small, N> + pow( + std::complex const& a1, + small const& a2) { + typedef small, N> return_array_type; + return return_array_type(a2.size(), + make_init_functor(make_array_functor_s_a( + fn::functor_pow< + std::complex, + std::complex, + ElementType >(), a1, a2.begin()))); + } + + template + inline + small, N> + pow( + small, N> const& a1, + small, N> const& a2) { + typedef small, N> return_array_type; + if (a1.size() != a2.size()) throw_range_error(); + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_a( + fn::functor_pow< + std::complex, + std::complex, + std::complex >(), a1.begin(), a2.begin()))); + } + + template + inline + small, N> + pow( + small, N> const& a1, + std::complex const& a2) { + typedef small, N> return_array_type; + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_s( + fn::functor_pow< + std::complex, + std::complex, + std::complex >(), a1.begin(), a2))); + } + + template + inline + small, N> + pow( + std::complex const& a1, + small, N> const& a2) { + typedef small, N> return_array_type; + return return_array_type(a2.size(), + make_init_functor(make_array_functor_s_a( + fn::functor_pow< + std::complex, + std::complex, + std::complex >(), a1, a2.begin()))); + } + + template + inline + small, N> + pow( + small const& a1, + small, N> const& a2) { + typedef small, N> return_array_type; + if (a1.size() != a2.size()) throw_range_error(); + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_a( + fn::functor_pow< + std::complex, + ElementType, + std::complex >(), a1.begin(), a2.begin()))); + } + + template + inline + small, N> + pow( + small const& a1, + std::complex const& a2) { + typedef small, N> return_array_type; + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_s( + fn::functor_pow< + std::complex, + ElementType, + std::complex >(), a1.begin(), a2))); + } + + template + inline + small, N> + pow( + ElementType const& a1, + small, N> const& a2) { + typedef small, N> return_array_type; + return return_array_type(a2.size(), + make_init_functor(make_array_functor_s_a( + fn::functor_pow< + std::complex, + ElementType, + std::complex >(), a1, a2.begin()))); + } + + template + inline + small, N> + polar( + small const& a1, + small const& a2) { + typedef small, N> return_array_type; + if (a1.size() != a2.size()) throw_range_error(); + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_a( + fn::functor_polar< + std::complex, + ElementType, + ElementType >(), a1.begin(), a2.begin()))); + } + + template + inline + small, N> + polar( + small const& a1, + ElementType const& a2) { + typedef small, N> return_array_type; + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_s( + fn::functor_polar< + std::complex, + ElementType, + ElementType >(), a1.begin(), a2))); + } + + template + inline + small, N> + polar( + ElementType const& a1, + small const& a2) { + typedef small, N> return_array_type; + return return_array_type(a2.size(), + make_init_functor(make_array_functor_s_a( + fn::functor_polar< + std::complex, + ElementType, + ElementType >(), a1, a2.begin()))); + } + + template + inline + small + approx_equal( + small const& a1, + small const& a2, + ElementType const& tolerance) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + if (a1.size() != a2.size()) throw_range_error(); + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_a_s( + fn::functor_approx_equal(), + a1.begin(), a2.begin(), tolerance))); + } + + template + inline + small + approx_equal( + small const& a1, + ElementType const& a2, + ElementType const& tolerance) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a1.size(), + make_init_functor(make_array_functor_a_s_s( + fn::functor_approx_equal(), + a1.begin(), a2, tolerance))); + } + + template + inline + small + approx_equal( + ElementType const& a1, + small const& a2, + ElementType const& tolerance) { + typedef small + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return return_array_type(a2.size(), + make_init_functor(make_array_functor_s_a_s( + fn::functor_approx_equal(), + a1, a2.begin(), tolerance))); + } + +}} // namespace scitbx::af + +#endif // DOXYGEN_SHOULD_SKIP_THIS + +#endif // SCITBX_ARRAY_FAMILY_SMALL_ALGEBRA_H diff --git a/extern/cctbx/include/scitbx/array_family/small_plain.h b/extern/cctbx/include/scitbx/array_family/small_plain.h new file mode 100644 index 00000000..8801761a --- /dev/null +++ b/extern/cctbx/include/scitbx/array_family/small_plain.h @@ -0,0 +1,153 @@ +#ifndef SCITBX_ARRAY_FAMILY_SMALL_PLAIN_H +#define SCITBX_ARRAY_FAMILY_SMALL_PLAIN_H + +#include +#include + +namespace scitbx { namespace af { + + // Automatic allocation, variable size. + template + class small_plain + { + public: + static const std::size_t capacity_value = N; + + SCITBX_ARRAY_FAMILY_TYPEDEFS + + small_plain() + : m_size(0) + {} + + explicit + small_plain(size_type const& sz) + : m_size(0) + { + if (N < sz) throw_range_error(); + std::uninitialized_fill_n(begin(), sz, ElementType()); + m_size = sz; + } + + // non-std + small_plain(af::reserve const& sz) + : m_size(0) + { + if (N < sz()) throw_range_error(); + } + + small_plain(size_type const& sz, ElementType const& x) + : m_size(0) + { + if (N < sz) throw_range_error(); + std::uninitialized_fill_n(begin(), sz, x); + m_size = sz; + } + + // non-std + template + small_plain(size_type const& sz, init_functor const& ftor) + : m_size(0) + { + if (N < sz) throw_range_error(); + (*ftor.held)(begin(), sz); + m_size = sz; + } + + small_plain(const ElementType* first, const ElementType* last) + : m_size(0) + { + if (N < last - first) throw_range_error(); + std::uninitialized_copy(first, last, begin()); + m_size = last - first; + } + +#if !(defined(BOOST_MSVC) && BOOST_MSVC <= 1200) // VC++ 6.0 + template + small_plain(const OtherElementType* first, const OtherElementType* last) + : m_size(0) + { + if (N < last - first) throw_range_error(); + uninitialized_copy_typeconv(first, last, begin()); + m_size = last - first; + } +#endif + + small_plain(small_plain const& other) + : m_size(0) + { + std::uninitialized_copy(other.begin(), other.end(), begin()); + m_size = other.m_size; + } + + template + small_plain(array_adaptor const& a_a) + : m_size(0) + { + OtherArrayType const& a = *(a_a.pointee); + if (a.size() > N) throw_range_error(); + for(std::size_t i=0;i& + operator=(small_plain const& other) + { + clear(); + std::uninitialized_copy(other.begin(), other.end(), begin()); + m_size = other.m_size; + return *this; + } + + size_type size() const { return m_size; } + bool empty() const { if (size() == 0) return true; return false; } + static size_type max_size() { return N; } + static size_type capacity() { return N; } + + SCITBX_ARRAY_FAMILY_BEGIN_END_ETC(small_plain, + ((ElementType*)(m_elems.buffer)), m_size) // fix this + + SCITBX_ARRAY_FAMILY_TAKE_REF(begin(), m_size) + + void swap(small_plain& other) { + std::swap(*this, other); + } + + void reserve(size_type const& sz) { + if (N < sz) throw_range_error(); + } + +# include + + protected: + void m_insert_overflow(ElementType* /*pos*/, + size_type const& /*n*/, ElementType const& /*x*/, + bool /*at_end*/) { + throw_range_error(); + } + + void m_insert_overflow(ElementType* /*pos*/, + const ElementType* /*first*/, + const ElementType* /*last*/) { + throw_range_error(); + } + + void m_set_size(size_type const& sz) { + m_size = sz; + } + + void m_incr_size(size_type const& n) { + m_size += n; + } + + void m_decr_size(size_type const& n) { + m_size -= n; + } + + detail::auto_allocator m_elems; + size_type m_size; + }; + +}} // namespace scitbx::af + +#endif // SCITBX_ARRAY_FAMILY_SMALL_PLAIN_H diff --git a/extern/cctbx/include/scitbx/array_family/small_reductions.h b/extern/cctbx/include/scitbx/array_family/small_reductions.h new file mode 100644 index 00000000..740ce39e --- /dev/null +++ b/extern/cctbx/include/scitbx/array_family/small_reductions.h @@ -0,0 +1,155 @@ +/* ***************************************************** + THIS IS AN AUTOMATICALLY GENERATED FILE. DO NOT EDIT. + ***************************************************** + + Generated by: + scitbx.source_generators.array_family.generate_reductions + */ + +#ifndef SCITBX_ARRAY_FAMILY_SMALL_REDUCTIONS_H +#define SCITBX_ARRAY_FAMILY_SMALL_REDUCTIONS_H + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + +#include +#include + +namespace scitbx { namespace af { + + template + int + inline + order( + small_plain const& a1, + small_plain const& a2) + { + return order(a1.const_ref(), a2.const_ref()); + } + + template + inline + std::size_t + max_index(small_plain const& a) + { + return max_index(a.const_ref()); + } + + template + inline + std::size_t + min_index(small_plain const& a) + { + return min_index(a.const_ref()); + } + + template + inline + ElementType + max(small_plain const& a) + { + return max(a.const_ref()); + } + + template + inline + ElementType + min(small_plain const& a) + { + return min(a.const_ref()); + } + + template + inline + ElementType + max_absolute(small_plain const& a) + { + return max_absolute(a.const_ref()); + } + + template + inline + ElementType + sum(small_plain const& a) + { + return sum(a.const_ref()); + } + + template + inline + ElementType + sum_sq(small_plain const& a) + { + return sum_sq(a.const_ref()); + } + + template + inline + ElementType + product(small_plain const& a) + { + return product(a.const_ref()); + } + + template + inline + ElementType + mean(small_plain const& a) + { + return mean(a.const_ref()); + } + + template + inline + ElementType + mean_sq(small_plain const& a) + { + return mean_sq(a.const_ref()); + } + + template + inline + ElementTypeValues + mean_weighted( + small_plain const& values, + small_plain const& weights) + { + return mean_weighted(values.const_ref(), weights.const_ref()); + } + + template + inline + ElementTypeValues + mean_sq_weighted( + small_plain const& values, + small_plain const& weights) + { + return mean_sq_weighted(values.const_ref(), weights.const_ref()); + } + + template + inline + boost::optional + first_index(small_plain const& a, + PredicateType p) + { + return first_index(a.const_ref(), p); + } + + template + inline + boost::optional + last_index(small_plain const& a, + PredicateType p) + { + return last_index(a.const_ref(), p); + } + +}} // namespace scitbx::af + +#endif // DOXYGEN_SHOULD_SKIP_THIS + +#endif // SCITBX_ARRAY_FAMILY_SMALL_REDUCTIONS_H + diff --git a/extern/cctbx/include/scitbx/array_family/tiny.h b/extern/cctbx/include/scitbx/array_family/tiny.h new file mode 100644 index 00000000..cf235c78 --- /dev/null +++ b/extern/cctbx/include/scitbx/array_family/tiny.h @@ -0,0 +1,38 @@ +#ifndef SCITBX_ARRAY_FAMILY_TINY_H +#define SCITBX_ARRAY_FAMILY_TINY_H + +#include +#include + +namespace scitbx { namespace af { + + // Automatic allocation, fixed size, standard operators. + template + class tiny : public tiny_plain + { + public: + SCITBX_ARRAY_FAMILY_TYPEDEFS + + typedef tiny_plain base_class; + + tiny() {} + + template + tiny(array_adaptor const& a_a) + : base_class(a_a) + {} + + template + tiny(array_adaptor_with_static_cast const& a_a) + : base_class(a_a) + {} + + SCITBX_ARRAY_FAMILY_TINY_CONVENIENCE_CONSTRUCTORS(tiny) + SCITBX_ARRAY_FAMILY_TINY_COPY_AND_ASSIGNMENT(tiny) + +# include + }; + +}} // namespace scitbx::af + +#endif // SCITBX_ARRAY_FAMILY_TINY_H diff --git a/extern/cctbx/include/scitbx/array_family/tiny_algebra.h b/extern/cctbx/include/scitbx/array_family/tiny_algebra.h new file mode 100644 index 00000000..f490de06 --- /dev/null +++ b/extern/cctbx/include/scitbx/array_family/tiny_algebra.h @@ -0,0 +1,1838 @@ +/* ***************************************************** + THIS IS AN AUTOMATICALLY GENERATED FILE. DO NOT EDIT. + ***************************************************** + + Generated by: + scitbx.source_generators.array_family.generate_algebras + */ + +#ifndef SCITBX_ARRAY_FAMILY_TINY_ALGEBRA_H +#define SCITBX_ARRAY_FAMILY_TINY_ALGEBRA_H + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + +#include + +#include +#include +#include +#include +#include + +namespace scitbx { namespace af { + + template + inline + tiny + operator-(tiny const& a) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a(fn::functor_negate< + return_element_type, + ElementType>(), + a.begin(), result.begin(), a.size(), true_type()); + return result; + } + + template + inline + tiny + operator!(tiny const& a) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a(fn::functor_logical_not< + return_element_type, + ElementType>(), + a.begin(), result.begin(), a.size(), true_type()); + return result; + } + + template + inline + tiny< + typename binary_operator_traits< + ElementType1, ElementType2>::arithmetic, N> + operator+( + tiny const& a1, + tiny const& a2) { + typedef tiny< + typename binary_operator_traits< + ElementType1, ElementType2>::arithmetic, N> + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a_a(fn::functor_plus< + return_element_type, + ElementType1, + ElementType2>(), + a1.begin(), a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + operator+( + tiny const& a1, + ElementType const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a_s(fn::functor_plus< + return_element_type, + ElementType, + ElementType>(), + a1.begin(), a2, result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + operator+( + ElementType const& a1, + tiny const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_s_a(fn::functor_plus< + return_element_type, + ElementType, + ElementType>(), + a1, a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny& + operator+=( + tiny& a1, + tiny const& a2) { + array_operation_in_place_a_a(fn::functor_ip_plus< + ElementType1, + ElementType2>(), + a1.begin(), a2.begin(), N); + return a1; + } + + template + inline + tiny& + operator+=( + tiny& a1, + ElementType const& a2) { + array_operation_in_place_a_s(fn::functor_ip_plus< + ElementType, + ElementType>(), + a1.begin(), a2, N); + return a1; + } + + template + inline + tiny< + typename binary_operator_traits< + ElementType1, ElementType2>::arithmetic, N> + operator-( + tiny const& a1, + tiny const& a2) { + typedef tiny< + typename binary_operator_traits< + ElementType1, ElementType2>::arithmetic, N> + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a_a(fn::functor_minus< + return_element_type, + ElementType1, + ElementType2>(), + a1.begin(), a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + operator-( + tiny const& a1, + ElementType const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a_s(fn::functor_minus< + return_element_type, + ElementType, + ElementType>(), + a1.begin(), a2, result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + operator-( + ElementType const& a1, + tiny const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_s_a(fn::functor_minus< + return_element_type, + ElementType, + ElementType>(), + a1, a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny& + operator-=( + tiny& a1, + tiny const& a2) { + array_operation_in_place_a_a(fn::functor_ip_minus< + ElementType1, + ElementType2>(), + a1.begin(), a2.begin(), N); + return a1; + } + + template + inline + tiny& + operator-=( + tiny& a1, + ElementType const& a2) { + array_operation_in_place_a_s(fn::functor_ip_minus< + ElementType, + ElementType>(), + a1.begin(), a2, N); + return a1; + } + + template + inline + tiny< + typename binary_operator_traits< + ElementType1, ElementType2>::arithmetic, N> + operator*( + tiny const& a1, + tiny const& a2) { + typedef tiny< + typename binary_operator_traits< + ElementType1, ElementType2>::arithmetic, N> + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a_a(fn::functor_multiplies< + return_element_type, + ElementType1, + ElementType2>(), + a1.begin(), a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + operator*( + tiny const& a1, + ElementType const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a_s(fn::functor_multiplies< + return_element_type, + ElementType, + ElementType>(), + a1.begin(), a2, result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + operator*( + ElementType const& a1, + tiny const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_s_a(fn::functor_multiplies< + return_element_type, + ElementType, + ElementType>(), + a1, a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny& + operator*=( + tiny& a1, + tiny const& a2) { + array_operation_in_place_a_a(fn::functor_ip_multiplies< + ElementType1, + ElementType2>(), + a1.begin(), a2.begin(), N); + return a1; + } + + template + inline + tiny& + operator*=( + tiny& a1, + ElementType const& a2) { + array_operation_in_place_a_s(fn::functor_ip_multiplies< + ElementType, + ElementType>(), + a1.begin(), a2, N); + return a1; + } + + template + inline + tiny< + typename binary_operator_traits< + ElementType1, ElementType2>::arithmetic, N> + operator/( + tiny const& a1, + tiny const& a2) { + typedef tiny< + typename binary_operator_traits< + ElementType1, ElementType2>::arithmetic, N> + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a_a(fn::functor_divides< + return_element_type, + ElementType1, + ElementType2>(), + a1.begin(), a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + operator/( + tiny const& a1, + ElementType const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a_s(fn::functor_divides< + return_element_type, + ElementType, + ElementType>(), + a1.begin(), a2, result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + operator/( + ElementType const& a1, + tiny const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_s_a(fn::functor_divides< + return_element_type, + ElementType, + ElementType>(), + a1, a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny& + operator/=( + tiny& a1, + tiny const& a2) { + array_operation_in_place_a_a(fn::functor_ip_divides< + ElementType1, + ElementType2>(), + a1.begin(), a2.begin(), N); + return a1; + } + + template + inline + tiny& + operator/=( + tiny& a1, + ElementType const& a2) { + array_operation_in_place_a_s(fn::functor_ip_divides< + ElementType, + ElementType>(), + a1.begin(), a2, N); + return a1; + } + + template + inline + tiny< + typename binary_operator_traits< + ElementType1, ElementType2>::arithmetic, N> + operator%( + tiny const& a1, + tiny const& a2) { + typedef tiny< + typename binary_operator_traits< + ElementType1, ElementType2>::arithmetic, N> + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a_a(fn::functor_modulus< + return_element_type, + ElementType1, + ElementType2>(), + a1.begin(), a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + operator%( + tiny const& a1, + ElementType const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a_s(fn::functor_modulus< + return_element_type, + ElementType, + ElementType>(), + a1.begin(), a2, result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + operator%( + ElementType const& a1, + tiny const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_s_a(fn::functor_modulus< + return_element_type, + ElementType, + ElementType>(), + a1, a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny& + operator%=( + tiny& a1, + tiny const& a2) { + array_operation_in_place_a_a(fn::functor_ip_modulus< + ElementType1, + ElementType2>(), + a1.begin(), a2.begin(), N); + return a1; + } + + template + inline + tiny& + operator%=( + tiny& a1, + ElementType const& a2) { + array_operation_in_place_a_s(fn::functor_ip_modulus< + ElementType, + ElementType>(), + a1.begin(), a2, N); + return a1; + } + + template + inline + tiny + operator&&( + tiny const& a1, + tiny const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a_a(fn::functor_logical_and< + return_element_type, + ElementType1, + ElementType2>(), + a1.begin(), a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + operator&&( + tiny const& a1, + ElementType const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a_s(fn::functor_logical_and< + return_element_type, + ElementType, + ElementType>(), + a1.begin(), a2, result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + operator&&( + ElementType const& a1, + tiny const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_s_a(fn::functor_logical_and< + return_element_type, + ElementType, + ElementType>(), + a1, a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + operator||( + tiny const& a1, + tiny const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a_a(fn::functor_logical_or< + return_element_type, + ElementType1, + ElementType2>(), + a1.begin(), a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + operator||( + tiny const& a1, + ElementType const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a_s(fn::functor_logical_or< + return_element_type, + ElementType, + ElementType>(), + a1.begin(), a2, result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + operator||( + ElementType const& a1, + tiny const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_s_a(fn::functor_logical_or< + return_element_type, + ElementType, + ElementType>(), + a1, a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + operator==( + tiny const& a1, + tiny const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a_a(fn::functor_equal_to< + return_element_type, + ElementType1, + ElementType2>(), + a1.begin(), a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + operator==( + tiny const& a1, + ElementType const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a_s(fn::functor_equal_to< + return_element_type, + ElementType, + ElementType>(), + a1.begin(), a2, result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + operator==( + ElementType const& a1, + tiny const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_s_a(fn::functor_equal_to< + return_element_type, + ElementType, + ElementType>(), + a1, a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + operator!=( + tiny const& a1, + tiny const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a_a(fn::functor_not_equal_to< + return_element_type, + ElementType1, + ElementType2>(), + a1.begin(), a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + operator!=( + tiny const& a1, + ElementType const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a_s(fn::functor_not_equal_to< + return_element_type, + ElementType, + ElementType>(), + a1.begin(), a2, result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + operator!=( + ElementType const& a1, + tiny const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_s_a(fn::functor_not_equal_to< + return_element_type, + ElementType, + ElementType>(), + a1, a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + operator>( + tiny const& a1, + tiny const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a_a(fn::functor_greater< + return_element_type, + ElementType1, + ElementType2>(), + a1.begin(), a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + operator>( + tiny const& a1, + ElementType const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a_s(fn::functor_greater< + return_element_type, + ElementType, + ElementType>(), + a1.begin(), a2, result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + operator>( + ElementType const& a1, + tiny const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_s_a(fn::functor_greater< + return_element_type, + ElementType, + ElementType>(), + a1, a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + operator<( + tiny const& a1, + tiny const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a_a(fn::functor_less< + return_element_type, + ElementType1, + ElementType2>(), + a1.begin(), a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + operator<( + tiny const& a1, + ElementType const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a_s(fn::functor_less< + return_element_type, + ElementType, + ElementType>(), + a1.begin(), a2, result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + operator<( + ElementType const& a1, + tiny const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_s_a(fn::functor_less< + return_element_type, + ElementType, + ElementType>(), + a1, a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + operator>=( + tiny const& a1, + tiny const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a_a(fn::functor_greater_equal< + return_element_type, + ElementType1, + ElementType2>(), + a1.begin(), a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + operator>=( + tiny const& a1, + ElementType const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a_s(fn::functor_greater_equal< + return_element_type, + ElementType, + ElementType>(), + a1.begin(), a2, result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + operator>=( + ElementType const& a1, + tiny const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_s_a(fn::functor_greater_equal< + return_element_type, + ElementType, + ElementType>(), + a1, a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + operator<=( + tiny const& a1, + tiny const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a_a(fn::functor_less_equal< + return_element_type, + ElementType1, + ElementType2>(), + a1.begin(), a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + operator<=( + tiny const& a1, + ElementType const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a_s(fn::functor_less_equal< + return_element_type, + ElementType, + ElementType>(), + a1.begin(), a2, result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + operator<=( + ElementType const& a1, + tiny const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_s_a(fn::functor_less_equal< + return_element_type, + ElementType, + ElementType>(), + a1, a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + absolute(tiny const& a) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a(fn::functor_absolute(), + a.begin(), result.begin(), a.size(), true_type()); + return result; + } + + template + inline + tiny + pow2(tiny const& a) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a(fn::functor_pow2(), + a.begin(), result.begin(), a.size(), true_type()); + return result; + } + + template + inline + tiny + acos(tiny const& a) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a(fn::functor_acos(), + a.begin(), result.begin(), a.size(), true_type()); + return result; + } + + template + inline + tiny + cos(tiny const& a) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a(fn::functor_cos(), + a.begin(), result.begin(), a.size(), true_type()); + return result; + } + + template + inline + tiny + tan(tiny const& a) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a(fn::functor_tan(), + a.begin(), result.begin(), a.size(), true_type()); + return result; + } + + template + inline + tiny + asin(tiny const& a) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a(fn::functor_asin(), + a.begin(), result.begin(), a.size(), true_type()); + return result; + } + + template + inline + tiny + cosh(tiny const& a) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a(fn::functor_cosh(), + a.begin(), result.begin(), a.size(), true_type()); + return result; + } + + template + inline + tiny + tanh(tiny const& a) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a(fn::functor_tanh(), + a.begin(), result.begin(), a.size(), true_type()); + return result; + } + + template + inline + tiny + atan(tiny const& a) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a(fn::functor_atan(), + a.begin(), result.begin(), a.size(), true_type()); + return result; + } + + template + inline + tiny + exp(tiny const& a) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a(fn::functor_exp(), + a.begin(), result.begin(), a.size(), true_type()); + return result; + } + + template + inline + tiny + sin(tiny const& a) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a(fn::functor_sin(), + a.begin(), result.begin(), a.size(), true_type()); + return result; + } + + template + inline + tiny + fabs(tiny const& a) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a(fn::functor_fabs(), + a.begin(), result.begin(), a.size(), true_type()); + return result; + } + + template + inline + tiny + log(tiny const& a) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a(fn::functor_log(), + a.begin(), result.begin(), a.size(), true_type()); + return result; + } + + template + inline + tiny + sinh(tiny const& a) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a(fn::functor_sinh(), + a.begin(), result.begin(), a.size(), true_type()); + return result; + } + + template + inline + tiny + ceil(tiny const& a) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a(fn::functor_ceil(), + a.begin(), result.begin(), a.size(), true_type()); + return result; + } + + template + inline + tiny + floor(tiny const& a) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a(fn::functor_floor(), + a.begin(), result.begin(), a.size(), true_type()); + return result; + } + + template + inline + tiny + log10(tiny const& a) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a(fn::functor_log10(), + a.begin(), result.begin(), a.size(), true_type()); + return result; + } + + template + inline + tiny + sqrt(tiny const& a) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a(fn::functor_sqrt(), + a.begin(), result.begin(), a.size(), true_type()); + return result; + } + + template + inline + tiny + abs(tiny const& a) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a(fn::functor_abs(), + a.begin(), result.begin(), a.size(), true_type()); + return result; + } + + template + inline + tiny + conj(tiny const& a) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + return_array_type result; + array_operation_a(fn::functor_conj(), + a.begin(), result.begin(), a.size(), true_type()); + return result; + } + + template + inline + tiny + fmod_positive( + tiny const& a1, + tiny const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + + return_array_type result; + array_operation_a_a(fn::functor_fmod_positive< + return_element_type, ElementType1, ElementType2>(), + a1.begin(), a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + fmod_positive( + tiny const& a1, + ElementType const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + + return_array_type result; + array_operation_a_s(fn::functor_fmod_positive< + return_element_type, ElementType, ElementType>(), + a1.begin(), a2, result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + fmod_positive( + ElementType const& a1, + tiny const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + + return_array_type result; + array_operation_s_a(fn::functor_fmod_positive< + return_element_type, ElementType, ElementType>(), + a1, a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + fmod( + tiny const& a1, + tiny const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + + return_array_type result; + array_operation_a_a(fn::functor_fmod< + return_element_type, ElementType1, ElementType2>(), + a1.begin(), a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + fmod( + tiny const& a1, + ElementType const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + + return_array_type result; + array_operation_a_s(fn::functor_fmod< + return_element_type, ElementType, ElementType>(), + a1.begin(), a2, result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + fmod( + ElementType const& a1, + tiny const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + + return_array_type result; + array_operation_s_a(fn::functor_fmod< + return_element_type, ElementType, ElementType>(), + a1, a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + pow( + tiny const& a1, + tiny const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + + return_array_type result; + array_operation_a_a(fn::functor_pow< + return_element_type, ElementType1, ElementType2>(), + a1.begin(), a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + pow( + tiny const& a1, + ElementType const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + + return_array_type result; + array_operation_a_s(fn::functor_pow< + return_element_type, ElementType, ElementType>(), + a1.begin(), a2, result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + pow( + ElementType const& a1, + tiny const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + + return_array_type result; + array_operation_s_a(fn::functor_pow< + return_element_type, ElementType, ElementType>(), + a1, a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + atan2( + tiny const& a1, + tiny const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + + return_array_type result; + array_operation_a_a(fn::functor_atan2< + return_element_type, ElementType1, ElementType2>(), + a1.begin(), a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + atan2( + tiny const& a1, + ElementType const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + + return_array_type result; + array_operation_a_s(fn::functor_atan2< + return_element_type, ElementType, ElementType>(), + a1.begin(), a2, result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + atan2( + ElementType const& a1, + tiny const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + + return_array_type result; + array_operation_s_a(fn::functor_atan2< + return_element_type, ElementType, ElementType>(), + a1, a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + each_min( + tiny const& a1, + tiny const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + + return_array_type result; + array_operation_a_a(fn::functor_each_min< + return_element_type, ElementType1, ElementType2>(), + a1.begin(), a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + each_min( + tiny const& a1, + ElementType const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + + return_array_type result; + array_operation_a_s(fn::functor_each_min< + return_element_type, ElementType, ElementType>(), + a1.begin(), a2, result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + each_min( + ElementType const& a1, + tiny const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + + return_array_type result; + array_operation_s_a(fn::functor_each_min< + return_element_type, ElementType, ElementType>(), + a1, a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + each_max( + tiny const& a1, + tiny const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + + return_array_type result; + array_operation_a_a(fn::functor_each_max< + return_element_type, ElementType1, ElementType2>(), + a1.begin(), a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + each_max( + tiny const& a1, + ElementType const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + + return_array_type result; + array_operation_a_s(fn::functor_each_max< + return_element_type, ElementType, ElementType>(), + a1.begin(), a2, result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + each_max( + ElementType const& a1, + tiny const& a2) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + + return_array_type result; + array_operation_s_a(fn::functor_each_max< + return_element_type, ElementType, ElementType>(), + a1, a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + real(tiny, N> const& a) { + typedef tiny return_array_type; + return_array_type result; + array_operation_a(fn::functor_real< + ElementType, + std::complex >(), + a.begin(), result.begin(), a.size(), true_type()); + return result; + } + + template + inline + tiny + imag(tiny, N> const& a) { + typedef tiny return_array_type; + return_array_type result; + array_operation_a(fn::functor_imag< + ElementType, + std::complex >(), + a.begin(), result.begin(), a.size(), true_type()); + return result; + } + + template + inline + tiny + abs(tiny, N> const& a) { + typedef tiny return_array_type; + return_array_type result; + array_operation_a(fn::functor_abs< + ElementType, + std::complex >(), + a.begin(), result.begin(), a.size(), true_type()); + return result; + } + + template + inline + tiny + arg(tiny, N> const& a) { + typedef tiny return_array_type; + return_array_type result; + array_operation_a(fn::functor_arg< + ElementType, + std::complex >(), + a.begin(), result.begin(), a.size(), true_type()); + return result; + } + + template + inline + tiny + norm(tiny, N> const& a) { + typedef tiny return_array_type; + return_array_type result; + array_operation_a(fn::functor_norm< + ElementType, + std::complex >(), + a.begin(), result.begin(), a.size(), true_type()); + return result; + } + + template + inline + tiny, N> + pow( + tiny, N> const& a1, + tiny const& a2) { + typedef tiny, N> return_array_type; + return_array_type result; + array_operation_a_a(fn::functor_pow< + std::complex, + std::complex, + int >(), + a1.begin(), a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny, N> + pow( + tiny, N> const& a1, + int const& a2) { + typedef tiny, N> return_array_type; + return_array_type result; + array_operation_a_s(fn::functor_pow< + std::complex, + std::complex, + int >(), + a1.begin(), a2, result.begin(), N, true_type()); + return result; + } + + template + inline + tiny, N> + pow( + std::complex const& a1, + tiny const& a2) { + typedef tiny, N> return_array_type; + return_array_type result; + array_operation_s_a(fn::functor_pow< + std::complex, + std::complex, + int >(), + a1, a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny, N> + pow( + tiny, N> const& a1, + tiny const& a2) { + typedef tiny, N> return_array_type; + return_array_type result; + array_operation_a_a(fn::functor_pow< + std::complex, + std::complex, + ElementType >(), + a1.begin(), a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny, N> + pow( + tiny, N> const& a1, + ElementType const& a2) { + typedef tiny, N> return_array_type; + return_array_type result; + array_operation_a_s(fn::functor_pow< + std::complex, + std::complex, + ElementType >(), + a1.begin(), a2, result.begin(), N, true_type()); + return result; + } + + template + inline + tiny, N> + pow( + std::complex const& a1, + tiny const& a2) { + typedef tiny, N> return_array_type; + return_array_type result; + array_operation_s_a(fn::functor_pow< + std::complex, + std::complex, + ElementType >(), + a1, a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny, N> + pow( + tiny, N> const& a1, + tiny, N> const& a2) { + typedef tiny, N> return_array_type; + return_array_type result; + array_operation_a_a(fn::functor_pow< + std::complex, + std::complex, + std::complex >(), + a1.begin(), a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny, N> + pow( + tiny, N> const& a1, + std::complex const& a2) { + typedef tiny, N> return_array_type; + return_array_type result; + array_operation_a_s(fn::functor_pow< + std::complex, + std::complex, + std::complex >(), + a1.begin(), a2, result.begin(), N, true_type()); + return result; + } + + template + inline + tiny, N> + pow( + std::complex const& a1, + tiny, N> const& a2) { + typedef tiny, N> return_array_type; + return_array_type result; + array_operation_s_a(fn::functor_pow< + std::complex, + std::complex, + std::complex >(), + a1, a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny, N> + pow( + tiny const& a1, + tiny, N> const& a2) { + typedef tiny, N> return_array_type; + return_array_type result; + array_operation_a_a(fn::functor_pow< + std::complex, + ElementType, + std::complex >(), + a1.begin(), a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny, N> + pow( + tiny const& a1, + std::complex const& a2) { + typedef tiny, N> return_array_type; + return_array_type result; + array_operation_a_s(fn::functor_pow< + std::complex, + ElementType, + std::complex >(), + a1.begin(), a2, result.begin(), N, true_type()); + return result; + } + + template + inline + tiny, N> + pow( + ElementType const& a1, + tiny, N> const& a2) { + typedef tiny, N> return_array_type; + return_array_type result; + array_operation_s_a(fn::functor_pow< + std::complex, + ElementType, + std::complex >(), + a1, a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny, N> + polar( + tiny const& a1, + tiny const& a2) { + typedef tiny, N> return_array_type; + return_array_type result; + array_operation_a_a(fn::functor_polar< + std::complex, + ElementType, + ElementType >(), + a1.begin(), a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny, N> + polar( + tiny const& a1, + ElementType const& a2) { + typedef tiny, N> return_array_type; + return_array_type result; + array_operation_a_s(fn::functor_polar< + std::complex, + ElementType, + ElementType >(), + a1.begin(), a2, result.begin(), N, true_type()); + return result; + } + + template + inline + tiny, N> + polar( + ElementType const& a1, + tiny const& a2) { + typedef tiny, N> return_array_type; + return_array_type result; + array_operation_s_a(fn::functor_polar< + std::complex, + ElementType, + ElementType >(), + a1, a2.begin(), result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + approx_equal( + tiny const& a1, + tiny const& a2, + ElementType const& tolerance) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + + return_array_type result; + array_operation_a_a_s(fn::functor_approx_equal< + return_element_type, ElementType, ElementType, ElementType>(), + a1.begin(), a2.begin(), tolerance, + result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + approx_equal( + tiny const& a1, + ElementType const& a2, + ElementType const& tolerance) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + + return_array_type result; + array_operation_a_s_s(fn::functor_approx_equal< + return_element_type, ElementType, ElementType, ElementType>(), + a1.begin(), a2, tolerance, + result.begin(), N, true_type()); + return result; + } + + template + inline + tiny + approx_equal( + ElementType const& a1, + tiny const& a2, + ElementType const& tolerance) { + typedef tiny + return_array_type; + typedef typename return_array_type::value_type return_element_type; + + return_array_type result; + array_operation_s_a_s(fn::functor_approx_equal< + return_element_type, ElementType, ElementType, ElementType>(), + a1, a2.begin(), tolerance, + result.begin(), N, true_type()); + return result; + } + +}} // namespace scitbx::af + +#endif // DOXYGEN_SHOULD_SKIP_THIS + +#endif // SCITBX_ARRAY_FAMILY_TINY_ALGEBRA_H diff --git a/extern/cctbx/include/scitbx/array_family/tiny_mat_ref.h b/extern/cctbx/include/scitbx/array_family/tiny_mat_ref.h new file mode 100644 index 00000000..5745c946 --- /dev/null +++ b/extern/cctbx/include/scitbx/array_family/tiny_mat_ref.h @@ -0,0 +1,24 @@ +#include +#include + +namespace scitbx { namespace af { + + template + class tiny_mat_ref : public ref + { + public: + tiny_mat_ref(ElementType *storage) + : ref(storage, mat_grid(Rows, Cols)) + {} + }; + + template + class tiny_mat_const_ref : public const_ref + { + public: + tiny_mat_const_ref(ElementType const *storage) + : const_ref(storage, mat_grid(Rows, Cols)) + {} + }; + +}} diff --git a/extern/cctbx/include/scitbx/array_family/tiny_plain.h b/extern/cctbx/include/scitbx/array_family/tiny_plain.h new file mode 100644 index 00000000..bb4dfc3d --- /dev/null +++ b/extern/cctbx/include/scitbx/array_family/tiny_plain.h @@ -0,0 +1,59 @@ +#ifndef SCITBX_ARRAY_FAMILY_TINY_PLAIN_H +#define SCITBX_ARRAY_FAMILY_TINY_PLAIN_H + +#include +#include +#include +#include + +namespace scitbx { namespace af { + + // Automatic allocation, fixed size. + template + class tiny_plain + { + public: + SCITBX_ARRAY_FAMILY_TYPEDEFS + + BOOST_STATIC_CONSTANT(std::size_t, fixed_size=N); + + ElementType elems[N]; + + tiny_plain() {} + + template + tiny_plain(array_adaptor const& a_a) + { + OtherArrayType const& a = *(a_a.pointee); + if (a.size() != N) throw_range_error(); + for(std::size_t i=0;i + tiny_plain(array_adaptor_with_static_cast const& a_a) + { + OtherArrayType const& a = *(a_a.pointee); + if (a.size() != N) throw_range_error(); + for(std::size_t i=0;i(a[i]); + } + + SCITBX_ARRAY_FAMILY_TINY_CONVENIENCE_CONSTRUCTORS(tiny_plain) + SCITBX_ARRAY_FAMILY_TINY_COPY_AND_ASSIGNMENT(tiny_plain) + + static size_type size() { return N; } + static bool empty() { return false; } + static size_type max_size() { return N; } + static size_type capacity() { return N; } + + SCITBX_ARRAY_FAMILY_BEGIN_END_ETC(tiny_plain, elems, N) + + SCITBX_ARRAY_FAMILY_TAKE_REF(elems, N) + + void swap(ElementType* other) { + std::swap(*this, other); + } + }; + +}} // namespace scitbx::af + +#endif // SCITBX_ARRAY_FAMILY_TINY_PLAIN_H diff --git a/extern/cctbx/include/scitbx/array_family/tiny_reductions.h b/extern/cctbx/include/scitbx/array_family/tiny_reductions.h new file mode 100644 index 00000000..f221b131 --- /dev/null +++ b/extern/cctbx/include/scitbx/array_family/tiny_reductions.h @@ -0,0 +1,155 @@ +/* ***************************************************** + THIS IS AN AUTOMATICALLY GENERATED FILE. DO NOT EDIT. + ***************************************************** + + Generated by: + scitbx.source_generators.array_family.generate_reductions + */ + +#ifndef SCITBX_ARRAY_FAMILY_TINY_REDUCTIONS_H +#define SCITBX_ARRAY_FAMILY_TINY_REDUCTIONS_H + +#ifndef DOXYGEN_SHOULD_SKIP_THIS + +#include +#include + +namespace scitbx { namespace af { + + template + int + inline + order( + tiny_plain const& a1, + tiny_plain const& a2) + { + return order(a1.const_ref(), a2.const_ref()); + } + + template + inline + std::size_t + max_index(tiny_plain const& a) + { + return max_index(a.const_ref()); + } + + template + inline + std::size_t + min_index(tiny_plain const& a) + { + return min_index(a.const_ref()); + } + + template + inline + ElementType + max(tiny_plain const& a) + { + return max(a.const_ref()); + } + + template + inline + ElementType + min(tiny_plain const& a) + { + return min(a.const_ref()); + } + + template + inline + ElementType + max_absolute(tiny_plain const& a) + { + return max_absolute(a.const_ref()); + } + + template + inline + ElementType + sum(tiny_plain const& a) + { + return sum(a.const_ref()); + } + + template + inline + ElementType + sum_sq(tiny_plain const& a) + { + return sum_sq(a.const_ref()); + } + + template + inline + ElementType + product(tiny_plain const& a) + { + return product(a.const_ref()); + } + + template + inline + ElementType + mean(tiny_plain const& a) + { + return mean(a.const_ref()); + } + + template + inline + ElementType + mean_sq(tiny_plain const& a) + { + return mean_sq(a.const_ref()); + } + + template + inline + ElementTypeValues + mean_weighted( + tiny_plain const& values, + tiny_plain const& weights) + { + return mean_weighted(values.const_ref(), weights.const_ref()); + } + + template + inline + ElementTypeValues + mean_sq_weighted( + tiny_plain const& values, + tiny_plain const& weights) + { + return mean_sq_weighted(values.const_ref(), weights.const_ref()); + } + + template + inline + boost::optional + first_index(tiny_plain const& a, + PredicateType p) + { + return first_index(a.const_ref(), p); + } + + template + inline + boost::optional + last_index(tiny_plain const& a, + PredicateType p) + { + return last_index(a.const_ref(), p); + } + +}} // namespace scitbx::af + +#endif // DOXYGEN_SHOULD_SKIP_THIS + +#endif // SCITBX_ARRAY_FAMILY_TINY_REDUCTIONS_H + diff --git a/extern/cctbx/include/scitbx/array_family/tiny_types.h b/extern/cctbx/include/scitbx/array_family/tiny_types.h new file mode 100644 index 00000000..c1a81411 --- /dev/null +++ b/extern/cctbx/include/scitbx/array_family/tiny_types.h @@ -0,0 +1,115 @@ +#ifndef SCITBX_ARRAY_FAMILY_TINY_TYPES_H +#define SCITBX_ARRAY_FAMILY_TINY_TYPES_H + +#include + +namespace scitbx { namespace af { + + typedef tiny int2; + typedef tiny int3; + typedef tiny int4; + typedef tiny int6; + typedef tiny int9; + typedef tiny long3; + typedef tiny double2; + typedef tiny double3; + typedef tiny double4; + typedef tiny double6; + typedef tiny double9; + typedef tiny float2; + typedef tiny float3; + typedef tiny float4; + typedef tiny float6; + typedef tiny float9; + +}} // namespace scitbx::af + +#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) + +namespace boost { + + template<> + struct has_trivial_destructor { + static const bool value = true; + }; + + template<> + struct has_trivial_destructor { + static const bool value = true; + }; + + template<> + struct has_trivial_destructor { + static const bool value = true; + }; + + template<> + struct has_trivial_destructor { + static const bool value = true; + }; + + template<> + struct has_trivial_destructor { + static const bool value = true; + }; + + template<> + struct has_trivial_destructor { + static const bool value = true; + }; + + template<> + struct has_trivial_destructor { + static const bool value = true; + }; + + template<> + struct has_trivial_destructor { + static const bool value = true; + }; + + template<> + struct has_trivial_destructor { + static const bool value = true; + }; + + template<> + struct has_trivial_destructor { + static const bool value = true; + }; + + template<> + struct has_trivial_destructor { + static const bool value = true; + }; + + template<> + struct has_trivial_destructor { + static const bool value = true; + }; + + template<> + struct has_trivial_destructor { + static const bool value = true; + }; + + template<> + struct has_trivial_destructor { + static const bool value = true; + }; + + template<> + struct has_trivial_destructor { + static const bool value = true; + }; + + template<> + struct has_trivial_destructor { + static const bool value = true; + }; + +} + +#endif // !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) + +#endif // SCITBX_ARRAY_FAMILY_TINY_TYPES_H diff --git a/extern/cctbx/include/scitbx/array_family/type_traits.h b/extern/cctbx/include/scitbx/array_family/type_traits.h new file mode 100644 index 00000000..ef5e4fbf --- /dev/null +++ b/extern/cctbx/include/scitbx/array_family/type_traits.h @@ -0,0 +1,70 @@ +#ifndef SCITBX_ARRAY_FAMILY_TYPE_TRAITS_H +#define SCITBX_ARRAY_FAMILY_TYPE_TRAITS_H + +namespace scitbx { namespace af { + + struct false_type {}; + struct true_type {}; + +}} + +#include + +#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) + +#define SCITBX_ARRAY_FAMILY_STATIC_ASSERT_HAS_TRIVIAL_DESTRUCTOR + +namespace scitbx { namespace af { + + template + struct has_trivial_destructor { + typedef false_type value; + }; + +}} + +#else + +#include +#include +#define SCITBX_ARRAY_FAMILY_STATIC_ASSERT_HAS_TRIVIAL_DESTRUCTOR \ +{ \ + BOOST_STATIC_ASSERT(::boost::has_trivial_destructor::value); \ +} + +#include + +namespace boost { + template + struct has_trivial_destructor > { + // we really hope that this is true ... + static const bool value = ::boost::has_trivial_destructor::value; + }; +} + +namespace scitbx { namespace af { + + template + struct bool_as_type; + + template <> + struct bool_as_type { + typedef false_type value; + }; + + template <> + struct bool_as_type { + typedef true_type value; + }; + + template + struct has_trivial_destructor { + typedef typename bool_as_type< + ::boost::has_trivial_destructor::value>::value value; + }; + +}} + +#endif // defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) + +#endif // SCITBX_ARRAY_FAMILY_TYPE_TRAITS_H diff --git a/extern/cctbx/include/scitbx/constants.h b/extern/cctbx/include/scitbx/constants.h new file mode 100644 index 00000000..18801c5c --- /dev/null +++ b/extern/cctbx/include/scitbx/constants.h @@ -0,0 +1,59 @@ +/*! \file + General purpose mathematical or physical %constants. + */ + +#ifndef SCITBX_CONSTANTS_H +#define SCITBX_CONSTANTS_H + +#include + +namespace scitbx { + + //! General purpose mathematical or physical %constants. + namespace constants { + //! mathematical constant pi + static const double pi = 4. * std::atan(1.); + //! mathematical constant pi*pi + static const double pi_sq = pi * pi; + //! mathematical constant 2*pi + static const double two_pi = 8. * std::atan(1.); + //! mathematical constant 2*pi*pi + static const double two_pi_sq = 2. * pi_sq; + //! mathematical constant 4*pi + static const double four_pi = 16. * std::atan(1.); + //! mathematical constant 4*pi*pi + static const double four_pi_sq = two_pi * two_pi; + //! mathematical constant 8*pi*pi + static const double eight_pi_sq = 2. * four_pi_sq; + //! mathematical constant pi/2 + static const double pi_2 = 2. * std::atan(1.); + //! mathematical constant pi/180 + static const double pi_180 = std::atan(1.) / 45.; + + //! Factor for keV <-> Angstrom conversion. + /*! + http://physics.nist.gov/PhysRefData/codata86/table2.html + + h = Plank's Constant = 6.6260755e-34 J s + c = speed of light = 2.99792458e+8 m/s + 1 keV = 1.e+3 * 1.60217733e-19 J + 1 A = Angstrom = 1.e-10 m + + E = (h * c) / lamda; + + Exponents: (-34 + 8) - (3 - 19 - 10) = 0 + */ + static const double + factor_kev_angstrom = 6.6260755 * 2.99792458 / 1.60217733; + static const double + factor_ev_angstrom = 6626.0755 * 2.99792458 / 1.60217733; + } + + //! Conversions from degrees to radians. + inline double deg_as_rad(double deg) { return deg * constants::pi_180;} + //! Conversions from radians to degrees. + inline double rad_as_deg(double rad) { return rad / constants::pi_180;} + +} // namespace scitbx + +#endif // SCITBX_CONSTANTS_H diff --git a/extern/cctbx/include/scitbx/error.h b/extern/cctbx/include/scitbx/error.h new file mode 100644 index 00000000..0e440523 --- /dev/null +++ b/extern/cctbx/include/scitbx/error.h @@ -0,0 +1,79 @@ +/* ***************************************************** + THIS IS AN AUTOMATICALLY GENERATED FILE. DO NOT EDIT. + ***************************************************** + + Generated by: + scitbx.generate_error_h + */ + +/*! \file + Declarations and macros for exception handling. + */ + +#ifndef SCITBX_ERROR_H +#define SCITBX_ERROR_H + +#include +#include + +#define SCITBX_CHECK_POINT \ + std::cout << __FILE__ << "(" << __LINE__ << ")" << std::endl << std::flush +#define SCITBX_CHECK_POINT_MSG(msg) \ + std::cout << msg << " @ " __FILE__ << "(" << __LINE__ << ")" \ + << std::endl << std::flush +#define SCITBX_EXAMINE(A) \ + std::cout << "variable " << #A << ": " << A << std::endl << std::flush + +//! Common scitbx namespace. +namespace scitbx { + + //! All scitbx exceptions are derived from this class. + class error : public ::scitbx::error_base + { + public: + + //! General scitbx error message. + explicit + error(std::string const& msg) throw() + : ::scitbx::error_base("scitbx", msg) + {} + + //! Error message with file name and line number. + /*! Used by the macros below. + */ + error(const char* file, long line, std::string const& msg = "", + bool internal = true) throw() + : ::scitbx::error_base("scitbx", file, line, msg, internal) + {} + }; + + //! Special class for "Index out of range." exceptions. + /*! These exceptions are propagated to Python as IndexError. + */ + class error_index : public error + { + public: + //! Default constructor. The message may be customized. + explicit + error_index(std::string const& msg = "Index out of range.") throw() + : error(msg) + {} + }; + +} // namespace scitbx + +//! For throwing an error exception with file name, line number, and message. +#define SCITBX_ERROR(msg) \ + SCITBX_ERROR_UTILS_REPORT(scitbx::error, msg) +//! For throwing an "Internal Error" exception. +#define SCITBX_INTERNAL_ERROR() \ + SCITBX_ERROR_UTILS_REPORT_INTERNAL(scitbx::error) +//! For throwing a "Not implemented" exception. +#define SCITBX_NOT_IMPLEMENTED() \ + SCITBX_ERROR_UTILS_REPORT_NOT_IMPLEMENTED(scitbx::error) + +//! Custom scitbx assertion. +#define SCITBX_ASSERT(assertion) \ + SCITBX_ERROR_UTILS_ASSERT(scitbx::error, SCITBX_ASSERT, assertion) + +#endif // SCITBX_ERROR_H diff --git a/extern/cctbx/include/scitbx/error_utils.h b/extern/cctbx/include/scitbx/error_utils.h new file mode 100644 index 00000000..a8c5908c --- /dev/null +++ b/extern/cctbx/include/scitbx/error_utils.h @@ -0,0 +1,169 @@ +#ifndef SCITBX_ERROR_UTILS_H +#define SCITBX_ERROR_UTILS_H + +#include +#include +#include +#include + +#ifdef _MSC_VER +# pragma warning(disable:4355) +#endif + +namespace scitbx { + + //! Exception which can plug into the SCITBX_ERROR_UTILS_ASSERT trickery + /*! + This class is aimed at being inherited from: + class error : public std::exception, protected scitbx::error_base + { + // define constructors + } + */ + template + class error_base : public std::exception + { + public: + DerivedError &SCITBX_ERROR_UTILS_ASSERT_A, &SCITBX_ERROR_UTILS_ASSERT_B; + + DerivedError& derived_this() throw(); + + error_base(std::string const& prefix, std::string const& msg) throw(); + + error_base( + std::string const& prefix, + const char* file, long line, + std::string const& msg = "", + bool internal = true) throw(); + + error_base(error_base const& e) throw(); + + virtual ~error_base() throw(); + + virtual const char* + what() const throw(); + + template + DerivedError& + with_current_value(const T& value, const char* label); + + protected: + std::string msg_; + }; + + template + DerivedError& error_base + ::derived_this() throw() + { + return static_cast(*this); + } + + template + error_base + ::error_base( + std::string const& prefix, + std::string const& msg) throw() + : + SCITBX_ERROR_UTILS_ASSERT_A(derived_this()), + SCITBX_ERROR_UTILS_ASSERT_B(derived_this()) + { + std::ostringstream o; + o << prefix << " Error: " << msg; + msg_ = o.str(); + } + + template + error_base + ::error_base( + std::string const& prefix, + const char* file, long line, + std::string const& msg, + bool internal) throw() + : + SCITBX_ERROR_UTILS_ASSERT_A(derived_this()), + SCITBX_ERROR_UTILS_ASSERT_B(derived_this()) + { + std::ostringstream o; + o << prefix; + if (internal) o << " Internal"; + o << " Error: " << file << "(" << line << ")"; + if (msg.size()) o << ": " << msg; + msg_ = o.str(); + } + + template + error_base + ::error_base(error_base const& e) throw() + : + std::exception(e), + SCITBX_ERROR_UTILS_ASSERT_A(derived_this()), + SCITBX_ERROR_UTILS_ASSERT_B(derived_this()) + { + msg_ += e.msg_; + } + + template + error_base + ::~error_base() throw() {} + + template + const char* + error_base + ::what() const throw() { return msg_.c_str(); } + + template + template + DerivedError& error_base + ::with_current_value( + const T& value, + const char* label) + { + std::ostringstream o; + o << "\n" << " " << label << " = " << value; + msg_ += o.str(); + return derived_this(); + } + +} // namespace scitbx + +//! For throwing an error exception with file name, line number, and message. +#define SCITBX_ERROR_UTILS_REPORT(error_class, msg) \ + error_class(__FILE__, __LINE__, msg, false) +//! For throwing an "Internal Error" exception. +#define SCITBX_ERROR_UTILS_REPORT_INTERNAL(error_class) \ + error_class(__FILE__, __LINE__) +//! For throwing a "Not implemented" exception. +#define SCITBX_ERROR_UTILS_REPORT_NOT_IMPLEMENTED(error_class) \ + error_class(__FILE__, __LINE__, "Not implemented.") + +//! Custom assertion. +/*! +Here is an example of use: + \code + SCITBX_ERROR_UTILS_ASSERT(error_class, n > 0 && m < n)(m)(n); + \endcode + The first parenthesis contains the expression to assert whereas the subsequent + parentheses contain the variables whose values will be reported upon failure of + the assertion. The C++ stream system must know how to handle the type of m and + n through the operator <<. + If the condition is violated, an instance of error_class is thrown. That + class should inherit from error_format as explained in the + documentation of error_format. + + The implementation uses the tricks described in [1]. + + [1] A. Alexandrescu and J. Torjo, "Enhancing Assertions", + C/C++ Users Journal, August 2003 + */ + +#define SCITBX_ERROR_UTILS_ASSERT_A(x) SCITBX_ERROR_UTILS_ASSERT_OP(x, B) +#define SCITBX_ERROR_UTILS_ASSERT_B(x) SCITBX_ERROR_UTILS_ASSERT_OP(x, A) +#define SCITBX_ERROR_UTILS_ASSERT_OP(x, next) \ + SCITBX_ERROR_UTILS_ASSERT_A.with_current_value( \ + (x), #x).SCITBX_ERROR_UTILS_ASSERT_ ## next + +#define SCITBX_ERROR_UTILS_ASSERT(error_class, assert_macro, assertion) \ + if (!(assertion)) throw error_class(__FILE__, __LINE__, \ + #assert_macro"(" # assertion ") failure.").SCITBX_ERROR_UTILS_ASSERT_A + +#endif // SCITBX_ERROR_UTILS_H diff --git a/extern/cctbx/include/scitbx/mat3.h b/extern/cctbx/include/scitbx/mat3.h new file mode 100644 index 00000000..9b9a1a16 --- /dev/null +++ b/extern/cctbx/include/scitbx/mat3.h @@ -0,0 +1,977 @@ +#ifndef SCITBX_MAT3_H +#define SCITBX_MAT3_H + +#include +#include +#include +#include + +namespace scitbx { + + // forward declaration + template + class sym_mat3; + + //! Matrix class (3x3). + /*! This class represents a 3x3 matrix that can be used to store + linear transformations. + + Enhanced version of the python mat3 class by + Matthias Baas (baas@ira.uka.de). See + http://cgkit.sourceforge.net/ + for more information. + */ + template + class mat3 : public af::tiny_plain + { + public: + typedef typename af::tiny_plain base_type; + + //! Default constructor. Elements are not initialized. + mat3() {} + //! Constructor. + mat3(NumType const& e00, NumType const& e01, NumType const& e02, + NumType const& e10, NumType const& e11, NumType const& e12, + NumType const& e20, NumType const& e21, NumType const& e22) + : base_type(e00, e01, e02, e10, e11, e12, e20, e21, e22) + {} + //! Constructor. + mat3(base_type const& a) + : base_type(a) + {} + //! Constructor. + explicit + mat3(const NumType* a) + { + for(std::size_t i=0;i<9;i++) this->elems[i] = a[i]; + } + //! Constructor for diagonal matrix. + explicit + mat3(NumType const& diag) + : base_type(diag,0,0,0,diag,0,0,0,diag) + {} + //! Constructor for diagonal matrix. + explicit + mat3(NumType const& diag0, NumType const& diag1, NumType const& diag2) + : base_type(diag0,0,0,0,diag1,0,0,0,diag2) + {} + //! Constructor for diagonal matrix. + explicit + mat3(af::tiny_plain const& diag) + : base_type(diag[0],0,0,0,diag[1],0,0,0,diag[2]) + {} + //! Construction from symmetric matrix. + explicit + inline + mat3(sym_mat3 const& m); + + //! Access elements with 2-dimensional indices. + NumType const& + operator()(std::size_t r, std::size_t c) const + { + return this->elems[r * 3 + c]; + } + //! Access elements with 2-dimensional indices. + NumType& + operator()(std::size_t r, std::size_t c) + { + return this->elems[r * 3 + c]; + } + + //! Return a row. + vec3 + get_row(std::size_t i) const + { + return vec3(&this->elems[i * 3]); + } + + //! Set a row. + void + set_row(std::size_t i, af::tiny_plain const& v) + { + std::copy(v.begin(), v.end(), &this->elems[i * 3]); + } + + //! Swap two rows in place. + void + swap_rows(std::size_t i1, std::size_t i2) + { + std::swap_ranges(&(*this)(i1,0), &(*this)(i1+1,0), &(*this)(i2,0)); + } + + //! Return a column. + vec3 + get_column(std::size_t i) const + { + vec3 result; + for(std::size_t j=0;j<3;j++) result[j] = this->elems[j * 3 + i]; + return result; + } + + //! Set a column. + void + set_column(std::size_t i, af::tiny_plain const& v) + { + for(std::size_t j=0;j<3;j++) this->elems[j * 3 + i] = v[j]; + } + + //! Swap two columns in place. + void + swap_columns(std::size_t i1, std::size_t i2) + { + for(std::size_t i=0;i<9;i+=3) { + std::swap(this->elems[i + i1], this->elems[i + i2]); + } + } + + //! Return diagonal elements. + vec3 + diagonal() const + { + mat3 const& m = *this; + return vec3(m[0], m[4], m[8]); + } + + //! Return the transposed matrix. + mat3 + transpose() const + { + mat3 const& m = *this; + return mat3(m[0], m[3], m[6], + m[1], m[4], m[7], + m[2], m[5], m[8]); + } + + //! Return trace (sum of diagonal elements). + NumType + trace() const + { + mat3 const& m = *this; + return m[0] + m[4] + m[8]; + } + + //! Return determinant. + NumType + determinant() const + { + mat3 const& m = *this; + return m[0] * (m[4] * m[8] - m[5] * m[7]) + - m[1] * (m[3] * m[8] - m[5] * m[6]) + + m[2] * (m[3] * m[7] - m[4] * m[6]); + } + + //! Maximum of the absolute values of the elements of this matrix. + NumType + max_abs() const + { + return af::max_absolute(this->const_ref()); + } + + //! Test for symmetric matrix. + /*! Returns false if the absolute value of the difference between + any pair of off-diagonal elements is different from zero. + */ + bool + is_symmetric() const + { + mat3 const& m = *this; + return m[1] == m[3] + && m[2] == m[6] + && m[5] == m[7]; + } + + //! Test for symmetric matrix. + /*! Returns false if the absolute value of the difference between + any pair of off-diagonal elements is larger than + max_abs()*relative_tolerance. + */ + bool + is_symmetric(NumType const& relative_tolerance) const + { + mat3 const& m = *this; + NumType tolerance = max_abs() * relative_tolerance; + return fn::approx_equal(m[1], m[3], tolerance) + && fn::approx_equal(m[2], m[6], tolerance) + && fn::approx_equal(m[5], m[7], tolerance); + } + + bool + is_diagonal() const + { + mat3 const& m = *this; + return ( m[1]==0 && m[2]==0 + && m[3]==0 && m[5]==0 + && m[6]==0 && m[7]==0); + } + + //! Return the transposed of the co-factor matrix. + /*! The inverse matrix is obtained by dividing the result + by the determinant(). + */ + mat3 + co_factor_matrix_transposed() const + { + mat3 const& m = *this; + return mat3( + m[4] * m[8] - m[5] * m[7], + -m[1] * m[8] + m[2] * m[7], + m[1] * m[5] - m[2] * m[4], + -m[3] * m[8] + m[5] * m[6], + m[0] * m[8] - m[2] * m[6], + -m[0] * m[5] + m[2] * m[3], + m[3] * m[7] - m[4] * m[6], + -m[0] * m[7] + m[1] * m[6], + m[0] * m[4] - m[1] * m[3]); + } + + //! Return the inverse matrix. + /*! An exception is thrown if the matrix is not invertible, + i.e. if the determinant() is zero. + */ + mat3 + inverse() const + { + NumType d = determinant(); + if (d == NumType(0)) throw error("Matrix is not invertible."); + return co_factor_matrix_transposed() / d; + } + + //! Returns the inverse matrix, after minimizing the error numerically. + /*! Here's the theory: + M*M^-1 = I-E, where E is the error + M*M^-1*(I+E) = (I-E)*(I+E) + M*(M^-1*(I+E)) = I^2-E^2 + M*(M^-1*(I+E)) = I-E^2 + let M^-1*(I+E) = M1 + let E^2 = E2 + M*M1*(I+E2) = (I-E2)*(I+E2) + M*M2 = I-E4 + M*Mi = I-E2^i + Supposedly this will drive the error pretty low after + only a few repetitions. The error rate should be ~E^(2^iterations), + which I think is pretty good. This assumes that E is "<< 1", + whatever that means. Attributed to Judah I. Rosenblatt. + + 2*I - (I-E) ==> 2*I - I + E = I + E + */ + mat3 + error_minimizing_inverse ( std::size_t iterations ) const + { + mat3 inverse = this->inverse(); + if ( 0 == iterations ) + return inverse; + mat3 two_diagonal(2); + for ( std::size_t i=0; i const& v) + { + for(std::size_t i=0;i<9;) { + for(std::size_t j=0;j<3;j++,i++) { + this->elems[i] *= v[j]; + } + } + return *this; + } + + //! Return a matrix with orthogonal base vectors. + mat3 ortho() const; + + //! Decomposes the matrix into a rotation and scaling part. + std::pair > + decompose() const; + + //! (*this) * this->transpose(). + inline + sym_mat3 + self_times_self_transpose() const; + + //! this->transpose() * (*this). + inline + sym_mat3 + self_transpose_times_self() const; + + //! Sum of element-wise products. + inline + NumType + dot(mat3 const& other) const + { + mat3 const& m = *this; + return m[0] * other[0] + + m[1] * other[1] + + m[2] * other[2] + + m[3] * other[3] + + m[4] * other[4] + + m[5] * other[5] + + m[6] * other[6] + + m[7] * other[7] + + m[8] * other[8]; + } + + //! Matrix associated with vector cross product. + /*! a.cross(b) is equivalent to cross_product_matrix(a) * b. + Useful for simplification of equations. Used frequently in + robotics and classical mechanics literature. + */ + static + mat3 + cross_product_matrix( + vec3 const& v) + { + return mat3( + 0, -v[2], v[1], + v[2], 0, -v[0], + -v[1], v[0], 0); + } + + /// Matrix associated with symmetric rank-2 tensor transform + /** The change of basis of such a tensor U reads + \f[ U' = R U R^T \f] + where \f$U, U'\f$ are represented as symmetric matrices. + If, on the other hand, \f$U\f$ is represented as a vector + \f[ u = (u_{11}, u_{22}, u_{33}, u_{12}, u_{13}, u_{23}) \f] + and similarly \f$U'\f$, then the change of basis may be written + as a linear transformation + \f[ u' = P u \] + where \f$P\f$ reads + \f[ P = \begin{bmatrix} + r_{11}^2 & r_{12}^2 & r_{13}^2 & + 2 r_{11} r_{12} & 2 r_{11} r_{13} & 2 r_{12} r_{13} \\ + r_{21}^2 & r_{22}^2 & r_{23}^2 & + 2 r_{21} r_{22} & 2 r_{21} r_{23} & 2 r_{22} r_{23} \\ + r_{31}^2 & r_{32}^2 & r_{33}^2 & + 2 r_{31} r_{32} & 2 r_{31} r_{33} & 2 r_{32} r_{33} \\ + r_{11} r_{21} & r_{12} r_{22} & r_{13} r_{23} & + r_{12} r_{21} + r_{11} r_{22} & + r_{13} r_{21} + r_{11} r_{23} & + r_{13} r_{22} + r_{12} r_{23} \\ + r_{11} r_{31} & r_{12} r_{32} & r_{13} r_{33} & + r_{12} r_{31} + r_{11} r_{32} & + r_{13} r_{31} + r_{11} r_{33} & + r_{13} r_{32} + r_{12} r_{33} \\ + r_{21} r_{31} & r_{22} r_{32} & r_{23} r_{33} & + r_{22} r_{31} + r_{21} r_{32} & + r_{23} r_{31} + r_{21} r_{33} & + r_{23} r_{32} + r_{22} r_{33} + \end{bmatrix} + C.f. scitbx/matrix/tensor_transform_as_linear_map.nb + for the Mathematica code used to obtain this result. + + The result is a matrix stored by row. + */ + af::tiny tensor_transform_matrix() const { + af::tiny result; + NumType *p = result.begin(); + + mat3 const &m = *this; + NumType r11 = m[0], r12 = m[1], r13 = m[2], + r21 = m[3], r22 = m[4], r23 = m[5], + r31 = m[6], r32 = m[7], r33 = m[8]; + + // 1st row + *p++ = r11*r11; + *p++ = r12*r12; + *p++ = r13*r13; + *p++ = 2*r11*r12; + *p++ = 2*r11*r13; + *p++ = 2*r12*r13; + + // 2nd row + *p++ = r21*r21; + *p++ = r22*r22; + *p++ = r23*r23; + *p++ = 2*r21*r22; + *p++ = 2*r21*r23; + *p++ = 2*r22*r23; + + // 3rd row + *p++ = r31*r31; + *p++ = r32*r32; + *p++ = r33*r33; + *p++ = 2*r31*r32; + *p++ = 2*r31*r33; + *p++ = 2*r32*r33; + + // 4th row + *p++ = r11*r21; + *p++ = r12*r22; + *p++ = r13*r23; + *p++ = r12*r21 + r11*r22; + *p++ = r13*r21 + r11*r23; + *p++ = r13*r22 + r12*r23; + + // 5th row + *p++ = r11*r31; + *p++ = r12*r32; + *p++ = r13*r33; + *p++ = r12*r31 + r11*r32; + *p++ = r13*r31 + r11*r33; + *p++ = r13*r32 + r12*r33; + + // 6th row + *p++ = r21*r31; + *p++ = r22*r32; + *p++ = r23*r33; + *p++ = r22*r31 + r21*r32; + *p++ = r23*r31 + r21*r33; + *p++ = r23*r32 + r22*r33; + + return result; + } + }; + + // non-inline member function + template + mat3 + mat3::ortho() const + { + vec3 x = get_column(0); + vec3 y = get_column(1); + vec3 z = get_column(2); + NumType xl = x.length_sq(); + y = y - ((x * y) / xl) * x; + z = z - ((x * z) / xl) * x; + NumType yl = y.length_sq(); + z = z - ((y * z) / yl) * y; + return mat3(x[0], y[0], z[0], + x[1], y[1], z[1], + x[2], y[2], z[2]); + } + + // non-inline member function + template + std::pair, vec3 > + mat3::decompose() const + { + mat3 ro = ortho(); + vec3 x = ro.get_column(0); + vec3 y = ro.get_column(1); + vec3 z = ro.get_column(2); + NumType xl = x.length(); + NumType yl = y.length(); + NumType zl = z.length(); + vec3 sc(xl, yl, zl); + x /= xl; + y /= yl; + z /= zl; + ro.set_column(0, x); + ro.set_column(1, y); + ro.set_column(2, z); + if (ro.determinant() < NumType(0)) { + ro.set_column(0, -x); + sc[0] = -sc[0]; + } + return std::make_pair(ro, sc); + } + + //! Test equality. + template + inline + bool + operator==( + mat3 const& lhs, + mat3 const& rhs) + { + for(std::size_t i=0;i<9;i++) { + if (lhs[i] != rhs[i]) return false; + } + return true; + } + + //! Test equality. True if all elements of lhs == rhs. + template + inline + bool + operator==( + mat3 const& lhs, + NumType const& rhs) + { + for(std::size_t i=0;i<9;i++) { + if (lhs[i] != rhs ) return false; + } + return true; + } + + //! Test equality. True if all elements of rhs == lhs. + template + inline + bool + operator==( + NumType const& lhs, + mat3 const& rhs) + { + for(std::size_t i=0;i<9;i++) { + if (lhs != rhs[i]) return false; + } + return true; + } + + //! Test inequality. + template + inline + bool + operator!=( + mat3 const& lhs, + mat3 const& rhs) + { + return !(lhs == rhs); + } + + //! Test inequality. True if any element of lhs != rhs. + template + inline + bool + operator!=( + mat3 const& lhs, + NumType const& rhs) + { + return !(lhs == rhs); + } + + //! Test inequality. True if any element of rhs != lhs. + template + inline + bool + operator!=( + NumType const& lhs, + mat3 const& rhs) + { + return !(lhs == rhs); + } + + //! Element-wise addition. + template + inline + mat3 + operator+( + mat3 const& lhs, + mat3 const& rhs) + { + mat3 result; + for(std::size_t i=0;i<9;i++) { + result[i] = lhs[i] + rhs[i]; + } + return result; + } + + //! Element-wise addition. + template + inline + mat3 + operator+( + mat3 const& lhs, + NumType const& rhs) + { + mat3 result; + for(std::size_t i=0;i<9;i++) { + result[i] = lhs[i] + rhs ; + } + return result; + } + + //! Element-wise addition. + template + inline + mat3 + operator+( + NumType const& lhs, + mat3 const& rhs) + { + mat3 result; + for(std::size_t i=0;i<9;i++) { + result[i] = lhs + rhs[i]; + } + return result; + } + + //! Element-wise difference. + template + inline + mat3 + operator-( + mat3 const& lhs, + mat3 const& rhs) + { + mat3 result; + for(std::size_t i=0;i<9;i++) { + result[i] = lhs[i] - rhs[i]; + } + return result; + } + + //! Element-wise difference. + template + inline + mat3 + operator-( + mat3 const& lhs, + NumType const& rhs) + { + mat3 result; + for(std::size_t i=0;i<9;i++) { + result[i] = lhs[i] - rhs ; + } + return result; + } + + //! Element-wise difference. + template + inline + mat3 + operator-( + NumType const& lhs, + mat3 const& rhs) + { + mat3 result; + for(std::size_t i=0;i<9;i++) { + result[i] = lhs - rhs[i]; + } + return result; + } + + //! Matrix * matrix product. + template + inline + mat3< + typename af::binary_operator_traits< + NumTypeLhs, NumTypeRhs>::arithmetic> + operator*( + mat3 const& lhs, + mat3 const& rhs) + { + return mat3< + typename af::binary_operator_traits< + NumTypeLhs, NumTypeRhs>::arithmetic>( + lhs[0]*rhs[0]+lhs[1]*rhs[3]+lhs[2]*rhs[6], + lhs[0]*rhs[1]+lhs[1]*rhs[4]+lhs[2]*rhs[7], + lhs[0]*rhs[2]+lhs[1]*rhs[5]+lhs[2]*rhs[8], + lhs[3]*rhs[0]+lhs[4]*rhs[3]+lhs[5]*rhs[6], + lhs[3]*rhs[1]+lhs[4]*rhs[4]+lhs[5]*rhs[7], + lhs[3]*rhs[2]+lhs[4]*rhs[5]+lhs[5]*rhs[8], + lhs[6]*rhs[0]+lhs[7]*rhs[3]+lhs[8]*rhs[6], + lhs[6]*rhs[1]+lhs[7]*rhs[4]+lhs[8]*rhs[7], + lhs[6]*rhs[2]+lhs[7]*rhs[5]+lhs[8]*rhs[8]); + } + + //! lhs.transpose() * rhs + template + inline + mat3< + typename af::binary_operator_traits< + NumTypeLhs, NumTypeRhs>::arithmetic> + transpose_mul( + mat3 const& lhs, + mat3 const& rhs) + { + return mat3< + typename af::binary_operator_traits< + NumTypeLhs, NumTypeRhs>::arithmetic>( + lhs[0]*rhs[0]+lhs[3]*rhs[3]+lhs[6]*rhs[6], + lhs[0]*rhs[1]+lhs[3]*rhs[4]+lhs[6]*rhs[7], + lhs[0]*rhs[2]+lhs[3]*rhs[5]+lhs[6]*rhs[8], + lhs[1]*rhs[0]+lhs[4]*rhs[3]+lhs[7]*rhs[6], + lhs[1]*rhs[1]+lhs[4]*rhs[4]+lhs[7]*rhs[7], + lhs[1]*rhs[2]+lhs[4]*rhs[5]+lhs[7]*rhs[8], + lhs[2]*rhs[0]+lhs[5]*rhs[3]+lhs[8]*rhs[6], + lhs[2]*rhs[1]+lhs[5]*rhs[4]+lhs[8]*rhs[7], + lhs[2]*rhs[2]+lhs[5]*rhs[5]+lhs[8]*rhs[8]); + } + + //! lhs * rhs.transpose() + template + inline + mat3< + typename af::binary_operator_traits< + NumTypeLhs, NumTypeRhs>::arithmetic> + mul_transpose( + mat3 const& lhs, + mat3 const& rhs) + { + return mat3< + typename af::binary_operator_traits< + NumTypeLhs, NumTypeRhs>::arithmetic>( + lhs[0]*rhs[0]+lhs[1]*rhs[1]+lhs[2]*rhs[2], + lhs[0]*rhs[3]+lhs[1]*rhs[4]+lhs[2]*rhs[5], + lhs[0]*rhs[6]+lhs[1]*rhs[7]+lhs[2]*rhs[8], + lhs[3]*rhs[0]+lhs[4]*rhs[1]+lhs[5]*rhs[2], + lhs[3]*rhs[3]+lhs[4]*rhs[4]+lhs[5]*rhs[5], + lhs[3]*rhs[6]+lhs[4]*rhs[7]+lhs[5]*rhs[8], + lhs[6]*rhs[0]+lhs[7]*rhs[1]+lhs[8]*rhs[2], + lhs[6]*rhs[3]+lhs[7]*rhs[4]+lhs[8]*rhs[5], + lhs[6]*rhs[6]+lhs[7]*rhs[7]+lhs[8]*rhs[8]); + } + + //! Matrix * vector product. + template + inline + vec3< + typename af::binary_operator_traits< + NumTypeMatrix, NumTypeVector>::arithmetic> + operator*( + mat3 const& lhs, + af::tiny_plain const& rhs) + { + return vec3< + typename af::binary_operator_traits< + NumTypeMatrix, NumTypeVector>::arithmetic>( + lhs[0]*rhs[0]+lhs[1]*rhs[1]+lhs[2]*rhs[2], + lhs[3]*rhs[0]+lhs[4]*rhs[1]+lhs[5]*rhs[2], + lhs[6]*rhs[0]+lhs[7]*rhs[1]+lhs[8]*rhs[2]); + } + + //! Vector * matrix product. + template + inline + vec3< + typename af::binary_operator_traits< + NumTypeMatrix, NumTypeVector>::arithmetic> + operator*( + af::tiny_plain const& lhs, + mat3 const& rhs) + { + return vec3< + typename af::binary_operator_traits< + NumTypeMatrix, NumTypeVector>::arithmetic>( + lhs[0]*rhs[0]+lhs[1]*rhs[3]+lhs[2]*rhs[6], + lhs[0]*rhs[1]+lhs[1]*rhs[4]+lhs[2]*rhs[7], + lhs[0]*rhs[2]+lhs[1]*rhs[5]+lhs[2]*rhs[8]); + } + + //! Element-wise multiplication. + template + inline + mat3 + operator*( + mat3 const& lhs, + NumType const& rhs) + { + mat3 result; + for(std::size_t i=0;i<9;i++) { + result[i] = lhs[i] * rhs ; + } + return result; + } + + //! Element-wise multiplication. + template + inline + mat3 + operator*( + NumType const& lhs, + mat3 const& rhs) + { + mat3 result; + for(std::size_t i=0;i<9;i++) { + result[i] = lhs * rhs[i]; + } + return result; + } + + //! Element-wise division. + template + inline + mat3 + operator/( + mat3 const& lhs, + NumType const& rhs) + { + mat3 result; + for(std::size_t i=0;i<9;i++) { + result[i] = lhs[i] / rhs ; + } + return result; + } + + //! Element-wise division. + template + inline + mat3 + operator/( + NumType const& lhs, + mat3 const& rhs) + { + mat3 result; + for(std::size_t i=0;i<9;i++) { + result[i] = lhs / rhs[i]; + } + return result; + } + + //! Element-wise modulus operation. + template + inline + mat3 + operator%( + mat3 const& lhs, + NumType const& rhs) + { + mat3 result; + for(std::size_t i=0;i<9;i++) { + result[i] = lhs[i] % rhs ; + } + return result; + } + + //! Element-wise modulus operation. + template + inline + mat3 + operator%( + NumType const& lhs, + mat3 const& rhs) + { + mat3 result; + for(std::size_t i=0;i<9;i++) { + result[i] = lhs % rhs[i]; + } + return result; + } + + //! Element-wise in-place addition. + template + inline + mat3& + operator+=( + mat3& lhs, + mat3 const& rhs) + { + for(std::size_t i=0;i<9;i++) { + lhs[i] += rhs[i]; + } + return lhs; + } + + //! Element-wise in-place addition. + template + inline + mat3& + operator+=( + mat3& lhs, + NumType const& rhs) + { + for(std::size_t i=0;i<9;i++) { + lhs[i] += rhs ; + } + return lhs; + } + + //! Element-wise in-place difference. + template + inline + mat3& + operator-=( + mat3& lhs, + mat3 const& rhs) + { + for(std::size_t i=0;i<9;i++) { + lhs[i] -= rhs[i]; + } + return lhs; + } + + //! Element-wise in-place difference. + template + inline + mat3& + operator-=( + mat3& lhs, + NumType const& rhs) + { + for(std::size_t i=0;i<9;i++) { + lhs[i] -= rhs ; + } + return lhs; + } + + //! Element-wise in-place multiplication. + template + inline + mat3& + operator*=( + mat3& lhs, + NumType const& rhs) + { + for(std::size_t i=0;i<9;i++) { + lhs[i] *= rhs ; + } + return lhs; + } + + //! Element-wise in-place division. + template + inline + mat3& + operator/=( + mat3& lhs, + NumType const& rhs) + { + for(std::size_t i=0;i<9;i++) { + lhs[i] /= rhs ; + } + return lhs; + } + + //! Element-wise in-place modulus operation. + template + inline + mat3& + operator%=( + mat3& lhs, + NumType const& rhs) + { + for(std::size_t i=0;i<9;i++) { + lhs[i] %= rhs ; + } + return lhs; + } + + //! Element-wise unary minus. + template + inline + mat3 + operator-( + mat3 const& v) + { + mat3 result; + for(std::size_t i=0;i<9;i++) { + result[i] = -v[i]; + } + return result; + } + + //! Element-wise unary plus. + template + inline + mat3 + operator+( + mat3 const& v) + { + mat3 result; + for(std::size_t i=0;i<9;i++) { + result[i] = +v[i]; + } + return result; + } + +} // namespace scitbx + +#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) + +namespace boost { + template + struct has_trivial_destructor > { + static const bool value = ::boost::has_trivial_destructor::value; + }; +} + +#endif + +#endif // SCITBX_MAT3_H diff --git a/extern/cctbx/include/scitbx/math/approx_equal.h b/extern/cctbx/include/scitbx/math/approx_equal.h new file mode 100644 index 00000000..dbe33e97 --- /dev/null +++ b/extern/cctbx/include/scitbx/math/approx_equal.h @@ -0,0 +1,78 @@ +#ifndef SCITBX_MATH_APPROX_EQUAL_H +#define SCITBX_MATH_APPROX_EQUAL_H + +#include +#include +#include +#include + +namespace scitbx { namespace math { + + /** \brief A functor testing whether the relative error + between two floating point values is smaller than some tolerance. + + This is recommended a method to compare two values which should only + differ because of rounding errors. The generic type NumType may be + a scalar floating point type, a complex number type or even some vector of + floating point values, providing that std::abs(x) exists + and that abs_traits has the correct specialisation. + + The implementation first tests whether the two values are very small, + in which case their relative difference is deemed to be zero. + */ + template + struct approx_equal_relatively + { + typedef NumType num_type; + typedef typename abs_traits::result_type amplitude_type; + + amplitude_type relative_error, near_zero_threshold; + + approx_equal_relatively(amplitude_type relative_error) + : + relative_error(relative_error), + near_zero_threshold(std::numeric_limits::min()) + {} + + approx_equal_relatively(amplitude_type relative_error, + amplitude_type near_zero_threshold) + : + relative_error(relative_error), + near_zero_threshold(near_zero_threshold) + {} + + bool operator()(num_type const &x, num_type const &y) const { + amplitude_type a = std::abs(x), b = std::abs(y), m = std::max(a, b); + if (m < near_zero_threshold) return true; + if (std::abs(x - y) <= relative_error*m) return true; + return false; + } + }; + + /** \brief A functor testing whether the relative error + between two floating point values is smaller than some tolerance. + + The generic type NumType may be + a scalar floating point type, a complex number type or even some vector of + floating point values, providing that std::abs(x) exists + and that abs_traits has the correct specialisation. + */ + template + struct approx_equal_absolutely + { + typedef NumType num_type; + typedef typename abs_traits::result_type amplitude_type; + + amplitude_type absolute_error; + + approx_equal_absolutely(amplitude_type absolute_error) + : absolute_error(absolute_error) + {} + + bool operator()(num_type const &x, num_type const &y) const { + return std::abs(x - y) <= absolute_error; + } + }; +}} + +#endif diff --git a/extern/cctbx/include/scitbx/math/atanh.h b/extern/cctbx/include/scitbx/math/atanh.h new file mode 100644 index 00000000..b6f63ff9 --- /dev/null +++ b/extern/cctbx/include/scitbx/math/atanh.h @@ -0,0 +1,21 @@ +#ifndef SCITBX_MATH_ATANH_H +#define SCITBX_MATH_ATANH_H + +#if defined(__GNUC__) \ + && __GNUC__ == 2 && __GNUC_MINOR__ == 96 && __GNUC_PATCHLEVEL__ == 0 + +#include +namespace scitbx { namespace math { + using ::atanh; +}} // namespace scitbx::math + +#else + +#include +namespace scitbx { namespace math { + using boost::math::atanh; +}} // namespace scitbx::math + +#endif + +#endif // SCITBX_MATH_ATANH_H diff --git a/extern/cctbx/include/scitbx/math/bessel.h b/extern/cctbx/include/scitbx/math/bessel.h new file mode 100644 index 00000000..4f639ab2 --- /dev/null +++ b/extern/cctbx/include/scitbx/math/bessel.h @@ -0,0 +1,370 @@ +#ifndef SCITBX_MATH_BESSEL_H +#define SCITBX_MATH_BESSEL_H + +#include +#include +#include + +#include +#if !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ == 2) +# include +# define SCITBX_MATH_BESSEL_HAS_SPHERICAL +#endif + +namespace scitbx { namespace math { + +//! Family of Bessel functions. +namespace bessel { + + //! Calculates the ratio I1(x)/I0(x). + template + FloatType + i1_over_i0(FloatType const& x) + { + typedef FloatType f_t; + f_t p[] = {1.0,3.5156229,3.0899424,1.2067292,0.2659732,0.360768E-1, + 0.45813E-2}; + f_t q[] = {0.39894228,0.1328592E-1,0.225319E-2,-0.157565E-2,0.916281E-2, + -0.2057706E-1,0.2635537E-1,-0.1647633E-1,0.392377E-2}; + f_t pp[] = {0.5,0.87890594,0.51498869,0.15084934,0.2658733E-1,0.301532E-2, + 0.32411E-3}; + f_t qq[] = {0.39894228,-0.3988024E-1,-0.362018E-2,0.163801E-2, + -0.1031555E-1, 0.2282967E-1,-0.2895312E-1,0.1787654E-1,-0.420059E-2}; + f_t be1 = 0; + f_t be0 = 0; + f_t abs_x = x; + if (abs_x < 0) abs_x = -abs_x; + if (abs_x < 3.75) { + f_t y=x/3.75; + y *= y; + f_t pow_y_i = 1; + for(int i=0; i<7; i++) { + be0 += p[i]*pow_y_i; + be1 += x*pp[i]*pow_y_i; + pow_y_i *= y; + } + } + else { + f_t y=3.75/abs_x; + f_t pow_y_i = 1; + for(int i=0; i<9; i++) { + be0 += q[i]*pow_y_i; + be1 += qq[i]*pow_y_i; + pow_y_i *= y; + } + } + f_t result = be1/be0; + if (x < 0.0 && result > 0.0) return -result; + return result; + } + + template + scitbx::af::shared + i1_over_i0( scitbx::af::const_ref const& x ) + { + SCITBX_ASSERT( x.size()>0 ); + scitbx::af::shared result; + for (int ii=0;ii 10 the results are not very accurate. + */ + template + FloatType + inverse_i1_over_i0(const FloatType& x) + { + typedef FloatType f_t; + f_t x0 = std::fabs(x); + f_t a0 = -7.107935*x0; + f_t a1 = 3.553967-3.524142*x0; + f_t a2 = 1.639294-2.228716*x0; + f_t a3 = 1.0-x0; + f_t w = a2/(3.0*a3); + f_t p = a1/(3.0*a3)-w*w; + f_t q = -w*w*w+0.5*(a1*w-a0)/a3; + f_t d = std::sqrt(q*q+p*p*p); + f_t q1 = q + d; + f_t q2 = q - d; + f_t r1 = std::pow(std::fabs(q1), 1.0/3.0); + f_t r2 = std::pow(std::fabs(q2), 1.0/3.0); + if (x >= 0.0) return (((q1>0.0)? r1 : -r1) + ((q2>0.0)? r2 : -r2) - w); + return -(((q1>0.0)? r1 : -r1) + ((q2>0.0)? r2 : -r2) - w); + } + + template + scitbx::af::shared + inverse_i1_over_i0( scitbx::af::const_ref const& x ) + { + SCITBX_ASSERT( x.size()>0 ); + scitbx::af::shared result; + for (int ii=0;ii + FloatType + i0(FloatType const& x) + { + typedef FloatType f_t; + f_t abs_x = x; + if (abs_x < 0) abs_x = -abs_x; + f_t bessel_i0; + if (abs_x/3.75 < 1.0) { + f_t y = x/3.75; + y *= y; + bessel_i0=1.0+y*(3.5156229+y*(3.0899424+y*(1.2067492+ + y*(0.2659732+y*(0.0360768+y*0.0045813))))); + } + else { + f_t y = 3.75/abs_x; + y=0.39894228+y*(0.01328592+y*(0.00225319+y*(-0.00157565+ + y*(0.00916281+y*(-0.02057706+y*(0.02635537+ + y*(-0.01647633+y*0.00392377))))))); + bessel_i0=y*std::exp(abs_x)/std::sqrt(abs_x); + } + return bessel_i0; + } + + //! Calculates I1(x). + template + FloatType + i1(FloatType const& x) + { + typedef FloatType f_t; + f_t abs_x = x; + if (abs_x < 0) abs_x = -abs_x; + f_t ans; + if (abs_x/3.75 < 1.0) { + f_t y=x/3.75; + y*=y; + ans=abs_x*(0.5+y*(0.87890594+y*(0.51498869+y*(0.15084934 + +y*(0.2658733e-1+y*(0.301532e-2+y*0.32411e-3)))))); + } + else { + f_t y=3.75/abs_x; + ans=0.2282967e-1+y*(-0.2895312e-1+y*(0.1787654e-1 + -y*0.420059e-2)); + ans=0.39894228+y*(-0.3988024e-1+y*(-0.362018e-2 + +y*(0.163801e-2+y*(-0.1031555e-1+y*ans)))); + ans *= (std::exp(abs_x)/std::sqrt(abs_x)); + } + f_t result = ans; + if (x < 0.0 && result > 0.0) return -result; + return result; + } + + //! Calculates ln( I0(x) ). + template + FloatType + ln_of_i0(FloatType const& x) + { + typedef FloatType f_t; + f_t abs_x = x; + if (abs_x < 0) abs_x = -abs_x; + f_t bessel_lni0; + if (abs_x/3.75 < 1.0) { + f_t y = x/3.75; + y *= y; + bessel_lni0=1.0+y*(3.5156229+y*(3.0899424+y*(1.2067492+ + y*(0.2659732+y*(0.0360768+y*0.0045813))))); + bessel_lni0 = std::log(bessel_lni0); + } + else { + f_t y = 3.75/abs_x; + y=0.39894228+y*(0.01328592+y*(0.00225319+y*(-0.00157565+ + y*(0.00916281+y*(-0.02057706+y*(0.02635537+ + y*(-0.01647633+y*0.00392377))))))); + bessel_lni0 = std::log(y) + abs_x - 0.5*std::log(abs_x); + } + return bessel_lni0; + } + + template + FloatType + ei1(FloatType const& x) + { + // a quick and dirty approximation + FloatType t; + t = x/(1.0+x); + /* + + + Final set of parameters Asymptotic Standard Error + ======================= ========================== + + a = 0.47735 +/- 0.0003554 (0.07446%) + b = 0.175945 +/- 0.004666 (2.652%) + c = -2.82479 +/- 0.02347 (0.831%) + d = 8.74696 +/- 0.05844 (0.6681%) + e = -14.2023 +/- 0.07694 (0.5417%) + f = 10.9149 +/- 0.05134 (0.4704%) + g = -3.14135 +/- 0.01368 (0.4356%) + + + correlation matrix of the fit parameters: + + a b c d e f g + a 1.000 + b -0.974 1.000 + c 0.930 -0.988 1.000 + d -0.887 0.965 -0.993 1.000 + e 0.847 -0.939 0.979 -0.996 1.000 + f -0.812 0.912 -0.962 0.986 -0.997 1.000 + g 0.781 -0.887 0.943 -0.974 0.990 -0.998 1.000 + gnuplot> f(x) = sqrt(1-x)*exp(x)*(x*(a+x*(b+x*(c+x*(d+x*(e+x*(f+g*x))))))) + */ + FloatType a= 0.47735; + FloatType b= 0.175945; + FloatType c= -2.82479; + FloatType d= 8.74696; + FloatType e=-14.2023; + FloatType f= 10.9149; + FloatType g= -3.14135; + + FloatType result; + result = std::sqrt(1-t)*std::exp(t)*(t*(a+t*(b+t*(c+t*(d+t*(e+t*(f+g*t))))))); + return result; + } + + + template + FloatType + ei0(FloatType const& x) + { + // A quick and dirty approximation + FloatType t; + t = x/(1.0+x); + /* + degrees of freedom (ndf) : 39 + rms of residuals (stdfit) = sqrt(WSSR/ndf) : 0.000162321 + variance of residuals (reduced chisquare) = WSSR/ndf : 2.6348e-08 + + Final set of parameters Asymptotic Standard Error + ======================= ========================== + + b = -1.51857 +/- 0.002712 (0.1786%) + c = 0.862203 +/- 0.01986 (2.304%) + d = -1.11554 +/- 0.05248 (4.705%) + e = 1.72229 +/- 0.05872 (3.41%) + f = -0.804154 +/- 0.02353 (2.926%) + + + correlation matrix of the fit parameters: + + b c d e f + b 1.000 + c -0.973 1.000 + d 0.922 -0.986 1.000 + e -0.868 0.956 -0.992 1.000 + f 0.819 -0.923 0.973 -0.995 1.000 + gnuplot> plot 'pp' using 2:3, f(x) + gnuplot> f(x) = sqrt(1-x)*exp(x)*(1+x*(b+x*(c+x*(d+x*(e+f*x))))) + */ + + FloatType a= 1.0; + FloatType b= -1.51857; + FloatType c= 0.862203; + FloatType d= -1.11554; + FloatType e= 1.72229; + FloatType f= -0.804154; + + FloatType result; + result = std::sqrt(1-t)*std::exp(t)*(a+t*(b+t*(c+t*(d+t*(e+f*t))))) ; + return result; + } + +#if defined(SCITBX_MATH_BESSEL_HAS_SPHERICAL) + template + FloatType + spherical_bessel(int const& l, FloatType const& x) + { + using boost::math::sph_bessel; + return( sph_bessel(l,x) ); + } + + template + scitbx::af::shared< FloatType > + spherical_bessel_array(int const& l, scitbx::af::shared< FloatType >const& x) + { + using boost::math::sph_bessel; + scitbx::af::shared< FloatType > result; + for (int ii=0;ii + FloatType + bessel_J(int const& l, FloatType const& x) + { + using boost::math::cyl_bessel_j; + return( cyl_bessel_j(l,x) ); + } + + template + scitbx::af::shared< FloatType > + bessel_J_array(int const& l, scitbx::af::shared< FloatType >const& x) + { + using boost::math::cyl_bessel_j; + scitbx::af::shared< FloatType > result; + for (int ii=0;ii= 105500 + + template + scitbx::af::shared< FloatType > + bessel_J_zeroes(FloatType const& l, int const& n) + { + using boost::math::cyl_bessel_j_zero; + scitbx::af::shared result; + for (int ii=1;ii<=n;ii++){ + result.push_back( cyl_bessel_j_zero(l,ii) ); + } + return result; + } + + template + scitbx::af::shared< FloatType > + sph_bessel_j_zeroes(FloatType const& l, int const& n) + { + FloatType eps=1e-4; + using boost::math::cyl_bessel_j_zero; + scitbx::af::shared result; + if (std::abs(l-0.0)= 105500 + +#endif + +}}} // namespace scitbx::math::bessel + +#endif // SCITBX_MATH_BESSEL_H diff --git a/extern/cctbx/include/scitbx/math/compile_time.h b/extern/cctbx/include/scitbx/math/compile_time.h new file mode 100644 index 00000000..ee0ca9b9 --- /dev/null +++ b/extern/cctbx/include/scitbx/math/compile_time.h @@ -0,0 +1,26 @@ +#ifndef SCITBX_MATH_COMPILE_TIME_H +#define SCITBX_MATH_COMPILE_TIME_H + +#include + +namespace scitbx { namespace math { namespace compile_time { + + template + struct product + { + template + static std::size_t + get(IndexType const& i) { return i[N-1] * product::get(i); } + }; + + template <> + struct product<1> + { + template + static std::size_t + get(IndexType const& i) { return i[0]; } + }; + +}}} // namespace scitbx::math::compile_time + +#endif // SCITBX_MATH_COMPILE_TIME_H diff --git a/extern/cctbx/include/scitbx/math/erf.h b/extern/cctbx/include/scitbx/math/erf.h new file mode 100644 index 00000000..b6cd6c86 --- /dev/null +++ b/extern/cctbx/include/scitbx/math/erf.h @@ -0,0 +1,60 @@ +#ifndef SCITBX_MATH_ERF_H +#define SCITBX_MATH_ERF_H + +#include +#include +#include + +namespace scitbx { namespace math { + + //! Approximate values for erf(x). + /*! See also: scitbx::math::erf_engine + */ + template + inline + FloatType + erf(FloatType const& x) + { + return erf_engine().compute(x, 0); + } + + template + inline + af::shared + erf(af::const_ref const& x) + { + af::shared result(x.size(), + af::init_functor_null()); + erf_engine engine; + for( unsigned ii=0;ii + inline + FloatType + erfc(FloatType const& x) + { + return erf_engine().compute(x, 1); + } + + //! Approximate values for exp(x*x) * erfc(x). + /*! See also: scitbx::math::erf_engine + */ + template + inline + FloatType + erfcx(FloatType const& x) + { + return erf_engine().compute(x, 2); + } + +}} // namespace scitbx::math + +#endif // SCITBX_MATH_ERF_H diff --git a/extern/cctbx/include/scitbx/math/erf/constants.h b/extern/cctbx/include/scitbx/math/erf/constants.h new file mode 100644 index 00000000..85cc1fcf --- /dev/null +++ b/extern/cctbx/include/scitbx/math/erf/constants.h @@ -0,0 +1,79 @@ +#ifndef SCITBX_MATH_ERF_CONSTANTS_H +#define SCITBX_MATH_ERF_CONSTANTS_H + +#include + +namespace scitbx { namespace math { + +//! Port of http://www.netlib.org/specfun/erf (as of 2003 Dec 03). +namespace erf_constants { + + //! Port of http://www.netlib.org/specfun/erf (as of 2003 Dec 03). + /*! From the FORTRAN documentation: +

+Explanation of machine-dependent constants
+
+  XMIN   = the smallest positive floating-point number.
+  XINF   = the largest positive finite floating-point number.
+  XNEG   = the largest negative argument acceptable to ERFCX;
+           the negative of the solution to the equation
+           2*exp(x*x) = XINF.
+  XSMALL = argument below which erf(x) may be represented by
+           2*x/sqrt(pi)  and above which  x*x  will not underflow.
+           A conservative value is the largest machine number X
+           such that   1.0 + X = 1.0   to machine precision.
+  XBIG   = largest argument acceptable to ERFC;  solution to
+           the equation:  W(x) * (1-0.5/x**2) = XMIN,  where
+           W(x) = exp(-x*x)/[x*sqrt(pi)].
+  XHUGE  = argument above which  1.0 - 1/(2*x*x) = 1.0  to
+           machine precision.  A conservative value is
+           1/[2*sqrt(XSMALL)]
+  XMAX   = largest acceptable argument to ERFCX; the minimum
+           of XINF and 1/[sqrt(pi)*XMIN].
+
+ */ + template + struct machine_dependent_base + { + machine_dependent_base( + FloatType const& xinf_, + FloatType const& xneg_, + FloatType const& xsmall_, + FloatType const& xbig_, + FloatType const& xhuge_, + FloatType const& xmax_) + : + xinf(xinf_), + xneg(xneg_), + xsmall(xsmall_), + xbig(xbig_), + xhuge(xhuge_), + xmax(xmax_) + {} + + FloatType xinf, xneg, xsmall, xbig, xhuge, xmax; + }; + + template + struct machine_dependent; + + template + struct machine_dependent : machine_dependent_base + { + machine_dependent() : machine_dependent_base( + 3.40e38, -9.382, 5.96e-8, 9.194, 2.90e3, 4.79e37) + {} + }; + + template + struct machine_dependent : machine_dependent_base + { + machine_dependent() : machine_dependent_base( + 1.79e308, -26.628e0, 1.11e-16, 26.543e0, 6.71e7, 2.53e307) + {} + }; + +}}} // namespace scitbx::math::erf_constants + +#endif // SCITBX_MATH_ERF_CONSTANTS_H diff --git a/extern/cctbx/include/scitbx/math/erf/engine.h b/extern/cctbx/include/scitbx/math/erf/engine.h new file mode 100644 index 00000000..3551e184 --- /dev/null +++ b/extern/cctbx/include/scitbx/math/erf/engine.h @@ -0,0 +1,187 @@ +#ifndef SCITBX_MATH_ERF_ENGINE_H +#define SCITBX_MATH_ERF_ENGINE_H + +#include +#include + +namespace scitbx { namespace math { + + //! Port of http://www.netlib.org/specfun/erf (as of 2003 Dec 03). + /*! From the FORTRAN documentation: +
+This packet evaluates  erf(x),  erfc(x),  and  exp(x*x)*erfc(x)
+for a real argument  x.  It contains three FUNCTION type
+subprograms: ERF, ERFC, and ERFCX (or DERF, DERFC, and DERFCX),
+and one SUBROUTINE type subprogram, CALERF.  The calling
+statements for the primary entries are:
+
+                Y=ERF(X)     (or   Y=DERF(X)),
+
+                Y=ERFC(X)    (or   Y=DERFC(X)),
+and
+                Y=ERFCX(X)   (or   Y=DERFCX(X)).
+
+The routine  CALERF  is intended for internal packet use only,
+all computations within the packet being concentrated in this
+routine.  The function subprograms invoke  CALERF  with the
+statement
+
+       CALL CALERF(ARG,RESULT,JINT)
+
+where the parameter usage is as follows
+
+   Function                     Parameters for CALERF
+    call              ARG                  Result          JINT
+
+  ERF(ARG)      ANY REAL ARGUMENT         ERF(ARG)          0
+  ERFC(ARG)     ABS(ARG) .LT. XBIG        ERFC(ARG)         1
+  ERFCX(ARG)    XNEG .LT. ARG .LT. XMAX   ERFCX(ARG)        2
+
+The main computation evaluates near-minimax approximations
+from "Rational Chebyshev approximations for the error function"
+by W. J. Cody, Math. Comp., 1969, PP. 631-638.  This
+transportable program uses rational functions that theoretically
+approximate  erf(x)  and  erfc(x)  to at least 18 significant
+decimal digits.  The accuracy achieved depends on the arithmetic
+system, the compiler, the intrinsic functions, and proper
+selection of the machine-dependent constants.
+
+ */ + + template + struct erf_engine : erf_constants::machine_dependent + { + FloatType + compute(FloatType const& arg, int jint) + { + FloatType sixten = 16.; + FloatType four = 4.; + FloatType one = 1.; + FloatType half = .5; + FloatType two = 2.; + FloatType zero = 0.; + FloatType sqrpi = 5.6418958354775628695e-1; + FloatType thresh = 0.46875; + FloatType a[] = {3.16112374387056560e00, 1.13864154151050156e02, + 3.77485237685302021e02, 3.20937758913846947e03, + 1.85777706184603153e-1 + }; + FloatType b[] = {2.36012909523441209e01, 2.44024637934444173e02, + 1.28261652607737228e03, 2.84423683343917062e03 + }; + FloatType c[] = {5.64188496988670089e-1, 8.88314979438837594e0, + 6.61191906371416295e01, 2.98635138197400131e02, + 8.81952221241769090e02, 1.71204761263407058e03, + 2.05107837782607147e03, 1.23033935479799725e03, + 2.15311535474403846e-8 + }; + FloatType d[] = {1.57449261107098347e01, 1.17693950891312499e02, + 5.37181101862009858e02, 1.62138957456669019e03, + 3.29079923573345963e03, 4.36261909014324716e03, + 3.43936767414372164e03, 1.23033935480374942e03 + }; + FloatType p[] = {3.05326634961232344e-1, 3.60344899949804439e-1, + 1.25781726111229246e-1, 1.60837851487422766e-2, + 6.58749161529837803e-4, 1.63153871373020978e-2 + }; + FloatType q[] = {2.56852019228982242e00, 1.87295284992346047e00, + 5.27905102951428412e-1, 6.05183413124413191e-2, + 2.33520497626869185e-3 + }; + FloatType result; + FloatType x = arg; + FloatType y = x; + if (y < 0) y = -y; + if (y <= thresh) { + FloatType ysq = zero; + if (y > this->xsmall) ysq = y * y; + FloatType xnum = a[5-1]*ysq; + FloatType xden = ysq; + for(std::size_t i=1;i<=3;i++) { + xnum = (xnum + a[i-1]) * ysq; + xden = (xden + b[i-1]) * ysq; + } + result = x * (xnum + a[4-1]) / (xden + b[4-1]); + if (jint != 0) result = one - result; + if (jint == 2) result = exp_(ysq) * result; + return result; + } + else if (y <= four) { + FloatType xnum = c[9-1]*y; + FloatType xden = y; + for(std::size_t i=1;i<=7;i++) { + xnum = (xnum + c[i-1]) * y; + xden = (xden + d[i-1]) * y; + } + result = (xnum + c[8-1]) / (xden + d[8-1]); + if (jint != 2) { + FloatType ysq = aint_(y*sixten)/sixten; + FloatType del_ = (y-ysq)*(y+ysq); + result = exp_(-ysq*ysq) * exp_(-del_) * result; + } + } + else { + result = zero; + if (y >= this->xbig) { + if ((jint != 2) || (y >= this->xmax)) goto label_300; + if (y >= this->xhuge) { + result = sqrpi / y; + goto label_300; + } + } + FloatType ysq = one / (y * y); + FloatType xnum = p[6-1]*ysq; + FloatType xden = ysq; + for(std::size_t i=1;i<=4;i++) { + xnum = (xnum + p[i-1]) * ysq; + xden = (xden + q[i-1]) * ysq; + } + result = ysq *(xnum + p[5-1]) / (xden + q[5-1]); + result = (sqrpi - result) / y; + if (jint != 2) { + FloatType ysq = aint_(y*sixten)/sixten; + FloatType del_ = (y-ysq)*(y+ysq); + result = exp_(-ysq*ysq) * exp_(-del_) * result; + } + } + label_300: + if (jint == 0) { + result = (half - result) + half; + if (x < zero) result = -result; + } + else if (jint == 1) { + if (x < zero) result = two - result; + } + else { + if (x < zero) { + if (x < this->xneg) { + result = this->xinf; + } + else { + FloatType ysq = aint_(x*sixten)/sixten; + FloatType del_ = (x-ysq)*(x+ysq); + y = exp_(ysq*ysq) * exp_(del_); + result = (y+y) - result; + } + } + } + return result; + } + + static FloatType + exp_(FloatType const& x) + { + return static_cast(std::exp(x)); + } + + static FloatType + aint_(FloatType const& x) + { + return static_cast(static_cast(x)); + } + }; + +}} // namespace scitbx::math + +#endif // SCITBX_MATH_ERF_ENGINE_H diff --git a/extern/cctbx/include/scitbx/math/gaussian/sum.h b/extern/cctbx/include/scitbx/math/gaussian/sum.h new file mode 100644 index 00000000..9dbb62e9 --- /dev/null +++ b/extern/cctbx/include/scitbx/math/gaussian/sum.h @@ -0,0 +1,233 @@ +#ifndef SCITBX_MATH_GAUSSIAN_SUM_H +#define SCITBX_MATH_GAUSSIAN_SUM_H + +#ifndef SCITBX_MATH_GAUSSIAN_SUM_MAX_N_TERMS +#define SCITBX_MATH_GAUSSIAN_SUM_MAX_N_TERMS 10 +#endif + +#include +#include +#include +#include + +namespace scitbx { namespace math { namespace gaussian { + + //! Sum of Gaussian terms plus a constant. + template + class sum + { + public: + //! Maximum number of terms. + BOOST_STATIC_CONSTANT(std::size_t, + max_n_terms=SCITBX_MATH_GAUSSIAN_SUM_MAX_N_TERMS); + + //! Default constructor. Some data members are not initialized! + sum() {} + + //! Initialization of the constant. + explicit + sum(FloatType const& c, bool use_c=true) + : + c_(c), + use_c_(use_c) + { + SCITBX_ASSERT(use_c || c == 0); + } + + //! Initialization of the terms and optionally the constant. + /*! If c is different from zero use_c will automatically be + set to true. +

+ Not available in Python. + */ + sum( + af::small, max_n_terms> const& terms, + FloatType const& c=0, + bool use_c=false) + : + terms_(terms), + c_(c), + use_c_(use_c || c != 0) + {} + + //! Initialization of the terms and optionally the constant. + /*! If c is different from zero use_c will automatically be + set to true. + */ + sum( + af::small const& a, + af::small const& b, + FloatType const& c=0, + bool use_c=false) + : + c_(c), + use_c_(use_c || c != 0) + { + SCITBX_ASSERT(a.size() == b.size()); + for(std::size_t i=0;i(a[i], b[i])); + } + } + + //! Initialization of the terms and optionally the constant. + /*! If c is different from zero use_c will automatically be + set to true. If ab contains an odd number of elements + the last element is used to initialize c and use_c will + bet set to true. + */ + sum( + af::const_ref const& ab, + FloatType const& c=0, + bool use_c=false) + : + c_(c), + use_c_(use_c || c != 0) + { + SCITBX_ASSERT(!use_c || ab.size() % 2 == 0); + SCITBX_ASSERT(ab.size() / 2 <= max_n_terms); + std::size_t n = ab.size(); + if (n % 2 != 0) { + n--; + c_ = ab.back(); + use_c_ = true; + } + for(std::size_t i=0;i(ab[i], ab[i+1])); + } + } + + //! Number of terms. + std::size_t + n_terms() const { return terms_.size(); } + + //! Terms. + /*! Not available in Python. + */ + af::small, max_n_terms> const& + terms() const { return terms_; } + + //! Array of coefficients a. + af::small + array_of_a() const + { + af::small result; + for(std::size_t i=0;i + array_of_b() const + { + af::small result; + for(std::size_t i=0;i + parameters() const + { + af::shared result; + result.reserve(n_parameters()); + for(std::size_t i=0;i const& ti = terms_[i]; + result.push_back(ti.a); + result.push_back(ti.b); + } + if (use_c()) result.push_back(c_); + return result; + } + + //! Sum of Gaussian terms at the point x, given x^2. + FloatType + at_x_sq(FloatType const& x_sq) const + { + FloatType result = c_; + for(std::size_t i=0;i + at_x_sq(af::const_ref const& x_sq) const + { + af::shared result(x_sq.size(),af::init_functor_null()); + for(std::size_t i=0;i + at_x(af::const_ref const& x) const + { + af::shared result(x.size(),af::init_functor_null()); + for(std::size_t i=0;i, max_n_terms> terms_; + FloatType c_; + bool use_c_; + }; + +}}} // scitbx::math::gaussian + +#endif // SCITBX_MATH_GAUSSIAN_SUM_H diff --git a/extern/cctbx/include/scitbx/math/gaussian/term.h b/extern/cctbx/include/scitbx/math/gaussian/term.h new file mode 100644 index 00000000..30e7f3a0 --- /dev/null +++ b/extern/cctbx/include/scitbx/math/gaussian/term.h @@ -0,0 +1,105 @@ +#ifndef SCITBX_MATH_GAUSSIAN_TERM_H +#define SCITBX_MATH_GAUSSIAN_TERM_H + +#include +#include +#include + +namespace scitbx { namespace math { namespace gaussian { + + //! Gaussian term: a Exp[-b x^2] + template + struct term + { + //! Default constructor. Some data members are not initialized! + term() {} + + //! Definition of coefficients a and b. + term(FloatType const& a_, FloatType const& b_) + : + a(a_), + b(b_) + {} + + //! Gaussian at the point x, given x^2. + FloatType + at_x_sq(FloatType const& x_sq) const + { + return a * std::exp(-b * x_sq); + } + + //! Gaussian at the point x. + FloatType + at_x(FloatType const& x) const + { + return at_x_sq(x * x); + } + + //! Analytical gradient w.r.t. x at the point x. + FloatType + gradient_dx_at_x(FloatType const& x) const + { + return -2*a*b*x/std::exp(b*x*x); + } + + //! Analytical integral dx from 0 to the point x. + FloatType + integral_dx_at_x( + FloatType const& x, + FloatType const& b_min_for_erf_based_algorithm=1e-3) + { + using scitbx::math::erf; + static const FloatType sqrt_pi = std::sqrt(scitbx::constants::pi); + if (b == 0) return a * x; + if (b > b_min_for_erf_based_algorithm) { + /* Mathematica: + f = a Exp[-b x^2] + Integrate[f,x] + */ + FloatType sqrt_b = std::sqrt(b); + return a*sqrt_pi*erf(sqrt_b*x)/(2*sqrt_b); + } + /* Mathematica: + f = a Exp[-b x^2] + Series[Integrate[f,x], {x,0,20}] + Formula for the denominator of the series expansion: (2n+1)*n! + Encyclopedia of Integer Sequences ID Number: A007680 + */ + FloatType bxx = b * x * x; + FloatType part = 1; + FloatType result = 1; + FloatType prev_result = result; + unsigned n = 0; + unsigned tnp1 = 1; + while (true) { + n++; + tnp1 += 2; + part *= bxx / n; + result -= part / tnp1; + if (result == prev_result) break; + prev_result = result; + n++; + tnp1 += 2; + part *= bxx / n; + result += part / tnp1; + if (result == prev_result) break; + prev_result = result; + } + return a * x * result; + } + + //! Analytical gradients w.r.t. a and b at the point x, given x^2. + term + gradients_d_ab_at_x_sq(FloatType const& x_sq) const + { + FloatType gr_a = std::exp(-b * x_sq); + return term(gr_a, -a * x_sq * gr_a); + } + + FloatType a; + FloatType b; + }; + +}}} // scitbx::math::gaussian + +#endif // SCITBX_MATH_GAUSSIAN_TERM_H diff --git a/extern/cctbx/include/scitbx/math/gcd.h b/extern/cctbx/include/scitbx/math/gcd.h new file mode 100644 index 00000000..9c962dda --- /dev/null +++ b/extern/cctbx/include/scitbx/math/gcd.h @@ -0,0 +1,195 @@ +#ifndef SCITBX_MATH_GCD_H +#define SCITBX_MATH_GCD_H + +#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) \ + && (!defined(__clang__)) \ + && (defined(__APPLE_CC__) && __APPLE_CC__ >= 5465) // OS X 10.5 +# define SCITBX_MATH_GCD_USING_ASM +#endif + +namespace scitbx { namespace math { + + inline + int + gcd_int_simple( + int a, + int b) + { + for(;;) { + if (b == 0) return (a < 0 ? -a : a); + int next_b = a % b; + a = b; + b = next_b; + } + } + + inline + long + gcd_long_simple( + long a, + long b) + { + for(;;) { + if (b == 0) return (a < 0 ? -a : a); + long next_b = a % b; + a = b; + b = next_b; + } + } + +#if defined(SCITBX_MATH_GCD_USING_ASM) + /* gcc 3.2 32-bit: ca. 30% faster than gcd_int_simple() + gcc 4.0 32-bit: ca. 10% faster + gcc 4.1 64-bit: ca. 15% faster + gcc 4.4, icc 9.1 64-bit: practically same speed + */ + inline + int + gcd_int32_asm( + int a, + int b) + { + __asm__( + " movl %2, %%ecx\n" + ".L_for_%=:\n" + " cmpl $0, %%ecx\n" // if b == 0 + " je .L_return_a_or_minus_a_%=\n" + " movl %0, %%edx\n" + " sarl $31, %%edx\n" + " idivl %%ecx\n" // next_b = a % b + " movl %%ecx, %0\n" // a = b + " movl %%edx, %%ecx\n" // b = next_b + " jmp .L_for_%=\n" + ".L_return_a_or_minus_a_%=:\n" + // next five lines: slightly faster than compare & jump + " movl %0, %%ecx\n" + " cltd\n" + " xorl %%edx, %%ecx\n" + " subl %%edx, %%ecx\n" + " movl %%ecx, %0\n" + : "=a"(a) /* output */ + : "0"(a), "r"(b) /* input */ + : "cc", "%ecx", "%edx"); /* clobbered registers */ + return a; + } +#endif + +#if defined(SCITBX_MATH_GCD_USING_ASM) && defined(__x86_64__) + inline + long + gcd_int64_asm( + long a, + long b) + { + __asm__( + " movq %2, %%rcx\n" + ".L_for_%=:\n" + " cmpq $0, %%rcx\n" // if b == 0 + " je .L_return_a_or_minus_a_%=\n" + " movq %0, %%rdx\n" + " sarq $63, %%rdx\n" + " idivq %%rcx\n" // next_b = a % b + " movq %%rcx, %0\n" // a = b + " movq %%rdx, %%rcx\n" // b = next_b + " jmp .L_for_%=\n" + ".L_return_a_or_minus_a_%=:\n" + // next five lines: slightly faster than compare & jump + " movq %0, %%rcx\n" + " cqto\n" + " xorq %%rdx, %%rcx\n" + " subq %%rdx, %%rcx\n" + " movq %%rcx, %0\n" + : "=a"(a) /* output */ + : "0"(a), "r"(b) /* input */ + : "cc", "%rcx", "%rdx"); /* clobbered registers */ + return a; + } +#endif + + // from boost/math/common_factor_rt.hpp, svn trunk rev. 47847 + inline + unsigned long + gcd_unsigned_long_binary( + unsigned long u, + unsigned long v) + { + if ( u && v ) { + // Shift out common factors of 2 + unsigned shifts = 0; + while ( !(u & 1u) && !(v & 1u) ) { + ++shifts; + u >>= 1; + v >>= 1; + } + // Start with the still-even one, if any + unsigned long r[] = { u, v }; + unsigned which = static_cast( u & 1u ); + // Whittle down the values via their differences + do { + // Remove factors of two from the even one + while ( !(r[ which ] & 1u) ) { + r[ which ] >>= 1; + } + // Replace the larger of the two with their difference + if ( r[!which] > r[which] ) { + which ^= 1u; + } + r[ which ] -= r[ !which ]; + } + while ( r[which] ); + // Shift-in the common factor of 2 to the residues' GCD + return r[ !which ] << shifts; + } + else { + // At least one input is zero, return the other + // (adding since zero is the additive identity) + // or zero if both are zero. + return u + v; + } + } + + inline + long + gcd_long_binary( + long u, + long v) + { + return static_cast( + gcd_unsigned_long_binary( + u < 0 ? -u : u, + v < 0 ? -v : v)); + } + + inline + int + gcd_int( + int a, + int b) + { +#if defined(SCITBX_MATH_GCD_USING_ASM) + return gcd_int32_asm(a, b); +#else + return gcd_int_simple(a, b); +#endif + } + + inline + long + gcd_long( + long a, + long b) + { +#if defined(SCITBX_MATH_GCD_USING_ASM) +# if defined(__x86_64__) + return gcd_int64_asm(a, b); +# else + return gcd_int32_asm(a, b); +# endif +#else + return gcd_long_simple(a, b); +#endif + } + +}} // namespace scitbx::math + +#endif // GUARD diff --git a/extern/cctbx/include/scitbx/math/modulo.h b/extern/cctbx/include/scitbx/math/modulo.h new file mode 100644 index 00000000..b2a83645 --- /dev/null +++ b/extern/cctbx/include/scitbx/math/modulo.h @@ -0,0 +1,43 @@ +#ifndef SCITBX_MATH_MOD_H +#define SCITBX_MATH_MOD_H + +#include + +namespace scitbx { namespace math { + + template + inline + IntType + mod_positive(IntType ix, IntType const& iy) + { + if (iy > 0) { + ix %= iy; + if (ix < 0) ix += iy; + } + return ix; + } + + template + inline + IntType + mod_short(IntType ix, IntType const& iy) + { + ix = mod_positive(ix, iy); + if (ix > iy / 2) + ix -= iy; + return ix; + } + + template + inline FloatType + fmod_short(FloatType const& x, FloatType const& y) + { + FloatType result = std::fmod(x, y); + if (result < 0) result += y; + if (result > y/2) result -= y; + return result; + } + +}} // namespace scitbx::math + +#endif // GUARD diff --git a/extern/cctbx/include/scitbx/math/traits.h b/extern/cctbx/include/scitbx/math/traits.h new file mode 100644 index 00000000..6578fcc8 --- /dev/null +++ b/extern/cctbx/include/scitbx/math/traits.h @@ -0,0 +1,20 @@ +#ifndef SCITBX_MATH_ABS_H +#define SCITBX_MATH_ABS_H + +#include + +namespace scitbx { namespace math { + + template + struct abs_traits { + typedef T result_type; + }; + + template + struct abs_traits< std::complex > { + typedef T result_type; + }; + +}} + +#endif diff --git a/extern/cctbx/include/scitbx/math/unimodular_generator.h b/extern/cctbx/include/scitbx/math/unimodular_generator.h new file mode 100644 index 00000000..faa1edb1 --- /dev/null +++ b/extern/cctbx/include/scitbx/math/unimodular_generator.h @@ -0,0 +1,122 @@ +#ifndef SCITBX_MATH_UNIMODULAR_GENERATOR_H +#define SCITBX_MATH_UNIMODULAR_GENERATOR_H + +#include + +namespace scitbx { namespace math { + + template + class unimodular_generator + { + private: + IntType range_; + bool at_end_; + unsigned return_target_id_; + IntType i0, i1, i2, i3, i4, i5, i6, i7, i8; + IntType i37, i38, i48, i4857, i3746, i3856, i04857; + IntType i04857_one, one_i04857_13856; + + public: + unimodular_generator() {} + + unimodular_generator(IntType const& range) + : + range_(range), + at_end_(false), + return_target_id_(0) + { + incr(); + } + + bool + at_end() const { return at_end_; } + + scitbx::mat3 + next() + { + SCITBX_ASSERT(!at_end_); + scitbx::mat3 result(i0,i1,i2,i3,i4,i5,i6,i7,i8); + incr(); + return result; + } + + std::size_t + count() + { + std::size_t result = 0; + while (!at_end_) { + result++; + incr(); + } + return result; + } + + private: + void + incr() + { + if (return_target_id_ == 1) goto return_target_1; + if (return_target_id_ == 2) goto return_target_2; + if (return_target_id_ == 3) goto return_target_3; + // 0 1 2 + // 3 4 5 + // 6 7 8 + // Manually optimized search for matrices with determinant 1. + for(i4=-range_;i4<=range_;i4++) { + for(i8=-range_;i8<=range_;i8++) { i48 = i4*i8; + for(i5=-range_;i5<=range_;i5++) { + for(i7=-range_;i7<=range_;i7++) { i4857 = i48-i5*i7; + for(i3=-range_;i3<=range_;i3++) { i38 = i3*i8; + i37 = i3*i7; + for(i6=-range_;i6<=range_;i6++) { i3746 = i37-i4*i6; + i3856 = i38-i5*i6; + if (i3746 == 0) { + if (i3856 == 0) { + if (i4857 == -1 || i4857 == 1) { + return_target_id_ = 1; + i0 = i4857; + for(i1=-range_;i1<=range_;i1++) { + for(i2=-range_;i2<=range_;i2++) { + return; + return_target_1:; + } + } + } + } + else { + return_target_id_ = 2; + for(i0=-range_;i0<=range_;i0++) { + i04857_one = i0*i4857 - 1; + i1 = i04857_one / i3856; + if (-range_ <= i1 && i1 <= range_ && i1*i3856 == i04857_one) { + for(i2=-range_;i2<=range_;i2++) { + return; + return_target_2:; + } + } + } + } + } + else { + return_target_id_ = 3; + for(i0=-range_;i0<=range_;i0++) { + i04857 = i0*i4857; + for(i1=-range_;i1<=range_;i1++) { + one_i04857_13856 = 1 - i04857 + i1*i3856; + i2 = one_i04857_13856 / i3746; + if (-range_ <= i2 && i2 <= range_ + && i2*i3746 == one_i04857_13856) { + return; + return_target_3:; + } + } + } + } + }}}}}} + at_end_ = true; + } + }; + +}} // namespace scitbx::math + +#endif // SCITBX_MATH_UNIMODULAR_GENERATOR_H diff --git a/extern/cctbx/include/scitbx/math/utils.h b/extern/cctbx/include/scitbx/math/utils.h new file mode 100644 index 00000000..14b1c8f4 --- /dev/null +++ b/extern/cctbx/include/scitbx/math/utils.h @@ -0,0 +1,161 @@ +#ifndef SCITBX_MATH_UTILS_H +#define SCITBX_MATH_UTILS_H + +#include +#include +#include +#include + +namespace scitbx { namespace math { + + template + inline + NumType1& + update_min(NumType1& m, NumType2 const& x) + { + if (m > x) m = x; + return m; + } + + template + inline + NumType1& + update_max(NumType1& m, NumType2 const& x) + { + if (m < x) m = x; + return m; + } + + /// Overflow-proof sqrt(x*x + y*y) + template + inline + NumType norm(NumType x, NumType y) { + x = std::abs(x); + y = std::abs(y); + if (x > y) std::swap(x, y); + // 0 < x < y from here on + if (x == 0) return y; + NumType t = x/y; + return y*std::sqrt(NumType(1) + t*t); + } + + template + FloatType + round(FloatType x, int n_digits=0) + { + // based on Python/bltinmodule.c: builtin_round() + FloatType f = 1; + int i = n_digits; + if (i < 0) i = -i; + while (--i >= 0) f *= 10; + if (n_digits < 0) x /= f; + else x *= f; + if (x >= 0) x = std::floor(x + 0.5); + else x = std::ceil(x - 0.5); + if (n_digits < 0) x *= f; + else x /= f; + return x; + } + + template + struct float_int_conversions + { + static + inline + SignedIntType + iround(FloatType const& x) + { + if (x < 0) return static_cast(x-0.5); + return static_cast(x+.5); + } + + static + inline + SignedIntType + iceil(FloatType const& x) { return iround(std::ceil(x)); } + + static + inline + SignedIntType + ifloor(FloatType const& x) { return iround(std::floor(x)); } + + static + inline + SignedIntType + nearest_integer(FloatType const& x) + { + SignedIntType i = static_cast(x); + FloatType dxi = x - static_cast(i); + if (x >= 0) { + if (dxi > 0.5) i++; + else if (dxi == 0.5 && (i & 1)) i++; + } + else { + if (x - static_cast(i) < -0.5) i--; + else if (dxi == -0.5 && (i & 1)) i--; + } + return i; + } + }; + + inline + int + iround(double x) { return float_int_conversions::iround(x); } + + inline + int + iceil(double x) { return float_int_conversions::iceil(x); } + + inline + int + ifloor(double x) { return float_int_conversions::ifloor(x); } + + inline + int + nearest_integer(double x) + { + return float_int_conversions::nearest_integer(x); + } + + template + bool + unsigned_product_leads_to_overflow(UnsignedIntType* a, SizeType n) { + double product = 1; + for (int i=0; i std::numeric_limits::max(); + } + + /// Quotient and remainder of x/y for floating point x and y + /** The static function divmod returns n,r such that: + - n is the nearest integer to x/y + - r = x - n*y + */ + template + struct remainder_and_quotient { + static inline + std::pair + divmod(FloatType x, FloatType y) { + SignedIntType quo + = float_int_conversions::nearest_integer(x/y); + FloatType rem = x - quo*y; + return std::make_pair(quo, rem); + } + }; + + inline std::pair divmod(double x, double y) { + return remainder_and_quotient::divmod(x,y); + } + + // Returns a complex number with magnitude equal to 1, and phase theta + template + std::complex unit_complex(FloatType const& theta){ + return std::complex(std::cos(theta), std::sin(theta)); + } + + +}} // namespace scitbx::math + +#endif // SCITBX_MATH_UTILS_H diff --git a/extern/cctbx/include/scitbx/matrix/as_xyz.h b/extern/cctbx/include/scitbx/matrix/as_xyz.h new file mode 100644 index 00000000..83b8aa53 --- /dev/null +++ b/extern/cctbx/include/scitbx/matrix/as_xyz.h @@ -0,0 +1,81 @@ +#ifndef SCITBX_MATRIX_AS_XYZ_H +#define SCITBX_MATRIX_AS_XYZ_H + +#include +#include +#include + +namespace scitbx { namespace matrix { + + template + std::string + rational_as_xyz( + int n_rows, + int n_columns, + const IntType* r_num, + IntType r_den, + const IntType* t_num, + IntType t_den, + bool decimal, + bool t_first, + const char* letters_xyz, + const char* separator) + { + SCITBX_ASSERT(letters_xyz != 0 + && std::strlen(letters_xyz) == static_cast(n_columns)); + SCITBX_ASSERT(separator != 0); + std::string result; + for (int i = 0; i < n_rows; i++) { + std::string R_term; + if (r_num != 0) { + for (int j = 0; j < n_columns; j++) { + boost::rational R_frac(r_num[i*n_columns+j], r_den); + if (R_frac != 0) { + if (R_frac > 0) { + if (!R_term.empty()) { + R_term += "+"; + } + } + else { + R_term += "-"; + R_frac *= -1; + } + if (R_frac != 1) { + R_term += scitbx::format(R_frac, decimal) + "*"; + } + R_term += letters_xyz[j]; + } + } + } + if (i != 0) result += separator; + if (t_num == 0) { + if (R_term.empty()) result += "0"; + else result += R_term; + } + else { + boost::rational T_frac(t_num[i], t_den); + if (T_frac == 0) { + if (R_term.empty()) result += "0"; + else result += R_term; + } + else if (R_term.empty()) { + result += scitbx::format(T_frac, decimal); + } + else if (t_first) { + result += scitbx::format(T_frac, decimal); + if (R_term[0] != '-') result += "+"; + result += R_term; + } + else { + result += R_term; + if (T_frac > 0) result += "+"; + result += scitbx::format(T_frac, decimal); + } + } + } + return result; + } + +}} // namespace scitbx::matrix + +#endif // SCITBX_MATRIX_AS_XYZ_H diff --git a/extern/cctbx/include/scitbx/matrix/multiply.h b/extern/cctbx/include/scitbx/matrix/multiply.h new file mode 100644 index 00000000..24771bab --- /dev/null +++ b/extern/cctbx/include/scitbx/matrix/multiply.h @@ -0,0 +1,227 @@ +#ifndef SCITBX_MATRIX_MULTIPLY_H +#define SCITBX_MATRIX_MULTIPLY_H + +namespace scitbx { namespace matrix { + + //! Generic matrix multiplication function: a * b + /*! ab[ar, bc] = a[ar, ac] * b[ac, bc] + */ + template + void + multiply( + const NumTypeA *a, + const NumTypeB *b, + unsigned ar, + unsigned ac, + unsigned bc, + NumTypeAB *ab) + { + unsigned i0 = 0; + for (unsigned i=0; i + void + transpose_multiply( + const NumTypeA *a, + const NumTypeB *b, + unsigned ar, + unsigned ac, + unsigned bc, + NumTypeAtB *atb) + { + unsigned arac = ar * ac; + for (unsigned i=0;i + void + multiply_transpose( + const NumTypeA *a, + const NumTypeB *b, + unsigned ar, + unsigned ac, + unsigned br, + NumTypeAB *ab) + { + unsigned i0 = 0; + for (unsigned i=0; i + void + multiply_packed_u( + const NumTypeA* a, + const NumTypeB* b, + unsigned ar, + unsigned ac, + NumTypeAB *ab) + { + unsigned i0 = 0; + for(unsigned i=0;i + void + multiply_packed_u_multiply_lhs_transpose( + const NumTypeA* a, + const NumTypeB* b, + unsigned ar, + unsigned ac, + NumTypeAB *ab, + NumTypeABAt *abat) + { + multiply_packed_u(a, b, ar, ac, ab); + unsigned i0 = 0; + for(unsigned i=0;i + void + transpose_multiply_as_packed_u( + const NumTypeA *a, + unsigned ar, + unsigned ac, + NumTypeAB *ata) + { + if (ar == 0) { + std::fill(ata, ata+(ac*(ac+1)/2), static_cast(0)); + return; + } + std::size_t ik = 0; + for(unsigned i=0;i + void + transpose_multiply_diagonal_multiply_as_packed_u( + const NumTypeA *a, + const NumTypeD *diagonal_elements, + unsigned n, + NumTypeAD *atda) + { + std::size_t ik = 0; + for(unsigned i=0;i +#include +#include +#include +#include + +namespace scitbx { namespace matrix { namespace row_echelon { + + namespace detail { + + template + inline void + swap(AnyType* a, AnyType* b, std::size_t n) + { + for(std::size_t i=0;i + std::size_t + form_t(af::ref& m, + af::ref const& t) + { + // C++ version of RowEchelonFormT from the CrystGAP package + // (GAP Version 3.4.4). + // B. Eick, F. Ga"hler and W. Nickel + // Computing Maximal Subgroups and Wyckoff Positions of Space Groups + // Acta Cryst. (1997). A53, 467 - 474 + using std::size_t; + size_t mr = m.n_rows(); + size_t mc = m.n_columns(); + size_t tc = t.n_columns(); + if (tc) { + SCITBX_ASSERT(t.begin() != 0 && t.n_rows() >= mr); + } + size_t i, j; + for (i = j = 0; i < mr && j < mc;) { + size_t k = i; while (k < mr && m(k,j) == 0) k++; + if (k == mr) + j++; + else { + if (i != k) { + detail::swap(&m(i,0), &m(k,0), mc); + if (tc) detail::swap(&t(i,0), &t(k,0), tc); + } + for (k++; k < mr; k++) { + IntType a = scitbx::fn::absolute(m(k, j)); + if (a != 0 && a < scitbx::fn::absolute(m(i,j))) { + detail::swap(&m(i,0), &m(k,0), mc); + if (tc) detail::swap(&t(i,0), &t(k,0), tc); + } + } + if (m(i,j) < 0) { + for(size_t ic=0;ic(m.begin(), i, mc); + return i; + } + + template + std::size_t + form(af::ref& m) + { + af::ref t(0,0,0); + return form_t(m, t); + } + + template + IntType + back_substitution_int( + af::const_ref const& re_mx, + const IntType* v = 0, + IntType* sol = 0, + bool* flag_indep = 0) + { + using std::size_t; + size_t nr = re_mx.n_rows(); + size_t nc = re_mx.n_columns(); + if (flag_indep) { + for(size_t ic=0;ic 0;) + { + ir--; + size_t ic; + for(ic=0;ic + bool + back_substitution_float( + af::const_ref const& re_mx, + const FloatType* v, + FloatType* sol) + { + SCITBX_ASSERT(sol != 0); + using std::size_t; + size_t nr = re_mx.n_rows(); + size_t nc = re_mx.n_columns(); + for (size_t ir = nr; ir > 0;) + { + ir--; + size_t ic; + for(ic=0;ic(re_mx(ir,ic)); + } + return true; + } + + template + struct independent + { + independent() {} + + independent(af::const_ref const& re_mx) + { + using std::size_t; + size_t nc = re_mx.n_columns(); + SCITBX_ASSERT(nc <= MaxIndependentIndices); + bool flag_indep[MaxIndependentIndices]; + IntType* n_a = 0; + SCITBX_ASSERT(back_substitution_int(re_mx, n_a, n_a, flag_indep) >= 1); + for(size_t ic=0;ic indices; + }; + +}}} // namespace scitbx::matrix::row_echelon + +#endif // include guard diff --git a/extern/cctbx/include/scitbx/rational.h b/extern/cctbx/include/scitbx/rational.h new file mode 100644 index 00000000..99cdba79 --- /dev/null +++ b/extern/cctbx/include/scitbx/rational.h @@ -0,0 +1,73 @@ +#ifndef SCITBX_RATIONAL_H +#define SCITBX_RATIONAL_H + +#include +#include +#include + +namespace scitbx { + + //! Formatting of rational numbers. + template + std::string + format( + boost::rational const& v, + bool decimal=false) + { + if (v.numerator() == 0) return std::string("0"); + char buf[128]; + if (decimal) { + std::sprintf(buf, "%.6g", double(v.numerator()) / v.denominator()); + char* cp = buf; + if (*cp == '-') cp++; + if (*cp == '0') { + char* cpp = cp + 1; while (*cp) *cp++ = *cpp++; + } + } + else if (v.denominator() == 1) { + std::sprintf(buf, "%ld", static_cast(v.numerator())); + } + else { + std::sprintf(buf, "%ld/%ld", static_cast(v.numerator()), + static_cast(v.denominator())); + } + return std::string(buf); + } + + template + std::string + format( + boost::rational const* values, + std::size_t values_size, + char const* seperator=",", + bool decimal=false) + { + std::string result; + if (values_size != 0) { + result.reserve(8*values_size); + for(std::size_t i=0;;) { + result += format(values[i++], decimal); + if (i == values_size) break; + result += seperator; + } + } + return result; + } + + template + typename ArrayType::value_type + array_lcm(ArrayType const& a) + { + typename ArrayType::value_type result; + if (a.size() > 0) { + result = a[0]; + for(std::size_t i=1;i +#include + +#if defined(__i386__) \ + || defined(__x86_64__) \ + || defined(__alpha__) \ + || defined(__host_mips) \ + || defined(__APPLE_CC__) +# define SCITBX_SERIALIZATION_BASE_256_USE_BIT_SHIFTS +#endif + +//#define SCITBX_SERIALIZATION_BASE_256_USE_LDEXP_POSITIVE +//#define SCITBX_SERIALIZATION_BASE_256_USE_LDEXP_NEGATIVE + +namespace scitbx { namespace serialization { namespace base_256 { + + namespace integer { + + namespace signed_ { + + template + inline + char* + to_string(char* buf, T value) + { + unsigned char* u_buf = reinterpret_cast(buf); + unsigned char* u_buf0 = u_buf; + *u_buf++ = 0; + if (value != 0) { + if (value < 0) { + *u_buf0 = 128; + value = -value; + } + for(unsigned i=0;i(value % 256); + value /= 256; +#else + *u_buf++ = static_cast(value & 0xFFU); + value >>= 8; +#endif + if (value == 0) break; + } + *u_buf0 += static_cast(u_buf - u_buf0); + } + return reinterpret_cast(u_buf); + } + + template + struct from_string + { + from_string(const char* buf) + : + end(buf), + value(0) + { + const unsigned char* + u_end = reinterpret_cast(end); +#if !defined(SCITBX_SERIALIZATION_BASE_256_USE_BIT_SHIFTS) + int len = *u_end % 128; +#else + int len = *u_end & 0x7FU; +#endif + if (len == 0) { + end++; + return; + } + const unsigned char* + u_buf = reinterpret_cast(buf); + u_end += len-1; + for(;;) { + value += static_cast(*u_end--); + if (u_end == u_buf) break; +#if !defined(SCITBX_SERIALIZATION_BASE_256_USE_BIT_SHIFTS) + value *= 256; +#else + value <<= 8; +#endif + } + if (*u_buf > 128) value = -value; + end = buf + len; + } + + const char* end; + T value; + }; + + } // namespace signed_ + + namespace unsigned_ { + + template + inline + char* + to_string(char* buf, T value) + { + unsigned char* u_buf = reinterpret_cast(buf); + unsigned char* u_buf0 = u_buf; + *u_buf++ = 0; + if (value != 0) { + for(unsigned i=0;i(value % 256); + value /= 256; +#else + *u_buf++ = static_cast(value & 0xFFU); + value >>= 8; +#endif + if (value == 0) break; + } + *u_buf0 += static_cast(u_buf - u_buf0); + } + return reinterpret_cast(u_buf); + } + + template + struct from_string + { + from_string(const char* buf) + : + end(buf), + value(0) + { + const unsigned char* + u_end = reinterpret_cast(end); +#if !defined(SCITBX_SERIALIZATION_BASE_256_USE_BIT_SHIFTS) + int len = *u_end % 128; +#else + int len = *u_end & 0x7FU; +#endif + if (len == 0) { + end++; + return; + } + const unsigned char* + u_buf = reinterpret_cast(buf); + u_end += len-1; + for(;;) { + value += static_cast(*u_end--); + if (u_end == u_buf) break; +#if !defined(SCITBX_SERIALIZATION_BASE_256_USE_BIT_SHIFTS) + value *= 256; +#else + value <<= 8; +#endif + } + end = buf + len; + } + + const char* end; + T value; + }; + + } // namespace unsigned_ + + } // namespace integer + + template + struct from_string; + + inline + char* + to_string(char* buf, short const& value) + { + return integer::signed_::to_string(buf, value); + } + + template<> + struct from_string : integer::signed_::from_string + { + from_string(const char* buf) + : integer::signed_::from_string(buf) + {} + }; + + inline + char* + to_string(char* buf, unsigned short const& value) + { + return integer::unsigned_::to_string(buf, value); + } + + template<> + struct from_string + : integer::unsigned_::from_string + { + from_string(const char* buf) + : integer::unsigned_::from_string(buf) + {} + }; + + inline + char* + to_string(char* buf, int const& value) + { + return integer::signed_::to_string(buf, value); + } + + template<> + struct from_string : integer::signed_::from_string + { + from_string(const char* buf) + : integer::signed_::from_string(buf) + {} + }; + + inline + char* + to_string(char* buf, unsigned int const& value) + { + return integer::unsigned_::to_string(buf, value); + } + + template<> + struct from_string + : integer::unsigned_::from_string + { + from_string(const char* buf) + : integer::unsigned_::from_string(buf) + {} + }; + + inline + char* + to_string(char* buf, long const& value) + { + return integer::signed_::to_string(buf, value); + } + + template<> + struct from_string : integer::signed_::from_string + { + from_string(const char* buf) + : integer::signed_::from_string(buf) + {} + }; + + inline + char* + to_string(char* buf, unsigned long const& value) + { + return integer::unsigned_::to_string(buf, value); + } + + template<> + struct from_string + : integer::unsigned_::from_string + { + from_string(const char* buf) + : integer::unsigned_::from_string(buf) + {} + }; + + inline + char* + to_string(char* buf, long long const& value) + { + return integer::signed_::to_string(buf, value); + } + + template<> + struct from_string : integer::signed_::from_string + { + from_string(const char* buf) + : integer::signed_::from_string(buf) + {} + }; + + inline + char* + to_string(char* buf, unsigned long long const& value) + { + return integer::unsigned_::to_string(buf, value); + } + + template<> + struct from_string + : integer::unsigned_::from_string + { + from_string(const char* buf) + : integer::unsigned_::from_string(buf) + {} + }; + + namespace floating_point { + + struct decomposition + { + decomposition(double x) + { + f = std::frexp(x, &e); + } + + double f; + int e; + }; + + template + inline + char* + to_string(char* buf, T value) + { + unsigned char* u_buf = reinterpret_cast(buf); + unsigned char* u_buf0 = u_buf; + *u_buf++ = 0; + if (value == 0) return reinterpret_cast(u_buf); + if (value < 0) { + *u_buf0 = 128; + value = -value; + } + decomposition v(value); + for(unsigned i=0;i(v.f); + SCITBX_ASSERT(d < 256); + *u_buf++ = static_cast(d); + v.f -= d; + if (v.f == 0) break; + } + *u_buf0 += static_cast(u_buf - u_buf0); + return base_256::to_string(reinterpret_cast(u_buf), v.e); + } + + template + struct from_string + { + from_string(const char* buf) + : + end(buf) + { + const unsigned char* + u_end = reinterpret_cast(end); +#if !defined(SCITBX_SERIALIZATION_BASE_256_USE_BIT_SHIFTS) + int len = *u_end % 128; +#else + int len = *u_end & 0x7FU; +#endif + if (len == 0) { + value = 0; + end++; + return; + } + const unsigned char* + u_buf = reinterpret_cast(buf); + u_end += len-1; + double vd = 0; + for(;;) { + vd += static_cast(*u_end--); +#ifndef SCITBX_SERIALIZATION_BASE_256_USE_LDEXP_NEGATIVE + vd /= 256; +#else + vd = std::ldexp(vd, -8); +#endif + if (u_end == u_buf) break; + } + base_256::from_string e_proxy(buf + len); + value = static_cast(std::ldexp(vd, e_proxy.value)); + if (*u_buf > 128) value = -value; + end = e_proxy.end; + } + + const char* end; + T value; + }; + + } // namespace floating_point + + inline + char* + to_string(char* buf, float const& value) + { + return floating_point::to_string(buf, value); + } + + template<> + struct from_string : floating_point::from_string + { + from_string(const char* buf) + : floating_point::from_string(buf) + {} + }; + + inline + char* + to_string(char* buf, double const& value) + { + return floating_point::to_string(buf, value); + } + + template<> + struct from_string : floating_point::from_string + { + from_string(const char* buf) + : floating_point::from_string(buf) + {} + }; + +}}} // namespace scitbx::serialization::base_256 diff --git a/extern/cctbx/include/scitbx/sym_mat3.h b/extern/cctbx/include/scitbx/sym_mat3.h new file mode 100644 index 00000000..8bad9287 --- /dev/null +++ b/extern/cctbx/include/scitbx/sym_mat3.h @@ -0,0 +1,845 @@ +#ifndef SCITBX_SYM_MAT3_H +#define SCITBX_SYM_MAT3_H + +#include + +namespace scitbx { + + static const std::size_t sym_mat3_storage_mapping[] = {0,3,4, + 3,1,5, + 4,5,2}; + //! Symmetric 3x3 matrix class. + template + class sym_mat3 : public af::tiny_plain + { + public: + typedef typename af::tiny_plain base_type; + + //! Default constructor. Elements are not initialized. + sym_mat3() {} + //! Constructor. + sym_mat3(NumType const& e00, NumType const& e11, NumType const& e22, + NumType const& e01, NumType const& e02, NumType const& e12) + : base_type(e00, e11, e22, e01, e02, e12) + {} + //! Constructor. + sym_mat3(base_type const& a) + : base_type(a) + {} + //! Constructor. + explicit + sym_mat3(const NumType* a) + { + for(std::size_t i=0;i<6;i++) this->elems[i] = a[i]; + } + //! Constructor for diagonal matrix. + explicit + sym_mat3(NumType const& diag) + : base_type(diag,diag,diag,0,0,0) + {} + //! Constructor for diagonal matrix. + explicit + sym_mat3(af::tiny_plain const& diag) + : base_type(diag[0],diag[1],diag[2],0,0,0) + {} + //! Construction from full 3x3 matrix. + /*! The off-diagonal elements of the new sym_mat3 are copied from + the upper-right triangle of m. +

+ An exception is thrown if the absolute value of the + difference between any pair of off-diagonal elements is + different from zero. +

+ See also: mat3<>::is_symmetric() + */ + explicit + sym_mat3(mat3 const& m) + : base_type(m[0],m[4],m[8],m[1],m[2],m[5]) + { + SCITBX_ASSERT(m.is_symmetric()); + } + //! Construction from full 3x3 matrix. + /*! The off-diagonal elements of the new sym_mat3 are determined + as the averages of the corresponding off-diagonal elements + of the input matrix m. +

+ If relative_tolerance is greater than or equal to zero, it is + used to check the input matrix m. An exception is thrown if + the absolute value of the difference between any pair of + off-diagonal elements is larger than + max_abs*relative_tolerance, where max_abs is the maximum of + the absolute values of the elements of m. +

+ See also: mat3<>::is_symmetric() + */ + explicit + sym_mat3(mat3 const& m, NumType const& relative_tolerance) + : base_type(m[0],m[4],m[8], + (m[1]+m[3])/2, + (m[2]+m[6])/2, + (m[5]+m[7])/2) + { + SCITBX_ASSERT(relative_tolerance < 0 + || m.is_symmetric(relative_tolerance)); + } + + //! Access elements with 2-dimensional indices. + NumType const& + operator()(std::size_t r, std::size_t c) const + { + return this->begin()[sym_mat3_storage_mapping[r * 3 + c]]; + } + //! Access elements with 2-dimensional indices. + NumType& + operator()(std::size_t r, std::size_t c) + { + return this->begin()[sym_mat3_storage_mapping[r * 3 + c]]; + } + + //! Return diagonal elements. + vec3 + diagonal() const + { + return vec3(this->begin()); + } + + //! Return the transposed matrix. + /*! In analogy with mat3, return a new instance. + */ + sym_mat3 + transpose() + { + return *this; + } + + //! Return trace (sum of diagonal elements). + NumType + trace() const + { + return af::sum(diagonal()); + } + + //! Return determinant. + NumType + determinant() const + { + sym_mat3 const& m = *this; + return m(0,0) * (m(1,1) * m(2,2) - m(1,2) * m(2,1)) + - m(0,1) * (m(1,0) * m(2,2) - m(1,2) * m(2,0)) + + m(0,2) * (m(1,0) * m(2,1) - m(1,1) * m(2,0)); + } + + //! Return the transposed of the co-factor matrix. + /*! The inverse matrix is obtained by dividing the result + by the determinant(). + */ + sym_mat3 + co_factor_matrix_transposed() const + { + sym_mat3 const& m = *this; + sym_mat3 result; + result(0,0) = m(1,1) * m(2,2) - m(1,2) * m(2,1); + result(1,1) = m(0,0) * m(2,2) - m(0,2) * m(2,0); + result(2,2) = m(0,0) * m(1,1) - m(0,1) * m(1,0); + result(0,1) = -m(0,1) * m(2,2) + m(0,2) * m(2,1); + result(0,2) = m(0,1) * m(1,2) - m(0,2) * m(1,1); + result(1,2) = -m(0,0) * m(1,2) + m(0,2) * m(1,0); + return result; + } + + //! Return the inverse matrix. + /*! An exception is thrown if the matrix is not invertible, + i.e. if the determinant() is zero. + */ + sym_mat3 + inverse() const + { + NumType d = determinant(); + if (d == NumType(0)) throw error("Matrix is not invertible."); + return co_factor_matrix_transposed() / d; + } + + //! Tensor transform: c * (*this) * c.transpose() + template + sym_mat3 + tensor_transform(mat3 const& c) const; + + //! Antisymmetric tensor transform: c * (*this) * c.transpose() + /*! c is the antisymmetric matrix + {{ 0, v0, v1}, + {-v0, 0, v2} + {-v1, -v2, 0}} + */ + sym_mat3 + antisymmetric_tensor_transform( + NumType const& v0, + NumType const& v1, + NumType const& v2) const; + + //! Antisymmetric tensor transform: c * (*this) * c.transpose() + /*! c is the antisymmetric matrix + {{ 0, v[0], v[1]}, + {-v[0], 0, v[2]} + {-v[1], -v[2], 0 }} + */ + sym_mat3 + antisymmetric_tensor_transform(vec3 const& v) const + { + return antisymmetric_tensor_transform(v[0], v[1], v[2]); + } + + //! Tensor transform: c.transpose() * (*this) * c + sym_mat3 + tensor_transpose_transform(mat3 const& c) const; + + //! Sum of 9 element-wise products. + inline + NumType + dot(sym_mat3 const& other) const + { + sym_mat3 const& m = *this; + return m[0] * other[0] + + m[1] * other[1] + + m[2] * other[2] + + 2 * ( m[3] * other[3] + + m[4] * other[4] + + m[5] * other[5]); + } + }; + + // Constructor for mat3. + template + inline + mat3::mat3(sym_mat3 const& m) + : base_type(m[0], m[3], m[4], + m[3], m[1], m[5], + m[4], m[5], m[2]) + {} + + template + inline + sym_mat3 + mat3::self_times_self_transpose() const + { + mat3 const& m = *this; + return sym_mat3( + m[0]*m[0]+m[1]*m[1]+m[2]*m[2], + m[3]*m[3]+m[4]*m[4]+m[5]*m[5], + m[6]*m[6]+m[7]*m[7]+m[8]*m[8], + m[0]*m[3]+m[1]*m[4]+m[2]*m[5], + m[0]*m[6]+m[1]*m[7]+m[2]*m[8], + m[3]*m[6]+m[4]*m[7]+m[5]*m[8]); + } + + template + inline + sym_mat3 + mat3::self_transpose_times_self() const + { + mat3 const& m = *this; + return sym_mat3( + m[0]*m[0]+m[3]*m[3]+m[6]*m[6], + m[1]*m[1]+m[4]*m[4]+m[7]*m[7], + m[2]*m[2]+m[5]*m[5]+m[8]*m[8], + m[0]*m[1]+m[3]*m[4]+m[6]*m[7], + m[0]*m[2]+m[3]*m[5]+m[6]*m[8], + m[1]*m[2]+m[4]*m[5]+m[7]*m[8]); + } + + // non-inline member function + template + sym_mat3 + sym_mat3 + ::antisymmetric_tensor_transform( + NumType const& v0, + NumType const& v1, + NumType const& v2) const + { + sym_mat3 const& t = *this; + NumType v00 = v0 * v0; + NumType v11 = v1 * v1; + NumType v22 = v2 * v2; + NumType v01 = v0 * v1; + NumType v02 = v0 * v2; + NumType v12 = v1 * v2; + // The result is guaranteed to be a symmetric matrix. + return sym_mat3( + t[2]*v11 + 2*t[5]*v01 + t[1]*v00, + t[2]*v22 - 2*t[4]*v02 + t[0]*v00, + t[1]*v22 + 2*t[3]*v12 + t[0]*v11, + t[2]*v12 + t[5]*v02 - t[4]*v01 - t[3]*v00, + -t[5]*v12 - t[1]*v02 - t[4]*v11 - t[3]*v01, + -t[5]*v22 - t[4]*v12 + t[3]*v02 + t[0]*v01); + } + + // non-inline member function + template + template + sym_mat3 + sym_mat3 + ::tensor_transform(mat3 const& c) const + { + mat3 ct = c * (*this); + // The result is guaranteed to be a symmetric matrix. + return sym_mat3( + ct[0]*c[0]+ct[1]*c[1]+ct[2]*c[2], + ct[3]*c[3]+ct[4]*c[4]+ct[5]*c[5], + ct[6]*c[6]+ct[7]*c[7]+ct[8]*c[8], + ct[0]*c[3]+ct[1]*c[4]+ct[2]*c[5], + ct[0]*c[6]+ct[1]*c[7]+ct[2]*c[8], + ct[3]*c[6]+ct[4]*c[7]+ct[5]*c[8]); + } + + // non-inline member function + template + sym_mat3 + sym_mat3 + ::tensor_transpose_transform(mat3 const& c) const + { + sym_mat3 const& t = *this; + mat3 ctt( // c.transpose() * (*this) + c[0]*t[0]+c[3]*t[3]+c[6]*t[4], + c[3]*t[1]+c[0]*t[3]+c[6]*t[5], + c[6]*t[2]+c[0]*t[4]+c[3]*t[5], + c[1]*t[0]+c[4]*t[3]+c[7]*t[4], + c[4]*t[1]+c[1]*t[3]+c[7]*t[5], + c[7]*t[2]+c[1]*t[4]+c[4]*t[5], + c[2]*t[0]+c[5]*t[3]+c[8]*t[4], + c[5]*t[1]+c[2]*t[3]+c[8]*t[5], + c[8]*t[2]+c[2]*t[4]+c[5]*t[5]); + // The result is guaranteed to be a symmetric matrix. + return sym_mat3( + ctt[0]*c[0]+ctt[1]*c[3]+ctt[2]*c[6], + ctt[3]*c[1]+ctt[4]*c[4]+ctt[5]*c[7], + ctt[6]*c[2]+ctt[7]*c[5]+ctt[8]*c[8], + ctt[0]*c[1]+ctt[1]*c[4]+ctt[2]*c[7], + ctt[0]*c[2]+ctt[1]*c[5]+ctt[2]*c[8], + ctt[3]*c[2]+ctt[4]*c[5]+ctt[5]*c[8]); + } + + //! Test equality. + template + inline + bool + operator==( + sym_mat3 const& lhs, + sym_mat3 const& rhs) + { + for(std::size_t i=0;i<6;i++) { + if (lhs[i] != rhs[i]) return false; + } + return true; + } + + //! Test equality. True if all elements of lhs == rhs. + template + inline + bool + operator==( + sym_mat3 const& lhs, + NumType const& rhs) + { + for(std::size_t i=0;i<6;i++) { + if (lhs[i] != rhs ) return false; + } + return true; + } + + //! Test equality. True if all elements of rhs == lhs. + template + inline + bool + operator==( + NumType const& lhs, + sym_mat3 const& rhs) + { + for(std::size_t i=0;i<6;i++) { + if (lhs != rhs[i]) return false; + } + return true; + } + + //! Test inequality. + template + inline + bool + operator!=( + sym_mat3 const& lhs, + sym_mat3 const& rhs) + { + return !(lhs == rhs); + } + + //! Test inequality. True if any element of lhs != rhs. + template + inline + bool + operator!=( + sym_mat3 const& lhs, + NumType const& rhs) + { + return !(lhs == rhs); + } + + //! Test inequality. True if any element of rhs != lhs. + template + inline + bool + operator!=( + NumType const& lhs, + sym_mat3 const& rhs) + { + return !(lhs == rhs); + } + + //! Element-wise addition. + template + inline + sym_mat3 + operator+( + sym_mat3 const& lhs, + sym_mat3 const& rhs) + { + sym_mat3 result; + for(std::size_t i=0;i<6;i++) { + result[i] = lhs[i] + rhs[i]; + } + return result; + } + + //! Element-wise addition. + template + inline + sym_mat3 + operator+( + sym_mat3 const& lhs, + NumType const& rhs) + { + sym_mat3 result; + for(std::size_t i=0;i<6;i++) { + result[i] = lhs[i] + rhs ; + } + return result; + } + + //! Element-wise addition. + template + inline + sym_mat3 + operator+( + NumType const& lhs, + sym_mat3 const& rhs) + { + sym_mat3 result; + for(std::size_t i=0;i<6;i++) { + result[i] = lhs + rhs[i]; + } + return result; + } + + //! Element-wise difference. + template + inline + sym_mat3 + operator-( + sym_mat3 const& lhs, + sym_mat3 const& rhs) + { + sym_mat3 result; + for(std::size_t i=0;i<6;i++) { + result[i] = lhs[i] - rhs[i]; + } + return result; + } + + //! Element-wise difference. + template + inline + sym_mat3 + operator-( + sym_mat3 const& lhs, + NumType const& rhs) + { + sym_mat3 result; + for(std::size_t i=0;i<6;i++) { + result[i] = lhs[i] - rhs ; + } + return result; + } + + //! Element-wise difference. + template + inline + sym_mat3 + operator-( + NumType const& lhs, + sym_mat3 const& rhs) + { + sym_mat3 result; + for(std::size_t i=0;i<6;i++) { + result[i] = lhs - rhs[i]; + } + return result; + } + + //! Symmetric * symmetric matrix product. + template + inline + mat3< + typename af::binary_operator_traits< + NumTypeLhs, NumTypeRhs>::arithmetic> + operator*( + sym_mat3 const& lhs, + sym_mat3 const& rhs) + { + typedef + typename af::binary_operator_traits< + NumTypeLhs, NumTypeRhs>::arithmetic + result_element_type; + result_element_type lhs_3__rhs_3_ = lhs[3]*rhs[3]; + result_element_type lhs_4__rhs_4_ = lhs[4]*rhs[4]; + result_element_type lhs_5__rhs_5_ = lhs[5]*rhs[5]; + return mat3( + lhs[0]*rhs[0]+lhs_3__rhs_3_+lhs_4__rhs_4_, + lhs[3]*rhs[1]+lhs[0]*rhs[3]+lhs[4]*rhs[5], + lhs[4]*rhs[2]+lhs[0]*rhs[4]+lhs[3]*rhs[5], + lhs[3]*rhs[0]+lhs[1]*rhs[3]+lhs[5]*rhs[4], + lhs[1]*rhs[1]+lhs_3__rhs_3_+lhs_5__rhs_5_, + lhs[5]*rhs[2]+lhs[3]*rhs[4]+lhs[1]*rhs[5], + lhs[4]*rhs[0]+lhs[5]*rhs[3]+lhs[2]*rhs[4], + lhs[5]*rhs[1]+lhs[4]*rhs[3]+lhs[2]*rhs[5], + lhs[2]*rhs[2]+lhs_4__rhs_4_+lhs_5__rhs_5_); + } + + //! Square * symmetric matrix product. + template + inline + mat3< + typename af::binary_operator_traits< + NumTypeLhs, NumTypeRhs>::arithmetic> + operator*( + mat3 const& lhs, + sym_mat3 const& rhs) + { + return mat3< + typename af::binary_operator_traits< + NumTypeLhs, NumTypeRhs>::arithmetic>( + lhs[0]*rhs[0]+lhs[1]*rhs[3]+lhs[2]*rhs[4], + lhs[1]*rhs[1]+lhs[0]*rhs[3]+lhs[2]*rhs[5], + lhs[2]*rhs[2]+lhs[0]*rhs[4]+lhs[1]*rhs[5], + lhs[3]*rhs[0]+lhs[4]*rhs[3]+lhs[5]*rhs[4], + lhs[4]*rhs[1]+lhs[3]*rhs[3]+lhs[5]*rhs[5], + lhs[5]*rhs[2]+lhs[3]*rhs[4]+lhs[4]*rhs[5], + lhs[6]*rhs[0]+lhs[7]*rhs[3]+lhs[8]*rhs[4], + lhs[7]*rhs[1]+lhs[6]*rhs[3]+lhs[8]*rhs[5], + lhs[8]*rhs[2]+lhs[6]*rhs[4]+lhs[7]*rhs[5]); + } + + //! Symmetric * square matrix product. + template + inline + mat3< + typename af::binary_operator_traits< + NumTypeLhs, NumTypeRhs>::arithmetic> + operator*( + sym_mat3 const& lhs, + mat3 const& rhs) + { + return mat3< + typename af::binary_operator_traits< + NumTypeLhs, NumTypeRhs>::arithmetic>( + rhs[0]*lhs[0]+rhs[3]*lhs[3]+rhs[6]*lhs[4], + rhs[1]*lhs[0]+rhs[4]*lhs[3]+rhs[7]*lhs[4], + rhs[2]*lhs[0]+rhs[5]*lhs[3]+rhs[8]*lhs[4], + rhs[3]*lhs[1]+rhs[0]*lhs[3]+rhs[6]*lhs[5], + rhs[4]*lhs[1]+rhs[1]*lhs[3]+rhs[7]*lhs[5], + rhs[5]*lhs[1]+rhs[2]*lhs[3]+rhs[8]*lhs[5], + rhs[6]*lhs[2]+rhs[0]*lhs[4]+rhs[3]*lhs[5], + rhs[7]*lhs[2]+rhs[1]*lhs[4]+rhs[4]*lhs[5], + rhs[8]*lhs[2]+rhs[2]*lhs[4]+rhs[5]*lhs[5]); + } + + //! Matrix * vector product. + template + inline + vec3< + typename af::binary_operator_traits< + NumTypeMatrix, NumTypeVector>::arithmetic> + operator*( + sym_mat3 const& lhs, + af::tiny_plain const& rhs) + { + return vec3< + typename af::binary_operator_traits< + NumTypeMatrix, NumTypeVector>::arithmetic>( + lhs[0]*rhs[0]+lhs[3]*rhs[1]+lhs[4]*rhs[2], + lhs[3]*rhs[0]+lhs[1]*rhs[1]+lhs[5]*rhs[2], + lhs[4]*rhs[0]+lhs[5]*rhs[1]+lhs[2]*rhs[2]); + } + + //! Vector * matrix product. + template + inline + vec3< + typename af::binary_operator_traits< + NumTypeMatrix, NumTypeVector>::arithmetic> + operator*( + af::tiny_plain const& lhs, + sym_mat3 const& rhs) + { + return vec3< + typename af::binary_operator_traits< + NumTypeMatrix, NumTypeVector>::arithmetic>( + lhs[0]*rhs[0]+lhs[1]*rhs[3]+lhs[2]*rhs[4], + lhs[1]*rhs[1]+lhs[0]*rhs[3]+lhs[2]*rhs[5], + lhs[2]*rhs[2]+lhs[0]*rhs[4]+lhs[1]*rhs[5]); + } + + /// Linear form * (matrix as 6-vector) + template + inline + typename af::binary_operator_traits::arithmetic + operator*(af::tiny_plain const &form, + sym_mat3 const &matrix_as_vec6) + { + typename af::binary_operator_traits::arithmetic + result = 0; + for (int i=0; i<6; ++i) result += form[i]*matrix_as_vec6[i]; + return result; + } + + //! Element-wise multiplication. + template + inline + sym_mat3 + operator*( + sym_mat3 const& lhs, + NumType const& rhs) + { + sym_mat3 result; + for(std::size_t i=0;i<6;i++) { + result[i] = lhs[i] * rhs ; + } + return result; + } + + //! Element-wise multiplication. + template + inline + sym_mat3 + operator*( + NumType const& lhs, + sym_mat3 const& rhs) + { + sym_mat3 result; + for(std::size_t i=0;i<6;i++) { + result[i] = lhs * rhs[i]; + } + return result; + } + + //! Element-wise division. + template + inline + sym_mat3 + operator/( + sym_mat3 const& lhs, + NumType const& rhs) + { + sym_mat3 result; + for(std::size_t i=0;i<6;i++) { + result[i] = lhs[i] / rhs ; + } + return result; + } + + //! Element-wise division. + template + inline + sym_mat3 + operator/( + NumType const& lhs, + sym_mat3 const& rhs) + { + sym_mat3 result; + for(std::size_t i=0;i<6;i++) { + result[i] = lhs / rhs[i]; + } + return result; + } + + //! Element-wise modulus operation. + template + inline + sym_mat3 + operator%( + sym_mat3 const& lhs, + NumType const& rhs) + { + sym_mat3 result; + for(std::size_t i=0;i<6;i++) { + result[i] = lhs[i] % rhs ; + } + return result; + } + + //! Element-wise modulus operation. + template + inline + sym_mat3 + operator%( + NumType const& lhs, + sym_mat3 const& rhs) + { + sym_mat3 result; + for(std::size_t i=0;i<6;i++) { + result[i] = lhs % rhs[i]; + } + return result; + } + + //! Element-wise in-place addition. + template + inline + sym_mat3& + operator+=( + sym_mat3& lhs, + sym_mat3 const& rhs) + { + for(std::size_t i=0;i<6;i++) { + lhs[i] += rhs[i]; + } + return lhs; + } + + //! Element-wise in-place addition. + template + inline + sym_mat3& + operator+=( + sym_mat3& lhs, + NumType const& rhs) + { + for(std::size_t i=0;i<6;i++) { + lhs[i] += rhs ; + } + return lhs; + } + + //! Element-wise in-place difference. + template + inline + sym_mat3& + operator-=( + sym_mat3& lhs, + sym_mat3 const& rhs) + { + for(std::size_t i=0;i<6;i++) { + lhs[i] -= rhs[i]; + } + return lhs; + } + + //! Element-wise in-place difference. + template + inline + sym_mat3& + operator-=( + sym_mat3& lhs, + NumType const& rhs) + { + for(std::size_t i=0;i<6;i++) { + lhs[i] -= rhs ; + } + return lhs; + } + + //! Element-wise in-place multiplication. + template + inline + sym_mat3& + operator*=( + sym_mat3& lhs, + NumType const& rhs) + { + for(std::size_t i=0;i<6;i++) { + lhs[i] *= rhs ; + } + return lhs; + } + + //! Element-wise in-place division. + template + inline + sym_mat3& + operator/=( + sym_mat3& lhs, + NumType const& rhs) + { + for(std::size_t i=0;i<6;i++) { + lhs[i] /= rhs ; + } + return lhs; + } + + //! Element-wise in-place modulus operation. + template + inline + sym_mat3& + operator%=( + sym_mat3& lhs, + NumType const& rhs) + { + for(std::size_t i=0;i<6;i++) { + lhs[i] %= rhs ; + } + return lhs; + } + + //! Element-wise unary minus. + template + inline + sym_mat3 + operator-( + sym_mat3 const& v) + { + sym_mat3 result; + for(std::size_t i=0;i<6;i++) { + result[i] = -v[i]; + } + return result; + } + + //! Element-wise unary plus. + template + inline + sym_mat3 + operator+( + sym_mat3 const& v) + { + sym_mat3 result; + for(std::size_t i=0;i<6;i++) { + result[i] = +v[i]; + } + return result; + } + +} // namespace scitbx + +#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) + +namespace boost { + template + struct has_trivial_destructor > { + static const bool value = ::boost::has_trivial_destructor::value; + }; +} + +#endif + +#endif // SCITBX_SYM_MAT3_H diff --git a/extern/cctbx/include/scitbx/type_holder.h b/extern/cctbx/include/scitbx/type_holder.h new file mode 100644 index 00000000..9cd1d008 --- /dev/null +++ b/extern/cctbx/include/scitbx/type_holder.h @@ -0,0 +1,10 @@ +#ifndef SCITBX_TYPE_HOLDER_H +#define SCITBX_TYPE_HOLDER_H + +namespace scitbx { + + template struct type_holder { typedef T type; }; + +} // namespace scitbx + +#endif // SCITBX_TYPE_HOLDER_H diff --git a/extern/cctbx/include/scitbx/vec3.h b/extern/cctbx/include/scitbx/vec3.h new file mode 100644 index 00000000..0bbad34c --- /dev/null +++ b/extern/cctbx/include/scitbx/vec3.h @@ -0,0 +1,736 @@ +#ifndef SCITBX_VEC3_H +#define SCITBX_VEC3_H + +#include +#include +#include + +namespace scitbx { + + //! Three-dimensional vector. + /*! This class can be used to represent points, vectors, normals + or even colors. The usual vector operations are available. + + C++ version of the python vec3 class by + Matthias Baas (baas@ira.uka.de). See + http://cgkit.sourceforge.net/ + for more information. + */ + template + class vec3 : public af::tiny_plain + { + public: + typedef typename af::tiny_plain base_type; + + //! Default constructor. Elements are not initialized. + vec3() {} + //! All elements are initialized with e. + vec3(NumType const& e) + : base_type(e, e, e) + {} + //! Constructor. + vec3(NumType const& e0, NumType const& e1, NumType const& e2) + : base_type(e0, e1, e2) + {} + //! Constructor. + vec3(base_type const& a) + : base_type(a) + {} + //! Constructor. + explicit + vec3(const NumType* a) + { + for(std::size_t i=0;i<3;i++) this->elems[i] = a[i]; + } + + //! Test if all elements are 0. + bool is_zero() const + { + return !(this->elems[0] || this->elems[1] || this->elems[2]); + } + + //! Minimum of vector elements. + NumType + min() const + { + NumType result = this->elems[0]; + if (result > this->elems[1]) result = this->elems[1]; + if (result > this->elems[2]) result = this->elems[2]; + return result; + } + + //! Maximum of vector elements. + NumType + max() const + { + NumType result = this->elems[0]; + if (result < this->elems[1]) result = this->elems[1]; + if (result < this->elems[2]) result = this->elems[2]; + return result; + } + + //! In-place minimum of this and other for each element. + void + each_update_min(vec3 const& other) + { + for(std::size_t i=0;i<3;i++) { + if (this->elems[i] > other[i]) this->elems[i] = other[i]; + } + } + + //! In-place maximum of this and other for each element. + void + each_update_max(vec3 const& other) + { + for(std::size_t i=0;i<3;i++) { + if (this->elems[i] < other[i]) this->elems[i] = other[i]; + } + } + + //! Sum of vector elements. + NumType + sum() const + { + return this->elems[0] + this->elems[1] + this->elems[2]; + } + + //! Product of vector elements. + NumType + product() const + { + return this->elems[0] * this->elems[1] * this->elems[2]; + } + + //! Cross product. + vec3 cross(vec3 const& other) const + { + vec3 const& a = *this; + vec3 const& b = other; + return vec3( + a[1] * b[2] - b[1] * a[2], + a[2] * b[0] - b[2] * a[0], + a[0] * b[1] - b[0] * a[1]); + } + + //! Element-wise multiplication. + template + vec3< + typename af::binary_operator_traits::arithmetic> + each_mul( + vec3 const& rhs) const + { + vec3< + typename af::binary_operator_traits::arithmetic> + result; + for(std::size_t i=0;i<3;i++) { + result[i] = (*this)[i] * rhs[i]; + } + return result; + } + + //! Return the length squared of the vector. + NumType length_sq() const + { + return (*this) * (*this); + } + + //! Return the length of the vector. + NumType length() const + { + return NumType(std::sqrt(length_sq())); + } + + //! Return normalized vector. + /*! length() == 0 will lead to a division-by-zero exception. + Explicit checks are avoided to maximize performance. + A maximally robust (but slower) calculation of the + ||.||_2 norm is implemented in + scitbx::math::accumulator::norm_accumulator . + */ + vec3 normalize() const + { + return (*this) / length(); + } + + //! Return angle (in radians) between this and other. + /*! This implementation is unsafe as it does not check + if both vector lengths are different from zero. + */ + NumType + angle( + vec3 const& other) const + { + return NumType( + std::acos(((*this) * other) / (length() * other.length()))); + } + + //! Return angle (in radians) between this and other. + /*! Safe implementation guarding against division-by-zero + and rounding errors. + */ + boost::optional + angle_rad( + vec3 const& other) const + { + NumType den = length() * other.length(); + if (den == 0) return boost::optional(); + NumType c = ((*this) * other) / den; + if (c < -1) c = -1; + else if (c > 1) c = 1; + return boost::optional(NumType(std::acos(c))); + } + + //! Return the reflection vector. + /*! @param n is the surface normal which has to be of unit length. + */ + vec3 reflect(vec3 const& n) const + { + return (*this) - NumType(2) * ((*this) * n) * n; + } + + //! Return the transmitted vector. + /*! @param n is the surface normal which has to be of unit length. + @param eta is the relative index of refraction. If the returned + vector is zero then there is no transmitted light because + of total internal reflection. + */ + vec3 refract(vec3 const& n, NumType const& eta) const + { + NumType dot = (*this) * n; + NumType k = 1. - eta*eta*(1. - dot*dot); + if (k < NumType(0)) return vec3(0,0,0); + return eta * (*this) - (eta * dot + std::sqrt(k)) * n; + } + + //! Returns a vector that is orthogonal to this. + /*! If normalize is true, given the null vector (within + floating-point precision) the result is (0,0,1). + */ + vec3 ortho(bool normalize=false) const; + + //! Copies the vector to a tiny instance. + af::tiny + as_tiny() const { return af::tiny(*this); } + + //! Rotate the vector. + /*! Use the rotation formula to rotate the vector around the direction + vector through an angle given in radians. The direction vector is + normalized so need not be given as a vector of unit length. + */ + vec3 + rotate_around_origin(vec3 const& direction, NumType const& angle) const { + vec3 unit = direction.normalize(); + return unit_rotate_around_origin(unit,angle); + } + + //! Rotate the vector. + /*! Use the rotation formula to rotate the vector around the unit + direction through an angle given in radians. The caller + guarantees that the direction vector is of unit length. + */ + vec3 + unit_rotate_around_origin(vec3 const& unit, NumType const& angle) const { + NumType cosang = std::cos(angle); + return (*this)*cosang + + unit*(unit*(*this))*(1.0-cosang)+ + (unit.cross(*this))*std::sin(angle); + } + + private: + static NumType abs_(NumType const& x) + { + if (x < NumType(0)) return -x; + return x; + } + }; + + //! Test equality. + template + inline + bool + operator==( + vec3 const& lhs, + vec3 const& rhs) + { + for(std::size_t i=0;i<3;i++) { + if (lhs[i] != rhs[i]) return false; + } + return true; + } + + //! Test equality. True if all elements of lhs == rhs. + template + inline + bool + operator==( + vec3 const& lhs, + NumType const& rhs) + { + for(std::size_t i=0;i<3;i++) { + if (lhs[i] != rhs ) return false; + } + return true; + } + + //! Test equality. True if all elements of rhs == lhs. + template + inline + bool + operator==( + NumType const& lhs, + vec3 const& rhs) + { + for(std::size_t i=0;i<3;i++) { + if (lhs != rhs[i]) return false; + } + return true; + } + + //! Test inequality. + template + inline + bool + operator!=( + vec3 const& lhs, + vec3 const& rhs) + { + return !(lhs == rhs); + } + + //! Test inequality. True if any element of lhs != rhs. + template + inline + bool + operator!=( + vec3 const& lhs, + NumType const& rhs) + { + return !(lhs == rhs); + } + + //! Test inequality. True if any element of rhs != lhs. + template + inline + bool + operator!=( + NumType const& lhs, + vec3 const& rhs) + { + return !(lhs == rhs); + } + + //! Element-wise addition. + template + inline + vec3 + operator+( + vec3 const& lhs, + vec3 const& rhs) + { + vec3 result; + for(std::size_t i=0;i<3;i++) { + result[i] = lhs[i] + rhs[i]; + } + return result; + } + + //! Element-wise addition. + template + inline + vec3 + operator+( + vec3 const& lhs, + NumType const& rhs) + { + vec3 result; + for(std::size_t i=0;i<3;i++) { + result[i] = lhs[i] + rhs ; + } + return result; + } + + //! Element-wise addition. + template + inline + vec3 + operator+( + NumType const& lhs, + vec3 const& rhs) + { + vec3 result; + for(std::size_t i=0;i<3;i++) { + result[i] = lhs + rhs[i]; + } + return result; + } + + //! Element-wise difference. + template + inline + vec3 + operator-( + vec3 const& lhs, + vec3 const& rhs) + { + vec3 result; + for(std::size_t i=0;i<3;i++) { + result[i] = lhs[i] - rhs[i]; + } + return result; + } + + //! Element-wise difference. + template + inline + vec3 + operator-( + vec3 const& lhs, + NumType const& rhs) + { + vec3 result; + for(std::size_t i=0;i<3;i++) { + result[i] = lhs[i] - rhs ; + } + return result; + } + + //! Element-wise difference. + template + inline + vec3 + operator-( + NumType const& lhs, + vec3 const& rhs) + { + vec3 result; + for(std::size_t i=0;i<3;i++) { + result[i] = lhs - rhs[i]; + } + return result; + } + + //! Dot product. + template + inline + typename af::binary_operator_traits::arithmetic + operator*( + vec3 const& lhs, + vec3 const& rhs) + { + typename af::binary_operator_traits::arithmetic + result(0); + for(std::size_t i=0;i<3;i++) { + result += lhs[i] * rhs[i]; + } + return result; + } + + //! Element-wise multiplication. + template + inline + vec3 + operator*( + vec3 const& lhs, + NumType const& rhs) + { + vec3 result; + for(std::size_t i=0;i<3;i++) { + result[i] = lhs[i] * rhs ; + } + return result; + } + + //! Element-wise multiplication. + template + inline + vec3 + operator*( + NumType const& lhs, + vec3 const& rhs) + { + vec3 result; + for(std::size_t i=0;i<3;i++) { + result[i] = lhs * rhs[i]; + } + return result; + } + + //! Element-wise division. + template + inline + vec3 + operator/( + vec3 const& lhs, + vec3 const& rhs) + { + vec3 result; + for(std::size_t i=0;i<3;i++) { + result[i] = lhs[i] / rhs[i]; + } + return result; + } + + //! Element-wise division. + template + inline + vec3 + operator/( + vec3 const& lhs, + NumType const& rhs) + { + vec3 result; + for(std::size_t i=0;i<3;i++) { + result[i] = lhs[i] / rhs ; + } + return result; + } + + //! Element-wise division. + template + inline + vec3 + operator/( + vec3 const& lhs, + std::size_t const& rhs) + { + vec3 result; + for(std::size_t i=0;i<3;i++) { + result[i] = lhs[i] / rhs ; + } + return result; + } + + //! Element-wise division. + template + inline + vec3 + operator/( + NumType const& lhs, + vec3 const& rhs) + { + vec3 result; + for(std::size_t i=0;i<3;i++) { + result[i] = lhs / rhs[i]; + } + return result; + } + + //! Element-wise modulus operation. + template + inline + vec3 + operator%( + vec3 const& lhs, + NumType const& rhs) + { + vec3 result; + for(std::size_t i=0;i<3;i++) { + result[i] = lhs[i] % rhs ; + } + return result; + } + + //! Element-wise modulus operation. + template + inline + vec3 + operator%( + NumType const& lhs, + vec3 const& rhs) + { + vec3 result; + for(std::size_t i=0;i<3;i++) { + result[i] = lhs % rhs[i]; + } + return result; + } + + //! Element-wise in-place addition. + template + inline + vec3& + operator+=( + vec3& lhs, + vec3 const& rhs) + { + for(std::size_t i=0;i<3;i++) { + lhs[i] += rhs[i]; + } + return lhs; + } + + //! Element-wise in-place addition. + template + inline + vec3& + operator+=( + vec3& lhs, + NumType const& rhs) + { + for(std::size_t i=0;i<3;i++) { + lhs[i] += rhs ; + } + return lhs; + } + + //! Element-wise in-place difference. + template + inline + vec3& + operator-=( + vec3& lhs, + vec3 const& rhs) + { + for(std::size_t i=0;i<3;i++) { + lhs[i] -= rhs[i]; + } + return lhs; + } + + //! Element-wise in-place difference. + template + inline + vec3& + operator-=( + vec3& lhs, + NumType const& rhs) + { + for(std::size_t i=0;i<3;i++) { + lhs[i] -= rhs ; + } + return lhs; + } + + //! Element-wise in-place multiplication. + template + inline + vec3& + operator*=( + vec3& lhs, + NumType const& rhs) + { + for(std::size_t i=0;i<3;i++) { + lhs[i] *= rhs ; + } + return lhs; + } + + //! Element-wise in-place division. + template + inline + vec3& + operator/=( + vec3& lhs, + NumType const& rhs) + { + for(std::size_t i=0;i<3;i++) { + lhs[i] /= rhs ; + } + return lhs; + } + + //! Element-wise in-place modulus operation. + template + inline + vec3& + operator%=( + vec3& lhs, + NumType const& rhs) + { + for(std::size_t i=0;i<3;i++) { + lhs[i] %= rhs ; + } + return lhs; + } + + //! Element-wise unary minus. + template + inline + vec3 + operator-( + vec3 const& v) + { + vec3 result; + for(std::size_t i=0;i<3;i++) { + result[i] = -v[i]; + } + return result; + } + + //! Element-wise unary plus. + template + inline + vec3 + operator+( + vec3 const& v) + { + vec3 result; + for(std::size_t i=0;i<3;i++) { + result[i] = +v[i]; + } + return result; + } + + //! Return the length of the vector. + template + inline + NumType + abs( + vec3 const& v) + { + return v.length(); + } + + template + vec3 + vec3::ortho(bool normalize) const + { + const NumType* e = this->elems; + NumType x = abs_(e[0]); + NumType y = abs_(e[1]); + NumType z = abs_(e[2]); + NumType u, v, w; + // Is z the smallest element? Then use x and y. + if (z <= x && z <= y) { + u = e[1]; v = -e[0]; w = 0; + if (normalize) { + NumType d = std::sqrt(x*x + y*y); + if (d != 0) { u /= d; v /= d; } + else { u = 0; v = 0; w = 1; } + } + } + // Is y smallest element? Then use x and z. + else if (y <= x && y <= z) { + u = -e[2]; v = 0; w = e[0]; + if (normalize) { + NumType d = std::sqrt(x*x + z*z); + if (d != 0) { u /= d; w /= d; } + else { u = 0; v = 0; w = 1; } + } + } + // x is smallest. + else { + u = 0; v = e[2]; w = -e[1]; + if (normalize) { + NumType d = std::sqrt(y*y + z*z); + if (d != 0) { v /= d; w /= d; } + else { u = 0; v = 0; w = 1; } + } + } + return vec3(u,v,w); + } + +} // namespace scitbx + +#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) + +namespace boost { + template + struct has_trivial_destructor > { + static const bool value = ::boost::has_trivial_destructor::value; + }; +} + +#endif + +#endif // SCITBX_VEC3_H diff --git a/extern/newmat/Makefile.in b/extern/newmat/Makefile.in new file mode 100644 index 00000000..23f623cb --- /dev/null +++ b/extern/newmat/Makefile.in @@ -0,0 +1,116 @@ +# +# makefile for newmat +# + +srcdir = . + +### Placeholder for Makefile fragment +##### +### + +# standard stuff + +OPT++DEFINES = $(OPTPP_DEFS) $(NEWMAT_DEFS) $(ARCH_DEFINES) + +OPT++INCLUDES = -I$(srcdir) $(OPTPP_INCL) $(ARCH_INCLUDES) + +LIB = $(NEWMAT_ARCHIVE) + +LIBOBJ = fft.o evalue.o submat.o cholesky.o hholder.o sort.o newmatrm.o \ + jacobi.o svd.o newmat8.o newmat7.o newmat6.o newmat5.o newmat3.o \ + newmat4.o newmat2.o newmat1.o bandmat.o myexcept.o newmatex.o \ + newfft.o nm_misc.o + +all: $(LIB) + +$(LIB): $(LIBOBJ) + $(RM) $(LIB) + $(AR) $(AR_FLAGS) $(LIB) $(LIBOBJ) + $(RANLIB) $(LIB) + +clean: + $(RM) *.o *.d *.ti *~ *.log *.dat *.out*, core + $(RM) -r SunWS_cache ii_files cxx_repository + +clobber: + $(RM) *.o *.d *.ti *~ *.log *.dat *.out*, core + $(RM) -r SunWS_cache ii_files cxx_repository + $(RM) $(PGM) $(LIB) + +distclean: + $(RM) *.o *.d *.ti *~ *.log *.dat *.out*, core + $(RM) -r SunWS_cache ii_files cxx_repository + $(RM) $(PGM) $(LIB) + $(RM) config.status Makefile Makefile-$(TARGET_NAME) + +newmatxx = $(srcdir)/include.h $(srcdir)/newmat.h $(srcdir)/myexcept.h + +myexcept.o: $(srcdir)/include.h $(srcdir)/myexcept.h $(srcdir)/myexcept.cpp + $(CXX) $(CXXFLAGS) $(OPT++DEFINES) $(OPT++INCLUDES) $(srcdir)/myexcept.cpp + +newmatex.o: $(newmatxx) $(srcdir)/newmatex.cpp + $(CXX) $(CXXFLAGS) $(OPT++DEFINES) $(OPT++INCLUDES) $(srcdir)/newmatex.cpp + +cholesky.o: $(newmatxx) $(srcdir)/cholesky.cpp + $(CXX) $(CXXFLAGS) $(OPT++DEFINES) $(OPT++INCLUDES) $(srcdir)/cholesky.cpp + +evalue.o: $(newmatxx) $(srcdir)/newmatrm.h $(srcdir)/precisio.h $(srcdir)/evalue.cpp + $(CXX) $(CXXFLAGS) $(OPT++DEFINES) $(OPT++INCLUDES) $(srcdir)/evalue.cpp + +fft.o: $(newmatxx) $(srcdir)/newmatap.h $(srcdir)/fft.cpp + $(CXX) $(CXXFLAGS) $(OPT++DEFINES) $(OPT++INCLUDES) $(srcdir)/fft.cpp + +newfft.o: $(newmatxx) $(srcdir)/newmatap.h $(srcdir)/newfft.cpp + $(CXX) $(CXXFLAGS) $(OPT++DEFINES) $(OPT++INCLUDES) $(srcdir)/newfft.cpp + +hholder.o: $(newmatxx) $(srcdir)/newmatap.h $(srcdir)/hholder.cpp + $(CXX) $(CXXFLAGS) $(OPT++DEFINES) $(OPT++INCLUDES) $(srcdir)/hholder.cpp + +jacobi.o: $(newmatxx) $(srcdir)/precisio.h $(srcdir)/newmatrm.h $(srcdir)/jacobi.cpp + $(CXX) $(CXXFLAGS) $(OPT++DEFINES) $(OPT++INCLUDES) $(srcdir)/jacobi.cpp + +bandmat.o: $(newmatxx) $(srcdir)/newmatrc.h $(srcdir)/controlw.h $(srcdir)/bandmat.cpp + $(CXX) $(CXXFLAGS) $(OPT++DEFINES) $(OPT++INCLUDES) $(srcdir)/bandmat.cpp + +newmat1.o: $(newmatxx) $(srcdir)/newmat1.cpp + $(CXX) $(CXXFLAGS) $(OPT++DEFINES) $(OPT++INCLUDES) $(srcdir)/newmat1.cpp + +newmat2.o: $(newmatxx) $(srcdir)/newmatrc.h $(srcdir)/controlw.h $(srcdir)/newmat2.cpp + $(CXX) $(CXXFLAGS) $(OPT++DEFINES) $(OPT++INCLUDES) $(srcdir)/newmat2.cpp + +newmat3.o: $(newmatxx) $(srcdir)/newmatrc.h $(srcdir)/controlw.h $(srcdir)/newmat3.cpp + $(CXX) $(CXXFLAGS) $(OPT++DEFINES) $(OPT++INCLUDES) $(srcdir)/newmat3.cpp + +newmat4.o: $(newmatxx) $(srcdir)/newmatrc.h $(srcdir)/controlw.h $(srcdir)/newmat4.cpp + $(CXX) $(CXXFLAGS) $(OPT++DEFINES) $(OPT++INCLUDES) $(srcdir)/newmat4.cpp + +newmat5.o: $(newmatxx) $(srcdir)/newmatrc.h $(srcdir)/controlw.h $(srcdir)/newmat5.cpp + $(CXX) $(CXXFLAGS) $(OPT++DEFINES) $(OPT++INCLUDES) $(srcdir)/newmat5.cpp + +newmat6.o: $(newmatxx) $(srcdir)/newmatrc.h $(srcdir)/controlw.h $(srcdir)/newmat6.cpp + $(CXX) $(CXXFLAGS) $(OPT++DEFINES) $(OPT++INCLUDES) $(srcdir)/newmat6.cpp + +newmat7.o: $(newmatxx) $(srcdir)/newmatrc.h $(srcdir)/controlw.h $(srcdir)/newmat7.cpp + $(CXX) $(CXXFLAGS) $(OPT++DEFINES) $(OPT++INCLUDES) $(srcdir)/newmat7.cpp + +newmat8.o: $(newmatxx) $(srcdir)/newmatap.h $(srcdir)/newmat8.cpp + $(CXX) $(CXXFLAGS) $(OPT++DEFINES) $(OPT++INCLUDES) $(srcdir)/newmat8.cpp + +newmat9.o: $(newmatxx) $(srcdir)/newmatrc.h $(srcdir)/controlw.h $(srcdir)/newmatio.h newmat9.cpp + $(CXX) $(CXXFLAGS) $(OPT++DEFINES) $(OPT++INCLUDES) $(srcdir)/newmat9.cpp + +newmatrm.o: $(newmatxx) $(srcdir)/newmatrm.h $(srcdir)/newmatrm.cpp + $(CXX) $(CXXFLAGS) $(OPT++DEFINES) $(OPT++INCLUDES) $(srcdir)/newmatrm.cpp + +nm_misc.o: $(newmatxx) $(srcdir)/newmatap.h $(srcdir)/nm_misc.cpp + $(CXX) $(CXXFLAGS) $(OPT++DEFINES) $(OPT++INCLUDES) $(srcdir)/nm_misc.cpp + +sort.o: $(newmatxx) $(srcdir)/newmatap.h $(srcdir)/sort.cpp + $(CXX) $(CXXFLAGS) $(OPT++DEFINES) $(OPT++INCLUDES) $(srcdir)/sort.cpp + +submat.o: $(newmatxx) $(srcdir)/newmatrc.h $(srcdir)/controlw.h $(srcdir)/submat.cpp + $(CXX) $(CXXFLAGS) $(OPT++DEFINES) $(OPT++INCLUDES) $(srcdir)/submat.cpp + +svd.o: $(newmatxx) $(srcdir)/newmatrm.h $(srcdir)/precisio.h $(srcdir)/svd.cpp + $(CXX) $(CXXFLAGS) $(OPT++DEFINES) $(OPT++INCLUDES) $(srcdir)/svd.cpp + diff --git a/extern/newmat/_newmat.dox b/extern/newmat/_newmat.dox new file mode 100644 index 00000000..9318ab11 --- /dev/null +++ b/extern/newmat/_newmat.dox @@ -0,0 +1,29 @@ +/// \ingroup newmat +///@{ + +/// \file _newmat.dox Introduction to Newmat. +/// +/// \page newmat Newmat matrix manipulation library. +///This package is intended for scientists and engineers who need to manipulate a variety of types of +///matrices using standard matrix operations. Emphasis is on the kind of operations needed in +///statistical calculations such as least squares, linear equation solve and eigenvalues. +/// +///It supports a variety of matrix types and the standard matrix operations. +///Currently, only one element type (float or double) is supported. +/// +///The package includes the operations Kronecker product, Schur (elementwise) product, concatenation, +///inverse, transpose, conversion between types, submatrix, determinant, Cholesky decomposition, +///QR decomposition, singular value decomposition, eigenvalues of a symmetric matrix, sorting, +///fast Fourier transform, fast trigonometric transforms, printing and an interface with +///Numerical Recipes in C. +/// +///It is intended for matrices in the range 10 x 10 to the maximum size your machine will +///accommodate in a single array. The package will work for very small matrices but becomes +///rather inefficient. + +///@} + + + + + diff --git a/extern/newmat/_rbd_com.dox b/extern/newmat/_rbd_com.dox new file mode 100644 index 00000000..4ddf9089 --- /dev/null +++ b/extern/newmat/_rbd_com.dox @@ -0,0 +1,26 @@ +/// \ingroup rbd_common +///@{ + +/// \file _rbd_com.dox Description of rbd_common. +/// +/// \page rbd_common RBD common library. +///These are classes and functions and define statements that used by many +///of my C++ libraries. +/// +///Currently these are in files "include.h", "myexcept.h", "myexcept.cpp". +/// +///The file "include.h" sets options appropriate +///for different compilers and user requirements. +/// +///The files "myexcept.h" and "myexcept.cpp" contain my exception classes and +///and the code for simulating exceptions with compilers that do not support +///exceptions. + + + +///@} + + + + + diff --git a/extern/newmat/add_time.png b/extern/newmat/add_time.png new file mode 100644 index 0000000000000000000000000000000000000000..58731d46dc17936892801c16cbf13aaaa3825d00 GIT binary patch literal 15259 zcmdtJcUV)~_ve2AL8U48Qbd}7g%*$^MXDg8R6!IW6lu~DdJln!0$w_T6zL+M^p?!4HE6FbV*;t5bgR$Q$jf0Dv0#FZRVzaU;-DZF!+bHaayZa2|s>n0m!uO%2?r zO3WW7yy`5|E)P-Za64ehT7U6l=(^HM9{`LD8f0XYa}QEIh|9Ki(uk)(5&OG_a|w@y z%46O#9N2tf4Nl=^&!E9qp7)q%1p*!A^eRQJP2MXHK_%uX!Wqh!XSmXp(9HX)%qZBr z;I>+MNPn-I_i`|Ee>pX3349i$ngW(HuBxJuud5hnCn%7l`pB3%%XVnX@M@bMGxW?; z`1fI48C3ozJ)r0yr}z5F&%TFo*-Qhf{VdEBPg3vt)p-VKLPR93=$*Tz`&hGf4M&k|P&e)KaN0Zt4ehc%M--7?E$H6M$<_amZSZ2NUrc0rcm>#}#_3$vm zA_hl3TBzG6Ap%@>R$WZY*NcqhBcD0#;-Y@6y(HS6`*=O!kL_9F&g2K~vHDIg(RTmc zys;f6?5H0UNjB`6`@UlK*UnnR&YH%y7b9ZheUS!j;DyeZ>(r>MH(gMmj?GZwC&CzLIa}9F=zO+Vggw`ym7UKwGrP&_b&J-u_S{a!P@g!v?Zy^cL z5n$Ql;Pj4tV?_r5DvsgAQB!ty0Qh1M4jBxw{7K%qalBV~JhNHtG()ALX9Kwra!|vA zl4NL`k%$grL>_{ng%i27gMteZ^JJ$ss)0c|V=cHSH?`-& zYEHMEb`&KlvCG8qKJ3||BIU+ifu^nBx3tNU6qUU%gt}wZo(M@uX`LVQAvC3_sls{u z=mop+`>I4N+l9Xa6^C>=SpF`+mBASMD35PO?w#}gpPytB3>vhD|58#c@X5x+ zh=lIjz%{c;3v}A*U?~010GDOfHt%$_WjCXD?7ae~REe>H+^X?q9?aX@lSlL~r5vr{ zgVq~$E`_>zWh-_+)dAi2bb*JyBf-;{JJG`+vA1`pJ%e=te$#k3;vOe-tF(t8an>*u9FmO+K(KJhw~ z{&{bjay=G(o2g=)vF(Sj0*^9+Z@RJfx;XkbqogqR6rwTm~U);6CDt#=x2l~mg+*;(-ND9urQNO}Zs;M^cRPfes zRx95lTI#3MTenx&2hzByZ*)VyaQzwsC@)=_?LdjmvQM>cOmO5p#FYm0N!|#ebuwc4 z`794O%a7%NGQC~Dm8wgqr!Pb>rNNc8PpDC}U{EUl`OlK68a?ja#w>6bE-*7J)%n$n z9p9ZG+ohI50ZBXfn!CoSBF*!Xzi(5rvBQq2gFB?t|jJ-k^ z>BA^cfr=$Q6e^DW<;8u}@3IiZdWG(uT&Oc9f6pkxYmvYg|4j@$kB=(t-2(qd;QX^9 z+bAo#vf$VfG`)wzGDvmt>i|;id)@W6`IUz^MVvqma#{ z^;+DM3uZ-`cbia3SaJLn|JAa2kEOjd;81(rX<2j8ycwvvi+j~_JsPPj8EPqz%}pux z2sPD8#P0F-k>WlAg>TofI^c{KXt(R3y8LhbpB3XqOC=#5CtqduYuXhRy+o}-J+%M< zbk3T=k|=j>l~K0Hfi|BANe|~dEPw)olzwz7bl@yP$Fj5luH1g|b3I*vU`R%I!&4>O z0_+!RR0OydRopd(C5bw3=#JOP(x`9`^q*cZwFBLlx{Kc$mnV!ddhw*@iI=Sn>fzsx zJ2f$JLDY%j@oRCXwhU`9Rs+y?!kD2LW1{$Kfz)DCsy zsUF3a_?>IoU_O{(@E=*BZ#%sZYVhAv!oHU6YruOwZmJic>jMt- zZ8P`?Kt(0|pBAWGocr1N9s)FjE(t*823Rj$248=-9lYcb4rh%%PXz!X;44s`1=0AM z zJ(!%wjMEweHRi&8P9v;YE|w7xvE*oaV5i#}b)K29DbC<@M6IGtnvk0+pNhm&rh$eG zZ5G<(`mEdLe&bG-8fZxRXN3AHW4giYNMol@tiTs8a1agi$De|O_$6YwEA~^_CiUrD zVNA@xP->uh%Jk*C6!z-#4b;I<;o{*^w*{?_3t5({3c3A^-z|SaJ2nO!s;f72)9vUy zb(X`6J4kVz*WG;d73OTOn>`gPJpb0NI6?#6qW%s5_ICV@Mg0(j6IU=p3=axT)JJrGy8(U8aB6ssEKw+I0pP zvA!uWvgJELUHi6zoqzYlj)o*pjni+k)r>MD>fP{nox-Z$o(oM452#pX{vfnOO3tAM zV&fgUmgGI&Y+l#SwDcS zkKmR&Xq|5!S+987F)QJ1b3 zOpvG4sFc%OA12K7zU<3){xPUlWztz!YUAF7A$+N7y`c?%ArgPUQXh+7@uX=dJ(XY( z!td7=qCKiDP{S`c(bP)4wD82SFT3qetVKFgFhvixHw(ufUA}M0_c?CG1S`%EDG)<_ znRWAtdsj$ssz6o#%L>jR0St>FR?1S-FisP$Gu+v-wD1v9z-g1%xt)lhg~;5834>M< zG1-@;_()s79D6@b6&uA&(2T^l=1)hPtfQsE<&WiJV-)gi<5g3a!#j*=iLOKKDjiZ# z$BFCFLo!onFnr(O3D(G)y6Gr<_pjUKiXDavJdW#FKhai_9}9Bysb2T|QB@kEQZ=*+BE+mVK;pav`~1bC?+(llDk_R9U+Mf}`CZ?_2+I&_+>z(|T* z2vQDIO5B_aVJ2SL`TlrFR!MVpb!is&LeYSgVBmgwC5`UhQ2L$d#~RjyVZv1j)uo2y zca(m;Q5c){pT>Jl1OCRo&TGACJ{i-6ScQ^g`hkP7IdSVSeHB_=wpk;XuMNf=rjjCG(0^LYw^Zww z4qEoAB$AzOxM=xtBN?v`2Ro!7wd)V}nCU|M^~em&uj^3Aa$@a%#~ zceWgKeljZ_+%`#k!&jxe+cvE=! z0pTbr^y1qQXA*KFUs)Nuy0qd}+`=vRL8Hgj zUM(y?)^xSEA?gkKT&dMS7sN#__PJK$_Hx&1rSgmT+cQb|9OYb{L+v6Zi+9EEamjJb zkJ*2_7rHsK*1VTtbIE6DNN*r1vBBY^SPl+AJO}@BUK|pWdI$wu}BO#XR!5Z9^YvmgP>&H zd!o5D$;@s&Y1OZtqhb|{c5R zs32ky@ksKE!$`uq{PEA@Pcd#D(oesZ4wX0gCT=-yWA?jd*oY#6G%mBrtHUwsqMApH%&Rl(+@+Va=ONw8})}^Dp6g z)L*^)J&cWuIn~vfKI9sY{W9K`*CuO&_@;&%5SL7&1x$iwrsA>3tyRQ&g&JJe^Aj-d#O znvPv+(W6Oaf3hOa{?e}J%3K5fYc0?q*5eh|F>}0EkW<7BYqCwxn}AuEMi|hIiCb|T zbhWWJiA6tN4&b4#R+PWvWF`_Wzg;FaP?S%s+>vzA`XH-rENZmn^-&-<@dY@tEQBu{ z-?Vw;9*JvHJ8&eJP=0r?$k2Bo*f~vx2-I-FlkiP2l9d#*WWP0XuVe>OEdYYNkN*hR1G;4|0DF0X$E^RKReZnw&hfEOEv=|iV8El|A9;U}H^*U_OXja9H9j65rKd)e=ufuI^FjWZ zGI(>{hfQ<+@XWFVlecAJF@2;7=K;fo4}{9SIoZ~9@ z4$9>eu1{L1(x0?QFfn2N?WS=MYGSdi(NM9~hmpF+%;<@eyVG3co>OUCD&bq9{2UJV zw~@709063em8@0OX*q@8%pEtrrv;~8`qhfH%IY7Yucu;Wl*J2Us($p^@JEIJ_UA_p zLJdg?X6n1}VHt&HOx%~N=YNgLKJzq(oMPA=&?kj4A7$>ZWUx#_^E6)b1w742oG6`f zTRUI=tJR;-8EsBNtkcDgN@JYcxt5@L1S5#o3A2rrv_mq358syV7HZ4aeT!IWyrM#- z{HU}6j|&qOef7oOb9?FM!y*~Go5C)LDJ4kBZhgAP_lmH^-jGSe7*`^mHFF8NT{As2 zwl{;PD;xVvb@A}l(`KVo52vSae-l`J)jUQ%U^mdY!q$+~%@af;GbrJQeFcxJCHlFW z9T)9!78@00`+&iIfDtdL<}X_&S^xF@blk$@_`~$m!={us~8*~!e>SZ02Jsq?4w*6QA8VAC=v{#Uc?`v^${&syP?U)M1E7=|K ztD~Fh0pd#J)XGGeul_STH2j}Gf^wulyWzYATL*9{-^Pt~dIHq2y2RXZ-pW=Seskc4 z*9HO@k^j+H{@!Y8`9#A7myk~sfHK`_%2@TDlN};(4%9>bMcn*nzxjK|`=6@k|Kb;i zV2pCS7@8e9_ZT7WTwYbucKzUIQ%I-Py8lxoeZT2ISIkGV74}*2mt`erp0LW@?zl1Z zwF*q*l8KlxG`u0*k=KqJdmmxuq{IlZgIBkEAE{Ks9L&bdN8-FI5Jao(G~o)YGNyn ziiFQt|HRK@btQ6h;=VFPh#4BAZ_Bk)*g8^0M(%cHNn??nAhLMn6?X*&%S6b?7-=jj z+<|F{tr%-stkf-zT3=@{h%w?;gcq9Q&`CQYxtU%>TScv9C$psOShN`{6mU=Gu~gc6 ziJ;?U1lAp|II%zhgExAA;U(3-_nbeCdSugM($0z+#Hnr@KW?HmzrqSMp<_Yu6UY|K z23(6-!50_uQN=#c|`<0HvL3e-{8@DkRo1J2n9 zc?m+b_{h1R!YVUoXLBqAI#QoW;;fIz8e^wXO}}qbiO^OLeV4)Y47ntoNV&Dq@g;r1 z*P8>luchTDWVf8c1eG1y?)o7$Xp&5mU@J$_rI$g85X87vOU1~4%2*ylyuwy9zeRM*;#u&9p&UkBgv~IfpLBD|tgnF2r zt?j)Z2k;|Op>bV0i#i;VW`6?QVvXf*ay~0N^+j}(c^vyNju&Oe>$5xhB57?s@;vK2 zV5*a$+8jD0Or^Wgf4Zl6KfRb2_xW@W)!;S1{Q$ZCny8#=>bSoR|MVAb`4_?Mzl1}b zgg6|1+mAW28>bPd^R5Fe(wnR(R#5QT(cmkDMFplgMlR_gyfl`- z;zNP?D-AsxLF8g9mtB$8OU0nw5sx?AZLEwU|#ndo1y^*4^0 z4E$tUH>c!py8aUD*@?VunkVl(fE%j1@^R)btYrgM+Uf1ksH>sI&k+Ol@( zl{iYE>o(ZSV6ewLmUW&(;clE}y_8uV!wy}X*IYo!uFHxnB%68;=O$u%LFwqYqTc>M z+;nKpf48PT_p!_PTXF-kM!=`u@8D^Xk42G;{)_aJCB~oCkx^ZJL+& za0U;$z}T7QVE%#>0CG4Az*q|jVxnmmeKM=~uPDx4&gj#rGk0-+yzqcMlkOXsnQ&7Yh?y}XuQyho1&ZU) zr{0cJBFFy>hX(ByWx)?$R>@ojkT28FxmD@a6_3iPFWyMZr10)wJPs!)Y~(jCk*rUn)~2~@)`*) zbKzY81^9(N?3uSBT{Aie!IG?T%-A)%p^wO6y8+{KI@|iM=)KQy{+sq+!PN}$9$pOz zz?XoEL_9Mz%VBFyHTqAA6GFoT%Fk^-wj>Uzx4 z6bxhM@!yAWKg8cxE=XrE-2tkEG;vMj>Q6~;$IX$t0|#F(Y}ups1!EdpDG^C zxy0{Bmv#$h00pPog+=rICqFywR{DZ|3H$#{Kx!~D=}k9%F}#G5Is%0U@ZYB!^g&Ky zty;VqFbataJ-bqUP1zZP^3485qv5iL29IlsZ1IlO<$~DAhil!a@)M;~>z&2ZHAJMLP};qf4mH-@^JK z)NxNQ7DLp_so(2vP@z`33B-!mcmt5Z%IaV>g0r1;PX}MOfjEJ{1l+RHMvC&Obv@gPaGCu;nU-w4ZntYRy&@4T4etD6K^?tJt69 zJ1U(OF}TFHgg5xLt$0Oe0jjwCZ^5N* zpAv}1CRc;N1~$BJ4;TC>#=Rq=qH!&TN-8&OFiI2LbeN4>$)99G;*&$Ot^xNI0GHV6 z)7=(dLhedx`pddux;Tn=3;w|WN@jEj($;`^BvlKPY3Z{rt>);LT z8`s+I8Nn(|dno~l_-Yjwb6q*_OTty2?cU4$XWyQ38D%;RdWx(*h@fPL^E~Vu2N=Zy z%FSr?KhgqAJsH*gmDD7>sl9UGa_E(>T(c4ItEw!(P3sQkcaIFtquEe@Dn?(Vx@?t4XXn?OMwyJT>C4kM$(6p+PO<@i3Va<80Cx24U*i)_3NU=b zwqSD5gtNX33b|pkF6`LM^-fQCdPC^2q!ohV1XG34=doL(N-dX+PF31o#AYsd?e8NW z#6YvhF&%#3yZsoh^xs{sSO4j#wXpAD9J;xSsLcx$Dg4k05oZDGTzqF5ctl?la=6?( z;c)qUQsqd~o448*@4&>YgqVR5-sik8b8_nR?pOr{Kn|A+4dgTZ70g5pB&`U1Y~{eK zANtBtYNS?aw&?H9LTIPbA&1%>3Eg{O%?auZU%CY%DIT}$@BwKWv^e@Kzf)PbMi69U zybrR0EJk+v!^aTxutO)}>4W5qv{xsK;-%bngL%SW2_(S>>rxsBlRn8~Q6WlNgjWi9>>&h~Cog0b#j?YRY6hxwZ|_91PMW z6_%2h^es#ldv5J#h{9V;lk#g3I*}(RSMVfXN<21GRweh0=HzG+ox_O?1v(-AX)9Df zx&#;dMG1PIT+Gw#DckP?uL>+F8$aFm#HsjQ^L1P+c zNRjp4%ndr%_EbhmJz#&k_L!$9Xj*OSl@;NpMzq7nMDt1#GmrFvE){o(w})k;W2US6 z*{O=69x*-H8v1VSJNAv<6Po4JC0=)CeDj~{980&^4RZbP;*B!+&hx1Nc?`_oNOdn7 zsR)bEnChYyx$CmN^dWsG#nCP$h{kO5R+Ht=71fL9<051#!nT~0drMC4O|qg}9d6D2 zo{vo`n-{7o%Y2SKKfYQemz&71t-kgQ^e(kRjf6^_huont?OXmdS+_JH8tmnbDf}Jh zAJ6MgTE0KF+y-1R-CrUMuwVfssuumB$0)E^-+orAn%mSn0|KqO$?+Y?P4p4Ov^XiA zUT0@(#&6ybtH})U7C08H0;-m`T8a&@?92q(0&NZN`3qoXSffl=oOL?uUdeH5cPksg zGCPt1Ot9%LH9BNNtl1+}v5o%S(6PEpkr{SsIv0u;M6yf68(1smR=@Rs9zeyPnRY_1 zEh*8$_t@9iOFnD=IZsp%5TX!~q)wrG!Bq}dRM61~?bi{dy^(MXa)3Rqwc#z7S-#>W z2!K2Tg@uR=zBA6A@~rY-{%YX*ihBz;8kfzNgEqaqZ8(op3?7YmQ>Lw^G%y!Mv`bEE zEIsV>F4F-vSG+7rM%;PZF(R4JkvS&V7s_~5@&+;0QYrn-xc_Gc`HR;C6EAp zM~|*#v?W-2=D^u$VbLdXg?3Fm#r;6`CekFi6iI?#tHayLT*iBQc-hpXJeU7)n_%Z+ z`3WO29Cx;G%)wy&P1IoE!MC?#HOt+xVfxS?8A)2;qHFh9u!={yPWF?I9!*zH=kvJC z%we!exnQ&cU*pjvNgqWORbXtNpO;g8V}eVD-*GyRdt1s;D~5Yuk1_v9p1f|}c7Zon zD137dS*_Q1zDQwsZfL%dm6q5UBcJ*7q2Q;mKddeKD=I5Vy=UT^Crhd$;ht6AS`Khx zE_bd>@jXxkODPIwR5)pevv7@1A^M!BVVX!J{&PHy7O{r_P~L~>B?uK7KtxXcxZGXG zlN*xy*Y(fe;Z+!Ml6-keIH$dT!t(tWmpp@@e#IAZqxko?-%p#BBegZI=4MD>vWHA^ zs(3(Z&qRpNy&0b7Xqo*gWbCCX-A-LT(KZqdcD{VZIu_R+UitXweI6w8R8A`ZKO>r>=Y*$}zeoM}i>KPNLbQrQBCwdoOk05s7LrIOm$QF=S<@9LapEJTbKX z-~oc-F-g|ZbT+zC?Hw|HU>s|DLbkZ4hV?qn=PvD@;mch8eit|Fpan!?aT3&oaAW)W83|;fHS1Uhv=M+ zU^I_nQYkG6%`;$-L$***oRbZ?<+)s=76ag{t+Bo_Oe% zC?&ZMyh>QY-z=NV-IJQPP{(aim`kw8ecXOuz*c^~1ny-2$=lzPyu$D?bjkT$M6434 z(X%PBlPNMfskGkl_%(fEBXK;r65M7R+i?sveLE?l@%PFaxg+%Kfi-(zQO}qUG|?xr z(jexF{*ze+!P6=aM5UTJ6?}_ETE*|c;yKl&9kI*N%!EtBic4mmzH`eTZew`&_2;M6 z$CZ{vFJD1yNt$R`^Q~h4t^nw@E06CU+skA*G71GlX+mi!4-c(!lOF*PQ|Pa5+|zBm z_bt|dt}`XP*D3EddZ}ys{YF#_udLN(sIy4>);V8nz5XMjl>q>=`h=+{K5bLT2?^CR zV!Q}0zA;Or>jwvKqIxJjJKw|2Pv`M++(zwQD7WRv!5|UVRo=^}-fe68Cg)KPx|(Et zD9XFm*Dy9dtD2@b;_e0}eKRxjsQDO1TvGb0sr>pgmX6BSQ@Mf%UvtVL-PoX~praOD#O+SRb}U z5Vw-&DL&k2cwlw*^5>?s89ry89E@ql9$HH1Yg2&GLVHfA<IUJf74m@IhY9OA@do(83hovL^9MlfP$NEeDjhTq9|l2&V{n3lrVr#c_X z&ETSCGiCaV(T#tJer-~ym*g4lA}mEtrEbCZDtMiA)UFo(X8V}Hrh#dyiidZcxo$Y8 z4w+J;g62u&KmCJKeDOoEk%N?pmaG0Qp%~1qb6hGD zaxgqT`y0o%xHWpPMTc?ao3B9*Tb=ZdqrCC!$25xz{H-+d?$>d(N=0~&8#X!UQ*3UT zQ*SGI#<~c^NZCSZgeL2fgrY0`Gxce^QZUO#yy7b~5V;I3Hb2Xr<>mkqUM}p{GbGO2 z(k68IU^N9)v2#h};XpMSz9~t~{`0a+yuR}a{>LCe!L|7BC62AK>$+5+VYpy7kB^XH z4&K8V(vm;DiAk70X{)ncV7}$%jl?lydAVvZ`7mqp9ZdCPi@6C6%~HDQ`e;FwmB$D6 zPV7~2JFfFw?Bh_R-+%->v(h_gRO07cKe4S;LeaTwmoKwjJ*Nw@-=r}05*`!Hjq)nd zTguajvp6j1qrR`{aJlu(dXhlB+Z*nm&#u33YL zUp<^0)bfyiF%mABK0bfNq&$$2t)c5#9n&GNnp|Z14FWyZId463=I|;T3_Pwi&z5vwTJ<#3B-Q_z6*timerrbrHEI;Hqv+7OO0D@*>iWab<(Z(2U28gu z?1$s`qOOofY}o0m27dKnfb;Cc`6Y4!pXtobq5yHX??Q1dL(1-gqP+w8UB(-c=PtW9 z82kiyPRBSkoqjI!n+XoGBGfScwTF+-eDwcxF9ee?vvhFARKm&9V!8r{(OVlL@I802 zxhQeMQ+M5z8GL&;r~GY?3wXGX8_z3+KZ#M~0h&j*gY|R2hUfsV*gJQviyT?8Ul4mQ zd1^wK2wya~Nf$%o^_1)Ov)xW@)&8krA2eAsWO8x%H*(*85YI6s%A}poi%4_01xjoY z8tH;99|y_<7*~mDZ%lhM-e;nXn-{qcw+B#Oy z$(ye@JvBthyd0$9$9#-Y;CxMLHDGX#u#d!je*0*5q4=9EIZfQ(X&%EMdQm;%A9il0 zAu94P{M;*-i33&E(R21KXH903?8b&k_vCL(u*B=xf*t<{vPyDtH6H%t(1?awRV6;! zIl=PP#Q6P!ZrU}$Q1B87th%Tdaz7ny+UUl4JW_8pH;q-OoI02^0d!^hrgHQj-FUw6 z1Dba()qrmIZ`wZ*IZeXaLm(?~iwvE0!jj$41i6|*mudeo>gI0dVCOZ%E@S+kNQ>Iw%vKdm%`FYN2znB;5-a>2p~pPInd}eH}}QKFgB8tpVLqF{&EE)Lh6H24HxCL zgCnx8b08BPTjbjtjqBK)N@Sq?&2ah5j8(n|{dvTgTVB#!c3x%5N7BbNae>%A{q zSLDhP+J-Y_?2i(y1w=1W-w?#W+-+Q|G>3=*%s%G!ou$?tuUIb?`b9#J4XYX2O;Rxf zkH^0xPMg!)x;qzBb=?oK!a6&hw#`4r9QeqvO-1Kv6tm*H>o|(3?b{5}h~4u>ehu65 zVQ}N|Q+o|kys)1N_6m&cBi3hB$`{ItKh}}zt68RUbQGSotIE?aIK7bG+ove&lRtD5 zbV=%2!>_L;+8Fw5tme%k>NaG_8mD8kMUB)M1HDQgtqL~G1bJA#51i@V9C)sLEszDj z>?k5qUzY1dS}31T5>FfAap_)+k@r88XH(1%)ZX@Y^UT^`qHT-%?X~Z{XxEj7Rmlat zM+frliI`uN1fS5k%DTny4m2z<5bCn{*_iIw@4?*X9f7MkIppA^&5c+CjL(>xCto)J6Tuph9UOYe7VE{aS_(Bzh<54HiDXuA4RMF zEb@wm@N$u#>@N(;{n1*u+id$$R5n;aIc8~ZYF*ipF}6MKmH#{XO1?D&J}ED6qI?7}*WTz&gu9ZNl9r>%-`pDcMTfa| znf~S^I;DI{yC)Z_T^dV==lnI0rU+B;tP^?4SU(L=&Lo-!NI?8YjV^pWNaLJV|e$z7&ygQk4#H|2Kzoz)Sxpk0qWQ zH5-vS5%S7OR+Cl^X5ay{4J2Jm`}9ul{)M#Kj5wa>^*G5^>+_aoPRfjS>+$^mGY;(> zK|FZoJn^}%r13pJ(PkH4pJB}NTyjiu)7o{+|Bf#`Uy&2Bb9NQ!KJP{Rs|dbci_^j- z^0`2Lq!=j`HxS~^iS~#bzhI^PfZqy%>dxGLiz05p1tbaH^-fdzi865VgPx_n9 z+nFJZ2MqR2#;z#Zz?1kfii#f)#zrd>iRQSg(PdtzdJzmTe_gpXV3BE;Rh1K%9@WGNVSsm1nSY?|!be_%pue~);TOU$4*6DD z7QoV=DFOsI@t&}M)d#8+UrZq2i;dK2F6Cz^DbWCqU2o8BeW z2{dwZh)(ae`B+95o|NI#XagP&^DYQU^Ak}cdKK@Cw4> X^{aJ|hA*vPi-3FTy0=SIp9KGZ$b8?+ literal 0 HcmV?d00001 diff --git a/extern/newmat/bandmat.cpp b/extern/newmat/bandmat.cpp new file mode 100644 index 00000000..8d91526d --- /dev/null +++ b/extern/newmat/bandmat.cpp @@ -0,0 +1,718 @@ +/// \ingroup newmat +///@{ + +/// \file bandmat.cpp +/// Band-matrix member functions. + + +// Copyright (C) 1991,2,3,4,9: R B Davies + +#define WANT_MATH // include.h will get math fns + +//#define WANT_STREAM + +#include "include.h" + +#include "newmat.h" +#include "newmatrc.h" + +#ifdef use_namespace +namespace NEWMAT { +#endif + + + +#ifdef DO_REPORT +#define REPORT { static ExeCounter ExeCount(__LINE__,10); ++ExeCount; } +#else +#define REPORT {} +#endif + +//static inline int my_min(int x, int y) { return x < y ? x : y; } +//static inline int my_max(int x, int y) { return x > y ? x : y; } + + +BandMatrix::BandMatrix(const BaseMatrix& M) +{ + REPORT // CheckConversion(M); + // MatrixConversionCheck mcc; + GeneralMatrix* gmx=((BaseMatrix&)M).Evaluate(MatrixType::BM); + GetMatrix(gmx); CornerClear(); +} + +void BandMatrix::SetParameters(const GeneralMatrix* gmx) +{ + REPORT + MatrixBandWidth bw = gmx->bandwidth(); + lower_val = bw.lower_val; upper_val = bw.upper_val; +} + +void BandMatrix::resize(int n, int lb, int ub) +{ + REPORT + Tracer tr("BandMatrix::resize"); + if (lb<0 || ub<0) Throw(ProgramException("Undefined bandwidth")); + lower_val = (lb<=n) ? lb : n-1; upper_val = (ub<=n) ? ub : n-1; + GeneralMatrix::resize(n,n,n*(lower_val+1+upper_val)); CornerClear(); +} + +// SimpleAddOK shows when we can add etc two matrices by a simple vector add +// and when we can add one matrix into another +// +// *gm must be the same type as *this +// - return 0 if simple add is OK +// - return 1 if we can add into *gm only +// - return 2 if we can add into *this only +// - return 3 if we can't add either way +// +// For SP this will still be valid if we swap 1 and 2 + +/// \brief can we add two band matrices with simple vector add +/// +/// For band matrices the bandwidths must agree + +short BandMatrix::SimpleAddOK(const GeneralMatrix* gm) +{ + const BandMatrix* bm = (const BandMatrix*)gm; + if (bm->lower_val == lower_val && bm->upper_val == upper_val) + { REPORT return 0; } + else if (bm->lower_val >= lower_val && bm->upper_val >= upper_val) + { REPORT return 1; } + else if (bm->lower_val <= lower_val && bm->upper_val <= upper_val) + { REPORT return 2; } + else { REPORT return 3; } +} + +/// \brief can we add two symmetric band matrices with simple vector add +/// +/// Sufficient to check lower bandwidths agree + +short SymmetricBandMatrix::SimpleAddOK(const GeneralMatrix* gm) +{ + const SymmetricBandMatrix* bm = (const SymmetricBandMatrix*)gm; + if (bm->lower_val == lower_val) { REPORT return 0; } + else if (bm->lower_val > lower_val) { REPORT return 1; } + else { REPORT return 2; } +} + +/// \brief resize UpperBandMatrix +void UpperBandMatrix::resize(int n, int lb, int ub) +{ + REPORT + if (lb != 0) + { + Tracer tr("UpperBandMatrix::resize"); + Throw(ProgramException("UpperBandMatrix with non-zero lower band" )); + } + BandMatrix::resize(n, lb, ub); +} + +/// \brief resize LowerBandMatrix +void LowerBandMatrix::resize(int n, int lb, int ub) +{ + REPORT + if (ub != 0) + { + Tracer tr("LowerBandMatrix::resize"); + Throw(ProgramException("LowerBandMatrix with non-zero upper band" )); + } + BandMatrix::resize(n, lb, ub); +} + +/// \brief resize BandMatrix +void BandMatrix::resize(const GeneralMatrix& A) +{ + REPORT + int n = A.Nrows(); + if (n != A.Ncols()) + { + Tracer tr("BandMatrix::resize(GM)"); + Throw(NotSquareException(*this)); + } + MatrixBandWidth mbw = A.bandwidth(); + resize(n, mbw.Lower(), mbw.Upper()); +} + +/* +bool BandMatrix::SameStorageType(const GeneralMatrix& A) const +{ + if (type() != A.type()) { REPORT return false; } + REPORT + return bandwidth() == A.bandwidth(); +} + +void BandMatrix::resizeForAdd(const GeneralMatrix& A, const GeneralMatrix& B) +{ + REPORT + Tracer tr("BandMatrix::resizeForAdd"); + MatrixBandWidth A_BW = A.bandwidth(); MatrixBandWidth B_BW = B.bandwidth(); + if ((A_BW.Lower() < 0) | (A_BW.Upper() < 0) | (B_BW.Lower() < 0) + | (A_BW.Upper() < 0)) + Throw(ProgramException("Can't resize to BandMatrix" )); + // already know A and B are square + resize(A.Nrows(), my_max(A_BW.Lower(), B_BW.Lower()), + my_max(A_BW.Upper(), B_BW.Upper())); +} + +void BandMatrix::resizeForSP(const GeneralMatrix& A, const GeneralMatrix& B) +{ + REPORT + Tracer tr("BandMatrix::resizeForSP"); + MatrixBandWidth A_BW = A.bandwidth(); MatrixBandWidth B_BW = B.bandwidth(); + if ((A_BW.Lower() < 0) | (A_BW.Upper() < 0) | (B_BW.Lower() < 0) + | (A_BW.Upper() < 0)) + Throw(ProgramException("Can't resize to BandMatrix" )); + // already know A and B are square + resize(A.Nrows(), my_min(A_BW.Lower(), B_BW.Lower()), + my_min(A_BW.Upper(), B_BW.Upper())); +} +*/ + +/// \brief assignment operator for BandMatrix +void BandMatrix::operator=(const BaseMatrix& X) +{ + REPORT // CheckConversion(X); + // MatrixConversionCheck mcc; + Eq(X,MatrixType::BM); CornerClear(); +} + +/// \brief set unused parts of BandMatrix to zero +void BandMatrix::CornerClear() const +{ + REPORT + int i = lower_val; Real* s = store; int bw = lower_val + 1 + upper_val; + while (i) + { int j = i--; Real* sj = s; s += bw; while (j--) *sj++ = 0.0; } + i = upper_val; s = store + storage; + while (i) + { int j = i--; Real* sj = s; s -= bw; while (j--) *(--sj) = 0.0; } +} + +MatrixBandWidth MatrixBandWidth::operator+(const MatrixBandWidth& bw) const +{ + REPORT + int l = bw.lower_val; int u = bw.upper_val; + l = (lower_val < 0 || l < 0) ? -1 : (lower_val > l) ? lower_val : l; + u = (upper_val < 0 || u < 0) ? -1 : (upper_val > u) ? upper_val : u; + return MatrixBandWidth(l,u); +} + +MatrixBandWidth MatrixBandWidth::operator*(const MatrixBandWidth& bw) const +{ + REPORT + int l = bw.lower_val; int u = bw.upper_val; + l = (lower_val < 0 || l < 0) ? -1 : lower_val+l; + u = (upper_val < 0 || u < 0) ? -1 : upper_val+u; + return MatrixBandWidth(l,u); +} + +MatrixBandWidth MatrixBandWidth::minimum(const MatrixBandWidth& bw) const +{ + REPORT + int l = bw.lower_val; int u = bw.upper_val; + if ((lower_val >= 0) && ( (l < 0) || (l > lower_val) )) l = lower_val; + if ((upper_val >= 0) && ( (u < 0) || (u > upper_val) )) u = upper_val; + return MatrixBandWidth(l,u); +} + +UpperBandMatrix::UpperBandMatrix(const BaseMatrix& M) +{ + REPORT // CheckConversion(M); + // MatrixConversionCheck mcc; + GeneralMatrix* gmx=((BaseMatrix&)M).Evaluate(MatrixType::UB); + GetMatrix(gmx); CornerClear(); +} + +void UpperBandMatrix::operator=(const BaseMatrix& X) +{ + REPORT // CheckConversion(X); + // MatrixConversionCheck mcc; + Eq(X,MatrixType::UB); CornerClear(); +} + +LowerBandMatrix::LowerBandMatrix(const BaseMatrix& M) +{ + REPORT // CheckConversion(M); + // MatrixConversionCheck mcc; + GeneralMatrix* gmx=((BaseMatrix&)M).Evaluate(MatrixType::LB); + GetMatrix(gmx); CornerClear(); +} + +void LowerBandMatrix::operator=(const BaseMatrix& X) +{ + REPORT // CheckConversion(X); + // MatrixConversionCheck mcc; + Eq(X,MatrixType::LB); CornerClear(); +} + +BandLUMatrix::BandLUMatrix(const BaseMatrix& m) +{ + REPORT + Tracer tr("BandLUMatrix"); + storage2 = 0; store2 = 0; indx = 0; // in event of exception during build + GeneralMatrix* gm = ((BaseMatrix&)m).Evaluate(); + if (gm->nrows() != gm->ncols()) + { gm->tDelete(); Throw(NotSquareException(*this)); } + if (gm->type() == MatrixType::BC) + { REPORT ((BandLUMatrix*)gm)->get_aux(*this); GetMatrix(gm); } + else + { + REPORT + BandMatrix* gm1 = (BandMatrix*)(gm->Evaluate(MatrixType::BM)); + m1 = gm1->lower_val; m2 = gm1->upper_val; + GetMatrix(gm1); + d = true; sing = false; + indx = new int [nrows_val]; MatrixErrorNoSpace(indx); + MONITOR_INT_NEW("Index (BndLUMat)",nrows_val,indx) + storage2 = nrows_val * m1; + store2 = new Real [storage2]; MatrixErrorNoSpace(store2); + MONITOR_REAL_NEW("Make (BandLUMat)",storage2,store2) + ludcmp(); + } +} + +GeneralMatrix* BandLUMatrix::Evaluate(MatrixType mt) +{ + if (Compare(this->Type(),mt)) { REPORT return this; } + REPORT + Tracer et("BandLUMatrix::Evaluate"); + bool dummy = true; + if (dummy) Throw(ProgramException("Illegal use of BandLUMatrix", *this)); + return this; +} + +// could we use SetParameters instead of this +void BandLUMatrix::get_aux(BandLUMatrix& X) +{ + X.d = d; X.sing = sing; X.storage2 = storage2; X.m1 = m1; X.m2 = m2; + if (tag_val == 0 || tag_val == 1) // reuse the array + { + REPORT + X.indx = indx; indx = 0; + X.store2 = store2; store2 = 0; + d = true; sing = true; storage2 = 0; m1 = 0; m2 = 0; + return; + } + else if (nrows_val == 0) + { + REPORT + indx = 0; store2 = 0; storage2 = 0; + d = true; sing = true; m1 = m2 = 0; + return; + } + else // copy the array + { + REPORT + Tracer tr("BandLUMatrix::get_aux"); + int *ix = new int [nrows_val]; MatrixErrorNoSpace(ix); + MONITOR_INT_NEW("Index (BLUM::get_aux)", nrows_val, ix) + int n = nrows_val; int* i = ix; int* j = indx; + while(n--) *i++ = *j++; + X.indx = ix; + Real *rx = new Real [storage2]; MatrixErrorNoSpace(indx); + MONITOR_REAL_NEW("Index (BLUM::get_aux)", storage2, rx) + newmat_block_copy(storage2, store2, rx); + X.store2 = rx; + } +} + +BandLUMatrix::BandLUMatrix(const BandLUMatrix& gm) : GeneralMatrix() +{ + REPORT + Tracer tr("BandLUMatrix(const BandLUMatrix&)"); + ((BandLUMatrix&)gm).get_aux(*this); + GetMatrix(&gm); +} + +void BandLUMatrix::operator=(const BandLUMatrix& gm) +{ + if (&gm == this) { REPORT tag_val = -1; return; } + REPORT + delete [] indx; indx = 0; + delete [] store2; store2 = 0; storage2 = 0; + ((BandLUMatrix&)gm).get_aux(*this); + Eq(gm); +} + + + + + + + + +BandLUMatrix::~BandLUMatrix() +{ + REPORT + MONITOR_INT_DELETE("Index (BndLUMat)",nrows_val,indx) + MONITOR_REAL_DELETE("Delete (BndLUMt)",storage2,store2) + delete [] indx; delete [] store2; +} + +MatrixType BandLUMatrix::type() const { REPORT return MatrixType::BC; } + + +LogAndSign BandLUMatrix::log_determinant() const +{ + REPORT + if (sing) return 0.0; + Real* a = store; int w = m1+1+m2; LogAndSign sum; int i = nrows_val; + // while (i--) { sum *= *a; a += w; } + if (i) for (;;) { sum *= *a; if (!(--i)) break; a += w; } + if (!d) sum.ChangeSign(); + return sum; +} + +GeneralMatrix* BandMatrix::MakeSolver() +{ + REPORT + GeneralMatrix* gm = new BandLUMatrix(*this); + MatrixErrorNoSpace(gm); gm->ReleaseAndDelete(); return gm; +} + + +void BandLUMatrix::ludcmp() +{ + REPORT + Real* a = store2; int i = storage2; + // clear store2 - so unused locations are always zero - + // required by operator== + while (i--) *a++ = 0.0; + a = store; + i = m1; int j = m2; int k; int n = nrows_val; int w = m1 + 1 + m2; + while (i) + { + Real* ai = a + i; + k = ++j; while (k--) *a++ = *ai++; + k = i--; while (k--) *a++ = 0.0; + } + + a = store; int l = m1; + for (k=0; k=mini; i--) + { + Real* b = B + i; Real* bk = b; Real x = *bk; + Real* a = store + w*i; Real y = *a; + int k = l+m1; while (k--) x -= *(++a) * *(++bk); + *b = x / y; + if (l < m2) l++; + } +} + +void BandLUMatrix::Solver(MatrixColX& mcout, const MatrixColX& mcin) +{ + REPORT + int i = mcin.skip; Real* el = mcin.data-i; Real* el1=el; + while (i--) *el++ = 0.0; + el += mcin.storage; i = nrows_val - mcin.skip - mcin.storage; + while (i--) *el++ = 0.0; + lubksb(el1, mcout.skip); +} + +// Do we need check for entirely zero output? + + +void UpperBandMatrix::Solver(MatrixColX& mcout, + const MatrixColX& mcin) +{ + REPORT + int i = mcin.skip-mcout.skip; Real* elx = mcin.data-i; + while (i-- > 0) *elx++ = 0.0; + int nr = mcin.skip+mcin.storage; + elx = mcin.data+mcin.storage; Real* el = elx; + int j = mcout.skip+mcout.storage-nr; i = nr-mcout.skip; + while (j-- > 0) *elx++ = 0.0; + + Real* Ael = store + (upper_val+1)*(i-1)+1; j = 0; + if (i > 0) for(;;) + { + elx = el; Real sum = 0.0; int jx = j; + while (jx--) sum += *(--Ael) * *(--elx); + elx--; *elx = (*elx - sum) / *(--Ael); + if (--i <= 0) break; + if (j 0) *elx++ = 0.0; + int nc = mcin.skip; i = nc+mcin.storage; elx = mcin.data+mcin.storage; + int nr = mcout.skip+mcout.storage; int j = nr-i; i = nr-nc; + while (j-- > 0) *elx++ = 0.0; + + Real* el = mcin.data; + Real* Ael = store + (lower_val+1)*nc + lower_val; + j = 0; + if (i > 0) for(;;) + { + elx = el; Real sum = 0.0; int jx = j; + while (jx--) sum += *Ael++ * *elx++; + *elx = (*elx - sum) / *Ael++; + if (--i <= 0) break; + if (jReleaseAndDelete(); return gm; +} + +SymmetricBandMatrix::SymmetricBandMatrix(const BaseMatrix& M) +{ + REPORT // CheckConversion(M); + // MatrixConversionCheck mcc; + GeneralMatrix* gmx=((BaseMatrix&)M).Evaluate(MatrixType::SB); + GetMatrix(gmx); +} + +GeneralMatrix* SymmetricBandMatrix::Transpose(TransposedMatrix*, MatrixType mt) +{ REPORT return Evaluate(mt); } + +LogAndSign SymmetricBandMatrix::log_determinant() const +{ + REPORT + BandLUMatrix C(*this); return C.log_determinant(); +} + +void SymmetricBandMatrix::SetParameters(const GeneralMatrix* gmx) +{ REPORT lower_val = gmx->bandwidth().lower_val; } + +void SymmetricBandMatrix::resize(int n, int lb) +{ + REPORT + Tracer tr("SymmetricBandMatrix::resize"); + if (lb<0) Throw(ProgramException("Undefined bandwidth")); + lower_val = (lb<=n) ? lb : n-1; + GeneralMatrix::resize(n,n,n*(lower_val+1)); +} + +void SymmetricBandMatrix::resize(const GeneralMatrix& A) +{ + REPORT + int n = A.Nrows(); + if (n != A.Ncols()) + { + Tracer tr("SymmetricBandMatrix::resize(GM)"); + Throw(NotSquareException(*this)); + } + MatrixBandWidth mbw = A.bandwidth(); int b = mbw.Lower(); + if (b != mbw.Upper()) + { + Tracer tr("SymmetricBandMatrix::resize(GM)"); + Throw(ProgramException("Upper and lower band-widths not equal")); + } + resize(n, b); +} +/* +bool SymmetricBandMatrix::SameStorageType(const GeneralMatrix& A) const +{ + if (type() != A.type()) { REPORT return false; } + REPORT + return bandwidth() == A.bandwidth(); +} + +void SymmetricBandMatrix::resizeForAdd(const GeneralMatrix& A, + const GeneralMatrix& B) +{ + REPORT + Tracer tr("SymmetricBandMatrix::resizeForAdd"); + MatrixBandWidth A_BW = A.bandwidth(); MatrixBandWidth B_BW = B.bandwidth(); + if ((A_BW.Lower() < 0) | (B_BW.Lower() < 0)) + Throw(ProgramException("Can't resize to SymmetricBandMatrix" )); + // already know A and B are square + resize(A.Nrows(), my_max(A_BW.Lower(), B_BW.Lower())); +} + +void SymmetricBandMatrix::resizeForSP(const GeneralMatrix& A, + const GeneralMatrix& B) +{ + REPORT + Tracer tr("SymmetricBandMatrix::resizeForSP"); + MatrixBandWidth A_BW = A.bandwidth(); MatrixBandWidth B_BW = B.bandwidth(); + if ((A_BW.Lower() < 0) | (B_BW.Lower() < 0)) + Throw(ProgramException("Can't resize to SymmetricBandMatrix" )); + // already know A and B are square + resize(A.Nrows(), my_min(A_BW.Lower(), B_BW.Lower())); +} +*/ + +void SymmetricBandMatrix::operator=(const BaseMatrix& X) +{ + REPORT // CheckConversion(X); + // MatrixConversionCheck mcc; + Eq(X,MatrixType::SB); +} + +void SymmetricBandMatrix::CornerClear() const +{ + // set unused parts of BandMatrix to zero + REPORT + int i = lower_val; Real* s = store; int bw = lower_val + 1; + if (i) for(;;) + { + int j = i; + Real* sj = s; + while (j--) *sj++ = 0.0; + if (!(--i)) break; + s += bw; + } +} + +MatrixBandWidth SymmetricBandMatrix::bandwidth() const + { REPORT return MatrixBandWidth(lower_val,lower_val); } + +GeneralMatrix* BandMatrix::Image() const +{ + REPORT + GeneralMatrix* gm = new BandMatrix(*this); MatrixErrorNoSpace(gm); + return gm; +} + +GeneralMatrix* UpperBandMatrix::Image() const +{ + REPORT + GeneralMatrix* gm = new UpperBandMatrix(*this); MatrixErrorNoSpace(gm); + return gm; +} + +GeneralMatrix* LowerBandMatrix::Image() const +{ + REPORT + GeneralMatrix* gm = new LowerBandMatrix(*this); MatrixErrorNoSpace(gm); + return gm; +} + +GeneralMatrix* SymmetricBandMatrix::Image() const +{ + REPORT + GeneralMatrix* gm = new SymmetricBandMatrix(*this); MatrixErrorNoSpace(gm); + return gm; +} + +GeneralMatrix* BandLUMatrix::Image() const +{ + REPORT + GeneralMatrix* gm = new BandLUMatrix(*this); MatrixErrorNoSpace(gm); + return gm; +} + + +inline Real square(Real x) { return x*x; } + +Real SymmetricBandMatrix::sum_square() const +{ + REPORT + CornerClear(); + Real sum1=0.0; Real sum2=0.0; Real* s=store; int i=nrows_val; + int l=lower_val; + while (i--) + { int j = l; while (j--) sum2 += square(*s++); sum1 += square(*s++); } + ((GeneralMatrix&)*this).tDelete(); return sum1 + 2.0 * sum2; +} + +Real SymmetricBandMatrix::sum_absolute_value() const +{ + REPORT + CornerClear(); + Real sum1=0.0; Real sum2=0.0; Real* s=store; int i=nrows_val; + int l=lower_val; + while (i--) + { int j = l; while (j--) sum2 += fabs(*s++); sum1 += fabs(*s++); } + ((GeneralMatrix&)*this).tDelete(); return sum1 + 2.0 * sum2; +} + +Real SymmetricBandMatrix::sum() const +{ + REPORT + CornerClear(); + Real sum1=0.0; Real sum2=0.0; Real* s=store; int i=nrows_val; + int l=lower_val; + while (i--) + { int j = l; while (j--) sum2 += *s++; sum1 += *s++; } + ((GeneralMatrix&)*this).tDelete(); return sum1 + 2.0 * sum2; +} + + + + + +#ifdef use_namespace +} +#endif + +///@} + + diff --git a/extern/newmat/cholesky.cpp b/extern/newmat/cholesky.cpp new file mode 100644 index 00000000..e0df0fa6 --- /dev/null +++ b/extern/newmat/cholesky.cpp @@ -0,0 +1,289 @@ +/// \ingroup newmat +///@{ + +/// \file cholesky.cpp +/// Cholesky decomposition. +/// Cholesky decomposition of symmetric and band symmetric matrices, +/// update, downdate, manipulate a Cholesky decomposition + + +// Copyright (C) 1991,2,3,4: R B Davies + +#define WANT_MATH +//#define WANT_STREAM + +#include "include.h" + +#include "newmat.h" +#include "newmatrm.h" + +#ifdef use_namespace +namespace NEWMAT { +#endif + +#ifdef DO_REPORT +#define REPORT { static ExeCounter ExeCount(__LINE__,14); ++ExeCount; } +#else +#define REPORT {} +#endif + +/********* Cholesky decomposition of a positive definite matrix *************/ + +// Suppose S is symmetrix and positive definite. Then there exists a unique +// lower triangular matrix L such that L L.t() = S; + + +ReturnMatrix Cholesky(const SymmetricMatrix& S) +{ + REPORT + Tracer trace("Cholesky"); + int nr = S.Nrows(); + LowerTriangularMatrix T(nr); + Real* s = S.Store(); Real* t = T.Store(); Real* ti = t; + for (int i=0; i= 1.0) + Throw(ProgramException("downdate_Cholesky() fails", chol)); + + Real alpha = sqrt(1.0 - squareNormA); + + // compute and apply Givens rotations to the vector a + ColumnVector cGivens(nRC); cGivens = 0.0; + ColumnVector sGivens(nRC); sGivens = 0.0; + for(i = nRC; i >= 1; i--) + alpha = pythag(alpha, a(i), cGivens(i), sGivens(i)); + + // apply Givens rotations to the jth column of chol + ColumnVector xtilde(nRC); xtilde = 0.0; + for(j = nRC; j >= 1; j--) + { + // only the first j rotations have an affect on chol,0 + for(int k = j; k >= 1; k--) + GivensRotation(cGivens(k), -sGivens(k), chol(k,j), xtilde(j)); + } +} + + + +// produces the Cholesky decomposition of EAE where A = chol.t() * chol +// and E produces a RIGHT circular shift of the rows and columns from +// 1,...,k-1,k,k+1,...l,l+1,...,p to +// 1,...,k-1,l,k,k+1,...l-1,l+1,...p +void right_circular_update_Cholesky(UpperTriangularMatrix &chol, int k, int l) +{ + int nRC = chol.Nrows(); + int i, j; + + // I. compute shift of column l to the kth position + Matrix cholCopy = chol; + // a. grab column l + ColumnVector columnL = cholCopy.Column(l); + // b. shift columns k,...l-1 to the RIGHT + for(j = l-1; j >= k; --j) + cholCopy.Column(j+1) = cholCopy.Column(j); + // c. copy the top k-1 elements of columnL into the kth column of cholCopy + cholCopy.Column(k) = 0.0; + for(i = 1; i < k; ++i) cholCopy(i,k) = columnL(i); + + // II. determine the l-k Given's rotations + int nGivens = l-k; + ColumnVector cGivens(nGivens); cGivens = 0.0; + ColumnVector sGivens(nGivens); sGivens = 0.0; + for(i = l; i > k; i--) + { + int givensIndex = l-i+1; + columnL(i-1) = pythag(columnL(i-1), columnL(i), + cGivens(givensIndex), sGivens(givensIndex)); + columnL(i) = 0.0; + } + // the kth entry of columnL is the new diagonal element in column k of cholCopy + cholCopy(k,k) = columnL(k); + + // III. apply these Given's rotations to subsequent columns + // for columns k+1,...,l-1 we only need to apply the last nGivens-(j-k) rotations + for(j = k+1; j <= nRC; ++j) + { + ColumnVector columnJ = cholCopy.Column(j); + int imin = nGivens - (j-k) + 1; if (imin < 1) imin = 1; + for(int gIndex = imin; gIndex <= nGivens; ++gIndex) + { + // apply gIndex Given's rotation + int topRowIndex = k + nGivens - gIndex; + GivensRotationR(cGivens(gIndex), sGivens(gIndex), + columnJ(topRowIndex), columnJ(topRowIndex+1)); + } + cholCopy.Column(j) = columnJ; + } + + chol << cholCopy; +} + + + +// produces the Cholesky decomposition of EAE where A = chol.t() * chol +// and E produces a LEFT circular shift of the rows and columns from +// 1,...,k-1,k,k+1,...l,l+1,...,p to +// 1,...,k-1,k+1,...l,k,l+1,...,p to +void left_circular_update_Cholesky(UpperTriangularMatrix &chol, int k, int l) +{ + int nRC = chol.Nrows(); + int i, j; + + // I. compute shift of column k to the lth position + Matrix cholCopy = chol; + // a. grab column k + ColumnVector columnK = cholCopy.Column(k); + // b. shift columns k+1,...l to the LEFT + for(j = k+1; j <= l; ++j) + cholCopy.Column(j-1) = cholCopy.Column(j); + // c. copy the elements of columnK into the lth column of cholCopy + cholCopy.Column(l) = 0.0; + for(i = 1; i <= k; ++i) + cholCopy(i,l) = columnK(i); + + // II. apply and compute Given's rotations + int nGivens = l-k; + ColumnVector cGivens(nGivens); cGivens = 0.0; + ColumnVector sGivens(nGivens); sGivens = 0.0; + for(j = k; j <= nRC; ++j) + { + ColumnVector columnJ = cholCopy.Column(j); + + // apply the previous Givens rotations to columnJ + int imax = j - k; if (imax > nGivens) imax = nGivens; + for(int i = 1; i <= imax; ++i) + { + int gIndex = i; + int topRowIndex = k + i - 1; + GivensRotationR(cGivens(gIndex), sGivens(gIndex), + columnJ(topRowIndex), columnJ(topRowIndex+1)); + } + + // compute a new Given's rotation when j < l + if(j < l) + { + int gIndex = j-k+1; + columnJ(j) = pythag(columnJ(j), columnJ(j+1), cGivens(gIndex), + sGivens(gIndex)); + columnJ(j+1) = 0.0; + } + + cholCopy.Column(j) = columnJ; + } + + chol << cholCopy; + +} + + + + +#ifdef use_namespace +} +#endif + +///@} diff --git a/extern/newmat/controlw.h b/extern/newmat/controlw.h new file mode 100644 index 00000000..416bd659 --- /dev/null +++ b/extern/newmat/controlw.h @@ -0,0 +1,56 @@ +/// \ingroup newmat +///@{ + +/// \file controlw.h +/// Control word class. +/// Manipulate bits used for setting options. + + +#ifndef CONTROL_WORD_LIB +#define CONTROL_WORD_LIB 0 + +/// Organise an int as a series of bits to set options. +/// \internal +class ControlWord +{ +protected: + int cw; // the control word +public: + ControlWord() : cw(0) {} // do nothing + ControlWord(int i) : cw(i) {} // load an integer + + // select specific bits (for testing at least one set) + ControlWord operator*(ControlWord i) const + { return ControlWord(cw & i.cw); } + void operator*=(ControlWord i) { cw &= i.cw; } + + // set bits + ControlWord operator+(ControlWord i) const + { return ControlWord(cw | i.cw); } + void operator+=(ControlWord i) { cw |= i.cw; } + + // reset bits + ControlWord operator-(ControlWord i) const + { return ControlWord(cw - (cw & i.cw)); } + void operator-=(ControlWord i) { cw -= (cw & i.cw); } + + // check if all of selected bits set or reset + bool operator>=(ControlWord i) const { return (cw & i.cw) == i.cw; } + bool operator<=(ControlWord i) const { return (cw & i.cw) == cw; } + + // flip selected bits + ControlWord operator^(ControlWord i) const + { return ControlWord(cw ^ i.cw); } + ControlWord operator~() const { return ControlWord(~cw); } + + // convert to integer + int operator+() const { return cw; } + int operator!() const { return cw==0; } + FREE_CHECK(ControlWord) +}; + + +#endif + +///@} + diff --git a/extern/newmat/evalue.cpp b/extern/newmat/evalue.cpp new file mode 100644 index 00000000..f3c7e34b --- /dev/null +++ b/extern/newmat/evalue.cpp @@ -0,0 +1,303 @@ +/// \ingroup newmat +///@{ + +/// \file evalue.cpp +/// Eigen-value decomposition (Householder method). + +// Copyright (C) 1991,2,3,4: R B Davies + +#define WANT_MATH + +#include "include.h" +#include "newmatap.h" +#include "newmatrm.h" +#include "precisio.h" + +#ifdef use_namespace +namespace NEWMAT { +#endif + +#ifdef DO_REPORT +#define REPORT { static ExeCounter ExeCount(__LINE__,17); ++ExeCount; } +#else +#define REPORT {} +#endif + + + +static void tred2(const SymmetricMatrix& A, DiagonalMatrix& D, + DiagonalMatrix& E, Matrix& Z) +{ + Tracer et("Evalue(tred2)"); + REPORT + Real tol = + FloatingPointPrecision::Minimum()/FloatingPointPrecision::Epsilon(); + int n = A.Nrows(); Z.resize(n,n); Z.Inject(A); + D.resize(n); E.resize(n); + Real* z = Z.Store(); int i; + + for (i=n-1; i > 0; i--) // i=0 is excluded + { + Real f = Z.element(i,i-1); Real g = 0.0; + int k = i-1; Real* zik = z + i*n; + while (k--) g += square(*zik++); + Real h = g + square(f); + if (g <= tol) { REPORT E.element(i) = f; h = 0.0; } + else + { + REPORT + g = sign(-sqrt(h), f); E.element(i) = g; h -= f*g; + Z.element(i,i-1) = f-g; f = 0.0; + Real* zji = z + i; Real* zij = z + i*n; Real* ej = E.Store(); + int j; + for (j=0; j=l; i--) + { + Real ei = E.element(i); Real di = D.element(i); + Real& ei1 = E.element(i+1); + g = c * ei; h = c * p; + if ( fabs(p) >= fabs(ei)) + { + REPORT + c = ei / p; r = sqrt(c*c + 1.0); + ei1 = s*p*r; s = c/r; c = 1.0/r; + } + else + { + REPORT + c = p / ei; r = sqrt(c*c + 1.0); + ei1 = s * ei * r; s = 1.0/r; c /= r; + } + p = c * di - s*g; D.element(i+1) = h + s * (c*g + s*di); + + Real* zki = z + i; Real* zki1 = zki + 1; int k = n; + if (k) for (;;) + { + REPORT + h = *zki1; *zki1 = s*(*zki) + c*h; *zki = c*(*zki) - s*h; + if (!(--k)) break; + zki += n; zki1 += n; + } + } + el = s*p; dl = c*p; + if (fabs(el) <= b) { REPORT; test = true; break; } + } + if (!test) Throw ( ConvergenceException(D) ); + dl += f; + } +/* + for (int i=0; i= 0; i--) + { + Real h = 0.0; Real f = - FloatingPointPrecision::Maximum(); + Real* d = D.Store(); Real* a = A.Store() + (i*(i+1))/2; int k = i; + while (k--) { f = *a++; *d++ = f; h += square(f); } + if (h <= tol) { REPORT *(--ei) = 0.0; h = 0.0; } + else + { + REPORT + Real g = sign(-sqrt(h), f); *(--ei) = g; h -= f*g; + f -= g; *(d-1) = f; *(a-1) = f; f = 0.0; + Real* dj = D.Store(); Real* ej = E.Store(); int j; + for (j = 0; j < i; j++) + { + Real* dk = D.Store(); Real* ak = A.Store()+(j*(j+1))/2; + Real g = 0.0; k = j; + while (k--) g += *ak++ * *dk++; + k = i-j; int l = j; + if (k) for (;;) { g += *ak * *dk++; if (!(--k)) break; ak += ++l; } + g /= h; *ej++ = g; f += g * *dj++; + } + Real hh = f / (2 * h); Real* ak = A.Store(); + dj = D.Store(); ej = E.Store(); + for (j = 0; j < i; j++) + { + f = *dj++; g = *ej - hh * f; *ej++ = g; + Real* dk = D.Store(); Real* ek = E.Store(); k = j+1; + while (k--) { *ak++ -= (f * *ek++ + g * *dk++); } + } + } + *d = *a; *a = h; + } +} + +static void tql1(DiagonalMatrix& D, DiagonalMatrix& E) +{ + Tracer et("Evalue(tql1)"); + REPORT + Real eps = FloatingPointPrecision::Epsilon(); + int n = D.Nrows(); int l; + for (l=1; l=l; i--) + { + Real ei = E.element(i); Real di = D.element(i); + Real& ei1 = E.element(i+1); + g = c * ei; h = c * p; + if ( fabs(p) >= fabs(ei)) + { + REPORT + c = ei / p; r = sqrt(c*c + 1.0); + ei1 = s*p*r; s = c/r; c = 1.0/r; + } + else + { + REPORT + c = p / ei; r = sqrt(c*c + 1.0); + ei1 = s * ei * r; s = 1.0/r; c /= r; + } + p = c * di - s*g; D.element(i+1) = h + s * (c*g + s*di); + } + el = s*p; dl = c*p; + if (fabs(el) <= b) { REPORT test = true; break; } + } + if (!test) Throw ( ConvergenceException(D) ); + Real p = dl + f; + test = false; + for (i=l; i>0; i--) + { + if (p < D.element(i-1)) { REPORT D.element(i) = D.element(i-1); } + else { REPORT test = true; break; } + } + if (!test) i=0; + D.element(i) = p; + } +} + +void eigenvalues(const SymmetricMatrix& A, DiagonalMatrix& D, Matrix& Z) +{ REPORT DiagonalMatrix E; tred2(A, D, E, Z); tql2(D, E, Z); SortSV(D,Z,true); } + +void eigenvalues(const SymmetricMatrix& X, DiagonalMatrix& D) +{ REPORT DiagonalMatrix E; SymmetricMatrix A; tred3(X,D,E,A); tql1(D,E); } + +void eigenvalues(const SymmetricMatrix& X, DiagonalMatrix& D, + SymmetricMatrix& A) +{ REPORT DiagonalMatrix E; tred3(X,D,E,A); tql1(D,E); } + + +#ifdef use_namespace +} +#endif + +///@} + diff --git a/extern/newmat/example.cpp b/extern/newmat/example.cpp new file mode 100644 index 00000000..e671d0a1 --- /dev/null +++ b/extern/newmat/example.cpp @@ -0,0 +1,346 @@ +/// \ingroup newmat +///@{ + +/// \file example.cpp +/// Example of use of matrix package. +/// Carry out a simple regression analysis using a number of different methods +/// to illustrate matrix manipulation, solving equations, +/// Cholesky decomposition, QR decomposition, Singular Value decomposition. + + +#define WANT_STREAM // include.h will get stream fns +#define WANT_MATH // include.h will get math fns + // newmatap.h will get include.h + +#include "newmatap.h" // need matrix applications + +#include "newmatio.h" // need matrix output routines + +#ifdef use_namespace +using namespace NEWMAT; // access NEWMAT namespace +#endif + + +// demonstration of matrix package on linear regression problem + + +void test1(Real* y, Real* x1, Real* x2, int nobs, int npred) +{ + cout << "\n\nTest 1 - traditional, bad\n"; + + // traditional sum of squares and products method of calculation + // but not adjusting means; maybe subject to round-off error + + // make matrix of predictor values with 1s into col 1 of matrix + int npred1 = npred+1; // number of cols including col of ones. + Matrix X(nobs,npred1); + X.column(1) = 1.0; + + // load x1 and x2 into X + // [use << rather than = when loading arrays] + X.column(2) << x1; X.column(3) << x2; + + // vector of Y values + ColumnVector Y(nobs); Y << y; + + // form sum of squares and product matrix + // [use << rather than = for copying Matrix into SymmetricMatrix] + SymmetricMatrix SSQ; SSQ << X.t() * X; + + // calculate estimate + // [bracket last two terms to force this multiplication first] + // [ .i() means inverse, but inverse is not explicity calculated] + ColumnVector A = SSQ.i() * (X.t() * Y); + + // Get variances of estimates from diagonal elements of inverse of SSQ + // get inverse of SSQ - we need it for finding D + DiagonalMatrix D; D << SSQ.i(); + ColumnVector V = D.as_column(); + + // Calculate fitted values and residuals + ColumnVector Fitted = X * A; + ColumnVector Residual = Y - Fitted; + Real ResVar = sum_square(Residual) / (nobs-npred1); + + // Get diagonals of Hat matrix (an expensive way of doing this) + DiagonalMatrix Hat; Hat << X * (X.t() * X).i() * X.t(); + + // print out answers + cout << "\nEstimates and their standard errors\n\n"; + + // make vector of standard errors + ColumnVector SE(npred1); + for (int i=1; i<=npred1; i++) SE(i) = sqrt(V(i)*ResVar); + // use concatenation function to form matrix and use matrix print + // to get two columns + cout << setw(11) << setprecision(5) << (A | SE) << endl; + + cout << "\nObservations, fitted value, residual value, hat value\n"; + + // use concatenation again; select only columns 2 to 3 of X + cout << setw(9) << setprecision(3) << + (X.columns(2,3) | Y | Fitted | Residual | Hat.as_column()); + cout << "\n\n"; +} + +void test2(Real* y, Real* x1, Real* x2, int nobs, int npred) +{ + cout << "\n\nTest 2 - traditional, OK\n"; + + // traditional sum of squares and products method of calculation + // with subtraction of means - less subject to round-off error + // than test1 + + // make matrix of predictor values + Matrix X(nobs,npred); + + // load x1 and x2 into X + // [use << rather than = when loading arrays] + X.column(1) << x1; X.column(2) << x2; + + // vector of Y values + ColumnVector Y(nobs); Y << y; + + // make vector of 1s + ColumnVector Ones(nobs); Ones = 1.0; + + // calculate means (averages) of x1 and x2 [ .t() takes transpose] + RowVector M = X.sum_columns() / nobs; + + // and subtract means from x1 and x2 + Matrix XC(nobs,npred); + XC = X - Ones * M; + + // do the same to Y [use sum to get sum of elements] + ColumnVector YC(nobs); + Real m = sum(Y) / nobs; YC = Y - Ones * m; + + // form sum of squares and product matrix + // [use << rather than = for copying Matrix into SymmetricMatrix] + SymmetricMatrix SSQ; SSQ << XC.t() * XC; + + // calculate estimate + // [bracket last two terms to force this multiplication first] + // [ .i() means inverse, but inverse is not explicity calculated] + ColumnVector A = SSQ.i() * (XC.t() * YC); + + // calculate estimate of constant term + // [AsScalar converts 1x1 matrix to Real] + Real a = m - (M * A).as_scalar(); + + // Get variances of estimates from diagonal elements of inverse of SSQ + // [ we are taking inverse of SSQ - we need it for finding D ] + Matrix ISSQ = SSQ.i(); DiagonalMatrix D; D << ISSQ; + ColumnVector V = D.AsColumn(); + Real v = 1.0/nobs + (M * ISSQ * M.t()).as_scalar(); + // for calc variance of const + + // Calculate fitted values and residuals + int npred1 = npred+1; + ColumnVector Fitted = X * A + a; + ColumnVector Residual = Y - Fitted; + Real ResVar = sum_square(Residual) / (nobs-npred1); + + // Get diagonals of Hat matrix (an expensive way of doing this) + Matrix X1(nobs,npred1); X1.column(1)<0 && alpha1>0 && beta1>0 && (alpha1+beta1)<1.0; } + +Real GARCH11_LL::LogLikelihood() +{ +// cout << endl << " "; +// cout << setw(10) << setprecision(5) << beta; +// cout << setw(10) << setprecision(5) << alpha0; +// cout << setw(10) << setprecision(5) << alpha1; +// cout << setw(10) << setprecision(5) << beta1; +// cout << endl; + ColumnVector H(n); // residual variances + ColumnVector U = Y - X * beta; // the residuals + ColumnVector LH(n); // derivative of log-likelihood wrt H + // each row corresponds to one observation + LH(1)=0; + Matrix Hderiv(n,4); // rectangular matrix of derivatives + // of H wrt parameters + // each row corresponds to one observation + // each column to one of the parameters + + // Regard Y(1) as fixed and don't include in likelihood + // then put in an expected value of H(1) in place of actual value + // which we don't know. Use + // E{H(i)} = alpha0 + alpha1 * E{square(epsilon(i-1))} + beta1 * E{H(i-1)} + // and E{square(epsilon(i-1))} = E{H(i-1)} = E{H(i)} + Real denom = (1-alpha1-beta1); + H(1) = alpha0/denom; // the expected value of H + Hderiv(1,1) = 0; + Hderiv(1,2) = 1.0 / denom; + Hderiv(1,3) = alpha0 / square(denom); + Hderiv(1,4) = Hderiv(1,3); + Real LL = 0.0; // the log likelihood + Real sum1 = 0; // for forming derivative wrt beta + Real sum2 = 0; // for forming second derivative wrt beta + for (int i=2; i<=n; i++) + { + Real u1 = U(i-1); Real h1 = H(i-1); + Real h = alpha0 + alpha1*square(u1) + beta1*h1; // variance of this obsv. + H(i) = h; Real u = U(i); + LL += log(h) + square(u) / h; // -2 * log likelihood + // Hderiv are derivatives of h with respect to the parameters + // need to allow for h1 depending on parameters + Hderiv(i,1) = -2*u1*alpha1*X(i-1) + beta1*Hderiv(i-1,1); // beta + Hderiv(i,2) = 1 + beta1*Hderiv(i-1,2); // alpha0 + Hderiv(i,3) = square(u1) + beta1*Hderiv(i-1,3); // alpha1 + Hderiv(i,4) = h1 + beta1*Hderiv(i-1,4); // beta1 + LH(i) = -0.5 * (1/h - square(u/h)); + sum1 += u * X(i)/ h; + sum2 += square(X(i)) / h; + } + D = Hderiv.t()*LH; // derivatives of likelihood wrt parameters + D(1) += sum1; // add on deriv wrt beta from square(u) term +// cout << setw(10) << setprecision(5) << D << endl; + + // do minus expected value of second derivatives + if (wg) // do only if second derivatives wanted + { + Hderiv.row(1) = 0.0; + Hderiv = H.as_diagonal().i() * Hderiv; + D2 << Hderiv.t() * Hderiv; D2 = D2 / 2.0; + D2(1,1) += sum2; +// cout << setw(10) << setprecision(5) << D2 << endl; +// DiagonalMatrix DX; EigenValues(D2,DX); +// cout << setw(10) << setprecision(5) << DX << endl; + + } + return -0.5 * LL; +} + +ReturnMatrix GARCH11_LL::Derivatives() +{ return D; } + +ReturnMatrix GARCH11_LL::FI() +{ + if (!wg) cout << endl << "unexpected call of FI" << endl; + return D2; +} + + +int my_main() +{ + // get data + ifstream fin("garch.dat"); + if (!fin) { cout << "cannot find garch.dat\n"; exit(1); } + int n; fin >> n; // series length + // Y contains the dependant variable, X the predictor variable + ColumnVector Y(n), X(n); + int i; + for (i=1; i<=n; i++) fin >> Y(i) >> X(i); + cout << "Read " << n << " data points - begin fit\n\n"; + // now do the fit + ColumnVector H(n); + GARCH11_LL garch11(Y,X); // loglikehood "object" + MLE_D_FI mle_d_fi(garch11,100,0.0001); // mle "object" + ColumnVector Para(4); // to hold the parameters + Para << 0.0 << 0.1 << 0.1 << 0.1; // starting values + // (Should change starting values to a more intelligent formula) + mle_d_fi.Fit(Para); // do the fit + ColumnVector SE; + mle_d_fi.GetStandardErrors(SE); + cout << "\n\n"; + cout << "estimates and standard errors\n"; + cout << setw(15) << setprecision(5) << (Para | SE) << endl << endl; + SymmetricMatrix Corr; + mle_d_fi.GetCorrelations(Corr); + cout << "correlation matrix\n"; + cout << setw(10) << setprecision(2) << Corr << endl << endl; + cout << "inverse of correlation matrix\n"; + cout << setw(10) << setprecision(2) << Corr.i() << endl << endl; + return 0; +} + + +// call my_main() - use this to catch exceptions +int main() +{ + Try + { + return my_main(); + } + Catch(BaseException) + { + cout << BaseException::what() << "\n"; + } + CatchAll + { + cout << "\nProgram fails - exception generated\n\n"; + } + return 0; +} + + +///@} diff --git a/extern/newmat/garch.dat b/extern/newmat/garch.dat new file mode 100644 index 00000000..81f55b01 --- /dev/null +++ b/extern/newmat/garch.dat @@ -0,0 +1,502 @@ +500 + 3.44443 -0.49800 + 1.43549 -0.49600 + 3.70477 -0.49400 + -3.82558 -0.49200 + 1.20130 -0.49000 + -2.62383 -0.48800 + -1.34321 -0.48600 + -0.35801 -0.48400 + -2.18813 -0.48200 + -1.98628 -0.48000 + -1.53262 -0.47800 + -1.45007 -0.47600 + -1.18593 -0.47400 + -0.55274 -0.47200 + -1.55943 -0.47000 + -3.10084 -0.46800 + 0.44254 -0.46600 + -0.63936 -0.46400 + 2.44989 -0.46200 + -2.14392 -0.46000 + 0.47310 -0.45800 + -1.64464 -0.45600 + 0.56628 -0.45400 + -0.80925 -0.45200 + -0.78961 -0.45000 + -1.12984 -0.44800 + -0.50715 -0.44600 + -1.75134 -0.44400 + -1.04231 -0.44200 + 0.94435 -0.44000 + 1.16306 -0.43800 + -2.87888 -0.43600 + -3.31084 -0.43400 + -3.06191 -0.43200 + 1.06977 -0.43000 + 3.50462 -0.42800 + 3.94848 -0.42600 + 1.56565 -0.42400 + -5.21742 -0.42200 + 1.94652 -0.42000 + -3.01182 -0.41800 + -3.88963 -0.41600 + -0.31319 -0.41400 + -5.71752 -0.41200 + -6.72218 -0.41000 + 3.23482 -0.40800 + 2.12675 -0.40600 + -0.10975 -0.40400 + -1.73790 -0.40200 + -0.86870 -0.40000 + -1.46022 -0.39800 + -0.22960 -0.39600 + 0.01596 -0.39400 + 0.00568 -0.39200 + -3.41221 -0.39000 + -0.47401 -0.38800 + -1.76305 -0.38600 + -0.49640 -0.38400 + -2.36184 -0.38200 + -0.09625 -0.38000 + -2.81448 -0.37800 + 3.14301 -0.37600 + 1.88025 -0.37400 + -2.61618 -0.37200 + -1.56239 -0.37000 + 0.95722 -0.36800 + 1.29773 -0.36600 + -1.45155 -0.36400 + -0.63342 -0.36200 + -0.78925 -0.36000 + 0.42473 -0.35800 + 1.39599 -0.35600 + 1.03934 -0.35400 + -0.11042 -0.35200 + 0.89123 -0.35000 + 0.93411 -0.34800 + 2.78027 -0.34600 + 3.37402 -0.34400 + -0.07986 -0.34200 + 0.79142 -0.34000 + -4.17148 -0.33800 + -1.26717 -0.33600 + -4.36262 -0.33400 + 1.17431 -0.33200 + -1.75656 -0.33000 + 0.40495 -0.32800 + 0.17572 -0.32600 + -0.27991 -0.32400 + -0.85524 -0.32200 + -1.23380 -0.32000 + -1.01889 -0.31800 + 1.08393 -0.31600 + -0.55989 -0.31400 + -1.91643 -0.31200 + -1.23897 -0.31000 + -0.85407 -0.30800 + 0.35218 -0.30600 + -1.57057 -0.30400 + 0.20665 -0.30200 + 0.19680 -0.30000 + 0.03116 -0.29800 + 0.09100 -0.29600 + 1.03416 -0.29400 + -0.16048 -0.29200 + -0.27530 -0.29000 + -0.11056 -0.28800 + -2.11332 -0.28600 + -0.51348 -0.28400 + -0.16360 -0.28200 + 1.30712 -0.28000 + -0.94392 -0.27800 + -0.06838 -0.27600 + -0.04095 -0.27400 + -2.00364 -0.27200 + 0.63950 -0.27000 + -1.02895 -0.26800 + -0.17454 -0.26600 + -0.86659 -0.26400 + 0.81698 -0.26200 + 0.51579 -0.26000 + -0.74525 -0.25800 + 2.43378 -0.25600 + 0.89364 -0.25400 + 1.81727 -0.25200 + -0.29667 -0.25000 + -0.99628 -0.24800 + 0.09452 -0.24600 + 1.73730 -0.24400 + 0.36819 -0.24200 + -1.56521 -0.24000 + 0.74916 -0.23800 + 0.56802 -0.23600 + -1.34157 -0.23400 + -0.65638 -0.23200 + -2.12183 -0.23000 + -2.35486 -0.22800 + -2.09369 -0.22600 + -3.30745 -0.22400 + -4.14763 -0.22200 + -3.56306 -0.22000 + 0.78907 -0.21800 + -3.74014 -0.21600 + -2.73770 -0.21400 + -4.43153 -0.21200 + -0.80243 -0.21000 + -0.17474 -0.20800 + -0.38250 -0.20600 + -0.98962 -0.20400 + -1.41965 -0.20200 + 0.90585 -0.20000 + 0.66850 -0.19800 + -0.81629 -0.19600 + -3.04422 -0.19400 + -0.94514 -0.19200 + 0.05209 -0.19000 + 0.21315 -0.18800 + -0.86960 -0.18600 + -1.72978 -0.18400 + -2.85623 -0.18200 + -3.15650 -0.18000 + -0.09176 -0.17800 + -1.27376 -0.17600 + -1.06533 -0.17400 + 1.21766 -0.17200 + 0.41706 -0.17000 + -0.30885 -0.16800 + 0.78344 -0.16600 + -1.76348 -0.16400 + 2.46496 -0.16200 + -0.32712 -0.16000 + 1.38586 -0.15800 + 0.33513 -0.15600 + 0.66116 -0.15400 + 0.92420 -0.15200 + -0.67200 -0.15000 + -0.90707 -0.14800 + -0.41053 -0.14600 + 0.62288 -0.14400 + 0.78497 -0.14200 + 0.99670 -0.14000 + -2.19972 -0.13800 + 0.21922 -0.13600 + -0.15003 -0.13400 + -0.72706 -0.13200 + 0.13596 -0.13000 + -0.00235 -0.12800 + 0.50025 -0.12600 + 0.80875 -0.12400 + -0.71010 -0.12200 + -3.85477 -0.12000 + 2.45549 -0.11800 + -2.87772 -0.11600 + 1.03987 -0.11400 + -1.41914 -0.11200 + -1.87414 -0.11000 + 1.32656 -0.10800 + 2.15281 -0.10600 + 3.25624 -0.10400 + -3.72420 -0.10200 + -4.01675 -0.10000 + 1.19241 -0.09800 + 0.35189 -0.09600 + -0.40223 -0.09400 + 0.84146 -0.09200 + 1.08746 -0.09000 + 2.20874 -0.08800 + -0.18822 -0.08600 + -1.29757 -0.08400 + -1.36022 -0.08200 + 0.54575 -0.08000 + -0.23008 -0.07800 + 0.00750 -0.07600 + 1.81600 -0.07400 + -0.07319 -0.07200 + 0.70587 -0.07000 + -2.67033 -0.06800 + 0.67446 -0.06600 + -0.21002 -0.06400 + 2.11396 -0.06200 + -0.94189 -0.06000 + 0.27803 -0.05800 + -0.92172 -0.05600 + 1.37776 -0.05400 + 2.72565 -0.05200 + 0.47208 -0.05000 + -3.33845 -0.04800 + -0.20695 -0.04600 + -2.18905 -0.04400 + -4.33413 -0.04200 + 0.17860 -0.04000 + -5.57817 -0.03800 + -0.32771 -0.03600 + 1.47321 -0.03400 + 2.33767 -0.03200 + 1.22282 -0.03000 + -1.48593 -0.02800 + 0.79435 -0.02600 + 0.54491 -0.02400 + 1.31706 -0.02200 + -1.26472 -0.02000 + -1.72634 -0.01800 + -3.85299 -0.01600 + 0.43717 -0.01400 + -3.39362 -0.01200 + -3.60823 -0.01000 + 0.18868 -0.00800 + 1.23035 -0.00600 + 1.70454 -0.00400 + -1.44766 -0.00200 + 0.99808 0.00000 + 0.24554 0.00200 + 1.44446 0.00400 + 0.96697 0.00600 + -3.30396 0.00800 + -5.97223 0.01000 + 1.22379 0.01200 + 6.00662 0.01400 + 4.43380 0.01600 + 2.01081 0.01800 + -2.74552 0.02000 + 1.19452 0.02200 + 3.81020 0.02400 + 2.04597 0.02600 + 0.66764 0.02800 + 2.68350 0.03000 + -2.85514 0.03200 + 0.21727 0.03400 + 1.88780 0.03600 + 2.23549 0.03800 + 1.57589 0.04000 + 1.92344 0.04200 + -1.78414 0.04400 + -0.67367 0.04600 + 0.19357 0.04800 + 1.00246 0.05000 + 2.13782 0.05200 + 1.90734 0.05400 + 0.43943 0.05600 + -0.55699 0.05800 + 1.76985 0.06000 + -0.77310 0.06200 + -0.33812 0.06400 + -0.85572 0.06600 + -2.49390 0.06800 + -3.17954 0.07000 + 2.86688 0.07200 + 2.03589 0.07400 + -1.34393 0.07600 + 1.01839 0.07800 + -0.15220 0.08000 + 1.17978 0.08200 + 1.96847 0.08400 + 1.90596 0.08600 + 3.72675 0.08800 + -0.65513 0.09000 + -1.45672 0.09200 + -0.08779 0.09400 + -0.39105 0.09600 + 1.88645 0.09800 + 2.34710 0.10000 + -2.65900 0.10200 + -0.47996 0.10400 + -2.51512 0.10600 + -3.59097 0.10800 + -1.62117 0.11000 + -2.43947 0.11200 + 3.50339 0.11400 + 3.05144 0.11600 + -2.73565 0.11800 + -1.31556 0.12000 + 1.85250 0.12200 + -1.03864 0.12400 + 0.79097 0.12600 + -0.12426 0.12800 + 0.48964 0.13000 + 1.42419 0.13200 + 0.55098 0.13400 + -0.78121 0.13600 + -0.01716 0.13800 + -1.27952 0.14000 + 1.91981 0.14200 + 0.25822 0.14400 + 0.68516 0.14600 + 1.25616 0.14800 + -1.40178 0.15000 + -0.99551 0.15200 + 1.45728 0.15400 + -1.66513 0.15600 + -1.20284 0.15800 + 1.84775 0.16000 + -1.91535 0.16200 + 0.34142 0.16400 + 1.90641 0.16600 + 1.55524 0.16800 + 1.77263 0.17000 + 1.25731 0.17200 + -0.66331 0.17400 + 0.93506 0.17600 + 0.87120 0.17800 + 0.73840 0.18000 + -1.48181 0.18200 + -1.76043 0.18400 + 0.96176 0.18600 + 1.29128 0.18800 + 1.20889 0.19000 + 0.78386 0.19200 + 1.54668 0.19400 + -0.25996 0.19600 + 0.93201 0.19800 + 1.30374 0.20000 + 2.23175 0.20200 + -0.42525 0.20400 + 1.12784 0.20600 + -0.42014 0.20800 + -0.00577 0.21000 + -1.14837 0.21200 + 2.48454 0.21400 + -0.51466 0.21600 + -0.06257 0.21800 + -1.25993 0.22000 + 1.26623 0.22200 + 3.05099 0.22400 + -1.84077 0.22600 + -0.36058 0.22800 + 2.65788 0.23000 + -0.17717 0.23200 + 1.68915 0.23400 + -1.53406 0.23600 + 1.78097 0.23800 + -1.24217 0.24000 + -4.17466 0.24200 + 0.80433 0.24400 + 0.70856 0.24600 + -0.96881 0.24800 + 0.87322 0.25000 + -2.45936 0.25200 + 2.95677 0.25400 + 1.81628 0.25600 + -0.85793 0.25800 + 1.02089 0.26000 + -1.05425 0.26200 + -0.29861 0.26400 + 1.69682 0.26600 + 1.07389 0.26800 + 0.22183 0.27000 + 1.72766 0.27200 + -0.99746 0.27400 + -2.14178 0.27600 + -1.67924 0.27800 + 1.56520 0.28000 + -0.86864 0.28200 + 2.65155 0.28400 + -2.27166 0.28600 + 0.68310 0.28800 + 0.84102 0.29000 + 0.64604 0.29200 + 0.68712 0.29400 + 1.56297 0.29600 + -0.68136 0.29800 + 1.25519 0.30000 + -1.38612 0.30200 + 2.36320 0.30400 + 5.40128 0.30600 + -1.14776 0.30800 + -1.36081 0.31000 + 0.07679 0.31200 + -0.17231 0.31400 + 1.19094 0.31600 + 0.09285 0.31800 + -0.85191 0.32000 + -0.43739 0.32200 + -0.22950 0.32400 + 2.21298 0.32600 + 0.75045 0.32800 + 0.97489 0.33000 + -0.62158 0.33200 + 1.10503 0.33400 + 0.36977 0.33600 + -0.32894 0.33800 + 2.13729 0.34000 + 4.42019 0.34200 + -2.80916 0.34400 + 2.28181 0.34600 + 2.59053 0.34800 + -1.52891 0.35000 + -1.35202 0.35200 + 1.27639 0.35400 + 0.28782 0.35600 + 0.83540 0.35800 + -0.32867 0.36000 + 1.16891 0.36200 + 0.02511 0.36400 + -0.71878 0.36600 + 0.69811 0.36800 + 1.29399 0.37000 + 0.86300 0.37200 + -0.12139 0.37400 + -0.28069 0.37600 + 3.07623 0.37800 + -2.91737 0.38000 + 0.16709 0.38200 + -1.60815 0.38400 + 0.02795 0.38600 + 1.19657 0.38800 + 0.04390 0.39000 + 0.95983 0.39200 + -1.83683 0.39400 + -1.69167 0.39600 + 3.15836 0.39800 + 2.24002 0.40000 + 0.45225 0.40200 + 1.35014 0.40400 + -1.67177 0.40600 + -0.97317 0.40800 + 4.20922 0.41000 + -0.03983 0.41200 + -0.35933 0.41400 + -1.49772 0.41600 + 2.72900 0.41800 + -2.61061 0.42000 + -0.26581 0.42200 + -4.30162 0.42400 + -3.55225 0.42600 + -5.60739 0.42800 + 2.26730 0.43000 + -0.05568 0.43200 + -0.14348 0.43400 + -1.73015 0.43600 + -1.01649 0.43800 + -2.39568 0.44000 + 3.41626 0.44200 + 2.23817 0.44400 + -1.02668 0.44600 + 3.18086 0.44800 + 0.71908 0.45000 + -0.37826 0.45200 + -0.39837 0.45400 + 0.50378 0.45600 + 0.38287 0.45800 + 2.95404 0.46000 + -1.16143 0.46200 + 0.89913 0.46400 + -0.82190 0.46600 + 1.30638 0.46800 + 0.89138 0.47000 + 0.85038 0.47200 + -1.38925 0.47400 + 3.74026 0.47600 + 4.60999 0.47800 + 1.31364 0.48000 + 5.17183 0.48200 + 1.82162 0.48400 + 1.09830 0.48600 + 1.36666 0.48800 + -0.09676 0.49000 + 0.74155 0.49200 + 1.21910 0.49400 + 1.20746 0.49600 + 0.82236 0.49800 + 1.54856 0.50000 + diff --git a/extern/newmat/garch.txt b/extern/newmat/garch.txt new file mode 100644 index 00000000..328ccccf --- /dev/null +++ b/extern/newmat/garch.txt @@ -0,0 +1,45 @@ +Read 500 data points - begin fit + + + -2247.993783 25945.58733 + -537.4533239 + -554.5885614 + -537.2164816 26.36266449 + -520.7034774 + -519.7069034 6.153112127 + -516.7045383 + -516.690955 1.394658892 + -516.396412 + -516.215149 0.1555724069 + -516.1509657 + -516.1486772 0.02342168856 + -516.1420803 + -516.1404735 0.002342030975 + -516.1395282 + -516.1394913 0.0003287516503 + -516.1393961 + -516.1393755 3.25631984e-05 +Converged + + +estimates and standard errors + 1.56690 0.22311 + 0.80046 0.20274 + 0.45307 0.08428 + 0.34655 0.09081 + + +correlation matrix + 1.00 0.00 -0.02 0.01 + 0.00 1.00 0.21 -0.81 + -0.02 0.21 1.00 -0.63 + 0.01 -0.81 -0.63 1.00 + + +inverse of correlation matrix + 1.00 0.03 0.04 0.04 + 0.03 4.77 2.28 5.28 + 0.04 2.28 2.73 3.55 + 0.04 5.28 3.55 7.48 + + diff --git a/extern/newmat/hholder.cpp b/extern/newmat/hholder.cpp new file mode 100644 index 00000000..a1e10b8d --- /dev/null +++ b/extern/newmat/hholder.cpp @@ -0,0 +1,520 @@ +/// \ingroup newmat +///@{ + +/// \file hholder.cpp +/// QR related decompositions +/// QRZ, QRZT decompositions +/// QR update and extend orthogonal functions + +// Copyright (C) 1991,2,3,4: R B Davies + +#define WANT_MATH +//#define WANT_STREAM + +#include "include.h" + +#include "newmatap.h" + +#ifdef use_namespace +namespace NEWMAT { +#endif + +#ifdef DO_REPORT +#define REPORT { static ExeCounter ExeCount(__LINE__,16); ++ExeCount; } +#else +#define REPORT {} +#endif + + +/*************************** QR decompositions ***************************/ + +inline Real square(Real x) { return x*x; } + +void QRZT(Matrix& X, LowerTriangularMatrix& L) +{ + REPORT + Tracer et("QRZT(1)"); + int n = X.Ncols(); int s = X.Nrows(); L.resize(s); + if (n == 0 || s == 0) { L = 0.0; return; } + Real* xi = X.Store(); int k; + for (int i=0; i nr) Throw(IncompatibleDimensionsException(A)); + if (n > nc) Throw(IncompatibleDimensionsException(A)); + ColumnVector SSR; + { Matrix A1 = A.Columns(1,n); SSR = A1.sum_square_rows(); } + for (int i = n; i < nc; ++i) + { + // pick row with smallest SSQ + int k; SSR.minimum1(k); + // orthogonalise column with 1 at element k, 0 elsewhere + // next line is rather inefficient + ColumnVector X = - A.Columns(1, i) * A.SubMatrix(k, k, 1, i).t(); + X(k) += 1.0; + // normalise + X /= sqrt(X.SumSquare()); + // update row sums of squares + for (k = 1; k <= nr; ++k) SSR(k) += square(X(k)); + // load new column into matrix + A.Column(i+1) = X; + } +} + + + + + +#ifdef use_namespace +} +#endif + + +///@} diff --git a/extern/newmat/include.h b/extern/newmat/include.h new file mode 100644 index 00000000..e5b8d1eb --- /dev/null +++ b/extern/newmat/include.h @@ -0,0 +1,362 @@ +/// \defgroup rbd_common RBD common library +///@{ + +/// \file include.h +/// Set options and and details of include files. + +#ifndef INCLUDE_LIB +#define INCLUDE_LIB + +//#define use_namespace // define name spaces + +//#define SETUP_C_SUBSCRIPTS // allow element access via A[i][j] + +//#define OPT_COMPATIBLE // for use with opt++ + +// Activate just one of the following 3 statements + +//#define SimulateExceptions // use simulated exceptions +#define UseExceptions // use C++ exceptions +//#define DisableExceptions // do not use exceptions + + +//#define TEMPS_DESTROYED_QUICKLY // for compilers that delete + // temporaries too quickly + +//#define TEMPS_DESTROYED_QUICKLY_R // the same thing but applied + // to return from functions only + +//#define DO_FREE_CHECK // check news and deletes balance + +#define USING_DOUBLE // elements of type double +//#define USING_FLOAT // elements of type float + +#define bool_LIB 0 // for compatibility with my older libraries + +//#define ios_format_flags ios::fmtflags // for Gnu 3 and Intel for Linux + + +//#define _STANDARD_ // using standard library + +//#define use_float_h // use float.h for precision data + + +//#define HAS_INT64 // if unsigned _int64 is recognised + // used by newran03 + +//#define set_unix_options // set if running UNIX or LINUX + +// comment out next line if Exception causes a problem +#define TypeDefException + +//*********************** end of options set by user ******************** + + +// for Gnu C++ version 3 +#if defined __GNUG__ && __GNUG__ >= 3 + #define _STANDARD_ // use standard library + #define ios_format_flags ios::fmtflags +#endif + +// for Intel C++ for Linux +#if defined __ICC + #define _STANDARD_ // use standard library + #define ios_format_flags ios::fmtflags +#endif + +// for Intel C++ for Windows +#if defined __ICL + #define _STANDARD_ // use standard library + #define ios_format_flags ios::fmtflags +#endif + +// for Microsoft Visual C++ 7 and above (and Intel simulating these) +#if defined _MSC_VER && _MSC_VER >= 1300 + #define _STANDARD_ // use standard library +#endif + +// for Borland Builder C++ 2006 and above +#if defined __BCPLUSPLUS__ && __BCPLUSPLUS__ >= 0x0570 + #define _STANDARD_ // use standard library + #define ios_format_flags ios::fmtflags +#endif + + +#ifdef _STANDARD_ // using standard library + #include + #if defined _MSC_VER && _MSC_VER == 1200 + #include // for VC++6 + #endif + #ifdef WANT_STREAM + #include + #include + #endif + #ifdef WANT_MATH + #include + #endif + #ifdef WANT_STRING + #include + #endif + #ifdef WANT_TIME + #include + #endif + #ifdef WANT_FSTREAM + #include + #endif + using namespace std; +#else + +#define DEFAULT_HEADER // use AT&T style header + // if no other compiler is recognised + +#ifdef _MSC_VER // Microsoft + #include + +// reactivate these statements to run under MSC version 7.0 +// typedef int jmp_buf[9]; +// extern "C" +// { +// int __cdecl setjmp(jmp_buf); +// void __cdecl longjmp(jmp_buf, int); +// } + + #ifdef WANT_STREAM + #include + #include + #endif + #ifdef WANT_MATH + #include + #include + #endif + #ifdef WANT_STRING + #include + #endif + #ifdef WANT_TIME + #include + #endif + #ifdef WANT_FSTREAM + #include + #endif + #undef DEFAULT_HEADER +#endif + +#ifdef __ZTC__ // Zortech + #include + #ifdef WANT_STREAM + #include + #include + #define flush "" // not defined in iomanip? + #endif + #ifdef WANT_MATH + #include + #include + #endif + #ifdef WANT_STRING + #include + #endif + #ifdef WANT_TIME + #include + #endif + #ifdef WANT_FSTREAM + #include + #endif + #undef DEFAULT_HEADER +#endif + +#if defined __BCPLUSPLUS__ || defined __TURBOC__ // Borland or Turbo + #include + #ifdef WANT_STREAM + #include + #include + #endif + #ifdef WANT_MATH + #include + #include // Borland has both float and values + // but values.h returns +INF for + // MAXDOUBLE in BC5 + #endif + #ifdef WANT_STRING + #include + #endif + #ifdef WANT_TIME + #include + #endif + #ifdef WANT_FSTREAM + #include + #endif + #undef DEFAULT_HEADER +#endif + +#ifdef __GNUG__ // Gnu C++ + #include + #ifdef WANT_STREAM + #include + #include + #endif + #ifdef WANT_MATH + #include + #include + #endif + #ifdef WANT_STRING + #include + #endif + #ifdef WANT_TIME + #include + #endif + #ifdef WANT_FSTREAM + #include + #endif + #undef DEFAULT_HEADER +#endif + +#ifdef __WATCOMC__ // Watcom C/C++ + #include + #ifdef WANT_STREAM + #include + #include + #endif + #ifdef WANT_MATH + #include + #include + #endif + #ifdef WANT_STRING + #include + #endif + #ifdef WANT_TIME + #include + #endif + #ifdef WANT_FSTREAM + #include + #endif + #undef DEFAULT_HEADER +#endif + + +#ifdef macintosh // MPW C++ on the Mac +#include +#ifdef WANT_STREAM +#include +#include +#endif +#ifdef WANT_MATH +#include +#include +#endif +#ifdef WANT_STRING +#include +#endif +#ifdef WANT_TIME +#include +#endif +#ifdef WANT_FSTREAM +#include +#endif +#undef DEFAULT_HEADER +#endif + +#ifdef use_float_h // use float.h for precision values +#include +#ifdef WANT_STREAM +#include +#include +#endif +#ifdef WANT_MATH +#include +#include +#endif +#ifdef WANT_STRING +#include +#endif +#ifdef WANT_TIME +#include +#endif +#ifdef WANT_FSTREAM +#include +#endif +#undef DEFAULT_HEADER +#endif + + +#ifdef DEFAULT_HEADER // for example AT&T +#define ATandT +#include +#ifdef WANT_STREAM +#include +#include +#endif +#ifdef WANT_MATH +#include +#define SystemV // use System V +#include +#endif +#ifdef WANT_STRING +#include +#endif +#ifdef WANT_TIME +#include +#endif +#ifdef WANT_FSTREAM +#include +#endif +#endif // DEFAULT_HEADER + +#endif // _STANDARD_ + +#ifdef use_namespace +namespace RBD_COMMON { +#endif + + +#ifdef USING_FLOAT // set precision type to float +typedef float Real; +typedef double long_Real; +#endif + +#ifdef USING_DOUBLE // set precision type to double +typedef double Real; +typedef long double long_Real; +#endif + + +// This is for (very old) compilers that do not have bool automatically defined + +#ifndef bool_LIB +#define bool_LIB 0 + +class bool +{ + int value; +public: + bool(const int b) { value = b ? 1 : 0; } + bool(const void* b) { value = b ? 1 : 0; } + bool() {} + operator int() const { return value; } + int operator!() const { return !value; } +}; + + +const bool true = 1; +const bool false = 0; + +#endif + + +#ifdef use_namespace +} +#endif + + +#ifdef use_namespace +namespace RBD_COMMON {} +namespace RBD_LIBRARIES // access all my libraries +{ + using namespace RBD_COMMON; +} +#endif + + +#endif + + +///@} + diff --git a/extern/newmat/jacobi.cpp b/extern/newmat/jacobi.cpp new file mode 100644 index 00000000..4c4d699f --- /dev/null +++ b/extern/newmat/jacobi.cpp @@ -0,0 +1,130 @@ +/// \ingroup newmat +///@{ + +/// \file jacobi.cpp +/// Eigen value decomposition using Jacobi method. + + +// Copyright (C) 1991,2,3,4: R B Davies + + +//#define WANT_STREAM + + +#define WANT_MATH + +#include "include.h" +#include "newmatap.h" +#include "precisio.h" +#include "newmatrm.h" + +#ifdef use_namespace +namespace NEWMAT { +#endif + +#ifdef DO_REPORT +#define REPORT { static ExeCounter ExeCount(__LINE__,18); ++ExeCount; } +#else +#define REPORT {} +#endif + + +void Jacobi(const SymmetricMatrix& X, DiagonalMatrix& D, SymmetricMatrix& A, + Matrix& V, bool eivec) +{ + Real epsilon = FloatingPointPrecision::Epsilon(); + Tracer et("Jacobi"); + REPORT + int n = X.Nrows(); DiagonalMatrix B(n), Z(n); D.resize(n); A = X; + if (eivec) { REPORT V.resize(n,n); D = 1.0; V = D; } + B << A; D = B; Z = 0.0; A.Inject(Z); + bool converged = false; + for (int i=1; i<=50; i++) + { + Real sm=0.0; Real* a = A.Store(); int p = A.Storage(); + while (p--) sm += fabs(*a++); // have previously zeroed diags + if (sm==0.0) { REPORT converged = true; break; } + Real tresh = (i<4) ? 0.2 * sm / square(n) : 0.0; a = A.Store(); + for (p = 0; p < n; p++) + { + Real* ap1 = a + (p*(p+1))/2; + Real& zp = Z.element(p); Real& dp = D.element(p); + for (int q = p+1; q < n; q++) + { + Real* ap = ap1; Real* aq = a + (q*(q+1))/2; + Real& zq = Z.element(q); Real& dq = D.element(q); + Real& apq = A.element(q,p); + Real g = 100 * fabs(apq); Real adp = fabs(dp); Real adq = fabs(dq); + + if (i>4 && g < epsilon*adp && g < epsilon*adq) { REPORT apq = 0.0; } + else if (fabs(apq) > tresh) + { + REPORT + Real t; Real h = dq - dp; Real ah = fabs(h); + if (g < epsilon*ah) { REPORT t = apq / h; } + else + { + REPORT + Real theta = 0.5 * h / apq; + t = 1.0 / ( fabs(theta) + sqrt(1.0 + square(theta)) ); + if (theta<0.0) { REPORT t = -t; } + } + Real c = 1.0 / sqrt(1.0 + square(t)); Real s = t * c; + Real tau = s / (1.0 + c); h = t * apq; + zp -= h; zq += h; dp -= h; dq += h; apq = 0.0; + int j = p; + while (j--) + { + g = *ap; h = *aq; + *ap++ = g-s*(h+g*tau); *aq++ = h+s*(g-h*tau); + } + int ip = p+1; j = q-ip; ap += ip++; aq++; + while (j--) + { + g = *ap; h = *aq; + *ap = g-s*(h+g*tau); *aq++ = h+s*(g-h*tau); + ap += ip++; + } + if (q < n-1) // last loop is non-empty + { + int iq = q+1; j = n-iq; ap += ip++; aq += iq++; + for (;;) + { + g = *ap; h = *aq; + *ap = g-s*(h+g*tau); *aq = h+s*(g-h*tau); + if (!(--j)) break; + ap += ip++; aq += iq++; + } + } + if (eivec) + { + REPORT + RectMatrixCol VP(V,p); RectMatrixCol VQ(V,q); + Rotate(VP, VQ, tau, s); + } + } + } + } + B = B + Z; D = B; Z = 0.0; + } + if (!converged) Throw(ConvergenceException(X)); + if (eivec) SortSV(D, V, true); + else SortAscending(D); +} + +void Jacobi(const SymmetricMatrix& X, DiagonalMatrix& D) +{ REPORT SymmetricMatrix A; Matrix V; Jacobi(X,D,A,V,false); } + +void Jacobi(const SymmetricMatrix& X, DiagonalMatrix& D, SymmetricMatrix& A) +{ REPORT Matrix V; Jacobi(X,D,A,V,false); } + +void Jacobi(const SymmetricMatrix& X, DiagonalMatrix& D, Matrix& V) +{ REPORT SymmetricMatrix A; Jacobi(X,D,A,V,true); } + + +#ifdef use_namespace +} +#endif + + +///@} diff --git a/extern/newmat/myexcept.cpp b/extern/newmat/myexcept.cpp new file mode 100644 index 00000000..d4f57be0 --- /dev/null +++ b/extern/newmat/myexcept.cpp @@ -0,0 +1,496 @@ +/// \ingroup rbd_common +///@{ + +/// \file myexcept.cpp +/// Exception handler. +/// The low level classes for +/// - my exception class hierarchy +/// - the functions needed for my simulated exceptions +/// - the Tracer mechanism +/// - routines for checking whether new and delete calls are balanced +/// + +// Copyright (C) 1993,4,6: R B Davies + + +#define WANT_STREAM // include.h will get stream fns +#define WANT_STRING + +#include "include.h" // include standard files + + +#include "myexcept.h" // for exception handling + +#ifdef use_namespace +namespace RBD_COMMON { +#endif + + +//#define REG_DEREG // for print out uses of new/delete +//#define CLEAN_LIST // to print entries being added to + // or deleted from cleanup list + +#ifdef SimulateExceptions + +void Throw() +{ + for (Janitor* jan = JumpBase::jl->janitor; jan; jan = jan->NextJanitor) + jan->CleanUp(); + JumpItem* jx = JumpBase::jl->ji; // previous jumpbase; + if ( !jx ) { Terminate(); } // jl was initial JumpItem + JumpBase::jl = jx; // drop down a level; cannot be in front + // of previous line + Tracer::last = JumpBase::jl->trace; + longjmp(JumpBase::jl->env, 1); +} + +#endif // end of simulate exceptions + + +unsigned long BaseException::Select; +char* BaseException::what_error; +int BaseException::SoFar; +int BaseException::LastOne; + +BaseException::BaseException(const char* a_what) +{ + Select++; SoFar = 0; + if (!what_error) // make space for exception message + { + LastOne = 511; + what_error = new char[512]; + if (!what_error) // fail to make space + { + LastOne = 0; + what_error = (char *)"No heap space for exception message\n"; + } + } + AddMessage("\n\nAn exception has been thrown\n"); + AddMessage(a_what); + if (a_what) Tracer::AddTrace(); +} + +void BaseException::AddMessage(const char* a_what) +{ + if (a_what) + { + int l = strlen(a_what); int r = LastOne - SoFar; + if (l < r) { strcpy(what_error+SoFar, a_what); SoFar += l; } + else if (r > 0) + { + strncpy(what_error+SoFar, a_what, r); + what_error[LastOne] = 0; + SoFar = LastOne; + } + } +} + +void BaseException::AddInt(int value) +{ + bool negative; + if (value == 0) { AddMessage("0"); return; } + else if (value < 0) { value = -value; negative = true; } + else negative = false; + int n = 0; int v = value; // how many digits will we need? + while (v > 0) { v /= 10; n++; } + if (negative) n++; + if (LastOne-SoFar < n) { AddMessage("***"); return; } + + SoFar += n; n = SoFar; what_error[n] = 0; + while (value > 0) + { + int nv = value / 10; int rm = value - nv * 10; value = nv; + what_error[--n] = (char)(rm + '0'); + } + if (negative) what_error[--n] = '-'; + return; +} + +void Tracer::PrintTrace() +{ + cout << "\n"; + for (Tracer* et = last; et; et=et->previous) + cout << " * " << et->entry << "\n"; +} + +void Tracer::AddTrace() +{ + if (last) + { + BaseException::AddMessage("Trace: "); + BaseException::AddMessage(last->entry); + for (Tracer* et = last->previous; et; et=et->previous) + { + BaseException::AddMessage("; "); + BaseException::AddMessage(et->entry); + } + BaseException::AddMessage(".\n"); + } +} + +#ifdef SimulateExceptions + + +Janitor::Janitor() +{ + if (do_not_link) + { + do_not_link = false; NextJanitor = 0; OnStack = false; +#ifdef CLEAN_LIST + cout << "Not added to clean-list " << (unsigned long)this << "\n"; +#endif + } + else + { + OnStack = true; +#ifdef CLEAN_LIST + cout << "Add to clean-list " << (unsigned long)this << "\n"; +#endif + NextJanitor = JumpBase::jl->janitor; JumpBase::jl->janitor=this; + } +} + +Janitor::~Janitor() +{ + // expect the item to be deleted to be first on list + // but must be prepared to search list + if (OnStack) + { +#ifdef CLEAN_LIST + cout << "Delete from clean-list " << (unsigned long)this << "\n"; +#endif + Janitor* lastjan = JumpBase::jl->janitor; + if (this == lastjan) JumpBase::jl->janitor = NextJanitor; + else + { + for (Janitor* jan = lastjan->NextJanitor; jan; + jan = lastjan->NextJanitor) + { + if (jan==this) + { lastjan->NextJanitor = jan->NextJanitor; return; } + lastjan=jan; + } + + Throw(BaseException( +"Cannot resolve memory linked list\nSee notes in myexcept.cpp for details\n" + )); + + +// This message occurs when a call to ~Janitor() occurs, apparently +// without a corresponding call to Janitor(). This could happen if my +// way of deciding whether a constructor is being called by new +// fails. + +// It may happen if you are using my simulated exceptions and also have +// your compiler s exceptions turned on. + +// It can also happen if you have a class derived from Janitor +// which does not include a copy constructor [ eg X(const &X) ]. +// Possibly also if delete is applied an object on the stack (ie not +// called by new). Otherwise, it is a bug in myexcept or your compiler. +// If you do not #define TEMPS_DESTROYED_QUICKLY you will get this +// error with Microsoft C 7.0. There are probably situations where +// you will get this when you do define TEMPS_DESTROYED_QUICKLY. This +// is a bug in MSC. Beware of "operator" statements for defining +// conversions; particularly for converting from a Base class to a +// Derived class. + +// You may get away with simply deleting this error message and Throw +// statement if you can not find a better way of overcoming the +// problem. In any case please tell me if you get this error message, +// particularly for compilers apart from Microsoft C 7.0. + + + } + } +} + +JumpItem* JumpBase::jl; // will be set to zero +jmp_buf JumpBase::env; +bool Janitor::do_not_link; // will be set to false + + +int JanitorInitializer::ref_count; + +JanitorInitializer::JanitorInitializer() +{ + if (ref_count++ == 0) new JumpItem; + // need JumpItem at head of list +} + +#endif // end of SimulateExceptions + +Tracer* Tracer::last; // will be set to zero + + +void Terminate() +{ + cout << "\n\nThere has been an exception with no handler - exiting"; + const char* what = BaseException::what(); + if (what) cout << what << "\n"; + exit(1); +} + + + +#ifdef DO_FREE_CHECK +// Routines for tracing whether new and delete calls are balanced + +FreeCheckLink::FreeCheckLink() : next(FreeCheck::next) + { FreeCheck::next = this; } + +FCLClass::FCLClass(void* t, char* name) : ClassName(name) { ClassStore=t; } + +FCLRealArray::FCLRealArray(void* t, char* o, int s) + : Operation(o), size(s) { ClassStore=t; } + +FCLIntArray::FCLIntArray(void* t, char* o, int s) + : Operation(o), size(s) { ClassStore=t; } + +FreeCheckLink* FreeCheck::next; +int FreeCheck::BadDelete; + +void FCLClass::Report() +{ cout << " " << ClassName << " " << (unsigned long)ClassStore << "\n"; } + +void FCLRealArray::Report() +{ + cout << " " << Operation << " " << (unsigned long)ClassStore << + " " << size << "\n"; +} + +void FCLIntArray::Report() +{ + cout << " " << Operation << " " << (unsigned long)ClassStore << + " " << size << "\n"; +} + +void FreeCheck::Register(void* t, char* name) +{ + FCLClass* f = new FCLClass(t,name); + if (!f) { cout << "Out of memory in FreeCheck\n"; exit(1); } +#ifdef REG_DEREG + cout << "Registering " << name << " " << (unsigned long)t << "\n"; +#endif +} + +void FreeCheck::RegisterR(void* t, char* o, int s) +{ + FCLRealArray* f = new FCLRealArray(t,o,s); + if (!f) { cout << "Out of memory in FreeCheck\n"; exit(1); } +#ifdef REG_DEREG + cout << o << " " << s << " " << (unsigned long)t << "\n"; +#endif +} + +void FreeCheck::RegisterI(void* t, char* o, int s) +{ + FCLIntArray* f = new FCLIntArray(t,o,s); + if (!f) { cout << "Out of memory in FreeCheck\n"; exit(1); } +#ifdef REG_DEREG + cout << o << " " << s << " " << (unsigned long)t << "\n"; +#endif +} + +void FreeCheck::DeRegister(void* t, char* name) +{ + FreeCheckLink* last = 0; +#ifdef REG_DEREG + cout << "Deregistering " << name << " " << (unsigned long)t << "\n"; +#endif + for (FreeCheckLink* fcl = next; fcl; fcl = fcl->next) + { + if (fcl->ClassStore==t) + { + if (last) last->next = fcl->next; else next = fcl->next; + delete fcl; return; + } + last = fcl; + } + cout << "\nRequest to delete non-existent object of class and location:\n"; + cout << " " << name << " " << (unsigned long)t << "\n"; + BadDelete++; + Tracer::PrintTrace(); + cout << "\n"; +} + +void FreeCheck::DeRegisterR(void* t, char* o, int s) +{ + FreeCheckLink* last = 0; +#ifdef REG_DEREG + cout << o << " " << s << " " << (unsigned long)t << "\n"; +#endif + for (FreeCheckLink* fcl = next; fcl; fcl = fcl->next) + { + if (fcl->ClassStore==t) + { + if (last) last->next = fcl->next; else next = fcl->next; + if (s >= 0 && ((FCLRealArray*)fcl)->size != s) + { + cout << "\nArray sizes do not agree:\n"; + cout << " " << o << " " << (unsigned long)t + << " " << ((FCLRealArray*)fcl)->size << " " << s << "\n"; + Tracer::PrintTrace(); + cout << "\n"; + } + delete fcl; return; + } + last = fcl; + } + cout << "\nRequest to delete non-existent real array:\n"; + cout << " " << o << " " << (unsigned long)t << " " << s << "\n"; + BadDelete++; + Tracer::PrintTrace(); + cout << "\n"; +} + +void FreeCheck::DeRegisterI(void* t, char* o, int s) +{ + FreeCheckLink* last = 0; +#ifdef REG_DEREG + cout << o << " " << s << " " << (unsigned long)t << "\n"; +#endif + for (FreeCheckLink* fcl = next; fcl; fcl = fcl->next) + { + if (fcl->ClassStore==t) + { + if (last) last->next = fcl->next; else next = fcl->next; + if (s >= 0 && ((FCLIntArray*)fcl)->size != s) + { + cout << "\nArray sizes do not agree:\n"; + cout << " " << o << " " << (unsigned long)t + << " " << ((FCLIntArray*)fcl)->size << " " << s << "\n"; + Tracer::PrintTrace(); + cout << "\n"; + } + delete fcl; return; + } + last = fcl; + } + cout << "\nRequest to delete non-existent int array:\n"; + cout << " " << o << " " << (unsigned long)t << " " << s << "\n"; + BadDelete++; + Tracer::PrintTrace(); + cout << "\n"; +} + +void FreeCheck::Status() +{ + if (next) + { + cout << "\nObjects of the following classes remain undeleted:\n"; + for (FreeCheckLink* fcl = next; fcl; fcl = fcl->next) fcl->Report(); + cout << "\n"; + } + else cout << "\nNo objects remain undeleted\n\n"; + if (BadDelete) + { + cout << "\nThere were " << BadDelete << + " requests to delete non-existent items\n\n"; + } +} + +#endif // end of DO_FREE_CHECK + +// derived exception bodies + +Logic_error::Logic_error(const char* a_what) : BaseException() +{ + Select = BaseException::Select; + AddMessage("Logic error:- "); AddMessage(a_what); + if (a_what) Tracer::AddTrace(); +} + +Runtime_error::Runtime_error(const char* a_what) + : BaseException() +{ + Select = BaseException::Select; + AddMessage("Runtime error:- "); AddMessage(a_what); + if (a_what) Tracer::AddTrace(); +} + +Domain_error::Domain_error(const char* a_what) : Logic_error() +{ + Select = BaseException::Select; + AddMessage("domain error\n"); AddMessage(a_what); + if (a_what) Tracer::AddTrace(); +} + +Invalid_argument::Invalid_argument(const char* a_what) : Logic_error() +{ + Select = BaseException::Select; + AddMessage("invalid argument\n"); AddMessage(a_what); + if (a_what) Tracer::AddTrace(); +} + +Length_error::Length_error(const char* a_what) : Logic_error() +{ + Select = BaseException::Select; + AddMessage("length error\n"); AddMessage(a_what); + if (a_what) Tracer::AddTrace(); +} + +Out_of_range::Out_of_range(const char* a_what) : Logic_error() +{ + Select = BaseException::Select; + AddMessage("out of range\n"); AddMessage(a_what); + if (a_what) Tracer::AddTrace(); +} + +//Bad_cast::Bad_cast(const char* a_what) : Logic_error() +//{ +// Select = BaseException::Select; +// AddMessage("bad cast\n"); AddMessage(a_what); +// if (a_what) Tracer::AddTrace(); +//} + +//Bad_typeid::Bad_typeid(const char* a_what) : Logic_error() +//{ +// Select = BaseException::Select; +// AddMessage("bad type id.\n"); AddMessage(a_what); +// if (a_what) Tracer::AddTrace(); +//} + +Range_error::Range_error(const char* a_what) : Runtime_error() +{ + Select = BaseException::Select; + AddMessage("range error\n"); AddMessage(a_what); + if (a_what) Tracer::AddTrace(); +} + +Overflow_error::Overflow_error(const char* a_what) : Runtime_error() +{ + Select = BaseException::Select; + AddMessage("overflow error\n"); AddMessage(a_what); + if (a_what) Tracer::AddTrace(); +} + +Bad_alloc::Bad_alloc(const char* a_what) : BaseException() +{ + Select = BaseException::Select; + AddMessage("bad allocation\n"); AddMessage(a_what); + if (a_what) Tracer::AddTrace(); +} + + + + +unsigned long Logic_error::Select; +unsigned long Runtime_error::Select; +unsigned long Domain_error::Select; +unsigned long Invalid_argument::Select; +unsigned long Length_error::Select; +unsigned long Out_of_range::Select; +//unsigned long Bad_cast::Select; +//unsigned long Bad_typeid::Select; +unsigned long Range_error::Select; +unsigned long Overflow_error::Select; +unsigned long Bad_alloc::Select; + +#ifdef use_namespace +} +#endif + + +///@} + diff --git a/extern/newmat/myexcept.h b/extern/newmat/myexcept.h new file mode 100644 index 00000000..e260d57c --- /dev/null +++ b/extern/newmat/myexcept.h @@ -0,0 +1,448 @@ +/// \ingroup rbd_common +///@{ + +/// \file myexcept.h +/// Exception handler. +/// The low level classes for +/// - my exception class hierarchy +/// - the functions needed for my simulated exceptions +/// - the Tracer mechanism +/// - routines for checking whether new and delete calls are balanced +/// + + +// A set of classes to simulate exceptions in C++ +// +// Partially copied from Carlos Vidal s article in the C users journal +// September 1992, pp 19-28 +// +// Operations defined +// Try { } +// Throw ( exception object ) +// ReThrow +// Catch ( exception class ) { } +// CatchAll { } +// CatchAndThrow +// +// All catch lists must end with a CatchAll or CatchAndThrow statement +// but not both. +// +// When exceptions are finally implemented replace Try, Throw(E), Rethrow, +// Catch, CatchAll, CatchAndThrow by try, throw E, throw, catch, +// catch(...), and {}. +// +// All exception classes must be derived from BaseException, have no +// non-static variables and must include the statement +// +// static unsigned long Select; +// +// Any constructor in one of these exception classes must include +// +// Select = BaseException::Select; +// +// For each exceptions class, EX_1, some .cpp file must include +// +// unsigned long EX_1::Select; +// + + +#ifndef EXCEPTION_LIB +#define EXCEPTION_LIB + +#include "include.h" + +#ifdef use_namespace +namespace RBD_COMMON { +#endif + + +void Terminate(); + + +//********** classes for setting up exceptions and reporting ************// + +class BaseException; + +class Tracer // linked list showing how +{ // we got here + const char* entry; + Tracer* previous; +public: + Tracer(const char*); + ~Tracer(); + void ReName(const char*); + static void PrintTrace(); // for printing trace + static void AddTrace(); // insert trace in exception record + static Tracer* last; // points to Tracer list + static void clear() {} // for compatibility + friend class BaseException; +}; + + +class BaseException // The base exception class +{ +protected: + static char* what_error; // error message + static int SoFar; // no. characters already entered + static int LastOne; // last location in error buffer +public: + static void AddMessage(const char* a_what); + // messages about exception + static void AddInt(int value); // integer to error message + static unsigned long Select; // for identifying exception + BaseException(const char* a_what = 0); + static const char* what() { return what_error; } + // for getting error message + static void clear() {} // for compatibility +}; + +#ifdef TypeDefException +typedef BaseException Exception; // for compatibility with my older libraries +#endif + +inline Tracer::Tracer(const char* e) + : entry(e), previous(last) { last = this; } + +inline Tracer::~Tracer() { last = previous; } + +inline void Tracer::ReName(const char* e) { entry=e; } + +#ifdef SimulateExceptions // SimulateExceptions + +#include + + +//************* the definitions of Try, Throw and Catch *****************// + + +class JumpItem; +class Janitor; + +class JumpBase // pointer to a linked list of jmp_buf s +{ +public: + static JumpItem *jl; + static jmp_buf env; +}; + +class JumpItem // an item in a linked list of jmp_buf s +{ +public: + JumpItem *ji; + jmp_buf env; + Tracer* trace; // to keep check on Tracer items + Janitor* janitor; // list of items for cleanup + JumpItem() : ji(JumpBase::jl), trace(0), janitor(0) + { JumpBase::jl = this; } + ~JumpItem() { JumpBase::jl = ji; } +}; + +void Throw(); + +inline void Throw(const BaseException&) { Throw(); } + +#define Try \ + if (!setjmp( JumpBase::jl->env )) { \ + JumpBase::jl->trace = Tracer::last; \ + JumpItem JI387256156; + +#define ReThrow Throw() + +#define Catch(EXCEPTION) \ + } else if (BaseException::Select == EXCEPTION::Select) { + +#define CatchAll } else + +#define CatchAndThrow } else Throw(); + + +//****************** cleanup heap following Throw ***********************// + +class Janitor +{ +protected: + static bool do_not_link; // set when new is called + bool OnStack; // false if created by new +public: + Janitor* NextJanitor; + virtual void CleanUp() {} + Janitor(); + virtual ~Janitor(); +}; + + +// The tiresome old trick for initializing the Janitor class +// this is needed for classes derived from Janitor which have objects +// declared globally + +class JanitorInitializer +{ +public: + JanitorInitializer(); +private: + static int ref_count; +}; + +static JanitorInitializer JanInit; + +#endif // end of SimulateExceptions + +#ifdef UseExceptions + +#define Try try +#define Throw(E) throw E +#define ReThrow throw +#define Catch catch +#define CatchAll catch(...) +#define CatchAndThrow {} + +#endif // end of UseExceptions + + +#ifdef DisableExceptions // Disable exceptions + +#define Try { +#define ReThrow Throw() +#define Catch(EXCEPTION) } if (false) { +#define CatchAll } if (false) +#define CatchAndThrow } + +inline void Throw() { Terminate(); } +inline void Throw(const BaseException&) { Terminate(); } + + +#endif // end of DisableExceptions + +#ifndef SimulateExceptions // ! SimulateExceptions + +class Janitor // a dummy version +{ +public: + virtual void CleanUp() {} + Janitor() {} + virtual ~Janitor() {} +}; + +#endif // end of ! SimulateExceptions + + +//******************** FREE_CHECK and NEW_DELETE ***********************// + +#ifdef DO_FREE_CHECK // DO_FREE_CHECK +// Routines for tracing whether new and delete calls are balanced + +class FreeCheck; + +class FreeCheckLink +{ +protected: + FreeCheckLink* next; + void* ClassStore; + FreeCheckLink(); + virtual void Report()=0; // print details of link + friend class FreeCheck; +}; + +class FCLClass : public FreeCheckLink // for registering objects +{ + char* ClassName; + FCLClass(void* t, char* name); + void Report(); + friend class FreeCheck; +}; + +class FCLRealArray : public FreeCheckLink // for registering real arrays +{ + char* Operation; + int size; + FCLRealArray(void* t, char* o, int s); + void Report(); + friend class FreeCheck; +}; + +class FCLIntArray : public FreeCheckLink // for registering int arrays +{ + char* Operation; + int size; + FCLIntArray(void* t, char* o, int s); + void Report(); + friend class FreeCheck; +}; + + +class FreeCheck +{ + static FreeCheckLink* next; + static int BadDelete; +public: + static void Register(void*, char*); + static void DeRegister(void*, char*); + static void RegisterR(void*, char*, int); + static void DeRegisterR(void*, char*, int); + static void RegisterI(void*, char*, int); + static void DeRegisterI(void*, char*, int); + static void Status(); + friend class FreeCheckLink; + friend class FCLClass; + friend class FCLRealArray; + friend class FCLIntArray; +}; + +#define FREE_CHECK(Class) \ +public: \ + void* operator new(size_t size) \ + { \ + void* t = ::operator new(size); FreeCheck::Register(t,#Class); \ + return t; \ + } \ + void operator delete(void* t) \ + { FreeCheck::DeRegister(t,#Class); ::operator delete(t); } + + +#ifdef SimulateExceptions // SimulateExceptions + +#define NEW_DELETE(Class) \ +public: \ + void* operator new(size_t size) \ + { \ + do_not_link=true; \ + void* t = ::operator new(size); FreeCheck::Register(t,#Class); \ + return t; \ + } \ + void operator delete(void* t) \ + { FreeCheck::DeRegister(t,#Class); ::operator delete(t); } + + +#endif // end of SimulateExceptions + + +#define MONITOR_REAL_NEW(Operation, Size, Pointer) \ + FreeCheck::RegisterR(Pointer, Operation, Size); +#define MONITOR_INT_NEW(Operation, Size, Pointer) \ + FreeCheck::RegisterI(Pointer, Operation, Size); +#define MONITOR_REAL_DELETE(Operation, Size, Pointer) \ + FreeCheck::DeRegisterR(Pointer, Operation, Size); +#define MONITOR_INT_DELETE(Operation, Size, Pointer) \ + FreeCheck::DeRegisterI(Pointer, Operation, Size); + +#else // DO_FREE_CHECK not defined + +#define FREE_CHECK(Class) public: +#define MONITOR_REAL_NEW(Operation, Size, Pointer) {} +#define MONITOR_INT_NEW(Operation, Size, Pointer) {} +#define MONITOR_REAL_DELETE(Operation, Size, Pointer) {} +#define MONITOR_INT_DELETE(Operation, Size, Pointer) {} + + +#ifdef SimulateExceptions // SimulateExceptions + + +#define NEW_DELETE(Class) \ +public: \ + void* operator new(size_t size) \ + { do_not_link=true; void* t = ::operator new(size); return t; } \ + void operator delete(void* t) { ::operator delete(t); } + +#endif // end of SimulateExceptions + +#endif // end of ! DO_FREE_CHECK + +#ifndef SimulateExceptions // ! SimulateExceptions + +#define NEW_DELETE(Class) FREE_CHECK(Class) + +#endif // end of ! SimulateExceptions + + +//********************* derived exceptions ******************************// + +class Logic_error : public BaseException +{ +public: + static unsigned long Select; + Logic_error(const char* a_what = 0); +}; + +class Runtime_error : public BaseException +{ +public: + static unsigned long Select; + Runtime_error(const char* a_what = 0); +}; + +class Domain_error : public Logic_error +{ +public: + static unsigned long Select; + Domain_error(const char* a_what = 0); +}; + +class Invalid_argument : public Logic_error +{ +public: + static unsigned long Select; + Invalid_argument(const char* a_what = 0); +}; + +class Length_error : public Logic_error +{ +public: + static unsigned long Select; + Length_error(const char* a_what = 0); +}; + +class Out_of_range : public Logic_error +{ +public: + static unsigned long Select; + Out_of_range(const char* a_what = 0); +}; + +//class Bad_cast : public Logic_error +//{ +//public: +// static unsigned long Select; +// Bad_cast(const char* a_what = 0); +//}; + +//class Bad_typeid : public Logic_error +//{ +//public: +// static unsigned long Select; +// Bad_typeid(const char* a_what = 0); +//}; + +class Range_error : public Runtime_error +{ +public: + static unsigned long Select; + Range_error(const char* a_what = 0); +}; + +class Overflow_error : public Runtime_error +{ +public: + static unsigned long Select; + Overflow_error(const char* a_what = 0); +}; + +class Bad_alloc : public BaseException +{ +public: + static unsigned long Select; + Bad_alloc(const char* a_what = 0); +}; + +#ifdef use_namespace +} +#endif + + +#endif // end of EXCEPTION_LIB + + +// body file: myexcept.cpp + + +///@} + diff --git a/extern/newmat/newfft.cpp b/extern/newmat/newfft.cpp new file mode 100644 index 00000000..41d849db --- /dev/null +++ b/extern/newmat/newfft.cpp @@ -0,0 +1,1065 @@ +/// \ingroup newmat +///@{ + +/// \file newfft.cpp +/// Fast Fourier transform using Sande and Gentleman method. + + +// This is originally by Sande and Gentleman in 1967! I have translated from +// Fortran into C and a little bit of C++. + +// It takes about twice as long as fftw +// (http://theory.lcs.mit.edu/~fftw/homepage.html) +// but is much shorter than fftw and so despite its age +// might represent a reasonable +// compromise between speed and complexity. +// If you really need the speed get fftw. + + +// THIS SUBROUTINE WAS WRITTEN BY G.SANDE OF PRINCETON UNIVERSITY AND +// W.M.GENTLMAN OF THE BELL TELEPHONE LAB. IT WAS BROUGHT TO LONDON +// BY DR. M.D. GODFREY AT THE IMPERIAL COLLEGE AND WAS ADAPTED FOR +// BURROUGHS 6700 BY D. R. BRILLINGER AND J. PEMBERTON +// IT REPRESENTS THE STATE OF THE ART OF COMPUTING COMPLETE FINITE +// DISCRETE FOURIER TRANSFORMS AS OF NOV.1967. +// OTHER PROGRAMS REQUIRED. +// ONLY THOSE SUBROUTINES INCLUDED HERE. +// USAGE. +// CALL AR1DFT(N,X,Y) +// WHERE N IS THE NUMBER OF POINTS IN THE SEQUENCE . +// X - IS A ONE-DIMENSIONAL ARRAY CONTAINING THE REAL +// PART OF THE SEQUENCE. +// Y - IS A ONE-DIMENSIONAL ARRAY CONTAINING THE +// IMAGINARY PART OF THE SEQUENCE. +// THE TRANSFORM IS RETURNED IN X AND Y. +// METHOD +// FOR A GENERAL DISCUSSION OF THESE TRANSFORMS AND OF +// THE FAST METHOD FOR COMPUTING THEM, SEE GENTLEMAN AND SANDE, +// @FAST FOURIER TRANSFORMS - FOR FUN AND PROFIT,@ 1966 FALL JOINT +// COMPUTER CONFERENCE. +// THIS PROGRAM COMPUTES THIS FOR A COMPLEX SEQUENCE Z(T) OF LENGTH +// N WHOSE ELEMENTS ARE STORED AT(X(I) , Y(I)) AND RETURNS THE +// TRANSFORM COEFFICIENTS AT (X(I), Y(I)). +// DESCRIPTION +// AR1DFT IS A HIGHLY MODULAR ROUTINE CAPABLE OF COMPUTING IN PLACE +// THE COMPLETE FINITE DISCRETE FOURIER TRANSFORM OF A ONE- +// DIMENSIONAL SEQUENCE OF RATHER GENERAL LENGTH N. +// THE MAIN ROUTINE , AR1DFT ITSELF, FACTORS N. IT THEN CALLS ON +// ON GR 1D FT TO COMPUTE THE ACTUAL TRANSFORMS, USING THESE FACTORS. +// THIS GR 1D FT DOES, CALLING AT EACH STAGE ON THE APPROPRIATE KERN +// EL R2FTK, R4FTK, R8FTK, R16FTK, R3FTK, R5FTK, OR RPFTK TO PERFORM +// THE COMPUTATIONS FOR THIS PASS OVER THE SEQUENCE, DEPENDING ON +// WHETHER THE CORRESPONDING FACTOR IS 2, 4, 8, 16, 3, 5, OR SOME +// MORE GENERAL PRIME P. WHEN GR1DFT IS FINISHED THE TRANSFORM IS +// COMPUTED, HOWEVER, THE RESULTS ARE STORED IN "DIGITS REVERSED" +// ORDER. AR1DFT THEREFORE, CALLS UPON GR 1S FS TO SORT THEM OUT. +// TO RETURN TO THE FACTORIZATION, SINGLETON HAS POINTED OUT THAT +// THE TRANSFORMS ARE MORE EFFICIENT IF THE SAMPLE SIZE N, IS OF THE +// FORM B*A**2 AND B CONSISTS OF A SINGLE FACTOR. IN SUCH A CASE +// IF WE PROCESS THE FACTORS IN THE ORDER ABA THEN +// THE REORDERING CAN BE DONE AS FAST IN PLACE, AS WITH SCRATCH +// STORAGE. BUT AS B BECOMES MORE COMPLICATED, THE COST OF THE DIGIT +// REVERSING DUE TO B PART BECOMES VERY EXPENSIVE IF WE TRY TO DO IT +// IN PLACE. IN SUCH A CASE IT MIGHT BE BETTER TO USE EXTRA STORAGE +// A ROUTINE TO DO THIS IS, HOWEVER, NOT INCLUDED HERE. +// ANOTHER FEATURE INFLUENCING THE FACTORIZATION IS THAT FOR ANY FIXED +// FACTOR N WE CAN PREPARE A SPECIAL KERNEL WHICH WILL COMPUTE +// THAT STAGE OF THE TRANSFORM MORE EFFICIENTLY THAN WOULD A KERNEL +// FOR GENERAL FACTORS, ESPECIALLY IF THE GENERAL KERNEL HAD TO BE +// APPLIED SEVERAL TIMES. FOR EXAMPLE, FACTORS OF 4 ARE MORE +// EFFICIENT THAN FACTORS OF 2, FACTORS OF 8 MORE EFFICIENT THAN 4,ETC +// ON THE OTHER HAND DIMINISHING RETURNS RAPIDLY SET IN, ESPECIALLY +// SINCE THE LENGTH OF THE KERNEL FOR A SPECIAL CASE IS ROUGHLY +// PROPORTIONAL TO THE FACTOR IT DEALS WITH. HENCE THESE PROBABLY ARE +// ALL THE KERNELS WE WISH TO HAVE. +// RESTRICTIONS. +// AN UNFORTUNATE FEATURE OF THE SORTING PROBLEM IS THAT THE MOST +// EFFICIENT WAY TO DO IT IS WITH NESTED DO LOOPS, ONE FOR EACH +// FACTOR. THIS PUTS A RESTRICTION ON N AS TO HOW MANY FACTORS IT +// CAN HAVE. CURRENTLY THE LIMIT IS 16, BUT THE LIMIT CAN BE READILY +// RAISED IF NECESSARY. +// A SECOND RESTRICTION OF THE PROGRAM IS THAT LOCAL STORAGE OF THE +// THE ORDER P**2 IS REQUIRED BY THE GENERAL KERNEL RPFTK, SO SOME +// LIMIT MUST BE SET ON P. CURRENTLY THIS IS 19, BUT IT CAN BE INCRE +// INCREASED BY TRIVIAL CHANGES. +// OTHER COMMENTS. +//(1) THE ROUTINE IS ADAPTED TO CHECK WHETHER A GIVEN N WILL MEET THE +// ABOVE FACTORING REQUIREMENTS AN, IF NOT, TO RETURN THE NEXT HIGHER +// NUMBER, NX, SAY, WHICH WILL MEET THESE REQUIREMENTS. +// THIS CAN BE ACCHIEVED BY A STATEMENT OF THE FORM +// CALL FACTR(N,X,Y). +// IF A DIFFERENT N, SAY NX, IS RETURNED THEN THE TRANSFORMS COULD BE +// OBTAINED BY EXTENDING THE SIZE OF THE X-ARRAY AND Y-ARRAY TO NX, +// AND SETTING X(I) = Y(I) = 0., FOR I = N+1, NX. +//(2) IF THE SEQUENCE Z IS ONLY A REAL SEQUENCE, THEN THE IMAGINARY PART +// Y(I)=0., THIS WILL RETURN THE COSINE TRANSFORM OF THE REAL SEQUENCE +// IN X, AND THE SINE TRANSFORM IN Y. + + +#define WANT_STREAM + +#define WANT_MATH + +#include "newmatap.h" + +#ifdef use_namespace +namespace NEWMAT { +#endif + +#ifdef DO_REPORT +#define REPORT { static ExeCounter ExeCount(__LINE__,20); ++ExeCount; } +#else +#define REPORT {} +#endif + +inline Real square(Real x) { return x*x; } +inline int square(int x) { return x*x; } + +static void GR_1D_FS (int PTS, int N_SYM, int N_UN_SYM, + const SimpleIntArray& SYM, int P_SYM, const SimpleIntArray& UN_SYM, + Real* X, Real* Y); +static void GR_1D_FT (int N, int N_FACTOR, const SimpleIntArray& FACTOR, + Real* X, Real* Y); +static void R_P_FTK (int N, int M, int P, Real* X, Real* Y); +static void R_2_FTK (int N, int M, Real* X0, Real* Y0, Real* X1, Real* Y1); +static void R_3_FTK (int N, int M, Real* X0, Real* Y0, Real* X1, Real* Y1, + Real* X2, Real* Y2); +static void R_4_FTK (int N, int M, + Real* X0, Real* Y0, Real* X1, Real* Y1, + Real* X2, Real* Y2, Real* X3, Real* Y3); +static void R_5_FTK (int N, int M, + Real* X0, Real* Y0, Real* X1, Real* Y1, Real* X2, Real* Y2, + Real* X3, Real* Y3, Real* X4, Real* Y4); +static void R_8_FTK (int N, int M, + Real* X0, Real* Y0, Real* X1, Real* Y1, + Real* X2, Real* Y2, Real* X3, Real* Y3, + Real* X4, Real* Y4, Real* X5, Real* Y5, + Real* X6, Real* Y6, Real* X7, Real* Y7); +static void R_16_FTK (int N, int M, + Real* X0, Real* Y0, Real* X1, Real* Y1, + Real* X2, Real* Y2, Real* X3, Real* Y3, + Real* X4, Real* Y4, Real* X5, Real* Y5, + Real* X6, Real* Y6, Real* X7, Real* Y7, + Real* X8, Real* Y8, Real* X9, Real* Y9, + Real* X10, Real* Y10, Real* X11, Real* Y11, + Real* X12, Real* Y12, Real* X13, Real* Y13, + Real* X14, Real* Y14, Real* X15, Real* Y15); +static int BitReverse(int x, int prod, int n, const SimpleIntArray& f); + + +bool FFT_Controller::ar_1d_ft (int PTS, Real* X, Real *Y) +{ +// ARBITRARY RADIX ONE DIMENSIONAL FOURIER TRANSFORM + + REPORT + + int F,J,N,NF,P,PMAX,P_SYM,P_TWO,Q,R,TWO_GRP; + + // NP is maximum number of squared factors allows PTS up to 2**32 at least + // NQ is number of not-squared factors - increase if we increase PMAX + const int NP = 16, NQ = 10; + SimpleIntArray PP(NP), QQ(NQ); + + TWO_GRP=16; PMAX=19; + + // PMAX is the maximum factor size + // TWO_GRP is the maximum power of 2 handled as a single factor + // Doesn't take advantage of combining powers of 2 when calculating + // number of factors + + if (PTS<=1) return true; + N=PTS; P_SYM=1; F=2; P=0; Q=0; + + // P counts the number of squared factors + // Q counts the number of the rest + // R = 0 for no non-squared factors; 1 otherwise + + // FACTOR holds all the factors - non-squared ones in the middle + // - length is 2*P+Q + // SYM also holds all the factors but with the non-squared ones + // multiplied together - length is 2*P+R + // PP holds the values of the squared factors - length is P + // QQ holds the values of the rest - length is Q + + // P_SYM holds the product of the squared factors + + // find the factors - load into PP and QQ + while (N > 1) + { + bool fail = true; + for (J=F; J<=PMAX; J++) + if (N % J == 0) { fail = false; F=J; break; } + if (fail || P >= NP || Q >= NQ) return false; // can't factor + N /= F; + if (N % F != 0) QQ[Q++] = F; + else { N /= F; PP[P++] = F; P_SYM *= F; } + } + + R = (Q == 0) ? 0 : 1; // R = 0 if no not-squared factors, 1 otherwise + + NF = 2*P + Q; + SimpleIntArray FACTOR(NF + 1), SYM(2*P + R); + FACTOR[NF] = 0; // we need this in the "combine powers of 2" + + // load into SYM and FACTOR + for (J=0; J0) + { + REPORT + for (J=0; J 0) + { + REPORT + SimpleIntArray U(N_SYM); + for(MultiRadixCounter MRC(N_SYM, SYM, U); !MRC.Finish(); ++MRC) + { + if (MRC.Swap()) + { + int P = MRC.Reverse(); int JJ = MRC.Counter(); Real T; + T=X[JJ]; X[JJ]=X[P]; X[P]=T; T=Y[JJ]; Y[JJ]=Y[P]; Y[P]=T; + } + } + } + + int J,JL,K,L,M,MS; + + // UN_SYM contains the non-squared factors + // I have replaced the Sande-Gentleman code as it runs into + // integer overflow problems + // My code (and theirs) would be improved by using a bit array + // as suggested by Van Loan + + if (N_UN_SYM==0) { REPORT return; } + P_UN_SYM=PTS/square(P_SYM); JL=(P_UN_SYM-3)*P_SYM; MS=P_UN_SYM*P_SYM; + + for (J = P_SYM; J<=JL; J+=P_SYM) + { + K=J; + do K = P_SYM * BitReverse(K / P_SYM, P_UN_SYM, N_UN_SYM, UN_SYM); + while (K 1) + { + bool fail = true; + for (int J = F; J <= PMAX; J++) + if (N % J == 0) { fail = false; F=J; break; } + if (fail || P >= NP || Q >= NQ) { REPORT return false; } + N /= F; + if (N % F != 0) Q++; else { N /= F; P++; } + } + + return true; // can factorise + +} + +bool FFT_Controller::OnlyOldFFT; // static variable + +// **************************** multi radix counter ********************** + +MultiRadixCounter::MultiRadixCounter(int nx, const SimpleIntArray& rx, + SimpleIntArray& vx) + : Radix(rx), Value(vx), n(nx), reverse(0), + product(1), counter(0), finish(false) +{ + REPORT for (int k = 0; k < n; k++) { Value[k] = 0; product *= Radix[k]; } +} + +void MultiRadixCounter::operator++() +{ + REPORT + counter++; int p = product; + for (int k = 0; k < n; k++) + { + Value[k]++; int p1 = p / Radix[k]; reverse += p1; + if (Value[k] == Radix[k]) { REPORT Value[k] = 0; reverse -= p; p = p1; } + else { REPORT return; } + } + finish = true; +} + + +static int BitReverse(int x, int prod, int n, const SimpleIntArray& f) +{ + // x = c[0]+f[0]*(c[1]+f[1]*(c[2]+... + // return c[n-1]+f[n-1]*(c[n-2]+f[n-2]*(c[n-3]+... + // prod is the product of the f[i] + // n is the number of f[i] (don't assume f has the correct length) + + REPORT + const int* d = f.Data() + n; int sum = 0; int q = 1; + while (n--) + { + prod /= *(--d); + int c = x / prod; x-= c * prod; + sum += q * c; q *= *d; + } + return sum; +} + + +#ifdef use_namespace +} +#endif + +///@} + diff --git a/extern/newmat/newmat.h b/extern/newmat/newmat.h new file mode 100644 index 00000000..0c6ec2c7 --- /dev/null +++ b/extern/newmat/newmat.h @@ -0,0 +1,2253 @@ +/// \defgroup newmat Newmat matrix manipulation library +///@{ + +/// \file newmat.h +/// Definition file for matrix library. + +// Copyright (C) 2004: R B Davies + +#ifndef NEWMAT_LIB +#define NEWMAT_LIB 0 + +#include "include.h" + +#include "myexcept.h" + + +#ifdef use_namespace +namespace NEWMAT { using namespace RBD_COMMON; } +namespace RBD_LIBRARIES { using namespace NEWMAT; } +namespace NEWMAT { +#endif + +//#define DO_REPORT // to activate REPORT + +#ifdef NO_LONG_NAMES +#define UpperTriangularMatrix UTMatrix +#define LowerTriangularMatrix LTMatrix +#define SymmetricMatrix SMatrix +#define DiagonalMatrix DMatrix +#define BandMatrix BMatrix +#define UpperBandMatrix UBMatrix +#define LowerBandMatrix LBMatrix +#define SymmetricBandMatrix SBMatrix +#define BandLUMatrix BLUMatrix +#endif + +// ************************** general utilities ****************************/ + +class GeneralMatrix; // defined later +class BaseMatrix; // defined later +class MatrixInput; // defined later + +void MatrixErrorNoSpace(const void*); ///< test for allocation fails + +/// Return from LogDeterminant function. +/// Members are the log of the absolute value and the sign (+1, -1 or 0) +class LogAndSign +{ + Real log_val; + int sign_val; +public: + LogAndSign() { log_val=0.0; sign_val=1; } + LogAndSign(Real); + void operator*=(Real); ///< multiply by a real + void pow_eq(int k); ///< raise to power of k + void PowEq(int k) { pow_eq(k); } + void ChangeSign() { sign_val = -sign_val; } + void change_sign() { sign_val = -sign_val; } ///< change sign + Real LogValue() const { return log_val; } + Real log_value() const { return log_val; } ///< log of the absolute value + int Sign() const { return sign_val; } + int sign() const { return sign_val; } ///< sign of the value + Real value() const; ///< the value + Real Value() const { return value(); } + FREE_CHECK(LogAndSign) +}; + +// the following class is for counting the number of times a piece of code +// is executed. It is used for locating any code not executed by test +// routines. Use turbo GREP locate all places this code is called and +// check which ones are not accessed. +// Somewhat implementation dependent as it relies on "cout" still being +// present when ExeCounter objects are destructed. + +#ifdef DO_REPORT + +class ExeCounter +{ + int line; // code line number + int fileid; // file identifier + long nexe; // number of executions + static int nreports; // number of reports +public: + ExeCounter(int,int); + void operator++() { nexe++; } + ~ExeCounter(); // prints out reports +}; + +#endif + + +// ************************** class MatrixType ***************************** + +/// Find the type of a matrix resulting from matrix operations. +/// Also identify what conversions are permissible. +/// This class must be updated when new matrix types are added. + +class MatrixType +{ +public: + enum Attribute { Valid = 1, + Diagonal = 2, // order of these is important + Symmetric = 4, + Band = 8, + Lower = 16, + Upper = 32, + Square = 64, + Skew = 128, + LUDeco = 256, + Ones = 512 }; + + enum { US = 0, + UT = Valid + Upper + Square, + LT = Valid + Lower + Square, + Rt = Valid, + Sq = Valid + Square, + Sm = Valid + Symmetric + Square, + Sk = Valid + Skew + Square, + Dg = Valid + Diagonal + Band + Lower + Upper + Symmetric + + Square, + Id = Valid + Diagonal + Band + Lower + Upper + Symmetric + + Square + Ones, + RV = Valid, // do not separate out + CV = Valid, // vectors + BM = Valid + Band + Square, + UB = Valid + Band + Upper + Square, + LB = Valid + Band + Lower + Square, + SB = Valid + Band + Symmetric + Square, + KB = Valid + Band + Skew + Square, + Ct = Valid + LUDeco + Square, + BC = Valid + Band + LUDeco + Square, + Mask = ~Square + }; + + + static int nTypes() { return 13; } // number of different types + // exclude Ct, US, BC +public: + int attribute; + bool DataLossOK; // true if data loss is OK when + // this represents a destination +public: + MatrixType () : DataLossOK(false) {} + MatrixType (int i) : attribute(i), DataLossOK(false) {} + MatrixType (int i, bool dlok) : attribute(i), DataLossOK(dlok) {} + MatrixType (const MatrixType& mt) + : attribute(mt.attribute), DataLossOK(mt.DataLossOK) {} + void operator=(const MatrixType& mt) + { attribute = mt.attribute; DataLossOK = mt.DataLossOK; } + void SetDataLossOK() { DataLossOK = true; } + int operator+() const { return attribute; } + MatrixType operator+(MatrixType mt) const + { return MatrixType(attribute & mt.attribute); } + MatrixType operator*(const MatrixType&) const; + MatrixType SP(const MatrixType&) const; + MatrixType KP(const MatrixType&) const; + MatrixType operator|(const MatrixType& mt) const + { return MatrixType(attribute & mt.attribute & Valid); } + MatrixType operator&(const MatrixType& mt) const + { return MatrixType(attribute & mt.attribute & Valid); } + bool operator>=(MatrixType mt) const + { return ( attribute & ~mt.attribute & Mask ) == 0; } + bool operator<(MatrixType mt) const // for MS Visual C++ 4 + { return ( attribute & ~mt.attribute & Mask ) != 0; } + bool operator==(MatrixType t) const + { return (attribute == t.attribute); } + bool operator!=(MatrixType t) const + { return (attribute != t.attribute); } + bool operator!() const { return (attribute & Valid) == 0; } + MatrixType i() const; ///< type of inverse + MatrixType t() const; ///< type of transpose + MatrixType AddEqualEl() const ///< add constant to matrix + { return MatrixType(attribute & (Valid + Symmetric + Square)); } + MatrixType MultRHS() const; ///< type for rhs of multiply + MatrixType sub() const ///< type of submatrix + { return MatrixType(attribute & Valid); } + MatrixType ssub() const ///< type of sym submatrix + { return MatrixType(attribute); } // not for selection matrix + GeneralMatrix* New() const; ///< new matrix of given type + GeneralMatrix* New(int,int,BaseMatrix*) const; + ///< new matrix of given type + const char* value() const; ///< type as char string + const char* Value() const { return value(); } + friend bool Rectangular(MatrixType a, MatrixType b, MatrixType c); + friend bool Compare(const MatrixType&, MatrixType&); + ///< compare and check conversion + bool is_band() const { return (attribute & Band) != 0; } + bool is_diagonal() const { return (attribute & Diagonal) != 0; } + bool is_symmetric() const { return (attribute & Symmetric) != 0; } + bool CannotConvert() const { return (attribute & LUDeco) != 0; } + // used by operator== + FREE_CHECK(MatrixType) +}; + + +// *********************** class MatrixBandWidth ***********************/ + +///Upper and lower bandwidths of a matrix. +///That is number of diagonals strictly above or below main diagonal, +///e.g. diagonal matrix has 0 upper and lower bandwiths. +///-1 means the matrix may have the maximum bandwidth. +class MatrixBandWidth +{ +public: + int lower_val; + int upper_val; + MatrixBandWidth(const int l, const int u) : lower_val(l), upper_val(u) {} + MatrixBandWidth(const int i) : lower_val(i), upper_val(i) {} + MatrixBandWidth operator+(const MatrixBandWidth&) const; + MatrixBandWidth operator*(const MatrixBandWidth&) const; + MatrixBandWidth minimum(const MatrixBandWidth&) const; + MatrixBandWidth t() const { return MatrixBandWidth(upper_val,lower_val); } + bool operator==(const MatrixBandWidth& bw) const + { return (lower_val == bw.lower_val) && (upper_val == bw.upper_val); } + bool operator!=(const MatrixBandWidth& bw) const { return !operator==(bw); } + int Upper() const { return upper_val; } + int upper() const { return upper_val; } + int Lower() const { return lower_val; } + int lower() const { return lower_val; } + FREE_CHECK(MatrixBandWidth) +}; + + +// ********************* Array length specifier ************************/ + +/// This class is used to avoid constructors such as +/// ColumnVector(int) being used for conversions. +/// Eventually this should be replaced by the use of the keyword "explicit". + +class ArrayLengthSpecifier +{ + int v; +public: + int Value() const { return v; } + int value() const { return v; } + ArrayLengthSpecifier(int l) : v(l) {} +}; + +// ************************* Matrix routines ***************************/ + + +class MatrixRowCol; // defined later +class MatrixRow; +class MatrixCol; +class MatrixColX; + +class GeneralMatrix; // defined later +class AddedMatrix; +class MultipliedMatrix; +class SubtractedMatrix; +class SPMatrix; +class KPMatrix; +class ConcatenatedMatrix; +class StackedMatrix; +class SolvedMatrix; +class ShiftedMatrix; +class NegShiftedMatrix; +class ScaledMatrix; +class TransposedMatrix; +class ReversedMatrix; +class NegatedMatrix; +class InvertedMatrix; +class RowedMatrix; +class ColedMatrix; +class DiagedMatrix; +class MatedMatrix; +class GetSubMatrix; +class ReturnMatrix; +class Matrix; +class SquareMatrix; +class nricMatrix; +class RowVector; +class ColumnVector; +class SymmetricMatrix; +class UpperTriangularMatrix; +class LowerTriangularMatrix; +class DiagonalMatrix; +class CroutMatrix; +class BandMatrix; +class LowerBandMatrix; +class UpperBandMatrix; +class SymmetricBandMatrix; +class LinearEquationSolver; +class GenericMatrix; + + +#define MatrixTypeUnSp 0 +//static MatrixType MatrixTypeUnSp(MatrixType::US); +// // AT&T needs this + +/// Base of the matrix classes. +class BaseMatrix : public Janitor +{ +protected: + virtual int search(const BaseMatrix*) const = 0; + // count number of times matrix is referred to +public: + virtual GeneralMatrix* Evaluate(MatrixType mt=MatrixTypeUnSp) = 0; + // evaluate temporary + // for old version of G++ + // virtual GeneralMatrix* Evaluate(MatrixType mt) = 0; + // GeneralMatrix* Evaluate() { return Evaluate(MatrixTypeUnSp); } + AddedMatrix operator+(const BaseMatrix&) const; // results of operations + MultipliedMatrix operator*(const BaseMatrix&) const; + SubtractedMatrix operator-(const BaseMatrix&) const; + ConcatenatedMatrix operator|(const BaseMatrix&) const; + StackedMatrix operator&(const BaseMatrix&) const; + ShiftedMatrix operator+(Real) const; + ScaledMatrix operator*(Real) const; + ScaledMatrix operator/(Real) const; + ShiftedMatrix operator-(Real) const; + TransposedMatrix t() const; +// TransposedMatrix t; + NegatedMatrix operator-() const; // change sign of elements + ReversedMatrix reverse() const; + ReversedMatrix Reverse() const; + InvertedMatrix i() const; +// InvertedMatrix i; + RowedMatrix as_row() const; + RowedMatrix AsRow() const; + ColedMatrix as_column() const; + ColedMatrix AsColumn() const; + DiagedMatrix as_diagonal() const; + DiagedMatrix AsDiagonal() const; + MatedMatrix as_matrix(int,int) const; + MatedMatrix AsMatrix(int m, int n) const; + GetSubMatrix submatrix(int,int,int,int) const; + GetSubMatrix SubMatrix(int fr, int lr, int fc, int lc) const; + GetSubMatrix sym_submatrix(int,int) const; + GetSubMatrix SymSubMatrix(int f, int l) const; + GetSubMatrix row(int) const; + GetSubMatrix rows(int,int) const; + GetSubMatrix column(int) const; + GetSubMatrix columns(int,int) const; + GetSubMatrix Row(int f) const; + GetSubMatrix Rows(int f, int l) const; + GetSubMatrix Column(int f) const; + GetSubMatrix Columns(int f, int l) const; + Real as_scalar() const; // conversion of 1 x 1 matrix + Real AsScalar() const; + virtual LogAndSign log_determinant() const; + LogAndSign LogDeterminant() const { return log_determinant(); } + Real determinant() const; + Real Determinant() const { return determinant(); } + virtual Real sum_square() const; + Real SumSquare() const { return sum_square(); } + Real norm_Frobenius() const; + Real norm_frobenius() const { return norm_Frobenius(); } + Real NormFrobenius() const { return norm_Frobenius(); } + virtual Real sum_absolute_value() const; + Real SumAbsoluteValue() const { return sum_absolute_value(); } + virtual Real sum() const; + virtual Real Sum() const { return sum(); } + virtual Real maximum_absolute_value() const; + Real MaximumAbsoluteValue() const { return maximum_absolute_value(); } + virtual Real maximum_absolute_value1(int& i) const; + Real MaximumAbsoluteValue1(int& i) const + { return maximum_absolute_value1(i); } + virtual Real maximum_absolute_value2(int& i, int& j) const; + Real MaximumAbsoluteValue2(int& i, int& j) const + { return maximum_absolute_value2(i,j); } + virtual Real minimum_absolute_value() const; + Real MinimumAbsoluteValue() const { return minimum_absolute_value(); } + virtual Real minimum_absolute_value1(int& i) const; + Real MinimumAbsoluteValue1(int& i) const + { return minimum_absolute_value1(i); } + virtual Real minimum_absolute_value2(int& i, int& j) const; + Real MinimumAbsoluteValue2(int& i, int& j) const + { return minimum_absolute_value2(i,j); } + virtual Real maximum() const; + Real Maximum() const { return maximum(); } + virtual Real maximum1(int& i) const; + Real Maximum1(int& i) const { return maximum1(i); } + virtual Real maximum2(int& i, int& j) const; + Real Maximum2(int& i, int& j) const { return maximum2(i,j); } + virtual Real minimum() const; + Real Minimum() const { return minimum(); } + virtual Real minimum1(int& i) const; + Real Minimum1(int& i) const { return minimum1(i); } + virtual Real minimum2(int& i, int& j) const; + Real Minimum2(int& i, int& j) const { return minimum2(i,j); } + virtual Real trace() const; + Real Trace() const { return trace(); } + Real norm1() const; + Real Norm1() const { return norm1(); } + Real norm_infinity() const; + Real NormInfinity() const { return norm_infinity(); } + virtual MatrixBandWidth bandwidth() const; // bandwidths of band matrix + virtual MatrixBandWidth BandWidth() const { return bandwidth(); } + void IEQND() const; // called by ineq. ops + ReturnMatrix sum_square_columns() const; + ReturnMatrix sum_square_rows() const; + ReturnMatrix sum_columns() const; + ReturnMatrix sum_rows() const; + virtual void cleanup() {} + void CleanUp() { cleanup(); } + +// virtual ReturnMatrix Reverse() const; // reverse order of elements +//protected: +// BaseMatrix() : t(this), i(this) {} + + friend class GeneralMatrix; + friend class Matrix; + friend class SquareMatrix; + friend class nricMatrix; + friend class RowVector; + friend class ColumnVector; + friend class SymmetricMatrix; + friend class UpperTriangularMatrix; + friend class LowerTriangularMatrix; + friend class DiagonalMatrix; + friend class CroutMatrix; + friend class BandMatrix; + friend class LowerBandMatrix; + friend class UpperBandMatrix; + friend class SymmetricBandMatrix; + friend class AddedMatrix; + friend class MultipliedMatrix; + friend class SubtractedMatrix; + friend class SPMatrix; + friend class KPMatrix; + friend class ConcatenatedMatrix; + friend class StackedMatrix; + friend class SolvedMatrix; + friend class ShiftedMatrix; + friend class NegShiftedMatrix; + friend class ScaledMatrix; + friend class TransposedMatrix; + friend class ReversedMatrix; + friend class NegatedMatrix; + friend class InvertedMatrix; + friend class RowedMatrix; + friend class ColedMatrix; + friend class DiagedMatrix; + friend class MatedMatrix; + friend class GetSubMatrix; + friend class ReturnMatrix; + friend class LinearEquationSolver; + friend class GenericMatrix; + NEW_DELETE(BaseMatrix) +}; + + +// ***************************** working classes **************************/ + +/// The classes for matrices that can contain data are derived from this. +class GeneralMatrix : public BaseMatrix // declarable matrix types +{ +protected: + int tag_val; // shows whether can reuse + int nrows_val, ncols_val; // dimensions + int storage; // total store required + Real* store; // point to store (0=not set) + GeneralMatrix(); // initialise with no store + GeneralMatrix(ArrayLengthSpecifier); // constructor getting store + void Add(GeneralMatrix*, Real); // sum of GM and Real + void Add(Real); // add Real to this + void NegAdd(GeneralMatrix*, Real); // Real - GM + void NegAdd(Real); // this = this - Real + void Multiply(GeneralMatrix*, Real); // product of GM and Real + void Multiply(Real); // multiply this by Real + void Negate(GeneralMatrix*); // change sign + void Negate(); // change sign + void ReverseElements(); // internal reverse of elements + void ReverseElements(GeneralMatrix*); // reverse order of elements + Real* GetStore(); // get store or copy + GeneralMatrix* BorrowStore(GeneralMatrix*, MatrixType); + // temporarily access store + void GetMatrix(const GeneralMatrix*); // used by = and initialise + int search(const BaseMatrix*) const; + virtual GeneralMatrix* Transpose(TransposedMatrix*, MatrixType); + void CheckConversion(const BaseMatrix&); // check conversion OK + void resize(int, int, int); // change dimensions + virtual short SimpleAddOK(const GeneralMatrix*) { return 0; } + // see bandmat.cpp for explanation + virtual void MiniCleanUp() + { store = 0; storage = 0; nrows_val = 0; ncols_val = 0; tag_val = -1;} + // CleanUp when the data array has already been deleted + void PlusEqual(const GeneralMatrix& gm); + void SP_Equal(const GeneralMatrix& gm); + void MinusEqual(const GeneralMatrix& gm); + void PlusEqual(Real f); + void MinusEqual(Real f); + void swap(GeneralMatrix& gm); // swap values +public: + GeneralMatrix* Evaluate(MatrixType mt=MatrixTypeUnSp); + void Eq(const BaseMatrix&, MatrixType); // used by = + void Eq(const GeneralMatrix&); // version with no conversion + void Eq(const BaseMatrix&, MatrixType, bool);// used by << + void Eq2(const BaseMatrix&, MatrixType); // cut down version of Eq + virtual MatrixType type() const = 0; // type of a matrix + MatrixType Type() const { return type(); } + int Nrows() const { return nrows_val; } // get dimensions + int Ncols() const { return ncols_val; } + int Storage() const { return storage; } + Real* Store() const { return store; } + // updated names + int nrows() const { return nrows_val; } // get dimensions + int ncols() const { return ncols_val; } + int size() const { return storage; } + Real* data() { return store; } + const Real* data() const { return store; } + const Real* const_data() const { return store; } + void operator=(Real); // set matrix to constant + virtual ~GeneralMatrix(); // delete store if set + void tDelete(); // delete if tag_val permits + bool reuse(); // true if tag_val allows reuse + void protect() { tag_val=-1; } // cannot delete or reuse + void Protect() { tag_val=-1; } // cannot delete or reuse + int tag() const { return tag_val; } + int Tag() const { return tag_val; } + bool is_zero() const; // test matrix has all zeros + bool IsZero() const { return is_zero(); } // test matrix has all zeros + void Release() { tag_val=1; } // del store after next use + void Release(int t) { tag_val=t; } // del store after t accesses + void ReleaseAndDelete() { tag_val=0; } // delete matrix after use + void release() { tag_val=1; } // del store after next use + void release(int t) { tag_val=t; } // del store after t accesses + void release_and_delete() { tag_val=0; } // delete matrix after use + void operator<<(const double*); // assignment from an array + void operator<<(const float*); // assignment from an array + void operator<<(const int*); // assignment from an array + void operator<<(const BaseMatrix& X) + { Eq(X,this->type(),true); } // = without checking type + void inject(const GeneralMatrix&); // copy stored els only + void Inject(const GeneralMatrix& GM) { inject(GM); } + void operator+=(const BaseMatrix&); + void SP_eq(const BaseMatrix&); + void operator-=(const BaseMatrix&); + void operator*=(const BaseMatrix&); + void operator|=(const BaseMatrix&); + void operator&=(const BaseMatrix&); + void operator+=(Real); + void operator-=(Real r) { operator+=(-r); } + void operator*=(Real); + void operator/=(Real r) { operator*=(1.0/r); } + virtual GeneralMatrix* MakeSolver(); // for solving + virtual void Solver(MatrixColX&, const MatrixColX&) {} + virtual void GetRow(MatrixRowCol&) = 0; // Get matrix row + virtual void RestoreRow(MatrixRowCol&) {} // Restore matrix row + virtual void NextRow(MatrixRowCol&); // Go to next row + virtual void GetCol(MatrixRowCol&) = 0; // Get matrix col + virtual void GetCol(MatrixColX&) = 0; // Get matrix col + virtual void RestoreCol(MatrixRowCol&) {} // Restore matrix col + virtual void RestoreCol(MatrixColX&) {} // Restore matrix col + virtual void NextCol(MatrixRowCol&); // Go to next col + virtual void NextCol(MatrixColX&); // Go to next col + Real sum_square() const; + Real sum_absolute_value() const; + Real sum() const; + Real maximum_absolute_value1(int& i) const; + Real minimum_absolute_value1(int& i) const; + Real maximum1(int& i) const; + Real minimum1(int& i) const; + Real maximum_absolute_value() const; + Real maximum_absolute_value2(int& i, int& j) const; + Real minimum_absolute_value() const; + Real minimum_absolute_value2(int& i, int& j) const; + Real maximum() const; + Real maximum2(int& i, int& j) const; + Real minimum() const; + Real minimum2(int& i, int& j) const; + LogAndSign log_determinant() const; + virtual bool IsEqual(const GeneralMatrix&) const; + // same type, same values + void CheckStore() const; // check store is non-zero + virtual void SetParameters(const GeneralMatrix*) {} + // set parameters in GetMatrix + operator ReturnMatrix() const; // for building a ReturnMatrix + ReturnMatrix for_return() const; + ReturnMatrix ForReturn() const; + //virtual bool SameStorageType(const GeneralMatrix& A) const; + //virtual void ReSizeForAdd(const GeneralMatrix& A, const GeneralMatrix& B); + //virtual void ReSizeForSP(const GeneralMatrix& A, const GeneralMatrix& B); + virtual void resize(const GeneralMatrix& A); + virtual void ReSize(const GeneralMatrix& A) { resize(A); } + MatrixInput operator<<(double); // for loading a list + MatrixInput operator<<(float); // for loading a list + MatrixInput operator<<(int f); +// ReturnMatrix Reverse() const; // reverse order of elements + void cleanup(); // to clear store + virtual GeneralMatrix* Image() const; // copy of matrix + + friend class Matrix; + friend class SquareMatrix; + friend class nricMatrix; + friend class SymmetricMatrix; + friend class UpperTriangularMatrix; + friend class LowerTriangularMatrix; + friend class DiagonalMatrix; + friend class CroutMatrix; + friend class RowVector; + friend class ColumnVector; + friend class BandMatrix; + friend class LowerBandMatrix; + friend class UpperBandMatrix; + friend class SymmetricBandMatrix; + friend class BaseMatrix; + friend class AddedMatrix; + friend class MultipliedMatrix; + friend class SubtractedMatrix; + friend class SPMatrix; + friend class KPMatrix; + friend class ConcatenatedMatrix; + friend class StackedMatrix; + friend class SolvedMatrix; + friend class ShiftedMatrix; + friend class NegShiftedMatrix; + friend class ScaledMatrix; + friend class TransposedMatrix; + friend class ReversedMatrix; + friend class NegatedMatrix; + friend class InvertedMatrix; + friend class RowedMatrix; + friend class ColedMatrix; + friend class DiagedMatrix; + friend class MatedMatrix; + friend class GetSubMatrix; + friend class ReturnMatrix; + friend class LinearEquationSolver; + friend class GenericMatrix; + NEW_DELETE(GeneralMatrix) +}; + + +/// The usual rectangular matrix. +class Matrix : public GeneralMatrix +{ +public: + Matrix() {} + ~Matrix() {} + Matrix(int, int); // standard declaration + Matrix(const BaseMatrix&); // evaluate BaseMatrix + void operator=(const BaseMatrix&); + void operator=(Real f) { GeneralMatrix::operator=(f); } + void operator=(const Matrix& m) { Eq(m); } + MatrixType type() const; + Real& operator()(int, int); // access element + Real& element(int, int); // access element + Real operator()(int, int) const; // access element + Real element(int, int) const; // access element +#ifdef SETUP_C_SUBSCRIPTS + Real* operator[](int m) { return store+m*ncols_val; } + const Real* operator[](int m) const { return store+m*ncols_val; } + // following for Numerical Recipes in C++ + Matrix(Real, int, int); + Matrix(const Real*, int, int); +#endif + Matrix(const Matrix& gm) : GeneralMatrix() { GetMatrix(&gm); } + GeneralMatrix* MakeSolver(); + Real trace() const; + void GetRow(MatrixRowCol&); + void GetCol(MatrixRowCol&); + void GetCol(MatrixColX&); + void RestoreCol(MatrixRowCol&); + void RestoreCol(MatrixColX&); + void NextRow(MatrixRowCol&); + void NextCol(MatrixRowCol&); + void NextCol(MatrixColX&); + virtual void resize(int,int); // change dimensions + // virtual so we will catch it being used in a vector called as a matrix + virtual void resize_keep(int,int); + virtual void ReSize(int m, int n) { resize(m, n); } + void resize(const GeneralMatrix& A); + void ReSize(const GeneralMatrix& A) { resize(A); } + Real maximum_absolute_value2(int& i, int& j) const; + Real minimum_absolute_value2(int& i, int& j) const; + Real maximum2(int& i, int& j) const; + Real minimum2(int& i, int& j) const; + void operator+=(const Matrix& M) { PlusEqual(M); } + void SP_eq(const Matrix& M) { SP_Equal(M); } + void operator-=(const Matrix& M) { MinusEqual(M); } + void operator+=(const BaseMatrix& M) { GeneralMatrix::operator+=(M); } + void SP_eq(const BaseMatrix& M) { GeneralMatrix::SP_eq(M); } + void operator-=(const BaseMatrix& M) { GeneralMatrix::operator-=(M); } + void operator+=(Real f) { GeneralMatrix::Add(f); } + void operator-=(Real f) { GeneralMatrix::Add(-f); } + void swap(Matrix& gm) { GeneralMatrix::swap((GeneralMatrix&)gm); } + GeneralMatrix* Image() const; // copy of matrix + friend Real dotproduct(const Matrix& A, const Matrix& B); + NEW_DELETE(Matrix) +}; + +/// Square matrix. +class SquareMatrix : public Matrix +{ +public: + SquareMatrix() {} + ~SquareMatrix() {} + SquareMatrix(ArrayLengthSpecifier); // standard declaration + SquareMatrix(const BaseMatrix&); // evaluate BaseMatrix + void operator=(const BaseMatrix&); + void operator=(Real f) { GeneralMatrix::operator=(f); } + void operator=(const SquareMatrix& m) { Eq(m); } + void operator=(const Matrix& m); + MatrixType type() const; + SquareMatrix(const SquareMatrix& gm) : Matrix() { GetMatrix(&gm); } + SquareMatrix(const Matrix& gm); + void resize(int); // change dimensions + void ReSize(int m) { resize(m); } + void resize_keep(int); + void resize_keep(int,int); + void resize(int,int); // change dimensions + void ReSize(int m, int n) { resize(m, n); } + void resize(const GeneralMatrix& A); + void ReSize(const GeneralMatrix& A) { resize(A); } + void operator+=(const Matrix& M) { PlusEqual(M); } + void SP_eq(const Matrix& M) { SP_Equal(M); } + void operator-=(const Matrix& M) { MinusEqual(M); } + void operator+=(const BaseMatrix& M) { GeneralMatrix::operator+=(M); } + void SP_eq(const BaseMatrix& M) { GeneralMatrix::SP_eq(M); } + void operator-=(const BaseMatrix& M) { GeneralMatrix::operator-=(M); } + void operator+=(Real f) { GeneralMatrix::Add(f); } + void operator-=(Real f) { GeneralMatrix::Add(-f); } + void swap(SquareMatrix& gm) { GeneralMatrix::swap((GeneralMatrix&)gm); } + GeneralMatrix* Image() const; // copy of matrix + NEW_DELETE(SquareMatrix) +}; + +/// Rectangular matrix for use with Numerical Recipes in C. +class nricMatrix : public Matrix +{ + Real** row_pointer; // points to rows + void MakeRowPointer(); // build rowpointer + void DeleteRowPointer(); +public: + nricMatrix() {} + nricMatrix(int m, int n) // standard declaration + : Matrix(m,n) { MakeRowPointer(); } + nricMatrix(const BaseMatrix& bm) // evaluate BaseMatrix + : Matrix(bm) { MakeRowPointer(); } + void operator=(const BaseMatrix& bm) + { DeleteRowPointer(); Matrix::operator=(bm); MakeRowPointer(); } + void operator=(Real f) { GeneralMatrix::operator=(f); } + void operator=(const nricMatrix& m) + { DeleteRowPointer(); Eq(m); MakeRowPointer(); } + void operator<<(const BaseMatrix& X) + { DeleteRowPointer(); Eq(X,this->type(),true); MakeRowPointer(); } + nricMatrix(const nricMatrix& gm) : Matrix() + { GetMatrix(&gm); MakeRowPointer(); } + void resize(int m, int n) // change dimensions + { DeleteRowPointer(); Matrix::resize(m,n); MakeRowPointer(); } + void resize_keep(int m, int n) // change dimensions + { DeleteRowPointer(); Matrix::resize_keep(m,n); MakeRowPointer(); } + void ReSize(int m, int n) // change dimensions + { DeleteRowPointer(); Matrix::resize(m,n); MakeRowPointer(); } + void resize(const GeneralMatrix& A); + void ReSize(const GeneralMatrix& A) { resize(A); } + ~nricMatrix() { DeleteRowPointer(); } + Real** nric() const { CheckStore(); return row_pointer-1; } + void cleanup(); // to clear store + void MiniCleanUp(); + void operator+=(const Matrix& M) { PlusEqual(M); } + void SP_eq(const Matrix& M) { SP_Equal(M); } + void operator-=(const Matrix& M) { MinusEqual(M); } + void operator+=(const BaseMatrix& M) { GeneralMatrix::operator+=(M); } + void SP_eq(const BaseMatrix& M) { GeneralMatrix::SP_eq(M); } + void operator-=(const BaseMatrix& M) { GeneralMatrix::operator-=(M); } + void operator+=(Real f) { GeneralMatrix::Add(f); } + void operator-=(Real f) { GeneralMatrix::Add(-f); } + void swap(nricMatrix& gm); + GeneralMatrix* Image() const; // copy of matrix + NEW_DELETE(nricMatrix) +}; + +/// Symmetric matrix. +class SymmetricMatrix : public GeneralMatrix +{ +public: + SymmetricMatrix() {} + ~SymmetricMatrix() {} + SymmetricMatrix(ArrayLengthSpecifier); + SymmetricMatrix(const BaseMatrix&); + void operator=(const BaseMatrix&); + void operator=(Real f) { GeneralMatrix::operator=(f); } + void operator=(const SymmetricMatrix& m) { Eq(m); } + Real& operator()(int, int); // access element + Real& element(int, int); // access element + Real operator()(int, int) const; // access element + Real element(int, int) const; // access element +#ifdef SETUP_C_SUBSCRIPTS + Real* operator[](int m) { return store+(m*(m+1))/2; } + const Real* operator[](int m) const { return store+(m*(m+1))/2; } +#endif + MatrixType type() const; + SymmetricMatrix(const SymmetricMatrix& gm) + : GeneralMatrix() { GetMatrix(&gm); } + Real sum_square() const; + Real sum_absolute_value() const; + Real sum() const; + Real trace() const; + void GetRow(MatrixRowCol&); + void GetCol(MatrixRowCol&); + void GetCol(MatrixColX&); + void RestoreCol(MatrixRowCol&) {} + void RestoreCol(MatrixColX&); + GeneralMatrix* Transpose(TransposedMatrix*, MatrixType); + void resize(int); // change dimensions + void ReSize(int m) { resize(m); } + void resize_keep(int); + void resize(const GeneralMatrix& A); + void ReSize(const GeneralMatrix& A) { resize(A); } + void operator+=(const SymmetricMatrix& M) { PlusEqual(M); } + void SP_eq(const SymmetricMatrix& M) { SP_Equal(M); } + void operator-=(const SymmetricMatrix& M) { MinusEqual(M); } + void operator+=(const BaseMatrix& M) { GeneralMatrix::operator+=(M); } + void SP_eq(const BaseMatrix& M) { GeneralMatrix::SP_eq(M); } + void operator-=(const BaseMatrix& M) { GeneralMatrix::operator-=(M); } + void operator+=(Real f) { GeneralMatrix::Add(f); } + void operator-=(Real f) { GeneralMatrix::Add(-f); } + void swap(SymmetricMatrix& gm) { GeneralMatrix::swap((GeneralMatrix&)gm); } + GeneralMatrix* Image() const; // copy of matrix + NEW_DELETE(SymmetricMatrix) +}; + +/// Upper triangular matrix. +class UpperTriangularMatrix : public GeneralMatrix +{ +public: + UpperTriangularMatrix() {} + ~UpperTriangularMatrix() {} + UpperTriangularMatrix(ArrayLengthSpecifier); + void operator=(const BaseMatrix&); + void operator=(const UpperTriangularMatrix& m) { Eq(m); } + UpperTriangularMatrix(const BaseMatrix&); + UpperTriangularMatrix(const UpperTriangularMatrix& gm) + : GeneralMatrix() { GetMatrix(&gm); } + void operator=(Real f) { GeneralMatrix::operator=(f); } + Real& operator()(int, int); // access element + Real& element(int, int); // access element + Real operator()(int, int) const; // access element + Real element(int, int) const; // access element +#ifdef SETUP_C_SUBSCRIPTS + Real* operator[](int m) { return store+m*ncols_val-(m*(m+1))/2; } + const Real* operator[](int m) const + { return store+m*ncols_val-(m*(m+1))/2; } +#endif + MatrixType type() const; + GeneralMatrix* MakeSolver() { return this; } // for solving + void Solver(MatrixColX&, const MatrixColX&); + LogAndSign log_determinant() const; + Real trace() const; + void GetRow(MatrixRowCol&); + void GetCol(MatrixRowCol&); + void GetCol(MatrixColX&); + void RestoreCol(MatrixRowCol&); + void RestoreCol(MatrixColX& c) { RestoreCol((MatrixRowCol&)c); } + void NextRow(MatrixRowCol&); + void resize(int); // change dimensions + void ReSize(int m) { resize(m); } + void resize(const GeneralMatrix& A); + void ReSize(const GeneralMatrix& A) { resize(A); } + void resize_keep(int); + MatrixBandWidth bandwidth() const; + void operator+=(const UpperTriangularMatrix& M) { PlusEqual(M); } + void SP_eq(const UpperTriangularMatrix& M) { SP_Equal(M); } + void operator-=(const UpperTriangularMatrix& M) { MinusEqual(M); } + void operator+=(const BaseMatrix& M) { GeneralMatrix::operator+=(M); } + void SP_eq(const BaseMatrix& M) { GeneralMatrix::SP_eq(M); } + void operator-=(const BaseMatrix& M) { GeneralMatrix::operator-=(M); } + void operator+=(Real f) { GeneralMatrix::operator+=(f); } + void operator-=(Real f) { GeneralMatrix::operator-=(f); } + void swap(UpperTriangularMatrix& gm) + { GeneralMatrix::swap((GeneralMatrix&)gm); } + GeneralMatrix* Image() const; // copy of matrix + NEW_DELETE(UpperTriangularMatrix) +}; + +/// Lower triangular matrix. +class LowerTriangularMatrix : public GeneralMatrix +{ +public: + LowerTriangularMatrix() {} + ~LowerTriangularMatrix() {} + LowerTriangularMatrix(ArrayLengthSpecifier); + LowerTriangularMatrix(const LowerTriangularMatrix& gm) + : GeneralMatrix() { GetMatrix(&gm); } + LowerTriangularMatrix(const BaseMatrix& M); + void operator=(const BaseMatrix&); + void operator=(Real f) { GeneralMatrix::operator=(f); } + void operator=(const LowerTriangularMatrix& m) { Eq(m); } + Real& operator()(int, int); // access element + Real& element(int, int); // access element + Real operator()(int, int) const; // access element + Real element(int, int) const; // access element +#ifdef SETUP_C_SUBSCRIPTS + Real* operator[](int m) { return store+(m*(m+1))/2; } + const Real* operator[](int m) const { return store+(m*(m+1))/2; } +#endif + MatrixType type() const; + GeneralMatrix* MakeSolver() { return this; } // for solving + void Solver(MatrixColX&, const MatrixColX&); + LogAndSign log_determinant() const; + Real trace() const; + void GetRow(MatrixRowCol&); + void GetCol(MatrixRowCol&); + void GetCol(MatrixColX&); + void RestoreCol(MatrixRowCol&); + void RestoreCol(MatrixColX& c) { RestoreCol((MatrixRowCol&)c); } + void NextRow(MatrixRowCol&); + void resize(int); // change dimensions + void ReSize(int m) { resize(m); } + void resize_keep(int); + void resize(const GeneralMatrix& A); + void ReSize(const GeneralMatrix& A) { resize(A); } + MatrixBandWidth bandwidth() const; + void operator+=(const LowerTriangularMatrix& M) { PlusEqual(M); } + void SP_eq(const LowerTriangularMatrix& M) { SP_Equal(M); } + void operator-=(const LowerTriangularMatrix& M) { MinusEqual(M); } + void operator+=(const BaseMatrix& M) { GeneralMatrix::operator+=(M); } + void SP_eq(const BaseMatrix& M) { GeneralMatrix::SP_eq(M); } + void operator-=(const BaseMatrix& M) { GeneralMatrix::operator-=(M); } + void operator+=(Real f) { GeneralMatrix::operator+=(f); } + void operator-=(Real f) { GeneralMatrix::operator-=(f); } + void swap(LowerTriangularMatrix& gm) + { GeneralMatrix::swap((GeneralMatrix&)gm); } + GeneralMatrix* Image() const; // copy of matrix + NEW_DELETE(LowerTriangularMatrix) +}; + +/// Diagonal matrix. +class DiagonalMatrix : public GeneralMatrix +{ +public: + DiagonalMatrix() {} + ~DiagonalMatrix() {} + DiagonalMatrix(ArrayLengthSpecifier); + DiagonalMatrix(const BaseMatrix&); + DiagonalMatrix(const DiagonalMatrix& gm) + : GeneralMatrix() { GetMatrix(&gm); } + void operator=(const BaseMatrix&); + void operator=(Real f) { GeneralMatrix::operator=(f); } + void operator=(const DiagonalMatrix& m) { Eq(m); } + Real& operator()(int, int); // access element + Real& operator()(int); // access element + Real operator()(int, int) const; // access element + Real operator()(int) const; + Real& element(int, int); // access element + Real& element(int); // access element + Real element(int, int) const; // access element + Real element(int) const; // access element +#ifdef SETUP_C_SUBSCRIPTS + Real& operator[](int m) { return store[m]; } + const Real& operator[](int m) const { return store[m]; } +#endif + MatrixType type() const; + + LogAndSign log_determinant() const; + Real trace() const; + void GetRow(MatrixRowCol&); + void GetCol(MatrixRowCol&); + void GetCol(MatrixColX&); + void NextRow(MatrixRowCol&); + void NextCol(MatrixRowCol&); + void NextCol(MatrixColX&); + GeneralMatrix* MakeSolver() { return this; } // for solving + void Solver(MatrixColX&, const MatrixColX&); + GeneralMatrix* Transpose(TransposedMatrix*, MatrixType); + void resize(int); // change dimensions + void ReSize(int m) { resize(m); } + void resize_keep(int); + void resize(const GeneralMatrix& A); + void ReSize(const GeneralMatrix& A) { resize(A); } + Real* nric() const + { CheckStore(); return store-1; } // for use by NRIC + MatrixBandWidth bandwidth() const; +// ReturnMatrix Reverse() const; // reverse order of elements + void operator+=(const DiagonalMatrix& M) { PlusEqual(M); } + void SP_eq(const DiagonalMatrix& M) { SP_Equal(M); } + void operator-=(const DiagonalMatrix& M) { MinusEqual(M); } + void operator+=(const BaseMatrix& M) { GeneralMatrix::operator+=(M); } + void SP_eq(const BaseMatrix& M) { GeneralMatrix::SP_eq(M); } + void operator-=(const BaseMatrix& M) { GeneralMatrix::operator-=(M); } + void operator+=(Real f) { GeneralMatrix::operator+=(f); } + void operator-=(Real f) { GeneralMatrix::operator-=(f); } + void swap(DiagonalMatrix& gm) + { GeneralMatrix::swap((GeneralMatrix&)gm); } + GeneralMatrix* Image() const; // copy of matrix + NEW_DELETE(DiagonalMatrix) +}; + +/// Row vector. +class RowVector : public Matrix +{ +public: + RowVector() { nrows_val = 1; } + ~RowVector() {} + RowVector(ArrayLengthSpecifier n) : Matrix(1,n.Value()) {} + RowVector(const BaseMatrix&); + RowVector(const RowVector& gm) : Matrix() { GetMatrix(&gm); } + void operator=(const BaseMatrix&); + void operator=(Real f) { GeneralMatrix::operator=(f); } + void operator=(const RowVector& m) { Eq(m); } + Real& operator()(int); // access element + Real& element(int); // access element + Real operator()(int) const; // access element + Real element(int) const; // access element +#ifdef SETUP_C_SUBSCRIPTS + Real& operator[](int m) { return store[m]; } + const Real& operator[](int m) const { return store[m]; } + // following for Numerical Recipes in C++ + RowVector(Real a, int n) : Matrix(a, 1, n) {} + RowVector(const Real* a, int n) : Matrix(a, 1, n) {} +#endif + MatrixType type() const; + void GetCol(MatrixRowCol&); + void GetCol(MatrixColX&); + void NextCol(MatrixRowCol&); + void NextCol(MatrixColX&); + void RestoreCol(MatrixRowCol&) {} + void RestoreCol(MatrixColX& c); + GeneralMatrix* Transpose(TransposedMatrix*, MatrixType); + void resize(int); // change dimensions + void ReSize(int m) { resize(m); } + void resize_keep(int); + void resize_keep(int,int); + void resize(int,int); // in case access is matrix + void ReSize(int m,int n) { resize(m, n); } + void resize(const GeneralMatrix& A); + void ReSize(const GeneralMatrix& A) { resize(A); } + Real* nric() const + { CheckStore(); return store-1; } // for use by NRIC + void cleanup(); // to clear store + void MiniCleanUp() + { store = 0; storage = 0; nrows_val = 1; ncols_val = 0; tag_val = -1; } + // friend ReturnMatrix GetMatrixRow(Matrix& A, int row); + void operator+=(const Matrix& M) { PlusEqual(M); } + void SP_eq(const Matrix& M) { SP_Equal(M); } + void operator-=(const Matrix& M) { MinusEqual(M); } + void operator+=(const BaseMatrix& M) { GeneralMatrix::operator+=(M); } + void SP_eq(const BaseMatrix& M) { GeneralMatrix::SP_eq(M); } + void operator-=(const BaseMatrix& M) { GeneralMatrix::operator-=(M); } + void operator+=(Real f) { GeneralMatrix::Add(f); } + void operator-=(Real f) { GeneralMatrix::Add(-f); } + void swap(RowVector& gm) + { GeneralMatrix::swap((GeneralMatrix&)gm); } + GeneralMatrix* Image() const; // copy of matrix + NEW_DELETE(RowVector) +}; + +/// Column vector. +class ColumnVector : public Matrix +{ +public: + ColumnVector() { ncols_val = 1; } + ~ColumnVector() {} + ColumnVector(ArrayLengthSpecifier n) : Matrix(n.Value(),1) {} + ColumnVector(const BaseMatrix&); + ColumnVector(const ColumnVector& gm) : Matrix() { GetMatrix(&gm); } + void operator=(const BaseMatrix&); + void operator=(Real f) { GeneralMatrix::operator=(f); } + void operator=(const ColumnVector& m) { Eq(m); } + Real& operator()(int); // access element + Real& element(int); // access element + Real operator()(int) const; // access element + Real element(int) const; // access element +#ifdef SETUP_C_SUBSCRIPTS + Real& operator[](int m) { return store[m]; } + const Real& operator[](int m) const { return store[m]; } + // following for Numerical Recipes in C++ + ColumnVector(Real a, int m) : Matrix(a, m, 1) {} + ColumnVector(const Real* a, int m) : Matrix(a, m, 1) {} +#endif + MatrixType type() const; + GeneralMatrix* Transpose(TransposedMatrix*, MatrixType); + void resize(int); // change dimensions + void ReSize(int m) { resize(m); } + void resize_keep(int); + void resize_keep(int,int); + void resize(int,int); // in case access is matrix + void ReSize(int m,int n) { resize(m, n); } + void resize(const GeneralMatrix& A); + void ReSize(const GeneralMatrix& A) { resize(A); } + Real* nric() const + { CheckStore(); return store-1; } // for use by NRIC + void cleanup(); // to clear store + void MiniCleanUp() + { store = 0; storage = 0; nrows_val = 0; ncols_val = 1; tag_val = -1; } +// ReturnMatrix Reverse() const; // reverse order of elements + void operator+=(const Matrix& M) { PlusEqual(M); } + void SP_eq(const Matrix& M) { SP_Equal(M); } + void operator-=(const Matrix& M) { MinusEqual(M); } + void operator+=(const BaseMatrix& M) { GeneralMatrix::operator+=(M); } + void SP_eq(const BaseMatrix& M) { GeneralMatrix::SP_eq(M); } + void operator-=(const BaseMatrix& M) { GeneralMatrix::operator-=(M); } + void operator+=(Real f) { GeneralMatrix::Add(f); } + void operator-=(Real f) { GeneralMatrix::Add(-f); } + void swap(ColumnVector& gm) + { GeneralMatrix::swap((GeneralMatrix&)gm); } + GeneralMatrix* Image() const; // copy of matrix + NEW_DELETE(ColumnVector) +}; + +/// LU matrix. +/// A square matrix decomposed into upper and lower triangular +/// in preparation for inverting or solving equations. +class CroutMatrix : public GeneralMatrix +{ + int* indx; + bool d; // number of row swaps = even or odd + bool sing; + void ludcmp(); + void get_aux(CroutMatrix&); // for copying indx[] etc +public: + CroutMatrix(const BaseMatrix&); + CroutMatrix() : indx(0), d(true), sing(true) {} + CroutMatrix(const CroutMatrix&); + void operator=(const CroutMatrix&); + GeneralMatrix* Evaluate(MatrixType mt=MatrixTypeUnSp); + MatrixType type() const; + void lubksb(Real*, int=0); + ~CroutMatrix(); + GeneralMatrix* MakeSolver() { return this; } // for solving + LogAndSign log_determinant() const; + void Solver(MatrixColX&, const MatrixColX&); + void GetRow(MatrixRowCol&); + void GetCol(MatrixRowCol&); + void GetCol(MatrixColX& c) { GetCol((MatrixRowCol&)c); } + void cleanup(); // to clear store + void MiniCleanUp(); + bool IsEqual(const GeneralMatrix&) const; + bool is_singular() const { return sing; } + bool IsSingular() const { return sing; } + const int* const_data_indx() const { return indx; } + bool even_exchanges() const { return d; } + void swap(CroutMatrix& gm); + GeneralMatrix* Image() const; // copy of matrix + NEW_DELETE(CroutMatrix) +}; + +// ***************************** band matrices ***************************/ + +/// Band matrix. +class BandMatrix : public GeneralMatrix +{ +protected: + void CornerClear() const; // set unused elements to zero + short SimpleAddOK(const GeneralMatrix* gm); +public: + int lower_val, upper_val; // band widths + BandMatrix() { lower_val=0; upper_val=0; CornerClear(); } + ~BandMatrix() {} + BandMatrix(int n,int lb,int ub) { resize(n,lb,ub); CornerClear(); } + // standard declaration + BandMatrix(const BaseMatrix&); // evaluate BaseMatrix + void operator=(const BaseMatrix&); + void operator=(Real f) { GeneralMatrix::operator=(f); } + void operator=(const BandMatrix& m) { Eq(m); } + MatrixType type() const; + Real& operator()(int, int); // access element + Real& element(int, int); // access element + Real operator()(int, int) const; // access element + Real element(int, int) const; // access element +#ifdef SETUP_C_SUBSCRIPTS + Real* operator[](int m) { return store+(upper_val+lower_val)*m+lower_val; } + const Real* operator[](int m) const + { return store+(upper_val+lower_val)*m+lower_val; } +#endif + BandMatrix(const BandMatrix& gm) : GeneralMatrix() { GetMatrix(&gm); } + LogAndSign log_determinant() const; + GeneralMatrix* MakeSolver(); + Real trace() const; + Real sum_square() const + { CornerClear(); return GeneralMatrix::sum_square(); } + Real sum_absolute_value() const + { CornerClear(); return GeneralMatrix::sum_absolute_value(); } + Real sum() const + { CornerClear(); return GeneralMatrix::sum(); } + Real maximum_absolute_value() const + { CornerClear(); return GeneralMatrix::maximum_absolute_value(); } + Real minimum_absolute_value() const + { int i, j; return GeneralMatrix::minimum_absolute_value2(i, j); } + Real maximum() const { int i, j; return GeneralMatrix::maximum2(i, j); } + Real minimum() const { int i, j; return GeneralMatrix::minimum2(i, j); } + void GetRow(MatrixRowCol&); + void GetCol(MatrixRowCol&); + void GetCol(MatrixColX&); + void RestoreCol(MatrixRowCol&); + void RestoreCol(MatrixColX& c) { RestoreCol((MatrixRowCol&)c); } + void NextRow(MatrixRowCol&); + virtual void resize(int, int, int); // change dimensions + virtual void ReSize(int m, int n, int b) { resize(m, n, b); } + void resize(const GeneralMatrix& A); + void ReSize(const GeneralMatrix& A) { resize(A); } + //bool SameStorageType(const GeneralMatrix& A) const; + //void ReSizeForAdd(const GeneralMatrix& A, const GeneralMatrix& B); + //void ReSizeForSP(const GeneralMatrix& A, const GeneralMatrix& B); + MatrixBandWidth bandwidth() const; + void SetParameters(const GeneralMatrix*); + MatrixInput operator<<(double); // will give error + MatrixInput operator<<(float); // will give error + MatrixInput operator<<(int f); + void operator<<(const double* r); // will give error + void operator<<(const float* r); // will give error + void operator<<(const int* r); // will give error + // the next is included because Zortech and Borland + // cannot find the copy in GeneralMatrix + void operator<<(const BaseMatrix& X) { GeneralMatrix::operator<<(X); } + void swap(BandMatrix& gm); + GeneralMatrix* Image() const; // copy of matrix + NEW_DELETE(BandMatrix) +}; + +/// Upper triangular band matrix. +class UpperBandMatrix : public BandMatrix +{ +public: + UpperBandMatrix() {} + ~UpperBandMatrix() {} + UpperBandMatrix(int n, int ubw) // standard declaration + : BandMatrix(n, 0, ubw) {} + UpperBandMatrix(const BaseMatrix&); // evaluate BaseMatrix + void operator=(const BaseMatrix&); + void operator=(Real f) { GeneralMatrix::operator=(f); } + void operator=(const UpperBandMatrix& m) { Eq(m); } + MatrixType type() const; + UpperBandMatrix(const UpperBandMatrix& gm) : BandMatrix() { GetMatrix(&gm); } + GeneralMatrix* MakeSolver() { return this; } + void Solver(MatrixColX&, const MatrixColX&); + LogAndSign log_determinant() const; + void resize(int, int, int); // change dimensions + void ReSize(int m, int n, int b) { resize(m, n, b); } + void resize(int n,int ubw) // change dimensions + { BandMatrix::resize(n,0,ubw); } + void ReSize(int n,int ubw) // change dimensions + { BandMatrix::resize(n,0,ubw); } + void resize(const GeneralMatrix& A) { BandMatrix::resize(A); } + void ReSize(const GeneralMatrix& A) { BandMatrix::resize(A); } + Real& operator()(int, int); + Real operator()(int, int) const; + Real& element(int, int); + Real element(int, int) const; +#ifdef SETUP_C_SUBSCRIPTS + Real* operator[](int m) { return store+upper_val*m; } + const Real* operator[](int m) const { return store+upper_val*m; } +#endif + void swap(UpperBandMatrix& gm) + { BandMatrix::swap((BandMatrix&)gm); } + GeneralMatrix* Image() const; // copy of matrix + NEW_DELETE(UpperBandMatrix) +}; + +/// Lower triangular band matrix. +class LowerBandMatrix : public BandMatrix +{ +public: + LowerBandMatrix() {} + ~LowerBandMatrix() {} + LowerBandMatrix(int n, int lbw) // standard declaration + : BandMatrix(n, lbw, 0) {} + LowerBandMatrix(const BaseMatrix&); // evaluate BaseMatrix + void operator=(const BaseMatrix&); + void operator=(Real f) { GeneralMatrix::operator=(f); } + void operator=(const LowerBandMatrix& m) { Eq(m); } + MatrixType type() const; + LowerBandMatrix(const LowerBandMatrix& gm) : BandMatrix() { GetMatrix(&gm); } + GeneralMatrix* MakeSolver() { return this; } + void Solver(MatrixColX&, const MatrixColX&); + LogAndSign log_determinant() const; + void resize(int, int, int); // change dimensions + void ReSize(int m, int n, int b) { resize(m, n, b); } + void resize(int n,int lbw) // change dimensions + { BandMatrix::resize(n,lbw,0); } + void ReSize(int n,int lbw) // change dimensions + { BandMatrix::resize(n,lbw,0); } + void resize(const GeneralMatrix& A) { BandMatrix::resize(A); } + void ReSize(const GeneralMatrix& A) { BandMatrix::resize(A); } + Real& operator()(int, int); + Real operator()(int, int) const; + Real& element(int, int); + Real element(int, int) const; +#ifdef SETUP_C_SUBSCRIPTS + Real* operator[](int m) { return store+lower_val*(m+1); } + const Real* operator[](int m) const { return store+lower_val*(m+1); } +#endif + void swap(LowerBandMatrix& gm) + { BandMatrix::swap((BandMatrix&)gm); } + GeneralMatrix* Image() const; // copy of matrix + NEW_DELETE(LowerBandMatrix) +}; + +/// Symmetric band matrix. +class SymmetricBandMatrix : public GeneralMatrix +{ + void CornerClear() const; // set unused elements to zero + short SimpleAddOK(const GeneralMatrix* gm); +public: + int lower_val; // lower band width + SymmetricBandMatrix() { lower_val=0; CornerClear(); } + ~SymmetricBandMatrix() {} + SymmetricBandMatrix(int n, int lb) { resize(n,lb); CornerClear(); } + SymmetricBandMatrix(const BaseMatrix&); + void operator=(const BaseMatrix&); + void operator=(Real f) { GeneralMatrix::operator=(f); } + void operator=(const SymmetricBandMatrix& m) { Eq(m); } + Real& operator()(int, int); // access element + Real& element(int, int); // access element + Real operator()(int, int) const; // access element + Real element(int, int) const; // access element +#ifdef SETUP_C_SUBSCRIPTS + Real* operator[](int m) { return store+lower_val*(m+1); } + const Real* operator[](int m) const { return store+lower_val*(m+1); } +#endif + MatrixType type() const; + SymmetricBandMatrix(const SymmetricBandMatrix& gm) + : GeneralMatrix() { GetMatrix(&gm); } + GeneralMatrix* MakeSolver(); + Real sum_square() const; + Real sum_absolute_value() const; + Real sum() const; + Real maximum_absolute_value() const + { CornerClear(); return GeneralMatrix::maximum_absolute_value(); } + Real minimum_absolute_value() const + { int i, j; return GeneralMatrix::minimum_absolute_value2(i, j); } + Real maximum() const { int i, j; return GeneralMatrix::maximum2(i, j); } + Real minimum() const { int i, j; return GeneralMatrix::minimum2(i, j); } + Real trace() const; + LogAndSign log_determinant() const; + void GetRow(MatrixRowCol&); + void GetCol(MatrixRowCol&); + void GetCol(MatrixColX&); + void RestoreCol(MatrixRowCol&) {} + void RestoreCol(MatrixColX&); + GeneralMatrix* Transpose(TransposedMatrix*, MatrixType); + void resize(int,int); // change dimensions + void ReSize(int m,int b) { resize(m, b); } + void resize(const GeneralMatrix& A); + void ReSize(const GeneralMatrix& A) { resize(A); } + //bool SameStorageType(const GeneralMatrix& A) const; + //void ReSizeForAdd(const GeneralMatrix& A, const GeneralMatrix& B); + //void ReSizeForSP(const GeneralMatrix& A, const GeneralMatrix& B); + MatrixBandWidth bandwidth() const; + void SetParameters(const GeneralMatrix*); + void operator<<(const double* r); // will give error + void operator<<(const float* r); // will give error + void operator<<(const int* r); // will give error + void operator<<(const BaseMatrix& X) { GeneralMatrix::operator<<(X); } + void swap(SymmetricBandMatrix& gm); + GeneralMatrix* Image() const; // copy of matrix + NEW_DELETE(SymmetricBandMatrix) +}; + +/// LU decomposition of a band matrix. +class BandLUMatrix : public GeneralMatrix +{ + int* indx; + bool d; + bool sing; // true if singular + Real* store2; + int storage2; + int m1,m2; // lower and upper + void ludcmp(); + void get_aux(BandLUMatrix&); // for copying indx[] etc +public: + BandLUMatrix(const BaseMatrix&); + BandLUMatrix() + : indx(0), d(true), sing(true), store2(0), storage2(0), m1(0), m2(0) {} + BandLUMatrix(const BandLUMatrix&); + void operator=(const BandLUMatrix&); + GeneralMatrix* Evaluate(MatrixType mt=MatrixTypeUnSp); + MatrixType type() const; + void lubksb(Real*, int=0); + ~BandLUMatrix(); + GeneralMatrix* MakeSolver() { return this; } // for solving + LogAndSign log_determinant() const; + void Solver(MatrixColX&, const MatrixColX&); + void GetRow(MatrixRowCol&); + void GetCol(MatrixRowCol&); + void GetCol(MatrixColX& c) { GetCol((MatrixRowCol&)c); } + void cleanup(); // to clear store + void MiniCleanUp(); + bool IsEqual(const GeneralMatrix&) const; + bool is_singular() const { return sing; } + bool IsSingular() const { return sing; } + const Real* const_data2() const { return store2; } + int size2() const { return storage2; } + const int* const_data_indx() const { return indx; } + bool even_exchanges() const { return d; } + MatrixBandWidth bandwidth() const; + void swap(BandLUMatrix& gm); + GeneralMatrix* Image() const; // copy of matrix + NEW_DELETE(BandLUMatrix) +}; + +// ************************** special matrices **************************** + +/// Identity matrix. +class IdentityMatrix : public GeneralMatrix +{ +public: + IdentityMatrix() {} + ~IdentityMatrix() {} + IdentityMatrix(ArrayLengthSpecifier n) : GeneralMatrix(1) + { nrows_val = ncols_val = n.Value(); *store = 1; } + IdentityMatrix(const IdentityMatrix& gm) + : GeneralMatrix() { GetMatrix(&gm); } + IdentityMatrix(const BaseMatrix&); + void operator=(const BaseMatrix&); + void operator=(const IdentityMatrix& m) { Eq(m); } + void operator=(Real f) { GeneralMatrix::operator=(f); } + MatrixType type() const; + + LogAndSign log_determinant() const; + Real trace() const; + Real sum_square() const; + Real sum_absolute_value() const; + Real sum() const { return trace(); } + void GetRow(MatrixRowCol&); + void GetCol(MatrixRowCol&); + void GetCol(MatrixColX&); + void NextRow(MatrixRowCol&); + void NextCol(MatrixRowCol&); + void NextCol(MatrixColX&); + GeneralMatrix* MakeSolver() { return this; } // for solving + void Solver(MatrixColX&, const MatrixColX&); + GeneralMatrix* Transpose(TransposedMatrix*, MatrixType); + void resize(int n); + void ReSize(int n) { resize(n); } + void resize(const GeneralMatrix& A); + void ReSize(const GeneralMatrix& A) { resize(A); } + MatrixBandWidth bandwidth() const; +// ReturnMatrix Reverse() const; // reverse order of elements + void swap(IdentityMatrix& gm) + { GeneralMatrix::swap((GeneralMatrix&)gm); } + GeneralMatrix* Image() const; // copy of matrix + NEW_DELETE(IdentityMatrix) +}; + + + + +// ************************** GenericMatrix class ************************/ + +/// A matrix which can be of any GeneralMatrix type. +class GenericMatrix : public BaseMatrix +{ + GeneralMatrix* gm; + int search(const BaseMatrix* bm) const; + friend class BaseMatrix; +public: + GenericMatrix() : gm(0) {} + GenericMatrix(const BaseMatrix& bm) + { gm = ((BaseMatrix&)bm).Evaluate(); gm = gm->Image(); } + GenericMatrix(const GenericMatrix& bm) : BaseMatrix() + { gm = bm.gm->Image(); } + void operator=(const GenericMatrix&); + void operator=(const BaseMatrix&); + void operator+=(const BaseMatrix&); + void SP_eq(const BaseMatrix&); + void operator-=(const BaseMatrix&); + void operator*=(const BaseMatrix&); + void operator|=(const BaseMatrix&); + void operator&=(const BaseMatrix&); + void operator+=(Real); + void operator-=(Real r) { operator+=(-r); } + void operator*=(Real); + void operator/=(Real r) { operator*=(1.0/r); } + ~GenericMatrix() { delete gm; } + void cleanup() { delete gm; gm = 0; } + void Release() { gm->Release(); } + void release() { gm->release(); } + GeneralMatrix* Evaluate(MatrixType = MatrixTypeUnSp); + MatrixBandWidth bandwidth() const; + void swap(GenericMatrix& x); + NEW_DELETE(GenericMatrix) +}; + +// *************************** temporary classes *************************/ + +/// Product of two matrices. +/// \internal +class MultipliedMatrix : public BaseMatrix +{ +protected: + // if these union statements cause problems, simply remove them + // and declare the items individually + union { const BaseMatrix* bm1; GeneralMatrix* gm1; }; + // pointers to summands + union { const BaseMatrix* bm2; GeneralMatrix* gm2; }; + MultipliedMatrix(const BaseMatrix* bm1x, const BaseMatrix* bm2x) + : bm1(bm1x),bm2(bm2x) {} + int search(const BaseMatrix*) const; + friend class BaseMatrix; + friend class GeneralMatrix; + friend class GenericMatrix; +public: + ~MultipliedMatrix() {} + GeneralMatrix* Evaluate(MatrixType mt=MatrixTypeUnSp); + MatrixBandWidth bandwidth() const; + NEW_DELETE(MultipliedMatrix) +}; + +/// Sum of two matrices. +/// \internal +class AddedMatrix : public MultipliedMatrix +{ +protected: + AddedMatrix(const BaseMatrix* bm1x, const BaseMatrix* bm2x) + : MultipliedMatrix(bm1x,bm2x) {} + + friend class BaseMatrix; + friend class GeneralMatrix; + friend class GenericMatrix; +public: + ~AddedMatrix() {} + GeneralMatrix* Evaluate(MatrixType mt=MatrixTypeUnSp); + MatrixBandWidth bandwidth() const; + NEW_DELETE(AddedMatrix) +}; + +/// Schur (elementwise) product of two matrices. +/// \internal +class SPMatrix : public AddedMatrix +{ +protected: + SPMatrix(const BaseMatrix* bm1x, const BaseMatrix* bm2x) + : AddedMatrix(bm1x,bm2x) {} + + friend class BaseMatrix; + friend class GeneralMatrix; + friend class GenericMatrix; +public: + ~SPMatrix() {} + GeneralMatrix* Evaluate(MatrixType mt=MatrixTypeUnSp); + MatrixBandWidth bandwidth() const; + + friend SPMatrix SP(const BaseMatrix&, const BaseMatrix&); + + NEW_DELETE(SPMatrix) +}; + +/// Kronecker product of two matrices. +/// \internal +class KPMatrix : public MultipliedMatrix +{ +protected: + KPMatrix(const BaseMatrix* bm1x, const BaseMatrix* bm2x) + : MultipliedMatrix(bm1x,bm2x) {} + + friend class BaseMatrix; + friend class GeneralMatrix; + friend class GenericMatrix; +public: + ~KPMatrix() {} + MatrixBandWidth bandwidth() const; + GeneralMatrix* Evaluate(MatrixType mt=MatrixTypeUnSp); + friend KPMatrix KP(const BaseMatrix&, const BaseMatrix&); + NEW_DELETE(KPMatrix) +}; + +/// Two matrices horizontally concatenated. +/// \internal +class ConcatenatedMatrix : public MultipliedMatrix +{ +protected: + ConcatenatedMatrix(const BaseMatrix* bm1x, const BaseMatrix* bm2x) + : MultipliedMatrix(bm1x,bm2x) {} + + friend class BaseMatrix; + friend class GeneralMatrix; + friend class GenericMatrix; +public: + ~ConcatenatedMatrix() {} + MatrixBandWidth bandwidth() const; + GeneralMatrix* Evaluate(MatrixType mt=MatrixTypeUnSp); + NEW_DELETE(ConcatenatedMatrix) +}; + +/// Two matrices vertically concatenated. +/// \internal +class StackedMatrix : public ConcatenatedMatrix +{ +protected: + StackedMatrix(const BaseMatrix* bm1x, const BaseMatrix* bm2x) + : ConcatenatedMatrix(bm1x,bm2x) {} + + friend class BaseMatrix; + friend class GeneralMatrix; + friend class GenericMatrix; +public: + ~StackedMatrix() {} + GeneralMatrix* Evaluate(MatrixType mt=MatrixTypeUnSp); + NEW_DELETE(StackedMatrix) +}; + +/// Inverted matrix times matrix. +/// \internal +class SolvedMatrix : public MultipliedMatrix +{ + SolvedMatrix(const BaseMatrix* bm1x, const BaseMatrix* bm2x) + : MultipliedMatrix(bm1x,bm2x) {} + friend class BaseMatrix; + friend class InvertedMatrix; // for operator* +public: + ~SolvedMatrix() {} + GeneralMatrix* Evaluate(MatrixType mt=MatrixTypeUnSp); + MatrixBandWidth bandwidth() const; + NEW_DELETE(SolvedMatrix) +}; + +/// Difference between two matrices. +/// \internal +class SubtractedMatrix : public AddedMatrix +{ + SubtractedMatrix(const BaseMatrix* bm1x, const BaseMatrix* bm2x) + : AddedMatrix(bm1x,bm2x) {} + friend class BaseMatrix; + friend class GeneralMatrix; + friend class GenericMatrix; +public: + ~SubtractedMatrix() {} + GeneralMatrix* Evaluate(MatrixType mt=MatrixTypeUnSp); + NEW_DELETE(SubtractedMatrix) +}; + +/// Any type of matrix plus Real. +/// \internal +class ShiftedMatrix : public BaseMatrix +{ +protected: + union { const BaseMatrix* bm; GeneralMatrix* gm; }; + Real f; + ShiftedMatrix(const BaseMatrix* bmx, Real fx) : bm(bmx),f(fx) {} + int search(const BaseMatrix*) const; + friend class BaseMatrix; + friend class GeneralMatrix; + friend class GenericMatrix; +public: + ~ShiftedMatrix() {} + GeneralMatrix* Evaluate(MatrixType mt=MatrixTypeUnSp); + friend ShiftedMatrix operator+(Real f, const BaseMatrix& BM); + NEW_DELETE(ShiftedMatrix) +}; + +/// Real minus matrix. +/// \internal +class NegShiftedMatrix : public ShiftedMatrix +{ +protected: + NegShiftedMatrix(Real fx, const BaseMatrix* bmx) : ShiftedMatrix(bmx,fx) {} + friend class BaseMatrix; + friend class GeneralMatrix; + friend class GenericMatrix; +public: + ~NegShiftedMatrix() {} + GeneralMatrix* Evaluate(MatrixType mt=MatrixTypeUnSp); + friend NegShiftedMatrix operator-(Real, const BaseMatrix&); + NEW_DELETE(NegShiftedMatrix) +}; + +/// Any type of matrix times Real. +/// \internal +class ScaledMatrix : public ShiftedMatrix +{ + ScaledMatrix(const BaseMatrix* bmx, Real fx) : ShiftedMatrix(bmx,fx) {} + friend class BaseMatrix; + friend class GeneralMatrix; + friend class GenericMatrix; +public: + ~ScaledMatrix() {} + GeneralMatrix* Evaluate(MatrixType mt=MatrixTypeUnSp); + MatrixBandWidth bandwidth() const; + friend ScaledMatrix operator*(Real f, const BaseMatrix& BM); + NEW_DELETE(ScaledMatrix) +}; + +/// Any type of matrix times -1. +/// \internal +class NegatedMatrix : public BaseMatrix +{ +protected: + union { const BaseMatrix* bm; GeneralMatrix* gm; }; + NegatedMatrix(const BaseMatrix* bmx) : bm(bmx) {} + int search(const BaseMatrix*) const; +private: + friend class BaseMatrix; +public: + ~NegatedMatrix() {} + GeneralMatrix* Evaluate(MatrixType mt=MatrixTypeUnSp); + MatrixBandWidth bandwidth() const; + NEW_DELETE(NegatedMatrix) +}; + +/// Transposed matrix. +/// \internal +class TransposedMatrix : public NegatedMatrix +{ + TransposedMatrix(const BaseMatrix* bmx) : NegatedMatrix(bmx) {} + friend class BaseMatrix; +public: + ~TransposedMatrix() {} + GeneralMatrix* Evaluate(MatrixType mt=MatrixTypeUnSp); + MatrixBandWidth bandwidth() const; + NEW_DELETE(TransposedMatrix) +}; + +/// Any type of matrix with order of elements reversed. +/// \internal +class ReversedMatrix : public NegatedMatrix +{ + ReversedMatrix(const BaseMatrix* bmx) : NegatedMatrix(bmx) {} + friend class BaseMatrix; +public: + ~ReversedMatrix() {} + GeneralMatrix* Evaluate(MatrixType mt=MatrixTypeUnSp); + NEW_DELETE(ReversedMatrix) +}; + +/// Inverse of matrix. +/// \internal +class InvertedMatrix : public NegatedMatrix +{ + InvertedMatrix(const BaseMatrix* bmx) : NegatedMatrix(bmx) {} +public: + ~InvertedMatrix() {} + SolvedMatrix operator*(const BaseMatrix&) const; // inverse(A) * B + ScaledMatrix operator*(Real t) const { return BaseMatrix::operator*(t); } + friend class BaseMatrix; + GeneralMatrix* Evaluate(MatrixType mt=MatrixTypeUnSp); + MatrixBandWidth bandwidth() const; + NEW_DELETE(InvertedMatrix) +}; + +/// Any type of matrix interpreted as a RowVector. +/// \internal +class RowedMatrix : public NegatedMatrix +{ + RowedMatrix(const BaseMatrix* bmx) : NegatedMatrix(bmx) {} + friend class BaseMatrix; +public: + ~RowedMatrix() {} + GeneralMatrix* Evaluate(MatrixType mt=MatrixTypeUnSp); + MatrixBandWidth bandwidth() const; + NEW_DELETE(RowedMatrix) +}; + +/// Any type of matrix interpreted as a ColumnVector. +/// \internal +class ColedMatrix : public NegatedMatrix +{ + ColedMatrix(const BaseMatrix* bmx) : NegatedMatrix(bmx) {} + friend class BaseMatrix; +public: + ~ColedMatrix() {} + GeneralMatrix* Evaluate(MatrixType mt=MatrixTypeUnSp); + MatrixBandWidth bandwidth() const; + NEW_DELETE(ColedMatrix) +}; + +/// Any type of matrix interpreted as a DiagonalMatrix. +/// \internal +class DiagedMatrix : public NegatedMatrix +{ + DiagedMatrix(const BaseMatrix* bmx) : NegatedMatrix(bmx) {} + friend class BaseMatrix; +public: + ~DiagedMatrix() {} + GeneralMatrix* Evaluate(MatrixType mt=MatrixTypeUnSp); + MatrixBandWidth bandwidth() const; + NEW_DELETE(DiagedMatrix) +}; + +/// Any type of matrix interpreted as a (rectangular) Matrix. +/// \internal +class MatedMatrix : public NegatedMatrix +{ + int nr, nc; + MatedMatrix(const BaseMatrix* bmx, int nrx, int ncx) + : NegatedMatrix(bmx), nr(nrx), nc(ncx) {} + friend class BaseMatrix; +public: + ~MatedMatrix() {} + GeneralMatrix* Evaluate(MatrixType mt=MatrixTypeUnSp); + MatrixBandWidth bandwidth() const; + NEW_DELETE(MatedMatrix) +}; + +/// A matrix in an "envelope' for return from a function. +/// \internal +class ReturnMatrix : public BaseMatrix +{ + GeneralMatrix* gm; + int search(const BaseMatrix*) const; +public: + ~ReturnMatrix() {} + GeneralMatrix* Evaluate(MatrixType mt=MatrixTypeUnSp); + friend class BaseMatrix; + ReturnMatrix(const ReturnMatrix& tm) : BaseMatrix(), gm(tm.gm) {} + ReturnMatrix(const GeneralMatrix* gmx) : gm((GeneralMatrix*&)gmx) {} +// ReturnMatrix(GeneralMatrix&); + MatrixBandWidth bandwidth() const; + NEW_DELETE(ReturnMatrix) +}; + + +// ************************** submatrices ******************************/ + +/// A submatrix of a matrix. +/// \internal +class GetSubMatrix : public NegatedMatrix +{ + int row_skip; + int row_number; + int col_skip; + int col_number; + bool IsSym; + + GetSubMatrix + (const BaseMatrix* bmx, int rs, int rn, int cs, int cn, bool is) + : NegatedMatrix(bmx), + row_skip(rs), row_number(rn), col_skip(cs), col_number(cn), IsSym(is) {} + void SetUpLHS(); + friend class BaseMatrix; +public: + GetSubMatrix(const GetSubMatrix& g) + : NegatedMatrix(g.bm), row_skip(g.row_skip), row_number(g.row_number), + col_skip(g.col_skip), col_number(g.col_number), IsSym(g.IsSym) {} + ~GetSubMatrix() {} + GeneralMatrix* Evaluate(MatrixType mt=MatrixTypeUnSp); + void operator=(const BaseMatrix&); + void operator+=(const BaseMatrix&); + void SP_eq(const BaseMatrix&); + void operator-=(const BaseMatrix&); + void operator=(const GetSubMatrix& m) { operator=((const BaseMatrix&)m); } + void operator<<(const BaseMatrix&); + void operator<<(const double*); // copy from array + void operator<<(const float*); // copy from array + void operator<<(const int*); // copy from array + MatrixInput operator<<(double); // for loading a list + MatrixInput operator<<(float); // for loading a list + MatrixInput operator<<(int f); + void operator=(Real); // copy from constant + void operator+=(Real); // add constant + void operator-=(Real r) { operator+=(-r); } // subtract constant + void operator*=(Real); // multiply by constant + void operator/=(Real r) { operator*=(1.0/r); } // divide by constant + void inject(const GeneralMatrix&); // copy stored els only + void Inject(const GeneralMatrix& GM) { inject(GM); } + MatrixBandWidth bandwidth() const; + NEW_DELETE(GetSubMatrix) +}; + +// ******************** linear equation solving ****************************/ + +/// A class for finding A.i() * B. +/// This is supposed to choose the appropriate method depending on the +/// type A. Not very satisfactory as it doesn't know about Cholesky for +/// for positive definite matrices. +class LinearEquationSolver : public BaseMatrix +{ + GeneralMatrix* gm; + int search(const BaseMatrix*) const { return 0; } + friend class BaseMatrix; +public: + LinearEquationSolver(const BaseMatrix& bm); + ~LinearEquationSolver() { delete gm; } + void cleanup() { delete gm; } + GeneralMatrix* Evaluate(MatrixType) { return gm; } + // probably should have an error message if MatrixType != UnSp + NEW_DELETE(LinearEquationSolver) +}; + +// ************************** matrix input *******************************/ + +/// Class for reading values into a (small) matrix within a program. +/// \internal +/// Is able to detect a mismatch in the number of elements. + +class MatrixInput +{ + int n; // number values still to be read + Real* r; // pointer to next location to be read to +public: + MatrixInput(const MatrixInput& mi) : n(mi.n), r(mi.r) {} + MatrixInput(int nx, Real* rx) : n(nx), r(rx) {} + ~MatrixInput(); + MatrixInput operator<<(double); + MatrixInput operator<<(float); + MatrixInput operator<<(int f); + friend class GeneralMatrix; +}; + + + +// **************** a very simple integer array class ********************/ + +/// A very simple integer array class. +/// A minimal array class to imitate a C style array but giving dynamic storage +/// mostly intended for internal use by newmat. +/// Probably to be replaced by a templated class when I start using templates. + +class SimpleIntArray : public Janitor +{ +protected: + int* a; ///< pointer to the array + int n; ///< length of the array +public: + SimpleIntArray(int xn); ///< build an array length xn + SimpleIntArray() : a(0), n(0) {} ///< build an array length 0 + ~SimpleIntArray(); ///< return the space to memory + int& operator[](int i); ///< access element of the array - start at 0 + int operator[](int i) const; + ///< access element of constant array + void operator=(int ai); ///< set the array equal to a constant + void operator=(const SimpleIntArray& b); + ///< copy the elements of an array + SimpleIntArray(const SimpleIntArray& b); + ///< make a new array equal to an existing one + int Size() const { return n; } + ///< return the size of the array + int size() const { return n; } + ///< return the size of the array + int* Data() { return a; } ///< pointer to the data + const int* Data() const { return a; } ///< pointer to the data + int* data() { return a; } ///< pointer to the data + const int* data() const { return a; } ///< pointer to the data + const int* const_data() const { return a; } ///< pointer to the data + void resize(int i, bool keep = false); + ///< change length, keep data if keep = true + void ReSize(int i, bool keep = false) { resize(i, keep); } + ///< change length, keep data if keep = true + void resize_keep(int i) { resize(i, true); } + ///< change length, keep data + void cleanup() { resize(0); } ///< set length to zero + void CleanUp() { resize(0); } ///< set length to zero + NEW_DELETE(SimpleIntArray) +}; + +// ********************** C subscript classes **************************** + +/// Let matrix simulate a C type two dimensional array +class RealStarStar +{ + Real** a; +public: + RealStarStar(Matrix& A); + ~RealStarStar() { delete [] a; } + operator Real**() { return a; } +}; + +/// Let matrix simulate a C type const two dimensional array +class ConstRealStarStar +{ + const Real** a; +public: + ConstRealStarStar(const Matrix& A); + ~ConstRealStarStar() { delete [] a; } + operator const Real**() { return a; } +}; + +// *************************** exceptions ********************************/ + +/// Not positive definite exception. +class NPDException : public Runtime_error +{ +public: + static unsigned long Select; + NPDException(const GeneralMatrix&); +}; + +/// Covergence failure exception. +class ConvergenceException : public Runtime_error +{ +public: + static unsigned long Select; + ConvergenceException(const GeneralMatrix& A); + ConvergenceException(const char* c); +}; + +/// Singular matrix exception. +class SingularException : public Runtime_error +{ +public: + static unsigned long Select; + SingularException(const GeneralMatrix& A); +}; + +/// Real overflow exception. +class OverflowException : public Runtime_error +{ +public: + static unsigned long Select; + OverflowException(const char* c); +}; + +/// Miscellaneous exception (details in character string). +class ProgramException : public Logic_error +{ +protected: + ProgramException(); +public: + static unsigned long Select; + ProgramException(const char* c); + ProgramException(const char* c, const GeneralMatrix&); + ProgramException(const char* c, const GeneralMatrix&, const GeneralMatrix&); + ProgramException(const char* c, MatrixType, MatrixType); +}; + +/// Index exception. +class IndexException : public Logic_error +{ +public: + static unsigned long Select; + IndexException(int i, const GeneralMatrix& A); + IndexException(int i, int j, const GeneralMatrix& A); + // next two are for access via element function + IndexException(int i, const GeneralMatrix& A, bool); + IndexException(int i, int j, const GeneralMatrix& A, bool); +}; + +/// Cannot convert to vector exception. +class VectorException : public Logic_error +{ +public: + static unsigned long Select; + VectorException(); + VectorException(const GeneralMatrix& A); +}; + +/// A matrix is not square exception. +class NotSquareException : public Logic_error +{ +public: + static unsigned long Select; + NotSquareException(const GeneralMatrix& A); + NotSquareException(); +}; + +/// Submatrix dimension exception. +class SubMatrixDimensionException : public Logic_error +{ +public: + static unsigned long Select; + SubMatrixDimensionException(); +}; + +/// Incompatible dimensions exception. +class IncompatibleDimensionsException : public Logic_error +{ +public: + static unsigned long Select; + IncompatibleDimensionsException(); + IncompatibleDimensionsException(const GeneralMatrix&); + IncompatibleDimensionsException(const GeneralMatrix&, const GeneralMatrix&); +}; + +/// Not defined exception. +class NotDefinedException : public Logic_error +{ +public: + static unsigned long Select; + NotDefinedException(const char* op, const char* matrix); +}; + +/// Cannot build matrix with these properties exception. +class CannotBuildException : public Logic_error +{ +public: + static unsigned long Select; + CannotBuildException(const char* matrix); +}; + + +/// Internal newmat exception - shouldn't happen. +class InternalException : public Logic_error +{ +public: + static unsigned long Select; // for identifying exception + InternalException(const char* c); +}; + +// ************************ functions ************************************ // + +bool operator==(const GeneralMatrix& A, const GeneralMatrix& B); +bool operator==(const BaseMatrix& A, const BaseMatrix& B); +inline bool operator!=(const GeneralMatrix& A, const GeneralMatrix& B) + { return ! (A==B); } +inline bool operator!=(const BaseMatrix& A, const BaseMatrix& B) + { return ! (A==B); } + + // inequality operators are dummies included for compatibility + // with STL. They throw an exception if actually called. +inline bool operator<=(const BaseMatrix& A, const BaseMatrix&) + { A.IEQND(); return true; } +inline bool operator>=(const BaseMatrix& A, const BaseMatrix&) + { A.IEQND(); return true; } +inline bool operator<(const BaseMatrix& A, const BaseMatrix&) + { A.IEQND(); return true; } +inline bool operator>(const BaseMatrix& A, const BaseMatrix&) + { A.IEQND(); return true; } + +bool is_zero(const BaseMatrix& A); +inline bool IsZero(const BaseMatrix& A) { return is_zero(A); } + +Real dotproduct(const Matrix& A, const Matrix& B); +Matrix crossproduct(const Matrix& A, const Matrix& B); +ReturnMatrix crossproduct_rows(const Matrix& A, const Matrix& B); +ReturnMatrix crossproduct_columns(const Matrix& A, const Matrix& B); + +inline Real DotProduct(const Matrix& A, const Matrix& B) + { return dotproduct(A, B); } +inline Matrix CrossProduct(const Matrix& A, const Matrix& B) + { return crossproduct(A, B); } +inline ReturnMatrix CrossProductRows(const Matrix& A, const Matrix& B) + { return crossproduct_rows(A, B); } +inline ReturnMatrix CrossProductColumns(const Matrix& A, const Matrix& B) + { return crossproduct_columns(A, B); } + +void newmat_block_copy(int n, Real* from, Real* to); + +// ********************* friend functions ******************************** // + +// Functions declared as friends - G++ wants them declared externally as well + +bool Rectangular(MatrixType a, MatrixType b, MatrixType c); +bool Compare(const MatrixType&, MatrixType&); +Real dotproduct(const Matrix& A, const Matrix& B); +SPMatrix SP(const BaseMatrix&, const BaseMatrix&); +KPMatrix KP(const BaseMatrix&, const BaseMatrix&); +ShiftedMatrix operator+(Real f, const BaseMatrix& BM); +NegShiftedMatrix operator-(Real, const BaseMatrix&); +ScaledMatrix operator*(Real f, const BaseMatrix& BM); + +// ********************* inline functions ******************************** // + +inline LogAndSign log_determinant(const BaseMatrix& B) + { return B.log_determinant(); } +inline LogAndSign LogDeterminant(const BaseMatrix& B) + { return B.log_determinant(); } +inline Real determinant(const BaseMatrix& B) + { return B.determinant(); } +inline Real Determinant(const BaseMatrix& B) + { return B.determinant(); } +inline Real sum_square(const BaseMatrix& B) { return B.sum_square(); } +inline Real SumSquare(const BaseMatrix& B) { return B.sum_square(); } +inline Real norm_Frobenius(const BaseMatrix& B) { return B.norm_Frobenius(); } +inline Real norm_frobenius(const BaseMatrix& B) { return B.norm_Frobenius(); } +inline Real NormFrobenius(const BaseMatrix& B) { return B.norm_Frobenius(); } +inline Real trace(const BaseMatrix& B) { return B.trace(); } +inline Real Trace(const BaseMatrix& B) { return B.trace(); } +inline Real sum_absolute_value(const BaseMatrix& B) + { return B.sum_absolute_value(); } +inline Real SumAbsoluteValue(const BaseMatrix& B) + { return B.sum_absolute_value(); } +inline Real sum(const BaseMatrix& B) + { return B.sum(); } +inline Real Sum(const BaseMatrix& B) + { return B.sum(); } +inline Real maximum_absolute_value(const BaseMatrix& B) + { return B.maximum_absolute_value(); } +inline Real MaximumAbsoluteValue(const BaseMatrix& B) + { return B.maximum_absolute_value(); } +inline Real minimum_absolute_value(const BaseMatrix& B) + { return B.minimum_absolute_value(); } +inline Real MinimumAbsoluteValue(const BaseMatrix& B) + { return B.minimum_absolute_value(); } +inline Real maximum(const BaseMatrix& B) { return B.maximum(); } +inline Real Maximum(const BaseMatrix& B) { return B.maximum(); } +inline Real minimum(const BaseMatrix& B) { return B.minimum(); } +inline Real Minimum(const BaseMatrix& B) { return B.minimum(); } +inline Real norm1(const BaseMatrix& B) { return B.norm1(); } +inline Real Norm1(const BaseMatrix& B) { return B.norm1(); } +inline Real norm1(RowVector& RV) { return RV.maximum_absolute_value(); } +inline Real Norm1(RowVector& RV) { return RV.maximum_absolute_value(); } +inline Real norm_infinity(const BaseMatrix& B) { return B.norm_infinity(); } +inline Real NormInfinity(const BaseMatrix& B) { return B.norm_infinity(); } +inline Real norm_infinity(ColumnVector& CV) + { return CV.maximum_absolute_value(); } +inline Real NormInfinity(ColumnVector& CV) + { return CV.maximum_absolute_value(); } +inline bool IsZero(const GeneralMatrix& A) { return A.IsZero(); } +inline bool is_zero(const GeneralMatrix& A) { return A.is_zero(); } + + +inline MatrixInput MatrixInput::operator<<(int f) { return *this << (Real)f; } +inline MatrixInput GeneralMatrix::operator<<(int f) { return *this << (Real)f; } +inline MatrixInput BandMatrix::operator<<(int f) { return *this << (Real)f; } +inline MatrixInput GetSubMatrix::operator<<(int f) { return *this << (Real)f; } + +inline ReversedMatrix BaseMatrix::Reverse() const { return reverse(); } +inline RowedMatrix BaseMatrix::AsRow() const { return as_row(); } +inline ColedMatrix BaseMatrix::AsColumn() const { return as_column(); } +inline DiagedMatrix BaseMatrix::AsDiagonal() const { return as_diagonal(); } +inline MatedMatrix BaseMatrix::AsMatrix(int m, int n) const + { return as_matrix(m, n); } +inline GetSubMatrix BaseMatrix::SubMatrix(int fr, int lr, int fc, int lc) const + { return submatrix(fr, lr, fc, lc); } +inline GetSubMatrix BaseMatrix::SymSubMatrix(int f, int l) const + { return sym_submatrix(f, l); } +inline GetSubMatrix BaseMatrix::Row(int f) const { return row(f); } +inline GetSubMatrix BaseMatrix::Rows(int f, int l) const { return rows(f, l); } +inline GetSubMatrix BaseMatrix::Column(int f) const { return column(f); } +inline GetSubMatrix BaseMatrix::Columns(int f, int l) const + { return columns(f, l); } +inline Real BaseMatrix::AsScalar() const { return as_scalar(); } + +inline ReturnMatrix GeneralMatrix::ForReturn() const { return for_return(); } + +inline void swap(Matrix& A, Matrix& B) { A.swap(B); } +inline void swap(SquareMatrix& A, SquareMatrix& B) { A.swap(B); } +inline void swap(nricMatrix& A, nricMatrix& B) { A.swap(B); } +inline void swap(UpperTriangularMatrix& A, UpperTriangularMatrix& B) + { A.swap(B); } +inline void swap(LowerTriangularMatrix& A, LowerTriangularMatrix& B) + { A.swap(B); } +inline void swap(SymmetricMatrix& A, SymmetricMatrix& B) { A.swap(B); } +inline void swap(DiagonalMatrix& A, DiagonalMatrix& B) { A.swap(B); } +inline void swap(RowVector& A, RowVector& B) { A.swap(B); } +inline void swap(ColumnVector& A, ColumnVector& B) { A.swap(B); } +inline void swap(CroutMatrix& A, CroutMatrix& B) { A.swap(B); } +inline void swap(BandMatrix& A, BandMatrix& B) { A.swap(B); } +inline void swap(UpperBandMatrix& A, UpperBandMatrix& B) { A.swap(B); } +inline void swap(LowerBandMatrix& A, LowerBandMatrix& B) { A.swap(B); } +inline void swap(SymmetricBandMatrix& A, SymmetricBandMatrix& B) { A.swap(B); } +inline void swap(BandLUMatrix& A, BandLUMatrix& B) { A.swap(B); } +inline void swap(IdentityMatrix& A, IdentityMatrix& B) { A.swap(B); } +inline void swap(GenericMatrix& A, GenericMatrix& B) { A.swap(B); } + +#ifdef OPT_COMPATIBLE // for compatibility with opt++ + +inline Real Norm2(const ColumnVector& CV) { return CV.norm_Frobenius(); } +inline Real Dot(ColumnVector& CV1, ColumnVector& CV2) + { return dotproduct(CV1, CV2); } + +#endif + + +#ifdef use_namespace +} +#endif + + +#endif + +// body file: newmat1.cpp +// body file: newmat2.cpp +// body file: newmat3.cpp +// body file: newmat4.cpp +// body file: newmat5.cpp +// body file: newmat6.cpp +// body file: newmat7.cpp +// body file: newmat8.cpp +// body file: newmatex.cpp +// body file: bandmat.cpp +// body file: submat.cpp + + + +///@} + + + + diff --git a/extern/newmat/newmat.lfl b/extern/newmat/newmat.lfl new file mode 100644 index 00000000..dc884f50 --- /dev/null +++ b/extern/newmat/newmat.lfl @@ -0,0 +1,4 @@ +newmat.h +newmatap.h +newmatio.h +myexcept.cpp diff --git a/extern/newmat/newmat1.cpp b/extern/newmat/newmat1.cpp new file mode 100644 index 00000000..d1432d61 --- /dev/null +++ b/extern/newmat/newmat1.cpp @@ -0,0 +1,209 @@ +/// \ingroup newmat +///@{ + +/// \file newmat1.cpp +/// MatrixType functions. +/// Find the type of a matrix resulting from a multiply, add etc +/// Make a new matrix corresponding to a MatrixType + +// Copyright (C) 1991,2,3,4: R B Davies + +//#define WANT_STREAM + +#include "newmat.h" + +#ifdef use_namespace +namespace NEWMAT { +#endif + +#ifdef DO_REPORT +#define REPORT { static ExeCounter ExeCount(__LINE__,1); ++ExeCount; } +#else +#define REPORT {} +#endif + + +/************************* MatrixType functions *****************************/ + + +// Skew needs more work <<<<<<<<< + +// all operations to return MatrixTypes which correspond to valid types +// of matrices. +// Eg: if it has the Diagonal attribute, then it must also have +// Upper, Lower, Band, Square and Symmetric. + + +MatrixType MatrixType::operator*(const MatrixType& mt) const +{ + REPORT + int a = attribute & mt.attribute & ~(Symmetric | Skew); + a |= (a & Diagonal) * 63; // recognise diagonal + return MatrixType(a); +} + +MatrixType MatrixType::SP(const MatrixType& mt) const +// elementwise product +// Lower, Upper, Diag, Band if only one is +// Symmetric, Ones, Valid (and Real) if both are +// Need to include Lower & Upper => Diagonal +// Will need to include both Skew => Symmetric +{ + REPORT + int a = ((attribute | mt.attribute) & ~(Symmetric + Skew + Valid + Ones)) + | (attribute & mt.attribute); + if ((a & Lower) != 0 && (a & Upper) != 0) a |= Diagonal; + if ((attribute & Skew) != 0) + { + if ((mt.attribute & Symmetric) != 0) a |= Skew; + if ((mt.attribute & Skew) != 0) { a &= ~Skew; a |= Symmetric; } + } + else if ((mt.attribute & Skew) != 0 && (attribute & Symmetric) != 0) + a |= Skew; + a |= (a & Diagonal) * 63; // recognise diagonal + return MatrixType(a); +} + +MatrixType MatrixType::KP(const MatrixType& mt) const +// Kronecker product +// Lower, Upper, Diag, Symmetric, Band, Valid if both are +// Band if LHS is band & other is square +// Ones is complicated so leave this out +{ + REPORT + int a = (attribute & mt.attribute) & ~Ones; + if ((attribute & Band) != 0 && (mt.attribute & Square) != 0) + a |= Band; + //int a = ((attribute & mt.attribute) | (attribute & Band)) & ~Ones; + + return MatrixType(a); +} + +MatrixType MatrixType::i() const // type of inverse +{ + REPORT + int a = attribute & ~(Band+LUDeco); + a |= (a & Diagonal) * 63; // recognise diagonal + return MatrixType(a); +} + +MatrixType MatrixType::t() const +// swap lower and upper attributes +// assume Upper is in bit above Lower +{ + REPORT + int a = attribute; + a ^= (((a >> 1) ^ a) & Lower) * 3; + return MatrixType(a); +} + +MatrixType MatrixType::MultRHS() const +{ + REPORT + // remove symmetric attribute unless diagonal + return (attribute >= Dg) ? attribute : (attribute & ~Symmetric); +} + +// this is used for deciding type of multiplication +bool Rectangular(MatrixType a, MatrixType b, MatrixType c) +{ + REPORT + return + ((a.attribute | b.attribute | c.attribute) + & ~(MatrixType::Valid | MatrixType::Square)) == 0; +} + +const char* MatrixType::value() const +{ +// make a string with the name of matrix with the given attributes + switch (attribute) + { + case Valid: REPORT return "Rect "; + case Valid+Square: REPORT return "Squ "; + case Valid+Symmetric+Square: REPORT return "Sym "; + case Valid+Skew+Square: REPORT return "Skew "; + case Valid+Band+Square: REPORT return "Band "; + case Valid+Symmetric+Band+Square: REPORT return "SmBnd"; + case Valid+Skew+Band+Square: REPORT return "SkBnd"; + case Valid+Upper+Square: REPORT return "UT "; + case Valid+Diagonal+Symmetric+Band+Upper+Lower+Square: + REPORT return "Diag "; + case Valid+Diagonal+Symmetric+Band+Upper+Lower+Ones+Square: + REPORT return "Ident"; + case Valid+Band+Upper+Square: REPORT return "UpBnd"; + case Valid+Lower+Square: REPORT return "LT "; + case Valid+Band+Lower+Square: REPORT return "LwBnd"; + default: + REPORT + if (!(attribute & Valid)) return "UnSp "; + if (attribute & LUDeco) + return (attribute & Band) ? "BndLU" : "Crout"; + return "?????"; + } +} + + +GeneralMatrix* MatrixType::New(int nr, int nc, BaseMatrix* bm) const +{ +// make a new matrix with the given attributes + + Tracer tr("New"); GeneralMatrix* gm=0; // initialised to keep gnu happy + switch (attribute) + { + case Valid: + REPORT + if (nc==1) { gm = new ColumnVector(nr); break; } + if (nr==1) { gm = new RowVector(nc); break; } + gm = new Matrix(nr, nc); break; + + case Valid+Square: + REPORT + if (nc!=nr) { Throw(NotSquareException()); } + gm = new SquareMatrix(nr); break; + + case Valid+Symmetric+Square: + REPORT gm = new SymmetricMatrix(nr); break; + + case Valid+Band+Square: + { + REPORT + MatrixBandWidth bw = bm->bandwidth(); + gm = new BandMatrix(nr,bw.lower_val,bw.upper_val); break; + } + + case Valid+Symmetric+Band+Square: + REPORT gm = new SymmetricBandMatrix(nr,bm->bandwidth().lower_val); break; + + case Valid+Upper+Square: + REPORT gm = new UpperTriangularMatrix(nr); break; + + case Valid+Diagonal+Symmetric+Band+Upper+Lower+Square: + REPORT gm = new DiagonalMatrix(nr); break; + + case Valid+Band+Upper+Square: + REPORT gm = new UpperBandMatrix(nr,bm->bandwidth().upper_val); break; + + case Valid+Lower+Square: + REPORT gm = new LowerTriangularMatrix(nr); break; + + case Valid+Band+Lower+Square: + REPORT gm = new LowerBandMatrix(nr,bm->bandwidth().lower_val); break; + + case Valid+Diagonal+Symmetric+Band+Upper+Lower+Ones+Square: + REPORT gm = new IdentityMatrix(nr); break; + + default: + Throw(ProgramException("Invalid matrix type")); + } + + MatrixErrorNoSpace(gm); gm->Protect(); return gm; +} + + +#ifdef use_namespace +} +#endif + + + +///@} diff --git a/extern/newmat/newmat2.cpp b/extern/newmat/newmat2.cpp new file mode 100644 index 00000000..aac78ebb --- /dev/null +++ b/extern/newmat/newmat2.cpp @@ -0,0 +1,675 @@ +/// \ingroup newmat +///@{ + +/// \file newmat2.cpp +/// Matrix row and column operations. +/// The operations on individual rows and columns used to carry out matrix +/// add, multiply etc. + + +// Copyright (C) 1991,2,3,4: R B Davies + +#define WANT_MATH + +#include "include.h" + +#include "newmat.h" +#include "newmatrc.h" + +#ifdef use_namespace +namespace NEWMAT { +#endif + + +#ifdef DO_REPORT +#define REPORT { static ExeCounter ExeCount(__LINE__,2); ++ExeCount; } +#else +#define REPORT {} +#endif + +//#define MONITOR(what,storage,store) { cout << what << " " << storage << " at " << (long)store << "\n"; } + +#define MONITOR(what,store,storage) {} + +/************************** Matrix Row/Col functions ************************/ + +void MatrixRowCol::Add(const MatrixRowCol& mrc) +{ + // THIS += mrc + REPORT + int f = mrc.skip; int l = f + mrc.storage; int lx = skip + storage; + if (f < skip) f = skip; + if (l > lx) l = lx; + l -= f; + if (l<=0) return; + Real* elx=data+(f-skip); Real* el=mrc.data+(f-mrc.skip); + while (l--) *elx++ += *el++; +} + +void MatrixRowCol::AddScaled(const MatrixRowCol& mrc, Real x) +{ + REPORT + // THIS += (mrc * x) + int f = mrc.skip; int l = f + mrc.storage; int lx = skip + storage; + if (f < skip) f = skip; + if (l > lx) l = lx; + l -= f; + if (l<=0) return; + Real* elx=data+(f-skip); Real* el=mrc.data+(f-mrc.skip); + while (l--) *elx++ += *el++ * x; +} + +void MatrixRowCol::Sub(const MatrixRowCol& mrc) +{ + REPORT + // THIS -= mrc + int f = mrc.skip; int l = f + mrc.storage; int lx = skip + storage; + if (f < skip) f = skip; + if (l > lx) l = lx; + l -= f; + if (l<=0) return; + Real* elx=data+(f-skip); Real* el=mrc.data+(f-mrc.skip); + while (l--) *elx++ -= *el++; +} + +void MatrixRowCol::Inject(const MatrixRowCol& mrc) +// copy stored elements only +{ + REPORT + int f = mrc.skip; int l = f + mrc.storage; int lx = skip + storage; + if (f < skip) f = skip; + if (l > lx) l = lx; + l -= f; + if (l<=0) return; + Real* elx=data+(f-skip); Real* ely=mrc.data+(f-mrc.skip); + while (l--) *elx++ = *ely++; +} + +Real DotProd(const MatrixRowCol& mrc1, const MatrixRowCol& mrc2) +{ + REPORT // not accessed + int f = mrc1.skip; int f2 = mrc2.skip; + int l = f + mrc1.storage; int l2 = f2 + mrc2.storage; + if (f < f2) f = f2; + if (l > l2) l = l2; + l -= f; + if (l<=0) return 0.0; + + Real* el1=mrc1.data+(f-mrc1.skip); Real* el2=mrc2.data+(f-mrc2.skip); + Real sum = 0.0; + while (l--) sum += *el1++ * *el2++; + return sum; +} + +void MatrixRowCol::Add(const MatrixRowCol& mrc1, const MatrixRowCol& mrc2) +{ + // THIS = mrc1 + mrc2 + int f = skip; int l = skip + storage; + int f1 = mrc1.skip; int l1 = f1 + mrc1.storage; + if (f1l) l1=l; + int f2 = mrc2.skip; int l2 = f2 + mrc2.storage; + if (f2l) l2=l; + Real* el = data + (f-skip); + Real* el1 = mrc1.data+(f1-mrc1.skip); Real* el2 = mrc2.data+(f2-mrc2.skip); + if (f1l) l1=l; + int f2 = mrc2.skip; int l2 = f2 + mrc2.storage; + if (f2l) l2=l; + Real* el = data + (f-skip); + Real* el1 = mrc1.data+(f1-mrc1.skip); Real* el2 = mrc2.data+(f2-mrc2.skip); + if (f1 lx) { l = lx; if (f > lx) f = lx; } + + Real* elx = data; Real* ely = mrc1.data+(f-mrc1.skip); + + int l1 = f-skip; while (l1--) *elx++ = x; + l1 = l-f; while (l1--) *elx++ = *ely++ + x; + lx -= l; while (lx--) *elx++ = x; +} + +void MatrixRowCol::NegAdd(const MatrixRowCol& mrc1, Real x) +{ + // THIS = x - mrc1 + REPORT + if (!storage) return; + int f = mrc1.skip; int l = f + mrc1.storage; int lx = skip + storage; + if (f < skip) { f = skip; if (l < f) l = f; } + if (l > lx) { l = lx; if (f > lx) f = lx; } + + Real* elx = data; Real* ely = mrc1.data+(f-mrc1.skip); + + int l1 = f-skip; while (l1--) *elx++ = x; + l1 = l-f; while (l1--) *elx++ = x - *ely++; + lx -= l; while (lx--) *elx++ = x; +} + +void MatrixRowCol::RevSub(const MatrixRowCol& mrc1) +{ + // THIS = mrc - THIS + REPORT + if (!storage) return; + int f = mrc1.skip; int l = f + mrc1.storage; int lx = skip + storage; + if (f < skip) { f = skip; if (l < f) l = f; } + if (l > lx) { l = lx; if (f > lx) f = lx; } + + Real* elx = data; Real* ely = mrc1.data+(f-mrc1.skip); + + int l1 = f-skip; while (l1--) { *elx = - *elx; elx++; } + l1 = l-f; while (l1--) { *elx = *ely++ - *elx; elx++; } + lx -= l; while (lx--) { *elx = - *elx; elx++; } +} + +void MatrixRowCol::ConCat(const MatrixRowCol& mrc1, const MatrixRowCol& mrc2) +{ + // THIS = mrc1 | mrc2 + REPORT + int f1 = mrc1.skip; int l1 = f1 + mrc1.storage; int lx = skip + storage; + if (f1 < skip) { f1 = skip; if (l1 < f1) l1 = f1; } + if (l1 > lx) { l1 = lx; if (f1 > lx) f1 = lx; } + + Real* elx = data; + + int i = f1-skip; while (i--) *elx++ =0.0; + i = l1-f1; + if (i) // in case f1 would take ely out of range + { Real* ely = mrc1.data+(f1-mrc1.skip); while (i--) *elx++ = *ely++; } + + int f2 = mrc2.skip; int l2 = f2 + mrc2.storage; i = mrc1.length; + int skipx = l1 - i; lx -= i; // addresses rel to second seg, maybe -ve + if (f2 < skipx) { f2 = skipx; if (l2 < f2) l2 = f2; } + if (l2 > lx) { l2 = lx; if (f2 > lx) f2 = lx; } + + i = f2-skipx; while (i--) *elx++ = 0.0; + i = l2-f2; + if (i) // in case f2 would take ely out of range + { Real* ely = mrc2.data+(f2-mrc2.skip); while (i--) *elx++ = *ely++; } + lx -= l2; while (lx--) *elx++ = 0.0; +} + +void MatrixRowCol::Multiply(const MatrixRowCol& mrc1) +// element by element multiply into +{ + REPORT + if (!storage) return; + int f = mrc1.skip; int l = f + mrc1.storage; int lx = skip + storage; + if (f < skip) { f = skip; if (l < f) l = f; } + if (l > lx) { l = lx; if (f > lx) f = lx; } + + Real* elx = data; Real* ely = mrc1.data+(f-mrc1.skip); + + int l1 = f-skip; while (l1--) *elx++ = 0; + l1 = l-f; while (l1--) *elx++ *= *ely++; + lx -= l; while (lx--) *elx++ = 0; +} + +void MatrixRowCol::Multiply(const MatrixRowCol& mrc1, const MatrixRowCol& mrc2) +// element by element multiply +{ + int f = skip; int l = skip + storage; + int f1 = mrc1.skip; int l1 = f1 + mrc1.storage; + if (f1l) l1=l; + int f2 = mrc2.skip; int l2 = f2 + mrc2.storage; + if (f2l) l2=l; + Real* el = data + (f-skip); int i; + if (f1l2) l1 = l2; + if (l1<=f1) { REPORT i = l-f; while (i--) *el++ = 0.0; } // disjoint + else + { + REPORT + Real* el1 = mrc1.data+(f1-mrc1.skip); + Real* el2 = mrc2.data+(f1-mrc2.skip); + i = f1-f ; while (i--) *el++ = 0.0; + i = l1-f1; while (i--) *el++ = *el1++ * *el2++; + i = l-l1; while (i--) *el++ = 0.0; + } +} + +void MatrixRowCol::KP(const MatrixRowCol& mrc1, const MatrixRowCol& mrc2) +// row for Kronecker product +{ + int f = skip; int s = storage; Real* el = data; int i; + + i = mrc1.skip * mrc2.length; + if (i > f) + { + i -= f; f = 0; if (i > s) { i = s; s = 0; } else s -= i; + while (i--) *el++ = 0.0; + if (s == 0) return; + } + else f -= i; + + i = mrc1.storage; Real* el1 = mrc1.data; + int mrc2_skip = mrc2.skip; int mrc2_storage = mrc2.storage; + int mrc2_length = mrc2.length; + int mrc2_remain = mrc2_length - mrc2_skip - mrc2_storage; + while (i--) + { + int j; Real* el2 = mrc2.data; Real vel1 = *el1; + if (f == 0 && mrc2_length <= s) + { + j = mrc2_skip; s -= j; while (j--) *el++ = 0.0; + j = mrc2_storage; s -= j; while (j--) *el++ = vel1 * *el2++; + j = mrc2_remain; s -= j; while (j--) *el++ = 0.0; + } + else if (f >= mrc2_length) f -= mrc2_length; + else + { + j = mrc2_skip; + if (j > f) + { + j -= f; f = 0; if (j > s) { j = s; s = 0; } else s -= j; + while (j--) *el++ = 0.0; + } + else f -= j; + + j = mrc2_storage; + if (j > f) + { + j -= f; el2 += f; f = 0; if (j > s) { j = s; s = 0; } else s -= j; + while (j--) *el++ = vel1 * *el2++; + } + else f -= j; + + j = mrc2_remain; + if (j > f) + { + j -= f; f = 0; if (j > s) { j = s; s = 0; } else s -= j; + while (j--) *el++ = 0.0; + } + else f -= j; + } + if (s == 0) return; + ++el1; + } + + i = (mrc1.length - mrc1.skip - mrc1.storage) * mrc2.length; + if (i > f) + { + i -= f; if (i > s) i = s; + while (i--) *el++ = 0.0; + } +} + + +void MatrixRowCol::Copy(const MatrixRowCol& mrc1) +{ + // THIS = mrc1 + REPORT + if (!storage) return; + int f = mrc1.skip; int l = f + mrc1.storage; int lx = skip + storage; + if (f < skip) { f = skip; if (l < f) l = f; } + if (l > lx) { l = lx; if (f > lx) f = lx; } + + Real* elx = data; Real* ely = 0; + + if (l-f) ely = mrc1.data+(f-mrc1.skip); + + int l1 = f-skip; while (l1--) *elx++ = 0.0; + l1 = l-f; while (l1--) *elx++ = *ely++; + lx -= l; while (lx--) *elx++ = 0.0; +} + +void MatrixRowCol::CopyCheck(const MatrixRowCol& mrc1) +// Throw an exception if this would lead to a loss of data +{ + REPORT + if (!storage) return; + int f = mrc1.skip; int l = f + mrc1.storage; int lx = skip + storage; + if (f < skip || l > lx) Throw(ProgramException("Illegal Conversion")); + + Real* elx = data; Real* ely = mrc1.data+(f-mrc1.skip); + + int l1 = f-skip; while (l1--) *elx++ = 0.0; + l1 = l-f; while (l1--) *elx++ = *ely++; + lx -= l; while (lx--) *elx++ = 0.0; +} + +void MatrixRowCol::Check(const MatrixRowCol& mrc1) +// Throw an exception if +=, -=, copy etc would lead to a loss of data +{ + REPORT + int f = mrc1.skip; int l = f + mrc1.storage; int lx = skip + storage; + if (f < skip || l > lx) Throw(ProgramException("Illegal Conversion")); +} + +void MatrixRowCol::Check() +// Throw an exception if +=, -= of constant would lead to a loss of data +// that is: check full row is present +// may not be appropriate for symmetric matrices +{ + REPORT + if (skip!=0 || storage!=length) + Throw(ProgramException("Illegal Conversion")); +} + +void MatrixRowCol::Negate(const MatrixRowCol& mrc1) +{ + // THIS = -mrc1 + REPORT + if (!storage) return; + int f = mrc1.skip; int l = f + mrc1.storage; int lx = skip + storage; + if (f < skip) { f = skip; if (l < f) l = f; } + if (l > lx) { l = lx; if (f > lx) f = lx; } + + Real* elx = data; Real* ely = mrc1.data+(f-mrc1.skip); + + int l1 = f-skip; while (l1--) *elx++ = 0.0; + l1 = l-f; while (l1--) *elx++ = - *ely++; + lx -= l; while (lx--) *elx++ = 0.0; +} + +void MatrixRowCol::Multiply(const MatrixRowCol& mrc1, Real s) +{ + // THIS = mrc1 * s + REPORT + if (!storage) return; + int f = mrc1.skip; int l = f + mrc1.storage; int lx = skip + storage; + if (f < skip) { f = skip; if (l < f) l = f; } + if (l > lx) { l = lx; if (f > lx) f = lx; } + + Real* elx = data; Real* ely = mrc1.data+(f-mrc1.skip); + + int l1 = f-skip; while (l1--) *elx++ = 0.0; + l1 = l-f; while (l1--) *elx++ = *ely++ * s; + lx -= l; while (lx--) *elx++ = 0.0; +} + +void DiagonalMatrix::Solver(MatrixColX& mrc, const MatrixColX& mrc1) +{ + // mrc = mrc / mrc1 (elementwise) + REPORT + int f = mrc1.skip; int f0 = mrc.skip; + int l = f + mrc1.storage; int lx = f0 + mrc.storage; + if (f < f0) { f = f0; if (l < f) l = f; } + if (l > lx) { l = lx; if (f > lx) f = lx; } + + Real* elx = mrc.data; Real* eld = store+f; + + int l1 = f-f0; while (l1--) *elx++ = 0.0; + l1 = l-f; while (l1--) *elx++ /= *eld++; + lx -= l; while (lx--) *elx++ = 0.0; + // Solver makes sure input and output point to same memory +} + +void IdentityMatrix::Solver(MatrixColX& mrc, const MatrixColX& mrc1) +{ + // mrc = mrc / mrc1 (elementwise) + REPORT + int f = mrc1.skip; int f0 = mrc.skip; + int l = f + mrc1.storage; int lx = f0 + mrc.storage; + if (f < f0) { f = f0; if (l < f) l = f; } + if (l > lx) { l = lx; if (f > lx) f = lx; } + + Real* elx = mrc.data; Real eldv = *store; + + int l1 = f-f0; while (l1--) *elx++ = 0.0; + l1 = l-f; while (l1--) *elx++ /= eldv; + lx -= l; while (lx--) *elx++ = 0.0; + // Solver makes sure input and output point to same memory +} + +void MatrixRowCol::Copy(const double*& r) +{ + // THIS = *r + REPORT + Real* elx = data; const double* ely = r+skip; r += length; + int l = storage; while (l--) *elx++ = (Real)*ely++; +} + +void MatrixRowCol::Copy(const float*& r) +{ + // THIS = *r + REPORT + Real* elx = data; const float* ely = r+skip; r += length; + int l = storage; while (l--) *elx++ = (Real)*ely++; +} + +void MatrixRowCol::Copy(const int*& r) +{ + // THIS = *r + REPORT + Real* elx = data; const int* ely = r+skip; r += length; + int l = storage; while (l--) *elx++ = (Real)*ely++; +} + +void MatrixRowCol::Copy(Real r) +{ + // THIS = r + REPORT Real* elx = data; int l = storage; while (l--) *elx++ = r; +} + +void MatrixRowCol::Zero() +{ + // THIS = 0 + REPORT Real* elx = data; int l = storage; while (l--) *elx++ = 0; +} + +void MatrixRowCol::Multiply(Real r) +{ + // THIS *= r + REPORT Real* elx = data; int l = storage; while (l--) *elx++ *= r; +} + +void MatrixRowCol::Add(Real r) +{ + // THIS += r + REPORT + Real* elx = data; int l = storage; while (l--) *elx++ += r; +} + +Real MatrixRowCol::SumAbsoluteValue() +{ + REPORT + Real sum = 0.0; Real* elx = data; int l = storage; + while (l--) sum += fabs(*elx++); + return sum; +} + +// max absolute value of r and elements of row/col +// we use <= or >= in all of these so we are sure of getting +// r reset at least once. +Real MatrixRowCol::MaximumAbsoluteValue1(Real r, int& i) +{ + REPORT + Real* elx = data; int l = storage; int li = -1; + while (l--) { Real f = fabs(*elx++); if (r <= f) { r = f; li = l; } } + i = (li >= 0) ? storage - li + skip : 0; + return r; +} + +// min absolute value of r and elements of row/col +Real MatrixRowCol::MinimumAbsoluteValue1(Real r, int& i) +{ + REPORT + Real* elx = data; int l = storage; int li = -1; + while (l--) { Real f = fabs(*elx++); if (r >= f) { r = f; li = l; } } + i = (li >= 0) ? storage - li + skip : 0; + return r; +} + +// max value of r and elements of row/col +Real MatrixRowCol::Maximum1(Real r, int& i) +{ + REPORT + Real* elx = data; int l = storage; int li = -1; + while (l--) { Real f = *elx++; if (r <= f) { r = f; li = l; } } + i = (li >= 0) ? storage - li + skip : 0; + return r; +} + +// min value of r and elements of row/col +Real MatrixRowCol::Minimum1(Real r, int& i) +{ + REPORT + Real* elx = data; int l = storage; int li = -1; + while (l--) { Real f = *elx++; if (r >= f) { r = f; li = l; } } + i = (li >= 0) ? storage - li + skip : 0; + return r; +} + +Real MatrixRowCol::Sum() +{ + REPORT + Real sum = 0.0; Real* elx = data; int l = storage; + while (l--) sum += *elx++; + return sum; +} + +void MatrixRowCol::SubRowCol(MatrixRowCol& mrc, int skip1, int l1) const +{ + mrc.length = l1; int d = skip - skip1; + if (d<0) { mrc.skip = 0; mrc.data = data - d; } + else { mrc.skip = d; mrc.data = data; } + d = skip + storage - skip1; + d = ((l1 < d) ? l1 : d) - mrc.skip; mrc.storage = (d < 0) ? 0 : d; + mrc.cw = 0; +} + +#ifdef use_namespace +} +#endif + + +///@} diff --git a/extern/newmat/newmat3.cpp b/extern/newmat/newmat3.cpp new file mode 100644 index 00000000..a48fdc11 --- /dev/null +++ b/extern/newmat/newmat3.cpp @@ -0,0 +1,855 @@ +/// \ingroup newmat +///@{ + +/// \file newmat3.cpp +/// Get and restore rows and columns. + +// Copyright (C) 1991,2,3,4: R B Davies + +//#define WANT_STREAM + +#include "include.h" + +#include "newmat.h" +#include "newmatrc.h" + +#ifdef use_namespace +namespace NEWMAT { +#endif + + +#ifdef DO_REPORT +#define REPORT { static ExeCounter ExeCount(__LINE__,3); ++ExeCount; } +#else +#define REPORT {} +#endif + +//#define MONITOR(what,storage,store) +// { cout << what << " " << storage << " at " << (long)store << "\n"; } + +#define MONITOR(what,store,storage) {} + + +// Control bits codes for GetRow, GetCol, RestoreRow, RestoreCol +// +// LoadOnEntry: +// Load data into MatrixRow or Col dummy array under GetRow or GetCol +// StoreOnExit: +// Restore data to original matrix under RestoreRow or RestoreCol +// DirectPart: +// Load or restore only part directly stored; must be set with StoreOnExit +// Still have decide how to handle this with symmetric +// StoreHere: +// used in columns only - store data at supplied storage address; +// used for GetCol, NextCol & RestoreCol. No need to fill out zeros +// HaveStore: +// dummy array has been assigned (internal use only). + +// For symmetric matrices, treat columns as rows unless StoreHere is set; +// then stick to columns as this will give better performance for doing +// inverses + +// How components are used: + +// Use rows wherever possible in preference to columns + +// Columns without StoreHere are used in in-exact transpose, sum column, +// multiply a column vector, and maybe in future access to column, +// additional multiply functions, add transpose + +// Columns with StoreHere are used in exact transpose (not symmetric matrices +// or vectors, load only) + +// Columns with MatrixColX (Store to full column) are used in inverse and solve + +// Functions required for each matrix class + +// GetRow(MatrixRowCol& mrc) +// GetCol(MatrixRowCol& mrc) +// GetCol(MatrixColX& mrc) +// RestoreRow(MatrixRowCol& mrc) +// RestoreCol(MatrixRowCol& mrc) +// RestoreCol(MatrixColX& mrc) +// NextRow(MatrixRowCol& mrc) +// NextCol(MatrixRowCol& mrc) +// NextCol(MatrixColX& mrc) + +// The Restore routines assume StoreOnExit has already been checked +// Defaults for the Next routines are given below +// Assume cannot have both !DirectPart && StoreHere for MatrixRowCol routines + + +// Default NextRow and NextCol: +// will work as a default but need to override NextRow for efficiency + +void GeneralMatrix::NextRow(MatrixRowCol& mrc) +{ + REPORT + if (+(mrc.cw*StoreOnExit)) { REPORT this->RestoreRow(mrc); } + mrc.rowcol++; + if (mrc.rowcolGetRow(mrc); } + else { REPORT mrc.cw -= StoreOnExit; } +} + +void GeneralMatrix::NextCol(MatrixRowCol& mrc) +{ + REPORT // 423 + if (+(mrc.cw*StoreOnExit)) { REPORT this->RestoreCol(mrc); } + mrc.rowcol++; + if (mrc.rowcolGetCol(mrc); } + else { REPORT mrc.cw -= StoreOnExit; } +} + +void GeneralMatrix::NextCol(MatrixColX& mrc) +{ + REPORT // 423 + if (+(mrc.cw*StoreOnExit)) { REPORT this->RestoreCol(mrc); } + mrc.rowcol++; + if (mrc.rowcolGetCol(mrc); } + else { REPORT mrc.cw -= StoreOnExit; } +} + + +// routines for matrix + +void Matrix::GetRow(MatrixRowCol& mrc) +{ + REPORT + mrc.skip=0; mrc.storage=mrc.length=ncols_val; + mrc.data=store+mrc.rowcol*ncols_val; +} + + +void Matrix::GetCol(MatrixRowCol& mrc) +{ + REPORT + mrc.skip=0; mrc.storage=mrc.length=nrows_val; + if ( ncols_val==1 && !(mrc.cw*StoreHere) ) // ColumnVector + { REPORT mrc.data=store; } + else + { + Real* ColCopy; + if ( !(mrc.cw*(HaveStore+StoreHere)) ) + { + REPORT + ColCopy = new Real [nrows_val]; MatrixErrorNoSpace(ColCopy); + MONITOR_REAL_NEW("Make (MatGetCol)",nrows_val,ColCopy) + mrc.data = ColCopy; mrc.cw += HaveStore; + } + else { REPORT ColCopy = mrc.data; } + if (+(mrc.cw*LoadOnEntry)) + { + REPORT + Real* Mstore = store+mrc.rowcol; int i=nrows_val; + //while (i--) { *ColCopy++ = *Mstore; Mstore+=ncols_val; } + if (i) for (;;) + { *ColCopy++ = *Mstore; if (!(--i)) break; Mstore+=ncols_val; } + } + } +} + +void Matrix::GetCol(MatrixColX& mrc) +{ + REPORT + mrc.skip=0; mrc.storage=nrows_val; mrc.length=nrows_val; + if (+(mrc.cw*LoadOnEntry)) + { + REPORT Real* ColCopy = mrc.data; + Real* Mstore = store+mrc.rowcol; int i=nrows_val; + //while (i--) { *ColCopy++ = *Mstore; Mstore+=ncols_val; } + if (i) for (;;) + { *ColCopy++ = *Mstore; if (!(--i)) break; Mstore+=ncols_val; } + } +} + +void Matrix::RestoreCol(MatrixRowCol& mrc) +{ + // always check StoreOnExit before calling RestoreCol + REPORT // 429 + if (+(mrc.cw*HaveStore)) + { + REPORT // 426 + Real* Mstore = store+mrc.rowcol; int i=nrows_val; + Real* Cstore = mrc.data; + // while (i--) { *Mstore = *Cstore++; Mstore+=ncols_val; } + if (i) for (;;) + { *Mstore = *Cstore++; if (!(--i)) break; Mstore+=ncols_val; } + } +} + +void Matrix::RestoreCol(MatrixColX& mrc) +{ + REPORT + Real* Mstore = store+mrc.rowcol; int i=nrows_val; Real* Cstore = mrc.data; + // while (i--) { *Mstore = *Cstore++; Mstore+=ncols_val; } + if (i) for (;;) + { *Mstore = *Cstore++; if (!(--i)) break; Mstore+=ncols_val; } +} + +void Matrix::NextRow(MatrixRowCol& mrc) { REPORT mrc.IncrMat(); } // 1808 + +void Matrix::NextCol(MatrixRowCol& mrc) +{ + REPORT // 632 + if (+(mrc.cw*StoreOnExit)) { REPORT RestoreCol(mrc); } + mrc.rowcol++; + if (mrc.rowcol= LoadOnEntry) + { REPORT *(mrc.data) = *(store+mrc.rowcol); } + +} + +void RowVector::NextCol(MatrixRowCol& mrc) +{ REPORT mrc.rowcol++; mrc.data++; } + +void RowVector::NextCol(MatrixColX& mrc) +{ + if (+(mrc.cw*StoreOnExit)) { REPORT *(store+mrc.rowcol)=*(mrc.data); } + + mrc.rowcol++; + if (mrc.rowcol < ncols_val) + { + if (+(mrc.cw*LoadOnEntry)) { REPORT *(mrc.data)=*(store+mrc.rowcol); } + } + else { REPORT mrc.cw -= StoreOnExit; } +} + +void RowVector::RestoreCol(MatrixColX& mrc) + { REPORT *(store+mrc.rowcol)=*(mrc.data); } // not accessed + + +// routines for band matrices + +void BandMatrix::GetRow(MatrixRowCol& mrc) +{ + REPORT + int r = mrc.rowcol; int w = lower_val+1+upper_val; mrc.length=ncols_val; + int s = r-lower_val; + if (s<0) { mrc.data = store+(r*w-s); w += s; s = 0; } + else mrc.data = store+r*w; + mrc.skip = s; s += w-ncols_val; if (s>0) w -= s; mrc.storage = w; +} + +// should make special versions of this for upper and lower band matrices + +void BandMatrix::NextRow(MatrixRowCol& mrc) +{ + REPORT + int r = ++mrc.rowcol; + if (r<=lower_val) { mrc.storage++; mrc.data += lower_val+upper_val; } + else { mrc.skip++; mrc.data += lower_val+upper_val+1; } + if (r>=ncols_val-upper_val) mrc.storage--; +} + +void BandMatrix::GetCol(MatrixRowCol& mrc) +{ + REPORT + int c = mrc.rowcol; int n = lower_val+upper_val; int w = n+1; + mrc.length=nrows_val; Real* ColCopy; + int b; int s = c-upper_val; + if (s<=0) { w += s; s = 0; b = c+lower_val; } else b = s*w+n; + mrc.skip = s; s += w-nrows_val; if (s>0) w -= s; mrc.storage = w; + if ( +(mrc.cw*(StoreHere+HaveStore)) ) + { REPORT ColCopy = mrc.data; } + else + { + REPORT + ColCopy = new Real [n+1]; MatrixErrorNoSpace(ColCopy); + MONITOR_REAL_NEW("Make (BMGetCol)",n+1,ColCopy) + mrc.cw += HaveStore; mrc.data = ColCopy; + } + + if (+(mrc.cw*LoadOnEntry)) + { + REPORT + Real* Mstore = store+b; + // while (w--) { *ColCopy++ = *Mstore; Mstore+=n; } + if (w) for (;;) + { *ColCopy++ = *Mstore; if (!(--w)) break; Mstore+=n; } + } +} + +void BandMatrix::GetCol(MatrixColX& mrc) +{ + REPORT + int c = mrc.rowcol; int n = lower_val+upper_val; int w = n+1; + mrc.length=nrows_val; int b; int s = c-upper_val; + if (s<=0) { w += s; s = 0; b = c+lower_val; } else b = s*w+n; + mrc.skip = s; s += w-nrows_val; if (s>0) w -= s; mrc.storage = w; + mrc.data = mrc.store+mrc.skip; + + if (+(mrc.cw*LoadOnEntry)) + { + REPORT + Real* ColCopy = mrc.data; Real* Mstore = store+b; + // while (w--) { *ColCopy++ = *Mstore; Mstore+=n; } + if (w) for (;;) + { *ColCopy++ = *Mstore; if (!(--w)) break; Mstore+=n; } + } +} + +void BandMatrix::RestoreCol(MatrixRowCol& mrc) +{ + REPORT + int c = mrc.rowcol; int n = lower_val+upper_val; int s = c-upper_val; + Real* Mstore = store + ((s<=0) ? c+lower_val : s*n+s+n); + Real* Cstore = mrc.data; + int w = mrc.storage; + // while (w--) { *Mstore = *Cstore++; Mstore += n; } + if (w) for (;;) + { *Mstore = *Cstore++; if (!(--w)) break; Mstore += n; } +} + +// routines for symmetric band matrix + +void SymmetricBandMatrix::GetRow(MatrixRowCol& mrc) +{ + REPORT + int r=mrc.rowcol; int s = r-lower_val; int w1 = lower_val+1; int o = r*w1; + mrc.length = ncols_val; + if (s<0) { w1 += s; o -= s; s = 0; } + mrc.skip = s; + + if (+(mrc.cw*DirectPart)) + { REPORT mrc.data = store+o; mrc.storage = w1; } + else + { + // do not allow StoreOnExit and !DirectPart + if (+(mrc.cw*StoreOnExit)) + Throw(InternalException("SymmetricBandMatrix::GetRow(MatrixRowCol&)")); + int w = w1+lower_val; s += w-ncols_val; Real* RowCopy; + if (s>0) w -= s; + mrc.storage = w; + int w2 = w-w1; + if (!(mrc.cw*HaveStore)) + { + REPORT + RowCopy = new Real [2*lower_val+1]; MatrixErrorNoSpace(RowCopy); + MONITOR_REAL_NEW("Make (SmBGetRow)",2*lower_val+1,RowCopy) + mrc.cw += HaveStore; mrc.data = RowCopy; + } + else { REPORT RowCopy = mrc.data; } + + if (+(mrc.cw*LoadOnEntry) && ncols_val > 0) + { + REPORT + Real* Mstore = store+o; + while (w1--) *RowCopy++ = *Mstore++; + Mstore--; + while (w2--) { Mstore += lower_val; *RowCopy++ = *Mstore; } + } + } +} + +void SymmetricBandMatrix::GetCol(MatrixRowCol& mrc) +{ + // do not allow StoreHere + if (+(mrc.cw*StoreHere)) + Throw(InternalException("SymmetricBandMatrix::GetCol(MatrixRowCol&)")); + + int c=mrc.rowcol; int w1 = lower_val+1; mrc.length=nrows_val; + REPORT + int s = c-lower_val; int o = c*w1; + if (s<0) { w1 += s; o -= s; s = 0; } + mrc.skip = s; + + if (+(mrc.cw*DirectPart)) + { REPORT mrc.data = store+o; mrc.storage = w1; } + else + { + // do not allow StoreOnExit and !DirectPart + if (+(mrc.cw*StoreOnExit)) + Throw(InternalException("SymmetricBandMatrix::GetCol(MatrixRowCol&)")); + int w = w1+lower_val; s += w-ncols_val; Real* ColCopy; + if (s>0) w -= s; + mrc.storage = w; + int w2 = w-w1; + + if ( +(mrc.cw*HaveStore) ) { REPORT ColCopy = mrc.data; } + else + { + REPORT ColCopy = new Real [2*lower_val+1]; MatrixErrorNoSpace(ColCopy); + MONITOR_REAL_NEW("Make (SmBGetCol)",2*lower_val+1,ColCopy) + mrc.cw += HaveStore; mrc.data = ColCopy; + } + + if (+(mrc.cw*LoadOnEntry)) + { + REPORT + Real* Mstore = store+o; + while (w1--) *ColCopy++ = *Mstore++; + Mstore--; + while (w2--) { Mstore += lower_val; *ColCopy++ = *Mstore; } + } + } +} + +void SymmetricBandMatrix::GetCol(MatrixColX& mrc) +{ + int c=mrc.rowcol; int w1 = lower_val+1; mrc.length=nrows_val; + if (+(mrc.cw*DirectPart)) + { + REPORT + int b = c*w1+lower_val; + mrc.skip = c; c += w1-nrows_val; w1 -= c; mrc.storage = w1; + Real* ColCopy = mrc.data = mrc.store+mrc.skip; + if (+(mrc.cw*LoadOnEntry)) + { + REPORT + Real* Mstore = store+b; + // while (w1--) { *ColCopy++ = *Mstore; Mstore += lower; } + if (w1) for (;;) + { *ColCopy++ = *Mstore; if (!(--w1)) break; Mstore += lower_val; } + } + } + else + { + REPORT + // do not allow StoreOnExit and !DirectPart + if (+(mrc.cw*StoreOnExit)) + Throw(InternalException("SymmetricBandMatrix::GetCol(MatrixColX&)")); + int s = c-lower_val; int o = c*w1; + if (s<0) { w1 += s; o -= s; s = 0; } + mrc.skip = s; + + int w = w1+lower_val; s += w-ncols_val; + if (s>0) w -= s; + mrc.storage = w; + int w2 = w-w1; + + Real* ColCopy = mrc.data = mrc.store+mrc.skip; + + if (+(mrc.cw*LoadOnEntry)) + { + REPORT + Real* Mstore = store+o; + while (w1--) *ColCopy++ = *Mstore++; + Mstore--; + while (w2--) { Mstore += lower_val; *ColCopy++ = *Mstore; } + } + + } +} + +void SymmetricBandMatrix::RestoreCol(MatrixColX& mrc) +{ + REPORT + int c = mrc.rowcol; + Real* Mstore = store + c*lower_val+c+lower_val; + Real* Cstore = mrc.data; int w = mrc.storage; + // while (w--) { *Mstore = *Cstore++; Mstore += lower_val; } + if (w) for (;;) + { *Mstore = *Cstore++; if (!(--w)) break; Mstore += lower_val; } +} + +// routines for identity matrix + +void IdentityMatrix::GetRow(MatrixRowCol& mrc) +{ + REPORT + mrc.skip=mrc.rowcol; mrc.storage=1; mrc.data=store; mrc.length=ncols_val; +} + +void IdentityMatrix::GetCol(MatrixRowCol& mrc) +{ + REPORT + mrc.skip=mrc.rowcol; mrc.storage=1; mrc.length=nrows_val; + if (+(mrc.cw*StoreHere)) // should not happen + Throw(InternalException("IdentityMatrix::GetCol(MatrixRowCol&)")); + else { REPORT mrc.data=store; } +} + +void IdentityMatrix::GetCol(MatrixColX& mrc) +{ + REPORT + mrc.skip=mrc.rowcol; mrc.storage=1; mrc.length=nrows_val; + mrc.data = mrc.store+mrc.skip; *(mrc.data)=*store; +} + +void IdentityMatrix::NextRow(MatrixRowCol& mrc) { REPORT mrc.IncrId(); } + +void IdentityMatrix::NextCol(MatrixRowCol& mrc) { REPORT mrc.IncrId(); } + +void IdentityMatrix::NextCol(MatrixColX& mrc) +{ + REPORT + if (+(mrc.cw*StoreOnExit)) { REPORT *store=*(mrc.data); } + mrc.IncrDiag(); // must increase mrc.data so need IncrDiag + int t1 = +(mrc.cw*LoadOnEntry); + if (t1 && mrc.rowcol < ncols_val) { REPORT *(mrc.data)=*store; } +} + + + + +// *************************** destructors ******************************* + +MatrixRowCol::~MatrixRowCol() +{ + if (+(cw*HaveStore)) + { + MONITOR_REAL_DELETE("Free (RowCol)",-1,data) // do not know length + delete [] data; + } +} + +MatrixRow::~MatrixRow() { if (+(cw*StoreOnExit)) gm->RestoreRow(*this); } + +MatrixCol::~MatrixCol() { if (+(cw*StoreOnExit)) gm->RestoreCol(*this); } + +MatrixColX::~MatrixColX() { if (+(cw*StoreOnExit)) gm->RestoreCol(*this); } + +#ifdef use_namespace +} +#endif + +///@} diff --git a/extern/newmat/newmat4.cpp b/extern/newmat/newmat4.cpp new file mode 100644 index 00000000..5c5cc41d --- /dev/null +++ b/extern/newmat/newmat4.cpp @@ -0,0 +1,1387 @@ +/// \ingroup newmat +///@{ + +/// \file newmat4.cpp +/// Constructors, resize, basic utilities, SimpleIntArray. + + +// Copyright (C) 1991,2,3,4,8,9: R B Davies + +//#define WANT_STREAM + +#include "include.h" + +#include "newmat.h" +#include "newmatrc.h" + +#ifdef use_namespace +namespace NEWMAT { +#endif + + + +#ifdef DO_REPORT +#define REPORT { static ExeCounter ExeCount(__LINE__,4); ++ExeCount; } +#else +#define REPORT {} +#endif + + +#define DO_SEARCH // search for LHS of = in RHS + +// ************************* general utilities *************************/ + +static int tristore(int n) // elements in triangular matrix +{ return (n*(n+1))/2; } + + +// **************************** constructors ***************************/ + +GeneralMatrix::GeneralMatrix() +{ store=0; storage=0; nrows_val=0; ncols_val=0; tag_val=-1; } + +GeneralMatrix::GeneralMatrix(ArrayLengthSpecifier s) +{ + REPORT + storage=s.Value(); tag_val=-1; + if (storage) + { + store = new Real [storage]; MatrixErrorNoSpace(store); + MONITOR_REAL_NEW("Make (GenMatrix)",storage,store) + } + else store = 0; +} + +Matrix::Matrix(int m, int n) : GeneralMatrix(m*n) +{ REPORT nrows_val=m; ncols_val=n; } + +SquareMatrix::SquareMatrix(ArrayLengthSpecifier n) + : Matrix(n.Value(),n.Value()) +{ REPORT } + +SymmetricMatrix::SymmetricMatrix(ArrayLengthSpecifier n) + : GeneralMatrix(tristore(n.Value())) +{ REPORT nrows_val=n.Value(); ncols_val=n.Value(); } + +UpperTriangularMatrix::UpperTriangularMatrix(ArrayLengthSpecifier n) + : GeneralMatrix(tristore(n.Value())) +{ REPORT nrows_val=n.Value(); ncols_val=n.Value(); } + +LowerTriangularMatrix::LowerTriangularMatrix(ArrayLengthSpecifier n) + : GeneralMatrix(tristore(n.Value())) +{ REPORT nrows_val=n.Value(); ncols_val=n.Value(); } + +DiagonalMatrix::DiagonalMatrix(ArrayLengthSpecifier m) : GeneralMatrix(m) +{ REPORT nrows_val=m.Value(); ncols_val=m.Value(); } + +Matrix::Matrix(const BaseMatrix& M) +{ + REPORT // CheckConversion(M); + // MatrixConversionCheck mcc; + GeneralMatrix* gmx=((BaseMatrix&)M).Evaluate(MatrixType::Rt); + GetMatrix(gmx); +} + +SquareMatrix::SquareMatrix(const BaseMatrix& M) : Matrix(M) +{ + REPORT + if (ncols_val != nrows_val) + { + Tracer tr("SquareMatrix"); + Throw(NotSquareException(*this)); + } +} + + +SquareMatrix::SquareMatrix(const Matrix& gm) +{ + REPORT + if (gm.ncols_val != gm.nrows_val) + { + Tracer tr("SquareMatrix(Matrix)"); + Throw(NotSquareException(gm)); + } + GetMatrix(&gm); +} + + +RowVector::RowVector(const BaseMatrix& M) : Matrix(M) +{ + REPORT + if (nrows_val!=1) + { + Tracer tr("RowVector"); + Throw(VectorException(*this)); + } +} + +ColumnVector::ColumnVector(const BaseMatrix& M) : Matrix(M) +{ + REPORT + if (ncols_val!=1) + { + Tracer tr("ColumnVector"); + Throw(VectorException(*this)); + } +} + +SymmetricMatrix::SymmetricMatrix(const BaseMatrix& M) +{ + REPORT // CheckConversion(M); + // MatrixConversionCheck mcc; + GeneralMatrix* gmx=((BaseMatrix&)M).Evaluate(MatrixType::Sm); + GetMatrix(gmx); +} + +UpperTriangularMatrix::UpperTriangularMatrix(const BaseMatrix& M) +{ + REPORT // CheckConversion(M); + // MatrixConversionCheck mcc; + GeneralMatrix* gmx=((BaseMatrix&)M).Evaluate(MatrixType::UT); + GetMatrix(gmx); +} + +LowerTriangularMatrix::LowerTriangularMatrix(const BaseMatrix& M) +{ + REPORT // CheckConversion(M); + // MatrixConversionCheck mcc; + GeneralMatrix* gmx=((BaseMatrix&)M).Evaluate(MatrixType::LT); + GetMatrix(gmx); +} + +DiagonalMatrix::DiagonalMatrix(const BaseMatrix& M) +{ + REPORT //CheckConversion(M); + // MatrixConversionCheck mcc; + GeneralMatrix* gmx=((BaseMatrix&)M).Evaluate(MatrixType::Dg); + GetMatrix(gmx); +} + +IdentityMatrix::IdentityMatrix(const BaseMatrix& M) +{ + REPORT //CheckConversion(M); + // MatrixConversionCheck mcc; + GeneralMatrix* gmx=((BaseMatrix&)M).Evaluate(MatrixType::Id); + GetMatrix(gmx); +} + +GeneralMatrix::~GeneralMatrix() +{ + if (store) + { + MONITOR_REAL_DELETE("Free (GenMatrix)",storage,store) + delete [] store; + } +} + +CroutMatrix::CroutMatrix(const BaseMatrix& m) +{ + REPORT + Tracer tr("CroutMatrix"); + indx = 0; // in case of exception at next line + GeneralMatrix* gm = ((BaseMatrix&)m).Evaluate(); + if (gm->nrows_val!=gm->ncols_val) + { gm->tDelete(); Throw(NotSquareException(*gm)); } + if (gm->type() == MatrixType::Ct) + { REPORT ((CroutMatrix*)gm)->get_aux(*this); GetMatrix(gm); } + else + { + REPORT + GeneralMatrix* gm1 = gm->Evaluate(MatrixType::Rt); + GetMatrix(gm1); + d=true; sing=false; + indx=new int [nrows_val]; MatrixErrorNoSpace(indx); + MONITOR_INT_NEW("Index (CroutMat)",nrows_val,indx) + ludcmp(); + } +} + +// could we use SetParameters instead of this +void CroutMatrix::get_aux(CroutMatrix& X) +{ + X.d = d; X.sing = sing; + if (tag_val == 0 || tag_val == 1) // reuse the array + { REPORT X.indx = indx; indx = 0; d = true; sing = true; return; } + else if (nrows_val == 0) + { REPORT indx = 0; d = true; sing = true; return; } + else // copy the array + { + REPORT + Tracer tr("CroutMatrix::get_aux"); + int *ix = new int [nrows_val]; MatrixErrorNoSpace(ix); + MONITOR_INT_NEW("Index (CM::get_aux)", nrows_val, ix) + int n = nrows_val; int* i = ix; int* j = indx; + while(n--) *i++ = *j++; + X.indx = ix; + } +} + +CroutMatrix::CroutMatrix(const CroutMatrix& gm) : GeneralMatrix() +{ + REPORT + Tracer tr("CroutMatrix(const CroutMatrix&)"); + ((CroutMatrix&)gm).get_aux(*this); + GetMatrix(&gm); +} + +CroutMatrix::~CroutMatrix() +{ + MONITOR_INT_DELETE("Index (CroutMat)",nrows_val,indx) + delete [] indx; +} + +//ReturnMatrix::ReturnMatrix(GeneralMatrix& gmx) +//{ +// REPORT +// gm = gmx.Image(); gm->ReleaseAndDelete(); +//} + + +GeneralMatrix::operator ReturnMatrix() const +{ + REPORT + GeneralMatrix* gm = Image(); gm->ReleaseAndDelete(); + return ReturnMatrix(gm); +} + + + +ReturnMatrix GeneralMatrix::for_return() const +{ + REPORT + GeneralMatrix* gm = Image(); gm->ReleaseAndDelete(); + return ReturnMatrix(gm); +} + +// ************ Constructors for use with NR in C++ interface *********** + +#ifdef SETUP_C_SUBSCRIPTS + +Matrix::Matrix(Real a, int m, int n) : GeneralMatrix(m * n) + { REPORT nrows_val=m; ncols_val=n; operator=(a); } + +Matrix::Matrix(const Real* a, int m, int n) : GeneralMatrix(m * n) + { REPORT nrows_val=m; ncols_val=n; *this << a; } + +#endif + + + +// ************************** resize matrices ***************************/ + +void GeneralMatrix::resize(int nr, int nc, int s) +{ + REPORT + if (store) + { + MONITOR_REAL_DELETE("Free (ReDimensi)",storage,store) + delete [] store; + } + storage=s; nrows_val=nr; ncols_val=nc; tag_val=-1; + if (s) + { + store = new Real [storage]; MatrixErrorNoSpace(store); + MONITOR_REAL_NEW("Make (ReDimensi)",storage,store) + } + else store = 0; +} + +void Matrix::resize(int nr, int nc) +{ REPORT GeneralMatrix::resize(nr,nc,nr*nc); } + +void SquareMatrix::resize(int n) +{ REPORT GeneralMatrix::resize(n,n,n*n); } + +void SquareMatrix::resize(int nr, int nc) +{ + REPORT + Tracer tr("SquareMatrix::resize"); + if (nc != nr) Throw(NotSquareException(*this)); + GeneralMatrix::resize(nr,nc,nr*nc); +} + +void SymmetricMatrix::resize(int nr) +{ REPORT GeneralMatrix::resize(nr,nr,tristore(nr)); } + +void UpperTriangularMatrix::resize(int nr) +{ REPORT GeneralMatrix::resize(nr,nr,tristore(nr)); } + +void LowerTriangularMatrix::resize(int nr) +{ REPORT GeneralMatrix::resize(nr,nr,tristore(nr)); } + +void DiagonalMatrix::resize(int nr) +{ REPORT GeneralMatrix::resize(nr,nr,nr); } + +void RowVector::resize(int nc) +{ REPORT GeneralMatrix::resize(1,nc,nc); } + +void ColumnVector::resize(int nr) +{ REPORT GeneralMatrix::resize(nr,1,nr); } + +void RowVector::resize(int nr, int nc) +{ + Tracer tr("RowVector::resize"); + if (nr != 1) Throw(VectorException(*this)); + REPORT GeneralMatrix::resize(1,nc,nc); +} + +void ColumnVector::resize(int nr, int nc) +{ + Tracer tr("ColumnVector::resize"); + if (nc != 1) Throw(VectorException(*this)); + REPORT GeneralMatrix::resize(nr,1,nr); +} + +void IdentityMatrix::resize(int nr) +{ REPORT GeneralMatrix::resize(nr,nr,1); *store = 1; } + + +void Matrix::resize(const GeneralMatrix& A) +{ REPORT resize(A.Nrows(), A.Ncols()); } + +void SquareMatrix::resize(const GeneralMatrix& A) +{ + REPORT + int n = A.Nrows(); + if (n != A.Ncols()) + { + Tracer tr("SquareMatrix::resize(GM)"); + Throw(NotSquareException(*this)); + } + resize(n); +} + +void nricMatrix::resize(const GeneralMatrix& A) +{ REPORT resize(A.Nrows(), A.Ncols()); } + +void ColumnVector::resize(const GeneralMatrix& A) +{ REPORT resize(A.Nrows(), A.Ncols()); } + +void RowVector::resize(const GeneralMatrix& A) +{ REPORT resize(A.Nrows(), A.Ncols()); } + +void SymmetricMatrix::resize(const GeneralMatrix& A) +{ + REPORT + int n = A.Nrows(); + if (n != A.Ncols()) + { + Tracer tr("SymmetricMatrix::resize(GM)"); + Throw(NotSquareException(*this)); + } + resize(n); +} + +void DiagonalMatrix::resize(const GeneralMatrix& A) +{ + REPORT + int n = A.Nrows(); + if (n != A.Ncols()) + { + Tracer tr("DiagonalMatrix::resize(GM)"); + Throw(NotSquareException(*this)); + } + resize(n); +} + +void UpperTriangularMatrix::resize(const GeneralMatrix& A) +{ + REPORT + int n = A.Nrows(); + if (n != A.Ncols()) + { + Tracer tr("UpperTriangularMatrix::resize(GM)"); + Throw(NotSquareException(*this)); + } + resize(n); +} + +void LowerTriangularMatrix::resize(const GeneralMatrix& A) +{ + REPORT + int n = A.Nrows(); + if (n != A.Ncols()) + { + Tracer tr("LowerTriangularMatrix::resize(GM)"); + Throw(NotSquareException(*this)); + } + resize(n); +} + +void IdentityMatrix::resize(const GeneralMatrix& A) +{ + REPORT + int n = A.Nrows(); + if (n != A.Ncols()) + { + Tracer tr("IdentityMatrix::resize(GM)"); + Throw(NotSquareException(*this)); + } + resize(n); +} + +void GeneralMatrix::resize(const GeneralMatrix&) +{ + REPORT + Tracer tr("GeneralMatrix::resize(GM)"); + Throw(NotDefinedException("resize", "this type of matrix")); +} + +//*********************** resize_keep ******************************* + +void Matrix::resize_keep(int nr, int nc) +{ + Tracer tr("Matrix::resize_keep"); + if (nr == nrows_val && nc == ncols_val) { REPORT return; } + + if (nr <= nrows_val && nc <= ncols_val) + { + REPORT + Matrix X = submatrix(1,nr,1,nc); + swap(X); + } + else if (nr >= nrows_val && nc >= ncols_val) + { + REPORT + Matrix X(nr, nc); X = 0; + X.submatrix(1,nrows_val,1,ncols_val) = *this; + swap(X); + } + else + { + REPORT + Matrix X(nr, nc); X = 0; + if (nr > nrows_val) nr = nrows_val; + if (nc > ncols_val) nc = ncols_val; + X.submatrix(1,nr,1,nc) = submatrix(1,nr,1,nc); + swap(X); + } +} + +void SquareMatrix::resize_keep(int nr) +{ + Tracer tr("SquareMatrix::resize_keep"); + if (nr < nrows_val) + { + REPORT + SquareMatrix X = sym_submatrix(1,nr); + swap(X); + } + else if (nr > nrows_val) + { + REPORT + SquareMatrix X(nr); X = 0; + X.sym_submatrix(1,nrows_val) = *this; + swap(X); + } +} + +void SquareMatrix::resize_keep(int nr, int nc) +{ + Tracer tr("SquareMatrix::resize_keep 2"); + REPORT + if (nr != nc) Throw(NotSquareException(*this)); + resize_keep(nr); +} + + +void SymmetricMatrix::resize_keep(int nr) +{ + Tracer tr("SymmetricMatrix::resize_keep"); + if (nr < nrows_val) + { + REPORT + SymmetricMatrix X = sym_submatrix(1,nr); + swap(X); + } + else if (nr > nrows_val) + { + REPORT + SymmetricMatrix X(nr); X = 0; + X.sym_submatrix(1,nrows_val) = *this; + swap(X); + } +} + +void UpperTriangularMatrix::resize_keep(int nr) +{ + Tracer tr("UpperTriangularMatrix::resize_keep"); + if (nr < nrows_val) + { + REPORT + UpperTriangularMatrix X = sym_submatrix(1,nr); + swap(X); + } + else if (nr > nrows_val) + { + REPORT + UpperTriangularMatrix X(nr); X = 0; + X.sym_submatrix(1,nrows_val) = *this; + swap(X); + } +} + +void LowerTriangularMatrix::resize_keep(int nr) +{ + Tracer tr("LowerTriangularMatrix::resize_keep"); + if (nr < nrows_val) + { + REPORT + LowerTriangularMatrix X = sym_submatrix(1,nr); + swap(X); + } + else if (nr > nrows_val) + { + REPORT + LowerTriangularMatrix X(nr); X = 0; + X.sym_submatrix(1,nrows_val) = *this; + swap(X); + } +} + +void DiagonalMatrix::resize_keep(int nr) +{ + Tracer tr("DiagonalMatrix::resize_keep"); + if (nr < nrows_val) + { + REPORT + DiagonalMatrix X = sym_submatrix(1,nr); + swap(X); + } + else if (nr > nrows_val) + { + REPORT + DiagonalMatrix X(nr); X = 0; + X.sym_submatrix(1,nrows_val) = *this; + swap(X); + } +} + +void RowVector::resize_keep(int nc) +{ + Tracer tr("RowVector::resize_keep"); + if (nc < ncols_val) + { + REPORT + RowVector X = columns(1,nc); + swap(X); + } + else if (nc > ncols_val) + { + REPORT + RowVector X(nc); X = 0; + X.columns(1,ncols_val) = *this; + swap(X); + } +} + +void RowVector::resize_keep(int nr, int nc) +{ + Tracer tr("RowVector::resize_keep 2"); + REPORT + if (nr != 1) Throw(VectorException(*this)); + resize_keep(nc); +} + +void ColumnVector::resize_keep(int nr) +{ + Tracer tr("ColumnVector::resize_keep"); + if (nr < nrows_val) + { + REPORT + ColumnVector X = rows(1,nr); + swap(X); + } + else if (nr > nrows_val) + { + REPORT + ColumnVector X(nr); X = 0; + X.rows(1,nrows_val) = *this; + swap(X); + } +} + +void ColumnVector::resize_keep(int nr, int nc) +{ + Tracer tr("ColumnVector::resize_keep 2"); + REPORT + if (nc != 1) Throw(VectorException(*this)); + resize_keep(nr); +} + + +/* +void GeneralMatrix::resizeForAdd(const GeneralMatrix& A, const GeneralMatrix&) +{ REPORT resize(A); } + +void GeneralMatrix::resizeForSP(const GeneralMatrix& A, const GeneralMatrix&) +{ REPORT resize(A); } + + +// ************************* SameStorageType ****************************** + +// SameStorageType checks A and B have same storage type including bandwidth +// It does not check same dimensions since we assume this is already done + +bool GeneralMatrix::SameStorageType(const GeneralMatrix& A) const +{ + REPORT + return type() == A.type(); +} +*/ + +// ******************* manipulate types, storage **************************/ + +int GeneralMatrix::search(const BaseMatrix* s) const +{ REPORT return (s==this) ? 1 : 0; } + +int GenericMatrix::search(const BaseMatrix* s) const +{ REPORT return gm->search(s); } + +int MultipliedMatrix::search(const BaseMatrix* s) const +{ REPORT return bm1->search(s) + bm2->search(s); } + +int ShiftedMatrix::search(const BaseMatrix* s) const +{ REPORT return bm->search(s); } + +int NegatedMatrix::search(const BaseMatrix* s) const +{ REPORT return bm->search(s); } + +int ReturnMatrix::search(const BaseMatrix* s) const +{ REPORT return (s==gm) ? 1 : 0; } + +MatrixType Matrix::type() const { return MatrixType::Rt; } +MatrixType SquareMatrix::type() const { return MatrixType::Sq; } +MatrixType SymmetricMatrix::type() const { return MatrixType::Sm; } +MatrixType UpperTriangularMatrix::type() const { return MatrixType::UT; } +MatrixType LowerTriangularMatrix::type() const { return MatrixType::LT; } +MatrixType DiagonalMatrix::type() const { return MatrixType::Dg; } +MatrixType RowVector::type() const { return MatrixType::RV; } +MatrixType ColumnVector::type() const { return MatrixType::CV; } +MatrixType CroutMatrix::type() const { return MatrixType::Ct; } +MatrixType BandMatrix::type() const { return MatrixType::BM; } +MatrixType UpperBandMatrix::type() const { return MatrixType::UB; } +MatrixType LowerBandMatrix::type() const { return MatrixType::LB; } +MatrixType SymmetricBandMatrix::type() const { return MatrixType::SB; } + +MatrixType IdentityMatrix::type() const { return MatrixType::Id; } + + + +MatrixBandWidth BaseMatrix::bandwidth() const { REPORT return -1; } +MatrixBandWidth DiagonalMatrix::bandwidth() const { REPORT return 0; } +MatrixBandWidth IdentityMatrix::bandwidth() const { REPORT return 0; } + +MatrixBandWidth UpperTriangularMatrix::bandwidth() const + { REPORT return MatrixBandWidth(0,-1); } + +MatrixBandWidth LowerTriangularMatrix::bandwidth() const + { REPORT return MatrixBandWidth(-1,0); } + +MatrixBandWidth BandMatrix::bandwidth() const + { REPORT return MatrixBandWidth(lower_val,upper_val); } + +MatrixBandWidth BandLUMatrix::bandwidth() const + { REPORT return MatrixBandWidth(m1,m2); } + +MatrixBandWidth GenericMatrix::bandwidth()const + { REPORT return gm->bandwidth(); } + +MatrixBandWidth AddedMatrix::bandwidth() const + { REPORT return gm1->bandwidth() + gm2->bandwidth(); } + +MatrixBandWidth SPMatrix::bandwidth() const + { REPORT return gm1->bandwidth().minimum(gm2->bandwidth()); } + +MatrixBandWidth KPMatrix::bandwidth() const +{ + int lower, upper; + MatrixBandWidth bw1 = gm1->bandwidth(), bw2 = gm2->bandwidth(); + if (bw1.Lower() < 0) + { + if (bw2.Lower() < 0) { REPORT lower = -1; } + else { REPORT lower = bw2.Lower() + (gm1->Nrows() - 1) * gm2->Nrows(); } + } + else + { + if (bw2.Lower() < 0) + { REPORT lower = (1 + bw1.Lower()) * gm2->Nrows() - 1; } + else { REPORT lower = bw2.Lower() + bw1.Lower() * gm2->Nrows(); } + } + if (bw1.Upper() < 0) + { + if (bw2.Upper() < 0) { REPORT upper = -1; } + else { REPORT upper = bw2.Upper() + (gm1->Nrows() - 1) * gm2->Nrows(); } + } + else + { + if (bw2.Upper() < 0) + { REPORT upper = (1 + bw1.Upper()) * gm2->Nrows() - 1; } + else { REPORT upper = bw2.Upper() + bw1.Upper() * gm2->Nrows(); } + } + return MatrixBandWidth(lower, upper); +} + +MatrixBandWidth MultipliedMatrix::bandwidth() const +{ REPORT return gm1->bandwidth() * gm2->bandwidth(); } + +MatrixBandWidth ConcatenatedMatrix::bandwidth() const { REPORT return -1; } + +MatrixBandWidth SolvedMatrix::bandwidth() const +{ + if (+gm1->type() & MatrixType::Diagonal) + { REPORT return gm2->bandwidth(); } + else { REPORT return -1; } +} + +MatrixBandWidth ScaledMatrix::bandwidth() const + { REPORT return gm->bandwidth(); } + +MatrixBandWidth NegatedMatrix::bandwidth() const + { REPORT return gm->bandwidth(); } + +MatrixBandWidth TransposedMatrix::bandwidth() const + { REPORT return gm->bandwidth().t(); } + +MatrixBandWidth InvertedMatrix::bandwidth() const +{ + if (+gm->type() & MatrixType::Diagonal) + { REPORT return MatrixBandWidth(0,0); } + else { REPORT return -1; } +} + +MatrixBandWidth RowedMatrix::bandwidth() const { REPORT return -1; } +MatrixBandWidth ColedMatrix::bandwidth() const { REPORT return -1; } +MatrixBandWidth DiagedMatrix::bandwidth() const { REPORT return 0; } +MatrixBandWidth MatedMatrix::bandwidth() const { REPORT return -1; } +MatrixBandWidth ReturnMatrix::bandwidth() const + { REPORT return gm->bandwidth(); } + +MatrixBandWidth GetSubMatrix::bandwidth() const +{ + + if (row_skip==col_skip && row_number==col_number) + { REPORT return gm->bandwidth(); } + else { REPORT return MatrixBandWidth(-1); } +} + +// ********************** the memory managment tools **********************/ + +// Rules regarding tDelete, reuse, GetStore, BorrowStore +// All matrices processed during expression evaluation must be subject +// to exactly one of reuse(), tDelete(), GetStore() or BorrowStore(). +// If reuse returns true the matrix must be reused. +// GetMatrix(gm) always calls gm->GetStore() +// gm->Evaluate obeys rules +// bm->Evaluate obeys rules for matrices in bm structure + +// Meaning of tag_val +// tag_val = -1 memory cannot be reused (default situation) +// tag_val = -2 memory has been borrowed from another matrix +// (don't change values) +// tag_val = i > 0 delete or reuse memory after i operations +// tag_val = 0 like value 1 but matrix was created by new +// so delete it + +void GeneralMatrix::tDelete() +{ + if (tag_val<0) + { + if (tag_val<-1) { REPORT store = 0; delete this; return; } // borrowed + else { REPORT return; } // not a temporary matrix - leave alone + } + if (tag_val==1) + { + if (store) + { + REPORT MONITOR_REAL_DELETE("Free (tDelete)",storage,store) + delete [] store; + } + MiniCleanUp(); return; // CleanUp + } + if (tag_val==0) { REPORT delete this; return; } + + REPORT tag_val--; return; +} + +void newmat_block_copy(int n, Real* from, Real* to) +{ + REPORT + int i = (n >> 3); + while (i--) + { + *to++ = *from++; *to++ = *from++; *to++ = *from++; *to++ = *from++; + *to++ = *from++; *to++ = *from++; *to++ = *from++; *to++ = *from++; + } + i = n & 7; while (i--) *to++ = *from++; +} + +bool GeneralMatrix::reuse() +{ + if (tag_val < -1) // borrowed storage + { + if (storage) + { + REPORT + Real* s = new Real [storage]; MatrixErrorNoSpace(s); + MONITOR_REAL_NEW("Make (reuse)",storage,s) + newmat_block_copy(storage, store, s); store = s; + } + else { REPORT MiniCleanUp(); } // CleanUp + tag_val = 0; return true; + } + if (tag_val < 0 ) { REPORT return false; } + if (tag_val <= 1 ) { REPORT return true; } + REPORT tag_val--; return false; +} + +Real* GeneralMatrix::GetStore() +{ + if (tag_val<0 || tag_val>1) + { + Real* s; + if (storage) + { + s = new Real [storage]; MatrixErrorNoSpace(s); + MONITOR_REAL_NEW("Make (GetStore)",storage,s) + newmat_block_copy(storage, store, s); + } + else s = 0; + if (tag_val > 1) { REPORT tag_val--; } + else if (tag_val < -1) { REPORT store = 0; delete this; } // borrowed store + else { REPORT } + return s; + } + Real* s = store; // cleanup - done later + if (tag_val==0) { REPORT store = 0; delete this; } + else { REPORT MiniCleanUp(); } + return s; +} + +void GeneralMatrix::GetMatrix(const GeneralMatrix* gmx) +{ + REPORT tag_val=-1; nrows_val=gmx->Nrows(); ncols_val=gmx->Ncols(); + storage=gmx->storage; SetParameters(gmx); + store=((GeneralMatrix*)gmx)->GetStore(); +} + +GeneralMatrix* GeneralMatrix::BorrowStore(GeneralMatrix* gmx, MatrixType mt) +// Copy storage of *this to storage of *gmx. Then convert to type mt. +// If mt == 0 just let *gmx point to storage of *this if tag_val==-1. +{ + if (!mt) + { + if (tag_val == -1) { REPORT gmx->tag_val = -2; gmx->store = store; } + else { REPORT gmx->tag_val = 0; gmx->store = GetStore(); } + } + else if (Compare(gmx->type(),mt)) + { REPORT gmx->tag_val = 0; gmx->store = GetStore(); } + else + { + REPORT gmx->tag_val = -2; gmx->store = store; + gmx = gmx->Evaluate(mt); gmx->tag_val = 0; tDelete(); + } + + return gmx; +} + +void GeneralMatrix::Eq(const BaseMatrix& X, MatrixType mt) +// Count number of references to this in X. +// If zero delete storage in this; +// otherwise tag this to show when storage can be deleted +// evaluate X and copy to this +{ +#ifdef DO_SEARCH + int counter=X.search(this); + if (counter==0) + { + REPORT + if (store) + { + MONITOR_REAL_DELETE("Free (operator=)",storage,store) + REPORT delete [] store; storage = 0; store = 0; + } + } + else { REPORT Release(counter); } + GeneralMatrix* gmx = ((BaseMatrix&)X).Evaluate(mt); + if (gmx!=this) { REPORT GetMatrix(gmx); } + else { REPORT } + Protect(); +#else + GeneralMatrix* gmx = ((BaseMatrix&)X).Evaluate(mt); + if (gmx!=this) + { + REPORT + if (store) + { + MONITOR_REAL_DELETE("Free (operator=)",storage,store) + REPORT delete [] store; storage = 0; store = 0; + } + GetMatrix(gmx); + } + else { REPORT } + Protect(); +#endif +} + +// version with no conversion +void GeneralMatrix::Eq(const GeneralMatrix& X) +{ + GeneralMatrix* gmx = (GeneralMatrix*)&X; + if (gmx!=this) + { + REPORT + if (store) + { + MONITOR_REAL_DELETE("Free (operator=)",storage,store) + REPORT delete [] store; storage = 0; store = 0; + } + GetMatrix(gmx); + } + else { REPORT } + Protect(); +} + +// version to work with operator<< +void GeneralMatrix::Eq(const BaseMatrix& X, MatrixType mt, bool ldok) +{ + REPORT + if (ldok) mt.SetDataLossOK(); + Eq(X, mt); +} + +void GeneralMatrix::Eq2(const BaseMatrix& X, MatrixType mt) +// a cut down version of Eq for use with += etc. +// we know BaseMatrix points to two GeneralMatrix objects, +// the first being this (may be the same). +// we know tag_val has been set correctly in each. +{ + GeneralMatrix* gmx = ((BaseMatrix&)X).Evaluate(mt); + if (gmx!=this) { REPORT GetMatrix(gmx); } // simplify GetMatrix ? + else { REPORT } + Protect(); +} + +void GeneralMatrix::inject(const GeneralMatrix& X) +// copy stored values of X; otherwise leave els of *this unchanged +{ + REPORT + Tracer tr("inject"); + if (nrows_val != X.nrows_val || ncols_val != X.ncols_val) + Throw(IncompatibleDimensionsException()); + MatrixRow mr((GeneralMatrix*)&X, LoadOnEntry); + MatrixRow mrx(this, LoadOnEntry+StoreOnExit+DirectPart); + int i=nrows_val; + while (i--) { mrx.Inject(mr); mrx.Next(); mr.Next(); } +} + +// ************* checking for data loss during conversion *******************/ + +bool Compare(const MatrixType& source, MatrixType& destination) +{ + if (!destination) { destination=source; return true; } + if (destination==source) return true; + if (!destination.DataLossOK && !(destination>=source)) + Throw(ProgramException("Illegal Conversion", source, destination)); + return false; +} + +// ************* Make a copy of a matrix on the heap *********************/ + +GeneralMatrix* Matrix::Image() const +{ + REPORT + GeneralMatrix* gm = new Matrix(*this); MatrixErrorNoSpace(gm); + return gm; +} + +GeneralMatrix* SquareMatrix::Image() const +{ + REPORT + GeneralMatrix* gm = new SquareMatrix(*this); MatrixErrorNoSpace(gm); + return gm; +} + +GeneralMatrix* SymmetricMatrix::Image() const +{ + REPORT + GeneralMatrix* gm = new SymmetricMatrix(*this); MatrixErrorNoSpace(gm); + return gm; +} + +GeneralMatrix* UpperTriangularMatrix::Image() const +{ + REPORT + GeneralMatrix* gm = new UpperTriangularMatrix(*this); + MatrixErrorNoSpace(gm); return gm; +} + +GeneralMatrix* LowerTriangularMatrix::Image() const +{ + REPORT + GeneralMatrix* gm = new LowerTriangularMatrix(*this); + MatrixErrorNoSpace(gm); return gm; +} + +GeneralMatrix* DiagonalMatrix::Image() const +{ + REPORT + GeneralMatrix* gm = new DiagonalMatrix(*this); MatrixErrorNoSpace(gm); + return gm; +} + +GeneralMatrix* RowVector::Image() const +{ + REPORT + GeneralMatrix* gm = new RowVector(*this); MatrixErrorNoSpace(gm); + return gm; +} + +GeneralMatrix* ColumnVector::Image() const +{ + REPORT + GeneralMatrix* gm = new ColumnVector(*this); MatrixErrorNoSpace(gm); + return gm; +} + +GeneralMatrix* nricMatrix::Image() const +{ + REPORT + GeneralMatrix* gm = new nricMatrix(*this); MatrixErrorNoSpace(gm); + return gm; +} + +GeneralMatrix* IdentityMatrix::Image() const +{ + REPORT + GeneralMatrix* gm = new IdentityMatrix(*this); MatrixErrorNoSpace(gm); + return gm; +} + +GeneralMatrix* CroutMatrix::Image() const +{ + REPORT + GeneralMatrix* gm = new CroutMatrix(*this); MatrixErrorNoSpace(gm); + return gm; +} + +GeneralMatrix* GeneralMatrix::Image() const +{ + bool dummy = true; + if (dummy) // get rid of warning message + Throw(InternalException("Cannot apply Image to this matrix type")); + return 0; +} + + +// *********************** nricMatrix routines *****************************/ + +void nricMatrix::MakeRowPointer() +{ + REPORT + if (nrows_val > 0) + { + row_pointer = new Real* [nrows_val]; MatrixErrorNoSpace(row_pointer); + Real* s = Store() - 1; int i = nrows_val; Real** rp = row_pointer; + if (i) for (;;) { *rp++ = s; if (!(--i)) break; s+=ncols_val; } + } + else row_pointer = 0; +} + +void nricMatrix::DeleteRowPointer() + { REPORT if (nrows_val) delete [] row_pointer; } + +void GeneralMatrix::CheckStore() const +{ + REPORT + if (!store) + Throw(ProgramException("NRIC accessing matrix with unset dimensions")); +} + + +// *************************** CleanUp routines *****************************/ + +void GeneralMatrix::cleanup() +{ + // set matrix dimensions to zero, delete storage + REPORT + if (store && storage) + { + MONITOR_REAL_DELETE("Free (cleanup) ",storage,store) + REPORT delete [] store; + } + store=0; storage=0; nrows_val=0; ncols_val=0; tag_val = -1; +} + +void nricMatrix::cleanup() + { REPORT DeleteRowPointer(); GeneralMatrix::cleanup(); } + +void nricMatrix::MiniCleanUp() + { REPORT DeleteRowPointer(); GeneralMatrix::MiniCleanUp(); } + +void RowVector::cleanup() + { REPORT GeneralMatrix::cleanup(); nrows_val=1; } + +void ColumnVector::cleanup() + { REPORT GeneralMatrix::cleanup(); ncols_val=1; } + +void CroutMatrix::cleanup() +{ + REPORT + if (nrows_val) delete [] indx; + GeneralMatrix::cleanup(); +} + +void CroutMatrix::MiniCleanUp() +{ + REPORT + if (nrows_val) delete [] indx; + GeneralMatrix::MiniCleanUp(); +} + +void BandLUMatrix::cleanup() +{ + REPORT + if (nrows_val) delete [] indx; + if (storage2) delete [] store2; + GeneralMatrix::cleanup(); +} + +void BandLUMatrix::MiniCleanUp() +{ + REPORT + if (nrows_val) delete [] indx; + if (storage2) delete [] store2; + GeneralMatrix::MiniCleanUp(); +} + +// ************************ simple integer array class *********************** + +// construct a new array of length xn. Check that xn is non-negative and +// that space is available + +SimpleIntArray::SimpleIntArray(int xn) : n(xn) +{ + if (n < 0) Throw(Logic_error("invalid array length")); + else if (n == 0) { REPORT a = 0; } + else { REPORT a = new int [n]; if (!a) Throw(Bad_alloc()); } +} + +// destroy an array - return its space to memory + +SimpleIntArray::~SimpleIntArray() { REPORT if (a) delete [] a; } + +// access an element of an array; return a "reference" so elements +// can be modified. +// check index is within range +// in this array class the index runs from 0 to n-1 + +int& SimpleIntArray::operator[](int i) +{ + REPORT + if (i < 0 || i >= n) Throw(Logic_error("array index out of range")); + return a[i]; +} + +// same thing again but for arrays declared constant so we can't +// modify its elements + +int SimpleIntArray::operator[](int i) const +{ + REPORT + if (i < 0 || i >= n) Throw(Logic_error("array index out of range")); + return a[i]; +} + +// set all the elements equal to a given value + +void SimpleIntArray::operator=(int ai) + { REPORT for (int i = 0; i < n; i++) a[i] = ai; } + +// set the elements equal to those of another array. +// now allow length to be changed + +void SimpleIntArray::operator=(const SimpleIntArray& b) +{ + REPORT + if (b.n != n) resize(b.n); + for (int i = 0; i < n; i++) a[i] = b.a[i]; +} + +// construct a new array equal to an existing array +// check that space is available + +SimpleIntArray::SimpleIntArray(const SimpleIntArray& b) : Janitor(), n(b.n) +{ + if (n == 0) { REPORT a = 0; } + else + { + REPORT + a = new int [n]; if (!a) Throw(Bad_alloc()); + for (int i = 0; i < n; i++) a[i] = b.a[i]; + } +} + +// change the size of an array; optionally copy data from old array to +// new array + +void SimpleIntArray::resize(int n1, bool keep) +{ + if (n1 == n) { REPORT return; } + else if (n1 == 0) { REPORT n = 0; delete [] a; a = 0; } + else if (n == 0) + { + REPORT + a = new int [n1]; if (!a) Throw(Bad_alloc()); + n = n1; + if (keep) operator=(0); + } + else + { + int* a1 = a; + if (keep) + { + REPORT + int i; + a = new int [n1]; if (!a) Throw(Bad_alloc()); + if (n > n1) n = n1; + else for (i = n; i < n1; i++) a[i] = 0; + for (i = 0; i < n; i++) a[i] = a1[i]; + n = n1; delete [] a1; + } + else + { + REPORT n = n1; delete [] a1; + a = new int [n]; if (!a) Throw(Bad_alloc()); + } + } +} + +//************************** swap values ******************************** + +// swap values + +void GeneralMatrix::swap(GeneralMatrix& gm) +{ + REPORT + int t; + t = tag_val; tag_val = gm.tag_val; gm.tag_val = t; + t = nrows_val; nrows_val = gm.nrows_val; gm.nrows_val = t; + t = ncols_val; ncols_val = gm.ncols_val; gm.ncols_val = t; + t = storage; storage = gm.storage; gm.storage = t; + Real* s = store; store = gm.store; gm.store = s; +} + +void nricMatrix::swap(nricMatrix& gm) +{ + REPORT + GeneralMatrix::swap((GeneralMatrix&)gm); + Real** rp = row_pointer; row_pointer = gm.row_pointer; gm.row_pointer = rp; +} + +void CroutMatrix::swap(CroutMatrix& gm) +{ + REPORT + GeneralMatrix::swap((GeneralMatrix&)gm); + int* i = indx; indx = gm.indx; gm.indx = i; + bool b; + b = d; d = gm.d; gm.d = b; + b = sing; sing = gm.sing; gm.sing = b; +} + +void BandMatrix::swap(BandMatrix& gm) +{ + REPORT + GeneralMatrix::swap((GeneralMatrix&)gm); + int i; + i = lower_val; lower_val = gm.lower_val; gm.lower_val = i; + i = upper_val; upper_val = gm.upper_val; gm.upper_val = i; +} + +void SymmetricBandMatrix::swap(SymmetricBandMatrix& gm) +{ + REPORT + GeneralMatrix::swap((GeneralMatrix&)gm); + int i; + i = lower_val; lower_val = gm.lower_val; gm.lower_val = i; +} + +void BandLUMatrix::swap(BandLUMatrix& gm) +{ + REPORT + GeneralMatrix::swap((GeneralMatrix&)gm); + int* i = indx; indx = gm.indx; gm.indx = i; + bool b; + b = d; d = gm.d; gm.d = b; + b = sing; sing = gm.sing; gm.sing = b; + int m; + m = storage2; storage2 = gm.storage2; gm.storage2 = m; + m = m1; m1 = gm.m1; gm.m1 = m; + m = m2; m2 = gm.m2; gm.m2 = m; + Real* s = store2; store2 = gm.store2; gm.store2 = s; +} + +void GenericMatrix::swap(GenericMatrix& x) +{ + REPORT + GeneralMatrix* tgm = gm; gm = x.gm; x.gm = tgm; +} + +// ********************** C subscript classes **************************** + +RealStarStar::RealStarStar(Matrix& A) +{ + REPORT + Tracer tr("RealStarStar"); + int n = A.ncols(); + int m = A.nrows(); + a = new Real*[m]; + MatrixErrorNoSpace(a); + Real* d = A.data(); + for (int i = 0; i < m; ++i) a[i] = d + i * n; +} + +ConstRealStarStar::ConstRealStarStar(const Matrix& A) +{ + REPORT + Tracer tr("ConstRealStarStar"); + int n = A.ncols(); + int m = A.nrows(); + a = new const Real*[m]; + MatrixErrorNoSpace(a); + const Real* d = A.data(); + for (int i = 0; i < m; ++i) a[i] = d + i * n; +} + + + +#ifdef use_namespace +} +#endif + + +/// \fn GeneralMatrix::SimpleAddOK(const GeneralMatrix* gm) +/// Can we add two matrices with simple vector add. +/// SimpleAddOK shows when we can add two matrices by a simple vector add +/// and when we can add one matrix into another +/// +/// *gm must be the same type as *this +/// - return 0 if simple add is OK +/// - return 1 if we can add into *gm only +/// - return 2 if we can add into *this only +/// - return 3 if we can't add either way +/// +/// Also applies to subtract; +/// for SP this will still be valid if we swap 1 and 2 +/// +/// For types Matrix, DiagonalMatrix, UpperTriangularMatrix, +/// LowerTriangularMatrix, SymmetricMatrix etc return 0. +/// For band matrices we will need to check bandwidths. + + + + + + + +///@} diff --git a/extern/newmat/newmat5.cpp b/extern/newmat/newmat5.cpp new file mode 100644 index 00000000..703fb00e --- /dev/null +++ b/extern/newmat/newmat5.cpp @@ -0,0 +1,557 @@ +/// \ingroup newmat +///@{ + +/// \file newmat5.cpp +/// Transpose, evaluate, operations with scalar, matrix input. + +// Copyright (C) 1991,2,3,4: R B Davies + +//#define WANT_STREAM + +#include "include.h" + +#include "newmat.h" +#include "newmatrc.h" + +#ifdef use_namespace +namespace NEWMAT { +#endif + + +#ifdef DO_REPORT +#define REPORT { static ExeCounter ExeCount(__LINE__,5); ++ExeCount; } +#else +#define REPORT {} +#endif + + +/************************ carry out operations ******************************/ + + +GeneralMatrix* GeneralMatrix::Transpose(TransposedMatrix* tm, MatrixType mt) +{ + GeneralMatrix* gm1; + + if (Compare(Type().t(),mt)) + { + REPORT + gm1 = mt.New(ncols_val,nrows_val,tm); + for (int i=0; iReleaseAndDelete(); return gm1; +} + +GeneralMatrix* SymmetricMatrix::Transpose(TransposedMatrix*, MatrixType mt) +{ REPORT return Evaluate(mt); } + + +GeneralMatrix* DiagonalMatrix::Transpose(TransposedMatrix*, MatrixType mt) +{ REPORT return Evaluate(mt); } + +GeneralMatrix* ColumnVector::Transpose(TransposedMatrix*, MatrixType mt) +{ + REPORT + GeneralMatrix* gmx = new RowVector; MatrixErrorNoSpace(gmx); + gmx->nrows_val = 1; gmx->ncols_val = gmx->storage = storage; + return BorrowStore(gmx,mt); +} + +GeneralMatrix* RowVector::Transpose(TransposedMatrix*, MatrixType mt) +{ + REPORT + GeneralMatrix* gmx = new ColumnVector; MatrixErrorNoSpace(gmx); + gmx->ncols_val = 1; gmx->nrows_val = gmx->storage = storage; + return BorrowStore(gmx,mt); +} + +GeneralMatrix* IdentityMatrix::Transpose(TransposedMatrix*, MatrixType mt) +{ REPORT return Evaluate(mt); } + +GeneralMatrix* GeneralMatrix::Evaluate(MatrixType mt) +{ + if (Compare(this->Type(),mt)) { REPORT return this; } + REPORT + GeneralMatrix* gmx = mt.New(nrows_val,ncols_val,this); + MatrixRow mr(this, LoadOnEntry); + MatrixRow mrx(gmx, StoreOnExit+DirectPart); + int i=nrows_val; + while (i--) { mrx.Copy(mr); mrx.Next(); mr.Next(); } + tDelete(); gmx->ReleaseAndDelete(); return gmx; +} + +GeneralMatrix* CroutMatrix::Evaluate(MatrixType mt) +{ + if (Compare(this->Type(),mt)) { REPORT return this; } + REPORT + Tracer et("CroutMatrix::Evaluate"); + bool dummy = true; + if (dummy) Throw(ProgramException("Illegal use of CroutMatrix", *this)); + return this; +} + +GeneralMatrix* GenericMatrix::Evaluate(MatrixType mt) + { REPORT return gm->Evaluate(mt); } + +GeneralMatrix* ShiftedMatrix::Evaluate(MatrixType mt) +{ + gm=((BaseMatrix*&)bm)->Evaluate(); + int nr=gm->Nrows(); int nc=gm->Ncols(); + Compare(gm->Type().AddEqualEl(),mt); + if (!(mt==gm->Type())) + { + REPORT + GeneralMatrix* gmx = mt.New(nr,nc,this); + MatrixRow mr(gm, LoadOnEntry); + MatrixRow mrx(gmx, StoreOnExit+DirectPart); + while (nr--) { mrx.Add(mr,f); mrx.Next(); mr.Next(); } + gmx->ReleaseAndDelete(); gm->tDelete(); + return gmx; + } + else if (gm->reuse()) + { + REPORT gm->Add(f); + return gm; + } + else + { + REPORT GeneralMatrix* gmy = gm->Type().New(nr,nc,this); + gmy->ReleaseAndDelete(); gmy->Add(gm,f); + return gmy; + } +} + +GeneralMatrix* NegShiftedMatrix::Evaluate(MatrixType mt) +{ + gm=((BaseMatrix*&)bm)->Evaluate(); + int nr=gm->Nrows(); int nc=gm->Ncols(); + Compare(gm->Type().AddEqualEl(),mt); + if (!(mt==gm->Type())) + { + REPORT + GeneralMatrix* gmx = mt.New(nr,nc,this); + MatrixRow mr(gm, LoadOnEntry); + MatrixRow mrx(gmx, StoreOnExit+DirectPart); + while (nr--) { mrx.NegAdd(mr,f); mrx.Next(); mr.Next(); } + gmx->ReleaseAndDelete(); gm->tDelete(); + return gmx; + } + else if (gm->reuse()) + { + REPORT gm->NegAdd(f); + return gm; + } + else + { + REPORT GeneralMatrix* gmy = gm->Type().New(nr,nc,this); + gmy->ReleaseAndDelete(); gmy->NegAdd(gm,f); + return gmy; + } +} + +GeneralMatrix* ScaledMatrix::Evaluate(MatrixType mt) +{ + gm=((BaseMatrix*&)bm)->Evaluate(); + int nr=gm->Nrows(); int nc=gm->Ncols(); + if (Compare(gm->Type(),mt)) + { + if (gm->reuse()) + { + REPORT gm->Multiply(f); + return gm; + } + else + { + REPORT GeneralMatrix* gmx = gm->Type().New(nr,nc,this); + gmx->ReleaseAndDelete(); gmx->Multiply(gm,f); + return gmx; + } + } + else + { + REPORT + GeneralMatrix* gmx = mt.New(nr,nc,this); + MatrixRow mr(gm, LoadOnEntry); + MatrixRow mrx(gmx, StoreOnExit+DirectPart); + while (nr--) { mrx.Multiply(mr,f); mrx.Next(); mr.Next(); } + gmx->ReleaseAndDelete(); gm->tDelete(); + return gmx; + } +} + +GeneralMatrix* NegatedMatrix::Evaluate(MatrixType mt) +{ + gm=((BaseMatrix*&)bm)->Evaluate(); + int nr=gm->Nrows(); int nc=gm->Ncols(); + if (Compare(gm->Type(),mt)) + { + if (gm->reuse()) + { + REPORT gm->Negate(); + return gm; + } + else + { + REPORT + GeneralMatrix* gmx = gm->Type().New(nr,nc,this); + gmx->ReleaseAndDelete(); gmx->Negate(gm); + return gmx; + } + } + else + { + REPORT + GeneralMatrix* gmx = mt.New(nr,nc,this); + MatrixRow mr(gm, LoadOnEntry); + MatrixRow mrx(gmx, StoreOnExit+DirectPart); + while (nr--) { mrx.Negate(mr); mrx.Next(); mr.Next(); } + gmx->ReleaseAndDelete(); gm->tDelete(); + return gmx; + } +} + +GeneralMatrix* ReversedMatrix::Evaluate(MatrixType mt) +{ + gm=((BaseMatrix*&)bm)->Evaluate(); GeneralMatrix* gmx; + + if ((gm->Type()).is_band() && ! (gm->Type()).is_diagonal()) + { + gm->tDelete(); + Throw(NotDefinedException("Reverse", "band matrices")); + } + + if (gm->reuse()) { REPORT gm->ReverseElements(); gmx = gm; } + else + { + REPORT + gmx = gm->Type().New(gm->Nrows(), gm->Ncols(), this); + gmx->ReverseElements(gm); gmx->ReleaseAndDelete(); + } + return gmx->Evaluate(mt); // target matrix is different type? + +} + +GeneralMatrix* TransposedMatrix::Evaluate(MatrixType mt) +{ + REPORT + gm=((BaseMatrix*&)bm)->Evaluate(); + Compare(gm->Type().t(),mt); + GeneralMatrix* gmx=gm->Transpose(this, mt); + return gmx; +} + +GeneralMatrix* RowedMatrix::Evaluate(MatrixType mt) +{ + gm = ((BaseMatrix*&)bm)->Evaluate(); + GeneralMatrix* gmx = new RowVector; MatrixErrorNoSpace(gmx); + gmx->nrows_val = 1; gmx->ncols_val = gmx->storage = gm->storage; + return gm->BorrowStore(gmx,mt); +} + +GeneralMatrix* ColedMatrix::Evaluate(MatrixType mt) +{ + gm = ((BaseMatrix*&)bm)->Evaluate(); + GeneralMatrix* gmx = new ColumnVector; MatrixErrorNoSpace(gmx); + gmx->ncols_val = 1; gmx->nrows_val = gmx->storage = gm->storage; + return gm->BorrowStore(gmx,mt); +} + +GeneralMatrix* DiagedMatrix::Evaluate(MatrixType mt) +{ + gm = ((BaseMatrix*&)bm)->Evaluate(); + GeneralMatrix* gmx = new DiagonalMatrix; MatrixErrorNoSpace(gmx); + gmx->nrows_val = gmx->ncols_val = gmx->storage = gm->storage; + return gm->BorrowStore(gmx,mt); +} + +GeneralMatrix* MatedMatrix::Evaluate(MatrixType mt) +{ + Tracer tr("MatedMatrix::Evaluate"); + gm = ((BaseMatrix*&)bm)->Evaluate(); + GeneralMatrix* gmx = new Matrix; MatrixErrorNoSpace(gmx); + gmx->nrows_val = nr; gmx->ncols_val = nc; gmx->storage = gm->storage; + if (nr*nc != gmx->storage) + Throw(IncompatibleDimensionsException()); + return gm->BorrowStore(gmx,mt); +} + +GeneralMatrix* GetSubMatrix::Evaluate(MatrixType mt) +{ + REPORT + Tracer tr("SubMatrix(evaluate)"); + gm = ((BaseMatrix*&)bm)->Evaluate(); + if (row_number < 0) row_number = gm->Nrows(); + if (col_number < 0) col_number = gm->Ncols(); + if (row_skip+row_number > gm->Nrows() || col_skip+col_number > gm->Ncols()) + { + gm->tDelete(); + Throw(SubMatrixDimensionException()); + } + if (IsSym) Compare(gm->Type().ssub(), mt); + else Compare(gm->Type().sub(), mt); + GeneralMatrix* gmx = mt.New(row_number, col_number, this); + int i = row_number; + MatrixRow mr(gm, LoadOnEntry, row_skip); + MatrixRow mrx(gmx, StoreOnExit+DirectPart); + MatrixRowCol sub; + while (i--) + { + mr.SubRowCol(sub, col_skip, col_number); // put values in sub + mrx.Copy(sub); mrx.Next(); mr.Next(); + } + gmx->ReleaseAndDelete(); gm->tDelete(); + return gmx; +} + + +GeneralMatrix* ReturnMatrix::Evaluate(MatrixType mt) +{ + return gm->Evaluate(mt); +} + + +void GeneralMatrix::Add(GeneralMatrix* gm1, Real f) +{ + REPORT + Real* s1=gm1->store; Real* s=store; int i=(storage >> 2); + while (i--) + { *s++ = *s1++ + f; *s++ = *s1++ + f; *s++ = *s1++ + f; *s++ = *s1++ + f; } + i = storage & 3; while (i--) *s++ = *s1++ + f; +} + +void GeneralMatrix::Add(Real f) +{ + REPORT + Real* s=store; int i=(storage >> 2); + while (i--) { *s++ += f; *s++ += f; *s++ += f; *s++ += f; } + i = storage & 3; while (i--) *s++ += f; +} + +void GeneralMatrix::NegAdd(GeneralMatrix* gm1, Real f) +{ + REPORT + Real* s1=gm1->store; Real* s=store; int i=(storage >> 2); + while (i--) + { *s++ = f - *s1++; *s++ = f - *s1++; *s++ = f - *s1++; *s++ = f - *s1++; } + i = storage & 3; while (i--) *s++ = f - *s1++; +} + +void GeneralMatrix::NegAdd(Real f) +{ + REPORT + Real* s=store; int i=(storage >> 2); + while (i--) + { + *s = f - *s; s++; *s = f - *s; s++; + *s = f - *s; s++; *s = f - *s; s++; + } + i = storage & 3; while (i--) { *s = f - *s; s++; } +} + +void GeneralMatrix::Negate(GeneralMatrix* gm1) +{ + // change sign of elements + REPORT + Real* s1=gm1->store; Real* s=store; int i=(storage >> 2); + while (i--) + { *s++ = -(*s1++); *s++ = -(*s1++); *s++ = -(*s1++); *s++ = -(*s1++); } + i = storage & 3; while(i--) *s++ = -(*s1++); +} + +void GeneralMatrix::Negate() +{ + REPORT + Real* s=store; int i=(storage >> 2); + while (i--) + { *s = -(*s); s++; *s = -(*s); s++; *s = -(*s); s++; *s = -(*s); s++; } + i = storage & 3; while(i--) { *s = -(*s); s++; } +} + +void GeneralMatrix::Multiply(GeneralMatrix* gm1, Real f) +{ + REPORT + Real* s1=gm1->store; Real* s=store; int i=(storage >> 2); + while (i--) + { *s++ = *s1++ * f; *s++ = *s1++ * f; *s++ = *s1++ * f; *s++ = *s1++ * f; } + i = storage & 3; while (i--) *s++ = *s1++ * f; +} + +void GeneralMatrix::Multiply(Real f) +{ + REPORT + Real* s=store; int i=(storage >> 2); + while (i--) { *s++ *= f; *s++ *= f; *s++ *= f; *s++ *= f; } + i = storage & 3; while (i--) *s++ *= f; +} + + +/************************ MatrixInput routines ****************************/ + +// int MatrixInput::n; // number values still to be read +// Real* MatrixInput::r; // pointer to next location to be read to + +MatrixInput MatrixInput::operator<<(double f) +{ + REPORT + Tracer et("MatrixInput"); + if (n<=0) Throw(ProgramException("List of values too long")); + *r = (Real)f; int n1 = n-1; n=0; // n=0 so we won't trigger exception + return MatrixInput(n1, r+1); +} + + +MatrixInput GeneralMatrix::operator<<(double f) +{ + REPORT + Tracer et("MatrixInput"); + int n = Storage(); + if (n<=0) Throw(ProgramException("Loading data to zero length matrix")); + Real* r; r = Store(); *r = (Real)f; n--; + return MatrixInput(n, r+1); +} + +MatrixInput GetSubMatrix::operator<<(double f) +{ + REPORT + Tracer et("MatrixInput (GetSubMatrix)"); + SetUpLHS(); + if (row_number != 1 || col_skip != 0 || col_number != gm->Ncols()) + { + Throw(ProgramException("MatrixInput requires complete rows")); + } + MatrixRow mr(gm, DirectPart, row_skip); // to pick up location and length + int n = mr.Storage(); + if (n<=0) + { + Throw(ProgramException("Loading data to zero length row")); + } + Real* r; r = mr.Data(); *r = (Real)f; n--; + if (+(mr.cw*HaveStore)) + { + Throw(ProgramException("Fails with this matrix type")); + } + return MatrixInput(n, r+1); +} + +MatrixInput MatrixInput::operator<<(float f) +{ + REPORT + Tracer et("MatrixInput"); + if (n<=0) Throw(ProgramException("List of values too long")); + *r = (Real)f; int n1 = n-1; n=0; // n=0 so we won't trigger exception + return MatrixInput(n1, r+1); +} + + +MatrixInput GeneralMatrix::operator<<(float f) +{ + REPORT + Tracer et("MatrixInput"); + int n = Storage(); + if (n<=0) Throw(ProgramException("Loading data to zero length matrix")); + Real* r; r = Store(); *r = (Real)f; n--; + return MatrixInput(n, r+1); +} + +MatrixInput GetSubMatrix::operator<<(float f) +{ + REPORT + Tracer et("MatrixInput (GetSubMatrix)"); + SetUpLHS(); + if (row_number != 1 || col_skip != 0 || col_number != gm->Ncols()) + { + Throw(ProgramException("MatrixInput requires complete rows")); + } + MatrixRow mr(gm, DirectPart, row_skip); // to pick up location and length + int n = mr.Storage(); + if (n<=0) + { + Throw(ProgramException("Loading data to zero length row")); + } + Real* r; r = mr.Data(); *r = (Real)f; n--; + if (+(mr.cw*HaveStore)) + { + Throw(ProgramException("Fails with this matrix type")); + } + return MatrixInput(n, r+1); +} +MatrixInput::~MatrixInput() +{ + REPORT + Tracer et("MatrixInput"); + if (n!=0) Throw(ProgramException("A list of values was too short")); +} + +MatrixInput BandMatrix::operator<<(double) +{ + Tracer et("MatrixInput"); + bool dummy = true; + if (dummy) // get rid of warning message + Throw(ProgramException("Cannot use list read with a BandMatrix")); + return MatrixInput(0, 0); +} + +MatrixInput BandMatrix::operator<<(float) +{ + Tracer et("MatrixInput"); + bool dummy = true; + if (dummy) // get rid of warning message + Throw(ProgramException("Cannot use list read with a BandMatrix")); + return MatrixInput(0, 0); +} + +void BandMatrix::operator<<(const double*) +{ Throw(ProgramException("Cannot use array read with a BandMatrix")); } + +void BandMatrix::operator<<(const float*) +{ Throw(ProgramException("Cannot use array read with a BandMatrix")); } + +void BandMatrix::operator<<(const int*) +{ Throw(ProgramException("Cannot use array read with a BandMatrix")); } + +void SymmetricBandMatrix::operator<<(const double*) +{ Throw(ProgramException("Cannot use array read with a BandMatrix")); } + +void SymmetricBandMatrix::operator<<(const float*) +{ Throw(ProgramException("Cannot use array read with a BandMatrix")); } + +void SymmetricBandMatrix::operator<<(const int*) +{ Throw(ProgramException("Cannot use array read with a BandMatrix")); } + +// ************************* Reverse order of elements *********************** + +void GeneralMatrix::ReverseElements(GeneralMatrix* gm) +{ + // reversing into a new matrix + REPORT + int n = Storage(); Real* rx = Store() + n; Real* x = gm->Store(); + while (n--) *(--rx) = *(x++); +} + +void GeneralMatrix::ReverseElements() +{ + // reversing in place + REPORT + int n = Storage(); Real* x = Store(); Real* rx = x + n; + n /= 2; + while (n--) { Real t = *(--rx); *rx = *x; *(x++) = t; } +} + + +#ifdef use_namespace +} +#endif + +///@} diff --git a/extern/newmat/newmat6.cpp b/extern/newmat/newmat6.cpp new file mode 100644 index 00000000..eda39091 --- /dev/null +++ b/extern/newmat/newmat6.cpp @@ -0,0 +1,937 @@ +/// \ingroup newmat +///@{ + +/// \file newmat6.cpp +/// Operators, element access. + +// Copyright (C) 1991,2,3,4: R B Davies + +#include "include.h" + +#include "newmat.h" +#include "newmatrc.h" + +#ifdef use_namespace +namespace NEWMAT { +#endif + + + +#ifdef DO_REPORT +#define REPORT { static ExeCounter ExeCount(__LINE__,6); ++ExeCount; } +#else +#define REPORT {} +#endif + +/*************************** general utilities *************************/ + +static int tristore(int n) // els in triangular matrix +{ return (n*(n+1))/2; } + + +/****************************** operators *******************************/ + +Real& Matrix::operator()(int m, int n) +{ + REPORT + if (m<=0 || m>nrows_val || n<=0 || n>ncols_val) + Throw(IndexException(m,n,*this)); + return store[(m-1)*ncols_val+n-1]; +} + +Real& SymmetricMatrix::operator()(int m, int n) +{ + REPORT + if (m<=0 || n<=0 || m>nrows_val || n>ncols_val) + Throw(IndexException(m,n,*this)); + if (m>=n) return store[tristore(m-1)+n-1]; + else return store[tristore(n-1)+m-1]; +} + +Real& UpperTriangularMatrix::operator()(int m, int n) +{ + REPORT + if (m<=0 || nncols_val) + Throw(IndexException(m,n,*this)); + return store[(m-1)*ncols_val+n-1-tristore(m-1)]; +} + +Real& LowerTriangularMatrix::operator()(int m, int n) +{ + REPORT + if (n<=0 || mnrows_val) + Throw(IndexException(m,n,*this)); + return store[tristore(m-1)+n-1]; +} + +Real& DiagonalMatrix::operator()(int m, int n) +{ + REPORT + if (n<=0 || m!=n || m>nrows_val || n>ncols_val) + Throw(IndexException(m,n,*this)); + return store[n-1]; +} + +Real& DiagonalMatrix::operator()(int m) +{ + REPORT + if (m<=0 || m>nrows_val) Throw(IndexException(m,*this)); + return store[m-1]; +} + +Real& ColumnVector::operator()(int m) +{ + REPORT + if (m<=0 || m> nrows_val) Throw(IndexException(m,*this)); + return store[m-1]; +} + +Real& RowVector::operator()(int n) +{ + REPORT + if (n<=0 || n> ncols_val) Throw(IndexException(n,*this)); + return store[n-1]; +} + +Real& BandMatrix::operator()(int m, int n) +{ + REPORT + int w = upper_val+lower_val+1; int i = lower_val+n-m; + if (m<=0 || m>nrows_val || n<=0 || n>ncols_val || i<0 || i>=w) + Throw(IndexException(m,n,*this)); + return store[w*(m-1)+i]; +} + +Real& UpperBandMatrix::operator()(int m, int n) +{ + REPORT + int w = upper_val+1; int i = n-m; + if (m<=0 || m>nrows_val || n<=0 || n>ncols_val || i<0 || i>=w) + Throw(IndexException(m,n,*this)); + return store[w*(m-1)+i]; +} + +Real& LowerBandMatrix::operator()(int m, int n) +{ + REPORT + int w = lower_val+1; int i = lower_val+n-m; + if (m<=0 || m>nrows_val || n<=0 || n>ncols_val || i<0 || i>=w) + Throw(IndexException(m,n,*this)); + return store[w*(m-1)+i]; +} + +Real& SymmetricBandMatrix::operator()(int m, int n) +{ + REPORT + int w = lower_val+1; + if (m>=n) + { + REPORT + int i = lower_val+n-m; + if ( m>nrows_val || n<=0 || i<0 ) + Throw(IndexException(m,n,*this)); + return store[w*(m-1)+i]; + } + else + { + REPORT + int i = lower_val+m-n; + if ( n>nrows_val || m<=0 || i<0 ) + Throw(IndexException(m,n,*this)); + return store[w*(n-1)+i]; + } +} + + +Real Matrix::operator()(int m, int n) const +{ + REPORT + if (m<=0 || m>nrows_val || n<=0 || n>ncols_val) + Throw(IndexException(m,n,*this)); + return store[(m-1)*ncols_val+n-1]; +} + +Real SymmetricMatrix::operator()(int m, int n) const +{ + REPORT + if (m<=0 || n<=0 || m>nrows_val || n>ncols_val) + Throw(IndexException(m,n,*this)); + if (m>=n) return store[tristore(m-1)+n-1]; + else return store[tristore(n-1)+m-1]; +} + +Real UpperTriangularMatrix::operator()(int m, int n) const +{ + REPORT + if (m<=0 || nncols_val) + Throw(IndexException(m,n,*this)); + return store[(m-1)*ncols_val+n-1-tristore(m-1)]; +} + +Real LowerTriangularMatrix::operator()(int m, int n) const +{ + REPORT + if (n<=0 || mnrows_val) + Throw(IndexException(m,n,*this)); + return store[tristore(m-1)+n-1]; +} + +Real DiagonalMatrix::operator()(int m, int n) const +{ + REPORT + if (n<=0 || m!=n || m>nrows_val || n>ncols_val) + Throw(IndexException(m,n,*this)); + return store[n-1]; +} + +Real DiagonalMatrix::operator()(int m) const +{ + REPORT + if (m<=0 || m>nrows_val) Throw(IndexException(m,*this)); + return store[m-1]; +} + +Real ColumnVector::operator()(int m) const +{ + REPORT + if (m<=0 || m> nrows_val) Throw(IndexException(m,*this)); + return store[m-1]; +} + +Real RowVector::operator()(int n) const +{ + REPORT + if (n<=0 || n> ncols_val) Throw(IndexException(n,*this)); + return store[n-1]; +} + +Real BandMatrix::operator()(int m, int n) const +{ + REPORT + int w = upper_val+lower_val+1; int i = lower_val+n-m; + if (m<=0 || m>nrows_val || n<=0 || n>ncols_val || i<0 || i>=w) + Throw(IndexException(m,n,*this)); + return store[w*(m-1)+i]; +} + +Real UpperBandMatrix::operator()(int m, int n) const +{ + REPORT + int w = upper_val+1; int i = n-m; + if (m<=0 || m>nrows_val || n<=0 || n>ncols_val || i<0 || i>=w) + Throw(IndexException(m,n,*this)); + return store[w*(m-1)+i]; +} + +Real LowerBandMatrix::operator()(int m, int n) const +{ + REPORT + int w = lower_val+1; int i = lower_val+n-m; + if (m<=0 || m>nrows_val || n<=0 || n>ncols_val || i<0 || i>=w) + Throw(IndexException(m,n,*this)); + return store[w*(m-1)+i]; +} + +Real SymmetricBandMatrix::operator()(int m, int n) const +{ + REPORT + int w = lower_val+1; + if (m>=n) + { + REPORT + int i = lower_val+n-m; + if ( m>nrows_val || n<=0 || i<0 ) + Throw(IndexException(m,n,*this)); + return store[w*(m-1)+i]; + } + else + { + REPORT + int i = lower_val+m-n; + if ( n>nrows_val || m<=0 || i<0 ) + Throw(IndexException(m,n,*this)); + return store[w*(n-1)+i]; + } +} + + +Real BaseMatrix::as_scalar() const +{ + REPORT + GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate(); + + if (gm->nrows_val!=1 || gm->ncols_val!=1) + { + Tracer tr("as_scalar"); + Try + { Throw(ProgramException("Cannot convert to scalar", *gm)); } + CatchAll { gm->tDelete(); ReThrow; } + } + + Real x = *(gm->store); gm->tDelete(); return x; +} + + +AddedMatrix BaseMatrix::operator+(const BaseMatrix& bm) const +{ REPORT return AddedMatrix(this, &bm); } + +SPMatrix SP(const BaseMatrix& bm1,const BaseMatrix& bm2) +{ REPORT return SPMatrix(&bm1, &bm2); } + +KPMatrix KP(const BaseMatrix& bm1,const BaseMatrix& bm2) +{ REPORT return KPMatrix(&bm1, &bm2); } + +MultipliedMatrix BaseMatrix::operator*(const BaseMatrix& bm) const +{ REPORT return MultipliedMatrix(this, &bm); } + +ConcatenatedMatrix BaseMatrix::operator|(const BaseMatrix& bm) const +{ REPORT return ConcatenatedMatrix(this, &bm); } + +StackedMatrix BaseMatrix::operator&(const BaseMatrix& bm) const +{ REPORT return StackedMatrix(this, &bm); } + +SolvedMatrix InvertedMatrix::operator*(const BaseMatrix& bmx) const +{ REPORT return SolvedMatrix(bm, &bmx); } + +SubtractedMatrix BaseMatrix::operator-(const BaseMatrix& bm) const +{ REPORT return SubtractedMatrix(this, &bm); } + +ShiftedMatrix BaseMatrix::operator+(Real f) const +{ REPORT return ShiftedMatrix(this, f); } + +ShiftedMatrix operator+(Real f, const BaseMatrix& BM) +{ REPORT return ShiftedMatrix(&BM, f); } + +NegShiftedMatrix operator-(Real f, const BaseMatrix& bm) +{ REPORT return NegShiftedMatrix(f, &bm); } + +ScaledMatrix BaseMatrix::operator*(Real f) const +{ REPORT return ScaledMatrix(this, f); } + +ScaledMatrix BaseMatrix::operator/(Real f) const +{ REPORT return ScaledMatrix(this, 1.0/f); } + +ScaledMatrix operator*(Real f, const BaseMatrix& BM) +{ REPORT return ScaledMatrix(&BM, f); } + +ShiftedMatrix BaseMatrix::operator-(Real f) const +{ REPORT return ShiftedMatrix(this, -f); } + +TransposedMatrix BaseMatrix::t() const +{ REPORT return TransposedMatrix(this); } + +NegatedMatrix BaseMatrix::operator-() const +{ REPORT return NegatedMatrix(this); } + +ReversedMatrix BaseMatrix::reverse() const +{ REPORT return ReversedMatrix(this); } + +InvertedMatrix BaseMatrix::i() const +{ REPORT return InvertedMatrix(this); } + + +RowedMatrix BaseMatrix::as_row() const +{ REPORT return RowedMatrix(this); } + +ColedMatrix BaseMatrix::as_column() const +{ REPORT return ColedMatrix(this); } + +DiagedMatrix BaseMatrix::as_diagonal() const +{ REPORT return DiagedMatrix(this); } + +MatedMatrix BaseMatrix::as_matrix(int nrx, int ncx) const +{ REPORT return MatedMatrix(this,nrx,ncx); } + + +void GeneralMatrix::operator=(Real f) +{ REPORT int i=storage; Real* s=store; while (i--) { *s++ = f; } } + +void Matrix::operator=(const BaseMatrix& X) +{ + REPORT //CheckConversion(X); + // MatrixConversionCheck mcc; + Eq(X,MatrixType::Rt); +} + +void SquareMatrix::operator=(const BaseMatrix& X) +{ + REPORT //CheckConversion(X); + // MatrixConversionCheck mcc; + Eq(X,MatrixType::Rt); + if (nrows_val != ncols_val) + { Tracer tr("SquareMatrix(=)"); Throw(NotSquareException(*this)); } +} + +void SquareMatrix::operator=(const Matrix& m) +{ + REPORT + if (m.nrows_val != m.ncols_val) + { Tracer tr("SquareMatrix(=Matrix)"); Throw(NotSquareException(*this)); } + Eq(m); +} + +void RowVector::operator=(const BaseMatrix& X) +{ + REPORT // CheckConversion(X); + // MatrixConversionCheck mcc; + Eq(X,MatrixType::RV); + if (nrows_val!=1) + { Tracer tr("RowVector(=)"); Throw(VectorException(*this)); } +} + +void ColumnVector::operator=(const BaseMatrix& X) +{ + REPORT //CheckConversion(X); + // MatrixConversionCheck mcc; + Eq(X,MatrixType::CV); + if (ncols_val!=1) + { Tracer tr("ColumnVector(=)"); Throw(VectorException(*this)); } +} + +void SymmetricMatrix::operator=(const BaseMatrix& X) +{ + REPORT // CheckConversion(X); + // MatrixConversionCheck mcc; + Eq(X,MatrixType::Sm); +} + +void UpperTriangularMatrix::operator=(const BaseMatrix& X) +{ + REPORT //CheckConversion(X); + // MatrixConversionCheck mcc; + Eq(X,MatrixType::UT); +} + +void LowerTriangularMatrix::operator=(const BaseMatrix& X) +{ + REPORT //CheckConversion(X); + // MatrixConversionCheck mcc; + Eq(X,MatrixType::LT); +} + +void DiagonalMatrix::operator=(const BaseMatrix& X) +{ + REPORT // CheckConversion(X); + // MatrixConversionCheck mcc; + Eq(X,MatrixType::Dg); +} + +void IdentityMatrix::operator=(const BaseMatrix& X) +{ + REPORT // CheckConversion(X); + // MatrixConversionCheck mcc; + Eq(X,MatrixType::Id); +} + + +void CroutMatrix::operator=(const CroutMatrix& gm) +{ + if (&gm == this) { REPORT tag_val = -1; return; } + REPORT + if (indx) { delete [] indx; indx = 0; } + ((CroutMatrix&)gm).get_aux(*this); + Eq(gm); +} + + + + + +void GeneralMatrix::operator<<(const double* r) +{ + REPORT + int i = storage; Real* s=store; + while(i--) *s++ = (Real)*r++; +} + + +void GeneralMatrix::operator<<(const float* r) +{ + REPORT + int i = storage; Real* s=store; + while(i--) *s++ = (Real)*r++; +} + + +void GeneralMatrix::operator<<(const int* r) +{ + REPORT + int i = storage; Real* s=store; + while(i--) *s++ = (Real)*r++; +} + + +void GenericMatrix::operator=(const GenericMatrix& bmx) +{ + if (&bmx != this) { REPORT if (gm) delete gm; gm = bmx.gm->Image();} + else { REPORT } + gm->Protect(); +} + +void GenericMatrix::operator=(const BaseMatrix& bmx) +{ + if (gm) + { + int counter=bmx.search(gm); + if (counter==0) { REPORT delete gm; gm=0; } + else { REPORT gm->Release(counter); } + } + else { REPORT } + GeneralMatrix* gmx = ((BaseMatrix&)bmx).Evaluate(); + if (gmx != gm) { REPORT if (gm) delete gm; gm = gmx->Image(); } + else { REPORT } + gm->Protect(); +} + + +/*************************** += etc ***************************************/ + + +// GeneralMatrix operators + +void GeneralMatrix::operator+=(const BaseMatrix& X) +{ + REPORT + Tracer tr("GeneralMatrix::operator+="); + // MatrixConversionCheck mcc; + Protect(); // so it cannot get deleted during Evaluate + GeneralMatrix* gm = ((BaseMatrix&)X).Evaluate(); + AddedMatrix am(this,gm); + if (gm==this) Release(2); else Release(); + Eq2(am,type()); +} + +// GeneralMatrix operators + +void GeneralMatrix::SP_eq(const BaseMatrix& X) +{ + REPORT + Tracer tr("GeneralMatrix::SP_eq"); + // MatrixConversionCheck mcc; + Protect(); // so it cannot get deleted during Evaluate + GeneralMatrix* gm = ((BaseMatrix&)X).Evaluate(); + SPMatrix spm(this,gm); + if (gm==this) Release(2); else Release(); + Eq2(spm,type()); +} + +void GeneralMatrix::operator-=(const BaseMatrix& X) +{ + REPORT + Tracer tr("GeneralMatrix::operator-="); + // MatrixConversionCheck mcc; + Protect(); // so it cannot get deleted + // during Evaluate + GeneralMatrix* gm = ((BaseMatrix&)X).Evaluate(); + SubtractedMatrix am(this,gm); + if (gm==this) Release(2); else Release(); + Eq2(am,type()); +} + +void GeneralMatrix::operator*=(const BaseMatrix& X) +{ + REPORT + Tracer tr("GeneralMatrix::operator*="); + // MatrixConversionCheck mcc; + Protect(); // so it cannot get deleted + // during Evaluate + GeneralMatrix* gm = ((BaseMatrix&)X).Evaluate(); + MultipliedMatrix am(this,gm); + if (gm==this) Release(2); else Release(); + Eq2(am,type()); +} + +void GeneralMatrix::operator|=(const BaseMatrix& X) +{ + REPORT + Tracer tr("GeneralMatrix::operator|="); + // MatrixConversionCheck mcc; + Protect(); // so it cannot get deleted + // during Evaluate + GeneralMatrix* gm = ((BaseMatrix&)X).Evaluate(); + ConcatenatedMatrix am(this,gm); + if (gm==this) Release(2); else Release(); + Eq2(am,type()); +} + +void GeneralMatrix::operator&=(const BaseMatrix& X) +{ + REPORT + Tracer tr("GeneralMatrix::operator&="); + // MatrixConversionCheck mcc; + Protect(); // so it cannot get deleted + // during Evaluate + GeneralMatrix* gm = ((BaseMatrix&)X).Evaluate(); + StackedMatrix am(this,gm); + if (gm==this) Release(2); else Release(); + Eq2(am,type()); +} + +void GeneralMatrix::operator+=(Real r) +{ + REPORT + Tracer tr("GeneralMatrix::operator+=(Real)"); + // MatrixConversionCheck mcc; + ShiftedMatrix am(this,r); + Release(); Eq2(am,type()); +} + +void GeneralMatrix::operator*=(Real r) +{ + REPORT + Tracer tr("GeneralMatrix::operator*=(Real)"); + // MatrixConversionCheck mcc; + ScaledMatrix am(this,r); + Release(); Eq2(am,type()); +} + + +// Generic matrix operators + +void GenericMatrix::operator+=(const BaseMatrix& X) +{ + REPORT + Tracer tr("GenericMatrix::operator+="); + if (!gm) Throw(ProgramException("GenericMatrix is null")); + gm->Protect(); // so it cannot get deleted during Evaluate + GeneralMatrix* gmx = ((BaseMatrix&)X).Evaluate(); + AddedMatrix am(gm,gmx); + if (gmx==gm) gm->Release(2); else gm->Release(); + GeneralMatrix* gmy = am.Evaluate(); + if (gmy != gm) { REPORT delete gm; gm = gmy->Image(); } + else { REPORT } + gm->Protect(); +} + +void GenericMatrix::SP_eq(const BaseMatrix& X) +{ + REPORT + Tracer tr("GenericMatrix::SP_eq"); + if (!gm) Throw(ProgramException("GenericMatrix is null")); + gm->Protect(); // so it cannot get deleted during Evaluate + GeneralMatrix* gmx = ((BaseMatrix&)X).Evaluate(); + SPMatrix spm(gm,gmx); + if (gmx==gm) gm->Release(2); else gm->Release(); + GeneralMatrix* gmy = spm.Evaluate(); + if (gmy != gm) { REPORT delete gm; gm = gmy->Image(); } + else { REPORT } + gm->Protect(); +} + +void GenericMatrix::operator-=(const BaseMatrix& X) +{ + REPORT + Tracer tr("GenericMatrix::operator-="); + if (!gm) Throw(ProgramException("GenericMatrix is null")); + gm->Protect(); // so it cannot get deleted during Evaluate + GeneralMatrix* gmx = ((BaseMatrix&)X).Evaluate(); + SubtractedMatrix am(gm,gmx); + if (gmx==gm) gm->Release(2); else gm->Release(); + GeneralMatrix* gmy = am.Evaluate(); + if (gmy != gm) { REPORT delete gm; gm = gmy->Image(); } + else { REPORT } + gm->Protect(); +} + +void GenericMatrix::operator*=(const BaseMatrix& X) +{ + REPORT + Tracer tr("GenericMatrix::operator*="); + if (!gm) Throw(ProgramException("GenericMatrix is null")); + gm->Protect(); // so it cannot get deleted during Evaluate + GeneralMatrix* gmx = ((BaseMatrix&)X).Evaluate(); + MultipliedMatrix am(gm,gmx); + if (gmx==gm) gm->Release(2); else gm->Release(); + GeneralMatrix* gmy = am.Evaluate(); + if (gmy != gm) { REPORT delete gm; gm = gmy->Image(); } + else { REPORT } + gm->Protect(); +} + +void GenericMatrix::operator|=(const BaseMatrix& X) +{ + REPORT + Tracer tr("GenericMatrix::operator|="); + if (!gm) Throw(ProgramException("GenericMatrix is null")); + gm->Protect(); // so it cannot get deleted during Evaluate + GeneralMatrix* gmx = ((BaseMatrix&)X).Evaluate(); + ConcatenatedMatrix am(gm,gmx); + if (gmx==gm) gm->Release(2); else gm->Release(); + GeneralMatrix* gmy = am.Evaluate(); + if (gmy != gm) { REPORT delete gm; gm = gmy->Image(); } + else { REPORT } + gm->Protect(); +} + +void GenericMatrix::operator&=(const BaseMatrix& X) +{ + REPORT + Tracer tr("GenericMatrix::operator&="); + if (!gm) Throw(ProgramException("GenericMatrix is null")); + gm->Protect(); // so it cannot get deleted during Evaluate + GeneralMatrix* gmx = ((BaseMatrix&)X).Evaluate(); + StackedMatrix am(gm,gmx); + if (gmx==gm) gm->Release(2); else gm->Release(); + GeneralMatrix* gmy = am.Evaluate(); + if (gmy != gm) { REPORT delete gm; gm = gmy->Image(); } + else { REPORT } + gm->Protect(); +} + +void GenericMatrix::operator+=(Real r) +{ + REPORT + Tracer tr("GenericMatrix::operator+= (Real)"); + if (!gm) Throw(ProgramException("GenericMatrix is null")); + ShiftedMatrix am(gm,r); + gm->Release(); + GeneralMatrix* gmy = am.Evaluate(); + if (gmy != gm) { REPORT delete gm; gm = gmy->Image(); } + else { REPORT } + gm->Protect(); +} + +void GenericMatrix::operator*=(Real r) +{ + REPORT + Tracer tr("GenericMatrix::operator*= (Real)"); + if (!gm) Throw(ProgramException("GenericMatrix is null")); + ScaledMatrix am(gm,r); + gm->Release(); + GeneralMatrix* gmy = am.Evaluate(); + if (gmy != gm) { REPORT delete gm; gm = gmy->Image(); } + else { REPORT } + gm->Protect(); +} + + +/************************* element access *********************************/ + +Real& Matrix::element(int m, int n) +{ + REPORT + if (m<0 || m>= nrows_val || n<0 || n>= ncols_val) + Throw(IndexException(m,n,*this,true)); + return store[m*ncols_val+n]; +} + +Real Matrix::element(int m, int n) const +{ + REPORT + if (m<0 || m>= nrows_val || n<0 || n>= ncols_val) + Throw(IndexException(m,n,*this,true)); + return store[m*ncols_val+n]; +} + +Real& SymmetricMatrix::element(int m, int n) +{ + REPORT + if (m<0 || n<0 || m >= nrows_val || n>=ncols_val) + Throw(IndexException(m,n,*this,true)); + if (m>=n) return store[tristore(m)+n]; + else return store[tristore(n)+m]; +} + +Real SymmetricMatrix::element(int m, int n) const +{ + REPORT + if (m<0 || n<0 || m >= nrows_val || n>=ncols_val) + Throw(IndexException(m,n,*this,true)); + if (m>=n) return store[tristore(m)+n]; + else return store[tristore(n)+m]; +} + +Real& UpperTriangularMatrix::element(int m, int n) +{ + REPORT + if (m<0 || n=ncols_val) + Throw(IndexException(m,n,*this,true)); + return store[m*ncols_val+n-tristore(m)]; +} + +Real UpperTriangularMatrix::element(int m, int n) const +{ + REPORT + if (m<0 || n=ncols_val) + Throw(IndexException(m,n,*this,true)); + return store[m*ncols_val+n-tristore(m)]; +} + +Real& LowerTriangularMatrix::element(int m, int n) +{ + REPORT + if (n<0 || m=nrows_val) + Throw(IndexException(m,n,*this,true)); + return store[tristore(m)+n]; +} + +Real LowerTriangularMatrix::element(int m, int n) const +{ + REPORT + if (n<0 || m=nrows_val) + Throw(IndexException(m,n,*this,true)); + return store[tristore(m)+n]; +} + +Real& DiagonalMatrix::element(int m, int n) +{ + REPORT + if (n<0 || m!=n || m>=nrows_val || n>=ncols_val) + Throw(IndexException(m,n,*this,true)); + return store[n]; +} + +Real DiagonalMatrix::element(int m, int n) const +{ + REPORT + if (n<0 || m!=n || m>=nrows_val || n>=ncols_val) + Throw(IndexException(m,n,*this,true)); + return store[n]; +} + +Real& DiagonalMatrix::element(int m) +{ + REPORT + if (m<0 || m>=nrows_val) Throw(IndexException(m,*this,true)); + return store[m]; +} + +Real DiagonalMatrix::element(int m) const +{ + REPORT + if (m<0 || m>=nrows_val) Throw(IndexException(m,*this,true)); + return store[m]; +} + +Real& ColumnVector::element(int m) +{ + REPORT + if (m<0 || m>= nrows_val) Throw(IndexException(m,*this,true)); + return store[m]; +} + +Real ColumnVector::element(int m) const +{ + REPORT + if (m<0 || m>= nrows_val) Throw(IndexException(m,*this,true)); + return store[m]; +} + +Real& RowVector::element(int n) +{ + REPORT + if (n<0 || n>= ncols_val) Throw(IndexException(n,*this,true)); + return store[n]; +} + +Real RowVector::element(int n) const +{ + REPORT + if (n<0 || n>= ncols_val) Throw(IndexException(n,*this,true)); + return store[n]; +} + +Real& BandMatrix::element(int m, int n) +{ + REPORT + int w = upper_val+lower_val+1; int i = lower_val+n-m; + if (m<0 || m>= nrows_val || n<0 || n>= ncols_val || i<0 || i>=w) + Throw(IndexException(m,n,*this,true)); + return store[w*m+i]; +} + +Real BandMatrix::element(int m, int n) const +{ + REPORT + int w = upper_val+lower_val+1; int i = lower_val+n-m; + if (m<0 || m>= nrows_val || n<0 || n>= ncols_val || i<0 || i>=w) + Throw(IndexException(m,n,*this,true)); + return store[w*m+i]; +} + +Real& UpperBandMatrix::element(int m, int n) +{ + REPORT + int w = upper_val+1; int i = n-m; + if (m<0 || m>= nrows_val || n<0 || n>= ncols_val || i<0 || i>=w) + Throw(IndexException(m,n,*this,true)); + return store[w*m+i]; +} + +Real UpperBandMatrix::element(int m, int n) const +{ + REPORT + int w = upper_val+1; int i = n-m; + if (m<0 || m>= nrows_val || n<0 || n>= ncols_val || i<0 || i>=w) + Throw(IndexException(m,n,*this,true)); + return store[w*m+i]; +} + +Real& LowerBandMatrix::element(int m, int n) +{ + REPORT + int w = lower_val+1; int i = lower_val+n-m; + if (m<0 || m>= nrows_val || n<0 || n>= ncols_val || i<0 || i>=w) + Throw(IndexException(m,n,*this,true)); + return store[w*m+i]; +} + +Real LowerBandMatrix::element(int m, int n) const +{ + REPORT + int w = lower_val+1; int i = lower_val+n-m; + if (m<0 || m>= nrows_val || n<0 || n>= ncols_val || i<0 || i>=w) + Throw(IndexException(m,n,*this,true)); + return store[w*m+i]; +} + +Real& SymmetricBandMatrix::element(int m, int n) +{ + REPORT + int w = lower_val+1; + if (m>=n) + { + REPORT + int i = lower_val+n-m; + if ( m>=nrows_val || n<0 || i<0 ) + Throw(IndexException(m,n,*this,true)); + return store[w*m+i]; + } + else + { + REPORT + int i = lower_val+m-n; + if ( n>=nrows_val || m<0 || i<0 ) + Throw(IndexException(m,n,*this,true)); + return store[w*n+i]; + } +} + +Real SymmetricBandMatrix::element(int m, int n) const +{ + REPORT + int w = lower_val+1; + if (m>=n) + { + REPORT + int i = lower_val+n-m; + if ( m>=nrows_val || n<0 || i<0 ) + Throw(IndexException(m,n,*this,true)); + return store[w*m+i]; + } + else + { + REPORT + int i = lower_val+m-n; + if ( n>=nrows_val || m<0 || i<0 ) + Throw(IndexException(m,n,*this,true)); + return store[w*n+i]; + } +} + +#ifdef use_namespace +} +#endif + + +///} diff --git a/extern/newmat/newmat7.cpp b/extern/newmat/newmat7.cpp new file mode 100644 index 00000000..5befa5d9 --- /dev/null +++ b/extern/newmat/newmat7.cpp @@ -0,0 +1,1053 @@ +/// \ingroup newmat +///@{ + +/// \file newmat7.cpp +/// Invert, solve, binary operations. + +// Copyright (C) 1991,2,3,4: R B Davies + +#include "include.h" + +#include "newmat.h" +#include "newmatrc.h" + +#ifdef use_namespace +namespace NEWMAT { +#endif + + +#ifdef DO_REPORT +#define REPORT { static ExeCounter ExeCount(__LINE__,7); ++ExeCount; } +#else +#define REPORT {} +#endif + + +//***************************** solve routines ******************************/ + +GeneralMatrix* GeneralMatrix::MakeSolver() +{ + REPORT + GeneralMatrix* gm = new CroutMatrix(*this); + MatrixErrorNoSpace(gm); gm->ReleaseAndDelete(); return gm; +} + +GeneralMatrix* Matrix::MakeSolver() +{ + REPORT + GeneralMatrix* gm = new CroutMatrix(*this); + MatrixErrorNoSpace(gm); gm->ReleaseAndDelete(); return gm; +} + +void CroutMatrix::Solver(MatrixColX& mcout, const MatrixColX& mcin) +{ + REPORT + int i = mcin.skip; Real* el = mcin.data-i; Real* el1 = el; + while (i--) *el++ = 0.0; + el += mcin.storage; i = nrows_val - mcin.skip - mcin.storage; + while (i--) *el++ = 0.0; + lubksb(el1, mcout.skip); +} + + +// Do we need check for entirely zero output? + +void UpperTriangularMatrix::Solver(MatrixColX& mcout, + const MatrixColX& mcin) +{ + REPORT + int i = mcin.skip-mcout.skip; Real* elx = mcin.data-i; + while (i-- > 0) *elx++ = 0.0; + int nr = mcin.skip+mcin.storage; + elx = mcin.data+mcin.storage; Real* el = elx; + int j = mcout.skip+mcout.storage-nr; + int nc = ncols_val-nr; i = nr-mcout.skip; + while (j-- > 0) *elx++ = 0.0; + Real* Ael = store + (nr*(2*ncols_val-nr+1))/2; j = 0; + while (i-- > 0) + { + elx = el; Real sum = 0.0; int jx = j++; Ael -= nc; + while (jx--) sum += *(--Ael) * *(--elx); + elx--; *elx = (*elx - sum) / *(--Ael); + } +} + +void LowerTriangularMatrix::Solver(MatrixColX& mcout, + const MatrixColX& mcin) +{ + REPORT + int i = mcin.skip-mcout.skip; Real* elx = mcin.data-i; + while (i-- > 0) *elx++ = 0.0; + int nc = mcin.skip; i = nc+mcin.storage; elx = mcin.data+mcin.storage; + int nr = mcout.skip+mcout.storage; int j = nr-i; i = nr-nc; + while (j-- > 0) *elx++ = 0.0; + Real* el = mcin.data; Real* Ael = store + (nc*(nc+1))/2; j = 0; + while (i-- > 0) + { + elx = el; Real sum = 0.0; int jx = j++; Ael += nc; + while (jx--) sum += *Ael++ * *elx++; + *elx = (*elx - sum) / *Ael++; + } +} + +//******************* carry out binary operations *************************/ + +static GeneralMatrix* + GeneralMult(GeneralMatrix*,GeneralMatrix*,MultipliedMatrix*,MatrixType); +static GeneralMatrix* + GeneralSolv(GeneralMatrix*,GeneralMatrix*,BaseMatrix*,MatrixType); +static GeneralMatrix* + GeneralSolvI(GeneralMatrix*,BaseMatrix*,MatrixType); +static GeneralMatrix* + GeneralKP(GeneralMatrix*,GeneralMatrix*,KPMatrix*,MatrixType); + +GeneralMatrix* MultipliedMatrix::Evaluate(MatrixType mt) +{ + REPORT + gm2 = ((BaseMatrix*&)bm2)->Evaluate(); + gm2 = gm2->Evaluate(gm2->type().MultRHS()); // no symmetric on RHS + gm1 = ((BaseMatrix*&)bm1)->Evaluate(); + return GeneralMult(gm1, gm2, this, mt); +} + +GeneralMatrix* SolvedMatrix::Evaluate(MatrixType mt) +{ + REPORT + gm1 = ((BaseMatrix*&)bm1)->Evaluate(); + gm2 = ((BaseMatrix*&)bm2)->Evaluate(); + return GeneralSolv(gm1,gm2,this,mt); +} + +GeneralMatrix* KPMatrix::Evaluate(MatrixType mt) +{ + REPORT + gm1 = ((BaseMatrix*&)bm1)->Evaluate(); + gm2 = ((BaseMatrix*&)bm2)->Evaluate(); + return GeneralKP(gm1,gm2,this,mt); +} + +// routines for adding or subtracting matrices of identical storage structure + +static void Add(GeneralMatrix* gm, GeneralMatrix* gm1, GeneralMatrix* gm2) +{ + REPORT + Real* s1=gm1->Store(); Real* s2=gm2->Store(); + Real* s=gm->Store(); int i=gm->Storage() >> 2; + while (i--) + { + *s++ = *s1++ + *s2++; *s++ = *s1++ + *s2++; + *s++ = *s1++ + *s2++; *s++ = *s1++ + *s2++; + } + i=gm->Storage() & 3; while (i--) *s++ = *s1++ + *s2++; +} + +static void AddTo(GeneralMatrix* gm, const GeneralMatrix* gm2) +{ + REPORT + const Real* s2=gm2->Store(); Real* s=gm->Store(); int i=gm->Storage() >> 2; + while (i--) + { *s++ += *s2++; *s++ += *s2++; *s++ += *s2++; *s++ += *s2++; } + i=gm->Storage() & 3; while (i--) *s++ += *s2++; +} + +void GeneralMatrix::PlusEqual(const GeneralMatrix& gm) +{ + REPORT + if (nrows_val != gm.nrows_val || ncols_val != gm.ncols_val) + Throw(IncompatibleDimensionsException(*this, gm)); + AddTo(this, &gm); +} + +static void Subtract(GeneralMatrix* gm, GeneralMatrix* gm1, GeneralMatrix* gm2) +{ + REPORT + Real* s1=gm1->Store(); Real* s2=gm2->Store(); + Real* s=gm->Store(); int i=gm->Storage() >> 2; + while (i--) + { + *s++ = *s1++ - *s2++; *s++ = *s1++ - *s2++; + *s++ = *s1++ - *s2++; *s++ = *s1++ - *s2++; + } + i=gm->Storage() & 3; while (i--) *s++ = *s1++ - *s2++; +} + +static void SubtractFrom(GeneralMatrix* gm, const GeneralMatrix* gm2) +{ + REPORT + const Real* s2=gm2->Store(); Real* s=gm->Store(); int i=gm->Storage() >> 2; + while (i--) + { *s++ -= *s2++; *s++ -= *s2++; *s++ -= *s2++; *s++ -= *s2++; } + i=gm->Storage() & 3; while (i--) *s++ -= *s2++; +} + +void GeneralMatrix::MinusEqual(const GeneralMatrix& gm) +{ + REPORT + if (nrows_val != gm.nrows_val || ncols_val != gm.ncols_val) + Throw(IncompatibleDimensionsException(*this, gm)); + SubtractFrom(this, &gm); +} + +static void ReverseSubtract(GeneralMatrix* gm, const GeneralMatrix* gm2) +{ + REPORT + const Real* s2=gm2->Store(); Real* s=gm->Store(); int i=gm->Storage() >> 2; + while (i--) + { + *s = *s2++ - *s; s++; *s = *s2++ - *s; s++; + *s = *s2++ - *s; s++; *s = *s2++ - *s; s++; + } + i=gm->Storage() & 3; while (i--) { *s = *s2++ - *s; s++; } +} + +static void SP(GeneralMatrix* gm, GeneralMatrix* gm1, GeneralMatrix* gm2) +{ + REPORT + Real* s1=gm1->Store(); Real* s2=gm2->Store(); + Real* s=gm->Store(); int i=gm->Storage() >> 2; + while (i--) + { + *s++ = *s1++ * *s2++; *s++ = *s1++ * *s2++; + *s++ = *s1++ * *s2++; *s++ = *s1++ * *s2++; + } + i=gm->Storage() & 3; while (i--) *s++ = *s1++ * *s2++; +} + +static void SP(GeneralMatrix* gm, const GeneralMatrix* gm2) +{ + REPORT + const Real* s2=gm2->Store(); Real* s=gm->Store(); int i=gm->Storage() >> 2; + while (i--) + { *s++ *= *s2++; *s++ *= *s2++; *s++ *= *s2++; *s++ *= *s2++; } + i=gm->Storage() & 3; while (i--) *s++ *= *s2++; +} + +void GeneralMatrix::SP_Equal(const GeneralMatrix& gm) +{ + REPORT + if (nrows_val != gm.nrows_val || ncols_val != gm.ncols_val) + Throw(IncompatibleDimensionsException(*this, gm)); + SP(this, &gm); +} + +// routines for adding or subtracting matrices of different storage structure + +static void AddDS(GeneralMatrix* gm, GeneralMatrix* gm1, GeneralMatrix* gm2) +{ + REPORT + int nr = gm->Nrows(); + MatrixRow mr1(gm1, LoadOnEntry); MatrixRow mr2(gm2, LoadOnEntry); + MatrixRow mr(gm, StoreOnExit+DirectPart); + while (nr--) { mr.Add(mr1,mr2); mr1.Next(); mr2.Next(); mr.Next(); } +} + +static void AddDS(GeneralMatrix* gm, GeneralMatrix* gm2) +// Add into first argument +{ + REPORT + int nr = gm->Nrows(); + MatrixRow mr(gm, StoreOnExit+LoadOnEntry+DirectPart); + MatrixRow mr2(gm2, LoadOnEntry); + while (nr--) { mr.Add(mr2); mr.Next(); mr2.Next(); } +} + +static void SubtractDS + (GeneralMatrix* gm, GeneralMatrix* gm1, GeneralMatrix* gm2) +{ + REPORT + int nr = gm->Nrows(); + MatrixRow mr1(gm1, LoadOnEntry); MatrixRow mr2(gm2, LoadOnEntry); + MatrixRow mr(gm, StoreOnExit+DirectPart); + while (nr--) { mr.Sub(mr1,mr2); mr1.Next(); mr2.Next(); mr.Next(); } +} + +static void SubtractDS(GeneralMatrix* gm, GeneralMatrix* gm2) +{ + REPORT + int nr = gm->Nrows(); + MatrixRow mr(gm, LoadOnEntry+StoreOnExit+DirectPart); + MatrixRow mr2(gm2, LoadOnEntry); + while (nr--) { mr.Sub(mr2); mr.Next(); mr2.Next(); } +} + +static void ReverseSubtractDS(GeneralMatrix* gm, GeneralMatrix* gm2) +{ + REPORT + int nr = gm->Nrows(); + MatrixRow mr(gm, LoadOnEntry+StoreOnExit+DirectPart); + MatrixRow mr2(gm2, LoadOnEntry); + while (nr--) { mr.RevSub(mr2); mr2.Next(); mr.Next(); } +} + +static void SPDS(GeneralMatrix* gm, GeneralMatrix* gm1, GeneralMatrix* gm2) +{ + REPORT + int nr = gm->Nrows(); + MatrixRow mr1(gm1, LoadOnEntry); MatrixRow mr2(gm2, LoadOnEntry); + MatrixRow mr(gm, StoreOnExit+DirectPart); + while (nr--) { mr.Multiply(mr1,mr2); mr1.Next(); mr2.Next(); mr.Next(); } +} + +static void SPDS(GeneralMatrix* gm, GeneralMatrix* gm2) +// SP into first argument +{ + REPORT + int nr = gm->Nrows(); + MatrixRow mr(gm, StoreOnExit+LoadOnEntry+DirectPart); + MatrixRow mr2(gm2, LoadOnEntry); + while (nr--) { mr.Multiply(mr2); mr.Next(); mr2.Next(); } +} + +static GeneralMatrix* GeneralMult1(GeneralMatrix* gm1, GeneralMatrix* gm2, + MultipliedMatrix* mm, MatrixType mtx) +{ + REPORT + Tracer tr("GeneralMult1"); + int nr=gm1->Nrows(); int nc=gm2->Ncols(); + if (gm1->Ncols() !=gm2->Nrows()) + Throw(IncompatibleDimensionsException(*gm1, *gm2)); + GeneralMatrix* gmx = mtx.New(nr,nc,mm); + + MatrixCol mcx(gmx, StoreOnExit+DirectPart); + MatrixCol mc2(gm2, LoadOnEntry); + while (nc--) + { + MatrixRow mr1(gm1, LoadOnEntry, mcx.Skip()); + Real* el = mcx.Data(); // pointer to an element + int n = mcx.Storage(); + while (n--) { *(el++) = DotProd(mr1,mc2); mr1.Next(); } + mc2.Next(); mcx.Next(); + } + gmx->ReleaseAndDelete(); gm1->tDelete(); gm2->tDelete(); return gmx; +} + +static GeneralMatrix* GeneralMult2(GeneralMatrix* gm1, GeneralMatrix* gm2, + MultipliedMatrix* mm, MatrixType mtx) +{ + // version that accesses by row only - not good for thin matrices + // or column vectors in right hand term. + REPORT + Tracer tr("GeneralMult2"); + int nr=gm1->Nrows(); int nc=gm2->Ncols(); + if (gm1->Ncols() !=gm2->Nrows()) + Throw(IncompatibleDimensionsException(*gm1, *gm2)); + GeneralMatrix* gmx = mtx.New(nr,nc,mm); + + MatrixRow mrx(gmx, LoadOnEntry+StoreOnExit+DirectPart); + MatrixRow mr1(gm1, LoadOnEntry); + while (nr--) + { + MatrixRow mr2(gm2, LoadOnEntry, mr1.Skip()); + Real* el = mr1.Data(); // pointer to an element + int n = mr1.Storage(); + mrx.Zero(); + while (n--) { mrx.AddScaled(mr2, *el++); mr2.Next(); } + mr1.Next(); mrx.Next(); + } + gmx->ReleaseAndDelete(); gm1->tDelete(); gm2->tDelete(); return gmx; +} + +static GeneralMatrix* mmMult(GeneralMatrix* gm1, GeneralMatrix* gm2) +{ + // matrix multiplication for type Matrix only + REPORT + Tracer tr("MatrixMult"); + + int nr=gm1->Nrows(); int ncr=gm1->Ncols(); int nc=gm2->Ncols(); + if (ncr != gm2->Nrows()) Throw(IncompatibleDimensionsException(*gm1,*gm2)); + + Matrix* gm = new Matrix(nr,nc); MatrixErrorNoSpace(gm); + + Real* s1=gm1->Store(); Real* s2=gm2->Store(); Real* s=gm->Store(); + + if (ncr) + { + while (nr--) + { + Real* s2x = s2; int j = ncr; + Real* sx = s; Real f = *s1++; int k = nc; + while (k--) *sx++ = f * *s2x++; + while (--j) + { sx = s; f = *s1++; k = nc; while (k--) *sx++ += f * *s2x++; } + s = sx; + } + } + else *gm = 0.0; + + gm->ReleaseAndDelete(); gm1->tDelete(); gm2->tDelete(); return gm; +} + +static GeneralMatrix* GeneralMult(GeneralMatrix* gm1, GeneralMatrix* gm2, + MultipliedMatrix* mm, MatrixType mtx) +{ + if ( Rectangular(gm1->type(), gm2->type(), mtx)) + { REPORT return mmMult(gm1, gm2); } + Compare(gm1->type() * gm2->type(),mtx); + int nr = gm2->Nrows(); int nc = gm2->Ncols(); + if (nc <= 5 && nr > nc) { REPORT return GeneralMult1(gm1, gm2, mm, mtx); } + REPORT return GeneralMult2(gm1, gm2, mm, mtx); +} + +static GeneralMatrix* GeneralKP(GeneralMatrix* gm1, GeneralMatrix* gm2, + KPMatrix* kp, MatrixType mtx) +{ + REPORT + Tracer tr("GeneralKP"); + int nr1 = gm1->Nrows(); int nc1 = gm1->Ncols(); + int nr2 = gm2->Nrows(); int nc2 = gm2->Ncols(); + Compare((gm1->type()).KP(gm2->type()),mtx); + GeneralMatrix* gmx = mtx.New(nr1*nr2, nc1*nc2, kp); + MatrixRow mrx(gmx, LoadOnEntry+StoreOnExit+DirectPart); + MatrixRow mr1(gm1, LoadOnEntry); + for (int i = 1; i <= nr1; ++i) + { + MatrixRow mr2(gm2, LoadOnEntry); + for (int j = 1; j <= nr2; ++j) + { mrx.KP(mr1,mr2); mr2.Next(); mrx.Next(); } + mr1.Next(); + } + gmx->ReleaseAndDelete(); gm1->tDelete(); gm2->tDelete(); return gmx; +} + +static GeneralMatrix* GeneralSolv(GeneralMatrix* gm1, GeneralMatrix* gm2, + BaseMatrix* sm, MatrixType mtx) +{ + REPORT + Tracer tr("GeneralSolv"); + Compare(gm1->type().i() * gm2->type(),mtx); + int nr = gm1->Nrows(); + if (nr != gm1->Ncols()) Throw(NotSquareException(*gm1)); + int nc = gm2->Ncols(); + if (gm1->Ncols() != gm2->Nrows()) + Throw(IncompatibleDimensionsException(*gm1, *gm2)); + GeneralMatrix* gmx = mtx.New(nr,nc,sm); MatrixErrorNoSpace(gmx); + Real* r = new Real [nr]; MatrixErrorNoSpace(r); + MONITOR_REAL_NEW("Make (GenSolv)",nr,r) + GeneralMatrix* gms = gm1->MakeSolver(); + Try + { + + MatrixColX mcx(gmx, r, StoreOnExit+DirectPart); // copy to and from r + // this must be inside Try so mcx is destroyed before gmx + MatrixColX mc2(gm2, r, LoadOnEntry); + while (nc--) { gms->Solver(mcx, mc2); mcx.Next(); mc2.Next(); } + } + CatchAll + { + if (gms) gms->tDelete(); + delete gmx; // <-------------------- + gm2->tDelete(); + MONITOR_REAL_DELETE("Delete (GenSolv)",nr,r) + // AT&T version 2.1 gives an internal error + delete [] r; + ReThrow; + } + gms->tDelete(); gmx->ReleaseAndDelete(); gm2->tDelete(); + MONITOR_REAL_DELETE("Delete (GenSolv)",nr,r) + // AT&T version 2.1 gives an internal error + delete [] r; + return gmx; +} + +// version for inverses - gm2 is identity +static GeneralMatrix* GeneralSolvI(GeneralMatrix* gm1, BaseMatrix* sm, + MatrixType mtx) +{ + REPORT + Tracer tr("GeneralSolvI"); + Compare(gm1->type().i(),mtx); + int nr = gm1->Nrows(); + if (nr != gm1->Ncols()) Throw(NotSquareException(*gm1)); + int nc = nr; + // DiagonalMatrix I(nr); I = 1; + IdentityMatrix I(nr); + GeneralMatrix* gmx = mtx.New(nr,nc,sm); MatrixErrorNoSpace(gmx); + Real* r = new Real [nr]; MatrixErrorNoSpace(r); + MONITOR_REAL_NEW("Make (GenSolvI)",nr,r) + GeneralMatrix* gms = gm1->MakeSolver(); + Try + { + + MatrixColX mcx(gmx, r, StoreOnExit+DirectPart); // copy to and from r + // this must be inside Try so mcx is destroyed before gmx + MatrixColX mc2(&I, r, LoadOnEntry); + while (nc--) { gms->Solver(mcx, mc2); mcx.Next(); mc2.Next(); } + } + CatchAll + { + if (gms) gms->tDelete(); + delete gmx; + MONITOR_REAL_DELETE("Delete (GenSolvI)",nr,r) + // AT&T version 2.1 gives an internal error + delete [] r; + ReThrow; + } + gms->tDelete(); gmx->ReleaseAndDelete(); + MONITOR_REAL_DELETE("Delete (GenSolvI)",nr,r) + // AT&T version 2.1 gives an internal error + delete [] r; + return gmx; +} + +GeneralMatrix* InvertedMatrix::Evaluate(MatrixType mtx) +{ + // Matrix Inversion - use solve routines + Tracer tr("InvertedMatrix::Evaluate"); + REPORT + gm=((BaseMatrix*&)bm)->Evaluate(); + return GeneralSolvI(gm,this,mtx); +} + +//*************************** New versions ************************ + +GeneralMatrix* AddedMatrix::Evaluate(MatrixType mtd) +{ + REPORT + Tracer tr("AddedMatrix::Evaluate"); + gm1=((BaseMatrix*&)bm1)->Evaluate(); gm2=((BaseMatrix*&)bm2)->Evaluate(); + int nr=gm1->Nrows(); int nc=gm1->Ncols(); + if (nr!=gm2->Nrows() || nc!=gm2->Ncols()) + { + Try { Throw(IncompatibleDimensionsException(*gm1, *gm2)); } + CatchAll + { + gm1->tDelete(); gm2->tDelete(); + ReThrow; + } + } + MatrixType mt1 = gm1->type(), mt2 = gm2->type(); MatrixType mts = mt1 + mt2; + if (!mtd) { REPORT mtd = mts; } + else if (!(mtd.DataLossOK || mtd >= mts)) + { + REPORT + gm1->tDelete(); gm2->tDelete(); + Throw(ProgramException("Illegal Conversion", mts, mtd)); + } + GeneralMatrix* gmx; + bool c1 = (mtd == mt1), c2 = (mtd == mt2); + if ( c1 && c2 && (gm1->SimpleAddOK(gm2) == 0) ) + { + if (gm1->reuse()) { REPORT AddTo(gm1,gm2); gm2->tDelete(); gmx = gm1; } + else if (gm2->reuse()) { REPORT AddTo(gm2,gm1); gmx = gm2; } + else + { + REPORT + // what if new throws an exception + Try { gmx = mt1.New(nr,nc,this); } + CatchAll + { + ReThrow; + } + gmx->ReleaseAndDelete(); Add(gmx,gm1,gm2); + } + } + else + { + if (c1 && c2) + { + short SAO = gm1->SimpleAddOK(gm2); + if (SAO & 1) { REPORT c1 = false; } + if (SAO & 2) { REPORT c2 = false; } + } + if (c1 && gm1->reuse() ) // must have type test first + { REPORT AddDS(gm1,gm2); gm2->tDelete(); gmx = gm1; } + else if (c2 && gm2->reuse() ) + { REPORT AddDS(gm2,gm1); if (!c1) gm1->tDelete(); gmx = gm2; } + else + { + REPORT + Try { gmx = mtd.New(nr,nc,this); } + CatchAll + { + if (!c1) gm1->tDelete(); + if (!c2) gm2->tDelete(); + ReThrow; + } + AddDS(gmx,gm1,gm2); + if (!c1) gm1->tDelete(); + if (!c2) gm2->tDelete(); + gmx->ReleaseAndDelete(); + } + } + return gmx; +} + +GeneralMatrix* SubtractedMatrix::Evaluate(MatrixType mtd) +{ + REPORT + Tracer tr("SubtractedMatrix::Evaluate"); + gm1=((BaseMatrix*&)bm1)->Evaluate(); gm2=((BaseMatrix*&)bm2)->Evaluate(); + int nr=gm1->Nrows(); int nc=gm1->Ncols(); + if (nr!=gm2->Nrows() || nc!=gm2->Ncols()) + { + Try { Throw(IncompatibleDimensionsException(*gm1, *gm2)); } + CatchAll + { + gm1->tDelete(); gm2->tDelete(); + ReThrow; + } + } + MatrixType mt1 = gm1->type(), mt2 = gm2->type(); MatrixType mts = mt1 + mt2; + if (!mtd) { REPORT mtd = mts; } + else if (!(mtd.DataLossOK || mtd >= mts)) + { + gm1->tDelete(); gm2->tDelete(); + Throw(ProgramException("Illegal Conversion", mts, mtd)); + } + GeneralMatrix* gmx; + bool c1 = (mtd == mt1), c2 = (mtd == mt2); + if ( c1 && c2 && (gm1->SimpleAddOK(gm2) == 0) ) + { + if (gm1->reuse()) + { REPORT SubtractFrom(gm1,gm2); gm2->tDelete(); gmx = gm1; } + else if (gm2->reuse()) { REPORT ReverseSubtract(gm2,gm1); gmx = gm2; } + else + { + REPORT + Try { gmx = mt1.New(nr,nc,this); } + CatchAll + { + ReThrow; + } + gmx->ReleaseAndDelete(); Subtract(gmx,gm1,gm2); + } + } + else + { + if (c1 && c2) + { + short SAO = gm1->SimpleAddOK(gm2); + if (SAO & 1) { REPORT c1 = false; } + if (SAO & 2) { REPORT c2 = false; } + } + if (c1 && gm1->reuse() ) // must have type test first + { REPORT SubtractDS(gm1,gm2); gm2->tDelete(); gmx = gm1; } + else if (c2 && gm2->reuse() ) + { + REPORT ReverseSubtractDS(gm2,gm1); + if (!c1) gm1->tDelete(); + gmx = gm2; + } + else + { + REPORT + // what if New throws and exception + Try { gmx = mtd.New(nr,nc,this); } + CatchAll + { + if (!c1) gm1->tDelete(); + if (!c2) gm2->tDelete(); + ReThrow; + } + SubtractDS(gmx,gm1,gm2); + if (!c1) gm1->tDelete(); + if (!c2) gm2->tDelete(); + gmx->ReleaseAndDelete(); + } + } + return gmx; +} + +GeneralMatrix* SPMatrix::Evaluate(MatrixType mtd) +{ + REPORT + Tracer tr("SPMatrix::Evaluate"); + gm1=((BaseMatrix*&)bm1)->Evaluate(); gm2=((BaseMatrix*&)bm2)->Evaluate(); + int nr=gm1->Nrows(); int nc=gm1->Ncols(); + if (nr!=gm2->Nrows() || nc!=gm2->Ncols()) + { + Try { Throw(IncompatibleDimensionsException(*gm1, *gm2)); } + CatchAll + { + gm1->tDelete(); gm2->tDelete(); + ReThrow; + } + } + MatrixType mt1 = gm1->type(), mt2 = gm2->type(); + MatrixType mts = mt1.SP(mt2); + if (!mtd) { REPORT mtd = mts; } + else if (!(mtd.DataLossOK || mtd >= mts)) + { + gm1->tDelete(); gm2->tDelete(); + Throw(ProgramException("Illegal Conversion", mts, mtd)); + } + GeneralMatrix* gmx; + bool c1 = (mtd == mt1), c2 = (mtd == mt2); + if ( c1 && c2 && (gm1->SimpleAddOK(gm2) == 0) ) + { + if (gm1->reuse()) { REPORT SP(gm1,gm2); gm2->tDelete(); gmx = gm1; } + else if (gm2->reuse()) { REPORT SP(gm2,gm1); gmx = gm2; } + else + { + REPORT + Try { gmx = mt1.New(nr,nc,this); } + CatchAll + { + ReThrow; + } + gmx->ReleaseAndDelete(); SP(gmx,gm1,gm2); + } + } + else + { + if (c1 && c2) + { + short SAO = gm1->SimpleAddOK(gm2); + if (SAO & 1) { REPORT c2 = false; } // c1 and c2 swapped + if (SAO & 2) { REPORT c1 = false; } + } + if (c1 && gm1->reuse() ) // must have type test first + { REPORT SPDS(gm1,gm2); gm2->tDelete(); gmx = gm1; } + else if (c2 && gm2->reuse() ) + { REPORT SPDS(gm2,gm1); if (!c1) gm1->tDelete(); gmx = gm2; } + else + { + REPORT + // what if New throws and exception + Try { gmx = mtd.New(nr,nc,this); } + CatchAll + { + if (!c1) gm1->tDelete(); + if (!c2) gm2->tDelete(); + ReThrow; + } + SPDS(gmx,gm1,gm2); + if (!c1) gm1->tDelete(); + if (!c2) gm2->tDelete(); + gmx->ReleaseAndDelete(); + } + } + return gmx; +} + + + +//*************************** norm functions ****************************/ + +Real BaseMatrix::norm1() const +{ + // maximum of sum of absolute values of a column + REPORT + GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate(); + int nc = gm->Ncols(); Real value = 0.0; + MatrixCol mc(gm, LoadOnEntry); + while (nc--) + { Real v = mc.SumAbsoluteValue(); if (value < v) value = v; mc.Next(); } + gm->tDelete(); return value; +} + +Real BaseMatrix::norm_infinity() const +{ + // maximum of sum of absolute values of a row + REPORT + GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate(); + int nr = gm->Nrows(); Real value = 0.0; + MatrixRow mr(gm, LoadOnEntry); + while (nr--) + { Real v = mr.SumAbsoluteValue(); if (value < v) value = v; mr.Next(); } + gm->tDelete(); return value; +} + +//********************** Concatenation and stacking *************************/ + +GeneralMatrix* ConcatenatedMatrix::Evaluate(MatrixType mtx) +{ + REPORT + Tracer tr("Concatenate"); + gm2 = ((BaseMatrix*&)bm2)->Evaluate(); + gm1 = ((BaseMatrix*&)bm1)->Evaluate(); + Compare(gm1->type() | gm2->type(),mtx); + int nr=gm1->Nrows(); int nc = gm1->Ncols() + gm2->Ncols(); + if (nr != gm2->Nrows()) + Throw(IncompatibleDimensionsException(*gm1, *gm2)); + GeneralMatrix* gmx = mtx.New(nr,nc,this); + MatrixRow mr1(gm1, LoadOnEntry); MatrixRow mr2(gm2, LoadOnEntry); + MatrixRow mr(gmx, StoreOnExit+DirectPart); + while (nr--) { mr.ConCat(mr1,mr2); mr1.Next(); mr2.Next(); mr.Next(); } + gmx->ReleaseAndDelete(); gm1->tDelete(); gm2->tDelete(); return gmx; +} + +GeneralMatrix* StackedMatrix::Evaluate(MatrixType mtx) +{ + REPORT + Tracer tr("Stack"); + gm2 = ((BaseMatrix*&)bm2)->Evaluate(); + gm1 = ((BaseMatrix*&)bm1)->Evaluate(); + Compare(gm1->type() & gm2->type(),mtx); + int nc=gm1->Ncols(); + int nr1 = gm1->Nrows(); int nr2 = gm2->Nrows(); + if (nc != gm2->Ncols()) + Throw(IncompatibleDimensionsException(*gm1, *gm2)); + GeneralMatrix* gmx = mtx.New(nr1+nr2,nc,this); + MatrixRow mr1(gm1, LoadOnEntry); MatrixRow mr2(gm2, LoadOnEntry); + MatrixRow mr(gmx, StoreOnExit+DirectPart); + while (nr1--) { mr.Copy(mr1); mr1.Next(); mr.Next(); } + while (nr2--) { mr.Copy(mr2); mr2.Next(); mr.Next(); } + gmx->ReleaseAndDelete(); gm1->tDelete(); gm2->tDelete(); return gmx; +} + +// ************************* equality of matrices ******************** // + +static bool RealEqual(Real* s1, Real* s2, int n) +{ + int i = n >> 2; + while (i--) + { + if (*s1++ != *s2++) return false; + if (*s1++ != *s2++) return false; + if (*s1++ != *s2++) return false; + if (*s1++ != *s2++) return false; + } + i = n & 3; while (i--) if (*s1++ != *s2++) return false; + return true; +} + +static bool intEqual(int* s1, int* s2, int n) +{ + int i = n >> 2; + while (i--) + { + if (*s1++ != *s2++) return false; + if (*s1++ != *s2++) return false; + if (*s1++ != *s2++) return false; + if (*s1++ != *s2++) return false; + } + i = n & 3; while (i--) if (*s1++ != *s2++) return false; + return true; +} + + +bool operator==(const BaseMatrix& A, const BaseMatrix& B) +{ + Tracer tr("BaseMatrix =="); + REPORT + GeneralMatrix* gmA = ((BaseMatrix&)A).Evaluate(); + GeneralMatrix* gmB = ((BaseMatrix&)B).Evaluate(); + + if (gmA == gmB) // same matrix + { REPORT gmA->tDelete(); return true; } + + if ( gmA->Nrows() != gmB->Nrows() || gmA->Ncols() != gmB->Ncols() ) + // different dimensions + { REPORT gmA->tDelete(); gmB->tDelete(); return false; } + + // check for CroutMatrix or BandLUMatrix + MatrixType AType = gmA->type(); MatrixType BType = gmB->type(); + if (AType.CannotConvert() || BType.CannotConvert() ) + { + REPORT + bool bx = gmA->IsEqual(*gmB); + gmA->tDelete(); gmB->tDelete(); + return bx; + } + + // is matrix storage the same + // will need to modify if further matrix structures are introduced + if (AType == BType && gmA->bandwidth() == gmB->bandwidth()) + { // compare store + REPORT + bool bx = RealEqual(gmA->Store(),gmB->Store(),gmA->Storage()); + gmA->tDelete(); gmB->tDelete(); + return bx; + } + + // matrix storage different - just subtract + REPORT return is_zero(*gmA-*gmB); +} + +bool operator==(const GeneralMatrix& A, const GeneralMatrix& B) +{ + Tracer tr("GeneralMatrix =="); + // May or may not call tDeletes + REPORT + + if (&A == &B) // same matrix + { REPORT return true; } + + if ( A.Nrows() != B.Nrows() || A.Ncols() != B.Ncols() ) + { REPORT return false; } // different dimensions + + // check for CroutMatrix or BandLUMatrix + MatrixType AType = A.Type(); MatrixType BType = B.Type(); + if (AType.CannotConvert() || BType.CannotConvert() ) + { REPORT return A.IsEqual(B); } + + // is matrix storage the same + // will need to modify if further matrix structures are introduced + if (AType == BType && A.bandwidth() == B.bandwidth()) + { REPORT return RealEqual(A.Store(),B.Store(),A.Storage()); } + + // matrix storage different - just subtract + REPORT return is_zero(A-B); +} + +bool GeneralMatrix::is_zero() const +{ + REPORT + Real* s=store; int i = storage >> 2; + while (i--) + { + if (*s++) return false; + if (*s++) return false; + if (*s++) return false; + if (*s++) return false; + } + i = storage & 3; while (i--) if (*s++) return false; + return true; +} + +bool is_zero(const BaseMatrix& A) +{ + Tracer tr("BaseMatrix::is_zero"); + REPORT + GeneralMatrix* gm1 = 0; bool bx; + Try { gm1=((BaseMatrix&)A).Evaluate(); bx = gm1->is_zero(); } + CatchAll { if (gm1) gm1->tDelete(); ReThrow; } + gm1->tDelete(); + return bx; +} + +// IsEqual functions - insist matrices are of same type +// as well as equal values to be equal + +bool GeneralMatrix::IsEqual(const GeneralMatrix& A) const +{ + Tracer tr("GeneralMatrix IsEqual"); + if (A.type() != type()) // not same types + { REPORT return false; } + if (&A == this) // same matrix + { REPORT return true; } + if (A.nrows_val != nrows_val || A.ncols_val != ncols_val) + // different dimensions + { REPORT return false; } + // is matrix storage the same - compare store + REPORT + return RealEqual(A.store,store,storage); +} + +bool CroutMatrix::IsEqual(const GeneralMatrix& A) const +{ + Tracer tr("CroutMatrix IsEqual"); + if (A.type() != type()) // not same types + { REPORT return false; } + if (&A == this) // same matrix + { REPORT return true; } + if (A.nrows_val != nrows_val || A.ncols_val != ncols_val) + // different dimensions + { REPORT return false; } + // is matrix storage the same - compare store + REPORT + return RealEqual(A.store,store,storage) + && intEqual(((CroutMatrix&)A).indx, indx, nrows_val); +} + + +bool BandLUMatrix::IsEqual(const GeneralMatrix& A) const +{ + Tracer tr("BandLUMatrix IsEqual"); + if (A.type() != type()) // not same types + { REPORT return false; } + if (&A == this) // same matrix + { REPORT return true; } + if ( A.Nrows() != nrows_val || A.Ncols() != ncols_val + || ((BandLUMatrix&)A).m1 != m1 || ((BandLUMatrix&)A).m2 != m2 ) + // different dimensions + { REPORT return false; } + + // matrix storage the same - compare store + REPORT + return RealEqual(A.Store(),store,storage) + && RealEqual(((BandLUMatrix&)A).store2,store2,storage2) + && intEqual(((BandLUMatrix&)A).indx, indx, nrows_val); +} + + +// ************************* cross products ******************** // + +inline void crossproduct_body(Real* a, Real* b, Real* c) +{ + c[0] = a[1] * b[2] - a[2] * b[1]; + c[1] = a[2] * b[0] - a[0] * b[2]; + c[2] = a[0] * b[1] - a[1] * b[0]; +} + +Matrix crossproduct(const Matrix& A, const Matrix& B) +{ + REPORT + int ac = A.Ncols(); int ar = A.Nrows(); + int bc = B.Ncols(); int br = B.Nrows(); + Real* a = A.Store(); Real* b = B.Store(); + if (ac == 3) + { + if (bc != 3 || ar != 1 || br != 1) + { Tracer et("crossproduct"); IncompatibleDimensionsException(A, B); } + REPORT + RowVector C(3); Real* c = C.Store(); crossproduct_body(a, b, c); + return (Matrix&)C; + } + else + { + if (ac != 1 || bc != 1 || ar != 3 || br != 3) + { Tracer et("crossproduct"); IncompatibleDimensionsException(A, B); } + REPORT + ColumnVector C(3); Real* c = C.Store(); crossproduct_body(a, b, c); + return (Matrix&)C; + } +} + +ReturnMatrix crossproduct_rows(const Matrix& A, const Matrix& B) +{ + REPORT + int n = A.Nrows(); + if (A.Ncols() != 3 || B.Ncols() != 3 || n != B.Nrows()) + { + Tracer et("crossproduct_rows"); IncompatibleDimensionsException(A, B); + } + Matrix C(n, 3); + Real* a = A.Store(); Real* b = B.Store(); Real* c = C.Store(); + if (n--) + { + for (;;) + { + crossproduct_body(a, b, c); + if (!(n--)) break; + a += 3; b += 3; c += 3; + } + } + + return C.ForReturn(); +} + +ReturnMatrix crossproduct_columns(const Matrix& A, const Matrix& B) +{ + REPORT + int n = A.Ncols(); + if (A.Nrows() != 3 || B.Nrows() != 3 || n != B.Ncols()) + { + Tracer et("crossproduct_columns"); + IncompatibleDimensionsException(A, B); + } + Matrix C(3, n); + Real* a = A.Store(); Real* b = B.Store(); Real* c = C.Store(); + Real* an = a+n; Real* an2 = an+n; + Real* bn = b+n; Real* bn2 = bn+n; + Real* cn = c+n; Real* cn2 = cn+n; + + int i = n; + while (i--) + { + *c++ = *an * *bn2 - *an2 * *bn; + *cn++ = *an2++ * *b - *a * *bn2++; + *cn2++ = *a++ * *bn++ - *an++ * *b++; + } + + return C.ForReturn(); +} + + +#ifdef use_namespace +} +#endif + +///@} + diff --git a/extern/newmat/newmat8.cpp b/extern/newmat/newmat8.cpp new file mode 100644 index 00000000..f48edc6b --- /dev/null +++ b/extern/newmat/newmat8.cpp @@ -0,0 +1,833 @@ +/// \ingroup newmat +///@{ + +/// \file newmat8.cpp +/// LU transform, scalar functions of matrices. + +// Copyright (C) 1991,2,3,4,8: R B Davies + +#define WANT_MATH + +#include "include.h" + +#include "newmat.h" +#include "newmatrc.h" +#include "precisio.h" + +#ifdef use_namespace +namespace NEWMAT { +#endif + + +#ifdef DO_REPORT +#define REPORT { static ExeCounter ExeCount(__LINE__,8); ++ExeCount; } +#else +#define REPORT {} +#endif + + +/************************** LU transformation ****************************/ + +void CroutMatrix::ludcmp() +// LU decomposition from Golub & Van Loan, algorithm 3.4.1, (the "outer +// product" version). +// This replaces the code derived from Numerical Recipes in C in previous +// versions of newmat and being row oriented runs much faster with large +// matrices. +{ + REPORT + Tracer tr( "Crout(ludcmp)" ); sing = false; + Real* akk = store; // runs down diagonal + + Real big = fabs(*akk); int mu = 0; Real* ai = akk; int k; + + for (k = 1; k < nrows_val; k++) + { + ai += nrows_val; const Real trybig = fabs(*ai); + if (big < trybig) { big = trybig; mu = k; } + } + + + if (nrows_val) for (k = 0;;) + { + /* + int mu1; + { + Real big = fabs(*akk); mu1 = k; Real* ai = akk; int i; + + for (i = k+1; i < nrows_val; i++) + { + ai += nrows_val; const Real trybig = fabs(*ai); + if (big < trybig) { big = trybig; mu1 = i; } + } + } + if (mu1 != mu) cout << k << " " << mu << " " << mu1 << endl; + */ + + indx[k] = mu; + + if (mu != k) //row swap + { + Real* a1 = store + nrows_val * k; + Real* a2 = store + nrows_val * mu; d = !d; + int j = nrows_val; + while (j--) { const Real temp = *a1; *a1++ = *a2; *a2++ = temp; } + } + + Real diag = *akk; big = 0; mu = k + 1; + if (diag != 0) + { + ai = akk; int i = nrows_val - k - 1; + while (i--) + { + ai += nrows_val; Real* al = ai; + Real mult = *al / diag; *al = mult; + int l = nrows_val - k - 1; Real* aj = akk; + // work out the next pivot as part of this loop + // this saves a column operation + if (l-- != 0) + { + *(++al) -= (mult * *(++aj)); + const Real trybig = fabs(*al); + if (big < trybig) { big = trybig; mu = nrows_val - i - 1; } + while (l--) *(++al) -= (mult * *(++aj)); + } + } + } + else sing = true; + if (++k == nrows_val) break; // so next line won't overflow + akk += nrows_val + 1; + } +} + +void CroutMatrix::lubksb(Real* B, int mini) +{ + REPORT + // this has been adapted from Numerical Recipes in C. The code has been + // substantially streamlined, so I do not think much of the original + // copyright remains. However there is not much opportunity for + // variation in the code, so it is still similar to the NR code. + // I follow the NR code in skipping over initial zeros in the B vector. + + Tracer tr("Crout(lubksb)"); + if (sing) Throw(SingularException(*this)); + int i, j, ii = nrows_val; // ii initialised : B might be all zeros + + + // scan for first non-zero in B + for (i = 0; i < nrows_val; i++) + { + int ip = indx[i]; Real temp = B[ip]; B[ip] = B[i]; B[i] = temp; + if (temp != 0.0) { ii = i; break; } + } + + Real* bi; Real* ai; + i = ii + 1; + + if (i < nrows_val) + { + bi = B + ii; ai = store + ii + i * nrows_val; + for (;;) + { + int ip = indx[i]; Real sum = B[ip]; B[ip] = B[i]; + Real* aij = ai; Real* bj = bi; j = i - ii; + while (j--) sum -= *aij++ * *bj++; + B[i] = sum; + if (++i == nrows_val) break; + ai += nrows_val; + } + } + + ai = store + nrows_val * nrows_val; + + for (i = nrows_val - 1; i >= mini; i--) + { + Real* bj = B+i; ai -= nrows_val; Real* ajx = ai+i; + Real sum = *bj; Real diag = *ajx; + j = nrows_val - i; while(--j) sum -= *(++ajx) * *(++bj); + B[i] = sum / diag; + } +} + +/****************************** scalar functions ****************************/ + +inline Real square(Real x) { return x*x; } + +Real GeneralMatrix::sum_square() const +{ + REPORT + Real sum = 0.0; int i = storage; Real* s = store; + while (i--) sum += square(*s++); + ((GeneralMatrix&)*this).tDelete(); return sum; +} + +Real GeneralMatrix::sum_absolute_value() const +{ + REPORT + Real sum = 0.0; int i = storage; Real* s = store; + while (i--) sum += fabs(*s++); + ((GeneralMatrix&)*this).tDelete(); return sum; +} + +Real GeneralMatrix::sum() const +{ + REPORT + Real sm = 0.0; int i = storage; Real* s = store; + while (i--) sm += *s++; + ((GeneralMatrix&)*this).tDelete(); return sm; +} + +// maxima and minima + +// There are three sets of routines +// maximum_absolute_value, minimum_absolute_value, maximum, minimum +// ... these find just the maxima and minima +// maximum_absolute_value1, minimum_absolute_value1, maximum1, minimum1 +// ... these find the maxima and minima and their locations in a +// one dimensional object +// maximum_absolute_value2, minimum_absolute_value2, maximum2, minimum2 +// ... these find the maxima and minima and their locations in a +// two dimensional object + +// If the matrix has no values throw an exception + +// If we do not want the location find the maximum or minimum on the +// array stored by GeneralMatrix +// This won't work for BandMatrices. We call ClearCorner for +// maximum_absolute_value but for the others use the absolute_minimum_value2 +// version and discard the location. + +// For one dimensional objects, when we want the location of the +// maximum or minimum, work with the array stored by GeneralMatrix + +// For two dimensional objects where we want the location of the maximum or +// minimum proceed as follows: + +// For rectangular matrices use the array stored by GeneralMatrix and +// deduce the location from the location in the GeneralMatrix + +// For other two dimensional matrices use the Matrix Row routine to find the +// maximum or minimum for each row. + +static void NullMatrixError(const GeneralMatrix* gm) +{ + ((GeneralMatrix&)*gm).tDelete(); + Throw(ProgramException("Maximum or minimum of null matrix")); +} + +Real GeneralMatrix::maximum_absolute_value() const +{ + REPORT + if (storage == 0) NullMatrixError(this); + Real maxval = 0.0; int l = storage; Real* s = store; + while (l--) { Real a = fabs(*s++); if (maxval < a) maxval = a; } + ((GeneralMatrix&)*this).tDelete(); return maxval; +} + +Real GeneralMatrix::maximum_absolute_value1(int& i) const +{ + REPORT + if (storage == 0) NullMatrixError(this); + Real maxval = 0.0; int l = storage; Real* s = store; int li = storage; + while (l--) + { Real a = fabs(*s++); if (maxval <= a) { maxval = a; li = l; } } + i = storage - li; + ((GeneralMatrix&)*this).tDelete(); return maxval; +} + +Real GeneralMatrix::minimum_absolute_value() const +{ + REPORT + if (storage == 0) NullMatrixError(this); + int l = storage - 1; Real* s = store; Real minval = fabs(*s++); + while (l--) { Real a = fabs(*s++); if (minval > a) minval = a; } + ((GeneralMatrix&)*this).tDelete(); return minval; +} + +Real GeneralMatrix::minimum_absolute_value1(int& i) const +{ + REPORT + if (storage == 0) NullMatrixError(this); + int l = storage - 1; Real* s = store; Real minval = fabs(*s++); int li = l; + while (l--) + { Real a = fabs(*s++); if (minval >= a) { minval = a; li = l; } } + i = storage - li; + ((GeneralMatrix&)*this).tDelete(); return minval; +} + +Real GeneralMatrix::maximum() const +{ + REPORT + if (storage == 0) NullMatrixError(this); + int l = storage - 1; Real* s = store; Real maxval = *s++; + while (l--) { Real a = *s++; if (maxval < a) maxval = a; } + ((GeneralMatrix&)*this).tDelete(); return maxval; +} + +Real GeneralMatrix::maximum1(int& i) const +{ + REPORT + if (storage == 0) NullMatrixError(this); + int l = storage - 1; Real* s = store; Real maxval = *s++; int li = l; + while (l--) { Real a = *s++; if (maxval <= a) { maxval = a; li = l; } } + i = storage - li; + ((GeneralMatrix&)*this).tDelete(); return maxval; +} + +Real GeneralMatrix::minimum() const +{ + REPORT + if (storage == 0) NullMatrixError(this); + int l = storage - 1; Real* s = store; Real minval = *s++; + while (l--) { Real a = *s++; if (minval > a) minval = a; } + ((GeneralMatrix&)*this).tDelete(); return minval; +} + +Real GeneralMatrix::minimum1(int& i) const +{ + REPORT + if (storage == 0) NullMatrixError(this); + int l = storage - 1; Real* s = store; Real minval = *s++; int li = l; + while (l--) { Real a = *s++; if (minval >= a) { minval = a; li = l; } } + i = storage - li; + ((GeneralMatrix&)*this).tDelete(); return minval; +} + +Real GeneralMatrix::maximum_absolute_value2(int& i, int& j) const +{ + REPORT + if (storage == 0) NullMatrixError(this); + Real maxval = 0.0; int nr = Nrows(); + MatrixRow mr((GeneralMatrix*)this, LoadOnEntry+DirectPart); + for (int r = 1; r <= nr; r++) + { + int c; maxval = mr.MaximumAbsoluteValue1(maxval, c); + if (c > 0) { i = r; j = c; } + mr.Next(); + } + ((GeneralMatrix&)*this).tDelete(); return maxval; +} + +Real GeneralMatrix::minimum_absolute_value2(int& i, int& j) const +{ + REPORT + if (storage == 0) NullMatrixError(this); + Real minval = FloatingPointPrecision::Maximum(); int nr = Nrows(); + MatrixRow mr((GeneralMatrix*)this, LoadOnEntry+DirectPart); + for (int r = 1; r <= nr; r++) + { + int c; minval = mr.MinimumAbsoluteValue1(minval, c); + if (c > 0) { i = r; j = c; } + mr.Next(); + } + ((GeneralMatrix&)*this).tDelete(); return minval; +} + +Real GeneralMatrix::maximum2(int& i, int& j) const +{ + REPORT + if (storage == 0) NullMatrixError(this); + Real maxval = -FloatingPointPrecision::Maximum(); int nr = Nrows(); + MatrixRow mr((GeneralMatrix*)this, LoadOnEntry+DirectPart); + for (int r = 1; r <= nr; r++) + { + int c; maxval = mr.Maximum1(maxval, c); + if (c > 0) { i = r; j = c; } + mr.Next(); + } + ((GeneralMatrix&)*this).tDelete(); return maxval; +} + +Real GeneralMatrix::minimum2(int& i, int& j) const +{ + REPORT + if (storage == 0) NullMatrixError(this); + Real minval = FloatingPointPrecision::Maximum(); int nr = Nrows(); + MatrixRow mr((GeneralMatrix*)this, LoadOnEntry+DirectPart); + for (int r = 1; r <= nr; r++) + { + int c; minval = mr.Minimum1(minval, c); + if (c > 0) { i = r; j = c; } + mr.Next(); + } + ((GeneralMatrix&)*this).tDelete(); return minval; +} + +Real Matrix::maximum_absolute_value2(int& i, int& j) const +{ + REPORT + int k; Real m = GeneralMatrix::maximum_absolute_value1(k); k--; + i = k / Ncols(); j = k - i * Ncols(); i++; j++; + return m; +} + +Real Matrix::minimum_absolute_value2(int& i, int& j) const +{ + REPORT + int k; Real m = GeneralMatrix::minimum_absolute_value1(k); k--; + i = k / Ncols(); j = k - i * Ncols(); i++; j++; + return m; +} + +Real Matrix::maximum2(int& i, int& j) const +{ + REPORT + int k; Real m = GeneralMatrix::maximum1(k); k--; + i = k / Ncols(); j = k - i * Ncols(); i++; j++; + return m; +} + +Real Matrix::minimum2(int& i, int& j) const +{ + REPORT + int k; Real m = GeneralMatrix::minimum1(k); k--; + i = k / Ncols(); j = k - i * Ncols(); i++; j++; + return m; +} + +Real SymmetricMatrix::sum_square() const +{ + REPORT + Real sum1 = 0.0; Real sum2 = 0.0; Real* s = store; int nr = nrows_val; + for (int i = 0; isum_square(); return s; +} + +Real BaseMatrix::norm_Frobenius() const + { REPORT return sqrt(sum_square()); } + +Real BaseMatrix::sum_absolute_value() const +{ + REPORT GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate(); + Real s = gm->sum_absolute_value(); return s; +} + +Real BaseMatrix::sum() const +{ + REPORT GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate(); + Real s = gm->sum(); return s; +} + +Real BaseMatrix::maximum_absolute_value() const +{ + REPORT GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate(); + Real s = gm->maximum_absolute_value(); return s; +} + +Real BaseMatrix::maximum_absolute_value1(int& i) const +{ + REPORT GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate(); + Real s = gm->maximum_absolute_value1(i); return s; +} + +Real BaseMatrix::maximum_absolute_value2(int& i, int& j) const +{ + REPORT GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate(); + Real s = gm->maximum_absolute_value2(i, j); return s; +} + +Real BaseMatrix::minimum_absolute_value() const +{ + REPORT GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate(); + Real s = gm->minimum_absolute_value(); return s; +} + +Real BaseMatrix::minimum_absolute_value1(int& i) const +{ + REPORT GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate(); + Real s = gm->minimum_absolute_value1(i); return s; +} + +Real BaseMatrix::minimum_absolute_value2(int& i, int& j) const +{ + REPORT GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate(); + Real s = gm->minimum_absolute_value2(i, j); return s; +} + +Real BaseMatrix::maximum() const +{ + REPORT GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate(); + Real s = gm->maximum(); return s; +} + +Real BaseMatrix::maximum1(int& i) const +{ + REPORT GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate(); + Real s = gm->maximum1(i); return s; +} + +Real BaseMatrix::maximum2(int& i, int& j) const +{ + REPORT GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate(); + Real s = gm->maximum2(i, j); return s; +} + +Real BaseMatrix::minimum() const +{ + REPORT GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate(); + Real s = gm->minimum(); return s; +} + +Real BaseMatrix::minimum1(int& i) const +{ + REPORT GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate(); + Real s = gm->minimum1(i); return s; +} + +Real BaseMatrix::minimum2(int& i, int& j) const +{ + REPORT GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate(); + Real s = gm->minimum2(i, j); return s; +} + +Real dotproduct(const Matrix& A, const Matrix& B) +{ + REPORT + int n = A.storage; + if (n != B.storage) + { + Tracer tr("dotproduct"); + Throw(IncompatibleDimensionsException(A,B)); + } + Real sum = 0.0; Real* a = A.store; Real* b = B.store; + while (n--) sum += *a++ * *b++; + return sum; +} + +Real Matrix::trace() const +{ + REPORT + Tracer tr("trace"); + int i = nrows_val; int d = i+1; + if (i != ncols_val) Throw(NotSquareException(*this)); + Real sum = 0.0; Real* s = store; +// while (i--) { sum += *s; s += d; } + if (i) for (;;) { sum += *s; if (!(--i)) break; s += d; } + ((GeneralMatrix&)*this).tDelete(); return sum; +} + +Real DiagonalMatrix::trace() const +{ + REPORT + int i = nrows_val; Real sum = 0.0; Real* s = store; + while (i--) sum += *s++; + ((GeneralMatrix&)*this).tDelete(); return sum; +} + +Real SymmetricMatrix::trace() const +{ + REPORT + int i = nrows_val; Real sum = 0.0; Real* s = store; int j = 2; + // while (i--) { sum += *s; s += j++; } + if (i) for (;;) { sum += *s; if (!(--i)) break; s += j++; } + ((GeneralMatrix&)*this).tDelete(); return sum; +} + +Real LowerTriangularMatrix::trace() const +{ + REPORT + int i = nrows_val; Real sum = 0.0; Real* s = store; int j = 2; + // while (i--) { sum += *s; s += j++; } + if (i) for (;;) { sum += *s; if (!(--i)) break; s += j++; } + ((GeneralMatrix&)*this).tDelete(); return sum; +} + +Real UpperTriangularMatrix::trace() const +{ + REPORT + int i = nrows_val; Real sum = 0.0; Real* s = store; + while (i) { sum += *s; s += i--; } // won t cause a problem + ((GeneralMatrix&)*this).tDelete(); return sum; +} + +Real BandMatrix::trace() const +{ + REPORT + int i = nrows_val; int w = lower_val+upper_val+1; + Real sum = 0.0; Real* s = store+lower_val; + // while (i--) { sum += *s; s += w; } + if (i) for (;;) { sum += *s; if (!(--i)) break; s += w; } + ((GeneralMatrix&)*this).tDelete(); return sum; +} + +Real SymmetricBandMatrix::trace() const +{ + REPORT + int i = nrows_val; int w = lower_val+1; + Real sum = 0.0; Real* s = store+lower_val; + // while (i--) { sum += *s; s += w; } + if (i) for (;;) { sum += *s; if (!(--i)) break; s += w; } + ((GeneralMatrix&)*this).tDelete(); return sum; +} + +Real IdentityMatrix::trace() const +{ + Real sum = *store * nrows_val; + ((GeneralMatrix&)*this).tDelete(); return sum; +} + + +Real BaseMatrix::trace() const +{ + REPORT + MatrixType Diag = MatrixType::Dg; Diag.SetDataLossOK(); + GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate(Diag); + Real sum = gm->trace(); return sum; +} + +void LogAndSign::operator*=(Real x) +{ + if (x > 0.0) { log_val += log(x); } + else if (x < 0.0) { log_val += log(-x); sign_val = -sign_val; } + else sign_val = 0; +} + +void LogAndSign::pow_eq(int k) +{ + if (sign_val) + { + log_val *= k; + if ( (k & 1) == 0 ) sign_val = 1; + } +} + +Real LogAndSign::value() const +{ + Tracer et("LogAndSign::value"); + if (log_val >= FloatingPointPrecision::LnMaximum()) + Throw(OverflowException("Overflow in exponential")); + return sign_val * exp(log_val); +} + +LogAndSign::LogAndSign(Real f) +{ + if (f == 0.0) { log_val = 0.0; sign_val = 0; return; } + else if (f < 0.0) { sign_val = -1; f = -f; } + else sign_val = 1; + log_val = log(f); +} + +LogAndSign DiagonalMatrix::log_determinant() const +{ + REPORT + int i = nrows_val; LogAndSign sum; Real* s = store; + while (i--) sum *= *s++; + ((GeneralMatrix&)*this).tDelete(); return sum; +} + +LogAndSign LowerTriangularMatrix::log_determinant() const +{ + REPORT + int i = nrows_val; LogAndSign sum; Real* s = store; int j = 2; + // while (i--) { sum *= *s; s += j++; } + if (i) for(;;) { sum *= *s; if (!(--i)) break; s += j++; } + ((GeneralMatrix&)*this).tDelete(); return sum; +} + +LogAndSign UpperTriangularMatrix::log_determinant() const +{ + REPORT + int i = nrows_val; LogAndSign sum; Real* s = store; + while (i) { sum *= *s; s += i--; } + ((GeneralMatrix&)*this).tDelete(); return sum; +} + +LogAndSign IdentityMatrix::log_determinant() const +{ + REPORT + int i = nrows_val; LogAndSign sum; + if (i > 0) { sum = *store; sum.PowEq(i); } + ((GeneralMatrix&)*this).tDelete(); return sum; +} + +LogAndSign BaseMatrix::log_determinant() const +{ + REPORT GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate(); + LogAndSign sum = gm->log_determinant(); return sum; +} + +LogAndSign GeneralMatrix::log_determinant() const +{ + REPORT + Tracer tr("log_determinant"); + if (nrows_val != ncols_val) Throw(NotSquareException(*this)); + CroutMatrix C(*this); return C.log_determinant(); +} + +LogAndSign CroutMatrix::log_determinant() const +{ + REPORT + if (sing) return 0.0; + int i = nrows_val; int dd = i+1; LogAndSign sum; Real* s = store; + if (i) for(;;) + { + sum *= *s; + if (!(--i)) break; + s += dd; + } + if (!d) sum.ChangeSign(); + return sum; + +} + +Real BaseMatrix::determinant() const +{ + REPORT + Tracer tr("determinant"); + REPORT GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate(); + LogAndSign ld = gm->log_determinant(); + return ld.Value(); +} + +LinearEquationSolver::LinearEquationSolver(const BaseMatrix& bm) +{ + gm = ( ((BaseMatrix&)bm).Evaluate() )->MakeSolver(); + if (gm==&bm) { REPORT gm = gm->Image(); } + // want a copy if *gm is actually bm + else { REPORT gm->Protect(); } +} + +ReturnMatrix BaseMatrix::sum_square_rows() const +{ + REPORT + GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate(); + int nr = gm->nrows(); + ColumnVector ssq(nr); + if (gm->size() == 0) { REPORT ssq = 0.0; } + else + { + MatrixRow mr(gm, LoadOnEntry); + for (int i = 1; i <= nr; ++i) + { + Real sum = 0.0; + int s = mr.Storage(); + Real* in = mr.Data(); + while (s--) sum += square(*in++); + ssq(i) = sum; + mr.Next(); + } + } + gm->tDelete(); + ssq.release(); return ssq.for_return(); +} + +ReturnMatrix BaseMatrix::sum_square_columns() const +{ + REPORT + GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate(); + int nr = gm->nrows(); int nc = gm->ncols(); + RowVector ssq(nc); ssq = 0.0; + if (gm->size() != 0) + { + MatrixRow mr(gm, LoadOnEntry); + for (int i = 1; i <= nr; ++i) + { + int s = mr.Storage(); + Real* in = mr.Data(); Real* out = ssq.data() + mr.Skip(); + while (s--) *out++ += square(*in++); + mr.Next(); + } + } + gm->tDelete(); + ssq.release(); return ssq.for_return(); +} + +ReturnMatrix BaseMatrix::sum_rows() const +{ + REPORT + GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate(); + int nr = gm->nrows(); + ColumnVector sum_vec(nr); + if (gm->size() == 0) { REPORT sum_vec = 0.0; } + else + { + MatrixRow mr(gm, LoadOnEntry); + for (int i = 1; i <= nr; ++i) + { + Real sum = 0.0; + int s = mr.Storage(); + Real* in = mr.Data(); + while (s--) sum += *in++; + sum_vec(i) = sum; + mr.Next(); + } + } + gm->tDelete(); + sum_vec.release(); return sum_vec.for_return(); +} + +ReturnMatrix BaseMatrix::sum_columns() const +{ + REPORT + GeneralMatrix* gm = ((BaseMatrix&)*this).Evaluate(); + int nr = gm->nrows(); int nc = gm->ncols(); + RowVector sum_vec(nc); sum_vec = 0.0; + if (gm->size() != 0) + { + MatrixRow mr(gm, LoadOnEntry); + for (int i = 1; i <= nr; ++i) + { + int s = mr.Storage(); + Real* in = mr.Data(); Real* out = sum_vec.data() + mr.Skip(); + while (s--) *out++ += *in++; + mr.Next(); + } + } + gm->tDelete(); + sum_vec.release(); return sum_vec.for_return(); +} + + +#ifdef use_namespace +} +#endif + + +///} diff --git a/extern/newmat/newmat9.cpp b/extern/newmat/newmat9.cpp new file mode 100644 index 00000000..dfece384 --- /dev/null +++ b/extern/newmat/newmat9.cpp @@ -0,0 +1,82 @@ +/// \ingroup newmat +///@{ + +/// \file newmat9.cpp +/// Output. + +// Copyright (C) 1991,2,3,4: R B Davies + + +#define WANT_FSTREAM + +#include "include.h" + +#include "newmat.h" +#include "newmatio.h" +#include "newmatrc.h" + +#ifdef use_namespace +namespace NEWMAT { +#endif + + + +#ifdef DO_REPORT +#define REPORT { static ExeCounter ExeCount(__LINE__,9); ++ExeCount; } +#else +#define REPORT {} +#endif + +// for G++ 3.01 +#ifndef ios_format_flags +#define ios_format_flags long +#endif + +ostream& operator<<(ostream& s, const BaseMatrix& X) +{ + GeneralMatrix* gm = ((BaseMatrix&)X).Evaluate(); operator<<(s, *gm); + gm->tDelete(); return s; +} + + +ostream& operator<<(ostream& s, const GeneralMatrix& X) +{ + MatrixRow mr((GeneralMatrix*)&X, LoadOnEntry); + int w = s.width(); int nr = X.Nrows(); ios_format_flags f = s.flags(); + if (f & ios::scientific) s.setf(ios::scientific, ios::floatfield); + else s.setf(ios::fixed, ios::floatfield); + for (int i=1; i<=nr; i++) + { + int skip = mr.skip; int storage = mr.storage; + Real* store = mr.data; skip *= w+1; + while (skip--) s << " "; + while (storage--) { s.width(w); s << *store++ << " "; } +// while (storage--) s << setw(w) << *store++ << " "; + mr.Next(); s << "\n"; + } + s << flush; s.flags(f); return s; +} + +// include this stuff if you are using an old version of G++ +// with an incomplete io library + +/* + +ostream& operator<<(ostream& os, Omanip_precision i) + { os.precision(i.x); return os; } + +Omanip_precision setprecision(int i) { return Omanip_precision(i); } + +ostream& operator<<(ostream& os, Omanip_width i) + { os.width(i.x); return os; } + +Omanip_width setw(int i) { return Omanip_width(i); } + +*/ + +#ifdef use_namespace +} +#endif + + +///@} diff --git a/extern/newmat/newmatap.h b/extern/newmat/newmatap.h new file mode 100644 index 00000000..dc88ac14 --- /dev/null +++ b/extern/newmat/newmatap.h @@ -0,0 +1,272 @@ +/// \ingroup newmat +///@{ + +/// \file newmatap.h +/// Definition file for advanced matrix functions. + +// Copyright (C) 1991,2,3,4,8: R B Davies + +#ifndef NEWMATAP_LIB +#define NEWMATAP_LIB 0 + +#include "newmat.h" + +#ifdef use_namespace +namespace NEWMAT { +#endif + + +// ************************** applications *****************************/ + + +void QRZT(Matrix&, LowerTriangularMatrix&); + +void QRZT(const Matrix&, Matrix&, Matrix&); + +void QRZ(Matrix&, UpperTriangularMatrix&); + +void QRZ(const Matrix&, Matrix&, Matrix&); + +inline void QRZT(Matrix& X, Matrix& Y, LowerTriangularMatrix& L, Matrix& M) + { QRZT(X, L); QRZT(X, Y, M); } + +inline void QRZ(Matrix& X, Matrix& Y, UpperTriangularMatrix& U, Matrix& M) + { QRZ(X, U); QRZ(X, Y, M); } + +inline void HHDecompose(Matrix& X, LowerTriangularMatrix& L) +{ QRZT(X,L); } + +inline void HHDecompose(const Matrix& X, Matrix& Y, Matrix& M) +{ QRZT(X, Y, M); } + +void updateQRZT(Matrix& X, LowerTriangularMatrix& L); + +void updateQRZ(Matrix& X, UpperTriangularMatrix& U); + +void updateQRZ(const Matrix& X, Matrix& MX, Matrix& MU); + +void updateQRZ(UpperTriangularMatrix& X, UpperTriangularMatrix& U); + +void updateQRZ(const UpperTriangularMatrix& X, Matrix& MX, Matrix& MU); + +inline void UpdateQRZT(Matrix& X, LowerTriangularMatrix& L) + { updateQRZT(X, L); } + +inline void UpdateQRZ(Matrix& X, UpperTriangularMatrix& U) + { updateQRZ(X, U); } + +inline void UpdateQRZ(UpperTriangularMatrix& X, UpperTriangularMatrix& U) + { updateQRZ(X, U); } + +inline void UpdateQRZ(const UpperTriangularMatrix& X, Matrix& MX, Matrix& MU) + { updateQRZ(X, MX, MU); } + +inline void UpdateQRZ(const Matrix& X, Matrix& MX, Matrix& MU) + { updateQRZ(X, MX, MU); } + + +// Matrix A's first n columns are orthonormal +// so A.Columns(1,n).t() * A.Columns(1,n) is the identity matrix. +// Fill out the remaining columns of A to make them orthonormal +// so A.t() * A is the identity matrix +void extend_orthonormal(Matrix& A, int n); + + +ReturnMatrix Cholesky(const SymmetricMatrix&); + +ReturnMatrix Cholesky(const SymmetricBandMatrix&); + + +// produces the Cholesky decomposition of A + x.t() * x +// where A = chol.t() * chol and x is a RowVector +void update_Cholesky(UpperTriangularMatrix& chol, RowVector x); +inline void UpdateCholesky(UpperTriangularMatrix& chol, const RowVector& x) + { update_Cholesky(chol, x); } + +// produces the Cholesky decomposition of A - x.t() * x +// where A = chol.t() * chol and x is a RowVector +void downdate_Cholesky(UpperTriangularMatrix &chol, RowVector x); +inline void DowndateCholesky(UpperTriangularMatrix &chol, const RowVector& x) + { downdate_Cholesky(chol, x); } + +// a RIGHT circular shift of the rows and columns from +// 1,...,k-1,k,k+1,...l,l+1,...,p to +// 1,...,k-1,l,k,k+1,...l-1,l+1,...p +void right_circular_update_Cholesky(UpperTriangularMatrix &chol, int k, int l); +inline void RightCircularUpdateCholesky(UpperTriangularMatrix &chol, + int k, int l) { right_circular_update_Cholesky(chol, k, l); } + +// a LEFT circular shift of the rows and columns from +// 1,...,k-1,k,k+1,...l,l+1,...,p to +// 1,...,k-1,k+1,...l,k,l+1,...,p to +void left_circular_update_Cholesky(UpperTriangularMatrix &chol, int k, int l); +inline void LeftCircularUpdateCholesky(UpperTriangularMatrix &chol, + int k, int l) { left_circular_update_Cholesky(chol, k, l); } + + +void SVD(const Matrix&, DiagonalMatrix&, Matrix&, Matrix&, + bool=true, bool=true); + +void SVD(const Matrix&, DiagonalMatrix&); + +inline void SVD(const Matrix& A, DiagonalMatrix& D, Matrix& U, + bool withU = true) { SVD(A, D, U, U, withU, false); } + +void SortSV(DiagonalMatrix& D, Matrix& U, bool ascending = false); + +void SortSV(DiagonalMatrix& D, Matrix& U, Matrix& V, bool ascending = false); + +void Jacobi(const SymmetricMatrix&, DiagonalMatrix&); + +void Jacobi(const SymmetricMatrix&, DiagonalMatrix&, SymmetricMatrix&); + +void Jacobi(const SymmetricMatrix&, DiagonalMatrix&, Matrix&); + +void Jacobi(const SymmetricMatrix&, DiagonalMatrix&, SymmetricMatrix&, + Matrix&, bool=true); + +void eigenvalues(const SymmetricMatrix&, DiagonalMatrix&); + +void eigenvalues(const SymmetricMatrix&, DiagonalMatrix&, SymmetricMatrix&); + +void eigenvalues(const SymmetricMatrix&, DiagonalMatrix&, Matrix&); + +inline void EigenValues(const SymmetricMatrix& A, DiagonalMatrix& D) + { eigenvalues(A, D); } + +inline void EigenValues(const SymmetricMatrix& A, DiagonalMatrix& D, + SymmetricMatrix& S) { eigenvalues(A, D, S); } + +inline void EigenValues(const SymmetricMatrix& A, DiagonalMatrix& D, Matrix& V) + { eigenvalues(A, D, V); } + +class SymmetricEigenAnalysis +// not implemented yet +{ +public: + SymmetricEigenAnalysis(const SymmetricMatrix&); +private: + DiagonalMatrix diag; + DiagonalMatrix offdiag; + SymmetricMatrix backtransform; + FREE_CHECK(SymmetricEigenAnalysis) +}; + +void sort_ascending(GeneralMatrix&); + +void sort_descending(GeneralMatrix&); + +inline void SortAscending(GeneralMatrix& gm) { sort_ascending(gm); } + +inline void SortDescending(GeneralMatrix& gm) { sort_descending(gm); } + +/// Decide which fft method to use and carry out new fft function +class FFT_Controller +{ +public: + static bool OnlyOldFFT; + static bool ar_1d_ft (int PTS, Real* X, Real *Y); + static bool CanFactor(int PTS); +}; + +void FFT(const ColumnVector&, const ColumnVector&, + ColumnVector&, ColumnVector&); + +void FFTI(const ColumnVector&, const ColumnVector&, + ColumnVector&, ColumnVector&); + +void RealFFT(const ColumnVector&, ColumnVector&, ColumnVector&); + +void RealFFTI(const ColumnVector&, const ColumnVector&, ColumnVector&); + +void DCT_II(const ColumnVector&, ColumnVector&); + +void DCT_II_inverse(const ColumnVector&, ColumnVector&); + +void DST_II(const ColumnVector&, ColumnVector&); + +void DST_II_inverse(const ColumnVector&, ColumnVector&); + +void DCT(const ColumnVector&, ColumnVector&); + +void DCT_inverse(const ColumnVector&, ColumnVector&); + +void DST(const ColumnVector&, ColumnVector&); + +void DST_inverse(const ColumnVector&, ColumnVector&); + +void FFT2(const Matrix& U, const Matrix& V, Matrix& X, Matrix& Y); + +void FFT2I(const Matrix& U, const Matrix& V, Matrix& X, Matrix& Y); + + +// This class is used by the new FFT program + +// Suppose an integer is expressed as a sequence of digits with each +// digit having a different radix. +// This class supposes we are counting with this multi-radix number +// but also keeps track of the number with the digits (and radices) +// reversed. +// The integer starts at zero +// operator++() increases it by 1 +// Counter gives the number of increments +// Reverse() gives the value with the digits in reverse order +// Swap is true if reverse is less than counter +// Finish is true when we have done a complete cycle and are back at zero + +class MultiRadixCounter +{ + const SimpleIntArray& Radix; + // radix of each digit + // n-1 highest order, 0 lowest order + SimpleIntArray& Value; // value of each digit + const int n; // number of digits + int reverse; // value when order of digits is reversed + int product; // product of radices + int counter; // counter + bool finish; // true when we have gone over whole range +public: + MultiRadixCounter(int nx, const SimpleIntArray& rx, + SimpleIntArray& vx); + void operator++(); // increment the multi-radix counter + bool Swap() const { return reverse < counter; } + bool Finish() const { return finish; } + int Reverse() const { return reverse; } + int Counter() const { return counter; } +}; + +// multiplication by Helmert matrix +ReturnMatrix Helmert(int n, bool full=false); +ReturnMatrix Helmert(const ColumnVector& X, bool full=false); +ReturnMatrix Helmert(int n, int j, bool full=false); +ReturnMatrix Helmert_transpose(const ColumnVector& Y, bool full=false); +Real Helmert_transpose(const ColumnVector& Y, int j, bool full=false); +ReturnMatrix Helmert(const Matrix& X, bool full=false); +ReturnMatrix Helmert_transpose(const Matrix& Y, bool full=false); + + + + +#ifdef use_namespace +} +#endif + + + +#endif + +// body file: cholesky.cpp +// body file: evalue.cpp +// body file: fft.cpp +// body file: hholder.cpp +// body file: jacobi.cpp +// body file: newfft.cpp +// body file: sort.cpp +// body file: svd.cpp +// body file: nm_misc.cpp + + + +///@} + + diff --git a/extern/newmat/newmatex.cpp b/extern/newmat/newmatex.cpp new file mode 100644 index 00000000..d00496ec --- /dev/null +++ b/extern/newmat/newmatex.cpp @@ -0,0 +1,325 @@ +/// \file newmatex.cpp +/// \brief Exceptions thrown by matrix library. + +// Copyright (C) 1992,3,4,7: R B Davies + +#define WANT_STREAM // include.h will get stream fns + +#include "include.h" // include standard files +#include "newmat.h" + +#ifdef use_namespace +namespace NEWMAT { +#endif + +unsigned long OverflowException::Select; +unsigned long SingularException::Select; +unsigned long NPDException::Select; +unsigned long ConvergenceException::Select; +unsigned long ProgramException::Select; +unsigned long IndexException::Select; +unsigned long VectorException::Select; +unsigned long NotSquareException::Select; +unsigned long SubMatrixDimensionException::Select; +unsigned long IncompatibleDimensionsException::Select; +unsigned long NotDefinedException::Select; +unsigned long CannotBuildException::Select; +unsigned long InternalException::Select; + + + +static void MatrixDetails(const GeneralMatrix& A) +// write matrix details to Exception buffer +{ + MatrixBandWidth bw = A.bandwidth(); + int ubw = bw.upper_val; int lbw = bw.lower_val; + BaseException::AddMessage("MatrixType = "); + BaseException::AddMessage(A.Type().Value()); + BaseException::AddMessage(" # Rows = "); BaseException::AddInt(A.Nrows()); + BaseException::AddMessage("; # Cols = "); BaseException::AddInt(A.Ncols()); + if (lbw >=0) + { + BaseException::AddMessage("; lower BW = "); + BaseException::AddInt(lbw); + } + if (ubw >=0) + { + BaseException::AddMessage("; upper BW = "); + BaseException::AddInt(ubw); + } + BaseException::AddMessage("\n"); +} + +NPDException::NPDException(const GeneralMatrix& A) + : Runtime_error() +{ + Select = BaseException::Select; + AddMessage("detected by Newmat: matrix not positive definite\n\n"); + MatrixDetails(A); + Tracer::AddTrace(); +} + +SingularException::SingularException(const GeneralMatrix& A) + : Runtime_error() +{ + Select = BaseException::Select; + AddMessage("detected by Newmat: matrix is singular\n\n"); + MatrixDetails(A); + Tracer::AddTrace(); +} + +ConvergenceException::ConvergenceException(const GeneralMatrix& A) + : Runtime_error() +{ + Select = BaseException::Select; + AddMessage("detected by Newmat: process fails to converge\n\n"); + MatrixDetails(A); + Tracer::AddTrace(); +} + +ConvergenceException::ConvergenceException(const char* c) : Runtime_error() +{ + Select = BaseException::Select; + AddMessage("detected by Newmat: "); + AddMessage(c); AddMessage("\n\n"); + if (c) Tracer::AddTrace(); +} + +OverflowException::OverflowException(const char* c) : Runtime_error() +{ + Select = BaseException::Select; + AddMessage("detected by Newmat: "); + AddMessage(c); AddMessage("\n\n"); + if (c) Tracer::AddTrace(); +} + +ProgramException::ProgramException(const char* c) : Logic_error() +{ + Select = BaseException::Select; + AddMessage("detected by Newmat: "); + AddMessage(c); AddMessage("\n\n"); + if (c) Tracer::AddTrace(); +} + +ProgramException::ProgramException(const char* c, const GeneralMatrix& A) + : Logic_error() +{ + Select = BaseException::Select; + AddMessage("detected by Newmat: "); + AddMessage(c); AddMessage("\n\n"); + MatrixDetails(A); + if (c) Tracer::AddTrace(); +} + +ProgramException::ProgramException(const char* c, const GeneralMatrix& A, + const GeneralMatrix& B) : Logic_error() +{ + Select = BaseException::Select; + AddMessage("detected by Newmat: "); + AddMessage(c); AddMessage("\n\n"); + MatrixDetails(A); MatrixDetails(B); + if (c) Tracer::AddTrace(); +} + +ProgramException::ProgramException(const char* c, MatrixType a, MatrixType b) + : Logic_error() +{ + Select = BaseException::Select; + AddMessage("detected by Newmat: "); + AddMessage(c); AddMessage("\nMatrixTypes = "); + AddMessage(a.Value()); AddMessage("; "); + AddMessage(b.Value()); AddMessage("\n\n"); + if (c) Tracer::AddTrace(); +} + +VectorException::VectorException() : Logic_error() +{ + Select = BaseException::Select; + AddMessage("detected by Newmat: cannot convert matrix to vector\n\n"); + Tracer::AddTrace(); +} + +VectorException::VectorException(const GeneralMatrix& A) + : Logic_error() +{ + Select = BaseException::Select; + AddMessage("detected by Newmat: cannot convert matrix to vector\n\n"); + MatrixDetails(A); + Tracer::AddTrace(); +} + +NotSquareException::NotSquareException(const GeneralMatrix& A) + : Logic_error() +{ + Select = BaseException::Select; + AddMessage("detected by Newmat: matrix is not square\n\n"); + MatrixDetails(A); + Tracer::AddTrace(); +} + +NotSquareException::NotSquareException() + : Logic_error() +{ + Select = BaseException::Select; + AddMessage("detected by Newmat: matrix is not square\n\n"); + Tracer::AddTrace(); +} + +SubMatrixDimensionException::SubMatrixDimensionException() + : Logic_error() +{ + Select = BaseException::Select; + AddMessage("detected by Newmat: incompatible submatrix dimension\n\n"); + Tracer::AddTrace(); +} + +IncompatibleDimensionsException::IncompatibleDimensionsException() + : Logic_error() +{ + Select = BaseException::Select; + AddMessage("detected by Newmat: incompatible dimensions\n\n"); + Tracer::AddTrace(); +} + +IncompatibleDimensionsException::IncompatibleDimensionsException + (const GeneralMatrix& A, const GeneralMatrix& B) + : Logic_error() +{ + Select = BaseException::Select; + AddMessage("detected by Newmat: incompatible dimensions\n\n"); + MatrixDetails(A); MatrixDetails(B); + Tracer::AddTrace(); +} + +IncompatibleDimensionsException::IncompatibleDimensionsException + (const GeneralMatrix& A) + : Logic_error() +{ + Select = BaseException::Select; + AddMessage("detected by Newmat: incompatible dimensions\n\n"); + MatrixDetails(A); + Tracer::AddTrace(); +} + +NotDefinedException::NotDefinedException(const char* op, const char* matrix) + : Logic_error() +{ + Select = BaseException::Select; + AddMessage("detected by Newmat: "); + AddMessage(op); + AddMessage(" not defined for "); + AddMessage(matrix); + AddMessage("\n\n"); + Tracer::AddTrace(); +} + +CannotBuildException::CannotBuildException(const char* matrix) + : Logic_error() +{ + Select = BaseException::Select; + AddMessage("detected by Newmat: cannot build matrix type "); + AddMessage(matrix); AddMessage("\n\n"); + Tracer::AddTrace(); +} + +IndexException::IndexException(int i, const GeneralMatrix& A) + : Logic_error() +{ + Select = BaseException::Select; + AddMessage("detected by Newmat: index error: requested index = "); + AddInt(i); AddMessage("\n\n"); + MatrixDetails(A); + Tracer::AddTrace(); +} + +IndexException::IndexException(int i, int j, const GeneralMatrix& A) + : Logic_error() +{ + Select = BaseException::Select; + AddMessage("detected by Newmat: index error: requested indices = "); + AddInt(i); AddMessage(", "); AddInt(j); + AddMessage("\n\n"); + MatrixDetails(A); + Tracer::AddTrace(); +} + + +IndexException::IndexException(int i, const GeneralMatrix& A, bool) + : Logic_error() +{ + Select = BaseException::Select; + AddMessage("detected by Newmat: element error: requested index (wrt 0) = "); + AddInt(i); + AddMessage("\n\n"); + MatrixDetails(A); + Tracer::AddTrace(); +} + +IndexException::IndexException(int i, int j, const GeneralMatrix& A, bool) + : Logic_error() +{ + Select = BaseException::Select; + AddMessage( + "detected by Newmat: element error: requested indices (wrt 0) = "); + AddInt(i); AddMessage(", "); AddInt(j); + AddMessage("\n\n"); + MatrixDetails(A); + Tracer::AddTrace(); +} + +InternalException::InternalException(const char* c) : Logic_error() +{ + Select = BaseException::Select; + AddMessage("internal error detected by Newmat: please inform author\n"); + AddMessage(c); AddMessage("\n\n"); + Tracer::AddTrace(); +} + + + + +/************************* ExeCounter functions *****************************/ + +#ifdef DO_REPORT + +int ExeCounter::nreports; // will be set to zero + +ExeCounter::ExeCounter(int xl, int xf) : line(xl), fileid(xf), nexe(0) {} + +ExeCounter::~ExeCounter() +{ + nreports++; + cout << "REPORT " << setw(6) << nreports << " " + << setw(6) << fileid << " " << setw(6) << line + << " " << setw(6) << nexe << "\n"; +} + +#endif + +/**************************** error handler *******************************/ + +void MatrixErrorNoSpace(const void* v) { if (!v) Throw(Bad_alloc()); } +// throw exception if v is null + + + + +/************************* miscellanous errors ***************************/ + + +void CroutMatrix::GetRow(MatrixRowCol&) + { Throw(NotDefinedException("GetRow","Crout")); } +void CroutMatrix::GetCol(MatrixRowCol&) + { Throw(NotDefinedException("GetCol","Crout")); } +void BandLUMatrix::GetRow(MatrixRowCol&) + { Throw(NotDefinedException("GetRow","BandLUMatrix")); } +void BandLUMatrix::GetCol(MatrixRowCol&) + { Throw(NotDefinedException("GetCol","BandLUMatrix")); } +void BaseMatrix::IEQND() const + { Throw(NotDefinedException("inequalities", "matrices")); } + + +#ifdef use_namespace +} +#endif + diff --git a/extern/newmat/newmatio.h b/extern/newmat/newmatio.h new file mode 100644 index 00000000..0f1aa974 --- /dev/null +++ b/extern/newmat/newmatio.h @@ -0,0 +1,67 @@ +/// \ingroup newmat +///@{ + +/// \file newmatio.h +/// Definition file for matrix package output. + +// Copyright (C) 1991,2,3,4: R B Davies + +#ifndef NEWMATIO_LIB +#define NEWMATIO_LIB 0 + +#ifndef WANT_STREAM +#define WANT_STREAM +#endif + +#include "newmat.h" + +#ifdef use_namespace +namespace NEWMAT { +#endif + + + +// **************************** input/output *****************************/ + +ostream& operator<<(ostream&, const BaseMatrix&); + +ostream& operator<<(ostream&, const GeneralMatrix&); + + +/* Use in some old versions of G++ without complete iomanipulators + +class Omanip_precision +{ + int x; +public: + Omanip_precision(int i) : x(i) {} + friend ostream& operator<<(ostream& os, Omanip_precision i); +}; + + +Omanip_precision setprecision(int i); + +class Omanip_width +{ + int x; +public: + Omanip_width(int i) : x(i) {} + friend ostream& operator<<(ostream& os, Omanip_width i); +}; + +Omanip_width setw(int i); + +*/ + +#ifdef use_namespace +} +#endif + + + +#endif + +// body file: newmat9.cpp + + +///@} diff --git a/extern/newmat/newmatnl.cpp b/extern/newmat/newmatnl.cpp new file mode 100644 index 00000000..56c52ea2 --- /dev/null +++ b/extern/newmat/newmatnl.cpp @@ -0,0 +1,266 @@ +/// \ingroup newmat +///@{ + +/// \file newmatnl.cpp +/// Non-linear optimisation. + +// Copyright (C) 1993,4,5,6: R B Davies + + +#define WANT_MATH +#define WANT_STREAM + +#include "newmatap.h" +#include "newmatnl.h" + +#ifdef use_namespace +namespace NEWMAT { +#endif + + + +void FindMaximum2::Fit(ColumnVector& Theta, int n_it) +{ + Tracer tr("FindMaximum2::Fit"); + enum State {Start, Restart, Continue, Interpolate, Extrapolate, + Fail, Convergence}; + State TheState = Start; + Real z,w,x,x2,g,l1,l2,l3,d1,d2=0,d3; + ColumnVector Theta1, Theta2, Theta3; + int np = Theta.Nrows(); + ColumnVector H1(np), H3, HP(np), K, K1(np); + bool oorg, conv; + int counter = 0; + Theta1 = Theta; HP = 0.0; g = 0.0; + + // This is really a set of gotos and labels, but they do not work + // correctly in AT&T C++ and Sun 4.01 C++. + + for(;;) + { + switch (TheState) + { + case Start: + tr.ReName("FindMaximum2::Fit/Start"); + Value(Theta1, true, l1, oorg); + if (oorg) Throw(ProgramException("invalid starting value\n")); + + case Restart: + tr.ReName("FindMaximum2::Fit/ReStart"); + conv = NextPoint(H1, d1); + if (conv) { TheState = Convergence; break; } + if (counter++ > n_it) { TheState = Fail; break; } + + z = 1.0 / sqrt(d1); + H3 = H1 * z; K = (H3 - HP) * g; HP = H3; + g = 0.0; // de-activate to use curved projection + if ( g == 0.0 ) K1 = 0.0; else K1 = K * 0.2 + K1 * 0.6; + // (K - K1) * alpha + K1 * (1 - alpha) + // = K * alpha + K1 * (1 - 2 * alpha) + K = K1 * d1; g = z; + + case Continue: + tr.ReName("FindMaximum2::Fit/Continue"); + Theta2 = Theta1 + H1 + K; + Value(Theta2, false, l2, oorg); + if (counter++ > n_it) { TheState = Fail; break; } + if (oorg) + { + H1 *= 0.5; K *= 0.25; d1 *= 0.5; g *= 2.0; + TheState = Continue; break; + } + d2 = LastDerivative(H1 + K * 2.0); + + case Interpolate: + tr.ReName("FindMaximum2::Fit/Interpolate"); + z = d1 + d2 - 3.0 * (l2 - l1); + w = z * z - d1 * d2; + if (w < 0.0) { TheState = Extrapolate; break; } + w = z + sqrt(w); + if (1.5 * w + d1 < 0.0) + { TheState = Extrapolate; break; } + if (d2 > 0.0 && l2 > l1 && w > 0.0) + { TheState = Extrapolate; break; } + x = d1 / (w + d1); x2 = x * x; g /= x; + Theta3 = Theta1 + H1 * x + K * x2; + Value(Theta3, true, l3, oorg); + if (counter++ > n_it) { TheState = Fail; break; } + if (oorg) + { + if (x <= 1.0) + { x *= 0.5; x2 = x*x; g *= 2.0; d1 *= x; H1 *= x; K *= x2; } + else + { + x = 0.5 * (x-1.0); x2 = x*x; Theta1 = Theta2; + H1 = (H1 + K * 2.0) * x; + K *= x2; g = 0.0; d1 = x * d2; l1 = l2; + } + TheState = Continue; break; + } + + if (l3 >= l1 && l3 >= l2) + { Theta1 = Theta3; l1 = l3; TheState = Restart; break; } + + d3 = LastDerivative(H1 + K * 2.0); + if (l1 > l2) + { H1 *= x; K *= x2; Theta2 = Theta3; d1 *= x; d2 = d3*x; } + else + { + Theta1 = Theta2; Theta2 = Theta3; + x -= 1.0; x2 = x*x; g = 0.0; H1 = (H1 + K * 2.0) * x; + K *= x2; l1 = l2; l2 = l3; d1 = x*d2; d2 = x*d3; + if (d1 <= 0.0) { TheState = Start; break; } + } + TheState = Interpolate; break; + + case Extrapolate: + tr.ReName("FindMaximum2::Fit/Extrapolate"); + Theta1 = Theta2; g = 0.0; K *= 4.0; H1 = (H1 * 2.0 + K); + d1 = 2.0 * d2; l1 = l2; + TheState = Continue; break; + + case Fail: + Throw(ConvergenceException(Theta)); + + case Convergence: + Theta = Theta1; return; + } + } +} + + + +void NonLinearLeastSquares::Value + (const ColumnVector& Parameters, bool, Real& v, bool& oorg) +{ + Tracer tr("NonLinearLeastSquares::Value"); + Y.resize(n_obs); X.resize(n_obs,n_param); + // put the fitted values in Y, the derivatives in X. + Pred.Set(Parameters); + if (!Pred.IsValid()) { oorg=true; return; } + for (int i=1; i<=n_obs; i++) + { + Y(i) = Pred(i); + X.Row(i) = Pred.Derivatives(); + } + if (!Pred.IsValid()) { oorg=true; return; } // check afterwards as well + Y = *DataPointer - Y; Real ssq = Y.SumSquare(); + errorvar = ssq / (n_obs - n_param); + cout << endl; + cout << setw(15) << setprecision(10) << " " << errorvar; + Derivs = Y.t() * X; // get the derivative and stash it + oorg = false; v = -0.5 * ssq; +} + +bool NonLinearLeastSquares::NextPoint(ColumnVector& Adj, Real& test) +{ + Tracer tr("NonLinearLeastSquares::NextPoint"); + QRZ(X, U); QRZ(X, Y, M); // do the QR decomposition + test = M.SumSquare(); + cout << " " << setw(15) << setprecision(10) + << test << " " << Y.SumSquare() / (n_obs - n_param); + Adj = U.i() * M; + if (test < errorvar * criterion) return true; + else return false; +} + +Real NonLinearLeastSquares::LastDerivative(const ColumnVector& H) +{ return (Derivs * H).AsScalar(); } + +void NonLinearLeastSquares::Fit(const ColumnVector& Data, + ColumnVector& Parameters) +{ + Tracer tr("NonLinearLeastSquares::Fit"); + n_param = Parameters.Nrows(); n_obs = Data.Nrows(); + DataPointer = &Data; + FindMaximum2::Fit(Parameters, Lim); + cout << "\nConverged" << endl; +} + +void NonLinearLeastSquares::MakeCovariance() +{ + if (Covariance.Nrows()==0) + { + UpperTriangularMatrix UI = U.i(); + Covariance << UI * UI.t() * errorvar; + SE << Covariance; // get diagonals + for (int i = 1; i<=n_param; i++) SE(i) = sqrt(SE(i)); + } +} + +void NonLinearLeastSquares::GetStandardErrors(ColumnVector& SEX) + { MakeCovariance(); SEX = SE.AsColumn(); } + +void NonLinearLeastSquares::GetCorrelations(SymmetricMatrix& Corr) + { MakeCovariance(); Corr << SE.i() * Covariance * SE.i(); } + +void NonLinearLeastSquares::GetHatDiagonal(DiagonalMatrix& Hat) const +{ + Hat.resize(n_obs); + for (int i = 1; i<=n_obs; i++) Hat(i) = X.Row(i).SumSquare(); +} + + +// the MLE_D_FI routines + +void MLE_D_FI::Value + (const ColumnVector& Parameters, bool wg, Real& v, bool& oorg) +{ + Tracer tr("MLE_D_FI::Value"); + if (!LL.IsValid(Parameters,wg)) { oorg=true; return; } + v = LL.LogLikelihood(); + if (!LL.IsValid()) { oorg=true; return; } // check validity again + cout << endl; + cout << setw(20) << setprecision(10) << v; + oorg = false; + Derivs = LL.Derivatives(); // Get derivatives +} + +bool MLE_D_FI::NextPoint(ColumnVector& Adj, Real& test) +{ + Tracer tr("MLE_D_FI::NextPoint"); + SymmetricMatrix FI = LL.FI(); + LT = Cholesky(FI); + ColumnVector Adj1 = LT.i() * Derivs; + Adj = LT.t().i() * Adj1; + test = SumSquare(Adj1); + cout << " " << setw(20) << setprecision(10) << test; + return (test < Criterion); +} + +Real MLE_D_FI::LastDerivative(const ColumnVector& H) +{ return (Derivs.t() * H).AsScalar(); } + +void MLE_D_FI::Fit(ColumnVector& Parameters) +{ + Tracer tr("MLE_D_FI::Fit"); + FindMaximum2::Fit(Parameters,Lim); + cout << "\nConverged" << endl; +} + +void MLE_D_FI::MakeCovariance() +{ + if (Covariance.Nrows()==0) + { + LowerTriangularMatrix LTI = LT.i(); + Covariance << LTI.t() * LTI; + SE << Covariance; // get diagonal + int n = Covariance.Nrows(); + for (int i=1; i <= n; i++) SE(i) = sqrt(SE(i)); + } +} + +void MLE_D_FI::GetStandardErrors(ColumnVector& SEX) +{ MakeCovariance(); SEX = SE.AsColumn(); } + +void MLE_D_FI::GetCorrelations(SymmetricMatrix& Corr) +{ MakeCovariance(); Corr << SE.i() * Covariance * SE.i(); } + + + +#ifdef use_namespace +} +#endif + + +///@} diff --git a/extern/newmat/newmatnl.h b/extern/newmat/newmatnl.h new file mode 100644 index 00000000..0a415845 --- /dev/null +++ b/extern/newmat/newmatnl.h @@ -0,0 +1,327 @@ +/// \ingroup newmat +///@{ + +/// \file newmatnl.h +/// Header file for non-linear optimisation + +// Copyright (C) 1993,4,5: R B Davies + +#ifndef NEWMATNL_LIB +#define NEWMATNL_LIB 0 + +#include "newmat.h" + +#ifdef use_namespace +namespace NEWMAT { +#endif + + + +/* + +This is a beginning of a series of classes for non-linear optimisation. + +At present there are two classes. FindMaximum2 is the basic optimisation +strategy when one is doing an optimisation where one has first +derivatives and estimates of the second derivatives. Class +NonLinearLeastSquares is derived from FindMaximum2. This provides the +functions that calculate function values and derivatives. + +A third class is now added. This is for doing maximum-likelihood when +you have first derviatives and something like the Fisher Information +matrix (eg the variance covariance matrix of the first derivatives or +minus the second derivatives - this matrix is assumed to be positive +definite). + + + + class FindMaximum2 + +Suppose T is the ColumnVector of parameters, F(T) the function we want +to maximise, D(T) the ColumnVector of derivatives of F with respect to +T, and S(T) the matrix of second derivatives. + +Then the basic iteration is given a value of T, update it to + + T - S.i() * D + +where .i() denotes inverse. + +If F was quadratic this would give exactly the right answer (except it +might get a minimum rather than a maximum). Since F is not usually +quadratic, the simple procedure would be to recalculate S and D with the +new value of T and keep iterating until the process converges. This is +known as the method of conjugate gradients. + +In practice, this method may not converge. FindMaximum2 considers an +iteration of the form + + T - x * S.i() * D + +where x is a number. It tries x = 1 and uses the values of F and its +slope with respect to x at x = 0 and x = 1 to fit a cubic in x. It then +choses x to maximise the resulting function. This gives our new value of +T. The program checks that the value of F is getting better and carries +out a variety of strategies if it is not. + +The program also has a second strategy. If the successive values of T +seem to be lying along a curve - eg we are following along a curved +ridge, the program will try to fit this ridge and project along it. This +does not work at present and is commented out. + +FindMaximum2 has three virtual functions which need to be over-ridden by +a derived class. + + void Value(const ColumnVector& T, bool wg, Real& f, bool& oorg); + +T is the column vector of parameters. The function returns the value of +the function to f, but may instead set oorg to true if the parameter +values are not valid. If wg is true it may also calculate and store the +second derivative information. + + bool NextPoint(ColumnVector& H, Real& d); + +Using the value of T provided in the previous call of Value, find the +conjugate gradients adjustment to T, that is - S.i() * D. Also return + + d = D.t() * S.i() * D. + +NextPoint should return true if it considers that the process has +converged (d very small) and false otherwise. The previous call of Value +will have set wg to true, so that S will be available. + + Real LastDerivative(const ColumnVector& H); + +Return the scalar product of H and the vector of derivatives at the last +value of T. + +The function Fit is the function that calls the iteration. + + void Fit(ColumnVector&, int); + +The arguments are the trial parameter values as a ColumnVector and the +maximum number of iterations. The program calls a DataException if the +initial parameters are not valid and a ConvergenceException if the +process fails to converge. + + + class NonLinearLeastSquares + +This class is derived from FindMaximum2 and carries out a non-linear +least squares fit. It uses a QR decomposition to carry out the +operations required by FindMaximum2. + +A prototype class R1_Col_I_D is provided. The user needs to derive a +class from this which includes functions the predicted value of each +observation its derivatives. An object from this class has to be +provided to class NonLinearLeastSquares. + +Suppose we observe n normal random variables with the same unknown +variance and such the i-th one has expected value given by f(i,P) +where P is a column vector of unknown parameters and f is a known +function. We wish to estimate P. + +First derive a class from R1_Col_I_D and override Real operator()(int i) +to give the value of the function f in terms of i and the ColumnVector +para defined in class R1_CoL_I_D. Also override ReturnMatrix +Derivatives() to give the derivates of f at para and the value of i +used in the preceeding call to operator(). Return the result as a +RowVector. Construct an object from this class. Suppose in what follows +it is called pred. + +Now constuct a NonLinearLeastSquaresObject accessing pred and optionally +an iteration limit and an accuracy critierion. + + NonLinearLeastSquares NLLS(pred, 1000, 0.0001); + +The accuracy critierion should be somewhat less than one and 0.0001 is +about the smallest sensible value. + +Define a ColumnVector P containing a guess at the value of the unknown +parameter, and a ColumnVector Y containing the unknown data. Call + + NLLS.Fit(Y,P); + +If the process converges, P will contain the estimates of the unknown +parameters. If it does not converge an exception will be generated. + +The following member functions can be called after you have done a fit. + +Real ResidualVariance() const; + +The estimate of the variance of the observations. + +void GetResiduals(ColumnVector& Z) const; + +The residuals of the individual observations. + +void GetStandardErrors(ColumnVector&); + +The standard errors of the observations. + +void GetCorrelations(SymmetricMatrix&); + +The correlations of the observations. + +void GetHatDiagonal(DiagonalMatrix&) const; + +Forms a diagonal matrix of values between 0 and 1. If the i-th value is +larger than, say 0.2, then the i-th data value could have an undue +influence on your estimates. + + +*/ + +class FindMaximum2 +{ + virtual void Value(const ColumnVector&, bool, Real&, bool&) = 0; + virtual bool NextPoint(ColumnVector&, Real&) = 0; + virtual Real LastDerivative(const ColumnVector&) = 0; +public: + void Fit(ColumnVector&, int); + virtual ~FindMaximum2() {} // to keep gnu happy +}; + +class R1_Col_I_D +{ + // The prototype for a Real function of a ColumnVector and an + // integer. + // You need to derive your function from this one and put in your + // function for operator() and Derivatives() at least. + // You may also want to set up a constructor to enter in additional + // parameter values (that will not vary during the solve). + +protected: + ColumnVector para; // Current x value + +public: + virtual bool IsValid() { return true; } + // is the current x value OK + virtual Real operator()(int i) = 0; // i-th function value at current para + virtual void Set(const ColumnVector& X) { para = X; } + // set current para + bool IsValid(const ColumnVector& X) + { Set(X); return IsValid(); } + // set para, check OK + Real operator()(int i, const ColumnVector& X) + { Set(X); return operator()(i); } + // set para, return value + virtual ReturnMatrix Derivatives() = 0; + // return derivatives as RowVector + virtual ~R1_Col_I_D() {} // to keep gnu happy +}; + + +class NonLinearLeastSquares : public FindMaximum2 +{ + // these replace the corresponding functions in FindMaximum2 + void Value(const ColumnVector&, bool, Real&, bool&); + bool NextPoint(ColumnVector&, Real&); + Real LastDerivative(const ColumnVector&); + + Matrix X; // the things we need to do the + ColumnVector Y; // QR triangularisation + UpperTriangularMatrix U; // see the write-up in newmata.txt + ColumnVector M; + Real errorvar, criterion; + int n_obs, n_param; + const ColumnVector* DataPointer; + RowVector Derivs; + SymmetricMatrix Covariance; + DiagonalMatrix SE; + R1_Col_I_D& Pred; // Reference to predictor object + int Lim; // maximum number of iterations + +public: + NonLinearLeastSquares(R1_Col_I_D& pred, int lim=1000, Real crit=0.0001) + : criterion(crit), Pred(pred), Lim(lim) {} + void Fit(const ColumnVector&, ColumnVector&); + Real ResidualVariance() const { return errorvar; } + void GetResiduals(ColumnVector& Z) const { Z = Y; } + void GetStandardErrors(ColumnVector&); + void GetCorrelations(SymmetricMatrix&); + void GetHatDiagonal(DiagonalMatrix&) const; + +private: + void MakeCovariance(); +}; + + +// The next class is the prototype class for calculating the +// log-likelihood. +// I assume first derivatives are available and something like the +// Fisher Information or variance/covariance matrix of the first +// derivatives or minus the matrix of second derivatives is +// available. This matrix must be positive definite. + +class LL_D_FI +{ +protected: + ColumnVector para; // current parameter values + bool wg; // true if FI matrix wanted + +public: + virtual void Set(const ColumnVector& X) { para = X; } + // set parameter values + virtual void WG(bool wgx) { wg = wgx; } + // set wg + + virtual bool IsValid() { return true; } + // return true is para is OK + bool IsValid(const ColumnVector& X, bool wgx=true) + { Set(X); WG(wgx); return IsValid(); } + + virtual Real LogLikelihood() = 0; // return the loglikelihhod + Real LogLikelihood(const ColumnVector& X, bool wgx=true) + { Set(X); WG(wgx); return LogLikelihood(); } + + virtual ReturnMatrix Derivatives() = 0; + // column vector of derivatives + virtual ReturnMatrix FI() = 0; // Fisher Information matrix + virtual ~LL_D_FI() {} // to keep gnu happy +}; + +// This is the class for doing the maximum likelihood estimation + +class MLE_D_FI : public FindMaximum2 +{ + // these replace the corresponding functions in FindMaximum2 + void Value(const ColumnVector&, bool, Real&, bool&); + bool NextPoint(ColumnVector&, Real&); + Real LastDerivative(const ColumnVector&); + + // the things we need for the analysis + LL_D_FI& LL; // reference to log-likelihood + int Lim; // maximum number of iterations + Real Criterion; // convergence criterion + ColumnVector Derivs; // for the derivatives + LowerTriangularMatrix LT; // Cholesky decomposition of FI + SymmetricMatrix Covariance; + DiagonalMatrix SE; + +public: + MLE_D_FI(LL_D_FI& ll, int lim=1000, Real criterion=0.0001) + : LL(ll), Lim(lim), Criterion(criterion) {} + void Fit(ColumnVector& Parameters); + void GetStandardErrors(ColumnVector&); + void GetCorrelations(SymmetricMatrix&); + +private: + void MakeCovariance(); +}; + + +#ifdef use_namespace +} +#endif + + + +#endif + +// body file: newmatnl.cpp + + + +///@} + diff --git a/extern/newmat/newmatrc.h b/extern/newmat/newmatrc.h new file mode 100644 index 00000000..d9237ebb --- /dev/null +++ b/extern/newmat/newmatrc.h @@ -0,0 +1,186 @@ +/// \ingroup newmat +///@{ + +/// \file newmatrc.h +/// Header file for row/column classes + +// Copyright (C) 1991,2,3,4,7: R B Davies + +#ifndef NEWMATRC_LIB +#define NEWMATRC_LIB 0 + +#ifdef use_namespace +namespace NEWMAT { +#endif + +#include "controlw.h" + + +/************** classes MatrixRowCol, MatrixRow, MatrixCol *****************/ + +// Used for accessing the rows and columns of matrices +// All matrix classes must provide routines for calculating matrix rows and +// columns. Assume rows can be found very efficiently. + +enum LSF { LoadOnEntry=1,StoreOnExit=2,DirectPart=4,StoreHere=8,HaveStore=16 }; + + +/// Option for accessing row or column. +/// \internal +class LoadAndStoreFlag : public ControlWord +{ +public: + LoadAndStoreFlag() {} + LoadAndStoreFlag(int i) : ControlWord(i) {} + LoadAndStoreFlag(LSF lsf) : ControlWord(lsf) {} + LoadAndStoreFlag(const ControlWord& cwx) : ControlWord(cwx) {} +}; + + +/// Access a row or column of a matrix. +/// \internal +class MatrixRowCol +{ +public: // these are public to avoid + // numerous friend statements + int length; // row or column length + int skip; // initial number of zeros + int storage; // number of stored elements + int rowcol; // row or column number + GeneralMatrix* gm; // pointer to parent matrix + Real* data; // pointer to local storage + LoadAndStoreFlag cw; // Load? Store? Is a Copy? + void IncrMat() { rowcol++; data += storage; } // used by NextRow + void IncrDiag() { rowcol++; skip++; data++; } + void IncrId() { rowcol++; skip++; } + void IncrUT() { rowcol++; data += storage; storage--; skip++; } + void IncrLT() { rowcol++; data += storage; storage++; } + +public: + void Zero(); // set elements to zero + void Add(const MatrixRowCol&); // add a row/col + void AddScaled(const MatrixRowCol&, Real); // add a multiple of a row/col + void Add(const MatrixRowCol&, const MatrixRowCol&); + // add two rows/cols + void Add(const MatrixRowCol&, Real); // add a row/col + void NegAdd(const MatrixRowCol&, Real); // Real - a row/col + void Sub(const MatrixRowCol&); // subtract a row/col + void Sub(const MatrixRowCol&, const MatrixRowCol&); + // sub a row/col from another + void RevSub(const MatrixRowCol&); // subtract from a row/col + void ConCat(const MatrixRowCol&, const MatrixRowCol&); + // concatenate two row/cols + void Multiply(const MatrixRowCol&); // multiply a row/col + void Multiply(const MatrixRowCol&, const MatrixRowCol&); + // multiply two row/cols + void KP(const MatrixRowCol&, const MatrixRowCol&); + // Kronecker Product two row/cols + void Copy(const MatrixRowCol&); // copy a row/col + void CopyCheck(const MatrixRowCol&); // ... check for data loss + void Check(const MatrixRowCol&); // just check for data loss + void Check(); // check full row/col present + void Copy(const double*&); // copy from an array + void Copy(const float*&); // copy from an array + void Copy(const int*&); // copy from an array + void Copy(Real); // copy from constant + void Add(Real); // add a constant + void Multiply(Real); // multiply by constant + Real SumAbsoluteValue(); // sum of absolute values + Real MaximumAbsoluteValue1(Real r, int& i); // maximum of absolute values + Real MinimumAbsoluteValue1(Real r, int& i); // minimum of absolute values + Real Maximum1(Real r, int& i); // maximum + Real Minimum1(Real r, int& i); // minimum + Real Sum(); // sum of values + void Inject(const MatrixRowCol&); // copy stored els of a row/col + void Negate(const MatrixRowCol&); // change sign of a row/col + void Multiply(const MatrixRowCol&, Real); // scale a row/col + friend Real DotProd(const MatrixRowCol&, const MatrixRowCol&); + // sum of pairwise product + Real* Data() { return data; } + int Skip() { return skip; } // number of elements skipped + int Storage() { return storage; } // number of elements stored + int Length() { return length; } // length of row or column + void Skip(int i) { skip=i; } + void Storage(int i) { storage=i; } + void Length(int i) { length=i; } + void SubRowCol(MatrixRowCol&, int, int) const; + // get part of a row or column + MatrixRowCol() {} // to stop warning messages + ~MatrixRowCol(); + FREE_CHECK(MatrixRowCol) +}; + +/// Access a row of a matrix. +/// \internal +class MatrixRow : public MatrixRowCol +{ +public: + // bodies for these are inline at the end of this .h file + MatrixRow(GeneralMatrix*, LoadAndStoreFlag, int=0); + // extract a row + ~MatrixRow(); + void Next(); // get next row + FREE_CHECK(MatrixRow) +}; + +/// Access a column of a matrix. +/// \internal +class MatrixCol : public MatrixRowCol +{ +public: + // bodies for these are inline at the end of this .h file + MatrixCol(GeneralMatrix*, LoadAndStoreFlag, int=0); + // extract a col + MatrixCol(GeneralMatrix*, Real*, LoadAndStoreFlag, int=0); + // store/retrieve a col + ~MatrixCol(); + void Next(); // get next column + FREE_CHECK(MatrixCol) +}; + +/// Alternative to MatrixCol where the complete column is stored externally. +/// \internal +class MatrixColX : public MatrixRowCol +{ +public: + // bodies for these are inline at the end of this .h file + MatrixColX(GeneralMatrix*, Real*, LoadAndStoreFlag, int=0); + // store/retrieve a col + ~MatrixColX(); + void Next(); // get next row + Real* store; // pointer to local storage + // less skip + FREE_CHECK(MatrixColX) +}; + +/**************************** inline bodies ****************************/ + +inline MatrixRow::MatrixRow(GeneralMatrix* gmx, LoadAndStoreFlag cwx, int row) +{ gm=gmx; cw=cwx; rowcol=row; gm->GetRow(*this); } + +inline void MatrixRow::Next() { gm->NextRow(*this); } + +inline MatrixCol::MatrixCol(GeneralMatrix* gmx, LoadAndStoreFlag cwx, int col) +{ gm=gmx; cw=cwx; rowcol=col; gm->GetCol(*this); } + +inline MatrixCol::MatrixCol(GeneralMatrix* gmx, Real* r, + LoadAndStoreFlag cwx, int col) +{ gm=gmx; data=r; cw=cwx+StoreHere; rowcol=col; gm->GetCol(*this); } + +inline MatrixColX::MatrixColX(GeneralMatrix* gmx, Real* r, + LoadAndStoreFlag cwx, int col) +{ gm=gmx; store=data=r; cw=cwx+StoreHere; rowcol=col; gm->GetCol(*this); } + + +inline void MatrixCol::Next() { gm->NextCol(*this); } + +inline void MatrixColX::Next() { gm->NextCol(*this); } + +#ifdef use_namespace +} +#endif + +#endif + + +///@} diff --git a/extern/newmat/newmatrm.cpp b/extern/newmat/newmatrm.cpp new file mode 100644 index 00000000..726d10f1 --- /dev/null +++ b/extern/newmat/newmatrm.cpp @@ -0,0 +1,221 @@ +/// \ingroup newmat +///@{ + +/// \file newmatrm.cpp +/// Rectangular matrix operations + +// Copyright (C) 1991,2,3,4: R B Davies + +#define WANT_MATH + +#include "newmat.h" +#include "newmatrm.h" + +#ifdef use_namespace +namespace NEWMAT { +#endif + +#ifdef DO_REPORT +#define REPORT { static ExeCounter ExeCount(__LINE__,12); ++ExeCount; } +#else +#define REPORT {} +#endif + + +// operations on rectangular matrices + + +void RectMatrixRow::Reset (const Matrix& M, int row, int skip, int length) +{ + REPORT + RectMatrixRowCol::Reset + ( M.Store()+row*M.Ncols()+skip, length, 1, M.Ncols() ); +} + +void RectMatrixRow::Reset (const Matrix& M, int row) +{ + REPORT + RectMatrixRowCol::Reset( M.Store()+row*M.Ncols(), M.Ncols(), 1, M.Ncols() ); +} + +void RectMatrixCol::Reset (const Matrix& M, int skip, int col, int length) +{ + REPORT + RectMatrixRowCol::Reset + ( M.Store()+col+skip*M.Ncols(), length, M.Ncols(), 1 ); +} + +void RectMatrixCol::Reset (const Matrix& M, int col) +{ + REPORT + RectMatrixRowCol::Reset( M.Store()+col, M.Nrows(), M.Ncols(), 1 ); +} + + +Real RectMatrixRowCol::SumSquare() const +{ + REPORT + long_Real sum = 0.0; int i = n; Real* s = store; int d = spacing; + // while (i--) { sum += (long_Real)*s * *s; s += d; } + if (i) for(;;) + { sum += (long_Real)*s * *s; if (!(--i)) break; s += d; } + return (Real)sum; +} + +Real RectMatrixRowCol::operator*(const RectMatrixRowCol& rmrc) const +{ + REPORT + long_Real sum = 0.0; int i = n; + Real* s = store; int d = spacing; + Real* s1 = rmrc.store; int d1 = rmrc.spacing; + if (i!=rmrc.n) + { + Tracer tr("newmatrm"); + Throw(InternalException("Dimensions differ in *")); + } + // while (i--) { sum += (long_Real)*s * *s1; s += d; s1 += d1; } + if (i) for(;;) + { sum += (long_Real)*s * *s1; if (!(--i)) break; s += d; s1 += d1; } + return (Real)sum; +} + +void RectMatrixRowCol::AddScaled(const RectMatrixRowCol& rmrc, Real r) +{ + REPORT + int i = n; Real* s = store; int d = spacing; + Real* s1 = rmrc.store; int d1 = rmrc.spacing; + if (i!=rmrc.n) + { + Tracer tr("newmatrm"); + Throw(InternalException("Dimensions differ in AddScaled")); + } + // while (i--) { *s += *s1 * r; s += d; s1 += d1; } + if (i) for (;;) + { *s += *s1 * r; if (!(--i)) break; s += d; s1 += d1; } +} + +void RectMatrixRowCol::Divide(const RectMatrixRowCol& rmrc, Real r) +{ + REPORT + int i = n; Real* s = store; int d = spacing; + Real* s1 = rmrc.store; int d1 = rmrc.spacing; + if (i!=rmrc.n) + { + Tracer tr("newmatrm"); + Throw(InternalException("Dimensions differ in Divide")); + } + // while (i--) { *s = *s1 / r; s += d; s1 += d1; } + if (i) for (;;) { *s = *s1 / r; if (!(--i)) break; s += d; s1 += d1; } +} + +void RectMatrixRowCol::Divide(Real r) +{ + REPORT + int i = n; Real* s = store; int d = spacing; + // while (i--) { *s /= r; s += d; } + if (i) for (;;) { *s /= r; if (!(--i)) break; s += d; } +} + +void RectMatrixRowCol::Negate() +{ + REPORT + int i = n; Real* s = store; int d = spacing; + // while (i--) { *s = - *s; s += d; } + if (i) for (;;) { *s = - *s; if (!(--i)) break; s += d; } +} + +void RectMatrixRowCol::Zero() +{ + REPORT + int i = n; Real* s = store; int d = spacing; + // while (i--) { *s = 0.0; s += d; } + if (i) for (;;) { *s = 0.0; if (!(--i)) break; s += d; } +} + +void ComplexScale(RectMatrixCol& U, RectMatrixCol& V, Real x, Real y) +{ + REPORT + int n = U.n; + if (n != V.n) + { + Tracer tr("newmatrm"); + Throw(InternalException("Dimensions differ in ComplexScale")); + } + Real* u = U.store; Real* v = V.store; + int su = U.spacing; int sv = V.spacing; + //while (n--) + //{ + // Real z = *u * x - *v * y; *v = *u * y + *v * x; *u = z; + // u += su; v += sv; + //} + if (n) for (;;) + { + Real z = *u * x - *v * y; *v = *u * y + *v * x; *u = z; + if (!(--n)) break; + u += su; v += sv; + } +} + +void Rotate(RectMatrixCol& U, RectMatrixCol& V, Real tau, Real s) +{ + REPORT + // (U, V) = (U, V) * (c, s) where tau = s/(1+c), c^2 + s^2 = 1 + int n = U.n; + if (n != V.n) + { + Tracer tr("newmatrm"); + Throw(InternalException("Dimensions differ in Rotate")); + } + Real* u = U.store; Real* v = V.store; + int su = U.spacing; int sv = V.spacing; + //while (n--) + //{ + // Real zu = *u; Real zv = *v; + // *u -= s * (zv + zu * tau); *v += s * (zu - zv * tau); + // u += su; v += sv; + //} + if (n) for(;;) + { + Real zu = *u; Real zv = *v; + *u -= s * (zv + zu * tau); *v += s * (zu - zv * tau); + if (!(--n)) break; + u += su; v += sv; + } +} + + +// misc procedures for numerical things + +Real pythag(Real f, Real g, Real& c, Real& s) +// return z=sqrt(f*f+g*g), c=f/z, s=g/z +// set c=1,s=0 if z==0 +// avoid floating point overflow or divide by zero +{ + if (f==0 && g==0) { c=1.0; s=0.0; return 0.0; } + Real af = f>=0 ? f : -f; + Real ag = g>=0 ? g : -g; + if (ag=0) ? x : -x; } // assume x >=0 + + +// Misc numerical things + +Real pythag(Real f, Real g, Real& c, Real& s); + +inline void GivensRotation(Real cGivens, Real sGivens, Real& x, Real& y) +{ + // allow for possibility &x = &y + Real tmp0 = cGivens * x + sGivens * y; + Real tmp1 = -sGivens * x + cGivens * y; + x = tmp0; y = tmp1; +} + +inline void GivensRotationR(Real cGivens, Real sGivens, Real& x, Real& y) +{ + // also change sign of y + // allow for possibility &x = &y + Real tmp0 = cGivens * x + sGivens * y; + Real tmp1 = sGivens * x - cGivens * y; + x = tmp0; y = tmp1; +} + + + + + +#ifdef use_namespace +} +#endif + +#endif + +// body file: newmatrm.cpp + + +///@} diff --git a/extern/newmat/nl_ex.cpp b/extern/newmat/nl_ex.cpp new file mode 100644 index 00000000..25c9a012 --- /dev/null +++ b/extern/newmat/nl_ex.cpp @@ -0,0 +1,125 @@ +/// \ingroup newmat +///@{ + +/// \file nl_ex.cpp +/// Example of non-linear least squares fit. +/// +/// This is an example of a non-linear least squares fit. The example +/// is from "Nonlinear estimation" by Gavin Ross (Springer,1990), p 63. +/// There are better ways of doing the fit in this case so this +/// example is just an example. +/// +/// The model is E(y) = a + b exp(-kx) and there are 6 data points. + +#define WANT_STREAM +#define WANT_MATH +#include "newmatnl.h" +#include "newmatio.h" + +#ifdef use_namespace +using namespace RBD_LIBRARIES; +#endif + + +// first define the class describing the predictor function + +class Model_3pe : public R1_Col_I_D +{ + ColumnVector x_values; // the values of "x" + RowVector deriv; // values of derivatives +public: + Model_3pe(const ColumnVector& X_Values) + : x_values(X_Values) { deriv.resize(3); } + // load X data + Real operator()(int); + bool IsValid() { return para(3)>0; } + // require "k" > 0 + ReturnMatrix Derivatives() { return deriv; } +}; + +Real Model_3pe::operator()(int i) +{ + Real a = para(1); Real b = para(2); Real k = para(3); + Real xvi = x_values(i); + Real e = exp(-k * xvi); + deriv(1) = 1.0; // calculate derivatives + deriv(2) = e; + deriv(3) = - b * e * xvi; + return a + b * e; // function value +} + + +int my_main() +{ + { + // Get the data + ColumnVector X(6); + ColumnVector Y(6); + X << 1 << 2 << 3 << 4 << 6 << 8; + Y << 3.2 << 7.9 << 11.1 << 14.5 << 16.7 << 18.3; + + + // Do the fit + Model_3pe model(X); // the model object + NonLinearLeastSquares NLLS(model); // the non-linear least squares + // object + ColumnVector Para(3); // for the parameters + Para << 9 << -6 << .5; // trial values of parameters + cout << "Fitting parameters\n"; + NLLS.Fit(Y,Para); // do the fit + + // Inspect the results + ColumnVector SE; // for the standard errors + NLLS.GetStandardErrors(SE); + cout << "\n\nEstimates and standard errors\n" << + setw(10) << setprecision(2) << (Para | SE) << endl; + Real ResidualSD = sqrt(NLLS.ResidualVariance()); + cout << "\nResidual s.d. = " << setw(10) << setprecision(2) << + ResidualSD << endl; + SymmetricMatrix Correlations; + NLLS.GetCorrelations(Correlations); + cout << "\nCorrelationMatrix\n" << + setw(10) << setprecision(2) << Correlations << endl; + ColumnVector Residuals; + NLLS.GetResiduals(Residuals); + DiagonalMatrix Hat; + NLLS.GetHatDiagonal(Hat); + cout << "\nX, Y, Residual, Hat\n" << setw(10) << setprecision(2) << + (X | Y | Residuals | Hat.as_column()) << endl; + // recover var/cov matrix + SymmetricMatrix D; + D << SE.as_diagonal() * Correlations * SE.as_diagonal(); + cout << "\nVar/cov\n" << setw(14) << setprecision(4) << D << endl; + } + +#ifdef DO_FREE_CHECK + FreeCheck::Status(); +#endif + + return 0; +} + + +// call my_main() - use this to catch exceptions +int main() +{ + Try + { + return my_main(); + } + Catch(BaseException) + { + cout << BaseException::what() << "\n"; + } + CatchAll + { + cout << "\nProgram fails - exception generated\n\n"; + } + return 0; +} + + +///@} + + + diff --git a/extern/newmat/nl_ex.txt b/extern/newmat/nl_ex.txt new file mode 100644 index 00000000..46dcbf4b --- /dev/null +++ b/extern/newmat/nl_ex.txt @@ -0,0 +1,42 @@ +Fitting parameters + + 70.02918529 209.6252324 0.1541078372 + 94.78295699 + 49.23360397 147.1803571 0.1734849298 + 1.848950128 + 0.7422941575 1.70673579 0.1733822274 + 0.2113527145 + 0.1955923541 0.06041118379 0.1754552928 + 0.1754553498 + 0.1754553471 2.341694142e-08 0.1754553393 +Converged + + +Estimates and standard errors + 19.77 0.73 + -23.63 0.82 + 0.35 0.04 + + +Residual s.d. = 0.42 + +CorrelationMatrix + 1.00 -0.05 -0.91 + -0.05 1.00 -0.31 + -0.91 -0.31 1.00 + + +X, Y, Residual, Hat + 1.00 3.20 0.10 0.89 + 2.00 7.90 -0.11 0.33 + 3.00 11.10 -0.38 0.39 + 4.00 14.50 0.58 0.35 + 6.00 16.70 -0.16 0.32 + 8.00 18.30 -0.02 0.73 + + +Var/cov + 0.5295 -0.0324 -0.0250 + -0.0324 0.6668 -0.0096 + -0.0250 -0.0096 0.0014 + diff --git a/extern/newmat/nm11.htm b/extern/newmat/nm11.htm new file mode 100644 index 00000000..f34829ad --- /dev/null +++ b/extern/newmat/nm11.htm @@ -0,0 +1,5145 @@ + + + + + + + + + +Newmat11 documentation + + + + + +

Documentation for newmat11, a matrix library in C++

+

next - skip - +up - start
+return to online documentation page

+

Copyright (C) 2008: R B Davies

+

20 November, 2008.

+ + + + + +
1. +Introduction
+2. Getting started
+3. Reference manual
+4. +Error messages
+5. Design of the library
+6. Function summary
+7. Change History
+8. Problem report form
+

 

+

This is the how to use documentation for newmat plus some +background information on its design.

+

There is additional support material on my web site. +

+

Navigation:  This page is arranged in sections, +sub-sections and sub-sub-sections; four cross-references are given at the top +of these. Next takes you through the sections, sub-sections and +sub-sub-sections in order. Skip goes to the next section, sub-section or +sub-sub-section at the same level in the hierarchy as the section, sub-section +or sub-sub-section that you are currently reading. Up takes you up one +level in the hierarchy and start gets you back here.

+

Please read the sections on customising and +compilers before +attempting to compile newmat.

+

1. Introduction

+

next - skip - +up - start

+ + + + + +
1.1 +Conditions of use
+1.2 Description
+1.3 Is this the library for you?
+1.4 Other matrix libraries
1.5 +Where to find this library
+1.6 How to contact the author
+1.7 References
+

1.1 Conditions of use

+

next - skip - +up - start

+
+

I place no restrictions on the use of newmat except that I take no liability for any problems that may arise from its use, +distribution or other dealings with it.

+

+You can use it in your commercial projects (as well as your non-commercial +projects).

+

+You can make and distribute modified or merged versions. You can +include parts of it in your own software.

+

+If you distribute modified or merged versions, please make it clear +which parts are mine and which parts are modified.

+

+For a substantially modified version, simply note that it is, in +part, derived from my software. A comment in the code will be +sufficient.

+

+The software is provided as is, without warranty of any kind.

+

+Please understand that there may still be bugs and errors. Use at +your own risk. I (Robert Davies) take no responsibility for any errors +or omissions in this package or for any misfortune that may befall you +or others as a result of your use, distribution or other dealings with it.


+

Please report bugs to me at robert at statsresearch.co.nz   +[replace at by you-know-what-character in the email address].

+

When reporting a bug please tell me which C++ compiler you are using, and +what version. Also give me details of your computer. And tell me which version +of newmat (e.g. newmat03 or newmat04) you are using and its date. Note any changes +you have made to my code. If at all possible give me a piece of code +illustrating the bug. See the problem report form.

+

Please do report bugs to me.

+

1.2 General description +

+

next - skip - +up - start

+

The package is intended for scientists and engineers who need to manipulate +a variety of types of matrices using standard matrix operations. Emphasis is on +the kind of operations needed in statistical calculations such as least +squares, linear equation solve and eigenvalues.

+

It supports matrix types

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Matrixrectangular matrix
SquareMatrixsquare matrix
nricMatrixfor use with Numerical Recipes in C programs
UpperTriangularMatrix 
LowerTriangularMatrix 
DiagonalMatrix 
SymmetricMatrix 
BandMatrix 
UpperBandMatrixupper triangular band matrix
LowerBandMatrixlower triangular band matrix
SymmetricBandMatrix 
RowVectorderived from Matrix
ColumnVectorderived from Matrix
IdentityMatrixdiagonal matrix, elements have same value
+
+

Only one element type (float or double) is supported.

+

The package includes the operations *, +, -, +Kronecker product, Schur product, concatenation, inverse, transpose, conversion between types, submatrix, +determinant, Cholesky decomposition, QR decomposition, singular value +decomposition, eigenvalues of a symmetric matrix, sorting, fast Fourier +transform, printing and an interface with Numerical Recipes in C.

+

It is intended for matrices in the range 10 x 10 to the maximum size your +machine will accommodate in a single array. The number of elements in an array +cannot exceed the maximum size of an int. The package will work for very +small matrices but becomes rather inefficient. Some of the factorisation +functions are not (yet) optimised for paged memory and so become inefficient +when used with very large matrices.

+

A lazy evaluation approach to evaluating matrix expressions is used +to improve efficiency and reduce the use of temporary storage.

+

I have tested versions of the package on variety of compilers and platforms +including Borland, Gnu, Microsoft and Sun. For more details +see the section on compilers.

+

1.3 Is this the library for +you?

+

next - skip - +up - start

+

Do you

+
    +
  • understand * to mean matrix multiply and not element by element +multiply
  • +
  • need matrix operators such as * and + defined as +operators so you can write things like X = A * (B + C);
  • +
  • need a variety of types of matrices (but not sparse)
  • +
  • need only one element type (float or double)
  • +
  • work with matrices in the range 10 x 10 up to what can be stored in memory +
  • +
  • tolerate a moderately large but not huge package
  • +
  • need high quality but not necessarily the latest numerical methods.
  • +
+

Then newmat may be the right matrix library for you.

+

1.4 Other matrix libraries +

+

next - skip - +up - start

+

For details of other C++ matrix libraries look at +http://www.robertnz.net/cpp_site.html. +Look at the section lists of libraries which gives the locations of +several very comprehensive lists of matrix and other C++ libraries and at the +section source code. Or just search on Google.

+

1.5 Where to find this +library

+

next - skip - +up - start

+ +

1.6 How to contact the +author

+

next - skip - +up - start

+
   Robert Davies
+   16 Gloucester Street
+   Wilton
+   Wellington
+   New Zealand
+
+   Internet: robert at statsresearch.co.nz
+ +[replace at by you-know-what.] + + +

1.7 References

+

next - skip - +up - start

+
    +
  • The matrix LU decomposition is from Golub, G.H. & Van Loan, C.F. +(1996), Matrix Computations, published by Johns Hopkins University +Press.
  • +
  • Part of the matrix inverse/solve routine is adapted from Press, Flannery, +Teukolsky, Vetterling (1988), Numerical Recipes in C, published by the +Cambridge University Press.
  • +
  • Many of the advanced matrix routines are adapted from routines in Wilkinson +and Reinsch (1971), Handbook for Automatic Computation, Vol II, Linear +Algebra published by Springer Verlag.
  • +
  • The fast Fourier transform is adapted from Carl de Boor (1980), Siam J +Sci Stat Comput, pp173-8 and the fast trigonometric transforms from Charles +Van Loan (1992) in Computational frameworks for the fast Fourier +transform published by SIAM.
  • +
  • The sort function is derived from Sedgewick, Robert (1992), Algorithms +in C++ published by Addison Wesley.
  • +
+

For references about Newmat see

+
    +
  • Davies, R.B. (1994) Writing a matrix package in C++. In OON-SKI'94: The +second annual object-oriented numerics conference, pp 207-213. Rogue Wave +Software, Corvallis.
  • +
  • Eddelbuttel, Dirk (1996) Object-oriented econometrics: matrix programming +in C++ using GCC and Newmat. Journal of Applied Econometrics, Vol 11, No 2, pp +199-209.
  • +
+

2. Getting started

+

next - skip - +up - start

+ + + + + +
2.1 Overview
+2.2 Make files
+2.3 Customising
+2.4 Compilers
+2.5 Updating from previous versions
+2.6 Catching exceptions
2.7 Examples
+2.8 Testing
+2.9 Bugs
+2.10 Problem areas
+2.11 Files in newmat11
+ 
+

2.1 Overview

+

next - skip - +up - start

+

I use .h as the suffix of definition files and .cpp as the suffix of C++ +source files.

+

You will need to compile all the *.cpp files listed as program files in the +files section to get the complete package. Ideally you +should store the resulting object files as a library. The tmt*.cpp files are +used for testing, example.cpp is an example and sl_ex.cpp, nl_ex.cpp and garch.cpp are examples +of the non-linear solve and optimisation routines. A +demonstration and test of the exception mechanism is in test_exc.cpp. The files +nm_ex1.cpp, nm_ex2.cpp and nm_ex3.cpp contain more simple examples.

+

I include a number of make files for compiling the example and the +test package. See the section on make files for details. +Alternatively, with the PC compilers, its pretty quick just to load all the files in the +interactive environments by pointing and clicking.

+

Use the large or win32 console model when you are using a PC. Do not +outline inline functions. You may need to increase the stack size on +older operating systems or compilers.

+

Your source files that access the newmat will need to #include one or more +of the following files.

+ + + + + + + + + + + + + + + + + + + + + +
include.hto access just the compiler options
newmat.hto access just the main matrix library (includes include.h)
newmatap.hto access the advanced matrix routines such as Cholesky decomposition, QR +triangularisation etc (includes newmat.h)
newmatio.hto access the output routines (includes newmat.h) You +can use this only with compilers that support the standard input/output +routines including manipulators (all recent compilers)
newmatnl.hto access the non-linear optimisation routines (includes newmat.h)
+

See the section on customising to see how to edit +include.h for your environment and the section on compilers for any special problems with the compiler you +are using.

+

2.2 Make files

+

next - skip - +up - start

+

I have included make files for compiling my test and example programs for +various versions of CC, Borland, Microsoft, Open Watcom, Intel and Gnu compilers. You +can generate make files for a number of other compilers with my +genmake utility. Make files provide +a way of compiling your programs without using the IDE that comes with +PC compilers. See the files section for details.

+

PC

+

I include make files for various versions of Borland, Microsoft and Intel +compilers. With the +Borland compiler you will need to edit it to show where +you have stored your Borland compiler. For make files for other compilers use my +genmake utility. To compile my test and example +programs use Borland 5.5 (Builder 5) use

+
   make -f nm_b55.mak
+

or with Borland 5.6 (Builder 6) use

+
   make -f nm_b56.mak
+

or with Microsoft VC++ 6 or 7 use

+
   nmake -f nm_m6.mak
+

There are some more notes in the +genmake documentation about using these make files.

+

Unix

+

The make file for the Unix CC compilers link a .cxx file to each .cpp +file since some of these compilers do not recognise .cpp as a legitimate +extension for a C++ file. I suggest you delete this part of the make +file and, if necessary, rename the .cpp files to something your compiler +recognises.

+

My make file for Gnu GCC on Unix systems is for use with +gmake rather than make. I assume your compiler recognises the +.cpp extension. Ordinary make works with it on the Sun but did not the +Silicon Graphics or HP machines when I had access to them, many years ago. On Linux use make.

+

My make file for the CC compilers works with the ordinary make.

+

To compile everything with the CC compiler use

+
   make -f nm_cc.mak
+
+ +

or for the gnu compiler use

+
   make -f nm_gnu.mak
+
+ +

There is a line in the make file for CC rm -f $*.cxx. Some systems +won't accept this line and you will need to delete it. In this case, if you +have a bad compile and you are using my scheme for linking .cxx files, you will +need to delete the .cxx file link generated by that compile before you can do +the next one.

+

2.3 Customising

+

next - skip - +up - start

+

The file include.h sets a variety of options including several +compiler dependent options. You may need to edit include.h to get the options +you require. If you are using a compiler different from one I have worked with +you may have to set up a new section in include.h appropriate for your +compiler.

+

Borland, Gnu, Microsoft and Watcom are recognised automatically. If +none of these are recognised a default set of options is used. These are fine +for AT&T, HPUX and Sun C++. If you using a compiler I don't know about you +may have to write a new set of options.

+

There is an option in include.h for selecting whether you use compiler +supported exceptions, simulated exceptions, or disable exceptions. I now set + compiler supported exceptions as the default. Use the option for +compiler supported exceptions if and only if you have set the option on +your compiler to recognise exceptions. Disabling exceptions sometimes helps +with compilers that are incompatible with my exception simulation scheme.

+

Activate the appropriate statement to make the element type float or +double. I suggest you leave it at double.

+

The option DO_FREE_CHECK is used for tracking memory +leaks and normally should not be activated.

+

Activate SETUP_C_SUBSCRIPTS if you want to use traditional C style +element access. Note that this does not change +the starting point for indices when you are using round brackets for accessing +elements or selecting submatrices. It does enable you to use C style square +brackets. This also activates additional constructors for Matrix, ColumnVector +and RowVector to simplify use with Numerical Recipes in C++.

+

Activate #define use_namespace if you want to use namespaces. Do this only if you are sure your compiler +supports namespaces. If you do turn this option on, be prepared to turn it off +again if the compiler reports inaccessible variables or the linker reports +missing links.

+

Activate #define _STANDARD_ to use the standard names for the +included files and to find the floating point precision data using the floating +point standard. This will work with most recent compilers and is done +automatically for Borland, Gnu, Intel and Microsoft compilers.

+

If you haven't defined _STANDARD_ and are using a compiler that +include.h does not recognise and you want to pick up the floating point +precision data from float.h then activate #define use_float_h. +Otherwise the floating point precision data will be accessed from +values.h. You may need to do this with computers from Digital, in +particular.

+

There is a line

+
   //#define set_unix_options
+

You can activate this if you are using a Linux or Unix system. It is not used +by Newmat but is used by some of my other programs.

+

2.4 Compilers

+

next - skip - +up - start

+ + + + + +
+2.4.1 AT&T
+2.4.2 Borland
+2.4.3 Gnu G++
+2.4.4 HPUX
+2.4.5 Intel
+2.4.6 Microsoft
+2.4.7 Sun
+2.4.8 Watcom
+

I have tested this library on a number of compilers. Here are the levels of +success and any special considerations. In most cases I have chosen code that +works under all the compilers I have access to, but I have had to include some +specific work-arounds for some compilers. For the newest PC versions, I use a Pentium +4 computer running windows XP or Linux +(Red Hat workstation version). The Unix versions are on a Sun Sparc +station. Thanks to Victoria University for access to the Sparc.

+

I have set up a block of code for each of the compilers in include.h. Turbo, +Borland, Gnu, Microsoft and Watcom are recognised automatically. There is a +default option that works for AT&T, Sun C++ and HPUX. So you don't +have to make any changes for these compilers. Otherwise you may have to build +your own set of options in include.h.

+

2.4.1 AT&T

+

next - skip - +up - start

+

The AT&T compiler used to be available on a wide variety of Unix +workstations. I don't know if anyone still uses it. However the AT&T options are +the default if your compiler is not recognised.

+

AT&T C++ 2.1; 3.0.1 on a Sun: Previous versions worked on these +compilers, which I no longer have access to.

+

In AT&T 2.1 you may get an error when you use an expression for the +single argument when constructing a Vector or DiagonalMatrix or one of the +Triangular Matrices. You need to evaluate the expression separately.

+

2.4.2 Borland

+

next - skip - +up - start

+

Newer compilers

+

Borland Builder version 8. My tests here have been compiling from a +make file using nm_b58.mak and making a console program. This works fine +except that my values of LnMinimum and LnMaximum in precisio.h +are not correct.

+

Borland Builder version 6: My tests have been on the personal +version. See the notes for version 5. If you are +compiling with a make file you can use nm_b56.mak as a model. You can set +the newmat options to use namespace and the standard library. If you are +compiling a GUI program you may need to comment out the line defining +TypeDefException in include.h. I don't believe exceptions work +completely correctly in either version 5 or version 6. However, this does not +seem to be a problem with my use of them in newmat.

+

Borland Builder version 5: This works fine in console mode and no +special editing of the source codes is required. I haven't tested it in GUI +mode. You can set the newmat options to use namespace and the standard library. You +should turn off the Borland option to use pre-compiled headers. There +are notes on compiling with the IDE on my website. +Alternatively you can use the nm_b55.mak make file.

+

Borland Builder version 4: I have successfully used this on older +versions of newmat using the +console wizard (menu item file/new - select new tab). Use compiler +exceptions. Suppose you are compiling my test program tmt. Rename my +main() function in tmt.cpp to my_main(). Rename +tmt.cpp to tmt_main.cpp. Borland will generate a new file +tmt.cpp containing their main() function. Put the line int +my_main(); above this function and put return my_main(); into the +body of main().

+

Borland compiler version 5.5: this is the free C++ compiler available +from Borland's web site. I suggest you use +the compiler supported exceptions and turn on standard in include.h. You +can use the make file nm_b55.mak after editing to correct the file locations for +your system.

+

Older compilers

+

Borland C++ 5.02:

+

I am not longer checking compatibility with this compiler.

+

Use the large or 32 bit flat model. If you are not debugging, turn off the +options that collect debugging information. Use my simulated exceptions.

+

When running my test program under ms-dos you may run out of memory. Either +compile the test routine to run under easywin or use simulated exceptions +rather than the built in exceptions.

+

If you can, upgrade to windows 95 or window NT and use the 32 bit console +model.

+

If you are using the 16 bit large model, don't forget to keep all matrices +less than 64K bytes in length (90x90 for a rectangular matrix if you are using +double as your element type). Otherwise your program will crash +without warning or explanation. You will need to break the tmt set of test files into several parts to get the program +to fit into your computer and run without stack overflow.

+

You can generate make files for versions 5 with my +genmake utility.

+

Borland C++ 3 and 4.

+

The program used to compile in version 3.1 if you enable the simulated booleans +- comment out the line #define bool_LIB 0 in include.h +and use the simulated exceptions. I haven't checked the latest versions +of Newmat. The main test program is too large to run +unless you break it up into several parts. I haven't tried it under version 4.

+

2.4.3 Gnu G++

+

next - skip - +up - start

+

Gnu G++ 3, 4 (Linux), 3 (Sun): These work OK. If you are using a much earlier version +see if you can upgrade. It  used to work with 2.95 and 2.96 but I don't +have access to these now. You can't use standard with the 2.9X +versions. The namespace option worked with 2.96 on Linux but not with 2.95 on +the Sun. Standard is automatically turned on with the 3.X.

+

This version of Newmat is not compatible with versions 2.6 or earlier.

+

2.4.4 HP-UX

+

next - skip - +up - start

+

HP 9000 series HP-UX. I no longer have access to this compiler. Newmat09 +worked without problems with the simulated exceptions; haven't tried the +built-in exceptions.

+

With recent versions of the compiler you may get warning messages like +Unsafe cast between pointers/references to incomplete classes. At +present, I think these can be ignored.

+ +

2.4.5 Intel

+

next - skip - +up - start

+ +

Newmat works correctly with the Intel 10 C++ compiler for Windows and Linux. (Not tested for the other versions). Standard is +automatically turned on for both the Linux versions and Windows versions. If +this causes a problem for the version you are using you can find the lines in +include.h that control this and comment them out. Note that the Intel compiler for +Linux is free for non-commercial use. (One of the versions of 8.1 gave a +warning message every time I had something like +Real x; ... if (x==0.0) ..., which was often. This is now seems to be fixed.)

+ +

2.4.6 Microsoft

+

next - skip - +up - start

+

Newer versions

+

See my web site for instructions how to work +Microsoft's IDE.

+

Microsoft Visual C++ 7, 7.1, 8: These work OK. All my tests have +been in console mode. You can turn on my namespace option. Standard is turned on +by default for these versions.

+

Microsoft Visual C++ 6: Get the latest service pack. I have tried this +in console mode and it seems to work satisfactorily. Use the compiler supported exceptions. You may be able to +use the namespace and standard options. If you want to work under MFC +you may need to #include "stdafx.h" at the beginning of each .cpp file +(or turn off precompiled headers).

+

Microsoft Visual C++ 5: I have tried this in console mode on previous +versions of Newmat. It +seems to work satisfactorily. There may be a problem with namespace (fixed by Service Pack 3?). Turn optimisation +off. Use the compiler supported exceptions. If +you want to work under MFC  +you may need to #include "stdafx.h" at the +beginning of each .cpp file (or turn off precompiled headers).

+

Older versions

+

I doubt whether these will work.

+

2.4.7 Sun

+

next - skip - +up - start

+

Sun C++ (version = ?): This seems to work fine with +compiler supported exceptions. Sun C++ (version +5): There was a problem with exceptions. If you use my simulated +exceptions the non-linear optimisation programs hang. If you use the compiler +supported exceptions my tmt and test_exc programs crash. You should +disable exceptions.

+

2.4.8 Watcom

+

next - skip - +up - start

+

Open Watcom (version 1.7a): this works. You can set the standard +option in include.h. The scientific and fixed +manipulators don't work.

+

Watcom C++ (version 10a): this used to work, I don't know if it works +now.

+

2.5 Updating from previous +versions

+

next - skip - +up - start

+

Newmat11 - if you are upgrading from earlier versions note the +following:

+
    +
  • The class Exception in myexcept.h has been replaced by + BaseException and a typedef statement included so programs that use + the Exception class will still work. If the Exception class was + causing a problem comment out the line defining TypeDefException in + include.h.
  • +
  • Newmat11 does not support the TEMP_DESTROYED_QUICKLY options so won't work + with very old versions of Gnu G++
  • +
  • Old AT&T work-arounds are removed
  • +
  • The simulated Booleans class is now stored at the end of include.h. In + general, I am not testing with compilers that don't support bool.
  • +
  • QRZ and QRZT no longer throw an exception if they generate a singular + triangular matrix
  • +
  • Converting functions to lower case. Both the old and new names will work. See the list of + functions for new and old names
  • +
  • nm_i5.mak, nm_il5.mak replaced by nm_i8.mak, + nm_il8.mak
  • +
  • extra file nm_misc.cpp to be included in compilation
  • +
  • scientific and fixed manipulators now recognised in output + statements. If you want fixed output and have been using + scientific in a previous output statement, you may need to include the + fixed manipulator. (Doesn't work in Visual C++, version 6 and open + Watcom).
  • +
+

Newmat10 includes new maxima, minima, +determinant, dot product and Frobenius norm functions, a +faster FFT, revised make files for GCC +and CC compilers, several corrections, new ReSize function, IdentityMatrix +and Kronecker Product. Singular values from +SVD are sorted. The program files include a new file, newfft.cpp, so you +will need to include this in the list of files in your IDE and make files. There +is also a new test file tmtm.cpp. +Pointer arithmetic now mostly meets requirements of +standard. You can use << to load data into rows +of a matrix. The default options in include.h have been +changed. If you are updating from a beta version of newmat09 look through the +next section as there were some late changes to newmat09.

+

If you are upgrading from newmat08 note the following: +

+
    +
  • Boolean, TRUE, FALSE are now bool, true, false. See +customising if your compiler supports the bool class. +
  • +
  • ReDimension is now ReSize. +
  • +
  • The simulated exception package has +been updated.
  • +
  • Operators ==, !=, +=, +-=, *=, |=, &= are now supported as +binary matrix operators.
  • +
  • A+=f, A-=f, A*=f, A/=f, +f+A, f-A, f*A are supported for A +matrix, f scalar.
  • +
  • Fast trigonometric transforms. +
  • +
  • Reverse function for reversing order of +elements in a vector or matrix.
  • +
  • IsSingular function.
  • +
  • An option is included for defining namespaces.
  • +
  • Dummy inequality operators are defined for compatibility +with the STL.
  • +
  • The row/column classes in newmat3.cpp have been modified to +improve efficiency and correct an invalid use of pointer arithmetic. Most users +won't be using these classes explicitly; if you are, please contact me for +details of the changes.
  • +
  • Matrix LU decomposition rewritten (faster for large arrays). +
  • +
  • The sort function rewritten (faster).
  • +
  • The documentation files newmata.txt and newmatb.txt have +been amalgamated and both are included in the hypertext version.
  • +
  • Some of the make files reorganised +again.
  • +
+

If you are upgrading from newmat07 note the following: +

+
    +
  • .cxx files are now .cpp files. Some versions of won't accept +.cpp. The make files for Gnu and AT&T link the .cpp files to .cxx +files before compilation and delete the links after compilation.
  • +
  • An option in include.h allows you to +use compiler supported exceptions, simulated exceptions or disable exceptions. +Edit the file include.h to select one of these three options. Don't simulate +exceptions if you have set your compiler's option to implement exceptions. +
  • +
  • New QR decomposition functions. +
  • +
  • A non-linear least squares class. +
  • +
  • No need to explicitly set the AT&T option in include.h. +
  • +
  • Concatenation and elementwise +multiplication.
  • +
  • A new GenericMatrix class. +
  • +
  • Sum function.
  • +
  • Some of the make files reorganised. +
  • +
+

If you are upgrading from newmat06 note the following: +

+
    +
  • If you are using << to load a Real into a submatrix +change this to =.
  • +
+

If you are upgrading from newmat03 or newmat04 +note the following

+
    +
  • .hxx files are now .h files
  • +
  • real changed to Real
  • +
  • BOOL changed to Boolean
  • +
  • CopyToMatrix changed to AsMatrix, etc
  • +
  • real(A) changed to A.AsScalar()
  • +
+

The current version is quite a bit longer that newmat04, so +if you are almost out of space with newmat04, don't throw newmat04 away until +you have checked your program will work under this version.

+

See the change history for other changes.

+

2.6 Catching exceptions

+

next - skip - +up - start

+

This section applies particularly to people using compiler supported +exceptions rather than my simulated exceptions.

+
+

If newmat detects an error it will throw an exception. It is important that +you catch this exception and print the error message. Otherwise you will get an +unhelpful message like abnormal termination.

+
+

I suggest you set up your +main program like 

+
#define WANT_STREAM             // or #include <iostream>
+#include "newmat.h"             // or #include "newmatap.h"
+#include "newmatio.h"           // if you are using my matrix output functions
+
+main()
+{
+   try
+   {
+      ... your program here
+   }
+   // catch exceptions thrown by my programs
+   catch(BaseException) { cout << BaseException::what() << endl; }
+   // catch exceptions thrown by other people's programs
+   catch(...) { cout << "exception caught in main program" << endl; }
+   return 0;
+}
+

Or see my file nm_ex1.cpp for an easy way of organising this.

+

If you are using a GUI version rather a console version of the program you +will need to catch the exception and display the error message in a pop-up +window.

+

If you are using my simulated exceptions or have set the disable exceptions +option in include.h then uncaught exceptions automatically print the +error message generated by the exception so you can ignore this section. +Alternatively use Try, Catch and CatchAll in place of try, catch +and catch(...) in the preceding code.

+

See the section on exceptions for more information on +the exception structure.

+

2.7 Examples

+

next - skip - +up - start

+

I include a number of example files. See the sections on make +files and on compilers for information about compiling +them.

+

Invert matrix: nm_ex1.cpp. Load values into a 4x4 matrix; invert it +and check the result. The output is in nm_ex1.txt.

+

Eigenvalues and eigenvectors of Hilbert matrix: nm_ex2.cpp. Calculate the +eigenvalues and eigenvectors of a 7x7 Hilbert matrix. The output is in +nm_ex2.txt.

+

Values in precisio.h: nm_ex3.cpp.

+

Linear regression example: example.cpp. This gives a linear +regression example using five different algorithms. The correct output is given +in example.txt. The program carries out a rough check that no memory +is left allocated on the heap when it terminates. See the section on +testing for a comment on the reliability of this check +and the use of the DO_FREE_CHECK option.

+

Other example files are nl_ex.cpp and garch.cpp for +demonstrating the non-linear fitting routines, sl_ex for demonstrating +the solve function and test_exc for demonstrating and testing exception +handling.

+

2.8 Testing

+

next - skip - +up - start

+

The library package contains a comprehensive test program in the form of a +series of files with names of the form tmt?.cxx. The files consist of a large +number of matrix formulae all of which evaluate to zero (except the first one +which is used to check that we are detecting non-zero matrices). The printout +should state that it has found just one non-zero matrix.

+

The test program should be run with Real typedefed to double +rather than float in include.h.

+

Make sure the C subscripts are enabled if you want +to test these.

+

If you are carrying out some form of bounds checking, for example, with +Borland's CodeGuard, then disable the testing of the Numerical Recipes in C interface. Activate the statement +#define DONT_DO_NRIC in tmt.h.

+

Various versions of the make file (extension .mak) are included with the +package. See the section on make files.

+

The program also allocates and deletes a large block and small block of +memory before it starts the main testing and then at the end of the test. It +then checks that the blocks of memory were allocated in the same place. If not, +then one suspects that there has been a memory leak. i.e. a piece of memory has +been allocated and not deleted.

+

This is not foolproof. For example, programs may allocate extra print buffers +while the program is running. I have tried to overcome this by doing a print +before I allocate the first memory block. Programs may allocate memory for +different sized items in different places, or might not allocate items +consecutively. Or they might mix the items with memory blocks from other +programs. Nevertheless, I seem to get consistent answers from some of the +compilers I work with, so I think this is a worthwhile test. The compilers that +the test seems to work for include the Borland compilers, Microsoft VC++ 6 , +Watcom, and Gnu 2.96 for Linux.

+

If the DO_FREE_CHECK option in include.h is activated, +the program checks that each new is balanced with exactly one +delete. This provides a more definitive test of no memory leaks. There +are additional statements in myexcept.cpp which can be activated to print out +details of the memory being allocated and released.

+

I have included a facility for checking that each piece of code in the +library is really exercised by the test routines. Each block of code in the +main part of the library contains a word REPORT. newmat.h has +a line defining REPORT that can be activated (deactivate the dummy +version). This gives a printout of the number of times each of the +REPORT statements in the .cpp files is accessed. Use a grep +with line numbers to locate the lines on which REPORT occurs and +compare these with the lines that the printout shows were actually accessed. +One can then see which lines of code were not accessed.

+

2.9 Bugs

+

next - skip - +up - start

+
    +
  • Small memory leaks may occur when an exception is thrown and caught.
  • +
  • My exception scheme may not be not properly linked in with the standard +library exceptions. In particular, my scheme may fail to catch out-of-memory +exceptions.
  • +
+

2.10 Problem areas

+

next - skip - +up - start

+

This section lists parts of Newmat which users (including me) have found +difficult or unnatural. Also see the newmat FAQ list on +my website.

+

Invert, element access, matrix multiply etc causes the program to crash

+
+

Newmat throws an exception when it detects an error. This can cause a program +crash unless the exception is caught with a catch statement. See +catching exceptions.

+
+

1x1 matrix not automatically converted to a Real

+
+

Use the as_scalar() member function or the +dotproduct() function to take the dot +product of two vectors.

+
+

Constructors do not initialise elements

+
+

For example, Matrix A(4,5); does not initialise the elements of A. Use the +statement A=0.0 to set the values to zero.

+
+

resize does not initialise elements

+
+

For example, A.resize(5,6); does not set the elements of A. +If you want to keep values use resize_keep. See resize.

+
+

Setting Matrix to a scalar sets all the values

+
+

A(1,3) = 0.0; sets one element of a Matrix to zero. A = 0.0; sets all the +elements to zero. This is very convenient but also a source of error that is + +hard to see if you wanted A(1,3) = 0.0; but left out the element details.

+
+

Symmetry not detected automatically

+
+

For example, SymmetricMatrix SM = A.t() * A; will fail. Use SymmetricMatrix +SM; SM << A.t() * A;

+
+

<< does not work with constructors

+
+

For example, SymmetricMatrix SM << A.t() * A; does not work.

+
+

Multiple multiplication may be inefficient

+
+

For example, A * B * X where A and B are matrices and X is a column vector is +likely to be much slower than A * (B * X).

+
+

 

+

2.11 List of files

+

next - skip - +up - start

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Documentationreadme.txtreadme file
 nm11.htmdocumentation file
 add_time.pgnimage used by nm11.htm
 rbd.cssstyle sheet for nm11.htm
 _newmat.doxdescription file for Doxygen
 _rbd_com.doxdescription file for Doxygen
Header filescontrolw.hcontrol word definition file
 include.hdetails of include files and options
 myexcept.hgeneral exception handler definitions
 newmat.hmain matrix class definition file
 newmatap.happlications definition file
 newmatio.hinput/output definition file
 newmatnl.hnon-linear optimisation definition file
 newmatrc.hrow/column functions definition files
 newmatrm.hrectangular matrix access definition files
 precisio.hnumerical precision constants
 solution.hone dimensional solve definition file
Program filesbandmat.cppband matrix routines
 cholesky.cppCholesky decomposition
 evalue.cppeigenvalues and eigenvector calculation
 fft.cppfast Fourier, trig. transforms
 hholder.cppQR routines
 jacobi.cppeigenvalues by the Jacobi method
 myexcept.cppgeneral error and exception handler
 newfft.cppnew fast Fourier transform
 newmat1.cpptype manipulation routines
 newmat2.cpprow and column manipulation functions
 newmat3.cpprow and column access functions
 newmat4.cppconstructors, resize, utilities
 newmat5.cpptranspose, evaluate, matrix functions
 newmat6.cppoperators, element access
 newmat7.cppinvert, solve, binary operations
 newmat8.cppLU decomposition, scalar functions
 newmat9.cppoutput routines
 newmatex.cppmatrix exception handler
 newmatnl.cppnon-linear optimisation
 newmatrm.cpprectangular matrix access functions
 nm_misc.cppmiscellaneous classes, functions
 sort.cppsorting functions
 solution.cppone dimensional solve
 submat.cppsubmatrix functions
 svd.cppsingular value decomposition
Example filesnm_ex1.cppsimple example - invert matrix
 nm_ex1.txtoutput from nm_ex1.cpp
 nm_ex2.cppsimple example - eigenvalues of Hilbert matrix
 nm_ex2.txtoutput from nm_ex2.cpp
 nm_ex3.cppscientific format and constants from precisio.h
 nm_ex3.txtoutput from nm_ex3.cpp
 example.cppexample of use of package
 example.txtoutput from example
 sl_ex.cppexample of OneDimSolve routine
 sl_ex.txtoutput from example
 nl_ex.cppexample of non-linear least squares
 nl_ex.txtoutput from example
 garch.cppexample of maximum-likelihood fit
 garch.datdata file for garch.cpp
 garch.txtoutput from example
 test_exc.cppdemonstration exceptions
 test_exc.txtoutput from test_exc.cpp
Test filestmt.hheader file for test files
 tmt*.cpptest files (see the section on testing)
 tmt.txtoutput from test files
Make filesnm_gnu.makmake file for Gnu G++
 nm_cc.makmake file for AT&T, Sun and HPUX
 nm_b55.makmake file for Borland C++ 5.5
 nm_b56.makmake file for Borland Builder C++ 6
 nm_b58.makmake file for Borland Builder C++ 8
 nm_m6.makmake file for VC++ 6&7
 nm_m8.makmake file for VC++ 8
 nm_i8.makmake file for Intel C++ 8,9 under Windows
 nm_i10.makmake file for Intel C++ 10 under Windows
 nm_il8.makmake file for Intel C++ 8,9,10 under Linux
 nm_ow.makmake file for Open Watcom
 newmat.lfllibrary file list for use with genmake
 nm_targ.txttarget file list for use with genmake
 Makefile.inused for compiling with Opt++
+ +

 

+

These are the .cpp files you need to include in your make file or project:

+

Basic newmat

+ + + + + + + +
    +
  • bandmat.cpp
  • +
  • myexcept.cpp
  • +
  • newmat1.cpp
  • +
  • newmat2.cpp
  • +
+
    +
  • newmat3.cpp
  • +
  • newmat4.cpp
  • +
  • newmat5.cpp
  • +
  • newmat6.cpp
  • +
+
    +
  • newmat7.cpp
  • +
  • newmat8.cpp
  • +
  • newmat9.cpp
  • +
  • newmatex.cpp
  • +
+
    +
  • newmatrm.cpp
  • +
  • submat.cpp
  • +
+
+

Factorisations etc

+ + + + + + + +
    +
  • cholesky.cpp
  • +
  • evalue.cpp
  • +
  • fft.cpp
  • +
+
+
    +
  • hholder.cpp
  • +
  • jacobi.cpp
  • +
+
+
    +
  • sort.cpp
  • +
  • svd.cpp
  • +
+

 

    +
  • newfft.cpp
  • +
  • nm_misc.cpp
  • +
+
+

Nonlinear routines

+ + + + + + + +
    +
  • newmatnl.cpp
  • +
+
    +
  • solution.cpp
  • +
+
+

 

+ +

3. Reference manual

+

next - skip - +up - start

+ + + + + +
3.1 +Constructors
+3.2 Accessing elements
+3.3 Assignment and copying
+3.4 Entering values
+3.5 Unary operations
+3.6 Binary operations
+3.7 Matrix and scalar ops
+3.8 Scalar functions - size & shape
+3.9 Scalar functions - maximum & minimum
+3.10 Scalar functions - numerical
+3.11 Submatrices
+3.12 Change dimension
+3.13 Change type
+3.14 Multiple matrix solve
+3.15 Memory management
+3.16 Efficiency
+3.17 Output
+3.18 Accessing unspecified type
+3.19 Cholesky decomposition
+3.20 QR decomposition
+3.21 Singular value decomposition
+3.22 Eigenvalue decomposition
+3.23 Sorting
+3.24 Fast Fourier transform
+3.25 Fast trigonometric transforms
+3.26 Numerical recipes in C
+3.27 Exceptions
+3.28 Cleanup following exception
+3.29 Non-linear applications
+3.30 Standard template library
+3.31 Namespace
+3.32 Updating the Cholesky matrix
+3.33 Accessing C functions
+3.34 Simple integer array class
+3.35 Extend orthonormal set of columns
+3.36 Miscellaneous functions
+

See also function summary.

+ +

3.1 Constructors

+

next - skip - +up - start

+

To construct an m x n matrix, A, (m and +n are integers) use

+
    Matrix A(m,n);
+
+ +

The SquareMatrix, UpperTriangularMatrix, LowerTriangularMatrix, SymmetricMatrix and +DiagonalMatrix types are square. To construct an n x n matrix +use, for example

+
    SquareMatrix SQ(n);
+    UpperTriangularMatrix UT(n);
+    LowerTriangularMatrix LT(n);
+    SymmetricMatrix S(n);
+    DiagonalMatrix D(n);
+
+ +

Band matrices need to include bandwidth information in their constructors. +

+
    BandMatrix BM(n, lower, upper);
+    UpperBandMatrix UB(n, upper);
+    LowerBandMatrix LB(n, lower);
+    SymmetricBandMatrix SB(n, lower);
+
+ +

The integers upper and lower are the number of non-zero +diagonals above and below the diagonal (excluding the diagonal) +respectively.  The UpperBandMatrix and LowerBandMatrix are upper and lower +triangular band matrices. So an UpperBandMatrix is essentially a BandMatrix with +lower = 0 and a LowerBandMatrix is a BandMatrix with upper = 0.

+

The RowVector and ColumnVector types take just one argument in their +constructors:

+
    RowVector RV(n);
+    ColumnVector CV(n);
+
+ +

These constructors do not initialise the elements of the matrices. + +To set all the elements to zero use, for example,

+
    Matrix A(m, n); A = 0.0;
+
+ +

The IdentityMatrix takes one argument in its constructor specifying its +dimension.

+
    IdentityMatrix I(n);
+

The value of the diagonal elements is set to 1 by default, but you can +change this value as with other matrix types.

+ +

You can also construct vectors and matrices without specifying the +dimension. For example

+
    Matrix A;
+
+ +

In this case the dimension must be set by an assignment +statement or a resize statement.

+

You can also use a constructor to set a matrix equal to another matrix or +matrix expression.

+
    Matrix A = UT;
+    Matrix A = UT * LT;
+
+ +

Only conversions that don't lose information are supported - eg you cannot +convert an upper triangular matrix into a diagonal matrix using =.

+

3.2 Accessing elements +

+

next - skip - +up - start

+

Elements are accessed by expressions of the form A(i,j) where +i and j run from 1 to the appropriate dimension. Access elements +of vectors with just one argument. Diagonal matrices can accept one or two +subscripts.

+

This is different from the earliest version of the package in which the +subscripts ran from 0 to one less than the appropriate dimension. Use +A.element(i,j) if you want this earlier convention.

+

A(i,j) and A.element(i,j) can appear on either side of an += sign.

+

If you activate the #define SETUP_C_SUBSCRIPTS in +include.h you can also access elements using the traditional C style +notation. That is A[i][j] for matrices (except diagonal) and +V[i] for vectors and diagonal matrices. The subscripts start at zero +(i.e. like element) and there is no range checking. Because of the +possibility of confusing V(i) and V[i], I suggest you do +not activate this option unless you really want to use it.

+

Symmetric matrices are stored as lower triangular matrices. It is important +to remember this if you are using the A[i][j] method of accessing +elements. Make sure the first subscript is greater than or equal to the second +subscript. However, if you are using the A(i,j) method the program +will swap i and j if necessary; so it doesn't matter if you +think of the storage as being in the upper triangle (but it does matter +in some other situations such as when entering data).

+

The IdentityMatrix type does not support element access.

+

For interfacing with traditional C functions that involve one and two +dimensional arrays see accessing C functions.

+

3.3 Assignment and copying

+

next - skip - +up - start

+

The operator = is used for copying matrices, converting matrices, +or evaluating expressions. For example

+
    A = B;  A = L;  A = L * U;
+
+ +

Only conversions that don't lose information are supported. The dimensions +of the matrix on the left hand side are adjusted to those of the matrix or +expression on the right hand side. Elements on the right hand side which are +not present on the left hand side are set to zero.

+

The operator << can be used in place of = where it +is permissible for information to be lost.

+

For example

+
    SymmetricMatrix S; Matrix A;
+    ......
+    S << A.t() * A;
+
+ +

is acceptable whereas

+
    S = A.t() * A;                            // error
+
+ +

will cause a runtime error since the package does not (yet?) recognise +A.t()*A as symmetric.

+

Note that you can not use << with constructors. For +example

+
    SymmetricMatrix S << A.t() * A;           // error
+
+ +

does not work.

+

Also note that << cannot be used to load values from a full +matrix into a band matrix, since it will be unable to determine the bandwidth +of the band matrix.

+

A third copy routine is used in a similar role to =. Use

+
    A.inject(D);
+
+ +

to copy the elements of D to the corresponding elements of +A but leave the elements of A unchanged if there is no +corresponding element of D (the = operator would set them to +0). This is useful, for example, for setting the diagonal elements of a matrix +without disturbing the rest of the matrix. Unlike = and +<<, inject does not reset the dimensions of A, which +must match those of D. Inject does not test for no loss of +information. The name Inject can be used instead on inject.

+

You cannot replace D by a matrix expression. The effect of inject(D) depends on the type of D. If D is an +expression it might not be obvious to the user what type it would have. So I +thought it best to disallow expressions.

+

Inject can be used for loading values from a regular matrix into a band +matrix. (Don't forget to zero any elements of the left hand side that will not +be set by the loading operation).

+

Both << and inject can be used with submatrix expressions on +the left hand side. See the section on submatrices.

+

To set the elements of a matrix to a scalar use operator =

+
    Real r; int m,n;
+    ......
+    Matrix A(m,n); A = r;
+ + +To swap the values in two matrices A and B use one of the +following expressions
   A.swap(B);
+
   swap(A,B);
+The matrices A and B must be of the same type. This can be any +of the matrix types listed in the section on constructors, +CroutMatrix, BandLUMatrix or +GenericMatrix. Swap works by switching pointers and does not do any actual copying +of the main data arrays.

Notes:

+ +
    +
  • When you do a matrix assignment to another matrix or matrix expression with +either = or << the original data array associated with the matrix + being assigned to is destroyed +even if there is no change in length. See the section on storage. +This means, in particular, that pointers to matrix elements - e.g. +Real* a; a = &(A(1,1)); become invalid. If you want avoid this you + can use +Inject rather than =. But remember that you may need to zero + the matrix first.
    +
  • +
+ +

3.4 Entering values

+

next - skip - +up - start

+

You can load the elements of a matrix from an array:

+
    Matrix A(3,2);
+    Real a[] = { 11,12,21,22,31,33 };
+    A << a;
+

or

+
    Matrix A(3,2);
+    int a[] = { 11,12,21,22,31,33 };
+    A << a;
+

This construction does not check that the numbers of elements match +correctly. This version of << can be used with submatrices on +the left hand side. It is not defined for band matrices.

+

Note that you enter only the values stored in a matrix. For example

+
    SymmetricMatrix A(2);
+    Real a[] = { 11,12,22 };
+    A << a;
+

Alternatively you can enter short lists using a sequence of numbers +separated by << .

+
    Matrix A(3,2);
+    A << 11 << 12
+      << 21 << 22
+      << 31 << 32;
+
+ +

This does check for the correct total number of entries, although the +message for there being insufficient numbers in the list may be delayed until +the end of the block or the next use of this construction. This does not +work for band matrices or for long lists. It does work for submatrices if the +submatrix is a single complete row. For example

+
    Matrix A(3,2);
+    A.row(1) << 11 << 12;
+    A.row(2) << 21 << 22;
+    A.row(3) << 31 << 32;
+
+ +

Load only values that are actually stored in the matrix. For example

+
    SymmetricMatrix S(2);
+    S.row(1) << 11;
+    S.row(2) << 21 << 22;
+
+ +

Try to restrict this way of loading data to numbers. You can include +expressions, but these must not call a function which includes the same +construction.

+ +

Remember that matrices are stored by rows and that symmetric matrices are +stored as lower triangular matrices when using these methods to enter +data.

+

3.5 Unary operators

+

next - skip - +up - start

+

The package supports unary operations

+
    X = -A;           // change sign of elements
+    X = A.t();        // transpose
+    X = A.i();        // inverse (of square matrix A)
+    X = A.reverse();  // reverse order of elements of vector
+                      // or matrix (not band matrix)
+    ColumnVector X = A.sum_rows();         // sum of elements
+                                           // of each row
+    RowVector X = A.sum_columns();         // sum of elements
+                                           // of each column
+    ColumnVector X = A.sum_square_rows();  // sum of squares of
+                                           // elements of each row
+    RowVector X = A.sum_square_columns();  // sum of squares of
+                                           // elements of each column
+ +

See the function summary list for the older +depreciated function name.

+ + +

3.6 Binary operators

+

next - skip - +up - start

+

The package supports binary operations

+
    X = A + B;       // matrix addition
+    X = A - B;       // matrix subtraction
+    X = A * B;       // matrix multiplication
+    X = A.i() * B;   // equation solve (square matrix A)
+    X = A | B;       // concatenate horizontally (concatenate the rows)
+    X = A & B;       // concatenate vertically (concatenate the columns)
+    X = SP(A, B);    // elementwise product of A and B (Schur product)
+    X = KP(A, B);    // Kronecker product of A and B
+    X = crossproduct(A, B);          // vector cross product - see notes
+    X = crossproduct_rows(A, B);     // cross product of rows
+    X = crossproduct_columns(A, B);  // cross product of columns
+    bool b = A == B; // test whether A and B are equal
+    bool b = A != B; // ! (A == B)
+    A += B;          // A = A + B;
+    A -= B;          // A = A - B;
+    A *= B;          // A = A * B;
+    A |= B;          // A = A | B;
+    A &= B;          // A = A & B;
+    A.SP_eq(B);      // A = SP(A, B);
+    <, >, <=, >=     // included for compatibility with STL - see notes
+
+ +

Notes:

+
    +
  • If you are doing repeated multiplication. For example A*B*C, use +brackets to force the order of evaluation to minimise the number of operations. +If C is a column vector and A is not a vector, then it will +usually reduce the number of operations to use A*(B*C).
  • +
  • In the equation solve example case the inverse is not explicitly +calculated. An LU decomposition of A is performed and this is applied +to B. This is more efficient than calculating the inverse and then +multiplying. See also multiple matrix solving.
  • +
  • The package does not (yet?) recognise B*A.i() as an equation solve +and the inverse of A would be calculated. It is probably better to use +(A.t().i()*B.t()).t().
  • +
  • Horizontal or vertical concatenation returns a result of type Matrix, +RowVector or ColumnVector.
  • +
  • If A is m x p, B is m x q, +then A | B is m x (p+q) with the k-th row +being the elements of the k-th row of A followed by the +elements of the k-th row of B.
  • +
  • If A is p x n, B is q x n, +then A & B is (p+q) x n with the k-th +column being the elements of the k-th column of A followed by +the elements of the k-th column of B.
  • +
  • For complicated concatenations of matrices, consider instead using +submatrices.
  • +
  • See the section on submatrices on using a submatrix +on the RHS of an expression.
  • +
  • crossproduct - assumes A and B are both RowVectors of length 3 or both +ColumnVectors of length 3. Result is a Matrix of same dimension as A or B (will +automatically convert to RowVector if A and B are RowVectors and ColumnVector if +they are ColumnVectors).
  • +
  • crossproduct_rows - assumes A and B are of type Matrix with the same number +of rows and 3 columns. Does a cross product on corresponding pairs of rows.
  • +
  • crossproduct_columns - assumes A and B are of type Matrix with  the same +number of columns and 3 rows. Does a cross product on corresponding pairs of +columns.
  • +
  • Two matrices are equal if their difference is zero. They may be of +different types. For the CroutMatrix or BandLUMatrix they must be of the same +type and have all their elements equal. This is not a very useful operator and +is included for compatibility with some container templates.
  • +
  • The inequality operators are included for compatibility with some versions +of the +standard template library. If actually called, they will +throw an exception. So don't try to sort a list of matrices.
  • +
  • A row vector multiplied by a column vector yields a 1x1 matrix, not +a Real. To get a Real result use either as_scalar or +dotproduct.
  • +
  • The result from Kronecker product, KP(A, B), possesses an attribute such as +upper triangular, lower triangular, band, symmetric, diagonal if both of the +matrices A and B have the attribute. If A is band and B is a square type +(eg SquareMatrix, Diagonal, LowerTriangularMatrix etc) then +the result is band.
  • +
  • Elementwise product is also known as the Schur product or the Hadamard +product.
  • +
  • See the function summary list for the older +depreciated function names.
  • +
+

Remember that the product of symmetric matrices is not +necessarily symmetric so the following code will not run:

+
   SymmetricMatrix A, B;
+   .... put values in A, B ....
+   SymmetricMatrix C = A * B;   // run time error
+ +

Use instead

+
   Matrix C = A * B;
+ +

or, if you know the product will be symmetric, +use

+
   SymmetricMatrix C; C << A * B;
+
+ +

3.7 Matrix and scalar

+

next - skip - +up - start

+

The following expressions multiply the elements of a matrix A by a +scalar f: A * f or f * A . Likewise one can divide +the elements of a matrix A by a scalar f: A / f . +

+

The expressions A + f and A - f add or subtract a +rectangular matrix of the same dimension as A with elements equal to +f to or from the matrix A .

+

The expression f + A is an alternative to A + f. The +expression f - A subtracts matrix A from a rectangular matrix +of the same dimension as A and with elements equal to f . +

+

The expression A += f replaces A by A + f. +Operators -=, *=, /= are similarly defined.

+

3.8 Scalar functions of a +matrix - size & shape

+

next - skip - +up - start

+

This page describes functions returning the values associated with the size +and shape of matrices. The following pages describe other scalar matrix +functions.

+
    int m = A.nrows();                     // number of rows
+    int n = A.ncols();                     // number of columns
+    MatrixType mt = A.type();              // type of matrix
+    Real* s = A.data();                    // pointer to array of elements
+    const Real* s = A.data();              // pointer to array of elements
+                                           //    where A is const
+    const Real* s = A.const_data();        // pointer to array of elements
+    int l = A.size();                      // length of array of elements
+    MatrixBandWidth mbw = A.bandwidth();   // upper and lower bandwidths
+
+ +

MatrixType mt = A.type() returns the type of a matrix. Use +mt.value() to get a string (UT, LT, Rect, Sym, Diag, Band, UB, LB, +Crout, BndLU) showing the type (Vector types are returned as Rect).

+

MatrixBandWidth has member functions upper() and +lower() for finding the upper and lower bandwidths (number of diagonals +above and below the diagonal, both zero for a diagonal matrix). For non-band +matrices -1 is returned for both these values.

+

See the function summary list for the older +depreciated function names.

+

3.9 Scalar functions of a +matrix - maximum & minimum

+

next - skip - +up - start

+

This page describes functions for finding the maximum and minimum elements +of a matrix.

+
    int i, j;
+    Real mv = A.maximum_absolute_value();    // maximum of absolute values
+    Real mv = A.minimum_absolute_value();    // minimum of absolute values
+    Real mv = A.maximum();                   // maximum value
+    Real mv = A.minimum();                   // minimum value
+    Real mv = A.maximum_absolute_value1(i);  // maximum of absolute values
+    Real mv = A.minimum_absolute_value1(i);  // minimum of absolute values
+    Real mv = A.maximum1(i);                 // maximum value
+    Real mv = A.minimum1(i);                 // minimum value
+    Real mv = A.maximum_absolute_value2(i,j);// maximum of absolute values
+    Real mv = A.minimum_absolute_value2(i,j);// minimum of absolute values
+    Real mv = A.maximum2(i,j);               // maximum value
+    Real mv = A.minimum2(i,j);               // minimum value
+
+ +

All these functions throw an exception if A has no rows or no +columns.

+

The versions A.maximum_absolute_value1(i), etc return the location of +the extreme element in a RowVector, ColumnVector or DiagonalMatrix. The +versions A.maximum_absolute_value2(i,j), etc return the row and column +numbers of the extreme element. If the extreme value occurs more than once the +location of the last one is given.

+

The versions maximum_absolute_value(A), minimum_absolute_value(A), maximum(A), +minimum(A) can be used in place of A.maximum_absolute_value(), +A.minimum_absolute_value(), A.maximum(), A.minimum().

+

3.10 Scalar functions of a +matrix - numerical

+

next - skip - +up - start

+
    Real r = A.as_scalar();                // value of 1x1 matrix
+    Real ssq = A.sum_square();             // sum of squares of elements
+    Real sav = A.sum_absolute_value();     // sum of absolute values
+    Real s = A.sum();                      // sum of values
+    Real norm = A.norm1();                 // maximum of sum of absolute
+                                              values of elements of a column
+    Real norm = A.norm_infinity();         // maximum of sum of absolute
+                                              values of elements of a row
+    Real norm = A.norm_Frobenius();        // square root of sum of squares
+                                           // of the elements
+    Real t = A.trace();                    // trace
+    Real d = A.determinant();              // determinant
+    LogAndSign ld = A.log_determinant();   // natural log of determinant
+    bool z = A.is_zero();                  // test all elements zero
+    bool s = A.is_singular();              // A is a CroutMatrix or
+                                              BandLUMatrix
+    Real s = dotproduct(A, B);             // dot product of A and B
+                                           // interpreted as vectors
+
+ +

See the function summary list for the older +depreciated function names.

+ +

A.log_determinant() returns a value of type LogAndSign. If ld is of +type LogAndSign use

+
    ld.value()     to get the value of the determinant
+    ld.sign()      to get the sign of the determinant (values 1, 0, -1)
+    ld.log_value() to get the log of the absolute value.
+
+ +

Note that the direct use of the function determinant() will often +cause a floating point overflow exception.

+

A.is_zero() returns Boolean value true if the matrix +A has all elements equal to 0.0.

+

is_singular() is defined only for CroutMatrix and BandLUMatrix. It +returns true if one of the diagonal elements of the LU decomposition +is exactly zero.

+

dotproduct(const Matrix& A, const Matrix& B) converts both +of the arguments to rectangular matrices, checks that they have the same number +of elements and then calculates the first element of A * first element +of B + second element of A * second element of B + +... ignoring the row/column structure of A and B. It is +primarily intended for the situation where A and B are row or +column vectors.

+

The versions sum(A), sum_square(A), sum_absolute_value(A), trace(A), +log_determinant(A), determinant(A), norm1(A), norm_infinity(A), norm_Frobenius(A) +can be used in place of A.sum(), A.sum_square(), A.sum_absolute_value(), +A.trace(), A.log_determinant(), A.determinant(A), A.norm1(), A.norm_infinity(), A.norm_Frobenius(). +

+

3.11 Submatrices

+

next - skip - +up - start

+
    A.submatrix(fr,lr,fc,lc)
+
+ +

This selects a submatrix from A. The arguments +fr,lr,fc,lc are the first row, last row, +first column, last column of the submatrix with the numbering beginning at 1. +

+

I allow lr = fr-1 or lc = fc-1 or to indicate that a +matrix of zero rows or columns is to be returned.

+

A submatrix command may be used in any matrix expression or on the left hand +side of =, << or inject. inject does not check +no information loss. You can also use the construction

+
    Real c; .... A.submatrix(fr,lr,fc,lc) = c;
+
+ +

to set a submatrix equal to a constant.

+

The following are variants of submatrix:

+
    A.sym_submatrix(f,l)            //   assumes fr=fc and lr=lc
+    A.rows(f,l)                     //   select rows
+    A.row(f)                        //   select single row
+    A.columns(f,l)                  //   select columns
+    A.column(f)                     //   select single column
+
+ +

See the function summary list for the older +depreciated function names.

+ +

In each case f and l mean the first and last row or column +to be selected (starting at 1).

+

I allow l = f-1 to indicate that a matrix of zero rows or columns +is to be returned.

+

If submatrix or its variant occurs on the right hand side of an = +or << or within an expression think of its type as follows

+
    A.submatrix(fr,lr,fc,lc)           If A is RowVector or
+                                       ColumnVector then same type
+                                       otherwise type Matrix
+    A.sym_submatrix(f,l)               Same type as A
+    A.rows(f,l)                        Type Matrix
+    A.row(f)                           Type RowVector
+    A.columns(f,l)                     Type Matrix
+    A.column(f)                        Type ColumnVector
+
+ +

If submatrix or its variant appears on the left hand side of = or +<< , think of its type being Matrix. Thus L.row(1) +where L is LowerTriangularMatrix expects L.ncols() elements +even though it will use only one of them. If you are using = the +program will check for no loss of data.

+ +

A submatrix can appear on the left-hand side of += or -= +with a matrix expression on the right-hand side. It can also appear on the +left-hand side of +=, -=, *= or /= with a +Real on the right-hand side. In each case there must be no loss of information. +The SP_eq function is also defined for a submatrix. +

+

The row version can appear on the left hand side of +<< for loading literal data into a row. +Load only the number of elements that are actually going to be stored in +memory.

+

Do not use the += and -= operations with a submatrix of a +SymmetricMatrix or BandSymmetricMatrix on the LHS.

+

You can't pass a submatrix (or any of its variants) as a reference +non-constant matrix in a function argument. For example, the following will not +work:

+
   void YourFunction(Matrix& A);
+   ...
+   Matrix B(10,10);
+   YourFunction(B.submatrix(1,5,1,5))    // won't compile
+

If you are are using the submatrix facility to build a matrix from a small +number of components, consider instead using the concatenation operators.

+

3.12 Change dimensions

+

next - skip - +up - start

+

The following operations change the dimensions of a matrix. The values of the +elements are lost, for resize. resize_keep keeps element +values and zeros the elements in the matrix with the new size that are not in +the matrix with the old size.

+
    A.resize(nrows,ncols);        // for type Matrix or nricMatrix
+    A.resize(n);                  // for other types, except Band
+    A.resize(n,lower,upper);      // for BandMatrix
+    A.resize(n,lower);            // for LowerBandMatrix
+    A.resize(n,upper);            // for UpperBandMatrix
+    A.resize(n,lower);            // for SymmetricBandMatrix
+    A.resize(B);                  // set dims to those of B
+    A.cleanup();                  // resize to zero dimensions
+    A.resize_keep(nrows,ncols);   // for type Matrix or nricMatrix, keep values
+    A.resize_keep(n);             // for other types, except Band, keep values
+
+ +

Use A.cleanup() to set the dimensions of A to zero and +release all the heap memory.

+

A.resize(B) sets the dimensions of A to those of a matrix +B. This includes the band-width in the case of a band matrix. It is an +error for A to be a band matrix and B not a band matrix (or +diagonal matrix).

+

Remember that resize destroys values. If you want to resize, but +keep the values in the bit that is left use resize_keep.

+

See the function summary list for the older +depreciated function names.

+ +

3.13 Change type

+

next - skip - +up - start

+

The following functions interpret the elements of a matrix (stored row by +row) to be a vector or matrix of a different type. Actual copying is usually +avoided where these occur as part of a more complicated expression.

+
    A.as_row()
+    A.as_column()
+    A.as_diagonal()
+    A.as_matrix(nrows,ncols)
+    A.as_scalar()
+
+ +

The expression A.as_scalar() is used to convert a 1 x 1 matrix to a +scalar.

+

See the function summary list for the older +depreciated function names.

+

3.14 Multiple matrix solve

+

next - skip - +up - start

+

To solve the matrix equation Ay = b where A is a square +matrix of equation coefficients, y is a column vector of values to be +solved for, and b is a column vector, use the code

+
    int n = something
+    Matrix A(n,n); ColumnVector b(n);
+    ... put values in A and b
+    ColumnVector y = A.i() * b;       // solves matrix equation
+
+ +

The following notes are for the case where you want to solve more than one +matrix equation with different values of b but the same A. Or +where you want to solve a matrix equation and also find the determinant of +A. In these cases you probably want to avoid repeating the LU +decomposition of A for each solve or determinant calculation.

+

If A is a square or symmetric matrix use

+
    ColumnVector p, q;    
+    ...
+    CroutMatrix X = A;                // carries out LU decomposition
+    ColumnVector Ap = X.i()*p; ColumnVector Aq = X.i()*q;
+    LogAndSign ld = X.log_determinant();
+
+ +

rather than

+
    ColumnVector p, q;    
+    ...
+    ColumnVector Ap = A.i()*p; ColumnVector Aq = A.i()*q;
+    LogAndSign ld = A.log_determinant();
+
+ +

since each operation will repeat the LU decomposition.

+

If A is a BandMatrix or a SymmetricBandMatrix begin with

+
    BandLUMatrix X = A;               // carries out LU decomposition
+
+ +

A CroutMatrix or BandLUMatrix can be copied and you can have a constructor +with no parameters (use = to give it values). They work with +release(), release_and_delete and +GenericMatrix and ReturnMatrix. You +can't do any other manipulation apart from taking the inverse or solving with +i(), or finding the determinant or log determinant. See the function summary list +for accessing the internals of a CroutMatrix or BandLUMatrix.

+

You can alternatively use

+
    LinearEquationSolver X = A;
+
+ +

This will choose the most appropriate decomposition of A. That is, +the band form if A is banded; the Crout decomposition if A is +square or symmetric and no decomposition if A is triangular or +diagonal. It doesn't know about positive definite matrices so won't use +Cholesky.

+

3.15 Memory management

+

next - skip - +up - start

+

The package does not support delayed copy. Several strategies are required +to prevent unnecessary matrix copies.

+

Where a matrix is called as a function argument use a constant reference. +For example

+
    YourFunction(const Matrix& A)
+
+ +

rather than

+
    YourFunction(Matrix A)
+
+ +

Skip the rest of this section on your first reading.

+

A second place where it is desirable to avoid unnecessary copies is when a +function is returning a matrix. Matrices can be returned from a function with +the return command as you would expect. However these may incur one and +possibly two copyings of the matrix. To avoid this use the following +instructions.

+

Make your function of type ReturnMatrix . Then precede the return statement +with a release statement (or a release_and_delete statement if the matrix was +created with new). For example

+
    ReturnMatrix MakeAMatrix()
+    {
+       Matrix A;                // or any other matrix type
+       ......
+       A.release(); return A;
+    }
+
+ +

or

+
    ReturnMatrix MakeAMatrix()
+    {
+       Matrix* m = new Matrix;
+       ......
+       m->release_and_delete(); return *m;
+    }
+
+ +

If your compiler objects to this code, replace the return statements with +

+
    return A.for_return();
+
+ +

or

+
    return m->for_return();
+ +
+

Do not forget to make the function of type ReturnMatrix.

+
+

In particular, don't do

+
    Matrix MakeAMatrix()
+    {
+       Matrix A;                // or any other matrix type
+       ......
+       A.release(); return A;   // will compile but could give wrong answers.
+    }
+

since with some compilers A might retain its released status +after being returned.

+

You can also use .release() or ->release_and_delete() to +allow a matrix expression to recycle space. Suppose you call

+
    A.release();
+
+ +

just before A is used just once in an expression. Then the memory +used by A is either returned to the system or reused in the +expression. In either case, A's memory is destroyed. This procedure +can be used to improve efficiency and reduce the use of memory.

+

Use ->release_and_delete for matrices created by new if you want +to completely delete the matrix after it is accessed.

+

See the function summary list for the older +depreciated function names.

+

3.16 Efficiency

+

next - skip - +up - start

+

The package tends to be not very efficient for dealing with matrices with +short rows. This is because some administration is required for accessing rows +for a variety of types of matrices. To reduce the administration a special +multiply routine is used for rectangular matrices in place of the generic one. +Where operations can be done without reference to the individual rows (such as +adding matrices of the same type) appropriate routines are used.

+

When you are using small matrices (say smaller than 10 x 10) you may find it +faster to use rectangular matrices rather than the triangular or symmetric +ones.

+

3.17 Output

+

next - skip - +up - start

+

To print a matrix use an expression like

+
   Matrix A, B C;
+   ......
+   cout << setw(10) << setprecision(5) << A << endl;
+   cout << setw(10) << setprecision(5) << scientific << B << endl;
+   cout << setw(10) << setprecision(5) << fixed << C << endl;
+
+ +

This will work only with systems that support the standard input/output +routines including manipulators. The scientific and fixed manipulators won't +work with Visual C++, version 6.

+

You need to #include the files iostream.h, +iomanip.h, newmatio.h in your C++ source files that use this facility. The +files iostream.h, iomanip.h will be included automatically if you include the +statement #define WANT_STREAM at the beginning of your source file. So +you can begin your file with either

+
   #define WANT_STREAM
+   #include "newmatio.h"
+
+ +

or

+
   #include <iostream>
+   #include <iomanip>
+   #include "newmatio.h"
+
+ +

The present version of this routine is useful only for matrices small enough +to fit within a page or screen width.

+

To print several vectors or matrices in columns use a concatenation operator:

+
   ColumnVector A, B;
+   .....
+   cout << setw(10) << setprecision(5) << (A | B) << endl;
+
+ +

3.18 Unspecified type

+

next - skip - +up - start

+

Skip this section on your first reading.

+

If you want to work with a matrix of unknown type, say in a function. You +can construct a matrix of type GenericMatrix. Eg

+
   Matrix A;
+   .....                                  // put some values in A
+   GenericMatrix GM = A;
+
+ +

A GenericMatrix matrix can be used anywhere where a matrix expression can be +used and also on the left hand side of an =. You can pass any type of +matrix to a const +GenericMatrix& argument in a function. However most scalar functions +including nrows(), ncols(), type() and element access do not work with it. Nor +does the ReturnMatrix construct. swap does work with objects of type +GenericMatrix. See also the paragraph on LinearEquationSolver.

+

An alternative and less flexible approach is to use BaseMatrix or +GeneralMatrix.

+

Suppose you wish to write a function which accesses a matrix of unknown type +including expressions (eg A*B). Then use a layout similar to the +following:

+
   void YourFunction(BaseMatrix& X)
+   {
+      GeneralMatrix* gm = X.Evaluate();   // evaluate an expression
+                                          // if necessary
+      ........                            // operations on *gm
+      gm->tDelete();                      // delete *gm if a temporary
+   }
+
+ +

See, as an example, the definitions of operator<< in +newmat9.cpp.

+

Under certain circumstances; particularly where X is to be used +just once in an expression you can leave out the Evaluate() statement +and the corresponding tDelete(). Just use X in the +expression.

+

If you know YourFunction will never have to handle a formula as its argument +you could also use

+
   void YourFunction(const GeneralMatrix& X)
+   {
+      ........                            // operations on X
+   }
+
+ +

Do not try to construct a GeneralMatrix or BaseMatrix.

+

3.19 Cholesky +decomposition

+

next - skip - +up - start

+

Suppose S is symmetric and positive definite. Then there exists a +unique lower triangular matrix L such that L * L.t() = S. To +calculate this use

+
    SymmetricMatrix S;
+    ......
+    LowerTriangularMatrix L = Cholesky(S);
+
+ +

If S is a symmetric band matrix then L is a band matrix +and an alternative procedure is provided for carrying out the decomposition: +

+
    SymmetricBandMatrix S;
+    ......
+    LowerBandMatrix L = Cholesky(S);
+ +

See section 3.32 on updating a Cholesky +decomposition.
+

+ +

3.20 QR decomposition

+

next - skip - +up - start

+

This is a variant on the usual QR transformation.

+

Start with matrix (dimensions shown to left and below the matrix)

+
       / 0    0 \      s
+       \ X    Y /      n
+
+         s    t
+
+ +

Our version of the QR decomposition multiplies this matrix by an orthogonal +matrix Q to get

+
       / U    M \      s
+       \ 0    Z /      n
+
+         s    t
+
+ +

where U is upper triangular (the R of the QR transform). That is +

+
      Q  / 0   0 \  =  / U   M \
+         \ X   Y /     \ 0   Z / 
+ +

This is good for solving least squares problems: choose b (matrix or column +vector) to minimise the sum of the squares of the elements of

+
         Y - X*b
+
+ +

Then choose b = U.i()*M; The residuals Y - X*b are in +Z.

+

This is the usual QR transformation applied to the matrix X with +the square zero matrix concatenated on top of it. It gives the same triangular +matrix as the QR transform applied directly to X and generally seems +to work in the same way as the usual QR transform. However it fits into the +matrix package better and also gives us the residuals directly. It turns out to +be essentially a modified Gram-Schmidt decomposition.

+

Two routines are provided in newmat:

+
    QRZ(X, U);
+
+ +

replaces X by orthogonal columns and forms U.

+
    QRZ(X, Y, M);
+
+ +

uses X from the first routine, replaces Y by Z +and forms M. There is also a routine

+
    QRZ(X, Y, U, M);
+

which does both of these.

+

To extend U to a square orthogonal matrix see the function for +extending an orthonormal set of columns.

+

The are also routines QRZT(X, L), QRZT(X, Y, M) +and QRZT(X, Y, L, M) +which do the same decomposition on the transposes of all these matrices. QRZT +replaces the routines HHDecompose in earlier versions of newmat. +HHDecompose is +still defined but just calls QRZT.

+

For an example of the use of this decomposition see the file +example.cpp.

+

See the section on updating a Cholesky decomposition +for updating U.

+

Alternatively to update U or L with a new block of data, X, one can use

+
    updateQRZ(X, U);
+
+

or

+
    updateQRZT(X, L);
+

You can update the M matrix with

+
    updateQRZ(X, Y, M);
+

At present, there is no corresponding function for updateQRZT. Also +note, at present, updateQRZ(X, Y, M) is not optimised for accessing +contiguous locations.

+

If you have carried out QRZ transforms on two blocks of data, X1, X2, +(same number of columns in each) with the data to be fitted in Y1, +Y2, you can combine them as follows

+
    // QRZ transforms of two blocks of data
+    UpperTriangularMatrix U1, U2; Matrix M1, M2;
+    QRZ(X1, U1); QRZ(X2, U2); QRZ(X1, Y1, M1); QRZ(X2, Y2, M2);
+
+    // Now combine the results
+    updateQRZ(U1, U2); updateQRZ(U1, M1, M2);
+

Results are in U2 and M2. The values in U1 and +M1 are modified so use copies if you still need the original values.

+

The functions updateQRZ(U1, U2) and updateQRZ(U1, M1, M2) +are not optimised for accessing contiguous locations. +This is probably not an issue, since usually all the data will fit into cache +memory. 

+

Notes on updateQRZ and updateQRZT:

+
    +
  • Use these routines if your data is arriving in blocks or there is too much to +fit into memory.
  • +
  • Use QRZ or QRZT on the first block of data or you can use + updateQRZ or +updateQRZT if U or L is correctly dimensioned and set to zero.
  • +
  • The block of data, X, will be modified by these routines but the +modified data is probably not useful for further analysis.
  • +
  • The signs of some of the rows of U or columns of L maybe the reverse of what you would +expect (i.e. you get the negative of what you get from QRZ or QRZT applied to + the whole dataset). Usually this will not be a problem.
  • +
  • The second version of updateQRZ is sometimes a more useful way of + combining blocks, especially if you want to use the reduce function + in Intel's Threaded Building Blocks to parallelise QRZ. (Contact me + for what you need to do to make Newmat compatible with Threaded Building + Blocks).
  • +
  • See the function summary list for the older +depreciated function names.
  • +
+

 

+

3.21 Singular value +decomposition

+

next - skip - +up - start

+

The singular value decomposition of an m x n Matrix +A (where m >= n) is a decomposition

+
    A  = U * D * V.t()
+
+ +

where U is m x n with U.t() * U equalling +the identity, D is an n x n DiagonalMatrix and +V is an n x n orthogonal matrix (type Matrix in +Newmat).

+

Singular value decompositions are useful for understanding the structure of +ill-conditioned matrices, solving least squares problems, and for finding the +eigenvalues of A.t() * A.

+

To calculate the singular value decomposition of A (with m +>= n) use one of

+
    SVD(A, D, U, V);                  // U = A is OK
+    SVD(A, D);
+    SVD(A, D, U);                     // U = A is OK
+    SVD(A, D, U, false);              // U (can = A) for workspace only
+    SVD(A, D, U, V, false);           // U (can = A) for workspace only
+
+ +

where A, U and V are of type Matrix and +D is a DiagonalMatrix. The values of A are not +changed unless A is also inserted as the third argument.

+ +

The elements of D are sorted in descending order.

+ +

To extend U to a square orthogonal matrix see the function for +extending an orthonormal set of columns.

+

Remember that the SVD decomposition is not completely unique. The signs of the elements in a column of U may be reversed +if the signs in the corresponding column in V are reversed. If a +number of the singular values are identical one can apply an orthogonal +transformation to the corresponding columns of U and the corresponding +columns of V.

+

If m < n apply the SVD transform to the transpose +of A and swap U and V. If necessary, extend U to a square matrix as described +above.

+

3.22 Eigenvalue +decomposition

+

next - skip - +up - start

+

An eigenvalue decomposition of a SymmetricMatrix A is a +decomposition

+
    A  = V * D * V.t()
+
+ +

where V is an orthogonal matrix (type Matrix in +Newmat) and D is a DiagonalMatrix.

+

Eigenvalue analyses are used in a wide variety of engineering, statistical +and other mathematical analyses.

+

The package includes two algorithms: Jacobi and Householder. The first is +extremely reliable but much slower than the second.

+

The code is adapted from routines in Handbook for Automatic Computation, +Vol II, Linear Algebra by Wilkinson and Reinsch, published by Springer +Verlag.

+
    Jacobi(A,D,S,V);                  // A, S symmetric; S is workspace,
+                                      //    S = A is OK; V is a matrix
+    Jacobi(A,D);                      // A symmetric
+    Jacobi(A,D,S);                    // A, S symmetric; S is workspace,
+                                      //    S = A is OK
+    Jacobi(A,D,V);                    // A symmetric; V is a matrix
+
+    eigenvalues(A,D);                 // A symmetric
+    eigenvalues(A,D,S);               // A, S symmetric; S is for back
+                                      //    transforming, S = A is OK
+    eigenvalues(A,D,V);               // A symmetric; V is a matrix
+
+ +

where A, S are of type SymmetricMatrix, +D is of type DiagonalMatrix and V is of type +Matrix. The values of A are not changed unless A is +also inserted as the third argument. If you need eigenvectors use one of the +forms with matrix V. The eigenvectors are returned as the columns of +V.

+ +

The elements of D are sorted in ascending order.

+

Remember that an eigenvalue decomposition is not completely +unique - see the comments about the SVD +decomposition.

+

See the function summary list for the older +depreciated function names.

+

3.23 Sorting

+

next - skip - +up - start

+

To sort the values in a matrix or vector, A, (in general this +operation makes sense only for vectors and diagonal matrices) use one of

+
    sort_ascending(A);
+
+    sort_descending(A);
+
+ +

I use the quicksort algorithm. The algorithm is similar to that in +Sedgewick's algorithms in C++. If the sort seems to be failing (as quicksort +can do) an exception is thrown.

+

You will get incorrect results if you try to sort a band matrix - but why +would you want to sort a band matrix?

+

See the function summary list for the older +depreciated function names.

+

3.24 Fast Fourier transform +

+

next - skip - +up - start

+
   FFT(X, Y, F, G);                         // F=X and G=Y are OK
+
+ +

where X, Y, F, G are ColumnVectors. +X and Y are the real and imaginary input vectors; F +and G are the real and imaginary output vectors. The lengths of +X and Y must be equal and should be the product of numbers +less than about 10 for fast execution.

+

The formula is

+
          n-1
+   h[k] = SUM  z[j] exp (-2 pi i jk/n)
+          j=0
+
+ +

where z[j] is stored complex and stored in X(j+1) and +Y(j+1). Likewise h[k] is complex and stored in +F(k+1) and G(k+1). The fast Fourier algorithm takes order +n log(n) operations (for good values of n) rather than +n**2 that straight evaluation (see the file tmtf.cpp) takes. +

+

I use one of two methods:

+
    +
  • A program originally written by Sande and Gentleman. This requires that +n can be expressed as a product of small numbers.
  • +
  • A method of Carl de Boor (1980), Siam J Sci Stat Comput, pp 173-8. +The sines and cosines are calculated explicitly. This gives better accuracy, at +an expense of being a little slower than is otherwise possible. This is slower +than the Sande-Gentleman program but will work for all n --- although it +will be very slow for bad values of n.
  • +
+

Related functions

+
   FFTI(F, G, X, Y);                        // X=F and Y=G are OK
+   RealFFT(X, F, G);
+   RealFFTI(F, G, X);
+
+ +

FFTI is the inverse transform for FFT. RealFFT is +for the case when the input vector is real, that is Y = 0. I assume +the length of X, denoted by n, is even. That is, +n must be divisible by 2. The program sets the lengths of F and +G to n/2 + 1. RealFFTI is the inverse of +RealFFT.

+

See also the section on fast trigonometric +transforms.

+

There are also two dimensional versions

+
   FFT2(X, Y, F, G);                       // F=X and G=Y are OK
+   FFT2I(F, G, X, Y);                      // inverse, X=F and Y=G are OK
+

where X, Y, F, G are of type Matrix. +X and Y are the real and imaginary input matrices; F +and G are the real and imaginary output matrices. The dimensions of Y +must be the same as those of X and should be the product of numbers +less than about 10 for fast execution.

+

The formula is

+
            m-1 n-1
+   h[p,q] = SUM SUM z[j,k] exp (-2 pi i (jp/m + kq/n))
+            j=0 k=0
+
+ +

where z[j,k] is stored complex and stored in X(j+1,k+1) and +Y(j+1,k+1) and X and Y have dimension m x n. Likewise h[p,q] is complex and stored in +F(p+1,q+1) and G(p+1,q+1). +

+

 

+

3.25 Fast trigonometric +transforms

+

next - skip - +up - start

+

These are the sin and cosine transforms as defined by Charles Van Loan +(1992) in Computational frameworks for the fast Fourier transform +published by SIAM. See page 229. Some other authors use slightly different +conventions. All the functions call the fast Fourier +transforms and require an even transform length, denoted by +m in these notes. That is, m must be divisible by 2. As with the +FFT m should be the product of numbers less than about 10 for fast +execution.

+

The functions I define are

+
   DCT(U,V);                // U, V are ColumnVectors, length m+1
+   DCT_inverse(V,U);        // inverse of DCT
+   DST(U,V);                // U, V are ColumnVectors, length m+1
+   DST_inverse(V,U);        // inverse of DST
+   DCT_II(U,V);             // U, V are ColumnVectors, length m
+   DCT_II_inverse(V,U);     // inverse of DCT_II
+   DST_II(U,V);             // U, V are ColumnVectors, length m
+   DST_II_inverse(V,U);     // inverse of DST_II
+
+ +

where the first argument is the input and the second argument is the output. +V = U is OK. The length of the output ColumnVector is set by the +functions.

+

Here are the formulae:

+

DCT

+
                   m-1                             k
+   v[k] = u[0]/2 + SUM { u[j] cos (pi jk/m) } + (-) u[m]/2
+                   j=1
+
+ +

for k = 0...m, where u[j] and v[k] are stored in +U(j+1) and V(k+1).

+

DST

+
          m-1
+   v[k] = SUM { u[j] sin (pi jk/m) }
+          j=1
+
+ +

for k = 1...(m-1), where u[j] and v[k] are stored +in U(j+1) and V(k+1)and where u[0] and u[m] +are ignored and v[0] and v[m] are set to zero. For the +inverse function v[0] and v[m] are ignored and u[0] +and u[m] are set to zero.

+

DCT_II

+
          m-1
+   v[k] = SUM { u[j] cos (pi (j+1/2)k/m) }
+          j=0
+
+ +

for k = 0...(m-1), where u[j] and v[k] are stored +in U(j+1) and V(k+1).

+

DST_II

+
           m
+   v[k] = SUM { u[j] sin (pi (j-1/2)k/m) }
+          j=1
+
+ +

for k = 1...m, where u[j] and v[k] are stored in +U(j) and V(k).

+

Note that the relationship between the subscripts in the formulae and those +used in newmat is different for DST_II (and DST_II_inverse).

+

3.26 Interface to Numerical +Recipes in C

+

next - skip - +up - start

+

This section refers to Numerical Recipes in C. This section is not +relevant to Numerical Recipes in C++. I'll put a note on the website soon +on how to interface with Numerical Recipes in C++.

+

This package can be used with the vectors and matrices defined in +Numerical Recipes in C. You need to edit the routines in Numerical +Recipes so that the elements are of the same type as used in this package. Eg +replace float by double, vector by dvector and matrix by dmatrix, etc. You may +need to edit the function definitions to use the version acceptable to your +compiler (if you are using the first edition of NRIC). You may need to enclose +the code from Numerical Recipes in extern "C" { ... }. You +will also need to include the matrix and vector utility routines.

+

Then any vector in Numerical Recipes with subscripts starting from 1 in a +function call can be accessed by a RowVector, ColumnVector or DiagonalMatrix in +the present package. Similarly any matrix with subscripts starting from 1 can +be accessed by an nricMatrix in the present package. The class nricMatrix is +derived from Matrix and can be used in place of Matrix. In each case, if you +wish to refer to a RowVector, ColumnVector, DiagonalMatrix or nricMatrix +X in an function from Numerical Recipes, use X.nric() in the +function call.

+

Numerical Recipes cannot change the dimensions of a matrix or vector. So +matrices or vectors must be correctly dimensioned before a Numerical Recipes +routine is called.

+

For example

+
   SymmetricMatrix B(44);
+   .....                             // load values into B
+   nricMatrix BX = B;                // copy values to an nricMatrix
+   DiagonalMatrix D(44);             // Matrices for output
+   nricMatrix V(44,44);              //    correctly dimensioned
+   int nrot;
+   jacobi(BX.nric(),44,D.nric(),V.nric(),&nrot);
+                                     // jacobi from NRIC
+   cout << D;                        // print eigenvalues
+
+ +

3.27 Exceptions

+

next - skip - +up - start

+

Here is the class structure for exceptions:

+
Exception
+  Logic_error
+    ProgramException                 miscellaneous matrix error
+    IndexException                   index out of bounds
+    VectorException                  unable to convert matrix to vector
+    NotSquareException               matrix is not square (invert, solve)
+    SubMatrixDimensionException      out of bounds index of submatrix
+    IncompatibleDimensionsException  (multiply, add etc)
+    NotDefinedException              operation not defined (eg <)
+    CannotBuildException             copying a matrix where copy is undefined
+    InternalException                probably an error in newmat
+  Runtime_error
+    NPDException                     matrix not positive definite (Cholesky)
+    ConvergenceException             no convergence (e-values, non-linear, sort)
+    SingularException                matrix is singular (invert, solve)
+    SolutionException                no convergence in solution routine
+    OverflowException                floating point overflow
+  Bad_alloc                          out of space (new fails)
+
+ +

I have attempted to mimic the exception class structure in the C++ standard +library, by defining the Logic_error and Runtime_error classes.

+

Suppose you have edited include.h to use my simulated +exceptions or to disable exceptions. If there is no catch statement or exceptions are disabled then my +Terminate() function in myexcept.h is called when you throw an +exception. This prints out +an error message, the dimensions and types of the matrices involved, the name +of the routine detecting the exception, and any other information set by the +Tracer class. Also see the section on error messages for additional notes on the messages generated +by the exceptions.

+

You can also print this information in a catch clause by printing Exception::what(). +

+

If you are using compiler supported exceptions then see the section +on catching exceptions.  +

+

See the file test_exc.cpp as an example of catching an exception +and printing the error message.

+

The 08 version of newmat defined a member function void +SetAction(int) to help customise the action when an exception is called. +This has been deleted in the 09 and later versions. Now include an instruction +such as cout << Exception::what() << endl; in the +Catch or CatchAll block to determine the action.

+

The library includes the alternatives of using the inbuilt exceptions +provided by a compiler, simulating exceptions, or disabling exceptions. See +customising for selecting the correct exception option. +

+

The rest of this section describes my partial simulation of exceptions for +compilers which do not support C++ exceptions. Skip the rest of this section and +the next section if you are using compiler supported exceptions. I use Carlos Vidal's article in +the September 1992 C Users Journal as a starting point.

+

Newmat does a partial clean up of memory following throwing an exception - +see the next section. However, the present version will leave a little heap +memory unrecovered under some circumstances. I would not expect this to be a +major problem, but it is something that needs to be sorted out.

+

The functions/macros I define are Try, Throw, Catch, CatchAll and +CatchAndThrow. Try, Throw, Catch and CatchAll correspond to try, throw, catch +and catch(...) in the C++ standard. A list of Catch clauses must be terminated +by either CatchAll or CatchAndThrow but not both. Throw takes an Exception as +an argument or takes no argument (for passing on an exception). I do not have a +version of Throw for specifying which exceptions a function might throw. Catch +takes an exception class name as an argument; CatchAll and CatchAndThrow don't +have any arguments. Try, Catch and CatchAll must be followed by blocks enclosed +in curly brackets.

+

I have added another macro ReThrow to mean a rethrow, Throw(). This was +necessary to enable the package to be compatible with both my exception package +and C++ exceptions.

+

If you want to throw an exception, use a statement like

+
   Throw(Exception("Error message\n"));
+
+ +

It is important to have the exception declaration in the Throw statement, +rather than as a separate statement.

+

All exception classes must be derived from the class, Exception, defined in +newmat and can contain only static variables. See the examples in newmat if you +want to define additional exceptions.

+

Note that the simulation exception mechanism does not work if you define +arrays of matrices.

+

3.28 Cleanup after an +exception

+

next - skip - +up - start

+

This section is about the simulated exceptions used in newmat. It is +irrelevant if you are using the exceptions built into a compiler or have set +the disable-exceptions option.

+

The simulated exception mechanisms in newmat are based on the C functions +setjmp and longjmp. These functions do not call destructors so can lead to +garbage being left on the heap. (I refer to memory allocated by new as +heap memory). For example, when you call

+
   Matrix A(20,30);
+
+ +

a small amount of space is used on the stack containing the row and column +dimensions of the matrix and 600 doubles are allocated on the heap for the +actual values of the matrix. At the end of the block in which A is declared, +the destructor for A is called and the 600 doubles are freed. The locations on +the stack are freed as part of the normal operations of the stack. If you leave +the block using a longjmp command those 600 doubles will not be freed and will +occupy space until the program terminates.

+

To overcome this problem newmat keeps a list of all the currently declared +matrices and its exception mechanism will return heap memory when you do a +Throw and Catch.

+

However it will not return heap memory from objects from other packages. +

+

If you want the mechanism to work with another class you will have to do +four things:

+
    +
  1. derive your class from class Janitor defined in except.h;
  2. +
  3. define a function void CleanUp() in that class to return all heap +memory;
  4. +
  5. include the following lines in the class definition
          public:
    +         void* operator new(size_t size)
    +         { do_not_link=true; void* t = ::operator new(size); return t; }
    +         void operator delete(void* t) { ::operator delete(t); }
    +
    + +
  6. +
  7. be sure to include a copy constructor in you class definition, that is, +something like
          X(const X&);
    +
    + +
  8. +
+

Use CleanUp() rather than cleanup() since this is what is +defined in class Janitor.

+

Note that the function CleanUp() does somewhat the same duties as +the destructor. However CleanUp() has to do the cleaning for +the class you are working with and also the classes it is derived from. So it +will often be wrong to use exactly the same code for both CleanUp() +and the destructor or to define your destructor as a call to +CleanUp().

+

3.29 Non-linear +applications

+

next - skip - +up - start

+

Files solution.h, solution.cpp contain a class for solving for x in +y = f(x) where x is a one-dimensional continuous +monotonic function. This is not a matrix thing at all but is included because +it is a useful program and because it is a simpler version of the coding technique used +in the non-linear least squares.

+

Files newmatnl.h, newmatnl.cpp contain a series of classes for non-linear +least squares and maximum likelihood. These classes work on very well-behaved +functions but need upgrading for less well-behaved functions. I haven't followed +the usual practice of inflating the values of the diagonal elements of the +matrix of second derivatives. I originally thought I could avoid this if my +program had a good line search. But this was wrong and when I use this program +on all but the most well-behaved problems I run the fit first with the diagonal +elements inflated by a factor of 2 to 5 and the critical value for the stopping +criterion set to something like 50. Then rerun with with no inflation factor and +critical value 0.0001.

+

Documentation for both of these is in the definition files. Simple examples +are in sl_ex.cpp, nl_ex.cpp and garch.cpp.

+

3.30 Standard template +library

+

next - skip - +up - start

+

The standard template library (STL) is the set of container templates +(vector, deque, list etc) defined by the C++ standards committee. Newmat is +intended to be compatible with the STL in the sense that you can store matrices +in the standard containers. I have defined == and +inequality operators which seem to be required by some versions of the STL.

+

If you want to use the container classes with Newmat please note

+
    +
  • Don't use simulated exceptions.
  • +
  • Make sure the option DO_FREE_CHECK is not +turned on.
  • +
  • You can store only one type of matrix in a container. If you want to use a +variety of types use the GenericMatrix type or store pointers to the matrices. +
  • +
  • The vector and deque container templates like to copy their elements. For +the vector container this happens when you insert an element anywhere except at +the end or when you append an element and the current vector storage overflows. +Since Newmat does not have copy-on-write this could get very inefficient.
  • +
  • You won't be able to sort the container or do anything that would call an +inequality operator.
  • +
+

3.31 Namespace

+

next - skip - +up - start

+

Namespace is used to avoid name +clashes between different libraries. I have included the namespace capability. +Activate the line #define use_namespace in include.h. Then +include either the statement

+
   using namespace NEWMAT;
+
+ +

at the beginning of any file that needs to access the newmat library or

+
   using namespace RBD_LIBRARIES;
+
+ +

at the beginning of any file that needs to access all my libraries.

+

This works correctly with Borland C++ version 5 and +Builder 5 and 6.

+

Microsoft Visual C++ version 5 works in my example +and test files, but fails with apparently insignificant changes (it may be more +reliable if you have applied service pack 3). If you #include +"newmatap.h", but no other newmat include file, then also #include +"newmatio.h". It seems to work with Microsoft +Visual C++ version 6 if you have applied at least service pack 2.

+

My use of namespace does not work with Gnu g++ version +2.8.1 but does work with versions 3.x.

+

I have defined the following namespaces:

+
    +
  • RBD_COMMON for functions and classes used by most of my libraries
  • +
  • NEWMAT for the newmat library
  • +
  • RBD_LIBRARIES for all my libraries
  • +
+

3.32 Updating the Cholesky matrix

+ + +

next - skip - +up - start

+ + +

Suppose X is matrix and U has been formed with either

+ + +
   SymmetricMatrix A; A << X.t() * X;
+   UpperTriangularMatrix U = Cholesky(A).t();
+

or

+
   UpperTriangularMatrix U;
+   QRZ(X, U);
+

See sections 3.19 and 3.20.

+

Now suppose we want to append an extra row to X or delete a row from X +or rearrange the columns of X. The functions described here allow you to +update U without  recalculating it.

+ + +
   update_Cholesky(U, x);                    // x is a RowVector
+   downdate_Cholesky(U, x);                  // x is a RowVector
+   right_circular_update_Cholesky(U, j, k);  // j and k are integers
+   left_circular_update_Cholesky(U, j, k);   // j and k are integers
+

update_Cholesky carries out the modification of U corresponding to appending +an extra row x to X.

+ + +

downdate_Cholesky carries out the modification corresponding +to removing a row x from X. A ProgramException exception is +thrown if the modification fails.

+ + +

right_circular_update_Cholesky supposes that columns j,j+1,...k of X are +replaced by columns k,j,j+1,...k-1.

+ + +

left_circular_update_Cholesky supposes that columns j,j+1,...k of X are replaced +by columns j+1,...k,j.

+ + +

These functions are based on a contribution from Nick Bennett of +Schlumberger-Doll Research. See also the LINPACK User's Guide, Chapter 10, +Dongarra et. al., SIAM, Philadelphia, 1979.

+ + +

Where you want to append a number of new rows consider using the update +routine in section 3.20.

+ + +

See the function summary list for the older +depreciated function names.

+ + +

3.33 Accessing C functions

+ + +

next - skip - +up - start

+ + +

You have a C function that uses one and two dimensional arrays as +vectors and matrices. You want to access it from Newmat.

+ + +

One dimensional arrays are easy. Set up a ColumnVector, RowVector +or DiagonalMatrix with the correct dimension and where the function has a +double* argument enter X.data() where X denotes the +ColumnVector, RowVector or DiagonalMatrix. (I am assuming you +have left Real being typedefed as a double). If you have a +const double* argument use X.const_data().

+ + +

You can't do this with two dimensional arrays where you have a double** +argument. Newmat includes classes RealStarStar and ConstRealStarStar for this situation. +To access a Matrix A from a function c_function(double** a) +use either

+ + +
   c_function(RealStarStar(A));
+

or

+
   RealStarStar a(A);
+   c_function(a);
+

If the argument is const double** use ConstRealStarStar.

+ + +

The Matrix A must be correctly dimensioned and must not be +resized or set equal to another matrix between setting up the RealStarStar +object and its use in the function. Also the following construction will not +work

+ + +
   double** a = RealStarStar(A);      // wrong
+   c_function(a);
+

since the RealStarStar structure will have been destroyed before you +get to the second line.

+ + +

3.34 Simple integer array class

+ + +

next - skip - +up - start

+ + +

This is primarily for use within Newmat. You can set up a simple array +of integers with the SimpleIntArray class. Here are the descriptions of +the constructors and functions.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SimpleIntArray A; Constructs int array of length zero
SimpleIntArray A(n); Constructs int array of length n - +individual elements are not initialised
A = i; sets values to i where i is an int +variable
A = B; sets values to those of B where +B is +a SimpleIntArray, change size if necessary.
n = A.size(); return the length of A
A.resize(n); change the length of A, don't keep +values
A.resize_keep(n); change the length of A, do keep +values; if length is being increased set new elements to zero.
int x = A[i]; element access; i runs from 0 to +n-1
int* d = A.data(); get beginning of data array
const int* d = A.data(); get beginning of data array as const +int* if A is const
const int* d = A.const_data(); get beginning of data array as const +int*
A.cleanup() resize to zero length
+ + 

3.35 + +Extend orthonormal set of columns

+

next - skip - +up - start

+

Suppose a Matrix A's first n columns are orthonormal so that +A.Columns(1,n).t() * A.Columns(1,n) is the identity matrix. Suppose +we want to fill out the remaining columns of A to make them orthonormal so +that A.t() * A is the identity matrix. Then use the function

+
   extend_orthonormal(A, n);
+

Matrix A is then replaced by the matrix with the additional +columns.

+

Use this function to extend U from the QRZ or +SVD decompositions to form a square (orthogonal) matrix.

+

Notes:

+
    +
  • the first n columns of A must be orthonormal
  • +
  • n must be less or equal to the number of columns of A
  • +
  • the number of columns of A must be less than or equal to the number of + rows of A
  • +
+ +

3.36 Miscellaneous functions

+

next - skip - +up - start

+

The section includes some miscellaneous functions I have needed for my work. So +far there are only the Helmert transforms.

+

Helmert transforms

+

This section refers to the Helmert transform used in some statistical +packages for extracting contrasts. It is different from the Helmert transform +used in geodesy. The version of the transform I am going to use is based on the +n x n matrix

+
| 1/sqrt(1*2)                       | * | -1  1              |
+|     1/sqrt(2*3)                   |   | -1 -1  2           |
+|          1/sqrt(3*4)              |   | -1 -1 -1  3        |
+|               ...                 |   |  ...               |
+|                  1/(sqrt(n-1)*n)  |   | -1 -1  ...  -1 n-1 |
+|                         1/sqrt(n) |   |  1  1  ...       1 | 
+

You can interpret multiplying a column vector by this matrix as follows. Form +the k-th element in the resulting column vector by taking the k+1-th +element and subtracting the average of the previous k elements. Then +multiply by sqrt((k+1)/k) so we get an orthonormal transform. The +last element is just the sum divided by sqrt(n). Usually one will omit +the last element since we want just the contrasts.

+

Here are the functions. X and Y are ColumnVectors, A +and B are matrices, b is a boolean, j, n are +integers, x is a Real.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
A = Helmert(n, b);
+A = Helmert(n);
Return the n x n +Helmert matrix or the (n-1) x n version with the last row omitted.
Y = Helmert(X,b);
+Y = Helmert(X);
Multiply by the Helmert matrix.
Y = Helmert(n,j,b);
+Y = Helmert(n,j);
Return j-th column of Helmert +matrix as a ColumnVector.
X = Helmert_transpose(Y,b);
+X = Helmert_transpose(Y);
Multiply by the transpose of the +Helmert matrix.
x = Helmert_transpose(Y,j,b);
+x = Helmert_transpose(Y,j);
Multiply by the transpose of the +Helmert matrix, return just the j-th element.
B = Helmert(A,b);
+B = Helmert(A);
Multiply a Matrix by the Helmert +matrix.
A = Helmert_transpose(B,b);
+A = Helmert_transpose(B);
Multiply a Matrix by the transpose of +the Helmert matrix.
+ +

If b is true the full Helmert matrix is used, if it is false or +omitted the n-th row (or n-column of the transpose) is omitted.

+

 

+ +

4. Error messages

+

next - skip - +up - start

+

Most error messages are self-explanatory. The message gives the size of the +matrices involved. Matrix types are referred to by the following codes:

+
   Matrix or vector                   Rect
+   Symmetric matrix                   Sym
+   Band matrix                        Band
+   Symmetric band matrix              SmBnd
+   Lower triangular matrix            LT
+   Lower triangular band matrix       LwBnd
+   Upper triangular matrix            UT
+   Upper triangular band matrix       UpBnd
+   Diagonal matrix                    Diag
+   Crout matrix (LU matrix)           Crout
+   Band LU matrix                     BndLU
+
+ +

Other codes should not occur.

+

See the section on exceptions for more details on the +structure of the exception classes.

+

I have defined a class Tracer that is intended to help locate the place +where an error has occurred. At the beginning of a function I suggest you +include a statement like

+
   Tracer tr("name");
+
+ +

where name is the name of the function. This name will be printed as part of +the error message, if an exception occurs in that function, or in a function +called from that function. You can change the name as you proceed through a +function with the ReName function

+
   tr.ReName("new name");
+
+ +

if, for example, you want to track progress through the function.

+

5. Notes on the design of the +library

+

next - skip - +up - start

+ + + + + +
5.1 +Safety, usability, efficiency
+5.2 Matrix vs array library
+5.3 Design questions
+5.4 Data storage
+5.5 Memory management - 1
+5.6 Memory management - 2
+5.7 Evaluation of expressions
5.8 Explosion in the number of operations
+5.9 Destruction of temporaries
+5.10 A calculus of matrix types
+5.11 Pointer arithmetic
+5.12 Error handling
+5.13 Sparse matrices
+5.14 Complex matrices
+

I describe some of the ideas behind this package, some of the decisions that +I needed to make and give some details about the way it works. You don't need +to read this part of the documentation in order to use the package.

+

It isn't obvious what is the best way of going about structuring a matrix +package. I don't think you can figure this out with thought experiments. +Different people have to try out different approaches. And someone else may +have to figure out which is best. Or, more likely, the ultimate packages will +lift some ideas from each of a variety of trial packages. So, I don't claim my +package is an ultimate package, but simply a trial of a number of ideas. +The following pages give some background on these ideas.

+

5.1 Safety, usability, +efficiency

+

next - skip - +up - start

+

Some general comments

+

A library like newmat needs to balance safety, +usability and efficiency.

+

By safety, I mean getting the right answer, and not causing crashes +or damage to the computer system.

+

By usability, I mean being easy to learn and use, including not being +too complicated, being intuitive, saving the users' time, being nice to use. +

+

Efficiency means minimising the use of computer memory and time.

+

In the early days of computers the emphasis was on efficiency. But computer +power gets cheaper and cheaper, halving in price every 18 months. On the other +hand the unaided human brain is probably not a lot better than it was 100,000 +years ago! So we should expect the balance to shift to put more emphasis on +safety and usability and a little less on efficiency. So I don't mind if my +programs are a little less efficient than programs written in pure C (or +Fortran) if I gain substantially in safety and usability. But I would mind if +they were a lot less efficient.

+

Type of use

+

Second reason for putting extra emphasis on safety and usability is the way +I and, I suspect, most other users actually use newmat. Most completed +programs are used only a few times. Some result is required for a client, paper +or thesis. The program is developed and tested, the result is obtained, and the +program archived. Of course bits of the program will be recycled for the next +project. But it may be less usual for the same program to be run over and over +again. So the cost, computer time + people time, is in the development time and +often, much less in the actual time to run the final program. So good use of +people time, especially during development is really important. This means you +need highly usable libraries.

+

So if you are dealing with matrices, you want the good interface that I have +tried to provide in newmat, and, of course, reliable methods underneath +it.

+

Of course, efficiency is still important. We often want to run the biggest +problem our computer will handle and often a little bigger. The C++ language +almost lets us have both worlds. We can define a reasonably good interface, and +get good efficiency in the use of the computer.

+

Levels of access

+

We can imagine the black box model of a newmat. Suppose the +inside is hidden but can be accessed by the methods described in the +reference section. Then the interface is reasonably +consistent and intuitive. Matrices can be accessed and manipulated in much the +same way as doubles or ints in regular C. All accesses are checked. It is most +unlikely that an incorrect index will crash the system. In general, users do +not need to use pointers, so one shouldn't get pointers pointing into space. +And, hopefully, you will get simpler code with less errors.

+

There are some exceptions to this. In particular, the C-like subscripts are not checked for validity. They give +faster access but with a lower level of safety.

+

Then there is the data() function which takes you to +the data array within a matrix. This takes you right inside the black +box. But this is what you have to use if you are writing, for example, a +new matrix factorisation, and require fast access to the data array. I have +tried to write code to simplify access to the interior of a rectangular matrix, +see file newmatrm.cpp, but I don't regard this as very successful, as yet, and +have not included it in the documentation. Ideally we should have improved +versions of this code for each of the major types of matrix. But, in reality, +most of my matrix factorisations are written in what is basically the C +language with very little C++.

+

So our box is not very black. You have a choice of how far you +penetrate. On the outside you have a good level of safety, but in some cases +efficiency is compromised a little. If you penetrate inside the box +safety is reduced but you can get better efficiency.

+

Some performance data

+

This section looks at the performance on newmat for simple sums, +comparing it with C code and with a simple array program. +(This is now very old data).

+

The following table lists the time (in seconds) for carrying out the +operations X=A+B;, X=A+B+C;, X=A+B+C+D;, X=A+B+C+D+E; where +X,A,B,C,D,E are of type ColumnVector, with a variety of programs. I am +using Microsoft VC++, version 6 in console mode under windows 2000 on a PC with +a 1 ghz Pentium III and 512 mbytes of memory.

+
    length    iters. newmat      C C-res.  subs.  array
+X = A + B
+         2   5000000   27.8    0.3    8.8    1.9    9.5 
+        20    500000    3.0    0.3    1.1    1.9    1.2 
+       200     50000    0.5    0.3    0.4    1.9    0.3 
+      2000      5000    0.4    0.3    0.4    2.0    1.0 
+     20000       500    4.5    4.5    4.5    6.7    4.4 
+    200000        50    5.2    4.7    5.5    5.8    5.2 
+
+X = A + B + C
+         2   5000000   36.6    0.4    8.9    2.5   12.2 
+        20    500000    4.0    0.4    1.2    2.5    1.6 
+       200     50000    0.8    0.3    0.5    2.5    0.5 
+      2000      5000    3.6    4.4    4.6    9.0    4.4 
+     20000       500    6.8    5.4    5.4    9.6    6.8 
+    200000        50    8.6    6.0    6.7    7.1    8.6 
+
+X = A + B + C + D
+         2   5000000   44.0    0.7    9.3    3.1   14.6 
+        20    500000    4.9    0.6    1.5    3.1    1.9 
+       200     50000    1.0    0.6    0.8    3.2    0.8 
+      2000      5000    5.6    6.6    6.8   11.5    5.9 
+     20000       500    9.0    6.7    6.8   11.0    8.5 
+    200000        50   11.9    7.1    7.9    9.5   12.0 
+
+X = A + B + C + D + E
+         2   5000000   50.6    1.0    9.5    3.8   17.1 
+        20    500000    5.7    0.8    1.7    3.9    2.4 
+       200     50000    1.3    0.9    1.0    3.9    1.0 
+      2000      5000    7.0    8.3    8.2   13.8    7.1 
+     20000       500   11.5    8.1    8.4   13.2   11.0 
+    200000        50   15.2    8.7    9.5   12.4   15.4 
+
+

I have graphed the results +and included rather more array lengths.

+ +

The first column gives the lengths of the arrays, the second the number of +iterations and the remaining columns the total time required in seconds. If the +only thing that consumed time was the double precision addition then the +numbers within each block of the table would be the same. The summation is +repeated 5 times within each loop, for example:

+
   for (i=1; i<=m; ++i)
+   {
+      X1 = A1+B1+C1; X2 = A2+B2+C2; X3 = A3+B3+C3;
+      X4 = A4+B4+C4; X5 = A5+B5+C5;
+   }
+

The column labelled newmat is using the standard newmat add. The column labelled C uses the usual C method: while +(j1--) *x1++ = *a1++ + *b1++; . The following column also includes an +X.resize() in the outer loop to correspond to the reassignment of +memory that newmat would do. In the next column the calculation is using +the usual C style for loop +and accessing the elements using newmat subscripts such as +A(i). The final column is the time taken by a +simple array package. This uses an alternative method for avoiding temporaries +and unnecessary copies that does not involve runtime tests. It does its sums in blocks of 4 and copies in blocks of +8 in the same way that newmat does.

+

Here are my conclusions.

+
    +
  • Newmat does very badly for length 2 and doesn't do well for +length 20. There is a lot of code in newmat for +determining which sum algorithm to use and it is not surprising that this +impacts on performance for small lengths. +However the array program is also having difficulty with length 2 so it +is unlikely that the problem could be completely eliminated.
  • +
  • For arrays of length 2000 or longer newmat is doing about as well as +C and slightly better than C with resize in the X=A+B table. For the +other two tables it tends to be slower, but not dramatically so.
  • +
  • It is really important for fast processing with the Pentium III to stay +within the Pentium cache.
  • +
  • Addition using the newmat subscripts, while considerably slower than +the others, is still surprisingly good for the longer arrays.
  • +
  • The array program and newmat are similar for +lengths 2000 or higher (the longer times for the array program for the longest +arrays shown on the graph are probably a quirk of the timing program).
  • +
+

In summary: for the situation considered here, newmat is doing very +well for large ColumnVectors, even for sums with several terms, but not so well +for shorter ColumnVectors.

+

5.2 Matrix vs array +library

+

next - skip - +up - start

+

The newmat library is for the manipulation of matrices, including the +standard operations such as multiplication as understood by numerical analysts, +engineers and mathematicians.

+

A matrix is a two dimensional array of numbers. However, very special +operations such as matrix multiplication are defined specifically for matrices. +This means that a matrix library, as I understand the term, is different +from a general array library. Here are some contrasting properties.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureMatrix +libraryArray +library
ExpressionsMatrix expressions; +* means matrix multiply; inverse functionArithmetic operations, if +supported, mean elementwise combination of arrays
Element accessAccess to the elements of a +matrixHigh speed access to elements +directly and perhaps with iterators
Elementary functionsFor example: determinant, +traceMatrix multiplication as a +function
Advanced functionsFor example: eigenvalue +analysis 
Element typesReal and possibly +complexWide range - real, integer, string +etc
TypesRectangular, symmetric, diagonal, +etcOne, two and three dimensional +arrays, at least
+

Both types of library need to support access to sub-matrices or sub-arrays, +have good efficiency and storage management, and graceful exit for errors. In +both cases, we probably need two versions, one optimised for large matrices or +arrays and one for small matrices or arrays.

+

It may be possible to amalgamate the two sets of requirements to some +extent. However newmat is definitely oriented towards the matrix library +set.

+

5.3 Design questions

+

next - skip - +up - start

+

Even within the bounds set by the requirements of a matrix library there is +a substantial opportunity for variation between what different matrix packages +might provide. It is not possible to build a matrix package that will meet +everyone's requirements. In many cases if you put in one facility, you impose +overheads on everyone using the package. This both in storage required for the +program and in efficiency. Likewise a package that is optimised towards +handling large matrices is likely to become less efficient for very small +matrices where the administration time for the matrix may become significant +compared with the time to carry out the operations. It is better to provide a +variety of packages (hopefully compatible) so that most users can find one that +meets their requirements. This package is intended to be one of these packages; +but not all of them.

+

Since my background is in statistical methods, this package is oriented +towards the kinds things you need for statistical analyses.

+

Now looking at some specific questions.

+

What size of matrices?

+

A matrix library may target small matrices (say 3 x 3), or medium sized +matrices, or very large matrices.

+

A library targeting very small matrices will seek to minimise +administration. A library for medium sized or very large matrices can spend +more time on administration in order to conserve space or optimise the +evaluation of expressions. A library for very large matrices will need to pay +special attention to storage and numerical properties. This library is designed +for medium sized matrices. This means it is worth introducing some +optimisations, but I don't have to worry about setting up some form of virtual +memory.

+

Which matrix types?

+

As well as the usual rectangular matrices, matrices occurring repeatedly in +numerical calculations are upper and lower triangular matrices, symmetric +matrices and diagonal matrices. This is particularly the case in calculations +involving least squares and eigenvalue calculations. So as a first stage these +were the types I decided to include.

+

It is also necessary to have types row vector and column vector. In a +matrix package, in contrast to an array package, it is necessary +to have both these types since they behave differently in matrix expressions. +The vector types can be derived for the rectangular matrix type, so having them +does not greatly increase the complexity of the package.

+

The problem with having several matrix types is the number of versions of +the binary operators one needs. If one has 5 distinct matrix types then a +simple library will need 25 versions of each of the binary operators. In fact, +we can evade this problem, but at the cost of some complexity.

+

What element types?

+

Ideally we would allow element types double, float, complex and int, at +least. It might be reasonably easy, using templates or equivalent, to provide a +library which could handle a variety of element types. However, as soon as one +starts implementing the binary operators between matrices with different +element types, again one gets an explosion in the number of operations one +needs to consider. At the present time the compilers I deal with are not up to +handling this problem with templates. (Of course, when I started writing +newmat there were no templates). But even when the compilers do meet the +specifications of the draft standard, writing a matrix package that allows for +a variety of element types using the template mechanism is going to be very +difficult. I am inclined to use templates in an array library but not in +a matrix library.

+

Hence I decided to implement only one element type. But the user can decide +whether this is float or double. The package assumes elements are of type Real. +The user typedefs Real to float or double.

+

It might also be worth including symmetric and triangular matrices with +extra precision elements (double or long double) to be used for storage only +and with a minimum of operations defined. These would be used for accumulating +the results of sums of squares and product matrices or multi-stage QR +decompositions.

+

Allow matrix expressions

+

I want to be able to write matrix expressions the way I would on paper. So +if I want to multiply two matrices and then add the transpose of a third one I +can write something like X = A * B + C.t();. I want this expression to +be evaluated with close to the same efficiency as a hand-coded version. This is +not so much of a problem with expressions including a multiply since the +multiply will dominate the time. However, it is not so easy to achieve with +expressions with just + and -.

+

A second requirement is that temporary matrices generated during the +evaluation of an expression are destroyed as quickly as possible.

+

A desirable feature is that a certain amount of intelligence be +displayed in the evaluation of an expression. For example, in the expression +X = A.i() * B; where i() denotes inverse, it would be +desirable if the inverse wasn't explicitly calculated.

+

Naming convention

+

How are classes and public member functions to be named? As a general rule I +have spelt identifiers out in full with individual words being capitalised. For +example UpperTriangularMatrix. If you don't like this you can #define or +typedef shorter names. This convention means you can select an abbreviation +scheme that makes sense to you.

+

Exceptions to the general rule are the functions for transpose and inverse. +To make matrix expressions more like the corresponding mathematical formulae, I +have used the single letter abbreviations, t() and i().

+

I am now switching to using lowercase for functions with individual +words separated by "_". This is following the convention in +the standard library and I think it looks neater. Class names will remain with +individual words being capitalised.

+

Row and column index ranges

+

In mathematical work matrix subscripts usually start at one. In C, array +subscripts start at zero. In Fortran, they start at one. Possibilities for this +package were to make them start at 0 or 1 or be arbitrary.

+

Alternatively one could specify an index set for indexing the rows +and columns of a matrix. One would be able to add or multiply matrices only if +the appropriate row and column index sets were identical.

+

In fact, I adopted the simpler convention of making the rows and columns of +a matrix be indexed by an integer starting at one, following the traditional +convention. In an earlier version of the package I had them starting at zero, +but even I was getting mixed up when trying to use this earlier package. So I +reverted to the more usual notation and started at 1.

+

Element access - method and checking

+

We want to be able to use the notation A(i,j) to specify the +(i,j)-th element of a matrix. This is the way mathematicians expect to +address the elements of matrices. I consider the notation A[i][j] +totally alien. However I include this as an option to help people converting +from C.

+

There are two ways of working out the address of A(i,j). One is +using a dope vector which contains the first address of each row. +Alternatively you can calculate the address using the formula appropriate for +the structure of A. I use this second approach. It is probably slower, +but saves worrying about an extra bit of storage.

+

The other question is whether to check for i and j being +in range. I do carry out this check following years of experience with both +systems that do and systems that don't do this check. I would hope that the +routines I supply with this package will reduce your need to access elements of +matrices so speed of access is not a high priority.

+

Use iterators

+

Iterators are an alternative way of providing fast access to the elements of +an array or matrix when they are to be accessed sequentially. They need to be +customised for each type of matrix. I have not implemented iterators in this +package, although some iterator like functions are used internally for some row +and column functions.

+

5.4 Data storage

+

next - skip - +up - start

+

The stack and heap

+

To understand how newmat stores matrices you need to know a little bit +about the heap and stack.

+

The data values of variables or objects in a C++ program are stored in either +of two sections of memory called the stack and the heap. Sometimes +there is more than one heap to cater for different sized variables.

+

If you declare an automatic variable

+
   int x;
+

then the value of x is stored on the stack. As you declare more +variables the stack gets bigger. When you exit a block (i.e a section of code +delimited by curly brackets {...}) the memory used by the automatic +variables declared in the block is released and the stack shrinks.

+

When you declare a variable with new, for example,

+
   int* y = new int;
+

the pointer y is stored on the stack but the value it is +pointing to is stored on the heap. Memory on the heap is not +released until the program explicitly does this with a delete statement

+
   delete y;
+

or the program exits.

+

On the stack, variables and objects are is always added to the end of +the stack and are removed in the reverse order to that in which they are +added - that is the last on will be the first off. This is not the case with the +heap, where the variables and objects can be removed in any order. So one +can get alternating pieces of used and unused memory. When a new variable or +object is declared on the heap the system needs to search for piece of +unused memory large enough to hold it. This means that storing on the heap +will usually be a slower process than storing on the stack. There is also +likely to be waste space on the heap because of gaps between the used +blocks of memory that are too small for the next object you want to store on the +heap. There is also the possibility of wasting space if you forget to +remove a variable or object on the heap even though you have finished +using it. However, the stack is usually limited to holding small objects +with size known at compile time. Large objects, objects whose size you don't +know at compile time, and objects that you want to persist after the end of the +block need to be stored on the heap.

+

In C++, the constructor/destructor system enables one to build +complicated objects such as matrices that behave as automatic variables stored +on the stack, so the programmer doesn't have to worry about deleting them +at the end of the block, but which really utilise the heap for storing +their data.

+

Structure of matrix objects

+

Each matrix object contains the basic information such as the number of rows +and columns, the amount of memory used, a status variable and a pointer to the data array which is on +the heap. So if you declare a matrix

+
   Matrix A(1000,1000);
+

there is an small amount of memory used on the stack for storing the numbers +of rows and columns, the amount of  memory used, the status variable and +the pointer together with 1,000,000 Real locations stored on the heap. +When you exit the block in which A is declared, the heap memory used by +A is automatically returned to the system, as well as the memory used on +the stack.

+

Of course, if you use new to declare a matrix

+
   Matrix* B = new Matrix(1000,1000);
+

both the information about the size and the actual data are stored on heap +and not deleted until the program exits or you do an explicit delete:

+
   delete B;
+

If you carry out an assignment with = or << or do a +resize() the data array currently associated with a matrix is destroyed and +a new array generated. For example

+
   Matrix A(1000,1000);
+   Matrix B(50, 50);
+   ... put some values in B
+   A = B;
+

At the last step the heap memory associated with A is returned to the +system and a new block of heap memory is assigned to contain the new values. +This happens even if there is no change in the amount of memory required.

+

One block or several

+

The elements of the matrix are stored as a single array. Alternatives would +have been to store each row as a separate array or a set of adjacent rows as a +separate array. The present solution simplifies the program but limits the size +of matrices in 16 bit PCs that have a 64k byte limit on the size of arrays (I +don't use the huge keyword). The large arrays may also cause problems +for memory management in smaller machines. [The 16 bit PC problem has largely +gone away but it was a problem when much of newmat was written. Now, +occasionally I run into the 32 bit PC problem.]

+

By row or by column or other

+

In Fortran two dimensional arrays are stored by column. In most other +systems they are stored by row. I have followed this later convention. This +makes it easier to interface with other packages written in C but harder to +interface with those written in Fortran. This may have been a wrong decision. +Most work on the efficient manipulation of large matrices is being done in +Fortran. It would have been easier to use this work if I had adopted the +Fortran convention.

+

An alternative would be to store the elements by mid-sized rectangular +blocks. This might impose less strain on memory management when one needs to +access both rows and columns.

+

Storage of symmetric matrices

+

Symmetric matrices are stored as lower triangular matrices. The decision was +pretty arbitrary, but it does slightly simplify the Cholesky decomposition +program.

+

5.5 Memory management - +reference counting or status variable?

+

next - skip - +up - start

+

Consider the instruction

+
   X = A + B + C;
+
+ +

To evaluate this a simple program will add A to B putting +the total in a temporary T1. Then it will add T1 to +C creating another temporary T2 which will be copied into +X. T1 and T2 will sit around till the end of the +execution of the statement and perhaps of the block. It would be faster if the +program recognised that T1 was temporary and stored the sum of +T1 and C back into T1 instead of creating +T2 and then avoided the final copy by just assigning the contents of +T1 to X rather than copying. In this case there will be no +temporaries requiring deletion. (More precisely there will be a header to be +deleted but no contents).

+

For an instruction like

+
   X = (A * B) + (C * D);
+
+ +

we can't easily avoid one temporary being left over, so we would like this +temporary deleted as quickly as possible.

+

I provide the functionality for doing all this by attaching a status +variable to each matrix. This indicates if the matrix is temporary so that its +memory is available for recycling or deleting. Any matrix operation checks the +status variables of the matrices it is working with and recycles or deletes any +temporary memory.

+

An alternative or additional approach would be to use reference counting +and delayed copying - also known as copy on write. If a program +requests a matrix to be copied, the copy is delayed until an instruction is +executed which modifies the memory of either the original matrix or the copy. +If the original matrix is deleted before either matrix is modified, in effect, +the values of the original matrix are transferred to the copy without any +actual copying taking place. This solves the difficult problem of returning an +object from a function without copying and saves the unnecessary copying in the +previous examples.

+

There are downsides to the delayed copying approach. Typically, for delayed +copying one uses a structure like the following:

+
   Matrix
+     |
+     +------> Array Object
+     |          |
+     |          +------> Data array
+     |          |
+     |          +------- Counter
+     |
+     +------ Dimension information
+
+
+ +

where the arrows denote a pointer to a data structure. If one wants to +access the Data array one will need to track through two pointers. If +one is going to write, one will have to check whether one needs to copy first. +This is not important when one is going to access the whole array, say, for a +add operation. But if one wants to access just a single element, then it +imposes a significant additional overhead on that operation. Any subscript +operation would need to check whether an update was required - even read since +it is hard for the compiler to tell whether a subscript access is a read or +write.

+

Some matrix libraries don't bother to do this. So if you write A = +B; and then modify an element of one of A or B, then the +same element of the other is also modified. I don't think this is acceptable +behaviour.

+

Delayed copy does not provide the additional functionality of my approach +but I suppose it would be possible to have both delayed copy and tagging +temporaries.

+

My approach does not automatically avoid all copying. In particular, you +need use a special technique to return a matrix from a function without +copying.

+

5.6 Memory management - +accessing contiguous locations

+

next - skip - +up - start

+

Modern computers work faster if one accesses memory by running through +contiguous locations rather than by jumping around all over the place. Newmat +stores matrices by rows so that algorithms that access +memory by running along rows will tend to work faster than one that runs down +columns. A number of the algorithms used in Newmat were developed before this +was an issue and so are not as efficient as possible.

+

I have gradually upgrading the algorithms to access memory by rows. The +following table shows the current status of this process.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FunctionContiguous memory accessComment
Add, subtractYes 
MultiplyYes 
ConcatenateYes 
TransposeNo 
Invert and solveYesMostly
CholeskyYes 
QRZ, QRZTYes 
updateQRZ, updateQRZTPartially 
SVDNo 
JacobiNoNot an issue; used only for smaller matrices
EigenvaluesNo 
SortYesQuick-sort is naturally good
FFT?Could be improved?
+

This is now all rather out of date. With Pentiums, at least, the important +requirement for speed seems to be to minimise transfers between the RAM memory +and the on-chip memory. There isn't much you can do about add and subtract, but +there lots of possibilities for some of the other operations.

+

5.7 Evaluation of expressions - +lazy evaluation

+

next - skip - +up - start

+

Consider the instruction

+
   X = B - X;
+
+ +

A simple program will subtract X from B, store the result +in a temporary T1 and copy T1 into X. It would be +faster if the program recognised that the result could be stored directly into +X. This would happen automatically if the program could look at the +instruction first and mark X as temporary.

+

C programmers would expect to avoid the same problem with

+
   X = X - B;
+
+ +

by using an operator -=

+
   X -= B;
+
+ +

However this is an unnatural notation for non C users and it may be nicer to +write X = X - B; and know that the program will carry out the +simplification.

+

Another example where this intelligent analysis of an instruction is helpful +is in

+
   X = A.i() * B;
+
+ +

where i() denotes inverse. Numerical analysts know it is +inefficient to evaluate this expression by carrying out the inverse operation +and then the multiply. Yet it is a convenient way of writing the instruction. +It would be helpful if the program recognised this expression and carried out +the more appropriate approach.

+

I regard this interpretation of A.i() * B as just providing a +convenient notation. The objective is not primarily to correct the errors of +people who are unaware of the inefficiency of A.i() * B if interpreted +literally.

+

There is a third reason for the two-stage evaluation of expressions and this +is probably the most important one. In C++ it is quite hard to return an +expression from a function such as (*, + etc) without a copy. +This is particularly the case when an assignment (=) is involved. The +mechanism described here provides one way for avoiding this in matrix +expressions.

+

The C++ standard (section 12.8/15) allows the compiler to optimise away the +copy when returning an object from a function (but there will still be one copy +is an assignment (=) is involved). This means special handling of returns from a +function is less important when a modern optimising compiler is being +used. 

+

To carry out this intelligent analysis of an instruction matrix +expressions are evaluated in two stages. In the the first stage a tree +representation of the expression is formed. For example (A+B)*C is +represented by a tree

+

+       *
+      / \
+     +   C
+    / \
+   A   B
+
+ +

Rather than adding A and B the + operator yields +an object of a class AddedMatrix which is just a pair of pointers to +A and B. Then the * operator yields a +MultipliedMatrix which is a pair of pointers to the AddedMatrix +and C. The tree is examined for any simplifications and then evaluated +recursively.

+

Further possibilities not yet included are to recognise A.t()*A and +A.t()+A as symmetric or to improve the efficiency of evaluation of +expressions like A+B+C, A*B*C, A*B.t() (t() +denotes transpose).

+

One of the disadvantages of the two-stage approach is that the types of +matrix expressions are determined at run-time. So the compiler will not detect +errors of the type

+
   Matrix M;
+   DiagonalMatrix D;
+   ....;
+   D = M;
+
+ +

We don't allow conversions using = when information would be lost. +Such errors will be detected when the statement is executed.

+

5.8 How to overcome an +explosion in number of operations

+

next - skip - +up - start

+

The package attempts to solve the problem of the large number of versions of +the binary operations required when one has a variety of types.

+

With n types of matrices the binary operations will each require +n-squared separate algorithms. Some reduction in the number may be +possible by carrying out conversions. However, the situation rapidly becomes +impossible with more than 4 or 5 types. Doug Lea told me that it was possible +to avoid this problem. I don't know what his solution is. Here's mine.

+

Each matrix type includes routines for extracting individual rows or +columns. I assume a row or column consists of a sequence of zeros, a sequence +of stored values and then another sequence of zeros. Only a single algorithm is +then required for each binary operation. The rows can be located very quickly +since most of the matrices are stored row by row. Columns must be copied and so +the access is somewhat slower. As far as possible my algorithms access the +matrices by row.

+

There is another approach. Each of the matrix types defined in this package +can be set up so both rows and columns have their elements at equal intervals +provided we are prepared to store the rows and columns in up to three chunks. +With such an approach one could write a single "generic" algorithm +for each of multiply and add. This would be a reasonable alternative to my +approach.

+

I provide several algorithms for operations like + . If one is adding two +matrices of the same type then there is no need to access the individual rows +or columns and a faster general algorithm is appropriate.

+

Generally the method works well. However symmetric matrices are not always +handled very efficiently (yet) since complete rows are not stored explicitly. +

+

The original version of the package did not use this access by row or column +method and provided the multitude of algorithms for the combination of +different matrix types. The code file length turned out to be just a little +longer than the present one when providing the same facilities with 5 distinct +types of matrices. It would have been very difficult to increase the number of +matrix types in the original version. Apparently 4 to 5 types is about the +break even point for switching to the approach adopted in the present package. +

+

However it must also be admitted that there is a substantial overhead in the +approach adopted in the present package for small matrices. The test program +developed for the original version of the package takes 30 to 50% longer to run +with the current version (though there may be some other reasons for this). +This is for matrices in the range 6x6 to 10x10.

+

To try to improve the situation a little I do provide an ordinary matrix +multiplication routine for the case when all the matrices involved are +rectangular.

+

5.9 Destruction of +temporaries

+

next - skip - +up - start

+

Versions before version 5 of newmat did not work correctly with Gnu C++ +(version 5 or earlier). This was because the tree structure used to represent a +matrix expression was set up on the stack.  Early versions of Gnu C++ destroyed temporary structures as soon as the +function that accesses them finished. To overcome this problem, there was an +option to store the temporaries forming the tree structure on the heap (created +with new) and to delete them explicitly. Now that the C++ standards committee +has said that temporary structures should not be destroyed before a statement +finishes, I have deleted this option.

+

5.10 A calculus of matrix +types

+

next - skip - +up - start

+

The program needs to be able to work out the class of the result of a matrix +expression. This is to check that a conversion is legal or to determine the +class of an intermediate result. To assist with this, a class MatrixType is +defined. Operators +, -, *, >= are +defined to calculate the types of the results of expressions or to check that +conversions are legal.

+

Early versions of newmat stored the types of the results of +operations in a table. So, for example, if you multiplied an +UpperTriangularMatrix by a LowerTriangularMatrix, newmat would look up +the table and see that the result was of type Matrix. With this approach the +exploding number of operations problem recurred although +not as seriously as when code had to be written for each pair of types. But +there was always the suspicion that somewhere, there was an error in one of +those 9x9 tables, that would be very hard to find. And the problem would get +worse as additional matrix types or operators were included.

+

The present version of newmat solves the problem by assigning +attributes such as diagonal or band or upper +triangular to each matrix type. Which attributes a matrix type has, is +stored as bits in an integer. As an example, the DiagonalMatrix type has the +bits corresponding to diagonal, symmetric and band equal +to 1. By looking at the attributes of each of the operands of a binary +operator, the program can work out the attributes of the result of the +operation with simple bitwise operations. Hence it can deduce an appropriate +type. The symmetric attribute is a minor problem because +symmetric * symmetric does not yield symmetric unless both +operands are diagonal. But otherwise very simple code can be used to +deduce the attributes of the result of a binary operation.

+

Tables of the types resulting from the binary operators are output at the +beginning of the test program.

+

5.11 Pointer arithmetic

+

next - skip - +up - start

+

Suppose you do something like

+
   int* y = new int[100];
+   y += 200;          // y points to something outside the array
+   // y is never accessed
+
+ +

Then the standard says that the behaviour of the program is undefined +even if y is never accessed. (You are allowed to calculate a pointer +value one location beyond the end of the array). In practice, a program like +this does not cause any problems with any compiler I have come across and +no-one has reported any such problems to me.

+

However, this error is detected by Borland's Code Guard +bound's checker and this makes it very difficult to use this to use Code +Guard to detect other problems since the output is swamped by reports of +this error.

+

Now consider

+
   int* y = new int[100];
+   y += 200;          // y points to something outside the array
+   y -= 150;          // y points to something inside the array
+   // y is accessed
+
+ +

Again this is not strictly correct but does not seem to cause a problem. But +it is much more doubtful than the previous example.

+

I removed most instances of the second version of the problem from Newmat09. +Hopefully the remainder of these instances were removed from Newmat10. In addition, most instances of the first version of the +problem have also been fixed.

+

There is one exception. The interface to the Numerical +Recipes in C does still contain the second version of the problem. This is +inevitable because of the way Numerical Recipes in C stores vectors and +matrices. If you are running the test program with a +bounds checking program, edit tmt.h to disable the testing of the NRIC +interface.

+

The rule does does cause a problem for authors of matrix and +multidimensional array packages. If we want to run down a column of a matrix we +would like to do something like

+
   // set values of column 1
+   Matrix A;
+   ... set dimensions and put values in A
+   Real* a = A.data();               // points to first element
+   int nr = A.nrows();                // number of rows
+   int nc = A.ncols();                // number of columns
+   while (nr--)
+   {
+      *a = something to put in first element of row
+      a += nc;                        // jump to next element of column
+   }
+
+ +

If the matrix has more than one column the last execution of a += +nc; will run off the end of the space allocated to the matrix and we'll +get a bounds error report.

+

Instead we have to use a program like

+
   // set values of column 1
+   Matrix A;
+   ... set dimensions and put values in A
+   Real* a = A.data();               // points to first element
+   int nr = A.nrows();                // number of rows
+   int nc = A.ncols();                // number of columns
+   if (nr != 0)
+   {
+      for(;;)
+      {
+         *a = something to put in first element of row
+         if (!(--nr)) break;
+         a += nc;                     // jump to next element of column
+      }
+   }
+
+ +

which is more complicated and consequently introduces more chance of error. +

+

5.12 Error handling +

+

next - skip - +up - start

+

The library now does have a moderately graceful exit from errors. One can +use either the simulated exceptions or the compiler supported exceptions. When +newmat08 was released (in 1995), compiler exception handling in the compilers I +had access to was unreliable. I recommended you used my simulated exceptions. +In 1997 compiler supported exceptions seemed to work on a variety of +compilers - but not all compilers. This was still true in 2001. One compiler +company was still having problems in 2003 (not sure about 2004). Try using the +compiler supported exceptions if you have a recent compiler, but if you are +getting strange crashes or errors try going back to my simulated exceptions.

+

The approach in the present library, attempting to simulate C++ exceptions, +is not completely satisfactory, but seems a good interim solution for those who +cannot use compiler supported exceptions. People who don't want exceptions in +any shape or form, can set the option to exit the program if an exception is +thrown.

+

The exception mechanism cannot clean-up objects explicitly created by new. +This must be explicitly carried out by the package writer or the package user. +I have not yet done this completely with the present package so occasionally a +little garbage may be left behind after an exception. I don't think this is a +big problem, but it is one that needs fixing.

+

5.13 Sparse matrices

+

next - skip - +up - start

+

The library does not support sparse matrices.

+

For sparse matrices there is going to be some kind of structure vector. It +is going to have to be calculated for the results of expressions in much the +same way that types are calculated. In addition, a whole new set of row and +column operations would have to be written.

+

Sparse matrices are important for people solving large sets of differential +equations as well as being important for statistical and operational research +applications.

+

But there are packages being developed specifically for sparse matrices and +these might present the best approach, at least where sparse matrices are the +main interest.

+

5.14 Complex matrices

+

next - skip - +up - start

+

The package does not yet support matrices with complex elements. There are +at least two approaches to including these. One is to have matrices with +complex elements.

+

This probably means making new versions of the basic row and column +operations for Real*Complex, Complex*Complex, Complex*Real and similarly for ++ and -. This would be OK, except that if I also want to do +this for sparse matrices, then when you put these together, the whole thing +will get out of hand.

+

The alternative is to represent a Complex matrix by a pair of Real matrices. +One probably needs another level of decoding expressions but I think it might +still be simpler than the first approach. But there is going to be a problem +with accessing elements and it does not seem possible to solve this in an +entirely satisfactory way.

+

Complex matrices are used extensively by electrical engineers and physicists +and really should be fully supported in a comprehensive package.

+

You can simulate most complex operations by representing Z = X + iY +by

+
    /  X   Y \
+    \ -Y   X / 
+
+ +

Most matrix operations will simulate the corresponding complex operation, +when applied to this matrix. But, of course, this matrix is essentially twice as big as you +would need with a genuine complex matrix library.

+ + +

 

+ + +

6. Function summary

+ + +

next - skip - +up - start

+ + +

6.1 Member functions for matrices +and matrix expressions
+6.2 Member functions for matrices
+6.3 Operators
+6.3 Global functions - newmat.h
+6.4 Global functions - newmatap.h
+6.5 Other classes - member functions

+ + +

This section lists member and global functions for matrices defined in +newmat.h. Where there are alternative names the lower-case non-capitalised +versions are the preferred ones.

+ + +

6.1 Member functions for matrices and matrix expressions

+

next - +skip - up - start

+

Member functions for matrices and matrix expressions. These do not apply to +CroutMatrix and BandLUMatrix +unless explicitly noted.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Function groupfunction namedescription
Unary operators

(see also + operators)

.t()matrix transpose
.reverse()
+ .Reverse()
reverse order of elements (not band matrices)
.i()invert matrix or solve (also works with CroutMatrix and BandLUMatrix)
.sum_rows()sum elements in each row
.sum_columns()sum elements in each column
.sum_square_rows()sum squares of elements in each row
.sum_square_columns()sum squares of elements in each column
Change type.as_row()
+ .AsRow()
interpret matrix body as a single row
.as_column()
+ .AsColumn()
interpret matrix body as a single column
.as_diagonal()
+ .AsDiagonal()
interpret matrix body as a diagonal matrix
.as_matrix()
+ .AsMatrix()
interpret matrix body as a rectangular matrix
.as_scalar()
+ .AsScalar()
convert 1x1 to Real
Submatrices.submatrix(int,int,int,int)
+ .SubMatrix(int,int,int,int)
submatrix
.sym_submatrix(int,int)
+ .SymSubMatrix(int,int)
submatrix with same row and column range
.row(int)
+ .Row(int)
select a row of a matrix
.rows(int,int)
+ .Rows(int,int)
select a range of rows of a matrix
.column(int)
+ .Column(int,int)
select a column of a matrix
.columns(int)
+ .Columns(int,int)
select a range of columns of a matrix
Scalar functions - maxima & + minima

(also global versions of maximum(), minimum(),  + maximum_absolute_value(), mimimum_absolute_value())

.maximum_absolute_value()
+ .
MaximumAbsoluteValue()
maximum absolute value of elements
.maximum_absolute_value1(int&)
+ .MaximumAbsoluteValue1(int&)
maximum absolute value, return location
.maximum_absolute_value2(int&,int&)
+ .MaximumAbsoluteValue2(int&,int&)
maximum absolute value, return location
.minimum_absolute_value()
+ .MinimumAbsoluteValue()
minimum absolute value of elements
.minimum_absolute_value1(int&)
+ .MinimumAbsoluteValue1(int&)
minimum absolute value, return location
.minimum_absolute_value2(int&,int&)
+ .MinimumAbsoluteValue2(int&,int&)
minimum absolute value, return location
.maximum()
+ .Maximum()
maximum value of elements
.maximum1(int&)
+ .Maximum1(int&)
maximum value, return location
.maximum2(int&,int&)
+ .Maximum2(int&,int&)
maximum value, return location
.minimum()
+ .Minimum()
minimum value of elements
.minimum1(int&)
+ .Minimum1(int&)
minimum value, return location
.minimum2(int&,int&)
+ .Minimum2(int&,int&)
minimum value, return location
Scalar functions - numerical

+ (also global versions of these functions)

.log_determinant()
+ .LogDeterminant()
natural logarithm of the determinant (also works with CroutMatrix and BandLUMatrix)
.determinant()
+ .Determinant()
determinant (also works with CroutMatrix and BandLUMatrix)
.sum_square()
+ .SumSquare()
sum of squares of elements
.norm_Frobenius()
+ .norm_frobenius()
+ .NormFrobenius()
square root of sum of squares of elements
.sum_absolute_value()
+ .SumAbsoluteValue()
sum of absolute values of elements
.sum()
+ .Sum()
sum of elements
.trace()
+ .Trace()
trace of a matrix
.norm1()
+ .Norm1()
maximum of sum of absolute values of elements of a column
.norm_infinity()
+ .NormInfinity()
maximum of sum of absolute values of elements of a row
Scalar functions - size and shape.bandwidth()
+ .BandWidth()
bandwidth of matrix (also works with CroutMatrix and BandLUMatrix)
+

 

+

6.2 Member functions for matrices

+

next - skip - up - start

+

Member functions for matrices but not matrix expressions. These do not apply +to CroutMatrix and BandLUMatrix unless explicitly noted.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Function groupfunction namedescription
Element access

(see + also operators)

.element(int,int)access element - subscripts start at 0
.element(int)access element - subscripts start at 0
Copying.inject(const GeneralMatrix&)
+ .Inject(const GeneralMatrix&)
copy elements into a matrix
.swap(Matrix&)swap bodies of two matrices of same type (also global + version, also works with CroutMatrix and BandLUMatrix)
Scalar functions - size and + shape

(also work with CroutMatrix and BandLUMatrix)

.type()
+ .Type()
type of a matrix
.nrows()
+ .Nrows()
number of rows
.ncols()
+ .Ncols()
number of columns
.size()
+ .Storage()
number of stored elements (including unused elements in band + matrices)
.size2()size of second array (BandLUMatrix only)
.data()
+ .Store()
pointer to stored elements
.const_data()constant pointer to stored elements
.const_data2()constant pointer to second array (BandLUMatrix only)
.const_data_indx()constant pointer to row swap array (CroutMatrix and BandLUMatrix + only)
Scalar functions - numerical.is_zero()
+ .IsZero()
test all elements are exactly zero (also global version)
.is_singular()
+ .IsSingular()
test for exact singularity (CroutMatrix and BandLUMatrix + only)
.even_exchanges()true if there have been an even number of row exchanges (CroutMatrix and BandLUMatrix + only)
Memory management.release()
+ .Release()
release memory after next operation
.release(int)
+ .Release(int)
release memory after specified number of operations
.release_and_delete()
+ .ReleaseAndDelete()
delete after next operation
.for_return()
+ .ForReturn()
place in an envelope for efficient return from a function
Change dimensions.resize(int)
+ .ReSize(int)
change the dimensions (vectors and square matrices)
.resize(int,int)
+ .ReSize(int,int)
change the dimensions (non-square matrices, triangular band + matrices and symmetric band matrices)
.resize(int,int,int)
+ .ReSize(int,int,int)
change the dimensions (band matrices)
.resize(const GeneralMatrix&)
+ .ReSize(const GeneralMatrix&)
change dimensions to match those of another matrix
.cleanup()
+ .CleanUp()
resize to 0x0
.resize_keep(int)change the dimensions, keep values (vectors and square matrices, + not band)
.resize_keep(int,int)change the dimensions , keep values (non-square matrices)
+

 

+

6.3 Operators

+

next - +skip - up - start

+

Operators for matrices and matrix expressions. These do not apply to CroutMatrix and BandLUMatrix +unless explicitly noted.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Function groupfunction namedescription
Element access

+ (matrices only, not functions of a matrix)

()access element - subscripts start at 1
()access element - subscripts start at 1
[]access element C style - subscripts start at zero; if + SETUP_C_SUBSCRIPTS is defined.
Unary operators-change sign of elements
Binary operators+, +=add matrices
-, -=subtract matrices
*, *=matrix multiplication
|, |=horizontal concatenation
&, &=vertical stacking
==test for exact equality (also works with CroutMatrix and BandLUMatrix)
!=test for inequality (i.e. not exact equality, also works with CroutMatrix and BandLUMatrix)
Matrix and scalar+, +=add Real to matrix
-, -=subtract Real from matrix; subtract matrix from Real
*, *=multiply matrix by Real
/, /=divide matrix by Real
Copying=copy matrix (error if there is loss of data,  also works with CroutMatrix and BandLUMatrix)
=copy Real + to all elements
<<copy matrix (no error if there is loss of data)
Enter values<<enter list of values into matrix
Output

(header in newmatio.h)

<<print matrix to file
+

 

+ +

6.4 Global functions - newmat.h

+

next - +skip - +up - start

+

Operators for matrices and matrix expressions. These do not apply to CroutMatrix and BandLUMatrix.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Function groupfunction namedescription
Binary operators

(see + also operators)

SP(const BaseMatrix&, const BaseMatrix&)element-wise product of two matrices
KP(const BaseMatrix&, const BaseMatrix&)Kronecker product of two matrices
crossproduct(const Matrix&, const Matrix&)
+ CrossProduct(const Matrix&, const Matrix&)
cross product of two 3x1 or 1x3 matrices or vectors.
crossproduct_rows(const Matrix&, const Matrix&)
+ CrossProductRows(const Matrix&, const Matrix&)
row-wise cross product
crossproduct_columns(const Matrix&, const Matrix&)
+ CrossProductColumns(const Matrix&, const Matrix&)
column-wise cross product
Scalar functions - numericaldotproduct(const Matrix&, const Matrix&)
+
DotProduct(const Matrix&, const Matrix&)
dot product of two vectors
+ +

 

+ + +

6.5 Global functions - newmatap.h

+

next - skip - +up - start

+ +

Advanced operators for matrices and matrix expressions. These do not apply to CroutMatrix and BandLUMatrix.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Function groupfunction namedescription
QR transformQRZT(Matrix&, LowerTriangularMatrix&)transposed version of QRZ transform
QRZT(const Matrix&, Matrix&, Matrix&)transposed version of QRZ transform - solve part
QRZT(Matrix&, Matrix&, LowerTriangularMatrix&, Matrix&)both of previous two lines
QRZ(Matrix&, UpperTriangularMatrix&)QRZ transform
QRZ(const Matrix&, Matrix&, Matrix&)QRZ transform - solve part
QRZ(Matrix&, Matrix&, UpperTriangularMatrix&, Matrix&)both of previous two lines
updateQRZT(Matrix&, LowerTriangularMatrix&)
+ UpdateQRZT(Matrix&, LowerTriangularMatrix&)
add extra columns to transposed version of QRZ + transform
updateQRZ(Matrix&, UpperTriangularMatrix&)
+ UpdateQRZ(Matrix&, UpperTriangularMatrix&)
add extra rows to QRZ transform
updateQRZ(const Matrix&, Matrix&, Matrix&)
+ UpdateQRZ(const Matrix&, Matrix&, Matrix&)
combine the results of the solve parts of QRZ + transforms on two blocks of data
updateQRZ(UpperTriangularMatrix&, UpperTriangularMatrix&)
+ UpdateQRZ(UpperTriangularMatrix&, UpperTriangularMatrix&)
combine the results of QRZ transforms on two + blocks of data
updateQRZ(const UpperTriangularMatrix&, Matrix&, Matrix&)
+ UpdateQRZ(const UpperTriangularMatrix&, Matrix&, Matrix&)
combine the results of the solve parts of QRZ + transforms on two blocks of data
Extend orthonormal setextend_orthonormal(Matrix&, int)extend a set of orthonormal columns
Cholesky + decompositionCholesky(const SymmetricMatrix&)Cholesky decomposition of symmetric matrix
Cholesky(const SymmetricBandMatrix&)Cholesky decomposition of symmetric band matrix
Update Cholesky + decompositionupdate_Cholesky (UpperTriangularMatrix&, + RowVector)
+ UpdateCholesky (UpperTriangularMatrix&, + RowVector)
add extra row to Cholesky/QR decomposition
downdate_Cholesky (UpperTriangularMatrix&, + RowVector)
+ DowndateCholesky (UpperTriangularMatrix&, + RowVector)
remove row from Cholesky/QR decomposition
right_circular_update_Cholesky (UpperTriangularMatrix&, + int, int)
+ RightCircularUpdateCholesky (UpperTriangularMatrix&, + int, int)
rearrange columns in Cholesky/QR decomposition
left_circular_update_Cholesky (UpperTriangularMatrix&, + int, int)
+ LeftCircularUpdateCholesky (UpperTriangularMatrix&, + int, int)
rearrange columns in Cholesky/QR decomposition
Singular value + decompositionSVD(const Matrix&, DiagonalMatrix&, + Matrix&, Matrix&, bool, bool)singular value decomposition - get U and V
SVD(const Matrix&, DiagonalMatrix&)SVD decomposition - get just singular values
SVD(const Matrix& A, DiagonalMatrix& D, + Matrix&, bool)SVD decomposition - get U
Eigenvalue + decomposition of a symmetric matrixJacobi(const SymmetricMatrix&, + DiagonalMatrix&)Jacobi eigenvalue decomposition - get only eigenvalues
Jacobi(const SymmetricMatrix&, + DiagonalMatrix&, SymmetricMatrix&)Jacobi eigenvalue decomposition - get only + eigenvalues
Jacobi(const SymmetricMatrix&, + DiagonalMatrix&, Matrix&)Jacobi eigenvalue decomposition - get + eigenvalues and eigenvectors
Jacobi(const SymmetricMatrix&, + DiagonalMatrix&, SymmetricMatrix&, Matrix&, bool)Jacobi eigenvalue decomposition - get + eigenvalues and eigenvectors
eigenvalues(const SymmetricMatrix&, + DiagonalMatrix&)
+ EigenValues(const SymmetricMatrix&, + DiagonalMatrix&)
Householder eigenvalue decomposition - get only + eigenvalues
eigenvalues(const SymmetricMatrix&, + DiagonalMatrix&, SymmetricMatrix&)
+ EigenValues(const SymmetricMatrix&, + DiagonalMatrix&, SymmetricMatrix&)
Householder eigenvalue decomposition with back + transform - get only eigenvalues
eigenvalues(const SymmetricMatrix&, + DiagonalMatrix&, Matrix&)
+ EigenValues(const SymmetricMatrix&, + DiagonalMatrix&, Matrix&)
Householder eigenvalue decomposition - get + eigenvalues and eigenvectors
Sortingsort_ascending(GeneralMatrix&)
+ SortAscending(GeneralMatrix&)
ascending sort
sort_descending(GeneralMatrix&)
+ SortDescending(GeneralMatrix&)
descending sort
Fast Fourier + transformFFT(const ColumnVector&, const + ColumnVector&, ColumnVector&, ColumnVector&)fast Fourier transform
FFTI(const ColumnVector&, const + ColumnVector&, ColumnVector&, ColumnVector&)fast Fourier transform - inverse
RealFFT(const ColumnVector&, ColumnVector&, + ColumnVector&)FFT of real vector
RealFFTI(const ColumnVector&, const + ColumnVector&, ColumnVector&)FFT of real vector - inverse
FFT2(const Matrix& U, const Matrix& V, + Matrix& X, Matrix& Y)two dimensional FFT
FFT2I(const Matrix& U, const Matrix& V, + Matrix& X, Matrix& Y)two dimensional FFT - inverse
Fast + trigonometric transformDCT_II(const ColumnVector&, ColumnVector&)type II discrete cosine transform
DCT_II_inverse(const ColumnVector&, + ColumnVector&)type II discrete cosine transform - inverse
DST_II(const ColumnVector&, ColumnVector&)type II discrete sine transform
DST_II_inverse(const ColumnVector&, + ColumnVector&)type II discrete sine transform - inverse
DCT(const ColumnVector&, ColumnVector&)discrete cosine transform
DCT_inverse(const ColumnVector&, + ColumnVector&)discrete cosine transform - inverse
DST(const ColumnVector&, ColumnVector&)discrete sine transform
DST_inverse(const ColumnVector&, + ColumnVector&)discrete sine transform - inverse
+ Helmert transformHelmert(int, bool=false)return Helmert transform matrix
Helmert(const ColumnVector&, bool=false)
+ Helmert(const Matrix&, bool=false)
multiply by Helmert transform matrix
Helmert(int, int, bool=false)return column of Helmert transform matrix
Helmert_transpose(const ColumnVector&, bool=false)
+ Helmert_transpose(const Matrix&, bool=false)
multiply by transpose of Helmert transform + matrix
Helmert_transpose(const ColumnVector&, int, bool=false)multiply by transpose of Helmert transform + matrix, return one element of result
+ +

 

+

6.6 Other classes - member functions

+

next - skip - +up - start

+ +

 

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Classfunction namedescription
LogAndSign.pow_eq(int)
+ .PowEq(int)
raise to a power
.change_sign()
+ .ChangeSign()
change sign
.log_value()
+ .LogValue()
return the natural logarithm of the value
.sign()
+ .Sign()
return the sign
.value()
+ .Value()
return the value (no log transform)
MatrixType.value()
+ .Value()
return the value (as character string)
.is_diagonal()has diagonal attribute
.is_symmetric() has symmetric attribute
.is_band()has band attribute
MatrixBandWidth.upper()
+ .Upper()
return upper band width
.lower()
+ .Lower()
return lower bandwidth
SimpleIntArray.size()
+ .Size()
return size of array
.data()
+ .Data()
return a pointer to the data
.const_data()return a constant pointer to the data
.resize()
+ .Resize()
change the size of an array
.resize_keep()
+ .resize(true)
+ .Resize(true)
change the size of an array - keep the values
.cleanup()
+ .CleanUp()
resize to zero
+ + +

 

+ + +

7. Change history

+

next - skip - +up - start

+

Newmat11 - November, 2008:

+

Remove work-arounds for older compilers, Borland Builder 6 and +Open Watcom compatibility, SquareMatrix, +load from array of ints, crossproducts, Cholesky and QRZ update functions, swap +functions, FFT2, access to arrays in traditional C functions, SimpleIntArray +class, compatibility with Numerical Recipes in C++, sum_rows(), sum_columns(), sum_squares_rows() and +sum_squares_columns() functions, extend_orthogonal function, resize_keep +function, speed-ups and +bug-fixes, change to lower case for functions, can copy CroutMatrix, +BandLUMatrix, Helmert transform, compatibility fix for G++ 4.1, start inserting +comments for Doxygen, SP_eq, scientific format for output, fix for 64 bits.

+

Newmat10A - October, 2002, Newmat10B - January 2005:

+

Fix error in Kronecker product; fixes for Intel and GCC3 +compilers.

+

Newmat10 - January, 2002:

+

Improve compatibility with GCC, fix errors in FFT and +GenericMatrix, update simulated exceptions, maxima, minima, determinant, dot +product and Frobenius norm functions, update make files for CC and GCC, faster +FFT, A.ReSize(B), fix pointer arithmetic, << for loading +data into rows, IdentityMatrix, Kronecker product, sort singular values.

+

Newmat09 - September, 1997:

+

Operator ==, !=, +=, -=, +*=, /=, |=, &=. Follow new rules for +for (int i; ... ) construct. Change Boolean, TRUE, FALSE to bool, true, +false. Change ReDimension to ReSize. SubMatrix allows zero rows and columns. +Scalar +, - or * matrix is OK. Simplify simulated +exceptions. Fix non-linear programs for AT&T compilers. Dummy inequality +operators. Improve internal row/column operations. Improve matrix LU +decomposition. Improve sort. Reverse function. IsSingular function. Fast trig +transforms. Namespace definitions.

+

Newmat08A - July, 1995:

+

Fix error in SVD.

+

Newmat08 - January, 1995:

+

Corrections to improve compatibility with Gnu, Watcom. +Concatenation of matrices. Elementwise products. Option to use compilers +supporting exceptions. Correction to exception module to allow global +declarations of matrices. Fix problem with inverse of symmetric matrices. Fix +divide-by-zero problem in SVD. Include new QR routines. Sum function. +Non-linear optimisation. GenericMatrices.

+

Newmat07 - January, 1993

+

Minor corrections to improve compatibility with Zortech, +Microsoft and Gnu. Correction to exception module. Additional FFT functions. +Some minor increases in efficiency. Submatrices can now be used on RHS of =. +Option for allowing C type subscripts. Method for loading short lists of +numbers.

+

Newmat06 - December 1992:

+

Added band matrices; 'real' changed to 'Real' (to avoid +potential conflict in complex class); Inject doesn't check for no loss of +information; fixes for AT&T C++ version 3.0; real(A) becomes A.AsScalar(); +CopyToMatrix becomes AsMatrix, etc; .c() is no longer required (to be deleted +in next version); option for version 2.1 or later. Suffix for include files +changed to .h; BOOL changed to Boolean (BOOL doesn't work in g++ v 2.0); +modifications to allow for compilers that destroy temporaries very quickly; +(Gnu users - see the section of compilers). Added CleanUp, +LinearEquationSolver, primitive version of exceptions.

+

Newmat05 - June 1992:

+

For private release only

+

Newmat04 - December 1991:

+

Fix problem with G++1.40, some extra documentation +

+

Newmat03 - November 1991:

+

Col and Cols become Column and Columns. Added Sort, SVD, +Jacobi, Eigenvalues, FFT, real conversion of 1x1 matrix, Numerical Recipes +in C interface, output operations, various scalar functions. Improved +return from functions. Reorganised setting options in "include.hxx". +

+

Newmat02 - July 1991:

+

Version with matrix row/column operations and numerous +additional functions.

+

Matrix - October 1990:

+

Early version of package.

+ +

 

+

8. Problem report form +

+ +

next - skip - up - +start

+ +

Copy and paste this to your editor; fill it out and email to robert at statsresearch.co.nz

+

But first look in my web page +http://www.robertnz.net to see if the bug has +already been reported.

+
 Version: ............... newmat11 (20 November 2008)
+ Your email address: ....
+ Today's date: ..........
+ Your machine: ..........
+ Operating system: ......
+ Compiler & version: ....
+ Compiler options
+   (eg GUI or console)...
+ Describe the problem - attach examples if possible:
+
+
+
+
+ +
-----------------------------------------------------------
+
+ +

 

+ +

 

+

return to top
+return to online documentation page

+

 

+

 

+

 

+

 

+

 

+

 

+

 

+ + \ No newline at end of file diff --git a/extern/newmat/nm_b55.mak b/extern/newmat/nm_b55.mak new file mode 100644 index 00000000..c7c45030 --- /dev/null +++ b/extern/newmat/nm_b55.mak @@ -0,0 +1,234 @@ +BORLANDPATH = "C:\program files\Borland\cbuilder5" + +TASM = TASM32 +TLIB = tlib +TLINK = ilink32 +LIBPATH = $(BORLANDPATH)\LIB +INCLUDEPATH = $(BORLANDPATH)\INCLUDE + +DIFF = sdiff +PRE = + +CC = bcc32 -W- -v- -H- -3 -N -Og -Oi -Ov -f -I$(INCLUDEPATH) + +.cpp.obj: + $(CC) -c {$< } + +everything: tmt.exe example.exe nm_ex1.exe nm_ex2.exe nm_ex3.exe test_exc.exe nl_ex.exe sl_ex.exe garch.exe + +newmat_lobj = newmat1.obj newmat2.obj newmat3.obj newmat4.obj newmat5.obj newmat6.obj newmat7.obj newmat8.obj newmatex.obj bandmat.obj submat.obj myexcept.obj cholesky.obj evalue.obj fft.obj hholder.obj jacobi.obj newfft.obj sort.obj svd.obj nm_misc.obj newmatrm.obj newmat9.obj + +newmat.lib: $(newmat_lobj) + $(TLIB) $@ /P32 /u $(newmat_lobj) + +tmt_obj = tmt.obj tmt1.obj tmt2.obj tmt3.obj tmt4.obj tmt5.obj tmt6.obj tmt7.obj tmt8.obj tmt9.obj tmta.obj tmtb.obj tmtc.obj tmtd.obj tmte.obj tmtf.obj tmtg.obj tmth.obj tmti.obj tmtj.obj tmtk.obj tmtl.obj tmtm.obj + +tmt.exe: $(tmt_obj) newmat.lib + $(TLINK) /x/L$(LIBPATH)/Gn -Tpe -ap -c @&&| +c0x32.obj $(tmt_obj),$@,, newmat.lib import32.lib cw32.lib +| + +example_obj = example.obj + +example.exe: $(example_obj) newmat.lib + $(TLINK) /x/L$(LIBPATH)/Gn -Tpe -ap -c @&&| +c0x32.obj $(example_obj),$@,, newmat.lib import32.lib cw32.lib +| + +nm_ex1_obj = nm_ex1.obj + +nm_ex1.exe: $(nm_ex1_obj) newmat.lib + $(TLINK) /x/L$(LIBPATH)/Gn -Tpe -ap -c @&&| +c0x32.obj $(nm_ex1_obj),$@,, newmat.lib import32.lib cw32.lib +| + +nm_ex2_obj = nm_ex2.obj + +nm_ex2.exe: $(nm_ex2_obj) newmat.lib + $(TLINK) /x/L$(LIBPATH)/Gn -Tpe -ap -c @&&| +c0x32.obj $(nm_ex2_obj),$@,, newmat.lib import32.lib cw32.lib +| + +nm_ex3_obj = nm_ex3.obj + +nm_ex3.exe: $(nm_ex3_obj) newmat.lib + $(TLINK) /x/L$(LIBPATH)/Gn -Tpe -ap -c @&&| +c0x32.obj $(nm_ex3_obj),$@,, newmat.lib import32.lib cw32.lib +| + +test_exc_obj = test_exc.obj + +test_exc.exe: $(test_exc_obj) newmat.lib + $(TLINK) /x/L$(LIBPATH)/Gn -Tpe -ap -c @&&| +c0x32.obj $(test_exc_obj),$@,, newmat.lib import32.lib cw32.lib +| + +nl_ex_obj = nl_ex.obj newmatnl.obj + +nl_ex.exe: $(nl_ex_obj) newmat.lib + $(TLINK) /x/L$(LIBPATH)/Gn -Tpe -ap -c @&&| +c0x32.obj $(nl_ex_obj),$@,, newmat.lib import32.lib cw32.lib +| + +sl_ex_obj = sl_ex.obj solution.obj myexcept.obj + +sl_ex.exe: $(sl_ex_obj) + $(TLINK) /x/L$(LIBPATH)/Gn -Tpe -ap -c @&&| +c0x32.obj $(sl_ex_obj),$@,,import32.lib cw32.lib +| + +garch_obj = garch.obj newmatnl.obj + +garch.exe: $(garch_obj) newmat.lib + $(TLINK) /x/L$(LIBPATH)/Gn -Tpe -ap -c @&&| +c0x32.obj $(garch_obj),$@,, newmat.lib import32.lib cw32.lib +| + +newmat1.obj: newmat1.cpp newmat.h include.h myexcept.h + +newmat2.obj: newmat2.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat3.obj: newmat3.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat4.obj: newmat4.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat5.obj: newmat5.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat6.obj: newmat6.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat7.obj: newmat7.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat8.obj: newmat8.cpp include.h newmat.h newmatrc.h precisio.h myexcept.h controlw.h + +newmatex.obj: newmatex.cpp include.h newmat.h myexcept.h + +bandmat.obj: bandmat.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +submat.obj: submat.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +myexcept.obj: myexcept.cpp include.h myexcept.h + +cholesky.obj: cholesky.cpp include.h newmat.h newmatrm.h myexcept.h + +evalue.obj: evalue.cpp include.h newmatap.h newmatrm.h precisio.h newmat.h myexcept.h + +fft.obj: fft.cpp include.h newmatap.h newmat.h myexcept.h + +hholder.obj: hholder.cpp include.h newmatap.h newmat.h myexcept.h + +jacobi.obj: jacobi.cpp include.h newmatap.h precisio.h newmatrm.h newmat.h myexcept.h + +newfft.obj: newfft.cpp newmatap.h newmat.h include.h myexcept.h + +sort.obj: sort.cpp include.h newmatap.h newmat.h myexcept.h + +svd.obj: svd.cpp include.h newmatap.h newmatrm.h precisio.h newmat.h myexcept.h + +nm_misc.obj: nm_misc.cpp include.h newmatap.h newmat.h myexcept.h + +newmatrm.obj: newmatrm.cpp newmat.h newmatrm.h include.h myexcept.h + +newmat9.obj: newmat9.cpp include.h newmat.h newmatio.h newmatrc.h myexcept.h controlw.h + +tmt.obj: tmt.cpp include.h newmat.h tmt.h myexcept.h + +tmt1.obj: tmt1.cpp include.h newmat.h tmt.h myexcept.h + +tmt2.obj: tmt2.cpp include.h newmat.h tmt.h myexcept.h + +tmt3.obj: tmt3.cpp include.h newmat.h tmt.h myexcept.h + +tmt4.obj: tmt4.cpp include.h newmat.h tmt.h myexcept.h + +tmt5.obj: tmt5.cpp include.h newmat.h tmt.h myexcept.h + +tmt6.obj: tmt6.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmt7.obj: tmt7.cpp include.h newmat.h tmt.h myexcept.h + +tmt8.obj: tmt8.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmt9.obj: tmt9.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmta.obj: tmta.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtb.obj: tmtb.cpp include.h newmat.h tmt.h myexcept.h + +tmtc.obj: tmtc.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtd.obj: tmtd.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmte.obj: tmte.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtf.obj: tmtf.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtg.obj: tmtg.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmth.obj: tmth.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmti.obj: tmti.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtj.obj: tmtj.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtk.obj: tmtk.cpp include.h newmatap.h newmatio.h tmt.h newmat.h myexcept.h + +tmtl.obj: tmtl.cpp newmat.h tmt.h include.h myexcept.h + +tmtm.obj: tmtm.cpp newmat.h newmatio.h tmt.h include.h myexcept.h + +example.obj: example.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nm_ex1.obj: nm_ex1.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nm_ex2.obj: nm_ex2.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nm_ex3.obj: nm_ex3.cpp newmatio.h precisio.h newmat.h include.h myexcept.h + +test_exc.obj: test_exc.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nl_ex.obj: nl_ex.cpp newmatnl.h newmatio.h newmat.h include.h myexcept.h + +newmatnl.obj: newmatnl.cpp newmatap.h newmatnl.h newmat.h include.h myexcept.h + +sl_ex.obj: sl_ex.cpp include.h solution.h myexcept.h + +solution.obj: solution.cpp include.h myexcept.h solution.h + +garch.obj: garch.cpp newmatap.h newmatio.h newmatnl.h newmat.h include.h myexcept.h + +tmt.txx: tmt.exe + $(PRE)tmt > tmt.txx + $(DIFF) tmt.txt tmt.txx + +example.txx: example.exe + $(PRE)example > example.txx + $(DIFF) example.txt example.txx + +nm_ex1.txx: nm_ex1.exe + $(PRE)nm_ex1 > nm_ex1.txx + $(DIFF) nm_ex1.txt nm_ex1.txx + +nm_ex2.txx: nm_ex2.exe + $(PRE)nm_ex2 > nm_ex2.txx + $(DIFF) nm_ex2.txt nm_ex2.txx + +nm_ex3.txx: nm_ex3.exe + $(PRE)nm_ex3 > nm_ex3.txx + $(DIFF) nm_ex3.txt nm_ex3.txx + +test_exc.txx: test_exc.exe + $(PRE)test_exc > test_exc.txx + $(DIFF) test_exc.txt test_exc.txx + +nl_ex.txx: nl_ex.exe + $(PRE)nl_ex > nl_ex.txx + $(DIFF) nl_ex.txt nl_ex.txx + +sl_ex.txx: sl_ex.exe + $(PRE)sl_ex > sl_ex.txx + $(DIFF) sl_ex.txt sl_ex.txx + +garch.txx: garch.exe + $(PRE)garch > garch.txx + $(DIFF) garch.txt garch.txx + diff --git a/extern/newmat/nm_b56.mak b/extern/newmat/nm_b56.mak new file mode 100644 index 00000000..8414f19b --- /dev/null +++ b/extern/newmat/nm_b56.mak @@ -0,0 +1,234 @@ +BORLANDPATH = "C:\program files\Borland\BDS\4.0" + +TASM = TASM32 +TLIB = tlib +TLINK = ilink32 +LIBPATH = $(BORLANDPATH)\LIB +INCLUDEPATH = $(BORLANDPATH)\INCLUDE + +DIFF = sdiff +PRE = + +CC = bcc32 -W- -v- -H- -6 -Og -Oi -Ov -I$(INCLUDEPATH) + +.cpp.obj: + $(CC) -c {$< } + +everything: tmt.exe example.exe nm_ex1.exe nm_ex2.exe nm_ex3.exe test_exc.exe nl_ex.exe sl_ex.exe garch.exe + +newmat_lobj = newmat1.obj newmat2.obj newmat3.obj newmat4.obj newmat5.obj newmat6.obj newmat7.obj newmat8.obj newmatex.obj bandmat.obj submat.obj myexcept.obj cholesky.obj evalue.obj fft.obj hholder.obj jacobi.obj newfft.obj sort.obj svd.obj nm_misc.obj newmatrm.obj newmat9.obj + +newmat.lib: $(newmat_lobj) + $(TLIB) $@ /P32 /u $(newmat_lobj) + +tmt_obj = tmt.obj tmt1.obj tmt2.obj tmt3.obj tmt4.obj tmt5.obj tmt6.obj tmt7.obj tmt8.obj tmt9.obj tmta.obj tmtb.obj tmtc.obj tmtd.obj tmte.obj tmtf.obj tmtg.obj tmth.obj tmti.obj tmtj.obj tmtk.obj tmtl.obj tmtm.obj + +tmt.exe: $(tmt_obj) newmat.lib + $(TLINK) /x/L$(LIBPATH)/Gn -Tpe -ap -c @&&| +c0x32.obj $(tmt_obj),$@,, newmat.lib import32.lib cw32.lib +| + +example_obj = example.obj + +example.exe: $(example_obj) newmat.lib + $(TLINK) /x/L$(LIBPATH)/Gn -Tpe -ap -c @&&| +c0x32.obj $(example_obj),$@,, newmat.lib import32.lib cw32.lib +| + +nm_ex1_obj = nm_ex1.obj + +nm_ex1.exe: $(nm_ex1_obj) newmat.lib + $(TLINK) /x/L$(LIBPATH)/Gn -Tpe -ap -c @&&| +c0x32.obj $(nm_ex1_obj),$@,, newmat.lib import32.lib cw32.lib +| + +nm_ex2_obj = nm_ex2.obj + +nm_ex2.exe: $(nm_ex2_obj) newmat.lib + $(TLINK) /x/L$(LIBPATH)/Gn -Tpe -ap -c @&&| +c0x32.obj $(nm_ex2_obj),$@,, newmat.lib import32.lib cw32.lib +| + +nm_ex3_obj = nm_ex3.obj + +nm_ex3.exe: $(nm_ex3_obj) newmat.lib + $(TLINK) /x/L$(LIBPATH)/Gn -Tpe -ap -c @&&| +c0x32.obj $(nm_ex3_obj),$@,, newmat.lib import32.lib cw32.lib +| + +test_exc_obj = test_exc.obj + +test_exc.exe: $(test_exc_obj) newmat.lib + $(TLINK) /x/L$(LIBPATH)/Gn -Tpe -ap -c @&&| +c0x32.obj $(test_exc_obj),$@,, newmat.lib import32.lib cw32.lib +| + +nl_ex_obj = nl_ex.obj newmatnl.obj + +nl_ex.exe: $(nl_ex_obj) newmat.lib + $(TLINK) /x/L$(LIBPATH)/Gn -Tpe -ap -c @&&| +c0x32.obj $(nl_ex_obj),$@,, newmat.lib import32.lib cw32.lib +| + +sl_ex_obj = sl_ex.obj solution.obj myexcept.obj + +sl_ex.exe: $(sl_ex_obj) + $(TLINK) /x/L$(LIBPATH)/Gn -Tpe -ap -c @&&| +c0x32.obj $(sl_ex_obj),$@,,import32.lib cw32.lib +| + +garch_obj = garch.obj newmatnl.obj + +garch.exe: $(garch_obj) newmat.lib + $(TLINK) /x/L$(LIBPATH)/Gn -Tpe -ap -c @&&| +c0x32.obj $(garch_obj),$@,, newmat.lib import32.lib cw32.lib +| + +newmat1.obj: newmat1.cpp newmat.h include.h myexcept.h + +newmat2.obj: newmat2.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat3.obj: newmat3.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat4.obj: newmat4.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat5.obj: newmat5.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat6.obj: newmat6.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat7.obj: newmat7.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat8.obj: newmat8.cpp include.h newmat.h newmatrc.h precisio.h myexcept.h controlw.h + +newmatex.obj: newmatex.cpp include.h newmat.h myexcept.h + +bandmat.obj: bandmat.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +submat.obj: submat.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +myexcept.obj: myexcept.cpp include.h myexcept.h + +cholesky.obj: cholesky.cpp include.h newmat.h newmatrm.h myexcept.h + +evalue.obj: evalue.cpp include.h newmatap.h newmatrm.h precisio.h newmat.h myexcept.h + +fft.obj: fft.cpp include.h newmatap.h newmat.h myexcept.h + +hholder.obj: hholder.cpp include.h newmatap.h newmat.h myexcept.h + +jacobi.obj: jacobi.cpp include.h newmatap.h precisio.h newmatrm.h newmat.h myexcept.h + +newfft.obj: newfft.cpp newmatap.h newmat.h include.h myexcept.h + +sort.obj: sort.cpp include.h newmatap.h newmat.h myexcept.h + +svd.obj: svd.cpp include.h newmatap.h newmatrm.h precisio.h newmat.h myexcept.h + +nm_misc.obj: nm_misc.cpp include.h newmatap.h newmat.h myexcept.h + +newmatrm.obj: newmatrm.cpp newmat.h newmatrm.h include.h myexcept.h + +newmat9.obj: newmat9.cpp include.h newmat.h newmatio.h newmatrc.h myexcept.h controlw.h + +tmt.obj: tmt.cpp include.h newmat.h tmt.h myexcept.h + +tmt1.obj: tmt1.cpp include.h newmat.h tmt.h myexcept.h + +tmt2.obj: tmt2.cpp include.h newmat.h tmt.h myexcept.h + +tmt3.obj: tmt3.cpp include.h newmat.h tmt.h myexcept.h + +tmt4.obj: tmt4.cpp include.h newmat.h tmt.h myexcept.h + +tmt5.obj: tmt5.cpp include.h newmat.h tmt.h myexcept.h + +tmt6.obj: tmt6.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmt7.obj: tmt7.cpp include.h newmat.h tmt.h myexcept.h + +tmt8.obj: tmt8.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmt9.obj: tmt9.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmta.obj: tmta.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtb.obj: tmtb.cpp include.h newmat.h tmt.h myexcept.h + +tmtc.obj: tmtc.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtd.obj: tmtd.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmte.obj: tmte.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtf.obj: tmtf.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtg.obj: tmtg.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmth.obj: tmth.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmti.obj: tmti.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtj.obj: tmtj.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtk.obj: tmtk.cpp include.h newmatap.h newmatio.h tmt.h newmat.h myexcept.h + +tmtl.obj: tmtl.cpp newmat.h tmt.h include.h myexcept.h + +tmtm.obj: tmtm.cpp newmat.h newmatio.h tmt.h include.h myexcept.h + +example.obj: example.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nm_ex1.obj: nm_ex1.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nm_ex2.obj: nm_ex2.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nm_ex3.obj: nm_ex3.cpp newmatio.h precisio.h newmat.h include.h myexcept.h + +test_exc.obj: test_exc.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nl_ex.obj: nl_ex.cpp newmatnl.h newmatio.h newmat.h include.h myexcept.h + +newmatnl.obj: newmatnl.cpp newmatap.h newmatnl.h newmat.h include.h myexcept.h + +sl_ex.obj: sl_ex.cpp include.h solution.h myexcept.h + +solution.obj: solution.cpp include.h myexcept.h solution.h + +garch.obj: garch.cpp newmatap.h newmatio.h newmatnl.h newmat.h include.h myexcept.h + +tmt.txx: tmt.exe + $(PRE)tmt > tmt.txx + $(DIFF) tmt.txt tmt.txx + +example.txx: example.exe + $(PRE)example > example.txx + $(DIFF) example.txt example.txx + +nm_ex1.txx: nm_ex1.exe + $(PRE)nm_ex1 > nm_ex1.txx + $(DIFF) nm_ex1.txt nm_ex1.txx + +nm_ex2.txx: nm_ex2.exe + $(PRE)nm_ex2 > nm_ex2.txx + $(DIFF) nm_ex2.txt nm_ex2.txx + +nm_ex3.txx: nm_ex3.exe + $(PRE)nm_ex3 > nm_ex3.txx + $(DIFF) nm_ex3.txt nm_ex3.txx + +test_exc.txx: test_exc.exe + $(PRE)test_exc > test_exc.txx + $(DIFF) test_exc.txt test_exc.txx + +nl_ex.txx: nl_ex.exe + $(PRE)nl_ex > nl_ex.txx + $(DIFF) nl_ex.txt nl_ex.txx + +sl_ex.txx: sl_ex.exe + $(PRE)sl_ex > sl_ex.txx + $(DIFF) sl_ex.txt sl_ex.txx + +garch.txx: garch.exe + $(PRE)garch > garch.txx + $(DIFF) garch.txt garch.txx + diff --git a/extern/newmat/nm_cc.mak b/extern/newmat/nm_cc.mak new file mode 100644 index 00000000..cb3a7354 --- /dev/null +++ b/extern/newmat/nm_cc.mak @@ -0,0 +1,217 @@ +CXX = CC +CXXFLAGS = -O2 + +DIFF = ./sdiff +PRE = ./ + + +.SUFFIXES: +.SUFFIXES: .a .o .c .cpp + +.cpp.o: + rm -f $*.cxx + ln $*.cpp $*.cxx + $(CXX) $(CXXFLAGS) -c $*.cxx + rm $*.cxx + +everything: tmt example nm_ex1 nm_ex2 nm_ex3 test_exc nl_ex sl_ex garch + +newmat_lobj = newmat1.o newmat2.o newmat3.o newmat4.o newmat5.o newmat6.o newmat7.o newmat8.o newmatex.o bandmat.o submat.o myexcept.o cholesky.o evalue.o fft.o hholder.o jacobi.o newfft.o sort.o svd.o nm_misc.o newmatrm.o newmat9.o + +libnewmat.a: $(newmat_lobj) + $(AR) -cr $@ $(newmat_lobj) + ranlib $@ + +tmt_obj = tmt.o tmt1.o tmt2.o tmt3.o tmt4.o tmt5.o tmt6.o tmt7.o tmt8.o tmt9.o tmta.o tmtb.o tmtc.o tmtd.o tmte.o tmtf.o tmtg.o tmth.o tmti.o tmtj.o tmtk.o tmtl.o tmtm.o + +tmt: $(tmt_obj) libnewmat.a + $(CXX) -o $@ $(tmt_obj) -L. -lnewmat -lm + +example_obj = example.o + +example: $(example_obj) libnewmat.a + $(CXX) -o $@ $(example_obj) -L. -lnewmat -lm + +nm_ex1_obj = nm_ex1.o + +nm_ex1: $(nm_ex1_obj) libnewmat.a + $(CXX) -o $@ $(nm_ex1_obj) -L. -lnewmat -lm + +nm_ex2_obj = nm_ex2.o + +nm_ex2: $(nm_ex2_obj) libnewmat.a + $(CXX) -o $@ $(nm_ex2_obj) -L. -lnewmat -lm + +nm_ex3_obj = nm_ex3.o + +nm_ex3: $(nm_ex3_obj) libnewmat.a + $(CXX) -o $@ $(nm_ex3_obj) -L. -lnewmat -lm + +test_exc_obj = test_exc.o + +test_exc: $(test_exc_obj) libnewmat.a + $(CXX) -o $@ $(test_exc_obj) -L. -lnewmat -lm + +nl_ex_obj = nl_ex.o newmatnl.o + +nl_ex: $(nl_ex_obj) libnewmat.a + $(CXX) -o $@ $(nl_ex_obj) -L. -lnewmat -lm + +sl_ex_obj = sl_ex.o solution.o myexcept.o + +sl_ex: $(sl_ex_obj) + $(CXX) -o $@ $(sl_ex_obj) -L. -lm + +garch_obj = garch.o newmatnl.o + +garch: $(garch_obj) libnewmat.a + $(CXX) -o $@ $(garch_obj) -L. -lnewmat -lm + +newmat1.o: newmat1.cpp newmat.h include.h myexcept.h + +newmat2.o: newmat2.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat3.o: newmat3.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat4.o: newmat4.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat5.o: newmat5.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat6.o: newmat6.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat7.o: newmat7.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat8.o: newmat8.cpp include.h newmat.h newmatrc.h precisio.h myexcept.h controlw.h + +newmatex.o: newmatex.cpp include.h newmat.h myexcept.h + +bandmat.o: bandmat.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +submat.o: submat.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +myexcept.o: myexcept.cpp include.h myexcept.h + +cholesky.o: cholesky.cpp include.h newmat.h newmatrm.h myexcept.h + +evalue.o: evalue.cpp include.h newmatap.h newmatrm.h precisio.h newmat.h myexcept.h + +fft.o: fft.cpp include.h newmatap.h newmat.h myexcept.h + +hholder.o: hholder.cpp include.h newmatap.h newmat.h myexcept.h + +jacobi.o: jacobi.cpp include.h newmatap.h precisio.h newmatrm.h newmat.h myexcept.h + +newfft.o: newfft.cpp newmatap.h newmat.h include.h myexcept.h + +sort.o: sort.cpp include.h newmatap.h newmat.h myexcept.h + +svd.o: svd.cpp include.h newmatap.h newmatrm.h precisio.h newmat.h myexcept.h + +nm_misc.o: nm_misc.cpp include.h newmatap.h newmat.h myexcept.h + +newmatrm.o: newmatrm.cpp newmat.h newmatrm.h include.h myexcept.h + +newmat9.o: newmat9.cpp include.h newmat.h newmatio.h newmatrc.h myexcept.h controlw.h + +tmt.o: tmt.cpp include.h newmat.h tmt.h myexcept.h + +tmt1.o: tmt1.cpp include.h newmat.h tmt.h myexcept.h + +tmt2.o: tmt2.cpp include.h newmat.h tmt.h myexcept.h + +tmt3.o: tmt3.cpp include.h newmat.h tmt.h myexcept.h + +tmt4.o: tmt4.cpp include.h newmat.h tmt.h myexcept.h + +tmt5.o: tmt5.cpp include.h newmat.h tmt.h myexcept.h + +tmt6.o: tmt6.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmt7.o: tmt7.cpp include.h newmat.h tmt.h myexcept.h + +tmt8.o: tmt8.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmt9.o: tmt9.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmta.o: tmta.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtb.o: tmtb.cpp include.h newmat.h tmt.h myexcept.h + +tmtc.o: tmtc.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtd.o: tmtd.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmte.o: tmte.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtf.o: tmtf.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtg.o: tmtg.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmth.o: tmth.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmti.o: tmti.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtj.o: tmtj.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtk.o: tmtk.cpp include.h newmatap.h newmatio.h tmt.h newmat.h myexcept.h + +tmtl.o: tmtl.cpp newmat.h tmt.h include.h myexcept.h + +tmtm.o: tmtm.cpp newmat.h newmatio.h tmt.h include.h myexcept.h + +example.o: example.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nm_ex1.o: nm_ex1.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nm_ex2.o: nm_ex2.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nm_ex3.o: nm_ex3.cpp newmatio.h precisio.h newmat.h include.h myexcept.h + +test_exc.o: test_exc.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nl_ex.o: nl_ex.cpp newmatnl.h newmatio.h newmat.h include.h myexcept.h + +newmatnl.o: newmatnl.cpp newmatap.h newmatnl.h newmat.h include.h myexcept.h + +sl_ex.o: sl_ex.cpp include.h solution.h myexcept.h + +solution.o: solution.cpp include.h myexcept.h solution.h + +garch.o: garch.cpp newmatap.h newmatio.h newmatnl.h newmat.h include.h myexcept.h + +tmt.txx: tmt + $(PRE)tmt > tmt.txx + $(DIFF) tmt.txt tmt.txx + +example.txx: example + $(PRE)example > example.txx + $(DIFF) example.txt example.txx + +nm_ex1.txx: nm_ex1 + $(PRE)nm_ex1 > nm_ex1.txx + $(DIFF) nm_ex1.txt nm_ex1.txx + +nm_ex2.txx: nm_ex2 + $(PRE)nm_ex2 > nm_ex2.txx + $(DIFF) nm_ex2.txt nm_ex2.txx + +nm_ex3.txx: nm_ex3 + $(PRE)nm_ex3 > nm_ex3.txx + $(DIFF) nm_ex3.txt nm_ex3.txx + +test_exc.txx: test_exc + $(PRE)test_exc > test_exc.txx + $(DIFF) test_exc.txt test_exc.txx + +nl_ex.txx: nl_ex + $(PRE)nl_ex > nl_ex.txx + $(DIFF) nl_ex.txt nl_ex.txx + +sl_ex.txx: sl_ex + $(PRE)sl_ex > sl_ex.txx + $(DIFF) sl_ex.txt sl_ex.txx + +garch.txx: garch + $(PRE)garch > garch.txx + $(DIFF) garch.txt garch.txx + diff --git a/extern/newmat/nm_ex1.cpp b/extern/newmat/nm_ex1.cpp new file mode 100644 index 00000000..05bb45c3 --- /dev/null +++ b/extern/newmat/nm_ex1.cpp @@ -0,0 +1,63 @@ +/// \ingroup newmat +///@{ + +/// \file nm_ex1.cpp +/// Very simple example 1. +/// Invert a 4 x 4 matrix then check the result + +#define WANT_STREAM // include iostream and iomanipulators + +#include "newmatap.h" // newmat advanced functions + // should not be required for this example + // included because it seems to help MS VC6 + // when you have namespace turned on + +#include "newmatio.h" // newmat headers including output functions + +#ifdef use_namespace +using namespace RBD_LIBRARIES; +#endif + + +int my_main() // called by main() +{ + Tracer tr("my_main "); // for tracking exceptions + + // declare a matrix + Matrix X(4,4); + + // load values row by row + X.row(1) << 3.7 << -2.1 << 7.4 << -1.0; + X.row(2) << 4.1 << 0.0 << 3.9 << 4.0; + X.row(3) << -2.5 << 1.9 << -0.4 << 7.3; + X.row(4) << 1.5 << 9.8 << -2.1 << 1.1; + + // print the matrix + cout << "Matrix X" << endl; + cout << setw(15) << setprecision(8) << X << endl; + + // calculate its inverse and print it + Matrix Y = X.i(); + cout << "Inverse of X" << endl; + cout << setw(15) << setprecision(8) << Y << endl; + + // multiply X by its inverse and print the result (should be near identity) + cout << "X * inverse of X" << endl; + cout << setw(15) << setprecision(8) << (X * Y) << endl; + + return 0; +} + + +// call my_main() - use this to catch exceptions +// use macros for exception names for compatibility with simulated exceptions +int main() +{ + Try { return my_main(); } + Catch(BaseException) { cout << BaseException::what() << "\n"; } + CatchAll { cout << "\nProgram fails - exception generated\n\n"; } + return 0; +} + +///@} + diff --git a/extern/newmat/nm_ex1.txt b/extern/newmat/nm_ex1.txt new file mode 100644 index 00000000..53eab140 --- /dev/null +++ b/extern/newmat/nm_ex1.txt @@ -0,0 +1,18 @@ +Matrix X + 3.70000000 -2.10000000 7.40000000 -1.00000000 + 4.10000000 0.00000000 3.90000000 4.00000000 + -2.50000000 1.90000000 -0.40000000 7.30000000 + 1.50000000 9.80000000 -2.10000000 1.10000000 + +Inverse of X + -0.15613535 0.27856000 -0.17406776 0.00029026 + 0.07956310 -0.08691703 0.04180094 0.11098579 + 0.22744144 -0.14910111 0.10868682 0.02766552 + -0.06171667 0.10984958 0.07244980 -0.02727139 + +X * inverse of X + 1.00000000 -0.00000000 0.00000000 0.00000000 + 0.00000000 1.00000000 0.00000000 0.00000000 + -0.00000000 -0.00000000 1.00000000 -0.00000000 + -0.00000000 0.00000000 0.00000000 1.00000000 + diff --git a/extern/newmat/nm_ex2.cpp b/extern/newmat/nm_ex2.cpp new file mode 100644 index 00000000..d0887a8a --- /dev/null +++ b/extern/newmat/nm_ex2.cpp @@ -0,0 +1,76 @@ +/// \ingroup newmat +///@{ + +/// \file nm_ex2.cpp +/// Very simple example 2. +/// +/// Generate a Hilbert matrix and work out its eigenvalues +/// and eigenvectors; check result by multiplying out. +/// +/// The Hilbert matrix is notoriously ill-conditioned (difficult to invert). +/// In this example, I calculate the eigenvalues of a 7 x 7 Hilbert matrix. +/// +/// The dimensions of this matrix are not large enough for there to be numerical +/// problems but we will be able to see that wide range of values of the +/// eigenvalues. + +#define WANT_STREAM // include iostream and iomanipulators + +#include "newmatap.h" // newmat headers including advanced functions +#include "newmatio.h" // newmat headers including output functions + +#ifdef use_namespace +using namespace RBD_LIBRARIES; +#endif + + +int my_main() // called by main() +{ + Tracer tr("my_main "); // for tracking exceptions + + int n = 7; // this is the order we will work with + int i, j; + + // declare a matrix + SymmetricMatrix H(n); + + // load values for Hilbert matrix + for (i = 1; i <= n; ++i) for (j = 1; j <= i; ++j) + H(i, j) = 1.0 / (i + j - 1); + + // print the matrix + cout << "SymmetricMatrix H" << endl; + cout << setw(10) << setprecision(7) << H << endl; + + // calculate its eigenvalues and eigenvectors and print them + Matrix U; DiagonalMatrix D; + eigenvalues(H, D, U); + cout << "Eigenvalues of H" << endl; + cout << setw(17) << setprecision(14) << D.as_column() << endl; + cout << "Eigenvector matrix, U" << endl; + cout << setw(10) << setprecision(7) << U << endl; + + // check orthogonality + cout << "U * U.t() (should be near identity)" << endl; + cout << setw(10) << setprecision(7) << (U * U.t()) << endl; + + // check decomposition + cout << "U * D * U.t() (should be near H)" << endl; + cout << setw(10) << setprecision(7) << (U * D * U.t()) << endl; + + return 0; +} + + +// call my_main() - use this to catch exceptions +// use macros for exception names for compatibility with simuated exceptions +int main() +{ + Try { return my_main(); } + Catch(BaseException) { cout << BaseException::what() << "\n"; } + CatchAll { cout << "\nProgram fails - exception generated\n\n"; } + return 0; +} + + +///@} diff --git a/extern/newmat/nm_ex2.txt b/extern/newmat/nm_ex2.txt new file mode 100644 index 00000000..fb988220 --- /dev/null +++ b/extern/newmat/nm_ex2.txt @@ -0,0 +1,45 @@ +SymmetricMatrix H + 1.0000000 0.5000000 0.3333333 0.2500000 0.2000000 0.1666667 0.1428571 + 0.5000000 0.3333333 0.2500000 0.2000000 0.1666667 0.1428571 0.1250000 + 0.3333333 0.2500000 0.2000000 0.1666667 0.1428571 0.1250000 0.1111111 + 0.2500000 0.2000000 0.1666667 0.1428571 0.1250000 0.1111111 0.1000000 + 0.2000000 0.1666667 0.1428571 0.1250000 0.1111111 0.1000000 0.0909091 + 0.1666667 0.1428571 0.1250000 0.1111111 0.1000000 0.0909091 0.0833333 + 0.1428571 0.1250000 0.1111111 0.1000000 0.0909091 0.0833333 0.0769231 + +Eigenvalues of H + 0.00000000349390 + 0.00000048567634 + 0.00002938636815 + 0.00100858761077 + 0.02128975490833 + 0.27192019814935 + 1.66088533892693 + +Eigenvector matrix, U + 0.0002451 -0.0024687 0.0159939 -0.0751873 0.2608426 0.6232385 -0.7332256 +-0.0098386 0.0617968 -0.2279023 0.5267775 -0.6705585 -0.1630715 -0.4363592 + 0.0951956 -0.3486749 0.6287534 -0.4256562 -0.2953295 -0.3215141 -0.3197791 +-0.3713200 0.6446867 -0.2003656 -0.4616761 0.0230466 -0.3573674 -0.2548856 + 0.6825295 -0.1743885 -0.4970150 -0.1711955 0.2336876 -0.3570683 -0.2128441 +-0.5910349 -0.5436283 -0.1848709 0.1826645 0.3678759 -0.3445700 -0.1831431 + 0.1944058 0.3647422 0.4807560 0.5097549 0.4523486 -0.3281347 -0.1609397 + +U * U.t() (should be near identity) + 1.0000000 -0.0000000 -0.0000000 0.0000000 -0.0000000 -0.0000000 0.0000000 +-0.0000000 1.0000000 0.0000000 -0.0000000 -0.0000000 -0.0000000 0.0000000 +-0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 -0.0000000 -0.0000000 + 0.0000000 -0.0000000 0.0000000 1.0000000 0.0000000 0.0000000 0.0000000 +-0.0000000 -0.0000000 0.0000000 0.0000000 1.0000000 -0.0000000 0.0000000 +-0.0000000 -0.0000000 -0.0000000 0.0000000 -0.0000000 1.0000000 0.0000000 + 0.0000000 0.0000000 -0.0000000 0.0000000 0.0000000 0.0000000 1.0000000 + +U * D * U.t() (should be near H) + 1.0000000 0.5000000 0.3333333 0.2500000 0.2000000 0.1666667 0.1428571 + 0.5000000 0.3333333 0.2500000 0.2000000 0.1666667 0.1428571 0.1250000 + 0.3333333 0.2500000 0.2000000 0.1666667 0.1428571 0.1250000 0.1111111 + 0.2500000 0.2000000 0.1666667 0.1428571 0.1250000 0.1111111 0.1000000 + 0.2000000 0.1666667 0.1428571 0.1250000 0.1111111 0.1000000 0.0909091 + 0.1666667 0.1428571 0.1250000 0.1111111 0.1000000 0.0909091 0.0833333 + 0.1428571 0.1250000 0.1111111 0.1000000 0.0909091 0.0833333 0.0769231 + diff --git a/extern/newmat/nm_ex3.cpp b/extern/newmat/nm_ex3.cpp new file mode 100644 index 00000000..8c3309fd --- /dev/null +++ b/extern/newmat/nm_ex3.cpp @@ -0,0 +1,103 @@ +/// \ingroup newmat +///@{ + +/// \file nm_ex3.cpp +/// Print out values from precisio.h + +#define WANT_STREAM +#define WANT_MATH + +#include "newmatio.h" +#include "precisio.h" + +#ifdef use_namespace +using namespace RBD_LIBRARIES; +#endif + + +int my_main() // called by main() +{ + Tracer tr("my_main "); // for tracking exceptions + + cout << "Values from precisio.h" << endl; + cout << "printed as individual numbers - no special formatting" + << endl << endl; + cout << "Epsilon " << FloatingPointPrecision::Epsilon() << endl; + cout << "Maximum " << FloatingPointPrecision::Maximum() << endl; + cout << "LnMaximum " << FloatingPointPrecision::LnMaximum() << endl; + cout << "Minimum " << FloatingPointPrecision::Minimum() << endl; + cout << "LnMinimum " << FloatingPointPrecision::LnMinimum() << endl; + cout << endl; + + ColumnVector values(5), sel_values(4); + + values(1) = sel_values(1) = FloatingPointPrecision::Epsilon(); + values(2) = FloatingPointPrecision::Maximum(); + values(3) = sel_values(2) = FloatingPointPrecision::LnMaximum(); + values(4) = sel_values(3) = FloatingPointPrecision::Minimum(); + values(5) = sel_values(4) = FloatingPointPrecision::LnMinimum(); + + cout << "Load values into a ColumnVector and print in scientific format" + << endl << endl; + cout << "Values in scientific format" << endl; + cout << setw(15) << setprecision(5) << scientific << values << endl; + + cout << "Print in fixed format" << endl << endl; + cout << "Selected values in fixed format (omit Maximum)" << endl; + cout << setw(15) << setprecision(5) << fixed << sel_values << endl; + + cout << "Test Epsilon" << endl << endl; + Real x = 1.0 + FloatingPointPrecision::Epsilon(); + cout << "This value should be non-zero" << endl; + cout << "(1.0 + Epsilon) - 1.0 " << setw(15) << setprecision(5) << + scientific << (Real)(x - 1.0) << endl; + x = 1.0 + FloatingPointPrecision::Epsilon() / 2.0; + cout << "This value should be zero" << endl; + cout << "(1.0 + Epsilon / 2) - 1.0" << setw(15) << setprecision(5) << + scientific << (Real)(x - 1.0) << endl; + cout << endl; + + cout << "Test Minimum" << endl << endl; + cout << "This value should be non-zero" << endl; + cout << "Minimum " << setw(15) << setprecision(5) << + scientific << FloatingPointPrecision::Minimum() << endl; + x = FloatingPointPrecision::Minimum() * FloatingPointPrecision::Epsilon(); + cout << "Not clear whether this should be zero" << endl; + cout << "Minimum * Epsilon " << setw(15) << setprecision(5) << + scientific << x << endl; + x /= 2.0; + cout << "This value should be zero" << endl; + cout << "Minimum * Epsilon / 2.0 " << setw(15) << setprecision(5) << + scientific << x << endl; + cout << endl; + + cout << "Test LnMaximum and LnMinimum" << endl << endl; + x = exp(FloatingPointPrecision::LnMaximum()); + cout << "This should print a value close to Maximum" << endl; + cout << "Fails with some compilers - needs fixing" << endl; + cout << "exp(LnMaximum) " << setw(15) << setprecision(5) << + scientific << x << endl; + x = exp(FloatingPointPrecision::LnMinimum()); + cout << "This should print a value close to Minimum, not zero" << endl; + cout << "exp(LnMinimum) " << setw(15) << setprecision(5) << + scientific << x << endl; + cout << endl; + + + + return 0; +} + + +// call my_main() - use this to catch exceptions +// use macros for exception names for compatibility with simulated exceptions +int main() +{ + Try { return my_main(); } + Catch(BaseException) { cout << BaseException::what() << "\n"; } + CatchAll { cout << "\nProgram fails - exception generated\n\n"; } + return 0; +} + +///@} + diff --git a/extern/newmat/nm_ex3.txt b/extern/newmat/nm_ex3.txt new file mode 100644 index 00000000..6bb79ff4 --- /dev/null +++ b/extern/newmat/nm_ex3.txt @@ -0,0 +1,50 @@ +Values from precisio.h +printed as individual numbers - no special formatting + +Epsilon 2.22045e-016 +Maximum 1.79769e+308 +LnMaximum 709.783 +Minimum 2.22507e-308 +LnMinimum -708.396 + +Load values into a ColumnVector and print in scientific format + +Values in scientific format + 2.22045e-016 + 1.79769e+308 + 7.09783e+002 + 2.22507e-308 + -7.08396e+002 + +Print in fixed format + +Selected values in fixed format (omit Maximum) + 0.00000 + 709.78271 + 0.00000 + -708.39642 + +Test Epsilon + +This value should be non-zero +(1.0 + Epsilon) - 1.0 2.22045e-016 +This value should be zero +(1.0 + Epsilon / 2) - 1.0 0.00000e+000 + +Test Minimum + +This value should be non-zero +Minimum 2.22507e-308 +Not clear whether this should be zero +Minimum * Epsilon 4.94066e-324 +This value should be zero +Minimum * Epsilon / 2.0 0.00000e+000 + +Test LnMaximum and LnMinimum + +This should print a value close to Maximum +Fails with some compilers - needs fixing +exp(LnMaximum) 1.79769e+308 +This should print a value close to Minimum, not zero +exp(LnMinimum) 2.22507e-308 + diff --git a/extern/newmat/nm_gnu.mak b/extern/newmat/nm_gnu.mak new file mode 100644 index 00000000..aca0335a --- /dev/null +++ b/extern/newmat/nm_gnu.mak @@ -0,0 +1,212 @@ +CXX = g++ +CXXFLAGS = -O2 -Wall + +DIFF = ./sdiff +PRE = ./ +MAJOR = 1 +MINOR = 0 + +%.o: %.cpp + $(CXX) $(CXXFLAGS) -c $*.cpp + +everything: tmt example nm_ex1 nm_ex2 nm_ex3 test_exc nl_ex sl_ex garch + +newmat_lobj = newmat1.o newmat2.o newmat3.o newmat4.o newmat5.o newmat6.o newmat7.o newmat8.o newmatex.o bandmat.o submat.o myexcept.o cholesky.o evalue.o fft.o hholder.o jacobi.o newfft.o sort.o svd.o nm_misc.o newmatrm.o newmat9.o + +libnewmat.a: $(newmat_lobj) + $(AR) -cr $@ $(newmat_lobj) + ranlib $@ + +tmt_obj = tmt.o tmt1.o tmt2.o tmt3.o tmt4.o tmt5.o tmt6.o tmt7.o tmt8.o tmt9.o tmta.o tmtb.o tmtc.o tmtd.o tmte.o tmtf.o tmtg.o tmth.o tmti.o tmtj.o tmtk.o tmtl.o tmtm.o + +tmt: $(tmt_obj) libnewmat.a + $(CXX) -o $@ $(tmt_obj) -L. -lnewmat -lm + +example_obj = example.o + +example: $(example_obj) libnewmat.a + $(CXX) -o $@ $(example_obj) -L. -lnewmat -lm + +nm_ex1_obj = nm_ex1.o + +nm_ex1: $(nm_ex1_obj) libnewmat.a + $(CXX) -o $@ $(nm_ex1_obj) -L. -lnewmat -lm + +nm_ex2_obj = nm_ex2.o + +nm_ex2: $(nm_ex2_obj) libnewmat.a + $(CXX) -o $@ $(nm_ex2_obj) -L. -lnewmat -lm + +nm_ex3_obj = nm_ex3.o + +nm_ex3: $(nm_ex3_obj) libnewmat.a + $(CXX) -o $@ $(nm_ex3_obj) -L. -lnewmat -lm + +test_exc_obj = test_exc.o + +test_exc: $(test_exc_obj) libnewmat.a + $(CXX) -o $@ $(test_exc_obj) -L. -lnewmat -lm + +nl_ex_obj = nl_ex.o newmatnl.o + +nl_ex: $(nl_ex_obj) libnewmat.a + $(CXX) -o $@ $(nl_ex_obj) -L. -lnewmat -lm + +sl_ex_obj = sl_ex.o solution.o myexcept.o + +sl_ex: $(sl_ex_obj) + $(CXX) -o $@ $(sl_ex_obj) -L. -lm + +garch_obj = garch.o newmatnl.o + +garch: $(garch_obj) libnewmat.a + $(CXX) -o $@ $(garch_obj) -L. -lnewmat -lm + +newmat1.o: newmat1.cpp newmat.h include.h myexcept.h + +newmat2.o: newmat2.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat3.o: newmat3.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat4.o: newmat4.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat5.o: newmat5.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat6.o: newmat6.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat7.o: newmat7.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat8.o: newmat8.cpp include.h newmat.h newmatrc.h precisio.h myexcept.h controlw.h + +newmatex.o: newmatex.cpp include.h newmat.h myexcept.h + +bandmat.o: bandmat.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +submat.o: submat.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +myexcept.o: myexcept.cpp include.h myexcept.h + +cholesky.o: cholesky.cpp include.h newmat.h newmatrm.h myexcept.h + +evalue.o: evalue.cpp include.h newmatap.h newmatrm.h precisio.h newmat.h myexcept.h + +fft.o: fft.cpp include.h newmatap.h newmat.h myexcept.h + +hholder.o: hholder.cpp include.h newmatap.h newmat.h myexcept.h + +jacobi.o: jacobi.cpp include.h newmatap.h precisio.h newmatrm.h newmat.h myexcept.h + +newfft.o: newfft.cpp newmatap.h newmat.h include.h myexcept.h + +sort.o: sort.cpp include.h newmatap.h newmat.h myexcept.h + +svd.o: svd.cpp include.h newmatap.h newmatrm.h precisio.h newmat.h myexcept.h + +nm_misc.o: nm_misc.cpp include.h newmatap.h newmat.h myexcept.h + +newmatrm.o: newmatrm.cpp newmat.h newmatrm.h include.h myexcept.h + +newmat9.o: newmat9.cpp include.h newmat.h newmatio.h newmatrc.h myexcept.h controlw.h + +tmt.o: tmt.cpp include.h newmat.h tmt.h myexcept.h + +tmt1.o: tmt1.cpp include.h newmat.h tmt.h myexcept.h + +tmt2.o: tmt2.cpp include.h newmat.h tmt.h myexcept.h + +tmt3.o: tmt3.cpp include.h newmat.h tmt.h myexcept.h + +tmt4.o: tmt4.cpp include.h newmat.h tmt.h myexcept.h + +tmt5.o: tmt5.cpp include.h newmat.h tmt.h myexcept.h + +tmt6.o: tmt6.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmt7.o: tmt7.cpp include.h newmat.h tmt.h myexcept.h + +tmt8.o: tmt8.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmt9.o: tmt9.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmta.o: tmta.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtb.o: tmtb.cpp include.h newmat.h tmt.h myexcept.h + +tmtc.o: tmtc.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtd.o: tmtd.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmte.o: tmte.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtf.o: tmtf.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtg.o: tmtg.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmth.o: tmth.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmti.o: tmti.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtj.o: tmtj.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtk.o: tmtk.cpp include.h newmatap.h newmatio.h tmt.h newmat.h myexcept.h + +tmtl.o: tmtl.cpp newmat.h tmt.h include.h myexcept.h + +tmtm.o: tmtm.cpp newmat.h newmatio.h tmt.h include.h myexcept.h + +example.o: example.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nm_ex1.o: nm_ex1.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nm_ex2.o: nm_ex2.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nm_ex3.o: nm_ex3.cpp newmatio.h precisio.h newmat.h include.h myexcept.h + +test_exc.o: test_exc.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nl_ex.o: nl_ex.cpp newmatnl.h newmatio.h newmat.h include.h myexcept.h + +newmatnl.o: newmatnl.cpp newmatap.h newmatnl.h newmat.h include.h myexcept.h + +sl_ex.o: sl_ex.cpp include.h solution.h myexcept.h + +solution.o: solution.cpp include.h myexcept.h solution.h + +garch.o: garch.cpp newmatap.h newmatio.h newmatnl.h newmat.h include.h myexcept.h + +tmt.txx: tmt + $(PRE)tmt > tmt.txx + $(DIFF) tmt.txt tmt.txx + +example.txx: example + $(PRE)example > example.txx + $(DIFF) example.txt example.txx + +nm_ex1.txx: nm_ex1 + $(PRE)nm_ex1 > nm_ex1.txx + $(DIFF) nm_ex1.txt nm_ex1.txx + +nm_ex2.txx: nm_ex2 + $(PRE)nm_ex2 > nm_ex2.txx + $(DIFF) nm_ex2.txt nm_ex2.txx + +nm_ex3.txx: nm_ex3 + $(PRE)nm_ex3 > nm_ex3.txx + $(DIFF) nm_ex3.txt nm_ex3.txx + +test_exc.txx: test_exc + $(PRE)test_exc > test_exc.txx + $(DIFF) test_exc.txt test_exc.txx + +nl_ex.txx: nl_ex + $(PRE)nl_ex > nl_ex.txx + $(DIFF) nl_ex.txt nl_ex.txx + +sl_ex.txx: sl_ex + $(PRE)sl_ex > sl_ex.txx + $(DIFF) sl_ex.txt sl_ex.txx + +garch.txx: garch + $(PRE)garch > garch.txx + $(DIFF) garch.txt garch.txx + diff --git a/extern/newmat/nm_i10.mak b/extern/newmat/nm_i10.mak new file mode 100644 index 00000000..6fcf660f --- /dev/null +++ b/extern/newmat/nm_i10.mak @@ -0,0 +1,211 @@ + +conlibs = + +DIFF = sdiff +PRE = + +.SUFFIXES: .cpp + +.cpp.obj: + icl -c -GX -GR -Ge -GS -Qprec -Qprec_div -nologo -Qlong_double $*.cpp + +everything: tmt.exe example.exe nm_ex1.exe nm_ex2.exe nm_ex3.exe test_exc.exe nl_ex.exe sl_ex.exe garch.exe + +newmat_lobj = newmat1.obj newmat2.obj newmat3.obj newmat4.obj newmat5.obj newmat6.obj newmat7.obj newmat8.obj newmatex.obj bandmat.obj submat.obj myexcept.obj cholesky.obj evalue.obj fft.obj hholder.obj jacobi.obj newfft.obj sort.obj svd.obj nm_misc.obj newmatrm.obj newmat9.obj + +newmat.lib: $(newmat_lobj) + lib -Out:$@ $(newmat_lobj) + +tmt_obj = tmt.obj tmt1.obj tmt2.obj tmt3.obj tmt4.obj tmt5.obj tmt6.obj tmt7.obj tmt8.obj tmt9.obj tmta.obj tmtb.obj tmtc.obj tmtd.obj tmte.obj tmtf.obj tmtg.obj tmth.obj tmti.obj tmtj.obj tmtk.obj tmtl.obj tmtm.obj + +tmt.exe: $(tmt_obj) newmat.lib + link -Out:$@ $(conlibs) $(tmt_obj) newmat.lib + +example_obj = example.obj + +example.exe: $(example_obj) newmat.lib + link -Out:$@ $(conlibs) $(example_obj) newmat.lib + +nm_ex1_obj = nm_ex1.obj + +nm_ex1.exe: $(nm_ex1_obj) newmat.lib + link -Out:$@ $(conlibs) $(nm_ex1_obj) newmat.lib + +nm_ex2_obj = nm_ex2.obj + +nm_ex2.exe: $(nm_ex2_obj) newmat.lib + link -Out:$@ $(conlibs) $(nm_ex2_obj) newmat.lib + +nm_ex3_obj = nm_ex3.obj + +nm_ex3.exe: $(nm_ex3_obj) newmat.lib + link -Out:$@ $(conlibs) $(nm_ex3_obj) newmat.lib + +test_exc_obj = test_exc.obj + +test_exc.exe: $(test_exc_obj) newmat.lib + link -Out:$@ $(conlibs) $(test_exc_obj) newmat.lib + +nl_ex_obj = nl_ex.obj newmatnl.obj + +nl_ex.exe: $(nl_ex_obj) newmat.lib + link -Out:$@ $(conlibs) $(nl_ex_obj) newmat.lib + +sl_ex_obj = sl_ex.obj solution.obj myexcept.obj + +sl_ex.exe: $(sl_ex_obj) + link -Out:$@ $(conlibs) $(sl_ex_obj) + +garch_obj = garch.obj newmatnl.obj + +garch.exe: $(garch_obj) newmat.lib + link -Out:$@ $(conlibs) $(garch_obj) newmat.lib + +newmat1.obj: newmat1.cpp newmat.h include.h myexcept.h + +newmat2.obj: newmat2.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat3.obj: newmat3.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat4.obj: newmat4.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat5.obj: newmat5.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat6.obj: newmat6.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat7.obj: newmat7.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat8.obj: newmat8.cpp include.h newmat.h newmatrc.h precisio.h myexcept.h controlw.h + +newmatex.obj: newmatex.cpp include.h newmat.h myexcept.h + +bandmat.obj: bandmat.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +submat.obj: submat.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +myexcept.obj: myexcept.cpp include.h myexcept.h + +cholesky.obj: cholesky.cpp include.h newmat.h newmatrm.h myexcept.h + +evalue.obj: evalue.cpp include.h newmatap.h newmatrm.h precisio.h newmat.h myexcept.h + +fft.obj: fft.cpp include.h newmatap.h newmat.h myexcept.h + +hholder.obj: hholder.cpp include.h newmatap.h newmat.h myexcept.h + +jacobi.obj: jacobi.cpp include.h newmatap.h precisio.h newmatrm.h newmat.h myexcept.h + +newfft.obj: newfft.cpp newmatap.h newmat.h include.h myexcept.h + +sort.obj: sort.cpp include.h newmatap.h newmat.h myexcept.h + +svd.obj: svd.cpp include.h newmatap.h newmatrm.h precisio.h newmat.h myexcept.h + +nm_misc.obj: nm_misc.cpp include.h newmatap.h newmat.h myexcept.h + +newmatrm.obj: newmatrm.cpp newmat.h newmatrm.h include.h myexcept.h + +newmat9.obj: newmat9.cpp include.h newmat.h newmatio.h newmatrc.h myexcept.h controlw.h + +tmt.obj: tmt.cpp include.h newmat.h tmt.h myexcept.h + +tmt1.obj: tmt1.cpp include.h newmat.h tmt.h myexcept.h + +tmt2.obj: tmt2.cpp include.h newmat.h tmt.h myexcept.h + +tmt3.obj: tmt3.cpp include.h newmat.h tmt.h myexcept.h + +tmt4.obj: tmt4.cpp include.h newmat.h tmt.h myexcept.h + +tmt5.obj: tmt5.cpp include.h newmat.h tmt.h myexcept.h + +tmt6.obj: tmt6.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmt7.obj: tmt7.cpp include.h newmat.h tmt.h myexcept.h + +tmt8.obj: tmt8.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmt9.obj: tmt9.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmta.obj: tmta.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtb.obj: tmtb.cpp include.h newmat.h tmt.h myexcept.h + +tmtc.obj: tmtc.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtd.obj: tmtd.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmte.obj: tmte.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtf.obj: tmtf.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtg.obj: tmtg.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmth.obj: tmth.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmti.obj: tmti.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtj.obj: tmtj.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtk.obj: tmtk.cpp include.h newmatap.h newmatio.h tmt.h newmat.h myexcept.h + +tmtl.obj: tmtl.cpp newmat.h tmt.h include.h myexcept.h + +tmtm.obj: tmtm.cpp newmat.h newmatio.h tmt.h include.h myexcept.h + +example.obj: example.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nm_ex1.obj: nm_ex1.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nm_ex2.obj: nm_ex2.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nm_ex3.obj: nm_ex3.cpp newmatio.h precisio.h newmat.h include.h myexcept.h + +test_exc.obj: test_exc.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nl_ex.obj: nl_ex.cpp newmatnl.h newmatio.h newmat.h include.h myexcept.h + +newmatnl.obj: newmatnl.cpp newmatap.h newmatnl.h newmat.h include.h myexcept.h + +sl_ex.obj: sl_ex.cpp include.h solution.h myexcept.h + +solution.obj: solution.cpp include.h myexcept.h solution.h + +garch.obj: garch.cpp newmatap.h newmatio.h newmatnl.h newmat.h include.h myexcept.h + +tmt.txx: tmt.exe + $(PRE)tmt > tmt.txx + $(DIFF) tmt.txt tmt.txx + +example.txx: example.exe + $(PRE)example > example.txx + $(DIFF) example.txt example.txx + +nm_ex1.txx: nm_ex1.exe + $(PRE)nm_ex1 > nm_ex1.txx + $(DIFF) nm_ex1.txt nm_ex1.txx + +nm_ex2.txx: nm_ex2.exe + $(PRE)nm_ex2 > nm_ex2.txx + $(DIFF) nm_ex2.txt nm_ex2.txx + +nm_ex3.txx: nm_ex3.exe + $(PRE)nm_ex3 > nm_ex3.txx + $(DIFF) nm_ex3.txt nm_ex3.txx + +test_exc.txx: test_exc.exe + $(PRE)test_exc > test_exc.txx + $(DIFF) test_exc.txt test_exc.txx + +nl_ex.txx: nl_ex.exe + $(PRE)nl_ex > nl_ex.txx + $(DIFF) nl_ex.txt nl_ex.txx + +sl_ex.txx: sl_ex.exe + $(PRE)sl_ex > sl_ex.txx + $(DIFF) sl_ex.txt sl_ex.txx + +garch.txx: garch.exe + $(PRE)garch > garch.txx + $(DIFF) garch.txt garch.txx + diff --git a/extern/newmat/nm_i8.mak b/extern/newmat/nm_i8.mak new file mode 100644 index 00000000..30b36ba8 --- /dev/null +++ b/extern/newmat/nm_i8.mak @@ -0,0 +1,211 @@ + +conlibs = libm.lib libc.lib + +DIFF = sdiff +PRE = + +.SUFFIXES: .cpp + +.cpp.obj: + icl -c -GX -GR -Ge -GS -Qprec -Qprec_div -nologo -Qlong_double $*.cpp + +everything: tmt.exe example.exe nm_ex1.exe nm_ex2.exe nm_ex3.exe test_exc.exe nl_ex.exe sl_ex.exe garch.exe + +newmat_lobj = newmat1.obj newmat2.obj newmat3.obj newmat4.obj newmat5.obj newmat6.obj newmat7.obj newmat8.obj newmatex.obj bandmat.obj submat.obj myexcept.obj cholesky.obj evalue.obj fft.obj hholder.obj jacobi.obj newfft.obj sort.obj svd.obj nm_misc.obj newmatrm.obj newmat9.obj + +newmat.lib: $(newmat_lobj) + lib -Out:$@ $(newmat_lobj) + +tmt_obj = tmt.obj tmt1.obj tmt2.obj tmt3.obj tmt4.obj tmt5.obj tmt6.obj tmt7.obj tmt8.obj tmt9.obj tmta.obj tmtb.obj tmtc.obj tmtd.obj tmte.obj tmtf.obj tmtg.obj tmth.obj tmti.obj tmtj.obj tmtk.obj tmtl.obj tmtm.obj + +tmt.exe: $(tmt_obj) newmat.lib + link -Out:$@ $(conlibs) $(tmt_obj) newmat.lib + +example_obj = example.obj + +example.exe: $(example_obj) newmat.lib + link -Out:$@ $(conlibs) $(example_obj) newmat.lib + +nm_ex1_obj = nm_ex1.obj + +nm_ex1.exe: $(nm_ex1_obj) newmat.lib + link -Out:$@ $(conlibs) $(nm_ex1_obj) newmat.lib + +nm_ex2_obj = nm_ex2.obj + +nm_ex2.exe: $(nm_ex2_obj) newmat.lib + link -Out:$@ $(conlibs) $(nm_ex2_obj) newmat.lib + +nm_ex3_obj = nm_ex3.obj + +nm_ex3.exe: $(nm_ex3_obj) newmat.lib + link -Out:$@ $(conlibs) $(nm_ex3_obj) newmat.lib + +test_exc_obj = test_exc.obj + +test_exc.exe: $(test_exc_obj) newmat.lib + link -Out:$@ $(conlibs) $(test_exc_obj) newmat.lib + +nl_ex_obj = nl_ex.obj newmatnl.obj + +nl_ex.exe: $(nl_ex_obj) newmat.lib + link -Out:$@ $(conlibs) $(nl_ex_obj) newmat.lib + +sl_ex_obj = sl_ex.obj solution.obj myexcept.obj + +sl_ex.exe: $(sl_ex_obj) + link -Out:$@ $(conlibs) $(sl_ex_obj) + +garch_obj = garch.obj newmatnl.obj + +garch.exe: $(garch_obj) newmat.lib + link -Out:$@ $(conlibs) $(garch_obj) newmat.lib + +newmat1.obj: newmat1.cpp newmat.h include.h myexcept.h + +newmat2.obj: newmat2.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat3.obj: newmat3.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat4.obj: newmat4.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat5.obj: newmat5.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat6.obj: newmat6.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat7.obj: newmat7.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat8.obj: newmat8.cpp include.h newmat.h newmatrc.h precisio.h myexcept.h controlw.h + +newmatex.obj: newmatex.cpp include.h newmat.h myexcept.h + +bandmat.obj: bandmat.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +submat.obj: submat.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +myexcept.obj: myexcept.cpp include.h myexcept.h + +cholesky.obj: cholesky.cpp include.h newmat.h newmatrm.h myexcept.h + +evalue.obj: evalue.cpp include.h newmatap.h newmatrm.h precisio.h newmat.h myexcept.h + +fft.obj: fft.cpp include.h newmatap.h newmat.h myexcept.h + +hholder.obj: hholder.cpp include.h newmatap.h newmat.h myexcept.h + +jacobi.obj: jacobi.cpp include.h newmatap.h precisio.h newmatrm.h newmat.h myexcept.h + +newfft.obj: newfft.cpp newmatap.h newmat.h include.h myexcept.h + +sort.obj: sort.cpp include.h newmatap.h newmat.h myexcept.h + +svd.obj: svd.cpp include.h newmatap.h newmatrm.h precisio.h newmat.h myexcept.h + +nm_misc.obj: nm_misc.cpp include.h newmatap.h newmat.h myexcept.h + +newmatrm.obj: newmatrm.cpp newmat.h newmatrm.h include.h myexcept.h + +newmat9.obj: newmat9.cpp include.h newmat.h newmatio.h newmatrc.h myexcept.h controlw.h + +tmt.obj: tmt.cpp include.h newmat.h tmt.h myexcept.h + +tmt1.obj: tmt1.cpp include.h newmat.h tmt.h myexcept.h + +tmt2.obj: tmt2.cpp include.h newmat.h tmt.h myexcept.h + +tmt3.obj: tmt3.cpp include.h newmat.h tmt.h myexcept.h + +tmt4.obj: tmt4.cpp include.h newmat.h tmt.h myexcept.h + +tmt5.obj: tmt5.cpp include.h newmat.h tmt.h myexcept.h + +tmt6.obj: tmt6.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmt7.obj: tmt7.cpp include.h newmat.h tmt.h myexcept.h + +tmt8.obj: tmt8.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmt9.obj: tmt9.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmta.obj: tmta.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtb.obj: tmtb.cpp include.h newmat.h tmt.h myexcept.h + +tmtc.obj: tmtc.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtd.obj: tmtd.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmte.obj: tmte.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtf.obj: tmtf.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtg.obj: tmtg.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmth.obj: tmth.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmti.obj: tmti.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtj.obj: tmtj.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtk.obj: tmtk.cpp include.h newmatap.h newmatio.h tmt.h newmat.h myexcept.h + +tmtl.obj: tmtl.cpp newmat.h tmt.h include.h myexcept.h + +tmtm.obj: tmtm.cpp newmat.h newmatio.h tmt.h include.h myexcept.h + +example.obj: example.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nm_ex1.obj: nm_ex1.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nm_ex2.obj: nm_ex2.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nm_ex3.obj: nm_ex3.cpp newmatio.h precisio.h newmat.h include.h myexcept.h + +test_exc.obj: test_exc.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nl_ex.obj: nl_ex.cpp newmatnl.h newmatio.h newmat.h include.h myexcept.h + +newmatnl.obj: newmatnl.cpp newmatap.h newmatnl.h newmat.h include.h myexcept.h + +sl_ex.obj: sl_ex.cpp include.h solution.h myexcept.h + +solution.obj: solution.cpp include.h myexcept.h solution.h + +garch.obj: garch.cpp newmatap.h newmatio.h newmatnl.h newmat.h include.h myexcept.h + +tmt.txx: tmt.exe + $(PRE)tmt > tmt.txx + $(DIFF) tmt.txt tmt.txx + +example.txx: example.exe + $(PRE)example > example.txx + $(DIFF) example.txt example.txx + +nm_ex1.txx: nm_ex1.exe + $(PRE)nm_ex1 > nm_ex1.txx + $(DIFF) nm_ex1.txt nm_ex1.txx + +nm_ex2.txx: nm_ex2.exe + $(PRE)nm_ex2 > nm_ex2.txx + $(DIFF) nm_ex2.txt nm_ex2.txx + +nm_ex3.txx: nm_ex3.exe + $(PRE)nm_ex3 > nm_ex3.txx + $(DIFF) nm_ex3.txt nm_ex3.txx + +test_exc.txx: test_exc.exe + $(PRE)test_exc > test_exc.txx + $(DIFF) test_exc.txt test_exc.txx + +nl_ex.txx: nl_ex.exe + $(PRE)nl_ex > nl_ex.txx + $(DIFF) nl_ex.txt nl_ex.txx + +sl_ex.txx: sl_ex.exe + $(PRE)sl_ex > sl_ex.txx + $(DIFF) sl_ex.txt sl_ex.txx + +garch.txx: garch.exe + $(PRE)garch > garch.txx + $(DIFF) garch.txt garch.txx + diff --git a/extern/newmat/nm_il8.mak b/extern/newmat/nm_il8.mak new file mode 100644 index 00000000..4d174121 --- /dev/null +++ b/extern/newmat/nm_il8.mak @@ -0,0 +1,212 @@ +CXX = icpc -i-static +CXXFLAGS = -O2 -mp -prec_div -long_double + +DIFF = ./sdiff +PRE = ./ +MAJOR = 101 +MINOR = 0 + +%.o: %.cpp + $(CXX) $(CXXFLAGS) -c $*.cpp + +everything: tmt example nm_ex1 nm_ex2 nm_ex3 test_exc nl_ex sl_ex garch + +newmat_lobj = newmat1.o newmat2.o newmat3.o newmat4.o newmat5.o newmat6.o newmat7.o newmat8.o newmatex.o bandmat.o submat.o myexcept.o cholesky.o evalue.o fft.o hholder.o jacobi.o newfft.o sort.o svd.o nm_misc.o newmatrm.o newmat9.o + +libnewmat.a: $(newmat_lobj) + $(AR) -cr $@ $(newmat_lobj) + ranlib $@ + +tmt_obj = tmt.o tmt1.o tmt2.o tmt3.o tmt4.o tmt5.o tmt6.o tmt7.o tmt8.o tmt9.o tmta.o tmtb.o tmtc.o tmtd.o tmte.o tmtf.o tmtg.o tmth.o tmti.o tmtj.o tmtk.o tmtl.o tmtm.o + +tmt: $(tmt_obj) libnewmat.a + $(CXX) -o $@ $(tmt_obj) -L. -lnewmat -lm + +example_obj = example.o + +example: $(example_obj) libnewmat.a + $(CXX) -o $@ $(example_obj) -L. -lnewmat -lm + +nm_ex1_obj = nm_ex1.o + +nm_ex1: $(nm_ex1_obj) libnewmat.a + $(CXX) -o $@ $(nm_ex1_obj) -L. -lnewmat -lm + +nm_ex2_obj = nm_ex2.o + +nm_ex2: $(nm_ex2_obj) libnewmat.a + $(CXX) -o $@ $(nm_ex2_obj) -L. -lnewmat -lm + +nm_ex3_obj = nm_ex3.o + +nm_ex3: $(nm_ex3_obj) libnewmat.a + $(CXX) -o $@ $(nm_ex3_obj) -L. -lnewmat -lm + +test_exc_obj = test_exc.o + +test_exc: $(test_exc_obj) libnewmat.a + $(CXX) -o $@ $(test_exc_obj) -L. -lnewmat -lm + +nl_ex_obj = nl_ex.o newmatnl.o + +nl_ex: $(nl_ex_obj) libnewmat.a + $(CXX) -o $@ $(nl_ex_obj) -L. -lnewmat -lm + +sl_ex_obj = sl_ex.o solution.o myexcept.o + +sl_ex: $(sl_ex_obj) + $(CXX) -o $@ $(sl_ex_obj) -L. -lm + +garch_obj = garch.o newmatnl.o + +garch: $(garch_obj) libnewmat.a + $(CXX) -o $@ $(garch_obj) -L. -lnewmat -lm + +newmat1.o: newmat1.cpp newmat.h include.h myexcept.h + +newmat2.o: newmat2.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat3.o: newmat3.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat4.o: newmat4.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat5.o: newmat5.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat6.o: newmat6.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat7.o: newmat7.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat8.o: newmat8.cpp include.h newmat.h newmatrc.h precisio.h myexcept.h controlw.h + +newmatex.o: newmatex.cpp include.h newmat.h myexcept.h + +bandmat.o: bandmat.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +submat.o: submat.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +myexcept.o: myexcept.cpp include.h myexcept.h + +cholesky.o: cholesky.cpp include.h newmat.h newmatrm.h myexcept.h + +evalue.o: evalue.cpp include.h newmatap.h newmatrm.h precisio.h newmat.h myexcept.h + +fft.o: fft.cpp include.h newmatap.h newmat.h myexcept.h + +hholder.o: hholder.cpp include.h newmatap.h newmat.h myexcept.h + +jacobi.o: jacobi.cpp include.h newmatap.h precisio.h newmatrm.h newmat.h myexcept.h + +newfft.o: newfft.cpp newmatap.h newmat.h include.h myexcept.h + +sort.o: sort.cpp include.h newmatap.h newmat.h myexcept.h + +svd.o: svd.cpp include.h newmatap.h newmatrm.h precisio.h newmat.h myexcept.h + +nm_misc.o: nm_misc.cpp include.h newmatap.h newmat.h myexcept.h + +newmatrm.o: newmatrm.cpp newmat.h newmatrm.h include.h myexcept.h + +newmat9.o: newmat9.cpp include.h newmat.h newmatio.h newmatrc.h myexcept.h controlw.h + +tmt.o: tmt.cpp include.h newmat.h tmt.h myexcept.h + +tmt1.o: tmt1.cpp include.h newmat.h tmt.h myexcept.h + +tmt2.o: tmt2.cpp include.h newmat.h tmt.h myexcept.h + +tmt3.o: tmt3.cpp include.h newmat.h tmt.h myexcept.h + +tmt4.o: tmt4.cpp include.h newmat.h tmt.h myexcept.h + +tmt5.o: tmt5.cpp include.h newmat.h tmt.h myexcept.h + +tmt6.o: tmt6.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmt7.o: tmt7.cpp include.h newmat.h tmt.h myexcept.h + +tmt8.o: tmt8.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmt9.o: tmt9.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmta.o: tmta.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtb.o: tmtb.cpp include.h newmat.h tmt.h myexcept.h + +tmtc.o: tmtc.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtd.o: tmtd.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmte.o: tmte.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtf.o: tmtf.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtg.o: tmtg.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmth.o: tmth.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmti.o: tmti.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtj.o: tmtj.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtk.o: tmtk.cpp include.h newmatap.h newmatio.h tmt.h newmat.h myexcept.h + +tmtl.o: tmtl.cpp newmat.h tmt.h include.h myexcept.h + +tmtm.o: tmtm.cpp newmat.h newmatio.h tmt.h include.h myexcept.h + +example.o: example.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nm_ex1.o: nm_ex1.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nm_ex2.o: nm_ex2.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nm_ex3.o: nm_ex3.cpp newmatio.h precisio.h newmat.h include.h myexcept.h + +test_exc.o: test_exc.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nl_ex.o: nl_ex.cpp newmatnl.h newmatio.h newmat.h include.h myexcept.h + +newmatnl.o: newmatnl.cpp newmatap.h newmatnl.h newmat.h include.h myexcept.h + +sl_ex.o: sl_ex.cpp include.h solution.h myexcept.h + +solution.o: solution.cpp include.h myexcept.h solution.h + +garch.o: garch.cpp newmatap.h newmatio.h newmatnl.h newmat.h include.h myexcept.h + +tmt.txx: tmt + $(PRE)tmt > tmt.txx + $(DIFF) tmt.txt tmt.txx + +example.txx: example + $(PRE)example > example.txx + $(DIFF) example.txt example.txx + +nm_ex1.txx: nm_ex1 + $(PRE)nm_ex1 > nm_ex1.txx + $(DIFF) nm_ex1.txt nm_ex1.txx + +nm_ex2.txx: nm_ex2 + $(PRE)nm_ex2 > nm_ex2.txx + $(DIFF) nm_ex2.txt nm_ex2.txx + +nm_ex3.txx: nm_ex3 + $(PRE)nm_ex3 > nm_ex3.txx + $(DIFF) nm_ex3.txt nm_ex3.txx + +test_exc.txx: test_exc + $(PRE)test_exc > test_exc.txx + $(DIFF) test_exc.txt test_exc.txx + +nl_ex.txx: nl_ex + $(PRE)nl_ex > nl_ex.txx + $(DIFF) nl_ex.txt nl_ex.txx + +sl_ex.txx: sl_ex + $(PRE)sl_ex > sl_ex.txx + $(DIFF) sl_ex.txt sl_ex.txx + +garch.txx: garch + $(PRE)garch > garch.txx + $(DIFF) garch.txt garch.txx + diff --git a/extern/newmat/nm_m6.mak b/extern/newmat/nm_m6.mak new file mode 100644 index 00000000..97931f36 --- /dev/null +++ b/extern/newmat/nm_m6.mak @@ -0,0 +1,211 @@ + +conlibs = libc.lib kernel32.lib + +DIFF = sdiff +PRE = + +.SUFFIXES: .cpp + +.cpp.obj: + cl -c -W3 -Ox -GX $*.cpp + +everything: tmt.exe example.exe nm_ex1.exe nm_ex2.exe nm_ex3.exe test_exc.exe nl_ex.exe sl_ex.exe garch.exe + +newmat_lobj = newmat1.obj newmat2.obj newmat3.obj newmat4.obj newmat5.obj newmat6.obj newmat7.obj newmat8.obj newmatex.obj bandmat.obj submat.obj myexcept.obj cholesky.obj evalue.obj fft.obj hholder.obj jacobi.obj newfft.obj sort.obj svd.obj nm_misc.obj newmatrm.obj newmat9.obj + +newmat.lib: $(newmat_lobj) + lib -Out:$@ $(newmat_lobj) + +tmt_obj = tmt.obj tmt1.obj tmt2.obj tmt3.obj tmt4.obj tmt5.obj tmt6.obj tmt7.obj tmt8.obj tmt9.obj tmta.obj tmtb.obj tmtc.obj tmtd.obj tmte.obj tmtf.obj tmtg.obj tmth.obj tmti.obj tmtj.obj tmtk.obj tmtl.obj tmtm.obj + +tmt.exe: $(tmt_obj) newmat.lib + link -Out:$@ $(conlibs) $(tmt_obj) newmat.lib + +example_obj = example.obj + +example.exe: $(example_obj) newmat.lib + link -Out:$@ $(conlibs) $(example_obj) newmat.lib + +nm_ex1_obj = nm_ex1.obj + +nm_ex1.exe: $(nm_ex1_obj) newmat.lib + link -Out:$@ $(conlibs) $(nm_ex1_obj) newmat.lib + +nm_ex2_obj = nm_ex2.obj + +nm_ex2.exe: $(nm_ex2_obj) newmat.lib + link -Out:$@ $(conlibs) $(nm_ex2_obj) newmat.lib + +nm_ex3_obj = nm_ex3.obj + +nm_ex3.exe: $(nm_ex3_obj) newmat.lib + link -Out:$@ $(conlibs) $(nm_ex3_obj) newmat.lib + +test_exc_obj = test_exc.obj + +test_exc.exe: $(test_exc_obj) newmat.lib + link -Out:$@ $(conlibs) $(test_exc_obj) newmat.lib + +nl_ex_obj = nl_ex.obj newmatnl.obj + +nl_ex.exe: $(nl_ex_obj) newmat.lib + link -Out:$@ $(conlibs) $(nl_ex_obj) newmat.lib + +sl_ex_obj = sl_ex.obj solution.obj myexcept.obj + +sl_ex.exe: $(sl_ex_obj) + link -Out:$@ $(conlibs) $(sl_ex_obj) + +garch_obj = garch.obj newmatnl.obj + +garch.exe: $(garch_obj) newmat.lib + link -Out:$@ $(conlibs) $(garch_obj) newmat.lib + +newmat1.obj: newmat1.cpp newmat.h include.h myexcept.h + +newmat2.obj: newmat2.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat3.obj: newmat3.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat4.obj: newmat4.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat5.obj: newmat5.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat6.obj: newmat6.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat7.obj: newmat7.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat8.obj: newmat8.cpp include.h newmat.h newmatrc.h precisio.h myexcept.h controlw.h + +newmatex.obj: newmatex.cpp include.h newmat.h myexcept.h + +bandmat.obj: bandmat.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +submat.obj: submat.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +myexcept.obj: myexcept.cpp include.h myexcept.h + +cholesky.obj: cholesky.cpp include.h newmat.h newmatrm.h myexcept.h + +evalue.obj: evalue.cpp include.h newmatap.h newmatrm.h precisio.h newmat.h myexcept.h + +fft.obj: fft.cpp include.h newmatap.h newmat.h myexcept.h + +hholder.obj: hholder.cpp include.h newmatap.h newmat.h myexcept.h + +jacobi.obj: jacobi.cpp include.h newmatap.h precisio.h newmatrm.h newmat.h myexcept.h + +newfft.obj: newfft.cpp newmatap.h newmat.h include.h myexcept.h + +sort.obj: sort.cpp include.h newmatap.h newmat.h myexcept.h + +svd.obj: svd.cpp include.h newmatap.h newmatrm.h precisio.h newmat.h myexcept.h + +nm_misc.obj: nm_misc.cpp include.h newmatap.h newmat.h myexcept.h + +newmatrm.obj: newmatrm.cpp newmat.h newmatrm.h include.h myexcept.h + +newmat9.obj: newmat9.cpp include.h newmat.h newmatio.h newmatrc.h myexcept.h controlw.h + +tmt.obj: tmt.cpp include.h newmat.h tmt.h myexcept.h + +tmt1.obj: tmt1.cpp include.h newmat.h tmt.h myexcept.h + +tmt2.obj: tmt2.cpp include.h newmat.h tmt.h myexcept.h + +tmt3.obj: tmt3.cpp include.h newmat.h tmt.h myexcept.h + +tmt4.obj: tmt4.cpp include.h newmat.h tmt.h myexcept.h + +tmt5.obj: tmt5.cpp include.h newmat.h tmt.h myexcept.h + +tmt6.obj: tmt6.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmt7.obj: tmt7.cpp include.h newmat.h tmt.h myexcept.h + +tmt8.obj: tmt8.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmt9.obj: tmt9.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmta.obj: tmta.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtb.obj: tmtb.cpp include.h newmat.h tmt.h myexcept.h + +tmtc.obj: tmtc.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtd.obj: tmtd.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmte.obj: tmte.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtf.obj: tmtf.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtg.obj: tmtg.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmth.obj: tmth.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmti.obj: tmti.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtj.obj: tmtj.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtk.obj: tmtk.cpp include.h newmatap.h newmatio.h tmt.h newmat.h myexcept.h + +tmtl.obj: tmtl.cpp newmat.h tmt.h include.h myexcept.h + +tmtm.obj: tmtm.cpp newmat.h newmatio.h tmt.h include.h myexcept.h + +example.obj: example.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nm_ex1.obj: nm_ex1.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nm_ex2.obj: nm_ex2.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nm_ex3.obj: nm_ex3.cpp newmatio.h precisio.h newmat.h include.h myexcept.h + +test_exc.obj: test_exc.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nl_ex.obj: nl_ex.cpp newmatnl.h newmatio.h newmat.h include.h myexcept.h + +newmatnl.obj: newmatnl.cpp newmatap.h newmatnl.h newmat.h include.h myexcept.h + +sl_ex.obj: sl_ex.cpp include.h solution.h myexcept.h + +solution.obj: solution.cpp include.h myexcept.h solution.h + +garch.obj: garch.cpp newmatap.h newmatio.h newmatnl.h newmat.h include.h myexcept.h + +tmt.txx: tmt.exe + $(PRE)tmt > tmt.txx + $(DIFF) tmt.txt tmt.txx + +example.txx: example.exe + $(PRE)example > example.txx + $(DIFF) example.txt example.txx + +nm_ex1.txx: nm_ex1.exe + $(PRE)nm_ex1 > nm_ex1.txx + $(DIFF) nm_ex1.txt nm_ex1.txx + +nm_ex2.txx: nm_ex2.exe + $(PRE)nm_ex2 > nm_ex2.txx + $(DIFF) nm_ex2.txt nm_ex2.txx + +nm_ex3.txx: nm_ex3.exe + $(PRE)nm_ex3 > nm_ex3.txx + $(DIFF) nm_ex3.txt nm_ex3.txx + +test_exc.txx: test_exc.exe + $(PRE)test_exc > test_exc.txx + $(DIFF) test_exc.txt test_exc.txx + +nl_ex.txx: nl_ex.exe + $(PRE)nl_ex > nl_ex.txx + $(DIFF) nl_ex.txt nl_ex.txx + +sl_ex.txx: sl_ex.exe + $(PRE)sl_ex > sl_ex.txx + $(DIFF) sl_ex.txt sl_ex.txx + +garch.txx: garch.exe + $(PRE)garch > garch.txx + $(DIFF) garch.txt garch.txx + diff --git a/extern/newmat/nm_m8.mak b/extern/newmat/nm_m8.mak new file mode 100644 index 00000000..5b29da94 --- /dev/null +++ b/extern/newmat/nm_m8.mak @@ -0,0 +1,211 @@ + +conlibs = kernel32.lib + +DIFF = sdiff +PRE = + +.SUFFIXES: .cpp + +.cpp.obj: + cl -c -W3 -Ox -EHsc $*.cpp + +everything: tmt.exe example.exe nm_ex1.exe nm_ex2.exe nm_ex3.exe test_exc.exe nl_ex.exe sl_ex.exe garch.exe + +newmat_lobj = newmat1.obj newmat2.obj newmat3.obj newmat4.obj newmat5.obj newmat6.obj newmat7.obj newmat8.obj newmatex.obj bandmat.obj submat.obj myexcept.obj cholesky.obj evalue.obj fft.obj hholder.obj jacobi.obj newfft.obj sort.obj svd.obj nm_misc.obj newmatrm.obj newmat9.obj + +newmat.lib: $(newmat_lobj) + lib -Out:$@ $(newmat_lobj) + +tmt_obj = tmt.obj tmt1.obj tmt2.obj tmt3.obj tmt4.obj tmt5.obj tmt6.obj tmt7.obj tmt8.obj tmt9.obj tmta.obj tmtb.obj tmtc.obj tmtd.obj tmte.obj tmtf.obj tmtg.obj tmth.obj tmti.obj tmtj.obj tmtk.obj tmtl.obj tmtm.obj + +tmt.exe: $(tmt_obj) newmat.lib + link -Out:$@ $(conlibs) $(tmt_obj) newmat.lib + +example_obj = example.obj + +example.exe: $(example_obj) newmat.lib + link -Out:$@ $(conlibs) $(example_obj) newmat.lib + +nm_ex1_obj = nm_ex1.obj + +nm_ex1.exe: $(nm_ex1_obj) newmat.lib + link -Out:$@ $(conlibs) $(nm_ex1_obj) newmat.lib + +nm_ex2_obj = nm_ex2.obj + +nm_ex2.exe: $(nm_ex2_obj) newmat.lib + link -Out:$@ $(conlibs) $(nm_ex2_obj) newmat.lib + +nm_ex3_obj = nm_ex3.obj + +nm_ex3.exe: $(nm_ex3_obj) newmat.lib + link -Out:$@ $(conlibs) $(nm_ex3_obj) newmat.lib + +test_exc_obj = test_exc.obj + +test_exc.exe: $(test_exc_obj) newmat.lib + link -Out:$@ $(conlibs) $(test_exc_obj) newmat.lib + +nl_ex_obj = nl_ex.obj newmatnl.obj + +nl_ex.exe: $(nl_ex_obj) newmat.lib + link -Out:$@ $(conlibs) $(nl_ex_obj) newmat.lib + +sl_ex_obj = sl_ex.obj solution.obj myexcept.obj + +sl_ex.exe: $(sl_ex_obj) + link -Out:$@ $(conlibs) $(sl_ex_obj) + +garch_obj = garch.obj newmatnl.obj + +garch.exe: $(garch_obj) newmat.lib + link -Out:$@ $(conlibs) $(garch_obj) newmat.lib + +newmat1.obj: newmat1.cpp newmat.h include.h myexcept.h + +newmat2.obj: newmat2.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat3.obj: newmat3.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat4.obj: newmat4.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat5.obj: newmat5.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat6.obj: newmat6.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat7.obj: newmat7.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat8.obj: newmat8.cpp include.h newmat.h newmatrc.h precisio.h myexcept.h controlw.h + +newmatex.obj: newmatex.cpp include.h newmat.h myexcept.h + +bandmat.obj: bandmat.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +submat.obj: submat.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +myexcept.obj: myexcept.cpp include.h myexcept.h + +cholesky.obj: cholesky.cpp include.h newmat.h newmatrm.h myexcept.h + +evalue.obj: evalue.cpp include.h newmatap.h newmatrm.h precisio.h newmat.h myexcept.h + +fft.obj: fft.cpp include.h newmatap.h newmat.h myexcept.h + +hholder.obj: hholder.cpp include.h newmatap.h newmat.h myexcept.h + +jacobi.obj: jacobi.cpp include.h newmatap.h precisio.h newmatrm.h newmat.h myexcept.h + +newfft.obj: newfft.cpp newmatap.h newmat.h include.h myexcept.h + +sort.obj: sort.cpp include.h newmatap.h newmat.h myexcept.h + +svd.obj: svd.cpp include.h newmatap.h newmatrm.h precisio.h newmat.h myexcept.h + +nm_misc.obj: nm_misc.cpp include.h newmatap.h newmat.h myexcept.h + +newmatrm.obj: newmatrm.cpp newmat.h newmatrm.h include.h myexcept.h + +newmat9.obj: newmat9.cpp include.h newmat.h newmatio.h newmatrc.h myexcept.h controlw.h + +tmt.obj: tmt.cpp include.h newmat.h tmt.h myexcept.h + +tmt1.obj: tmt1.cpp include.h newmat.h tmt.h myexcept.h + +tmt2.obj: tmt2.cpp include.h newmat.h tmt.h myexcept.h + +tmt3.obj: tmt3.cpp include.h newmat.h tmt.h myexcept.h + +tmt4.obj: tmt4.cpp include.h newmat.h tmt.h myexcept.h + +tmt5.obj: tmt5.cpp include.h newmat.h tmt.h myexcept.h + +tmt6.obj: tmt6.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmt7.obj: tmt7.cpp include.h newmat.h tmt.h myexcept.h + +tmt8.obj: tmt8.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmt9.obj: tmt9.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmta.obj: tmta.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtb.obj: tmtb.cpp include.h newmat.h tmt.h myexcept.h + +tmtc.obj: tmtc.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtd.obj: tmtd.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmte.obj: tmte.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtf.obj: tmtf.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtg.obj: tmtg.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmth.obj: tmth.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmti.obj: tmti.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtj.obj: tmtj.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtk.obj: tmtk.cpp include.h newmatap.h newmatio.h tmt.h newmat.h myexcept.h + +tmtl.obj: tmtl.cpp newmat.h tmt.h include.h myexcept.h + +tmtm.obj: tmtm.cpp newmat.h newmatio.h tmt.h include.h myexcept.h + +example.obj: example.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nm_ex1.obj: nm_ex1.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nm_ex2.obj: nm_ex2.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nm_ex3.obj: nm_ex3.cpp newmatio.h precisio.h newmat.h include.h myexcept.h + +test_exc.obj: test_exc.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nl_ex.obj: nl_ex.cpp newmatnl.h newmatio.h newmat.h include.h myexcept.h + +newmatnl.obj: newmatnl.cpp newmatap.h newmatnl.h newmat.h include.h myexcept.h + +sl_ex.obj: sl_ex.cpp include.h solution.h myexcept.h + +solution.obj: solution.cpp include.h myexcept.h solution.h + +garch.obj: garch.cpp newmatap.h newmatio.h newmatnl.h newmat.h include.h myexcept.h + +tmt.txx: tmt.exe + $(PRE)tmt > tmt.txx + $(DIFF) tmt.txt tmt.txx + +example.txx: example.exe + $(PRE)example > example.txx + $(DIFF) example.txt example.txx + +nm_ex1.txx: nm_ex1.exe + $(PRE)nm_ex1 > nm_ex1.txx + $(DIFF) nm_ex1.txt nm_ex1.txx + +nm_ex2.txx: nm_ex2.exe + $(PRE)nm_ex2 > nm_ex2.txx + $(DIFF) nm_ex2.txt nm_ex2.txx + +nm_ex3.txx: nm_ex3.exe + $(PRE)nm_ex3 > nm_ex3.txx + $(DIFF) nm_ex3.txt nm_ex3.txx + +test_exc.txx: test_exc.exe + $(PRE)test_exc > test_exc.txx + $(DIFF) test_exc.txt test_exc.txx + +nl_ex.txx: nl_ex.exe + $(PRE)nl_ex > nl_ex.txx + $(DIFF) nl_ex.txt nl_ex.txx + +sl_ex.txx: sl_ex.exe + $(PRE)sl_ex > sl_ex.txx + $(DIFF) sl_ex.txt sl_ex.txx + +garch.txx: garch.exe + $(PRE)garch > garch.txx + $(DIFF) garch.txt garch.txx + diff --git a/extern/newmat/nm_misc.cpp b/extern/newmat/nm_misc.cpp new file mode 100644 index 00000000..611aaad2 --- /dev/null +++ b/extern/newmat/nm_misc.cpp @@ -0,0 +1,147 @@ +/// \ingroup newmat +///@{ + +/// \file nm_misc.cpp +/// Miscellaneous programs. + +#define WANT_MATH + +#include "include.h" + +#include "newmatap.h" + +#ifdef use_namespace +namespace NEWMAT { +#endif + + +#ifdef DO_REPORT +#define REPORT { static ExeCounter ExeCount(__LINE__,21); ++ExeCount; } +#else +#define REPORT {} +#endif + +ReturnMatrix Helmert(int n, bool full) +{ + REPORT + Tracer et("Helmert "); + if (n <= 0) Throw(ProgramException("Dimension <= 0 ")); + Matrix H; + + if (full) H.resize(n,n); else H.resize(n-1,n); + H = 0.0; + for (int i = 1; i < n; ++i) + { + Real f = 1.0 / sqrt((Real)i * (i+1)); + H.submatrix(i,i,1,i) = -f; H(i,i+1) = f * i; + } + if (full) { H.row(n) = 1.0 / sqrt((Real)n); } + H.release(); return H.for_return(); +} + + + +// Multiply X by n-1 x n matrix to give n-1 contrasts +// Return a ColumnVector +ReturnMatrix Helmert(const ColumnVector& X, bool full) +{ + REPORT + Tracer et("Helmert * CV"); + int n = X.nrows(); + if (n == 0) Throw(ProgramException("X Vector of length 0", X)); + Real sum = 0.0; ColumnVector Y; + if (full) Y.resize(n); else Y.resize(n-1); + for (int i = 1; i < n; ++i) + { sum += X(i); Y(i) = (i * X(i+1) - sum) / sqrt((Real)i * (i+1)); } + if (full) { sum += X(n); Y(n) = sum / sqrt((Real)n); } + Y.release(); return Y.for_return(); +} + +// same as above for X a ColumnVector, length n, element j = 1; otherwise 0 +ReturnMatrix Helmert(int n, int j, bool full) +{ + REPORT + Tracer et("Helmert:single element "); + if (n <= 0) Throw(ProgramException("X Vector of length <= 0")); + if (j > n || j <= 0) + Throw(ProgramException("Out of range element number ")); + ColumnVector Y; if (full) Y.resize(n); else Y.resize(n-1); + Y = 0.0; + if (j > 1) Y(j-1) = sqrt((Real)(j-1) / (Real)j); + for (int i = j; i < n; ++i) Y(i) = - 1.0 / sqrt((Real)i * (i+1)); + if (full) Y(n) = 1.0 / sqrt((Real)n); + Y.release(); return Y.for_return(); +} + +ReturnMatrix Helmert_transpose(const ColumnVector& Y, bool full) +{ + REPORT + Tracer et("Helmert_transpose * CV "); + int n = Y.nrows(); Real sum; + if (full) sum = Y(n) / sqrt((Real)n); else { sum = 0.0; ++n; } + ColumnVector X(n); + for (int i = n-1; i > 0; --i) + { + Real Yi = Y(i) / sqrt((Real)i * (i+1)); + X(i+1) = i * Yi + sum; sum -= Yi; + } + X(1) = sum; + X.release(); return X.for_return(); +} + +// same as above but want only j-th element +Real Helmert_transpose(const ColumnVector& Y, int j, bool full) +{ + REPORT + Tracer et("Helmert_transpose:single element "); + int n = Y.nrows(); Real sum; + if (full) sum = Y(n) / sqrt((Real)n); else { sum = 0.0; ++n; } + if (j > n || j <= 0) Throw(IndexException(j, Y)); + for (int i = n-1; i > 0; --i) + { + Real Yi = Y(i) / sqrt((Real)i * (i+1)); + if (i+1 == j) return i * Yi + sum; + sum -= Yi; + } + return sum; +} + +ReturnMatrix Helmert(const Matrix& X, bool full) +{ + REPORT + Tracer et("Helmert * Matrix"); + int m = X.nrows(); int n = X.ncols(); + if (m == 0) Throw(ProgramException("Matrix has 0 rows ", X)); + Matrix Y; + if (full) Y.resize(m,n); else Y.resize(m-1, n); + for (int j = 1; j <= n; ++j) + { + ColumnVector CV = X.Column(j); + Y.Column(j) = Helmert(CV, full); + } + Y.release(); return Y.for_return(); +} + +ReturnMatrix Helmert_transpose(const Matrix& Y, bool full) +{ + REPORT + Tracer et("Helmert_transpose * Matrix "); + int m = Y.nrows(); int n = Y.ncols(); if (!full) ++m; + Matrix X(m, n); + for (int j = 1; j <= n; ++j) + { + ColumnVector CV = Y.Column(j); + X.Column(j) = Helmert_transpose(CV, full); + } + X.release(); return X.for_return(); +} + + + + +#ifdef use_namespace +} +#endif + + +///@} diff --git a/extern/newmat/nm_ow.mak b/extern/newmat/nm_ow.mak new file mode 100644 index 00000000..0e69d234 --- /dev/null +++ b/extern/newmat/nm_ow.mak @@ -0,0 +1,212 @@ +.cpp.obj: + wcl386 -c -xs $*.cpp + + +DIFF = sdiff +PRE = + + + + +everything: tmt.exe example.exe nm_ex1.exe nm_ex2.exe nm_ex3.exe test_exc.exe nl_ex.exe sl_ex.exe garch.exe + +newmat_lobj = newmat1.obj newmat2.obj newmat3.obj newmat4.obj newmat5.obj newmat6.obj newmat7.obj newmat8.obj newmatex.obj bandmat.obj submat.obj myexcept.obj cholesky.obj evalue.obj fft.obj hholder.obj jacobi.obj newfft.obj sort.obj svd.obj nm_misc.obj newmatrm.obj newmat9.obj + +newmat_pobj = +newmat1.obj +newmat2.obj +newmat3.obj +newmat4.obj +newmat5.obj +newmat6.obj +newmat7.obj +newmat8.obj +newmatex.obj +bandmat.obj +submat.obj +myexcept.obj +cholesky.obj +evalue.obj +fft.obj +hholder.obj +jacobi.obj +newfft.obj +sort.obj +svd.obj +nm_misc.obj +newmatrm.obj +newmat9.obj + +newmat.lib: $(newmat_lobj) + wlib -n $@ $(newmat_pobj) + +tmt_obj = tmt.obj tmt1.obj tmt2.obj tmt3.obj tmt4.obj tmt5.obj tmt6.obj tmt7.obj tmt8.obj tmt9.obj tmta.obj tmtb.obj tmtc.obj tmtd.obj tmte.obj tmtf.obj tmtg.obj tmth.obj tmti.obj tmtj.obj tmtk.obj tmtl.obj tmtm.obj + +tmt.exe: $(tmt_obj) newmat.lib + wcl386 -fe=$@ $(tmt_obj) newmat.lib + +example_obj = example.obj + +example.exe: $(example_obj) newmat.lib + wcl386 -fe=$@ $(example_obj) newmat.lib + +nm_ex1_obj = nm_ex1.obj + +nm_ex1.exe: $(nm_ex1_obj) newmat.lib + wcl386 -fe=$@ $(nm_ex1_obj) newmat.lib + +nm_ex2_obj = nm_ex2.obj + +nm_ex2.exe: $(nm_ex2_obj) newmat.lib + wcl386 -fe=$@ $(nm_ex2_obj) newmat.lib + +nm_ex3_obj = nm_ex3.obj + +nm_ex3.exe: $(nm_ex3_obj) newmat.lib + wcl386 -fe=$@ $(nm_ex3_obj) newmat.lib + +test_exc_obj = test_exc.obj + +test_exc.exe: $(test_exc_obj) newmat.lib + wcl386 -fe=$@ $(test_exc_obj) newmat.lib + +nl_ex_obj = nl_ex.obj newmatnl.obj + +nl_ex.exe: $(nl_ex_obj) newmat.lib + wcl386 -fe=$@ $(nl_ex_obj) newmat.lib + +sl_ex_obj = sl_ex.obj solution.obj myexcept.obj + +sl_ex.exe: $(sl_ex_obj) + wcl386 -fe=$@ $(sl_ex_obj) + +garch_obj = garch.obj newmatnl.obj + +garch.exe: $(garch_obj) newmat.lib + wcl386 -fe=$@ $(garch_obj) newmat.lib + +newmat1.obj: newmat1.cpp newmat.h include.h myexcept.h + +newmat2.obj: newmat2.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat3.obj: newmat3.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat4.obj: newmat4.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat5.obj: newmat5.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat6.obj: newmat6.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat7.obj: newmat7.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +newmat8.obj: newmat8.cpp include.h newmat.h newmatrc.h precisio.h myexcept.h controlw.h + +newmatex.obj: newmatex.cpp include.h newmat.h myexcept.h + +bandmat.obj: bandmat.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +submat.obj: submat.cpp include.h newmat.h newmatrc.h myexcept.h controlw.h + +myexcept.obj: myexcept.cpp include.h myexcept.h + +cholesky.obj: cholesky.cpp include.h newmat.h newmatrm.h myexcept.h + +evalue.obj: evalue.cpp include.h newmatap.h newmatrm.h precisio.h newmat.h myexcept.h + +fft.obj: fft.cpp include.h newmatap.h newmat.h myexcept.h + +hholder.obj: hholder.cpp include.h newmatap.h newmat.h myexcept.h + +jacobi.obj: jacobi.cpp include.h newmatap.h precisio.h newmatrm.h newmat.h myexcept.h + +newfft.obj: newfft.cpp newmatap.h newmat.h include.h myexcept.h + +sort.obj: sort.cpp include.h newmatap.h newmat.h myexcept.h + +svd.obj: svd.cpp include.h newmatap.h newmatrm.h precisio.h newmat.h myexcept.h + +nm_misc.obj: nm_misc.cpp include.h newmatap.h newmat.h myexcept.h + +newmatrm.obj: newmatrm.cpp newmat.h newmatrm.h include.h myexcept.h + +newmat9.obj: newmat9.cpp include.h newmat.h newmatio.h newmatrc.h myexcept.h controlw.h + +tmt.obj: tmt.cpp include.h newmat.h tmt.h myexcept.h + +tmt1.obj: tmt1.cpp include.h newmat.h tmt.h myexcept.h + +tmt2.obj: tmt2.cpp include.h newmat.h tmt.h myexcept.h + +tmt3.obj: tmt3.cpp include.h newmat.h tmt.h myexcept.h + +tmt4.obj: tmt4.cpp include.h newmat.h tmt.h myexcept.h + +tmt5.obj: tmt5.cpp include.h newmat.h tmt.h myexcept.h + +tmt6.obj: tmt6.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmt7.obj: tmt7.cpp include.h newmat.h tmt.h myexcept.h + +tmt8.obj: tmt8.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmt9.obj: tmt9.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmta.obj: tmta.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtb.obj: tmtb.cpp include.h newmat.h tmt.h myexcept.h + +tmtc.obj: tmtc.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtd.obj: tmtd.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmte.obj: tmte.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtf.obj: tmtf.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtg.obj: tmtg.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmth.obj: tmth.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmti.obj: tmti.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtj.obj: tmtj.cpp include.h newmatap.h tmt.h newmat.h myexcept.h + +tmtk.obj: tmtk.cpp include.h newmatap.h newmatio.h tmt.h newmat.h myexcept.h + +tmtl.obj: tmtl.cpp newmat.h tmt.h include.h myexcept.h + +tmtm.obj: tmtm.cpp newmat.h newmatio.h tmt.h include.h myexcept.h + +example.obj: example.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nm_ex1.obj: nm_ex1.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nm_ex2.obj: nm_ex2.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nm_ex3.obj: nm_ex3.cpp newmatio.h precisio.h newmat.h include.h myexcept.h + +test_exc.obj: test_exc.cpp newmatap.h newmatio.h newmat.h include.h myexcept.h + +nl_ex.obj: nl_ex.cpp newmatnl.h newmatio.h newmat.h include.h myexcept.h + +newmatnl.obj: newmatnl.cpp newmatap.h newmatnl.h newmat.h include.h myexcept.h + +sl_ex.obj: sl_ex.cpp include.h solution.h myexcept.h + +solution.obj: solution.cpp include.h myexcept.h solution.h + +garch.obj: garch.cpp newmatap.h newmatio.h newmatnl.h newmat.h include.h myexcept.h + +tmt.txx: tmt.exe + $(PRE)tmt > tmt.txx + $(DIFF) tmt.txt tmt.txx + +example.txx: example.exe + $(PRE)example > example.txx + $(DIFF) example.txt example.txx + +nm_ex1.txx: nm_ex1.exe + $(PRE)nm_ex1 > nm_ex1.txx + $(DIFF) nm_ex1.txt nm_ex1.txx + +nm_ex2.txx: nm_ex2.exe + $(PRE)nm_ex2 > nm_ex2.txx + $(DIFF) nm_ex2.txt nm_ex2.txx + +nm_ex3.txx: nm_ex3.exe + $(PRE)nm_ex3 > nm_ex3.txx + $(DIFF) nm_ex3.txt nm_ex3.txx + +test_exc.txx: test_exc.exe + $(PRE)test_exc > test_exc.txx + $(DIFF) test_exc.txt test_exc.txx + +nl_ex.txx: nl_ex.exe + $(PRE)nl_ex > nl_ex.txx + $(DIFF) nl_ex.txt nl_ex.txx + +sl_ex.txx: sl_ex.exe + $(PRE)sl_ex > sl_ex.txx + $(DIFF) sl_ex.txt sl_ex.txx + +garch.txx: garch.exe + $(PRE)garch > garch.txx + $(DIFF) garch.txt garch.txx + diff --git a/extern/newmat/nm_targ.txt b/extern/newmat/nm_targ.txt new file mode 100644 index 00000000..0fa27699 --- /dev/null +++ b/extern/newmat/nm_targ.txt @@ -0,0 +1,10 @@ +newmat.lfl +tmt +example +nm_ex1 +nm_ex2 +nm_ex3 +test_exc +nl_ex +sl_ex +garch diff --git a/extern/newmat/precisio.h b/extern/newmat/precisio.h new file mode 100644 index 00000000..141e1555 --- /dev/null +++ b/extern/newmat/precisio.h @@ -0,0 +1,266 @@ +/// \ingroup newmat +///@{ + +/// \file precisio.h +/// Floating point precision constants. + +#ifndef PRECISION_LIB +#define PRECISION_LIB 0 + +#define WANT_MATH +#include "include.h" // in case being used as stand alone + +#ifdef _STANDARD_ // standard library available +#include +#endif + +#ifdef use_namespace +namespace NEWMAT { +#endif + +#ifdef _STANDARD_ // standard library available + +#ifdef OPT_COMPATIBLE +#include // for FLT_MAX +#endif + +using namespace std; + +/// Floating point precision. +class FloatingPointPrecision +{ +public: + static int Dig() // number of decimal digits or precision + { return numeric_limits::digits10 ; } + + static Real Epsilon() // smallest number such that 1+Eps!=Eps + { return numeric_limits::epsilon(); } + + static int Mantissa() // bits in mantisa + { return numeric_limits::digits; } + + static Real Maximum() // maximum value + { return numeric_limits::max(); } + + static int MaximumDecimalExponent() // maximum decimal exponent + { return numeric_limits::max_exponent10; } + + static int MaximumExponent() // maximum binary exponent + { return numeric_limits::max_exponent; } + + static Real LnMaximum() // natural log of maximum + { return (Real)log(Maximum()); } + + static Real Minimum() // minimum positive value + { return numeric_limits::min(); } + + static int MinimumDecimalExponent() // minimum decimal exponent + { return numeric_limits::min_exponent10; } + + static int MinimumExponent() // minimum binary exponent + { return numeric_limits::min_exponent; } + + static Real LnMinimum() // natural log of minimum + { return (Real)log(Minimum()); } + + static int Radix() // exponent radix + { return numeric_limits::radix; } + + static int Rounds() // addition rounding (1 = does round) + { + return numeric_limits::round_style == + round_to_nearest ? 1 : 0; + } + +}; + + +#else // _STANDARD_ not defined + +#ifndef SystemV // if there is float.h + +#ifdef USING_FLOAT + +/// Floating point precision (type float). +class FloatingPointPrecision +{ +public: + static int Dig() + { return FLT_DIG; } // number of decimal digits or precision + + static Real Epsilon() + { return FLT_EPSILON; } // smallest number such that 1+Eps!=Eps + + static int Mantissa() + { return FLT_MANT_DIG; } // bits in mantisa + + static Real Maximum() + { return FLT_MAX; } // maximum value + + static int MaximumDecimalExponent() + { return FLT_MAX_10_EXP; } // maximum decimal exponent + + static int MaximumExponent() + { return FLT_MAX_EXP; } // maximum binary exponent + + static Real LnMaximum() + { return (Real)log(Maximum()); } // natural log of maximum + + static Real Minimum() + { return FLT_MIN; } // minimum positive value + + static int MinimumDecimalExponent() + { return FLT_MIN_10_EXP; } // minimum decimal exponent + + static int MinimumExponent() + { return FLT_MIN_EXP; } // minimum binary exponent + + static Real LnMinimum() + { return (Real)log(Minimum()); } // natural log of minimum + + static int Radix() + { return FLT_RADIX; } // exponent radix + + static int Rounds() + { return FLT_ROUNDS; } // addition rounding (1 = does round) + +}; + +#endif // USING_FLOAT + + +#ifdef USING_DOUBLE + +/// Floating point precision (type double). +class FloatingPointPrecision +{ +public: + + static int Dig() + { return DBL_DIG; } // number of decimal digits or precision + + static Real Epsilon() + { return DBL_EPSILON; } // smallest number such that 1+Eps!=Eps + + static int Mantissa() + { return DBL_MANT_DIG; } // bits in mantisa + + static Real Maximum() + { return DBL_MAX; } // maximum value + + static int MaximumDecimalExponent() + { return DBL_MAX_10_EXP; } // maximum decimal exponent + + static int MaximumExponent() + { return DBL_MAX_EXP; } // maximum binary exponent + + static Real LnMaximum() + { return (Real)log(Maximum()); } // natural log of maximum + + static Real Minimum() + { +//#ifdef __BCPLUSPLUS__ +// return 2.225074e-308; // minimum positive value +//#else + return DBL_MIN; +//#endif + } + + static int MinimumDecimalExponent() + { return DBL_MIN_10_EXP; } // minimum decimal exponent + + static int MinimumExponent() + { return DBL_MIN_EXP; } // minimum binary exponent + + static Real LnMinimum() + { return (Real)log(Minimum()); } // natural log of minimum + + + static int Radix() + { return FLT_RADIX; } // exponent radix + + static int Rounds() + { return FLT_ROUNDS; } // addition rounding (1 = does round) + +}; + +#endif // USING_DOUBLE + +#else // if there is no float.h + +#ifdef OPT_COMPATIBLE +#define FLT_MAX MAXFLOAT +#endif + + +#ifdef USING_FLOAT + +/// Floating point precision (type float). +class FloatingPointPrecision +{ +public: + + static Real Epsilon() + { return pow(2.0,(int)(1-FSIGNIF)); } + // smallest number such that 1+Eps!=Eps + + static Real Maximum() + { return MAXFLOAT; } // maximum value + + static Real LnMaximum() + { return (Real)log(Maximum()); } // natural log of maximum + + static Real Minimum() + { return MINFLOAT; } // minimum positive value + + static Real LnMinimum() + { return (Real)log(Minimum()); } // natural log of minimum + +}; + +#endif // USING_FLOAT + + +#ifdef USING_DOUBLE + +/// Floating point precision (type double). +class FloatingPointPrecision +{ +public: + + static Real Epsilon() + { return pow(2.0,(int)(1-DSIGNIF)); } + // smallest number such that 1+Eps!=Eps + + static Real Maximum() + { return MAXDOUBLE; } // maximum value + + static Real LnMaximum() + { return LN_MAXDOUBLE; } // natural log of maximum + + static Real Minimum() + { return MINDOUBLE; } + + static Real LnMinimum() + { return LN_MINDOUBLE; } // natural log of minimum +}; + +#endif // USING_DOUBLE + +#endif // SystemV + +#endif // _STANDARD_ + + + + +#ifdef use_namespace +} +#endif // use_namespace + + + +#endif // PRECISION_LIB + + +///@} diff --git a/extern/newmat/rbd.css b/extern/newmat/rbd.css new file mode 100644 index 00000000..d512592b --- /dev/null +++ b/extern/newmat/rbd.css @@ -0,0 +1,20 @@ +/* Style sheet - if you are saving my html files, please also save this file as rbd.css */ +h1 { font-family: Arial, Helvetica, sans-serif; font-size: 20pt; color: maroon } +h2 { font-family: Arial, Helvetica, sans-serif; font-size: 16pt; color: maroon } +h3 { font-family: Arial, Helvetica, sans-serif; font-size: 14pt; color: maroon } +h4 { font-family: Arial, Helvetica, sans-serif; font-size: 12pt; color: maroon } +body { font-family: "Times New Roman", Times, serif; background-color: white } +body.gray { font-family: "Times New Roman", Times, serif; background-color: #CCCCCC } +p { font-family: "Times New Roman", Times, serif; margin-top: 8; margin-bottom: 8 } +p.small { font-family: "Times New Roman", Times, serif; font-size: 10pt; margin-top: 8; margin-bottom: 8 } +ul { line-height: 100%; margin-top: 2; margin-bottom: 2 } +li { margin-top: 2; margin-bottom: 2; font-size: 10pt } +tt { font-family: "Courier New", Courier, monospaced; font-size: 10pt } +pre { font-family: "Courier New", Courier, monospaced; font-size: 10pt } +pre.small { font-family: "Courier New", Courier, monospaced; font-size: 8pt } +hr { color: maroon } +a:link { color: blue } +a:visited { color: green } +a:active { color: red } +table { font-size: 10pt } +.question { color: navy; } \ No newline at end of file diff --git a/extern/newmat/readme.txt b/extern/newmat/readme.txt new file mode 100644 index 00000000..0293c78f --- /dev/null +++ b/extern/newmat/readme.txt @@ -0,0 +1,12 @@ + ReadMe file for newmat11 - beta version - 20 November, 2008 +------------------------------------------------------------- + +This is a beta version of newmat11. + +Documentation is in nm11.htm. + +This library is freeware. See the documentation for details. + +To contact the author please email robert@statsresearch.co.nz + + diff --git a/extern/newmat/sl_ex.cpp b/extern/newmat/sl_ex.cpp new file mode 100644 index 00000000..485b6e29 --- /dev/null +++ b/extern/newmat/sl_ex.cpp @@ -0,0 +1,59 @@ +/// \ingroup newmat +///@{ + +/// \file sl_ex.cpp +/// Test one-dimensional solve function. +/// This is an example of the use of solution to find the cube root of +/// the integers -10 to 10 +/// +/// you will need to compile and link solution.cpp and my_except.cpp + +#define WANT_STREAM +#define WANT_MATH + +#include "include.h" +#include "solution.h" + +#ifdef use_namespace +using namespace RBD_LIBRARIES; +#endif + + +// the cube class + +class Cube : public R1_R1 +{ Real operator()() { return x*x*x; } }; + + +int my_main() +{ + // construct the Cube object + Cube cube; + // and then the solve object + OneDimSolve cube_root(cube); + // Now do the solves + for (int i=-10; i<=10; i++) + cout << i << " " << cube_root.Solve(i,0,1.5) << endl; + return 0; +} + +// call my_main() - use this to catch exceptions +int main() +{ + Try + { + return my_main(); + } + Catch(BaseException) + { + cout << BaseException::what() << "\n"; + } + CatchAll + { + cout << "\nProgram fails - exception generated\n\n"; + } + return 0; +} + + +///@} diff --git a/extern/newmat/sl_ex.txt b/extern/newmat/sl_ex.txt new file mode 100644 index 00000000..e69ed62d --- /dev/null +++ b/extern/newmat/sl_ex.txt @@ -0,0 +1,21 @@ +-10 -2.15443 +-9 -2.08008 +-8 -2 +-7 -1.91293 +-6 -1.81712 +-5 -1.70998 +-4 -1.5874 +-3 -1.44225 +-2 -1.25992 +-1 -1.00001 +0 0 +1 1.00001 +2 1.25992 +3 1.44225 +4 1.58741 +5 1.70998 +6 1.81712 +7 1.91293 +8 2 +9 2.08008 +10 2.15443 diff --git a/extern/newmat/solution.cpp b/extern/newmat/solution.cpp new file mode 100644 index 00000000..1f06e9e6 --- /dev/null +++ b/extern/newmat/solution.cpp @@ -0,0 +1,205 @@ +/// \ingroup newmat +///@{ + +/// \file solution.cpp +/// One dimensional solve routine. + +// Copyright (C) 1994: R B Davies + + +#define WANT_STREAM // include.h will get stream fns +#define WANT_MATH // include.h will get math fns + +#include "include.h" +#include "myexcept.h" + +#include "solution.h" + +#ifdef use_namespace +namespace RBD_COMMON { +#endif + + +void R1_R1::Set(Real X) +{ + if ((!minXinf && X <= minX) || (!maxXinf && X >= maxX)) + Throw(SolutionException("X value out of range")); + x = X; xSet = true; +} + +R1_R1::operator Real() +{ + if (!xSet) Throw(SolutionException("Value of X not set")); + Real y = operator()(); + return y; +} + +unsigned long SolutionException::Select; + +SolutionException::SolutionException(const char* a_what) : BaseException() +{ + Select = BaseException::Select; + AddMessage("Error detected by solution package\n"); + AddMessage(a_what); AddMessage("\n"); + if (a_what) Tracer::AddTrace(); +} + +inline Real square(Real x) { return x*x; } + +void OneDimSolve::LookAt(int V) +{ + lim--; + if (!lim) Throw(SolutionException("Does not converge")); + Last = V; + Real yy = function(x[V]) - YY; + Finish = (fabs(yy) <= accY) || (Captured && fabs(x[L]-x[U]) <= accX ); + y[V] = vpol*yy; +} + +void OneDimSolve::HFlip() { hpol=-hpol; State(U,C,L); } + +void OneDimSolve::VFlip() + { vpol = -vpol; y[0] = -y[0]; y[1] = -y[1]; y[2] = -y[2]; } + +void OneDimSolve::Flip() +{ + hpol=-hpol; vpol=-vpol; State(U,C,L); + y[0] = -y[0]; y[1] = -y[1]; y[2] = -y[2]; +} + +void OneDimSolve::State(int I, int J, int K) { L=I; C=J; U=K; } + +void OneDimSolve::Linear(int I, int J, int K) +{ + x[J] = (x[I]*y[K] - x[K]*y[I])/(y[K] - y[I]); + // cout << "Linear\n"; +} + +void OneDimSolve::Quadratic(int I, int J, int K) +{ + // result to overwrite I + Real YJK, YIK, YIJ, XKI, XKJ; + YJK = y[J] - y[K]; YIK = y[I] - y[K]; YIJ = y[I] - y[J]; + XKI = (x[K] - x[I]); + XKJ = (x[K]*y[J] - x[J]*y[K])/YJK; + if ( square(YJK/YIK)>(x[K] - x[J])/XKI || + square(YIJ/YIK)>(x[J] - x[I])/XKI ) + { + x[I] = XKJ; + // cout << "Quadratic - exceptional\n"; + } + else + { + XKI = (x[K]*y[I] - x[I]*y[K])/YIK; + x[I] = (XKJ*y[I] - XKI*y[J])/YIJ; + // cout << "Quadratic - normal\n"; + } +} + +Real OneDimSolve::Solve(Real Y, Real X, Real Dev, int Lim) +{ + enum Loop { start, captured1, captured2, binary, finish }; + Tracer et("OneDimSolve::Solve"); + lim=Lim; Captured = false; + if ( Dev == 0.0 ) Throw(SolutionException("Dev is zero")); + L=0; C=1; U=2; vpol=1; hpol=1; y[C]=0.0; y[U]=0.0; + if (Dev<0.0) { hpol=-1; Dev = -Dev; } + YY=Y; // target value + x[L] = X; // initial trial value + if (!function.IsValid(X)) + Throw(SolutionException("Starting value is invalid")); + Loop TheLoop = start; + for (;;) + { + switch (TheLoop) + { + case start: + LookAt(L); if (Finish) { TheLoop = finish; break; } + if (y[L]>0.0) VFlip(); // so Y[L] < 0 + + x[U] = X + Dev * hpol; + if (!function.maxXinf && x[U] > function.maxX) + x[U] = (function.maxX + X) / 2.0; + if (!function.minXinf && x[U] < function.minX) + x[U] = (function.minX + X) / 2.0; + + LookAt(U); if (Finish) { TheLoop = finish; break; } + if (y[U] > 0.0) { TheLoop = captured1; Captured = true; break; } + if (y[U] == y[L]) + Throw(SolutionException("Function is flat")); + if (y[U] < y[L]) HFlip(); // Change direction + State(L,U,C); + for (i=0; i<20; i++) + { + // cout << "Searching for crossing point\n"; + // Have L C then crossing point, Y[L] function.maxX) + x[U] = (function.maxX + x[C]) / 2.0; + if (!function.minXinf && x[U] < function.minX) + x[U] = (function.minX + x[C]) / 2.0; + + LookAt(U); if (Finish) { TheLoop = finish; break; } + if (y[U] > 0) { TheLoop = captured2; Captured = true; break; } + if (y[U] < y[C]) + Throw(SolutionException("Function is not monotone")); + Dev *= 2.0; + State(C,U,L); + } + if (TheLoop != start ) break; + Throw(SolutionException("Cannot locate a crossing point")); + + case captured1: + // cout << "Captured - 1\n"; + // We have 2 points L and U with crossing between them + Linear(L,C,U); // linear interpolation + // - result to C + LookAt(C); if (Finish) { TheLoop = finish; break; } + if (y[C] > 0.0) Flip(); // Want y[C] < 0 + if (y[C] < 0.5*y[L]) { State(C,L,U); TheLoop = binary; break; } + + case captured2: + // cout << "Captured - 2\n"; + // We have L,C before crossing, U after crossing + Quadratic(L,C,U); // quad interpolation + // - result to L + State(C,L,U); + if ((x[C] - x[L])*hpol <= 0.0 || (x[C] - x[U])*hpol >= 0.0) + { TheLoop = captured1; break; } + LookAt(C); if (Finish) { TheLoop = finish; break; } + // cout << "Through first stage\n"; + if (y[C] > 0.0) Flip(); + if (y[C] > 0.5*y[L]) { TheLoop = captured2; break; } + else { State(C,L,U); TheLoop = captured1; break; } + + case binary: + // We have L, U around crossing - do binary search + // cout << "Binary\n"; + for (i=3; i; i--) + { + x[C] = 0.5*(x[L]+x[U]); + LookAt(C); if (Finish) { TheLoop = finish; break; } + if (y[C]>0.0) State(L,U,C); else State(C,L,U); + } + if (TheLoop != binary) break; + TheLoop = captured1; break; + + case finish: + return x[Last]; + + } + } +} + +bool R1_R1::IsValid(Real X) +{ + Set(X); + return (minXinf || x > minX) && (maxXinf || x < maxX); +} + +#ifdef use_namespace +} +#endif + + +///@} diff --git a/extern/newmat/solution.h b/extern/newmat/solution.h new file mode 100644 index 00000000..b752e18a --- /dev/null +++ b/extern/newmat/solution.h @@ -0,0 +1,99 @@ +/// \ingroup newmat +///@{ + +/// \file solution.h +/// One dimensional solve routine. + +#include "myexcept.h" + +#ifdef use_namespace +namespace RBD_COMMON { +#endif + + +// Solve the equation f(x)=y for x where f is a monotone continuous +// function of x +// Essentially Brent s method + +// You need to derive a class from R1_R1 and override "operator()" +// with the function you want to solve. +// Use an object from this class in OneDimSolve + +class R1_R1 +{ + // the prototype for a Real function of a Real variable + // you need to derive your function from this one and put in your + // function for operator() at least. You probably also want to set up a + // constructor to put in additional parameter values (e.g. that will not + // vary during a solve) + +protected: + Real x; // Current x value + bool xSet; // true if a value assigned to x + +public: + Real minX, maxX; // range of value x + bool minXinf, maxXinf; // true if these are infinite + R1_R1() : xSet(false), minXinf(true), maxXinf(true) {} + virtual Real operator()() = 0; // function value at current x + // set current x + virtual void Set(Real X); // set x, check OK + Real operator()(Real X) { Set(X); return operator()(); } + // set x, return value + virtual bool IsValid(Real X); + operator Real(); // implicit conversion + virtual ~R1_R1() {} // keep gnu happy +}; + +class SolutionException : public BaseException +{ +public: + static unsigned long Select; + SolutionException(const char* a_what = 0); +}; + +class OneDimSolve +{ + R1_R1& function; // reference to the function + Real accX; // accuracy in X direction + Real accY; // accuracy in Y direction + int lim; // maximum number of iterations + +public: + OneDimSolve(R1_R1& f, Real AccY = 0.0001, Real AccX = 0.0) + : function(f), accX(AccX), accY(AccY) {} + // f is an R1_R1 function + Real Solve(Real Y, Real X, Real Dev, int Lim=100); + // Solve for x in Y=f(x) + // X is the initial trial value of x + // X+Dev is the second trial value + // program returns a value of x such that + // |Y-f(x)| <= accY or |f.inv(Y)-x| <= accX + +private: + Real x[3], y[3]; // Trial values of X and Y + int L,C,U,Last; // Locations of trial values + int vpol, hpol; // polarities + Real YY; // target value + int i; + void LookAt(int); // get new value of function + bool Finish; // true if LookAt finds conv. + bool Captured; // true when target surrounded + void VFlip(); + void HFlip(); + void Flip(); + void State(int I, int J, int K); + void Linear(int, int, int); + void Quadratic(int, int, int); +}; + + +#ifdef use_namespace +} +#endif + +// body file: solution.cpp + + +///@} + diff --git a/extern/newmat/sort.cpp b/extern/newmat/sort.cpp new file mode 100644 index 00000000..954b86f9 --- /dev/null +++ b/extern/newmat/sort.cpp @@ -0,0 +1,277 @@ +/// \ingroup newmat +///@{ + +/// \file sort.cpp +/// Sorting functions. + +// Copyright (C) 1991,2,3,4: R B Davies + +#define WANT_MATH + +#include "include.h" + +#include "newmatap.h" + +#ifdef use_namespace +namespace NEWMAT { +#endif + +#ifdef DO_REPORT +#define REPORT { static ExeCounter ExeCount(__LINE__,13); ++ExeCount; } +#else +#define REPORT {} +#endif + +/******************************** Quick sort ********************************/ + +// Quicksort. +// Essentially the method described in Sedgewick s algorithms in C++ +// My version is still partially recursive, unlike Segewick s, but the +// smallest segment of each split is used in the recursion, so it should +// not overlead the stack. + +// If the process does not seems to be converging an exception is thrown. + + +#define DoSimpleSort 17 // when to switch to insert sort +#define MaxDepth 50 // maximum recursion depth + +static void MyQuickSortDescending(Real* first, Real* last, int depth); +static void InsertionSortDescending(Real* first, const int length, + int guard); +static Real SortThreeDescending(Real* a, Real* b, Real* c); + +static void MyQuickSortAscending(Real* first, Real* last, int depth); +static void InsertionSortAscending(Real* first, const int length, + int guard); + + +void sort_descending(GeneralMatrix& GM) +{ + REPORT + Tracer et("sort_descending"); + + Real* data = GM.Store(); int max = GM.Storage(); + + if (max > DoSimpleSort) MyQuickSortDescending(data, data + max - 1, 0); + InsertionSortDescending(data, max, DoSimpleSort); + +} + +static Real SortThreeDescending(Real* a, Real* b, Real* c) +{ + // sort *a, *b, *c; return *b; optimise for already sorted + if (*a >= *b) + { + if (*b >= *c) { REPORT return *b; } + else if (*a >= *c) { REPORT Real x = *c; *c = *b; *b = x; return x; } + else { REPORT Real x = *a; *a = *c; *c = *b; *b = x; return x; } + } + else if (*c >= *b) { REPORT Real x = *c; *c = *a; *a = x; return *b; } + else if (*a >= *c) { REPORT Real x = *a; *a = *b; *b = x; return x; } + else { REPORT Real x = *c; *c = *a; *a = *b; *b = x; return x; } +} + +static void InsertionSortDescending(Real* first, const int length, + int guard) +// guard gives the length of the sequence to scan to find first +// element (eg = length) +{ + REPORT + if (length <= 1) return; + + // scan for first element + Real* f = first; Real v = *f; Real* h = f; + if (guard > length) { REPORT guard = length; } + int i = guard - 1; + while (i--) if (v < *(++f)) { v = *f; h = f; } + *h = *first; *first = v; + + // do the sort + i = length - 1; f = first; + while (i--) + { + Real* g = f++; h = f; v = *h; + while (*g < v) *h-- = *g--; + *h = v; + } +} + +static void MyQuickSortDescending(Real* first, Real* last, int depth) +{ + REPORT + for (;;) + { + const int length = last - first + 1; + if (length < DoSimpleSort) { REPORT return; } + if (depth++ > MaxDepth) + Throw(ConvergenceException("QuickSortDescending fails: ")); + Real* centre = first + length/2; + const Real test = SortThreeDescending(first, centre, last); + Real* f = first; Real* l = last; + for (;;) + { + while (*(++f) > test) {} + while (*(--l) < test) {} + if (l <= f) break; + const Real temp = *f; *f = *l; *l = temp; + } + if (f > centre) + { REPORT MyQuickSortDescending(l+1, last, depth); last = f-1; } + else { REPORT MyQuickSortDescending(first, f-1, depth); first = l+1; } + } +} + +void sort_ascending(GeneralMatrix& GM) +{ + REPORT + Tracer et("sort_ascending"); + + Real* data = GM.Store(); int max = GM.Storage(); + + if (max > DoSimpleSort) MyQuickSortAscending(data, data + max - 1, 0); + InsertionSortAscending(data, max, DoSimpleSort); + +} + +static void InsertionSortAscending(Real* first, const int length, + int guard) +// guard gives the length of the sequence to scan to find first +// element (eg guard = length) +{ + REPORT + if (length <= 1) return; + + // scan for first element + Real* f = first; Real v = *f; Real* h = f; + if (guard > length) { REPORT guard = length; } + int i = guard - 1; + while (i--) if (v > *(++f)) { v = *f; h = f; } + *h = *first; *first = v; + + // do the sort + i = length - 1; f = first; + while (i--) + { + Real* g = f++; h = f; v = *h; + while (*g > v) *h-- = *g--; + *h = v; + } +} +static void MyQuickSortAscending(Real* first, Real* last, int depth) +{ + REPORT + for (;;) + { + const int length = last - first + 1; + if (length < DoSimpleSort) { REPORT return; } + if (depth++ > MaxDepth) + Throw(ConvergenceException("QuickSortAscending fails: ")); + Real* centre = first + length/2; + const Real test = SortThreeDescending(last, centre, first); + Real* f = first; Real* l = last; + for (;;) + { + while (*(++f) < test) {} + while (*(--l) > test) {} + if (l <= f) break; + const Real temp = *f; *f = *l; *l = temp; + } + if (f > centre) + { REPORT MyQuickSortAscending(l+1, last, depth); last = f-1; } + else { REPORT MyQuickSortAscending(first, f-1, depth); first = l+1; } + } +} + +//********* sort diagonal matrix & rearrange matrix columns **************** + +// used by SVD + +// these are for sorting singular values - should be updated with faster +// sorts that handle exchange of columns better +// however time is probably not significant compared with SVD time + +void SortSV(DiagonalMatrix& D, Matrix& U, bool ascending) +{ + REPORT + Tracer trace("SortSV_DU"); + int m = U.Nrows(); int n = U.Ncols(); + if (n != D.Nrows()) Throw(IncompatibleDimensionsException(D,U)); + Real* u = U.Store(); + for (int i=0; i p) { k = j; p = D.element(j); } } + } + if (k != i) + { + D.element(k) = D.element(i); D.element(i) = p; int j = m; + Real* uji = u + i; Real* ujk = u + k; + if (j) for(;;) + { + p = *uji; *uji = *ujk; *ujk = p; + if (!(--j)) break; + uji += n; ujk += n; + } + } + } +} + +void SortSV(DiagonalMatrix& D, Matrix& U, Matrix& V, bool ascending) +{ + REPORT + Tracer trace("SortSV_DUV"); + int mu = U.Nrows(); int mv = V.Nrows(); int n = D.Nrows(); + if (n != U.Ncols()) Throw(IncompatibleDimensionsException(D,U)); + if (n != V.Ncols()) Throw(IncompatibleDimensionsException(D,V)); + Real* u = U.Store(); Real* v = V.Store(); + for (int i=0; i p) { k = j; p = D.element(j); } } + } + if (k != i) + { + D.element(k) = D.element(i); D.element(i) = p; + Real* uji = u + i; Real* ujk = u + k; + Real* vji = v + i; Real* vjk = v + k; + int j = mu; + if (j) for(;;) + { + p = *uji; *uji = *ujk; *ujk = p; if (!(--j)) break; + uji += n; ujk += n; + } + j = mv; + if (j) for(;;) + { + p = *vji; *vji = *vjk; *vjk = p; if (!(--j)) break; + vji += n; vjk += n; + } + } + } +} + + + + +#ifdef use_namespace +} +#endif + +///@} diff --git a/extern/newmat/submat.cpp b/extern/newmat/submat.cpp new file mode 100644 index 00000000..f3cc95d8 --- /dev/null +++ b/extern/newmat/submat.cpp @@ -0,0 +1,401 @@ +/// \ingroup newmat +///@{ + +/// \file submat.cpp +/// Submatrix manipulation. + +// Copyright (C) 1991,2,3,4: R B Davies + +#include "include.h" + +#include "newmat.h" +#include "newmatrc.h" + +#ifdef use_namespace +namespace NEWMAT { +#endif + +#ifdef DO_REPORT +#define REPORT { static ExeCounter ExeCount(__LINE__,11); ++ExeCount; } +#else +#define REPORT {} +#endif + + +/****************************** submatrices *********************************/ + +GetSubMatrix BaseMatrix::submatrix(int first_row, int last_row, int first_col, + int last_col) const +{ + REPORT + Tracer tr("submatrix"); + int a = first_row - 1; int b = last_row - first_row + 1; + int c = first_col - 1; int d = last_col - first_col + 1; + if (a<0 || b<0 || c<0 || d<0) Throw(SubMatrixDimensionException()); + // allow zero rows or columns + return GetSubMatrix(this, a, b, c, d, false); +} + +GetSubMatrix BaseMatrix::sym_submatrix(int first_row, int last_row) const +{ + REPORT + Tracer tr("sym_submatrix"); + int a = first_row - 1; int b = last_row - first_row + 1; + if (a<0 || b<0) Throw(SubMatrixDimensionException()); + // allow zero rows or columns + return GetSubMatrix( this, a, b, a, b, true); +} + +GetSubMatrix BaseMatrix::row(int first_row) const +{ + REPORT + Tracer tr("SubMatrix(row)"); + int a = first_row - 1; + if (a<0) Throw(SubMatrixDimensionException()); + return GetSubMatrix(this, a, 1, 0, -1, false); +} + +GetSubMatrix BaseMatrix::rows(int first_row, int last_row) const +{ + REPORT + Tracer tr("SubMatrix(rows)"); + int a = first_row - 1; int b = last_row - first_row + 1; + if (a<0 || b<0) Throw(SubMatrixDimensionException()); + // allow zero rows or columns + return GetSubMatrix(this, a, b, 0, -1, false); +} + +GetSubMatrix BaseMatrix::column(int first_col) const +{ + REPORT + Tracer tr("SubMatrix(column)"); + int c = first_col - 1; + if (c<0) Throw(SubMatrixDimensionException()); + return GetSubMatrix(this, 0, -1, c, 1, false); +} + +GetSubMatrix BaseMatrix::columns(int first_col, int last_col) const +{ + REPORT + Tracer tr("SubMatrix(columns)"); + int c = first_col - 1; int d = last_col - first_col + 1; + if (c<0 || d<0) Throw(SubMatrixDimensionException()); + // allow zero rows or columns + return GetSubMatrix(this, 0, -1, c, d, false); +} + +void GetSubMatrix::SetUpLHS() +{ + REPORT + Tracer tr("SubMatrix(LHS)"); + const BaseMatrix* bm1 = bm; + GeneralMatrix* gm1 = ((BaseMatrix*&)bm)->Evaluate(); + if ((BaseMatrix*)gm1!=bm1) + Throw(ProgramException("Invalid LHS")); + if (row_number < 0) row_number = gm1->Nrows(); + if (col_number < 0) col_number = gm1->Ncols(); + if (row_skip+row_number > gm1->Nrows() + || col_skip+col_number > gm1->Ncols()) + Throw(SubMatrixDimensionException()); +} + +void GetSubMatrix::operator<<(const BaseMatrix& bmx) +{ + REPORT + Tracer tr("SubMatrix(<<)"); GeneralMatrix* gmx = 0; + Try + { + SetUpLHS(); gmx = ((BaseMatrix&)bmx).Evaluate(); + if (row_number != gmx->Nrows() || col_number != gmx->Ncols()) + Throw(IncompatibleDimensionsException()); + MatrixRow mrx(gmx, LoadOnEntry); + MatrixRow mr(gm, LoadOnEntry+StoreOnExit+DirectPart, row_skip); + // do need LoadOnEntry + MatrixRowCol sub; int i = row_number; + while (i--) + { + mr.SubRowCol(sub, col_skip, col_number); // put values in sub + sub.Copy(mrx); mr.Next(); mrx.Next(); + } + gmx->tDelete(); + } + + CatchAll + { + if (gmx) gmx->tDelete(); + ReThrow; + } +} + +void GetSubMatrix::operator=(const BaseMatrix& bmx) +{ + REPORT + Tracer tr("SubMatrix(=)"); GeneralMatrix* gmx = 0; + // MatrixConversionCheck mcc; // Check for loss of info + Try + { + SetUpLHS(); gmx = ((BaseMatrix&)bmx).Evaluate(); + if (row_number != gmx->Nrows() || col_number != gmx->Ncols()) + Throw(IncompatibleDimensionsException()); + LoadAndStoreFlag lasf = + ( row_skip == col_skip + && gm->type().is_symmetric() + && gmx->type().is_symmetric() ) + ? LoadOnEntry+DirectPart + : LoadOnEntry; + MatrixRow mrx(gmx, lasf); + MatrixRow mr(gm, LoadOnEntry+StoreOnExit+DirectPart, row_skip); + // do need LoadOnEntry + MatrixRowCol sub; int i = row_number; + while (i--) + { + mr.SubRowCol(sub, col_skip, col_number); // put values in sub + sub.CopyCheck(mrx); mr.Next(); mrx.Next(); + } + gmx->tDelete(); + } + + CatchAll + { + if (gmx) gmx->tDelete(); + ReThrow; + } +} + +void GetSubMatrix::operator<<(const double* r) +{ + REPORT + Tracer tr("SubMatrix(< gm->Nrows() || col_skip+col_number > gm->Ncols()) + Throw(SubMatrixDimensionException()); + MatrixRow mr(gm, LoadOnEntry+StoreOnExit+DirectPart, row_skip); + // do need LoadOnEntry + MatrixRowCol sub; int i = row_number; + while (i--) + { + mr.SubRowCol(sub, col_skip, col_number); // put values in sub + sub.Copy(r); mr.Next(); + } +} + +void GetSubMatrix::operator<<(const float* r) +{ + REPORT + Tracer tr("SubMatrix(< gm->Nrows() || col_skip+col_number > gm->Ncols()) + Throw(SubMatrixDimensionException()); + MatrixRow mr(gm, LoadOnEntry+StoreOnExit+DirectPart, row_skip); + // do need LoadOnEntry + MatrixRowCol sub; int i = row_number; + while (i--) + { + mr.SubRowCol(sub, col_skip, col_number); // put values in sub + sub.Copy(r); mr.Next(); + } +} + +void GetSubMatrix::operator<<(const int* r) +{ + REPORT + Tracer tr("SubMatrix(< gm->Nrows() || col_skip+col_number > gm->Ncols()) + Throw(SubMatrixDimensionException()); + MatrixRow mr(gm, LoadOnEntry+StoreOnExit+DirectPart, row_skip); + // do need LoadOnEntry + MatrixRowCol sub; int i = row_number; + while (i--) + { + mr.SubRowCol(sub, col_skip, col_number); // put values in sub + sub.Copy(r); mr.Next(); + } +} + +void GetSubMatrix::operator=(Real r) +{ + REPORT + Tracer tr("SubMatrix(=Real)"); + SetUpLHS(); + MatrixRow mr(gm, LoadOnEntry+StoreOnExit+DirectPart, row_skip); + // do need LoadOnEntry + MatrixRowCol sub; int i = row_number; + while (i--) + { + mr.SubRowCol(sub, col_skip, col_number); // put values in sub + sub.Copy(r); mr.Next(); + } +} + +void GetSubMatrix::inject(const GeneralMatrix& gmx) +{ + REPORT + Tracer tr("SubMatrix(inject)"); + SetUpLHS(); + if (row_number != gmx.Nrows() || col_number != gmx.Ncols()) + Throw(IncompatibleDimensionsException()); + MatrixRow mrx((GeneralMatrix*)(&gmx), LoadOnEntry); + MatrixRow mr(gm, LoadOnEntry+StoreOnExit+DirectPart, row_skip); + // do need LoadOnEntry + MatrixRowCol sub; int i = row_number; + while (i--) + { + mr.SubRowCol(sub, col_skip, col_number); // put values in sub + sub.Inject(mrx); mr.Next(); mrx.Next(); + } +} + +void GetSubMatrix::operator+=(const BaseMatrix& bmx) +{ + REPORT + Tracer tr("SubMatrix(+=)"); GeneralMatrix* gmx = 0; + // MatrixConversionCheck mcc; // Check for loss of info + Try + { + SetUpLHS(); gmx = ((BaseMatrix&)bmx).Evaluate(); + if (row_number != gmx->Nrows() || col_number != gmx->Ncols()) + Throw(IncompatibleDimensionsException()); + if (gm->type().is_symmetric() && + ( ! gmx->type().is_symmetric() || row_skip != col_skip) ) + Throw(ProgramException("Illegal operation on symmetric")); + MatrixRow mrx(gmx, LoadOnEntry); + MatrixRow mr(gm, LoadOnEntry+StoreOnExit+DirectPart, row_skip); + // do need LoadOnEntry + MatrixRowCol sub; int i = row_number; + while (i--) + { + mr.SubRowCol(sub, col_skip, col_number); // put values in sub + sub.Check(mrx); // check for loss of info + sub.Add(mrx); mr.Next(); mrx.Next(); + } + gmx->tDelete(); + } + + CatchAll + { + if (gmx) gmx->tDelete(); + ReThrow; + } +} + +void GetSubMatrix::SP_eq(const BaseMatrix& bmx) +{ + REPORT + Tracer tr("SubMatrix(SP_eq)"); GeneralMatrix* gmx = 0; + // MatrixConversionCheck mcc; // Check for loss of info + Try + { + SetUpLHS(); gmx = ((BaseMatrix&)bmx).Evaluate(); + if (row_number != gmx->Nrows() || col_number != gmx->Ncols()) + Throw(IncompatibleDimensionsException()); + if (gm->type().is_symmetric() && + ( ! gmx->type().is_symmetric() || row_skip != col_skip) ) + Throw(ProgramException("Illegal operation on symmetric")); + MatrixRow mrx(gmx, LoadOnEntry); + MatrixRow mr(gm, LoadOnEntry+StoreOnExit+DirectPart, row_skip); + // do need LoadOnEntry + MatrixRowCol sub; int i = row_number; + while (i--) + { + mr.SubRowCol(sub, col_skip, col_number); // put values in sub + sub.Multiply(mrx); mr.Next(); mrx.Next(); + } + gmx->tDelete(); + } + + CatchAll + { + if (gmx) gmx->tDelete(); + ReThrow; + } +} + +void GetSubMatrix::operator-=(const BaseMatrix& bmx) +{ + REPORT + Tracer tr("SubMatrix(-=)"); GeneralMatrix* gmx = 0; + // MatrixConversionCheck mcc; // Check for loss of info + Try + { + SetUpLHS(); gmx = ((BaseMatrix&)bmx).Evaluate(); + if (row_number != gmx->Nrows() || col_number != gmx->Ncols()) + Throw(IncompatibleDimensionsException()); + if (gm->type().is_symmetric() && + ( ! gmx->type().is_symmetric() || row_skip != col_skip) ) + Throw(ProgramException("Illegal operation on symmetric")); + MatrixRow mrx(gmx, LoadOnEntry); + MatrixRow mr(gm, LoadOnEntry+StoreOnExit+DirectPart, row_skip); + // do need LoadOnEntry + MatrixRowCol sub; int i = row_number; + while (i--) + { + mr.SubRowCol(sub, col_skip, col_number); // put values in sub + sub.Check(mrx); // check for loss of info + sub.Sub(mrx); mr.Next(); mrx.Next(); + } + gmx->tDelete(); + } + + CatchAll + { + if (gmx) gmx->tDelete(); + ReThrow; + } +} + +void GetSubMatrix::operator+=(Real r) +{ + REPORT + Tracer tr("SubMatrix(+= or -= Real)"); + // MatrixConversionCheck mcc; // Check for loss of info + Try + { + SetUpLHS(); + MatrixRow mr(gm, LoadOnEntry+StoreOnExit+DirectPart, row_skip); + // do need LoadOnEntry + MatrixRowCol sub; int i = row_number; + while (i--) + { + mr.SubRowCol(sub, col_skip, col_number); // put values in sub + sub.Check(); // check for loss of info + sub.Add(r); mr.Next(); + } + } + + CatchAll + { + ReThrow; + } +} + +void GetSubMatrix::operator*=(Real r) +{ + REPORT + Tracer tr("SubMatrix(*= or /= Real)"); + // MatrixConversionCheck mcc; // Check for loss of info + Try + { + SetUpLHS(); + MatrixRow mr(gm, LoadOnEntry+StoreOnExit+DirectPart, row_skip); + // do need LoadOnEntry + MatrixRowCol sub; int i = row_number; + while (i--) + { + mr.SubRowCol(sub, col_skip, col_number); // put values in sub + sub.Multiply(r); mr.Next(); + } + } + + CatchAll + { + ReThrow; + } +} + +#ifdef use_namespace +} +#endif + +///@} + diff --git a/extern/newmat/svd.cpp b/extern/newmat/svd.cpp new file mode 100644 index 00000000..49929f35 --- /dev/null +++ b/extern/newmat/svd.cpp @@ -0,0 +1,209 @@ +/// \ingroup newmat +///@{ + +/// \file svd.cpp +/// Singular value decomposition. + +// Copyright (C) 1991,2,3,4,5: R B Davies +// Updated 17 July, 1995 + +#define WANT_MATH + +#include "include.h" +#include "newmatap.h" +#include "newmatrm.h" +#include "precisio.h" + +#ifdef use_namespace +namespace NEWMAT { +#endif + +#ifdef DO_REPORT +#define REPORT { static ExeCounter ExeCount(__LINE__,15); ++ExeCount; } +#else +#define REPORT {} +#endif + + + + +void SVD(const Matrix& A, DiagonalMatrix& Q, Matrix& U, Matrix& V, + bool withU, bool withV) +// from Wilkinson and Reinsch: "Handbook of Automatic Computation" +{ + REPORT + Tracer trace("SVD"); + Real eps = FloatingPointPrecision::Epsilon(); + Real tol = FloatingPointPrecision::Minimum()/eps; + + int m = A.Nrows(); int n = A.Ncols(); + if (m= no. Cols", A)); + if (withV && &U == &V) + Throw(ProgramException("Need different matrices for U and V", U, V)); + U = A; Real g = 0.0; Real f,h; Real x = 0.0; int i; + RowVector E(n); RectMatrixRow EI(E,0); Q.ReSize(n); + RectMatrixCol UCI(U,0); RectMatrixRow URI(U,0,1,n-1); + + if (n) for (i=0;;) + { + EI.First() = g; Real ei = g; EI.Right(); Real s = UCI.SumSquare(); + if (s=0; i--) + { + VCI.Left(); + if (g!=0.0) + { + VCI.Divide(URI, URI.First()*g); int j = n-i; + RectMatrixCol VCJ = VCI; + while (--j) { VCJ.Right(); VCJ.AddScaled( VCI, (URI*VCJ) ); } + } + VCI.Zero(); VCI.Up(); VCI.First() = 1.0; g=E.element(i); + if (i==0) break; + URI.UpDiag(); + } + } + + if (withU) + { + REPORT + for (i=n-1; i>=0; i--) + { + g = Q.element(i); URI.Reset(U,i,i+1,n-i-1); URI.Zero(); + if (g!=0.0) + { + h=UCI.First()*g; int j=n-i; RectMatrixCol UCJ = UCI; + while (--j) + { + UCJ.Right(); UCI.Down(); UCJ.Down(); Real s = UCI*UCJ; + UCI.Up(); UCJ.Up(); UCJ.AddScaled(UCI,s/h); + } + UCI.Divide(g); + } + else UCI.Zero(); + UCI.First() += 1.0; + if (i==0) break; + UCI.UpDiag(); + } + } + + eps *= x; + for (int k=n-1; k>=0; k--) + { + Real z = -FloatingPointPrecision::Maximum(); // to keep Gnu happy + Real y; int limit = 50; int l = 0; + while (limit--) + { + Real c, s; int i; int l1=k; bool tfc=false; + for (l=k; l>=0; l--) + { +// if (fabs(E.element(l))<=eps) goto test_f_convergence; + if (fabs(E.element(l))<=eps) { REPORT tfc=true; break; } + if (fabs(Q.element(l-1))<=eps) { REPORT l1=l; break; } + REPORT + } + if (!tfc) + { + REPORT + l=l1; l1=l-1; s = -1.0; c = 0.0; + for (i=l; i<=k; i++) + { + f = - s * E.element(i); E.element(i) *= c; +// if (fabs(f)<=eps) goto test_f_convergence; + if (fabs(f)<=eps) { REPORT break; } + g = Q.element(i); h = pythag(g,f,c,s); Q.element(i) = h; + if (withU) + { + REPORT + RectMatrixCol UCI(U,i); RectMatrixCol UCJ(U,l1); + ComplexScale(UCJ, UCI, c, s); + } + } + } +// test_f_convergence: z = Q.element(k); if (l==k) goto convergence; + z = Q.element(k); if (l==k) { REPORT break; } + + x = Q.element(l); y = Q.element(k-1); + g = E.element(k-1); h = E.element(k); + f = ((y-z)*(y+z) + (g-h)*(g+h)) / (2*h*y); + if (f>1) { REPORT g = f * sqrt(1 + square(1/f)); } + else if (f<-1) { REPORT g = -f * sqrt(1 + square(1/f)); } + else { REPORT g = sqrt(f*f + 1); } + { REPORT f = ((x-z)*(x+z) + h*(y / ((f<0.0) ? f-g : f+g)-h)) / x; } + + c = 1.0; s = 1.0; + for (i=l+1; i<=k; i++) + { + g = E.element(i); y = Q.element(i); h = s*g; g *= c; + z = pythag(f,h,c,s); E.element(i-1) = z; + f = x*c + g*s; g = -x*s + g*c; h = y*s; y *= c; + if (withV) + { + REPORT + RectMatrixCol VCI(V,i); RectMatrixCol VCJ(V,i-1); + ComplexScale(VCI, VCJ, c, s); + } + z = pythag(f,h,c,s); Q.element(i-1) = z; + f = c*g + s*y; x = -s*g + c*y; + if (withU) + { + REPORT + RectMatrixCol UCI(U,i); RectMatrixCol UCJ(U,i-1); + ComplexScale(UCI, UCJ, c, s); + } + } + E.element(l) = 0.0; E.element(k) = f; Q.element(k) = x; + } + if (l!=k) { Throw(ConvergenceException(A)); } +// convergence: + if (z < 0.0) + { + REPORT + Q.element(k) = -z; + if (withV) { RectMatrixCol VCI(V,k); VCI.Negate(); } + } + } + if (withU & withV) SortSV(Q, U, V); + else if (withU) SortSV(Q, U); + else if (withV) SortSV(Q, V); + else sort_descending(Q); +} + +void SVD(const Matrix& A, DiagonalMatrix& D) +{ REPORT Matrix U; SVD(A, D, U, U, false, false); } + + + +#ifdef use_namespace +} +#endif + +///@} diff --git a/extern/newmat/test_exc.cpp b/extern/newmat/test_exc.cpp new file mode 100644 index 00000000..6606d729 --- /dev/null +++ b/extern/newmat/test_exc.cpp @@ -0,0 +1,221 @@ +/// \ingroup newmat +///@{ + +/// \file test_exc.cpp +/// Test some of the exceptions in the matrix library. + + +#define WANT_STREAM + +#include "newmatap.h" +#include "newmatio.h" // to help namespace with VC++ 5 + +#ifdef use_namespace +using namespace RBD_LIBRARIES; +#endif + +//#include // if you want to use set_terminate + +/**************************** test exceptions ******************************/ + + + +int main() +{ + // activate the next expression if you want to use compiler supported + // exceptions and you want Terminate to catch uncaught exceptions + // set_terminate(Terminate); + Real* s1; Real* s2; Real* s3; Real* s4; + // Forces cout to allocate memory at beginning + cout << "\nThis tests the exception system, so you will get\n" << + "a long list of error messages\n\n"; + cout << "\nPrint a real number (may help lost memory test): " + << 3.14159265 << "\n"; + // Throw exception to set up exception buffer + Try { Throw(BaseException("Just a dummy\n")); } + CatchAll {}; + BaseException::clear(); + { Matrix A1(40,200); s1 = A1.data(); } + { Matrix A1(1,1); s3 = A1.data(); } + { + Tracer et("Test"); + + Try + { + Tracer et("Try block"); + + + + cout << "-----------------------------------------\n\n"; + Matrix A(2,3), B(4,5); A = 1; B = 2; + cout << "Incompatible dimensions\n"; + et.ReName("Block A"); + Try { Matrix C = A + B; } + CatchAll { cout << BaseException::what() << endl; } + cout << "-----------------------------------------\n\n"; + + cout << "Bad index\n"; + et.ReName("Block B"); + Try { Real f = A(3,3); cout << f << endl; } + CatchAll { cout << BaseException::what() << endl; } + cout << "-----------------------------------------\n\n"; + + cout << "Illegal conversion\n"; + et.ReName("Block C"); + Try { UpperTriangularMatrix U = A; } + CatchAll { cout << BaseException::what() << endl; } + cout << "-----------------------------------------\n\n"; + + cout << "Invert non-square matrix - 1\n"; + et.ReName("Block D"); + Try { CroutMatrix X = A; } + CatchAll { cout << BaseException::what() << endl; } + cout << "-----------------------------------------\n\n"; + + cout << "Invert non-square matrix - 2\n"; + et.ReName("Block E"); + Try { Matrix X = A.i(); } + CatchAll { cout << BaseException::what() << endl; } + cout << "-----------------------------------------\n\n"; + + cout << "Non 1x1 matrix to scalar\n"; + et.ReName("Block F"); + Try { Real f = A.as_scalar(); cout << f << endl; } + CatchAll { cout << BaseException::what() << endl; } + cout << "-----------------------------------------\n\n"; + + cout << "Matrix to vector\n"; + et.ReName("Block G"); + Try { ColumnVector CV = A;} + CatchAll { cout << BaseException::what() << endl; } + cout << "-----------------------------------------\n\n"; + + cout << "Invert singular matrix\n"; + et.ReName("Block H"); + Try { Matrix X(2,2); X<<1<<2<<2<<4; X = X.i(); } + CatchAll { cout << BaseException::what() << endl; } + cout << "-----------------------------------------\n\n"; + + cout << "SubMatrix error\n"; + et.ReName("Block I"); + Try { Matrix X = A.Row(3); } + CatchAll { cout << BaseException::what() << endl; } + cout << "-----------------------------------------\n\n"; + + cout << "SubMatrix error\n"; + et.ReName("Block J"); + Try { Matrix X = A.Row(0); } + CatchAll { cout << BaseException::what() << endl; } + cout << "-----------------------------------------\n\n"; + + cout << "Cholesky error\n"; + et.ReName("Block K"); + Try + { + SymmetricMatrix SM(50); SM = 10; + LowerTriangularMatrix L = Cholesky(SM); + } + CatchAll { cout << BaseException::what() << endl; } + cout << "-----------------------------------------\n\n"; + + cout << "Inequality error\n"; + et.ReName("Block L"); + Try + { + Matrix A(10,10), B(10,10); A = 10; B = 20; + if ( A < B) A = B; + } + CatchAll { cout << BaseException::what() << endl; } + cout << "-----------------------------------------\n\n"; + + cout << "Maximum of empty matrix\n"; + et.ReName("Block M"); + Try + { + Matrix A(10,20); A = 5; Matrix B=A.Rows(6,5); + maximum_absolute_value(B); + } + CatchAll { cout << BaseException::what() << endl; } + cout << "-----------------------------------------\n\n"; + + cout << "Incorrectly ReSizing band matrix\n"; + et.ReName("Block N"); + Try + { + BandMatrix A(20,5,3); A = 5; UpperBandMatrix B; + B.resize(A); + } + CatchAll { cout << BaseException::what() << endl; } + cout << "-----------------------------------------\n\n"; + + cout << "Incorrectly resizing symmetric band matrix\n"; + et.ReName("Block M"); + Try + { + BandMatrix A(20,5,3); A = 5; SymmetricBandMatrix B; + B.ReSize(A); + } + CatchAll { cout << BaseException::what() << endl; } + cout << "-----------------------------------------\n\n"; + + cout << "ReSize CroutMatrix\n"; + et.ReName("Block O"); + Try + { + Matrix A(3,3); A = 0; A(1,1) = A(2,2) = A(3,3) = 1; + CroutMatrix B = A; + B.resize(A); + } + CatchAll { cout << BaseException::what() << endl; } + cout << "-----------------------------------------\n\n"; + + cout << "Manipulate CroutMatrix\n"; + et.ReName("Block P"); + Try + { + Matrix A(3,3); A = 0; A(1,1) = A(2,2) = A(3,3) = 1; + CroutMatrix B = A; + Matrix C = B; + } + CatchAll { cout << BaseException::what() << endl; } + cout << "-----------------------------------------\n\n"; + + cout << "Manipulate BandLUMatrix\n"; + et.ReName("Block Q"); + Try + { + SymmetricBandMatrix A(3,1); A = 0; A(1,1) = A(2,2) = A(3,3) = 1; + BandLUMatrix B = A; + Matrix C = B; + } + CatchAll { cout << BaseException::what() << endl; } + cout << "-----------------------------------------\n\n"; + + + } + CatchAll { cout << "\nException generated in test program\n\n"; } + } + + cout << "\nEnd test\n"; + { Matrix A1(40,200); s2 = A1.data(); } + cout << "\n(The following memory checks are probably not valid with all\n"; + cout << "compilers - see documentation)\n"; + cout << "\nChecking for lost memory (large block): " + << (unsigned long)s1 << " " << (unsigned long)s2 << " "; + if (s1 != s2) cout << " - see section 2.8\n"; else cout << " - ok\n"; + { Matrix A1(1,1); s4 = A1.data(); } + cout << "\nChecking for lost memory (small block): " + << (unsigned long)s3 << " " << (unsigned long)s4 << " "; + if (s3 != s4) cout << " - see section 2.8\n\n"; else cout << " - ok\n\n"; + + +#ifdef DO_FREE_CHECK + FreeCheck::Status(); +#endif + +// Throw(Runtime_error("Exception outside try block")); + + return 0; +} + +///@} diff --git a/extern/newmat/test_exc.txt b/extern/newmat/test_exc.txt new file mode 100644 index 00000000..a0be2118 --- /dev/null +++ b/extern/newmat/test_exc.txt @@ -0,0 +1,210 @@ + +This tests the exception system, so you will get +a long list of error messages + + +Print a real number (may help lost memory test): 3.14159 +----------------------------------------- + +Incompatible dimensions + + +An exception has been thrown +Logic error:- detected by Newmat: incompatible dimensions + +MatrixType = Rect # Rows = 2; # Cols = 3 +MatrixType = Rect # Rows = 4; # Cols = 5 +Trace: AddedMatrix::Evaluate; Block A; Test. + +----------------------------------------- + +Bad index + + +An exception has been thrown +Logic error:- detected by Newmat: index error: requested indices = 3, 3 + +MatrixType = Rect # Rows = 2; # Cols = 3 +Trace: Block B; Test. + +----------------------------------------- + +Illegal conversion + + +An exception has been thrown +Logic error:- detected by Newmat: Illegal Conversion +MatrixTypes = Rect ; UT + +Trace: Block C; Test. + +----------------------------------------- + +Invert non-square matrix - 1 + + +An exception has been thrown +Logic error:- detected by Newmat: matrix is not square + +MatrixType = Rect # Rows = 2; # Cols = 3 +Trace: CroutMatrix; Block D; Test. + +----------------------------------------- + +Invert non-square matrix - 2 + + +An exception has been thrown +Logic error:- detected by Newmat: matrix is not square + +MatrixType = Rect # Rows = 2; # Cols = 3 +Trace: GeneralSolvI; InvertedMatrix::Evaluate; Block E; Test. + +----------------------------------------- + +Non 1x1 matrix to scalar + + +An exception has been thrown +Logic error:- detected by Newmat: Cannot convert to scalar + +MatrixType = Rect # Rows = 2; # Cols = 3 +Trace: as_scalar; Block F; Test. + +----------------------------------------- + +Matrix to vector + + +An exception has been thrown +Logic error:- detected by Newmat: cannot convert matrix to vector + +MatrixType = Rect # Rows = 2; # Cols = 3 +Trace: ColumnVector; Block G; Test. + +----------------------------------------- + +Invert singular matrix + + +An exception has been thrown +Runtime error:- detected by Newmat: matrix is singular + +MatrixType = Crout # Rows = 2; # Cols = 2 +Trace: Crout(lubksb); GeneralSolvI; InvertedMatrix::Evaluate; Block H; Test. + +----------------------------------------- + +SubMatrix error + + +An exception has been thrown +Logic error:- detected by Newmat: incompatible submatrix dimension + +Trace: SubMatrix(evaluate); Block I; Test. + +----------------------------------------- + +SubMatrix error + + +An exception has been thrown +Logic error:- detected by Newmat: incompatible submatrix dimension + +Trace: SubMatrix(row); Block J; Test. + +----------------------------------------- + +Cholesky error + + +An exception has been thrown +Runtime error:- detected by Newmat: matrix not positive definite + +MatrixType = Sym # Rows = 50; # Cols = 50 +Trace: Cholesky; Block K; Test. + +----------------------------------------- + +Inequality error + + +An exception has been thrown +Logic error:- detected by Newmat: inequalities not defined for matrices + +Trace: Block L; Test. + +----------------------------------------- + +Maximum of empty matrix + + +An exception has been thrown +Logic error:- detected by Newmat: Maximum or minimum of null matrix + +Trace: Block M; Test. + +----------------------------------------- + +Incorrectly ReSizing band matrix + + +An exception has been thrown +Logic error:- detected by Newmat: UpperBandMatrix with non-zero lower band + +Trace: UpperBandMatrix::resize; Block N; Test. + +----------------------------------------- + +Incorrectly resizing symmetric band matrix + + +An exception has been thrown +Logic error:- detected by Newmat: Upper and lower band-widths not equal + +Trace: SymmetricBandMatrix::resize(GM); Block M; Test. + +----------------------------------------- + +ReSize CroutMatrix + + +An exception has been thrown +Logic error:- detected by Newmat: resize not defined for this type of matrix + +Trace: GeneralMatrix::resize(GM); Block O; Test. + +----------------------------------------- + +Manipulate CroutMatrix + + +An exception has been thrown +Logic error:- detected by Newmat: Illegal use of CroutMatrix + +MatrixType = Crout # Rows = 3; # Cols = 3 +Trace: CroutMatrix::Evaluate; Block P; Test. + +----------------------------------------- + +Manipulate BandLUMatrix + + +An exception has been thrown +Logic error:- detected by Newmat: Illegal use of BandLUMatrix + +MatrixType = BndLU # Rows = 3; # Cols = 3; lower BW = 1; upper BW = 1 +Trace: BandLUMatrix::Evaluate; Block Q; Test. + +----------------------------------------- + + +End test + +(The following memory checks are probably not valid with all +compilers - see documentation) + +Checking for lost memory (large block): 9191360 9191360 - ok + +Checking for lost memory (small block): 9191360 9191360 - ok + diff --git a/extern/newmat/tmt.cpp b/extern/newmat/tmt.cpp new file mode 100644 index 00000000..3b4af857 --- /dev/null +++ b/extern/newmat/tmt.cpp @@ -0,0 +1,559 @@ +/// \ingroup newmat +///@{ + +/// \file tmt.cpp +/// Main file for matrix library test program. + +#define WANT_STREAM +#define WANT_TIME + +#include "include.h" + +#include "newmat.h" + +#include "tmt.h" + +#ifdef use_namespace +//using namespace NEWMAT; +namespace NEWMAT { +#endif + + +/**************************** test program ******************************/ + + +class PrintCounter +{ + int count; + const char* s; +public: + PrintCounter(const char * sx) : count(0), s(sx) {} + void operator++() { count++; } + void report(); +}; + +PrintCounter PCZ("Number of non-zero matrices (should be 1) = "); +PrintCounter PCN("Number of matrices tested = "); + +void PrintCounter::report() +{ cout << s << count << "\n"; } + + +void Print(const Matrix& X) +{ + ++PCN; + cout << "\nMatrix type: " << X.Type().Value() << " ("; + cout << X.Nrows() << ", "; + cout << X.Ncols() << ")\n\n"; + if (X.IsZero()) { cout << "All elements are zero\n" << flush; return; } + int nr=X.Nrows(); int nc=X.Ncols(); + for (int i=1; i<=nr; i++) + { + for (int j=1; j<=nc; j++) cout << X(i,j) << "\t"; + cout << "\n"; + } + cout << flush; ++PCZ; +} + +void Print(const UpperTriangularMatrix& X) +{ + ++PCN; + cout << "\nMatrix type: " << X.Type().Value() << " ("; + cout << X.Nrows() << ", "; + cout << X.Ncols() << ")\n\n"; + if (X.IsZero()) { cout << "All elements are zero\n" << flush; return; } + int nr=X.Nrows(); int nc=X.Ncols(); + for (int i=1; i<=nr; i++) + { + int j; + for (j=1; j -c)) A(i,j) = 0.0; } + } +} + +void Clean(DiagonalMatrix& A, Real c) +{ + int nr = A.Nrows(); + for (int i=1; i<=nr; i++) + { Real a = A(i,i); if ((a < c) && (a > -c)) A(i,i) = 0.0; } +} + +void PentiumCheck(Real N, Real D) +{ + Real R = N / D; + R = R * D - N; + if ( R > 1 || R < -1) + cout << "Pentium error detected: % error = " << 100 * R / N << "\n"; +} + +// random number generator class +// See newran03 documentation for details + +MultWithCarry::MultWithCarry(double s) +{ + if (s>=1.0 || s<=0.0) + Throw(Logic_error("MultWithCarry: seed out of range")); + x = (unsigned long)(s * 4294967296.0); + crry = 1234567; +} + + +// carry out 32bit * 32bit multiply in software + +void MultWithCarry::NextValue() +{ + unsigned long mult = 2083801278; + unsigned long m_hi = mult >> 16; + unsigned long m_lo = mult & 0xFFFF; + + unsigned long x_hi = x >> 16; + unsigned long x_lo = x & 0xFFFF; + + unsigned long c_hi = crry >> 16; + unsigned long c_lo = crry & 0xFFFF; + + x = x_lo * m_lo + c_lo; + unsigned long axc = x_lo * m_hi + x_hi * m_lo + c_hi + (x >> 16); + crry = x_hi * m_hi + (axc >> 16); + + x = (x & 0xFFFF) + ((axc << 16) & 0xFFFFFFFF); + +} + +Real MultWithCarry::Next() { NextValue(); return ((double)x + 0.5) / 4294967296.0; } + +// fill a matrix with values from the MultWithCarry random number generator +void FillWithValues(MultWithCarry&MWC, Matrix& M) +{ + int nr = M.nrows(); + int nc = M.ncols(); + for (int i = 1; i <= nr; ++i) for (int j = 1; j <= nc; ++ j) + M(i, j) = MWC.Next(); +} + +void FillWithValues(MultWithCarry&MWC, UpperTriangularMatrix& M) +{ + int nr = M.nrows(); + for (int i = 1; i <= nr; ++i) for (int j = i; j <= nr; ++ j) + M(i, j) = MWC.Next(); +} + +void FillWithValues(MultWithCarry&MWC, LowerTriangularMatrix& M) +{ + int nr = M.nrows(); + for (int i = 1; i <= nr; ++i) for (int j = 1; j <= i; ++ j) + M(i, j) = MWC.Next(); +} + +void FillWithValues(MultWithCarry&MWC, DiagonalMatrix& M) +{ + int nr = M.nrows(); + for (int i = 1; i <= nr; ++i) + M(i) = MWC.Next(); +} + +void FillWithValues(MultWithCarry&MWC, SymmetricMatrix& M) +{ + int nr = M.nrows(); + for (int i = 1; i <= nr; ++i) for (int j = 1; j <= i; ++ j) + M(i, j) = MWC.Next(); +} + + + +#ifdef use_namespace +} +using namespace NEWMAT; +#endif + + +//*************************** main program ********************************** + +void TestTypeAdd(); // test + +void TestTypeMult(); // test * +void TestTypeConcat(); // test | +void TestTypeSP(); // test SP +void TestTypeKP(); // test KP +void TestTypeOrder(); // test >= + + +int main() +{ + time_lapse tl; // measure program run time + Real* s1; Real* s2; Real* s3; Real* s4; + cout << "\nBegin test\n"; // Forces cout to allocate memory at beginning + cout << "Now print a real number: " << 3.14159265 << endl; + // Throw exception to set up exception buffer +#ifndef DisableExceptions + Try { Throw(BaseException("Just a dummy\n")); } + CatchAll {} + BaseException::clear(); +#else + cout << "Not doing exceptions\n"; +#endif + { Matrix A1(40,200); s1 = A1.Store(); } + { Matrix A1(1,1); s3 = A1.Store(); } + { + Tracer et("Matrix test program"); + + Matrix A(25,150); + { + int i; + RowVector A(8); + for (i=1;i<=7;i++) A(i)=0.0; A(8)=1.0; + Print(A); + } + cout << "\n"; + + TestTypeAdd(); TestTypeMult(); TestTypeConcat(); + TestTypeSP(); TestTypeKP(); TestTypeOrder(); + + Try { + trymat1(); + trymat2(); + trymat3(); + trymat4(); + trymat5(); + trymat6(); + trymat7(); + trymat8(); + trymat9(); + trymata(); + trymatb(); + trymatc(); + trymatd(); + trymate(); + trymatf(); + trymatg(); + trymath(); + trymati(); + trymatj(); + trymatk(); + trymatl(); + trymatm(); + + cout << "\nEnd of tests\n"; + } + CatchAll + { + cout << "\nTest program fails - exception generated\n\n"; + cout << BaseException::what(); + } + + + } + + { Matrix A1(40,200); s2 = A1.Store(); } + cout << "\n(The following memory checks are probably not valid with all\n"; + cout << "compilers - see documentation)\n"; + cout << "\nChecking for lost memory (large block): " + << (unsigned long)s1 << " " << (unsigned long)s2 << " "; + if (s1 != s2) cout << " - see section 2.8\n\n"; else cout << " - ok\n\n"; + { Matrix A1(1,1); s4 = A1.Store(); } + cout << "\nChecking for lost memory (small block): " + << (unsigned long)s3 << " " << (unsigned long)s4 << " "; + if (s3 != s4) cout << " - see section 2.8\n\n"; else cout << " - ok\n\n"; + + // check for Pentium bug + PentiumCheck(4195835L,3145727L); + PentiumCheck(5244795L,3932159L); + +#ifdef DO_FREE_CHECK + FreeCheck::Status(); +#endif + + // print matrix print count + PCN.report(); + PCZ.report(); + cout << endl; + + return 0; +} + + + + +//************************ test type manipulation **************************/ + + +// These functions may cause problems for Glockenspiel 2.0c; they are used +// only for testing so you can delete them + + +void TestTypeAdd() +{ + MatrixType list[13]; + list[0] = MatrixType::UT; + list[1] = MatrixType::LT; + list[2] = MatrixType::Rt; + list[3] = MatrixType::Sq; + list[4] = MatrixType::Sm; + list[5] = MatrixType::Sk; + list[6] = MatrixType::Dg; + list[7] = MatrixType::Id; + list[8] = MatrixType::BM; + list[9] = MatrixType::UB; + list[10] = MatrixType::LB; + list[11] = MatrixType::SB; + list[12] = MatrixType::KB; + + cout << "+ "; + int i; + for (i=0; i= "; + int i; + for (i = 0; i=list[i]) ? "Yes " : "No "); + cout << "\n"; + } + cout << "\n"; +} + + +//************** elapsed time class **************** + +time_lapse::time_lapse() +{ + start_time = ((double)clock())/(double)CLOCKS_PER_SEC; +} + +time_lapse::~time_lapse() +{ + double time = ((double)clock())/(double)CLOCKS_PER_SEC - start_time; + cout << "Elapsed (processor) time = " << setprecision(2) << time << " seconds" << endl; + cout << endl; +} + + + + +///@} + + + diff --git a/extern/newmat/tmt.h b/extern/newmat/tmt.h new file mode 100644 index 00000000..4233d6d6 --- /dev/null +++ b/extern/newmat/tmt.h @@ -0,0 +1,100 @@ +/// \ingroup newmat +///@{ + +/// \file tmt.h +/// Header file for test programs + +//#define DONT_DO_NRIC // activate if running a bounds checker + +#ifdef use_namespace +//using namespace NEWMAT; +namespace NEWMAT { +#endif + +// print time between construction and destruction +class time_lapse +{ + double start_time; +public: + time_lapse(); + ~time_lapse(); +}; + +// random number generator + +class MultWithCarry +{ + unsigned long x; + unsigned long crry; + + void NextValue(); + + void operator=(const MultWithCarry&) {} // private so can't access + +public: + MultWithCarry(double s=0.46875); + Real Next(); + ~MultWithCarry() {} +}; + +// fill a matrix with values from the MultWithCarry random number generator +void FillWithValues(MultWithCarry& MWC, Matrix& M); +void FillWithValues(MultWithCarry& MWC, UpperTriangularMatrix& M); +void FillWithValues(MultWithCarry& MWC, LowerTriangularMatrix& M); +void FillWithValues(MultWithCarry& MWC, DiagonalMatrix& M); +void FillWithValues(MultWithCarry& MWC, SymmetricMatrix& M); + + +void Print(const Matrix& X); +void Print(const UpperTriangularMatrix& X); +void Print(const DiagonalMatrix& X); +void Print(const SymmetricMatrix& X); +void Print(const LowerTriangularMatrix& X); + +void Clean(Matrix&, Real); +void Clean(DiagonalMatrix&, Real); + +#ifdef use_namespace +} +using namespace NEWMAT; +#endif + + + +void trymat1(); void trymat2(); void trymat3(); +void trymat4(); void trymat5(); void trymat6(); +void trymat7(); void trymat8(); void trymat9(); +void trymata(); void trymatb(); void trymatc(); +void trymatd(); void trymate(); void trymatf(); +void trymatg(); void trymath(); void trymati(); +void trymatj(); void trymatk(); void trymatl(); +void trymatm(); + + + +// body file: tmt.cpp +// body file: tmt1.cpp +// body file: tmt2.cpp +// body file: tmt3.cpp +// body file: tmt4.cpp +// body file: tmt5.cpp +// body file: tmt6.cpp +// body file: tmt7.cpp +// body file: tmt8.cpp +// body file: tmt9.cpp +// body file: tmta.cpp +// body file: tmtb.cpp +// body file: tmtc.cpp +// body file: tmtd.cpp +// body file: tmte.cpp +// body file: tmtf.cpp +// body file: tmtg.cpp +// body file: tmth.cpp +// body file: tmti.cpp +// body file: tmtj.cpp +// body file: tmtk.cpp +// body file: tmtl.cpp +// body file: tmtm.cpp + + +///@} diff --git a/extern/newmat/tmt.txt b/extern/newmat/tmt.txt new file mode 100644 index 00000000..76a79f79 --- /dev/null +++ b/extern/newmat/tmt.txt @@ -0,0 +1,6594 @@ + +Begin test +Now print a real number: 3.14159 + +Matrix type: Rect (1, 8) + +0 0 0 0 0 0 0 1 + ++ UT LT Rect Squ Sym Skew Diag Ident Band UpBnd LwBnd SmBnd SkBnd +UT UT Squ Rect Squ Squ Squ UT UT Squ UT Squ Squ Squ +LT Squ LT Rect Squ Squ Squ LT LT Squ Squ LT Squ Squ +Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect +Squ Squ Squ Rect Squ Squ Squ Squ Squ Squ Squ Squ Squ Squ +Sym Squ Squ Rect Squ Sym Squ Sym Sym Squ Squ Squ Sym Squ +Skew Squ Squ Rect Squ Squ Skew Squ Squ Squ Squ Squ Squ Skew +Diag UT LT Rect Squ Sym Squ Diag Diag Band UpBnd LwBnd SmBnd Band +Ident UT LT Rect Squ Sym Squ Diag Ident Band UpBnd LwBnd SmBnd Band +Band Squ Squ Rect Squ Squ Squ Band Band Band Band Band Band Band +UpBnd UT Squ Rect Squ Squ Squ UpBnd UpBnd Band UpBnd Band Band Band +LwBnd Squ LT Rect Squ Squ Squ LwBnd LwBnd Band Band LwBnd Band Band +SmBnd Squ Squ Rect Squ Sym Squ SmBnd SmBnd Band Band Band SmBnd Band +SkBnd Squ Squ Rect Squ Squ Skew Band Band Band Band Band Band SkBnd + +* UT LT Rect Squ Sym Skew Diag Ident Band UpBnd LwBnd SmBnd SkBnd +UT UT Squ Rect Squ Squ Squ UT UT Squ UT Squ Squ Squ +LT Squ LT Rect Squ Squ Squ LT LT Squ Squ LT Squ Squ +Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect +Squ Squ Squ Rect Squ Squ Squ Squ Squ Squ Squ Squ Squ Squ +Sym Squ Squ Rect Squ Squ Squ Squ Squ Squ Squ Squ Squ Squ +Skew Squ Squ Rect Squ Squ Squ Squ Squ Squ Squ Squ Squ Squ +Diag UT LT Rect Squ Squ Squ Diag Diag Band UpBnd LwBnd Band Band +Ident UT LT Rect Squ Squ Squ Diag Ident Band UpBnd LwBnd Band Band +Band Squ Squ Rect Squ Squ Squ Band Band Band Band Band Band Band +UpBnd UT Squ Rect Squ Squ Squ UpBnd UpBnd Band UpBnd Band Band Band +LwBnd Squ LT Rect Squ Squ Squ LwBnd LwBnd Band Band LwBnd Band Band +SmBnd Squ Squ Rect Squ Squ Squ Band Band Band Band Band Band Band +SkBnd Squ Squ Rect Squ Squ Squ Band Band Band Band Band Band Band + +| UT LT Rect Squ Sym Skew Diag Ident Band UpBnd LwBnd SmBnd SkBnd +UT Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect +LT Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect +Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect +Squ Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect +Sym Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect +Skew Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect +Diag Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect +Ident Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect +Band Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect +UpBnd Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect +LwBnd Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect +SmBnd Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect +SkBnd Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect + +SP UT LT Rect Squ Sym Skew Diag Ident Band UpBnd LwBnd SmBnd SkBnd +UT UT Diag UT UT UT UT Diag Diag UpBnd UpBnd Diag UpBnd UpBnd +LT Diag LT LT LT LT LT Diag Diag LwBnd Diag LwBnd LwBnd LwBnd +Rect UT LT Rect Squ Squ Squ Diag Diag Band UpBnd LwBnd Band Band +Squ UT LT Squ Squ Squ Squ Diag Diag Band UpBnd LwBnd Band Band +Sym UT LT Squ Squ Sym Skew Diag Diag Band UpBnd LwBnd SmBnd SkBnd +Skew UT LT Squ Squ Skew Sym ????? ????? Band UpBnd LwBnd SkBnd SmBnd +Diag Diag Diag Diag Diag Diag ????? Diag Diag Diag Diag Diag Diag ????? +Ident Diag Diag Diag Diag Diag ????? Diag Ident Diag Diag Diag Diag ????? +Band UpBnd LwBnd Band Band Band Band Diag Diag Band UpBnd LwBnd Band Band +UpBnd UpBnd Diag UpBnd UpBnd UpBnd UpBnd Diag Diag UpBnd UpBnd Diag UpBnd UpBnd +LwBnd Diag LwBnd LwBnd LwBnd LwBnd LwBnd Diag Diag LwBnd Diag LwBnd LwBnd LwBnd +SmBnd UpBnd LwBnd Band Band SmBnd SkBnd Diag Diag Band UpBnd LwBnd SmBnd SkBnd +SkBnd UpBnd LwBnd Band Band SkBnd SmBnd ????? ????? Band UpBnd LwBnd SkBnd SmBnd + +KP UT LT Rect Squ Sym Skew Diag Ident Band UpBnd LwBnd SmBnd SkBnd +UT UT Squ Rect Squ Squ Squ UpBnd UpBnd Band UpBnd Band Band Band +LT Squ LT Rect Squ Squ Squ LwBnd LwBnd Band Band LwBnd Band Band +Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect Rect +Squ Squ Squ Rect Squ Squ Squ Band Band Band Band Band Band Band +Sym Squ Squ Rect Squ Sym Squ SmBnd SmBnd Band Band Band SmBnd Band +Skew Squ Squ Rect Squ Squ Skew Band Band Band Band Band Band SkBnd +Diag UT LT Rect Squ Sym Squ Diag Diag Band UpBnd LwBnd SmBnd Band +Ident UT LT Rect Squ Sym Squ Diag Diag Band UpBnd LwBnd SmBnd Band +Band Squ Squ Rect Squ Squ Squ Band Band Band Band Band Band Band +UpBnd UT Squ Rect Squ Squ Squ UpBnd UpBnd Band UpBnd Band Band Band +LwBnd Squ LT Rect Squ Squ Squ LwBnd LwBnd Band Band LwBnd Band Band +SmBnd Squ Squ Rect Squ Sym Squ SmBnd SmBnd Band Band Band SmBnd Band +SkBnd Squ Squ Rect Squ Squ Skew Band Band Band Band Band Band SkBnd + +>= UT LT Rect Squ Sym Skew Diag Ident Band UpBnd LwBnd SmBnd SkBnd +UT Yes No Yes Yes No No No No No No No No No +LT No Yes Yes Yes No No No No No No No No No +Rect No No Yes Yes No No No No No No No No No +Squ No No Yes Yes No No No No No No No No No +Sym No No Yes Yes Yes No No No No No No No No +Skew No No Yes Yes No Yes No No No No No No No +Diag Yes Yes Yes Yes Yes No Yes No Yes Yes Yes Yes No +Ident Yes Yes Yes Yes Yes No Yes Yes Yes Yes Yes Yes No +Band No No Yes Yes No No No No Yes No No No No +UpBnd Yes No Yes Yes No No No No Yes Yes No No No +LwBnd No Yes Yes Yes No No No No Yes No Yes No No +SmBnd No No Yes Yes Yes No No No Yes No No Yes No +SkBnd No No Yes Yes No Yes No No Yes No No No Yes + + + * First test of Matrix package + * Matrix test program + +Matrix type: LT (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: UT (9, 9) + +All elements are zero + +Matrix type: Rect (9, 9) + +All elements are zero + +Matrix type: Rect (10, 3) + +All elements are zero + +Matrix type: Rect (10, 3) + +All elements are zero + +Matrix type: Rect (10, 3) + +All elements are zero + +Matrix type: Rect (10, 3) + +All elements are zero + +Matrix type: Rect (10, 3) + +All elements are zero + +Matrix type: Rect (10, 3) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (20, 8) + +All elements are zero + +Matrix type: Rect (20, 6) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 20) + +All elements are zero + +Matrix type: Rect (20, 10) + +All elements are zero + +Matrix type: Rect (20, 10) + +All elements are zero + +Matrix type: Rect (10, 20) + +All elements are zero + +Matrix type: Rect (3, 3) + +All elements are zero + +Matrix type: Rect (3, 1) + +All elements are zero + +Matrix type: Rect (3, 1) + +All elements are zero + +Matrix type: Rect (3, 1) + +All elements are zero + +Matrix type: Rect (3, 1) + +All elements are zero + +Matrix type: Rect (3, 1) + +All elements are zero + +Matrix type: Rect (3, 1) + +All elements are zero + +Matrix type: Rect (3, 1) + +All elements are zero + +Matrix type: Rect (3, 1) + +All elements are zero + +Matrix type: Rect (3, 1) + +All elements are zero + +Matrix type: Rect (3, 1) + +All elements are zero + +Matrix type: Rect (3, 1) + +All elements are zero + +Matrix type: Rect (1, 3) + +All elements are zero + +Matrix type: Rect (10, 3) + +All elements are zero + +Matrix type: Rect (3, 10) + +All elements are zero + +Matrix type: Rect (10, 1) + +All elements are zero + + * Second test of Matrix package + * Matrix test program + +Matrix type: Rect (8, 10) + +All elements are zero + +Matrix type: Rect (8, 10) + +All elements are zero + +Matrix type: Rect (8, 10) + +All elements are zero + +Matrix type: Rect (8, 10) + +All elements are zero + +Matrix type: Rect (8, 10) + +All elements are zero + +Matrix type: Rect (100, 1) + +All elements are zero + +Matrix type: Rect (10, 1) + +All elements are zero + +Matrix type: Rect (20, 1) + +All elements are zero + +Matrix type: Rect (4, 7) + +All elements are zero + +Matrix type: Rect (4, 7) + +All elements are zero + +Matrix type: Rect (8, 8) + +All elements are zero + +Matrix type: Rect (8, 8) + +All elements are zero + +Matrix type: Rect (8, 8) + +All elements are zero + +Matrix type: Rect (8, 8) + +All elements are zero + +Matrix type: Rect (8, 8) + +All elements are zero + +Matrix type: Rect (10, 20) + +All elements are zero + +Matrix type: Rect (0, 0) + +All elements are zero + +Matrix type: Rect (16, 1) + +All elements are zero + +Matrix type: Rect (0, 1) + +All elements are zero + +Matrix type: Rect (16, 1) + +All elements are zero + +Matrix type: Rect (1, 0) + +All elements are zero + +Matrix type: Rect (16, 1) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Diag (10, 10) + +All elements are zero + +Matrix type: Rect (8, 1) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (14, 1) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 20) + +All elements are zero + +Matrix type: Rect (20, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (4, 6) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Diag (20, 20) + +All elements are zero + +Matrix type: Rect (3, 3) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (2, 3) + +All elements are zero + +Matrix type: Rect (2, 3) + +All elements are zero + + * Third test of Matrix package + * Matrix test program + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (6, 7) + +All elements are zero + +Matrix type: Rect (6, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Diag (6, 6) + +All elements are zero + +Matrix type: Diag (6, 6) + +All elements are zero + +Matrix type: Rect (3, 3) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Rect (10, 1) + +All elements are zero + +Matrix type: Rect (1, 10) + +All elements are zero + +Matrix type: Diag (10, 10) + +All elements are zero + +Matrix type: Rect (19, 1) + +All elements are zero + +Matrix type: Rect (19, 1) + +All elements are zero + +Matrix type: Rect (3, 3) + +All elements are zero + +Matrix type: Rect (3, 3) + +All elements are zero + +Matrix type: Rect (3, 3) + +All elements are zero + +Matrix type: Rect (3, 3) + +All elements are zero + +Matrix type: Rect (4, 1) + +All elements are zero + +Matrix type: Rect (6, 1) + +All elements are zero + +Matrix type: Rect (6, 3) + +All elements are zero + +Matrix type: Rect (3, 3) + +All elements are zero + + * Fourth test of Matrix package + * Matrix test program + +Matrix type: Rect (3, 10) + +All elements are zero + +Matrix type: Rect (3, 10) + +All elements are zero + +Matrix type: Rect (3, 3) + +All elements are zero + +Matrix type: Rect (10, 3) + +All elements are zero + +Matrix type: Rect (10, 3) + +All elements are zero + +Matrix type: Rect (10, 1) + +All elements are zero + +Matrix type: Rect (10, 3) + +All elements are zero + +Matrix type: Rect (5, 8) + +All elements are zero + +Matrix type: Rect (4, 5) + +All elements are zero + +Matrix type: Rect (4, 5) + +All elements are zero + +Matrix type: Rect (4, 5) + +All elements are zero + +Matrix type: Rect (4, 5) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Rect (4, 4) + +All elements are zero + +Matrix type: Diag (1, 1) + +All elements are zero + +Matrix type: Rect (2, 2) + +All elements are zero + +Matrix type: Diag (4, 4) + +All elements are zero + +Matrix type: Diag (4, 4) + +All elements are zero + +Matrix type: Rect (5, 6) + +All elements are zero + +Matrix type: Rect (3, 4) + +All elements are zero + +Matrix type: Rect (0, 0) + +All elements are zero + +Matrix type: Rect (5, 6) + +All elements are zero + +Matrix type: Rect (0, 0) + +All elements are zero + +Matrix type: Rect (1, 2) + +All elements are zero + +Matrix type: UT (0, 0) + +All elements are zero + +Matrix type: UT (20, 20) + +All elements are zero + +Matrix type: LT (0, 0) + +All elements are zero + +Matrix type: LT (20, 20) + +All elements are zero + +Matrix type: Sym (0, 0) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Diag (0, 0) + +All elements are zero + +Matrix type: Diag (20, 20) + +All elements are zero + +Matrix type: Rect (1, 0) + +All elements are zero + +Matrix type: Rect (1, 20) + +All elements are zero + +Matrix type: Rect (0, 1) + +All elements are zero + +Matrix type: Rect (20, 1) + +All elements are zero + +Matrix type: Rect (0, 0) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (0, 0) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (0, 0) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (0, 0) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + + * Fifth test of Matrix package + * Matrix test program + +Matrix type: Rect (6, 1) + +All elements are zero + +Matrix type: Rect (6, 1) + +All elements are zero + +Matrix type: Rect (6, 1) + +All elements are zero + +Matrix type: Rect (1, 6) + +All elements are zero + +Matrix type: Rect (1, 10) + +All elements are zero + +Matrix type: Rect (2, 3) + +All elements are zero + +Matrix type: Rect (3, 2) + +All elements are zero + +Matrix type: Rect (1, 10) + +All elements are zero + +Matrix type: Rect (10, 1) + +All elements are zero + +Matrix type: Rect (5, 6) + +All elements are zero + +Matrix type: Rect (31, 31) + +All elements are zero + +Matrix type: Rect (31, 31) + +All elements are zero + +Matrix type: Rect (31, 31) + +All elements are zero + +Matrix type: Rect (31, 31) + +All elements are zero + +Matrix type: Rect (31, 31) + +All elements are zero + +Matrix type: Rect (31, 31) + +All elements are zero + +Matrix type: Diag (31, 31) + +All elements are zero + + * Sixth test of Matrix package + * Matrix test program + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: LT (5, 5) + +All elements are zero + +Matrix type: LT (5, 5) + +All elements are zero + +Matrix type: Diag (5, 5) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Rect (5, 10) + +All elements are zero + +Matrix type: Rect (5, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (1, 1) + +All elements are zero + +Matrix type: Rect (1, 1) + +All elements are zero + +Matrix type: Rect (1, 1) + +All elements are zero + +Matrix type: Rect (1, 1) + +All elements are zero + +Matrix type: Rect (1, 1) + +All elements are zero + +Matrix type: Rect (1, 1) + +All elements are zero + +Matrix type: Rect (1, 1) + +All elements are zero + +Matrix type: Rect (1, 1) + +All elements are zero + +Matrix type: Rect (1, 2) + +All elements are zero + +Matrix type: Rect (1, 2) + +All elements are zero + +Matrix type: Rect (1, 2) + +All elements are zero + +Matrix type: Rect (1, 2) + +All elements are zero + +Matrix type: Rect (1, 2) + +All elements are zero + +Matrix type: Rect (1, 2) + +All elements are zero + +Matrix type: Rect (1, 2) + +All elements are zero + +Matrix type: Rect (1, 2) + +All elements are zero + +Matrix type: Rect (1, 3) + +All elements are zero + +Matrix type: Rect (1, 3) + +All elements are zero + +Matrix type: Rect (1, 3) + +All elements are zero + +Matrix type: Rect (1, 3) + +All elements are zero + +Matrix type: Rect (1, 3) + +All elements are zero + +Matrix type: Rect (1, 3) + +All elements are zero + +Matrix type: Rect (1, 3) + +All elements are zero + +Matrix type: Rect (1, 3) + +All elements are zero + +Matrix type: Rect (1, 4) + +All elements are zero + +Matrix type: Rect (1, 4) + +All elements are zero + +Matrix type: Rect (1, 4) + +All elements are zero + +Matrix type: Rect (1, 4) + +All elements are zero + +Matrix type: Rect (1, 4) + +All elements are zero + +Matrix type: Rect (1, 4) + +All elements are zero + +Matrix type: Rect (1, 4) + +All elements are zero + +Matrix type: Rect (1, 4) + +All elements are zero + +Matrix type: Rect (1, 15) + +All elements are zero + +Matrix type: Rect (1, 15) + +All elements are zero + +Matrix type: Rect (1, 15) + +All elements are zero + +Matrix type: Rect (1, 15) + +All elements are zero + +Matrix type: Rect (1, 15) + +All elements are zero + +Matrix type: Rect (1, 15) + +All elements are zero + +Matrix type: Rect (1, 15) + +All elements are zero + +Matrix type: Rect (1, 15) + +All elements are zero + +Matrix type: Rect (1, 16) + +All elements are zero + +Matrix type: Rect (1, 16) + +All elements are zero + +Matrix type: Rect (1, 16) + +All elements are zero + +Matrix type: Rect (1, 16) + +All elements are zero + +Matrix type: Rect (1, 16) + +All elements are zero + +Matrix type: Rect (1, 16) + +All elements are zero + +Matrix type: Rect (1, 16) + +All elements are zero + +Matrix type: Rect (1, 16) + +All elements are zero + +Matrix type: Rect (1, 17) + +All elements are zero + +Matrix type: Rect (1, 17) + +All elements are zero + +Matrix type: Rect (1, 17) + +All elements are zero + +Matrix type: Rect (1, 17) + +All elements are zero + +Matrix type: Rect (1, 17) + +All elements are zero + +Matrix type: Rect (1, 17) + +All elements are zero + +Matrix type: Rect (1, 17) + +All elements are zero + +Matrix type: Rect (1, 17) + +All elements are zero + +Matrix type: Rect (1, 18) + +All elements are zero + +Matrix type: Rect (1, 18) + +All elements are zero + +Matrix type: Rect (1, 18) + +All elements are zero + +Matrix type: Rect (1, 18) + +All elements are zero + +Matrix type: Rect (1, 18) + +All elements are zero + +Matrix type: Rect (1, 18) + +All elements are zero + +Matrix type: Rect (1, 18) + +All elements are zero + +Matrix type: Rect (1, 18) + +All elements are zero + +Matrix type: Rect (1, 99) + +All elements are zero + +Matrix type: Rect (1, 99) + +All elements are zero + +Matrix type: Rect (1, 99) + +All elements are zero + +Matrix type: Rect (1, 99) + +All elements are zero + +Matrix type: Rect (1, 99) + +All elements are zero + +Matrix type: Rect (1, 99) + +All elements are zero + +Matrix type: Rect (1, 99) + +All elements are zero + +Matrix type: Rect (1, 99) + +All elements are zero + +Matrix type: Rect (1, 100) + +All elements are zero + +Matrix type: Rect (1, 100) + +All elements are zero + +Matrix type: Rect (1, 100) + +All elements are zero + +Matrix type: Rect (1, 100) + +All elements are zero + +Matrix type: Rect (1, 100) + +All elements are zero + +Matrix type: Rect (1, 100) + +All elements are zero + +Matrix type: Rect (1, 100) + +All elements are zero + +Matrix type: Rect (1, 100) + +All elements are zero + +Matrix type: Rect (1, 101) + +All elements are zero + +Matrix type: Rect (1, 101) + +All elements are zero + +Matrix type: Rect (1, 101) + +All elements are zero + +Matrix type: Rect (1, 101) + +All elements are zero + +Matrix type: Rect (1, 101) + +All elements are zero + +Matrix type: Rect (1, 101) + +All elements are zero + +Matrix type: Rect (1, 101) + +All elements are zero + +Matrix type: Rect (1, 101) + +All elements are zero + + * Seventh test of Matrix package + * Matrix test program + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (11, 11) + +All elements are zero + +Matrix type: Rect (11, 11) + +All elements are zero + +Matrix type: Rect (1, 1) + +All elements are zero + +Matrix type: Rect (1, 121) + +All elements are zero + +Matrix type: Rect (11, 11) + +All elements are zero + +Matrix type: Rect (11, 11) + +All elements are zero + +Matrix type: Rect (11, 11) + +All elements are zero + +Matrix type: Rect (11, 11) + +All elements are zero + +Matrix type: Rect (11, 11) + +All elements are zero + +Matrix type: Rect (11, 11) + +All elements are zero + +Matrix type: Rect (11, 11) + +All elements are zero + +Matrix type: Rect (11, 11) + +All elements are zero + +Matrix type: Rect (11, 11) + +All elements are zero + +Matrix type: Rect (11, 11) + +All elements are zero + +Matrix type: Rect (10, 1) + +All elements are zero + +Matrix type: Rect (10, 15) + +All elements are zero + +Matrix type: Rect (11, 8) + +All elements are zero + +Matrix type: Rect (15, 25) + +All elements are zero + +Matrix type: Rect (15, 25) + +All elements are zero + +Matrix type: Rect (29, 27) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (38, 17) + +All elements are zero + +Matrix type: Rect (38, 17) + +All elements are zero + +Matrix type: Rect (15, 25) + +All elements are zero + +Matrix type: Rect (15, 25) + +All elements are zero + +Matrix type: Rect (29, 27) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (38, 17) + +All elements are zero + +Matrix type: Rect (38, 17) + +All elements are zero + +Matrix type: Rect (13, 13) + +All elements are zero + +Matrix type: Rect (13, 13) + +All elements are zero + +Matrix type: Rect (23, 23) + +All elements are zero + +Matrix type: Squ (50, 50) + +All elements are zero + +Matrix type: Rect (13, 13) + +All elements are zero + +Matrix type: Rect (13, 13) + +All elements are zero + +Matrix type: Rect (23, 23) + +All elements are zero + +Matrix type: Sym (50, 50) + +All elements are zero + +Matrix type: Rect (13, 13) + +All elements are zero + +Matrix type: Rect (13, 13) + +All elements are zero + +Matrix type: Rect (23, 23) + +All elements are zero + +Matrix type: LT (50, 50) + +All elements are zero + +Matrix type: Rect (13, 13) + +All elements are zero + +Matrix type: Rect (13, 13) + +All elements are zero + +Matrix type: Rect (23, 23) + +All elements are zero + +Matrix type: UT (50, 50) + +All elements are zero + +Matrix type: Rect (13, 13) + +All elements are zero + +Matrix type: Rect (13, 13) + +All elements are zero + +Matrix type: Rect (23, 23) + +All elements are zero + +Matrix type: Diag (50, 50) + +All elements are zero + +Matrix type: Rect (1, 13) + +All elements are zero + +Matrix type: Rect (1, 13) + +All elements are zero + +Matrix type: Rect (1, 23) + +All elements are zero + +Matrix type: Rect (1, 50) + +All elements are zero + +Matrix type: Rect (13, 1) + +All elements are zero + +Matrix type: Rect (13, 1) + +All elements are zero + +Matrix type: Rect (23, 1) + +All elements are zero + +Matrix type: Rect (50, 1) + +All elements are zero + + * Eighth test of Matrix package + * Matrix test program + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Diag (6, 6) + +All elements are zero + +Matrix type: Diag (6, 6) + +All elements are zero + +Matrix type: Diag (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: LT (4, 4) + +All elements are zero + +Matrix type: LT (4, 4) + +All elements are zero + +Matrix type: LT (4, 4) + +All elements are zero + +Matrix type: LT (4, 4) + +All elements are zero + +Matrix type: LT (4, 4) + +All elements are zero + +Matrix type: LT (4, 4) + +All elements are zero + +Matrix type: LT (4, 4) + +All elements are zero + +Matrix type: LT (4, 4) + +All elements are zero + +Matrix type: Rect (4, 4) + +All elements are zero + +Matrix type: LT (4, 4) + +All elements are zero + +Matrix type: LT (4, 4) + +All elements are zero + +Matrix type: LT (4, 4) + +All elements are zero + +Matrix type: LT (4, 4) + +All elements are zero + +Matrix type: UT (4, 4) + +All elements are zero + +Matrix type: Diag (12, 12) + +All elements are zero + +Matrix type: Rect (10, 6) + +All elements are zero + +Matrix type: Rect (5, 9) + +All elements are zero + +Matrix type: Rect (3, 5) + +All elements are zero + +Matrix type: Diag (5, 5) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Rect (6, 0) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + + * Ninth test of Matrix package + * Matrix test program + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 3) + +All elements are zero + +Matrix type: Rect (7, 3) + +All elements are zero + +Matrix type: Rect (3, 7) + +All elements are zero + +Matrix type: Diag (7, 7) + +All elements are zero + +Matrix type: Diag (7, 7) + +All elements are zero + +Matrix type: Diag (7, 7) + +All elements are zero + +Matrix type: Rect (18, 1) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (22, 1) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (12, 1) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (4, 4) + +All elements are zero + +Matrix type: Rect (4, 4) + +All elements are zero + +Matrix type: Rect (50, 50) + +All elements are zero + +Matrix type: Rect (50, 50) + +All elements are zero + +Matrix type: Rect (50, 50) + +All elements are zero + +Matrix type: Rect (1, 4) + +All elements are zero + +Matrix type: Rect (51, 51) + +All elements are zero + +Matrix type: Rect (51, 51) + +All elements are zero + +Matrix type: Rect (51, 51) + +All elements are zero + +Matrix type: Rect (1, 4) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + + * Tenth test of Matrix package + * Matrix test program + +Matrix type: Rect (8, 6) + +All elements are zero + +Matrix type: Rect (8, 6) + +All elements are zero + +Matrix type: Rect (8, 8) + +All elements are zero + +Matrix type: Rect (8, 8) + +All elements are zero + +Matrix type: Rect (8, 8) + +All elements are zero + +Matrix type: Rect (8, 8) + +All elements are zero + +Matrix type: Rect (8, 8) + +All elements are zero + +Matrix type: Rect (8, 8) + +All elements are zero + +Matrix type: Rect (4, 2) + +All elements are zero + +Matrix type: Rect (4, 2) + +All elements are zero + +Matrix type: Rect (4, 2) + +All elements are zero + +Matrix type: UT (4, 4) + +All elements are zero + +Matrix type: Rect (4, 2) + +All elements are zero + +Matrix type: Rect (4, 4) + +All elements are zero + +Matrix type: Rect (4, 4) + +All elements are zero + + * Eleventh test of Matrix package + * Matrix test program + +Matrix type: Rect (1, 10) + +All elements are zero + +Matrix type: Rect (1, 10) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Rect (5, 10) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (3, 4) + +All elements are zero + +Matrix type: Rect (6, 4) + +All elements are zero + +Matrix type: Rect (7, 6) + +All elements are zero + +Matrix type: Rect (3, 4) + +All elements are zero + +Matrix type: Rect (2, 3) + +All elements are zero + + * Twelfth test of Matrix package + * Matrix test program + +Matrix type: Rect (15, 1) + +All elements are zero + +Matrix type: Rect (1, 15) + +All elements are zero + +Matrix type: Rect (1, 15) + +All elements are zero + +Matrix type: Rect (1, 15) + +All elements are zero + +Matrix type: Rect (1, 15) + +All elements are zero + +Matrix type: Rect (1, 15) + +All elements are zero + +Matrix type: Rect (1, 15) + +All elements are zero + +Matrix type: Rect (15, 1) + +All elements are zero + +Matrix type: Rect (3, 5) + +All elements are zero + +Matrix type: Rect (15, 1) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 5) + +All elements are zero + +Matrix type: Rect (7, 5) + +All elements are zero + +Matrix type: Rect (7, 5) + +All elements are zero + +Matrix type: UT (20, 20) + +All elements are zero + +Matrix type: UT (5, 5) + +All elements are zero + +Matrix type: UT (20, 20) + +All elements are zero + +Matrix type: UT (5, 5) + +All elements are zero + +Matrix type: Rect (8, 5) + +All elements are zero + +Matrix type: UT (20, 20) + +All elements are zero + +Matrix type: LT (20, 20) + +All elements are zero + +Matrix type: LT (5, 5) + +All elements are zero + +Matrix type: LT (20, 20) + +All elements are zero + +Matrix type: LT (5, 5) + +All elements are zero + +Matrix type: Rect (5, 8) + +All elements are zero + +Matrix type: LT (20, 20) + +All elements are zero + +Matrix type: Rect (20, 30) + +All elements are zero + +Matrix type: Rect (0, 0) + +All elements are zero + +Matrix type: Rect (20, 30) + +All elements are zero + +Matrix type: Rect (0, 0) + +All elements are zero + +Matrix type: Rect (20, 30) + +All elements are zero + +Matrix type: Rect (0, 0) + +All elements are zero + +Matrix type: Rect (20, 60) + +All elements are zero + +Matrix type: Rect (20, 1) + +All elements are zero + +Matrix type: Rect (1, 15) + +All elements are zero + +Matrix type: Rect (1, 15) + +All elements are zero + +Matrix type: Rect (20, 1) + +All elements are zero + +Matrix type: Rect (17, 1) + +All elements are zero + +Matrix type: Rect (1, 17) + +All elements are zero + +Matrix type: Rect (17, 1) + +All elements are zero + +Matrix type: Rect (1, 17) + +All elements are zero + +Matrix type: Rect (17, 1) + +All elements are zero + +Matrix type: Rect (1, 17) + +All elements are zero + +Matrix type: Rect (17, 1) + +All elements are zero + +Matrix type: Rect (1, 17) + +All elements are zero + +Matrix type: Rect (17, 1) + +All elements are zero + +Matrix type: Rect (1, 17) + +All elements are zero + +Matrix type: Rect (17, 1) + +All elements are zero + +Matrix type: Rect (1, 17) + +All elements are zero + +Matrix type: Rect (29, 1) + +All elements are zero + +Matrix type: Rect (1, 29) + +All elements are zero + +Matrix type: Rect (1, 10) + +All elements are zero + +Matrix type: Rect (0, 1) + +All elements are zero + +Matrix type: Rect (10, 1) + +All elements are zero + +Matrix type: Rect (1, 0) + +All elements are zero + +Matrix type: Rect (20, 5) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Rect (20, 5) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 5) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (100, 100) + +All elements are zero + +Matrix type: Rect (100, 100) + +All elements are zero + +Matrix type: Rect (15, 40) + +All elements are zero + +Matrix type: Rect (20, 1) + +All elements are zero + +Matrix type: Rect (1, 15) + +All elements are zero + +Matrix type: Rect (1, 15) + +All elements are zero + +Matrix type: Rect (20, 1) + +All elements are zero + +Matrix type: Rect (17, 1) + +All elements are zero + +Matrix type: Rect (1, 17) + +All elements are zero + +Matrix type: Rect (17, 1) + +All elements are zero + +Matrix type: Rect (1, 17) + +All elements are zero + +Matrix type: Rect (17, 1) + +All elements are zero + +Matrix type: Rect (1, 17) + +All elements are zero + +Matrix type: Rect (17, 1) + +All elements are zero + +Matrix type: Rect (1, 17) + +All elements are zero + +Matrix type: Rect (17, 1) + +All elements are zero + +Matrix type: Rect (1, 17) + +All elements are zero + +Matrix type: Rect (17, 1) + +All elements are zero + +Matrix type: Rect (1, 17) + +All elements are zero + +Matrix type: Rect (29, 1) + +All elements are zero + +Matrix type: Rect (1, 29) + +All elements are zero + +Matrix type: Rect (1, 10) + +All elements are zero + +Matrix type: Rect (0, 1) + +All elements are zero + +Matrix type: Rect (10, 1) + +All elements are zero + +Matrix type: Rect (1, 0) + +All elements are zero + +Matrix type: Rect (37, 23) + +All elements are zero + +Matrix type: Rect (33, 33) + +All elements are zero + +Matrix type: Rect (37, 23) + +All elements are zero + +Matrix type: Rect (30, 30) + +All elements are zero + +Matrix type: Rect (50, 50) + +All elements are zero + +Matrix type: Rect (50, 50) + +All elements are zero + +Matrix type: Rect (50, 50) + +All elements are zero + +Matrix type: Rect (10, 13) + +All elements are zero + +Matrix type: Rect (10, 13) + +All elements are zero + +Matrix type: Rect (10, 13) + +All elements are zero + +Matrix type: Rect (10, 13) + +All elements are zero + +Matrix type: Rect (10, 13) + +All elements are zero + +Matrix type: Rect (10, 13) + +All elements are zero + +Matrix type: Rect (10, 13) + +All elements are zero + +Matrix type: Rect (10, 13) + +All elements are zero + +Matrix type: Rect (10, 13) + +All elements are zero + +Matrix type: Rect (17, 17) + +All elements are zero + +Matrix type: Rect (19, 19) + +All elements are zero + +Matrix type: Rect (19, 19) + +All elements are zero + +Matrix type: Rect (19, 19) + +All elements are zero + +Matrix type: Rect (19, 19) + +All elements are zero + +Matrix type: Rect (19, 19) + +All elements are zero + +Matrix type: Rect (19, 19) + +All elements are zero + +Matrix type: UT (19, 19) + +All elements are zero + +Matrix type: UT (19, 19) + +All elements are zero + +Matrix type: Rect (19, 19) + +All elements are zero + +Matrix type: Sym (13, 13) + +All elements are zero + +Matrix type: Rect (13, 13) + +All elements are zero + +Matrix type: Rect (13, 13) + +All elements are zero + +Matrix type: Rect (13, 13) + +All elements are zero + +Matrix type: Rect (13, 13) + +All elements are zero + +Matrix type: Rect (13, 13) + +All elements are zero + +Matrix type: Rect (13, 13) + +All elements are zero + +Matrix type: Rect (13, 13) + +All elements are zero + +Matrix type: Rect (13, 13) + +All elements are zero + +Matrix type: Rect (13, 13) + +All elements are zero + +Matrix type: Rect (13, 13) + +All elements are zero + +Matrix type: Rect (13, 13) + +All elements are zero + +Matrix type: Rect (13, 13) + +All elements are zero + +Matrix type: Rect (13, 13) + +All elements are zero + +Matrix type: Rect (13, 13) + +All elements are zero + +Matrix type: Rect (13, 13) + +All elements are zero + +Matrix type: Rect (13, 13) + +All elements are zero + +Matrix type: Rect (13, 13) + +All elements are zero + +Matrix type: Rect (13, 13) + +All elements are zero + +Matrix type: Rect (13, 13) + +All elements are zero + +Matrix type: Rect (13, 13) + +All elements are zero + +Matrix type: Rect (13, 13) + +All elements are zero + + * Thirteenth test of Matrix package + * Matrix test program + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Rect (20, 5) + +All elements are zero + +Matrix type: Rect (20, 3) + +All elements are zero + +Matrix type: Rect (5, 3) + +All elements are zero + +Matrix type: Rect (3, 5) + +All elements are zero + +Matrix type: Rect (5, 1) + +All elements are zero + +Matrix type: Rect (1, 7) + +All elements are zero + +Matrix type: Rect (5, 1) + +All elements are zero + +Matrix type: Rect (40, 1) + +All elements are zero + +Matrix type: Rect (40, 1) + +All elements are zero + +Matrix type: Rect (40, 1) + +All elements are zero + +Matrix type: Rect (40, 40) + +All elements are zero + +Matrix type: Rect (40, 1) + +All elements are zero + +Matrix type: Rect (40, 1) + +All elements are zero + +Matrix type: Rect (40, 1) + +All elements are zero + +Matrix type: Rect (40, 1) + +All elements are zero + +Matrix type: Rect (40, 40) + +All elements are zero + +Matrix type: Rect (40, 40) + +All elements are zero + +Matrix type: Rect (40, 40) + +All elements are zero + +Matrix type: Rect (40, 40) + +All elements are zero + +Matrix type: Rect (40, 40) + +All elements are zero + +Matrix type: Rect (40, 40) + +All elements are zero + +Matrix type: Rect (4, 4) + +All elements are zero + +Matrix type: Rect (4, 4) + +All elements are zero + +Matrix type: Rect (50, 50) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (1, 30) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (1, 30) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 5) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 5) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 5) + +All elements are zero + +Matrix type: Rect (20, 5) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 5) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 5) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 5) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 5) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 5) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (21, 21) + +All elements are zero + +Matrix type: Rect (21, 21) + +All elements are zero + +Matrix type: Rect (21, 21) + +All elements are zero + + * Fourteenth test of Matrix package + * Matrix test program + +Matrix type: Rect (8, 5) + +All elements are zero + +Matrix type: Rect (8, 5) + +All elements are zero + +Matrix type: Diag (5, 5) + +All elements are zero + +Matrix type: Diag (5, 5) + +All elements are zero + +Matrix type: Diag (5, 5) + +All elements are zero + +Matrix type: Rect (8, 5) + +All elements are zero + +Matrix type: Diag (5, 5) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Diag (5, 5) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Rect (8, 5) + +All elements are zero + +Matrix type: Diag (5, 5) + +All elements are zero + +Matrix type: Rect (8, 5) + +All elements are zero + +Matrix type: Diag (5, 5) + +All elements are zero + +Matrix type: Diag (5, 5) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Diag (5, 5) + +All elements are zero + +Matrix type: Diag (5, 5) + +All elements are zero + +Matrix type: Diag (5, 5) + +All elements are zero + +Matrix type: Diag (5, 5) + +All elements are zero + +Matrix type: Diag (5, 5) + +All elements are zero + +Matrix type: Diag (8, 8) + +All elements are zero + +Matrix type: Rect (8, 8) + +All elements are zero + +Matrix type: Diag (8, 8) + +All elements are zero + +Matrix type: Diag (5, 5) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Diag (5, 5) + +All elements are zero + +Matrix type: Diag (8, 8) + +All elements are zero + +Matrix type: Rect (8, 8) + +All elements are zero + +Matrix type: Diag (8, 8) + +All elements are zero + +Matrix type: Diag (5, 5) + +All elements are zero + +Matrix type: Diag (5, 5) + +All elements are zero + +Matrix type: Diag (8, 8) + +All elements are zero + +Matrix type: Diag (8, 8) + +All elements are zero + +Matrix type: Diag (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (21, 20) + +All elements are zero + +Matrix type: Diag (20, 20) + +All elements are zero + +Matrix type: Diag (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Diag (20, 20) + +All elements are zero + +Matrix type: Diag (21, 21) + +All elements are zero + +Matrix type: Rect (21, 21) + +All elements are zero + +Matrix type: Diag (21, 21) + +All elements are zero + +Matrix type: Diag (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Diag (20, 20) + +All elements are zero + +Matrix type: Diag (21, 21) + +All elements are zero + +Matrix type: Rect (21, 21) + +All elements are zero + +Matrix type: Diag (21, 21) + +All elements are zero + +Matrix type: Diag (20, 20) + +All elements are zero + +Matrix type: Diag (20, 20) + +All elements are zero + +Matrix type: Diag (21, 21) + +All elements are zero + +Matrix type: Diag (21, 21) + +All elements are zero + +Matrix type: Diag (30, 30) + +All elements are zero + +Matrix type: Rect (30, 30) + +All elements are zero + +Matrix type: Rect (30, 30) + +All elements are zero + +Matrix type: Rect (30, 30) + +All elements are zero + +Matrix type: Rect (3, 1) + +All elements are zero + +Matrix type: Diag (2, 2) + +All elements are zero + +Matrix type: Rect (2, 2) + +All elements are zero + +Matrix type: Rect (2, 2) + +All elements are zero + +Matrix type: Rect (2, 2) + +All elements are zero + +Matrix type: Diag (2, 2) + +All elements are zero + +Matrix type: Diag (2, 2) + +All elements are zero + +Matrix type: Rect (2, 2) + +All elements are zero + +Matrix type: Rect (2, 2) + +All elements are zero + +Matrix type: Rect (2, 2) + +All elements are zero + +Matrix type: Diag (2, 2) + +All elements are zero + +Matrix type: Diag (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (22, 20) + +All elements are zero + +Matrix type: Diag (10, 10) + +All elements are zero + +Matrix type: Diag (10, 10) + +All elements are zero + +Matrix type: Diag (10, 10) + +All elements are zero + +Matrix type: Diag (10, 10) + +All elements are zero + +Matrix type: Rect (6, 1) + +All elements are zero + +Matrix type: Sym (10, 10) + +All elements are zero + +Matrix type: Diag (9, 9) + +All elements are zero + +Matrix type: Diag (9, 9) + +All elements are zero + +Matrix type: Diag (9, 9) + +All elements are zero + +Matrix type: Rect (6, 1) + +All elements are zero + +Matrix type: Diag (8, 8) + +All elements are zero + +Matrix type: Rect (8, 8) + +All elements are zero + +Matrix type: Diag (8, 8) + +All elements are zero + +Matrix type: Rect (8, 8) + +All elements are zero + +Matrix type: Rect (8, 8) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Diag (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (2, 2) + +All elements are zero + +Matrix type: Rect (2, 2) + +All elements are zero + +Matrix type: Rect (2, 2) + +All elements are zero + +Matrix type: Rect (2, 2) + +All elements are zero + + * Fifteenth test of Matrix package + * Matrix test program + +Matrix type: Rect (12, 1) + +All elements are zero + +Matrix type: Rect (12, 1) + +All elements are zero + +Matrix type: Rect (2048, 1) + +All elements are zero + +Matrix type: Rect (2048, 1) + +All elements are zero + +Matrix type: Rect (2000, 1) + +All elements are zero + +Matrix type: Rect (2000, 1) + +All elements are zero + +Matrix type: Rect (2187, 1) + +All elements are zero + +Matrix type: Rect (2187, 1) + +All elements are zero + +Matrix type: Rect (2310, 1) + +All elements are zero + +Matrix type: Rect (2310, 1) + +All elements are zero + +Matrix type: Rect (2401, 1) + +All elements are zero + +Matrix type: Rect (2401, 1) + +All elements are zero + +Matrix type: Rect (2197, 1) + +All elements are zero + +Matrix type: Rect (2197, 1) + +All elements are zero + +Matrix type: Rect (2021, 1) + +All elements are zero + +Matrix type: Rect (2021, 1) + +All elements are zero + +Matrix type: Rect (768, 1) + +All elements are zero + +Matrix type: Rect (768, 1) + +All elements are zero + +Matrix type: Rect (1280, 1) + +All elements are zero + +Matrix type: Rect (1280, 1) + +All elements are zero + +Matrix type: Rect (1792, 1) + +All elements are zero + +Matrix type: Rect (1792, 1) + +All elements are zero + +Matrix type: Rect (320, 1) + +All elements are zero + +Matrix type: Rect (320, 1) + +All elements are zero + +Matrix type: Rect (2, 1) + +All elements are zero + +Matrix type: Rect (2, 1) + +All elements are zero + +Matrix type: Rect (2, 1) + +All elements are zero + +Matrix type: Rect (50, 1) + +All elements are zero + +Matrix type: Rect (50, 1) + +All elements are zero + +Matrix type: Rect (98, 1) + +All elements are zero + +Matrix type: Rect (12, 1) + +All elements are zero + +Matrix type: Rect (12, 1) + +All elements are zero + +Matrix type: Rect (22, 1) + +All elements are zero + +Matrix type: Rect (51, 1) + +All elements are zero + +Matrix type: Rect (51, 1) + +All elements are zero + +Matrix type: Rect (100, 1) + +All elements are zero + +Matrix type: Rect (1025, 1) + +All elements are zero + +Matrix type: Rect (1025, 1) + +All elements are zero + +Matrix type: Rect (2048, 1) + +All elements are zero + +Matrix type: Rect (1001, 1) + +All elements are zero + +Matrix type: Rect (1001, 1) + +All elements are zero + +Matrix type: Rect (2000, 1) + +All elements are zero + +Matrix type: Rect (1226, 1) + +All elements are zero + +Matrix type: Rect (1226, 1) + +All elements are zero + +Matrix type: Rect (2450, 1) + +All elements are zero + +Matrix type: Rect (1, 1) + +All elements are zero + +Matrix type: Rect (1, 1) + +All elements are zero + +Matrix type: Rect (13, 1) + +All elements are zero + +Matrix type: Rect (13, 1) + +All elements are zero + +Matrix type: Rect (12, 1) + +All elements are zero + +Matrix type: Rect (12, 1) + +All elements are zero + +Matrix type: Rect (9, 1) + +All elements are zero + +Matrix type: Rect (9, 1) + +All elements are zero + +Matrix type: Rect (16, 1) + +All elements are zero + +Matrix type: Rect (16, 1) + +All elements are zero + +Matrix type: Rect (30, 1) + +All elements are zero + +Matrix type: Rect (30, 1) + +All elements are zero + +Matrix type: Rect (42, 1) + +All elements are zero + +Matrix type: Rect (42, 1) + +All elements are zero + +Matrix type: Rect (24, 1) + +All elements are zero + +Matrix type: Rect (24, 1) + +All elements are zero + +Matrix type: Rect (8, 1) + +All elements are zero + +Matrix type: Rect (8, 1) + +All elements are zero + +Matrix type: Rect (40, 1) + +All elements are zero + +Matrix type: Rect (40, 1) + +All elements are zero + +Matrix type: Rect (48, 1) + +All elements are zero + +Matrix type: Rect (48, 1) + +All elements are zero + +Matrix type: Rect (4, 1) + +All elements are zero + +Matrix type: Rect (4, 1) + +All elements are zero + +Matrix type: Rect (3, 1) + +All elements are zero + +Matrix type: Rect (3, 1) + +All elements are zero + +Matrix type: Rect (5, 1) + +All elements are zero + +Matrix type: Rect (5, 1) + +All elements are zero + +Matrix type: Rect (32, 1) + +All elements are zero + +Matrix type: Rect (32, 1) + +All elements are zero + +Matrix type: Rect (2, 1) + +All elements are zero + +Matrix type: Rect (2, 1) + +All elements are zero + +Matrix type: Rect (2, 1) + +All elements are zero + +Matrix type: Rect (2, 1) + +All elements are zero + +Matrix type: Rect (26, 1) + +All elements are zero + +Matrix type: Rect (26, 1) + +All elements are zero + +Matrix type: Rect (32, 1) + +All elements are zero + +Matrix type: Rect (32, 1) + +All elements are zero + +Matrix type: Rect (18, 1) + +All elements are zero + +Matrix type: Rect (18, 1) + +All elements are zero + +Matrix type: Rect (2, 1) + +All elements are zero + +Matrix type: Rect (2, 1) + +All elements are zero + +Matrix type: Rect (2, 1) + +All elements are zero + +Matrix type: Rect (2, 1) + +All elements are zero + +Matrix type: Rect (202, 1) + +All elements are zero + +Matrix type: Rect (202, 1) + +All elements are zero + +Matrix type: Rect (202, 1) + +All elements are zero + +Matrix type: Rect (202, 1) + +All elements are zero + +Matrix type: Rect (1000, 1) + +All elements are zero + +Matrix type: Rect (1000, 1) + +All elements are zero + +Matrix type: Rect (1000, 1) + +All elements are zero + +Matrix type: Rect (1000, 1) + +All elements are zero + +Matrix type: Rect (3, 1) + +All elements are zero + +Matrix type: Rect (3, 1) + +All elements are zero + +Matrix type: Rect (3, 1) + +All elements are zero + +Matrix type: Rect (3, 1) + +All elements are zero + +Matrix type: Rect (275, 1) + +All elements are zero + +Matrix type: Rect (275, 1) + +All elements are zero + +Matrix type: Rect (275, 1) + +All elements are zero + +Matrix type: Rect (275, 1) + +All elements are zero + +Matrix type: Rect (1001, 1) + +All elements are zero + +Matrix type: Rect (1001, 1) + +All elements are zero + +Matrix type: Rect (1001, 1) + +All elements are zero + +Matrix type: Rect (1001, 1) + +All elements are zero + +Matrix type: Rect (3, 1) + +All elements are zero + +Matrix type: Rect (3, 1) + +All elements are zero + +Matrix type: Rect (27, 1) + +All elements are zero + +Matrix type: Rect (27, 1) + +All elements are zero + +Matrix type: Rect (33, 1) + +All elements are zero + +Matrix type: Rect (33, 1) + +All elements are zero + +Matrix type: Rect (19, 1) + +All elements are zero + +Matrix type: Rect (19, 1) + +All elements are zero + +Matrix type: Rect (1, 16) + +All elements are zero + +Matrix type: Rect (1, 16) + +All elements are zero + +Matrix type: Rect (1, 16) + +All elements are zero + +Matrix type: Rect (1, 16) + +All elements are zero + +Matrix type: Rect (16, 1) + +All elements are zero + +Matrix type: Rect (16, 1) + +All elements are zero + +Matrix type: Rect (16, 1) + +All elements are zero + +Matrix type: Rect (16, 1) + +All elements are zero + +Matrix type: Rect (4, 3) + +All elements are zero + +Matrix type: Rect (4, 3) + +All elements are zero + +Matrix type: Rect (4, 3) + +All elements are zero + +Matrix type: Rect (4, 3) + +All elements are zero + +Matrix type: Rect (4, 4) + +All elements are zero + +Matrix type: Rect (4, 4) + +All elements are zero + +Matrix type: Rect (4, 4) + +All elements are zero + +Matrix type: Rect (4, 4) + +All elements are zero + +Matrix type: Rect (4, 5) + +All elements are zero + +Matrix type: Rect (4, 5) + +All elements are zero + +Matrix type: Rect (4, 5) + +All elements are zero + +Matrix type: Rect (4, 5) + +All elements are zero + +Matrix type: Rect (5, 3) + +All elements are zero + +Matrix type: Rect (5, 3) + +All elements are zero + +Matrix type: Rect (5, 3) + +All elements are zero + +Matrix type: Rect (5, 3) + +All elements are zero + +Matrix type: Rect (12, 1) + +All elements are zero + +Matrix type: Rect (12, 1) + +All elements are zero + +Matrix type: Rect (2048, 1) + +All elements are zero + +Matrix type: Rect (2048, 1) + +All elements are zero + +Matrix type: Rect (2000, 1) + +All elements are zero + +Matrix type: Rect (2000, 1) + +All elements are zero + +Matrix type: Rect (2187, 1) + +All elements are zero + +Matrix type: Rect (2187, 1) + +All elements are zero + +Matrix type: Rect (2310, 1) + +All elements are zero + +Matrix type: Rect (2310, 1) + +All elements are zero + +Matrix type: Rect (2401, 1) + +All elements are zero + +Matrix type: Rect (2401, 1) + +All elements are zero + +Matrix type: Rect (2197, 1) + +All elements are zero + +Matrix type: Rect (2197, 1) + +All elements are zero + +Matrix type: Rect (2021, 1) + +All elements are zero + +Matrix type: Rect (2021, 1) + +All elements are zero + +Matrix type: Rect (768, 1) + +All elements are zero + +Matrix type: Rect (768, 1) + +All elements are zero + +Matrix type: Rect (1280, 1) + +All elements are zero + +Matrix type: Rect (1280, 1) + +All elements are zero + +Matrix type: Rect (1792, 1) + +All elements are zero + +Matrix type: Rect (1792, 1) + +All elements are zero + +Matrix type: Rect (320, 1) + +All elements are zero + +Matrix type: Rect (320, 1) + +All elements are zero + +Matrix type: Rect (2, 1) + +All elements are zero + +Matrix type: Rect (2, 1) + +All elements are zero + +Matrix type: Rect (2, 1) + +All elements are zero + +Matrix type: Rect (50, 1) + +All elements are zero + +Matrix type: Rect (50, 1) + +All elements are zero + +Matrix type: Rect (98, 1) + +All elements are zero + +Matrix type: Rect (12, 1) + +All elements are zero + +Matrix type: Rect (12, 1) + +All elements are zero + +Matrix type: Rect (22, 1) + +All elements are zero + +Matrix type: Rect (51, 1) + +All elements are zero + +Matrix type: Rect (51, 1) + +All elements are zero + +Matrix type: Rect (100, 1) + +All elements are zero + +Matrix type: Rect (1025, 1) + +All elements are zero + +Matrix type: Rect (1025, 1) + +All elements are zero + +Matrix type: Rect (2048, 1) + +All elements are zero + +Matrix type: Rect (1001, 1) + +All elements are zero + +Matrix type: Rect (1001, 1) + +All elements are zero + +Matrix type: Rect (2000, 1) + +All elements are zero + +Matrix type: Rect (1226, 1) + +All elements are zero + +Matrix type: Rect (1226, 1) + +All elements are zero + +Matrix type: Rect (2450, 1) + +All elements are zero + +Matrix type: Rect (1, 1) + +All elements are zero + +Matrix type: Rect (1, 1) + +All elements are zero + +Matrix type: Rect (13, 1) + +All elements are zero + +Matrix type: Rect (13, 1) + +All elements are zero + +Matrix type: Rect (12, 1) + +All elements are zero + +Matrix type: Rect (12, 1) + +All elements are zero + +Matrix type: Rect (9, 1) + +All elements are zero + +Matrix type: Rect (9, 1) + +All elements are zero + +Matrix type: Rect (16, 1) + +All elements are zero + +Matrix type: Rect (16, 1) + +All elements are zero + +Matrix type: Rect (30, 1) + +All elements are zero + +Matrix type: Rect (30, 1) + +All elements are zero + +Matrix type: Rect (42, 1) + +All elements are zero + +Matrix type: Rect (42, 1) + +All elements are zero + +Matrix type: Rect (24, 1) + +All elements are zero + +Matrix type: Rect (24, 1) + +All elements are zero + +Matrix type: Rect (8, 1) + +All elements are zero + +Matrix type: Rect (8, 1) + +All elements are zero + +Matrix type: Rect (40, 1) + +All elements are zero + +Matrix type: Rect (40, 1) + +All elements are zero + +Matrix type: Rect (48, 1) + +All elements are zero + +Matrix type: Rect (48, 1) + +All elements are zero + +Matrix type: Rect (4, 1) + +All elements are zero + +Matrix type: Rect (4, 1) + +All elements are zero + +Matrix type: Rect (3, 1) + +All elements are zero + +Matrix type: Rect (3, 1) + +All elements are zero + +Matrix type: Rect (5, 1) + +All elements are zero + +Matrix type: Rect (5, 1) + +All elements are zero + +Matrix type: Rect (32, 1) + +All elements are zero + +Matrix type: Rect (32, 1) + +All elements are zero + +Matrix type: Rect (2, 1) + +All elements are zero + +Matrix type: Rect (2, 1) + +All elements are zero + +Matrix type: Rect (2, 1) + +All elements are zero + +Matrix type: Rect (2, 1) + +All elements are zero + +Matrix type: Rect (26, 1) + +All elements are zero + +Matrix type: Rect (26, 1) + +All elements are zero + +Matrix type: Rect (32, 1) + +All elements are zero + +Matrix type: Rect (32, 1) + +All elements are zero + +Matrix type: Rect (18, 1) + +All elements are zero + +Matrix type: Rect (18, 1) + +All elements are zero + +Matrix type: Rect (2, 1) + +All elements are zero + +Matrix type: Rect (2, 1) + +All elements are zero + +Matrix type: Rect (2, 1) + +All elements are zero + +Matrix type: Rect (2, 1) + +All elements are zero + +Matrix type: Rect (202, 1) + +All elements are zero + +Matrix type: Rect (202, 1) + +All elements are zero + +Matrix type: Rect (202, 1) + +All elements are zero + +Matrix type: Rect (202, 1) + +All elements are zero + +Matrix type: Rect (1000, 1) + +All elements are zero + +Matrix type: Rect (1000, 1) + +All elements are zero + +Matrix type: Rect (1000, 1) + +All elements are zero + +Matrix type: Rect (1000, 1) + +All elements are zero + +Matrix type: Rect (3, 1) + +All elements are zero + +Matrix type: Rect (3, 1) + +All elements are zero + +Matrix type: Rect (3, 1) + +All elements are zero + +Matrix type: Rect (3, 1) + +All elements are zero + +Matrix type: Rect (275, 1) + +All elements are zero + +Matrix type: Rect (275, 1) + +All elements are zero + +Matrix type: Rect (275, 1) + +All elements are zero + +Matrix type: Rect (275, 1) + +All elements are zero + +Matrix type: Rect (1001, 1) + +All elements are zero + +Matrix type: Rect (1001, 1) + +All elements are zero + +Matrix type: Rect (1001, 1) + +All elements are zero + +Matrix type: Rect (1001, 1) + +All elements are zero + +Matrix type: Rect (3, 1) + +All elements are zero + +Matrix type: Rect (3, 1) + +All elements are zero + +Matrix type: Rect (27, 1) + +All elements are zero + +Matrix type: Rect (27, 1) + +All elements are zero + +Matrix type: Rect (33, 1) + +All elements are zero + +Matrix type: Rect (33, 1) + +All elements are zero + +Matrix type: Rect (19, 1) + +All elements are zero + +Matrix type: Rect (19, 1) + +All elements are zero + + * Sixteenth test of Matrix package + * Matrix test program + +Matrix type: Rect (1, 7) + +All elements are zero + +Matrix type: Rect (1, 6) + +All elements are zero + +Matrix type: Rect (1, 6) + +All elements are zero + +Matrix type: Rect (1, 8) + +All elements are zero + +Matrix type: Rect (1, 3) + +All elements are zero + +Matrix type: Rect (1, 4) + +All elements are zero + +Matrix type: Rect (1, 4) + +All elements are zero + +Matrix type: Rect (1, 4) + +All elements are zero + +Matrix type: Rect (1, 3) + +All elements are zero + +Matrix type: Rect (1, 5) + +All elements are zero + +Matrix type: Rect (6, 1) + +All elements are zero + + * Seventeenth test of Matrix package + * Matrix test program + +Matrix type: Rect (8, 8) + +All elements are zero + +Matrix type: Rect (8, 8) + +All elements are zero + +Matrix type: Rect (8, 8) + +All elements are zero + +Matrix type: Rect (8, 8) + +All elements are zero + +Matrix type: Rect (8, 8) + +All elements are zero + +Matrix type: Rect (8, 8) + +All elements are zero + +Matrix type: Rect (1, 1) + +All elements are zero + +Matrix type: Rect (8, 8) + +All elements are zero + +Matrix type: Rect (8, 8) + +All elements are zero + +Matrix type: Rect (6, 1) + +All elements are zero + +Matrix type: Rect (1, 7) + +All elements are zero + +Matrix type: Rect (80, 1) + +All elements are zero + +Matrix type: Rect (80, 1) + +All elements are zero + +Matrix type: Rect (1, 1) + +All elements are zero + +Matrix type: Rect (80, 1) + +All elements are zero + +Matrix type: Rect (80, 1) + +All elements are zero + +Matrix type: Rect (1, 4) + +All elements are zero + +Matrix type: Rect (8, 8) + +All elements are zero + +Matrix type: Rect (8, 8) + +All elements are zero + +Matrix type: Rect (8, 8) + +All elements are zero + +Matrix type: Rect (8, 1) + +All elements are zero + +Matrix type: Rect (7, 1) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (7, 2) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (7, 2) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (7, 2) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (7, 2) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (7, 2) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (7, 2) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (7, 2) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (7, 2) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (7, 2) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (7, 2) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (7, 2) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (7, 2) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (7, 2) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (7, 2) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Rect (7, 2) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Rect (7, 2) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Rect (7, 2) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Rect (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Rect (7, 2) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Sym (20, 20) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (10, 10) + +All elements are zero + +Matrix type: Rect (6, 6) + +All elements are zero + +Matrix type: Rect (9, 2) + +All elements are zero + +Matrix type: Rect (1, 1) + +All elements are zero + +Matrix type: Rect (20, 30) + +All elements are zero + +Matrix type: UT (25, 25) + +All elements are zero + +Matrix type: LT (25, 25) + +All elements are zero + +Matrix type: Diag (25, 25) + +All elements are zero + +Matrix type: Sym (25, 25) + +All elements are zero + +Matrix type: Diag (25, 25) + +All elements are zero + +Matrix type: Rect (10, 1) + +All elements are zero + +Matrix type: Rect (1, 10) + +All elements are zero + +Matrix type: Rect (5, 5) + +All elements are zero + +Matrix type: Diag (4, 4) + +All elements are zero + +Matrix type: Rect (4, 4) + +All elements are zero + +Matrix type: Rect (1, 2) + +All elements are zero + +Matrix type: Rect (8, 9) + +All elements are zero + +Matrix type: Rect (8, 8) + +All elements are zero + +Matrix type: Rect (9, 8) + +All elements are zero + +Matrix type: Rect (8, 8) + +All elements are zero + +Matrix type: Rect (8, 8) + +All elements are zero + +Matrix type: Rect (8, 8) + +All elements are zero + +Matrix type: Rect (9, 9) + +All elements are zero + +Matrix type: Rect (9, 9) + +All elements are zero + +Matrix type: Rect (9, 9) + +All elements are zero + +Matrix type: Rect (8, 9) + +All elements are zero + +Matrix type: Rect (99, 1) + +All elements are zero + +Matrix type: Rect (24, 30) + +All elements are zero + +Matrix type: Rect (1, 30) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (14, 15) + +All elements are zero + + * Eighteenth test of Matrix package + * Matrix test program + +Matrix type: Rect (23, 1) + +All elements are zero + +Matrix type: Rect (10, 20) + +All elements are zero + + * Nineteenth test of Matrix package + * Matrix test program + +Matrix type: Rect (13, 7) + +All elements are zero + +Matrix type: Rect (13, 7) + +All elements are zero + +Matrix type: Rect (13, 7) + +All elements are zero + +Matrix type: Rect (13, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Diag (7, 7) + +All elements are zero + +Matrix type: Diag (7, 7) + +All elements are zero + +Matrix type: Diag (7, 7) + +All elements are zero + +Matrix type: Diag (7, 7) + +All elements are zero + +Matrix type: LT (7, 7) + +All elements are zero + +Matrix type: LT (7, 7) + +All elements are zero + +Matrix type: LT (7, 7) + +All elements are zero + +Matrix type: LT (7, 7) + +All elements are zero + +Matrix type: UT (25, 25) + +All elements are zero + +Matrix type: Rect (25, 25) + +All elements are zero + +Matrix type: Rect (25, 25) + +All elements are zero + +Matrix type: Rect (25, 25) + +All elements are zero + +Matrix type: Rect (25, 25) + +All elements are zero + +Matrix type: Rect (25, 25) + +All elements are zero + +Matrix type: Rect (25, 25) + +All elements are zero + +Matrix type: Rect (25, 25) + +All elements are zero + +Matrix type: Rect (25, 25) + +All elements are zero + +Matrix type: Rect (25, 25) + +All elements are zero + +Matrix type: Rect (25, 25) + +All elements are zero + +Matrix type: Rect (19, 19) + +All elements are zero + +Matrix type: Rect (19, 19) + +All elements are zero + +Matrix type: Rect (19, 19) + +All elements are zero + +Matrix type: Rect (19, 19) + +All elements are zero + +Matrix type: Rect (19, 19) + +All elements are zero + +Matrix type: Rect (19, 19) + +All elements are zero + +Matrix type: Rect (19, 19) + +All elements are zero + +Matrix type: Rect (19, 19) + +All elements are zero + +Matrix type: Rect (2, 1) + +All elements are zero + +Matrix type: Rect (19, 19) + +All elements are zero + +Matrix type: Rect (19, 19) + +All elements are zero + +Matrix type: Rect (19, 19) + +All elements are zero + +Matrix type: Rect (19, 19) + +All elements are zero + +Matrix type: Rect (19, 19) + +All elements are zero + +Matrix type: Rect (19, 19) + +All elements are zero + +Matrix type: Rect (19, 19) + +All elements are zero + +Matrix type: Rect (19, 19) + +All elements are zero + +Matrix type: Rect (2, 1) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + +Matrix type: Rect (7, 7) + +All elements are zero + + * Twentieth test of Matrix package + * Matrix test program +C subscripts not enabled, not tested + + + * Twenty first test of Matrix package + * Matrix test program + +Matrix type: Rect (1, 28) + +All elements are zero + + * Twenty second test of Matrix package + * Matrix test program + +Matrix type: Rect (8, 9) + +All elements are zero + +Matrix type: Diag (150, 150) + +All elements are zero + +Matrix type: UT (12, 12) + +All elements are zero + +Matrix type: Rect (12, 12) + +All elements are zero + +Matrix type: UT (12, 12) + +All elements are zero + +Matrix type: LT (12, 12) + +All elements are zero + +Matrix type: Rect (12, 12) + +All elements are zero + +Matrix type: UT (12, 12) + +All elements are zero + +Matrix type: LT (12, 12) + +All elements are zero + +Matrix type: Rect (24, 24) + +All elements are zero + +Matrix type: Rect (24, 24) + +All elements are zero + +Matrix type: Rect (24, 24) + +All elements are zero + +Matrix type: Rect (1, 4) + +All elements are zero + +Matrix type: UT (24, 24) + +All elements are zero + +Matrix type: LT (24, 24) + +All elements are zero + +Matrix type: Rect (12, 12) + +All elements are zero + +Matrix type: Rect (12, 12) + +All elements are zero + +Matrix type: Rect (12, 12) + +All elements are zero + +Matrix type: Rect (12, 12) + +All elements are zero + +Matrix type: Rect (12, 12) + +All elements are zero + +Matrix type: Rect (3, 3) + +All elements are zero + +Matrix type: Rect (1, 15) + +All elements are zero + +Matrix type: Rect (15, 1) + +All elements are zero + +Matrix type: Rect (15, 15) + +All elements are zero + +Matrix type: Rect (3, 12) + +All elements are zero + +Matrix type: Rect (2, 2) + +All elements are zero + +Matrix type: Rect (3, 3) + +All elements are zero + +Matrix type: Squ (5, 5) + +All elements are zero + +Matrix type: Squ (4, 4) + +All elements are zero + +Matrix type: Squ (4, 4) + +All elements are zero + +End of tests + +(The following memory checks are probably not valid with all +compilers - see documentation) + +Checking for lost memory (large block): 10501164 10501164 - ok + + +Checking for lost memory (small block): 10501164 10501164 - ok + +Number of matrices tested = 1604 +Number of non-zero matrices (should be 1) = 1 + +Elapsed (processor) time = 0.36 seconds + diff --git a/extern/newmat/tmt1.cpp b/extern/newmat/tmt1.cpp new file mode 100644 index 00000000..80d76ded --- /dev/null +++ b/extern/newmat/tmt1.cpp @@ -0,0 +1,292 @@ +/// \ingroup newmat +///@{ + +/// \file tmt1.cpp +/// Part of matrix library test program. + + +#define WANT_STREAM + + + +#include "include.h" + +#include "newmat.h" + +#include "tmt.h" + +#ifdef use_namespace +using namespace NEWMAT; +#endif + + +/**************************** test program ******************************/ + + +void trymat1() +{ +// cout << "\nFirst test of Matrix package\n\n"; + Tracer et("First test of Matrix package"); + Tracer::PrintTrace(); + { + Tracer et1("Stage 1"); + int i,j; + + LowerTriangularMatrix L(10); + for (i=1;i<=10;i++) for (j=1;j<=i;j++) L(i,j)=2.0+i*i+j; + SymmetricMatrix S(10); + for (i=1;i<=10;i++) for (j=1;j<=i;j++) S(i,j)=i*j+1.0; + SymmetricMatrix S1 = S / 2.0; + S = S1 * 2.0; + UpperTriangularMatrix U=L.t()*2.0; + Print(LowerTriangularMatrix(L-U.t()*0.5)); + DiagonalMatrix D(10); + for (i=1;i<=10;i++) D(i,i)=(i-4)*(i-5)*(i-6); + Matrix M=(S+U-D+L)*(L+U-D+S); + DiagonalMatrix DD=D*D; + LowerTriangularMatrix LD=L*D; + // expressions split for Turbo C + Matrix M1 = S*L + U*L - D*L + L*L + 10.0; + { M1 = M1 + S*U + U*U - D*U + L*U - S*D; } + { M1 = M1 - U*D + DD - LD + S*S; } + { M1 = M1 + U*S - D*S + L*S - 10.0; } + M=M1-M; + Print(M); + } + { + Tracer et1("Stage 2"); + int i,j; + + LowerTriangularMatrix L(9); + for (i=1;i<=9;i++) for (j=1;j<=i;j++) L(i,j)=1.0+j; + UpperTriangularMatrix U1(9); + for (j=1;j<=9;j++) for (i=1;i<=j;i++) U1(i,j)=1.0+i; + LowerTriangularMatrix LX(9); + for (i=1;i<=9;i++) for (j=1;j<=i;j++) LX(i,j)=1.0+i*i; + UpperTriangularMatrix UX(9); + for (j=1;j<=9;j++) for (i=1;i<=j;i++) UX(i,j)=1.0+j*j; + { + L=L+LX/0.5; L=L-LX*3.0; L=LX*2.0+L; + U1=U1+UX*2.0; U1=U1-UX*3.0; U1=UX*2.0+U1; + } + + + SymmetricMatrix S(9); + for (i=1;i<=9;i++) for (j=1;j<=i;j++) S(i,j)=i*i+j; + { + SymmetricMatrix S1 = S; + S=S1+5.0; + S=S-3.0; + } + + DiagonalMatrix D(9); + for (i=1;i<=9;i++) D(i,i)=S(i,i); + UpperTriangularMatrix U=L.t()*2.0; + { + U1=U1*2.0 - U; Print(U1); + L=L*2.0-D; U=U-D; + } + Matrix M=U+L; S=S*2.0; M=S-M; Print(M); + } + { + Tracer et1("Stage 3"); + int i,j; + Matrix M(10,3), N(10,3); + for (i = 1; i<=10; i++) for (j = 1; j<=3; j++) + { M(i,j) = 2*i-j; N(i,j) = i*j + 20; } + Matrix MN = M + N, M1; + + M1 = M; M1 += N; M1 -= MN; Print(M1); + M1 = M; M1 += M1; M1 = M1 - M * 2; Print(M1); + M1 = M; M1 += N * 2; M1 -= (MN + N); Print(M1); + M1 = M; M1 -= M1; Print(M1); + M1 = M; M1 -= MN + M1; M1 += N + M; Print(M1); + M1 = M; M1 -= 5; M1 -= M; M1 *= 0.2; M1 = M1 + 1; Print(M1); + Matrix NT = N.t(); + M1 = M; M1 *= NT; M1 -= M * N.t(); Print(M1); + M = M * M.t(); + DiagonalMatrix D(10); D = 2; + M1 = M; M1 += D; M1 -= M; M1 = M1 - D; Print(M1); + M1 = M; M1 -= D; M1 -= M; M1 = M1 + D; Print(M1); + M1 = M; M1 *= D; M1 /= 2; M1 -= M; Print(M1); + SymmetricMatrix SM; SM << M; + // UpperTriangularMatrix SM; SM << M; + SM += 10; M1 = SM - M; M1 /=10; M1 = M1 - 1; Print(M1); + } + { + Tracer et1("Stage 4"); + int i,j; + Matrix M(10,3), N(10,5); + for (i = 1; i<=10; i++) for (j = 1; j<=3; j++) M(i,j) = 2*i-j; + for (i = 1; i<=10; i++) for (j = 1; j<=5; j++) N(i,j) = i*j + 20; + Matrix M1; + M1 = M; M1 |= N; M1 &= N | M; + M1 -= (M | N) & (N | M); Print(M1); + M1 = M; M1 |= M1; M1 &= M1; + M1 -= (M | M) & (M | M); Print(M1); + + } + { + Tracer et1("Stage 5"); + int i,j; + BandMatrix BM1(10,2,3), BM2(10,4,1); Matrix M1(10,10), M2(10,10); + for (i=1;i<=10;i++) for (j=1;j<=10;j++) + { M1(i,j) = 0.5*i+j*j-50; M2(i,j) = (i*101 + j*103) % 13; } + BM1.Inject(M1); BM2.Inject(M2); + BandMatrix BM = BM1; BM += BM2; + Matrix M1X = BM1; Matrix M2X = BM2; Matrix MX = BM; + MX -= M1X + M2X; Print(MX); + MX = BM1; MX += BM2; MX -= M1X; MX -= M2X; Print(MX); + SymmetricBandMatrix SM1; SM1 << BM1 * BM1.t(); + SymmetricBandMatrix SM2; SM2 << BM2 * BM2.t(); + SM1 *= 5.5; + M1X *= M1X.t(); M1X *= 5.5; M2X *= M2X.t(); + SM1 -= SM2; M1 = SM1 - M1X + M2X; Print(M1); + M1 = BM1; BM1 *= SM1; M1 = M1 * SM1 - BM1; Print(M1); + M1 = BM1; BM1 -= SM1; M1 = M1 - SM1 - BM1; Print(M1); + M1 = BM1; BM1 += SM1; M1 = M1 + SM1 - BM1; Print(M1); + + } + { + Tracer et1("Stage 6"); + int i,j; + Matrix M(10,10), N(10,10); + for (i = 1; i<=10; i++) for (j = 1; j<=10; j++) + { M(i,j) = 2*i-j; N(i,j) = i*j + 20; } + GenericMatrix GM = M; + GM += N; Matrix M1 = GM - N - M; Print(M1); + DiagonalMatrix D(10); D = 3; + GM = D; GM += N; GM += M; GM += D; + M1 = D*2 - GM + M + N; Print(M1); + GM = D; GM *= 4; GM += 16; GM /= 8; GM -= 2; + GM -= D / 2; M1 = GM; Print(M1); + GM = D; GM *= M; GM *= N; GM /= 3; M1 = M*N - GM; Print(M1); + GM = D; GM |= M; GM &= N | D; M1 = GM - ((D | M) & (N | D)); + Print(M1); + GM = M; M1 = M; GM += 5; GM *= 3; M *= 3; M += 15; M1 = GM - M; + Print(M1); + D.ReSize(10); for (i = 1; i<=10; i++) D(i) = i; + M1 = D + 10; GM = D; GM += 10; M1 -= GM; Print(M1); + GM = M; GM -= D; M1 = GM; GM = D; GM -= M; M1 += GM; Print(M1); + GM = M; GM *= D; M1 = GM; GM = D; GM *= M.t(); + M1 -= GM.t(); Print(M1); + GM = M; GM += 2 * GM; GM -= 3 * M; M1 = GM; Print(M1); + GM = M; GM |= GM; GM -= (M | M); M1 = GM; Print(M1); + GM = M; GM &= GM; GM -= (M & M); M1 = GM; Print(M1); + M1 = M; M1 = (M1.t() & M.t()) - (M | M).t(); Print(M1); + M1 = M; M1 = (M1.t() | M.t()) - (M & M).t(); Print(M1); + + } + + { + Tracer et1("Stage 7"); + // test for bug in MS VC5 + int n = 3; + int k; int j; + Matrix A(n,n), B(n,n); + + //first version - MS VC++ 5 mis-compiles if optimisation is on + for (k=1; k<=n; k++) + { + for (j = 1; j <= n; j++) A(k,j) = ((k-1) * (2*j-1)); + } + + //second version + for (k=1; k<=n; k++) + { + const int k1 = k-1; // otherwise Visual C++ 5 fails + for (j = 1; j <= n; j++) B(k,j) = (k1 * (2*j-1)); + } + + if (A != B) + { + cout << "\nVisual C++ version 5 compiler error?"; + cout << "\nTurn off optimisation"; + } + + A -= B; Print(A); + + } + + { + Tracer et1("Stage 8"); + // Cross product + ColumnVector i(3); i << 1 << 0 << 0; + ColumnVector j(3); j << 0 << 1 << 0; + ColumnVector k(3); k << 0 << 0 << 1; + ColumnVector X; + X = CrossProduct(i,j) - k; Print(X); + X = CrossProduct(j,k) - i; Print(X); + X = CrossProduct(k,i) - j; Print(X); + X = CrossProduct(j,i) + k; Print(X); + X = CrossProduct(k,j) + i; Print(X); + X = CrossProduct(i,k) + j; Print(X); + X = CrossProduct(i,i); Print(X); + X = CrossProduct(j,j); Print(X); + X = CrossProduct(k,k); Print(X); + + ColumnVector A(3); A << 2.25 << 1.75 << -7.5; + ColumnVector B(3); B << -0.5 << 4.75 << 3.25; + ColumnVector C(3); C << 9.25 << 3.5 << 1.25; + + Real d0 = (A | B | C).Determinant(); // Vector triple product + Real d1 = DotProduct(CrossProduct(A, B), C); + Real d2 = DotProduct(CrossProduct(B, C), A); + Real d3 = DotProduct(CrossProduct(C, A), B); + X << (d1 - d0) << (d2 - d0) << (d3 - d0); + Clean(X, 0.000000001); Print(X); + + X = CrossProduct(A, CrossProduct(B, C)) + + CrossProduct(B, CrossProduct(C, A)) + + CrossProduct(C, CrossProduct(A, B)); + Print(X); + + RowVector XT = CrossProduct(A.AsRow(), B.AsRow()); + XT -= CrossProduct(A, B).AsRow(); + Print(XT); + } + + { + Tracer et1("Stage 9"); + // More cross product + int i, j; + Matrix M(10,3), N(10,3); + for (i = 1; i<=10; i++) for (j = 1; j<=3; j++) + { M(i,j) = 2*i-j; N(i,j) = i*j + 20; } + + Matrix CP1 = CrossProductRows(M, N); + Matrix CP2(10,3); + for (i = 1; i<=10; i++) + CP2.Row(i) = CrossProduct(M.Row(i), N.Row(i)); + CP2 -= CP1; Print(CP2); + + CP2 = CrossProductColumns(M.t(), N.t()); + CP2 -= CP1.t(); Print(CP2); + } + + { + Tracer et1("Stage 10"); + // Make sure RNG works + MultWithCarry mwc; + ColumnVector cv(10); + for (int i = 1; i <= 10; ++i) cv(i) = mwc.Next(); + cv *= 100.0; + cv(1) -= 6.27874; + cv(2) -= 42.1718; + cv(3) -= 80.2854; + cv(4) -= 12.961; + cv(5) -= 17.7499; + cv(6) -= 13.2657; + cv(7) -= 50.4923; + cv(8) -= 26.095; + cv(9) -= 57.9147; + cv(10) -= 30.1778; + Clean(cv, 0.0001); Print(cv); + } + + +// cout << "\nEnd of first test\n"; +} + + +///@} diff --git a/extern/newmat/tmt2.cpp b/extern/newmat/tmt2.cpp new file mode 100644 index 00000000..443aea74 --- /dev/null +++ b/extern/newmat/tmt2.cpp @@ -0,0 +1,314 @@ +/// \ingroup newmat +///@{ + +/// \file tmt2.cpp +/// Part of matrix library test program. + + +//#define WANT_STREAM + + +#include "include.h" + +#include "newmat.h" + +#include "tmt.h" + +#ifdef use_namespace +using namespace NEWMAT; +#endif + + +/**************************** test program ******************************/ + + +void trymat2() +{ +// cout << "\nSecond test of Matrix package\n\n"; + Tracer et("Second test of Matrix package"); + Tracer::PrintTrace(); + + int i,j; + + Matrix M(3,5); + for (i=1; i<=3; i++) for (j=1; j<=5; j++) M(i,j) = 100*i + j; + Matrix X(8,10); + for (i=1; i<=8; i++) for (j=1; j<=10; j++) X(i,j) = 1000*i + 10*j; + Matrix Y = X; Matrix Z = X; + { X.SubMatrix(2,4,3,7) << M; } + for (i=1; i<=3; i++) for (j=1; j<=5; j++) Y(i+1,j+2) = 100*i + j; + Print(Matrix(X-Y)); + + + Real a[15]; Real* r = a; + for (i=1; i<=3; i++) for (j=1; j<=5; j++) *r++ = 100*i + j; + { Z.SubMatrix(2,4,3,7) << a; } + Print(Matrix(Z-Y)); + + { M=33; X.SubMatrix(2,4,3,7) << M; } + { Z.SubMatrix(2,4,3,7) = 33; } + Print(Matrix(Z-X)); + + for (i=1; i<=8; i++) for (j=1; j<=10; j++) X(i,j) = 1000*i + 10*j; + Y = X; + UpperTriangularMatrix U(5); + for (i=1; i<=5; i++) for (j=i; j<=5; j++) U(i,j) = 100*i + j; + { X.SubMatrix(3,7,5,9) << U; } + for (i=1; i<=5; i++) for (j=i; j<=5; j++) Y(i+2,j+4) = 100*i + j; + for (i=1; i<=5; i++) for (j=1; jReSize(10,20); + for (i = 1; i <= 10; i++) for (j = 1; j <= 20; j++) + (*MX)(i,j) = 100 * i + j; + ColumnVector* CV = new ColumnVector(10); + if (!CV) Throw(Bad_alloc("New fails ")); + *CV << 1 << 2 << 3 << 4 << 5 << 6 << 7 << 8 << 9 << 10; + RowVector* RV = new RowVector(CV->t() | (*CV + 10).t()); + if (!RV) Throw(Bad_alloc("New fails ")); + CV1 = ColumnVector(10); CV1 = 1; RV1 = RowVector(20); RV1 = 1; + *MX -= 100 * *CV * RV1 + CV1 * *RV; + Print(*MX); + delete MX; delete CV; delete RV; + } + + + // test copying of vectors and matrices with no elements + { + ColumnVector dims(16); + Matrix M1; Matrix M2 = M1; Print(M2); + dims(1) = M2.Nrows(); dims(2) = M2.Ncols(); + dims(3) = (Real)(unsigned long)M2.Store(); dims(4) = M2.Storage(); + M2 = M1; + dims(5) = M2.Nrows(); dims(6) = M2.Ncols(); + dims(7) = (Real)(unsigned long)M2.Store(); dims(8) = M2.Storage(); + M2.ReSize(10,20); M2.CleanUp(); + dims(9) = M2.Nrows(); dims(10) = M2.Ncols(); + dims(11) = (Real)(unsigned long)M2.Store(); dims(12) = M2.Storage(); + M2.ReSize(20,10); M2.ReSize(0,0); + dims(13) = M2.Nrows(); dims(14) = M2.Ncols(); + dims(15) = (Real)(unsigned long)M2.Store(); dims(16) = M2.Storage(); + Print(dims); + } + + { + ColumnVector dims(16); + ColumnVector M1; ColumnVector M2 = M1; Print(M2); + dims(1) = M2.Nrows(); dims(2) = M2.Ncols()-1; + dims(3) = (Real)(unsigned long)M2.Store(); dims(4) = M2.Storage(); + M2 = M1; + dims(5) = M2.Nrows(); dims(6) = M2.Ncols()-1; + dims(7) = (Real)(unsigned long)M2.Store(); dims(8) = M2.Storage(); + M2.ReSize(10); M2.CleanUp(); + dims(9) = M2.Nrows(); dims(10) = M2.Ncols()-1; + dims(11) = (Real)(unsigned long)M2.Store(); dims(12) = M2.Storage(); + M2.ReSize(10); M2.ReSize(0); + dims(13) = M2.Nrows(); dims(14) = M2.Ncols()-1; + dims(15) = (Real)(unsigned long)M2.Store(); dims(16) = M2.Storage(); + Print(dims); + } + + { + ColumnVector dims(16); + RowVector M1; RowVector M2 = M1; Print(M2); + dims(1) = M2.Nrows()-1; dims(2) = M2.Ncols(); + dims(3) = (Real)(unsigned long)M2.Store(); dims(4) = M2.Storage(); + M2 = M1; + dims(5) = M2.Nrows()-1; dims(6) = M2.Ncols(); + dims(7) = (Real)(unsigned long)M2.Store(); dims(8) = M2.Storage(); + M2.ReSize(10); M2.CleanUp(); + dims(9) = M2.Nrows()-1; dims(10) = M2.Ncols(); + dims(11) = (Real)(unsigned long)M2.Store(); dims(12) = M2.Storage(); + M2.ReSize(10); M2.ReSize(0); + dims(13) = M2.Nrows()-1; dims(14) = M2.Ncols(); + dims(15) = (Real)(unsigned long)M2.Store(); dims(16) = M2.Storage(); + Print(dims); + } + + // test identity matrix + { + Matrix M; + IdentityMatrix I(10); DiagonalMatrix D(10); D = 1; + M = I; M -= D; Print(M); + D -= I; Print(D); + ColumnVector X(8); + D = 1; + X(1) = Sum(D) - Sum(I); + X(2) = SumAbsoluteValue(D) - SumAbsoluteValue(I); + X(3) = SumSquare(D) - SumSquare(I); + X(4) = Trace(D) - Trace(I); + X(5) = Maximum(D) - Maximum(I); + X(6) = Minimum(D) - Minimum(I); + X(7) = LogDeterminant(D).LogValue() - LogDeterminant(I).LogValue(); + X(8) = LogDeterminant(D).Sign() - LogDeterminant(I).Sign(); + Clean(X,0.00000001); Print(X); + + for (i = 1; i <= 10; i++) for (j = 1; j <= 10; j++) + M(i,j) = 100 * i + j; + Matrix N; + N = M * I - M; Print(N); + N = I * M - M; Print(N); + N = M * I.i() - M; Print(N); + N = I.i() * M - M; Print(N); + N = I.i(); N -= I; Print(N); + N = I.t(); N -= I; Print(N); + N = I.t(); N += (-I); Print(N); // <---------------- + D = I; N = D; D = 1; N -= D; Print(N); + N = I; D = 1; N -= D; Print(N); + N = M + 2 * IdentityMatrix(10); N -= (M + 2 * D); Print(N); + + I *= 4; + + D = 4; + + X.ReSize(14); + X(1) = Sum(D) - Sum(I); + X(2) = SumAbsoluteValue(D) - SumAbsoluteValue(I); + X(3) = SumSquare(D) - SumSquare(I); + X(4) = Trace(D) - Trace(I); + X(5) = Maximum(D) - Maximum(I); + X(6) = Minimum(D) - Minimum(I); + X(7) = LogDeterminant(D).LogValue() - LogDeterminant(I).LogValue(); // <-- + X(8) = LogDeterminant(D).Sign() - LogDeterminant(I).Sign(); + int i,j; + X(9) = I.Maximum1(i) - 4; X(10) = i-1; + X(11) = I.Maximum2(i,j) - 4; X(12) = i-10; X(13) = j-10; + X(14) = I.Nrows() - 10; + Clean(X,0.00000001); Print(X); + + + N = D.i(); + N += I / (-16); + Print(N); + N = M * I - 4 * M; Print(N); + N = I * M - 4 * M; Print(N); + N = M * I.i() - 0.25 * M; Print(N); + N = I.i() * M - 0.25 * M; Print(N); + N = I.i(); N -= I * 0.0625; Print(N); + N = I.i(); N = N - 0.0625 * I; Print(N); + N = I.t(); N -= I; Print(N); + D = I * 2; N = D; D = 1; N -= 8 * D; Print(N); + N = I * 2; N -= 8 * D; Print(N); + N = 0.5 * I + M; N -= M; N -= 2.0 * D; Print(N); + + IdentityMatrix J(10); J = 8; + D = 4; + DiagonalMatrix E(10); E = 8; + N = (I + J) - (D + E); Print(N); + N = (5*I + 3*J) - (5*D + 3*E); Print(N); + N = (-I + J) - (-D + E); Print(N); + N = (I - J) - (D - E); Print(N); + N = (I | J) - (D | E); Print(N); + N = (I & J) - (D & E); Print(N); + N = SP(I,J) - SP(D,E); Print(N); + N = D.SubMatrix(2,5,3,8) - I.SubMatrix(2,5,3,8); Print(N); + + N = M; N.Inject(I); D << M; N -= (M + I); N += D; Print(N); + D = 4; + + IdentityMatrix K = I.i()*7 - J.t()/4; + N = D.i() * 7 - E / 4 - K; Print(N); + K = I * J; N = K - D * E; Print(N); + N = I * J; N -= D * E; Print(N); + K = 5*I - 3*J; + N = K - (5*D - 3*E); Print(N); + K = I.i(); N = K - 0.0625 * I; Print(N); + K = I.t(); N = K - I; Print(N); + + + K.ReSize(20); D.ReSize(20); D = 1; + D -= K; Print(D); + + I.ReSize(3); J.ReSize(3); K = I * J; N = K - I; Print(N); + K << D; N = K - D; Print(N); + } + + // test add integer + { + Matrix X(2,3); + X << 5.25 << 7.75 << 1.25 + << 9.00 << 1.00 << 2.50; + Matrix Y = X; + X = 10 + X; + X += (-10); + X -= Y; + Print(X); + + // also test f suffix + X << 5.25f << 7.75f << 1.25f + << 9.00f << 1.00f << 2.50f; + X -= Y; Print(X); + + } + + + + +// cout << "\nEnd of second test\n"; +} + + +///@} diff --git a/extern/newmat/tmt3.cpp b/extern/newmat/tmt3.cpp new file mode 100644 index 00000000..4062f0bf --- /dev/null +++ b/extern/newmat/tmt3.cpp @@ -0,0 +1,168 @@ +/// \ingroup newmat +///@{ + +/// \file tmt3.cpp +/// Part of matrix library test program. + + +//#define WANT_STREAM + +#include "include.h" + +#include "newmat.h" + +#include "tmt.h" + +#ifdef use_namespace +using namespace NEWMAT; +#endif + + +/**************************** test program ******************************/ + +void trymat3() +{ + Tracer et("Third test of Matrix package"); + Tracer::PrintTrace(); + + { + Tracer et1("Stage 1"); + int i,j; + SymmetricMatrix S(7); + for (i=1;i<=7;i++) for (j=1;j<=i;j++) S(i,j)=i*i+j; + S=-S+2.0; + + DiagonalMatrix D(7); + for (i=1;i<=7;i++) D(i,i)=S(i,i); + + Matrix M4(7,7); { M4=D+(D+4.0); M4=M4-D*2.0; M4=M4-4.0; Print(M4); } + SymmetricMatrix S2=D; Matrix M2=S2; { M2=-D+M2; Print(M2); } + UpperTriangularMatrix U2=D; { M2=U2; M2=D-M2; Print(M2); } + LowerTriangularMatrix L2=D; { M2=L2; M2=D-M2; Print(M2); } + M2=D; M2=M2-D; Print(M2); + for (i=1;i<=7;i++) for (j=1;j<=i;j++) L2(i,j)=2.0-i*i-j; + U2=L2.t(); D=D.t(); S=S.t(); + M4=(L2-1.0)+(U2+1.0)-D-S; Print(M4); + M4=(-L2+1.0)+(-U2-1.0)+D+S; Print(M4); + } + + { + Tracer et1("Stage 2"); + int i,j; + DiagonalMatrix D(6); + for (i=1;i<=6;i++) D(i,i)=i*3.0+i*i+2.0; + UpperTriangularMatrix U2(7); LowerTriangularMatrix L2(7); + for (i=1;i<=7;i++) for (j=1;j<=i;j++) L2(i,j)=2.0-i*i+j; + { U2=L2.t(); } + DiagonalMatrix D1(7); for (i=1;i<=7;i++) D1(i,i)=(i-2)*(i-4); + Matrix M2(6,7); + for (i=1;i<=6;i++) for (j=1;j<=7;j++) M2(i,j)=2.0+i*j+i*i+2.0*j*j; + Matrix MD=D; SymmetricMatrix MD1(1); MD1=D1; + Matrix MX=MD*M2*MD1 - D*(M2*D1); Print(MX); + MX=MD*M2*MD1 - (D*M2)*D1; Print(MX); + { + D.ReSize(7); for (i=1;i<=7;i++) D(i,i)=i*3.0+i*i+2.0; + LowerTriangularMatrix LD(1); LD=D; + UpperTriangularMatrix UD(1); UD=D; + M2=U2; M2=LD*M2*MD1 - D*(U2*D1); Print(M2); + M2=U2; M2=UD*M2*MD1 - (D*U2)*D1; Print(M2); + M2=L2; M2=LD*M2*MD1 - D*(L2*D1); Print(M2); + M2=L2; M2=UD*M2*MD1 - (D*L2)*D1; Print(M2); + } + } + + { + Tracer et1("Stage 3"); + // test inverse * scalar + DiagonalMatrix D(6); + for (int i=1;i<=6;i++) D(i)=i*i; + DiagonalMatrix E = D.i() * 4.0; + DiagonalMatrix I(6); I = 1.0; + E=D*E-I*4.0; Print(E); + E = D.i() / 0.25; E=D*E-I*4.0; Print(E); + } + { + Tracer et1("Stage 4"); + Matrix sigma(3,3); Matrix sigmaI(3,3); + sigma = 0; sigma(1,1) = 1.0; sigma(2,2) = 1.0; sigma(3,3) = 1.0; + sigmaI = sigma.i(); + sigmaI -= sigma; Clean(sigmaI, 0.000000001); Print(sigmaI); + } + { + Tracer et1("Stage 5"); + Matrix X(5,5); DiagonalMatrix DM(5); + for (int i=1; i<=5; i++) for (int j=1; j<=5; j++) + X(i,j) = (23*i+59*j) % 43; + DM << 1 << 8 << -7 << 2 << 3; + Matrix Y = X.i() * DM; Y = X * Y - DM; + Clean(Y, 0.000000001); Print(Y); + } + { + Tracer et1("Stage 6"); // test reverse function + ColumnVector CV(10), RCV(10); + CV << 2 << 7 << 1 << 6 << -3 << 1 << 8 << -4 << 0 << 17; + RCV << 17 << 0 << -4 << 8 << 1 << -3 << 6 << 1 << 7 << 2; + ColumnVector X = CV - RCV.Reverse(); Print(X); + RowVector Y = CV.t() - RCV.t().Reverse(); Print(Y); + DiagonalMatrix D = CV.AsDiagonal() - RCV.AsDiagonal().Reverse(); + Print(D); + X = CV & CV.Rows(1,9).Reverse(); + ColumnVector Z(19); + Z.Rows(1,10) = RCV.Reverse(); Z.Rows(11,19) = RCV.Rows(2,10); + X -= Z; Print(X); Z -= Z.Reverse(); Print(Z); + Matrix A(3,3); A << 1 << 2 << 3 << 4 << 5 << 6 << 7 << 8 << 9; + Matrix B(3,3); B << 9 << 8 << 7 << 6 << 5 << 4 << 3 << 2 << 1; + Matrix Diff = A - B.Reverse(); Print(Diff); + Diff = (-A).Reverse() + B; Print(Diff); + UpperTriangularMatrix U; + U << A.Reverse(); Diff = U; U << B; Diff -= U; Print(Diff); + U << (-A).Reverse(); Diff = U; U << B; Diff += U; Print(Diff); + } + { + Tracer et1("Stage 7"); // test IsSingular function + ColumnVector XX(4); + Matrix A(3,3); + A = 0; + CroutMatrix B1 = A; + XX(1) = B1.IsSingular() ? 0 : 1; + A << 1 << 3 << 6 + << 7 << 11 << 13 + << 2 << 4 << 1; + CroutMatrix B2(A); + XX(2) = B2.IsSingular() ? 1 : 0; + BandMatrix C(3,1,1); C.Inject(A); + BandLUMatrix B3(C); + XX(3) = B3.IsSingular() ? 1 : 0; + C = 0; + BandLUMatrix B4(C); + XX(4) = B4.IsSingular() ? 0 : 1; + Print(XX); + } + { + Tracer et1("Stage 8"); // inverse with vector of 0s + Matrix A(3,3); Matrix Z(3,3); ColumnVector X(6); + A << 1 << 3 << 6 + << 7 << 11 << 13 + << 2 << 4 << 1; + Z = 0; + Matrix B = (A | Z) & (Z | A); // 6 * 6 matrix + X = 0.0; + X = B.i() * X; + Print(X); + // also check inverse with non-zero Y + Matrix Y(3,3); + Y << 0.0 << 1.0 << 1.0 + << 5.0 << 0.0 << 5.0 + << 3.0 << 3.0 << 0.0; + Matrix YY = Y & Y; // stack Y matrices + YY = B.i() * YY; + Matrix Y1 = A.i() * Y; + YY -= Y1 & Y1; Clean(YY, 0.000000001); Print(YY); + Y1 = A * Y1 - Y; Clean(Y1, 0.000000001); Print(Y1); + } + + +} + + +///@} diff --git a/extern/newmat/tmt4.cpp b/extern/newmat/tmt4.cpp new file mode 100644 index 00000000..d2ed96bf --- /dev/null +++ b/extern/newmat/tmt4.cpp @@ -0,0 +1,253 @@ +/// \ingroup newmat +///@{ + +/// \file tmt4.cpp +/// Part of matrix library test program. + + +//#define WANT_STREAM + + +#include "include.h" + +#include "newmat.h" + +#include "tmt.h" + +#ifdef use_namespace +using namespace NEWMAT; +#endif + + +/**************************** test program ******************************/ + + +void trymat4() +{ +// cout << "\nFourth test of Matrix package\n"; + Tracer et("Fourth test of Matrix package"); + Tracer::PrintTrace(); + + + { + Tracer et1("Stage 1"); + int i, j; + Matrix M(10,10); + UpperTriangularMatrix U(10); + for (i=1;i<=10;i++) for (j=1;j<=10;j++) M(i,j) = 100*i+j; + U << -M; + Matrix X1 = M.Rows(2,4); + Matrix Y1 = U.t().Rows(2,4); + Matrix X = U; { Print(Matrix(X.Columns(2,4).t()-Y1)); } + RowVector RV = M.Row(5); + { + X.ReSize(3,10); + X.Row(1) << M.Row(2); X.Row(2) << M.Row(3); X.Row(3) << M.Row(4); + Print(Matrix(X-X1)); + } + { + UpperTriangularMatrix V = U.SymSubMatrix(3,5); + Matrix MV = U.SubMatrix(3,5,3,5); { Print(Matrix(MV-V)); } + Matrix X2 = M.t().Columns(2,4); { Print(Matrix(X2-X1.t())); } + Matrix Y2 = U.Columns(2,4); { Print(Matrix(Y2-Y1.t())); } + ColumnVector CV = M.t().Column(5); { Print(ColumnVector(CV-RV.t())); } + X.ReSize(10,3); M = M.t(); + X.Column(1) << M.Column(2); X.Column(2) << M.Column(3); + X.Column(3) << M.Column(4); + Print(Matrix(X-X2)); + } + } + + { + Tracer et1("Stage 2"); + int i, j; + Matrix M; Matrix X; M.ReSize(5,8); + for (i=1;i<=5;i++) for (j=1;j<=8;j++) M(i,j) = 100*i+j; + { + X = M.Columns(5,8); M.Columns(5,8) << M.Columns(1,4); + M.Columns(1,4) << X; + X = M.Columns(3,4); M.Columns(3,4) << M.Columns(1,2); + M.Columns(1,2) << X; + X = M.Columns(7,8); M.Columns(7,8) << M.Columns(5,6); + M.Columns(5,6) << X; + } + { + X = M.Column(2); M.Column(2) = M.Column(1); M.Column(1) = X; + X = M.Column(4); M.Column(4) = M.Column(3); M.Column(3) = X; + X = M.Column(6); M.Column(6) = M.Column(5); M.Column(5) = X; + X = M.Column(8); M.Column(8) = M.Column(7); M.Column(7) = X; + X.ReSize(5,8); + } + for (i=1;i<=5;i++) for (j=1;j<=8;j++) X(i,9-j) = 100*i+j; + Print(Matrix(X-M)); + } + { + Tracer et1("Stage 3"); + // try submatrices of zero dimension + int i, j; + Matrix A(4,5); Matrix B, C; + for (i=1; i<=4; i++) for (j=1; j<=5; j++) + A(i,j) = 100+i*10+j; + B = A + 100; + C = A | B.Columns(4,3); Print(Matrix(A - C)); + C = A | B.Columns(1,0); Print(Matrix(A - C)); + C = A | B.Columns(6,5); Print(Matrix(A - C)); + C = A & B.Rows(2,1); Print(Matrix(A - C)); + } + { + Tracer et1("Stage 4"); + BandMatrix BM(5,3,2); + BM(1,1) = 1; BM(1,2) = 2; BM(1,3) = 3; + BM(2,1) = 4; BM(2,2) = 5; BM(2,3) = 6; BM(2,4) = 7; + BM(3,1) = 8; BM(3,2) = 9; BM(3,3) =10; BM(3,4) =11; BM(3,5) =12; + BM(4,1) =13; BM(4,2) =14; BM(4,3) =15; BM(4,4) =16; BM(4,5) =17; + BM(5,2) =18; BM(5,3) =19; BM(5,4) =20; BM(5,5) =21; + SymmetricBandMatrix SM(5,3); + SM.Inject(BandMatrix(BM + BM.t())); + Matrix A = BM + 1; + Matrix M = A + A.t() - 2; + Matrix C = A.i() * BM; + C = A * C - BM; Clean(C, 0.000000001); Print(C); + C = A.i() * SM; + C = A * C - M; Clean(C, 0.000000001); Print(C); + + // check row-wise load + BandMatrix BM1(5,3,2); + BM1.Row(1) << 1 << 2 << 3; + BM1.Row(2) << 4 << 5 << 6 << 7; + BM1.Row(3) << 8 << 9 << 10 << 11 << 12; + BM1.Row(4) << 13 << 14 << 15 << 16 << 17; + BM1.Row(5) << 18 << 19 << 20 << 21; + Matrix M1 = BM1 - BM; Print(M1); + } + { + Tracer et1("Stage 5"); + Matrix X(4,4); + X << 1 << 2 << 3 << 4 + << 5 << 6 << 7 << 8 + << 9 <<10 <<11 <<12 + <<13 <<14 <<15 <<16; + Matrix Y(4,0); + Y = X | Y; + X -= Y; Print(X); + + DiagonalMatrix D(1); + D << 23; // matrix input with just one value + D(1) -= 23; Print(D); + + } + { + Tracer et1("Stage 6"); + Matrix h (2,2); + h << 1.0 << 2.0 << 0.0 << 1.0 ; + RowVector c(2); + c << 0.0 << 1.0; + h -= c & c; + h -= c.t().Reverse() | c.Reverse().t(); + Print(h); + } + { + Tracer et1("Stage 7"); + // Check row-wise input for diagonal matrix + DiagonalMatrix D(4); + D << 18 << 23 << 31 << 17; + DiagonalMatrix D1(4); + D1.Row(1) << 18; D1.Row(2) << 23; D1.Row(3) << 31; D1.Row(4) << 17; + D1 -= D; Print(D1); + D1(1) = 18; D1(2) = 23; D1(3) = 31; D1(4) = 17; + D1 -= D; Print(D1); + } + + { + Tracer et1("Stage 8"); + // test swap functions + MultWithCarry MWC; + Matrix A(3,4); Matrix B(5,6); + FillWithValues(MWC, A); FillWithValues(MWC, B); + Matrix A1 = A; Matrix B1 = B; A.Release(); B.Release(2); + swap(A, B); + int a = A.size() - B1.size(), b = B.size() - A1.size(); + Matrix D = A - B1; Print(D); + D = B - A1; Print(D); + Print(B); // should be zero because of release + D = A - B1; Print(D); + Print(A); // now should be zero + D.ReSize(1,2); D(1,1) = a; D(1,2) = b; Print(D); + + A.ReSize(20,20); FillWithValues(MWC, A); + + UpperTriangularMatrix UA; UA << A; UpperTriangularMatrix UA1 = UA; + UpperTriangularMatrix UB; + swap(UA, UB); Print(UA); UB -= UA1; Print(UB); + + LowerTriangularMatrix LA; LA << A; LowerTriangularMatrix LA1 = LA; + LowerTriangularMatrix LB; + swap(LB, LA); Print(LA); LB -= LA1; Print(LB); + + SymmetricMatrix SA; SA << A; SymmetricMatrix SA1 = SA; + SymmetricMatrix SB; + swap(SA, SB); Print(SA); SB -= SA1; Print(SB); + + DiagonalMatrix DA; DA << A; DiagonalMatrix DA1 = DA; + DiagonalMatrix DB; + swap(DB, DA); Print(DA); DB -= DA1; Print(DB); + + RowVector RVA = A.Row(1); RowVector RVA1 = RVA; + RowVector RVB; + swap(RVB, RVA); Print(RVA); RVB -= RVA1; Print(RVB); + + ColumnVector CVA = A.Column(1); ColumnVector CVA1 = CVA; + ColumnVector CVB; + swap(CVA, CVB); Print(CVA); CVB -= CVA1; Print(CVB); + + BandMatrix BA(20, 7, 4); BA.Inject(A); BandMatrix BA1 = BA; + BandMatrix BB; + swap(BA, BB); D = BA; Print(D); BB -= BA1; D = BB; Print(D); + + LowerBandMatrix LBA(20, 6); LBA.Inject(A); LowerBandMatrix LBA1 = LBA; + LowerBandMatrix LBB; + swap(LBB, LBA); D = LBA; Print(D); LBB -= LBA1; D = LBB; Print(D); + + UpperBandMatrix UBA(20, 9); UBA.Inject(A); UpperBandMatrix UBA1 = UBA; + UpperBandMatrix UBB; + swap(UBA, UBB); D = UBA; Print(D); UBB -= UBA1; D = UBB; Print(D); + + SymmetricBandMatrix SBA(20, 4); SBA.Inject(A); + SymmetricBandMatrix SBA1 = SBA; + SymmetricBandMatrix SBB; + + swap(SBB, SBA); D = SBA; Print(D); + SBB -= SBA1; D = SBB; Print(D); + + B.ReSize(10,10); FillWithValues(MWC, B); + + CroutMatrix CA = A; IdentityMatrix IA(20); + CroutMatrix CB = B; IdentityMatrix IB(10); + swap(CA, CB); swap(IA, IB); + D = CA.i() * B - IA; Clean(D,0.00000001); Print(D); + D = CB.i() * A - IB; Clean(D,0.00000001); Print(D); + + BA.ReSize(20, 5, 7); BA.Inject(A); BandLUMatrix BLUA = BA; + BB.ReSize(10, 3, 4); BB.Inject(B); BandLUMatrix BLUB = BB; + swap(BLUA, BLUB); + D = BLUA.i() * BB - IA; Clean(D,0.00000001); Print(D); + D = BLUB.i() * BA - IB; Clean(D,0.00000001); Print(D); + + + SBA.ReSize(20, 5); SBA.Inject(A); BandLUMatrix SBLUA = SBA; + SBB.ReSize(10, 3); SBB.Inject(B); BandLUMatrix SBLUB = SBB; + swap(SBLUA, SBLUB); + D = SBLUA.i() * SBB - IA; Clean(D,0.00000001); Print(D); + D = SBLUB.i() * SBA - IB; Clean(D,0.00000001); Print(D); + + UA << A; + GenericMatrix GUA = UA; GenericMatrix GB = B; swap(GUA, GB); + D = GB - UA; Print(D); D = B - GUA; Print(D); + + } + +// cout << "\nEnd of fourth test\n"; +} + + +///@} diff --git a/extern/newmat/tmt5.cpp b/extern/newmat/tmt5.cpp new file mode 100644 index 00000000..d698d90e --- /dev/null +++ b/extern/newmat/tmt5.cpp @@ -0,0 +1,135 @@ +/// \ingroup newmat +///@{ + +/// \file tmt5.cpp +/// Part of matrix library test program. + + +//#define WANT_STREAM + +#include "include.h" + +#include "newmat.h" + +#include "tmt.h" + +#ifdef use_namespace +using namespace NEWMAT; +#endif + + +// **************************** test program ****************************** + + + +ReturnMatrix Returner0(const GenericMatrix& GM) +{ Matrix M = GM; M.Release(); return M; } + +ReturnMatrix Returner1(const GenericMatrix& GM) +{ Matrix M = GM+1; M.Release(); return M; } + +ReturnMatrix Returner2(const GenericMatrix& GM) +{ UpperBandMatrix M = GM*2; M.Release(); return M; } + +ReturnMatrix Returner3(const GenericMatrix& GM) +{ LowerBandMatrix M = GM*3; M.Release(); return M; } + +ReturnMatrix Returner4(const GenericMatrix& GM) +{ SymmetricMatrix M = GM+4; M.Release(); return M; } + +ReturnMatrix Returner5(const GenericMatrix& GM) +{ SymmetricBandMatrix M = GM*5; M.Release(); return M; } + +ReturnMatrix Returner6(const GenericMatrix& GM) +{ BandMatrix M = GM*6; M.Release(); return M; } + +ReturnMatrix Returner7(const GenericMatrix& GM) +{ DiagonalMatrix M = GM*7; M.Release(); return M; } + +void trymat5() +{ +// cout << "\nFifth test of Matrix package\n"; + Tracer et("Fifth test of Matrix package"); + Tracer::PrintTrace(); + + int i,j; + + Matrix A(5,6); + for (i=1;i<=5;i++) for (j=1;j<=6;j++) A(i,j)=1+i*j+i*i+j*j; + ColumnVector CV(6); + for (i=1;i<=6;i++) CV(i)=i*i+3; + ColumnVector CV2(5); for (i=1;i<=5;i++) CV2(i)=1.0; + ColumnVector CV1=CV; + + { + CV=A*CV; + RowVector RV=CV.t(); // RowVector RV; RV=CV.t(); + RV=RV-1.0; + CV=(RV*A).t()+A.t()*CV2; CV1=(A.t()*A)*CV1 - CV; + Print(CV1); + } + + CV1.ReSize(6); + CV2.ReSize(6); + CV.ReSize(6); + for (i=1;i<=6;i++) { CV1(i)=i*3+1; CV2(i)=10-i; CV(i)=11+i*2; } + ColumnVector CX=CV2-CV; { CX=CX+CV1; Print(CX); } + Print(ColumnVector(CV1+CV2-CV)); + RowVector RV=CV.t(); RowVector RV1=CV1.t(); + RowVector R=RV-RV1; Print(RowVector(R-CV2.t())); + +// test loading of list + + RV.ReSize(10); + for (i=1;i<=10;i++) RV(i) = i*i; + RV1.ReSize(10); + RV1 << 1 << 4 << 9 << 16 << 25 << 36 << 49 << 64 << 81 << 100; // << 121; + Print(RowVector(RV-RV1)); + + et.ReName("Fifth test of Matrix package - almost at end"); + + Matrix X(2,3); + X << 11 << 12 << 13 + << 21 << 22 << 23; + + Matrix Y = X.t(); // check simple transpose + + X(1,1) -= 11; X(1,2) -= 12; X(1,3) -= 13; + X(2,1) -= 21; X(2,2) -= 22; X(2,3) -= 23; + Print(X); + + Y(1,1) -= 11; Y(2,1) -= 12; Y(3,1) -= 13; + Y(1,2) -= 21; Y(2,2) -= 22; Y(3,2) -= 23; + Print(Y); + + et.ReName("Fifth test of Matrix package - at end"); + + RV = Returner1(RV)-1; Print(RowVector(RV-RV1)); + CV1 = Returner1(RV.t())-1; Print(ColumnVector(RV.t()-CV1)); +#ifndef DONT_DO_NRIC + nricMatrix AA = A; + X = Returner1(AA)-A-1; Print(X); +#endif + UpperTriangularMatrix UT(31); + for (i=1; i<=31; i++) for (j=i; j<=31; j++) UT(i,j) = i+j+(i-j)*(i-2*j); + UpperBandMatrix UB(31,5); UB.Inject(UT); + LowerTriangularMatrix LT = UT.t(); + LowerBandMatrix LB(31,5); LB.Inject(LT); + A = Returner0(UB)-LB.t(); Print(A); + A = Returner2(UB).t()-LB*2; Print(A); + A = Returner3(LB).t()-UB*3; Print(A); + SymmetricMatrix SM; SM << (UT+LT); + A = Returner4(SM)-UT-LT-4; Print(A); + SymmetricBandMatrix SB(31,5); SB.Inject(SM); + A = Returner5(SB)/5-UB-LB; Print(A); + BandMatrix B = UB+LB*LB; A = LB; + A = Returner6(B)/6 - UB - A*A; Print(A); + DiagonalMatrix D; D << UT; + D << (Returner7(D)/7 - UT); Print(D); + +// cout << "\nEnd of fifth test\n"; +} + + + +///@} diff --git a/extern/newmat/tmt6.cpp b/extern/newmat/tmt6.cpp new file mode 100644 index 00000000..8defa2ad --- /dev/null +++ b/extern/newmat/tmt6.cpp @@ -0,0 +1,163 @@ +/// \ingroup newmat +///@{ + +/// \file tmt6.cpp +/// Part of matrix library test program. + + +//#define WANT_STREAM +#define WANT_MATH + + +#include "include.h" + +#include "newmatap.h" + +#include "tmt.h" + +#ifdef use_namespace +using namespace NEWMAT; +#endif + + +/**************************** test program ******************************/ + + +// slow sort program + +static void SimpleSortDescending(Real* first, const int length) +{ + int i = length; + while (--i) + { + Real x = *first; Real* f = first; Real* g = f; + int j = i; + while (j--) if (x < *(++f)) { g = f; x = *g; } + *g = *first; *first++ = x; + } +} + +static void TestSort(int n) +{ + // make some data + RowVector X(n); + int i; + for (i = 1; i <= n; i++) + X(i) = sin((Real)i) + 0.3 * cos(i/5.0) - 0.6 * sin(i/7.0) + 0.2 * sin(2.0 * i); + RowVector X_Sorted = X; SimpleSortDescending(X_Sorted.Store(), n); + RowVector A = X + X.Reverse(); SimpleSortDescending(A.Store(), n); + + // test descending sort + + RowVector Y = X; SortDescending(Y); Y -= X_Sorted; Print(Y); + Y = X_Sorted; SortDescending(Y); Y -= X_Sorted; Print(Y); + Y = X_Sorted.Reverse(); SortDescending(Y); Y -= X_Sorted; Print(Y); + Y = X + X.Reverse(); SortDescending(Y); Y -= A; Print(Y); + + // test ascending sort + + Y = X; SortAscending(Y); Y -= X_Sorted.Reverse(); Print(Y); + Y = X_Sorted; SortAscending(Y); Y -= X_Sorted.Reverse(); Print(Y); + Y = X_Sorted.Reverse(); SortAscending(Y); Y -= X_Sorted.Reverse(); Print(Y); + Y = X + X.Reverse(); SortAscending(Y); Y -= A.Reverse(); Print(Y); +} + + +void trymat6() +{ + Tracer et("Sixth test of Matrix package"); + Tracer::PrintTrace(); + + int i,j; + + + DiagonalMatrix D(6); + UpperTriangularMatrix U(6); + for (i=1;i<=6;i++) { for (j=i;j<=6;j++) U(i,j)=i*i*i-50; D(i,i)=i*i+i-10; } + LowerTriangularMatrix L=(U*3.0).t(); + SymmetricMatrix S(6); + for (i=1;i<=6;i++) for (j=i;j<=6;j++) S(i,j)=i*i+2.0+j; + Matrix MD=D; Matrix ML=L; Matrix MU=U; Matrix MS=S; + Matrix M(6,6); + for (i=1;i<=6;i++) for (j=1;j<=6;j++) M(i,j)=i*j+i*i-10.0; + { + Tracer et1("Stage 1"); + Print(Matrix(MS+(-MS))); + Print(Matrix((S+M)-(MS+M))); + Print(Matrix((M+U)-(M+MU))); + Print(Matrix((M+L)-(M+ML))); + } + { + Tracer et1("Stage 2"); + Print(Matrix((M+D)-(M+MD))); + Print(Matrix((U+D)-(MU+MD))); + Print(Matrix((D+L)-(ML+MD))); + Print(Matrix((-U+D)+MU-MD)); + Print(Matrix((-L+D)+ML-MD)); + } + { + Tracer et1("Stage 3 - concatenate"); + RowVector A(5); + A << 1 << 2 << 3 << 4 << 5; + RowVector B(5); + B << 3 << 1 << 4 << 1 << 5; + Matrix C(3,5); + C << 2 << 3 << 5 << 7 << 11 + << 13 << 17 << 19 << 23 << 29 + << 31 << 37 << 41 << 43 << 47; + Matrix X1 = A & B & C; + Matrix X2 = (A.t() | B.t() | C.t()).t(); + Matrix X3(5,5); + X3.Row(1)=A; X3.Row(2)=B; X3.Rows(3,5)=C; + Print(Matrix(X1-X2)); + Print(Matrix(X1-X3)); + LowerTriangularMatrix LT1; LT1 << (A & B & C); + UpperTriangularMatrix UT1; UT1 << (A.t() | B.t() | C.t()); + Print(LowerTriangularMatrix(LT1-UT1.t())); + DiagonalMatrix D1; D1 << (A.t() | B.t() | C.t()); + ColumnVector At = A.t(); + ColumnVector Bt = B.t(); + Matrix Ct = C.t(); + LowerTriangularMatrix LT2; LT2 << (At | Bt | Ct); + UpperTriangularMatrix UT2; UT2 << (At.t() & Bt.t() & Ct.t()); + Matrix ABt = At | Bt; + DiagonalMatrix D2; D2 << (ABt | Ct); + Print(LowerTriangularMatrix(LT2-UT2.t())); + Print(DiagonalMatrix(D1-D2)); + Print(Matrix(LT1+UT2-D2-X1)); + Matrix M1 = LT1 | UT2; Matrix M2 = UT1 & LT2; + Print(Matrix(M1-M2.t())); + M1 = UT2 | LT1; M2 = LT2 & UT1; + Print(Matrix(M1-M2.t())); + M1 = (LT1 | UT2) & (UT2 | LT1); + M2 = (UT1 & LT2) | (LT2 & UT1); + Print(Matrix(M1-M2.t())); + SymmetricMatrix SM1; SM1 << (M1 + M1.t()); + SymmetricMatrix SM2; SM2 << ((SM1 | M1) & (M1.t() | SM1)); + Matrix M3(20,20); + M3.SubMatrix(1,10,1,10) = SM1; + M3.SubMatrix(1,10,11,20) = M1; + M3.SubMatrix(11,20,1,10) = M2; + M3.SubMatrix(11,20,11,20) = SM1; + Print(Matrix(M3-SM2)); + + SymmetricMatrix SM(15); SM = 0; SM.SymSubMatrix(1,10) = SM1; + M3.ReSize(15,15); M3 = 0; M3.SubMatrix(1,10,1,10) = SM1; + M3 -= SM; Print(M3); + SM = 0; SM.SymSubMatrix(6,15) = SM1; + M3.ReSize(15,15); M3 = 0; M3.SubMatrix(6,15,6,15) = SM1; + M3 = M3.t() - SM; Print(M3); + } + { + Tracer et1("Stage 4 - sort"); + TestSort(1); TestSort(2); TestSort(3); TestSort(4); + TestSort(15); TestSort(16); TestSort(17); TestSort(18); + TestSort(99); TestSort(100); TestSort(101); + } + + +// cout << "\nEnd of sixth test\n"; +} + + +///@} diff --git a/extern/newmat/tmt7.cpp b/extern/newmat/tmt7.cpp new file mode 100644 index 00000000..c4e43fa3 --- /dev/null +++ b/extern/newmat/tmt7.cpp @@ -0,0 +1,299 @@ +/// \ingroup newmat +///@{ + +/// \file tmt7.cpp +/// Part of matrix library test program. + + +//#define WANT_STREAM + +#include "include.h" + +#include "newmat.h" + +#include "tmt.h" + +#ifdef use_namespace +using namespace NEWMAT; +#endif + +// C matrix mulitply - for testing RealStarStar + +void c_matrix_multiply(int p, int q, int r, + const Real** a, const Real** b, Real** c) +{ + for (int i = 0; i < p; ++i) for (int k = 0; k < r; ++k) + { + Real sum = 0.0; + for (int j = 0; j < q; ++j) sum += a[i][j] * b[j][k]; + c[i][k] = sum; + } +} + + + +void trymat7() +{ +// cout << "\nSeventh test of Matrix package\n"; + Tracer et("Seventh test of Matrix package"); + Tracer::PrintTrace(); + + int i,j; + + + DiagonalMatrix D(6); + UpperTriangularMatrix U(6); + for (i=1;i<=6;i++) { for (j=i;j<=6;j++) U(i,j)=i*i*j-50; D(i,i)=i*i+i-10; } + LowerTriangularMatrix L=(U*3.0).t(); + SymmetricMatrix S(6); + for (i=1;i<=6;i++) for (j=i;j<=6;j++) S(i,j)=i*i+2.0+j; + Matrix MD=D; Matrix ML=L; Matrix MU=U; + Matrix MS=S; + Matrix M(6,6); + for (i=1;i<=6;i++) for (j=1;j<=6;j++) M(i,j)=i*j+i*i-10.0; + { + Tracer et1("Stage 1"); + Print(Matrix((S-M)-(MS-M))); + Print(Matrix((-M-S)+(MS+M))); + Print(Matrix((U-M)-(MU-M))); + } + { + Tracer et1("Stage 2"); + Print(Matrix((L-M)+(M-ML))); + Print(Matrix((D-M)+(M-MD))); + Print(Matrix((D-S)+(MS-MD))); + Print(Matrix((D-L)+(ML-MD))); + } + + { M=MU.t(); } + LowerTriangularMatrix LY=D.i()*U.t(); + { + Tracer et1("Stage 3"); + MS=D*LY-M; Clean(MS,0.00000001); Print(MS); + L=U.t(); + LY=D.i()*L; MS=D*LY-M; Clean(MS,0.00000001); Print(MS); + } + { + Tracer et1("Stage 4"); + UpperTriangularMatrix UT(11); + int i, j; + for (i=1;i<=11;i++) for (j=i;j<=11;j++) UT(i,j)=i*i+j*3; + GenericMatrix GM; Matrix X; + UpperBandMatrix UB(11,3); UB.Inject(UT); UT = UB; + UpperBandMatrix UB2 = UB / 8; + GM = UB2-UT/8; X = GM; Print(X); + SymmetricBandMatrix SB(11,4); SB << (UB + UB.t()); + X = SB - UT - UT.t(); Print(X); + BandMatrix B = UB + UB.t()*2; + DiagonalMatrix D; D << B; + X.ReSize(1,1); X(1,1) = Trace(B)-Sum(D); Print(X); + X = SB + 5; Matrix X1=X; X = SP(UB,X); Matrix X2 =UB; + X1 = (X1.AsDiagonal() * X2.AsDiagonal()).AsRow()-X.AsColumn().t(); + Print(X1); + X1=SB.t(); X2 = B.t(); X = SB.i() * B - X1.i() * X2.t(); + Clean(X,0.00000001); Print(X); + X = SB.i(); X = X * B - X1.i() * X2.t(); + Clean(X,0.00000001); Print(X); + D = 1; X = SB.i() * SB - D; Clean(X,0.00000001); Print(X); + ColumnVector CV(11); + CV << 2 << 6 <<3 << 8 << -4 << 17.5 << 2 << 1 << -2 << 5 << 3.75; + D << 2 << 6 <<3 << 8 << -4 << 17.5 << 2 << 1 << -2 << 5 << 3.75; + X = CV.AsDiagonal(); X = X-D; Print(X); + SymmetricBandMatrix SB1(11,7); SB1 = 5; + SymmetricBandMatrix SB2 = SB1 + D; + X.ReSize(11,11); X=0; + for (i=1;i<=11;i++) for (j=1;j<=11;j++) + { + if (abs(i-j)<=7) X(i,j)=5; + if (i==j) X(i,j)+=CV(i); + } + SymmetricMatrix SM; SM.ReSize(11); + SM=SB; SB = SB+SB2; X1 = SM+X-SB; Print(X1); + SB2=0; X2=SB2; X1=SB; Print(X2); + for (i=1;i<=11;i++) SB2.Column(i)<a3) ? i : a3; j<=a4; j++) + M3(i-a1+1,j-a3+1) = 100*i + j; + Print(Matrix(M2-M3)); + } + { + Tracer et1("Stage 8"); + a1=3; a2=9; a3=2; a4=7; + U.ReSize(10); + for (i=1; i<=10; i++) for (j=i; j<=10; j++) U(i,j) = 100*i + j; + M2 = U.SubMatrix(a1,a2,a3,a4); + M3.ReSize(a2-a1+1,a4-a3+1); M3=0.0; + for (i=a1; i<=a2; i++) for (j=(i>a3) ? i : a3; j<=a4; j++) + M3(i-a1+1,j-a3+1) = 100*i + j; + Print(Matrix(M2-M3)); + } + { + Tracer et1("Stage 9"); + a1=4; a2=6; a3=2; a4=5; + U.ReSize(10); + for (i=1; i<=10; i++) for (j=i; j<=10; j++) U(i,j) = 100*i + j; + M2 = U.SubMatrix(a1,a2,a3,a4); + M3.ReSize(a2-a1+1,a4-a3+1); M3=0.0; + for (i=a1; i<=a2; i++) for (j=(i>a3) ? i : a3; j<=a4; j++) + M3(i-a1+1,j-a3+1) = 100*i + j; + Print(Matrix(M2-M3)); + } + + { + Tracer et1("Stage 10"); + TestClass TC; + Matrix M = TC.Sum() - 9; + Print(M); + } + + +// cout << "\nEnd of eleventh test\n"; +} + + + +///@} diff --git a/extern/newmat/tmtc.cpp b/extern/newmat/tmtc.cpp new file mode 100644 index 00000000..a88f4f82 --- /dev/null +++ b/extern/newmat/tmtc.cpp @@ -0,0 +1,555 @@ +/// \ingroup newmat +///@{ + +/// \file tmtc.cpp +/// Part of matrix library test program. + + +//#define WANT_STREAM + + +#include "include.h" +#include "newmatap.h" + +#include "tmt.h" + +#ifdef use_namespace +using namespace NEWMAT; +#endif + +// test SP_eq with Generic Matrices +void test_SP_eq(const GenericMatrix& GX, const GenericMatrix& GY) +{ + GenericMatrix GZ = SP(GX, GY); GenericMatrix GX1 = GX; + GX1.SP_eq(GY); Matrix Z = GX1 - GZ; Print(Z); + GX1 = GX; GX1.SP_eq(2 * GY); Z = GX1 - 2 * GZ; Print(Z); + GX1 = GX; GX1.SP_eq(GX1); Z = GX1 - SP(GX,GX); Print(Z); +} + + +void trymatc() +{ +// cout << "\nTwelfth test of Matrix package\n"; + Tracer et("Twelfth test of Matrix package"); + Tracer::PrintTrace(); + DiagonalMatrix D(15); D=1.5; + Matrix A(15,15); + int i,j; + for (i=1;i<=15;i++) for (j=1;j<=15;j++) A(i,j)=i*i+j-150; + { A = A + D; } + ColumnVector B(15); + for (i=1;i<=15;i++) B(i)=i+i*i-150.0; + { + Tracer et1("Stage 1"); + ColumnVector B1=B; + B=(A*2.0).i() * B1; + Matrix X = A*B-B1/2.0; + Clean(X, 0.000000001); Print(X); + A.ReSize(3,5); + for (i=1; i<=3; i++) for (j=1; j<=5; j++) A(i,j) = i+100*j; + + B = A.AsColumn()+10000; + RowVector R = (A+10000).AsColumn().t(); + Print( RowVector(R-B.t()) ); + } + + { + Tracer et1("Stage 2"); + B = A.AsColumn()+10000; + Matrix XR = (A+10000).AsMatrix(15,1).t(); + Print( RowVector(XR-B.t()) ); + } + + { + Tracer et1("Stage 3"); + B = (A.AsMatrix(15,1)+A.AsColumn())/2.0+10000; + Matrix MR = (A+10000).AsColumn().t(); + Print( RowVector(MR-B.t()) ); + + B = (A.AsMatrix(15,1)+A.AsColumn())/2.0; + MR = A.AsColumn().t(); + Print( RowVector(MR-B.t()) ); + } + + { + Tracer et1("Stage 4"); + B = (A.AsMatrix(15,1)+A.AsColumn())/2.0; + RowVector R = A.AsColumn().t(); + Print( RowVector(R-B.t()) ); + } + + { + Tracer et1("Stage 5"); + RowVector R = (A.AsColumn()-5000).t(); + B = ((R.t()+10000) - A.AsColumn())-5000; + Print( RowVector(B.t()) ); + } + + { + Tracer et1("Stage 6"); + B = A.AsColumn(); ColumnVector B1 = (A+10000).AsColumn() - 10000; + Print(ColumnVector(B1-B)); + } + + { + Tracer et1("Stage 7"); + Matrix X = B.AsMatrix(3,5); Print(Matrix(X-A)); + for (i=1; i<=3; i++) for (j=1; j<=5; j++) B(5*(i-1)+j) -= i+100*j; + Print(B); + } + + { + Tracer et1("Stage 8"); + A.ReSize(7,7); D.ReSize(7); + for (i=1; i<=7; i++) for (j=1; j<=7; j++) A(i,j) = i*j*j; + for (i=1; i<=7; i++) D(i,i) = i; + UpperTriangularMatrix U; U << A; + Matrix X = A; for (i=1; i<=7; i++) X(i,i) = i; + A.Inject(D); Print(Matrix(X-A)); + X = U; U.Inject(D); A = U; for (i=1; i<=7; i++) X(i,i) = i; + Print(Matrix(X-A)); + } + + { + Tracer et1("Stage 9"); + A.ReSize(7,5); + for (i=1; i<=7; i++) for (j=1; j<=5; j++) A(i,j) = i+100*j; + Matrix Y = A; Y = Y - ((const Matrix&)A); Print(Y); + Matrix X = A; + Y = A; Y = ((const Matrix&)X) - A; Print(Y); Y = 0.0; + Y = ((const Matrix&)X) - ((const Matrix&)A); Print(Y); + } + + { + Tracer et1("Stage 10"); + // some tests on submatrices + UpperTriangularMatrix U(20); + for (i=1; i<=20; i++) for (j=i; j<=20; j++) U(i,j)=100 * i + j; + UpperTriangularMatrix V = U.SymSubMatrix(1,5); + UpperTriangularMatrix U1 = U; + U1.SubMatrix(4,8,5,9) /= 2; + U1.SubMatrix(4,8,5,9) += 388 * V; + U1.SubMatrix(4,8,5,9) *= 2; + U1.SubMatrix(4,8,5,9) += V; + U1 -= U; UpperTriangularMatrix U2 = U1; + U1 << U1.SubMatrix(4,8,5,9); + U2.SubMatrix(4,8,5,9) -= U1; Print(U2); + U1 -= (777*V); Print(U1); + + U1 = U; U1.SubMatrix(4,8,5,9) -= U.SymSubMatrix(1,5); + U1 -= U; U2 = U1; U1 << U1.SubMatrix(4,8,5,9); + U2.SubMatrix(4,8,5,9) -= U1; Print(U2); + U1 += V; Print(U1); + + U1 = U; + U1.SubMatrix(3,10,15,19) += 29; + U1 -= U; + Matrix X = U1.SubMatrix(3,10,15,19); X -= 29; Print(X); + U1.SubMatrix(3,10,15,19) *= 0; Print(U1); + + LowerTriangularMatrix L = U.t(); + LowerTriangularMatrix M = L.SymSubMatrix(1,5); + LowerTriangularMatrix L1 = L; + L1.SubMatrix(5,9,4,8) /= 2; + L1.SubMatrix(5,9,4,8) += 388 * M; + L1.SubMatrix(5,9,4,8) *= 2; + L1.SubMatrix(5,9,4,8) += M; + L1 -= L; LowerTriangularMatrix L2 = L1; + L1 << L1.SubMatrix(5,9,4,8); + L2.SubMatrix(5,9,4,8) -= L1; Print(L2); + L1 -= (777*M); Print(L1); + + L1 = L; L1.SubMatrix(5,9,4,8) -= L.SymSubMatrix(1,5); + L1 -= L; L2 =L1; L1 << L1.SubMatrix(5,9,4,8); + L2.SubMatrix(5,9,4,8) -= L1; Print(L2); + L1 += M; Print(L1); + + L1 = L; + L1.SubMatrix(15,19,3,10) -= 29; + L1 -= L; + X = L1.SubMatrix(15,19,3,10); X += 29; Print(X); + L1.SubMatrix(15,19,3,10) *= 0; Print(L1); + } + + { + Tracer et1("Stage 11"); + // more tests on submatrices + Matrix M(20,30); + for (i=1; i<=20; i++) for (j=1; j<=30; j++) M(i,j)=100 * i + j; + Matrix M1 = M; + + for (j=1; j<=30; j++) + { ColumnVector CV = 3 * M1.Column(j); M.Column(j) += CV; } + for (i=1; i<=20; i++) + { RowVector RV = 5 * M1.Row(i); M.Row(i) -= RV; } + + M += M1; Print(M); + + } + + { + Tracer et1("Stage 12"); + // more tests on Release + Matrix M(20,30); + for (i=1; i<=20; i++) for (j=1; j<=30; j++) M(i,j)=100 * i + j; + Matrix M1 = M; + M.Release(); + Matrix M2 = M; + Matrix X = M; Print(X); + X = M1 - M2; Print(X); + +#ifndef DONT_DO_NRIC + nricMatrix N = M1; + nricMatrix N1 = N; + N.Release(); + nricMatrix N2 = N; + nricMatrix Y = N; Print(Y); + Y = N1 - N2; Print(Y); + + N = M1 / 2; N1 = N * 2; N.Release(); N2 = N * 2; Y = N; Print(N); + Y = (N1 - M1) | (N2 - M1); Print(Y); +#endif + + } + + { + Tracer et("Stage 13"); + // test sum of squares of rows or columns + MultWithCarry mwc; + DiagonalMatrix DM; Matrix X; + // rectangular matrix + Matrix A(20, 15); + FillWithValues(mwc, A); + // sum of squares of rows + DM << A * A.t(); + ColumnVector CV = A.sum_square_rows(); + X = CV - DM.AsColumn(); Clean(X, 0.000000001); Print(X); + DM << A.t() * A; + RowVector RV = A.sum_square_columns(); + X = RV - DM.AsRow(); Clean(X, 0.000000001); Print(X); + X = RV - A.t().sum_square_rows().t(); Clean(X, 0.000000001); Print(X); + X = CV - A.t().sum_square_columns().t(); Clean(X, 0.000000001); Print(X); + // UpperTriangularMatrix + A.ReSize(17,17); FillWithValues(mwc, A); + UpperTriangularMatrix UT; UT << A; + Matrix A1 = UT; + X = UT.sum_square_rows() - A1.sum_square_rows(); Clean(X, 0.00000000000001); Print(X); + X = UT.sum_square_columns() - A1.sum_square_columns(); Clean(X, 0.00000000000001); Print(X); + // LowerTriangularMatrix + LowerTriangularMatrix LT; LT << A; + A1 = LT; + X = LT.sum_square_rows() - A1.sum_square_rows(); Clean(X, 0.00000000000001); Print(X); + X = LT.sum_square_columns() - A1.sum_square_columns(); Clean(X, 0.00000000000001); Print(X); + // SymmetricMatrix + SymmetricMatrix SM; SM << A; + A1 = SM; + X = SM.sum_square_rows() - A1.sum_square_rows(); Clean(X, 0.00000000000001); Print(X); + X = SM.sum_square_columns() - A1.sum_square_columns(); Clean(X, 0.00000000000001); Print(X); + // DiagonalMatrix + DM << A; + A1 = DM; + X = DM.sum_square_rows() - A1.sum_square_rows(); Clean(X, 0.00000000000001); Print(X); + X = DM.sum_square_columns() - A1.sum_square_columns(); Clean(X, 0.00000000000001); Print(X); + // BandMatrix + BandMatrix BM(17, 3, 5); BM.Inject(A); + A1 = BM; + X = BM.sum_square_rows() - A1.sum_square_rows(); Clean(X, 0.00000000000001); Print(X); + X = BM.sum_square_columns() - A1.sum_square_columns(); Clean(X, 0.00000000000001); Print(X); + // SymmetricBandMatrix + SymmetricBandMatrix SBM(17, 4); SBM.Inject(A); + A1 = SBM; + X = SBM.sum_square_rows() - A1.sum_square_rows(); Clean(X, 0.00000000000001); Print(X); + X = SBM.sum_square_columns() - A1.sum_square_columns(); Clean(X, 0.00000000000001); Print(X); + // IdentityMatrix + IdentityMatrix IM(29); + X = IM.sum_square_rows() - 1; Clean(X, 0.00000000000001); Print(X); + X = IM.sum_square_columns() - 1; Clean(X, 0.00000000000001); Print(X); + // Matrix with zero rows + A1.ReSize(0,10); + X.ReSize(1,10); X = 0; X -= A1.sum_square_columns(); Clean(X, 0.00000000000001); Print(X); + X.ReSize(0,1); X -= A1.sum_square_rows(); Clean(X, 0.00000000000001); Print(X); + // Matrix with zero columns + A1.ReSize(10,0); + X.ReSize(10,1); X = 0; X -= A1.sum_square_rows(); Clean(X, 0.00000000000001); Print(X); + X.ReSize(1,0); X -= A1.sum_square_columns(); Clean(X, 0.00000000000001); Print(X); + + } + + { + Tracer et("Stage 14"); + // test extend orthonormal + MultWithCarry mwc; + Matrix A(20,5); FillWithValues(mwc, A); + // Orthonormalise + UpperTriangularMatrix R; + Matrix A_old = A; + QRZ(A,R); + // Check decomposition + Matrix X = A * R - A_old; Clean(X, 0.000000001); Print(X); + // Check orthogonality + X = A.t() * A - IdentityMatrix(5); + Clean(X, 0.000000001); Print(X); + // Try orthonality extend + SquareMatrix A1(20); + A1.Columns(1,5) = A; + extend_orthonormal(A1,5); + // check columns unchanged + X = A - A1.Columns(1,5); Print(X); + // Check orthogonality + X = A1.t() * A1 - IdentityMatrix(20); + Clean(X, 0.000000001); Print(X); + X = A1 * A1.t() - IdentityMatrix(20); + Clean(X, 0.000000001); Print(X); + // Test with smaller number of columns + Matrix A2(20,15); + A2.Columns(1,5) = A; + extend_orthonormal(A2,5); + // check columns unchanged + X = A - A2.Columns(1,5); Print(X); + // Check orthogonality + X = A2.t() * A2 - IdentityMatrix(15); + Clean(X, 0.000000001); Print(X); + // check it works with no columns to start with + A2.ReSize(100,100); + extend_orthonormal(A2,0); + // Check orthogonality + X = A2.t() * A2 - IdentityMatrix(100); + Clean(X, 0.000000001); Print(X); + X = A2 * A2.t() - IdentityMatrix(100); + Clean(X, 0.000000001); Print(X); + } + + { + Tracer et("Stage 15"); + // test extend orthonormal for SVD + MultWithCarry mwc; + Matrix A(15,40); FillWithValues(mwc, A); + Matrix U, V; DiagonalMatrix D; + SVD(A.t(),D,V,U); + Matrix VE(40,40); VE.columns(1,15) = V; + extend_orthonormal(VE,15); + Matrix DE(15,40); DE = 0; DE.columns(1,15) = D; + Matrix B = U * DE * VE.t(); + B -= A; + Clean(B, 0.000000001); Print(B); + } + + { + Tracer et("Stage 16"); + // test sum of rows or columns + MultWithCarry mwc; + ColumnVector CVX; Matrix X; + // rectangular matrix + Matrix A(20, 15); + FillWithValues(mwc, A); + // sum of rows + ColumnVector Ones(15); Ones = 1; + CVX = A * Ones; + ColumnVector CV = A.sum_rows(); + X = CV - CVX; Clean(X, 0.000000001); Print(X); + Ones.resize(20); Ones = 1; + CVX << A.t() * Ones; + RowVector RV = A.sum_columns(); + X = RV - CVX.AsRow(); Clean(X, 0.000000001); Print(X); + X = RV - A.t().sum_rows().t(); Clean(X, 0.000000001); Print(X); + X = CV - A.t().sum_columns().t(); Clean(X, 0.000000001); Print(X); + // UpperTriangularMatrix + A.ReSize(17,17); FillWithValues(mwc, A); + UpperTriangularMatrix UT; UT << A; + Matrix A1 = UT; + X = UT.sum_rows() - A1.sum_rows(); Print(X); + X = UT.sum_columns() - A1.sum_columns(); Print(X); + // LowerTriangularMatrix + LowerTriangularMatrix LT; LT << A; + A1 = LT; + X = LT.sum_rows() - A1.sum_rows(); Print(X); + X = LT.sum_columns() - A1.sum_columns(); Print(X); + // SymmetricMatrix + SymmetricMatrix SM; SM << A; + A1 = SM; + X = SM.sum_rows() - A1.sum_rows(); Print(X); + X = SM.sum_columns() - A1.sum_columns(); Print(X); + // DiagonalMatrix + DiagonalMatrix DM; DM << A; + A1 = DM; + X = DM.sum_rows() - A1.sum_rows(); Print(X); + X = DM.sum_columns() - A1.sum_columns(); Print(X); + // BandMatrix + BandMatrix BM(17, 3, 5); BM.Inject(A); + A1 = BM; + X = BM.sum_rows() - A1.sum_rows(); Print(X); + X = BM.sum_columns() - A1.sum_columns(); Print(X); + // SymmetricBandMatrix + SymmetricBandMatrix SBM(17, 4); SBM.Inject(A); + A1 = SBM; + X = SBM.sum_rows() - A1.sum_rows(); Print(X); + X = SBM.sum_columns() - A1.sum_columns(); Print(X); + // IdentityMatrix + IdentityMatrix IM(29); + X = IM.sum_rows() - 1; Print(X); + X = IM.sum_columns() - 1; Print(X); + // Matrix with zero rows + A1.ReSize(0,10); + X.ReSize(1,10); X = 0; X -= A1.sum_columns(); Print(X); + X.ReSize(0,1); X -= A1.sum_rows(); Print(X); + // Matrix with zero columns + A1.ReSize(10,0); + X.ReSize(10,1); X = 0; X -= A1.sum_rows(); Print(X); + X.ReSize(1,0); X -= A1.sum_columns(); Print(X); + + } + + { + Tracer et("Stage 17"); + // SP_eq on submatrices + MultWithCarry mwc; + Matrix A(37, 23); Matrix B(17,11); + FillWithValues(mwc, A); FillWithValues(mwc, B); + Matrix X = A; X.submatrix(5,21,3,13).SP_eq(B); + Matrix Y = A; Y.submatrix(5,21,3,13) = SP(Y.submatrix(5,21,3,13),B); + Y -= X; Print(Y); + + UpperTriangularMatrix UT(33); + FillWithValues(mwc, UT); + UpperTriangularMatrix UTX = UT; + UTX.submatrix(5,21,3,13).SP_eq(B); + Y = UT; Y.submatrix(5,21,3,13) = SP(Y.submatrix(5,21,3,13),B); + Y -= UTX; Print(Y); + + UT.resize(10); + FillWithValues(mwc, UT); + X = A; X.submatrix(5,14,3,12).SP_eq(UT); + Y = A; Y.submatrix(5,14,3,12) = SP(Y.submatrix(5,14,3,12),UT); + Y -= X; Print(Y); + + SymmetricMatrix SM(30), SM1(10); + FillWithValues(mwc, SM); FillWithValues(mwc, SM1); + SymmetricMatrix SMX = SM; + // This doesn't work - gets caught as illegal conversion + //SMX.sym_submatrix(5,14) += SM1; + //Y = SM; Y.submatrix(5,14,5,14) = Y.submatrix(5,14,5,14) + SM1; + //Y -= SMX; Print(Y); + + SMX = SM; + SMX.submatrix(5,14,5,14).SP_eq(SM1); + Y = SM; Y.submatrix(5,14,5,14) = SP(Y.submatrix(5,14,5,14),SM1); + Y -= SMX; Print(Y); + + BandMatrix BM(50, 10, 12); + X.resize(50,50); FillWithValues(mwc, X); + BM.inject(X); X = BM; + B.resize(7, 10); FillWithValues(mwc, B); + BM.submatrix(2,8,4,13) += B; + X.submatrix(2,8,4,13) = X.submatrix(2,8,4,13) + B; + X -= BM; Print(X); + + X.resize(50,50); FillWithValues(mwc, X); + BM.inject(X); X = BM; + B.resize(7, 10); FillWithValues(mwc, B); + BM.submatrix(2,8,4,13).SP_eq(B); + X.submatrix(2,8,4,13) = SP(X.submatrix(2,8,4,13), B); + X -= BM; Print(X); + + X.resize(50,50); FillWithValues(mwc, X); + BM.inject(X); X = BM; + B.resize(21, 23); FillWithValues(mwc, B); + BM.submatrix(2,22,4,26).SP_eq(B); + X.submatrix(2,22,4,26) = SP(X.submatrix(2,22,4,26), B); + X -= BM; Print(X); + + } + + { + Tracer et("Stage 18"); + // += real on submatrices of symmetric matrices + // these don't work either + //MultWithCarry mwc; + //SymmetricMatrix SM(30); + //FillWithValues(mwc, SM); + //SymmetricMatrix SMX = SM; + //SMX.sym_submatrix(7,11) += 5; + //Matrix X = SM; X.sym_submatrix(7,11) += 5; + //X -= SMX; Print(X); + + } + + { + Tracer et("Stage 19"); + // SQ_eq on matrices + MultWithCarry mwc; + + Matrix X(10,13), Y(10,13); + FillWithValues(mwc, X); FillWithValues(mwc, Y); + Matrix Z = X; Z.SP_eq(Y); + Z -= SP(X, Y); Print(Z); + + Z = X; Z.SP_eq(2 * Y); + Z -= 2 * SP(X, Y); Print(Z); + + Z = X; Z.SP_eq(Z); + Z -= SP(X, X); Print(Z); + + GenericMatrix GX = X, GY = Y; test_SP_eq(GX, GY); test_SP_eq(GX, GX); + + X.resize(17,17); Y.resize(17,17); + FillWithValues(mwc, X); FillWithValues(mwc, Y); + UpperTriangularMatrix UT; UT << Y; + LowerTriangularMatrix LT; LT << Y; + DiagonalMatrix D; D << Y; + Matrix ZUT = X; ZUT.SP_eq(UT); + Matrix ZLT = X; ZLT.SP_eq(LT); + Matrix ZD = X; ZD.SP_eq(D); + Z = ZUT + ZLT - ZD - SP(X, Y); + Clean(Z, 0.000000001); Print(Z); + + UpperTriangularMatrix UX(19), UY(19); + FillWithValues(mwc, UX); FillWithValues(mwc, UY); + + GX = UX; GY = UY; test_SP_eq(GX, GY); test_SP_eq(GX, GY.t()); + + UpperTriangularMatrix UZ = UX; UZ.SP_eq(UY); + UZ -= SP(UX, UY); Print(UZ); + + UZ = UX; UZ.SP_eq(2 * UY); + UZ -= 2 * SP(UX, UY); Print(UZ); + + UT << UY; LT << UY; D << UY; + UpperTriangularMatrix UZUT = UX; UZUT.SP_eq(UT); + UpperTriangularMatrix UZLT = UX; UZLT.SP_eq(LT); + UpperTriangularMatrix UZD = UX; UZD.SP_eq(D); + Z = UZUT + UZLT - UZD - SP(UX, UY); + Clean(Z, 0.000000001); Print(Z); + + SymmetricMatrix SM(13), SM1(13), SMX, SM2; + FillWithValues(mwc, SM); FillWithValues(mwc, SM1); + SMX = SP(SM, SM1); SM2 = SM; + SM2.SP_eq(SM1); SM2 -= SMX; Print(SM2); + GX = SM; GY = SM1; test_SP_eq(GX, GY); + + X.resize(13,13); FillWithValues(mwc, X); + Z = SP(X,SM); SM2 = SM; + X.SP_eq(SM); X -= Z; Print(X); + + FillWithValues(mwc, X); + GX = X; GY = SM; test_SP_eq(GX, GY); + GX = SM; GY = X; test_SP_eq(GX, GY); + + BandMatrix BMX(13, 5,9); BMX.inject(X); + SymmetricBandMatrix SBM(13,6); SBM.inject(SM); + GX = BMX; GY = SBM; test_SP_eq(GX, GY); + GX = SBM; GY = BMX; test_SP_eq(GX, GY); + BandMatrix BMX1 = BMX; BMX1.SP_eq(SBM); Z = BMX1 - SP(BMX,SBM); Print(Z); + BandMatrix BMX2 = SBM; + GX = BMX; GY = BMX2; test_SP_eq(GX, GY); + BMX1 = BMX; BMX1.SP_eq(BMX2); Z = BMX1 - SP(BMX,BMX2); Print(Z); + + + } + + + +// cout << "\nEnd of twelfth test\n"; +} + + +///@} diff --git a/extern/newmat/tmtd.cpp b/extern/newmat/tmtd.cpp new file mode 100644 index 00000000..edf574e9 --- /dev/null +++ b/extern/newmat/tmtd.cpp @@ -0,0 +1,769 @@ +/// \ingroup newmat +///@{ + +/// \file tmtd.cpp +/// Part of matrix library test program. + + +//#define WANT_STREAM + +#include "include.h" +#include "newmatap.h" + +#include "tmt.h" + +#ifdef use_namespace +using namespace NEWMAT; +#endif + +void fix_signs(UpperTriangularMatrix& U); +void fix_signs(LowerTriangularMatrix& L); + +ReturnMatrix Inverter1(const CroutMatrix& X) +{ + Matrix Y = X.i(); + Y.Release(); + return Y.ForReturn(); +} + +// this version forces a copy +ReturnMatrix Inverter2(CroutMatrix X) +{ + Matrix Y = X.i(); + Y.Release(); + return Y.ForReturn(); +} + +ReturnMatrix Inverter1(const BandLUMatrix& X) +{ + Matrix Y = X.i(); + Y.Release(); + return Y.ForReturn(); +} + +// this version forces a copy +ReturnMatrix Inverter2(BandLUMatrix X) +{ + Matrix Y = X.i(); + Y.Release(); + return Y.ForReturn(); +} + +ReturnMatrix LU1(const Matrix& A) +{ + Tracer et1("LU1 - Crout"); + CroutMatrix X = A; + return X.for_return(); +} + +ReturnMatrix LU2(const Matrix& A) +{ + Tracer et1("LU2 - Crout"); + CroutMatrix X = A; X.release(); + return X.for_return(); +} + +ReturnMatrix LU3(const Matrix& A) +{ + Tracer et1("LU3 - Crout"); + CroutMatrix* X = new CroutMatrix(A); MatrixErrorNoSpace(X); + X->release_and_delete(); + return X->for_return(); +} + +ReturnMatrix LU1(const BandMatrix& A) +{ + Tracer et1("LU1 - BandLU"); + BandLUMatrix X = A; + return X.for_return(); +} + +ReturnMatrix LU2(const BandMatrix& A) +{ + Tracer et1("LU2 - BandLU"); + BandLUMatrix X = A; X.release(); + return X.for_return(); +} + +ReturnMatrix LU3(const BandMatrix& A) +{ + Tracer et1("LU3 - BandLU"); + BandLUMatrix* X = new BandLUMatrix(A); MatrixErrorNoSpace(X); + X->release_and_delete(); + return X->for_return(); +} + + + +void CircularShift(const Matrix& X1, int first, int last) +{ + Matrix X; UpperTriangularMatrix U1, U2; + int n = X1.Ncols(); + + // Try right circular shift of columns + X = X1; QRZ(X, U1); + RightCircularUpdateCholesky(U1, first, last); + X = X1.Columns(1,first-1) | X1.Column(last) + | X1.Columns(first,last-1) | X1.Columns(last+1,n); + QRZ(X, U2); + X = U1 - U2; Clean(X, 0.000000001); Print(X); + + // Try left circular shift of columns + X = X1; QRZ(X, U1); + LeftCircularUpdateCholesky(U1, first, last); + X = X1.Columns(1,first-1) | X1.Columns(first+1,last) + | X1.Column(first) | X1.Columns(last+1,n); + QRZ(X, U2); + X = U1 - U2; Clean(X, 0.000000001); Print(X); +} + +class TestUpdateQRZ +{ + int m,n1,n2,n3; + Matrix X1, X2, X3; + MultWithCarry mwc; // Uniform random number generator +public: + void Reset(); + TestUpdateQRZ(int mx, int n1x, int n2x=0, int n3x=0) + : m(mx), n1(n1x), n2(n2x), n3(n3x) { Reset(); } + void DoTest(); + void ClearRow(int i) { X1.Row(i) = 0.0; } + void SetRow(int i, int j) { X1.Row(i) = X1.Row(j); } +}; + +// QRZ transform but check QRZT gives same answer +void QRZ_checkT(Matrix& X, Matrix& Y, UpperTriangularMatrix& U, Matrix& M) +{ + Matrix XT = X.t(), YT = Y.t(), MT, BX; + LowerTriangularMatrix L; + QRZ(X, Y, U, M); QRZT(XT, YT, L, MT); + BX = U - L.t(); Clean(BX, 0.000000001); Print(BX); + BX = M - MT.t(); Clean(BX, 0.000000001); Print(BX); +} + + + +void trymatd() +{ + Tracer et("Thirteenth test of Matrix package"); + Tracer::PrintTrace(); + Matrix X(5,20); + int i,j; + for (j=1;j<=20;j++) X(1,j) = j+1; + for (i=2;i<=5;i++) for (j=1;j<=20; j++) X(i,j) = (long)X(i-1,j) * j % 1001; + SymmetricMatrix S; S << X * X.t(); + Matrix SM = X * X.t() - S; + Print(SM); + LowerTriangularMatrix L = Cholesky(S); + Matrix Diff = L*L.t()-S; Clean(Diff, 0.000000001); + Print(Diff); + { + Tracer et1("Stage 1"); + LowerTriangularMatrix L1(5); + Matrix Xt = X.t(); Matrix Xt2 = Xt; + QRZT(X,L1); + Diff = L - L1; Clean(Diff,0.000000001); Print(Diff); + UpperTriangularMatrix Ut(5); + QRZ(Xt,Ut); + Diff = L - Ut.t(); Clean(Diff,0.000000001); Print(Diff); + Matrix Y(3,20); + for (j=1;j<=20;j++) Y(1,j) = 22-j; + for (i=2;i<=3;i++) for (j=1;j<=20; j++) + Y(i,j) = (long)Y(i-1,j) * j % 101; + Matrix Yt = Y.t(); Matrix M,Mt; Matrix Y2=Y; + QRZT(X,Y,M); QRZ(Xt,Yt,Mt); + Diff = Xt - X.t(); Clean(Diff,0.000000001); Print(Diff); + Diff = Yt - Y.t(); Clean(Diff,0.000000001); Print(Diff); + Diff = Mt - M.t(); Clean(Diff,0.000000001); Print(Diff); + Diff = Y2 * Xt2 * S.i() - M * L.i(); + Clean(Diff,0.000000001); Print(Diff); + } + + ColumnVector C1(5); + { + Tracer et1("Stage 2"); + X.ReSize(5,5); + for (j=1;j<=5;j++) X(1,j) = j+1; + for (i=2;i<=5;i++) for (j=1;j<=5; j++) + X(i,j) = (long)X(i-1,j) * j % 1001; + for (i=1;i<=5;i++) C1(i) = i*i; + CroutMatrix A = X; + ColumnVector C2 = A.i() * C1; C1 = X.i() * C1; + X = C1 - C2; Clean(X,0.000000001); Print(X); + } + + { + Tracer et1("Stage 3"); + X.ReSize(7,7); + for (j=1;j<=7;j++) X(1,j) = j+1; + for (i=2;i<=7;i++) for (j=1;j<=7; j++) + X(i,j) = (long)X(i-1,j) * j % 1001; + C1.ReSize(7); + for (i=1;i<=7;i++) C1(i) = i*i; + RowVector R1 = C1.t(); + Diff = R1 * X.i() - ( X.t().i() * R1.t() ).t(); Clean(Diff,0.000000001); + Print(Diff); + } + + { + Tracer et1("Stage 4"); + X.ReSize(5,5); + for (j=1;j<=5;j++) X(1,j) = j+1; + for (i=2;i<=5;i++) for (j=1;j<=5; j++) + X(i,j) = (long)X(i-1,j) * j % 1001; + C1.ReSize(5); + for (i=1;i<=5;i++) C1(i) = i*i; + CroutMatrix A1 = X*X; + ColumnVector C2 = A1.i() * C1; C1 = X.i() * C1; C1 = X.i() * C1; + X = C1 - C2; Clean(X,0.000000001); Print(X); + } + + + { + Tracer et1("Stage 5"); + int n = 40; + SymmetricBandMatrix B(n,2); B = 0.0; + for (i=1; i<=n; i++) + { + B(i,i) = 6; + if (i<=n-1) B(i,i+1) = -4; + if (i<=n-2) B(i,i+2) = 1; + } + B(1,1) = 5; B(n,n) = 5; + SymmetricMatrix A = B; + ColumnVector X(n); + X(1) = 429; + for (i=2;i<=n;i++) X(i) = (long)X(i-1) * 31 % 1001; + X = X / 100000L; + // the matrix B is rather ill-conditioned so the difficulty is getting + // good agreement (we have chosen X very small) may not be surprising; + // maximum element size in B.i() is around 1400 + ColumnVector Y1 = A.i() * X; + LowerTriangularMatrix C1 = Cholesky(A); + ColumnVector Y2 = C1.t().i() * (C1.i() * X) - Y1; + Clean(Y2, 0.000000001); Print(Y2); + UpperTriangularMatrix CU = C1.t().i(); + LowerTriangularMatrix CL = C1.i(); + Y2 = CU * (CL * X) - Y1; + Clean(Y2, 0.000000001); Print(Y2); + Y2 = B.i() * X - Y1; Clean(Y2, 0.000000001); Print(Y2); + + LowerBandMatrix C2 = Cholesky(B); + Matrix M = C2 - C1; Clean(M, 0.000000001); Print(M); + ColumnVector Y3 = C2.t().i() * (C2.i() * X) - Y1; + Clean(Y3, 0.000000001); Print(Y3); + CU = C1.t().i(); + CL = C1.i(); + Y3 = CU * (CL * X) - Y1; + Clean(Y3, 0.000000001); Print(Y3); + + Y3 = B.i() * X - Y1; Clean(Y3, 0.000000001); Print(Y3); + + SymmetricMatrix AI = A.i(); + Y2 = AI*X - Y1; Clean(Y2, 0.000000001); Print(Y2); + SymmetricMatrix BI = B.i(); + BandMatrix C = B; Matrix CI = C.i(); + M = A.i() - CI; Clean(M, 0.000000001); Print(M); + M = B.i() - CI; Clean(M, 0.000000001); Print(M); + M = AI-BI; Clean(M, 0.000000001); Print(M); + M = AI-CI; Clean(M, 0.000000001); Print(M); + + M = A; AI << M; M = AI-A; Clean(M, 0.000000001); Print(M); + C = B; BI << C; M = BI-B; Clean(M, 0.000000001); Print(M); + } + + { + Tracer et1("Stage 5"); + SymmetricMatrix A(4), B(4); + A << 5 + << 1 << 4 + << 2 << 1 << 6 + << 1 << 0 << 1 << 7; + B << 8 + << 1 << 5 + << 1 << 0 << 9 + << 2 << 1 << 0 << 6; + LowerTriangularMatrix AB = Cholesky(A) * Cholesky(B); + Matrix M = Cholesky(A) * B * Cholesky(A).t() - AB*AB.t(); + Clean(M, 0.000000001); Print(M); + M = A * Cholesky(B); M = M * M.t() - A * B * A; + Clean(M, 0.000000001); Print(M); + } + + { + Tracer et1("Stage 6"); + int N=49; + int i; + SymmetricBandMatrix S(N,1); + Matrix B(N,N+1); B=0; + for (i=1;i<=N;i++) { S(i,i)=1; B(i,i)=1; B(i,i+1)=-1; } + for (i=1;ij) A(i,j) = 0; else if (i==j) A(i,j) = 21-i; else A(i,j) = -1; } + A = A.t(); + SymmetricMatrix S1; S1 << A.t() * A; + SymmetricMatrix S2; S2 << A * A.t(); + DiagonalMatrix D; Matrix U; Matrix V; + DiagonalMatrix I(A.Ncols()); + I=1.0; + SVD(A,D,U,V); CheckIsSorted(D); + Matrix SU = U.t() * U - I; Clean(SU,0.000000001); Print(SU); + Matrix SV = V.t() * V - I; Clean(SV,0.000000001); Print(SV); + Matrix B = U * D * V.t() - A; Clean(B,0.000000001); Print(B); + for (i=1; i<=20; i++) D(i) -= sqrt((22.0-i)*(21.0-i)); + Clean(D,0.000000001); Print(D); + Jacobi(S1, D, V); CheckIsSorted(D, true); + V = S1 - V * D * V.t(); Clean(V,0.000000001); Print(V); + D = D.Reverse(); + for (i=1; i<=20; i++) D(i) -= (22-i)*(21-i); + Clean(D,0.000000001); Print(D); + Jacobi(S2, D, V); CheckIsSorted(D, true); + V = S2 - V * D * V.t(); Clean(V,0.000000001); Print(V); + D = D.Reverse(); + for (i=1; i<=20; i++) D(i) -= (22-i)*(21-i); + Clean(D,0.000000001); Print(D); + + EigenValues(S1, D, V); CheckIsSorted(D, true); + V = S1 - V * D * V.t(); Clean(V,0.000000001); Print(V); + for (i=1; i<=20; i++) D(i) -= (i+1)*i; + Clean(D,0.000000001); Print(D); + EigenValues(S2, D, V); CheckIsSorted(D, true); + V = S2 - V * D * V.t(); Clean(V,0.000000001); Print(V); + for (i=2; i<=21; i++) D(i) -= (i-1)*i; + Clean(D,0.000000001); Print(D); + + EigenValues(S1, D); CheckIsSorted(D, true); + for (i=1; i<=20; i++) D(i) -= (i+1)*i; + Clean(D,0.000000001); Print(D); + EigenValues(S2, D); CheckIsSorted(D, true); + for (i=2; i<=21; i++) D(i) -= (i-1)*i; + Clean(D,0.000000001); Print(D); + } + + { + Tracer et1("Stage 3"); + Matrix A(30,30); + int i,j; + for (i=1; i<=30; i++) for (j=1; j<=30; j++) + { if (i>j) A(i,j) = 0; else if (i==j) A(i,j) = 1; else A(i,j) = -1; } + Real d1 = A.LogDeterminant().Value(); + DiagonalMatrix D; Matrix U; Matrix V; + DiagonalMatrix I(A.Ncols()); + I=1.0; + SVD(A,D,U,V); CheckIsSorted(D); + Matrix SU = U.t() * U - I; Clean(SU,0.000000001); Print(SU); + Matrix SV = V.t() * V - I; Clean(SV,0.000000001); Print(SV); + Real d2 = D.LogDeterminant().Value(); + Matrix B = U * D * V.t() - A; Clean(B,0.000000001); Print(B); + Real d3 = D.LogDeterminant().Value(); + ColumnVector Test(3); + Test(1) = d1 - 1; Test(2) = d2 - 1; Test(3) = d3 - 1; + Clean(Test,0.00000001); Print(Test); // only 8 decimal figures + A.ReSize(2,2); + Real a = 1.5; Real b = 2; Real c = 2 * (a*a + b*b); + A << a << b << a << b; + I.ReSize(2); I=1; + SVD(A,D,U,V); CheckIsSorted(D); + SU = U.t() * U - I; Clean(SU,0.000000001); Print(SU); + SV = V.t() * V - I; Clean(SV,0.000000001); Print(SV); + B = U * D * V.t() - A; Clean(B,0.000000001); Print(B); + D = D*D; SortDescending(D); + DiagonalMatrix D50(2); D50 << c << 0; D = D - D50; + Clean(D,0.000000001); + Print(D); + A << a << a << b << b; + SVD(A,D,U,V); CheckIsSorted(D); + SU = U.t() * U - I; Clean(SU,0.000000001); Print(SU); + SV = V.t() * V - I; Clean(SV,0.000000001); Print(SV); + B = U * D * V.t() - A; Clean(B,0.000000001); Print(B); + D = D*D; SortDescending(D); + D = D - D50; + Clean(D,0.000000001); + Print(D); + } + + { + Tracer et1("Stage 4"); + + // test for bug found by Olof Runborg, + // Department of Numerical Analysis and Computer Science (NADA), + // KTH, Stockholm + + Matrix A(22,20); + + A = 0; + + int a=1; + + A(a+0,a+2) = 1; A(a+0,a+18) = -1; + A(a+1,a+9) = 1; A(a+1,a+12) = -1; + A(a+2,a+11) = 1; A(a+2,a+12) = -1; + A(a+3,a+10) = 1; A(a+3,a+19) = -1; + A(a+4,a+16) = 1; A(a+4,a+19) = -1; + A(a+5,a+17) = 1; A(a+5,a+18) = -1; + A(a+6,a+10) = 1; A(a+6,a+4) = -1; + A(a+7,a+3) = 1; A(a+7,a+2) = -1; + A(a+8,a+14) = 1; A(a+8,a+15) = -1; + A(a+9,a+13) = 1; A(a+9,a+16) = -1; + A(a+10,a+8) = 1; A(a+10,a+9) = -1; + A(a+11,a+1) = 1; A(a+11,a+15) = -1; + A(a+12,a+16) = 1; A(a+12,a+4) = -1; + A(a+13,a+6) = 1; A(a+13,a+9) = -1; + A(a+14,a+5) = 1; A(a+14,a+4) = -1; + A(a+15,a+0) = 1; A(a+15,a+1) = -1; + A(a+16,a+14) = 1; A(a+16,a+0) = -1; + A(a+17,a+7) = 1; A(a+17,a+6) = -1; + A(a+18,a+13) = 1; A(a+18,a+5) = -1; + A(a+19,a+7) = 1; A(a+19,a+8) = -1; + A(a+20,a+17) = 1; A(a+20,a+3) = -1; + A(a+21,a+6) = 1; A(a+21,a+11) = -1; + + + Matrix U, V; DiagonalMatrix S; + + SVD(A, S, U, V, true, true); CheckIsSorted(S); + + DiagonalMatrix D(20); D = 1; + + Matrix tmp = U.t() * U - D; + Clean(tmp,0.000000001); Print(tmp); + + tmp = V.t() * V - D; + Clean(tmp,0.000000001); Print(tmp); + + tmp = U * S * V.t() - A ; + Clean(tmp,0.000000001); Print(tmp); + + } + + { + Tracer et1("Stage 5"); + Matrix A(10,10); + + A.Row(1) << 1.00 << 0.07 << 0.05 << 0.00 << 0.06 + << 0.09 << 0.03 << 0.02 << 0.02 << -0.03; + A.Row(2) << 0.07 << 1.00 << 0.05 << 0.05 << -0.03 + << 0.07 << 0.00 << 0.07 << 0.00 << 0.02; + A.Row(3) << 0.05 << 0.05 << 1.00 << 0.05 << 0.02 + << 0.01 << -0.05 << 0.04 << 0.05 << -0.03; + A.Row(4) << 0.00 << 0.05 << 0.05 << 1.00 << -0.05 + << 0.04 << 0.01 << 0.02 << -0.05 << 0.00; + A.Row(5) << 0.06 << -0.03 << 0.02 << -0.05 << 1.00 + << -0.03 << 0.02 << -0.02 << 0.04 << 0.00; + A.Row(6) << 0.09 << 0.07 << 0.01 << 0.04 << -0.03 + << 1.00 << -0.06 << 0.08 << -0.02 << -0.10; + A.Row(7) << 0.03 << 0.00 << -0.05 << 0.01 << 0.02 + << -0.06 << 1.00 << 0.09 << 0.12 << -0.03; + A.Row(8) << 0.02 << 0.07 << 0.04 << 0.02 << -0.02 + << 0.08 << 0.09 << 1.00 << 0.00 << -0.02; + A.Row(9) << 0.02 << 0.00 << 0.05 << -0.05 << 0.04 + << -0.02 << 0.12 << 0.00 << 1.00 << 0.02; + A.Row(10) << -0.03 << 0.02 << -0.03 << 0.00 << 0.00 + << -0.10 << -0.03 << -0.02 << 0.02 << 1.00; + + SymmetricMatrix AS; AS << A; + Matrix V; DiagonalMatrix D, D1; + ColumnVector Check(6); + EigenValues(AS,D,V); CheckIsSorted(D, true); + Check(1) = MaximumAbsoluteValue(A - V * D * V.t()); + DiagonalMatrix I(10); I = 1; + Check(2) = MaximumAbsoluteValue(V * V.t() - I); + Check(3) = MaximumAbsoluteValue(V.t() * V - I); + + EigenValues(AS, D1); CheckIsSorted(D1, true); + D -= D1; + Clean(D,0.000000001); Print(D); + + Jacobi(AS,D,V); + Check(4) = MaximumAbsoluteValue(A - V * D * V.t()); + Check(5) = MaximumAbsoluteValue(V * V.t() - I); + Check(6) = MaximumAbsoluteValue(V.t() * V - I); + + SortAscending(D); + D -= D1; + Clean(D,0.000000001); Print(D); + + Clean(Check,0.000000001); Print(Check); + + // Check loading rows + + SymmetricMatrix B(10); + + B.Row(1) << 1.00; + B.Row(2) << 0.07 << 1.00; + B.Row(3) << 0.05 << 0.05 << 1.00; + B.Row(4) << 0.00 << 0.05 << 0.05 << 1.00; + B.Row(5) << 0.06 << -0.03 << 0.02 << -0.05 << 1.00; + B.Row(6) << 0.09 << 0.07 << 0.01 << 0.04 << -0.03 + << 1.00; + B.Row(7) << 0.03 << 0.00 << -0.05 << 0.01 << 0.02 + << -0.06 << 1.00; + B.Row(8) << 0.02 << 0.07 << 0.04 << 0.02 << -0.02 + << 0.08 << 0.09 << 1.00; + B.Row(9) << 0.02 << 0.00 << 0.05 << -0.05 << 0.04 + << -0.02 << 0.12 << 0.00 << 1.00; + B.Row(10) << -0.03 << 0.02 << -0.03 << 0.00 << 0.00 + << -0.10 << -0.03 << -0.02 << 0.02 << 1.00; + + B -= AS; Print(B); + + } + + { + Tracer et1("Stage 6"); + // badly scaled matrix + Matrix A(9,9); + + A.Row(1) << 1.13324e+012 << 3.68788e+011 << 3.35163e+009 + << 3.50193e+011 << 1.25335e+011 << 1.02212e+009 + << 3.16602e+009 << 1.02418e+009 << 9.42959e+006; + A.Row(2) << 3.68788e+011 << 1.67128e+011 << 1.27449e+009 + << 1.25335e+011 << 6.05413e+010 << 4.34573e+008 + << 1.02418e+009 << 4.69192e+008 << 3.61098e+006; + A.Row(3) << 3.35163e+009 << 1.27449e+009 << 1.25571e+007 + << 1.02212e+009 << 4.34573e+008 << 3.69769e+006 + << 9.42959e+006 << 3.61098e+006 << 3.59450e+004; + A.Row(4) << 3.50193e+011 << 1.25335e+011 << 1.02212e+009 + << 1.43514e+011 << 5.42310e+010 << 4.15822e+008 + << 1.23068e+009 << 4.31545e+008 << 3.58714e+006; + A.Row(5) << 1.25335e+011 << 6.05413e+010 << 4.34573e+008 + << 5.42310e+010 << 2.76601e+010 << 1.89102e+008 + << 4.31545e+008 << 2.09778e+008 << 1.51083e+006; + A.Row(6) << 1.02212e+009 << 4.34573e+008 << 3.69769e+006 + << 4.15822e+008 << 1.89102e+008 << 1.47143e+006 + << 3.58714e+006 << 1.51083e+006 << 1.30165e+004; + A.Row(7) << 3.16602e+009 << 1.02418e+009 << 9.42959e+006 + << 1.23068e+009 << 4.31545e+008 << 3.58714e+006 + << 1.12335e+007 << 3.54778e+006 << 3.34311e+004; + A.Row(8) << 1.02418e+009 << 4.69192e+008 << 3.61098e+006 + << 4.31545e+008 << 2.09778e+008 << 1.51083e+006 + << 3.54778e+006 << 1.62552e+006 << 1.25885e+004; + A.Row(9) << 9.42959e+006 << 3.61098e+006 << 3.59450e+004 + << 3.58714e+006 << 1.51083e+006 << 1.30165e+004 + << 3.34311e+004 << 1.25885e+004 << 1.28000e+002; + + + SymmetricMatrix AS; AS << A; + Matrix V; DiagonalMatrix D, D1; + ColumnVector Check(6); + EigenValues(AS,D,V); CheckIsSorted(D, true); + Check(1) = MaximumAbsoluteValue(A - V * D * V.t()) / 100000; + DiagonalMatrix I(9); I = 1; + Check(2) = MaximumAbsoluteValue(V * V.t() - I); + Check(3) = MaximumAbsoluteValue(V.t() * V - I); + + EigenValues(AS, D1); + D -= D1; + Clean(D,0.001); Print(D); + + Jacobi(AS,D,V); + Check(4) = MaximumAbsoluteValue(A - V * D * V.t()) / 100000; + Check(5) = MaximumAbsoluteValue(V * V.t() - I); + Check(6) = MaximumAbsoluteValue(V.t() * V - I); + + SortAscending(D); + D -= D1; + Clean(D,0.001); Print(D); + + Clean(Check,0.0000001); Print(Check); + } + + { + Tracer et1("Stage 7"); + // matrix with all singular values close to 1 + Matrix A(8,8); + A.Row(1)<<-0.4343<<-0.0445<<-0.4582<<-0.1612<<-0.3191<<-0.6784<<0.1068<<0; + A.Row(2)<<0.5791<<0.5517<<0.2575<<-0.1055<<-0.0437<<-0.5282<<0.0442<<0; + A.Row(3)<<0.5709<<-0.5179<<-0.3275<<0.2598<<-0.196<<-0.1451<<-0.4143<<0; + A.Row(4)<<0.2785<<-0.5258<<0.1251<<-0.4382<<0.0514<<-0.0446<<0.6586<<0; + A.Row(5)<<0.2654<<0.3736<<-0.7436<<-0.0122<<0.0376<<0.3465<<0.3397<<0; + A.Row(6)<<0.0173<<-0.0056<<-0.1903<<-0.7027<<0.4863<<-0.0199<<-0.4825<<0; + A.Row(7)<<0.0434<<0.0966<<0.1083<<-0.4576<<-0.7857<<0.3425<<-0.1818<<0; + A.Row(8)<<0.0<<0.0<<0.0<<0.0<<0.0<<0.0<<0.0<<-1.0; + Matrix U,V; DiagonalMatrix D; + SVD(A,D,U,V); CheckIsSorted(D); + Matrix B = U * D * V.t() - A; Clean(B,0.000000001); Print(B); + DiagonalMatrix I(8); I = 1; D -= I; Clean(D,0.0001); Print(D); + U *= U.t(); U -= I; Clean(U,0.000000001); Print(U); + V *= V.t(); V -= I; Clean(V,0.000000001); Print(V); + + } + + { + Tracer et1("Stage 8"); + // check SortSV functions + + Matrix A(15, 10); + int i, j; + for (i = 1; i <= 15; ++i) for (j = 1; j <= 10; ++j) + A(i, j) = i + j / 1000.0; + DiagonalMatrix D(10); + D << 0.2 << 0.5 << 0.1 << 0.7 << 0.8 << 0.3 << 0.4 << 0.7 << 0.9 << 0.6; + Matrix U = A; Matrix V = 10 - 2 * A; + Matrix Prod = U * D * V.t(); + + DiagonalMatrix D2 = D; SortDescending(D2); + DiagonalMatrix D1 = D; SortSV(D1, U, V); Matrix X = D1 - D2; Print(X); + X = Prod - U * D1 * V.t(); Clean(X,0.000000001); Print(X); + U = A; V = 10 - 2 * A; + D1 = D; SortSV(D1, U); X = D1 - D2; Print(X); + D1 = D; SortSV(D1, V); X = D1 - D2; Print(X); + X = Prod - U * D1 * V.t(); Clean(X,0.000000001); Print(X); + + D2 = D; SortAscending(D2); + U = A; V = 10 - 2 * A; + D1 = D; SortSV(D1, U, V, true); X = D1 - D2; Print(X); + X = Prod - U * D1 * V.t(); Clean(X,0.000000001); Print(X); + U = A; V = 10 - 2 * A; + D1 = D; SortSV(D1, U, true); X = D1 - D2; Print(X); + D1 = D; SortSV(D1, V, true); X = D1 - D2; Print(X); + X = Prod - U * D1 * V.t(); Clean(X,0.000000001); Print(X); + } + + { + Tracer et1("Stage 9"); + // Tom William's example + Matrix A(10,10); + Matrix U; + Matrix V; + DiagonalMatrix Sigma; + Real myVals[] = + { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, + 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, + 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, + }; + + A << myVals; + SVD(A, Sigma, U, V); CheckIsSorted(Sigma); + A -= U * Sigma * V.t(); + Clean(A, 0.000000001); Print(A); + } + + { + Tracer et1("Stage 10"); + // 2x2 evalue test + SymmetricMatrix A(2); DiagonalMatrix D; Matrix V; + Real a[] = {0.616556, 0.61544, 0.716556}; + A << a; + EigenValues(A,D,V); + Matrix X = V * D * V.t() - A; + Clean(X, 0.000000001); Print(X); + Matrix Y = V * V.t() - IdentityMatrix(2); + Clean(Y, 0.000000001); Print(Y); + D.cleanup(); V.cleanup(); + Jacobi(A,D,V); + X = V * D * V.t() - A; + Clean(X, 0.000000001); Print(X); + Y = V * V.t() - IdentityMatrix(2); + Clean(Y, 0.000000001); Print(Y); + + } + + + +} + + +///@} diff --git a/extern/newmat/tmtf.cpp b/extern/newmat/tmtf.cpp new file mode 100644 index 00000000..57d21c20 --- /dev/null +++ b/extern/newmat/tmtf.cpp @@ -0,0 +1,430 @@ +/// \ingroup newmat +///@{ + +/// \file tmtf.cpp +/// Part of matrix library test program. + + +//#define WANT_STREAM +#define WANT_MATH + +#include "include.h" + +#include "newmatap.h" + +//#include "newmatio.h" + +#include "tmt.h" + +#ifdef use_namespace +using namespace NEWMAT; +#endif + + + +static void SlowFT(const ColumnVector& a, const ColumnVector&b, + ColumnVector& x, ColumnVector& y) +{ + int n = a.Nrows(); + x.ReSize(n); y.ReSize(n); + Real f = 6.2831853071795864769/n; + for (int j=1; j<=n; j++) + { + Real sumx = 0.0; Real sumy = 0.0; + for (int k=1; k<=n; k++) + { + Real theta = - (j-1) * (k-1) * f; + Real c = cos(theta); Real s = sin(theta); + sumx += c * a(k) - s * b(k); sumy += s * a(k) + c * b(k); + } + x(j) = sumx; y(j) = sumy; + } +} + +static void SlowDTT_II(const ColumnVector& a, ColumnVector& c, ColumnVector& s) +{ + int n = a.Nrows(); c.ReSize(n); s.ReSize(n); + Real f = 6.2831853071795864769 / (4*n); + int k; + + for (k=1; k<=n; k++) + { + Real sum = 0.0; + const int k1 = k-1; // otherwise Visual C++ 5 fails + for (int j=1; j<=n; j++) sum += cos(k1 * (2*j-1) * f) * a(j); + c(k) = sum; + } + + for (k=1; k<=n; k++) + { + Real sum = 0.0; + for (int j=1; j<=n; j++) sum += sin(k * (2*j-1) * f) * a(j); + s(k) = sum; + } +} + +static void SlowDTT(const ColumnVector& a, ColumnVector& c, ColumnVector& s) +{ + int n1 = a.Nrows(); int n = n1 - 1; + c.ReSize(n1); s.ReSize(n1); + Real f = 6.2831853071795864769 / (2*n); + int k; + + int sign = 1; + for (k=1; k<=n1; k++) + { + Real sum = 0.0; + for (int j=2; j<=n; j++) sum += cos((j-1) * (k-1) * f) * a(j); + c(k) = sum + (a(1) + sign * a(n1)) / 2.0; + sign = -sign; + } + + for (k=2; k<=n; k++) + { + Real sum = 0.0; + for (int j=2; j<=n; j++) sum += sin((j-1) * (k-1) * f) * a(j); + s(k) = sum; + } + s(1) = s(n1) = 0; +} + +void SlowFT2(const Matrix& U, const Matrix& V, Matrix& X, Matrix& Y) +{ + Tracer trace("SlowFT2"); + int m = U.Nrows(); int n = U.Ncols(); + if (m != V.Nrows() || n != V.Ncols() || m == 0 || n == 0) + Throw(ProgramException("Matrix dimensions unequal or zero", U, V)); + X.ReSize(U); Y.ReSize(V); + const Real pi2 = atan(1.0) * 8.0; + for (int i = 0; i < m; ++i) for (int j = 0; j < n; ++j) + { + Real sumr = 0.0, sumi = 0.0; + for (int k = 0; k < m; ++k) for (int l = 0; l < n; ++l) + { + Real a = -pi2 * ( (Real)k * (Real)i / (Real)m + + (Real)j * (Real)l / (Real)n ); + Real cs = cos(a); Real sn = sin(a); + sumr += cs * U(k+1,l+1) - sn * V(k+1,l+1); + sumi += cs * V(k+1,l+1) + sn * U(k+1,l+1); + } + X(i+1,j+1) = sumr; Y(i+1,j+1) = sumi; + } +} + + +static void test(int n) +{ + Tracer et("Test FFT"); + MultWithCarry mwc; + + ColumnVector A(n), B(n), X, Y; + for (int i=0; i q) ? p : q; } + +static int my_min(int p, int q) { return (p < q) ? p : q; } + + +void BandFunctions(int l1, int u1, int l2, int u2) +{ + int i, j; + BandMatrix BM1(20, l1, u1); BM1 = 999999.0; + for (i = 1; i <= 20; ++i) for (j = 1; j <= 20; ++j) + if (i - j <= l1 && i - j >= -u1) BM1(i, j) = 100 * i + j; + + BandMatrix BM2 = BM1; Matrix M = BM2 - BM1; Print(M); + + BM2.ReSize(20, l2, u2); BM2 = 777777.0; + for (i = 1; i <= 20; ++i) for (j = 1; j <= 20; ++j) + if (i - j <= l2 && i - j >= -u2) BM2(i, j) = (100 * i + j) * 11; + + BandMatrix BMA = BM1 + BM2, BMS = BM1 - BM2, BMSP = SP(BM1, BM2), + BMM = BM1 * BM2, BMN = -BM1; + + Matrix M1(20,20); M1 = 0; + for (i = 1; i <= 20; ++i) for (j = 1; j <= 20; ++j) + if (i - j <= l1 && i - j >= -u1) M1(i, j) = 100 * i + j; + + Matrix M2(20,20); M2 = 0; + for (i = 1; i <= 20; ++i) for (j = 1; j <= 20; ++j) + if (i - j <= l2 && i - j >= -u2) M2(i, j) = (100 * i + j) * 11; + + Matrix MA = M1 + M2, MS = M1 - M2, MSP = SP(M1, M2), MM = M1 * M2, MN = -M1; + MA -= BMA; MS -= BMS; MSP -= BMSP; MM -= BMM; MN -= BMN; + Print(MA); Print(MS); Print(MSP); Print(MM); Print(MN); + + Matrix Test(7, 2); + Test(1,1) = BM1.BandWidth().Lower() - l1; + Test(1,2) = BM1.BandWidth().Upper() - u1; + Test(2,1) = BM2.BandWidth().Lower() - l2; + Test(2,2) = BM2.BandWidth().Upper() - u2; + Test(3,1) = BMA.BandWidth().Lower() - my_max(l1,l2); + Test(3,2) = BMA.BandWidth().Upper() - my_max(u1,u2); + Test(4,1) = BMS.BandWidth().Lower() - my_max(l1,l2); + Test(4,2) = BMS.BandWidth().Upper() - my_max(u1,u2); + Test(5,1) = BMSP.BandWidth().Lower() - my_min(l1,l2); + Test(5,2) = BMSP.BandWidth().Upper() - my_min(u1,u2); + Test(6,1) = BMM.BandWidth().Lower() - (l1 + l2); + Test(6,2) = BMM.BandWidth().Upper() - (u1 + u2); + Test(7,1) = BMN.BandWidth().Lower() - l1; + Test(7,2) = BMN.BandWidth().Upper() - u1; + Print(Test); + + // test element function + BandMatrix BM1E(20, l1, u1); BM1E = 999999.0; + for (i = 1; i <= 20; ++i) for (j = 1; j <= 20; ++j) + if (i - j <= l1 && i - j >= -u1) BM1E.element(i-1, j-1) = 100 * i + j; + BandMatrix BM2E = BM1E; BM2E.ReSize(BM2); BM2E = 777777.0; + for (i = 1; i <= 20; ++i) for (j = 1; j <= 20; ++j) + if (i - j <= l2 && i - j >= -u2) + BM2E.element(i-1, j-1) = (100 * i + j) * 11; + M1 = BM1E - BM1; Print(M1); + M2 = BM2E - BM2; Print(M2); + + // test element function with constant + BM1E = 444444.04; BM2E = 555555.0; + const BandMatrix BM1C = BM1, BM2C = BM2; + for (i = 1; i <= 20; ++i) for (j = 1; j <= 20; ++j) + if (i - j <= l1 && i - j >= -u1) + BM1E.element(i-1, j-1) = BM1C.element(i-1, j-1); + for (i = 1; i <= 20; ++i) for (j = 1; j <= 20; ++j) + if (i - j <= l2 && i - j >= -u2) + BM2E.element(i-1, j-1) = BM2C.element(i-1, j-1); + M1 = BM1E - BM1; Print(M1); + M2 = BM2E - BM2; Print(M2); + + // test subscript function with constant + BM1E = 444444.04; BM2E = 555555.0; + for (i = 1; i <= 20; ++i) for (j = 1; j <= 20; ++j) + if (i - j <= l1 && i - j >= -u1) BM1E(i, j) = BM1C(i, j); + for (i = 1; i <= 20; ++i) for (j = 1; j <= 20; ++j) + if (i - j <= l2 && i - j >= -u2) BM2E(i, j) = BM2C(i, j); + M1 = BM1E - BM1; Print(M1); + M2 = BM2E - BM2; Print(M2); +} + +void LowerBandFunctions(int l1, int l2) +{ + int i, j; + LowerBandMatrix BM1(20, l1); BM1 = 999999.0; + for (i = 1; i <= 20; ++i) for (j = 1; j <= i; ++j) + if (i - j <= l1) BM1(i, j) = 100 * i + j; + + LowerBandMatrix BM2 = BM1; Matrix M = BM2 - BM1; Print(M); + + BM2.ReSize(20, l2); BM2 = 777777.0; + for (i = 1; i <= 20; ++i) for (j = 1; j <= i; ++j) + if (i - j <= l2) BM2(i, j) = (100 * i + j) * 11; + + LowerBandMatrix BMA = BM1 + BM2, BMS = BM1 - BM2, BMSP = SP(BM1, BM2), + BMM = BM1 * BM2, BMN = -BM1; + + Matrix M1(20,20); M1 = 0; + for (i = 1; i <= 20; ++i) for (j = 1; j <= i; ++j) + if (i - j <= l1) M1(i, j) = 100 * i + j; + + Matrix M2(20,20); M2 = 0; + for (i = 1; i <= 20; ++i) for (j = 1; j <= i; ++j) + if (i - j <= l2) M2(i, j) = (100 * i + j) * 11; + + Matrix MA = M1 + M2, MS = M1 - M2, MSP = SP(M1, M2), MM = M1 * M2, MN = -M1; + MA -= BMA; MS -= BMS; MSP -= BMSP; MM -= BMM; MN -= BMN; + Print(MA); Print(MS); Print(MSP); Print(MM); Print(MN); + + Matrix Test(7, 2); + Test(1,1) = BM1.BandWidth().Lower() - l1; + Test(1,2) = BM1.BandWidth().Upper(); + Test(2,1) = BM2.BandWidth().Lower() - l2; + Test(2,2) = BM2.BandWidth().Upper(); + Test(3,1) = BMA.BandWidth().Lower() - my_max(l1,l2); + Test(3,2) = BMA.BandWidth().Upper(); + Test(4,1) = BMS.BandWidth().Lower() - my_max(l1,l2); + Test(4,2) = BMS.BandWidth().Upper(); + Test(5,1) = BMSP.BandWidth().Lower() - my_min(l1,l2); + Test(5,2) = BMSP.BandWidth().Upper(); + Test(6,1) = BMM.BandWidth().Lower() - (l1 + l2); + Test(6,2) = BMM.BandWidth().Upper(); + Test(7,1) = BMN.BandWidth().Lower() - l1; + Test(7,2) = BMN.BandWidth().Upper(); + Print(Test); + + // test element function + LowerBandMatrix BM1E(20, l1); BM1E = 999999.0; + for (i = 1; i <= 20; ++i) for (j = 1; j <= i; ++j) + if (i - j <= l1) BM1E.element(i-1, j-1) = 100 * i + j; + LowerBandMatrix BM2E = BM1E; BM2E.ReSize(BM2); BM2E = 777777.0; + for (i = 1; i <= 20; ++i) for (j = 1; j <= i; ++j) + if (i - j <= l2) BM2E.element(i-1, j-1) = (100 * i + j) * 11; + M1 = BM1E - BM1; Print(M1); + M2 = BM2E - BM2; Print(M2); + + // test element function with constant + BM1E = 444444.04; BM2E = 555555.0; + const LowerBandMatrix BM1C = BM1, BM2C = BM2; + for (i = 1; i <= 20; ++i) for (j = 1; j <= i; ++j) + if (i - j <= l1) BM1E.element(i-1, j-1) = BM1C.element(i-1, j-1); + for (i = 1; i <= 20; ++i) for (j = 1; j <= i; ++j) + if (i - j <= l2) BM2E.element(i-1, j-1) = BM2C.element(i-1, j-1); + M1 = BM1E - BM1; Print(M1); + M2 = BM2E - BM2; Print(M2); + + // test subscript function with constant + BM1E = 444444.04; BM2E = 555555.0; + for (i = 1; i <= 20; ++i) for (j = 1; j <= i; ++j) + if (i - j <= l1) BM1E(i, j) = BM1C(i, j); + for (i = 1; i <= 20; ++i) for (j = 1; j <= i; ++j) + if (i - j <= l2) BM2E(i, j) = BM2C(i, j); + M1 = BM1E - BM1; Print(M1); + M2 = BM2E - BM2; Print(M2); +} + +void UpperBandFunctions(int u1, int u2) +{ + int i, j; + UpperBandMatrix BM1(20, u1); BM1 = 999999.0; + for (i = 1; i <= 20; ++i) for (j = i; j <= 20; ++j) + if (i - j >= -u1) BM1(i, j) = 100 * i + j; + + UpperBandMatrix BM2 = BM1; Matrix M = BM2 - BM1; Print(M); + + BM2.ReSize(20, u2); BM2 = 777777.0; + for (i = 1; i <= 20; ++i) for (j = i; j <= 20; ++j) + if (i - j >= -u2) BM2(i, j) = (100 * i + j) * 11; + + UpperBandMatrix BMA = BM1 + BM2, BMS = BM1 - BM2, BMSP = SP(BM1, BM2), + BMM = BM1 * BM2, BMN = -BM1; + + Matrix M1(20,20); M1 = 0; + for (i = 1; i <= 20; ++i) for (j = i; j <= 20; ++j) + if (i - j >= -u1) M1(i, j) = 100 * i + j; + + Matrix M2(20,20); M2 = 0; + for (i = 1; i <= 20; ++i) for (j = i; j <= 20; ++j) + if (i - j >= -u2) M2(i, j) = (100 * i + j) * 11; + + Matrix MA = M1 + M2, MS = M1 - M2, MSP = SP(M1, M2), MM = M1 * M2, MN = -M1; + MA -= BMA; MS -= BMS; MSP -= BMSP; MM -= BMM; MN -= BMN; + Print(MA); Print(MS); Print(MSP); Print(MM); Print(MN); + + Matrix Test(7, 2); + Test(1,1) = BM1.BandWidth().Lower(); + Test(1,2) = BM1.BandWidth().Upper() - u1; + Test(2,1) = BM2.BandWidth().Lower(); + Test(2,2) = BM2.BandWidth().Upper() - u2; + Test(3,1) = BMA.BandWidth().Lower(); + Test(3,2) = BMA.BandWidth().Upper() - my_max(u1,u2); + Test(4,1) = BMS.BandWidth().Lower(); + Test(4,2) = BMS.BandWidth().Upper() - my_max(u1,u2); + Test(5,1) = BMSP.BandWidth().Lower(); + Test(5,2) = BMSP.BandWidth().Upper() - my_min(u1,u2); + Test(6,1) = BMM.BandWidth().Lower(); + Test(6,2) = BMM.BandWidth().Upper() - (u1 + u2); + Test(7,1) = BMN.BandWidth().Lower(); + Test(7,2) = BMN.BandWidth().Upper() - u1; + Print(Test); + + // test element function + UpperBandMatrix BM1E(20, u1); BM1E = 999999.0; + for (i = 1; i <= 20; ++i) for (j = i; j <= 20; ++j) + if (i - j >= -u1) BM1E.element(i-1, j-1) = 100 * i + j; + UpperBandMatrix BM2E = BM1E; BM2E.ReSize(BM2); BM2E = 777777.0; + for (i = 1; i <= 20; ++i) for (j = i; j <= 20; ++j) + if (i - j >= -u2) BM2E.element(i-1, j-1) = (100 * i + j) * 11; + M1 = BM1E - BM1; Print(M1); + M2 = BM2E - BM2; Print(M2); + + // test element function with constant + BM1E = 444444.04; BM2E = 555555.0; + const UpperBandMatrix BM1C = BM1, BM2C = BM2; + for (i = 1; i <= 20; ++i) for (j = i; j <= 20; ++j) + if (i - j >= -u1) BM1E.element(i-1, j-1) = BM1C.element(i-1, j-1); + for (i = 1; i <= 20; ++i) for (j = i; j <= 20; ++j) + if (i - j >= -u2) BM2E.element(i-1, j-1) = BM2C.element(i-1, j-1); + M1 = BM1E - BM1; Print(M1); + M2 = BM2E - BM2; Print(M2); + + // test subscript function with constant + BM1E = 444444.04; BM2E = 555555.0; + for (i = 1; i <= 20; ++i) for (j = i; j <= 20; ++j) + if (i - j >= -u1) BM1E(i, j) = BM1C(i, j); + for (i = 1; i <= 20; ++i) for (j = i; j <= 20; ++j) + if (i - j >= -u2) BM2E(i, j) = BM2C(i, j); + M1 = BM1E - BM1; Print(M1); + M2 = BM2E - BM2; Print(M2); +} + +void SymmetricBandFunctions(int l1, int l2) +{ + int i, j; + SymmetricBandMatrix BM1(20, l1); BM1 = 999999.0; + for (i = 1; i <= 20; ++i) for (j = 1; j <= i; ++j) + if (i - j <= l1) BM1(i, j) = 100 * i + j; + + SymmetricBandMatrix BM2 = BM1; Matrix M = BM2 - BM1; Print(M); + + BM2.ReSize(20, l2); BM2 = 777777.0; + for (i = 1; i <= 20; ++i) for (j = 1; j <= i; ++j) + if (i - j <= l2) BM2(i, j) = (100 * i + j) * 11; + + SymmetricBandMatrix BMA = BM1 + BM2, BMS = BM1 - BM2, BMSP = SP(BM1, BM2), + BMN = -BM1; + BandMatrix BMM = BM1 * BM2; + + SymmetricMatrix M1(20); M1 = 0; + for (i = 1; i <= 20; ++i) for (j = 1; j <= i; ++j) + if (i - j <= l1) M1(i, j) = 100 * i + j; + + SymmetricMatrix M2(20); M2 = 0; + for (i = 1; i <= 20; ++i) for (j = 1; j <= i; ++j) + if (i - j <= l2) M2(i, j) = (100 * i + j) * 11; + + SymmetricMatrix MA = M1 + M2, MS = M1 - M2, MSP = SP(M1, M2), MN = -M1; + Matrix MM = M1 * M2; + MA -= BMA; MS -= BMS; MSP -= BMSP; MM -= BMM; MN -= BMN; + Print(MA); Print(MS); Print(MSP); Print(MM); Print(MN); + + Matrix Test(7, 2); + Test(1,1) = BM1.BandWidth().Lower() - l1; + Test(1,2) = BM1.BandWidth().Upper() - l1; + Test(2,1) = BM2.BandWidth().Lower() - l2; + Test(2,2) = BM2.BandWidth().Upper() - l2; + Test(3,1) = BMA.BandWidth().Lower() - my_max(l1,l2); + Test(3,2) = BMA.BandWidth().Upper() - my_max(l1,l2); + Test(4,1) = BMS.BandWidth().Lower() - my_max(l1,l2); + Test(4,2) = BMS.BandWidth().Upper() - my_max(l1,l2); + Test(5,1) = BMSP.BandWidth().Lower() - my_min(l1,l2); + Test(5,2) = BMSP.BandWidth().Upper() - my_min(l1,l2); + Test(6,1) = BMM.BandWidth().Lower() - (l1 + l2); + Test(6,2) = BMM.BandWidth().Upper() - (l1 + l2); + Test(7,1) = BMN.BandWidth().Lower() - l1; + Test(7,2) = BMN.BandWidth().Upper() - l1; + Print(Test); + + // test element function + SymmetricBandMatrix BM1E(20, l1); BM1E = 999999.0; + for (i = 1; i <= 20; ++i) for (j = 1; j <= i; ++j) + if (i - j <= l1) BM1E.element(i-1, j-1) = 100 * i + j; + SymmetricBandMatrix BM2E = BM1E; BM2E.ReSize(BM2); BM2E = 777777.0; + for (i = 1; i <= 20; ++i) for (j = 1; j <= i; ++j) + if (i - j <= l2) BM2E.element(i-1, j-1) = (100 * i + j) * 11; + M1 = BM1E - BM1; Print(M1); + M2 = BM2E - BM2; Print(M2); + + // reverse subscripts + BM1E = 999999.0; + for (i = 1; i <= 20; ++i) for (j = 1; j <= i; ++j) + if (i - j <= l1) BM1E.element(j-1, i-1) = 100 * i + j; + BM2E = 777777.0; + for (i = 1; i <= 20; ++i) for (j = 1; j <= i; ++j) + if (i - j <= l2) BM2E.element(j-1, i-1) = (100 * i + j) * 11; + M1 = BM1E - BM1; Print(M1); + M2 = BM2E - BM2; Print(M2); + + // test element function with constant + BM1E = 444444.04; BM2E = 555555.0; + const SymmetricBandMatrix BM1C = BM1, BM2C = BM2; + for (i = 1; i <= 20; ++i) for (j = 1; j <= i; ++j) + if (i - j <= l1) BM1E.element(i-1, j-1) = BM1C.element(i-1, j-1); + for (i = 1; i <= 20; ++i) for (j = 1; j <= i; ++j) + if (i - j <= l2) BM2E.element(i-1, j-1) = BM2C.element(i-1, j-1); + M1 = BM1E - BM1; Print(M1); + M2 = BM2E - BM2; Print(M2); + + // reverse subscripts + BM1E = 444444.0; BM2E = 555555.0; + for (i = 1; i <= 20; ++i) for (j = 1; j <= i; ++j) + if (i - j <= l1) BM1E.element(j-1, i-1) = BM1C.element(j-1, i-1); + for (i = 1; i <= 20; ++i) for (j = 1; j <= i; ++j) + if (i - j <= l2) BM2E.element(j-1, i-1) = BM2C.element(j-1, i-1); + M1 = BM1E - BM1; Print(M1); + M2 = BM2E - BM2; Print(M2); + + // test subscript function with constant + BM1E = 444444.0; BM2E = 555555.0; + for (i = 1; i <= 20; ++i) for (j = 1; j <= i; ++j) + if (i - j <= l1) BM1E(i, j) = BM1C(i, j); + for (i = 1; i <= 20; ++i) for (j = 1; j <= i; ++j) + if (i - j <= l2) BM2E(i, j) = BM2C(i, j); + M1 = BM1E - BM1; Print(M1); + M2 = BM2E - BM2; Print(M2); + + // reverse subscripts + BM1E = 444444.0; BM2E = 555555.0; + for (i = 1; i <= 20; ++i) for (j = 1; j <= i; ++j) + if (i - j <= l1) BM1E(j, i) = BM1C(j, i); + for (i = 1; i <= 20; ++i) for (j = 1; j <= i; ++j) + if (i - j <= l2) BM2E(j, i) = BM2C(j, i); + M1 = BM1E - BM1; Print(M1); + M2 = BM2E - BM2; Print(M2); + + // partly reverse subscripts + BM1E = 444444.0; BM2E = 555555.0; + for (i = 1; i <= 20; ++i) for (j = 1; j <= i; ++j) + if (i - j <= l1) BM1E(j, i) = BM1C(i, j); + for (i = 1; i <= 20; ++i) for (j = 1; j <= i; ++j) + if (i - j <= l2) BM2E(j, i) = BM2C(i, j); + M1 = BM1E - BM1; Print(M1); + M2 = BM2E - BM2; Print(M2); + +} + + + +void trymath() +{ +// cout << "\nSeventeenth test of Matrix package\n"; +// cout << "\n"; + Tracer et("Seventeenth test of Matrix package"); + Tracer::PrintTrace(); + + + { + Tracer et1("Stage 1"); + int i, j; + BandMatrix B(8,3,1); + for (i=1; i<=8; i++) for (j=-3; j<=1; j++) + { int k = i+j; if (k>0 && k<=8) B(i,k) = i + k/64.0; } + + IdentityMatrix I(8); BandMatrix B1; B1 = I; + UpperTriangularMatrix UT = I; Print(Matrix(B1-UT)); + Print(Matrix(B * B - B * 2 + I - (B - I) * (B - I))); + Matrix A = B; BandMatrix C; C = B; + Print(Matrix(B * A - C * 2 + I - (A - I) * (B - I))); + + C.ReSize(8,2,2); C = 0.0; C.Inject(B); + Matrix X = A.t(); + B1.ReSize(8,2,2); B1.Inject(X); Print(Matrix(C.t()-B1)); + + Matrix BI = B.i(); A = A.i()-BI; Clean(A,0.000000001); Print(A); + BandLUMatrix BLU = B.t(); + BI = BLU.i(); A = X.i()-BI; Clean(A,0.000000001); Print(A); + X.ReSize(1,1); + X(1,1) = BLU.LogDeterminant().Value()-B.LogDeterminant().Value(); + Clean(X,0.000000001); Print(X); + + UpperBandMatrix U; U << B; LowerBandMatrix L; L << B; + DiagonalMatrix D; D << B; + Print( Matrix(L + (U - D - B)) ); + + + + for (i=1; i<=8; i++) A.Column(i) << B.Column(i); + Print(Matrix(A-B)); + } + { + Tracer et1("Stage 2"); + BandMatrix A(7,2,2); + int i,j; + for (i=1; i<=7; i++) for (j=1; j<=7; j++) + { + int k=i-j; if (k<0) k = -k; + if (k==0) A(i,j)=6; + else if (k==1) A(i,j) = -4; + else if (k==2) A(i,j) = 1; + A(1,1) = A(7,7) = 5; + } + DiagonalMatrix D(7); D = 0.0; A = A - D; + BandLUMatrix B(A); Matrix M = A; + ColumnVector V(6); + V(1) = LogDeterminant(B).Value(); + V(2) = LogDeterminant(A).Value(); + V(3) = LogDeterminant(M).Value(); + V(4) = Determinant(B); + V(5) = Determinant(A); + V(6) = Determinant(M); + V = V / 64 - 1; Clean(V,0.000000001); Print(V); + ColumnVector X(7); + + Real a[] = {1,2,3,4,5,6,7}; + X << a; + M = (M.i()*X).t() - (B.i()*X).t() * 2.0 + (A.i()*X).t(); + Clean(M,0.000000001); Print(M); + + + BandMatrix P(80,2,5); ColumnVector CX(80); + for (i=1; i<=80; i++) for (j=1; j<=80; j++) + { int d = i-j; if (d<=2 && d>=-5) P(i,j) = i + j/100.0; } + for (i=1; i<=80; i++) CX(i) = i*100.0; + Matrix MP = P; + ColumnVector V1 = P.i() * CX; ColumnVector V2 = MP.i() * CX; + V = V1 - V2; Clean(V,0.000000001); Print(V); + + V1 = P * V1; V2 = MP * V2; V = V1 - V2; Clean(V,0.000000001); Print(V); + RowVector XX(1); + XX = LogDeterminant(P).Value() / LogDeterminant(MP).Value() - 1.0; + Clean(XX,0.000000001); Print(XX); + + LowerBandMatrix LP(80,5); + for (i=1; i<=80; i++) for (j=1; j<=80; j++) + { int d = i-j; if (d<=5 && d>=0) LP(i,j) = i + j/100.0; } + MP = LP; + XX.ReSize(4); + XX(1) = LogDeterminant(LP).Value(); + XX(2) = LogDeterminant(MP).Value(); + V1 = LP.i() * CX; V2 = MP.i() * CX; + V = V1 - V2; Clean(V,0.000000001); Print(V); + + UpperBandMatrix UP(80,4); + for (i=1; i<=80; i++) for (j=1; j<=80; j++) + { int d = i-j; if (d<=0 && d>=-4) UP(i,j) = i + j/100.0; } + MP = UP; + XX(3) = LogDeterminant(UP).Value(); + XX(4) = LogDeterminant(MP).Value(); + V1 = UP.i() * CX; V2 = MP.i() * CX; + V = V1 - V2; Clean(V,0.000000001); Print(V); + XX = XX / SumAbsoluteValue(XX) - .25; Clean(XX,0.000000001); Print(XX); + } + + { + Tracer et1("Stage 3"); + SymmetricBandMatrix SA(8,5); + int i,j; + for (i=1; i<=8; i++) for (j=1; j<=8; j++) + if (i-j<=5 && 0<=i-j) SA(i,j) =i + j/128.0; + DiagonalMatrix D(8); D = 10; SA = SA + D; + + Matrix MA1(8,8); Matrix MA2(8,8); + for (i=1; i<=8; i++) + { MA1.Column(i) << SA.Column(i); MA2.Row(i) << SA.Row(i); } + Print(Matrix(MA1-MA2)); + + D = 10; SA = SA.t() + D; MA1 = MA1 + D; + Print(Matrix(MA1-SA)); + + UpperBandMatrix UB(8,3); LowerBandMatrix LB(8,4); + D << SA; UB << SA; LB << SA; + SA = SA * 5.0; D = D * 5.0; LB = LB * 5.0; UB = UB * 5.0; + BandMatrix B = LB - D + UB - SA; Print(Matrix(B)); + + SymmetricBandMatrix A(7,2); A = 100.0; + for (i=1; i<=7; i++) for (j=1; j<=7; j++) + { + int k=i-j; + if (k==0) A(i,j)=6; + else if (k==1) A(i,j) = -4; + else if (k==2) A(i,j) = 1; + A(1,1) = A(7,7) = 5; + } + BandLUMatrix C(A); Matrix M = A; + ColumnVector X(8); + X(1) = LogDeterminant(C).Value() - 64; + X(2) = LogDeterminant(A).Value() - 64; + X(3) = LogDeterminant(M).Value() - 64; + X(4) = SumSquare(M) - SumSquare(A); + X(5) = SumAbsoluteValue(M) - SumAbsoluteValue(A); + X(6) = MaximumAbsoluteValue(M) - MaximumAbsoluteValue(A); + X(7) = Trace(M) - Trace(A); + X(8) = Sum(M) - Sum(A); + Clean(X,0.000000001); Print(X); + + Real a[] = {1,2,3,4,5,6,7}; + X.ReSize(7); + X << a; + X = M.i()*X - C.i()*X * 2 + A.i()*X; + Clean(X,0.000000001); Print(X); + + + LB << A; UB << A; D << A; + BandMatrix XA = LB + (UB - D); + Print(Matrix(XA - A)); + + for (i=1; i<=7; i++) for (j=1; j<=7; j++) + { + int k=i-j; + if (k==0) A(i,j)=6; + else if (k==1) A(i,j) = -4; + else if (k==2) A(i,j) = 1; + A(1,1) = A(7,7) = 5; + } + D = 1; + + M = LB.i() * LB - D; Clean(M,0.000000001); Print(M); + M = UB.i() * UB - D; Clean(M,0.000000001); Print(M); + M = XA.i() * XA - D; Clean(M,0.000000001); Print(M); + Matrix MUB = UB; Matrix MLB = LB; + M = LB.i() * UB - LB.i() * MUB; Clean(M,0.000000001); Print(M); + M = UB.i() * LB - UB.i() * MLB; Clean(M,0.000000001); Print(M); + M = LB.i() * UB - LB.i() * Matrix(UB); Clean(M,0.000000001); Print(M); + M = UB.i() * LB - UB.i() * Matrix(LB); Clean(M,0.000000001); Print(M); + } + + { + // some tests about adding and subtracting band matrices of different + // sizes - check bandwidth of results + Tracer et1("Stage 4"); + + BandFunctions(9, 3, 9, 3); // equal + BandFunctions(4, 7, 4, 7); // equal + BandFunctions(9, 3, 5, 8); // neither < or > + BandFunctions(5, 8, 9, 3); // neither < or > + BandFunctions(9, 8, 5, 3); // > + BandFunctions(3, 5, 8, 9); // < + + LowerBandFunctions(9, 9); // equal + LowerBandFunctions(4, 4); // equal + LowerBandFunctions(9, 5); // > + LowerBandFunctions(3, 8); // < + + UpperBandFunctions(3, 3); // equal + UpperBandFunctions(7, 7); // equal + UpperBandFunctions(8, 3); // > + UpperBandFunctions(5, 9); // < + + SymmetricBandFunctions(9, 9); // equal + SymmetricBandFunctions(4, 4); // equal + SymmetricBandFunctions(9, 5); // > + SymmetricBandFunctions(3, 8); // < + + DiagonalMatrix D(6); D << 2 << 3 << 4.5 << 1.25 << 9.5 << -5; + BandMatrix BD = D; + UpperBandMatrix UBD; UBD = D; + LowerBandMatrix LBD; LBD = D; + SymmetricBandMatrix SBD = D; + Matrix X = BD - D; Print(X); X = UBD - D; Print(X); + X = LBD - D; Print(X); X = SBD - D; Print(X); + Matrix Test(9,2); + Test(1,1) = BD.BandWidth().Lower(); Test(1,2) = BD.BandWidth().Upper(); + Test(2,1) = UBD.BandWidth().Lower(); Test(2,2) = UBD.BandWidth().Upper(); + Test(3,1) = LBD.BandWidth().Lower(); Test(3,2) = LBD.BandWidth().Upper(); + Test(4,1) = SBD.BandWidth().Lower(); Test(4,2) = SBD.BandWidth().Upper(); + + IdentityMatrix I(10); I *= 5; + BD = I; UBD = I; LBD = I; SBD = I; + X = BD - I; Print(X); X = UBD - I; Print(X); + X = LBD - I; Print(X); X = SBD - I; Print(X); + Test(5,1) = BD.BandWidth().Lower(); Test(5,2) = BD.BandWidth().Upper(); + Test(6,1) = UBD.BandWidth().Lower(); Test(6,2) = UBD.BandWidth().Upper(); + Test(7,1) = LBD.BandWidth().Lower(); Test(7,2) = LBD.BandWidth().Upper(); + Test(8,1) = SBD.BandWidth().Lower(); Test(8,2) = SBD.BandWidth().Upper(); + + RowVector RV = D.AsRow(); I.ReSize(6); BandMatrix BI = I; I = 1; + BD = RV.AsDiagonal() + BI; X = BD - D - I; Print(X); + Test(9,1) = BD.BandWidth().Lower(); Test(9,2) = BD.BandWidth().Upper(); + + Print(Test); + } + + { + // various element functions + Tracer et1("Stage 5"); + + int i, j; + Matrix Count(1, 1); Count = 0; // for counting errors + Matrix M(20,30); + for (i = 1; i <= 20; ++i) for (j = 1; j <= 30; ++j) + M(i, j) = 100 * i + j; + const Matrix CM = M; + for (i = 1; i <= 20; ++i) for (j = 1; j <= 30; ++j) + { + if (M(i, j) != CM(i, j)) ++Count(1,1); + if (M(i, j) != CM.element(i-1, j-1)) ++Count(1,1); + if (M(i, j) != M.element(i-1, j-1)) ++Count(1,1); + } + + UpperTriangularMatrix U(20); + for (i = 1; i <= 20; ++i) for (j = i; j <= 20; ++j) + U(i, j) = 100 * i + j; + const UpperTriangularMatrix CU = U; + for (i = 1; i <= 20; ++i) for (j = i; j <= 20; ++j) + { + if (U(i, j) != CU(i, j)) ++Count(1,1); + if (U(i, j) != CU.element(i-1, j-1)) ++Count(1,1); + if (U(i, j) != U.element(i-1, j-1)) ++Count(1,1); + } + + LowerTriangularMatrix L(20); + for (i = 1; i <= 20; ++i) for (j = 1; j <= i; ++j) + L(i, j) = 100 * i + j; + const LowerTriangularMatrix CL = L; + for (i = 1; i <= 20; ++i) for (j = 1; j <= i; ++j) + { + if (L(i, j) != CL(i, j)) ++Count(1,1); + if (L(i, j) != CL.element(i-1, j-1)) ++Count(1,1); + if (L(i, j) != L.element(i-1, j-1)) ++Count(1,1); + } + + SymmetricMatrix S(20); + for (i = 1; i <= 20; ++i) for (j = 1; j <= i; ++j) + S(i, j) = 100 * i + j; + const SymmetricMatrix CS = S; + for (i = 1; i <= 20; ++i) for (j = 1; j <= 20; ++j) + { + if (S(i, j) != CS(i, j)) ++Count(1,1); + if (S(i, j) != CS.element(i-1, j-1)) ++Count(1,1); + if (S(i, j) != S.element(i-1, j-1)) ++Count(1,1); + if (S(i, j) != S(j, i)) ++Count(1,1); + if (S(i, j) != CS(i, j)) ++Count(1,1); + if (S(i, j) != CS.element(i-1, j-1)) ++Count(1,1); + if (S(i, j) != S.element(i-1, j-1)) ++Count(1,1); + } + + DiagonalMatrix D(20); + for (i = 1; i <= 20; ++i) D(i) = 100 * i + i * i; + const DiagonalMatrix CD = D; + for (i = 1; i <= 20; ++i) + { + if (D(i, i) != CD(i, i)) ++Count(1,1); + if (D(i, i) != CD.element(i-1, i-1)) ++Count(1,1); + if (D(i, i) != D.element(i-1, i-1)) ++Count(1,1); + if (D(i, i) != D(i)) ++Count(1,1); + if (D(i) != CD(i)) ++Count(1,1); + if (D(i) != CD.element(i-1)) ++Count(1,1); + if (D(i) != D.element(i-1)) ++Count(1,1); + } + + RowVector R(20); + for (i = 1; i <= 20; ++i) R(i) = 100 * i + i * i; + const RowVector CR = R; + for (i = 1; i <= 20; ++i) + { + if (R(i) != CR(i)) ++Count(1,1); + if (R(i) != CR.element(i-1)) ++Count(1,1); + if (R(i) != R.element(i-1)) ++Count(1,1); + } + + ColumnVector C(20); + for (i = 1; i <= 20; ++i) C(i) = 100 * i + i * i; + const ColumnVector CC = C; + for (i = 1; i <= 20; ++i) + { + if (C(i) != CC(i)) ++Count(1,1); + if (C(i) != CC.element(i-1)) ++Count(1,1); + if (C(i) != C.element(i-1)) ++Count(1,1); + } + + Print(Count); + + } + + { + // resize to another matrix size + Tracer et1("Stage 6"); + + Matrix A(20, 30); A = 3; + Matrix B(3, 4); + B.ReSize(A); B = 6; B -= 2 * A; Print(B); + + A.ReSize(25,25); A = 12; + + UpperTriangularMatrix U(5); + U.ReSize(A); U = 12; U << (U - A); Print(U); + + LowerTriangularMatrix L(5); + L.ReSize(U); L = 12; L << (L - A); Print(L); + + DiagonalMatrix D(5); + D.ReSize(U); D = 12; D << (D - A); Print(D); + + SymmetricMatrix S(5); + S.ReSize(U); S = 12; S << (S - A); Print(S); + + IdentityMatrix I(5); + I.ReSize(U); I = 12; D << (I - A); Print(D); + + A.ReSize(10, 1); A = 17; + ColumnVector C(5); C.ReSize(A); C = 17; C -= A; Print(C); + + A.ReSize(1, 10); A = 15; + RowVector R(5); R.ReSize(A); R = 15; R -= A; Print(R); + + } + + { + // generic matrix and identity matrix + Tracer et1("Stage 7"); + IdentityMatrix I(5); + I *= 4; + GenericMatrix GM = I; + GM /= 2; + DiagonalMatrix D = GM; + Matrix A = GM + 10; + A -= 10; + A -= D; + Print(A); + } + + { + // SP and upper and lower triangular matrices + Tracer et1("Stage 8"); + UpperTriangularMatrix UT(4); + UT << 3 << 7 << 3 << 9 + << 5 << 2 << 6 + << 8 << 0 + << 4; + LowerTriangularMatrix LT; LT.ReSize(UT); + LT << 2 + << 7 << 9 + << 2 << 8 << 6 + << 1 << 0 << 3 << 5; + + DiagonalMatrix D = SP(UT, LT); + DiagonalMatrix D1(4); + D1 << 6 << 45 << 48 << 20; + D -= D1; Print(D); + BandMatrix BM = SP(UT, LT); + Matrix X = BM - D1; Print(X); + RowVector RV(2); + RV(1) = BM.BandWidth().Lower(); + RV(2) = BM.BandWidth().Upper(); + Print(RV); + } + + { + // Helmert multiplies + Tracer et1("Stage 9"); + MultWithCarry MCW; + int i, j; + + IdentityMatrix I(8); + Matrix X = I; + Matrix Y = Helmert_transpose(X); + Matrix H = Helmert(9); H -= Y.t(); Clean(H,0.000000001); Print(H); + Matrix Z = Helmert(Y) - I; + Clean(Z,0.000000001); Print(Z); + + Matrix A(9, 8); + for (i = 1; i <= 9; ++i) for (j = 1; j <= 8; ++j) + A(i, j) = Helmert_transpose(X.column(j), i); + A -= Y; Clean(A,0.000000001); Print(A); + + X = I; + Y = Helmert_transpose(X, true); + H = Helmert(8, true); H -= Y.t(); Clean(H,0.000000001); Print(H); + Z = Helmert(Y, true) - I; + Clean(Z,0.000000001); Print(Z); + + A.resize(8, 8); + for (i = 1; i <= 8; ++i) for (j = 1; j <= 8; ++j) + A(i, j) = Helmert_transpose(X.column(j), i, true); + A -= Y; Clean(A,0.000000001); Print(A); + + + + I.ReSize(9); + X = I; + Y = Helmert(X, true); + H = Helmert(9, true); H -= Y; Clean(H,0.000000001); Print(H); + Z = Helmert_transpose(Y, true) - I; + Clean(Z,0.000000001); Print(Z); + + A.ReSize(9, 9); + for (i = 1; i <= 9; ++i) A.Column(i) = Helmert(9, i, true); + A -= Y; Clean(A,0.000000001); Print(A); + + Y = Helmert(X); + A.ReSize(8, 9); + for (i = 1; i <= 9; ++i) A.Column(i) = Helmert(9, i); + A -= Y; Clean(A,0.000000001); Print(A); + + ColumnVector Twos(100); Twos = 2; + ColumnVector CV = Helmert(Twos); Clean(CV,0.000000001); Print(CV); + + X.resize(25,30); + FillWithValues(MCW, X); + Y = Helmert(X); + Z = Helmert(X,true).rows(1,24) - Y; + Clean(Z,0.000000001); Print(Z); + Z = Helmert(X,true).row(25) - X.sum_columns() / 5.0; + Clean(Z,0.000000001); Print(Z); + + I.resize(15); + X = I; + Z = Helmert_transpose(X, true) - Helmert(X, true).t(); + Clean(Z,0.000000001); Print(Z); + I.resize(14); Y = I; + Z = Helmert(X) - Helmert_transpose(Y).t(); + Clean(Z,0.000000001); Print(Z); + + + + } + + + + + + +// cout << "\nEnd of Seventeenth test\n"; +} + + +///*} diff --git a/extern/newmat/tmti.cpp b/extern/newmat/tmti.cpp new file mode 100644 index 00000000..c74057e6 --- /dev/null +++ b/extern/newmat/tmti.cpp @@ -0,0 +1,240 @@ +/// \ingroup newmat +///@{ + +/// \file tmti.cpp +/// Part of matrix library test program. +/// Test exceptions + + +//#define WANT_STREAM + +#include "include.h" + +#include "newmatap.h" +//#include "newmatio.h" + +#include "tmt.h" + +#ifdef use_namespace +using namespace NEWMAT; +#endif + + +void WillNotConverge() +{ + Matrix A(10,10); + Throw(ConvergenceException(A)); +} + +void ReSizeMatrix(Matrix& A) +// for seeing if we can redimension a vector as a matrix +{ A.ReSize(4,5); } + +void trymati() +{ +#ifndef DisableExceptions + Tracer et("Eighteenth test of Matrix package"); + Matrix RUStillThere(10,20); RUStillThere = 1553; + Tracer::PrintTrace(); + + ColumnVector checks(23); checks = 1.0; checks(1) = 0.0; + + Try { WillNotConverge(); } + Catch(ConvergenceException) { checks(2) = 0; } + CatchAll { checks(1) = 1; } + BaseException::clear(); + + + Try { Matrix M(10,10); SymmetricMatrix S = M; } + Catch(ConvergenceException) { checks(1) = 1; } + Catch(InternalException) { checks(1) = 1; } + Catch(ProgramException) { checks(3) = 0; } + CatchAll { checks(1) = 1; } + BaseException::clear(); + + + Try { Matrix M(10,10); M(10,11) = 2.0; } + Catch(ConvergenceException) { checks(1) = 1; } + Catch(InternalException) { checks(1) = 1; } + Catch(IndexException) { checks(4) = 0; } + CatchAll { checks(1) = 1; } + BaseException::clear(); + + Try { Matrix M(10,10); M = 0.0; M = M.i(); } + Catch(ConvergenceException) { checks(1) = 1; } + Catch(InternalException) { checks(1) = 1; } + Catch(ProgramException) { checks(1) = 1; } + Catch(SingularException) { checks(5) = 0; } + Catch(Bad_alloc) { checks(1) = 1; } + CatchAndThrow; + BaseException::clear(); + + Try { ColumnVector A(30), B(50); A = 5; B = 3; FFT(A,B,A,B); } + Catch(ConvergenceException) { checks(1) = 1; } + Catch(InternalException) { checks(1) = 1; } + Catch(ProgramException) { checks(6) = 0; } + CatchAll { checks(1) = 1; } + BaseException::clear(); + + Try + { + ColumnVector A(30); A = 5; Matrix At = A.t(); + DiagonalMatrix D; + SVD(At,D); + } + Catch(ConvergenceException) { checks(1) = 1; } + Catch(InternalException) { checks(1) = 1; } + Catch(Logic_error) { checks(6) = 0; } + Catch(Bad_alloc) { checks(1) = 1; } + CatchAndThrow; + BaseException::clear(); + + Try { BandMatrix X(10,3,4); X(1,10) = 4.0; } + Catch(ConvergenceException) { checks(1) = 1; } + Catch(InternalException) { checks(1) = 1; } + Catch(IndexException) { checks(7) = 0; } + CatchAll { checks(1) = 1; } + BaseException::clear(); + + Try + { + SymmetricMatrix S(10); S = 5; + LowerTriangularMatrix L = Cholesky(S); + } + Catch(ConvergenceException) { checks(1) = 1; } + Catch(InternalException) { checks(1) = 1; } + Catch(ProgramException) { checks(1) = 1; } + Catch(NPDException) { checks(8) = 0; } + Catch(Bad_alloc) { checks(1) = 1; } + CatchAndThrow; + BaseException::clear(); + + Try { BandMatrix M(10,3,5); M = 0.0; Matrix XM = M.i(); } + Catch(ConvergenceException) { checks(1) = 1; } + Catch(InternalException) { checks(1) = 1; } + Catch(ProgramException) { checks(1) = 1; } + Catch(SingularException) { checks(9) = 0; } + Catch(Bad_alloc) { checks(1) = 1; } + CatchAndThrow; + BaseException::clear(); + + Try { ColumnVector X(10); ColumnVector Y; X = 5; X = X - Y; } + Catch(ConvergenceException) { checks(1) = 1; } + Catch(InternalException) { checks(1) = 1; } + Catch(IncompatibleDimensionsException) { checks(10) = 0; } + Catch(Bad_alloc) { checks(1) = 1; } + CatchAndThrow; + BaseException::clear(); + + Try + { + UpperTriangularMatrix U(3); RowVector RV(3); RV = 10; + U.Row(2) = RV; + } + Catch(ConvergenceException) { checks(1) = 1; } + Catch(InternalException) { checks(1) = 1; } + Catch(ProgramException) { checks(11) = 0; } + Catch(Bad_alloc) { checks(1) = 1; } + CatchAndThrow; + BaseException::clear(); + + Try { DiagonalMatrix D(3); D << 12 << 13 << 14 << 15; } + Catch(ConvergenceException) { checks(1) = 1; } + Catch(InternalException) { checks(1) = 1; } + Catch(ProgramException) { checks(12) = 0; } + CatchAndThrow; + BaseException::clear(); + + Try { ColumnVector D(3); D << 12 << 13; D << 1 << 2 << 3; } + Catch(ConvergenceException) { checks(1) = 1; } + Catch(InternalException) { checks(1) = 1; } + Catch(ProgramException) { checks(13) = 0; } + CatchAndThrow; + BaseException::clear(); + + + Try { { ColumnVector D(3); D << 12 << 13; } } + Catch(ConvergenceException) { checks(1) = 1; } + Catch(InternalException) { checks(1) = 1; } + Catch(ProgramException) { checks(14) = 0; } + CatchAndThrow; + BaseException::clear(); + + Try { ColumnVector CV; ReSizeMatrix(CV); } + Catch(ConvergenceException) { checks(1) = 1; } + Catch(InternalException) { checks(1) = 1; } + Catch(VectorException) { checks(15) = 0; } + CatchAndThrow; + BaseException::clear(); + + Try { RowVector RV(20); ReSizeMatrix(RV); } + Catch(ConvergenceException) { checks(1) = 1; } + Catch(InternalException) { checks(1) = 1; } + Catch(VectorException) { checks(16) = 0; } + CatchAndThrow; + BaseException::clear(); + + Try + { + UpperTriangularMatrix U(10); U = 5; + DiagonalMatrix D(10); D = 2; + D += U; // illegal conversion + } + Catch(ConvergenceException) { checks(1) = 1; } + Catch(InternalException) { checks(1) = 1; } + Catch(ProgramException) { checks(17) = 0; } + CatchAndThrow; + BaseException::clear(); + + Try { Matrix A(2,3), B(2,3); if (A < B) A = B; } + Catch(ConvergenceException) { checks(1) = 1; } + Catch(InternalException) { checks(1) = 1; } + Catch(NotDefinedException) { checks(18) = 0; } + CatchAndThrow; + BaseException::clear(); + + Try { SymmetricBandMatrix A(3,1); A = 1; A = A.Reverse(); } + Catch(ConvergenceException) { checks(1) = 1; } + Catch(InternalException) { checks(1) = 1; } + Catch(NotDefinedException) { checks(19) = 0; } + CatchAndThrow; + BaseException::clear(); + + Try + { + Matrix A(5,5); A = 1.0; + UpperTriangularMatrix B(10); + B.SubMatrix(3,7,3,7) = A; + } + Catch(ProgramException) { checks(20) = 0; } + CatchAndThrow; + BaseException::clear(); + + Try { { RowVector D(1); D << 12 << 13; } } + Catch(InternalException) { checks(1) = 1; } + Catch(ProgramException) { checks(21) = 0; } + CatchAndThrow; + BaseException::clear(); + + Try { { RowVector D(0); D << 12; } } + Catch(InternalException) { checks(1) = 1; } + Catch(ProgramException) { checks(22) = 0; } + CatchAndThrow; + BaseException::clear(); + + Try { Matrix M(10,10); Matrix XM(3,3); M = 0.0; XM = M.i(); } + Catch(SingularException) { checks(23) = 0; } + CatchAll { checks(1) = 1; } + BaseException::clear(); + + Print(checks); + Matrix RUStillThere1(10,20); RUStillThere1 = 1553; + RUStillThere = RUStillThere - RUStillThere1; + Print(RUStillThere); +#endif + +} + + +///@} + diff --git a/extern/newmat/tmtj.cpp b/extern/newmat/tmtj.cpp new file mode 100644 index 00000000..9463f0e9 --- /dev/null +++ b/extern/newmat/tmtj.cpp @@ -0,0 +1,159 @@ +/// \ingroup newmat +///@{ + +/// \file tmtj.cpp +/// Part of matrix library test program. + + +//#define WANT_STREAM + +#include "include.h" + +#include "newmatap.h" +//#include "newmatio.h" + +#include "tmt.h" + +#ifdef use_namespace +using namespace NEWMAT; +#endif + + +void trymatj() +{ + Tracer et("Nineteenth test of Matrix package"); + Tracer::PrintTrace(); + // testing elementwise (SP) products + + { + Tracer et1("Stage 1"); + Matrix A(13,7), B(13,7), C(13,7); + int i,j; + for (i=1;i<=13;i++) for (j=1; j<=7; j++) + { + Real a = (i+j*j)/2, b = (i*j-i/4); + A(i,j)=a; B(i,j)=b; C(i,j)=a*b; + } + // Where complete matrix routine can be used + Matrix X = SP(A,B)-C; Print(X); + X = SP(A,B+1.0)-A-C; Print(X); + X = SP(A-1,B)+B-C; Print(X); + X = SP(A-1,B+1)+B-A-C+1; Print(X); + // Where row-wise routine will be used + A = A.Rows(7,13); B = B.Rows(7,13); C = C.Rows(7,13); + LowerTriangularMatrix LTA; LTA << A; + UpperTriangularMatrix UTB; UTB << B; + DiagonalMatrix DC; DC << C; + X = SP(LTA,UTB) - DC; Print(X); + X = SP(LTA*2,UTB) - DC*2; Print(X); + X = SP(LTA, UTB /2) - DC/2; Print(X); + X = SP(LTA/2, UTB*2) - DC; Print(X); + DiagonalMatrix DX; + DX << SP(A,B); DX << (DX-C); Print(DX); + DX << SP(A*4,B); DX << (DX-C*4); Print(DX); + DX << SP(A,B*2); DX << (DX-C*2); Print(DX); + DX << SP(A/4,B/4); DX << (DX-C/16); Print(DX); + LowerTriangularMatrix LX; + LX = SP(LTA,B); LX << (LX-C); Print(LX); + LX = SP(LTA*3,B); LX << (LX-C*3); Print(LX); + LX = SP(LTA,B*5); LX << (LX-C*5); Print(LX); + LX = SP(-LTA,-B); LX << (LX-C); Print(LX); + } + { + // Symmetric Matrices + Tracer et1("Stage 2"); + SymmetricMatrix A(25), B(25), C(25); + int i,j; + for (i=1;i<=25;i++) for (j=i;j<=25;j++) + { + Real a = i*j +i - j + 3; + Real b = i * i + j; + A(i,j)=a; B(i,j)=b; C(i,j)=a*b; + } + UpperTriangularMatrix UT; + UT << SP(A,B); UT << (UT - C); Print(UT); + Matrix MA = A, X; + X = SP(MA,B)-C; Print(X); + X = SP(A,B)-C; Print(X); + SymmetricBandMatrix BA(25,5), BB(25,5), BC(25,5); + BA.Inject(A); BB.Inject(B); BC.Inject(C); + X = SP(BA,BB)-BC; Print(X); + X = SP(BA*7,BB)-BC*7; Print(X); + X = SP(BA,BB/8)-BC/8; Print(X); + X = SP(BA*16,BB/16)-BC; Print(X); + X = SP(BA,BB); X=X-BC; Print(X); + X = SP(BA*2, BB/2)-BC; Print(X); + X = SP(BA, BB/2)-BC/2; Print(X); + X = SP(BA*2, BB)-BC*2; Print(X); + } + { + // Band matrices + Tracer et1("Stage 3"); + Matrix A(19,19), B(19,19), C(19,19); + int i,j; + for (i=1;i<=19;i++) for (j=1;j<=19;j++) + { + Real a = i*j +i - 1.5*j + 3; + Real b = i * i + j; + A(i,j)=a; B(i,j)=b; C(i,j)=a*b; + } + BandMatrix BA(19,10,7), BB(19,8,15), BC(19,8,7); + BA.Inject(A); BB.Inject(B); BC.Inject(C); + Matrix X; BandMatrix BX; ColumnVector BW(2); + X = SP(BA,BB); X=X-BC; Print(X); + X = SP(BA/8,BB); X=X-BC/8; Print(X); + X = SP(BA,BB*17); X=X-BC*17; Print(X); + X = SP(BA/4,BB*7); X=X-BC*7/4; Print(X); + X = SP(BA,BB)-BC; Print(X); + X = SP(BA/8,BB)-BC/8; Print(X); + X = SP(BA,BB*17)-BC*17; Print(X); + X = SP(BA/4,BB*7)-BC*7/4; Print(X); + BX = SP(BA,BB); + BW(1)=BX.upper_val-7; BW(2)=BX.lower_val-8; Print(BW); + + BA.ReSize(19,7,10); BB.ReSize(19,15,8); + BC.ReSize(19,7,8); + BA.Inject(A); BB.Inject(B); BC.Inject(C); + + X = SP(BA,BB); X=X-BC; Print(X); + X = SP(BA/8,BB); X=X-BC/8; Print(X); + X = SP(BA,BB*17); X=X-BC*17; Print(X); + X = SP(BA/4,BB*7); X=X-BC*7/4; Print(X); + X = SP(BA,BB)-BC; Print(X); + X = SP(BA/8,BB)-BC/8; Print(X); + X = SP(BA,BB*17)-BC*17; Print(X); + X = SP(BA/4,BB*7)-BC*7/4; Print(X); + BX = SP(BA,BB); + BW(1)=BX.upper_val-8; BW(2)=BX.lower_val-7; Print(BW); + } + { + // SymmetricBandMatrices + Tracer et1("Stage 4"); + Matrix A(7,7), B(7,7); + int i,j; + for (i=1;i<=7;i++) for (j=1;j<=7;j++) + { + Real a = i*j +i - 1.5*j + 3; + Real b = i * i + j; + A(i,j)=a; B(i,j)=b; + } + BandMatrix BA(7,2,4), BB(7,3,1), BC(7,2,1); + BA.Inject(A); + SymmetricBandMatrix SB(7,3); + SymmetricMatrix S; S << (B+B.t()); + SB.Inject(S); A = BA; S = SB; + Matrix X; + X = SP(BA,SB); X=X-SP(A,S); Print(X); + X = SP(BA*2,SB); X=X-SP(A,S*2); Print(X); + X = SP(BA,SB/4); X=X-SP(A/4,S); Print(X); + X = SP(BA*4,SB/4); X=X-SP(A,S); Print(X); + X = SP(BA,SB)-SP(A,S); Print(X); + X = SP(BA*2,SB)-SP(A,S*2); Print(X); + X = SP(BA,SB/4)-SP(A/4,S); Print(X); + X = SP(BA*4,SB/4)-SP(A,S); Print(X); + } + +} + + +///@} diff --git a/extern/newmat/tmtk.cpp b/extern/newmat/tmtk.cpp new file mode 100644 index 00000000..4a57bc22 --- /dev/null +++ b/extern/newmat/tmtk.cpp @@ -0,0 +1,208 @@ +/// \ingroup newmat +///@{ + +/// \file tmtk.cpp +/// Part of matrix library test program. + + +#define WANT_STREAM + +#include "include.h" + +#include "newmatap.h" +#include "newmatio.h" + +#include "tmt.h" + +#ifdef use_namespace +using namespace NEWMAT; +#endif + + +static inline int my_min(int x, int y) { return x < y ? x : y; } +static inline int my_max(int x, int y) { return x > y ? x : y; } + + +#ifdef SETUP_C_SUBSCRIPTS + +void trymatk() +{ + Tracer et("Twentieth test of Matrix package"); + Tracer::PrintTrace(); + // test C subscript package + + + int i,j; Matrix X, Y; + + cout << "Matrix\n"; + Matrix A(15,35), B(15, 35); + for (i=0; i<15; i++) for (j=0; j<35; j++) + { A[i][j] = i+100*j; B(i+1,j+1) = i+100*j; } + X = A - B; Print(X); Y = X; + for (i=0; i<15; i++) for (j=0; j<35; j++) + { + X.element(i,j) = A.element(i,j) - B[i][j]; + Y.element(i,j) = ((const Matrix&)A)[i][j] - B[i][j]; + } + Print(X); Print(Y); + A.CleanUp(); B.CleanUp(); + + cout << "UpperTriangularMatrix\n"; + UpperTriangularMatrix A1(15), B1(15); + for (i=0; i<15; i++) for (j=i; j<15; j++) + { A1[i][j] = i+100*j; B1(i+1,j+1) = i+100*j; } + X = A1 - B1; Print(X); Y = X; + for (i=0; i<15; i++) for (j=i; j<15; j++) + { + X.element(i,j) = A1.element(i,j) - B1[i][j]; + Y.element(i,j) = ((const UpperTriangularMatrix&)A1)[i][j] - B1[i][j]; + } + Print(X); Print(Y); + A1.CleanUp(); B1.CleanUp(); + + cout << "LowerTriangularMatrix\n"; + LowerTriangularMatrix A2(35), B2(35); + for (i=0; i<35; i++) for (j=0; j<=i; j++) + { A2[i][j] = i+100*j; B2(i+1,j+1) = i+100*j; } + X = A2 - B2; Print(X); Y = X; + for (i=0; i<35; i++) for (j=0; j<=i; j++) + { + X.element(i,j) = A2.element(i,j) - B2[i][j]; + Y.element(i,j) = ((const LowerTriangularMatrix&)A2)[i][j] - B2[i][j]; + } + Print(X); Print(Y); + A2.CleanUp(); B2.CleanUp(); + + cout << "SymmetricMatrix\n"; + SymmetricMatrix A3(10), B3(10); + for (i=0; i<10; i++) for (j=0; j<=i; j++) + { A3[i][j] = i+100*j; B3(i+1,j+1) = i+100*j; } + X = A3 - B3; Print(X); Y = X; + for (i=0; i<10; i++) for (j=0; j<=i; j++) + { + X.element(i,j) = A3.element(i,j) - B3[i][j]; + Y.element(i,j) = ((const SymmetricMatrix&)A3)[i][j] - B3[i][j]; + } + Print(X); Print(Y); + A3.CleanUp(); B3.CleanUp(); + + cout << "DiagonalMatrix\n"; + DiagonalMatrix A4(10), B4(10); + for (i=0; i<10; i++) + { A4[i] = i+100; B4(i+1) = i+100; } + X = A4 - B4; Print(X); Y = X; + for (i=0; i<10; i++) + { + X.element(i,i) = A4.element(i) - B4[i]; + Y.element(i,i) = ((const DiagonalMatrix&)A4)[i] - B4[i]; + } + Print(X); Print(Y); + A4.CleanUp(); B4.CleanUp(); + + cout << "RowVector\n"; + RowVector A5(10), B5(10); + for (i=0; i<10; i++) + { A5[i] = i+100; B5(i+1) = i+100; } + X = A5 - B5; Print(X); Y = X; + for (i=0; i<10; i++) + { + X.element(0,i) = A5.element(i) - B5[i]; + Y.element(0,i) = ((const RowVector&)A5)[i] - B5[i]; + } + Print(X); Print(Y); + A5.CleanUp(); B5.CleanUp(); + + cout << "ColumnVector\n"; + ColumnVector A6(10), B6(10); + for (i=0; i<10; i++) + { A6[i] = i+100; B6(i+1) = i+100; } + X = A6 - B6; Print(X); Y = X; + for (i=0; i<10; i++) + { + X.element(i,0) = A6.element(i) - B6[i]; + Y.element(i,0) = ((const ColumnVector&)A6)[i] - B6[i]; + } + Print(X); Print(Y); + A6.CleanUp(); B6.CleanUp(); + + cout << "BandMatrix\n"; + BandMatrix A7(55,10, 5), B7(55, 10, 5); + for (i=0; i<55; i++) for (j=my_max(0,i-10); j<=my_min(54,i+5); j++) + { A7[i][j] = i+100*j; B7(i+1,j+1) = i+100*j; } + X = A7 - B7; Print(X); Y = X; + for (i=0; i<55; i++) for (j=my_max(0,i-10); j<=my_min(54,i+5); j++) + { + X.element(i,j) = A7.element(i,j) - B7[i][j]; + Y.element(i,j) = ((const BandMatrix&)A7)[i][j] - B7[i][j]; + } + Print(X); Print(Y); + A7.CleanUp(); B7.CleanUp(); + + cout << "UpperBandMatrix\n"; + UpperBandMatrix A8(80,15), B8(80,15); + for (i=0; i<80; i++) for (j=i; j<=my_min(79,i+15); j++) + { A8[i][j] = i+100*j; B8(i+1,j+1) = i+100*j; } + X = A8 - B8; Print(X); Y = X; + for (i=0; i<80; i++) for (j=i; j<=my_min(79,i+15); j++) + { + X.element(i,j) = A8.element(i,j) - B8[i][j]; + Y.element(i,j) = ((const UpperBandMatrix&)A8)[i][j] - B8[i][j]; + } + Print(X); Print(Y); + A8.CleanUp(); B8.CleanUp(); + + cout << "LowerBandMatrix\n"; + LowerBandMatrix A9(75,27), B9(75,27); + for (i=0; i<75; i++) for (j=my_max(0,i-27); j<=i; j++) + { A9[i][j] = i+100*j; B9(i+1,j+1) = i+100*j; } + X = A9 - B9; Print(X); Y = X; + for (i=0; i<75; i++) for (j=my_max(0,i-27); j<=i; j++) + { + X.element(i,j) = A9.element(i,j) - B9[i][j]; + Y.element(i,j) = ((const LowerBandMatrix&)A9)[i][j] - B9[i][j]; + } + Print(X); Print(Y); + A9.CleanUp(); B9.CleanUp(); + + cout << "SymmetricBandMatrix\n"; + SymmetricBandMatrix Aa(69,15), Ba(69,15); + for (i=0; i<69; i++) for (j=my_max(0,i-15); j<=i; j++) + { Aa[i][j] = i+100*j; Ba(i+1,j+1) = i+100*j; } + X = Aa - Ba; Print(X); Y = X; + for (i=0; i<69; i++) for (j=my_max(0,i-15); j<=i; j++) + { + X.element(i,j) = Aa.element(i,j) - Ba[i][j]; + Y.element(i,j) = ((const SymmetricBandMatrix&)Aa)[i][j] - Ba[i][j]; + } + Print(X); Print(Y); + Aa.CleanUp(); Ba.CleanUp(); + + // test special constructors used in Numerical Recipes for C++ + Real a[] = {1.2, 5.6, 7.9, 3.8, 4.5, 1.3, + 5.2, 9.9, 2.1, 4.7, 0.0, 1.6 }; + ColumnVector CV0(12); CV0 << a; + ColumnVector CV1(a, 12); CV1 -= CV0; Print(CV1); + RowVector RV1(a, 12); RV1 -= CV0.AsRow(); Print(RV1); + Matrix RM1(a, 3, 4); RM1 -= CV0.AsMatrix(3,4); Print(RM1); + ColumnVector CV2(5.75, 15); CV2 -= 5.75; Print(CV2); + RowVector RV2(2.75, 15); RV2 -= 2.75; Print(RV2); + Matrix RM2(-3.75, 6, 4); RM2 += 3.75; Print(RM2); + + +} + + +#else + +void trymatk() +{ + Tracer et("Twentieth test of Matrix package"); + Tracer::PrintTrace(); + // test C subscript package + cout << "C subscripts not enabled, not tested\n\n"; +} + +#endif + + +///@} diff --git a/extern/newmat/tmtl.cpp b/extern/newmat/tmtl.cpp new file mode 100644 index 00000000..04e80bb6 --- /dev/null +++ b/extern/newmat/tmtl.cpp @@ -0,0 +1,206 @@ +/// \ingroup newmat +///@{ + +/// \file tmtl.cpp +/// Part of matrix library test program. + + +#define WANT_STREAM + +#define WANT_MATH + +#include "newmat.h" + +#include "tmt.h" + +#ifdef use_namespace +using namespace NEWMAT; +#endif + + + +// test maxima and minima + +Real TestMax(const GenericMatrix& GM) +{ + Matrix M = GM; + ColumnVector CV = GM.AsColumn(); + + int c, i, j, k; int n = CV.Nrows(), nr = M.Nrows(), nc = M.Ncols(); + Real x1, x2, x3; + + MatrixBandWidth mbw = GM.BandWidth(); + int u = mbw.Upper(); int l = mbw.Lower(); + bool IsBandMatrix = u > 0 && l > 0 && !(u == 0 && l == 0); + + x1 = GM.MaximumAbsoluteValue(); + x2 = GM.MaximumAbsoluteValue1(i); + if (fabs(CV(i)) != x2) return 1.1; + x3 = GM.MaximumAbsoluteValue2(i,j); + if (fabs(M(i,j)) != x3) return 1.2; + if (x3 != x1) return 1.3; + if (x2 != x1) return 1.4; + c = 0; + for (k = 1; k <= n; k++) + { + Real cvk = fabs(CV(k)); + if (x1 <= cvk) { if (x1 < cvk) return 1.5; else c++; } + } + if (c == 0) return 1.6; + + + x1 = GM.MinimumAbsoluteValue(); + x2 = GM.MinimumAbsoluteValue1(i); + if (fabs(CV(i)) != x2) return 2.1; + x3 = GM.MinimumAbsoluteValue2(i,j); + if (fabs(M(i,j)) != x3) return 2.2; + if (x3 != x1) return 2.3; + if (x2 != CV.MinimumAbsoluteValue()) return 2.4; + c = 0; + if (IsBandMatrix) + { + for (i = 1; i <= nr; i++) for (j = 1; j <= nc; j++) + if (i - j <= l && j - i <= u) + { + Real mij = fabs(M(i,j)); + if (x1 >= mij) { if (x1 > mij) return 2.51; else c++; } + } + } + else + { + for (k = 1; k <= n; k++) + { + Real cvk = fabs(CV(k)); + if (x1 >= cvk) { if (x1 > cvk) return 2.52; else c++; } + } + } + if (c == 0) return 2.6; + + x1 = GM.Maximum(); + x2 = GM.Maximum1(i); + if (CV(i) != x2) return 3.1; + x3 = GM.Maximum2(i,j); + if (M(i,j) != x3) return 3.2; + if (x3 != x1) return 3.3; + if (x2 != CV.Maximum()) return 3.4; + c = 0; + if (IsBandMatrix) + { + for (i = 1; i <= nr; i++) for (j = 1; j <= nc; j++) + if (i - j <= l && j - i <= u) + { + Real mij = M(i,j); + if (x1 <= mij) { if (x1 < mij) return 3.51; else c++; } + } + } + else + { + for (k = 1; k <= n; k++) + { + Real cvk = CV(k); + if (x1 <= cvk) { if (x1 < cvk) return 3.52; else c++; } + } + } + if (c == 0) return 3.6; + + x1 = GM.Minimum(); + x2 = GM.Minimum1(i); + if (CV(i) != x2) return 4.1; + x3 = GM.Minimum2(i,j); + if (M(i,j) != x3) return 4.2; + if (x3 != x1) return 4.3; + if (x2 != CV.Minimum()) return 4.4; + c = 0; + if (IsBandMatrix) + { + for (i = 1; i <= nr; i++) for (j = 1; j <= nc; j++) + if (i - j <= l && j - i <= u) + { + Real mij = M(i,j); + if (x1 >= mij) { if (x1 > mij) return 4.51; else c++; } + } + } + else + { + for (k = 1; k <= n; k++) + { + Real cvk = CV(k); + if (x1 >= cvk) { if (x1 > cvk) return 4.52; else c++; } + } + } + if (c == 0) return 4.6; + + return 0; + +} + + +void trymatl() +{ + Tracer et("Twenty first test of Matrix package"); + Tracer::PrintTrace(); + + Matrix M(4, 4); + M << 1.5 << 1.0 << -4.0 << 4.5 + << 3.5 << 7.0 << 2.0 << -1.0 + << -1.5 << 7.5 << -6.0 << 5.0 + << 0.5 << -8.0 << 5.5 << 4.0; + UpperTriangularMatrix UM; UM << M; + LowerTriangularMatrix LM; LM << -M; + SymmetricMatrix SM; SM << (UM + UM.t()); + BandMatrix BM(4, 1, 2); BM.Inject(M); + DiagonalMatrix DM; DM << M; + SymmetricBandMatrix SBM(4,1); SBM.Inject(M); + RowVector Test(28); int k = 0; + + // tests for different shapes + Test(++k) = TestMax(GenericMatrix(M)); + Test(++k) = TestMax(GenericMatrix(UM)); + Test(++k) = TestMax(GenericMatrix(LM)); + Test(++k) = TestMax(GenericMatrix(SM)); + Test(++k) = TestMax(GenericMatrix(DM)); + Test(++k) = TestMax(GenericMatrix(BM)); + Test(++k) = TestMax(GenericMatrix(SBM)); + + // tests for constant matrices - don't put non-zeros in corners of BM + Matrix MX(4,4); + MX = 1; Test(++k) = TestMax(GenericMatrix(MX)); + BM.Inject(MX); Test(++k) = TestMax(GenericMatrix(BM)); + MX = 0; Test(++k) = TestMax(GenericMatrix(MX)); + BM.Inject(MX); Test(++k) = TestMax(GenericMatrix(BM)); + MX = -1; Test(++k) = TestMax(GenericMatrix(MX)); + BM.Inject(MX); Test(++k) = TestMax(GenericMatrix(BM)); + + // test for non-square + MX = M | (2 * M).t(); Test(++k) = TestMax(GenericMatrix(MX)); + + // test on row and column vector + RowVector RV(6); + RV << 1 << 3 << -5 << 2 << -4 << 3; + Test(++k) = TestMax(GenericMatrix(RV)); + Test(++k) = TestMax(GenericMatrix(RV.t())); + + // test for function form + Test(++k) = (MaximumAbsoluteValue(RV) - 5); + Test(++k) = (MinimumAbsoluteValue(RV) - 1); + Test(++k) = (Maximum(RV) - 3); + Test(++k) = (Minimum(RV) + 5); + Test(++k) = (MaximumAbsoluteValue(-RV) - 5); + Test(++k) = (MinimumAbsoluteValue(-RV) - 1); + Test(++k) = (Maximum(-RV) - 5); + Test(++k) = (Minimum(-RV) + 3); + + // test formulae + RowVector RV2(6); + RV2 << 2 << 8 << 1 << 9 << 3 << -1; + Test(++k) = (MaximumAbsoluteValue(RV+RV2) - 11); + Test(++k) = (MinimumAbsoluteValue(RV+RV2) - 1); + Test(++k) = (Maximum(RV+RV2) - 11); + Test(++k) = (Minimum(RV+RV2) + 4); + + + Print(Test); +} + + +///@} diff --git a/extern/newmat/tmtm.cpp b/extern/newmat/tmtm.cpp new file mode 100644 index 00000000..057a28c3 --- /dev/null +++ b/extern/newmat/tmtm.cpp @@ -0,0 +1,279 @@ +/// \ingroup newmat +///@{ + +/// \file tmtm.cpp +/// Part of matrix library test program. + + +#define WANT_STREAM + +#define WANT_MATH + +#include "newmat.h" +#include "newmatio.h" + +#include "tmt.h" + +#ifdef use_namespace +using namespace NEWMAT; +#endif + + + +// test Kronecker Product + + +void trymatm() +{ + Tracer et("Twenty second test of Matrix package"); + Tracer::PrintTrace(); + + { + Tracer et1("Stage 1"); + + + Matrix A(2,3); + A << 3 << 5 << 2 + << 4 << 1 << 6; + + Matrix B(4,3); + B << 7 << 2 << 9 + << 1 << 3 << 6 + << 4 << 10 << 5 + << 11 << 8 << 12; + + Matrix C(8, 9); + + C.Row(1) << 21 << 6 << 27 << 35 << 10 << 45 << 14 << 4 << 18; + C.Row(2) << 3 << 9 << 18 << 5 << 15 << 30 << 2 << 6 << 12; + C.Row(3) << 12 << 30 << 15 << 20 << 50 << 25 << 8 << 20 << 10; + C.Row(4) << 33 << 24 << 36 << 55 << 40 << 60 << 22 << 16 << 24; + + C.Row(5) << 28 << 8 << 36 << 7 << 2 << 9 << 42 << 12 << 54; + C.Row(6) << 4 << 12 << 24 << 1 << 3 << 6 << 6 << 18 << 36; + C.Row(7) << 16 << 40 << 20 << 4 << 10 << 5 << 24 << 60 << 30; + C.Row(8) << 44 << 32 << 48 << 11 << 8 << 12 << 66 << 48 << 72; + + Matrix AB = KP(A,B) - C; Print(AB); + + IdentityMatrix I1(10); IdentityMatrix I2(15); I2 *= 2; + DiagonalMatrix D = KP(I1, I2) - IdentityMatrix(150) * 2; + Print(D); + } + + { + Tracer et1("Stage 2"); + + UpperTriangularMatrix A(3); + A << 3 << 8 << 5 + << 7 << 2 + << 4; + UpperTriangularMatrix B(4); + B << 4 << 1 << 7 << 2 + << 3 << 9 << 8 + << 1 << 5 + << 6; + + UpperTriangularMatrix C(12); + + C.Row(1) <<12<< 3<<21<< 6 <<32<< 8<<56<<16 <<20<< 5<<35<<10; + C.Row(2) << 9<<27<<24 << 0<<24<<72<<64 << 0<<15<<45<<40; + C.Row(3) << 3<<15 << 0<< 0<< 8<<40 << 0<< 0<< 5<<25; + C.Row(4) <<18 << 0<< 0<< 0<<48 << 0<< 0<< 0<<30; + + C.Row(5) <<28<< 7<<49<<14 << 8<< 2<<14<< 4; + C.Row(6) <<21<<63<<56 << 0<< 6<<18<<16; + C.Row(7) << 7<<35 << 0<< 0<< 2<<10; + C.Row(8) <<42 << 0<< 0<< 0<<12; + + C.Row(9) <<16<< 4<<28<< 8; + C.Row(10) <<12<<36<<32; + C.Row(11) << 4<<20; + C.Row(12) <<24; + + + UpperTriangularMatrix AB = KP(A,B) - C; Print(AB); + + LowerTriangularMatrix BT = B.t(); Matrix N(12,12); + + N.Row(1) <<12 << 0<< 0<< 0 <<32<< 0<< 0<< 0 <<20<< 0<< 0<< 0; + N.Row(2) << 3 << 9<< 0<< 0 << 8<<24<< 0<< 0 << 5<<15<< 0<< 0; + N.Row(3) <<21 <<27<< 3<< 0 <<56<<72<< 8<< 0 <<35<<45<< 5<< 0; + N.Row(4) << 6 <<24<<15<<18 <<16<<64<<40<<48 <<10<<40<<25<<30; + + N.Row(5) << 0 << 0<< 0<< 0 <<28<< 0<< 0<< 0 << 8<< 0<< 0<< 0; + N.Row(6) << 0 << 0<< 0<< 0 << 7<<21<< 0<< 0 << 2<< 6<< 0<< 0; + N.Row(7) << 0 << 0<< 0<< 0 <<49<<63<< 7<< 0 <<14<<18<< 2<< 0; + N.Row(8) << 0 << 0<< 0<< 0 <<14<<56<<35<<42 << 4<<16<<10<<12; + + N.Row(9) << 0 << 0<< 0<< 0 << 0<< 0<< 0<< 0 <<16<< 0<< 0<< 0; + N.Row(10)<< 0 << 0<< 0<< 0 << 0<< 0<< 0<< 0 << 4<<12<< 0<< 0; + N.Row(11)<< 0 << 0<< 0<< 0 << 0<< 0<< 0<< 0 <<28<<36<< 4<< 0; + N.Row(12)<< 0 << 0<< 0<< 0 << 0<< 0<< 0<< 0 << 8<<32<<20<<24; + + Matrix N1 = KP(A, BT); N1 -= N; Print(N1); + AB << KP(A, BT); AB << (AB - N); Print(AB); + BT << KP(A, BT); BT << (BT - N); Print(BT); + + LowerTriangularMatrix AT = A.t(); + N1 = KP(AT, B); N1 -= N.t(); Print(N1); + AB << KP(AT, B); AB << (AB - N.t()); Print(AB); + BT << KP(AT, B); BT << (BT - N.t()); Print(BT); + } + + { + Tracer et1("Stage 3"); + + BandMatrix BMA(6,2,3); + BMA.Row(1) << 5.25 << 4.75 << 2.25 << 1.75; + BMA.Row(2) << 1.25 << 9.75 << 4.50 << 0.25 << 1.50; + BMA.Row(3) << 7.75 << 1.50 << 3.00 << 4.25 << 0.50 << 5.50; + BMA.Row(4) << 2.75 << 9.00 << 8.00 << 3.25 << 3.50; + BMA.Row(5) << 8.75 << 6.25 << 5.00 << 5.75; + BMA.Row(6) << 3.75 << 6.75 << 6.00; + + Matrix A = BMA; + + BandMatrix BMB(4,2,1); + BMB.Row(1) << 4.5 << 9.5; + BMB.Row(2) << 1.5 << 6.0 << 2.0; + BMB.Row(3) << 0.5 << 2.5 << 8.5 << 7.5; + BMB.Row(4) << 3.0 << 4.0 << 6.5; + + SquareMatrix B = BMB; + + BandMatrix BMC = KP(BMA, BMB); + BandMatrix BMC1 = KP(BMA, B); + Matrix C2 = KP(A, BMB); + Matrix C = KP(A, B); + + Matrix M = C - BMC; Print(M); + M = C - BMC1; Print(M); + M = C - C2; Print(M); + + RowVector X(4); + X(1) = BMC.BandWidth().Lower() - 10; + X(2) = BMC.BandWidth().Upper() - 13; + X(3) = BMC1.BandWidth().Lower() - 11; + X(4) = BMC1.BandWidth().Upper() - 15; + Print(X); + + UpperTriangularMatrix UT; UT << KP(BMA, BMB); + UpperTriangularMatrix UT1; UT1 << (C - UT); Print(UT1); + LowerTriangularMatrix LT; LT << KP(BMA, BMB); + LowerTriangularMatrix LT1; LT1 << (C - LT); Print(LT1); + } + + { + Tracer et1("Stage 4"); + + SymmetricMatrix SM1(4); + SM1.Row(1) << 2; + SM1.Row(2) << 4 << 5; + SM1.Row(3) << 9 << 2 << 1; + SM1.Row(4) << 3 << 6 << 8 << 2; + + SymmetricMatrix SM2(3); + SM2.Row(1) << 3; + SM2.Row(2) << -7 << -6; + SM2.Row(3) << 4 << -2 << -1; + + SymmetricMatrix SM = KP(SM1, SM2); + Matrix M1 = SM1; Matrix M2 = SM2; + Matrix M = KP(SM1, SM2); M -= SM; Print(M); + M = KP(SM1, SM2) - SM; Print(M); + M = KP(M1, SM2) - SM; Print(M); + M = KP(SM1, M2) - SM; Print(M); + M = KP(M1, M2); M -= SM; Print(M); + } + + { + Tracer et1("Stage 5"); + + Matrix A(2,3); + A << 3 << 5 << 2 + << 4 << 1 << 6; + + Matrix B(3,4); + B << 7 << 2 << 9 << 11 + << 1 << 3 << 6 << 8 + << 4 << 10 << 5 << 12; + + RowVector C(2); C << 3 << 7; + ColumnVector D(4); D << 0 << 5 << 13 << 11; + + Matrix M = KP(C * A, B * D) - KP(C, B) * KP(A, D); Print(M); + } + + { + Tracer et1("Stage 6"); + + RowVector A(3), B(5), C(15); + A << 5 << 2 << 4; + B << 3 << 2 << 0 << 1 << 6; + C << 15 << 10 << 0 << 5 << 30 + << 6 << 4 << 0 << 2 << 12 + << 12 << 8 << 0 << 4 << 24; + Matrix N = KP(A, B) - C; Print(N); + N = KP(A.t(), B.t()) - C.t(); Print(N); + N = KP(A.AsDiagonal(), B.AsDiagonal()) - C.AsDiagonal(); Print(N); + } + + { + Tracer et1("Stage 7"); + IdentityMatrix I(3); + ColumnVector CV(4); CV << 4 << 3 << 1 << 7; + Matrix A = KP(I, CV) + 5; + Matrix B(3,12); + B.Row(1) << 9 << 8 << 6 << 12 << 5 << 5 << 5 << 5 << 5 << 5 << 5 << 5; + B.Row(2) << 5 << 5 << 5 << 5 << 9 << 8 << 6 << 12 << 5 << 5 << 5 << 5; + B.Row(3) << 5 << 5 << 5 << 5 << 5 << 5 << 5 << 5 << 9 << 8 << 6 << 12; + B -= A.t(); Print(B); + + } + + { + Tracer et1("Stage 8"); // SquareMatrix + Matrix A(2,3), B(3,2); + A << 2 << 6 << 7 + << 4 << 3 << 9; + B << 1 << 3 + << 4 << 8 + << 0 << 6; + SquareMatrix AB = A * B; + Matrix M = (B.t() * A.t()).t(); M -= AB; Print(M); + AB = B * A; + M = (A.t() * B.t()).t(); M -= AB; Print(M); + AB.ReSize(5,5); AB = 0; + AB.SubMatrix(1,2,1,3) = A; AB.SubMatrix(4,5,3,5) = A; + AB.SubMatrix(1,3,4,5) = B; AB.SubMatrix(3,5,1,2) = B; + SquareMatrix C(5); + C.Row(1) << 2 << 6 << 7 << 1 << 3; + C.Row(2) << 4 << 3 << 9 << 4 << 8; + C.Row(3) << 1 << 3 << 0 << 0 << 6; + C.Row(4) << 4 << 8 << 2 << 6 << 7; + C.Row(5) << 0 << 6 << 4 << 3 << 9; + C -= AB; Print(C); + AB = A.SymSubMatrix(1,2); + AB = (AB | AB) & (AB | AB); + C.ReSize(4); + C.Row(1) << 2 << 6 << 2 << 6; + C.Row(2) << 4 << 3 << 4 << 3; + C.Row(3) << 2 << 6 << 2 << 6; + C.Row(4) << 4 << 3 << 4 << 3; + M = AB; + C -= M; Print(C); + C << M; C += -M; Print(C); + + } + + +} + + +///@} + + + + + diff --git a/extern/objcryst b/extern/objcryst new file mode 160000 index 00000000..bfdcfda6 --- /dev/null +++ b/extern/objcryst @@ -0,0 +1 @@ +Subproject commit bfdcfda67db8c91af0c1b801fe988e90cbb79246 diff --git a/nanobind_migration_notes.md b/nanobind_migration_notes.md new file mode 100644 index 00000000..c289e4c1 --- /dev/null +++ b/nanobind_migration_notes.md @@ -0,0 +1,530 @@ +# nanobind Migration Notes for pyobjcryst + +## Status (2026-08-12) + +**The migration is functionally complete for the audited API surface, with known, accepted +gaps listed below — it is not "fully done" in the sense of zero open items.** + +What's done and verified: +- The C++ binding layer is fully ported from Boost.Python + SCons to nanobind + CMake + + scikit-build-core. `src/pyobjcryst/*.py` (the pure-Python layer) and `tests/*.py` are untouched — + nothing there is Boost.Python-specific. +- All 45 `nb_*.cpp` binding files (`src/extensions/`) have real implementations covering the same + class surface as the old `*_ext.cpp` files, built against `extern/objcryst` + (`vincefn/objcryst@bfdcfda`, vendored as a submodule). +- A systematic audit (diffing every Python-exposed name in the old Boost.Python bindings against + the nanobind ones) found and fixed every discovered regression, most recently a significant one: + `Scatterer`, `ScatteringPower`, `ScatteringData`, and `PowderPatternComponent` (and everything + under them) had lost most of `RefinableObj`'s method surface because of a virtual-inheritance + limitation in nanobind — see [Virtual Inheritance](#virtual-inheritance) below. That fix is + covered by real, committed tests. +- **161/161 tests pass** (`pytest tests/ -q`). + +Known, accepted gaps — real, not oversights, but still open: +- **Python-side method override does not work across the `RefinableObj` virtual-inheritance + seam.** A Python subclass of `Atom`, `Molecule`, `ScatteringPowerAtom`, + `DiffractionDataSingleCrystal`, `PowderPatternBackground`, etc. that overrides an inherited + `RefinableObj` method (e.g. `UpdateDisplay`) will **not** have that override seen by + C++-internal virtual dispatch — only plain forwarding calls were restored, not overridability. + This was an explicit scope decision (general override support was confirmed not needed), not an + oversight, but it is a real regression vs. Boost.Python's `bases`, which handled + this transparently. Override support that *does* still work: `RefinableObj`'s own ~15 virtuals + when subclassing `RefinableObj` directly; `Scatterer`/`ScatteringPower`/`Restraint`'s own + (non-inherited) virtuals; and `UpdateDisplay` specifically on `Crystal`, `PowderPattern`, and + `MonteCarloObj` (all three reach `RefinableObj` through a non-virtual chain, so no seam exists + there). See [Virtual Inheritance](#virtual-inheritance) for why this is a hard nanobind + limitation, not a bug. +- **Reference-counting leak**: `nanobind: leaked N instances!` warnings print at interpreter exit. + The `Molecule`↔`MolAtom` cycle is fixed. `Crystal`↔`Scatterer`/`Molecule`/`ScatteringPower` cycles + remain (56 leaked instances in the current full-suite run) — not safe to fix the same way, see + [keep_alive Reference Cycles](#keep_alive-reference-cycles). Not blocking functionality. +- **CI has not been exercised against this build.** `.github/workflows/` is inherited from `main` + unmodified (it calls a shared reusable workflow); it has never actually run against the + nanobind/CMake build because nothing on this branch has been pushed yet. +- **Cross-platform**: everything above has been built and tested on Linux only. macOS/Windows are + unverified. +- **Performance**: not benchmarked against Boost.Python. +- **Versioning**: `pyproject.toml` uses a static placeholder version (`2024.2.1.dev0`) instead of + `main`'s dynamic tag-based versioning (`setuptools-git-versioning`) — scikit-build-core needs a + different mechanism for that; flagged as a `TODO` in `pyproject.toml` itself, not yet resolved. + +None of the above blocks day-to-day use of the library from Python — every method that was +reachable under Boost.Python is reachable under nanobind (modulo the override caveat above, which +only matters if you're writing a Python subclass that overrides a virtual method). + +--- + +## Table of Contents + +1. [Overview](#overview) +2. [Architecture](#architecture) +3. [Building & Testing](#building--testing) +4. [Virtual Inheritance](#virtual-inheritance) +5. [Other Recurring Gotchas](#other-recurring-gotchas) +6. [Binding Patterns Quick Reference](#binding-patterns-quick-reference) +7. [Architecture Decisions](#architecture-decisions) +8. [Pitfalls Checklist](#pitfalls-checklist) + +--- + +## Overview + +**Why nanobind instead of Boost.Python:** much less code per binding (~20-40 lines vs. 70+), +faster compilation, smaller binaries, and native `scikit-build-core`/`pyproject.toml` integration +instead of SCons. The trade-off, discovered during this migration, is that nanobind's automatic +base↔derived pointer adjustment does not support C++ virtual inheritance at all — which ObjCryst++ +uses extensively (`Scatterer`, `ScatteringPower`, `ScatteringData`, `PowderPatternComponent` all +inherit `RefinableObj` virtually) — so a large fraction of the actual migration work was working +around that one limitation. [Virtual Inheritance](#virtual-inheritance) covers this in full. + +--- + +## Architecture + +### File structure + +``` +pyobjcryst/ +├── extern/ +│ ├── objcryst/ # ObjCryst++ C++ core (git submodule, vincefn/objcryst@bfdcfda) +│ ├── newmat/ # matrix library (vendored) +│ └── cctbx/ # crystallography utilities (vendored, hand-pared subset) +├── src/ +│ ├── pyobjcryst/ # Python package layer — unchanged, not Boost.Python-specific +│ └── extensions/ # nanobind C++ bindings: nb_module.cpp, helpers_nb.hpp, 45 nb_*.cpp files +├── CMakeLists.txt +├── pyproject.toml # scikit-build-core backend +└── tests/ +``` + +### Build pipeline + +``` +pyproject.toml (scikit-build-core) + -> CMakeLists.txt + -> extern/newmat/ -> static libNewmat + -> extern/cctbx/ -> static libCCTBX + -> extern/objcryst/-> static libObjCryst (REAL=double forwarded via target_compile_definitions) + -> src/extensions/ -> nanobind extension _pyobjcryst (links all static libs) + -> wheel: pyobjcryst/*.py + _pyobjcryst.so +``` + +Python-facing API is unchanged: `from pyobjcryst import Crystal, SpaceGroup, Atom, ...` still +works, re-exported from `pyobjcryst._pyobjcryst`. + +--- + +## Building & Testing + +### Environment + +```bash +# Miniforge/mamba, created OUTSIDE the git checkout. Tested with python=3.14. +mamba create -n pyobjcryst-nb python=3.14 numpy nanobind scikit-build-core \ + ninja cmake libboost-devel libboost-headers libboost +conda activate pyobjcryst-nb +git submodule update --init # fetches extern/objcryst +``` + +**Compiler note:** if the host's glibc is older than conda-forge's bundled GCC assumes +(`GLIBC_ABI_GNU2_TLS` error at import time — conda-forge GCC 14+ defaults to the `gnu2` TLS +dialect), build with the system compiler instead, keeping the rest of the toolchain from conda: + +```bash +CC=/usr/bin/gcc CXX=/usr/bin/g++ pip install -e . --no-build-isolation -Cbuild-dir=build +``` + +### Build & test + +```bash +pip install -e . --no-build-isolation # in-place / development +pip wheel . -w dist/ # production wheel + +pytest tests/ -q # full suite: 161 passed +``` + +A bare `cmake --build build` refreshes the compiled extension but **not** the editable install — +after any C++ change, re-run the `pip install -e .` command above (with `-Cbuild-dir=build` to +reuse the existing build directory rather than reconfiguring from scratch). + +`nanobind: leaked N instances!` / `leaked keep_alive records!` / `leaked types!` warnings print +after every test run — pre-existing, tracked in [Status](#status-2026-08-12) and +[keep_alive Reference Cycles](#keep_alive-reference-cycles), not currently blocking anything. + +### Build troubleshooting + +| Symptom | Cause | Fix | +|---|---|---| +| `nanobind not found` | not installed | `conda install nanobind` | +| `ObjCryst submodule empty` | not initialized | `git submodule update --init --recursive` | +| `version.h: No such file` | CMake config not run | `pip install -e . --no-build-isolation` | +| Segfault / bus error in a test | pointer-offset bug (virtual inheritance) | check whether the crashing class's C++ header declares `virtual` inheritance anywhere in its ancestry; see [Virtual Inheritance](#virtual-inheritance) | +| `RuntimeError: std::bad_cast`, no useful location | usually `nb::cast` on a `bytes` object | check every `.attr("read")()` call site — see [Python file-like input](#python-file-like-input-str-vs-bytes) | +| Binary needs a newer glibc than the host ships (`GLIBC_ABI_GNU2_TLS`) | conda-forge GCC's `gnu2` TLS dialect | build with the system compiler: `CC=/usr/bin/gcc CXX=/usr/bin/g++ pip install -e . --no-build-isolation` | +| gdb: `(no debugging symbols found)` | scikit-build-core strips symbols on install | `pip install -e . --no-build-isolation -Ccmake.define.CMAKE_BUILD_TYPE=RelWithDebInfo`, then copy the unstripped `.so` over the installed one | +| Values off in the last few digits | `REAL` (`ObjCryst/ObjCryst/General.h`) defaults to `float`; must be forced to `double` | confirm `CMakeLists.txt` sets `target_compile_definitions(ObjCryst PUBLIC REAL=double ...)`, and that any helper uses the `CrystVector_REAL`/`CrystMatrix_REAL` macros rather than a hardcoded ``/`` | + +Useful gdb recipe for a segfault/bad_cast inside the extension: +```bash +gdb -q --args python -m pytest tests/test_whatever.py -k test_name +(gdb) catch throw # for std::bad_cast / C++ exceptions +(gdb) run +(gdb) bt +``` + +--- + +## Virtual Inheritance + +**This is the single largest source of bugs in this migration — read this section before binding +or extending any class near `RefinableObj`, `Scatterer`, `ScatteringPower`, `ScatteringData`, or +`PowderPatternComponent`.** + +### The core problem + +ObjCryst++ uses *virtual* inheritance in several places: `Scatterer : virtual public +RefinableObj`, `ScatteringPower : virtual public RefinableObj`, `ScatteringData : virtual public +RefinableObj`, `PowderPatternComponent : virtual public RefinableObj`, and a second hop for +`ScatteringPowerAtom : virtual public ScatteringPower` and `GlobalScatteringPower : virtual public +ScatteringPower`. + +nanobind's automatic base↔derived pointer adjustment (used by `nb::class_(...)`) +assumes a **fixed, statically computable** offset between `Derived*` and `Base*`. That's only +valid for *non-virtual* inheritance. Declaring the nanobind base across a virtual link does **not** +raise an error — it silently computes a *wrong* offset, which can look fine for fields at offset 0 +and then segfault or return garbage the moment a method touching state further into the object is +called. + +**Rule of thumb: if class `D` inherits `virtual`ly from `B` anywhere in its hierarchy, never write +`nb::class_(...)`.** Register `D` standalone and handle every base↔derived crossing by hand. +Grep the whole `extern/objcryst/ObjCryst` tree for `": *virtual public"` before starting new +binding work — it's cheap and saves a debugging session per class. Plain (non-virtual) inheritance +is fine and should still use nanobind's automatic base declaration (e.g. `ScatteringPowerSphere : +public ScatteringPower`, no `virtual`, is safely `nb::class_`). + +### Four ways this bites, and the fix for each + +**1. Return direction** — a function returns a base-typed reference/pointer +(`ScatteringPower&`) whose dynamic type is a virtually-derived leaf (`ScatteringPowerAtom`). Fix: +`dynamic_cast` to the concrete type before handing it to nanobind, so it wraps an already-exact-type +pointer (offset-0-safe): + +```cpp +nb::object wrapScatteringPowerReturn(const ScatteringPower* sp, nb::handle parent) { + if (!sp) return nb::none(); + if (auto* spa = dynamic_cast(sp)) + return nb::cast(const_cast(spa), nb::rv_policy::reference_internal, parent); + return nb::cast(const_cast(sp), nb::rv_policy::reference_internal, parent); +} +``` +Applies even when the returned type is an *intermediate* base, not the ultimate leaf (e.g. +`PowderPattern::GetPowderPatternComponent(i)` returns `PowderPatternComponent&`, whose dynamic type +is `PowderPatternDiffraction`) — every function returning a shared ancestor type anywhere in a +virtual hierarchy needs this, not just the one function returning the immediate leaf type. + +**2. Argument direction** — a virtually-derived leaf is registered *without* a declared nanobind +base (per the rule above), so nanobind refuses it wherever a C++ function's parameter type is the +*base* (`void AddAtom(..., const ScatteringPower* pow, ...)` rejects a Python `ScatteringPowerAtom` +with `TypeError: incompatible function arguments`). Fix: accept `nb::object` and resolve manually, +trying the concrete leaf type first: + +```cpp +const ScatteringPower* extractScatteringPowerArg(nb::object obj) { + if (obj.is_none()) return nullptr; + try { return static_cast(&nb::cast(obj)); } catch (...) {} + return &nb::cast(obj); +} +``` + +**3. Generic "any `RefinableObj`" argument functions** — the same argument-direction problem, but +for functions generic over *any* `RefinableObj` (`MonteCarloObj::AddRefinableObj`, +`LSQNumObj::SetRefinedObj`, `RefinableObj::AddPar`): nanobind has no conversion path from a Python +`DiffractionDataSingleCrystal`/`Atom`/`Molecule`/etc. to `RefinableObj&`, since none of those +concrete classes declare that base. Fix: a shared helper (`extractRefinableObjArg`, in +`helpers_nb.hpp`/`nb_refinableobj.cpp`) trying the safe cast first, then falling back through every +known virtually-linked type with `static_cast` (always well-defined at compile time — the problem +is only ever nanobind's own *runtime* offset table, never a real `static_cast`): + +```cpp +RefinableObj& extractRefinableObjArg(nb::object obj) { + try { return nb::cast(obj); } catch (...) {} + try { return static_cast(nb::cast(obj)); } catch (...) {} + try { return static_cast(nb::cast(obj)); } catch (...) {} + try { return static_cast(nb::cast(obj)); } catch (...) {} + try { return static_cast(nb::cast(obj)); } catch (...) {} + try { return static_cast(nb::cast(obj)); } catch (...) {} + return nb::cast(obj); // nothing matched -- raise a clear TypeError +} +``` + +**4. Under-declaring a *safe* base** — the mirror-image mistake: forgetting to declare a nanobind +base across a link that's perfectly safe (plain, non-virtual). Symptom looks identical +(`TypeError: incompatible function arguments`) but the cause is a *missing* declaration, not a +dangerous one. Fix: register the base type too (it needs no bindings of its own, just an internal +name), then declare the relationship normally: +```cpp +nb::class_(m, "_PeakListBase"); // internal-only +nb::class_(m, "PeakList"); // now declared +``` + +### Restoring `RefinableObj`'s method surface on virtually-inherited classes + +Because `Scatterer`, `ScatteringPower`, `ScatteringData`, and `PowderPatternComponent` can never +nanobind-declare `RefinableObj` as their base (per the rule above), none of their ~44 inherited +methods (`Print`, `XMLOutput`/`XMLInput`, `BeginOptimization`/`EndOptimization`, +`GetLogLikelihood`, `UpdateDisplay`, `AddPar`/`RemovePar`, `CreateParamSet`, `GetOption`, ...) are +reachable from Python by default — under Boost.Python, `bases` handled this +transparently via real casts, so this is a genuine regression, not a pre-existing limitation. + +Fix: two reusable template helpers in `helpers_nb.hpp`, `bind_refinableobj_forwarding()` and +`bind_scatteringpower_forwarding()`, each binding one method-set's full surface via plain +forwarding `.def()` calls (`&T::Method`, or a lambda for anything needing a helper/numpy +conversion). This is safe despite the virtual base because `T` is fully known at compile time at +the call site, so the *compiler* resolves the pointer adjustment — exactly the mechanism +Boost.Python relied on, nothing to do with nanobind's own (virtual-base-unsafe) casting. Called +once each in `nb_scatterer.cpp`, `nb_scatteringpower.cpp`, `nb_scatteringdata.cpp`, and +`nb_powderpatterncomponent.cpp` (cascades automatically to every non-virtually-inherited child — +`Atom`, `Molecule`, `ZScatterer`, `PowderPatternBackground`, `PowderPatternDiffraction`, etc. — via +ordinary Python MRO); `ScatteringPowerAtom` and `GlobalScatteringPower` need both helpers called +directly on them, since they have a *second* virtual-inheritance hop of their own. + +**This restores callability, not overridability** — see [Status](#status-2026-08-12) for why that +distinction matters and is a deliberate, accepted scope limit (nanobind's `NB_TRAMPOLINE` macro +requires its argument to be a *direct* base, a hard C++ rule that blocks chained/templated +trampolines the way pybind11 supports them — confirmed by compiler error in a standalone repro, +not a nanobind design choice that could be worked around). + +Two real bugs turned up while adding test coverage for this fix, both worth remembering as general +lessons: +- A binding that reaches a protected member via a trampoline/alias helper class (here, + `PyScatterer::GetClockScattCompList()`, added to reach `Scatterer`'s protected + `mClockScattCompList`) must take the **real base type** (`Scatterer&`) as its bound parameter, + not the trampoline/alias type (`PyScatterer&`) — a plain `Atom`/`Molecule` instance is never + actually constructed as the trampoline, so binding against the alias type raises `TypeError` for + every ordinary instance. Cast through the alias *inside* the lambda instead: + ```cpp + .def("GetClockScattCompList", + [](Scatterer& s) -> const RefinableObjClock& { + return static_cast(s).GetClockScattCompList(); // safe: no added data members + }, nb::rv_policy::reference_internal) + ``` +- `bind_scatteringpower_forwarding()` forwarded `GetBij`/`SetBij` but missed the `B11`/`B12`/ + `B13`/`B22`/`B23`/`B33`/`Biso` *properties* that `nb_scatteringpower.cpp` defines separately via + file-local templates — a reminder that a forwarding helper needs to be checked against the full + `dir()` of the canonical class, not just its method list, when a class also exposes properties. + +--- + +## Other Recurring Gotchas + +### `None` argument handling + +nanobind rejects `None` by default for any typed `nb::arg`. Allow it explicitly: +```cpp +.def("AddScatterer", &Crystal::AddScatterer, nb::arg("pScatt").none(), nb::arg("ownsScatt") = true) +``` +`.none()` is required even for generic `nb::object` parameters — it isn't automatic just because +the C++ parameter type is generic. + +**Limit**: `.none()` only bridges `None -> nullptr` for `nb::object` parameters and pointers to a +`nb::class_`-registered type. It does **not** work for a pointer to a plain arithmetic type (e.g. +`REAL* derivpar` in `RecUnitCell::hkl2d`) — nanobind's arithmetic `type_caster` rejects +`None` outright before `.none()` on the outer `nb::arg` ever gets a chance to matter. Fix: wrap in +a helper taking `nb::object` and bridge manually: +```cpp +float _hkl2d(const RecUnitCell& r, float h, float k, float l, nb::object derivpar, unsigned int derivhkl) { + if (derivpar.is_none()) return r.hkl2d(h, k, l, nullptr, derivhkl); + REAL d = 0; + return r.hkl2d(h, k, l, &d, derivhkl); // Python float is immutable -- there's no way to write +} // the derivative back to the caller regardless of binding tech +``` + +### Custom container types (`CrystVector`/`CrystMatrix`) + +nanobind has no built-in support for ObjCryst++'s custom matrix library. Convert explicitly via a +heap-allocated copy wrapped in an `nb::ndarray` capsule (see `crystvec_to_array`/ +`crystmat_to_array` in `helpers_nb.hpp`). Always use the `CrystVector_REAL`/`CrystMatrix_REAL` +macros, never a hardcoded ``/``, so a future `REAL` macro change doesn't silently +produce wrong-precision code. + +### Lambda return type silently deduced by value + +A `.def(...)` that wraps a reference-returning helper in a lambda **without an explicit trailing +return type** deduces `auto`, which strips the reference and returns *by value* — silently +*copying* the object, even with `nb::rv_policy::reference_internal` set (that policy only controls +how nanobind wraps whatever the lambda actually returns; it can't recover a reference from an +already-copied value). This caused a real bug: `Molecule.AddRigidGroup`'s lambda copied the +`RigidGroup` it had just added, so `Molecule.RemoveRigidGroup` (which finds the group to remove by +pointer identity) silently became a no-op with no error anywhere. + +Fix: always give the lambda an explicit trailing return type when it wraps a reference-returning +helper: `[](...) -> RigidGroup& { return _AddRigidGroupIterable(...); }`. Rule of thumb: any +`.def()` combining a lambda with `nb::rv_policy::reference`/`reference_internal` needs a `-> T&`/ +`-> T*` on the lambda. Binding a bare function pointer directly has no such problem — nothing is +deduced. + +### `keep_alive` reference cycles + +`nanobind: leaked N instances!` warnings are a **real leak**, not a shutdown-ordering artifact — +confirmed by a plain, non-pytest script that creates a `Molecule`, calls `AddBondAngle` once, drops +all references, and calls `gc.collect()` twice: still leaks 6 instances at exit. Root cause: +nanobind types don't participate in Python's cyclic GC by default (no `tp_traverse`/`tp_clear`), +so a bidirectional `keep_alive` between two live objects — parent keeps child alive (a `.def()` +declares `keep_alive<1,N>()`) *and* child keeps parent alive (a `.def()` returns via +`rv_policy::reference_internal`, nanobind's shorthand for `keep_alive<0,1>()`) — forms a cycle +nothing can ever collect. + +Fixed for `Molecule`↔`MolAtom`: removed the redundant Molecule-keeps-atom direction from +`AddBond`/`AddBondAngle`/`AddDihedralAngle` (safe because `MolAtom` has no standalone Python-owned +existence — its only constructor is a copy constructor, so it's always reached via +`GetAtom()`/`AddAtom()`, which already protects it via the *other* direction). + +**Not safe to fix the same way**, and still open: `Crystal`↔`Scatterer`/`Molecule`/ +`ScatteringPower` (and possibly `RefinableObj`↔`RefinablePar`). Unlike `MolAtom`, these classes +*do* have real standalone Python-owned constructors (`sp = ScatteringPowerAtom("C", "C")` with no +parent) — the forward direction is protecting a real gap (between construction and being added to +a `Crystal`, nothing else keeps the child's wrapper alive), so removing it would trade a leak for a +use-after-free. The real fix is nanobind's `tp_traverse`/`tp_clear` mechanism, which likely requires +replacing `keep_alive<>` with explicit `nb::object` members on every class in each cycle — a +substantial redesign, not attempted. When auditing a new class, grep for `keep_alive<1,` and check +whether the same child type also has an accessor using `rv_policy::reference_internal` back onto +the parent — that combination is the signature to look for. + +### Python file-like input (`str` vs `bytes`) + +Any binding calling `.attr("read")()` on a caller-supplied Python object and casting straight to +`std::string` breaks the moment the file was opened in binary mode (`.read()` returns `bytes`, +`nb::cast` throws `std::bad_cast`). Use a shared helper: +```cpp +inline std::string read_pyfile_to_string(nb::object input) { + nb::object data = input.attr("read")(); + if (nb::isinstance(data)) { + nb::bytes b = nb::cast(data); + return std::string(b.c_str(), b.size()); + } + return nb::cast(data); +} +``` + +### `bases<>` mixing in an unrelated class has no nanobind equivalent + +Boost.Python's `bases<>` can mix a wrapped class's Python methods into another wrapped class +regardless of the real C++ inheritance graph — used to give `RigidGroup` (a real +`std::set` subclass) a Python-set interface (`add`/`discard`/`remove`/`update`/ +`__contains__`/`__getitem__`) via an unrelated wrapper class, `MolAtomSet`. nanobind's +`nb::class_` requires `Base` to actually be `T`'s C++ base (or `static_cast`-reachable), +so this doesn't carry over — the interface has to be rebound directly on the real class instead +(done for `RigidGroup` in `nb_rigidgroup.cpp`, including a new `__iter__` nanobind classes don't +get for free the way legacy `__getitem__`-fallback iteration did). If auditing for other silent +interface losses like this, look for any Boost.Python `bases` where `Y` isn't actually `X`'s +C++ base. + +### A vendored C++ core bug, not a binding bug + +`MonteCarloObj`'s optimizer defaults to auto-saving progress, formatting the current +log-likelihood into a filename with `sprintf(buf[30], "...%f", ...)`. For a bad starting +configuration the log-likelihood can be enormous, overflowing the 30-byte buffer; glibc's +fortified `sprintf` aborts the process rather than corrupting the stack — surfacing as an +uncatchable `Fatal Python error: Aborted`, not a Python exception. Fixed in the vendored +`extern/objcryst/ObjCryst/RefinableObj/GlobalOptimObj.cpp` itself (five sites): widened buffers, +switched to `snprintf`, and switched `%f` -> `%g` (bounded length regardless of magnitude). Worth +remembering if `extern/objcryst` is ever re-synced from upstream — that sync would silently drop +this fix unless it's re-applied or merged upstream. + +--- + +## Binding Patterns Quick Reference + +**Simple class, no virtuals:** +```cpp +nb::class_(m, "MyClass") + .def(nb::init<>()) + .def("method", &MyClass::method) + .def_prop_rw("prop", &MyClass::GetProp, &MyClass::SetProp) + ; +``` + +**Class with overridable virtuals (trampoline) — only where `Base` is a *direct*, non-virtual +base of the trampoline, per [Virtual Inheritance](#virtual-inheritance):** +```cpp +struct PyMyClass : MyClass { + NB_TRAMPOLINE(MyClass, 2); // 2 virtual methods + int VirtualMethod1() override { NB_OVERRIDE(int, VirtualMethod1); } + void VirtualMethod2(int x) override { NB_OVERRIDE(void, VirtualMethod2, x); } +}; +nb::class_(m, "MyClass").def(nb::init<>()); +``` + +**String representation** (many ObjCryst objects have a useful `operator<<`): +```cpp +.def("__str__", [](const T& obj){ return obj_str(obj); }) // obj_str() in helpers_nb.hpp, mutes debug spam +.def("__repr__", [](const T& obj){ return obj_str(obj); }) +``` + +**Method overload resolution** — nanobind can't distinguish C++ overloads at binding time; use a +lambda or a pointer-to-member-function cast: +```cpp +.def("SetX", nb::overload_cast(&T::SetX)) +``` + +See [Virtual Inheritance](#virtual-inheritance) for the standalone-registration pattern for +virtually-inherited leaves, and [Other Recurring Gotchas](#other-recurring-gotchas) for `None` +handling, container conversion, lambda return types, `keep_alive`, and file-like input. + +--- + +## Architecture Decisions + +| Decision | Rationale | +|---|---| +| Single `_pyobjcryst` extension | simpler than per-class extensions; nanobind modules can be large | +| Static linking (newmat, cctbx, ObjCryst) | avoids runtime library conflicts on Windows/macOS wheels | +| scikit-build-core + CMake | modern standard for C++ Python extensions, replaces SCons | +| ObjCryst++ as a submodule | tracks upstream, simpler than a fork | +| Vendored newmat/cctbx (not conda-forge `cctbx-base`) | see below | + +**Vendored `cctbx` vs. conda-forge's `cctbx-base`** (investigated, not adopted): `cctbx-base` +does contain the right modules, compiled and working, but isn't structured for third-party C++ +use — no stable `include/` directory (real headers live inside a Python-version-specific +`site-packages` path), no CMake/pkg-config export, a transitive dependency on Boost headers not +otherwise needed, and a ~160 MB/123-package install to obtain four submodules the current vendored +copy already provides in 2.8 MB with zero extra runtime dependencies. Not worth the trade today. If +revisited, the more promising angle is asking upstream cctbx for a minimal +`sgtbx`+`uctbx`+`eltbx`+`miller`-only build target with its own clean `include/` output — not +depending on `cctbx-base` as it currently ships. + +--- + +## Pitfalls Checklist + +**Before writing/extending a binding for class `X`:** +- [ ] Grep `X`'s header and its whole ancestry (not just the direct parent) for `: *virtual + public` — if found, do **not** declare that base in `nb::class_`; use the manual + `dynamic_cast`/`nb::cast` patterns instead + +**While writing:** +- [ ] Every optional pointer/object argument needs `.none()` on its `nb::arg(...)`, including plain + `nb::object` params — except pointers to a plain arithmetic type, where `.none()` has no + effect; wrap those in an `nb::object`-taking helper instead +- [ ] Every function returning a base-typed reference/pointer whose dynamic type is commonly a + virtually-derived leaf needs the `dynamic_cast`-and-recast treatment +- [ ] Every function generically *accepting* a base type as an argument needs its argument routed + through a helper like `extractRefinableObjArg()` +- [ ] Any `.def(...)` combining a lambda with `nb::rv_policy::reference`/`reference_internal` needs + an explicit `-> T&`/`-> T*` trailing return type on the lambda +- [ ] Any binding calling `.attr("read")()` on a caller-supplied object should go through + `read_pyfile_to_string()`, not a raw `nb::cast` +- [ ] Any container type (`CrystVector`, `CrystMatrix`) crossing the boundary should use the + `CrystVector_REAL`/`CrystMatrix_REAL` macros, never a hardcoded ``/`` +- [ ] A binding reaching a protected/private member via a trampoline/alias helper class must take + the *real* base type as its bound parameter, not the trampoline/alias type — otherwise it + raises `TypeError` on every instance not literally constructed as that alias + +**After writing, before declaring done:** +- [ ] Rebuilt and re-ran the specific test file, then the full suite, and confirmed no new failures +- [ ] If the class exposes properties as well as methods, checked the forwarding/coverage against + the full `dir()` of the canonical class, not just its method list +- [ ] If a genuinely new bug class was found, added it to this document with a concrete repro — + the pattern-matching value compounds; most bugs in this migration turned out to be new + instances of an already-documented class, not new classes outright diff --git a/pyproject.toml b/pyproject.toml index 60aa20f3..bc809f9d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,14 @@ [build-system] -requires = ["setuptools>=62.0", "setuptools-git-versioning>=2.0", "numpy"] -build-backend = "setuptools.build_meta" +requires = ["scikit-build-core>=0.9", "nanobind", "numpy"] +build-backend = "scikit_build_core.build" [project] name = "pyobjcryst" -dynamic=['version', 'dependencies'] +# TODO: main uses setuptools-git-versioning (dynamic, tag-based) with +# setuptools.build_meta; scikit-build-core needs a different dynamic-version +# provider to match that exactly. Pinned as a static placeholder for now -- +# revisit before release, see nanobind_migration_notes.md. +version = "2024.2.1.dev0" authors = [ { name="Christopher Farrow" }, { name="Pavol Juhás" }, @@ -18,6 +22,7 @@ description = "Python bindings to the ObjCryst++ library." keywords = ['objcryst', 'atom structure crystallography', 'powder diffraction'] readme = "README.rst" requires-python = ">=3.12, <3.15" +dependencies = ["numpy"] classifiers = [ 'Development Status :: 5 - Production/Stable', 'Environment :: Console', @@ -42,26 +47,12 @@ classifiers = [ Homepage = "https://github.com/diffpy/pyobjcryst/" Issues = "https://github.com/diffpy/pyobjcryst/issues/" -[tool.setuptools-git-versioning] -enabled = true -template = "{tag}" -dev_template = "{tag}" -dirty_template = "{tag}" -# Use this version when git data are not available as in a git zip archive. -# Update when tagging a new release. -starting_version = "2024.2.1" - -[tool.setuptools.packages.find] -where = ["src"] # list of folders that contain the packages (["."] by default) -include = ["*"] # package names should match these glob patterns (["*"] by default) -exclude = [] # exclude packages matching these glob patterns (empty by default) -namespaces = false # to disable scanning PEP 420 namespaces (true by default) - [project.scripts] pyobjcryst = "pyobjcryst.pyobjcryst_app:main" -[tool.setuptools.dynamic] -dependencies = {file = ["requirements/pip.txt"]} +[tool.scikit-build] +cmake.build-type = "Release" +wheel.packages = ["src/pyobjcryst"] [tool.codespell] exclude-file = ".codespell/ignore_lines.txt" @@ -89,8 +80,6 @@ exclude = ''' | buck-out | build | dist - - # The following are specific to Black, you probably don't want those. | blib2to3 | tests/data )/ diff --git a/setup.py b/setup.py deleted file mode 100644 index 26c8f7dd..00000000 --- a/setup.py +++ /dev/null @@ -1,123 +0,0 @@ -#!/usr/bin/env python - -# Installation script for pyobjcryst -"""pyobjcryst - Python bindings to ObjCryst++ Object-Oriented Crystallographic -Library - -Packages: pyobjcryst -""" - -import glob -import os -import sys -import sysconfig -from ctypes.util import find_library -from pathlib import Path - -import numpy as np -from setuptools import Extension, setup - -# Helper functions ----------------------------------------------------------- - - -def get_boost_libraries(): - # the names we'll search for - major, minor = sys.version_info.major, sys.version_info.minor - candidates = [ - f"boost_python{major}{minor}", - f"boost_python{major}", - "boost_python", - ] - - conda_prefix = os.environ.get("CONDA_PREFIX") - if conda_prefix: - libdir = os.path.join(conda_prefix, "lib") - for name in candidates: - so = f"lib{name}.so" - if os.path.isfile(os.path.join(libdir, so)): - # return the plain "boost_python311" etc (no "lib" prefix or ".so") - return [name] - - # fallback to ldconfig - for name in candidates: - found = find_library(name) - if found: - # find_library may return "libboost_python3.so.1.74.0" etc - # strip off lib*.so.* if you like, or just return name - return [name] - - raise RuntimeError("Cannot find a suitable Boost.Python library.") - - -def get_env_config(): - conda_prefix = os.environ.get("CONDA_PREFIX") - if conda_prefix: - if os.name == "nt": - inc = Path(conda_prefix) / "Library" / "include" - lib = Path(conda_prefix) / "Library" / "lib" - else: - inc = Path(conda_prefix) / "include" - lib = Path(conda_prefix) / "lib" - return {"include_dirs": [str(inc)], "library_dirs": [str(lib)]} - - # no conda env: fallback to system/venv Python include/lib dirs - py_inc = sysconfig.get_paths().get("include") - libdir = sysconfig.get_config_var("LIBDIR") or "/usr/lib" - return { - "include_dirs": [p for p in [py_inc] if p], - "library_dirs": [libdir], - } - - -def create_extensions(): - include_dirs = get_env_config().get("include_dirs") + [np.get_include()] - library_dirs = get_env_config().get("library_dirs") - - if os.name == "nt": - objcryst_lib = "libObjCryst" - else: - objcryst_lib = "ObjCryst" - - libraries = [objcryst_lib] + get_boost_libraries() - extra_objects = [] - extra_compile_args = [] - extra_link_args = [] - - define_macros = [] - - if os.name == "nt": - extra_compile_args = [ - "-DBOOST_ERROR_CODE_HEADER_ONLY", - "-DREAL=double", - ] - else: - extra_compile_args = [ - "-std=c++11", - "-DBOOST_ERROR_CODE_HEADER_ONLY", - "-DREAL=double", - "-fno-strict-aliasing", - ] - - ext_kws = { - "include_dirs": include_dirs, - "libraries": libraries, - "library_dirs": library_dirs, - "define_macros": define_macros, - "extra_compile_args": extra_compile_args, - "extra_link_args": extra_link_args, - "extra_objects": extra_objects, - } - ext = Extension( - "pyobjcryst._pyobjcryst", glob.glob("src/extensions/*.cpp"), **ext_kws - ) - return [ext] - - -def ext_modules(): - if set(sys.argv) & {"build_ext", "bdist_wheel", "install"}: - return create_extensions() - return [] - - -if __name__ == "__main__": - setup(ext_modules=ext_modules()) diff --git a/src/extensions/SConscript b/src/extensions/SConscript deleted file mode 100644 index ca5077b5..00000000 --- a/src/extensions/SConscript +++ /dev/null @@ -1,52 +0,0 @@ -import numpy as np -import os -from SCons.Script import Clean - -Import('env') - -# make sure numpy headers are available -env.AppendUnique(CPPPATH=[np.get_include()]) - -# configure the boost_python library, which may have different extensions -if not (GetOption('clean') or env.GetOption('help')): - SConscript('SConscript.configure') - -if env['PLATFORM'] == 'win32': - if env['profile']: - print("Warning: Windows profiling is not enabled; skipping /Gh") -else: - if env['profile']: - env.AppendUnique(CCFLAGS='-pg') - env.AppendUnique(LINKFLAGS='-pg') - -# python extension module -module_nodes = env.SharedLibrary( - '_pyobjcryst', - Glob('*.cpp'), - SHLIBPREFIX='', - SHLIBSUFFIX = '.pyd' if env['PLATFORM']=='win32' else '.so') - -ext_module = module_nodes[0] -installed = env.Install(Dir('#/src/pyobjcryst'), ext_module) - -# run `scons develop` to install the extension in development mode -dev = Alias('dev', installed) -AlwaysBuild(dev) - - -# run `scons test` to run the tests -env['ENV']['PYTHONPATH'] = Dir('#').abspath + os.sep + 'src' -test = env.Alias( - 'test', - ['dev'], - Action('pytest') -) -AlwaysBuild(test) - -# default targets: -Default(module_nodes) - -# clean up the build artifacts -Clean(module_nodes, installed) - -# vim: ft=python diff --git a/src/extensions/SConscript.configure b/src/extensions/SConscript.configure deleted file mode 100644 index 46acb75f..00000000 --- a/src/extensions/SConscript.configure +++ /dev/null @@ -1,91 +0,0 @@ -import platform -from os.path import join as pjoin -import sysconfig - -Import('env', 'pyversion') - -# Helper functions ----------------------------------------------------------- - -def CheckOptimizerFlag(context, flag): - ccflags_save = context.env['CCFLAGS'] - context.Message('Checking if compiler allows {!r}... '.format(flag)) - context.env.Replace(CCFLAGS=[flag]) - result = context.TryCompile('int a;\n', '.cpp') - context.Result(result) - if not result: - ccflags_save.remove(flag) - context.env.Replace(CCFLAGS=ccflags_save) - return result - - -def configure_boost_library(libname): - '''Detect name extension of a boost library and add it to the environment. - - libname -- boost library name without any extension - - Note: CheckLib function automatically adds library to the environment. - ''' - mttags = ['', '-mt'] - boostlibtags = mttags - # check more tags for boost_python - if libname == 'boost_python': - major, minor = pyversion.split('.') - pytags = [major + minor, major, ''] - boostlibtags = [(pt + mt) for mt in mttags for pt in pytags] - # using global conf defined below - for t in boostlibtags: - libnamefull = libname + t - if conf.CheckLib(libnamefull, language='C++'): - return - # library not found here - print('This program requires the %r library.' % libname) - Exit(1) - -# Start configuration -------------------------------------------------------- - -# Anaconda Python is compiled with super fancy gcc optimizer flags. -# Remove any flags that are not supported by the current compiler. -custom_tests = {'CheckOptimizerFlag' : CheckOptimizerFlag} - -conf = Configure(env, custom_tests=custom_tests) -optflags = [o for o in env['CCFLAGS'] - if o[:2] in ('-f', '-m')] -for o in optflags: - conf.CheckOptimizerFlag(o) -conf.Finish() - - -if platform.system().lower() == "windows": - ecfg = env.Clone() - ecfg.Append(LIBS=['libObjCryst']) -else: - # Create configuration environment that links with Python shared_library, so - # that the boost_python check does not fail due to unresolved Python symbols. - ecfg = env.Clone() - ecfg.Append(LIBS=[]) - ecfg.MergeFlags(sysconfig.get_config_var('BLDLIBRARY')) - # make sure there are no implicit dependency nodes in added LIBS - ecfg.Replace(LIBS=[str(n) for n in ecfg['LIBS']]) - newlibsindex = len(ecfg['LIBS']) -conf = Configure(ecfg) - -if platform.system().lower() == "windows": - # Why libObjCryst and not ObjCryst on windows ? - if not conf.CheckLib('libObjCryst', language='C++'): - print("This program requires the 'libObjCryst' library.") - Exit(1) -else: - if not conf.CheckLib('ObjCryst', language='C++'): - print("This program requires the 'libObjCryst' library.") - Exit(1) - -configure_boost_library('boost_python') -conf.Finish() - -if platform.system().lower() != "windows": - # Use libraries that were found in the configuration. - env.AppendUnique(LIBS=ecfg['LIBS'][newlibsindex:]) -else: - env.AppendUnique(LIBS=ecfg['LIBS']) - -# vim: ft=python diff --git a/src/extensions/asymmetricunit_ext.cpp b/src/extensions/asymmetricunit_ext.cpp deleted file mode 100644 index b401ffc5..00000000 --- a/src/extensions/asymmetricunit_ext.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::AsymmetricUnit. -* -*****************************************************************************/ - -#include -#include - -#include - -namespace bp = boost::python; -using namespace boost::python; -using namespace ObjCryst; - -void wrap_asymmetricunit() -{ - - class_("AsymmetricUnit") - // Constructors - .def(init(bp::arg("spg"))) - // Methods - .def("SetSpaceGroup", &AsymmetricUnit::SetSpaceGroup, bp::arg("spg")) - .def("IsInAsymmetricUnit", &AsymmetricUnit::IsInAsymmetricUnit, - (bp::arg("x"), bp::arg("y"), bp::arg("z"))) - .def("Xmin", &AsymmetricUnit::Xmin) - .def("Xmax", &AsymmetricUnit::Xmax) - .def("Ymin", &AsymmetricUnit::Ymin) - .def("Ymax", &AsymmetricUnit::Ymax) - .def("Zmin", &AsymmetricUnit::Zmin) - .def("Zmax", &AsymmetricUnit::Zmax) - ; -} diff --git a/src/extensions/atom_ext.cpp b/src/extensions/atom_ext.cpp deleted file mode 100644 index 6986010c..00000000 --- a/src/extensions/atom_ext.cpp +++ /dev/null @@ -1,72 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::Atom. -* -* Changes from ObjCryst::Atom -* - The default constructor has been disabled. When not followed-up by Init, it -* will cause segmentation faults, even if it is printed. -* -*****************************************************************************/ - -#include -#include - -#include - -#include -#include - -namespace bp = boost::python; -using namespace boost::python; -using namespace ObjCryst; - -namespace { - -// Helper function - avoid dereferencing NULL when Atom is dummy. - -const ScatteringPower* getscatteringpowerpointer(const Atom& a) -{ - const ScatteringPower* rv = - a.IsDummy() ? NULL : &(a.GetScatteringPower()); - return rv; -} - -} // namespace - -void wrap_atom() -{ - class_ >("Atom", init(bp::arg("old"))) - // Constructors - .def(init >( - (bp::arg("x"), bp::arg("y"), bp::arg("z"), bp::arg("name"), - bp::arg("pow"), bp::arg("popu"))) - [with_custodian_and_ward<1,6>()]) - // Methods - .def("Init", &Atom::Init, - (bp::arg("x"), bp::arg("y"), bp::arg("z"), bp::arg("name"), - bp::arg("pow"), bp::arg("popu")=1.0), - with_custodian_and_ward<1,6>()) - .def("GetMass", &Atom::GetMass) - .def("GetRadius", &Atom::GetRadius) - .def("IsDummy", &Atom::IsDummy) - // FIXME - this should be returned as a constant reference. However, I - // can't get this to work. This returns it as an internal reference, - // which is probably a bad idea. - .def("GetScatteringPower", &getscatteringpowerpointer, - return_internal_reference<>()) - //return_value_policy()) - ; -} diff --git a/src/extensions/crystal_ext.cpp b/src/extensions/crystal_ext.cpp deleted file mode 100644 index 9176b0c1..00000000 --- a/src/extensions/crystal_ext.cpp +++ /dev/null @@ -1,431 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::Crystal. -* -* Changes from ObjCryst::Crystal -* - CIFOutput accepts a python file-like object -* - CIFOutput has default mindist = 0, rather than 0.5 -* - CalcDynPopCorr is not enabled, as the API states that this is for internal -* use only. -* - GetScatteringComponentList returns an actual list. -* -* Other Changes -* - CreateCrystalFromCIF is placed here instead of in a separate CIF module. This -* method accepts a python file rather than a CIF object. -* -*****************************************************************************/ - -#include -#include -#include -#include -#include - -#include -#include - -#undef B0 -#include -#include -#include -#include -#include - -#include "python_streambuf.hpp" -#include "helpers.hpp" - -namespace bp = boost::python; -using namespace boost::python; -using namespace ObjCryst; - -namespace { - -// Overloaded so that AddScatterer does not add NULL -void _AddScatterer(Crystal& crystal, Scatterer* scatt) -{ - if(NULL == scatt) - { - PyErr_SetString(PyExc_ValueError, - "Cannot add nonexistent Scatterer"); - throw_error_already_set(); - } - // Make sure the associated ScatteringPower exists in the Crystal - if(scatt->GetClassName()=="Atom") - { - Atom *pat=dynamic_cast(scatt); - if(!(pat->IsDummy())) - { - const ScatteringPower *psp = &pat->GetScatteringPower(); - if(crystal.GetScatteringPowerRegistry().Find(psp)<0) - throw ObjCryst::ObjCrystException("The Atom's scattering power must be added to the Crystal first."); - } - } - else if(scatt->GetClassName()=="Molecule") - { - Molecule *pm=dynamic_cast(scatt); - for(int i=0; iGetNbComponent(); i++) - { - if(!(pm->GetAtom(i).IsDummy())) - { - if(crystal.GetScatteringPowerRegistry().Find(&(pm->GetAtom(i).GetScatteringPower()))<0) - throw ObjCryst::ObjCrystException("The Molecule or Polyhedra scattering powers must be added to the Crystal first."); - } - } - } - - crystal.AddScatterer(scatt); -} - -// Overloaded so that RemoveScatterer cannot delete the passed scatterer -void _RemoveScatterer(Crystal& crystal, Scatterer* scatt) -{ - if(NULL == scatt) - { - PyErr_SetString(PyExc_ValueError, - "Cannot remove nonexistent Scatterer"); - throw_error_already_set(); - } - - crystal.RemoveScatterer(scatt, false); -} - -// Overload to handle invalid index values -Scatterer& _GetScattByIndex(Crystal& crystal, int idx) -{ - int i = check_index(idx, crystal.GetNbScatterer(), ALLOW_NEGATIVE); - return crystal.GetScatt(i); -} - - -// Overload to handle invalid names -Scatterer* _GetScattByName(Crystal& crystal, const std::string& name) -{ - Scatterer* rv = NULL; - try - { - CaptureStdOut gag; - rv = &(crystal.GetScatt(name)); - } - catch (ObjCrystException e) - { - rv = NULL; - } - if (!rv) - { - bp::object emsg = ("Invalid atom name %r" % bp::make_tuple(name)); - PyErr_SetObject(PyExc_ValueError, emsg.ptr()); - throw_error_already_set(); - } - return rv; -} - - -// Overloaded so that AddScatteringPower does not add NULL -void _AddScatteringPower(Crystal& crystal, ScatteringPower* scattpow) -{ - if(NULL == scattpow) - { - PyErr_SetString(PyExc_ValueError, - "Cannot add nonexistent ScatteringPower"); - throw_error_already_set(); - } - crystal.AddScatteringPower(scattpow); -} - - -// Overloaded so that RemoveScatteringPower cannot delete the passed -// scatteringpower -void _RemoveScatteringPower(Crystal& crystal, ScatteringPower* scattpow) -{ - if(NULL == scattpow) - { - PyErr_SetString(PyExc_ValueError, - "Cannot remove nonexistent ScatteringPower"); - throw_error_already_set(); - } - crystal.RemoveScatteringPower(scattpow, false); -} - -void _PrintMinDistanceTable(const Crystal& crystal, - const double minDistance = 0.1) -{ - - crystal.PrintMinDistanceTable(minDistance); -} - -// We want to turn a ScatteringComponentList into an actual list -bp::list _GetScatteringComponentList(Crystal& c) -{ - const ScatteringComponentList& scl = c.GetScatteringComponentList(); - bp::list l; - for(int i = 0; i < scl.GetNbComponent(); ++i) - { - l.append(scl(i)); - } - - return l; -} - - -void _CIFOutput(Crystal& c, bp::object output, double mindist) -{ - boost_adaptbx::python::ostream os(output); - c.CIFOutput(os, mindist); - os.flush(); -} - -std::string _CIF(const Crystal &c, double mindist) -{ - std::stringstream s; - c.CIFOutput(s, mindist); - return s.str(); -} - -void _ImportCrystalFromCIF(Crystal &cryst, bp::object input, - const bool oneScatteringPowerPerElement=false, - const bool connectAtoms=false) -{ - // Reading a cif file creates some output via fpObjCrystInformUser. - // Mute the output and restore it on return or exception. - // Also mute any hardcoded output to cout. - MuteObjCrystUserInfo muzzle; - CaptureStdOut gag; - - boost_adaptbx::python::streambuf sbuf(input); - boost_adaptbx::python::streambuf::istream in(sbuf); - ObjCryst::CIF cif(in); - - const bool verbose = false; - const bool checkSymAsXYZ = true; - ObjCryst::CreateCrystalFromCIF(cif, verbose, checkSymAsXYZ, oneScatteringPowerPerElement, - connectAtoms, &cryst); - - gag.release(); - muzzle.release(); -} - - -// wrap the virtual functions that need it -class CrystalWrap : public Crystal, public wrapper -{ - - public: - - CrystalWrap() : Crystal() - { - SetDeleteSubObjInDestructor(false); - SetDeleteRefParInDestructor(false); - } - - CrystalWrap(const Crystal& c) : Crystal(c) - { - SetDeleteSubObjInDestructor(false); - SetDeleteRefParInDestructor(false); - } - - CrystalWrap(const double a, const double b, const double c , - const std::string& sg) - : Crystal(a, b, c, sg) - { - SetDeleteSubObjInDestructor(false); - SetDeleteRefParInDestructor(false); - } - - CrystalWrap(const double a, const double b, const double c , - const double alpha, const double beta, const double gamma, - const std::string& sg) - : Crystal(a, b, c, alpha, beta, gamma, sg) - { - SetDeleteSubObjInDestructor(false); - SetDeleteRefParInDestructor(false); - } - - const ScatteringComponentList& default_GetScatteringComponentList() const - { return this->Crystal::GetScatteringComponentList(); } - - const ScatteringComponentList& GetScatteringComponentList() const - { - override f = this->get_override("GetScatteringComponentList"); - if (f) return f(); - return default_GetScatteringComponentList(); - } - - void default_UpdateDisplay() const - { this->Crystal::UpdateDisplay();} - - virtual void UpdateDisplay() const - { - override f = this->get_override("UpdateDisplay"); - if (f) f(); - else default_UpdateDisplay(); - } - -}; - -// Easier than exposing all the CIF classes -// Also allow oneScatteringPowerPerElement and connectAtoms - -Crystal* -_CreateCrystalFromCIF(bp::object input, - const bool oneScatteringPowerPerElement=false, - const bool connectAtoms=false) -{ - // Reading a cif file creates some output via fpObjCrystInformUser. - // Mute the output and restore it on return or exception. - // Also mute any hardcoded output to cout. - MuteObjCrystUserInfo muzzle; - CaptureStdOut gag; - - boost_adaptbx::python::streambuf sbuf(input); - boost_adaptbx::python::streambuf::istream in(sbuf); - ObjCryst::CIF cif(in); - - int idx0 = gCrystalRegistry.GetNb(); - - const bool verbose = false; - const bool checkSymAsXYZ = true; - ObjCryst::CreateCrystalFromCIF(cif, verbose, checkSymAsXYZ, - oneScatteringPowerPerElement, connectAtoms); - - gag.release(); - muzzle.release(); - - int idx = gCrystalRegistry.GetNb(); - if(idx == idx0) - { - throw ObjCryst::ObjCrystException("Cannot create crystal from CIF"); - } - idx--; - - ObjCryst::Crystal* c = &gCrystalRegistry.GetObj( idx ); - c->SetDeleteSubObjInDestructor(false); - c->SetDeleteRefParInDestructor(false); - - return c; -} - - -} // namespace - - -void wrap_crystal() -{ - scope().attr("refpartype_crystal") = object(ptr(gpRefParTypeCrystal)); - // Global object registry - scope().attr("gCrystalRegistry") = boost::cref(gCrystalRegistry); - - class_, boost::noncopyable>("Crystal") - /* Constructors */ - .def(init( - (bp::arg("a"), bp::arg("b"), bp::arg("c"), - bp::arg("SpaceGroupId")))) - .def(init( - (bp::arg("a"), bp::arg("b"), bp::arg("c"), - bp::arg("alpha"), bp::arg("beta"), bp::arg("gamma"), - bp::arg("SpaceGroupId")))) - .def(init(bp::arg("oldCryst"))) - /* Methods */ - .def("AddScatterer", &_AddScatterer, - with_custodian_and_ward<1,2,with_custodian_and_ward<2,1> >()) - .def("RemoveScatterer", &_RemoveScatterer) - .def("GetNbScatterer", &Crystal::GetNbScatterer) - .def("GetScatt", _GetScattByName, return_internal_reference<>()) - .def("GetScatt", _GetScattByIndex, return_internal_reference<>()) - .def("GetScatterer", _GetScattByName, return_internal_reference<>()) - .def("GetScatterer", _GetScattByIndex, return_internal_reference<>()) - .def("GetScattererRegistry", ( ObjRegistry& - (Crystal::*) ()) &Crystal::GetScattererRegistry, - return_internal_reference<>()) - .def("GetScatteringPowerRegistry", ( ObjRegistry& - (Crystal::*) ()) &Crystal::GetScatteringPowerRegistry, - return_internal_reference<>()) - .def("AddScatteringPower", &_AddScatteringPower, - with_custodian_and_ward<1,2,with_custodian_and_ward<2,1> >()) - .def("RemoveScatteringPower", &_RemoveScatteringPower) - .def("GetScatteringPower", - (ScatteringPower& (Crystal::*)(const std::string&)) - &Crystal::GetScatteringPower, - return_internal_reference<>()) - .def("GetMasterClockScatteringPower", - &Crystal::GetMasterClockScatteringPower, - return_value_policy()) - .def("GetScatteringComponentList", &_GetScatteringComponentList) - .def("GetClockScattCompList", &Crystal::GetClockScattCompList, - return_value_policy()) - .def("GetMinDistanceTable", &Crystal::GetMinDistanceTable, - (bp::arg("minDistance")=1.0)) - .def("PrintMinDistanceTable", &_PrintMinDistanceTable, - (bp::arg("minDistance")=1.0)) - //.def("CalcDynPopCorr", &Crystal::CalcDynPopCorr, - // (bp::arg("overlapDist")=1.0, - // bp::arg("mergeDist")=0.0)) - .def("ResetDynPopCorr", &Crystal::ResetDynPopCorr) - .def("SetUseDynPopCorr", &Crystal::SetUseDynPopCorr) - .def("GetUseDynPopCorr", &Crystal::GetUseDynPopCorr) - .def("GetBumpMergeCost", &Crystal::GetBumpMergeCost) - .def("SetBumpMergeDistance", - (void (Crystal::*)(const ScatteringPower&, const ScatteringPower&, const double)) - &Crystal::SetBumpMergeDistance, - (bp::arg("scatt1"), - bp::arg("scatt2"), - bp::arg("dist")=1.5)) - .def("SetBumpMergeDistance", - (void (Crystal::*) - (const ScatteringPower&, const ScatteringPower&, const double, const - bool)) - &Crystal::SetBumpMergeDistance, - (bp::arg("scatt1"), - bp::arg("scatt2"), - bp::arg("dist"), - bp::arg("allowMerge"))) - .def("RemoveBumpMergeDistance", &Crystal::RemoveBumpMergeDistance) - .def("GetBumpMergeParList", (Crystal::VBumpMergePar& (Crystal::*)()) - &Crystal::GetBumpMergeParList, return_internal_reference<>()) - .def("GetClockScattererList", &Crystal::GetClockScattererList, - return_value_policy()) - .def("CIFOutput", &_CIFOutput, (bp::arg("file"), bp::arg("mindist")=0)) - .def("CIF", &_CIF, (bp::arg("mindist")=0)) - .def("AddBondValenceRo", &Crystal::AddBondValenceRo) - .def("RemoveBondValenceRo", &Crystal::AddBondValenceRo) - .def("GetBondValenceCost", &Crystal::GetBondValenceCost) - .def("GetBondValenceRoList", - (std::map< pair< const ScatteringPower *, const ScatteringPower * >, double > & - (Crystal::*)()) &Crystal::GetBondValenceRoList, - return_internal_reference<>()) - .def("ConnectAtoms", &Crystal::ConnectAtoms, - (bp::arg("min_relat_dist")=0.4, bp::arg("max_relat_dist")=1.3, - bp::arg("warnuser_fail")=false)) - .def("GetFormula", &Crystal::GetFormula) - .def("GetWeight", &Crystal::GetWeight) - .def("ImportCrystalFromCIF", &_ImportCrystalFromCIF, (bp::arg("input"), - bp::arg("oneScatteringPowerPerElement")=false, - bp::arg("connectAtoms")=false)) - .def("UpdateDisplay", &Crystal::UpdateDisplay, - &CrystalWrap::default_UpdateDisplay) - ; - - - class_("BumpMergePar", no_init) - .def_readwrite("mDist2", &Crystal::BumpMergePar::mDist2) - .def_readwrite("mCanOverlap", &Crystal::BumpMergePar::mCanOverlap) - ; - - def("CreateCrystalFromCIF", &_CreateCrystalFromCIF, - (bp::arg("file"), bp::arg("oneScatteringPowerPerElement")=false, - bp::arg("connectAtoms")=false), - return_value_policy()); -} diff --git a/src/extensions/diffractiondatasinglecrystal_ext.cpp b/src/extensions/diffractiondatasinglecrystal_ext.cpp deleted file mode 100644 index decc91e5..00000000 --- a/src/extensions/diffractiondatasinglecrystal_ext.cpp +++ /dev/null @@ -1,199 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst Complex Modeling Initiative -* (c) 2015 Brookhaven Science Associates -* Brookhaven National Laboratory. -* All rights reserved. -* -* File coded by: Vincent Favre-Nicolin, Kevin Knox -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::DiffractionDataSingleCrystal. -* Changes from ObjCryst::DiffractionDataSingleCrystal -* - SetHklIobs takes float(64) H, K, L arrays rather than long integers - easier -* because passing numpy int array seesm complicated, and more practical anyway -* since GetH() GetK() GetL() functions from ScatteringData natively use floats. -*****************************************************************************/ - -#include -#include -#include -#include -#include -#undef B0 - -#include - -#include -#include -#include -#include - -#include "python_streambuf.hpp" -#include "helpers.hpp" - -namespace bp = boost::python; -using namespace boost::python; -using namespace ObjCryst; - -namespace { - -DiffractionDataSingleCrystal* _CreateSingleCrystalDataFromCIF(bp::object input, Crystal &cryst) -{ - // Reading a cif file creates some output via fpObjCrystInformUser. - // Mute the output and restore it on return or exception. - // Also mute any hardcoded output to cout. - MuteObjCrystUserInfo muzzle; - CaptureStdOut gag; - - boost_adaptbx::python::streambuf sbuf(input); - boost_adaptbx::python::streambuf::istream in(sbuf); - ObjCryst::CIF cif(in); - - int idx0 = gDiffractionDataSingleCrystalRegistry.GetNb(); - - ObjCryst::DiffractionDataSingleCrystal* d = - ObjCryst::CreateSingleCrystalDataFromCIF(cif, &cryst); - - gag.release(); - muzzle.release(); - - int idx = gDiffractionDataSingleCrystalRegistry.GetNb(); - if(idx == idx0) - { - throw ObjCryst::ObjCrystException("Cannot create single crystal diffraction data from CIF"); - } - - return d; -} - -void setdiffractiondatasinglecrystal_iobs(DiffractionDataSingleCrystal& diff, bp::object iobs) -{ - CrystVector_REAL iiobs; - assignCrystVector(iiobs, iobs); - if(iiobs.size() != diff.GetIobs().size()) - throw ObjCryst::ObjCrystException("DiffractionDataSingleCrystal::SetIobs(): " - "number of elements does not match the previous Iobs list. " - "Use SetHklIobs if you want to change the number of reflections."); - MuteObjCrystUserInfo muzzle; - diff.SetIobs(iiobs); -} - -void setdiffractiondatasinglecrystal_sigma(DiffractionDataSingleCrystal& diff, bp::object sigma) -{ - CrystVector_REAL ssigma; - assignCrystVector(ssigma, sigma); - if(ssigma.size() != diff.GetIobs().size()) - throw ObjCryst::ObjCrystException("DiffractionDataSingleCrystal::SetSigma(): " - "number of elements does not match the Iobs list. " - "Use SetHklIobs if you want to change the number of reflections."); - MuteObjCrystUserInfo muzzle; - diff.SetSigma(ssigma); -} - -// TODO: For SetHklIobs we should pass directly an integer array but that seems difficult-passed numpy arrays -// are always interpreted as doubles (?). It's more practical this way. -void assignCrystVector(CrystVector& cv, bp::object obj) -{ - bp::stl_input_iterator begin(obj), end; - std::list values(begin, end); - cv.resize(values.size()); - std::list::const_iterator vv = values.begin(); - long* dst = cv.data(); - for (; vv != values.end(); ++vv, ++dst) *dst = lround(*vv); -} - -void setdiffractiondatasinglecrystal_hkliobs(DiffractionDataSingleCrystal& diff, - bp::object h,bp::object k, bp::object l, - bp::object iobs, bp::object sigma) -{ - CrystVector hh; - assignCrystVector(hh, h); - CrystVector kk; - assignCrystVector(kk, k); - CrystVector ll; - assignCrystVector(ll, l); - CrystVector_REAL iiobs; - assignCrystVector(iiobs, iobs); - CrystVector_REAL ssigma; - assignCrystVector(ssigma, sigma); - - if(hh.size() != kk.size()) - throw ObjCryst::ObjCrystException("DiffractionDataSingleCrystal::SetHklIobs(): h and k array sizes differ"); - if(hh.size() != ll.size()) - throw ObjCryst::ObjCrystException("DiffractionDataSingleCrystal::SetHklIobs(): h and l array sizes differ"); - if(hh.size() != iiobs.size()) - throw ObjCryst::ObjCrystException("DiffractionDataSingleCrystal::SetHklIobs(): h and iobs array sizes differ"); - if(hh.size() != ssigma.size()) - throw ObjCryst::ObjCrystException("DiffractionDataSingleCrystal::SetHklIobs(): h and sigma array sizes differ"); - - MuteObjCrystUserInfo muzzle; - diff.SetHklIobs(hh, kk, ll, iiobs, ssigma); -} - - -} // namespace - -void wrap_diffractiondatasinglecrystal() -{ - // Global object registry - scope().attr("gDiffractionDataSingleCrystalRegistry") = object(boost::cref(gDiffractionDataSingleCrystalRegistry)); - - class_ >( - "DiffractionDataSingleCrystal", - init((bp::arg("cryst"), bp::arg("regist")=true)) - [with_custodian_and_ward<1,2>()]) - // FIXME ... add crystal-less constructor - .def("GetIcalc", &DiffractionDataSingleCrystal::GetIcalc, - return_value_policy()) - .def("GetIobs", &DiffractionDataSingleCrystal::GetIobs, - return_value_policy()) - .def("GetSigma", &DiffractionDataSingleCrystal::GetSigma, - return_value_policy()) - .def("SetIobs", - &setdiffractiondatasinglecrystal_iobs, - bp::arg("iobs")) - .def("SetSigma", - &setdiffractiondatasinglecrystal_sigma, - bp::arg("sigma")) - .def("SetHklIobs", - &setdiffractiondatasinglecrystal_hkliobs, - (bp::arg("h"),bp::arg("k"),bp::arg("l"), bp::arg("iobs"), bp::arg("sigma"))) - .def("SetIobsToIcalc", &DiffractionDataSingleCrystal::SetIobsToIcalc) - .def("GetRw", &DiffractionDataSingleCrystal::GetRw) - .def("GetR", &DiffractionDataSingleCrystal::GetR) - .def("GetChi2", &DiffractionDataSingleCrystal::GetChi2) - .def("FitScaleFactorForRw", &DiffractionDataSingleCrystal::FitScaleFactorForRw) - .def("FitScaleFactorForR", &DiffractionDataSingleCrystal::FitScaleFactorForR) - // TODO: These functions should print a limited number of reflections - problems otherwise - .def("PrintObsData", &DiffractionDataSingleCrystal::PrintObsData) - .def("PrintObsCalcData", &DiffractionDataSingleCrystal::PrintObsCalcData) - .def("SetUseOnlyLowAngleData", &DiffractionDataSingleCrystal::SetUseOnlyLowAngleData) - .def("SaveHKLIobsIcalc", &DiffractionDataSingleCrystal::SaveHKLIobsIcalc) - .def("GetLogLikelihood", &DiffractionDataSingleCrystal::GetLogLikelihood) - .def("ImportHklIobs", &DiffractionDataSingleCrystal::ImportHklIobs, - (bp::arg("fileName"), bp::arg("nbRefl"), bp::arg("skipLines")=0)) - .def("ImportHklIobsSigma", &DiffractionDataSingleCrystal::ImportHklIobsSigma, - (bp::arg("fileName"), bp::arg("nbRefl"), bp::arg("skipLines")=0)) - .def("ImportShelxHKLF4", &DiffractionDataSingleCrystal::ImportShelxHKLF4) - .def("ImportCIF", &DiffractionDataSingleCrystal::ImportCIF) - .def("SetWavelength", - (void(DiffractionDataSingleCrystal::*)(const REAL)) - &DiffractionDataSingleCrystal::SetWavelength, - bp::arg("wavelength")) - .def("SetWavelength", - (void (DiffractionDataSingleCrystal::*)(const string&, const REAL)) - &DiffractionDataSingleCrystal::SetWavelength, - (bp::arg("XRayTubeElementName"), bp::arg("alpha2Alpha2ratio")=0.5)) - .def("SetEnergy", &DiffractionDataSingleCrystal::SetEnergy, - bp::arg("nrj_kev")) - ; - def("CreateSingleCrystalDataFromCIF", - &_CreateSingleCrystalDataFromCIF, (bp::arg("file"), bp::arg("crystal")), - with_custodian_and_ward_postcall<0,2, - return_value_policy >()); -} diff --git a/src/extensions/general_ext.cpp b/src/extensions/general_ext.cpp deleted file mode 100644 index e9c7ad25..00000000 --- a/src/extensions/general_ext.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to general structures and objects defined in -* ObjCryst/ObjCryst/General.h -* -*****************************************************************************/ - -#include -#include -#include - -#include -#include - -#if LIBOBJCRYST_VERSION < 2017002002000LL -#error pyobjcryst requires libobjcryst 2017.2.2 or later. -#endif - -using namespace boost::python; -using namespace ObjCryst; - -// wrappers ------------------------------------------------------------------ - -namespace { - -const char* doc__get_libobjcryst_version_info_dict = "\ -Return dictionary with version data for the loaded libobjcryst library.\n\ -"; - -dict get_libobjcryst_version_info_dict() -{ - dict rv; - rv["version"] = libobjcryst_version_info::version; - rv["version_str"] = libobjcryst_version_info::version_str; - rv["major"] = libobjcryst_version_info::major; - rv["minor"] = libobjcryst_version_info::minor; - rv["micro"] = libobjcryst_version_info::micro; - rv["date"] = libobjcryst_version_info::date; - rv["git_commit"] = libobjcryst_version_info::git_commit; - rv["patch"] = libobjcryst_version_info::patch; - return rv; -} - -} // namespace - -// --------------------------------------------------------------------------- - -void wrap_general() -{ - enum_("RadiationType") - .value("RAD_NEUTRON", RAD_NEUTRON) - .value("RAD_XRAY", RAD_XRAY) - .value("RAD_ELECTRON", RAD_ELECTRON) - ; - - // Only import wavelength types actually used - enum_("WavelengthType") - .value("WAVELENGTH_MONOCHROMATIC", WAVELENGTH_MONOCHROMATIC) - .value("WAVELENGTH_ALPHA12", WAVELENGTH_ALPHA12) - .value("WAVELENGTH_TOF", WAVELENGTH_TOF) - ; - - def("_get_libobjcryst_version_info_dict", - get_libobjcryst_version_info_dict, - doc__get_libobjcryst_version_info_dict); -} diff --git a/src/extensions/globaloptim_ext.cpp b/src/extensions/globaloptim_ext.cpp deleted file mode 100644 index f2d57493..00000000 --- a/src/extensions/globaloptim_ext.cpp +++ /dev/null @@ -1,220 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst -* -* File coded by: Vincent Favre-Nicolin -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::GlobalOptimObj and ObjCryst::MonteCarloObj. -* -* Changes from ObjCryst::MonteCarloObj: -* - add access to mAutoLSQ option -* -* Other Changes -* -*****************************************************************************/ - -#include -#include -#include -#include - -#include -#include "helpers.hpp" - -namespace bp = boost::python; -using namespace boost::python; -using namespace ObjCryst; - -namespace { - -// Overload MonteCarlo class so that it does not auto-save to XML -class MonteCarloObjWrap: public MonteCarloObj, public wrapper -{ - public: - MonteCarloObjWrap(): - MonteCarloObj() - { - this->GetOption("Save Best Config Regularly").SetChoice(0); - } - - MonteCarloObjWrap(const string name): - MonteCarloObj(name) - { - this->GetOption("Save Best Config Regularly").SetChoice(0); - } - - MonteCarloObjWrap(const MonteCarloObj &old): - MonteCarloObj(old) - {} - - void default_UpdateDisplay() const - { this->MonteCarloObj::UpdateDisplay();} - - virtual void UpdateDisplay() const - { - override f = this->get_override("UpdateDisplay"); - if (f) f(); - // Always call the default UpdateDisplay, which updates all - // other objects display - default_UpdateDisplay(); - } - -}; - -void run_optimize(MonteCarloObj& obj, long nbSteps, const bool silent, - const double finalcost, const double maxTime) -{ - CaptureStdOut gag; - obj.Optimize(nbSteps, silent, finalcost, maxTime); -} - -void multirun_optimize(MonteCarloObj& obj, long nbCycle, long nbSteps, - const bool silent, const double finalcost, const double maxTime) -{ - CaptureStdOut gag; - obj.MultiRunOptimize(nbCycle, nbSteps, silent, finalcost, maxTime); -} - -void mc_sa(MonteCarloObj& obj, long nbSteps, const bool silent, - const double finalcost, const double maxTime) -{ - CaptureStdOut gag; - obj.RunSimulatedAnnealing(nbSteps, silent, finalcost, maxTime); -} - -void mc_pt(MonteCarloObj& obj, long nbSteps, const bool silent, - const double finalcost, const double maxTime) -{ - CaptureStdOut gag; - obj.RunParallelTempering(nbSteps, silent, finalcost, maxTime); -} - -/* -void mc_random_lsq(MonteCarloObjWrap& obj, long nbCycle) -{ - obj.RunRandomLSQMethod(nbCycle); -} -*/ - -} // namespace - - -void wrap_globaloptim() -{ - // Global object registry - scope().attr("gOptimizationObjRegistry") = boost::cref(gOptimizationObjRegistry); - - enum_("AnnealingSchedule") - .value("CONSTANT", ANNEALING_CONSTANT) - .value("BOLTZMANN", ANNEALING_BOLTZMANN) - .value("CAUCHY", ANNEALING_CAUCHY) - .value("EXPONENTIAL", ANNEALING_EXPONENTIAL) - .value("SMART", ANNEALING_SMART) - .value("GAMMA", ANNEALING_GAMMA) - ; - - enum_("GlobalOptimType") - .value("SIMULATED_ANNEALING", GLOBAL_OPTIM_SIMULATED_ANNEALING) - .value("PARALLEL_TEMPERING", GLOBAL_OPTIM_PARALLEL_TEMPERING) - .value("RANDOM_LSQ", GLOBAL_OPTIM_RANDOM_LSQ) - .value("SIMULATED_ANNEALING_MULTI", GLOBAL_OPTIM_SIMULATED_ANNEALING_MULTI) - .value("PARALLEL_TEMPERING_MULTI", GLOBAL_OPTIM_PARALLEL_TEMPERING_MULTI) - ; - - class_("MonteCarlo") - .def(init<>()) - .def(init(bp::arg("old"))) - .def(init(bp::arg("name"))) - //////////////// OptimizationObj methods - .def("RandomizeStartingConfig", &MonteCarloObj::RandomizeStartingConfig) - .def("Optimize", &run_optimize, - (bp::arg("nbSteps"), bp::arg("silent")=false, - bp::arg("finalcost")=0.0, bp::arg("maxTime")=-1)) - .def("MultiRunOptimize", &multirun_optimize, - (bp::arg("nbCycle"), bp::arg("nbSteps"), bp::arg("silent")=false, - bp::arg("finalcost")=0.0, bp::arg("maxTime")=-1)) - .def("FixAllPar", &MonteCarloObj::FixAllPar) - .def("SetParIsFixed", (void (MonteCarloObj::*)(const std::string&, const bool)) - &MonteCarloObj::SetParIsFixed) - .def("SetParIsFixed", (void (MonteCarloObj::*)(const RefParType*, const bool)) - &MonteCarloObj::SetParIsFixed) - .def("UnFixAllPar", &MonteCarloObj::UnFixAllPar) - .def("SetParIsUsed", (void (MonteCarloObj::*)(const std::string&, const bool)) - &MonteCarloObj::SetParIsUsed) - .def("SetParIsUsed", (void (MonteCarloObj::*)(const RefParType*, const bool)) - &MonteCarloObj::SetParIsUsed) - .def("SetLimitsRelative", ( void (MonteCarloObj::*) - (const std::string&, const double, const double) ) - &MonteCarloObj::SetLimitsRelative) - .def("SetLimitsRelative", ( void (MonteCarloObj::*) - (const RefParType*, const double, const double) ) - &MonteCarloObj::SetLimitsRelative) - .def("SetLimitsAbsolute", ( void (MonteCarloObj::*) - (const std::string&, const double, const double) ) - &MonteCarloObj::SetLimitsAbsolute) - .def("SetLimitsAbsolute", ( void (MonteCarloObj::*) - (const RefParType*, const double, const double) ) - &MonteCarloObj::SetLimitsAbsolute) - .def("GetLogLikelihood", &MonteCarloObj::GetLogLikelihood) - .def("StopAfterCycle", &MonteCarloObj::StopAfterCycle) - .def("AddRefinableObj", &MonteCarloObj::AddRefinableObj, - bp::arg("obj"), - with_custodian_and_ward<1,2>()) - .def("GetFullRefinableObj", &MonteCarloObj::GetFullRefinableObj, - bp::arg("rebuild")=true, - with_custodian_and_ward_postcall<1,0, return_internal_reference<> >()) - .def("GetName", &MonteCarloObj::GetName, return_value_policy()) - .def("SetName", &MonteCarloObj::SetName) - .def("GetClassName", &MonteCarloObj::GetClassName) - .def("Print", &MonteCarloObj::Print, &MonteCarloObj::Print) - .def("RestoreBestConfiguration", &MonteCarloObj::RestoreBestConfiguration) - .def("GetNbParamSet", &MonteCarloObj::GetNbParamSet) - .def("GetParamSetIndex", &MonteCarloObj::GetParamSetIndex) - .def("GetParamSetCost", &MonteCarloObj::GetParamSetCost) - .def("RestoreParamSet", &MonteCarloObj::RestoreParamSet, (bp::arg("idx"), bp::arg("update_display")=true)) - .def("IsOptimizing", &MonteCarloObj::IsOptimizing) - .def("GetLastOptimElapsedTime", &MonteCarloObj::GetLastOptimElapsedTime) - //.def("GetMainTracker", &MonteCarloObj::GetMainTracker) - //.add_property("name", &MonteCarloObj::GetName, &MonteCarloObj::SetName) - .def("GetNbOption", &MonteCarloObj::GetNbOption) - .def("GetOption", (RefObjOpt& (MonteCarloObj::*)(const unsigned int)) - &MonteCarloObj::GetOption, - return_internal_reference<>()) - .def("GetOption", (RefObjOpt& (MonteCarloObj::*)(const string&)) - &MonteCarloObj::GetOption, - with_custodian_and_ward_postcall<1,0,return_internal_reference<> >()) - .add_property("trial", &MonteCarloObj::GetTrial) - .add_property("run", &MonteCarloObj::GetRun) - .add_property("llk", &MonteCarloObj::GetLogLikelihood) - - //////////////// MonteCarlo methods - .def("SetAlgorithmParallTempering", &MonteCarloObj::SetAlgorithmParallTempering, - (bp::arg("scheduleTemp"), bp::arg("tMax"), bp::arg("tMin"), - bp::arg("scheduleMutation")=ANNEALING_SMART, - bp::arg("mutMax")=16, bp::arg("mutMin")=.125)) - .def("SetAlgorithmSimulAnnealing", &MonteCarloObj::SetAlgorithmSimulAnnealing, - (bp::arg("scheduleTemp"), bp::arg("tMax"), bp::arg("tMin"), - bp::arg("scheduleMutation")=ANNEALING_SMART, - bp::arg("mutMax")=16, bp::arg("mutMin")=.125, - bp::arg("nbTrialRetry")=0, bp::arg("minCostRetry")=0.)) - .def("RunSimulatedAnnealing", &mc_sa, - (bp::arg("nbSteps"), bp::arg("silent")=false, - bp::arg("finalcost")=0.0, bp::arg("maxTime")=-1)) - .def("RunParallelTempering", &mc_pt, - (bp::arg("nbSteps"), bp::arg("silent")=false, - bp::arg("finalcost")=0.0, bp::arg("maxTime")=-1)) - // TODO: seems unstable - //.def("RunRandomLSQ", &mc_random_lsq, - // bp::arg("nbCycle")) - .def("GetLSQObj", - (LSQNumObj& (MonteCarloObj::*)()) &MonteCarloObj::GetLSQObj, - with_custodian_and_ward_postcall<1,0, return_internal_reference<> >()) - .def("InitLSQ", &MonteCarloObj::InitLSQ, - bp::arg("useFullPowderPatternProfile")=true) - ; -} diff --git a/src/extensions/globalscatteringpower_ext.cpp b/src/extensions/globalscatteringpower_ext.cpp deleted file mode 100644 index 477f63be..00000000 --- a/src/extensions/globalscatteringpower_ext.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::GlobalScatteringPower from -* ObjCryst/ObjCryst/ZScatterer.h -* -*****************************************************************************/ - -#include - -#include -#include - -using namespace boost::python; -using namespace ObjCryst; - -void wrap_globalscatteringpower() -{ - - typedef void (GlobalScatteringPower::*GSPInitType)(const ZScatterer&); - GSPInitType theinit = &GlobalScatteringPower::Init; - - class_ >("GlobalScatteringPower") - .def(init()) - .def(init()) - .def("Init", theinit) - .def("GetRadius", &GlobalScatteringPower::GetRadius) - ; -} diff --git a/src/extensions/helpers.cpp b/src/extensions/helpers.cpp deleted file mode 100644 index 9a98c360..00000000 --- a/src/extensions/helpers.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* Implementation of non-template binding-specific helper functions. -* -*****************************************************************************/ - -#include "helpers.hpp" -#include - -#include -#include - -#include - -// Use numpy here, but initialize it later in the extension module. -#include "pyobjcryst_numpy_setup.hpp" -#define NO_IMPORT_ARRAY -#include - - -namespace bp = boost::python; - -namespace { - -void black_hole_info(const std::string& s) { } - -} // namespace - -// class MuteObjCrystUserInfo ------------------------------------------------ - -MuteObjCrystUserInfo::MuteObjCrystUserInfo() : - msave_info_func(ObjCryst::fpObjCrystInformUser) -{ - ObjCryst::fpObjCrystInformUser = black_hole_info; -} - - -MuteObjCrystUserInfo::~MuteObjCrystUserInfo() -{ - this->release(); -} - - -void MuteObjCrystUserInfo::release() -{ - using ObjCryst::fpObjCrystInformUser; - if (msave_info_func) fpObjCrystInformUser = msave_info_func; - msave_info_func = NULL; -} - -// class CaptureStdOut ------------------------------------------------------- - -CaptureStdOut::CaptureStdOut() : - msave_cout_buffer(std::cout.rdbuf()) -{ - std::cout.rdbuf(moutput.rdbuf()); -} - - -CaptureStdOut::~CaptureStdOut() -{ - this->release(); -} - - -std::string CaptureStdOut::str() const -{ - return moutput.str(); -} - - -void CaptureStdOut::release() -{ - if (msave_cout_buffer) std::cout.rdbuf(msave_cout_buffer); - msave_cout_buffer = NULL; -} - -// free functions ------------------------------------------------------------ - -void assignCrystVector(CrystVector& cv, bp::object obj) -{ - // copy data directly if it is a numpy array of doubles - PyArrayObject* a = PyArray_Check(obj.ptr()) ? - reinterpret_cast(obj.ptr()) : NULL; - bool isdoublenumpyarray = a && - (1 == PyArray_NDIM(a)) && - (NPY_DOUBLE == PyArray_TYPE(a)); - if (isdoublenumpyarray) - { - const double* src = static_cast(PyArray_DATA(a)); - npy_intp stride = PyArray_STRIDE(a, 0) / PyArray_ITEMSIZE(a); - cv.resize(PyArray_SIZE(a)); - double* dst = cv.data(); - const double* last = dst + cv.size(); - for (; dst != last; ++dst, src += stride) *dst = *src; - } - // otherwise copy elementwise converting each element to a double - else - { - bp::stl_input_iterator begin(obj), end; - // use intermediate list to preserve cv when conversion fails. - std::list values(begin, end); - cv.resize(values.size()); - std::list::const_iterator vv = values.begin(); - double* dst = cv.data(); - for (; vv != values.end(); ++vv, ++dst) *dst = *vv; - } -} - - -int check_index(int idx, int size, NegativeIndexFlag nflag) -{ - const int lo = (nflag == ALLOW_NEGATIVE) ? -size : 0; - if (idx < lo || idx >= size) - { - PyErr_SetString(PyExc_IndexError, "Index out of range."); - bp::throw_error_already_set(); - } - int rv = (idx < 0) ? size + idx : idx; - return rv; -} diff --git a/src/extensions/helpers.hpp b/src/extensions/helpers.hpp deleted file mode 100644 index f5af128d..00000000 --- a/src/extensions/helpers.hpp +++ /dev/null @@ -1,158 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* This is home to converters and utility functions that are explicitly applied -* within the extensions, rather than registered in registerconverters.cpp. -* -*****************************************************************************/ - -#ifndef HELPERS_HPP -#define HELPERS_HPP - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -namespace bp = boost::python; - -typedef std::numeric_limits doublelim; - -class MuteObjCrystUserInfo -{ - public: - - MuteObjCrystUserInfo(); - ~MuteObjCrystUserInfo(); - void release(); - - private: - - // pointer to the previous info function - void (*msave_info_func)(const std::string &); -}; - -class CaptureStdOut -{ - public: - - CaptureStdOut(); - ~CaptureStdOut(); - std::string str() const; - void release(); - - private: - - std::ostringstream moutput; - std::streambuf* msave_cout_buffer; - -}; - -template -std::string __str__(const T& obj) -{ - CaptureStdOut outbuf; - obj.Print(); - outbuf.release(); - - std::string outstr = outbuf.str(); - // Remove the trailing newline - size_t idx = outstr.find_last_not_of("\n"); - if (idx != std::string::npos) - outstr.erase(idx+1); - - return outstr; -} - -template -std::set pyIterableToSet(const bp::object& l) -{ - - std::set cl; - T typeobj; - - for(int i=0; i < len(l); ++i) - { - typeobj = bp::extract(l[i]); - cl.insert(typeobj); - } - - return cl; -} - -// For turning vector-like containers into lists -// It is assumed that T contains non-pointers -template -bp::list containerToPyList(T& v) -{ - bp::list l; - - for(typename T::const_iterator it = v.begin(); it != v.end(); ++it) - { - l.append(*it); - } - return l; -} - -// For turning vector-like containers into lists -// It is assumed that T contains pointers -template -bp::list ptrcontainerToPyList(T& v) -{ - bp::list l; - - for(typename T::const_iterator it = v.begin(); it != v.end(); ++it) - { - l.append(bp::ptr(*it)); - } - return l; -} - -template -bp::list setToPyList(std::set& v) -{ - return containerToPyList< typename std::set >(v); -} - - -template -bp::list vectorToPyList(std::vector& v) -{ - return containerToPyList< typename std::vector >(v); -} - -template -bp::list listToPyList(std::list& v) -{ - return containerToPyList< typename std::list >(v); -} - - -// Extract CrystVector from a Python object -template class CrystVector; - -void assignCrystVector(CrystVector& cv, bp::object obj); - -// check index bounds and convert negative index to equivalent value -enum NegativeIndexFlag {POSITIVE, ALLOW_NEGATIVE}; -int check_index(int idx, int size, NegativeIndexFlag nflag); - -#endif diff --git a/src/extensions/helpers_nb.hpp b/src/extensions/helpers_nb.hpp new file mode 100644 index 00000000..cf3ccbfb --- /dev/null +++ b/src/extensions/helpers_nb.hpp @@ -0,0 +1,557 @@ +/* + * pyobjcryst nanobind port + * helpers_nb.hpp — utilities analogous to helpers.hpp but without boost::python + */ + +#ifndef HELPERS_NB_HPP +#define HELPERS_NB_HPP + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +namespace nb = nanobind; + +typedef std::numeric_limits doublelim; + +// --------------------------------------------------------------------------- +// wrap_peaklist — wrap a plain ObjCryst::PeakList (returned by value from +// several C++ APIs, e.g. PowderPattern::FindPeaks()) into the Python +// "PeakList" type. The actual nanobind-registered type is PeakListNB, a +// thin subclass defined in an anonymous namespace in nb_indexing.cpp (it +// needs extra methods not present on the plain C++ PeakList) -- nanobind +// has no registered Python type for the base PeakList itself, so returning +// one directly fails with "Unable to convert function return value to a +// Python type!". This function is implemented (with external linkage) in +// nb_indexing.cpp so other translation units (e.g. nb_powderpattern.cpp) +// can convert a PeakList without needing PeakListNB's definition. +// --------------------------------------------------------------------------- +namespace ObjCryst { class PeakList; } +nb::object wrap_peaklist(const ObjCryst::PeakList& pl); + +// --------------------------------------------------------------------------- +// extractRefinableObjArg — resolve an arbitrary Python object, known only to +// be "some RefinableObj-derived instance", to a C++ RefinableObj&. +// +// Several concrete classes (ScatteringData, PowderPatternComponent, +// Scatterer, ScatteringPower, and the ScatteringPowerAtom leaf) inherit +// RefinableObj VIRTUALLY and are therefore (correctly, see §1 in +// nanobind_migration_notes.md) registered in nanobind WITHOUT declaring +// RefinableObj as their base. That means functions which generically accept +// "any RefinableObj" -- MonteCarloObj::AddRefinableObj, +// LSQNumObj::SetRefinedObj, RefinableObj::AddPar(RefinableObj&, bool), and +// any future one -- have no automatic nanobind conversion path for a Python +// DiffractionDataSingleCrystal, PowderPatternBackground, Atom, Molecule, +// ScatteringPowerSphere, or ScatteringPowerAtom argument, even though a +// plain C++ static_cast on the same object is always +// perfectly well-defined (virtual inheritance is exactly what lets the +// compiler resolve it correctly at compile time -- the problem is only ever +// nanobind's own offset-table machinery, never a real static_cast/ +// dynamic_cast). Implemented (with external linkage) in nb_refinableobj.cpp, +// since that is the one file that reasonably includes every intermediate +// type's header without looking out of place. +// --------------------------------------------------------------------------- +namespace ObjCryst { class RefinableObj; } +ObjCryst::RefinableObj& extractRefinableObjArg(nb::object obj); + +// --------------------------------------------------------------------------- +// MuteObjCrystUserInfo — suppress ObjCryst++ fpObjCrystInformUser during +// construction/parsing operations. +// --------------------------------------------------------------------------- +class MuteObjCrystUserInfo +{ +public: + MuteObjCrystUserInfo() : + msave_info_func(ObjCryst::fpObjCrystInformUser) + { + ObjCryst::fpObjCrystInformUser = [](const std::string&) {}; + } + + ~MuteObjCrystUserInfo() { release(); } + + void release() + { + if (msave_info_func) { + ObjCryst::fpObjCrystInformUser = msave_info_func; + msave_info_func = nullptr; + } + } + +private: + void (*msave_info_func)(const std::string&); +}; + +// --------------------------------------------------------------------------- +// CaptureStdOut — redirect std::cout to a string buffer +// --------------------------------------------------------------------------- +class CaptureStdOut +{ +public: + CaptureStdOut() : msave(std::cout.rdbuf()) { + std::cout.rdbuf(mss.rdbuf()); + } + ~CaptureStdOut() { release(); } + + std::string str() const { return mss.str(); } + + void release() { + if (msave) { std::cout.rdbuf(msave); msave = nullptr; } + } + +private: + std::ostringstream mss; + std::streambuf* msave; +}; + +// --------------------------------------------------------------------------- +// __str__ helper — call obj.Print(), return captured output +// --------------------------------------------------------------------------- +template +std::string obj_str(const T& obj) +{ + CaptureStdOut outbuf; + obj.Print(); + outbuf.release(); + std::string s = outbuf.str(); + // strip trailing newline + while (!s.empty() && s.back() == '\n') s.pop_back(); + return s; +} + +// --------------------------------------------------------------------------- +// read_pyfile_to_string — read the full contents of a Python file-like +// object into a std::string, regardless of whether it was opened in text +// mode (file.read() -> str) or binary mode (file.read() -> bytes). +// +// Callers throughout the codebase do `open(file, "rb")` (matching the old +// Boost.Python python_streambuf convention), so `.read()` returns `bytes`. +// A plain `nb::cast(input.attr("read")())` only accepts `str` +// and throws (cast_error, reported to Python as "std::bad_cast") on bytes. +// --------------------------------------------------------------------------- +inline std::string read_pyfile_to_string(nb::object input) +{ + nb::object data = input.attr("read")(); + if (nb::isinstance(data)) { + nb::bytes b = nb::cast(data); + return std::string(b.c_str(), b.size()); + } + return nb::cast(data); +} + +// --------------------------------------------------------------------------- +// Index checking (supports negative indexing) +// --------------------------------------------------------------------------- +enum NegativeIndexFlag { POSITIVE, ALLOW_NEGATIVE }; + +inline int check_index(int idx, int size, NegativeIndexFlag nflag = POSITIVE) +{ + if (nflag == ALLOW_NEGATIVE && idx < 0) idx += size; + if (idx < 0 || idx >= size) + throw nb::index_error("index out of range"); + return idx; +} + +// --------------------------------------------------------------------------- +// CrystVector_REAL / CrystMatrix_REAL <-> numpy array (copies data to double) +// +// NOTE: these must use CrystVector_REAL / CrystMatrix_REAL (i.e. CrystVector), +// NOT a hardcoded CrystVector. REAL is defined project-wide as `double` +// (see CMakeLists.txt: target_compile_definitions(ObjCryst PUBLIC REAL=double), +// matching the historical SConstruct build). Hardcoding here silently +// round-trips every vector/matrix through a lossy CrystVector::operator +// CrystVector() conversion (and fails to compile at all for the non-const +// write path), which is likely the source of several nanobind-port test +// failures (bad_cast / precision mismatches) — REAL must stay in sync here. +// --------------------------------------------------------------------------- +using nb_array_1d = nb::ndarray>; +using nb_array_2d = nb::ndarray>; + +inline nb_array_1d crystvec_to_array(const CrystVector_REAL& cv) +{ + size_t n = cv.numElements(); + double* data = new double[n]; + for (size_t i = 0; i < n; ++i) data[i] = cv(i); + nb::capsule owner(data, [](void* p) noexcept { delete[] static_cast(p); }); + return nb_array_1d(data, {n}, owner); +} + +inline nb_array_2d crystmat_to_array(const CrystMatrix_REAL& cm) +{ + size_t rows = cm.rows(), cols = cm.cols(); + double* data = new double[rows * cols]; + for (size_t i = 0; i < rows; ++i) + for (size_t j = 0; j < cols; ++j) + data[i * cols + j] = cm(i, j); + nb::capsule owner(data, [](void* p) noexcept { delete[] static_cast(p); }); + return nb_array_2d(data, {rows, cols}, owner); +} + +// --------------------------------------------------------------------------- +// numpy array → CrystVector_REAL +// --------------------------------------------------------------------------- +inline void assign_crystvec(CrystVector_REAL& cv, nb_array_1d arr) +{ + size_t n = arr.shape(0); + cv.resize(n); + for (size_t i = 0; i < n; ++i) cv(i) = static_cast(arr(i)); +} + +// --------------------------------------------------------------------------- +// assignCrystVector — fill CrystVector from a Python iterable or ndarray +// --------------------------------------------------------------------------- +template +inline void assignCrystVector(CrystVector& cv, nb::object obj) +{ + // Try ndarray first + try { + auto arr = nb::cast(obj); + assign_crystvec(cv, arr); + return; + } catch (...) {} + // Fallback: iterate + nb::list lst(obj); + long n = static_cast(nb::len(lst)); + cv.resize(n); + for (long i = 0; i < n; ++i) + cv(i) = static_cast(nb::cast(lst[i])); +} + +// --------------------------------------------------------------------------- +// Helper: pointer container -> nb::list +// --------------------------------------------------------------------------- +template +nb::list ptrcontainerToPyList(const Container& c) +{ + nb::list l; + for (auto it = c.begin(); it != c.end(); ++it) + l.append(nb::cast(*it, nb::rv_policy::reference)); + return l; +} + +template +nb::list containerToPyList(const Container& c) +{ + nb::list l; + for (auto it = c.begin(); it != c.end(); ++it) + l.append(nb::cast(*it)); + return l; +} + +// --------------------------------------------------------------------------- +// pyIterableToSet — Python iterable -> std::set +// --------------------------------------------------------------------------- +template +std::set pyIterableToSet(nb::object obj) +{ + std::set result; + for (nb::handle h : obj) + result.insert(&nb::cast(h)); + return result; +} + +// --------------------------------------------------------------------------- +// RefinableObj / ScatteringPower method-forwarding +// +// Scatterer, ScatteringPower, ScatteringData, and PowderPatternComponent all +// inherit RefinableObj VIRTUALLY in C++ (see extractRefinableObjArg above), +// and ScatteringPowerAtom/GlobalScatteringPower additionally inherit +// ScatteringPower virtually -- so nanobind cannot declare RefinableObj (or, +// for those last two, ScatteringPower) as their Python-visible base. Under +// Boost.Python, `bases` gave every one of these classes (and +// their concrete subclasses: Atom, Molecule, ZScatterer, ZPolyhedron, +// ScatteringPowerAtom, ScatteringPowerSphere, GlobalScatteringPower, +// DiffractionDataSingleCrystal, PowderPatternBackground, +// PowderPatternDiffraction) the full RefinableObj method surface for free, +// via ordinary Python inheritance, because Boost.Python's base registration +// performs a real cast rather than nanobind's cached fixed-offset scheme. +// nanobind can't do that, so today only a handful of these methods are +// reachable from Python on these classes (whatever a handful of prior, +// one-off `static_cast(...)` shims happened to cover). +// +// bind_refinableobj_forwarding()/bind_scatteringpower_forwarding() +// restore the *rest* of that surface: one plain forwarding `.def()` per +// method, calling straight through T (implicit Derived&->Base& reference +// conversion, or a direct member call -- both resolved correctly by the +// compiler even across a virtual base, because T is fully known here at +// compile time; this is exactly the mechanism Boost.Python relied on, and +// is unrelated to nanobind's own generic, virtual-base-unsafe casting). +// +// Deliberately NOT the trampoline/NB_OVERRIDE mechanism: these become +// callable from Python (restoring Boost.Python-era behaviour), but a Python +// subclass overriding one of them still won't be seen by C++-internal +// virtual dispatch through a plain T&. That's a separate, harder problem +// (tracked for Crystal/PowderPattern/MonteCarloObj's existing UpdateDisplay +// overrides, which this file does not touch) and was explicitly out of +// scope for this pass. +// --------------------------------------------------------------------------- + +inline nb_array_1d refobj_fwd_get_paramset(ObjCryst::RefinableObj& obj, unsigned long id) +{ + return crystvec_to_array(obj.GetParamSet(id)); +} + +inline void refobj_fwd_add_par(ObjCryst::RefinableObj& obj, ObjCryst::RefinablePar* p) +{ + obj.AddPar(p); + obj.SetDeleteRefParInDestructor(0); +} + +inline void refobj_fwd_add_par_obj(ObjCryst::RefinableObj& obj, nb::object o, const bool copyParam) +{ + obj.AddPar(extractRefinableObjArg(o), copyParam); + obj.SetDeleteRefParInDestructor(0); +} + +inline ObjCryst::RefinablePar& refobj_fwd_get_par_long(ObjCryst::RefinableObj& obj, const long i) +{ + obj.SetDeleteRefParInDestructor(0); + return obj.GetPar(i); +} + +inline ObjCryst::RefinablePar& refobj_fwd_get_par_string(ObjCryst::RefinableObj& obj, const std::string& s) +{ + obj.SetDeleteRefParInDestructor(0); + return obj.GetPar(s); +} + +inline ObjCryst::RefinablePar& refobj_fwd_get_par_not_fixed(ObjCryst::RefinableObj& obj, const long i) +{ + obj.SetDeleteRefParInDestructor(0); + return obj.GetParNotFixed(i); +} + +inline std::string refobj_fwd_xml(ObjCryst::RefinableObj& r) +{ + std::stringstream s; + r.XMLOutput(s, 0); + return s.str(); +} + +inline void refobj_fwd_xml_output(ObjCryst::RefinableObj& r, nb::object output, int indent) +{ + std::ostringstream os; + os.precision(doublelim::digits10); + r.XMLOutput(os, indent); + output.attr("write")(os.str()); +} + +inline void refobj_fwd_xml_input(ObjCryst::RefinableObj& r, nb::object input, ObjCryst::XMLCrystTag& tag) +{ + std::string s = read_pyfile_to_string(input); + std::istringstream is(s); + r.XMLInput(is, tag); +} + +inline void refobj_fwd_xml_input_string(ObjCryst::RefinableObj& r, const std::string& s) +{ + std::istringstream ss(s); + ss.imbue(std::locale::classic()); + ObjCryst::XMLCrystTag tag; + ss >> tag; + r.XMLInput(ss, tag); +} + +template +void bind_refinableobj_forwarding(nb::class_& cls) +{ + using ObjCryst::RefParType; + using ObjCryst::RefinablePar; + cls + .def("PrepareForRefinement", &T::PrepareForRefinement) + .def("FixAllPar", &T::FixAllPar) + .def("UnFixAllPar", &T::UnFixAllPar) + .def("SetParIsFixed", + nb::overload_cast(&T::SetParIsFixed)) + .def("SetParIsFixed", + nb::overload_cast(&T::SetParIsFixed)) + .def("SetParIsFixed", + nb::overload_cast(&T::SetParIsFixed)) + .def("SetParIsUsed", + nb::overload_cast(&T::SetParIsUsed)) + .def("SetParIsUsed", + nb::overload_cast(&T::SetParIsUsed)) + .def("GetNbPar", &T::GetNbPar) + .def("GetNbParNotFixed", &T::GetNbParNotFixed) + .def("GetPar", + [](T& o, const long i) -> RefinablePar& { return refobj_fwd_get_par_long(o, i); }, + nb::rv_policy::reference_internal) + .def("GetPar", + [](T& o, const std::string& s) -> RefinablePar& { return refobj_fwd_get_par_string(o, s); }, + nb::rv_policy::reference_internal) + .def("GetParNotFixed", + [](T& o, const long i) -> RefinablePar& { return refobj_fwd_get_par_not_fixed(o, i); }, + nb::rv_policy::reference_internal) + .def("AddPar", + [](T& o, RefinablePar* p){ refobj_fwd_add_par(o, p); }, + nb::arg("par"), nb::keep_alive<1,2>()) + .def("AddPar", + [](T& o, nb::object newRefParList, const bool copyParam){ + refobj_fwd_add_par_obj(o, newRefParList, copyParam); }, + nb::arg("newRefParList"), nb::arg("copyParam") = false, nb::keep_alive<1,2>()) + .def("RemovePar", [](T& o, RefinablePar* p){ o.RemovePar(p); }) + .def("CreateParamSet", &T::CreateParamSet, nb::arg("name") = "") + .def("ClearParamSet", &T::ClearParamSet) + .def("SaveParamSet", &T::SaveParamSet) + .def("RestoreParamSet",&T::RestoreParamSet) + .def("GetParamSet", [](T& o, unsigned long id){ return refobj_fwd_get_paramset(o, id); }) + .def("GetParamSet_ParNotFixedHumanValue", &T::GetParamSet_ParNotFixedHumanValue) + .def("EraseAllParamSet", [](T& o){ o.EraseAllParamSet(); }) + .def("GetParamSetName",&T::GetParamSetName) + .def("SetLimitsAbsolute", + nb::overload_cast(&T::SetLimitsAbsolute)) + .def("SetLimitsAbsolute", + nb::overload_cast(&T::SetLimitsAbsolute)) + .def("SetLimitsRelative", + nb::overload_cast(&T::SetLimitsRelative)) + .def("SetLimitsRelative", + nb::overload_cast(&T::SetLimitsRelative)) + .def("SetLimitsProportional", + nb::overload_cast(&T::SetLimitsProportional)) + .def("SetLimitsProportional", + nb::overload_cast(&T::SetLimitsProportional)) + .def("SetGlobalOptimStep", &T::SetGlobalOptimStep) + .def("GetSubObjRegistry", + nb::overload_cast<>(&T::GetSubObjRegistry), nb::rv_policy::reference_internal) + .def("GetClientRegistry", + nb::overload_cast<>(&T::GetClientRegistry), nb::rv_policy::reference_internal) + .def("GetOptionList", &T::GetOptionList, nb::rv_policy::reference) + .def("GetNbOption", &T::GetNbOption) + .def("GetOption", + nb::overload_cast(&T::GetOption), nb::rv_policy::reference_internal) + .def("IsBeingRefined", &T::IsBeingRefined) + .def("BeginGlobalOptRandomMove",&T::BeginGlobalOptRandomMove) + .def("ResetParList", &T::ResetParList) + .def("GetRefParListClock", &T::GetRefParListClock, nb::rv_policy::reference_internal) + .def("GetClockMaster", &T::GetClockMaster, nb::rv_policy::reference_internal) + .def("AddRestraint", &T::AddRestraint, nb::keep_alive<1,2>()) + .def("RemoveRestraint",&T::RemoveRestraint) + .def("GetClassName", &T::GetClassName) + .def("GetName", &T::GetName) + .def("SetName", &T::SetName) + .def("Print", &T::Print) + .def("RegisterClient", &T::RegisterClient, nb::keep_alive<1,2>()) + .def("DeRegisterClient",&T::DeRegisterClient) + .def("BeginOptimization",&T::BeginOptimization, + nb::arg("allowApproximations") = false, nb::arg("enableRestraints") = false) + .def("EndOptimization", &T::EndOptimization) + .def("RandomizeConfiguration",&T::RandomizeConfiguration) + .def("GlobalOptRandomMove", &T::GlobalOptRandomMove, + nb::arg("mutationAmplitude"), nb::arg("type") = ObjCryst::gpRefParTypeObjCryst) + .def("GetLogLikelihood", &T::GetLogLikelihood) + .def("GetNbLSQFunction", &T::GetNbLSQFunction) + .def("GetLSQCalc", [](T& o, unsigned int i){ return crystvec_to_array(o.GetLSQCalc(i)); }, + nb::arg("idx")) + .def("GetLSQObs", [](T& o, unsigned int i){ return crystvec_to_array(o.GetLSQObs(i)); }, + nb::arg("idx")) + .def("GetLSQWeight", [](T& o, unsigned int i){ return crystvec_to_array(o.GetLSQWeight(i)); }, + nb::arg("idx")) + .def("GetLSQDeriv", [](T& o, unsigned int i, RefinablePar& p){ + return crystvec_to_array(o.GetLSQDeriv(i, p)); }, + nb::arg("idx"), nb::arg("par")) + .def("UpdateDisplay", &T::UpdateDisplay) + .def("GetRestraintCost", &T::GetRestraintCost) + .def("TagNewBestConfig", &T::TagNewBestConfig) + .def("XMLOutput", + [](T& o, nb::object output, int indent){ refobj_fwd_xml_output(o, output, indent); }, + nb::arg("file"), nb::arg("indent") = 0) + .def("xml", [](T& o){ return refobj_fwd_xml(o); }) + .def("XMLInput", + [](T& o, nb::object input, ObjCryst::XMLCrystTag& tag){ refobj_fwd_xml_input(o, input, tag); }, + nb::arg("file"), nb::arg("tag")) + .def("XMLInput", + [](T& o, const std::string& s){ refobj_fwd_xml_input_string(o, s); }, + nb::arg("xml")) + .def("GetGeneGroup",&T::GetGeneGroup) + .def("int_ptr", &T::int_ptr) + ; +} + +template +void bind_scatteringpower_forwarding(nb::class_& cls) +{ + cls + .def("GetScatteringFactor", &T::GetScatteringFactor, + nb::arg("data"), nb::arg("spgSymPosIndex") = -1) + .def("GetForwardScatteringFactor", &T::GetForwardScatteringFactor) + .def("GetTemperatureFactor", &T::GetTemperatureFactor, + nb::arg("data"), nb::arg("spgSymPosIndex") = -1) + .def("GetResonantScattFactReal", &T::GetResonantScattFactReal, + nb::arg("data"), nb::arg("spgSymPosIndex") = -1) + .def("GetResonantScattFactImag", &T::GetResonantScattFactImag, + nb::arg("data"), nb::arg("spgSymPosIndex") = -1) + .def("IsScatteringFactorAnisotropic", &T::IsScatteringFactorAnisotropic) + .def("IsTemperatureFactorAnisotropic", &T::IsTemperatureFactorAnisotropic) + .def("IsResonantScatteringAnisotropic",&T::IsResonantScatteringAnisotropic) + .def("GetSymbol", &T::GetSymbol) + .def("GetBiso", + nb::overload_cast<>(&T::GetBiso, nb::const_)) + .def("SetBiso", &T::SetBiso) + .def("GetBij", + nb::overload_cast(&T::GetBij, nb::const_)) + .def("SetBij", + nb::overload_cast(&T::SetBij)) + .def("IsIsotropic", &T::IsIsotropic) + .def("GetDynPopCorrIndex", &T::GetDynPopCorrIndex) + .def("GetNbScatteringPower", &T::GetNbScatteringPower) + .def("GetLastChangeClock", &T::GetLastChangeClock, + nb::rv_policy::reference_internal) + .def("GetRadius", &T::GetRadius) + .def("GetMaximumLikelihoodPositionError", &T::GetMaximumLikelihoodPositionError) + .def("SetMaximumLikelihoodPositionError", &T::SetMaximumLikelihoodPositionError) + .def("GetMaximumLikelihoodNbGhostAtom", &T::GetMaximumLikelihoodNbGhostAtom) + .def("SetMaximumLikelihoodNbGhostAtom", &T::SetMaximumLikelihoodNbGhostAtom) + .def("GetMaximumLikelihoodParClock", &T::GetMaximumLikelihoodParClock, + nb::rv_policy::reference_internal) + .def("GetFormalCharge", &T::GetFormalCharge) + .def("SetFormalCharge", &T::SetFormalCharge) + .def("GetColourRGB", [](T& sp){ return nb::make_tuple(sp.GetColourRGB()[0], + sp.GetColourRGB()[1], + sp.GetColourRGB()[2]); }) + .def("GetColour", [](T& sp){ return nb::make_tuple(sp.GetColourRGB()[0], + sp.GetColourRGB()[1], + sp.GetColourRGB()[2]); }) + .def("SetColour", + nb::overload_cast(&T::SetColour), + nb::arg("r"), nb::arg("g"), nb::arg("b")) + // B11/B12/.../Biso properties: nb_scatteringpower.cpp exposes these + // on ScatteringPower itself via file-local _GetBij/_SetBij + // templates; those aren't visible here, so the properties are + // reimplemented against T's own (non-virtual) GetBij/SetBij, which + // resolve correctly across a virtual base the same way every other + // forwarding .def() in this function does. + .def_prop_rw("Biso", + [](T& sp){ return sp.GetBiso(); }, + [](T& sp, const REAL b){ sp.SetBiso(b); }) + .def_prop_rw("B11", + [](T& sp){ return sp.GetBij(1, 1); }, + [](T& sp, const REAL b){ sp.SetBij(1, 1, b); }) + .def_prop_rw("B22", + [](T& sp){ return sp.GetBij(2, 2); }, + [](T& sp, const REAL b){ sp.SetBij(2, 2, b); }) + .def_prop_rw("B33", + [](T& sp){ return sp.GetBij(3, 3); }, + [](T& sp, const REAL b){ sp.SetBij(3, 3, b); }) + .def_prop_rw("B12", + [](T& sp){ return sp.GetBij(1, 2); }, + [](T& sp, const REAL b){ sp.SetBij(1, 2, b); }) + .def_prop_rw("B13", + [](T& sp){ return sp.GetBij(1, 3); }, + [](T& sp, const REAL b){ sp.SetBij(1, 3, b); }) + .def_prop_rw("B23", + [](T& sp){ return sp.GetBij(2, 3); }, + [](T& sp, const REAL b){ sp.SetBij(2, 3, b); }) + ; +} + +#endif // HELPERS_NB_HPP diff --git a/src/extensions/indexing_ext.cpp b/src/extensions/indexing_ext.cpp deleted file mode 100644 index 180c46cb..00000000 --- a/src/extensions/indexing_ext.cpp +++ /dev/null @@ -1,445 +0,0 @@ -/***************************************************************************** -* -* -* File coded by: Vincent Favre-Nicolin -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::Indexing. -* -* Changes from Indexing: -* -*****************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#undef B0 - -#include - -#include -#include - -#include "python_streambuf.hpp" -#include "helpers.hpp" - - -namespace bp = boost::python; -using namespace boost::python; -using namespace ObjCryst; - -#ifndef M_PI -#define M_PI 3.14159265358979323846264338327950288 -#endif - -#define RAD2DEG (180./M_PI) - - - -namespace { - -bp::tuple _direct_unit_cell(const RecUnitCell &r, const bool equiv, const bool degrees=false) -{ - const std::vector &v = r.DirectUnitCell(equiv); - if(degrees) - return bp::make_tuple(v[0], v[1], v[2], v[3]*RAD2DEG, v[4]*RAD2DEG, v[5]*RAD2DEG, v[6]); - return bp::make_tuple(v[0], v[1], v[2], v[3], v[4], v[5], v[6]); -} - -bp::list _vDicVolHKL(const PeakList::hkl& h) -{ - return listToPyList< PeakList::hkl0 > (h.vDicVolHKL); -} - -std::string __str__RecUnitCell(RecUnitCell& ruc) -{ - std::string sys; - switch(ruc.mlattice) - { - case TRICLINIC:sys="TRICLINIC"; break; - case MONOCLINIC:sys="MONOCLINIC"; break; - case ORTHORHOMBIC:sys="ORTHORHOMBIC"; break; - case HEXAGONAL:sys="HEXAGONAL"; break; - case RHOMBOEDRAL:sys="RHOMBOEDRAL"; break; - case TETRAGONAL:sys="TETRAGONAL"; break; - case CUBIC:sys="CUBIC"; break; - } - - char centc; - switch(ruc.mCentering) - { - case LATTICE_P:centc='P'; break; - case LATTICE_I:centc='I'; break; - case LATTICE_A:centc='A'; break; - case LATTICE_B:centc='B'; break; - case LATTICE_C:centc='C'; break; - case LATTICE_F:centc='F'; break; - } - - std::vector d = ruc.DirectUnitCell(); - - if(ruc.mNbSpurious>0) - return (boost::format("%5.2f %5.2f %5.2f %5.1f %5.1f %5.1f V=%4.0f %s %c (%d SPURIOUS)") - % d[0] % d[1] % d[2] % (d[3]*RAD2DEG) % (d[4]*RAD2DEG) - % (d[5]*RAD2DEG) % d[6] % sys % centc % ruc.mNbSpurious).str(); - - return (boost::format("%5.2f %5.2f %5.2f %5.1f %5.1f %5.1f V=%4.0f %s %c") - % d[0] % d[1] % d[2] % (d[3]*RAD2DEG) % (d[4]*RAD2DEG) - % (d[5]*RAD2DEG) % d[6] % sys % centc).str(); -} - -std::string __str__hkl0(PeakList::hkl0& hkl) -{ - return (boost::format("(%2d %2d %2d)") % hkl.h % hkl.k % hkl.l).str(); -} - -std::string __str__hkl(PeakList::hkl& hkl) -{ - if(hkl.isIndexed) - return (boost::format("Peak dobs=%7.5f+/-%7.5f iobs=%6e (%2d %2d %2d))") - % hkl.dobs % hkl.dobssigma % hkl.iobs - % hkl.h % hkl.k % hkl.l).str(); - - return (boost::format("Peak dobs=%7.5f+/-%7.5f iobs=%6e (? ? ?))") - % hkl.dobs % hkl.dobssigma % hkl.iobs).str(); -} - -class PeakListWrap : public PeakList, public wrapper -{ - public: - PeakListWrap():PeakList() {} - - PeakListWrap(const PeakList &p):PeakList(p) {} - - void ImportDhklDSigmaIntensity(bp::object input, const float defaultsigma) - { - CaptureStdOut gag; - const std::string cname = bp::extract - (input.attr("__class__").attr("__name__")); - if(cname.compare("str")==0) - { // Filename - std::string p = bp::extract(input); - std::ifstream is(p); - this->PeakList::ImportDhklDSigmaIntensity(is, defaultsigma); - } - else - { // Python file object - boost_adaptbx::python::streambuf sbuf(input); - boost_adaptbx::python::streambuf::istream is(sbuf); - this->PeakList::ImportDhklDSigmaIntensity(is, defaultsigma); - } - } - - - void ImportDhklIntensity(bp::object input) - { - CaptureStdOut gag; - const std::string cname = bp::extract - (input.attr("__class__").attr("__name__")); - if(cname.compare("str")==0) - { // Filename - std::string p = bp::extract(input); - std::ifstream is(p); - this->PeakList::ImportDhklIntensity(is); - } - else - {// Python file object - boost_adaptbx::python::streambuf sbuf(input); - boost_adaptbx::python::streambuf::istream is(sbuf); - this->PeakList::ImportDhklIntensity(is); - } - } - - void default_ImportDhkl(bp::object input) - { - CaptureStdOut gag; - const std::string cname = bp::extract - (input.attr("__class__").attr("__name__")); - if(cname.compare("str")==0) - { // Filename - std::string p = bp::extract(input); - std::ifstream is(p); - this->PeakList::ImportDhkl(is); - } - else - {// Python file object - boost_adaptbx::python::streambuf sbuf(input); - boost_adaptbx::python::streambuf::istream is(sbuf); - this->PeakList::ImportDhkl(is); - } - } - - void Import2ThetaIntensity(bp::object input, const float wavelength) - { - CaptureStdOut gag; - const std::string cname = bp::extract - (input.attr("__class__").attr("__name__")); - if(cname.compare("str")==0) - { // Filename - std::string p = bp::extract(input); - std::ifstream is(p); - this->PeakList::Import2ThetaIntensity(is, wavelength); - } - else - {// Python file object - boost_adaptbx::python::streambuf sbuf(input); - boost_adaptbx::python::streambuf::istream is(sbuf); - this->PeakList::Import2ThetaIntensity(is, wavelength); - } - } - - void ExportDhklDSigmaIntensity(bp::object output) - { - CaptureStdOut gag; - const std::string cname = bp::extract - (output.attr("__class__").attr("__name__")); - if(cname.compare("str")==0) - { // Filename - std::string sout =bp::extract(output); - std::ofstream out(sout); - this->PeakList::ExportDhklDSigmaIntensity(out); - } - else - {// Python file object - boost_adaptbx::python::streambuf sbuf(output); - boost_adaptbx::python::streambuf::ostream out(sbuf); - this->PeakList::ExportDhklDSigmaIntensity(out); - } - } - - void set_dobs_list(bp::list &l) - { - this->GetPeakList().clear(); - bp::ssize_t n = bp::len(l); - for(bp::ssize_t i=0;iAddPeak(bp::extract(l[i])); - } - - unsigned int Length() const - {return this->GetPeakList().size();} - - std::vector::const_iterator GetPeakIterBegin() - {return this->GetPeakList().begin();} - - std::vector::const_iterator GetPeakIterEnd() - {return this->GetPeakList().end();} - - void resize(const unsigned int nb) - {this->GetPeakList().resize(nb);} - - void clear() - {this->GetPeakList().clear();} - - bp::list _getPeakList() - { - return vectorToPyList< PeakList::hkl > (this->GetPeakList()); - } - -}; - -std::list >::const_iterator _GetSolutionsIterBegin(const CellExplorer& c) -{return c.GetSolutions().begin();} - -std::list >::const_iterator _GetSolutionsIterEnd(const CellExplorer& c) -{return c.GetSolutions().end();} - -void _DicVolGag(CellExplorer &ex, const float minScore,const unsigned int minDepth, - const float stopOnScore,const unsigned int stopOnDepth, const bool verbose=true) -{ - CaptureStdOut gag; - if(verbose) gag.release(); - ex.DicVol(minScore, minDepth, stopOnScore, stopOnDepth); -} - -// Custom converter -struct pair_ruc_float_to_tuple -{ - static PyObject* convert(std::pair const &p) - { - bp::object tpl = bp::make_tuple(bp::ptr(&p.first), p.second); - PyObject* rv = tpl.ptr(); - return bp::incref(rv); - } - - static PyTypeObject const* get_pytype() - { - return &PyTuple_Type; - } -}; - -bp::list _GetSolutions(CellExplorer &ex) -{ // See containerToPyList - bp::list l; - - for(std::list >::const_iterator pos = ex.GetSolutions().begin(); - pos != ex.GetSolutions().end(); ++pos) - l.append(*pos); - - return l; -} - -} // namespace - - -void wrap_indexing() -{ - enum_("CrystalSystem") - .value("TRICLINIC", TRICLINIC) - .value("MONOCLINIC", MONOCLINIC) - .value("ORTHOROMBIC", ORTHOROMBIC) - .value("ORTHORHOMBIC", ORTHORHOMBIC) - .value("HEXAGONAL", HEXAGONAL) - .value("RHOMBOEDRAL", RHOMBOEDRAL) - .value("TETRAGONAL", TETRAGONAL) - .value("CUBIC", CUBIC) - ; - - enum_("CrystalCentering") - .value("LATTICE_P", LATTICE_P) - .value("LATTICE_I", LATTICE_I) - .value("LATTICE_A", LATTICE_A) - .value("LATTICE_B", LATTICE_B) - .value("LATTICE_C", LATTICE_C) - .value("LATTICE_F", LATTICE_F) - ; - - def("EstimateCellVolume", &EstimateCellVolume, - (bp::arg("dmin"), bp::arg("dmax"), bp::arg("nbrefl"), bp::arg("system"), - bp::arg("centering"), bp::arg("kappa")=1.)); - - class_ ("RecUnitCell") - .def(init( - (bp::arg("zero")=0, bp::arg("par0")=0, bp::arg("par1")=0, - bp::arg("par2")=0, bp::arg("par3")=0, bp::arg("par4")=0, - bp::arg("par5")=0, bp::arg("lattice")=CUBIC, - bp::arg("cent")=LATTICE_P, bp::arg("nbspurious")=0))) - .def(init(bp::arg("old"))) - .def("hkl2d", &RecUnitCell::hkl2d, - (bp::arg("h"), bp::arg("k"), bp::arg("l"), - bp::arg("derivpar")=NULL, bp::arg("derivhkl")=0)) - .def("DirectUnitCell", &_direct_unit_cell, - (bp::arg("equiv")=false, bp::arg("degrees")=false)) - //.def_readonly("par", &RecUnitCell::par) - .def_readonly("mlattice", &RecUnitCell::mlattice) - .def_readonly("lattice", &RecUnitCell::mlattice) - .def_readonly("mCentering", &RecUnitCell::mCentering) - .def_readonly("centering", &RecUnitCell::mCentering) - .def_readonly("nb_spurious", &RecUnitCell::mNbSpurious) - .def_readonly("mNbSpurious", &RecUnitCell::mNbSpurious) - .def("__str__", &__str__RecUnitCell) - .def("__repr__", &__str__RecUnitCell) - ; - - // Avoid the name hkl which may conflict somewhere else - class_ ("PeakList_hkl0") - .def(init( - (bp::arg("h")=0, bp::arg("k")=0, bp::arg("l")=0))) - .def_readonly("h", &PeakList::hkl0::h) - .def_readonly("k", &PeakList::hkl0::k) - .def_readonly("l", &PeakList::hkl0::l) - .def("__str__", &__str__hkl0) - .def("__repr__", &__str__hkl0) - ; - - // Avoid the name hkl which may conflict somewhere else - class_ ("PeakList_hkl") - .def(init( - (bp::arg("dobs")=1.0, bp::arg("iobs")=0, bp::arg("dobssigma")=0, - bp::arg("iobssigma")=0, bp::arg("h")=0, bp::arg("k")=0, - bp::arg("l")=0, bp::arg("d2calc")=0))) - .def_readonly("dobs", &PeakList::hkl::dobs) - .def_readonly("dobssigma", &PeakList::hkl::dobssigma) - .def_readonly("d2obs", &PeakList::hkl::d2obs) - .def_readonly("d2obsmin", &PeakList::hkl::d2obsmin) - .def_readonly("d2obsmax", &PeakList::hkl::d2obsmax) - .def_readonly("iobs", &PeakList::hkl::iobs) - .def_readonly("iobssigma", &PeakList::hkl::iobssigma) - .def_readonly("h", &PeakList::hkl::h) - .def_readonly("k", &PeakList::hkl::k) - .def_readonly("l", &PeakList::hkl::l) - .def_readonly("isIndexed", &PeakList::hkl::isIndexed) - .add_property("vDicVolHKL", &_vDicVolHKL) - .def_readonly("isSpurious", &PeakList::hkl::isSpurious) - .def_readonly("stats", &PeakList::hkl::stats) - .def_readonly("d2calc", &PeakList::hkl::d2calc) - .def_readonly("d2diff", &PeakList::hkl::d2diff) - .def("__str__", &__str__hkl) - .def("__repr__", &__str__hkl) - ; - - class_ ("PeakList") - .def("ImportDhklDSigmaIntensity", - &PeakListWrap::ImportDhklDSigmaIntensity, - (bp::arg("file"), bp::arg("defaultsigma")=0.001)) - .def("ImportDhklIntensity", - &PeakListWrap::ImportDhklIntensity, - bp::arg("file")) - .def("ImportDhkl", - &PeakListWrap::ImportDhkl, - bp::arg("file")) - .def("Import2ThetaIntensity", - &PeakListWrap::Import2ThetaIntensity, - (bp::arg("file"), bp::arg("wavelength"))) - .def("ExportDhklDSigmaIntensity", - &PeakListWrap::ExportDhklDSigmaIntensity, - bp::arg("file")) - .def("Simulate", &PeakList::Simulate, - (bp::arg("zero"), bp::arg("a"), bp::arg("b"), bp::arg("c"), - bp::arg("alpha"), bp::arg("beta"), bp::arg("gamma"), bp::arg("deg"), - bp::arg("nb")=20, bp::arg("nbspurious")=0, bp::arg("sigma")=0, - bp::arg("percentMissing")=0, bp::arg("verbose")=false)) - .def("GetPeakList", &PeakListWrap::_getPeakList, - with_custodian_and_ward_postcall<1,0>()) - // Python only - .def("resize", &PeakListWrap::resize, bp::arg("nb")=20) - .def("clear", &PeakListWrap::clear) - .def("set_dobs_list", &PeakListWrap::set_dobs_list, (bp::arg("dobs"))) - .def("__len__", &PeakListWrap::Length) - .def("__iter__", range > - (&PeakListWrap::GetPeakIterBegin, &PeakListWrap::GetPeakIterEnd)) - ; - - // Register converter - boost::python::to_python_converter, - pair_ruc_float_to_tuple>(); - - class_, boost::noncopyable>("CellExplorer", - init( - (bp::arg("dhkl"), bp::arg("lattice"), bp::arg("nbSpurious")=0)) - [with_custodian_and_ward<1,2>()]) - .def("SetLengthMinMax", &CellExplorer::SetLengthMinMax) - .def("SetAngleMinMax", &CellExplorer::SetAngleMinMax) - .def("SetVolumeMinMax", &CellExplorer::SetVolumeMinMax) - .def("SetNbSpurious", &CellExplorer::SetNbSpurious) - .def("SetD2Error", &CellExplorer::SetD2Error) - .def("SetMinMaxZeroShift", &CellExplorer::SetMinMaxZeroShift) - .def("SetCrystalSystem", &CellExplorer::SetCrystalSystem) - .def("SetCrystalCentering", &CellExplorer::SetCrystalCentering) - .def("Print", &CellExplorer::Print) - .def("DicVol", &_DicVolGag, - (bp::arg("minScore")=10, bp::arg("minScore")=10, bp::arg("stopOnScore")=50, - bp::arg("stopOnDepth")=6, bp::arg("verbose")=true)) - .def("ReduceSolutions", &CellExplorer::ReduceSolutions, - bp::arg("updateReportThreshold")=false) - .def("GetBestScore", &CellExplorer::GetBestScore) - .def("GetSolutions", &_GetSolutions) - // Python only - .def("__iter__", range > - (&_GetSolutionsIterBegin, &_GetSolutionsIterEnd)) - ; -} diff --git a/src/extensions/io_ext.cpp b/src/extensions/io_ext.cpp deleted file mode 100644 index 05421f4f..00000000 --- a/src/extensions/io_ext.cpp +++ /dev/null @@ -1,96 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst/RefinableObj/IO.h. -* -* Changes from ObjCryst::XMLCrystTag -* - The istream constructor of XMLCrystTag is not wrapped. -* -*****************************************************************************/ - -#include -#include -#include - -#include - -#include -#include - -#include "helpers.hpp" -#include "python_streambuf.hpp" - -namespace bp = boost::python; -using namespace boost::python; -using namespace ObjCryst; - -void _XMLCrystFileLoadAllObject(bp::object input, const bool verbose=false) -{ - // Mute all output - MuteObjCrystUserInfo muzzle; - CaptureStdOut gag; - if(verbose) - { - gag.release(); - muzzle.release(); - } - - boost_adaptbx::python::streambuf sbuf(input); - boost_adaptbx::python::streambuf::istream in(sbuf); - XMLCrystFileLoadAllObject(in); -} - -void _XMLCrystFileSaveGlobal(bp::object output) -{ - boost_adaptbx::python::streambuf sbuf(output); - boost_adaptbx::python::streambuf::ostream out(sbuf); - XMLCrystFileSaveGlobal(out); -} - -void wrap_io() -{ - - class_ - ("XMLCrystTag", init - ((bp::arg("tagName"), - bp::arg("isEndTag")=false, - bp::arg("isEmptyTag")=false))) - .def("GetName", &XMLCrystTag::GetName, - return_value_policy()) - .def("GetClassName", &XMLCrystTag::GetClassName, - return_value_policy()) - .def("GetNbAttribute", &XMLCrystTag::GetNbAttribute) - .def("AddAttribute", &XMLCrystTag::AddAttribute, - (bp::arg("attName"), bp::arg("attValue"))) - .def("GetAttribute", &XMLCrystTag::GetAttribute, - (bp::arg("attNum"), bp::arg("attName"), bp::arg("attValue"))) - .def("GetAttributeName", &XMLCrystTag::GetAttributeName, - return_value_policy()) - .def("GetAttributeValue", &XMLCrystTag::GetAttributeValue, - return_value_policy()) - .def("SetIsEndTag", &XMLCrystTag::SetIsEndTag) - .def("IsEndTag", &XMLCrystTag::IsEndTag) - .def("SetIsEmptyTag", &XMLCrystTag::SetIsEmptyTag) - .def("IsEmptyTag", &XMLCrystTag::IsEmptyTag) - .def("Print", &XMLCrystTag::Print) - .def("__str__", &__str__) - // python-only - ; - - def("XMLCrystFileLoadAllObject", &_XMLCrystFileLoadAllObject, - (bp::arg("file"), bp::arg("verbose")=false)); - def("XMLCrystFileSaveGlobal", &_XMLCrystFileSaveGlobal, - bp::arg("file")); - -} diff --git a/src/extensions/lsq_ext.cpp b/src/extensions/lsq_ext.cpp deleted file mode 100644 index b28ba8d0..00000000 --- a/src/extensions/lsq_ext.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst -* -* File coded by: Vincent Favre-Nicolin -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::LSQNumObj. -* -* Changes from ObjCryst::LSQNumObj -* -* Other Changes -* -*****************************************************************************/ - -#include -#include -#include -#include - -#include - -#include -#include - -#include "helpers.hpp" - -namespace bp = boost::python; -using namespace boost::python; -using namespace ObjCryst; - -namespace { - -bool _SafeRefine(LSQNumObj & lsq, REAL maxChi2factor, int nbCycle, bool useLevenbergMarquardt, - const bool silent, const bool callBeginEndOptimization,const float minChi2var) -{ - CaptureStdOut gag; - if(!silent) gag.release(); - - std::list vnewpar; - std::list vnewpartype; - return lsq.SafeRefine(vnewpar, vnewpartype, nbCycle, useLevenbergMarquardt, silent, - callBeginEndOptimization, minChi2var); -} - -bp::dict _GetVarianceCovarianceMap(LSQNumObj & lsq) -{ - const std::map, REAL> &m = - lsq.GetVarianceCovarianceMap(); - bp::dict d; - for (std::map, REAL>::const_iterator it = m.begin(); - it != m.end(); ++it) - { - const RefinablePar *pi = it->first.first; - const RefinablePar *pj = it->first.second; - d[bp::make_tuple(pi->GetName(), pj->GetName())] = it->second; - } - return d; -} - -} // namespace - -void wrap_lsq() -{ - class_("LSQ") - /// LSQNumObj::PrepareRefParList() must be called first! - .def("SetParIsFixed", - (void (LSQNumObj::*)(const std::string&, const bool)) - &LSQNumObj::SetParIsFixed, - (bp::arg("parName"), bp::arg("fix"))) - .def("SetParIsFixed", - (void (LSQNumObj::*)(const RefParType *, const bool)) - &LSQNumObj::SetParIsFixed, - (bp::arg("type"), bp::arg("fix"))) - .def("SetParIsFixed", - (void (LSQNumObj::*)(RefinablePar &, const bool)) - &LSQNumObj::SetParIsFixed, - (bp::arg("par"), bp::arg("fix"))) - //void SetParIsFixed(RefinableObj &obj, const bool fix); - .def("UnFixAllPar", &LSQNumObj::UnFixAllPar) - //void SetParIsUsed(const std::string& parName, const bool use); - //void SetParIsUsed(const RefParType *type, const bool use); - .def("Refine", &LSQNumObj::Refine, - (bp::arg("nbCycle")=1, - bp::arg("useLevenbergMarquardt")=false, - bp::arg("silent")=false, - bp::arg("callBeginEndOptimization")=true, - bp::arg("minChi2var")=0.01)) - .def("SafeRefine", &_SafeRefine, - (bp::arg("maxChi2factor")=1.01,bp::arg("nbCycle")=1, - bp::arg("useLevenbergMarquardt")=false, - bp::arg("silent")=false, - bp::arg("callBeginEndOptimization")=true, - bp::arg("minChi2var")=0.01)) - .def("Rfactor", &LSQNumObj::Rfactor) - .def("RwFactor", &LSQNumObj::RwFactor) - .def("ChiSquare", &LSQNumObj::ChiSquare) - .def("SetRefinedObj", &LSQNumObj::SetRefinedObj, - (bp::arg("obj"), bp::arg("LSQFuncIndex")=0, - bp::arg("init")=true, bp::arg("recursive")=false), - with_custodian_and_ward<1,2>()) - .def("GetCompiledRefinedObj", - (RefinableObj& (LSQNumObj::*)()) - &LSQNumObj::GetCompiledRefinedObj, - with_custodian_and_ward_postcall<0,1,return_internal_reference<> >()) - .def("PrintRefResults", &LSQNumObj::PrintRefResults) - .def("PrepareRefParList", &LSQNumObj::PrepareRefParList, - (bp::arg("copy_param")=false)) - .def("GetLSQCalc", &LSQNumObj::GetLSQCalc, - return_value_policy()) - .def("GetLSQObs", &LSQNumObj::GetLSQObs, - return_value_policy()) - .def("GetLSQWeight", &LSQNumObj::GetLSQWeight, - return_value_policy()) - .def("GetLSQDeriv", &LSQNumObj::GetLSQDeriv, - bp::arg("par"), - return_value_policy()) - .def("GetVarianceCovarianceMap", &_GetVarianceCovarianceMap) - .def("BeginOptimization", &LSQNumObj::BeginOptimization, - (bp::arg("allowApproximations")=false, - bp::arg("enableRestraints")=false)) - .def("EndOptimization", &LSQNumObj::EndOptimization) - ; -} diff --git a/src/extensions/molatom_ext.cpp b/src/extensions/molatom_ext.cpp deleted file mode 100644 index bc576717..00000000 --- a/src/extensions/molatom_ext.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::MolAtom. -* -* Changes from ObjCryst::MolAtom -* - Wrapped as a to-python converter only. -* - File IO is disabled -* - X, Y and Z are wrapped as properties rather than methods. -* -*****************************************************************************/ - -#include -#include - -#include - -#include -#include - -namespace bp = boost::python; -using namespace boost::python; -using namespace ObjCryst; - -namespace { - -// Helper function - avoid dereferencing NULL when MolAtom is dummy. - -const ScatteringPower* getscatteringpowerpointer(const MolAtom& a) -{ - const ScatteringPower* rv = - a.IsDummy() ? NULL : &(a.GetScatteringPower()); - return rv; -} - - -std::string __str__(MolAtom& a) -{ - std::stringstream s; - s << a.GetName() << " " << a.GetX() << " " << a.GetY() << " " << a.GetZ(); - return s.str(); -} - -} // namespace - - -void wrap_molatom() -{ - - class_ ("MolAtom", init()) - .def("GetName", (const std::string& (MolAtom::*)() const) - &MolAtom::GetName, - return_value_policy()) - .def("SetName", &MolAtom::SetName) - .def("GetMolecule", (Molecule& (MolAtom::*)()) - &MolAtom::GetMolecule, - return_internal_reference<>()) - .def("GetX", &MolAtom::GetX) - .def("GetY", &MolAtom::GetY) - .def("GetZ", &MolAtom::GetZ) - .def("GetOccupancy", &MolAtom::GetOccupancy) - .def("SetX", &MolAtom::SetX) - .def("SetY", &MolAtom::SetY) - .def("SetZ", &MolAtom::SetZ) - .def("SetOccupancy", &MolAtom::SetOccupancy) - .def("IsDummy", &MolAtom::IsDummy) - // FIXME - this should be returned as a constant reference. However, I - // can't get this to work. This returns it as an internal reference, - // which is probably a bad idea. - .def("GetScatteringPower", getscatteringpowerpointer, - return_internal_reference<>()) - //return_value_policy()) - .def("SetIsInRing", &MolAtom::SetIsInRing) - .def("IsInRing", &MolAtom::IsInRing) - // Python-only - .add_property("X", &MolAtom::GetX, &MolAtom::SetX) - .add_property("Y", &MolAtom::GetY, &MolAtom::SetY) - .add_property("Z", &MolAtom::GetZ, &MolAtom::SetZ) - .add_property("Occupancy", &MolAtom::GetOccupancy, - &MolAtom::SetOccupancy) - .def("__str__", &__str__) - .def("int_ptr", &MolAtom::int_ptr) - ; -} diff --git a/src/extensions/molbond_ext.cpp b/src/extensions/molbond_ext.cpp deleted file mode 100644 index d749bd99..00000000 --- a/src/extensions/molbond_ext.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::MolBond. -* -* Changes from ObjCryst::MolBond -* - Added __getitem__ access for MolAtoms. -* - File IO is disabled -* - GetDeriv and CalcGradient are not wrapped. -* - Length0, LengthDelta, LengthSigma and BondOrder are wrapped as properties -* rather than methods. -* -*****************************************************************************/ - -#include - -#include - -namespace bp = boost::python; -using namespace boost::python; -using namespace ObjCryst; - -namespace { - -MolAtom* _GetAtom(MolBond& mb, size_t i) -{ - - MolAtom* rv = NULL; - switch(i) - { - case 0: - rv = &(mb.GetAtom1()); - break; - case 1: - rv = &(mb.GetAtom2()); - break; - default: - PyErr_SetString(PyExc_IndexError, "Index out of range"); - throw_error_already_set(); - } - - // Do this to avoid ugly compiler warnings - return rv; -} - -} // namespace - - -void wrap_molbond() -{ - - class_ > ("MolBond", no_init) - //init()) - .def("GetMolecule", (Molecule& (MolBond::*)()) - &MolBond::GetMolecule, - return_internal_reference<>()) - .def("GetLogLikelihood", - (double (MolBond::*)() const) - &MolBond::GetLogLikelihood) - .def("GetLogLikelihood", - (double (MolBond::*)(const bool, const bool) const) - &MolBond::GetLogLikelihood) - .def("GetName", &MolBond::GetName) - .def("GetAtom1", (MolAtom& (MolBond::*)()) &MolBond::GetAtom1, - return_internal_reference<>()) - .def("GetAtom2", (MolAtom& (MolBond::*)()) &MolBond::GetAtom2, - return_internal_reference<>()) - .def("SetAtom1", &MolBond::SetAtom1, - with_custodian_and_ward<1,2>()) - .def("SetAtom2", &MolBond::SetAtom2, - with_custodian_and_ward<1,2>()) - .def("GetLength", &MolBond::GetLength) - .def("GetLength0", &MolBond::GetLength0) - .def("GetLengthDelta", &MolBond::GetLengthDelta) - .def("GetLengthSigma", &MolBond::GetLengthSigma) - .def("GetBondOrder", &MolBond::GetBondOrder) - .def("SetLength0", &MolBond::SetLength0) - .def("SetLengthDelta", &MolBond::SetLengthDelta) - .def("SetLengthSigma", &MolBond::SetLengthSigma) - .def("SetBondOrder", &MolBond::SetBondOrder) - .def("IsFreeTorsion", &MolBond::IsFreeTorsion) - .def("SetFreeTorsion", &MolBond::SetFreeTorsion) - // Python-only - .add_property("Length", &MolBond::GetLength) - .add_property("Length0", &MolBond::GetLength0, &MolBond::SetLength0) - .add_property("LengthDelta", &MolBond::GetLengthDelta, - &MolBond::SetLengthDelta) - .add_property("LengthSigma", &MolBond::GetLengthSigma, - &MolBond::SetLengthSigma) - .add_property("BondOrder", &MolBond::GetBondOrder, - &MolBond::SetBondOrder) - .def("__getitem__", &_GetAtom, - return_internal_reference<>()) - .def("int_ptr", &MolBond::int_ptr) - ; -} diff --git a/src/extensions/molbondangle_ext.cpp b/src/extensions/molbondangle_ext.cpp deleted file mode 100644 index b8565ea0..00000000 --- a/src/extensions/molbondangle_ext.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::MolBondAngle. -* -* Changes from ObjCryst::MolBondAngle -* - Wrapped as a to-python converter only (no constructor) -* - Added __getitem__ access for MolAtoms. -* - File IO is disabled -* - GetDeriv and CalcGradient are not wrapped. -* - Angle0, AngleDelta and AngleSigma are wrapped as properties rather than -* methods. -* - IsFlexible and SetFlexible are not wrapped, as they are not implemented in -* the library. -* -*****************************************************************************/ - -#include -#include - -#include - -namespace bp = boost::python; -using namespace boost::python; -using namespace ObjCryst; - -namespace { - -MolAtom* _GetAtom(MolBondAngle& mb, size_t i) -{ - MolAtom* rv = NULL; - switch(i) - { - case 0: - rv = &(mb.GetAtom1()); - break; - case 1: - rv = &(mb.GetAtom2()); - break; - case 2: - rv = &(mb.GetAtom3()); - break; - default: - PyErr_SetString(PyExc_IndexError, "Index out of range"); - throw_error_already_set(); - } - return rv; -} - - -} // namespace - - -void wrap_molbondangle() -{ - - class_ > ("MolBondAngle", no_init) - .def("GetMolecule", (Molecule& (MolBondAngle::*)()) - &MolBondAngle::GetMolecule, - return_internal_reference<>()) - .def("GetName", &MolBondAngle::GetName) - .def("GetLogLikelihood", - (double (MolBondAngle::*)() const) - &MolBondAngle::GetLogLikelihood) - .def("GetLogLikelihood", - (double (MolBondAngle::*)(const bool, const bool) const) - &MolBondAngle::GetLogLikelihood) - .def("GetAngle", &MolBondAngle::GetAngle) - .def("GetAngle0", &MolBondAngle::GetAngle0) - .def("GetAngleDelta", &MolBondAngle::GetAngleDelta) - .def("GetAngleSigma", &MolBondAngle::GetAngleSigma) - .def("SetAngle0", &MolBondAngle::SetAngle0) - .def("SetAngleDelta", &MolBondAngle::SetAngleDelta) - .def("SetAngleSigma", &MolBondAngle::SetAngleSigma) - .def("GetAtom1", (MolAtom& (MolBondAngle::*)()) &MolBondAngle::GetAtom1, - return_internal_reference<>()) - .def("GetAtom2", (MolAtom& (MolBondAngle::*)()) &MolBondAngle::GetAtom2, - return_internal_reference<>()) - .def("GetAtom3", (MolAtom& (MolBondAngle::*)()) &MolBondAngle::GetAtom3, - return_internal_reference<>()) - .def("SetAtom1", &MolBondAngle::SetAtom1, - with_custodian_and_ward<1,2>()) - .def("SetAtom2", &MolBondAngle::SetAtom2, - with_custodian_and_ward<1,2>()) - .def("SetAtom3", &MolBondAngle::SetAtom3, - with_custodian_and_ward<1,2>()) - //.def("IsFlexible", &MolBondAngle::IsFlexible) - //.def("SetFlexible", &MolBondAngle::SetFlexible) - // Python-only - .add_property("Angle", &MolBondAngle::GetAngle) - .add_property("Angle0", &MolBondAngle::GetAngle0, - &MolBondAngle::SetAngle0) - .add_property("AngleDelta", &MolBondAngle::GetAngleDelta, - &MolBondAngle::SetAngleDelta) - .add_property("AngleSigma", &MolBondAngle::GetAngleSigma, - &MolBondAngle::SetAngleSigma) - .def("__getitem__", &_GetAtom, - return_internal_reference<>()) - // Iterate other the atoms involved - .def("__iter__", range > - (&MolBondAngle::begin, &MolBondAngle::end)) - .def("int_ptr", &MolBondAngle::int_ptr) - ; -} diff --git a/src/extensions/moldihedralangle_ext.cpp b/src/extensions/moldihedralangle_ext.cpp deleted file mode 100644 index 5261743e..00000000 --- a/src/extensions/moldihedralangle_ext.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::MolDihedralAngle. -* -* Changes from ObjCryst::MolDihedralAngle -* - Wrapped as a to-python converter only (no constructor) -* - Added __getitem__ access for MolAtoms. -* -*****************************************************************************/ - -#include -#include - -#include - -namespace bp = boost::python; -using namespace boost::python; -using namespace ObjCryst; - -namespace { - -MolAtom* _GetAtom(MolDihedralAngle& mb, size_t i) -{ - MolAtom* rv = NULL; - switch(i) - { - case 0: - rv = &(mb.GetAtom1()); - break; - case 1: - rv = &(mb.GetAtom2()); - break; - case 2: - rv = &(mb.GetAtom3()); - break; - case 3: - rv = &(mb.GetAtom4()); - break; - default: - PyErr_SetString(PyExc_IndexError, "Index out of range"); - throw_error_already_set(); - } - - return rv; -} - -} // namespace - - -void wrap_moldihedralangle() -{ - - class_ > ("MolDihedralAngle", no_init) - .def("GetMolecule", (Molecule& (MolDihedralAngle::*)()) - &MolDihedralAngle::GetMolecule, - return_internal_reference<>()) - .def("GetName", &MolDihedralAngle::GetName) - .def("GetLogLikelihood", - (double (MolDihedralAngle::*)() const) - &MolDihedralAngle::GetLogLikelihood) - .def("GetLogLikelihood", - (double (MolDihedralAngle::*)(const bool, const bool) const) - &MolDihedralAngle::GetLogLikelihood) - .def("GetAngle", &MolDihedralAngle::GetAngle) - .def("GetAngle0", &MolDihedralAngle::GetAngle0) - .def("GetAngleDelta", &MolDihedralAngle::GetAngleDelta) - .def("GetAngleSigma", &MolDihedralAngle::GetAngleSigma) - .def("SetAngle0", &MolDihedralAngle::SetAngle0) - .def("SetAngleDelta", &MolDihedralAngle::SetAngleDelta) - .def("SetAngleSigma", &MolDihedralAngle::SetAngleSigma) - .def("GetAtom1", (MolAtom& (MolDihedralAngle::*)()) - &MolDihedralAngle::GetAtom1, - return_internal_reference<>()) - .def("GetAtom2", (MolAtom& (MolDihedralAngle::*)()) - &MolDihedralAngle::GetAtom2, - return_internal_reference<>()) - .def("GetAtom3", (MolAtom& (MolDihedralAngle::*)()) - &MolDihedralAngle::GetAtom3, - return_internal_reference<>()) - .def("GetAtom4", (MolAtom& (MolDihedralAngle::*)()) - &MolDihedralAngle::GetAtom4, - return_internal_reference<>()) - .def("SetAtom1", &MolDihedralAngle::SetAtom1, - with_custodian_and_ward<1,2>()) - .def("SetAtom2", &MolDihedralAngle::SetAtom2, - with_custodian_and_ward<1,2>()) - .def("SetAtom3", &MolDihedralAngle::SetAtom3, - with_custodian_and_ward<1,2>()) - .def("SetAtom4", &MolDihedralAngle::SetAtom4, - with_custodian_and_ward<1,2>()) - // Python-only - .add_property("Angle", &MolDihedralAngle::GetAngle) - .add_property("Angle0", &MolDihedralAngle::GetAngle0, - &MolDihedralAngle::SetAngle0) - .add_property("AngleDelta", &MolDihedralAngle::GetAngleDelta, - &MolDihedralAngle::SetAngleDelta) - .add_property("AngleSigma", &MolDihedralAngle::GetAngleSigma, - &MolDihedralAngle::SetAngleSigma) - .def("__getitem__", &_GetAtom, - return_internal_reference<>()) - // Iterate other the atoms involved - .def("__iter__", range > - (&MolDihedralAngle::begin, &MolDihedralAngle::end)) - .def("int_ptr", &MolDihedralAngle::int_ptr) - ; -} diff --git a/src/extensions/molecule_ext.cpp b/src/extensions/molecule_ext.cpp deleted file mode 100644 index d856c827..00000000 --- a/src/extensions/molecule_ext.cpp +++ /dev/null @@ -1,863 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::Molecule. -* -* Note that all indices are zero-based. -* -* Changes from ObjCryst::Molecule -* - The public data are not wrapped. -* - Added __getitem__ access for MolAtoms. -* - AddAtom returns the added MolAtom -* - AddBond returns the added MolBond -* - AddBondAngle returns the added MolBondAngle -* - AddDihedralAngle returns the added MolDihedralAngle -* - RemoveAtom returns None, has an indexed version -* - RemoveBond returns None, has an indexed version -* - RemoveBondAngle returns None, has an indexed version -* - RemoveDihedralAngle returns None, has an indexed version -* - RemoveRigidGroup returns None -* - Added GetNbAtoms -* - Added GetNbBonds -* - Added GetNbBondAngles -* - Added GetNbDihedralAngles -* - Added GetNbRigidGroups -* - Added GetBond -* - Added GetBondAngle -* - Added GetDihedralAngle -* - Added GetRigidGroup -* - FindBond returns the bond if found, None otherwise -* - FindBondAngle returns the bond angle if found, None otherwise -* - FindDihedralAngle returns the dihedral angle if found, None otherwise -* - FindAtom returns the Atom if found or None otherwise -* - FlipAtomGroup is not wrapped. -* - FlipGroup, RotorGroup and StretchModeGroup are not wrapped. -* - StretchMode getters are not wrapped. -* - Quaternion ordinates Q0, Q1, Q2 and Q3 wrapped as properties. -* -*****************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "helpers.hpp" - -namespace bp = boost::python; -using namespace boost::python; -using namespace ObjCryst; - - -namespace { - - -// Overloaded to return added object and manage the lifetime of the object. -MolAtom& _AddAtom(Molecule& m, const double x, const double y, const double z, - const ScatteringPower* pow, const std::string& name, - const bool updateDisplay=true) -{ - m.AddAtom(x, y, z, pow, name, updateDisplay); - m.SetDeleteSubObjInDestructor(false); - std::vector& v = m.GetAtomList(); - return *v.back(); -} - -MolBond& _AddBond(Molecule& m, MolAtom& atom1, MolAtom& atom2, const double - length, const double sigma, const double delta, const double bondOrder = - 1., const bool updateDisplay = true) -{ - m.AddBond(atom1, atom2, length, sigma, delta, bondOrder, updateDisplay); - m.SetDeleteSubObjInDestructor(false); - std::vector& v = m.GetBondList(); - return *v.back(); -} - -MolBondAngle& _AddBondAngle(Molecule& m, MolAtom& atom1, MolAtom& atom2, - MolAtom& atom3, const double angle, const double sigma, const double - delta, const bool updateDisplay = true) -{ - m.AddBondAngle(atom1, atom2, atom3, angle, sigma, delta, updateDisplay); - m.SetDeleteSubObjInDestructor(false); - std::vector& v = m.GetBondAngleList(); - return *v.back(); -} - -MolDihedralAngle& _AddDihedralAngle(Molecule& m, MolAtom& atom1, MolAtom& - atom2, MolAtom& atom3, MolAtom& atom4, const double angle, const double - sigma, const double delta, const bool updateDisplay = true) -{ - m.AddDihedralAngle(atom1, atom2, atom3, atom4, angle, sigma, delta, - updateDisplay); - m.SetDeleteSubObjInDestructor(false); - std::vector& v = m.GetDihedralAngleList(); - return *v.back(); -} - -// New Functions -size_t _GetNbAtoms(Molecule& m) -{ - std::vector& v = m.GetAtomList(); - return v.size(); -} - -size_t _GetNbBonds(Molecule& m) -{ - std::vector& v = m.GetBondList(); - return v.size(); -} - -size_t _GetNbBondAngles(Molecule& m) -{ - std::vector& v = m.GetBondAngleList(); - return v.size(); -} - -size_t _GetNbDihedralAngles(Molecule& m) -{ - std::vector& v = m.GetDihedralAngleList(); - return v.size(); -} - -size_t _GetNbRigidGroups(Molecule& m) -{ - std::vector& v = m.GetRigidGroupList(); - return v.size(); -} - -// Overloaded for safety -MolAtom& _GetAtomIdx(Molecule& m, int idx) -{ - int i = check_index(idx, m.GetNbComponent(), ALLOW_NEGATIVE); - return m.GetAtom(i); -} - -// Overloaded for safety -MolAtom* _FindAtom(Molecule& m, const std::string& name) -{ - MolAtom* rv = NULL; - auto ii = m.FindAtom(name); - if (ii != m.mvpAtom.rend()) rv = *ii; - return rv; -} - -// Overloaded for safety -MolAtom* _GetAtomByName(Molecule& m, const std::string& name) -{ - MolAtom* rv = _FindAtom(m, name); - if (!rv) - { - bp::object emsg = ("Invalid atom name %r" % bp::make_tuple(name)); - PyErr_SetObject(PyExc_ValueError, emsg.ptr()); - throw_error_already_set(); - } - return rv; -} - -MolBond& _GetBondIdx(Molecule& m, int idx) -{ - std::vector& v = m.GetBondList(); - if(idx < 0) idx += v.size(); - if(0 == v.size() || idx < 0 || idx >= (int) v.size()) - { - PyErr_SetString(PyExc_IndexError, "Index out of range"); - throw_error_already_set(); - } - return *v[idx]; -} - -MolBondAngle& _GetBondAngleIdx(Molecule& m, int idx) -{ - std::vector& v = m.GetBondAngleList(); - if(idx < 0) idx += v.size(); - if(0 == v.size() || idx < 0 || idx >= (int) v.size()) - { - PyErr_SetString(PyExc_IndexError, "Index out of range"); - throw_error_already_set(); - } - return *v[idx]; -} - -MolDihedralAngle& _GetDihedralAngleIdx(Molecule& m, int idx) -{ - std::vector& v = m.GetDihedralAngleList(); - if(idx < 0) idx += v.size(); - if(0 == v.size() || idx < 0 || idx >= (int) v.size()) - { - PyErr_SetString(PyExc_IndexError, "Index out of range"); - throw_error_already_set(); - } - return *v[idx]; -} - -// Overloaded for void return type and index access. -void _RemoveAtom(Molecule& m, MolAtom& ma) -{ - m.RemoveAtom(ma, false); -} - -void _RemoveAtomIdx(Molecule& m, int idx) -{ - m.RemoveAtom(_GetAtomIdx(m, idx), false); -} - -void _RemoveBond(Molecule& m, const MolBond& mb) -{ - m.RemoveBond(mb, false); -} - -void _RemoveBondIdx(Molecule& m, int idx) -{ - m.RemoveBond(_GetBondIdx(m, idx), false); -} - -void _RemoveBondAngle(Molecule& m, MolBondAngle& mba) -{ - m.RemoveBondAngle(mba, false); -} - -void _RemoveBondAngleIdx(Molecule& m, int idx) -{ - m.RemoveBondAngle(_GetBondAngleIdx(m, idx), false); -} - -void _RemoveDihedralAngle(Molecule& m, MolDihedralAngle& mda) -{ - m.RemoveDihedralAngle(mda, false); -} - -void _RemoveDihedralAngleIdx(Molecule& m, int idx) -{ - m.RemoveDihedralAngle(_GetDihedralAngleIdx(m, idx), false); -} - -// Overloaded to return new rigid group object -RigidGroup& _AddRigidGroup(Molecule& m, const RigidGroup& r, const bool ud=true) -{ - m.AddRigidGroup(r, ud); - // Get the new rigid group and return it - std::vector& v = m.GetRigidGroupList(); - return *v.back(); -} - -// Overloaded to accept python iterable and to return the rigid group object -RigidGroup& _AddRigidGroupIterable(Molecule& m, bp::object& l, const bool ud=true) -{ - // convert l to a rigid group - RigidGroup* r = new RigidGroup(); - - for(int i=0; i < len(l); ++i) - { - MolAtom* a = extract(l[i]); - r->insert(a); - } - - // Add this rigid group and delete it, since AddRigidGroup makes a copy. - m.AddRigidGroup(*r, ud); - delete r; - - // Get the new rigid group and return it - std::vector& v = m.GetRigidGroupList(); - return *v.back(); -} - -// Overloaded for void return type -void _RemoveRigidGroup(Molecule& m, RigidGroup& mda, const bool ud=true) -{ - m.RemoveRigidGroup(mda, ud, false); -} - -PyObject* _FindBond(const Molecule& m, const MolAtom& ma1, const MolAtom& ma2) -{ - std::vector::const_iterator mbi; - mbi = m.FindBond(ma1, ma2); - const std::vector& bondlist = m.GetBondList(); - PyObject* retval; - if(bondlist.end() == mbi) - { - // return None - retval = Py_None; - } - else - { - reference_existing_object::apply::type converter; - retval = converter(*mbi); - - } - bp::incref(retval); - return retval; -} - -PyObject* _FindBondAngle(const Molecule& m, const MolAtom& ma1, const MolAtom& - ma2, const MolAtom& ma3) -{ - std::vector::const_iterator mbai; - mbai = m.FindBondAngle(ma1, ma2, ma3); - const std::vector& bondanglelist = m.GetBondAngleList(); - PyObject* retval; - if(bondanglelist.end() == mbai) - { - // return None - retval = Py_None; - } - else - { - reference_existing_object::apply::type converter; - retval = converter(*mbai); - } - bp::incref(retval); - return retval; -} - -PyObject* _FindDihedralAngle(const Molecule& m, const MolAtom& ma1, - const MolAtom& ma2, const MolAtom& ma3, const MolAtom& ma4) -{ - std::vector::const_iterator mdai; - mdai = m.FindDihedralAngle(ma1, ma2, ma3, ma4); - const std::vector& dihedralanglelist - = m.GetDihedralAngleList(); - PyObject* retval; - if(dihedralanglelist.end() == mdai) - { - // return None - retval = Py_None; - } - else - { - reference_existing_object::apply::type converter; - retval = converter(*mdai); - } - bp::incref(retval); - return retval; -} - -// This could usually be done with an indexing suite, but it doesn't work with -// vectors of pointers. -bp::list _GetAtomList(const Molecule& m) -{ - bp::list l; - - const std::vector& v = m.GetAtomList(); - - l = ptrcontainerToPyList< const std::vector >(v); - - return l; -} - -bp::list _GetBondList(const Molecule& m) -{ - bp::list l; - - const std::vector& v = m.GetBondList(); - - l = ptrcontainerToPyList< const std::vector >(v); - - return l; -} - -bp::list _GetBondAngleList(const Molecule& m) -{ - bp::list l; - - const std::vector& v = m.GetBondAngleList(); - - l = ptrcontainerToPyList< const std::vector >(v); - - return l; -} - -bp::list _GetDihedralAngleList(const Molecule& m) -{ - bp::list l; - - const std::vector& v = m.GetDihedralAngleList(); - - l = ptrcontainerToPyList< const std::vector >(v); - - return l; -} - -bp::list _GetStretchModeBondLengthList(const Molecule& m) -{ - bp::list l; - - const std::list& v = - m.GetStretchModeBondLengthList(); - - l = containerToPyList< const std::list >(v); - - return l; -} - -bp::list _GetStretchModeBondAngleList(const Molecule& m) -{ - bp::list l; - - const std::list& v = m.GetStretchModeBondAngleList(); - - l = containerToPyList< const std::list >(v); - - return l; -} - -bp::list _GetStretchModeTorsionList(const Molecule& m) -{ - bp::list l; - - const std::list& v = m.GetStretchModeTorsionList(); - - l = containerToPyList< const std::list >(v); - - return l; -} - -bp::list _GetRigidGroupList(const Molecule& m) -{ - bp::list l; - - const std::vector& v = m.GetRigidGroupList(); - - l = ptrcontainerToPyList< const std::vector >(v); - - return l; -} - -// Access using standard iterators -std::vector::const_iterator _GetAtomIterBegin(const Molecule& m) -{return m.GetAtomList().begin();} -std::vector::const_iterator _GetAtomIterEnd(const Molecule& m) -{return m.GetAtomList().end();} - -std::vector::const_iterator _GetBondIterBegin(const Molecule& m) -{return m.GetBondList().begin();} -std::vector::const_iterator _GetBondIterEnd(const Molecule& m) -{return m.GetBondList().end();} - -std::vector::const_iterator _GetBondAngleIterBegin(const Molecule& m) -{return m.GetBondAngleList().begin();} -std::vector::const_iterator _GetBondAngleIterEnd(const Molecule& m) -{return m.GetBondAngleList().end();} - -std::vector::const_iterator _GetDihedralAngleIterBegin(const Molecule& m) -{return m.GetDihedralAngleList().begin();} -std::vector::const_iterator _GetDihedralAngleIterEnd(const Molecule& m) -{return m.GetDihedralAngleList().end();} - - -// Get atoms by slice -bp::object getAtomSlice(Molecule& m, bp::slice& s) -{ - bp::list l = _GetAtomList(m); - return l[s]; -} - -// Overloaded to accept a python iterable instead of a std::set. Again, could be -// done with converters, but there are issues with pointers. Perhaps another -// day... -void _RotateAtomGroup(Molecule& m, const MolAtom& at1, const MolAtom& at2, - const bp::object& atoms, const double angle, const bool keepCenter=true) -{ - - std::set catoms = pyIterableToSet(atoms); - m.RotateAtomGroup(at1, at2, catoms, angle, keepCenter); -} - -void _RotateAtomGroupVec(Molecule& m, const MolAtom& at1, const double vx, - const double vy, const double vz, const bp::object& atoms, const double angle, - const bool keepCenter=true) -{ - - std::set catoms = pyIterableToSet(atoms); - m.RotateAtomGroup(at1, vx, vy, vz, catoms, angle, keepCenter); -} - -// A new method for three-tuples -void _RotateAtomGroup2Vec(Molecule& m, bp::object& v1, bp::object& v2, - const bp::object& atoms, const double angle, - const bool keepCenter=true) -{ - - double x, y, z; - x = extract(v1[0]); - y = extract(v1[1]); - z = extract(v1[2]); - MolAtom& a = _AddAtom(m, x, y, z, 0, "_rag2vectemp", false); - x = extract(v2[0]); - y = extract(v2[1]); - z = extract(v2[2]); - _RotateAtomGroupVec(m, a, x, y, z, atoms, angle, keepCenter); - m.RemoveAtom(a, true); - return; -} - -void _TranslateAtomGroup(Molecule& m, const bp::object& atoms, const double dx, - const double dy, const double dz, const bool keepCenter=true) -{ - - std::set catoms = pyIterableToSet(atoms); - m.TranslateAtomGroup(catoms, dx, dy, dz, keepCenter); -} - -bp::dict _GetConnectivityTable(Molecule& m) -{ - - const std::map >& ct - = m.GetConnectivityTable(); - - std::map >::const_iterator miter; - - bp::dict d; - - for(miter = ct.begin(); miter != ct.end(); ++miter) - { - bp::object key(bp::ptr(miter->first)); - - d[key] = ptrcontainerToPyList< const std::set - >(miter->second); - } - - return d; -} - -bp::list _AsZMatrix(const Molecule& m, const bool keeporder) -{ - bp::list l; - - const std::vector& v = m.AsZMatrix(keeporder); - - l = containerToPyList< const std::vector >(v); - - return l; -} - -std::string quatparname(const Molecule& m, int idx) -{ - using namespace std; - static bool didseparator = false; - static bool prefixmolname = false; - static string separator; - if (!didseparator) - { - map qnames; - for (long i = 0; i < m.GetNbPar(); ++i) - { - const string& pname = m.GetPar(i).GetName(); - size_t n = pname.size(); - if (n < 2) continue; - if (pname[n - 2] != 'Q') continue; - if (pname.find_last_of("0123", n - 1) == string::npos) continue; - qnames[pname.substr(0, n - 2)] += 1; - } - map::iterator qni; - const string& mname = m.GetName(); - for (qni = qnames.begin(); qni != qnames.end(); ++qni) - { - if (qni->second == 4) - { - const string& qnm = qni->first; - prefixmolname = (qnm.size() >= mname.size() && - qnm.substr(0, mname.size()) == mname); - size_t p0 = prefixmolname ? mname.size() : 0; - separator = qnm.substr(p0); - didseparator = true; - } - } - } - ostringstream rv; - rv << (prefixmolname ? m.GetName() : "") << separator << 'Q' << idx; - return rv.str(); -} - - -// Setters and getters for position -void _setQ0(Molecule& m, double val) -{ - m.GetPar(quatparname(m, 0)).SetValue(val); -} - -double _getQ0(Molecule& m) -{ - return m.GetPar(quatparname(m, 0)).GetValue(); -} - -void _setQ1(Molecule& m, double val) -{ - m.GetPar(quatparname(m, 1)).SetValue(val); -} - -double _getQ1(Molecule& m) -{ - return m.GetPar(quatparname(m, 1)).GetValue(); -} - -void _setQ2(Molecule& m, double val) -{ - m.GetPar(quatparname(m, 2)).SetValue(val); -} - -double _getQ2(Molecule& m) -{ - return m.GetPar(quatparname(m, 2)).GetValue(); -} - -void _setQ3(Molecule& m, double val) -{ - m.GetPar(quatparname(m, 3)).SetValue(val); -} - -double _getQ3(Molecule& m) -{ - return m.GetPar(quatparname(m, 3)).GetValue(); -} - -const ScatteringPower* getscatteringpowerpointer(const MolZAtom& a) -{ - const ScatteringPower* rv = - a.mpPow==0 ? NULL : a.mpPow; - return rv; -} - -} // namespace - - -void wrap_molecule() -{ - - class_ > ("Molecule", - init(bp::arg("oldMolecule"))) - /* Constructors */ - .def(init( - (bp::arg("cryst"), bp::arg("name")=""))) - /* Methods */ - .def("GetFormula", &Molecule::GetFormula) - .def("AddAtom", &_AddAtom, - (bp::arg("x"), bp::arg("y"), bp::arg("z"), bp::arg("pPow"), - bp::arg("name"), bp::arg("updateDisplay")=true), - with_custodian_and_ward<1,5, return_internal_reference<> >()) - .def("RemoveAtom", &_RemoveAtom) - .def("RemoveAtom", &_RemoveAtomIdx) - .def("AddBond", &_AddBond, - (bp::arg("atom1"), bp::arg("atom2"), bp::arg("length"), - bp::arg("sigma"), bp::arg("delta"), bp::arg("bondOrder")=1, - bp::arg("updateDisplay")=true), - with_custodian_and_ward<1,2, - with_custodian_and_ward<1,3, - return_internal_reference<> > >()) - .def("RemoveBond", &_RemoveBond) - .def("RemoveBond", &_RemoveBondIdx) - .def("GetBond", &_GetBondIdx, return_internal_reference<>()) - .def("FindBond", &_FindBond, - with_custodian_and_ward_postcall<1,0>()) - .def("AddBondAngle", &_AddBondAngle, - (bp::arg("atom1"), bp::arg("atom2"), bp::arg("atom3"), - bp::arg("angle"), bp::arg("sigma"), bp::arg("delta"), - bp::arg("updateDisplay")=true), - with_custodian_and_ward<1,2, - with_custodian_and_ward<1,3, - with_custodian_and_ward<1,4, - return_internal_reference<> > > >()) - .def("RemoveBondAngle", &_RemoveBondAngle) - .def("RemoveBondAngle", &_RemoveBondAngleIdx) - .def("GetBondAngle", &_GetBondAngleIdx, return_internal_reference<>()) - .def("FindBondAngle", &_FindBondAngle, - with_custodian_and_ward_postcall<1,0>()) - .def("AddDihedralAngle", &_AddDihedralAngle, - (bp::arg("atom1"), bp::arg("atom2"), bp::arg("atom3"), - bp::arg("atom4"), bp::arg("angle"), bp::arg("sigma"), - bp::arg("delta"), bp::arg("updateDisplay")=true), - with_custodian_and_ward<1,2, - with_custodian_and_ward<1,3, - with_custodian_and_ward<1,4, - with_custodian_and_ward<1,5, - return_internal_reference<> > > > >()) - .def("RemoveDihedralAngle", &_RemoveDihedralAngle) - .def("RemoveDihedralAngle", &_RemoveDihedralAngleIdx) - .def("GetDihedralAngle", &_GetDihedralAngleIdx, - return_internal_reference<>()) - .def("FindDihedralAngle", &_FindDihedralAngle, - with_custodian_and_ward_postcall<1,0>()) - .def("AddRigidGroup", &_AddRigidGroup, - (bp::arg("group"), bp::arg("updateDisplay") = true), - return_internal_reference<>()) - .def("AddRigidGroup", &_AddRigidGroupIterable, - (bp::arg("group"), bp::arg("updateDisplay") = true), - return_internal_reference<>()) - .def("RemoveRigidGroup", &_RemoveRigidGroup, - (bp::arg("group"), bp::arg("updateDisplay") = true)) - .def("GetAtom", &_GetAtomIdx, return_internal_reference<>()) - .def("GetAtom", &_GetAtomByName, return_internal_reference<>()) - .def("FindAtom", &_FindAtom, return_internal_reference<>()) - .def("OptimizeConformation", &Molecule::OptimizeConformation, - (bp::arg("nbTrial")=10000, bp::arg("stopCost")=0)) - .def("OptimizeConformationSteepestDescent", - &Molecule::OptimizeConformationSteepestDescent, - (bp::arg("maxStep")=0.1, bp::arg("nbSteps")=1)) - .def("GetNbAtoms", &_GetNbAtoms) - .def("GetNbBonds", &_GetNbBonds) - .def("GetNbBondAngles", &_GetNbBondAngles) - .def("GetNbDihedralAngles", &_GetNbDihedralAngles) - .def("GetNbRigidGroups", &_GetNbRigidGroups) - .def("GetAtomList", &_GetAtomList, - with_custodian_and_ward_postcall<1,0>()) - .def("GetBondList", &_GetBondList, - with_custodian_and_ward_postcall<1,0>()) - .def("GetBondAngleList", &_GetBondAngleList, - with_custodian_and_ward_postcall<1,0>()) - .def("GetDihedralAngleList", &_GetDihedralAngleList, - with_custodian_and_ward_postcall<1,0>()) - .def("GetRigidGroupList", &_GetRigidGroupList, - with_custodian_and_ward_postcall<1,0>()) - .def("GetStretchModeBondLengthList", &_GetStretchModeBondLengthList, - with_custodian_and_ward_postcall<1,0>()) - .def("GetStretchModeBondAngleList", &_GetStretchModeBondAngleList, - with_custodian_and_ward_postcall<1,0>()) - .def("GetStretchModeTorsionList", &_GetStretchModeTorsionList, - with_custodian_and_ward_postcall<1,0>()) - .def("RotateAtomGroup", &_RotateAtomGroup, - (bp::arg("at1"), bp::arg("at2"), bp::arg("atoms"), bp::arg("angle"), - bp::arg("keepCenter")=true - ) - ) - .def("RotateAtomGroup", &_RotateAtomGroupVec, - (bp::arg("at1"), bp::arg("vx"), bp::arg("vy"), bp::arg("vz"), - bp::arg("atoms"), bp::arg("angle"), bp::arg("keepCenter")=true - ) - ) - .def("RotateAtomGroup", &_RotateAtomGroup2Vec, - (bp::arg("v1"), bp::arg("v2"), bp::arg("atoms"), bp::arg("angle"), - bp::arg("keepCenter")=true - ) - ) - .def("TranslateAtomGroup", &_TranslateAtomGroup, - (bp::arg("atoms"), bp::arg("dx"), bp::arg("dy"), bp::arg("dz"), - bp::arg("keepCenter")=true - ) - ) - .def("GetConnectivityTable", &_GetConnectivityTable, - with_custodian_and_ward_postcall<1,0>()) - .def("GetBondListClock", (RefinableObjClock& (Molecule::*)()) - &Molecule::GetBondListClock, - return_internal_reference<>()) - .def("GetAtomPositionClock", (RefinableObjClock& (Molecule::*)()) - &Molecule::GetAtomPositionClock, - return_internal_reference<>()) - .def("GetRigidGroupClock", (RefinableObjClock& (Molecule::*)()) - &Molecule::GetRigidGroupClock, - return_internal_reference<>()) - .def("RigidifyWithDihedralAngles", - &Molecule::RigidifyWithDihedralAngles) - .def("BondLengthRandomChange", &Molecule::BondLengthRandomChange, - (bp::arg("mode"), bp::arg("amplitude"), - bp::arg("respectRestraint")=true) - ) - .def("BondAngleRandomChange", &Molecule::BondAngleRandomChange, - (bp::arg("mode"), bp::arg("amplitude"), - bp::arg("respectRestraint")=true) - ) - .def("DihedralAngleRandomChange", &Molecule::DihedralAngleRandomChange, - (bp::arg("mode"), bp::arg("amplitude"), - bp::arg("respectRestraint")=true) - ) - .def("GetCenterAtom", &Molecule::GetCenterAtom, - return_internal_reference<>()) - // Memory management shouldn't be necessary here, but there is the - // possibility that a MolAtom that was created in another Molecule is - // passed to this one. This could lead to memory corruption if the - // original Molecule was to be deleted before this one, hence the - // with_custodian_and_ward. - .def("SetCenterAtom", &Molecule::SetCenterAtom, - with_custodian_and_ward<1,2>()) - .def("AsZMatrix", &_AsZMatrix, - with_custodian_and_ward_postcall<1,0>()) - .def("BuildRingList", &Molecule::BuildRingList) - .def("BuildConnectivityTable", &Molecule::BuildConnectivityTable) - .def("BuildRotorGroup", &Molecule::BuildRotorGroup) - .def("TuneGlobalOptimRotationAmplitude", - &Molecule::TuneGlobalOptimRotationAmplitude) - .def("BuildFlipGroup", &Molecule::BuildFlipGroup) - .def("BuildStretchModeBondLength", - &Molecule::BuildStretchModeBondLength) - .def("BuildStretchModeBondAngle", - &Molecule::BuildStretchModeBondAngle) - .def("BuildStretchModeTorsion", - &Molecule::BuildStretchModeTorsion) - .def("BuildStretchModeTwist", - &Molecule::BuildStretchModeTwist) - .def("BuildStretchModeGroups", - &Molecule::BuildStretchModeGroups) - .def("UpdateScattCompList", &Molecule::UpdateScattCompList) - .def("InitOptions", &Molecule::InitOptions) - // Python only functions - .def("__getitem__", &getAtomSlice, - with_custodian_and_ward_postcall<1,0>()) - .def("__getitem__", &_GetAtomIdx, - return_internal_reference<>()) - .def("__len__", &_GetNbAtoms) - .def("__iter__", range > - (&_GetAtomIterBegin, &_GetAtomIterEnd)) - .def("IterAtom", range > - (&_GetAtomIterBegin, &_GetAtomIterEnd)) - .def("IterBond", range > - (&_GetBondIterBegin, &_GetBondIterEnd)) - .def("IterBondAngle", range > - (&_GetBondAngleIterBegin, &_GetBondAngleIterEnd)) - .def("IterDihedralAngle", range > - (&_GetDihedralAngleIterBegin, &_GetDihedralAngleIterEnd)) - - // Properties for molecule position - .add_property("Q0", &_getQ0, &_setQ0) - .add_property("Q1", &_getQ1, &_setQ1) - .add_property("Q2", &_getQ2, &_setQ2) - .add_property("Q3", &_getQ3, &_setQ3) - ; - - // Wrap some functions - def("GetBondLength", &GetBondLength); - def("GetBondAngle", &GetBondAngle); - def("GetDihedralAngle", &GetDihedralAngle); - - def("ZScatterer2Molecule", - (Molecule* (*)(ZScatterer*)) &ZScatterer2Molecule, bp::arg("zscatt"), - return_value_policy()); - - // Wrap - class_ ("MolZAtom", init()) - .def("GetScatteringPower", getscatteringpowerpointer, - return_internal_reference<>()) - //return_value_policy()) - .add_property("bond_atom", &MolZAtom::mBondAtom) - .add_property("bond_angle_atom", &MolZAtom::mBondAngleAtom) - .add_property("dihdral_angle_atom", &MolZAtom::mDihedralAtom) - .add_property("bond_length", &MolZAtom::mBondLength) - .add_property("bond_angle", &MolZAtom::mBondAngle) - .add_property("dihdral_angle", &MolZAtom::mDihedralAngle) - ; - -} diff --git a/src/extensions/nb_asymmetricunit.cpp b/src/extensions/nb_asymmetricunit.cpp new file mode 100644 index 00000000..c5b10a5b --- /dev/null +++ b/src/extensions/nb_asymmetricunit.cpp @@ -0,0 +1,27 @@ +/* + * pyobjcryst nanobind port — AsymmetricUnit bindings + */ + +#include + +#include + +namespace nb = nanobind; +using namespace ObjCryst; + +void wrap_asymmetricunit(nb::module_& m) +{ + nb::class_(m, "AsymmetricUnit") + .def(nb::init<>()) + .def(nb::init(), nb::arg("spg")) + .def("SetSpaceGroup", &AsymmetricUnit::SetSpaceGroup, nb::arg("spg")) + .def("IsInAsymmetricUnit", &AsymmetricUnit::IsInAsymmetricUnit, + nb::arg("x"), nb::arg("y"), nb::arg("z")) + .def("Xmin", &AsymmetricUnit::Xmin) + .def("Xmax", &AsymmetricUnit::Xmax) + .def("Ymin", &AsymmetricUnit::Ymin) + .def("Ymax", &AsymmetricUnit::Ymax) + .def("Zmin", &AsymmetricUnit::Zmin) + .def("Zmax", &AsymmetricUnit::Zmax) + ; +} diff --git a/src/extensions/nb_atom.cpp b/src/extensions/nb_atom.cpp new file mode 100644 index 00000000..8516522d --- /dev/null +++ b/src/extensions/nb_atom.cpp @@ -0,0 +1,85 @@ +/* + * pyobjcryst nanobind port — Atom bindings + */ + +#include +#include + +#include +#include +#include + +namespace nb = nanobind; +using namespace ObjCryst; + +namespace { + +// Wrap a (possibly null) ScatteringPower* for return to Python. Its dynamic +// type is almost always ScatteringPowerAtom, which inherits VIRTUALLY from +// ScatteringPower and is therefore intentionally registered in nanobind +// WITHOUT a declared base (see nb_scatteringpoweratom.cpp) -- nanobind's +// automatic base<->derived pointer adjustment assumes a fixed, statically +// computable offset, which virtual inheritance does not provide. Detect the +// concrete type with a real C++ dynamic_cast (correct for virtual +// inheritance) before handing nanobind an already-correctly-typed pointer. +// See the identical fix in nb_crystal.cpp::wrapScatteringPowerPython for the +// segfault this avoids. +nb::object getScatteringPowerPython(nb::handle self) +{ + const Atom& a = nb::cast(self); + if (a.IsDummy()) return nb::none(); + const ScatteringPower& sp = a.GetScatteringPower(); + if (auto* spa = dynamic_cast(&sp)) + return nb::cast(const_cast(spa), nb::rv_policy::reference_internal, self); + return nb::cast(const_cast(&sp), nb::rv_policy::reference_internal, self); +} + +// Helper to get ScatteringPower* from various Python types (ScatteringPowerAtom, etc.) +// Since these classes may use virtual inheritance, we extract the pointer via the concrete type +const ScatteringPower* getScatteringPowerPtr(nb::object obj) +{ + // Handle None -> nullptr (dummy atom) + if (obj.is_none()) return nullptr; + // Try ScatteringPowerAtom first (most common) + try { + return static_cast(&nb::cast(obj)); + } catch (...) {} + // Try ScatteringPower directly + return &nb::cast(obj); +} + +} // namespace + +void wrap_atom(nb::module_& m) +{ + nb::class_(m, "Atom", nb::is_final()) + .def("__init__", + [](Atom* self, const Atom& old) { + new (self) Atom(old); + }, nb::arg("old")) + .def("__init__", + [](Atom* self, REAL x, REAL y, REAL z, + const std::string& name, nb::object pow, REAL popu) { + const ScatteringPower* sp = getScatteringPowerPtr(pow); + new (self) Atom(x, y, z, name, sp, popu); + }, + nb::arg("x"), nb::arg("y"), nb::arg("z"), nb::arg("name"), + nb::arg("pow").none(), nb::arg("popu") = (REAL)1.0) + .def("Init", + [](Atom& self, REAL x, REAL y, REAL z, + const std::string& name, nb::object pow, REAL popu) { + const ScatteringPower* sp = getScatteringPowerPtr(pow); + self.Init(x, y, z, name, sp, popu); + }, + nb::arg("x"), nb::arg("y"), nb::arg("z"), nb::arg("name"), + nb::arg("pow").none(), nb::arg("popu") = (REAL)1.0) + .def("GetMass", &Atom::GetMass) + .def("GetRadius", &Atom::GetRadius) + .def("IsDummy", &Atom::IsDummy) + .def("GetScatteringPower", &getScatteringPowerPython) + // GetName and other RefinableObj methods via Scatterer + .def("GetName", [](Atom& a) -> std::string { return std::string(a.GetName()); }) + .def("SetName", [](Atom& a, const std::string& n) { + static_cast(a).SetName(n); }) + ; +} diff --git a/src/extensions/nb_crystal.cpp b/src/extensions/nb_crystal.cpp new file mode 100644 index 00000000..67a7b23f --- /dev/null +++ b/src/extensions/nb_crystal.cpp @@ -0,0 +1,346 @@ +/* + * pyobjcryst nanobind port — Crystal bindings + */ + +#include +#include +#include +#include + +#include +#include + +#undef B0 +#include +#include +#include +#include +#include +#include + +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +struct PyCrystal : Crystal { + NB_TRAMPOLINE(Crystal, 1); + void UpdateDisplay() const override { NB_OVERRIDE(UpdateDisplay); } +}; + +namespace { + +// Crystal::GetScatteringPower() returns a ScatteringPower& whose dynamic +// type is almost always ScatteringPowerAtom. ScatteringPowerAtom inherits +// VIRTUALLY from ScatteringPower (see ScatteringPower.h), so nanobind's +// automatic base<->derived pointer-adjustment (used when it detects, via +// RTTI, that the returned object's most-derived registered type differs +// from the static return type) cannot compute a correct offset — it isn't +// a fixed, statically-known value for virtual bases. Left to its own +// devices, nanobind was producing a corrupted pointer for the +// ScatteringPowerAtom Python wrapper: reads/writes through it landed on +// unrelated memory, and calling any inherited method that touches the +// RefinableObjClock member (e.g. Biso's getter, which Clicks the clock) +// segfaulted walking a bogus mvParent tree (see +// tests/test_cif.py::test_TiO2_rutile_cif). +// +// The fix (same pattern already used in nb_scatteringcomponent.cpp's +// getScatteringPowerPython, and documented as "Pattern 4: Const Pointer +// Type Confusion" in nanobind_migration_notes.md): perform the downcast +// ourselves with a real C++ dynamic_cast (which correctly walks the +// object's actual vtable/RTTI at runtime, unlike nanobind's static offset +// table), and only then hand nanobind an already-correctly-typed pointer, +// so its automatic machinery has nothing left to compute. +nb::object wrapScatteringPowerPython(ScatteringPower& sp, nb::handle parent) +{ + if (auto* spa = dynamic_cast(&sp)) + return nb::cast(spa, nb::rv_policy::reference_internal, parent); + return nb::cast(&sp, nb::rv_policy::reference_internal, parent); +} + +} // namespace + +namespace { + +void _AddScatterer(Crystal& crystal, nb::handle obj) +{ + if (obj.is_none()) throw nb::value_error("Cannot add nonexistent Scatterer"); + Scatterer* scatt = nullptr; + try { + scatt = static_cast(&nb::cast(obj)); + } catch (...) { + try { + scatt = &nb::cast(obj); + } catch (...) { + throw nb::type_error("AddScatterer: argument must be a Scatterer instance"); + } + } + if (!scatt) throw nb::value_error("Cannot add nonexistent Scatterer"); + if (scatt->GetClassName() == "Atom") { + Atom* pat = dynamic_cast(scatt); + if (!pat->IsDummy()) { + const ScatteringPower* psp = &pat->GetScatteringPower(); + if (crystal.GetScatteringPowerRegistry().Find(psp) < 0) + throw ObjCrystException("The Atom's scattering power must be added to the Crystal first."); + } + } else if (scatt->GetClassName() == "Molecule") { + Molecule* pm = dynamic_cast(scatt); + for (int i = 0; i < pm->GetNbComponent(); i++) { + if (!pm->GetAtom(i).IsDummy()) { + if (crystal.GetScatteringPowerRegistry().Find(&pm->GetAtom(i).GetScatteringPower()) < 0) + throw ObjCrystException("The Molecule scattering powers must be added to the Crystal first."); + } + } + } + crystal.AddScatterer(scatt); +} + +void _RemoveScatterer(Crystal& crystal, nb::handle obj) +{ + if (obj.is_none()) throw nb::value_error("Cannot remove nonexistent Scatterer"); + Scatterer* scatt = nullptr; + try { + scatt = static_cast(&nb::cast(obj)); + } catch (...) { + try { + scatt = &nb::cast(obj); + } catch (...) { + throw nb::type_error("RemoveScatterer: argument must be a Scatterer instance"); + } + } + if (!scatt) throw nb::value_error("Cannot remove nonexistent Scatterer"); + crystal.RemoveScatterer(scatt, false); +} + +Scatterer& _GetScattByIndex(Crystal& crystal, int idx) +{ + int i = check_index(idx, crystal.GetNbScatterer(), ALLOW_NEGATIVE); + return crystal.GetScatt(i); +} + +Scatterer& _GetScattByName(Crystal& crystal, const std::string& name) +{ + try { + CaptureStdOut gag; + return crystal.GetScatt(name); + } catch (ObjCrystException&) { + throw nb::value_error(("Invalid atom name: " + name).c_str()); + } +} + +void _AddScatteringPower(Crystal& crystal, nb::handle obj) +{ + if (obj.is_none()) throw nb::value_error("Cannot add nonexistent ScatteringPower"); + // Accept ScatteringPowerAtom, ScatteringPowerSphere, or any ScatteringPower + // Use explicit static_cast through the concrete type to handle virtual inheritance + ScatteringPower* sp = nullptr; + try { sp = static_cast(&nb::cast(obj)); goto found; } + catch (...) {} + try { sp = &nb::cast(obj); goto found; } + catch (...) {} + throw nb::type_error("AddScatteringPower: argument must be a ScatteringPower instance"); +found: + if (!sp) throw nb::value_error("Cannot add nonexistent ScatteringPower"); + crystal.AddScatteringPower(sp); +} + +void _RemoveScatteringPower(Crystal& crystal, nb::handle obj) +{ + if (obj.is_none()) throw nb::value_error("Cannot remove nonexistent ScatteringPower"); + ScatteringPower* sp = nullptr; + try { sp = static_cast(&nb::cast(obj)); goto found; } + catch (...) {} + try { sp = &nb::cast(obj); goto found; } + catch (...) {} + throw nb::type_error("RemoveScatteringPower: argument must be a ScatteringPower instance"); +found: + if (!sp) throw nb::value_error("Cannot remove nonexistent ScatteringPower"); + crystal.RemoveScatteringPower(sp, false); +} + +nb::list _GetScatteringComponentList(Crystal& c) +{ + const ScatteringComponentList& scl = c.GetScatteringComponentList(); + nb::list l; + for (int i = 0; i < scl.GetNbComponent(); ++i) + l.append(nb::cast(scl(i))); + return l; +} + +std::string _CIF(const Crystal& c, double mindist) +{ + std::stringstream s; + c.CIFOutput(s, mindist); + return s.str(); +} + +void _CIFOutput(Crystal& c, nb::object output, double mindist) +{ + std::ostringstream os; + c.CIFOutput(os, mindist); + output.attr("write")(os.str()); +} + +void _ImportCrystalFromCIF(Crystal& cryst, nb::object input, + const bool oneScatteringPowerPerElement = false, + const bool connectAtoms = false) +{ + MuteObjCrystUserInfo muzzle; + CaptureStdOut gag; + std::string s = read_pyfile_to_string(input); + std::istringstream in(s); + ObjCryst::CIF cif(in); + const bool verbose = false; + const bool checkSymAsXYZ = true; + ObjCryst::CreateCrystalFromCIF(cif, verbose, checkSymAsXYZ, + oneScatteringPowerPerElement, connectAtoms, &cryst); +} + +Crystal* _CreateCrystalFromCIF(nb::object input, + const bool oneScatteringPowerPerElement = false, + const bool connectAtoms = false) +{ + MuteObjCrystUserInfo muzzle; + CaptureStdOut gag; + std::string s = read_pyfile_to_string(input); + std::istringstream in(s); + ObjCryst::CIF cif(in); + int idx0 = gCrystalRegistry.GetNb(); + ObjCryst::CreateCrystalFromCIF(cif, false, true, + oneScatteringPowerPerElement, connectAtoms); + gag.release(); + muzzle.release(); + if (gCrystalRegistry.GetNb() == idx0) + throw ObjCrystException("Cannot create crystal from CIF"); + ObjCryst::Crystal* c = &gCrystalRegistry.GetObj(gCrystalRegistry.GetNb() - 1); + c->SetDeleteSubObjInDestructor(false); + c->SetDeleteRefParInDestructor(false); + return c; +} + +} // namespace + +void wrap_crystal(nb::module_& m) +{ + m.attr("refpartype_crystal") = gpRefParTypeCrystal; + m.attr("gCrystalRegistry") = &gCrystalRegistry; + + nb::class_(m, "Crystal") + .def("__init__", [](Crystal* self) { new (self) Crystal(); }) + .def("__init__", [](Crystal* self, REAL a, REAL b, REAL c, + const std::string& sgId) { + new (self) Crystal(a, b, c, sgId); + self->SetDeleteSubObjInDestructor(false); + self->SetDeleteRefParInDestructor(false); + }, + nb::arg("a"), nb::arg("b"), nb::arg("c"), nb::arg("SpaceGroupId")) + .def("__init__", [](Crystal* self, REAL a, REAL b, REAL c, + REAL al, REAL be, REAL ga, + const std::string& sgId) { + new (self) Crystal(a, b, c, al, be, ga, sgId); + self->SetDeleteSubObjInDestructor(false); + self->SetDeleteRefParInDestructor(false); + }, + nb::arg("a"), nb::arg("b"), nb::arg("c"), + nb::arg("alpha"), nb::arg("beta"), nb::arg("gamma"), + nb::arg("SpaceGroupId")) + .def("AddScatterer", + [](nb::handle crystal_h, nb::handle obj) { + Crystal& crystal = nb::cast(crystal_h); + _AddScatterer(crystal, obj); + // Keep scatterer alive as long as crystal is alive (but not for None) + if (!obj.is_none()) { + nb::detail::keep_alive(crystal_h.ptr(), obj.ptr()); + } + }, nb::arg("arg").none()) + .def("RemoveScatterer", &_RemoveScatterer, nb::arg("arg").none()) + .def("GetNbScatterer", &Crystal::GetNbScatterer) + .def("GetScatt", + [](Crystal& c, const std::string& name) -> Scatterer& { + return _GetScattByName(c, name); + }, nb::rv_policy::reference_internal) + .def("GetScatt", + [](Crystal& c, int idx) -> Scatterer& { + return _GetScattByIndex(c, idx); + }, nb::rv_policy::reference_internal) + .def("GetScatterer", + [](Crystal& c, const std::string& name) -> Scatterer& { + return _GetScattByName(c, name); + }, nb::rv_policy::reference_internal) + .def("GetScatterer", + [](Crystal& c, int idx) -> Scatterer& { + return _GetScattByIndex(c, idx); + }, nb::rv_policy::reference_internal) + .def("GetScattererRegistry", + nb::overload_cast<>(&Crystal::GetScattererRegistry), + nb::rv_policy::reference_internal) + .def("GetScatteringPowerRegistry", + nb::overload_cast<>(&Crystal::GetScatteringPowerRegistry), + nb::rv_policy::reference_internal) + .def("AddScatteringPower", &_AddScatteringPower, nb::keep_alive<1,2>(), nb::arg("arg").none()) + .def("RemoveScatteringPower", &_RemoveScatteringPower, nb::arg("arg").none()) + .def("GetScatteringPower", + [](nb::handle self, const std::string& name) -> nb::object { + Crystal& c = nb::cast(self); + return wrapScatteringPowerPython(c.GetScatteringPower(name), self); + }) + .def("GetMasterClockScatteringPower", &Crystal::GetMasterClockScatteringPower, + nb::rv_policy::reference_internal) + .def("GetScatteringComponentList", &_GetScatteringComponentList) + .def("GetClockScattCompList", &Crystal::GetClockScattCompList, + nb::rv_policy::reference_internal) + .def("GetMinDistanceTable", &Crystal::GetMinDistanceTable, + nb::arg("minDistance") = 1.0) + .def("PrintMinDistanceTable", + [](const Crystal& c, double d){ c.PrintMinDistanceTable(d); }, + nb::arg("minDistance") = 1.0) + .def("ResetDynPopCorr", &Crystal::ResetDynPopCorr) + .def("SetUseDynPopCorr", &Crystal::SetUseDynPopCorr) + .def("GetUseDynPopCorr", &Crystal::GetUseDynPopCorr) + .def("GetBumpMergeCost", &Crystal::GetBumpMergeCost) + .def("SetBumpMergeDistance", + (void (Crystal::*)(const ScatteringPower&, const ScatteringPower&, const REAL)) + &Crystal::SetBumpMergeDistance, + nb::arg("scatt1"), nb::arg("scatt2"), nb::arg("dist") = 1.5) + .def("SetBumpMergeDistance", + (void (Crystal::*)(const ScatteringPower&, const ScatteringPower&, + const REAL, const bool)) + &Crystal::SetBumpMergeDistance, + nb::arg("scatt1"), nb::arg("scatt2"), nb::arg("dist"), nb::arg("allowMerge")) + .def("RemoveBumpMergeDistance", &Crystal::RemoveBumpMergeDistance) + .def("GetBumpMergeParList", + nb::overload_cast<>(&Crystal::GetBumpMergeParList), + nb::rv_policy::reference_internal) + .def("GetClockScattererList", &Crystal::GetClockScattererList, + nb::rv_policy::reference_internal) + .def("CIFOutput", &_CIFOutput, nb::arg("file"), nb::arg("mindist") = 0) + .def("CIF", &_CIF, nb::arg("mindist") = 0) + .def("AddBondValenceRo", &Crystal::AddBondValenceRo) + .def("RemoveBondValenceRo", &Crystal::AddBondValenceRo) + .def("GetBondValenceCost", &Crystal::GetBondValenceCost) + .def("GetBondValenceRoList", + nb::overload_cast<>(&Crystal::GetBondValenceRoList), + nb::rv_policy::reference_internal) + .def("ConnectAtoms", &Crystal::ConnectAtoms, + nb::arg("min_relat_dist") = 0.4, nb::arg("max_relat_dist") = 1.3, + nb::arg("warnuser_fail") = false) + .def("GetFormula", &Crystal::GetFormula) + .def("GetWeight", &Crystal::GetWeight) + .def("ImportCrystalFromCIF", &_ImportCrystalFromCIF, + nb::arg("input"), + nb::arg("oneScatteringPowerPerElement") = false, + nb::arg("connectAtoms") = false) + .def("UpdateDisplay", &Crystal::UpdateDisplay) + ; + + nb::class_(m, "BumpMergePar") + .def_rw("mDist2", &Crystal::BumpMergePar::mDist2) + .def_rw("mCanOverlap", &Crystal::BumpMergePar::mCanOverlap) + ; + + m.def("CreateCrystalFromCIF", &_CreateCrystalFromCIF, + nb::arg("file"), + nb::arg("oneScatteringPowerPerElement") = false, + nb::arg("connectAtoms") = false, + nb::rv_policy::take_ownership); +} diff --git a/src/extensions/nb_diffractiondatasinglecrystal.cpp b/src/extensions/nb_diffractiondatasinglecrystal.cpp new file mode 100644 index 00000000..18fa458b --- /dev/null +++ b/src/extensions/nb_diffractiondatasinglecrystal.cpp @@ -0,0 +1,124 @@ +/* + * pyobjcryst nanobind port — DiffractionDataSingleCrystal bindings + */ + +#include +#include + +#undef B0 +#include +#include +#include +#include + +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +namespace { + +DiffractionDataSingleCrystal* _CreateSingleCrystalDataFromCIF(nb::object input, Crystal& cryst) +{ + MuteObjCrystUserInfo muzzle; + CaptureStdOut gag; + std::string s = read_pyfile_to_string(input); + std::istringstream in(s); + ObjCryst::CIF cif(in); + int idx0 = gDiffractionDataSingleCrystalRegistry.GetNb(); + ObjCryst::DiffractionDataSingleCrystal* d = + ObjCryst::CreateSingleCrystalDataFromCIF(cif, &cryst); + gag.release(); muzzle.release(); + if (gDiffractionDataSingleCrystalRegistry.GetNb() == idx0) + throw ObjCrystException("Cannot create single crystal diffraction data from CIF"); + return d; +} + +void _setIobs(DiffractionDataSingleCrystal& diff, nb::object iobs) +{ + CrystVector_REAL ii; + assignCrystVector(ii, iobs); + if (ii.size() != diff.GetIobs().size()) + throw ObjCrystException("DiffractionDataSingleCrystal::SetIobs(): size mismatch"); + MuteObjCrystUserInfo muzzle; + diff.SetIobs(ii); +} + +void _setSigma(DiffractionDataSingleCrystal& diff, nb::object sigma) +{ + CrystVector_REAL ss; + assignCrystVector(ss, sigma); + if (ss.size() != diff.GetIobs().size()) + throw ObjCrystException("DiffractionDataSingleCrystal::SetSigma(): size mismatch"); + MuteObjCrystUserInfo muzzle; + diff.SetSigma(ss); +} + +void _setHklIobs(DiffractionDataSingleCrystal& diff, + nb::object h, nb::object k, nb::object l, + nb::object iobs, nb::object sigma) +{ + CrystVector_REAL hdbl, kdbl, ldbl; + assignCrystVector(hdbl, h); + assignCrystVector(kdbl, k); + assignCrystVector(ldbl, l); + CrystVector hh(hdbl.size()), kk(kdbl.size()), ll(ldbl.size()); + for (long i = 0; i < hdbl.size(); ++i) hh(i) = lround(hdbl(i)); + for (long i = 0; i < kdbl.size(); ++i) kk(i) = lround(kdbl(i)); + for (long i = 0; i < ldbl.size(); ++i) ll(i) = lround(ldbl(i)); + CrystVector_REAL iiobs, ssigma; + assignCrystVector(iiobs, iobs); + assignCrystVector(ssigma, sigma); + MuteObjCrystUserInfo muzzle; + diff.SetHklIobs(hh, kk, ll, iiobs, ssigma); +} + +} // namespace + +void wrap_diffractiondatasinglecrystal(nb::module_& m) +{ + m.attr("gDiffractionDataSingleCrystalRegistry") = &gDiffractionDataSingleCrystalRegistry; + + nb::class_(m, "DiffractionDataSingleCrystal") + .def(nb::init(), + nb::arg("cryst"), nb::arg("regist") = true, + nb::keep_alive<1,2>()) + .def("GetIcalc", [](DiffractionDataSingleCrystal& d){ return crystvec_to_array(d.GetIcalc()); }) + .def("GetIobs", [](DiffractionDataSingleCrystal& d){ return crystvec_to_array(d.GetIobs()); }) + .def("GetSigma", [](DiffractionDataSingleCrystal& d){ return crystvec_to_array(d.GetSigma()); }) + .def("SetIobs", &_setIobs, nb::arg("iobs")) + .def("SetSigma", &_setSigma, nb::arg("sigma")) + .def("SetHklIobs",&_setHklIobs, + nb::arg("h"), nb::arg("k"), nb::arg("l"), nb::arg("iobs"), nb::arg("sigma")) + .def("SetIobsToIcalc", &DiffractionDataSingleCrystal::SetIobsToIcalc) + .def("GetRw", &DiffractionDataSingleCrystal::GetRw) + .def("GetR", &DiffractionDataSingleCrystal::GetR) + .def("GetChi2",&DiffractionDataSingleCrystal::GetChi2) + .def("FitScaleFactorForRw", &DiffractionDataSingleCrystal::FitScaleFactorForRw) + .def("FitScaleFactorForR", &DiffractionDataSingleCrystal::FitScaleFactorForR) + .def("PrintObsData", &DiffractionDataSingleCrystal::PrintObsData) + .def("PrintObsCalcData", &DiffractionDataSingleCrystal::PrintObsCalcData) + .def("SetUseOnlyLowAngleData",&DiffractionDataSingleCrystal::SetUseOnlyLowAngleData) + .def("SaveHKLIobsIcalc", &DiffractionDataSingleCrystal::SaveHKLIobsIcalc) + .def("GetLogLikelihood", &DiffractionDataSingleCrystal::GetLogLikelihood) + .def("ImportHklIobs", &DiffractionDataSingleCrystal::ImportHklIobs, + nb::arg("fileName"), nb::arg("nbRefl"), nb::arg("skipLines") = 0) + .def("ImportHklIobsSigma", &DiffractionDataSingleCrystal::ImportHklIobsSigma, + nb::arg("fileName"), nb::arg("nbRefl"), nb::arg("skipLines") = 0) + .def("ImportShelxHKLF4", &DiffractionDataSingleCrystal::ImportShelxHKLF4) + .def("ImportCIF", &DiffractionDataSingleCrystal::ImportCIF) + .def("SetWavelength", + nb::overload_cast(&DiffractionDataSingleCrystal::SetWavelength), + nb::arg("wavelength")) + .def("SetWavelength", + nb::overload_cast( + &DiffractionDataSingleCrystal::SetWavelength), + nb::arg("XRayTubeElementName"), nb::arg("alpha2Alpha2ratio") = 0.5) + .def("SetEnergy", &DiffractionDataSingleCrystal::SetEnergy, nb::arg("nrj_kev")) + ; + + m.def("CreateSingleCrystalDataFromCIF", &_CreateSingleCrystalDataFromCIF, + nb::arg("file"), nb::arg("crystal"), + nb::keep_alive<0,2>(), + nb::rv_policy::take_ownership); +} diff --git a/src/extensions/nb_general.cpp b/src/extensions/nb_general.cpp new file mode 100644 index 00000000..fb01e1bc --- /dev/null +++ b/src/extensions/nb_general.cpp @@ -0,0 +1,90 @@ +/* + * pyobjcryst nanobind port — general bindings + * Wraps RadiationType, WavelengthType enums and libobjcryst version info + */ + +#include +#include +#include + +#include +#include +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +namespace { + +// getTestVector/getTestMatrix -- ported from the legacy Boost.Python +// registerconverters.cpp (`def("getTestVector", ...)` / `def("getTestMatrix", +// ...)`). Exercised only by tests/test_converters.py, which verifies the +// CrystVector<->ndarray / CrystMatrix<->ndarray conversion path via a known +// fixed result, independent of any real ObjCryst++ computation. Uses +// CrystVector_REAL/CrystMatrix_REAL (not a hardcoded ) and the shared +// crystvec_to_array/crystmat_to_array helpers, per this project's REAL-macro +// convention (see helpers_nb.hpp). +nb_array_1d getTestVector() +{ + // Should produce [0, 1, 2] + CrystVector_REAL tv(3); + for (int i = 0; i < 3; ++i) tv(i) = i; + return crystvec_to_array(tv); +} + +nb_array_2d getTestMatrix() +{ + // Should produce [[0, 1], [2, 3], [4, 5]] + CrystMatrix_REAL tm(3, 2); + int counter = 0; + for (int i = 0; i < 3; ++i) + for (int j = 0; j < 2; ++j) + tm(i, j) = counter++; + return crystmat_to_array(tm); +} + +nb::dict get_libobjcryst_version_info_dict() +{ + nb::dict rv; + rv["version"] = libobjcryst_version_info::version; + rv["version_str"] = std::string(libobjcryst_version_info::version_str); + rv["major"] = libobjcryst_version_info::major; + rv["minor"] = libobjcryst_version_info::minor; + rv["micro"] = libobjcryst_version_info::micro; + rv["date"] = std::string(libobjcryst_version_info::date); + rv["git_commit"] = std::string(libobjcryst_version_info::git_commit); + rv["patch"] = libobjcryst_version_info::patch; + return rv; +} + +} // namespace + +void wrap_general(nb::module_& m) +{ + nb::enum_(m, "RadiationType") + .value("RAD_NEUTRON", RAD_NEUTRON) + .value("RAD_XRAY", RAD_XRAY) + .value("RAD_ELECTRON", RAD_ELECTRON) + .export_values() + ; + + nb::enum_(m, "WavelengthType") + .value("WAVELENGTH_MONOCHROMATIC", WAVELENGTH_MONOCHROMATIC) + .value("WAVELENGTH_ALPHA12", WAVELENGTH_ALPHA12) + .value("WAVELENGTH_TOF", WAVELENGTH_TOF) + .export_values() + ; + + m.def("_get_libobjcryst_version_info_dict", &get_libobjcryst_version_info_dict, + "Return dictionary with version data for the loaded libobjcryst library."); + + // Diagnostic test for nb::object + None + m.def("_test_handle_none", [](nb::object x) -> bool { + return x.is_none(); + }, nb::arg("x") = nb::none()); + + // Used only by tests/test_converters.py -- see the comment at the + // definitions above. + m.def("getTestVector", &getTestVector); + m.def("getTestMatrix", &getTestMatrix); +} diff --git a/src/extensions/nb_globaloptim.cpp b/src/extensions/nb_globaloptim.cpp new file mode 100644 index 00000000..dcfff0fb --- /dev/null +++ b/src/extensions/nb_globaloptim.cpp @@ -0,0 +1,168 @@ +/* + * pyobjcryst nanobind port — GlobalOptimObj / MonteCarloObj bindings + */ + +#include +#include +#include + +#include + +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +struct PyMonteCarloObj : MonteCarloObj { + NB_TRAMPOLINE(MonteCarloObj, 1); + void UpdateDisplay() const override { NB_OVERRIDE(UpdateDisplay); MonteCarloObj::UpdateDisplay(); } +}; + +namespace { + +void run_optimize(MonteCarloObj& obj, long nbSteps, const bool silent, + const double finalcost, const double maxTime) +{ + CaptureStdOut gag; + obj.Optimize(nbSteps, silent, finalcost, maxTime); +} + +// MonteCarloObj::AddRefinableObj(RefinableObj&) generically accepts "any +// RefinableObj" -- see the extractRefinableObjArg comment in helpers_nb.hpp +// for why a plain `&MonteCarloObj::AddRefinableObj` binding fails for +// virtually-linked concrete types (e.g. DiffractionDataSingleCrystal). +void _AddRefinableObj(MonteCarloObj& mc, nb::object obj) +{ + mc.AddRefinableObj(extractRefinableObjArg(obj)); +} + +void multirun_optimize(MonteCarloObj& obj, long nbCycle, long nbSteps, + const bool silent, const double finalcost, const double maxTime) +{ + CaptureStdOut gag; + obj.MultiRunOptimize(nbCycle, nbSteps, silent, finalcost, maxTime); +} + +void mc_sa(MonteCarloObj& obj, long nbSteps, const bool silent, + const double finalcost, const double maxTime) +{ + CaptureStdOut gag; + obj.RunSimulatedAnnealing(nbSteps, silent, finalcost, maxTime); +} + +void mc_pt(MonteCarloObj& obj, long nbSteps, const bool silent, + const double finalcost, const double maxTime) +{ + CaptureStdOut gag; + obj.RunParallelTempering(nbSteps, silent, finalcost, maxTime); +} + +} // namespace + +void wrap_globaloptim(nb::module_& m) +{ + m.attr("gOptimizationObjRegistry") = &gOptimizationObjRegistry; + + nb::enum_(m, "AnnealingSchedule") + .value("CONSTANT", ANNEALING_CONSTANT) + .value("BOLTZMANN", ANNEALING_BOLTZMANN) + .value("CAUCHY", ANNEALING_CAUCHY) + .value("EXPONENTIAL", ANNEALING_EXPONENTIAL) + .value("SMART", ANNEALING_SMART) + .value("GAMMA", ANNEALING_GAMMA) + .export_values() + ; + + nb::enum_(m, "GlobalOptimType") + .value("SIMULATED_ANNEALING", GLOBAL_OPTIM_SIMULATED_ANNEALING) + .value("PARALLEL_TEMPERING", GLOBAL_OPTIM_PARALLEL_TEMPERING) + .value("RANDOM_LSQ", GLOBAL_OPTIM_RANDOM_LSQ) + .value("SIMULATED_ANNEALING_MULTI", GLOBAL_OPTIM_SIMULATED_ANNEALING_MULTI) + .value("PARALLEL_TEMPERING_MULTI", GLOBAL_OPTIM_PARALLEL_TEMPERING_MULTI) + .export_values() + ; + + nb::class_(m, "MonteCarlo") + .def(nb::init<>()) + .def(nb::init(), nb::arg("name")) + .def("RandomizeStartingConfig", &MonteCarloObj::RandomizeStartingConfig) + .def("Optimize", &run_optimize, + nb::arg("nbSteps"), nb::arg("silent") = false, + nb::arg("finalcost") = 0.0, nb::arg("maxTime") = -1.0) + .def("MultiRunOptimize", &multirun_optimize, + nb::arg("nbCycle"), nb::arg("nbSteps"), nb::arg("silent") = false, + nb::arg("finalcost") = 0.0, nb::arg("maxTime") = -1.0) + .def("FixAllPar", &MonteCarloObj::FixAllPar) + .def("SetParIsFixed", + nb::overload_cast(&MonteCarloObj::SetParIsFixed)) + .def("SetParIsFixed", + nb::overload_cast(&MonteCarloObj::SetParIsFixed)) + .def("UnFixAllPar", &MonteCarloObj::UnFixAllPar) + .def("SetParIsUsed", + nb::overload_cast(&MonteCarloObj::SetParIsUsed)) + .def("SetParIsUsed", + nb::overload_cast(&MonteCarloObj::SetParIsUsed)) + .def("SetLimitsRelative", + nb::overload_cast( + &MonteCarloObj::SetLimitsRelative)) + .def("SetLimitsRelative", + nb::overload_cast( + &MonteCarloObj::SetLimitsRelative)) + .def("SetLimitsAbsolute", + nb::overload_cast( + &MonteCarloObj::SetLimitsAbsolute)) + .def("SetLimitsAbsolute", + nb::overload_cast( + &MonteCarloObj::SetLimitsAbsolute)) + .def("GetLogLikelihood", &MonteCarloObj::GetLogLikelihood) + .def("StopAfterCycle", &MonteCarloObj::StopAfterCycle) + .def("AddRefinableObj", &_AddRefinableObj, + nb::arg("obj"), nb::keep_alive<1,2>()) + .def("GetFullRefinableObj", &MonteCarloObj::GetFullRefinableObj, + nb::arg("rebuild") = true, nb::rv_policy::reference_internal) + .def("GetName", &MonteCarloObj::GetName) + .def("SetName", &MonteCarloObj::SetName) + .def("GetClassName", &MonteCarloObj::GetClassName) + .def("Print", &MonteCarloObj::Print) + .def("RestoreBestConfiguration", &MonteCarloObj::RestoreBestConfiguration) + .def("GetNbParamSet", &MonteCarloObj::GetNbParamSet) + .def("GetParamSetIndex", &MonteCarloObj::GetParamSetIndex) + .def("GetParamSetCost", &MonteCarloObj::GetParamSetCost) + .def("RestoreParamSet", &MonteCarloObj::RestoreParamSet, + nb::arg("idx"), nb::arg("update_display") = true) + .def("IsOptimizing", &MonteCarloObj::IsOptimizing) + .def("GetLastOptimElapsedTime", &MonteCarloObj::GetLastOptimElapsedTime) + .def("GetNbOption", &MonteCarloObj::GetNbOption) + .def("GetOption", + nb::overload_cast(&MonteCarloObj::GetOption), + nb::rv_policy::reference_internal) + .def("GetOption", + nb::overload_cast(&MonteCarloObj::GetOption), + nb::rv_policy::reference_internal) + .def_prop_ro("trial", &MonteCarloObj::GetTrial) + .def_prop_ro("run", &MonteCarloObj::GetRun) + .def_prop_ro("llk", &MonteCarloObj::GetLogLikelihood) + .def("SetAlgorithmParallTempering", + &MonteCarloObj::SetAlgorithmParallTempering, + nb::arg("scheduleTemp"), nb::arg("tMax"), nb::arg("tMin"), + nb::arg("scheduleMutation") = ANNEALING_SMART, + nb::arg("mutMax") = 16.0, nb::arg("mutMin") = 0.125) + .def("SetAlgorithmSimulAnnealing", + &MonteCarloObj::SetAlgorithmSimulAnnealing, + nb::arg("scheduleTemp"), nb::arg("tMax"), nb::arg("tMin"), + nb::arg("scheduleMutation") = ANNEALING_SMART, + nb::arg("mutMax") = 16.0, nb::arg("mutMin") = 0.125, + nb::arg("nbTrialRetry") = 0, nb::arg("minCostRetry") = 0.) + .def("RunSimulatedAnnealing", &mc_sa, + nb::arg("nbSteps"), nb::arg("silent") = false, + nb::arg("finalcost") = 0.0, nb::arg("maxTime") = -1.0) + .def("RunParallelTempering", &mc_pt, + nb::arg("nbSteps"), nb::arg("silent") = false, + nb::arg("finalcost") = 0.0, nb::arg("maxTime") = -1.0) + .def("GetLSQObj", + nb::overload_cast<>(&MonteCarloObj::GetLSQObj), + nb::rv_policy::reference_internal) + .def("InitLSQ", &MonteCarloObj::InitLSQ, + nb::arg("useFullPowderPatternProfile") = true) + ; +} diff --git a/src/extensions/nb_globalscatteringpower.cpp b/src/extensions/nb_globalscatteringpower.cpp new file mode 100644 index 00000000..22e08c4c --- /dev/null +++ b/src/extensions/nb_globalscatteringpower.cpp @@ -0,0 +1,34 @@ +/* + * pyobjcryst nanobind port — GlobalScatteringPower bindings + */ + +#include +#include + +#include +#include +#include + +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +void wrap_globalscatteringpower(nb::module_& m) +{ + nb::class_ cls(m, "GlobalScatteringPower", nb::is_final()); + cls + .def(nb::init<>()) + .def(nb::init()) + .def(nb::init()) + .def("Init", nb::overload_cast(&GlobalScatteringPower::Init)) + .def("GetRadius", &GlobalScatteringPower::GetRadius) + ; + + // GlobalScatteringPower inherits ScatteringPower virtually (like + // ScatteringPowerAtom) -- neither ScatteringPower's own method surface + // nor RefinableObj's is reachable via nanobind inheritance, so forward + // both directly. See nb_scatteringpoweratom.cpp / helpers_nb.hpp. + bind_scatteringpower_forwarding(cls); + bind_refinableobj_forwarding(cls); +} diff --git a/src/extensions/nb_indexing.cpp b/src/extensions/nb_indexing.cpp new file mode 100644 index 00000000..e06ace54 --- /dev/null +++ b/src/extensions/nb_indexing.cpp @@ -0,0 +1,385 @@ +#include +#include +#include + +#include +#include +#include + +#undef B0 +#include +#include +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +#ifndef M_PI +#define M_PI 3.14159265358979323846264338327950288 +#endif +#define RAD2DEG (180./M_PI) + +namespace { + +// RecUnitCell::hkl2d takes a raw `REAL *derivpar` output parameter. nanobind's +// automatic None<->nullptr pointer bridging (as used elsewhere in this codebase, +// e.g. Crystal.AddScatterer's Scatterer* argument) only works for pointers to a +// type registered via nb::class_<...> -- there is no such bridging for a pointer +// to a plain arithmetic type like REAL/double, so binding +// `&RecUnitCell::hkl2d` directly rejects an explicit `derivpar=None` from Python +// with "incompatible function arguments", even though None is exactly what a +// Python caller must pass (a Python float is immutable, so there is no way for +// the derivative to be written back to it regardless of binding technology -- +// this matches the pre-existing Boost.Python behavor, where derivpar was only +// ever meaningfully used from within C++ itself, e.g. LSQ fitting internals). +// Fixed by taking derivpar as nb::object and manually bridging None -> nullptr. +float _hkl2d(const RecUnitCell& r, const float h, const float k, const float l, + nb::object derivpar, const unsigned int derivhkl) +{ + if (derivpar.is_none()) + return r.hkl2d(h, k, l, nullptr, derivhkl); + REAL d = 0; + return r.hkl2d(h, k, l, &d, derivhkl); +} + +nb::tuple _direct_unit_cell(const RecUnitCell& r, const bool equiv, const bool degrees=false) +{ + const std::vector& v = r.DirectUnitCell(equiv); + if (degrees) + return nb::make_tuple(v[0], v[1], v[2], v[3]*RAD2DEG, v[4]*RAD2DEG, v[5]*RAD2DEG, v[6]); + return nb::make_tuple(v[0], v[1], v[2], v[3], v[4], v[5], v[6]); +} + +nb::list _vDicVolHKL(const PeakList::hkl& h) +{ + nb::list l; + for (const auto& hkl0 : h.vDicVolHKL) + l.append(hkl0); + return l; +} + +std::string __str__RecUnitCell(RecUnitCell& ruc) +{ + const char* sys_names[] = {"TRICLINIC","MONOCLINIC","ORTHORHOMBIC","HEXAGONAL","RHOMBOEDRAL","TETRAGONAL","CUBIC"}; + const char cent_chars[] = "PIABCF"; + std::vector d = ruc.DirectUnitCell(); + std::ostringstream oss; + if (ruc.mNbSpurious > 0) + oss << d[0] << " " << d[1] << " " << d[2] + << " " << d[3]*RAD2DEG << " " << d[4]*RAD2DEG << " " << d[5]*RAD2DEG + << " V=" << d[6] << " " << sys_names[(int)ruc.mlattice] + << " " << cent_chars[(int)ruc.mCentering] + << " (" << ruc.mNbSpurious << " SPURIOUS)"; + else + oss << d[0] << " " << d[1] << " " << d[2] + << " " << d[3]*RAD2DEG << " " << d[4]*RAD2DEG << " " << d[5]*RAD2DEG + << " V=" << d[6] << " " << sys_names[(int)ruc.mlattice] + << " " << cent_chars[(int)ruc.mCentering]; + return oss.str(); +} + +std::string __str__hkl0(PeakList::hkl0& hkl) +{ + std::ostringstream oss; + oss << "(" << hkl.h << " " << hkl.k << " " << hkl.l << ")"; + return oss.str(); +} + +std::string __str__hkl(PeakList::hkl& hkl) +{ + std::ostringstream oss; + if (hkl.isIndexed) + oss << "Peak dobs=" << hkl.dobs << "+/-" << hkl.dobssigma + << " iobs=" << hkl.iobs + << " (" << hkl.h << " " << hkl.k << " " << hkl.l << ")"; + else + oss << "Peak dobs=" << hkl.dobs << "+/-" << hkl.dobssigma + << " iobs=" << hkl.iobs << " (? ? ?)"; + return oss.str(); +} + +void _DicVolGag(CellExplorer& ex, const float minScore, const unsigned int minDepth, + const float stopOnScore, const unsigned int stopOnDepth, const bool verbose=true) +{ + CaptureStdOut gag; + if (verbose) gag.release(); + ex.DicVol(minScore, minDepth, stopOnScore, stopOnDepth); +} + +nb::list _GetSolutions(CellExplorer& ex) +{ + nb::list l; + for (const auto& p : ex.GetSolutions()) + l.append(nb::make_tuple(nb::cast(p.first), p.second)); + return l; +} + +struct PeakListNB : PeakList { + PeakListNB() : PeakList() {} + PeakListNB(const PeakList& p) : PeakList(p) {} + + void nb_ImportDhklDSigmaIntensity(nb::object input, const float defaultsigma) + { + CaptureStdOut gag; + if (nb::isinstance(input)) { + std::string path = nb::cast(input); + std::ifstream is(path); + this->PeakList::ImportDhklDSigmaIntensity(is, defaultsigma); + } else { + std::string s = read_pyfile_to_string(input); + std::istringstream is(s); + this->PeakList::ImportDhklDSigmaIntensity(is, defaultsigma); + } + } + + void nb_ImportDhklIntensity(nb::object input) + { + CaptureStdOut gag; + if (nb::isinstance(input)) { + std::string path = nb::cast(input); + std::ifstream is(path); + this->PeakList::ImportDhklIntensity(is); + } else { + std::string s = read_pyfile_to_string(input); + std::istringstream is(s); + this->PeakList::ImportDhklIntensity(is); + } + } + + void nb_ImportDhkl(nb::object input) + { + CaptureStdOut gag; + if (nb::isinstance(input)) { + std::string path = nb::cast(input); + std::ifstream is(path); + this->PeakList::ImportDhkl(is); + } else { + std::string s = read_pyfile_to_string(input); + std::istringstream is(s); + this->PeakList::ImportDhkl(is); + } + } + + void nb_Import2ThetaIntensity(nb::object input, const float wavelength) + { + CaptureStdOut gag; + if (nb::isinstance(input)) { + std::string path = nb::cast(input); + std::ifstream is(path); + this->PeakList::Import2ThetaIntensity(is, wavelength); + } else { + std::string s = read_pyfile_to_string(input); + std::istringstream is(s); + this->PeakList::Import2ThetaIntensity(is, wavelength); + } + } + + void nb_ExportDhklDSigmaIntensity(nb::object output) + { + if (nb::isinstance(output)) { + std::string path = nb::cast(output); + std::ofstream out(path); + this->PeakList::ExportDhklDSigmaIntensity(out); + } else { + std::ostringstream oss; + this->PeakList::ExportDhklDSigmaIntensity(oss); + output.attr("write")(oss.str()); + } + } + + void set_dobs_list(nb::list& l) + { + this->GetPeakList().clear(); + for (auto h : l) + this->AddPeak(nb::cast(h)); + } + + unsigned int Length() const { return (unsigned int)this->GetPeakList().size(); } + + nb::list getPeakList() + { + nb::list l; + for (const auto& hkl : this->GetPeakList()) + l.append(hkl); + return l; + } +}; + +} // namespace + +// External-linkage wrapper declared in helpers_nb.hpp -- see the comment +// there. Must live outside the anonymous namespace above (which is where +// PeakListNB itself is defined) so other translation units can call it. +nb::object wrap_peaklist(const PeakList& pl) +{ + return nb::cast(PeakListNB(pl)); +} + +void wrap_indexing(nb::module_& m) +{ + nb::enum_(m, "CrystalSystem") + .value("TRICLINIC", TRICLINIC) + .value("MONOCLINIC", MONOCLINIC) + // Ported forward from upstream main (spelling fix, pre-commit + // auto-fix commit): the C++ enum is (and always was) ORTHORHOMBIC -- + // ORTHOROMBIC was a Python-binding-only misspelling. Keep both + // names bound to the same value for backward compatibility. + .value("ORTHORHOMBIC", ORTHORHOMBIC) + .value("ORTHOROMBIC", ORTHORHOMBIC) + .value("HEXAGONAL", HEXAGONAL) + .value("RHOMBOEDRAL", RHOMBOEDRAL) + .value("TETRAGONAL", TETRAGONAL) + .value("CUBIC", CUBIC) + .export_values() + ; + + nb::enum_(m, "CrystalCentering") + .value("LATTICE_P", LATTICE_P) + .value("LATTICE_I", LATTICE_I) + .value("LATTICE_A", LATTICE_A) + .value("LATTICE_B", LATTICE_B) + .value("LATTICE_C", LATTICE_C) + .value("LATTICE_F", LATTICE_F) + .export_values() + ; + + m.def("EstimateCellVolume", &EstimateCellVolume, + nb::arg("dmin"), nb::arg("dmax"), nb::arg("nbrefl"), + nb::arg("system"), nb::arg("centering"), nb::arg("kappa") = 1.f); + + nb::class_(m, "RecUnitCell") + .def(nb::init(), + nb::arg("zero") = 0.f, nb::arg("par0") = 0.f, nb::arg("par1") = 0.f, + nb::arg("par2") = 0.f, nb::arg("par3") = 0.f, nb::arg("par4") = 0.f, + nb::arg("par5") = 0.f, nb::arg("lattice") = CUBIC, + nb::arg("cent") = LATTICE_P, nb::arg("nbspurious") = 0u) + .def(nb::init(), nb::arg("old")) + .def("hkl2d", &_hkl2d, + nb::arg("h"), nb::arg("k"), nb::arg("l"), + nb::arg("derivpar") = nb::none(), nb::arg("derivhkl") = 0) + .def("DirectUnitCell", &_direct_unit_cell, + nb::arg("equiv") = false, nb::arg("degrees") = false) + .def_ro("mlattice", &RecUnitCell::mlattice) + .def_ro("lattice", &RecUnitCell::mlattice) + .def_ro("mCentering", &RecUnitCell::mCentering) + .def_ro("centering", &RecUnitCell::mCentering) + .def_ro("nb_spurious", &RecUnitCell::mNbSpurious) + .def_ro("mNbSpurious", &RecUnitCell::mNbSpurious) + .def("__str__", &__str__RecUnitCell) + .def("__repr__", &__str__RecUnitCell) + ; + + nb::class_(m, "PeakList_hkl0") + .def(nb::init(), + nb::arg("h") = 0, nb::arg("k") = 0, nb::arg("l") = 0) + .def_ro("h", &PeakList::hkl0::h) + .def_ro("k", &PeakList::hkl0::k) + .def_ro("l", &PeakList::hkl0::l) + .def("__str__", &__str__hkl0) + .def("__repr__", &__str__hkl0) + ; + + nb::class_(m, "PeakList_hkl") + .def(nb::init(), + nb::arg("dobs") = 1.0f, nb::arg("iobs") = 0.f, + nb::arg("dobssigma") = 0.f, nb::arg("iobssigma") = 0.f, + nb::arg("h") = 0, nb::arg("k") = 0, nb::arg("l") = 0, + nb::arg("d2calc") = 0.f) + .def_ro("dobs", &PeakList::hkl::dobs) + .def_ro("dobssigma", &PeakList::hkl::dobssigma) + .def_ro("d2obs", &PeakList::hkl::d2obs) + .def_ro("d2obsmin", &PeakList::hkl::d2obsmin) + .def_ro("d2obsmax", &PeakList::hkl::d2obsmax) + .def_ro("iobs", &PeakList::hkl::iobs) + .def_ro("iobssigma", &PeakList::hkl::iobssigma) + .def_ro("h", &PeakList::hkl::h) + .def_ro("k", &PeakList::hkl::k) + .def_ro("l", &PeakList::hkl::l) + .def_ro("isIndexed", &PeakList::hkl::isIndexed) + .def_prop_ro("vDicVolHKL", &_vDicVolHKL) + .def_ro("isSpurious",&PeakList::hkl::isSpurious) + .def_ro("stats", &PeakList::hkl::stats) + .def_ro("d2calc", &PeakList::hkl::d2calc) + .def_ro("d2diff", &PeakList::hkl::d2diff) + .def("__str__", &__str__hkl) + .def("__repr__", &__str__hkl) + ; + + // PeakListNB : public PeakList is plain (non-virtual) inheritance -- + // perfectly safe to declare as a nanobind base (unlike the virtual- + // inheritance cases in §1 of nanobind_migration_notes.md) -- but it was + // previously registered with NO declared base at all + // (`nb::class_(m, "PeakList")`), which meant nanobind had no + // known relationship between the two types. That broke + // `CellExplorer(pl, ...)` (nb::init()): passing a + // Python "PeakList" (i.e. a PeakListNB instance, e.g. from + // PowderPattern.FindPeaks()) failed to convert to `const PeakList&` + // with a generic "incompatible function arguments" error. `PeakList` + // itself has no other nanobind bindings of its own (nothing but + // PeakListNB is ever exposed to Python), so it is registered here under + // an internal name purely so the base relationship can be declared. + nb::class_(m, "_PeakListBase"); + + nb::class_(m, "PeakList") + .def(nb::init<>()) + .def(nb::init()) + .def("ImportDhklDSigmaIntensity", &PeakListNB::nb_ImportDhklDSigmaIntensity, + nb::arg("file"), nb::arg("defaultsigma") = 0.001f) + .def("ImportDhklIntensity", &PeakListNB::nb_ImportDhklIntensity, nb::arg("file")) + .def("ImportDhkl", &PeakListNB::nb_ImportDhkl, nb::arg("file")) + .def("Import2ThetaIntensity", &PeakListNB::nb_Import2ThetaIntensity, + nb::arg("file"), nb::arg("wavelength")) + .def("ExportDhklDSigmaIntensity", &PeakListNB::nb_ExportDhklDSigmaIntensity, nb::arg("file")) + .def("Simulate", &PeakList::Simulate, + nb::arg("zero"), nb::arg("a"), nb::arg("b"), nb::arg("c"), + nb::arg("alpha"), nb::arg("beta"), nb::arg("gamma"), nb::arg("deg"), + nb::arg("nb") = 20, nb::arg("nbspurious") = 0, nb::arg("sigma") = 0.f, + nb::arg("percentMissing") = 0.f, nb::arg("verbose") = false, + // "merge" is new in the vendored ObjCryst++ core since this + // binding was originally written (not present when the old + // migration branch's submodule was pinned) -- merges observed + // lines with near-identical d-spacing before picking the + // largest nb lines. Default false preserves old behavior. + nb::arg("merge") = false) + .def("GetPeakList", &PeakListNB::getPeakList) + .def("resize", [](PeakListNB& pl, unsigned int nb){ pl.GetPeakList().resize(nb); }, + nb::arg("nb") = 20) + .def("clear", [](PeakListNB& pl){ pl.GetPeakList().clear(); }) + .def("set_dobs_list", &PeakListNB::set_dobs_list, nb::arg("dobs")) + .def("__len__", &PeakListNB::Length) + .def("__iter__", [](PeakListNB& pl){ + auto& v = pl.GetPeakList(); + return nb::make_iterator(nb::type(), "peak_iter", v.begin(), v.end()); + }, nb::keep_alive<0,1>()) + ; + + nb::class_(m, "CellExplorer") + .def(nb::init(), + nb::arg("dhkl"), nb::arg("lattice"), nb::arg("nbSpurious") = 0u, + nb::keep_alive<1,2>()) + .def("SetLengthMinMax", &CellExplorer::SetLengthMinMax) + .def("SetAngleMinMax", &CellExplorer::SetAngleMinMax) + .def("SetVolumeMinMax", &CellExplorer::SetVolumeMinMax) + .def("SetNbSpurious", &CellExplorer::SetNbSpurious) + .def("SetD2Error", &CellExplorer::SetD2Error) + .def("SetMinMaxZeroShift", &CellExplorer::SetMinMaxZeroShift) + .def("SetCrystalSystem", &CellExplorer::SetCrystalSystem) + .def("SetCrystalCentering",&CellExplorer::SetCrystalCentering) + .def("Print", &CellExplorer::Print) + .def("DicVol", &_DicVolGag, + nb::arg("minScore") = 10.f, nb::arg("minDepth") = 10u, + nb::arg("stopOnScore") = 50.f, nb::arg("stopOnDepth") = 6u, + nb::arg("verbose") = true) + .def("ReduceSolutions", &CellExplorer::ReduceSolutions, + nb::arg("updateReportThreshold") = false) + .def("GetBestScore", &CellExplorer::GetBestScore) + .def("GetSolutions", &_GetSolutions) + .def("__iter__", [](CellExplorer& ex){ + auto& v = ex.GetSolutions(); + return nb::make_iterator(nb::type(), "sol_iter", v.begin(), v.end()); + }, nb::keep_alive<0,1>()) + ; +} diff --git a/src/extensions/nb_io.cpp b/src/extensions/nb_io.cpp new file mode 100644 index 00000000..41f79e69 --- /dev/null +++ b/src/extensions/nb_io.cpp @@ -0,0 +1,69 @@ +/* + * pyobjcryst nanobind port — IO bindings (XMLCrystTag, XMLCrystFile*) + */ + +#include +#include + +#include +#include + +#include +#include + +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +namespace { + +void _XMLCrystFileLoadAllObject(nb::object input, const bool verbose = false) +{ + MuteObjCrystUserInfo muzzle; + CaptureStdOut gag; + if (verbose) { + gag.release(); + muzzle.release(); + } + std::string s = read_pyfile_to_string(input); + std::istringstream in(s); + XMLCrystFileLoadAllObject(in); +} + +void _XMLCrystFileSaveGlobal(nb::object output) +{ + std::ostringstream out; + XMLCrystFileSaveGlobal(out); + output.attr("write")(out.str()); +} + +} // namespace + +void wrap_io(nb::module_& m) +{ + nb::class_(m, "XMLCrystTag") + .def(nb::init(), + nb::arg("tagName"), nb::arg("isEndTag") = false, nb::arg("isEmptyTag") = false) + .def("GetName", &XMLCrystTag::GetName) + .def("GetClassName", &XMLCrystTag::GetClassName) + .def("GetNbAttribute", &XMLCrystTag::GetNbAttribute) + .def("AddAttribute", &XMLCrystTag::AddAttribute, + nb::arg("attName"), nb::arg("attValue")) + .def("GetAttribute", &XMLCrystTag::GetAttribute, + nb::arg("attNum"), nb::arg("attName"), nb::arg("attValue")) + .def("GetAttributeName", &XMLCrystTag::GetAttributeName) + .def("GetAttributeValue",&XMLCrystTag::GetAttributeValue) + .def("SetIsEndTag", &XMLCrystTag::SetIsEndTag) + .def("IsEndTag", &XMLCrystTag::IsEndTag) + .def("SetIsEmptyTag", &XMLCrystTag::SetIsEmptyTag) + .def("IsEmptyTag", &XMLCrystTag::IsEmptyTag) + .def("Print", &XMLCrystTag::Print) + .def("__str__", [](const XMLCrystTag& t){ return obj_str(t); }) + ; + + m.def("XMLCrystFileLoadAllObject", &_XMLCrystFileLoadAllObject, + nb::arg("file"), nb::arg("verbose") = false); + m.def("XMLCrystFileSaveGlobal", &_XMLCrystFileSaveGlobal, + nb::arg("file")); +} diff --git a/src/extensions/nb_lsq.cpp b/src/extensions/nb_lsq.cpp new file mode 100644 index 00000000..84182a65 --- /dev/null +++ b/src/extensions/nb_lsq.cpp @@ -0,0 +1,97 @@ +/* + * pyobjcryst nanobind port — LSQNumObj bindings + */ + +#include +#include + +#include +#include + +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +namespace { + +bool _SafeRefine(LSQNumObj& lsq, REAL maxChi2factor, int nbCycle, + bool useLevenbergMarquardt, const bool silent, + const bool callBeginEndOptimization, const float minChi2var) +{ + CaptureStdOut gag; + if (!silent) gag.release(); + std::list vnewpar; + std::list vnewpartype; + return lsq.SafeRefine(vnewpar, vnewpartype, nbCycle, useLevenbergMarquardt, + silent, callBeginEndOptimization, minChi2var); +} + +// LSQNumObj::SetRefinedObj(RefinableObj&, ...) generically accepts "any +// RefinableObj" -- see the extractRefinableObjArg comment in helpers_nb.hpp +// for why a plain `&LSQNumObj::SetRefinedObj` binding fails for +// virtually-linked concrete types (e.g. DiffractionDataSingleCrystal). +void _SetRefinedObj(LSQNumObj& lsq, nb::object obj, + const unsigned int LSQFuncIndex, const bool init, + const bool recursive) +{ + lsq.SetRefinedObj(extractRefinableObjArg(obj), LSQFuncIndex, init, recursive); +} + +} // namespace + +void wrap_lsq(nb::module_& m) +{ + nb::class_(m, "LSQ") + .def(nb::init<>()) + .def("SetParIsFixed", + nb::overload_cast(&LSQNumObj::SetParIsFixed), + nb::arg("parName"), nb::arg("fix")) + .def("SetParIsFixed", + nb::overload_cast(&LSQNumObj::SetParIsFixed), + nb::arg("type"), nb::arg("fix")) + .def("SetParIsFixed", + nb::overload_cast(&LSQNumObj::SetParIsFixed), + nb::arg("par"), nb::arg("fix")) + .def("UnFixAllPar", &LSQNumObj::UnFixAllPar) + .def("Refine", &LSQNumObj::Refine, + nb::arg("nbCycle") = 1, + nb::arg("useLevenbergMarquardt") = false, + nb::arg("silent") = false, + nb::arg("callBeginEndOptimization") = true, + nb::arg("minChi2var") = 0.01f) + .def("SafeRefine", &_SafeRefine, + nb::arg("maxChi2factor") = 1.01, + nb::arg("nbCycle") = 1, + nb::arg("useLevenbergMarquardt") = false, + nb::arg("silent") = false, + nb::arg("callBeginEndOptimization") = true, + nb::arg("minChi2var") = 0.01f) + .def("Rfactor", &LSQNumObj::Rfactor) + .def("RwFactor", &LSQNumObj::RwFactor) + .def("ChiSquare", &LSQNumObj::ChiSquare) + .def("SetRefinedObj", &_SetRefinedObj, + nb::arg("obj"), nb::arg("LSQFuncIndex") = 0, + nb::arg("init") = true, nb::arg("recursive") = false, + nb::keep_alive<1,2>()) + .def("GetCompiledRefinedObj", + nb::overload_cast<>(&LSQNumObj::GetCompiledRefinedObj), + nb::rv_policy::reference_internal) + .def("PrintRefResults", &LSQNumObj::PrintRefResults) + .def("PrepareRefParList",&LSQNumObj::PrepareRefParList, + nb::arg("copy_param") = false) + .def("GetLSQCalc", + [](LSQNumObj& obj){ return crystvec_to_array(obj.GetLSQCalc()); }) + .def("GetLSQObs", + [](LSQNumObj& obj){ return crystvec_to_array(obj.GetLSQObs()); }) + .def("GetLSQWeight", + [](LSQNumObj& obj){ return crystvec_to_array(obj.GetLSQWeight()); }) + .def("GetLSQDeriv", + [](LSQNumObj& obj, RefinablePar& par){ return crystvec_to_array(obj.GetLSQDeriv(par)); }, + nb::arg("par")) + .def("BeginOptimization", &LSQNumObj::BeginOptimization, + nb::arg("allowApproximations") = false, + nb::arg("enableRestraints") = false) + .def("EndOptimization", &LSQNumObj::EndOptimization) + ; +} diff --git a/src/extensions/nb_module.cpp b/src/extensions/nb_module.cpp new file mode 100644 index 00000000..267391ea --- /dev/null +++ b/src/extensions/nb_module.cpp @@ -0,0 +1,136 @@ +/* + * pyobjcryst nanobind port — module entry point (_pyobjcryst) + */ + +#include +#include + +#undef B0 +#include +#include + +namespace nb = nanobind; + +// Forward declarations for all wrap_* functions +void wrap_general(nb::module_&); +void wrap_io(nb::module_&); +void wrap_objregistry(nb::module_&); +void wrap_quaternion(nb::module_&); +void wrap_refinableobjclock(nb::module_&); +void wrap_refobjopt(nb::module_&); +void wrap_refpartype(nb::module_&); +void wrap_restraint(nb::module_&); +void wrap_refinablepar(nb::module_&); +void wrap_refinableobj(nb::module_&); +void wrap_scatteringdata(nb::module_&); +void wrap_scatterer(nb::module_&); +void wrap_scatteringpower(nb::module_&); +void wrap_zscatterer(nb::module_&); +void wrap_unitcell(nb::module_&); +void wrap_powderpatterncomponent(nb::module_&); +void wrap_reflectionprofile(nb::module_&); +void wrap_asymmetricunit(nb::module_&); +void wrap_atom(nb::module_&); +void wrap_crystal(nb::module_&); +void wrap_diffractiondatasinglecrystal(nb::module_&); +void wrap_globaloptim(nb::module_&); +void wrap_globalscatteringpower(nb::module_&); +void wrap_indexing(nb::module_&); +void wrap_lsq(nb::module_&); +void wrap_molatom(nb::module_&); +void wrap_molbond(nb::module_&); +void wrap_molbondangle(nb::module_&); +void wrap_moldihedralangle(nb::module_&); +void wrap_molecule(nb::module_&); +void wrap_polyhedron(nb::module_&); +void wrap_powderpattern(nb::module_&); +void wrap_powderpatternbackground(nb::module_&); +void wrap_powderpatterndiffraction(nb::module_&); +void wrap_radiation(nb::module_&); +void wrap_rigidgroup(nb::module_&); +void wrap_scatteringcomponent(nb::module_&); +void wrap_scatteringcomponentlist(nb::module_&); +void wrap_scatteringpoweratom(nb::module_&); +void wrap_scatteringpowersphere(nb::module_&); +void wrap_spacegroup(nb::module_&); +void wrap_stretchmode(nb::module_&); +void wrap_zatom(nb::module_&); +void wrap_zpolyhedron(nb::module_&); + +NB_MODULE(_pyobjcryst, m) +{ + m.doc() = "pyobjcryst — Python bindings to ObjCryst++ (nanobind port)"; + + // Create ObjCrystException as a Python exception class + PyObject* exc_class = PyErr_NewException("_pyobjcryst.ObjCrystException", nullptr, nullptr); + m.attr("ObjCrystException") = nb::steal(exc_class); + + // Register translator so C++ ObjCrystException -> Python ObjCrystException + nb::register_exception_translator( + [](const std::exception_ptr& p, void* exc_ptr) { + try { + std::rethrow_exception(p); + } catch (const ObjCryst::ObjCrystException& e) { + PyErr_SetString(reinterpret_cast(exc_ptr), e.message.c_str()); + } + }, exc_class + ); + + // General enums, version + wrap_general(m); + + // I/O helpers (XMLCrystTag etc.) + wrap_io(m); + + // ObjRegistry template instantiations + wrap_objregistry(m); + + // Simple value types + wrap_quaternion(m); + wrap_refinableobjclock(m); + wrap_refobjopt(m); + wrap_refpartype(m); + + // Core refinable hierarchy (order matters: base before derived) + wrap_restraint(m); + wrap_refinablepar(m); + wrap_refinableobj(m); + + // Scattering base classes + wrap_scatteringdata(m); + wrap_scatterer(m); + wrap_scatteringpower(m); + wrap_zscatterer(m); + wrap_unitcell(m); + wrap_powderpatterncomponent(m); + wrap_reflectionprofile(m); + + // Concrete classes + wrap_asymmetricunit(m); + wrap_spacegroup(m); + wrap_scatteringcomponent(m); + wrap_scatteringcomponentlist(m); + wrap_scatteringpoweratom(m); + wrap_scatteringpowersphere(m); + wrap_atom(m); + wrap_crystal(m); + wrap_diffractiondatasinglecrystal(m); + wrap_globaloptim(m); + wrap_globalscatteringpower(m); + wrap_indexing(m); + wrap_lsq(m); + wrap_rigidgroup(m); + wrap_molatom(m); + wrap_molbond(m); + wrap_molbondangle(m); + wrap_moldihedralangle(m); + wrap_stretchmode(m); + wrap_molecule(m); + wrap_polyhedron(m); + wrap_powderpattern(m); + wrap_powderpatternbackground(m); + wrap_powderpatterndiffraction(m); + wrap_radiation(m); + wrap_zatom(m); + wrap_zpolyhedron(m); +} diff --git a/src/extensions/nb_molatom.cpp b/src/extensions/nb_molatom.cpp new file mode 100644 index 00000000..40e69c2c --- /dev/null +++ b/src/extensions/nb_molatom.cpp @@ -0,0 +1,70 @@ +#include +#include +#include +#include +#include +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +namespace { +// Wrap a (possibly null) ScatteringPower* for return to Python. Its dynamic +// type is almost always ScatteringPowerAtom, which inherits VIRTUALLY from +// ScatteringPower and is therefore intentionally registered in nanobind +// WITHOUT a declared base (see nb_scatteringpoweratom.cpp) -- nanobind's +// automatic base<->derived pointer adjustment assumes a fixed, statically +// computable offset, which virtual inheritance does not provide. Detect the +// concrete type with a real C++ dynamic_cast (correct for virtual +// inheritance) before handing nanobind an already-correctly-typed pointer. +// See the identical fix in nb_crystal.cpp::wrapScatteringPowerPython for the +// segfault this avoids. +nb::object getScatteringPowerPython(nb::handle self) +{ + const MolAtom& a = nb::cast(self); + if (a.IsDummy()) return nb::none(); + const ScatteringPower& sp = a.GetScatteringPower(); + if (auto* spa = dynamic_cast(&sp)) + return nb::cast(const_cast(spa), nb::rv_policy::reference_internal, self); + return nb::cast(const_cast(&sp), nb::rv_policy::reference_internal, self); +} +std::string __str__(MolAtom& a) +{ + std::ostringstream s; + s << a.GetName() << " " << a.GetX() << " " << a.GetY() << " " << a.GetZ(); + return s.str(); +} +} // namespace + +void wrap_molatom(nb::module_& m) +{ + nb::class_(m, "MolAtom") + .def(nb::init()) + .def("GetName", nb::overload_cast<>(&MolAtom::GetName, nb::const_)) + .def("SetName", &MolAtom::SetName) + .def("GetMolecule", nb::overload_cast<>(&MolAtom::GetMolecule), + nb::rv_policy::reference_internal) + .def("GetX", &MolAtom::GetX) + .def("GetY", &MolAtom::GetY) + .def("GetZ", &MolAtom::GetZ) + .def("GetOccupancy", &MolAtom::GetOccupancy) + .def("SetX", &MolAtom::SetX) + .def("SetY", &MolAtom::SetY) + .def("SetZ", &MolAtom::SetZ) + .def("SetOccupancy", &MolAtom::SetOccupancy) + .def("IsDummy", &MolAtom::IsDummy) + .def("GetScatteringPower", &getScatteringPowerPython) + .def("SetIsInRing", &MolAtom::SetIsInRing) + .def("IsInRing", &MolAtom::IsInRing) + .def_prop_rw("X", &MolAtom::GetX, &MolAtom::SetX) + .def_prop_rw("Y", &MolAtom::GetY, &MolAtom::SetY) + .def_prop_rw("Z", &MolAtom::GetZ, &MolAtom::SetZ) + .def_prop_rw("Occupancy", &MolAtom::GetOccupancy, &MolAtom::SetOccupancy) + .def_prop_rw("x", &MolAtom::GetX, &MolAtom::SetX) + .def_prop_rw("y", &MolAtom::GetY, &MolAtom::SetY) + .def_prop_rw("z", &MolAtom::GetZ, &MolAtom::SetZ) + .def_prop_rw("occ", &MolAtom::GetOccupancy, &MolAtom::SetOccupancy) + .def("__str__", &__str__) + .def("int_ptr", &MolAtom::int_ptr) + ; +} diff --git a/src/extensions/nb_molbond.cpp b/src/extensions/nb_molbond.cpp new file mode 100644 index 00000000..5fb28fbe --- /dev/null +++ b/src/extensions/nb_molbond.cpp @@ -0,0 +1,53 @@ +#include +#include +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +namespace { +MolAtom& _GetAtom(MolBond& mb, size_t i) +{ + switch(i) { + case 0: return mb.GetAtom1(); + case 1: return mb.GetAtom2(); + default: throw nb::index_error("Index out of range"); + } +} +} // namespace + +void wrap_molbond(nb::module_& m) +{ + nb::class_(m, "MolBond") + .def("GetMolecule", nb::overload_cast<>(&MolBond::GetMolecule), + nb::rv_policy::reference_internal) + .def("GetLogLikelihood", nb::overload_cast<>(&MolBond::GetLogLikelihood, nb::const_)) + .def("GetLogLikelihood", + nb::overload_cast(&MolBond::GetLogLikelihood, nb::const_)) + .def("GetName", &MolBond::GetName) + .def("GetAtom1", nb::overload_cast<>(&MolBond::GetAtom1), + nb::rv_policy::reference_internal) + .def("GetAtom2", nb::overload_cast<>(&MolBond::GetAtom2), + nb::rv_policy::reference_internal) + .def("SetAtom1", &MolBond::SetAtom1, nb::keep_alive<1,2>()) + .def("SetAtom2", &MolBond::SetAtom2, nb::keep_alive<1,2>()) + .def("GetLength", &MolBond::GetLength) + .def("GetLength0", &MolBond::GetLength0) + .def("GetLengthDelta", &MolBond::GetLengthDelta) + .def("GetLengthSigma", &MolBond::GetLengthSigma) + .def("GetBondOrder", &MolBond::GetBondOrder) + .def("SetLength0", &MolBond::SetLength0) + .def("SetLengthDelta", &MolBond::SetLengthDelta) + .def("SetLengthSigma", &MolBond::SetLengthSigma) + .def("SetBondOrder", &MolBond::SetBondOrder) + .def("IsFreeTorsion", &MolBond::IsFreeTorsion) + .def("SetFreeTorsion", &MolBond::SetFreeTorsion) + .def_prop_ro("Length", &MolBond::GetLength) + .def_prop_rw("Length0", &MolBond::GetLength0, &MolBond::SetLength0) + .def_prop_rw("LengthDelta", &MolBond::GetLengthDelta, &MolBond::SetLengthDelta) + .def_prop_rw("LengthSigma", &MolBond::GetLengthSigma, &MolBond::SetLengthSigma) + .def_prop_rw("BondOrder", &MolBond::GetBondOrder, &MolBond::SetBondOrder) + .def("__getitem__", &_GetAtom, nb::rv_policy::reference_internal) + .def("int_ptr", &MolBond::int_ptr) + ; +} diff --git a/src/extensions/nb_molbondangle.cpp b/src/extensions/nb_molbondangle.cpp new file mode 100644 index 00000000..48ab11ec --- /dev/null +++ b/src/extensions/nb_molbondangle.cpp @@ -0,0 +1,59 @@ +#include +#include +#include +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +namespace { +MolAtom& _GetAtom(MolBondAngle& mb, size_t i) +{ + switch(i) { + case 0: return mb.GetAtom1(); + case 1: return mb.GetAtom2(); + case 2: return mb.GetAtom3(); + default: throw nb::index_error("Index out of range"); + } +} +} // namespace + +void wrap_molbondangle(nb::module_& m) +{ + nb::class_(m, "MolBondAngle") + .def("GetMolecule", nb::overload_cast<>(&MolBondAngle::GetMolecule), + nb::rv_policy::reference_internal) + .def("GetName", &MolBondAngle::GetName) + .def("GetLogLikelihood", nb::overload_cast<>(&MolBondAngle::GetLogLikelihood, nb::const_)) + .def("GetLogLikelihood", + nb::overload_cast(&MolBondAngle::GetLogLikelihood, nb::const_)) + .def("GetAngle", &MolBondAngle::GetAngle) + .def("GetAngle0", &MolBondAngle::GetAngle0) + .def("GetAngleDelta", &MolBondAngle::GetAngleDelta) + .def("GetAngleSigma", &MolBondAngle::GetAngleSigma) + .def("SetAngle0", &MolBondAngle::SetAngle0) + .def("SetAngleDelta", &MolBondAngle::SetAngleDelta) + .def("SetAngleSigma", &MolBondAngle::SetAngleSigma) + .def("GetAtom1", nb::overload_cast<>(&MolBondAngle::GetAtom1), + nb::rv_policy::reference_internal) + .def("GetAtom2", nb::overload_cast<>(&MolBondAngle::GetAtom2), + nb::rv_policy::reference_internal) + .def("GetAtom3", nb::overload_cast<>(&MolBondAngle::GetAtom3), + nb::rv_policy::reference_internal) + .def("SetAtom1", &MolBondAngle::SetAtom1, nb::keep_alive<1,2>()) + .def("SetAtom2", &MolBondAngle::SetAtom2, nb::keep_alive<1,2>()) + .def("SetAtom3", &MolBondAngle::SetAtom3, nb::keep_alive<1,2>()) + .def_prop_ro("Angle", &MolBondAngle::GetAngle) + .def_prop_rw("Angle0", &MolBondAngle::GetAngle0, &MolBondAngle::SetAngle0) + .def_prop_rw("AngleDelta", &MolBondAngle::GetAngleDelta, &MolBondAngle::SetAngleDelta) + .def_prop_rw("AngleSigma", &MolBondAngle::GetAngleSigma, &MolBondAngle::SetAngleSigma) + .def("__getitem__", &_GetAtom, nb::rv_policy::reference_internal) + // Iterate over the atoms involved (present in the legacy + // Boost.Python binding via MolBondAngle::begin()/end()). + .def("__iter__", [](MolBondAngle& mb){ + return nb::make_iterator(nb::find(nb::type()), + "molbondangle_atom_iter", mb.begin(), mb.end()); + }, nb::keep_alive<0,1>()) + .def("int_ptr", &MolBondAngle::int_ptr) + ; +} diff --git a/src/extensions/nb_moldihedralangle.cpp b/src/extensions/nb_moldihedralangle.cpp new file mode 100644 index 00000000..4787c323 --- /dev/null +++ b/src/extensions/nb_moldihedralangle.cpp @@ -0,0 +1,63 @@ +#include +#include +#include +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +namespace { +MolAtom& _GetAtom(MolDihedralAngle& mb, size_t i) +{ + switch(i) { + case 0: return mb.GetAtom1(); + case 1: return mb.GetAtom2(); + case 2: return mb.GetAtom3(); + case 3: return mb.GetAtom4(); + default: throw nb::index_error("Index out of range"); + } +} +} // namespace + +void wrap_moldihedralangle(nb::module_& m) +{ + nb::class_(m, "MolDihedralAngle") + .def("GetMolecule", nb::overload_cast<>(&MolDihedralAngle::GetMolecule), + nb::rv_policy::reference_internal) + .def("GetName", &MolDihedralAngle::GetName) + .def("GetLogLikelihood", nb::overload_cast<>(&MolDihedralAngle::GetLogLikelihood, nb::const_)) + .def("GetLogLikelihood", + nb::overload_cast(&MolDihedralAngle::GetLogLikelihood, nb::const_)) + .def("GetAngle", &MolDihedralAngle::GetAngle) + .def("GetAngle0", &MolDihedralAngle::GetAngle0) + .def("GetAngleDelta", &MolDihedralAngle::GetAngleDelta) + .def("GetAngleSigma", &MolDihedralAngle::GetAngleSigma) + .def("SetAngle0", &MolDihedralAngle::SetAngle0) + .def("SetAngleDelta", &MolDihedralAngle::SetAngleDelta) + .def("SetAngleSigma", &MolDihedralAngle::SetAngleSigma) + .def("GetAtom1", nb::overload_cast<>(&MolDihedralAngle::GetAtom1), + nb::rv_policy::reference_internal) + .def("GetAtom2", nb::overload_cast<>(&MolDihedralAngle::GetAtom2), + nb::rv_policy::reference_internal) + .def("GetAtom3", nb::overload_cast<>(&MolDihedralAngle::GetAtom3), + nb::rv_policy::reference_internal) + .def("GetAtom4", nb::overload_cast<>(&MolDihedralAngle::GetAtom4), + nb::rv_policy::reference_internal) + .def("SetAtom1", &MolDihedralAngle::SetAtom1, nb::keep_alive<1,2>()) + .def("SetAtom2", &MolDihedralAngle::SetAtom2, nb::keep_alive<1,2>()) + .def("SetAtom3", &MolDihedralAngle::SetAtom3, nb::keep_alive<1,2>()) + .def("SetAtom4", &MolDihedralAngle::SetAtom4, nb::keep_alive<1,2>()) + .def_prop_ro("Angle", &MolDihedralAngle::GetAngle) + .def_prop_rw("Angle0", &MolDihedralAngle::GetAngle0, &MolDihedralAngle::SetAngle0) + .def_prop_rw("AngleDelta", &MolDihedralAngle::GetAngleDelta, &MolDihedralAngle::SetAngleDelta) + .def_prop_rw("AngleSigma", &MolDihedralAngle::GetAngleSigma, &MolDihedralAngle::SetAngleSigma) + .def("__getitem__", &_GetAtom, nb::rv_policy::reference_internal) + // Iterate over the atoms involved (present in the legacy + // Boost.Python binding via MolDihedralAngle::begin()/end()). + .def("__iter__", [](MolDihedralAngle& mb){ + return nb::make_iterator(nb::find(nb::type()), + "moldihedralangle_atom_iter", mb.begin(), mb.end()); + }, nb::keep_alive<0,1>()) + .def("int_ptr", &MolDihedralAngle::int_ptr) + ; +} diff --git a/src/extensions/nb_molecule.cpp b/src/extensions/nb_molecule.cpp new file mode 100644 index 00000000..ab7b358a --- /dev/null +++ b/src/extensions/nb_molecule.cpp @@ -0,0 +1,545 @@ +#include +#include +#include + +#include +#include +#include +#include +#include + +#undef B0 +#include +#include +#include +#include +#include + +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +namespace { + +// ScatteringPowerAtom inherits VIRTUALLY from ScatteringPower (see +// ScatteringPower.h), so it is intentionally registered in nanobind WITHOUT +// a declared base (see nb_scatteringpoweratom.cpp) -- nanobind's automatic +// base<->derived pointer adjustment assumes a fixed, statically computable +// offset, which virtual inheritance does not provide. Left as a plain +// `const ScatteringPower* pow` parameter, nanobind refuses to accept a +// Python ScatteringPowerAtom instance there at all (TypeError), since it +// has no declared relationship to ScatteringPower. Resolve it manually: +// try the concrete registered type first (exact match, no offset needed), +// falling back to ScatteringPower directly. Mirrors getScatteringPowerPtr +// in nb_atom.cpp. +const ScatteringPower* extractScatteringPowerArg(nb::object obj) +{ + if (obj.is_none()) return nullptr; + try { + return static_cast(&nb::cast(obj)); + } catch (...) {} + return &nb::cast(obj); +} + +// Wrap a (possibly null) ScatteringPower* for return to Python. Its dynamic +// type is almost always ScatteringPowerAtom; detect that with a real C++ +// dynamic_cast (correct for virtual inheritance, unlike nanobind's own +// offset-based polymorphic auto-detection -- see the identical fix and +// longer explanation in nb_crystal.cpp::wrapScatteringPowerPython) before +// handing nanobind an already-correctly-typed pointer. +nb::object wrapScatteringPowerReturn(const ScatteringPower* sp, nb::handle parent) +{ + if (!sp) return nb::none(); + if (auto* spa = dynamic_cast(sp)) + return nb::cast(const_cast(spa), nb::rv_policy::reference_internal, parent); + return nb::cast(const_cast(sp), nb::rv_policy::reference_internal, parent); +} + +MolAtom& _AddAtom(Molecule& m, const double x, const double y, const double z, + nb::object pow, const std::string& name, + const bool updateDisplay=true) +{ + const ScatteringPower* sp = extractScatteringPowerArg(pow); + m.AddAtom(x, y, z, sp, name, updateDisplay); + m.SetDeleteSubObjInDestructor(false); + return *m.GetAtomList().back(); +} + +MolBond& _AddBond(Molecule& m, MolAtom& atom1, MolAtom& atom2, const double length, + const double sigma, const double delta, const double bondOrder=1., + const bool updateDisplay=true) +{ + m.AddBond(atom1, atom2, length, sigma, delta, bondOrder, updateDisplay); + m.SetDeleteSubObjInDestructor(false); + return *m.GetBondList().back(); +} + +MolBondAngle& _AddBondAngle(Molecule& m, MolAtom& atom1, MolAtom& atom2, MolAtom& atom3, + const double angle, const double sigma, const double delta, + const bool updateDisplay=true) +{ + m.AddBondAngle(atom1, atom2, atom3, angle, sigma, delta, updateDisplay); + m.SetDeleteSubObjInDestructor(false); + return *m.GetBondAngleList().back(); +} + +MolDihedralAngle& _AddDihedralAngle(Molecule& m, MolAtom& a1, MolAtom& a2, + MolAtom& a3, MolAtom& a4, + const double angle, const double sigma, const double delta, + const bool updateDisplay=true) +{ + m.AddDihedralAngle(a1, a2, a3, a4, angle, sigma, delta, updateDisplay); + m.SetDeleteSubObjInDestructor(false); + return *m.GetDihedralAngleList().back(); +} + +MolAtom& _GetAtomIdx(Molecule& m, int idx) +{ + int i = check_index(idx, m.GetNbComponent(), ALLOW_NEGATIVE); + return m.GetAtom(i); +} + +MolAtom* _FindAtom(Molecule& m, const std::string& name) +{ + auto ii = m.FindAtom(name); + return (ii != m.mvpAtom.rend()) ? *ii : nullptr; +} + +MolAtom* _GetAtomByName(Molecule& m, const std::string& name) +{ + MolAtom* rv = _FindAtom(m, name); + if (!rv) throw nb::value_error(("Invalid atom name: " + name).c_str()); + return rv; +} + +MolBond& _GetBondIdx(Molecule& m, int idx) +{ + auto& v = m.GetBondList(); + if (idx < 0) idx += (int)v.size(); + if (v.empty() || idx < 0 || idx >= (int)v.size()) + throw nb::index_error("Index out of range"); + return *v[idx]; +} + +MolBondAngle& _GetBondAngleIdx(Molecule& m, int idx) +{ + auto& v = m.GetBondAngleList(); + if (idx < 0) idx += (int)v.size(); + if (v.empty() || idx < 0 || idx >= (int)v.size()) + throw nb::index_error("Index out of range"); + return *v[idx]; +} + +MolDihedralAngle& _GetDihedralAngleIdx(Molecule& m, int idx) +{ + auto& v = m.GetDihedralAngleList(); + if (idx < 0) idx += (int)v.size(); + if (v.empty() || idx < 0 || idx >= (int)v.size()) + throw nb::index_error("Index out of range"); + return *v[idx]; +} + +RigidGroup& _AddRigidGroup(Molecule& m, const RigidGroup& r, const bool ud=true) +{ + m.AddRigidGroup(r, ud); + return *m.GetRigidGroupList().back(); +} + +RigidGroup& _AddRigidGroupIterable(Molecule& m, nb::object& l, const bool ud=true) +{ + RigidGroup rg; + for (auto h : l) rg.insert(&nb::cast(h)); + m.AddRigidGroup(rg, ud); + return *m.GetRigidGroupList().back(); +} + +nb::object _FindBond(const Molecule& m, const MolAtom& a1, const MolAtom& a2) +{ + auto it = m.FindBond(a1, a2); + if (it == m.GetBondList().end()) return nb::none(); + return nb::cast(*it, nb::rv_policy::reference); +} + +nb::object _FindBondAngle(const Molecule& m, const MolAtom& a1, const MolAtom& a2, const MolAtom& a3) +{ + auto it = m.FindBondAngle(a1, a2, a3); + if (it == m.GetBondAngleList().end()) return nb::none(); + return nb::cast(*it, nb::rv_policy::reference); +} + +nb::object _FindDihedralAngle(const Molecule& m, const MolAtom& a1, const MolAtom& a2, + const MolAtom& a3, const MolAtom& a4) +{ + auto it = m.FindDihedralAngle(a1, a2, a3, a4); + if (it == m.GetDihedralAngleList().end()) return nb::none(); + return nb::cast(*it, nb::rv_policy::reference); +} + +nb::list _GetAtomList(const Molecule& m) +{ return ptrcontainerToPyList>(m.GetAtomList()); } + +nb::list _GetBondList(const Molecule& m) +{ return ptrcontainerToPyList>(m.GetBondList()); } + +nb::list _GetBondAngleList(const Molecule& m) +{ return ptrcontainerToPyList>(m.GetBondAngleList()); } + +nb::list _GetDihedralAngleList(const Molecule& m) +{ return ptrcontainerToPyList>(m.GetDihedralAngleList()); } + +nb::list _GetRigidGroupList(const Molecule& m) +{ return ptrcontainerToPyList>(m.GetRigidGroupList()); } + +nb::list _GetStretchModeBondLengthList(const Molecule& m) +{ return containerToPyList>(m.GetStretchModeBondLengthList()); } + +nb::list _GetStretchModeBondAngleList(const Molecule& m) +{ return containerToPyList>(m.GetStretchModeBondAngleList()); } + +nb::list _GetStretchModeTorsionList(const Molecule& m) +{ return containerToPyList>(m.GetStretchModeTorsionList()); } + +void _RotateAtomGroup(Molecule& m, const MolAtom& at1, const MolAtom& at2, + const nb::object& atoms, const double angle, const bool keepCenter=true) +{ + auto catoms = pyIterableToSet(atoms); + m.RotateAtomGroup(at1, at2, catoms, angle, keepCenter); +} + +void _RotateAtomGroupVec(Molecule& m, const MolAtom& at1, const REAL vx, + const double vy, const double vz, const nb::object& atoms, + const double angle, const bool keepCenter=true) +{ + auto catoms = pyIterableToSet(atoms); + m.RotateAtomGroup(at1, vx, vy, vz, catoms, angle, keepCenter); +} + +// Accepts two 3-tuples (a point and a direction vector) instead of two +// MolAtom instances, mirroring the legacy Boost.Python _RotateAtomGroup2Vec +// in src/extensions/molecule_ext.cpp: creates a temporary dummy atom at v1, +// rotates around the axis defined by (temp atom, direction v2), then removes +// the temporary atom again. +void _RotateAtomGroup2Vec(Molecule& m, nb::object v1, nb::object v2, + const nb::object& atoms, const double angle, + const bool keepCenter=true) +{ + double x = nb::cast(v1[0]); + double y = nb::cast(v1[1]); + double z = nb::cast(v1[2]); + MolAtom& a = _AddAtom(m, x, y, z, nb::none(), "_rag2vectemp", false); + x = nb::cast(v2[0]); + y = nb::cast(v2[1]); + z = nb::cast(v2[2]); + _RotateAtomGroupVec(m, a, x, y, z, atoms, angle, keepCenter); + m.RemoveAtom(a, true); +} + +void _TranslateAtomGroup(Molecule& m, const nb::object& atoms, const double dx, + const double dy, const double dz, const bool keepCenter=true) +{ + auto catoms = pyIterableToSet(atoms); + m.TranslateAtomGroup(catoms, dx, dy, dz, keepCenter); +} + +nb::dict _GetConnectivityTable(Molecule& m) +{ + const auto& ct = m.GetConnectivityTable(); + nb::dict d; + for (const auto& kv : ct) { + nb::object key = nb::cast(kv.first, nb::rv_policy::reference); + d[key] = ptrcontainerToPyList>(kv.second); + } + return d; +} + +nb::list _AsZMatrix(const Molecule& m, const bool keeporder) +{ + return containerToPyList>(m.AsZMatrix(keeporder)); +} + +std::string quatparname(const Molecule& m, int idx) +{ + using namespace std; + static bool didseparator = false; + static bool prefixmolname = false; + static string separator; + if (!didseparator) { + map qnames; + for (long i = 0; i < m.GetNbPar(); ++i) { + const string& pname = m.GetPar(i).GetName(); + size_t n = pname.size(); + if (n < 2) continue; + if (pname[n-2] != 'Q') continue; + if (pname.find_last_of("0123", n-1) == string::npos) continue; + qnames[pname.substr(0, n-2)] += 1; + } + const string& mname = m.GetName(); + for (auto& kv : qnames) { + if (kv.second == 4) { + const string& qnm = kv.first; + prefixmolname = (qnm.size() >= mname.size() && + qnm.substr(0, mname.size()) == mname); + size_t p0 = prefixmolname ? mname.size() : 0; + separator = qnm.substr(p0); + didseparator = true; + } + } + } + std::ostringstream rv; + rv << (prefixmolname ? m.GetName() : "") << separator << 'Q' << idx; + return rv.str(); +} + +void _setQ0(Molecule& m, double v) { m.GetPar(quatparname(m,0)).SetValue(v); } +double _getQ0(Molecule& m) { return m.GetPar(quatparname(m,0)).GetValue(); } +void _setQ1(Molecule& m, double v) { m.GetPar(quatparname(m,1)).SetValue(v); } +double _getQ1(Molecule& m) { return m.GetPar(quatparname(m,1)).GetValue(); } +void _setQ2(Molecule& m, double v) { m.GetPar(quatparname(m,2)).SetValue(v); } +double _getQ2(Molecule& m) { return m.GetPar(quatparname(m,2)).GetValue(); } +void _setQ3(Molecule& m, double v) { m.GetPar(quatparname(m,3)).SetValue(v); } +double _getQ3(Molecule& m) { return m.GetPar(quatparname(m,3)).GetValue(); } + +nb::object molzatom_spow(nb::handle self) +{ + const MolZAtom& a = nb::cast(self); + return wrapScatteringPowerReturn(a.mpPow ? a.mpPow : nullptr, self); +} + +// AddPar on Molecule: Molecule does not nanobind-inherit RefinableObj (it is +// only ever exposed via Scatterer, and reaching RefinableObj itself would hit +// the same virtual-inheritance offset problem documented throughout this +// migration), so reach the base via static_cast, exactly mirroring the +// already-working _AddPar/_AddParObj pattern in nb_refinableobj.cpp. +void _AddParMol(Molecule& m, RefinablePar* p) +{ + static_cast(m).AddPar(p); + static_cast(m).SetDeleteRefParInDestructor(0); +} +void _AddParObjMol(Molecule& m, nb::object o, const bool copyParam = false) +{ + static_cast(m).AddPar(extractRefinableObjArg(o), copyParam); + static_cast(m).SetDeleteRefParInDestructor(0); +} + +// __getitem__ slice support, mirroring Python list semantics. Registered as +// a separate overload from the plain-int _GetAtomIdx (below) so nanobind's +// own overload resolution distinguishes `int` from `slice` arguments, +// rather than us hand-rolling that dispatch. self is taken as nb::handle so +// each returned MolAtom* can be explicitly tied (via rv_policy and parent) +// to the Molecule's lifetime, matching the pattern used everywhere else in +// this file for reference_internal returns. +nb::list _GetItemSlice(nb::handle self, const nb::slice& sl) +{ + Molecule& m = nb::cast(self); + auto [start, stop, step, slice_length] = sl.compute(m.GetAtomList().size()); + nb::list rv; + for (size_t i = 0; i < slice_length; ++i) { + rv.append(nb::cast(&_GetAtomIdx(m, (int)start), nb::rv_policy::reference_internal, self)); + start += step; + } + return rv; +} + +} // namespace + +void wrap_molecule(nb::module_& m) +{ + // nb::dynamic_attr() is required because the legacy Python-layer helper + // ImportFenskeHallZMatrix() (see pyobjcryst/molecule.py) sets an ad-hoc + // `m._crystal = cryst` attribute on the Molecule instance to keep the + // Crystal alive (a pre-existing hack from the Boost.Python era, kept + // as-is rather than restructured here). + nb::class_(m, "Molecule", nb::is_final(), nb::dynamic_attr()) + .def(nb::init(), nb::arg("oldMolecule")) + .def(nb::init(), + nb::arg("cryst"), nb::arg("name") = "") + .def("GetFormula", &Molecule::GetFormula) + .def("AddAtom", &_AddAtom, + nb::arg("x"), nb::arg("y"), nb::arg("z"), nb::arg("pPow").none(), + nb::arg("name"), nb::arg("updateDisplay") = true, + nb::keep_alive<1,5>(), nb::rv_policy::reference_internal) + .def("RemoveAtom", [](Molecule& mol, MolAtom& a){ mol.RemoveAtom(a, false); }) + .def("RemoveAtom", [](Molecule& mol, int idx){ mol.RemoveAtom(_GetAtomIdx(mol, idx), false); }) + .def("AddBond", &_AddBond, + nb::arg("atom1"), nb::arg("atom2"), nb::arg("length"), + nb::arg("sigma"), nb::arg("delta"), nb::arg("bondOrder") = 1., + nb::arg("updateDisplay") = true, + // No nb::keep_alive<1,2/3>() here (Molecule keeping atom1/atom2 + // alive): both atoms already arrive with their OWN reverse- + // direction link back to this Molecule (established when they + // were obtained via GetAtom()/AddAtom(), which use + // rv_policy::reference_internal). Adding the forward direction + // here too closes a Molecule<->MolAtom reference cycle that + // nanobind objects don't participate in Python's cyclic GC for + // by default, so it never gets collected (a real, reproduced + // leak -- see §10 in nanobind_migration_notes.md). The forward + // direction is not actually needed: MolAtom has no standalone + // Python-owned existence (see nb_molatom.cpp) independent of + // the Molecule that returned it, so nothing here can dangle + // once the redundant direction is removed. + nb::rv_policy::reference_internal) + .def("RemoveBond", [](Molecule& mol, const MolBond& b){ mol.RemoveBond(b, false); }) + .def("RemoveBond", [](Molecule& mol, int idx){ mol.RemoveBond(_GetBondIdx(mol, idx), false); }) + .def("GetBond", &_GetBondIdx, nb::rv_policy::reference_internal) + .def("FindBond", &_FindBond) + .def("AddBondAngle", &_AddBondAngle, + nb::arg("atom1"), nb::arg("atom2"), nb::arg("atom3"), + nb::arg("angle"), nb::arg("sigma"), nb::arg("delta"), + nb::arg("updateDisplay") = true, + // See the comment on AddBond above -- same reasoning applies to + // atom1/atom2/atom3 here (§10). + nb::rv_policy::reference_internal) + .def("RemoveBondAngle", [](Molecule& mol, MolBondAngle& ba){ mol.RemoveBondAngle(ba, false); }) + .def("RemoveBondAngle", [](Molecule& mol, int idx){ mol.RemoveBondAngle(_GetBondAngleIdx(mol, idx), false); }) + .def("GetBondAngle", &_GetBondAngleIdx, nb::rv_policy::reference_internal) + .def("FindBondAngle", &_FindBondAngle) + .def("AddDihedralAngle", &_AddDihedralAngle, + nb::arg("atom1"), nb::arg("atom2"), nb::arg("atom3"), nb::arg("atom4"), + nb::arg("angle"), nb::arg("sigma"), nb::arg("delta"), + nb::arg("updateDisplay") = true, + // See the comment on AddBond above -- same reasoning applies to + // atom1..atom4 here (§10). + nb::rv_policy::reference_internal) + .def("RemoveDihedralAngle", [](Molecule& mol, MolDihedralAngle& da){ mol.RemoveDihedralAngle(da, false); }) + .def("RemoveDihedralAngle", [](Molecule& mol, int idx){ mol.RemoveDihedralAngle(_GetDihedralAngleIdx(mol, idx), false); }) + .def("GetDihedralAngle", &_GetDihedralAngleIdx, nb::rv_policy::reference_internal) + .def("FindDihedralAngle", &_FindDihedralAngle) + .def("AddRigidGroup", + [](Molecule& mol, const RigidGroup& group, const bool updateDisplay) -> RigidGroup& { return _AddRigidGroup(mol, group, updateDisplay); }, + nb::arg("group"), nb::arg("updateDisplay") = true, + nb::rv_policy::reference_internal) + .def("AddRigidGroup", + [](Molecule& mol, nb::object& group, const bool updateDisplay) -> RigidGroup& { return _AddRigidGroupIterable(mol, group, updateDisplay); }, + nb::arg("group"), nb::arg("updateDisplay") = true, + nb::rv_policy::reference_internal) + .def("RemoveRigidGroup", [](Molecule& mol, RigidGroup& rg, const bool ud){ mol.RemoveRigidGroup(rg, ud, false); }, + nb::arg("group"), nb::arg("updateDisplay") = true) + .def("GetAtom", [](Molecule& mol, int idx) -> MolAtom& { return _GetAtomIdx(mol, idx); }, nb::rv_policy::reference_internal) + .def("GetAtom", [](Molecule& mol, const std::string& name) -> MolAtom& { return *_GetAtomByName(mol, name); }, nb::rv_policy::reference_internal) + .def("FindAtom", &_FindAtom, nb::rv_policy::reference_internal) + .def("OptimizeConformation", &Molecule::OptimizeConformation, + nb::arg("nbTrial") = 10000, nb::arg("stopCost") = 0.) + .def("OptimizeConformationSteepestDescent", + &Molecule::OptimizeConformationSteepestDescent, + nb::arg("maxStep") = 0.1, nb::arg("nbSteps") = 1) + .def("GetNbAtoms", [](Molecule& mol){ return mol.GetAtomList().size(); }) + .def("GetNbBonds", [](Molecule& mol){ return mol.GetBondList().size(); }) + .def("GetNbBondAngles", [](Molecule& mol){ return mol.GetBondAngleList().size(); }) + .def("GetNbDihedralAngles", [](Molecule& mol){ return mol.GetDihedralAngleList().size(); }) + .def("GetNbRigidGroups", [](Molecule& mol){ return mol.GetRigidGroupList().size(); }) + .def("GetAtomList", &_GetAtomList) + .def("GetBondList", &_GetBondList) + .def("GetBondAngleList", &_GetBondAngleList) + .def("GetDihedralAngleList", &_GetDihedralAngleList) + .def("GetRigidGroupList", &_GetRigidGroupList) + // Named iterators, present in the legacy Boost.Python binding + // alongside the default atom __iter__ (see below). IterAtom is + // functionally redundant with __iter__ (same begin/end pair) but + // kept for interface fidelity; IterBond/IterBondAngle/ + // IterDihedralAngle have no other way to iterate those lists. + .def("IterAtom", [](Molecule& mol){ + auto& v = mol.GetAtomList(); + return nb::make_iterator(nb::find(nb::type()), "atom_iter", v.begin(), v.end()); + }, nb::keep_alive<0,1>()) + .def("IterBond", [](Molecule& mol){ + auto& v = mol.GetBondList(); + return nb::make_iterator(nb::find(nb::type()), "bond_iter", v.begin(), v.end()); + }, nb::keep_alive<0,1>()) + .def("IterBondAngle", [](Molecule& mol){ + auto& v = mol.GetBondAngleList(); + return nb::make_iterator(nb::find(nb::type()), "bondangle_iter", v.begin(), v.end()); + }, nb::keep_alive<0,1>()) + .def("IterDihedralAngle", [](Molecule& mol){ + auto& v = mol.GetDihedralAngleList(); + return nb::make_iterator(nb::find(nb::type()), "dihedralangle_iter", v.begin(), v.end()); + }, nb::keep_alive<0,1>()) + .def("GetStretchModeBondLengthList", &_GetStretchModeBondLengthList) + .def("GetStretchModeBondAngleList", &_GetStretchModeBondAngleList) + .def("GetStretchModeTorsionList", &_GetStretchModeTorsionList) + .def("RotateAtomGroup", + [](Molecule& mol, const MolAtom& at1, const MolAtom& at2, const nb::object& atoms, const double angle, const bool keepCenter){ + _RotateAtomGroup(mol, at1, at2, atoms, angle, keepCenter); + }, + nb::arg("at1"), nb::arg("at2"), nb::arg("atoms"), nb::arg("angle"), nb::arg("keepCenter") = true) + .def("RotateAtomGroup", + [](Molecule& mol, const MolAtom& at1, const double vx, const double vy, const double vz, const nb::object& atoms, const double angle, const bool keepCenter){ + _RotateAtomGroupVec(mol, at1, vx, vy, vz, atoms, angle, keepCenter); + }, + nb::arg("at1"), nb::arg("vx"), nb::arg("vy"), nb::arg("vz"), nb::arg("atoms"), nb::arg("angle"), nb::arg("keepCenter") = true) + .def("RotateAtomGroup", &_RotateAtomGroup2Vec, + nb::arg("v1"), nb::arg("v2"), nb::arg("atoms"), nb::arg("angle"), nb::arg("keepCenter") = true) + .def("TranslateAtomGroup", &_TranslateAtomGroup, + nb::arg("atoms"), nb::arg("dx"), nb::arg("dy"), nb::arg("dz"), nb::arg("keepCenter") = true) + .def("GetConnectivityTable", &_GetConnectivityTable) + .def("GetBondListClock", nb::overload_cast<>(&Molecule::GetBondListClock), + nb::rv_policy::reference_internal) + .def("GetAtomPositionClock", nb::overload_cast<>(&Molecule::GetAtomPositionClock), + nb::rv_policy::reference_internal) + .def("GetRigidGroupClock", nb::overload_cast<>(&Molecule::GetRigidGroupClock), + nb::rv_policy::reference_internal) + .def("RigidifyWithDihedralAngles", &Molecule::RigidifyWithDihedralAngles) + .def("BondLengthRandomChange", &Molecule::BondLengthRandomChange, + nb::arg("mode"), nb::arg("amplitude"), nb::arg("respectRestraint") = true) + .def("BondAngleRandomChange", &Molecule::BondAngleRandomChange, + nb::arg("mode"), nb::arg("amplitude"), nb::arg("respectRestraint") = true) + .def("DihedralAngleRandomChange", &Molecule::DihedralAngleRandomChange, + nb::arg("mode"), nb::arg("amplitude"), nb::arg("respectRestraint") = true) + .def("GetCenterAtom", &Molecule::GetCenterAtom, + nb::rv_policy::reference_internal) + .def("SetCenterAtom", &Molecule::SetCenterAtom, nb::keep_alive<1,2>()) + .def("AsZMatrix", &_AsZMatrix, nb::arg("keeporder")) + .def("BuildRingList", &Molecule::BuildRingList) + .def("BuildConnectivityTable", &Molecule::BuildConnectivityTable) + .def("BuildRotorGroup", &Molecule::BuildRotorGroup) + .def("TuneGlobalOptimRotationAmplitude", &Molecule::TuneGlobalOptimRotationAmplitude) + .def("BuildFlipGroup", &Molecule::BuildFlipGroup) + .def("BuildStretchModeBondLength", &Molecule::BuildStretchModeBondLength) + .def("BuildStretchModeBondAngle", &Molecule::BuildStretchModeBondAngle) + .def("BuildStretchModeTorsion", &Molecule::BuildStretchModeTorsion) + .def("BuildStretchModeTwist", &Molecule::BuildStretchModeTwist) + .def("BuildStretchModeGroups", &Molecule::BuildStretchModeGroups) + .def("UpdateScattCompList", &Molecule::UpdateScattCompList) + .def("InitOptions", &Molecule::InitOptions) + .def("__getitem__", &_GetItemSlice) + .def("__getitem__", &_GetAtomIdx, nb::rv_policy::reference_internal) + .def("__len__", [](Molecule& mol){ return mol.GetAtomList().size(); }) + .def("GetLogLikelihood", [](Molecule& mol) -> double { + return (double)static_cast(mol).GetLogLikelihood(); }) + .def("xml", [](const Molecule& mol) -> std::string { + std::ostringstream s; + static_cast(mol).XMLOutput(s, 0); + return s.str(); + }) + .def("AddPar", &_AddParMol, nb::arg("par"), nb::keep_alive<1,2>()) + .def("AddPar", &_AddParObjMol, nb::arg("newRefParList"), nb::arg("copyParam") = false, + nb::keep_alive<1,2>()) + .def("__iter__", [](Molecule& mol){ + auto& v = mol.GetAtomList(); + return nb::make_iterator(nb::find(nb::type()), "atom_iter", v.begin(), v.end()); + }, nb::keep_alive<0,1>()) + .def_prop_rw("Q0", &_getQ0, &_setQ0) + .def_prop_rw("Q1", &_getQ1, &_setQ1) + .def_prop_rw("Q2", &_getQ2, &_setQ2) + .def_prop_rw("Q3", &_getQ3, &_setQ3) + ; + + m.def("GetBondLength", &GetBondLength); + m.def("GetBondAngle", &GetBondAngle); + m.def("GetDihedralAngle", &GetDihedralAngle); + + m.def("ZScatterer2Molecule", + (Molecule* (*)(ZScatterer*)) &ZScatterer2Molecule, + nb::arg("zscatt"), nb::rv_policy::take_ownership); + + nb::class_(m, "MolZAtom") + .def(nb::init()) + .def("GetScatteringPower", &molzatom_spow) + .def_ro("bond_atom", &MolZAtom::mBondAtom) + .def_ro("bond_angle_atom", &MolZAtom::mBondAngleAtom) + .def_ro("dihdral_angle_atom", &MolZAtom::mDihedralAtom) + .def_ro("bond_length", &MolZAtom::mBondLength) + .def_ro("bond_angle", &MolZAtom::mBondAngle) + .def_ro("dihdral_angle", &MolZAtom::mDihedralAngle) + ; +} diff --git a/src/extensions/nb_objregistry.cpp b/src/extensions/nb_objregistry.cpp new file mode 100644 index 00000000..9db46d30 --- /dev/null +++ b/src/extensions/nb_objregistry.cpp @@ -0,0 +1,152 @@ +/* + * pyobjcryst nanobind port — ObjRegistry bindings + */ + +#include +#include +#include + +#undef B0 +#include +#include +#include +#include +#include +#include +#include + +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +namespace { + +template +nb::list _getObjSlice(ObjRegistry& reg, nb::slice s) +{ + nb::list l; + for (auto it = reg.begin(); it != reg.end(); ++it) + l.append(nb::cast(*it, nb::rv_policy::reference)); + // Apply slice using Python + return nb::cast(nb::object(l).attr("__getitem__")(s)); +} + +template +MonteCarloObj& _getObjCastMonteCarlo(ObjRegistry& reg, const unsigned int i) +{ + T* obj = ®.GetObj(i); + MonteCarloObj* p = dynamic_cast(obj); + if (!p) throw ObjCryst::ObjCrystException("Cannot cast to MonteCarloObj"); + return *p; +} + +template <> +MonteCarloObj& _getObjCastMonteCarlo(ObjRegistry& reg, const unsigned int i) +{ + throw ObjCryst::ObjCrystException("Cannot cast a ZAtom to a MonteCarloObj"); +} + +template +void wrapObjRegistry(nb::class_>& c) +{ + c + .def("Register", &ObjRegistry::Register) + .def("DeRegister", + nb::overload_cast(&ObjRegistry::DeRegister)) + .def("DeRegister", + nb::overload_cast(&ObjRegistry::DeRegister)) + .def("DeRegisterAll", &ObjRegistry::DeRegisterAll) + .def("GetObj", + nb::overload_cast(&ObjRegistry::GetObj), + nb::rv_policy::reference_internal) + .def("GetObj", + nb::overload_cast(&ObjRegistry::GetObj), + nb::rv_policy::reference_internal) + .def("GetObj", + nb::overload_cast(&ObjRegistry::GetObj), + nb::rv_policy::reference_internal) + .def("GetNb", &ObjRegistry::GetNb) + .def("Print", &ObjRegistry::Print) + .def("SetName", &ObjRegistry::SetName) + .def("GetName", &ObjRegistry::GetName) + .def("Find", + nb::overload_cast(&ObjRegistry::Find, nb::const_)) + .def("Find", + nb::overload_cast( + &ObjRegistry::Find, nb::const_)) + .def("Find", + nb::overload_cast(&ObjRegistry::Find, nb::const_)) + .def("GetRegistryClock", &ObjRegistry::GetRegistryClock, + nb::rv_policy::reference_internal) + .def("__str__", [](ObjRegistry& r){ return obj_str(r); }) + .def("__len__", &ObjRegistry::GetNb) + .def("__getitem__", + nb::overload_cast(&ObjRegistry::GetObj), + nb::rv_policy::reference_internal) + .def("__getitem__", &_getObjSlice) + .def("__iter__", + [](ObjRegistry& r) { + return nb::make_iterator(nb::find(nb::type>()), "iterator", + r.begin(), r.end()); + }, nb::keep_alive<0, 1>()) + .def("_getObjCastMonteCarlo", &_getObjCastMonteCarlo, + nb::rv_policy::reference_internal) + ; +} + +} // namespace + +void wrap_objregistry(nb::module_& m) +{ + { + nb::class_> c(m, "CrystalRegistry", nb::dynamic_attr()); + c.def(nb::init()); + wrapObjRegistry(c); + } + { + nb::class_> c(m, "PowderPatternRegistry", nb::dynamic_attr()); + c.def(nb::init()); + wrapObjRegistry(c); + } + { + nb::class_> c(m, "DiffractionDataSingleCrystalRegistry", nb::dynamic_attr()); + c.def(nb::init()); + wrapObjRegistry(c); + } + { + nb::class_> c(m, "OptimizationObjRegistry", nb::dynamic_attr()); + c.def(nb::init()); + wrapObjRegistry(c); + } + { + nb::class_> c(m, "RefinableObjRegistry", nb::dynamic_attr()); + c.def(nb::init()); + wrapObjRegistry(c); + } + { + nb::class_> c(m, "RefObjOptRegistry", nb::dynamic_attr()); + c.def(nb::init()); + wrapObjRegistry(c); + } + { + nb::class_> c(m, "ScattererRegistry"); + c.def(nb::init()); + wrapObjRegistry(c); + } + { + nb::class_> c(m, "ScatteringPowerRegistry"); + c.def(nb::init()); + wrapObjRegistry(c); + } + { + nb::class_> c(m, "ScatteringPowerAtomRegistry"); + c.def(nb::init()); + wrapObjRegistry(c); + } + { + nb::class_> c(m, "ZAtomRegistry"); + c.def(nb::init()); + wrapObjRegistry(c); + } +} diff --git a/src/extensions/nb_polyhedron.cpp b/src/extensions/nb_polyhedron.cpp new file mode 100644 index 00000000..1eb680d8 --- /dev/null +++ b/src/extensions/nb_polyhedron.cpp @@ -0,0 +1,126 @@ +#include +#include +#include +#include +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +namespace { + +// All Make*() factory functions below take `const ScatteringPower*` +// arguments, but the values passed from Python are almost always +// ScatteringPowerAtom instances. ScatteringPowerAtom inherits VIRTUALLY from +// ScatteringPower (see ScatteringPower.h) and is therefore intentionally +// registered in nanobind WITHOUT a declared base (see +// nb_scatteringpoweratom.cpp) -- nanobind's automatic base<->derived pointer +// adjustment assumes a fixed, statically computable offset, which virtual +// inheritance does not provide. Left as a plain `const ScatteringPower*` +// parameter, nanobind refuses to accept a Python ScatteringPowerAtom +// instance there at all (TypeError). Resolve it manually: try the concrete +// registered type first (exact match, no offset needed), falling back to +// ScatteringPower directly. Mirrors getScatteringPowerPtr in nb_atom.cpp / +// extractScatteringPowerArg in nb_molecule.cpp. +const ScatteringPower* extractScatteringPowerArg(nb::object obj) +{ + if (obj.is_none()) return nullptr; + try { + return static_cast(&nb::cast(obj)); + } catch (...) {} + return &nb::cast(obj); +} + +Molecule* _MakeTetrahedron(Crystal& cryst, const std::string& name, + nb::object centralAtom, nb::object peripheralAtom, const REAL dist) +{ + return MakeTetrahedron(cryst, name, extractScatteringPowerArg(centralAtom), + extractScatteringPowerArg(peripheralAtom), dist); +} +Molecule* _MakeOctahedron(Crystal& cryst, const std::string& name, + nb::object centralAtom, nb::object peripheralAtom, const REAL dist) +{ + return MakeOctahedron(cryst, name, extractScatteringPowerArg(centralAtom), + extractScatteringPowerArg(peripheralAtom), dist); +} +Molecule* _MakeSquarePlane(Crystal& cryst, const std::string& name, + nb::object centralAtom, nb::object peripheralAtom, const REAL dist) +{ + return MakeSquarePlane(cryst, name, extractScatteringPowerArg(centralAtom), + extractScatteringPowerArg(peripheralAtom), dist); +} +Molecule* _MakeCube(Crystal& cryst, const std::string& name, + nb::object centralAtom, nb::object peripheralAtom, const REAL dist) +{ + return MakeCube(cryst, name, extractScatteringPowerArg(centralAtom), + extractScatteringPowerArg(peripheralAtom), dist); +} +Molecule* _MakeAntiPrismTetragonal(Crystal& cryst, const std::string& name, + nb::object centralAtom, nb::object peripheralAtom, const REAL dist) +{ + return MakeAntiPrismTetragonal(cryst, name, extractScatteringPowerArg(centralAtom), + extractScatteringPowerArg(peripheralAtom), dist); +} +Molecule* _MakePrismTrigonal(Crystal& cryst, const std::string& name, + nb::object centralAtom, nb::object peripheralAtom, const REAL dist) +{ + return MakePrismTrigonal(cryst, name, extractScatteringPowerArg(centralAtom), + extractScatteringPowerArg(peripheralAtom), dist); +} +Molecule* _MakeIcosahedron(Crystal& cryst, const std::string& name, + nb::object centralAtom, nb::object peripheralAtom, const REAL dist) +{ + return MakeIcosahedron(cryst, name, extractScatteringPowerArg(centralAtom), + extractScatteringPowerArg(peripheralAtom), dist); +} +Molecule* _MakeTriangle(Crystal& cryst, const std::string& name, + nb::object centralAtom, nb::object peripheralAtom, const REAL dist) +{ + return MakeTriangle(cryst, name, extractScatteringPowerArg(centralAtom), + extractScatteringPowerArg(peripheralAtom), dist); +} + +} // namespace + +void wrap_polyhedron(nb::module_& m) +{ + m.def("MakeTetrahedron", &_MakeTetrahedron, + nb::arg("cryst"), nb::arg("name"), nb::arg("centralAtom").none(), + nb::arg("peripheralAtom").none(), nb::arg("dist"), + nb::rv_policy::take_ownership); + + m.def("MakeOctahedron", &_MakeOctahedron, + nb::arg("cryst"), nb::arg("name"), nb::arg("centralAtom").none(), + nb::arg("peripheralAtom").none(), nb::arg("dist"), + nb::rv_policy::take_ownership); + + m.def("MakeSquarePlane", &_MakeSquarePlane, + nb::arg("cryst"), nb::arg("name"), nb::arg("centralAtom").none(), + nb::arg("peripheralAtom").none(), nb::arg("dist"), + nb::rv_policy::take_ownership); + + m.def("MakeCube", &_MakeCube, + nb::arg("cryst"), nb::arg("name"), nb::arg("centralAtom").none(), + nb::arg("peripheralAtom").none(), nb::arg("dist"), + nb::rv_policy::take_ownership); + + m.def("MakeAntiPrismTetragonal", &_MakeAntiPrismTetragonal, + nb::arg("cryst"), nb::arg("name"), nb::arg("centralAtom").none(), + nb::arg("peripheralAtom").none(), nb::arg("dist"), + nb::rv_policy::take_ownership); + + m.def("MakePrismTrigonal", &_MakePrismTrigonal, + nb::arg("cryst"), nb::arg("name"), nb::arg("centralAtom").none(), + nb::arg("peripheralAtom").none(), nb::arg("dist"), + nb::rv_policy::take_ownership); + + m.def("MakeIcosahedron", &_MakeIcosahedron, + nb::arg("cryst"), nb::arg("name"), nb::arg("centralAtom").none(), + nb::arg("peripheralAtom").none(), nb::arg("dist"), + nb::rv_policy::take_ownership); + + m.def("MakeTriangle", &_MakeTriangle, + nb::arg("cryst"), nb::arg("name"), nb::arg("centralAtom").none(), + nb::arg("peripheralAtom").none(), nb::arg("dist"), + nb::rv_policy::take_ownership); +} diff --git a/src/extensions/nb_powderpattern.cpp b/src/extensions/nb_powderpattern.cpp new file mode 100644 index 00000000..c694f650 --- /dev/null +++ b/src/extensions/nb_powderpattern.cpp @@ -0,0 +1,342 @@ +/* + * pyobjcryst nanobind port — PowderPattern, SPGScore, SpaceGroupExplorer bindings + */ + +#include +#include +#include + +#include +#include +#include +#include + +#undef B0 +#include +#include +#include + +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +struct PyPowderPattern : PowderPattern { + NB_TRAMPOLINE(PowderPattern, 1); + void UpdateDisplay() const override { NB_OVERRIDE(UpdateDisplay); } +}; + +namespace { + +PowderPattern* _CreatePowderPatternFromCIF_file(nb::object input) +{ + MuteObjCrystUserInfo muzzle; + CaptureStdOut gag; + std::string s = read_pyfile_to_string(input); + std::istringstream in(s); + ObjCryst::CIF cif(in); + int idx0 = gPowderPatternRegistry.GetNb(); + ObjCryst::PowderPattern* p = ObjCryst::CreatePowderPatternFromCIF(cif); + gag.release(); muzzle.release(); + if (gPowderPatternRegistry.GetNb() == idx0) + throw ObjCrystException("Cannot create powder pattern from CIF"); + return p; +} + +PowderPattern* _CreatePowderPatternFromCIF_obj(nb::object input, PowderPattern& pp) +{ + MuteObjCrystUserInfo muzzle; + CaptureStdOut gag; + std::string s = read_pyfile_to_string(input); + std::istringstream in(s); + ObjCryst::CIF cif(in); + bool import_ok = false; + for (auto& pos : cif.mvData) { + if (pos.second.mPowderPatternObs.size() > 10) { + pp.ImportPowderPatternCIF(cif); + import_ok = true; + break; + } + } + gag.release(); muzzle.release(); + if (!import_ok) + throw ObjCrystException("Cannot create powder pattern from CIF"); + return &pp; +} + +PowderPatternBackground& _addppbackground(PowderPattern& pp) +{ + PowderPatternBackground* ppc = new PowderPatternBackground(); + pp.AddPowderPatternComponent(*ppc); + return *ppc; +} + +// Ported forward from upstream main's fix (#94, src/extensions/powderpattern_ext.cpp +// commit 69e6239): guard against a crash when the new PowderPatternDiffraction has +// no reflections in the target 2theta window. Prepare against the target context +// before final registration so a no-reflections failure can't leave a broken +// partially-attached component behind, and roll back cleanly on any other +// Prepare() failure too. +PowderPatternDiffraction& _addppdiffraction(PowderPattern& pp, Crystal& crst) +{ + std::unique_ptr ppc(new PowderPatternDiffraction()); + ppc->SetCrystal(crst); + ppc->SetParentPowderPattern(pp); + ppc->GenHKLFullSpace(); + if (ppc->GetNbReflBelowMaxSinThetaOvLambda() == 0) + { + throw ObjCrystException( + "PowderPatternDiffraction::CalcSinThetaLambda(): there are no reflections!" + ); + } + pp.AddPowderPatternComponent(*ppc); + try + { + pp.Prepare(); + } + catch (...) + { + pp.RemovePowderPatternComponent(*ppc); + throw; + } + return *ppc.release(); +} + +void _setX(PowderPattern& pp, nb::object x) +{ + CrystVector_REAL cvx; + assignCrystVector(cvx, x); + pp.SetPowderPatternX(cvx); +} + +void _setObs(PowderPattern& pp, nb::object x) +{ + CrystVector_REAL cvx; + assignCrystVector(cvx, x); + MuteObjCrystUserInfo muzzle; + pp.SetPowderPatternObs(cvx); +} + +// Ported forward from upstream main (#84): GetPowderPatternObsSigma/ +// SetPowderPatternObsSigma were added after this branch's original fork. +void _setObsSigma(PowderPattern& pp, nb::object x) +{ + CrystVector_REAL cvx; + assignCrystVector(cvx, x); + pp.SetPowderPatternObsSigma(cvx); +} + +nb::object _FindPeaks(PowderPattern& pp, const float dmin, const float maxratio, + const unsigned int maxpeak, const bool verbose) +{ + CaptureStdOut gag; + if (verbose) gag.release(); + // PowderPattern::FindPeaks() returns a plain ObjCryst::PeakList by value, + // but nanobind only has a registered Python type for PeakListNB (see + // nb_indexing.cpp) -- returning PeakList directly fails with "Unable to + // convert function return value to a Python type!". wrap_peaklist() + // (declared in helpers_nb.hpp, defined in nb_indexing.cpp) does the + // PeakList -> PeakListNB -> Python conversion. + return wrap_peaklist(pp.FindPeaks(dmin, maxratio, maxpeak)); +} + +std::string __str__SPGScore(SPGScore& s) +{ + std::ostringstream oss; + if (s.ngof > 0.0001) + oss << s.hm << " nGoF=" << s.ngof << " GoF=" << s.gof << " Rw=" << s.rw; + else + oss << s.hm << " GoF=" << s.gof << " Rw=" << s.rw; + return oss.str(); +} + +nb::list _GetScores(const SpaceGroupExplorer& spgex) +{ + return containerToPyList(spgex.GetScores()); +} + +// PowderPattern::GetPowderPatternComponent() returns a generic +// PowderPatternComponent&, but the dynamic type is always one of the leaf +// classes (PowderPatternBackground, PowderPatternDiffraction, ...). +// PowderPatternComponent is itself a virtual base of RefinableObj, AND +// PowderPatternDiffraction inherits it virtually too -- nanobind's +// automatic polymorphic-return downcast relies on a base-offset table built +// from declared nb::class_ relationships, which is exactly +// wrong for virtual inheritance (§1 in nanobind_migration_notes.md). +// Concretely: PowderPatternDiffraction deliberately does NOT declare +// PowderPatternComponent as its nanobind base (see nb_powderpatterndiffraction.cpp), +// so nanobind has no offset path from PowderPatternComponent to +// PowderPatternDiffraction at all -- returning the base reference directly +// produced a different (and, once accessed, crashing) Python object than +// the one originally created by AddPowderPatternDiffraction(). Fix: resolve +// the concrete type by hand with a real dynamic_cast (RTTI, virtual-base +// safe) before handing nanobind an exact-type pointer, exactly like +// Crystal::GetScatteringPower()'s fix in nb_crystal.cpp. +nb::object wrapPowderPatternComponent(PowderPatternComponent& c, nb::handle parent) +{ + if (auto* d = dynamic_cast(&c)) + return nb::cast(d, nb::rv_policy::reference_internal, parent); + if (auto* b = dynamic_cast(&c)) + return nb::cast(b, nb::rv_policy::reference_internal, parent); + return nb::cast(&c, nb::rv_policy::reference_internal, parent); +} + +// Argument-direction mirror of the above, for GetScaleFactor(const +// PowderPatternComponent&) and friends: a Python PowderPatternDiffraction +// no longer declares PowderPatternComponent as a nanobind base (see above), +// so passing one where a plain PowderPatternComponent& is expected has no +// declared relationship for nanobind to use. Try the concrete leaf types +// first (exact match, no offset needed), falling back to the base. +PowderPatternComponent& extractPowderPatternComponentArg(nb::object obj) +{ + try { return nb::cast(obj); } catch (...) {} + try { return nb::cast(obj); } catch (...) {} + return nb::cast(obj); +} + +} // namespace + +void wrap_powderpattern(nb::module_& m) +{ + m.attr("gPowderPatternRegistry") = &gPowderPatternRegistry; + + nb::class_(m, "PowderPattern") + .def(nb::init<>()) + .def("AddPowderPatternBackground", &_addppbackground, + nb::rv_policy::reference_internal) + .def("AddPowderPatternDiffraction", &_addppdiffraction, + nb::keep_alive<1,2>(), nb::rv_policy::reference_internal) + .def("GetNbPowderPatternComponent", &PowderPattern::GetNbPowderPatternComponent) + .def("GetPowderPatternComponent", + [](nb::handle self, const int i) -> nb::object { + PowderPattern& pp = nb::cast(self); + return wrapPowderPatternComponent(pp.GetPowderPatternComponent(i), self); + }) + .def("FindPeaks", &_FindPeaks, + nb::arg("dmin") = 2.0f, nb::arg("maxratio") = 0.01f, + nb::arg("maxpeak") = 100u, nb::arg("verbose") = false) + .def("GetScaleFactor", + nb::overload_cast(&PowderPattern::GetScaleFactor, nb::const_)) + .def("GetScaleFactor", + [](PowderPattern& pp, nb::object comp) { + return pp.GetScaleFactor(extractPowderPatternComponentArg(comp)); + }) + .def("SetScaleFactor", + nb::overload_cast(&PowderPattern::SetScaleFactor)) + .def("SetPowderPatternPar", &PowderPattern::SetPowderPatternPar, + nb::arg("xmin"), nb::arg("xstep"), nb::arg("nbpoints")) + .def("SetPowderPatternX", &_setX, nb::arg("x")) + .def("GetPowderPatternCalc", + [](PowderPattern& p){ return crystvec_to_array(p.GetPowderPatternCalc()); }) + .def("GetPowderPatternObs", + [](PowderPattern& p){ return crystvec_to_array(p.GetPowderPatternObs()); }) + .def("GetPowderPatternObsSigma", + [](PowderPattern& p){ return crystvec_to_array(p.GetPowderPatternObsSigma()); }) + .def("GetPowderPatternX", + [](PowderPattern& p){ return crystvec_to_array(p.GetPowderPatternX()); }) + .def("GetNbPoint", &PowderPattern::GetNbPoint) + .def("GetNbPointUsed", &PowderPattern::GetNbPoint) + .def("GetRadiation", + nb::overload_cast<>(&PowderPattern::GetRadiation), + nb::rv_policy::reference_internal) + .def("GetRadiationType", &PowderPattern::GetRadiationType) + .def("SetRadiationType", &PowderPattern::SetRadiationType) + .def("GetWavelength", &PowderPattern::GetWavelength) + .def("SetWavelength", + nb::overload_cast(&PowderPattern::SetWavelength), + nb::arg("wavelength")) + .def("SetWavelength", + nb::overload_cast(&PowderPattern::SetWavelength), + nb::arg("XRayTubeElementName"), nb::arg("alpha2Alpha2ratio") = 0.5) + .def("SetEnergy", [](PowderPattern& pp, REAL energy_keV) { + // 12.398 angstrom*keV = hc + pp.SetWavelength(static_cast(12.398 / energy_keV)); + }, nb::arg("nrj_kev")) + .def("ImportPowderPatternFullprof", &PowderPattern::ImportPowderPatternFullprof, nb::arg("filename")) + .def("ImportPowderPatternPSI_DMC", &PowderPattern::ImportPowderPatternPSI_DMC, nb::arg("filename")) + .def("ImportPowderPatternILL_D1A5", &PowderPattern::ImportPowderPatternILL_D1A5, nb::arg("filename")) + .def("ImportPowderPatternXdd", &PowderPattern::ImportPowderPatternXdd, nb::arg("filename")) + .def("ImportPowderPatternSietronicsCPI", &PowderPattern::ImportPowderPatternSietronicsCPI, nb::arg("filename")) + .def("ImportPowderPattern2ThetaObsSigma",&PowderPattern::ImportPowderPattern2ThetaObsSigma, + nb::arg("filename"), nb::arg("nbSkip") = 0) + .def("ImportPowderPatternFullprof4", &PowderPattern::ImportPowderPatternFullprof4, nb::arg("filename")) + .def("ImportPowderPatternMultiDetectorLLBG42",&PowderPattern::ImportPowderPatternMultiDetectorLLBG42, nb::arg("filename")) + .def("ImportPowderPattern2ThetaObs", &PowderPattern::ImportPowderPattern2ThetaObs, + nb::arg("filename"), nb::arg("nbSkip") = 0) + .def("ImportPowderPatternTOF_ISIS_XYSigma",&PowderPattern::ImportPowderPatternTOF_ISIS_XYSigma, nb::arg("filename")) + .def("ImportPowderPatternGSAS", &PowderPattern::ImportPowderPatternGSAS, nb::arg("filename")) + .def("SetPowderPatternObs", &_setObs, nb::arg("obs")) + .def("SetPowderPatternObsSigma", &_setObsSigma, nb::arg("sigma")) + .def("FitScaleFactorForR", &PowderPattern::FitScaleFactorForR) + .def("FitScaleFactorForIntegratedR", &PowderPattern::FitScaleFactorForIntegratedR) + .def("FitScaleFactorForRw", &PowderPattern::FitScaleFactorForRw) + .def("FitScaleFactorForIntegratedRw", &PowderPattern::FitScaleFactorForIntegratedRw) + .def("SetMaxSinThetaOvLambda", &PowderPattern::SetMaxSinThetaOvLambda, nb::arg("max")) + .def("GetMaxSinThetaOvLambda", &PowderPattern::GetMaxSinThetaOvLambda) + .def("X2XCorr", &PowderPattern::X2XCorr) + .def("X2PixelCorr", &PowderPattern::X2PixelCorr) + .def("X2Pixel", &PowderPattern::X2Pixel) + .def("STOL2X", &PowderPattern::STOL2X) + .def("X2STOL", &PowderPattern::X2STOL) + .def("STOL2Pixel", &PowderPattern::STOL2Pixel) + .def("UpdateDisplay",&PowderPattern::UpdateDisplay) + .def("GetR", &PowderPattern::GetR) + .def("GetIntegratedR", &PowderPattern::GetIntegratedR) + .def("GetRw", &PowderPattern::GetRw) + .def("GetIntegratedRw", &PowderPattern::GetIntegratedRw) + .def("GetChi2", &PowderPattern::GetChi2) + .def("GetIntegratedChi2", &PowderPattern::GetIntegratedChi2) + .def("GetLogLikelihood", &PowderPattern::GetLogLikelihood) + .def("Prepare", &PowderPattern::Prepare) + .def_prop_rw("mur", &PowderPattern::GetMuR, &PowderPattern::SetMuR) + .def_prop_ro("r", &PowderPattern::GetR) + .def_prop_ro("r_integrated", &PowderPattern::GetIntegratedR) + .def_prop_ro("rw", &PowderPattern::GetRw) + .def_prop_ro("rw_integrated", &PowderPattern::GetIntegratedRw) + .def_prop_ro("chi2", &PowderPattern::GetChi2) + .def_prop_ro("chi2_integrated",&PowderPattern::GetIntegratedChi2) + .def_prop_ro("llk", &PowderPattern::GetLogLikelihood) + .def_prop_rw("wavelength", + &PowderPattern::GetWavelength, + nb::overload_cast(&PowderPattern::SetWavelength)) + ; + + nb::class_(m, "SPGScore") + .def(nb::init(), + nb::arg("hermann_mauguin"), nb::arg("rw"), nb::arg("gof"), + nb::arg("nbextinct"), nb::arg("ngof") = 0) + .def_ro("hermann_mauguin", &SPGScore::hm) + .def_ro("Rw", &SPGScore::rw) + .def_ro("GoF", &SPGScore::gof) + .def_ro("nGoF",&SPGScore::ngof) + .def("__str__", &__str__SPGScore) + .def("__repr__", &__str__SPGScore) + ; + + nb::class_(m, "SpaceGroupExplorer") + .def(nb::init(), + nb::arg("powdiff"), nb::keep_alive<1,2>()) + .def("Run", + nb::overload_cast( + &SpaceGroupExplorer::Run), + nb::arg("spg"), nb::arg("fitprofile") = false, nb::arg("verbose") = false, + nb::arg("restore_orig") = false, nb::arg("update_display") = false, + nb::arg("relative_length_tolerance") = (REAL)0.01, + nb::arg("absolute_angle_tolerance_degree") = (REAL)0.5) + .def("RunAll", &SpaceGroupExplorer::RunAll, + nb::arg("fitprofile_all") = false, nb::arg("verbose") = true, + nb::arg("keep_best") = true, nb::arg("update_display") = true, + nb::arg("fitprofile_p1") = true, + nb::arg("relative_length_tolerance") = 0.01, + nb::arg("absolute_angle_tolerance_degree") = 1) + .def("GetScores", &_GetScores) + ; + + m.def("CreatePowderPatternFromCIF", + [](nb::object input) { return _CreatePowderPatternFromCIF_file(input); }, + nb::arg("file"), nb::rv_policy::take_ownership); + m.def("CreatePowderPatternFromCIF", + [](nb::object input, PowderPattern& pp) { return _CreatePowderPatternFromCIF_obj(input, pp); }, + nb::arg("file"), nb::arg("powpat"), nb::rv_policy::take_ownership); +} diff --git a/src/extensions/nb_powderpatternbackground.cpp b/src/extensions/nb_powderpatternbackground.cpp new file mode 100644 index 00000000..29688c07 --- /dev/null +++ b/src/extensions/nb_powderpatternbackground.cpp @@ -0,0 +1,54 @@ +/* + * pyobjcryst nanobind port — PowderPatternBackground bindings + */ + +#include +#include + +#undef B0 +#include + +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +namespace { + +void _SetInterpPoints(PowderPatternBackground& b, nb::object tth, nb::object backgd) +{ + CrystVector_REAL cvtth, cvbackg; + assignCrystVector(cvtth, tth); + assignCrystVector(cvbackg, backgd); + b.SetInterpPoints(cvtth, cvbackg); +} + +void _OptimizeBayesianBackground(PowderPatternBackground& b, const bool verbose = false) +{ + CaptureStdOut gag; + if (verbose) gag.release(); + b.OptimizeBayesianBackground(); +} + +} // namespace + +void wrap_powderpatternbackground(nb::module_& m) +{ + m.attr("refpartype_scattdata_background") = gpRefParTypeScattDataBackground; + + nb::class_(m, "PowderPatternBackground") + .def("GetPowderPatternCalc", + [](PowderPatternBackground& b){ return crystvec_to_array(b.GetPowderPatternCalc()); }) + .def("ImportUserBackground", &PowderPatternBackground::ImportUserBackground, + nb::arg("filename")) + .def("SetInterpPoints", &_SetInterpPoints, nb::arg("tth"), nb::arg("backgd")) + .def("GetInterpPointsX", + [](PowderPatternBackground& b){ return crystvec_to_array(*b.GetInterpPoints().first); }) + .def("GetInterpPointsY", + [](PowderPatternBackground& b){ return crystvec_to_array(*b.GetInterpPoints().second); }) + .def("OptimizeBayesianBackground", &_OptimizeBayesianBackground, + nb::arg("verbose") = false) + .def("FixParametersBeyondMaxresolution", + &PowderPatternBackground::FixParametersBeyondMaxresolution, nb::arg("obj")) + ; +} diff --git a/src/extensions/nb_powderpatterncomponent.cpp b/src/extensions/nb_powderpatterncomponent.cpp new file mode 100644 index 00000000..42a4addb --- /dev/null +++ b/src/extensions/nb_powderpatterncomponent.cpp @@ -0,0 +1,56 @@ +/* + * pyobjcryst nanobind port — PowderPatternComponent bindings + */ + +#include +#include + +#undef B0 +#include +#include + +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +// PowderPatternComponent : virtual public RefinableObj (see PowderPattern.h) +// -- registered standalone (no declared nanobind base), per the virtual +// inheritance pattern documented in nanobind_migration_notes.md §1. Base +// RefinableObj methods needed by callers (e.g. PowderPatternBackground's +// UnFixAllPar(), used from the Python-layer quick_fit_profile()) must be +// rebound explicitly here via static_cast, not inherited. Any class that +// safely nanobind-inherits PowderPatternComponent (i.e. via a non-virtual +// link -- see PowderPatternBackground) picks these up automatically; +// PowderPatternDiffraction inherits PowderPatternComponent virtually and +// therefore repeats the same rebinding itself (see nb_powderpatterndiffraction.cpp). +void wrap_powderpatterncomponent(nb::module_& m) +{ + nb::class_ cls(m, "PowderPatternComponent"); + cls + .def("GetParentPowderPattern", + nb::overload_cast<>(&PowderPatternComponent::GetParentPowderPattern), + nb::rv_policy::reference_internal) + .def("GetName", [](PowderPatternComponent& c) -> std::string { + return static_cast(c).GetName(); }) + .def("SetName", [](PowderPatternComponent& c, const std::string& n) { + static_cast(c).SetName(n); }) + .def("GetClassName", [](PowderPatternComponent& c) -> std::string { + return static_cast(c).GetClassName(); }) + .def("FixAllPar", [](PowderPatternComponent& c) { static_cast(c).FixAllPar(); }) + .def("UnFixAllPar", [](PowderPatternComponent& c) { static_cast(c).UnFixAllPar(); }) + ; + + // Restore the rest of RefinableObj's method surface (XMLOutput, + // BeginOptimization, GetLogLikelihood, AddPar, CreateParamSet, + // GetOption, UpdateDisplay, ... -- only GetName/SetName/GetClassName/ + // FixAllPar/UnFixAllPar were covered one-off above). See helpers_nb.hpp + // for why this is safe despite PowderPatternComponent's virtual + // inheritance of RefinableObj. Covers PowderPatternBackground + // automatically (non-virtual inheritance, already correctly declared as + // its nanobind base). PowderPatternDiffraction inherits + // PowderPatternComponent virtually too, but already gets this same + // surface via its (non-virtual) ScatteringData base once + // nb_scatteringdata.cpp's copy is applied, so it needs no separate call. + bind_refinableobj_forwarding(cls); +} diff --git a/src/extensions/nb_powderpatterndiffraction.cpp b/src/extensions/nb_powderpatterndiffraction.cpp new file mode 100644 index 00000000..460a4fe8 --- /dev/null +++ b/src/extensions/nb_powderpatterndiffraction.cpp @@ -0,0 +1,89 @@ +/* + * pyobjcryst nanobind port — PowderPatternDiffraction bindings + */ + +#include +#include + +#include + +#undef B0 +#include +#include +#include + +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +void wrap_powderpatterndiffraction(nb::module_& m) +{ + nb::enum_(m, "ReflectionProfileType") + .value("PROFILE_GAUSSIAN", PROFILE_GAUSSIAN) + .value("PROFILE_LORENTZIAN", PROFILE_LORENTZIAN) + .value("PROFILE_PSEUDO_VOIGT",PROFILE_PSEUDO_VOIGT) + .value("PROFILE_PSEUDO_VOIGT_FINGER_COX_JEPHCOAT", + PROFILE_PSEUDO_VOIGT_FINGER_COX_JEPHCOAT) + .value("PROFILE_PEARSON_VII", PROFILE_PEARSON_VII) + .export_values() + ; + + // PowderPatternDiffraction : virtual public PowderPatternComponent, + // public ScatteringData + // (see PowderPattern.h). The link to PowderPatternComponent is VIRTUAL + // -- declaring it as the nanobind base here (as an earlier version of + // this file did) computes a wrong pointer offset (§1 in + // nanobind_migration_notes.md), which is exactly the bug class that + // caused the Crystal.GetScatteringPower() segfault elsewhere in this + // migration. The link to ScatteringData is a plain (non-virtual) single + // base, so it is the one declared here; ScatteringData is already + // registered standalone in nb_scatteringdata.cpp and brings GetCrystal(), + // GetNbRefl(), and friends along automatically. PowderPatternComponent's + // GetParentPowderPattern() and the RefinableObj methods reachable only + // via the (now-undeclared) virtual base are rebound explicitly below, + // mirroring nb_powderpatterncomponent.cpp. + nb::class_( + m, "PowderPatternDiffraction") + .def("GetParentPowderPattern", + [](PowderPatternDiffraction& d) -> PowderPattern& { + return static_cast(d).GetParentPowderPattern(); }, + nb::rv_policy::reference_internal) + .def("GetName", [](PowderPatternDiffraction& d) -> std::string { + return static_cast(d).GetName(); }) + .def("SetName", [](PowderPatternDiffraction& d, const std::string& n) { + static_cast(d).SetName(n); }) + .def("GetClassName", [](PowderPatternDiffraction& d) -> std::string { + return static_cast(d).GetClassName(); }) + .def("FixAllPar", [](PowderPatternDiffraction& d) { static_cast(d).FixAllPar(); }) + .def("UnFixAllPar", [](PowderPatternDiffraction& d) { static_cast(d).UnFixAllPar(); }) + .def("GetPowderPatternCalc", + [](PowderPatternDiffraction& d){ return crystvec_to_array(d.GetPowderPatternCalc()); }) + .def("SetReflectionProfilePar", + &PowderPatternDiffraction::SetReflectionProfilePar, + nb::arg("type") = PROFILE_PSEUDO_VOIGT, + nb::arg("fwhmCagliotiW") = 1e-6, + nb::arg("fwhmCagliotiU") = 0, + nb::arg("fwhmCagliotiV") = 0, + nb::arg("eta0") = 0.5, + nb::arg("eta1") = 0) + .def("GetProfile", + nb::overload_cast<>(&PowderPatternDiffraction::GetProfile), + nb::rv_policy::reference_internal) + .def("SetExtractionMode", + &PowderPatternDiffraction::SetExtractionMode, + nb::arg("extract") = true, nb::arg("init") = false) + .def("GetExtractionMode", + &PowderPatternDiffraction::GetExtractionMode) + .def("ExtractLeBail", + &PowderPatternDiffraction::ExtractLeBail, + nb::arg("nbcycle") = 1) + .def("SetCrystal", + &PowderPatternDiffraction::SetCrystal, + nb::arg("crystal"), nb::keep_alive<1,2>()) + .def("GetNbReflBelowMaxSinThetaOvLambda", + &PowderPatternDiffraction::GetNbReflBelowMaxSinThetaOvLambda) + .def("GetFhklObsSq", + [](PowderPatternDiffraction& d){ return crystvec_to_array(d.GetFhklObsSq()); }) + ; +} diff --git a/src/extensions/nb_quaternion.cpp b/src/extensions/nb_quaternion.cpp new file mode 100644 index 00000000..91ad74e6 --- /dev/null +++ b/src/extensions/nb_quaternion.cpp @@ -0,0 +1,54 @@ +/* + * pyobjcryst nanobind port — Quaternion bindings + */ + +#include +#include + +#undef B0 +#include +#include + +namespace nb = nanobind; +using namespace ObjCryst; + +namespace { + +nb::tuple _RotateVector(const Quaternion& q, double v1, double v2, double v3) +{ + REAL rv1 = v1, rv2 = v2, rv3 = v3; + q.RotateVector(rv1, rv2, rv3); + return nb::make_tuple((double)rv1, (double)rv2, (double)rv3); +} + +} // namespace + +void wrap_quaternion(nb::module_& m) +{ + nb::class_(m, "Quaternion") + .def(nb::init(), + nb::arg("q0"), nb::arg("q1"), nb::arg("q2"), nb::arg("q3"), + nb::arg("unit") = true) + .def("GetConjugate", &Quaternion::GetConjugate) + .def("RotateVector", &_RotateVector, + nb::arg("v1"), nb::arg("v2"), nb::arg("v3")) + .def("Normalize", &Quaternion::Normalize) + .def("GetNorm", &Quaternion::GetNorm) + .def_static("RotationQuaternion", &Quaternion::RotationQuaternion, + nb::arg("ang"), nb::arg("v1"), nb::arg("v2"), nb::arg("v3")) + .def_prop_rw("Q0", + [](const Quaternion& q){ return (double)q.Q0(); }, + [](Quaternion& q, double v){ q.Q0() = static_cast(v); }) + .def_prop_rw("Q1", + [](const Quaternion& q){ return (double)q.Q1(); }, + [](Quaternion& q, double v){ q.Q1() = static_cast(v); }) + .def_prop_rw("Q2", + [](const Quaternion& q){ return (double)q.Q2(); }, + [](Quaternion& q, double v){ q.Q2() = static_cast(v); }) + .def_prop_rw("Q3", + [](const Quaternion& q){ return (double)q.Q3(); }, + [](Quaternion& q, double v){ q.Q3() = static_cast(v); }) + .def("__mul__", [](const Quaternion& a, const Quaternion& b){ return a * b; }) + .def("__imul__", [](Quaternion& a, const Quaternion& b) -> Quaternion& { a *= b; return a; }) + ; +} diff --git a/src/extensions/nb_radiation.cpp b/src/extensions/nb_radiation.cpp new file mode 100644 index 00000000..37c8d525 --- /dev/null +++ b/src/extensions/nb_radiation.cpp @@ -0,0 +1,47 @@ +/* + * pyobjcryst nanobind port — Radiation bindings + */ + +#include +#include + +#include + +namespace nb = nanobind; +using namespace ObjCryst; + +namespace { +double _GetWavelength(Radiation& r) { return r.GetWavelength()(0); } +} // namespace + +void wrap_radiation(nb::module_& m) +{ + nb::class_(m, "Radiation") + .def(nb::init<>()) + .def("SetRadiationType", &Radiation::SetRadiationType) + .def("GetRadiationType", &Radiation::GetRadiationType) + .def("SetWavelengthType", &Radiation::SetWavelengthType) + .def("GetWavelengthType", &Radiation::GetWavelengthType) + .def("GetWavelength", &_GetWavelength) + .def("SetWavelength", + nb::overload_cast(&Radiation::SetWavelength)) + .def("SetWavelength", + nb::overload_cast(&Radiation::SetWavelength), + nb::arg("XRayTubeElementName"), nb::arg("alpha2Alpha2ratio") = 0.5) + .def("GetXRayTubeDeltaLambda", &Radiation::GetXRayTubeDeltaLambda) + .def("GetXRayTubeAlpha2Alpha1Ratio",&Radiation::GetXRayTubeAlpha2Alpha1Ratio) + // Ported forward from upstream main (closes diffpy/pyobjcryst#38): + // LinearPolarRate accessors and clock accessors, added after this + // branch's original fork. No LIBOBJCRYST_VERSION guard needed here + // (unlike main's version) since we vendor the ObjCryst++ source + // directly rather than depending on an externally-installed version. + .def("GetLinearPolarRate", &Radiation::GetLinearPolarRate) + .def("SetLinearPolarRate", &Radiation::SetLinearPolarRate) + .def("GetClockWavelength", + &Radiation::GetClockWavelength, nb::rv_policy::reference_internal) + .def("GetClockRadiation", + &Radiation::GetClockRadiation, nb::rv_policy::reference_internal) + .def("GetClockLinearPolarRate", + &Radiation::GetClockLinearPolarRate, nb::rv_policy::reference_internal) + ; +} diff --git a/src/extensions/nb_refinableobj.cpp b/src/extensions/nb_refinableobj.cpp new file mode 100644 index 00000000..4bdb782a --- /dev/null +++ b/src/extensions/nb_refinableobj.cpp @@ -0,0 +1,297 @@ +/* + * pyobjcryst nanobind port — RefinableObj bindings + * + * Changes from ObjCryst::RefinableObj: + * - XMLOutput and XMLInput accept python file-like objects or strings + * - SetDeleteRefParInDestructor(false) called in constructors + * - GetParamSet returns a copy + * - RemovePar returns None + */ + +#include +#include +#include +#include + +#include +#include + +#include +#include + +// Extra headers needed only for extractRefinableObjArg()'s fallback chain +// (see helpers_nb.hpp) -- every concrete class that virtually inherits +// RefinableObj and is therefore unreachable from it via nanobind's own +// mechanism. +#undef B0 +#include +#include +#include +#include + +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +// --------------------------------------------------------------------------- +// Trampoline for RefinableObj virtual methods +// --------------------------------------------------------------------------- +struct PyRefinableObj : RefinableObj { + NB_TRAMPOLINE(RefinableObj, 14); + + // Note: GetClassName() and GetName() return const string& which can't be overridden + // via NB_OVERRIDE (returns temporary). Subclasses should use SetName instead. + void SetName(const std::string& n) override { NB_OVERRIDE(SetName, n); } + void Print() const override { NB_OVERRIDE(Print); } + void RegisterClient(RefinableObj& c) const override { NB_OVERRIDE(RegisterClient, c); } + void DeRegisterClient(RefinableObj& c) const override { NB_OVERRIDE(DeRegisterClient, c); } + ObjRegistry& GetClientRegistry() override { NB_OVERRIDE(GetClientRegistry); } + void BeginOptimization(const bool approx, const bool restr) override { + NB_OVERRIDE(BeginOptimization, approx, restr); + } + void EndOptimization() override { NB_OVERRIDE(EndOptimization); } + void RandomizeConfiguration() override { NB_OVERRIDE(RandomizeConfiguration); } + void GlobalOptRandomMove(const REAL amp, const RefParType* type) override { + NB_OVERRIDE(GlobalOptRandomMove, amp, type); + } + REAL GetLogLikelihood() const override { NB_OVERRIDE(GetLogLikelihood); } + unsigned int GetNbLSQFunction() const override { NB_OVERRIDE(GetNbLSQFunction); } + void UpdateDisplay() const override { NB_OVERRIDE(UpdateDisplay); } + REAL GetRestraintCost() const override { NB_OVERRIDE(GetRestraintCost); } +}; + +// --------------------------------------------------------------------------- +// Helper wrappers +// --------------------------------------------------------------------------- +namespace { + +void _AddPar(RefinableObj& obj, RefinablePar* p) +{ + obj.AddPar(p); + obj.SetDeleteRefParInDestructor(0); +} + +void _AddParObj(RefinableObj& obj, nb::object o, const bool copyParam = false) +{ + obj.AddPar(extractRefinableObjArg(o), copyParam); + obj.SetDeleteRefParInDestructor(0); +} + +RefinablePar& _GetParLong(RefinableObj& obj, const long i) +{ + obj.SetDeleteRefParInDestructor(0); + return obj.GetPar(i); +} + +RefinablePar& _GetParString(RefinableObj& obj, const std::string& s) +{ + obj.SetDeleteRefParInDestructor(0); + return obj.GetPar(s); +} + +RefinablePar& _GetParNotFixed(RefinableObj& obj, const long i) +{ + obj.SetDeleteRefParInDestructor(0); + return obj.GetParNotFixed(i); +} + +void _RemovePar(RefinableObj& obj, RefinablePar* p) { obj.RemovePar(p); } + +std::string _xml(const RefinableObj& r) +{ + std::stringstream s; + r.XMLOutput(s, 0); + return s.str(); +} + +void _XMLOutput(const RefinableObj& r, nb::object output, int indent = 0) +{ + std::ostringstream os; + os.precision(doublelim::digits10); + r.XMLOutput(os, indent); + output.attr("write")(os.str()); +} + +void _XMLInput(RefinableObj& r, nb::object input, XMLCrystTag& tag) +{ + std::string s = read_pyfile_to_string(input); + std::istringstream is(s); + r.XMLInput(is, tag); +} + +void _XMLInputString(RefinableObj& r, const std::string& s) +{ + std::istringstream ss(s); + ss.imbue(std::locale::classic()); + XMLCrystTag tag; + ss >> tag; + r.XMLInput(ss, tag); +} + +// Return CrystVector as a numpy array copy +nb_array_1d _GetParamSet(const RefinableObj& obj, const unsigned long id) +{ + return crystvec_to_array(obj.GetParamSet(id)); +} + +} // namespace + +// External-linkage helper declared in helpers_nb.hpp -- see the comment +// there for why this is needed and why it lives here. +RefinableObj& extractRefinableObjArg(nb::object obj) +{ + // Safe/declared path first: works for anything reaching RefinableObj + // through a non-virtual chain (Crystal, UnitCell, Molecule, Atom, + // PowderPattern, MonteCarloObj, LSQNumObj, ...). + try { return nb::cast(obj); } catch (...) {} + // Known classes that virtually inherit RefinableObj (directly or via an + // intermediate virtual base) and are therefore registered in nanobind + // without a declared path to it -- try each concrete/intermediate type, + // then bridge with a real (always-correct) static_cast. + try { return static_cast(nb::cast(obj)); } catch (...) {} + try { return static_cast(nb::cast(obj)); } catch (...) {} + try { return static_cast(nb::cast(obj)); } catch (...) {} + try { return static_cast(nb::cast(obj)); } catch (...) {} + try { return static_cast(nb::cast(obj)); } catch (...) {} + // Nothing matched -- let this raise a clear nanobind TypeError rather + // than silently returning a dangling reference. + return nb::cast(obj); +} + +void wrap_refinableobj(nb::module_& m) +{ + m.attr("refpartype_objcryst") = gpRefParTypeObjCryst; + m.attr("gRefinableObjRegistry") = &gRefinableObjRegistry; + m.attr("gTopRefinableObjRegistry") = &gTopRefinableObjRegistry; + + nb::class_(m, "RefinableObj") + .def(nb::init<>()) + .def(nb::init()) + /* Parameter management */ + .def("PrepareForRefinement", &RefinableObj::PrepareForRefinement) + .def("FixAllPar", &RefinableObj::FixAllPar) + .def("UnFixAllPar", &RefinableObj::UnFixAllPar) + .def("SetParIsFixed", + nb::overload_cast(&RefinableObj::SetParIsFixed)) + .def("SetParIsFixed", + nb::overload_cast(&RefinableObj::SetParIsFixed)) + .def("SetParIsFixed", + nb::overload_cast(&RefinableObj::SetParIsFixed)) + .def("SetParIsUsed", + nb::overload_cast(&RefinableObj::SetParIsUsed)) + .def("SetParIsUsed", + nb::overload_cast(&RefinableObj::SetParIsUsed)) + .def("GetNbPar", &RefinableObj::GetNbPar) + .def("GetNbParNotFixed", &RefinableObj::GetNbParNotFixed) + .def("GetPar", + &_GetParLong, nb::rv_policy::reference_internal) + .def("GetPar", + &_GetParString, nb::rv_policy::reference_internal) + .def("GetParNotFixed", &_GetParNotFixed, nb::rv_policy::reference_internal) + .def("AddPar", &_AddPar, nb::arg("par"), nb::keep_alive<1,2>()) + .def("AddPar", &_AddParObj, nb::arg("newRefParList"), nb::arg("copyParam") = false, + nb::keep_alive<1,2>()) + .def("RemovePar", &_RemovePar) + /* Parameter sets */ + .def("CreateParamSet", &RefinableObj::CreateParamSet, + nb::arg("name") = "") + .def("ClearParamSet", &RefinableObj::ClearParamSet) + .def("SaveParamSet", &RefinableObj::SaveParamSet) + .def("RestoreParamSet",&RefinableObj::RestoreParamSet) + .def("GetParamSet", &_GetParamSet) + .def("GetParamSet_ParNotFixedHumanValue", + &RefinableObj::GetParamSet_ParNotFixedHumanValue) + .def("EraseAllParamSet", [](RefinableObj& obj){ obj.EraseAllParamSet(); }) + .def("GetParamSetName",&RefinableObj::GetParamSetName) + /* Limits */ + .def("SetLimitsAbsolute", + nb::overload_cast( + &RefinableObj::SetLimitsAbsolute)) + .def("SetLimitsAbsolute", + nb::overload_cast( + &RefinableObj::SetLimitsAbsolute)) + .def("SetLimitsRelative", + nb::overload_cast( + &RefinableObj::SetLimitsRelative)) + .def("SetLimitsRelative", + nb::overload_cast( + &RefinableObj::SetLimitsRelative)) + .def("SetLimitsProportional", + nb::overload_cast( + &RefinableObj::SetLimitsProportional)) + .def("SetLimitsProportional", + nb::overload_cast( + &RefinableObj::SetLimitsProportional)) + .def("SetGlobalOptimStep", &RefinableObj::SetGlobalOptimStep) + /* Registries / sub-objects */ + .def("GetSubObjRegistry", + nb::overload_cast<>(&RefinableObj::GetSubObjRegistry), + nb::rv_policy::reference_internal) + .def("GetClientRegistry", + nb::overload_cast<>(&RefinableObj::GetClientRegistry), + nb::rv_policy::reference_internal) + .def("GetOptionList", &RefinableObj::GetOptionList, + nb::rv_policy::reference) + .def("GetNbOption", &RefinableObj::GetNbOption) + .def("GetOption", + nb::overload_cast(&RefinableObj::GetOption), + nb::rv_policy::reference_internal) + /* State */ + .def("IsBeingRefined", &RefinableObj::IsBeingRefined) + .def("BeginGlobalOptRandomMove",&RefinableObj::BeginGlobalOptRandomMove) + .def("ResetParList", &RefinableObj::ResetParList) + .def("GetRefParListClock", &RefinableObj::GetRefParListClock, + nb::rv_policy::reference_internal) + .def("GetClockMaster", &RefinableObj::GetClockMaster, + nb::rv_policy::reference_internal) + .def("AddRestraint", &RefinableObj::AddRestraint, nb::keep_alive<1,2>()) + .def("RemoveRestraint",&RefinableObj::RemoveRestraint) + /* Virtual methods */ + .def("GetClassName", &RefinableObj::GetClassName) + .def("GetName", &RefinableObj::GetName) + .def("SetName", &RefinableObj::SetName) + .def("Print", &RefinableObj::Print) + .def("RegisterClient", &RefinableObj::RegisterClient, + nb::keep_alive<1,2>()) + .def("DeRegisterClient",&RefinableObj::DeRegisterClient) + .def("BeginOptimization",&RefinableObj::BeginOptimization, + nb::arg("allowApproximations") = false, + nb::arg("enableRestraints") = false) + .def("EndOptimization", &RefinableObj::EndOptimization) + .def("RandomizeConfiguration",&RefinableObj::RandomizeConfiguration) + .def("GlobalOptRandomMove", &RefinableObj::GlobalOptRandomMove, + nb::arg("mutationAmplitude"), + nb::arg("type") = gpRefParTypeObjCryst) + .def("GetLogLikelihood", &RefinableObj::GetLogLikelihood) + .def("GetNbLSQFunction", &RefinableObj::GetNbLSQFunction) + // LSQ-target extensibility API -- lets a Python subclass supply a + // custom least-squares objective (data/weights/derivatives). Ported + // forward from Boost.Python (missing from the initial nanobind + // port); returns numpy arrays like every other CrystVector-returning + // method here. + .def("GetLSQCalc", [](RefinableObj& o, unsigned int i){ + return crystvec_to_array(o.GetLSQCalc(i)); }, + nb::arg("idx")) + .def("GetLSQObs", [](RefinableObj& o, unsigned int i){ + return crystvec_to_array(o.GetLSQObs(i)); }, + nb::arg("idx")) + .def("GetLSQWeight", [](RefinableObj& o, unsigned int i){ + return crystvec_to_array(o.GetLSQWeight(i)); }, + nb::arg("idx")) + .def("GetLSQDeriv", [](RefinableObj& o, unsigned int i, RefinablePar& p){ + return crystvec_to_array(o.GetLSQDeriv(i, p)); }, + nb::arg("idx"), nb::arg("par")) + .def("UpdateDisplay", &RefinableObj::UpdateDisplay) + .def("GetRestraintCost", &RefinableObj::GetRestraintCost) + .def("TagNewBestConfig", &RefinableObj::TagNewBestConfig) + /* XML I/O */ + .def("XMLOutput", &_XMLOutput, nb::arg("file"), nb::arg("indent") = 0) + .def("xml", &_xml) + .def("XMLInput", &_XMLInput, nb::arg("file"), nb::arg("tag")) + .def("XMLInput", &_XMLInputString, nb::arg("xml")) + .def("GetGeneGroup",&RefinableObj::GetGeneGroup) + .def("int_ptr", &RefinableObj::int_ptr) + .def("__str__", [](const RefinableObj& obj){ return obj_str(obj); }) + ; +} diff --git a/src/extensions/nb_refinableobjclock.cpp b/src/extensions/nb_refinableobjclock.cpp new file mode 100644 index 00000000..968e1c79 --- /dev/null +++ b/src/extensions/nb_refinableobjclock.cpp @@ -0,0 +1,36 @@ +/* + * pyobjcryst nanobind port — RefinableObjClock bindings + */ + +#include +#include +#include + +#include + +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +void wrap_refinableobjclock(nb::module_& m) +{ + nb::class_(m, "RefinableObjClock", + "Internal clock used by ObjCryst++ to track modification times.") + .def(nb::init<>()) + .def("AddChild", &RefinableObjClock::AddChild, nb::keep_alive<1,2>()) + .def("AddParent", &RefinableObjClock::AddParent, nb::keep_alive<1,2>()) + .def("Click", &RefinableObjClock::Click) + .def("Print", &RefinableObjClock::Print) + .def("PrintStatic",&RefinableObjClock::PrintStatic) + .def("RemoveChild",&RefinableObjClock::RemoveChild) + .def("RemoveParent",&RefinableObjClock::RemoveParent) + .def("Reset", &RefinableObjClock::Reset) + .def("SetEqual", [](RefinableObjClock& c1, const RefinableObjClock& c2){ c1 = c2; }) + .def("__lt__", [](const RefinableObjClock& a, const RefinableObjClock& b){ return a < b; }) + .def("__le__", [](const RefinableObjClock& a, const RefinableObjClock& b){ return a <= b; }) + .def("__gt__", [](const RefinableObjClock& a, const RefinableObjClock& b){ return a > b; }) + .def("__ge__", [](const RefinableObjClock& a, const RefinableObjClock& b){ return a >= b; }) + .def("__str__", [](const RefinableObjClock& c){ return obj_str(c); }) + ; +} diff --git a/src/extensions/nb_refinablepar.cpp b/src/extensions/nb_refinablepar.cpp new file mode 100644 index 00000000..a09adab7 --- /dev/null +++ b/src/extensions/nb_refinablepar.cpp @@ -0,0 +1,123 @@ +/* + * pyobjcryst nanobind port — RefinablePar bindings + */ + +#include +#include + +#include + +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +namespace { + +// Wrapper to store the double value alongside the parameter +class PyRefinablePar : public RefinablePar +{ +public: + PyRefinablePar() : RefinablePar(), pval(nullptr) {} + + PyRefinablePar(const std::string& name, double value, + const double min, const double max, + const RefParType* type, + RefParDerivStepModel derivMode = REFPAR_DERIV_STEP_RELATIVE, + const bool hasLimits = true, + const bool isFixed = false, + const bool isUsed = true, + const bool isPeriodic = false, + const REAL humanScale = 1., + REAL period = 1.) + : RefinablePar() + { + pval = new REAL(static_cast(value)); + RefinablePar::Init(name, pval, min, max, type, derivMode, + hasLimits, isFixed, isUsed, isPeriodic, humanScale, period); + } + + ~PyRefinablePar() + { + delete pval; + } + +private: + REAL* pval; +}; + +} // namespace + +void wrap_refinablepar(nb::module_& m) +{ + nb::enum_(m, "RefParDerivStepModel") + .value("REFPAR_DERIV_STEP_ABSOLUTE", REFPAR_DERIV_STEP_ABSOLUTE) + .value("REFPAR_DERIV_STEP_RELATIVE", REFPAR_DERIV_STEP_RELATIVE) + .export_values() + ; + + // C++-created RefinablePar (no init from python) + nb::class_(m, "_RefinablePar") + .def("GetValue", &RefinablePar::GetValue) + .def("SetValue", &RefinablePar::SetValue) + .def("GetHumanValue", &RefinablePar::GetHumanValue) + .def("SetHumanValue", &RefinablePar::SetHumanValue) + .def("Mutate", &RefinablePar::Mutate) + .def("MutateTo", &RefinablePar::MutateTo) + .def("GetSigma", &RefinablePar::GetSigma) + .def("GetHumanSigma", &RefinablePar::GetHumanSigma) + .def("SetSigma", &RefinablePar::SetSigma) + .def("GetName", &RefinablePar::GetName) + .def("SetName", &RefinablePar::SetName) + .def("Print", &RefinablePar::Print) + .def("IsFixed", &RefinablePar::IsFixed) + .def("SetIsFixed", &RefinablePar::SetIsFixed) + .def("IsLimited", &RefinablePar::IsLimited) + .def("SetIsLimited",&RefinablePar::SetIsLimited) + .def("IsUsed", &RefinablePar::IsUsed) + .def("SetIsUsed", &RefinablePar::SetIsUsed) + .def("IsPeriodic", &RefinablePar::IsPeriodic) + .def("SetIsPeriodic",&RefinablePar::SetIsPeriodic) + .def("GetHumanScale",&RefinablePar::GetHumanScale) + .def("SetHumanScale",&RefinablePar::SetHumanScale) + .def("GetMin", &RefinablePar::GetMin) + .def("SetMin", &RefinablePar::SetMin) + .def("GetHumanMin",&RefinablePar::GetHumanMin) + .def("SetHumanMin",&RefinablePar::SetHumanMin) + .def("GetMax", &RefinablePar::GetMax) + .def("SetMax", &RefinablePar::SetMax) + .def("GetHumanMax",&RefinablePar::GetHumanMax) + .def("SetHumanMax",&RefinablePar::SetHumanMax) + .def("GetPeriod", &RefinablePar::GetPeriod) + .def("SetPeriod", &RefinablePar::SetPeriod) + .def("GetDerivStep",&RefinablePar::GetDerivStep) + .def("SetDerivStep",&RefinablePar::SetDerivStep) + .def("GetGlobalOptimStep",&RefinablePar::GetGlobalOptimStep) + .def("SetGlobalOptimStep",&RefinablePar::SetGlobalOptimStep) + .def("AssignClock",&RefinablePar::AssignClock) + .def("SetLimitsAbsolute",&RefinablePar::SetLimitsAbsolute) + .def("SetLimitsRelative",&RefinablePar::SetLimitsRelative) + .def("SetLimitsProportional",&RefinablePar::SetLimitsProportional) + .def("GetType", &RefinablePar::GetType, nb::rv_policy::reference_internal) + .def("__str__", [](const RefinablePar& p){ return obj_str(p); }) + .def_prop_rw("value", &RefinablePar::GetValue, &RefinablePar::SetValue) + ; + + // Python-created RefinablePar + nb::class_(m, "RefinablePar") + .def(nb::init(), + nb::arg("name"), nb::arg("value"), nb::arg("min"), nb::arg("max"), + nb::arg("type"), + nb::arg("derivMode") = REFPAR_DERIV_STEP_RELATIVE, + nb::arg("hasLimits") = true, + nb::arg("isFixed") = false, + nb::arg("isUsed") = true, + nb::arg("isPeriodic") = false, + nb::arg("humanScale") = 1., + nb::arg("period") = 1., + nb::keep_alive<1, 6>()) + ; +} diff --git a/src/extensions/nb_reflectionprofile.cpp b/src/extensions/nb_reflectionprofile.cpp new file mode 100644 index 00000000..6952c2be --- /dev/null +++ b/src/extensions/nb_reflectionprofile.cpp @@ -0,0 +1,97 @@ +/* + * pyobjcryst nanobind port — ReflectionProfile bindings + */ + +#include +#include +#include + +#include + +#undef B0 +#include +#include + +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +struct PyReflectionProfile : ReflectionProfile { + NB_TRAMPOLINE(ReflectionProfile, 5); + + ReflectionProfile* CreateCopy() const override { + NB_OVERRIDE_PURE(CreateCopy); + } + CrystVector_REAL GetProfile(const CrystVector_REAL& x, const REAL xcenter, + const REAL h, const REAL k, const REAL l) const override { + NB_OVERRIDE_PURE(GetProfile, x, xcenter, h, k, l); + } + REAL GetFullProfileWidth(const REAL relInt, const REAL xcenter, + const REAL h, const REAL k, const REAL l) override { + NB_OVERRIDE_PURE(GetFullProfileWidth, relInt, xcenter, h, k, l); + } + void XMLOutput(std::ostream& os, int indent) const override { + NB_OVERRIDE_PURE(XMLOutput, os, indent); + } + void XMLInput(std::istream& is, const XMLCrystTag& tag) override { + NB_OVERRIDE_PURE(XMLInput, is, tag); + } +}; + +namespace { + +// Ported forward from upstream main (#79): expose the remaining public +// ReflectionProfile methods as callable, not just overridable via the +// trampoline. Previously only CreateCopy was bound, so Python code (e.g. +// PowderPatternDiffraction.GetProfile()'s return value) could not actually +// call GetProfile/GetFullProfileWidth/XMLOutput/XMLInput on a concrete +// profile object. + +// GetProfile: accepts a sequence/ndarray for `x` (via the existing +// assignCrystVector helper -- nanobind has no built-in caster for the raw +// CrystVector_REAL type, so binding ReflectionProfile::GetProfile directly +// isn't an option), and converts the CrystVector_REAL result back to a +// numpy array (crystvec_to_array), matching every other Get*() binding in +// this codebase (e.g. PowderPattern::GetPowderPatternCalc). +nb_array_1d _GetProfile(const ReflectionProfile& rp, nb::object x, + const REAL xcenter, const REAL h, const REAL k, + const REAL l) +{ + CrystVector_REAL cvx; + assignCrystVector(cvx, x); + return crystvec_to_array(rp.GetProfile(cvx, xcenter, h, k, l)); +} + +void _XMLOutput(const ReflectionProfile& rp, nb::object output, int indent = 0) +{ + std::ostringstream os; + rp.XMLOutput(os, indent); + output.attr("write")(os.str()); +} + +void _XMLInput(ReflectionProfile& rp, nb::object input, const XMLCrystTag& tag) +{ + std::string s = read_pyfile_to_string(input); + std::istringstream is(s); + rp.XMLInput(is, tag); +} + +} // namespace + +void wrap_reflectionprofile(nb::module_& m) +{ + nb::class_(m, "ReflectionProfile") + .def("CreateCopy", &ReflectionProfile::CreateCopy, + nb::rv_policy::take_ownership) + .def("GetProfile", &_GetProfile, + nb::arg("x"), nb::arg("xcenter"), nb::arg("h"), nb::arg("k"), nb::arg("l")) + .def("GetFullProfileWidth", + nb::overload_cast( + &ReflectionProfile::GetFullProfileWidth), + nb::arg("relativeIntensity"), nb::arg("xcenter"), + nb::arg("h"), nb::arg("k"), nb::arg("l")) + .def("XMLOutput", &_XMLOutput, nb::arg("file"), nb::arg("indent") = 0) + .def("XMLInput", &_XMLInput, nb::arg("file"), nb::arg("tag")) + ; +} diff --git a/src/extensions/nb_refobjopt.cpp b/src/extensions/nb_refobjopt.cpp new file mode 100644 index 00000000..b06e02b9 --- /dev/null +++ b/src/extensions/nb_refobjopt.cpp @@ -0,0 +1,37 @@ +/* + * pyobjcryst nanobind port — RefObjOpt bindings + */ + +#include +#include +#include + +#include + +namespace nb = nanobind; +using namespace ObjCryst; + +struct PyRefObjOpt : RefObjOpt { + NB_TRAMPOLINE(RefObjOpt, 1); + void SetChoice(const int choice) override { NB_OVERRIDE(SetChoice, choice); } +}; + +void wrap_refobjopt(nb::module_& m) +{ + nb::class_(m, "RefObjOpt") + .def(nb::init<>()) + .def("Init", &RefObjOpt::Init) + .def("GetNbChoice", &RefObjOpt::GetNbChoice) + .def("GetChoice", &RefObjOpt::GetChoice) + .def("SetChoice", + nb::overload_cast(&RefObjOpt::SetChoice)) + .def("SetChoice", + nb::overload_cast(&RefObjOpt::SetChoice)) + .def("GetName", &RefObjOpt::GetName) + .def("GetClassName", &RefObjOpt::GetClassName) + .def("GetChoiceName", &RefObjOpt::GetChoiceName) + .def("GetClock", &RefObjOpt::GetClock, nb::rv_policy::reference_internal) + .def("XMLOutput", &RefObjOpt::XMLOutput) + .def("XMLInput", &RefObjOpt::XMLInput) + ; +} diff --git a/src/extensions/nb_refpartype.cpp b/src/extensions/nb_refpartype.cpp new file mode 100644 index 00000000..5fb008bb --- /dev/null +++ b/src/extensions/nb_refpartype.cpp @@ -0,0 +1,27 @@ +/* + * pyobjcryst nanobind port — RefParType bindings + */ + +#include +#include + +#include + +namespace nb = nanobind; +using namespace ObjCryst; + +void wrap_refpartype(nb::module_& m) +{ + nb::class_(m, "RefParType") + .def(nb::init(), nb::arg("name")) + .def(nb::init(), + nb::arg("parent"), nb::arg("name"), + nb::keep_alive<1, 2>()) + .def("IsDescendantFromOrSameAs", &RefParType::IsDescendantFromOrSameAs) + .def("GetName", &RefParType::GetName) + .def("__eq__", [](const RefParType* a, const RefParType* b){ return a == b; }) + ; + + // Expose the global root RefParType + m.attr("gpRefParTypeObjCryst") = gpRefParTypeObjCryst; +} diff --git a/src/extensions/nb_restraint.cpp b/src/extensions/nb_restraint.cpp new file mode 100644 index 00000000..50e6155a --- /dev/null +++ b/src/extensions/nb_restraint.cpp @@ -0,0 +1,42 @@ +/* + * pyobjcryst nanobind port — Restraint and RefObjOpt bindings + */ + +#include +#include +#include + +#include + +namespace nb = nanobind; +using namespace ObjCryst; + +// --------------------------------------------------------------------------- +// Trampoline for Restraint (virtual methods) +// --------------------------------------------------------------------------- +struct PyRestraint : Restraint { + NB_TRAMPOLINE(Restraint, 3); + + const RefParType* GetType() const override { + NB_OVERRIDE(GetType); + } + void SetType(const RefParType* type) override { + NB_OVERRIDE(SetType, type); + } + REAL GetLogLikelihood() const override { + NB_OVERRIDE(GetLogLikelihood); + } +}; + +void wrap_restraint(nb::module_& m) +{ + nb::class_(m, "Restraint") + .def(nb::init<>()) + .def(nb::init(), nb::arg("type"), + nb::keep_alive<1, 2>()) + .def("GetType", &Restraint::GetType, nb::rv_policy::reference_internal) + .def("SetType", &Restraint::SetType, nb::arg("type"), + nb::keep_alive<1, 2>()) + .def("GetLogLikelihood", &Restraint::GetLogLikelihood) + ; +} diff --git a/src/extensions/nb_rigidgroup.cpp b/src/extensions/nb_rigidgroup.cpp new file mode 100644 index 00000000..086eae2b --- /dev/null +++ b/src/extensions/nb_rigidgroup.cpp @@ -0,0 +1,87 @@ +#include +#include +#include +#include +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +// RigidGroup is a typedef for std::set. The legacy Boost.Python +// binding registered RigidGroup with `bases` so that it +// inherited the full Python-set-like interface (add/discard/remove/update/ +// clear/__contains__/__getitem__/__len__) from a generic MolAtomSet wrapper +// -- see the module docstring in pyobjcryst/molecule.py: "RigidGroup is +// wrapped to have python-set methods rather than stl::set methods." nanobind +// has no equivalent to bases<> mixing in a second wrapped C++ base that +// isn't in RigidGroup's real inheritance chain, so that interface has to be +// bound directly here instead. (__iter__ is a new addition -- Boost's +// MolAtomSet never defined it either, relying on the legacy __getitem__ +// fallback iteration protocol -- but nanobind classes don't get that +// fallback, so without an explicit __iter__ a RigidGroup wouldn't even +// support `for atom in group:`.) +namespace { + +void _addRG(RigidGroup& rg, MolAtom& a) +{ + rg.insert(&a); +} + +void _updateRG(RigidGroup& rg, nb::object other) +{ + std::set s = pyIterableToSet(other); + rg.insert(s.begin(), s.end()); +} + +bool _containsRG(const RigidGroup& rg, MolAtom& a) +{ + return rg.find(&a) != rg.end(); +} + +MolAtom& _getItemRG(const RigidGroup& rg, size_t i) +{ + if (i >= rg.size()) + throw nb::index_error("index out of range"); + RigidGroup::const_iterator p = rg.begin(); + std::advance(p, i); + return **p; +} + +void _discardRG(RigidGroup& rg, MolAtom& a) +{ + rg.erase(&a); +} + +void _removeRG(RigidGroup& rg, MolAtom& a) +{ + auto it = rg.find(&a); + if (it == rg.end()) + throw nb::key_error("KeyError"); + rg.erase(it); +} + +} // namespace + +void wrap_rigidgroup(nb::module_& m) +{ + nb::class_(m, "RigidGroup") + .def(nb::init<>()) + .def(nb::init()) + .def("GetName", &RigidGroup::GetName) + .def("int_ptr", &RigidGroup::int_ptr) + // Python-set-like interface (faithful to the legacy MolAtomSet + // mixin -- see the file-level comment above). + .def("add", &_addRG, nb::keep_alive<1,2>()) + .def("clear", [](RigidGroup& rg){ rg.clear(); }) + .def("discard", &_discardRG) + .def("remove", &_removeRG) + .def("update", &_updateRG, nb::keep_alive<1,2>()) + .def("__contains__", &_containsRG) + .def("__getitem__", &_getItemRG, nb::rv_policy::reference_internal) + .def("__len__", [](const RigidGroup& rg){ return rg.size(); }) + .def("__iter__", [](RigidGroup& rg){ + return nb::make_iterator(nb::find(nb::type()), + "rigidgroup_iter", rg.begin(), rg.end()); + }, nb::keep_alive<0,1>()) + ; +} diff --git a/src/extensions/nb_scatterer.cpp b/src/extensions/nb_scatterer.cpp new file mode 100644 index 00000000..9c7a1796 --- /dev/null +++ b/src/extensions/nb_scatterer.cpp @@ -0,0 +1,150 @@ +/* + * pyobjcryst nanobind port — Scatterer bindings + */ + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +struct PyScatterer : Scatterer { + NB_TRAMPOLINE(Scatterer, 9); + + void SetX(const REAL x) override { NB_OVERRIDE(SetX, x); } + void SetY(const REAL y) override { NB_OVERRIDE(SetY, y); } + void SetZ(const REAL z) override { NB_OVERRIDE(SetZ, z); } + void SetOccupancy(const REAL occ) override { NB_OVERRIDE(SetOccupancy, occ); } + Scatterer* CreateCopy() const override { NB_OVERRIDE_PURE(CreateCopy); } + int GetNbComponent() const override { NB_OVERRIDE_PURE(GetNbComponent); } + const ScatteringComponentList& GetScatteringComponentList() const override { + NB_OVERRIDE_PURE(GetScatteringComponentList); + } + std::string GetComponentName(const int i) const override { + NB_OVERRIDE_PURE(GetComponentName, i); + } + void Print() const override { NB_OVERRIDE_PURE(Print); } + std::ostream& POVRayDescription(std::ostream& os, const CrystalPOVRayOptions& opt) const override { + return os; + } + // GetClockScattCompList: forwards a *protected* Scatterer member + // (mClockScattCompList) not reachable from any free function -- the + // Boost.Python binding used the same trick (subclassing Scatterer to + // gain access), see scatterer_ext.cpp's ScattererWrap::_GetClockScattCompList. + const RefinableObjClock& GetClockScattCompList() const { + return mClockScattCompList; + } +#ifdef OBJCRYST_GL + void GLInitDisplayList(const bool noSymmetrics, + const REAL xMin, const REAL xMax, + const REAL yMin, const REAL yMax, + const REAL zMin, const REAL zMax, + const bool displayEnantiomer, + const bool displayNames, + const bool hideHydrogens, + const REAL fadeDistance, + const bool fullMoleculeInLimits) const override {} +#endif +protected: + void InitRefParList() override {} +}; + +namespace { + +nb::list _GetScatteringComponentList(Scatterer& s) +{ + const ScatteringComponentList& scl = s.GetScatteringComponentList(); + nb::list l; + for (int i = 0; i < scl.GetNbComponent(); ++i) + l.append(nb::cast(scl(i))); + return l; +} + +} // namespace + +void wrap_scatterer(nb::module_& m) +{ + m.attr("refpartype_scatt") = gpRefParTypeScatt; + m.attr("refpartype_scatt_transl") = gpRefParTypeScattTransl; + m.attr("refpartype_scatt_transl_x") = gpRefParTypeScattTranslX; + m.attr("refpartype_scatt_transl_y") = gpRefParTypeScattTranslY; + m.attr("refpartype_scatt_transl_z") = gpRefParTypeScattTranslZ; + m.attr("refpartype_scatt_orient") = gpRefParTypeScattOrient; + m.attr("refpartype_scatt_conform") = gpRefParTypeScattConform; + m.attr("refpartype_scatt_conform_bondlength") = gpRefParTypeScattConformBondLength; + m.attr("refpartype_scatt_conform_bondangle") = gpRefParTypeScattConformBondAngle; + m.attr("refpartype_scatt_conform_dihedangle") = gpRefParTypeScattConformDihedAngle; + m.attr("refpartype_scatt_conform_x") = gpRefParTypeScattConformX; + m.attr("refpartype_scatt_conform_y") = gpRefParTypeScattConformY; + m.attr("refpartype_scatt_conform_z") = gpRefParTypeScattConformZ; + m.attr("refpartype_scatt_occup") = gpRefParTypeScattOccup; + m.attr("gScattererRegistry") = &gScattererRegistry; + + nb::class_ cls(m, "Scatterer"); + cls + .def("GetX", &Scatterer::GetX) + .def("GetY", &Scatterer::GetY) + .def("GetZ", &Scatterer::GetZ) + .def("GetOccupancy", &Scatterer::GetOccupancy) + .def("SetX", &Scatterer::SetX) + .def("SetY", &Scatterer::SetY) + .def("SetZ", &Scatterer::SetZ) + .def("SetOccupancy", &Scatterer::SetOccupancy) + .def("GetClockScatterer", + nb::overload_cast<>(&Scatterer::GetClockScatterer), + nb::rv_policy::reference_internal) + .def("SetCrystal", &Scatterer::SetCrystal, nb::keep_alive<1,2>()) + .def("GetCrystal", + nb::overload_cast<>(&Scatterer::GetCrystal), + nb::rv_policy::reference_internal) + .def("GetNbComponent", &Scatterer::GetNbComponent) + .def("GetComponentName", &Scatterer::GetComponentName) + .def("GetScatteringComponentList",&_GetScatteringComponentList) + .def("Print", &Scatterer::Print) + .def("__str__", [](const Scatterer& s){ return obj_str(s); }) + .def_prop_rw("X", &Scatterer::GetX, &Scatterer::SetX) + .def_prop_rw("Y", &Scatterer::GetY, &Scatterer::SetY) + .def_prop_rw("Z", &Scatterer::GetZ, &Scatterer::SetZ) + .def_prop_rw("Occupancy", &Scatterer::GetOccupancy, &Scatterer::SetOccupancy) + // RefinableObj methods (virtual base — use lambdas to avoid vbase offset issue) + .def("GetName", [](Scatterer& s) -> std::string { return s.GetName(); }) + .def("SetName", [](Scatterer& s, const std::string& n) { s.SetName(n); }) + .def("GetClassName",[](Scatterer& s) -> std::string { return s.GetClassName(); }) + .def("GetNbPar", [](Scatterer& s) { return s.GetNbPar(); }) + .def("GetPar", [](Scatterer& s, const std::string& name) -> RefinablePar& { + return s.GetPar(name); }, nb::rv_policy::reference_internal) + .def("GetPar", [](Scatterer& s, long i) -> RefinablePar& { + return s.GetPar(i); }, nb::rv_policy::reference_internal) + // NB: parameter is Scatterer&, not PyScatterer& -- this must work on + // Atom/Molecule/... instances too, which are plain Scatterer + // subclasses (never actually constructed as a PyScatterer). Casting + // through PyScatterer is safe here because PyScatterer adds no data + // members of its own; it exists purely to obtain access to the + // protected mClockScattCompList (same trick Boost.Python's + // ScattererWrap used -- see scatterer_ext.cpp). + .def("GetClockScattCompList", + [](Scatterer& s) -> const RefinableObjClock& { + return static_cast(s).GetClockScattCompList(); + }, + nb::rv_policy::reference_internal) + ; + + // Restore the rest of RefinableObj's method surface (Print, GetName, + // GetNbPar, and GetPar above were already covered one-off; everything + // else -- FixAllPar, XMLOutput, BeginOptimization, GetLogLikelihood, + // AddPar, CreateParamSet, GetOption, UpdateDisplay, ... -- was not). + // See helpers_nb.hpp for why this is safe despite Scatterer's virtual + // inheritance of RefinableObj. Covers Atom, Molecule, ZScatterer, and + // ZPolyhedron automatically, since they inherit Scatterer non-virtually + // and already have it correctly declared as their nanobind base. + bind_refinableobj_forwarding(cls); +} diff --git a/src/extensions/nb_scatteringcomponent.cpp b/src/extensions/nb_scatteringcomponent.cpp new file mode 100644 index 00000000..01426187 --- /dev/null +++ b/src/extensions/nb_scatteringcomponent.cpp @@ -0,0 +1,56 @@ +/* + * pyobjcryst nanobind port — ScatteringComponent bindings + */ + +#include +#include + +#include + +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +namespace { + +// Return the scattering power as the correct concrete type pointer +nb::object getScatteringPowerPython(ScatteringComponent& s, nb::handle parent) +{ + const ScatteringPower* sp = s.mpScattPow; + if (!sp) return nb::none(); + // Try ScatteringPowerAtom first + const ScatteringPowerAtom* spa = dynamic_cast(sp); + if (spa) { + return nb::cast(const_cast(spa), + nb::rv_policy::reference_internal, parent); + } + // Fall back to ScatteringPower + return nb::cast(const_cast(sp), + nb::rv_policy::reference_internal, parent); +} + +} // namespace + +void wrap_scatteringcomponent(nb::module_& m) +{ + nb::class_(m, "ScatteringComponent") + .def(nb::init<>()) + .def("Print", &ScatteringComponent::Print) + .def_rw("mX", &ScatteringComponent::mX) + .def_rw("X", &ScatteringComponent::mX) + .def_rw("mY", &ScatteringComponent::mY) + .def_rw("Y", &ScatteringComponent::mY) + .def_rw("mZ", &ScatteringComponent::mZ) + .def_rw("Z", &ScatteringComponent::mZ) + .def_rw("mOccupancy", &ScatteringComponent::mOccupancy) + .def_rw("Occupancy", &ScatteringComponent::mOccupancy) + .def_ro("mDynPopCorr",&ScatteringComponent::mDynPopCorr) + .def_prop_ro("mpScattPow", + [](nb::handle self) -> nb::object { + ScatteringComponent& s = nb::cast(self); + return getScatteringPowerPython(s, self); + }) + .def("__str__", [](const ScatteringComponent& s){ return obj_str(s); }) + ; +} diff --git a/src/extensions/nb_scatteringcomponentlist.cpp b/src/extensions/nb_scatteringcomponentlist.cpp new file mode 100644 index 00000000..b2af0d01 --- /dev/null +++ b/src/extensions/nb_scatteringcomponentlist.cpp @@ -0,0 +1,48 @@ +/* + * pyobjcryst nanobind port — ScatteringComponentList bindings + */ + +#include + +#include + +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +namespace { + +const ScatteringComponent& _getItem(const ScatteringComponentList& scl, long idx) +{ + long n = scl.GetNbComponent(); + if (idx < 0) idx += n; + if (idx < 0 || idx >= n) + throw nb::index_error("index out of range"); + return scl(idx); +} + +bool _contains(const ScatteringComponentList& scl, const ScatteringComponent& sc) +{ + for (long i = 0; i < scl.GetNbComponent(); ++i) + if (scl(i) == sc) return true; + return false; +} + +} // namespace + +void wrap_scatteringcomponentlist(nb::module_& m) +{ + nb::class_(m, "ScatteringComponentList") + .def("Reset", &ScatteringComponentList::Reset) + .def("GetNbComponent", &ScatteringComponentList::GetNbComponent) + .def("Print", &ScatteringComponentList::Print) + .def("__eq__", [](const ScatteringComponentList& a, const ScatteringComponentList& b){ return a == b; }) + .def("__iadd__",[](ScatteringComponentList& a, const ScatteringComponentList& b) -> ScatteringComponentList& { a += b; return a; }) + .def("__iadd__",[](ScatteringComponentList& a, const ScatteringComponent& b) -> ScatteringComponentList& { a += b; return a; }) + .def("__str__", [](const ScatteringComponentList& s){ return obj_str(s); }) + .def("__len__", &ScatteringComponentList::GetNbComponent) + .def("__getitem__", &_getItem, nb::rv_policy::reference_internal) + .def("__contains__", &_contains) + ; +} diff --git a/src/extensions/nb_scatteringdata.cpp b/src/extensions/nb_scatteringdata.cpp new file mode 100644 index 00000000..8b5ffff6 --- /dev/null +++ b/src/extensions/nb_scatteringdata.cpp @@ -0,0 +1,107 @@ +/* + * pyobjcryst nanobind port — ScatteringData bindings + */ + +#include +#include +#include + +#include +#include + +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +namespace { + +double _GetWavelength(ScatteringData& s) +{ + return s.GetWavelength()(0); +} + +nb::dict _GetScatteringFactor(ScatteringData& data) +{ + const std::map& vsf + = data.GetScatteringFactor(); + nb::dict d; + for (auto& kv : vsf) { + nb::object key = nb::cast(kv.first, nb::rv_policy::reference); + d[key] = crystvec_to_array(kv.second); + } + return d; +} + +} // namespace + +void wrap_scatteringdata(nb::module_& m) +{ + m.attr("refpartype_scattdata") = gpRefParTypeScattData; + m.attr("refpartype_scattdata_scale") = gpRefParTypeScattDataScale; + m.attr("refpartype_scattdata_profile") = gpRefParTypeScattDataProfile; + m.attr("refpartype_scattdata_profile_type") = gpRefParTypeScattDataProfileType; + m.attr("refpartype_scattdata_profile_width") = gpRefParTypeScattDataProfileWidth; + m.attr("refpartype_scattdata_profile_asym") = gpRefParTypeScattDataProfileAsym; + m.attr("refpartype_scattdata_corr") = gpRefParTypeScattDataCorr; + m.attr("refpartype_scattdata_corr_pos") = gpRefParTypeScattDataCorrPos; + m.attr("refpartype_scattdata_radiation") = gpRefParTypeRadiation; + m.attr("refpartype_scattdata_radiation_wavelength") = gpRefParTypeRadiationWavelength; + + nb::class_ cls(m, "ScatteringData"); + cls + .def("GenHKLFullSpace2", + nb::overload_cast(&ScatteringData::GenHKLFullSpace2), + nb::arg("maxsithsl"), nb::arg("unique") = false) + .def("GenHKLFullSpace", + nb::overload_cast(&ScatteringData::GenHKLFullSpace), + nb::arg("maxtheta"), nb::arg("unique") = false) + .def("SetCrystal", &ScatteringData::SetCrystal) + .def("GetCrystal", + nb::overload_cast<>(&ScatteringData::GetCrystal), + nb::rv_policy::reference_internal) + .def("HasCrystal", &ScatteringData::HasCrystal) + .def("GetNbRefl", &ScatteringData::GetNbRefl) + .def("GetH", [](ScatteringData& s){ return crystvec_to_array(s.GetH()); }) + .def("GetK", [](ScatteringData& s){ return crystvec_to_array(s.GetK()); }) + .def("GetL", [](ScatteringData& s){ return crystvec_to_array(s.GetL()); }) + .def("GetH2Pi", [](ScatteringData& s){ return crystvec_to_array(s.GetH2Pi()); }) + .def("GetK2Pi", [](ScatteringData& s){ return crystvec_to_array(s.GetK2Pi()); }) + .def("GetL2Pi", [](ScatteringData& s){ return crystvec_to_array(s.GetL2Pi()); }) + .def("GetReflX", [](ScatteringData& s){ return crystvec_to_array(s.GetReflX()); }) + .def("GetReflY", [](ScatteringData& s){ return crystvec_to_array(s.GetReflY()); }) + .def("GetReflZ", [](ScatteringData& s){ return crystvec_to_array(s.GetReflZ()); }) + .def("GetSinThetaOverLambda", [](ScatteringData& s){ return crystvec_to_array(s.GetSinThetaOverLambda()); }) + .def("GetTheta", [](ScatteringData& s){ return crystvec_to_array(s.GetTheta()); }) + .def("GetClockTheta", &ScatteringData::GetClockTheta, nb::rv_policy::reference_internal) + .def("GetFhklCalcSq", [](ScatteringData& s){ return crystvec_to_array(s.GetFhklCalcSq()); }) + .def("GetFhklCalcReal",[](ScatteringData& s){ return crystvec_to_array(s.GetFhklCalcReal()); }) + .def("GetFhklCalcImag",[](ScatteringData& s){ return crystvec_to_array(s.GetFhklCalcImag()); }) + .def("GetFhklObsSq", [](ScatteringData& s){ return crystvec_to_array(s.GetFhklObsSq()); }) + .def("GetRadiation", + nb::overload_cast<>(&ScatteringData::GetRadiation, nb::const_), + nb::rv_policy::reference_internal) + .def("GetRadiationType", &ScatteringData::GetRadiationType) + .def("GetWavelength", &_GetWavelength) + .def("SetIsIgnoringImagScattFact", &ScatteringData::SetIsIgnoringImagScattFact) + .def("IsIgnoringImagScattFact", &ScatteringData::IsIgnoringImagScattFact) + .def("PrintFhklCalc", [](const ScatteringData& s){ s.PrintFhklCalc(); }) + .def("PrintFhklCalcDetail", [](const ScatteringData& s){ s.PrintFhklCalcDetail(); }) + .def("SetMaxSinThetaOvLambda", &ScatteringData::SetMaxSinThetaOvLambda) + .def("GetMaxSinThetaOvLambda", &ScatteringData::GetMaxSinThetaOvLambda) + .def("GetNbReflBelowMaxSinThetaOvLambda", &ScatteringData::GetNbReflBelowMaxSinThetaOvLambda) + .def("GetClockNbReflBelowMaxSinThetaOvLambda", + &ScatteringData::GetClockNbReflBelowMaxSinThetaOvLambda, + nb::rv_policy::reference_internal) + .def("GetScatteringFactor", &_GetScatteringFactor) + ; + + // Restore RefinableObj's method surface (Print, GetName, FixAllPar, + // BeginOptimization, XMLOutput, AddPar, ...): ScatteringData inherits + // RefinableObj virtually, so none of it was reachable before -- see + // helpers_nb.hpp for why forwarding like this is safe. Covers + // DiffractionDataSingleCrystal and PowderPatternDiffraction + // automatically (both inherit ScatteringData non-virtually and already + // have it correctly declared as their nanobind base). + bind_refinableobj_forwarding(cls); +} diff --git a/src/extensions/nb_scatteringpower.cpp b/src/extensions/nb_scatteringpower.cpp new file mode 100644 index 00000000..fad2ee43 --- /dev/null +++ b/src/extensions/nb_scatteringpower.cpp @@ -0,0 +1,155 @@ +/* + * pyobjcryst nanobind port — ScatteringPower bindings + */ + +#include +#include +#include + +#include +#include +#include +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +struct PyScatteringPower : ScatteringPower { + NB_TRAMPOLINE(ScatteringPower, 13); + + CrystVector_REAL GetScatteringFactor(const ScatteringData& d, const int idx) const override { + NB_OVERRIDE_PURE(GetScatteringFactor, d, idx); + } + REAL GetForwardScatteringFactor(const RadiationType t) const override { + NB_OVERRIDE_PURE(GetForwardScatteringFactor, t); + } + CrystVector_REAL GetTemperatureFactor(const ScatteringData& d, const int idx) const override { + NB_OVERRIDE_PURE(GetTemperatureFactor, d, idx); + } + CrystMatrix_REAL GetResonantScattFactReal(const ScatteringData& d, const int idx) const override { + NB_OVERRIDE_PURE(GetResonantScattFactReal, d, idx); + } + CrystMatrix_REAL GetResonantScattFactImag(const ScatteringData& d, const int idx) const override { + NB_OVERRIDE_PURE(GetResonantScattFactImag, d, idx); + } + REAL GetRadius() const override { NB_OVERRIDE_PURE(GetRadius); } + // GetMaximumLikelihood*/SetMaximumLikelihood* are not virtual; not in trampoline + bool IsScatteringFactorAnisotropic() const override { + NB_OVERRIDE(IsScatteringFactorAnisotropic); + } + bool IsTemperatureFactorAnisotropic() const override { + NB_OVERRIDE(IsTemperatureFactorAnisotropic); + } + bool IsResonantScatteringAnisotropic() const override { + NB_OVERRIDE(IsResonantScatteringAnisotropic); + } + // GetSymbol: const string& return; override not supported, use base class + void SetBiso(const REAL b) override { NB_OVERRIDE(SetBiso, b); } + void SetBij(const size_t& i, const size_t& j, const REAL b) override { + NB_OVERRIDE(SetBij, i, j, b); + } + REAL GetFormalCharge() const override { NB_OVERRIDE(GetFormalCharge); } + void SetFormalCharge(const REAL c) override { NB_OVERRIDE(SetFormalCharge, c); } +protected: + void InitRefParList() override {} +}; + +namespace { + +template +double _GetBij(ScatteringPower& sp) { return sp.GetBij(I, J); } + +template +void _SetBij(ScatteringPower& sp, const double bd) { sp.SetBij(I, J, static_cast(bd)); } + +nb::tuple _GetColourRGB(ScatteringPower& sp) { + return nb::make_tuple(sp.GetColourRGB()[0], sp.GetColourRGB()[1], sp.GetColourRGB()[2]); +} + +} // namespace + +void wrap_scatteringpower(nb::module_& m) +{ + m.attr("refpartype_scattpow") = gpRefParTypeScattPow; + m.attr("refpartype_scattpow_temperature") = gpRefParTypeScattPowTemperature; + m.attr("gScatteringPowerRegistry") = &gScatteringPowerRegistry; + + nb::class_ cls(m, "ScatteringPower"); + cls + .def("GetScatteringFactor", &ScatteringPower::GetScatteringFactor, + nb::arg("data"), nb::arg("spgSymPosIndex") = -1) + .def("GetForwardScatteringFactor", &ScatteringPower::GetForwardScatteringFactor) + .def("GetTemperatureFactor", &ScatteringPower::GetTemperatureFactor, + nb::arg("data"), nb::arg("spgSymPosIndex") = -1) + .def("GetResonantScattFactReal", &ScatteringPower::GetResonantScattFactReal, + nb::arg("data"), nb::arg("spgSymPosIndex") = -1) + .def("GetResonantScattFactImag", &ScatteringPower::GetResonantScattFactImag, + nb::arg("data"), nb::arg("spgSymPosIndex") = -1) + .def("IsScatteringFactorAnisotropic", &ScatteringPower::IsScatteringFactorAnisotropic) + .def("IsTemperatureFactorAnisotropic", &ScatteringPower::IsTemperatureFactorAnisotropic) + .def("IsResonantScatteringAnisotropic",&ScatteringPower::IsResonantScatteringAnisotropic) + .def("GetSymbol", &ScatteringPower::GetSymbol) + .def("GetBiso", + nb::overload_cast<>(&ScatteringPower::GetBiso, nb::const_)) + .def("SetBiso", &ScatteringPower::SetBiso) + .def("GetBij", + nb::overload_cast(&ScatteringPower::GetBij, nb::const_)) + .def("SetBij", + nb::overload_cast(&ScatteringPower::SetBij)) + .def("IsIsotropic", &ScatteringPower::IsIsotropic) + .def("GetDynPopCorrIndex", &ScatteringPower::GetDynPopCorrIndex) + .def("GetNbScatteringPower", &ScatteringPower::GetNbScatteringPower) + .def("GetLastChangeClock", &ScatteringPower::GetLastChangeClock, + nb::rv_policy::reference_internal) + .def("GetRadius", &ScatteringPower::GetRadius) + .def("GetMaximumLikelihoodPositionError", &ScatteringPower::GetMaximumLikelihoodPositionError) + .def("SetMaximumLikelihoodPositionError", &ScatteringPower::SetMaximumLikelihoodPositionError) + .def("GetMaximumLikelihoodNbGhostAtom", &ScatteringPower::GetMaximumLikelihoodNbGhostAtom) + .def("SetMaximumLikelihoodNbGhostAtom", &ScatteringPower::SetMaximumLikelihoodNbGhostAtom) + .def("GetMaximumLikelihoodParClock", &ScatteringPower::GetMaximumLikelihoodParClock, + nb::rv_policy::reference_internal) + .def("GetFormalCharge", &ScatteringPower::GetFormalCharge) + .def("SetFormalCharge", &ScatteringPower::SetFormalCharge) + .def("GetColourRGB", &_GetColourRGB) + .def("GetColour", &_GetColourRGB) + .def("SetColour", + nb::overload_cast(&ScatteringPower::SetColour), + nb::arg("r"), nb::arg("g"), nb::arg("b")) + .def_prop_rw("Biso", + nb::overload_cast<>(&ScatteringPower::GetBiso, nb::const_), + &ScatteringPower::SetBiso) + .def_prop_rw("B11", &_GetBij<1,1>, &_SetBij<1,1>) + .def_prop_rw("B22", &_GetBij<2,2>, &_SetBij<2,2>) + .def_prop_rw("B33", &_GetBij<3,3>, &_SetBij<3,3>) + .def_prop_rw("B12", &_GetBij<1,2>, &_SetBij<1,2>) + .def_prop_rw("B13", &_GetBij<1,3>, &_SetBij<1,3>) + .def_prop_rw("B23", &_GetBij<2,3>, &_SetBij<2,3>) + // RefinableObj methods (virtual base — call via ScatteringPower* to avoid vbase offset issue) + .def("GetName", [](ScatteringPower& sp) -> std::string { return sp.GetName(); }) + .def("SetName", [](ScatteringPower& sp, const std::string& n) { sp.SetName(n); }) + .def("GetClassName", [](ScatteringPower& sp) -> std::string { return sp.GetClassName(); }) + .def("Print", [](ScatteringPower& sp) { sp.Print(); }) + .def("GetNbPar", [](ScatteringPower& sp) { return sp.GetNbPar(); }) + .def("GetPar", [](ScatteringPower& sp, const std::string& name) -> RefinablePar& { + return sp.GetPar(name); }, nb::rv_policy::reference_internal) + .def("GetPar", [](ScatteringPower& sp, long i) -> RefinablePar& { + return sp.GetPar(i); }, nb::rv_policy::reference_internal) + .def("GetClockMaster",[](ScatteringPower& sp) -> const RefinableObjClock& { + return sp.GetClockMaster(); }, nb::rv_policy::reference_internal) + .def("__str__", [](ScatteringPower& sp) { return sp.GetName(); }) + ; + + // Restore the rest of RefinableObj's method surface (a handful of + // methods -- GetName/SetName/GetClassName/Print/GetNbPar/GetPar/ + // GetClockMaster -- were already covered one-off above; everything + // else -- FixAllPar, XMLOutput, BeginOptimization, GetLogLikelihood, + // AddPar, CreateParamSet, GetOption, UpdateDisplay, ... -- was not). + // See helpers_nb.hpp for why this is safe despite ScatteringPower's + // virtual inheritance of RefinableObj. Covers ScatteringPowerSphere + // automatically (non-virtual inheritance, already correctly declared as + // its nanobind base); ScatteringPowerAtom and GlobalScatteringPower + // additionally inherit ScatteringPower virtually and need this called + // on them directly too (see nb_scatteringpoweratom.cpp, + // nb_globalscatteringpower.cpp). + bind_refinableobj_forwarding(cls); +} diff --git a/src/extensions/nb_scatteringpoweratom.cpp b/src/extensions/nb_scatteringpoweratom.cpp new file mode 100644 index 00000000..13719bc0 --- /dev/null +++ b/src/extensions/nb_scatteringpoweratom.cpp @@ -0,0 +1,116 @@ +/* + * pyobjcryst nanobind port — ScatteringPowerAtom bindings + */ + +#include +#include + +#include +#include + +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +namespace { + +// Helper: call ScatteringPower methods via the virtual base safely +// Use static_cast to get ScatteringPower* first, THEN access mName via +// RefinableObj methods (which are virtual and will work through the vtable) + +template +double _GetBijSPA(ScatteringPowerAtom& sp) { return sp.GetBij(I, J); } + +template +void _SetBijSPA(ScatteringPowerAtom& sp, double b) { sp.SetBij(I, J, static_cast(b)); } + +} // namespace + +void wrap_scatteringpoweratom(nb::module_& m) +{ + // NOTE: intentionally registered WITHOUT ScatteringPower as a declared + // nanobind base. Unlike ScatteringPowerSphere (plain `public + // ScatteringPower`), ScatteringPowerAtom uses VIRTUAL inheritance + // (`class ScatteringPowerAtom : virtual public ScatteringPower`, see + // ScatteringPower.h). nanobind's automatic base<->derived pointer-offset + // machinery (nb::class_) assumes a fixed, statically + // computable offset, which virtual inheritance does not provide — this + // is exactly the "Pattern 1/2: leaf class, no declared virtual base" + // case documented in nanobind_migration_notes.md. All ScatteringPower + // methods needed on ScatteringPowerAtom are therefore explicitly + // rebound below (not inherited via nanobind), matching the working + // Atom/Scatterer pattern elsewhere in this codebase. Do not add + // ScatteringPower here without re-verifying against that virtual base. + nb::class_ cls(m, "ScatteringPowerAtom"); + cls + .def(nb::init()) + .def(nb::init(), + nb::arg("name"), nb::arg("symbol"), nb::arg("bIso") = 1.0) + .def("Init", + nb::overload_cast( + &ScatteringPowerAtom::Init), + nb::arg("name"), nb::arg("symbol"), nb::arg("biso") = 1.0) + .def("SetSymbol", &ScatteringPowerAtom::SetSymbol) + .def("GetElementName", &ScatteringPowerAtom::GetElementName) + .def("GetAtomicNumber", &ScatteringPowerAtom::GetAtomicNumber) + .def("GetAtomicWeight", &ScatteringPowerAtom::GetAtomicWeight) + // ScatteringPower methods (would need virtual cast, use direct call) + .def("GetSymbol", [](ScatteringPowerAtom& sp) -> std::string { return sp.GetSymbol(); }) + .def("GetBiso", [](ScatteringPowerAtom& sp) { return (double)sp.GetBiso(); }) + .def("SetBiso", [](ScatteringPowerAtom& sp, double b) { sp.SetBiso(static_cast(b)); }) + .def("GetRadius", [](ScatteringPowerAtom& sp) { return (double)sp.GetRadius(); }) + .def("GetForwardScatteringFactor", [](ScatteringPowerAtom& sp, RadiationType t) { + return (double)sp.GetForwardScatteringFactor(t); }) + .def("GetMaximumLikelihoodPositionError", + [](ScatteringPowerAtom& sp) { return (double)sp.GetMaximumLikelihoodPositionError(); }) + .def("SetMaximumLikelihoodPositionError", + [](ScatteringPowerAtom& sp, double e) { sp.SetMaximumLikelihoodPositionError(static_cast(e)); }) + .def("GetMaximumLikelihoodNbGhostAtom", + [](ScatteringPowerAtom& sp) { return (double)sp.GetMaximumLikelihoodNbGhostAtom(); }) + .def("SetMaximumLikelihoodNbGhostAtom", + [](ScatteringPowerAtom& sp, double n) { sp.SetMaximumLikelihoodNbGhostAtom(static_cast(n)); }) + .def("GetFormalCharge", [](ScatteringPowerAtom& sp) { return (double)sp.GetFormalCharge(); }) + .def("SetFormalCharge", [](ScatteringPowerAtom& sp, double c) { sp.SetFormalCharge(static_cast(c)); }) + // RefinableObj methods (virtual base — access via ScatteringPowerAtom directly) + .def("GetName", [](ScatteringPowerAtom& sp) -> std::string { return std::string(sp.GetName()); }) + .def("SetName", [](ScatteringPowerAtom& sp, const std::string& n) { static_cast(sp).SetName(n); }) + .def("GetClassName",[](ScatteringPowerAtom& sp) -> std::string { return std::string(sp.GetClassName()); }) + .def("Print", [](ScatteringPowerAtom& sp) { sp.Print(); }) + .def("GetNbPar", [](ScatteringPowerAtom& sp) { return sp.GetNbPar(); }) + .def("GetPar", [](ScatteringPowerAtom& sp, const std::string& n) -> RefinablePar& { + return sp.GetPar(n); }, nb::rv_policy::reference_internal) + .def("GetPar", [](ScatteringPowerAtom& sp, long i) -> RefinablePar& { + return sp.GetPar(i); }, nb::rv_policy::reference_internal) + .def("__str__", [](ScatteringPowerAtom& sp) -> std::string { return std::string(sp.GetName()); }) + .def_prop_rw("Biso", + [](ScatteringPowerAtom& sp) { return (double)sp.GetBiso(); }, + [](ScatteringPowerAtom& sp, double b) { sp.SetBiso(static_cast(b)); }) + .def_prop_rw("B11", &_GetBijSPA<1,1>, &_SetBijSPA<1,1>) + .def_prop_rw("B22", &_GetBijSPA<2,2>, &_SetBijSPA<2,2>) + .def_prop_rw("B33", &_GetBijSPA<3,3>, &_SetBijSPA<3,3>) + .def_prop_rw("B12", &_GetBijSPA<1,2>, &_SetBijSPA<1,2>) + .def_prop_rw("B13", &_GetBijSPA<1,3>, &_SetBijSPA<1,3>) + .def_prop_rw("B23", &_GetBijSPA<2,3>, &_SetBijSPA<2,3>) + // Additional ScatteringPower methods needed by tests + .def("IsIsotropic", [](ScatteringPowerAtom& sp) { return sp.IsIsotropic(); }) + .def("IsScatteringFactorAnisotropic", [](ScatteringPowerAtom& sp) { return sp.IsScatteringFactorAnisotropic(); }) + .def("IsTemperatureFactorAnisotropic", [](ScatteringPowerAtom& sp) { return sp.IsTemperatureFactorAnisotropic(); }) + ; + + // ScatteringPowerAtom inherits ScatteringPower *virtually* too (see the + // NOTE above), so -- unlike ScatteringPowerSphere -- it can't ride on + // ScatteringPower's nanobind base for either RefinableObj's or + // ScatteringPower's own method surface; both need to be forwarded + // directly. Most of ScatteringPower's own methods were already covered + // one-off above (some already went through this file specifically + // because they need REAL<->double conversions ScatteringPower's own + // binding doesn't need); bind_scatteringpower_forwarding fills in the + // rest (GetScatteringFactor, GetTemperatureFactor, + // GetResonantScattFactReal/Imag, GetDynPopCorrIndex, + // GetNbScatteringPower, GetLastChangeClock, GetMaximumLikelihoodParClock, + // GetColour(RGB)/SetColour, generic GetBij/SetBij, ...); any name + // already bound above simply keeps winning (first registered wins). + bind_scatteringpower_forwarding(cls); + bind_refinableobj_forwarding(cls); +} diff --git a/src/extensions/nb_scatteringpowersphere.cpp b/src/extensions/nb_scatteringpowersphere.cpp new file mode 100644 index 00000000..28f6730f --- /dev/null +++ b/src/extensions/nb_scatteringpowersphere.cpp @@ -0,0 +1,25 @@ +/* + * pyobjcryst nanobind port — ScatteringPowerSphere bindings + */ + +#include +#include + +#include + +namespace nb = nanobind; +using namespace ObjCryst; + +void wrap_scatteringpowersphere(nb::module_& m) +{ + nb::class_(m, "ScatteringPowerSphere", nb::is_final()) + .def(nb::init<>()) + .def(nb::init(), + nb::arg("name"), nb::arg("radius"), nb::arg("bIso") = 1.0) + .def("Init", + nb::overload_cast( + &ScatteringPowerSphere::Init), + nb::arg("name"), nb::arg("radius"), nb::arg("biso") = 1.0) + .def("GetRadius", &ScatteringPowerSphere::GetRadius) + ; +} diff --git a/src/extensions/nb_spacegroup.cpp b/src/extensions/nb_spacegroup.cpp new file mode 100644 index 00000000..2e7a0873 --- /dev/null +++ b/src/extensions/nb_spacegroup.cpp @@ -0,0 +1,110 @@ +/* + * pyobjcryst nanobind port — SpaceGroup bindings + */ + +#include +#include +#include + +#include + +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +namespace { + +nb::list GetTranslationVectors(const SpaceGroup& sg) +{ + const std::vector& tv = sg.GetTranslationVectors(); + nb::list outlist; + for (auto& vec : tv) { + CrystVector_REAL translation(3); + for (int i = 0; i < 3; ++i) translation(i) = vec.tr[i]; + outlist.append(crystvec_to_array(translation)); + } + return outlist; +} + +nb::list GetSymmetryOperations(const SpaceGroup& sg) +{ + const std::vector& sv = sg.GetSymmetryOperations(); + nb::list outlist; + for (auto& tup : sv) { + CrystVector_REAL translation(3); + for (int i = 0; i < 3; ++i) translation(i) = tup.tr[i]; + CrystMatrix_REAL rotation(3, 3); + for (int idx = 0; idx < 9; ++idx) rotation(idx/3, idx%3) = tup.mx[idx]; + outlist.append(nb::make_tuple(crystvec_to_array(translation), crystmat_to_array(rotation))); + } + return outlist; +} + +SpaceGroup* CreateSpaceGroup(const std::string& sgid) +{ + MuteObjCrystUserInfo muzzle; + return new SpaceGroup(sgid); +} + +void SafeChangeSpaceGroup(SpaceGroup& sg, const std::string& sgid) +{ + MuteObjCrystUserInfo muzzle; + sg.ChangeSpaceGroup(sgid); +} + +} // namespace + +void wrap_spacegroup(nb::module_& m) +{ + nb::class_(m, "SpaceGroup") + .def(nb::init<>()) + .def("__init__", + [](SpaceGroup* sg, const std::string& sgid) { + MuteObjCrystUserInfo muzzle; + new (sg) SpaceGroup(sgid); + }, nb::arg("spacegroup") = "P1") + .def("ChangeSpaceGroup", &SafeChangeSpaceGroup) + .def("GetName", &SpaceGroup::GetName) + .def("IsInAsymmetricUnit", &SpaceGroup::IsInAsymmetricUnit) + .def("ChangeToAsymmetricUnit", &SpaceGroup::ChangeToAsymmetricUnit) + .def("GetAsymUnit", &SpaceGroup::GetAsymUnit, + nb::rv_policy::reference_internal) + .def("GetSpaceGroupNumber", &SpaceGroup::GetSpaceGroupNumber) + .def("IsCentrosymmetric", &SpaceGroup::IsCentrosymmetric) + .def("GetNbTranslationVectors", &SpaceGroup::GetNbTranslationVectors) + .def("GetTranslationVectors", &GetTranslationVectors) + .def("GetSymmetryOperations", &GetSymmetryOperations) + .def("GetAllSymmetrics", + [](const SpaceGroup& sg, REAL x, REAL y, REAL z, + bool noCenter, bool noTransl, bool noIdentical) { + return crystmat_to_array(sg.GetAllSymmetrics(x, y, z, noCenter, noTransl, noIdentical)); + }, + nb::arg("x"), nb::arg("y"), nb::arg("z"), + nb::arg("noCenter") = false, nb::arg("noTransl") = false, + nb::arg("noIdentical") = false) + .def("GetNbSymmetrics", &SpaceGroup::GetNbSymmetrics, + nb::arg("noCenter") = false, nb::arg("noTransl") = false) + .def("GetInversionCenter", [](const SpaceGroup& sg) { + return crystvec_to_array(sg.GetInversionCenter()); }) + .def("Print", &SpaceGroup::Print) + .def("HasInversionCenter", &SpaceGroup::HasInversionCenter) + .def("IsInversionCenterAtOrigin", &SpaceGroup::IsInversionCenterAtOrigin) + .def("GetClockSpaceGroup", &SpaceGroup::GetClockSpaceGroup, + nb::rv_policy::reference_internal) + .def("GetUniqueAxis", &SpaceGroup::GetUniqueAxis) + .def("GetExtension", &SpaceGroup::GetExtension) + .def("GetAllEquivRefl", [](const SpaceGroup& sg, REAL h, REAL k, REAL l, + bool excFriedel, bool forceFriedel) { + return crystmat_to_array(sg.GetAllEquivRefl(h, k, l, excFriedel, forceFriedel)); + }, + nb::arg("h"), nb::arg("k"), nb::arg("l"), + nb::arg("excludeFriedelMate") = false, + nb::arg("forceFriedelLaw") = false) + .def("IsReflSystematicAbsent", &SpaceGroup::IsReflSystematicAbsent) + .def("IsReflCentric", &SpaceGroup::IsReflCentric) + .def("GetExpectedIntensityFactor",&SpaceGroup::GetExpectedIntensityFactor) + .def("__str__", &SpaceGroup::GetName) + .def("__repr__", &SpaceGroup::GetName) + ; +} diff --git a/src/extensions/nb_stretchmode.cpp b/src/extensions/nb_stretchmode.cpp new file mode 100644 index 00000000..80ea6540 --- /dev/null +++ b/src/extensions/nb_stretchmode.cpp @@ -0,0 +1,120 @@ +#include +#include +#include +#include +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +typedef std::set MolAtomSet; + +struct PyStretchMode : StretchMode { + NB_TRAMPOLINE(StretchMode, 3); + void CalcDeriv(const bool derivllk=true) const override + { NB_OVERRIDE_PURE(CalcDeriv, derivllk); } + void Stretch(const REAL change, const bool keepCenter=true) override + { NB_OVERRIDE_PURE(Stretch, change, keepCenter); } + void RandomStretch(const REAL amplitude, const bool keepCenter=true) override + { NB_OVERRIDE_PURE(RandomStretch, amplitude, keepCenter); } +}; + +namespace { + +// StretchModeBondLength atom helpers +void _AddAtomSMBL(StretchModeBondLength& mode, MolAtom& a) +{ mode.mvTranslatedAtomList.insert(&a); } + +void _AddAtomsSMBL(StretchModeBondLength& mode, nb::object& l) +{ + for (auto h : l) mode.mvTranslatedAtomList.insert(&nb::cast(h)); +} + +nb::list _GetAtomsSMBL(StretchModeBondLength& mode) +{ + return ptrcontainerToPyList(mode.mvTranslatedAtomList); +} + +MolAtom* _GetAtom0BL(StretchModeBondLength& m) { return m.mpAtom0; } +MolAtom* _GetAtom1BL(StretchModeBondLength& m) { return m.mpAtom1; } + +// Angle/torsion mode helpers +template +void _AddAtom(T& mode, MolAtom& a) { mode.mvRotatedAtomList.insert(&a); } + +template +void _AddAtoms(T& mode, nb::object& l) +{ for (auto h : l) mode.mvRotatedAtomList.insert(&nb::cast(h)); } + +template +nb::list _GetAtoms(T& mode) +{ return ptrcontainerToPyList(mode.mvRotatedAtomList); } + +template MolAtom* _GetAtom0(T& m) { return m.mpAtom0; } +template MolAtom* _GetAtom1(T& m) { return m.mpAtom1; } +template MolAtom* _GetAtom2(T& m) { return m.mpAtom2; } + +} // namespace + +void wrap_stretchmode(nb::module_& m) +{ + nb::class_(m, "StretchMode") + .def("CalcDeriv", &StretchMode::CalcDeriv, nb::arg("derivllk") = true) + .def("Stretch", &StretchMode::Stretch, nb::arg("amplitude"), nb::arg("keepCenter") = true) + .def("RandomStretch", &StretchMode::RandomStretch, nb::arg("amplitude"), nb::arg("keepCenter") = true) + ; + + nb::class_(m, "StretchModeBondLength") + .def(nb::init(), + nb::arg("at0"), nb::arg("at1"), nb::arg("pBond") = nullptr, + nb::keep_alive<1,2>(), nb::keep_alive<1,3>()) + .def("AddAtom", &_AddAtomSMBL, nb::keep_alive<1,2>()) + .def("AddAtoms", &_AddAtomsSMBL, nb::keep_alive<1,2>()) + .def("GetAtoms", &_GetAtomsSMBL) + .def_prop_ro("mpAtom0", + &_GetAtom0BL, nb::rv_policy::reference_internal) + .def_prop_ro("mpAtom1", + &_GetAtom1BL, nb::rv_policy::reference_internal) + ; + + nb::class_(m, "StretchModeBondAngle") + .def(nb::init(), + nb::arg("at0"), nb::arg("at1"), nb::arg("at2"), nb::arg("pBondAngle") = nullptr, + nb::keep_alive<1,2>(), nb::keep_alive<1,3>(), nb::keep_alive<1,4>()) + .def("AddAtom", &_AddAtom, nb::keep_alive<1,2>()) + .def("AddAtoms", &_AddAtoms, nb::keep_alive<1,2>()) + .def("GetAtoms", &_GetAtoms) + .def_prop_ro("mpAtom0", + [](StretchModeBondAngle& m){ return m.mpAtom0; }, nb::rv_policy::reference_internal) + .def_prop_ro("mpAtom1", + [](StretchModeBondAngle& m){ return m.mpAtom1; }, nb::rv_policy::reference_internal) + .def_prop_ro("mpAtom2", + [](StretchModeBondAngle& m){ return m.mpAtom2; }, nb::rv_policy::reference_internal) + ; + + nb::class_(m, "StretchModeTorsion") + .def(nb::init(), + nb::arg("at0"), nb::arg("at1"), nb::arg("pDihedralAngle") = nullptr, + nb::keep_alive<1,2>(), nb::keep_alive<1,3>()) + .def("AddAtom", &_AddAtom, nb::keep_alive<1,2>()) + .def("AddAtoms", &_AddAtoms, nb::keep_alive<1,2>()) + .def("GetAtoms", &_GetAtoms) + .def_prop_ro("mpAtom1", + [](StretchModeTorsion& m){ return m.mpAtom1; }, nb::rv_policy::reference_internal) + .def_prop_ro("mpAtom2", + [](StretchModeTorsion& m){ return m.mpAtom2; }, nb::rv_policy::reference_internal) + ; + + nb::class_(m, "StretchModeTwist") + .def(nb::init(), + nb::arg("at0"), nb::arg("at1"), + nb::keep_alive<1,2>(), nb::keep_alive<1,3>()) + .def("AddAtom", &_AddAtom, nb::keep_alive<1,2>()) + .def("AddAtoms", &_AddAtoms, nb::keep_alive<1,2>()) + .def("GetAtoms", &_GetAtoms) + .def_prop_ro("mpAtom1", + [](StretchModeTwist& m){ return m.mpAtom1; }, nb::rv_policy::reference_internal) + .def_prop_ro("mpAtom2", + [](StretchModeTwist& m){ return m.mpAtom2; }, nb::rv_policy::reference_internal) + ; +} diff --git a/src/extensions/nb_unitcell.cpp b/src/extensions/nb_unitcell.cpp new file mode 100644 index 00000000..623f1861 --- /dev/null +++ b/src/extensions/nb_unitcell.cpp @@ -0,0 +1,123 @@ +/* + * pyobjcryst nanobind port — UnitCell bindings + */ + +#include +#include + +#include +#include + +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +namespace { + +nb::tuple FractionalToOrthonormal(const UnitCell& uc, double xd, double yd, double zd) +{ + REAL x=xd, y=yd, z=zd; + uc.FractionalToOrthonormalCoords(x, y, z); + return nb::make_tuple((double)x, (double)y, (double)z); +} + +nb::tuple OrthonormalToFractional(const UnitCell& uc, double xd, double yd, double zd) +{ + REAL x=xd, y=yd, z=zd; + uc.OrthonormalToFractionalCoords(x, y, z); + return nb::make_tuple((double)x, (double)y, (double)z); +} + +nb::tuple MillerToOrthonormal(const UnitCell& uc, double xd, double yd, double zd) +{ + REAL x=xd, y=yd, z=zd; + uc.MillerToOrthonormalCoords(x, y, z); + return nb::make_tuple((double)x, (double)y, (double)z); +} + +nb::tuple OrthonormalToMiller(const UnitCell& uc, double xd, double yd, double zd) +{ + REAL x=xd, y=yd, z=zd; + uc.OrthonormalToMillerCoords(x, y, z); + return nb::make_tuple((double)x, (double)y, (double)z); +} + +void _seta(UnitCell& u, double v) { u.GetPar("a").SetValue(v); } +double _geta(UnitCell& u) { return u.GetLatticePar(0); } +void _setb(UnitCell& u, double v) { u.GetPar("b").SetValue(v); } +double _getb(UnitCell& u) { return u.GetLatticePar(1); } +void _setc(UnitCell& u, double v) { u.GetPar("c").SetValue(v); } +double _getc(UnitCell& u) { return u.GetLatticePar(2); } + +void _setalpha(UnitCell& u, double v) { + if (v <= 0 || v >= M_PI) throw ObjCrystException("alpha must be within ]0;pi["); + RefinablePar& p = u.GetPar("alpha"); + if (p.IsUsed()) p.SetValue(v); +} +double _getalpha(UnitCell& u) { return u.GetLatticePar(3); } + +void _setbeta(UnitCell& u, double v) { + if (v <= 0 || v >= M_PI) throw ObjCrystException("beta must be within ]0;pi["); + RefinablePar& p = u.GetPar("beta"); + if (p.IsUsed()) p.SetValue(v); +} +double _getbeta(UnitCell& u) { return u.GetLatticePar(4); } + +void _setgamma(UnitCell& u, double v) { + if (v <= 0 || v >= M_PI) throw ObjCrystException("gamma must be within ]0;pi["); + RefinablePar& p = u.GetPar("gamma"); + if (p.IsUsed()) p.SetValue(v); +} +double _getgamma(UnitCell& u) { return u.GetLatticePar(5); } + +void SafeChangeSpaceGroup(UnitCell& u, const std::string& sgid) +{ + MuteObjCrystUserInfo muzzle; + u.ChangeSpaceGroup(sgid); +} + +} // namespace + +void wrap_unitcell(nb::module_& m) +{ + m.attr("refpartype_unitcell") = gpRefParTypeUnitCell; + m.attr("refpartype_unitcell_length") = gpRefParTypeUnitCellLength; + m.attr("refpartype_unitcell_angle") = gpRefParTypeUnitCellAngle; + + nb::class_(m, "UnitCell") + .def(nb::init<>()) + .def(nb::init()) + .def(nb::init()) + .def(nb::init()) + .def("GetLatticePar", + nb::overload_cast<>(&UnitCell::GetLatticePar, nb::const_)) + .def("GetLatticePar", + nb::overload_cast(&UnitCell::GetLatticePar, nb::const_)) + .def("GetClockLatticePar", &UnitCell::GetClockLatticePar, + nb::rv_policy::reference_internal) + .def("GetBMatrix", [](UnitCell& u){ return crystmat_to_array(u.GetBMatrix()); }) + .def("GetOrthMatrix", [](UnitCell& u){ return crystmat_to_array(u.GetOrthMatrix()); }) + .def("GetClockMetricMatrix", &UnitCell::GetClockMetricMatrix, + nb::rv_policy::reference_internal) + .def("GetOrthonormalCoords", &UnitCell::GetOrthonormalCoords) + .def("FractionalToOrthonormalCoords", &FractionalToOrthonormal) + .def("OrthonormalToFractionalCoords", &OrthonormalToFractional) + .def("MillerToOrthonormalCoords", &MillerToOrthonormal) + .def("OrthonormalToMillerCoords", &OrthonormalToMiller) + .def("GetSpaceGroup", + nb::overload_cast<>(&UnitCell::GetSpaceGroup), + nb::rv_policy::reference_internal) + .def("ChangeSpaceGroup", &SafeChangeSpaceGroup) + .def("GetVolume", &UnitCell::GetVolume) + .def("__str__", [](const UnitCell& u){ return obj_str(u); }) + .def_prop_rw("a", &_geta, &_seta) + .def_prop_rw("b", &_getb, &_setb) + .def_prop_rw("c", &_getc, &_setc) + .def_prop_rw("alpha", &_getalpha, &_setalpha) + .def_prop_rw("beta", &_getbeta, &_setbeta) + .def_prop_rw("gamma", &_getgamma, &_setgamma) + ; +} diff --git a/src/extensions/nb_zatom.cpp b/src/extensions/nb_zatom.cpp new file mode 100644 index 00000000..f9613b14 --- /dev/null +++ b/src/extensions/nb_zatom.cpp @@ -0,0 +1,33 @@ +#include +#include +#include +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +void wrap_zatom(nb::module_& m) +{ + nb::class_(m, "ZAtom") + .def("GetClassName", &ZAtom::GetClassName) + .def("GetName", &ZAtom::GetName) + .def("SetName", &ZAtom::SetName) + .def("GetZScatterer", nb::overload_cast<>(&ZAtom::GetZScatterer), + nb::rv_policy::reference_internal) + .def("GetZBondAtom", &ZAtom::GetZBondAtom) + .def("GetZAngleAtom", &ZAtom::GetZAngleAtom) + .def("GetZDihedralAngleAtom", &ZAtom::GetZDihedralAngleAtom) + .def("GetZBondLength", &ZAtom::GetZBondLength) + .def("GetZAngle", &ZAtom::GetZAngle) + .def("GetZDihedralAngle", &ZAtom::GetZDihedralAngle) + .def("GetOccupancy", &ZAtom::GetOccupancy) + .def("GetScatteringPower", &ZAtom::GetScatteringPower, + nb::rv_policy::reference_internal) + .def("SetZBondLength", &ZAtom::SetZBondLength) + .def("SetZAngle", &ZAtom::SetZAngle) + .def("SetZDihedralAngle", &ZAtom::SetZDihedralAngle) + .def("SetOccupancy", &ZAtom::SetOccupancy) + .def("SetScatteringPower", &ZAtom::SetScatteringPower, + nb::keep_alive<1,2>()) + ; +} diff --git a/src/extensions/nb_zpolyhedron.cpp b/src/extensions/nb_zpolyhedron.cpp new file mode 100644 index 00000000..728f1192 --- /dev/null +++ b/src/extensions/nb_zpolyhedron.cpp @@ -0,0 +1,37 @@ +#include +#include +#include +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +void wrap_zpolyhedron(nb::module_& m) +{ + nb::enum_(m, "RegularPolyhedraType") + .value("TETRAHEDRON", TETRAHEDRON) + .value("OCTAHEDRON", OCTAHEDRON) + .value("SQUARE_PLANE", SQUARE_PLANE) + .value("CUBE", CUBE) + .value("ANTIPRISM_TETRAGONAL", ANTIPRISM_TETRAGONAL) + .value("PRISM_TETRAGONAL_MONOCAP", PRISM_TETRAGONAL_MONOCAP) + .value("PRISM_TETRAGONAL_DICAP", PRISM_TETRAGONAL_DICAP) + .value("PRISM_TRIGONAL", PRISM_TRIGONAL) + .value("PRISM_TRIGONAL_TRICAPPED", PRISM_TRIGONAL_TRICAPPED) + .value("ICOSAHEDRON", ICOSAHEDRON) + .value("TRIANGLE_PLANE", TRIANGLE_PLANE) + .export_values() + ; + + nb::class_(m, "ZPolyhedron") + .def(nb::init()) + .def(nb::init(), + nb::arg("type"), nb::arg("cryst"), nb::arg("x"), nb::arg("y"), nb::arg("z"), + nb::arg("name"), nb::arg("centralAtomPow"), nb::arg("periphAtomPow"), + nb::arg("centralPeriphDist"), nb::arg("ligandPopu") = 1., + nb::arg("phi") = 0., nb::arg("chi") = 0., nb::arg("psi") = 0., + nb::keep_alive<1,3>(), nb::keep_alive<1,8>(), nb::keep_alive<1,9>()) + ; +} diff --git a/src/extensions/nb_zscatterer.cpp b/src/extensions/nb_zscatterer.cpp new file mode 100644 index 00000000..47f411cc --- /dev/null +++ b/src/extensions/nb_zscatterer.cpp @@ -0,0 +1,81 @@ +#include +#include +#include +#include +#include +#include "helpers_nb.hpp" + +namespace nb = nanobind; +using namespace ObjCryst; + +struct PyZScatterer : ZScatterer { + NB_TRAMPOLINE(ZScatterer, 1); + // Explicit constructors to help nanobind find them + PyZScatterer(const std::string& name, Crystal& cryst, + REAL x=0, REAL y=0, REAL z=0, + REAL phi=0, REAL chi=0, REAL psi=0) + : ZScatterer(name, cryst, x, y, z, phi, chi, psi) {} + PyZScatterer(const ZScatterer& old) : ZScatterer(old) {} + ZScatterer* CreateCopy() const override { NB_OVERRIDE_PURE(CreateCopy); } +}; + +namespace { +void _ImportFenskeHallZMatrix(ZScatterer& scatt, nb::object input, bool named) +{ + MuteObjCrystUserInfo muzzle; + CaptureStdOut gag; + std::string s = read_pyfile_to_string(input); + std::istringstream in(s); + scatt.ImportFenskeHallZMatrix(in, named); +} +} // namespace + +void wrap_zscatterer(nb::module_& m) +{ + nb::class_(m, "ZScatterer") + .def(nb::init(), nb::arg("old")) + .def(nb::init(), + nb::arg("name"), nb::arg("cryst"), + nb::arg("x") = 0., nb::arg("y") = 0., nb::arg("z") = 0., + nb::arg("phi") = 0., nb::arg("chi") = 0., nb::arg("psi") = 0., + nb::keep_alive<1,3>()) + .def("GetClassName", &ZScatterer::GetClassName) + .def("AddAtom", &ZScatterer::AddAtom, + nb::arg("name"), nb::arg("pow"), + nb::arg("atomBond"), nb::arg("bondLength"), + nb::arg("atomAngle"), nb::arg("bondAngle"), + nb::arg("atomDihedral"), nb::arg("dihedralAngle"), + nb::arg("popu") = 1.0, + nb::keep_alive<1,3>()) + .def("GetPhi", &ZScatterer::GetPhi) + .def("GetChi", &ZScatterer::GetChi) + .def("GetPsi", &ZScatterer::GetPsi) + .def("SetPhi", &ZScatterer::SetPhi) + .def("SetChi", &ZScatterer::SetChi) + .def("SetPsi", &ZScatterer::SetPsi) + .def("GetZAtomX", &ZScatterer::GetZAtomX) + .def("GetZAtomY", &ZScatterer::GetZAtomY) + .def("GetZAtomZ", &ZScatterer::GetZAtomZ) + .def("GetZBondAtom", &ZScatterer::GetZBondAtom) + .def("GetZAngleAtom", &ZScatterer::GetZAngleAtom) + .def("GetZDihedralAngleAtom", &ZScatterer::GetZDihedralAngleAtom) + .def("GetZBondLength", &ZScatterer::GetZBondLength) + .def("GetZAngle", &ZScatterer::GetZAngle) + .def("GetZDihedralAngle", &ZScatterer::GetZDihedralAngle) + .def("SetZBondLength", &ZScatterer::SetZBondLength) + .def("SetZAngle", &ZScatterer::SetZAngle) + .def("SetZDihedralAngle", &ZScatterer::SetZDihedralAngle) + .def("GetZAtomRegistry", + [](ZScatterer& z) -> const ObjRegistry& { return z.GetZAtomRegistry(); }, + nb::rv_policy::reference_internal) + .def("GetXCoord", [](ZScatterer& z){ return crystvec_to_array(z.GetXCoord()); }) + .def("GetYCoord", [](ZScatterer& z){ return crystvec_to_array(z.GetYCoord()); }) + .def("GetZCoord", [](ZScatterer& z){ return crystvec_to_array(z.GetZCoord()); }) + .def("SetCenterAtomIndex", &ZScatterer::SetCenterAtomIndex) + .def("GetCenterAtomIndex", &ZScatterer::GetCenterAtomIndex) + .def("ImportFenskeHallZMatrix", &_ImportFenskeHallZMatrix, + nb::arg("input"), nb::arg("named") = false) + .def("__str__", [](ZScatterer& z){ return obj_str(z); }) + ; +} diff --git a/src/extensions/objregistry_ext.cpp b/src/extensions/objregistry_ext.cpp deleted file mode 100644 index 42932b21..00000000 --- a/src/extensions/objregistry_ext.cpp +++ /dev/null @@ -1,208 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::ObjRegistry template class. -* -* Changes from ObjCryst::ObjRegistry -* - DeleteAll not wrapped -* - C++ methods that can return const or non-const objects return non-const -* objects in python. -* -*****************************************************************************/ - -#include -#include -#include -#include -#undef B0 - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "helpers.hpp" - -using namespace ObjCryst; -using namespace boost::python; - -namespace { - -// Get objects by slice -template bp::object getObjSlice(ObjRegistry& o, bp::slice& s) -{ - bp::list l; - - for(typename std::vector::const_iterator it = o.begin(); it != o.end(); ++it) - { - l.append(bp::ptr(*it)); - } - return l[s]; -} - -// Get a MonteCarloObj by dynamic casting. This assumes that the caller (from python) -// first checked the correct type e.g. using GetClassName() -template MonteCarloObj& getObjCastMonteCarlo(ObjRegistry& reg, const unsigned int i) -{ - T* obj = ®.GetObj(i); - MonteCarloObj *p = dynamic_cast(obj); - return *p; -} - -// Explicit specialization for ZAtom which is not polymorphic -template <> MonteCarloObj& getObjCastMonteCarlo(ObjRegistry& reg, const unsigned int i) -{ - throw ObjCryst::ObjCrystException("Cannot cast a ZAtom to a MonteCarloObj"); -} - - -/* Wrap all the class methods for the template class */ -template -void -wrapClass(class_ > & c) -{ - /* Functions */ - c.def("Register", &ObjRegistry::Register) - .def("DeRegister", (void (ObjRegistry::*)(T&)) - &ObjRegistry::DeRegister) - .def("DeRegister", - (void (ObjRegistry::*)(const string&)) - &ObjRegistry::DeRegister) - .def("DeRegisterAll", &ObjRegistry::DeRegisterAll) - // Dangerous and not wrapped - //.def("DeleteAll", &ObjRegistry::DeleteAll) - .def("GetObj", (T& (ObjRegistry::*)(const unsigned int)) - &ObjRegistry::GetObj, - return_internal_reference<>()) - .def("GetObj", - (T& (ObjRegistry::*)(const string&)) &ObjRegistry::GetObj, - return_internal_reference<>()) - .def("GetObj", - (T& (ObjRegistry::*)(const string&, const string&)) - &ObjRegistry::GetObj, - return_internal_reference<>()) - .def("GetNb", &ObjRegistry::GetNb) - .def("Print", &ObjRegistry::Print) - .def("SetName", &ObjRegistry::SetName) - .def("GetName", &ObjRegistry::GetName, - return_value_policy()) - .def("Find", (long (ObjRegistry::*)(const string&) const) - &ObjRegistry::Find) - .def("Find", - (long (ObjRegistry::*) - (const string&, const string&, const bool) const) - &ObjRegistry::Find) - .def("Find", (long (ObjRegistry::*)(const T&) const) - &ObjRegistry::Find) - .def("GetRegistryClock", &ObjRegistry::GetRegistryClock, - return_value_policy()) - // Python-only methods - .def("__str__", &__str__< ObjRegistry >) - .def("__len__", &ObjRegistry::GetNb) - .def("__getitem__", &getObjSlice, - with_custodian_and_ward_postcall<1,0>()) - .def("__getitem__", (T& (ObjRegistry::*)(const unsigned int)) - &ObjRegistry::GetObj, - return_internal_reference<>()) - // Note to indexing robots: It took me a while to understand how this worked, - // so that the object would be returned instead of the pointer ! - // The definition of NextPolicies use in boost.python range is quite obscure - // - // Unrelated note: this can be dangerous, as the registry is susceptible to - // change while being iterated. Example - // c = pyobjcryst.crystal.Crystal(...) - // for c in pyobjcryst.crystal.gCrystalRegistry: print(c.GetName()) - // => this will erase the first crystal 'c' when looping other the registry, - // which will effectively invalidate the iterator... - .def("__iter__", range > - (&ObjRegistry::list_begin, &ObjRegistry::list_end)) - // Special casting functions so base class object registries can still - // provide access to the correct python object - .def("_getObjCastMonteCarlo", &getObjCastMonteCarlo, return_internal_reference<>()) - ; -} - -} // end namespace - - -void wrap_objregistry() -{ - // Template instantiation - - // ObjRegistry - class_< ObjRegistry > - CrystalRegistry("CrystalRegistry", - init()); - wrapClass(CrystalRegistry); - - // ObjRegistry - class_< ObjRegistry > - PowderPatternRegistry("PowderPatternRegistry", - init()); - wrapClass(PowderPatternRegistry); - - // ObjRegistry - class_< ObjRegistry > - DiffractionDataSingleCrystalRegistry("DiffractionDataSingleCrystalRegistry", - init()); - wrapClass(DiffractionDataSingleCrystalRegistry); - - // ObjRegistry - class_< ObjRegistry > - OptimizationObjRegistry("OptimizationObjRegistry", - init()); - wrapClass(OptimizationObjRegistry); - - // ObjRegistry - class_< ObjRegistry > - RefinableObjRegistry("RefinableObjRegistry", - init()); - wrapClass(RefinableObjRegistry); - - // ObjRegistry - class_< ObjRegistry > - RefObjOptRegistry("RefObjOpt", - init()); - wrapClass(RefObjOptRegistry); - - // ObjRegistry - class_< ObjRegistry > - ScattererRegistry("ScattererRegistry", - init()); - wrapClass(ScattererRegistry); - - // ObjRegistry - class_< ObjRegistry > - ScatteringPowerRegistry("ScatteringPowerRegistry", - init()); - wrapClass(ScatteringPowerRegistry); - - // ObjRegistry - class_< ObjRegistry > - ScatteringPowerAtomRegistry("ScatteringPowerAtomRegistry", - init()); - wrapClass(ScatteringPowerAtomRegistry); - - // ObjRegistry - class_< ObjRegistry > - ZAtomRegistry("ZAtomRegistry", - init()); - wrapClass(ZAtomRegistry); - -} diff --git a/src/extensions/polyhedron_ext.cpp b/src/extensions/polyhedron_ext.cpp deleted file mode 100644 index e29c7f4c..00000000 --- a/src/extensions/polyhedron_ext.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::Polyhedron module. -* -*****************************************************************************/ - -#include -#include -#include -#include - -#include - -namespace bp = boost::python; -using namespace boost::python; -using namespace ObjCryst; - -void wrap_polyhedron() -{ - - def("MakeTetrahedron", &MakeTetrahedron, - (bp::arg("cryst"), bp::arg("name"), bp::arg("centralAtom"), - bp::arg("peripheralAtom"), bp::arg("dist")), - with_custodian_and_ward_postcall<0,3, - with_custodian_and_ward_postcall<0,4, - return_value_policy > >()); - - def("MakeOctahedron", &MakeOctahedron, - (bp::arg("cryst"), bp::arg("name"), bp::arg("centralAtom"), - bp::arg("peripheralAtom"), bp::arg("dist")), - with_custodian_and_ward_postcall<0,3, - with_custodian_and_ward_postcall<0,4, - return_value_policy > >()); - - def("MakeSquarePlane", &MakeSquarePlane, - (bp::arg("cryst"), bp::arg("name"), bp::arg("centralAtom"), - bp::arg("peripheralAtom"), bp::arg("dist")), - with_custodian_and_ward_postcall<0,3, - with_custodian_and_ward_postcall<0,4, - return_value_policy > >()); - - def("MakeCube", &MakeCube, - (bp::arg("cryst"), bp::arg("name"), bp::arg("centralAtom"), - bp::arg("peripheralAtom"), bp::arg("dist")), - with_custodian_and_ward_postcall<0,3, - with_custodian_and_ward_postcall<0,4, - return_value_policy > >()); - - def("MakeAntiPrismTetragonal", &MakeAntiPrismTetragonal, - (bp::arg("cryst"), bp::arg("name"), bp::arg("centralAtom"), - bp::arg("peripheralAtom"), bp::arg("dist")), - with_custodian_and_ward_postcall<0,3, - with_custodian_and_ward_postcall<0,4, - return_value_policy > >()); - - def("MakePrismTrigonal", &MakePrismTrigonal, - (bp::arg("cryst"), bp::arg("name"), bp::arg("centralAtom"), - bp::arg("peripheralAtom"), bp::arg("dist")), - with_custodian_and_ward_postcall<0,3, - with_custodian_and_ward_postcall<0,4, - return_value_policy > >()); - - def("MakeIcosahedron", &MakeIcosahedron, - (bp::arg("cryst"), bp::arg("name"), bp::arg("centralAtom"), - bp::arg("peripheralAtom"), bp::arg("dist")), - with_custodian_and_ward_postcall<0,3, - with_custodian_and_ward_postcall<0,4, - return_value_policy > >()); - - def("MakeTriangle", &MakeTriangle, - (bp::arg("cryst"), bp::arg("name"), bp::arg("centralAtom"), - bp::arg("peripheralAtom"), bp::arg("dist")), - with_custodian_and_ward_postcall<0,3, - with_custodian_and_ward_postcall<0,4, - return_value_policy > >()); - -} diff --git a/src/extensions/powderpattern_ext.cpp b/src/extensions/powderpattern_ext.cpp deleted file mode 100644 index c40f71a7..00000000 --- a/src/extensions/powderpattern_ext.cpp +++ /dev/null @@ -1,401 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst -* -* File coded by: Vincent Favre-Nicolin -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::PowderPattern. -* -* Changes from ObjCryst::PowderPattern -* -* Other Changes -* -*****************************************************************************/ - -#include -#include -#include -#include -#include -#undef B0 - -#include -#include - -#include -#include -#include - -#include "python_streambuf.hpp" -#include "helpers.hpp" - -namespace bp = boost::python; -using namespace boost::python; -using namespace ObjCryst; - -namespace { - -// This creates a C++ PowderPattern object -PowderPattern* _CreatePowderPatternFromCIF(bp::object input) -{ - // Reading a cif file creates some output via fpObjCrystInformUser. - // Mute the output and restore it on return or exception. - // Also mute any hardcoded output to cout. - MuteObjCrystUserInfo muzzle; - CaptureStdOut gag; - - boost_adaptbx::python::streambuf sbuf(input); - boost_adaptbx::python::streambuf::istream in(sbuf); - ObjCryst::CIF cif(in); - - int idx0 = gPowderPatternRegistry.GetNb(); - - ObjCryst::PowderPattern* p = ObjCryst::CreatePowderPatternFromCIF(cif); - - gag.release(); - muzzle.release(); - - int idx = gPowderPatternRegistry.GetNb(); - if(idx == idx0) - { - throw ObjCryst::ObjCrystException("Cannot create powder pattern from CIF"); - } - - return p; -} - -// This reads the CIF into an existing PowderPattern object -PowderPattern* _CreatePowderPatternFromCIF(bp::object input, PowderPattern &p) -{ - // Reading a cif file creates some output via fpObjCrystInformUser. - // Mute the output and restore it on return or exception. - // Also mute any hardcoded output to cout. - MuteObjCrystUserInfo muzzle; - CaptureStdOut gag; - - boost_adaptbx::python::streambuf sbuf(input); - boost_adaptbx::python::streambuf::istream in(sbuf); - ObjCryst::CIF cif(in); - - bool import_ok = false; - - for(map::iterator pos=cif.mvData.begin();pos!=cif.mvData.end();++pos) - { - if(pos->second.mPowderPatternObs.size()>10) - { - p.ImportPowderPatternCIF(cif); - (*fpObjCrystInformUser)((boost::format("CIF: Imported POWDER PATTERN, with %d points") % p.GetNbPoint()).str()); - import_ok = true; - break; // only import one powder pattern - } - } - - gag.release(); - muzzle.release(); - - if(!import_ok) - { - throw ObjCryst::ObjCrystException("Cannot create powder pattern from CIF"); - } - - return &p; -} - - -PowderPatternBackground& addppbackground(PowderPattern& pp) -{ - PowderPatternBackground* ppc = new PowderPatternBackground(); - pp.AddPowderPatternComponent(*ppc); - return *ppc; -} - - -PowderPatternDiffraction& addppdiffraction(PowderPattern& pp, Crystal& crst) -{ - std::unique_ptr ppc(new PowderPatternDiffraction()); - ppc->SetCrystal(crst); - // Prepare against the target powder-pattern context before final - // registration so a no-reflections failure cannot leave a broken - // partially attached component behind. - ppc->SetParentPowderPattern(pp); - ppc->GenHKLFullSpace(); - if(ppc->GetNbReflBelowMaxSinThetaOvLambda() == 0) - { - throw ObjCrystException( - "PowderPatternDiffraction::CalcSinThetaLambda(): there are no reflections!" - ); - } - pp.AddPowderPatternComponent(*ppc); - try - { - pp.Prepare(); - } - catch(...) - { - pp.RemovePowderPatternComponent(*ppc); - throw; - } - return *ppc.release(); -} - - -void setpowderpatternx (PowderPattern& pp, bp::object x) -{ - CrystVector_REAL cvx; - assignCrystVector(cvx, x); - pp.SetPowderPatternX(cvx); -} - - -void setpowderpatternobs (PowderPattern& pp, bp::object x) -{ - CrystVector_REAL cvx; - assignCrystVector(cvx, x); - MuteObjCrystUserInfo muzzle; - pp.SetPowderPatternObs(cvx); -} - -void setpowderpatternobssigma (PowderPattern& pp, bp::object x) -{ - CrystVector_REAL cvx; - assignCrystVector(cvx, x); - pp.SetPowderPatternObsSigma(cvx); -} - - -// Allow override (since we can't benefit from override in RefinableObjWrap) -class PowderPatternWrap : public PowderPattern, public wrapper -{ - public: - PowderPatternWrap() : PowderPattern() {} - - PowderPatternWrap(const PowderPattern& p) : PowderPattern(p){} - - PeakList _FindPeaks(const float dmin=2.0,const float maxratio=0.01, - const unsigned int maxpeak=100, const bool verbose=true) - { - CaptureStdOut gag; - if(verbose) gag.release(); - return this->FindPeaks(dmin, maxratio, maxpeak); - } - - void default_UpdateDisplay() const - { this->PowderPattern::UpdateDisplay();} - - virtual void UpdateDisplay() const - { - override f = this->get_override("UpdateDisplay"); - if (f) f(); - else default_UpdateDisplay(); - } - -}; - -std::string __str__SPGScore(SPGScore& s) -{ - if(s.ngof>0.0001) - return (boost::format("%-13s nGoF=%9.4f GoF=%8.3f Rw=%5.2f [%3d reflections, extinct446=%3d]") - % s.hm % s.ngof % s.gof % s.rw %s.nbreflused %s.nbextinct446).str(); - - return (boost::format("%-13s GoF=%8.3f Rw=%4.2f [extinct446=%3d]") - % s.hm % s.gof % s.rw %s.nbreflused %s.nbextinct446).str(); -} - -bp::list _GetScores(const SpaceGroupExplorer &spgex) -{ - return containerToPyList(spgex.GetScores()); -} - -} // namespace - -void wrap_powderpattern() -{ - // Global object registry - scope().attr("gPowderPatternRegistry") = boost::cref(gPowderPatternRegistry); - - class_ >("PowderPattern") - .def("AddPowderPatternBackground", - &addppbackground, - return_internal_reference<>()) - .def("AddPowderPatternDiffraction", - &addppdiffraction, - with_custodian_and_ward_postcall<1,0, - with_custodian_and_ward_postcall<0,2,return_internal_reference<> > > ()) - .def("GetNbPowderPatternComponent", - &PowderPattern::GetNbPowderPatternComponent) - .def("GetPowderPatternComponent", - (PowderPatternComponent& (PowderPattern::*) (const int)) - &PowderPattern::GetPowderPatternComponent, - return_internal_reference<>()) - .def("FindPeaks", &PowderPatternWrap::_FindPeaks, - (bp::arg("dmin")=2.0, bp::arg("maxratio")=0.01, - bp::arg("maxpeak")=100, bp::arg("verbose")=false)) - .def("GetScaleFactor", - (REAL (PowderPattern::*) (const int) const) - &PowderPattern::GetScaleFactor) - .def("GetScaleFactor", - (REAL (PowderPattern::*) (const PowderPatternComponent&) const) - &PowderPattern::GetScaleFactor) - .def("SetScaleFactor", - (void (PowderPattern::*) (const int, REAL)) - &PowderPattern::SetScaleFactor) - .def("SetPowderPatternPar", - &PowderPattern::SetPowderPatternPar, - (bp::arg("xmin"), bp::arg("xstep"), bp::arg("nbpoints"))) - .def("SetPowderPatternX", - &setpowderpatternx, - bp::arg("x")) - .def("GetPowderPatternCalc", - &PowderPattern::GetPowderPatternCalc, - return_value_policy()) - .def("GetPowderPatternObs", - &PowderPattern::GetPowderPatternObs, - return_value_policy()) - .def("GetPowderPatternObsSigma", - &PowderPattern::GetPowderPatternObsSigma, - return_value_policy()) - .def("GetPowderPatternX", - &PowderPattern::GetPowderPatternX, - return_value_policy()) - .def("GetNbPoint", &PowderPattern::GetNbPoint) - .def("GetNbPointUsed", &PowderPattern::GetNbPoint) - .def("GetRadiation", - (Radiation& (PowderPattern::*)()) &PowderPattern::GetRadiation, - return_internal_reference<>()) - .def("GetRadiationType", &PowderPattern::GetRadiationType) - .def("SetRadiationType", &PowderPattern::SetRadiationType) - .def("GetWavelength", &PowderPattern::GetWavelength) - .def("SetWavelength", - (void (PowderPattern::*) (const REAL)) - &PowderPattern::SetWavelength, bp::arg("wavelength")) - .def("SetWavelength", - (void (PowderPattern::*) (const string&, const REAL)) - &PowderPattern::SetWavelength, - (bp::arg("XRayTubeElementName"), bp::arg("alpha2Alpha2ratio")=0.5)) - .def("SetEnergy", - &DiffractionDataSingleCrystal::SetEnergy, - bp::arg("nrj_kev")) - .def("ImportPowderPatternFullprof", - &PowderPattern::ImportPowderPatternFullprof, - bp::arg("filename")) - .def("ImportPowderPatternPSI_DMC", - &PowderPattern::ImportPowderPatternPSI_DMC, - bp::arg("filename")) - .def("ImportPowderPatternILL_D1A5", - &PowderPattern::ImportPowderPatternILL_D1A5, - bp::arg("filename")) - .def("ImportPowderPatternXdd", - &PowderPattern::ImportPowderPatternXdd, - bp::arg("filename")) - .def("ImportPowderPatternSietronicsCPI", - &PowderPattern::ImportPowderPatternSietronicsCPI, - bp::arg("filename")) - .def("ImportPowderPattern2ThetaObsSigma", - &PowderPattern::ImportPowderPattern2ThetaObsSigma, - (bp::arg("filename"), bp::arg("nbSkip")=0)) - .def("ImportPowderPatternFullprof4", - &PowderPattern::ImportPowderPatternFullprof4, - bp::arg("filename")) - .def("ImportPowderPatternMultiDetectorLLBG42", - &PowderPattern::ImportPowderPatternMultiDetectorLLBG42, - bp::arg("filename")) - .def("ImportPowderPattern2ThetaObs", - &PowderPattern::ImportPowderPattern2ThetaObs, - (bp::arg("filename"), bp::arg("nbSkip")=0)) - .def("ImportPowderPatternTOF_ISIS_XYSigma", - &PowderPattern::ImportPowderPatternTOF_ISIS_XYSigma, - bp::arg("filename")) - .def("ImportPowderPatternGSAS", - &PowderPattern::ImportPowderPatternGSAS, - bp::arg("filename")) - .def("SetPowderPatternObs", - &setpowderpatternobs, - bp::arg("obs")) - .def("SetPowderPatternObsSigma", - &setpowderpatternobssigma, - bp::arg("sigma")) - .def("FitScaleFactorForR", - &PowderPattern::FitScaleFactorForR) - .def("FitScaleFactorForIntegratedR", - &PowderPattern::FitScaleFactorForIntegratedR) - .def("FitScaleFactorForRw", - &PowderPattern::FitScaleFactorForRw) - .def("FitScaleFactorForIntegratedRw", - &PowderPattern::FitScaleFactorForIntegratedRw) - .def("SetMaxSinThetaOvLambda", - &PowderPattern::SetMaxSinThetaOvLambda, - bp::arg("max")) - .def("GetMaxSinThetaOvLambda", - &PowderPattern::GetMaxSinThetaOvLambda) - .def("X2XCorr", &PowderPattern::X2XCorr) - .def("X2PixelCorr", &PowderPattern::X2PixelCorr) - .def("X2Pixel", &PowderPattern::X2Pixel) - .def("STOL2X", &PowderPattern::STOL2X) - .def("X2STOL", &PowderPattern::X2STOL) - .def("X2XCorr", &PowderPattern::X2XCorr) - .def("STOL2Pixel", &PowderPattern::STOL2Pixel) - .def("UpdateDisplay", &PowderPattern::UpdateDisplay, - &PowderPatternWrap::default_UpdateDisplay) - .def("GetR", &PowderPattern::GetR) - .def("GetIntegratedR", &PowderPattern::GetIntegratedR) - .def("GetRw", &PowderPattern::GetRw) - .def("GetIntegratedRw", &PowderPattern::GetIntegratedRw) - .def("GetChi2", &PowderPattern::GetChi2) - .def("GetIntegratedChi2", &PowderPattern::GetIntegratedChi2) - .def("GetLogLikelihood", &PowderPattern::GetLogLikelihood) - .def("Prepare", &PowderPattern::Prepare) - .add_property("mur", &PowderPattern::GetMuR, &PowderPattern::SetMuR) - .add_property("r", &PowderPattern::GetR) - .add_property("r_integrated", &PowderPattern::GetIntegratedR) - .add_property("rw", &PowderPattern::GetRw) - .add_property("rw_integrated", &PowderPattern::GetIntegratedRw) - .add_property("chi2", &PowderPattern::GetChi2) - .add_property("chi2_integrated", &PowderPattern::GetIntegratedChi2) - .add_property("llk", &PowderPattern::GetLogLikelihood) - .add_property("wavelength", &PowderPattern::GetWavelength, - (void (PowderPattern::*)(double)) &PowderPattern::SetWavelength) - ; - - class_("SPGScore", init > - ((bp::arg("hermann_mauguin"), bp::arg("rw"), bp::arg("gof"), - bp::arg("nbextinct"), bp::arg("ngof")=0))) - .def_readonly("hermann_mauguin", &SPGScore::hm) - .def_readonly("Rw", &SPGScore::rw) - .def_readonly("GoF", &SPGScore::gof) - .def_readonly("nGoF", &SPGScore::ngof) - .def("__str__", &__str__SPGScore) - .def("__repr__", &__str__SPGScore) - ; - //,init(bp::arg("powdiff")),with_custodian_and_ward_postcall<1,2>() - class_("SpaceGroupExplorer", init - ((bp::arg("powdiff"))) [with_custodian_and_ward<1,2>()]) - .def("Run", (SPGScore (SpaceGroupExplorer::*)(const string&, const bool, const bool, const bool, const bool, - const double, const double)) - &SpaceGroupExplorer::Run, - (bp::arg("spg"), bp::arg("fitprofile")=false, bp::arg("verbose")=false, - bp::arg("restore_orig")=false, bp::arg("update_display")=false, - bp::arg("relative_length_tolerance")=0.01, bp::arg("absolute_angle_tolerance_degree")=1)) - .def("RunAll", &SpaceGroupExplorer::RunAll, - (bp::arg("fitprofile_all")=false, bp::arg("verbose")=true, - bp::arg("keep_best")=true, bp::arg("update_display")=true, - bp::arg("fitprofile_p1")=true, bp::arg("relative_length_tolerance")=0.01, - bp::arg("absolute_angle_tolerance_degree")=1)) - .def("GetScores", &_GetScores) - ; - - // This will only return a C++ PowderPattern object - def("CreatePowderPatternFromCIF", - (PowderPattern* (*)(bp::object input)) &_CreatePowderPatternFromCIF, bp::arg("file"), - return_value_policy()); - - // This can update a PowderPattern object with python methods - def("CreatePowderPatternFromCIF", - (PowderPattern* (*)(bp::object input, PowderPattern &)) &_CreatePowderPatternFromCIF, (bp::arg("file"), bp::arg("powpat")), - return_value_policy()); -} diff --git a/src/extensions/powderpatternbackground_ext.cpp b/src/extensions/powderpatternbackground_ext.cpp deleted file mode 100644 index 5a99d4ff..00000000 --- a/src/extensions/powderpatternbackground_ext.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst -* -* File coded by: Vincent Favre-Nicolin -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::PowderPatternBackground. -* -* Changes from ObjCryst::PowderPatternBackground -* -* Other Changes -* -*****************************************************************************/ - -#include -#include -#include -#include - -#undef B0 - -#include - -#include "helpers.hpp" - -namespace bp = boost::python; -using namespace ObjCryst; -using namespace boost::python; - -namespace { - -void _SetInterpPoints(PowderPatternBackground& b, - bp::object tth, bp::object backgd) -{ - CrystVector_REAL cvtth, cvbackg; - assignCrystVector(cvtth, tth); - assignCrystVector(cvbackg, backgd); - b.SetInterpPoints(cvtth, cvbackg); -} - -void _OptimizeBayesianBackground(PowderPatternBackground *pbackgd, const bool verbose=false) -{ - CaptureStdOut gag; - if(verbose) gag.release(); - pbackgd->OptimizeBayesianBackground(); -} - -const CrystVector_REAL& _GetInterpPointsX(PowderPatternBackground *pbackgd) -{ - return *(pbackgd->GetInterpPoints().first); -} - -const CrystVector_REAL& _GetInterpPointsY(PowderPatternBackground *pbackgd) -{ - return *(pbackgd->GetInterpPoints().second); -} - - -} // namespace - - -void wrap_powderpatternbackground() -{ - scope().attr("refpartype_scattdata_background") = object(ptr(gpRefParTypeScattDataBackground)); - - class_, boost::noncopyable>( - "PowderPatternBackground", no_init) - //.def("SetParentPowderPattern", &PowderPatternBackground::SetParentPowderPattern) - .def("GetPowderPatternCalc", - &PowderPatternBackground::GetPowderPatternCalc, - return_value_policy()) - .def("ImportUserBackground", - &PowderPatternBackground::ImportUserBackground, - bp::arg("filename")) - .def("SetInterpPoints", - _SetInterpPoints, - (bp::arg("tth"), bp::arg("backgd"))) - .def("GetInterpPointsX", - &_GetInterpPointsX, - return_value_policy()) - .def("GetInterpPointsY", - &_GetInterpPointsY, - return_value_policy()) - .def("OptimizeBayesianBackground", - &_OptimizeBayesianBackground, (bp::arg("verbose")=false)) - .def("FixParametersBeyondMaxresolution", - &PowderPatternBackground::FixParametersBeyondMaxresolution, - bp::arg("obj")) - ; -} diff --git a/src/extensions/powderpatterncomponent_ext.cpp b/src/extensions/powderpatterncomponent_ext.cpp deleted file mode 100644 index e39c01ef..00000000 --- a/src/extensions/powderpatterncomponent_ext.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst -* -* File coded by: Vincent Favre-Nicolin -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::PowderPatternComponent. -* -* Changes from ObjCryst::PowderPatternComponent -* -* Other Changes -* -*****************************************************************************/ - -#include -#undef B0 - -#include - -namespace bp = boost::python; -using namespace boost::python; -using namespace ObjCryst; - - -void wrap_powderpatterncomponent() -{ - class_, boost::noncopyable> - ("PowderPatternComponent", no_init) - .def("GetParentPowderPattern", - (PowderPattern& (PowderPatternComponent::*)()) - &PowderPatternComponent::GetParentPowderPattern, - return_internal_reference<>()) - ; -} diff --git a/src/extensions/powderpatterndiffraction_ext.cpp b/src/extensions/powderpatterndiffraction_ext.cpp deleted file mode 100644 index 839c9252..00000000 --- a/src/extensions/powderpatterndiffraction_ext.cpp +++ /dev/null @@ -1,96 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst -* -* File coded by: Vincent Favre-Nicolin -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::PowderPatternDiffraction. -* -* Changes from ObjCryst::PowderPatternDiffraction -* -* Other Changes -* -*****************************************************************************/ - -#include -#include -#include -#include -#undef B0 - -#include -#include -#include -#include - -namespace bp = boost::python; -using namespace boost::python; -using namespace ObjCryst; - -namespace -{ - -void SetProfileCopy(PowderPatternDiffraction &pdiff, - const ReflectionProfile &profile) -{ - pdiff.SetProfile(profile.CreateCopy()); -} - -} // namespace - - -void wrap_powderpatterndiffraction() -{ - enum_("ReflectionProfileType") - .value("PROFILE_GAUSSIAN", PROFILE_GAUSSIAN) - .value("PROFILE_LORENTZIAN", PROFILE_LORENTZIAN) - .value("PROFILE_PSEUDO_VOIGT", PROFILE_PSEUDO_VOIGT) - .value("PROFILE_PSEUDO_VOIGT_FINGER_COX_JEPHCOAT", - PROFILE_PSEUDO_VOIGT_FINGER_COX_JEPHCOAT) - .value("PROFILE_PEARSON_VII", PROFILE_PEARSON_VII) - ; - - class_ >( - "PowderPatternDiffraction", no_init) - .def("GetPowderPatternCalc", - &PowderPatternDiffraction::GetPowderPatternCalc, - return_value_policy()) - .def("SetReflectionProfilePar", - &PowderPatternDiffraction::SetReflectionProfilePar, - (bp::arg("type")=PROFILE_PSEUDO_VOIGT, - bp::arg("fwhmCagliotiW")=1e-6, - bp::arg("fwhmCagliotiU")=0, - bp::arg("fwhmCagliotiV")=0, - bp::arg("eta0")=0.5, bp::arg("eta1")=0)) - .def("GetProfile", - (ReflectionProfile& (PowderPatternDiffraction::*)()) - &PowderPatternDiffraction::GetProfile, - return_internal_reference<>()) - .def("SetProfile", &SetProfileCopy, bp::arg("profile"), - "Install an independent copy of a reflection profile.") - .def("SetExtractionMode", - &PowderPatternDiffraction::SetExtractionMode, - (bp::arg("extract")=true, bp::arg("init")=false)) - .def("GetExtractionMode", - &PowderPatternDiffraction::GetExtractionMode) - .def("ExtractLeBail", - &PowderPatternDiffraction::ExtractLeBail, - (bp::arg("nbcycle")=1)) - .def("SetCrystal", - &PowderPatternDiffraction::SetCrystal, - bp::arg("crystal"), - with_custodian_and_ward<1, 2>()) - .def("GetNbReflBelowMaxSinThetaOvLambda", - &PowderPatternDiffraction::GetNbReflBelowMaxSinThetaOvLambda) - .def("GetFhklObsSq", &PowderPatternDiffraction::GetFhklObsSq, - return_value_policy()) - .def("X2XCorrPhase", &PowderPatternDiffraction::X2XCorrPhase) - ; - -} diff --git a/src/extensions/pyobjcryst.cpp b/src/extensions/pyobjcryst.cpp deleted file mode 100644 index e74ebf98..00000000 --- a/src/extensions/pyobjcryst.cpp +++ /dev/null @@ -1,140 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* definition of the _pyobjcryst Python extension module. -* -*****************************************************************************/ - -#include - -// Initialize numpy here. -#include "pyobjcryst_numpy_setup.hpp" -#include - - -void wrap_asymmetricunit(); -void wrap_atom(); -void wrap_crystal(); -void wrap_diffractiondatasinglecrystal(); -void wrap_general(); -void wrap_globaloptim(); -void wrap_globalscatteringpower(); -void wrap_indexing(); -void wrap_io(); -void wrap_lsq(); -void wrap_molatom(); -void wrap_molbond(); -void wrap_molbondangle(); -void wrap_moldihedralangle(); -void wrap_molecule(); -void wrap_objregistry(); -void wrap_polyhedron(); -void wrap_powderpattern(); -void wrap_powderpatternbackground(); -void wrap_powderpatterncomponent(); -void wrap_powderpatterndiffraction(); -void wrap_quaternion(); -void wrap_radiation(); -void wrap_refinableobj(); -void wrap_refinableobjclock(); -void wrap_refinablepar(); -void wrap_reflectionprofile(); -void wrap_refobjopt(); -void wrap_refpartype(); -void wrap_registerconverters(); -void wrap_restraint(); -void wrap_rigidgroup(); -void wrap_scatterer(); -void wrap_scatteringcomponent(); -void wrap_scatteringcomponentlist(); -void wrap_scatteringdata(); -void wrap_scatteringpower(); -void wrap_scatteringpoweratom(); -void wrap_scatteringpowersphere(); -void wrap_spacegroup(); -void wrap_stretchmode(); -void wrap_unitcell(); -void wrap_zatom(); -void wrap_zpolyhedron(); -void wrap_zscatterer(); - -namespace { - -#if PY_MAJOR_VERSION >= 3 - void* initialize_numpy() { import_array(); return NULL; } -#else - void initialize_numpy() { import_array(); } -#endif - -} // namespace - -// Wrappers must be called according to inheritance hierarchy -BOOST_PYTHON_MODULE(_pyobjcryst) -{ - // initialize numpy module - initialize_numpy(); - - // General stuff - wrap_general(); - wrap_io(); - wrap_objregistry(); - wrap_quaternion(); - wrap_refinableobjclock(); - wrap_refobjopt(); - wrap_refpartype(); - wrap_registerconverters(); - - // Core objects - wrap_restraint(); - wrap_refinablepar(); - wrap_refinableobj(); - - // Other base classes - wrap_scatteringdata(); - wrap_scatterer(); - wrap_scatteringpower(); - wrap_zscatterer(); - wrap_unitcell(); - wrap_powderpatterncomponent(); - wrap_reflectionprofile(); - - // Other stuff in no particular order. - wrap_asymmetricunit(); - wrap_atom(); - wrap_crystal(); - wrap_diffractiondatasinglecrystal(); - wrap_globaloptim(); - wrap_globalscatteringpower(); - wrap_indexing(); - wrap_lsq(); - wrap_molatom(); - wrap_molbond(); - wrap_molbondangle(); - wrap_moldihedralangle(); - wrap_molecule(); - wrap_polyhedron(); - wrap_powderpattern(); - wrap_powderpatternbackground(); - wrap_powderpatterndiffraction(); - wrap_radiation(); - wrap_rigidgroup(); - wrap_scatteringcomponent(); - wrap_scatteringcomponentlist(); - wrap_scatteringpoweratom(); - wrap_scatteringpowersphere(); - wrap_spacegroup(); - wrap_stretchmode(); - wrap_zatom(); - wrap_zpolyhedron(); -} diff --git a/src/extensions/pyobjcryst_numpy_setup.hpp b/src/extensions/pyobjcryst_numpy_setup.hpp deleted file mode 100644 index 90481abb..00000000 --- a/src/extensions/pyobjcryst_numpy_setup.hpp +++ /dev/null @@ -1,29 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst Complex Modeling Initiative -* (c) 2017 Brookhaven Science Associates -* Brookhaven National Laboratory. -* All rights reserved. -* -* File coded by: Pavol Juhas -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -****************************************************************************** -* -* Define PY_ARRAY_UNIQUE_SYMBOL for the pyobjcryst extension module. -* -*****************************************************************************/ - -#ifndef PYOBJCRYST_NUMPY_SETUP_HPP_INCLUDED -#define PYOBJCRYST_NUMPY_SETUP_HPP_INCLUDED - -// Specify the version of NumPy API that will be used. -#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION - -// This macro is required for extension modules that are in several files. -// It must be defined before inclusion of numpy/arrayobject.h -#define PY_ARRAY_UNIQUE_SYMBOL PYOBJCRYST_NUMPY_ARRAY_SYMBOL - -#endif // PYOBJCRYST_NUMPY_SETUP_HPP_INCLUDED diff --git a/src/extensions/python_streambuf.hpp b/src/extensions/python_streambuf.hpp deleted file mode 100644 index c2b04565..00000000 --- a/src/extensions/python_streambuf.hpp +++ /dev/null @@ -1,541 +0,0 @@ -/****************************************************************************** -*** License agreement *** - -cctbx Copyright (c) 2006, The Regents of the University of -California, through Lawrence Berkeley National Laboratory (subject to -receipt of any required approvals from the U.S. Dept. of Energy). All -rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -(1) Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - -(2) Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. - -(3) Neither the name of the University of California, Lawrence Berkeley -National Laboratory, U.S. Dept. of Energy nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS -IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER -OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -You are under no obligation whatsoever to provide any bug fixes, -patches, or upgrades to the features, functionality or performance of -the source code ("Enhancements") to anyone; however, if you choose to -make your Enhancements available either publicly, or directly to -Lawrence Berkeley National Laboratory, without imposing a separate -written license agreement for such Enhancements, then you hereby grant -the following license: a non-exclusive, royalty-free perpetual license -to install, use, modify, prepare derivative works, incorporate into -other computer software, distribute, and sublicense such enhancements or -derivative works thereof, in binary and source code form. - -******************************************************************************/ - -/****************************************************************************** -CHANGELOG: -2009-07-07 - CLF Added license notice -2009-07-07 - CLF Changed file extension to hpp -2009-07-07 - Removed buffer_size, to be defined within the wrapper. -2015-09-24 - PJ sync with r22950 (last change in r11117). -******************************************************************************/ - -#ifndef BOOST_ADAPTBX_PYTHON_STREAMBUF_H -#define BOOST_ADAPTBX_PYTHON_STREAMBUF_H - -#include -#include -#include - -#include -#include - -#include -#include - -// Substitute macros otherwise defined in tbxx/error_utils.hpp --------------- - -#include - -#define TBXX_ASSERT(a) assert(a) -#define TBXX_UNREACHABLE_ERROR() \ - std::logic_error( \ - "Control flow passes through branch that should be unreachable.") - -// --------------------------------------------------------------------------- - -namespace boost_adaptbx { namespace python { - -namespace bp = boost::python; - -/// A stream buffer getting data from and putting data into a Python file object -/** The aims are as follow: - - - Given a C++ function acting on a standard stream, e.g. - - \code - void read_inputs(std::istream& input) { - ... - input >> something >> something_else; - } - \endcode - - and given a piece of Python code which creates a file-like object, - to be able to pass this file object to that C++ function, e.g. - - \code - import gzip - gzip_file_obj = gzip.GzipFile(...) - read_inputs(gzip_file_obj) - \endcode - - and have the standard stream pull data from and put data into the Python - file object. - - - When Python \c read_inputs() returns, the Python object is able to - continue reading or writing where the C++ code left off. - - - Operations in C++ on mere files should be competitively fast compared - to the direct use of \c std::fstream. - - - \b Motivation - - - the standard Python library offer of file-like objects (files, - compressed files and archives, network, ...) is far superior to the - offer of streams in the C++ standard library and Boost C++ libraries. - - - i/o code involves a fair amount of text processing which is more - efficiently prototyped in Python but then one may need to rewrite - a time-critical part in C++, in as seamless a manner as possible. - - \b Usage - - This is 2-step: - - - a trivial wrapper function - - \code - using boost_adaptbx::python::streambuf; - void read_inputs_wrapper(streambuf& input) - { - streambuf::istream is(input); - read_inputs(is); - } - - def("read_inputs", read_inputs_wrapper); - \endcode - - which has to be written every time one wants a Python binding for - such a C++ function. - - - the Python side - - \code - from boost.python import streambuf - read_inputs(streambuf(python_file_obj=obj, buffer_size=1024)) - \endcode - - \c buffer_size is optional. See also: \c default_buffer_size - - Note: references are to the C++ standard (the numbers between parentheses - at the end of references are margin markers). -*/ -class streambuf : public std::basic_streambuf -{ - private: - typedef std::basic_streambuf base_t; - - public: - /* The syntax - using base_t::char_type; - would be nicer but Visual Studio C++ 8 chokes on it - */ - typedef base_t::char_type char_type; - typedef base_t::int_type int_type; - typedef base_t::pos_type pos_type; - typedef base_t::off_type off_type; - typedef base_t::traits_type traits_type; - - // work around Visual C++ 7.1 problem - inline static int - traits_type_eof() { return traits_type::eof(); } - - /// The default size of the read and write buffer. - /** They are respectively used to buffer data read from and data written to - the Python file object. It can be modified from Python. - */ - static std::size_t default_buffer_size; - - /// Construct from a Python file object - /** if buffer_size is 0 the current default_buffer_size is used. - */ - streambuf( - bp::object& python_file_obj, - std::size_t buffer_size_=0) - : - py_read (getattr(python_file_obj, "read", bp::object())), - py_write(getattr(python_file_obj, "write", bp::object())), - py_seek (getattr(python_file_obj, "seek", bp::object())), - py_tell (getattr(python_file_obj, "tell", bp::object())), - buffer_size(buffer_size_ != 0 ? buffer_size_ : default_buffer_size), - write_buffer(0), - pos_of_read_buffer_end_in_py_file(0), - pos_of_write_buffer_end_in_py_file(buffer_size), - farthest_pptr(0) - { - TBXX_ASSERT(buffer_size != 0); - /* Some Python file objects (e.g. sys.stdout and sys.stdin) - have non-functional seek and tell. If so, assign None to - py_tell and py_seek. - */ - if (py_tell != bp::object()) { - try { - py_tell(); - } - catch (bp::error_already_set&) { - py_tell = bp::object(); - py_seek = bp::object(); - /* Boost.Python does not do any Python exception handling whatsoever - So we need to catch it by hand like so. - */ - PyErr_Clear(); - } - } - - if (py_write != bp::object()) { - // C-like string to make debugging easier - write_buffer = new char[buffer_size + 1]; - write_buffer[buffer_size] = '\0'; - setp(write_buffer, write_buffer + buffer_size); // 27.5.2.4.5 (5) - farthest_pptr = pptr(); - } - else { - // The first attempt at output will result in a call to overflow - setp(0, 0); - } - - if (py_tell != bp::object()) { - off_type py_pos = bp::extract(py_tell()); - pos_of_read_buffer_end_in_py_file = py_pos; - pos_of_write_buffer_end_in_py_file = py_pos; - } - } - - /// Mundane destructor freeing the allocated resources - virtual ~streambuf() { - if (write_buffer) delete[] write_buffer; - } - - /// C.f. C++ standard section 27.5.2.4.3 - /** It is essential to override this virtual function for the stream - member function readsome to work correctly (c.f. 27.6.1.3, alinea 30) - */ - virtual std::streamsize showmanyc() { - int_type const failure = traits_type::eof(); - int_type status = underflow(); - if (status == failure) return -1; - return egptr() - gptr(); - } - - /// C.f. C++ standard section 27.5.2.4.3 - virtual int_type underflow() { - int_type const failure = traits_type::eof(); - if (py_read == bp::object()) { - throw std::invalid_argument( - "That Python file object has no 'read' attribute"); - } - read_buffer = py_read(buffer_size); - char *read_buffer_data; - bp::ssize_t py_n_read; - if (PyBytes_AsStringAndSize(read_buffer.ptr(), - &read_buffer_data, &py_n_read) == -1) { - setg(0, 0, 0); - throw std::invalid_argument( - "The method 'read' of the Python file object " - "did not return a string."); - } - off_type n_read = (off_type)py_n_read; - pos_of_read_buffer_end_in_py_file += n_read; - setg(read_buffer_data, read_buffer_data, read_buffer_data + n_read); - // ^^^27.5.2.3.1 (4) - if (n_read == 0) return failure; - return traits_type::to_int_type(read_buffer_data[0]); - } - - /// C.f. C++ standard section 27.5.2.4.5 - virtual int_type overflow(int_type c=traits_type_eof()) { - if (py_write == bp::object()) { - throw std::invalid_argument( - "That Python file object has no 'write' attribute"); - } - farthest_pptr = std::max(farthest_pptr, pptr()); - off_type n_written = (off_type)(farthest_pptr - pbase()); - bp::str chunk(pbase(), farthest_pptr); - py_write(chunk); - if (!traits_type::eq_int_type(c, traits_type::eof())) { - py_write(traits_type::to_char_type(c)); - n_written++; - } - if (n_written) { - pos_of_write_buffer_end_in_py_file += n_written; - setp(pbase(), epptr()); - // ^^^ 27.5.2.4.5 (5) - farthest_pptr = pptr(); - } - return traits_type::eq_int_type( - c, traits_type::eof()) ? traits_type::not_eof(c) : c; - } - - /// Update the python file to reflect the state of this stream buffer - /** Empty the write buffer into the Python file object and set the seek - position of the latter accordingly (C++ standard section 27.5.2.4.2). - If there is no write buffer or it is empty, but there is a non-empty - read buffer, set the Python file object seek position to the - seek position in that read buffer. - */ - virtual int sync() { - int result = 0; - farthest_pptr = std::max(farthest_pptr, pptr()); - if (farthest_pptr && farthest_pptr > pbase()) { - off_type delta = pptr() - farthest_pptr; - int_type status = overflow(); - if (traits_type::eq_int_type(status, traits_type::eof())) result = -1; - if (py_seek != bp::object()) py_seek(delta, 1); - } - else if (gptr() && gptr() < egptr()) { - if (py_seek != bp::object()) py_seek(gptr() - egptr(), 1); - } - return result; - } - - /// C.f. C++ standard section 27.5.2.4.2 - /** This implementation is optimised to look whether the position is within - the buffers, so as to avoid calling Python seek or tell. It is - important for many applications that the overhead of calling into Python - is avoided as much as possible (e.g. parsers which may do a lot of - backtracking) - */ - virtual - pos_type seekoff(off_type off, std::ios_base::seekdir way, - std::ios_base::openmode which= std::ios_base::in - | std::ios_base::out) - { - /* In practice, "which" is either std::ios_base::in or out - since we end up here because either seekp or seekg was called - on the stream using this buffer. That simplifies the code - in a few places. - */ - int const failure = off_type(-1); - - if (py_seek == bp::object()) { - throw std::invalid_argument( - "That Python file object has no 'seek' attribute"); - } - - // we need the read buffer to contain something! - if (which == std::ios_base::in && !gptr()) { - if (traits_type::eq_int_type(underflow(), traits_type::eof())) { - return failure; - } - } - - // compute the whence parameter for Python seek - int whence; - switch (way) { - case std::ios_base::beg: - whence = 0; - break; - case std::ios_base::cur: - whence = 1; - break; - case std::ios_base::end: - whence = 2; - break; - default: - return failure; - } - - // Let's have a go - boost::optional result = seekoff_without_calling_python( - off, way, which); - if (!result) { - // we need to call Python - if (which == std::ios_base::out) overflow(); - if (way == std::ios_base::cur) { - if (which == std::ios_base::in) off -= egptr() - gptr(); - else if (which == std::ios_base::out) off += pptr() - pbase(); - } - py_seek(off, whence); - result = off_type(bp::extract(py_tell())); - if (which == std::ios_base::in) underflow(); - } - return *result; - } - - /// C.f. C++ standard section 27.5.2.4.2 - virtual - pos_type seekpos(pos_type sp, - std::ios_base::openmode which= std::ios_base::in - | std::ios_base::out) - { - return streambuf::seekoff(sp, std::ios_base::beg, which); - } - - private: - bp::object py_read, py_write, py_seek, py_tell; - - std::size_t buffer_size; - - /* This is actually a Python string and the actual read buffer is - its internal data, i.e. an array of characters. We use a Boost.Python - object so as to hold on it: as a result, the actual buffer can't - go away. - */ - bp::object read_buffer; - - /* A mere array of char's allocated on the heap at construction time and - de-allocated only at destruction time. - */ - char *write_buffer; - - off_type pos_of_read_buffer_end_in_py_file, - pos_of_write_buffer_end_in_py_file; - - // the farthest place the buffer has been written into - char *farthest_pptr; - - - boost::optional seekoff_without_calling_python( - off_type off, - std::ios_base::seekdir way, - std::ios_base::openmode which) - { - boost::optional const failure; - - // Buffer range and current position - off_type buf_begin, buf_end, buf_cur, upper_bound; - off_type pos_of_buffer_end_in_py_file; - if (which == std::ios_base::in) { - pos_of_buffer_end_in_py_file = pos_of_read_buffer_end_in_py_file; - buf_begin = reinterpret_cast(eback()); - buf_cur = reinterpret_cast(gptr()); - buf_end = reinterpret_cast(egptr()); - upper_bound = buf_end; - } - else if (which == std::ios_base::out) { - pos_of_buffer_end_in_py_file = pos_of_write_buffer_end_in_py_file; - buf_begin = reinterpret_cast(pbase()); - buf_cur = reinterpret_cast(pptr()); - buf_end = reinterpret_cast(epptr()); - farthest_pptr = std::max(farthest_pptr, pptr()); - upper_bound = reinterpret_cast(farthest_pptr) + 1; - } - else { - throw TBXX_UNREACHABLE_ERROR(); - } - - // Sought position in "buffer coordinate" - off_type buf_sought; - if (way == std::ios_base::cur) { - buf_sought = buf_cur + off; - } - else if (way == std::ios_base::beg) { - buf_sought = buf_end + (off - pos_of_buffer_end_in_py_file); - } - else if (way == std::ios_base::end) { - return failure; - } - else { - throw TBXX_UNREACHABLE_ERROR(); - } - - // if the sought position is not in the buffer, give up - if (buf_sought < buf_begin || buf_sought >= upper_bound) return failure; - - // we are in wonderland - if (which == std::ios_base::in) gbump(buf_sought - buf_cur); - else if (which == std::ios_base::out) pbump(buf_sought - buf_cur); - return pos_of_buffer_end_in_py_file + (buf_sought - buf_end); - } - - public: - - class istream : public std::istream - { - public: - istream(streambuf& buf) : std::istream(&buf) - { - exceptions(std::ios_base::badbit); - } - - ~istream() { if (this->good()) this->sync(); } - }; - - class ostream : public std::ostream - { - public: - ostream(streambuf& buf) : std::ostream(&buf) - { - exceptions(std::ios_base::badbit); - } - - ~ostream() { if (this->good()) this->flush(); } - }; -}; - -struct streambuf_capsule -{ - streambuf python_streambuf; - - streambuf_capsule( - bp::object& python_file_obj, - std::size_t buffer_size=0) - : - python_streambuf(python_file_obj, buffer_size) - {} -}; - -struct ostream : private streambuf_capsule, streambuf::ostream -{ - ostream( - bp::object& python_file_obj, - std::size_t buffer_size=0) - : - streambuf_capsule(python_file_obj, buffer_size), - streambuf::ostream(python_streambuf) - {} - - ~ostream() - { - try { - if (this->good()) this->flush(); - } - catch (bp::error_already_set&) { - PyErr_Clear(); - throw std::runtime_error( - "Problem closing python ostream.\n" - " Known limitation: the error is unrecoverable. Sorry.\n" - " Suggestion for programmer: add ostream.flush() before" - " returning."); - } - } -}; - -}} // boost_adaptbx::python - -#endif // GUARD diff --git a/src/extensions/quaternion_ext.cpp b/src/extensions/quaternion_ext.cpp deleted file mode 100644 index 3e75d5f8..00000000 --- a/src/extensions/quaternion_ext.cpp +++ /dev/null @@ -1,114 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::Quaternion. -* -* Changes from ObjCryst::Quaternion -* - IO is not wrapped -* - Q0, Q1, Q2 and Q3 are wrapped as properties, rather than functions. -* - RotateVector overloaded to return tuple of the mutated arguments. -* -*****************************************************************************/ - -#include -#include -#include -#include - -#include - -namespace bp = boost::python; -using namespace boost::python; -using namespace ObjCryst; - -namespace { - -double getQ0(const Quaternion& q) -{ - return q.Q0(); -} - -double getQ1(const Quaternion& q) -{ - return q.Q1(); -} - -double getQ2(const Quaternion& q) -{ - return q.Q2(); -} - -double getQ3(const Quaternion& q) -{ - return q.Q3(); -} - -void setQ0(Quaternion& q, double val) -{ - q.Q0() = val; -} - -void setQ1(Quaternion& q, double val) -{ - q.Q1() = val; -} - -void setQ2(Quaternion& q, double val) -{ - q.Q2() = val; -} - -void setQ3(Quaternion& q, double val) -{ - q.Q3() = val; -} - -// Overloaded to return a tuple -bp::tuple _RotateVector( const Quaternion& q, double v1, double v2, double v3 ) -{ - - q.RotateVector(v1, v2, v3); - return bp::make_tuple(v1, v2, v3); - -} - -} // namespace - -void wrap_quaternion() -{ - - class_("Quaternion") - .def(init( - (bp::arg("q0"), bp::arg("q1"), bp::arg("q2"), bp::arg("q3"), - bp::arg("unit")=true - )) - ) - .def("GetConjugate", &Quaternion::GetConjugate) - //.def("RotateVector", &Quaternion::RotateVector, - // (bp::arg("v1"), bp::arg("v2"), bp::arg("v3"))) - .def("RotateVector", &_RotateVector, - (bp::arg("v1"), bp::arg("v2"), bp::arg("v3"))) - .def("Normalize", &Quaternion::Normalize) - .def("GetNorm", &Quaternion::GetNorm) - .def("RotationQuaternion", &Quaternion::RotationQuaternion, - (bp::arg("ang"), bp::arg("v1"), bp::arg("v2"), bp::arg("v3"))) - .staticmethod("RotationQuaternion") - .add_property("Q0", &getQ0, &setQ0) - .add_property("Q1", &getQ1, &setQ1) - .add_property("Q2", &getQ2, &setQ2) - .add_property("Q3", &getQ3, &setQ3) - .def(self * self) - .def(self *= self) - ; -} diff --git a/src/extensions/radiation_ext.cpp b/src/extensions/radiation_ext.cpp deleted file mode 100644 index 952429fa..00000000 --- a/src/extensions/radiation_ext.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst -* -* File coded by: Vincent Favre-Nicolin -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::Radiation. -* -* Changes from ObjCryst::Radiation -* - GetWavelength returns a scalar instead of a vector -* -*****************************************************************************/ - -#include -#include - -#include - -#include -#include - -namespace bp = boost::python; -using namespace boost::python; -using namespace ObjCryst; - -namespace{ - -double _GetWavelength(Radiation& r) -{ - return r.GetWavelength()(0); -} - -} // anonymous namespace - -void wrap_radiation() -{ - class_, boost::noncopyable>("Radiation") - .def("SetRadiationType", &Radiation::SetRadiationType) - .def("GetRadiationType", &Radiation::GetRadiationType) - .def("SetWavelengthType", &Radiation::SetWavelengthType) - .def("GetWavelengthType", &Radiation::GetWavelengthType) - // Overloaded to return a single wavelength instead of a vector - // .def("GetWavelength", &Radiation::GetWavelength, return_value_policy()) - .def("GetWavelength", &_GetWavelength) - .def("SetWavelength", (void (Radiation::*)(const REAL)) &Radiation::SetWavelength) - .def("SetWavelength", (void (Radiation::*)(const std::string &,const REAL)) &Radiation::SetWavelength, - (bp::arg("XRayTubeElementName"), bp::arg("alpha2Alpha2ratio")=0.5)) - .def("GetXRayTubeDeltaLambda", & Radiation::GetXRayTubeDeltaLambda) - .def("GetXRayTubeAlpha2Alpha1Ratio", & Radiation::GetXRayTubeAlpha2Alpha1Ratio) - .def("GetLinearPolarRate", &Radiation::GetLinearPolarRate) - .def("SetLinearPolarRate", &Radiation::SetLinearPolarRate) - .def("GetClockWavelength", &Radiation::GetClockWavelength, - return_value_policy()) - .def("GetClockRadiation", &Radiation::GetClockRadiation, - return_value_policy()) -#if LIBOBJCRYST_VERSION >= 2026002000000LL - .def("GetClockLinearPolarRate", &Radiation::GetClockLinearPolarRate, - return_value_policy()) -#endif - ; -} diff --git a/src/extensions/refinableobj_ext.cpp b/src/extensions/refinableobj_ext.cpp deleted file mode 100644 index df367c19..00000000 --- a/src/extensions/refinableobj_ext.cpp +++ /dev/null @@ -1,598 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::RefinableObj. This is a virtual class that -* can be derived from in python. These bindings are used by ObjCryst objects -* that inherit from RefinableObj (see for example unitcell_ext.cpp). -* RefinableObj derivatives can be created in python and will work in c++ -* functions that are also bound into python. -* -* Changes from ObjCryst::RefinableObj -* - XMLOutput and XMLInput accept python file-like objects. -* - GetPar that takes a const double* is not exposed, as it is designed for -* internal use. -* - GetParamSet returns a copy of the internal data so that no indirect -* manipulation can take place from python. -* - SetDeleteRefParInDestructor(false) is called in the constructors of the -* python class and the parameter accessors. -* - SetDeleteRefParInDestructor is not exposed. -* - RemovePar is overloaded to return None. -* - GetClientRegistry() override is deactivated for windows -*****************************************************************************/ - -#include -#include -#include -#include - -#include -#include -#include - -#include -#include - -#include "helpers.hpp" -#include "python_streambuf.hpp" - -namespace bp = boost::python; -using namespace boost::python; -using namespace ObjCryst; - -namespace { - - -// Workaround to SetDeleteRefParInDestructor(0) when a parameter is added - -void _AddPar(RefinableObj& obj, RefinablePar* p) -{ - obj.AddPar(p); - obj.SetDeleteRefParInDestructor(0); -} - -void _AddParObj(RefinableObj& obj, RefinableObj& o, const bool copyParam = false) -{ - obj.AddPar(o, copyParam); - obj.SetDeleteRefParInDestructor(0); -} - -RefinablePar& _GetParLong(RefinableObj& obj, const long i) -{ - obj.SetDeleteRefParInDestructor(0); - return obj.GetPar(i); -} - -RefinablePar& _GetParString(RefinableObj& obj, const string& s) -{ - obj.SetDeleteRefParInDestructor(0); - return obj.GetPar(s); -} - -RefinablePar& _GetParNotFixedLong(RefinableObj& obj, const long i) -{ - obj.SetDeleteRefParInDestructor(0); - return obj.GetParNotFixed(i); -} - -void _EraseAllParamSet(RefinableObj& obj) -{ - obj.EraseAllParamSet(); -} - - -class RefinableObjWrap : public RefinableObj, - public wrapper -{ - - public: - - /* alias the constructors from RefinableObj */ - RefinableObjWrap() : RefinableObj() - { - RefinableObj::SetDeleteRefParInDestructor(false); - } - - RefinableObjWrap(const bool internal) : RefinableObj(internal) - { - RefinableObj::SetDeleteRefParInDestructor(false); - } - - const std::string& default_GetClassName() const - { return this->RefinableObj::GetClassName(); } - - const std::string& GetClassName() const - { - override f = this->get_override("GetClassName"); - if (f) return f(); - return default_GetClassName(); - } - - const std::string& default_GetName() const - { return this->RefinableObj::GetName(); } - - const std::string& GetName() const - { - override f = this->get_override("GetName"); - if (f) return f(); - return default_GetName(); - } - - void default_SetName(const std::string& name) - { this->RefinableObj::SetName(name); } - - void SetName(const std::string& name) - { - override f = this->get_override("SetName"); - if (f) f(name); - else default_SetName(name); - } - - void default_Print() const - { this->RefinableObj::Print();} - - void Print() const - { - override f = this->get_override("Print"); - if (f) f(); - else default_Print(); - } - - void default_RegisterClient(RefinableObj& client) const - { this->RefinableObj::RegisterClient(client); } - - void RegisterClient(RefinableObj& client) const - { - override f = this->get_override("RegisterClient"); - if (f) f(client); - else default_RegisterClient(client); - } - - void default_DeRegisterClient(RefinableObj& client) const - { this->RefinableObj::DeRegisterClient(client); } - - void DeRegisterClient(RefinableObj& client) const - { - override f = this->get_override("DeRegisterClient"); - if (f) f(client); - else default_DeRegisterClient(client); - } - - ObjRegistry< RefinableObj >& default_GetClientRegistry() - { return this->RefinableObj::GetClientRegistry(); } - - ObjRegistry< RefinableObj >& GetClientRegistry() - { - override f = this->get_override("GetClientRegistry"); - if (f) - { - #ifdef _MSC_VER - return call&>(f.ptr()); - #else - return f(); - #endif - } - return default_GetClientRegistry(); - } - - void default_BeginOptimization(const bool allowApproximations, - const bool enableRestraints) - { this->RefinableObj::BeginOptimization(allowApproximations, enableRestraints); } - - void BeginOptimization(const bool allowApproximations, - const bool enableRestraints) - { - override f = this->get_override("BeginOptimization"); - if (f) f(allowApproximations, enableRestraints); - else default_BeginOptimization(allowApproximations, enableRestraints); - } - - void default_EndOptimization() - { this->RefinableObj::EndOptimization();} - - void EndOptimization() - { - override f = this->get_override("EndOptimization"); - if (f) f(); - else default_EndOptimization(); - } - - void default_RandomizeConfiguration() - { this->RefinableObj::RandomizeConfiguration();} - - void RandomizeConfiguration() - { - override f = this->get_override("RandomizeConfiguration"); - if (f) f(); - else default_RandomizeConfiguration(); - } - - void default_GlobalOptRandomMove(const double mutationAmplitude, - const RefParType* type) - { this->RefinableObj::GlobalOptRandomMove(mutationAmplitude, type);} - - void GlobalOptRandomMove(const double mutationAmplitude, - const RefParType* type) - { - override f = this->get_override("GlobalOptRandomMove"); - if (f) f(mutationAmplitude, type); - else default_GlobalOptRandomMove(mutationAmplitude, type); - } - - double default_GetLogLikelihood() const - { return this->RefinableObj::GetLogLikelihood(); } - - double GetLogLikelihood() const - { - override f = this->get_override("GetLogLikelihood"); - if (f) return f(); - return default_GetLogLikelihood(); - } - - unsigned int default_GetNbLSQFunction() const - { return this->RefinableObj::GetNbLSQFunction(); } - - unsigned int GetNbLSQFunction() const - { - override f = this->get_override("GetNbLSQFunction"); - if (f) return f(); - return default_GetNbLSQFunction(); - } - - const CrystVector& default_GetLSQCalc(const unsigned int i) const - { return this->RefinableObj::GetLSQCalc(i); } - - const CrystVector& GetLSQCalc(const unsigned int i) const - { - override f = this->get_override("GetLSQCalc"); - if (f) return f(i); - return default_GetLSQCalc(i); - } - - const CrystVector& default_GetLSQObs(const unsigned int i) const - { return this->RefinableObj::GetLSQObs(i); } - - const CrystVector& GetLSQObs(const unsigned int i) const - { - override f = this->get_override("GetLSQObs"); - if (f) return f(i); - return default_GetLSQObs(i); - } - - const CrystVector& default_GetLSQWeight(const unsigned int i) const - { return this->RefinableObj::GetLSQWeight(i); } - - const CrystVector& GetLSQWeight(const unsigned int i) const - { - override f = this->get_override("GetLSQWeight"); - if (f) return f(i); - return default_GetLSQWeight(i); - } - - const CrystVector& default_GetLSQDeriv(const unsigned int i, - RefinablePar& rp) - { return this->RefinableObj::GetLSQDeriv(i, rp); } - - const CrystVector& GetLSQDeriv(const unsigned int i, - RefinablePar& rp) - { - override f = this->get_override("GetLSQDeriv"); - if (f) return f(i, rp); - return default_GetLSQDeriv(i, rp); - } - - void default_XMLOutput(std::ostream& os, int indent) const - { this->RefinableObj::XMLOutput(os, indent); } - - void XMLOutput(std::ostream& os, int indent) const - { - override f = this->get_override("XMLOutput"); - if (f) f(os, indent); - else default_XMLOutput(os, indent); - } - - void default_XMLInput(std::istream& is, - const ObjCryst::XMLCrystTag& tag) - { this->RefinableObj::XMLInput(is, tag); } - - void XMLInput(std::istream& is, - const ObjCryst::XMLCrystTag& tag) - { - override f = this->get_override("XMLInput"); - if (f) f(is, tag); - else default_XMLInput(is, tag); - } - - void default_GetGeneGroup(const ObjCryst::RefinableObj& obj, - CrystVector& groupIndex, - unsigned int& firstGroup) const - { this->RefinableObj::GetGeneGroup(obj, groupIndex, firstGroup);} - - void GetGeneGroup(const ObjCryst::RefinableObj& obj, - CrystVector& groupIndex, - unsigned int& firstGroup) const - { - override f = this->get_override("GetGeneGroup"); - if (f) f(obj, groupIndex, firstGroup); - else default_GetGeneGroup(obj, groupIndex, firstGroup); - } - - void default_UpdateDisplay() const - { this->RefinableObj::UpdateDisplay();} - - void UpdateDisplay() const - { - override f = this->get_override("UpdateDisplay"); - if (f) f(); - else default_UpdateDisplay(); - } - - double default_GetRestraintCost() const - { return this->RefinableObj::GetRestraintCost();} - - double GetRestraintCost() const - { - override f = this->get_override("GetRestraintCost"); - if (f) return f(); - return default_GetRestraintCost(); - } - - void default_TagNewBestConfig() const - { this->RefinableObj::TagNewBestConfig();} - - void TagNewBestConfig() const - { - override f = this->get_override("TagNewBestConfig"); - if (f) f(); - else default_TagNewBestConfig(); - } - - // Protected methods - - void default_Prepare() - { RefinableObj::Prepare();} - - void Prepare() - { - override f = this->get_override("Prepare"); - if (f) f(); - else default_Prepare(); - } - - long FindPar(const std::string& name) const - { return RefinableObj::FindPar(name); } - - void AddOption(RefObjOpt* opt) - { RefinableObj::AddOption(opt); } - - std::map, std::string> - >::iterator - FindParamSet(unsigned long id) const - { return RefinableObj::FindParamSet(id); } - -}; - -void _RemovePar(RefinableObj& obj, RefinablePar* refpar) -{ - obj.RemovePar(refpar); - return; -} - -void _XMLOutput( - const RefinableObj& r, - bp::object output, - int indent = 0) -{ - boost_adaptbx::python::ostream os(output); - os.precision(doublelim::digits10); - r.XMLOutput(os, indent); - os.flush(); -} - -std::string _xml(const RefinableObj &r) -{ - std::stringstream s; - int indent=0; - r.XMLOutput(s, indent); - return s.str(); -} - - -void _XMLInput( - RefinableObj& r, - bp::object input, - XMLCrystTag& tag) -{ - boost_adaptbx::python::streambuf sbuf(input); - boost_adaptbx::python::streambuf::istream in(sbuf); - r.XMLInput(in, tag); - in.sync(); -} - -void _XMLInputString(RefinableObj& r, const string& s) -{ - stringstream ss(s); - ss.imbue(std::locale::classic()); - XMLCrystTag tag; - ss>>tag; - r.XMLInput(ss, tag); -} - -} // anonymous namespace - - -void wrap_refinableobj() -{ - scope().attr("refpartype_objcryst") = object(ptr(gpRefParTypeObjCryst)); - // Global object registry - scope().attr("gRefinableObjRegistry") = boost::cref(gRefinableObjRegistry); - // Global top object registry, exposed at the pyobjcryst module level - scope().attr("gTopRefinableObjRegistry") = boost::cref(gTopRefinableObjRegistry); - - class_("RefinableObj") - .def(init()) - // Defined not implemented - //.def(init()) - /* Methods */ - .def("PrepareForRefinement", &RefinableObj::PrepareForRefinement) - .def("FixAllPar", &RefinableObj::FixAllPar) - .def("UnFixAllPar", &RefinableObj::UnFixAllPar) - .def("SetParIsFixed", (void (RefinableObj::*)(const long, const bool)) - &RefinableObj::SetParIsFixed) - .def("SetParIsFixed", (void (RefinableObj::*)(const std::string&, const bool)) - &RefinableObj::SetParIsFixed) - .def("SetParIsFixed", (void (RefinableObj::*)(const RefParType*, const bool)) - &RefinableObj::SetParIsFixed) - .def("SetParIsUsed", (void (RefinableObj::*)(const std::string&, const bool)) - &RefinableObj::SetParIsUsed) - .def("SetParIsUsed", (void (RefinableObj::*)(const RefParType*, const bool)) - &RefinableObj::SetParIsUsed) - .def("GetNbPar", &RefinableObj::GetNbPar) - .def("GetNbParNotFixed", &RefinableObj::GetNbParNotFixed) - .def("GetPar", &_GetParLong, - return_internal_reference<>()) - .def("GetPar", &_GetParString, - return_internal_reference<>()) - .def("GetParNotFixed", &_GetParNotFixedLong, - return_internal_reference<>()) - .def("AddPar", &_AddPar, - bp::arg("par"), - with_custodian_and_ward<1,2>()) - .def("AddPar", &_AddParObj, - (bp::arg("newRefParList"), bp::arg("copyParam")=false), - with_custodian_and_ward<1,2>()) - .def("RemovePar", &_RemovePar) - .def("CreateParamSet", &RefinableObj::CreateParamSet, - (bp::arg("name")="")) - .def("ClearParamSet", &RefinableObj::ClearParamSet) - .def("SaveParamSet", &RefinableObj::SaveParamSet) - .def("RestoreParamSet", &RefinableObj::RestoreParamSet) - .def("GetParamSet", (const CrystVector& (RefinableObj::*) - (const unsigned long) const) &RefinableObj::GetParamSet, - return_value_policy()) - .def("GetParamSet_ParNotFixedHumanValue", - &RefinableObj::GetParamSet_ParNotFixedHumanValue) - .def("EraseAllParamSet", &_EraseAllParamSet) - .def("GetParamSetName", &RefinableObj::GetParamSetName, - return_value_policy()) - .def("SetLimitsAbsolute", ( void (RefinableObj::*) - (const std::string&, const double, const double) ) - &RefinableObj::SetLimitsAbsolute) - .def("SetLimitsAbsolute", ( void (RefinableObj::*) - (const RefParType*, const double, const double) ) - &RefinableObj::SetLimitsAbsolute) - .def("SetLimitsRelative", ( void (RefinableObj::*) - (const std::string&, const double, const double) ) - &RefinableObj::SetLimitsRelative) - .def("SetLimitsRelative", ( void (RefinableObj::*) - (const RefParType*, const double, const double) ) - &RefinableObj::SetLimitsRelative) - .def("SetLimitsProportional", ( void (RefinableObj::*) - (const std::string&, const double, const double) ) - &RefinableObj::SetLimitsProportional) - .def("SetLimitsProportional", ( void (RefinableObj::*) - (const RefParType*, const double, const double) ) - &RefinableObj::SetLimitsProportional) - .def("SetGlobalOptimStep", &RefinableObj::SetGlobalOptimStep) - .def("GetSubObjRegistry", ( ObjRegistry& - (RefinableObj::*) ()) &RefinableObj::GetSubObjRegistry, - return_internal_reference<>()) - .def("IsBeingRefined", &RefinableObj::IsBeingRefined) - .def("BeginGlobalOptRandomMove", - &RefinableObj::BeginGlobalOptRandomMove) - .def("ResetParList", &RefinableObj::ResetParList) - .def("GetOptionList", &RefinableObj::GetOptionList, return_value_policy()) - .def("GetNbOption", &RefinableObj::GetNbOption) - .def("GetOption", (RefObjOpt& (RefinableObj::*)(const unsigned int)) - &RefinableObj::GetOption, - return_internal_reference<>()) - // Not exposed, as we want python to manage the objects - //.def("SetDeleteRefParInDestructor", - // &RefinableObj::SetDeleteRefParInDestructor) - .def("GetRefParListClock", &RefinableObj::GetRefParListClock, - return_value_policy()) - .def("AddRestraint", &RefinableObj::AddRestraint, - with_custodian_and_ward<1,2>()) - .def("RemoveRestraint", &RefinableObj::RemoveRestraint) - .def("GetClockMaster", &RefinableObj::GetClockMaster, - return_value_policy()) - // Virtual - .def("GetClassName", &RefinableObj::GetClassName, - &RefinableObjWrap::default_GetClassName, - return_value_policy()) - .def("GetName", &RefinableObj::GetName, - &RefinableObjWrap::default_GetName, - return_value_policy()) - .def("SetName", &RefinableObj::SetName, - &RefinableObjWrap::default_SetName) - .def("Print", &RefinableObj::Print, - &RefinableObjWrap::default_Print) - .def("RegisterClient", &RefinableObj::RegisterClient, - &RefinableObjWrap::default_RegisterClient, - with_custodian_and_ward<1,2>()) - .def("DeRegisterClient", &RefinableObj::DeRegisterClient, - &RefinableObjWrap::default_DeRegisterClient) - .def("GetClientRegistry", ( ObjRegistry& - (RefinableObj::*) ()) &RefinableObj::GetClientRegistry, - &RefinableObjWrap::default_GetClientRegistry, - return_internal_reference<>()) - .def("BeginOptimization", &RefinableObj::BeginOptimization, - &RefinableObjWrap::default_BeginOptimization, - (bp::arg("allowApproximations")=false, - bp::arg("enableRestraints")=false)) - .def("EndOptimization", &RefinableObj::EndOptimization, - &RefinableObjWrap::default_EndOptimization) - .def("RandomizeConfiguration", &RefinableObj::RandomizeConfiguration, - &RefinableObjWrap::default_RandomizeConfiguration) - .def("GlobalOptRandomMove", &RefinableObj::GlobalOptRandomMove, - &RefinableObjWrap::default_GlobalOptRandomMove, - (bp::arg("mutationAmplitude"), bp::arg("type")=gpRefParTypeObjCryst)) - .def("GetLogLikelihood", &RefinableObj::GetLogLikelihood, - &RefinableObjWrap::default_GetLogLikelihood) - .def("GetNbLSQFunction", &RefinableObj::GetNbLSQFunction, - &RefinableObjWrap::default_GetNbLSQFunction) - .def("GetLSQCalc", &RefinableObj::GetLSQCalc, - &RefinableObjWrap::default_GetLSQCalc, - return_value_policy()) - .def("GetLSQObs", &RefinableObj::GetLSQObs, - &RefinableObjWrap::default_GetLSQObs, - return_value_policy()) - .def("GetLSQWeight", &RefinableObj::GetLSQWeight, - &RefinableObjWrap::default_GetLSQWeight, - return_value_policy()) - .def("GetLSQDeriv", &RefinableObj::GetLSQDeriv, - &RefinableObjWrap::default_GetLSQDeriv, - return_value_policy()) - .def("XMLOutput", &_XMLOutput, (bp::arg("file"), bp::arg("indent")=0)) - .def("XMLOutput", &RefinableObj::XMLOutput, - &RefinableObjWrap::default_XMLOutput) - .def("xml", &_xml) - .def("XMLInput", &_XMLInput, (bp::arg("file"), bp::arg("tag"))) - .def("XMLInput", &RefinableObj::XMLInput, - &RefinableObjWrap::default_XMLInput) - .def("XMLInput", &_XMLInputString, (bp::arg("xml"))) - .def("GetGeneGroup", &RefinableObj::GetGeneGroup, - &RefinableObjWrap::default_GetGeneGroup) - .def("UpdateDisplay", &RefinableObj::UpdateDisplay, - &RefinableObjWrap::default_UpdateDisplay) - .def("GetRestraintCost", &RefinableObj::GetRestraintCost, - &RefinableObjWrap::default_GetRestraintCost) - .def("TagNewBestConfig", &RefinableObj::TagNewBestConfig, - &RefinableObjWrap::default_TagNewBestConfig) - .def("int_ptr", &RefinableObj::int_ptr) - // Additional methods for python only - .def("__str__", &__str__) - ; -} diff --git a/src/extensions/refinableobjclock_ext.cpp b/src/extensions/refinableobjclock_ext.cpp deleted file mode 100644 index bcc5763f..00000000 --- a/src/extensions/refinableobjclock_ext.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::RefinableObjClock. -* -* Changes from ObjCryst::RefinableObjClock -* - operator= is wrapped as the SetEqual method -* a.SetEqual(b) -> a = b -* -*****************************************************************************/ - -#include -#include - -#include - -#include "helpers.hpp" - -using namespace boost::python; -using ObjCryst::RefinableObjClock; - -namespace { - -const char* classdoc = -"We need to record exactly when refinable objects\n\ -have been modified for the last time (to avoid re-computation),\n\ -and to do that we need a precise time. Since the clock() function is not\n\ -precise enough (and is architecture-dependant), we use a custom time,\n\ -which records the number of events in the program which uses the library.\n\ -This is purely internal, so don't worry about it...\n\ -\n\ -The clock values have nothing to do with 'time' as any normal person understands it."; - -const char* addchilddoc = -"Add a 'child' clock. Whenever a child clock is clicked, it will also click its parent.\n\ -This function takes care of adding itself to the list of parent in the children clock."; - -const char* addparentdoc = -"Add a 'parent' clock. Whenever a clock is clicked, all parent clocks\n\ -also are."; - -const char* clickdoc = -"Record an event for this clock (generally, the 'time'\n\ -an object has been modified, or some computation has been made)"; - -const char * printdoc = -"Print clock value. Only for debugging purposes."; - -const char * printstaticdoc = -"Print current general clock value. Only for debugging purposes."; - -const char * removechilddoc = -"remove a child clock. This also tells the child clock to remove the parent."; - -const char * removeparentdoc = -"remove a parent clock"; - -const char * resetdoc = -"Reset a Clock to 0, to force an update"; - -// set clock1 equal to clock2 (operator=) -void SetEqual(RefinableObjClock& c1, const RefinableObjClock& c2) -{ - c1 = c2; -} - - -} // anonymous namespace - -void wrap_refinableobjclock() -{ - - class_ - ("RefinableObjClock", classdoc) - .def("AddChild", &RefinableObjClock::AddChild, addchilddoc, - with_custodian_and_ward<1,2>()) - .def("AddParent", &RefinableObjClock::AddParent, addparentdoc, - with_custodian_and_ward<1,2>()) - .def("Click", &RefinableObjClock::Click, clickdoc) - .def("Print", &RefinableObjClock::Print, printdoc) - .def("PrintStatic", &RefinableObjClock::PrintStatic, printstaticdoc) - .def("RemoveChild", &RefinableObjClock::RemoveChild, removechilddoc) - .def("RemoveParent", &RefinableObjClock::RemoveParent, removeparentdoc) - .def("Reset", &RefinableObjClock::Reset, resetdoc) - .def("SetEqual", &SetEqual) - .def(self < self) - .def(self <= self) - .def(self > self) - .def(self >= self) - .def("__str__", &__str__) - ; -} diff --git a/src/extensions/refinablepar_ext.cpp b/src/extensions/refinablepar_ext.cpp deleted file mode 100644 index d439abf5..00000000 --- a/src/extensions/refinablepar_ext.cpp +++ /dev/null @@ -1,164 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::RefinablePar and -* ObjCryst::RefParDerivStepModel. -* -* Changes from ObjCryst::RefinablePar -* - The constructor has been changed to accept a double, -* rather than a pointer to a double. -* - The copy and default constructors and Init are not wrapped in order to avoid -* memory corruption. Since boost cannot implicitly handle double* object, a -* wrapper class had to be created. However, this wrapper class cannot be used -* to convert RefinablePar objected created in c++. Thus, -* ObjCryst::RefinablePar objects created in c++ are passed into python as -* instances of _RefinablePar, which is a python wrapper around -* ObjCryst::RefinablePar. The RefinablePar python class is a wrapper around -* the C++ class PyRefinablePar, which manages its own double*. These python -* classes are interchangeable once instantiated, so users should not notice. -* - XML input/output are not exposed. -* -*****************************************************************************/ - -#include -#include -#include -#include - -#include - -#include - -#include "helpers.hpp" - -namespace bp = boost::python; -using namespace boost::python; -using namespace ObjCryst; - -namespace { - -/* A little wrapper around the initializers since python doubles and double* don't - * get along. - */ - -class PyRefinablePar : public RefinablePar -{ - - public: - - PyRefinablePar() : RefinablePar(), pval(0) {}; - - PyRefinablePar(const string& name, double value, const double min, const - double max, const RefParType* type, RefParDerivStepModel - derivMode=REFPAR_DERIV_STEP_RELATIVE, const bool hasLimits=true, const - bool isFixed=false, const bool isUsed=true, const bool isPeriodic=false, - const double humanScale=1., double period=1.) : RefinablePar() - { - pval = new double(value); - RefinablePar::Init(name, pval, min, max, type, derivMode, hasLimits, - isFixed, isUsed, isPeriodic, humanScale, period); - } - - ~PyRefinablePar() - { - if( pval != NULL ) - { - delete pval; - } - } - - private: - - double* pval; - - -}; - -} // anonymous namespace - - -void wrap_refinablepar() -{ - - enum_("RefParDerivStepModel") - .value("REFPAR_DERIV_STEP_ABSOLUTE", REFPAR_DERIV_STEP_ABSOLUTE) - .value("REFPAR_DERIV_STEP_RELATIVE", REFPAR_DERIV_STEP_RELATIVE) - ; - - // Class for holding RefinablePar instances created in c++. This should not - // be exported to the pyobjcryst namespace - class_ > ("_RefinablePar", no_init) - .def("GetValue", &RefinablePar::GetValue) - .def("SetValue", &RefinablePar::SetValue) - .def("GetHumanValue", &RefinablePar::GetHumanValue, - return_value_policy()) - .def("SetHumanValue", &RefinablePar::SetHumanValue) - .def("Mutate", &RefinablePar::Mutate) - .def("MutateTo", &RefinablePar::MutateTo) - .def("GetSigma", &RefinablePar::GetSigma) - .def("GetHumanSigma", &RefinablePar::GetHumanSigma) - .def("SetSigma", &RefinablePar::SetSigma) - .def("GetName", &RefinablePar::GetName) - .def("SetName", &RefinablePar::SetName) - .def("Print", &RefinablePar::Print) - .def("IsFixed", &RefinablePar::IsFixed) - .def("SetIsFixed", &RefinablePar::SetIsFixed) - .def("IsLimited", &RefinablePar::IsLimited) - .def("SetIsLimited", &RefinablePar::SetIsLimited) - .def("IsUsed", &RefinablePar::IsUsed) - .def("SetIsUsed", &RefinablePar::SetIsUsed) - .def("IsPeriodic", &RefinablePar::IsPeriodic) - .def("SetIsPeriodic", &RefinablePar::SetIsPeriodic) - .def("GetHumanScale", &RefinablePar::GetHumanScale) - .def("SetHumanScale", &RefinablePar::SetHumanScale) - .def("GetMin", &RefinablePar::GetMin) - .def("SetMin", &RefinablePar::SetMin) - .def("GetHumanMin", &RefinablePar::GetHumanMin) - .def("SetHumanMin", &RefinablePar::SetHumanMin) - .def("GetMax", &RefinablePar::GetMax) - .def("SetMax", &RefinablePar::SetMax) - .def("GetHumanMax", &RefinablePar::GetHumanMax) - .def("SetHumanMax", &RefinablePar::SetHumanMax) - .def("GetPeriod", &RefinablePar::GetPeriod) - .def("SetPeriod", &RefinablePar::SetPeriod) - .def("GetDerivStep", &RefinablePar::GetDerivStep) - .def("SetDerivStep", &RefinablePar::SetDerivStep) - .def("GetGlobalOptimStep", &RefinablePar::GetGlobalOptimStep) - .def("SetGlobalOptimStep", &RefinablePar::SetGlobalOptimStep) - .def("AssignClock", &RefinablePar::AssignClock) - .def("SetLimitsAbsolute", &RefinablePar::SetLimitsAbsolute) - .def("SetLimitsRelative", &RefinablePar::SetLimitsRelative) - .def("SetLimitsProportional", &RefinablePar::SetLimitsProportional) - // Python-only attributes - .def("__str__", &__str__) - .add_property("value", &RefinablePar::GetValue, &RefinablePar::SetValue) - ; - - // Class for creating new RefinablePar instances - class_ > - ("RefinablePar", //... - init(( - bp::arg("name"), bp::arg("value"), bp::arg("min"), - bp::arg("max"), bp::arg("type"), - bp::arg("derivMode")=REFPAR_DERIV_STEP_RELATIVE, - bp::arg("hasLimits")=true, bp::arg("isFixed")=false, - bp::arg("isUsed")=true, bp::arg("isPeriodic")=false, - bp::arg("humanScale")=1., bp::arg("period")=1.)) - [with_custodian_and_ward<1,6>()]) - ; - - -} diff --git a/src/extensions/reflectionprofile_ext.cpp b/src/extensions/reflectionprofile_ext.cpp deleted file mode 100644 index e72bc26f..00000000 --- a/src/extensions/reflectionprofile_ext.cpp +++ /dev/null @@ -1,169 +0,0 @@ -/***************************************************************************** - * - * pyobjcryst - * - * File coded by: Vincent Favre-Nicolin - * - * See AUTHORS.txt for a list of people who contributed. - * See LICENSE.txt for license information. - * - ****************************************************************************** - * - * boost::python bindings to ObjCryst::ReflectionProfile. - * - * Changes from ObjCryst::ReflectionProfile - * - * Other Changes - * - *****************************************************************************/ - -#define BOOST_PYTHON_MAX_ARITY 20 - -#include -#include -#include -#include -#undef B0 - -#include "helpers.hpp" // assignCrystVector helper for numpy/sequence inputs - -#include - -#include - -namespace bp = boost::python; -using namespace boost::python; -using namespace ObjCryst; - -namespace -{ - - class ReflectionProfileWrap : public ReflectionProfile, public wrapper - { - public: - // Pure virtual functions - - ReflectionProfile *CreateCopy() const - { - return this->get_override("CreateCopy")(); - } - - CrystVector_REAL GetProfile( - const CrystVector_REAL &x, const REAL xcenter, - const REAL h, const REAL k, const REAL l) const - { - bp::override f = this->get_override("GetProfile"); - return f(x, xcenter, h, k, l); - } - - REAL GetFullProfileWidth( - const REAL relativeIntensity, const REAL xcenter, - const REAL h, const REAL k, const REAL l) - { - bp::override f = this->get_override("GetFullProfileWidth"); - return f(relativeIntensity, xcenter, h, k, l); - } - - void XMLOutput(ostream &os, int indent) const - { - bp::override f = this->get_override("XMLOutput"); - f(os, indent); - } - - void XMLInput(istream &is, const XMLCrystTag &tag) - { - bp::override f = this->get_override("XMLInput"); - f(is, tag); - } - }; - - // Accept python sequences/ndarrays for x and forward to the C++ API. - CrystVector_REAL _GetProfile( - const ReflectionProfile &rp, bp::object x, const REAL xcenter, - const REAL h, const REAL k, const REAL l) - { - CrystVector_REAL cvx; - assignCrystVector(cvx, x); - return rp.GetProfile(cvx, xcenter, h, k, l); - } - -} // namespace - -void wrap_reflectionprofile() -{ - class_, boost::noncopyable>( - "ReflectionProfile") - .def("CreateCopy", - pure_virtual(&ReflectionProfile::CreateCopy), - (return_value_policy()), - "Return a new ReflectionProfile instance copied from this one.") - // Two overloads for GetProfile: - // - Native CrystVector signature (for C++ callers / already-converted vectors). - // - Python-friendly wrapper that accepts sequences/ndarrays and converts them. - .def( - "GetProfile", - pure_virtual((CrystVector_REAL (ReflectionProfile::*)(const CrystVector_REAL &, REAL, REAL, REAL, REAL) const) & ReflectionProfile::GetProfile), - (bp::arg("x"), bp::arg("xcenter"), bp::arg("h"), - bp::arg("k"), bp::arg("l")), - "Compute the profile values at positions `x` for reflection (h, k, l) centered at `xcenter`.") - .def( - "GetProfile", &_GetProfile, - (bp::arg("x"), bp::arg("xcenter"), bp::arg("h"), bp::arg("k"), - bp::arg("l")), - "Compute the profile values at positions `x` (sequence/ndarray accepted) for reflection (h, k, l) centered at `xcenter`.") - .def("GetFullProfileWidth", - pure_virtual((REAL (ReflectionProfile::*)(const REAL, const REAL, const REAL, const REAL, const REAL) const) & ReflectionProfile::GetFullProfileWidth), - (bp::arg("relativeIntensity"), bp::arg("xcenter"), - bp::arg("h"), bp::arg("k"), bp::arg("l")), - "Return the full profile width at a given relative intensity for reflection (h, k, l) around `xcenter`.") - .def("IsAnisotropic", &ReflectionProfile::IsAnisotropic, - "Return whether the profile depends on the reflection indices.") - .def("XMLOutput", - pure_virtual((void (ReflectionProfile::*)(ostream &, int) const) & ReflectionProfile::XMLOutput), - (bp::arg("os"), bp::arg("indent")), - "Write this ReflectionProfile as XML to a file-like object. `indent` controls indentation depth.") - .def("XMLInput", - pure_virtual((void (ReflectionProfile::*)(istream &, const XMLCrystTag &))&ReflectionProfile::XMLInput), - (bp::arg("is"), bp::arg("tag")), - "Load ReflectionProfile parameters from an XML stream and tag."); - - class_ >( - "ReflectionProfilePseudoVoigt", init<>()) - .def(init(bp::arg("old"))) - .def("CreateCopy", &ReflectionProfilePseudoVoigt::CreateCopy, - return_value_policy(), - "Return an independent copy of this profile.") - .def("SetProfilePar", &ReflectionProfilePseudoVoigt::SetProfilePar, - (bp::arg("fwhmCagliotiW"), bp::arg("fwhmCagliotiU") = 0, - bp::arg("fwhmCagliotiV") = 0, bp::arg("eta0") = 0.5, - bp::arg("eta1") = 0), - "Set the isotropic pseudo-Voigt profile parameters."); - - class_ >( - "ReflectionProfilePseudoVoigtAnisotropic", init<>()) - .def(init( - bp::arg("old"))) - .def("CreateCopy", - &ReflectionProfilePseudoVoigtAnisotropic::CreateCopy, - return_value_policy(), - "Return an independent copy of this profile.") - .def( - "SetProfilePar", - &ReflectionProfilePseudoVoigtAnisotropic::SetProfilePar, - (bp::arg("fwhmCagliotiW"), bp::arg("fwhmCagliotiU") = 0, - bp::arg("fwhmCagliotiV") = 0, bp::arg("fwhmGaussP") = 0, - bp::arg("fwhmLorentzX") = 0, - bp::arg("fwhmLorentzY") = 0, - bp::arg("fwhmLorentzGammaHH") = 0, - bp::arg("fwhmLorentzGammaKK") = 0, - bp::arg("fwhmLorentzGammaLL") = 0, - bp::arg("fwhmLorentzGammaHK") = 0, - bp::arg("fwhmLorentzGammaHL") = 0, - bp::arg("fwhmLorentzGammaKL") = 0, - bp::arg("pseudoVoigtEta0") = 0, - bp::arg("pseudoVoigtEta1") = 0, - bp::arg("asymA0") = 1, bp::arg("asymA1") = 0, - bp::arg("asymA2") = 0), - "Set the anisotropic pseudo-Voigt profile parameters."); -} diff --git a/src/extensions/refobjopt_ext.cpp b/src/extensions/refobjopt_ext.cpp deleted file mode 100644 index cb28b6c2..00000000 --- a/src/extensions/refobjopt_ext.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::RefObjOpt. -* -*****************************************************************************/ - -#include -#include - -#include - -#include - -using namespace boost::python; -using namespace ObjCryst; - -namespace { - -class RefObjOptWrap : public RefObjOpt, - public wrapper -{ - - public: - - void default_SetChoice(const int choice) - { - RefObjOpt::SetChoice(choice); - } - - void SetChoice(const int choice) - { - override f = this->get_override("SetChoice"); - if (f) f(choice); - else default_SetChoice(choice); - } - -}; // AtomWrap - -} // anonymous namespace - - -void wrap_refobjopt() -{ - - class_("RefObjOpt") - .def("Init", &RefObjOpt::Init) - .def("GetNbChoice", &RefObjOpt::GetNbChoice) - .def("GetChoice", &RefObjOpt::GetChoice) - .def("SetChoice", (void (RefObjOpt::*)(const int)) &RefObjOpt::SetChoice, - &RefObjOptWrap::default_SetChoice) - .def("SetChoice", (void (RefObjOpt::*)(const std::string&)) &RefObjOpt::SetChoice) - .def("GetName", &RefObjOpt::GetName, - return_value_policy()) - .def("GetClassName", &RefObjOpt::GetClassName, - return_value_policy()) - .def("GetChoiceName", &RefObjOpt::GetChoiceName, - return_value_policy()) - .def("GetClock", &RefObjOpt::GetClock, - return_value_policy()) - .def("XMLOutput", &RefObjOpt::XMLOutput) - .def("XMLInput", &RefObjOpt::XMLInput) - ; -} diff --git a/src/extensions/refpartype_ext.cpp b/src/extensions/refpartype_ext.cpp deleted file mode 100644 index 0e7a21ec..00000000 --- a/src/extensions/refpartype_ext.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::RefParType. -* -*****************************************************************************/ - -#include -#include - -#include - -#include - -using namespace ObjCryst; -using namespace boost::python; - -namespace { - -bool __eq__(const RefParType* rpt1, const RefParType* rpt2) -{ - return rpt1 == rpt2; -} - -} // anonymous namespace - - -void wrap_refpartype() -{ - - class_("RefParType", init()) - .def(init() - [with_custodian_and_ward<1,2>()]) - /* Functions */ - .def("IsDescendantFromOrSameAs", &RefParType::IsDescendantFromOrSameAs) - .def("__eq__", &__eq__) - .def("GetName", &RefParType::GetName, - return_value_policy()) - ; -} diff --git a/src/extensions/registerconverters.cpp b/src/extensions/registerconverters.cpp deleted file mode 100644 index bac7484d..00000000 --- a/src/extensions/registerconverters.cpp +++ /dev/null @@ -1,327 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings for various conversions used in pyobjcryst. -* -*****************************************************************************/ - -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include - -// Use numpy here, but initialize it later in the extension module. -#include "pyobjcryst_numpy_setup.hpp" -#define NO_IMPORT_ARRAY -#include - - -using namespace boost::python; -using namespace ObjCryst; - - -namespace { - -namespace bp = boost::python; - -typedef std::pair< ScatteringPower const*, ScatteringPower const* > sppair; - -typedef std::map< sppair, double > mapsppairtodouble; - -typedef std::map< sppair, Crystal::BumpMergePar > mapsppairtobmp; - -typedef std::set MolAtomSet; - -typedef std::vector MolAtomVec; - - -// Make an array out of a data pointer and a dimension vector -PyObject* makeNdArray(const double* data, std::vector& dims) -{ - PyObject* pyarray = PyArray_SimpleNew(dims.size(), &dims[0], NPY_DOUBLE); - PyArrayObject* a = reinterpret_cast(pyarray); - double* adata = static_cast(PyArray_DATA(a)); - std::copy(data, data + PyArray_SIZE(a), adata); - return pyarray; -} - -// CrystVector to ndarray -struct CrystVector_REAL_to_ndarray -{ - - static PyObject* convert(const CrystVector& cv) - { - std::vector dims(1); - dims[0] = cv.numElements(); - return makeNdArray((double *) cv.data(), dims); - } - - static PyTypeObject const* get_pytype() - { - return &PyDoubleArrType_Type; - } - -}; - -// CrystMatrix to ndarray -struct CrystMatrix_REAL_to_ndarray -{ - - static PyObject* convert(const CrystMatrix& cm) - { - std::vector dims(2); - dims[0] = cm.rows(); - dims[1] = cm.cols(); - return makeNdArray((double *) cm.data(), dims); - } - - static PyTypeObject const* get_pytype() - { - return &PyDoubleArrType_Type; - } - -}; - -// std::pair to tuple -template -struct std_pair_to_tuple -{ - - static PyObject* convert(std::pair const& p) - { - bp::object tpl = bp::make_tuple(p.first, p.second); - PyObject* rv = tpl.ptr(); - return bp::incref(rv); - } - - static PyTypeObject const* get_pytype() - { - return &PyTuple_Type; - } - -}; - -// Helper for convenience. -template -struct std_pair_to_python_converter -{ - -std_pair_to_python_converter() -{ - bp::to_python_converter< - std::pair, - std_pair_to_tuple - >(); -} - -}; - -/* For MolAtomSet (std::set) */ - -void _addMAS(MolAtomSet& mas, MolAtom* a) -{ - mas.insert(a); -} - -void _updateMAS(MolAtomSet& mas, const MolAtomSet& other) -{ - mas.insert(other.begin(), other.end()); -} - -bool _containsMAS(const MolAtomSet& mas, MolAtom* a) -{ - return mas.find(a) != mas.end(); -} - -MolAtom* _getItemMAS(const MolAtomSet& mas, size_t i) -{ - // Look for size violation - if (i >= mas.size()) - { - PyErr_SetString(PyExc_IndexError, "index out of range"); - throw_error_already_set(); - } - - MolAtomSet::const_iterator p = mas.begin(); - while (i > 0) { p++; i--; } - return *p; -} - -void _discardMAS(MolAtomSet& mas, MolAtom* a) -{ - if( _containsMAS(mas, a) ) - { - mas.erase(a); - } -} - -void _removeMAS(MolAtomSet& mas, MolAtom* a) -{ - if( _containsMAS(mas, a) ) - { - mas.erase(a); - } - else - { - PyErr_SetString(PyExc_KeyError, "KeyError"); - throw_error_already_set(); - } -} - -/* For MolAtomVec */ - -void _appendMAV(MolAtomVec& mav, MolAtom* a) -{ - mav.push_back(a); -} - -void _extendMAV(MolAtomVec& mav, const MolAtomVec& other) -{ - for(MolAtomVec::iterator p; p < other.end(); ++p) - { - mav.push_back(*p); - } -} - -bool _containsMAV(const MolAtomVec& mav, MolAtom* a) -{ - return std::find(mav.begin(), mav.end(), a) != mav.end(); -} - -MolAtom* _getItemMAV(const MolAtomVec& mav, size_t i) -{ - return mav[i]; -} - -void _setItemMAV(MolAtomVec& mav, size_t i, MolAtom* a) -{ - mav[i] = a; -} - -void _deleteMAV(MolAtomVec& mav, size_t i) -{ - mav.erase(mav.begin()+i); -} - -/* Exception translation */ - -PyObject* pyobjcryst_ObjCrystException; - - -void translateException(const ObjCrystException& e) -{ - PyErr_SetString(pyobjcryst_ObjCrystException, e.message.c_str()); -} - - -// -// For testing -// - -CrystVector getTestVector() -{ - /* Should produce - * 0 1 2 - */ - CrystVector tv(3); - for(int i=0;i<3;i++) - { - tv(i) = i; - } - return tv; -} - -CrystMatrix getTestMatrix() -{ - /* Should produce - * 0 1 - * 2 3 - * 4 5 - */ - CrystMatrix tm(3,2); - int counter = 0; - for(int i=0;i<3;i++) - { - for(int j=0;j<2;j++) - { - tm(i,j) = counter; - counter++; - } - } - return tm; -} - -} // namespace - -void wrap_registerconverters() -{ - - /* Exceptions */ - pyobjcryst_ObjCrystException = PyErr_NewException((char*)"pyobjcryst.ObjCrystException", 0, 0); - register_exception_translator(translateException); - // We want silent exceptions - ObjCrystException::verbose = false; - - - // Put ObjCrystException in module namespace - scope().attr("ObjCrystException") = - object(handle<>(pyobjcryst_ObjCrystException)); - - /* Data type converters */ - to_python_converter< CrystVector, CrystVector_REAL_to_ndarray >(); - to_python_converter< CrystMatrix, CrystMatrix_REAL_to_ndarray >(); - // From boost sources - std_pair_to_python_converter - (); - // Semi-converter for mapsppairtodouble - class_("mapsppairtodouble", no_init) - .def(map_indexing_suite()); - // Semi-converter for mapsppairtobmp - class_("mapsppairtobmp", no_init) - .def(map_indexing_suite()); - - class_< MolAtomSet >("MolAtomSet", no_init) - .def("add", &_addMAS, with_custodian_and_ward<1,2>()) - .def("clear", &std::set::clear) - .def("discard", &_discardMAS) - .def("remove", &_removeMAS) - .def("update", &_updateMAS, with_custodian_and_ward<1,2>()) - .def("__contains__", &_containsMAS) - .def("__getitem__", &_getItemMAS, return_internal_reference<>()) - .def("__len__", &MolAtomSet::size) - ; - - class_< MolAtomVec >("MolAtomVec", no_init) - .def("append", &_appendMAV, with_custodian_and_ward<1,2>()) - .def("extend", &_extendMAV, with_custodian_and_ward<1,2>()) - .def("contains", &_containsMAV) - .def("delete", &_deleteMAV) - .def("__getitem__", &_getItemMAV, return_internal_reference<>()) - .def("__setitem__", &_setItemMAV, with_custodian_and_ward<1,2>()) - .def("__len__", &MolAtomVec::size) - ; - - // some tests - def("getTestVector", &getTestVector); - def("getTestMatrix", &getTestMatrix); - -} diff --git a/src/extensions/restraint_ext.cpp b/src/extensions/restraint_ext.cpp deleted file mode 100644 index 410aa3bd..00000000 --- a/src/extensions/restraint_ext.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* Changes from ObjCryst::Restraint -* - The default and copy constructors are not wrapped, nor is Init. -* - GetType returns a non-const reference to the RefParType. This should be a -* no-no, but RefParType has no mutating methods, so this should no lead to -* trouble. -* - XML input/output are not exposed. -* -*****************************************************************************/ - -#include -#include - -#include - -namespace bp = boost::python; -using namespace boost::python; -using namespace ObjCryst; - -namespace { - -class RestraintWrap : public Restraint, - public wrapper -{ - public: - - RestraintWrap() : Restraint() {}; - RestraintWrap(const RefParType* type) : Restraint(type) {}; - - const RefParType* default_GetType() const - { - return this->Restraint::GetType(); - } - - const RefParType* GetType() const - { - override f = this->get_override("GetType"); - if(f) return f(); - return this->default_GetType(); - } - - void default_SetType(const RefParType* type) - { - this->Restraint::SetType(type); - return; - } - - void SetType(const RefParType* type) - { - override f = this->get_override("SetType"); - if(f) - { - f(type); - return; - } - return this->default_SetType(type); - } - - double default_GetLogLikelihood() const - { - return this->Restraint::GetLogLikelihood(); - } - - double GetLogLikelihood() const - { - override f = this->get_override("GetLogLikelihood"); - if(f) return f(); - return this->default_GetLogLikelihood(); - } - -}; - -} // anonymous namespace - - -void wrap_restraint() -{ - - class_("Restraint") - .def(init((bp::arg("type")))[ - with_custodian_and_ward<1,2>()]) - .def("GetType", &Restraint::GetType, &RestraintWrap::default_GetType, - return_internal_reference<>()) - .def("SetType", &Restraint::SetType, &RestraintWrap::default_SetType, - with_custodian_and_ward<1,2>()) - .def("GetLogLikelihood", &Restraint::GetLogLikelihood, - &RestraintWrap::default_GetLogLikelihood) - ; -} diff --git a/src/extensions/rigidgroup_ext.cpp b/src/extensions/rigidgroup_ext.cpp deleted file mode 100644 index 61502c26..00000000 --- a/src/extensions/rigidgroup_ext.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::RigidGroup. -* -* Changes from ObjCryst::RigidGroup -* - RigidGroup is wrapped to have python-set methods rather than stl::set -* methods. -* -*****************************************************************************/ - -#include - -#include - -#include - -namespace bp = boost::python; -using namespace boost::python; -using namespace ObjCryst; - -typedef std::set MolAtomSet; - -namespace { - - -} // namespace - - -void wrap_rigidgroup() -{ - - class_ >("RigidGroup") - .def(init()) - .def("GetName", &RigidGroup::GetName) - .def("int_ptr", &RigidGroup::int_ptr) - ; -} diff --git a/src/extensions/scatterer_ext.cpp b/src/extensions/scatterer_ext.cpp deleted file mode 100644 index a01d271a..00000000 --- a/src/extensions/scatterer_ext.cpp +++ /dev/null @@ -1,276 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::Scatterer. This is a virtual class that -* can be derived from in python. These bindings are used by ObjCryst objects -* that inherit from Scatterer (see for example atom_ext.cpp). -* -* Changes from ObjCryst::Scatterer -* - C++ methods that can return const or non-const objects return non-const -* objects in python. -* - Operator string() is not exposed. -* - Internal use only methods have not been exposed. -* - InitRefParList is not exposed, as it is not used inside of Scatterer. -* - GetClockScattCompList is exposed using a workaround, because it is not -* implemented in the library. -* - Methods related to visualization are not exposed. -* -*****************************************************************************/ - -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include - -#include "helpers.hpp" - -using namespace ObjCryst; -using namespace boost::python; - -namespace { - -class ScattererWrap : public Scatterer, - public wrapper -{ - - public: - - ScattererWrap() : Scatterer() {} - - ScattererWrap(const ScattererWrap& S) : Scatterer(S) {} - - void default_SetX(const double x) - { this->Scatterer::SetX(x);} - - void SetX(const double x) - { - override f = this->get_override("SetX"); - if (f) f(x); - else default_SetX(x); - } - - void default_SetY(const double y) - { this->Scatterer::SetY(y);} - - void SetY(const double y) - { - override f = this->get_override("SetY"); - if (f) f(y); - else default_SetY(y); - } - - void default_SetZ(const double z) - { this->Scatterer::SetZ(z);} - - void SetZ(const double z) - { - override f = this->get_override("SetZ"); - if (f) f(z); - else default_SetZ(z); - } - - void default_SetOccupancy(const double occ) - { this->Scatterer::SetOccupancy(occ);} - - void SetOccupancy(const double occ) - { - override f = this->get_override("SetOccupancy"); - if (f) f(occ); - else default_SetOccupancy(occ); - } - - // Pure virtual - - Scatterer* CreateCopy() const - { - return this->get_override("CreateCopy")(); - } - - int GetNbComponent() const - { - return this->get_override("GetNbComponent")(); - } - - const ScatteringComponentList& GetScatteringComponentList() const - { - return this->get_override("GetScatteringComponentList")(); - } - - std::string GetComponentName(const int i) const - { - return this->get_override("GetComponentName")(i); - } - - void Print() const - { - this->get_override("Print")(); - } - - //Need to implement the pure virtual function POVRayDescription - std::ostream& default_POVRayDescription(std::ostream& os, - const CrystalPOVRayOptions& options) const - { - if(this->GetClassName()=="Molecule") - { - const Molecule *p = dynamic_cast(this); - return p->POVRayDescription(os, options); - } - if(this->GetClassName()=="ZScatterer") - { - const ZScatterer *p = dynamic_cast(this); - return p->POVRayDescription(os, options); - } - const Atom *p = dynamic_cast(this); - return p->POVRayDescription(os, options); - } - - std::ostream& POVRayDescription(std::ostream& os, - const CrystalPOVRayOptions& options) const - { - #ifdef _MSC_VER - override f = this->get_override("POVRayDescription"); - if(f) return call(f.ptr(), os, options); - else return default_POVRayDescription(os, options); - #else - return this->get_override("POVRayDescription")(os, options); - #endif - } - - // interface prior to Fox version 2016.2 - void GLInitDisplayList(const bool noSymmetrics, - const REAL xMin, const REAL xMax, - const REAL yMin, const REAL yMax, - const REAL zMin, const REAL zMax, - const bool displayEnantiomer, - const bool displayNames, - const bool hideHydrogens) const - { - // no operation - } - - void GLInitDisplayList(const bool noSymmetrics, - const REAL xMin, const REAL xMax, - const REAL yMin, const REAL yMax, - const REAL zMin, const REAL zMax, - const bool displayEnantiomer, - const bool displayNames, - const bool hideHydrogens, - const REAL fadeDistance=0) const - { - // no operation - } - - const RefinableObjClock& _GetClockScattCompList() const - { - return mClockScattCompList; - } - - protected: - - // Needed for compilation - void InitRefParList() {}; - -}; // ScattererWrap - -// We want to turn a ScatteringComponentList into an actual list -bp::list _GetScatteringComponentList(Scatterer& s) -{ - const ScatteringComponentList& scl = s.GetScatteringComponentList(); - bp::list l; - for(int i = 0; i < scl.GetNbComponent(); ++i) - { - l.append(scl(i)); - } - - return l; -} - - -} // anonymous namespace - - -void wrap_scatterer() -{ - scope().attr("refpartype_scatt") = object(gpRefParTypeScatt); - scope().attr("refpartype_scatt_transl") = object(ptr(gpRefParTypeScattTransl)); - scope().attr("refpartype_scatt_transl_x") = object(ptr(gpRefParTypeScattTranslX)); - scope().attr("refpartype_scatt_transl_y") = object(ptr(gpRefParTypeScattTranslY)); - scope().attr("refpartype_scatt_transl_z") = object(ptr(gpRefParTypeScattTranslZ)); - scope().attr("refpartype_scatt_orient") = object(ptr(gpRefParTypeScattOrient)); - scope().attr("refpartype_scatt_conform") = object(ptr(gpRefParTypeScattConform)); - scope().attr("refpartype_scatt_conform_bondlength") = object(ptr(gpRefParTypeScattConformBondLength)); - scope().attr("refpartype_scatt_conform_bondangle") = object(ptr(gpRefParTypeScattConformBondAngle)); - scope().attr("refpartype_scatt_conform_dihedangle") = object(ptr(gpRefParTypeScattConformDihedAngle)); - scope().attr("refpartype_scatt_conform_x") = object(ptr(gpRefParTypeScattConformX)); - scope().attr("refpartype_scatt_conform_y") = object(ptr(gpRefParTypeScattConformY)); - scope().attr("refpartype_scatt_conform_z") = object(ptr(gpRefParTypeScattConformZ)); - scope().attr("refpartype_scatt_occup") = object(ptr(gpRefParTypeScattOccup)); - // Global object registry - scope().attr("gScattererRegistry") = boost::cref(gScattererRegistry); - - class_ > - ("Scatterer") - /* Constructors */ - .def(init()) - /* Methods */ - .def("GetX", &Scatterer::GetX) - .def("GetY", &Scatterer::GetY) - .def("GetZ", &Scatterer::GetZ) - .def("GetOccupancy", &Scatterer::GetOccupancy) - // virtual methods - .def("SetX", &Scatterer::SetX, &ScattererWrap::default_SetX) - .def("SetY", &Scatterer::SetY, &ScattererWrap::default_SetY) - .def("SetZ", &Scatterer::SetZ, &ScattererWrap::default_SetZ) - .def("SetOccupancy", &ObjCryst::Scatterer::SetOccupancy, - &ScattererWrap::default_SetOccupancy) - .def("GetClockScatterer", - (RefinableObjClock & (Scatterer::*)()) - &Scatterer::GetClockScatterer, - return_internal_reference<>()) - .def("SetCrystal", &Scatterer::SetCrystal, - with_custodian_and_ward<1,2>()) - .def("GetCrystal", (Crystal &(Scatterer::*)()) - &Scatterer::GetCrystal, - return_internal_reference<>()) - // pure virtual methods - .def("GetNbComponent", pure_virtual(&Scatterer::GetNbComponent)) - .def("GetComponentName", pure_virtual(&Scatterer::GetComponentName)) - //.def("GetScatteringComponentList", - // pure_virtual(&Scatterer::GetScatteringComponentList), - // return_value_policy()) - .def("GetScatteringComponentList", &_GetScatteringComponentList, - with_custodian_and_ward_postcall<1,0>()) - .def("Print", pure_virtual(&Scatterer::Print)) - .def("__str__", &__str__) - // protected methods - .def("GetClockScattCompList", - &ScattererWrap::_GetClockScattCompList, - return_value_policy()) - // Properties - to be compatible with MolAtom - .add_property("X", &Scatterer::GetX, &Scatterer::SetX) - .add_property("Y", &Scatterer::GetY, &Scatterer::SetY) - .add_property("Z", &Scatterer::GetZ, &Scatterer::SetZ) - .add_property("Occupancy", &Scatterer::GetOccupancy, - &Scatterer::SetOccupancy) - ; - -} diff --git a/src/extensions/scatteringcomponent_ext.cpp b/src/extensions/scatteringcomponent_ext.cpp deleted file mode 100644 index bced4043..00000000 --- a/src/extensions/scatteringcomponent_ext.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::ScatteringComponent. -* -* Changes from ObjCryst::ScatteringComponent -* - Added attributes X, Y, Z, Occupancy to conform to MolAtom. -* -*****************************************************************************/ - -#include - -#include - -#include "helpers.hpp" - -using namespace boost::python; -using namespace ObjCryst; - -namespace -{ - -const ScatteringPower* _getScatteringPower(ScatteringComponent& s) -{ - return s.mpScattPow; -} - -} - -void wrap_scatteringcomponent() -{ - - class_("ScatteringComponent") - .def("Print", &ScatteringComponent::Print) - .def_readwrite("mX", &ScatteringComponent::mX) - .def_readwrite("X", &ScatteringComponent::mX) - .def_readwrite("mY", &ScatteringComponent::mY) - .def_readwrite("Y", &ScatteringComponent::mY) - .def_readwrite("mZ", &ScatteringComponent::mZ) - .def_readwrite("Z", &ScatteringComponent::mZ) - .def_readwrite("mOccupancy", &ScatteringComponent::mOccupancy) - .def_readwrite("Occupancy", &ScatteringComponent::mOccupancy) - .def_readonly("mDynPopCorr", &ScatteringComponent::mDynPopCorr) - // Workaround to give attribute access. Again, returning the object, - // where it should be read-only. - .add_property("mpScattPow", - make_function( &_getScatteringPower, - return_internal_reference<>())) - .def("__str__", &__str__) - ; -} diff --git a/src/extensions/scatteringcomponentlist_ext.cpp b/src/extensions/scatteringcomponentlist_ext.cpp deleted file mode 100644 index 2663a41d..00000000 --- a/src/extensions/scatteringcomponentlist_ext.cpp +++ /dev/null @@ -1,92 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::ScatteringComponentList. -* -* Changes from ObjCryst::ScatteringComponentList -* - Wrapped as a to-python converter only (no constructor) -* - Added python list-like access -* -*****************************************************************************/ - -#include -#include -#include - -#include - -#include "helpers.hpp" - - -using namespace boost::python; -using namespace ObjCryst; - -namespace -{ - -const ScatteringComponent& -getItem(const ScatteringComponentList& scl, long idx) -{ - long n = scl.GetNbComponent(); - if(idx < 0) idx += n; - if(idx < 0 || idx >= n) - { - PyErr_SetString(PyExc_IndexError, "index out of range"); - throw_error_already_set(); - } - return scl(idx); -} - -bool contains(const ScatteringComponentList& scl, - const ScatteringComponent& sc) -{ - for(long i=0; i < scl.GetNbComponent(); ++i) - { - if( scl(i) == sc ) return true; - } - return false; -} - -// Get slices directly from the boost python object -bp::object getSCSlice(bp::object & scl, bp::slice& s) -{ - bp::list l(scl); - return l[s]; -} - - -} - -void wrap_scatteringcomponentlist() -{ - - class_ - ("ScatteringComponentList", no_init) - //("ScatteringComponentList", init()) - //.def(init()) - .def("Reset", &ScatteringComponentList::Reset) - .def("GetNbComponent", &ScatteringComponentList::GetNbComponent) - .def("Print", &ScatteringComponentList::Print) - .def(self == self) - .def(self += self) - .def(self += ScatteringComponent()) - .def("__str__", &__str__) - // Container-type things - .def("__len__", &ScatteringComponentList::GetNbComponent) - .def("__getitem__", &getItem, return_internal_reference<>()) - .def("__getitem__", &getSCSlice, - with_custodian_and_ward_postcall<1,0>()) - .def("__contains__", &contains) - ; -} diff --git a/src/extensions/scatteringdata_ext.cpp b/src/extensions/scatteringdata_ext.cpp deleted file mode 100644 index 9bdaa006..00000000 --- a/src/extensions/scatteringdata_ext.cpp +++ /dev/null @@ -1,172 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst Complex Modeling Initiative -* (c) 2015 Brookhaven Science Associates -* Brookhaven National Laboratory. -* All rights reserved. -* -* File coded by: Kevin Knox -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::ScatteringData. These bindings are -* used by ObjCryst objects that inherit from ScatteringData (see, for example, -* diffractiondatasinglecrystal_ext.cpp). -* -* Changes from ObjCryst::ScatteringData -* - GetWavelength returns a scalar instead of a vector -* -*****************************************************************************/ - -#include -#include -#include -#include - -#include -#include - -namespace bp = boost::python; -using namespace boost::python; -using namespace ObjCryst; - -namespace { - -void _PrintFhklCalc(const ScatteringData& sd) -{ - sd.PrintFhklCalc(); -} - - -void _PrintFhklCalcDetail(const ScatteringData& sd) -{ - sd.PrintFhklCalcDetail(); -} - - -double _GetWavelength(ScatteringData& s) -{ - return s.GetWavelength()(0); -} - -bp::dict _GetScatteringFactor(ScatteringData& data) -{ - - const std::map& vsf - = data.GetScatteringFactor(); - - std::map::const_iterator pos; - bp::dict d; - - for(pos = vsf.begin(); pos != vsf.end(); ++pos) - { - bp::object key(bp::ptr(pos->first)); - d[key] = pos->second; - } - return d; -} - - -} // anonymous namespace - - -void wrap_scatteringdata() -{ - scope().attr("refpartype_scattdata") = object(ptr(gpRefParTypeScattData)); - scope().attr("refpartype_scattdata_scale") = object(ptr(gpRefParTypeScattDataScale)); - scope().attr("refpartype_scattdata_profile") = object(ptr(gpRefParTypeScattDataProfile)); - scope().attr("refpartype_scattdata_profile_type") = object(ptr(gpRefParTypeScattDataProfileType)); - scope().attr("refpartype_scattdata_profile_width") = object(ptr(gpRefParTypeScattDataProfileWidth)); - scope().attr("refpartype_scattdata_profile_asym") = object(ptr(gpRefParTypeScattDataProfileAsym)); - scope().attr("refpartype_scattdata_corr") = object(ptr(gpRefParTypeScattDataCorr)); - scope().attr("refpartype_scattdata_corr_pos") = object(ptr(gpRefParTypeScattDataCorrPos)); - scope().attr("refpartype_scattdata_radiation") = object(ptr(gpRefParTypeRadiation)); - scope().attr("refpartype_scattdata_radiation_wavelength") = object(ptr(gpRefParTypeRadiationWavelength)); - - class_, boost::noncopyable>( - "ScatteringData", no_init) - /* Methods */ - // Have to convert from Python array to C++ array - //.def("SetHKL", &ScatteringData::SetHKL) - .def("GenHKLFullSpace2", - (void (ScatteringData::*)(const REAL,const bool)) &ScatteringData::GenHKLFullSpace2, - (bp::arg("maxsithsl"), bp::arg("unique")=false)) - .def("GenHKLFullSpace", - (void (ScatteringData::*)(const REAL,const bool)) &ScatteringData::GenHKLFullSpace, - (bp::arg("maxtheta"), bp::arg("unique")=false)) - // have to figure this out - //.def("GetRadiationType", &ScatteringData::GetRadiationType, - // return_value_policy()) - .def("SetCrystal", &ScatteringData::SetCrystal) - .def("GetCrystal", - (Crystal& (ScatteringData::*)()) &ScatteringData::GetCrystal, - return_internal_reference<>()) - .def("HasCrystal", &ScatteringData::HasCrystal) - .def("GetNbRefl", &ScatteringData::GetNbRefl) - .def("GetH", &ScatteringData::GetH, - return_value_policy()) - .def("GetK", &ScatteringData::GetK, - return_value_policy()) - .def("GetL", &ScatteringData::GetL, - return_value_policy()) - .def("GetH2Pi", &ScatteringData::GetH2Pi, - return_value_policy()) - .def("GetK2Pi", &ScatteringData::GetK2Pi, - return_value_policy()) - .def("GetL2Pi", &ScatteringData::GetL2Pi, - return_value_policy()) - .def("GetReflX", &ScatteringData::GetReflX, - return_value_policy()) - .def("GetReflY", &ScatteringData::GetReflY, - return_value_policy()) - .def("GetReflZ", &ScatteringData::GetReflZ, - return_value_policy()) - .def("GetSinThetaOverLambda", &ScatteringData::GetSinThetaOverLambda, - return_value_policy()) - .def("GetTheta", &ScatteringData::GetTheta, - return_value_policy()) - .def("GetClockTheta", &ScatteringData::GetClockTheta, - return_value_policy()) - .def("GetFhklCalcSq", &ScatteringData::GetFhklCalcSq, - return_value_policy()) - //.def("GetFhklCalcSq_FullDeriv") - .def("GetFhklCalcReal", &ScatteringData::GetFhklCalcReal, - return_value_policy()) - .def("GetFhklCalcImag", &ScatteringData::GetFhklCalcImag, - return_value_policy()) - .def("GetFhklObsSq", &ScatteringData::GetFhklObsSq, - return_value_policy()) - //.def("GetScatteringFactor", - // (const std::map< const ScatteringPower *, CrystVector_REAL > & - // (ScatteringData::*)()) &ScatteringData::GetScatteringFactor, - // return_internal_reference<>()) - .def("GetRadiation", - (Radiation& (ScatteringData::*)()) &ScatteringData::GetRadiation, - return_internal_reference<>()) - .def("GetRadiationType", &ScatteringData::GetRadiationType) - // Overloaded to return a single wavelength instead of a vector - .def("GetWavelength", &_GetWavelength) - .def("SetIsIgnoringImagScattFact", - &ScatteringData::SetIsIgnoringImagScattFact) - .def("IsIgnoringImagScattFact", - &ScatteringData::IsIgnoringImagScattFact) - .def("PrintFhklCalc", &_PrintFhklCalc) - .def("PrintFhklCalcDetail", &_PrintFhklCalcDetail) - // These don't seem necessary as I doubt we'll use ObjCryst for optimizations - //.def("BeginOptimization") - //.def("EndOptimization") - //.def("SetApproximationFlag") - .def("SetMaxSinThetaOvLambda", &ScatteringData::SetMaxSinThetaOvLambda) - .def("GetMaxSinThetaOvLambda", &ScatteringData::GetMaxSinThetaOvLambda) - .def("GetNbReflBelowMaxSinThetaOvLambda", - &ScatteringData::GetNbReflBelowMaxSinThetaOvLambda) - .def("GetClockNbReflBelowMaxSinThetaOvLambda", - &ScatteringData::GetClockNbReflBelowMaxSinThetaOvLambda, - return_value_policy()) - .def("GetScatteringFactor", &_GetScatteringFactor, - with_custodian_and_ward_postcall<1,0>()) - ; -} diff --git a/src/extensions/scatteringpower_ext.cpp b/src/extensions/scatteringpower_ext.cpp deleted file mode 100644 index 83ce1222..00000000 --- a/src/extensions/scatteringpower_ext.cpp +++ /dev/null @@ -1,295 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::ScatteringPower. -* -*****************************************************************************/ - -#include -#include -#include -#include -#include - -#include -#include -#include - -using namespace boost::python; -using namespace ObjCryst; - -namespace { - -class ScatteringPowerWrap : public ScatteringPower, - public wrapper -{ - - public: - - ScatteringPowerWrap() : ScatteringPower() {} - ScatteringPowerWrap(const ScatteringPower& S) : ScatteringPower(S) {} - ScatteringPowerWrap(const ScatteringPowerWrap& S) : ScatteringPower(S) {} - - // Pure Virtual functions - - CrystVector GetScatteringFactor( - const ScatteringData& data, const int spgSymPosIndex) const - { - return this->get_override("GetScatteringFactor")(data, spgSymPosIndex); - } - - double GetForwardScatteringFactor(const RadiationType type) const - { - return this->get_override("GetForwardScatteringFactor")(type); - } - - CrystVector GetTemperatureFactor( - const ScatteringData& data, const int spgSymPosIndex) const - { - return this->get_override("GetTemperatureFactor")(data, spgSymPosIndex); - } - - CrystMatrix GetResonantScattFactReal( - const ScatteringData& data, const int spgSymPosIndex) const - { - return this->get_override("GetResonantScattFactReal")(data, - spgSymPosIndex); - } - - CrystMatrix GetResonantScattFactImag( - const ScatteringData& data, const int spgSymPosIndex) const - { - return this->get_override("GetResonantScattFactImag")(data, - spgSymPosIndex); - } - - double GetRadius() const - { - return this->get_override("GetRadius")(); - } - - // Just plain virtual functions - // - bool default_IsScatteringFactorAnisotropic() const - { return ScatteringPower::IsScatteringFactorAnisotropic(); } - - bool IsScatteringFactorAnisotropic() const - { - override f = this->get_override("IsScatteringFactorAnisotropic"); - if (f) return f(); - return default_IsScatteringFactorAnisotropic(); - } - - bool default_IsTemperatureFactorAnisotropic() const - { return ScatteringPower::IsTemperatureFactorAnisotropic(); } - - bool IsTemperatureFactorAnisotropic() const - { - override f = this->get_override("IsTemperatureFactorAnisotropic"); - if (f) return f(); - return default_IsTemperatureFactorAnisotropic(); - } - - bool default_IsResonantScatteringAnisotropic() const - { return ScatteringPower::IsResonantScatteringAnisotropic(); } - - bool IsResonantScatteringAnisotropic() const - { - override f = this->get_override("IsResonantScatteringAnisotropic"); - if (f) return f(); - return default_IsResonantScatteringAnisotropic(); - } - - const std::string& default_GetSymbol() const - { return ScatteringPower::GetSymbol(); } - - const std::string& GetSymbol() const - { - override f = this->get_override("GetSymbol"); - if (f) return f(); - return default_GetSymbol(); - } - - void default_SetBiso(const double newB) - { ScatteringPower::SetBiso(newB); } - - void SetBiso(const double newB) - { - override f = this->get_override("SetBiso"); - if (f) f(newB); - else default_SetBiso(newB); - } - - void default_SetBij(const size_t& i, const size_t& j, const double newB) - { ScatteringPower::SetBij(i, j, newB); } - - void SetBij(const size_t& i, const size_t& j, const double newB) - { - override f = this->get_override("SetBij"); - if (f) f(i, j, newB); - else default_SetBij(i, j, newB); - } - - double default_GetFormalCharge() const - { return ScatteringPower::GetFormalCharge(); } - - double GetFormalCharge() const - { - override f = this->get_override("GetFormalCharge"); - if (f) return f(); - return default_GetFormalCharge(); - } - - void default_SetFormalCharge(const double charge) - { ScatteringPower::SetFormalCharge(charge); } - - void SetFormalCharge(const double charge) - { - override f = this->get_override("SetFormalCharge"); - if (f) f(charge); - else default_SetFormalCharge(charge); - } - - - protected: - - void InitRefParList() - { - this->get_override("InitRefParList")(); - } - - -}; // ScatteringPowerWrap - - -// Accessors for Bij parameters - -template -double _GetBij(ScatteringPower& sp) -{ - return sp.GetBij(i, j); -} - -template -void _SetBij(ScatteringPower& sp, const double newB) -{ - return sp.SetBij(i, j, newB); -} - -boost::python::tuple _GetColourRGB(ScatteringPower& sp) -{ - return make_tuple(sp.GetColourRGB()[0], sp.GetColourRGB()[1], sp.GetColourRGB()[2]); -} - - -} // anonymous namespace - - -void wrap_scatteringpower() -{ - scope().attr("refpartype_scattpow") = object(ptr(gpRefParTypeScattPow)); - // scope().attr("refpartype_scattpow_resonant") = object(ptr(gpRefParTypeScattPowResonant)); - scope().attr("refpartype_scattpow_temperature") = object(ptr(gpRefParTypeScattPowTemperature)); - // scope().attr("refpartype_scattpow_temperature_iso") = object(ptr(gpRefParTypeScattPowTemperatureIso)); - // scope().attr("refpartype_scattpow_temperature_aniso") = object(ptr(gpRefParTypeScattPowTemperatureAniso)); - // Global object registry - scope().attr("gScatteringPowerRegistry") = boost::cref(gScatteringPowerRegistry); - - // By making this non-copyable ScatteringPower can be passed from c++ when - // copy_const_reference is uses, but they are turned into RefinableObj - // instances. - class_ > - ("ScatteringPower") - .def(init()) - .def("GetScatteringFactor", - pure_virtual(&ScatteringPower::GetScatteringFactor), - (boost::python::arg("data"), - boost::python::arg("spgSymPosIndex")=-1)) - .def("GetForwardScatteringFactor", - pure_virtual(&ScatteringPower::GetForwardScatteringFactor)) - .def("GetTemperatureFactor", - pure_virtual(&ScatteringPower::GetTemperatureFactor), - (boost::python::arg("data"), - boost::python::arg("spgSymPosIndex")=-1)) - .def("GetResonantScattFactReal", - pure_virtual(&ScatteringPower::GetResonantScattFactReal), - (boost::python::arg("data"), - boost::python::arg("spgSymPosIndex")=-1)) - .def("GetResonantScattFactImag", - pure_virtual(&ScatteringPower::GetResonantScattFactImag), - (boost::python::arg("data"), - boost::python::arg("spgSymPosIndex")=-1)) - .def("IsScatteringFactorAnisotropic", - &ScatteringPower::IsScatteringFactorAnisotropic, - &ScatteringPowerWrap::default_IsScatteringFactorAnisotropic) - .def("IsTemperatureFactorAnisotropic", - &ScatteringPower::IsTemperatureFactorAnisotropic, - &ScatteringPowerWrap::default_IsTemperatureFactorAnisotropic) - .def("IsResonantScatteringAnisotropic", - &ScatteringPower::IsResonantScatteringAnisotropic, - &ScatteringPowerWrap::default_IsResonantScatteringAnisotropic) - .def("GetSymbol", - &ScatteringPower::GetSymbol, - &ScatteringPowerWrap::default_GetSymbol, - return_value_policy()) - .def("GetBiso", - (double (ScatteringPower::*)()const) &ScatteringPower::GetBiso) - .def("SetBiso", &ScatteringPower::SetBiso, - &ScatteringPowerWrap::default_SetBiso) - .def("GetBij", - (double (ScatteringPower::*)(const size_t&, const size_t&) const) - &ScatteringPower::GetBij) - .def("SetBij", (void (ScatteringPower::*) - (const size_t&, const size_t&, const double)) - &ScatteringPower::SetBij, - &ScatteringPowerWrap::default_SetBij) - .def("IsIsotropic", &ScatteringPower::IsIsotropic) - .def("GetDynPopCorrIndex", &ScatteringPower::GetDynPopCorrIndex) - .def("GetNbScatteringPower", &ScatteringPower::GetNbScatteringPower) - .def("GetLastChangeClock", &ScatteringPower::GetLastChangeClock, - return_value_policy()) - .def("GetRadius", - pure_virtual(&ScatteringPower::GetRadius)) - .def("GetMaximumLikelihoodPositionError", - pure_virtual(&ScatteringPower::GetMaximumLikelihoodPositionError)) - .def("SetMaximumLikelihoodPositionError", - pure_virtual(&ScatteringPower::SetMaximumLikelihoodPositionError)) - .def("GetMaximumLikelihoodNbGhostAtom", - pure_virtual(&ScatteringPower::GetMaximumLikelihoodNbGhostAtom)) - .def("SetMaximumLikelihoodNbGhostAtom", - pure_virtual(&ScatteringPower::SetMaximumLikelihoodNbGhostAtom)) - .def("GetMaximumLikelihoodParClock", - &ScatteringPower::GetMaximumLikelihoodParClock, - return_value_policy()) - .def("GetFormalCharge", - &ScatteringPower::GetFormalCharge, - &ScatteringPowerWrap::default_GetFormalCharge) - .def("SetFormalCharge", - &ScatteringPower::SetFormalCharge, - &ScatteringPowerWrap::default_SetFormalCharge) - .def("GetColourRGB", &_GetColourRGB) - .def("GetColour", &_GetColourRGB) - .def("SetColour", - (void (ScatteringPower::*)(const float,const float,const float)) &ScatteringPower::SetColour, - (boost::python::arg("r"), boost::python::arg("g"), boost::python::arg("b"))) - .add_property("Biso", (double (ScatteringPower::*)()const) - &ScatteringPower::GetBiso, &ScatteringPower::SetBiso) - .add_property("B11", &_GetBij<1,1>, &_SetBij<1,1>) - .add_property("B22", &_GetBij<2,2>, &_SetBij<2,2>) - .add_property("B33", &_GetBij<3,3>, &_SetBij<3,3>) - .add_property("B12", &_GetBij<1,2>, &_SetBij<1,2>) - .add_property("B13", &_GetBij<1,3>, &_SetBij<1,3>) - .add_property("B23", &_GetBij<2,3>, &_SetBij<2,3>) - ; -} diff --git a/src/extensions/scatteringpoweratom_ext.cpp b/src/extensions/scatteringpoweratom_ext.cpp deleted file mode 100644 index 7653d7b8..00000000 --- a/src/extensions/scatteringpoweratom_ext.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::ScatteringPowerAtom. -* -*****************************************************************************/ - -#include -#include - -#include - -#include - -namespace bp = boost::python; -using namespace boost::python; -using namespace ObjCryst; - - -void wrap_scatteringpoweratom() -{ - - typedef void (ScatteringPowerAtom::*SPAInitType)( - const string&, const string&, const double); - SPAInitType theinit = &ScatteringPowerAtom::Init; - - class_ > ("ScatteringPowerAtom", - init()) - .def( - init > - ((bp::arg("name"), bp::arg("symbol"), bp::arg("bIso")=1.0))) - .def("Init", theinit, - (bp::arg("name"), - bp::arg("symbol"), - bp::arg("biso")=1.0 - )) - .def("SetSymbol", &ScatteringPowerAtom::SetSymbol) - .def("GetElementName", &ScatteringPowerAtom::GetElementName) - .def("GetAtomicNumber", &ScatteringPowerAtom::GetAtomicNumber) - .def("GetAtomicWeight", &ScatteringPowerAtom::GetAtomicWeight) - ; -} diff --git a/src/extensions/scatteringpowersphere_ext.cpp b/src/extensions/scatteringpowersphere_ext.cpp deleted file mode 100644 index 3d9838c0..00000000 --- a/src/extensions/scatteringpowersphere_ext.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::ScatteringPowerSphere. -* -*****************************************************************************/ - -#include -#include - -#include - -#include - -namespace bp = boost::python; -using namespace boost::python; -using namespace ObjCryst; - - -void wrap_scatteringpowersphere() -{ - - typedef void (ScatteringPowerSphere::*SPSInitType)( - const string&, const double, const double); - SPSInitType theinit = &ScatteringPowerSphere::Init; - - class_ > - ("ScatteringPowerSphere") - .def(init >()) - .def("Init", theinit, - (boost::python::arg("name"), - boost::python::arg("radius"), - boost::python::arg("biso")=1.0 - )) - .def("GetRadius", &ScatteringPowerSphere::GetRadius) - ; -} diff --git a/src/extensions/spacegroup_ext.cpp b/src/extensions/spacegroup_ext.cpp deleted file mode 100644 index 7b596337..00000000 --- a/src/extensions/spacegroup_ext.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::SpaceGroup. -* -*****************************************************************************/ - -#include -#include -#include -#include -#include - -#include - -#include "helpers.hpp" - -namespace bp = boost::python; -using namespace boost::python; -using namespace ObjCryst; - -namespace { - -// This returns a list of translation operations -bp::list GetTranslationVectors(const SpaceGroup& sg) -{ - - const std::vector& tv = sg.GetTranslationVectors(); - - bp::list outlist; - std::vector::const_iterator vec; - for(vec = tv.begin(); vec != tv.end(); ++vec) - { - CrystVector translation(3); - for(int idx = 0; idx < 3; ++idx) - { - translation(idx) = vec->tr[idx]; - } - outlist.append(translation); - } - return outlist; -} - - -// Returns a list of (translation vector, rotation) tuples -bp::list GetSymmetryOperations(const SpaceGroup& sg) -{ - - const std::vector& sv = sg.GetSymmetryOperations(); - - bp::list outlist; - int r, c; - std::vector::const_iterator tup; - for(tup = sv.begin(); tup != sv.end(); ++tup) - { - CrystVector translation(3); - for(int idx = 0; idx < 3; ++idx) - { - translation(idx) = tup->tr[idx]; - } - CrystMatrix rotation(3,3); - for(int idx = 0; idx < 9; ++idx) - { - r = idx/3; - c = idx%3; - rotation(r,c) = tup->mx[idx]; - } - outlist.append(bp::make_tuple(translation, rotation)); - } - return outlist; -} - - -SpaceGroup* CreateSpaceGroup(const std::string& sgid) -{ - MuteObjCrystUserInfo muzzle; - // this may throw invalid_argument which is translated to ValueError - SpaceGroup* rv = new SpaceGroup(sgid); - return rv; -} - - -void SafeChangeSpaceGroup(SpaceGroup& sg, const std::string& sgid) -{ - MuteObjCrystUserInfo muzzle; - // this may throw invalid_argument which is translated to ValueError - sg.ChangeSpaceGroup(sgid); -} - -} // namespace - - -void wrap_spacegroup() -{ - - class_("SpaceGroup") - // Constructors - .def("__init__", make_constructor(CreateSpaceGroup)) - // Methods - .def("ChangeSpaceGroup", &SafeChangeSpaceGroup) - .def("GetName", &SpaceGroup::GetName, - return_value_policy()) - .def("IsInAsymmetricUnit", &SpaceGroup::IsInAsymmetricUnit) - .def("ChangeToAsymmetricUnit", &SpaceGroup::ChangeToAsymmetricUnit) - .def("IsInAsymmetricUnit", &SpaceGroup::IsInAsymmetricUnit) - .def("GetAsymUnit", &SpaceGroup::GetAsymUnit, - return_internal_reference<>()) - .def("GetSpaceGroupNumber", &SpaceGroup::GetSpaceGroupNumber) - .def("IsCentrosymmetric", &SpaceGroup::IsCentrosymmetric) - .def("GetNbTranslationVectors", &SpaceGroup::GetNbTranslationVectors) - .def("GetTranslationVectors", &GetTranslationVectors) - .def("GetSymmetryOperations", &GetSymmetryOperations) - .def("GetAllSymmetrics", &SpaceGroup::GetAllSymmetrics, - (bp::arg("x"), - bp::arg("y"), - bp::arg("z"), - bp::arg("noCenter")=false, - bp::arg("noTransl")=false, - bp::arg("noIdentical")=false)) - .def("GetNbSymmetrics", &SpaceGroup::GetNbSymmetrics, - (bp::arg("noCenter")=false, - bp::arg("noTransl")=false)) - .def("GetInversionCenter", &SpaceGroup::GetInversionCenter) - .def("Print", &SpaceGroup::Print) - .def("HasInversionCenter", &SpaceGroup::HasInversionCenter) - .def("IsInversionCenterAtOrigin", - &SpaceGroup::IsInversionCenterAtOrigin) - // Requires cctbx? Forward declaration doesn't work - //.def("GetCCTbxSpg", &SpaceGroup::GetCCTbxSpg, - // return_value_policy()) - .def("GetClockSpaceGroup", &SpaceGroup::GetClockSpaceGroup, - return_value_policy()) - .def("GetUniqueAxis", &SpaceGroup::GetUniqueAxis) - .def("GetExtension", &SpaceGroup::GetExtension) - .def("GetAllEquivRefl", &SpaceGroup::GetAllEquivRefl, - (bp::arg("h"), - bp::arg("k"), - bp::arg("l"), - bp::arg("excludeFriedelMate")=false, - bp::arg("forceFriedelLaw")=false)) - .def("IsReflSystematicAbsent", &SpaceGroup::IsReflSystematicAbsent) - .def("IsReflCentric", &SpaceGroup::IsReflCentric) - .def("GetExpectedIntensityFactor", &SpaceGroup::GetExpectedIntensityFactor) - .def("__str__", &SpaceGroup::GetName, - return_value_policy()) - .def("__repr__", &SpaceGroup::GetName, - return_value_policy()) - ; -} diff --git a/src/extensions/stretchmode_ext.cpp b/src/extensions/stretchmode_ext.cpp deleted file mode 100644 index be3eed6c..00000000 --- a/src/extensions/stretchmode_ext.cpp +++ /dev/null @@ -1,275 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::StretchMode and its derivatives. -* -* Note that all indices are zero-based. -* -*****************************************************************************/ - -#include -#include -#include -#include - -#include - -#include - -#include "helpers.hpp" - -namespace bp = boost::python; -using namespace boost::python; -using namespace ObjCryst; - - -namespace { - -typedef std::set MolAtomSet; - -class StretchModeWrap : public StretchMode, - public wrapper -{ - public: - - StretchModeWrap() : StretchMode() {} - StretchModeWrap(const StretchModeWrap& sm) : StretchMode(sm) {} - - // Pure virtual - - void CalcDeriv(const bool derivllk=true) const - { - this->get_override("CalcDeriv")(derivllk); - } - - void Stretch(const double change, const bool keepCenter) - { - this->get_override("Stretch")(change, keepCenter); - } - - void RandomStretch(const double change, const bool keepCenter) - { - this->get_override("RandomStretch")(change); - } - -}; - -// These gives us a way to add an atom to a stretch mode -void _AddAtomSMBL(StretchModeBondLength& mode, MolAtom& a) -{ - mode.mvTranslatedAtomList.insert(&a); -} - -void _AddAtomsSMBL(StretchModeBondLength& mode, bp::object& l) -{ - for(int i=0; i < len(l); ++i) - { - MolAtom* a = extract(l[i]); - mode.mvTranslatedAtomList.insert(a); - } -} - -void _AddAtomsSetSMBL(StretchModeBondLength& mode, MolAtomSet& l) -{ - - MolAtomSet::const_iterator p; - for(p = l.begin(); p != l.end(); ++p) - { - mode.mvTranslatedAtomList.insert(*p); - } -} - -bp::list _GetAtomsSMBL(StretchModeBondLength& mode) -{ - bp::list l; - - MolAtomSet& v = mode.mvTranslatedAtomList; - - l = ptrcontainerToPyList< MolAtomSet >(v); - - return l; -} - - -// This one is for the angle modes -template -void _AddAtom(T& mode, MolAtom& a) -{ - mode.mvRotatedAtomList.insert(&a); -} - -template -void _AddAtoms(T& mode, bp::object& l) -{ - for(int i=0; i < len(l); ++i) - { - MolAtom* a = extract(l[i]); - mode.mvRotatedAtomList.insert(a); - } -} - -template -void _AddAtomsSet(T& mode, MolAtomSet& l) -{ - - MolAtomSet::const_iterator p; - for(p = l.begin(); p != l.end(); ++p) - { - mode.mvRotatedAtomList.insert(*p); - } -} - -template -bp::list _GetAtoms(T& mode) -{ - bp::list l; - - MolAtomSet& v = mode.mvRotatedAtomList; - - l = ptrcontainerToPyList< MolAtomSet >(v); - - return l; -} - -// These are accessors for the atoms. - -template -MolAtom* _GetAtom0(T& mode) -{ - return mode.mpAtom0; -} - -template -MolAtom* _GetAtom1(T& mode) -{ - return mode.mpAtom1; -} - -template -MolAtom* _GetAtom2(T& mode) -{ - return mode.mpAtom2; -} - -} // namespace - - -void wrap_stretchmode() -{ - - class_ ("StretchMode", no_init ) - .def("CalcDeriv", pure_virtual(&StretchMode::CalcDeriv), - (bp::arg("derivllk")=true)) - .def("Stretch", pure_virtual(&StretchMode::Stretch), - (bp::arg("amplitude"), bp::arg("keepCenter")=true)) - .def("RandomStretch", pure_virtual(&StretchMode::RandomStretch), - bp::arg("amplitude")) - ; - - class_ > - ("StretchModeBondLength", - init - ((bp::arg("at0"), bp::arg("at1"), bp::arg("pBond")=0)) - [with_custodian_and_ward<1,2, - with_custodian_and_ward<1,3, - with_custodian_and_ward<1,4> > >()]) - .def("AddAtom", &_AddAtomSMBL, - with_custodian_and_ward<1,2>()) - .def("AddAtoms", &_AddAtomsSMBL, - with_custodian_and_ward<1,2>()) - .def("AddAtoms", &_AddAtomsSetSMBL, - with_custodian_and_ward<1,2>()) - .def("GetAtoms", &_GetAtomsSMBL, - with_custodian_and_ward_postcall<1,0>()) - .add_property("mpAtom0", - make_function( &_GetAtom0, - return_internal_reference<>())) - .add_property("mpAtom1", - make_function( &_GetAtom1, - return_internal_reference<>())) - ; - - class_ > - ("StretchModeBondAngle", - init - ((bp::arg("at0"), bp::arg("at1"), bp::arg("at2"), - bp::arg("pBondAngle")=0)) - [with_custodian_and_ward<1,2, - with_custodian_and_ward<1,3, - with_custodian_and_ward<1,4, - with_custodian_and_ward<1,5> > > >()]) - .def("AddAtom", &_AddAtom, - with_custodian_and_ward<1,2>()) - .def("AddAtoms", &_AddAtoms, - with_custodian_and_ward<1,2>()) - .def("AddAtoms", &_AddAtomsSet, - with_custodian_and_ward<1,2>()) - .def("GetAtoms", &_GetAtoms, - with_custodian_and_ward_postcall<1,0>()) - .add_property("mpAtom0", - make_function( &_GetAtom0, - return_internal_reference<>())) - .add_property("mpAtom1", - make_function( &_GetAtom1, - return_internal_reference<>())) - .add_property("mpAtom2", - make_function( &_GetAtom2, - return_internal_reference<>())) - ; - - class_ > - ("StretchModeTorsion", - init - ((bp::arg("at0"), bp::arg("at1"), bp::arg("pDihedralAngle")=0)) - [with_custodian_and_ward<1,2, - with_custodian_and_ward<1,3, - with_custodian_and_ward<1,4> > >()]) - .def("AddAtom", &_AddAtom, - with_custodian_and_ward<1,2>()) - .def("AddAtoms", &_AddAtoms, - with_custodian_and_ward<1,2>()) - .def("AddAtoms", &_AddAtomsSet, - with_custodian_and_ward<1,2>()) - .def("GetAtoms", &_GetAtoms, - with_custodian_and_ward_postcall<1,0>()) - .add_property("mpAtom1", - make_function( &_GetAtom1, - return_internal_reference<>())) - .add_property("mpAtom2", - make_function( &_GetAtom2, - return_internal_reference<>())) - ; - - class_ > - ("StretchModeTwist", - init - ((bp::arg("at0"), bp::arg("at1"))) - [with_custodian_and_ward<1,2, - with_custodian_and_ward<1,3> >()]) - .def("AddAtom", &_AddAtom, - with_custodian_and_ward<1,2>()) - .def("AddAtoms", &_AddAtoms, - with_custodian_and_ward<1,2>()) - .def("AddAtoms", &_AddAtomsSet, - with_custodian_and_ward<1,2>()) - .def("GetAtoms", &_GetAtoms, - with_custodian_and_ward_postcall<1,0>()) - .add_property("mpAtom1", - make_function( &_GetAtom1, - return_internal_reference<>())) - .add_property("mpAtom2", - make_function( &_GetAtom2, - return_internal_reference<>())) - ; -} diff --git a/src/extensions/unitcell_ext.cpp b/src/extensions/unitcell_ext.cpp deleted file mode 100644 index 94c986a5..00000000 --- a/src/extensions/unitcell_ext.cpp +++ /dev/null @@ -1,201 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::UnitCell. -* -*****************************************************************************/ - -#include -#include -#include -#include - -#include - -#include -#include - -#include "helpers.hpp" - -using namespace boost::python; -using namespace ObjCryst; -namespace bp = boost::python; - -namespace { - -bp::tuple FractionalToOrthonormalCoords(const UnitCell& uc, - double x, double y, double z) -{ - uc.FractionalToOrthonormalCoords(x,y,z); - return bp::make_tuple(x,y,z); -} - -bp::tuple OrthonormalToFractionalCoords(const UnitCell& uc, - double x, double y, double z) -{ - uc.OrthonormalToFractionalCoords(x,y,z); - return bp::make_tuple(x,y,z); -} - -bp::tuple MillerToOrthonormalCoords(const UnitCell& uc, - double x, double y, double z) -{ - uc.MillerToOrthonormalCoords(x,y,z); - return bp::make_tuple(x,y,z); -} - -bp::tuple OrthonormalToMillerCoords(const UnitCell& uc, - double x, double y, double z) -{ - uc.OrthonormalToMillerCoords(x,y,z); - return bp::make_tuple(x,y,z); -} - -// Setter for the lattice parameters. - -void _seta(UnitCell& u, double val) -{ - u.GetPar("a").SetValue(val); -} - -double _geta(UnitCell& u) -{ - return u.GetLatticePar(0); -} - -void _setb(UnitCell& u, double val) -{ - u.GetPar("b").SetValue(val); -} - -double _getb(UnitCell& u) -{ - return u.GetLatticePar(1); -} - -void _setc(UnitCell& u, double val) -{ - u.GetPar("c").SetValue(val); -} - -double _getc(UnitCell& u) -{ - return u.GetLatticePar(2); -} - -void _setalpha(UnitCell& u, double val) -{ - if((val<=0)||(val>=M_PI)) throw ObjCrystException("alpha must be within ]0;pi["); - RefinablePar &p = u.GetPar("alpha"); - if(p.IsUsed()) p.SetValue(val); - // Throwing an exception here would be risky - a warning would be more adequate - // else throw ObjCrystException("alpha is fixed and cannot be changed"); -} - -double _getalpha(UnitCell& u) -{ - return u.GetLatticePar(3); -} - -void _setbeta(UnitCell& u, double val) -{ - if((val<=0)||(val>=M_PI)) throw ObjCrystException("beta must be within ]0;pi["); - RefinablePar &p = u.GetPar("beta"); - if(p.IsUsed()) p.SetValue(val); - // Throwing an exception here would be risky - a warning would be more adequate - // else throw ObjCrystException("beta is fixed and cannot be changed"); -} - -double _getbeta(UnitCell& u) -{ - return u.GetLatticePar(4); -} - -void _setgamma(UnitCell& u, double val) -{ - if((val<=0)||(val>=M_PI)) throw ObjCrystException("gamma must be within ]0;pi["); - RefinablePar &p = u.GetPar("gamma"); - if(p.IsUsed()) p.SetValue(val); - // Throwing an exception here would be risky - a warning would be more adequate - // else throw ObjCrystException("gamma is fixed and cannot be changed"); -} - -double _getgamma(UnitCell& u) -{ - return u.GetLatticePar(5); -} - -void SafeChangeSpaceGroup(UnitCell& u, const std::string& sgid) -{ - MuteObjCrystUserInfo muzzle; - // this may throw invalid_argument which is translated to ValueError - u.ChangeSpaceGroup(sgid); -} - - -} - -void wrap_unitcell() -{ - scope().attr("refpartype_unitcell") = object(ptr(gpRefParTypeUnitCell)); - scope().attr("refpartype_unitcell_length") = object(ptr(gpRefParTypeUnitCellLength)); - scope().attr("refpartype_unitcell_angle") = object(ptr(gpRefParTypeUnitCellAngle)); - - class_ > - ("UnitCell") - // Constructors - .def(init()) - .def(init()) - .def(init()) - .def("GetLatticePar", - (CrystVector (UnitCell::*)() const) &UnitCell::GetLatticePar) - .def("GetLatticePar", - (double (UnitCell::*)(const int) const) &UnitCell::GetLatticePar) - .def("GetClockLatticePar", &UnitCell::GetClockLatticePar, - return_value_policy()) - .def("GetBMatrix", &UnitCell::GetBMatrix, - return_value_policy()) - .def("GetOrthMatrix", &UnitCell::GetOrthMatrix, - return_value_policy()) - .def("GetClockMetricMatrix", &UnitCell::GetClockMetricMatrix, - return_value_policy()) - .def("GetOrthonormalCoords", &UnitCell::GetOrthonormalCoords) - // Modified to return a tuple - .def("OrthonormalToFractionalCoords", - &OrthonormalToFractionalCoords) - // Modified to return a tuple - .def("FractionalToOrthonormalCoords", - &FractionalToOrthonormalCoords) - // Modified to return a tuple - .def("MillerToOrthonormalCoords", - &MillerToOrthonormalCoords) - // Modified to return a tuple - .def("OrthonormalToMillerCoords", - &OrthonormalToMillerCoords) - .def("GetSpaceGroup", (SpaceGroup& (UnitCell::*)()) &UnitCell::GetSpaceGroup, - return_internal_reference<>()) - .def("ChangeSpaceGroup", &SafeChangeSpaceGroup) - .def("GetVolume", &UnitCell::GetVolume) - .def("__str__", &__str__) - // python-only - .add_property("a", &_geta, &_seta) - .add_property("b", &_getb, &_setb) - .add_property("c", &_getc, &_setc) - .add_property("alpha", &_getalpha, &_setalpha) - .add_property("beta", &_getbeta, &_setbeta) - .add_property("gamma", &_getgamma, &_setgamma) - ; -} diff --git a/src/extensions/zatom_ext.cpp b/src/extensions/zatom_ext.cpp deleted file mode 100644 index 64c3e7fc..00000000 --- a/src/extensions/zatom_ext.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::ZAtom. -* -* Changes from ObjCryst::ZAtom -* - XMLOutput and Input are not wrapped. -* -*****************************************************************************/ - -#include -#include -#include - -#include - -namespace bp = boost::python; -using namespace boost::python; -using namespace ObjCryst; - -namespace { - -} - -void wrap_zatom() -{ - - /* This class is created internally by a ZScatterer, so it does not have an - * init function - */ - class_("ZAtom", no_init) - //init( - // (bp::arg("scatt"), bp::arg("pow"), bp::arg("atomBond")=0, - // bp::arg("bondLength")=1, bp::arg("atomAngle")=0, - // bp::arg("bondAngle")=0, bp::arg("atomDihedral")=0, - // bp::arg("popu")=1, bp::arg("name")="") - // ) - //[with_custodian_and_ward<2,1,with_custodian_and_ward<1,3> >()] - //) - // Methods - .def("GetClassName", &ZAtom::GetClassName, - return_value_policy()) - .def("GetName", &ZAtom::GetName, - return_value_policy()) - .def("SetName", &ZAtom::SetName) - .def("GetZScatterer", (ZScatterer& (ZAtom::*)()) &ZAtom::GetZScatterer, - return_internal_reference<>()) - .def("GetZBondAtom", &ZAtom::GetZBondAtom) - .def("GetZAngleAtom", &ZAtom::GetZAngleAtom) - .def("GetZDihedralAngleAtom", &ZAtom::GetZDihedralAngleAtom) - .def("GetZBondLength", &ZAtom::GetZBondLength, - return_value_policy()) - .def("GetZAngle", &ZAtom::GetZAngle, - return_value_policy()) - .def("GetZDihedralAngle", &ZAtom::GetZDihedralAngle, - return_value_policy()) - .def("GetOccupancy", &ZAtom::GetOccupancy, - return_value_policy()) - .def("GetScatteringPower", &ZAtom::GetScatteringPower, - return_internal_reference<>()) - .def("SetZBondLength", &ZAtom::SetZBondLength) - .def("SetZAngle", &ZAtom::SetZAngle) - .def("SetZDihedralAngle", &ZAtom::SetZDihedralAngle) - .def("SetOccupancy", &ZAtom::SetOccupancy) - .def("SetScatteringPower", &ZAtom::SetScatteringPower, - with_custodian_and_ward<1,2>()) - ; - -} diff --git a/src/extensions/zpolyhedron_ext.cpp b/src/extensions/zpolyhedron_ext.cpp deleted file mode 100644 index 9e9ac9c0..00000000 --- a/src/extensions/zpolyhedron_ext.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::ZPolyhedron. -* -*****************************************************************************/ - -#include -#include -#include - -#include - -#include - - -namespace bp = boost::python; -using namespace boost::python; -using namespace ObjCryst; - - -void wrap_zpolyhedron() -{ - - class_ > - ("ZPolyhedron", init()) - /* Constructors */ - .def(init( - (bp::arg("type"), bp::arg("cryst"), bp::arg("x"), - bp::arg("y"), bp::arg("z"), bp::arg("name"), - bp::arg("centralAtomPow"), bp::arg("periphAtomPow"), - bp::arg("centralPeriphDist"), bp::arg("ligandPopu")=1, - bp::arg("phi")=0, bp::arg("chi")=0, bp::arg("psi")=0) - ) - [with_custodian_and_ward<3,1, - with_custodian_and_ward<1,8, - with_custodian_and_ward<1,9> > >() - ] - ) - ; - - enum_("RegularPolyhedraType") - .value("TETRAHEDRON", TETRAHEDRON) - .value("OCTAHEDRON", OCTAHEDRON) - .value("SQUARE_PLANE", SQUARE_PLANE) - .value("CUBE", CUBE) - .value("ANTIPRISM_TETRAGONAL", ANTIPRISM_TETRAGONAL) - .value("PRISM_TETRAGONAL_MONOCAP", PRISM_TETRAGONAL_MONOCAP) - .value("PRISM_TETRAGONAL_DICAP", PRISM_TETRAGONAL_DICAP) - .value("PRISM_TRIGONAL", PRISM_TRIGONAL) - .value("PRISM_TRIGONAL_TRICAPPED", PRISM_TRIGONAL_TRICAPPED) - .value("ICOSAHEDRON", ICOSAHEDRON) - .value("TRIANGLE_PLANE", TRIANGLE_PLANE) - ; -} diff --git a/src/extensions/zscatterer_ext.cpp b/src/extensions/zscatterer_ext.cpp deleted file mode 100644 index f5e08229..00000000 --- a/src/extensions/zscatterer_ext.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/***************************************************************************** -* -* pyobjcryst by DANSE Diffraction group -* Simon J. L. Billinge -* (c) 2009 The Trustees of Columbia University -* in the City of New York. All rights reserved. -* -* File coded by: Chris Farrow -* -* See AUTHORS.txt for a list of people who contributed. -* See LICENSE_DANSE.txt for license information. -* -****************************************************************************** -* -* boost::python bindings to ObjCryst::ZScatterer. -* -* Changes from ObjCryst++ -* - XMLOutput and Input are not wrapped. -* -* - Import and output is not implemented yet. -* -*****************************************************************************/ - -#include -#include -#include - -#include - -#include - -#include "python_streambuf.hpp" -#include "helpers.hpp" - -namespace bp = boost::python; -using namespace boost::python; -using namespace ObjCryst; - -void _ImportFenskeHallZMatrix(ZScatterer &scatt, bp::object input , bool named) -{ - // Mute output - MuteObjCrystUserInfo muzzle; - CaptureStdOut gag; - - boost_adaptbx::python::streambuf sbuf(input); - boost_adaptbx::python::streambuf::istream in(sbuf); - scatt.ImportFenskeHallZMatrix(in, named); -} - -void wrap_zscatterer() -{ - - class_ > - ("ZScatterer", init(bp::arg("old"))) - /* Constructors */ - .def(init - ((bp::arg("name"), bp::arg("cryst"), bp::arg("x")=0, bp::arg("y")=0, - bp::arg("z")=0, bp::arg("phi")=0, bp::arg("chi")=0, - bp::arg("psi")=0) - ) [with_custodian_and_ward<1,6>()]) - /* Methods */ - .def("GetClassName", &ZScatterer::GetClassName, - return_value_policy()) - .def("AddAtom", &ZScatterer::AddAtom, - (bp::arg("name"), bp::arg("pow"), - bp::arg("atomBond"), bp::arg("bondLength"), - bp::arg("atomAngle"), bp::arg("bondAngle"), - bp::arg("atomDihedral"), bp::arg("dihedralAngle"), - bp::arg("popu")=1.0 - ), with_custodian_and_ward<1,3>() - ) - .def("GetPhi", &ZScatterer::GetPhi) - .def("GetChi", &ZScatterer::GetChi) - .def("GetPsi", &ZScatterer::GetPsi) - .def("SetPhi", &ZScatterer::SetPhi) - .def("SetChi", &ZScatterer::SetChi) - .def("SetPsi", &ZScatterer::SetPsi) - .def("GetZAtomX", &ZScatterer::GetZAtomX) - .def("GetZAtomY", &ZScatterer::GetZAtomY) - .def("GetZAtomZ", &ZScatterer::GetZAtomZ) - .def("GetZBondAtom", &ZScatterer::GetZBondAtom) - .def("GetZAngleAtom", &ZScatterer::GetZAngleAtom) - .def("GetZDihedralAngleAtom", &ZScatterer::GetZDihedralAngleAtom) - .def("GetZBondLength", &ZScatterer::GetZBondLength) - .def("GetZAngle", &ZScatterer::GetZAngle) - .def("GetZDihedralAngle", &ZScatterer::GetZDihedralAngle) - .def("SetZBondLength", &ZScatterer::SetZBondLength) - .def("SetZAngle", &ZScatterer::SetZAngle) - .def("SetZDihedralAngle", &ZScatterer::SetZDihedralAngle) - .def("GetZAtomRegistry", &ZScatterer::GetZAtomRegistry, - return_value_policy()) - .def("GetXCoord", &ZScatterer::GetXCoord, - return_value_policy()) - .def("GetYCoord", &ZScatterer::GetYCoord, - return_value_policy()) - .def("GetZCoord", &ZScatterer::GetZCoord, - return_value_policy()) - .def("SetCenterAtomIndex", &ZScatterer::SetCenterAtomIndex) - .def("GetCenterAtomIndex", &ZScatterer::GetCenterAtomIndex) - .def("ImportFenskeHallZMatrix", &_ImportFenskeHallZMatrix) - // Python-only methods - .def("__str__", &__str__) - ; - -} diff --git a/tests/test_powderpattern.py b/tests/test_powderpattern.py index a5420a15..4cb37db9 100644 --- a/tests/test_powderpattern.py +++ b/tests/test_powderpattern.py @@ -181,6 +181,33 @@ def test_SetRadiationType(self): self.assertEqual(pp.GetRadiationType(), RadiationType.RAD_NEUTRON) pp.SetRadiationType(t) + def test_GetClassName(self): + # Regression test: PowderPatternDiffraction/PowderPatternBackground + # nanobind-inherit from ScatteringData/PowderPatternComponent rather + # than RefinableObj directly (RefinableObj is a *virtual* base of + # both, see nanobind_migration_notes.md); GetName/SetName/FixAllPar/ + # UnFixAllPar were rebound manually to compensate, but GetClassName + # was missed, so it raised AttributeError -- surfaced via + # PowderPattern.plot(hkl=True), which calls GetClassName() on every + # component to build the phase legend. Nanobind-specific; no + # equivalent needed upstream (Boost.Python didn't have this bug). + c = self.loadcifdata("paracetamol.cif") + p = PowderPattern() + p.SetWavelength(0.7) + x = np.linspace(0, 40, 8001) + p.SetPowderPatternX(np.deg2rad(x)) + p.SetPowderPatternObs(np.ones_like(x)) + pd = p.AddPowderPatternDiffraction(c) + bg = p.AddPowderPatternBackground() + self.assertEqual("PowderPatternDiffraction", pd.GetClassName()) + self.assertEqual("PowderPatternBackground", bg.GetClassName()) + for i in range(p.GetNbPowderPatternComponent()): + comp = p.GetPowderPatternComponent(i) + self.assertIn( + comp.GetClassName(), + ("PowderPatternDiffraction", "PowderPatternBackground"), + ) + def test_quick_fit(self): c = self.loadcifdata("paracetamol.cif") p = PowderPattern() @@ -337,10 +364,53 @@ def test_update_nbrefl(self): # ---------------------------------------------------------------------------- -class TestPowderPatternComponent(unittest.TestCase): - pass - # def test___init__(self): assert False - # def test_GetParentPowderPattern(self): assert False +class _PowderPatternComponentFixtureMixin: + """Shared setUp for the three test classes below: a PowderPattern with + one real PowderPatternBackground and one real PowderPatternDiffraction + attached, mirroring TestPowderPattern.test_GetClassName's setup. Both + PowderPatternComponent and ScatteringData inherit RefinableObj virtually + in C++ (and PowderPatternDiffraction inherits PowderPatternComponent + virtually *again*, on top of ScatteringData non-virtually) -- see + nanobind_migration_notes.md's "Follow-up" section -- so neither class is + directly instantiable from Python; these fixtures exercise the + forwarding fix through real, concrete PowderPatternComponent-family + objects instead. + """ + + @pytest.fixture(autouse=True) + def prepare_fixture(self, loadcifdata): + self.loadcifdata = loadcifdata + + def setUp(self): + c = self.loadcifdata("paracetamol.cif") + self.pp = PowderPattern() + self.pp.SetWavelength(0.7) + x = np.linspace(0, 40, 8001) + self.pp.SetPowderPatternX(np.deg2rad(x)) + self.pp.SetPowderPatternObs(np.ones_like(x)) + self.bg = self.pp.AddPowderPatternBackground() + self.diff = self.pp.AddPowderPatternDiffraction(c) + + +class TestPowderPatternComponent(_PowderPatternComponentFixtureMixin, unittest.TestCase): + + def test_GetParentPowderPattern(self): + self.assertIs(self.pp, self.bg.GetParentPowderPattern()) + self.assertIs(self.pp, self.diff.GetParentPowderPattern()) + + def test_refinableobj_forwarding(self): + """PowderPatternComponent inherits RefinableObj virtually; only + GetName/SetName/GetClassName/FixAllPar/UnFixAllPar were reachable + before the forwarding fix (see test_GetClassName above, which + covers GetClassName specifically) -- exercise the rest here.""" + self.bg.SetName("mybg") + self.assertEqual("mybg", self.bg.GetName()) + self.bg.FixAllPar() + self.bg.UnFixAllPar() + self.bg.BeginOptimization() + self.bg.EndOptimization() + self.assertEqual(0.0, self.bg.GetLogLikelihood()) + self.bg.UpdateDisplay() # End of class TestPowderPatternComponent @@ -348,8 +418,7 @@ class TestPowderPatternComponent(unittest.TestCase): # ---------------------------------------------------------------------------- -class TestPowderPatternBackground(unittest.TestCase): - pass +class TestPowderPatternBackground(_PowderPatternComponentFixtureMixin, unittest.TestCase): # def test___init__(self): assert False # def test_FixParametersBeyondMaxresolution(self): assert False # def test_GetPowderPatternCalc(self): assert False @@ -357,42 +426,21 @@ class TestPowderPatternBackground(unittest.TestCase): # def test_OptimizeBayesianBackground(self): assert False # def test_SetInterpPoints(self): assert False + def test_refinableobj_forwarding(self): + import io -# End of class TestPowderPatternBackground + self.bg.SetName("bg_xml_test") + buf = io.StringIO() + self.bg.XMLOutput(buf) + self.assertIn("() and + bind_scatteringpower_forwarding() had to be applied directly to it.""" + + def setUp(self): + self.sp, self.atom = makeScatterer() + + def test_names(self): + self.assertEqual("ScatteringPowerAtom", self.sp.GetClassName()) + self.assertEqual("Ni", self.sp.GetName()) + + def test_print_does_not_raise(self): + # Print() writes to stdout; just confirm it's reachable and runs. + self.sp.Print() + + def test_log_likelihood(self): + self.assertEqual(0.0, self.sp.GetLogLikelihood()) + + def test_scatteringpower_own_methods_forwarded(self): + """These are ScatteringPower's *own* methods (not RefinableObj's), + forwarded via bind_scatteringpower_forwarding().""" + self.assertGreaterEqual(self.sp.GetDynPopCorrIndex(), 0) + self.assertIsNotNone(self.sp.GetLastChangeClock()) + r, g, b = self.sp.GetColourRGB() + self.assertTrue(all(0.0 <= v <= 1.0 for v in (r, g, b))) + + def test_lsq_methods_reachable_and_raise_when_unset(self): + """Ported forward alongside the forwarding fix: GetLSQCalc/Obs/ + Weight/Deriv exist on RefinableObj and are therefore forwarded here + too, even though nothing has configured a custom LSQ target.""" + with self.assertRaises(ObjCrystException): + self.sp.GetLSQCalc(0) + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/test_single_crystal_data.py b/tests/test_single_crystal_data.py index 61253fdb..d64e38d7 100644 --- a/tests/test_single_crystal_data.py +++ b/tests/test_single_crystal_data.py @@ -2,6 +2,7 @@ """Tests for diffractiondatasinglecrystal module.""" +import io import unittest import numpy as np @@ -58,6 +59,29 @@ def test_create_set_hkliobs(self): d.SetSigma(sigma) self.assertTrue(np.all(sigma == d.GetSigma())) + def test_refinableobj_forwarding(self): + """DiffractionDataSingleCrystal reaches RefinableObj only through + ScatteringData's C++ virtual base (see nanobind_migration_notes.md's + "Follow-up: restoring RefinableObj's method surface on virtually- + inherited classes"); presence-only coverage for the class lives in + test_virtualbase_forwarding.py -- this exercises actual behaviour.""" + c = Crystal(3.52, 3.52, 3.52, "225") + d = DiffractionDataSingleCrystal(c) + + d.SetName("mydiff") + self.assertEqual("mydiff", d.GetName()) + + d.FixAllPar() + d.UnFixAllPar() + d.BeginOptimization() + d.EndOptimization() + self.assertEqual(0.0, d.GetLogLikelihood()) + d.UpdateDisplay() + + buf = io.StringIO() + d.XMLOutput(buf) + self.assertIn("derived pointer +adjustment assumes a fixed offset, which a virtual base doesn't have). +Boost.Python's ``bases`` had no such problem, so under +Boost.Python these four classes -- and everything under them (Atom, +Molecule, ZScatterer, ZPolyhedron, ScatteringPowerAtom, ScatteringPowerSphere, +GlobalScatteringPower, DiffractionDataSingleCrystal, PowderPatternBackground, +PowderPatternDiffraction) -- got RefinableObj's full method surface for free +via ordinary Python inheritance. The initial nanobind port only restored a +handful of these methods as one-off shims; the rest (Print, XMLOutput, +BeginOptimization, GetLogLikelihood, UpdateDisplay, AddPar, ...) were simply +uncallable from Python. See nanobind_migration_notes.md's "Follow-up: +restoring RefinableObj's method surface on virtually-inherited classes". + +This file exhaustively enumerates every method the canonical RefinableObj/ +ScatteringPower Python types expose and asserts each of the affected classes +also has it -- so a future refactor that touches +``bind_refinableobj_forwarding()``/``bind_scatteringpower_forwarding()`` +or any of their call sites in ``helpers_nb.hpp`` can't silently drop coverage +the way the original port did. Functional (not just presence) tests for a +representative sample live in test_scatterer.py, test_refinableobj.py, +test_powderpattern.py, and test_single_crystal_data.py. +""" + +import unittest + +import pyobjcryst._pyobjcryst as _p +from pyobjcryst.powderpattern import PowderPatternComponent +from pyobjcryst.refinableobj import RefinableObj +from pyobjcryst.scatterer import Scatterer +from pyobjcryst.scatteringdata import ScatteringData +from pyobjcryst.scatteringpower import ScatteringPower, ScatteringPowerAtom +from pyobjcryst.zscatterer import GlobalScatteringPower + + +def _public_methods(cls): + return sorted(name for name in dir(cls) if not name.startswith("_")) + + +REFINABLEOBJ_METHODS = _public_methods(RefinableObj) +SCATTERINGPOWER_METHODS = _public_methods(ScatteringPower) + + +class TestRefinableObjSurfaceForwarding(unittest.TestCase): + """Every RefinableObj method must be reachable on the four classes that + only reach RefinableObj through a C++ virtual base.""" + + def _assert_full_coverage(self, cls): + missing = [m for m in REFINABLEOBJ_METHODS if not hasattr(cls, m)] + self.assertEqual( + missing, + [], + f"{cls.__name__} is missing RefinableObj methods: {missing}", + ) + + def test_scatterer(self): + self._assert_full_coverage(Scatterer) + + def test_scatteringpower(self): + self._assert_full_coverage(ScatteringPower) + + def test_scatteringdata(self): + self._assert_full_coverage(ScatteringData) + + def test_powderpatterncomponent(self): + self._assert_full_coverage(PowderPatternComponent) + + # Concrete leaves that inherit the four classes above *non-virtually* + # should get the surface "for free" via ordinary Python inheritance -- + # verify that actually holds rather than assuming it. + def test_atom(self): + self._assert_full_coverage(_p.Atom) + + def test_molecule(self): + self._assert_full_coverage(_p.Molecule) + + def test_zscatterer(self): + self._assert_full_coverage(_p.ZScatterer) + + def test_zpolyhedron(self): + self._assert_full_coverage(_p.ZPolyhedron) + + def test_scatteringpowersphere(self): + self._assert_full_coverage(_p.ScatteringPowerSphere) + + def test_diffractiondatasinglecrystal(self): + self._assert_full_coverage(_p.DiffractionDataSingleCrystal) + + def test_powderpatternbackground(self): + self._assert_full_coverage(_p.PowderPatternBackground) + + def test_powderpatterndiffraction(self): + self._assert_full_coverage(_p.PowderPatternDiffraction) + + # ScatteringPowerAtom and GlobalScatteringPower have a *second* virtual + # inheritance jump (they inherit ScatteringPower virtually too), so they + # can't ride on ScatteringPower's nanobind base either -- confirm they + # were forwarded directly rather than assuming the cascade covers them. + def test_scatteringpoweratom(self): + self._assert_full_coverage(ScatteringPowerAtom) + + def test_globalscatteringpower(self): + self._assert_full_coverage(GlobalScatteringPower) + + +class TestScatteringPowerSurfaceForwarding(unittest.TestCase): + """ScatteringPowerAtom and GlobalScatteringPower need ScatteringPower's + own method surface (GetScatteringFactor, GetBij/SetBij, GetColour, ...) + forwarded too, on top of RefinableObj's.""" + + def _assert_full_coverage(self, cls): + missing = [m for m in SCATTERINGPOWER_METHODS if not hasattr(cls, m)] + self.assertEqual( + missing, + [], + f"{cls.__name__} is missing ScatteringPower methods: {missing}", + ) + + def test_scatteringpoweratom(self): + self._assert_full_coverage(ScatteringPowerAtom) + + def test_globalscatteringpower(self): + self._assert_full_coverage(GlobalScatteringPower) + + +if __name__ == "__main__": + unittest.main() From 2ab7fe4d8f1e70f6f5137d4cf560c9a5fec03e36 Mon Sep 17 00:00:00 2001 From: Vincent Favre-Nicolin Date: Wed, 12 Aug 2026 23:26:02 +0200 Subject: [PATCH 02/21] Update version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index bc809f9d..f5dfd5fc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ name = "pyobjcryst" # setuptools.build_meta; scikit-build-core needs a different dynamic-version # provider to match that exactly. Pinned as a static placeholder for now -- # revisit before release, see nanobind_migration_notes.md. -version = "2024.2.1.dev0" +version = "2026.2.1.dev0" authors = [ { name="Christopher Farrow" }, { name="Pavol Juhás" }, From 117cb30a86dc64d0cb455cf85b53d3b269b61e65 Mon Sep 17 00:00:00 2001 From: Vincent Favre-Nicolin Date: Tue, 1 Sep 2026 14:31:32 +0200 Subject: [PATCH 03/21] feat: update objcryst submodule and expose new features (PRs #107,#109,#112,#113,#114,#115,#116) - Update extern/objcryst submodule to origin/master (30fc8df), adding: GetRwHistory, minRwpVar, ReflectionProfilePseudoVoigtTCH, PowderPatternBackgroundHist, fixed aniso PV constructor, etc. - nb_lsq.cpp: Add GetVarianceCovarianceMap() (dict keyed by name tuples), GetRwHistory() (list of Rw fractions per cycle), minRwpVar arg to Refine/SafeRefine, verbose overload for PrepareRefParList, fix SafeRefine to pass maxChi2factor in correct position - nb_reflectionprofile.cpp: Expose concrete ReflectionProfilePseudoVoigt, ReflectionProfilePseudoVoigtTCH (8-arg SetProfilePar), and ReflectionProfilePseudoVoigtAnisotropic; add IsAnisotropic() to base - nb_powderpatterndiffraction.cpp: Add X2XCorrPhase() method and SetProfile() (installs a copy of a given ReflectionProfile) - nb_crystal.cpp: Fix pre-existing build error: replace nb::detail::keep_alive (non-existent in nanobind 3.x) with nb::keep_alive<1,2>() annotation - CMakeLists.txt: Add homebrew include paths for Boost headers on macOS - src/pyobjcryst/reflectionprofile.py: Export new concrete profile classes - tests: Port new tests for all features from main branch and open PRs Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- CMakeLists.txt | 13 ++ extern/objcryst | 2 +- news/expose-aniso-pv.rst | 2 + news/fix-erase-all-param-set.rst | 2 +- news/get_variance_covariance_map.rst | 2 +- news/prepareparlist-silent.rst | 23 ++ news/rw_history.rst | 23 ++ news/rwp-tol-refine.rst | 23 ++ news/tch-pv-profile.rst | 23 ++ news/x2xcorrphase-public.rst | 2 +- src/extensions/nb_crystal.cpp | 9 +- src/extensions/nb_lsq.cpp | 51 +++- .../nb_powderpatterndiffraction.cpp | 9 + src/extensions/nb_reflectionprofile.cpp | 64 ++++++ src/pyobjcryst/reflectionprofile.py | 27 ++- tests/test_lsq.py | 60 +++++ tests/test_powderpattern.py | 31 +++ tests/test_reflectionprofile.py | 217 +++++++++--------- 18 files changed, 451 insertions(+), 132 deletions(-) create mode 100644 news/prepareparlist-silent.rst create mode 100644 news/rw_history.rst create mode 100644 news/rwp-tol-refine.rst create mode 100644 news/tch-pv-profile.rst diff --git a/CMakeLists.txt b/CMakeLists.txt index f1be3e7b..84216445 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -96,6 +96,19 @@ target_include_directories(cctbx PUBLIC if(DEFINED ENV{CONDA_PREFIX}) target_include_directories(cctbx PUBLIC "$ENV{CONDA_PREFIX}/include") endif() +# Homebrew (Apple Silicon / Intel) +if(EXISTS "/opt/homebrew/include") + target_include_directories(cctbx PUBLIC "/opt/homebrew/include") +endif() +if(EXISTS "/usr/local/include") + target_include_directories(cctbx PUBLIC "/usr/local/include") +endif() +# Honour an explicit Boost_ROOT / BOOST_ROOT from the environment or cmake args +if(DEFINED Boost_INCLUDE_DIR) + target_include_directories(cctbx PUBLIC "${Boost_INCLUDE_DIR}") +elseif(DEFINED ENV{BOOST_ROOT}) + target_include_directories(cctbx PUBLIC "$ENV{BOOST_ROOT}/include") +endif() set_property(TARGET cctbx PROPERTY POSITION_INDEPENDENT_CODE ON) # --------------------------------------------------------------------------- diff --git a/extern/objcryst b/extern/objcryst index bfdcfda6..30fc8df2 160000 --- a/extern/objcryst +++ b/extern/objcryst @@ -1 +1 @@ -Subproject commit bfdcfda67db8c91af0c1b801fe988e90cbb79246 +Subproject commit 30fc8df2db6c42480e21ec07edef2deea7d5e3ef diff --git a/news/expose-aniso-pv.rst b/news/expose-aniso-pv.rst index 9e3f0992..7363c052 100644 --- a/news/expose-aniso-pv.rst +++ b/news/expose-aniso-pv.rst @@ -3,6 +3,8 @@ * Add explicitly constructable reflection profiles * Expose objcryst's anisotropic Pseudo-Voigt profile * Add PowderPatternDiffraction.SetProfile +* Expose reflection profile ``ReflectionProfilePseudoVoigt`` and ``ReflectionProfilePseudoVoigtAnisotropic`` as constructible Python classes. +* Add ``IsAnisotropic()`` method to ``ReflectionProfile``. **Changed:** diff --git a/news/fix-erase-all-param-set.rst b/news/fix-erase-all-param-set.rst index b3e4c6c8..48ec5736 100644 --- a/news/fix-erase-all-param-set.rst +++ b/news/fix-erase-all-param-set.rst @@ -16,7 +16,7 @@ **Fixed:** -* Fix EraseAllParamSet binding for compiled RefinableObj +* Fix ``EraseAllParamSet`` on compiled ``RefinableObj`` (from ``LSQ.GetCompiledRefinedObj()``). **Security:** diff --git a/news/get_variance_covariance_map.rst b/news/get_variance_covariance_map.rst index 5e9db10f..b8c3b92b 100644 --- a/news/get_variance_covariance_map.rst +++ b/news/get_variance_covariance_map.rst @@ -1,6 +1,6 @@ **Added:** -* Expose ``lsq.GetVarianceCovarianceMap()`` for covariance between refined parameters +* Add ``lsq.GetVarianceCovarianceMap()`` to get the variance-covariance matrix as a dict keyed by ``(param_name, param_name)`` tuples. **Changed:** diff --git a/news/prepareparlist-silent.rst b/news/prepareparlist-silent.rst new file mode 100644 index 00000000..e78a6c04 --- /dev/null +++ b/news/prepareparlist-silent.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* Make ``LSQ.PrepareRefParList()`` silent by default and add a ``verbose`` argument to control warnings about duplicate parameter names. + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* diff --git a/news/rw_history.rst b/news/rw_history.rst new file mode 100644 index 00000000..a348487b --- /dev/null +++ b/news/rw_history.rst @@ -0,0 +1,23 @@ +**Added:** + +* Add method ``GetRwHistory`` on LSQ object to get history of Rw values through one run of ``lsq.Refine()``. + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* diff --git a/news/rwp-tol-refine.rst b/news/rwp-tol-refine.rst new file mode 100644 index 00000000..b000d8d2 --- /dev/null +++ b/news/rwp-tol-refine.rst @@ -0,0 +1,23 @@ +**Added:** + +* Add Rwp threshold ``minRwpVar`` for ``lsq.Refine()`` and ``lsq.SafeRefine()``. + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* diff --git a/news/tch-pv-profile.rst b/news/tch-pv-profile.rst new file mode 100644 index 00000000..81fd4b2e --- /dev/null +++ b/news/tch-pv-profile.rst @@ -0,0 +1,23 @@ +**Added:** + +* Expose reflection profile ``ReflectionProfilePseudoVoigtTCH`` with TCH instead of explicit Eta mixing. + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* diff --git a/news/x2xcorrphase-public.rst b/news/x2xcorrphase-public.rst index 45ccd5d7..c0443ec7 100644 --- a/news/x2xcorrphase-public.rst +++ b/news/x2xcorrphase-public.rst @@ -1,6 +1,6 @@ **Added:** -* Expose PowderPatternDiffraction.X2XCorrPhase +* Expose ``PowderPatternDiffraction.X2XCorrPhase()`` for per-phase flat-detector displacement correction. **Changed:** diff --git a/src/extensions/nb_crystal.cpp b/src/extensions/nb_crystal.cpp index 67a7b23f..74e961c0 100644 --- a/src/extensions/nb_crystal.cpp +++ b/src/extensions/nb_crystal.cpp @@ -245,14 +245,9 @@ void wrap_crystal(nb::module_& m) nb::arg("alpha"), nb::arg("beta"), nb::arg("gamma"), nb::arg("SpaceGroupId")) .def("AddScatterer", - [](nb::handle crystal_h, nb::handle obj) { - Crystal& crystal = nb::cast(crystal_h); + [](Crystal& crystal, nb::object obj) { _AddScatterer(crystal, obj); - // Keep scatterer alive as long as crystal is alive (but not for None) - if (!obj.is_none()) { - nb::detail::keep_alive(crystal_h.ptr(), obj.ptr()); - } - }, nb::arg("arg").none()) + }, nb::arg("arg").none(), nb::keep_alive<1,2>()) .def("RemoveScatterer", &_RemoveScatterer, nb::arg("arg").none()) .def("GetNbScatterer", &Crystal::GetNbScatterer) .def("GetScatt", diff --git a/src/extensions/nb_lsq.cpp b/src/extensions/nb_lsq.cpp index 84182a65..2535b18d 100644 --- a/src/extensions/nb_lsq.cpp +++ b/src/extensions/nb_lsq.cpp @@ -4,6 +4,11 @@ #include #include +#include + +#include +#include +#include #include #include @@ -17,14 +22,35 @@ namespace { bool _SafeRefine(LSQNumObj& lsq, REAL maxChi2factor, int nbCycle, bool useLevenbergMarquardt, const bool silent, - const bool callBeginEndOptimization, const float minChi2var) + const bool callBeginEndOptimization, const float minChi2var, + const float minRwpVar) { CaptureStdOut gag; if (!silent) gag.release(); std::list vnewpar; std::list vnewpartype; - return lsq.SafeRefine(vnewpar, vnewpartype, nbCycle, useLevenbergMarquardt, - silent, callBeginEndOptimization, minChi2var); + return lsq.SafeRefine(vnewpar, vnewpartype, maxChi2factor, nbCycle, + useLevenbergMarquardt, silent, + callBeginEndOptimization, minChi2var, minRwpVar); +} + +nb::dict _GetVarianceCovarianceMap(LSQNumObj& lsq) +{ + const std::map, REAL>& m = + lsq.GetVarianceCovarianceMap(); + nb::dict d; + for (auto& kv : m) { + const RefinablePar* pi = kv.first.first; + const RefinablePar* pj = kv.first.second; + d[nb::make_tuple(pi->GetName(), pj->GetName())] = kv.second; + } + return d; +} + +std::list _GetRwHistory(const LSQNumObj& lsq) +{ + const std::vector& h = lsq.GetRwHistory(); + return std::list(h.begin(), h.end()); } // LSQNumObj::SetRefinedObj(RefinableObj&, ...) generically accepts "any @@ -59,16 +85,20 @@ void wrap_lsq(nb::module_& m) nb::arg("useLevenbergMarquardt") = false, nb::arg("silent") = false, nb::arg("callBeginEndOptimization") = true, - nb::arg("minChi2var") = 0.01f) + nb::arg("minChi2var") = 0.01f, + nb::arg("minRwpVar") = -1.0f) .def("SafeRefine", &_SafeRefine, nb::arg("maxChi2factor") = 1.01, nb::arg("nbCycle") = 1, nb::arg("useLevenbergMarquardt") = false, nb::arg("silent") = false, nb::arg("callBeginEndOptimization") = true, - nb::arg("minChi2var") = 0.01f) + nb::arg("minChi2var") = 0.01f, + nb::arg("minRwpVar") = -1.0f) .def("Rfactor", &LSQNumObj::Rfactor) .def("RwFactor", &LSQNumObj::RwFactor) + .def("GetRwHistory", &_GetRwHistory, + "Return the per-cycle Rw history from the last Refine() call (as a list of fractions).") .def("ChiSquare", &LSQNumObj::ChiSquare) .def("SetRefinedObj", &_SetRefinedObj, nb::arg("obj"), nb::arg("LSQFuncIndex") = 0, @@ -78,8 +108,17 @@ void wrap_lsq(nb::module_& m) nb::overload_cast<>(&LSQNumObj::GetCompiledRefinedObj), nb::rv_policy::reference_internal) .def("PrintRefResults", &LSQNumObj::PrintRefResults) - .def("PrepareRefParList",&LSQNumObj::PrepareRefParList, + .def("PrepareRefParList", + nb::overload_cast(&LSQNumObj::PrepareRefParList), nb::arg("copy_param") = false) + .def("PrepareRefParList", + nb::overload_cast(&LSQNumObj::PrepareRefParList), + nb::arg("copy_param") = false, + nb::arg("verbose") = false, + "Prepare the compiled parameter list. Set verbose=True to " + "show warnings emitted while resolving duplicate names.") + .def("GetVarianceCovarianceMap", &_GetVarianceCovarianceMap, + "Return the variance-covariance matrix as a dict keyed by (param_name, param_name) tuples.") .def("GetLSQCalc", [](LSQNumObj& obj){ return crystvec_to_array(obj.GetLSQCalc()); }) .def("GetLSQObs", diff --git a/src/extensions/nb_powderpatterndiffraction.cpp b/src/extensions/nb_powderpatterndiffraction.cpp index 460a4fe8..92df37c0 100644 --- a/src/extensions/nb_powderpatterndiffraction.cpp +++ b/src/extensions/nb_powderpatterndiffraction.cpp @@ -10,6 +10,7 @@ #undef B0 #include #include +#include #include #include "helpers_nb.hpp" @@ -70,6 +71,12 @@ void wrap_powderpatterndiffraction(nb::module_& m) .def("GetProfile", nb::overload_cast<>(&PowderPatternDiffraction::GetProfile), nb::rv_policy::reference_internal) + .def("SetProfile", + [](PowderPatternDiffraction& d, ReflectionProfile& p) { + d.SetProfile(p.CreateCopy()); + }, + nb::arg("profile"), + "Install an independent copy of the given profile.") .def("SetExtractionMode", &PowderPatternDiffraction::SetExtractionMode, nb::arg("extract") = true, nb::arg("init") = false) @@ -85,5 +92,7 @@ void wrap_powderpatterndiffraction(nb::module_& m) &PowderPatternDiffraction::GetNbReflBelowMaxSinThetaOvLambda) .def("GetFhklObsSq", [](PowderPatternDiffraction& d){ return crystvec_to_array(d.GetFhklObsSq()); }) + .def("X2XCorrPhase", &PowderPatternDiffraction::X2XCorrPhase, + "Apply the flat-detector displacement correction for this phase's offset.") ; } diff --git a/src/extensions/nb_reflectionprofile.cpp b/src/extensions/nb_reflectionprofile.cpp index 6952c2be..14e442f4 100644 --- a/src/extensions/nb_reflectionprofile.cpp +++ b/src/extensions/nb_reflectionprofile.cpp @@ -91,7 +91,71 @@ void wrap_reflectionprofile(nb::module_& m) &ReflectionProfile::GetFullProfileWidth), nb::arg("relativeIntensity"), nb::arg("xcenter"), nb::arg("h"), nb::arg("k"), nb::arg("l")) + .def("IsAnisotropic", &ReflectionProfile::IsAnisotropic, + "Return whether the profile depends on the reflection indices.") .def("XMLOutput", &_XMLOutput, nb::arg("file"), nb::arg("indent") = 0) .def("XMLInput", &_XMLInput, nb::arg("file"), nb::arg("tag")) ; + + nb::class_( + m, "ReflectionProfilePseudoVoigt") + .def(nb::init<>()) + .def(nb::init(), nb::arg("old")) + .def("CreateCopy", &ReflectionProfilePseudoVoigt::CreateCopy, + nb::rv_policy::take_ownership, + "Return an independent copy of this profile.") + .def("SetProfilePar", &ReflectionProfilePseudoVoigt::SetProfilePar, + nb::arg("fwhmCagliotiW"), nb::arg("fwhmCagliotiU") = 0.0, + nb::arg("fwhmCagliotiV") = 0.0, nb::arg("eta0") = 0.5, + nb::arg("eta1") = 0.0, + "Set the isotropic pseudo-Voigt profile parameters.") + ; + + nb::class_( + m, "ReflectionProfilePseudoVoigtTCH") + .def(nb::init<>()) + .def(nb::init(), nb::arg("old")) + .def("CreateCopy", &ReflectionProfilePseudoVoigtTCH::CreateCopy, + nb::rv_policy::take_ownership, + "Return an independent copy of this profile.") + .def("SetProfilePar", + nb::overload_cast( + &ReflectionProfilePseudoVoigtTCH::SetProfilePar), + nb::arg("fwhmCagliotiW"), nb::arg("fwhmCagliotiU") = 0.0, + nb::arg("fwhmCagliotiV") = 0.0, + nb::arg("fwhmLorentzX") = 0.0, + nb::arg("fwhmLorentzY") = 0.0, + nb::arg("fwhmLorentzZ") = 0.0, + nb::arg("fwhmScherrerP") = 0.0, + nb::arg("scherrerLGmix") = 1.0, + "Set the TCH pseudo-Voigt U, V, W, X, Y, Z, P and LGmix parameters.") + ; + + nb::class_( + m, "ReflectionProfilePseudoVoigtAnisotropic") + .def(nb::init<>()) + .def(nb::init(), nb::arg("old")) + .def("CreateCopy", &ReflectionProfilePseudoVoigtAnisotropic::CreateCopy, + nb::rv_policy::take_ownership, + "Return an independent copy of this profile.") + .def("SetProfilePar", + &ReflectionProfilePseudoVoigtAnisotropic::SetProfilePar, + nb::arg("fwhmCagliotiW"), nb::arg("fwhmCagliotiU") = 0.0, + nb::arg("fwhmCagliotiV") = 0.0, nb::arg("fwhmGaussP") = 0.0, + nb::arg("fwhmLorentzX") = 0.0, + nb::arg("fwhmLorentzY") = 0.0, + nb::arg("fwhmLorentzGammaHH") = 0.0, + nb::arg("fwhmLorentzGammaKK") = 0.0, + nb::arg("fwhmLorentzGammaLL") = 0.0, + nb::arg("fwhmLorentzGammaHK") = 0.0, + nb::arg("fwhmLorentzGammaHL") = 0.0, + nb::arg("fwhmLorentzGammaKL") = 0.0, + nb::arg("pseudoVoigtEta0") = 0.0, + nb::arg("pseudoVoigtEta1") = 0.0, + nb::arg("asymA0") = 1.0, nb::arg("asymA1") = 0.0, + nb::arg("asymA2") = 0.0, + "Set the anisotropic pseudo-Voigt profile parameters.") + ; } diff --git a/src/pyobjcryst/reflectionprofile.py b/src/pyobjcryst/reflectionprofile.py index c88f4b69..c3d9d3b7 100644 --- a/src/pyobjcryst/reflectionprofile.py +++ b/src/pyobjcryst/reflectionprofile.py @@ -20,21 +20,28 @@ ``XMLOutput`` / ``XMLInput`` and ``CreateCopy``. ``GetProfile`` accepts a Python sequence or numpy array for ``x``. -Concrete isotropic and anisotropic pseudo-Voigt profiles can be installed -with ``PowderPatternDiffraction.SetProfile``. The diffraction component -stores an independent copy, so one configured profile can be reused as a -template for multiple phases:: +Concrete empirical isotropic, TCH isotropic, and anisotropic pseudo-Voigt +profiles can be installed with ``PowderPatternDiffraction.SetProfile``. The +diffraction component stores an independent copy, so one configured profile +can be reused as a template for multiple phases:: from pyobjcryst.reflectionprofile import ( + ReflectionProfilePseudoVoigt, + ReflectionProfilePseudoVoigtTCH, ReflectionProfilePseudoVoigtAnisotropic, ) - profile = ReflectionProfilePseudoVoigtAnisotropic() - profile.GetPar("W").SetValue(1e-6) - profile.GetPar("G_HH").SetValue(2e-6) + iso = ReflectionProfilePseudoVoigt() + iso.SetProfilePar(fwhmCagliotiW=1e-4, eta0=0.5) + ppd.SetProfile(iso) - for pdiff in powder_pattern.get_crystalline_components(): - pdiff.SetProfile(profile) + tch = ReflectionProfilePseudoVoigtTCH() + tch.SetProfilePar(fwhmCagliotiW=1e-4, fwhmLorentzZ=2e-4) + ppd2.SetProfile(tch) + + aniso = ReflectionProfilePseudoVoigtAnisotropic() + aniso.SetProfilePar(fwhmCagliotiW=1e-4) + ppd3.SetProfile(aniso) Example ------- @@ -67,6 +74,7 @@ __all__ = [ "ReflectionProfile", "ReflectionProfilePseudoVoigt", + "ReflectionProfilePseudoVoigtTCH", "ReflectionProfilePseudoVoigtAnisotropic", "ReflectionProfileType", ] @@ -75,5 +83,6 @@ ReflectionProfile, ReflectionProfilePseudoVoigt, ReflectionProfilePseudoVoigtAnisotropic, + ReflectionProfilePseudoVoigtTCH, ReflectionProfileType, ) diff --git a/tests/test_lsq.py b/tests/test_lsq.py index 82624b7b..0618d83b 100644 --- a/tests/test_lsq.py +++ b/tests/test_lsq.py @@ -93,6 +93,66 @@ def test_lsq_refine(self): self.c.RandomizeConfiguration() lsq.Refine(10, False, True) + def test_lsq_compiled_refined_obj_erase_all_param_set(self): + """Check parameter sets can be erased on compiled refined objects.""" + lsq = LSQ() + lsq.SetRefinedObj(self.d, 0, True, True) + lsq.PrepareRefParList() + refobj = lsq.GetCompiledRefinedObj() + save = refobj.CreateParamSet("save") + refobj.EraseAllParamSet() + self.assertRaises(ObjCrystException, refobj.SaveParamSet, save) + + def test_lsq_get_variance_covariance_map(self): + """GetVarianceCovarianceMap returns a dict keyed by (name, name) tuples.""" + lsq = LSQ() + lsq.SetRefinedObj(self.d, 0, True, True) + lsq.PrepareRefParList() + lsq.SetParIsFixed(refinableobj.refpartype_objcryst, True) + lsq.SetParIsFixed(refinableobj.refpartype_scattdata_scale, False) + lsq.Refine(1, silent=True) + cov = lsq.GetVarianceCovarianceMap() + self.assertIsInstance(cov, dict) + for key in cov: + self.assertIsInstance(key, tuple) + self.assertEqual(len(key), 2) + self.assertIsInstance(key[0], str) + self.assertIsInstance(key[1], str) + + def test_lsq_get_rw_history(self): + """GetRwHistory returns a list of floats after Refine().""" + lsq = LSQ() + lsq.SetRefinedObj(self.d, 0, True, True) + lsq.PrepareRefParList() + lsq.SetParIsFixed(refinableobj.refpartype_objcryst, True) + lsq.SetParIsFixed(refinableobj.refpartype_scattdata_scale, False) + history_before = lsq.GetRwHistory() + self.assertEqual(list(history_before), []) + lsq.Refine(3, silent=True) + history = lsq.GetRwHistory() + self.assertIsInstance(history, list) + self.assertGreater(len(history), 0) + for v in history: + self.assertIsInstance(v, float) + self.assertGreaterEqual(v, 0.0) + + def test_lsq_refine_minrwpvar(self): + """minRwpVar argument is accepted by Refine without error.""" + lsq = LSQ() + lsq.SetRefinedObj(self.d, 0, True, True) + lsq.PrepareRefParList() + lsq.SetParIsFixed(refinableobj.refpartype_objcryst, True) + lsq.SetParIsFixed(refinableobj.refpartype_scattdata_scale, False) + lsq.Refine(5, silent=True, minRwpVar=0.01) + + def test_lsq_prepare_ref_par_list_verbose(self): + """PrepareRefParList accepts a verbose keyword argument.""" + lsq = LSQ() + lsq.SetRefinedObj(self.d, 0, True, True) + lsq.PrepareRefParList(verbose=False) + lsq.PrepareRefParList(copy_param=False, verbose=True) + if __name__ == "__main__": unittest.main() + diff --git a/tests/test_powderpattern.py b/tests/test_powderpattern.py index 4cb37db9..507734f5 100644 --- a/tests/test_powderpattern.py +++ b/tests/test_powderpattern.py @@ -461,6 +461,37 @@ def test_refinableobj_forwarding(self): self.assertEqual(0.0, self.diff.GetLogLikelihood()) self.diff.UpdateDisplay() + def test_X2XCorrPhase_flat_detector_displacement(self): + """X2XCorrPhase returns the corrected 2theta for a flat-detector + displacement offset on this phase.""" + pp = PowderPattern() + pp.SetWavelength(1.54056) + pp.SetPowderPatternPar(np.deg2rad(5), np.deg2rad(0.1), 851) + crystal = makeCrystal(*makeScatterer()) + pdiff = pp.AddPowderPatternDiffraction(crystal) + + x = np.deg2rad(30) + self.assertAlmostEqual(pdiff.X2XCorrPhase(x), x) + + phase_ratio = 1e-4 + pdiff.GetPar("2ThetaFlatDetDispRatioPhase").SetValue(phase_ratio) + expected = x + np.arctan( + phase_ratio + * np.sin(2 * x) + / (2 - 2 * phase_ratio * np.sin(x) ** 2) + ) + self.assertAlmostEqual(pdiff.X2XCorrPhase(x), expected) + + pattern_ratio = 2e-4 + pp.GetPar("2ThetaFlatDetDispRatio").SetValue(pattern_ratio) + total_ratio = phase_ratio + pattern_ratio + expected = x + np.arctan( + total_ratio + * np.sin(2 * x) + / (2 - 2 * total_ratio * np.sin(x) ** 2) + ) + self.assertAlmostEqual(pdiff.X2XCorrPhase(x), expected) + # End of class TestPowderPatternDiffraction diff --git a/tests/test_reflectionprofile.py b/tests/test_reflectionprofile.py index c304e44f..f4cfc489 100644 --- a/tests/test_reflectionprofile.py +++ b/tests/test_reflectionprofile.py @@ -8,9 +8,9 @@ from pyobjcryst.powderpattern import PowderPattern from pyobjcryst.refinableobj import RefinableObj from pyobjcryst.reflectionprofile import ( - ReflectionProfile, ReflectionProfilePseudoVoigt, ReflectionProfilePseudoVoigtAnisotropic, + ReflectionProfilePseudoVoigtTCH, ) @@ -24,120 +24,17 @@ def prepare_fixture(self, loadcifdata): def setUp(self): """Set up a ReflectionProfile instance for testing.""" x = np.linspace(0, 40, 1000) - self.crystal = self.loadcifdata("paracetamol.cif") + c = self.loadcifdata("paracetamol.cif") self.pp = PowderPattern() self.pp.SetWavelength(0.7) self.pp.SetPowderPatternX(np.deg2rad(x)) self.pp.SetPowderPatternObs(np.ones_like(x)) - self.ppd = self.pp.AddPowderPatternDiffraction(self.crystal) + self.ppd = self.pp.AddPowderPatternDiffraction(c) self.profile = self.ppd.GetProfile() - def test_concrete_pseudo_voigt_profiles(self): - """Concrete isotropic and anisotropic profiles are - constructible.""" - isotropic = ReflectionProfilePseudoVoigt() - anisotropic = ReflectionProfilePseudoVoigtAnisotropic() - - self.assertIsInstance(isotropic, ReflectionProfile) - self.assertIsInstance(anisotropic, ReflectionProfile) - self.assertFalse(isotropic.IsAnisotropic()) - self.assertTrue(anisotropic.IsAnisotropic()) - - expected = { - "U", - "V", - "W", - "P", - "X", - "Y", - "G_HH", - "G_KK", - "G_LL", - "G_HK", - "G_HL", - "G_KL", - "Eta0", - "Eta1", - "Asym0", - "Asym1", - "Asym2", - } - self.assertEqual( - expected, - { - anisotropic.GetPar(i).GetName() - for i in range(anisotropic.GetNbPar()) - }, - ) - - def test_anisotropic_set_profile_par(self): - """SetProfilePar assigns widths and retains symmetric default - asymmetry.""" - profile = ReflectionProfilePseudoVoigtAnisotropic() - profile.SetProfilePar(1e-6, fwhmLorentzX=2e-6) - profile.GetPar("P").SetValue(3e-6) - - self.assertAlmostEqual(profile.GetPar("W").GetValue(), 1e-6) - self.assertAlmostEqual(profile.GetPar("X").GetValue(), 2e-6) - self.assertAlmostEqual(profile.GetPar("P").GetValue(), 3e-6) - self.assertAlmostEqual(profile.GetPar("Asym0").GetValue(), 1.0) - - def test_anisotropic_profile_depends_on_hkl(self): - """Anisotropic Lorentz coefficients produce direction - dependence.""" - profile = ReflectionProfilePseudoVoigtAnisotropic() - profile.SetProfilePar( - 1e-6, - fwhmLorentzGammaHH=1e-3, - fwhmLorentzGammaKK=2e-3, - pseudoVoigtEta0=1, - ) - center = 0.5 - x = np.linspace(center - 0.1, center + 0.1, 401) - - h00 = profile.GetProfile(x, center, 1, 0, 0) - zero_k0 = profile.GetProfile(x, center, 0, 1, 0) - - self.assertFalse(np.allclose(h00, zero_k0)) - - def test_set_profile_copies_reusable_template(self): - """One profile template can safely initialize multiple - phases.""" - second = self.pp.AddPowderPatternDiffraction(self.crystal) - template = ReflectionProfilePseudoVoigtAnisotropic() - template.GetPar("W").SetValue(1e-6) - template.GetPar("G_HH").SetValue(2e-6) - - for pdiff in (self.ppd, second): - pdiff.SetProfile(template) - - first_profile = self.ppd.GetProfile() - second_profile = second.GetProfile() - self.assertIsInstance( - first_profile, ReflectionProfilePseudoVoigtAnisotropic - ) - self.assertIsInstance( - second_profile, ReflectionProfilePseudoVoigtAnisotropic - ) - self.assertAlmostEqual(first_profile.GetPar("W").GetValue(), 1e-6) - self.assertAlmostEqual(second_profile.GetPar("G_HH").GetValue(), 2e-6) - - first_profile.GetPar("W").SetValue(3e-6) - self.assertAlmostEqual(template.GetPar("W").GetValue(), 1e-6) - self.assertAlmostEqual(second_profile.GetPar("W").GetValue(), 1e-6) - - def test_set_profile_accepts_temporary(self): - """A temporary concrete profile is safely copied into the - phase.""" - self.ppd.SetProfile(ReflectionProfilePseudoVoigt()) - profile = self.ppd.GetProfile() - - self.assertIsInstance(profile, ReflectionProfilePseudoVoigt) - self.assertFalse(profile.IsAnisotropic()) - def test_get_computed_profile(self): """Sample a profile slice and verify broadening lowers the peak height.""" @@ -224,6 +121,114 @@ def test_xml_output(self): xml_from_stream = buf.getvalue() self.assertTrue(xml_from_stream.startswith(" Date: Tue, 3 Nov 2026 09:06:13 +0100 Subject: [PATCH 04/21] chore: allow Python 3.15, set 2026.2.0rc0 and use PyPI libboost-headers - pyproject: requires-python <3.16, add 3.15 classifier, version 2026.2.0rc0, add libboost-headers to build requirements. - CMake: locate Boost headers from the libboost-headers Python package, else BOOST_INCLUDE_DIR or system/conda headers; drop hardcoded include paths. - requirements/conda.txt: drop libboost-python and libobjcryst, add compilers. - requirements/pip.txt: add libboost-headers. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- CMakeLists.txt | 52 ++++++++++++++++++++++--------------- README.rst | 6 ++--- cookiecutter.json | 2 +- nanobind_migration_notes.md | 4 +-- news/nanobind-packaging.rst | 24 +++++++++++++++++ pyproject.toml | 7 ++--- requirements/conda.txt | 3 +-- requirements/pip.txt | 1 + 8 files changed, 67 insertions(+), 32 deletions(-) create mode 100644 news/nanobind-packaging.rst diff --git a/CMakeLists.txt b/CMakeLists.txt index 84216445..26b23b87 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,8 +22,34 @@ find_package(nanobind CONFIG REQUIRED) # --------------------------------------------------------------------------- # Boost (header-only: format, rational, date_time used by ObjCryst sources) -# --------------------------------------------------------------------------- -find_package(Boost REQUIRED) +# Priority: explicit BOOST_INCLUDE_DIR, then the PyPI `libboost-headers` +# package (used for isolated pip builds), then system/conda headers. +# --------------------------------------------------------------------------- +if(BOOST_INCLUDE_DIR) + set(PYOBJCRYST_BOOST_INCLUDE_DIR "${BOOST_INCLUDE_DIR}") +else() + execute_process( + COMMAND "${Python_EXECUTABLE}" -c + "import importlib.util, os; s = importlib.util.find_spec('libboost_headers'); print(os.path.join(s.submodule_search_locations[0], 'include') if s else '')" + OUTPUT_VARIABLE _PYPI_BOOST_INCLUDE_DIR + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_QUIET + ) + if(_PYPI_BOOST_INCLUDE_DIR AND EXISTS "${_PYPI_BOOST_INCLUDE_DIR}/boost/rational.hpp") + set(PYOBJCRYST_BOOST_INCLUDE_DIR "${_PYPI_BOOST_INCLUDE_DIR}") + else() + find_path(BOOST_SYSTEM_INCLUDE_DIR boost/rational.hpp + HINTS "$ENV{BOOST_ROOT}/include" "$ENV{Boost_ROOT}/include" "$ENV{CONDA_PREFIX}/include" + ) + if(NOT BOOST_SYSTEM_INCLUDE_DIR) + message(FATAL_ERROR + "Boost headers not found. Install them with `pip install libboost-headers`, " + "`conda install -c conda-forge libboost-headers`, or set -DBOOST_INCLUDE_DIR=.") + endif() + set(PYOBJCRYST_BOOST_INCLUDE_DIR "${BOOST_SYSTEM_INCLUDE_DIR}") + endif() +endif() +message(STATUS "Using Boost headers from: ${PYOBJCRYST_BOOST_INCLUDE_DIR}") # --------------------------------------------------------------------------- # External source paths @@ -91,24 +117,8 @@ add_library(cctbx STATIC ${CCTBX_SOURCES}) target_include_directories(cctbx PUBLIC "${CCTBX_SRC}/include" "${Python_ROOT_DIR}/include" + "${PYOBJCRYST_BOOST_INCLUDE_DIR}" ) -# Add conda/system boost headers if available -if(DEFINED ENV{CONDA_PREFIX}) - target_include_directories(cctbx PUBLIC "$ENV{CONDA_PREFIX}/include") -endif() -# Homebrew (Apple Silicon / Intel) -if(EXISTS "/opt/homebrew/include") - target_include_directories(cctbx PUBLIC "/opt/homebrew/include") -endif() -if(EXISTS "/usr/local/include") - target_include_directories(cctbx PUBLIC "/usr/local/include") -endif() -# Honour an explicit Boost_ROOT / BOOST_ROOT from the environment or cmake args -if(DEFINED Boost_INCLUDE_DIR) - target_include_directories(cctbx PUBLIC "${Boost_INCLUDE_DIR}") -elseif(DEFINED ENV{BOOST_ROOT}) - target_include_directories(cctbx PUBLIC "$ENV{BOOST_ROOT}/include") -endif() set_property(TARGET cctbx PROPERTY POSITION_INDEPENDENT_CODE ON) # --------------------------------------------------------------------------- @@ -131,7 +141,7 @@ target_include_directories(ObjCryst PUBLIC "${CCTBX_SRC}/include" "${CMAKE_CURRENT_SOURCE_DIR}/extern" "${CMAKE_CURRENT_BINARY_DIR}/include" - ${Boost_INCLUDE_DIRS} + "${PYOBJCRYST_BOOST_INCLUDE_DIR}" ) set_property(TARGET ObjCryst PROPERTY POSITION_INDEPENDENT_CODE ON) target_compile_definitions(ObjCryst PUBLIC @@ -159,7 +169,7 @@ target_include_directories(_pyobjcryst PRIVATE "${CCTBX_SRC}/include" "${CMAKE_CURRENT_SOURCE_DIR}/extern" "${CMAKE_CURRENT_BINARY_DIR}/include" - ${Boost_INCLUDE_DIRS} + "${PYOBJCRYST_BOOST_INCLUDE_DIR}" ${Python_NumPy_INCLUDE_DIRS} "${CMAKE_CURRENT_SOURCE_DIR}/src/extensions" ) diff --git a/README.rst b/README.rst index 9472e39b..ba46399e 100644 --- a/README.rst +++ b/README.rst @@ -74,7 +74,7 @@ The second paper describes the c++ crystallographic objects in Installation ------------ -The latest release of ``pyobjcryst`` runs in python versions 3.12, 3.13 and 3.14. You may +The latest release of ``pyobjcryst`` runs in python versions 3.12, 3.13, 3.14 and 3.15. You may specify an earlier release if you need it to run in an earlier version of Python. The preferred method is to use `Miniconda Python @@ -132,9 +132,9 @@ You can use ``pip`` to download and install the latest release from Pyobjcryst can be installed from pip. We recommend installing the dependencies that can be found in ``requirements/conda.txt`` from conda-forge, e.g., :: - conda create -n pyobjcryst-env python=3.14 + conda create -n pyobjcryst-env python=3.15 conda activate pyobjcryst-env - conda install -c conda-forge numpy libobjcryst libboost-devel libboost-python packaging ipywidgets matplotlib-base ipympl py3dmol + conda install -c conda-forge numpy compilers libboost-devel packaging ipywidgets matplotlib-base ipympl py3dmol pip install pyobjcryst If you prefer to install from sources, after installing the dependencies, obtain the source archive from diff --git a/cookiecutter.json b/cookiecutter.json index 96b6a37b..33685bc4 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -14,7 +14,7 @@ "project_short_description": "Python bindings to the ObjCryst++ library.", "project_keywords": "objcryst, atom structure crystallography, powder diffraction", "minimum_supported_python_version": "3.12", - "maximum_supported_python_version": "3.14", + "maximum_supported_python_version": "3.15", "project_needs_c_code_compiled": "Yes", "project_has_gui_tests": "No" } diff --git a/nanobind_migration_notes.md b/nanobind_migration_notes.md index c289e4c1..d055205e 100644 --- a/nanobind_migration_notes.md +++ b/nanobind_migration_notes.md @@ -44,7 +44,7 @@ Known, accepted gaps — real, not oversights, but still open: - **Cross-platform**: everything above has been built and tested on Linux only. macOS/Windows are unverified. - **Performance**: not benchmarked against Boost.Python. -- **Versioning**: `pyproject.toml` uses a static placeholder version (`2024.2.1.dev0`) instead of +- **Versioning**: `pyproject.toml` uses a static version (`2026.2.0rc0`) instead of `main`'s dynamic tag-based versioning (`setuptools-git-versioning`) — scikit-build-core needs a different mechanism for that; flagged as a `TODO` in `pyproject.toml` itself, not yet resolved. @@ -121,7 +121,7 @@ works, re-exported from `pyobjcryst._pyobjcryst`. ```bash # Miniforge/mamba, created OUTSIDE the git checkout. Tested with python=3.14. mamba create -n pyobjcryst-nb python=3.14 numpy nanobind scikit-build-core \ - ninja cmake libboost-devel libboost-headers libboost + ninja cmake libboost-headers conda activate pyobjcryst-nb git submodule update --init # fetches extern/objcryst ``` diff --git a/news/nanobind-packaging.rst b/news/nanobind-packaging.rst new file mode 100644 index 00000000..6b7e45e8 --- /dev/null +++ b/news/nanobind-packaging.rst @@ -0,0 +1,24 @@ +**Added:** + +* Support for Python 3.15. + +**Changed:** + +* Boost headers are now taken from the PyPI ``libboost-headers`` package when building with pip, falling back to system/conda Boost headers (or ``-DBOOST_INCLUDE_DIR=``). +* Set package version to ``2026.2.0rc0``. + +**Deprecated:** + +* + +**Removed:** + +* ``libboost-python`` and ``libobjcryst`` from the conda requirements, as they are no longer needed with the nanobind build. + +**Fixed:** + +* + +**Security:** + +* diff --git a/pyproject.toml b/pyproject.toml index f5dfd5fc..ea0624b5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["scikit-build-core>=0.9", "nanobind", "numpy"] +requires = ["scikit-build-core>=0.9", "nanobind", "numpy", "libboost-headers"] build-backend = "scikit_build_core.build" [project] @@ -8,7 +8,7 @@ name = "pyobjcryst" # setuptools.build_meta; scikit-build-core needs a different dynamic-version # provider to match that exactly. Pinned as a static placeholder for now -- # revisit before release, see nanobind_migration_notes.md. -version = "2026.2.1.dev0" +version = "2026.2.0rc0" authors = [ { name="Christopher Farrow" }, { name="Pavol Juhás" }, @@ -21,7 +21,7 @@ maintainers = [ description = "Python bindings to the ObjCryst++ library." keywords = ['objcryst', 'atom structure crystallography', 'powder diffraction'] readme = "README.rst" -requires-python = ">=3.12, <3.15" +requires-python = ">=3.12, <3.16" dependencies = ["numpy"] classifiers = [ 'Development Status :: 5 - Production/Stable', @@ -38,6 +38,7 @@ classifiers = [ 'Programming Language :: Python :: 3.12', 'Programming Language :: Python :: 3.13', 'Programming Language :: Python :: 3.14', + 'Programming Language :: Python :: 3.15', 'Topic :: Scientific/Engineering :: Physics', 'Topic :: Scientific/Engineering :: Chemistry', 'Topic :: Software Development :: Libraries', diff --git a/requirements/conda.txt b/requirements/conda.txt index 476a3204..8e74a22d 100644 --- a/requirements/conda.txt +++ b/requirements/conda.txt @@ -1,7 +1,6 @@ numpy -libobjcryst>=2026.2.0 +compilers libboost-devel -libboost-python packaging # for matplotlib version parsing in powderpattern.py # plotting diff --git a/requirements/pip.txt b/requirements/pip.txt index a85739ed..e1eb2554 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -1,2 +1,3 @@ setuptools numpy +libboost-headers From 7ae3117a2c10b3ca8cdac3e1c03d474dd0d370c9 Mon Sep 17 00:00:00 2001 From: Vincent Favre-Nicolin Date: Tue, 3 Nov 2026 10:39:11 +0100 Subject: [PATCH 05/21] chore: update objcryst submodule to master (ba6ca89) Picks up vincefn/objcryst fixes since 30fc8df: - Invalidate March-Dollase texture cache in SetPhasePar, implement DeletePhase (vincefn/objcryst#105) - Recalculate powder pattern when Radiation changes (vincefn/objcryst#104) - Fix TextureEllipsoid implementation (vincefn/objcryst#103) - Le-Bail: update extracted intensities if number of reflections changed (vincefn/objcryst#99) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- extern/objcryst | 2 +- nanobind_migration_notes.md | 4 ++-- news/nanobind-packaging.rst | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/extern/objcryst b/extern/objcryst index 30fc8df2..ba6ca893 160000 --- a/extern/objcryst +++ b/extern/objcryst @@ -1 +1 @@ -Subproject commit 30fc8df2db6c42480e21ec07edef2deea7d5e3ef +Subproject commit ba6ca893d657fea07760c21a398a6b1b9548cec9 diff --git a/nanobind_migration_notes.md b/nanobind_migration_notes.md index d055205e..ffc2e353 100644 --- a/nanobind_migration_notes.md +++ b/nanobind_migration_notes.md @@ -11,7 +11,7 @@ What's done and verified: nothing there is Boost.Python-specific. - All 45 `nb_*.cpp` binding files (`src/extensions/`) have real implementations covering the same class surface as the old `*_ext.cpp` files, built against `extern/objcryst` - (`vincefn/objcryst@bfdcfda`, vendored as a submodule). + (`vincefn/objcryst@ba6ca89`, vendored as a submodule). - A systematic audit (diffing every Python-exposed name in the old Boost.Python bindings against the nanobind ones) found and fixed every discovered regression, most recently a significant one: `Scatterer`, `ScatteringPower`, `ScatteringData`, and `PowderPatternComponent` (and everything @@ -86,7 +86,7 @@ around that one limitation. [Virtual Inheritance](#virtual-inheritance) covers t ``` pyobjcryst/ ├── extern/ -│ ├── objcryst/ # ObjCryst++ C++ core (git submodule, vincefn/objcryst@bfdcfda) +│ ├── objcryst/ # ObjCryst++ C++ core (git submodule, vincefn/objcryst@ba6ca89) │ ├── newmat/ # matrix library (vendored) │ └── cctbx/ # crystallography utilities (vendored, hand-pared subset) ├── src/ diff --git a/news/nanobind-packaging.rst b/news/nanobind-packaging.rst index 6b7e45e8..6419c7fb 100644 --- a/news/nanobind-packaging.rst +++ b/news/nanobind-packaging.rst @@ -17,7 +17,7 @@ **Fixed:** -* +* Update ObjCryst++ to vincefn/objcryst master (ba6ca89): fix TextureEllipsoid, invalidate March-Dollase cache on phase change, recalculate powder pattern on Radiation change, update Le-Bail extracted intensities when the number of reflections changes. **Security:** From 18e63370ed2330eb8586b8377eead38821cc3e23 Mon Sep 17 00:00:00 2001 From: Vincent Favre-Nicolin Date: Tue, 3 Nov 2026 12:49:38 +0100 Subject: [PATCH 06/21] feat: port March-Dollase texture (#119) and TOF profile (#120) to nanobind (#122) * feat: port March-Dollase texture (#119) and TOF profile (#120) to nanobind - Bind TextureMarchDollase and PowderPatternDiffraction.GetTextureMarchDollase. SetPhasePar is bound directly (no RefinablePar workaround) since the objcryst submodule (ba6ca89, vincefn/objcryst#105) now clicks the texture clock; DeletePhase is also exposed. - TextureMarchDollase has RefinableObj as a second (non-zero offset) base, so it is registered standalone with bind_refinableobj_forwarding and added to extractRefinableObjArg. - Bind ReflectionProfileDoubleExponentialPseudoVoigt; SetProfile gives a TOF profile copy the crystal's unit cell. - Port tests and news items, with extra DeletePhase tests. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * [pre-commit.ci] auto fixes from pre-commit hooks * ci: check out submodules and exclude vendored extern/ from pre-commit - Pass submodules: 'true' to the scikit-package reusable workflows, so that extern/objcryst is available when building. - Exclude extern/ (objcryst submodule, vendored cctbx and newmat) from pre-commit hooks. - Remove duplicated test_lsq_compiled_refined_obj_erase_all_param_set (F811) and fix a typo flagged by codespell. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * [pre-commit.ci] auto fixes from pre-commit hooks * [pre-commit.ci] auto fixes from pre-commit hooks * docs: keep inline code on one line so prettier output is stable Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * revert: restore vendored extern/ sources modified by pre-commit.ci autofix Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .../build-and-publish-docs-on-dispatch.yml | 1 + .../workflows/build-wheel-release-upload.yml | 1 + .github/workflows/matrix-and-codecov.yml | 1 + .github/workflows/tests-on-pr.yml | 1 + .pre-commit-config.yaml | 2 + nanobind_migration_notes.md | 111 +++++--- news/march-dollase-texture.rst | 23 ++ news/tof-profile.rst | 23 ++ src/extensions/nb_indexing.cpp | 2 +- .../nb_powderpatterndiffraction.cpp | 63 ++++- src/extensions/nb_refinableobj.cpp | 3 + src/extensions/nb_reflectionprofile.cpp | 26 ++ src/pyobjcryst/powderpattern.py | 2 + src/pyobjcryst/reflectionprofile.py | 7 + tests/test_lsq.py | 16 +- tests/test_powderpattern.py | 251 ++++++++++++++++-- tests/test_refinableobj.py | 7 +- tests/test_reflectionprofile.py | 147 +++++++++- tests/test_scatterer.py | 36 +-- tests/test_virtualbase_forwarding.py | 14 +- 20 files changed, 629 insertions(+), 108 deletions(-) create mode 100644 news/march-dollase-texture.rst create mode 100644 news/tof-profile.rst diff --git a/.github/workflows/build-and-publish-docs-on-dispatch.yml b/.github/workflows/build-and-publish-docs-on-dispatch.yml index a60668bc..1be1b4f8 100644 --- a/.github/workflows/build-and-publish-docs-on-dispatch.yml +++ b/.github/workflows/build-and-publish-docs-on-dispatch.yml @@ -13,6 +13,7 @@ jobs: uses: scikit-package/release-scripts/.github/workflows/_release-docs.yml@v0 with: project: pyobjcryst + submodules: "true" c_extension: true headless: false python_version: ${{ fromJSON(needs.get-python-version.outputs.latest_python_version) }} diff --git a/.github/workflows/build-wheel-release-upload.yml b/.github/workflows/build-wheel-release-upload.yml index 396b9ec9..42b91f71 100644 --- a/.github/workflows/build-wheel-release-upload.yml +++ b/.github/workflows/build-wheel-release-upload.yml @@ -27,6 +27,7 @@ jobs: uses: scikit-package/release-scripts/.github/workflows/_build-wheel-release-upload.yml@v0 with: project: pyobjcryst + submodules: "true" c_extension: true maintainer_github_username: sbillinge secrets: diff --git a/.github/workflows/matrix-and-codecov.yml b/.github/workflows/matrix-and-codecov.yml index 9a3b8e29..f02cc914 100644 --- a/.github/workflows/matrix-and-codecov.yml +++ b/.github/workflows/matrix-and-codecov.yml @@ -15,6 +15,7 @@ jobs: uses: scikit-package/release-scripts/.github/workflows/_matrix-and-codecov-on-merge-to-main.yml@v0 with: project: pyobjcryst + submodules: "true" c_extension: true headless: false secrets: diff --git a/.github/workflows/tests-on-pr.yml b/.github/workflows/tests-on-pr.yml index 62937438..2480080a 100644 --- a/.github/workflows/tests-on-pr.yml +++ b/.github/workflows/tests-on-pr.yml @@ -9,6 +9,7 @@ jobs: uses: scikit-package/release-scripts/.github/workflows/_tests-on-pr.yml@v0 with: project: pyobjcryst + submodules: "true" c_extension: true headless: false secrets: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b60917aa..beb88153 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,5 @@ +# Vendored third-party sources (objcryst submodule, cctbx, newmat) +exclude: "^extern/" default_language_version: python: python3 ci: diff --git a/nanobind_migration_notes.md b/nanobind_migration_notes.md index ffc2e353..57eb662c 100644 --- a/nanobind_migration_notes.md +++ b/nanobind_migration_notes.md @@ -6,6 +6,7 @@ gaps listed below — it is not "fully done" in the sense of zero open items.** What's done and verified: + - The C++ binding layer is fully ported from Boost.Python + SCons to nanobind + CMake + scikit-build-core. `src/pyobjcryst/*.py` (the pure-Python layer) and `tests/*.py` are untouched — nothing there is Boost.Python-specific. @@ -21,6 +22,7 @@ What's done and verified: - **161/161 tests pass** (`pytest tests/ -q`). Known, accepted gaps — real, not oversights, but still open: + - **Python-side method override does not work across the `RefinableObj` virtual-inheritance seam.** A Python subclass of `Atom`, `Molecule`, `ScatteringPowerAtom`, `DiffractionDataSingleCrystal`, `PowderPatternBackground`, etc. that overrides an inherited @@ -28,7 +30,7 @@ Known, accepted gaps — real, not oversights, but still open: C++-internal virtual dispatch — only plain forwarding calls were restored, not overridability. This was an explicit scope decision (general override support was confirmed not needed), not an oversight, but it is a real regression vs. Boost.Python's `bases`, which handled - this transparently. Override support that *does* still work: `RefinableObj`'s own ~15 virtuals + this transparently. Override support that _does_ still work: `RefinableObj`'s own ~15 virtuals when subclassing `RefinableObj` directly; `Scatterer`/`ScatteringPower`/`Restraint`'s own (non-inherited) virtuals; and `UpdateDisplay` specifically on `Crystal`, `PowderPattern`, and `MonteCarloObj` (all three reach `RefinableObj` through a non-virtual chain, so no seam exists @@ -153,18 +155,19 @@ after every test run — pre-existing, tracked in [Status](#status-2026-08-12) a ### Build troubleshooting -| Symptom | Cause | Fix | -|---|---|---| -| `nanobind not found` | not installed | `conda install nanobind` | -| `ObjCryst submodule empty` | not initialized | `git submodule update --init --recursive` | -| `version.h: No such file` | CMake config not run | `pip install -e . --no-build-isolation` | -| Segfault / bus error in a test | pointer-offset bug (virtual inheritance) | check whether the crashing class's C++ header declares `virtual` inheritance anywhere in its ancestry; see [Virtual Inheritance](#virtual-inheritance) | -| `RuntimeError: std::bad_cast`, no useful location | usually `nb::cast` on a `bytes` object | check every `.attr("read")()` call site — see [Python file-like input](#python-file-like-input-str-vs-bytes) | -| Binary needs a newer glibc than the host ships (`GLIBC_ABI_GNU2_TLS`) | conda-forge GCC's `gnu2` TLS dialect | build with the system compiler: `CC=/usr/bin/gcc CXX=/usr/bin/g++ pip install -e . --no-build-isolation` | -| gdb: `(no debugging symbols found)` | scikit-build-core strips symbols on install | `pip install -e . --no-build-isolation -Ccmake.define.CMAKE_BUILD_TYPE=RelWithDebInfo`, then copy the unstripped `.so` over the installed one | -| Values off in the last few digits | `REAL` (`ObjCryst/ObjCryst/General.h`) defaults to `float`; must be forced to `double` | confirm `CMakeLists.txt` sets `target_compile_definitions(ObjCryst PUBLIC REAL=double ...)`, and that any helper uses the `CrystVector_REAL`/`CrystMatrix_REAL` macros rather than a hardcoded ``/`` | +| Symptom | Cause | Fix | +| --------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `nanobind not found` | not installed | `conda install nanobind` | +| `ObjCryst submodule empty` | not initialized | `git submodule update --init --recursive` | +| `version.h: No such file` | CMake config not run | `pip install -e . --no-build-isolation` | +| Segfault / bus error in a test | pointer-offset bug (virtual inheritance) | check whether the crashing class's C++ header declares `virtual` inheritance anywhere in its ancestry; see [Virtual Inheritance](#virtual-inheritance) | +| `RuntimeError: std::bad_cast`, no useful location | usually `nb::cast` on a `bytes` object | check every `.attr("read")()` call site — see [Python file-like input](#python-file-like-input-str-vs-bytes) | +| Binary needs a newer glibc than the host ships (`GLIBC_ABI_GNU2_TLS`) | conda-forge GCC's `gnu2` TLS dialect | build with the system compiler: `CC=/usr/bin/gcc CXX=/usr/bin/g++ pip install -e . --no-build-isolation` | +| gdb: `(no debugging symbols found)` | scikit-build-core strips symbols on install | `pip install -e . --no-build-isolation -Ccmake.define.CMAKE_BUILD_TYPE=RelWithDebInfo`, then copy the unstripped `.so` over the installed one | +| Values off in the last few digits | `REAL` (`ObjCryst/ObjCryst/General.h`) defaults to `float`; must be forced to `double` | confirm `CMakeLists.txt` sets `target_compile_definitions(ObjCryst PUBLIC REAL=double ...)`, and that any helper uses the `CrystVector_REAL`/`CrystMatrix_REAL` macros rather than a hardcoded ``/`` | Useful gdb recipe for a segfault/bad_cast inside the extension: + ```bash gdb -q --args python -m pytest tests/test_whatever.py -k test_name (gdb) catch throw # for std::bad_cast / C++ exceptions @@ -182,7 +185,7 @@ or extending any class near `RefinableObj`, `Scatterer`, `ScatteringPower`, `Sca ### The core problem -ObjCryst++ uses *virtual* inheritance in several places: `Scatterer : virtual public +ObjCryst++ uses _virtual_ inheritance in several places: `Scatterer : virtual public RefinableObj`, `ScatteringPower : virtual public RefinableObj`, `ScatteringData : virtual public RefinableObj`, `PowderPatternComponent : virtual public RefinableObj`, and a second hop for `ScatteringPowerAtom : virtual public ScatteringPower` and `GlobalScatteringPower : virtual public @@ -190,8 +193,8 @@ ScatteringPower`. nanobind's automatic base↔derived pointer adjustment (used by `nb::class_(...)`) assumes a **fixed, statically computable** offset between `Derived*` and `Base*`. That's only -valid for *non-virtual* inheritance. Declaring the nanobind base across a virtual link does **not** -raise an error — it silently computes a *wrong* offset, which can look fine for fields at offset 0 +valid for _non-virtual_ inheritance. Declaring the nanobind base across a virtual link does **not** +raise an error — it silently computes a _wrong_ offset, which can look fine for fields at offset 0 and then segfault or return garbage the moment a method touching state further into the object is called. @@ -203,6 +206,12 @@ is fine and should still use nanobind's automatic base declaration (e.g. `Scatte public ScatteringPower`, no `virtual`, is safely `nb::class_`). +The same applies to _non-virtual multiple inheritance_ where the base is not the first one, e.g. +`TextureMarchDollase : public ScatteringCorr, public RefinableObj`: `RefinableObj` sits at a +non-zero offset, and `nb::class_` silently returns garbage +(`GetNbPar()` was 0). Register it standalone, call `bind_refinableobj_forwarding()`, and add it to +`extractRefinableObjArg`. + ### Four ways this bites, and the fix for each **1. Return direction** — a function returns a base-typed reference/pointer @@ -218,14 +227,15 @@ nb::object wrapScatteringPowerReturn(const ScatteringPower* sp, nb::handle paren return nb::cast(const_cast(sp), nb::rv_policy::reference_internal, parent); } ``` -Applies even when the returned type is an *intermediate* base, not the ultimate leaf (e.g. + +Applies even when the returned type is an _intermediate_ base, not the ultimate leaf (e.g. `PowderPattern::GetPowderPatternComponent(i)` returns `PowderPatternComponent&`, whose dynamic type is `PowderPatternDiffraction`) — every function returning a shared ancestor type anywhere in a virtual hierarchy needs this, not just the one function returning the immediate leaf type. -**2. Argument direction** — a virtually-derived leaf is registered *without* a declared nanobind +**2. Argument direction** — a virtually-derived leaf is registered _without_ a declared nanobind base (per the rule above), so nanobind refuses it wherever a C++ function's parameter type is the -*base* (`void AddAtom(..., const ScatteringPower* pow, ...)` rejects a Python `ScatteringPowerAtom` +_base_ (`void AddAtom(..., const ScatteringPower* pow, ...)` rejects a Python `ScatteringPowerAtom` with `TypeError: incompatible function arguments`). Fix: accept `nb::object` and resolve manually, trying the concrete leaf type first: @@ -238,13 +248,13 @@ const ScatteringPower* extractScatteringPowerArg(nb::object obj) { ``` **3. Generic "any `RefinableObj`" argument functions** — the same argument-direction problem, but -for functions generic over *any* `RefinableObj` (`MonteCarloObj::AddRefinableObj`, +for functions generic over _any_ `RefinableObj` (`MonteCarloObj::AddRefinableObj`, `LSQNumObj::SetRefinedObj`, `RefinableObj::AddPar`): nanobind has no conversion path from a Python `DiffractionDataSingleCrystal`/`Atom`/`Molecule`/etc. to `RefinableObj&`, since none of those concrete classes declare that base. Fix: a shared helper (`extractRefinableObjArg`, in `helpers_nb.hpp`/`nb_refinableobj.cpp`) trying the safe cast first, then falling back through every known virtually-linked type with `static_cast` (always well-defined at compile time — the problem -is only ever nanobind's own *runtime* offset table, never a real `static_cast`): +is only ever nanobind's own _runtime_ offset table, never a real `static_cast`): ```cpp RefinableObj& extractRefinableObjArg(nb::object obj) { @@ -258,11 +268,12 @@ RefinableObj& extractRefinableObjArg(nb::object obj) { } ``` -**4. Under-declaring a *safe* base** — the mirror-image mistake: forgetting to declare a nanobind +**4. Under-declaring a _safe_ base** — the mirror-image mistake: forgetting to declare a nanobind base across a link that's perfectly safe (plain, non-virtual). Symptom looks identical -(`TypeError: incompatible function arguments`) but the cause is a *missing* declaration, not a +(`TypeError: incompatible function arguments`) but the cause is a _missing_ declaration, not a dangerous one. Fix: register the base type too (it needs no bindings of its own, just an internal name), then declare the relationship normally: + ```cpp nb::class_(m, "_PeakListBase"); // internal-only nb::class_(m, "PeakList"); // now declared @@ -281,28 +292,29 @@ Fix: two reusable template helpers in `helpers_nb.hpp`, `bind_refinableobj_forwa `bind_scatteringpower_forwarding()`, each binding one method-set's full surface via plain forwarding `.def()` calls (`&T::Method`, or a lambda for anything needing a helper/numpy conversion). This is safe despite the virtual base because `T` is fully known at compile time at -the call site, so the *compiler* resolves the pointer adjustment — exactly the mechanism +the call site, so the _compiler_ resolves the pointer adjustment — exactly the mechanism Boost.Python relied on, nothing to do with nanobind's own (virtual-base-unsafe) casting. Called once each in `nb_scatterer.cpp`, `nb_scatteringpower.cpp`, `nb_scatteringdata.cpp`, and `nb_powderpatterncomponent.cpp` (cascades automatically to every non-virtually-inherited child — `Atom`, `Molecule`, `ZScatterer`, `PowderPatternBackground`, `PowderPatternDiffraction`, etc. — via ordinary Python MRO); `ScatteringPowerAtom` and `GlobalScatteringPower` need both helpers called -directly on them, since they have a *second* virtual-inheritance hop of their own. +directly on them, since they have a _second_ virtual-inheritance hop of their own. **This restores callability, not overridability** — see [Status](#status-2026-08-12) for why that distinction matters and is a deliberate, accepted scope limit (nanobind's `NB_TRAMPOLINE` macro -requires its argument to be a *direct* base, a hard C++ rule that blocks chained/templated +requires its argument to be a _direct_ base, a hard C++ rule that blocks chained/templated trampolines the way pybind11 supports them — confirmed by compiler error in a standalone repro, not a nanobind design choice that could be worked around). Two real bugs turned up while adding test coverage for this fix, both worth remembering as general lessons: + - A binding that reaches a protected member via a trampoline/alias helper class (here, `PyScatterer::GetClockScattCompList()`, added to reach `Scatterer`'s protected `mClockScattCompList`) must take the **real base type** (`Scatterer&`) as its bound parameter, not the trampoline/alias type (`PyScatterer&`) — a plain `Atom`/`Molecule` instance is never actually constructed as the trampoline, so binding against the alias type raises `TypeError` for - every ordinary instance. Cast through the alias *inside* the lambda instead: + every ordinary instance. Cast through the alias _inside_ the lambda instead: ```cpp .def("GetClockScattCompList", [](Scatterer& s) -> const RefinableObjClock& { @@ -310,7 +322,7 @@ lessons: }, nb::rv_policy::reference_internal) ``` - `bind_scatteringpower_forwarding()` forwarded `GetBij`/`SetBij` but missed the `B11`/`B12`/ - `B13`/`B22`/`B23`/`B33`/`Biso` *properties* that `nb_scatteringpower.cpp` defines separately via + `B13`/`B22`/`B23`/`B33`/`Biso` _properties_ that `nb_scatteringpower.cpp` defines separately via file-local templates — a reminder that a forwarding helper needs to be checked against the full `dir()` of the canonical class, not just its method list, when a class also exposes properties. @@ -321,9 +333,11 @@ lessons: ### `None` argument handling nanobind rejects `None` by default for any typed `nb::arg`. Allow it explicitly: + ```cpp .def("AddScatterer", &Crystal::AddScatterer, nb::arg("pScatt").none(), nb::arg("ownsScatt") = true) ``` + `.none()` is required even for generic `nb::object` parameters — it isn't automatic just because the C++ parameter type is generic. @@ -332,6 +346,7 @@ the C++ parameter type is generic. `REAL* derivpar` in `RecUnitCell::hkl2d`) — nanobind's arithmetic `type_caster` rejects `None` outright before `.none()` on the outer `nb::arg` ever gets a chance to matter. Fix: wrap in a helper taking `nb::object` and bridge manually: + ```cpp float _hkl2d(const RecUnitCell& r, float h, float k, float l, nb::object derivpar, unsigned int derivhkl) { if (derivpar.is_none()) return r.hkl2d(h, k, l, nullptr, derivhkl); @@ -351,8 +366,8 @@ produce wrong-precision code. ### Lambda return type silently deduced by value A `.def(...)` that wraps a reference-returning helper in a lambda **without an explicit trailing -return type** deduces `auto`, which strips the reference and returns *by value* — silently -*copying* the object, even with `nb::rv_policy::reference_internal` set (that policy only controls +return type** deduces `auto`, which strips the reference and returns _by value_ — silently +_copying_ the object, even with `nb::rv_policy::reference_internal` set (that policy only controls how nanobind wraps whatever the lambda actually returns; it can't recover a reference from an already-copied value). This caused a real bug: `Molecule.AddRigidGroup`'s lambda copied the `RigidGroup` it had just added, so `Molecule.RemoveRigidGroup` (which finds the group to remove by @@ -371,18 +386,18 @@ confirmed by a plain, non-pytest script that creates a `Molecule`, calls `AddBon all references, and calls `gc.collect()` twice: still leaks 6 instances at exit. Root cause: nanobind types don't participate in Python's cyclic GC by default (no `tp_traverse`/`tp_clear`), so a bidirectional `keep_alive` between two live objects — parent keeps child alive (a `.def()` -declares `keep_alive<1,N>()`) *and* child keeps parent alive (a `.def()` returns via +declares `keep_alive<1,N>()`) _and_ child keeps parent alive (a `.def()` returns via `rv_policy::reference_internal`, nanobind's shorthand for `keep_alive<0,1>()`) — forms a cycle nothing can ever collect. Fixed for `Molecule`↔`MolAtom`: removed the redundant Molecule-keeps-atom direction from `AddBond`/`AddBondAngle`/`AddDihedralAngle` (safe because `MolAtom` has no standalone Python-owned existence — its only constructor is a copy constructor, so it's always reached via -`GetAtom()`/`AddAtom()`, which already protects it via the *other* direction). +`GetAtom()`/`AddAtom()`, which already protects it via the _other_ direction). **Not safe to fix the same way**, and still open: `Crystal`↔`Scatterer`/`Molecule`/ `ScatteringPower` (and possibly `RefinableObj`↔`RefinablePar`). Unlike `MolAtom`, these classes -*do* have real standalone Python-owned constructors (`sp = ScatteringPowerAtom("C", "C")` with no +_do_ have real standalone Python-owned constructors (`sp = ScatteringPowerAtom("C", "C")` with no parent) — the forward direction is protecting a real gap (between construction and being added to a `Crystal`, nothing else keeps the child's wrapper alive), so removing it would trade a leak for a use-after-free. The real fix is nanobind's `tp_traverse`/`tp_clear` mechanism, which likely requires @@ -396,6 +411,7 @@ the parent — that combination is the signature to look for. Any binding calling `.attr("read")()` on a caller-supplied Python object and casting straight to `std::string` breaks the moment the file was opened in binary mode (`.read()` returns `bytes`, `nb::cast` throws `std::bad_cast`). Use a shared helper: + ```cpp inline std::string read_pyfile_to_string(nb::object input) { nb::object data = input.attr("read")(); @@ -437,6 +453,7 @@ this fix unless it's re-applied or merged upstream. ## Binding Patterns Quick Reference **Simple class, no virtuals:** + ```cpp nb::class_(m, "MyClass") .def(nb::init<>()) @@ -445,8 +462,9 @@ nb::class_(m, "MyClass") ; ``` -**Class with overridable virtuals (trampoline) — only where `Base` is a *direct*, non-virtual +**Class with overridable virtuals (trampoline) — only where `Base` is a _direct_, non-virtual base of the trampoline, per [Virtual Inheritance](#virtual-inheritance):** + ```cpp struct PyMyClass : MyClass { NB_TRAMPOLINE(MyClass, 2); // 2 virtual methods @@ -457,6 +475,7 @@ nb::class_(m, "MyClass").def(nb::init<>()); ``` **String representation** (many ObjCryst objects have a useful `operator<<`): + ```cpp .def("__str__", [](const T& obj){ return obj_str(obj); }) // obj_str() in helpers_nb.hpp, mutes debug spam .def("__repr__", [](const T& obj){ return obj_str(obj); }) @@ -464,6 +483,7 @@ nb::class_(m, "MyClass").def(nb::init<>()); **Method overload resolution** — nanobind can't distinguish C++ overloads at binding time; use a lambda or a pointer-to-member-function cast: + ```cpp .def("SetX", nb::overload_cast(&T::SetX)) ``` @@ -476,13 +496,13 @@ handling, container conversion, lambda return types, `keep_alive`, and file-like ## Architecture Decisions -| Decision | Rationale | -|---|---| -| Single `_pyobjcryst` extension | simpler than per-class extensions; nanobind modules can be large | -| Static linking (newmat, cctbx, ObjCryst) | avoids runtime library conflicts on Windows/macOS wheels | -| scikit-build-core + CMake | modern standard for C++ Python extensions, replaces SCons | -| ObjCryst++ as a submodule | tracks upstream, simpler than a fork | -| Vendored newmat/cctbx (not conda-forge `cctbx-base`) | see below | +| Decision | Rationale | +| ---------------------------------------------------- | ---------------------------------------------------------------- | +| Single `_pyobjcryst` extension | simpler than per-class extensions; nanobind modules can be large | +| Static linking (newmat, cctbx, ObjCryst) | avoids runtime library conflicts on Windows/macOS wheels | +| scikit-build-core + CMake | modern standard for C++ Python extensions, replaces SCons | +| ObjCryst++ as a submodule | tracks upstream, simpler than a fork | +| Vendored newmat/cctbx (not conda-forge `cctbx-base`) | see below | **Vendored `cctbx` vs. conda-forge's `cctbx-base`** (investigated, not adopted): `cctbx-base` does contain the right modules, compiled and working, but isn't structured for third-party C++ @@ -499,17 +519,19 @@ depending on `cctbx-base` as it currently ships. ## Pitfalls Checklist **Before writing/extending a binding for class `X`:** -- [ ] Grep `X`'s header and its whole ancestry (not just the direct parent) for `: *virtual - public` — if found, do **not** declare that base in `nb::class_`; use the manual - `dynamic_cast`/`nb::cast` patterns instead + +- [ ] Grep `X`'s header and its whole ancestry (not just the direct parent) for + `: *virtual public` — if found, do **not** declare that base in + `nb::class_`; use the manual `dynamic_cast`/`nb::cast` patterns instead **While writing:** + - [ ] Every optional pointer/object argument needs `.none()` on its `nb::arg(...)`, including plain `nb::object` params — except pointers to a plain arithmetic type, where `.none()` has no effect; wrap those in an `nb::object`-taking helper instead - [ ] Every function returning a base-typed reference/pointer whose dynamic type is commonly a virtually-derived leaf needs the `dynamic_cast`-and-recast treatment -- [ ] Every function generically *accepting* a base type as an argument needs its argument routed +- [ ] Every function generically _accepting_ a base type as an argument needs its argument routed through a helper like `extractRefinableObjArg()` - [ ] Any `.def(...)` combining a lambda with `nb::rv_policy::reference`/`reference_internal` needs an explicit `-> T&`/`-> T*` trailing return type on the lambda @@ -518,10 +540,11 @@ depending on `cctbx-base` as it currently ships. - [ ] Any container type (`CrystVector`, `CrystMatrix`) crossing the boundary should use the `CrystVector_REAL`/`CrystMatrix_REAL` macros, never a hardcoded ``/`` - [ ] A binding reaching a protected/private member via a trampoline/alias helper class must take - the *real* base type as its bound parameter, not the trampoline/alias type — otherwise it + the _real_ base type as its bound parameter, not the trampoline/alias type — otherwise it raises `TypeError` on every instance not literally constructed as that alias **After writing, before declaring done:** + - [ ] Rebuilt and re-ran the specific test file, then the full suite, and confirmed no new failures - [ ] If the class exposes properties as well as methods, checked the forwarding/coverage against the full `dir()` of the canonical class, not just its method list diff --git a/news/march-dollase-texture.rst b/news/march-dollase-texture.rst new file mode 100644 index 00000000..3a891a09 --- /dev/null +++ b/news/march-dollase-texture.rst @@ -0,0 +1,23 @@ +**Added:** + +* Expose the March-Dollase preferred-orientation correction TextureMarchDollase (AddPhase, SetPhasePar, DeletePhase and getters) and PowderPatternDiffraction.GetTextureMarchDollase. SetPhasePar and DeletePhase rely on the upstream ObjCryst++ fix (vincefn/objcryst#105) which recalculates the powder pattern when the texture changes. + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* diff --git a/news/tof-profile.rst b/news/tof-profile.rst new file mode 100644 index 00000000..ad9d2c62 --- /dev/null +++ b/news/tof-profile.rst @@ -0,0 +1,23 @@ +**Added:** + +* Expose the time-of-flight reflection profile ReflectionProfileDoubleExponentialPseudoVoigt. + +**Changed:** + +* PowderPatternDiffraction.SetProfile gives a ReflectionProfileDoubleExponentialPseudoVoigt the unit cell of the component's crystal. + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* diff --git a/src/extensions/nb_indexing.cpp b/src/extensions/nb_indexing.cpp index e06ace54..44bf2a3a 100644 --- a/src/extensions/nb_indexing.cpp +++ b/src/extensions/nb_indexing.cpp @@ -30,7 +30,7 @@ namespace { // with "incompatible function arguments", even though None is exactly what a // Python caller must pass (a Python float is immutable, so there is no way for // the derivative to be written back to it regardless of binding technology -- -// this matches the pre-existing Boost.Python behavor, where derivpar was only +// this matches the pre-existing Boost.Python behavior, where derivpar was only // ever meaningfully used from within C++ itself, e.g. LSQ fitting internals). // Fixed by taking derivpar as nb::object and manually bridging None -> nullptr. float _hkl2d(const RecUnitCell& r, const float h, const float k, const float l, diff --git a/src/extensions/nb_powderpatterndiffraction.cpp b/src/extensions/nb_powderpatterndiffraction.cpp index 92df37c0..df8627f6 100644 --- a/src/extensions/nb_powderpatterndiffraction.cpp +++ b/src/extensions/nb_powderpatterndiffraction.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include "helpers_nb.hpp" @@ -18,6 +19,38 @@ namespace nb = nanobind; using namespace ObjCryst; +namespace { + +void SetProfileCopy(PowderPatternDiffraction& pdiff, + const ReflectionProfile& profile) +{ + ReflectionProfile* copy = profile.CreateCopy(); + // The TOF profile needs a unit cell to compute d_hkl, as in + // PowderPatternDiffraction::SetCrystal and XMLInput. + auto* tofprofile = + dynamic_cast(copy); + if (tofprofile != nullptr && pdiff.HasCrystal()) + tofprofile->SetUnitCell(pdiff.GetCrystal()); + pdiff.SetProfile(copy); +} + +// PowderPatternDiffraction has no public accessor for its texture +// correction, but registers it as a sub-object. +TextureMarchDollase& GetTextureMarchDollase(PowderPatternDiffraction& pdiff) +{ + ObjRegistry& subobjs = pdiff.GetSubObjRegistry(); + for (long i = 0; i < subobjs.GetNb(); ++i) + { + auto* texture = dynamic_cast(&subobjs.GetObj(i)); + if (texture != nullptr) return *texture; + } + throw ObjCrystException("PowderPatternDiffraction has no " + "TextureMarchDollase sub-object. Please report " + "this as a pyobjcryst bug."); +} + +} // namespace + void wrap_powderpatterndiffraction(nb::module_& m) { nb::enum_(m, "ReflectionProfileType") @@ -72,9 +105,7 @@ void wrap_powderpatterndiffraction(nb::module_& m) nb::overload_cast<>(&PowderPatternDiffraction::GetProfile), nb::rv_policy::reference_internal) .def("SetProfile", - [](PowderPatternDiffraction& d, ReflectionProfile& p) { - d.SetProfile(p.CreateCopy()); - }, + &SetProfileCopy, nb::arg("profile"), "Install an independent copy of the given profile.") .def("SetExtractionMode", @@ -94,5 +125,31 @@ void wrap_powderpatterndiffraction(nb::module_& m) [](PowderPatternDiffraction& d){ return crystvec_to_array(d.GetFhklObsSq()); }) .def("X2XCorrPhase", &PowderPatternDiffraction::X2XCorrPhase, "Apply the flat-detector displacement correction for this phase's offset.") + .def("GetTextureMarchDollase", &GetTextureMarchDollase, + nb::rv_policy::reference_internal, + "Return the March-Dollase preferred-orientation correction.") + ; + + // TextureMarchDollase : public ScatteringCorr, public RefinableObj -- + // RefinableObj is a second base at a non-zero offset, which nanobind's + // base casting cannot handle (same failure mode as the virtual bases in + // nanobind_migration_notes.md). Register it standalone and forward the + // RefinableObj surface through T instead. + auto texture = nb::class_(m, "TextureMarchDollase"); + bind_refinableobj_forwarding(texture); + texture + .def("AddPhase", &TextureMarchDollase::AddPhase, + nb::arg("fraction"), nb::arg("coeffMarch"), + nb::arg("h"), nb::arg("k"), nb::arg("l")) + .def("SetPhasePar", &TextureMarchDollase::SetPhasePar, + nb::arg("i"), nb::arg("fraction"), nb::arg("coeffMarch"), + nb::arg("h"), nb::arg("k"), nb::arg("l")) + .def("DeletePhase", &TextureMarchDollase::DeletePhase, nb::arg("i")) + .def("GetNbPhase", &TextureMarchDollase::GetNbPhase) + .def("GetFraction", &TextureMarchDollase::GetFraction, nb::arg("i")) + .def("GetMarchCoeff", &TextureMarchDollase::GetMarchCoeff, nb::arg("i")) + .def("GetPhaseH", &TextureMarchDollase::GetPhaseH, nb::arg("i")) + .def("GetPhaseK", &TextureMarchDollase::GetPhaseK, nb::arg("i")) + .def("GetPhaseL", &TextureMarchDollase::GetPhaseL, nb::arg("i")) ; } diff --git a/src/extensions/nb_refinableobj.cpp b/src/extensions/nb_refinableobj.cpp index 4bdb782a..322678d0 100644 --- a/src/extensions/nb_refinableobj.cpp +++ b/src/extensions/nb_refinableobj.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include "helpers_nb.hpp" @@ -154,6 +155,8 @@ RefinableObj& extractRefinableObjArg(nb::object obj) try { return static_cast(nb::cast(obj)); } catch (...) {} try { return static_cast(nb::cast(obj)); } catch (...) {} try { return static_cast(nb::cast(obj)); } catch (...) {} + // Non-virtual, but RefinableObj is its second base (non-zero offset). + try { return static_cast(nb::cast(obj)); } catch (...) {} // Nothing matched -- let this raise a clear nanobind TypeError rather // than silently returning a dangling reference. return nb::cast(obj); diff --git a/src/extensions/nb_reflectionprofile.cpp b/src/extensions/nb_reflectionprofile.cpp index 14e442f4..1252fd73 100644 --- a/src/extensions/nb_reflectionprofile.cpp +++ b/src/extensions/nb_reflectionprofile.cpp @@ -10,6 +10,7 @@ #undef B0 #include +#include #include #include "helpers_nb.hpp" @@ -133,6 +134,31 @@ void wrap_reflectionprofile(nb::module_& m) "Set the TCH pseudo-Voigt U, V, W, X, Y, Z, P and LGmix parameters.") ; + nb::class_( + m, "ReflectionProfileDoubleExponentialPseudoVoigt", + nb::is_weak_referenceable()) + .def(nb::init<>()) + .def(nb::init(), nb::arg("cell"), nb::keep_alive<1, 2>()) + .def(nb::init(), + nb::arg("old"), nb::keep_alive<1, 2>()) + .def("CreateCopy", + &ReflectionProfileDoubleExponentialPseudoVoigt::CreateCopy, + nb::rv_policy::take_ownership, nb::keep_alive<0, 1>(), + "Return an independent copy of this profile.") + .def("SetProfilePar", + &ReflectionProfileDoubleExponentialPseudoVoigt::SetProfilePar, + nb::arg("instrumentAlpha0"), nb::arg("instrumentAlpha1"), + nb::arg("instrumentBeta0"), nb::arg("instrumentBeta1"), + nb::arg("gaussianSigma0"), nb::arg("gaussianSigma1"), + nb::arg("gaussianSigma2"), nb::arg("lorentzianGamma0"), + nb::arg("lorentzianGamma1"), nb::arg("lorentzianGamma2"), + "Set the double-exponential pseudo-Voigt TOF profile parameters.") + .def("SetUnitCell", + &ReflectionProfileDoubleExponentialPseudoVoigt::SetUnitCell, + nb::arg("cell"), nb::keep_alive<1, 2>(), + "Set the unit cell used to compute d_hkl for reflections.") + ; + nb::class_( m, "ReflectionProfilePseudoVoigtAnisotropic") .def(nb::init<>()) diff --git a/src/pyobjcryst/powderpattern.py b/src/pyobjcryst/powderpattern.py index a044024d..0b74b26e 100644 --- a/src/pyobjcryst/powderpattern.py +++ b/src/pyobjcryst/powderpattern.py @@ -30,6 +30,7 @@ "PowderPatternDiffraction", "ReflectionProfileType", "SpaceGroupExplorer", + "TextureMarchDollase", ] from pyobjcryst._pyobjcryst import ( @@ -45,6 +46,7 @@ PowderPatternDiffraction, ReflectionProfileType, SpaceGroupExplorer, + TextureMarchDollase, ) from pyobjcryst.general import ObjCrystException from pyobjcryst.refinableobj import refpartype_scattdata_background diff --git a/src/pyobjcryst/reflectionprofile.py b/src/pyobjcryst/reflectionprofile.py index c3d9d3b7..cf90ebd5 100644 --- a/src/pyobjcryst/reflectionprofile.py +++ b/src/pyobjcryst/reflectionprofile.py @@ -43,6 +43,11 @@ aniso.SetProfilePar(fwhmCagliotiW=1e-4) ppd3.SetProfile(aniso) +For time-of-flight neutron data, use the double-exponential pseudo-Voigt +profile ``ReflectionProfileDoubleExponentialPseudoVoigt``. It needs the +unit cell to compute ``d_hkl``, which ``PowderPatternDiffraction.SetProfile`` +sets from the component's crystal. + Example ------- @@ -76,11 +81,13 @@ "ReflectionProfilePseudoVoigt", "ReflectionProfilePseudoVoigtTCH", "ReflectionProfilePseudoVoigtAnisotropic", + "ReflectionProfileDoubleExponentialPseudoVoigt", "ReflectionProfileType", ] from pyobjcryst._pyobjcryst import ( ReflectionProfile, + ReflectionProfileDoubleExponentialPseudoVoigt, ReflectionProfilePseudoVoigt, ReflectionProfilePseudoVoigtAnisotropic, ReflectionProfilePseudoVoigtTCH, diff --git a/tests/test_lsq.py b/tests/test_lsq.py index 0618d83b..99730d2e 100644 --- a/tests/test_lsq.py +++ b/tests/test_lsq.py @@ -93,18 +93,9 @@ def test_lsq_refine(self): self.c.RandomizeConfiguration() lsq.Refine(10, False, True) - def test_lsq_compiled_refined_obj_erase_all_param_set(self): - """Check parameter sets can be erased on compiled refined objects.""" - lsq = LSQ() - lsq.SetRefinedObj(self.d, 0, True, True) - lsq.PrepareRefParList() - refobj = lsq.GetCompiledRefinedObj() - save = refobj.CreateParamSet("save") - refobj.EraseAllParamSet() - self.assertRaises(ObjCrystException, refobj.SaveParamSet, save) - def test_lsq_get_variance_covariance_map(self): - """GetVarianceCovarianceMap returns a dict keyed by (name, name) tuples.""" + """GetVarianceCovarianceMap returns a dict keyed by (name, name) + tuples.""" lsq = LSQ() lsq.SetRefinedObj(self.d, 0, True, True) lsq.PrepareRefParList() @@ -137,7 +128,7 @@ def test_lsq_get_rw_history(self): self.assertGreaterEqual(v, 0.0) def test_lsq_refine_minrwpvar(self): - """minRwpVar argument is accepted by Refine without error.""" + """MinRwpVar argument is accepted by Refine without error.""" lsq = LSQ() lsq.SetRefinedObj(self.d, 0, True, True) lsq.PrepareRefParList() @@ -155,4 +146,3 @@ def test_lsq_prepare_ref_par_list_verbose(self): if __name__ == "__main__": unittest.main() - diff --git a/tests/test_powderpattern.py b/tests/test_powderpattern.py index 507734f5..84fd1645 100644 --- a/tests/test_powderpattern.py +++ b/tests/test_powderpattern.py @@ -23,7 +23,11 @@ from pyobjcryst import ObjCrystException from pyobjcryst.indexing import CrystalCentering, CrystalSystem, quick_index -from pyobjcryst.powderpattern import PowderPattern, SpaceGroupExplorer +from pyobjcryst.powderpattern import ( + PowderPattern, + SpaceGroupExplorer, + TextureMarchDollase, +) from pyobjcryst.radiation import RadiationType, WavelengthType from pyobjcryst.reflectionprofile import ReflectionProfileType @@ -365,16 +369,18 @@ def test_update_nbrefl(self): class _PowderPatternComponentFixtureMixin: - """Shared setUp for the three test classes below: a PowderPattern with - one real PowderPatternBackground and one real PowderPatternDiffraction - attached, mirroring TestPowderPattern.test_GetClassName's setup. Both - PowderPatternComponent and ScatteringData inherit RefinableObj virtually - in C++ (and PowderPatternDiffraction inherits PowderPatternComponent - virtually *again*, on top of ScatteringData non-virtually) -- see - nanobind_migration_notes.md's "Follow-up" section -- so neither class is - directly instantiable from Python; these fixtures exercise the - forwarding fix through real, concrete PowderPatternComponent-family - objects instead. + """Shared setUp for the three test classes below: a PowderPattern + with one real PowderPatternBackground and one real + PowderPatternDiffraction attached, mirroring + TestPowderPattern.test_GetClassName's setup. + + Both PowderPatternComponent and ScatteringData inherit RefinableObj + virtually in C++ (and PowderPatternDiffraction inherits + PowderPatternComponent virtually *again*, on top of ScatteringData + non-virtually) -- see nanobind_migration_notes.md's "Follow-up" + section -- so neither class is directly instantiable from Python; + these fixtures exercise the forwarding fix through real, concrete + PowderPatternComponent-family objects instead. """ @pytest.fixture(autouse=True) @@ -392,7 +398,9 @@ def setUp(self): self.diff = self.pp.AddPowderPatternDiffraction(c) -class TestPowderPatternComponent(_PowderPatternComponentFixtureMixin, unittest.TestCase): +class TestPowderPatternComponent( + _PowderPatternComponentFixtureMixin, unittest.TestCase +): def test_GetParentPowderPattern(self): self.assertIs(self.pp, self.bg.GetParentPowderPattern()) @@ -400,9 +408,10 @@ def test_GetParentPowderPattern(self): def test_refinableobj_forwarding(self): """PowderPatternComponent inherits RefinableObj virtually; only - GetName/SetName/GetClassName/FixAllPar/UnFixAllPar were reachable - before the forwarding fix (see test_GetClassName above, which - covers GetClassName specifically) -- exercise the rest here.""" + GetName/SetName/GetClassName/FixAllPar/UnFixAllPar were + reachable before the forwarding fix (see test_GetClassName + above, which covers GetClassName specifically) -- exercise the + rest here.""" self.bg.SetName("mybg") self.assertEqual("mybg", self.bg.GetName()) self.bg.FixAllPar() @@ -418,7 +427,9 @@ def test_refinableobj_forwarding(self): # ---------------------------------------------------------------------------- -class TestPowderPatternBackground(_PowderPatternComponentFixtureMixin, unittest.TestCase): +class TestPowderPatternBackground( + _PowderPatternComponentFixtureMixin, unittest.TestCase +): # def test___init__(self): assert False # def test_FixParametersBeyondMaxresolution(self): assert False # def test_GetPowderPatternCalc(self): assert False @@ -440,7 +451,9 @@ def test_refinableobj_forwarding(self): # ---------------------------------------------------------------------------- -class TestPowderPatternDiffraction(_PowderPatternComponentFixtureMixin, unittest.TestCase): +class TestPowderPatternDiffraction( + _PowderPatternComponentFixtureMixin, unittest.TestCase +): # def test___init__(self): assert False # def test_ExtractLeBail(self): assert False # def test_GetExtractionMode(self): assert False @@ -452,10 +465,10 @@ class TestPowderPatternDiffraction(_PowderPatternComponentFixtureMixin, unittest # def test_SetReflectionProfilePar(self): assert False def test_refinableobj_forwarding(self): - """PowderPatternDiffraction reaches RefinableObj via ScatteringData - (non-virtual, already a correct nanobind base) -- confirm the - forwarding applied to ScatteringData actually cascades here rather - than assuming it does.""" + """PowderPatternDiffraction reaches RefinableObj via + ScatteringData (non-virtual, already a correct nanobind base) -- + confirm the forwarding applied to ScatteringData actually + cascades here rather than assuming it does.""" self.diff.FixAllPar() self.diff.UnFixAllPar() self.assertEqual(0.0, self.diff.GetLogLikelihood()) @@ -497,5 +510,201 @@ def test_X2XCorrPhase_flat_detector_displacement(self): # ---------------------------------------------------------------------------- + +def build_textured_pattern(crystal, phases): + """Return an X-ray powder pattern of crystal with March-Dollase + phases.""" + pattern = PowderPattern() + pattern.SetWavelength(1.54) + x = np.deg2rad(np.linspace(5, 40, 2001)) + pattern.SetPowderPatternX(x) + pattern.SetPowderPatternObs(np.ones_like(x)) + diffraction = pattern.AddPowderPatternDiffraction(crystal) + texture = diffraction.GetTextureMarchDollase() + for phase in phases: + texture.AddPhase(*phase) + return pattern + + +@pytest.mark.parametrize( + "phases, expected_par_names", + [ + # Test that AddPhase stores a texture phase and its refinable + # parameters + # C1: One phase with a fraction, March coefficient and hkl is + # added. + # Expected: The getters return the phase's values, and its five + # parameters are named with the suffix _0. + ( + [(1.0, 0.5, 0, 0, 1)], + ["Fraction_0", "MarchCoeff_0", "H_0", "K_0", "L_0"], + ), + # C2: Two phases are added. + # Expected: The getters return each phase's values, and the second + # phase's parameters are named with the suffix _1. + ( + [(0.7, 0.5, 0, 0, 1), (0.3, 2.0, 1, 1, 0)], + [ + "Fraction_0", + "MarchCoeff_0", + "H_0", + "K_0", + "L_0", + "Fraction_1", + "MarchCoeff_1", + "H_1", + "K_1", + "L_1", + ], + ), + ], +) +def test_add_phase(loadcifdata, phases, expected_par_names): + crystal = loadcifdata("paracetamol.cif") + pattern = build_textured_pattern(crystal, phases) + texture = pattern.GetPowderPatternComponent(0).GetTextureMarchDollase() + actual_type = type(texture) + expected_type = TextureMarchDollase + actual_phases = [ + ( + texture.GetFraction(i), + texture.GetMarchCoeff(i), + texture.GetPhaseH(i), + texture.GetPhaseK(i), + texture.GetPhaseL(i), + ) + for i in range(texture.GetNbPhase()) + ] + expected_phases = phases + actual_par_names = [ + texture.GetPar(i).GetName() for i in range(texture.GetNbPar()) + ] + assert actual_type == expected_type + assert actual_phases == [pytest.approx(e) for e in expected_phases] + assert actual_par_names == expected_par_names + + +@pytest.mark.parametrize( + "initial_phases, method_name, method_args, expected_phases", + [ + # Test that changing the texture of an existing pattern + # recalculates it + # C1: A phase is added to an untextured pattern. + # Expected: The pattern equals one built with that phase. + ([], "AddPhase", (1.0, 0.5, 0, 0, 1), [(1.0, 0.5, 0, 0, 1)]), + # C2: SetPhasePar changes the March coefficient of a phase. + # Expected: The pattern equals one built with the new March + # coefficient. + ( + [(1.0, 0.5, 0, 0, 1)], + "SetPhasePar", + (0, 1.0, 2.0, 0, 0, 1), + [(1.0, 2.0, 0, 0, 1)], + ), + # C3: DeletePhase removes the second of two phases. + # Expected: The pattern equals one built with only the first phase. + ( + [(0.7, 0.5, 0, 0, 1), (0.3, 2.0, 1, 1, 0)], + "DeletePhase", + (1,), + [(0.7, 0.5, 0, 0, 1)], + ), + ], +) +def test_get_powder_pattern_calc_after_texture_change( + loadcifdata, initial_phases, method_name, method_args, expected_phases +): + crystal = loadcifdata("paracetamol.cif") + pattern = build_textured_pattern(crystal, initial_phases) + pattern.GetPowderPatternCalc() + texture = pattern.GetPowderPatternComponent(0).GetTextureMarchDollase() + getattr(texture, method_name)(*method_args) + actual_calc = pattern.GetPowderPatternCalc() + expected_calc = build_textured_pattern( + crystal, expected_phases + ).GetPowderPatternCalc() + assert np.allclose(actual_calc, expected_calc) + + +@pytest.mark.parametrize( + "method_name, method_args", + [ + # Test texture methods with the index of a phase that does not exist + # C1: SetPhasePar is called with index 1 on a single-phase texture. + # Expected: An ObjCrystException is raised. + ("SetPhasePar", (1, 1.0, 2.0, 0, 0, 1)), + # C2: DeletePhase is called with index 1 on a single-phase texture. + # Expected: An ObjCrystException is raised. + ("DeletePhase", (1,)), + ], +) +def test_texture_phase_index_out_of_range( + loadcifdata, method_name, method_args +): + crystal = loadcifdata("paracetamol.cif") + pattern = build_textured_pattern(crystal, [(1.0, 0.5, 0, 0, 1)]) + texture = pattern.GetPowderPatternComponent(0).GetTextureMarchDollase() + with pytest.raises(ObjCrystException): + getattr(texture, method_name)(*method_args) + + +@pytest.mark.parametrize( + "phases, deleted_index, expected_phases, expected_par_names", + [ + # Test that DeletePhase removes a phase and its refinable parameters + # C1: The only phase is deleted. + # Expected: No phase and no parameter remain. + ([(1.0, 0.5, 0, 0, 1)], 0, [], []), + # C2: The first of two phases is deleted. + # Expected: The second phase remains, and its parameters are + # renamed with the suffix _0. + ( + [(0.7, 0.5, 0, 0, 1), (0.3, 2.0, 1, 1, 0)], + 0, + [(0.3, 2.0, 1, 1, 0)], + ["Fraction_0", "MarchCoeff_0", "H_0", "K_0", "L_0"], + ), + ], +) +def test_delete_phase( + loadcifdata, phases, deleted_index, expected_phases, expected_par_names +): + crystal = loadcifdata("paracetamol.cif") + pattern = build_textured_pattern(crystal, phases) + texture = pattern.GetPowderPatternComponent(0).GetTextureMarchDollase() + texture.DeletePhase(deleted_index) + actual_phases = [ + ( + texture.GetFraction(i), + texture.GetMarchCoeff(i), + texture.GetPhaseH(i), + texture.GetPhaseK(i), + texture.GetPhaseL(i), + ) + for i in range(texture.GetNbPhase()) + ] + actual_par_names = [ + texture.GetPar(i).GetName() for i in range(texture.GetNbPar()) + ] + assert actual_phases == [pytest.approx(e) for e in expected_phases] + assert actual_par_names == expected_par_names + + +def test_get_powder_pattern_calc_after_march_coeff_par_change(loadcifdata): + # Test refining the March coefficient through its RefinablePar + # Expected: The pattern equals one built with the new March + # coefficient. + crystal = loadcifdata("paracetamol.cif") + pattern = build_textured_pattern(crystal, [(1.0, 0.5, 0, 0, 1)]) + pattern.GetPowderPatternCalc() + texture = pattern.GetPowderPatternComponent(0).GetTextureMarchDollase() + texture.GetPar("MarchCoeff_0").SetValue(2.0) + actual_calc = pattern.GetPowderPatternCalc() + expected_calc = build_textured_pattern( + crystal, [(1.0, 2.0, 0, 0, 1)] + ).GetPowderPatternCalc() + assert np.allclose(actual_calc, expected_calc) + + if __name__ == "__main__": unittest.main() diff --git a/tests/test_refinableobj.py b/tests/test_refinableobj.py index e5b71e5b..087b3fe3 100644 --- a/tests/test_refinableobj.py +++ b/tests/test_refinableobj.py @@ -425,7 +425,9 @@ def test_xml(self): def test_xml_output_input_reachable(self): """XMLOutput/XMLInput were dropped from the nanobind port's - method-forwarding audit alongside the LSQ methods below. Note + method-forwarding audit alongside the LSQ methods below. + + Note RefinableObj's own C++ base implementation is a documented no-op ("Does nothing! Should be purely virtual...", see RefinableObj/IO.cpp) -- real content only appears once a concrete @@ -434,7 +436,8 @@ def test_xml_output_input_reachable(self): file-like object, exercised on concrete subclasses that do override XMLOutput/XMLInput with real behaviour, live in test_scatterer.py (Atom), test_powderpattern.py (PowderPatternBackground) and - test_single_crystal_data.py (DiffractionDataSingleCrystal).""" + test_single_crystal_data.py (DiffractionDataSingleCrystal). + """ import io buf = io.StringIO() diff --git a/tests/test_reflectionprofile.py b/tests/test_reflectionprofile.py index f4cfc489..a3b1eeb3 100644 --- a/tests/test_reflectionprofile.py +++ b/tests/test_reflectionprofile.py @@ -1,13 +1,17 @@ """Unit tests for pyobjcryst.reflectionprofile bindings.""" +import gc import unittest +import weakref import numpy as np import pytest from pyobjcryst.powderpattern import PowderPattern +from pyobjcryst.radiation import RadiationType, WavelengthType from pyobjcryst.refinableobj import RefinableObj from pyobjcryst.reflectionprofile import ( + ReflectionProfileDoubleExponentialPseudoVoigt, ReflectionProfilePseudoVoigt, ReflectionProfilePseudoVoigtAnisotropic, ReflectionProfilePseudoVoigtTCH, @@ -126,8 +130,8 @@ def test_is_anisotropic(self): self.assertFalse(self.profile.IsAnisotropic()) def test_concrete_pseudo_voigt_profiles(self): - """ReflectionProfilePseudoVoigt and Anisotropic can be constructed - and installed on a PowderPatternDiffraction.""" + """ReflectionProfilePseudoVoigt and Anisotropic can be + constructed and installed on a PowderPatternDiffraction.""" iso = ReflectionProfilePseudoVoigt() self.assertFalse(iso.IsAnisotropic()) self.assertTrue( @@ -148,7 +152,9 @@ def test_concrete_pseudo_voigt_profiles(self): aniso.SetProfilePar(fwhmCagliotiW=1e-4) self.ppd.SetProfile(aniso) installed_aniso = self.ppd.GetProfile() - self.assertIsInstance(installed_aniso, ReflectionProfilePseudoVoigtAnisotropic) + self.assertIsInstance( + installed_aniso, ReflectionProfilePseudoVoigtAnisotropic + ) def test_tch_profile_width_and_limits(self): """TCH derives one common FWHM and reaches both pure limits.""" @@ -230,5 +236,140 @@ def test_anisotropic_set_profile_par(self): self.assertAlmostEqual(aniso.GetPar("G_KK").GetValue(), 2e-5) +def build_tof_pattern(crystal, profile): + """Return a TOF neutron powder pattern of crystal using profile.""" + pattern = PowderPattern() + pattern.SetRadiationType(RadiationType.RAD_NEUTRON) + pattern.GetRadiation().SetWavelengthType(WavelengthType.WAVELENGTH_TOF) + # TOF decreases with sin(theta)/lambda, so x is in descending order. + x = np.linspace(120000, 20000, 2001) + pattern.SetPowderPatternX(x) + pattern.SetPowderPatternObs(np.ones_like(x)) + diffraction = pattern.AddPowderPatternDiffraction(crystal) + diffraction.SetProfile(profile) + return pattern + + +def test_set_profile_par_tof(): + # Test that SetProfilePar assigns the ten TOF profile parameters + # Expected: Each refinable parameter has the value passed for it. + profile = ReflectionProfileDoubleExponentialPseudoVoigt() + profile.SetProfilePar( + instrumentAlpha0=0.01, + instrumentAlpha1=0.1, + instrumentBeta0=0.02, + instrumentBeta1=0.004, + gaussianSigma0=1.0, + gaussianSigma1=7.0, + gaussianSigma2=0.5, + lorentzianGamma0=0.1, + lorentzianGamma1=0.2, + lorentzianGamma2=0.4, + ) + actual_values = { + profile.GetPar(i).GetName(): profile.GetPar(i).GetValue() + for i in range(profile.GetNbPar()) + } + expected_values = { + "Alpha0": 0.01, + "Alpha1": 0.1, + "Beta0": 0.02, + "Beta1": 0.004, + "GaussianSigma0": 1.0, + "GaussianSigma1": 7.0, + "GaussianSigma2": 0.5, + "LorentzianGamma0": 0.1, + "LorentzianGamma1": 0.2, + "LorentzianGamma2": 0.4, + } + assert actual_values == pytest.approx(expected_values) + + +def test_set_profile_tof_without_unit_cell(loadcifdata): + # Test installing a TOF profile constructed without a unit cell + # Expected: SetProfile gives the profile the crystal's unit cell, so + # the strongest peak is the Si (220) reflection at + # TOF = DIFC * d + DIFA * d^2. + crystal = loadcifdata("Si.cif") + pattern = build_tof_pattern( + crystal, ReflectionProfileDoubleExponentialPseudoVoigt() + ) + calc = pattern.GetPowderPatternCalc() + x = pattern.GetPowderPatternX() + actual_peak_tof = x[np.argmax(calc)] + d_220 = crystal.a / np.sqrt(8) + expected_peak_tof = ( + pattern.GetPar("DIFC").GetValue() * d_220 + + pattern.GetPar("DIFA").GetValue() * d_220**2 + ) + tof_step = abs(x[1] - x[0]) + assert actual_peak_tof == pytest.approx(expected_peak_tof, abs=tof_step) + + +@pytest.mark.parametrize( + "parameter_name, new_value", + [ + # Test that changing a parameter of the installed TOF profile + # recalculates the pattern + # C1: The rising-edge exponential coefficient Alpha1 is changed. + # Expected: The pattern equals one calculated with Alpha1 set + # before the profile was installed. + ("Alpha1", 0.2), + # C2: The falling-edge exponential coefficient Beta0 is changed. + # Expected: The pattern equals one calculated with Beta0 set + # before the profile was installed. + ("Beta0", 0.05), + # C3: The Gaussian width coefficient GaussianSigma1 is changed. + # Expected: The pattern equals one calculated with GaussianSigma1 + # set before the profile was installed. + ("GaussianSigma1", 50.0), + # C4: The Lorentzian width coefficient LorentzianGamma2 is changed. + # Expected: The pattern equals one calculated with + # LorentzianGamma2 set before the profile was installed. + ("LorentzianGamma2", 2.0), + ], +) +def test_get_powder_pattern_calc_after_tof_profile_change( + loadcifdata, parameter_name, new_value +): + crystal = loadcifdata("Si.cif") + pattern = build_tof_pattern( + crystal, ReflectionProfileDoubleExponentialPseudoVoigt() + ) + pattern.GetPowderPatternCalc() + profile = pattern.GetPowderPatternComponent(0).GetProfile() + profile.GetPar(parameter_name).SetValue(new_value) + actual_calc = pattern.GetPowderPatternCalc() + expected_profile = ReflectionProfileDoubleExponentialPseudoVoigt(crystal) + expected_profile.GetPar(parameter_name).SetValue(new_value) + expected_calc = build_tof_pattern( + crystal, expected_profile + ).GetPowderPatternCalc() + assert np.allclose(actual_calc, expected_calc) + + +@pytest.mark.parametrize("copy_method", ["CreateCopy", "copy_constructor"]) +def test_tof_profile_copy_keeps_original_alive(loadcifdata, copy_method): + # Test that a copy of a TOF profile keeps its source and unit cell alive + # Expected: The original profile and crystal survive until the copy is + # deleted, since both profiles reference the same unit cell. + crystal = loadcifdata("Si.cif") + original = ReflectionProfileDoubleExponentialPseudoVoigt(crystal) + if copy_method == "CreateCopy": + copied = original.CreateCopy() + else: + copied = ReflectionProfileDoubleExponentialPseudoVoigt(original) + original_ref = weakref.ref(original) + crystal_ref = weakref.ref(crystal) + del original, crystal + gc.collect() + assert original_ref() is not None + assert crystal_ref() is not None + del copied + gc.collect() + assert original_ref() is None + assert crystal_ref() is None + + if __name__ == "__main__": unittest.main() diff --git a/tests/test_scatterer.py b/tests/test_scatterer.py index c68c89cf..d2abecec 100644 --- a/tests/test_scatterer.py +++ b/tests/test_scatterer.py @@ -1,10 +1,11 @@ #!/usr/bin/env python """Functional tests for the RefinableObj/ScatteringPower method surface restored on Scatterer/ScatteringPowerAtom (see -nanobind_migration_notes.md's "Follow-up: restoring RefinableObj's method -surface on virtually-inherited classes"; presence-only coverage across every -affected class lives in test_virtualbase_forwarding.py). These exercise the -actual behaviour, not just that the method exists. +nanobind_migration_notes.md's "Follow-up: restoring RefinableObj's +method surface on virtually-inherited classes"; presence-only coverage +across every affected class lives in test_virtualbase_forwarding.py). + +These exercise the actual behaviour, not just that the method exists. """ import io @@ -17,7 +18,8 @@ class TestScattererForwarding(unittest.TestCase): - """Atom reaches RefinableObj only through Scatterer's C++ virtual base.""" + """Atom reaches RefinableObj only through Scatterer's C++ virtual + base.""" def setUp(self): self.sp, self.atom = makeScatterer() @@ -62,9 +64,10 @@ def test_update_display(self): self.atom.UpdateDisplay() def test_get_clock_scatt_comp_list(self): - """Forwards a *protected* Scatterer member (mClockScattCompList); - unrelated to the virtual-inheritance issue (it's a plain omission) - but fixed in the same pass -- see PyScatterer in nb_scatterer.cpp.""" + """Forwards a *protected* Scatterer member + (mClockScattCompList); unrelated to the virtual-inheritance + issue (it's a plain omission) but fixed in the same pass -- see + PyScatterer in nb_scatterer.cpp.""" clock = self.atom.GetClockScattCompList() self.assertIsInstance(clock, RefinableObjClock) @@ -86,9 +89,10 @@ def test_create_param_set_roundtrip(self): class TestScatteringPowerAtomForwarding(unittest.TestCase): """ScatteringPowerAtom inherits ScatteringPower virtually, and - ScatteringPower inherits RefinableObj virtually too -- a second hop, so - both bind_refinableobj_forwarding() and - bind_scatteringpower_forwarding() had to be applied directly to it.""" + ScatteringPower inherits RefinableObj virtually too -- a second hop, + so both bind_refinableobj_forwarding() and + bind_scatteringpower_forwarding() had to be applied directly to + it.""" def setUp(self): self.sp, self.atom = makeScatterer() @@ -105,8 +109,9 @@ def test_log_likelihood(self): self.assertEqual(0.0, self.sp.GetLogLikelihood()) def test_scatteringpower_own_methods_forwarded(self): - """These are ScatteringPower's *own* methods (not RefinableObj's), - forwarded via bind_scatteringpower_forwarding().""" + """These are ScatteringPower's *own* methods (not + RefinableObj's), forwarded via + bind_scatteringpower_forwarding().""" self.assertGreaterEqual(self.sp.GetDynPopCorrIndex(), 0) self.assertIsNotNone(self.sp.GetLastChangeClock()) r, g, b = self.sp.GetColourRGB() @@ -114,8 +119,9 @@ def test_scatteringpower_own_methods_forwarded(self): def test_lsq_methods_reachable_and_raise_when_unset(self): """Ported forward alongside the forwarding fix: GetLSQCalc/Obs/ - Weight/Deriv exist on RefinableObj and are therefore forwarded here - too, even though nothing has configured a custom LSQ target.""" + Weight/Deriv exist on RefinableObj and are therefore forwarded + here too, even though nothing has configured a custom LSQ + target.""" with self.assertRaises(ObjCrystException): self.sp.GetLSQCalc(0) diff --git a/tests/test_virtualbase_forwarding.py b/tests/test_virtualbase_forwarding.py index c497f29b..be32f2b3 100644 --- a/tests/test_virtualbase_forwarding.py +++ b/tests/test_virtualbase_forwarding.py @@ -1,5 +1,6 @@ #!/usr/bin/env python -"""Coverage guard for the RefinableObj/ScatteringPower method-forwarding fix. +"""Coverage guard for the RefinableObj/ScatteringPower method-forwarding +fix. Scatterer, ScatteringPower, ScatteringData, and PowderPatternComponent all inherit RefinableObj *virtually* in C++, so nanobind cannot declare @@ -46,8 +47,8 @@ def _public_methods(cls): class TestRefinableObjSurfaceForwarding(unittest.TestCase): - """Every RefinableObj method must be reachable on the four classes that - only reach RefinableObj through a C++ virtual base.""" + """Every RefinableObj method must be reachable on the four classes + that only reach RefinableObj through a C++ virtual base.""" def _assert_full_coverage(self, cls): missing = [m for m in REFINABLEOBJ_METHODS if not hasattr(cls, m)] @@ -108,9 +109,10 @@ def test_globalscatteringpower(self): class TestScatteringPowerSurfaceForwarding(unittest.TestCase): - """ScatteringPowerAtom and GlobalScatteringPower need ScatteringPower's - own method surface (GetScatteringFactor, GetBij/SetBij, GetColour, ...) - forwarded too, on top of RefinableObj's.""" + """ScatteringPowerAtom and GlobalScatteringPower need + ScatteringPower's own method surface (GetScatteringFactor, + GetBij/SetBij, GetColour, ...) forwarded too, on top of + RefinableObj's.""" def _assert_full_coverage(self, cls): missing = [m for m in SCATTERINGPOWER_METHODS if not hasattr(cls, m)] From efddce85910503a52fb303bea97a172d6c1bfbc4 Mon Sep 17 00:00:00 2001 From: SYMSCAE Date: Tue, 3 Nov 2026 10:13:20 -0800 Subject: [PATCH 07/21] Fix lifetime management regressions in Atom bindings --- news/fix-atom-scatteringpower-lifetime.rst | 24 ++++++++++++++++++++++ src/extensions/nb_atom.cpp | 8 +++++--- 2 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 news/fix-atom-scatteringpower-lifetime.rst diff --git a/news/fix-atom-scatteringpower-lifetime.rst b/news/fix-atom-scatteringpower-lifetime.rst new file mode 100644 index 00000000..90042c54 --- /dev/null +++ b/news/fix-atom-scatteringpower-lifetime.rst @@ -0,0 +1,24 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* Preserve scattering power lifetimes in nanobind Atom construction, + copying, and initialization to prevent use-after-free crashes. + +**Security:** + +* diff --git a/src/extensions/nb_atom.cpp b/src/extensions/nb_atom.cpp index 8516522d..6450029c 100644 --- a/src/extensions/nb_atom.cpp +++ b/src/extensions/nb_atom.cpp @@ -56,7 +56,7 @@ void wrap_atom(nb::module_& m) .def("__init__", [](Atom* self, const Atom& old) { new (self) Atom(old); - }, nb::arg("old")) + }, nb::arg("old"), nb::keep_alive<1,2>()) .def("__init__", [](Atom* self, REAL x, REAL y, REAL z, const std::string& name, nb::object pow, REAL popu) { @@ -64,7 +64,8 @@ void wrap_atom(nb::module_& m) new (self) Atom(x, y, z, name, sp, popu); }, nb::arg("x"), nb::arg("y"), nb::arg("z"), nb::arg("name"), - nb::arg("pow").none(), nb::arg("popu") = (REAL)1.0) + nb::arg("pow").none(), nb::arg("popu") = (REAL)1.0, + nb::keep_alive<1,6>()) .def("Init", [](Atom& self, REAL x, REAL y, REAL z, const std::string& name, nb::object pow, REAL popu) { @@ -72,7 +73,8 @@ void wrap_atom(nb::module_& m) self.Init(x, y, z, name, sp, popu); }, nb::arg("x"), nb::arg("y"), nb::arg("z"), nb::arg("name"), - nb::arg("pow").none(), nb::arg("popu") = (REAL)1.0) + nb::arg("pow").none(), nb::arg("popu") = (REAL)1.0, + nb::keep_alive<1,6>()) .def("GetMass", &Atom::GetMass) .def("GetRadius", &Atom::GetRadius) .def("IsDummy", &Atom::IsDummy) From 12b9087c5bd5baf7a872bcbecdf8b24af8e8b638 Mon Sep 17 00:00:00 2001 From: Vincent Favre-Nicolin Date: Wed, 4 Nov 2026 08:42:20 +0100 Subject: [PATCH 08/21] test: add Atom/ScatteringPower lifetime tests (#123) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- tests/test_atom.py | 118 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 tests/test_atom.py diff --git a/tests/test_atom.py b/tests/test_atom.py new file mode 100644 index 00000000..38f0e185 --- /dev/null +++ b/tests/test_atom.py @@ -0,0 +1,118 @@ +#!/usr/bin/env python +"""Lifetime tests for Atom and its ScatteringPower (see issue #123). + +An Atom only stores a raw pointer to its ScatteringPower and calls +``DeRegisterClient`` on it in its destructor, so the Python Atom must keep +the Python ScatteringPower alive. +""" + +import gc +import os +import subprocess +import sys +import textwrap + +import pytest + +from pyobjcryst.atom import Atom +from pyobjcryst.scatteringpower import ScatteringPowerAtom + + +def _refcount(obj): + gc.collect() + return sys.getrefcount(obj) + + +# The refcount tests below never let a ScatteringPower die before its Atom, +# so that they fail cleanly (instead of crashing pytest) without the fix. + + +def test_constructor_keeps_scattering_power_alive(): + sp = ScatteringPowerAtom("Ni", "Ni") + before = _refcount(sp) + atom = Atom(0, 0, 0, "Ni", sp) + delta = _refcount(sp) - before + del atom + assert delta >= 1 + + +def test_init_keeps_scattering_power_alive(): + sp1 = ScatteringPowerAtom("Ni", "Ni") + sp2 = ScatteringPowerAtom("O", "O") + atom = Atom(0, 0, 0, "Ni", sp1) + before = _refcount(sp2) + atom.Init(0.1, 0.2, 0.3, "O", sp2) + delta = _refcount(sp2) - before + symbol = atom.GetScatteringPower().GetSymbol() + del atom + assert delta >= 1 + assert symbol == "O" + + +def test_copy_constructor_keeps_original_alive(): + sp = ScatteringPowerAtom("Ni", "Ni") + atom = Atom(0, 0, 0, "Ni", sp) + before = _refcount(atom) + copy = Atom(atom) + delta = _refcount(atom) - before + symbol = copy.GetScatteringPower().GetSymbol() + del copy, atom + assert delta >= 1 + assert symbol == "Ni" + + +@pytest.mark.parametrize( + "script", + [ + # Atom constructed from a temporary ScatteringPower. + """ + atom = Atom(0, 0, 0, "Ni", ScatteringPowerAtom("Ni", "Ni")) + gc.collect() + assert atom.GetScatteringPower().GetSymbol() == "Ni" + del atom + """, + # Atom re-initialized with a temporary ScatteringPower. + """ + atom = Atom(0, 0, 0, "Ni", ScatteringPowerAtom("Ni", "Ni")) + atom.Init(0, 0, 0, "O", ScatteringPowerAtom("O", "O")) + gc.collect() + assert atom.GetScatteringPower().GetSymbol() == "O" + del atom + """, + # Copy outliving both the original Atom and the ScatteringPower. + """ + sp = ScatteringPowerAtom("Ni", "Ni") + atom = Atom(0, 0, 0, "Ni", sp) + copy = Atom(atom) + del sp, atom + gc.collect() + assert copy.GetScatteringPower().GetSymbol() == "Ni" + del copy + """, + # Dummy atom (no ScatteringPower) must still work. + """ + atom = Atom(0, 0, 0, "dummy", None) + assert atom.IsDummy() + assert atom.GetScatteringPower() is None + atom.Init(0, 0, 0, "dummy2", None) + assert atom.IsDummy() + del atom + """, + ], +) +def test_scattering_power_outlived_by_atom(script): + # Run in a subprocess so that a use-after-free crash is reported as a + # test failure rather than killing pytest. Freed memory is scribbled + # (macOS / glibc) to make such a crash deterministic. + code = ( + "import gc\n" + "from pyobjcryst.atom import Atom\n" + "from pyobjcryst.scatteringpower import ScatteringPowerAtom\n" + + textwrap.dedent(script) + + "gc.collect()\n" + ) + env = dict(os.environ, MallocScribble="1", MALLOC_PERTURB_="85") + result = subprocess.run( + [sys.executable, "-c", code], capture_output=True, text=True, env=env + ) + assert result.returncode == 0, result.stderr From 34528134963a14aa7e8894c630ec57e458286791 Mon Sep 17 00:00:00 2001 From: William Huang Date: Wed, 4 Nov 2026 00:19:16 -0800 Subject: [PATCH 09/21] Fix lifetime management regressions in Atom bindings (#124) * Fix lifetime management regressions in Atom bindings * test: add Atom/ScatteringPower lifetime tests (#123) --------- Co-authored-by: Vincent Favre-Nicolin Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- news/fix-atom-scatteringpower-lifetime.rst | 24 +++++ src/extensions/nb_atom.cpp | 8 +- tests/test_atom.py | 118 +++++++++++++++++++++ 3 files changed, 147 insertions(+), 3 deletions(-) create mode 100644 news/fix-atom-scatteringpower-lifetime.rst create mode 100644 tests/test_atom.py diff --git a/news/fix-atom-scatteringpower-lifetime.rst b/news/fix-atom-scatteringpower-lifetime.rst new file mode 100644 index 00000000..90042c54 --- /dev/null +++ b/news/fix-atom-scatteringpower-lifetime.rst @@ -0,0 +1,24 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* Preserve scattering power lifetimes in nanobind Atom construction, + copying, and initialization to prevent use-after-free crashes. + +**Security:** + +* diff --git a/src/extensions/nb_atom.cpp b/src/extensions/nb_atom.cpp index 8516522d..6450029c 100644 --- a/src/extensions/nb_atom.cpp +++ b/src/extensions/nb_atom.cpp @@ -56,7 +56,7 @@ void wrap_atom(nb::module_& m) .def("__init__", [](Atom* self, const Atom& old) { new (self) Atom(old); - }, nb::arg("old")) + }, nb::arg("old"), nb::keep_alive<1,2>()) .def("__init__", [](Atom* self, REAL x, REAL y, REAL z, const std::string& name, nb::object pow, REAL popu) { @@ -64,7 +64,8 @@ void wrap_atom(nb::module_& m) new (self) Atom(x, y, z, name, sp, popu); }, nb::arg("x"), nb::arg("y"), nb::arg("z"), nb::arg("name"), - nb::arg("pow").none(), nb::arg("popu") = (REAL)1.0) + nb::arg("pow").none(), nb::arg("popu") = (REAL)1.0, + nb::keep_alive<1,6>()) .def("Init", [](Atom& self, REAL x, REAL y, REAL z, const std::string& name, nb::object pow, REAL popu) { @@ -72,7 +73,8 @@ void wrap_atom(nb::module_& m) self.Init(x, y, z, name, sp, popu); }, nb::arg("x"), nb::arg("y"), nb::arg("z"), nb::arg("name"), - nb::arg("pow").none(), nb::arg("popu") = (REAL)1.0) + nb::arg("pow").none(), nb::arg("popu") = (REAL)1.0, + nb::keep_alive<1,6>()) .def("GetMass", &Atom::GetMass) .def("GetRadius", &Atom::GetRadius) .def("IsDummy", &Atom::IsDummy) diff --git a/tests/test_atom.py b/tests/test_atom.py new file mode 100644 index 00000000..38f0e185 --- /dev/null +++ b/tests/test_atom.py @@ -0,0 +1,118 @@ +#!/usr/bin/env python +"""Lifetime tests for Atom and its ScatteringPower (see issue #123). + +An Atom only stores a raw pointer to its ScatteringPower and calls +``DeRegisterClient`` on it in its destructor, so the Python Atom must keep +the Python ScatteringPower alive. +""" + +import gc +import os +import subprocess +import sys +import textwrap + +import pytest + +from pyobjcryst.atom import Atom +from pyobjcryst.scatteringpower import ScatteringPowerAtom + + +def _refcount(obj): + gc.collect() + return sys.getrefcount(obj) + + +# The refcount tests below never let a ScatteringPower die before its Atom, +# so that they fail cleanly (instead of crashing pytest) without the fix. + + +def test_constructor_keeps_scattering_power_alive(): + sp = ScatteringPowerAtom("Ni", "Ni") + before = _refcount(sp) + atom = Atom(0, 0, 0, "Ni", sp) + delta = _refcount(sp) - before + del atom + assert delta >= 1 + + +def test_init_keeps_scattering_power_alive(): + sp1 = ScatteringPowerAtom("Ni", "Ni") + sp2 = ScatteringPowerAtom("O", "O") + atom = Atom(0, 0, 0, "Ni", sp1) + before = _refcount(sp2) + atom.Init(0.1, 0.2, 0.3, "O", sp2) + delta = _refcount(sp2) - before + symbol = atom.GetScatteringPower().GetSymbol() + del atom + assert delta >= 1 + assert symbol == "O" + + +def test_copy_constructor_keeps_original_alive(): + sp = ScatteringPowerAtom("Ni", "Ni") + atom = Atom(0, 0, 0, "Ni", sp) + before = _refcount(atom) + copy = Atom(atom) + delta = _refcount(atom) - before + symbol = copy.GetScatteringPower().GetSymbol() + del copy, atom + assert delta >= 1 + assert symbol == "Ni" + + +@pytest.mark.parametrize( + "script", + [ + # Atom constructed from a temporary ScatteringPower. + """ + atom = Atom(0, 0, 0, "Ni", ScatteringPowerAtom("Ni", "Ni")) + gc.collect() + assert atom.GetScatteringPower().GetSymbol() == "Ni" + del atom + """, + # Atom re-initialized with a temporary ScatteringPower. + """ + atom = Atom(0, 0, 0, "Ni", ScatteringPowerAtom("Ni", "Ni")) + atom.Init(0, 0, 0, "O", ScatteringPowerAtom("O", "O")) + gc.collect() + assert atom.GetScatteringPower().GetSymbol() == "O" + del atom + """, + # Copy outliving both the original Atom and the ScatteringPower. + """ + sp = ScatteringPowerAtom("Ni", "Ni") + atom = Atom(0, 0, 0, "Ni", sp) + copy = Atom(atom) + del sp, atom + gc.collect() + assert copy.GetScatteringPower().GetSymbol() == "Ni" + del copy + """, + # Dummy atom (no ScatteringPower) must still work. + """ + atom = Atom(0, 0, 0, "dummy", None) + assert atom.IsDummy() + assert atom.GetScatteringPower() is None + atom.Init(0, 0, 0, "dummy2", None) + assert atom.IsDummy() + del atom + """, + ], +) +def test_scattering_power_outlived_by_atom(script): + # Run in a subprocess so that a use-after-free crash is reported as a + # test failure rather than killing pytest. Freed memory is scribbled + # (macOS / glibc) to make such a crash deterministic. + code = ( + "import gc\n" + "from pyobjcryst.atom import Atom\n" + "from pyobjcryst.scatteringpower import ScatteringPowerAtom\n" + + textwrap.dedent(script) + + "gc.collect()\n" + ) + env = dict(os.environ, MallocScribble="1", MALLOC_PERTURB_="85") + result = subprocess.run( + [sys.executable, "-c", code], capture_output=True, text=True, env=env + ) + assert result.returncode == 0, result.stderr From 2b74b6ffdcc997a6508209475a9f9722643eb477 Mon Sep 17 00:00:00 2001 From: SYMSCAE Date: Sat, 7 Nov 2026 18:13:01 -0800 Subject: [PATCH 10/21] build: build self-contained PyPI wheels with cibuildwheel The published wheels needed libObjCryst/libboost_python (Linux, macOS, Windows) from a conda environment: the old shared wheel workflow ran auditwheel and then removed the bundled libraries and pointed RPATH at the conda prefix. The nanobind build links ObjCryst++, cctbx and newmat statically and Boost is header-only, so build the wheels with cibuildwheel: - add [tool.cibuildwheel] (cp312-cp315; manylinux x86_64, macOS native, Windows AMD64; tests run on every wheel) - use the cibuildwheel shared workflow from SYMSCAE/release-scripts until it is released in scikit-package/release-scripts@v0 - derive the version from git tags with setuptools-scm instead of the static 2026.2.0rc0 placeholder - declare packaging as a runtime dependency (used by powderpattern) - trim unused ObjCryst++ submodule parts from the sdist - guard the GCC-only -O0 flag and add MSVC settings in CMakeLists.txt - ship the licenses of the statically linked code in the wheel Co-Authored-By: Claude Opus 5.5 --- .../workflows/build-wheel-release-upload.yml | 7 ++- CMakeLists.txt | 27 ++++++++-- nanobind_migration_notes.md | 19 ++++--- news/cibuildwheel-wheels.rst | 25 +++++++++ news/nanobind-packaging.rst | 1 - pyproject.toml | 54 ++++++++++++++++--- requirements/pip.txt | 1 + 7 files changed, 113 insertions(+), 21 deletions(-) create mode 100644 news/cibuildwheel-wheels.rst diff --git a/.github/workflows/build-wheel-release-upload.yml b/.github/workflows/build-wheel-release-upload.yml index 42b91f71..63897b13 100644 --- a/.github/workflows/build-wheel-release-upload.yml +++ b/.github/workflows/build-wheel-release-upload.yml @@ -23,8 +23,13 @@ jobs: # # Choose this for open-source packages distributed via PyPI and/or # conda-forge where broad public availability is the goal. + # + # Wheels are built with cibuildwheel using [tool.cibuildwheel] in + # pyproject.toml. + # TODO: switch back to scikit-package/release-scripts@v0 once the + # cibuildwheel change is released there. build-release: - uses: scikit-package/release-scripts/.github/workflows/_build-wheel-release-upload.yml@v0 + uses: SYMSCAE/release-scripts/.github/workflows/_build-wheel-release-upload.yml@cibuildwheel with: project: pyobjcryst submodules: "true" diff --git a/CMakeLists.txt b/CMakeLists.txt index 26b23b87..11065343 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -152,10 +152,21 @@ target_compile_definitions(ObjCryst PUBLIC target_link_libraries(ObjCryst PUBLIC cctbx newmat) # Put VFNDebug.cpp first so debug-level constants are defined before use -set_source_files_properties( - "${OBJCRYST_SRC}/Quirks/VFNDebug.cpp" - PROPERTIES COMPILE_FLAGS "-O0" -) +if(NOT MSVC) + set_source_files_properties( + "${OBJCRYST_SRC}/Quirks/VFNDebug.cpp" + PROPERTIES COMPILE_FLAGS "-O0" + ) +endif() + +# MSVC: same settings as the libobjcryst Windows build (/EHsc, M_PI etc.), +# plus /bigobj for the large binding translation units. +if(MSVC) + foreach(_tgt newmat cctbx ObjCryst) + target_compile_definitions(${_tgt} PUBLIC _USE_MATH_DEFINES NOMINMAX) + target_compile_options(${_tgt} PUBLIC /EHsc /bigobj) + endforeach() +endif() # --------------------------------------------------------------------------- # nanobind extension: _pyobjcryst @@ -178,3 +189,11 @@ target_link_libraries(_pyobjcryst PRIVATE ObjCryst) # Install into pyobjcryst package install(TARGETS _pyobjcryst LIBRARY DESTINATION pyobjcryst) + +# Licenses of the statically linked third-party code ship with the wheel. +install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/extern/objcryst/LICENSE.txt" + DESTINATION pyobjcryst/licenses/objcryst) +install(FILES "${CCTBX_SRC}/LICENSE_2_0.txt" "${CCTBX_SRC}/COPYRIGHT_2_0.txt" + DESTINATION pyobjcryst/licenses/cctbx) +install(FILES "${NEWMAT_SRC}/readme.txt" "${NEWMAT_SRC}/nm11.htm" + DESTINATION pyobjcryst/licenses/newmat) diff --git a/nanobind_migration_notes.md b/nanobind_migration_notes.md index 57eb662c..5f2c75c0 100644 --- a/nanobind_migration_notes.md +++ b/nanobind_migration_notes.md @@ -40,15 +40,18 @@ Known, accepted gaps — real, not oversights, but still open: The `Molecule`↔`MolAtom` cycle is fixed. `Crystal`↔`Scatterer`/`Molecule`/`ScatteringPower` cycles remain (56 leaked instances in the current full-suite run) — not safe to fix the same way, see [keep_alive Reference Cycles](#keep_alive-reference-cycles). Not blocking functionality. -- **CI has not been exercised against this build.** `.github/workflows/` is inherited from `main` - unmodified (it calls a shared reusable workflow); it has never actually run against the - nanobind/CMake build because nothing on this branch has been pushed yet. -- **Cross-platform**: everything above has been built and tested on Linux only. macOS/Windows are - unverified. +- **Wheel builds**: PyPI wheels are built with `cibuildwheel` by the shared release workflow, + configured in `[tool.cibuildwheel]` in `pyproject.toml`. The old shared workflow stripped the + libraries `auditwheel` had bundled, so those wheels only worked inside a conda environment. + The cibuildwheel version of the shared workflow is not released yet: + `build-wheel-release-upload.yml` points at `SYMSCAE/release-scripts@cibuildwheel` for now and + must be switched back to `scikit-package/release-scripts@v0` once it is. +- **Cross-platform**: Linux, macOS (x86_64/arm64) and Windows wheels are built and tested by + cibuildwheel in the release workflow. - **Performance**: not benchmarked against Boost.Python. -- **Versioning**: `pyproject.toml` uses a static version (`2026.2.0rc0`) instead of - `main`'s dynamic tag-based versioning (`setuptools-git-versioning`) — scikit-build-core needs a - different mechanism for that; flagged as a `TODO` in `pyproject.toml` itself, not yet resolved. +- **Versioning**: the version comes from the git tag via `setuptools-scm` + (`metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"`), replacing + `main`'s `setuptools-git-versioning`. Builds need the tags (`fetch-depth: 0` in CI). None of the above blocks day-to-day use of the library from Python — every method that was reachable under Boost.Python is reachable under nanobind (modulo the override caveat above, which diff --git a/news/cibuildwheel-wheels.rst b/news/cibuildwheel-wheels.rst new file mode 100644 index 00000000..87862f2e --- /dev/null +++ b/news/cibuildwheel-wheels.rst @@ -0,0 +1,25 @@ +**Added:** + +* + +**Changed:** + +* Build the PyPI wheels with ``cibuildwheel`` (manylinux, macOS x86_64/arm64 and Windows AMD64), configured in ``[tool.cibuildwheel]`` in ``pyproject.toml``. +* The package version is now derived from the git tag via ``setuptools-scm``. + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* PyPI wheels are now self-contained and no longer need ``libObjCryst`` or ``libboost_python`` from a conda environment; previously ``import pyobjcryst`` failed in a plain virtual environment. +* Declare ``packaging`` as a runtime dependency (used by ``pyobjcryst.powderpattern``). + +**Security:** + +* diff --git a/news/nanobind-packaging.rst b/news/nanobind-packaging.rst index 6419c7fb..6d6fa3f0 100644 --- a/news/nanobind-packaging.rst +++ b/news/nanobind-packaging.rst @@ -5,7 +5,6 @@ **Changed:** * Boost headers are now taken from the PyPI ``libboost-headers`` package when building with pip, falling back to system/conda Boost headers (or ``-DBOOST_INCLUDE_DIR=``). -* Set package version to ``2026.2.0rc0``. **Deprecated:** diff --git a/pyproject.toml b/pyproject.toml index ea0624b5..d70a14b8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,14 +1,16 @@ [build-system] -requires = ["scikit-build-core>=0.9", "nanobind", "numpy", "libboost-headers"] +requires = [ + "scikit-build-core>=0.10", + "setuptools-scm>=8", + "nanobind", + "numpy", + "libboost-headers", +] build-backend = "scikit_build_core.build" [project] name = "pyobjcryst" -# TODO: main uses setuptools-git-versioning (dynamic, tag-based) with -# setuptools.build_meta; scikit-build-core needs a different dynamic-version -# provider to match that exactly. Pinned as a static placeholder for now -- -# revisit before release, see nanobind_migration_notes.md. -version = "2026.2.0rc0" +dynamic = ["version"] authors = [ { name="Christopher Farrow" }, { name="Pavol Juhás" }, @@ -22,7 +24,7 @@ description = "Python bindings to the ObjCryst++ library." keywords = ['objcryst', 'atom structure crystallography', 'powder diffraction'] readme = "README.rst" requires-python = ">=3.12, <3.16" -dependencies = ["numpy"] +dependencies = ["numpy", "packaging"] classifiers = [ 'Development Status :: 5 - Production/Stable', 'Environment :: Console', @@ -52,8 +54,46 @@ Issues = "https://github.com/diffpy/pyobjcryst/issues/" pyobjcryst = "pyobjcryst.pyobjcryst_app:main" [tool.scikit-build] +minimum-version = "build-system.requires" cmake.build-type = "Release" wheel.packages = ["src/pyobjcryst"] +sdist.cmake = true +sdist.exclude = [ + "build", + "dist", + ".pytest_cache", + # Parts of the ObjCryst++ submodule not needed to build the extension. + "extern/objcryst/Fox", + "extern/objcryst/test", + "extern/objcryst/ObjCryst/doc", + "extern/objcryst/ObjCryst/example", +] +metadata.version.provider = "scikit_build_core.metadata.setuptools_scm" + +[tool.setuptools_scm] +version_scheme = "no-guess-dev" + +# PyPI wheels: ObjCryst++, cctbx and newmat are built from extern/ and linked +# statically, Boost is header-only and nanobind is linked statically, so the +# wheels install into any environment without conda or system libraries. +[tool.cibuildwheel] +build = ["cp312-*", "cp313-*", "cp314-*", "cp315-*"] +skip = ["*-musllinux_*"] +test-requires = ["pytest"] +# The tests open tests/testdata/* relative to the working directory. +test-sources = ["tests"] +test-command = "pytest tests" + +[tool.cibuildwheel.linux] +archs = ["x86_64"] + +[tool.cibuildwheel.macos] +archs = ["native"] +environment = { MACOSX_DEPLOYMENT_TARGET = "11.0" } + +# No Windows ARM64 wheels. +[tool.cibuildwheel.windows] +archs = ["AMD64"] [tool.codespell] exclude-file = ".codespell/ignore_lines.txt" diff --git a/requirements/pip.txt b/requirements/pip.txt index e1eb2554..f70a1e26 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -1,3 +1,4 @@ setuptools numpy +packaging libboost-headers From 7951366742008735c4447f917efe124b6f1aac79 Mon Sep 17 00:00:00 2001 From: SYMSCAE Date: Sun, 8 Nov 2026 16:26:08 -0800 Subject: [PATCH 11/21] ci: update workflow --- .github/workflows/build-wheel-release-upload.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-wheel-release-upload.yml b/.github/workflows/build-wheel-release-upload.yml index 63897b13..375e2480 100644 --- a/.github/workflows/build-wheel-release-upload.yml +++ b/.github/workflows/build-wheel-release-upload.yml @@ -24,16 +24,17 @@ jobs: # Choose this for open-source packages distributed via PyPI and/or # conda-forge where broad public availability is the goal. # - # Wheels are built with cibuildwheel using [tool.cibuildwheel] in - # pyproject.toml. + # build_c_ext_with_cibw builds the wheels with cibuildwheel using + # [tool.cibuildwheel] in pyproject.toml. # TODO: switch back to scikit-package/release-scripts@v0 once the - # cibuildwheel change is released there. + # cibw change is released there. build-release: - uses: SYMSCAE/release-scripts/.github/workflows/_build-wheel-release-upload.yml@cibuildwheel + uses: SYMSCAE/release-scripts/.github/workflows/_build-wheel-release-upload.yml@cibw with: project: pyobjcryst submodules: "true" c_extension: true + build_c_ext_with_cibw: true maintainer_github_username: sbillinge secrets: PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} From def1a60fe548a288520c789af68a331c15e1f3ec Mon Sep 17 00:00:00 2001 From: SYMSCAE Date: Mon, 9 Nov 2026 18:41:51 -0800 Subject: [PATCH 12/21] ci: switch link to upstream v0 --- .github/workflows/build-wheel-release-upload.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-wheel-release-upload.yml b/.github/workflows/build-wheel-release-upload.yml index 375e2480..2be83306 100644 --- a/.github/workflows/build-wheel-release-upload.yml +++ b/.github/workflows/build-wheel-release-upload.yml @@ -29,7 +29,7 @@ jobs: # TODO: switch back to scikit-package/release-scripts@v0 once the # cibw change is released there. build-release: - uses: SYMSCAE/release-scripts/.github/workflows/_build-wheel-release-upload.yml@cibw + uses: scikit-package/release-scripts/.github/workflows/_build-wheel-release-upload.yml@v0 with: project: pyobjcryst submodules: "true" From 4d8552d12962759b30cd1a3b93c2420d846c5436 Mon Sep 17 00:00:00 2001 From: SYMSCAE Date: Mon, 9 Nov 2026 18:43:04 -0800 Subject: [PATCH 13/21] doc: cleanup todo --- .github/workflows/build-wheel-release-upload.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build-wheel-release-upload.yml b/.github/workflows/build-wheel-release-upload.yml index 2be83306..a4247d09 100644 --- a/.github/workflows/build-wheel-release-upload.yml +++ b/.github/workflows/build-wheel-release-upload.yml @@ -26,8 +26,6 @@ jobs: # # build_c_ext_with_cibw builds the wheels with cibuildwheel using # [tool.cibuildwheel] in pyproject.toml. - # TODO: switch back to scikit-package/release-scripts@v0 once the - # cibw change is released there. build-release: uses: scikit-package/release-scripts/.github/workflows/_build-wheel-release-upload.yml@v0 with: From 3492bdeda349ea42ab3abcd57951f8cddb7461e0 Mon Sep 17 00:00:00 2001 From: Clemens Schmid Date: Fri, 13 Nov 2026 16:29:26 +0100 Subject: [PATCH 14/21] fix: return numpy arrays from CrystVector/CrystMatrix bindings nanobind has no global converter for CrystVector_REAL/CrystMatrix_REAL, so bindings that returned them directly raised when called. Wrap them in crystvec_to_array/crystmat_to_array: - UnitCell.GetLatticePar(), UnitCell.GetOrthonormalCoords() - Crystal.GetMinDistanceTable() - ScatteringPower.GetScatteringFactor(), GetTemperatureFactor(), GetResonantScattFactReal(), GetResonantScattFactImag(), (both in the base binding and in the forwarding for ScatteringPowerAtom and GlobalScatteringPower) Add tests that call each method, plus a check that no binding's signature still returns a raw CrystVector/CrystMatrix. fixes #127 --- src/extensions/helpers_nb.hpp | 18 +++- src/extensions/nb_crystal.cpp | 3 +- src/extensions/nb_scatteringpower.cpp | 16 +++- src/extensions/nb_unitcell.cpp | 6 +- tests/test_array_returns.py | 117 ++++++++++++++++++++++++++ 5 files changed, 149 insertions(+), 11 deletions(-) create mode 100644 tests/test_array_returns.py diff --git a/src/extensions/helpers_nb.hpp b/src/extensions/helpers_nb.hpp index cf3ccbfb..01aa1007 100644 --- a/src/extensions/helpers_nb.hpp +++ b/src/extensions/helpers_nb.hpp @@ -477,18 +477,28 @@ void bind_refinableobj_forwarding(nb::class_& cls) ; } +namespace ObjCryst { class ScatteringData; } + template void bind_scatteringpower_forwarding(nb::class_& cls) { cls - .def("GetScatteringFactor", &T::GetScatteringFactor, + .def("GetScatteringFactor", + [](T& sp, const ObjCryst::ScatteringData& data, const int idx){ + return crystvec_to_array(sp.GetScatteringFactor(data, idx)); }, nb::arg("data"), nb::arg("spgSymPosIndex") = -1) .def("GetForwardScatteringFactor", &T::GetForwardScatteringFactor) - .def("GetTemperatureFactor", &T::GetTemperatureFactor, + .def("GetTemperatureFactor", + [](T& sp, const ObjCryst::ScatteringData& data, const int idx){ + return crystvec_to_array(sp.GetTemperatureFactor(data, idx)); }, nb::arg("data"), nb::arg("spgSymPosIndex") = -1) - .def("GetResonantScattFactReal", &T::GetResonantScattFactReal, + .def("GetResonantScattFactReal", + [](T& sp, const ObjCryst::ScatteringData& data, const int idx){ + return crystmat_to_array(sp.GetResonantScattFactReal(data, idx)); }, nb::arg("data"), nb::arg("spgSymPosIndex") = -1) - .def("GetResonantScattFactImag", &T::GetResonantScattFactImag, + .def("GetResonantScattFactImag", + [](T& sp, const ObjCryst::ScatteringData& data, const int idx){ + return crystmat_to_array(sp.GetResonantScattFactImag(data, idx)); }, nb::arg("data"), nb::arg("spgSymPosIndex") = -1) .def("IsScatteringFactorAnisotropic", &T::IsScatteringFactorAnisotropic) .def("IsTemperatureFactorAnisotropic", &T::IsTemperatureFactorAnisotropic) diff --git a/src/extensions/nb_crystal.cpp b/src/extensions/nb_crystal.cpp index 74e961c0..887c603e 100644 --- a/src/extensions/nb_crystal.cpp +++ b/src/extensions/nb_crystal.cpp @@ -284,7 +284,8 @@ void wrap_crystal(nb::module_& m) .def("GetScatteringComponentList", &_GetScatteringComponentList) .def("GetClockScattCompList", &Crystal::GetClockScattCompList, nb::rv_policy::reference_internal) - .def("GetMinDistanceTable", &Crystal::GetMinDistanceTable, + .def("GetMinDistanceTable", + [](const Crystal& c, double d){ return crystmat_to_array(c.GetMinDistanceTable(d)); }, nb::arg("minDistance") = 1.0) .def("PrintMinDistanceTable", [](const Crystal& c, double d){ c.PrintMinDistanceTable(d); }, diff --git a/src/extensions/nb_scatteringpower.cpp b/src/extensions/nb_scatteringpower.cpp index fad2ee43..507ed4ce 100644 --- a/src/extensions/nb_scatteringpower.cpp +++ b/src/extensions/nb_scatteringpower.cpp @@ -76,14 +76,22 @@ void wrap_scatteringpower(nb::module_& m) nb::class_ cls(m, "ScatteringPower"); cls - .def("GetScatteringFactor", &ScatteringPower::GetScatteringFactor, + .def("GetScatteringFactor", + [](ScatteringPower& sp, const ScatteringData& data, const int idx){ + return crystvec_to_array(sp.GetScatteringFactor(data, idx)); }, nb::arg("data"), nb::arg("spgSymPosIndex") = -1) .def("GetForwardScatteringFactor", &ScatteringPower::GetForwardScatteringFactor) - .def("GetTemperatureFactor", &ScatteringPower::GetTemperatureFactor, + .def("GetTemperatureFactor", + [](ScatteringPower& sp, const ScatteringData& data, const int idx){ + return crystvec_to_array(sp.GetTemperatureFactor(data, idx)); }, nb::arg("data"), nb::arg("spgSymPosIndex") = -1) - .def("GetResonantScattFactReal", &ScatteringPower::GetResonantScattFactReal, + .def("GetResonantScattFactReal", + [](ScatteringPower& sp, const ScatteringData& data, const int idx){ + return crystmat_to_array(sp.GetResonantScattFactReal(data, idx)); }, nb::arg("data"), nb::arg("spgSymPosIndex") = -1) - .def("GetResonantScattFactImag", &ScatteringPower::GetResonantScattFactImag, + .def("GetResonantScattFactImag", + [](ScatteringPower& sp, const ScatteringData& data, const int idx){ + return crystmat_to_array(sp.GetResonantScattFactImag(data, idx)); }, nb::arg("data"), nb::arg("spgSymPosIndex") = -1) .def("IsScatteringFactorAnisotropic", &ScatteringPower::IsScatteringFactorAnisotropic) .def("IsTemperatureFactorAnisotropic", &ScatteringPower::IsTemperatureFactorAnisotropic) diff --git a/src/extensions/nb_unitcell.cpp b/src/extensions/nb_unitcell.cpp index 623f1861..85124b89 100644 --- a/src/extensions/nb_unitcell.cpp +++ b/src/extensions/nb_unitcell.cpp @@ -93,7 +93,7 @@ void wrap_unitcell(nb::module_& m) const std::string&>()) .def(nb::init()) .def("GetLatticePar", - nb::overload_cast<>(&UnitCell::GetLatticePar, nb::const_)) + [](const UnitCell& u){ return crystvec_to_array(u.GetLatticePar()); }) .def("GetLatticePar", nb::overload_cast(&UnitCell::GetLatticePar, nb::const_)) .def("GetClockLatticePar", &UnitCell::GetClockLatticePar, @@ -102,7 +102,9 @@ void wrap_unitcell(nb::module_& m) .def("GetOrthMatrix", [](UnitCell& u){ return crystmat_to_array(u.GetOrthMatrix()); }) .def("GetClockMetricMatrix", &UnitCell::GetClockMetricMatrix, nb::rv_policy::reference_internal) - .def("GetOrthonormalCoords", &UnitCell::GetOrthonormalCoords) + .def("GetOrthonormalCoords", + [](const UnitCell& u, double x, double y, double z){ + return crystvec_to_array(u.GetOrthonormalCoords(x, y, z)); }) .def("FractionalToOrthonormalCoords", &FractionalToOrthonormal) .def("OrthonormalToFractionalCoords", &OrthonormalToFractional) .def("MillerToOrthonormalCoords", &MillerToOrthonormal) diff --git a/tests/test_array_returns.py b/tests/test_array_returns.py new file mode 100644 index 00000000..4ce97657 --- /dev/null +++ b/tests/test_array_returns.py @@ -0,0 +1,117 @@ +#!/usr/bin/env python +"""Tests for bindings that return ObjCryst's CrystVector / CrystMatrix. + +nanobind has no global converter for these types: a binding that returns +them without ``crystvec_to_array`` / ``crystmat_to_array`` fails only +when called, with "Unable to convert function return value to a Python +type". +""" + +import unittest + +import numpy as np + +import pyobjcryst._pyobjcryst as _pyobjcryst +from pyobjcryst.atom import Atom +from pyobjcryst.crystal import Crystal +from pyobjcryst.powderpattern import PowderPattern +from pyobjcryst.scatteringpower import ScatteringPowerAtom +from pyobjcryst.scatteringpowersphere import ScatteringPowerSphere + + +def _corundum(): + crystal = Crystal(4.76, 4.76, 12.99, "R-3c") + al = ScatteringPowerAtom("Al", "Al") + o = ScatteringPowerAtom("O", "O") + crystal.AddScatteringPower(al) + crystal.AddScatteringPower(o) + crystal.AddScatterer(Atom(0.0, 0.0, 0.35216, "Al1", al)) + crystal.AddScatterer(Atom(0.3064, 0.0, 0.25, "O1", o)) + return crystal, al + + +class TestNoRawCrystVectorReturns(unittest.TestCase): + + def test_signatures(self): + """No binding's signature returns an unconverted C++ type.""" + raw = [] + for class_name, cls in vars(_pyobjcryst).items(): + if not isinstance(cls, type): + continue + for name, member in vars(cls).items(): + doc = getattr(member, "__doc__", None) or "" + for line in doc.splitlines(): + if "->" not in line: + continue + return_type = line.rsplit("->", 1)[-1] + if "CrystVector" in return_type or ( + "CrystMatrix" in return_type + ): + raw.append(f"{class_name}.{name}: {line.strip()}") + self.assertEqual(raw, []) + + +class TestArrayReturns(unittest.TestCase): + + def setUp(self): + self.crystal, self.al = _corundum() + + def test_GetLatticePar(self): + # b and gamma are derived from the R-3c constraints + self.crystal.a = 5.0 + lattice = self.crystal.GetLatticePar() + self.assertIsInstance(lattice, np.ndarray) + expected = [self.crystal.GetLatticePar(i) for i in range(6)] + np.testing.assert_allclose(lattice, expected) + np.testing.assert_allclose( + lattice, [5.0, 5.0, 12.99, np.pi / 2, np.pi / 2, 2 * np.pi / 3] + ) + + def test_GetOrthonormalCoords(self): + xyz = self.crystal.GetOrthonormalCoords(0.1, 0.2, 0.3) + self.assertIsInstance(xyz, np.ndarray) + np.testing.assert_allclose( + xyz, self.crystal.FractionalToOrthonormalCoords(0.1, 0.2, 0.3) + ) + + def test_GetMinDistanceTable(self): + table = self.crystal.GetMinDistanceTable(1.0) + self.assertIsInstance(table, np.ndarray) + self.assertEqual(table.shape, (2, 2)) + np.testing.assert_allclose(table, table.T) + # shortest Al-O distance in corundum + self.assertAlmostEqual(table[0, 1], 1.85, places=2) + + def test_scattering_power_factors(self): + pp = PowderPattern() + pp.SetWavelength(1.0) + pp.SetPowderPatternX(np.radians(np.linspace(10.0, 60.0, 200))) + pp.AddPowderPatternDiffraction(self.crystal) + data = pp.get_crystalline_components()[0] + pp.GetPowderPatternCalc() + n_refl = data.GetNbRefl() + self.assertGreater(n_refl, 0) + + # ScatteringPowerAtom uses the forwarding bindings, + # ScatteringPowerSphere the ScatteringPower base bindings + sphere = ScatteringPowerSphere("sphere", 2.0, 1.0) + for sp in (self.al, sphere): + with self.subTest(type(sp).__name__): + for name in ("GetScatteringFactor", "GetTemperatureFactor"): + values = getattr(sp, name)(data) + self.assertIsInstance(values, np.ndarray) + self.assertEqual(values.shape, (n_refl,)) + self.assertTrue(np.all(np.isfinite(values))) + for name in ( + "GetResonantScattFactReal", + "GetResonantScattFactImag", + ): + values = getattr(sp, name)(data) + self.assertIsInstance(values, np.ndarray) + self.assertEqual(values.ndim, 2) + + self.assertGreater(self.al.GetScatteringFactor(data)[0], 0.0) + + +if __name__ == "__main__": + unittest.main() From 0d9a511f3cedb16438fe74f21117c0e58cc8001f Mon Sep 17 00:00:00 2001 From: Clemens Schmid Date: Fri, 13 Nov 2026 16:32:42 +0100 Subject: [PATCH 15/21] add news file --- news/128.rst | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 news/128.rst diff --git a/news/128.rst b/news/128.rst new file mode 100644 index 00000000..9192f3ed --- /dev/null +++ b/news/128.rst @@ -0,0 +1,28 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* Return numpy arrays from ``UnitCell.GetLatticePar()``, + ``UnitCell.GetOrthonormalCoords()``, ``Crystal.GetMinDistanceTable()`` + and the ``ScatteringPower`` methods ``GetScatteringFactor()``, + ``GetTemperatureFactor()``, ``GetResonantScattFactReal()`` and + ``GetResonantScattFactImag()``, which raised a ``TypeError`` in the + nanobind bindings. + +**Security:** + +* From 493b6d886e8def3f76ea721d8ea969074549da6c Mon Sep 17 00:00:00 2001 From: Clemens Schmid Date: Fri, 13 Nov 2026 16:49:00 +0100 Subject: [PATCH 16/21] remove single-argument binding of PrepareRefParList --- src/extensions/nb_lsq.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/extensions/nb_lsq.cpp b/src/extensions/nb_lsq.cpp index 2535b18d..52333017 100644 --- a/src/extensions/nb_lsq.cpp +++ b/src/extensions/nb_lsq.cpp @@ -108,9 +108,6 @@ void wrap_lsq(nb::module_& m) nb::overload_cast<>(&LSQNumObj::GetCompiledRefinedObj), nb::rv_policy::reference_internal) .def("PrintRefResults", &LSQNumObj::PrintRefResults) - .def("PrepareRefParList", - nb::overload_cast(&LSQNumObj::PrepareRefParList), - nb::arg("copy_param") = false) .def("PrepareRefParList", nb::overload_cast(&LSQNumObj::PrepareRefParList), nb::arg("copy_param") = false, From a2f6f0d47b3cd0b9c054cc6060699d512cf32fa8 Mon Sep 17 00:00:00 2001 From: Clemens Schmid Date: Fri, 13 Nov 2026 16:50:58 +0100 Subject: [PATCH 17/21] add news file --- news/129.rst | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 news/129.rst diff --git a/news/129.rst b/news/129.rst new file mode 100644 index 00000000..5d31b53b --- /dev/null +++ b/news/129.rst @@ -0,0 +1,25 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* ``LSQ.PrepareRefParList()`` is silent by default again in the nanobind + bindings, as documented. Pass ``verbose=True`` to show the warnings + about duplicate parameter names. + +**Security:** + +* From c91557fb3a6388adef4620af8b441123dd0fc51f Mon Sep 17 00:00:00 2001 From: Clemens Schmid Date: Fri, 13 Nov 2026 16:54:08 +0100 Subject: [PATCH 18/21] fix news file --- news/{129.rst => 130.rst} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename news/{129.rst => 130.rst} (100%) diff --git a/news/129.rst b/news/130.rst similarity index 100% rename from news/129.rst rename to news/130.rst From c10d6c037d0f7fcc99c8976043b000afc721631d Mon Sep 17 00:00:00 2001 From: SYMSCAE Date: Fri, 13 Nov 2026 19:02:49 -0800 Subject: [PATCH 19/21] chore: separate build dependencies from conda.txt and pip.txt --- requirements/build.txt | 6 ++++++ requirements/conda.txt | 2 -- requirements/pip.txt | 2 -- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/requirements/build.txt b/requirements/build.txt index e69de29b..eb8ef302 100644 --- a/requirements/build.txt +++ b/requirements/build.txt @@ -0,0 +1,6 @@ +compilers +libboost-devel +nanobind +numpy +scikit-build-core +setuptools-scm diff --git a/requirements/conda.txt b/requirements/conda.txt index 8e74a22d..0965109d 100644 --- a/requirements/conda.txt +++ b/requirements/conda.txt @@ -1,6 +1,4 @@ numpy -compilers -libboost-devel packaging # for matplotlib version parsing in powderpattern.py # plotting diff --git a/requirements/pip.txt b/requirements/pip.txt index f70a1e26..1382eda5 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -1,4 +1,2 @@ -setuptools numpy packaging -libboost-headers From 94fc2120790415c283bc2b479cd67c50bb4ef71a Mon Sep 17 00:00:00 2001 From: Vincent Favre-Nicolin Date: Mon, 16 Nov 2026 00:38:58 +0800 Subject: [PATCH 20/21] test: restore reflection-profile tests dropped in nanobind port Re-implement test_anisotropic_profile_depends_on_hkl, test_set_profile_copies_reusable_template and test_set_profile_accepts_temporary (from #112) against the nanobind API. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- tests/test_reflectionprofile.py | 54 +++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/tests/test_reflectionprofile.py b/tests/test_reflectionprofile.py index a3b1eeb3..74f5694a 100644 --- a/tests/test_reflectionprofile.py +++ b/tests/test_reflectionprofile.py @@ -235,6 +235,60 @@ def test_anisotropic_set_profile_par(self): self.assertAlmostEqual(aniso.GetPar("G_HH").GetValue(), 1e-5) self.assertAlmostEqual(aniso.GetPar("G_KK").GetValue(), 2e-5) + def test_anisotropic_profile_depends_on_hkl(self): + """Anisotropic Lorentz coefficients make the profile depend on + the reflection direction.""" + profile = ReflectionProfilePseudoVoigtAnisotropic() + profile.SetProfilePar( + fwhmCagliotiW=1e-6, + fwhmLorentzGammaHH=1e-3, + fwhmLorentzGammaKK=2e-3, + pseudoVoigtEta0=1, + ) + center = 0.5 + x = np.linspace(center - 0.1, center + 0.1, 401) + h00 = profile.GetProfile(x, center, 1, 0, 0) + k00 = profile.GetProfile(x, center, 0, 1, 0) + self.assertFalse(np.allclose(h00, k00)) + + def test_set_profile_copies_reusable_template(self): + """One profile template can initialize several phases, each + receiving an independent copy.""" + second = self.pp.AddPowderPatternDiffraction( + self.loadcifdata("paracetamol.cif") + ) + template = ReflectionProfilePseudoVoigtAnisotropic() + template.GetPar("W").SetValue(1e-6) + template.GetPar("G_HH").SetValue(2e-6) + + for pdiff in (self.ppd, second): + pdiff.SetProfile(template) + + first_profile = self.ppd.GetProfile() + second_profile = second.GetProfile() + self.assertIsInstance( + first_profile, ReflectionProfilePseudoVoigtAnisotropic + ) + self.assertIsInstance( + second_profile, ReflectionProfilePseudoVoigtAnisotropic + ) + self.assertAlmostEqual(first_profile.GetPar("W").GetValue(), 1e-6) + self.assertAlmostEqual(second_profile.GetPar("G_HH").GetValue(), 2e-6) + + first_profile.GetPar("W").SetValue(3e-6) + self.assertAlmostEqual(template.GetPar("W").GetValue(), 1e-6) + self.assertAlmostEqual(second_profile.GetPar("W").GetValue(), 1e-6) + + def test_set_profile_accepts_temporary(self): + """A temporary profile is copied into the phase and stays valid + after the temporary is garbage collected.""" + self.ppd.SetProfile(ReflectionProfilePseudoVoigt()) + gc.collect() + profile = self.ppd.GetProfile() + self.assertIsInstance(profile, ReflectionProfilePseudoVoigt) + self.assertFalse(profile.IsAnisotropic()) + self.assertGreater(self.pp.GetPowderPatternCalc().max(), 0) + def build_tof_pattern(crystal, profile): """Return a TOF neutron powder pattern of crystal using profile.""" From 0a305f771e778bf378832000b19cdad190e65f35 Mon Sep 17 00:00:00 2001 From: Vincent Favre-Nicolin Date: Mon, 16 Nov 2026 00:47:41 +0800 Subject: [PATCH 21/21] docs: update README installation for nanobind/CMake build Drop SCons and libobjcryst instructions, describe self-contained PyPI wheels, building from source with submodules, and Debug builds via scikit-build-core. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- README.rst | 63 +++++++++++++++++++----------------------------------- 1 file changed, 22 insertions(+), 41 deletions(-) diff --git a/README.rst b/README.rst index ba46399e..7af519c2 100644 --- a/README.rst +++ b/README.rst @@ -127,56 +127,38 @@ Alternative methods of installation These approaches are not recommended but reproduced here for advanced users. You can use ``pip`` to download and install the latest release from -`Python Package Index `_. +`Python Package Index `_. The PyPI wheels are +self-contained (ObjCryst++, cctbx and newmat are built in), so no compiler +or conda libraries are needed :: -Pyobjcryst can be installed from pip. We recommend installing the dependencies that can be -found in ``requirements/conda.txt`` from conda-forge, e.g., :: - - conda create -n pyobjcryst-env python=3.15 - conda activate pyobjcryst-env - conda install -c conda-forge numpy compilers libboost-devel packaging ipywidgets matplotlib-base ipympl py3dmol pip install pyobjcryst -If you prefer to install from sources, after installing the dependencies, obtain the source archive from -`GitHub `_. Once installed, ``cd`` into your ``pyobjcryst`` directory -and run the following :: - - pip install . - -An alternative way of installing pyobjcryst is to use the SCons tool, -which can speed up the process by compiling C++ files in several -parallel jobs (-j4):: +The optional graphical dependencies can be installed with :: - conda install scons - conda install --file requirements/conda.txt - scons -j4 dev + pip install ipywidgets matplotlib ipympl py3dmol -See ``scons -h`` for description of build targets and options. +To build from source, a C++ compiler is required; CMake, nanobind and the +Boost headers are fetched automatically by ``pip``. ObjCryst++ is included +as a git submodule, so clone with ``--recursive`` (or run +``git submodule update --init`` in an existing clone) :: -Alternatively, on Ubuntu Linux the required software can be installed using :: - - sudo apt-get install \ - python-setuptools python-numpy scons \ - build-essential python-dev libboost-all-dev - -If this doesn't work, please see the `requirements/conda.txt` file for the -latest list of requirements. + git clone --recursive https://github.com/diffpy/pyobjcryst.git + cd pyobjcryst + pip install . -The ``libobjcryst`` library can also be installed as per the instructions at -https://github.com/diffpy/libobjcryst. Make sure other required software are -also in place and then run from the pyobjcryst directory :: +Outside a conda environment, e.g. on Ubuntu Linux, the compiler and Boost +headers can be installed using :: - pip install . + sudo apt-get install build-essential python3-dev python3-pip libboost-dev -You may need to use sudo with system Python so the process is allowed to copy files to system -directories, unless you are installing into a conda environment. If administrator (root) access is not -available, see the usage information from python setup.py install --help for options to install -to a user-writable location. +Boost headers can also be installed from conda-forge (``libboost-headers``), +or their location given explicitly with +``pip install . -Ccmake.define.BOOST_INCLUDE_DIR=``. Testing your installation ------------------------- -The installation integrity can be verified by executing the included tests with +The installation integrity can be verified by executing the included tests. First install test dependencies then type pytest:: @@ -208,11 +190,10 @@ If it fails by black or isort, just rerun and it should pass (black and isort wi pass after they are modified). If the flake8 test fails please see the error messages and fix them manually before trying to commit again. -When developing it is preferable to compile the C++ files with -SCons using the ``build=debug`` option, which compiles the extension -module with debug information and C-assertions checks :: +When developing it is preferable to compile the extension module with +debug information and C-assertions checks :: - scons -j4 build=debug dev + pip install -e . -Ccmake.build-type=Debug Improvements and fixes are always appreciated.