diff --git a/doc/src/Manual.txt b/doc/src/Manual.txt index 9bfe918137..1da854c483 100644 --- a/doc/src/Manual.txt +++ b/doc/src/Manual.txt @@ -1,7 +1,7 @@ LAMMPS Users Manual - + @@ -21,7 +21,7 @@

LAMMPS Documentation :c,h3 -13 Feb 2017 version :c,h4 +21 Feb 2017 version :c,h4 Version info: :h4 diff --git a/doc/src/Section_commands.txt b/doc/src/Section_commands.txt index 30c2743abd..c36c961de3 100644 --- a/doc/src/Section_commands.txt +++ b/doc/src/Section_commands.txt @@ -1076,7 +1076,7 @@ KOKKOS, o = USER-OMP, t = OPT. "none"_bond_none.html, "zero"_bond_zero.html, "hybrid"_bond_hybrid.html, -"class2 (o)"_bond_class2.html, +"class2 (ko)"_bond_class2.html, "fene (iko)"_bond_fene.html, "fene/expand (o)"_bond_fene_expand.html, "harmonic (ko)"_bond_harmonic.html, @@ -1109,7 +1109,7 @@ USER-OMP, t = OPT. "zero"_angle_zero.html, "hybrid"_angle_hybrid.html, "charmm (ko)"_angle_charmm.html, -"class2 (o)"_angle_class2.html, +"class2 (ko)"_angle_class2.html, "cosine (o)"_angle_cosine.html, "cosine/delta (o)"_angle_cosine_delta.html, "cosine/periodic (o)"_angle_cosine_periodic.html, @@ -1145,7 +1145,7 @@ USER-OMP, t = OPT. "zero"_dihedral_zero.html, "hybrid"_dihedral_hybrid.html, "charmm (ko)"_dihedral_charmm.html, -"class2 (o)"_dihedral_class2.html, +"class2 (ko)"_dihedral_class2.html, "harmonic (io)"_dihedral_harmonic.html, "helix (o)"_dihedral_helix.html, "multi/harmonic (o)"_dihedral_multi_harmonic.html, @@ -1177,7 +1177,7 @@ USER-OMP, t = OPT. "none"_improper_none.html, "zero"_improper_zero.html, "hybrid"_improper_hybrid.html, -"class2 (o)"_improper_class2.html, +"class2 (ko)"_improper_class2.html, "cvff (io)"_improper_cvff.html, "harmonic (ko)"_improper_harmonic.html, "umbrella (o)"_improper_umbrella.html :tb(c=4,ea=c) diff --git a/doc/src/Section_howto.txt b/doc/src/Section_howto.txt index 5e8f676209..b69d69614a 100644 --- a/doc/src/Section_howto.txt +++ b/doc/src/Section_howto.txt @@ -2573,7 +2573,7 @@ well. 6.26 Adiabatic core/shell model :link(howto_26),h4 The adiabatic core-shell model by "Mitchell and -Finchham"_#MitchellFinchham is a simple method for adding +Fincham"_#MitchellFincham is a simple method for adding polarizability to a system. In order to mimic the electron shell of an ion, a satellite particle is attached to it. This way the ions are split into a core and a shell where the latter is meant to react to @@ -2667,13 +2667,16 @@ bond_coeff 1 63.014 0.0 bond_coeff 2 25.724 0.0 :pre When running dynamics with the adiabatic core/shell model, the -following issues should be considered. Since the relative motion of -the core and shell particles corresponds to the polarization, typical -thermostats can alter the polarization behaviour, meaning the shell -will not react freely to its electrostatic environment. This is -critical during the equilibration of the system. Therefore -it's typically desirable to decouple the relative motion of the -core/shell pair, which is an imaginary degree of freedom, from the +following issues should be considered. The relative motion of +the core and shell particles corresponds to the polarization, +hereby an instantaneous relaxation of the shells is approximated +and a fast core/shell spring frequency ensures a nearly constant +internal kinetic energy during the simulation. +Thermostats can alter this polarization behaviour, by scaling the +internal kinetic energy, meaning the shell will not react freely to +its electrostatic environment. +Therefore it is typically desirable to decouple the relative motion of +the core/shell pair, which is an imaginary degree of freedom, from the real physical system. To do that, the "compute temp/cs"_compute_temp_cs.html command can be used, in conjunction with any of the thermostat fixes, such as "fix nvt"_fix_nh.html or "fix @@ -2704,6 +2707,22 @@ fix thermostatequ all nve # integrator as needed f fix_modify thermoberendsen temp CSequ thermo_modify temp CSequ # output of center-of-mass derived temperature :pre +The pressure for the core/shell system is computed via the regular +LAMMPS convention by "treating the cores and shells as individual +particles"_#MitchellFincham2. For the thermo output of the pressure +as well as for the application of a barostat, it is necessary to +use an additional "pressure"_compute_pressure compute based on the +default "temperature"_compute_temp and specifying it as a second +argument in "fix modify"_fix_modify.html and +"thermo_modify"_thermo_modify.html resulting in: + +(...) +compute CSequ all temp/cs cores shells +compute thermo_press_lmp all pressure thermo_temp # pressure for individual particles +thermo_modify temp CSequ press thermo_press_lmp # modify thermo to regular pressure +fix press_bar all npt temp 300 300 0.04 iso 0 0 0.4 +fix_modify press_bar temp CSequ press thermo_press_lmp # pressure modification for correct kinetic scalar :pre + If "compute temp/cs"_compute_temp_cs.html is used, the decoupled relative motion of the core and the shell should in theory be stable. However numerical fluctuation can introduce a small @@ -2724,24 +2743,18 @@ temp/cs"_compute_temp_cs.html command to the {temp} keyword of the velocity all create 1427 134 bias yes temp CSequ velocity all scale 1427 temp CSequ :pre -It is important to note that the polarizability of the core/shell -pairs is based on their relative motion. Therefore the choice of -spring force and mass ratio need to ensure much faster relative motion -of the 2 atoms within the core/shell pair than their center-of-mass -velocity. This allow the shells to effectively react instantaneously -to the electrostatic environment. This fast movement also limits the -timestep size that can be used. +To maintain the correct polarizability of the core/shell pairs, the +kinetic energy of the internal motion shall remain nearly constant. +Therefore the choice of spring force and mass ratio need to ensure +much faster relative motion of the 2 atoms within the core/shell pair +than their center-of-mass velocity. This allows the shells to +effectively react instantaneously to the electrostatic environment and +limits energy transfer to or from the core/shell oscillators. +This fast movement also dictates the timestep that can be used. The primary literature of the adiabatic core/shell model suggests that the fast relative motion of the core/shell pairs only allows negligible -energy transfer to the environment. Therefore it is not intended to -decouple the core/shell degree of freedom from the physical system -during production runs. In other words, the "compute -temp/cs"_compute_temp_cs.html command should not be used during -production runs and is only required during equilibration. This way one -is consistent with literature (based on the code packages DL_POLY or -GULP for instance). - +energy transfer to the environment. The mentioned energy transfer will typically lead to a small drift in total energy over time. This internal energy can be monitored using the "compute chunk/atom"_compute_chunk_atom.html and "compute @@ -2761,14 +2774,20 @@ command, to use as input to the "compute chunk/atom"_compute_chunk_atom.html command to define the core/shell pairs as chunks. -For example, +For example if core/shell pairs are the only molecules: + +read_data NaCl_CS_x0.1_prop.data +compute prop all property/atom molecule +compute cs_chunk all chunk/atom c_prop +compute cstherm all temp/chunk cs_chunk temp internal com yes cdof 3.0 # note the chosen degrees of freedom for the core/shell pairs +fix ave_chunk all ave/time 10 1 10 c_cstherm file chunk.dump mode vector :pre + +For example if core/shell pairs and other molecules are present: fix csinfo all property/atom i_CSID # property/atom command read_data NaCl_CS_x0.1_prop.data fix csinfo NULL CS-Info # atom property added in the data-file compute prop all property/atom i_CSID -compute cs_chunk all chunk/atom c_prop -compute cstherm all temp/chunk cs_chunk temp internal com yes cdof 3.0 # note the chosen degrees of freedom for the core/shell pairs -fix ave_chunk all ave/time 10 1 10 c_cstherm file chunk.dump mode vector :pre +(...) :pre The additional section in the date file would be formatted like this: @@ -2890,9 +2909,13 @@ Phys, 79, 926 (1983). :link(Shinoda) [(Shinoda)] Shinoda, Shiga, and Mikami, Phys Rev B, 69, 134103 (2004). -:link(MitchellFinchham) -[(Mitchell and Finchham)] Mitchell, Finchham, J Phys Condensed Matter, +:link(MitchellFincham) +[(Mitchell and Fincham)] Mitchell, Fincham, J Phys Condensed Matter, 5, 1031-1038 (1993). +:link(MitchellFincham2) +[(Fincham)] Fincham, Mackrodt and Mitchell, J Phys Condensed Matter, +6, 393-404 (1994). + :link(howto-Lamoureux) [(Lamoureux and Roux)] G. Lamoureux, B. Roux, J. Chem. Phys 119, 3025 (2003) diff --git a/doc/src/angle_class2.txt b/doc/src/angle_class2.txt index a29f1a6796..74f2544cd4 100644 --- a/doc/src/angle_class2.txt +++ b/doc/src/angle_class2.txt @@ -8,6 +8,7 @@ angle_style class2 command :h3 angle_style class2/omp command :h3 +angle_style class2/kk command :h3 [Syntax:] diff --git a/doc/src/bond_class2.txt b/doc/src/bond_class2.txt index e804b5f0f0..aa05412387 100644 --- a/doc/src/bond_class2.txt +++ b/doc/src/bond_class2.txt @@ -8,6 +8,7 @@ bond_style class2 command :h3 bond_style class2/omp command :h3 +bond_style class2/kk command :h3 [Syntax:] diff --git a/doc/src/compute_rdf.txt b/doc/src/compute_rdf.txt index 6ea4da5207..1c9de277bc 100644 --- a/doc/src/compute_rdf.txt +++ b/doc/src/compute_rdf.txt @@ -10,21 +10,27 @@ compute rdf command :h3 [Syntax:] -compute ID group-ID rdf Nbin itype1 jtype1 itype2 jtype2 ... :pre +compute ID group-ID rdf Nbin itype1 jtype1 itype2 jtype2 ... keyword/value ... :pre -ID, group-ID are documented in "compute"_compute.html command -rdf = style name of this compute command -Nbin = number of RDF bins -itypeN = central atom type for Nth RDF histogram (see asterisk form below) -jtypeN = distribution atom type for Nth RDF histogram (see asterisk form below) :ul +ID, group-ID are documented in "compute"_compute.html command :ulb,l +rdf = style name of this compute command :l +Nbin = number of RDF bins :l +itypeN = central atom type for Nth RDF histogram (see asterisk form below) :l +jtypeN = distribution atom type for Nth RDF histogram (see asterisk form below) :l + +zero or more keyword/value pairs may be appended :l +keyword = {cutoff} :l + {cutoff} value = Rcut + Rcut = cutoff distance for RDF computation (distance units) :pre +:ule [Examples:] compute 1 all rdf 100 compute 1 all rdf 100 1 1 -compute 1 all rdf 100 * 3 +compute 1 all rdf 100 * 3 cutoff 5.0 compute 1 fluid rdf 500 1 1 1 2 2 1 2 2 -compute 1 fluid rdf 500 1*3 2 5 *10 :pre +compute 1 fluid rdf 500 1*3 2 5 *10 cutoff 3.5 :pre [Description:] @@ -32,7 +38,8 @@ Define a computation that calculates the radial distribution function (RDF), also called g(r), and the coordination number for a group of particles. Both are calculated in histogram form by binning pairwise distances into {Nbin} bins from 0.0 to the maximum force cutoff -defined by the "pair_style"_pair_style.html command. The bins are of +defined by the "pair_style"_pair_style.html command or the cutoff +distance {Rcut} specified via the {cutoff} keyword. The bins are of uniform size in radial distance. Thus a single bin encompasses a thin shell of distances in 3d and a thin ring of distances in 2d. @@ -52,6 +59,30 @@ the dump file. The rerun script can use a "special_bonds"_special_bonds.html command that includes all pairs in the neighbor list. +By default the RDF is computed out to the maximum force cutoff defined +by the "pair_style"_pair_style.html command. If the {cutoff} keyword +is used, then the RDF is computed accurately out to the {Rcut} > 0.0 +distance specified. + +NOTE: Normally, you should only use the {cutoff} keyword if no pair +style is defined, e.g. the "rerun"_rerun.html command is being used to +post-process a dump file of snapshots. Or if you really want the RDF +for distances beyond the pair_style force cutoff and cannot easily +post-process a dump file to calculate it. This is because using the +{cutoff} keyword incurs extra computation and possibly communication, +which may slow down your simulation. If you specify a {Rcut} <= force +cutoff, you will force an additional neighbor list to be built at +every timestep this command is invoked (or every reneighboring +timestep, whichever is less frequent), which is inefficent. LAMMPS +will warn you if this is the case. If you specify a {Rcut} > force +cutoff, you must insure ghost atom information out to {Rcut} + {skin} +is communicated, via the "comm_modify cutoff"_comm_modify.html +command, else the RDF computation cannot be performed, and LAMMPS will +give an error message. The {skin} value is what is specified with the +"neighbor"_neighbor.html command. In this case, you are forcing a +large neighbor list to be built just for the RDF computation, and +extra communication to be performed every timestep. + The {itypeN} and {jtypeN} arguments are optional. These arguments must come in pairs. If no pairs are listed, then a single histogram is computed for g(r) between all atom types. If one or more pairs are @@ -153,4 +184,6 @@ change from zero to one at the location of the spike in g(r). "fix ave/time"_fix_ave_time.html -[Default:] none +[Default:] + +The keyword defaults are cutoff = 0.0 (use the pairwise force cutoff). diff --git a/doc/src/dihedral_class2.txt b/doc/src/dihedral_class2.txt index bc32dc90d3..91ab6f3738 100644 --- a/doc/src/dihedral_class2.txt +++ b/doc/src/dihedral_class2.txt @@ -8,6 +8,7 @@ dihedral_style class2 command :h3 dihedral_style class2/omp command :h3 +dihedral_style class2/kk command :h3 [Syntax:] diff --git a/doc/src/improper_class2.txt b/doc/src/improper_class2.txt index 7dbc4071d8..0b41afe2db 100644 --- a/doc/src/improper_class2.txt +++ b/doc/src/improper_class2.txt @@ -8,6 +8,7 @@ improper_style class2 command :h3 improper_style class2/omp command :h3 +improper_style class2/kk command :h3 [Syntax:] diff --git a/examples/coreshell/in.coreshell b/examples/coreshell/in.coreshell index b03946306b..b436b75a86 100644 --- a/examples/coreshell/in.coreshell +++ b/examples/coreshell/in.coreshell @@ -40,7 +40,8 @@ thermo 50 thermo_style custom step etotal pe ke temp press & epair evdwl ecoul elong ebond fnorm fmax vol -compute CSequ all temp/cs cores shells +compute CStemp all temp/cs cores shells +compute thermo_press_lmp all pressure thermo_temp # press for correct kinetic scalar # output via chunk method @@ -49,16 +50,18 @@ compute CSequ all temp/cs cores shells #compute cstherm all temp/chunk cs_chunk temp internal com yes cdof 3.0 #fix ave_chunk all ave/time 100 1 100 c_cstherm file chunk.dump mode vector -thermo_modify temp CSequ +thermo_modify temp CStemp press thermo_press_lmp # velocity bias option -velocity all create 1427 134 dist gaussian mom yes rot no bias yes temp CSequ -velocity all scale 1427 temp CSequ +velocity all create 1427 134 dist gaussian mom yes rot no bias yes temp CStemp +velocity all scale 1427 temp CStemp + +# thermostating using the core/shell decoupling fix thermoberendsen all temp/berendsen 1427 1427 0.4 fix nve all nve -fix_modify thermoberendsen temp CSequ +fix_modify thermoberendsen temp CStemp # 2 fmsec timestep diff --git a/examples/coreshell/in.coreshell.thermostats b/examples/coreshell/in.coreshell.thermostats new file mode 100644 index 0000000000..fc788ca820 --- /dev/null +++ b/examples/coreshell/in.coreshell.thermostats @@ -0,0 +1,86 @@ +# Testsystem for core-shell model compared to Mitchell and Fincham +# Hendrik Heenen, June 2014 + +# ------------------------ INITIALIZATION ---------------------------- + +units metal +dimension 3 +boundary p p p +atom_style full + +# ----------------------- ATOM DEFINITION ---------------------------- + +fix csinfo all property/atom i_CSID +read_data data.coreshell fix csinfo NULL CS-Info + +group cores type 1 2 +group shells type 3 4 + +neighbor 2.0 bin +comm_modify vel yes + +# ------------------------ FORCE FIELDS ------------------------------ + +kspace_style ewald 1.0e-6 +pair_style born/coul/long/cs 20.0 20.0 # A, rho, sigma=0, C, D +pair_coeff * * 0.0 1.000 0.00 0.00 0.00 +pair_coeff 3 3 487.0 0.23768 0.00 1.05 0.50 #Na-Na +pair_coeff 3 4 145134.0 0.23768 0.00 6.99 8.70 #Na-Cl +pair_coeff 4 4 405774.0 0.23768 0.00 72.40 145.40 #Cl-Cl + +bond_style harmonic +bond_coeff 1 63.014 0.0 +bond_coeff 2 25.724 0.0 + +# ------------------------ Equilibration Run ------------------------------- + +reset_timestep 0 + +thermo 50 +thermo_style custom step etotal pe ke temp press & + epair evdwl ecoul elong ebond fnorm fmax vol + +compute CStemp all temp/cs cores shells +compute thermo_press_lmp all pressure thermo_temp # press for correct kinetic scalar + +# output via chunk method + +#compute prop all property/atom i_CSID +#compute cs_chunk all chunk/atom c_prop +#compute cstherm all temp/chunk cs_chunk temp internal com yes cdof 3.0 +#fix ave_chunk all ave/time 100 1 100 c_cstherm file chunk.dump mode vector + +thermo_modify temp CStemp press thermo_press_lmp + +# 2 fmsec timestep + +timestep 0.002 + +# velocity bias option + +velocity all create 1427 134 dist gaussian mom yes rot no bias yes temp CStemp +velocity all scale 1427 temp CStemp + +# thermostating using the core/shell decoupling + +fix thermoberendsen all temp/berendsen 1427 1427 0.4 +fix nve all nve +fix_modify thermoberendsen temp CStemp + +run 500 + +unfix thermoberendsen +unfix nve + +fix npt_equ all npt temp 1427 1427 0.04 iso 0 0 0.4 +fix_modify npt_equ temp CStemp press thermo_press_lmp # pressure for correct kinetic scalar + +run 500 + +unfix npt_equ + +# ------------------------ Dynamic Run ------------------------------- + +fix npt_dyn all npt temp 1427 1427 0.04 iso 0 0 0.4 +fix_modify npt_dyn temp CStemp press thermo_press_lmp # pressure for correct kinetic scalar +run 1000 diff --git a/examples/snap/He_He_JW2013.table b/examples/snap/He_He_JW2013.table new file mode 100644 index 0000000000..415492d911 --- /dev/null +++ b/examples/snap/He_He_JW2013.table @@ -0,0 +1,5008 @@ +# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Juslin, N. and Wirth, B. D. Journal of Nuclear Materials, 423, (2013) p61-63 +# +# # Helium-Helium potential, courtesy of N. Juslin and A. Kohnert. +# D.E. Beck, Mol. Phys. 14 (4): 311-315 (1968) as modified by +# [NIKLAS: WHAT IS THE CITATION FOR THE MODIFICATION?]. + +HeHe +N 4999 + +1 0.000000001 75519.84343541 66456437 +2 0.001520304 37631.7120347908 33228235 +3 0.002280456 25002.8254988559 12459985 +4 0.003040608 18688.7473128597 6644878.5 +5 0.00380076 14900.590193906 4152692.9 +6 0.004560912 12375.3917309215 2847264.7 +7 0.005321064 10571.8823332253 2075877.3 +8 0.006081216 9219.42721767206 1581399.9 +9 0.006841368 8167.67373770059 1245156.8 +10 0.00760152 7326.41031495415 1006012.1 +11 0.008361672 6638.22959001766 829801.35 +12 0.009121824 6064.85999778702 696192.17 +13 0.009881976 5579.80584651465 592459.37 +14 0.010642128 5164.14164869331 510303.94 +15 0.01140228 4803.9887195868 444124.07 +16 0.012162432 4488.93805131225 390026.53 +17 0.012922584 4211.02981959958 345236.87 +18 0.013682736 3964.07305496495 307734.29 +19 0.014442888 3743.1801545667 276018.49 +20 0.01520304 3544.44104050478 248956.62 +21 0.015963192 3364.69041574939 225680.22 +22 0.016723344 3201.33849572566 205514.5 +23 0.017483496 3052.24589687661 187928.66 +24 0.018243648 2915.62980308569 172500.53 +25 0.0190038 2789.99265215812 158890.93 +26 0.019763952 2674.06727926841 146824.85 +27 0.020524104 2566.7742507531 136077.35 +28 0.021284256 2467.18834066244 126463.07 +29 0.022044408 2374.51194319818 117828.1 +30 0.02280456 2288.05380266404 110043.84 +31 0.023564712 2207.21186020013 103002.09 +32 0.024324864 2131.45931675491 96611.355 +33 0.025085016 2060.33323006244 90793.81 +34 0.025845168 1993.42512391793 85482.918 +35 0.02660532 1930.37320729201 80621.529 +36 0.027365472 1870.85589025938 76160.331 +37 0.028125624 1814.58635139873 72056.593 +38 0.028885776 1761.30796297177 68273.142 +39 0.029645928 1710.790419921 64777.514 +40 0.03040608 1662.82644951799 61541.256 +41 0.031166232 1617.22900252672 58539.347 +42 0.031926384 1573.82884562939 55749.714 +43 0.032686536 1532.47248979297 53152.82 +44 0.033446688 1493.02040113142 50731.327 +45 0.03420684 1455.34545031963 48469.804 +46 0.034966992 1419.33156425792 46354.479 +47 0.035727144 1384.87254986461 44373.033 +48 0.036487296 1351.87106489457 42514.415 +49 0.037247448 1320.23771478016 40768.693 +50 0.0380076 1289.89025785135 39126.919 +51 0.038767752 1260.75290405945 37581.012 +52 0.039527904 1232.75569461749 36123.665 +53 0.040288056 1205.83395187003 34748.251 +54 0.041048208 1179.92779028867 33448.752 +55 0.04180836 1154.98168081362 32219.693 +56 0.042568512 1130.94406187304 31056.084 +57 0.043328664 1107.76699134779 29953.369 +58 0.044088816 1085.40583453996 28907.381 +59 0.044848968 1063.81898387343 27914.304 +60 0.04560912 1042.96760662453 26970.636 +61 0.046369272 1022.81541746614 26073.163 +62 0.047129424 1003.3284730237 25218.924 +63 0.047889576 984.474985997409 24405.195 +64 0.048649728 966.225156710593 23629.462 +65 0.04940988 948.551020207457 22889.402 +66 0.050170032 931.426307251157 22182.868 +67 0.050930184 914.826317769866 21507.871 +68 0.051690336 898.727805469435 20862.568 +69 0.052450488 883.108872479803 20245.249 +70 0.05321064 867.948873031782 19654.324 +71 0.053970792 853.228325273896 19088.316 +72 0.054730944 838.928830437882 18545.848 +73 0.055491096 825.032998648183 18025.638 +74 0.056251248 811.524380746945 17526.49 +75 0.0570114 798.387405573084 17047.287 +76 0.057771552 785.607322193051 16586.985 +77 0.058531704 773.17014663316 16144.606 +78 0.059291856 761.062612709482 15719.238 +79 0.060052008 749.272126592235 15310.022 +80 0.06081216 737.786724777893 14916.156 +81 0.061572312 726.595035174528 14536.885 +82 0.062332464 715.686241034613 14171.5 +83 0.063092616 705.050047495149 13819.335 +84 0.063852768 694.67665050782 13479.764 +85 0.06461292 684.556707962377 13152.197 +86 0.065373072 674.681312824697 12836.077 +87 0.066133224 665.041968127458 12530.881 +88 0.066893376 655.630563666017 12236.115 +89 0.067653528 646.439354265416 11951.31 +90 0.06841368 637.460939496282 11676.026 +91 0.069173832 628.688244728194 11409.847 +92 0.069933984 620.114503418735 11152.378 +93 0.070694136 611.733240545225 10903.245 +94 0.071454288 603.53825709405 10662.095 +95 0.07221444 595.523615529642 10428.593 +96 0.072974592 587.683626171693 10202.421 +97 0.073734744 580.012834415052 9983.278 +98 0.074494896 572.506008732108 9770.8781 +99 0.075255048 565.158129402347 9564.9494 +100 0.0760152 557.96437791816 9365.2338 +101 0.076775352 550.920127020055 9171.4858 +102 0.077535504 544.020931318057 8983.4721 +103 0.078295656 537.262518459473 8800.9704 +104 0.079055808 530.640780806244 8623.7692 +105 0.07981596 524.151767587898 8451.6671 +106 0.080576112 517.791677498722 8284.472 +107 0.081336264 511.556851710066 8122.0007 +108 0.082096416 505.443767270885 7964.0788 +109 0.082856568 499.449030871588 7810.5394 +110 0.08361672 493.569372948063 7661.2235 +111 0.084376872 487.80164210444 7515.9791 +112 0.085137024 482.142799834653 7374.661 +113 0.085897176 476.589915524312 7237.1303 +114 0.086657328 471.140161715654 7103.2543 +115 0.08741748 465.790809619566 6972.906 +116 0.088177632 460.539224859779 6845.9638 +117 0.088937784 455.382863435324 6722.3114 +118 0.089697936 450.31926788832 6601.8374 +119 0.090458088 445.346063665003 6484.4348 +120 0.09121824 440.460955658732 6370.0015 +121 0.091978392 435.661724924438 6258.4392 +122 0.092738544 430.946225554678 6149.6538 +123 0.093498696 426.312381708107 6043.555 +124 0.094258848 421.758184781751 5940.0561 +125 0.095019 417.281690719033 5839.0739 +126 0.095779152 412.881017446016 5740.5284 +127 0.096539304 408.554342428782 5644.3429 +128 0.097299456 404.299900345337 5550.4436 +129 0.098059608 400.115980865817 5458.7594 +130 0.09881976 396.000926535166 5369.2223 +131 0.099579912 391.953130752817 5281.7665 +132 0.100340064 387.971035844212 5196.3288 +133 0.101100216 384.053131219361 5112.8486 +134 0.101860368 380.197951613849 5031.2673 +135 0.10262052 376.404075408063 4951.5285 +136 0.103380672 372.67012302057 4873.5779 +137 0.104140824 368.994755371888 4797.3633 +138 0.104900976 365.376672415063 4722.8341 +139 0.105661128 361.814611729696 4649.9419 +140 0.10642128 358.307347176234 4578.6396 +141 0.107181432 354.853687607556 4508.8821 +142 0.107941584 351.452475635006 4440.6258 +143 0.108701736 348.102586446216 4373.8285 +144 0.109461888 344.802926672215 4308.4496 +145 0.11022204 341.552433301419 4244.4498 +146 0.110982192 338.350072638272 4181.7913 +147 0.111742344 335.194839304412 4120.4373 +148 0.112502496 332.085755280337 4060.3526 +149 0.113262648 329.021868985683 4001.5029 +150 0.1140228 326.002254396305 3943.8552 +151 0.114782952 323.026010196449 3887.3774 +152 0.115543104 320.092258964419 3832.0387 +153 0.116303256 317.200146390174 3777.8092 +154 0.117063408 314.348840523443 3724.6599 +155 0.11782356 311.537531050938 3672.5628 +156 0.118583712 308.765428601398 3621.4908 +157 0.119343864 306.031764077195 3571.4177 +158 0.120104016 303.335788011338 3522.318 +159 0.120864168 300.676769948751 3474.1671 +160 0.12162432 298.053997850773 3426.9412 +161 0.122384472 295.466777521852 3380.6172 +162 0.123144624 292.914432057498 3335.1726 +163 0.123904776 290.396301312558 3290.5857 +164 0.124664928 287.911741388961 3246.8356 +165 0.12542508 285.460124142102 3203.9018 +166 0.126185232 283.040836705077 3161.7644 +167 0.126945384 280.653281030027 3120.4044 +168 0.127705536 278.296873445871 3079.803 +169 0.128465688 275.971044231749 3039.9422 +170 0.12922584 273.675237205537 3000.8044 +171 0.129985992 271.408909326807 2962.3726 +172 0.130746144 269.171530313647 2924.6302 +173 0.131506296 266.962582272785 2887.5613 +174 0.132266448 264.781559342472 2851.1501 +175 0.1330266 262.627967347625 2815.3816 +176 0.133786752 260.50132346673 2780.241 +177 0.134546904 258.401155910056 2745.7139 +178 0.135307056 256.32700360871 2711.7866 +179 0.136067208 254.278415914143 2678.4454 +180 0.13682736 252.254952307665 2645.6773 +181 0.137587512 250.25618211961 2613.4694 +182 0.138347664 248.281684257763 2581.8094 +183 0.139107816 246.331046944699 2550.6851 +184 0.139867968 244.403867463705 2520.0848 +185 0.14062812 242.499751912934 2489.9971 +186 0.141388272 240.618314967519 2460.4107 +187 0.142148424 238.759179649308 2431.315 +188 0.142908576 236.921977103973 2402.6992 +189 0.143668728 235.106346385193 2374.5533 +190 0.14442888 233.311934245662 2346.8671 +191 0.145189032 231.538394934673 2319.631 +192 0.145949184 229.785390002034 2292.8354 +193 0.146709336 228.052588108088 2266.4712 +194 0.147469488 226.339664839612 2240.5292 +195 0.14822964 224.646302531397 2215.0009 +196 0.148989792 222.972190093289 2189.8776 +197 0.149749944 221.317022842509 2165.151 +198 0.150510096 219.680502341062 2140.813 +199 0.151270248 218.062336238053 2116.8557 +200 0.152030400000001 216.46223811674 2093.2714 +201 0.152790552000001 214.879927346167 2070.0526 +202 0.153550704000001 213.315128937196 2047.1918 +203 0.154310856000001 211.76757340282 2024.6821 +204 0.155071008000001 210.236996622572 2002.5164 +205 0.155831160000001 208.723139710923 1980.6879 +206 0.156591312000001 207.225748889516 1959.19 +207 0.157351464000001 205.744575363102 1938.0161 +208 0.158111616000001 204.279375199073 1917.1601 +209 0.158871768000001 202.829909210453 1896.6156 +210 0.159631920000001 201.395942842237 1876.3768 +211 0.160392072000001 199.977246060971 1856.4377 +212 0.161152224000001 198.573593247463 1836.7925 +213 0.161912376000001 197.184763092521 1817.4357 +214 0.162672528000001 195.810538495621 1798.3618 +215 0.163432680000001 194.450706466405 1779.5654 +216 0.164192832000001 193.105058028928 1761.0414 +217 0.164952984000001 191.773388128549 1742.7847 +218 0.165713136000001 190.455495541399 1724.7901 +219 0.166473288000001 189.151182786329 1707.053 +220 0.167233440000001 187.860256039265 1689.5685 +221 0.167993592000001 186.582525049895 1672.332 +222 0.168753744000001 185.317803060615 1655.3389 +223 0.169513896000001 184.065906727656 1638.5848 +224 0.170274048000001 182.826656044333 1622.0654 +225 0.171034200000001 181.599874266341 1605.7763 +226 0.171794352000001 180.385387839045 1589.7136 +227 0.172554504000001 179.183026326692 1573.8731 +228 0.173314656000001 177.992622343493 1558.2507 +229 0.174074808000001 176.814011486516 1542.8428 +230 0.174834960000001 175.64703227033 1527.6454 +231 0.175595112000001 174.491526063356 1512.6549 +232 0.176355264000001 173.347337025865 1497.8675 +233 0.177115416000001 172.214312049584 1483.2799 +234 0.177875568000001 171.092300698842 1468.8884 +235 0.178635720000001 169.981155153237 1454.6897 +236 0.179395872000001 168.880730151754 1440.6804 +237 0.180156024000001 167.79088293831 1426.8574 +238 0.180916176000001 166.711473208672 1413.2173 +239 0.181676328000001 165.642363058711 1399.7571 +240 0.182436480000001 164.583416933955 1386.4737 +241 0.183196632000001 163.534501580401 1373.3641 +242 0.183956784000001 162.495485996557 1360.4254 +243 0.184716936000001 161.466241386657 1347.6547 +244 0.185477088000001 160.446641115047 1335.0493 +245 0.186237240000001 159.436560661684 1322.6062 +246 0.186997392000001 158.435877578721 1310.3229 +247 0.187757544000001 157.444471448156 1298.1968 +248 0.188517696000001 156.462223840507 1286.2251 +249 0.189277848000001 155.489018274489 1274.4054 +250 0.190038000000001 154.524740177656 1262.7352 +251 0.190798152000001 153.569276847992 1251.2121 +252 0.191558304000001 152.622517416424 1239.8336 +253 0.192318456000001 151.684352810215 1228.5975 +254 0.193078608000001 150.75467571724 1217.5014 +255 0.193838760000001 149.833380551092 1206.5431 +256 0.194598912000001 148.920363417022 1195.7204 +257 0.195359064000001 148.015522078667 1185.0311 +258 0.196119216000001 147.118755925559 1174.4731 +259 0.196879368000001 146.229965941394 1164.0443 +260 0.197639520000001 145.349054673027 1153.7428 +261 0.198399672000001 144.475926200192 1143.5664 +262 0.199159824000001 143.610486105913 1133.5133 +263 0.199919976000001 142.752641447594 1123.5815 +264 0.200680128000001 141.902300728773 1113.7691 +265 0.201440280000001 141.059373871511 1104.0743 +266 0.202200432000001 140.223772189411 1094.4953 +267 0.202960584000001 139.395408361251 1085.0302 +268 0.203720736000001 138.574196405196 1075.6774 +269 0.204480888000001 137.760051653608 1066.4352 +270 0.205241040000001 136.952890728398 1057.3018 +271 0.206001192000001 136.152631516942 1048.2756 +272 0.206761344000002 135.35919314852 1039.355 +273 0.207521496000002 134.572495971285 1030.5384 +274 0.208281648000002 133.792461529731 1021.8242 +275 0.209041800000002 133.019012542661 1013.2109 +276 0.209801952000002 132.25207288163 1004.6971 +277 0.210562104000002 131.491567549865 996.28115 +278 0.211322256000002 130.737422661638 987.9617 +279 0.212082408000002 129.989565422084 979.73731 +280 0.212842560000002 129.247924107457 971.60658 +281 0.213602712000002 128.512428045809 963.56815 +282 0.214362864000002 127.78300759808 955.62066 +283 0.215123016000002 127.059594139597 947.76279 +284 0.215883168000002 126.342120041958 939.99324 +285 0.216643320000002 125.630518655307 932.31074 +286 0.217403472000002 124.92472429098 924.71404 +287 0.218163624000002 124.224672204513 917.2019 +288 0.218923776000002 123.530298579014 909.77311 +289 0.219683928000002 122.841540508876 902.42649 +290 0.220444080000002 122.158335983827 895.16086 +291 0.221204232000002 121.480623873321 887.97508 +292 0.221964384000002 120.808343911241 880.86803 +293 0.222724536000002 120.141436680923 873.83859 +294 0.223484688000002 119.479843600487 866.88568 +295 0.224244840000002 118.823506908468 860.00823 +296 0.225004992000002 118.172369649738 853.20518 +297 0.225765144000002 117.52637566172 846.4755 +298 0.226525296000002 116.885469560874 839.81818 +299 0.227285448000002 116.249596729462 833.23221 +300 0.228045600000002 115.618703302578 826.71661 +301 0.228805752000002 114.992736155434 820.27043 +302 0.229565904000002 114.371642890912 813.8927 +303 0.230326056000002 113.755371827347 807.5825 +304 0.231086208000002 113.143871986571 801.33891 +305 0.231846360000002 112.53709308218 795.16102 +306 0.232606512000002 111.93498550804 789.04795 +307 0.233366664000002 111.337500327019 782.99883 +308 0.234126816000002 110.744589259935 777.01279 +309 0.234886968000002 110.156204674729 771.089 +310 0.235647120000002 109.572299575841 765.22661 +311 0.236407272000002 108.992827593794 759.42483 +312 0.237167424000002 108.417742974988 753.68283 +313 0.237927576000002 107.84700057168 747.99984 +314 0.238687728000002 107.280555832162 742.37506 +315 0.239447880000002 106.71836479113 736.80775 +316 0.240208032000002 106.160384060235 731.29714 +317 0.240968184000002 105.606570818813 725.8425 +318 0.241728336000002 105.056882804792 720.44309 +319 0.242488488000002 104.511278305776 715.0982 +320 0.243248640000002 103.969716150289 709.80712 +321 0.244008792000002 103.432155699194 704.56916 +322 0.244768944000002 102.898556837265 699.38363 +323 0.245529096000002 102.368879964922 694.24987 +324 0.246289248000002 101.843085990117 689.1672 +325 0.247049400000002 101.321136320376 684.13497 +326 0.247809552000002 100.802992854983 679.15255 +327 0.248569704000002 100.288617977312 674.21931 +328 0.249329856000002 99.7779745473017 669.33461 +329 0.250090008000002 99.2710258940651 664.49785 +330 0.250850160000002 98.7677358086385 659.70842 +331 0.251610312000002 98.2680685368607 654.96574 +332 0.252370464000002 97.7719887723829 650.26921 +333 0.253130616000002 97.2794616498065 645.61827 +334 0.253890768000002 96.7904527379441 641.01233 +335 0.254650920000002 96.3049280332035 636.45086 +336 0.255411072000002 95.8228539530906 631.93329 +337 0.256171224000002 95.344197329829 627.45908 +338 0.256931376000002 94.8689254040944 623.0277 +339 0.257691528000002 94.3970058188609 618.63863 +340 0.258451680000002 93.9284066133568 614.29135 +341 0.259211832000002 93.4630962171284 609.98535 +342 0.259971984000002 93.0010434442086 605.72013 +343 0.260732136000003 92.5422174873886 601.49518 +344 0.261492288000003 92.0865879125911 597.31003 +345 0.262252440000003 91.6341246533418 593.1642 +346 0.263012592000003 91.1847980053384 589.05721 +347 0.263772744000003 90.7385786211141 584.98859 +348 0.264532896000003 90.2954375047943 580.9579 +349 0.265293048000003 89.8553460069446 576.96466 +350 0.266053200000003 89.4182758195081 573.00845 +351 0.266813352000003 88.98419897083 569.08881 +352 0.267573504000003 88.5530878207684 565.20532 +353 0.268333656000003 88.1249150558887 561.35755 +354 0.269093808000003 87.699653684741 557.54508 +355 0.269853960000003 87.2772770332174 553.7675 +356 0.270614112000003 86.8577587399898 550.02439 +357 0.271374264000003 86.4410727520238 546.31536 +358 0.272134416000003 86.0271933201699 542.64 +359 0.272894568000003 85.6160949948288 538.99792 +360 0.273654720000003 85.2077526216896 535.38875 +361 0.274414872000003 84.8021413375405 531.8121 +362 0.275175024000003 84.3992365661486 528.26759 +363 0.275935176000003 83.9990140142104 524.75485 +364 0.276695328000003 83.6014496673678 521.27353 +365 0.277455480000003 83.2065197862924 517.82325 +366 0.278215632000003 82.8142009028335 514.40368 +367 0.278975784000003 82.4244698162306 511.01445 +368 0.279735936000003 82.037303589388 507.65523 +369 0.280496088000003 81.6526795452112 504.32567 +370 0.281256240000003 81.2705752630035 501.02543 +371 0.282016392000003 80.8909685749209 497.7542 +372 0.282776544000003 80.5138375624862 494.51164 +373 0.283536696000003 80.1391605531591 491.29743 +374 0.284296848000003 79.7669161169621 488.11125 +375 0.285057000000003 79.3970830631614 484.9528 +376 0.285817152000003 79.0296404370017 481.82176 +377 0.286577304000003 78.6645675164929 478.71783 +378 0.287337456000003 78.3018438092495 475.64071 +379 0.288097608000003 77.9414490493805 472.5901 +380 0.288857760000003 77.5833631944281 469.56571 +381 0.289617912000003 77.227566422357 466.56726 +382 0.290378064000003 76.8740391285905 463.59445 +383 0.291138216000003 76.5227619230939 460.64702 +384 0.291898368000003 76.1737156275044 457.72467 +385 0.292658520000003 75.8268812723066 454.82715 +386 0.293418672000003 75.4822400940518 451.95417 +387 0.294178824000003 75.1397735326215 449.10549 +388 0.294938976000003 74.7994632285345 446.28082 +389 0.295699128000003 74.4612910202948 443.47991 +390 0.296459280000003 74.1252389417822 440.70252 +391 0.297219432000003 73.7912892196827 437.94838 +392 0.297979584000003 73.4594242709597 435.21725 +393 0.298739736000003 73.1296267003634 432.50888 +394 0.299499888000003 72.8018792979795 429.82302 +395 0.300260040000003 72.4761650368155 427.15945 +396 0.301020192000003 72.152467070424 424.51793 +397 0.301780344000003 71.8307687305627 421.89822 +398 0.302540496000003 71.5110535248905 419.30008 +399 0.303300648000003 71.193305134698 416.72331 +400 0.304060800000003 70.8775074126734 414.16766 +401 0.304820952000003 70.563644380702 411.63293 +402 0.305581104000003 70.2517002276993 409.11888 +403 0.306341256000003 69.9416593074768 406.62531 +404 0.307101408000003 69.6335061366398 404.15201 +405 0.307861560000003 69.3272253925173 401.69876 +406 0.308621712000003 69.022801911123 399.26535 +407 0.309381864000003 68.720220685146 396.85158 +408 0.310142016000003 68.4194668619732 394.45726 +409 0.310902168000003 68.1205257417395 392.08217 +410 0.311662320000003 67.8233827754081 389.72612 +411 0.312422472000003 67.5280235628793 387.38892 +412 0.313182624000003 67.2344338511264 385.07037 +413 0.313942776000003 66.9425995323605 382.77029 +414 0.314702928000003 66.6525066422212 380.48849 +415 0.315463080000004 66.3641413579948 378.22478 +416 0.316223232000004 66.0774899968579 375.97898 +417 0.316983384000004 65.7925390141476 373.7509 +418 0.317743536000004 65.5092750016562 371.54038 +419 0.318503688000004 65.227684685951 369.34723 +420 0.319263840000004 64.9477549267189 367.17128 +421 0.320023992000004 64.6694727151346 365.01236 +422 0.320784144000004 64.3928251722528 362.8703 +423 0.321544296000004 64.1177995474231 360.74493 +424 0.322304448000004 63.8443832167285 358.63608 +425 0.323064600000004 63.5725636814455 356.54359 +426 0.323824752000004 63.3023285665273 354.46731 +427 0.324584904000004 63.0336656191077 352.40706 +428 0.325345056000004 62.7665627070274 350.36269 +429 0.326105208000004 62.5010078173802 348.33405 +430 0.326865360000004 62.2369890550809 346.32098 +431 0.327625512000004 61.974494641453 344.32333 +432 0.328385664000004 61.7135129128363 342.34095 +433 0.329145816000004 61.4540323192149 340.37369 +434 0.329905968000004 61.1960414228635 338.42141 +435 0.330666120000004 60.9395288970134 336.48395 +436 0.331426272000004 60.6844835245373 334.56118 +437 0.332186424000004 60.4308941966524 332.65295 +438 0.332946576000004 60.178749911641 330.75913 +439 0.333706728000004 59.9280397735904 328.87957 +440 0.334466880000004 59.6787529911486 327.01413 +441 0.335227032000004 59.4308788762987 325.1627 +442 0.335987184000004 59.1844068431495 323.32512 +443 0.336747336000004 58.9393264067429 321.50127 +444 0.337507488000004 58.6956271818782 319.69101 +445 0.338267640000004 58.4532988819521 317.89423 +446 0.339027792000004 58.212331317815 316.11078 +447 0.339787944000004 57.9727143966425 314.34055 +448 0.340548096000004 57.7344381208227 312.58341 +449 0.341308248000004 57.4974925868589 310.83924 +450 0.342068400000004 57.2618679842869 309.10791 +451 0.342828552000004 57.0275545946068 307.38931 +452 0.343588704000004 56.7945427902299 305.68331 +453 0.344348856000004 56.5628230334394 303.9898 +454 0.345109008000004 56.3323858753653 302.30867 +455 0.345869160000004 56.1032219549731 300.63979 +456 0.346629312000004 55.8753219980663 298.98306 +457 0.347389464000004 55.6486768163015 297.33836 +458 0.348149616000004 55.4232773062182 295.70557 +459 0.348909768000004 55.1991144482798 294.0846 +460 0.349669920000004 54.9761793059286 292.47534 +461 0.350430072000004 54.754463024653 290.87766 +462 0.351190224000004 54.5339568310674 289.29148 +463 0.351950376000004 54.3146520320034 287.71668 +464 0.352710528000004 54.0965400136141 286.15316 +465 0.353470680000004 53.8796122404898 284.60082 +466 0.354230832000004 53.6638602547849 283.05955 +467 0.354990984000004 53.4492756753571 281.52926 +468 0.355751136000004 53.2358501969173 280.00984 +469 0.356511288000004 53.023575589191 278.50121 +470 0.357271440000004 52.81244369609 277.00325 +471 0.358031592000004 52.6024464348962 275.51588 +472 0.358791744000004 52.3935757954543 274.03901 +473 0.359551896000004 52.1858238393767 272.57252 +474 0.360312048000004 51.9791826992572 271.11634 +475 0.361072200000004 51.7736445778962 269.67038 +476 0.361832352000004 51.5692017475347 268.23453 +477 0.362592504000004 51.3658465490993 266.80871 +478 0.363352656000004 51.1635713914559 265.39284 +479 0.364112808000004 50.9623687506736 263.98682 +480 0.364872960000004 50.762231169298 262.59057 +481 0.365633112000004 50.5631512556336 261.204 +482 0.366393264000004 50.365121683035 259.82703 +483 0.367153416000004 50.1681351892083 258.45956 +484 0.367913568000004 49.9721845755198 257.10153 +485 0.368673720000004 49.7772627063148 255.75284 +486 0.369433872000004 49.5833625082446 254.41342 +487 0.370194024000005 49.3904769696012 253.08318 +488 0.370954176000005 49.1985991396618 251.76204 +489 0.371714328000005 49.0077221280405 250.44993 +490 0.372474480000005 48.8178391040487 249.14677 +491 0.373234632000005 48.6289432960629 247.85248 +492 0.373994784000005 48.4410279909012 246.56698 +493 0.374754936000005 48.2540865332071 245.2902 +494 0.375515088000005 48.0681123248408 244.02206 +495 0.376275240000005 47.8830988242787 242.76249 +496 0.377035392000005 47.6990395460198 241.51141 +497 0.377795544000005 47.5159280599996 240.26876 +498 0.378555696000005 47.3337579910116 239.03446 +499 0.379315848000005 47.1525230181352 237.80844 +500 0.380076000000005 46.9722168741714 236.59062 +501 0.380836152000005 46.7928333450848 235.38095 +502 0.381596304000005 46.6143662694533 234.17935 +503 0.382356456000005 46.4368095379235 232.98576 +504 0.383116608000005 46.2601570926735 231.80009 +505 0.383876760000005 46.0844029268819 230.6223 +506 0.384636912000005 45.9095410842036 229.45231 +507 0.385397064000005 45.7355656582515 228.29006 +508 0.386157216000005 45.562470792085 227.13548 +509 0.386917368000005 45.3902506777042 225.98851 +510 0.387677520000005 45.2188995555506 224.84909 +511 0.388437672000005 45.0484117140137 223.71714 +512 0.389197824000005 44.8787814889435 222.59262 +513 0.389957976000005 44.7100032631686 221.47546 +514 0.390718128000005 44.5420714660211 220.36559 +515 0.391478280000005 44.3749805728656 219.26296 +516 0.392238432000005 44.2087251046351 218.16751 +517 0.392998584000005 44.0432996273722 217.07918 +518 0.393758736000005 43.8786987517752 215.99792 +519 0.394518888000005 43.7149171327502 214.92365 +520 0.395279040000005 43.5519494689683 213.85633 +521 0.396039192000005 43.3897905024279 212.7959 +522 0.396799344000005 43.2284350180224 211.7423 +523 0.397559496000005 43.0678778431131 210.69547 +524 0.398319648000005 42.9081138471066 209.65537 +525 0.399079800000005 42.7491379410376 208.62194 +526 0.399839952000005 42.5909450771569 207.59512 +527 0.400600104000005 42.4335302485233 206.57486 +528 0.401360256000005 42.276888488601 205.56111 +529 0.402120408000005 42.1210148708617 204.55381 +530 0.402880560000005 41.9659045083911 203.55292 +531 0.403640712000005 41.8115525534996 202.55838 +532 0.404400864000005 41.6579541973385 201.57014 +533 0.405161016000005 41.5051046695197 200.58815 +534 0.405921168000005 41.3529992377405 199.61236 +535 0.406681320000005 41.2016332074121 198.64272 +536 0.407441472000005 41.0510019212931 197.67918 +537 0.408201624000005 40.9011007591262 196.7217 +538 0.408961776000005 40.7519251372804 195.77022 +539 0.409721928000005 40.603470508396 194.8247 +540 0.410482080000005 40.4557323610349 193.8851 +541 0.411242232000005 40.3087062193334 192.95136 +542 0.412002384000005 40.1623876426606 192.02343 +543 0.412762536000005 40.0167722252794 191.10128 +544 0.413522688000005 39.8718555960123 190.18486 +545 0.414282840000005 39.7276334179099 189.27412 +546 0.415042992000005 39.5841013879244 188.36902 +547 0.415803144000005 39.441255236586 187.46952 +548 0.416563296000005 39.2990907276829 186.57557 +549 0.417323448000005 39.1576036579454 185.68712 +550 0.418083600000005 39.0167898567334 184.80414 +551 0.418843752000005 38.8766451857269 183.92658 +552 0.419603904000005 38.7371655386208 183.05441 +553 0.420364056000005 38.5983468408223 182.18757 +554 0.421124208000005 38.4601850491525 181.32603 +555 0.421884360000005 38.3226761515503 180.46975 +556 0.422644512000005 38.185816166781 179.61869 +557 0.423404664000005 38.0496011441464 178.7728 +558 0.424164816000005 37.9140271631997 177.93205 +559 0.424924968000006 37.7790903334627 177.0964 +560 0.425685120000006 37.6447867941464 176.26581 +561 0.426445272000006 37.5111127138743 175.44024 +562 0.427205424000006 37.3780642904093 174.61966 +563 0.427965576000006 37.2456377503834 173.80402 +564 0.428725728000006 37.1138293490302 172.99328 +565 0.429485880000006 36.9826353699205 172.18742 +566 0.430246032000006 36.8520521247007 171.38639 +567 0.431006184000006 36.7220759528341 170.59016 +568 0.431766336000006 36.5927032213451 169.79869 +569 0.432526488000006 36.463930324566 169.01195 +570 0.433286640000006 36.3357536838867 168.22989 +571 0.434046792000006 36.2081697475072 167.45249 +572 0.434806944000006 36.0811749901924 166.67971 +573 0.435567096000006 35.9547659130299 165.91152 +574 0.436327248000006 35.8289390431905 165.14788 +575 0.437087400000006 35.7036909336908 164.38875 +576 0.437847552000006 35.5790181631589 163.63411 +577 0.438607704000006 35.4549173356021 162.88393 +578 0.439367856000006 35.3313850801777 162.13815 +579 0.440128008000006 35.2084180509657 161.39677 +580 0.440888160000006 35.0860129267438 160.65974 +581 0.441648312000006 34.9641664107661 159.92703 +582 0.442408464000006 34.8428752305421 159.1986 +583 0.443168616000006 34.7221361376199 158.47444 +584 0.443928768000006 34.6019459073706 157.7545 +585 0.444688920000006 34.4823013387753 157.03876 +586 0.445449072000006 34.3631992542147 156.32718 +587 0.446209224000006 34.2446364992603 155.61974 +588 0.446969376000006 34.1266099424681 154.9164 +589 0.447729528000006 34.0091164751749 154.21714 +590 0.448489680000006 33.8921530112957 153.52192 +591 0.449249832000006 33.7757164871243 152.83072 +592 0.450009984000006 33.6598038611353 152.1435 +593 0.450770136000006 33.5444121137886 151.46024 +594 0.451530288000006 33.4295382473356 150.78091 +595 0.452290440000006 33.3151792856276 150.10549 +596 0.453050592000006 33.2013322739262 149.43393 +597 0.453810744000006 33.0879942787157 148.76622 +598 0.454570896000006 32.975162387517 148.10233 +599 0.455331048000006 32.8628337087045 147.44223 +600 0.456091200000006 32.7510053713234 146.7859 +601 0.456851352000006 32.6396745249103 146.13329 +602 0.457611504000006 32.5288383393148 145.4844 +603 0.458371656000006 32.4184940045231 144.8392 +604 0.459131808000006 32.3086387304837 144.19765 +605 0.459891960000006 32.1992697469345 143.55973 +606 0.460652112000006 32.0903843032317 142.92541 +607 0.461412264000006 31.9819796681811 142.29468 +608 0.462172416000006 31.87405312987 141.6675 +609 0.462932568000006 31.7666019955019 141.04386 +610 0.463692720000006 31.6596235912321 140.42371 +611 0.464452872000006 31.5531152620057 139.80705 +612 0.465213024000006 31.447074371396 139.19385 +613 0.465973176000006 31.3414983014465 138.58407 +614 0.466733328000006 31.2363844525123 137.97771 +615 0.467493480000006 31.1317302431049 137.37472 +616 0.468253632000006 31.0275331097374 136.7751 +617 0.469013784000006 30.9237905067719 136.17882 +618 0.469773936000006 30.820499906268 135.58585 +619 0.470534088000006 30.7176587978333 134.99617 +620 0.471294240000006 30.6152646884751 134.40976 +621 0.472054392000006 30.5133151024534 133.82659 +622 0.472814544000006 30.4118075811357 133.24665 +623 0.473574696000006 30.3107396828532 132.66991 +624 0.474334848000006 30.2101089827584 132.09635 +625 0.475095000000006 30.1099130726839 131.52595 +626 0.475855152000006 30.0101495610027 130.95868 +627 0.476615304000006 29.9108160724906 130.39452 +628 0.477375456000006 29.8119102481885 129.83346 +629 0.478135608000006 29.7134297452675 129.27547 +630 0.478895760000006 29.6153722368941 128.72053 +631 0.479655912000007 29.5177354120983 128.16862 +632 0.480416064000007 29.420516975641 127.61972 +633 0.481176216000007 29.3237146478845 127.0738 +634 0.481936368000007 29.227326164663 126.53086 +635 0.482696520000007 29.1313492771553 125.99086 +636 0.483456672000007 29.0357817517581 125.4538 +637 0.484216824000007 28.9406213699608 124.91964 +638 0.484976976000007 28.8458659282215 124.38837 +639 0.485737128000007 28.7515132378441 123.85997 +640 0.486497280000007 28.6575611248569 123.33442 +641 0.487257432000007 28.5640074298919 122.8117 +642 0.488017584000007 28.4708500080658 122.29179 +643 0.488777736000007 28.3780867288615 121.77468 +644 0.489537888000007 28.2857154760117 121.26034 +645 0.490298040000007 28.1937341473823 120.74876 +646 0.491058192000007 28.1021406548585 120.23991 +647 0.491818344000007 28.0109329242303 119.73379 +648 0.492578496000007 27.9201088950807 119.23037 +649 0.493338648000007 27.829666520674 118.72963 +650 0.494098800000007 27.739603767845 118.23155 +651 0.494858952000007 27.6499186168902 117.73613 +652 0.495619104000007 27.5606090614595 117.24333 +653 0.496379256000007 27.4716731084483 116.75315 +654 0.497139408000007 27.3831087778921 116.26557 +655 0.497899560000007 27.2949141028605 115.78056 +656 0.498659712000007 27.2070871293535 115.29812 +657 0.499419864000007 27.1196259161981 114.81822 +658 0.500180016000007 27.0325285349458 114.34085 +659 0.500940168000007 26.9457930697716 113.86599 +660 0.501700320000007 26.8594176173735 113.39363 +661 0.502460472000007 26.773400286873 112.92374 +662 0.503220624000007 26.6877391997169 112.45632 +663 0.503980776000007 26.6024324895793 111.99135 +664 0.504740928000007 26.5174783022655 111.52881 +665 0.505501080000007 26.4328747956159 111.06868 +666 0.506261232000007 26.3486201394112 110.61096 +667 0.507021384000007 26.2647125152785 110.15562 +668 0.507781536000007 26.1811501165983 109.70264 +669 0.508541688000007 26.0979311484122 109.25202 +670 0.509301840000007 26.0150538273315 108.80374 +671 0.510061992000007 25.9325163814467 108.35779 +672 0.510822144000007 25.850317050238 107.91414 +673 0.511582296000007 25.7684540844863 107.47278 +674 0.512342448000007 25.6869257461851 107.03371 +675 0.513102600000007 25.6057303084534 106.5969 +676 0.513862752000007 25.5248660554495 106.16234 +677 0.514622904000007 25.4443312822849 105.73001 +678 0.515383056000007 25.3641242949399 105.29991 +679 0.516143208000007 25.2842434101794 104.87201 +680 0.516903360000007 25.2046869554696 104.44631 +681 0.517663512000007 25.1254532688955 104.02279 +682 0.518423664000007 25.0465406990791 103.60143 +683 0.519183816000007 24.9679476050986 103.18222 +684 0.519943968000007 24.8896723564077 102.76515 +685 0.520704120000007 24.8117133327565 102.35021 +686 0.521464272000007 24.7340689241122 101.93738 +687 0.522224424000007 24.6567375305816 101.52664 +688 0.522984576000007 24.5797175623331 101.11799 +689 0.523744728000007 24.5030074395202 100.71142 +690 0.524504880000007 24.4266055922057 100.3069 +691 0.525265032000007 24.3505104602859 99.904426 +692 0.526025184000007 24.2747204934167 99.503987 +693 0.526785336000007 24.1992341509386 99.105568 +694 0.527545488000007 24.1240499018042 98.709157 +695 0.528305640000007 24.0491662245054 98.314742 +696 0.529065792000007 23.9745816070011 97.922309 +697 0.529825944000007 23.9002945466459 97.531847 +698 0.530586096000007 23.8263035501196 97.143343 +699 0.531346248000007 23.752607133357 96.756786 +700 0.532106400000007 23.6792038214782 96.372163 +701 0.532866552000007 23.6060921487201 95.989462 +702 0.533626704000007 23.533270658368 95.608672 +703 0.534386856000007 23.4607379026877 95.22978 +704 0.535147008000007 23.388492442859 94.852775 +705 0.535907160000007 23.3165328489086 94.477646 +706 0.536667312000008 23.2448576996449 94.104381 +707 0.537427464000008 23.1734655825922 93.732968 +708 0.538187616000008 23.1023550939262 93.363396 +709 0.538947768000008 23.03152483841 92.995654 +710 0.539707920000008 22.96097342933 92.629731 +711 0.540468072000008 22.8906994884336 92.265615 +712 0.541228224000008 22.8207016458661 91.903296 +713 0.541988376000008 22.7509785401093 91.542762 +714 0.542748528000008 22.6815288179196 91.184004 +715 0.543508680000008 22.6123511342675 90.827009 +716 0.544268832000008 22.5434441522773 90.471768 +717 0.545028984000008 22.474806543167 90.11827 +718 0.545789136000008 22.4064369861894 89.766504 +719 0.546549288000008 22.338334168573 89.416459 +720 0.547309440000008 22.270496785464 89.068126 +721 0.548069592000008 22.2029235398684 88.721494 +722 0.548829744000008 22.1356131425947 88.376553 +723 0.549589896000008 22.0685643121975 88.033293 +724 0.550350048000008 22.0017757749208 87.691703 +725 0.551110200000008 21.9352462646423 87.351774 +726 0.551870352000008 21.8689745228183 87.013496 +727 0.552630504000008 21.8029592984287 86.676859 +728 0.553390656000008 21.7371993479228 86.341852 +729 0.554150808000008 21.671693435165 86.008467 +730 0.554910960000008 21.606440331382 85.676694 +731 0.555671112000008 21.5414388151091 85.346522 +732 0.556431264000008 21.4766876721383 85.017944 +733 0.557191416000008 21.4121856954658 84.690948 +734 0.557951568000008 21.3479316852405 84.365526 +735 0.558711720000008 21.2839244487129 84.041669 +736 0.559471872000008 21.2201628001841 83.719366 +737 0.560232024000008 21.1566455609557 83.39861 +738 0.560992176000008 21.0933715592796 83.079391 +739 0.561752328000008 21.0303396303089 82.7617 +740 0.562512480000008 20.9675486160484 82.445527 +741 0.563272632000008 20.9049973653061 82.130865 +742 0.564032784000008 20.8426847336453 81.817704 +743 0.564792936000008 20.780609583336 81.506035 +744 0.565553088000008 20.718770783308 81.195849 +745 0.566313240000008 20.6571672091039 80.887139 +746 0.567073392000008 20.5957977428321 80.579895 +747 0.567833544000008 20.5346612731207 80.274108 +748 0.568593696000008 20.4737566950716 79.969771 +749 0.569353848000008 20.4130829102149 79.666875 +750 0.570114000000008 20.3526388264641 79.365411 +751 0.570874152000008 20.292423358071 79.065372 +752 0.571634304000008 20.2324354255813 78.766748 +753 0.572394456000008 20.1726739557909 78.469532 +754 0.573154608000008 20.1131378817022 78.173716 +755 0.573914760000008 20.0538261424804 77.879291 +756 0.574674912000008 19.994737683411 77.58625 +757 0.575435064000008 19.9358714558572 77.294585 +758 0.576195216000008 19.8772264172174 77.004287 +759 0.576955368000008 19.8188015308835 76.715348 +760 0.577715520000008 19.7605957661995 76.427762 +761 0.578475672000008 19.7026080984199 76.14152 +762 0.579235824000008 19.6448375086694 75.856615 +763 0.579995976000008 19.5872829839018 75.573038 +764 0.580756128000008 19.5299435168602 75.290783 +765 0.581516280000008 19.472818106037 75.009841 +766 0.582276432000008 19.4159057556344 74.730206 +767 0.583036584000008 19.3592054755251 74.451869 +768 0.583796736000008 19.3027162812135 74.174824 +769 0.584556888000008 19.2464371937969 73.899063 +770 0.585317040000008 19.1903672399277 73.624579 +771 0.586077192000008 19.1345054517748 73.351365 +772 0.586837344000008 19.0788508669865 73.079412 +773 0.587597496000008 19.0234025286527 72.808716 +774 0.588357648000008 18.9681594852684 72.539267 +775 0.589117800000008 18.9131207906962 72.27106 +776 0.589877952000008 18.8582855041306 72.004086 +777 0.590638104000008 18.8036526900613 71.73834 +778 0.591398256000009 18.7492214182375 71.473815 +779 0.592158408000009 18.6949907636324 71.210503 +780 0.592918560000009 18.6409598064079 70.948397 +781 0.593678712000009 18.5871276318792 70.687491 +782 0.594438864000009 18.5334933304806 70.427779 +783 0.595199016000009 18.4800559977308 70.169253 +784 0.595959168000009 18.4268147341986 69.911907 +785 0.596719320000009 18.373768645469 69.655735 +786 0.597479472000009 18.3209168421098 69.400729 +787 0.598239624000009 18.268258439638 69.146884 +788 0.598999776000009 18.2157925584865 68.894192 +789 0.599759928000009 18.1635183239718 68.625994 +790 0.600520080000009 18.1114601849061 68.375921 +791 0.601280232000009 18.0595661373698 68.144101 +792 0.602040384000009 18.0078604353563 67.897161 +793 0.602800536000009 17.9563418124902 67.651878 +794 0.603560688000009 17.9050090139242 67.40824 +795 0.604320840000009 17.8538607962331 67.166229 +796 0.605080992000009 17.8028959273069 66.925832 +797 0.605841144000009 17.7521131862474 66.687034 +798 0.606601296000009 17.7015113632629 66.44982 +799 0.607361448000009 17.6510892595673 66.214176 +800 0.608121600000009 17.6008456872772 65.980087 +801 0.608881752000009 17.5507794693122 65.74754 +802 0.609641904000009 17.5008894392945 65.51652 +803 0.610402056000009 17.4511744414517 65.287014 +804 0.611162208000009 17.4016333305174 65.059008 +805 0.611922360000009 17.3522649716365 64.832488 +806 0.612682512000009 17.3030682402685 64.60744 +807 0.613442664000009 17.2540420220926 64.383852 +808 0.614202816000009 17.2051852129151 64.161709 +809 0.614962968000009 17.1564967185753 63.941 +810 0.615723120000009 17.1079754548548 63.72171 +811 0.616483272000009 17.0596203473856 63.503828 +812 0.617243424000009 17.0114303315605 63.287339 +813 0.618003576000009 16.963404352444 63.072232 +814 0.618763728000009 16.9155413646837 62.858494 +815 0.619523880000009 16.8678403324228 62.646113 +816 0.620284032000009 16.8203002292139 62.435075 +817 0.621044184000009 16.7729200379327 62.22537 +818 0.621804336000009 16.7256987506939 62.016984 +819 0.622564488000009 16.6786353687662 61.809907 +820 0.623324640000009 16.6317289024894 61.604125 +821 0.624084792000009 16.5849783711924 61.399628 +822 0.624844944000009 16.538382803111 61.196403 +823 0.625605096000009 16.4919412353065 60.994439 +824 0.626365248000009 16.4456527135871 60.793725 +825 0.627125400000009 16.3995162924268 60.594249 +826 0.627885552000009 16.3535310348888 60.396 +827 0.628645704000009 16.3076960125455 60.198966 +828 0.629405856000009 16.2620103054031 60.003138 +829 0.630166008000009 16.2164730018245 59.808503 +830 0.630926160000009 16.1710831984538 59.615052 +831 0.631686312000009 16.1258400001414 59.422772 +832 0.632446464000009 16.0807425198699 59.231655 +833 0.633206616000009 16.0357898786805 59.041688 +834 0.633966768000009 15.9909812056003 58.852862 +835 0.634726920000009 15.9463156375697 58.665166 +836 0.635487072000009 15.9017923193721 58.47859 +837 0.636247224000009 15.8574104035616 58.293124 +838 0.637007376000009 15.8131690503943 58.108757 +839 0.637767528000009 15.7690674277579 57.92548 +840 0.638527680000009 15.7251047111033 57.743283 +841 0.639287832000009 15.6812800833764 57.562156 +842 0.640047984000009 15.6375927349504 57.382089 +843 0.640808136000009 15.5940418635593 57.203073 +844 0.641568288000009 15.5506266742307 57.025098 +845 0.642328440000009 15.5073463792215 56.848154 +846 0.643088592000009 15.4642001979512 56.672233 +847 0.643848744000009 15.4211873569392 56.497324 +848 0.644608896000009 15.3783070897392 56.32342 +849 0.645369048000009 15.3355586368772 56.150509 +850 0.64612920000001 15.2929412457879 55.978585 +851 0.64688935200001 15.2504541707531 55.807636 +852 0.64764950400001 15.2080966728397 55.637656 +853 0.64840965600001 15.1658680198395 55.468634 +854 0.64916980800001 15.123767486207 55.300563 +855 0.64992996000001 15.0817943530017 55.133433 +856 0.65069011200001 15.0399479078268 54.967236 +857 0.65145026400001 14.9982274447715 54.801963 +858 0.65221041600001 14.9566322643522 54.637606 +859 0.65297056800001 14.9151616734549 54.474157 +860 0.65373072000001 14.8738149852777 54.311608 +861 0.65449087200001 14.8325915192741 54.149949 +862 0.65525102400001 14.7914906010969 53.989174 +863 0.65601117600001 14.7505115625423 53.829273 +864 0.65677132800001 14.7096537414946 53.67024 +865 0.65753148000001 14.6689164818715 53.512066 +866 0.65829163200001 14.6282991335696 53.354743 +867 0.65905178400001 14.5878010524111 53.198264 +868 0.65981193600001 14.5474216000899 53.042621 +869 0.66057208800001 14.5071601441187 52.887806 +870 0.66133224000001 14.4670160577774 52.733811 +871 0.66209239200001 14.4269887200601 52.58063 +872 0.66285254400001 14.3870775156245 52.428255 +873 0.66361269600001 14.3472818347401 52.276678 +874 0.66437284800001 14.3076010732381 52.125892 +875 0.66513300000001 14.2680346324614 51.97589 +876 0.66589315200001 14.2285819192142 51.826665 +877 0.66665330400001 14.1892423457131 51.67821 +878 0.66741345600001 14.1500153295387 51.530518 +879 0.66817360800001 14.1109002935862 51.383581 +880 0.66893376000001 14.0718966660182 51.237393 +881 0.66969391200001 14.0330038802168 51.091947 +882 0.67045406400001 13.994221374736 50.947236 +883 0.67121421600001 13.9555485932558 50.803254 +884 0.67197436800001 13.9169849845352 50.659994 +885 0.67273452000001 13.878530002366 50.517448 +886 0.67349467200001 13.8401831055278 50.375612 +887 0.67425482400001 13.8019437577426 50.234478 +888 0.67501497600001 13.7638114276296 50.09404 +889 0.67577512800001 13.7257855886611 49.954291 +890 0.67653528000001 13.6878657191186 49.815226 +891 0.67729543200001 13.6500513020487 49.676837 +892 0.67805558400001 13.6123418252201 49.539119 +893 0.67881573600001 13.5747367810802 49.402066 +894 0.67957588800001 13.5372356667132 49.265671 +895 0.68033604000001 13.4998379837971 49.129929 +896 0.68109619200001 13.4625432385624 48.994834 +897 0.68185634400001 13.4253509417505 48.860379 +898 0.68261649600001 13.388260608572 48.726559 +899 0.68337664800001 13.3512717586666 48.593369 +900 0.68413680000001 13.314383916062 48.460801 +901 0.68489695200001 13.2775966091343 48.328851 +902 0.68565710400001 13.2409093705675 48.197513 +903 0.68641725600001 13.2043217373146 48.066781 +904 0.68717740800001 13.1678332505583 47.936651 +905 0.68793756000001 13.1314434556718 47.807115 +906 0.68869771200001 13.0951519021809 47.67817 +907 0.68945786400001 13.0589581437251 47.549809 +908 0.69021801600001 13.0228617380205 47.422027 +909 0.69097816800001 12.9868622468218 47.294819 +910 0.69173832000001 12.9509592358847 47.168179 +911 0.69249847200001 12.9151522749294 47.042104 +912 0.69325862400001 12.8794409376043 46.916586 +913 0.69401877600001 12.8438248014488 46.791622 +914 0.69477892800001 12.8083034478578 46.667206 +915 0.69553908000001 12.772876462046 46.543333 +916 0.69629923200001 12.737543433012 46.419998 +917 0.69705938400001 12.7023039535036 46.297197 +918 0.69781953600001 12.6671576199828 46.174924 +919 0.69857968800001 12.6321040325908 46.053174 +920 0.69933984000001 12.5971427951142 45.931944 +921 0.70009999200001 12.5622735149508 45.811227 +922 0.700860144000011 12.527495803076 45.69102 +923 0.701620296000011 12.4928092740087 45.571318 +924 0.702380448000011 12.4582135457786 45.452116 +925 0.703140600000011 12.4237082398937 45.33341 +926 0.703900752000011 12.3892929813065 45.215195 +927 0.704660904000011 12.3549673983826 45.097466 +928 0.705421056000011 12.3207311228677 44.98022 +929 0.706181208000011 12.2865837898568 44.863452 +930 0.706941360000011 12.2525250377611 44.747157 +931 0.707701512000011 12.218554508278 44.631331 +932 0.708461664000011 12.1846718463593 44.515971 +933 0.709221816000011 12.1508767001807 44.401071 +934 0.709981968000011 12.1171687211102 44.286627 +935 0.710742120000011 12.0835475636791 44.172636 +936 0.711502272000011 12.050012885551 44.059094 +937 0.712262424000011 12.016564347492 43.945995 +938 0.713022576000011 11.9832016133413 43.833337 +939 0.713782728000011 11.9499243499816 43.721115 +940 0.714542880000011 11.9167322273098 43.609325 +941 0.715303032000011 11.8836249182085 43.497964 +942 0.716063184000011 11.8506020985169 43.387027 +943 0.716823336000011 11.8176634470022 43.276511 +944 0.717583488000011 11.7848086453318 43.166412 +945 0.718343640000011 11.7520373780451 43.056726 +946 0.719103792000011 11.7193493325251 42.947449 +947 0.719863944000011 11.6867441989721 42.838578 +948 0.720624096000011 11.6542216703749 42.73011 +949 0.721384248000011 11.6217814424848 42.622039 +950 0.722144400000011 11.5894232137878 42.514364 +951 0.722904552000011 11.5571466854786 42.407079 +952 0.723664704000011 11.5249515614335 42.300183 +953 0.724424856000011 11.4928375481846 42.193671 +954 0.725185008000011 11.4608043548933 42.08754 +955 0.725945160000011 11.4288516933248 41.981786 +956 0.726705312000011 11.3969792778223 41.876406 +957 0.727465464000011 11.3651868252812 41.771397 +958 0.728225616000011 11.3334740551243 41.666756 +959 0.728985768000011 11.3018406892767 41.562479 +960 0.729745920000011 11.2702864521405 41.458563 +961 0.730506072000011 11.2388110705709 41.355004 +962 0.731266224000011 11.2074142738508 41.2518 +963 0.732026376000011 11.1760957936672 41.148948 +964 0.732786528000011 11.1448553640869 41.046443 +965 0.733546680000011 11.1136927215328 40.944284 +966 0.734306832000011 11.0826076047599 40.842467 +967 0.735066984000011 11.0515997548319 40.74099 +968 0.735827136000011 11.020668915098 40.639848 +969 0.736587288000011 10.9898148311696 40.53904 +970 0.737347440000011 10.9590372508974 40.438562 +971 0.738107592000011 10.9283359243486 40.338411 +972 0.738867744000011 10.8977106037848 40.238584 +973 0.739627896000011 10.8671610436385 40.13908 +974 0.740388048000011 10.836687000492 40.039894 +975 0.741148200000011 10.8062882330548 39.941024 +976 0.741908352000011 10.7759645021417 39.842467 +977 0.742668504000011 10.7457155706511 39.744221 +978 0.743428656000011 10.7155412035438 39.646283 +979 0.744188808000011 10.6854411678214 39.54865 +980 0.744948960000011 10.6554152325051 39.45132 +981 0.745709112000011 10.6254631686144 39.354289 +982 0.746469264000011 10.5955847491471 39.257556 +983 0.747229416000011 10.5657797490576 39.161118 +984 0.747989568000011 10.5360479452373 39.064972 +985 0.748749720000011 10.5063891164936 38.969115 +986 0.749509872000011 10.4768030435299 38.873546 +987 0.750270024000011 10.4472895089256 38.778262 +988 0.751030176000011 10.4178482971165 38.68326 +989 0.751790328000011 10.3884791943743 38.588538 +990 0.752550480000011 10.3591819887884 38.494093 +991 0.753310632000011 10.3299564702448 38.399924 +992 0.754070784000011 10.3008024304085 38.306028 +993 0.754830936000011 10.2717196627033 38.212402 +994 0.755591088000012 10.2427079622934 38.119045 +995 0.756351240000012 10.2137671260642 38.025954 +996 0.757111392000012 10.1848969526047 37.933126 +997 0.757871544000012 10.1560972421874 37.840561 +998 0.758631696000012 10.1273677967517 37.748254 +999 0.759391848000012 10.0987084198844 37.656206 +1000 0.760152000000012 10.0701189168025 37.564412 +1001 0.760912152000012 10.0415990943347 37.472871 +1002 0.761672304000012 10.0131487609043 37.381581 +1003 0.762432456000012 9.98476772651106 37.290541 +1004 0.763192608000012 9.95645580271441 37.199747 +1005 0.763952760000012 9.92821280261518 37.109198 +1006 0.764712912000012 9.90003854083943 37.018892 +1007 0.765473064000012 9.87193283352087 36.928826 +1008 0.766233216000012 9.84389549828415 36.839 +1009 0.766993368000012 9.81592635422802 36.749411 +1010 0.767753520000012 9.78802522190896 36.660057 +1011 0.768513672000012 9.76019192332431 36.570936 +1012 0.769273824000012 9.7324262818965 36.482046 +1013 0.770033976000012 9.70472812245607 36.393386 +1014 0.770794128000012 9.67709727122682 36.304954 +1015 0.771554280000012 9.64953355580833 36.216747 +1016 0.772314432000012 9.6220368051615 36.128765 +1017 0.773074584000012 9.59460684959226 36.041005 +1018 0.773834736000012 9.56724352073597 35.953466 +1019 0.774594888000012 9.53994665154256 35.866146 +1020 0.775355040000012 9.51271607626052 35.779042 +1021 0.776115192000012 9.4855516304222 35.692155 +1022 0.776875344000012 9.45845315082883 35.605481 +1023 0.777635496000012 9.43142047553547 35.519019 +1024 0.778395648000012 9.40445344383622 35.432768 +1025 0.779155800000012 9.37755189624974 35.346726 +1026 0.779915952000012 9.35071567450431 35.260892 +1027 0.780676104000012 9.32394462152419 35.175263 +1028 0.781436256000012 9.29723858141465 35.089839 +1029 0.782196408000012 9.27059739944806 35.004617 +1030 0.782956560000012 9.24402092204981 34.919597 +1031 0.783716712000012 9.2175089967849 34.834776 +1032 0.784476864000012 9.19106147234286 34.750154 +1033 0.785237016000012 9.16467819852582 34.665729 +1034 0.785997168000012 9.13835902623334 34.581499 +1035 0.786757320000012 9.11210380744999 34.497463 +1036 0.787517472000012 9.08591239523176 34.41362 +1037 0.788277624000012 9.05978464369257 34.329968 +1038 0.789037776000012 9.03372040799148 34.246506 +1039 0.789797928000012 9.00771954431968 34.163232 +1040 0.790558080000012 8.98178190988762 34.080145 +1041 0.791318232000012 8.95590736291192 33.997245 +1042 0.792078384000012 8.93009576260326 33.914529 +1043 0.792838536000012 8.90434696915344 33.831996 +1044 0.793598688000012 8.87866084372309 33.749645 +1045 0.794358840000012 8.85303724842941 33.667475 +1046 0.795118992000012 8.8274760463341 33.585485 +1047 0.795879144000012 8.8019771014306 33.503673 +1048 0.796639296000012 8.77654027863295 33.422038 +1049 0.797399448000012 8.7511654437633 33.340579 +1050 0.798159600000012 8.72585246354078 33.259294 +1051 0.798919752000012 8.70060120556871 33.178184 +1052 0.799679904000012 8.67541153832437 33.097245 +1053 0.800440056000012 8.65028333114661 33.016478 +1054 0.801200208000012 8.62521645422446 32.935882 +1055 0.801960360000012 8.60021077858671 32.855454 +1056 0.802720512000012 8.57526617608994 32.775194 +1057 0.803480664000012 8.55038251940783 32.695102 +1058 0.804240816000012 8.52555968202007 32.615175 +1059 0.805000968000012 8.50079753820143 32.535413 +1060 0.805761120000012 8.47609596301143 32.455815 +1061 0.806521272000012 8.451454832283 32.37638 +1062 0.807281424000012 8.42687402261284 32.297107 +1063 0.808041576000012 8.40235341134972 32.217995 +1064 0.808801728000012 8.37789287658533 32.139042 +1065 0.809561880000013 8.35349229714341 32.060248 +1066 0.810322032000013 8.32915155256961 31.981613 +1067 0.811082184000013 8.30487052312144 31.903134 +1068 0.811842336000013 8.28064908975828 31.824812 +1069 0.812602488000013 8.25648713413173 31.746645 +1070 0.813362640000013 8.23238453857554 31.668632 +1071 0.814122792000013 8.20834118609592 31.590773 +1072 0.814882944000013 8.18435696036211 31.513066 +1073 0.815643096000013 8.16043174569666 31.435511 +1074 0.816403248000013 8.13656542706615 31.358107 +1075 0.817163400000013 8.11275789007172 31.280853 +1076 0.817923552000013 8.08900902094015 31.203748 +1077 0.818683704000013 8.0653187065142 31.126792 +1078 0.819443856000013 8.04168683424408 31.049984 +1079 0.820204008000013 8.01811329217779 30.973322 +1080 0.820964160000013 7.9945979689532 30.896806 +1081 0.821724312000013 7.97114075378817 30.820436 +1082 0.822484464000013 7.94774153647275 30.744211 +1083 0.823244616000013 7.92440020735981 30.668129 +1084 0.824004768000013 7.90111665735719 30.59219 +1085 0.824764920000013 7.8778907779185 30.516394 +1086 0.825525072000013 7.85472246103549 30.44074 +1087 0.826285224000013 7.83161159922918 30.365227 +1088 0.827045376000013 7.80855808554214 30.289854 +1089 0.827805528000013 7.78556181352968 30.21462 +1090 0.828565680000013 7.76262267725265 30.139526 +1091 0.829325832000013 7.73974057126874 30.06457 +1092 0.830085984000013 7.71691539062519 29.989752 +1093 0.830846136000013 7.69414703085037 29.915071 +1094 0.831606288000013 7.67143538794688 29.840527 +1095 0.832366440000013 7.64878035838305 29.766118 +1096 0.833126592000013 7.62618183908604 29.691845 +1097 0.833886744000013 7.60363972743382 29.617707 +1098 0.834646896000013 7.58115392124842 29.543702 +1099 0.835407048000013 7.55872431878794 29.469831 +1100 0.836167200000013 7.53635081873974 29.396094 +1101 0.836927352000013 7.51403332021296 29.322488 +1102 0.837687504000013 7.49177172273184 29.249015 +1103 0.838447656000013 7.46956592622824 29.175673 +1104 0.839207808000013 7.44741583103512 29.102461 +1105 0.839967960000013 7.42532133787931 29.02938 +1106 0.840728112000013 7.40328234787498 28.956429 +1107 0.841488264000013 7.38129876251671 28.883608 +1108 0.842248416000013 7.35937048367293 28.810915 +1109 0.843008568000013 7.33749741357968 28.73835 +1110 0.843768720000013 7.31567945483344 28.665914 +1111 0.844528872000013 7.29391651038526 28.593605 +1112 0.845289024000013 7.27220848353415 28.521422 +1113 0.846049176000013 7.25055527792088 28.449367 +1114 0.846809328000013 7.22895679752158 28.377437 +1115 0.847569480000013 7.20741294664209 28.305633 +1116 0.848329632000013 7.18592362991127 28.233955 +1117 0.849089784000013 7.16448875227526 28.162401 +1118 0.849849936000013 7.14310821899183 28.090972 +1119 0.850610088000013 7.121781935624 28.019666 +1120 0.851370240000013 7.1005098080344 27.948485 +1121 0.852130392000013 7.07929174237997 27.877426 +1122 0.852890544000013 7.05812764510563 27.806491 +1123 0.853650696000013 7.03701742293905 27.735678 +1124 0.854410848000013 7.01596098288516 27.664987 +1125 0.855171000000013 6.99495823222052 27.594418 +1126 0.855931152000013 6.97400907848786 27.523971 +1127 0.856691304000013 6.95311342949093 27.453644 +1128 0.857451456000013 6.9322711932893 27.383439 +1129 0.858211608000013 6.91148227819285 27.313353 +1130 0.858971760000013 6.89074659275674 27.243388 +1131 0.859731912000013 6.8700640457764 27.173543 +1132 0.860492064000013 6.84943454628268 27.103818 +1133 0.861252216000013 6.82885800353624 27.034211 +1134 0.862012368000013 6.80833432702333 26.964724 +1135 0.862772520000013 6.78786342645094 26.895355 +1136 0.863532672000013 6.76744521174133 26.826104 +1137 0.864292824000014 6.74707959302825 26.756972 +1138 0.865052976000014 6.72676648065142 26.687957 +1139 0.865813128000014 6.70650578515252 26.61906 +1140 0.866573280000014 6.68629741727057 26.55028 +1141 0.867333432000014 6.66614128793704 26.481617 +1142 0.868093584000014 6.64603730827217 26.413072 +1143 0.868853736000014 6.62598538957975 26.344642 +1144 0.869613888000014 6.60598544334341 26.276329 +1145 0.870374040000014 6.58603738122231 26.208132 +1146 0.871134192000014 6.56614111504668 26.140051 +1147 0.871894344000014 6.54629655681391 26.072086 +1148 0.872654496000014 6.52650361868446 26.004236 +1149 0.873414648000014 6.5067622129777 25.936501 +1150 0.874174800000014 6.48707225216809 25.868882 +1151 0.874934952000014 6.46743364888106 25.801377 +1152 0.875695104000014 6.44784631588943 25.733987 +1153 0.876455256000014 6.42831016610967 25.666711 +1154 0.877215408000014 6.40882511259737 25.59955 +1155 0.877975560000014 6.38939106854471 25.532502 +1156 0.878735712000014 6.37000794727585 25.465569 +1157 0.879495864000014 6.35067566224398 25.398749 +1158 0.880256016000014 6.3313941270272 25.332043 +1159 0.881016168000014 6.31216325532553 25.265451 +1160 0.881776320000014 6.29298296095713 25.198972 +1161 0.882536472000014 6.27385315785538 25.132606 +1162 0.883296624000014 6.25477376006464 25.066353 +1163 0.884056776000014 6.23574468173809 25.000212 +1164 0.884816928000014 6.2167658371336 24.934185 +1165 0.885577080000014 6.1978371406111 24.86827 +1166 0.886337232000014 6.17895850662897 24.802468 +1167 0.887097384000014 6.16012984974123 24.736778 +1168 0.887857536000014 6.14135108459475 24.6712 +1169 0.888617688000014 6.12262212592548 24.605734 +1170 0.889377840000014 6.10394288855629 24.54038 +1171 0.890137992000014 6.08531328739367 24.475139 +1172 0.890898144000014 6.066733237425 24.410009 +1173 0.891658296000014 6.04820265371557 24.34499 +1174 0.892418448000014 6.02972145140598 24.280083 +1175 0.893178600000014 6.01128954570939 24.215288 +1176 0.893938752000014 5.99290685190882 24.150604 +1177 0.894698904000014 5.97457328535459 24.086032 +1178 0.895459056000014 5.95628876146149 24.02157 +1179 0.896219208000014 5.93805319570663 23.95722 +1180 0.896979360000014 5.91986650362654 23.892981 +1181 0.897739512000014 5.90172860081505 23.828853 +1182 0.898499664000014 5.88363940292072 23.764836 +1183 0.899259816000014 5.8655988256443 23.70093 +1184 0.900019968000014 5.84760678473685 23.637134 +1185 0.900780120000014 5.82966319599697 23.573449 +1186 0.901540272000014 5.81176797526885 23.509875 +1187 0.902300424000014 5.79392103844002 23.446412 +1188 0.903060576000014 5.77612230143903 23.383059 +1189 0.903820728000014 5.75837168023367 23.319817 +1190 0.904580880000014 5.74066909082851 23.256685 +1191 0.905341032000014 5.72301444926296 23.193663 +1192 0.906101184000014 5.70540767160953 23.130752 +1193 0.906861336000014 5.6878486739714 23.067952 +1194 0.907621488000014 5.67033737248103 23.005261 +1195 0.908381640000014 5.65287368329778 22.942681 +1196 0.909141792000014 5.63545752260625 22.880211 +1197 0.909901944000014 5.61808880661482 22.817852 +1198 0.910662096000014 5.60076745155312 22.755602 +1199 0.911422248000014 5.58349337367094 22.693463 +1200 0.912182400000014 5.5662664892363 22.631434 +1201 0.912942552000014 5.54908671453385 22.569515 +1202 0.913702704000014 5.53195396586318 22.507706 +1203 0.914462856000014 5.51486815953694 22.446007 +1204 0.915223008000014 5.49782921188004 22.384418 +1205 0.915983160000014 5.48083703922732 22.322939 +1206 0.916743312000014 5.46389155792252 22.261571 +1207 0.917503464000014 5.44699268431673 22.200312 +1208 0.918263616000014 5.43014033476694 22.139163 +1209 0.919023768000015 5.41333442563466 22.078125 +1210 0.919783920000015 5.39657487328449 22.017196 +1211 0.920544072000015 5.37986159408313 21.956378 +1212 0.921304224000015 5.36319450439762 21.895669 +1213 0.922064376000015 5.34657352059434 21.835071 +1214 0.922824528000015 5.32999855903788 21.774582 +1215 0.923584680000015 5.31346953608967 21.714204 +1216 0.924344832000015 5.29698636810677 21.653935 +1217 0.925104984000015 5.28054897144099 21.593777 +1218 0.925865136000015 5.2641572624377 21.533729 +1219 0.926625288000015 5.2478111574347 21.473791 +1220 0.927385440000015 5.23151057276105 21.413962 +1221 0.928145592000015 5.21525542473638 21.354244 +1222 0.928905744000015 5.19904562966968 21.294636 +1223 0.929665896000015 5.18288110385861 21.235139 +1224 0.930426048000015 5.1667617635881 21.175751 +1225 0.931186200000015 5.15068752513015 21.116473 +1226 0.931946352000015 5.13465830474207 21.057306 +1227 0.932706504000015 5.11867401866664 20.998249 +1228 0.933466656000015 5.10273458313071 20.939302 +1229 0.934226808000015 5.08683991434433 20.880465 +1230 0.934986960000015 5.07098992850043 20.821739 +1231 0.935747112000015 5.05518454177387 20.763122 +1232 0.936507264000015 5.03942367032068 20.704617 +1233 0.937267416000015 5.02370723027743 20.646221 +1234 0.938027568000015 5.00803513776092 20.587936 +1235 0.938787720000015 4.99240730886675 20.529761 +1236 0.939547872000015 4.97682365966967 20.471697 +1237 0.940308024000015 4.96128410622242 20.413743 +1238 0.941068176000015 4.94578856455552 20.3559 +1239 0.941828328000015 4.93033695067638 20.298167 +1240 0.942588480000015 4.9149291805691 20.240544 +1241 0.943348632000015 4.89956517019394 20.183033 +1242 0.944108784000015 4.88424483548703 20.125631 +1243 0.944868936000015 4.86896809235938 20.068341 +1244 0.945629088000015 4.85373485669735 20.011161 +1245 0.946389240000015 4.83854504436162 19.954092 +1246 0.947149392000015 4.8233985711868 19.897133 +1247 0.947909544000015 4.80829535298161 19.840286 +1248 0.948669696000015 4.79323530552843 19.783549 +1249 0.949429848000015 4.77821834458248 19.726923 +1250 0.950190000000015 4.76324438587229 19.670408 +1251 0.950950152000015 4.74831334509891 19.614003 +1252 0.951710304000015 4.7334251379362 19.55771 +1253 0.952470456000015 4.71857968003007 19.501528 +1254 0.953230608000015 4.70377688699881 19.445457 +1255 0.953990760000015 4.6890166744325 19.389497 +1256 0.954750912000015 4.67429895789328 19.333647 +1257 0.955511064000015 4.65962365291474 19.277909 +1258 0.956271216000015 4.64499067500261 19.222283 +1259 0.957031368000015 4.63039993963364 19.166767 +1260 0.957791520000015 4.61585136225645 19.111363 +1261 0.958551672000015 4.60134485829104 19.05607 +1262 0.959311824000015 4.5868803431288 19.000888 +1263 0.960071976000015 4.5724577321327 18.945818 +1264 0.960832128000015 4.55807694063717 18.890859 +1265 0.961592280000015 4.54373788394811 18.836011 +1266 0.962352432000015 4.52944047734274 18.781275 +1267 0.963112584000015 4.51518463607037 18.726651 +1268 0.963872736000015 4.50097027535164 18.672138 +1269 0.964632888000015 4.48679731037929 18.617736 +1270 0.965393040000015 4.47266565631791 18.563447 +1271 0.966153192000015 4.45857522830405 18.509268 +1272 0.966913344000015 4.44452594144662 18.455202 +1273 0.967673496000015 4.43051771082694 18.401247 +1274 0.968433648000015 4.41655045149889 18.347404 +1275 0.969193800000015 4.40262407848919 18.293673 +1276 0.969953952000015 4.38873850679743 18.240054 +1277 0.970714104000015 4.37489365139675 18.186547 +1278 0.971474256000015 4.36108942723351 18.133151 +1279 0.972234408000015 4.34732574922798 18.079868 +1280 0.972994560000015 4.33360253227432 18.026696 +1281 0.973754712000016 4.31991969124118 17.973636 +1282 0.974514864000016 4.30627714097182 17.920689 +1283 0.975275016000016 4.29267479628441 17.867853 +1284 0.976035168000016 4.27911257197244 17.81513 +1285 0.976795320000016 4.26559038280497 17.762519 +1286 0.977555472000016 4.25210814352722 17.71002 +1287 0.978315624000016 4.23866576886063 17.657633 +1288 0.979075776000016 4.22526317350348 17.605358 +1289 0.979835928000016 4.21190027213126 17.553196 +1290 0.980596080000016 4.19857697939687 17.501146 +1291 0.981356232000016 4.18529320993129 17.449208 +1292 0.982116384000016 4.1720488783441 17.397383 +1293 0.982876536000016 4.15884389922351 17.34567 +1294 0.983636688000016 4.1456781871372 17.294069 +1295 0.984396840000016 4.13255165663255 17.242581 +1296 0.985156992000016 4.11946422223748 17.191205 +1297 0.985917144000016 4.1064157984606 17.139942 +1298 0.986677296000016 4.09340629979166 17.088791 +1299 0.987437448000016 4.08043564070236 17.037753 +1300 0.988197600000016 4.06750373564665 16.986827 +1301 0.988957752000016 4.05461049906158 16.936014 +1302 0.989717904000016 4.04175584536729 16.885314 +1303 0.990478056000016 4.02893968896826 16.834726 +1304 0.991238208000016 4.01616194425316 16.784251 +1305 0.991998360000016 4.00342252559598 16.733888 +1306 0.992758512000016 3.99072134735645 16.683638 +1307 0.993518664000016 3.97805832388046 16.633501 +1308 0.994278816000016 3.96543336950097 16.583476 +1309 0.995038968000016 3.95284639853823 16.533564 +1310 0.995799120000016 3.94029732530089 16.483765 +1311 0.996559272000016 3.92778606408616 16.434079 +1312 0.997319424000016 3.9153125291807 16.384505 +1313 0.998079576000016 3.90287663486137 16.335045 +1314 0.998839728000016 3.89047829539551 16.285697 +1315 0.999599880000016 3.87811742504202 16.236462 +1316 1.00036003200002 3.86579393772429 16.187346 +1317 1.00112018400002 3.85350773884626 16.13836 +1318 1.00188033600002 3.84125872483556 16.08951 +1319 1.00264048800002 3.82904679191626 16.040797 +1320 1.00340064000002 3.81687183655886 15.99222 +1321 1.00416079200002 3.80473375547986 15.943779 +1322 1.00492094400002 3.79263244564147 15.895473 +1323 1.00568109600002 3.78056780425113 15.847302 +1324 1.00644124800002 3.76853972876115 15.799266 +1325 1.00720140000002 3.75654811686839 15.751364 +1326 1.00796155200002 3.74459286651379 15.703597 +1327 1.00872170400002 3.73267387588201 15.655963 +1328 1.00948185600002 3.72079104340107 15.608463 +1329 1.01024200800002 3.70894426774194 15.561095 +1330 1.01100216000002 3.69713344781816 15.513861 +1331 1.01176231200002 3.68535848278544 15.466759 +1332 1.01252246400002 3.6736192720413 15.419789 +1333 1.01328261600002 3.66191571522467 15.372952 +1334 1.01404276800002 3.6502477122155 15.326245 +1335 1.01480292000002 3.63861516313439 15.27967 +1336 1.01556307200002 3.62701796834217 15.233226 +1337 1.01632322400002 3.61545602843955 15.186913 +1338 1.01708337600002 3.60392924426671 15.140729 +1339 1.01784352800002 3.59243751690292 15.094676 +1340 1.01860368000002 3.58098074766615 15.048753 +1341 1.01936383200002 3.56955883811271 15.002958 +1342 1.02012398400002 3.55817169003681 14.957293 +1343 1.02088413600002 3.54681920547021 14.911757 +1344 1.02164428800002 3.53550128668183 14.866349 +1345 1.02240444000002 3.52421783617734 14.821069 +1346 1.02316459200002 3.51296875669882 14.775916 +1347 1.02392474400002 3.5017539512243 14.730892 +1348 1.02468489600002 3.49057332296744 14.685994 +1349 1.02544504800002 3.47942677537711 14.641224 +1350 1.02620520000002 3.468314212137 14.59658 +1351 1.02696535200002 3.45723553716523 14.552062 +1352 1.02772550400002 3.44619065461401 14.50767 +1353 1.02848565600002 3.43517946886915 14.463403 +1354 1.02924580800002 3.42420188454978 14.419262 +1355 1.03000596000002 3.4132578065079 14.375246 +1356 1.03076611200002 3.402347139828 14.331355 +1357 1.03152626400002 3.39146978982667 14.287588 +1358 1.03228641600002 3.38062566205224 14.243946 +1359 1.03304656800002 3.36981466228434 14.200427 +1360 1.03380672000002 3.35903669653357 14.157031 +1361 1.03456687200002 3.34829167104106 14.113759 +1362 1.03532702400002 3.3375794922781 14.07061 +1363 1.03608717600002 3.32690006694574 14.027583 +1364 1.03684732800002 3.31625330197445 13.984678 +1365 1.03760748000002 3.30563910452366 13.941896 +1366 1.03836763200002 3.29505738198141 13.899235 +1367 1.03912778400002 3.28450804196395 13.856696 +1368 1.03988793600002 3.27399099231535 13.814277 +1369 1.04064808800002 3.26350614110713 13.77198 +1370 1.04140824000002 3.25305339663783 13.729803 +1371 1.04216839200002 3.24263266743267 13.687746 +1372 1.04292854400002 3.23224386224309 13.645809 +1373 1.04368869600002 3.22188689004644 13.603991 +1374 1.04444884800002 3.21156166004554 13.562293 +1375 1.04520900000002 3.20126808166831 13.520714 +1376 1.04596915200002 3.19100606456735 13.479254 +1377 1.04672930400002 3.18077551861957 13.437912 +1378 1.04748945600002 3.17057635392584 13.396688 +1379 1.04824960800002 3.16040848081052 13.355582 +1380 1.04900976000002 3.15027180982111 13.314593 +1381 1.04976991200002 3.14016625172788 13.273722 +1382 1.05053006400002 3.13009171752345 13.232967 +1383 1.05129021600002 3.1200481184224 13.19233 +1384 1.05205036800002 3.11003536586088 13.151808 +1385 1.05281052000002 3.10005337149623 13.111403 +1386 1.05357067200002 3.09010204720661 13.071114 +1387 1.05433082400002 3.08018130509054 13.03094 +1388 1.05509097600002 3.07029105746657 12.990881 +1389 1.05585112800002 3.06043121687288 12.950937 +1390 1.05661128000002 3.05060169606686 12.911108 +1391 1.05737143200002 3.04080240802477 12.871393 +1392 1.05813158400002 3.03103326594128 12.831792 +1393 1.05889173600002 3.02129418322913 12.792305 +1394 1.05965188800002 3.01158507351873 12.752931 +1395 1.06041204000002 3.00190585065777 12.713671 +1396 1.06117219200002 2.99225642871081 12.674523 +1397 1.06193234400002 2.9826367219589 12.635489 +1398 1.06269249600002 2.97304664489919 12.596566 +1399 1.06345264800002 2.96348611224455 12.557756 +1400 1.06421280000002 2.95395503892315 12.519057 +1401 1.06497295200002 2.94445334007811 12.48047 +1402 1.06573310400002 2.93498093106706 12.441994 +1403 1.06649325600002 2.92553772746178 12.403628 +1404 1.06725340800002 2.91612364504781 12.365374 +1405 1.06801356000002 2.90673859982404 12.32723 +1406 1.06877371200002 2.89738250800234 12.289196 +1407 1.06953386400002 2.88805528600715 12.251272 +1408 1.07029401600002 2.87875685047509 12.213457 +1409 1.07105416800002 2.8694871182546 12.175752 +1410 1.07181432000002 2.8602460064055 12.138155 +1411 1.07257447200002 2.85103343219863 12.100668 +1412 1.07333462400002 2.84184931311545 12.063288 +1413 1.07409477600002 2.83269356684767 12.026017 +1414 1.07485492800002 2.8235661112968 11.988854 +1415 1.07561508000002 2.81446686457385 11.951798 +1416 1.07637523200002 2.80539574499883 11.91485 +1417 1.07713538400002 2.79635267110046 11.878008 +1418 1.07789553600002 2.78733756161572 11.841274 +1419 1.07865568800002 2.77835033548948 11.804645 +1420 1.07941584000002 2.76939091187408 11.768124 +1421 1.08017599200002 2.760459210129 11.731708 +1422 1.08093614400002 2.75155514982041 11.695397 +1423 1.08169629600002 2.7426786507208 11.659193 +1424 1.08245644800002 2.73382963280859 11.623093 +1425 1.08321660000002 2.72500801626775 11.587098 +1426 1.08397675200002 2.71621372148739 11.551208 +1427 1.08473690400002 2.7074466690614 11.515422 +1428 1.08549705600002 2.69870677978799 11.47974 +1429 1.08625720800002 2.68999397466941 11.444162 +1430 1.08701736000002 2.68130817491145 11.408687 +1431 1.08777751200002 2.67264930192312 11.373316 +1432 1.08853766400002 2.66401727731624 11.338048 +1433 1.08929781600002 2.65541202290502 11.302882 +1434 1.09005796800002 2.64683346070575 11.267819 +1435 1.09081812000002 2.63828151293629 11.232858 +1436 1.09157827200002 2.62975610201582 11.197999 +1437 1.09233842400002 2.62125715056432 11.163241 +1438 1.09309857600002 2.61278458140227 11.128585 +1439 1.09385872800002 2.60433831755023 11.094031 +1440 1.09461888000002 2.59591828222842 11.059577 +1441 1.09537903200002 2.58752439885641 11.025223 +1442 1.09613918400002 2.57915659105265 10.99097 +1443 1.09689933600002 2.57081478263411 10.956817 +1444 1.09765948800002 2.56249889761592 10.922764 +1445 1.09841964000002 2.55420886021093 10.888811 +1446 1.09917979200002 2.54594459482935 10.854957 +1447 1.09993994400002 2.53770602607839 10.821202 +1448 1.10070009600002 2.52949307876179 10.787545 +1449 1.10146024800002 2.52130567787952 10.753987 +1450 1.10222040000002 2.51314374862735 10.720528 +1451 1.10298055200002 2.50500721639644 10.687166 +1452 1.10374070400002 2.49689600677302 10.653903 +1453 1.10450085600002 2.48881004553792 10.620736 +1454 1.10526100800002 2.48074925866625 10.587667 +1455 1.10602116000002 2.47271357232698 10.554695 +1456 1.10678131200002 2.46470291288255 10.52182 +1457 1.10754146400002 2.4567172068885 10.489042 +1458 1.10830161600002 2.44875638109308 10.456359 +1459 1.10906176800002 2.44082036243685 10.423773 +1460 1.10982192000002 2.4329090780523 10.391282 +1461 1.11058207200002 2.42502245526347 10.358886 +1462 1.11134222400002 2.41716042158557 10.326586 +1463 1.11210237600002 2.40932290472455 10.294381 +1464 1.11286252800002 2.40150983257679 10.262271 +1465 1.11362268000002 2.39372113322864 10.230255 +1466 1.11438283200002 2.38595673495609 10.198333 +1467 1.11514298400002 2.37821656622434 10.166506 +1468 1.11590313600002 2.37050055568745 10.134772 +1469 1.11666328800002 2.36280863218794 10.103131 +1470 1.11742344000002 2.35514072475641 10.071584 +1471 1.11818359200002 2.34749676261113 10.04013 +1472 1.11894374400002 2.33987667515771 10.008768 +1473 1.11970389600002 2.33228039198866 9.9774994 +1474 1.12046404800002 2.32470784288304 9.9463227 +1475 1.12122420000002 2.31715895780607 9.915238 +1476 1.12198435200002 2.30963366690874 9.884245 +1477 1.12274450400002 2.30213190052743 9.8533436 +1478 1.12350465600002 2.29465358918351 9.8225335 +1479 1.12426480800002 2.28719866358301 9.7918144 +1480 1.12502496000002 2.27976705461617 9.7611861 +1481 1.12578511200002 2.27235869335711 9.7306483 +1482 1.12654526400002 2.2649735110634 9.7002009 +1483 1.12730541600002 2.25761143917574 9.6698435 +1484 1.12806556800002 2.25027240931753 9.639576 +1485 1.12882572000002 2.24295635329449 9.609398 +1486 1.12958587200002 2.2356632030943 9.5793094 +1487 1.13034602400002 2.22839289088622 9.5493099 +1488 1.13110617600002 2.22114534902069 9.5193993 +1489 1.13186632800002 2.21392051002895 9.4895773 +1490 1.13262648000002 2.2067183066227 9.4598438 +1491 1.13338663200002 2.19953867169367 9.4301984 +1492 1.13414678400002 2.19238153831324 9.4006409 +1493 1.13490693600002 2.18524683973212 9.3711711 +1494 1.13566708800002 2.17813450937991 9.3417888 +1495 1.13642724000002 2.17104448086474 9.3124937 +1496 1.13718739200002 2.16397668797291 9.2832856 +1497 1.13794754400002 2.15693106466847 9.2541642 +1498 1.13870769600002 2.1499075450929 9.2251294 +1499 1.13946784800002 2.14290606356468 9.1961808 +1500 1.14022800000002 2.13592655457893 9.1673184 +1501 1.14098815200002 2.12896895280706 9.1385417 +1502 1.14174830400002 2.12203319309634 9.1098506 +1503 1.14250845600002 2.11511921046956 9.0812449 +1504 1.14326860800002 2.10822694012467 9.0527243 +1505 1.14402876000002 2.10135631743435 9.0242887 +1506 1.14478891200002 2.09450727794567 8.9959377 +1507 1.14554906400002 2.08767975737972 8.9676711 +1508 1.14630921600002 2.08087369163122 8.9394888 +1509 1.14706936800002 2.07408901676815 8.9113905 +1510 1.14782952000002 2.06732566903137 8.8833759 +1511 1.14858967200002 2.06058358483425 8.8554449 +1512 1.14934982400002 2.05386270076231 8.8275972 +1513 1.15010997600002 2.04716295357282 8.7998325 +1514 1.15087012800002 2.04048428019443 8.7721507 +1515 1.15163028000002 2.03382661772684 8.7445516 +1516 1.15239043200002 2.02718990344037 8.7170349 +1517 1.15315058400002 2.02057407477561 8.6896003 +1518 1.15391073600002 2.01397906934306 8.6622477 +1519 1.15467088800002 2.00740482492275 8.6349769 +1520 1.15543104000002 2.00085127946387 8.6077875 +1521 1.15619119200002 1.99431837108438 8.5806795 +1522 1.15695134400002 1.98780603807068 8.5536526 +1523 1.15771149600002 1.98131421887718 8.5267065 +1524 1.15847164800002 1.97484285212602 8.499841 +1525 1.15923180000002 1.96839187660658 8.4730559 +1526 1.15999195200002 1.96196123127524 8.4463511 +1527 1.16075210400002 1.95555085525491 8.4197262 +1528 1.16151225600002 1.94916068783471 8.3931811 +1529 1.16227240800002 1.94279066846959 8.3667155 +1530 1.16303256000002 1.93644073677996 8.3403292 +1531 1.16379271200002 1.93011083255133 8.3140221 +1532 1.16455286400002 1.92380089573396 8.2877938 +1533 1.16531301600002 1.91751086644243 8.2616442 +1534 1.16607316800002 1.91124068495535 8.2355731 +1535 1.16683332000002 1.90499029171494 8.2095802 +1536 1.16759347200002 1.8987596273267 8.1836653 +1537 1.16835362400002 1.89254863255901 8.1578283 +1538 1.16911377600002 1.88635724834281 8.1320688 +1539 1.16987392800002 1.88018541577118 8.1063868 +1540 1.17063408000002 1.87403307609903 8.0807819 +1541 1.17139423200002 1.8679001707427 8.055254 +1542 1.17215438400002 1.86178664127962 8.0298028 +1543 1.17291453600002 1.8556924294479 8.0044281 +1544 1.17367468800002 1.84961747714605 7.9791298 +1545 1.17443484000002 1.84356172643253 7.9539077 +1546 1.17519499200002 1.83752511952547 7.9287614 +1547 1.17595514400002 1.83150759880222 7.9036908 +1548 1.17671529600002 1.82550910679907 7.8786957 +1549 1.17747544800002 1.81952958621085 7.8537759 +1550 1.17823560000002 1.81356897989056 7.8289312 +1551 1.17899575200002 1.80762723084903 7.8041613 +1552 1.17975590400002 1.80170428225458 7.7794661 +1553 1.18051605600002 1.79580007743259 7.7548453 +1554 1.18127620800002 1.78991455986524 7.7302988 +1555 1.18203636000002 1.78404767319105 7.7058264 +1556 1.18279651200002 1.77819936120462 7.6814278 +1557 1.18355666400002 1.77236956785618 7.6571028 +1558 1.18431681600002 1.76655823725131 7.6328512 +1559 1.18507696800002 1.76076531365052 7.6086729 +1560 1.18583712000002 1.75499074146896 7.5845675 +1561 1.18659727200002 1.74923446527601 7.560535 +1562 1.18735742400002 1.74349642979493 7.5365752 +1563 1.18811757600002 1.73777657990255 7.5126877 +1564 1.18887772800002 1.73207486062885 7.4888725 +1565 1.18963788000002 1.72639121715666 7.4651292 +1566 1.19039803200002 1.72072559482128 7.4414578 +1567 1.19115818400002 1.71507793911014 7.417858 +1568 1.19191833600002 1.70944819566242 7.3943296 +1569 1.19267848800002 1.70383631026875 7.3708724 +1570 1.19343864000002 1.6982422288708 7.3474862 +1571 1.19419879200002 1.69266589756095 7.3241709 +1572 1.19495894400002 1.68710726258196 7.3009262 +1573 1.19571909600002 1.68156627032661 7.2777518 +1574 1.19647924800002 1.67604286733731 7.2546478 +1575 1.19723940000002 1.6705370003058 7.2316137 +1576 1.19799955200002 1.66504861607279 7.2086495 +1577 1.19875970400002 1.6595776616276 7.1857549 +1578 1.19951985600002 1.65412408410781 7.1629298 +1579 1.20028000800002 1.64868783079893 7.1401739 +1580 1.20104016000002 1.64326884913401 7.1174871 +1581 1.20180031200002 1.63786708669336 7.0948691 +1582 1.20256046400002 1.63248249120415 7.0723198 +1583 1.20332061600002 1.62711501054007 7.049839 +1584 1.20408076800002 1.62176459272102 7.0274265 +1585 1.20484092000002 1.61643118591272 7.0050821 +1586 1.20560107200002 1.61111473842639 6.9828055 +1587 1.20636122400002 1.60581519871839 6.9605967 +1588 1.20712137600002 1.60053251538991 6.9384554 +1589 1.20788152800002 1.59526663718658 6.9163815 +1590 1.20864168000002 1.59001751299816 6.8943746 +1591 1.20940183200002 1.58478509185819 6.8724348 +1592 1.21016198400002 1.57956932294364 6.8505617 +1593 1.21092213600002 1.57437015557458 6.8287551 +1594 1.21168228800002 1.56918753921382 6.807015 +1595 1.21244244000002 1.5640214234666 6.785341 +1596 1.21320259200002 1.55887175808022 6.7637331 +1597 1.21396274400002 1.55373849294371 6.742191 +1598 1.21472289600002 1.54862157808751 6.7207146 +1599 1.21548304800002 1.54352096368309 6.6993036 +1600 1.21624320000002 1.53843660004266 6.6779579 +1601 1.21700335200002 1.53336843761879 6.6566772 +1602 1.21776350400002 1.5283164270041 6.6354615 +1603 1.21852365600002 1.52328051893093 6.6143105 +1604 1.21928380800002 1.51826066427095 6.593224 +1605 1.22004396000002 1.5132568140349 6.5722019 +1606 1.22080411200002 1.50826891937219 6.551244 +1607 1.22156426400002 1.50329693157062 6.5303501 +1608 1.22232441600002 1.49834080205598 6.5095199 +1609 1.22308456800002 1.4934004823918 6.4887534 +1610 1.22384472000002 1.48847592427892 6.4680504 +1611 1.22460487200002 1.48356707955526 6.4474106 +1612 1.22536502400002 1.47867390019539 6.4268339 +1613 1.22612517600002 1.47379633831028 6.4063201 +1614 1.22688532800002 1.4689343461469 6.385869 +1615 1.22764548000002 1.46408787608794 6.3654805 +1616 1.22840563200002 1.45925688065146 6.3451544 +1617 1.22916578400002 1.45444131249055 6.3248905 +1618 1.22992593600002 1.44964112439303 6.3046885 +1619 1.23068608800002 1.44485626928108 6.2845485 +1620 1.23144624000002 1.44008670021095 6.2644701 +1621 1.23220639200002 1.43533237037261 6.2444532 +1622 1.23296654400002 1.43059323308943 6.2244976 +1623 1.23372669600002 1.42586924181785 6.2046031 +1624 1.23448684800002 1.42116035014706 6.1847696 +1625 1.23524700000002 1.41646651179866 6.1649969 +1626 1.23600715200002 1.41178768062636 6.1452849 +1627 1.23676730400002 1.40712381061563 6.1256333 +1628 1.23752745600002 1.40247485588337 6.1060419 +1629 1.23828760800002 1.39784077067763 6.0865107 +1630 1.23904776000002 1.39322150937723 6.0670393 +1631 1.23980791200002 1.38861702649149 6.0476278 +1632 1.24056806400002 1.38402727665986 6.0282758 +1633 1.24132821600002 1.37945221465164 6.0089833 +1634 1.24208836800002 1.37489179536562 5.98975 +1635 1.24284852000002 1.3703459738298 5.9705757 +1636 1.24360867200002 1.36581470520102 5.9514604 +1637 1.24436882400002 1.3612979447647 5.9324038 +1638 1.24512897600002 1.35679564793446 5.9134058 +1639 1.24588912800002 1.35230777025186 5.8944662 +1640 1.24664928000002 1.34783426738603 5.8755848 +1641 1.24740943200002 1.34337509513337 5.8567615 +1642 1.24816958400002 1.33893020941727 5.8379961 +1643 1.24892973600002 1.33449956628773 5.8192884 +1644 1.24968988800002 1.33008312192108 5.8006383 +1645 1.25045004000002 1.32568083261967 5.7820456 +1646 1.25121019200002 1.32129265481153 5.7635102 +1647 1.25197034400002 1.31691854505009 5.7450318 +1648 1.25273049600002 1.31255846001382 5.7266103 +1649 1.25349064800002 1.30821235650596 5.7082456 +1650 1.25425080000002 1.30388019145418 5.6899374 +1651 1.25501095200002 1.29956192191028 5.6716857 +1652 1.25577110400002 1.29525750504988 5.6534902 +1653 1.25653125600002 1.29096689817209 5.6353508 +1654 1.25729140800002 1.28669005869923 5.6172673 +1655 1.25805156000002 1.28242694417648 5.5992396 +1656 1.25881171200002 1.27817751227161 5.5812676 +1657 1.25957186400002 1.27394172077465 5.5633509 +1658 1.26033201600002 1.26971952759757 5.5454896 +1659 1.26109216800002 1.26551089077402 5.5276834 +1660 1.26185232000002 1.26131576845894 5.5099321 +1661 1.26261247200002 1.25713411892834 5.4922357 +1662 1.26337262400002 1.25296590057894 5.4745939 +1663 1.26413277600002 1.24881107192788 5.4570066 +1664 1.26489292800002 1.2446695916124 5.4394736 +1665 1.26565308000002 1.24054141838959 5.4219949 +1666 1.26641323200002 1.23642651113598 5.4045701 +1667 1.26717338400002 1.23232482884736 5.3871992 +1668 1.26793353600002 1.22823633063838 5.369882 +1669 1.26869368800002 1.22416097574229 5.3526184 +1670 1.26945384000002 1.22009872351063 5.3354081 +1671 1.27021399200002 1.21604953341294 5.3182511 +1672 1.27097414400002 1.21201336503645 5.3011472 +1673 1.27173429600002 1.20799017808575 5.2840962 +1674 1.27249444800002 1.20397993238254 5.267098 +1675 1.27325460000002 1.19998258786531 5.2501525 +1676 1.27401475200002 1.19599810458902 5.2332594 +1677 1.27477490400002 1.19202644272484 5.2164186 +1678 1.27553505600002 1.18806756255981 5.19963 +1679 1.27629520800002 1.18412142449659 5.1828934 +1680 1.27705536000002 1.18018798905311 5.1662086 +1681 1.27781551200002 1.17626721686232 5.1495756 +1682 1.27857566400002 1.17235906867188 5.1329941 +1683 1.27933581600002 1.16846350534383 5.1164641 +1684 1.28009596800002 1.16458048785435 5.0999853 +1685 1.28085612000002 1.16070997729344 5.0835576 +1686 1.28161627200002 1.15685193486461 5.0671809 +1687 1.28237642400002 1.15300632188463 5.050855 +1688 1.28313657600002 1.14917309978319 5.0345798 +1689 1.28389672800002 1.14535223010263 5.0183551 +1690 1.28465688000002 1.14154367449767 5.0021807 +1691 1.28541703200002 1.13774739473506 4.9860566 +1692 1.28617718400002 1.13396335269335 4.9699826 +1693 1.28693733600002 1.13019151036259 4.9539585 +1694 1.28769748800002 1.12643182984399 4.9379841 +1695 1.28845764000002 1.1226842733497 4.9220594 +1696 1.28921779200002 1.11894880320248 4.9061842 +1697 1.28997794400002 1.11522538183542 4.8903584 +1698 1.29073809600002 1.11151397179165 4.8745817 +1699 1.29149824800002 1.10781453572407 4.8588541 +1700 1.29225840000002 1.10412703639504 4.8431755 +1701 1.29301855200002 1.10045143667613 4.8275456 +1702 1.29377870400002 1.09678769954779 4.8119643 +1703 1.29453885600002 1.09313578809909 4.7964315 +1704 1.29529900800002 1.08949566552744 4.7809471 +1705 1.29605916000002 1.0858672951383 4.7655108 +1706 1.29681931200002 1.0822506403449 4.7501227 +1707 1.29757946400002 1.07864566466794 4.7347824 +1708 1.29833961600002 1.07505233173536 4.7194899 +1709 1.29909976800002 1.07147060528198 4.7042451 +1710 1.29985992000002 1.06790044914928 4.6890477 +1711 1.30062007200002 1.06434182728511 4.6738977 +1712 1.30138022400002 1.0607947037434 4.658795 +1713 1.30214037600002 1.05725904268387 4.6437393 +1714 1.30290052800002 1.05373480837177 4.6287305 +1715 1.30366068000002 1.05022196517762 4.6137686 +1716 1.30442083200002 1.04672047757688 4.5988533 +1717 1.30518098400002 1.04323031014971 4.5839845 +1718 1.30594113600002 1.0397514275807 4.5691621 +1719 1.30670128800002 1.03628379465857 4.554386 +1720 1.30746144000002 1.03282737627592 4.539656 +1721 1.30822159200002 1.02938213742891 4.524972 +1722 1.30898174400002 1.02594804321706 4.5103338 +1723 1.30974189600002 1.02252505884291 4.4957414 +1724 1.31050204800002 1.01911314961177 4.4811945 +1725 1.31126220000002 1.01571228093145 4.466693 +1726 1.31202235200002 1.012322418312 4.4522369 +1727 1.31278250400002 1.00894352736541 4.4378259 +1728 1.31354265600002 1.00557557380537 4.42346 +1729 1.31430280800002 1.00221852344697 4.409139 +1730 1.31506296000002 0.998872342206448 4.3948627 +1731 1.31582311200002 0.995536996100931 4.3806311 +1732 1.31658326400002 0.99221245124814 4.366444 +1733 1.31734341600002 0.988898673866141 4.3523012 +1734 1.31810356800002 0.985595630273072 4.3382027 +1735 1.31886372000002 0.982303286886876 4.3241484 +1736 1.31962387200002 0.979021610225034 4.310138 +1737 1.32038402400002 0.975750566904298 4.2961714 +1738 1.32114417600002 0.972490123640435 4.2822486 +1739 1.32190432800002 0.969240247247948 4.2683694 +1740 1.32266448000002 0.966000904639821 4.2545336 +1741 1.32342463200002 0.962772062827253 4.2407411 +1742 1.32418478400002 0.959553688919395 4.2269919 +1743 1.32494493600002 0.95634575012309 4.2132857 +1744 1.32570508800002 0.953148213742606 4.1996225 +1745 1.32646524000002 0.949961047179377 4.1860021 +1746 1.32722539200002 0.946784217931744 4.1724245 +1747 1.32798554400002 0.943617693594692 4.1588893 +1748 1.32874569600002 0.94046144185959 4.1453966 +1749 1.32950584800002 0.937315430513933 4.1319463 +1750 1.33026600000002 0.934179627441085 4.1185381 +1751 1.33102615200002 0.931054000620018 4.1051719 +1752 1.33178630400002 0.927938518125052 4.0918477 +1753 1.33254645600002 0.924833148125606 4.0785654 +1754 1.33330660800002 0.921737858885934 4.0653247 +1755 1.33406676000002 0.918652618764871 4.0521255 +1756 1.33482691200002 0.915577396215579 4.0389679 +1757 1.33558706400002 0.91251215978529 4.0258515 +1758 1.33634721600002 0.909456878115053 4.0127763 +1759 1.33710736800002 0.906411519939484 3.9997422 +1760 1.33786752000002 0.903376054086501 3.986749 +1761 1.33862767200002 0.900350449477083 3.9737967 +1762 1.33938782400002 0.897334675125014 3.960885 +1763 1.34014797600002 0.894328700136631 3.948014 +1764 1.34090812800002 0.89133249371057 3.9351834 +1765 1.34166828000002 0.888346025137519 3.9223931 +1766 1.34242843200002 0.885369263799969 3.909643 +1767 1.34318858400002 0.882402179171963 3.8969331 +1768 1.34394873600002 0.879444740818841 3.8842631 +1769 1.34470888800002 0.876496918397002 3.871633 +1770 1.34546904000002 0.87355868165365 3.8590426 +1771 1.34622919200002 0.870630000426549 3.8464919 +1772 1.34698934400002 0.867710844643771 3.8339806 +1773 1.34774949600002 0.864801184323458 3.8215088 +1774 1.34850964800002 0.861900989573569 3.8090762 +1775 1.34926980000002 0.859010230591639 3.7966827 +1776 1.35002995200002 0.856128877664531 3.7843283 +1777 1.35079010400002 0.853256901168198 3.7720128 +1778 1.35155025600002 0.85039427156743 3.759736 +1779 1.35231040800002 0.84754095941562 3.747498 +1780 1.35307056000002 0.844696935354514 3.7352985 +1781 1.35383071200002 0.841862170113976 3.7231375 +1782 1.35459086400002 0.83903663451174 3.7110148 +1783 1.35535101600002 0.836220299453175 3.6989303 +1784 1.35611116800002 0.833413135931039 3.686884 +1785 1.35687132000002 0.830615115025241 3.6748756 +1786 1.35763147200002 0.827826207902607 3.6629051 +1787 1.35839162400002 0.825046385816635 3.6509723 +1788 1.35915177600002 0.822275620107252 3.6390772 +1789 1.35991192800002 0.81951388220059 3.6272196 +1790 1.36067208000002 0.816761143608739 3.6153995 +1791 1.36143223200002 0.814017375929511 3.6036166 +1792 1.36219238400002 0.811282550846208 3.591871 +1793 1.36295253600002 0.808556640127381 3.5801624 +1794 1.36371268800002 0.8058396156266 3.5684908 +1795 1.36447284000002 0.803131449282215 3.5568561 +1796 1.36523299200002 0.800432113117127 3.5452581 +1797 1.36599314400002 0.797741579238548 3.5336967 +1798 1.36675329600002 0.795059819837772 3.5221719 +1799 1.36751344800002 0.792386807189943 3.5106835 +1800 1.36827360000002 0.789722513653825 3.4992314 +1801 1.36903375200002 0.78706691167156 3.4878155 +1802 1.36979390400002 0.784419973768451 3.4764357 +1803 1.37055405600002 0.781781672552724 3.4650919 +1804 1.37131420800002 0.779151980715299 3.4537839 +1805 1.37207436000002 0.776530871029558 3.4425117 +1806 1.37283451200002 0.773918316351126 3.4312752 +1807 1.37359466400002 0.771314289617628 3.4200742 +1808 1.37435481600002 0.768718763848477 3.4089087 +1809 1.37511496800002 0.766131712144634 3.3977784 +1810 1.37587512000002 0.763553107688385 3.3866835 +1811 1.37663527200002 0.760982923743123 3.3756236 +1812 1.37739542400002 0.758421133653109 3.3645987 +1813 1.37815557600002 0.755867710843253 3.3536088 +1814 1.37891572800002 0.753322628818894 3.3426536 +1815 1.37967588000002 0.750785861165568 3.3317332 +1816 1.38043603200002 0.748257381548789 3.3208473 +1817 1.38119618400002 0.745737163713825 3.3099959 +1818 1.38195633600002 0.743225181485474 3.2991789 +1819 1.38271648800002 0.740721408767842 3.2883962 +1820 1.38347664000002 0.738225819544126 3.2776477 +1821 1.38423679200002 0.735738387876387 3.2669332 +1822 1.38499694400002 0.733259087905331 3.2562527 +1823 1.38575709600002 0.730787893850092 3.2456061 +1824 1.38651724800002 0.728324780008012 3.2349932 +1825 1.38727740000002 0.725869720754413 3.224414 +1826 1.38803755200002 0.723422690542393 3.2138683 +1827 1.38879770400002 0.720983663902599 3.2033561 +1828 1.38955785600002 0.718552615443012 3.1928772 +1829 1.39031800800002 0.716129519848727 3.1824316 +1830 1.39107816000002 0.713714351881743 3.1720192 +1831 1.39183831200002 0.711307086380739 3.1616398 +1832 1.39259846400002 0.708907698260866 3.1512933 +1833 1.39335861600002 0.706516162513527 3.1409797 +1834 1.39411876800002 0.704132454206166 3.1306989 +1835 1.39487892000002 0.701756548482051 3.1204507 +1836 1.39563907200002 0.699388420560064 3.110235 +1837 1.39639922400002 0.697028045734483 3.1000518 +1838 1.39715937600002 0.694675399374775 3.089901 +1839 1.39791952800002 0.692330456925384 3.0797824 +1840 1.39867968000002 0.689993193905514 3.0696959 +1841 1.39943983200002 0.687663585908924 3.0596416 +1842 1.40019998400002 0.685341608603713 3.0496191 +1843 1.40096013600002 0.683027237732116 3.0396286 +1844 1.40172028800002 0.680720449110289 3.0296698 +1845 1.40248044000002 0.678421218628099 3.0197427 +1846 1.40324059200002 0.676129522248926 3.0098471 +1847 1.40400074400002 0.673845336009442 2.999983 +1848 1.40476089600002 0.671568636019414 2.9901504 +1849 1.40552104800002 0.669299398461487 2.9803489 +1850 1.40628120000002 0.667037599590989 2.9705787 +1851 1.40704135200002 0.664783215735717 2.9608396 +1852 1.40780150400002 0.662536223295733 2.9511315 +1853 1.40856165600002 0.660296598743162 2.9414543 +1854 1.40932180800002 0.658064318621985 2.9318078 +1855 1.41008196000002 0.655839359547836 2.9221921 +1856 1.41084211200002 0.653621698207798 2.9126071 +1857 1.41160226400002 0.651411311360199 2.9030525 +1858 1.41236241600002 0.649208175834413 2.8935284 +1859 1.41312256800002 0.647012268530657 2.8840347 +1860 1.41388272000002 0.644823566419786 2.8745711 +1861 1.41464287200002 0.642642046543097 2.8651378 +1862 1.41540302400002 0.640467686012122 2.8557345 +1863 1.41616317600002 0.638300462008438 2.8463611 +1864 1.41692332800002 0.636140351783457 2.8370177 +1865 1.41768348000002 0.633987332658233 2.827704 +1866 1.41844363200002 0.631841382023263 2.8184201 +1867 1.41920378400002 0.629702477338287 2.8091657 +1868 1.41996393600002 0.627570596132092 2.7999409 +1869 1.42072408800002 0.625445716002313 2.7907455 +1870 1.42148424000002 0.62332781461524 2.7815794 +1871 1.42224439200002 0.621216869705616 2.7724426 +1872 1.42300454400002 0.619112859076451 2.7633349 +1873 1.42376469600002 0.617015760598814 2.7542563 +1874 1.42452484800002 0.61492555221165 2.7452067 +1875 1.42528500000002 0.612842211921579 2.7361859 +1876 1.42604515200002 0.610765717802704 2.727194 +1877 1.42680530400002 0.608696047996418 2.7182308 +1878 1.42756545600002 0.606633180711211 2.7092961 +1879 1.42832560800002 0.604577094222481 2.7003901 +1880 1.42908576000002 0.602527766872334 2.6915125 +1881 1.42984591200002 0.600485177069403 2.6826632 +1882 1.43060606400002 0.598449303288646 2.6738422 +1883 1.43136621600002 0.596420124071167 2.6650494 +1884 1.43212636800002 0.594397618024017 2.6562847 +1885 1.43288652000002 0.592381763820011 2.647548 +1886 1.43364667200002 0.590372540197533 2.6388392 +1887 1.43440682400002 0.588369925960353 2.6301583 +1888 1.43516697600002 0.586373899977434 2.6215052 +1889 1.43592712800002 0.58438444118275 2.6128797 +1890 1.43668728000002 0.582401528575095 2.6042818 +1891 1.43744743200002 0.580425141217896 2.5957113 +1892 1.43820758400002 0.57845525823903 2.5871683 +1893 1.43896773600002 0.576491858830634 2.5786527 +1894 1.43972788800002 0.574534922248923 2.5701643 +1895 1.44048804000002 0.572584427814007 2.561703 +1896 1.44124819200002 0.5706403549097 2.5532688 +1897 1.44200834400002 0.568702682983344 2.5448617 +1898 1.44276849600002 0.566771391545619 2.5364814 +1899 1.44352864800002 0.564846460170362 2.528128 +1900 1.44428880000002 0.56292786849439 2.5198013 +1901 1.44504895200002 0.561015596217312 2.5115012 +1902 1.44580910400002 0.559109623101344 2.5032278 +1903 1.44656925600002 0.557209928971138 2.4949809 +1904 1.44732940800002 0.555316493713594 2.4867603 +1905 1.44808956000002 0.553429297277685 2.4785662 +1906 1.44884971200002 0.55154831967427 2.4703982 +1907 1.44960986400002 0.549673540975921 2.4622565 +1908 1.45037001600002 0.547804941316743 2.4541408 +1909 1.45113016800002 0.545942500892193 2.4460512 +1910 1.45189032000002 0.544086199958906 2.4379874 +1911 1.45265047200002 0.542236018834513 2.4299496 +1912 1.45341062400002 0.54039193789747 2.4219375 +1913 1.45417077600002 0.538553937586875 2.4139511 +1914 1.45493092800002 0.536721998402295 2.4059903 +1915 1.45569108000002 0.534896100903592 2.3980551 +1916 1.45645123200002 0.533076225710745 2.3901453 +1917 1.45721138400002 0.531262353503676 2.3822608 +1918 1.45797153600002 0.529454465022077 2.3744017 +1919 1.45873168800002 0.527652541065234 2.3665678 +1920 1.45949184000002 0.525856562491854 2.3587591 +1921 1.46025199200002 0.524066510219895 2.3509754 +1922 1.46101214400002 0.522282365226389 2.3432167 +1923 1.46177229600002 0.520504108547273 2.3354829 +1924 1.46253244800002 0.518731721277218 2.3277739 +1925 1.46329260000002 0.516965184569453 2.3200897 +1926 1.46405275200002 0.515204479635599 2.3124302 +1927 1.46481290400002 0.513449587745499 2.3047952 +1928 1.46557305600002 0.511700490227043 2.2971848 +1929 1.46633320800002 0.509957168466004 2.2895989 +1930 1.46709336000002 0.508219603905865 2.2820373 +1931 1.46785351200002 0.506487778047655 2.2745 +1932 1.46861366400002 0.504761672449776 2.2669869 +1933 1.46937381600002 0.503041268727839 2.259498 +1934 1.47013396800002 0.501326548554492 2.2520332 +1935 1.47089412000002 0.499617493659259 2.2445923 +1936 1.47165427200002 0.497914085828371 2.2371754 +1937 1.47241442400002 0.4962163069046 2.2297824 +1938 1.47317457600002 0.49452413878709 2.2224131 +1939 1.47393472800002 0.4928375634312 2.2150675 +1940 1.47469488000002 0.491156562848332 2.2077455 +1941 1.47545503200002 0.489481119105769 2.2004471 +1942 1.47621518400002 0.487811214326513 2.1931722 +1943 1.47697533600002 0.486146830689119 2.1859206 +1944 1.47773548800002 0.484487950427534 2.1786925 +1945 1.47849564000002 0.482834555830933 2.1714875 +1946 1.47925579200002 0.481186629243557 2.1643058 +1947 1.48001594400002 0.479544153064553 2.1571472 +1948 1.48077609600002 0.477907109747811 2.1500116 +1949 1.48153624800002 0.476275481801804 2.142899 +1950 1.48229640000002 0.474649251789425 2.1358093 +1951 1.48305655200002 0.473028402327832 2.1287425 +1952 1.48381670400002 0.471412916088284 2.1216984 +1953 1.48457685600002 0.469802775795985 2.114677 +1954 1.48533700800002 0.468197964229922 2.1076782 +1955 1.48609716000002 0.466598464222709 2.1007019 +1956 1.48685731200002 0.465004258660427 2.0937482 +1957 1.48761746400002 0.463415330482473 2.0868168 +1958 1.48837761600002 0.46183166268139 2.0799078 +1959 1.48913776800002 0.460253238302723 2.0730211 +1960 1.48989792000002 0.458680040444859 2.0661565 +1961 1.49065807200002 0.457112052258867 2.0593141 +1962 1.49141822400002 0.455549256948346 2.0524938 +1963 1.49217837600002 0.45399163776927 2.0456954 +1964 1.49293852800002 0.452439178029835 2.038919 +1965 1.49369868000002 0.450891861090299 2.0321644 +1966 1.49445883200002 0.449349670362835 2.0254316 +1967 1.49521898400002 0.447812589311371 2.0187205 +1968 1.49597913600002 0.446280601451445 2.0120311 +1969 1.49673928800002 0.444753690350045 2.0053633 +1970 1.49749944000002 0.44323183962546 1.998717 +1971 1.49825959200003 0.441715032947129 1.9920921 +1972 1.49901974400003 0.440203254035487 1.9854886 +1973 1.49977989600003 0.438696486661817 1.9789064 +1974 1.50054004800003 0.437194714648099 1.9723455 +1975 1.50130020000003 0.435697921866856 1.9658058 +1976 1.50206035200003 0.434206092241009 1.9592872 +1977 1.50282050400003 0.432719209743726 1.9527896 +1978 1.50358065600003 0.431237258398273 1.946313 +1979 1.50434080800003 0.429760222277862 1.9398574 +1980 1.50510096000003 0.428288085505512 1.9334225 +1981 1.50586111200003 0.42682083225389 1.9270085 +1982 1.50662126400003 0.425358446745171 1.9206152 +1983 1.50738141600003 0.42390091325089 1.9142426 +1984 1.50814156800003 0.422448216091791 1.9078905 +1985 1.50890172000003 0.421000339637688 1.901559 +1986 1.50966187200003 0.419557268307313 1.895248 +1987 1.51042202400003 0.418118986568174 1.8889573 +1988 1.51118217600003 0.416685478936408 1.882687 +1989 1.51194232800003 0.415256729976638 1.876437 +1990 1.51270248000003 0.413832724301827 1.8702071 +1991 1.51346263200003 0.412413446573137 1.8639975 +1992 1.51422278400003 0.410998881499781 1.8578079 +1993 1.51498293600003 0.409589013838885 1.8516383 +1994 1.51574308800003 0.408183828395342 1.8454887 +1995 1.51650324000003 0.406783310021671 1.839359 +1996 1.51726339200003 0.405387443617872 1.8332491 +1997 1.51802354400003 0.403996214131293 1.827159 +1998 1.51878369600003 0.402609606556476 1.8210885 +1999 1.51954384800003 0.401227605935028 1.8150378 +2000 1.52030400000003 0.399850197355474 1.8090066 +2001 1.52106415200003 0.398477365953119 1.802995 +2002 1.52182430400003 0.397109096909908 1.7970028 +2003 1.52258445600003 0.395745375454286 1.79103 +2004 1.52334460800003 0.394386186861062 1.7850765 +2005 1.52410476000003 0.393031516451267 1.7791424 +2006 1.52486491200003 0.391681349592017 1.7732274 +2007 1.52562506400003 0.390335671696376 1.7673316 +2008 1.52638521600003 0.388994468223219 1.761455 +2009 1.52714536800003 0.387657724677092 1.7555973 +2010 1.52790552000003 0.386325426608081 1.7497586 +2011 1.52866567200003 0.384997559611669 1.7439389 +2012 1.52942582400003 0.383674109328604 1.738138 +2013 1.53018597600003 0.382355061444764 1.7323559 +2014 1.53094612800003 0.381040401691019 1.7265926 +2015 1.53170628000003 0.3797301158431 1.7208479 +2016 1.53246643200003 0.378424189721462 1.7151219 +2017 1.53322658400003 0.377122609191147 1.7094144 +2018 1.53398673600003 0.37582536016166 1.7037254 +2019 1.53474688800003 0.374532428586823 1.6980549 +2020 1.53550704000003 0.373243800464653 1.6924028 +2021 1.53626719200003 0.371959461837223 1.686769 +2022 1.53702734400003 0.370679398790532 1.6811535 +2023 1.53778749600003 0.369403597454372 1.6755562 +2024 1.53854764800003 0.368132044002199 1.6699771 +2025 1.53930780000003 0.366864724650998 1.664416 +2026 1.54006795200003 0.365601625661157 1.658873 +2027 1.54082810400003 0.364342733336332 1.653348 +2028 1.54158825600003 0.363088034023319 1.647841 +2029 1.54234840800003 0.361837514111924 1.6423518 +2030 1.54310856000003 0.360591160034836 1.6368804 +2031 1.54386871200003 0.359348958267493 1.6314268 +2032 1.54462886400003 0.358110895327957 1.6259909 +2033 1.54538901600003 0.356876957776787 1.6205727 +2034 1.54614916800003 0.355647132216906 1.615172 +2035 1.54690932000003 0.354421405293478 1.6097889 +2036 1.54766947200003 0.35319976369378 1.6044233 +2037 1.54842962400003 0.351982194147071 1.5990751 +2038 1.54918977600003 0.350768683424474 1.5937443 +2039 1.54994992800003 0.349559218338839 1.5884308 +2040 1.55071008000003 0.348353785744626 1.5831346 +2041 1.55147023200003 0.347152372537777 1.5778555 +2042 1.55223038400003 0.345954965655589 1.5725937 +2043 1.55299053600003 0.344761552076589 1.5673489 +2044 1.55375068800003 0.343572118820413 1.5621212 +2045 1.55451084000003 0.34238665294768 1.5569105 +2046 1.55527099200003 0.341205141559867 1.5517167 +2047 1.55603114400003 0.340027571799187 1.5465398 +2048 1.55679129600003 0.338853930848467 1.5413798 +2049 1.55755144800003 0.337684205931021 1.5362365 +2050 1.55831160000003 0.336518384310534 1.53111 +2051 1.55907175200003 0.335356453290934 1.5260001 +2052 1.55983190400003 0.334198400216275 1.5209069 +2053 1.56059205600003 0.333044212470612 1.5158302 +2054 1.56135220800003 0.331893877477881 1.5107701 +2055 1.56211236000003 0.33074738270178 1.5057264 +2056 1.56287251200003 0.329604715645648 1.5006991 +2057 1.56363266400003 0.328465863852343 1.4956882 +2058 1.56439281600003 0.327330814904125 1.4906936 +2059 1.56515296800003 0.326199556422534 1.4857152 +2060 1.56591312000003 0.325072076068274 1.4807531 +2061 1.56667327200003 0.323948361541091 1.4758071 +2062 1.56743342400003 0.322828400579659 1.4708773 +2063 1.56819357600003 0.321712180961456 1.4659634 +2064 1.56895372800003 0.320599690502653 1.4610656 +2065 1.56971388000003 0.319490917057991 1.4561838 +2066 1.57047403200003 0.318385848520667 1.4513178 +2067 1.57123418400003 0.317284472822219 1.4464677 +2068 1.57199433600003 0.316186777932402 1.4416334 +2069 1.57275448800003 0.315092751859083 1.4368148 +2070 1.57351464000003 0.314002382648115 1.4320119 +2071 1.57427479200003 0.312915658383231 1.4272247 +2072 1.57503494400003 0.311832567185918 1.4224531 +2073 1.57579509600003 0.310753097215313 1.4176971 +2074 1.57655524800003 0.309677236668082 1.4129565 +2075 1.57731540000003 0.308604973778309 1.4082314 +2076 1.57807555200003 0.30753629681738 1.4035217 +2077 1.57883570400003 0.306471194093869 1.3988274 +2078 1.57959585600003 0.305409653953431 1.3941484 +2079 1.58035600800003 0.304351664778681 1.3894846 +2080 1.58111616000003 0.303297214989086 1.384836 +2081 1.58187631200003 0.302246293040851 1.3802026 +2082 1.58263646400003 0.30119888742681 1.3755843 +2083 1.58339661600003 0.300154986676311 1.3709811 +2084 1.58415676800003 0.299114579355108 1.3663929 +2085 1.58491692000003 0.298077654065246 1.3618197 +2086 1.58567707200003 0.297044199444954 1.3572614 +2087 1.58643722400003 0.296014204168535 1.3527179 +2088 1.58719737600003 0.294987656946251 1.3481893 +2089 1.58795752800003 0.29396454652422 1.3436755 +2090 1.58871768000003 0.292944861684302 1.3391764 +2091 1.58947783200003 0.291928591243992 1.334692 +2092 1.59023798400003 0.290915724056309 1.3302223 +2093 1.59099813600003 0.289906249009693 1.3257671 +2094 1.59175828800003 0.288900155027888 1.3213265 +2095 1.59251844000003 0.287897431069845 1.3169004 +2096 1.59327859200003 0.286898066129602 1.3124887 +2097 1.59403874400003 0.285902049236191 1.3080915 +2098 1.59479889600003 0.284909369453518 1.3037086 +2099 1.59555904800003 0.283920015880264 1.29934 +2100 1.59631920000003 0.282933977649778 1.2949857 +2101 1.59707935200003 0.281951243929969 1.2906456 +2102 1.59783950400003 0.2809718039232 1.2863198 +2103 1.59859965600003 0.279995646866184 1.282008 +2104 1.59935980800003 0.279022762029881 1.2777103 +2105 1.60011996000003 0.278053138719387 1.2734267 +2106 1.60088011200003 0.277086766273837 1.2691571 +2107 1.60164026400003 0.276123634066295 1.2649015 +2108 1.60240041600003 0.275163731503652 1.2606597 +2109 1.60316056800003 0.274207048026526 1.2564319 +2110 1.60392072000003 0.27325357310915 1.2522178 +2111 1.60468087200003 0.272303296259279 1.2480176 +2112 1.60544102400003 0.27135620701808 1.243831 +2113 1.60620117600003 0.270412294960034 1.2396582 +2114 1.60696132800003 0.269471549692831 1.235499 +2115 1.60772148000003 0.268533960857269 1.2313534 +2116 1.60848163200003 0.267599518127154 1.2272214 +2117 1.60924178400003 0.266668211209196 1.2231029 +2118 1.61000193600003 0.265740029842912 1.2189979 +2119 1.61076208800003 0.264814963800519 1.2149063 +2120 1.61152224000003 0.263893002886841 1.2108281 +2121 1.61228239200003 0.262974136939204 1.2067633 +2122 1.61304254400003 0.262058355827337 1.2027118 +2123 1.61380269600003 0.261145649453274 1.1986735 +2124 1.61456284800003 0.260236007751254 1.1946484 +2125 1.61532300000003 0.25932942068762 1.1906365 +2126 1.61608315200003 0.258425878260725 1.1866378 +2127 1.61684330400003 0.257525370500829 1.1826521 +2128 1.61760345600003 0.256627887470003 1.1786796 +2129 1.61836360800003 0.255733419262031 1.17472 +2130 1.61912376000003 0.254841956002313 1.1707734 +2131 1.61988391200003 0.253953487847765 1.1668397 +2132 1.62064406400003 0.253068004986728 1.1629189 +2133 1.62140421600003 0.252185497638864 1.1590109 +2134 1.62216436800003 0.251305956055064 1.1551158 +2135 1.62292452000003 0.250429370517352 1.1512334 +2136 1.62368467200003 0.249555731338787 1.1473637 +2137 1.62444482400003 0.248685028863369 1.1435067 +2138 1.62520497600003 0.247817253465942 1.1396624 +2139 1.62596512800003 0.246952395552102 1.1358307 +2140 1.62672528000003 0.246090445558099 1.1320115 +2141 1.62748543200003 0.245231393950745 1.1282048 +2142 1.62824558400003 0.244375231227317 1.1244107 +2143 1.62900573600003 0.243521947915467 1.1206289 +2144 1.62976588800003 0.242671534573125 1.1168596 +2145 1.63052604000003 0.241823981788406 1.1131026 +2146 1.63128619200003 0.240979280179518 1.109358 +2147 1.63204634400003 0.240137420394669 1.1056256 +2148 1.63280649600003 0.239298393111975 1.1019055 +2149 1.63356664800003 0.238462189039366 1.0981976 +2150 1.63432680000003 0.237628798914494 1.0945018 +2151 1.63508695200003 0.236798213504643 1.0908182 +2152 1.63584710400003 0.235970423606636 1.0871467 +2153 1.63660725600003 0.235145420046746 1.0834872 +2154 1.63736740800003 0.2343231936806 1.0798397 +2155 1.63812756000003 0.233503735393095 1.0762042 +2156 1.63888771200003 0.232687036098302 1.0725807 +2157 1.63964786400003 0.231873086739377 1.068969 +2158 1.64040801600003 0.231061878288476 1.0653692 +2159 1.64116816800003 0.230253401746656 1.0617812 +2160 1.64192832000003 0.229447648143796 1.0582049 +2161 1.64268847200003 0.228644608538499 1.0546405 +2162 1.64344862400003 0.227844274018008 1.0510877 +2163 1.64420877600003 0.227046635698118 1.0475466 +2164 1.64496892800003 0.226251684723083 1.0440171 +2165 1.64572908000003 0.225459412265533 1.0404993 +2166 1.64648923200003 0.224669809526383 1.036993 +2167 1.64724938400003 0.223882867734746 1.0334982 +2168 1.64800953600003 0.223098578147847 1.0300148 +2169 1.64876968800003 0.222316932050934 1.026543 +2170 1.64952984000003 0.221537920757193 1.0230825 +2171 1.65028999200003 0.220761535607658 1.0196334 +2172 1.65105014400003 0.219987767971132 1.0161957 +2173 1.65181029600003 0.219216609244091 1.0127692 +2174 1.65257044800003 0.218448050850605 1.0093541 +2175 1.65333060000003 0.217682084242253 1.0059501 +2176 1.65409075200003 0.216918700898033 1.0025573 +2177 1.65485090400003 0.216157892324279 0.99917572 +2178 1.65561105600003 0.215399650054577 0.99580523 +2179 1.65637120800003 0.214643965649682 0.99244582 +2180 1.65713136000003 0.213890830697428 0.98909747 +2181 1.65789151200003 0.213140236812651 0.98576012 +2182 1.65865166400003 0.212392175637098 0.98243376 +2183 1.65941181600003 0.211646638839351 0.97911834 +2184 1.66017196800003 0.210903618114737 0.97581382 +2185 1.66093212000003 0.210163105185249 0.97252018 +2186 1.66169227200003 0.209425091799461 0.96923737 +2187 1.66245242400003 0.208689569732447 0.96596537 +2188 1.66321257600003 0.207956530785698 0.96270413 +2189 1.66397272800003 0.207225966787038 0.95945363 +2190 1.66473288000003 0.206497869590546 0.95621383 +2191 1.66549303200003 0.205772231076471 0.95298469 +2192 1.66625318400003 0.205049043151153 0.94976618 +2193 1.66701333600003 0.204328297746938 0.94655827 +2194 1.66777348800003 0.203609986822103 0.94336092 +2195 1.66853364000003 0.20289410236077 0.9401741 +2196 1.66929379200003 0.202180636372828 0.93699778 +2197 1.67005394400003 0.201469580893853 0.93383191 +2198 1.67081409600003 0.200760927985027 0.93067647 +2199 1.67157424800003 0.200054669733059 0.92753142 +2200 1.67233440000003 0.199350798250104 0.92439674 +2201 1.67309455200003 0.198649305673687 0.92127238 +2202 1.67385470400003 0.19795018416662 0.91815831 +2203 1.67461485600003 0.197253425916926 0.91505451 +2204 1.67537500800003 0.19655902313776 0.91196093 +2205 1.67613516000003 0.195866968067328 0.90887755 +2206 1.67689531200003 0.195177252968815 0.90580432 +2207 1.67765546400003 0.194489870130299 0.90274123 +2208 1.67841561600003 0.193804811864681 0.89968823 +2209 1.67917576800003 0.193122070509602 0.8966453 +2210 1.67993592000003 0.192441638427369 0.8936124 +2211 1.68069607200003 0.191763508004876 0.8905895 +2212 1.68145622400003 0.19108767165353 0.88757656 +2213 1.68221637600003 0.190414121809172 0.88457356 +2214 1.68297652800003 0.189742850932001 0.88158046 +2215 1.68373668000003 0.189073851506499 0.87859723 +2216 1.68449683200003 0.188407116041356 0.87562385 +2217 1.68525698400003 0.187742637069389 0.87266027 +2218 1.68601713600003 0.187080407147476 0.86970646 +2219 1.68677728800003 0.186420418856472 0.8667624 +2220 1.68753744000003 0.185762664801139 0.86382805 +2221 1.68829759200003 0.18510713761007 0.86090339 +2222 1.68905774400003 0.184453829935614 0.85798837 +2223 1.68981789600003 0.183802734453802 0.85508298 +2224 1.69057804800003 0.183153843864273 0.85218717 +2225 1.69133820000003 0.182507150890203 0.84930092 +2226 1.69209835200003 0.181862648278224 0.8464242 +2227 1.69285850400003 0.18122032879836 0.84355697 +2228 1.69361865600003 0.180580185243946 0.84069921 +2229 1.69437880800003 0.17994221043156 0.83785088 +2230 1.69513896000003 0.179306397200948 0.83501196 +2231 1.69589911200003 0.178672738414952 0.83218241 +2232 1.69665926400003 0.178041226959438 0.8293622 +2233 1.69741941600003 0.177411855743224 0.82655131 +2234 1.69817956800003 0.176784617698006 0.8237497 +2235 1.69893972000003 0.17615950577829 0.82095735 +2236 1.69969987200003 0.175536512961318 0.81817421 +2237 1.70046002400003 0.174915632246997 0.81540028 +2238 1.70122017600003 0.174296856657831 0.8126355 +2239 1.70198032800003 0.173680179238844 0.80987987 +2240 1.70274048000003 0.173065593057515 0.80713333 +2241 1.70350063200003 0.172453091203706 0.80439588 +2242 1.70426078400003 0.171842666789591 0.80166747 +2243 1.70502093600003 0.171234312949587 0.79894807 +2244 1.70578108800003 0.170628022840282 0.79623767 +2245 1.70654124000003 0.170023789640371 0.79353622 +2246 1.70730139200003 0.169421606550578 0.7908437 +2247 1.70806154400003 0.168821466793597 0.78816009 +2248 1.70882169600003 0.168223363614015 0.78548535 +2249 1.70958184800003 0.167627290278246 0.78281945 +2250 1.71034200000003 0.167033240074464 0.78016237 +2251 1.71110215200003 0.166441206312532 0.77751407 +2252 1.71186230400003 0.165851182323937 0.77487453 +2253 1.71262245600003 0.165263161461719 0.77224372 +2254 1.71338260800003 0.164677137100406 0.76962162 +2255 1.71414276000003 0.164093102635943 0.76700819 +2256 1.71490291200003 0.16351105148563 0.7644034 +2257 1.71566306400003 0.16293097708805 0.76180723 +2258 1.71642321600003 0.162352872903004 0.75921965 +2259 1.71718336800003 0.161776732411444 0.75664064 +2260 1.71794352000003 0.161202549115408 0.75407016 +2261 1.71870367200003 0.160630316537953 0.75150818 +2262 1.71946382400003 0.160060028223086 0.74895468 +2263 1.72022397600003 0.159491677735702 0.74640964 +2264 1.72098412800003 0.158925258661518 0.74387302 +2265 1.72174428000003 0.158360764607005 0.7413448 +2266 1.72250443200003 0.157798189199324 0.73882495 +2267 1.72326458400003 0.157237526086261 0.73631344 +2268 1.72402473600003 0.156678768936164 0.73381024 +2269 1.72478488800003 0.156121911437875 0.73131534 +2270 1.72554504000003 0.155566947300665 0.7288287 +2271 1.72630519200003 0.155013870254175 0.72635029 +2272 1.72706534400003 0.154462674048347 0.72388009 +2273 1.72782549600003 0.153913352453361 0.72141808 +2274 1.72858564800003 0.153365899259572 0.71896422 +2275 1.72934580000003 0.152820308277448 0.71651849 +2276 1.73010595200003 0.152276573337502 0.71408086 +2277 1.73086610400003 0.151734688290234 0.71165131 +2278 1.73162625600003 0.151194647006065 0.70922981 +2279 1.73238640800003 0.150656443375275 0.70681633 +2280 1.73314656000003 0.150120071307939 0.70441086 +2281 1.73390671200003 0.14958552473387 0.70201335 +2282 1.73466686400003 0.149052797602548 0.69962379 +2283 1.73542701600003 0.148521883883066 0.69724216 +2284 1.73618716800003 0.147992777564063 0.69486841 +2285 1.73694732000003 0.147465472653666 0.69250254 +2286 1.73770747200003 0.146939963179426 0.69014451 +2287 1.73846762400003 0.146416243188256 0.6877943 +2288 1.73922777600003 0.145894306746374 0.68545189 +2289 1.73998792800003 0.145374147939237 0.68311724 +2290 1.74074808000003 0.144855760871486 0.68079034 +2291 1.74150823200003 0.144339139666879 0.67847115 +2292 1.74226838400003 0.143824278468235 0.67615966 +2293 1.74302853600003 0.143311171437374 0.67385583 +2294 1.74378868800003 0.142799812755054 0.67155965 +2295 1.74454884000003 0.142290196620912 0.66927108 +2296 1.74530899200003 0.141782317253409 0.66699011 +2297 1.74606914400003 0.141276168889763 0.66471671 +2298 1.74682929600003 0.140771745785895 0.66245085 +2299 1.74758944800003 0.140269042216369 0.66019251 +2300 1.74834960000003 0.139768052474332 0.65794166 +2301 1.74910975200003 0.139268770871455 0.65569829 +2302 1.74986990400003 0.138771191737875 0.65346237 +2303 1.75063005600003 0.13827530942214 0.65123386 +2304 1.75139020800003 0.137781118291144 0.64901276 +2305 1.75215036000003 0.137288612730073 0.64679903 +2306 1.75291051200003 0.13679778714235 0.64459265 +2307 1.75367066400003 0.13630863594957 0.64239359 +2308 1.75443081600003 0.135821153591449 0.64020184 +2309 1.75519096800003 0.135335334525764 0.63801737 +2310 1.75595112000003 0.134851173228295 0.63584016 +2311 1.75671127200003 0.13436866419277 0.63367017 +2312 1.75747142400003 0.133887801930807 0.6315074 +2313 1.75823157600003 0.133408580971858 0.62935181 +2314 1.75899172800003 0.132930995863153 0.62720338 +2315 1.75975188000003 0.132455041169641 0.62506209 +2316 1.76051203200003 0.131980711473936 0.62292791 +2317 1.76127218400003 0.131508001376264 0.62080083 +2318 1.76203233600003 0.1310369054944 0.61868081 +2319 1.76279248800003 0.130567418463618 0.61656784 +2320 1.76355264000003 0.130099534936637 0.6144619 +2321 1.76431279200003 0.129633249583557 0.61236295 +2322 1.76507294400003 0.129168557091815 0.61027098 +2323 1.76583309600003 0.128705452166121 0.60818597 +2324 1.76659324800003 0.12824392952841 0.60610789 +2325 1.76735340000003 0.127783983917783 0.60403672 +2326 1.76811355200003 0.127325610090453 0.60197243 +2327 1.76887370400003 0.126868802819692 0.59991501 +2328 1.76963385600003 0.12641355689578 0.59786444 +2329 1.77039400800003 0.125959867125942 0.59582068 +2330 1.77115416000003 0.125507728334305 0.59378372 +2331 1.77191431200003 0.125057135361836 0.59175354 +2332 1.77267446400003 0.124608083066293 0.58973011 +2333 1.77343461600003 0.12416056632217 0.58771341 +2334 1.77419476800003 0.123714580020647 0.58570342 +2335 1.77495492000003 0.12327011906953 0.58370012 +2336 1.77571507200003 0.122827178393206 0.58170349 +2337 1.77647522400003 0.122385752932587 0.5797135 +2338 1.77723537600003 0.121945837645056 0.57773013 +2339 1.77799552800003 0.121507427504418 0.57575337 +2340 1.77875568000003 0.121070517500844 0.57378318 +2341 1.77951583200003 0.120635102640823 0.57181955 +2342 1.78027598400003 0.120201177947108 0.56986246 +2343 1.78103613600003 0.119768738458664 0.56791189 +2344 1.78179628800003 0.119337779230618 0.56596781 +2345 1.78255644000003 0.118908295334205 0.5640302 +2346 1.78331659200003 0.118480281856721 0.56209905 +2347 1.78407674400003 0.118053733901467 0.56017433 +2348 1.78483689600003 0.117628646587704 0.55825601 +2349 1.78559704800003 0.117205015050594 0.55634409 +2350 1.78635720000003 0.11678283444116 0.55443854 +2351 1.78711735200003 0.116362099926226 0.55253933 +2352 1.78787750400003 0.115942806688371 0.55064645 +2353 1.78863765600003 0.11552494992588 0.54875988 +2354 1.78939780800003 0.115108524852692 0.54687959 +2355 1.79015796000003 0.114693526698349 0.54500557 +2356 1.79091811200003 0.114279950707952 0.54313779 +2357 1.79167826400003 0.113867792142103 0.54127624 +2358 1.79243841600003 0.113457046276865 0.53942089 +2359 1.79319856800003 0.113047708403703 0.53757173 +2360 1.79395872000003 0.112639773829444 0.53572873 +2361 1.79471887200003 0.112233237876223 0.53389187 +2362 1.79547902400003 0.111828095881434 0.53206114 +2363 1.79623917600003 0.111424343197684 0.53023651 +2364 1.79699932800003 0.111021975192744 0.52841797 +2365 1.79775948000003 0.110620987249498 0.52660549 +2366 1.79851963200003 0.110221374765899 0.52479905 +2367 1.79927978400003 0.109823133154918 0.52299864 +2368 1.80003993600003 0.109426257844496 0.52120423 +2369 1.80080008800003 0.109030744277499 0.51941581 +2370 1.80156024000003 0.108636587911668 0.51763335 +2371 1.80232039200003 0.108243784219573 0.51585684 +2372 1.80308054400003 0.107852328688563 0.51408626 +2373 1.80384069600003 0.107462216820722 0.51232159 +2374 1.80460084800003 0.107073444132824 0.5105628 +2375 1.80536100000003 0.106686006156278 0.50880988 +2376 1.80612115200003 0.10629989843709 0.50706281 +2377 1.80688130400003 0.105915116535811 0.50532157 +2378 1.80764145600003 0.105531656027494 0.50358615 +2379 1.80840160800003 0.105149512501646 0.50185651 +2380 1.80916176000003 0.104768681562181 0.50013265 +2381 1.80992191200003 0.104389158827376 0.49841455 +2382 1.81068206400003 0.104010939929824 0.49670218 +2383 1.81144221600003 0.103634020516389 0.49499553 +2384 1.81220236800003 0.10325839624816 0.49329458 +2385 1.81296252000003 0.102884062800406 0.4915993 +2386 1.81372267200003 0.102511015862528 0.48990969 +2387 1.81448282400003 0.10213925113802 0.48822572 +2388 1.81524297600003 0.101768764344419 0.48654738 +2389 1.81600312800003 0.101399551213259 0.48487464 +2390 1.81676328000003 0.101031607490031 0.48320749 +2391 1.81752343200003 0.100664928934137 0.48154591 +2392 1.81828358400003 0.100299511318843 0.47988988 +2393 1.81904373600003 0.0999353504312363 0.47823938 +2394 1.81980388800003 0.0995724420721821 0.4765944 +2395 1.82056404000003 0.0992107820562789 0.47495492 +2396 1.82132419200003 0.0988503662118142 0.47332091 +2397 1.82208434400003 0.0984911903807212 0.47169237 +2398 1.82284449600003 0.0981332504185349 0.47006927 +2399 1.82360464800003 0.0977765421943493 0.46845159 +2400 1.82436480000003 0.0974210615907723 0.46683932 +2401 1.82512495200003 0.0970668045038847 0.46523245 +2402 1.82588510400003 0.0967137668431962 0.46363094 +2403 1.82664525600003 0.0963619445316016 0.46203479 +2404 1.82740540800003 0.0960113335053394 0.46044398 +2405 1.82816556000003 0.0956619297139481 0.45885848 +2406 1.82892571200003 0.0953137291202238 0.45727829 +2407 1.82968586400003 0.0949667277001787 0.45570338 +2408 1.83044601600003 0.0946209214429973 0.45413375 +2409 1.83120616800003 0.0942763063509957 0.45256936 +2410 1.83196632000003 0.093932878439578 0.4510102 +2411 1.83272647200003 0.0935906337371965 0.44945626 +2412 1.83348662400003 0.0932495682853078 0.44790752 +2413 1.83424677600003 0.0929096781383324 0.44636397 +2414 1.83500692800003 0.0925709593636129 0.44482557 +2415 1.83576708000003 0.0922334080413731 0.44329233 +2416 1.83652723200003 0.0918970202646752 0.44176421 +2417 1.83728738400003 0.0915617921393803 0.44024122 +2418 1.83804753600003 0.0912277197841072 0.43872331 +2419 1.83880768800003 0.0908947993301906 0.43721049 +2420 1.83956784000003 0.0905630269216412 0.43570274 +2421 1.84032799200003 0.0902323987151046 0.43420003 +2422 1.84108814400003 0.0899029108798213 0.43270235 +2423 1.84184829600003 0.089574559597586 0.43120969 +2424 1.84260844800003 0.0892473410627071 0.42972203 +2425 1.84336860000003 0.0889212514819673 0.42823934 +2426 1.84412875200003 0.0885962870745832 0.42676163 +2427 1.84488890400003 0.0882724440721652 0.42528886 +2428 1.84564905600003 0.0879497187186776 0.42382103 +2429 1.84640920800003 0.0876281072704006 0.42235811 +2430 1.84716936000003 0.0873076059958886 0.42090009 +2431 1.84792951200003 0.0869882111759321 0.41944696 +2432 1.84868966400003 0.0866699191035182 0.4179987 +2433 1.84944981600003 0.0863527260837915 0.41655529 +2434 1.85020996800003 0.0860366284340147 0.41511671 +2435 1.85097012000003 0.0857216224835309 0.41368296 +2436 1.85173027200003 0.0854077045737227 0.41225401 +2437 1.85249042400003 0.0850948710579759 0.41082986 +2438 1.85325057600003 0.0847831183016397 0.40941047 +2439 1.85401072800003 0.0844724426819882 0.40799584 +2440 1.85477088000003 0.0841628405881828 0.40658596 +2441 1.85553103200003 0.0838543084212334 0.4051808 +2442 1.85629118400003 0.0835468425939609 0.40378036 +2443 1.85705133600003 0.0832404395309589 0.40238461 +2444 1.85781148800003 0.0829350956685558 0.40099354 +2445 1.85857164000003 0.0826308074547775 0.39960713 +2446 1.85933179200003 0.0823275713493096 0.39822538 +2447 1.86009194400003 0.0820253838234601 0.39684825 +2448 1.86085209600003 0.0817242413601219 0.39547575 +2449 1.86161224800003 0.0814241404537353 0.39410786 +2450 1.86237240000003 0.0811250776102515 0.39274455 +2451 1.86313255200003 0.0808270493470957 0.39138581 +2452 1.86389270400003 0.0805300521931287 0.39003164 +2453 1.86465285600003 0.0802340826886125 0.38868201 +2454 1.86541300800003 0.0799391373851719 0.3873369 +2455 1.86617316000003 0.0796452128457584 0.38599631 +2456 1.86693331200003 0.0793523056446141 0.38466022 +2457 1.86769346400003 0.0790604123672349 0.38332862 +2458 1.86845361600003 0.0787695296103353 0.38200148 +2459 1.86921376800003 0.0784796539818105 0.3806788 +2460 1.86997392000003 0.0781907821007026 0.37936057 +2461 1.87073407200003 0.0779029105971634 0.37804675 +2462 1.87149422400003 0.0776160361124185 0.37673735 +2463 1.87225437600003 0.0773301552987327 0.37543234 +2464 1.87301452800003 0.0770452648193736 0.37413172 +2465 1.87377468000003 0.0767613613485764 0.37283546 +2466 1.87453483200003 0.0764784415715092 0.37154356 +2467 1.87529498400003 0.0761965021842369 0.370256 +2468 1.87605513600003 0.0759155398936867 0.36897276 +2469 1.87681528800003 0.075635551417613 0.36769384 +2470 1.87757544000003 0.0753565334845625 0.36641921 +2471 1.87833559200003 0.0750784828338396 0.36514886 +2472 1.87909574400003 0.0748013962154712 0.36388278 +2473 1.87985589600003 0.0745252703901732 0.36262095 +2474 1.88061604800003 0.0742501021293151 0.36136337 +2475 1.88137620000003 0.0739758882148861 0.36011001 +2476 1.88213635200003 0.0737026254394614 0.35886087 +2477 1.88289650400003 0.0734303106061667 0.35761592 +2478 1.88365665600003 0.0731589405286456 0.35637516 +2479 1.88441680800003 0.0728885120310253 0.35513856 +2480 1.88517696000003 0.0726190219478828 0.35390613 +2481 1.88593711200003 0.0723504671242102 0.35267784 +2482 1.88669726400003 0.072082844415383 0.35145368 +2483 1.88745741600003 0.0718161506871255 0.35023364 +2484 1.88821756800003 0.0715503828154775 0.3490177 +2485 1.88897772000003 0.0712855376867614 0.34780585 +2486 1.88973787200003 0.0710216121975486 0.34659807 +2487 1.89049802400003 0.0707586032546269 0.34539436 +2488 1.89125817600003 0.0704965077749672 0.34419469 +2489 1.89201832800003 0.0702353226856909 0.34299907 +2490 1.89277848000003 0.0699750449240369 0.34180746 +2491 1.89353863200003 0.0697156714373295 0.34061986 +2492 1.89429878400003 0.0694571991829454 0.33943626 +2493 1.89505893600003 0.0691996251282809 0.33825665 +2494 1.89581908800003 0.0689429462507206 0.337081 +2495 1.89657924000003 0.0686871595376045 0.33590931 +2496 1.89733939200003 0.068432261986196 0.33474156 +2497 1.89809954400003 0.0681782506036498 0.33357774 +2498 1.89885969600003 0.0679251224069802 0.33241785 +2499 1.89961984800003 0.067672874423029 0.33126185 +2500 1.90038000000003 0.0674215036884341 0.33010975 +2501 1.90114015200003 0.0671710072495973 0.32896153 +2502 1.90190030400003 0.0669213821626536 0.32781717 +2503 1.90266045600003 0.0666726254934391 0.32667667 +2504 1.90342060800003 0.0664247343174599 0.32554001 +2505 1.90418076000003 0.0661777057198612 0.32440717 +2506 1.90494091200003 0.0659315367953954 0.32327815 +2507 1.90570106400003 0.0656862246483918 0.32215294 +2508 1.90646121600003 0.0654417663927256 0.32103152 +2509 1.90722136800003 0.0651981591517862 0.31991387 +2510 1.90798152000003 0.0649554000584477 0.31879999 +2511 1.90874167200003 0.0647134862550375 0.31768986 +2512 1.90950182400003 0.0644724148933059 0.31658347 +2513 1.91026197600003 0.0642321831343956 0.31548081 +2514 1.91102212800003 0.0639927881488118 0.31438187 +2515 1.91178228000003 0.0637542271163909 0.31328663 +2516 1.91254243200003 0.0635164972262719 0.31219509 +2517 1.91330258400003 0.0632795956768645 0.31110722 +2518 1.91406273600003 0.0630435196758205 0.31002302 +2519 1.91482288800003 0.0628082664400035 0.30894247 +2520 1.91558304000003 0.0625738331954593 0.30786557 +2521 1.91634319200003 0.0623402171773852 0.3067923 +2522 1.91710334400003 0.0621074156301022 0.30572265 +2523 1.91786349600003 0.0618754258070239 0.30465661 +2524 1.91862364800003 0.0616442449706278 0.30359416 +2525 1.91938380000003 0.0614138703924259 0.30253529 +2526 1.92014395200003 0.0611842993529356 0.30148 +2527 1.92090410400003 0.0609555291416499 0.30042827 +2528 1.92166425600003 0.0607275570570098 0.29938008 +2529 1.92242440800003 0.0605003804063731 0.29833543 +2530 1.92318456000003 0.0602739965059879 0.29729431 +2531 1.92394471200003 0.0600484026809626 0.2962567 +2532 1.92470486400003 0.059823596265237 0.29522259 +2533 1.92546501600003 0.0595995746015544 0.29419197 +2534 1.92622516800003 0.059376335041433 0.29316483 +2535 1.92698532000003 0.0591538749451369 0.29214115 +2536 1.92774547200003 0.0589321916816486 0.29112093 +2537 1.92850562400003 0.0587112826286398 0.29010416 +2538 1.92926577600003 0.0584911451724446 0.28909081 +2539 1.93002592800003 0.05827177670803 0.28808089 +2540 1.93078608000003 0.058053174638969 0.28707438 +2541 1.93154623200003 0.0578353363774123 0.28607127 +2542 1.93230638400003 0.0576182593440601 0.28507154 +2543 1.93306653600003 0.0574019409681358 0.2840752 +2544 1.93382668800003 0.0571863786873566 0.28308221 +2545 1.93458684000003 0.0569715699479071 0.28209258 +2546 1.93534699200003 0.0567575122044116 0.2811063 +2547 1.93610714400003 0.0565442029199067 0.28012334 +2548 1.93686729600003 0.0563316395658142 0.27914371 +2549 1.93762744800003 0.0561198196219137 0.27816739 +2550 1.93838760000003 0.0559087405763159 0.27719436 +2551 1.93914775200003 0.0556983999254345 0.27622463 +2552 1.93990790400003 0.0554887951739611 0.27525817 +2553 1.94066805600003 0.0552799238348366 0.27429497 +2554 1.94142820800003 0.0550717834292255 0.27333504 +2555 1.94218836000003 0.054864371486489 0.27237834 +2556 1.94294851200003 0.0546576855441585 0.27142489 +2557 1.94370866400003 0.0544517231479082 0.27047465 +2558 1.94446881600003 0.0542464818515302 0.26952763 +2559 1.94522896800003 0.0540419592169073 0.26858381 +2560 1.94598912000003 0.0538381528139869 0.26764318 +2561 1.94674927200003 0.0536350602207542 0.26670573 +2562 1.94750942400003 0.0534326790232078 0.26577145 +2563 1.94826957600003 0.0532310068153316 0.26484034 +2564 1.94902972800003 0.0530300411990706 0.26391237 +2565 1.94978988000003 0.0528297797843041 0.26298754 +2566 1.95055003200003 0.0526302201888203 0.26206584 +2567 1.95131018400003 0.0524313600382903 0.26114726 +2568 1.95207033600003 0.0522331969662434 0.26023179 +2569 1.95283048800003 0.0520357286140405 0.25931941 +2570 1.95359064000003 0.0518389526308492 0.25841012 +2571 1.95435079200003 0.0516428666736184 0.25750391 +2572 1.95511094400003 0.0514474684070533 0.25660077 +2573 1.95587109600003 0.0512527555035897 0.25570068 +2574 1.95663124800003 0.0510587256433688 0.25480364 +2575 1.95739140000003 0.0508653765142134 0.25390963 +2576 1.95815155200003 0.0506727058116014 0.25301866 +2577 1.95891170400003 0.0504807112386417 0.2521307 +2578 1.95967185600003 0.0502893905060496 0.25124574 +2579 1.96043200800003 0.0500987413321215 0.25036378 +2580 1.96119216000003 0.0499087614427108 0.24948481 +2581 1.96195231200003 0.049719448571203 0.24860882 +2582 1.96271246400003 0.0495308004584913 0.24773579 +2583 1.96347261600003 0.0493428148529524 0.24686572 +2584 1.96423276800003 0.049155489510422 0.2459986 +2585 1.96499292000003 0.0489688221941705 0.24513442 +2586 1.96575307200003 0.048782810674879 0.24427316 +2587 1.96651322400003 0.0485974527306154 0.24341482 +2588 1.96727337600003 0.0484127461468096 0.24255939 +2589 1.96803352800003 0.0482286887162304 0.24170686 +2590 1.96879368000003 0.0480452782389612 0.24085722 +2591 1.96955383200003 0.0478625125223766 0.24001046 +2592 1.97031398400003 0.0476803893811183 0.23916656 +2593 1.97107413600003 0.0474989066370715 0.23832553 +2594 1.97183428800003 0.0473180621193415 0.23748735 +2595 1.97259444000003 0.0471378536642301 0.23665201 +2596 1.97335459200003 0.0469582791152126 0.23581951 +2597 1.97411474400003 0.0467793363229138 0.23498982 +2598 1.97487489600003 0.0466010231450849 0.23416295 +2599 1.97563504800003 0.046423337446581 0.23333889 +2600 1.97639520000003 0.046246277099337 0.23251762 +2601 1.97715535200003 0.0460698399823454 0.23169913 +2602 1.97791550400003 0.0458940239816325 0.23088342 +2603 1.97867565600003 0.0457188269902364 0.23007048 +2604 1.97943580800003 0.0455442469081835 0.2292603 +2605 1.98019596000003 0.045370281642466 0.22845286 +2606 1.98095611200003 0.0451969291070195 0.22764817 +2607 1.98171626400003 0.0450241872226998 0.2268462 +2608 1.98247641600003 0.0448520539172609 0.22604696 +2609 1.98323656800003 0.0446805271253323 0.22525043 +2610 1.98399672000003 0.0445096047883962 0.2244566 +2611 1.98475687200003 0.0443392848547666 0.22366547 +2612 1.98551702400003 0.0441695652795652 0.22287702 +2613 1.98627717600003 0.0440004440247004 0.22209125 +2614 1.98703732800003 0.0438319190588453 0.22130815 +2615 1.98779748000003 0.0436639883574146 0.22052771 +2616 1.98855763200003 0.0434966499025437 0.21974991 +2617 1.98931778400003 0.0433299016830665 0.21897476 +2618 1.99007793600003 0.0431637416944932 0.21820224 +2619 1.99083808800003 0.042998167938989 0.21743235 +2620 1.99159824000003 0.0428331784253525 0.21666507 +2621 1.99235839200003 0.0426687711689936 0.21590039 +2622 1.99311854400003 0.0425049441919119 0.21513832 +2623 1.99387869600003 0.0423416955226761 0.21437883 +2624 1.99463884800003 0.0421790231964017 0.21362193 +2625 1.99539900000003 0.0420169252547301 0.21286759 +2626 1.99615915200003 0.041855399745807 0.21211582 +2627 1.99691930400003 0.0416944447242618 0.2113666 +2628 1.99767945600003 0.0415340582511855 0.21061994 +2629 1.99843960800003 0.0413742383941107 0.2098758 +2630 1.99919976000003 0.0412149832269896 0.2091342 +2631 1.99995991200003 0.0410562908301741 0.20839512 +2632 2.00072006400003 0.0408981592903941 0.20765855 +2633 2.00148021600003 0.0407405867007369 0.20692449 +2634 2.00224036800003 0.0405835711606267 0.20619292 +2635 2.00300052000003 0.0404271107758036 0.20546384 +2636 2.00376067200003 0.0402712036583034 0.20473724 +2637 2.00452082400003 0.0401158479264367 0.20401311 +2638 2.00528097600003 0.0399610417047686 0.20329145 +2639 2.00604112800003 0.0398067831240983 0.20257224 +2640 2.00680128000003 0.0396530703214386 0.20185547 +2641 2.00756143200003 0.0394999014399958 0.20114115 +2642 2.00832158400003 0.0393472746291494 0.20042925 +2643 2.00908173600003 0.0391951880444323 0.19971978 +2644 2.00984188800003 0.0390436398475098 0.19901272 +2645 2.01060204000003 0.0388926282061606 0.19830807 +2646 2.01136219200003 0.0387421512942564 0.19760582 +2647 2.01212234400003 0.0385922072917419 0.19690595 +2648 2.01288249600003 0.0384427943846152 0.19620847 +2649 2.01364264800003 0.0382939107649078 0.19551337 +2650 2.01440280000003 0.0381455546306653 0.19482063 +2651 2.01516295200003 0.0379977241859272 0.19413025 +2652 2.01592310400003 0.037850417640708 0.19344222 +2653 2.01668325600003 0.037703633210977 0.19275653 +2654 2.01744340800003 0.0375573691186392 0.19207318 +2655 2.01820356000003 0.0374116235915161 0.19139215 +2656 2.01896371200003 0.0372663948633259 0.19071345 +2657 2.01972386400003 0.0371216811736647 0.19003706 +2658 2.02048401600003 0.0369774807679869 0.18936297 +2659 2.02124416800003 0.0368337918975865 0.18869118 +2660 2.02200432000003 0.0366906128195774 0.18802167 +2661 2.02276447200003 0.0365479417968751 0.18735445 +2662 2.02352462400003 0.0364057770981771 0.1866895 +2663 2.02428477600003 0.0362641169979446 0.18602682 +2664 2.02504492800003 0.0361229597763833 0.1853664 +2665 2.02580508000003 0.0359823037194244 0.18470823 +2666 2.02656523200003 0.0358421471187064 0.1840523 +2667 2.02732538400003 0.0357024882715563 0.18339861 +2668 2.02808553600003 0.0355633254809707 0.18274715 +2669 2.02884568800003 0.0354246570555975 0.1820979 +2670 2.02960584000003 0.0352864813097175 0.18145088 +2671 2.03036599200003 0.035148796563226 0.18080605 +2672 2.03112614400003 0.0350116011416141 0.18016343 +2673 2.03188629600003 0.0348748933759506 0.179523 +2674 2.03264644800003 0.034738671602864 0.17888476 +2675 2.03340660000003 0.0346029341645239 0.17824869 +2676 2.03416675200002 0.0344676794086233 0.17761479 +2677 2.03492690400002 0.0343329056883601 0.17698305 +2678 2.03568705600002 0.0341986113624193 0.17635347 +2679 2.03644720800002 0.0340647947949552 0.17572604 +2680 2.03720736000002 0.0339314543555731 0.17510075 +2681 2.03796751200002 0.0337985884193122 0.1744776 +2682 2.03872766400002 0.0336661953666268 0.17385657 +2683 2.03948781600002 0.0335342735833694 0.17323766 +2684 2.04024796800002 0.0334028214607727 0.17262086 +2685 2.04100812000002 0.0332718373954321 0.17200617 +2686 2.04176827200002 0.0331413197892878 0.17139358 +2687 2.04252842400002 0.0330112670496081 0.17078308 +2688 2.04328857600002 0.032881677588971 0.17017467 +2689 2.04404872800002 0.0327525498252476 0.16956833 +2690 2.04480888000002 0.0326238821815843 0.16896406 +2691 2.04556903200002 0.0324956730863856 0.16836186 +2692 2.04632918400002 0.0323679209732971 0.16776171 +2693 2.04708933600002 0.0322406242811879 0.16716362 +2694 2.04784948800002 0.0321137814541343 0.16656757 +2695 2.04860964000002 0.0319873909414018 0.16597355 +2696 2.04936979200002 0.0318614511974287 0.16538157 +2697 2.05012994400002 0.031735960681809 0.16479161 +2698 2.05089009600002 0.0316109178592756 0.16420366 +2699 2.05165024800002 0.0314863211996832 0.16361772 +2700 2.05241040000002 0.0313621691779917 0.16303379 +2701 2.05317055200002 0.0312384602742497 0.16245185 +2702 2.05393070400002 0.0311151929735773 0.16187191 +2703 2.05469085600002 0.03099236576615 0.16129394 +2704 2.05545100800002 0.0308699771471819 0.16071795 +2705 2.05621116000002 0.030748025616909 0.16014394 +2706 2.05697131200002 0.0306265096805733 0.15957188 +2707 2.05773146400002 0.0305054278484058 0.15900178 +2708 2.05849161600002 0.0303847786356103 0.15843363 +2709 2.05925176800002 0.0302645605623474 0.15786743 +2710 2.06001192000002 0.0301447721537179 0.15730316 +2711 2.06077207200002 0.0300254119397469 0.15674082 +2712 2.06153222400002 0.0299064784553675 0.15618041 +2713 2.06229237600002 0.0297879702404043 0.15562191 +2714 2.06305252800002 0.0296698858395584 0.15506533 +2715 2.06381268000002 0.0295522238023903 0.15451065 +2716 2.06457283200002 0.0294349826833049 0.15395787 +2717 2.06533298400002 0.0293181610415344 0.15340698 +2718 2.06609313600002 0.029201757441124 0.15285797 +2719 2.06685328800002 0.0290857704509152 0.15231085 +2720 2.06761344000002 0.0289701986445296 0.1517656 +2721 2.06837359200002 0.0288550406003546 0.15122222 +2722 2.06913374400002 0.0287402949015267 0.1506807 +2723 2.06989389600002 0.028625960135916 0.15014103 +2724 2.07065404800001 0.0285120348961112 0.14960321 +2725 2.07141420000001 0.0283985177794037 0.14906723 +2726 2.07217435200001 0.0282854073877721 0.14853309 +2727 2.07293450400001 0.0281727023278672 0.14800078 +2728 2.07369465600001 0.0280604012109964 0.14747029 +2729 2.07445480800001 0.0279485026531084 0.14694162 +2730 2.07521496000001 0.0278370052747783 0.14641476 +2731 2.07597511200001 0.0277259077011917 0.14588971 +2732 2.07673526400001 0.0276152085621304 0.14536646 +2733 2.07749541600001 0.0275049064919569 0.144845 +2734 2.07825556800001 0.0273950001295991 0.14432533 +2735 2.07901572000001 0.0272854881185358 0.14380744 +2736 2.07977587200001 0.0271763691067819 0.14329132 +2737 2.08053602400001 0.0270676417468724 0.14277698 +2738 2.08129617600001 0.0269593046958491 0.1422644 +2739 2.08205632800001 0.0268513566152446 0.14175357 +2740 2.08281648000001 0.026743796171068 0.1412445 +2741 2.08357663200001 0.0266366220337904 0.14073718 +2742 2.08433678400001 0.0265298328783297 0.14023159 +2743 2.08509693600001 0.0264234273840366 0.13972774 +2744 2.08585708800001 0.0263174042346795 0.13922562 +2745 2.08661724000001 0.0262117621184305 0.13872522 +2746 2.08737739200001 0.0261064997278506 0.13822654 +2747 2.08813754400001 0.0260016157598751 0.13772957 +2748 2.08889769600001 0.0258971089157999 0.1372343 +2749 2.08965784800001 0.0257929779012664 0.13674074 +2750 2.09041800000001 0.0256892214262477 0.13624887 +2751 2.09117815200001 0.0255858382050341 0.13575868 +2752 2.09193830400001 0.0254828269562195 0.13527018 +2753 2.09269845600001 0.0253801864026863 0.13478336 +2754 2.09345860800001 0.0252779152715921 0.13429821 +2755 2.09421876000001 0.0251760122943551 0.13381473 +2756 2.09497891200001 0.0250744762066406 0.1333329 +2757 2.09573906400001 0.0249733057483468 0.13285273 +2758 2.09649921600001 0.0248724996635904 0.13237421 +2759 2.09725936800001 0.0247720567006939 0.13189734 +2760 2.09801952000001 0.0246719756121704 0.1314221 +2761 2.09877967200001 0.024572255154711 0.1309485 +2762 2.09953982400001 0.0244728940891704 0.13047652 +2763 2.10029997600001 0.0243738911805533 0.13000616 +2764 2.10106012800001 0.0242752451980007 0.12953743 +2765 2.10182028000001 0.0241769549147766 0.1290703 +2766 2.10258043200001 0.0240790191082543 0.12860478 +2767 2.10334058400001 0.0239814365599025 0.12814085 +2768 2.10410073600001 0.0238842060552725 0.12767853 +2769 2.10486088800001 0.0237873263839842 0.12721779 +2770 2.10562104000001 0.023690796339713 0.12675864 +2771 2.10638119200001 0.0235946147201765 0.12630106 +2772 2.107141344 0.0234987803271209 0.12584506 +2773 2.107901496 0.0234032919663082 0.12539063 +2774 2.108661648 0.0233081484475023 0.12493776 +2775 2.1094218 0.0232133485844567 0.12448645 +2776 2.110181952 0.0231188911949007 0.1240367 +2777 2.110942104 0.0230247751005265 0.12358848 +2778 2.111702256 0.0229309991269763 0.12314182 +2779 2.112462408 0.022837562103829 0.12269669 +2780 2.11322256 0.0227444628645878 0.12225309 +2781 2.113982712 0.0226517002466667 0.12181101 +2782 2.114742864 0.0225592730913774 0.12137046 +2783 2.115503016 0.0224671802439177 0.12093143 +2784 2.116263168 0.0223754205533573 0.12049391 +2785 2.11702332 0.022283992872626 0.12005789 +2786 2.117783472 0.0221928960585004 0.11962338 +2787 2.118543624 0.0221021289715916 0.11919036 +2788 2.119303776 0.0220116904763324 0.11875883 +2789 2.120063928 0.0219215794409649 0.11832879 +2790 2.12082408 0.0218317947375275 0.11790024 +2791 2.121584232 0.021742335241843 0.11747315 +2792 2.122344384 0.0216531998335058 0.11704754 +2793 2.123104536 0.0215643873958693 0.1166234 +2794 2.123864688 0.0214758968160338 0.11620071 +2795 2.12462484 0.0213877269848344 0.11577949 +2796 2.125384992 0.0212998767968278 0.11535971 +2797 2.126145144 0.0212123451502813 0.11494139 +2798 2.126905296 0.0211251309471593 0.1145245 +2799 2.127665448 0.0210382330931119 0.11410905 +2800 2.1284256 0.0209516504974626 0.11369504 +2801 2.129185752 0.0208653820731961 0.11328245 +2802 2.129945904 0.0207794267369464 0.11287128 +2803 2.130706056 0.0206937834089844 0.11246154 +2804 2.131466208 0.0206084510132064 0.1120532 +2805 2.13222636 0.0205234284771218 0.11164628 +2806 2.132986512 0.0204387147318413 0.11124076 +2807 2.133746664 0.0203543087120649 0.11083663 +2808 2.134506816 0.0202702093560704 0.1104339 +2809 2.135266968 0.0201864156057013 0.11003257 +2810 2.13602712 0.0201029264063552 0.10963261 +2811 2.136787272 0.0200197407069718 0.10923404 +2812 2.137547424 0.0199368574600217 0.10883684 +2813 2.138307576 0.0198542756214942 0.10844102 +2814 2.139067728 0.0197719941508862 0.10804656 +2815 2.13982788 0.0196900120111902 0.10765346 +2816 2.140588032 0.0196083281688833 0.10726172 +2817 2.141348184 0.0195269415939151 0.10687133 +2818 2.142108336 0.0194458512596965 0.10648229 +2819 2.142868488 0.0193650561430885 0.10609459 +2820 2.14362863999999 0.0192845552243905 0.10570824 +2821 2.14438879199999 0.0192043474873291 0.10532322 +2822 2.14514894399999 0.0191244319190468 0.10493952 +2823 2.14590909599999 0.0190448075100905 0.10455716 +2824 2.14666924799999 0.0189654732544006 0.10417611 +2825 2.14742939999999 0.0188864281492998 0.10379638 +2826 2.14818955199999 0.0188076711954815 0.10341797 +2827 2.14894970399999 0.0187292013969992 0.10304086 +2828 2.14970985599999 0.0186510177612551 0.10266506 +2829 2.15047000799999 0.018573119298989 0.10229055 +2830 2.15123015999999 0.0184955050242676 0.10191734 +2831 2.15199031199999 0.0184181739544731 0.10154542 +2832 2.15275046399999 0.0183411251102926 0.10117479 +2833 2.15351061599999 0.0182643575157071 0.10080544 +2834 2.15427076799999 0.0181878701979805 0.10043737 +2835 2.15503091999999 0.0181116621876488 0.10007056 +2836 2.15579107199999 0.0180357325185094 0.099705033 +2837 2.15655122399999 0.0179600802276104 0.099340766 +2838 2.15731137599999 0.0178847043552394 0.098977759 +2839 2.15807152799999 0.0178096039449132 0.098616008 +2840 2.15883167999999 0.0177347780433674 0.09825551 +2841 2.15959183199999 0.0176602257005451 0.097896259 +2842 2.16035198399999 0.0175859459695867 0.097538251 +2843 2.16111213599999 0.0175119379068192 0.097181483 +2844 2.16187228799999 0.0174382005717457 0.09682595 +2845 2.16263243999999 0.0173647330270353 0.096471649 +2846 2.16339259199999 0.017291534338512 0.096118574 +2847 2.16415274399999 0.0172186035751444 0.095766721 +2848 2.16491289599999 0.0171459398090358 0.095416088 +2849 2.16567304799999 0.0170735421154132 0.095066669 +2850 2.16643319999999 0.0170014095726175 0.09471846 +2851 2.16719335199999 0.016929541262093 0.094371457 +2852 2.16795350399999 0.0168579362683769 0.094025657 +2853 2.16871365599999 0.0167865936790896 0.093681056 +2854 2.16947380799999 0.0167155125849239 0.093337648 +2855 2.17023395999999 0.0166446920796355 0.09299543 +2856 2.17099411199999 0.0165741312600322 0.092654399 +2857 2.17175426399999 0.0165038292259642 0.09231455 +2858 2.17251441599999 0.0164337850803144 0.091975879 +2859 2.17327456799999 0.0163639979289873 0.091638382 +2860 2.17403471999999 0.0162944668809 0.091302056 +2861 2.17479487199999 0.016225191047972 0.090966896 +2862 2.17555502399999 0.016156169545115 0.090632898 +2863 2.17631517599999 0.0160874014902232 0.090300059 +2864 2.17707532799999 0.0160188860041633 0.089968374 +2865 2.17783547999999 0.015950622210765 0.08963784 +2866 2.17859563199999 0.0158826092368108 0.089308453 +2867 2.17935578399999 0.0158148462120265 0.088980209 +2868 2.18011593599998 0.0157473322690712 0.088653104 +2869 2.18087608799998 0.0156800665435279 0.088327134 +2870 2.18163623999998 0.0156130481738938 0.088002296 +2871 2.18239639199998 0.0155462763015703 0.087678585 +2872 2.18315654399998 0.0154797500708537 0.087355998 +2873 2.18391669599998 0.0154134686289257 0.087034531 +2874 2.18467684799998 0.0153474311258435 0.08671418 +2875 2.18543699999998 0.0152816367145306 0.086394941 +2876 2.18619715199998 0.0152160845507673 0.086076812 +2877 2.18695730399998 0.0151507737931808 0.085759787 +2878 2.18771745599998 0.0150857036032366 0.085443864 +2879 2.18847760799998 0.0150208731452282 0.085129038 +2880 2.18923775999998 0.0149562815862684 0.084815306 +2881 2.18999791199998 0.0148919280962798 0.084502664 +2882 2.19075806399998 0.014827811847985 0.084191109 +2883 2.19151821599998 0.0147639320168983 0.083880636 +2884 2.19227836799998 0.0147002877813156 0.083571243 +2885 2.19303851999998 0.0146368783223056 0.083262925 +2886 2.19379867199998 0.0145737028237005 0.082955679 +2887 2.19455882399998 0.0145107604720868 0.082649501 +2888 2.19531897599998 0.0144480504567963 0.082344388 +2889 2.19607912799998 0.014385571969897 0.082040336 +2890 2.19683927999998 0.0143233242061839 0.081737341 +2891 2.19759943199998 0.0142613063631702 0.0814354 +2892 2.19835958399998 0.014199517641078 0.08113451 +2893 2.19911973599998 0.0141379572428296 0.080834667 +2894 2.19987988799998 0.0140766243740383 0.080535866 +2895 2.20064003999998 0.0140155182429997 0.080238106 +2896 2.20140019199998 0.0139546380606827 0.079941382 +2897 2.20216034399998 0.0138939830407208 0.07964569 +2898 2.20292049599998 0.0138335523994029 0.079351028 +2899 2.20368064799998 0.0137733453556649 0.079057391 +2900 2.20444079999998 0.0137133611310808 0.078764777 +2901 2.20520095199998 0.013653598949854 0.078473182 +2902 2.20596110399998 0.0135940580388081 0.078182602 +2903 2.20672125599998 0.0135347376273792 0.077893034 +2904 2.20748140799998 0.0134756369476063 0.077604475 +2905 2.20824155999998 0.0134167552341231 0.07731692 +2906 2.20900171199998 0.0133580917241493 0.077030368 +2907 2.20976186399998 0.0132996456574822 0.076744814 +2908 2.21052201599998 0.013241416276488 0.076460255 +2909 2.21128216799998 0.0131834028260932 0.076176687 +2910 2.21204231999998 0.0131256045537763 0.075894108 +2911 2.21280247199998 0.0130680207095593 0.075612514 +2912 2.21356262399998 0.0130106505459989 0.075331902 +2913 2.21432277599998 0.0129534933181788 0.075052267 +2914 2.21508292799998 0.0128965482837008 0.074773608 +2915 2.21584307999998 0.0128398147026764 0.074495921 +2916 2.21660323199997 0.012783291837719 0.074219201 +2917 2.21736338399997 0.0127269789539349 0.073943447 +2918 2.21812353599997 0.0126708753189156 0.073668655 +2919 2.21888368799997 0.0126149802027293 0.073394822 +2920 2.21964383999997 0.0125592928779126 0.073121944 +2921 2.22040399199997 0.0125038126194627 0.072850018 +2922 2.22116414399997 0.0124485387048287 0.07257904 +2923 2.22192429599997 0.0123934704139039 0.072309009 +2924 2.22268444799997 0.0123386070290174 0.07203992 +2925 2.22344459999997 0.0122839478349263 0.071771771 +2926 2.22420475199997 0.0122294921188073 0.071504557 +2927 2.22496490399997 0.012175239170249 0.071238277 +2928 2.22572505599997 0.0121211882812436 0.070972927 +2929 2.22648520799997 0.0120673387461793 0.070708503 +2930 2.22724535999997 0.0120136898618319 0.070445002 +2931 2.22800551199997 0.0119602409273572 0.070182422 +2932 2.22876566399997 0.011906991244283 0.06992076 +2933 2.22952581599997 0.0118539401165011 0.069660011 +2934 2.23028596799997 0.0118010868502598 0.069400174 +2935 2.23104611999997 0.0117484307541555 0.069141245 +2936 2.23180627199997 0.0116959711391255 0.068883221 +2937 2.23256642399997 0.01164370731844 0.068626098 +2938 2.23332657599997 0.0115916386076941 0.068369874 +2939 2.23408672799997 0.0115397643248006 0.068114547 +2940 2.23484687999997 0.0114880837899818 0.067860112 +2941 2.23560703199997 0.0114365963257621 0.067606566 +2942 2.23636718399997 0.0113853012569602 0.067353908 +2943 2.23712733599997 0.0113341979106819 0.067102133 +2944 2.23788748799997 0.0112832856163117 0.066851238 +2945 2.23864763999997 0.0112325637055061 0.066601222 +2946 2.23940779199997 0.0111820315121854 0.06635208 +2947 2.24016794399997 0.0111316883725266 0.06610381 +2948 2.24092809599997 0.0110815336249556 0.065856409 +2949 2.24168824799997 0.0110315666101401 0.065609874 +2950 2.24244839999997 0.0109817866709817 0.065364202 +2951 2.24320855199997 0.0109321931526087 0.06511939 +2952 2.24396870399997 0.0108827854023688 0.064875435 +2953 2.24472885599997 0.0108335627698215 0.064632334 +2954 2.24548900799997 0.0107845246067311 0.064390084 +2955 2.24624915999997 0.0107356702670589 0.064148683 +2956 2.24700931199997 0.0106869991069562 0.063908128 +2957 2.24776946399997 0.010638510484757 0.063668415 +2958 2.24852961599997 0.0105902037609707 0.063429542 +2959 2.24928976799997 0.0105420782982748 0.063191506 +2960 2.25004991999997 0.0104941334615079 0.062954304 +2961 2.25081007199997 0.0104463686176622 0.062717934 +2962 2.25157022399997 0.0103987831358767 0.062482392 +2963 2.25233037599997 0.0103513763874298 0.062247676 +2964 2.25309052799996 0.0103041477457322 0.062013782 +2965 2.25385067999996 0.01025709658632 0.061780709 +2966 2.25461083199996 0.0102102222868473 0.061548453 +2967 2.25537098399996 0.0101635242270796 0.061317012 +2968 2.25613113599996 0.0101170017888865 0.061086382 +2969 2.25689128799996 0.0100706543562346 0.060856561 +2970 2.25765143999996 0.0100244813151808 0.060627547 +2971 2.25841159199996 0.00997848205386508 0.060399336 +2972 2.25917174399996 0.00993265596250387 0.060171926 +2973 2.25993189599996 0.0098870024333829 0.059945315 +2974 2.26069204799996 0.00984152086085035 0.059719498 +2975 2.26145219999996 0.00979621064131014 0.059494475 +2976 2.26221235199996 0.00975107117321482 0.059270241 +2977 2.26297250399996 0.00970610185705905 0.059046794 +2978 2.26373265599996 0.00966130209537258 0.058824133 +2979 2.26449280799996 0.00961667129271363 0.058602253 +2980 2.26525295999996 0.00957220885566204 0.058381153 +2981 2.26601311199996 0.0095279141928126 0.058160829 +2982 2.26677326399996 0.00948378671476829 0.057941279 +2983 2.26753341599996 0.00943982583413365 0.057722501 +2984 2.26829356799996 0.00939603096550804 0.057504492 +2985 2.26905371999996 0.00935240152547918 0.057287248 +2986 2.26981387199996 0.00930893693261624 0.057070769 +2987 2.27057402399996 0.00926563660746348 0.05685505 +2988 2.27133417599996 0.00922249997253368 0.05664009 +2989 2.27209432799996 0.00917952645230137 0.056425885 +2990 2.27285447999996 0.00913671547319651 0.056212434 +2991 2.27361463199996 0.0090940664635979 0.055999734 +2992 2.27437478399996 0.00905157885382672 0.055787782 +2993 2.27513493599996 0.00900925207613993 0.055576575 +2994 2.27589508799996 0.00896708556472401 0.055366111 +2995 2.27665523999996 0.00892507875568846 0.055156388 +2996 2.27741539199996 0.00888323108705937 0.054947403 +2997 2.27817554399996 0.00884154199877302 0.054739154 +2998 2.27893569599996 0.00880001093266958 0.054531637 +2999 2.27969584799996 0.00875863733248674 0.054324851 +3000 2.28045599999996 0.00871742064385346 0.054118793 +3001 2.28121615199996 0.00867636031428336 0.053913461 +3002 2.28197630399996 0.00863545579316892 0.053708852 +3003 2.28273645599996 0.0085947065317749 0.053504963 +3004 2.28349660799996 0.0085541119832321 0.053301793 +3005 2.28425675999996 0.00851367160253136 0.053099338 +3006 2.28501691199996 0.00847338484651708 0.052897597 +3007 2.28577706399996 0.00843325117388126 0.052696567 +3008 2.28653721599996 0.00839327004515724 0.052496245 +3009 2.28729736799996 0.00835344092271363 0.052296629 +3010 2.28805751999996 0.00831376327074806 0.052097717 +3011 2.28881767199996 0.00827423655528129 0.051899506 +3012 2.28957782399995 0.00823486024415093 0.051701994 +3013 2.29033797599995 0.00819563380700546 0.051505178 +3014 2.29109812799995 0.00815655671529831 0.051309057 +3015 2.29185827999995 0.00811762844228164 0.051113627 +3016 2.29261843199995 0.00807884846300044 0.050918887 +3017 2.29337858399995 0.00804021625428658 0.050724834 +3018 2.29413873599995 0.00800173129475284 0.050531466 +3019 2.29489888799995 0.0079633930647869 0.05033878 +3020 2.29565903999995 0.00792520104654549 0.050146774 +3021 2.29641919199995 0.00788715472394852 0.049955446 +3022 2.29717934399995 0.00784925358267307 0.049764793 +3023 2.29793949599995 0.00781149711014771 0.049574813 +3024 2.29869964799995 0.0077738847955465 0.049385505 +3025 2.29945979999995 0.0077364161297832 0.049196865 +3026 2.30021995199995 0.00769909060550554 0.049008891 +3027 2.30098010399995 0.00766190771708941 0.048821581 +3028 2.30174025599995 0.00762486696063301 0.048634933 +3029 2.30250040799995 0.00758796783395123 0.048448944 +3030 2.30326055999995 0.00755120983656981 0.048263613 +3031 2.30402071199995 0.00751459246971972 0.048078937 +3032 2.30478086399995 0.00747811523633142 0.047894914 +3033 2.30554101599995 0.00744177764102915 0.047711541 +3034 2.30630116799995 0.00740557919012543 0.047528816 +3035 2.30706131999995 0.00736951939161518 0.047346738 +3036 2.30782147199995 0.0073335977551704 0.047165303 +3037 2.30858162399995 0.00729781379213432 0.046984511 +3038 2.30934177599995 0.00726216701551598 0.046804358 +3039 2.31010192799995 0.00722665693998451 0.046624842 +3040 2.31086207999995 0.00719128308186387 0.046445961 +3041 2.31162223199995 0.00715604495912689 0.046267714 +3042 2.31238238399995 0.00712094209139028 0.046090097 +3043 2.31314253599995 0.00708597399990869 0.045913109 +3044 2.31390268799995 0.00705114020756954 0.045736748 +3045 2.31466283999995 0.0070164402388874 0.045561011 +3046 2.31542299199995 0.00698187361999865 0.045385897 +3047 2.31618314399995 0.00694743987865597 0.045211402 +3048 2.31694329599995 0.00691313854422314 0.045037526 +3049 2.31770344799995 0.00687896914766933 0.044864266 +3050 2.31846359999995 0.00684493122156406 0.044691619 +3051 2.31922375199995 0.00681102430007171 0.044519585 +3052 2.31998390399995 0.00677724791894615 0.04434816 +3053 2.32074405599995 0.00674360161552553 0.044177342 +3054 2.32150420799995 0.00671008492872697 0.04400713 +3055 2.32226435999995 0.00667669739904117 0.043837522 +3056 2.32302451199995 0.00664343856852732 0.043668515 +3057 2.32378466399995 0.00661030798080774 0.043500108 +3058 2.32454481599995 0.0065773051810627 0.043332297 +3059 2.32530496799995 0.00654442971602523 0.043165082 +3060 2.32606511999994 0.0065116811339759 0.04299846 +3061 2.32682527199994 0.00647905898473767 0.04283243 +3062 2.32758542399994 0.00644656281967072 0.042666988 +3063 2.32834557599994 0.00641419219166728 0.042502134 +3064 2.32910572799994 0.00638194665514666 0.042337865 +3065 2.32986587999994 0.00634982576604986 0.042174179 +3066 2.33062603199994 0.00631782908183482 0.042011074 +3067 2.33138618399994 0.00628595616147106 0.041848549 +3068 2.33214633599994 0.00625420656543486 0.041686601 +3069 2.33290648799994 0.006222579855704 0.041525228 +3070 2.33366663999994 0.00619107559575298 0.041364428 +3071 2.33442679199994 0.0061596933505478 0.041204199 +3072 2.33518694399994 0.00612843268654107 0.04104454 +3073 2.33594709599994 0.00609729317166703 0.040885449 +3074 2.33670724799994 0.00606627437533667 0.040726923 +3075 2.33746739999994 0.00603537586843261 0.04056896 +3076 2.33822755199994 0.00600459722330433 0.040411559 +3077 2.33898770399994 0.00597393801376325 0.040254718 +3078 2.33974785599994 0.00594339781507779 0.040098434 +3079 2.34050800799994 0.00591297620396846 0.039942707 +3080 2.34126815999994 0.00588267275860316 0.039787533 +3081 2.34202831199994 0.00585248705859217 0.039632911 +3082 2.34278846399994 0.00582241868498338 0.03947884 +3083 2.34354861599994 0.0057924672202575 0.039325317 +3084 2.34430876799994 0.0057626322483233 0.03917234 +3085 2.34506891999994 0.00573291335451276 0.039019908 +3086 2.34582907199994 0.0057033101255763 0.038868019 +3087 2.34658922399994 0.00567382214967813 0.038716671 +3088 2.34734937599994 0.00564444901639144 0.038565861 +3089 2.34810952799994 0.00561519031669367 0.038415589 +3090 2.34886967999994 0.00558604564296185 0.038265852 +3091 2.34962983199994 0.00555701458896794 0.038116648 +3092 2.35038998399994 0.00552809674987412 0.037967977 +3093 2.35115013599994 0.00549929172222812 0.037819835 +3094 2.35191028799994 0.00547059910395861 0.037672221 +3095 2.35267043999994 0.00544201849437061 0.037525133 +3096 2.35343059199994 0.00541354949414083 0.03737857 +3097 2.35419074399994 0.00538519170531308 0.037232529 +3098 2.35495089599994 0.00535694473129367 0.037087009 +3099 2.35571104799994 0.00532880817684697 0.036942008 +3100 2.35647119999994 0.00530078164809067 0.036797525 +3101 2.35723135199994 0.00527286475249147 0.036653557 +3102 2.35799150399994 0.00524505709886037 0.036510103 +3103 2.35875165599994 0.00521735829734823 0.03636716 +3104 2.35951180799994 0.00518976795944136 0.036224728 +3105 2.36027195999994 0.00516228569795696 0.036082805 +3106 2.36103211199994 0.00513491112703865 0.035941388 +3107 2.36179226399994 0.00510764386215208 0.035800476 +3108 2.36255241599993 0.0050804835200805 0.035660067 +3109 2.36331256799993 0.0050534297189203 0.03552016 +3110 2.36407271999993 0.00502648207807668 0.035380753 +3111 2.36483287199993 0.00499964021825918 0.035241844 +3112 2.36559302399993 0.00497290376147736 0.035103431 +3113 2.36635317599993 0.00494627233103646 0.034965513 +3114 2.36711332799993 0.00491974555153303 0.034828088 +3115 2.36787347999993 0.00489332304885057 0.034691155 +3116 2.36863363199993 0.00486700445015533 0.034554711 +3117 2.36939378399993 0.00484078938389182 0.034418755 +3118 2.37015393599993 0.00481467747977876 0.034283285 +3119 2.37091408799993 0.00478866836880462 0.0341483 +3120 2.37167423999993 0.00476276168322343 0.034013797 +3121 2.37243439199993 0.00473695705655061 0.033879776 +3122 2.37319454399993 0.00471125412355857 0.033746235 +3123 2.37395469599993 0.00468565252027269 0.033613172 +3124 2.37471484799993 0.00466015188396693 0.033480585 +3125 2.37547499999993 0.00463475185315985 0.033348473 +3126 2.37623515199993 0.00460945206761024 0.033216834 +3127 2.37699530399993 0.00458425216831307 0.033085666 +3128 2.37775545599993 0.00455915179749536 0.032954968 +3129 2.37851560799993 0.00453415059861199 0.032824738 +3130 2.37927575999993 0.00450924821634154 0.032694975 +3131 2.38003591199993 0.00448444429658233 0.032565678 +3132 2.38079606399993 0.00445973848644822 0.032436843 +3133 2.38155621599993 0.00443513043426455 0.03230847 +3134 2.38231636799993 0.00441061978956408 0.032180558 +3135 2.38307651999993 0.00438620620308298 0.032053104 +3136 2.38383667199993 0.00436188932675669 0.031926108 +3137 2.38459682399993 0.00433766881371605 0.031799567 +3138 2.38535697599993 0.00431354431828311 0.03167348 +3139 2.38611712799993 0.00428951549596731 0.031547845 +3140 2.38687727999993 0.00426558200346135 0.031422661 +3141 2.38763743199993 0.00424174349863731 0.031297927 +3142 2.38839758399993 0.00421799964054265 0.03117364 +3143 2.38915773599993 0.0041943500893963 0.031049799 +3144 2.38991788799993 0.00417079450658466 0.030926403 +3145 2.39067803999993 0.00414733255465777 0.030803451 +3146 2.39143819199993 0.00412396389732535 0.03068094 +3147 2.39219834399993 0.00410068819945289 0.030558869 +3148 2.39295849599993 0.00407750512705784 0.030437236 +3149 2.39371864799993 0.00405441434730568 0.030316041 +3150 2.39447879999993 0.0040314155285061 0.030195281 +3151 2.39523895199993 0.00400850834010909 0.030074956 +3152 2.39599910399993 0.00398569245270125 0.029955063 +3153 2.39675925599993 0.00396296753800184 0.029835601 +3154 2.39751940799993 0.00394033326885902 0.029716569 +3155 2.39827955999993 0.00391778931924607 0.029597965 +3156 2.39903971199992 0.00389533536425762 0.029479788 +3157 2.39979986399992 0.00387297108010587 0.029362036 +3158 2.40056001599992 0.00385069614411683 0.029244707 +3159 2.40132016799992 0.00382851023472656 0.029127801 +3160 2.40208031999992 0.0038064130314775 0.029011316 +3161 2.40284047199992 0.00378440421501471 0.02889525 +3162 2.40360062399992 0.00376248346708219 0.028779602 +3163 2.40436077599992 0.00374065047051911 0.028664371 +3164 2.40512092799992 0.00371890490925625 0.028549555 +3165 2.40588107999992 0.00369724646831227 0.028435152 +3166 2.40664123199992 0.00367567483379006 0.028321162 +3167 2.40740138399992 0.00365418969287306 0.028207582 +3168 2.40816153599992 0.00363279073382172 0.028094412 +3169 2.40892168799992 0.00361147764596977 0.02798165 +3170 2.40968183999992 0.00359025011972075 0.027869294 +3171 2.41044199199992 0.00356910784654418 0.027757344 +3172 2.41120214399992 0.0035480505189723 0.027645797 +3173 2.41196229599992 0.00352707783059623 0.027534653 +3174 2.41272244799992 0.00350618947606252 0.02742391 +3175 2.41348259999992 0.00348538515106964 0.027313566 +3176 2.41424275199992 0.00346466455236431 0.027203621 +3177 2.41500290399992 0.0034440273777381 0.027094072 +3178 2.41576305599992 0.00342347332602392 0.026984919 +3179 2.41652320799992 0.00340300209709239 0.02687616 +3180 2.41728335999992 0.00338261339184847 0.026767794 +3181 2.41804351199992 0.00336230691222795 0.02665982 +3182 2.41880366399992 0.00334208236119399 0.026552235 +3183 2.41956381599992 0.00332193944273364 0.02644504 +3184 2.42032396799992 0.00330187786185439 0.026338231 +3185 2.42108411999992 0.0032818973245808 0.026231809 +3186 2.42184427199992 0.003261997537951 0.026125771 +3187 2.42260442399992 0.00324217821001332 0.026020117 +3188 2.42336457599992 0.00322243904982292 0.025914845 +3189 2.42412472799992 0.00320277976743834 0.025809954 +3190 2.42488487999992 0.00318320007391815 0.025705442 +3191 2.42564503199992 0.00316369968131759 0.025601308 +3192 2.42640518399992 0.00314427830268527 0.025497551 +3193 2.42716533599992 0.00312493565205972 0.02539417 +3194 2.42792548799992 0.0031056714444661 0.025291163 +3195 2.42868563999992 0.00308648539591293 0.025188529 +3196 2.42944579199992 0.00306737722338873 0.025086266 +3197 2.43020594399992 0.00304834664485873 0.024984374 +3198 2.43096609599992 0.00302939337926159 0.024882851 +3199 2.43172624799992 0.00301051714650612 0.024781696 +3200 2.43248639999992 0.00299171766746799 0.024680908 +3201 2.43324655199992 0.00297299466398656 0.024580484 +3202 2.43400670399992 0.00295434785886151 0.024480425 +3203 2.43476685599992 0.00293577697584968 0.024380729 +3204 2.43552700799991 0.00291728173966188 0.024281394 +3205 2.43628715999991 0.00289886187595959 0.024182419 +3206 2.43704731199991 0.00288051711135184 0.024083803 +3207 2.43780746399991 0.00286224717339194 0.023985546 +3208 2.43856761599991 0.00284405179057441 0.023887644 +3209 2.43932776799991 0.00282593069233167 0.023790098 +3210 2.44008791999991 0.00280788360903102 0.023692906 +3211 2.44084807199991 0.00278991027197136 0.023596067 +3212 2.44160822399991 0.00277201041338017 0.02349958 +3213 2.44236837599991 0.00275418376641032 0.023403443 +3214 2.44312852799991 0.00273643006513694 0.023307655 +3215 2.44388867999991 0.00271874904455434 0.023212216 +3216 2.44464883199991 0.00270114044057296 0.023117123 +3217 2.44540898399991 0.00268360399001613 0.023022376 +3218 2.44616913599991 0.0026661394306172 0.022927973 +3219 2.44692928799991 0.00264874650101628 0.022833913 +3220 2.44768943999991 0.00263142494075734 0.022740196 +3221 2.44844959199991 0.00261417449028505 0.022646819 +3222 2.44920974399991 0.00259699489094183 0.022553782 +3223 2.44996989599991 0.00257988588496476 0.022461084 +3224 2.45073004799991 0.00256284721548258 0.022368723 +3225 2.45149019999991 0.00254587862651274 0.022276698 +3226 2.45225035199991 0.0025289798629583 0.022185008 +3227 2.45301050399991 0.00251215067060504 0.022093652 +3228 2.45377065599991 0.00249539079611842 0.022002628 +3229 2.45453080799991 0.00247869998704067 0.021911936 +3230 2.45529095999991 0.00246207799178776 0.021821575 +3231 2.45605111199991 0.00244552455964657 0.021731543 +3232 2.45681126399991 0.00242903944077181 0.021641838 +3233 2.45757141599991 0.0024126223861832 0.021552461 +3234 2.45833156799991 0.00239627314776252 0.02146341 +3235 2.45909171999991 0.00237999147825065 0.021374683 +3236 2.45985187199991 0.00236377713124478 0.02128628 +3237 2.46061202399991 0.00234762986119545 0.0211982 +3238 2.46137217599991 0.00233154942340366 0.021110441 +3239 2.46213232799991 0.00231553557401805 0.021023002 +3240 2.46289247999991 0.00229958807003201 0.020935882 +3241 2.46365263199991 0.00228370666928083 0.02084908 +3242 2.46441278399991 0.00226789113043888 0.020762595 +3243 2.46517293599991 0.00225214121301674 0.020676426 +3244 2.46593308799991 0.00223645667735842 0.020590572 +3245 2.46669323999991 0.00222083728463854 0.020505031 +3246 2.46745339199991 0.00220528279685947 0.020419803 +3247 2.46821354399991 0.00218979297684864 0.020334886 +3248 2.46897369599991 0.00217436758825569 0.02025028 +3249 2.46973384799991 0.00215900639554965 0.020165983 +3250 2.47049399999991 0.0021437091640163 0.020081994 +3251 2.47125415199991 0.00212847565975529 0.019998312 +3252 2.4720143039999 0.00211330564967745 0.019914937 +3253 2.4727744559999 0.00209819890150207 0.019831866 +3254 2.4735346079999 0.00208315518375411 0.0197491 +3255 2.4742947599999 0.00206817426576154 0.019666636 +3256 2.4750549119999 0.00205325591765258 0.019584475 +3257 2.4758150639999 0.00203839991035307 0.019502614 +3258 2.4765752159999 0.00202360601558365 0.019421053 +3259 2.4773353679999 0.00200887400585722 0.019339791 +3260 2.4780955199999 0.00199420365447617 0.019258826 +3261 2.4788556719999 0.00197959473552972 0.019178158 +3262 2.4796158239999 0.00196504702389132 0.019097786 +3263 2.4803759759999 0.00195056029521595 0.019017708 +3264 2.4811361279999 0.00193613432593748 0.018937924 +3265 2.4818962799999 0.00192176889326607 0.018858433 +3266 2.4826564319999 0.00190746377518551 0.018779233 +3267 2.4834165839999 0.00189321875045066 0.018700323 +3268 2.4841767359999 0.00187903359858476 0.018621704 +3269 2.4849368879999 0.00186490809987693 0.018543372 +3270 2.4856970399999 0.0018508420353795 0.018465329 +3271 2.4864571919999 0.0018368351869055 0.018387571 +3272 2.4872173439999 0.00182288733702602 0.0183101 +3273 2.4879774959999 0.00180899826906771 0.018232913 +3274 2.4887376479999 0.00179516776711019 0.018156009 +3275 2.4894977999999 0.00178139561598351 0.018079388 +3276 2.4902579519999 0.00176768160126563 0.018003049 +3277 2.4910181039999 0.00175402550927985 0.01792699 +3278 2.4917782559999 0.00174042712709236 0.017851211 +3279 2.4925384079999 0.00172688624250965 0.01777571 +3280 2.4932985599999 0.00171340264407608 0.017700487 +3281 2.4940587119999 0.0016999761210713 0.017625541 +3282 2.4948188639999 0.00168660646350787 0.017550871 +3283 2.4955790159999 0.00167329346212869 0.017476475 +3284 2.4963391679999 0.00166003690840455 0.017402353 +3285 2.4970993199999 0.00164683659453173 0.017328505 +3286 2.4978594719999 0.00163369231342946 0.017254928 +3287 2.4986196239999 0.00162060385873751 0.017181622 +3288 2.4993797759999 0.00160757102481379 0.017108586 +3289 2.5001399279999 0.00159459360673185 0.01703582 +3290 2.5009000799999 0.00158167140027853 0.016963321 +3291 2.5016602319999 0.0015688042019515 0.01689109 +3292 2.5024203839999 0.00155599180895681 0.016819125 +3293 2.5031805359999 0.00154323401920665 0.016747425 +3294 2.5039406879999 0.00153053063131679 0.01667599 +3295 2.5047008399999 0.00151788144460428 0.016604819 +3296 2.5054609919999 0.0015052862590851 0.01653391 +3297 2.5062211439999 0.00149274487547172 0.016463263 +3298 2.5069812959999 0.00148025709517079 0.016392876 +3299 2.5077414479999 0.00146782272028082 0.01632275 +3300 2.50850159999989 0.00145544155358974 0.016252882 +3301 2.50926175199989 0.00144311339857268 0.016183273 +3302 2.51002190399989 0.00143083805938955 0.01611392 +3303 2.51078205599989 0.00141861534088281 0.016044824 +3304 2.51154220799989 0.00140644504857508 0.015975984 +3305 2.51230235999989 0.00139432698866687 0.015907398 +3306 2.51306251199989 0.00138226096803428 0.015839065 +3307 2.51382266399989 0.00137024679422675 0.015770986 +3308 2.51458281599989 0.00135828427546467 0.015703158 +3309 2.51534296799989 0.00134637322063726 0.015635581 +3310 2.51610311999989 0.00133451343930019 0.015568254 +3311 2.51686327199989 0.00132270474167337 0.015501177 +3312 2.51762342399989 0.00131094693863868 0.015434347 +3313 2.51838357599989 0.00129923984173773 0.015367766 +3314 2.51914372799989 0.00128758326316967 0.01530143 +3315 2.51990387999989 0.00127597701578891 0.015235341 +3316 2.52066403199989 0.00126442091310285 0.015169497 +3317 2.52142418399989 0.00125291476926982 0.015103896 +3318 2.52218433599989 0.00124145839909674 0.015038539 +3319 2.52294448799989 0.00123005161803699 0.014973424 +3320 2.52370463999989 0.00121869424218818 0.014908551 +3321 2.52446479199989 0.00120738608828997 0.014843918 +3322 2.52522494399989 0.00119612697372195 0.014779526 +3323 2.52598509599989 0.00118491671650139 0.014715372 +3324 2.52674524799989 0.00117375513528113 0.014651456 +3325 2.52750539999989 0.00116264204934742 0.014587778 +3326 2.52826555199989 0.00115157727861776 0.014524336 +3327 2.52902570399989 0.00114056064363874 0.01446113 +3328 2.52978585599989 0.00112959196558399 0.014398158 +3329 2.53054600799989 0.00111867106625191 0.014335421 +3330 2.53130615999989 0.00110779776806372 0.014272917 +3331 2.53206631199989 0.00109697189406123 0.014210645 +3332 2.53282646399989 0.00108619326790476 0.014148605 +3333 2.53358661599989 0.00107546171387106 0.014086795 +3334 2.53434676799989 0.00106477705685121 0.014025216 +3335 2.53510691999989 0.00105413912234854 0.013963865 +3336 2.53586707199989 0.00104354773647657 0.013902743 +3337 2.53662722399989 0.00103300272595688 0.013841849 +3338 2.53738737599989 0.00102250391811712 0.013781181 +3339 2.53814752799989 0.00101205114088891 0.01372074 +3340 2.53890767999989 0.00100164422280581 0.013660523 +3341 2.53966783199989 0.000991282993001247 0.013600531 +3342 2.54042798399989 0.00098096728120653 0.013540762 +3343 2.54118813599989 0.000970696917748788 0.013481217 +3344 2.54194828799989 0.000960471733548925 0.013421893 +3345 2.54270843999989 0.00095029156011967 0.013362791 +3346 2.54346859199989 0.000940156229563518 0.013303909 +3347 2.54422874399989 0.000930065574570717 0.013245246 +3348 2.54498889599988 0.00092001942841735 0.013186803 +3349 2.54574904799988 0.000910017624963226 0.013128578 +3350 2.54650919999988 0.000900059998650021 0.01307057 +3351 2.54726935199988 0.000890146384499225 0.013012779 +3352 2.54802950399988 0.000880276618110181 0.012955204 +3353 2.54878965599988 0.000870450535658167 0.012897844 +3354 2.54954980799988 0.000860667973892382 0.012840699 +3355 2.55030995999988 0.000850928770134042 0.012783767 +3356 2.55107011199988 0.000841232762274411 0.012727048 +3357 2.55183026399988 0.000831579788772884 0.012670541 +3358 2.55259041599988 0.000821969688655032 0.012614245 +3359 2.55335056799988 0.000812402301510702 0.01255816 +3360 2.55411071999988 0.000802877467492105 0.012502285 +3361 2.55487087199988 0.00079339502731186 0.012446619 +3362 2.55563102399988 0.00078395482224116 0.012391162 +3363 2.55639117599988 0.000774556694107809 0.012335912 +3364 2.55715132799988 0.000765200485294371 0.01228087 +3365 2.55791147999988 0.000755886038736273 0.012226033 +3366 2.55867163199988 0.000746613197919901 0.012171402 +3367 2.55943178399988 0.000737381806880799 0.012116976 +3368 2.56019193599988 0.000728191710201709 0.012062754 +3369 2.56095208799988 0.00071904275301078 0.012008736 +3370 2.56171223999988 0.000709934780979693 0.01195492 +3371 2.56247239199988 0.000700867640321803 0.011901306 +3372 2.56323254399988 0.000691841177790331 0.011847893 +3373 2.56399269599988 0.000682855240676444 0.011794681 +3374 2.56475284799988 0.000673909676807546 0.011741669 +3375 2.56551299999988 0.000665004334545373 0.011688856 +3376 2.56627315199988 0.000656139062784196 0.011636241 +3377 2.56703330399988 0.000647313710949008 0.011583824 +3378 2.56779345599988 0.000638528128993741 0.011531604 +3379 2.56855360799988 0.000629782167399422 0.01147958 +3380 2.56931375999988 0.000621075677172425 0.011427752 +3381 2.57007391199988 0.00061240850984267 0.011376119 +3382 2.57083406399988 0.000603780517461812 0.011324681 +3383 2.57159421599988 0.000595191552601525 0.011273436 +3384 2.57235436799988 0.000586641468351674 0.011222383 +3385 2.57311451999988 0.000578130118318594 0.011171523 +3386 2.57387467199988 0.00056965735662331 0.011120855 +3387 2.57463482399988 0.000561223037899798 0.011070378 +3388 2.57539497599988 0.000552827017293217 0.01102009 +3389 2.57615512799988 0.000544469150458201 0.010969993 +3390 2.57691527999988 0.000536149293557111 0.010920084 +3391 2.57767543199988 0.000527867303258293 0.010870363 +3392 2.57843558399988 0.000519623036734392 0.01082083 +3393 2.57919573599988 0.000511416351660573 0.010771484 +3394 2.57995588799988 0.000503247106212891 0.010722324 +3395 2.58071603999988 0.000495115159066521 0.01067335 +3396 2.58147619199987 0.00048702036939409 0.010624561 +3397 2.58223634399987 0.000478962596863969 0.010575956 +3398 2.58299649599987 0.000470941701638585 0.010527534 +3399 2.58375664799987 0.000462957544372758 0.010479296 +3400 2.58451679999987 0.000455009986212002 0.01043124 +3401 2.58527695199987 0.000447098888790874 0.010383365 +3402 2.58603710399987 0.000439224114231274 0.010335672 +3403 2.58679725599987 0.000431385525140832 0.010288159 +3404 2.58755740799987 0.000423582984611211 0.010240826 +3405 2.58831755999987 0.00041581635621648 0.010193672 +3406 2.58907771199987 0.00040808550401148 0.010146697 +3407 2.58983786399987 0.000400390292530156 0.010099899 +3408 2.59059801599987 0.000392730586783947 0.010053279 +3409 2.59135816799987 0.000385106252260154 0.010006835 +3410 2.59211831999987 0.000377517154920314 0.0099605678 +3411 2.59287847199987 0.000369963161198589 0.0099144756 +3412 2.59363862399987 0.000362444138000159 0.0098685582 +3413 2.59439877599987 0.000354959952699608 0.009822815 +3414 2.59515892799987 0.000347510473139316 0.0097772453 +3415 2.59591907999987 0.000340095567627891 0.0097318485 +3416 2.59667923199987 0.000332715104938554 0.0096866241 +3417 2.59743938399987 0.000325368954307569 0.0096415714 +3418 2.59819953599987 0.000318056985432669 0.0095966898 +3419 2.59895968799987 0.000310779068471447 0.0095519787 +3420 2.59971983999987 0.000303535074039848 0.0095074375 +3421 2.60047999199987 0.000296324873210557 0.0094630656 +3422 2.60124014399987 0.000289148337511446 0.0094188625 +3423 2.60200029599987 0.000282005338924049 0.0093748274 +3424 2.60276044799987 0.000274895749881994 0.0093309599 +3425 2.60352059999987 0.000267819443269461 0.0092872593 +3426 2.60428075199987 0.000260776292419657 0.009243725 +3427 2.60504090399987 0.00025376617111327 0.0092003565 +3428 2.60580105599987 0.000246788953576944 0.0091571532 +3429 2.60656120799987 0.000239844514481773 0.0091141144 +3430 2.60732135999987 0.000232932728941773 0.0090712397 +3431 2.60808151199987 0.000226053472512363 0.0090285283 +3432 2.60884166399987 0.000219206621188864 0.0089859798 +3433 2.60960181599987 0.000212392051405013 0.0089435936 +3434 2.61036196799987 0.000205609640031443 0.0089013691 +3435 2.61112211999987 0.00019885926437422 0.0088593057 +3436 2.61188227199987 0.000192140802173318 0.0088174028 +3437 2.61264242399987 0.000185454131601181 0.0087756599 +3438 2.61340257599987 0.00017879913126119 0.0087340765 +3439 2.61416272799987 0.000172175680186265 0.0086926519 +3440 2.61492287999987 0.000165583657837344 0.0086513856 +3441 2.61568303199987 0.000159022944101935 0.008610277 +3442 2.61644318399987 0.000152493419292655 0.0085693256 +3443 2.61720333599987 0.000145994964145814 0.0085285308 +3444 2.61796348799987 0.000139527459819906 0.0084878921 +3445 2.61872363999986 0.000133090787894224 0.0084474088 +3446 2.61948379199986 0.00012668483036738 0.0084070806 +3447 2.62024394399986 0.000120309469655895 0.0083669067 +3448 2.62100409599986 0.00011396458859278 0.0083268867 +3449 2.62176424799986 0.000107650070426092 0.0082870201 +3450 2.62252439999986 0.000101365798817519 0.0082473062 +3451 2.62328455199986 0.00009511165784098021 0.0082077445 +3452 2.62404470399986 0.00008888753198121271 0.0081683346 +3453 2.62480485599986 0.0000826933061323595 0.0081290758 +3454 2.62556500799986 0.00007652886559657511 0.0080899676 +3455 2.62632515999986 0.0000703940960826155 0.0080510095 +3456 2.62708531199986 0.00006428888370449721 0.0080122009 +3457 2.62784546399986 0.00005821311498004901 0.0079735414 +3458 2.62860561599986 0.000052166676829579106 0.0079350304 +3459 2.62936576799986 0.000046149456574465804 0.0078966673 +3460 2.63012591999986 0.000040161341935818605 0.0078584517 +3461 2.63088607199986 0.000034202221033089905 0.007820383 +3462 2.63164622399986 0.0000282719823827002 0.0077824607 +3463 2.63240637599986 0.000022370514896721503 0.0077446843 +3464 2.63316652799986 0.0000164977078814825 0.0077070532 +3465 2.63392667999986 0.000010653451036252 0.007669567 +3466 2.63468683199986 4.8376344518727105e-6 0.0076322252 +3467 2.63544698399986 -9.498513905653419e-7 0.0075950271 +3468 2.63620713599986 -6.709115621071889e-6 0.0075579723 +3469 2.63696728799986 -0.000012440266982064303 0.0075210604 +3470 2.63772743999986 -0.000018143413829729103 0.0074842907 +3471 2.63848759199986 -0.0000238186641353007 0.0074476629 +3472 2.63924774399986 -0.000029466125486422603 0.0074111763 +3473 2.64000789599986 -0.0000350859050884224 0.0073748305 +3474 2.64076804799986 -0.00004067810976564721 0.007338625 +3475 2.64152819999986 -0.000046242845962743604 0.0073025592 +3476 2.64228835199986 -0.00005178021974597401 0.0072666328 +3477 2.64304850399986 -0.00005729033680451981 0.0072308451 +3478 2.64380865599986 -0.00006277330245175581 0.0071951957 +3479 2.64456880799986 -0.0000682292216265222 0.0071596841 +3480 2.64532895999986 -0.00007365819889445721 0.0071243099 +3481 2.64608911199986 -0.00007906033844921541 0.0070890725 +3482 2.64684926399986 -0.00008443574411379172 0.0070539714 +3483 2.64760941599986 -0.00008978451934175091 0.0070190061 +3484 2.64836956799986 -0.0000951067672185198 0.0069841763 +3485 2.64912971999986 -0.000100402590462642 0.0069494813 +3486 2.64988987199986 -0.000105672091427028 0.0069149207 +3487 2.65065002399986 -0.000110915372100205 0.0068804941 +3488 2.65141017599986 -0.000116132534107582 0.0068462009 +3489 2.65217032799986 -0.000121323678712675 0.0068120407 +3490 2.65293047999986 -0.000126488906818353 0.006778013 +3491 2.65369063199986 -0.000131628318968081 0.0067441173 +3492 2.65445078399986 -0.000136742015347155 0.0067103532 +3493 2.65521093599985 -0.000141830095783892 0.0066767202 +3494 2.65597108799985 -0.000146892659750917 0.0066432178 +3495 2.65673123999985 -0.000151929806366321 0.0066098456 +3496 2.65749139199985 -0.000156941634394912 0.006576603 +3497 2.65825154399985 -0.000161928242249415 0.0065434897 +3498 2.65901169599985 -0.000166889727991675 0.0065105052 +3499 2.65977184799985 -0.000171826189333882 0.006477649 +3500 2.66053199999985 -0.000176737723639727 0.0064449206 +3501 2.66129215199985 -0.000181624427925644 0.0064123197 +3502 2.66205230399985 -0.000186486398861968 0.0063798456 +3503 2.66281245599985 -0.000191323732774135 0.0063474981 +3504 2.66357260799985 -0.000196136525643872 0.0063152766 +3505 2.66433275999985 -0.000200924873110347 0.0062831808 +3506 2.66509291199985 -0.000205688870471388 0.00625121 +3507 2.66585306399985 -0.000210428612684616 0.006219364 +3508 2.66661321599985 -0.000215144194368621 0.0061876422 +3509 2.66737336799985 -0.000219835709804137 0.0061560442 +3510 2.66813351999985 -0.000224503252935197 0.0061245695 +3511 2.66889367199985 -0.000229146917370286 0.0060932178 +3512 2.66965382399985 -0.000233766796383483 0.0060619886 +3513 2.67041397599985 -0.000238362982915628 0.0060308815 +3514 2.67117412799985 -0.000242935569575445 0.0059998959 +3515 2.67193427999985 -0.000247484648640697 0.0059690315 +3516 2.67269443199985 -0.000252010312059318 0.0059382879 +3517 2.67345458399985 -0.000256512651450538 0.0059076646 +3518 2.67421473599985 -0.000260991758106025 0.0058771611 +3519 2.67497488799985 -0.000265447722991003 0.0058467771 +3520 2.67573503999985 -0.00026988063674537 0.0058165122 +3521 2.67649519199985 -0.000274290589684811 0.0057863658 +3522 2.67725534399985 -0.000278677671801921 0.0057563376 +3523 2.67801549599985 -0.000283041972767319 0.0057264272 +3524 2.67877564799985 -0.000287383581930734 0.0056966341 +3525 2.67953579999985 -0.000291702588322129 0.0056669579 +3526 2.68029595199985 -0.00029599908065278 0.0056373982 +3527 2.68105610399985 -0.000300273147316388 0.0056079546 +3528 2.68181625599985 -0.000304524876390162 0.0055786266 +3529 2.68257640799985 -0.000308754355635901 0.0055494139 +3530 2.68333655999985 -0.000312961672501089 0.005520316 +3531 2.68409671199985 -0.000317146914119966 0.0054913325 +3532 2.68485686399985 -0.00032131016731461 0.0054624631 +3533 2.68561701599985 -0.000325451518596003 0.0054337072 +3534 2.68637716799985 -0.000329571054165108 0.0054050646 +3535 2.68713731999985 -0.000333668859913943 0.0053765347 +3536 2.68789747199985 -0.000337745021426615 0.0053481173 +3537 2.68865762399985 -0.000341799623980398 0.0053198118 +3538 2.68941777599985 -0.000345832752546794 0.0052916179 +3539 2.69017792799985 -0.000349844491792573 0.0052635351 +3540 2.69093807999985 -0.000353834926080812 0.0052355632 +3541 2.69169823199984 -0.000357804139471965 0.0052077016 +3542 2.69245838399984 -0.000361752215724879 0.0051799501 +3543 2.69321853599984 -0.000365679238297851 0.0051523081 +3544 2.69397868799984 -0.000369585290349646 0.0051247753 +3545 2.69473883999984 -0.000373470454740541 0.0050973514 +3546 2.69549899199984 -0.000377334814033331 0.0050700358 +3547 2.69625914399984 -0.00038117845049438 0.0050428283 +3548 2.69701929599984 -0.000385001446094625 0.0050157284 +3549 2.69777944799984 -0.000388803882510582 0.0049887358 +3550 2.69853959999984 -0.000392585841125388 0.0049618501 +3551 2.69929975199984 -0.000396347403029792 0.0049350708 +3552 2.70005990399984 -0.000400088649023152 0.0049083977 +3553 2.70082005599984 -0.000403809659614462 0.0048818302 +3554 2.70158020799984 -0.000407510515023338 0.0048553681 +3555 2.70234035999984 -0.000411191295181002 0.004829011 +3556 2.70310051199984 -0.000414852079731306 0.0048027584 +3557 2.70386066399984 -0.000418492948031694 0.0047766101 +3558 2.70462081599984 -0.000422113979154202 0.0047505656 +3559 2.70538096799984 -0.000425715251886436 0.0047246245 +3560 2.70614111999984 -0.00042929684473255 0.0046987866 +3561 2.70690127199984 -0.000432858835914224 0.0046730513 +3562 2.70766142399984 -0.000436401303371643 0.0046474184 +3563 2.70842157599984 -0.000439924324764452 0.0046218875 +3564 2.70918172799984 -0.000443427977472744 0.0045964582 +3565 2.70994187999984 -0.000446912338597998 0.0045711302 +3566 2.71070203199984 -0.000450377484964058 0.004545903 +3567 2.71146218399984 -0.000453823493118084 0.0045207763 +3568 2.71222233599984 -0.000457250439331507 0.0044957499 +3569 2.71298248799984 -0.000460658399600971 0.0044708231 +3570 2.71374263999984 -0.000464047449649284 0.0044459959 +3571 2.71450279199984 -0.000467417664926372 0.0044212677 +3572 2.71526294399984 -0.000470769120610206 0.0043966382 +3573 2.71602309599984 -0.000474101891607748 0.0043721071 +3574 2.71678324799984 -0.000477416052555873 0.004347674 +3575 2.71754339999984 -0.000480711677822333 0.0043233386 +3576 2.71830355199984 -0.000483988841506634 0.0042991005 +3577 2.71906370399984 -0.000487247617441008 0.0042749593 +3578 2.71982385599984 -0.000490488079191304 0.0042509147 +3579 2.72058400799984 -0.000493710300057919 0.0042269664 +3580 2.72134415999984 -0.000496914353076724 0.004203114 +3581 2.72210431199984 -0.000500100311019949 0.0041793571 +3582 2.72286446399984 -0.000503268246397117 0.0041556955 +3583 2.72362461599984 -0.000506418231455945 0.0041321287 +3584 2.72438476799984 -0.000509550338183243 0.0041086565 +3585 2.72514491999984 -0.00051266463830581 0.0040852784 +3586 2.72590507199984 -0.000515761203291336 0.0040619942 +3587 2.72666522399984 -0.00051884010434931 0.0040388035 +3588 2.72742537599984 -0.000521901412431887 0.004015706 +3589 2.72818552799983 -0.000524945198234791 0.0039927013 +3590 2.72894567999983 -0.000527971532198192 0.0039697891 +3591 2.72970583199983 -0.0005309804845076 0.0039469691 +3592 2.73046598399983 -0.000533972125094736 0.0039242409 +3593 2.73122613599983 -0.000536946523638406 0.0039016042 +3594 2.73198628799983 -0.000539903749565385 0.0038790587 +3595 2.73274643999983 -0.000542843872051265 0.003856604 +3596 2.73350659199983 -0.000545766960021355 0.0038342398 +3597 2.73426674399983 -0.000548673082151519 0.0038119658 +3598 2.73502689599983 -0.000551562306869048 0.0037897817 +3599 2.73578704799983 -0.000554434702353524 0.003767687 +3600 2.73654719999983 -0.000557290336537655 0.0037456816 +3601 2.73730735199983 -0.00056012927710816 0.0037237651 +3602 2.73806750399983 -0.000562951591506586 0.0037019371 +3603 2.73882765599983 -0.000565757346930181 0.0036801974 +3604 2.73958780799983 -0.000568546610332719 0.0036585456 +3605 2.74034795999983 -0.000571319448425365 0.0036369814 +3606 2.74110811199983 -0.000574075927677477 0.0036155045 +3607 2.74186826399983 -0.000576816114317483 0.0035941145 +3608 2.74262841599983 -0.000579540074333686 0.0035728112 +3609 2.74338856799983 -0.000582247873475107 0.0035515942 +3610 2.74414871999983 -0.000584939577252299 0.0035304633 +3611 2.74490887199983 -0.000587615250938197 0.0035094181 +3612 2.74566902399983 -0.000590274959568911 0.0034884582 +3613 2.74642917599983 -0.000592918767944556 0.0034675835 +3614 2.74718932799983 -0.00059554674063008 0.0034467935 +3615 2.74794947999983 -0.000598158941956061 0.0034260881 +3616 2.74870963199983 -0.000600755436019526 0.0034054668 +3617 2.74946978399983 -0.000603336286684758 0.0033849293 +3618 2.75022993599983 -0.000605901557584098 0.0033644754 +3619 2.75099008799983 -0.000608451312118753 0.0033441048 +3620 2.75175023999983 -0.000610985613459591 0.0033238171 +3621 2.75251039199983 -0.000613504524547942 0.0033036121 +3622 2.75327054399983 -0.000616008108096382 0.0032834894 +3623 2.75403069599983 -0.000618496426589548 0.0032634488 +3624 2.75479084799983 -0.000620969542284901 0.0032434899 +3625 2.75555099999983 -0.000623427517213533 0.0032236124 +3626 2.75631115199983 -0.000625870413180931 0.0032038162 +3627 2.75707130399983 -0.000628298291767778 0.0031841008 +3628 2.75783145599983 -0.000630711214330721 0.0031644659 +3629 2.75859160799983 -0.00063310924200314 0.0031449114 +3630 2.75935175999983 -0.000635492435695941 0.0031254368 +3631 2.76011191199983 -0.000637860856098306 0.0031060419 +3632 2.76087206399983 -0.000640214563678478 0.0030867265 +3633 2.76163221599983 -0.000642553618684511 0.0030674901 +3634 2.76239236799983 -0.000644878081145049 0.0030483326 +3635 2.76315251999983 -0.000647188010870071 0.0030292536 +3636 2.76391267199983 -0.000649483467451656 0.0030102528 +3637 2.76467282399982 -0.00065176451026474 0.00299133 +3638 2.76543297599982 -0.000654031198467867 0.0029724849 +3639 2.76619312799982 -0.000656283591003934 0.0029537172 +3640 2.76695327999982 -0.000658521746600949 0.0029350267 +3641 2.76771343199982 -0.000660745723772769 0.0029164129 +3642 2.76847358399982 -0.000662955580819833 0.0028978757 +3643 2.76923373599982 -0.000665151375829927 0.0028794148 +3644 2.76999388799982 -0.000667333166678899 0.0028610299 +3645 2.77075403999982 -0.000669501011031399 0.0028427207 +3646 2.77151419199982 -0.000671654966341622 0.002824487 +3647 2.77227434399982 -0.000673795089854022 0.0028063284 +3648 2.77303449599982 -0.000675921438604057 0.0027882447 +3649 2.77379464799982 -0.0006780340694189 0.0027702356 +3650 2.77455479999982 -0.000680133038918163 0.0027523009 +3651 2.77531495199982 -0.000682218403514627 0.0027344403 +3652 2.77607510399982 -0.000684290219414946 0.0027166534 +3653 2.77683525599982 -0.000686348542620379 0.0026989402 +3654 2.77759540799982 -0.000688393428927489 0.0026813001 +3655 2.77835555999982 -0.000690424933928853 0.0026637331 +3656 2.77911571199982 -0.000692443113013786 0.0026462388 +3657 2.77987586399982 -0.00069444802136903 0.002628817 +3658 2.78063601599982 -0.000696439713979462 0.0026114674 +3659 2.78139616799982 -0.0006984182456288 0.0025941897 +3660 2.78215631999982 -0.000700383670900294 0.0025769836 +3661 2.78291647199982 -0.00070233604417743 0.002559849 +3662 2.78367662399982 -0.000704275419644613 0.0025427856 +3663 2.78443677599982 -0.000706201851287872 0.002525793 +3664 2.78519692799982 -0.000708115392895545 0.0025088711 +3665 2.78595707999982 -0.000710016098058954 0.0024920195 +3666 2.78671723199982 -0.000711904020173106 0.0024752381 +3667 2.78747738399982 -0.000713779212437362 0.0024585265 +3668 2.78823753599982 -0.00071564172785613 0.0024418845 +3669 2.78899768799982 -0.00071749161923953 0.0024253119 +3670 2.78975783999982 -0.000719328939204075 0.0024088083 +3671 2.79051799199982 -0.000721153740173349 0.0023923736 +3672 2.79127814399982 -0.000722966074378666 0.0023760075 +3673 2.79203829599982 -0.000724765993859749 0.0023597097 +3674 2.79279844799982 -0.000726553550465388 0.00234348 +3675 2.79355859999982 -0.000728328795854109 0.0023273181 +3676 2.79431875199982 -0.000730091781494842 0.0023112238 +3677 2.79507890399982 -0.000731842558667566 0.0022951969 +3678 2.79583905599982 -0.000733581178463968 0.002279237 +3679 2.79659920799982 -0.000735307691788115 0.002263344 +3680 2.79735935999982 -0.000737022149357085 0.0022475175 +3681 2.79811951199982 -0.000738724601701639 0.0022317575 +3682 2.79887966399982 -0.000740415099166847 0.0022160635 +3683 2.79963981599982 -0.00074209369191275 0.0022004354 +3684 2.80039996799982 -0.000743760429914994 0.0021848729 +3685 2.80116011999981 -0.000745415362965486 0.0021693758 +3686 2.80192027199981 -0.000747058540673022 0.0021539439 +3687 2.80268042399981 -0.000748690012463915 0.0021385768 +3688 2.80344057599981 -0.000750309827582657 0.0021232744 +3689 2.80420072799981 -0.00075191803509253 0.0021080365 +3690 2.80496087999981 -0.000753514683876246 0.0020928627 +3691 2.80572103199981 -0.000755099822636573 0.0020777529 +3692 2.80648118399981 -0.000756673499896965 0.0020627068 +3693 2.80724133599981 -0.000758235764002183 0.0020477242 +3694 2.80800148799981 -0.00075978666311892 0.0020328048 +3695 2.80876163999981 -0.000761326245236413 0.0020179484 +3696 2.80952179199981 -0.000762854558167081 0.0020031548 +3697 2.81028194399981 -0.000764371649547116 0.0019884238 +3698 2.81104209599981 -0.000765877566837121 0.0019737551 +3699 2.81180224799981 -0.000767372357322703 0.0019591485 +3700 2.81256239999981 -0.000768856068115093 0.0019446037 +3701 2.81332255199981 -0.000770328746151751 0.0019301206 +3702 2.81408270399981 -0.000771790438196974 0.0019156989 +3703 2.81484285599981 -0.000773241190842497 0.0019013384 +3704 2.81560300799981 -0.00077468105050809 0.0018870388 +3705 2.81636315999981 -0.000776110063442177 0.0018727999 +3706 2.81712331199981 -0.000777528275722405 0.0018586216 +3707 2.81788346399981 -0.000778935733256265 0.0018445035 +3708 2.81864361599981 -0.000780332481781668 0.0018304455 +3709 2.81940376799981 -0.000781718566867549 0.0018164473 +3710 2.82016391999981 -0.00078309403391445 0.0018025088 +3711 2.82092407199981 -0.000784458928155102 0.0017886296 +3712 2.82168422399981 -0.000785813294655025 0.0017748096 +3713 2.82244437599981 -0.000787157178313112 0.0017610486 +3714 2.82320452799981 -0.000788490623862179 0.0017473463 +3715 2.82396467999981 -0.000789813675869589 0.0017337025 +3716 2.82472483199981 -0.000791126378737797 0.0017201171 +3717 2.82548498399981 -0.000792428776704945 0.0017065897 +3718 2.82624513599981 -0.000793720913845421 0.0016931202 +3719 2.82700528799981 -0.000795002834070444 0.0016797083 +3720 2.82776543999981 -0.000796274581128623 0.0016663539 +3721 2.82852559199981 -0.000797536198606537 0.0016530568 +3722 2.82928574399981 -0.000798787729929283 0.0016398166 +3723 2.83004589599981 -0.00080002921836106 0.0016266333 +3724 2.83080604799981 -0.000801260707005715 0.0016135065 +3725 2.83156619999981 -0.00080248223880732 0.0016004362 +3726 2.83232635199981 -0.000803693856550705 0.001587422 +3727 2.83308650399981 -0.000804895602862043 0.0015744638 +3728 2.83384665599981 -0.000806087520209387 0.0015615614 +3729 2.83460680799981 -0.000807269650903231 0.0015487145 +3730 2.83536695999981 -0.000808442037097047 0.001535923 +3731 2.83612711199981 -0.000809604720787856 0.0015231866 +3732 2.83688726399981 -0.000810757743816751 0.0015105052 +3733 2.8376474159998 -0.000811901147869465 0.0014978785 +3734 2.8384075679998 -0.000813034974476897 0.0014853063 +3735 2.8391677199998 -0.000814159265015663 0.0014727885 +3736 2.8399278719998 -0.000815274060708627 0.0014603248 +3737 2.8406880239998 -0.000816379402625454 0.001447915 +3738 2.8414481759998 -0.00081747533168313 0.001435559 +3739 2.8422083279998 -0.000818561888646501 0.0014232564 +3740 2.8429684799998 -0.000819639114128811 0.0014110072 +3741 2.8437286319998 -0.000820707048592229 0.0013988112 +3742 2.8444887839998 -0.000821765732348376 0.001386668 +3743 2.8452489359998 -0.00082281520555885 0.0013745776 +3744 2.8460090879998 -0.000823855508235761 0.0013625398 +3745 2.8467692399998 -0.000824886680242245 0.0013505543 +3746 2.8475293919998 -0.000825908761292984 0.0013386209 +3747 2.8482895439998 -0.000826921790954739 0.0013267395 +3748 2.8490496959998 -0.000827925808646851 0.0013149098 +3749 2.8498098479998 -0.000828920853641768 0.0013031318 +3750 2.8505699999998 -0.000829906965065566 0.001291405 +3751 2.8513301519998 -0.000830884181898437 0.0012797295 +3752 2.8520903039998 -0.000831852542975231 0.001268105 +3753 2.8528504559998 -0.000832812086985941 0.0012565313 +3754 2.8536106079998 -0.000833762852476223 0.0012450081 +3755 2.8543707599998 -0.000834704877847903 0.0012335355 +3756 2.8551309119998 -0.000835638201359464 0.001222113 +3757 2.8558910639998 -0.000836562861126579 0.0012107406 +3758 2.8566512159998 -0.000837478895122583 0.001199418 +3759 2.8574113679998 -0.000838386341178987 0.0011881452 +3760 2.8581715199998 -0.000839285236985967 0.0011769218 +3761 2.8589316719998 -0.000840175620092868 0.0011657477 +3762 2.8596918239998 -0.000841057527908694 0.0011546228 +3763 2.8604519759998 -0.000841930997702604 0.0011435467 +3764 2.8612121279998 -0.000842796066604387 0.0011325195 +3765 2.8619722799998 -0.000843652771604975 0.0011215408 +3766 2.8627324319998 -0.000844501149556914 0.0011106105 +3767 2.8634925839998 -0.000845341237174851 0.0010997284 +3768 2.8642527359998 -0.000846173071036024 0.0010888943 +3769 2.8650128879998 -0.000846996687580739 0.0010781081 +3770 2.8657730399998 -0.000847812123112852 0.0010673696 +3771 2.8665331919998 -0.000848619413800255 0.0010566785 +3772 2.8672933439998 -0.000849418595675337 0.0010460348 +3773 2.8680534959998 -0.000850209704635477 0.0010354382 +3774 2.8688136479998 -0.000850992776443505 0.0010248885 +3775 2.8695737999998 -0.000851767846728189 0.0010143856 +3776 2.8703339519998 -0.000852534950984688 0.0010039294 +3777 2.8710941039998 -0.000853294124575036 0.00099351955 +3778 2.8718542559998 -0.000854045402728604 0.00098315598 +3779 2.8726144079998 -0.000854788820542566 0.00097283849 +3780 2.8733745599998 -0.000855524412982363 0.00096256692 +3781 2.87413471199979 -0.000856252214882167 0.00095234109 +3782 2.87489486399979 -0.000856972260945344 0.00094216082 +3783 2.87565501599979 -0.000857684585744912 0.00093202595 +3784 2.87641516799979 -0.000858389223723998 0.0009219363 +3785 2.87717531999979 -0.000859086209196297 0.00091189172 +3786 2.87793547199979 -0.000859775576346528 0.00090189201 +3787 2.87869562399979 -0.000860457359230881 0.00089193703 +3788 2.87945577599979 -0.000861131591777476 0.00088202659 +3789 2.88021592799979 -0.000861798307786815 0.00087216054 +3790 2.88097607999979 -0.000862457540932226 0.0008623387 +3791 2.88173623199979 -0.000863109324760305 0.00085256091 +3792 2.88249638399979 -0.000863753692691378 0.000842827 +3793 2.88325653599979 -0.000864390678019927 0.00083313681 +3794 2.88401668799979 -0.000865020313915052 0.00082349017 +3795 2.88477683999979 -0.000865642633420895 0.00081388692 +3796 2.88553699199979 -0.000866257669457089 0.0008043269 +3797 2.88629714399979 -0.000866865454819192 0.00079480993 +3798 2.88705729599979 -0.000867466022179133 0.00078533587 +3799 2.88781744799979 -0.000868059404085632 0.00077590455 +3800 2.88857759999979 -0.000868645632964652 0.0007665158 +3801 2.88933775199979 -0.000869224741119814 0.00075716947 +3802 2.89009790399979 -0.000869796760732838 0.00074786539 +3803 2.89085805599979 -0.000870361723863973 0.00073860341 +3804 2.89161820799979 -0.000870919662452419 0.00072938337 +3805 2.89237835999979 -0.000871470608316762 0.00072020511 +3806 2.89313851199979 -0.000872014593155386 0.00071106846 +3807 2.89389866399979 -0.000872551648546913 0.00070197329 +3808 2.89465881599979 -0.000873081805950612 0.00069291942 +3809 2.89541896799979 -0.000873605096706823 0.0006839067 +3810 2.89617911999979 -0.000874121552037383 0.00067493497 +3811 2.89693927199979 -0.000874631203046035 0.00066600409 +3812 2.89769942399979 -0.00087513408071885 0.00065711389 +3813 2.89845957599979 -0.00087563021592464 0.00064826423 +3814 2.89921972799979 -0.000876119639415372 0.00063945494 +3815 2.89997987999979 -0.000876602381826581 0.00063068588 +3816 2.90074003199979 -0.000877078473677774 0.00062195689 +3817 2.90150018399979 -0.000877547945372852 0.00061326782 +3818 2.90226033599979 -0.000878010827200512 0.00060461852 +3819 2.90302048799979 -0.000878467149334647 0.00059600885 +3820 2.90378063999979 -0.000878916941834763 0.00058743864 +3821 2.90454079199979 -0.00087936023464637 0.00057890775 +3822 2.90530094399979 -0.000879797057601401 0.00057041603 +3823 2.90606109599979 -0.000880227440418593 0.00056196333 +3824 2.90682124799979 -0.000880651412703908 0.00055354951 +3825 2.90758139999979 -0.000881069003950911 0.00054517441 +3826 2.90834155199979 -0.000881480243541182 0.00053683789 +3827 2.90910170399979 -0.000881885160744705 0.0005285398 +3828 2.90986185599979 -0.000882283784720264 0.00052028 +3829 2.91062200799978 -0.000882676144515836 0.00051205834 +3830 2.91138215999978 -0.000883062269068978 0.00050387468 +3831 2.91214231199978 -0.000883442187207227 0.00049572887 +3832 2.91290246399978 -0.000883815927648478 0.00048762076 +3833 2.91366261599978 -0.000884183519001383 0.00047955022 +3834 2.91442276799978 -0.000884544989765726 0.0004715171 +3835 2.91518291999978 -0.000884900368332813 0.00046352126 +3836 2.91594307199978 -0.00088524968298586 0.00045556255 +3837 2.91670322399978 -0.000885592961900367 0.00044764084 +3838 2.91746337599978 -0.000885930233144504 0.00043975598 +3839 2.91822352799978 -0.000886261524679492 0.00043190784 +3840 2.91898367999978 -0.000886586864359978 0.00042409627 +3841 2.91974383199978 -0.00088690627993441 0.00041632113 +3842 2.92050398399978 -0.000887219799045422 0.00040858229 +3843 2.92126413599978 -0.000887527449230198 0.00040087961 +3844 2.92202428799978 -0.000887829257920853 0.00039321295 +3845 2.92278443999978 -0.0008881252524448 0.00038558216 +3846 2.92354459199978 -0.000888415460025124 0.00037798712 +3847 2.92430474399978 -0.00088869990778095 0.00037042769 +3848 2.92506489599978 -0.00088897862272781 0.00036290373 +3849 2.92582504799978 -0.000889251631778013 0.00035541511 +3850 2.92658519999978 -0.000889518961741009 0.00034796169 +3851 2.92734535199978 -0.000889780639323754 0.00034054333 +3852 2.92810550399978 -0.00089003669113107 0.00033315991 +3853 2.92886565599978 -0.000890287143666012 0.00032581128 +3854 2.92962580799978 -0.000890532023330226 0.00031849733 +3855 2.93038595999978 -0.000890771356424305 0.0003112179 +3856 2.93114611199978 -0.000891005169148158 0.00030397287 +3857 2.93190626399978 -0.000891233487601355 0.00029676212 +3858 2.93266641599978 -0.000891456337783488 0.0002895855 +3859 2.93342656799978 -0.000891673745594528 0.00028244289 +3860 2.93418671999978 -0.000891885736835172 0.00027533415 +3861 2.93494687199978 -0.000892092337207204 0.00026825916 +3862 2.93570702399978 -0.000892293572313835 0.00026121779 +3863 2.93646717599978 -0.000892489467660063 0.00025420991 +3864 2.93722732799978 -0.000892680048653016 0.00024723538 +3865 2.93798747999978 -0.000892865340602299 0.00024029409 +3866 2.93874763199978 -0.000893045368720344 0.0002333859 +3867 2.93950778399978 -0.000893220158122749 0.00022651069 +3868 2.94026793599978 -0.000893389733828631 0.00021966833 +3869 2.94102808799978 -0.000893554120760958 0.00021285869 +3870 2.94178823999978 -0.000893713343746898 0.00020608165 +3871 2.94254839199978 -0.000893867427518157 0.00019933708 +3872 2.94330854399978 -0.000894016396711314 0.00019262486 +3873 2.94406869599978 -0.000894160275868171 0.00018594487 +3874 2.94482884799978 -0.000894299089436073 0.00017929697 +3875 2.94558899999978 -0.000894432861768258 0.00017268105 +3876 2.94634915199978 -0.000894561617124183 0.00016609698 +3877 2.94710930399977 -0.000894685379669864 0.00015954464 +3878 2.94786945599977 -0.000894804173478196 0.00015302391 +3879 2.94862960799977 -0.000894918022529302 0.00014653466 +3880 2.94938975999977 -0.000895026950710848 0.00014007678 +3881 2.95014991199977 -0.000895130981818381 0.00013365014 +3882 2.95091006399977 -0.000895230139555646 0.00012725463 +3883 2.95167021599977 -0.000895324447534927 0.00012089011 +3884 2.95243036799977 -0.00089541392927736 0.00011455648 +3885 2.95319051999977 -0.000895498608213265 0.00010825362 +3886 2.95395067199977 -0.000895578507682464 0.00010198139 +3887 2.95471082399977 -0.000895653650934607 9.5739699e-05 +3888 2.95547097599977 -0.000895724061129494 8.9528412e-05 +3889 2.95623112799977 -0.000895789761337383 8.3347416e-05 +3890 2.95699127999977 -0.000895850774539331 7.7196594e-05 +3891 2.95775143199977 -0.000895907123627489 7.1075828e-05 +3892 2.95851158399977 -0.000895958831405434 6.4985004e-05 +3893 2.95927173599977 -0.000896005920588476 5.8924004e-05 +3894 2.96003188799977 -0.000896048413803977 5.2892713e-05 +3895 2.96079203999977 -0.000896086333591661 4.6891017e-05 +3896 2.96155219199977 -0.000896119702403932 4.0918799e-05 +3897 2.96231234399977 -0.000896148542606176 3.4975948e-05 +3898 2.96307249599977 -0.000896172876477081 2.9062347e-05 +3899 2.96383264799977 -0.000896192726208939 2.3177885e-05 +3900 2.96459279999977 -0.000896208113907958 1.7322447e-05 +3901 2.96535295199977 -0.000896219061594568 1.1495922e-05 +3902 2.96611310399977 -0.000896225591203724 5.6981963e-06 +3903 2.96687325599977 -0.000896227724585216 -7.0840934e-08 +3904 2.96763340799977 -0.000896225483503969 -5.8113015e-06 +3905 2.96839355999977 -0.000896218889640347 -1.1523296e-05 +3906 2.96915371199977 -0.000896207964590458 -1.7206936e-05 +3907 2.96991386399977 -0.000896192729866444 -2.2862331e-05 +3908 2.97067401599977 -0.000896173206896793 -2.8489591e-05 +3909 2.97143416799977 -0.000896149417026635 -3.4088826e-05 +3910 2.97219431999977 -0.000896121381518033 -3.9660145e-05 +3911 2.97295447199977 -0.000896089121550288 -4.5203655e-05 +3912 2.97371462399977 -0.000896052658220225 -5.0719466e-05 +3913 2.97447477599977 -0.000896012012542497 -5.6207686e-05 +3914 2.97523492799977 -0.000895967205449876 -6.1668422e-05 +3915 2.97599507999977 -0.000895918257793541 -6.7101781e-05 +3916 2.97675523199977 -0.000895865190343374 -7.250787e-05 +3917 2.97751538399977 -0.000895808023788251 -7.7886796e-05 +3918 2.97827553599977 -0.000895746778736325 -8.3238663e-05 +3919 2.97903568799977 -0.000895681475715326 -8.8563579e-05 +3920 2.97979583999977 -0.000895612135172836 -9.3861648e-05 +3921 2.98055599199977 -0.000895538777476585 -9.9132975e-05 +3922 2.98131614399977 -0.000895461422914734 -0.00010437766 +3923 2.98207629599977 -0.000895380091696154 -0.00010959582 +3924 2.98283644799977 -0.000895294803950719 -0.00011478755 +3925 2.98359659999976 -0.00089520557972958 -0.00011995295 +3926 2.98435675199976 -0.000895112439005455 -0.00012509212 +3927 2.98511690399976 -0.000895015401672902 -0.00013020518 +3928 2.98587705599976 -0.000894914487548603 -0.00013529222 +3929 2.98663720799976 -0.000894809716371644 -0.00014035334 +3930 2.98739735999976 -0.000894701107803786 -0.00014538865 +3931 2.98815751199976 -0.000894588681429752 -0.00015039824 +3932 2.98891766399976 -0.000894472456757492 -0.00015538222 +3933 2.98967781599976 -0.000894352453218469 -0.00016034069 +3934 2.99043796799976 -0.000894228690167922 -0.00016527374 +3935 2.99119811999976 -0.000894101186885151 -0.00017018149 +3936 2.99195827199976 -0.000893969962573775 -0.00017506402 +3937 2.99271842399976 -0.000893835036362015 -0.00017992143 +3938 2.99347857599976 -0.000893696427302963 -0.00018475383 +3939 2.99423872799976 -0.000893554154374844 -0.00018956131 +3940 2.99499887999976 -0.000893408236481289 -0.00019434398 +3941 2.99575903199976 -0.000893258692451607 -0.00019910192 +3942 2.99651918399976 -0.000893105541041039 -0.00020383523 +3943 2.99727933599976 -0.000892948800931039 -0.00020854402 +3944 2.99803948799976 -0.00089278849072953 -0.00021322838 +3945 2.99879963999976 -0.000892624628971165 -0.0002178884 +3946 2.99955979199976 -0.0008924572341176 -0.00022252419 +3947 3.00031994399976 -0.000892286324557744 -0.00022713583 +3948 3.00108009599976 -0.000892111918608032 -0.00023172342 +3949 3.00184024799976 -0.000891934034512673 -0.00023628706 +3950 3.00260039999976 -0.000891752690443923 -0.00024082684 +3951 3.00336055199976 -0.000891567904502333 -0.00024534286 +3952 3.00412070399976 -0.000891379694717006 -0.0002498352 +3953 3.00488085599976 -0.000891188079045862 -0.00025430397 +3954 3.00564100799976 -0.000890993075375889 -0.00025874925 +3955 3.00640115999976 -0.000890794701523397 -0.00026317114 +3956 3.00716131199976 -0.00089059297523427 -0.00026756974 +3957 3.00792146399976 -0.000890387914184229 -0.00027194512 +3958 3.00868161599976 -0.000890179535979069 -0.00027629739 +3959 3.00944176799976 -0.000889967858154927 -0.00028062664 +3960 3.01020191999976 -0.000889752898178518 -0.00028493295 +3961 3.01096207199976 -0.000889534673447395 -0.00028921643 +3962 3.01172222399976 -0.000889313201290189 -0.00029347715 +3963 3.01248237599976 -0.00088908849896687 -0.00029771521 +3964 3.01324252799976 -0.000888860583668975 -0.0003019307 +3965 3.01400267999976 -0.000888629472519874 -0.00030612371 +3966 3.01476283199976 -0.000888395182575002 -0.00031029432 +3967 3.01552298399976 -0.00088815773082211 -0.00031444263 +3968 3.01628313599976 -0.000887917134181503 -0.00031856873 +3969 3.01704328799976 -0.000887673409506291 -0.0003226727 +3970 3.01780343999976 -0.000887426573582625 -0.00032675463 +3971 3.01856359199976 -0.000887176643129938 -0.00033081461 +3972 3.01932374399976 -0.000886923634801189 -0.00033485273 +3973 3.02008389599975 -0.0008866675651831 -0.00033886907 +3974 3.02084404799975 -0.000886408450796394 -0.00034286372 +3975 3.02160419999975 -0.000886146308096035 -0.00034683677 +3976 3.02236435199975 -0.000885881153471467 -0.0003507883 +3977 3.02312450399975 -0.000885613003246843 -0.00035471839 +3978 3.02388465599975 -0.000885341873681267 -0.00035862714 +3979 3.02464480799975 -0.000885067780969026 -0.00036251463 +3980 3.02540495999975 -0.000884790741239825 -0.00036638094 +3981 3.02616511199975 -0.000884510770559018 -0.00037022616 +3982 3.02692526399975 -0.000884227884927842 -0.00037405037 +3983 3.02768541599975 -0.000883942100283649 -0.00037785366 +3984 3.02844556799975 -0.000883653432500134 -0.0003816361 +3985 3.02920571999975 -0.000883361897387565 -0.00038539779 +3986 3.02996587199975 -0.000883067510693017 -0.00038913881 +3987 3.03072602399975 -0.000882770288100592 -0.00039285923 +3988 3.03148617599975 -0.000882470245231654 -0.00039655915 +3989 3.03224632799975 -0.00088216739764505 -0.00040023863 +3990 3.03300647999975 -0.000881861760837343 -0.00040389777 +3991 3.03376663199975 -0.000881553350243027 -0.00040753665 +3992 3.03452678399975 -0.000881242181234758 -0.00041115535 +3993 3.03528693599975 -0.000880928269123578 -0.00041475394 +3994 3.03604708799975 -0.000880611629159133 -0.00041833251 +3995 3.03680723999975 -0.000880292276529904 -0.00042189115 +3996 3.03756739199975 -0.000879970226363413 -0.00042542992 +3997 3.03832754399975 -0.00087964549372646 -0.00042894891 +3998 3.03908769599975 -0.000879318093625332 -0.00043244819 +3999 3.03984784799975 -0.000878988041006026 -0.00043592786 +4000 3.04060799999975 -0.000878655350754466 -0.00043938798 +4001 3.04136815199975 -0.000878320037696721 -0.00044282864 +4002 3.04212830399975 -0.000877982116599223 -0.00044624991 +4003 3.04288845599975 -0.000877641602168978 -0.00044965188 +4004 3.04364860799975 -0.000877298509053785 -0.00045303461 +4005 3.04440875999975 -0.000876952851842454 -0.00045639819 +4006 3.04516891199975 -0.000876604645065011 -0.00045974269 +4007 3.04592906399975 -0.000876253903192916 -0.00046306819 +4008 3.04668921599975 -0.00087590064063928 -0.00046637477 +4009 3.04744936799975 -0.000875544871759064 -0.00046966251 +4010 3.04820951999975 -0.000875186610849301 -0.00047293147 +4011 3.04896967199975 -0.000874825872149301 -0.00047618174 +4012 3.04972982399975 -0.000874462669840863 -0.00047941339 +4013 3.05048997599975 -0.000874097018048479 -0.0004826265 +4014 3.05125012799975 -0.000873728930839545 -0.00048582114 +4015 3.05201027999975 -0.000873358422224571 -0.00048899739 +4016 3.05277043199975 -0.00087298550615738 -0.00049215531 +4017 3.05353058399975 -0.000872610196535322 -0.00049529499 +4018 3.05429073599975 -0.00087223250719947 -0.0004984165 +4019 3.05505088799975 -0.000871852451934834 -0.00050151991 +4020 3.05581103999975 -0.000871470044470556 -0.0005046053 +4021 3.05657119199974 -0.000871085298480119 -0.00050767273 +4022 3.05733134399974 -0.000870698227581547 -0.00051072229 +4023 3.05809149599974 -0.000870308845337601 -0.00051375404 +4024 3.05885164799974 -0.000869917165255992 -0.00051676806 +4025 3.05961179999974 -0.00086952320078957 -0.00051976442 +4026 3.06037195199974 -0.000869126965336527 -0.00052274318 +4027 3.06113210399974 -0.0008687284722406 -0.00052570443 +4028 3.06189225599974 -0.000868327734791258 -0.00052864823 +4029 3.06265240799974 -0.000867924766223915 -0.00053157465 +4030 3.06341255999974 -0.000867519579720109 -0.00053448377 +4031 3.06417271199974 -0.000867112188407714 -0.00053737566 +4032 3.06493286399974 -0.000866702605361124 -0.00054025038 +4033 3.06569301599974 -0.000866290843601454 -0.000543108 +4034 3.06645316799974 -0.00086587691609673 -0.0005459486 +4035 3.06721331999974 -0.000865460835762084 -0.00054877224 +4036 3.06797347199974 -0.000865042615459949 -0.000551579 +4037 3.06873362399974 -0.000864622268000243 -0.00055436894 +4038 3.06949377599974 -0.000864199806140572 -0.00055714213 +4039 3.07025392799974 -0.000863775242586409 -0.00055989864 +4040 3.07101407999974 -0.00086334858999129 -0.00056263854 +4041 3.07177423199974 -0.000862919860957006 -0.0005653619 +4042 3.07253438399974 -0.000862489068033784 -0.00056806878 +4043 3.07329453599974 -0.00086205622372048 -0.00057075925 +4044 3.07405468799974 -0.000861621340464765 -0.00057343338 +4045 3.07481483999974 -0.00086118443066331 -0.00057609123 +4046 3.07557499199974 -0.000860745506661977 -0.00057873288 +4047 3.07633514399974 -0.000860304580756001 -0.00058135838 +4048 3.07709529599974 -0.000859861665190171 -0.00058396781 +4049 3.07785544799974 -0.000859416772159022 -0.00058656123 +4050 3.07861559999974 -0.000858969913807011 -0.00058913871 +4051 3.07937575199974 -0.000858521102228706 -0.0005917003 +4052 3.08013590399974 -0.000858070349468963 -0.00059424609 +4053 3.08089605599974 -0.000857617667523111 -0.00059677613 +4054 3.08165620799974 -0.000857163068337132 -0.00059929048 +4055 3.08241635999974 -0.000856706563807838 -0.00060178922 +4056 3.08317651199974 -0.000856248165783058 -0.0006042724 +4057 3.08393666399974 -0.000855787886061807 -0.00060674009 +4058 3.08469681599974 -0.000855325736394476 -0.00060919236 +4059 3.08545696799974 -0.000854861728483 -0.00061162926 +4060 3.08621711999974 -0.000854395873981039 -0.00061405087 +4061 3.08697727199974 -0.000853928184494156 -0.00061645724 +4062 3.08773742399974 -0.00085345867157999 -0.00061884843 +4063 3.08849757599974 -0.000852987346748432 -0.00062122452 +4064 3.08925772799974 -0.000852514221461803 -0.00062358555 +4065 3.09001787999974 -0.000852039307135023 -0.00062593161 +4066 3.09077803199974 -0.000851562615135787 -0.00062826274 +4067 3.09153818399974 -0.000851084156784739 -0.000630579 +4068 3.09229833599974 -0.000850603943355645 -0.00063288047 +4069 3.09305848799973 -0.000850121986075557 -0.0006351672 +4070 3.09381863999973 -0.000849638296124995 -0.00063743925 +4071 3.09457879199973 -0.00084915288463811 -0.00063969668 +4072 3.09533894399973 -0.000848665762702858 -0.00064193956 +4073 3.09609909599973 -0.000848176941361167 -0.00064416794 +4074 3.09685924799973 -0.000847686431609104 -0.00064638188 +4075 3.09761939999973 -0.000847194244397049 -0.00064858145 +4076 3.09837955199973 -0.000846700390629857 -0.00065076671 +4077 3.09913970399973 -0.00084620488116703 -0.00065293771 +4078 3.09989985599973 -0.000845707726822873 -0.00065509451 +4079 3.10066000799973 -0.000845208938366676 -0.00065723717 +4080 3.10142015999973 -0.000844708526522865 -0.00065936576 +4081 3.10218031199973 -0.000844206501971174 -0.00066148032 +4082 3.10294046399973 -0.000843702875346807 -0.00066358092 +4083 3.10370061599973 -0.000843197657240603 -0.00066566762 +4084 3.10446076799973 -0.000842690858199193 -0.00066774048 +4085 3.10522091999973 -0.000842182488725173 -0.00066979954 +4086 3.10598107199973 -0.000841672559277256 -0.00067184488 +4087 3.10674122399973 -0.000841161080270437 -0.00067387654 +4088 3.10750137599973 -0.000840648062076158 -0.00067589459 +4089 3.10826152799973 -0.000840133515022458 -0.00067789908 +4090 3.10902167999973 -0.000839617449394144 -0.00067989007 +4091 3.10978183199973 -0.00083909987543294 -0.00068186761 +4092 3.11054198399973 -0.000838580803337652 -0.00068383177 +4093 3.11130213599973 -0.000838060243264325 -0.00068578259 +4094 3.11206228799973 -0.000837538205326396 -0.00068772013 +4095 3.11282243999973 -0.000837014699594858 -0.00068964446 +4096 3.11358259199973 -0.000836489736098409 -0.00069155562 +4097 3.11434274399973 -0.000835963324823613 -0.00069345367 +4098 3.11510289599973 -0.000835435475715052 -0.00069533866 +4099 3.11586304799973 -0.000834906198675485 -0.00069721066 +4100 3.11662319999973 -0.000834375503565993 -0.00069906971 +4101 3.11738335199973 -0.000833843400206143 -0.00070091586 +4102 3.11814350399973 -0.000833309898374136 -0.00070274919 +4103 3.11890365599973 -0.000832775007806959 -0.00070456973 +4104 3.11966380799973 -0.000832238738200539 -0.00070637754 +4105 3.12042395999973 -0.000831701099209892 -0.00070817268 +4106 3.12118411199973 -0.000831162100449277 -0.00070995519 +4107 3.12194426399973 -0.000830621751492344 -0.00071172514 +4108 3.12270441599973 -0.000830080061872285 -0.00071348257 +4109 3.12346456799973 -0.00082953704108198 -0.00071522755 +4110 3.12422471999973 -0.000828992698574154 -0.00071696011 +4111 3.12498487199973 -0.000828447043761513 -0.00071868031 +4112 3.12574502399973 -0.000827900086016908 -0.00072038822 +4113 3.12650517599973 -0.000827351834673463 -0.00072208387 +4114 3.12726532799973 -0.00082680229902474 -0.00072376732 +4115 3.12802547999973 -0.000826251488324872 -0.00072543862 +4116 3.12878563199973 -0.000825699411788714 -0.00072709783 +4117 3.12954578399972 -0.000825146078591991 -0.00072874499 +4118 3.13030593599972 -0.000824591497871438 -0.00073038015 +4119 3.13106608799972 -0.000824035678724943 -0.00073200338 +4120 3.13182623999972 -0.000823478630211697 -0.00073361471 +4121 3.13258639199972 -0.000822920361352334 -0.0007352142 +4122 3.13334654399972 -0.00082236088112907 -0.00073680189 +4123 3.13410669599972 -0.000821800198485852 -0.00073837785 +4124 3.13486684799972 -0.000821238322328494 -0.00073994212 +4125 3.13562699999972 -0.000820675261524823 -0.00074149474 +4126 3.13638715199972 -0.000820111024904813 -0.00074303578 +4127 3.13714730399972 -0.000819545621260734 -0.00074456527 +4128 3.13790745599972 -0.000818979059347284 -0.00074608327 +4129 3.13866760799972 -0.000818411347881732 -0.00074758983 +4130 3.13942775999972 -0.000817842495544057 -0.00074908499 +4131 3.14018791199972 -0.000817272510977087 -0.00075056881 +4132 3.14094806399972 -0.000816701402786629 -0.00075204133 +4133 3.14170821599972 -0.000816129179541619 -0.0007535026 +4134 3.14246836799972 -0.00081555584977425 -0.00075495267 +4135 3.14322851999972 -0.000814981421980109 -0.00075639159 +4136 3.14398867199972 -0.000814405904618316 -0.0007578194 +4137 3.14474882399972 -0.000813829306111659 -0.00075923616 +4138 3.14550897599972 -0.000813251634846725 -0.00076064191 +4139 3.14626912799972 -0.00081267289917404 -0.0007620367 +4140 3.14702927999972 -0.000812093107408198 -0.00076342057 +4141 3.14778943199972 -0.000811512267828 -0.00076479358 +4142 3.14854958399972 -0.000810930388676579 -0.00076615576 +4143 3.14930973599972 -0.00081034747816154 -0.00076750717 +4144 3.15006988799972 -0.00080976354445509 -0.00076884785 +4145 3.15083003999972 -0.000809178595694167 -0.00077017786 +4146 3.15159019199972 -0.000808592639980577 -0.00077149722 +4147 3.15235034399972 -0.000808005685381117 -0.000772806 +4148 3.15311049599972 -0.000807417739927711 -0.00077410423 +4149 3.15387064799972 -0.000806828811617538 -0.00077539197 +4150 3.15463079999972 -0.000806238908413161 -0.00077666925 +4151 3.15539095199972 -0.000805648038242657 -0.00077793613 +4152 3.15615110399972 -0.000805056208999745 -0.00077919265 +4153 3.15691125599972 -0.000804463428543912 -0.00078043885 +4154 3.15767140799972 -0.000803869704700543 -0.00078167477 +4155 3.15843155999972 -0.00080327504526105 -0.00078290047 +4156 3.15919171199972 -0.000802679457982994 -0.00078411599 +4157 3.15995186399972 -0.000802082950590211 -0.00078532136 +4158 3.16071201599972 -0.000801485530772945 -0.00078651665 +4159 3.16147216799972 -0.000800887206187965 -0.00078770188 +4160 3.16223231999972 -0.000800287984458694 -0.0007888771 +4161 3.16299247199972 -0.000799687873175333 -0.00079004236 +4162 3.16375262399972 -0.000799086879894985 -0.0007911977 +4163 3.16451277599972 -0.000798485012141779 -0.00079234317 +4164 3.16527292799972 -0.000797882277406991 -0.0007934788 +4165 3.16603307999971 -0.000797278683149169 -0.00079460464 +4166 3.16679323199971 -0.000796674236794255 -0.00079572073 +4167 3.16755338399971 -0.000796068945735705 -0.00079682712 +4168 3.16831353599971 -0.000795462817334614 -0.00079792385 +4169 3.16907368799971 -0.000794855858919832 -0.00079901095 +4170 3.16983383999971 -0.000794248077788091 -0.00080008848 +4171 3.17059399199971 -0.000793639481204118 -0.00080115647 +4172 3.17135414399971 -0.00079303007640076 -0.00080221497 +4173 3.17211429599971 -0.000792419870579103 -0.00080326401 +4174 3.17287444799971 -0.000791808870908587 -0.00080430365 +4175 3.17363459999971 -0.000791197084527128 -0.00080533391 +4176 3.17439475199971 -0.000790584518541236 -0.00080635485 +4177 3.17515490399971 -0.00078997118002613 -0.0008073665 +4178 3.17591505599971 -0.000789357076025857 -0.0008083689 +4179 3.17667520799971 -0.000788742213553412 -0.0008093621 +4180 3.17743535999971 -0.000788126599590847 -0.00081034613 +4181 3.17819551199971 -0.000787510241089393 -0.00081132104 +4182 3.17895566399971 -0.000786893144969575 -0.00081228686 +4183 3.17971581599971 -0.000786275318121324 -0.00081324364 +4184 3.18047596799971 -0.000785656767404093 -0.00081419142 +4185 3.18123611999971 -0.000785037499646977 -0.00081513023 +4186 3.18199627199971 -0.000784417521648815 -0.00081606012 +4187 3.18275642399971 -0.000783796840178317 -0.00081698113 +4188 3.18351657599971 -0.000783175461974167 -0.00081789329 +4189 3.18427672799971 -0.000782553393745143 -0.00081879664 +4190 3.18503687999971 -0.000781930642170222 -0.00081969122 +4191 3.18579703199971 -0.000781307213898699 -0.00082057708 +4192 3.18655718399971 -0.000780683115550294 -0.00082145425 +4193 3.18731733599971 -0.000780058353715267 -0.00082232277 +4194 3.18807748799971 -0.000779432934954523 -0.00082318268 +4195 3.18883763999971 -0.00077880686579973 -0.00082403401 +4196 3.18959779199971 -0.000778180152753422 -0.00082487681 +4197 3.19035794399971 -0.000777552802289114 -0.00082571111 +4198 3.19111809599971 -0.000776924820851409 -0.00082653695 +4199 3.19187824799971 -0.000776296214856104 -0.00082735437 +4200 3.19263839999971 -0.000775666990690305 -0.00082816341 +4201 3.19339855199971 -0.000775037154712528 -0.0008289641 +4202 3.19415870399971 -0.000774406713252814 -0.00082975648 +4203 3.19491885599971 -0.000773775672612829 -0.00083054059 +4204 3.19567900799971 -0.000773144039065976 -0.00083131647 +4205 3.19643915999971 -0.000772511818857501 -0.00083208415 +4206 3.19719931199971 -0.000771879018204599 -0.00083284367 +4207 3.19795946399971 -0.000771245643296515 -0.00083359506 +4208 3.19871961599971 -0.000770611700294658 -0.00083433837 +4209 3.19947976799971 -0.000769977195332698 -0.00083507363 +4210 3.20023991999971 -0.00076934213451668 -0.00083580087 +4211 3.20100007199971 -0.000768706523925117 -0.00083652014 +4212 3.20176022399971 -0.000768070369609102 -0.00083723146 +4213 3.2025203759997 -0.000767433677592412 -0.00083793487 +4214 3.2032805279997 -0.000766796453871604 -0.00083863042 +4215 3.2040406799997 -0.000766158704416126 -0.00083931813 +4216 3.2048008319997 -0.000765520435168416 -0.00083999803 +4217 3.2055609839997 -0.000764881652044002 -0.00084067018 +4218 3.2063211359997 -0.000764242360931609 -0.0008413346 +4219 3.2070812879997 -0.000763602567693256 -0.00084199132 +4220 3.2078414399997 -0.000762962278164357 -0.00084264038 +4221 3.2086015919997 -0.000762321498153828 -0.00084328182 +4222 3.2093617439997 -0.000761680233444178 -0.00084391567 +4223 3.2101218959997 -0.000761038489791617 -0.00084454196 +4224 3.2108820479997 -0.00076039627292615 -0.00084516073 +4225 3.2116421999997 -0.000759753588551682 -0.00084577202 +4226 3.2124023519997 -0.000759110442346111 -0.00084637585 +4227 3.2131625039997 -0.000758466839961431 -0.00084697226 +4228 3.2139226559997 -0.000757822787023826 -0.0008475613 +4229 3.2146828079997 -0.000757178289133775 -0.00084814298 +4230 3.2154429599997 -0.000756533351866142 -0.00084871734 +4231 3.2162031119997 -0.000755887980770276 -0.00084928442 +4232 3.2169632639997 -0.00075524218137011 -0.00084984425 +4233 3.2177234159997 -0.000754595959164257 -0.00085039686 +4234 3.2184835679997 -0.000753949319626101 -0.00085094229 +4235 3.2192437199997 -0.000753302268203901 -0.00085148056 +4236 3.2200038719997 -0.00075265481032088 -0.00085201172 +4237 3.2207640239997 -0.000752006951375323 -0.0008525358 +4238 3.2215241759997 -0.000751358696740673 -0.00085305282 +4239 3.2222843279997 -0.000750710051765622 -0.00085356282 +4240 3.2230444799997 -0.000750061021774209 -0.00085406583 +4241 3.2238046319997 -0.00074941161206591 -0.00085456189 +4242 3.2245647839997 -0.000748761827915734 -0.00085505102 +4243 3.2253249359997 -0.000748111674574319 -0.00085553327 +4244 3.2260850879997 -0.000747461157268018 -0.00085600865 +4245 3.2268452399997 -0.000746810281198995 -0.00085647721 +4246 3.2276053919997 -0.00074615905154532 -0.00085693897 +4247 3.2283655439997 -0.000745507473461056 -0.00085739396 +4248 3.2291256959997 -0.000744855552076354 -0.00085784222 +4249 3.2298858479997 -0.000744203292497542 -0.00085828378 +4250 3.2306459999997 -0.000743550699807219 -0.00085871867 +4251 3.2314061519997 -0.00074289777906434 -0.00085914692 +4252 3.2321663039997 -0.000742244535304312 -0.00085956856 +4253 3.2329264559997 -0.000741590973539083 -0.00085998363 +4254 3.2336866079997 -0.000740937098757226 -0.00086039214 +4255 3.2344467599997 -0.000740282915924038 -0.00086079414 +4256 3.2352069119997 -0.000739628429981618 -0.00086118965 +4257 3.2359670639997 -0.000738973645848967 -0.00086157871 +4258 3.2367272159997 -0.000738318568422067 -0.00086196134 +4259 3.2374873679997 -0.000737663202573972 -0.00086233758 +4260 3.2382475199997 -0.000737007553154898 -0.00086270745 +4261 3.23900767199969 -0.00073635162499231 -0.00086307098 +4262 3.23976782399969 -0.000735695422891007 -0.00086342821 +4263 3.24052797599969 -0.000735038951633207 -0.00086377916 +4264 3.24128812799969 -0.00073438221597864 -0.00086412387 +4265 3.24204827999969 -0.000733725220664629 -0.00086446235 +4266 3.24280843199969 -0.000733067970406177 -0.00086479465 +4267 3.24356858399969 -0.000732410469896053 -0.00086512079 +4268 3.24432873599969 -0.000731752723804878 -0.0008654408 +4269 3.24508888799969 -0.000731094736781208 -0.00086575471 +4270 3.24584903999969 -0.00073043651345162 -0.00086606255 +4271 3.24660919199969 -0.000729778058420797 -0.00086636435 +4272 3.24736934399969 -0.000729119376271609 -0.00086666013 +4273 3.24812949599969 -0.000728460471565203 -0.00086694992 +4274 3.24888964799969 -0.000727801348841079 -0.00086723376 +4275 3.24964979999969 -0.000727142012617177 -0.00086751166 +4276 3.25040995199969 -0.000726482467389962 -0.00086778367 +4277 3.25117010399969 -0.000725822717634501 -0.0008680498 +4278 3.25193025599969 -0.00072516276780455 -0.00086831009 +4279 3.25269040799969 -0.000724502622332634 -0.00086856456 +4280 3.25345055999969 -0.000723842285630131 -0.00086881324 +4281 3.25421071199969 -0.000723181762087347 -0.00086905616 +4282 3.25497086399969 -0.000722521056073608 -0.00086929335 +4283 3.25573101599969 -0.000721860171937328 -0.00086952482 +4284 3.25649116799969 -0.0007211991140061 -0.00086975062 +4285 3.25725131999969 -0.000720537886586772 -0.00086997077 +4286 3.25801147199969 -0.000719876493965527 -0.00087018529 +4287 3.25877162399969 -0.000719214940407962 -0.00087039421 +4288 3.25953177599969 -0.000718553230159169 -0.00087059757 +4289 3.26029192799969 -0.000717891367443814 -0.00087079538 +4290 3.26105207999969 -0.000717229356466216 -0.00087098767 +4291 3.26181223199969 -0.000716567201410423 -0.00087117447 +4292 3.26257238399969 -0.000715904906440292 -0.0008713558 +4293 3.26333253599969 -0.000715242475699571 -0.0008715317 +4294 3.26409268799969 -0.00071457991331197 -0.00087170218 +4295 3.26485283999969 -0.000713917223381242 -0.00087186728 +4296 3.26561299199969 -0.000713254409991258 -0.00087202703 +4297 3.26637314399969 -0.000712591477206089 -0.00087218143 +4298 3.26713329599969 -0.000711928429070077 -0.00087233053 +4299 3.26789344799969 -0.000711265269607912 -0.00087247435 +4300 3.26865359999969 -0.000710602002824714 -0.00087261291 +4301 3.26941375199969 -0.000709938632706101 -0.00087274624 +4302 3.27017390399969 -0.000709275163218269 -0.00087287437 +4303 3.27093405599969 -0.000708611598308065 -0.00087299732 +4304 3.27169420799969 -0.000707947941903065 -0.00087311511 +4305 3.27245435999969 -0.000707284197911646 -0.00087322778 +4306 3.27321451199969 -0.000706620370223062 -0.00087333534 +4307 3.27397466399969 -0.000705956462707518 -0.00087343782 +4308 3.27473481599969 -0.000705292479216242 -0.00087353524 +4309 3.27549496799968 -0.00070462842358156 -0.00087362764 +4310 3.27625511999968 -0.000703964299616973 -0.00087371504 +4311 3.27701527199968 -0.000703300111117225 -0.00087379745 +4312 3.27777542399968 -0.000702635861858376 -0.00087387491 +4313 3.27853557599968 -0.000701971555597878 -0.00087394744 +4314 3.27929572799968 -0.000701307196074647 -0.00087401506 +4315 3.28005587999968 -0.000700642787009131 -0.0008740778 +4316 3.28081603199968 -0.000699978332103386 -0.00087413568 +4317 3.28157618399968 -0.000699313835041147 -0.00087418873 +4318 3.28233633599968 -0.000698649299487899 -0.00087423696 +4319 3.28309648799968 -0.000697984729090945 -0.00087428041 +4320 3.28385663999968 -0.000697320127479483 -0.0008743191 +4321 3.28461679199968 -0.00069665549826467 -0.00087435305 +4322 3.28537694399968 -0.000695990845039698 -0.00087438228 +4323 3.28613709599968 -0.000695326171379861 -0.00087440683 +4324 3.28689724799968 -0.000694661480842624 -0.0008744267 +4325 3.28765739999968 -0.000693996776967696 -0.00087444193 +4326 3.28841755199968 -0.000693332063277094 -0.00087445254 +4327 3.28917770399968 -0.000692667343275221 -0.00087445975 +4328 3.28993785599968 -0.000692002618618903 -0.00087448338 +4329 3.29069800799968 -0.000691337862694597 -0.00087457741 +4330 3.29145815999968 -0.000690672995090957 -0.00087477869 +4331 3.29221831199968 -0.000690007933147996 -0.0008750882 +4332 3.29297846399968 -0.000689342595004194 -0.00087550487 +4333 3.29373861599968 -0.000688676899594287 -0.00087602766 +4334 3.29449876799968 -0.000688010766646596 -0.00087665553 +4335 3.29525891999968 -0.00068734411668081 -0.00087738744 +4336 3.29601907199968 -0.000686676871004988 -0.00087822236 +4337 3.29677922399968 -0.000686008951714001 -0.00087915925 +4338 3.29753937599968 -0.000685340281686209 -0.00088019707 +4339 3.29829952799968 -0.000684670784581121 -0.00088133482 +4340 3.29905967999968 -0.000684000384837513 -0.00088257145 +4341 3.29981983199968 -0.000683329007670319 -0.00088390596 +4342 3.30057998399968 -0.000682656579068408 -0.00088533733 +4343 3.30134013599968 -0.000681983025791921 -0.00088686453 +4344 3.30210028799968 -0.000681308275370163 -0.00088848657 +4345 3.30286043999968 -0.000680632256098823 -0.00089020244 +4346 3.30362059199968 -0.00067995489703776 -0.00089201113 +4347 3.30438074399968 -0.000679276128008 -0.00089391164 +4348 3.30514089599968 -0.00067859587958996 -0.00089590298 +4349 3.30590104799968 -0.000677914083120679 -0.00089798415 +4350 3.30666119999968 -0.00067723067069092 -0.00090015416 +4351 3.30742135199968 -0.000676545575143406 -0.00090241203 +4352 3.30818150399968 -0.000675858730070034 -0.00090475677 +4353 3.30894165599968 -0.000675170069809217 -0.0009071874 +4354 3.30970180799968 -0.00067447952944355 -0.00090970294 +4355 3.31046195999968 -0.000673787044797702 -0.00091230241 +4356 3.31122211199968 -0.000673092552435306 -0.00091498486 +4357 3.31198226399967 -0.000672395989656738 -0.0009177493 +4358 3.31274241599967 -0.000671697294497009 -0.00092059479 +4359 3.31350256799967 -0.000670996405722546 -0.00092352034 +4360 3.31426271999967 -0.000670293262829524 -0.00092652501 +4361 3.31502287199967 -0.000669587806040872 -0.00092960785 +4362 3.31578302399967 -0.000668879976303827 -0.00093276789 +4363 3.31654317599967 -0.000668169715287825 -0.0009360042 +4364 3.31730332799967 -0.000667456965381397 -0.00093931582 +4365 3.31806347999967 -0.000666741669690385 -0.00094270182 +4366 3.31882363199967 -0.000666023772035063 -0.00094616126 +4367 3.31958378399967 -0.000665303216947688 -0.0009496932 +4368 3.32034393599967 -0.000664579949670174 -0.00095329671 +4369 3.32110408799967 -0.000663853916151536 -0.00095697086 +4370 3.32186423999967 -0.000663125063045222 -0.00096071473 +4371 3.32262439199967 -0.000662393337707123 -0.00096452739 +4372 3.32338454399967 -0.000661658688192568 -0.00096840793 +4373 3.32414469599967 -0.000660921063254105 -0.00097235543 +4374 3.32490484799967 -0.000660180412339173 -0.00097636898 +4375 3.32566499999967 -0.000659436685587322 -0.00098044767 +4376 3.32642515199967 -0.000658689833827997 -0.00098459059 +4377 3.32718530399967 -0.000657939808577646 -0.00098879684 +4378 3.32794545599967 -0.000657186562037837 -0.00099306552 +4379 3.32870560799967 -0.000656430047092371 -0.00099739574 +4380 3.32946575999967 -0.000655670217304949 -0.0010017866 +4381 3.33022591199967 -0.000654907026916729 -0.0010062372 +4382 3.33098606399967 -0.000654140430843553 -0.0010107467 +4383 3.33174621599967 -0.000653370384674168 -0.0010153142 +4384 3.33250636799967 -0.000652596844666786 -0.0010199387 +4385 3.33326651999967 -0.000651819767747419 -0.0010246195 +4386 3.33402667199967 -0.000651039111507101 -0.0010293557 +4387 3.33478682399967 -0.000650254834199337 -0.0010341463 +4388 3.33554697599967 -0.00064946689473766 -0.0010389906 +4389 3.33630712799967 -0.000648675252693298 -0.0010438876 +4390 3.33706727999967 -0.000647879868292622 -0.0010488365 +4391 3.33782743199967 -0.000647080702414593 -0.0010538364 +4392 3.33858758399967 -0.000646277716588317 -0.0010588865 +4393 3.33934773599967 -0.000645470872990717 -0.001063986 +4394 3.34010788799967 -0.000644660134443975 -0.0010691339 +4395 3.34086803999967 -0.000643845464412762 -0.0010743295 +4396 3.34162819199967 -0.000643026827002346 -0.0010795719 +4397 3.34238834399967 -0.000642204186955486 -0.0010848602 +4398 3.34314849599967 -0.000641377509650654 -0.0010901937 +4399 3.34390864799967 -0.000640546761098926 -0.0010955715 +4400 3.34466879999967 -0.000639711907941654 -0.0011009927 +4401 3.34542895199967 -0.000638872917448352 -0.0011064566 +4402 3.34618910399967 -0.000638029757513925 -0.0011119623 +4403 3.34694925599967 -0.000637182396656 -0.0011175091 +4404 3.34770940799967 -0.000636330804013041 -0.001123096 +4405 3.34846955999967 -0.000635474949341241 -0.0011287223 +4406 3.34922971199966 -0.000634614803012523 -0.0011343872 +4407 3.34998986399966 -0.00063375033601154 -0.0011400898 +4408 3.35075001599966 -0.000632881519934014 -0.0011458294 +4409 3.35151016799966 -0.000632008326983402 -0.0011516052 +4410 3.35227031999966 -0.000631130729969009 -0.0011574163 +4411 3.35303047199966 -0.000630248702303104 -0.0011632621 +4412 3.35379062399966 -0.000629362217998808 -0.0011691416 +4413 3.35455077599966 -0.000628471251667539 -0.0011750541 +4414 3.35531092799966 -0.000627575778516021 -0.0011809989 +4415 3.35607107999966 -0.000626675774344831 -0.0011869751 +4416 3.35683123199966 -0.000625771215544968 -0.001192982 +4417 3.35759138399966 -0.000624862079095734 -0.0011990187 +4418 3.35835153599966 -0.000623948342562408 -0.0012050846 +4419 3.35911168799966 -0.000623029984093693 -0.0012111789 +4420 3.35987183999966 -0.000622106982419046 -0.0012173008 +4421 3.36063199199966 -0.000621179316846354 -0.0012234495 +4422 3.36139214399966 -0.000620246967259486 -0.0012296243 +4423 3.36215229599966 -0.00061930991411574 -0.0012358244 +4424 3.36291244799966 -0.000618368138443626 -0.0012420491 +4425 3.36367259999966 -0.000617421621839864 -0.0012482977 +4426 3.36443275199966 -0.000616470346467501 -0.0012545693 +4427 3.36519290399966 -0.000615514295052799 -0.0012608633 +4428 3.36595305599966 -0.00061455345088357 -0.001267179 +4429 3.36671320799966 -0.000613587797805959 -0.0012735155 +4430 3.36747335999966 -0.000612617320222331 -0.0012798721 +4431 3.36823351199966 -0.000611642003088719 -0.0012862482 +4432 3.36899366399966 -0.000610661831912385 -0.001292643 +4433 3.36975381599966 -0.000609676792749481 -0.0012990558 +4434 3.37051396799966 -0.000608686872201947 -0.0013054858 +4435 3.37127411999966 -0.000607692057416065 -0.0013119324 +4436 3.37203427199966 -0.000606692336079129 -0.0013183949 +4437 3.37279442399966 -0.000605687696417223 -0.0013248725 +4438 3.37355457599966 -0.000604678127193115 -0.0013313645 +4439 3.37431472799966 -0.000603663617703032 -0.0013378702 +4440 3.37507487999966 -0.000602644157774779 -0.001344389 +4441 3.37583503199966 -0.000601619737765402 -0.0013509201 +4442 3.37659518399966 -0.000600590348557972 -0.0013574629 +4443 3.37735533599966 -0.000599555981559918 -0.0013640166 +4444 3.37811548799966 -0.000598516628699808 -0.0013705806 +4445 3.37887563999966 -0.000597472282425571 -0.0013771542 +4446 3.37963579199966 -0.000596422935701613 -0.0013837367 +4447 3.38039594399966 -0.000595368582006373 -0.0013903274 +4448 3.38115609599966 -0.000594309215330102 -0.0013969258 +4449 3.38191624799966 -0.000593244830171979 -0.001403531 +4450 3.38267639999966 -0.00059217542153811 -0.0014101425 +4451 3.38343655199966 -0.00059110098493842 -0.0014167595 +4452 3.38419670399966 -0.000590021516384986 -0.0014233815 +4453 3.38495685599966 -0.000588937012389046 -0.0014300077 +4454 3.38571700799965 -0.000587847469958325 -0.0014366375 +4455 3.38647715999965 -0.000586752886595265 -0.0014432703 +4456 3.38723731199965 -0.000585653260293806 -0.0014499055 +4457 3.38799746399965 -0.000584548589537603 -0.0014565422 +4458 3.38875761599965 -0.000583438873296926 -0.0014631801 +4459 3.38951776799965 -0.000582324111026544 -0.0014698183 +4460 3.39027791999965 -0.000581204302663285 -0.0014764563 +4461 3.39103807199965 -0.00058007944862315 -0.0014830934 +4462 3.39179822399965 -0.000578949549799535 -0.0014897291 +4463 3.39255837599965 -0.000577814607560012 -0.0014963626 +4464 3.39331852799965 -0.000576674623744555 -0.0015029934 +4465 3.39407867999965 -0.000575529600662317 -0.0015096209 +4466 3.39483883199965 -0.000574379541089964 -0.0015162444 +4467 3.39559898399965 -0.00057322444826835 -0.0015228633 +4468 3.39635913599965 -0.000572064325901067 -0.0015294771 +4469 3.39711928799965 -0.000570899178150786 -0.0015360851 +4470 3.39787943999965 -0.000569729009637809 -0.0015426867 +4471 3.39863959199965 -0.000568553825437079 -0.0015492813 +4472 3.39939974399965 -0.000567373631075729 -0.0015558684 +4473 3.40015989599965 -0.000566188432530645 -0.0015624473 +4474 3.40092004799965 -0.000564998236226244 -0.0015690174 +4475 3.40168019999965 -0.000563803049031586 -0.0015755783 +4476 3.40244035199965 -0.000562602878258378 -0.0015821292 +4477 3.40320050399965 -0.000561397731657864 -0.0015886697 +4478 3.40396065599965 -0.000560187617418939 -0.001595199 +4479 3.40472080799965 -0.000558972544165481 -0.0016017168 +4480 3.40548095999965 -0.000557752520953692 -0.0016082224 +4481 3.40624111199965 -0.000556527557269981 -0.0016147152 +4482 3.40700126399965 -0.000555297663028198 -0.0016211946 +4483 3.40776141599965 -0.000554062848567294 -0.0016276602 +4484 3.40852156799965 -0.00055282312464866 -0.0016341114 +4485 3.40928171999965 -0.00055157850245402 -0.0016405476 +4486 3.41004187199965 -0.000550328993582649 -0.0016469682 +4487 3.41080202399965 -0.000549074610048939 -0.0016533728 +4488 3.41156217599965 -0.000547815364280169 -0.0016597608 +4489 3.41232232799965 -0.000546551269113627 -0.0016661316 +4490 3.41308247999965 -0.000545282337794606 -0.0016724847 +4491 3.41384263199965 -0.000544008583973299 -0.0016788196 +4492 3.41460278399965 -0.000542730021703242 -0.0016851357 +4493 3.41536293599965 -0.000541446665437761 -0.0016914326 +4494 3.41612308799965 -0.000540158530028423 -0.0016977096 +4495 3.41688323999965 -0.00053886563072203 -0.0017039664 +4496 3.41764339199965 -0.000537567983158294 -0.0017102023 +4497 3.41840354399965 -0.000536265603367503 -0.0017164168 +4498 3.41916369599965 -0.000534958507767858 -0.0017226096 +4499 3.41992384799965 -0.000533646713163027 -0.0017287799 +4500 3.42068399999965 -0.000532330236739598 -0.0017349274 +4501 3.42144415199965 -0.00053100909606496 -0.0017410516 +4502 3.42220430399964 -0.000529683309084428 -0.0017471518 +4503 3.42296445599964 -0.000528352894119011 -0.0017532278 +4504 3.42372460799964 -0.000527017869862756 -0.0017592789 +4505 3.42448475999964 -0.000525678255380413 -0.0017653047 +4506 3.42524491199964 -0.000524334070104882 -0.0017713047 +4507 3.42600506399964 -0.000522985333834991 -0.0017772783 +4508 3.42676521599964 -0.000521632066732614 -0.0017832253 +4509 3.42752536799964 -0.000520274289320444 -0.001789145 +4510 3.42828551999964 -0.000518912022479445 -0.001795037 +4511 3.42904567199964 -0.000517545287446408 -0.0018009008 +4512 3.42980582399964 -0.000516174105811618 -0.001806736 +4513 3.43056597599964 -0.000514798499516189 -0.0018125421 +4514 3.43132612799964 -0.000513418490849404 -0.0018183186 +4515 3.43208627999964 -0.000512034102446823 -0.0018240652 +4516 3.43284643199964 -0.000510645357287398 -0.0018297813 +4517 3.43360658399964 -0.000509252278690808 -0.0018354664 +4518 3.43436673599964 -0.000507854890315573 -0.0018411203 +4519 3.43512688799964 -0.000506453216156166 -0.0018467423 +4520 3.43588703999964 -0.00050504728054046 -0.0018523322 +4521 3.43664719199964 -0.00050363710812773 -0.0018578894 +4522 3.43740734399964 -0.000502222723905765 -0.0018634135 +4523 3.43816749599964 -0.000500804153188206 -0.001868904 +4524 3.43892764799964 -0.000499381421612988 -0.0018743607 +4525 3.43968779999964 -0.00049795455513868 -0.001879783 +4526 3.44044795199964 -0.000496523580042818 -0.0018851705 +4527 3.44120810399964 -0.000495088522919351 -0.0018905228 +4528 3.44196825599964 -0.000493649410675756 -0.0018958395 +4529 3.44272840799964 -0.000492206270531037 -0.0019011202 +4530 3.44348855999964 -0.000490759130012952 -0.0019063645 +4531 3.44424871199964 -0.000489308016955459 -0.001911572 +4532 3.44500886399964 -0.000487852959496826 -0.0019167422 +4533 3.44576901599964 -0.000486393986076417 -0.0019218749 +4534 3.44652916799964 -0.000484931125432686 -0.0019269695 +4535 3.44728931999964 -0.00048346440660052 -0.0019320258 +4536 3.44804947199964 -0.000481993858908902 -0.0019370433 +4537 3.44880962399964 -0.000480519511978139 -0.0019420216 +4538 3.44956977599964 -0.000479041395717861 -0.0019469604 +4539 3.45032992799964 -0.000477559540324135 -0.0019518593 +4540 3.45109007999964 -0.000476073976277247 -0.0019567179 +4541 3.45185023199964 -0.000474584734339034 -0.0019615358 +4542 3.45261038399964 -0.000473091845550444 -0.0019663127 +4543 3.45337053599964 -0.000471595341229314 -0.0019710483 +4544 3.45413068799964 -0.000470095252967706 -0.0019757421 +4545 3.45489083999964 -0.000468591612629132 -0.0019803938 +4546 3.45565099199964 -0.000467084452346778 -0.0019850031 +4547 3.45641114399964 -0.000465573804520392 -0.0019895695 +4548 3.45717129599964 -0.000464059701814068 -0.0019940929 +4549 3.45793144799964 -0.000462542177153802 -0.0019985727 +4550 3.45869159999963 -0.000461021263725048 -0.0020030087 +4551 3.45945175199963 -0.000459496994970165 -0.0020074006 +4552 3.46021190399963 -0.000457969404585867 -0.0020117479 +4553 3.46097205599963 -0.000456438526520775 -0.0020160505 +4554 3.46173220799963 -0.000454904394973199 -0.0020203079 +4555 3.46249235999963 -0.000453367044388253 -0.0020245198 +4556 3.46325251199963 -0.000451826509455966 -0.0020286859 +4557 3.46401266399963 -0.00045028282510795 -0.0020328059 +4558 3.46477281599963 -0.00044873602651585 -0.0020368795 +4559 3.46553296799963 -0.000447186149088119 -0.0020409063 +4560 3.46629311999963 -0.000445633228468134 -0.0020448861 +4561 3.46705327199963 -0.000444077300531198 -0.0020488186 +4562 3.46781342399963 -0.00044251840138243 -0.0020527034 +4563 3.46857357599963 -0.000440956567354434 -0.0020565403 +4564 3.46933372799963 -0.000439391835004077 -0.0020603289 +4565 3.47009387999963 -0.00043782424111094 -0.002064069 +4566 3.47085403199963 -0.000436253822674204 -0.0020677603 +4567 3.47161418399963 -0.000434680616910432 -0.0020714024 +4568 3.47237433599963 -0.000433104661251127 -0.0020749952 +4569 3.47313448799963 -0.000431525993340176 -0.0020785384 +4570 3.47389463999963 -0.0004299446510313 -0.0020820316 +4571 3.47465479199963 -0.000428360672385608 -0.0020854746 +4572 3.47541494399963 -0.00042677409566938 -0.0020888671 +4573 3.47617509599963 -0.000425184959351288 -0.0020922089 +4574 3.47693524799963 -0.000423593302100178 -0.0020954997 +4575 3.47769539999963 -0.000421999162782072 -0.0020987392 +4576 3.47845555199963 -0.00042040258045839 -0.0021019272 +4577 3.47921570399963 -0.000418803594383288 -0.0021050635 +4578 3.47997585599963 -0.000417202244000547 -0.0021081477 +4579 3.48073600799963 -0.000415598568942022 -0.0021111797 +4580 3.48149615999963 -0.000413992609024749 -0.0021141592 +4581 3.48225631199963 -0.000412384404248178 -0.0021170859 +4582 3.48301646399963 -0.000410773994792279 -0.0021199597 +4583 3.48377661599963 -0.000409161421014659 -0.0021227803 +4584 3.48453676799963 -0.000407546723448227 -0.0021255474 +4585 3.48529691999963 -0.000405929942798644 -0.0021282609 +4586 3.48605707199963 -0.000404311119942102 -0.0021309204 +4587 3.48681722399963 -0.000402690295922437 -0.0021335259 +4588 3.48757737599963 -0.000401067511949016 -0.0021360771 +4589 3.48833752799963 -0.000399442809394079 -0.0021385737 +4590 3.48909767999963 -0.000397816229790293 -0.0021410156 +4591 3.48985783199963 -0.000396187814828197 -0.0021434025 +4592 3.49061798399963 -0.000394557606354207 -0.0021457343 +4593 3.49137813599963 -0.00039292564636717 -0.0021480108 +4594 3.49213828799963 -0.000391291977017039 -0.0021502316 +4595 3.49289843999963 -0.000389656640601421 -0.0021523968 +4596 3.49365859199963 -0.000388019679563811 -0.002154506 +4597 3.49441874399963 -0.000386381136490588 -0.0021565591 +4598 3.49517889599962 -0.000384741054109017 -0.0021585559 +4599 3.49593904799962 -0.000383099475284365 -0.0021604963 +4600 3.49669919999962 -0.000381456443017569 -0.0021623799 +4601 3.49745935199962 -0.000379812000443014 -0.0021642068 +4602 3.49821950399962 -0.000378166190825535 -0.0021659766 +4603 3.49897965599962 -0.000376519057558422 -0.0021676893 +4604 3.49973980799962 -0.000374870644160752 -0.0021693446 +4605 3.50049995999962 -0.000373220994274948 -0.0021709425 +4606 3.50126011199962 -0.000371570151664224 -0.0021724827 +4607 3.50202026399962 -0.000369918160210037 -0.002173965 +4608 3.50278041599962 -0.000368265063910078 -0.0021753895 +4609 3.50354056799962 -0.000366610906875176 -0.0021767558 +4610 3.50430071999962 -0.000364955733327288 -0.0021780639 +4611 3.50506087199962 -0.000363299587596622 -0.0021793136 +4612 3.50582102399962 -0.000361642514119631 -0.0021805048 +4613 3.50658117599962 -0.000359984557436133 -0.0021816373 +4614 3.50734132799962 -0.000358325762187195 -0.002182711 +4615 3.50810147999962 -0.00035666617311203 -0.0021837258 +4616 3.50886163199962 -0.00035500583504644 -0.0021846816 +4617 3.50962178399962 -0.000353344792919597 -0.0021855782 +4618 3.51038193599962 -0.00035168309175182 -0.0021864155 +4619 3.51114208799962 -0.000350020776652138 -0.0021871934 +4620 3.51190223999962 -0.000348357892815843 -0.0021879118 +4621 3.51266239199962 -0.000346694485521826 -0.0021885706 +4622 3.51342254399962 -0.000345030600130358 -0.0021891697 +4623 3.51418269599962 -0.000343366282080315 -0.0021897089 +4624 3.51494284799962 -0.000341701576886955 -0.0021901882 +4625 3.51570299999962 -0.000340036530139365 -0.0021906075 +4626 3.51646315199962 -0.000338371187498021 -0.0021909667 +4627 3.51722330399962 -0.000336705594692122 -0.0021912657 +4628 3.51798345599962 -0.000335039797517367 -0.0021915044 +4629 3.51874360799962 -0.000333373841833406 -0.0021916827 +4630 3.51950375999962 -0.000331707773561285 -0.0021918006 +4631 3.52026391199962 -0.000330041638680778 -0.0021918579 +4632 3.52102406399962 -0.000328375483228616 -0.0021918546 +4633 3.52178421599962 -0.000326709353295151 -0.0021917907 +4634 3.52254436799962 -0.000325043295022587 -0.0021916661 +4635 3.52330451999962 -0.00032337735460175 -0.0021914806 +4636 3.52406467199962 -0.000321711578270434 -0.0021912343 +4637 3.52482482399962 -0.000320046012310393 -0.0021909271 +4638 3.52558497599962 -0.000318380703045018 -0.0021905589 +4639 3.52634512799962 -0.000316715696836889 -0.0021901297 +4640 3.52710527999962 -0.000315051040085224 -0.0021896394 +4641 3.52786543199962 -0.000313386779223435 -0.0021890881 +4642 3.52862558399962 -0.000311722960716798 -0.0021884756 +4643 3.52938573599962 -0.000310059631059567 -0.0021878019 +4644 3.53014588799962 -0.000308396836772973 -0.002187067 +4645 3.53090603999962 -0.000306734624402449 -0.0021862708 +4646 3.53166619199961 -0.000305073040515413 -0.0021854134 +4647 3.53242634399961 -0.000303412131698377 -0.0021844947 +4648 3.53318649599961 -0.000301751944554729 -0.0021835146 +4649 3.53394664799961 -0.000300092525702622 -0.0021824732 +4650 3.53470679999961 -0.000298433921771646 -0.0021813705 +4651 3.53546695199961 -0.000296776179401159 -0.0021802064 +4652 3.53622710399961 -0.000295119345237183 -0.002178981 +4653 3.53698725599961 -0.00029346346593051 -0.0021776941 +4654 3.53774740799961 -0.000291808588133713 -0.0021763459 +4655 3.53850755999961 -0.000290154758499028 -0.0021749364 +4656 3.53926771199961 -0.000288502023675696 -0.0021734654 +4657 3.54002786399961 -0.000286850430307517 -0.0021719331 +4658 3.54078801599961 -0.000285200025030519 -0.0021703395 +4659 3.54154816799961 -0.000283550854469961 -0.0021686845 +4660 3.54230831999961 -0.000281902965238778 -0.0021669683 +4661 3.54306847199961 -0.000280256403934032 -0.0021651907 +4662 3.54382862399961 -0.00027861121713546 -0.0021633519 +4663 3.54458877599961 -0.000276967451402155 -0.0021614518 +4664 3.54534892799961 -0.000275325153270556 -0.0021594906 +4665 3.54610907999961 -0.000273684369251903 -0.0021574681 +4666 3.54686923199961 -0.00027204514582968 -0.0021553846 +4667 3.54762938399961 -0.000270407529457062 -0.0021532399 +4668 3.54838953599961 -0.000268771566554804 -0.0021510342 +4669 3.54914968799961 -0.000267137303508136 -0.0021487675 +4670 3.54990983999961 -0.000265504786664983 -0.0021464399 +4671 3.55066999199961 -0.000263874062332969 -0.0021440514 +4672 3.55143014399961 -0.000262245176777309 -0.002141602 +4673 3.55219029599961 -0.000260618176217808 -0.0021390919 +4674 3.55295044799961 -0.000258993106827088 -0.002136521 +4675 3.55371059999961 -0.000257370014727587 -0.0021338896 +4676 3.55447075199961 -0.00025574894598912 -0.0021311975 +4677 3.55523090399961 -0.000254129946626769 -0.002128445 +4678 3.55599105599961 -0.000252513062598103 -0.002125632 +4679 3.55675120799961 -0.000250898339800409 -0.0021227587 +4680 3.55751135999961 -0.000249285824069134 -0.0021198251 +4681 3.55827151199961 -0.000247675561174332 -0.0021168314 +4682 3.55903166399961 -0.000246067596818889 -0.0021137776 +4683 3.55979181599961 -0.000244461976635968 -0.0021106638 +4684 3.56055196799961 -0.000242858746186125 -0.0021074901 +4685 3.56131211999961 -0.00024125795095542 -0.0021042567 +4686 3.56207227199961 -0.000239659636352196 -0.0021009635 +4687 3.56283242399961 -0.000238063847705416 -0.0020976108 +4688 3.56359257599961 -0.000236470630261776 -0.0020941986 +4689 3.56435272799961 -0.000234880029183038 -0.0020907271 +4690 3.56511287999961 -0.000233292089543813 -0.0020871963 +4691 3.56587303199961 -0.000231706856329228 -0.0020836064 +4692 3.56663318399961 -0.000230124374432039 -0.0020799575 +4693 3.56739333599961 -0.000228544688650523 -0.0020762497 +4694 3.5681534879996 -0.000226967843685588 -0.0020724832 +4695 3.5689136399996 -0.000225393884138891 -0.0020686581 +4696 3.5696737919996 -0.000223822854509725 -0.0020647745 +4697 3.5704339439996 -0.000222254799193022 -0.0020608326 +4698 3.5711940959996 -0.000220689762476578 -0.0020568325 +4699 3.5719542479996 -0.00021912778853872 -0.0020527743 +4700 3.5727143999996 -0.000217568921445754 -0.0020486583 +4701 3.5734745519996 -0.000216013205149523 -0.0020444845 +4702 3.5742347039996 -0.000214460683484963 -0.0020402531 +4703 3.5749948559996 -0.000212911400167548 -0.0020359643 +4704 3.5757550079996 -0.000211365398790964 -0.0020316182 +4705 3.5765151599996 -0.000209822722824216 -0.0020272151 +4706 3.5772753119996 -0.000208283415609856 -0.002022755 +4707 3.5780354639996 -0.000206747520360651 -0.0020182381 +4708 3.5787956159996 -0.000205215080157806 -0.0020136646 +4709 3.5795557679996 -0.0002036861379483 -0.0020090348 +4710 3.5803159199996 -0.000202160736542112 -0.0020043487 +4711 3.5810760719996 -0.000200638918610108 -0.0019996066 +4712 3.5818362239996 -0.000199120726681268 -0.0019948086 +4713 3.5825963759996 -0.000197606203140577 -0.0019899549 +4714 3.5833565279996 -0.000196095390226136 -0.0019850458 +4715 3.5841166799996 -0.000194588330026946 -0.0019800814 +4716 3.5848768319996 -0.000193085064480347 -0.001975062 +4717 3.5856369839996 -0.000191585635369362 -0.0019699877 +4718 3.5863971359996 -0.000190090084320804 -0.0019648587 +4719 3.5871572879996 -0.000188598452801947 -0.0019596753 +4720 3.5879174399996 -0.000187110782118638 -0.0019544377 +4721 3.5886775919996 -0.000185627113412967 -0.001949146 +4722 3.5894377439996 -0.000184147487659936 -0.0019438005 +4723 3.5901978959996 -0.000182671945666013 -0.0019384015 +4724 3.5909580479996 -0.000181200528065917 -0.0019329492 +4725 3.5917181999996 -0.000179733275320504 -0.0019274437 +4726 3.5924783519996 -0.000178270227713995 -0.0019218853 +4727 3.5932385039996 -0.000176811425351864 -0.0019162743 +4728 3.5939986559996 -0.000175356908158175 -0.001910611 +4729 3.5947588079996 -0.000173906715873029 -0.0019048954 +4730 3.5955189599996 -0.000172460888050008 -0.001899128 +4731 3.5962791119996 -0.000171019464054067 -0.0018933088 +4732 3.5970392639996 -0.000169582483058761 -0.0018874383 +4733 3.5977994159996 -0.000168149984043797 -0.0018815166 +4734 3.5985595679996 -0.000166722005792597 -0.0018755441 +4735 3.5993197199996 -0.000165298586889739 -0.0018695209 +4736 3.6000798719996 -0.000163879765718633 -0.0018634473 +4737 3.6008400239996 -0.00016246558045907 -0.0018573237 +4738 3.6016001759996 -0.000161056069084231 -0.0018511502 +4739 3.6023603279996 -0.000159651269359018 -0.0018449272 +4740 3.6031204799996 -0.000158251218837058 -0.001838655 +4741 3.6038806319996 -0.000156855954858037 -0.0018323337 +4742 3.60464078399959 -0.000155465514545816 -0.0018259638 +4743 3.60540093599959 -0.000154079934805651 -0.0018195454 +4744 3.60616108799959 -0.00015269925232142 -0.001813079 +4745 3.60692123999959 -0.000151323503553735 -0.0018065647 +4746 3.60768139199959 -0.000149952724736946 -0.0018000029 +4747 3.60844154399959 -0.000148586951876806 -0.0017933939 +4748 3.60920169599959 -0.000147226220748364 -0.001786738 +4749 3.60996184799959 -0.000145870566892858 -0.0017800355 +4750 3.61072199999959 -0.000144520025615713 -0.0017732867 +4751 3.61148215199959 -0.000143174631983767 -0.001766492 +4752 3.61224230399959 -0.00014183442082305 -0.0017596515 +4753 3.61300245599959 -0.000140499426716123 -0.0017527658 +4754 3.61376260799959 -0.000139169683999518 -0.001745835 +4755 3.61452275999959 -0.000137845226761635 -0.0017388596 +4756 3.61528291199959 -0.00013652608883985 -0.0017318398 +4757 3.61604306399959 -0.000135212303818077 -0.001724776 +4758 3.61680321599959 -0.000133903905024768 -0.0017176685 +4759 3.61756336799959 -0.000132600925529691 -0.0017105177 +4760 3.61832351999959 -0.000131303398141935 -0.0017033239 +4761 3.61908367199959 -0.000130011355407578 -0.0016960875 +4762 3.61984382399959 -0.000128724829606575 -0.0016888087 +4763 3.62060397599959 -0.000127443852750986 -0.0016814881 +4764 3.62136412799959 -0.000126168456581865 -0.0016741258 +4765 3.62212427999959 -0.000124898672567264 -0.0016667224 +4766 3.62288443199959 -0.000123634531899564 -0.0016592781 +4767 3.62364458399959 -0.000122376065492924 -0.0016517933 +4768 3.62440473599959 -0.000121123303980841 -0.0016442684 +4769 3.62516488799959 -0.000119876277713926 -0.0016367037 +4770 3.62592503999959 -0.000118635016756907 -0.0016290997 +4771 3.62668519199959 -0.000117399550886521 -0.0016214567 +4772 3.62744534399959 -0.000116169909589181 -0.0016137752 +4773 3.62820549599959 -0.000114946122057979 -0.0016060554 +4774 3.62896564799959 -0.000113728217190689 -0.0015982978 +4775 3.62972579999959 -0.000112516223586989 -0.0015905027 +4776 3.63048595199959 -0.000111310169546019 -0.0015826707 +4777 3.63124610399959 -0.000110110083064052 -0.001574802 +4778 3.63200625599959 -0.000108915991832048 -0.001566897 +4779 3.63276640799959 -0.00010772792323277 -0.0015589563 +4780 3.63352655999959 -0.000106545904338895 -0.0015509801 +4781 3.63428671199959 -0.000105369961909907 -0.001542969 +4782 3.63504686399959 -0.000104200122390208 -0.0015349233 +4783 3.63580701599959 -0.000103036411906343 -0.0015268434 +4784 3.63656716799959 -0.000101878856264115 -0.0015187298 +4785 3.63732731999959 -0.000100727480947249 -0.0015105829 +4786 3.63808747199959 -0.00009958231111351082 -0.001502403 +4787 3.63884762399959 -0.0000984433715932598 -0.0014941908 +4788 3.63960777599959 -0.0000973106868865647 -0.0014859465 +4789 3.64036792799959 -0.00009618428116076051 -0.0014776707 +4790 3.64112807999958 -0.00009506417824800552 -0.0014693637 +4791 3.64188823199958 -0.00009395040164272841 -0.0014610261 +4792 3.64264838399958 -0.00009284297449918541 -0.0014526582 +4793 3.64340853599958 -0.00009174191962890711 -0.0014442605 +4794 3.64416868799958 -0.00009064725949858851 -0.0014358335 +4795 3.64492883999958 -0.0000895590162270921 -0.0014273776 +4796 3.64568899199958 -0.0000884772115832266 -0.0014188934 +4797 3.64644914399958 -0.0000874018669831944 -0.0014103811 +4798 3.64720929599958 -0.00008633300348814822 -0.0014018415 +4799 3.64796944799958 -0.00008527064180197111 -0.0013932748 +4800 3.64872959999958 -0.0000842148022682787 -0.0013846816 +4801 3.64948975199958 -0.00008316550486808791 -0.0013760623 +4802 3.65024990399958 -0.0000821227692178184 -0.0013674175 +4803 3.65101005599958 -0.0000810866145661837 -0.0013587476 +4804 3.65177020799958 -0.00008005705979208241 -0.0013500531 +4805 3.65253035999958 -0.0000790341234018221 -0.0013413345 +4806 3.65329051199958 -0.00007801782352712121 -0.0013325923 +4807 3.65405066399958 -0.000077008177922 -0.0013238271 +4808 3.65481081599958 -0.00007600520396078281 -0.0013150392 +4809 3.65557096799958 -0.0000750089186356551 -0.0013062292 +4810 3.65633111999958 -0.0000740193385536658 -0.0012973976 +4811 3.65709127199958 -0.0000730364799347294 -0.0012885449 +4812 3.65785142399958 -0.00007206035860907181 -0.0012796716 +4813 3.65861157599958 -0.00007109099001434421 -0.0012707784 +4814 3.65937172799958 -0.0000701283891939575 -0.0012618655 +4815 3.66013187999958 -0.0000691725707937518 -0.0012529337 +4816 3.66089203199958 -0.00006822354905988701 -0.0012439834 +4817 3.66165218399958 -0.00006728133783651111 -0.0012350152 +4818 3.66241233599958 -0.0000663459505630959 -0.0012260295 +4819 3.66317248799958 -0.00006541740027188331 -0.001217027 +4820 3.66393263999958 -0.0000644956995855539 -0.0012080081 +4821 3.66469279199958 -0.0000635808607146737 -0.0011989734 +4822 3.66545294399958 -0.0000626728954553624 -0.0011899235 +4823 3.66621309599958 -0.0000617718151865176 -0.001180859 +4824 3.66697324799958 -0.0000608776308675951 -0.0011717802 +4825 3.66773339999958 -0.00005999035303594361 -0.0011626879 +4826 3.66849355199958 -0.000059109991804584505 -0.0011535826 +4827 3.66925370399958 -0.0000582365568595478 -0.0011444648 +4828 3.67001385599958 -0.000057370057457206705 -0.0011353351 +4829 3.67077400799958 -0.0000565105024222801 -0.001126194 +4830 3.67153415999958 -0.0000556579001449453 -0.0011170423 +4831 3.67229431199958 -0.0000548122585782851 -0.0011078803 +4832 3.67305446399958 -0.000053973585236510904 -0.0010987088 +4833 3.67381461599958 -0.000053141887191410206 -0.0010895283 +4834 3.67457476799958 -0.0000523171710710146 -0.0010803393 +4835 3.67533491999958 -0.00005149944305604671 -0.0010711425 +4836 3.67609507199958 -0.00005068870887825481 -0.0010619384 +4837 3.67685522399958 -0.0000498849738174156 -0.0010527277 +4838 3.67761537599957 -0.000049088242699335504 -0.001043511 +4839 3.67837552799957 -0.000048298519892853205 -0.0010342888 +4840 3.67913567999957 -0.00004751580930761891 -0.0010250618 +4841 3.67989583199957 -0.000046740114391652404 -0.0010158305 +4842 3.68065598399957 -0.0000459714381289 -0.0010065956 +4843 3.68141613599957 -0.0000452097830364595 -0.00099735774 +4844 3.68217628799957 -0.0000444551511625813 -0.00098811748 +4845 3.68293643999957 -0.000043707544083670905 -0.00097887545 +4846 3.68369659199957 -0.000042966962902180105 -0.00096963228 +4847 3.68445674399957 -0.0000422334082438303 -0.00096038861 +4848 3.68521689599957 -0.0000415068802556151 -0.00095114506 +4849 3.68597704799957 -0.000040787378602691306 -0.00094190227 +4850 3.68673719999957 -0.0000400749024664915 -0.00093266088 +4851 3.68749735199957 -0.0000393694505417264 -0.00092342152 +4852 3.68825750399957 -0.000038671021034386604 -0.00091418485 +4853 3.68901765599957 -0.000037979611658745 -0.00090495151 +4854 3.68977780799957 -0.0000372952196354692 -0.00089572215 +4855 3.69053795999957 -0.00003661784168862431 -0.00088649743 +4856 3.69129811199957 -0.0000359474740435628 -0.00087727801 +4857 3.69205826399957 -0.000035284112424038804 -0.00086806454 +4858 3.69281841599957 -0.000034627752050320204 -0.00085885769 +4859 3.69357856799957 -0.000033978387636191 -0.00084965814 +4860 3.69433871999957 -0.000033336013386509004 -0.00084046654 +4861 3.69509887199957 -0.0000327006229950966 -0.00083128358 +4862 3.69585902399957 -0.000032072209641853506 -0.00082210992 +4863 3.69661917599957 -0.000031450765990759203 -0.00081294626 +4864 3.69737932799957 -0.0000308362841867638 -0.00080379328 +4865 3.69813947999957 -0.000030228755853789503 -0.00079465166 +4866 3.69889963199957 -0.0000296281720920666 -0.00078552209 +4867 3.69965978399957 -0.0000290345234756906 -0.00077640527 +4868 3.70041993599957 -0.0000284478000502908 -0.0007673019 +4869 3.70118008799957 -0.000027867991330143804 -0.00075821267 +4870 3.70194023999957 -0.0000272950862961752 -0.00074913829 +4871 3.70270039199957 -0.0000267290733931835 -0.00074007946 +4872 3.70346054399957 -0.0000261699405275095 -0.0007310369 +4873 3.70422069599957 -0.00002561767506426 -0.00072201132 +4874 3.70498084799957 -0.0000250722638253098 -0.00071300344 +4875 3.70574099999957 -0.000024533693086636904 -0.00070401397 +4876 3.70650115199957 -0.0000240019485754361 -0.00069504363 +4877 3.70726130399957 -0.000023477015468342802 -0.00068609317 +4878 3.70802145599957 -0.0000229588783884349 -0.00067716329 +4879 3.70878160799957 -0.0000224475214029018 -0.00066825475 +4880 3.70954175999957 -0.000021942928020601803 -0.00065936827 +4881 3.71030191199957 -0.0000214450811897304 -0.00065050459 +4882 3.71106206399957 -0.0000209539632950451 -0.00064166445 +4883 3.71182221599957 -0.0000204695561553114 -0.00063284861 +4884 3.71258236799957 -0.0000199918410215272 -0.00062405781 +4885 3.71334251999957 -0.000019520798573591202 -0.0006152928 +4886 3.71410267199956 -0.000019056408918194402 -0.00060655434 +4887 3.71486282399956 -0.000018598651586487803 -0.00059784319 +4888 3.71562297599956 -0.0000181475055314184 -0.0005891601 +4889 3.71638312799956 -0.0000177029491252867 -0.00058050586 +4890 3.71714327999956 -0.000017264960157303802 -0.00057188121 +4891 3.71790343199956 -0.0000168335158309274 -0.00056328695 +4892 3.71866358399956 -0.000016408592761640902 -0.00055472383 +4893 3.71942373599956 -0.0000159901669745111 -0.00054619264 +4894 3.72018388799956 -0.0000155782139014127 -0.00053769417 +4895 3.72094403999956 -0.0000151727083786968 -0.00052922919 +4896 3.72170419199956 -0.0000147736246447483 -0.0005207985 +4897 3.72246434399956 -0.0000143809363376546 -0.00051240288 +4898 3.72322449599956 -0.000013994616492429802 -0.00050404314 +4899 3.72398464799956 -0.0000136146375385726 -0.00049572006 +4900 3.72474479999956 -0.000013240971297956402 -0.00048743446 +4901 3.72550495199956 -0.000012873588981832102 -0.00047918713 +4902 3.72626510399956 -0.000012512461188718401 -0.00047097888 +4903 3.72702525599956 -0.0000121575579018485 -0.00046281053 +4904 3.72778540799956 -0.0000118088484867274 -0.00045468289 +4905 3.72854555999956 -0.0000114663016883565 -0.00044659677 +4906 3.72930571199956 -0.000011129885629124202 -0.000438553 +4907 3.73006586399956 -0.0000107995678061412 -0.0004305524 +4908 3.73082601599956 -0.000010475315088909202 -0.0004225958 +4909 3.73158616799956 -0.000010157093716767202 -0.00041468403 +4910 3.73234631999956 -9.84486929633821e-6 -0.00040681792 +4911 3.73310647199956 -9.538606798975559e-6 -0.00039899832 +4912 3.73386662399956 -9.23827055854254e-6 -0.00039122605 +4913 3.73462677599956 -8.94382426896989e-6 -0.00038350197 +4914 3.73538692799956 -8.65523098148024e-6 -0.00037582692 +4915 3.73614707999956 -8.37245310225665e-6 -0.00036820175 +4916 3.73690723199956 -8.09545238988907e-6 -0.00036062731 +4917 3.73766738399956 -7.82418995315393e-6 -0.00035310447 +4918 3.73842753599956 -7.558626248238549e-6 -0.00034563408 +4919 3.73918768799956 -7.2987210765207405e-6 -0.00033821701 +4920 3.73994783999956 -7.04443358190421e-6 -0.00033085411 +4921 3.74070799199956 -6.79572224826508e-6 -0.00032354627 +4922 3.74146814399956 -6.55254489723145e-6 -0.00031629435 +4923 3.74222829599956 -6.314858685629859e-6 -0.00030909923 +4924 3.74298844799956 -6.08262010293181e-6 -0.00030196179 +4925 3.74374859999956 -5.8557849687002095e-6 -0.00029488291 +4926 3.74450875199956 -5.63430843047996e-6 -0.00028786349 +4927 3.74526890399956 -5.4181449608004e-6 -0.0002809044 +4928 3.74602905599956 -5.20724835506581e-6 -0.00027400654 +4929 3.74678920799956 -5.0015717291129696e-6 -0.0002671708 +4930 3.74754935999956 -4.8010675164356095e-6 -0.00026039809 +4931 3.74830951199956 -4.60568746585288e-6 -0.00025368931 +4932 3.74906966399956 -4.41538263928898e-6 -0.00024704537 +4933 3.74982981599956 -4.2301034087755e-6 -0.00024046716 +4934 3.75058996799955 -4.04979945456407e-6 -0.00023395561 +4935 3.75135011999955 -3.874419762128769e-6 -0.00022751163 +4936 3.75211027199955 -3.7039126199456296e-6 -0.00022113613 +4937 3.75287042399955 -3.5382256170501896e-6 -0.00021483005 +4938 3.75363057599955 -3.37730564059502e-6 -0.0002085943 +4939 3.75439072799955 -3.22109887307409e-6 -0.00020242981 +4940 3.75515087999955 -3.0695507902134297e-6 -0.00019633752 +4941 3.75591103199955 -2.92260615819551e-6 -0.00019031836 +4942 3.75667118399955 -2.78020903143883e-6 -0.00018437326 +4943 3.75743133599955 -2.64230274993338e-6 -0.00017850318 +4944 3.75819148799955 -2.50882993690915e-6 -0.00017270905 +4945 3.75895163999955 -2.37973249639367e-6 -0.00016699182 +4946 3.75971179199955 -2.25495161021438e-6 -0.00016135244 +4947 3.76047194399955 -2.1344277364443396e-6 -0.00015579187 +4948 3.76123209599955 -2.01810060618257e-6 -0.00015031107 +4949 3.76199224799955 -1.90590922122258e-6 -0.00014491099 +4950 3.76275239999955 -1.7977918520539798e-6 -0.0001395926 +4951 3.76351255199955 -1.69368603442077e-6 -0.00013435687 +4952 3.76427270399955 -1.59352856810013e-6 -0.00012920477 +4953 3.76503285599955 -1.49725551323865e-6 -0.00012413726 +4954 3.76579300799955 -1.4048021886869899e-6 -0.00011915534 +4955 3.76655315999955 -1.31610316900233e-6 -0.00011425998 +4956 3.76731331199955 -1.23109228256091e-6 -0.00010945216 +4957 3.76807346399955 -1.1497026084494898e-6 -0.00010473287 +4958 3.76883361599955 -1.07186647435586e-6 -0.00010010311 +4959 3.76959376799955 -9.97515454015385e-7 -9.5563854e-05 +4960 3.77035391999955 -9.26580364546403e-7 -9.1116112e-05 +4961 3.77111407199955 -8.589912646739251e-7 -8.676088e-05 +4962 3.77187422399955 -7.946774510658729e-7 -8.2499163e-05 +4963 3.77263437599955 -7.335674570008169e-7 -7.8331966e-05 +4964 3.77339452799955 -6.75589049370373e-7 -7.42603e-05 +4965 3.77415467999955 -6.2066922601467e-7 -7.0285177e-05 +4966 3.77491483199955 -5.687342137239429e-7 -6.6407614e-05 +4967 3.77567498399955 -5.19709465351958e-7 -6.2628629e-05 +4968 3.77643513599955 -4.7351965781761194e-7 -5.8949247e-05 +4969 3.77719528799955 -4.3008868888527703e-7 -5.5370493e-05 +4970 3.77795543999955 -3.8933967549947797e-7 -5.1893396e-05 +4971 3.77871559199955 -3.51194950898304e-7 -4.8518989e-05 +4972 3.77947574399955 -3.15576061837852e-7 -4.5248308e-05 +4973 3.78023589599955 -2.8240376703791996e-7 -4.2082392e-05 +4974 3.78099604799955 -2.51598033518263e-7 -3.9022282e-05 +4975 3.78175619999955 -2.2307803515531098e-7 -3.6069025e-05 +4976 3.78251635199955 -1.9676214979558198e-7 -3.322367e-05 +4977 3.78327650399955 -1.7256795636910698e-7 -3.0487269e-05 +4978 3.78403665599955 -1.50412233224095e-7 -2.7860876e-05 +4979 3.78479680799955 -1.30210955129328e-7 -2.5345551e-05 +4980 3.78555695999955 -1.11879290831673e-7 -2.2942355e-05 +4981 3.78631711199955 -9.53316006135907e-8 -2.0652354e-05 +4982 3.78707726399954 -8.048143418371011e-8 -1.8476616e-05 +4983 3.78783741599954 -6.72415274571847e-8 -1.6416212e-05 +4984 3.78859756799954 -5.5523800668311196e-8 -1.4472218e-05 +4985 3.78935771999954 -4.5239355928039495e-8 -1.2645712e-05 +4986 3.79011787199954 -3.62984743373929e-8 -1.0937774e-05 +4987 3.79087802399954 -2.86106136559994e-8 -9.3494907e-06 +4988 3.79163817599954 -2.2084406192668402e-8 -7.8819487e-06 +4989 3.79239832799954 -1.66276555857436e-8 -6.5362395e-06 +4990 3.79315847999954 -1.2147335137768801e-8 -5.3134574e-06 +4991 3.79391863199954 -8.54958503992975e-9 -4.2147004e-06 +4992 3.79467878399954 -5.73970926343037e-9 -3.2410693e-06 +4993 3.79543893599954 -3.62217444926927e-9 -2.3936683e-06 +4994 3.79619908799954 -2.10060580041471e-9 -1.6736049e-06 +4995 3.79695923999954 -1.0777861936262002e-9 -1.0819899e-06 +4996 3.79771939199954 -4.5565229367383603e-10 -6.1993718e-07 +4997 3.79847954399954 -1.3529322107075403e-10 -2.8856397e-07 +4998 3.79923969599954 -1.69473324262981e-11 -8.89909e-08 +4999 3.79999984799954 0 0 diff --git a/examples/snap/W.SNAP_HePair.pot b/examples/snap/W.SNAP_HePair.pot new file mode 100644 index 0000000000..eb5ee4dfbe --- /dev/null +++ b/examples/snap/W.SNAP_HePair.pot @@ -0,0 +1,17 @@ +# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. to appear in arxiv Feb2017, W-He and He-He from Juslin, N. and Wirth, B. D. Journal of Nuclear Materials, 423, (2013) p61-63 +# +# Definition of SNAP+ZBL+Tabulated potential. +variable zblcutinner equal 4 +variable zblcutouter equal 4.8 +variable zblz equal 74 + +# Specify hybrid with SNAP, ZBL, and long-range Coulomb + +pair_style hybrid/overlay zbl ${zblcutinner} ${zblcutouter} snap table spline 10000 table spline 10000 +pair_coeff 1 1 zbl ${zblz} ${zblz} +pair_coeff * * snap W_2940_2017_2.snapcoeff W W_2940_2017_2.snapparam W NULL +pair_coeff 2 2 table 1 He_He_JW2013.table HeHe +pair_coeff 1 2 table 2 W_He_JW2013.table WHe +#Hybrid/overlay will take all pair styles and add their contributions equally, order of pair_coeff doesnt matter here +#This is not the case for pair_style hybrid ... where only one pair_coeff is read for each type combination, order matters here. + diff --git a/examples/snap/W_2940_2017_2.pot.snap b/examples/snap/W_2940_2017_2.pot.snap new file mode 100644 index 0000000000..ea98d65c9e --- /dev/null +++ b/examples/snap/W_2940_2017_2.pot.snap @@ -0,0 +1,16 @@ +# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. to appear in arxiv Feb2017 +# +# Definition of SNAP+ZBL potential. +variable zblcutinner equal 4 +variable zblcutouter equal 4.8 +variable zblz equal 74 + +# Specify hybrid with SNAP, ZBL, and long-range Coulomb + +pair_style hybrid/overlay & +zbl ${zblcutinner} ${zblcutouter} & +snap +pair_coeff 1 1 zbl ${zblz} ${zblz} +pair_coeff * * snap W_2940_2017_2.snapcoeff W W_2940_2017_2.snapparam W + +#Nomenclature on the snap files are Element_DakotaID_Year_Month diff --git a/examples/snap/W_2940_2017_2.snapcoeff b/examples/snap/W_2940_2017_2.snapcoeff new file mode 100644 index 0000000000..98a5c50635 --- /dev/null +++ b/examples/snap/W_2940_2017_2.snapcoeff @@ -0,0 +1,62 @@ +# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. to appear in arxiv Feb2017 +# +# LAMMPS SNAP coefficients for W + +1 56 +W 0.5 1 + 0.781170857801 + -0.001794941735 + -0.016628679036 + -0.066625537037 + -0.073716343967 + -0.062913923923 + 0.032552694672 + -0.134901744419 + -0.075076334103 + -0.148558616547 + -0.140808831101 + -0.166749145704 + -0.047487675984 + -0.049892090603 + -0.032483739965 + -0.114766534860 + -0.106759718242 + -0.125894850485 + -0.103409735225 + -0.095247335447 + -0.061998736346 + -0.053895610976 + -0.010799734206 + -0.011644828900 + -0.028316826924 + 0.011176085541 + 0.064619474684 + -0.023886279996 + -0.004099224312 + -0.056084222496 + -0.035551497650 + -0.056678501024 + -0.004905851656 + -0.015701146162 + -0.008462280779 + 0.016429018676 + 0.032432633993 + -0.010805361272 + -0.014841893457 + 0.019414134562 + -0.008112452759 + -0.002700775447 + 0.007032887063 + -0.009706065042 + 0.008385967833 + 0.028606085876 + -0.007003591067 + 0.006467260152 + -0.006666986361 + 0.029243285316 + 0.002477673872 + -0.000199497504 + 0.004068954075 + 0.006036129972 + -0.013010633924 + -0.008314173699 diff --git a/examples/snap/W_2940_2017_2.snapparam b/examples/snap/W_2940_2017_2.snapparam new file mode 100644 index 0000000000..7ff57c905d --- /dev/null +++ b/examples/snap/W_2940_2017_2.snapparam @@ -0,0 +1,12 @@ +# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. to appear in arxiv Feb2017 +# +# required +rcutfac 4.73442 +twojmax 8 + +# optional + +gamma 1 +rfac0 0.99363 +rmin0 0 +diagonalstyle 3 diff --git a/examples/snap/W_He_JW2013.table b/examples/snap/W_He_JW2013.table new file mode 100644 index 0000000000..8caec71935 --- /dev/null +++ b/examples/snap/W_He_JW2013.table @@ -0,0 +1,333 @@ +# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Juslin, N. and Wirth, B. D. Journal of Nuclear Materials, 423, (2013) p61-63 +# +#-> LAMMPS Potential File in tabular format. <-# +# N. Juslin and B.D. Wirth, J. Nucl. Mater. 432: 61-66 (2013). # +# Implemented by K.D. Hammond (2013) karlh@utk.edu +WHe +N 325 + +1 0.000001 193967.941432641 21165142.7035409 +2 0.02 88781.7058271842 5199760.86773195 +3 0.03 54461.7226844158 2255783.27652381 +4 0.04 37754.4525147374 1233285.07338825 +5 0.05 28027.0551422937 765154.791685769 +6 0.06 21746.7711436002 514318.047209743 +7 0.07 17407.2122555268 365457.111099578 +8 0.08 14260.380890756 270524.172812057 +9 0.09 11894.315375388 206649.630589727 +10 0.1 10064.3593879466 161847.200920021 +11 0.11 8616.61401638085 129358.142417815 +12 0.12 7449.7679909506 105145.917230655 +13 0.13 6494.61875555217 86685.1834957916 +14 0.14 5702.42313976808 72334.2424211515 +15 0.15 5037.94580316996 60990.8171175998 +16 0.16 4475.14199778904 51894.0939422829 +17 0.17 3994.38401078788 44506.229619365 +18 0.18 3580.62666819885 38438.9489608325 +19 0.19 3222.16279673461 33406.7013437966 +20 0.2 2909.75986785247 29195.976537891 +21 0.21 2636.04908399207 25644.7364933058 +22 0.22 2395.08534986163 22628.3414553063 +23 0.23 2182.02521022247 20049.740107058 +24 0.24 1992.88767473625 17832.5164484929 +25 0.25 1824.374223221 15915.8858113167 +26 0.26 1673.73168801722 14251.0430039002 +27 0.27 1538.64662154286 12798.4627755747 +28 0.28 1417.16307190682 11525.8804272463 +29 0.29 1307.61796220838 10406.7644777657 +30 0.3 1208.58985019291 9419.14958758174 +31 0.31 1118.8579596074 8544.73619272459 +32 0.32 1037.36917029033 7768.18965475981 +33 0.33 963.211228625566 7076.59012069084 +34 0.34 895.590859433663 6458.9972713357 +35 0.35 833.815769676712 5906.10340798657 +36 0.36 777.27976462076 5409.9550164674 +37 0.37 725.450370074705 4963.72782166695 +38 0.38 677.858485369477 4561.54392990095 +39 0.39 634.089691821654 4198.3223154716 +40 0.4 593.776918443069 3869.65589682796 +41 0.41 556.594226358163 3571.70994736531 +42 0.42 522.251519987548 3301.13772506169 +43 0.43 490.490029664824 3055.01007668961 +44 0.44 461.07843929567 2830.75644369566 +45 0.45 433.809555685745 2626.11521737135 +46 0.46 408.497434574275 2439.09179705296 +47 0.47 384.974893215623 2267.92302383156 +48 0.48 363.091351319355 2111.04691385653 +49 0.49 342.710951882019 1967.07681501168 +50 0.5 323.710921379843 1834.77927007332 +51 0.51 305.980135298364 1713.05499722693 +52 0.52 289.417860333203 1600.9225017701 +53 0.53 273.932649026687 1497.50391617084 +54 0.54 259.44136628296 1402.0127334168 +55 0.55 245.86833026895 1313.74315392891 +56 0.56 233.144552771494 1232.06081168718 +57 0.57 221.207066231741 1156.3946825672 +58 0.58 209.998326488761 1086.23000874818 +59 0.59 199.465681793803 1021.10209864685 +60 0.6 189.560899952328 960.590883129588 +61 0.61 180.239746551915 904.316126537919 +62 0.62 171.461608172096 851.933205957983 +63 0.63 163.189155273495 803.129384679904 +64 0.64 155.388040149985 757.62051633995 +65 0.65 148.026625916815 715.148125151611 +66 0.66 141.075743014823 675.476815185188 +67 0.67 134.508470148273 638.391968073426 +68 0.68 128.299936952045 603.697693987706 +69 0.69 122.427146011509 571.215005397664 +70 0.7 116.868812142757 540.780187122909 +71 0.71 111.605217088269 512.243339613345 +72 0.72 106.618077998551 485.467075341772 +73 0.73 101.890428258492 460.32535073159 +74 0.74 97.4065093817089 436.702418234594 +75 0.75 93.1516728402801 414.491885070093 +76 0.76 89.1122908237631 393.595866780115 +77 0.77 85.2756750325343 373.92422518237 +78 0.78 81.6300027083206 355.393881543952 +79 0.79 78.1642491910339 337.928196880203 +80 0.8 74.8681263671512 321.456412227117 +81 0.81 71.7320264421784 305.913142560798 +82 0.82 68.7469705293107 291.237918759986 +83 0.83 65.9045615992059 277.374772641144 +84 0.84 63.1969413826496 264.271860652001 +85 0.85 60.6167508595336 251.881122298665 +86 0.86 58.1570940046202 240.157969812335 +87 0.87 55.8115044935616 229.061005941579 +88 0.88 53.5739151020755 218.551767091662 +89 0.89 51.4386295574478 208.594489329042 +90 0.9 49.400296625012 199.15589503172 +91 0.91 47.4538862332645 190.204998198848 +92 0.92 45.5946674600827 181.712926639528 +93 0.93 43.818188219384 173.652759444123 +94 0.94 42.1202565026948 165.999378304597 +95 0.95 40.4969230436942 158.729331395598 +96 0.96 38.944465286023 151.820708657476 +97 0.97 37.4593725456438 145.253027437895 +98 0.98 36.03833226895 139.00712755184 +99 0.99 34.6782172967515 133.065074912029 +100 1 33.3760740523261 127.410072964226 +101 1.01 32.1291115790037 122.026381235854 +102 1.02 30.9346913593292 116.899240372539 +103 1.03 29.7903178538011 112.014803096661 +104 1.04 28.6936297025718 107.360070575369 +105 1.05 27.6423915383737 102.922833733498 +106 1.06 26.6344863633652 98.69161908997 +107 1.07 25.6679084466039 94.6556387351718 +108 1.08 24.7407567025028 90.804744101767 +109 1.09 23.8272933774771 87.0424919424945 +110 1.1 22.9746938084833 83.501083250349 +111 1.11 22.1568053467682 80.0995862713648 +112 1.12 21.372249301539 76.8339257499533 +113 1.13 20.6196874341871 73.7000865054019 +114 1.14 19.8978213575361 70.6941134318681 +115 1.15 19.2053919350916 67.8121114983956 +116 1.16 18.5411786802966 65.0502457488983 +117 1.17 17.9039991557794 62.4047413021631 +118 1.18 17.2927083726064 59.8718833518619 +119 1.19 16.7061981895337 57.4480171665332 +120 1.2 16.1433967122567 55.1295480895992 +121 1.21 15.6032676926612 52.9129415393513 +122 1.22 15.0848099280771 50.7947230089626 +123 1.23 14.5870566605305 48.7714780664787 +124 1.24 14.1090749759875 46.8398523548244 +125 1.25 13.6499652036138 44.9965515917961 +126 1.26 13.2088603150229 43.2383415700692 +127 1.27 12.784925323525 41.5620481571964 +128 1.28 12.3773566833817 39.9645572956038 +129 1.29 11.9853816890583 38.4428150025965 +130 1.3 11.60825787447 36.9938273703497 +131 1.31 11.2452724122346 35.6146605659201 +132 1.32 10.8957415129272 34.3024408312399 +133 1.33 10.5590098243284 33.0543544831148 +134 1.34 10.234449830679 31.8676479132323 +135 1.35 9.92146125192414 30.739627588146 +136 1.36 9.61947044297006 29.6676600492951 +137 1.37 9.32792979293674 28.6491719129885 +138 1.38 9.04631712440562 27.6816498704143 +139 1.39 8.77413509267092 26.7626406876384 +140 1.4 8.51091058499253 25.8897512055996 +141 1.41 8.25619411984519 25.0606483401084 +142 1.42 8.00955924617449 24.2730590818669 +143 1.43 7.77060194264106 23.524770496429 +144 1.44 7.53894001687615 22.8136297242495 +145 1.45 7.31421250473534 22.1375439806457 +146 1.46 7.09607906954318 21.4944805558102 +147 1.47 6.88421940134788 20.8824668148159 +148 1.48 6.678332616175 20.2995901976151 +149 1.49 6.47813665527576 19.743998219024 +150 1.5 6.28336768437487 19.2138984687485 +151 1.51 6.09377949293196 18.7075586113629 +152 1.52 5.90914289338127 18.2233063863173 +153 1.53 5.72924512039265 17.759529607943 +154 1.54 5.55388923011117 17.3146761654411 +155 1.55 5.38289349942409 16.8872540228954 +156 1.56 5.21609082520001 16.4758312192575 +157 1.57 5.05332812353902 16.0790358683639 +158 1.58 4.89446572903546 15.6955561589207 +159 1.59 4.73937679401809 15.3241403545121 +160 1.6 4.58794668780786 14.9635967935988 +161 1.61 4.44007239596442 14.6127938895147 +162 1.62 4.29566191954302 14.2706601304803 +163 1.63 4.15463367433779 13.9361840795741 +164 1.64 4.01691589014092 13.6084143747644 +165 1.65 3.88244600998598 13.2864597288958 +166 1.66 3.75117008941481 12.9694889296766 +167 1.67 3.62304219570535 12.6567308397093 +168 1.68 3.49802380713948 12.3474743964548 +169 1.69 3.37608321225264 12.04106861226 +170 1.7 3.25719490908079 11.7369225743464 +171 1.71 3.14133900441368 11.4345054448136 +172 1.72 3.02850061304264 11.1333464606264 +173 1.73 2.91866925702027 10.8330349336425 +174 1.74 2.81183826489826 10.533220250582 +175 1.75 2.70800417099883 10.233611873045 +176 1.76 2.60716611463897 9.93397933750975 +177 1.77 2.50932523941003 9.63415225533254 +178 1.78 2.41448409240832 9.3340203127359 +179 1.79 2.3226460234938 9.03353327083141 +180 1.8 2.23381458454253 8.732700965596 +181 1.81 2.14799292869986 8.43159330788831 +182 1.82 2.06518320961743 8.13034028344418 +183 1.83 1.98538598072548 7.82913195286937 +184 1.84 1.90859959447164 7.52821845164772 +185 1.85 1.83481960157053 7.2279099901466 +186 1.86 1.7640381502589 6.92857685359786 +187 1.87 1.69624338555161 6.63064940211416 +188 1.88 1.63141884849222 6.33461807069079 +189 1.89 1.56954287538349 6.04103336918388 +190 1.9 1.51058799706618 5.75050588234672 +191 1.91 1.45452033816503 5.46370626978796 +192 1.92 1.40129901631838 5.18136526601165 +193 1.93 1.35087554145878 4.90427368037354 +194 1.94 1.30319321504351 4.63328239712837 +195 1.95 1.25818652931969 4.36930237539354 +196 1.96 1.21578056655756 4.11330464916909 +197 1.97 1.17589039832831 3.86632032733041 +198 1.98 1.13842048472736 3.62944059362462 +199 1.99 1.10326407363948 3.4038167066833 +200 2 1.07030260000113 3.19065999999702 +201 2.01 1.03940508502285 2.99124188195356 +202 2.02 1.01042753546074 2.80689383580147 +203 2.03 0.98321234287971 2.63900741967382 +204 2.04 0.957587682867711 2.48903426657353 +205 2.05 0.93336691431989 2.35848608439528 +206 2.06 0.910347978676441 2.24893465587638 +207 2.07 0.888312799175878 2.16201183866769 +208 2.08 0.867026680100139 2.09940956527362 +209 2.09 0.846311972535292 2.0501194750481 +210 2.1 0.826052090711088 2.00205155230487 +211 2.11 0.806267097861257 1.95513674544071 +212 2.12 0.786945609506685 1.90934585391834 +213 2.13 0.7680765291529 1.86465047725327 +214 2.14 0.749649040410966 1.82102299086693 +215 2.15 0.731652599355765 1.77843652275056 +216 2.16 0.714076927113717 1.73686493090964 +217 2.17 0.696912002672274 1.69628278155967 +218 2.18 0.680148055903811 1.65666532804561 +219 2.19 0.663775560796824 1.61798849045792 +220 2.2 0.647785228887586 1.5802288359199 +221 2.21 0.632168002885678 1.54336355952145 +222 2.22 0.616915050487049 1.50737046587586 +223 2.23 0.602017758368489 1.47222795127685 +224 2.24 0.587467726357617 1.43791498643425 +225 2.25 0.573256761772716 1.40441109976729 +226 2.26 0.559376873926913 1.37169636123572 +227 2.27 0.54582026879146 1.33975136668933 +228 2.28 0.532579343812991 1.30855722271748 +229 2.29 0.519646682879861 1.27809553198093 +230 2.3 0.507015051432831 1.24834837900889 +231 2.31 0.494677391715517 1.21929831644497 +232 2.32 0.482626818160208 1.19092835172618 +233 2.33 0.470856612904789 1.16322193418007 +234 2.34 0.459360221436662 1.1361629425252 +235 2.35 0.448131248359705 1.10973567276124 +236 2.36 0.437163453280438 1.08392482643501 +237 2.37 0.426450746809703 1.05871549926971 +238 2.38 0.415987186676291 1.0340931701448 +239 2.39 0.405766973949056 1.01004369041464 +240 2.4 0.395784449364215 0.986553273554313 +241 2.41 0.38603408975458 0.963608485121541 +242 2.42 0.376510504577652 0.941196233024116 +243 2.43 0.367208432539548 0.919303758082476 +244 2.44 0.358122738311864 0.897918624877599 +245 2.45 0.349248409338683 0.877028712874665 +246 2.46 0.340580552730998 0.85662220781334 +247 2.47 0.332114392245936 0.83668759335581 +248 2.48 0.323845265348255 0.8172136429841 +249 2.49 0.315768620351645 0.798189412138432 +250 2.5 0.307880013637488 0.779604230588763 +251 2.51 0.300175106948751 0.761447695031842 +252 2.52 0.292649664756829 0.743709661906479 +253 2.53 0.285299551699157 0.726380240419923 +254 2.54 0.278120730085547 0.70944978577854 +255 2.55 0.271109257471214 0.69290889261619 +256 2.56 0.264149883217677 0.704309455966822 +257 2.57 0.257023670963235 0.720548414483017 +258 2.58 0.249746544950963 0.73449858053557 +259 2.59 0.242341191411443 0.746201328856265 +260 2.6 0.234829852474346 0.755704032488528 +261 2.61 0.227234268357011 0.763059628544665 +262 2.62 0.219575623890343 0.768326185205915 +263 2.63 0.211874499363033 0.771566471270733 +264 2.64 0.204150825652343 0.772847529495918 +265 2.65 0.196423843597567 0.772240254912945 +266 2.66 0.188712067560753 0.769818979238484 +267 2.67 0.181033253108439 0.765661062433794 +268 2.68 0.17340436873789 0.759846492402718 +269 2.69 0.165841571561793 0.752457493752577 +270 2.7 0.158360186856416 0.743578146476553 +271 2.71 0.150974691370005 0.733294015350452 +272 2.72 0.14369870028059 0.721691790771177 +273 2.73 0.136544957685405 0.708858941699004 +274 2.74 0.129525330497857 0.69488338130108 +275 2.75 0.122650805622294 0.679853145829612 +276 2.76 0.115931490271846 0.663856087205069 +277 2.77 0.10937661529017 0.646979579712699 +278 2.78 0.102994541334199 0.629310241159726 +279 2.79 0.0967927677717845 0.610933668781077 +280 2.8 0.0907779441455664 0.591934190123306 +281 2.81 0.0849558840523623 0.572394629079895 +282 2.82 0.0793315812859323 0.552396087196204 +283 2.83 0.0739092280900552 0.532017740309284 +284 2.84 0.0686922353684514 0.51133665053656 +285 2.85 0.0636832546982004 0.490427593578163 +286 2.86 0.058884201993894 0.469362901250494 +287 2.87 0.0542962826708072 0.448212319123508 +288 2.88 0.0499200181568738 0.427042879091302 +289 2.89 0.04575527360515 0.405918786664859 +290 2.9 0.0418012866607671 0.384901322737369 +291 2.91 0.0380566971390415 0.364048759536354 +292 2.92 0.0345195774744505 0.343416290443013 +293 2.93 0.0311874638035265 0.323055973327595 +294 2.94 0.0280573875483925 0.303016687020528 +295 2.95 0.0251259073715924 0.283344100512051 +296 2.96 0.0223891413770724 0.264080654448684 +297 2.97 0.0198427994365954 0.245265554472591 +298 2.98 0.017482215525515 0.226934775930029 +299 2.99 0.0153023799566589 0.20912107945741 +300 3 0.0132979714060716 0.191854036938167 +301 3.01 0.0114633886294948 0.175160067310366 +302 3.02 0.009792781773727 0.159062481694054 +303 3.03 0.00828008319235769 0.143581537298372 +304 3.04 0.00691903768080766 0.128734499561665 +305 3.05 0.00570323205109961 0.114535711972949 +306 3.06 0.0046261239723178 0.100996673020243 +307 3.07 0.00368107000826405 0.088126119710232 +308 3.08 0.00286135278937321 0.0759301171045549 +309 3.09 0.00216020726148435 0.0644121533205429 +310 3.1 0.00157084595956787 0.0535732394484653 +311 3.11 0.00108648325995938 0.0434120138431347 +312 3.12 0.000700358570037423 0.0339248502550448 +313 3.13 0.000405758419588332 0.0251059692749879 +314 3.14 0.000196037423311657 0.0169475525761798 +315 3.15 6.46380890244662E-05 0.00943985944932857 +316 3.16 5.1094511057313E-06 0.00257134513861945 +317 3.17 0 0 +318 3.18 0 0 +319 3.19 0 0 +320 3.2 0 0 +321 3.21 0 0 +322 3.22 0 0 +323 3.23 0 0 +324 3.24 0 0 +325 3.25 0 0 diff --git a/examples/snap/in.snap b/examples/snap/in.snap.Ta06A similarity index 100% rename from examples/snap/in.snap rename to examples/snap/in.snap.Ta06A diff --git a/examples/snap/in.snap.W.2940 b/examples/snap/in.snap.W.2940 new file mode 100644 index 0000000000..7d81b4c78e --- /dev/null +++ b/examples/snap/in.snap.W.2940 @@ -0,0 +1,45 @@ +# Demonstrate SNAP Ta potential + +# Initialize simulation + +variable nsteps index 100 +variable nrep equal 4 +variable a equal 3.1803 +units metal + +# generate the box and atom positions using a BCC lattice + +variable nx equal ${nrep} +variable ny equal ${nrep} +variable nz equal ${nrep} + +boundary p p p + +lattice bcc $a +region box block 0 ${nx} 0 ${ny} 0 ${nz} +create_box 1 box +create_atoms 1 box + +mass 1 183.84 + +# choose potential + +include W_2940_2017_2.pot.snap + +# Setup output + +thermo 10 +thermo_modify norm yes + +# Set up NVE run + +timestep 0.5e-3 +neighbor 1.0 bin +neigh_modify once no every 1 delay 0 check yes + +# Run MD + +velocity all create 300.0 4928459 +fix 1 all nve +run ${nsteps} + diff --git a/examples/snap/in.snap.hybrid.WSNAP.HePair b/examples/snap/in.snap.hybrid.WSNAP.HePair new file mode 100644 index 0000000000..d2710bca77 --- /dev/null +++ b/examples/snap/in.snap.hybrid.WSNAP.HePair @@ -0,0 +1,48 @@ +# Demonstrate SNAP Ta potential + +# Initialize simulation + +variable nsteps index 100 +variable nrep equal 4 +variable a equal 3.1803 +units metal + +# generate the box and atom positions using a BCC lattice + +variable nx equal ${nrep} +variable ny equal ${nrep} +variable nz equal ${nrep} + +boundary p p p + +lattice bcc $a +region box block 0 ${nx} 0 ${ny} 0 ${nz} +create_box 2 box +create_atoms 1 box +mass 1 183.84 +mass 2 4.0026 + +set group all type/fraction 2 0.05 3590153 # Change 5% of W to He +group tungsten type 1 +group helium type 2 +# choose potential + +include W.SNAP_HePair.pot + +# Setup output + +thermo 10 +thermo_modify norm yes + +# Set up NVE run + +timestep 0.5e-3 +neighbor 1.0 bin +neigh_modify once no every 1 delay 0 check yes + +# Run MD + +velocity all create 300.0 4928459 +fix 1 all nve +run ${nsteps} + diff --git a/examples/snap/log.21Feb17.snap.W.2940.g++.1 b/examples/snap/log.21Feb17.snap.W.2940.g++.1 new file mode 100644 index 0000000000..8c74380b8b --- /dev/null +++ b/examples/snap/log.21Feb17.snap.W.2940.g++.1 @@ -0,0 +1,144 @@ +LAMMPS (13 Feb 2017) +# Demonstrate SNAP Ta potential + +# Initialize simulation + +variable nsteps index 100 +variable nrep equal 4 +variable a equal 3.1803 +units metal + +# generate the box and atom positions using a BCC lattice + +variable nx equal ${nrep} +variable nx equal 4 +variable ny equal ${nrep} +variable ny equal 4 +variable nz equal ${nrep} +variable nz equal 4 + +boundary p p p + +lattice bcc $a +lattice bcc 3.1803 +Lattice spacing in x,y,z = 3.1803 3.1803 3.1803 +region box block 0 ${nx} 0 ${ny} 0 ${nz} +region box block 0 4 0 ${ny} 0 ${nz} +region box block 0 4 0 4 0 ${nz} +region box block 0 4 0 4 0 4 +create_box 1 box +Created orthogonal box = (0 0 0) to (12.7212 12.7212 12.7212) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 128 atoms + +mass 1 183.84 + +# choose potential + +include W_2940_2017_2.pot.snap +# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. to appear in arxiv Feb2017 +# +# Definition of SNAP+ZBL potential. +variable zblcutinner equal 4 +variable zblcutouter equal 4.8 +variable zblz equal 74 + +# Specify hybrid with SNAP, ZBL, and long-range Coulomb + +pair_style hybrid/overlay zbl ${zblcutinner} ${zblcutouter} snap +pair_style hybrid/overlay zbl 4 ${zblcutouter} snap +pair_style hybrid/overlay zbl 4 4.8 snap +pair_coeff 1 1 zbl ${zblz} ${zblz} +pair_coeff 1 1 zbl 74 ${zblz} +pair_coeff 1 1 zbl 74 74 +pair_coeff * * snap W_2940_2017_2.snapcoeff W W_2940_2017_2.snapparam W +Reading potential file W_2940_2017_2.snapcoeff with DATE: 2017-02-20 +SNAP Element = W, Radius 0.5, Weight 1 +Reading potential file W_2940_2017_2.snapparam with DATE: 2017-02-20 +SNAP keyword rcutfac 4.73442 +SNAP keyword twojmax 8 +SNAP keyword gamma 1 +SNAP keyword rfac0 0.99363 +SNAP keyword rmin0 0 +SNAP keyword diagonalstyle 3 + +#Nomenclature on the snap files are Element_DakotaID_Year_Month + +# Setup output + +thermo 10 +thermo_modify norm yes + +# Set up NVE run + +timestep 0.5e-3 +neighbor 1.0 bin +neigh_modify once no every 1 delay 0 check yes + +# Run MD + +velocity all create 300.0 4928459 +fix 1 all nve +run ${nsteps} +run 100 +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 5.8 + ghost atom cutoff = 5.8 + binsize = 2.9, bins = 5 5 5 + 2 neighbor lists, perpetual/occasional/extra = 2 0 0 + (1) pair zbl, perpetual, half/full from (2) + attributes: half, newton on + pair build: halffull/newton + stencil: none + bin: none + (2) pair snap, perpetual + attributes: full, newton on + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Memory usage per processor = 5.14696 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 300 -11.028325 0 -10.98985 3010.497 + 10 293.40666 -11.027479 0 -10.989849 3246.0559 + 20 274.27375 -11.025025 0 -10.989849 3927.9497 + 30 244.50457 -11.021207 0 -10.989849 4983.5484 + 40 207.0784 -11.016407 0 -10.989849 6299.9473 + 50 165.74442 -11.011105 0 -10.989848 7736.5123 + 60 124.62181 -11.005831 0 -10.989848 9140.8587 + 70 87.744792 -11.001101 0 -10.989848 10366.489 + 80 58.605244 -10.997364 0 -10.989848 11289.914 + 90 39.754503 -10.994946 0 -10.989848 11824.945 + 100 32.524085 -10.994019 0 -10.989848 11932.118 +Loop time of 11.8271 on 1 procs for 100 steps with 128 atoms + +Performance: 0.365 ns/day, 65.706 hours/ns, 8.455 timesteps/s +99.9% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 11.826 | 11.826 | 11.826 | 0.0 | 99.99 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.00044084 | 0.00044084 | 0.00044084 | 0.0 | 0.00 +Output | 0.00013232 | 0.00013232 | 0.00013232 | 0.0 | 0.00 +Modify | 0.00021887 | 0.00021887 | 0.00021887 | 0.0 | 0.00 +Other | | 0.0002718 | | | 0.00 + +Nlocal: 128 ave 128 max 128 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 727 ave 727 max 727 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 3712 ave 3712 max 3712 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +FullNghs: 7424 ave 7424 max 7424 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 7424 +Ave neighs/atom = 58 +Neighbor list builds = 0 +Dangerous builds = 0 + +Total wall time: 0:00:11 diff --git a/examples/snap/log.21Feb17.snap.W.2940.g++.4 b/examples/snap/log.21Feb17.snap.W.2940.g++.4 new file mode 100644 index 0000000000..97ed5cc8d1 --- /dev/null +++ b/examples/snap/log.21Feb17.snap.W.2940.g++.4 @@ -0,0 +1,144 @@ +LAMMPS (13 Feb 2017) +# Demonstrate SNAP Ta potential + +# Initialize simulation + +variable nsteps index 100 +variable nrep equal 4 +variable a equal 3.1803 +units metal + +# generate the box and atom positions using a BCC lattice + +variable nx equal ${nrep} +variable nx equal 4 +variable ny equal ${nrep} +variable ny equal 4 +variable nz equal ${nrep} +variable nz equal 4 + +boundary p p p + +lattice bcc $a +lattice bcc 3.1803 +Lattice spacing in x,y,z = 3.1803 3.1803 3.1803 +region box block 0 ${nx} 0 ${ny} 0 ${nz} +region box block 0 4 0 ${ny} 0 ${nz} +region box block 0 4 0 4 0 ${nz} +region box block 0 4 0 4 0 4 +create_box 1 box +Created orthogonal box = (0 0 0) to (12.7212 12.7212 12.7212) + 1 by 2 by 2 MPI processor grid +create_atoms 1 box +Created 128 atoms + +mass 1 183.84 + +# choose potential + +include W_2940_2017_2.pot.snap +# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. to appear in arxiv Feb2017 +# +# Definition of SNAP+ZBL potential. +variable zblcutinner equal 4 +variable zblcutouter equal 4.8 +variable zblz equal 74 + +# Specify hybrid with SNAP, ZBL, and long-range Coulomb + +pair_style hybrid/overlay zbl ${zblcutinner} ${zblcutouter} snap +pair_style hybrid/overlay zbl 4 ${zblcutouter} snap +pair_style hybrid/overlay zbl 4 4.8 snap +pair_coeff 1 1 zbl ${zblz} ${zblz} +pair_coeff 1 1 zbl 74 ${zblz} +pair_coeff 1 1 zbl 74 74 +pair_coeff * * snap W_2940_2017_2.snapcoeff W W_2940_2017_2.snapparam W +Reading potential file W_2940_2017_2.snapcoeff with DATE: 2017-02-20 +SNAP Element = W, Radius 0.5, Weight 1 +Reading potential file W_2940_2017_2.snapparam with DATE: 2017-02-20 +SNAP keyword rcutfac 4.73442 +SNAP keyword twojmax 8 +SNAP keyword gamma 1 +SNAP keyword rfac0 0.99363 +SNAP keyword rmin0 0 +SNAP keyword diagonalstyle 3 + +#Nomenclature on the snap files are Element_DakotaID_Year_Month + +# Setup output + +thermo 10 +thermo_modify norm yes + +# Set up NVE run + +timestep 0.5e-3 +neighbor 1.0 bin +neigh_modify once no every 1 delay 0 check yes + +# Run MD + +velocity all create 300.0 4928459 +fix 1 all nve +run ${nsteps} +run 100 +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 5.8 + ghost atom cutoff = 5.8 + binsize = 2.9, bins = 5 5 5 + 2 neighbor lists, perpetual/occasional/extra = 2 0 0 + (1) pair zbl, perpetual, half/full from (2) + attributes: half, newton on + pair build: halffull/newton + stencil: none + bin: none + (2) pair snap, perpetual + attributes: full, newton on + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Memory usage per processor = 5.12833 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 300 -11.028325 0 -10.98985 3010.497 + 10 293.22504 -11.027456 0 -10.989849 3258.275 + 20 273.60084 -11.024939 0 -10.989849 3973.9038 + 30 243.15327 -11.021034 0 -10.989849 5077.9172 + 40 205.01905 -11.016142 0 -10.989849 6448.4941 + 50 163.10914 -11.010767 0 -10.989848 7935.6835 + 60 121.67854 -11.005453 0 -10.989848 9378.9959 + 70 84.846972 -11.000729 0 -10.989848 10626.301 + 80 56.127265 -10.997046 0 -10.989848 11551.687 + 90 38.025013 -10.994724 0 -10.989847 12069.936 + 100 31.768127 -10.993922 0 -10.989847 12145.648 +Loop time of 3.03545 on 4 procs for 100 steps with 128 atoms + +Performance: 1.423 ns/day, 16.864 hours/ns, 32.944 timesteps/s +99.9% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 2.9594 | 2.9866 | 3.0319 | 1.6 | 98.39 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.0024238 | 0.047825 | 0.075032 | 12.5 | 1.58 +Output | 0.00021601 | 0.00024045 | 0.00027442 | 0.0 | 0.01 +Modify | 9.6798e-05 | 0.00011188 | 0.00011802 | 0.0 | 0.00 +Other | | 0.000698 | | | 0.02 + +Nlocal: 32 ave 32 max 32 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +Nghost: 431 ave 431 max 431 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +Neighs: 928 ave 928 max 928 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +FullNghs: 1856 ave 1856 max 1856 min +Histogram: 4 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 7424 +Ave neighs/atom = 58 +Neighbor list builds = 0 +Dangerous builds = 0 + +Total wall time: 0:00:03 diff --git a/examples/snap/log.21Feb17.snap.hybrid.WSNAP.HePair.g++.1 b/examples/snap/log.21Feb17.snap.hybrid.WSNAP.HePair.g++.1 new file mode 100644 index 0000000000..846eef269c --- /dev/null +++ b/examples/snap/log.21Feb17.snap.hybrid.WSNAP.HePair.g++.1 @@ -0,0 +1,179 @@ +LAMMPS (13 Feb 2017) +# Demonstrate SNAP Ta potential + +# Initialize simulation + +variable nsteps index 100 +variable nrep equal 4 +variable a equal 3.1803 +units metal + +# generate the box and atom positions using a BCC lattice + +variable nx equal ${nrep} +variable nx equal 4 +variable ny equal ${nrep} +variable ny equal 4 +variable nz equal ${nrep} +variable nz equal 4 + +boundary p p p + +lattice bcc $a +lattice bcc 3.1803 +Lattice spacing in x,y,z = 3.1803 3.1803 3.1803 +region box block 0 ${nx} 0 ${ny} 0 ${nz} +region box block 0 4 0 ${ny} 0 ${nz} +region box block 0 4 0 4 0 ${nz} +region box block 0 4 0 4 0 4 +create_box 2 box +Created orthogonal box = (0 0 0) to (12.7212 12.7212 12.7212) + 1 by 1 by 1 MPI processor grid +create_atoms 1 box +Created 128 atoms +mass 1 183.84 +mass 2 4.0026 + +set group all type/fraction 2 0.05 3590153 # Change 5% of W to He + 5 settings made for type/fraction +group tungsten type 1 +123 atoms in group tungsten +group helium type 2 +5 atoms in group helium +# choose potential + +include W.SNAP_HePair.pot +# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. to appear in arxiv Feb2017, W-He and He-He from Juslin, N. and Wirth, B. D. Journal of Nuclear Materials, 423, (2013) p61-63 +# +# Definition of SNAP+ZBL+Tabulated potential. +variable zblcutinner equal 4 +variable zblcutouter equal 4.8 +variable zblz equal 74 + +# Specify hybrid with SNAP, ZBL, and long-range Coulomb + +pair_style hybrid/overlay zbl ${zblcutinner} ${zblcutouter} snap table spline 10000 table spline 10000 +pair_style hybrid/overlay zbl 4 ${zblcutouter} snap table spline 10000 table spline 10000 +pair_style hybrid/overlay zbl 4 4.8 snap table spline 10000 table spline 10000 +pair_coeff 1 1 zbl ${zblz} ${zblz} +pair_coeff 1 1 zbl 74 ${zblz} +pair_coeff 1 1 zbl 74 74 +pair_coeff * * snap W_2940_2017_2.snapcoeff W W_2940_2017_2.snapparam W NULL +Reading potential file W_2940_2017_2.snapcoeff with DATE: 2017-02-20 +SNAP Element = W, Radius 0.5, Weight 1 +Reading potential file W_2940_2017_2.snapparam with DATE: 2017-02-20 +SNAP keyword rcutfac 4.73442 +SNAP keyword twojmax 8 +SNAP keyword gamma 1 +SNAP keyword rfac0 0.99363 +SNAP keyword rmin0 0 +SNAP keyword diagonalstyle 3 +pair_coeff 2 2 table 1 He_He_JW2013.table HeHe +Reading potential file He_He_JW2013.table with DATE: 2017-02-20 +WARNING: 1 of 4999 force values in table are inconsistent with -dE/dr. + Should only be flagged at inflection points (../pair_table.cpp:476) +pair_coeff 1 2 table 2 W_He_JW2013.table WHe +Reading potential file W_He_JW2013.table with DATE: 2017-02-20 +WARNING: 3 of 325 force values in table are inconsistent with -dE/dr. + Should only be flagged at inflection points (../pair_table.cpp:476) +#Hybrid/overlay will take all pair styles and add their contributions equally, order of pair_coeff doesnt matter here +#This is not the case for pair_style hybrid ... where only one pair_coeff is read for each type combination, order matters here. + + +# Setup output + +thermo 10 +thermo_modify norm yes + +# Set up NVE run + +timestep 0.5e-3 +neighbor 1.0 bin +neigh_modify once no every 1 delay 0 check yes + +# Run MD + +velocity all create 300.0 4928459 +fix 1 all nve +run ${nsteps} +run 100 +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 5.8 + ghost atom cutoff = 5.8 + binsize = 2.9, bins = 5 5 5 + 6 neighbor lists, perpetual/occasional/extra = 6 0 0 + (1) pair zbl, perpetual, half/full from (2) + attributes: half, newton on + pair build: halffull/newton/skip + stencil: none + bin: none + (2) pair snap, perpetual, skip from (6) + attributes: full, newton on + pair build: skip + stencil: none + bin: none + (3) pair table, perpetual, skip from (5) + attributes: half, newton on + pair build: skip + stencil: none + bin: none + (4) pair table, perpetual, skip from (5) + attributes: half, newton on + pair build: skip + stencil: none + bin: none + (5) neighbor class addition, perpetual, half/full from (6) + attributes: half, newton on + pair build: halffull/newton + stencil: none + bin: none + (6) neighbor class addition, perpetual + attributes: full, newton on + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Memory usage per processor = 7.6729 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 300 -10.438105 0 -10.39963 -5445.2808 + 10 290.48923 -10.436885 0 -10.399629 -5646.4813 + 20 271.18868 -10.434409 0 -10.399629 -5654.4646 + 30 246.2601 -10.431212 0 -10.399629 -5281.8873 + 40 218.69918 -10.427677 0 -10.399629 -4343.3636 + 50 189.12519 -10.423885 0 -10.399629 -2903.1138 + 60 155.55701 -10.419579 0 -10.399629 -1402.2278 + 70 118.83581 -10.414869 0 -10.399629 -146.36141 + 80 85.903126 -10.410645 0 -10.399628 857.74986 + 90 65.223651 -10.407993 0 -10.399628 1494.2746 + 100 59.833542 -10.407302 0 -10.399628 1938.9164 +Loop time of 11.0736 on 1 procs for 100 steps with 128 atoms + +Performance: 0.390 ns/day, 61.520 hours/ns, 9.030 timesteps/s +99.9% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 11.072 | 11.072 | 11.072 | 0.0 | 99.99 +Neigh | 0.00041604 | 0.00041604 | 0.00041604 | 0.0 | 0.00 +Comm | 0.00046253 | 0.00046253 | 0.00046253 | 0.0 | 0.00 +Output | 0.0001657 | 0.0001657 | 0.0001657 | 0.0 | 0.00 +Modify | 0.0002265 | 0.0002265 | 0.0002265 | 0.0 | 0.00 +Other | | 0.0003119 | | | 0.00 + +Nlocal: 128 ave 128 max 128 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 727 ave 727 max 727 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 3425 ave 3425 max 3425 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +FullNghs: 6850 ave 6850 max 6850 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 6850 +Ave neighs/atom = 53.5156 +Neighbor list builds = 1 +Dangerous builds = 0 + +Total wall time: 0:00:11 diff --git a/examples/snap/log.21Feb17.snap.hybrid.WSNAP.HePair.g++.4 b/examples/snap/log.21Feb17.snap.hybrid.WSNAP.HePair.g++.4 new file mode 100644 index 0000000000..9bcbd288aa --- /dev/null +++ b/examples/snap/log.21Feb17.snap.hybrid.WSNAP.HePair.g++.4 @@ -0,0 +1,179 @@ +LAMMPS (13 Feb 2017) +# Demonstrate SNAP Ta potential + +# Initialize simulation + +variable nsteps index 100 +variable nrep equal 4 +variable a equal 3.1803 +units metal + +# generate the box and atom positions using a BCC lattice + +variable nx equal ${nrep} +variable nx equal 4 +variable ny equal ${nrep} +variable ny equal 4 +variable nz equal ${nrep} +variable nz equal 4 + +boundary p p p + +lattice bcc $a +lattice bcc 3.1803 +Lattice spacing in x,y,z = 3.1803 3.1803 3.1803 +region box block 0 ${nx} 0 ${ny} 0 ${nz} +region box block 0 4 0 ${ny} 0 ${nz} +region box block 0 4 0 4 0 ${nz} +region box block 0 4 0 4 0 4 +create_box 2 box +Created orthogonal box = (0 0 0) to (12.7212 12.7212 12.7212) + 1 by 2 by 2 MPI processor grid +create_atoms 1 box +Created 128 atoms +mass 1 183.84 +mass 2 4.0026 + +set group all type/fraction 2 0.05 3590153 # Change 5% of W to He + 5 settings made for type/fraction +group tungsten type 1 +123 atoms in group tungsten +group helium type 2 +5 atoms in group helium +# choose potential + +include W.SNAP_HePair.pot +# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. to appear in arxiv Feb2017, W-He and He-He from Juslin, N. and Wirth, B. D. Journal of Nuclear Materials, 423, (2013) p61-63 +# +# Definition of SNAP+ZBL+Tabulated potential. +variable zblcutinner equal 4 +variable zblcutouter equal 4.8 +variable zblz equal 74 + +# Specify hybrid with SNAP, ZBL, and long-range Coulomb + +pair_style hybrid/overlay zbl ${zblcutinner} ${zblcutouter} snap table spline 10000 table spline 10000 +pair_style hybrid/overlay zbl 4 ${zblcutouter} snap table spline 10000 table spline 10000 +pair_style hybrid/overlay zbl 4 4.8 snap table spline 10000 table spline 10000 +pair_coeff 1 1 zbl ${zblz} ${zblz} +pair_coeff 1 1 zbl 74 ${zblz} +pair_coeff 1 1 zbl 74 74 +pair_coeff * * snap W_2940_2017_2.snapcoeff W W_2940_2017_2.snapparam W NULL +Reading potential file W_2940_2017_2.snapcoeff with DATE: 2017-02-20 +SNAP Element = W, Radius 0.5, Weight 1 +Reading potential file W_2940_2017_2.snapparam with DATE: 2017-02-20 +SNAP keyword rcutfac 4.73442 +SNAP keyword twojmax 8 +SNAP keyword gamma 1 +SNAP keyword rfac0 0.99363 +SNAP keyword rmin0 0 +SNAP keyword diagonalstyle 3 +pair_coeff 2 2 table 1 He_He_JW2013.table HeHe +Reading potential file He_He_JW2013.table with DATE: 2017-02-20 +WARNING: 1 of 4999 force values in table are inconsistent with -dE/dr. + Should only be flagged at inflection points (../pair_table.cpp:476) +pair_coeff 1 2 table 2 W_He_JW2013.table WHe +Reading potential file W_He_JW2013.table with DATE: 2017-02-20 +WARNING: 3 of 325 force values in table are inconsistent with -dE/dr. + Should only be flagged at inflection points (../pair_table.cpp:476) +#Hybrid/overlay will take all pair styles and add their contributions equally, order of pair_coeff doesnt matter here +#This is not the case for pair_style hybrid ... where only one pair_coeff is read for each type combination, order matters here. + + +# Setup output + +thermo 10 +thermo_modify norm yes + +# Set up NVE run + +timestep 0.5e-3 +neighbor 1.0 bin +neigh_modify once no every 1 delay 0 check yes + +# Run MD + +velocity all create 300.0 4928459 +fix 1 all nve +run ${nsteps} +run 100 +Neighbor list info ... + update every 1 steps, delay 0 steps, check yes + max neighbors/atom: 2000, page size: 100000 + master list distance cutoff = 5.8 + ghost atom cutoff = 5.8 + binsize = 2.9, bins = 5 5 5 + 6 neighbor lists, perpetual/occasional/extra = 6 0 0 + (1) pair zbl, perpetual, half/full from (2) + attributes: half, newton on + pair build: halffull/newton/skip + stencil: none + bin: none + (2) pair snap, perpetual, skip from (6) + attributes: full, newton on + pair build: skip + stencil: none + bin: none + (3) pair table, perpetual, skip from (5) + attributes: half, newton on + pair build: skip + stencil: none + bin: none + (4) pair table, perpetual, skip from (5) + attributes: half, newton on + pair build: skip + stencil: none + bin: none + (5) neighbor class addition, perpetual, half/full from (6) + attributes: half, newton on + pair build: halffull/newton + stencil: none + bin: none + (6) neighbor class addition, perpetual + attributes: full, newton on + pair build: full/bin/atomonly + stencil: full/bin/3d + bin: standard +Memory usage per processor = 7.65426 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 300 -10.438105 0 -10.39963 -5445.2808 + 10 292.13979 -10.437097 0 -10.39963 -5516.3963 + 20 272.55728 -10.434585 0 -10.399629 -5460.4268 + 30 245.06559 -10.431059 0 -10.399629 -5016.6351 + 40 212.79459 -10.42692 0 -10.399629 -3924.2175 + 50 178.03903 -10.422462 0 -10.399629 -2354.5485 + 60 141.62155 -10.417791 0 -10.399628 -595.41345 + 70 107.24843 -10.413383 0 -10.399628 1138.4107 + 80 79.985938 -10.409886 0 -10.399628 2392.1106 + 90 62.568933 -10.407652 0 -10.399628 3141.7027 + 100 56.697933 -10.406899 0 -10.399628 3583.9538 +Loop time of 2.8757 on 4 procs for 100 steps with 128 atoms + +Performance: 1.502 ns/day, 15.976 hours/ns, 34.774 timesteps/s +99.9% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 2.7363 | 2.8122 | 2.8636 | 2.9 | 97.79 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.011014 | 0.062439 | 0.13842 | 19.3 | 2.17 +Output | 0.00023842 | 0.00025076 | 0.0002861 | 0.0 | 0.01 +Modify | 9.2506e-05 | 9.9301e-05 | 0.00010395 | 0.0 | 0.00 +Other | | 0.0006654 | | | 0.02 + +Nlocal: 32 ave 32 max 32 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +Nghost: 431 ave 431 max 431 min +Histogram: 4 0 0 0 0 0 0 0 0 0 +Neighs: 856.25 ave 885 max 818 min +Histogram: 1 0 0 0 1 0 0 0 1 1 +FullNghs: 1712.5 ave 1738 max 1658 min +Histogram: 1 0 0 0 0 0 0 0 2 1 + +Total # of neighbors = 6850 +Ave neighs/atom = 53.5156 +Neighbor list builds = 0 +Dangerous builds = 0 + +Total wall time: 0:00:02 diff --git a/examples/snap/log.5Oct16.snap.g++.1 b/examples/snap/log.5Oct16.snap.Ta06A.g++.1 similarity index 100% rename from examples/snap/log.5Oct16.snap.g++.1 rename to examples/snap/log.5Oct16.snap.Ta06A.g++.1 diff --git a/examples/snap/log.5Oct16.snap.g++.4 b/examples/snap/log.5Oct16.snap.Ta06A.g++.4 similarity index 100% rename from examples/snap/log.5Oct16.snap.g++.4 rename to examples/snap/log.5Oct16.snap.Ta06A.g++.4 diff --git a/lib/kokkos/CHANGELOG.md b/lib/kokkos/CHANGELOG.md index a444f08eed..4a96e24418 100644 --- a/lib/kokkos/CHANGELOG.md +++ b/lib/kokkos/CHANGELOG.md @@ -1,5 +1,27 @@ # Change Log +## [2.02.15](https://github.com/kokkos/kokkos/tree/2.02.15) (2017-02-10) +[Full Changelog](https://github.com/kokkos/kokkos/compare/2.02.07...2.02.15) + +**Implemented enhancements:** + +- Containers: Adding block partitioning to StaticCrsGraph [\#625](https://github.com/kokkos/kokkos/issues/625) +- Kokkos Make System can induce Errors on Cray Volta System [\#610](https://github.com/kokkos/kokkos/issues/610) +- OpenMP: error out if KOKKOS\_HAVE\_OPENMP is defined but not \_OPENMP [\#605](https://github.com/kokkos/kokkos/issues/605) +- CMake: fix standalone build with tests [\#604](https://github.com/kokkos/kokkos/issues/604) +- Change README \(that GitHub shows when opening Kokkos project page\) to tell users how to submit PRs [\#597](https://github.com/kokkos/kokkos/issues/597) +- Add correctness testing for all operators of Atomic View [\#420](https://github.com/kokkos/kokkos/issues/420) +- Allow assignment of Views with compatible memory spaces [\#290](https://github.com/kokkos/kokkos/issues/290) +- Build only one version of Kokkos library for tests [\#213](https://github.com/kokkos/kokkos/issues/213) +- Clean out old KOKKOS\_HAVE\_CXX11 macros clauses [\#156](https://github.com/kokkos/kokkos/issues/156) +- Harmonize Macro names [\#150](https://github.com/kokkos/kokkos/issues/150) + +**Fixed bugs:** + +- Cray and PGI: Kokkos\_Parallel\_Reduce [\#634](https://github.com/kokkos/kokkos/issues/634) +- Kokkos Make System can induce Errors on Cray Volta System [\#610](https://github.com/kokkos/kokkos/issues/610) +- Normal\(\) function random number generator doesn't give the expected distribution [\#592](https://github.com/kokkos/kokkos/issues/592) + ## [2.02.07](https://github.com/kokkos/kokkos/tree/2.02.07) (2016-12-16) [Full Changelog](https://github.com/kokkos/kokkos/compare/2.02.01...2.02.07) diff --git a/lib/kokkos/CMakeLists.txt b/lib/kokkos/CMakeLists.txt index 2b2b9be6aa..16854c839a 100644 --- a/lib/kokkos/CMakeLists.txt +++ b/lib/kokkos/CMakeLists.txt @@ -1,4 +1,3 @@ - IF(COMMAND TRIBITS_PACKAGE_DECL) SET(KOKKOS_HAS_TRILINOS ON CACHE BOOL "") ELSE() @@ -8,6 +7,7 @@ ENDIF() IF(NOT KOKKOS_HAS_TRILINOS) CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11 FATAL_ERROR) INCLUDE(cmake/tribits.cmake) + SET(CMAKE_CXX_STANDARD 11) ENDIF() # diff --git a/lib/kokkos/LICENSE b/lib/kokkos/LICENSE index 05980758fa..7341a699d6 100644 --- a/lib/kokkos/LICENSE +++ b/lib/kokkos/LICENSE @@ -6,6 +6,8 @@ // // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, // the U.S. Government retains certain rights in this software. +// +// Kokkos is licensed under 3-clause BSD terms of use: // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are diff --git a/lib/kokkos/Makefile.kokkos b/lib/kokkos/Makefile.kokkos index 038c252cf0..9d00c19027 100644 --- a/lib/kokkos/Makefile.kokkos +++ b/lib/kokkos/Makefile.kokkos @@ -7,7 +7,7 @@ CXXFLAGS=$(CCFLAGS) #Options: OpenMP,Serial,Pthreads,Cuda KOKKOS_DEVICES ?= "OpenMP" #KOKKOS_DEVICES ?= "Pthreads" -#Options: KNC,SNB,HSW,Kepler,Kepler30,Kepler32,Kepler35,Kepler37,Maxwell,Maxwell50,Maxwell52,Maxwell53,Pascal61,ARMv80,ARMv81,ARMv8-ThunderX,BGQ,Power7,Power8,KNL,BDW,SKX +#Options: KNC,SNB,HSW,Kepler,Kepler30,Kepler32,Kepler35,Kepler37,Maxwell,Maxwell50,Maxwell52,Maxwell53,Pascal61,ARMv80,ARMv81,ARMv8-ThunderX,BGQ,Power7,Power8,Power9,KNL,BDW,SKX KOKKOS_ARCH ?= "" #Options: yes,no KOKKOS_DEBUG ?= "no" @@ -192,7 +192,8 @@ KOKKOS_INTERNAL_USE_ARCH_ARMV8_THUNDERX := $(strip $(shell echo $(KOKKOS_ARCH) | KOKKOS_INTERNAL_USE_ARCH_BGQ := $(strip $(shell echo $(KOKKOS_ARCH) | grep BGQ | wc -l)) KOKKOS_INTERNAL_USE_ARCH_POWER7 := $(strip $(shell echo $(KOKKOS_ARCH) | grep Power7 | wc -l)) KOKKOS_INTERNAL_USE_ARCH_POWER8 := $(strip $(shell echo $(KOKKOS_ARCH) | grep Power8 | wc -l)) -KOKKOS_INTERNAL_USE_ARCH_IBM := $(strip $(shell echo $(KOKKOS_INTERNAL_USE_ARCH_BGQ)+$(KOKKOS_INTERNAL_USE_ARCH_POWER7)+$(KOKKOS_INTERNAL_USE_ARCH_POWER8) | bc)) +KOKKOS_INTERNAL_USE_ARCH_POWER9 := $(strip $(shell echo $(KOKKOS_ARCH) | grep Power9 | wc -l)) +KOKKOS_INTERNAL_USE_ARCH_IBM := $(strip $(shell echo $(KOKKOS_INTERNAL_USE_ARCH_BGQ)+$(KOKKOS_INTERNAL_USE_ARCH_POWER7)+$(KOKKOS_INTERNAL_USE_ARCH_POWER8)+$(KOKKOS_INTERNAL_USE_ARCH_POWER9) | bc)) #AMD based KOKKOS_INTERNAL_USE_ARCH_AMDAVX := $(strip $(shell echo $(KOKKOS_ARCH) | grep AMDAVX | wc -l)) @@ -206,7 +207,7 @@ KOKKOS_INTERNAL_USE_ARCH_AVX512XEON := $(strip $(shell echo $(KOKKOS_INTERNAL_US # Decide what ISA level we are able to support KOKKOS_INTERNAL_USE_ISA_X86_64 := $(strip $(shell echo $(KOKKOS_INTERNAL_USE_ARCH_SNB)+$(KOKKOS_INTERNAL_USE_ARCH_HSW)+$(KOKKOS_INTERNAL_USE_ARCH_BDW)+$(KOKKOS_INTERNAL_USE_ARCH_KNL)+$(KOKKOS_INTERNAL_USE_ARCH_SKX) | bc )) KOKKOS_INTERNAL_USE_ISA_KNC := $(strip $(shell echo $(KOKKOS_INTERNAL_USE_ARCH_KNC) | bc )) -KOKKOS_INTERNAL_USE_ISA_POWERPCLE := $(strip $(shell echo $(KOKKOS_INTERNAL_USE_ARCH_POWER8) | bc )) +KOKKOS_INTERNAL_USE_ISA_POWERPCLE := $(strip $(shell echo $(KOKKOS_INTERNAL_USE_ARCH_POWER8)+$(KOKKOS_INTERNAL_USE_ARCH_POWER9) | bc )) #Incompatible flags? KOKKOS_INTERNAL_USE_ARCH_MULTIHOST := $(strip $(shell echo "$(KOKKOS_INTERNAL_USE_ARCH_AVX)+$(KOKKOS_INTERNAL_USE_ARCH_AVX2)+$(KOKKOS_INTERNAL_USE_ARCH_KNC)+$(KOKKOS_INTERNAL_USE_ARCH_IBM)+$(KOKKOS_INTERNAL_USE_ARCH_AMDAVX)+$(KOKKOS_INTERNAL_USE_ARCH_ARMV80)+$(KOKKOS_INTERNAL_USE_ARCH_ARMV81)+$(KOKKOS_INTERNAL_USE_ARCH_ARMV8_THUNDERX)>1" | bc )) @@ -453,6 +454,17 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_POWER8), 1) endif endif +ifeq ($(KOKKOS_INTERNAL_USE_ARCH_POWER9), 1) + tmp := $(shell echo "\#define KOKKOS_ARCH_POWER9 1" >> KokkosCore_config.tmp ) + ifeq ($(KOKKOS_INTERNAL_COMPILER_PGI), 1) + + else + # Assume that this is a really a GNU compiler or it could be XL on P9 + KOKKOS_CXXFLAGS += -mcpu=power9 -mtune=power9 + KOKKOS_LDFLAGS += -mcpu=power9 -mtune=power9 + endif +endif + ifeq ($(KOKKOS_INTERNAL_USE_ARCH_AVX2), 1) tmp := $(shell echo "\#define KOKKOS_ARCH_AVX2 1" >> KokkosCore_config.tmp ) ifeq ($(KOKKOS_INTERNAL_COMPILER_INTEL), 1) diff --git a/lib/kokkos/README b/lib/kokkos/README index ffc1fe53b5..7ebde23a1f 100644 --- a/lib/kokkos/README +++ b/lib/kokkos/README @@ -5,6 +5,9 @@ Kokkos is designed to target complex node architectures with N-level memory hierarchies and multiple types of execution resources. It currently can use OpenMP, Pthreads and CUDA as backend programming models. +Kokkos is licensed under standard 3-clause BSD terms of use. For specifics +see the LICENSE file contained in the repository or distribution. + The core developers of Kokkos are Carter Edwards and Christian Trott at the Computer Science Research Institute of the Sandia National Laboratories. @@ -151,4 +154,12 @@ MPI rank of an application uses a single GPU [can be the same GPU for multiple MPI ranks]) you can set CUDA_MANAGED_FORCE_DEVICE_ALLOC=1. This will enforce proper UVM allocations, but can lead to errors if more than a single GPU is used by a single process. - + +=========================================================================== +====Contributing=========================================================== +=========================================================================== + +Contributions to Kokkos are welcome. In order to do so, please open an issue +where a feature request or bug can be discussed. Then issue a pull request +with your contribution. Pull requests must be issued against the develop branch. + diff --git a/lib/kokkos/algorithms/src/Kokkos_Random.hpp b/lib/kokkos/algorithms/src/Kokkos_Random.hpp index 78cddeeaec..d376173bf1 100644 --- a/lib/kokkos/algorithms/src/Kokkos_Random.hpp +++ b/lib/kokkos/algorithms/src/Kokkos_Random.hpp @@ -1014,7 +1014,7 @@ namespace Kokkos { } }; -#if defined(KOKKOS_HAVE_CUDA) && defined(__CUDACC__) +#if defined(KOKKOS_ENABLE_CUDA) && defined(__CUDACC__) template<> class Random_XorShift1024 { diff --git a/lib/kokkos/algorithms/unit_tests/TestCuda.cpp b/lib/kokkos/algorithms/unit_tests/TestCuda.cpp index d19c778c46..ba3938f497 100644 --- a/lib/kokkos/algorithms/unit_tests/TestCuda.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestCuda.cpp @@ -49,7 +49,7 @@ #include -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA #include #include @@ -106,5 +106,5 @@ CUDA_SORT_UNSIGNED(171) #undef CUDA_SORT_UNSIGNED } -#endif /* #ifdef KOKKOS_HAVE_CUDA */ +#endif /* #ifdef KOKKOS_ENABLE_CUDA */ diff --git a/lib/kokkos/algorithms/unit_tests/TestOpenMP.cpp b/lib/kokkos/algorithms/unit_tests/TestOpenMP.cpp index 4b06dffcb6..f4d582d0bb 100644 --- a/lib/kokkos/algorithms/unit_tests/TestOpenMP.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestOpenMP.cpp @@ -52,7 +52,7 @@ namespace Test { -#ifdef KOKKOS_HAVE_OPENMP +#ifdef KOKKOS_ENABLE_OPENMP class openmp : public ::testing::Test { protected: static void SetUpTestCase() diff --git a/lib/kokkos/algorithms/unit_tests/TestSerial.cpp b/lib/kokkos/algorithms/unit_tests/TestSerial.cpp index 741cf97ae1..6ac80cf73a 100644 --- a/lib/kokkos/algorithms/unit_tests/TestSerial.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestSerial.cpp @@ -55,7 +55,7 @@ namespace Test { -#ifdef KOKKOS_HAVE_SERIAL +#ifdef KOKKOS_ENABLE_SERIAL class serial : public ::testing::Test { protected: static void SetUpTestCase() @@ -93,7 +93,7 @@ SERIAL_SORT_UNSIGNED(171) #undef SERIAL_RANDOM_XORSHIFT1024 #undef SERIAL_SORT_UNSIGNED -#endif // KOKKOS_HAVE_SERIAL +#endif // KOKKOS_ENABLE_SERIAL } // namespace Test diff --git a/lib/kokkos/algorithms/unit_tests/TestThreads.cpp b/lib/kokkos/algorithms/unit_tests/TestThreads.cpp index a61d6c8bd5..36d438b643 100644 --- a/lib/kokkos/algorithms/unit_tests/TestThreads.cpp +++ b/lib/kokkos/algorithms/unit_tests/TestThreads.cpp @@ -55,7 +55,7 @@ namespace Test { -#ifdef KOKKOS_HAVE_PTHREAD +#ifdef KOKKOS_ENABLE_PTHREAD class threads : public ::testing::Test { protected: static void SetUpTestCase() diff --git a/lib/kokkos/cmake/tribits.cmake b/lib/kokkos/cmake/tribits.cmake index 879d801720..0f00f1dd2e 100644 --- a/lib/kokkos/cmake/tribits.cmake +++ b/lib/kokkos/cmake/tribits.cmake @@ -4,13 +4,31 @@ INCLUDE(CTest) cmake_policy(SET CMP0054 NEW) IF(NOT DEFINED ${PROJECT_NAME}) - project(Kokkos) + project(KokkosCMake) ENDIF() -IF(NOT DEFINED ${${PROJECT_NAME}_ENABLE_DEBUG}}) +MESSAGE(WARNING "The project name is: ${PROJECT_NAME}") + +IF(NOT DEFINED ${PROJECT_NAME}_ENABLE_OpenMP) + SET(${PROJECT_NAME}_ENABLE_OpenMP OFF) +ENDIF() + +IF(NOT DEFINED ${PROJECT_NAME}_ENABLE_DEBUG) SET(${PROJECT_NAME}_ENABLE_DEBUG OFF) ENDIF() +IF(NOT DEFINED ${PROJECT_NAME}_ENABLE_CXX11) + SET(${PROJECT_NAME}_ENABLE_CXX11 ON) +ENDIF() + +IF(NOT DEFINED ${PROJECT_NAME}_ENABLE_TESTS) + SET(${PROJECT_NAME}_ENABLE_TESTS OFF) +ENDIF() + +IF(NOT DEFINED TPL_ENABLE_Pthread) + SET(TPL_ENABLE_Pthread OFF) +ENDIF() + FUNCTION(ASSERT_DEFINED VARS) FOREACH(VAR ${VARS}) IF(NOT DEFINED ${VAR}) @@ -70,9 +88,11 @@ ENDMACRO() MACRO(TRIBITS_ADD_TEST_DIRECTORIES) - FOREACH(TEST_DIR ${ARGN}) - ADD_SUBDIRECTORY(${TEST_DIR}) - ENDFOREACH() + IF(${${PROJECT_NAME}_ENABLE_TESTS}) + FOREACH(TEST_DIR ${ARGN}) + ADD_SUBDIRECTORY(${TEST_DIR}) + ENDFOREACH() + ENDIF() ENDMACRO() MACRO(TRIBITS_ADD_EXAMPLE_DIRECTORIES) @@ -264,11 +284,11 @@ FUNCTION(TRIBITS_ADD_EXECUTABLE EXE_NAME) SET(EXE_BINARY_NAME ${PACKAGE_NAME}_${EXE_BINARY_NAME}) ENDIF() - IF (PARSE_TESTONLY) - SET(EXCLUDE_FROM_ALL_KEYWORD "EXCLUDE_FROM_ALL") - ELSE() - SET(EXCLUDE_FROM_ALL_KEYWORD) - ENDIF() + # IF (PARSE_TESTONLY) + # SET(EXCLUDE_FROM_ALL_KEYWORD "EXCLUDE_FROM_ALL") + # ELSE() + # SET(EXCLUDE_FROM_ALL_KEYWORD) + # ENDIF() ADD_EXECUTABLE(${EXE_BINARY_NAME} ${EXCLUDE_FROM_ALL_KEYWORD} ${EXE_SOURCES}) TARGET_LINK_AND_INCLUDE_LIBRARIES(${EXE_BINARY_NAME} ${LINK_LIBS}) @@ -470,9 +490,8 @@ ENDMACRO(TRIBITS_SUBPACKAGE_POSTPROCESS) MACRO(TRIBITS_PACKAGE_DECL NAME) - PROJECT(${NAME}) - STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC) - SET(PACKAGE_NAME ${PROJECT_NAME}) + SET(PACKAGE_NAME ${NAME}) + SET(${PACKAGE_NAME}_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) STRING(TOUPPER ${PACKAGE_NAME} PACKAGE_NAME_UC) SET(TRIBITS_DEPS_DIR "${CMAKE_SOURCE_DIR}/cmake/deps") @@ -489,7 +508,7 @@ MACRO(TRIBITS_PROCESS_SUBPACKAGES) FOREACH(SUBPACKAGE ${SUBPACKAGES}) GET_FILENAME_COMPONENT(SUBPACKAGE_CMAKE ${SUBPACKAGE} DIRECTORY) GET_FILENAME_COMPONENT(SUBPACKAGE_DIR ${SUBPACKAGE_CMAKE} DIRECTORY) - ADD_SUBDIRECTORY(${SUBPACKAGE_DIR}) + ADD_SUBDIRECTORY(${CMAKE_BINARY_DIR}/../${SUBPACKAGE_DIR}) ENDFOREACH() ENDMACRO(TRIBITS_PROCESS_SUBPACKAGES) diff --git a/lib/kokkos/config/master_history.txt b/lib/kokkos/config/master_history.txt index 78c512ccea..446cbb0216 100644 --- a/lib/kokkos/config/master_history.txt +++ b/lib/kokkos/config/master_history.txt @@ -4,3 +4,4 @@ tag: 2.01.10 date: 09:27:2016 master: e4119325 develop: e6cda11e tag: 2.02.00 date: 10:30:2016 master: 6c90a581 develop: ca3dd56e tag: 2.02.01 date: 11:01:2016 master: 9c698c86 develop: b0072304 tag: 2.02.07 date: 12:16:2016 master: 4b4cc4ba develop: 382c0966 +tag: 2.02.15 date: 02:10:2017 master: 8c64cd93 develop: 28dea8b6 diff --git a/lib/kokkos/config/test_all_sandia b/lib/kokkos/config/test_all_sandia index 21b8bbff65..2c15e951ba 100755 --- a/lib/kokkos/config/test_all_sandia +++ b/lib/kokkos/config/test_all_sandia @@ -10,12 +10,18 @@ set -o pipefail MACHINE="" HOSTNAME=$(hostname) +PROCESSOR=`uname -p` + if [[ "$HOSTNAME" =~ (white|ride).* ]]; then MACHINE=white elif [[ "$HOSTNAME" =~ .*bowman.* ]]; then MACHINE=bowman elif [[ "$HOSTNAME" =~ node.* ]]; then # Warning: very generic name - MACHINE=shepard + if [[ "$PROCESSOR" = "aarch64" ]]; then + MACHINE=sullivan + else + MACHINE=shepard + fi elif [[ "$HOSTNAME" =~ apollo ]]; then MACHINE=apollo elif [ ! -z "$SEMS_MODULEFILES_ROOT" ]; then @@ -27,6 +33,7 @@ fi GCC_BUILD_LIST="OpenMP,Pthread,Serial,OpenMP_Serial,Pthread_Serial" IBM_BUILD_LIST="OpenMP,Serial,OpenMP_Serial" +ARM_GCC_BUILD_LIST="OpenMP,Serial,OpenMP_Serial" INTEL_BUILD_LIST="OpenMP,Pthread,Serial,OpenMP_Serial,Pthread_Serial" CLANG_BUILD_LIST="Pthread,Serial,Pthread_Serial" CUDA_BUILD_LIST="Cuda_OpenMP,Cuda_Pthread,Cuda_Serial" @@ -200,6 +207,23 @@ elif [ "$MACHINE" = "bowman" ]; then if [ -z "$ARCH_FLAG" ]; then ARCH_FLAG="--arch=KNL" fi + + NUM_JOBS_TO_RUN_IN_PARALLEL=2 + +elif [ "$MACHINE" = "sullivan" ]; then + source /etc/profile.d/modules.sh + SKIP_HWLOC=True + export SLURM_TASKS_PER_NODE=96 + + BASE_MODULE_LIST="/" + + # Format: (compiler module-list build-list exe-name warning-flag) + COMPILERS=("gcc/5.3.0 $BASE_MODULE_LIST $ARM_GCC_BUILD_LIST g++ $GCC_WARNING_FLAGS") + + if [ -z "$ARCH_FLAG" ]; then + ARCH_FLAG="--arch=ARMv8-ThunderX" + fi + NUM_JOBS_TO_RUN_IN_PARALLEL=2 elif [ "$MACHINE" = "shepard" ]; then @@ -297,7 +321,8 @@ echo " Defaults to root repo containing this script" echo "--debug: Run tests in debug. Defaults to False" echo "--test-script: Test this script, not Kokkos" echo "--skip-hwloc: Do not do hwloc tests" -echo "--num=N: Number of jobs to run in parallel " +echo "--num=N: Number of jobs to run in parallel" +echo "--spot-check: Minimal test set to issue pull request" echo "--dry-run: Just print what would be executed" echo "--build-only: Just do builds, don't run anything" echo "--opt-flag=FLAG: Optimization flag (default: -O3)" diff --git a/lib/kokkos/config/test_kokkos_master_develop_promotion.sh b/lib/kokkos/config/test_kokkos_master_develop_promotion.sh new file mode 100755 index 0000000000..048f48194c --- /dev/null +++ b/lib/kokkos/config/test_kokkos_master_develop_promotion.sh @@ -0,0 +1,66 @@ +#!/bin/bash + +. /etc/profile.d/modules.sh + +echo "build-dir $1" +echo "backend $2" +echo "module $3" +echo "compiler $4" +echo "cxxflags $5" +echo "architecrure $6" +echo "debug $7" +echo "kokkos-options $8" +echo "kokkos-cuda-options $9" +echo "hwloc $9" + +NOW=`date "+%Y%m%d%H%M%S"` +BASEDIR="$1-$NOW" + +mkdir $BASEDIR +cd $BASEDIR + +module load $2 + +if [ $9 == "yes" ]; then +if [ $7 == "debug" ]; then + ../generate_makefile.sh --with-devices=$2 \ + --compiler=$4 \ + --cxxflags=$5 \ + --arch=$6 \ + --debug \ + --with-options=$8 \ + --with-cuda-options=$9 + --with-hwloc=${HWLOC_ROOT} +else + ../generate_makefile.sh --with-devices=$2 \ + --compiler=$4 \ + --cxxflags=$5 \ + --arch=$6 \ + --debug \ + --with-options=$8 \ + --with-cuda-options=$9 + --with-hwloc=${HWLOC_ROOT} +fi +else +if [ $7 == "debug" ]; then + ../generate_makefile.sh --with-devices=$2 \ + --compiler=$4 \ + --cxxflags=$5 \ + --arch=$6 \ + --debug \ + --with-options=$8 \ + --with-cuda-options=$9 +else + ../generate_makefile.sh --with-devices=$2 \ + --compiler=$4 \ + --cxxflags=$5 \ + --arch=$6 \ + --debug \ + --with-options=$8 \ + --with-cuda-options=$9 +fi +fi + + +make test +return $? diff --git a/lib/kokkos/config/trilinos-integration/prepare_trilinos_repos.sh b/lib/kokkos/config/trilinos-integration/prepare_trilinos_repos.sh index d2a7a533d5..2692f76038 100755 --- a/lib/kokkos/config/trilinos-integration/prepare_trilinos_repos.sh +++ b/lib/kokkos/config/trilinos-integration/prepare_trilinos_repos.sh @@ -27,13 +27,13 @@ cd ${TRILINOS_UPDATED_PATH} echo "" echo "" echo "Trilinos State:" -git log --pretty=oneline --since=2.days -SHA=`git log --pretty=oneline --since=2.days | head -n 2 | tail -n 1 | awk '{print $1}'` +git log --pretty=oneline --since=7.days +SHA=`git log --pretty=oneline --since=7.days | head -n 2 | tail -n 1 | awk '{print $1}'` cd .. cd ${TRILINOS_PRISTINE_PATH} git status -git log --pretty=oneline --since=2.days +git log --pretty=oneline --since=7.days echo "Checkout develop" git checkout develop echo "Pull" @@ -46,5 +46,5 @@ cd ${TRILINOS_PRISTINE_PATH} echo "" echo "" echo "Trilinos Pristine State:" -git log --pretty=oneline --since=2.days +git log --pretty=oneline --since=7.days cd .. diff --git a/lib/kokkos/containers/performance_tests/TestCuda.cpp b/lib/kokkos/containers/performance_tests/TestCuda.cpp index e7afad905b..d5cad06a47 100644 --- a/lib/kokkos/containers/performance_tests/TestCuda.cpp +++ b/lib/kokkos/containers/performance_tests/TestCuda.cpp @@ -52,7 +52,7 @@ #include -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) #include @@ -106,4 +106,4 @@ TEST_F( cuda, unordered_map_performance_far) } -#endif /* #if defined( KOKKOS_HAVE_CUDA ) */ +#endif /* #if defined( KOKKOS_ENABLE_CUDA ) */ diff --git a/lib/kokkos/containers/performance_tests/TestUnorderedMapPerformance.hpp b/lib/kokkos/containers/performance_tests/TestUnorderedMapPerformance.hpp index 71d1182cbe..93a206c996 100644 --- a/lib/kokkos/containers/performance_tests/TestUnorderedMapPerformance.hpp +++ b/lib/kokkos/containers/performance_tests/TestUnorderedMapPerformance.hpp @@ -1,12 +1,12 @@ //@HEADER // ************************************************************************ -// +// // Kokkos v. 2.0 // Copyright (2014) Sandia Corporation -// +// // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, // the U.S. Government retains certain rights in this software. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -35,7 +35,7 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) -// +// // ************************************************************************ //@HEADER @@ -164,12 +164,10 @@ struct UnorderedMapTest }; -//#define KOKKOS_COLLECT_UNORDERED_MAP_METRICS - template void run_performance_tests(std::string const & base_file_name) { -#if defined(KOKKOS_COLLECT_UNORDERED_MAP_METRICS) +#if 0 std::string metrics_file_name = base_file_name + std::string("-metrics.csv"); std::string length_file_name = base_file_name + std::string("-length.csv"); std::string distance_file_name = base_file_name + std::string("-distance.csv"); diff --git a/lib/kokkos/containers/src/Kokkos_DynRankView.hpp b/lib/kokkos/containers/src/Kokkos_DynRankView.hpp index 1ac92b9d17..acb37f7f75 100644 --- a/lib/kokkos/containers/src/Kokkos_DynRankView.hpp +++ b/lib/kokkos/containers/src/Kokkos_DynRankView.hpp @@ -586,13 +586,13 @@ private: #if defined( KOKKOS_ENABLE_DEBUG_BOUNDS_CHECK ) // rank of the calling operator - included as first argument in ARG -#define KOKKOS_VIEW_OPERATOR_VERIFY( ARG ) \ +#define KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( ARG ) \ DynRankView::template verify_space< Kokkos::Impl::ActiveExecutionMemorySpace >::check(); \ Kokkos::Experimental::Impl::dyn_rank_view_verify_operator_bounds ARG ; #else -#define KOKKOS_VIEW_OPERATOR_VERIFY( ARG ) \ +#define KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( ARG ) \ DynRankView::template verify_space< Kokkos::Impl::ActiveExecutionMemorySpace >::check(); #endif @@ -609,9 +609,9 @@ public: reference_type operator()() const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (0 , this->rank() , NULL , m_map) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (0 , this->rank() , NULL , m_map) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (0 , this->rank() , m_track.template get_label().c_str(),m_map) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (0 , this->rank() , m_track.template get_label().c_str(),m_map) ) #endif return implementation_map().reference(); //return m_map.reference(0,0,0,0,0,0,0); @@ -650,9 +650,9 @@ public: operator()(const iType & i0 ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (1 , this->rank() , NULL , m_map , i0) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (1 , this->rank() , NULL , m_map , i0) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (1 , this->rank() , m_track.template get_label().c_str(),m_map,i0) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (1 , this->rank() , m_track.template get_label().c_str(),m_map,i0) ) #endif return m_map.reference(i0); } @@ -663,9 +663,9 @@ public: operator()(const iType & i0 ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (1 , this->rank() , NULL , m_map , i0) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (1 , this->rank() , NULL , m_map , i0) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (1 , this->rank() , m_track.template get_label().c_str(),m_map,i0) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (1 , this->rank() , m_track.template get_label().c_str(),m_map,i0) ) #endif return m_map.reference(i0,0,0,0,0,0,0); } @@ -677,9 +677,9 @@ public: operator()(const iType0 & i0 , const iType1 & i1 ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (2 , this->rank() , NULL , m_map , i0 , i1) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (2 , this->rank() , NULL , m_map , i0 , i1) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (2 , this->rank() , m_track.template get_label().c_str(),m_map,i0,i1) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (2 , this->rank() , m_track.template get_label().c_str(),m_map,i0,i1) ) #endif return m_map.reference(i0,i1); } @@ -690,9 +690,9 @@ public: operator()(const iType0 & i0 , const iType1 & i1 ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (2 , this->rank() , NULL , m_map , i0 , i1) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (2 , this->rank() , NULL , m_map , i0 , i1) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (2 , this->rank() , m_track.template get_label().c_str(),m_map,i0,i1) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (2 , this->rank() , m_track.template get_label().c_str(),m_map,i0,i1) ) #endif return m_map.reference(i0,i1,0,0,0,0,0); } @@ -704,9 +704,9 @@ public: operator()(const iType0 & i0 , const iType1 & i1 , const iType2 & i2 ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (3 , this->rank() , NULL , m_map , i0 , i1 , i2) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (3 , this->rank() , NULL , m_map , i0 , i1 , i2) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (3 , this->rank() , m_track.template get_label().c_str(),m_map,i0,i1,i2) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (3 , this->rank() , m_track.template get_label().c_str(),m_map,i0,i1,i2) ) #endif return m_map.reference(i0,i1,i2); } @@ -717,9 +717,9 @@ public: operator()(const iType0 & i0 , const iType1 & i1 , const iType2 & i2 ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (3 , this->rank() , NULL , m_map , i0 , i1 , i2) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (3 , this->rank() , NULL , m_map , i0 , i1 , i2) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (3 , this->rank() , m_track.template get_label().c_str(),m_map,i0,i1,i2) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (3 , this->rank() , m_track.template get_label().c_str(),m_map,i0,i1,i2) ) #endif return m_map.reference(i0,i1,i2,0,0,0,0); } @@ -731,9 +731,9 @@ public: operator()(const iType0 & i0 , const iType1 & i1 , const iType2 & i2 , const iType3 & i3 ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (4 , this->rank() , NULL , m_map , i0 , i1 , i2 , i3) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (4 , this->rank() , NULL , m_map , i0 , i1 , i2 , i3) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (4 , this->rank() , m_track.template get_label().c_str(),m_map,i0,i1,i2,i3) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (4 , this->rank() , m_track.template get_label().c_str(),m_map,i0,i1,i2,i3) ) #endif return m_map.reference(i0,i1,i2,i3); } @@ -744,9 +744,9 @@ public: operator()(const iType0 & i0 , const iType1 & i1 , const iType2 & i2 , const iType3 & i3 ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (4 , this->rank() , NULL , m_map , i0 , i1 , i2 , i3) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (4 , this->rank() , NULL , m_map , i0 , i1 , i2 , i3) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (4 , this->rank() , m_track.template get_label().c_str(),m_map,i0,i1,i2,i3) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (4 , this->rank() , m_track.template get_label().c_str(),m_map,i0,i1,i2,i3) ) #endif return m_map.reference(i0,i1,i2,i3,0,0,0); } @@ -758,9 +758,9 @@ public: operator()(const iType0 & i0 , const iType1 & i1 , const iType2 & i2 , const iType3 & i3 , const iType4 & i4 ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (5 , this->rank() , NULL , m_map , i0 , i1 , i2 , i3, i4) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (5 , this->rank() , NULL , m_map , i0 , i1 , i2 , i3, i4) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (5 , this->rank() , m_track.template get_label().c_str(),m_map,i0,i1,i2,i3,i4) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (5 , this->rank() , m_track.template get_label().c_str(),m_map,i0,i1,i2,i3,i4) ) #endif return m_map.reference(i0,i1,i2,i3,i4); } @@ -771,9 +771,9 @@ public: operator()(const iType0 & i0 , const iType1 & i1 , const iType2 & i2 , const iType3 & i3 , const iType4 & i4 ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (5 , this->rank() , NULL , m_map , i0 , i1 , i2 , i3, i4) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (5 , this->rank() , NULL , m_map , i0 , i1 , i2 , i3, i4) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (5 , this->rank() , m_track.template get_label().c_str(),m_map,i0,i1,i2,i3,i4) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (5 , this->rank() , m_track.template get_label().c_str(),m_map,i0,i1,i2,i3,i4) ) #endif return m_map.reference(i0,i1,i2,i3,i4,0,0); } @@ -785,9 +785,9 @@ public: operator()(const iType0 & i0 , const iType1 & i1 , const iType2 & i2 , const iType3 & i3 , const iType4 & i4 , const iType5 & i5 ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (6 , this->rank() , NULL , m_map , i0 , i1 , i2 , i3, i4 , i5) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (6 , this->rank() , NULL , m_map , i0 , i1 , i2 , i3, i4 , i5) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (6 , this->rank() , m_track.template get_label().c_str(),m_map,i0,i1,i2,i3,i4,i5) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (6 , this->rank() , m_track.template get_label().c_str(),m_map,i0,i1,i2,i3,i4,i5) ) #endif return m_map.reference(i0,i1,i2,i3,i4,i5); } @@ -798,9 +798,9 @@ public: operator()(const iType0 & i0 , const iType1 & i1 , const iType2 & i2 , const iType3 & i3 , const iType4 & i4 , const iType5 & i5 ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (6 , this->rank() , NULL , m_map , i0 , i1 , i2 , i3, i4 , i5) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (6 , this->rank() , NULL , m_map , i0 , i1 , i2 , i3, i4 , i5) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (6 , this->rank() , m_track.template get_label().c_str(),m_map,i0,i1,i2,i3,i4,i5) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (6 , this->rank() , m_track.template get_label().c_str(),m_map,i0,i1,i2,i3,i4,i5) ) #endif return m_map.reference(i0,i1,i2,i3,i4,i5,0); } @@ -812,14 +812,14 @@ public: operator()(const iType0 & i0 , const iType1 & i1 , const iType2 & i2 , const iType3 & i3 , const iType4 & i4 , const iType5 & i5 , const iType6 & i6 ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (7 , this->rank() , NULL , m_map , i0 , i1 , i2 , i3, i4 , i5 , i6) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (7 , this->rank() , NULL , m_map , i0 , i1 , i2 , i3, i4 , i5 , i6) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (7 , this->rank() , m_track.template get_label().c_str(),m_map,i0,i1,i2,i3,i4,i5,i6) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (7 , this->rank() , m_track.template get_label().c_str(),m_map,i0,i1,i2,i3,i4,i5,i6) ) #endif return m_map.reference(i0,i1,i2,i3,i4,i5,i6); } -#undef KOKKOS_VIEW_OPERATOR_VERIFY +#undef KOKKOS_IMPL_VIEW_OPERATOR_VERIFY //---------------------------------------- // Standard constructor, destructor, and assignment operators... @@ -960,7 +960,7 @@ public: alloc_prop prop( arg_prop ); //------------------------------------------------------------ -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) // If allocating in CudaUVMSpace must fence before and after // the allocation to protect against possible concurrent access // on the CPU and the GPU. @@ -976,7 +976,7 @@ public: record = m_map.allocate_shared( prop , Impl::DynRankDimTraits::createLayout(arg_layout) ); //------------------------------------------------------------ -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) if ( std::is_same< Kokkos::CudaUVMSpace , typename traits::device_type::memory_space >::value ) { traits::device_type::memory_space::execution_space::fence(); } diff --git a/lib/kokkos/containers/src/Kokkos_StaticCrsGraph.hpp b/lib/kokkos/containers/src/Kokkos_StaticCrsGraph.hpp index 1ce38638a2..0408472c68 100644 --- a/lib/kokkos/containers/src/Kokkos_StaticCrsGraph.hpp +++ b/lib/kokkos/containers/src/Kokkos_StaticCrsGraph.hpp @@ -51,6 +51,80 @@ namespace Kokkos { +namespace Impl { + template + struct StaticCrsGraphBalancerFunctor { + typedef typename RowOffsetsType::non_const_value_type int_type; + RowOffsetsType row_offsets; + RowBlockOffsetsType row_block_offsets; + + int_type cost_per_row, num_blocks; + + StaticCrsGraphBalancerFunctor(RowOffsetsType row_offsets_, + RowBlockOffsetsType row_block_offsets_, + int_type cost_per_row_, int_type num_blocks_): + row_offsets(row_offsets_), + row_block_offsets(row_block_offsets_), + cost_per_row(cost_per_row_), + num_blocks(num_blocks_){} + + KOKKOS_INLINE_FUNCTION + void operator() (const int_type& iRow) const { + const int_type num_rows = row_offsets.dimension_0()-1; + const int_type num_entries = row_offsets(num_rows); + const int_type total_cost = num_entries + num_rows*cost_per_row; + + const double cost_per_workset = 1.0*total_cost/num_blocks; + + const int_type row_cost = row_offsets(iRow+1)-row_offsets(iRow) + cost_per_row; + + int_type count = row_offsets(iRow+1) + cost_per_row*iRow; + + if(iRow == num_rows-1) row_block_offsets(num_blocks) = num_rows; + + if(true) { + int_type current_block = (count-row_cost-cost_per_row)/cost_per_workset; + int_type end_block = count/cost_per_workset; + + // Handle some corner cases for the last two blocks. + if(current_block >= num_blocks-2) { + if((current_block == num_blocks-2) && (count >= (current_block + 1) * cost_per_workset)) { + int_type row = iRow; + int_type cc = count-row_cost-cost_per_row; + int_type block = cc/cost_per_workset; + while((block>0) && (block==current_block)) { + cc = row_offsets(row)+row*cost_per_row; + block = cc/cost_per_workset; + row--; + } + if((count-cc-row_cost-cost_per_row) < num_entries-row_offsets(iRow+1)) { + row_block_offsets(current_block+1) = iRow+1; + } else { + row_block_offsets(current_block+1) = iRow; + } + } + } else { + if((count >= (current_block + 1) * cost_per_workset) || + (iRow+2 == row_offsets.dimension_0())) { + if(end_block>current_block+1) { + int_type num_block = end_block-current_block; + row_block_offsets(current_block+1) = iRow; + for(int_type block = current_block+2; block <= end_block; block++) + if((block HostMirror; typedef View< const size_type* , array_layout, device_type > row_map_type; typedef View< DataType* , array_layout, device_type > entries_type; + typedef View< const size_type* , array_layout, device_type > row_block_type; entries_type entries; row_map_type row_map; + row_block_type row_block_offsets; //! Construct an empty view. - StaticCrsGraph () : entries(), row_map() {} + StaticCrsGraph () : entries(), row_map(), row_block_offsets() {} //! Copy constructor (shallow copy). - StaticCrsGraph (const StaticCrsGraph& rhs) : entries (rhs.entries), row_map (rhs.row_map) + StaticCrsGraph (const StaticCrsGraph& rhs) : entries (rhs.entries), row_map (rhs.row_map), + row_block_offsets(rhs.row_block_offsets) {} template - StaticCrsGraph (const EntriesType& entries_,const RowMapType& row_map_) : entries (entries_), row_map (row_map_) + StaticCrsGraph (const EntriesType& entries_,const RowMapType& row_map_) : entries (entries_), row_map (row_map_), + row_block_offsets() {} /** \brief Assign to a view of the rhs array. @@ -122,6 +200,7 @@ public: StaticCrsGraph& operator= (const StaticCrsGraph& rhs) { entries = rhs.entries; row_map = rhs.row_map; + row_block_offsets = rhs.row_block_offsets; return *this; } @@ -130,12 +209,30 @@ public: */ ~StaticCrsGraph() {} + /** \brief Return number of rows in the graph + */ KOKKOS_INLINE_FUNCTION size_type numRows() const { return (row_map.dimension_0 () != 0) ? row_map.dimension_0 () - static_cast (1) : static_cast (0); } + + /** \brief Create a row partitioning into a given number of blocks + * balancing non-zeros + a fixed cost per row. + */ + void create_block_partitioning(size_type num_blocks, size_type fix_cost_per_row = 4) { + View< size_type* , array_layout, device_type > + block_offsets("StatisCrsGraph::load_balance_offsets",num_blocks+1); + + Impl::StaticCrsGraphBalancerFunctor > + partitioner(row_map,block_offsets,fix_cost_per_row,num_blocks); + + Kokkos::parallel_for(Kokkos::RangePolicy(0,numRows()),partitioner); + Kokkos::fence(); + + row_block_offsets = block_offsets; + } }; //---------------------------------------------------------------------------- diff --git a/lib/kokkos/containers/src/Kokkos_Vector.hpp b/lib/kokkos/containers/src/Kokkos_Vector.hpp index 6a360e8d19..362b6b46cf 100644 --- a/lib/kokkos/containers/src/Kokkos_Vector.hpp +++ b/lib/kokkos/containers/src/Kokkos_Vector.hpp @@ -72,7 +72,7 @@ private: public: -#ifdef KOKKOS_CUDA_USE_UVM +#ifdef KOKKOS_ENABLE_CUDA_UVM KOKKOS_INLINE_FUNCTION Scalar& operator() (int i) const {return DV::h_view(i);}; KOKKOS_INLINE_FUNCTION Scalar& operator[] (int i) const {return DV::h_view(i);}; #else diff --git a/lib/kokkos/containers/src/impl/Kokkos_Functional_impl.hpp b/lib/kokkos/containers/src/impl/Kokkos_Functional_impl.hpp index c87bb8a3a3..7d6020536a 100644 --- a/lib/kokkos/containers/src/impl/Kokkos_Functional_impl.hpp +++ b/lib/kokkos/containers/src/impl/Kokkos_Functional_impl.hpp @@ -133,11 +133,11 @@ uint32_t MurmurHash3_x86_32 ( const void * key, int len, uint32_t seed ) defined( __GNUG__ ) /* GNU C++ */ || \ defined( __clang__ ) -#define KOKKOS_MAY_ALIAS __attribute__((__may_alias__)) +#define KOKKOS_IMPL_MAY_ALIAS __attribute__((__may_alias__)) #else -#define KOKKOS_MAY_ALIAS +#define KOKKOS_IMPL_MAY_ALIAS #endif @@ -145,10 +145,10 @@ template KOKKOS_FORCEINLINE_FUNCTION bool bitwise_equal(T const * const a_ptr, T const * const b_ptr) { - typedef uint64_t KOKKOS_MAY_ALIAS T64; - typedef uint32_t KOKKOS_MAY_ALIAS T32; - typedef uint16_t KOKKOS_MAY_ALIAS T16; - typedef uint8_t KOKKOS_MAY_ALIAS T8; + typedef uint64_t KOKKOS_IMPL_MAY_ALIAS T64; + typedef uint32_t KOKKOS_IMPL_MAY_ALIAS T32; + typedef uint16_t KOKKOS_IMPL_MAY_ALIAS T16; + typedef uint8_t KOKKOS_IMPL_MAY_ALIAS T8; enum { NUM_8 = sizeof(T), @@ -188,7 +188,7 @@ bool bitwise_equal(T const * const a_ptr, T const * const b_ptr) -#undef KOKKOS_MAY_ALIAS +#undef KOKKOS_IMPL_MAY_ALIAS }} // namespace Kokkos::Impl diff --git a/lib/kokkos/containers/src/impl/Kokkos_StaticCrsGraph_factory.hpp b/lib/kokkos/containers/src/impl/Kokkos_StaticCrsGraph_factory.hpp index c52fc24359..5072180876 100644 --- a/lib/kokkos/containers/src/impl/Kokkos_StaticCrsGraph_factory.hpp +++ b/lib/kokkos/containers/src/impl/Kokkos_StaticCrsGraph_factory.hpp @@ -69,15 +69,17 @@ create_mirror( const StaticCrsGraph & view typename staticcrsgraph_type::HostMirror tmp ; typename staticcrsgraph_type::row_map_type::HostMirror tmp_row_map = create_mirror( view.row_map); + typename staticcrsgraph_type::row_block_type::HostMirror tmp_row_block_offsets = create_mirror( view.row_block_offsets); // Allocation to match: tmp.row_map = tmp_row_map ; // Assignment of 'const' from 'non-const' tmp.entries = create_mirror( view.entries ); - + tmp.row_block_offsets = tmp_row_block_offsets ; // Assignment of 'const' from 'non-const' // Deep copy: deep_copy( tmp_row_map , view.row_map ); deep_copy( tmp.entries , view.entries ); + deep_copy( tmp_row_block_offsets , view.row_block_offsets ); return tmp ; } diff --git a/lib/kokkos/containers/unit_tests/TestCuda.cpp b/lib/kokkos/containers/unit_tests/TestCuda.cpp index 6be38cd7a7..1ca06150ff 100644 --- a/lib/kokkos/containers/unit_tests/TestCuda.cpp +++ b/lib/kokkos/containers/unit_tests/TestCuda.cpp @@ -69,7 +69,7 @@ //---------------------------------------------------------------------------- -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA namespace Test { @@ -96,6 +96,18 @@ TEST_F( cuda , staticcrsgraph ) { TestStaticCrsGraph::run_test_graph< Kokkos::Cuda >(); TestStaticCrsGraph::run_test_graph2< Kokkos::Cuda >(); + TestStaticCrsGraph::run_test_graph3< Kokkos::Cuda >(1, 0); + TestStaticCrsGraph::run_test_graph3< Kokkos::Cuda >(1, 1000); + TestStaticCrsGraph::run_test_graph3< Kokkos::Cuda >(1, 10000); + TestStaticCrsGraph::run_test_graph3< Kokkos::Cuda >(1, 100000); + TestStaticCrsGraph::run_test_graph3< Kokkos::Cuda >(3, 0); + TestStaticCrsGraph::run_test_graph3< Kokkos::Cuda >(3, 1000); + TestStaticCrsGraph::run_test_graph3< Kokkos::Cuda >(3, 10000); + TestStaticCrsGraph::run_test_graph3< Kokkos::Cuda >(3, 100000); + TestStaticCrsGraph::run_test_graph3< Kokkos::Cuda >(75, 0); + TestStaticCrsGraph::run_test_graph3< Kokkos::Cuda >(75, 1000); + TestStaticCrsGraph::run_test_graph3< Kokkos::Cuda >(75, 10000); + TestStaticCrsGraph::run_test_graph3< Kokkos::Cuda >(75, 100000); } @@ -225,5 +237,5 @@ TEST_F(cuda, ErrorReporter) } -#endif /* #ifdef KOKKOS_HAVE_CUDA */ +#endif /* #ifdef KOKKOS_ENABLE_CUDA */ diff --git a/lib/kokkos/containers/unit_tests/TestDynViewAPI.hpp b/lib/kokkos/containers/unit_tests/TestDynViewAPI.hpp index d062778644..125b9b3287 100644 --- a/lib/kokkos/containers/unit_tests/TestDynViewAPI.hpp +++ b/lib/kokkos/containers/unit_tests/TestDynViewAPI.hpp @@ -1298,7 +1298,7 @@ public: // For CUDA the constant random access View does not return // an lvalue reference due to retrieving through texture cache // therefore not allowed to query the underlying pointer. -#if defined(KOKKOS_HAVE_CUDA) +#if defined(KOKKOS_ENABLE_CUDA) if ( ! std::is_same< typename device::execution_space , Kokkos::Cuda >::value ) #endif { @@ -1408,7 +1408,7 @@ public: ASSERT_EQ( ds5.dimension_4() , ds5plus.dimension_4() ); ASSERT_EQ( ds5.dimension_5() , ds5plus.dimension_5() ); -#if ! defined( KOKKOS_HAVE_CUDA ) || defined ( KOKKOS_USE_CUDA_UVM ) +#if ! defined( KOKKOS_ENABLE_CUDA ) || defined ( KOKKOS_ENABLE_CUDA_UVM ) ASSERT_EQ( & ds5(1,1,1,1,0) - & ds5plus(1,1,1,1,0) , 0 ); ASSERT_EQ( & ds5(1,1,1,1,0,0) - & ds5plus(1,1,1,1,0,0) , 0 ); // passing argument to rank beyond the view's rank is allowed iff it is a 0. #endif diff --git a/lib/kokkos/containers/unit_tests/TestErrorReporter.hpp b/lib/kokkos/containers/unit_tests/TestErrorReporter.hpp index c431b62a53..cc206b80f4 100644 --- a/lib/kokkos/containers/unit_tests/TestErrorReporter.hpp +++ b/lib/kokkos/containers/unit_tests/TestErrorReporter.hpp @@ -200,7 +200,7 @@ struct ErrorReporterDriverUseLambda : public ErrorReporterDriverBase #endif -#ifdef KOKKOS_HAVE_OPENMP +#ifdef KOKKOS_ENABLE_OPENMP struct ErrorReporterDriverNativeOpenMP : public ErrorReporterDriverBase { typedef ErrorReporterDriverBase driver_base; diff --git a/lib/kokkos/containers/unit_tests/TestOpenMP.cpp b/lib/kokkos/containers/unit_tests/TestOpenMP.cpp index 598a296c78..d96d0c667d 100644 --- a/lib/kokkos/containers/unit_tests/TestOpenMP.cpp +++ b/lib/kokkos/containers/unit_tests/TestOpenMP.cpp @@ -68,7 +68,7 @@ namespace Test { -#ifdef KOKKOS_HAVE_OPENMP +#ifdef KOKKOS_ENABLE_OPENMP class openmp : public ::testing::Test { protected: static void SetUpTestCase() @@ -109,6 +109,18 @@ TEST_F( openmp , staticcrsgraph ) { TestStaticCrsGraph::run_test_graph< Kokkos::OpenMP >(); TestStaticCrsGraph::run_test_graph2< Kokkos::OpenMP >(); + TestStaticCrsGraph::run_test_graph3< Kokkos::OpenMP >(1, 0); + TestStaticCrsGraph::run_test_graph3< Kokkos::OpenMP >(1, 1000); + TestStaticCrsGraph::run_test_graph3< Kokkos::OpenMP >(1, 10000); + TestStaticCrsGraph::run_test_graph3< Kokkos::OpenMP >(1, 100000); + TestStaticCrsGraph::run_test_graph3< Kokkos::OpenMP >(3, 0); + TestStaticCrsGraph::run_test_graph3< Kokkos::OpenMP >(3, 1000); + TestStaticCrsGraph::run_test_graph3< Kokkos::OpenMP >(3, 10000); + TestStaticCrsGraph::run_test_graph3< Kokkos::OpenMP >(3, 100000); + TestStaticCrsGraph::run_test_graph3< Kokkos::OpenMP >(75, 0); + TestStaticCrsGraph::run_test_graph3< Kokkos::OpenMP >(75, 1000); + TestStaticCrsGraph::run_test_graph3< Kokkos::OpenMP >(75, 10000); + TestStaticCrsGraph::run_test_graph3< Kokkos::OpenMP >(75, 100000); } #define OPENMP_INSERT_TEST( name, num_nodes, num_inserts, num_duplicates, repeat, near ) \ diff --git a/lib/kokkos/containers/unit_tests/TestSerial.cpp b/lib/kokkos/containers/unit_tests/TestSerial.cpp index 2be27ea613..51fbd503c7 100644 --- a/lib/kokkos/containers/unit_tests/TestSerial.cpp +++ b/lib/kokkos/containers/unit_tests/TestSerial.cpp @@ -45,7 +45,7 @@ #include -#if ! defined(KOKKOS_HAVE_SERIAL) +#if ! defined(KOKKOS_ENABLE_SERIAL) # error "It doesn't make sense to build this file unless the Kokkos::Serial device is enabled. If you see this message, it probably means that there is an error in Kokkos' CMake build infrastructure." #else @@ -91,6 +91,18 @@ TEST_F( serial , staticcrsgraph ) { TestStaticCrsGraph::run_test_graph< Kokkos::Serial >(); TestStaticCrsGraph::run_test_graph2< Kokkos::Serial >(); + TestStaticCrsGraph::run_test_graph3< Kokkos::Serial >(1, 0); + TestStaticCrsGraph::run_test_graph3< Kokkos::Serial >(1, 1000); + TestStaticCrsGraph::run_test_graph3< Kokkos::Serial >(1, 10000); + TestStaticCrsGraph::run_test_graph3< Kokkos::Serial >(1, 100000); + TestStaticCrsGraph::run_test_graph3< Kokkos::Serial >(3, 0); + TestStaticCrsGraph::run_test_graph3< Kokkos::Serial >(3, 1000); + TestStaticCrsGraph::run_test_graph3< Kokkos::Serial >(3, 10000); + TestStaticCrsGraph::run_test_graph3< Kokkos::Serial >(3, 100000); + TestStaticCrsGraph::run_test_graph3< Kokkos::Serial >(75, 0); + TestStaticCrsGraph::run_test_graph3< Kokkos::Serial >(75, 1000); + TestStaticCrsGraph::run_test_graph3< Kokkos::Serial >(75, 10000); + TestStaticCrsGraph::run_test_graph3< Kokkos::Serial >(75, 100000); } TEST_F( serial, complex ) @@ -178,6 +190,6 @@ TEST_F(serial, ErrorReporter) } // namespace Test -#endif // KOKKOS_HAVE_SERIAL +#endif // KOKKOS_ENABLE_SERIAL diff --git a/lib/kokkos/containers/unit_tests/TestStaticCrsGraph.hpp b/lib/kokkos/containers/unit_tests/TestStaticCrsGraph.hpp index 52b45b7865..09cb84b166 100644 --- a/lib/kokkos/containers/unit_tests/TestStaticCrsGraph.hpp +++ b/lib/kokkos/containers/unit_tests/TestStaticCrsGraph.hpp @@ -144,6 +144,44 @@ void run_test_graph2() } } +template< class Space > +void run_test_graph3(size_t B, size_t N) +{ + srand(10310); + + typedef Kokkos::StaticCrsGraph< int , Space > dView ; + typedef typename dView::HostMirror hView ; + + const unsigned LENGTH = 2000 ; + + std::vector< size_t > sizes( LENGTH ); + + size_t total_length = 0 ; + + for ( size_t i = 0 ; i < LENGTH ; ++i ) { + sizes[i] = rand()%1000; + } + + sizes[1] = N; + sizes[1998] = N; + + for ( size_t i = 0 ; i < LENGTH ; ++i ) { + total_length += sizes[i]; + } + + int C = 0; + dView dx = Kokkos::create_staticcrsgraph( "test" , sizes ); + dx.create_block_partitioning(B,C); + hView hx = Kokkos::create_mirror( dx ); + + for( size_t i = 0; i2*((hx.row_map(hx.numRows())+C*hx.numRows())/B))&&(hx.row_block_offsets(i+1)>hx.row_block_offsets(i)+1)); + } +} } /* namespace TestStaticCrsGraph */ diff --git a/lib/kokkos/containers/unit_tests/TestThreads.cpp b/lib/kokkos/containers/unit_tests/TestThreads.cpp index 3b34006a01..4f352b3822 100644 --- a/lib/kokkos/containers/unit_tests/TestThreads.cpp +++ b/lib/kokkos/containers/unit_tests/TestThreads.cpp @@ -45,7 +45,7 @@ #include -#if defined( KOKKOS_HAVE_PTHREAD ) +#if defined( KOKKOS_ENABLE_PTHREAD ) #include #include @@ -106,6 +106,18 @@ TEST_F( threads , staticcrsgraph ) { TestStaticCrsGraph::run_test_graph< Kokkos::Threads >(); TestStaticCrsGraph::run_test_graph2< Kokkos::Threads >(); + TestStaticCrsGraph::run_test_graph3< Kokkos::Threads >(1, 0); + TestStaticCrsGraph::run_test_graph3< Kokkos::Threads >(1, 1000); + TestStaticCrsGraph::run_test_graph3< Kokkos::Threads >(1, 10000); + TestStaticCrsGraph::run_test_graph3< Kokkos::Threads >(1, 100000); + TestStaticCrsGraph::run_test_graph3< Kokkos::Threads >(3, 0); + TestStaticCrsGraph::run_test_graph3< Kokkos::Threads >(3, 1000); + TestStaticCrsGraph::run_test_graph3< Kokkos::Threads >(3, 10000); + TestStaticCrsGraph::run_test_graph3< Kokkos::Threads >(3, 100000); + TestStaticCrsGraph::run_test_graph3< Kokkos::Threads >(75, 0); + TestStaticCrsGraph::run_test_graph3< Kokkos::Threads >(75, 1000); + TestStaticCrsGraph::run_test_graph3< Kokkos::Threads >(75, 10000); + TestStaticCrsGraph::run_test_graph3< Kokkos::Threads >(75, 100000); } /*TEST_F( threads, bitset ) @@ -190,5 +202,5 @@ TEST_F(threads, ErrorReporter) } // namespace Test -#endif /* #if defined( KOKKOS_HAVE_PTHREAD ) */ +#endif /* #if defined( KOKKOS_ENABLE_PTHREAD ) */ diff --git a/lib/kokkos/core/perf_test/PerfTestCuda.cpp b/lib/kokkos/core/perf_test/PerfTestCuda.cpp index 524beb8b90..7386ecef20 100644 --- a/lib/kokkos/core/perf_test/PerfTestCuda.cpp +++ b/lib/kokkos/core/perf_test/PerfTestCuda.cpp @@ -48,7 +48,7 @@ #include -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) #include @@ -185,5 +185,5 @@ TEST_F( cuda, texture_double ) } // namespace Test -#endif /* #if defined( KOKKOS_HAVE_CUDA ) */ +#endif /* #if defined( KOKKOS_ENABLE_CUDA ) */ diff --git a/lib/kokkos/core/perf_test/PerfTestDriver.hpp b/lib/kokkos/core/perf_test/PerfTestDriver.hpp index e3dd3b4123..7b6cfc5b5c 100644 --- a/lib/kokkos/core/perf_test/PerfTestDriver.hpp +++ b/lib/kokkos/core/perf_test/PerfTestDriver.hpp @@ -51,8 +51,8 @@ // macro, so I'm commenting out the macro to avoid compiler complaints // about an unused macro. -// #define KOKKOS_MACRO_IMPL_TO_STRING( X ) #X -// #define KOKKOS_MACRO_TO_STRING( X ) KOKKOS_MACRO_IMPL_TO_STRING( X ) +// #define KOKKOS_IMPL_MACRO_TO_STRING( X ) #X +// #define KOKKOS_MACRO_TO_STRING( X ) KOKKOS_IMPL_MACRO_TO_STRING( X ) //------------------------------------------------------------------------ diff --git a/lib/kokkos/core/perf_test/PerfTestHost.cpp b/lib/kokkos/core/perf_test/PerfTestHost.cpp index 4a05eecfe0..606177ca50 100644 --- a/lib/kokkos/core/perf_test/PerfTestHost.cpp +++ b/lib/kokkos/core/perf_test/PerfTestHost.cpp @@ -45,17 +45,17 @@ #include -#if defined( KOKKOS_HAVE_OPENMP ) +#if defined( KOKKOS_ENABLE_OPENMP ) typedef Kokkos::OpenMP TestHostDevice ; const char TestHostDeviceName[] = "Kokkos::OpenMP" ; -#elif defined( KOKKOS_HAVE_PTHREAD ) +#elif defined( KOKKOS_ENABLE_PTHREAD ) typedef Kokkos::Threads TestHostDevice ; const char TestHostDeviceName[] = "Kokkos::Threads" ; -#elif defined( KOKKOS_HAVE_SERIAL ) +#elif defined( KOKKOS_ENABLE_SERIAL ) typedef Kokkos::Serial TestHostDevice ; const char TestHostDeviceName[] = "Kokkos::Serial" ; diff --git a/lib/kokkos/core/src/Cuda/Kokkos_CudaExec.hpp b/lib/kokkos/core/src/Cuda/Kokkos_CudaExec.hpp index d1a560ee04..0a0f41686b 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_CudaExec.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_CudaExec.hpp @@ -47,7 +47,7 @@ #include /* only compile this file if CUDA is enabled for Kokkos */ -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA #include #include @@ -112,7 +112,7 @@ CudaSpace::size_type * cuda_internal_scratch_unified( const CudaSpace::size_type #if defined( __CUDACC__ ) /** \brief Access to constant memory on the device */ -#ifdef KOKKOS_CUDA_USE_RELOCATABLE_DEVICE_CODE +#ifdef KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE __device__ __constant__ extern unsigned long kokkos_impl_cuda_constant_memory_buffer[] ; @@ -135,7 +135,7 @@ namespace Impl { } } __device__ __constant__ -#ifdef KOKKOS_CUDA_USE_RELOCATABLE_DEVICE_CODE +#ifdef KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE extern #endif Kokkos::Impl::CudaLockArraysStruct kokkos_impl_cuda_lock_arrays ; @@ -245,7 +245,7 @@ struct CudaParallelLaunch< DriverType , true > { // Copy functor to constant memory on the device cudaMemcpyToSymbol( kokkos_impl_cuda_constant_memory_buffer , & driver , sizeof(DriverType) ); - #ifndef KOKKOS_CUDA_USE_RELOCATABLE_DEVICE_CODE + #ifndef KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE Kokkos::Impl::CudaLockArraysStruct locks; locks.atomic = atomic_lock_array_cuda_space_ptr(false); locks.scratch = scratch_lock_array_cuda_space_ptr(false); @@ -287,7 +287,7 @@ struct CudaParallelLaunch< DriverType , false > { } #endif - #ifndef KOKKOS_CUDA_USE_RELOCATABLE_DEVICE_CODE + #ifndef KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE Kokkos::Impl::CudaLockArraysStruct locks; locks.atomic = atomic_lock_array_cuda_space_ptr(false); locks.scratch = scratch_lock_array_cuda_space_ptr(false); @@ -314,5 +314,5 @@ struct CudaParallelLaunch< DriverType , false > { //---------------------------------------------------------------------------- #endif /* defined( __CUDACC__ ) */ -#endif /* defined( KOKKOS_HAVE_CUDA ) */ +#endif /* defined( KOKKOS_ENABLE_CUDA ) */ #endif /* #ifndef KOKKOS_CUDAEXEC_HPP */ diff --git a/lib/kokkos/core/src/Cuda/Kokkos_CudaSpace.cpp b/lib/kokkos/core/src/Cuda/Kokkos_CudaSpace.cpp index 8abf2292d9..91a3c92138 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_CudaSpace.cpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_CudaSpace.cpp @@ -50,7 +50,7 @@ #include /* only compile this file if CUDA is enabled for Kokkos */ -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA #include #include @@ -910,5 +910,5 @@ void* cuda_resize_scratch_space(size_t bytes, bool force_shrink) { } } -#endif // KOKKOS_HAVE_CUDA +#endif // KOKKOS_ENABLE_CUDA diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Alloc.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Alloc.hpp index 10999ee57b..49c228f86a 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Alloc.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Alloc.hpp @@ -47,7 +47,7 @@ #include /* only compile this file if CUDA is enabled for Kokkos */ -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA #include @@ -176,7 +176,7 @@ public: }} // namespace Kokkos::Impl -#endif //KOKKOS_HAVE_CUDA +#endif //KOKKOS_ENABLE_CUDA #endif // #ifndef KOKKOS_CUDA_ALLOCATION_TRACKING_HPP diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Error.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Error.hpp index a0b29ddc2b..e58e1f58de 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Error.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Error.hpp @@ -47,7 +47,7 @@ #include /* only compile this file if CUDA is enabled for Kokkos */ -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA namespace Kokkos { namespace Impl { @@ -65,5 +65,5 @@ inline void cuda_internal_safe_call( cudaError e , const char * name, const char }} // namespace Kokkos::Impl -#endif //KOKKOS_HAVE_CUDA +#endif //KOKKOS_ENABLE_CUDA #endif //KOKKOS_CUDA_ERROR_HPP diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Impl.cpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Impl.cpp index 59e79bba25..eeea97049f 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Impl.cpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Impl.cpp @@ -47,7 +47,7 @@ #include /* only compile this file if CUDA is enabled for Kokkos */ -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA #include #include @@ -64,7 +64,7 @@ #include #include -#ifdef KOKKOS_CUDA_USE_RELOCATABLE_DEVICE_CODE +#ifdef KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE __device__ __constant__ unsigned long kokkos_impl_cuda_constant_memory_buffer[ Kokkos::Impl::CudaTraits::ConstantMemoryUsage / sizeof(unsigned long) ] ; @@ -299,8 +299,8 @@ void CudaInternal::print_configuration( std::ostream & s ) const { const CudaInternalDevices & dev_info = CudaInternalDevices::singleton(); -#if defined( KOKKOS_HAVE_CUDA ) - s << "macro KOKKOS_HAVE_CUDA : defined" << std::endl ; +#if defined( KOKKOS_ENABLE_CUDA ) + s << "macro KOKKOS_ENABLE_CUDA : defined" << std::endl ; #endif #if defined( CUDA_VERSION ) s << "macro CUDA_VERSION = " << CUDA_VERSION @@ -500,7 +500,7 @@ void CudaInternal::initialize( int cuda_device_id , int stream_count ) Kokkos::Impl::throw_runtime_exception( msg.str() ); } - #ifdef KOKKOS_CUDA_USE_UVM + #ifdef KOKKOS_ENABLE_CUDA_UVM if(!cuda_launch_blocking()) { std::cout << "Kokkos::Cuda::initialize WARNING: Cuda is allocating into UVMSpace by default" << std::endl; std::cout << " without setting CUDA_LAUNCH_BLOCKING=1." << std::endl; @@ -531,7 +531,7 @@ void CudaInternal::initialize( int cuda_device_id , int stream_count ) // Init the array for used for arbitrarily sized atomics Impl::init_lock_arrays_cuda_space(); - #ifdef KOKKOS_CUDA_USE_RELOCATABLE_DEVICE_CODE + #ifdef KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE Kokkos::Impl::CudaLockArraysStruct locks; locks.atomic = atomic_lock_array_cuda_space_ptr(false); locks.scratch = scratch_lock_array_cuda_space_ptr(false); @@ -773,6 +773,6 @@ void Cuda::fence() } // namespace Kokkos -#endif // KOKKOS_HAVE_CUDA +#endif // KOKKOS_ENABLE_CUDA //---------------------------------------------------------------------------- diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Internal.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Internal.hpp index 8b10d47f88..c75b9f1ddf 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Internal.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Internal.hpp @@ -47,7 +47,7 @@ #include /* only compile this file if CUDA is enabled for Kokkos */ -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA #include @@ -197,6 +197,6 @@ struct CudaGetOptBlockSize { }} // namespace Kokkos::Impl -#endif // KOKKOS_HAVE_CUDA +#endif // KOKKOS_ENABLE_CUDA #endif /* #ifndef KOKKOS_CUDA_INTERNAL_HPP */ diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Parallel.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Parallel.hpp index 12a639fd44..fa29d732f4 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Parallel.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Parallel.hpp @@ -51,7 +51,7 @@ #include /* only compile this file if CUDA is enabled for Kokkos */ -#if defined( __CUDACC__ ) && defined( KOKKOS_HAVE_CUDA ) +#if defined( __CUDACC__ ) && defined( KOKKOS_ENABLE_CUDA ) #include #include diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_ReduceScan.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_ReduceScan.hpp index f30a0a891f..ad9cca26ce 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_ReduceScan.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_ReduceScan.hpp @@ -47,7 +47,7 @@ #include /* only compile this file if CUDA is enabled for Kokkos */ -#if defined( __CUDACC__ ) && defined( KOKKOS_HAVE_CUDA ) +#if defined( __CUDACC__ ) && defined( KOKKOS_ENABLE_CUDA ) #include @@ -312,7 +312,7 @@ void cuda_intra_block_reduce_scan( const FunctorType & functor , ( rtid_intra & 16 ) ? 16 : 0 )))); if ( ! ( rtid_intra + n < blockDim.y ) ) n = 0 ; - #ifdef KOKKOS_CUDA_CLANG_WORKAROUND + #ifdef KOKKOS_IMPL_CUDA_CLANG_WORKAROUND BLOCK_SCAN_STEP(tdata_intra,n,4) __syncthreads();//__threadfence_block(); BLOCK_SCAN_STEP(tdata_intra,n,3) __syncthreads();//__threadfence_block(); BLOCK_SCAN_STEP(tdata_intra,n,2) __syncthreads();//__threadfence_block(); diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Task.cpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Task.cpp index d56de5db60..c96b8b7d40 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Task.cpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Task.cpp @@ -43,7 +43,7 @@ #include -#if defined( KOKKOS_HAVE_CUDA ) && defined( KOKKOS_ENABLE_TASKDAG ) +#if defined( KOKKOS_ENABLE_CUDA ) && defined( KOKKOS_ENABLE_TASKDAG ) #include @@ -174,6 +174,6 @@ printf("cuda_task_queue_execute after\n"); //---------------------------------------------------------------------------- -#endif /* #if defined( KOKKOS_HAVE_CUDA ) && defined( KOKKOS_ENABLE_TASKDAG ) */ +#endif /* #if defined( KOKKOS_ENABLE_CUDA ) && defined( KOKKOS_ENABLE_TASKDAG ) */ diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Vectorization.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Vectorization.hpp index 0b8427cbe1..33adc5b7dd 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Vectorization.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Vectorization.hpp @@ -46,7 +46,7 @@ #include /* only compile this file if CUDA is enabled for Kokkos */ -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA #include @@ -294,5 +294,5 @@ namespace Impl { } -#endif // KOKKOS_HAVE_CUDA +#endif // KOKKOS_ENABLE_CUDA #endif diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_View.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_View.hpp index b505b766a0..cbbe15374e 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_View.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_View.hpp @@ -45,7 +45,7 @@ #define KOKKOS_EXPERIMENTAL_CUDA_VIEW_HPP /* only compile this file if CUDA is enabled for Kokkos */ -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- @@ -144,7 +144,7 @@ struct CudaTextureFetch { {} }; -#if defined( KOKKOS_CUDA_USE_LDG_INTRINSIC ) +#if defined( KOKKOS_ENABLE_CUDA_LDG_INTRINSIC ) template< typename ValueType , typename AliasType > struct CudaLDGFetch { @@ -261,7 +261,7 @@ public: >::type >::type ; -#if defined( KOKKOS_CUDA_USE_LDG_INTRINSIC ) +#if defined( KOKKOS_ENABLE_CUDA_LDG_INTRINSIC ) using handle_type = Kokkos::Experimental::Impl::CudaLDGFetch< value_type , alias_type > ; #else using handle_type = Kokkos::Experimental::Impl::CudaTextureFetch< value_type , alias_type > ; @@ -301,6 +301,6 @@ public: //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- -#endif /* #if defined( KOKKOS_HAVE_CUDA ) */ +#endif /* #if defined( KOKKOS_ENABLE_CUDA ) */ #endif /* #ifndef KOKKOS_CUDA_VIEW_HPP */ diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_abort.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_abort.hpp index 60903b757f..c248913734 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_abort.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_abort.hpp @@ -47,7 +47,7 @@ //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- #include "Kokkos_Macros.hpp" -#if defined( __CUDACC__ ) && defined( KOKKOS_HAVE_CUDA ) +#if defined( __CUDACC__ ) && defined( KOKKOS_ENABLE_CUDA ) #include @@ -82,6 +82,6 @@ void cuda_abort( const char * const message ) } // namespace Impl } // namespace Kokkos -#endif /* #if defined(__CUDACC__) && defined( KOKKOS_HAVE_CUDA ) */ +#endif /* #if defined(__CUDACC__) && defined( KOKKOS_ENABLE_CUDA ) */ #endif /* #ifndef KOKKOS_CUDA_ABORT_HPP */ diff --git a/lib/kokkos/core/src/KokkosExp_MDRangePolicy.hpp b/lib/kokkos/core/src/KokkosExp_MDRangePolicy.hpp index e813285fc7..4e1ce855c5 100644 --- a/lib/kokkos/core/src/KokkosExp_MDRangePolicy.hpp +++ b/lib/kokkos/core/src/KokkosExp_MDRangePolicy.hpp @@ -48,8 +48,8 @@ #include #include -#if defined(KOKKOS_OPT_RANGE_AGGRESSIVE_VECTORIZATION) && defined(KOKKOS_HAVE_PRAGMA_IVDEP) && !defined(__CUDA_ARCH__) -#define KOKKOS_MDRANGE_IVDEP +#if defined(KOKKOS_OPT_RANGE_AGGRESSIVE_VECTORIZATION) && defined(KOKKOS_ENABLE_PRAGMA_IVDEP) && !defined(__CUDA_ARCH__) +#define KOKKOS_IMPL_MDRANGE_IVDEP #endif namespace Kokkos { namespace Experimental { @@ -350,7 +350,7 @@ struct MDForFunctor if ( MDRange::inner_direction == MDRange::Right ) { for (int i0=b0; i0 #include @@ -298,5 +298,5 @@ public: } // namespace Kokkos -#endif /* #ifndef KOKKOS_ARRAY */ +#endif /* #ifndef KOKKOS_ARRAY_HPP */ diff --git a/lib/kokkos/core/src/Kokkos_Atomic.hpp b/lib/kokkos/core/src/Kokkos_Atomic.hpp index 3102402b83..3ecae24da4 100644 --- a/lib/kokkos/core/src/Kokkos_Atomic.hpp +++ b/lib/kokkos/core/src/Kokkos_Atomic.hpp @@ -73,18 +73,18 @@ //---------------------------------------------------------------------------- #if defined(_WIN32) -#define KOKKOS_ATOMICS_USE_WINDOWS +#define KOKKOS_ENABLE_WINDOWS_ATOMICS #else -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) // Compiling NVIDIA device code, must use Cuda atomics: -#define KOKKOS_ATOMICS_USE_CUDA +#define KOKKOS_ENABLE_CUDA_ATOMICS #endif -#if ! defined( KOKKOS_ATOMICS_USE_GCC ) && \ - ! defined( KOKKOS_ATOMICS_USE_INTEL ) && \ - ! defined( KOKKOS_ATOMICS_USE_OMP31 ) +#if ! defined( KOKKOS_ENABLE_GNU_ATOMICS ) && \ + ! defined( KOKKOS_ENABLE_INTEL_ATOMICS ) && \ + ! defined( KOKKOS_ENABLE_OPENMP_ATOMICS ) // Compiling for non-Cuda atomic implementation has not been pre-selected. // Choose the best implementation for the detected compiler. @@ -94,16 +94,16 @@ defined( KOKKOS_COMPILER_CLANG ) || \ ( defined ( KOKKOS_COMPILER_NVCC ) ) -#define KOKKOS_ATOMICS_USE_GCC +#define KOKKOS_ENABLE_GNU_ATOMICS #elif defined( KOKKOS_COMPILER_INTEL ) || \ defined( KOKKOS_COMPILER_CRAYC ) -#define KOKKOS_ATOMICS_USE_INTEL +#define KOKKOS_ENABLE_INTEL_ATOMICS #elif defined( _OPENMP ) && ( 201107 <= _OPENMP ) -#define KOKKOS_ATOMICS_USE_OMP31 +#define KOKKOS_ENABLE_OPENMP_ATOMICS #else @@ -119,7 +119,7 @@ // Forward decalaration of functions supporting arbitrary sized atomics // This is necessary since Kokkos_Atomic.hpp is internally included very early // through Kokkos_HostSpace.hpp as well as the allocation tracker. -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA namespace Kokkos { namespace Impl { /// \brief Aquire a lock for the address @@ -127,7 +127,7 @@ namespace Impl { /// This function tries to aquire the lock for the hash value derived /// from the provided ptr. If the lock is successfully aquired the /// function returns true. Otherwise it returns false. -#ifdef KOKKOS_CUDA_USE_RELOCATABLE_DEVICE_CODE +#ifdef KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE extern #endif __device__ inline @@ -139,7 +139,7 @@ bool lock_address_cuda_space(void* ptr); /// from the provided ptr. This function should only be called /// after previously successfully aquiring a lock with /// lock_address. -#ifdef KOKKOS_CUDA_USE_RELOCATABLE_DEVICE_CODE +#ifdef KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE extern #endif __device__ inline @@ -170,16 +170,16 @@ namespace Kokkos { inline const char * atomic_query_version() { -#if defined( KOKKOS_ATOMICS_USE_CUDA ) - return "KOKKOS_ATOMICS_USE_CUDA" ; -#elif defined( KOKKOS_ATOMICS_USE_GCC ) - return "KOKKOS_ATOMICS_USE_GCC" ; -#elif defined( KOKKOS_ATOMICS_USE_INTEL ) - return "KOKKOS_ATOMICS_USE_INTEL" ; -#elif defined( KOKKOS_ATOMICS_USE_OMP31 ) - return "KOKKOS_ATOMICS_USE_OMP31" ; -#elif defined( KOKKOS_ATOMICS_USE_WINDOWS ) - return "KOKKOS_ATOMICS_USE_WINDOWS"; +#if defined( KOKKOS_ENABLE_CUDA_ATOMICS ) + return "KOKKOS_ENABLE_CUDA_ATOMICS" ; +#elif defined( KOKKOS_ENABLE_GNU_ATOMICS ) + return "KOKKOS_ENABLE_GNU_ATOMICS" ; +#elif defined( KOKKOS_ENABLE_INTEL_ATOMICS ) + return "KOKKOS_ENABLE_INTEL_ATOMICS" ; +#elif defined( KOKKOS_ENABLE_OPENMP_ATOMICS ) + return "KOKKOS_ENABLE_OPENMP_ATOMICS" ; +#elif defined( KOKKOS_ENABLE_WINDOWS_ATOMICS ) + return "KOKKOS_ENABLE_WINDOWS_ATOMICS"; #endif } diff --git a/lib/kokkos/core/src/Kokkos_Concepts.hpp b/lib/kokkos/core/src/Kokkos_Concepts.hpp index af83e5cac6..3f9bdea40d 100644 --- a/lib/kokkos/core/src/Kokkos_Concepts.hpp +++ b/lib/kokkos/core/src/Kokkos_Concepts.hpp @@ -185,15 +185,15 @@ public: typedef typename std::conditional < std::is_same< memory_space , Kokkos::HostSpace >::value -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) || std::is_same< memory_space , Kokkos::CudaUVMSpace >::value || std::is_same< memory_space , Kokkos::CudaHostPinnedSpace >::value -#endif /* #if defined( KOKKOS_HAVE_CUDA ) */ +#endif /* #if defined( KOKKOS_ENABLE_CUDA ) */ , memory_space , Kokkos::HostSpace >::type host_memory_space ; -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) typedef typename std::conditional < std::is_same< execution_space , Kokkos::Cuda >::value , Kokkos::DefaultHostExecutionSpace , execution_space diff --git a/lib/kokkos/core/src/Kokkos_Core.hpp b/lib/kokkos/core/src/Kokkos_Core.hpp index 266f750d37..6d92f4bf61 100644 --- a/lib/kokkos/core/src/Kokkos_Core.hpp +++ b/lib/kokkos/core/src/Kokkos_Core.hpp @@ -1,13 +1,13 @@ /* //@HEADER // ************************************************************************ -// +// // Kokkos v. 2.0 // Copyright (2014) Sandia Corporation -// +// // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, // the U.S. Government retains certain rights in this software. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -36,7 +36,7 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) -// +// // ************************************************************************ //@HEADER */ @@ -49,19 +49,19 @@ #include -#if defined( KOKKOS_HAVE_SERIAL ) +#if defined( KOKKOS_ENABLE_SERIAL ) #include #endif -#if defined( KOKKOS_HAVE_OPENMP ) +#if defined( KOKKOS_ENABLE_OPENMP ) #include #endif -#if defined( KOKKOS_HAVE_PTHREAD ) +#if defined( KOKKOS_ENABLE_PTHREAD ) #include #endif -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) #include #endif @@ -74,9 +74,7 @@ #include #include -#ifdef KOKKOS_HAVE_CXX11 #include -#endif //---------------------------------------------------------------------------- diff --git a/lib/kokkos/core/src/Kokkos_Core_fwd.hpp b/lib/kokkos/core/src/Kokkos_Core_fwd.hpp index 0f5ef9200a..e7e6a49d37 100644 --- a/lib/kokkos/core/src/Kokkos_Core_fwd.hpp +++ b/lib/kokkos/core/src/Kokkos_Core_fwd.hpp @@ -83,25 +83,25 @@ namespace Kokkos { class HostSpace ; ///< Memory space for main process and CPU execution spaces -#ifdef KOKKOS_HAVE_HBWSPACE +#ifdef KOKKOS_ENABLE_HBWSPACE namespace Experimental { class HBWSpace ; /// Memory space for hbw_malloc from memkind (e.g. for KNL processor) } #endif -#if defined( KOKKOS_HAVE_SERIAL ) +#if defined( KOKKOS_ENABLE_SERIAL ) class Serial ; ///< Execution space main process on CPU -#endif // defined( KOKKOS_HAVE_SERIAL ) +#endif // defined( KOKKOS_ENABLE_SERIAL ) -#if defined( KOKKOS_HAVE_PTHREAD ) +#if defined( KOKKOS_ENABLE_PTHREAD ) class Threads ; ///< Execution space with pthreads back-end #endif -#if defined( KOKKOS_HAVE_OPENMP ) +#if defined( KOKKOS_ENABLE_OPENMP ) class OpenMP ; ///< OpenMP execution space #endif -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) class CudaSpace ; ///< Memory space on Cuda GPU class CudaUVMSpace ; ///< Memory space on Cuda GPU with UVM class CudaHostPinnedSpace ; ///< Memory space on Host accessible to Cuda GPU @@ -122,29 +122,29 @@ struct Device; namespace Kokkos { -#if defined ( KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_CUDA ) +#if defined ( KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_CUDA ) typedef Cuda DefaultExecutionSpace ; -#elif defined ( KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_OPENMP ) +#elif defined ( KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_OPENMP ) typedef OpenMP DefaultExecutionSpace ; -#elif defined ( KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_THREADS ) +#elif defined ( KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_THREADS ) typedef Threads DefaultExecutionSpace ; -#elif defined ( KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_SERIAL ) +#elif defined ( KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_SERIAL ) typedef Serial DefaultExecutionSpace ; #else # error "At least one of the following execution spaces must be defined in order to use Kokkos: Kokkos::Cuda, Kokkos::OpenMP, Kokkos::Serial, or Kokkos::Threads." #endif -#if defined ( KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_OPENMP ) +#if defined ( KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_OPENMP ) typedef OpenMP DefaultHostExecutionSpace ; -#elif defined ( KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_THREADS ) +#elif defined ( KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_THREADS ) typedef Threads DefaultHostExecutionSpace ; -#elif defined ( KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_SERIAL ) +#elif defined ( KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_SERIAL ) typedef Serial DefaultHostExecutionSpace ; -#elif defined ( KOKKOS_HAVE_OPENMP ) +#elif defined ( KOKKOS_ENABLE_OPENMP ) typedef OpenMP DefaultHostExecutionSpace ; -#elif defined ( KOKKOS_HAVE_PTHREAD ) +#elif defined ( KOKKOS_ENABLE_PTHREAD ) typedef Threads DefaultHostExecutionSpace ; -#elif defined ( KOKKOS_HAVE_SERIAL ) +#elif defined ( KOKKOS_ENABLE_SERIAL ) typedef Serial DefaultHostExecutionSpace ; #else # error "At least one of the following execution spaces must be defined in order to use Kokkos: Kokkos::OpenMP, Kokkos::Serial, or Kokkos::Threads." @@ -161,7 +161,7 @@ namespace Kokkos { namespace Kokkos { namespace Impl { -#if defined( KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_CUDA ) && defined (KOKKOS_HAVE_CUDA) +#if defined( KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_CUDA ) && defined (KOKKOS_ENABLE_CUDA) typedef Kokkos::CudaSpace ActiveExecutionMemorySpace ; #elif defined( KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST ) typedef Kokkos::HostSpace ActiveExecutionMemorySpace ; diff --git a/lib/kokkos/core/src/Kokkos_Cuda.hpp b/lib/kokkos/core/src/Kokkos_Cuda.hpp index 84ae5ee044..afccdb6c52 100644 --- a/lib/kokkos/core/src/Kokkos_Cuda.hpp +++ b/lib/kokkos/core/src/Kokkos_Cuda.hpp @@ -48,7 +48,7 @@ // If CUDA execution space is enabled then use this header file. -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) #include #include @@ -94,7 +94,7 @@ public: //! Tag this class as a kokkos execution space typedef Cuda execution_space ; -#if defined( KOKKOS_USE_CUDA_UVM ) +#if defined( KOKKOS_ENABLE_CUDA_UVM ) //! This execution space's preferred memory space. typedef CudaUVMSpace memory_space ; #else @@ -240,7 +240,7 @@ struct MemorySpaceAccess enum { deepcopy = false }; }; -#if defined( KOKKOS_USE_CUDA_UVM ) +#if defined( KOKKOS_ENABLE_CUDA_UVM ) // If forcing use of UVM everywhere // then must assume that CudaUVMSpace @@ -297,7 +297,7 @@ struct VerifyExecutionCanAccessMemorySpace //---------------------------------------------------------------------------- -#endif /* #if defined( KOKKOS_HAVE_CUDA ) */ +#endif /* #if defined( KOKKOS_ENABLE_CUDA ) */ #endif /* #ifndef KOKKOS_CUDA_HPP */ diff --git a/lib/kokkos/core/src/Kokkos_CudaSpace.hpp b/lib/kokkos/core/src/Kokkos_CudaSpace.hpp index fd9b0ad123..2bbf631b73 100644 --- a/lib/kokkos/core/src/Kokkos_CudaSpace.hpp +++ b/lib/kokkos/core/src/Kokkos_CudaSpace.hpp @@ -46,7 +46,7 @@ #include -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) #include #include @@ -939,6 +939,6 @@ public: //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- -#endif /* #if defined( KOKKOS_HAVE_CUDA ) */ +#endif /* #if defined( KOKKOS_ENABLE_CUDA ) */ #endif /* #define KOKKOS_CUDASPACE_HPP */ diff --git a/lib/kokkos/core/src/Kokkos_HBWSpace.hpp b/lib/kokkos/core/src/Kokkos_HBWSpace.hpp index 10e735fe00..d6bf8dcdf4 100644 --- a/lib/kokkos/core/src/Kokkos_HBWSpace.hpp +++ b/lib/kokkos/core/src/Kokkos_HBWSpace.hpp @@ -48,7 +48,7 @@ #include /*--------------------------------------------------------------------------*/ -#ifdef KOKKOS_HAVE_HBWSPACE +#ifdef KOKKOS_ENABLE_HBWSPACE namespace Kokkos { namespace Experimental { @@ -102,15 +102,15 @@ public: /// Every memory space has a default execution space. This is /// useful for things like initializing a View (which happens in /// parallel using the View's default execution space). -#if defined( KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_OPENMP ) +#if defined( KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_OPENMP ) typedef Kokkos::OpenMP execution_space ; -#elif defined( KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_THREADS ) +#elif defined( KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_THREADS ) typedef Kokkos::Threads execution_space ; -#elif defined( KOKKOS_HAVE_OPENMP ) +#elif defined( KOKKOS_ENABLE_OPENMP ) typedef Kokkos::OpenMP execution_space ; -#elif defined( KOKKOS_HAVE_PTHREAD ) +#elif defined( KOKKOS_ENABLE_PTHREAD ) typedef Kokkos::Threads execution_space ; -#elif defined( KOKKOS_HAVE_SERIAL ) +#elif defined( KOKKOS_ENABLE_SERIAL ) typedef Kokkos::Serial execution_space ; #else # error "At least one of the following host execution spaces must be defined: Kokkos::OpenMP, Kokkos::Serial, or Kokkos::Threads. You might be seeing this message if you disabled the Kokkos::Serial device explicitly using the Kokkos_ENABLE_Serial:BOOL=OFF CMake option, but did not enable any of the other host execution space devices." diff --git a/lib/kokkos/core/src/Kokkos_HostSpace.hpp b/lib/kokkos/core/src/Kokkos_HostSpace.hpp index 0292dd8a6c..e79de462bf 100644 --- a/lib/kokkos/core/src/Kokkos_HostSpace.hpp +++ b/lib/kokkos/core/src/Kokkos_HostSpace.hpp @@ -108,15 +108,15 @@ public: /// Every memory space has a default execution space. This is /// useful for things like initializing a View (which happens in /// parallel using the View's default execution space). -#if defined( KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_OPENMP ) +#if defined( KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_OPENMP ) typedef Kokkos::OpenMP execution_space ; -#elif defined( KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_THREADS ) +#elif defined( KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_THREADS ) typedef Kokkos::Threads execution_space ; -#elif defined( KOKKOS_HAVE_OPENMP ) +#elif defined( KOKKOS_ENABLE_OPENMP ) typedef Kokkos::OpenMP execution_space ; -#elif defined( KOKKOS_HAVE_PTHREAD ) +#elif defined( KOKKOS_ENABLE_PTHREAD ) typedef Kokkos::Threads execution_space ; -#elif defined( KOKKOS_HAVE_SERIAL ) +#elif defined( KOKKOS_ENABLE_SERIAL ) typedef Kokkos::Serial execution_space ; #else # error "At least one of the following host execution spaces must be defined: Kokkos::OpenMP, Kokkos::Serial, or Kokkos::Threads. You might be seeing this message if you disabled the Kokkos::Serial device explicitly using the Kokkos_ENABLE_Serial:BOOL=OFF CMake option, but did not enable any of the other host execution space devices." diff --git a/lib/kokkos/core/src/Kokkos_Macros.hpp b/lib/kokkos/core/src/Kokkos_Macros.hpp index fbe699deb8..52845b9e09 100644 --- a/lib/kokkos/core/src/Kokkos_Macros.hpp +++ b/lib/kokkos/core/src/Kokkos_Macros.hpp @@ -1,13 +1,13 @@ /* //@HEADER // ************************************************************************ -// +// // Kokkos v. 2.0 // Copyright (2014) Sandia Corporation -// +// // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, // the U.S. Government retains certain rights in this software. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -36,7 +36,7 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) -// +// // ************************************************************************ //@HEADER */ @@ -47,23 +47,24 @@ //---------------------------------------------------------------------------- /** Pick up configure/build options via #define macros: * - * KOKKOS_HAVE_CUDA Kokkos::Cuda execution and memory spaces - * KOKKOS_HAVE_PTHREAD Kokkos::Threads execution space - * KOKKOS_HAVE_QTHREAD Kokkos::Qthread execution space - * KOKKOS_HAVE_OPENMP Kokkos::OpenMP execution space - * KOKKOS_HAVE_HWLOC HWLOC library is available + * KOKKOS_ENABLE_CUDA Kokkos::Cuda execution and memory spaces + * KOKKOS_ENABLE_PTHREAD Kokkos::Threads execution space + * KOKKOS_ENABLE_QTHREAD Kokkos::Qthread execution space + * KOKKOS_ENABLE_OPENMP Kokkos::OpenMP execution space + * KOKKOS_ENABLE_HWLOC HWLOC library is available * KOKKOS_ENABLE_DEBUG_BOUNDS_CHECK insert array bounds checks, is expensive! - * KOKKOS_HAVE_CXX11 enable C++11 features * - * KOKKOS_HAVE_MPI negotiate MPI/execution space interactions + * KOKKOS_ENABLE_MPI negotiate MPI/execution space interactions * - * KOKKOS_USE_CUDA_UVM Use CUDA UVM for Cuda memory space + * KOKKOS_ENABLE_CUDA_UVM Use CUDA UVM for Cuda memory space */ #ifndef KOKKOS_DONT_INCLUDE_CORE_CONFIG_H #include #endif +#include + //---------------------------------------------------------------------------- /** Pick up compiler specific #define macros: * @@ -80,10 +81,10 @@ * * Macros for which compiler extension to use for atomics on intrinsice types * - * KOKKOS_ATOMICS_USE_CUDA - * KOKKOS_ATOMICS_USE_GNU - * KOKKOS_ATOMICS_USE_INTEL - * KOKKOS_ATOMICS_USE_OPENMP31 + * KOKKOS_ENABLE_CUDA_ATOMICS + * KOKKOS_ENABLE_GNU_ATOMICS + * KOKKOS_ENABLE_INTEL_ATOMICS + * KOKKOS_ENABLE_OPENMP_ATOMICS * * A suite of 'KOKKOS_HAVE_PRAGMA_...' are defined for internal use. * @@ -96,7 +97,7 @@ //---------------------------------------------------------------------------- -#if defined( KOKKOS_HAVE_CUDA ) && defined( __CUDACC__ ) +#if defined( KOKKOS_ENABLE_CUDA ) && defined( __CUDACC__ ) /* Compiling with a CUDA compiler. * @@ -126,7 +127,7 @@ #error "Cuda device capability >= 3.0 is required" #endif -#ifdef KOKKOS_CUDA_USE_LAMBDA +#ifdef KOKKOS_ENABLE_CUDA_LAMBDA #if ( CUDA_VERSION < 7050 ) // CUDA supports C++11 lambdas generated in host code to be given // to the device starting with version 7.5. But the release candidate (7.5.6) @@ -137,18 +138,18 @@ #define KOKKOS_LAMBDA [=]__device__ #else #define KOKKOS_LAMBDA [=]__host__ __device__ - #if defined( KOKKOS_HAVE_CXX1Z ) + #if defined( KOKKOS_ENABLE_CXX1Z ) #define KOKKOS_CLASS_LAMBDA [=,*this] __host__ __device__ #endif #endif -#define KOKKOS_HAVE_CXX11_DISPATCH_LAMBDA 1 +#define KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA 1 #endif -#endif /* #if defined( KOKKOS_HAVE_CUDA ) && defined( __CUDACC__ ) */ +#endif /* #if defined( KOKKOS_ENABLE_CUDA ) && defined( __CUDACC__ ) */ -#if defined(KOKKOS_HAVE_CXX11_DISPATCH_LAMBDA) +#if defined(KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) // Cuda version 8.0 still needs the functor wrapper - #if (KOKKOS_HAVE_CXX11_DISPATCH_LAMBDA /* && (CUDA_VERSION < 8000) */ ) && defined(__NVCC__) + #if (KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA /* && (CUDA_VERSION < 8000) */ ) && defined(__NVCC__) #define KOKKOS_IMPL_NEED_FUNCTOR_WRAPPER #endif #endif @@ -156,7 +157,7 @@ /*--------------------------------------------------------------------------*/ /* Language info: C++, CUDA, OPENMP */ -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) // Compiling Cuda code to 'ptx' #define KOKKOS_FORCEINLINE_FUNCTION __device__ __host__ __forceinline__ @@ -185,21 +186,21 @@ #define KOKKOS_COMPILER_NVCC __NVCC__ #else -#if defined( KOKKOS_HAVE_CXX11 ) && ! defined( KOKKOS_HAVE_CXX11_DISPATCH_LAMBDA ) - #if !defined (KOKKOS_HAVE_CUDA) // Compiling with clang for Cuda does not work with LAMBDAs either +#if ! defined( KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA ) + #if !defined (KOKKOS_ENABLE_CUDA) // Compiling with clang for Cuda does not work with LAMBDAs either // CUDA (including version 6.5) does not support giving lambdas as // arguments to global functions. Thus its not currently possible // to dispatch lambdas from the host. - #define KOKKOS_HAVE_CXX11_DISPATCH_LAMBDA 1 + #define KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA 1 #endif #endif #endif /* #if defined( __NVCC__ ) */ -#if defined( KOKKOS_HAVE_CXX11 ) && !defined (KOKKOS_LAMBDA) +#if !defined (KOKKOS_LAMBDA) #define KOKKOS_LAMBDA [=] #endif -#if defined( KOKKOS_HAVE_CXX1Z ) && !defined (KOKKOS_CLASS_LAMBDA) +#if defined( KOKKOS_ENABLE_CXX1Z ) && !defined (KOKKOS_CLASS_LAMBDA) #define KOKKOS_CLASS_LAMBDA [=,*this] #endif @@ -259,11 +260,11 @@ #if defined( KOKKOS_COMPILER_INTEL ) - #define KOKKOS_HAVE_PRAGMA_UNROLL 1 - #define KOKKOS_HAVE_PRAGMA_IVDEP 1 - #define KOKKOS_HAVE_PRAGMA_LOOPCOUNT 1 - #define KOKKOS_HAVE_PRAGMA_VECTOR 1 - #define KOKKOS_HAVE_PRAGMA_SIMD 1 + #define KOKKOS_ENABLE_PRAGMA_UNROLL 1 + #define KOKKOS_ENABLE_PRAGMA_IVDEP 1 + #define KOKKOS_ENABLE_PRAGMA_LOOPCOUNT 1 + #define KOKKOS_ENABLE_PRAGMA_VECTOR 1 + #define KOKKOS_ENABLE_PRAGMA_SIMD 1 #define KOKKOS_RESTRICT __restrict__ @@ -317,11 +318,11 @@ #if defined( KOKKOS_COMPILER_IBM ) - #define KOKKOS_HAVE_PRAGMA_UNROLL 1 - //#define KOKKOS_HAVE_PRAGMA_IVDEP 1 - //#define KOKKOS_HAVE_PRAGMA_LOOPCOUNT 1 - //#define KOKKOS_HAVE_PRAGMA_VECTOR 1 - //#define KOKKOS_HAVE_PRAGMA_SIMD 1 + #define KOKKOS_ENABLE_PRAGMA_UNROLL 1 + //#define KOKKOS_ENABLE_PRAGMA_IVDEP 1 + //#define KOKKOS_ENABLE_PRAGMA_LOOPCOUNT 1 + //#define KOKKOS_ENABLE_PRAGMA_VECTOR 1 + //#define KOKKOS_ENABLE_PRAGMA_SIMD 1 #endif @@ -330,11 +331,11 @@ #if defined( KOKKOS_COMPILER_CLANG ) - //#define KOKKOS_HAVE_PRAGMA_UNROLL 1 - //#define KOKKOS_HAVE_PRAGMA_IVDEP 1 - //#define KOKKOS_HAVE_PRAGMA_LOOPCOUNT 1 - //#define KOKKOS_HAVE_PRAGMA_VECTOR 1 - //#define KOKKOS_HAVE_PRAGMA_SIMD 1 + //#define KOKKOS_ENABLE_PRAGMA_UNROLL 1 + //#define KOKKOS_ENABLE_PRAGMA_IVDEP 1 + //#define KOKKOS_ENABLE_PRAGMA_LOOPCOUNT 1 + //#define KOKKOS_ENABLE_PRAGMA_VECTOR 1 + //#define KOKKOS_ENABLE_PRAGMA_SIMD 1 #if ! defined( KOKKOS_FORCEINLINE_FUNCTION ) #define KOKKOS_FORCEINLINE_FUNCTION inline __attribute__((always_inline)) @@ -347,11 +348,11 @@ #if defined( KOKKOS_COMPILER_GNU ) - //#define KOKKOS_HAVE_PRAGMA_UNROLL 1 - //#define KOKKOS_HAVE_PRAGMA_IVDEP 1 - //#define KOKKOS_HAVE_PRAGMA_LOOPCOUNT 1 - //#define KOKKOS_HAVE_PRAGMA_VECTOR 1 - //#define KOKKOS_HAVE_PRAGMA_SIMD 1 + //#define KOKKOS_ENABLE_PRAGMA_UNROLL 1 + //#define KOKKOS_ENABLE_PRAGMA_IVDEP 1 + //#define KOKKOS_ENABLE_PRAGMA_LOOPCOUNT 1 + //#define KOKKOS_ENABLE_PRAGMA_VECTOR 1 + //#define KOKKOS_ENABLE_PRAGMA_SIMD 1 #if ! defined( KOKKOS_FORCEINLINE_FUNCTION ) #define KOKKOS_FORCEINLINE_FUNCTION inline __attribute__((always_inline)) @@ -371,11 +372,11 @@ #if defined( KOKKOS_COMPILER_PGI ) - #define KOKKOS_HAVE_PRAGMA_UNROLL 1 - #define KOKKOS_HAVE_PRAGMA_IVDEP 1 - //#define KOKKOS_HAVE_PRAGMA_LOOPCOUNT 1 - #define KOKKOS_HAVE_PRAGMA_VECTOR 1 - //#define KOKKOS_HAVE_PRAGMA_SIMD 1 + #define KOKKOS_ENABLE_PRAGMA_UNROLL 1 + #define KOKKOS_ENABLE_PRAGMA_IVDEP 1 + //#define KOKKOS_ENABLE_PRAGMA_LOOPCOUNT 1 + #define KOKKOS_ENABLE_PRAGMA_VECTOR 1 + //#define KOKKOS_ENABLE_PRAGMA_SIMD 1 #endif @@ -384,7 +385,7 @@ #if defined( KOKKOS_COMPILER_NVCC ) #if defined(__CUDA_ARCH__ ) - #define KOKKOS_HAVE_PRAGMA_UNROLL 1 + #define KOKKOS_ENABLE_PRAGMA_UNROLL 1 #endif #endif @@ -426,19 +427,15 @@ #define KOKKOS_ALIGN_PTR(size) __attribute__((aligned(size))) #endif -#if ! defined(KOKKOS_ALIGN_16) -#define KOKKOS_ALIGN_16 KOKKOS_ALIGN(16) -#endif - //---------------------------------------------------------------------------- /** Determine the default execution space for parallel dispatch. * There is zero or one default execution space specified. */ -#if 1 < ( ( defined ( KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_CUDA ) ? 1 : 0 ) + \ - ( defined ( KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_OPENMP ) ? 1 : 0 ) + \ - ( defined ( KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_THREADS ) ? 1 : 0 ) + \ - ( defined ( KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_SERIAL ) ? 1 : 0 ) ) +#if 1 < ( ( defined ( KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_CUDA ) ? 1 : 0 ) + \ + ( defined ( KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_OPENMP ) ? 1 : 0 ) + \ + ( defined ( KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_THREADS ) ? 1 : 0 ) + \ + ( defined ( KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_SERIAL ) ? 1 : 0 ) ) #error "More than one KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_* specified" ; @@ -447,24 +444,24 @@ /** If default is not specified then chose from enabled execution spaces. * Priority: CUDA, OPENMP, THREADS, SERIAL */ -#if defined ( KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_CUDA ) -#elif defined ( KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_OPENMP ) -#elif defined ( KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_THREADS ) -#elif defined ( KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_SERIAL ) -#elif defined ( KOKKOS_HAVE_CUDA ) -#define KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_CUDA -#elif defined ( KOKKOS_HAVE_OPENMP ) -#define KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_OPENMP -#elif defined ( KOKKOS_HAVE_PTHREAD ) -#define KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_THREADS +#if defined ( KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_CUDA ) +#elif defined ( KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_OPENMP ) +#elif defined ( KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_THREADS ) +#elif defined ( KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_SERIAL ) +#elif defined ( KOKKOS_ENABLE_CUDA ) +#define KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_CUDA +#elif defined ( KOKKOS_ENABLE_OPENMP ) +#define KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_OPENMP +#elif defined ( KOKKOS_ENABLE_PTHREAD ) +#define KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_THREADS #else -#define KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_SERIAL +#define KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_SERIAL #endif //---------------------------------------------------------------------------- /** Determine for what space the code is being compiled: */ -#if defined( __CUDACC__ ) && defined( __CUDA_ARCH__ ) && defined (KOKKOS_HAVE_CUDA) +#if defined( __CUDACC__ ) && defined( __CUDA_ARCH__ ) && defined (KOKKOS_ENABLE_CUDA) #define KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_CUDA #else #define KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST @@ -476,7 +473,7 @@ #if ( defined( _POSIX_C_SOURCE ) && _POSIX_C_SOURCE >= 200112L ) || \ ( defined( _XOPEN_SOURCE ) && _XOPEN_SOURCE >= 600 ) #if defined(KOKKOS_ENABLE_PERFORMANCE_POSIX_MEMALIGN) -#define KOKKOS_POSIX_MEMALIGN_AVAILABLE 1 +#define KOKKOS_ENABLE_POSIX_MEMALIGN 1 #endif #endif @@ -489,15 +486,6 @@ #define KOKKOS_ENABLE_PROFILING 1 #endif -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- -/* Transitional macro to change between old and new View - * are no longer supported. - */ - -#define KOKKOS_USING_EXP_VIEW 1 -#define KOKKOS_USING_EXPERIMENTAL_VIEW - //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- diff --git a/lib/kokkos/core/src/Kokkos_MemoryPool.hpp b/lib/kokkos/core/src/Kokkos_MemoryPool.hpp index e4f895b7d3..2d45926e76 100644 --- a/lib/kokkos/core/src/Kokkos_MemoryPool.hpp +++ b/lib/kokkos/core/src/Kokkos_MemoryPool.hpp @@ -57,18 +57,18 @@ // How should errors be handled? In general, production code should return a // value indicating failure so the user can decide how the error is handled. -// While experimental, code can abort instead. If KOKKOS_MEMPOOL_PRINTERR is +// While experimental, code can abort instead. If KOKKOS_ENABLE_MEMPOOL_PRINTERR is // defined, the code will abort with an error message. Otherwise, the code will // return with a value indicating failure when possible, or do nothing instead. -//#define KOKKOS_MEMPOOL_PRINTERR +//#define KOKKOS_ENABLE_MEMPOOL_PRINTERR -//#define KOKKOS_MEMPOOL_PRINT_INFO -//#define KOKKOS_MEMPOOL_PRINT_CONSTRUCTOR_INFO -//#define KOKKOS_MEMPOOL_PRINT_BLOCKSIZE_INFO -//#define KOKKOS_MEMPOOL_PRINT_SUPERBLOCK_INFO -//#define KOKKOS_MEMPOOL_PRINT_ACTIVE_SUPERBLOCKS -//#define KOKKOS_MEMPOOL_PRINT_PAGE_INFO -//#define KOKKOS_MEMPOOL_PRINT_INDIVIDUAL_PAGE_INFO +//#define KOKKOS_ENABLE_MEMPOOL_PRINT_INFO +//#define KOKKOS_ENABLE_MEMPOOL_PRINT_CONSTRUCTOR_INFO +//#define KOKKOS_ENABLE_MEMPOOL_PRINT_BLOCKSIZE_INFO +//#define KOKKOS_ENABLE_MEMPOOL_PRINT_SUPERBLOCK_INFO +//#define KOKKOS_ENABLE_MEMPOOL_PRINT_ACTIVE_SUPERBLOCKS +//#define KOKKOS_ENABLE_MEMPOOL_PRINT_PAGE_INFO +//#define KOKKOS_ENABLE_MEMPOOL_PRINT_INDIVIDUAL_PAGE_INFO //---------------------------------------------------------------------------- @@ -451,7 +451,7 @@ struct create_histogram { } }; -#ifdef KOKKOS_MEMPOOL_PRINT_SUPERBLOCK_INFO +#ifdef KOKKOS_ENABLE_MEMPOOL_PRINT_SUPERBLOCK_INFO template < typename UInt32View, typename SBHeaderView, typename MempoolBitset > struct count_allocated_blocks { typedef typename UInt32View::execution_space execution_space; @@ -790,7 +790,7 @@ public: } } -#ifdef KOKKOS_MEMPOOL_PRINT_CONSTRUCTOR_INFO +#ifdef KOKKOS_ENABLE_MEMPOOL_PRINT_CONSTRUCTOR_INFO printf( "\n" ); printf( " m_lg_sb_size: %12lu\n", m_lg_sb_size ); printf( " m_sb_size: %12lu\n", m_sb_size ); @@ -810,7 +810,7 @@ public: fflush( stdout ); #endif -#ifdef KOKKOS_MEMPOOL_PRINT_BLOCKSIZE_INFO +#ifdef KOKKOS_ENABLE_MEMPOOL_PRINT_BLOCKSIZE_INFO // Print the blocksize info for all the block sizes. printf( "SIZE BLOCKS_PER_SB PAGES_PER_SB SB_FULL_LEVEL PAGE_FULL_LEVEL\n" ); for ( size_t i = 0; i < m_num_block_size; ++i ) { @@ -845,7 +845,7 @@ public: uint32_t blocks_per_sb = m_blocksize_info[block_size_id].m_blocks_per_sb; uint32_t pages_per_sb = m_blocksize_info[block_size_id].m_pages_per_sb; -#ifdef KOKKOS_CUDA_CLANG_WORKAROUND +#ifdef KOKKOS_IMPL_CUDA_CLANG_WORKAROUND // Without this test it looks like pages_per_sb might come back wrong. if ( pages_per_sb == 0 ) return NULL; #endif @@ -966,7 +966,7 @@ public: if ( new_sb_id == sb_id ) { allocation_done = true; -#ifdef KOKKOS_MEMPOOL_PRINT_INFO +#ifdef KOKKOS_ENABLE_MEMPOOL_PRINT_INFO printf( "** No superblocks available. **\n" ); #ifdef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST fflush( stdout ); @@ -979,7 +979,7 @@ public: } } } -#ifdef KOKKOS_MEMPOOL_PRINT_INFO +#ifdef KOKKOS_ENABLE_MEMPOOL_PRINT_INFO else { printf( "** Requested allocation size (%zu) larger than superblock size (%lu). **\n", alloc_size, m_sb_size ); @@ -1068,7 +1068,7 @@ public: } } } -#ifdef KOKKOS_MEMPOOL_PRINTERR +#ifdef KOKKOS_ENABLE_MEMPOOL_PRINTERR else { printf( "\n** MemoryPool::deallocate() ADDRESS_OUT_OF_RANGE(0x%llx) **\n", reinterpret_cast( alloc_ptr ) ); @@ -1109,7 +1109,7 @@ public: { printf( "\n" ); -#ifdef KOKKOS_MEMPOOL_PRINT_SUPERBLOCK_INFO +#ifdef KOKKOS_ENABLE_MEMPOOL_PRINT_SUPERBLOCK_INFO typename SBHeaderView::HostMirror host_sb_header = create_mirror_view( m_sb_header ); deep_copy( host_sb_header, m_sb_header ); @@ -1188,7 +1188,7 @@ public: num_active_sb += host_active(i) != INVALID_SUPERBLOCK; } -#ifdef KOKKOS_MEMPOOL_PRINT_ACTIVE_SUPERBLOCKS +#ifdef KOKKOS_ENABLE_MEMPOOL_PRINT_ACTIVE_SUPERBLOCKS // Print active superblocks. printf( "BS_ID SB_ID\n" ); for ( size_t i = 0; i < m_num_block_size; ++i ) { @@ -1208,7 +1208,7 @@ public: fflush( stdout ); #endif -#ifdef KOKKOS_MEMPOOL_PRINT_PAGE_INFO +#ifdef KOKKOS_ENABLE_MEMPOOL_PRINT_PAGE_INFO // Print the summary page histogram. printf( "USED_BLOCKS PAGE_COUNT\n" ); for ( uint32_t i = 0; i < 33; ++i ) { @@ -1217,7 +1217,7 @@ public: printf( "\n" ); #endif -#ifdef KOKKOS_MEMPOOL_PRINT_INDIVIDUAL_PAGE_INFO +#ifdef KOKKOS_ENABLE_MEMPOOL_PRINT_INDIVIDUAL_PAGE_INFO // Print the page histogram for a few individual superblocks. // const uint32_t num_sb_id = 2; // uint32_t sb_id[num_sb_id] = { 0, 10 }; @@ -1484,7 +1484,7 @@ private: // 1. An invalid superblock should never be found here. // 2. If the new superblock is the same as the previous superblock, the // allocator is empty. -#ifdef KOKKOS_MEMPOOL_PRINTERR +#ifdef KOKKOS_ENABLE_MEMPOOL_PRINTERR if ( new_sb == INVALID_SUPERBLOCK ) { printf( "\n** MemoryPool::find_superblock() FOUND_INACTIVE_SUPERBLOCK **\n" ); #ifdef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST @@ -1531,28 +1531,28 @@ private: } // namespace Experimental } // namespace Kokkos -#ifdef KOKKOS_MEMPOOL_PRINTERR -#undef KOKKOS_MEMPOOL_PRINTERR +#ifdef KOKKOS_ENABLE_MEMPOOL_PRINTERR +#undef KOKKOS_ENABLE_MEMPOOL_PRINTERR #endif -#ifdef KOKKOS_MEMPOOL_PRINT_INFO -#undef KOKKOS_MEMPOOL_PRINT_INFO +#ifdef KOKKOS_ENABLE_MEMPOOL_PRINT_INFO +#undef KOKKOS_ENABLE_MEMPOOL_PRINT_INFO #endif -#ifdef KOKKOS_MEMPOOL_PRINT_BLOCKSIZE_INFO -#undef KOKKOS_MEMPOOL_PRINT_BLOCKSIZE_INFO +#ifdef KOKKOS_ENABLE_MEMPOOL_PRINT_BLOCKSIZE_INFO +#undef KOKKOS_ENABLE_MEMPOOL_PRINT_BLOCKSIZE_INFO #endif -#ifdef KOKKOS_MEMPOOL_PRINT_SUPERBLOCK_INFO -#undef KOKKOS_MEMPOOL_PRINT_SUPERBLOCK_INFO +#ifdef KOKKOS_ENABLE_MEMPOOL_PRINT_SUPERBLOCK_INFO +#undef KOKKOS_ENABLE_MEMPOOL_PRINT_SUPERBLOCK_INFO #endif -#ifdef KOKKOS_MEMPOOL_PRINT_PAGE_INFO -#undef KOKKOS_MEMPOOL_PRINT_PAGE_INFO +#ifdef KOKKOS_ENABLE_MEMPOOL_PRINT_PAGE_INFO +#undef KOKKOS_ENABLE_MEMPOOL_PRINT_PAGE_INFO #endif -#ifdef KOKKOS_MEMPOOL_PRINT_INDIVIDUAL_PAGE_INFO -#undef KOKKOS_MEMPOOL_PRINT_INDIVIDUAL_PAGE_INFO +#ifdef KOKKOS_ENABLE_MEMPOOL_PRINT_INDIVIDUAL_PAGE_INFO +#undef KOKKOS_ENABLE_MEMPOOL_PRINT_INDIVIDUAL_PAGE_INFO #endif #endif // KOKKOS_MEMORYPOOL_HPP diff --git a/lib/kokkos/core/src/Kokkos_OpenMP.hpp b/lib/kokkos/core/src/Kokkos_OpenMP.hpp index 0e6c6d84fe..a337d1a9d4 100644 --- a/lib/kokkos/core/src/Kokkos_OpenMP.hpp +++ b/lib/kokkos/core/src/Kokkos_OpenMP.hpp @@ -46,14 +46,18 @@ #include -#if defined( KOKKOS_HAVE_OPENMP ) && defined( _OPENMP ) +#if defined( KOKKOS_ENABLE_OPENMP) && !defined(_OPENMP) +#error "You enabled Kokkos OpenMP support without enabling OpenMP in the compiler!" +#endif + +#if defined( KOKKOS_ENABLE_OPENMP ) && defined( _OPENMP ) #include #include #include #include -#ifdef KOKKOS_HAVE_HBWSPACE +#ifdef KOKKOS_ENABLE_HBWSPACE #include #endif #include @@ -77,7 +81,7 @@ public: //! Tag this class as a kokkos execution space typedef OpenMP execution_space ; - #ifdef KOKKOS_HAVE_HBWSPACE + #ifdef KOKKOS_ENABLE_HBWSPACE typedef Experimental::HBWSpace memory_space ; #else typedef HostSpace memory_space ; @@ -194,7 +198,7 @@ struct VerifyExecutionCanAccessMemorySpace /*--------------------------------------------------------------------------*/ -#endif /* #if defined( KOKKOS_HAVE_OPENMP ) && defined( _OPENMP ) */ +#endif /* #if defined( KOKKOS_ENABLE_OPENMP ) && defined( _OPENMP ) */ #endif /* #ifndef KOKKOS_OPENMP_HPP */ diff --git a/lib/kokkos/core/src/Kokkos_Parallel.hpp b/lib/kokkos/core/src/Kokkos_Parallel.hpp index 588dc90af3..64b1502bcc 100644 --- a/lib/kokkos/core/src/Kokkos_Parallel.hpp +++ b/lib/kokkos/core/src/Kokkos_Parallel.hpp @@ -61,7 +61,7 @@ #include #include -#ifdef KOKKOS_HAVE_DEBUG +#ifdef KOKKOS_DEBUG #include #endif diff --git a/lib/kokkos/core/src/Kokkos_Parallel_Reduce.hpp b/lib/kokkos/core/src/Kokkos_Parallel_Reduce.hpp index 3a73e8a817..a3649b4422 100644 --- a/lib/kokkos/core/src/Kokkos_Parallel_Reduce.hpp +++ b/lib/kokkos/core/src/Kokkos_Parallel_Reduce.hpp @@ -978,7 +978,7 @@ struct ParallelReduceReturnValue::type value_type; diff --git a/lib/kokkos/core/src/Kokkos_ScratchSpace.hpp b/lib/kokkos/core/src/Kokkos_ScratchSpace.hpp index 09a5993863..ff6da6bef4 100644 --- a/lib/kokkos/core/src/Kokkos_ScratchSpace.hpp +++ b/lib/kokkos/core/src/Kokkos_ScratchSpace.hpp @@ -106,14 +106,14 @@ public: void* tmp = m_iter_L0 + m_offset * align (size); if (m_end_L0 < (m_iter_L0 += align (size) * m_multiplier)) { m_iter_L0 -= align (size) * m_multiplier; // put it back like it was - #ifdef KOKKOS_HAVE_DEBUG + #ifdef KOKKOS_DEBUG // mfh 23 Jun 2015: printf call consumes 25 registers // in a CUDA build, so only print in debug mode. The // function still returns NULL if not enough memory. printf ("ScratchMemorySpace<...>::get_shmem: Failed to allocate " "%ld byte(s); remaining capacity is %ld byte(s)\n", long(size), long(m_end_L0-m_iter_L0)); - #endif // KOKKOS_HAVE_DEBUG + #endif // KOKKOS_DEBUG tmp = 0; } return tmp; @@ -121,14 +121,14 @@ public: void* tmp = m_iter_L1 + m_offset * align (size); if (m_end_L1 < (m_iter_L1 += align (size) * m_multiplier)) { m_iter_L1 -= align (size) * m_multiplier; // put it back like it was - #ifdef KOKKOS_HAVE_DEBUG + #ifdef KOKKOS_DEBUG // mfh 23 Jun 2015: printf call consumes 25 registers // in a CUDA build, so only print in debug mode. The // function still returns NULL if not enough memory. printf ("ScratchMemorySpace<...>::get_shmem: Failed to allocate " "%ld byte(s); remaining capacity is %ld byte(s)\n", long(size), long(m_end_L1-m_iter_L1)); - #endif // KOKKOS_HAVE_DEBUG + #endif // KOKKOS_DEBUG tmp = 0; } return tmp; diff --git a/lib/kokkos/core/src/Kokkos_Serial.hpp b/lib/kokkos/core/src/Kokkos_Serial.hpp index 914edbc7c4..f262535910 100644 --- a/lib/kokkos/core/src/Kokkos_Serial.hpp +++ b/lib/kokkos/core/src/Kokkos_Serial.hpp @@ -61,7 +61,7 @@ #include -#if defined( KOKKOS_HAVE_SERIAL ) +#if defined( KOKKOS_ENABLE_SERIAL ) namespace Kokkos { @@ -1005,7 +1005,7 @@ template KOKKOS_INLINE_FUNCTION void parallel_for(const Impl::ThreadVectorRangeBoundariesStruct& loop_boundaries, const Lambda& lambda) { - #ifdef KOKKOS_HAVE_PRAGMA_IVDEP + #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP #pragma ivdep #endif for( iType i = loop_boundaries.start; i < loop_boundaries.end; i+=loop_boundaries.increment) @@ -1021,7 +1021,7 @@ KOKKOS_INLINE_FUNCTION void parallel_reduce(const Impl::ThreadVectorRangeBoundariesStruct& loop_boundaries, const Lambda & lambda, ValueType& result) { result = ValueType(); -#ifdef KOKKOS_HAVE_PRAGMA_IVDEP +#ifdef KOKKOS_ENABLE_PRAGMA_IVDEP #pragma ivdep #endif for( iType i = loop_boundaries.start; i < loop_boundaries.end; i+=loop_boundaries.increment) { @@ -1044,7 +1044,7 @@ void parallel_reduce(const Impl::ThreadVectorRangeBoundariesStruct& , const Func #include -#endif // defined( KOKKOS_HAVE_SERIAL ) +#endif // defined( KOKKOS_ENABLE_SERIAL ) #endif /* #define KOKKOS_SERIAL_HPP */ //---------------------------------------------------------------------------- diff --git a/lib/kokkos/core/src/Kokkos_TaskScheduler.hpp b/lib/kokkos/core/src/Kokkos_TaskScheduler.hpp index 0de926aa12..e4271aa188 100644 --- a/lib/kokkos/core/src/Kokkos_TaskScheduler.hpp +++ b/lib/kokkos/core/src/Kokkos_TaskScheduler.hpp @@ -1,13 +1,13 @@ /* //@HEADER // ************************************************************************ -// +// // Kokkos v. 2.0 // Copyright (2014) Sandia Corporation -// +// // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, // the U.S. Government retains certain rights in this software. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -36,7 +36,7 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) -// +// // ************************************************************************ //@HEADER */ @@ -52,9 +52,9 @@ // and use relocateable device code to enable the task policy. // nvcc relocatable device code option: --relocatable-device-code=true -#if ( defined( KOKKOS_HAVE_CUDA ) ) +#if ( defined( KOKKOS_ENABLE_CUDA ) ) #if ( 8000 <= CUDA_VERSION ) && \ - defined( KOKKOS_CUDA_USE_RELOCATABLE_DEVICE_CODE ) + defined( KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE ) #define KOKKOS_ENABLE_TASKDAG @@ -63,7 +63,6 @@ #define KOKKOS_ENABLE_TASKDAG #endif - #if defined( KOKKOS_ENABLE_TASKDAG ) //---------------------------------------------------------------------------- @@ -90,6 +89,34 @@ class TaskScheduler ; //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- +namespace Kokkos { +namespace Impl { + +/*\brief Implementation data for task data management, access, and execution. + * + * CRTP Inheritance structure to allow static_cast from the + * task root type and a task's FunctorType. + * + * TaskBase< Space , ResultType , FunctorType > + * : TaskBase< Space , ResultType , void > + * , FunctorType + * { ... }; + * + * TaskBase< Space , ResultType , void > + * : TaskBase< Space , void , void > + * { ... }; + */ +template< typename Space , typename ResultType , typename FunctorType > +class TaskBase ; + +template< typename Space > +class TaskExec ; + +} // namespace Impl +} // namespace Kokkos + +//---------------------------------------------------------------------------- + namespace Kokkos { /** @@ -302,14 +329,6 @@ enum TaskPriority { TaskHighPriority = 0 template< typename Space > void wait( TaskScheduler< Space > const & ); -} // namespace Kokkos - -//---------------------------------------------------------------------------- - -namespace Kokkos { - - - } // namespace Kokkos //---------------------------------------------------------------------------- @@ -360,23 +379,10 @@ private: template< typename A1 , typename A2 , typename ... Options > KOKKOS_INLINE_FUNCTION static void assign( task_base * const task - , Future< A1 , A2 > const & arg + , Future< A1 , A2 > const & arg , Options const & ... opts ) { - // Assign dependence to task->m_next - // which will be processed within subsequent call to schedule. - // Error if the dependence is reset. - - if ( 0 != Kokkos::atomic_exchange(& task->m_next, arg.m_task) ) { - Kokkos::abort("TaskScheduler ERROR: resetting task dependence"); - } - - if ( 0 != arg.m_task ) { - // The future may be destroyed upon returning from this call - // so increment reference count to track this assignment. - Kokkos::atomic_increment( &(arg.m_task->m_ref_count) ); - } - + task->add_dependence( arg.m_task ); assign( task , opts ... ); } @@ -463,7 +469,7 @@ public: template< typename FunctorType , typename ... Options > KOKKOS_FUNCTION Future< typename FunctorType::value_type , ExecSpace > - task_spawn( FunctorType const & arg_functor + task_spawn( FunctorType const & arg_functor , Options const & ... arg_options ) const { @@ -521,7 +527,7 @@ public: template< typename FunctorType , typename ... Options > inline Future< typename FunctorType::value_type , ExecSpace > - host_spawn( FunctorType const & arg_functor + host_spawn( FunctorType const & arg_functor , Options const & ... arg_options ) const { @@ -538,7 +544,7 @@ public: future_type f ; // Allocate task from memory pool - f.m_task = + f.m_task = reinterpret_cast( m_queue->allocate(sizeof(task_type)) ); if ( f.m_task ) { @@ -558,8 +564,7 @@ public: // Potentially spawning outside execution space so the // apply function pointer must be obtained from execution space. // Required for Cuda execution space function pointer. - queue_type::specialization::template - proc_set_apply< FunctorType >( & f.m_task->m_apply ); + m_queue->template proc_set_apply< FunctorType >( & f.m_task->m_apply ); m_queue->schedule( f.m_task ); } @@ -612,7 +617,7 @@ public: for ( int i = 0 ; i < narg ; ++i ) { task_base * const t = dep[i] = arg[i].m_task ; if ( 0 != t ) { - Kokkos::atomic_increment( &(t->m_ref_count) ); + Kokkos::atomic_increment( &(t->m_ref_count) ); } } @@ -638,25 +643,13 @@ public: , value_type , FunctorType > ; - task_base * const zero = (task_base *) 0 ; - task_base * const lock = (task_base *) task_base::LockTag ; task_type * const task = static_cast< task_type * >( task_self ); - // Precondition: - // task is in Executing state - // therefore m_next == LockTag - // - // Change to m_next == 0 for no dependence - - if ( lock != Kokkos::atomic_exchange( & task->m_next, zero ) ) { - Kokkos::abort("TaskScheduler::respawn ERROR: already respawned"); - } + // Reschedule task with no dependences. + m_queue->reschedule( task ); + // Dependences, if requested, are added here through parsing the arguments. assign( task , arg_options... ); - - // Postcondition: - // task is in Executing-Respawn state - // therefore m_next == dependece or 0 } //---------------------------------------- @@ -697,4 +690,3 @@ void wait( TaskScheduler< ExecSpace > const & policy ) #endif /* #if defined( KOKKOS_ENABLE_TASKDAG ) */ #endif /* #ifndef KOKKOS_TASKSCHEDULER_HPP */ - diff --git a/lib/kokkos/core/src/Kokkos_Threads.hpp b/lib/kokkos/core/src/Kokkos_Threads.hpp index f01b14724a..aca482b427 100644 --- a/lib/kokkos/core/src/Kokkos_Threads.hpp +++ b/lib/kokkos/core/src/Kokkos_Threads.hpp @@ -46,7 +46,7 @@ #include -#if defined( KOKKOS_HAVE_PTHREAD ) +#if defined( KOKKOS_ENABLE_PTHREAD ) #include #include @@ -227,7 +227,7 @@ struct VerifyExecutionCanAccessMemorySpace //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- -#endif /* #if defined( KOKKOS_HAVE_PTHREAD ) */ +#endif /* #if defined( KOKKOS_ENABLE_PTHREAD ) */ #endif /* #define KOKKOS_THREADS_HPP */ diff --git a/lib/kokkos/core/src/Kokkos_Timer.hpp b/lib/kokkos/core/src/Kokkos_Timer.hpp index 4eca5037e4..5fd4752cd9 100644 --- a/lib/kokkos/core/src/Kokkos_Timer.hpp +++ b/lib/kokkos/core/src/Kokkos_Timer.hpp @@ -47,10 +47,10 @@ #include #ifdef _MSC_VER -#undef KOKKOS_USE_LIBRT +#undef KOKKOS_ENABLE_LIBRT #include #else -#ifdef KOKKOS_USE_LIBRT +#ifdef KOKKOS_ENABLE_LIBRT #include #else #include @@ -63,7 +63,7 @@ namespace Kokkos { class Timer { private: - #ifdef KOKKOS_USE_LIBRT + #ifdef KOKKOS_ENABLE_LIBRT struct timespec m_old; #else struct timeval m_old ; @@ -74,7 +74,7 @@ public: inline void reset() { - #ifdef KOKKOS_USE_LIBRT + #ifdef KOKKOS_ENABLE_LIBRT clock_gettime(CLOCK_REALTIME, &m_old); #else gettimeofday( & m_old , ((struct timezone *) NULL ) ); @@ -90,7 +90,7 @@ public: inline double seconds() const { - #ifdef KOKKOS_USE_LIBRT + #ifdef KOKKOS_ENABLE_LIBRT struct timespec m_new; clock_gettime(CLOCK_REALTIME, &m_new); diff --git a/lib/kokkos/core/src/Kokkos_Vectorization.hpp b/lib/kokkos/core/src/Kokkos_Vectorization.hpp index a60c0ecaa7..9d7df2de5e 100644 --- a/lib/kokkos/core/src/Kokkos_Vectorization.hpp +++ b/lib/kokkos/core/src/Kokkos_Vectorization.hpp @@ -46,7 +46,7 @@ #ifndef KOKKOS_VECTORIZATION_HPP #define KOKKOS_VECTORIZATION_HPP -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) #include #endif diff --git a/lib/kokkos/core/src/Kokkos_View.hpp b/lib/kokkos/core/src/Kokkos_View.hpp index b728b36492..6575824d3d 100644 --- a/lib/kokkos/core/src/Kokkos_View.hpp +++ b/lib/kokkos/core/src/Kokkos_View.hpp @@ -623,13 +623,13 @@ private: #if defined( KOKKOS_ENABLE_DEBUG_BOUNDS_CHECK ) -#define KOKKOS_VIEW_OPERATOR_VERIFY( ARG ) \ +#define KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( ARG ) \ View::template verify_space< Kokkos::Impl::ActiveExecutionMemorySpace >::check(); \ Kokkos::Impl::view_verify_operator_bounds ARG ; #else -#define KOKKOS_VIEW_OPERATOR_VERIFY( ARG ) \ +#define KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( ARG ) \ View::template verify_space< Kokkos::Impl::ActiveExecutionMemorySpace >::check(); #endif @@ -647,9 +647,9 @@ public: operator()( Args ... args ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (NULL,m_map,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (NULL,m_map,args...) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,args...) ) #endif return m_map.reference(); @@ -670,9 +670,9 @@ public: , Args ... args ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,args...) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,args...) ) #endif return m_map.reference(i0); @@ -692,9 +692,9 @@ public: { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,args...) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,args...) ) #endif return m_map.m_handle[ i0 ]; @@ -713,9 +713,9 @@ public: , Args ... args ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,args...) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,args...) ) #endif return m_map.m_handle[ m_map.m_offset.m_stride.S0 * i0 ]; @@ -734,9 +734,9 @@ public: operator[]( const I0 & i0 ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0) ) #endif return m_map.reference(i0); @@ -753,9 +753,9 @@ public: operator[]( const I0 & i0 ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0) ) #endif return m_map.m_handle[ i0 ]; @@ -772,9 +772,9 @@ public: operator[]( const I0 & i0 ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0) ) #endif return m_map.m_handle[ m_map.m_offset.m_stride.S0 * i0 ]; @@ -795,9 +795,9 @@ public: , Args ... args ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,args...) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,args...) ) #endif return m_map.reference(i0,i1); @@ -816,9 +816,9 @@ public: , Args ... args ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,args...) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,args...) ) #endif return m_map.m_handle[ i0 + m_map.m_offset.m_dim.N0 * i1 ]; @@ -837,9 +837,9 @@ public: , Args ... args ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,args...) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,args...) ) #endif return m_map.m_handle[ i0 + m_map.m_offset.m_stride * i1 ]; @@ -858,9 +858,9 @@ public: , Args ... args ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,args...) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,args...) ) #endif return m_map.m_handle[ i1 + m_map.m_offset.m_dim.N1 * i0 ]; @@ -879,9 +879,9 @@ public: , Args ... args ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,args...) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,args...) ) #endif return m_map.m_handle[ i1 + m_map.m_offset.m_stride * i0 ]; @@ -900,9 +900,9 @@ public: , Args ... args ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,args...) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,args...) ) #endif return m_map.m_handle[ i0 * m_map.m_offset.m_stride.S0 + @@ -924,9 +924,9 @@ public: , Args ... args ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,i2,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,i2,args...) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,i2,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,i2,args...) ) #endif return m_map.m_handle[ m_map.m_offset(i0,i1,i2) ]; @@ -944,9 +944,9 @@ public: , Args ... args ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,i2,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,i2,args...) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,i2,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,i2,args...) ) #endif return m_map.reference(i0,i1,i2); @@ -967,9 +967,9 @@ public: , Args ... args ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,i2,i3,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,i2,i3,args...) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,i2,i3,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,i2,i3,args...) ) #endif return m_map.m_handle[ m_map.m_offset(i0,i1,i2,i3) ]; @@ -987,9 +987,9 @@ public: , Args ... args ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,i2,i3,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,i2,i3,args...) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,i2,i3,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,i2,i3,args...) ) #endif return m_map.reference(i0,i1,i2,i3); @@ -1012,9 +1012,9 @@ public: , Args ... args ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,i2,i3,i4,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,i2,i3,i4,args...) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,i2,i3,i4,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,i2,i3,i4,args...) ) #endif return m_map.m_handle[ m_map.m_offset(i0,i1,i2,i3,i4) ]; @@ -1034,9 +1034,9 @@ public: , Args ... args ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,i2,i3,i4,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,i2,i3,i4,args...) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,i2,i3,i4,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,i2,i3,i4,args...) ) #endif return m_map.reference(i0,i1,i2,i3,i4); @@ -1059,9 +1059,9 @@ public: , Args ... args ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,i2,i3,i4,i5,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,i2,i3,i4,i5,args...) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,i2,i3,i4,i5,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,i2,i3,i4,i5,args...) ) #endif return m_map.m_handle[ m_map.m_offset(i0,i1,i2,i3,i4,i5) ]; @@ -1081,9 +1081,9 @@ public: , Args ... args ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,i2,i3,i4,i5,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,i2,i3,i4,i5,args...) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,i2,i3,i4,i5,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,i2,i3,i4,i5,args...) ) #endif return m_map.reference(i0,i1,i2,i3,i4,i5); @@ -1106,9 +1106,9 @@ public: , Args ... args ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,i2,i3,i4,i5,i6,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,i2,i3,i4,i5,i6,args...) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,i2,i3,i4,i5,i6,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,i2,i3,i4,i5,i6,args...) ) #endif return m_map.m_handle[ m_map.m_offset(i0,i1,i2,i3,i4,i5,i6) ]; @@ -1128,9 +1128,9 @@ public: , Args ... args ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,i2,i3,i4,i5,i6,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,i2,i3,i4,i5,i6,args...) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,i2,i3,i4,i5,i6,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,i2,i3,i4,i5,i6,args...) ) #endif return m_map.reference(i0,i1,i2,i3,i4,i5,i6); @@ -1153,9 +1153,9 @@ public: , Args ... args ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,i2,i3,i4,i5,i6,i7,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,i2,i3,i4,i5,i6,i7,args...) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,i2,i3,i4,i5,i6,i7,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,i2,i3,i4,i5,i6,i7,args...) ) #endif return m_map.m_handle[ m_map.m_offset(i0,i1,i2,i3,i4,i5,i6,i7) ]; @@ -1175,15 +1175,15 @@ public: , Args ... args ) const { #ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST - KOKKOS_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,i2,i3,i4,i5,i6,i7,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (NULL,m_map,i0,i1,i2,i3,i4,i5,i6,i7,args...) ) #else - KOKKOS_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,i2,i3,i4,i5,i6,i7,args...) ) + KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( (m_track.template get_label().c_str(),m_map,i0,i1,i2,i3,i4,i5,i6,i7,args...) ) #endif return m_map.reference(i0,i1,i2,i3,i4,i5,i6,i7); } -#undef KOKKOS_VIEW_OPERATOR_VERIFY +#undef KOKKOS_IMPL_VIEW_OPERATOR_VERIFY //---------------------------------------- // Standard destructor, constructors, and assignment operators @@ -1322,7 +1322,7 @@ public: alloc_prop prop( arg_prop ); //------------------------------------------------------------ -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) // If allocating in CudaUVMSpace must fence before and after // the allocation to protect against possible concurrent access // on the CPU and the GPU. @@ -1338,7 +1338,7 @@ public: record = m_map.allocate_shared( prop , arg_layout ); //------------------------------------------------------------ -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) if ( std::is_same< Kokkos::CudaUVMSpace , typename traits::device_type::memory_space >::value ) { traits::device_type::memory_space::execution_space::fence(); } diff --git a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Parallel.hpp b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Parallel.hpp index 27ae5803ce..a61791ca9c 100644 --- a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Parallel.hpp +++ b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Parallel.hpp @@ -79,7 +79,7 @@ private: , const Member ibeg , const Member iend ) { #ifdef KOKKOS_OPT_RANGE_AGGRESSIVE_VECTORIZATION - #ifdef KOKKOS_HAVE_PRAGMA_IVDEP + #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP #pragma ivdep #endif #endif @@ -96,7 +96,7 @@ private: { const TagType t{} ; #ifdef KOKKOS_OPT_RANGE_AGGRESSIVE_VECTORIZATION - #ifdef KOKKOS_HAVE_PRAGMA_IVDEP + #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP #pragma ivdep #endif #endif @@ -218,7 +218,7 @@ private: , reference_type update ) { #ifdef KOKKOS_OPT_RANGE_AGGRESSIVE_VECTORIZATION - #ifdef KOKKOS_HAVE_PRAGMA_IVDEP + #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP #pragma ivdep #endif #endif @@ -236,7 +236,7 @@ private: { const TagType t{} ; #ifdef KOKKOS_OPT_RANGE_AGGRESSIVE_VECTORIZATION - #ifdef KOKKOS_HAVE_PRAGMA_IVDEP + #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP #pragma ivdep #endif #endif @@ -417,7 +417,7 @@ private: , reference_type update , const bool final ) { #ifdef KOKKOS_OPT_RANGE_AGGRESSIVE_VECTORIZATION - #ifdef KOKKOS_HAVE_PRAGMA_IVDEP + #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP #pragma ivdep #endif #endif @@ -435,7 +435,7 @@ private: { const TagType t{} ; #ifdef KOKKOS_OPT_RANGE_AGGRESSIVE_VECTORIZATION - #ifdef KOKKOS_HAVE_PRAGMA_IVDEP + #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP #pragma ivdep #endif #endif diff --git a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Task.cpp b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Task.cpp index 00a9957ee1..5b3e9873e1 100644 --- a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Task.cpp +++ b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Task.cpp @@ -43,7 +43,7 @@ #include -#if defined( KOKKOS_HAVE_OPENMP ) && defined( KOKKOS_ENABLE_TASKDAG ) +#if defined( KOKKOS_ENABLE_OPENMP ) && defined( KOKKOS_ENABLE_TASKDAG ) #include @@ -324,6 +324,6 @@ void TaskQueueSpecialization< Kokkos::OpenMP >:: //---------------------------------------------------------------------------- -#endif /* #if defined( KOKKOS_HAVE_OPENMP ) && defined( KOKKOS_ENABLE_TASKDAG ) */ +#endif /* #if defined( KOKKOS_ENABLE_OPENMP ) && defined( KOKKOS_ENABLE_TASKDAG ) */ diff --git a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMPexec.cpp b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMPexec.cpp index 25e7d89277..34cf581a47 100644 --- a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMPexec.cpp +++ b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMPexec.cpp @@ -51,7 +51,7 @@ #include #include -#ifdef KOKKOS_HAVE_OPENMP +#ifdef KOKKOS_ENABLE_OPENMP namespace Kokkos { namespace Impl { @@ -346,10 +346,10 @@ void OpenMP::print_configuration( std::ostream & s , const bool detail ) s << "Kokkos::OpenMP" ; -#if defined( KOKKOS_HAVE_OPENMP ) - s << " KOKKOS_HAVE_OPENMP" ; +#if defined( KOKKOS_ENABLE_OPENMP ) + s << " KOKKOS_ENABLE_OPENMP" ; #endif -#if defined( KOKKOS_HAVE_HWLOC ) +#if defined( KOKKOS_ENABLE_HWLOC ) const unsigned numa_count_ = Kokkos::hwloc::get_available_numa_count(); const unsigned cores_per_numa = Kokkos::hwloc::get_available_cores_per_numa(); @@ -405,4 +405,4 @@ int OpenMP::concurrency() { } // namespace Kokkos -#endif //KOKKOS_HAVE_OPENMP +#endif //KOKKOS_ENABLE_OPENMP diff --git a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMPexec.hpp b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMPexec.hpp index a2bfa742d1..63f7234da3 100644 --- a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMPexec.hpp +++ b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMPexec.hpp @@ -83,7 +83,7 @@ private: // Which thread am I stealing from currently int m_current_steal_target; // This thread's owned work_range - Kokkos::pair m_work_range KOKKOS_ALIGN_16; + Kokkos::pair m_work_range KOKKOS_ALIGN(16); // Team Offset if one thread determines work_range for others long m_team_work_index; @@ -404,7 +404,6 @@ public: #endif } -#ifdef KOKKOS_HAVE_CXX11 template< class ValueType, class JoinOp > KOKKOS_INLINE_FUNCTION ValueType team_reduce( const ValueType & value @@ -417,18 +416,6 @@ public: typedef ValueType value_type; const JoinLambdaAdapter op(op_in); #endif -#else // KOKKOS_HAVE_CXX11 - template< class JoinOp > - KOKKOS_INLINE_FUNCTION typename JoinOp::value_type - team_reduce( const typename JoinOp::value_type & value - , const JoinOp & op ) const - #if ! defined( KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST ) - { return typename JoinOp::value_type(); } - #else - { - typedef typename JoinOp::value_type value_type; - #endif -#endif // KOKKOS_HAVE_CXX11 #if defined( KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST ) // Make sure there is enough scratch space: typedef typename if_c< sizeof(value_type) < TEAM_REDUCE_SIZE @@ -965,7 +952,7 @@ template KOKKOS_INLINE_FUNCTION void parallel_for(const Impl::ThreadVectorRangeBoundariesStruct& loop_boundaries, const Lambda& lambda) { - #ifdef KOKKOS_HAVE_PRAGMA_IVDEP + #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP #pragma ivdep #endif for( iType i = loop_boundaries.start; i < loop_boundaries.end; i+=loop_boundaries.increment) @@ -981,7 +968,7 @@ KOKKOS_INLINE_FUNCTION void parallel_reduce(const Impl::ThreadVectorRangeBoundariesStruct& loop_boundaries, const Lambda & lambda, ValueType& result) { result = ValueType(); -#ifdef KOKKOS_HAVE_PRAGMA_IVDEP +#ifdef KOKKOS_ENABLE_PRAGMA_IVDEP #pragma ivdep #endif for( iType i = loop_boundaries.start; i < loop_boundaries.end; i+=loop_boundaries.increment) { @@ -1004,7 +991,7 @@ void parallel_reduce(const Impl::ThreadVectorRangeBoundariesStruct -#if defined( KOKKOS_HAVE_QTHREAD ) +#if defined( KOKKOS_ENABLE_QTHREAD ) #include #include @@ -507,5 +507,5 @@ QthreadTeamPolicyMember::QthreadTeamPolicyMember( const QthreadTeamPolicyMember: //---------------------------------------------------------------------------- -#endif /* #if defined( KOKKOS_HAVE_QTHREAD ) */ +#endif /* #if defined( KOKKOS_ENABLE_QTHREAD ) */ diff --git a/lib/kokkos/core/src/Qthread/Kokkos_Qthread_Parallel.hpp b/lib/kokkos/core/src/Qthread/Kokkos_Qthread_Parallel.hpp index 8ee70b9efa..cb5b180948 100644 --- a/lib/kokkos/core/src/Qthread/Kokkos_Qthread_Parallel.hpp +++ b/lib/kokkos/core/src/Qthread/Kokkos_Qthread_Parallel.hpp @@ -585,7 +585,6 @@ void parallel_reduce(const Impl::TeamThreadRangeBoundariesStruct()); } -#if defined( KOKKOS_HAVE_CXX11 ) /** \brief Intra-thread vector parallel_reduce. Executes lambda(iType i, ValueType & val) for each i=0..N-1. * @@ -610,8 +609,6 @@ void parallel_reduce(const Impl::TeamThreadRangeBoundariesStruct(join)); } -#endif /* #if defined( KOKKOS_HAVE_CXX11 ) */ - /** \brief Intra-thread vector parallel_for. Executes lambda(iType i) for each i=0..N-1. * * The range i=0..N-1 is mapped to all vector lanes of the the calling thread. @@ -620,7 +617,7 @@ template KOKKOS_INLINE_FUNCTION void parallel_for(const Impl::ThreadVectorRangeBoundariesStruct& loop_boundaries, const Lambda& lambda) { - #ifdef KOKKOS_HAVE_PRAGMA_IVDEP + #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP #pragma ivdep #endif for( iType i = loop_boundaries.start; i < loop_boundaries.end; i+=loop_boundaries.increment) @@ -636,7 +633,7 @@ KOKKOS_INLINE_FUNCTION void parallel_reduce(const Impl::ThreadVectorRangeBoundariesStruct& loop_boundaries, const Lambda & lambda, ValueType& result) { result = ValueType(); -#ifdef KOKKOS_HAVE_PRAGMA_IVDEP +#ifdef KOKKOS_ENABLE_PRAGMA_IVDEP #pragma ivdep #endif for( iType i = loop_boundaries.start; i < loop_boundaries.end; i+=loop_boundaries.increment) { @@ -659,7 +656,7 @@ void parallel_reduce(const Impl::ThreadVectorRangeBoundariesStruct -#if defined( KOKKOS_HAVE_QTHREAD ) +#if defined( KOKKOS_ENABLE_QTHREAD ) #include @@ -487,5 +487,5 @@ void wait( Kokkos::Experimental::TaskPolicy< Kokkos::Qthread > & policy ) } // namespace Kokkos #endif /* #if defined( KOKKOS_ENABLE_TASKDAG ) */ -#endif /* #if defined( KOKKOS_HAVE_QTHREAD ) */ +#endif /* #if defined( KOKKOS_ENABLE_QTHREAD ) */ diff --git a/lib/kokkos/core/src/Threads/Kokkos_ThreadsExec.cpp b/lib/kokkos/core/src/Threads/Kokkos_ThreadsExec.cpp index 9f6e3d37b1..0f69be9ed4 100644 --- a/lib/kokkos/core/src/Threads/Kokkos_ThreadsExec.cpp +++ b/lib/kokkos/core/src/Threads/Kokkos_ThreadsExec.cpp @@ -43,7 +43,7 @@ #include -#if defined( KOKKOS_HAVE_PTHREAD ) || defined( KOKKOS_HAVE_WINTHREAD ) +#if defined( KOKKOS_ENABLE_PTHREAD ) || defined( KOKKOS_ENABLE_WINTHREAD ) #include #include @@ -512,10 +512,10 @@ void ThreadsExec::print_configuration( std::ostream & s , const bool detail ) s << "Kokkos::Threads" ; -#if defined( KOKKOS_HAVE_PTHREAD ) - s << " KOKKOS_HAVE_PTHREAD" ; +#if defined( KOKKOS_ENABLE_PTHREAD ) + s << " KOKKOS_ENABLE_PTHREAD" ; #endif -#if defined( KOKKOS_HAVE_HWLOC ) +#if defined( KOKKOS_ENABLE_HWLOC ) s << " hwloc[" << numa_count << "x" << cores_per_numa << "x" << threads_per_core << "]" ; #endif @@ -822,5 +822,5 @@ int Threads::thread_pool_rank() //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- -#endif /* #if defined( KOKKOS_HAVE_PTHREAD ) || defined( KOKKOS_HAVE_WINTHREAD ) */ +#endif /* #if defined( KOKKOS_ENABLE_PTHREAD ) || defined( KOKKOS_ENABLE_WINTHREAD ) */ diff --git a/lib/kokkos/core/src/Threads/Kokkos_ThreadsExec.hpp b/lib/kokkos/core/src/Threads/Kokkos_ThreadsExec.hpp index 4ec1450d0f..385dd492d0 100644 --- a/lib/kokkos/core/src/Threads/Kokkos_ThreadsExec.hpp +++ b/lib/kokkos/core/src/Threads/Kokkos_ThreadsExec.hpp @@ -1,13 +1,13 @@ /* //@HEADER // ************************************************************************ -// +// // Kokkos v. 2.0 // Copyright (2014) Sandia Corporation -// +// // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, // the U.S. Government retains certain rights in this software. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -36,7 +36,7 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) -// +// // ************************************************************************ //@HEADER */ @@ -103,7 +103,7 @@ private: // Which thread am I stealing from currently int m_current_steal_target; // This thread's owned work_range - Kokkos::pair m_work_range KOKKOS_ALIGN_16; + Kokkos::pair m_work_range KOKKOS_ALIGN(16); // Team Offset if one thread determines work_range for others long m_team_work_index; diff --git a/lib/kokkos/core/src/Threads/Kokkos_ThreadsExec_base.cpp b/lib/kokkos/core/src/Threads/Kokkos_ThreadsExec_base.cpp index ce09248678..41493a5a20 100644 --- a/lib/kokkos/core/src/Threads/Kokkos_ThreadsExec_base.cpp +++ b/lib/kokkos/core/src/Threads/Kokkos_ThreadsExec_base.cpp @@ -46,7 +46,7 @@ //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- -#if defined( KOKKOS_HAVE_PTHREAD ) +#if defined( KOKKOS_ENABLE_PTHREAD ) /* Standard 'C' Linux libraries */ @@ -148,11 +148,11 @@ void ThreadsExec::wait_yield( volatile int & flag , const int value ) } // namespace Impl } // namespace Kokkos -/* end #if defined( KOKKOS_HAVE_PTHREAD ) */ +/* end #if defined( KOKKOS_ENABLE_PTHREAD ) */ //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- -#elif defined( KOKKOS_HAVE_WINTHREAD ) +#elif defined( KOKKOS_ENABLE_WINTHREAD ) /* Windows libraries */ #include @@ -247,7 +247,7 @@ void ThreadsExec::wait_yield( volatile int & flag , const int value ) {} } // namespace Impl } // namespace Kokkos -#endif /* end #elif defined( KOKKOS_HAVE_WINTHREAD ) */ +#endif /* end #elif defined( KOKKOS_ENABLE_WINTHREAD ) */ //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- diff --git a/lib/kokkos/core/src/Threads/Kokkos_ThreadsTeam.hpp b/lib/kokkos/core/src/Threads/Kokkos_ThreadsTeam.hpp index 4256b0aa67..b9edb64551 100644 --- a/lib/kokkos/core/src/Threads/Kokkos_ThreadsTeam.hpp +++ b/lib/kokkos/core/src/Threads/Kokkos_ThreadsTeam.hpp @@ -1,13 +1,13 @@ /* //@HEADER // ************************************************************************ -// +// // Kokkos v. 2.0 // Copyright (2014) Sandia Corporation -// +// // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, // the U.S. Government retains certain rights in this software. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -36,7 +36,7 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) -// +// // ************************************************************************ //@HEADER */ @@ -91,7 +91,7 @@ private: inline void set_team_shared() { new( & m_team_shared ) space( ((char *) (*m_team_base)->scratch_memory()) + TEAM_REDUCE_SIZE , m_team_shared_size ); } - + public: // Fan-in and wait until the matching fan-out is called. @@ -201,7 +201,6 @@ public: } #endif -#ifdef KOKKOS_HAVE_CXX11 template< class ValueType, class JoinOp > KOKKOS_INLINE_FUNCTION ValueType team_reduce( const ValueType & value @@ -213,18 +212,6 @@ public: typedef ValueType value_type; const JoinLambdaAdapter op(op_in); #endif -#else // KOKKOS_HAVE_CXX11 - template< class JoinOp > - KOKKOS_INLINE_FUNCTION typename JoinOp::value_type - team_reduce( const typename JoinOp::value_type & value - , const JoinOp & op ) const - #if ! defined( KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST ) - { return typename JoinOp::value_type(); } - #else - { - typedef typename JoinOp::value_type value_type; - #endif -#endif // KOKKOS_HAVE_CXX11 #if defined( KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST ) // Make sure there is enough scratch space: typedef typename if_c< sizeof(value_type) < TEAM_REDUCE_SIZE @@ -514,7 +501,7 @@ private: int m_chunk_size; inline - void init( const int league_size_request + void init( const int league_size_request , const int team_size_request ) { const int pool_size = traits::execution_space::thread_pool_size(0); @@ -777,8 +764,6 @@ void parallel_reduce(const Impl::TeamThreadRangeBoundariesStruct()); } -#if defined( KOKKOS_HAVE_CXX11 ) - /** \brief Intra-thread vector parallel_reduce. Executes lambda(iType i, ValueType & val) for each i=0..N-1. * * The range i=0..N-1 is mapped to all vector lanes of the the calling thread and a reduction of @@ -802,8 +787,6 @@ void parallel_reduce(const Impl::TeamThreadRangeBoundariesStruct(join)); } -#endif /* #if defined( KOKKOS_HAVE_CXX11 ) */ - } //namespace Kokkos @@ -816,7 +799,7 @@ template KOKKOS_INLINE_FUNCTION void parallel_for(const Impl::ThreadVectorRangeBoundariesStruct& loop_boundaries, const Lambda& lambda) { - #ifdef KOKKOS_HAVE_PRAGMA_IVDEP + #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP #pragma ivdep #endif for( iType i = loop_boundaries.start; i < loop_boundaries.end; i+=loop_boundaries.increment) @@ -832,7 +815,7 @@ KOKKOS_INLINE_FUNCTION void parallel_reduce(const Impl::ThreadVectorRangeBoundariesStruct& loop_boundaries, const Lambda & lambda, ValueType& result) { result = ValueType(); -#ifdef KOKKOS_HAVE_PRAGMA_IVDEP +#ifdef KOKKOS_ENABLE_PRAGMA_IVDEP #pragma ivdep #endif for( iType i = loop_boundaries.start; i < loop_boundaries.end; i+=loop_boundaries.increment) { @@ -855,7 +838,7 @@ void parallel_reduce(const Impl::ThreadVectorRangeBoundariesStruct::type val ) { -#ifdef KOKKOS_HAVE_CXX11 union U { int i ; T t ; KOKKOS_INLINE_FUNCTION U() {}; } tmp ; -#else - union U { - int i ; - T t ; - } tmp ; -#endif tmp.i = __sync_val_compare_and_swap( (int*) dest , *((int*)&compare) , *((int*)&val) ); return tmp.t ; @@ -175,24 +168,17 @@ T atomic_compare_exchange( volatile T * const dest, const T & compare, typename Kokkos::Impl::enable_if< sizeof(T) != sizeof(int) && sizeof(T) == sizeof(long) , const T & >::type val ) { -#ifdef KOKKOS_HAVE_CXX11 union U { long i ; T t ; KOKKOS_INLINE_FUNCTION U() {}; } tmp ; -#else - union U { - long i ; - T t ; - } tmp ; -#endif tmp.i = __sync_val_compare_and_swap( (long*) dest , *((long*)&compare) , *((long*)&val) ); return tmp.t ; } -#if defined( KOKKOS_ENABLE_ASM) && defined ( KOKKOS_USE_ISA_X86_64 ) +#if defined( KOKKOS_ENABLE_ASM) && defined ( KOKKOS_ENABLE_ISA_X86_64 ) template < typename T > inline T atomic_compare_exchange( volatile T * const dest, const T & compare, @@ -217,7 +203,7 @@ T atomic_compare_exchange( volatile T * const dest , const T compare , typename Kokkos::Impl::enable_if< ( sizeof(T) != 4 ) && ( sizeof(T) != 8 ) - #if defined(KOKKOS_ENABLE_ASM) && defined ( KOKKOS_USE_ISA_X86_64 ) + #if defined(KOKKOS_ENABLE_ASM) && defined ( KOKKOS_ENABLE_ISA_X86_64 ) && ( sizeof(T) != 16 ) #endif , const T >::type& val ) @@ -245,7 +231,7 @@ T atomic_compare_exchange( volatile T * const dest , const T compare , } //---------------------------------------------------------------------------- -#elif defined( KOKKOS_ATOMICS_USE_OMP31 ) +#elif defined( KOKKOS_ENABLE_OPENMP_ATOMICS ) template< typename T > KOKKOS_INLINE_FUNCTION diff --git a/lib/kokkos/core/src/impl/Kokkos_Atomic_Decrement.hpp b/lib/kokkos/core/src/impl/Kokkos_Atomic_Decrement.hpp index 7fc0e6984b..962a5a17a3 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Atomic_Decrement.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Atomic_Decrement.hpp @@ -41,8 +41,8 @@ //@HEADER */ -#if defined( KOKKOS_ATOMIC_HPP) && ! defined( KOKKOS_ATOMIC_DECREMENT ) -#define KOKKOS_ATOMIC_DECREMENT +#if defined( KOKKOS_ATOMIC_HPP) && ! defined( KOKKOS_ATOMIC_DECREMENT_HPP ) +#define KOKKOS_ATOMIC_DECREMENT_HPP #include "impl/Kokkos_Atomic_Fetch_Sub.hpp" @@ -52,7 +52,7 @@ namespace Kokkos { template<> KOKKOS_INLINE_FUNCTION void atomic_decrement(volatile char* a) { -#if defined( KOKKOS_ENABLE_ASM ) && defined( KOKKOS_USE_ISA_X86_64 ) && ! defined(_WIN32) && ! defined(__CUDA_ARCH__) +#if defined( KOKKOS_ENABLE_ASM ) && defined( KOKKOS_ENABLE_ISA_X86_64 ) && ! defined(_WIN32) && ! defined(__CUDA_ARCH__) __asm__ __volatile__( "lock decb %0" : /* no output registers */ @@ -67,7 +67,7 @@ void atomic_decrement(volatile char* a) { template<> KOKKOS_INLINE_FUNCTION void atomic_decrement(volatile short* a) { -#if defined( KOKKOS_ENABLE_ASM ) && defined( KOKKOS_USE_ISA_X86_64 ) && ! defined(_WIN32) && ! defined(__CUDA_ARCH__) +#if defined( KOKKOS_ENABLE_ASM ) && defined( KOKKOS_ENABLE_ISA_X86_64 ) && ! defined(_WIN32) && ! defined(__CUDA_ARCH__) __asm__ __volatile__( "lock decw %0" : /* no output registers */ @@ -82,7 +82,7 @@ void atomic_decrement(volatile short* a) { template<> KOKKOS_INLINE_FUNCTION void atomic_decrement(volatile int* a) { -#if defined( KOKKOS_ENABLE_ASM ) && defined( KOKKOS_USE_ISA_X86_64 ) && ! defined(_WIN32) && ! defined(__CUDA_ARCH__) +#if defined( KOKKOS_ENABLE_ASM ) && defined( KOKKOS_ENABLE_ISA_X86_64 ) && ! defined(_WIN32) && ! defined(__CUDA_ARCH__) __asm__ __volatile__( "lock decl %0" : /* no output registers */ @@ -97,7 +97,7 @@ void atomic_decrement(volatile int* a) { template<> KOKKOS_INLINE_FUNCTION void atomic_decrement(volatile long long int* a) { -#if defined( KOKKOS_ENABLE_ASM ) && defined( KOKKOS_USE_ISA_X86_64 ) && ! defined(_WIN32) && ! defined(__CUDA_ARCH__) +#if defined( KOKKOS_ENABLE_ASM ) && defined( KOKKOS_ENABLE_ISA_X86_64 ) && ! defined(_WIN32) && ! defined(__CUDA_ARCH__) __asm__ __volatile__( "lock decq %0" : /* no output registers */ diff --git a/lib/kokkos/core/src/impl/Kokkos_Atomic_Exchange.hpp b/lib/kokkos/core/src/impl/Kokkos_Atomic_Exchange.hpp index ae53b81779..428b792853 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Atomic_Exchange.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Atomic_Exchange.hpp @@ -48,8 +48,8 @@ namespace Kokkos { //---------------------------------------------------------------------------- -#if defined( KOKKOS_HAVE_CUDA ) -#if defined(__CUDA_ARCH__) || defined(KOKKOS_CUDA_CLANG_WORKAROUND) +#if defined( KOKKOS_ENABLE_CUDA ) +#if defined(__CUDA_ARCH__) || defined(KOKKOS_IMPL_CUDA_CLANG_WORKAROUND) __inline__ __device__ int atomic_exchange( volatile int * const dest , const int val ) @@ -162,8 +162,8 @@ void atomic_assign( //---------------------------------------------------------------------------- -#if !defined(__CUDA_ARCH__) || defined(KOKKOS_CUDA_CLANG_WORKAROUND) -#if defined(KOKKOS_ATOMICS_USE_GCC) || defined(KOKKOS_ATOMICS_USE_INTEL) +#if !defined(__CUDA_ARCH__) || defined(KOKKOS_IMPL_CUDA_CLANG_WORKAROUND) +#if defined(KOKKOS_ENABLE_GNU_ATOMICS) || defined(KOKKOS_ENABLE_INTEL_ATOMICS) template< typename T > inline @@ -177,15 +177,11 @@ T atomic_exchange( volatile T * const dest , type assumed ; -#ifdef KOKKOS_HAVE_CXX11 union U { T val_T ; type val_type ; inline U() {}; } old ; -#else - union { T val_T ; type val_type ; } old ; -#endif old.val_T = *dest ; @@ -197,7 +193,7 @@ T atomic_exchange( volatile T * const dest , return old.val_T ; } -#if defined(KOKKOS_ENABLE_ASM) && defined ( KOKKOS_USE_ISA_X86_64 ) +#if defined(KOKKOS_ENABLE_ASM) && defined ( KOKKOS_ENABLE_ISA_X86_64 ) template< typename T > inline T atomic_exchange( volatile T * const dest , @@ -230,7 +226,7 @@ T atomic_exchange( volatile T * const dest , typename Kokkos::Impl::enable_if< ( sizeof(T) != 4 ) && ( sizeof(T) != 8 ) - #if defined(KOKKOS_ENABLE_ASM) && defined ( KOKKOS_USE_ISA_X86_64 ) + #if defined(KOKKOS_ENABLE_ASM) && defined ( KOKKOS_ENABLE_ISA_X86_64 ) && ( sizeof(T) != 16 ) #endif , const T >::type& val ) @@ -267,15 +263,11 @@ void atomic_assign( volatile T * const dest , type assumed ; -#ifdef KOKKOS_HAVE_CXX11 union U { T val_T ; type val_type ; inline U() {}; } old ; -#else - union { T val_T ; type val_type ; } old ; -#endif old.val_T = *dest ; @@ -285,7 +277,7 @@ void atomic_assign( volatile T * const dest , } while ( assumed != old.val_type ); } -#if defined( KOKKOS_ENABLE_ASM ) && defined ( KOKKOS_USE_ISA_X86_64 ) +#if defined( KOKKOS_ENABLE_ASM ) && defined ( KOKKOS_ENABLE_ISA_X86_64 ) template< typename T > inline void atomic_assign( volatile T * const dest , @@ -313,7 +305,7 @@ void atomic_assign( volatile T * const dest , typename Kokkos::Impl::enable_if< ( sizeof(T) != 4 ) && ( sizeof(T) != 8 ) - #if defined(KOKKOS_ENABLE_ASM) && defined ( KOKKOS_USE_ISA_X86_64 ) + #if defined(KOKKOS_ENABLE_ASM) && defined ( KOKKOS_ENABLE_ISA_X86_64 ) && ( sizeof(T) != 16 ) #endif , const T >::type& val ) @@ -331,7 +323,7 @@ void atomic_assign( volatile T * const dest , } //---------------------------------------------------------------------------- -#elif defined( KOKKOS_ATOMICS_USE_OMP31 ) +#elif defined( KOKKOS_ENABLE_OPENMP_ATOMICS ) template < typename T > inline diff --git a/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Add.hpp b/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Add.hpp index 08d2867ab4..d6bc953ab2 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Add.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Add.hpp @@ -48,8 +48,8 @@ namespace Kokkos { //---------------------------------------------------------------------------- -#if defined( KOKKOS_HAVE_CUDA ) -#if defined(__CUDA_ARCH__) || defined(KOKKOS_CUDA_CLANG_WORKAROUND) +#if defined( KOKKOS_ENABLE_CUDA ) +#if defined(__CUDA_ARCH__) || defined(KOKKOS_IMPL_CUDA_CLANG_WORKAROUND) // Support for int, unsigned int, unsigned long long int, and float @@ -81,18 +81,11 @@ __inline__ __device__ T atomic_fetch_add( volatile T * const dest , typename Kokkos::Impl::enable_if< sizeof(T) == sizeof(int) , const T >::type val ) { -#ifdef KOKKOS_HAVE_CXX11 union U { int i ; T t ; KOKKOS_INLINE_FUNCTION U() {}; } assume , oldval , newval ; -#else - union U { - int i ; - T t ; - } assume , oldval , newval ; -#endif oldval.t = *dest ; @@ -111,18 +104,11 @@ T atomic_fetch_add( volatile T * const dest , typename Kokkos::Impl::enable_if< sizeof(T) != sizeof(int) && sizeof(T) == sizeof(unsigned long long int) , const T >::type val ) { -#ifdef KOKKOS_HAVE_CXX11 union U { unsigned long long int i ; T t ; KOKKOS_INLINE_FUNCTION U() {}; } assume , oldval , newval ; -#else - union U { - unsigned long long int i ; - T t ; - } assume , oldval , newval ; -#endif oldval.t = *dest ; @@ -167,10 +153,10 @@ T atomic_fetch_add( volatile T * const dest , #endif #endif //---------------------------------------------------------------------------- -#if !defined(__CUDA_ARCH__) || defined(KOKKOS_CUDA_CLANG_WORKAROUND) -#if defined(KOKKOS_ATOMICS_USE_GCC) || defined(KOKKOS_ATOMICS_USE_INTEL) +#if !defined(__CUDA_ARCH__) || defined(KOKKOS_IMPL_CUDA_CLANG_WORKAROUND) +#if defined(KOKKOS_ENABLE_GNU_ATOMICS) || defined(KOKKOS_ENABLE_INTEL_ATOMICS) -#if defined( KOKKOS_ENABLE_ASM ) && defined ( KOKKOS_USE_ISA_X86_64 ) +#if defined( KOKKOS_ENABLE_ASM ) && defined ( KOKKOS_ENABLE_ISA_X86_64 ) inline int atomic_fetch_add( volatile int * dest , const int val ) { @@ -195,7 +181,7 @@ inline long int atomic_fetch_add( volatile long int * const dest , const long int val ) { return __sync_fetch_and_add(dest,val); } -#if defined( KOKKOS_ATOMICS_USE_GCC ) +#if defined( KOKKOS_ENABLE_GNU_ATOMICS ) inline unsigned int atomic_fetch_add( volatile unsigned int * const dest , const unsigned int val ) @@ -212,18 +198,11 @@ inline T atomic_fetch_add( volatile T * const dest , typename Kokkos::Impl::enable_if< sizeof(T) == sizeof(int) , const T >::type val ) { -#ifdef KOKKOS_HAVE_CXX11 union U { int i ; T t ; inline U() {}; } assume , oldval , newval ; -#else - union U { - int i ; - T t ; - } assume , oldval , newval ; -#endif oldval.t = *dest ; @@ -242,18 +221,11 @@ T atomic_fetch_add( volatile T * const dest , typename Kokkos::Impl::enable_if< sizeof(T) != sizeof(int) && sizeof(T) == sizeof(long) , const T >::type val ) { -#ifdef KOKKOS_HAVE_CXX11 union U { long i ; T t ; inline U() {}; } assume , oldval , newval ; -#else - union U { - long i ; - T t ; - } assume , oldval , newval ; -#endif oldval.t = *dest ; @@ -266,7 +238,7 @@ T atomic_fetch_add( volatile T * const dest , return oldval.t ; } -#if defined( KOKKOS_ENABLE_ASM ) && defined ( KOKKOS_USE_ISA_X86_64 ) +#if defined( KOKKOS_ENABLE_ASM ) && defined ( KOKKOS_ENABLE_ISA_X86_64 ) template < typename T > inline T atomic_fetch_add( volatile T * const dest , @@ -300,7 +272,7 @@ T atomic_fetch_add( volatile T * const dest , typename Kokkos::Impl::enable_if< ( sizeof(T) != 4 ) && ( sizeof(T) != 8 ) - #if defined(KOKKOS_ENABLE_ASM) && defined ( KOKKOS_USE_ISA_X86_64 ) + #if defined(KOKKOS_ENABLE_ASM) && defined ( KOKKOS_ENABLE_ISA_X86_64 ) && ( sizeof(T) != 16 ) #endif , const T >::type& val ) @@ -324,7 +296,7 @@ T atomic_fetch_add( volatile T * const dest , } //---------------------------------------------------------------------------- -#elif defined( KOKKOS_ATOMICS_USE_OMP31 ) +#elif defined( KOKKOS_ENABLE_OPENMP_ATOMICS ) template< typename T > T atomic_fetch_add( volatile T * const dest , const T val ) diff --git a/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_And.hpp b/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_And.hpp index 121a5d5192..334272bc7c 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_And.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_And.hpp @@ -48,8 +48,8 @@ namespace Kokkos { //---------------------------------------------------------------------------- -#if defined( KOKKOS_HAVE_CUDA ) -#if defined(__CUDA_ARCH__) || defined(KOKKOS_CUDA_CLANG_WORKAROUND) +#if defined( KOKKOS_ENABLE_CUDA ) +#if defined(__CUDA_ARCH__) || defined(KOKKOS_IMPL_CUDA_CLANG_WORKAROUND) // Support for int, unsigned int, unsigned long long int, and float @@ -70,8 +70,8 @@ unsigned long long int atomic_fetch_and( volatile unsigned long long int * const #endif #endif //---------------------------------------------------------------------------- -#if !defined(__CUDA_ARCH__) || defined(KOKKOS_CUDA_CLANG_WORKAROUND) -#if defined(KOKKOS_ATOMICS_USE_GCC) || defined(KOKKOS_ATOMICS_USE_INTEL) +#if !defined(__CUDA_ARCH__) || defined(KOKKOS_IMPL_CUDA_CLANG_WORKAROUND) +#if defined(KOKKOS_ENABLE_GNU_ATOMICS) || defined(KOKKOS_ENABLE_INTEL_ATOMICS) inline int atomic_fetch_and( volatile int * const dest , const int val ) @@ -81,7 +81,7 @@ inline long int atomic_fetch_and( volatile long int * const dest , const long int val ) { return __sync_fetch_and_and(dest,val); } -#if defined( KOKKOS_ATOMICS_USE_GCC ) +#if defined( KOKKOS_ENABLE_GNU_ATOMICS ) inline unsigned int atomic_fetch_and( volatile unsigned int * const dest , const unsigned int val ) @@ -95,7 +95,7 @@ unsigned long int atomic_fetch_and( volatile unsigned long int * const dest , co //---------------------------------------------------------------------------- -#elif defined( KOKKOS_ATOMICS_USE_OMP31 ) +#elif defined( KOKKOS_ENABLE_OPENMP_ATOMICS ) template< typename T > T atomic_fetch_and( volatile T * const dest , const T val ) diff --git a/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Or.hpp b/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Or.hpp index 2c89f56705..75931d826d 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Or.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Or.hpp @@ -48,8 +48,8 @@ namespace Kokkos { //---------------------------------------------------------------------------- -#if defined( KOKKOS_HAVE_CUDA ) -#if defined(__CUDA_ARCH__) || defined(KOKKOS_CUDA_CLANG_WORKAROUND) +#if defined( KOKKOS_ENABLE_CUDA ) +#if defined(__CUDA_ARCH__) || defined(KOKKOS_IMPL_CUDA_CLANG_WORKAROUND) // Support for int, unsigned int, unsigned long long int, and float @@ -70,8 +70,8 @@ unsigned long long int atomic_fetch_or( volatile unsigned long long int * const #endif #endif //---------------------------------------------------------------------------- -#if !defined(__CUDA_ARCH__) || defined(KOKKOS_CUDA_CLANG_WORKAROUND) -#if defined(KOKKOS_ATOMICS_USE_GCC) || defined(KOKKOS_ATOMICS_USE_INTEL) +#if !defined(__CUDA_ARCH__) || defined(KOKKOS_IMPL_CUDA_CLANG_WORKAROUND) +#if defined(KOKKOS_ENABLE_GNU_ATOMICS) || defined(KOKKOS_ENABLE_INTEL_ATOMICS) inline int atomic_fetch_or( volatile int * const dest , const int val ) @@ -81,7 +81,7 @@ inline long int atomic_fetch_or( volatile long int * const dest , const long int val ) { return __sync_fetch_and_or(dest,val); } -#if defined( KOKKOS_ATOMICS_USE_GCC ) +#if defined( KOKKOS_ENABLE_GNU_ATOMICS ) inline unsigned int atomic_fetch_or( volatile unsigned int * const dest , const unsigned int val ) @@ -95,7 +95,7 @@ unsigned long int atomic_fetch_or( volatile unsigned long int * const dest , con //---------------------------------------------------------------------------- -#elif defined( KOKKOS_ATOMICS_USE_OMP31 ) +#elif defined( KOKKOS_ENABLE_OPENMP_ATOMICS ) template< typename T > T atomic_fetch_or( volatile T * const dest , const T val ) diff --git a/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Sub.hpp b/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Sub.hpp index b51d2fe782..7ce4112705 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Sub.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Sub.hpp @@ -48,8 +48,8 @@ namespace Kokkos { //---------------------------------------------------------------------------- -#if defined( KOKKOS_HAVE_CUDA ) -#if defined(__CUDA_ARCH__) || defined(KOKKOS_CUDA_CLANG_WORKAROUND) +#if defined( KOKKOS_ENABLE_CUDA ) +#if defined(__CUDA_ARCH__) || defined(KOKKOS_IMPL_CUDA_CLANG_WORKAROUND) // Support for int, unsigned int, unsigned long long int, and float @@ -130,8 +130,8 @@ T atomic_fetch_sub( volatile T * const dest , #endif #endif //---------------------------------------------------------------------------- -#if !defined(__CUDA_ARCH__) || defined(KOKKOS_CUDA_CLANG_WORKAROUND) -#if defined(KOKKOS_ATOMICS_USE_GCC) || defined(KOKKOS_ATOMICS_USE_INTEL) +#if !defined(__CUDA_ARCH__) || defined(KOKKOS_IMPL_CUDA_CLANG_WORKAROUND) +#if defined(KOKKOS_ENABLE_GNU_ATOMICS) || defined(KOKKOS_ENABLE_INTEL_ATOMICS) inline int atomic_fetch_sub( volatile int * const dest , const int val ) @@ -141,7 +141,7 @@ inline long int atomic_fetch_sub( volatile long int * const dest , const long int val ) { return __sync_fetch_and_sub(dest,val); } -#if defined( KOKKOS_ATOMICS_USE_GCC ) +#if defined( KOKKOS_ENABLE_GNU_ATOMICS ) inline unsigned int atomic_fetch_sub( volatile unsigned int * const dest , const unsigned int val ) @@ -210,7 +210,7 @@ T atomic_fetch_sub( volatile T * const dest , //---------------------------------------------------------------------------- -#elif defined( KOKKOS_ATOMICS_USE_OMP31 ) +#elif defined( KOKKOS_ENABLE_OPENMP_ATOMICS ) template< typename T > T atomic_fetch_sub( volatile T * const dest , const T val ) diff --git a/lib/kokkos/core/src/impl/Kokkos_Atomic_Increment.hpp b/lib/kokkos/core/src/impl/Kokkos_Atomic_Increment.hpp index eecda29f1c..2894a45f0b 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Atomic_Increment.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Atomic_Increment.hpp @@ -41,8 +41,8 @@ //@HEADER */ -#if defined( KOKKOS_ATOMIC_HPP) && ! defined( KOKKOS_ATOMIC_INCREMENT ) -#define KOKKOS_ATOMIC_INCREMENT +#if defined( KOKKOS_ATOMIC_HPP) && ! defined( KOKKOS_ATOMIC_INCREMENT_HPP ) +#define KOKKOS_ATOMIC_INCREMENT_HPP namespace Kokkos { @@ -50,7 +50,7 @@ namespace Kokkos { template<> KOKKOS_INLINE_FUNCTION void atomic_increment(volatile char* a) { -#if defined( KOKKOS_ENABLE_ASM ) && defined( KOKKOS_USE_ISA_X86_64 ) && ! defined(_WIN32) && ! defined(__CUDA_ARCH__) +#if defined( KOKKOS_ENABLE_ASM ) && defined( KOKKOS_ENABLE_ISA_X86_64 ) && ! defined(_WIN32) && ! defined(__CUDA_ARCH__) __asm__ __volatile__( "lock incb %0" : /* no output registers */ @@ -65,7 +65,7 @@ void atomic_increment(volatile char* a) { template<> KOKKOS_INLINE_FUNCTION void atomic_increment(volatile short* a) { -#if defined( KOKKOS_ENABLE_ASM ) && defined( KOKKOS_USE_ISA_X86_64 ) && ! defined(_WIN32) && ! defined(__CUDA_ARCH__) +#if defined( KOKKOS_ENABLE_ASM ) && defined( KOKKOS_ENABLE_ISA_X86_64 ) && ! defined(_WIN32) && ! defined(__CUDA_ARCH__) __asm__ __volatile__( "lock incw %0" : /* no output registers */ @@ -80,7 +80,7 @@ void atomic_increment(volatile short* a) { template<> KOKKOS_INLINE_FUNCTION void atomic_increment(volatile int* a) { -#if defined( KOKKOS_ENABLE_ASM ) && defined( KOKKOS_USE_ISA_X86_64 ) && ! defined(_WIN32) && ! defined(__CUDA_ARCH__) +#if defined( KOKKOS_ENABLE_ASM ) && defined( KOKKOS_ENABLE_ISA_X86_64 ) && ! defined(_WIN32) && ! defined(__CUDA_ARCH__) __asm__ __volatile__( "lock incl %0" : /* no output registers */ @@ -95,7 +95,7 @@ void atomic_increment(volatile int* a) { template<> KOKKOS_INLINE_FUNCTION void atomic_increment(volatile long long int* a) { -#if defined( KOKKOS_ENABLE_ASM ) && defined( KOKKOS_USE_ISA_X86_64 ) && ! defined(_WIN32) && ! defined(__CUDA_ARCH__) +#if defined( KOKKOS_ENABLE_ASM ) && defined( KOKKOS_ENABLE_ISA_X86_64 ) && ! defined(_WIN32) && ! defined(__CUDA_ARCH__) __asm__ __volatile__( "lock incq %0" : /* no output registers */ diff --git a/lib/kokkos/core/src/impl/Kokkos_Core.cpp b/lib/kokkos/core/src/impl/Kokkos_Core.cpp index de10859868..cd38eaa9da 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Core.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_Core.cpp @@ -70,20 +70,20 @@ void initialize_internal(const InitArguments& args) // This is an experimental setting // For KNL in Flat mode this variable should be set, so that // memkind allocates high bandwidth memory correctly. -#ifdef KOKKOS_HAVE_HBWSPACE +#ifdef KOKKOS_ENABLE_HBWSPACE setenv("MEMKIND_HBW_NODES", "1", 0); #endif // Protect declarations, to prevent "unused variable" warnings. -#if defined( KOKKOS_HAVE_OPENMP ) || defined( KOKKOS_HAVE_PTHREAD ) +#if defined( KOKKOS_ENABLE_OPENMP ) || defined( KOKKOS_ENABLE_PTHREAD ) const int num_threads = args.num_threads; const int use_numa = args.num_numa; -#endif // defined( KOKKOS_HAVE_OPENMP ) || defined( KOKKOS_HAVE_PTHREAD ) -#if defined( KOKKOS_HAVE_CUDA ) +#endif // defined( KOKKOS_ENABLE_OPENMP ) || defined( KOKKOS_ENABLE_PTHREAD ) +#if defined( KOKKOS_ENABLE_CUDA ) const int use_gpu = args.device_id; -#endif // defined( KOKKOS_HAVE_CUDA ) +#endif // defined( KOKKOS_ENABLE_CUDA ) -#if defined( KOKKOS_HAVE_OPENMP ) +#if defined( KOKKOS_ENABLE_OPENMP ) if( std::is_same< Kokkos::OpenMP , Kokkos::DefaultExecutionSpace >::value || std::is_same< Kokkos::OpenMP , Kokkos::HostSpace::execution_space >::value ) { if(num_threads>0) { @@ -103,7 +103,7 @@ setenv("MEMKIND_HBW_NODES", "1", 0); } #endif -#if defined( KOKKOS_HAVE_PTHREAD ) +#if defined( KOKKOS_ENABLE_PTHREAD ) if( std::is_same< Kokkos::Threads , Kokkos::DefaultExecutionSpace >::value || std::is_same< Kokkos::Threads , Kokkos::HostSpace::execution_space >::value ) { if(num_threads>0) { @@ -123,7 +123,7 @@ setenv("MEMKIND_HBW_NODES", "1", 0); } #endif -#if defined( KOKKOS_HAVE_SERIAL ) +#if defined( KOKKOS_ENABLE_SERIAL ) // Prevent "unused variable" warning for 'args' input struct. If // Serial::initialize() ever needs to take arguments from the input // struct, you may remove this line of code. @@ -135,7 +135,7 @@ setenv("MEMKIND_HBW_NODES", "1", 0); } #endif -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) if( std::is_same< Kokkos::Cuda , Kokkos::DefaultExecutionSpace >::value || 0 < use_gpu ) { if (use_gpu > -1) { Kokkos::Cuda::initialize( Kokkos::Cuda::SelectDevice( use_gpu ) ); @@ -159,14 +159,14 @@ void finalize_internal( const bool all_spaces = false ) Kokkos::Profiling::finalize(); #endif -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) if( std::is_same< Kokkos::Cuda , Kokkos::DefaultExecutionSpace >::value || all_spaces ) { if(Kokkos::Cuda::is_initialized()) Kokkos::Cuda::finalize(); } #endif -#if defined( KOKKOS_HAVE_OPENMP ) +#if defined( KOKKOS_ENABLE_OPENMP ) if( std::is_same< Kokkos::OpenMP , Kokkos::DefaultExecutionSpace >::value || std::is_same< Kokkos::OpenMP , Kokkos::HostSpace::execution_space >::value || all_spaces ) { @@ -175,7 +175,7 @@ void finalize_internal( const bool all_spaces = false ) } #endif -#if defined( KOKKOS_HAVE_PTHREAD ) +#if defined( KOKKOS_ENABLE_PTHREAD ) if( std::is_same< Kokkos::Threads , Kokkos::DefaultExecutionSpace >::value || std::is_same< Kokkos::Threads , Kokkos::HostSpace::execution_space >::value || all_spaces ) { @@ -184,7 +184,7 @@ void finalize_internal( const bool all_spaces = false ) } #endif -#if defined( KOKKOS_HAVE_SERIAL ) +#if defined( KOKKOS_ENABLE_SERIAL ) if( std::is_same< Kokkos::Serial , Kokkos::DefaultExecutionSpace >::value || std::is_same< Kokkos::Serial , Kokkos::HostSpace::execution_space >::value || all_spaces ) { @@ -197,27 +197,27 @@ void finalize_internal( const bool all_spaces = false ) void fence_internal() { -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) if( std::is_same< Kokkos::Cuda , Kokkos::DefaultExecutionSpace >::value ) { Kokkos::Cuda::fence(); } #endif -#if defined( KOKKOS_HAVE_OPENMP ) +#if defined( KOKKOS_ENABLE_OPENMP ) if( std::is_same< Kokkos::OpenMP , Kokkos::DefaultExecutionSpace >::value || std::is_same< Kokkos::OpenMP , Kokkos::HostSpace::execution_space >::value ) { Kokkos::OpenMP::fence(); } #endif -#if defined( KOKKOS_HAVE_PTHREAD ) +#if defined( KOKKOS_ENABLE_PTHREAD ) if( std::is_same< Kokkos::Threads , Kokkos::DefaultExecutionSpace >::value || std::is_same< Kokkos::Threads , Kokkos::HostSpace::execution_space >::value ) { Kokkos::Threads::fence(); } #endif -#if defined( KOKKOS_HAVE_SERIAL ) +#if defined( KOKKOS_ENABLE_SERIAL ) if( std::is_same< Kokkos::Serial , Kokkos::DefaultExecutionSpace >::value || std::is_same< Kokkos::Serial , Kokkos::HostSpace::execution_space >::value ) { Kokkos::Serial::fence(); diff --git a/lib/kokkos/core/src/impl/Kokkos_Error.hpp b/lib/kokkos/core/src/impl/Kokkos_Error.hpp index 5fab5eb9a7..7736307dce 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Error.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Error.hpp @@ -47,7 +47,7 @@ #include #include #include -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA #include #endif diff --git a/lib/kokkos/core/src/impl/Kokkos_HBWSpace.cpp b/lib/kokkos/core/src/impl/Kokkos_HBWSpace.cpp index 9534026112..96d30d0c4a 100644 --- a/lib/kokkos/core/src/impl/Kokkos_HBWSpace.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_HBWSpace.cpp @@ -58,7 +58,7 @@ #include #include #include -#ifdef KOKKOS_HAVE_HBWSPACE +#ifdef KOKKOS_ENABLE_HBWSPACE #include #endif @@ -68,7 +68,7 @@ //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- -#ifdef KOKKOS_HAVE_HBWSPACE +#ifdef KOKKOS_ENABLE_HBWSPACE #define MEMKIND_TYPE MEMKIND_HBW //hbw_get_kind(HBW_PAGESIZE_4KB) namespace Kokkos { diff --git a/lib/kokkos/core/src/impl/Kokkos_HostSpace.cpp b/lib/kokkos/core/src/impl/Kokkos_HostSpace.cpp index bfd13572b9..3cd603728e 100644 --- a/lib/kokkos/core/src/impl/Kokkos_HostSpace.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_HostSpace.cpp @@ -48,17 +48,17 @@ #endif /*--------------------------------------------------------------------------*/ -#if defined( __INTEL_COMPILER ) && ! defined ( KOKKOS_HAVE_CUDA ) +#if defined( __INTEL_COMPILER ) && ! defined ( KOKKOS_ENABLE_CUDA ) // Intel specialized allocator does not interoperate with CUDA memory allocation -#define KOKKOS_INTEL_MM_ALLOC_AVAILABLE +#define KOKKOS_ENABLE_INTEL_MM_ALLOC #endif /*--------------------------------------------------------------------------*/ -#if defined(KOKKOS_POSIX_MEMALIGN_AVAILABLE) +#if defined(KOKKOS_ENABLE_POSIX_MEMALIGN) #include #include @@ -66,18 +66,18 @@ /* mmap flags for private anonymous memory allocation */ #if defined( MAP_ANONYMOUS ) && defined( MAP_PRIVATE ) - #define KOKKOS_POSIX_MMAP_FLAGS (MAP_PRIVATE | MAP_ANONYMOUS) + #define KOKKOS_IMPL_POSIX_MMAP_FLAGS (MAP_PRIVATE | MAP_ANONYMOUS) #elif defined( MAP_ANON ) && defined( MAP_PRIVATE ) - #define KOKKOS_POSIX_MMAP_FLAGS (MAP_PRIVATE | MAP_ANON) + #define KOKKOS_IMPL_POSIX_MMAP_FLAGS (MAP_PRIVATE | MAP_ANON) #endif // mmap flags for huge page tables // the Cuda driver does not interoperate with MAP_HUGETLB -#if defined( KOKKOS_POSIX_MMAP_FLAGS ) - #if defined( MAP_HUGETLB ) && ! defined( KOKKOS_HAVE_CUDA ) - #define KOKKOS_POSIX_MMAP_FLAGS_HUGE (KOKKOS_POSIX_MMAP_FLAGS | MAP_HUGETLB ) +#if defined( KOKKOS_IMPL_POSIX_MMAP_FLAGS ) + #if defined( MAP_HUGETLB ) && ! defined( KOKKOS_ENABLE_CUDA ) + #define KOKKOS_IMPL_POSIX_MMAP_FLAGS_HUGE (KOKKOS_IMPL_POSIX_MMAP_FLAGS | MAP_HUGETLB ) #else - #define KOKKOS_POSIX_MMAP_FLAGS_HUGE KOKKOS_POSIX_MMAP_FLAGS + #define KOKKOS_IMPL_POSIX_MMAP_FLAGS_HUGE KOKKOS_IMPL_POSIX_MMAP_FLAGS #endif #endif @@ -162,11 +162,11 @@ namespace Kokkos { /* Default allocation mechanism */ HostSpace::HostSpace() : m_alloc_mech( -#if defined( KOKKOS_INTEL_MM_ALLOC_AVAILABLE ) +#if defined( KOKKOS_ENABLE_INTEL_MM_ALLOC ) HostSpace::INTEL_MM_ALLOC -#elif defined( KOKKOS_POSIX_MMAP_FLAGS ) +#elif defined( KOKKOS_IMPL_POSIX_MMAP_FLAGS ) HostSpace::POSIX_MMAP -#elif defined( KOKKOS_POSIX_MEMALIGN_AVAILABLE ) +#elif defined( KOKKOS_ENABLE_POSIX_MEMALIGN ) HostSpace::POSIX_MEMALIGN #else HostSpace::STD_MALLOC @@ -181,15 +181,15 @@ HostSpace::HostSpace( const HostSpace::AllocationMechanism & arg_alloc_mech ) if ( arg_alloc_mech == STD_MALLOC ) { m_alloc_mech = HostSpace::STD_MALLOC ; } -#if defined( KOKKOS_INTEL_MM_ALLOC_AVAILABLE ) +#if defined( KOKKOS_ENABLE_INTEL_MM_ALLOC ) else if ( arg_alloc_mech == HostSpace::INTEL_MM_ALLOC ) { m_alloc_mech = HostSpace::INTEL_MM_ALLOC ; } -#elif defined( KOKKOS_POSIX_MEMALIGN_AVAILABLE ) +#elif defined( KOKKOS_ENABLE_POSIX_MEMALIGN ) else if ( arg_alloc_mech == HostSpace::POSIX_MEMALIGN ) { m_alloc_mech = HostSpace::POSIX_MEMALIGN ; } -#elif defined( KOKKOS_POSIX_MMAP_FLAGS ) +#elif defined( KOKKOS_IMPL_POSIX_MMAP_FLAGS ) else if ( arg_alloc_mech == HostSpace::POSIX_MMAP ) { m_alloc_mech = HostSpace::POSIX_MMAP ; } @@ -244,25 +244,25 @@ void * HostSpace::allocate( const size_t arg_alloc_size ) const } } -#if defined( KOKKOS_INTEL_MM_ALLOC_AVAILABLE ) +#if defined( KOKKOS_ENABLE_INTEL_MM_ALLOC ) else if ( m_alloc_mech == INTEL_MM_ALLOC ) { ptr = _mm_malloc( arg_alloc_size , alignment ); } #endif -#if defined( KOKKOS_POSIX_MEMALIGN_AVAILABLE ) +#if defined( KOKKOS_ENABLE_POSIX_MEMALIGN ) else if ( m_alloc_mech == POSIX_MEMALIGN ) { posix_memalign( & ptr, alignment , arg_alloc_size ); } #endif -#if defined( KOKKOS_POSIX_MMAP_FLAGS ) +#if defined( KOKKOS_IMPL_POSIX_MMAP_FLAGS ) else if ( m_alloc_mech == POSIX_MMAP ) { constexpr size_t use_huge_pages = (1u << 27); constexpr int prot = PROT_READ | PROT_WRITE ; const int flags = arg_alloc_size < use_huge_pages - ? KOKKOS_POSIX_MMAP_FLAGS - : KOKKOS_POSIX_MMAP_FLAGS_HUGE ; + ? KOKKOS_IMPL_POSIX_MMAP_FLAGS + : KOKKOS_IMPL_POSIX_MMAP_FLAGS_HUGE ; // read write access to private memory @@ -314,19 +314,19 @@ void HostSpace::deallocate( void * const arg_alloc_ptr , const size_t arg_alloc_ free( alloc_ptr ); } -#if defined( KOKKOS_INTEL_MM_ALLOC_AVAILABLE ) +#if defined( KOKKOS_ENABLE_INTEL_MM_ALLOC ) else if ( m_alloc_mech == INTEL_MM_ALLOC ) { _mm_free( arg_alloc_ptr ); } #endif -#if defined( KOKKOS_POSIX_MEMALIGN_AVAILABLE ) +#if defined( KOKKOS_ENABLE_POSIX_MEMALIGN ) else if ( m_alloc_mech == POSIX_MEMALIGN ) { free( arg_alloc_ptr ); } #endif -#if defined( KOKKOS_POSIX_MMAP_FLAGS ) +#if defined( KOKKOS_IMPL_POSIX_MMAP_FLAGS ) else if ( m_alloc_mech == POSIX_MMAP ) { munmap( arg_alloc_ptr , arg_alloc_size ); } diff --git a/lib/kokkos/core/src/impl/Kokkos_Memory_Fence.hpp b/lib/kokkos/core/src/impl/Kokkos_Memory_Fence.hpp index 5155c66df9..84cf536bb7 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Memory_Fence.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Memory_Fence.hpp @@ -1,13 +1,13 @@ /* //@HEADER // ************************************************************************ -// +// // Kokkos v. 2.0 // Copyright (2014) Sandia Corporation -// +// // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, // the U.S. Government retains certain rights in this software. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -36,13 +36,13 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) -// +// // ************************************************************************ //@HEADER */ -#if defined( KOKKOS_ATOMIC_HPP ) && ! defined( KOKKOS_MEMORY_FENCE ) -#define KOKKOS_MEMORY_FENCE +#if defined( KOKKOS_ATOMIC_HPP ) && ! defined( KOKKOS_MEMORY_FENCE_HPP ) +#define KOKKOS_MEMORY_FENCE_HPP namespace Kokkos { //---------------------------------------------------------------------------- @@ -52,14 +52,14 @@ void memory_fence() { #if defined( __CUDA_ARCH__ ) __threadfence(); -#elif defined( KOKKOS_ATOMICS_USE_GCC ) || \ - ( defined( KOKKOS_COMPILER_NVCC ) && defined( KOKKOS_ATOMICS_USE_INTEL ) ) +#elif defined( KOKKOS_ENABLE_GNU_ATOMICS ) || \ + ( defined( KOKKOS_COMPILER_NVCC ) && defined( KOKKOS_ENABLE_INTEL_ATOMICS ) ) __sync_synchronize(); -#elif defined( KOKKOS_ATOMICS_USE_INTEL ) +#elif defined( KOKKOS_ENABLE_INTEL_ATOMICS ) _mm_mfence(); -#elif defined( KOKKOS_ATOMICS_USE_OMP31 ) +#elif defined( KOKKOS_ENABLE_OPENMP_ATOMICS ) #pragma omp flush -#elif defined( KOKKOS_ATOMICS_USE_WINDOWS ) +#elif defined( KOKKOS_ENABLE_WINDOWS_ATOMICS ) MemoryBarrier(); #else #error "Error: memory_fence() not defined" @@ -74,7 +74,7 @@ void memory_fence() KOKKOS_FORCEINLINE_FUNCTION void store_fence() { -#if defined( KOKKOS_ENABLE_ASM ) && defined( KOKKOS_USE_ISA_X86_64 ) +#if defined( KOKKOS_ENABLE_ASM ) && defined( KOKKOS_ENABLE_ISA_X86_64 ) asm volatile ( "sfence" ::: "memory" ); @@ -91,7 +91,7 @@ void store_fence() KOKKOS_FORCEINLINE_FUNCTION void load_fence() { -#if defined( KOKKOS_ENABLE_ASM ) && defined( KOKKOS_USE_ISA_X86_64 ) +#if defined( KOKKOS_ENABLE_ASM ) && defined( KOKKOS_ENABLE_ISA_X86_64 ) asm volatile ( "lfence" ::: "memory" ); diff --git a/lib/kokkos/core/src/impl/Kokkos_OldMacros.hpp b/lib/kokkos/core/src/impl/Kokkos_OldMacros.hpp new file mode 100644 index 0000000000..da95c943fe --- /dev/null +++ b/lib/kokkos/core/src/impl/Kokkos_OldMacros.hpp @@ -0,0 +1,447 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// 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 Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "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 SANDIA CORPORATION OR THE +// 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. +// +// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#ifndef KOKKOS_IMPL_OLD_MACROS_HPP +#define KOKKOS_IMPL_OLD_MACROS_HPP + +#ifdef KOKKOS_ATOMICS_USE_CUDA +#ifndef KOKKOS_ENABLE_CUDA_ATOMICS +#define KOKKOS_ENABLE_CUDA_ATOMICS KOKKOS_ATOMICS_USE_CUDA +#endif +#endif + +#ifdef KOKKOS_ATOMICS_USE_GCC +#ifndef KOKKOS_ENABLE_GNU_ATOMICS +#define KOKKOS_ENABLE_GNU_ATOMICS KOKKOS_ATOMICS_USE_GCC +#endif +#endif + +#ifdef KOKKOS_ATOMICS_USE_GNU +#ifndef KOKKOS_ENABLE_GNU_ATOMICS +#define KOKKOS_ENABLE_GNU_ATOMICS KOKKOS_ATOMICS_USE_GNU +#endif +#endif + +#ifdef KOKKOS_ATOMICS_USE_INTEL +#ifndef KOKKOS_ENABLE_INTEL_ATOMICS +#define KOKKOS_ENABLE_INTEL_ATOMICS KOKKOS_ATOMICS_USE_INTEL +#endif +#endif + +#ifdef KOKKOS_ATOMICS_USE_OMP31 +#ifndef KOKKOS_ENABLE_OPENMP_ATOMICS +#define KOKKOS_ENABLE_OPENMP_ATOMICS KOKKOS_ATOMICS_USE_OMP31 +#endif +#endif + +#ifdef KOKKOS_ATOMICS_USE_OPENMP31 +#ifndef KOKKOS_ENABLE_OPENMP_ATOMICS +#define KOKKOS_ENABLE_OPENMP_ATOMICS KOKKOS_ATOMICS_USE_OPENMP31 +#endif +#endif + +#ifdef KOKKOS_ATOMICS_USE_WINDOWS +#ifndef KOKKOS_ENABLE_WINDOWS_ATOMICS +#define KOKKOS_ENABLE_WINDOWS_ATOMICS KOKKOS_ATOMICS_USE_WINDOWS +#endif +#endif + +#ifdef KOKKOS_CUDA_CLANG_WORKAROUND +#ifndef KOKKOS_IMPL_CUDA_CLANG_WORKAROUND +#define KOKKOS_IMPL_CUDA_CLANG_WORKAROUND KOKKOS_CUDA_CLANG_WORKAROUND +#endif +#endif + +#ifdef KOKKOS_CUDA_USE_LAMBDA +#ifndef KOKKOS_ENABLE_CUDA_LAMBDA +#define KOKKOS_ENABLE_CUDA_LAMBDA KOKKOS_CUDA_USE_LAMBDA +#endif +#endif + +#ifdef KOKKOS_CUDA_USE_LDG_INTRINSIC +#ifndef KOKKOS_ENABLE_CUDA_LDG_INTRINSIC +#define KOKKOS_ENABLE_CUDA_LDG_INTRINSIC KOKKOS_CUDA_USE_LDG_INTRINSIC +#endif +#endif + +#ifdef KOKKOS_CUDA_USE_RELOCATABLE_DEVICE_CODE +#ifndef KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE +#define KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE KOKKOS_CUDA_USE_RELOCATABLE_DEVICE_CODE +#endif +#endif + +#ifdef KOKKOS_CUDA_USE_UVM +#ifndef KOKKOS_ENABLE_CUDA_UVM +#define KOKKOS_ENABLE_CUDA_UVM KOKKOS_CUDA_USE_UVM +#endif +#endif + +#ifdef KOKKOS_HAVE_CUDA +#ifndef KOKKOS_ENABLE_CUDA +#define KOKKOS_ENABLE_CUDA KOKKOS_HAVE_CUDA +#endif +#endif + +#ifdef KOKKOS_HAVE_CUDA_LAMBDA +#ifndef KOKKOS_ENABLE_CUDA_LAMBDA +#define KOKKOS_ENABLE_CUDA_LAMBDA KOKKOS_HAVE_CUDA_LAMBDA +#endif +#endif + +#ifdef KOKKOS_HAVE_CUDA_RDC +#ifndef KOKKOS_ENABLE_CUDA_RDC +#define KOKKOS_ENABLE_CUDA_RDC KOKKOS_HAVE_CUDA_RDC +#endif +#endif + +#ifdef KOKKOS_HAVE_CUSPARSE +#ifndef KOKKOS_ENABLE_CUSPARSE +#define KOKKOS_ENABLE_CUSPARSE KOKKOS_HAVE_CUSPARSE +#endif +#endif + +#ifdef KOKKOS_HAVE_CXX11_DISPATCH_LAMBDA +#ifndef KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA +#define KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA KOKKOS_HAVE_CXX11_DISPATCH_LAMBDA +#endif +#endif + +#ifdef KOKKOS_HAVE_CXX1Z +#ifndef KOKKOS_ENABLE_CXX1Z +#define KOKKOS_ENABLE_CXX1Z KOKKOS_HAVE_CXX1Z +#endif +#endif + +#ifdef KOKKOS_HAVE_DEBUG +#ifndef KOKKOS_DEBUG +#define KOKKOS_DEBUG KOKKOS_HAVE_DEBUG +#endif +#endif + +#ifdef KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_CUDA +#ifndef KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_CUDA +#define KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_CUDA KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_CUDA +#endif +#endif + +#ifdef KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_OPENMP +#ifndef KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_OPENMP +#define KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_OPENMP KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_OPENMP +#endif +#endif + +#ifdef KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_SERIAL +#ifndef KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_SERIAL +#define KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_SERIAL KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_SERIAL +#endif +#endif + +#ifdef KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_THREADS +#ifndef KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_THREADS +#define KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_THREADS KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_THREADS +#endif +#endif + +#ifdef KOKKOS_HAVE_HBWSPACE +#ifndef KOKKOS_ENABLE_HBWSPACE +#define KOKKOS_ENABLE_HBWSPACE KOKKOS_HAVE_HBWSPACE +#endif +#endif + +#ifdef KOKKOS_HAVE_HWLOC +#ifndef KOKKOS_ENABLE_HWLOC +#define KOKKOS_ENABLE_HWLOC KOKKOS_HAVE_HWLOC +#endif +#endif + +#ifdef KOKKOS_HAVE_MPI +#ifndef KOKKOS_ENABLE_MPI +#define KOKKOS_ENABLE_MPI KOKKOS_HAVE_MPI +#endif +#endif + +#ifdef KOKKOS_HAVE_OPENMP +#ifndef KOKKOS_ENABLE_OPENMP +#define KOKKOS_ENABLE_OPENMP KOKKOS_HAVE_OPENMP +#endif +#endif + +#ifdef KOKKOS_HAVE_PRAGMA_IVDEP +#ifndef KOKKOS_ENABLE_PRAGMA_IVDEP +#define KOKKOS_ENABLE_PRAGMA_IVDEP KOKKOS_HAVE_PRAGMA_IVDEP +#endif +#endif + +#ifdef KOKKOS_HAVE_PRAGMA_LOOPCOUNT +#ifndef KOKKOS_ENABLE_PRAGMA_LOOPCOUNT +#define KOKKOS_ENABLE_PRAGMA_LOOPCOUNT KOKKOS_HAVE_PRAGMA_LOOPCOUNT +#endif +#endif + +#ifdef KOKKOS_HAVE_PRAGMA_SIMD +#ifndef KOKKOS_ENABLE_PRAGMA_SIMD +#define KOKKOS_ENABLE_PRAGMA_SIMD KOKKOS_HAVE_PRAGMA_SIMD +#endif +#endif + +#ifdef KOKKOS_HAVE_PRAGMA_UNROLL +#ifndef KOKKOS_ENABLE_PRAGMA_UNROLL +#define KOKKOS_ENABLE_PRAGMA_UNROLL KOKKOS_HAVE_PRAGMA_UNROLL +#endif +#endif + +#ifdef KOKKOS_HAVE_PRAGMA_VECTOR +#ifndef KOKKOS_ENABLE_PRAGMA_VECTOR +#define KOKKOS_ENABLE_PRAGMA_VECTOR KOKKOS_HAVE_PRAGMA_VECTOR +#endif +#endif + +#ifdef KOKKOS_HAVE_PTHREAD +#ifndef KOKKOS_ENABLE_PTHREAD +#define KOKKOS_ENABLE_PTHREAD KOKKOS_HAVE_PTHREAD +#endif +#endif + +#ifdef KOKKOS_HAVE_QTHREAD +#ifndef KOKKOS_ENABLE_QTHREAD +#define KOKKOS_ENABLE_QTHREAD KOKKOS_HAVE_QTHREAD +#endif +#endif + +#ifdef KOKKOS_HAVE_SERIAL +#ifndef KOKKOS_ENABLE_SERIAL +#define KOKKOS_ENABLE_SERIAL KOKKOS_HAVE_SERIAL +#endif +#endif + +#ifdef KOKKOS_HAVE_TYPE +#ifndef KOKKOS_IMPL_HAS_TYPE +#define KOKKOS_IMPL_HAS_TYPE KOKKOS_HAVE_TYPE +#endif +#endif + +#ifdef KOKKOS_HAVE_WINTHREAD +#ifndef KOKKOS_ENABLE_WINTHREAD +#define KOKKOS_ENABLE_WINTHREAD KOKKOS_HAVE_WINTHREAD +#endif +#endif + +#ifdef KOKKOS_HAVE_Winthread +#ifndef KOKKOS_ENABLE_WINTHREAD +#define KOKKOS_ENABLE_WINTHREAD KOKKOS_HAVE_Winthread +#endif +#endif + +#ifdef KOKKOS_INTEL_MM_ALLOC_AVAILABLE +#ifndef KOKKOS_ENABLE_INTEL_MM_ALLOC +#define KOKKOS_ENABLE_INTEL_MM_ALLOC KOKKOS_INTEL_MM_ALLOC_AVAILABLE +#endif +#endif + +#ifdef KOKKOS_MACRO_IMPL_TO_STRING +#ifndef KOKKOS_IMPL_MACRO_TO_STRING +#define KOKKOS_IMPL_MACRO_TO_STRING KOKKOS_MACRO_IMPL_TO_STRING +#endif +#endif + +#ifdef KOKKOS_MACRO_TO_STRING +#ifndef KOKKOS_MACRO_TO_STRING +#define KOKKOS_MACRO_TO_STRING KOKKOS_MACRO_TO_STRING +#endif +#endif + +#ifdef KOKKOS_MAY_ALIAS +#ifndef KOKKOS_IMPL_MAY_ALIAS +#define KOKKOS_IMPL_MAY_ALIAS KOKKOS_MAY_ALIAS +#endif +#endif + +#ifdef KOKKOS_MDRANGE_IVDEP +#ifndef KOKKOS_IMPL_MDRANGE_IVDEP +#define KOKKOS_IMPL_MDRANGE_IVDEP KOKKOS_MDRANGE_IVDEP +#endif +#endif + + +#ifdef KOKKOS_MEMPOOL_PRINTERR +#ifndef KOKKOS_ENABLE_MEMPOOL_PRINTERR +#define KOKKOS_ENABLE_MEMPOOL_PRINTERR KOKKOS_MEMPOOL_PRINTERR +#endif +#endif + +#ifdef KOKKOS_MEMPOOL_PRINT_ACTIVE_SUPERBLOCKS +#ifndef KOKKOS_ENABLE_MEMPOOL_PRINT_ACTIVE_SUPERBLOCKS +#define KOKKOS_ENABLE_MEMPOOL_PRINT_ACTIVE_SUPERBLOCKS KOKKOS_MEMPOOL_PRINT_ACTIVE_SUPERBLOCKS +#endif +#endif + +#ifdef KOKKOS_MEMPOOL_PRINT_BLOCKSIZE_INFO +#ifndef KOKKOS_ENABLE_MEMPOOL_PRINT_BLOCKSIZE_INFO +#define KOKKOS_ENABLE_MEMPOOL_PRINT_BLOCKSIZE_INFO KOKKOS_MEMPOOL_PRINT_BLOCKSIZE_INFO +#endif +#endif + +#ifdef KOKKOS_MEMPOOL_PRINT_CONSTRUCTOR_INFO +#ifndef KOKKOS_ENABLE_MEMPOOL_PRINT_CONSTRUCTOR_INFO +#define KOKKOS_ENABLE_MEMPOOL_PRINT_CONSTRUCTOR_INFO KOKKOS_MEMPOOL_PRINT_CONSTRUCTOR_INFO +#endif +#endif + +#ifdef KOKKOS_MEMPOOL_PRINT_INDIVIDUAL_PAGE_INFO +#ifndef KOKKOS_ENABLE_MEMPOOL_PRINT_INDIVIDUAL_PAGE_INFO +#define KOKKOS_ENABLE_MEMPOOL_PRINT_INDIVIDUAL_PAGE_INFO KOKKOS_MEMPOOL_PRINT_INDIVIDUAL_PAGE_INFO +#endif +#endif + +#ifdef KOKKOS_MEMPOOL_PRINT_INFO +#ifndef KOKKOS_ENABLE_MEMPOOL_PRINT_INFO +#define KOKKOS_ENABLE_MEMPOOL_PRINT_INFO KOKKOS_MEMPOOL_PRINT_INFO +#endif +#endif + +#ifdef KOKKOS_MEMPOOL_PRINT_PAGE_INFO +#ifndef KOKKOS_ENABLE_MEMPOOL_PRINT_PAGE_INFO +#define KOKKOS_ENABLE_MEMPOOL_PRINT_PAGE_INFO KOKKOS_MEMPOOL_PRINT_PAGE_INFO +#endif +#endif + +#ifdef KOKKOS_MEMPOOL_PRINT_SUPERBLOCK_INFO +#ifndef KOKKOS_ENABLE_MEMPOOL_PRINT_SUPERBLOCK_INFO +#define KOKKOS_ENABLE_MEMPOOL_PRINT_SUPERBLOCK_INFO KOKKOS_MEMPOOL_PRINT_SUPERBLOCK_INFO +#endif +#endif + +#ifdef KOKKOS_POSIX_MEMALIGN_AVAILABLE +#ifndef KOKKOS_ENABLE_POSIX_MEMALIGN +#define KOKKOS_ENABLE_POSIX_MEMALIGN KOKKOS_POSIX_MEMALIGN_AVAILABLE +#endif +#endif + +#ifdef KOKKOS_POSIX_MMAP_FLAGS +#ifndef KOKKOS_IMPL_POSIX_MMAP_FLAGS +#define KOKKOS_IMPL_POSIX_MMAP_FLAGS KOKKOS_POSIX_MMAP_FLAGS +#endif +#endif + +#ifdef KOKKOS_POSIX_MMAP_FLAGS_HUGE +#ifndef KOKKOS_IMPL_POSIX_MMAP_FLAGS_HUGE +#define KOKKOS_IMPL_POSIX_MMAP_FLAGS_HUGE KOKKOS_POSIX_MMAP_FLAGS_HUGE +#endif +#endif + +#ifdef KOKKOS_SHARED_ALLOCATION_TRACKER_DECREMENT +#ifndef KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_DECREMENT +#define KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_DECREMENT KOKKOS_SHARED_ALLOCATION_TRACKER_DECREMENT +#endif +#endif + +#ifdef KOKKOS_SHARED_ALLOCATION_TRACKER_ENABLED +#ifndef KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_ENABLED +#define KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_ENABLED KOKKOS_SHARED_ALLOCATION_TRACKER_ENABLED +#endif +#endif + +#ifdef KOKKOS_SHARED_ALLOCATION_TRACKER_INCREMENT +#ifndef KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_INCREMENT +#define KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_INCREMENT KOKKOS_SHARED_ALLOCATION_TRACKER_INCREMENT +#endif +#endif + +#ifdef KOKKOS_USE_CUDA_UVM +#ifndef KOKKOS_ENABLE_CUDA_UVM +#define KOKKOS_ENABLE_CUDA_UVM KOKKOS_USE_CUDA_UVM +#endif +#endif + +#ifdef KOKKOS_USE_ISA_KNC +#ifndef KOKKOS_ENABLE_ISA_KNC +#define KOKKOS_ENABLE_ISA_KNC KOKKOS_USE_ISA_KNC +#endif +#endif + +#ifdef KOKKOS_USE_ISA_POWERPCLE +#ifndef KOKKOS_ENABLE_ISA_POWERPCLE +#define KOKKOS_ENABLE_ISA_POWERPCLE KOKKOS_USE_ISA_POWERPCLE +#endif +#endif + +#ifdef KOKKOS_USE_ISA_X86_64 +#ifndef KOKKOS_ENABLE_ISA_X86_64 +#define KOKKOS_ENABLE_ISA_X86_64 KOKKOS_USE_ISA_X86_64 +#endif +#endif + +#ifdef KOKKOS_USE_LIBRT +#ifndef KOKKOS_ENABLE_LIBRT +#define KOKKOS_ENABLE_LIBRT KOKKOS_USE_LIBRT +#endif +#endif + +#ifdef KOKKOS_VIEW_OPERATOR_VERIFY +#ifndef KOKKOS_IMPL_VIEW_OPERATOR_VERIFY +#define KOKKOS_IMPL_VIEW_OPERATOR_VERIFY KOKKOS_VIEW_OPERATOR_VERIFY +#endif +#endif + +//------------------------------------------------------------------------------ +// Deprecated macros +//------------------------------------------------------------------------------ +#ifdef KOKKOS_HAVE_CXX11 +#undef KOKKOS_HAVE_CXX11 +#endif +#ifdef KOKKOS_ENABLE_CXX11 +#undef KOKKOS_ENABLE_CXX11 +#endif +#ifdef KOKKOS_USING_EXP_VIEW +#undef KOKKOS_USING_EXP_VIEW +#endif +#ifdef KOKKOS_USING_EXPERIMENTAL_VIEW +#undef KOKKOS_USING_EXPERIMENTAL_VIEW +#endif + +#define KOKKOS_HAVE_CXX11 1 +#define KOKKOS_ENABLE_CXX11 1 +#define KOKKOS_USING_EXP_VIEW 1 +#define KOKKOS_USING_EXPERIMENTAL_VIEW 1 + +#endif //KOKKOS_IMPL_OLD_MACROS_HPP diff --git a/lib/kokkos/core/src/impl/Kokkos_Serial.cpp b/lib/kokkos/core/src/impl/Kokkos_Serial.cpp index 562c7afc6d..76161c10f1 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Serial.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_Serial.cpp @@ -47,7 +47,7 @@ #include #include -#if defined( KOKKOS_HAVE_SERIAL ) +#if defined( KOKKOS_ENABLE_SERIAL ) /*--------------------------------------------------------------------------*/ @@ -114,6 +114,6 @@ void * Serial::scratch_memory_resize( unsigned reduce_size , unsigned shared_siz } // namespace Kokkos -#endif // defined( KOKKOS_HAVE_SERIAL ) +#endif // defined( KOKKOS_ENABLE_SERIAL ) diff --git a/lib/kokkos/core/src/impl/Kokkos_Serial_Task.cpp b/lib/kokkos/core/src/impl/Kokkos_Serial_Task.cpp index eb881545d2..19f3abe71a 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Serial_Task.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_Serial_Task.cpp @@ -43,7 +43,7 @@ #include -#if defined( KOKKOS_HAVE_SERIAL ) && defined( KOKKOS_ENABLE_TASKDAG ) +#if defined( KOKKOS_ENABLE_SERIAL ) && defined( KOKKOS_ENABLE_TASKDAG ) #include #include @@ -144,5 +144,5 @@ void TaskQueueSpecialization< Kokkos::Serial > :: }} /* namespace Kokkos::Impl */ -#endif /* #if defined( KOKKOS_HAVE_SERIAL ) && defined( KOKKOS_ENABLE_TASKDAG ) */ +#endif /* #if defined( KOKKOS_ENABLE_SERIAL ) && defined( KOKKOS_ENABLE_TASKDAG ) */ diff --git a/lib/kokkos/core/src/impl/Kokkos_Serial_Task.hpp b/lib/kokkos/core/src/impl/Kokkos_Serial_Task.hpp index 473b7aadb2..178305c5d3 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Serial_Task.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Serial_Task.hpp @@ -240,7 +240,7 @@ void parallel_reduce ValueType& initialized_result) { initialized_result = ValueType(); -#ifdef KOKKOS_HAVE_PRAGMA_IVDEP +#ifdef KOKKOS_ENABLE_PRAGMA_IVDEP #pragma ivdep #endif for( iType i = loop_boundaries.start; i < loop_boundaries.end; i+=loop_boundaries.increment) { @@ -259,7 +259,7 @@ void parallel_reduce ValueType& initialized_result) { ValueType result = initialized_result; -#ifdef KOKKOS_HAVE_PRAGMA_IVDEP +#ifdef KOKKOS_ENABLE_PRAGMA_IVDEP #pragma ivdep #endif for( iType i = loop_boundaries.start; i < loop_boundaries.end; i+=loop_boundaries.increment) { diff --git a/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.hpp b/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.hpp index a9c2d6f22a..24061d574b 100644 --- a/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.hpp @@ -260,22 +260,22 @@ public: #if defined( KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST ) -#define KOKKOS_SHARED_ALLOCATION_TRACKER_ENABLED \ +#define KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_ENABLED \ Record::tracking_enabled() -#define KOKKOS_SHARED_ALLOCATION_TRACKER_INCREMENT \ +#define KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_INCREMENT \ if ( ! ( m_record_bits & DO_NOT_DEREF_FLAG ) ) Record::increment( m_record ); -#define KOKKOS_SHARED_ALLOCATION_TRACKER_DECREMENT \ +#define KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_DECREMENT \ if ( ! ( m_record_bits & DO_NOT_DEREF_FLAG ) ) Record::decrement( m_record ); #else -#define KOKKOS_SHARED_ALLOCATION_TRACKER_ENABLED 0 +#define KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_ENABLED 0 -#define KOKKOS_SHARED_ALLOCATION_TRACKER_INCREMENT /* */ +#define KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_INCREMENT /* */ -#define KOKKOS_SHARED_ALLOCATION_TRACKER_DECREMENT /* */ +#define KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_DECREMENT /* */ #endif @@ -319,7 +319,7 @@ public: KOKKOS_FORCEINLINE_FUNCTION ~SharedAllocationTracker() - { KOKKOS_SHARED_ALLOCATION_TRACKER_DECREMENT } + { KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_DECREMENT } KOKKOS_FORCEINLINE_FUNCTION constexpr SharedAllocationTracker() @@ -336,7 +336,7 @@ public: SharedAllocationTracker & operator = ( SharedAllocationTracker && rhs ) { // If this is tracking then must decrement - KOKKOS_SHARED_ALLOCATION_TRACKER_DECREMENT + KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_DECREMENT // Move and reset RHS to default constructed value. m_record_bits = rhs.m_record_bits ; rhs.m_record_bits = DO_NOT_DEREF_FLAG ; @@ -347,32 +347,32 @@ public: KOKKOS_FORCEINLINE_FUNCTION SharedAllocationTracker( const SharedAllocationTracker & rhs ) - : m_record_bits( KOKKOS_SHARED_ALLOCATION_TRACKER_ENABLED + : m_record_bits( KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_ENABLED ? rhs.m_record_bits : rhs.m_record_bits | DO_NOT_DEREF_FLAG ) { - KOKKOS_SHARED_ALLOCATION_TRACKER_INCREMENT + KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_INCREMENT } /** \brief Copy construction may disable tracking. */ KOKKOS_FORCEINLINE_FUNCTION SharedAllocationTracker( const SharedAllocationTracker & rhs , const bool enable_tracking ) - : m_record_bits( KOKKOS_SHARED_ALLOCATION_TRACKER_ENABLED + : m_record_bits( KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_ENABLED && enable_tracking ? rhs.m_record_bits : rhs.m_record_bits | DO_NOT_DEREF_FLAG ) - { KOKKOS_SHARED_ALLOCATION_TRACKER_INCREMENT } + { KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_INCREMENT } KOKKOS_FORCEINLINE_FUNCTION SharedAllocationTracker & operator = ( const SharedAllocationTracker & rhs ) { // If this is tracking then must decrement - KOKKOS_SHARED_ALLOCATION_TRACKER_DECREMENT - m_record_bits = KOKKOS_SHARED_ALLOCATION_TRACKER_ENABLED + KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_DECREMENT + m_record_bits = KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_ENABLED ? rhs.m_record_bits : rhs.m_record_bits | DO_NOT_DEREF_FLAG ; - KOKKOS_SHARED_ALLOCATION_TRACKER_INCREMENT + KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_INCREMENT return *this ; } @@ -381,17 +381,17 @@ public: void assign( const SharedAllocationTracker & rhs , const bool enable_tracking ) { - KOKKOS_SHARED_ALLOCATION_TRACKER_DECREMENT - m_record_bits = KOKKOS_SHARED_ALLOCATION_TRACKER_ENABLED + KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_DECREMENT + m_record_bits = KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_ENABLED && enable_tracking ? rhs.m_record_bits : rhs.m_record_bits | DO_NOT_DEREF_FLAG ; - KOKKOS_SHARED_ALLOCATION_TRACKER_INCREMENT + KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_INCREMENT } -#undef KOKKOS_SHARED_ALLOCATION_TRACKER_ENABLED -#undef KOKKOS_SHARED_ALLOCATION_TRACKER_INCREMENT -#undef KOKKOS_SHARED_ALLOCATION_TRACKER_DECREMENT +#undef KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_ENABLED +#undef KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_INCREMENT +#undef KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_DECREMENT }; diff --git a/lib/kokkos/core/src/impl/Kokkos_Tags.hpp b/lib/kokkos/core/src/impl/Kokkos_Tags.hpp index 9545e7e6b3..e23c8b749c 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Tags.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Tags.hpp @@ -51,17 +51,17 @@ //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- -/** KOKKOS_HAVE_TYPE( Type ) +/** KOKKOS_IMPL_HAS_TYPE( Type ) * * defines a meta-function that check if a type expose an internal typedef or * type alias which matches Type * * e.g. - * KOKKOS_HAVE_TYPE( array_layout ); + * KOKKOS_IMPL_HAS_TYPE( array_layout ); * struct Foo { using array_layout = void; }; * have_array_layout::value == 1; */ -#define KOKKOS_HAVE_TYPE( TYPE ) \ +#define KOKKOS_IMPL_HAS_TYPE( TYPE ) \ template struct have_ ## TYPE { \ private: \ template struct X : std::false_type {}; \ diff --git a/lib/kokkos/core/src/impl/Kokkos_TaskQueue.hpp b/lib/kokkos/core/src/impl/Kokkos_TaskQueue.hpp index ee9c69e922..afa01d0cde 100644 --- a/lib/kokkos/core/src/impl/Kokkos_TaskQueue.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_TaskQueue.hpp @@ -1,13 +1,13 @@ /* //@HEADER // ************************************************************************ -// +// // Kokkos v. 2.0 // Copyright (2014) Sandia Corporation -// +// // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, // the U.S. Government retains certain rights in this software. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -36,7 +36,7 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) -// +// // ************************************************************************ //@HEADER */ @@ -152,6 +152,16 @@ private: KOKKOS_FUNCTION void schedule( task_root_type * const ); + // Reschedule a task + // Precondition: + // task is in Executing state + // task->m_next == LockTag + // Postcondition: + // task is in Executing-Respawn state + // task->m_next == 0 (no dependence) + KOKKOS_FUNCTION + void reschedule( task_root_type * ); + // Complete a task // Precondition: // task is not executing @@ -187,6 +197,12 @@ public: void execute() { specialization::execute( this ); } + template< typename FunctorType > + void proc_set_apply( typename task_root_type::function_type * ptr ) + { + specialization::template proc_set_apply< FunctorType >( ptr ); + } + // Assign task pointer with reference counting of assigned tasks template< typename LV , typename RV > KOKKOS_FUNCTION static @@ -342,15 +358,15 @@ public: // sizeof(TaskBase) == 48 - function_type m_apply ; ///< Apply function pointer - queue_type * m_queue ; ///< Queue in which this task resides - TaskBase * m_wait ; ///< Linked list of tasks waiting on this - TaskBase * m_next ; ///< Waiting linked-list next - int32_t m_ref_count ; ///< Reference count - int32_t m_alloc_size ;///< Allocation size - int32_t m_dep_count ; ///< Aggregate's number of dependences - int16_t m_task_type ; ///< Type of task - int16_t m_priority ; ///< Priority of runnable task + function_type m_apply ; ///< Apply function pointer + queue_type * m_queue ; ///< Queue in which this task resides + TaskBase * m_wait ; ///< Linked list of tasks waiting on this + TaskBase * m_next ; ///< Waiting linked-list next + int32_t m_ref_count ; ///< Reference count + int32_t m_alloc_size ; ///< Allocation size + int32_t m_dep_count ; ///< Aggregate's number of dependences + int16_t m_task_type ; ///< Type of task + int16_t m_priority ; ///< Priority of runnable task TaskBase( TaskBase && ) = delete ; TaskBase( const TaskBase & ) = delete ; @@ -378,6 +394,31 @@ public: TaskBase ** aggregate_dependences() { return reinterpret_cast( this + 1 ); } + KOKKOS_INLINE_FUNCTION + bool requested_respawn() + { + // This should only be called when a task has finished executing and is + // in the transition to either the complete or executing-respawn state. + TaskBase * const lock = reinterpret_cast< TaskBase * >( LockTag ); + return lock != m_next; + } + + KOKKOS_INLINE_FUNCTION + void add_dependence( TaskBase* dep ) + { + // Assign dependence to m_next. It will be processed in the subsequent + // call to schedule. Error if the dependence is reset. + if ( 0 != Kokkos::atomic_exchange( & m_next, dep ) ) { + Kokkos::abort("TaskScheduler ERROR: resetting task dependence"); + } + + if ( 0 != dep ) { + // The future may be destroyed upon returning from this call + // so increment reference count to track this assignment. + Kokkos::atomic_increment( &(dep->m_ref_count) ); + } + } + using get_return_type = void ; KOKKOS_INLINE_FUNCTION @@ -415,7 +456,6 @@ public: get_return_type get() const { return m_result ; } }; - template< typename ExecSpace , typename ResultType , typename FunctorType > class TaskBase : public TaskBase< ExecSpace , ResultType , void > @@ -443,7 +483,7 @@ public: ( Type * const task , typename std::enable_if < std::is_same< typename Type::result_type , void >::value - , member_type * const + , member_type * const >::type member ) { @@ -457,7 +497,7 @@ public: ( Type * const task , typename std::enable_if < ! std::is_same< typename Type::result_type , void >::value - , member_type * const + , member_type * const >::type member ) { @@ -468,30 +508,28 @@ public: KOKKOS_FUNCTION static void apply( root_type * root , void * exec ) { - TaskBase * const lock = reinterpret_cast< TaskBase * >( root_type::LockTag ); TaskBase * const task = static_cast< TaskBase * >( root ); member_type * const member = reinterpret_cast< member_type * >( exec ); TaskBase::template apply_functor( task , member ); // Task may be serial or team. - // If team then must synchronize before querying task->m_next. + // If team then must synchronize before querying if respawn was requested. // If team then only one thread calls destructor. member->team_barrier(); - if ( 0 == member->team_rank() && lock == task->m_next ) { - // Did not respawn, destroy the functor to free memory + if ( 0 == member->team_rank() && !(task->requested_respawn()) ) { + // Did not respawn, destroy the functor to free memory. static_cast(task)->~functor_type(); - // Cannot destroy the task until its dependences - // have been processed. + // Cannot destroy the task until its dependences have been processed. } } KOKKOS_INLINE_FUNCTION - TaskBase( FunctorType const & arg_functor ) + TaskBase( functor_type const & arg_functor ) : base_type() - , FunctorType( arg_functor ) + , functor_type( arg_functor ) {} KOKKOS_INLINE_FUNCTION @@ -506,4 +544,3 @@ public: #endif /* #if defined( KOKKOS_ENABLE_TASKDAG ) */ #endif /* #ifndef KOKKOS_IMPL_TASKQUEUE_HPP */ - diff --git a/lib/kokkos/core/src/impl/Kokkos_TaskQueue_impl.hpp b/lib/kokkos/core/src/impl/Kokkos_TaskQueue_impl.hpp index 05fd06a9ad..fefbbad8bd 100644 --- a/lib/kokkos/core/src/impl/Kokkos_TaskQueue_impl.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_TaskQueue_impl.hpp @@ -1,13 +1,13 @@ /* //@HEADER // ************************************************************************ -// +// // Kokkos v. 2.0 // Copyright (2014) Sandia Corporation -// +// // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, // the U.S. Government retains certain rights in this software. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -36,7 +36,7 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) -// +// // ************************************************************************ //@HEADER */ @@ -117,14 +117,14 @@ void TaskQueue< ExecSpace >::decrement } #endif - if ( ( 1 == count ) && + if ( ( 1 == count ) && ( task->m_next == (task_root_type *) task_root_type::LockTag ) ) { // Reference count is zero and task is complete, deallocate. task->m_queue->deallocate( task , task->m_alloc_size ); - } - else if ( count <= 1 ) { + } + else if ( count <= 1 ) { Kokkos::abort("TaskScheduler task has negative reference count or is incomplete" ); - } + } } //---------------------------------------------------------------------------- @@ -375,7 +375,7 @@ void TaskQueue< ExecSpace >::schedule task_root_type * dep = Kokkos::atomic_exchange( & task->m_next , zero ); - const bool is_ready = + const bool is_ready = ( 0 == dep ) || ( ! push_task( & dep->m_wait , task ) ); // Reference count for dep was incremented when assigned @@ -476,6 +476,28 @@ void TaskQueue< ExecSpace >::schedule //---------------------------------------------------------------------------- +template< typename ExecSpace > +KOKKOS_FUNCTION +void TaskQueue< ExecSpace >::reschedule( task_root_type * task ) +{ + // Precondition: + // task is in Executing state + // task->m_next == LockTag + // + // Postcondition: + // task is in Executing-Respawn state + // task->m_next == 0 (no dependence) + + task_root_type * const zero = (task_root_type *) 0 ; + task_root_type * const lock = (task_root_type *) task_root_type::LockTag ; + + if ( lock != Kokkos::atomic_exchange( & task->m_next, zero ) ) { + Kokkos::abort("TaskScheduler::respawn ERROR: already respawned"); + } +} + +//---------------------------------------------------------------------------- + template< typename ExecSpace > KOKKOS_FUNCTION void TaskQueue< ExecSpace >::complete @@ -565,6 +587,4 @@ void TaskQueue< ExecSpace >::complete } /* namespace Impl */ } /* namespace Kokkos */ - #endif /* #if defined( KOKKOS_ENABLE_TASKDAG ) */ - diff --git a/lib/kokkos/core/src/impl/Kokkos_Traits.hpp b/lib/kokkos/core/src/impl/Kokkos_Traits.hpp index 278f715bc9..7f1400156f 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Traits.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Traits.hpp @@ -440,7 +440,7 @@ unsigned power_of_two_if_valid( const unsigned N ) { unsigned p = ~0u ; if ( N && ! ( N & ( N - 1 ) ) ) { -#if defined( __CUDA_ARCH__ ) && defined( KOKKOS_HAVE_CUDA ) +#if defined( __CUDA_ARCH__ ) && defined( KOKKOS_ENABLE_CUDA ) p = __ffs(N) - 1 ; #elif defined( __GNUC__ ) || defined( __GNUG__ ) p = __builtin_ffs(N) - 1 ; diff --git a/lib/kokkos/core/src/impl/Kokkos_Utilities.hpp b/lib/kokkos/core/src/impl/Kokkos_Utilities.hpp index d66fdd9a57..ff503cb273 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Utilities.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Utilities.hpp @@ -359,7 +359,7 @@ template struct exclusive_scan_integer_sequence { using value_type = typename IntegerSequence::value_type; - using helper = + using helper = exclusive_scan_integer_sequence_helper < reverse_integer_sequence , std::integral_constant< value_type , 0 > @@ -399,7 +399,7 @@ template struct inclusive_scan_integer_sequence { using value_type = typename IntegerSequence::value_type; - using helper = + using helper = inclusive_scan_integer_sequence_helper < reverse_integer_sequence , std::integral_constant< value_type , 0 > @@ -411,4 +411,4 @@ struct inclusive_scan_integer_sequence }} // namespace Kokkos::Impl -#endif //KOKKOS_CORE_IMPL_UTILITIES +#endif //KOKKOS_CORE_IMPL_UTILITIES_HPP diff --git a/lib/kokkos/core/src/impl/Kokkos_ViewMapping.hpp b/lib/kokkos/core/src/impl/Kokkos_ViewMapping.hpp index 588166c185..f76ddfb3a7 100644 --- a/lib/kokkos/core/src/impl/Kokkos_ViewMapping.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_ViewMapping.hpp @@ -1,13 +1,13 @@ /* //@HEADER // ************************************************************************ -// +// // Kokkos v. 2.0 // Copyright (2014) Sandia Corporation -// +// // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, // the U.S. Government retains certain rights in this software. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -36,7 +36,7 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) -// +// // ************************************************************************ //@HEADER */ @@ -119,38 +119,38 @@ KOKKOS_IMPL_VIEW_DIMENSION( 7 ) template< size_t ... Vals > struct ViewDimension - : public ViewDimension0< variadic_size_t<0,Vals...>::value + : public ViewDimension0< variadic_size_t<0,Vals...>::value , rank_dynamic< Vals... >::value > - , public ViewDimension1< variadic_size_t<1,Vals...>::value + , public ViewDimension1< variadic_size_t<1,Vals...>::value , rank_dynamic< Vals... >::value > - , public ViewDimension2< variadic_size_t<2,Vals...>::value + , public ViewDimension2< variadic_size_t<2,Vals...>::value , rank_dynamic< Vals... >::value > - , public ViewDimension3< variadic_size_t<3,Vals...>::value + , public ViewDimension3< variadic_size_t<3,Vals...>::value , rank_dynamic< Vals... >::value > - , public ViewDimension4< variadic_size_t<4,Vals...>::value + , public ViewDimension4< variadic_size_t<4,Vals...>::value , rank_dynamic< Vals... >::value > - , public ViewDimension5< variadic_size_t<5,Vals...>::value + , public ViewDimension5< variadic_size_t<5,Vals...>::value , rank_dynamic< Vals... >::value > - , public ViewDimension6< variadic_size_t<6,Vals...>::value + , public ViewDimension6< variadic_size_t<6,Vals...>::value , rank_dynamic< Vals... >::value > - , public ViewDimension7< variadic_size_t<7,Vals...>::value + , public ViewDimension7< variadic_size_t<7,Vals...>::value , rank_dynamic< Vals... >::value > { - typedef ViewDimension0< variadic_size_t<0,Vals...>::value + typedef ViewDimension0< variadic_size_t<0,Vals...>::value , rank_dynamic< Vals... >::value > D0 ; - typedef ViewDimension1< variadic_size_t<1,Vals...>::value + typedef ViewDimension1< variadic_size_t<1,Vals...>::value , rank_dynamic< Vals... >::value > D1 ; - typedef ViewDimension2< variadic_size_t<2,Vals...>::value + typedef ViewDimension2< variadic_size_t<2,Vals...>::value , rank_dynamic< Vals... >::value > D2 ; - typedef ViewDimension3< variadic_size_t<3,Vals...>::value + typedef ViewDimension3< variadic_size_t<3,Vals...>::value , rank_dynamic< Vals... >::value > D3 ; - typedef ViewDimension4< variadic_size_t<4,Vals...>::value + typedef ViewDimension4< variadic_size_t<4,Vals...>::value , rank_dynamic< Vals... >::value > D4 ; - typedef ViewDimension5< variadic_size_t<5,Vals...>::value + typedef ViewDimension5< variadic_size_t<5,Vals...>::value , rank_dynamic< Vals... >::value > D5 ; - typedef ViewDimension6< variadic_size_t<6,Vals...>::value + typedef ViewDimension6< variadic_size_t<6,Vals...>::value , rank_dynamic< Vals... >::value > D6 ; - typedef ViewDimension7< variadic_size_t<7,Vals...>::value + typedef ViewDimension7< variadic_size_t<7,Vals...>::value , rank_dynamic< Vals... >::value > D7 ; using D0::ArgN0 ; @@ -298,7 +298,7 @@ struct is_integral_extent static_assert( value || std::is_integral::value || - std::is_same::value + std::is_same::value , "subview argument must be either integral or integral extent" ); }; @@ -324,7 +324,7 @@ struct SubviewLegalArgsCompileTime struct SubviewLegalArgsCompileTime { @@ -400,7 +400,7 @@ private: bool set( unsigned domain_rank , unsigned range_rank , const ViewDimension< DimArgs ... > & dim - , const Kokkos::Experimental::Impl::ALL_t + , const Kokkos::Experimental::Impl::ALL_t , Args ... args ) { m_begin[ domain_rank ] = 0 ; @@ -516,12 +516,12 @@ private: , unsigned domain_rank , unsigned range_rank , const ViewDimension< DimArgs ... > & dim - , const Kokkos::Experimental::Impl::ALL_t + , const Kokkos::Experimental::Impl::ALL_t , Args ... args ) const { const int n = std::min( buf_len , snprintf( buf , buf_len - , " Kokkos::ALL %c" + , " Kokkos::ALL %c" , int( sizeof...(Args) ? ',' : ')' ) ) ); error( buf+n , buf_len-n , domain_rank + 1 , range_rank + 1 , dim , args... ); @@ -542,7 +542,7 @@ private: , " %lu <= %lu - %lu %c" , static_cast( dim.extent( domain_rank ) ) , static_cast( val.second ) - , static_cast( val.begin ) + , static_cast( val.first ) , int( sizeof...(Args) ? ',' : ')' ) ) ); error( buf+n , buf_len-n , domain_rank + 1 , range_rank + 1 , dim , args... ); @@ -563,7 +563,7 @@ private: , " %lu <= %lu - %lu %c" , static_cast( dim.extent( domain_rank ) ) , static_cast( val.second ) - , static_cast( val.begin ) + , static_cast( val.first ) , int( sizeof...(Args) ? ',' : ')' ) ) ); error( buf+n , buf_len-n , domain_rank + 1 , range_rank + 1 , dim , args... ); @@ -604,7 +604,7 @@ private: KOKKOS_FORCEINLINE_FUNCTION void error( const ViewDimension< DimArgs ... > & dim , Args ... args ) const { -#if defined( KOKKOS_ACTIVE_EXECUTION_SPACE_HOST ) +#if defined( KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST ) enum { LEN = 1024 }; char buffer[ LEN ]; @@ -708,7 +708,7 @@ struct ViewDataType< T , ViewDimension< N , Args... > > * Provide typedef for the ViewDimension<...> and value_type. */ template< class T > -struct ViewArrayAnalysis +struct ViewArrayAnalysis { typedef T value_type ; typedef typename std::add_const< T >::type const_value_type ; @@ -1006,12 +1006,12 @@ struct ViewOffset< Dimension , Kokkos::LayoutLeft template< class DimRHS > KOKKOS_INLINE_FUNCTION constexpr ViewOffset( const ViewOffset< DimRHS , Kokkos::LayoutLeft , void > & rhs ) - : m_dim( rhs.m_dim.N0 , rhs.m_dim.N1 , rhs.m_dim.N2 , rhs.m_dim.N3 + : m_dim( rhs.m_dim.N0 , rhs.m_dim.N1 , rhs.m_dim.N2 , rhs.m_dim.N3 , rhs.m_dim.N4 , rhs.m_dim.N5 , rhs.m_dim.N6 , rhs.m_dim.N7 ) { static_assert( int(DimRHS::rank) == int(dimension_type::rank) , "ViewOffset assignment requires equal rank" ); // Also requires equal static dimensions ... - } + } template< class DimRHS > KOKKOS_INLINE_FUNCTION @@ -1259,13 +1259,13 @@ public: template< class DimRHS > KOKKOS_INLINE_FUNCTION constexpr ViewOffset( const ViewOffset< DimRHS , Kokkos::LayoutLeft , void > & rhs ) - : m_dim( rhs.m_dim.N0 , rhs.m_dim.N1 , rhs.m_dim.N2 , rhs.m_dim.N3 + : m_dim( rhs.m_dim.N0 , rhs.m_dim.N1 , rhs.m_dim.N2 , rhs.m_dim.N3 , rhs.m_dim.N4 , rhs.m_dim.N5 , rhs.m_dim.N6 , rhs.m_dim.N7 ) , m_stride( rhs.stride_1() ) { static_assert( int(DimRHS::rank) == int(dimension_type::rank) , "ViewOffset assignment requires equal rank" ); // Also requires equal static dimensions ... - } + } //---------------------------------------- // Subview construction @@ -1484,12 +1484,12 @@ struct ViewOffset< Dimension , Kokkos::LayoutRight template< class DimRHS > KOKKOS_INLINE_FUNCTION constexpr ViewOffset( const ViewOffset< DimRHS , Kokkos::LayoutRight , void > & rhs ) - : m_dim( rhs.m_dim.N0 , rhs.m_dim.N1 , rhs.m_dim.N2 , rhs.m_dim.N3 + : m_dim( rhs.m_dim.N0 , rhs.m_dim.N1 , rhs.m_dim.N2 , rhs.m_dim.N3 , rhs.m_dim.N4 , rhs.m_dim.N5 , rhs.m_dim.N6 , rhs.m_dim.N7 ) { static_assert( int(DimRHS::rank) == int(dimension_type::rank) , "ViewOffset assignment requires equal rank" ); // Also requires equal static dimensions ... - } + } template< class DimRHS > KOKKOS_INLINE_FUNCTION @@ -1745,13 +1745,13 @@ public: template< class DimRHS > KOKKOS_INLINE_FUNCTION constexpr ViewOffset( const ViewOffset< DimRHS , Kokkos::LayoutRight , void > & rhs ) - : m_dim( rhs.m_dim.N0 , rhs.m_dim.N1 , rhs.m_dim.N2 , rhs.m_dim.N3 + : m_dim( rhs.m_dim.N0 , rhs.m_dim.N1 , rhs.m_dim.N2 , rhs.m_dim.N3 , rhs.m_dim.N4 , rhs.m_dim.N5 , rhs.m_dim.N6 , rhs.m_dim.N7 ) , m_stride( rhs.stride_0() ) { static_assert( int(DimRHS::rank) == int(dimension_type::rank) , "ViewOffset assignment requires equal rank" ); // Also requires equal static dimensions ... - } + } //---------------------------------------- // Subview construction @@ -2162,7 +2162,7 @@ public: template< class DimRHS , class LayoutRHS > KOKKOS_INLINE_FUNCTION constexpr ViewOffset( const ViewOffset< DimRHS , LayoutRHS , void > & rhs ) - : m_dim( rhs.m_dim.N0 , rhs.m_dim.N1 , rhs.m_dim.N2 , rhs.m_dim.N3 + : m_dim( rhs.m_dim.N0 , rhs.m_dim.N1 , rhs.m_dim.N2 , rhs.m_dim.N3 , rhs.m_dim.N4 , rhs.m_dim.N5 , rhs.m_dim.N6 , rhs.m_dim.N7 ) , m_stride( rhs.stride_0() , rhs.stride_1() , rhs.stride_2() , rhs.stride_3() , rhs.stride_4() , rhs.stride_5() , rhs.stride_6() , rhs.stride_7() ) @@ -2263,7 +2263,7 @@ struct ViewDataHandle { , size_t offset ) { return handle_type( arg_data_ptr + offset ); - } + } }; template< class Traits > @@ -2299,13 +2299,13 @@ struct ViewDataHandle< Traits , template< class Traits > struct ViewDataHandle< Traits , - typename std::enable_if<( + typename std::enable_if<( std::is_same< typename Traits::specialize , void >::value && (!Traits::memory_traits::Aligned) && Traits::memory_traits::Restrict -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA && (!( std::is_same< typename Traits::memory_space,Kokkos::CudaSpace>::value || std::is_same< typename Traits::memory_space,Kokkos::CudaUVMSpace>::value )) @@ -2336,13 +2336,13 @@ struct ViewDataHandle< Traits , template< class Traits > struct ViewDataHandle< Traits , - typename std::enable_if<( + typename std::enable_if<( std::is_same< typename Traits::specialize , void >::value && Traits::memory_traits::Aligned && (!Traits::memory_traits::Restrict) -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA && (!( std::is_same< typename Traits::memory_space,Kokkos::CudaSpace>::value || std::is_same< typename Traits::memory_space,Kokkos::CudaUVMSpace>::value )) @@ -2379,13 +2379,13 @@ struct ViewDataHandle< Traits , template< class Traits > struct ViewDataHandle< Traits , - typename std::enable_if<( + typename std::enable_if<( std::is_same< typename Traits::specialize , void >::value && Traits::memory_traits::Aligned && Traits::memory_traits::Restrict -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA && (!( std::is_same< typename Traits::memory_space,Kokkos::CudaSpace>::value || std::is_same< typename Traits::memory_space,Kokkos::CudaUVMSpace>::value )) @@ -2457,7 +2457,7 @@ struct ViewValueFunctor< ExecSpace , ValueType , false /* is_scalar */ > KOKKOS_INLINE_FUNCTION void operator()( const size_t i ) const { - if ( destroy ) { (ptr+i)->~ValueType(); } //KOKKOS_CUDA_CLANG_WORKAROUND this line causes ptax error __cxa_begin_catch in nested_view unit-test + if ( destroy ) { (ptr+i)->~ValueType(); } //KOKKOS_IMPL_CUDA_CLANG_WORKAROUND this line causes ptax error __cxa_begin_catch in nested_view unit-test else { new (ptr+i) ValueType(); } } @@ -2621,12 +2621,10 @@ public: typedef typename ViewDataHandle< Traits >::return_type reference_type ; typedef typename Traits::value_type * pointer_type ; - /** \brief If data references are lvalue_reference than can query pointer to memory */ + /** \brief Query raw pointer to memory */ KOKKOS_INLINE_FUNCTION constexpr pointer_type data() const { - return std::is_lvalue_reference< reference_type >::value - ? (pointer_type) m_handle - : (pointer_type) 0 ; + return m_handle; } //---------------------------------------- @@ -2983,7 +2981,7 @@ private: ( rank == 0 ) /* output rank zero */ || SubviewLegalArgsCompileTime::value + rank, SrcTraits::rank, 0, Args...>::value || // OutputRank 1 or 2, InputLayout Left, Interval 0 // because single stride one or second index has a stride. @@ -3013,13 +3011,13 @@ public: typedef Kokkos::ViewTraits < data_type - , array_layout + , array_layout , typename SrcTraits::device_type , typename SrcTraits::memory_traits > traits_type ; typedef Kokkos::View < data_type - , array_layout + , array_layout , typename SrcTraits::device_type , typename SrcTraits::memory_traits > type ; @@ -3029,13 +3027,13 @@ public: static_assert( Kokkos::Impl::is_memory_traits< MemoryTraits >::value , "" ); typedef Kokkos::ViewTraits - < data_type + < data_type , array_layout , typename SrcTraits::device_type , MemoryTraits > traits_type ; typedef Kokkos::View - < data_type + < data_type , array_layout , typename SrcTraits::device_type , MemoryTraits > type ; diff --git a/lib/kokkos/core/src/impl/Kokkos_Volatile_Load.hpp b/lib/kokkos/core/src/impl/Kokkos_Volatile_Load.hpp index 420ee63891..9c770c68d0 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Volatile_Load.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Volatile_Load.hpp @@ -1,13 +1,13 @@ /* //@HEADER // ************************************************************************ -// +// // Kokkos v. 2.0 // Copyright (2014) Sandia Corporation -// +// // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, // the U.S. Government retains certain rights in this software. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -36,23 +36,23 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) -// +// // ************************************************************************ //@HEADER */ -#if defined( KOKKOS_ATOMIC_HPP ) && ! defined( KOKKOS_VOLATILE_LOAD ) -#define KOKKOS_VOLATILE_LOAD +#if defined( KOKKOS_ATOMIC_HPP ) && ! defined( KOKKOS_VOLATILE_LOAD_HPP ) +#define KOKKOS_VOLATILE_LOAD_HPP #if defined( __GNUC__ ) /* GNU C */ || \ defined( __GNUG__ ) /* GNU C++ */ || \ defined( __clang__ ) -#define KOKKOS_MAY_ALIAS __attribute__((__may_alias__)) +#define KOKKOS_IMPL_MAY_ALIAS __attribute__((__may_alias__)) #else -#define KOKKOS_MAY_ALIAS +#define KOKKOS_IMPL_MAY_ALIAS #endif @@ -64,10 +64,10 @@ template KOKKOS_FORCEINLINE_FUNCTION T volatile_load(T const volatile * const src_ptr) { - typedef uint64_t KOKKOS_MAY_ALIAS T64; - typedef uint32_t KOKKOS_MAY_ALIAS T32; - typedef uint16_t KOKKOS_MAY_ALIAS T16; - typedef uint8_t KOKKOS_MAY_ALIAS T8; + typedef uint64_t KOKKOS_IMPL_MAY_ALIAS T64; + typedef uint32_t KOKKOS_IMPL_MAY_ALIAS T32; + typedef uint16_t KOKKOS_IMPL_MAY_ALIAS T16; + typedef uint8_t KOKKOS_IMPL_MAY_ALIAS T8; enum { NUM_8 = sizeof(T), @@ -117,10 +117,10 @@ template KOKKOS_FORCEINLINE_FUNCTION void volatile_store(T volatile * const dst_ptr, T const volatile * const src_ptr) { - typedef uint64_t KOKKOS_MAY_ALIAS T64; - typedef uint32_t KOKKOS_MAY_ALIAS T32; - typedef uint16_t KOKKOS_MAY_ALIAS T16; - typedef uint8_t KOKKOS_MAY_ALIAS T8; + typedef uint64_t KOKKOS_IMPL_MAY_ALIAS T64; + typedef uint32_t KOKKOS_IMPL_MAY_ALIAS T32; + typedef uint16_t KOKKOS_IMPL_MAY_ALIAS T16; + typedef uint8_t KOKKOS_IMPL_MAY_ALIAS T8; enum { NUM_8 = sizeof(T), @@ -166,10 +166,10 @@ template KOKKOS_FORCEINLINE_FUNCTION void volatile_store(T volatile * const dst_ptr, T const * const src_ptr) { - typedef uint64_t KOKKOS_MAY_ALIAS T64; - typedef uint32_t KOKKOS_MAY_ALIAS T32; - typedef uint16_t KOKKOS_MAY_ALIAS T16; - typedef uint8_t KOKKOS_MAY_ALIAS T8; + typedef uint64_t KOKKOS_IMPL_MAY_ALIAS T64; + typedef uint32_t KOKKOS_IMPL_MAY_ALIAS T32; + typedef uint16_t KOKKOS_IMPL_MAY_ALIAS T16; + typedef uint8_t KOKKOS_IMPL_MAY_ALIAS T8; enum { NUM_8 = sizeof(T), @@ -234,7 +234,7 @@ T safe_load(T const * const ptr) } // namespace kokkos -#undef KOKKOS_MAY_ALIAS +#undef KOKKOS_IMPL_MAY_ALIAS #endif diff --git a/lib/kokkos/core/src/impl/Kokkos_hwloc.cpp b/lib/kokkos/core/src/impl/Kokkos_hwloc.cpp index cb561f711c..c3c427bcce 100644 --- a/lib/kokkos/core/src/impl/Kokkos_hwloc.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_hwloc.cpp @@ -207,7 +207,7 @@ unsigned thread_mapping( const char * const label , /*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/ -#if defined( KOKKOS_HAVE_HWLOC ) +#if defined( KOKKOS_ENABLE_HWLOC ) #include #include @@ -691,7 +691,7 @@ std::pair get_this_thread_coordinate() //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- -#else /* ! defined( KOKKOS_HAVE_HWLOC ) */ +#else /* ! defined( KOKKOS_ENABLE_HWLOC ) */ namespace Kokkos { namespace hwloc { diff --git a/lib/kokkos/core/src/impl/Kokkos_spinwait.cpp b/lib/kokkos/core/src/impl/Kokkos_spinwait.cpp index aff7f29f89..ad1b6dce39 100644 --- a/lib/kokkos/core/src/impl/Kokkos_spinwait.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_spinwait.cpp @@ -54,7 +54,7 @@ /* Pause instruction to prevent excess processor bus usage */ #define YIELD asm volatile("pause\n":::"memory") #endif -#elif defined ( KOKKOS_HAVE_WINTHREAD ) +#elif defined ( KOKKOS_ENABLE_WINTHREAD ) #include #define YIELD Sleep(0) #elif defined ( _WIN32) && defined (_MSC_VER) diff --git a/lib/kokkos/core/unit_test/Makefile b/lib/kokkos/core/unit_test/Makefile index 3203dec28c..cc59825fba 100644 --- a/lib/kokkos/core/unit_test/Makefile +++ b/lib/kokkos/core/unit_test/Makefile @@ -44,6 +44,7 @@ else endif OBJ_CUDA += TestCuda_ViewAPI_a.o TestCuda_ViewAPI_b.o TestCuda_ViewAPI_c.o TestCuda_ViewAPI_d.o OBJ_CUDA += TestCuda_ViewAPI_e.o TestCuda_ViewAPI_f.o TestCuda_ViewAPI_g.o TestCuda_ViewAPI_h.o + OBJ_CUDA += TestCuda_ViewAPI_s.o OBJ_CUDA += UnitTestMain.o gtest-all.o TARGETS += KokkosCore_UnitTest_Cuda TEST_TARGETS += test-cuda diff --git a/lib/kokkos/core/unit_test/TestAtomicViews.hpp b/lib/kokkos/core/unit_test/TestAtomicViews.hpp new file mode 100644 index 0000000000..739492d32f --- /dev/null +++ b/lib/kokkos/core/unit_test/TestAtomicViews.hpp @@ -0,0 +1,1532 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// 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 Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "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 SANDIA CORPORATION OR THE +// 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. +// +// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include + +namespace TestAtomicViews { + +//------------------------------------------------- +//-----------atomic view api tests----------------- +//------------------------------------------------- + +template< class T , class ... P > +size_t allocation_count( const Kokkos::View & view ) +{ + const size_t card = view.size(); + const size_t alloc = view.span(); + + const int memory_span = Kokkos::View::required_allocation_size(100); + + return (card <= alloc && memory_span == 400) ? alloc : 0 ; +} + +template< class DataType , + class DeviceType , + unsigned Rank = Kokkos::ViewTraits< DataType >::rank > +struct TestViewOperator_LeftAndRight ; + +template< class DataType , class DeviceType > +struct TestViewOperator_LeftAndRight< DataType , DeviceType , 1 > +{ + typedef typename DeviceType::execution_space execution_space ; + typedef typename DeviceType::memory_space memory_space ; + typedef typename execution_space::size_type size_type ; + + typedef int value_type ; + + KOKKOS_INLINE_FUNCTION + static void join( volatile value_type & update , + const volatile value_type & input ) + { update |= input ; } + + KOKKOS_INLINE_FUNCTION + static void init( value_type & update ) + { update = 0 ; } + + + typedef Kokkos:: + View< DataType, Kokkos::LayoutLeft, execution_space, Kokkos::MemoryTraits< Kokkos::Atomic > > left_view ; + + typedef Kokkos:: + View< DataType, Kokkos::LayoutRight, execution_space, Kokkos::MemoryTraits< Kokkos::Atomic > > right_view ; + + typedef Kokkos:: + View< DataType, Kokkos::LayoutStride, execution_space, Kokkos::MemoryTraits< Kokkos::Atomic >> stride_view ; + + left_view left ; + right_view right ; + stride_view left_stride ; + stride_view right_stride ; + long left_alloc ; + long right_alloc ; + + TestViewOperator_LeftAndRight() + : left( "left" ) + , right( "right" ) + , left_stride( left ) + , right_stride( right ) + , left_alloc( allocation_count( left ) ) + , right_alloc( allocation_count( right ) ) + {} + + static void testit() + { + TestViewOperator_LeftAndRight driver ; + + int error_flag = 0 ; + + Kokkos::parallel_reduce( 1 , driver , error_flag ); + + ASSERT_EQ( error_flag , 0 ); + } + + KOKKOS_INLINE_FUNCTION + void operator()( const size_type , value_type & update ) const + { + for ( unsigned i0 = 0 ; i0 < unsigned(left.dimension_0()) ; ++i0 ) + { + // below checks that values match, but unable to check the references + // - should this be able to be checked? + if ( left(i0) != left(i0,0,0,0,0,0,0,0) ) { update |= 3 ; } + if ( right(i0) != right(i0,0,0,0,0,0,0,0) ) { update |= 3 ; } + if ( left(i0) != left_stride(i0) ) { update |= 4 ; } + if ( right(i0) != right_stride(i0) ) { update |= 8 ; } + /* + if ( & left(i0) != & left(i0,0,0,0,0,0,0,0) ) { update |= 3 ; } + if ( & right(i0) != & right(i0,0,0,0,0,0,0,0) ) { update |= 3 ; } + if ( & left(i0) != & left_stride(i0) ) { update |= 4 ; } + if ( & right(i0) != & right_stride(i0) ) { update |= 8 ; } + */ + } + } +}; + + +template< typename T, class DeviceType > +class TestAtomicViewAPI +{ +public: + typedef DeviceType device ; + + enum { N0 = 1000 , + N1 = 3 , + N2 = 5 , + N3 = 7 }; + + typedef Kokkos::View< T , device > dView0 ; + typedef Kokkos::View< T* , device > dView1 ; + typedef Kokkos::View< T*[N1] , device > dView2 ; + typedef Kokkos::View< T*[N1][N2] , device > dView3 ; + typedef Kokkos::View< T*[N1][N2][N3] , device > dView4 ; + typedef Kokkos::View< const T*[N1][N2][N3] , device > const_dView4 ; + typedef Kokkos::View< T****, device, Kokkos::MemoryUnmanaged > dView4_unmanaged ; + typedef typename dView0::host_mirror_space host ; + + typedef Kokkos::View< T , device , Kokkos::MemoryTraits< Kokkos::Atomic > > aView0 ; + typedef Kokkos::View< T* , device , Kokkos::MemoryTraits< Kokkos::Atomic > > aView1 ; + typedef Kokkos::View< T*[N1] , device , Kokkos::MemoryTraits< Kokkos::Atomic > > aView2 ; + typedef Kokkos::View< T*[N1][N2] , device , Kokkos::MemoryTraits< Kokkos::Atomic > > aView3 ; + typedef Kokkos::View< T*[N1][N2][N3] , device , Kokkos::MemoryTraits< Kokkos::Atomic > > aView4 ; + typedef Kokkos::View< const T*[N1][N2][N3] , device , Kokkos::MemoryTraits< Kokkos::Atomic > > const_aView4 ; + + typedef Kokkos::View< T****, device, Kokkos::MemoryTraits< Kokkos::Unmanaged | Kokkos::Atomic > > aView4_unmanaged ; + + typedef typename aView0::host_mirror_space host_atomic ; + + TestAtomicViewAPI() + { + TestViewOperator_LeftAndRight< int[2] , device >::testit(); + run_test_rank0(); + run_test_rank4(); + run_test_const(); + } + + + static void run_test_rank0() + { + dView0 dx , dy ; + aView0 ax , ay , az ; + + dx = dView0( "dx" ); + dy = dView0( "dy" ); + ASSERT_EQ( dx.use_count() , size_t(1) ); + ASSERT_EQ( dy.use_count() , size_t(1) ); + + ax = dx ; + ay = dy ; + ASSERT_EQ( dx.use_count() , size_t(2) ); + ASSERT_EQ( dy.use_count() , size_t(2) ); + ASSERT_EQ( dx.use_count() , ax.use_count() ); + + az = ax ; + ASSERT_EQ( dx.use_count() , size_t(3) ); + ASSERT_EQ( ax.use_count() , size_t(3) ); + ASSERT_EQ( az.use_count() , size_t(3) ); + ASSERT_EQ( az.use_count() , ax.use_count() ); + } + + static void run_test_rank4() + { + dView4 dx , dy ; + aView4 ax , ay , az ; + + dx = dView4( "dx" , N0 ); + dy = dView4( "dy" , N0 ); + ASSERT_EQ( dx.use_count() , size_t(1) ); + ASSERT_EQ( dy.use_count() , size_t(1) ); + + ax = dx ; + ay = dy ; + ASSERT_EQ( dx.use_count() , size_t(2) ); + ASSERT_EQ( dy.use_count() , size_t(2) ); + ASSERT_EQ( dx.use_count() , ax.use_count() ); + + dView4_unmanaged unmanaged_dx = dx; + ASSERT_EQ( dx.use_count() , size_t(2) ); + + az = ax ; + ASSERT_EQ( dx.use_count() , size_t(3) ); + ASSERT_EQ( ax.use_count() , size_t(3) ); + ASSERT_EQ( az.use_count() , size_t(3) ); + ASSERT_EQ( az.use_count() , ax.use_count() ); + + aView4_unmanaged unmanaged_ax = ax; + ASSERT_EQ( ax.use_count() , size_t(3) ); + + aView4_unmanaged unmanaged_ax_from_ptr_dx = aView4_unmanaged(dx.data(), + dx.dimension_0(), + dx.dimension_1(), + dx.dimension_2(), + dx.dimension_3()); + ASSERT_EQ( ax.use_count() , size_t(3) ); + + const_aView4 const_ax = ax ; + ASSERT_EQ( ax.use_count() , size_t(4) ); + ASSERT_EQ( const_ax.use_count() , ax.use_count() ); + + ASSERT_FALSE( ax.data() == 0 ); + ASSERT_FALSE( const_ax.data() == 0 ); // referenceable ptr + ASSERT_FALSE( unmanaged_ax.data() == 0 ); + ASSERT_FALSE( unmanaged_ax_from_ptr_dx.data() == 0 ); + ASSERT_FALSE( ay.data() == 0 ); +// ASSERT_NE( ax , ay ); +// Above test results in following runtime error from gtest: +// Expected: (ax) != (ay), actual: 32-byte object <30-01 D0-A0 D8-7F 00-00 00-31 44-0C 01-00 00-00 E8-03 00-00 00-00 00-00 69-00 00-00 00-00 00-00> vs 32-byte object <80-01 D0-A0 D8-7F 00-00 00-A1 4A-0C 01-00 00-00 E8-03 00-00 00-00 00-00 69-00 00-00 00-00 00-00> + + ASSERT_EQ( ax.dimension_0() , unsigned(N0) ); + ASSERT_EQ( ax.dimension_1() , unsigned(N1) ); + ASSERT_EQ( ax.dimension_2() , unsigned(N2) ); + ASSERT_EQ( ax.dimension_3() , unsigned(N3) ); + + ASSERT_EQ( ay.dimension_0() , unsigned(N0) ); + ASSERT_EQ( ay.dimension_1() , unsigned(N1) ); + ASSERT_EQ( ay.dimension_2() , unsigned(N2) ); + ASSERT_EQ( ay.dimension_3() , unsigned(N3) ); + + ASSERT_EQ( unmanaged_ax_from_ptr_dx.capacity(),unsigned(N0)*unsigned(N1)*unsigned(N2)*unsigned(N3) ); + } + + typedef T DataType[2] ; + + static void + check_auto_conversion_to_const( + const Kokkos::View< const DataType , device , Kokkos::MemoryTraits< Kokkos::Atomic> > & arg_const , + const Kokkos::View< const DataType , device , Kokkos::MemoryTraits< Kokkos::Atomic> > & arg ) + { + ASSERT_TRUE( arg_const == arg ); + } + + static void run_test_const() + { + typedef Kokkos::View< DataType , device , Kokkos::MemoryTraits< Kokkos::Atomic> > typeX ; + typedef Kokkos::View< const DataType , device , Kokkos::MemoryTraits< Kokkos::Atomic> > const_typeX ; + + typeX x( "X" ); + const_typeX xc = x ; + + //ASSERT_TRUE( xc == x ); // const xc is referenceable, non-const x is not + //ASSERT_TRUE( x == xc ); + + check_auto_conversion_to_const( x , xc ); + } + +}; + + +//--------------------------------------------------- +//-----------initialization functors----------------- +//--------------------------------------------------- + +template +struct InitFunctor_Seq { + + typedef Kokkos::View< T* , execution_space > view_type ; + + view_type input ; + const long length ; + + InitFunctor_Seq( view_type & input_ , const long length_ ) + : input(input_) + , length(length_) + {} + + KOKKOS_INLINE_FUNCTION + void operator()( const long i ) const { + if ( i < length ) { + input(i) = (T) i ; + } + } + +}; + + +template +struct InitFunctor_ModTimes { + + typedef Kokkos::View< T* , execution_space > view_type ; + + view_type input ; + const long length ; + const long remainder ; + + InitFunctor_ModTimes( view_type & input_ , const long length_ , const long remainder_ ) + : input(input_) + , length(length_) + , remainder(remainder_) + {} + + KOKKOS_INLINE_FUNCTION + void operator()( const long i ) const { + if ( i < length ) { + if ( i % (remainder+1) == remainder ) { + input(i) = (T)2 ; + } + else { + input(i) = (T)1 ; + } + } + } +}; + + +template +struct InitFunctor_ModShift { + + typedef Kokkos::View< T* , execution_space > view_type ; + + view_type input ; + const long length ; + const long remainder ; + + InitFunctor_ModShift( view_type & input_ , const long length_ , const long remainder_ ) + : input(input_) + , length(length_) + , remainder(remainder_) + {} + + KOKKOS_INLINE_FUNCTION + void operator()( const long i ) const { + if ( i < length ) { + if ( i % (remainder+1) == remainder ) { + input(i) = 1 ; + } + } + } +}; + + +//--------------------------------------------------- +//-----------atomic view plus-equal------------------ +//--------------------------------------------------- + +template +struct PlusEqualAtomicViewFunctor { + + typedef Kokkos::View< T* , execution_space , Kokkos::MemoryTraits< Kokkos::Atomic > > atomic_view_type ; + + typedef Kokkos::View< T* , execution_space > view_type ; + + view_type input; + atomic_view_type even_odd_result; + const long length; + + // Wrap the result view in an atomic view, use this for operator + PlusEqualAtomicViewFunctor( const view_type & input_ , view_type & even_odd_result_ , const long length_) + : input(input_) + , even_odd_result(even_odd_result_) + , length(length_) + {} + + KOKKOS_INLINE_FUNCTION + void operator()(const long i) const { + if ( i < length ) { + if ( i % 2 == 0 ) { + even_odd_result(0) += input(i); + } + else { + even_odd_result(1) += input(i); + } + } + } + +}; + + +template +T PlusEqualAtomicView(const long input_length) { + + typedef Kokkos::View< T* , execution_space > view_type ; + typedef typename view_type::HostMirror host_view_type ; + + const long length = input_length; + + view_type input("input_view",length) ; + view_type result_view("result_view",2) ; + + InitFunctor_Seq init_f( input , length ) ; + Kokkos::parallel_for(Kokkos::RangePolicy(0, length) , init_f ); + + PlusEqualAtomicViewFunctor functor(input, result_view, length); + Kokkos::parallel_for( Kokkos::RangePolicy(0, length), functor); + Kokkos::fence(); + + host_view_type h_result_view = Kokkos::create_mirror_view(result_view); + Kokkos::deep_copy(h_result_view, result_view); + + return (T) (h_result_view(0) + h_result_view(1) ) ; +} + +template +T PlusEqualAtomicViewCheck( const long input_length ) { + + const long N = input_length; + T result[2]; + if ( N % 2 == 0 ) { + const long half_sum_end = (N/2) - 1; + const long full_sum_end = N - 1; + result[0] = half_sum_end*(half_sum_end + 1)/2 ; //even sum + result[1] = ( full_sum_end*(full_sum_end + 1)/2 ) - result[0] ; // odd sum + } + else { + const long half_sum_end = (T)(N/2) ; + const long full_sum_end = N - 2; + result[0] = half_sum_end*(half_sum_end - 1)/2 ; //even sum + result[1] = ( full_sum_end*(full_sum_end - 1)/2 ) - result[0] ; // odd sum + } + + return (T)(result[0] + result[1]); +} + +template +bool PlusEqualAtomicViewTest(long input_length) +{ + T res = PlusEqualAtomicView(input_length); + T resSerial = PlusEqualAtomicViewCheck(input_length); + + bool passed = true; + + if ( resSerial != res ) { + passed = false; + + std::cout << "Loop<" + << typeid(T).name() + << ">( test = PlusEqualAtomicViewTest" + << " FAILED : " + << resSerial << " != " << res + << std::endl ; + } + + return passed ; +} + + +//--------------------------------------------------- +//-----------atomic view minus-equal----------------- +//--------------------------------------------------- + +template +struct MinusEqualAtomicViewFunctor { + + typedef Kokkos::View< T* , execution_space , Kokkos::MemoryTraits< Kokkos::Atomic > > atomic_view_type ; + + typedef Kokkos::View< T* , execution_space > view_type ; + + view_type input; + atomic_view_type even_odd_result; + const long length; + + // Wrap the result view in an atomic view, use this for operator + MinusEqualAtomicViewFunctor( const view_type & input_ , view_type & even_odd_result_ , const long length_) + : input(input_) + , even_odd_result(even_odd_result_) + , length(length_) + {} + + KOKKOS_INLINE_FUNCTION + void operator()(const long i) const { + if ( i < length ) { + if ( i % 2 == 0 ) { + even_odd_result(0) -= input(i); + } + else { + even_odd_result(1) -= input(i); + } + } + } + +}; + + +template +T MinusEqualAtomicView(const long input_length) { + + typedef Kokkos::View< T* , execution_space > view_type ; + typedef typename view_type::HostMirror host_view_type ; + + const long length = input_length; + + view_type input("input_view",length) ; + view_type result_view("result_view",2) ; + + InitFunctor_Seq init_f( input , length ) ; + Kokkos::parallel_for( Kokkos::RangePolicy(0, length), init_f ); + + MinusEqualAtomicViewFunctor functor(input, result_view,length); + Kokkos::parallel_for( Kokkos::RangePolicy(0, length), functor); + Kokkos::fence(); + + host_view_type h_result_view = Kokkos::create_mirror_view(result_view); + Kokkos::deep_copy(h_result_view, result_view); + + return (T) (h_result_view(0) + h_result_view(1) ) ; +} + +template +T MinusEqualAtomicViewCheck( const long input_length ) { + + const long N = input_length; + T result[2]; + if ( N % 2 == 0 ) { + const long half_sum_end = (N/2) - 1; + const long full_sum_end = N - 1; + result[0] = -1*( half_sum_end*(half_sum_end + 1)/2 ) ; //even sum + result[1] = -1*( ( full_sum_end*(full_sum_end + 1)/2 ) + result[0] ) ; // odd sum + } + else { + const long half_sum_end = (long)(N/2) ; + const long full_sum_end = N - 2; + result[0] = -1*( half_sum_end*(half_sum_end - 1)/2 ) ; //even sum + result[1] = -1*( ( full_sum_end*(full_sum_end - 1)/2 ) + result[0] ) ; // odd sum + } + + return (result[0] + result[1]); +} + +template +bool MinusEqualAtomicViewTest(long input_length) +{ + T res = MinusEqualAtomicView(input_length); + T resSerial = MinusEqualAtomicViewCheck(input_length); + + bool passed = true; + + if ( resSerial != res ) { + passed = false; + + std::cout << "Loop<" + << typeid(T).name() + << ">( test = MinusEqualAtomicViewTest" + << " FAILED : " + << resSerial << " != " << res + << std::endl ; + } + + return passed ; +} + + +//--------------------------------------------------- +//-----------atomic view times-equal----------------- +//--------------------------------------------------- + +template +struct TimesEqualAtomicViewFunctor { + + typedef Kokkos::View< T* , execution_space , Kokkos::MemoryTraits< Kokkos::Atomic > > atomic_view_type ; + + typedef Kokkos::View< T* , execution_space > view_type ; + + view_type input; + atomic_view_type result; + const long length; + + // Wrap the result view in an atomic view, use this for operator + TimesEqualAtomicViewFunctor( const view_type & input_ , view_type & result_ , const long length_) + : input(input_) + , result(result_) + , length(length_) + {} + + KOKKOS_INLINE_FUNCTION + void operator()(const long i) const { + if ( i < length && i > 0 ) { + result(0) *= (double)input(i); + } + } + +}; + + +template +T TimesEqualAtomicView(const long input_length, const long remainder) { + + typedef Kokkos::View< T* , execution_space > view_type ; + typedef typename view_type::HostMirror host_view_type ; + + const long length = input_length; + + view_type input("input_view",length) ; + view_type result_view("result_view",1) ; + deep_copy(result_view, 1.0); + + InitFunctor_ModTimes init_f( input , length , remainder ) ; + Kokkos::parallel_for( Kokkos::RangePolicy(0, length), init_f ); + + TimesEqualAtomicViewFunctor functor(input, result_view, length); + Kokkos::parallel_for( Kokkos::RangePolicy(0, length), functor); + Kokkos::fence(); + + host_view_type h_result_view = Kokkos::create_mirror_view(result_view); + Kokkos::deep_copy(h_result_view, result_view); + + return (T) (h_result_view(0)) ; +} + +template +T TimesEqualAtomicViewCheck( const long input_length, const long remainder ) { + + //Analytical result + const long N = input_length; + T result = 1.0; + + for ( long i = 2; i < N; ++i ) { + if ( i % (remainder+1) == remainder ) { + result *= 2.0; + } + else { + result *= 1.0; + } + } + + return (T)result; +} + +template +bool TimesEqualAtomicViewTest(const long input_length) +{ + const long remainder = 23; + T res = TimesEqualAtomicView(input_length, remainder); + T resSerial = TimesEqualAtomicViewCheck(input_length, remainder); + + bool passed = true; + + if ( resSerial != res ) { + passed = false; + + std::cout << "Loop<" + << typeid(T).name() + << ">( test = TimesEqualAtomicViewTest" + << " FAILED : " + << resSerial << " != " << res + << std::endl ; + } + + return passed ; +} + + +//--------------------------------------------------- +//------------atomic view div-equal------------------ +//--------------------------------------------------- + +template +struct DivEqualAtomicViewFunctor { + + typedef Kokkos::View< T , execution_space , Kokkos::MemoryTraits< Kokkos::Atomic > > atomic_view_type ; + + typedef Kokkos::View< T* , execution_space > view_type ; + typedef Kokkos::View< T , execution_space > scalar_view_type ; + + view_type input; + atomic_view_type result; + const long length; + + // Wrap the result view in an atomic view, use this for operator + DivEqualAtomicViewFunctor( const view_type & input_ , scalar_view_type & result_ , const long length_) + : input(input_) + , result(result_) + , length(length_) + {} + + KOKKOS_INLINE_FUNCTION + void operator()(const long i) const { + if ( i < length && i > 0 ) { + result() /= (double)(input(i)); + } + } + +}; + + +template +T DivEqualAtomicView(const long input_length, const long remainder) { + + typedef Kokkos::View< T* , execution_space > view_type ; + typedef Kokkos::View< T , execution_space > scalar_view_type ; + typedef typename scalar_view_type::HostMirror host_scalar_view_type ; + + const long length = input_length; + + view_type input("input_view",length) ; + scalar_view_type result_view("result_view") ; + Kokkos::deep_copy(result_view, 12121212121); + + InitFunctor_ModTimes init_f( input , length , remainder ) ; + Kokkos::parallel_for( Kokkos::RangePolicy(0, length), init_f ); + + DivEqualAtomicViewFunctor functor(input, result_view, length); + Kokkos::parallel_for( Kokkos::RangePolicy(0, length), functor); + Kokkos::fence(); + + host_scalar_view_type h_result_view = Kokkos::create_mirror_view(result_view); + Kokkos::deep_copy(h_result_view, result_view); + + return (T) (h_result_view()) ; +} + +template +T DivEqualAtomicViewCheck( const long input_length , const long remainder ) { + + const long N = input_length; + T result = 12121212121.0; + for ( long i = 2; i < N; ++i ) { + if ( i % (remainder+1) == remainder ) { + result /= 1.0; + } + else { + result /= 2.0; + } + + } + + return (T)result; +} + +template +bool DivEqualAtomicViewTest(const long input_length) +{ + const long remainder = 23; + + T res = DivEqualAtomicView(input_length, remainder); + T resSerial = DivEqualAtomicViewCheck(input_length, remainder); + + bool passed = true; + + if ( resSerial != res ) { + passed = false; + + std::cout << "Loop<" + << typeid(T).name() + << ">( test = DivEqualAtomicViewTest" + << " FAILED : " + << resSerial << " != " << res + << std::endl ; + } + + return passed ; +} + + +//--------------------------------------------------- +//------------atomic view mod-equal------------------ +//--------------------------------------------------- + +template +struct ModEqualAtomicViewFunctor { + + typedef Kokkos::View< T , execution_space , Kokkos::MemoryTraits< Kokkos::Atomic > > atomic_view_type ; + + typedef Kokkos::View< T* , execution_space > view_type ; + typedef Kokkos::View< T , execution_space > scalar_view_type ; + + view_type input; + atomic_view_type result; + const long length; + + // Wrap the result view in an atomic view, use this for operator + ModEqualAtomicViewFunctor( const view_type & input_ , scalar_view_type & result_ , const long length_) + : input(input_) + , result(result_) + , length(length_) + {} + + KOKKOS_INLINE_FUNCTION + void operator()(const long i) const { + if ( i < length && i > 0 ) { + result() %= (double)(input(i)); + } + } + +}; + + +template +T ModEqualAtomicView(const long input_length, const long remainder) { + + typedef Kokkos::View< T* , execution_space > view_type ; + typedef Kokkos::View< T , execution_space > scalar_view_type ; + typedef typename scalar_view_type::HostMirror host_scalar_view_type ; + + const long length = input_length; + + view_type input("input_view",length) ; + scalar_view_type result_view("result_view") ; + Kokkos::deep_copy(result_view, 12121212121); + + InitFunctor_ModTimes init_f( input , length , remainder ) ; + Kokkos::parallel_for( Kokkos::RangePolicy(0, length), init_f ); + + ModEqualAtomicViewFunctor functor(input, result_view, length); + Kokkos::parallel_for( Kokkos::RangePolicy(0, length), functor); + Kokkos::fence(); + + host_scalar_view_type h_result_view = Kokkos::create_mirror_view(result_view); + Kokkos::deep_copy(h_result_view, result_view); + + return (T) (h_result_view()) ; +} + +template +T ModEqualAtomicViewCheck( const long input_length , const long remainder ) { + + const long N = input_length; + T result = 12121212121; + for ( long i = 2; i < N; ++i ) { + if ( i % (remainder+1) == remainder ) { + result %= 1; + } + else { + result %= 2; + } + } + + return (T)result; +} + +template +bool ModEqualAtomicViewTest(const long input_length) +{ + + static_assert( std::is_integral::value, "ModEqualAtomicView Error: Type must be integral type for this unit test"); + + const long remainder = 23; + + T res = ModEqualAtomicView(input_length, remainder); + T resSerial = ModEqualAtomicViewCheck(input_length, remainder); + + bool passed = true; + + if ( resSerial != res ) { + passed = false; + + std::cout << "Loop<" + << typeid(T).name() + << ">( test = ModEqualAtomicViewTest" + << " FAILED : " + << resSerial << " != " << res + << std::endl ; + } + + return passed ; +} + + +//--------------------------------------------------- +//------------atomic view rs-equal------------------ +//--------------------------------------------------- + +template +struct RSEqualAtomicViewFunctor { + + typedef Kokkos::View< T**** , execution_space , Kokkos::MemoryTraits< Kokkos::Atomic > > atomic_view_type ; + + typedef Kokkos::View< T* , execution_space > view_type ; + typedef Kokkos::View< T**** , execution_space > result_view_type ; + + const view_type input; + atomic_view_type result; + const long length; + const long value; + + // Wrap the result view in an atomic view, use this for operator + RSEqualAtomicViewFunctor( const view_type & input_ , result_view_type & result_ , const long & length_ , const long & value_ ) + : input(input_) + , result(result_) + , length(length_) + , value(value_) + {} + + KOKKOS_INLINE_FUNCTION + void operator()(const long i) const { + if ( i < length ) { + if ( i % 4 == 0 ) { + result(1,0,0,0) >>= input(i); + } + else if ( i % 4 == 1 ) { + result(0,1,0,0) >>= input(i); + } + else if ( i % 4 == 2 ) { + result(0,0,1,0) >>= input(i); + } + else if ( i % 4 == 3 ) { + result(0,0,0,1) >>= input(i); + } + } + } + +}; + + +template +T RSEqualAtomicView(const long input_length, const long value, const long remainder) { + + typedef Kokkos::View< T* , execution_space > view_type ; + typedef Kokkos::View< T**** , execution_space > result_view_type ; + typedef typename result_view_type::HostMirror host_scalar_view_type ; + + const long length = input_length; + + view_type input("input_view",length) ; + result_view_type result_view("result_view",2,2,2,2) ; + host_scalar_view_type h_result_view = Kokkos::create_mirror_view(result_view); + h_result_view(1,0,0,0) = value; + h_result_view(0,1,0,0) = value; + h_result_view(0,0,1,0) = value; + h_result_view(0,0,0,1) = value; + Kokkos::deep_copy( result_view , h_result_view ); + + + InitFunctor_ModShift init_f( input , length , remainder ) ; + Kokkos::parallel_for( Kokkos::RangePolicy(0, length), init_f ); + + RSEqualAtomicViewFunctor functor(input, result_view, length, value); + Kokkos::parallel_for( Kokkos::RangePolicy(0, length), functor); + Kokkos::fence(); + + Kokkos::deep_copy(h_result_view, result_view); + + return (T) (h_result_view(1,0,0,0)) ; +} + +template +T RSEqualAtomicViewCheck( const long input_length, const long value, const long remainder ) { + + T result[4] ; + result[0] = value ; + result[1] = value ; + result[2] = value ; + result[3] = value ; + + T * input = new T[input_length]; + for ( long i = 0; i < input_length; ++i ) { + if ( i % (remainder+1) == remainder ) { + input[i] = 1; + } + else { + input[i] = 0; + } + } + + for ( long i = 0; i < input_length; ++i ) { + if ( i % 4 == 0 ) { + result[0] >>= input[i]; + } + else if ( i % 4 == 1 ) { + result[1] >>= input[i]; + } + else if ( i % 4 == 2 ) { + result[2] >>= input[i]; + } + else if ( i % 4 == 3 ) { + result[3] >>= input[i]; + } + } + delete [] input; + + return (T)result[0]; +} + +template +bool RSEqualAtomicViewTest(const long input_length) +{ + + static_assert( std::is_integral::value, "RSEqualAtomicViewTest: Must be integral type for test"); + + const long remainder = 61042; //prime - 1 + const long value = 1073741825; // 2^30+1 + T res = RSEqualAtomicView(input_length, value, remainder); + T resSerial = RSEqualAtomicViewCheck(input_length, value, remainder); + + bool passed = true; + + if ( resSerial != res ) { + passed = false; + + std::cout << "Loop<" + << typeid(T).name() + << ">( test = RSEqualAtomicViewTest" + << " FAILED : " + << resSerial << " != " << res + << std::endl ; + } + + return passed ; +} + + +//--------------------------------------------------- +//------------atomic view ls-equal------------------ +//--------------------------------------------------- + +template +struct LSEqualAtomicViewFunctor { + + typedef Kokkos::View< T**** , execution_space , Kokkos::MemoryTraits< Kokkos::Atomic > > atomic_view_type ; + + typedef Kokkos::View< T* , execution_space > view_type ; + typedef Kokkos::View< T**** , execution_space > result_view_type ; + + view_type input; + atomic_view_type result; + const long length; + const long value; + + // Wrap the result view in an atomic view, use this for operator + LSEqualAtomicViewFunctor( const view_type & input_ , result_view_type & result_ , const long & length_ , const long & value_ ) + : input(input_) + , result(result_) + , length(length_) + , value(value_) + {} + + KOKKOS_INLINE_FUNCTION + void operator()(const long i) const { + if ( i < length ) { + if ( i % 4 == 0 ) { + result(1,0,0,0) <<= input(i); + } + else if ( i % 4 == 1 ) { + result(0,1,0,0) <<= input(i); + } + else if ( i % 4 == 2 ) { + result(0,0,1,0) <<= input(i); + } + else if ( i % 4 == 3 ) { + result(0,0,0,1) <<= input(i); + } + } + } + +}; + + +template +T LSEqualAtomicView(const long input_length, const long value, const long remainder) { + + typedef Kokkos::View< T* , execution_space > view_type ; + typedef Kokkos::View< T**** , execution_space > result_view_type ; + typedef typename result_view_type::HostMirror host_scalar_view_type ; + + const long length = input_length; + + view_type input("input_view",length) ; + result_view_type result_view("result_view",2,2,2,2) ; + host_scalar_view_type h_result_view = Kokkos::create_mirror_view(result_view); + h_result_view(1,0,0,0) = value; + h_result_view(0,1,0,0) = value; + h_result_view(0,0,1,0) = value; + h_result_view(0,0,0,1) = value; + Kokkos::deep_copy( result_view , h_result_view ); + + InitFunctor_ModShift init_f( input , length , remainder ) ; + Kokkos::parallel_for( Kokkos::RangePolicy(0, length), init_f ); + + LSEqualAtomicViewFunctor functor(input, result_view, length, value); + Kokkos::parallel_for( Kokkos::RangePolicy(0, length), functor); + Kokkos::fence(); + + Kokkos::deep_copy(h_result_view, result_view); + + return (T) (h_result_view(1,0,0,0)) ; +} + +template +T LSEqualAtomicViewCheck( const long input_length, const long value, const long remainder ) { + + T result[4] ; + result[0] = value ; + result[1] = value ; + result[2] = value ; + result[3] = value ; + + T * input = new T[input_length]; + for ( long i = 0; i < input_length; ++i ) { + if ( i % (remainder+1) == remainder ) { + input[i] = 1; + } + else { + input[i] = 0; + } + } + + for ( long i = 0; i < input_length; ++i ) { + if ( i % 4 == 0 ) { + result[0] <<= input[i]; + } + else if ( i % 4 == 1 ) { + result[1] <<= input[i]; + } + else if ( i % 4 == 2 ) { + result[2] <<= input[i]; + } + else if ( i % 4 == 3 ) { + result[3] <<= input[i]; + } + } + + delete [] input; + + return (T)result[0]; +} + +template +bool LSEqualAtomicViewTest(const long input_length) +{ + + static_assert( std::is_integral::value, "LSEqualAtomicViewTest: Must be integral type for test"); + + const long remainder = 61042; //prime - 1 + const long value = 1; // 2^30+1 + T res = LSEqualAtomicView(input_length, value, remainder); + T resSerial = LSEqualAtomicViewCheck(input_length, value, remainder); + + bool passed = true; + + if ( resSerial != res ) { + passed = false; + + std::cout << "Loop<" + << typeid(T).name() + << ">( test = RSEqualAtomicViewTest" + << " FAILED : " + << resSerial << " != " << res + << std::endl ; + } + + return passed ; +} + + +//--------------------------------------------------- +//-----------atomic view and-equal----------------- +//--------------------------------------------------- + +template +struct AndEqualAtomicViewFunctor { + + typedef Kokkos::View< T* , execution_space , Kokkos::MemoryTraits< Kokkos::Atomic > > atomic_view_type ; + + typedef Kokkos::View< T* , execution_space > view_type ; + + view_type input; + atomic_view_type even_odd_result; + const long length; + + // Wrap the result view in an atomic view, use this for operator + AndEqualAtomicViewFunctor( const view_type & input_ , view_type & even_odd_result_ , const long length_) + : input(input_) + , even_odd_result(even_odd_result_) + , length(length_) + {} + + KOKKOS_INLINE_FUNCTION + void operator()(const long i) const { + if ( i < length ) { + if ( i % 2 == 0 ) { + even_odd_result(0) &= input(i); + } + else { + even_odd_result(1) &= input(i); + } + } + } + +}; + + +template +T AndEqualAtomicView(const long input_length) { + + typedef Kokkos::View< T* , execution_space > view_type ; + typedef typename view_type::HostMirror host_view_type ; + + const long length = input_length; + + view_type input("input_view",length) ; + view_type result_view("result_view",2) ; + Kokkos::deep_copy(result_view, 1); + + InitFunctor_Seq init_f( input , length ) ; + Kokkos::parallel_for( Kokkos::RangePolicy(0, length), init_f ); + + AndEqualAtomicViewFunctor functor(input, result_view,length); + Kokkos::parallel_for( Kokkos::RangePolicy(0, length), functor); + Kokkos::fence(); + + host_view_type h_result_view = Kokkos::create_mirror_view(result_view); + Kokkos::deep_copy(h_result_view, result_view); + + return (T) (h_result_view(0)) ; +} + +template +T AndEqualAtomicViewCheck( const long input_length ) { + + const long N = input_length; + T result[2] = {1}; + for ( long i = 0; i < N; ++i ) { + if ( N % 2 == 0 ) { + result[0] &= (T)i; + } + else { + result[1] &= (T)i; + } + } + + return (result[0]); +} + +template +bool AndEqualAtomicViewTest(long input_length) +{ + + static_assert( std::is_integral::value, "AndEqualAtomicViewTest: Must be integral type for test"); + + T res = AndEqualAtomicView(input_length); + T resSerial = AndEqualAtomicViewCheck(input_length); + + bool passed = true; + + if ( resSerial != res ) { + passed = false; + + std::cout << "Loop<" + << typeid(T).name() + << ">( test = AndEqualAtomicViewTest" + << " FAILED : " + << resSerial << " != " << res + << std::endl ; + } + + return passed ; +} + + +//--------------------------------------------------- +//-----------atomic view or-equal----------------- +//--------------------------------------------------- + +template +struct OrEqualAtomicViewFunctor { + + typedef Kokkos::View< T* , execution_space , Kokkos::MemoryTraits< Kokkos::Atomic > > atomic_view_type ; + + typedef Kokkos::View< T* , execution_space > view_type ; + + view_type input; + atomic_view_type even_odd_result; + const long length; + + // Wrap the result view in an atomic view, use this for operator + OrEqualAtomicViewFunctor( const view_type & input_ , view_type & even_odd_result_ , const long length_) + : input(input_) + , even_odd_result(even_odd_result_) + , length(length_) + {} + + KOKKOS_INLINE_FUNCTION + void operator()(const long i) const { + if ( i < length ) { + if ( i % 2 == 0 ) { + even_odd_result(0) |= input(i); + } + else { + even_odd_result(1) |= input(i); + } + } + } + +}; + + +template +T OrEqualAtomicView(const long input_length) { + + typedef Kokkos::View< T* , execution_space > view_type ; + typedef typename view_type::HostMirror host_view_type ; + + const long length = input_length; + + view_type input("input_view",length) ; + view_type result_view("result_view",2) ; + + InitFunctor_Seq init_f( input , length ) ; + Kokkos::parallel_for( Kokkos::RangePolicy(0, length), init_f ); + + OrEqualAtomicViewFunctor functor(input, result_view,length); + Kokkos::parallel_for( Kokkos::RangePolicy(0, length), functor); + Kokkos::fence(); + + host_view_type h_result_view = Kokkos::create_mirror_view(result_view); + Kokkos::deep_copy(h_result_view, result_view); + + return (T) (h_result_view(0)) ; +} + +template +T OrEqualAtomicViewCheck( const long input_length ) { + + const long N = input_length; + T result[2] = {0}; + for ( long i = 0; i < N; ++i ) { + if ( i % 2 == 0 ) { + result[0] |= (T)i; + } + else { + result[1] |= (T)i; + } + } + + return (T)(result[0]); +} + +template +bool OrEqualAtomicViewTest(long input_length) +{ + + static_assert( std::is_integral::value, "OrEqualAtomicViewTest: Must be integral type for test"); + + T res = OrEqualAtomicView(input_length); + T resSerial = OrEqualAtomicViewCheck(input_length); + + bool passed = true; + + if ( resSerial != res ) { + passed = false; + + std::cout << "Loop<" + << typeid(T).name() + << ">( test = OrEqualAtomicViewTest" + << " FAILED : " + << resSerial << " != " << res + << std::endl ; + } + + return passed ; +} + + +//--------------------------------------------------- +//-----------atomic view xor-equal----------------- +//--------------------------------------------------- + +template +struct XOrEqualAtomicViewFunctor { + + typedef Kokkos::View< T* , execution_space , Kokkos::MemoryTraits< Kokkos::Atomic > > atomic_view_type ; + + typedef Kokkos::View< T* , execution_space > view_type ; + + view_type input; + atomic_view_type even_odd_result; + const long length; + + // Wrap the result view in an atomic view, use this for operator + XOrEqualAtomicViewFunctor( const view_type & input_ , view_type & even_odd_result_ , const long length_) + : input(input_) + , even_odd_result(even_odd_result_) + , length(length_) + {} + + KOKKOS_INLINE_FUNCTION + void operator()(const long i) const { + if ( i < length ) { + if ( i % 2 == 0 ) { + even_odd_result(0) ^= input(i); + } + else { + even_odd_result(1) ^= input(i); + } + } + } + +}; + + +template +T XOrEqualAtomicView(const long input_length) { + + typedef Kokkos::View< T* , execution_space > view_type ; + typedef typename view_type::HostMirror host_view_type ; + + const long length = input_length; + + view_type input("input_view",length) ; + view_type result_view("result_view",2) ; + + InitFunctor_Seq init_f( input , length ) ; + Kokkos::parallel_for( Kokkos::RangePolicy(0, length), init_f ); + + XOrEqualAtomicViewFunctor functor(input, result_view,length); + Kokkos::parallel_for( Kokkos::RangePolicy(0, length), functor); + Kokkos::fence(); + + host_view_type h_result_view = Kokkos::create_mirror_view(result_view); + Kokkos::deep_copy(h_result_view, result_view); + + return (T) (h_result_view(0)) ; +} + +template +T XOrEqualAtomicViewCheck( const long input_length ) { + + const long N = input_length; + T result[2] = {0}; + for ( long i = 0; i < N; ++i ) { + if ( i % 2 == 0 ) { + result[0] ^= (T)i; + } + else { + result[1] ^= (T)i; + } + } + + return (T)(result[0]); +} + +template +bool XOrEqualAtomicViewTest(long input_length) +{ + + static_assert( std::is_integral::value, "XOrEqualAtomicViewTest: Must be integral type for test"); + + T res = XOrEqualAtomicView(input_length); + T resSerial = XOrEqualAtomicViewCheck(input_length); + + bool passed = true; + + if ( resSerial != res ) { + passed = false; + + std::cout << "Loop<" + << typeid(T).name() + << ">( test = XOrEqualAtomicViewTest" + << " FAILED : " + << resSerial << " != " << res + << std::endl ; + } + + return passed ; +} + + +// inc/dec? + + +//--------------------------------------------------- +//--------------atomic_test_control------------------ +//--------------------------------------------------- + +template +bool AtomicViewsTestIntegralType( const int length , int test ) +{ + static_assert( std::is_integral::value, "TestAtomicViews Error: Non-integral type passed into IntegralType tests"); + + switch (test) { + case 1: return PlusEqualAtomicViewTest( length ); + case 2: return MinusEqualAtomicViewTest( length ); + case 3: return RSEqualAtomicViewTest( length ); + case 4: return LSEqualAtomicViewTest( length ); + case 5: return ModEqualAtomicViewTest( length ); + case 6: return AndEqualAtomicViewTest( length ); + case 7: return OrEqualAtomicViewTest( length ); + case 8: return XOrEqualAtomicViewTest( length ); + } + return 0; +} + + +template +bool AtomicViewsTestNonIntegralType( const int length , int test ) +{ + switch (test) { + case 1: return PlusEqualAtomicViewTest( length ); + case 2: return MinusEqualAtomicViewTest( length ); + case 3: return TimesEqualAtomicViewTest( length ); + case 4: return DivEqualAtomicViewTest( length ); + } + return 0; +} + +} // namespace + diff --git a/lib/kokkos/core/unit_test/TestCXX11.hpp b/lib/kokkos/core/unit_test/TestCXX11.hpp index 2d6349776b..d6dde5e963 100644 --- a/lib/kokkos/core/unit_test/TestCXX11.hpp +++ b/lib/kokkos/core/unit_test/TestCXX11.hpp @@ -106,7 +106,7 @@ double AddTestFunctor() { } -#if defined (KOKKOS_HAVE_CXX11_DISPATCH_LAMBDA) +#if defined (KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) template double AddTestLambda() { @@ -228,7 +228,7 @@ double ReduceTestFunctor() { return result; } -#if defined (KOKKOS_HAVE_CXX11_DISPATCH_LAMBDA) +#if defined (KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) template double ReduceTestLambda() { @@ -306,7 +306,7 @@ double TestVariantFunctor(int test) { template bool Test(int test) { -#ifdef KOKKOS_HAVE_CXX11_DISPATCH_LAMBDA +#ifdef KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA double res_functor = TestVariantFunctor(test); double res_lambda = TestVariantLambda(test); diff --git a/lib/kokkos/core/unit_test/TestCompilerMacros.hpp b/lib/kokkos/core/unit_test/TestCompilerMacros.hpp index 71c2214489..5add656a4d 100644 --- a/lib/kokkos/core/unit_test/TestCompilerMacros.hpp +++ b/lib/kokkos/core/unit_test/TestCompilerMacros.hpp @@ -58,20 +58,20 @@ struct AddFunctor { KOKKOS_INLINE_FUNCTION void operator()(int i) const { -#ifdef KOKKOS_HAVE_PRAGMA_UNROLL +#ifdef KOKKOS_ENABLE_PRAGMA_UNROLL #pragma unroll #endif -#ifdef KOKKOS_HAVE_PRAGMA_IVDEP +#ifdef KOKKOS_ENABLE_PRAGMA_IVDEP #pragma ivdep #endif -#ifdef KOKKOS_HAVE_PRAGMA_VECTOR +#ifdef KOKKOS_ENABLE_PRAGMA_VECTOR #pragma vector always #endif -#ifdef KOKKOS_HAVE_PRAGMA_LOOPCOUNT +#ifdef KOKKOS_ENABLE_PRAGMA_LOOPCOUNT #pragma loop count(128) #endif -#ifndef KOKKOS_HAVE_DEBUG -#ifdef KOKKOS_HAVE_PRAGMA_SIMD +#ifndef KOKKOS_DEBUG +#ifdef KOKKOS_ENABLE_PRAGMA_SIMD #pragma simd #endif #endif diff --git a/lib/kokkos/core/unit_test/TestDefaultDeviceType.cpp b/lib/kokkos/core/unit_test/TestDefaultDeviceType.cpp index 87a534f11d..7e08f67e69 100644 --- a/lib/kokkos/core/unit_test/TestDefaultDeviceType.cpp +++ b/lib/kokkos/core/unit_test/TestDefaultDeviceType.cpp @@ -45,7 +45,7 @@ #include -#if !defined(KOKKOS_HAVE_CUDA) || defined(__CUDACC__) +#if !defined(KOKKOS_ENABLE_CUDA) || defined(__CUDACC__) //---------------------------------------------------------------------------- #include diff --git a/lib/kokkos/core/unit_test/TestDefaultDeviceTypeInit.hpp b/lib/kokkos/core/unit_test/TestDefaultDeviceTypeInit.hpp index caeb56c9e1..7778efde30 100644 --- a/lib/kokkos/core/unit_test/TestDefaultDeviceTypeInit.hpp +++ b/lib/kokkos/core/unit_test/TestDefaultDeviceTypeInit.hpp @@ -44,11 +44,11 @@ #include #include -#ifdef KOKKOS_HAVE_OPENMP +#ifdef KOKKOS_ENABLE_OPENMP #include #endif -#if !defined(KOKKOS_HAVE_CUDA) || defined(__CUDACC__) +#if !defined(KOKKOS_ENABLE_CUDA) || defined(__CUDACC__) //---------------------------------------------------------------------------- namespace Test { @@ -72,7 +72,7 @@ namespace Impl { if(do_threads) { int nthreads = 3; -#ifdef KOKKOS_HAVE_OPENMP +#ifdef KOKKOS_ENABLE_OPENMP if(omp_get_max_threads() < 3) nthreads = omp_get_max_threads(); #endif @@ -83,7 +83,7 @@ namespace Impl { * Kokkos::hwloc::get_available_numa_count(); } -#ifdef KOKKOS_HAVE_SERIAL +#ifdef KOKKOS_ENABLE_SERIAL if(std::is_same::value || std::is_same::value ) { nthreads = 1; @@ -97,7 +97,7 @@ namespace Impl { int numa = 1; if(Kokkos::hwloc::available()) numa = Kokkos::hwloc::get_available_numa_count(); -#ifdef KOKKOS_HAVE_SERIAL +#ifdef KOKKOS_ENABLE_SERIAL if(std::is_same::value || std::is_same::value ) { numa = 1; @@ -131,7 +131,7 @@ namespace Impl { if(do_threads) { int nthreads = 3; -#ifdef KOKKOS_HAVE_OPENMP +#ifdef KOKKOS_ENABLE_OPENMP if(omp_get_max_threads() < 3) nthreads = omp_get_max_threads(); #endif @@ -141,7 +141,7 @@ namespace Impl { nthreads = Kokkos::hwloc::get_available_threads_per_core() * Kokkos::hwloc::get_available_numa_count(); } -#ifdef KOKKOS_HAVE_SERIAL +#ifdef KOKKOS_ENABLE_SERIAL if(std::is_same::value || std::is_same::value ) { nthreads = 1; @@ -155,7 +155,7 @@ namespace Impl { int numa = 1; if(Kokkos::hwloc::available()) numa = Kokkos::hwloc::get_available_numa_count(); -#ifdef KOKKOS_HAVE_SERIAL +#ifdef KOKKOS_ENABLE_SERIAL if(std::is_same::value || std::is_same::value ) { numa = 1; @@ -183,7 +183,7 @@ namespace Impl { * Kokkos::hwloc::get_available_cores_per_numa() * Kokkos::hwloc::get_available_threads_per_core(); } else { - #ifdef KOKKOS_HAVE_OPENMP + #ifdef KOKKOS_ENABLE_OPENMP if(std::is_same::value) { expected_nthreads = omp_get_max_threads(); } else @@ -191,7 +191,7 @@ namespace Impl { expected_nthreads = 1; } - #ifdef KOKKOS_HAVE_SERIAL + #ifdef KOKKOS_ENABLE_SERIAL if(std::is_same::value || std::is_same::value ) expected_nthreads = 1; @@ -205,7 +205,7 @@ namespace Impl { } else { expected_numa = 1; } - #ifdef KOKKOS_HAVE_SERIAL + #ifdef KOKKOS_ENABLE_SERIAL if(std::is_same::value || std::is_same::value ) expected_numa = 1; @@ -213,7 +213,7 @@ namespace Impl { } ASSERT_EQ(Kokkos::HostSpace::execution_space::thread_pool_size(),expected_nthreads); -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA if(std::is_same::value) { int device; cudaGetDevice( &device ); diff --git a/lib/kokkos/core/unit_test/TestDefaultDeviceType_a.cpp b/lib/kokkos/core/unit_test/TestDefaultDeviceType_a.cpp index 185c1b7918..dd148a0624 100644 --- a/lib/kokkos/core/unit_test/TestDefaultDeviceType_a.cpp +++ b/lib/kokkos/core/unit_test/TestDefaultDeviceType_a.cpp @@ -45,7 +45,7 @@ #include -#if !defined(KOKKOS_HAVE_CUDA) || defined(__CUDACC__) +#if !defined(KOKKOS_ENABLE_CUDA) || defined(__CUDACC__) //---------------------------------------------------------------------------- #include diff --git a/lib/kokkos/core/unit_test/TestDefaultDeviceType_b.cpp b/lib/kokkos/core/unit_test/TestDefaultDeviceType_b.cpp index 9aa5401871..c8edfdd5c3 100644 --- a/lib/kokkos/core/unit_test/TestDefaultDeviceType_b.cpp +++ b/lib/kokkos/core/unit_test/TestDefaultDeviceType_b.cpp @@ -45,7 +45,7 @@ #include -#if !defined(KOKKOS_HAVE_CUDA) || defined(__CUDACC__) +#if !defined(KOKKOS_ENABLE_CUDA) || defined(__CUDACC__) //---------------------------------------------------------------------------- #include diff --git a/lib/kokkos/core/unit_test/TestDefaultDeviceType_c.cpp b/lib/kokkos/core/unit_test/TestDefaultDeviceType_c.cpp index 5856589092..405d49a9b8 100644 --- a/lib/kokkos/core/unit_test/TestDefaultDeviceType_c.cpp +++ b/lib/kokkos/core/unit_test/TestDefaultDeviceType_c.cpp @@ -45,7 +45,7 @@ #include -#if !defined(KOKKOS_HAVE_CUDA) || defined(__CUDACC__) +#if !defined(KOKKOS_ENABLE_CUDA) || defined(__CUDACC__) //---------------------------------------------------------------------------- #include diff --git a/lib/kokkos/core/unit_test/TestDefaultDeviceType_d.cpp b/lib/kokkos/core/unit_test/TestDefaultDeviceType_d.cpp index 2659b5c380..426cc4f06c 100644 --- a/lib/kokkos/core/unit_test/TestDefaultDeviceType_d.cpp +++ b/lib/kokkos/core/unit_test/TestDefaultDeviceType_d.cpp @@ -45,7 +45,7 @@ #include -#if !defined(KOKKOS_HAVE_CUDA) || defined(__CUDACC__) +#if !defined(KOKKOS_ENABLE_CUDA) || defined(__CUDACC__) //---------------------------------------------------------------------------- #include diff --git a/lib/kokkos/core/unit_test/TestMemoryPool.hpp b/lib/kokkos/core/unit_test/TestMemoryPool.hpp index f83f390ac6..868e64e9da 100644 --- a/lib/kokkos/core/unit_test/TestMemoryPool.hpp +++ b/lib/kokkos/core/unit_test/TestMemoryPool.hpp @@ -56,7 +56,7 @@ //#define TESTMEMORYPOOL_PRINT_STATUS #define STRIDE 1 -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA #define STRIDE_ALLOC 32 #else #define STRIDE_ALLOC 1 diff --git a/lib/kokkos/core/unit_test/TestReduce.hpp b/lib/kokkos/core/unit_test/TestReduce.hpp index a15fab17a6..645fc9e31b 100644 --- a/lib/kokkos/core/unit_test/TestReduce.hpp +++ b/lib/kokkos/core/unit_test/TestReduce.hpp @@ -470,7 +470,7 @@ public: // Computes y^T*A*x // (modified from kokkos-tutorials/GTC2016/Exercises/ThreeLevelPar ) -#if ( ! defined( KOKKOS_HAVE_CUDA ) ) || defined( KOKKOS_CUDA_USE_LAMBDA ) +#if ( ! defined( KOKKOS_ENABLE_CUDA ) ) || defined( KOKKOS_ENABLE_CUDA_LAMBDA ) template< typename ScalarType , class DeviceType > class TestTripleNestedReduce @@ -540,7 +540,7 @@ public: } }; -#else /* #if ( ! defined( KOKKOS_HAVE_CUDA ) ) || defined( KOKKOS_CUDA_USE_LAMBDA ) */ +#else /* #if ( ! defined( KOKKOS_ENABLE_CUDA ) ) || defined( KOKKOS_ENABLE_CUDA_LAMBDA ) */ template< typename ScalarType , class DeviceType > class TestTripleNestedReduce @@ -1034,7 +1034,7 @@ struct TestReduceCombinatoricalInstantiation { template static void AddFunctorLambdaRange(Args... args) { AddFunctor<0,Args...>(args...); - #ifdef KOKKOS_HAVE_CXX11_DISPATCH_LAMBDA + #ifdef KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA AddLambdaRange(typename std::conditional::value,void*,Kokkos::InvalidType>::type(), args...); #endif } @@ -1042,7 +1042,7 @@ struct TestReduceCombinatoricalInstantiation { template static void AddFunctorLambdaTeam(Args... args) { AddFunctor<1,Args...>(args...); - #ifdef KOKKOS_HAVE_CXX11_DISPATCH_LAMBDA + #ifdef KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA AddLambdaTeam(typename std::conditional::value,void*,Kokkos::InvalidType>::type(), args...); #endif } diff --git a/lib/kokkos/core/unit_test/TestScan.hpp b/lib/kokkos/core/unit_test/TestScan.hpp index 3eeea57043..1a9811a854 100644 --- a/lib/kokkos/core/unit_test/TestScan.hpp +++ b/lib/kokkos/core/unit_test/TestScan.hpp @@ -53,6 +53,8 @@ struct TestScan { typedef Device execution_space ; typedef long int value_type ; + Kokkos::View > errors; + KOKKOS_INLINE_FUNCTION void operator()( const int iwork , value_type & update , const bool final_pass ) const { @@ -69,7 +71,9 @@ struct TestScan { const value_type answer = n & 1 ? ( n * ( ( n + 1 ) / 2 ) ) : ( ( n / 2 ) * ( n + 1 ) ); if ( answer != update ) { - printf("TestScan(%d,%ld) != %ld\n",iwork,update,answer); + errors()++; + if(errors()<20) + printf("TestScan(%d,%ld) != %ld\n",iwork,update,answer); } } } @@ -83,11 +87,21 @@ struct TestScan { { update += input ; } TestScan( const WorkSpec & N ) - { parallel_scan( N , *this ); } + { + Kokkos::View errors_a("Errors"); + Kokkos::deep_copy(errors_a,0); + errors = errors_a; + parallel_scan( N , *this ); + } TestScan( const WorkSpec & Start , const WorkSpec & N ) { typedef Kokkos::RangePolicy exec_policy ; + + Kokkos::View errors_a("Errors"); + Kokkos::deep_copy(errors_a,0); + errors = errors_a; + parallel_scan( exec_policy( Start , N ) , *this ); } diff --git a/lib/kokkos/core/unit_test/TestSynchronic.cpp b/lib/kokkos/core/unit_test/TestSynchronic.cpp index f6a3f38e3f..dc1abbd8b3 100644 --- a/lib/kokkos/core/unit_test/TestSynchronic.cpp +++ b/lib/kokkos/core/unit_test/TestSynchronic.cpp @@ -29,7 +29,8 @@ OF THE POSSIBILITY OF SUCH DAMAGE. //#undef _WIN32_WINNT //#define _WIN32_WINNT 0x0602 -#if defined(__powerpc__) || defined(__ppc__) || defined(__PPC__) || defined(__APPLE__) || defined(__ARM_ARCH_8A) +#if defined(__powerpc__) || defined(__ppc__) || defined(__PPC__) || \ + defined(__APPLE__) || defined(__ARM_ARCH_8A) || defined(_CRAYC) // Skip for now diff --git a/lib/kokkos/core/unit_test/TestTeam.hpp b/lib/kokkos/core/unit_test/TestTeam.hpp index 23ad2be3f0..bcf4d3a173 100644 --- a/lib/kokkos/core/unit_test/TestTeam.hpp +++ b/lib/kokkos/core/unit_test/TestTeam.hpp @@ -499,7 +499,7 @@ struct TestSharedTeam { namespace Test { -#if defined (KOKKOS_HAVE_CXX11_DISPATCH_LAMBDA) +#if defined (KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) template< class MemorySpace, class ExecSpace, class ScheduleType > struct TestLambdaSharedTeam { @@ -519,7 +519,7 @@ struct TestLambdaSharedTeam { const int SHARED_COUNT = 1000; int team_size = 1; -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA if(std::is_same::value) team_size = 128; #endif @@ -841,7 +841,7 @@ struct ClassWithShmemSizeFunction { template< class ExecSpace, class ScheduleType > void test_team_mulit_level_scratch_test_lambda() { -#ifdef KOKKOS_HAVE_CXX11_DISPATCH_LAMBDA +#ifdef KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA Kokkos::View > errors; Kokkos::View d_errors("Errors"); errors = d_errors; @@ -885,7 +885,7 @@ struct TestMultiLevelScratchTeam { void run() { -#ifdef KOKKOS_HAVE_CXX11_DISPATCH_LAMBDA +#ifdef KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA Test::test_team_mulit_level_scratch_test_lambda(); #endif Test::ClassNoShmemSizeFunction c1; diff --git a/lib/kokkos/core/unit_test/TestTemplateMetaFunctions.hpp b/lib/kokkos/core/unit_test/TestTemplateMetaFunctions.hpp index 4f136bc64b..203c952679 100644 --- a/lib/kokkos/core/unit_test/TestTemplateMetaFunctions.hpp +++ b/lib/kokkos/core/unit_test/TestTemplateMetaFunctions.hpp @@ -1,13 +1,13 @@ /* //@HEADER // ************************************************************************ -// +// // Kokkos v. 2.0 // Copyright (2014) Sandia Corporation -// +// // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, // the U.S. Government retains certain rights in this software. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -36,7 +36,7 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) -// +// // ************************************************************************ //@HEADER */ @@ -168,7 +168,7 @@ template void TestTemplateMetaFunctions() { typedef typename Kokkos::View type; type a("A",100); -/* #ifdef KOKKOS_HAVE_CXX11 +/* int sum_plain_has_init_arg = Kokkos::Impl::FunctorHasInit, Scalar& >::value; ASSERT_EQ(sum_plain_has_init_arg,0); int sum_initjoinfinalvaluetype_has_init_arg = Kokkos::Impl::FunctorHasInit, Scalar >::value; @@ -181,20 +181,8 @@ void TestTemplateMetaFunctions() { //int sum_initjoinfinalvaluetypearray_has_init_arg = Kokkos::Impl::FunctorHasInit, Scalar[] >::value; //ASSERT_EQ(sum_initjoinfinalvaluetypearray_has_init_arg,1); - #else - - int sum_plain_has_init_arg = Kokkos::Impl::FunctorHasInit, Scalar& >::value; - ASSERT_EQ(sum_plain_has_init_arg,0); - int sum_initjoinfinalvaluetype_has_init_arg = Kokkos::Impl::FunctorHasInit, Scalar& >::value; - ASSERT_EQ(sum_initjoinfinalvaluetype_has_init_arg,1); - int sum_wronginitjoinfinalvaluetype_has_init_arg = Kokkos::Impl::FunctorHasInit, Scalar& >::value; - ASSERT_EQ(sum_wronginitjoinfinalvaluetype_has_init_arg,1); - - #endif - //printf("Values Init: %i %i %i\n",sum_plain_has_init_arg,sum_initjoinfinalvaluetype_has_init_arg,sum_wronginitjoinfinalvaluetype_has_init_arg); -#ifdef KOKKOS_HAVE_CXX11 int sum_plain_has_join_arg = Kokkos::Impl::FunctorHasJoin, Scalar >::value; ASSERT_EQ(sum_plain_has_join_arg,0); int sum_initjoinfinalvaluetype_has_join_arg = Kokkos::Impl::FunctorHasJoin, Scalar >::value; @@ -203,16 +191,7 @@ void TestTemplateMetaFunctions() { ASSERT_EQ(sum_initjoinfinalvaluetype_has_join_arg2,1); int sum_wronginitjoinfinalvaluetype_has_join_arg = Kokkos::Impl::FunctorHasJoin, Scalar >::value; ASSERT_EQ(sum_wronginitjoinfinalvaluetype_has_join_arg,0); -#else - int sum_plain_has_join_arg = Kokkos::Impl::FunctorHasJoin, Scalar& >::value; - ASSERT_EQ(sum_plain_has_join_arg,0); - int sum_initjoinfinalvaluetype_has_join_arg = Kokkos::Impl::FunctorHasJoin, Scalar& >::value; - ASSERT_EQ(sum_initjoinfinalvaluetype_has_join_arg,1); - int sum_initjoinfinalvaluetype_has_join_arg2 = Kokkos::Impl::FunctorHasJoin, Scalar& >::value; - ASSERT_EQ(sum_initjoinfinalvaluetype_has_join_arg2,1); - int sum_wronginitjoinfinalvaluetype_has_join_arg = Kokkos::Impl::FunctorHasJoin, Scalar& >::value; - ASSERT_EQ(sum_wronginitjoinfinalvaluetype_has_join_arg,1); -#endif*/ +*/ //printf("Values Join: %i %i %i\n",sum_plain_has_join_arg,sum_initjoinfinalvaluetype_has_join_arg,sum_wronginitjoinfinalvaluetype_has_join_arg); } diff --git a/lib/kokkos/core/unit_test/TestViewAPI.hpp b/lib/kokkos/core/unit_test/TestViewAPI.hpp index 88b474db1d..a96f31cc12 100644 --- a/lib/kokkos/core/unit_test/TestViewAPI.hpp +++ b/lib/kokkos/core/unit_test/TestViewAPI.hpp @@ -1205,7 +1205,7 @@ public: // For CUDA the constant random access View does not return // an lvalue reference due to retrieving through texture cache // therefore not allowed to query the underlying pointer. -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) if ( ! std::is_same< typename device::execution_space , Kokkos::Cuda >::value ) #endif { diff --git a/lib/kokkos/core/unit_test/TestViewMapping.hpp b/lib/kokkos/core/unit_test/TestViewMapping.hpp index 8989ee74c8..324f02e947 100644 --- a/lib/kokkos/core/unit_test/TestViewMapping.hpp +++ b/lib/kokkos/core/unit_test/TestViewMapping.hpp @@ -993,7 +993,7 @@ void test_view_mapping() ASSERT_EQ( a.use_count() , 1 ); ASSERT_EQ( b.use_count() , 0 ); -#if ! defined ( KOKKOS_CUDA_USE_LAMBDA ) +#if ! defined ( KOKKOS_ENABLE_CUDA_LAMBDA ) /* Cannot launch host lambda when CUDA lambda is enabled */ typedef typename Kokkos::Impl::HostMirror< Space >::Space::execution_space @@ -1011,7 +1011,7 @@ void test_view_mapping() ASSERT_EQ( a.use_count() , 2 ); ASSERT_EQ( x.use_count() , 2 ); }); -#endif /* #if ! defined ( KOKKOS_CUDA_USE_LAMBDA ) */ +#endif /* #if ! defined ( KOKKOS_ENABLE_CUDA_LAMBDA ) */ } } @@ -1370,6 +1370,16 @@ struct TestViewMappingAtomic { long error_count = -1 ; Kokkos::parallel_reduce( Kokkos::RangePolicy< ExecSpace , TagVerify >(0,N) , self , error_count ); ASSERT_EQ( 0 , error_count ); + typename TestViewMappingAtomic::T_atom::HostMirror x_host = Kokkos::create_mirror_view(self.x); + Kokkos::deep_copy(x_host,self.x); + error_count = -1; + Kokkos::parallel_reduce( Kokkos::RangePolicy< Kokkos::DefaultHostExecutionSpace, TagVerify>(0,N), + [=] ( const TagVerify & , const int i , long & tmp_error_count ) { + if ( i < 2 ) { if ( x_host(i) != int(i + N / 2) ) ++tmp_error_count ; } + else { if ( x_host(i) != int(i) ) ++tmp_error_count ; } + }, error_count); + ASSERT_EQ( 0 , error_count ); + Kokkos::deep_copy(self.x,x_host); } }; diff --git a/lib/kokkos/core/unit_test/TestViewSpaceAssign.hpp b/lib/kokkos/core/unit_test/TestViewSpaceAssign.hpp new file mode 100644 index 0000000000..09141e582c --- /dev/null +++ b/lib/kokkos/core/unit_test/TestViewSpaceAssign.hpp @@ -0,0 +1,82 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// 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 Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "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 SANDIA CORPORATION OR THE +// 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. +// +// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include + +#include +#include +#include +#include + +/*--------------------------------------------------------------------------*/ + +namespace Test { + +template< typename SpaceDst , typename SpaceSrc > +void view_space_assign() +{ + Kokkos::View a = + Kokkos::View("a",1); + + Kokkos::View b = + Kokkos::View("b",1); + + Kokkos::View c = + Kokkos::View("c",1); + + Kokkos::View d = + Kokkos::View("d",1); + + Kokkos::View e = + Kokkos::View("e",1); + + // Rank-one layout can assign: + Kokkos::View f = + Kokkos::View("f",1); +} + + +} // namespace Test + +/*--------------------------------------------------------------------------*/ + diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda.hpp b/lib/kokkos/core/unit_test/cuda/TestCuda.hpp index a49d9ef41e..36b9b0688b 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda.hpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda.hpp @@ -40,8 +40,8 @@ // ************************************************************************ //@HEADER */ -#ifndef KOKKOS_TEST_CUDAHPP -#define KOKKOS_TEST_CUDAHPP +#ifndef KOKKOS_TEST_CUDA_HPP +#define KOKKOS_TEST_CUDA_HPP #include #include @@ -59,8 +59,12 @@ #include #include #include +#include #include #include + +#include + #include #include #include diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_Atomics.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_Atomics.cpp index 113b72c70f..ff379dc805 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_Atomics.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_Atomics.cpp @@ -161,8 +161,43 @@ TEST_F( cuda , atomic_operations ) ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestNonIntegralType(start, end-i, 3 ) ) ); ASSERT_TRUE( ( TestAtomicOperations::AtomicOperationsTestNonIntegralType(start, end-i, 4 ) ) ); } - } +TEST_F( cuda , atomic_views_integral ) +{ + const long length = 1000000; + { + //Integral Types + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType(length, 1 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType(length, 2 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType(length, 3 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType(length, 4 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType(length, 5 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType(length, 6 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType(length, 7 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType(length, 8 ) ) ); + } +} + +TEST_F( cuda , atomic_views_nonintegral ) +{ + const long length = 1000000; + { + //Non-Integral Types + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestNonIntegralType(length, 1 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestNonIntegralType(length, 2 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestNonIntegralType(length, 3 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestNonIntegralType(length, 4 ) ) ); + + } +} + + +TEST_F( cuda , atomic_view_api ) +{ + TestAtomicViews::TestAtomicViewAPI(); +} + + } // namespace test diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_Other.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_Other.cpp index 80de6618e6..aeaa2a0e81 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_Other.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_Other.cpp @@ -134,7 +134,7 @@ TEST_F( cuda , task_team ) //---------------------------------------------------------------------------- -#if defined( KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_CUDA ) +#if defined( KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_CUDA ) TEST_F( cuda , cxx11 ) { if ( std::is_same< Kokkos::DefaultExecutionSpace , Kokkos::Cuda >::value ) { @@ -171,7 +171,7 @@ TEST_F( cuda, tile_layout ) TestTile::test< Kokkos::Cuda , 8 , 8 >( 9 , 11 ); } -#if defined (KOKKOS_HAVE_CXX11_DISPATCH_LAMBDA) +#if defined (KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) #if defined (KOKKOS_COMPILER_CLANG) TEST_F( cuda , dispatch ) { diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_Team.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_Team.cpp index 800a458af9..13834d09ad 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_Team.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_Team.cpp @@ -73,7 +73,7 @@ TEST_F( cuda , team_shared_request) { // TestScratchTeam< Kokkos::Cuda , Kokkos::Schedule >(); //} -#if defined(KOKKOS_HAVE_CXX11_DISPATCH_LAMBDA) +#if defined(KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) TEST_F( cuda , team_lambda_shared_request) { TestLambdaSharedTeam< Kokkos::CudaSpace, Kokkos::Cuda, Kokkos::Schedule >(); TestLambdaSharedTeam< Kokkos::CudaUVMSpace, Kokkos::Cuda, Kokkos::Schedule >(); diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_ViewAPI_s.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_ViewAPI_s.cpp new file mode 100644 index 0000000000..9bc09ba893 --- /dev/null +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_ViewAPI_s.cpp @@ -0,0 +1,53 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 2.0 +// Copyright (2014) Sandia Corporation +// +// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, +// the U.S. Government retains certain rights in this software. +// +// 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 Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "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 SANDIA CORPORATION OR THE +// 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. +// +// Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ +#include + +namespace Test { + +TEST_F( cuda , view_space_assign ) { + view_space_assign< Kokkos::HostSpace , Kokkos::CudaHostPinnedSpace >(); + view_space_assign< Kokkos::CudaSpace , Kokkos::CudaUVMSpace >(); +} + +} // namespace test + diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP.hpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP.hpp index 01324a1eeb..28ae5b41b0 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP.hpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP.hpp @@ -40,8 +40,8 @@ // ************************************************************************ //@HEADER */ -#ifndef KOKKOS_TEST_OPENMPHPP -#define KOKKOS_TEST_OPENMPHPP +#ifndef KOKKOS_TEST_OPENMP_HPP +#define KOKKOS_TEST_OPENMP_HPP #include #include @@ -65,6 +65,7 @@ #include #include #include +#include #include #include #include diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_Atomics.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_Atomics.cpp index 91722c8490..ed6c9f8d16 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_Atomics.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_Atomics.cpp @@ -164,5 +164,41 @@ TEST_F( openmp , atomic_operations ) } + +TEST_F( openmp , atomic_views_integral ) +{ + const long length = 1000000; + { + //Integral Types + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType(length, 1 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType(length, 2 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType(length, 3 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType(length, 4 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType(length, 5 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType(length, 6 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType(length, 7 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType(length, 8 ) ) ); + + } +} + +TEST_F( openmp , atomic_views_nonintegral ) +{ + const long length = 1000000; + { + //Non-Integral Types + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestNonIntegralType(length, 1 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestNonIntegralType(length, 2 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestNonIntegralType(length, 3 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestNonIntegralType(length, 4 ) ) ); + + } +} + +TEST_F( openmp , atomic_view_api ) +{ + TestAtomicViews::TestAtomicViewAPI(); +} + } // namespace test diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_Other.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_Other.cpp index c691036351..126d730f0f 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_Other.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_Other.cpp @@ -136,7 +136,7 @@ TEST_F( openmp , task_team ) //---------------------------------------------------------------------------- -#if defined( KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_OPENMP ) +#if defined( KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_OPENMP ) TEST_F( openmp , cxx11 ) { if ( std::is_same< Kokkos::DefaultExecutionSpace , Kokkos::OpenMP >::value ) { diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_Team.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_Team.cpp index 1539e30e19..38cf0a0f40 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_Team.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_Team.cpp @@ -72,7 +72,7 @@ TEST_F( openmp, team_scratch_request) { TestScratchTeam< Kokkos::OpenMP , Kokkos::Schedule >(); } -#if defined(KOKKOS_HAVE_CXX11_DISPATCH_LAMBDA) +#if defined(KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) TEST_F( openmp , team_lambda_shared_request) { TestLambdaSharedTeam< Kokkos::HostSpace, Kokkos::OpenMP , Kokkos::Schedule >(); TestLambdaSharedTeam< Kokkos::HostSpace, Kokkos::OpenMP , Kokkos::Schedule >(); diff --git a/lib/kokkos/core/unit_test/serial/TestSerial.hpp b/lib/kokkos/core/unit_test/serial/TestSerial.hpp index a966257fca..c0ffa6afb1 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial.hpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial.hpp @@ -40,8 +40,8 @@ // ************************************************************************ //@HEADER */ -#ifndef KOKKOS_TEST_SERIALHPP -#define KOKKOS_TEST_SERIALHPP +#ifndef KOKKOS_TEST_SERIAL_HPP +#define KOKKOS_TEST_SERIAL_HPP #include #include @@ -65,6 +65,9 @@ #include #include #include + +#include + #include #include #include diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_Atomics.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_Atomics.cpp index 6eec0683ae..729a76556d 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_Atomics.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_Atomics.cpp @@ -164,5 +164,41 @@ TEST_F( serial , atomic_operations ) } + +TEST_F( serial , atomic_views_integral ) +{ + const long length = 1000000; + { + //Integral Types + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType(length, 1 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType(length, 2 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType(length, 3 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType(length, 4 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType(length, 5 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType(length, 6 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType(length, 7 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType(length, 8 ) ) ); + + } +} + +TEST_F( serial , atomic_views_nonintegral ) +{ + const long length = 1000000; + { + //Non-Integral Types + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestNonIntegralType(length, 1 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestNonIntegralType(length, 2 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestNonIntegralType(length, 3 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestNonIntegralType(length, 4 ) ) ); + + } +} + +TEST_F( serial , atomic_view_api ) +{ + TestAtomicViews::TestAtomicViewAPI(); +} + } // namespace test diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_Other.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_Other.cpp index b1c32cfaf5..43fc4c3587 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_Other.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_Other.cpp @@ -121,7 +121,7 @@ TEST_F( serial , task_team ) //---------------------------------------------------------------------------- -#if defined( KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_SERIAL ) +#if defined( KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_SERIAL ) TEST_F( serial , cxx11 ) { if ( std::is_same< Kokkos::DefaultExecutionSpace , Kokkos::Serial >::value ) { diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_Team.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_Team.cpp index 3318e5f245..df400b4cb5 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_Team.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_Team.cpp @@ -67,7 +67,7 @@ TEST_F( serial, team_scratch_request) { TestScratchTeam< Kokkos::Serial , Kokkos::Schedule >(); } -#if defined(KOKKOS_HAVE_CXX11_DISPATCH_LAMBDA) +#if defined(KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) TEST_F( serial , team_lambda_shared_request) { TestLambdaSharedTeam< Kokkos::HostSpace, Kokkos::Serial , Kokkos::Schedule >(); TestLambdaSharedTeam< Kokkos::HostSpace, Kokkos::Serial , Kokkos::Schedule >(); diff --git a/lib/kokkos/core/unit_test/threads/TestThreads.hpp b/lib/kokkos/core/unit_test/threads/TestThreads.hpp index bb9f36581a..4f611cf99c 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads.hpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads.hpp @@ -40,8 +40,8 @@ // ************************************************************************ //@HEADER */ -#ifndef KOKKOS_TEST_THREADSHPP -#define KOKKOS_TEST_THREADSHPP +#ifndef KOKKOS_TEST_THREADS_HPP +#define KOKKOS_TEST_THREADS_HPP #include #include @@ -65,6 +65,7 @@ #include #include #include +#include #include #include #include diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_Atomics.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_Atomics.cpp index 8ce32fc338..6e24c4973e 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_Atomics.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_Atomics.cpp @@ -164,5 +164,41 @@ TEST_F( threads , atomic_operations ) } + +TEST_F( threads , atomic_views_integral ) +{ + const long length = 1000000; + { + //Integral Types + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType(length, 1 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType(length, 2 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType(length, 3 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType(length, 4 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType(length, 5 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType(length, 6 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType(length, 7 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestIntegralType(length, 8 ) ) ); + + } +} + +TEST_F( threads , atomic_views_nonintegral ) +{ + const long length = 1000000; + { + //Non-Integral Types + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestNonIntegralType(length, 1 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestNonIntegralType(length, 2 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestNonIntegralType(length, 3 ) ) ); + ASSERT_TRUE( ( TestAtomicViews::AtomicViewsTestNonIntegralType(length, 4 ) ) ); + + } +} + +TEST_F( threads , atomic_view_api ) +{ + TestAtomicViews::TestAtomicViewAPI(); +} + } // namespace test diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_Other.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_Other.cpp index d9f17cc88a..ac0356eeb4 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_Other.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_Other.cpp @@ -136,7 +136,7 @@ TEST_F( threads , task_team ) //---------------------------------------------------------------------------- -#if defined( KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_THREADS ) +#if defined( KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_THREADS ) TEST_F( threads , cxx11 ) { if ( std::is_same< Kokkos::DefaultExecutionSpace , Kokkos::Threads >::value ) { diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_Team.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_Team.cpp index 03f31b78c0..4690be4d3a 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_Team.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_Team.cpp @@ -72,7 +72,7 @@ TEST_F( threads, team_scratch_request) { TestScratchTeam< Kokkos::Threads , Kokkos::Schedule >(); } -#if defined(KOKKOS_HAVE_CXX11_DISPATCH_LAMBDA) +#if defined(KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) TEST_F( threads , team_lambda_shared_request) { TestLambdaSharedTeam< Kokkos::HostSpace, Kokkos::Threads , Kokkos::Schedule >(); TestLambdaSharedTeam< Kokkos::HostSpace, Kokkos::Threads , Kokkos::Schedule >(); diff --git a/lib/kokkos/example/cmake/Dependencies.cmake b/lib/kokkos/example/cmake/Dependencies.cmake index 0d86e78712..ca50a45c11 100644 --- a/lib/kokkos/example/cmake/Dependencies.cmake +++ b/lib/kokkos/example/cmake/Dependencies.cmake @@ -1,4 +1,4 @@ TRIBITS_PACKAGE_DEFINE_DEPENDENCIES( - LIB_REQUIRED_DEP_PACKAGES KokkosCore KokkosContainers KokkosAlgorithms - TEST_OPTIONAL_DEP_TPLS CUSPARSE MKL + LIB_REQUIRED_PACKAGES KokkosCore KokkosContainers KokkosAlgorithms + TEST_OPTIONAL_TPLS CUSPARSE MKL ) diff --git a/lib/kokkos/example/common/VectorImport.hpp b/lib/kokkos/example/common/VectorImport.hpp index 48b28f8c2c..4623272923 100644 --- a/lib/kokkos/example/common/VectorImport.hpp +++ b/lib/kokkos/example/common/VectorImport.hpp @@ -63,7 +63,7 @@ struct VectorImport ; } // namespace Example } // namespace Kokkos -#if ! defined( KOKKOS_HAVE_MPI ) +#if ! defined( KOKKOS_ENABLE_MPI ) //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- @@ -100,7 +100,7 @@ struct VectorImport { //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- -#else /* defined( KOKKOS_HAVE_MPI ) */ +#else /* defined( KOKKOS_ENABLE_MPI ) */ namespace Kokkos { namespace Example { diff --git a/lib/kokkos/example/common/WrapMPI.hpp b/lib/kokkos/example/common/WrapMPI.hpp index c75e4bc5c7..f6c5b7ff3e 100644 --- a/lib/kokkos/example/common/WrapMPI.hpp +++ b/lib/kokkos/example/common/WrapMPI.hpp @@ -47,7 +47,7 @@ #include #include -#if defined( KOKKOS_HAVE_MPI ) +#if defined( KOKKOS_ENABLE_MPI ) #include @@ -73,10 +73,10 @@ double all_reduce_max( double value , MPI_Comm comm ) } // namespace Example } // namespace Kokkos -#elif ! defined( KOKKOS_HAVE_MPI ) +#elif ! defined( KOKKOS_ENABLE_MPI ) /* Wrap the the MPI_Comm type and heavily used MPI functions - * to reduce the number of '#if defined( KOKKOS_HAVE_MPI )' + * to reduce the number of '#if defined( KOKKOS_ENABLE_MPI )' * blocks which have to be sprinkled throughout the examples. */ @@ -98,6 +98,6 @@ double all_reduce_max( double value , MPI_Comm ) { return value ; } } // namespace Example } // namespace Kokkos -#endif /* ! defined( KOKKOS_HAVE_MPI ) */ +#endif /* ! defined( KOKKOS_ENABLE_MPI ) */ #endif /* #ifndef KOKKOS_EXAMPLE_WRAP_MPI */ diff --git a/lib/kokkos/example/feint/feint_cuda.cpp b/lib/kokkos/example/feint/feint_cuda.cpp index 1370822feb..06f9c8b913 100644 --- a/lib/kokkos/example/feint/feint_cuda.cpp +++ b/lib/kokkos/example/feint/feint_cuda.cpp @@ -43,7 +43,7 @@ #include -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) #include diff --git a/lib/kokkos/example/feint/feint_openmp.cpp b/lib/kokkos/example/feint/feint_openmp.cpp index cf2fdca5ba..c80725f4a8 100644 --- a/lib/kokkos/example/feint/feint_openmp.cpp +++ b/lib/kokkos/example/feint/feint_openmp.cpp @@ -43,7 +43,7 @@ #include -#ifdef KOKKOS_HAVE_OPENMP +#ifdef KOKKOS_ENABLE_OPENMP #include diff --git a/lib/kokkos/example/feint/feint_threads.cpp b/lib/kokkos/example/feint/feint_threads.cpp index 5dcf5654f1..7f33401441 100644 --- a/lib/kokkos/example/feint/feint_threads.cpp +++ b/lib/kokkos/example/feint/feint_threads.cpp @@ -43,7 +43,7 @@ #include -#if defined( KOKKOS_HAVE_PTHREAD ) +#if defined( KOKKOS_ENABLE_PTHREAD ) #include @@ -63,4 +63,4 @@ template void feint< Kokkos::Threads ,true>( } /* namespace Example */ } /* namespace Kokkos */ -#endif /* #if defined( KOKKOS_HAVE_PTHREAD ) */ +#endif /* #if defined( KOKKOS_ENABLE_PTHREAD ) */ diff --git a/lib/kokkos/example/feint/main.cpp b/lib/kokkos/example/feint/main.cpp index c45d483e76..bfafc81fbb 100644 --- a/lib/kokkos/example/feint/main.cpp +++ b/lib/kokkos/example/feint/main.cpp @@ -48,7 +48,7 @@ int main() { -#if defined( KOKKOS_HAVE_PTHREAD ) +#if defined( KOKKOS_ENABLE_PTHREAD ) { // Use 4 cores per NUMA region, unless fewer available @@ -67,7 +67,7 @@ int main() } #endif -#if defined( KOKKOS_HAVE_OPENMP ) +#if defined( KOKKOS_ENABLE_OPENMP ) { // Use 4 cores per NUMA region, unless fewer available @@ -86,7 +86,7 @@ int main() } #endif -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) { // Initialize Host mirror device Kokkos::HostSpace::execution_space::initialize(1); diff --git a/lib/kokkos/example/fenl/fenl.cpp b/lib/kokkos/example/fenl/fenl.cpp index a5cba608f4..4d50af66e2 100644 --- a/lib/kokkos/example/fenl/fenl.cpp +++ b/lib/kokkos/example/fenl/fenl.cpp @@ -46,7 +46,7 @@ namespace Kokkos { namespace Example { namespace FENL { -#if defined( KOKKOS_HAVE_PTHREAD ) +#if defined( KOKKOS_ENABLE_PTHREAD ) template Perf fenl< Kokkos::Threads , Kokkos::Example::BoxElemPart::ElemLinear >( @@ -68,7 +68,7 @@ Perf fenl< Kokkos::Threads , Kokkos::Example::BoxElemPart::ElemQuadratic >( #endif -#if defined (KOKKOS_HAVE_OPENMP) +#if defined (KOKKOS_ENABLE_OPENMP) template Perf fenl< Kokkos::OpenMP , Kokkos::Example::BoxElemPart::ElemLinear >( @@ -89,7 +89,7 @@ Perf fenl< Kokkos::OpenMP , Kokkos::Example::BoxElemPart::ElemQuadratic >( #endif -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) template Perf fenl< Kokkos::Cuda , Kokkos::Example::BoxElemPart::ElemLinear >( diff --git a/lib/kokkos/example/fenl/fenl_impl.hpp b/lib/kokkos/example/fenl/fenl_impl.hpp index 15583c10e9..38dea539c2 100644 --- a/lib/kokkos/example/fenl/fenl_impl.hpp +++ b/lib/kokkos/example/fenl/fenl_impl.hpp @@ -71,7 +71,7 @@ inline double maximum( MPI_Comm comm , double local ) { double global = local ; -#if defined( KOKKOS_HAVE_MPI ) +#if defined( KOKKOS_ENABLE_MPI ) MPI_Allreduce( & local , & global , 1 , MPI_DOUBLE , MPI_MAX , comm ); #endif return global ; @@ -214,7 +214,7 @@ Perf fenl( { int global_error = ! fixture.ok(); -#if defined( KOKKOS_HAVE_MPI ) +#if defined( KOKKOS_ENABLE_MPI ) int local_error = global_error ; global_error = 0 ; MPI_Allreduce( & local_error , & global_error , 1 , MPI_INT , MPI_SUM , comm ); diff --git a/lib/kokkos/example/fenl/main.cpp b/lib/kokkos/example/fenl/main.cpp index 06005d97cb..d79c6d8992 100644 --- a/lib/kokkos/example/fenl/main.cpp +++ b/lib/kokkos/example/fenl/main.cpp @@ -155,7 +155,7 @@ void run( MPI_Comm comm , const int cmd[] ) { int comm_rank = 0 ; -#if defined( KOKKOS_HAVE_MPI ) +#if defined( KOKKOS_ENABLE_MPI ) MPI_Comm_rank( comm , & comm_rank ); #else comm = 0 ; @@ -254,7 +254,7 @@ int main( int argc , char ** argv ) { int comm_rank = 0 ; -#if defined( KOKKOS_HAVE_MPI ) +#if defined( KOKKOS_ENABLE_MPI ) MPI_Init( & argc , & argv ); MPI_Comm comm = MPI_COMM_WORLD ; MPI_Comm_rank( comm , & comm_rank ); @@ -326,7 +326,7 @@ int main( int argc , char ** argv ) if ( cmdline[ CMD_ECHO ] && 0 == comm_rank ) { print_cmdline( std::cout , cmdline ); } } -#if defined( KOKKOS_HAVE_MPI ) +#if defined( KOKKOS_ENABLE_MPI ) MPI_Bcast( cmdline , CMD_COUNT , MPI_INT , 0 , comm ); #endif @@ -356,7 +356,7 @@ int main( int argc , char ** argv ) cmdline[ CMD_USE_FIXTURE_Z ] = 2 ; } -#if defined( KOKKOS_HAVE_PTHREAD ) +#if defined( KOKKOS_ENABLE_PTHREAD ) if ( cmdline[ CMD_USE_THREADS ] ) { @@ -376,7 +376,7 @@ int main( int argc , char ** argv ) #endif -#if defined( KOKKOS_HAVE_OPENMP ) +#if defined( KOKKOS_ENABLE_OPENMP ) if ( cmdline[ CMD_USE_OPENMP ] ) { @@ -396,7 +396,7 @@ int main( int argc , char ** argv ) #endif -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) if ( cmdline[ CMD_USE_CUDA ] ) { // Use the last device: @@ -413,7 +413,7 @@ int main( int argc , char ** argv ) } -#if defined( KOKKOS_HAVE_MPI ) +#if defined( KOKKOS_ENABLE_MPI ) MPI_Finalize(); #endif diff --git a/lib/kokkos/example/fixture/Main.cpp b/lib/kokkos/example/fixture/Main.cpp index d80828ca52..9b2275ad27 100644 --- a/lib/kokkos/example/fixture/Main.cpp +++ b/lib/kokkos/example/fixture/Main.cpp @@ -290,7 +290,7 @@ int main() Kokkos::HostSpace::execution_space::finalize(); } -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) { std::cout << "test_fixture< Cuda >" << std::endl ; Kokkos::HostSpace::execution_space::initialize(); diff --git a/lib/kokkos/example/fixture/TestFixture.cpp b/lib/kokkos/example/fixture/TestFixture.cpp index 9cf2f07322..924cc39ce4 100644 --- a/lib/kokkos/example/fixture/TestFixture.cpp +++ b/lib/kokkos/example/fixture/TestFixture.cpp @@ -49,7 +49,7 @@ namespace Example { template void test_fixture< Kokkos::HostSpace::execution_space >(); -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) template void test_fixture(); #endif diff --git a/lib/kokkos/example/global_2_local_ids/G2L_Main.cpp b/lib/kokkos/example/global_2_local_ids/G2L_Main.cpp index 171ed4b5f6..8beac8880f 100644 --- a/lib/kokkos/example/global_2_local_ids/G2L_Main.cpp +++ b/lib/kokkos/example/global_2_local_ids/G2L_Main.cpp @@ -49,17 +49,17 @@ namespace G2L { size_t run_serial(unsigned num_ids, unsigned num_find_iterations) { -#ifdef KOKKOS_HAVE_SERIAL +#ifdef KOKKOS_ENABLE_SERIAL std::cout << "Serial" << std::endl; return run_test(num_ids,num_find_iterations); #else return 0; -#endif // KOKKOS_HAVE_SERIAL +#endif // KOKKOS_ENABLE_SERIAL } size_t run_threads(unsigned num_ids, unsigned num_find_iterations) { -#ifdef KOKKOS_HAVE_PTHREAD +#ifdef KOKKOS_ENABLE_PTHREAD std::cout << "Threads" << std::endl; return run_test(num_ids,num_find_iterations); #else @@ -69,7 +69,7 @@ size_t run_threads(unsigned num_ids, unsigned num_find_iterations) size_t run_openmp(unsigned num_ids, unsigned num_find_iterations) { -#ifdef KOKKOS_HAVE_OPENMP +#ifdef KOKKOS_ENABLE_OPENMP std::cout << "OpenMP" << std::endl; return run_test(num_ids,num_find_iterations); #else @@ -79,7 +79,7 @@ size_t run_openmp(unsigned num_ids, unsigned num_find_iterations) size_t run_cuda(unsigned num_ids, unsigned num_find_iterations) { -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA std::cout << "Cuda" << std::endl; return run_test(num_ids,num_find_iterations); #else @@ -123,7 +123,7 @@ int main(int argc, char *argv[]) num_errors += G2L::run_serial(num_ids,num_find_iterations); -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA Kokkos::HostSpace::execution_space::initialize(threads_count); Kokkos::Cuda::initialize( Kokkos::Cuda::SelectDevice(0) ); num_errors += G2L::run_cuda(num_ids,num_find_iterations); @@ -131,13 +131,13 @@ int main(int argc, char *argv[]) Kokkos::HostSpace::execution_space::finalize(); #endif -#ifdef KOKKOS_HAVE_PTHREAD +#ifdef KOKKOS_ENABLE_PTHREAD Kokkos::Threads::initialize( threads_count ); num_errors += G2L::run_threads(num_ids,num_find_iterations); Kokkos::Threads::finalize(); #endif -#ifdef KOKKOS_HAVE_OPENMP +#ifdef KOKKOS_ENABLE_OPENMP Kokkos::OpenMP::initialize( threads_count ); num_errors += G2L::run_openmp(num_ids,num_find_iterations); Kokkos::OpenMP::finalize(); diff --git a/lib/kokkos/example/grow_array/grow_array.hpp b/lib/kokkos/example/grow_array/grow_array.hpp index 9daef1a4b0..d8555bc4c6 100644 --- a/lib/kokkos/example/grow_array/grow_array.hpp +++ b/lib/kokkos/example/grow_array/grow_array.hpp @@ -50,7 +50,7 @@ #include -#if defined(KOKKOS_HAVE_CUDA) +#if defined(KOKKOS_ENABLE_CUDA) #include #include #endif @@ -69,7 +69,7 @@ struct SortView { } }; -#if defined(KOKKOS_HAVE_CUDA) +#if defined(KOKKOS_ENABLE_CUDA) template<> struct SortView< Kokkos::Cuda > { template< typename ValueType > diff --git a/lib/kokkos/example/grow_array/main.cpp b/lib/kokkos/example/grow_array/main.cpp index 4693aa3af4..25c368213f 100644 --- a/lib/kokkos/example/grow_array/main.cpp +++ b/lib/kokkos/example/grow_array/main.cpp @@ -66,7 +66,7 @@ int main( int argc , char ** argv ) num_threads = use_numa * use_core * Kokkos::hwloc::get_available_threads_per_core(); } -#if defined( KOKKOS_HAVE_SERIAL ) +#if defined( KOKKOS_ENABLE_SERIAL ) { std::cout << "Kokkos::Serial" << std::endl ; // The Serial device accepts these arguments, though it may ignore them. @@ -74,9 +74,9 @@ int main( int argc , char ** argv ) Example::grow_array< Kokkos::Serial >( length_array , span_values ); Kokkos::Serial::finalize (); } -#endif // defined( KOKKOS_HAVE_SERIAL ) +#endif // defined( KOKKOS_ENABLE_SERIAL ) -#if defined( KOKKOS_HAVE_PTHREAD ) +#if defined( KOKKOS_ENABLE_PTHREAD ) { std::cout << "Kokkos::Threads" << std::endl ; Kokkos::Threads::initialize( num_threads , use_numa , use_core ); @@ -85,7 +85,7 @@ int main( int argc , char ** argv ) } #endif -#if defined( KOKKOS_HAVE_OPENMP ) +#if defined( KOKKOS_ENABLE_OPENMP ) { std::cout << "Kokkos::OpenMP" << std::endl ; Kokkos::OpenMP::initialize( num_threads , use_numa , use_core ); @@ -94,7 +94,7 @@ int main( int argc , char ** argv ) } #endif -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) { std::cout << "Kokkos::Cuda" << std::endl ; Kokkos::HostSpace::execution_space::initialize(1); diff --git a/lib/kokkos/example/md_skeleton/force.cpp b/lib/kokkos/example/md_skeleton/force.cpp index a31944f859..4115bafad4 100644 --- a/lib/kokkos/example/md_skeleton/force.cpp +++ b/lib/kokkos/example/md_skeleton/force.cpp @@ -1,13 +1,13 @@ /* //@HEADER // ************************************************************************ -// +// // Kokkos v. 2.0 // Copyright (2014) Sandia Corporation -// +// // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, // the U.S. Government retains certain rights in this software. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -36,19 +36,11 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) -// +// // ************************************************************************ //@HEADER */ -/* Define values which set the max number of registers used for the Force Kernel - * Its 32 * 2048 / (KOKKOS_CUDA_MAX_THREADS * KOKKOS_CUDA_MIN_BLOCKS) - * Have to be set before including Kokkos header files. - */ - -#define KOKKOS_CUDA_MAX_THREADS 512 -#define KOKKOS_CUDA_MIN_BLOCKS 3 - #include #include diff --git a/lib/kokkos/example/md_skeleton/main.cpp b/lib/kokkos/example/md_skeleton/main.cpp index 58cf76cab0..2563863cbd 100644 --- a/lib/kokkos/example/md_skeleton/main.cpp +++ b/lib/kokkos/example/md_skeleton/main.cpp @@ -154,13 +154,13 @@ int main(int argc, char** argv) { printf("-> Init Device\n"); -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) Kokkos::HostSpace::execution_space::initialize(teams*num_threads); Kokkos::Cuda::SelectDevice select_device(device); Kokkos::Cuda::initialize(select_device); -#elif defined( KOKKOS_HAVE_OPENMP ) +#elif defined( KOKKOS_ENABLE_OPENMP ) Kokkos::OpenMP::initialize(teams*num_threads); -#elif defined( KOKKOS_HAVE_PTHREAD ) +#elif defined( KOKKOS_ENABLE_PTHREAD ) Kokkos::Threads::initialize(teams*num_threads); #endif diff --git a/lib/kokkos/example/multi_fem/Explicit.hpp b/lib/kokkos/example/multi_fem/Explicit.hpp index cef1a37a1a..9566aeff02 100644 --- a/lib/kokkos/example/multi_fem/Explicit.hpp +++ b/lib/kokkos/example/multi_fem/Explicit.hpp @@ -190,7 +190,7 @@ PerformanceData run( const typename FixtureType::FEMeshType & mesh , perf_data.number_of_steps = total_num_steps ; -#if defined( KOKKOS_HAVE_MPI ) +#if defined( KOKKOS_ENABLE_MPI ) typedef typename fields_type::geom_state_array_type::value_type comm_value_type ; @@ -208,7 +208,7 @@ PerformanceData run( const typename FixtureType::FEMeshType & mesh , wall_clock.reset(); //------------------------------------------------------------------------ -#if defined( KOKKOS_HAVE_MPI ) +#if defined( KOKKOS_ENABLE_MPI ) { // Communicate "send" nodes' displacement and velocity next_state // to the ghosted nodes. diff --git a/lib/kokkos/example/multi_fem/LinAlgBLAS.hpp b/lib/kokkos/example/multi_fem/LinAlgBLAS.hpp index 2478fa9aed..73aaaf5d95 100644 --- a/lib/kokkos/example/multi_fem/LinAlgBLAS.hpp +++ b/lib/kokkos/example/multi_fem/LinAlgBLAS.hpp @@ -99,7 +99,7 @@ namespace Kokkos { //---------------------------------------------------------------------------- -#if defined( KOKKOS_HAVE_MPI ) +#if defined( KOKKOS_ENABLE_MPI ) template< typename ScalarX /* Allow mix of const and non-const */ , typename ScalarY /* Allow mix of const and non-const */ , @@ -147,7 +147,7 @@ double dot( const size_t n , //---------------------------------------------------------------------------- -#if defined( KOKKOS_HAVE_MPI ) +#if defined( KOKKOS_ENABLE_MPI ) template< typename ScalarX /* Allow mix of const and non-const */ , class L , class D , diff --git a/lib/kokkos/example/multi_fem/Nonlinear.hpp b/lib/kokkos/example/multi_fem/Nonlinear.hpp index 1d243395c2..ad25131fa7 100644 --- a/lib/kokkos/example/multi_fem/Nonlinear.hpp +++ b/lib/kokkos/example/multi_fem/Nonlinear.hpp @@ -299,7 +299,7 @@ PerformanceData run( const typename FixtureType::FEMeshType & mesh , for(;;) { // Nonlinear loop -#if defined( KOKKOS_HAVE_MPI ) +#if defined( KOKKOS_ENABLE_MPI ) { //------------------------------------ // Import off-processor nodal solution values diff --git a/lib/kokkos/example/multi_fem/ParallelComm.hpp b/lib/kokkos/example/multi_fem/ParallelComm.hpp index 163e84a958..0b3ceb4c3e 100644 --- a/lib/kokkos/example/multi_fem/ParallelComm.hpp +++ b/lib/kokkos/example/multi_fem/ParallelComm.hpp @@ -50,7 +50,7 @@ //------------------------------------------------------------------------ -#if defined( KOKKOS_HAVE_MPI ) +#if defined( KOKKOS_ENABLE_MPI ) #include #include @@ -117,7 +117,7 @@ std::string command_line( Machine machine , const int argc , const char * const } -#else /* ! defined( KOKKOS_HAVE_MPI ) */ +#else /* ! defined( KOKKOS_ENABLE_MPI ) */ #include @@ -158,7 +158,7 @@ std::string command_line( Machine machine , const int argc , const char * const } -#endif /* ! defined( KOKKOS_HAVE_MPI ) */ +#endif /* ! defined( KOKKOS_ENABLE_MPI ) */ //------------------------------------------------------------------------ diff --git a/lib/kokkos/example/multi_fem/ParallelDataMap.hpp b/lib/kokkos/example/multi_fem/ParallelDataMap.hpp index 22a1cfefa1..8373c94d7d 100644 --- a/lib/kokkos/example/multi_fem/ParallelDataMap.hpp +++ b/lib/kokkos/example/multi_fem/ParallelDataMap.hpp @@ -282,7 +282,7 @@ class AsyncExchange ; // //---------------------------------------------------------------------------- -#ifdef KOKKOS_HAVE_MPI +#ifdef KOKKOS_ENABLE_MPI namespace Kokkos { @@ -476,7 +476,7 @@ public: } // namespace Kokkos -#else /* ! #ifdef KOKKOS_HAVE_MPI */ +#else /* ! #ifdef KOKKOS_ENABLE_MPI */ namespace Kokkos { @@ -508,7 +508,7 @@ public: } // namespace Kokkos -#endif /* ! #ifdef KOKKOS_HAVE_MPI */ +#endif /* ! #ifdef KOKKOS_ENABLE_MPI */ //---------------------------------------------------------------------------- diff --git a/lib/kokkos/example/multi_fem/ParallelMachine.cpp b/lib/kokkos/example/multi_fem/ParallelMachine.cpp index 0953cab760..07ceccb499 100644 --- a/lib/kokkos/example/multi_fem/ParallelMachine.cpp +++ b/lib/kokkos/example/multi_fem/ParallelMachine.cpp @@ -50,7 +50,7 @@ #include -#if ! defined( KOKKOS_HAVE_MPI ) +#if ! defined( KOKKOS_ENABLE_MPI ) #define MPI_COMM_NULL 0 #endif @@ -65,7 +65,7 @@ Machine::Machine( int * argc , char *** argv ) , m_mpi_gpu(0) { -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) //------------------------------------ // Might be using a Cuda aware version of MPI. // Must select Cuda device before initializing MPI. @@ -103,7 +103,7 @@ Machine::Machine( int * argc , char *** argv ) //------------------------------------ -#if defined( KOKKOS_HAVE_MPI ) +#if defined( KOKKOS_ENABLE_MPI ) MPI_Init( argc , argv ); m_mpi_comm = MPI_COMM_WORLD ; MPI_Comm_size( m_mpi_comm , & m_mpi_size ); @@ -132,7 +132,7 @@ Machine::Machine( int * argc , char *** argv ) } } -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) //------------------------------------ // Request to use Cuda device and not already initialized. if ( ! m_mpi_gpu ) { @@ -155,10 +155,10 @@ Machine::Machine( int * argc , char *** argv ) Machine::~Machine() { Kokkos::Threads::finalize(); -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) Kokkos::Cuda::finalize(); #endif -#if defined( KOKKOS_HAVE_MPI ) +#if defined( KOKKOS_ENABLE_MPI ) MPI_Finalize(); #endif } @@ -167,7 +167,7 @@ void Machine::print_configuration( std::ostream & msg ) const { msg << "MPI [ " << m_mpi_rank << " / " << m_mpi_size << " ]" << std::endl ; Kokkos::Threads::print_configuration( msg ); -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) Kokkos::Cuda::print_configuration( msg ); #endif } diff --git a/lib/kokkos/example/multi_fem/ParallelMachine.hpp b/lib/kokkos/example/multi_fem/ParallelMachine.hpp index 1ddf50ab3b..97b21e0c3d 100644 --- a/lib/kokkos/example/multi_fem/ParallelMachine.hpp +++ b/lib/kokkos/example/multi_fem/ParallelMachine.hpp @@ -54,7 +54,7 @@ //------------------------------------------------------------------------ -#if defined( KOKKOS_HAVE_MPI ) +#if defined( KOKKOS_ENABLE_MPI ) #include #else typedef int MPI_Comm ; diff --git a/lib/kokkos/example/multi_fem/SparseLinearSystem.hpp b/lib/kokkos/example/multi_fem/SparseLinearSystem.hpp index 8d140b6d25..b13528bdac 100644 --- a/lib/kokkos/example/multi_fem/SparseLinearSystem.hpp +++ b/lib/kokkos/example/multi_fem/SparseLinearSystem.hpp @@ -276,7 +276,7 @@ void cgsolve( //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) #if ( CUDA_VERSION < 6000 ) #pragma message "cusparse_v2.h" @@ -391,7 +391,7 @@ public: } /* namespace Impl */ } /* namespace Kokkos */ -#endif /* #if defined( KOKKOS_HAVE_CUDA ) */ +#endif /* #if defined( KOKKOS_ENABLE_CUDA ) */ //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- diff --git a/lib/kokkos/example/multi_fem/TestBoxMeshFixture.hpp b/lib/kokkos/example/multi_fem/TestBoxMeshFixture.hpp index 9cc32b6b10..3c37331b38 100644 --- a/lib/kokkos/example/multi_fem/TestBoxMeshFixture.hpp +++ b/lib/kokkos/example/multi_fem/TestBoxMeshFixture.hpp @@ -127,7 +127,7 @@ public: //---------------------------------------------------------------------------- -#ifdef KOKKOS_HAVE_MPI +#ifdef KOKKOS_ENABLE_MPI namespace TestFEMesh { @@ -190,7 +190,7 @@ void verify_parallel( } // namespace TestFEMesh -#else /* ! #ifdef KOKKOS_HAVE_MPI */ +#else /* ! #ifdef KOKKOS_ENABLE_MPI */ namespace TestFEMesh { @@ -205,7 +205,7 @@ void verify_parallel( } // namespace TestFEMesh -#endif /* ! #ifdef KOKKOS_HAVE_MPI */ +#endif /* ! #ifdef KOKKOS_ENABLE_MPI */ //---------------------------------------------------------------------------- diff --git a/lib/kokkos/example/multi_fem/TestCuda.cpp b/lib/kokkos/example/multi_fem/TestCuda.cpp index 11370a5350..fafa077a99 100644 --- a/lib/kokkos/example/multi_fem/TestCuda.cpp +++ b/lib/kokkos/example/multi_fem/TestCuda.cpp @@ -50,7 +50,7 @@ #include -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) //---------------------------------------------------------------------------- @@ -188,5 +188,5 @@ void test_cuda_nonlinear_quadratic( comm::Machine machine , //---------------------------------------------------------------------------- -#endif /* #if defined( KOKKOS_HAVE_CUDA ) */ +#endif /* #if defined( KOKKOS_ENABLE_CUDA ) */ diff --git a/lib/kokkos/example/multi_fem/TestHybridFEM.cpp b/lib/kokkos/example/multi_fem/TestHybridFEM.cpp index 1bbd74e4d7..62980f8302 100644 --- a/lib/kokkos/example/multi_fem/TestHybridFEM.cpp +++ b/lib/kokkos/example/multi_fem/TestHybridFEM.cpp @@ -183,7 +183,7 @@ bool run_host( std::istream & input , return cmd_error ; } -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) bool run_cuda( std::istream & input , comm::Machine machine ) { bool cmd_error = false ; @@ -259,7 +259,7 @@ void run( const std::string & argline , comm::Machine machine ) << " CORE[" << cores_per_numa << "]" << " PU[" << threads_per_core << "] }" << std::endl ; -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) test_cuda_query( machine ); #endif } @@ -290,7 +290,7 @@ void run( const std::string & argline , comm::Machine machine ) cmd_error = run_host( input , machine , host_gang_count , host_gang_worker_count ); } -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) else if ( which == std::string("cuda") ) { cmd_error = run_cuda( input , machine ); } diff --git a/lib/kokkos/example/query_device/query_device.cpp b/lib/kokkos/example/query_device/query_device.cpp index ced8cc4e95..f35ddadfb4 100644 --- a/lib/kokkos/example/query_device/query_device.cpp +++ b/lib/kokkos/example/query_device/query_device.cpp @@ -46,7 +46,7 @@ #include -#if defined( KOKKOS_HAVE_MPI ) +#if defined( KOKKOS_ENABLE_MPI ) #include #endif @@ -59,7 +59,7 @@ int main( int argc , char ** argv ) { std::ostringstream msg ; -#if defined( KOKKOS_HAVE_MPI ) +#if defined( KOKKOS_ENABLE_MPI ) MPI_Init( & argc , & argv ); @@ -81,7 +81,7 @@ int main( int argc , char ** argv ) << std::endl ; } -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) Kokkos::Cuda::print_configuration( msg ); #endif @@ -89,7 +89,7 @@ int main( int argc , char ** argv ) std::cout << msg.str(); -#if defined( KOKKOS_HAVE_MPI ) +#if defined( KOKKOS_ENABLE_MPI ) MPI_Finalize(); diff --git a/lib/kokkos/example/sort_array/main.cpp b/lib/kokkos/example/sort_array/main.cpp index 74c4ab154c..61e96cc6af 100644 --- a/lib/kokkos/example/sort_array/main.cpp +++ b/lib/kokkos/example/sort_array/main.cpp @@ -53,7 +53,7 @@ int main( int argc , char ** argv ) { -#if defined( KOKKOS_HAVE_CUDA ) || defined( KOKKOS_HAVE_PTHREAD ) || defined( KOKKOS_HAVE_OPENMP ) +#if defined( KOKKOS_ENABLE_CUDA ) || defined( KOKKOS_ENABLE_PTHREAD ) || defined( KOKKOS_ENABLE_OPENMP ) Kokkos::initialize( argc , argv ); int length_array = 100000 ; @@ -66,21 +66,21 @@ int main( int argc , char ** argv ) int length_total_array = length_array * 100; -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) if ( Kokkos::Cuda::is_initialized() ) { std::cout << "Kokkos::Cuda" << std::endl ; Example::sort_array< Kokkos::Cuda >( length_array , length_total_array ); } #endif -#if defined( KOKKOS_HAVE_PTHREAD ) +#if defined( KOKKOS_ENABLE_PTHREAD ) if ( Kokkos::Threads::is_initialized() ) { std::cout << "Kokkos::Threads" << std::endl ; Example::sort_array< Kokkos::Threads >( length_array , length_total_array ); } #endif -#if defined( KOKKOS_HAVE_OPENMP ) +#if defined( KOKKOS_ENABLE_OPENMP ) if ( Kokkos::OpenMP::is_initialized() ) { std::cout << "Kokkos::OpenMP" << std::endl ; Example::sort_array< Kokkos::OpenMP >( length_array , length_total_array ); diff --git a/lib/kokkos/example/sort_array/sort_array.hpp b/lib/kokkos/example/sort_array/sort_array.hpp index ae17cb7ac7..5dff64259f 100644 --- a/lib/kokkos/example/sort_array/sort_array.hpp +++ b/lib/kokkos/example/sort_array/sort_array.hpp @@ -68,7 +68,7 @@ struct SortView { } -#if defined(KOKKOS_HAVE_CUDA) +#if defined(KOKKOS_ENABLE_CUDA) #include #include @@ -102,7 +102,7 @@ void sort_array( const size_t array_length /* length of spans of array to sort * typedef Device execution_space ; typedef Kokkos::View device_array_type ; -#if defined( KOKKOS_HAVE_CUDA ) +#if defined( KOKKOS_ENABLE_CUDA ) typedef typename Kokkos::Impl::if_c< std::is_same< Device , Kokkos::Cuda >::value diff --git a/lib/kokkos/example/tutorial/01_hello_world_lambda/hello_world_lambda.cpp b/lib/kokkos/example/tutorial/01_hello_world_lambda/hello_world_lambda.cpp index 4b8b9db621..326d064105 100644 --- a/lib/kokkos/example/tutorial/01_hello_world_lambda/hello_world_lambda.cpp +++ b/lib/kokkos/example/tutorial/01_hello_world_lambda/hello_world_lambda.cpp @@ -100,7 +100,7 @@ int main (int argc, char* argv[]) { // order. Parallel for loops may execute in any order. // We also need to protect the usage of a lambda against compiling // with a backend which doesn't support it (i.e. Cuda 6.5/7.0). -#if (KOKKOS_HAVE_CXX11_DISPATCH_LAMBDA) +#if (KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) Kokkos::parallel_for (15, KOKKOS_LAMBDA (const int i) { // printf works in a CUDA parallel kernel; std::ostream does not. printf ("Hello from i = %i\n", i); diff --git a/lib/kokkos/example/tutorial/02_simple_reduce_lambda/simple_reduce_lambda.cpp b/lib/kokkos/example/tutorial/02_simple_reduce_lambda/simple_reduce_lambda.cpp index f44ddce309..70eea43240 100644 --- a/lib/kokkos/example/tutorial/02_simple_reduce_lambda/simple_reduce_lambda.cpp +++ b/lib/kokkos/example/tutorial/02_simple_reduce_lambda/simple_reduce_lambda.cpp @@ -69,7 +69,7 @@ int main (int argc, char* argv[]) { // It also handles any other syntax needed for CUDA. // We also need to protect the usage of a lambda against compiling // with a backend which doesn't support it (i.e. Cuda 6.5/7.0). - #if (KOKKOS_HAVE_CXX11_DISPATCH_LAMBDA) + #if (KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) Kokkos::parallel_reduce (n, KOKKOS_LAMBDA (const int i, int& lsum) { lsum += i*i; }, sum); @@ -85,7 +85,7 @@ int main (int argc, char* argv[]) { printf ("Sum of squares of integers from 0 to %i, " "computed sequentially, is %i\n", n - 1, seqSum); Kokkos::finalize (); -#if (KOKKOS_HAVE_CXX11_DISPATCH_LAMBDA) +#if (KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) return (sum == seqSum) ? 0 : -1; #else return 0; diff --git a/lib/kokkos/example/tutorial/03_simple_view_lambda/simple_view_lambda.cpp b/lib/kokkos/example/tutorial/03_simple_view_lambda/simple_view_lambda.cpp index e9e7c2370b..dd0641be54 100644 --- a/lib/kokkos/example/tutorial/03_simple_view_lambda/simple_view_lambda.cpp +++ b/lib/kokkos/example/tutorial/03_simple_view_lambda/simple_view_lambda.cpp @@ -99,7 +99,7 @@ int main (int argc, char* argv[]) { // ask for one. // We also need to protect the usage of a lambda against compiling // with a backend which doesn't support it (i.e. Cuda 6.5/7.0). - #if (KOKKOS_HAVE_CXX11_DISPATCH_LAMBDA) + #if (KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) Kokkos::parallel_for (10, KOKKOS_LAMBDA (const int i) { // Acesss the View just like a Fortran array. The layout depends // on the View's memory space, so don't rely on the View's diff --git a/lib/kokkos/example/tutorial/Advanced_Views/05_NVIDIA_UVM/uvm_example.cpp b/lib/kokkos/example/tutorial/Advanced_Views/05_NVIDIA_UVM/uvm_example.cpp index 72fd444abf..8cfb624b8d 100644 --- a/lib/kokkos/example/tutorial/Advanced_Views/05_NVIDIA_UVM/uvm_example.cpp +++ b/lib/kokkos/example/tutorial/Advanced_Views/05_NVIDIA_UVM/uvm_example.cpp @@ -47,7 +47,7 @@ #include #include -#ifdef KOKKOS_HAVE_CUDA +#ifdef KOKKOS_ENABLE_CUDA typedef Kokkos::View view_type; typedef Kokkos::View idx_type; #else diff --git a/lib/kokkos/example/tutorial/Hierarchical_Parallelism/01_thread_teams_lambda/thread_teams_lambda.cpp b/lib/kokkos/example/tutorial/Hierarchical_Parallelism/01_thread_teams_lambda/thread_teams_lambda.cpp index c0865cfa65..216db7f125 100644 --- a/lib/kokkos/example/tutorial/Hierarchical_Parallelism/01_thread_teams_lambda/thread_teams_lambda.cpp +++ b/lib/kokkos/example/tutorial/Hierarchical_Parallelism/01_thread_teams_lambda/thread_teams_lambda.cpp @@ -79,7 +79,7 @@ int main (int narg, char* args[]) { int sum = 0; // We also need to protect the usage of a lambda against compiling // with a backend which doesn't support it (i.e. Cuda 6.5/7.0). - #if (KOKKOS_HAVE_CXX11_DISPATCH_LAMBDA) + #if (KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) parallel_reduce (policy, KOKKOS_LAMBDA (const team_member& thread, int& lsum) { lsum += 1; // TeamPolicy<>::member_type provides functions to query the diff --git a/lib/kokkos/example/tutorial/Hierarchical_Parallelism/03_vectorization/vectorization.cpp b/lib/kokkos/example/tutorial/Hierarchical_Parallelism/03_vectorization/vectorization.cpp index 99d5958edf..b2e0ba5388 100644 --- a/lib/kokkos/example/tutorial/Hierarchical_Parallelism/03_vectorization/vectorization.cpp +++ b/lib/kokkos/example/tutorial/Hierarchical_Parallelism/03_vectorization/vectorization.cpp @@ -1,13 +1,13 @@ /* //@HEADER // ************************************************************************ -// +// // Kokkos v. 2.0 // Copyright (2014) Sandia Corporation -// +// // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, // the U.S. Government retains certain rights in this software. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -36,7 +36,7 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Questions? Contact H. Carter Edwards (hcedwar@sandia.gov) -// +// // ************************************************************************ //@HEADER */ @@ -45,7 +45,6 @@ #include #include -#ifdef KOKKOS_HAVE_CXX11 // The TeamPolicy actually supports 3D parallelism: Teams, Threads, Vector // Kokkos::parallel_{for/reduce/scan} calls can be completely free nested. @@ -159,4 +158,3 @@ int main(int narg, char* args[]) { Kokkos::finalize(); } -#endif //KOKKOS_HAVE_CXX11 diff --git a/lib/kokkos/generate_makefile.bash b/lib/kokkos/generate_makefile.bash index 6fa03ebb34..e7bd9da36b 100755 --- a/lib/kokkos/generate_makefile.bash +++ b/lib/kokkos/generate_makefile.bash @@ -1,6 +1,7 @@ #!/bin/bash KOKKOS_DEVICES="" +MAKE_J_OPTION="32" while [[ $# > 0 ]] do @@ -61,6 +62,9 @@ case $key in --debug|-dbg) KOKKOS_DEBUG=yes ;; + --make-j*) + MAKE_J_OPTION="${key#*=}" + ;; --compiler*) COMPILER="${key#*=}" CNUM=`which ${COMPILER} 2>&1 >/dev/null | grep "no ${COMPILER}" | wc -l` @@ -110,6 +114,7 @@ case $key in echo " Pascal61 = NVIDIA Pascal generation CC 6.1" echo " Maxwell50 = NVIDIA Maxwell generation CC 5.0" echo " Power8 = IBM POWER8 CPUs" + echo " Power9 = IBM POWER9 CPUs" echo "" echo "--compiler=/Path/To/Compiler set the compiler" echo "--debug,-dbg: enable Debugging" @@ -123,8 +128,9 @@ case $key in echo "--with-hwloc=/Path/To/Hwloc: set path to hwloc" echo "--with-options=[OPTIONS]: additional options to Kokkos:" echo " aggressive_vectorization = add ivdep on loops" - echo "--with-cuda-options=[OPTIONS]: additional options to CUDA:" + echo "--with-cuda-options=[OPT]: additional options to CUDA:" echo " force_uvm, use_ldg, enable_lambda, rdc" + echo "--make-j=[NUM]: set -j flag used during build." exit 0 ;; *) @@ -232,7 +238,7 @@ KOKKOS_SETTINGS="${KOKKOS_SETTINGS_NO_KOKKOS_PATH} KOKKOS_PATH=${KOKKOS_PATH}" echo "KOKKOS_SETTINGS=${KOKKOS_SETTINGS}" > core/unit_test/Makefile echo "" >> core/unit_test/Makefile echo "all:" >> core/unit_test/Makefile -echo -e "\tmake -j -f ${KOKKOS_PATH}/core/unit_test/Makefile ${KOKKOS_SETTINGS}" >> core/unit_test/Makefile +echo -e "\tmake -j ${MAKE_J_OPTION} -f ${KOKKOS_PATH}/core/unit_test/Makefile ${KOKKOS_SETTINGS}" >> core/unit_test/Makefile echo "" >> core/unit_test/Makefile echo "test: all" >> core/unit_test/Makefile echo -e "\tmake -f ${KOKKOS_PATH}/core/unit_test/Makefile ${KOKKOS_SETTINGS} test" >> core/unit_test/Makefile @@ -243,7 +249,7 @@ echo -e "\tmake -f ${KOKKOS_PATH}/core/unit_test/Makefile ${KOKKOS_SETTINGS} cle echo "KOKKOS_SETTINGS=${KOKKOS_SETTINGS}" > core/perf_test/Makefile echo "" >> core/perf_test/Makefile echo "all:" >> core/perf_test/Makefile -echo -e "\tmake -j -f ${KOKKOS_PATH}/core/perf_test/Makefile ${KOKKOS_SETTINGS}" >> core/perf_test/Makefile +echo -e "\tmake -j ${MAKE_J_OPTION} -f ${KOKKOS_PATH}/core/perf_test/Makefile ${KOKKOS_SETTINGS}" >> core/perf_test/Makefile echo "" >> core/perf_test/Makefile echo "test: all" >> core/perf_test/Makefile echo -e "\tmake -f ${KOKKOS_PATH}/core/perf_test/Makefile ${KOKKOS_SETTINGS} test" >> core/perf_test/Makefile @@ -254,7 +260,7 @@ echo -e "\tmake -f ${KOKKOS_PATH}/core/perf_test/Makefile ${KOKKOS_SETTINGS} cle echo "KOKKOS_SETTINGS=${KOKKOS_SETTINGS}" > containers/unit_tests/Makefile echo "" >> containers/unit_tests/Makefile echo "all:" >> containers/unit_tests/Makefile -echo -e "\tmake -j -f ${KOKKOS_PATH}/containers/unit_tests/Makefile ${KOKKOS_SETTINGS}" >> containers/unit_tests/Makefile +echo -e "\tmake -j ${MAKE_J_OPTION} -f ${KOKKOS_PATH}/containers/unit_tests/Makefile ${KOKKOS_SETTINGS}" >> containers/unit_tests/Makefile echo "" >> containers/unit_tests/Makefile echo "test: all" >> containers/unit_tests/Makefile echo -e "\tmake -f ${KOKKOS_PATH}/containers/unit_tests/Makefile ${KOKKOS_SETTINGS} test" >> containers/unit_tests/Makefile @@ -265,7 +271,7 @@ echo -e "\tmake -f ${KOKKOS_PATH}/containers/unit_tests/Makefile ${KOKKOS_SETTIN echo "KOKKOS_SETTINGS=${KOKKOS_SETTINGS}" > containers/performance_tests/Makefile echo "" >> containers/performance_tests/Makefile echo "all:" >> containers/performance_tests/Makefile -echo -e "\tmake -j -f ${KOKKOS_PATH}/containers/performance_tests/Makefile ${KOKKOS_SETTINGS}" >> containers/performance_tests/Makefile +echo -e "\tmake -j ${MAKE_J_OPTION} -f ${KOKKOS_PATH}/containers/performance_tests/Makefile ${KOKKOS_SETTINGS}" >> containers/performance_tests/Makefile echo "" >> containers/performance_tests/Makefile echo "test: all" >> containers/performance_tests/Makefile echo -e "\tmake -f ${KOKKOS_PATH}/containers/performance_tests/Makefile ${KOKKOS_SETTINGS} test" >> containers/performance_tests/Makefile @@ -276,7 +282,7 @@ echo -e "\tmake -f ${KOKKOS_PATH}/containers/performance_tests/Makefile ${KOKKOS echo "KOKKOS_SETTINGS=${KOKKOS_SETTINGS}" > algorithms/unit_tests/Makefile echo "" >> algorithms/unit_tests/Makefile echo "all:" >> algorithms/unit_tests/Makefile -echo -e "\tmake -j -f ${KOKKOS_PATH}/algorithms/unit_tests/Makefile ${KOKKOS_SETTINGS}" >> algorithms/unit_tests/Makefile +echo -e "\tmake -j ${MAKE_J_OPTION} -f ${KOKKOS_PATH}/algorithms/unit_tests/Makefile ${KOKKOS_SETTINGS}" >> algorithms/unit_tests/Makefile echo "" >> algorithms/unit_tests/Makefile echo "test: all" >> algorithms/unit_tests/Makefile echo -e "\tmake -f ${KOKKOS_PATH}/algorithms/unit_tests/Makefile ${KOKKOS_SETTINGS} test" >> algorithms/unit_tests/Makefile @@ -289,59 +295,59 @@ KOKKOS_SETTINGS="${KOKKOS_SETTINGS_NO_KOKKOS_PATH} KOKKOS_PATH=${KOKKOS_TEST_INS echo "KOKKOS_SETTINGS=${KOKKOS_SETTINGS}" > example/fixture/Makefile echo "" >> example/fixture/Makefile echo "all:" >> example/fixture/Makefile -echo -e "\tmake -j -f ${KOKKOS_PATH}/example/fixture/Makefile ${KOKKOS_SETTINGS}" >> example/fixture/Makefile +echo -e "\tmake -j ${MAKE_J_OPTION} -f ${KOKKOS_PATH}/example/fixture/Makefile ${KOKKOS_SETTINGS}" >> example/fixture/Makefile echo "" >> example/fixture/Makefile echo "test: all" >> example/fixture/Makefile -echo -e "\tmake -j -f ${KOKKOS_PATH}/example/fixture/Makefile ${KOKKOS_SETTINGS} test" >> example/fixture/Makefile +echo -e "\tmake -j ${MAKE_J_OPTION} -f ${KOKKOS_PATH}/example/fixture/Makefile ${KOKKOS_SETTINGS} test" >> example/fixture/Makefile echo "" >> example/fixture/Makefile echo "clean:" >> example/fixture/Makefile -echo -e "\tmake -j -f ${KOKKOS_PATH}/example/fixture/Makefile ${KOKKOS_SETTINGS} clean" >> example/fixture/Makefile +echo -e "\tmake -j ${MAKE_J_OPTION} -f ${KOKKOS_PATH}/example/fixture/Makefile ${KOKKOS_SETTINGS} clean" >> example/fixture/Makefile echo "KOKKOS_SETTINGS=${KOKKOS_SETTINGS}" > example/feint/Makefile echo "" >> example/feint/Makefile echo "all:" >> example/feint/Makefile -echo -e "\tmake -j -f ${KOKKOS_PATH}/example/feint/Makefile ${KOKKOS_SETTINGS}" >> example/feint/Makefile +echo -e "\tmake -j ${MAKE_J_OPTION} -f ${KOKKOS_PATH}/example/feint/Makefile ${KOKKOS_SETTINGS}" >> example/feint/Makefile echo "" >> example/feint/Makefile echo "test: all" >> example/feint/Makefile -echo -e "\tmake -j -f ${KOKKOS_PATH}/example/feint/Makefile ${KOKKOS_SETTINGS} test" >> example/feint/Makefile +echo -e "\tmake -j ${MAKE_J_OPTION} -f ${KOKKOS_PATH}/example/feint/Makefile ${KOKKOS_SETTINGS} test" >> example/feint/Makefile echo "" >> example/feint/Makefile echo "clean:" >> example/feint/Makefile -echo -e "\tmake -j -f ${KOKKOS_PATH}/example/feint/Makefile ${KOKKOS_SETTINGS} clean" >> example/feint/Makefile +echo -e "\tmake -j ${MAKE_J_OPTION} -f ${KOKKOS_PATH}/example/feint/Makefile ${KOKKOS_SETTINGS} clean" >> example/feint/Makefile echo "KOKKOS_SETTINGS=${KOKKOS_SETTINGS}" > example/fenl/Makefile echo "" >> example/fenl/Makefile echo "all:" >> example/fenl/Makefile -echo -e "\tmake -j -f ${KOKKOS_PATH}/example/fenl/Makefile ${KOKKOS_SETTINGS}" >> example/fenl/Makefile +echo -e "\tmake -j ${MAKE_J_OPTION} -f ${KOKKOS_PATH}/example/fenl/Makefile ${KOKKOS_SETTINGS}" >> example/fenl/Makefile echo "" >> example/fenl/Makefile echo "test: all" >> example/fenl/Makefile -echo -e "\tmake -j -f ${KOKKOS_PATH}/example/fenl/Makefile ${KOKKOS_SETTINGS} test" >> example/fenl/Makefile +echo -e "\tmake -j ${MAKE_J_OPTION} -f ${KOKKOS_PATH}/example/fenl/Makefile ${KOKKOS_SETTINGS} test" >> example/fenl/Makefile echo "" >> example/fenl/Makefile echo "clean:" >> example/fenl/Makefile -echo -e "\tmake -j -f ${KOKKOS_PATH}/example/fenl/Makefile ${KOKKOS_SETTINGS} clean" >> example/fenl/Makefile +echo -e "\tmake -j ${MAKE_J_OPTION} -f ${KOKKOS_PATH}/example/fenl/Makefile ${KOKKOS_SETTINGS} clean" >> example/fenl/Makefile echo "KOKKOS_SETTINGS=${KOKKOS_SETTINGS}" > example/tutorial/Makefile echo "" >> example/tutorial/Makefile echo "build:" >> example/tutorial/Makefile -echo -e "\tmake -j -f ${KOKKOS_PATH}/example/tutorial/Makefile KOKKOS_SETTINGS='${KOKKOS_SETTINGS}' KOKKOS_PATH=${KOKKOS_PATH} build">> example/tutorial/Makefile +echo -e "\tmake -j ${MAKE_J_OPTION} -f ${KOKKOS_PATH}/example/tutorial/Makefile KOKKOS_SETTINGS='${KOKKOS_SETTINGS}' KOKKOS_PATH=${KOKKOS_PATH} build">> example/tutorial/Makefile echo "" >> example/tutorial/Makefile echo "test: build" >> example/tutorial/Makefile -echo -e "\tmake -j -f ${KOKKOS_PATH}/example/tutorial/Makefile KOKKOS_SETTINGS='${KOKKOS_SETTINGS}' KOKKOS_PATH=${KOKKOS_PATH} test" >> example/tutorial/Makefile +echo -e "\tmake -j ${MAKE_J_OPTION} -f ${KOKKOS_PATH}/example/tutorial/Makefile KOKKOS_SETTINGS='${KOKKOS_SETTINGS}' KOKKOS_PATH=${KOKKOS_PATH} test" >> example/tutorial/Makefile echo "" >> example/tutorial/Makefile echo "clean:" >> example/tutorial/Makefile -echo -e "\tmake -j -f ${KOKKOS_PATH}/example/tutorial/Makefile KOKKOS_SETTINGS='${KOKKOS_SETTINGS}' KOKKOS_PATH=${KOKKOS_PATH} clean" >> example/tutorial/Makefile +echo -e "\tmake -j ${MAKE_J_OPTION} -f ${KOKKOS_PATH}/example/tutorial/Makefile KOKKOS_SETTINGS='${KOKKOS_SETTINGS}' KOKKOS_PATH=${KOKKOS_PATH} clean" >> example/tutorial/Makefile if [ ${#KOKKOS_ENABLE_EXAMPLE_ICHOL} -gt 0 ]; then echo "KOKKOS_SETTINGS=${KOKKOS_SETTINGS}" > example/ichol/Makefile echo "" >> example/ichol/Makefile echo "all:" >> example/ichol/Makefile -echo -e "\tmake -j -f ${KOKKOS_PATH}/example/ichol/Makefile ${KOKKOS_SETTINGS}" >> example/ichol/Makefile +echo -e "\tmake -j ${MAKE_J_OPTION} -f ${KOKKOS_PATH}/example/ichol/Makefile ${KOKKOS_SETTINGS}" >> example/ichol/Makefile echo "" >> example/ichol/Makefile echo "test: all" >> example/ichol/Makefile -echo -e "\tmake -j -f ${KOKKOS_PATH}/example/ichol/Makefile ${KOKKOS_SETTINGS} test" >> example/ichol/Makefile +echo -e "\tmake -j ${MAKE_J_OPTION} -f ${KOKKOS_PATH}/example/ichol/Makefile ${KOKKOS_SETTINGS} test" >> example/ichol/Makefile echo "" >> example/ichol/Makefile echo "clean:" >> example/ichol/Makefile -echo -e "\tmake -j -f ${KOKKOS_PATH}/example/ichol/Makefile ${KOKKOS_SETTINGS} clean" >> example/ichol/Makefile +echo -e "\tmake -j ${MAKE_J_OPTION} -f ${KOKKOS_PATH}/example/ichol/Makefile ${KOKKOS_SETTINGS} clean" >> example/ichol/Makefile fi KOKKOS_SETTINGS="${KOKKOS_SETTINGS_NO_KOKKOS_PATH} KOKKOS_PATH=${KOKKOS_PATH}" @@ -352,19 +358,19 @@ echo "KOKKOS_SETTINGS=${KOKKOS_SETTINGS}" > Makefile echo "" >> Makefile echo "kokkoslib:" >> Makefile echo -e "\tcd core; \\" >> Makefile -echo -e "\tmake -j -f ${KOKKOS_PATH}/core/src/Makefile ${KOKKOS_SETTINGS} PREFIX=${KOKKOS_INSTALL_PATH} build-lib" >> Makefile +echo -e "\tmake -j ${MAKE_J_OPTION} -f ${KOKKOS_PATH}/core/src/Makefile ${KOKKOS_SETTINGS} PREFIX=${KOKKOS_INSTALL_PATH} build-lib" >> Makefile echo "" >> Makefile echo "install: kokkoslib" >> Makefile echo -e "\tcd core; \\" >> Makefile -echo -e "\tmake -j -f ${KOKKOS_PATH}/core/src/Makefile ${KOKKOS_SETTINGS} PREFIX=${KOKKOS_INSTALL_PATH} install" >> Makefile +echo -e "\tmake -j ${MAKE_J_OPTION} -f ${KOKKOS_PATH}/core/src/Makefile ${KOKKOS_SETTINGS} PREFIX=${KOKKOS_INSTALL_PATH} install" >> Makefile echo "" >> Makefile echo "kokkoslib-test:" >> Makefile echo -e "\tcd core; \\" >> Makefile -echo -e "\tmake -j -f ${KOKKOS_PATH}/core/src/Makefile ${KOKKOS_SETTINGS} PREFIX=${KOKKOS_TEST_INSTALL_PATH} build-lib" >> Makefile +echo -e "\tmake -j ${MAKE_J_OPTION} -f ${KOKKOS_PATH}/core/src/Makefile ${KOKKOS_SETTINGS} PREFIX=${KOKKOS_TEST_INSTALL_PATH} build-lib" >> Makefile echo "" >> Makefile echo "install-test: kokkoslib-test" >> Makefile echo -e "\tcd core; \\" >> Makefile -echo -e "\tmake -j -f ${KOKKOS_PATH}/core/src/Makefile ${KOKKOS_SETTINGS} PREFIX=${KOKKOS_TEST_INSTALL_PATH} install" >> Makefile +echo -e "\tmake -j ${MAKE_J_OPTION} -f ${KOKKOS_PATH}/core/src/Makefile ${KOKKOS_SETTINGS} PREFIX=${KOKKOS_TEST_INSTALL_PATH} install" >> Makefile echo "" >> Makefile echo "build-test: install-test" >> Makefile echo -e "\tmake -C core/unit_test" >> Makefile diff --git a/lib/kokkos/tpls/gtest/gtest/LICENSE b/lib/kokkos/tpls/gtest/gtest/LICENSE deleted file mode 100644 index 1941a11f8c..0000000000 --- a/lib/kokkos/tpls/gtest/gtest/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -Copyright 2008, Google Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * 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. - * Neither the name of Google Inc. 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. diff --git a/lib/kokkos/tpls/gtest/gtest/README b/lib/kokkos/tpls/gtest/gtest/README deleted file mode 100644 index 82964ecc32..0000000000 --- a/lib/kokkos/tpls/gtest/gtest/README +++ /dev/null @@ -1,13 +0,0 @@ -This is a fused source version of gtest 1.7.0. All that should be necessary to -start using gtest in your package is to declare the dependency and include -gtest/gtest.h. - -However, because some of the packages that are developed in Sierra do not use a -fused source version of gtest we need to make it possible for them to build with -this version as well as with their native build. To facilitate this we have -created symlinks for the other gtest headers that they use to the fused source -gtest.h. This will make it possible for them find the headers while still using -the fuse source version. This should not have any ill effects since the header is -protected and allows for only using the non-gtest.h headers in their files. - - diff --git a/lib/kokkos/tpls/gtest/gtest/gtest-all.cc b/lib/kokkos/tpls/gtest/gtest/gtest-all.cc deleted file mode 100644 index 538c78db93..0000000000 --- a/lib/kokkos/tpls/gtest/gtest/gtest-all.cc +++ /dev/null @@ -1,9594 +0,0 @@ -// Copyright 2008, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. 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. -// -// Author: mheule@google.com (Markus Heule) -// -// Google C++ Testing Framework (Google Test) -// -// Sometimes it's desirable to build Google Test by compiling a single file. -// This file serves this purpose. - -// This line ensures that gtest.h can be compiled on its own, even -// when it's fused. -#include "gtest/gtest.h" - -// The following lines pull in the real gtest *.cc files. -// Copyright 2005, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. 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. -// -// Author: wan@google.com (Zhanyong Wan) -// -// The Google C++ Testing Framework (Google Test) - -// Copyright 2007, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. 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. -// -// Author: wan@google.com (Zhanyong Wan) -// -// Utilities for testing Google Test itself and code that uses Google Test -// (e.g. frameworks built on top of Google Test). - -#ifndef GTEST_INCLUDE_GTEST_GTEST_SPI_H_ -#define GTEST_INCLUDE_GTEST_GTEST_SPI_H_ - - -namespace testing { - -// This helper class can be used to mock out Google Test failure reporting -// so that we can test Google Test or code that builds on Google Test. -// -// An object of this class appends a TestPartResult object to the -// TestPartResultArray object given in the constructor whenever a Google Test -// failure is reported. It can either intercept only failures that are -// generated in the same thread that created this object or it can intercept -// all generated failures. The scope of this mock object can be controlled with -// the second argument to the two arguments constructor. -class GTEST_API_ ScopedFakeTestPartResultReporter - : public TestPartResultReporterInterface { - public: - // The two possible mocking modes of this object. - enum InterceptMode { - INTERCEPT_ONLY_CURRENT_THREAD, // Intercepts only thread local failures. - INTERCEPT_ALL_THREADS // Intercepts all failures. - }; - - // The c'tor sets this object as the test part result reporter used - // by Google Test. The 'result' parameter specifies where to report the - // results. This reporter will only catch failures generated in the current - // thread. DEPRECATED - explicit ScopedFakeTestPartResultReporter(TestPartResultArray* result); - - // Same as above, but you can choose the interception scope of this object. - ScopedFakeTestPartResultReporter(InterceptMode intercept_mode, - TestPartResultArray* result); - - // The d'tor restores the previous test part result reporter. - virtual ~ScopedFakeTestPartResultReporter(); - - // Appends the TestPartResult object to the TestPartResultArray - // received in the constructor. - // - // This method is from the TestPartResultReporterInterface - // interface. - virtual void ReportTestPartResult(const TestPartResult& result); - private: - void Init(); - - const InterceptMode intercept_mode_; - TestPartResultReporterInterface* old_reporter_; - TestPartResultArray* const result_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedFakeTestPartResultReporter); -}; - -namespace internal { - -// A helper class for implementing EXPECT_FATAL_FAILURE() and -// EXPECT_NONFATAL_FAILURE(). Its destructor verifies that the given -// TestPartResultArray contains exactly one failure that has the given -// type and contains the given substring. If that's not the case, a -// non-fatal failure will be generated. -class GTEST_API_ SingleFailureChecker { - public: - // The constructor remembers the arguments. - SingleFailureChecker(const TestPartResultArray* results, - TestPartResult::Type type, - const string& substr); - ~SingleFailureChecker(); - private: - const TestPartResultArray* const results_; - const TestPartResult::Type type_; - const string substr_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(SingleFailureChecker); -}; - -} // namespace internal - -} // namespace testing - -// A set of macros for testing Google Test assertions or code that's expected -// to generate Google Test fatal failures. It verifies that the given -// statement will cause exactly one fatal Google Test failure with 'substr' -// being part of the failure message. -// -// There are two different versions of this macro. EXPECT_FATAL_FAILURE only -// affects and considers failures generated in the current thread and -// EXPECT_FATAL_FAILURE_ON_ALL_THREADS does the same but for all threads. -// -// The verification of the assertion is done correctly even when the statement -// throws an exception or aborts the current function. -// -// Known restrictions: -// - 'statement' cannot reference local non-static variables or -// non-static members of the current object. -// - 'statement' cannot return a value. -// - You cannot stream a failure message to this macro. -// -// Note that even though the implementations of the following two -// macros are much alike, we cannot refactor them to use a common -// helper macro, due to some peculiarity in how the preprocessor -// works. The AcceptsMacroThatExpandsToUnprotectedComma test in -// gtest_unittest.cc will fail to compile if we do that. -#define EXPECT_FATAL_FAILURE(statement, substr) \ - do { \ - class GTestExpectFatalFailureHelper {\ - public:\ - static void Execute() { statement; }\ - };\ - ::testing::TestPartResultArray gtest_failures;\ - ::testing::internal::SingleFailureChecker gtest_checker(\ - >est_failures, ::testing::TestPartResult::kFatalFailure, (substr));\ - {\ - ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\ - ::testing::ScopedFakeTestPartResultReporter:: \ - INTERCEPT_ONLY_CURRENT_THREAD, >est_failures);\ - GTestExpectFatalFailureHelper::Execute();\ - }\ - } while (::testing::internal::AlwaysFalse()) - -#define EXPECT_FATAL_FAILURE_ON_ALL_THREADS(statement, substr) \ - do { \ - class GTestExpectFatalFailureHelper {\ - public:\ - static void Execute() { statement; }\ - };\ - ::testing::TestPartResultArray gtest_failures;\ - ::testing::internal::SingleFailureChecker gtest_checker(\ - >est_failures, ::testing::TestPartResult::kFatalFailure, (substr));\ - {\ - ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\ - ::testing::ScopedFakeTestPartResultReporter:: \ - INTERCEPT_ALL_THREADS, >est_failures);\ - GTestExpectFatalFailureHelper::Execute();\ - }\ - } while (::testing::internal::AlwaysFalse()) - -// A macro for testing Google Test assertions or code that's expected to -// generate Google Test non-fatal failures. It asserts that the given -// statement will cause exactly one non-fatal Google Test failure with 'substr' -// being part of the failure message. -// -// There are two different versions of this macro. EXPECT_NONFATAL_FAILURE only -// affects and considers failures generated in the current thread and -// EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS does the same but for all threads. -// -// 'statement' is allowed to reference local variables and members of -// the current object. -// -// The verification of the assertion is done correctly even when the statement -// throws an exception or aborts the current function. -// -// Known restrictions: -// - You cannot stream a failure message to this macro. -// -// Note that even though the implementations of the following two -// macros are much alike, we cannot refactor them to use a common -// helper macro, due to some peculiarity in how the preprocessor -// works. If we do that, the code won't compile when the user gives -// EXPECT_NONFATAL_FAILURE() a statement that contains a macro that -// expands to code containing an unprotected comma. The -// AcceptsMacroThatExpandsToUnprotectedComma test in gtest_unittest.cc -// catches that. -// -// For the same reason, we have to write -// if (::testing::internal::AlwaysTrue()) { statement; } -// instead of -// GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) -// to avoid an MSVC warning on unreachable code. -#define EXPECT_NONFATAL_FAILURE(statement, substr) \ - do {\ - ::testing::TestPartResultArray gtest_failures;\ - ::testing::internal::SingleFailureChecker gtest_checker(\ - >est_failures, ::testing::TestPartResult::kNonFatalFailure, \ - (substr));\ - {\ - ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\ - ::testing::ScopedFakeTestPartResultReporter:: \ - INTERCEPT_ONLY_CURRENT_THREAD, >est_failures);\ - if (::testing::internal::AlwaysTrue()) { statement; }\ - }\ - } while (::testing::internal::AlwaysFalse()) - -#define EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(statement, substr) \ - do {\ - ::testing::TestPartResultArray gtest_failures;\ - ::testing::internal::SingleFailureChecker gtest_checker(\ - >est_failures, ::testing::TestPartResult::kNonFatalFailure, \ - (substr));\ - {\ - ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\ - ::testing::ScopedFakeTestPartResultReporter::INTERCEPT_ALL_THREADS, \ - >est_failures);\ - if (::testing::internal::AlwaysTrue()) { statement; }\ - }\ - } while (::testing::internal::AlwaysFalse()) - -#endif // GTEST_INCLUDE_GTEST_GTEST_SPI_H_ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include // NOLINT -#include -#include - -#if GTEST_OS_LINUX - -// TODO(kenton@google.com): Use autoconf to detect availability of -// gettimeofday(). -# define GTEST_HAS_GETTIMEOFDAY_ 1 - -# include // NOLINT -# include // NOLINT -# include // NOLINT -// Declares vsnprintf(). This header is not available on Windows. -# include // NOLINT -# include // NOLINT -# include // NOLINT -# include // NOLINT -# include - -#elif GTEST_OS_SYMBIAN -# define GTEST_HAS_GETTIMEOFDAY_ 1 -# include // NOLINT - -#elif GTEST_OS_ZOS -# define GTEST_HAS_GETTIMEOFDAY_ 1 -# include // NOLINT - -// On z/OS we additionally need strings.h for strcasecmp. -# include // NOLINT - -#elif GTEST_OS_WINDOWS_MOBILE // We are on Windows CE. - -# include // NOLINT - -#elif GTEST_OS_WINDOWS // We are on Windows proper. - -# include // NOLINT -# include // NOLINT -# include // NOLINT -# include // NOLINT - -# if GTEST_OS_WINDOWS_MINGW -// MinGW has gettimeofday() but not _ftime64(). -// TODO(kenton@google.com): Use autoconf to detect availability of -// gettimeofday(). -// TODO(kenton@google.com): There are other ways to get the time on -// Windows, like GetTickCount() or GetSystemTimeAsFileTime(). MinGW -// supports these. consider using them instead. -# define GTEST_HAS_GETTIMEOFDAY_ 1 -# include // NOLINT -# endif // GTEST_OS_WINDOWS_MINGW - -// cpplint thinks that the header is already included, so we want to -// silence it. -# include // NOLINT - -#else - -// Assume other platforms have gettimeofday(). -// TODO(kenton@google.com): Use autoconf to detect availability of -// gettimeofday(). -# define GTEST_HAS_GETTIMEOFDAY_ 1 - -// cpplint thinks that the header is already included, so we want to -// silence it. -# include // NOLINT -# include // NOLINT - -#endif // GTEST_OS_LINUX - -#if GTEST_HAS_EXCEPTIONS -# include -#endif - -#if GTEST_CAN_STREAM_RESULTS_ -# include // NOLINT -# include // NOLINT -#endif - -// Indicates that this translation unit is part of Google Test's -// implementation. It must come before gtest-internal-inl.h is -// included, or there will be a compiler error. This trick is to -// prevent a user from accidentally including gtest-internal-inl.h in -// his code. -#define GTEST_IMPLEMENTATION_ 1 -// Copyright 2005, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. 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. - -// Utility functions and classes used by the Google C++ testing framework. -// -// Author: wan@google.com (Zhanyong Wan) -// -// This file contains purely Google Test's internal implementation. Please -// DO NOT #INCLUDE IT IN A USER PROGRAM. - -#ifndef GTEST_SRC_GTEST_INTERNAL_INL_H_ -#define GTEST_SRC_GTEST_INTERNAL_INL_H_ - -// GTEST_IMPLEMENTATION_ is defined to 1 iff the current translation unit is -// part of Google Test's implementation; otherwise it's undefined. -#if !GTEST_IMPLEMENTATION_ -// A user is trying to include this from his code - just say no. -# error "gtest-internal-inl.h is part of Google Test's internal implementation." -# error "It must not be included except by Google Test itself." -#endif // GTEST_IMPLEMENTATION_ - -#ifndef _WIN32_WCE -# include -#endif // !_WIN32_WCE -#include -#include // For strtoll/_strtoul64/malloc/free. -#include // For memmove. - -#include -#include -#include - - -#if GTEST_CAN_STREAM_RESULTS_ -# include // NOLINT -# include // NOLINT -#endif - -#if GTEST_OS_WINDOWS -# include // NOLINT -#endif // GTEST_OS_WINDOWS - - -namespace testing { - -// Declares the flags. -// -// We don't want the users to modify this flag in the code, but want -// Google Test's own unit tests to be able to access it. Therefore we -// declare it here as opposed to in gtest.h. -GTEST_DECLARE_bool_(death_test_use_fork); - -namespace internal { - -// The value of GetTestTypeId() as seen from within the Google Test -// library. This is solely for testing GetTestTypeId(). -GTEST_API_ extern const TypeId kTestTypeIdInGoogleTest; - -// Names of the flags (needed for parsing Google Test flags). -const char kAlsoRunDisabledTestsFlag[] = "also_run_disabled_tests"; -const char kBreakOnFailureFlag[] = "break_on_failure"; -const char kCatchExceptionsFlag[] = "catch_exceptions"; -const char kColorFlag[] = "color"; -const char kFilterFlag[] = "filter"; -const char kListTestsFlag[] = "list_tests"; -const char kOutputFlag[] = "output"; -const char kPrintTimeFlag[] = "print_time"; -const char kRandomSeedFlag[] = "random_seed"; -const char kRepeatFlag[] = "repeat"; -const char kShuffleFlag[] = "shuffle"; -const char kStackTraceDepthFlag[] = "stack_trace_depth"; -const char kStreamResultToFlag[] = "stream_result_to"; -const char kThrowOnFailureFlag[] = "throw_on_failure"; - -// A valid random seed must be in [1, kMaxRandomSeed]. -const int kMaxRandomSeed = 99999; - -// g_help_flag is true iff the --help flag or an equivalent form is -// specified on the command line. -GTEST_API_ extern bool g_help_flag; - -// Returns the current time in milliseconds. -GTEST_API_ TimeInMillis GetTimeInMillis(); - -// Returns true iff Google Test should use colors in the output. -GTEST_API_ bool ShouldUseColor(bool stdout_is_tty); - -// Formats the given time in milliseconds as seconds. -GTEST_API_ std::string FormatTimeInMillisAsSeconds(TimeInMillis ms); - -// Converts the given time in milliseconds to a date string in the ISO 8601 -// format, without the timezone information. N.B.: due to the use the -// non-reentrant localtime() function, this function is not thread safe. Do -// not use it in any code that can be called from multiple threads. -GTEST_API_ std::string FormatEpochTimeInMillisAsIso8601(TimeInMillis ms); - -// Parses a string for an Int32 flag, in the form of "--flag=value". -// -// On success, stores the value of the flag in *value, and returns -// true. On failure, returns false without changing *value. -GTEST_API_ bool ParseInt32Flag( - const char* str, const char* flag, Int32* value); - -// Returns a random seed in range [1, kMaxRandomSeed] based on the -// given --gtest_random_seed flag value. -inline int GetRandomSeedFromFlag(Int32 random_seed_flag) { - const unsigned int raw_seed = (random_seed_flag == 0) ? - static_cast(GetTimeInMillis()) : - static_cast(random_seed_flag); - - // Normalizes the actual seed to range [1, kMaxRandomSeed] such that - // it's easy to type. - const int normalized_seed = - static_cast((raw_seed - 1U) % - static_cast(kMaxRandomSeed)) + 1; - return normalized_seed; -} - -// Returns the first valid random seed after 'seed'. The behavior is -// undefined if 'seed' is invalid. The seed after kMaxRandomSeed is -// considered to be 1. -inline int GetNextRandomSeed(int seed) { - GTEST_CHECK_(1 <= seed && seed <= kMaxRandomSeed) - << "Invalid random seed " << seed << " - must be in [1, " - << kMaxRandomSeed << "]."; - const int next_seed = seed + 1; - return (next_seed > kMaxRandomSeed) ? 1 : next_seed; -} - -// This class saves the values of all Google Test flags in its c'tor, and -// restores them in its d'tor. -class GTestFlagSaver { - public: - // The c'tor. - GTestFlagSaver() { - also_run_disabled_tests_ = GTEST_FLAG(also_run_disabled_tests); - break_on_failure_ = GTEST_FLAG(break_on_failure); - catch_exceptions_ = GTEST_FLAG(catch_exceptions); - color_ = GTEST_FLAG(color); - death_test_style_ = GTEST_FLAG(death_test_style); - death_test_use_fork_ = GTEST_FLAG(death_test_use_fork); - filter_ = GTEST_FLAG(filter); - internal_run_death_test_ = GTEST_FLAG(internal_run_death_test); - list_tests_ = GTEST_FLAG(list_tests); - output_ = GTEST_FLAG(output); - print_time_ = GTEST_FLAG(print_time); - random_seed_ = GTEST_FLAG(random_seed); - repeat_ = GTEST_FLAG(repeat); - shuffle_ = GTEST_FLAG(shuffle); - stack_trace_depth_ = GTEST_FLAG(stack_trace_depth); - stream_result_to_ = GTEST_FLAG(stream_result_to); - throw_on_failure_ = GTEST_FLAG(throw_on_failure); - } - - // The d'tor is not virtual. DO NOT INHERIT FROM THIS CLASS. - ~GTestFlagSaver() { - GTEST_FLAG(also_run_disabled_tests) = also_run_disabled_tests_; - GTEST_FLAG(break_on_failure) = break_on_failure_; - GTEST_FLAG(catch_exceptions) = catch_exceptions_; - GTEST_FLAG(color) = color_; - GTEST_FLAG(death_test_style) = death_test_style_; - GTEST_FLAG(death_test_use_fork) = death_test_use_fork_; - GTEST_FLAG(filter) = filter_; - GTEST_FLAG(internal_run_death_test) = internal_run_death_test_; - GTEST_FLAG(list_tests) = list_tests_; - GTEST_FLAG(output) = output_; - GTEST_FLAG(print_time) = print_time_; - GTEST_FLAG(random_seed) = random_seed_; - GTEST_FLAG(repeat) = repeat_; - GTEST_FLAG(shuffle) = shuffle_; - GTEST_FLAG(stack_trace_depth) = stack_trace_depth_; - GTEST_FLAG(stream_result_to) = stream_result_to_; - GTEST_FLAG(throw_on_failure) = throw_on_failure_; - } - - private: - // Fields for saving the original values of flags. - bool also_run_disabled_tests_; - bool break_on_failure_; - bool catch_exceptions_; - std::string color_; - std::string death_test_style_; - bool death_test_use_fork_; - std::string filter_; - std::string internal_run_death_test_; - bool list_tests_; - std::string output_; - bool print_time_; - internal::Int32 random_seed_; - internal::Int32 repeat_; - bool shuffle_; - internal::Int32 stack_trace_depth_; - std::string stream_result_to_; - bool throw_on_failure_; -} GTEST_ATTRIBUTE_UNUSED_; - -// Converts a Unicode code point to a narrow string in UTF-8 encoding. -// code_point parameter is of type UInt32 because wchar_t may not be -// wide enough to contain a code point. -// If the code_point is not a valid Unicode code point -// (i.e. outside of Unicode range U+0 to U+10FFFF) it will be converted -// to "(Invalid Unicode 0xXXXXXXXX)". -GTEST_API_ std::string CodePointToUtf8(UInt32 code_point); - -// Converts a wide string to a narrow string in UTF-8 encoding. -// The wide string is assumed to have the following encoding: -// UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS) -// UTF-32 if sizeof(wchar_t) == 4 (on Linux) -// Parameter str points to a null-terminated wide string. -// Parameter num_chars may additionally limit the number -// of wchar_t characters processed. -1 is used when the entire string -// should be processed. -// If the string contains code points that are not valid Unicode code points -// (i.e. outside of Unicode range U+0 to U+10FFFF) they will be output -// as '(Invalid Unicode 0xXXXXXXXX)'. If the string is in UTF16 encoding -// and contains invalid UTF-16 surrogate pairs, values in those pairs -// will be encoded as individual Unicode characters from Basic Normal Plane. -GTEST_API_ std::string WideStringToUtf8(const wchar_t* str, int num_chars); - -// Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file -// if the variable is present. If a file already exists at this location, this -// function will write over it. If the variable is present, but the file cannot -// be created, prints an error and exits. -void WriteToShardStatusFileIfNeeded(); - -// Checks whether sharding is enabled by examining the relevant -// environment variable values. If the variables are present, -// but inconsistent (e.g., shard_index >= total_shards), prints -// an error and exits. If in_subprocess_for_death_test, sharding is -// disabled because it must only be applied to the original test -// process. Otherwise, we could filter out death tests we intended to execute. -GTEST_API_ bool ShouldShard(const char* total_shards_str, - const char* shard_index_str, - bool in_subprocess_for_death_test); - -// Parses the environment variable var as an Int32. If it is unset, -// returns default_val. If it is not an Int32, prints an error and -// and aborts. -GTEST_API_ Int32 Int32FromEnvOrDie(const char* env_var, Int32 default_val); - -// Given the total number of shards, the shard index, and the test id, -// returns true iff the test should be run on this shard. The test id is -// some arbitrary but unique non-negative integer assigned to each test -// method. Assumes that 0 <= shard_index < total_shards. -GTEST_API_ bool ShouldRunTestOnShard( - int total_shards, int shard_index, int test_id); - -// STL container utilities. - -// Returns the number of elements in the given container that satisfy -// the given predicate. -template -inline int CountIf(const Container& c, Predicate predicate) { - // Implemented as an explicit loop since std::count_if() in libCstd on - // Solaris has a non-standard signature. - int count = 0; - for (typename Container::const_iterator it = c.begin(); it != c.end(); ++it) { - if (predicate(*it)) - ++count; - } - return count; -} - -// Applies a function/functor to each element in the container. -template -void ForEach(const Container& c, Functor functor) { - std::for_each(c.begin(), c.end(), functor); -} - -// Returns the i-th element of the vector, or default_value if i is not -// in range [0, v.size()). -template -inline E GetElementOr(const std::vector& v, int i, E default_value) { - return (i < 0 || i >= static_cast(v.size())) ? default_value : v[i]; -} - -// Performs an in-place shuffle of a range of the vector's elements. -// 'begin' and 'end' are element indices as an STL-style range; -// i.e. [begin, end) are shuffled, where 'end' == size() means to -// shuffle to the end of the vector. -template -void ShuffleRange(internal::Random* random, int begin, int end, - std::vector* v) { - const int size = static_cast(v->size()); - GTEST_CHECK_(0 <= begin && begin <= size) - << "Invalid shuffle range start " << begin << ": must be in range [0, " - << size << "]."; - GTEST_CHECK_(begin <= end && end <= size) - << "Invalid shuffle range finish " << end << ": must be in range [" - << begin << ", " << size << "]."; - - // Fisher-Yates shuffle, from - // http://en.wikipedia.org/wiki/Fisher-Yates_shuffle - for (int range_width = end - begin; range_width >= 2; range_width--) { - const int last_in_range = begin + range_width - 1; - const int selected = begin + random->Generate(range_width); - std::swap((*v)[selected], (*v)[last_in_range]); - } -} - -// Performs an in-place shuffle of the vector's elements. -template -inline void Shuffle(internal::Random* random, std::vector* v) { - ShuffleRange(random, 0, static_cast(v->size()), v); -} - -// A function for deleting an object. Handy for being used as a -// functor. -template -static void Delete(T* x) { - delete x; -} - -// A predicate that checks the key of a TestProperty against a known key. -// -// TestPropertyKeyIs is copyable. -class TestPropertyKeyIs { - public: - // Constructor. - // - // TestPropertyKeyIs has NO default constructor. - explicit TestPropertyKeyIs(const std::string& key) : key_(key) {} - - // Returns true iff the test name of test property matches on key_. - bool operator()(const TestProperty& test_property) const { - return test_property.key() == key_; - } - - private: - std::string key_; -}; - -// Class UnitTestOptions. -// -// This class contains functions for processing options the user -// specifies when running the tests. It has only static members. -// -// In most cases, the user can specify an option using either an -// environment variable or a command line flag. E.g. you can set the -// test filter using either GTEST_FILTER or --gtest_filter. If both -// the variable and the flag are present, the latter overrides the -// former. -class GTEST_API_ UnitTestOptions { - public: - // Functions for processing the gtest_output flag. - - // Returns the output format, or "" for normal printed output. - static std::string GetOutputFormat(); - - // Returns the absolute path of the requested output file, or the - // default (test_detail.xml in the original working directory) if - // none was explicitly specified. - static std::string GetAbsolutePathToOutputFile(); - - // Functions for processing the gtest_filter flag. - - // Returns true iff the wildcard pattern matches the string. The - // first ':' or '\0' character in pattern marks the end of it. - // - // This recursive algorithm isn't very efficient, but is clear and - // works well enough for matching test names, which are short. - static bool PatternMatchesString(const char *pattern, const char *str); - - // Returns true iff the user-specified filter matches the test case - // name and the test name. - static bool FilterMatchesTest(const std::string &test_case_name, - const std::string &test_name); - -#if GTEST_OS_WINDOWS - // Function for supporting the gtest_catch_exception flag. - - // Returns EXCEPTION_EXECUTE_HANDLER if Google Test should handle the - // given SEH exception, or EXCEPTION_CONTINUE_SEARCH otherwise. - // This function is useful as an __except condition. - static int GTestShouldProcessSEH(DWORD exception_code); -#endif // GTEST_OS_WINDOWS - - // Returns true if "name" matches the ':' separated list of glob-style - // filters in "filter". - static bool MatchesFilter(const std::string& name, const char* filter); -}; - -// Returns the current application's name, removing directory path if that -// is present. Used by UnitTestOptions::GetOutputFile. -GTEST_API_ FilePath GetCurrentExecutableName(); - -// The role interface for getting the OS stack trace as a string. -class OsStackTraceGetterInterface { - public: - OsStackTraceGetterInterface() {} - virtual ~OsStackTraceGetterInterface() {} - - // Returns the current OS stack trace as an std::string. Parameters: - // - // max_depth - the maximum number of stack frames to be included - // in the trace. - // skip_count - the number of top frames to be skipped; doesn't count - // against max_depth. - virtual string CurrentStackTrace(int max_depth, int skip_count) = 0; - - // UponLeavingGTest() should be called immediately before Google Test calls - // user code. It saves some information about the current stack that - // CurrentStackTrace() will use to find and hide Google Test stack frames. - virtual void UponLeavingGTest() = 0; - - private: - GTEST_DISALLOW_COPY_AND_ASSIGN_(OsStackTraceGetterInterface); -}; - -// A working implementation of the OsStackTraceGetterInterface interface. -class OsStackTraceGetter : public OsStackTraceGetterInterface { - public: - OsStackTraceGetter() : caller_frame_(NULL) {} - - virtual string CurrentStackTrace(int max_depth, int skip_count) - GTEST_LOCK_EXCLUDED_(mutex_); - - virtual void UponLeavingGTest() GTEST_LOCK_EXCLUDED_(mutex_); - - // This string is inserted in place of stack frames that are part of - // Google Test's implementation. - static const char* const kElidedFramesMarker; - - private: - Mutex mutex_; // protects all internal state - - // We save the stack frame below the frame that calls user code. - // We do this because the address of the frame immediately below - // the user code changes between the call to UponLeavingGTest() - // and any calls to CurrentStackTrace() from within the user code. - void* caller_frame_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(OsStackTraceGetter); -}; - -// Information about a Google Test trace point. -struct TraceInfo { - const char* file; - int line; - std::string message; -}; - -// This is the default global test part result reporter used in UnitTestImpl. -// This class should only be used by UnitTestImpl. -class DefaultGlobalTestPartResultReporter - : public TestPartResultReporterInterface { - public: - explicit DefaultGlobalTestPartResultReporter(UnitTestImpl* unit_test); - // Implements the TestPartResultReporterInterface. Reports the test part - // result in the current test. - virtual void ReportTestPartResult(const TestPartResult& result); - - private: - UnitTestImpl* const unit_test_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultGlobalTestPartResultReporter); -}; - -// This is the default per thread test part result reporter used in -// UnitTestImpl. This class should only be used by UnitTestImpl. -class DefaultPerThreadTestPartResultReporter - : public TestPartResultReporterInterface { - public: - explicit DefaultPerThreadTestPartResultReporter(UnitTestImpl* unit_test); - // Implements the TestPartResultReporterInterface. The implementation just - // delegates to the current global test part result reporter of *unit_test_. - virtual void ReportTestPartResult(const TestPartResult& result); - - private: - UnitTestImpl* const unit_test_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultPerThreadTestPartResultReporter); -}; - -// The private implementation of the UnitTest class. We don't protect -// the methods under a mutex, as this class is not accessible by a -// user and the UnitTest class that delegates work to this class does -// proper locking. -class GTEST_API_ UnitTestImpl { - public: - explicit UnitTestImpl(UnitTest* parent); - virtual ~UnitTestImpl(); - - // There are two different ways to register your own TestPartResultReporter. - // You can register your own repoter to listen either only for test results - // from the current thread or for results from all threads. - // By default, each per-thread test result repoter just passes a new - // TestPartResult to the global test result reporter, which registers the - // test part result for the currently running test. - - // Returns the global test part result reporter. - TestPartResultReporterInterface* GetGlobalTestPartResultReporter(); - - // Sets the global test part result reporter. - void SetGlobalTestPartResultReporter( - TestPartResultReporterInterface* reporter); - - // Returns the test part result reporter for the current thread. - TestPartResultReporterInterface* GetTestPartResultReporterForCurrentThread(); - - // Sets the test part result reporter for the current thread. - void SetTestPartResultReporterForCurrentThread( - TestPartResultReporterInterface* reporter); - - // Gets the number of successful test cases. - int successful_test_case_count() const; - - // Gets the number of failed test cases. - int failed_test_case_count() const; - - // Gets the number of all test cases. - int total_test_case_count() const; - - // Gets the number of all test cases that contain at least one test - // that should run. - int test_case_to_run_count() const; - - // Gets the number of successful tests. - int successful_test_count() const; - - // Gets the number of failed tests. - int failed_test_count() const; - - // Gets the number of disabled tests that will be reported in the XML report. - int reportable_disabled_test_count() const; - - // Gets the number of disabled tests. - int disabled_test_count() const; - - // Gets the number of tests to be printed in the XML report. - int reportable_test_count() const; - - // Gets the number of all tests. - int total_test_count() const; - - // Gets the number of tests that should run. - int test_to_run_count() const; - - // Gets the time of the test program start, in ms from the start of the - // UNIX epoch. - TimeInMillis start_timestamp() const { return start_timestamp_; } - - // Gets the elapsed time, in milliseconds. - TimeInMillis elapsed_time() const { return elapsed_time_; } - - // Returns true iff the unit test passed (i.e. all test cases passed). - bool Passed() const { return !Failed(); } - - // Returns true iff the unit test failed (i.e. some test case failed - // or something outside of all tests failed). - bool Failed() const { - return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed(); - } - - // Gets the i-th test case among all the test cases. i can range from 0 to - // total_test_case_count() - 1. If i is not in that range, returns NULL. - const TestCase* GetTestCase(int i) const { - const int index = GetElementOr(test_case_indices_, i, -1); - return index < 0 ? NULL : test_cases_[i]; - } - - // Gets the i-th test case among all the test cases. i can range from 0 to - // total_test_case_count() - 1. If i is not in that range, returns NULL. - TestCase* GetMutableTestCase(int i) { - const int index = GetElementOr(test_case_indices_, i, -1); - return index < 0 ? NULL : test_cases_[index]; - } - - // Provides access to the event listener list. - TestEventListeners* listeners() { return &listeners_; } - - // Returns the TestResult for the test that's currently running, or - // the TestResult for the ad hoc test if no test is running. - TestResult* current_test_result(); - - // Returns the TestResult for the ad hoc test. - const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; } - - // Sets the OS stack trace getter. - // - // Does nothing if the input and the current OS stack trace getter - // are the same; otherwise, deletes the old getter and makes the - // input the current getter. - void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter); - - // Returns the current OS stack trace getter if it is not NULL; - // otherwise, creates an OsStackTraceGetter, makes it the current - // getter, and returns it. - OsStackTraceGetterInterface* os_stack_trace_getter(); - - // Returns the current OS stack trace as an std::string. - // - // The maximum number of stack frames to be included is specified by - // the gtest_stack_trace_depth flag. The skip_count parameter - // specifies the number of top frames to be skipped, which doesn't - // count against the number of frames to be included. - // - // For example, if Foo() calls Bar(), which in turn calls - // CurrentOsStackTraceExceptTop(1), Foo() will be included in the - // trace but Bar() and CurrentOsStackTraceExceptTop() won't. - std::string CurrentOsStackTraceExceptTop(int skip_count) GTEST_NO_INLINE_; - - // Finds and returns a TestCase with the given name. If one doesn't - // exist, creates one and returns it. - // - // Arguments: - // - // test_case_name: name of the test case - // type_param: the name of the test's type parameter, or NULL if - // this is not a typed or a type-parameterized test. - // set_up_tc: pointer to the function that sets up the test case - // tear_down_tc: pointer to the function that tears down the test case - TestCase* GetTestCase(const char* test_case_name, - const char* type_param, - Test::SetUpTestCaseFunc set_up_tc, - Test::TearDownTestCaseFunc tear_down_tc); - - // Adds a TestInfo to the unit test. - // - // Arguments: - // - // set_up_tc: pointer to the function that sets up the test case - // tear_down_tc: pointer to the function that tears down the test case - // test_info: the TestInfo object - void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc, - Test::TearDownTestCaseFunc tear_down_tc, - TestInfo* test_info) { - // In order to support thread-safe death tests, we need to - // remember the original working directory when the test program - // was first invoked. We cannot do this in RUN_ALL_TESTS(), as - // the user may have changed the current directory before calling - // RUN_ALL_TESTS(). Therefore we capture the current directory in - // AddTestInfo(), which is called to register a TEST or TEST_F - // before main() is reached. - if (original_working_dir_.IsEmpty()) { - original_working_dir_.Set(FilePath::GetCurrentDir()); - GTEST_CHECK_(!original_working_dir_.IsEmpty()) - << "Failed to get the current working directory."; - } - - GetTestCase(test_info->test_case_name(), - test_info->type_param(), - set_up_tc, - tear_down_tc)->AddTestInfo(test_info); - } - -#if GTEST_HAS_PARAM_TEST - // Returns ParameterizedTestCaseRegistry object used to keep track of - // value-parameterized tests and instantiate and register them. - internal::ParameterizedTestCaseRegistry& parameterized_test_registry() { - return parameterized_test_registry_; - } -#endif // GTEST_HAS_PARAM_TEST - - // Sets the TestCase object for the test that's currently running. - void set_current_test_case(TestCase* a_current_test_case) { - current_test_case_ = a_current_test_case; - } - - // Sets the TestInfo object for the test that's currently running. If - // current_test_info is NULL, the assertion results will be stored in - // ad_hoc_test_result_. - void set_current_test_info(TestInfo* a_current_test_info) { - current_test_info_ = a_current_test_info; - } - - // Registers all parameterized tests defined using TEST_P and - // INSTANTIATE_TEST_CASE_P, creating regular tests for each test/parameter - // combination. This method can be called more then once; it has guards - // protecting from registering the tests more then once. If - // value-parameterized tests are disabled, RegisterParameterizedTests is - // present but does nothing. - void RegisterParameterizedTests(); - - // Runs all tests in this UnitTest object, prints the result, and - // returns true if all tests are successful. If any exception is - // thrown during a test, this test is considered to be failed, but - // the rest of the tests will still be run. - bool RunAllTests(); - - // Clears the results of all tests, except the ad hoc tests. - void ClearNonAdHocTestResult() { - ForEach(test_cases_, TestCase::ClearTestCaseResult); - } - - // Clears the results of ad-hoc test assertions. - void ClearAdHocTestResult() { - ad_hoc_test_result_.Clear(); - } - - // Adds a TestProperty to the current TestResult object when invoked in a - // context of a test or a test case, or to the global property set. If the - // result already contains a property with the same key, the value will be - // updated. - void RecordProperty(const TestProperty& test_property); - - enum ReactionToSharding { - HONOR_SHARDING_PROTOCOL, - IGNORE_SHARDING_PROTOCOL - }; - - // Matches the full name of each test against the user-specified - // filter to decide whether the test should run, then records the - // result in each TestCase and TestInfo object. - // If shard_tests == HONOR_SHARDING_PROTOCOL, further filters tests - // based on sharding variables in the environment. - // Returns the number of tests that should run. - int FilterTests(ReactionToSharding shard_tests); - - // Prints the names of the tests matching the user-specified filter flag. - void ListTestsMatchingFilter(); - - const TestCase* current_test_case() const { return current_test_case_; } - TestInfo* current_test_info() { return current_test_info_; } - const TestInfo* current_test_info() const { return current_test_info_; } - - // Returns the vector of environments that need to be set-up/torn-down - // before/after the tests are run. - std::vector& environments() { return environments_; } - - // Getters for the per-thread Google Test trace stack. - std::vector& gtest_trace_stack() { - return *(gtest_trace_stack_.pointer()); - } - const std::vector& gtest_trace_stack() const { - return gtest_trace_stack_.get(); - } - -#if GTEST_HAS_DEATH_TEST - void InitDeathTestSubprocessControlInfo() { - internal_run_death_test_flag_.reset(ParseInternalRunDeathTestFlag()); - } - // Returns a pointer to the parsed --gtest_internal_run_death_test - // flag, or NULL if that flag was not specified. - // This information is useful only in a death test child process. - // Must not be called before a call to InitGoogleTest. - const InternalRunDeathTestFlag* internal_run_death_test_flag() const { - return internal_run_death_test_flag_.get(); - } - - // Returns a pointer to the current death test factory. - internal::DeathTestFactory* death_test_factory() { - return death_test_factory_.get(); - } - - void SuppressTestEventsIfInSubprocess(); - - friend class ReplaceDeathTestFactory; -#endif // GTEST_HAS_DEATH_TEST - - // Initializes the event listener performing XML output as specified by - // UnitTestOptions. Must not be called before InitGoogleTest. - void ConfigureXmlOutput(); - -#if GTEST_CAN_STREAM_RESULTS_ - // Initializes the event listener for streaming test results to a socket. - // Must not be called before InitGoogleTest. - void ConfigureStreamingOutput(); -#endif - - // Performs initialization dependent upon flag values obtained in - // ParseGoogleTestFlagsOnly. Is called from InitGoogleTest after the call to - // ParseGoogleTestFlagsOnly. In case a user neglects to call InitGoogleTest - // this function is also called from RunAllTests. Since this function can be - // called more than once, it has to be idempotent. - void PostFlagParsingInit(); - - // Gets the random seed used at the start of the current test iteration. - int random_seed() const { return random_seed_; } - - // Gets the random number generator. - internal::Random* random() { return &random_; } - - // Shuffles all test cases, and the tests within each test case, - // making sure that death tests are still run first. - void ShuffleTests(); - - // Restores the test cases and tests to their order before the first shuffle. - void UnshuffleTests(); - - // Returns the value of GTEST_FLAG(catch_exceptions) at the moment - // UnitTest::Run() starts. - bool catch_exceptions() const { return catch_exceptions_; } - - private: - friend class ::testing::UnitTest; - - // Used by UnitTest::Run() to capture the state of - // GTEST_FLAG(catch_exceptions) at the moment it starts. - void set_catch_exceptions(bool value) { catch_exceptions_ = value; } - - // The UnitTest object that owns this implementation object. - UnitTest* const parent_; - - // The working directory when the first TEST() or TEST_F() was - // executed. - internal::FilePath original_working_dir_; - - // The default test part result reporters. - DefaultGlobalTestPartResultReporter default_global_test_part_result_reporter_; - DefaultPerThreadTestPartResultReporter - default_per_thread_test_part_result_reporter_; - - // Points to (but doesn't own) the global test part result reporter. - TestPartResultReporterInterface* global_test_part_result_repoter_; - - // Protects read and write access to global_test_part_result_reporter_. - internal::Mutex global_test_part_result_reporter_mutex_; - - // Points to (but doesn't own) the per-thread test part result reporter. - internal::ThreadLocal - per_thread_test_part_result_reporter_; - - // The vector of environments that need to be set-up/torn-down - // before/after the tests are run. - std::vector environments_; - - // The vector of TestCases in their original order. It owns the - // elements in the vector. - std::vector test_cases_; - - // Provides a level of indirection for the test case list to allow - // easy shuffling and restoring the test case order. The i-th - // element of this vector is the index of the i-th test case in the - // shuffled order. - std::vector test_case_indices_; - -#if GTEST_HAS_PARAM_TEST - // ParameterizedTestRegistry object used to register value-parameterized - // tests. - internal::ParameterizedTestCaseRegistry parameterized_test_registry_; - - // Indicates whether RegisterParameterizedTests() has been called already. - bool parameterized_tests_registered_; -#endif // GTEST_HAS_PARAM_TEST - - // Index of the last death test case registered. Initially -1. - int last_death_test_case_; - - // This points to the TestCase for the currently running test. It - // changes as Google Test goes through one test case after another. - // When no test is running, this is set to NULL and Google Test - // stores assertion results in ad_hoc_test_result_. Initially NULL. - TestCase* current_test_case_; - - // This points to the TestInfo for the currently running test. It - // changes as Google Test goes through one test after another. When - // no test is running, this is set to NULL and Google Test stores - // assertion results in ad_hoc_test_result_. Initially NULL. - TestInfo* current_test_info_; - - // Normally, a user only writes assertions inside a TEST or TEST_F, - // or inside a function called by a TEST or TEST_F. Since Google - // Test keeps track of which test is current running, it can - // associate such an assertion with the test it belongs to. - // - // If an assertion is encountered when no TEST or TEST_F is running, - // Google Test attributes the assertion result to an imaginary "ad hoc" - // test, and records the result in ad_hoc_test_result_. - TestResult ad_hoc_test_result_; - - // The list of event listeners that can be used to track events inside - // Google Test. - TestEventListeners listeners_; - - // The OS stack trace getter. Will be deleted when the UnitTest - // object is destructed. By default, an OsStackTraceGetter is used, - // but the user can set this field to use a custom getter if that is - // desired. - OsStackTraceGetterInterface* os_stack_trace_getter_; - - // True iff PostFlagParsingInit() has been called. - bool post_flag_parse_init_performed_; - - // The random number seed used at the beginning of the test run. - int random_seed_; - - // Our random number generator. - internal::Random random_; - - // The time of the test program start, in ms from the start of the - // UNIX epoch. - TimeInMillis start_timestamp_; - - // How long the test took to run, in milliseconds. - TimeInMillis elapsed_time_; - -#if GTEST_HAS_DEATH_TEST - // The decomposed components of the gtest_internal_run_death_test flag, - // parsed when RUN_ALL_TESTS is called. - internal::scoped_ptr internal_run_death_test_flag_; - internal::scoped_ptr death_test_factory_; -#endif // GTEST_HAS_DEATH_TEST - - // A per-thread stack of traces created by the SCOPED_TRACE() macro. - internal::ThreadLocal > gtest_trace_stack_; - - // The value of GTEST_FLAG(catch_exceptions) at the moment RunAllTests() - // starts. - bool catch_exceptions_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTestImpl); -}; // class UnitTestImpl - -// Convenience function for accessing the global UnitTest -// implementation object. -inline UnitTestImpl* GetUnitTestImpl() { - return UnitTest::GetInstance()->impl(); -} - -#if GTEST_USES_SIMPLE_RE - -// Internal helper functions for implementing the simple regular -// expression matcher. -GTEST_API_ bool IsInSet(char ch, const char* str); -GTEST_API_ bool IsAsciiDigit(char ch); -GTEST_API_ bool IsAsciiPunct(char ch); -GTEST_API_ bool IsRepeat(char ch); -GTEST_API_ bool IsAsciiWhiteSpace(char ch); -GTEST_API_ bool IsAsciiWordChar(char ch); -GTEST_API_ bool IsValidEscape(char ch); -GTEST_API_ bool AtomMatchesChar(bool escaped, char pattern, char ch); -GTEST_API_ bool ValidateRegex(const char* regex); -GTEST_API_ bool MatchRegexAtHead(const char* regex, const char* str); -GTEST_API_ bool MatchRepetitionAndRegexAtHead( - bool escaped, char ch, char repeat, const char* regex, const char* str); -GTEST_API_ bool MatchRegexAnywhere(const char* regex, const char* str); - -#endif // GTEST_USES_SIMPLE_RE - -// Parses the command line for Google Test flags, without initializing -// other parts of Google Test. -GTEST_API_ void ParseGoogleTestFlagsOnly(int* argc, char** argv); -GTEST_API_ void ParseGoogleTestFlagsOnly(int* argc, wchar_t** argv); - -#if GTEST_HAS_DEATH_TEST - -// Returns the message describing the last system error, regardless of the -// platform. -GTEST_API_ std::string GetLastErrnoDescription(); - -# if GTEST_OS_WINDOWS -// Provides leak-safe Windows kernel handle ownership. -class AutoHandle { - public: - AutoHandle() : handle_(INVALID_HANDLE_VALUE) {} - explicit AutoHandle(HANDLE handle) : handle_(handle) {} - - ~AutoHandle() { Reset(); } - - HANDLE Get() const { return handle_; } - void Reset() { Reset(INVALID_HANDLE_VALUE); } - void Reset(HANDLE handle) { - if (handle != handle_) { - if (handle_ != INVALID_HANDLE_VALUE) - ::CloseHandle(handle_); - handle_ = handle; - } - } - - private: - HANDLE handle_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(AutoHandle); -}; -# endif // GTEST_OS_WINDOWS - -// Attempts to parse a string into a positive integer pointed to by the -// number parameter. Returns true if that is possible. -// GTEST_HAS_DEATH_TEST implies that we have ::std::string, so we can use -// it here. -template -bool ParseNaturalNumber(const ::std::string& str, Integer* number) { - // Fail fast if the given string does not begin with a digit; - // this bypasses strtoXXX's "optional leading whitespace and plus - // or minus sign" semantics, which are undesirable here. - if (str.empty() || !IsDigit(str[0])) { - return false; - } - errno = 0; - - char* end; - // BiggestConvertible is the largest integer type that system-provided - // string-to-number conversion routines can return. - -# if GTEST_OS_WINDOWS && !defined(__GNUC__) - - // MSVC and C++ Builder define __int64 instead of the standard long long. - typedef unsigned __int64 BiggestConvertible; - const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10); - -# else - - typedef unsigned long long BiggestConvertible; // NOLINT - const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10); - -# endif // GTEST_OS_WINDOWS && !defined(__GNUC__) - - const bool parse_success = *end == '\0' && errno == 0; - - // TODO(vladl@google.com): Convert this to compile time assertion when it is - // available. - GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed)); - - const Integer result = static_cast(parsed); - if (parse_success && static_cast(result) == parsed) { - *number = result; - return true; - } - return false; -} -#endif // GTEST_HAS_DEATH_TEST - -// TestResult contains some private methods that should be hidden from -// Google Test user but are required for testing. This class allow our tests -// to access them. -// -// This class is supplied only for the purpose of testing Google Test's own -// constructs. Do not use it in user tests, either directly or indirectly. -class TestResultAccessor { - public: - static void RecordProperty(TestResult* test_result, - const std::string& xml_element, - const TestProperty& property) { - test_result->RecordProperty(xml_element, property); - } - - static void ClearTestPartResults(TestResult* test_result) { - test_result->ClearTestPartResults(); - } - - static const std::vector& test_part_results( - const TestResult& test_result) { - return test_result.test_part_results(); - } -}; - -#if GTEST_CAN_STREAM_RESULTS_ - -// Streams test results to the given port on the given host machine. -class StreamingListener : public EmptyTestEventListener { - public: - // Abstract base class for writing strings to a socket. - class AbstractSocketWriter { - public: - virtual ~AbstractSocketWriter() {} - - // Sends a string to the socket. - virtual void Send(const string& message) = 0; - - // Closes the socket. - virtual void CloseConnection() {} - - // Sends a string and a newline to the socket. - void SendLn(const string& message) { - Send(message + "\n"); - } - }; - - // Concrete class for actually writing strings to a socket. - class SocketWriter : public AbstractSocketWriter { - public: - SocketWriter(const string& host, const string& port) - : sockfd_(-1), host_name_(host), port_num_(port) { - MakeConnection(); - } - - virtual ~SocketWriter() { - if (sockfd_ != -1) - CloseConnection(); - } - - // Sends a string to the socket. - virtual void Send(const string& message) { - GTEST_CHECK_(sockfd_ != -1) - << "Send() can be called only when there is a connection."; - - const int len = static_cast(message.length()); - if (write(sockfd_, message.c_str(), len) != len) { - GTEST_LOG_(WARNING) - << "stream_result_to: failed to stream to " - << host_name_ << ":" << port_num_; - } - } - - private: - // Creates a client socket and connects to the server. - void MakeConnection(); - - // Closes the socket. - void CloseConnection() { - GTEST_CHECK_(sockfd_ != -1) - << "CloseConnection() can be called only when there is a connection."; - - close(sockfd_); - sockfd_ = -1; - } - - int sockfd_; // socket file descriptor - const string host_name_; - const string port_num_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(SocketWriter); - }; // class SocketWriter - - // Escapes '=', '&', '%', and '\n' characters in str as "%xx". - static string UrlEncode(const char* str); - - StreamingListener(const string& host, const string& port) - : socket_writer_(new SocketWriter(host, port)) { Start(); } - - explicit StreamingListener(AbstractSocketWriter* socket_writer) - : socket_writer_(socket_writer) { Start(); } - - void OnTestProgramStart(const UnitTest& /* unit_test */) { - SendLn("event=TestProgramStart"); - } - - void OnTestProgramEnd(const UnitTest& unit_test) { - // Note that Google Test current only report elapsed time for each - // test iteration, not for the entire test program. - SendLn("event=TestProgramEnd&passed=" + FormatBool(unit_test.Passed())); - - // Notify the streaming server to stop. - socket_writer_->CloseConnection(); - } - - void OnTestIterationStart(const UnitTest& /* unit_test */, int iteration) { - SendLn("event=TestIterationStart&iteration=" + - StreamableToString(iteration)); - } - - void OnTestIterationEnd(const UnitTest& unit_test, int /* iteration */) { - SendLn("event=TestIterationEnd&passed=" + - FormatBool(unit_test.Passed()) + "&elapsed_time=" + - StreamableToString(unit_test.elapsed_time()) + "ms"); - } - - void OnTestCaseStart(const TestCase& test_case) { - SendLn(std::string("event=TestCaseStart&name=") + test_case.name()); - } - - void OnTestCaseEnd(const TestCase& test_case) { - SendLn("event=TestCaseEnd&passed=" + FormatBool(test_case.Passed()) - + "&elapsed_time=" + StreamableToString(test_case.elapsed_time()) - + "ms"); - } - - void OnTestStart(const TestInfo& test_info) { - SendLn(std::string("event=TestStart&name=") + test_info.name()); - } - - void OnTestEnd(const TestInfo& test_info) { - SendLn("event=TestEnd&passed=" + - FormatBool((test_info.result())->Passed()) + - "&elapsed_time=" + - StreamableToString((test_info.result())->elapsed_time()) + "ms"); - } - - void OnTestPartResult(const TestPartResult& test_part_result) { - const char* file_name = test_part_result.file_name(); - if (file_name == NULL) - file_name = ""; - SendLn("event=TestPartResult&file=" + UrlEncode(file_name) + - "&line=" + StreamableToString(test_part_result.line_number()) + - "&message=" + UrlEncode(test_part_result.message())); - } - - private: - // Sends the given message and a newline to the socket. - void SendLn(const string& message) { socket_writer_->SendLn(message); } - - // Called at the start of streaming to notify the receiver what - // protocol we are using. - void Start() { SendLn("gtest_streaming_protocol_version=1.0"); } - - string FormatBool(bool value) { return value ? "1" : "0"; } - - const scoped_ptr socket_writer_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(StreamingListener); -}; // class StreamingListener - -#endif // GTEST_CAN_STREAM_RESULTS_ - -} // namespace internal -} // namespace testing - -#endif // GTEST_SRC_GTEST_INTERNAL_INL_H_ -#undef GTEST_IMPLEMENTATION_ - -#if GTEST_OS_WINDOWS -# define vsnprintf _vsnprintf -#endif // GTEST_OS_WINDOWS - -namespace testing { - -using internal::CountIf; -using internal::ForEach; -using internal::GetElementOr; -using internal::Shuffle; - -// Constants. - -// A test whose test case name or test name matches this filter is -// disabled and not run. -static const char kDisableTestFilter[] = "DISABLED_*:*/DISABLED_*"; - -// A test case whose name matches this filter is considered a death -// test case and will be run before test cases whose name doesn't -// match this filter. -static const char kDeathTestCaseFilter[] = "*DeathTest:*DeathTest/*"; - -// A test filter that matches everything. -static const char kUniversalFilter[] = "*"; - -// The default output file for XML output. -static const char kDefaultOutputFile[] = "test_detail.xml"; - -// The environment variable name for the test shard index. -static const char kTestShardIndex[] = "GTEST_SHARD_INDEX"; -// The environment variable name for the total number of test shards. -static const char kTestTotalShards[] = "GTEST_TOTAL_SHARDS"; -// The environment variable name for the test shard status file. -static const char kTestShardStatusFile[] = "GTEST_SHARD_STATUS_FILE"; - -namespace internal { - -// The text used in failure messages to indicate the start of the -// stack trace. -const char kStackTraceMarker[] = "\nStack trace:\n"; - -// g_help_flag is true iff the --help flag or an equivalent form is -// specified on the command line. -bool g_help_flag = false; - -} // namespace internal - -static const char* GetDefaultFilter() { - return kUniversalFilter; -} - -GTEST_DEFINE_bool_( - also_run_disabled_tests, - internal::BoolFromGTestEnv("also_run_disabled_tests", false), - "Run disabled tests too, in addition to the tests normally being run."); - -GTEST_DEFINE_bool_( - break_on_failure, - internal::BoolFromGTestEnv("break_on_failure", false), - "True iff a failed assertion should be a debugger break-point."); - -GTEST_DEFINE_bool_( - catch_exceptions, - internal::BoolFromGTestEnv("catch_exceptions", true), - "True iff " GTEST_NAME_ - " should catch exceptions and treat them as test failures."); - -GTEST_DEFINE_string_( - color, - internal::StringFromGTestEnv("color", "auto"), - "Whether to use colors in the output. Valid values: yes, no, " - "and auto. 'auto' means to use colors if the output is " - "being sent to a terminal and the TERM environment variable " - "is set to a terminal type that supports colors."); - -GTEST_DEFINE_string_( - filter, - internal::StringFromGTestEnv("filter", GetDefaultFilter()), - "A colon-separated list of glob (not regex) patterns " - "for filtering the tests to run, optionally followed by a " - "'-' and a : separated list of negative patterns (tests to " - "exclude). A test is run if it matches one of the positive " - "patterns and does not match any of the negative patterns."); - -GTEST_DEFINE_bool_(list_tests, false, - "List all tests without running them."); - -GTEST_DEFINE_string_( - output, - internal::StringFromGTestEnv("output", ""), - "A format (currently must be \"xml\"), optionally followed " - "by a colon and an output file name or directory. A directory " - "is indicated by a trailing pathname separator. " - "Examples: \"xml:filename.xml\", \"xml::directoryname/\". " - "If a directory is specified, output files will be created " - "within that directory, with file-names based on the test " - "executable's name and, if necessary, made unique by adding " - "digits."); - -GTEST_DEFINE_bool_( - print_time, - internal::BoolFromGTestEnv("print_time", true), - "True iff " GTEST_NAME_ - " should display elapsed time in text output."); - -GTEST_DEFINE_int32_( - random_seed, - internal::Int32FromGTestEnv("random_seed", 0), - "Random number seed to use when shuffling test orders. Must be in range " - "[1, 99999], or 0 to use a seed based on the current time."); - -GTEST_DEFINE_int32_( - repeat, - internal::Int32FromGTestEnv("repeat", 1), - "How many times to repeat each test. Specify a negative number " - "for repeating forever. Useful for shaking out flaky tests."); - -GTEST_DEFINE_bool_( - show_internal_stack_frames, false, - "True iff " GTEST_NAME_ " should include internal stack frames when " - "printing test failure stack traces."); - -GTEST_DEFINE_bool_( - shuffle, - internal::BoolFromGTestEnv("shuffle", false), - "True iff " GTEST_NAME_ - " should randomize tests' order on every run."); - -GTEST_DEFINE_int32_( - stack_trace_depth, - internal::Int32FromGTestEnv("stack_trace_depth", kMaxStackTraceDepth), - "The maximum number of stack frames to print when an " - "assertion fails. The valid range is 0 through 100, inclusive."); - -GTEST_DEFINE_string_( - stream_result_to, - internal::StringFromGTestEnv("stream_result_to", ""), - "This flag specifies the host name and the port number on which to stream " - "test results. Example: \"localhost:555\". The flag is effective only on " - "Linux."); - -GTEST_DEFINE_bool_( - throw_on_failure, - internal::BoolFromGTestEnv("throw_on_failure", false), - "When this flag is specified, a failed assertion will throw an exception " - "if exceptions are enabled or exit the program with a non-zero code " - "otherwise."); - -namespace internal { - -// Generates a random number from [0, range), using a Linear -// Congruential Generator (LCG). Crashes if 'range' is 0 or greater -// than kMaxRange. -UInt32 Random::Generate(UInt32 range) { - // These constants are the same as are used in glibc's rand(3). - state_ = (1103515245U*state_ + 12345U) % kMaxRange; - - GTEST_CHECK_(range > 0) - << "Cannot generate a number in the range [0, 0)."; - GTEST_CHECK_(range <= kMaxRange) - << "Generation of a number in [0, " << range << ") was requested, " - << "but this can only generate numbers in [0, " << kMaxRange << ")."; - - // Converting via modulus introduces a bit of downward bias, but - // it's simple, and a linear congruential generator isn't too good - // to begin with. - return state_ % range; -} - -// GTestIsInitialized() returns true iff the user has initialized -// Google Test. Useful for catching the user mistake of not initializing -// Google Test before calling RUN_ALL_TESTS(). -// -// A user must call testing::InitGoogleTest() to initialize Google -// Test. g_init_gtest_count is set to the number of times -// InitGoogleTest() has been called. We don't protect this variable -// under a mutex as it is only accessed in the main thread. -GTEST_API_ int g_init_gtest_count = 0; -static bool GTestIsInitialized() { return g_init_gtest_count != 0; } - -// Iterates over a vector of TestCases, keeping a running sum of the -// results of calling a given int-returning method on each. -// Returns the sum. -static int SumOverTestCaseList(const std::vector& case_list, - int (TestCase::*method)() const) { - int sum = 0; - for (size_t i = 0; i < case_list.size(); i++) { - sum += (case_list[i]->*method)(); - } - return sum; -} - -// Returns true iff the test case passed. -static bool TestCasePassed(const TestCase* test_case) { - return test_case->should_run() && test_case->Passed(); -} - -// Returns true iff the test case failed. -static bool TestCaseFailed(const TestCase* test_case) { - return test_case->should_run() && test_case->Failed(); -} - -// Returns true iff test_case contains at least one test that should -// run. -static bool ShouldRunTestCase(const TestCase* test_case) { - return test_case->should_run(); -} - -// AssertHelper constructor. -AssertHelper::AssertHelper(TestPartResult::Type type, - const char* file, - int line, - const char* message) - : data_(new AssertHelperData(type, file, line, message)) { -} - -AssertHelper::~AssertHelper() { - delete data_; -} - -// Message assignment, for assertion streaming support. -void AssertHelper::operator=(const Message& message) const { - UnitTest::GetInstance()-> - AddTestPartResult(data_->type, data_->file, data_->line, - AppendUserMessage(data_->message, message), - UnitTest::GetInstance()->impl() - ->CurrentOsStackTraceExceptTop(1) - // Skips the stack frame for this function itself. - ); // NOLINT -} - -// Mutex for linked pointers. -GTEST_API_ GTEST_DEFINE_STATIC_MUTEX_(g_linked_ptr_mutex); - -// Application pathname gotten in InitGoogleTest. -std::string g_executable_path; - -// Returns the current application's name, removing directory path if that -// is present. -FilePath GetCurrentExecutableName() { - FilePath result; - -#if GTEST_OS_WINDOWS - result.Set(FilePath(g_executable_path).RemoveExtension("exe")); -#else - result.Set(FilePath(g_executable_path)); -#endif // GTEST_OS_WINDOWS - - return result.RemoveDirectoryName(); -} - -// Functions for processing the gtest_output flag. - -// Returns the output format, or "" for normal printed output. -std::string UnitTestOptions::GetOutputFormat() { - const char* const gtest_output_flag = GTEST_FLAG(output).c_str(); - if (gtest_output_flag == NULL) return std::string(""); - - const char* const colon = strchr(gtest_output_flag, ':'); - return (colon == NULL) ? - std::string(gtest_output_flag) : - std::string(gtest_output_flag, colon - gtest_output_flag); -} - -// Returns the name of the requested output file, or the default if none -// was explicitly specified. -std::string UnitTestOptions::GetAbsolutePathToOutputFile() { - const char* const gtest_output_flag = GTEST_FLAG(output).c_str(); - if (gtest_output_flag == NULL) - return ""; - - const char* const colon = strchr(gtest_output_flag, ':'); - if (colon == NULL) - return internal::FilePath::ConcatPaths( - internal::FilePath( - UnitTest::GetInstance()->original_working_dir()), - internal::FilePath(kDefaultOutputFile)).string(); - - internal::FilePath output_name(colon + 1); - if (!output_name.IsAbsolutePath()) - // TODO(wan@google.com): on Windows \some\path is not an absolute - // path (as its meaning depends on the current drive), yet the - // following logic for turning it into an absolute path is wrong. - // Fix it. - output_name = internal::FilePath::ConcatPaths( - internal::FilePath(UnitTest::GetInstance()->original_working_dir()), - internal::FilePath(colon + 1)); - - if (!output_name.IsDirectory()) - return output_name.string(); - - internal::FilePath result(internal::FilePath::GenerateUniqueFileName( - output_name, internal::GetCurrentExecutableName(), - GetOutputFormat().c_str())); - return result.string(); -} - -// Returns true iff the wildcard pattern matches the string. The -// first ':' or '\0' character in pattern marks the end of it. -// -// This recursive algorithm isn't very efficient, but is clear and -// works well enough for matching test names, which are short. -bool UnitTestOptions::PatternMatchesString(const char *pattern, - const char *str) { - switch (*pattern) { - case '\0': - case ':': // Either ':' or '\0' marks the end of the pattern. - return *str == '\0'; - case '?': // Matches any single character. - return *str != '\0' && PatternMatchesString(pattern + 1, str + 1); - case '*': // Matches any string (possibly empty) of characters. - return (*str != '\0' && PatternMatchesString(pattern, str + 1)) || - PatternMatchesString(pattern + 1, str); - default: // Non-special character. Matches itself. - return *pattern == *str && - PatternMatchesString(pattern + 1, str + 1); - } -} - -bool UnitTestOptions::MatchesFilter( - const std::string& name, const char* filter) { - const char *cur_pattern = filter; - for (;;) { - if (PatternMatchesString(cur_pattern, name.c_str())) { - return true; - } - - // Finds the next pattern in the filter. - cur_pattern = strchr(cur_pattern, ':'); - - // Returns if no more pattern can be found. - if (cur_pattern == NULL) { - return false; - } - - // Skips the pattern separater (the ':' character). - cur_pattern++; - } -} - -// Returns true iff the user-specified filter matches the test case -// name and the test name. -bool UnitTestOptions::FilterMatchesTest(const std::string &test_case_name, - const std::string &test_name) { - const std::string& full_name = test_case_name + "." + test_name.c_str(); - - // Split --gtest_filter at '-', if there is one, to separate into - // positive filter and negative filter portions - const char* const p = GTEST_FLAG(filter).c_str(); - const char* const dash = strchr(p, '-'); - std::string positive; - std::string negative; - if (dash == NULL) { - positive = GTEST_FLAG(filter).c_str(); // Whole string is a positive filter - negative = ""; - } else { - positive = std::string(p, dash); // Everything up to the dash - negative = std::string(dash + 1); // Everything after the dash - if (positive.empty()) { - // Treat '-test1' as the same as '*-test1' - positive = kUniversalFilter; - } - } - - // A filter is a colon-separated list of patterns. It matches a - // test if any pattern in it matches the test. - return (MatchesFilter(full_name, positive.c_str()) && - !MatchesFilter(full_name, negative.c_str())); -} - -#if GTEST_HAS_SEH -// Returns EXCEPTION_EXECUTE_HANDLER if Google Test should handle the -// given SEH exception, or EXCEPTION_CONTINUE_SEARCH otherwise. -// This function is useful as an __except condition. -int UnitTestOptions::GTestShouldProcessSEH(DWORD exception_code) { - // Google Test should handle a SEH exception if: - // 1. the user wants it to, AND - // 2. this is not a breakpoint exception, AND - // 3. this is not a C++ exception (VC++ implements them via SEH, - // apparently). - // - // SEH exception code for C++ exceptions. - // (see http://support.microsoft.com/kb/185294 for more information). - const DWORD kCxxExceptionCode = 0xe06d7363; - - bool should_handle = true; - - if (!GTEST_FLAG(catch_exceptions)) - should_handle = false; - else if (exception_code == EXCEPTION_BREAKPOINT) - should_handle = false; - else if (exception_code == kCxxExceptionCode) - should_handle = false; - - return should_handle ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH; -} -#endif // GTEST_HAS_SEH - -} // namespace internal - -// The c'tor sets this object as the test part result reporter used by -// Google Test. The 'result' parameter specifies where to report the -// results. Intercepts only failures from the current thread. -ScopedFakeTestPartResultReporter::ScopedFakeTestPartResultReporter( - TestPartResultArray* result) - : intercept_mode_(INTERCEPT_ONLY_CURRENT_THREAD), - result_(result) { - Init(); -} - -// The c'tor sets this object as the test part result reporter used by -// Google Test. The 'result' parameter specifies where to report the -// results. -ScopedFakeTestPartResultReporter::ScopedFakeTestPartResultReporter( - InterceptMode intercept_mode, TestPartResultArray* result) - : intercept_mode_(intercept_mode), - result_(result) { - Init(); -} - -void ScopedFakeTestPartResultReporter::Init() { - internal::UnitTestImpl* const impl = internal::GetUnitTestImpl(); - if (intercept_mode_ == INTERCEPT_ALL_THREADS) { - old_reporter_ = impl->GetGlobalTestPartResultReporter(); - impl->SetGlobalTestPartResultReporter(this); - } else { - old_reporter_ = impl->GetTestPartResultReporterForCurrentThread(); - impl->SetTestPartResultReporterForCurrentThread(this); - } -} - -// The d'tor restores the test part result reporter used by Google Test -// before. -ScopedFakeTestPartResultReporter::~ScopedFakeTestPartResultReporter() { - internal::UnitTestImpl* const impl = internal::GetUnitTestImpl(); - if (intercept_mode_ == INTERCEPT_ALL_THREADS) { - impl->SetGlobalTestPartResultReporter(old_reporter_); - } else { - impl->SetTestPartResultReporterForCurrentThread(old_reporter_); - } -} - -// Increments the test part result count and remembers the result. -// This method is from the TestPartResultReporterInterface interface. -void ScopedFakeTestPartResultReporter::ReportTestPartResult( - const TestPartResult& result) { - result_->Append(result); -} - -namespace internal { - -// Returns the type ID of ::testing::Test. We should always call this -// instead of GetTypeId< ::testing::Test>() to get the type ID of -// testing::Test. This is to work around a suspected linker bug when -// using Google Test as a framework on Mac OS X. The bug causes -// GetTypeId< ::testing::Test>() to return different values depending -// on whether the call is from the Google Test framework itself or -// from user test code. GetTestTypeId() is guaranteed to always -// return the same value, as it always calls GetTypeId<>() from the -// gtest.cc, which is within the Google Test framework. -TypeId GetTestTypeId() { - return GetTypeId(); -} - -// The value of GetTestTypeId() as seen from within the Google Test -// library. This is solely for testing GetTestTypeId(). -extern const TypeId kTestTypeIdInGoogleTest = GetTestTypeId(); - -// This predicate-formatter checks that 'results' contains a test part -// failure of the given type and that the failure message contains the -// given substring. -AssertionResult HasOneFailure(const char* /* results_expr */, - const char* /* type_expr */, - const char* /* substr_expr */, - const TestPartResultArray& results, - TestPartResult::Type type, - const string& substr) { - const std::string expected(type == TestPartResult::kFatalFailure ? - "1 fatal failure" : - "1 non-fatal failure"); - Message msg; - if (results.size() != 1) { - msg << "Expected: " << expected << "\n" - << " Actual: " << results.size() << " failures"; - for (int i = 0; i < results.size(); i++) { - msg << "\n" << results.GetTestPartResult(i); - } - return AssertionFailure() << msg; - } - - const TestPartResult& r = results.GetTestPartResult(0); - if (r.type() != type) { - return AssertionFailure() << "Expected: " << expected << "\n" - << " Actual:\n" - << r; - } - - if (strstr(r.message(), substr.c_str()) == NULL) { - return AssertionFailure() << "Expected: " << expected << " containing \"" - << substr << "\"\n" - << " Actual:\n" - << r; - } - - return AssertionSuccess(); -} - -// The constructor of SingleFailureChecker remembers where to look up -// test part results, what type of failure we expect, and what -// substring the failure message should contain. -SingleFailureChecker:: SingleFailureChecker( - const TestPartResultArray* results, - TestPartResult::Type type, - const string& substr) - : results_(results), - type_(type), - substr_(substr) {} - -// The destructor of SingleFailureChecker verifies that the given -// TestPartResultArray contains exactly one failure that has the given -// type and contains the given substring. If that's not the case, a -// non-fatal failure will be generated. -SingleFailureChecker::~SingleFailureChecker() { - EXPECT_PRED_FORMAT3(HasOneFailure, *results_, type_, substr_); -} - -DefaultGlobalTestPartResultReporter::DefaultGlobalTestPartResultReporter( - UnitTestImpl* unit_test) : unit_test_(unit_test) {} - -void DefaultGlobalTestPartResultReporter::ReportTestPartResult( - const TestPartResult& result) { - unit_test_->current_test_result()->AddTestPartResult(result); - unit_test_->listeners()->repeater()->OnTestPartResult(result); -} - -DefaultPerThreadTestPartResultReporter::DefaultPerThreadTestPartResultReporter( - UnitTestImpl* unit_test) : unit_test_(unit_test) {} - -void DefaultPerThreadTestPartResultReporter::ReportTestPartResult( - const TestPartResult& result) { - unit_test_->GetGlobalTestPartResultReporter()->ReportTestPartResult(result); -} - -// Returns the global test part result reporter. -TestPartResultReporterInterface* -UnitTestImpl::GetGlobalTestPartResultReporter() { - internal::MutexLock lock(&global_test_part_result_reporter_mutex_); - return global_test_part_result_repoter_; -} - -// Sets the global test part result reporter. -void UnitTestImpl::SetGlobalTestPartResultReporter( - TestPartResultReporterInterface* reporter) { - internal::MutexLock lock(&global_test_part_result_reporter_mutex_); - global_test_part_result_repoter_ = reporter; -} - -// Returns the test part result reporter for the current thread. -TestPartResultReporterInterface* -UnitTestImpl::GetTestPartResultReporterForCurrentThread() { - return per_thread_test_part_result_reporter_.get(); -} - -// Sets the test part result reporter for the current thread. -void UnitTestImpl::SetTestPartResultReporterForCurrentThread( - TestPartResultReporterInterface* reporter) { - per_thread_test_part_result_reporter_.set(reporter); -} - -// Gets the number of successful test cases. -int UnitTestImpl::successful_test_case_count() const { - return CountIf(test_cases_, TestCasePassed); -} - -// Gets the number of failed test cases. -int UnitTestImpl::failed_test_case_count() const { - return CountIf(test_cases_, TestCaseFailed); -} - -// Gets the number of all test cases. -int UnitTestImpl::total_test_case_count() const { - return static_cast(test_cases_.size()); -} - -// Gets the number of all test cases that contain at least one test -// that should run. -int UnitTestImpl::test_case_to_run_count() const { - return CountIf(test_cases_, ShouldRunTestCase); -} - -// Gets the number of successful tests. -int UnitTestImpl::successful_test_count() const { - return SumOverTestCaseList(test_cases_, &TestCase::successful_test_count); -} - -// Gets the number of failed tests. -int UnitTestImpl::failed_test_count() const { - return SumOverTestCaseList(test_cases_, &TestCase::failed_test_count); -} - -// Gets the number of disabled tests that will be reported in the XML report. -int UnitTestImpl::reportable_disabled_test_count() const { - return SumOverTestCaseList(test_cases_, - &TestCase::reportable_disabled_test_count); -} - -// Gets the number of disabled tests. -int UnitTestImpl::disabled_test_count() const { - return SumOverTestCaseList(test_cases_, &TestCase::disabled_test_count); -} - -// Gets the number of tests to be printed in the XML report. -int UnitTestImpl::reportable_test_count() const { - return SumOverTestCaseList(test_cases_, &TestCase::reportable_test_count); -} - -// Gets the number of all tests. -int UnitTestImpl::total_test_count() const { - return SumOverTestCaseList(test_cases_, &TestCase::total_test_count); -} - -// Gets the number of tests that should run. -int UnitTestImpl::test_to_run_count() const { - return SumOverTestCaseList(test_cases_, &TestCase::test_to_run_count); -} - -// Returns the current OS stack trace as an std::string. -// -// The maximum number of stack frames to be included is specified by -// the gtest_stack_trace_depth flag. The skip_count parameter -// specifies the number of top frames to be skipped, which doesn't -// count against the number of frames to be included. -// -// For example, if Foo() calls Bar(), which in turn calls -// CurrentOsStackTraceExceptTop(1), Foo() will be included in the -// trace but Bar() and CurrentOsStackTraceExceptTop() won't. -std::string UnitTestImpl::CurrentOsStackTraceExceptTop(int skip_count) { - (void)skip_count; - return ""; -} - -// Returns the current time in milliseconds. -TimeInMillis GetTimeInMillis() { -#if GTEST_OS_WINDOWS_MOBILE || defined(__BORLANDC__) - // Difference between 1970-01-01 and 1601-01-01 in milliseconds. - // http://analogous.blogspot.com/2005/04/epoch.html - const TimeInMillis kJavaEpochToWinFileTimeDelta = - static_cast(116444736UL) * 100000UL; - const DWORD kTenthMicrosInMilliSecond = 10000; - - SYSTEMTIME now_systime; - FILETIME now_filetime; - ULARGE_INTEGER now_int64; - // TODO(kenton@google.com): Shouldn't this just use - // GetSystemTimeAsFileTime()? - GetSystemTime(&now_systime); - if (SystemTimeToFileTime(&now_systime, &now_filetime)) { - now_int64.LowPart = now_filetime.dwLowDateTime; - now_int64.HighPart = now_filetime.dwHighDateTime; - now_int64.QuadPart = (now_int64.QuadPart / kTenthMicrosInMilliSecond) - - kJavaEpochToWinFileTimeDelta; - return now_int64.QuadPart; - } - return 0; -#elif GTEST_OS_WINDOWS && !GTEST_HAS_GETTIMEOFDAY_ - __timeb64 now; - -# ifdef _MSC_VER - - // MSVC 8 deprecates _ftime64(), so we want to suppress warning 4996 - // (deprecated function) there. - // TODO(kenton@google.com): Use GetTickCount()? Or use - // SystemTimeToFileTime() -# pragma warning(push) // Saves the current warning state. -# pragma warning(disable:4996) // Temporarily disables warning 4996. - _ftime64(&now); -# pragma warning(pop) // Restores the warning state. -# else - - _ftime64(&now); - -# endif // _MSC_VER - - return static_cast(now.time) * 1000 + now.millitm; -#elif GTEST_HAS_GETTIMEOFDAY_ - struct timeval now; - gettimeofday(&now, NULL); - return static_cast(now.tv_sec) * 1000 + now.tv_usec / 1000; -#else -# error "Don't know how to get the current time on your system." -#endif -} - -// Utilities - -// class String. - -#if GTEST_OS_WINDOWS_MOBILE -// Creates a UTF-16 wide string from the given ANSI string, allocating -// memory using new. The caller is responsible for deleting the return -// value using delete[]. Returns the wide string, or NULL if the -// input is NULL. -LPCWSTR String::AnsiToUtf16(const char* ansi) { - if (!ansi) return NULL; - const int length = strlen(ansi); - const int unicode_length = - MultiByteToWideChar(CP_ACP, 0, ansi, length, - NULL, 0); - WCHAR* unicode = new WCHAR[unicode_length + 1]; - MultiByteToWideChar(CP_ACP, 0, ansi, length, - unicode, unicode_length); - unicode[unicode_length] = 0; - return unicode; -} - -// Creates an ANSI string from the given wide string, allocating -// memory using new. The caller is responsible for deleting the return -// value using delete[]. Returns the ANSI string, or NULL if the -// input is NULL. -const char* String::Utf16ToAnsi(LPCWSTR utf16_str) { - if (!utf16_str) return NULL; - const int ansi_length = - WideCharToMultiByte(CP_ACP, 0, utf16_str, -1, - NULL, 0, NULL, NULL); - char* ansi = new char[ansi_length + 1]; - WideCharToMultiByte(CP_ACP, 0, utf16_str, -1, - ansi, ansi_length, NULL, NULL); - ansi[ansi_length] = 0; - return ansi; -} - -#endif // GTEST_OS_WINDOWS_MOBILE - -// Compares two C strings. Returns true iff they have the same content. -// -// Unlike strcmp(), this function can handle NULL argument(s). A NULL -// C string is considered different to any non-NULL C string, -// including the empty string. -bool String::CStringEquals(const char * lhs, const char * rhs) { - if ( lhs == NULL ) return rhs == NULL; - - if ( rhs == NULL ) return false; - - return strcmp(lhs, rhs) == 0; -} - -#if GTEST_HAS_STD_WSTRING || GTEST_HAS_GLOBAL_WSTRING - -// Converts an array of wide chars to a narrow string using the UTF-8 -// encoding, and streams the result to the given Message object. -static void StreamWideCharsToMessage(const wchar_t* wstr, size_t length, - Message* msg) { - for (size_t i = 0; i != length; ) { // NOLINT - if (wstr[i] != L'\0') { - *msg << WideStringToUtf8(wstr + i, static_cast(length - i)); - while (i != length && wstr[i] != L'\0') - i++; - } else { - *msg << '\0'; - i++; - } - } -} - -#endif // GTEST_HAS_STD_WSTRING || GTEST_HAS_GLOBAL_WSTRING - -} // namespace internal - -// Constructs an empty Message. -// We allocate the stringstream separately because otherwise each use of -// ASSERT/EXPECT in a procedure adds over 200 bytes to the procedure's -// stack frame leading to huge stack frames in some cases; gcc does not reuse -// the stack space. -Message::Message() : ss_(new ::std::stringstream) { - // By default, we want there to be enough precision when printing - // a double to a Message. - *ss_ << std::setprecision(std::numeric_limits::digits10 + 2); -} - -// These two overloads allow streaming a wide C string to a Message -// using the UTF-8 encoding. -Message& Message::operator <<(const wchar_t* wide_c_str) { - return *this << internal::String::ShowWideCString(wide_c_str); -} -Message& Message::operator <<(wchar_t* wide_c_str) { - return *this << internal::String::ShowWideCString(wide_c_str); -} - -#if GTEST_HAS_STD_WSTRING -// Converts the given wide string to a narrow string using the UTF-8 -// encoding, and streams the result to this Message object. -Message& Message::operator <<(const ::std::wstring& wstr) { - internal::StreamWideCharsToMessage(wstr.c_str(), wstr.length(), this); - return *this; -} -#endif // GTEST_HAS_STD_WSTRING - -#if GTEST_HAS_GLOBAL_WSTRING -// Converts the given wide string to a narrow string using the UTF-8 -// encoding, and streams the result to this Message object. -Message& Message::operator <<(const ::wstring& wstr) { - internal::StreamWideCharsToMessage(wstr.c_str(), wstr.length(), this); - return *this; -} -#endif // GTEST_HAS_GLOBAL_WSTRING - -// Gets the text streamed to this object so far as an std::string. -// Each '\0' character in the buffer is replaced with "\\0". -std::string Message::GetString() const { - return internal::StringStreamToString(ss_.get()); -} - -// AssertionResult constructors. -// Used in EXPECT_TRUE/FALSE(assertion_result). -AssertionResult::AssertionResult(const AssertionResult& other) - : success_(other.success_), - message_(other.message_.get() != NULL ? - new ::std::string(*other.message_) : - static_cast< ::std::string*>(NULL)) { -} - -// Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE. -AssertionResult AssertionResult::operator!() const { - AssertionResult negation(!success_); - if (message_.get() != NULL) - negation << *message_; - return negation; -} - -// Makes a successful assertion result. -AssertionResult AssertionSuccess() { - return AssertionResult(true); -} - -// Makes a failed assertion result. -AssertionResult AssertionFailure() { - return AssertionResult(false); -} - -// Makes a failed assertion result with the given failure message. -// Deprecated; use AssertionFailure() << message. -AssertionResult AssertionFailure(const Message& message) { - return AssertionFailure() << message; -} - -namespace internal { - -// Constructs and returns the message for an equality assertion -// (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure. -// -// The first four parameters are the expressions used in the assertion -// and their values, as strings. For example, for ASSERT_EQ(foo, bar) -// where foo is 5 and bar is 6, we have: -// -// expected_expression: "foo" -// actual_expression: "bar" -// expected_value: "5" -// actual_value: "6" -// -// The ignoring_case parameter is true iff the assertion is a -// *_STRCASEEQ*. When it's true, the string " (ignoring case)" will -// be inserted into the message. -AssertionResult EqFailure(const char* expected_expression, - const char* actual_expression, - const std::string& expected_value, - const std::string& actual_value, - bool ignoring_case) { - Message msg; - msg << "Value of: " << actual_expression; - if (actual_value != actual_expression) { - msg << "\n Actual: " << actual_value; - } - - msg << "\nExpected: " << expected_expression; - if (ignoring_case) { - msg << " (ignoring case)"; - } - if (expected_value != expected_expression) { - msg << "\nWhich is: " << expected_value; - } - - return AssertionFailure() << msg; -} - -// Constructs a failure message for Boolean assertions such as EXPECT_TRUE. -std::string GetBoolAssertionFailureMessage( - const AssertionResult& assertion_result, - const char* expression_text, - const char* actual_predicate_value, - const char* expected_predicate_value) { - const char* actual_message = assertion_result.message(); - Message msg; - msg << "Value of: " << expression_text - << "\n Actual: " << actual_predicate_value; - if (actual_message[0] != '\0') - msg << " (" << actual_message << ")"; - msg << "\nExpected: " << expected_predicate_value; - return msg.GetString(); -} - -// Helper function for implementing ASSERT_NEAR. -AssertionResult DoubleNearPredFormat(const char* expr1, - const char* expr2, - const char* abs_error_expr, - double val1, - double val2, - double abs_error) { - const double diff = fabs(val1 - val2); - if (diff <= abs_error) return AssertionSuccess(); - - // TODO(wan): do not print the value of an expression if it's - // already a literal. - return AssertionFailure() - << "The difference between " << expr1 << " and " << expr2 - << " is " << diff << ", which exceeds " << abs_error_expr << ", where\n" - << expr1 << " evaluates to " << val1 << ",\n" - << expr2 << " evaluates to " << val2 << ", and\n" - << abs_error_expr << " evaluates to " << abs_error << "."; -} - - -// Helper template for implementing FloatLE() and DoubleLE(). -template -AssertionResult FloatingPointLE(const char* expr1, - const char* expr2, - RawType val1, - RawType val2) { - // Returns success if val1 is less than val2, - if (val1 < val2) { - return AssertionSuccess(); - } - - // or if val1 is almost equal to val2. - const FloatingPoint lhs(val1), rhs(val2); - if (lhs.AlmostEquals(rhs)) { - return AssertionSuccess(); - } - - // Note that the above two checks will both fail if either val1 or - // val2 is NaN, as the IEEE floating-point standard requires that - // any predicate involving a NaN must return false. - - ::std::stringstream val1_ss; - val1_ss << std::setprecision(std::numeric_limits::digits10 + 2) - << val1; - - ::std::stringstream val2_ss; - val2_ss << std::setprecision(std::numeric_limits::digits10 + 2) - << val2; - - return AssertionFailure() - << "Expected: (" << expr1 << ") <= (" << expr2 << ")\n" - << " Actual: " << StringStreamToString(&val1_ss) << " vs " - << StringStreamToString(&val2_ss); -} - -} // namespace internal - -// Asserts that val1 is less than, or almost equal to, val2. Fails -// otherwise. In particular, it fails if either val1 or val2 is NaN. -AssertionResult FloatLE(const char* expr1, const char* expr2, - float val1, float val2) { - return internal::FloatingPointLE(expr1, expr2, val1, val2); -} - -// Asserts that val1 is less than, or almost equal to, val2. Fails -// otherwise. In particular, it fails if either val1 or val2 is NaN. -AssertionResult DoubleLE(const char* expr1, const char* expr2, - double val1, double val2) { - return internal::FloatingPointLE(expr1, expr2, val1, val2); -} - -namespace internal { - -// The helper function for {ASSERT|EXPECT}_EQ with int or enum -// arguments. -AssertionResult CmpHelperEQ(const char* expected_expression, - const char* actual_expression, - BiggestInt expected, - BiggestInt actual) { - if (expected == actual) { - return AssertionSuccess(); - } - - return EqFailure(expected_expression, - actual_expression, - FormatForComparisonFailureMessage(expected, actual), - FormatForComparisonFailureMessage(actual, expected), - false); -} - -// A macro for implementing the helper functions needed to implement -// ASSERT_?? and EXPECT_?? with integer or enum arguments. It is here -// just to avoid copy-and-paste of similar code. -#define GTEST_IMPL_CMP_HELPER_(op_name, op)\ -AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \ - BiggestInt val1, BiggestInt val2) {\ - if (val1 op val2) {\ - return AssertionSuccess();\ - } else {\ - return AssertionFailure() \ - << "Expected: (" << expr1 << ") " #op " (" << expr2\ - << "), actual: " << FormatForComparisonFailureMessage(val1, val2)\ - << " vs " << FormatForComparisonFailureMessage(val2, val1);\ - }\ -} - -// Implements the helper function for {ASSERT|EXPECT}_NE with int or -// enum arguments. -GTEST_IMPL_CMP_HELPER_(NE, !=) -// Implements the helper function for {ASSERT|EXPECT}_LE with int or -// enum arguments. -GTEST_IMPL_CMP_HELPER_(LE, <=) -// Implements the helper function for {ASSERT|EXPECT}_LT with int or -// enum arguments. -GTEST_IMPL_CMP_HELPER_(LT, < ) -// Implements the helper function for {ASSERT|EXPECT}_GE with int or -// enum arguments. -GTEST_IMPL_CMP_HELPER_(GE, >=) -// Implements the helper function for {ASSERT|EXPECT}_GT with int or -// enum arguments. -GTEST_IMPL_CMP_HELPER_(GT, > ) - -#undef GTEST_IMPL_CMP_HELPER_ - -// The helper function for {ASSERT|EXPECT}_STREQ. -AssertionResult CmpHelperSTREQ(const char* expected_expression, - const char* actual_expression, - const char* expected, - const char* actual) { - if (String::CStringEquals(expected, actual)) { - return AssertionSuccess(); - } - - return EqFailure(expected_expression, - actual_expression, - PrintToString(expected), - PrintToString(actual), - false); -} - -// The helper function for {ASSERT|EXPECT}_STRCASEEQ. -AssertionResult CmpHelperSTRCASEEQ(const char* expected_expression, - const char* actual_expression, - const char* expected, - const char* actual) { - if (String::CaseInsensitiveCStringEquals(expected, actual)) { - return AssertionSuccess(); - } - - return EqFailure(expected_expression, - actual_expression, - PrintToString(expected), - PrintToString(actual), - true); -} - -// The helper function for {ASSERT|EXPECT}_STRNE. -AssertionResult CmpHelperSTRNE(const char* s1_expression, - const char* s2_expression, - const char* s1, - const char* s2) { - if (!String::CStringEquals(s1, s2)) { - return AssertionSuccess(); - } else { - return AssertionFailure() << "Expected: (" << s1_expression << ") != (" - << s2_expression << "), actual: \"" - << s1 << "\" vs \"" << s2 << "\""; - } -} - -// The helper function for {ASSERT|EXPECT}_STRCASENE. -AssertionResult CmpHelperSTRCASENE(const char* s1_expression, - const char* s2_expression, - const char* s1, - const char* s2) { - if (!String::CaseInsensitiveCStringEquals(s1, s2)) { - return AssertionSuccess(); - } else { - return AssertionFailure() - << "Expected: (" << s1_expression << ") != (" - << s2_expression << ") (ignoring case), actual: \"" - << s1 << "\" vs \"" << s2 << "\""; - } -} - -} // namespace internal - -namespace { - -// Helper functions for implementing IsSubString() and IsNotSubstring(). - -// This group of overloaded functions return true iff needle is a -// substring of haystack. NULL is considered a substring of itself -// only. - -bool IsSubstringPred(const char* needle, const char* haystack) { - if (needle == NULL || haystack == NULL) - return needle == haystack; - - return strstr(haystack, needle) != NULL; -} - -bool IsSubstringPred(const wchar_t* needle, const wchar_t* haystack) { - if (needle == NULL || haystack == NULL) - return needle == haystack; - - return wcsstr(haystack, needle) != NULL; -} - -// StringType here can be either ::std::string or ::std::wstring. -template -bool IsSubstringPred(const StringType& needle, - const StringType& haystack) { - return haystack.find(needle) != StringType::npos; -} - -// This function implements either IsSubstring() or IsNotSubstring(), -// depending on the value of the expected_to_be_substring parameter. -// StringType here can be const char*, const wchar_t*, ::std::string, -// or ::std::wstring. -template -AssertionResult IsSubstringImpl( - bool expected_to_be_substring, - const char* needle_expr, const char* haystack_expr, - const StringType& needle, const StringType& haystack) { - if (IsSubstringPred(needle, haystack) == expected_to_be_substring) - return AssertionSuccess(); - - const bool is_wide_string = sizeof(needle[0]) > 1; - const char* const begin_string_quote = is_wide_string ? "L\"" : "\""; - return AssertionFailure() - << "Value of: " << needle_expr << "\n" - << " Actual: " << begin_string_quote << needle << "\"\n" - << "Expected: " << (expected_to_be_substring ? "" : "not ") - << "a substring of " << haystack_expr << "\n" - << "Which is: " << begin_string_quote << haystack << "\""; -} - -} // namespace - -// IsSubstring() and IsNotSubstring() check whether needle is a -// substring of haystack (NULL is considered a substring of itself -// only), and return an appropriate error message when they fail. - -AssertionResult IsSubstring( - const char* needle_expr, const char* haystack_expr, - const char* needle, const char* haystack) { - return IsSubstringImpl(true, needle_expr, haystack_expr, needle, haystack); -} - -AssertionResult IsSubstring( - const char* needle_expr, const char* haystack_expr, - const wchar_t* needle, const wchar_t* haystack) { - return IsSubstringImpl(true, needle_expr, haystack_expr, needle, haystack); -} - -AssertionResult IsNotSubstring( - const char* needle_expr, const char* haystack_expr, - const char* needle, const char* haystack) { - return IsSubstringImpl(false, needle_expr, haystack_expr, needle, haystack); -} - -AssertionResult IsNotSubstring( - const char* needle_expr, const char* haystack_expr, - const wchar_t* needle, const wchar_t* haystack) { - return IsSubstringImpl(false, needle_expr, haystack_expr, needle, haystack); -} - -AssertionResult IsSubstring( - const char* needle_expr, const char* haystack_expr, - const ::std::string& needle, const ::std::string& haystack) { - return IsSubstringImpl(true, needle_expr, haystack_expr, needle, haystack); -} - -AssertionResult IsNotSubstring( - const char* needle_expr, const char* haystack_expr, - const ::std::string& needle, const ::std::string& haystack) { - return IsSubstringImpl(false, needle_expr, haystack_expr, needle, haystack); -} - -#if GTEST_HAS_STD_WSTRING -AssertionResult IsSubstring( - const char* needle_expr, const char* haystack_expr, - const ::std::wstring& needle, const ::std::wstring& haystack) { - return IsSubstringImpl(true, needle_expr, haystack_expr, needle, haystack); -} - -AssertionResult IsNotSubstring( - const char* needle_expr, const char* haystack_expr, - const ::std::wstring& needle, const ::std::wstring& haystack) { - return IsSubstringImpl(false, needle_expr, haystack_expr, needle, haystack); -} -#endif // GTEST_HAS_STD_WSTRING - -namespace internal { - -#if GTEST_OS_WINDOWS - -namespace { - -// Helper function for IsHRESULT{SuccessFailure} predicates -AssertionResult HRESULTFailureHelper(const char* expr, - const char* expected, - long hr) { // NOLINT -# if GTEST_OS_WINDOWS_MOBILE - - // Windows CE doesn't support FormatMessage. - const char error_text[] = ""; - -# else - - // Looks up the human-readable system message for the HRESULT code - // and since we're not passing any params to FormatMessage, we don't - // want inserts expanded. - const DWORD kFlags = FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS; - const DWORD kBufSize = 4096; - // Gets the system's human readable message string for this HRESULT. - char error_text[kBufSize] = { '\0' }; - DWORD message_length = ::FormatMessageA(kFlags, - 0, // no source, we're asking system - hr, // the error - 0, // no line width restrictions - error_text, // output buffer - kBufSize, // buf size - NULL); // no arguments for inserts - // Trims tailing white space (FormatMessage leaves a trailing CR-LF) - for (; message_length && IsSpace(error_text[message_length - 1]); - --message_length) { - error_text[message_length - 1] = '\0'; - } - -# endif // GTEST_OS_WINDOWS_MOBILE - - const std::string error_hex("0x" + String::FormatHexInt(hr)); - return ::testing::AssertionFailure() - << "Expected: " << expr << " " << expected << ".\n" - << " Actual: " << error_hex << " " << error_text << "\n"; -} - -} // namespace - -AssertionResult IsHRESULTSuccess(const char* expr, long hr) { // NOLINT - if (SUCCEEDED(hr)) { - return AssertionSuccess(); - } - return HRESULTFailureHelper(expr, "succeeds", hr); -} - -AssertionResult IsHRESULTFailure(const char* expr, long hr) { // NOLINT - if (FAILED(hr)) { - return AssertionSuccess(); - } - return HRESULTFailureHelper(expr, "fails", hr); -} - -#endif // GTEST_OS_WINDOWS - -// Utility functions for encoding Unicode text (wide strings) in -// UTF-8. - -// A Unicode code-point can have upto 21 bits, and is encoded in UTF-8 -// like this: -// -// Code-point length Encoding -// 0 - 7 bits 0xxxxxxx -// 8 - 11 bits 110xxxxx 10xxxxxx -// 12 - 16 bits 1110xxxx 10xxxxxx 10xxxxxx -// 17 - 21 bits 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx - -// The maximum code-point a one-byte UTF-8 sequence can represent. -const UInt32 kMaxCodePoint1 = (static_cast(1) << 7) - 1; - -// The maximum code-point a two-byte UTF-8 sequence can represent. -const UInt32 kMaxCodePoint2 = (static_cast(1) << (5 + 6)) - 1; - -// The maximum code-point a three-byte UTF-8 sequence can represent. -const UInt32 kMaxCodePoint3 = (static_cast(1) << (4 + 2*6)) - 1; - -// The maximum code-point a four-byte UTF-8 sequence can represent. -const UInt32 kMaxCodePoint4 = (static_cast(1) << (3 + 3*6)) - 1; - -// Chops off the n lowest bits from a bit pattern. Returns the n -// lowest bits. As a side effect, the original bit pattern will be -// shifted to the right by n bits. -inline UInt32 ChopLowBits(UInt32* bits, int n) { - const UInt32 low_bits = *bits & ((static_cast(1) << n) - 1); - *bits >>= n; - return low_bits; -} - -// Converts a Unicode code point to a narrow string in UTF-8 encoding. -// code_point parameter is of type UInt32 because wchar_t may not be -// wide enough to contain a code point. -// If the code_point is not a valid Unicode code point -// (i.e. outside of Unicode range U+0 to U+10FFFF) it will be converted -// to "(Invalid Unicode 0xXXXXXXXX)". -std::string CodePointToUtf8(UInt32 code_point) { - if (code_point > kMaxCodePoint4) { - return "(Invalid Unicode 0x" + String::FormatHexInt(code_point) + ")"; - } - - char str[5]; // Big enough for the largest valid code point. - if (code_point <= kMaxCodePoint1) { - str[1] = '\0'; - str[0] = static_cast(code_point); // 0xxxxxxx - } else if (code_point <= kMaxCodePoint2) { - str[2] = '\0'; - str[1] = static_cast(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx - str[0] = static_cast(0xC0 | code_point); // 110xxxxx - } else if (code_point <= kMaxCodePoint3) { - str[3] = '\0'; - str[2] = static_cast(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx - str[1] = static_cast(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx - str[0] = static_cast(0xE0 | code_point); // 1110xxxx - } else { // code_point <= kMaxCodePoint4 - str[4] = '\0'; - str[3] = static_cast(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx - str[2] = static_cast(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx - str[1] = static_cast(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx - str[0] = static_cast(0xF0 | code_point); // 11110xxx - } - return str; -} - -// The following two functions only make sense if the the system -// uses UTF-16 for wide string encoding. All supported systems -// with 16 bit wchar_t (Windows, Cygwin, Symbian OS) do use UTF-16. - -// Determines if the arguments constitute UTF-16 surrogate pair -// and thus should be combined into a single Unicode code point -// using CreateCodePointFromUtf16SurrogatePair. -inline bool IsUtf16SurrogatePair(wchar_t first, wchar_t second) { - return sizeof(wchar_t) == 2 && - (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00; -} - -// Creates a Unicode code point from UTF16 surrogate pair. -inline UInt32 CreateCodePointFromUtf16SurrogatePair(wchar_t first, - wchar_t second) { - const UInt32 mask = (1 << 10) - 1; - return (sizeof(wchar_t) == 2) ? - (((first & mask) << 10) | (second & mask)) + 0x10000 : - // This function should not be called when the condition is - // false, but we provide a sensible default in case it is. - static_cast(first); -} - -// Converts a wide string to a narrow string in UTF-8 encoding. -// The wide string is assumed to have the following encoding: -// UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS) -// UTF-32 if sizeof(wchar_t) == 4 (on Linux) -// Parameter str points to a null-terminated wide string. -// Parameter num_chars may additionally limit the number -// of wchar_t characters processed. -1 is used when the entire string -// should be processed. -// If the string contains code points that are not valid Unicode code points -// (i.e. outside of Unicode range U+0 to U+10FFFF) they will be output -// as '(Invalid Unicode 0xXXXXXXXX)'. If the string is in UTF16 encoding -// and contains invalid UTF-16 surrogate pairs, values in those pairs -// will be encoded as individual Unicode characters from Basic Normal Plane. -std::string WideStringToUtf8(const wchar_t* str, int num_chars) { - if (num_chars == -1) - num_chars = static_cast(wcslen(str)); - - ::std::stringstream stream; - for (int i = 0; i < num_chars; ++i) { - UInt32 unicode_code_point; - - if (str[i] == L'\0') { - break; - } else if (i + 1 < num_chars && IsUtf16SurrogatePair(str[i], str[i + 1])) { - unicode_code_point = CreateCodePointFromUtf16SurrogatePair(str[i], - str[i + 1]); - i++; - } else { - unicode_code_point = static_cast(str[i]); - } - - stream << CodePointToUtf8(unicode_code_point); - } - return StringStreamToString(&stream); -} - -// Converts a wide C string to an std::string using the UTF-8 encoding. -// NULL will be converted to "(null)". -std::string String::ShowWideCString(const wchar_t * wide_c_str) { - if (wide_c_str == NULL) return "(null)"; - - return internal::WideStringToUtf8(wide_c_str, -1); -} - -// Compares two wide C strings. Returns true iff they have the same -// content. -// -// Unlike wcscmp(), this function can handle NULL argument(s). A NULL -// C string is considered different to any non-NULL C string, -// including the empty string. -bool String::WideCStringEquals(const wchar_t * lhs, const wchar_t * rhs) { - if (lhs == NULL) return rhs == NULL; - - if (rhs == NULL) return false; - - return wcscmp(lhs, rhs) == 0; -} - -// Helper function for *_STREQ on wide strings. -AssertionResult CmpHelperSTREQ(const char* expected_expression, - const char* actual_expression, - const wchar_t* expected, - const wchar_t* actual) { - if (String::WideCStringEquals(expected, actual)) { - return AssertionSuccess(); - } - - return EqFailure(expected_expression, - actual_expression, - PrintToString(expected), - PrintToString(actual), - false); -} - -// Helper function for *_STRNE on wide strings. -AssertionResult CmpHelperSTRNE(const char* s1_expression, - const char* s2_expression, - const wchar_t* s1, - const wchar_t* s2) { - if (!String::WideCStringEquals(s1, s2)) { - return AssertionSuccess(); - } - - return AssertionFailure() << "Expected: (" << s1_expression << ") != (" - << s2_expression << "), actual: " - << PrintToString(s1) - << " vs " << PrintToString(s2); -} - -// Compares two C strings, ignoring case. Returns true iff they have -// the same content. -// -// Unlike strcasecmp(), this function can handle NULL argument(s). A -// NULL C string is considered different to any non-NULL C string, -// including the empty string. -bool String::CaseInsensitiveCStringEquals(const char * lhs, const char * rhs) { - if (lhs == NULL) - return rhs == NULL; - if (rhs == NULL) - return false; - return posix::StrCaseCmp(lhs, rhs) == 0; -} - - // Compares two wide C strings, ignoring case. Returns true iff they - // have the same content. - // - // Unlike wcscasecmp(), this function can handle NULL argument(s). - // A NULL C string is considered different to any non-NULL wide C string, - // including the empty string. - // NB: The implementations on different platforms slightly differ. - // On windows, this method uses _wcsicmp which compares according to LC_CTYPE - // environment variable. On GNU platform this method uses wcscasecmp - // which compares according to LC_CTYPE category of the current locale. - // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the - // current locale. -bool String::CaseInsensitiveWideCStringEquals(const wchar_t* lhs, - const wchar_t* rhs) { - if (lhs == NULL) return rhs == NULL; - - if (rhs == NULL) return false; - -#if GTEST_OS_WINDOWS - return _wcsicmp(lhs, rhs) == 0; -#elif GTEST_OS_LINUX && !GTEST_OS_LINUX_ANDROID - return wcscasecmp(lhs, rhs) == 0; -#else - // Android, Mac OS X and Cygwin don't define wcscasecmp. - // Other unknown OSes may not define it either. - wint_t left, right; - do { - left = towlower(*lhs++); - right = towlower(*rhs++); - } while (left && left == right); - return left == right; -#endif // OS selector -} - -// Returns true iff str ends with the given suffix, ignoring case. -// Any string is considered to end with an empty suffix. -bool String::EndsWithCaseInsensitive( - const std::string& str, const std::string& suffix) { - const size_t str_len = str.length(); - const size_t suffix_len = suffix.length(); - return (str_len >= suffix_len) && - CaseInsensitiveCStringEquals(str.c_str() + str_len - suffix_len, - suffix.c_str()); -} - -// Formats an int value as "%02d". -std::string String::FormatIntWidth2(int value) { - std::stringstream ss; - ss << std::setfill('0') << std::setw(2) << value; - return ss.str(); -} - -// Formats an int value as "%X". -std::string String::FormatHexInt(int value) { - std::stringstream ss; - ss << std::hex << std::uppercase << value; - return ss.str(); -} - -// Formats a byte as "%02X". -std::string String::FormatByte(unsigned char value) { - std::stringstream ss; - ss << std::setfill('0') << std::setw(2) << std::hex << std::uppercase - << static_cast(value); - return ss.str(); -} - -// Converts the buffer in a stringstream to an std::string, converting NUL -// bytes to "\\0" along the way. -std::string StringStreamToString(::std::stringstream* ss) { - const ::std::string& str = ss->str(); - const char* const start = str.c_str(); - const char* const end = start + str.length(); - - std::string result; - result.reserve(2 * (end - start)); - for (const char* ch = start; ch != end; ++ch) { - if (*ch == '\0') { - result += "\\0"; // Replaces NUL with "\\0"; - } else { - result += *ch; - } - } - - return result; -} - -// Appends the user-supplied message to the Google-Test-generated message. -std::string AppendUserMessage(const std::string& gtest_msg, - const Message& user_msg) { - // Appends the user message if it's non-empty. - const std::string user_msg_string = user_msg.GetString(); - if (user_msg_string.empty()) { - return gtest_msg; - } - - return gtest_msg + "\n" + user_msg_string; -} - -} // namespace internal - -// class TestResult - -// Creates an empty TestResult. -TestResult::TestResult() - : death_test_count_(0), - elapsed_time_(0) { -} - -// D'tor. -TestResult::~TestResult() { -} - -// Returns the i-th test part result among all the results. i can -// range from 0 to total_part_count() - 1. If i is not in that range, -// aborts the program. -const TestPartResult& TestResult::GetTestPartResult(int i) const { - if (i < 0 || i >= total_part_count()) - internal::posix::Abort(); - return test_part_results_.at(i); -} - -// Returns the i-th test property. i can range from 0 to -// test_property_count() - 1. If i is not in that range, aborts the -// program. -const TestProperty& TestResult::GetTestProperty(int i) const { - if (i < 0 || i >= test_property_count()) - internal::posix::Abort(); - return test_properties_.at(i); -} - -// Clears the test part results. -void TestResult::ClearTestPartResults() { - test_part_results_.clear(); -} - -// Adds a test part result to the list. -void TestResult::AddTestPartResult(const TestPartResult& test_part_result) { - test_part_results_.push_back(test_part_result); -} - -// Adds a test property to the list. If a property with the same key as the -// supplied property is already represented, the value of this test_property -// replaces the old value for that key. -void TestResult::RecordProperty(const std::string& xml_element, - const TestProperty& test_property) { - if (!ValidateTestProperty(xml_element, test_property)) { - return; - } - internal::MutexLock lock(&test_properites_mutex_); - const std::vector::iterator property_with_matching_key = - std::find_if(test_properties_.begin(), test_properties_.end(), - internal::TestPropertyKeyIs(test_property.key())); - if (property_with_matching_key == test_properties_.end()) { - test_properties_.push_back(test_property); - return; - } - property_with_matching_key->SetValue(test_property.value()); -} - -// The list of reserved attributes used in the element of XML -// output. -static const char* const kReservedTestSuitesAttributes[] = { - "disabled", - "errors", - "failures", - "name", - "random_seed", - "tests", - "time", - "timestamp" -}; - -// The list of reserved attributes used in the element of XML -// output. -static const char* const kReservedTestSuiteAttributes[] = { - "disabled", - "errors", - "failures", - "name", - "tests", - "time" -}; - -// The list of reserved attributes used in the element of XML output. -static const char* const kReservedTestCaseAttributes[] = { - "classname", - "name", - "status", - "time", - "type_param", - "value_param" -}; - -template -std::vector ArrayAsVector(const char* const (&array)[kSize]) { - return std::vector(array, array + kSize); -} - -static std::vector GetReservedAttributesForElement( - const std::string& xml_element) { - if (xml_element == "testsuites") { - return ArrayAsVector(kReservedTestSuitesAttributes); - } else if (xml_element == "testsuite") { - return ArrayAsVector(kReservedTestSuiteAttributes); - } else if (xml_element == "testcase") { - return ArrayAsVector(kReservedTestCaseAttributes); - } else { - GTEST_CHECK_(false) << "Unrecognized xml_element provided: " << xml_element; - } - // This code is unreachable but some compilers may not realizes that. - return std::vector(); -} - -static std::string FormatWordList(const std::vector& words) { - Message word_list; - for (size_t i = 0; i < words.size(); ++i) { - if (i > 0 && words.size() > 2) { - word_list << ", "; - } - if (i == words.size() - 1) { - word_list << "and "; - } - word_list << "'" << words[i] << "'"; - } - return word_list.GetString(); -} - -bool ValidateTestPropertyName(const std::string& property_name, - const std::vector& reserved_names) { - if (std::find(reserved_names.begin(), reserved_names.end(), property_name) != - reserved_names.end()) { - ADD_FAILURE() << "Reserved key used in RecordProperty(): " << property_name - << " (" << FormatWordList(reserved_names) - << " are reserved by " << GTEST_NAME_ << ")"; - return false; - } - return true; -} - -// Adds a failure if the key is a reserved attribute of the element named -// xml_element. Returns true if the property is valid. -bool TestResult::ValidateTestProperty(const std::string& xml_element, - const TestProperty& test_property) { - return ValidateTestPropertyName(test_property.key(), - GetReservedAttributesForElement(xml_element)); -} - -// Clears the object. -void TestResult::Clear() { - test_part_results_.clear(); - test_properties_.clear(); - death_test_count_ = 0; - elapsed_time_ = 0; -} - -// Returns true iff the test failed. -bool TestResult::Failed() const { - for (int i = 0; i < total_part_count(); ++i) { - if (GetTestPartResult(i).failed()) - return true; - } - return false; -} - -// Returns true iff the test part fatally failed. -static bool TestPartFatallyFailed(const TestPartResult& result) { - return result.fatally_failed(); -} - -// Returns true iff the test fatally failed. -bool TestResult::HasFatalFailure() const { - return CountIf(test_part_results_, TestPartFatallyFailed) > 0; -} - -// Returns true iff the test part non-fatally failed. -static bool TestPartNonfatallyFailed(const TestPartResult& result) { - return result.nonfatally_failed(); -} - -// Returns true iff the test has a non-fatal failure. -bool TestResult::HasNonfatalFailure() const { - return CountIf(test_part_results_, TestPartNonfatallyFailed) > 0; -} - -// Gets the number of all test parts. This is the sum of the number -// of successful test parts and the number of failed test parts. -int TestResult::total_part_count() const { - return static_cast(test_part_results_.size()); -} - -// Returns the number of the test properties. -int TestResult::test_property_count() const { - return static_cast(test_properties_.size()); -} - -// class Test - -// Creates a Test object. - -// The c'tor saves the values of all Google Test flags. -Test::Test() - : gtest_flag_saver_(new internal::GTestFlagSaver) { -} - -// The d'tor restores the values of all Google Test flags. -Test::~Test() { - delete gtest_flag_saver_; -} - -// Sets up the test fixture. -// -// A sub-class may override this. -void Test::SetUp() { -} - -// Tears down the test fixture. -// -// A sub-class may override this. -void Test::TearDown() { -} - -// Allows user supplied key value pairs to be recorded for later output. -void Test::RecordProperty(const std::string& key, const std::string& value) { - UnitTest::GetInstance()->RecordProperty(key, value); -} - -// Allows user supplied key value pairs to be recorded for later output. -void Test::RecordProperty(const std::string& key, int value) { - Message value_message; - value_message << value; - RecordProperty(key, value_message.GetString().c_str()); -} - -namespace internal { - -void ReportFailureInUnknownLocation(TestPartResult::Type result_type, - const std::string& message) { - // This function is a friend of UnitTest and as such has access to - // AddTestPartResult. - UnitTest::GetInstance()->AddTestPartResult( - result_type, - NULL, // No info about the source file where the exception occurred. - -1, // We have no info on which line caused the exception. - message, - ""); // No stack trace, either. -} - -} // namespace internal - -// Google Test requires all tests in the same test case to use the same test -// fixture class. This function checks if the current test has the -// same fixture class as the first test in the current test case. If -// yes, it returns true; otherwise it generates a Google Test failure and -// returns false. -bool Test::HasSameFixtureClass() { - internal::UnitTestImpl* const impl = internal::GetUnitTestImpl(); - const TestCase* const test_case = impl->current_test_case(); - - // Info about the first test in the current test case. - const TestInfo* const first_test_info = test_case->test_info_list()[0]; - const internal::TypeId first_fixture_id = first_test_info->fixture_class_id_; - const char* const first_test_name = first_test_info->name(); - - // Info about the current test. - const TestInfo* const this_test_info = impl->current_test_info(); - const internal::TypeId this_fixture_id = this_test_info->fixture_class_id_; - const char* const this_test_name = this_test_info->name(); - - if (this_fixture_id != first_fixture_id) { - // Is the first test defined using TEST? - const bool first_is_TEST = first_fixture_id == internal::GetTestTypeId(); - // Is this test defined using TEST? - const bool this_is_TEST = this_fixture_id == internal::GetTestTypeId(); - - if (first_is_TEST || this_is_TEST) { - // The user mixed TEST and TEST_F in this test case - we'll tell - // him/her how to fix it. - - // Gets the name of the TEST and the name of the TEST_F. Note - // that first_is_TEST and this_is_TEST cannot both be true, as - // the fixture IDs are different for the two tests. - const char* const TEST_name = - first_is_TEST ? first_test_name : this_test_name; - const char* const TEST_F_name = - first_is_TEST ? this_test_name : first_test_name; - - ADD_FAILURE() - << "All tests in the same test case must use the same test fixture\n" - << "class, so mixing TEST_F and TEST in the same test case is\n" - << "illegal. In test case " << this_test_info->test_case_name() - << ",\n" - << "test " << TEST_F_name << " is defined using TEST_F but\n" - << "test " << TEST_name << " is defined using TEST. You probably\n" - << "want to change the TEST to TEST_F or move it to another test\n" - << "case."; - } else { - // The user defined two fixture classes with the same name in - // two namespaces - we'll tell him/her how to fix it. - ADD_FAILURE() - << "All tests in the same test case must use the same test fixture\n" - << "class. However, in test case " - << this_test_info->test_case_name() << ",\n" - << "you defined test " << first_test_name - << " and test " << this_test_name << "\n" - << "using two different test fixture classes. This can happen if\n" - << "the two classes are from different namespaces or translation\n" - << "units and have the same name. You should probably rename one\n" - << "of the classes to put the tests into different test cases."; - } - return false; - } - - return true; -} - -#if GTEST_HAS_SEH - -// Adds an "exception thrown" fatal failure to the current test. This -// function returns its result via an output parameter pointer because VC++ -// prohibits creation of objects with destructors on stack in functions -// using __try (see error C2712). -static std::string* FormatSehExceptionMessage(DWORD exception_code, - const char* location) { - Message message; - message << "SEH exception with code 0x" << std::setbase(16) << - exception_code << std::setbase(10) << " thrown in " << location << "."; - - return new std::string(message.GetString()); -} - -#endif // GTEST_HAS_SEH - -namespace internal { - -#if GTEST_HAS_EXCEPTIONS - -// Adds an "exception thrown" fatal failure to the current test. -static std::string FormatCxxExceptionMessage(const char* description, - const char* location) { - Message message; - if (description != NULL) { - message << "C++ exception with description \"" << description << "\""; - } else { - message << "Unknown C++ exception"; - } - message << " thrown in " << location << "."; - - return message.GetString(); -} - -static std::string PrintTestPartResultToString( - const TestPartResult& test_part_result); - -GoogleTestFailureException::GoogleTestFailureException( - const TestPartResult& failure) - : ::std::runtime_error(PrintTestPartResultToString(failure).c_str()) {} - -#endif // GTEST_HAS_EXCEPTIONS - -// We put these helper functions in the internal namespace as IBM's xlC -// compiler rejects the code if they were declared static. - -// Runs the given method and handles SEH exceptions it throws, when -// SEH is supported; returns the 0-value for type Result in case of an -// SEH exception. (Microsoft compilers cannot handle SEH and C++ -// exceptions in the same function. Therefore, we provide a separate -// wrapper function for handling SEH exceptions.) -template -Result HandleSehExceptionsInMethodIfSupported( - T* object, Result (T::*method)(), const char* location) { -#if GTEST_HAS_SEH - __try { - return (object->*method)(); - } __except (internal::UnitTestOptions::GTestShouldProcessSEH( // NOLINT - GetExceptionCode())) { - // We create the exception message on the heap because VC++ prohibits - // creation of objects with destructors on stack in functions using __try - // (see error C2712). - std::string* exception_message = FormatSehExceptionMessage( - GetExceptionCode(), location); - internal::ReportFailureInUnknownLocation(TestPartResult::kFatalFailure, - *exception_message); - delete exception_message; - return static_cast(0); - } -#else - (void)location; - return (object->*method)(); -#endif // GTEST_HAS_SEH -} - -// Runs the given method and catches and reports C++ and/or SEH-style -// exceptions, if they are supported; returns the 0-value for type -// Result in case of an SEH exception. -template -Result HandleExceptionsInMethodIfSupported( - T* object, Result (T::*method)(), const char* location) { - // NOTE: The user code can affect the way in which Google Test handles - // exceptions by setting GTEST_FLAG(catch_exceptions), but only before - // RUN_ALL_TESTS() starts. It is technically possible to check the flag - // after the exception is caught and either report or re-throw the - // exception based on the flag's value: - // - // try { - // // Perform the test method. - // } catch (...) { - // if (GTEST_FLAG(catch_exceptions)) - // // Report the exception as failure. - // else - // throw; // Re-throws the original exception. - // } - // - // However, the purpose of this flag is to allow the program to drop into - // the debugger when the exception is thrown. On most platforms, once the - // control enters the catch block, the exception origin information is - // lost and the debugger will stop the program at the point of the - // re-throw in this function -- instead of at the point of the original - // throw statement in the code under test. For this reason, we perform - // the check early, sacrificing the ability to affect Google Test's - // exception handling in the method where the exception is thrown. - if (internal::GetUnitTestImpl()->catch_exceptions()) { -#if GTEST_HAS_EXCEPTIONS - try { - return HandleSehExceptionsInMethodIfSupported(object, method, location); - } catch (const internal::GoogleTestFailureException&) { // NOLINT - // This exception type can only be thrown by a failed Google - // Test assertion with the intention of letting another testing - // framework catch it. Therefore we just re-throw it. - throw; - } catch (const std::exception& e) { // NOLINT - internal::ReportFailureInUnknownLocation( - TestPartResult::kFatalFailure, - FormatCxxExceptionMessage(e.what(), location)); - } catch (...) { // NOLINT - internal::ReportFailureInUnknownLocation( - TestPartResult::kFatalFailure, - FormatCxxExceptionMessage(NULL, location)); - } - return static_cast(0); -#else - return HandleSehExceptionsInMethodIfSupported(object, method, location); -#endif // GTEST_HAS_EXCEPTIONS - } else { - return (object->*method)(); - } -} - -} // namespace internal - -// Runs the test and updates the test result. -void Test::Run() { - if (!HasSameFixtureClass()) return; - - internal::UnitTestImpl* const impl = internal::GetUnitTestImpl(); - impl->os_stack_trace_getter()->UponLeavingGTest(); - internal::HandleExceptionsInMethodIfSupported(this, &Test::SetUp, "SetUp()"); - // We will run the test only if SetUp() was successful. - if (!HasFatalFailure()) { - impl->os_stack_trace_getter()->UponLeavingGTest(); - internal::HandleExceptionsInMethodIfSupported( - this, &Test::TestBody, "the test body"); - } - - // However, we want to clean up as much as possible. Hence we will - // always call TearDown(), even if SetUp() or the test body has - // failed. - impl->os_stack_trace_getter()->UponLeavingGTest(); - internal::HandleExceptionsInMethodIfSupported( - this, &Test::TearDown, "TearDown()"); -} - -// Returns true iff the current test has a fatal failure. -bool Test::HasFatalFailure() { - return internal::GetUnitTestImpl()->current_test_result()->HasFatalFailure(); -} - -// Returns true iff the current test has a non-fatal failure. -bool Test::HasNonfatalFailure() { - return internal::GetUnitTestImpl()->current_test_result()-> - HasNonfatalFailure(); -} - -// class TestInfo - -// Constructs a TestInfo object. It assumes ownership of the test factory -// object. -TestInfo::TestInfo(const std::string& a_test_case_name, - const std::string& a_name, - const char* a_type_param, - const char* a_value_param, - internal::TypeId fixture_class_id, - internal::TestFactoryBase* factory) - : test_case_name_(a_test_case_name), - name_(a_name), - type_param_(a_type_param ? new std::string(a_type_param) : NULL), - value_param_(a_value_param ? new std::string(a_value_param) : NULL), - fixture_class_id_(fixture_class_id), - should_run_(false), - is_disabled_(false), - matches_filter_(false), - factory_(factory), - result_() {} - -// Destructs a TestInfo object. -TestInfo::~TestInfo() { delete factory_; } - -namespace internal { - -// Creates a new TestInfo object and registers it with Google Test; -// returns the created object. -// -// Arguments: -// -// test_case_name: name of the test case -// name: name of the test -// type_param: the name of the test's type parameter, or NULL if -// this is not a typed or a type-parameterized test. -// value_param: text representation of the test's value parameter, -// or NULL if this is not a value-parameterized test. -// fixture_class_id: ID of the test fixture class -// set_up_tc: pointer to the function that sets up the test case -// tear_down_tc: pointer to the function that tears down the test case -// factory: pointer to the factory that creates a test object. -// The newly created TestInfo instance will assume -// ownership of the factory object. -TestInfo* MakeAndRegisterTestInfo( - const char* test_case_name, - const char* name, - const char* type_param, - const char* value_param, - TypeId fixture_class_id, - SetUpTestCaseFunc set_up_tc, - TearDownTestCaseFunc tear_down_tc, - TestFactoryBase* factory) { - TestInfo* const test_info = - new TestInfo(test_case_name, name, type_param, value_param, - fixture_class_id, factory); - GetUnitTestImpl()->AddTestInfo(set_up_tc, tear_down_tc, test_info); - return test_info; -} - -#if GTEST_HAS_PARAM_TEST -void ReportInvalidTestCaseType(const char* test_case_name, - const char* file, int line) { - Message errors; - errors - << "Attempted redefinition of test case " << test_case_name << ".\n" - << "All tests in the same test case must use the same test fixture\n" - << "class. However, in test case " << test_case_name << ", you tried\n" - << "to define a test using a fixture class different from the one\n" - << "used earlier. This can happen if the two fixture classes are\n" - << "from different namespaces and have the same name. You should\n" - << "probably rename one of the classes to put the tests into different\n" - << "test cases."; - - fprintf(stderr, "%s %s", FormatFileLocation(file, line).c_str(), - errors.GetString().c_str()); -} -#endif // GTEST_HAS_PARAM_TEST - -} // namespace internal - -namespace { - -// A predicate that checks the test name of a TestInfo against a known -// value. -// -// This is used for implementation of the TestCase class only. We put -// it in the anonymous namespace to prevent polluting the outer -// namespace. -// -// TestNameIs is copyable. - -//Commenting out this class since its not used and wherefor produces warnings -// class TestNameIs { -// public: -// // Constructor. -// // -// // TestNameIs has NO default constructor. -// explicit TestNameIs(const char* name) -// : name_(name) {} -// -// // Returns true iff the test name of test_info matches name_. -// bool operator()(const TestInfo * test_info) const { -// return test_info && test_info->name() == name_; -// } -// -// private: -// std::string name_; -//}; - -} // namespace - -namespace internal { - -// This method expands all parameterized tests registered with macros TEST_P -// and INSTANTIATE_TEST_CASE_P into regular tests and registers those. -// This will be done just once during the program runtime. -void UnitTestImpl::RegisterParameterizedTests() { -#if GTEST_HAS_PARAM_TEST - if (!parameterized_tests_registered_) { - parameterized_test_registry_.RegisterTests(); - parameterized_tests_registered_ = true; - } -#endif -} - -} // namespace internal - -// Creates the test object, runs it, records its result, and then -// deletes it. -void TestInfo::Run() { - if (!should_run_) return; - - // Tells UnitTest where to store test result. - internal::UnitTestImpl* const impl = internal::GetUnitTestImpl(); - impl->set_current_test_info(this); - - TestEventListener* repeater = UnitTest::GetInstance()->listeners().repeater(); - - // Notifies the unit test event listeners that a test is about to start. - repeater->OnTestStart(*this); - - const TimeInMillis start = internal::GetTimeInMillis(); - - impl->os_stack_trace_getter()->UponLeavingGTest(); - - // Creates the test object. - Test* const test = internal::HandleExceptionsInMethodIfSupported( - factory_, &internal::TestFactoryBase::CreateTest, - "the test fixture's constructor"); - - // Runs the test only if the test object was created and its - // constructor didn't generate a fatal failure. - if ((test != NULL) && !Test::HasFatalFailure()) { - // This doesn't throw as all user code that can throw are wrapped into - // exception handling code. - test->Run(); - } - - // Deletes the test object. - impl->os_stack_trace_getter()->UponLeavingGTest(); - internal::HandleExceptionsInMethodIfSupported( - test, &Test::DeleteSelf_, "the test fixture's destructor"); - - result_.set_elapsed_time(internal::GetTimeInMillis() - start); - - // Notifies the unit test event listener that a test has just finished. - repeater->OnTestEnd(*this); - - // Tells UnitTest to stop associating assertion results to this - // test. - impl->set_current_test_info(NULL); -} - -// class TestCase - -// Gets the number of successful tests in this test case. -int TestCase::successful_test_count() const { - return CountIf(test_info_list_, TestPassed); -} - -// Gets the number of failed tests in this test case. -int TestCase::failed_test_count() const { - return CountIf(test_info_list_, TestFailed); -} - -// Gets the number of disabled tests that will be reported in the XML report. -int TestCase::reportable_disabled_test_count() const { - return CountIf(test_info_list_, TestReportableDisabled); -} - -// Gets the number of disabled tests in this test case. -int TestCase::disabled_test_count() const { - return CountIf(test_info_list_, TestDisabled); -} - -// Gets the number of tests to be printed in the XML report. -int TestCase::reportable_test_count() const { - return CountIf(test_info_list_, TestReportable); -} - -// Get the number of tests in this test case that should run. -int TestCase::test_to_run_count() const { - return CountIf(test_info_list_, ShouldRunTest); -} - -// Gets the number of all tests. -int TestCase::total_test_count() const { - return static_cast(test_info_list_.size()); -} - -// Creates a TestCase with the given name. -// -// Arguments: -// -// name: name of the test case -// a_type_param: the name of the test case's type parameter, or NULL if -// this is not a typed or a type-parameterized test case. -// set_up_tc: pointer to the function that sets up the test case -// tear_down_tc: pointer to the function that tears down the test case -TestCase::TestCase(const char* a_name, const char* a_type_param, - Test::SetUpTestCaseFunc set_up_tc, - Test::TearDownTestCaseFunc tear_down_tc) - : name_(a_name), - type_param_(a_type_param ? new std::string(a_type_param) : NULL), - set_up_tc_(set_up_tc), - tear_down_tc_(tear_down_tc), - should_run_(false), - elapsed_time_(0) { -} - -// Destructor of TestCase. -TestCase::~TestCase() { - // Deletes every Test in the collection. - ForEach(test_info_list_, internal::Delete); -} - -// Returns the i-th test among all the tests. i can range from 0 to -// total_test_count() - 1. If i is not in that range, returns NULL. -const TestInfo* TestCase::GetTestInfo(int i) const { - const int index = GetElementOr(test_indices_, i, -1); - return index < 0 ? NULL : test_info_list_[index]; -} - -// Returns the i-th test among all the tests. i can range from 0 to -// total_test_count() - 1. If i is not in that range, returns NULL. -TestInfo* TestCase::GetMutableTestInfo(int i) { - const int index = GetElementOr(test_indices_, i, -1); - return index < 0 ? NULL : test_info_list_[index]; -} - -// Adds a test to this test case. Will delete the test upon -// destruction of the TestCase object. -void TestCase::AddTestInfo(TestInfo * test_info) { - test_info_list_.push_back(test_info); - test_indices_.push_back(static_cast(test_indices_.size())); -} - -// Runs every test in this TestCase. -void TestCase::Run() { - if (!should_run_) return; - - internal::UnitTestImpl* const impl = internal::GetUnitTestImpl(); - impl->set_current_test_case(this); - - TestEventListener* repeater = UnitTest::GetInstance()->listeners().repeater(); - - repeater->OnTestCaseStart(*this); - impl->os_stack_trace_getter()->UponLeavingGTest(); - internal::HandleExceptionsInMethodIfSupported( - this, &TestCase::RunSetUpTestCase, "SetUpTestCase()"); - - const internal::TimeInMillis start = internal::GetTimeInMillis(); - for (int i = 0; i < total_test_count(); i++) { - GetMutableTestInfo(i)->Run(); - } - elapsed_time_ = internal::GetTimeInMillis() - start; - - impl->os_stack_trace_getter()->UponLeavingGTest(); - internal::HandleExceptionsInMethodIfSupported( - this, &TestCase::RunTearDownTestCase, "TearDownTestCase()"); - - repeater->OnTestCaseEnd(*this); - impl->set_current_test_case(NULL); -} - -// Clears the results of all tests in this test case. -void TestCase::ClearResult() { - ad_hoc_test_result_.Clear(); - ForEach(test_info_list_, TestInfo::ClearTestResult); -} - -// Shuffles the tests in this test case. -void TestCase::ShuffleTests(internal::Random* random) { - Shuffle(random, &test_indices_); -} - -// Restores the test order to before the first shuffle. -void TestCase::UnshuffleTests() { - for (size_t i = 0; i < test_indices_.size(); i++) { - test_indices_[i] = static_cast(i); - } -} - -// Formats a countable noun. Depending on its quantity, either the -// singular form or the plural form is used. e.g. -// -// FormatCountableNoun(1, "formula", "formuli") returns "1 formula". -// FormatCountableNoun(5, "book", "books") returns "5 books". -static std::string FormatCountableNoun(int count, - const char * singular_form, - const char * plural_form) { - return internal::StreamableToString(count) + " " + - (count == 1 ? singular_form : plural_form); -} - -// Formats the count of tests. -static std::string FormatTestCount(int test_count) { - return FormatCountableNoun(test_count, "test", "tests"); -} - -// Formats the count of test cases. -static std::string FormatTestCaseCount(int test_case_count) { - return FormatCountableNoun(test_case_count, "test case", "test cases"); -} - -// Converts a TestPartResult::Type enum to human-friendly string -// representation. Both kNonFatalFailure and kFatalFailure are translated -// to "Failure", as the user usually doesn't care about the difference -// between the two when viewing the test result. -static const char * TestPartResultTypeToString(TestPartResult::Type type) { - switch (type) { - case TestPartResult::kSuccess: - return "Success"; - - case TestPartResult::kNonFatalFailure: - case TestPartResult::kFatalFailure: -#ifdef _MSC_VER - return "error: "; -#else - return "Failure\n"; -#endif - default: - return "Unknown result type"; - } -} - -namespace internal { - -// Prints a TestPartResult to an std::string. -static std::string PrintTestPartResultToString( - const TestPartResult& test_part_result) { - return (Message() - << internal::FormatFileLocation(test_part_result.file_name(), - test_part_result.line_number()) - << " " << TestPartResultTypeToString(test_part_result.type()) - << test_part_result.message()).GetString(); -} - -// Prints a TestPartResult. -static void PrintTestPartResult(const TestPartResult& test_part_result) { - const std::string& result = - PrintTestPartResultToString(test_part_result); - printf("%s\n", result.c_str()); - fflush(stdout); - // If the test program runs in Visual Studio or a debugger, the - // following statements add the test part result message to the Output - // window such that the user can double-click on it to jump to the - // corresponding source code location; otherwise they do nothing. -#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE - // We don't call OutputDebugString*() on Windows Mobile, as printing - // to stdout is done by OutputDebugString() there already - we don't - // want the same message printed twice. - ::OutputDebugStringA(result.c_str()); - ::OutputDebugStringA("\n"); -#endif -} - -// class PrettyUnitTestResultPrinter - -enum GTestColor { - COLOR_DEFAULT, - COLOR_RED, - COLOR_GREEN, - COLOR_YELLOW -}; - -#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE - -// Returns the character attribute for the given color. -WORD GetColorAttribute(GTestColor color) { - switch (color) { - case COLOR_RED: return FOREGROUND_RED; - case COLOR_GREEN: return FOREGROUND_GREEN; - case COLOR_YELLOW: return FOREGROUND_RED | FOREGROUND_GREEN; - default: return 0; - } -} - -#else - -// Returns the ANSI color code for the given color. COLOR_DEFAULT is -// an invalid input. -const char* GetAnsiColorCode(GTestColor color) { - switch (color) { - case COLOR_RED: return "1"; - case COLOR_GREEN: return "2"; - case COLOR_YELLOW: return "3"; - default: return NULL; - }; -} - -#endif // GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE - -// Returns true iff Google Test should use colors in the output. -bool ShouldUseColor(bool stdout_is_tty) { - const char* const gtest_color = GTEST_FLAG(color).c_str(); - - if (String::CaseInsensitiveCStringEquals(gtest_color, "auto")) { -#if GTEST_OS_WINDOWS - // On Windows the TERM variable is usually not set, but the - // console there does support colors. - return stdout_is_tty; -#else - // On non-Windows platforms, we rely on the TERM variable. - const char* const term = posix::GetEnv("TERM"); - const bool term_supports_color = - String::CStringEquals(term, "xterm") || - String::CStringEquals(term, "xterm-color") || - String::CStringEquals(term, "xterm-256color") || - String::CStringEquals(term, "screen") || - String::CStringEquals(term, "screen-256color") || - String::CStringEquals(term, "linux") || - String::CStringEquals(term, "cygwin"); - return stdout_is_tty && term_supports_color; -#endif // GTEST_OS_WINDOWS - } - - return String::CaseInsensitiveCStringEquals(gtest_color, "yes") || - String::CaseInsensitiveCStringEquals(gtest_color, "true") || - String::CaseInsensitiveCStringEquals(gtest_color, "t") || - String::CStringEquals(gtest_color, "1"); - // We take "yes", "true", "t", and "1" as meaning "yes". If the - // value is neither one of these nor "auto", we treat it as "no" to - // be conservative. -} - -// Helpers for printing colored strings to stdout. Note that on Windows, we -// cannot simply emit special characters and have the terminal change colors. -// This routine must actually emit the characters rather than return a string -// that would be colored when printed, as can be done on Linux. -void ColoredPrintf(GTestColor color, const char* fmt, ...) { - va_list args; - va_start(args, fmt); - -#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || GTEST_OS_ZOS || GTEST_OS_IOS - const bool use_color = false; -#else - static const bool in_color_mode = - ShouldUseColor(posix::IsATTY(posix::FileNo(stdout)) != 0); - const bool use_color = in_color_mode && (color != COLOR_DEFAULT); -#endif // GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || GTEST_OS_ZOS - // The '!= 0' comparison is necessary to satisfy MSVC 7.1. - - if (!use_color) { - vprintf(fmt, args); - va_end(args); - return; - } - -#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE - const HANDLE stdout_handle = GetStdHandle(STD_OUTPUT_HANDLE); - - // Gets the current text color. - CONSOLE_SCREEN_BUFFER_INFO buffer_info; - GetConsoleScreenBufferInfo(stdout_handle, &buffer_info); - const WORD old_color_attrs = buffer_info.wAttributes; - - // We need to flush the stream buffers into the console before each - // SetConsoleTextAttribute call lest it affect the text that is already - // printed but has not yet reached the console. - fflush(stdout); - SetConsoleTextAttribute(stdout_handle, - GetColorAttribute(color) | FOREGROUND_INTENSITY); - vprintf(fmt, args); - - fflush(stdout); - // Restores the text color. - SetConsoleTextAttribute(stdout_handle, old_color_attrs); -#else - printf("\033[0;3%sm", GetAnsiColorCode(color)); - vprintf(fmt, args); - printf("\033[m"); // Resets the terminal to default. -#endif // GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE - va_end(args); -} - -// Text printed in Google Test's text output and --gunit_list_tests -// output to label the type parameter and value parameter for a test. -static const char kTypeParamLabel[] = "TypeParam"; -static const char kValueParamLabel[] = "GetParam()"; - -void PrintFullTestCommentIfPresent(const TestInfo& test_info) { - const char* const type_param = test_info.type_param(); - const char* const value_param = test_info.value_param(); - - if (type_param != NULL || value_param != NULL) { - printf(", where "); - if (type_param != NULL) { - printf("%s = %s", kTypeParamLabel, type_param); - if (value_param != NULL) - printf(" and "); - } - if (value_param != NULL) { - printf("%s = %s", kValueParamLabel, value_param); - } - } -} - -// This class implements the TestEventListener interface. -// -// Class PrettyUnitTestResultPrinter is copyable. -class PrettyUnitTestResultPrinter : public TestEventListener { - public: - PrettyUnitTestResultPrinter() {} - static void PrintTestName(const char * test_case, const char * test) { - printf("%s.%s", test_case, test); - } - - // The following methods override what's in the TestEventListener class. - virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {} - virtual void OnTestIterationStart(const UnitTest& unit_test, int iteration); - virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test); - virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {} - virtual void OnTestCaseStart(const TestCase& test_case); - virtual void OnTestStart(const TestInfo& test_info); - virtual void OnTestPartResult(const TestPartResult& result); - virtual void OnTestEnd(const TestInfo& test_info); - virtual void OnTestCaseEnd(const TestCase& test_case); - virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test); - virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {} - virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration); - virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {} - - private: - static void PrintFailedTests(const UnitTest& unit_test); -}; - - // Fired before each iteration of tests starts. -void PrettyUnitTestResultPrinter::OnTestIterationStart( - const UnitTest& unit_test, int iteration) { - if (GTEST_FLAG(repeat) != 1) - printf("\nRepeating all tests (iteration %d) . . .\n\n", iteration + 1); - - const char* const filter = GTEST_FLAG(filter).c_str(); - - // Prints the filter if it's not *. This reminds the user that some - // tests may be skipped. - if (!String::CStringEquals(filter, kUniversalFilter)) { - ColoredPrintf(COLOR_YELLOW, - "Note: %s filter = %s\n", GTEST_NAME_, filter); - } - - if (internal::ShouldShard(kTestTotalShards, kTestShardIndex, false)) { - const Int32 shard_index = Int32FromEnvOrDie(kTestShardIndex, -1); - ColoredPrintf(COLOR_YELLOW, - "Note: This is test shard %d of %s.\n", - static_cast(shard_index) + 1, - internal::posix::GetEnv(kTestTotalShards)); - } - - if (GTEST_FLAG(shuffle)) { - ColoredPrintf(COLOR_YELLOW, - "Note: Randomizing tests' orders with a seed of %d .\n", - unit_test.random_seed()); - } - - ColoredPrintf(COLOR_GREEN, "[==========] "); - printf("Running %s from %s.\n", - FormatTestCount(unit_test.test_to_run_count()).c_str(), - FormatTestCaseCount(unit_test.test_case_to_run_count()).c_str()); - fflush(stdout); -} - -void PrettyUnitTestResultPrinter::OnEnvironmentsSetUpStart( - const UnitTest& /*unit_test*/) { - ColoredPrintf(COLOR_GREEN, "[----------] "); - printf("Global test environment set-up.\n"); - fflush(stdout); -} - -void PrettyUnitTestResultPrinter::OnTestCaseStart(const TestCase& test_case) { - const std::string counts = - FormatCountableNoun(test_case.test_to_run_count(), "test", "tests"); - ColoredPrintf(COLOR_GREEN, "[----------] "); - printf("%s from %s", counts.c_str(), test_case.name()); - if (test_case.type_param() == NULL) { - printf("\n"); - } else { - printf(", where %s = %s\n", kTypeParamLabel, test_case.type_param()); - } - fflush(stdout); -} - -void PrettyUnitTestResultPrinter::OnTestStart(const TestInfo& test_info) { - ColoredPrintf(COLOR_GREEN, "[ RUN ] "); - PrintTestName(test_info.test_case_name(), test_info.name()); - printf("\n"); - fflush(stdout); -} - -// Called after an assertion failure. -void PrettyUnitTestResultPrinter::OnTestPartResult( - const TestPartResult& result) { - // If the test part succeeded, we don't need to do anything. - if (result.type() == TestPartResult::kSuccess) - return; - - // Print failure message from the assertion (e.g. expected this and got that). - PrintTestPartResult(result); - fflush(stdout); -} - -void PrettyUnitTestResultPrinter::OnTestEnd(const TestInfo& test_info) { - if (test_info.result()->Passed()) { - ColoredPrintf(COLOR_GREEN, "[ OK ] "); - } else { - ColoredPrintf(COLOR_RED, "[ FAILED ] "); - } - PrintTestName(test_info.test_case_name(), test_info.name()); - if (test_info.result()->Failed()) - PrintFullTestCommentIfPresent(test_info); - - if (GTEST_FLAG(print_time)) { - printf(" (%s ms)\n", internal::StreamableToString( - test_info.result()->elapsed_time()).c_str()); - } else { - printf("\n"); - } - fflush(stdout); -} - -void PrettyUnitTestResultPrinter::OnTestCaseEnd(const TestCase& test_case) { - if (!GTEST_FLAG(print_time)) return; - - const std::string counts = - FormatCountableNoun(test_case.test_to_run_count(), "test", "tests"); - ColoredPrintf(COLOR_GREEN, "[----------] "); - printf("%s from %s (%s ms total)\n\n", - counts.c_str(), test_case.name(), - internal::StreamableToString(test_case.elapsed_time()).c_str()); - fflush(stdout); -} - -void PrettyUnitTestResultPrinter::OnEnvironmentsTearDownStart( - const UnitTest& /*unit_test*/) { - ColoredPrintf(COLOR_GREEN, "[----------] "); - printf("Global test environment tear-down\n"); - fflush(stdout); -} - -// Internal helper for printing the list of failed tests. -void PrettyUnitTestResultPrinter::PrintFailedTests(const UnitTest& unit_test) { - const int failed_test_count = unit_test.failed_test_count(); - if (failed_test_count == 0) { - return; - } - - for (int i = 0; i < unit_test.total_test_case_count(); ++i) { - const TestCase& test_case = *unit_test.GetTestCase(i); - if (!test_case.should_run() || (test_case.failed_test_count() == 0)) { - continue; - } - for (int j = 0; j < test_case.total_test_count(); ++j) { - const TestInfo& test_info = *test_case.GetTestInfo(j); - if (!test_info.should_run() || test_info.result()->Passed()) { - continue; - } - ColoredPrintf(COLOR_RED, "[ FAILED ] "); - printf("%s.%s", test_case.name(), test_info.name()); - PrintFullTestCommentIfPresent(test_info); - printf("\n"); - } - } -} - -void PrettyUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test, - int /*iteration*/) { - ColoredPrintf(COLOR_GREEN, "[==========] "); - printf("%s from %s ran.", - FormatTestCount(unit_test.test_to_run_count()).c_str(), - FormatTestCaseCount(unit_test.test_case_to_run_count()).c_str()); - if (GTEST_FLAG(print_time)) { - printf(" (%s ms total)", - internal::StreamableToString(unit_test.elapsed_time()).c_str()); - } - printf("\n"); - ColoredPrintf(COLOR_GREEN, "[ PASSED ] "); - printf("%s.\n", FormatTestCount(unit_test.successful_test_count()).c_str()); - - int num_failures = unit_test.failed_test_count(); - if (!unit_test.Passed()) { - const int failed_test_count = unit_test.failed_test_count(); - ColoredPrintf(COLOR_RED, "[ FAILED ] "); - printf("%s, listed below:\n", FormatTestCount(failed_test_count).c_str()); - PrintFailedTests(unit_test); - printf("\n%2d FAILED %s\n", num_failures, - num_failures == 1 ? "TEST" : "TESTS"); - } - - int num_disabled = unit_test.reportable_disabled_test_count(); - if (num_disabled && !GTEST_FLAG(also_run_disabled_tests)) { - if (!num_failures) { - printf("\n"); // Add a spacer if no FAILURE banner is displayed. - } - ColoredPrintf(COLOR_YELLOW, - " YOU HAVE %d DISABLED %s\n\n", - num_disabled, - num_disabled == 1 ? "TEST" : "TESTS"); - } - // Ensure that Google Test output is printed before, e.g., heapchecker output. - fflush(stdout); -} - -// End PrettyUnitTestResultPrinter - -// class TestEventRepeater -// -// This class forwards events to other event listeners. -class TestEventRepeater : public TestEventListener { - public: - TestEventRepeater() : forwarding_enabled_(true) {} - virtual ~TestEventRepeater(); - void Append(TestEventListener *listener); - TestEventListener* Release(TestEventListener* listener); - - // Controls whether events will be forwarded to listeners_. Set to false - // in death test child processes. - bool forwarding_enabled() const { return forwarding_enabled_; } - void set_forwarding_enabled(bool enable) { forwarding_enabled_ = enable; } - - virtual void OnTestProgramStart(const UnitTest& unit_test); - virtual void OnTestIterationStart(const UnitTest& unit_test, int iteration); - virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test); - virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test); - virtual void OnTestCaseStart(const TestCase& test_case); - virtual void OnTestStart(const TestInfo& test_info); - virtual void OnTestPartResult(const TestPartResult& result); - virtual void OnTestEnd(const TestInfo& test_info); - virtual void OnTestCaseEnd(const TestCase& test_case); - virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test); - virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test); - virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration); - virtual void OnTestProgramEnd(const UnitTest& unit_test); - - private: - // Controls whether events will be forwarded to listeners_. Set to false - // in death test child processes. - bool forwarding_enabled_; - // The list of listeners that receive events. - std::vector listeners_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventRepeater); -}; - -TestEventRepeater::~TestEventRepeater() { - ForEach(listeners_, Delete); -} - -void TestEventRepeater::Append(TestEventListener *listener) { - listeners_.push_back(listener); -} - -// TODO(vladl@google.com): Factor the search functionality into Vector::Find. -TestEventListener* TestEventRepeater::Release(TestEventListener *listener) { - for (size_t i = 0; i < listeners_.size(); ++i) { - if (listeners_[i] == listener) { - listeners_.erase(listeners_.begin() + i); - return listener; - } - } - - return NULL; -} - -// Since most methods are very similar, use macros to reduce boilerplate. -// This defines a member that forwards the call to all listeners. -#define GTEST_REPEATER_METHOD_(Name, Type) \ -void TestEventRepeater::Name(const Type& parameter) { \ - if (forwarding_enabled_) { \ - for (size_t i = 0; i < listeners_.size(); i++) { \ - listeners_[i]->Name(parameter); \ - } \ - } \ -} -// This defines a member that forwards the call to all listeners in reverse -// order. -#define GTEST_REVERSE_REPEATER_METHOD_(Name, Type) \ -void TestEventRepeater::Name(const Type& parameter) { \ - if (forwarding_enabled_) { \ - for (int i = static_cast(listeners_.size()) - 1; i >= 0; i--) { \ - listeners_[i]->Name(parameter); \ - } \ - } \ -} - -GTEST_REPEATER_METHOD_(OnTestProgramStart, UnitTest) -GTEST_REPEATER_METHOD_(OnEnvironmentsSetUpStart, UnitTest) -GTEST_REPEATER_METHOD_(OnTestCaseStart, TestCase) -GTEST_REPEATER_METHOD_(OnTestStart, TestInfo) -GTEST_REPEATER_METHOD_(OnTestPartResult, TestPartResult) -GTEST_REPEATER_METHOD_(OnEnvironmentsTearDownStart, UnitTest) -GTEST_REVERSE_REPEATER_METHOD_(OnEnvironmentsSetUpEnd, UnitTest) -GTEST_REVERSE_REPEATER_METHOD_(OnEnvironmentsTearDownEnd, UnitTest) -GTEST_REVERSE_REPEATER_METHOD_(OnTestEnd, TestInfo) -GTEST_REVERSE_REPEATER_METHOD_(OnTestCaseEnd, TestCase) -GTEST_REVERSE_REPEATER_METHOD_(OnTestProgramEnd, UnitTest) - -#undef GTEST_REPEATER_METHOD_ -#undef GTEST_REVERSE_REPEATER_METHOD_ - -void TestEventRepeater::OnTestIterationStart(const UnitTest& unit_test, - int iteration) { - if (forwarding_enabled_) { - for (size_t i = 0; i < listeners_.size(); i++) { - listeners_[i]->OnTestIterationStart(unit_test, iteration); - } - } -} - -void TestEventRepeater::OnTestIterationEnd(const UnitTest& unit_test, - int iteration) { - if (forwarding_enabled_) { - for (int i = static_cast(listeners_.size()) - 1; i >= 0; i--) { - listeners_[i]->OnTestIterationEnd(unit_test, iteration); - } - } -} - -// End TestEventRepeater - -// This class generates an XML output file. -class XmlUnitTestResultPrinter : public EmptyTestEventListener { - public: - explicit XmlUnitTestResultPrinter(const char* output_file); - - virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration); - - private: - // Is c a whitespace character that is normalized to a space character - // when it appears in an XML attribute value? - static bool IsNormalizableWhitespace(char c) { - return c == 0x9 || c == 0xA || c == 0xD; - } - - // May c appear in a well-formed XML document? - static bool IsValidXmlCharacter(char c) { - return IsNormalizableWhitespace(c) || c >= 0x20; - } - - // Returns an XML-escaped copy of the input string str. If - // is_attribute is true, the text is meant to appear as an attribute - // value, and normalizable whitespace is preserved by replacing it - // with character references. - static std::string EscapeXml(const std::string& str, bool is_attribute); - - // Returns the given string with all characters invalid in XML removed. - static std::string RemoveInvalidXmlCharacters(const std::string& str); - - // Convenience wrapper around EscapeXml when str is an attribute value. - static std::string EscapeXmlAttribute(const std::string& str) { - return EscapeXml(str, true); - } - - // Convenience wrapper around EscapeXml when str is not an attribute value. - static std::string EscapeXmlText(const char* str) { - return EscapeXml(str, false); - } - - // Verifies that the given attribute belongs to the given element and - // streams the attribute as XML. - static void OutputXmlAttribute(std::ostream* stream, - const std::string& element_name, - const std::string& name, - const std::string& value); - - // Streams an XML CDATA section, escaping invalid CDATA sequences as needed. - static void OutputXmlCDataSection(::std::ostream* stream, const char* data); - - // Streams an XML representation of a TestInfo object. - static void OutputXmlTestInfo(::std::ostream* stream, - const char* test_case_name, - const TestInfo& test_info); - - // Prints an XML representation of a TestCase object - static void PrintXmlTestCase(::std::ostream* stream, - const TestCase& test_case); - - // Prints an XML summary of unit_test to output stream out. - static void PrintXmlUnitTest(::std::ostream* stream, - const UnitTest& unit_test); - - // Produces a string representing the test properties in a result as space - // delimited XML attributes based on the property key="value" pairs. - // When the std::string is not empty, it includes a space at the beginning, - // to delimit this attribute from prior attributes. - static std::string TestPropertiesAsXmlAttributes(const TestResult& result); - - // The output file. - const std::string output_file_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(XmlUnitTestResultPrinter); -}; - -// Creates a new XmlUnitTestResultPrinter. -XmlUnitTestResultPrinter::XmlUnitTestResultPrinter(const char* output_file) - : output_file_(output_file) { - if (output_file_.c_str() == NULL || output_file_.empty()) { - fprintf(stderr, "XML output file may not be null\n"); - fflush(stderr); - exit(EXIT_FAILURE); - } -} - -// Called after the unit test ends. -void XmlUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test, - int /*iteration*/) { - FILE* xmlout = NULL; - FilePath output_file(output_file_); - FilePath output_dir(output_file.RemoveFileName()); - - if (output_dir.CreateDirectoriesRecursively()) { - xmlout = posix::FOpen(output_file_.c_str(), "w"); - } - if (xmlout == NULL) { - // TODO(wan): report the reason of the failure. - // - // We don't do it for now as: - // - // 1. There is no urgent need for it. - // 2. It's a bit involved to make the errno variable thread-safe on - // all three operating systems (Linux, Windows, and Mac OS). - // 3. To interpret the meaning of errno in a thread-safe way, - // we need the strerror_r() function, which is not available on - // Windows. - fprintf(stderr, - "Unable to open file \"%s\"\n", - output_file_.c_str()); - fflush(stderr); - exit(EXIT_FAILURE); - } - std::stringstream stream; - PrintXmlUnitTest(&stream, unit_test); - fprintf(xmlout, "%s", StringStreamToString(&stream).c_str()); - fclose(xmlout); -} - -// Returns an XML-escaped copy of the input string str. If is_attribute -// is true, the text is meant to appear as an attribute value, and -// normalizable whitespace is preserved by replacing it with character -// references. -// -// Invalid XML characters in str, if any, are stripped from the output. -// It is expected that most, if not all, of the text processed by this -// module will consist of ordinary English text. -// If this module is ever modified to produce version 1.1 XML output, -// most invalid characters can be retained using character references. -// TODO(wan): It might be nice to have a minimally invasive, human-readable -// escaping scheme for invalid characters, rather than dropping them. -std::string XmlUnitTestResultPrinter::EscapeXml( - const std::string& str, bool is_attribute) { - Message m; - - for (size_t i = 0; i < str.size(); ++i) { - const char ch = str[i]; - switch (ch) { - case '<': - m << "<"; - break; - case '>': - m << ">"; - break; - case '&': - m << "&"; - break; - case '\'': - if (is_attribute) - m << "'"; - else - m << '\''; - break; - case '"': - if (is_attribute) - m << """; - else - m << '"'; - break; - default: - if (IsValidXmlCharacter(ch)) { - if (is_attribute && IsNormalizableWhitespace(ch)) - m << "&#x" << String::FormatByte(static_cast(ch)) - << ";"; - else - m << ch; - } - break; - } - } - - return m.GetString(); -} - -// Returns the given string with all characters invalid in XML removed. -// Currently invalid characters are dropped from the string. An -// alternative is to replace them with certain characters such as . or ?. -std::string XmlUnitTestResultPrinter::RemoveInvalidXmlCharacters( - const std::string& str) { - std::string output; - output.reserve(str.size()); - for (std::string::const_iterator it = str.begin(); it != str.end(); ++it) - if (IsValidXmlCharacter(*it)) - output.push_back(*it); - - return output; -} - -// The following routines generate an XML representation of a UnitTest -// object. -// -// This is how Google Test concepts map to the DTD: -// -// <-- corresponds to a UnitTest object -// <-- corresponds to a TestCase object -// <-- corresponds to a TestInfo object -// ... -// ... -// ... -// <-- individual assertion failures -// -// -// - -// Formats the given time in milliseconds as seconds. -std::string FormatTimeInMillisAsSeconds(TimeInMillis ms) { - ::std::stringstream ss; - ss << ms/1000.0; - return ss.str(); -} - -// Converts the given epoch time in milliseconds to a date string in the ISO -// 8601 format, without the timezone information. -std::string FormatEpochTimeInMillisAsIso8601(TimeInMillis ms) { - // Using non-reentrant version as localtime_r is not portable. - time_t seconds = static_cast(ms / 1000); -#ifdef _MSC_VER -# pragma warning(push) // Saves the current warning state. -# pragma warning(disable:4996) // Temporarily disables warning 4996 - // (function or variable may be unsafe). - const struct tm* const time_struct = localtime(&seconds); // NOLINT -# pragma warning(pop) // Restores the warning state again. -#else - const struct tm* const time_struct = localtime(&seconds); // NOLINT -#endif - if (time_struct == NULL) - return ""; // Invalid ms value - - // YYYY-MM-DDThh:mm:ss - return StreamableToString(time_struct->tm_year + 1900) + "-" + - String::FormatIntWidth2(time_struct->tm_mon + 1) + "-" + - String::FormatIntWidth2(time_struct->tm_mday) + "T" + - String::FormatIntWidth2(time_struct->tm_hour) + ":" + - String::FormatIntWidth2(time_struct->tm_min) + ":" + - String::FormatIntWidth2(time_struct->tm_sec); -} - -// Streams an XML CDATA section, escaping invalid CDATA sequences as needed. -void XmlUnitTestResultPrinter::OutputXmlCDataSection(::std::ostream* stream, - const char* data) { - const char* segment = data; - *stream << ""); - if (next_segment != NULL) { - stream->write( - segment, static_cast(next_segment - segment)); - *stream << "]]>]]>"); - } else { - *stream << segment; - break; - } - } - *stream << "]]>"; -} - -void XmlUnitTestResultPrinter::OutputXmlAttribute( - std::ostream* stream, - const std::string& element_name, - const std::string& name, - const std::string& value) { - const std::vector& allowed_names = - GetReservedAttributesForElement(element_name); - - GTEST_CHECK_(std::find(allowed_names.begin(), allowed_names.end(), name) != - allowed_names.end()) - << "Attribute " << name << " is not allowed for element <" << element_name - << ">."; - - *stream << " " << name << "=\"" << EscapeXmlAttribute(value) << "\""; -} - -// Prints an XML representation of a TestInfo object. -// TODO(wan): There is also value in printing properties with the plain printer. -void XmlUnitTestResultPrinter::OutputXmlTestInfo(::std::ostream* stream, - const char* test_case_name, - const TestInfo& test_info) { - const TestResult& result = *test_info.result(); - const std::string kTestcase = "testcase"; - - *stream << " \n"; - } - const string location = internal::FormatCompilerIndependentFileLocation( - part.file_name(), part.line_number()); - const string summary = location + "\n" + part.summary(); - *stream << " "; - const string detail = location + "\n" + part.message(); - OutputXmlCDataSection(stream, RemoveInvalidXmlCharacters(detail).c_str()); - *stream << "\n"; - } - } - - if (failures == 0) - *stream << " />\n"; - else - *stream << " \n"; -} - -// Prints an XML representation of a TestCase object -void XmlUnitTestResultPrinter::PrintXmlTestCase(std::ostream* stream, - const TestCase& test_case) { - const std::string kTestsuite = "testsuite"; - *stream << " <" << kTestsuite; - OutputXmlAttribute(stream, kTestsuite, "name", test_case.name()); - OutputXmlAttribute(stream, kTestsuite, "tests", - StreamableToString(test_case.reportable_test_count())); - OutputXmlAttribute(stream, kTestsuite, "failures", - StreamableToString(test_case.failed_test_count())); - OutputXmlAttribute( - stream, kTestsuite, "disabled", - StreamableToString(test_case.reportable_disabled_test_count())); - OutputXmlAttribute(stream, kTestsuite, "errors", "0"); - OutputXmlAttribute(stream, kTestsuite, "time", - FormatTimeInMillisAsSeconds(test_case.elapsed_time())); - *stream << TestPropertiesAsXmlAttributes(test_case.ad_hoc_test_result()) - << ">\n"; - - for (int i = 0; i < test_case.total_test_count(); ++i) { - if (test_case.GetTestInfo(i)->is_reportable()) - OutputXmlTestInfo(stream, test_case.name(), *test_case.GetTestInfo(i)); - } - *stream << " \n"; -} - -// Prints an XML summary of unit_test to output stream out. -void XmlUnitTestResultPrinter::PrintXmlUnitTest(std::ostream* stream, - const UnitTest& unit_test) { - const std::string kTestsuites = "testsuites"; - - *stream << "\n"; - *stream << "<" << kTestsuites; - - OutputXmlAttribute(stream, kTestsuites, "tests", - StreamableToString(unit_test.reportable_test_count())); - OutputXmlAttribute(stream, kTestsuites, "failures", - StreamableToString(unit_test.failed_test_count())); - OutputXmlAttribute( - stream, kTestsuites, "disabled", - StreamableToString(unit_test.reportable_disabled_test_count())); - OutputXmlAttribute(stream, kTestsuites, "errors", "0"); - OutputXmlAttribute( - stream, kTestsuites, "timestamp", - FormatEpochTimeInMillisAsIso8601(unit_test.start_timestamp())); - OutputXmlAttribute(stream, kTestsuites, "time", - FormatTimeInMillisAsSeconds(unit_test.elapsed_time())); - - if (GTEST_FLAG(shuffle)) { - OutputXmlAttribute(stream, kTestsuites, "random_seed", - StreamableToString(unit_test.random_seed())); - } - - *stream << TestPropertiesAsXmlAttributes(unit_test.ad_hoc_test_result()); - - OutputXmlAttribute(stream, kTestsuites, "name", "AllTests"); - *stream << ">\n"; - - for (int i = 0; i < unit_test.total_test_case_count(); ++i) { - if (unit_test.GetTestCase(i)->reportable_test_count() > 0) - PrintXmlTestCase(stream, *unit_test.GetTestCase(i)); - } - *stream << "\n"; -} - -// Produces a string representing the test properties in a result as space -// delimited XML attributes based on the property key="value" pairs. -std::string XmlUnitTestResultPrinter::TestPropertiesAsXmlAttributes( - const TestResult& result) { - Message attributes; - for (int i = 0; i < result.test_property_count(); ++i) { - const TestProperty& property = result.GetTestProperty(i); - attributes << " " << property.key() << "=" - << "\"" << EscapeXmlAttribute(property.value()) << "\""; - } - return attributes.GetString(); -} - -// End XmlUnitTestResultPrinter - -#if GTEST_CAN_STREAM_RESULTS_ - -// Checks if str contains '=', '&', '%' or '\n' characters. If yes, -// replaces them by "%xx" where xx is their hexadecimal value. For -// example, replaces "=" with "%3D". This algorithm is O(strlen(str)) -// in both time and space -- important as the input str may contain an -// arbitrarily long test failure message and stack trace. -string StreamingListener::UrlEncode(const char* str) { - string result; - result.reserve(strlen(str) + 1); - for (char ch = *str; ch != '\0'; ch = *++str) { - switch (ch) { - case '%': - case '=': - case '&': - case '\n': - result.append("%" + String::FormatByte(static_cast(ch))); - break; - default: - result.push_back(ch); - break; - } - } - return result; -} - -void StreamingListener::SocketWriter::MakeConnection() { - GTEST_CHECK_(sockfd_ == -1) - << "MakeConnection() can't be called when there is already a connection."; - - addrinfo hints; - memset(&hints, 0, sizeof(hints)); - hints.ai_family = AF_UNSPEC; // To allow both IPv4 and IPv6 addresses. - hints.ai_socktype = SOCK_STREAM; - addrinfo* servinfo = NULL; - - // Use the getaddrinfo() to get a linked list of IP addresses for - // the given host name. - const int error_num = getaddrinfo( - host_name_.c_str(), port_num_.c_str(), &hints, &servinfo); - if (error_num != 0) { - GTEST_LOG_(WARNING) << "stream_result_to: getaddrinfo() failed: " - << gai_strerror(error_num); - } - - // Loop through all the results and connect to the first we can. - for (addrinfo* cur_addr = servinfo; sockfd_ == -1 && cur_addr != NULL; - cur_addr = cur_addr->ai_next) { - sockfd_ = socket( - cur_addr->ai_family, cur_addr->ai_socktype, cur_addr->ai_protocol); - if (sockfd_ != -1) { - // Connect the client socket to the server socket. - if (connect(sockfd_, cur_addr->ai_addr, cur_addr->ai_addrlen) == -1) { - close(sockfd_); - sockfd_ = -1; - } - } - } - - freeaddrinfo(servinfo); // all done with this structure - - if (sockfd_ == -1) { - GTEST_LOG_(WARNING) << "stream_result_to: failed to connect to " - << host_name_ << ":" << port_num_; - } -} - -// End of class Streaming Listener -#endif // GTEST_CAN_STREAM_RESULTS__ - -// Class ScopedTrace - -// Pushes the given source file location and message onto a per-thread -// trace stack maintained by Google Test. -ScopedTrace::ScopedTrace(const char* file, int line, const Message& message) - GTEST_LOCK_EXCLUDED_(&UnitTest::mutex_) { - TraceInfo trace; - trace.file = file; - trace.line = line; - trace.message = message.GetString(); - - UnitTest::GetInstance()->PushGTestTrace(trace); -} - -// Pops the info pushed by the c'tor. -ScopedTrace::~ScopedTrace() - GTEST_LOCK_EXCLUDED_(&UnitTest::mutex_) { - UnitTest::GetInstance()->PopGTestTrace(); -} - - -// class OsStackTraceGetter - -// Returns the current OS stack trace as an std::string. Parameters: -// -// max_depth - the maximum number of stack frames to be included -// in the trace. -// skip_count - the number of top frames to be skipped; doesn't count -// against max_depth. -// -string OsStackTraceGetter::CurrentStackTrace(int /* max_depth */, - int /* skip_count */) - GTEST_LOCK_EXCLUDED_(mutex_) { - return ""; -} - -void OsStackTraceGetter::UponLeavingGTest() - GTEST_LOCK_EXCLUDED_(mutex_) { -} - -const char* const -OsStackTraceGetter::kElidedFramesMarker = - "... " GTEST_NAME_ " internal frames ..."; - -// A helper class that creates the premature-exit file in its -// constructor and deletes the file in its destructor. -class ScopedPrematureExitFile { - public: - explicit ScopedPrematureExitFile(const char* premature_exit_filepath) - : premature_exit_filepath_(premature_exit_filepath) { - // If a path to the premature-exit file is specified... - if (premature_exit_filepath != NULL && *premature_exit_filepath != '\0') { - // create the file with a single "0" character in it. I/O - // errors are ignored as there's nothing better we can do and we - // don't want to fail the test because of this. - FILE* pfile = posix::FOpen(premature_exit_filepath, "w"); - fwrite("0", 1, 1, pfile); - fclose(pfile); - } - } - - ~ScopedPrematureExitFile() { - if (premature_exit_filepath_ != NULL && *premature_exit_filepath_ != '\0') { - remove(premature_exit_filepath_); - } - } - - private: - const char* const premature_exit_filepath_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedPrematureExitFile); -}; - -} // namespace internal - -// class TestEventListeners - -TestEventListeners::TestEventListeners() - : repeater_(new internal::TestEventRepeater()), - default_result_printer_(NULL), - default_xml_generator_(NULL) { -} - -TestEventListeners::~TestEventListeners() { delete repeater_; } - -// Returns the standard listener responsible for the default console -// output. Can be removed from the listeners list to shut down default -// console output. Note that removing this object from the listener list -// with Release transfers its ownership to the user. -void TestEventListeners::Append(TestEventListener* listener) { - repeater_->Append(listener); -} - -// Removes the given event listener from the list and returns it. It then -// becomes the caller's responsibility to delete the listener. Returns -// NULL if the listener is not found in the list. -TestEventListener* TestEventListeners::Release(TestEventListener* listener) { - if (listener == default_result_printer_) - default_result_printer_ = NULL; - else if (listener == default_xml_generator_) - default_xml_generator_ = NULL; - return repeater_->Release(listener); -} - -// Returns repeater that broadcasts the TestEventListener events to all -// subscribers. -TestEventListener* TestEventListeners::repeater() { return repeater_; } - -// Sets the default_result_printer attribute to the provided listener. -// The listener is also added to the listener list and previous -// default_result_printer is removed from it and deleted. The listener can -// also be NULL in which case it will not be added to the list. Does -// nothing if the previous and the current listener objects are the same. -void TestEventListeners::SetDefaultResultPrinter(TestEventListener* listener) { - if (default_result_printer_ != listener) { - // It is an error to pass this method a listener that is already in the - // list. - delete Release(default_result_printer_); - default_result_printer_ = listener; - if (listener != NULL) - Append(listener); - } -} - -// Sets the default_xml_generator attribute to the provided listener. The -// listener is also added to the listener list and previous -// default_xml_generator is removed from it and deleted. The listener can -// also be NULL in which case it will not be added to the list. Does -// nothing if the previous and the current listener objects are the same. -void TestEventListeners::SetDefaultXmlGenerator(TestEventListener* listener) { - if (default_xml_generator_ != listener) { - // It is an error to pass this method a listener that is already in the - // list. - delete Release(default_xml_generator_); - default_xml_generator_ = listener; - if (listener != NULL) - Append(listener); - } -} - -// Controls whether events will be forwarded by the repeater to the -// listeners in the list. -bool TestEventListeners::EventForwardingEnabled() const { - return repeater_->forwarding_enabled(); -} - -void TestEventListeners::SuppressEventForwarding() { - repeater_->set_forwarding_enabled(false); -} - -// class UnitTest - -// Gets the singleton UnitTest object. The first time this method is -// called, a UnitTest object is constructed and returned. Consecutive -// calls will return the same object. -// -// We don't protect this under mutex_ as a user is not supposed to -// call this before main() starts, from which point on the return -// value will never change. -UnitTest* UnitTest::GetInstance() { - // When compiled with MSVC 7.1 in optimized mode, destroying the - // UnitTest object upon exiting the program messes up the exit code, - // causing successful tests to appear failed. We have to use a - // different implementation in this case to bypass the compiler bug. - // This implementation makes the compiler happy, at the cost of - // leaking the UnitTest object. - - // CodeGear C++Builder insists on a public destructor for the - // default implementation. Use this implementation to keep good OO - // design with private destructor. - -#if (_MSC_VER == 1310 && !defined(_DEBUG)) || defined(__BORLANDC__) - static UnitTest* const instance = new UnitTest; - return instance; -#else - static UnitTest instance; - return &instance; -#endif // (_MSC_VER == 1310 && !defined(_DEBUG)) || defined(__BORLANDC__) -} - -// Gets the number of successful test cases. -int UnitTest::successful_test_case_count() const { - return impl()->successful_test_case_count(); -} - -// Gets the number of failed test cases. -int UnitTest::failed_test_case_count() const { - return impl()->failed_test_case_count(); -} - -// Gets the number of all test cases. -int UnitTest::total_test_case_count() const { - return impl()->total_test_case_count(); -} - -// Gets the number of all test cases that contain at least one test -// that should run. -int UnitTest::test_case_to_run_count() const { - return impl()->test_case_to_run_count(); -} - -// Gets the number of successful tests. -int UnitTest::successful_test_count() const { - return impl()->successful_test_count(); -} - -// Gets the number of failed tests. -int UnitTest::failed_test_count() const { return impl()->failed_test_count(); } - -// Gets the number of disabled tests that will be reported in the XML report. -int UnitTest::reportable_disabled_test_count() const { - return impl()->reportable_disabled_test_count(); -} - -// Gets the number of disabled tests. -int UnitTest::disabled_test_count() const { - return impl()->disabled_test_count(); -} - -// Gets the number of tests to be printed in the XML report. -int UnitTest::reportable_test_count() const { - return impl()->reportable_test_count(); -} - -// Gets the number of all tests. -int UnitTest::total_test_count() const { return impl()->total_test_count(); } - -// Gets the number of tests that should run. -int UnitTest::test_to_run_count() const { return impl()->test_to_run_count(); } - -// Gets the time of the test program start, in ms from the start of the -// UNIX epoch. -internal::TimeInMillis UnitTest::start_timestamp() const { - return impl()->start_timestamp(); -} - -// Gets the elapsed time, in milliseconds. -internal::TimeInMillis UnitTest::elapsed_time() const { - return impl()->elapsed_time(); -} - -// Returns true iff the unit test passed (i.e. all test cases passed). -bool UnitTest::Passed() const { return impl()->Passed(); } - -// Returns true iff the unit test failed (i.e. some test case failed -// or something outside of all tests failed). -bool UnitTest::Failed() const { return impl()->Failed(); } - -// Gets the i-th test case among all the test cases. i can range from 0 to -// total_test_case_count() - 1. If i is not in that range, returns NULL. -const TestCase* UnitTest::GetTestCase(int i) const { - return impl()->GetTestCase(i); -} - -// Returns the TestResult containing information on test failures and -// properties logged outside of individual test cases. -const TestResult& UnitTest::ad_hoc_test_result() const { - return *impl()->ad_hoc_test_result(); -} - -// Gets the i-th test case among all the test cases. i can range from 0 to -// total_test_case_count() - 1. If i is not in that range, returns NULL. -TestCase* UnitTest::GetMutableTestCase(int i) { - return impl()->GetMutableTestCase(i); -} - -// Returns the list of event listeners that can be used to track events -// inside Google Test. -TestEventListeners& UnitTest::listeners() { - return *impl()->listeners(); -} - -// Registers and returns a global test environment. When a test -// program is run, all global test environments will be set-up in the -// order they were registered. After all tests in the program have -// finished, all global test environments will be torn-down in the -// *reverse* order they were registered. -// -// The UnitTest object takes ownership of the given environment. -// -// We don't protect this under mutex_, as we only support calling it -// from the main thread. -Environment* UnitTest::AddEnvironment(Environment* env) { - if (env == NULL) { - return NULL; - } - - impl_->environments().push_back(env); - return env; -} - -// Adds a TestPartResult to the current TestResult object. All Google Test -// assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) eventually call -// this to report their results. The user code should use the -// assertion macros instead of calling this directly. -void UnitTest::AddTestPartResult( - TestPartResult::Type result_type, - const char* file_name, - int line_number, - const std::string& message, - const std::string& os_stack_trace) GTEST_LOCK_EXCLUDED_(mutex_) { - Message msg; - msg << message; - - internal::MutexLock lock(&mutex_); - if (impl_->gtest_trace_stack().size() > 0) { - msg << "\n" << GTEST_NAME_ << " trace:"; - - for (int i = static_cast(impl_->gtest_trace_stack().size()); - i > 0; --i) { - const internal::TraceInfo& trace = impl_->gtest_trace_stack()[i - 1]; - msg << "\n" << internal::FormatFileLocation(trace.file, trace.line) - << " " << trace.message; - } - } - - if (os_stack_trace.c_str() != NULL && !os_stack_trace.empty()) { - msg << internal::kStackTraceMarker << os_stack_trace; - } - - const TestPartResult result = - TestPartResult(result_type, file_name, line_number, - msg.GetString().c_str()); - impl_->GetTestPartResultReporterForCurrentThread()-> - ReportTestPartResult(result); - - if (result_type != TestPartResult::kSuccess) { - // gtest_break_on_failure takes precedence over - // gtest_throw_on_failure. This allows a user to set the latter - // in the code (perhaps in order to use Google Test assertions - // with another testing framework) and specify the former on the - // command line for debugging. - if (GTEST_FLAG(break_on_failure)) { -#if GTEST_OS_WINDOWS - // Using DebugBreak on Windows allows gtest to still break into a debugger - // when a failure happens and both the --gtest_break_on_failure and - // the --gtest_catch_exceptions flags are specified. - DebugBreak(); -#else - // Dereference NULL through a volatile pointer to prevent the compiler - // from removing. We use this rather than abort() or __builtin_trap() for - // portability: Symbian doesn't implement abort() well, and some debuggers - // don't correctly trap abort(). - *static_cast(NULL) = 1; -#endif // GTEST_OS_WINDOWS - } else if (GTEST_FLAG(throw_on_failure)) { -#if GTEST_HAS_EXCEPTIONS - throw internal::GoogleTestFailureException(result); -#else - // We cannot call abort() as it generates a pop-up in debug mode - // that cannot be suppressed in VC 7.1 or below. - exit(1); -#endif - } - } -} - -// Adds a TestProperty to the current TestResult object when invoked from -// inside a test, to current TestCase's ad_hoc_test_result_ when invoked -// from SetUpTestCase or TearDownTestCase, or to the global property set -// when invoked elsewhere. If the result already contains a property with -// the same key, the value will be updated. -void UnitTest::RecordProperty(const std::string& key, - const std::string& value) { - impl_->RecordProperty(TestProperty(key, value)); -} - -// Runs all tests in this UnitTest object and prints the result. -// Returns 0 if successful, or 1 otherwise. -// -// We don't protect this under mutex_, as we only support calling it -// from the main thread. -int UnitTest::Run() { - const bool in_death_test_child_process = - internal::GTEST_FLAG(internal_run_death_test).length() > 0; - - // Google Test implements this protocol for catching that a test - // program exits before returning control to Google Test: - // - // 1. Upon start, Google Test creates a file whose absolute path - // is specified by the environment variable - // TEST_PREMATURE_EXIT_FILE. - // 2. When Google Test has finished its work, it deletes the file. - // - // This allows a test runner to set TEST_PREMATURE_EXIT_FILE before - // running a Google-Test-based test program and check the existence - // of the file at the end of the test execution to see if it has - // exited prematurely. - - // If we are in the child process of a death test, don't - // create/delete the premature exit file, as doing so is unnecessary - // and will confuse the parent process. Otherwise, create/delete - // the file upon entering/leaving this function. If the program - // somehow exits before this function has a chance to return, the - // premature-exit file will be left undeleted, causing a test runner - // that understands the premature-exit-file protocol to report the - // test as having failed. - const internal::ScopedPrematureExitFile premature_exit_file( - in_death_test_child_process ? - NULL : internal::posix::GetEnv("TEST_PREMATURE_EXIT_FILE")); - - // Captures the value of GTEST_FLAG(catch_exceptions). This value will be - // used for the duration of the program. - impl()->set_catch_exceptions(GTEST_FLAG(catch_exceptions)); - -#if GTEST_HAS_SEH - // Either the user wants Google Test to catch exceptions thrown by the - // tests or this is executing in the context of death test child - // process. In either case the user does not want to see pop-up dialogs - // about crashes - they are expected. - if (impl()->catch_exceptions() || in_death_test_child_process) { -# if !GTEST_OS_WINDOWS_MOBILE - // SetErrorMode doesn't exist on CE. - SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOALIGNMENTFAULTEXCEPT | - SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX); -# endif // !GTEST_OS_WINDOWS_MOBILE - -# if (defined(_MSC_VER) || GTEST_OS_WINDOWS_MINGW) && !GTEST_OS_WINDOWS_MOBILE - // Death test children can be terminated with _abort(). On Windows, - // _abort() can show a dialog with a warning message. This forces the - // abort message to go to stderr instead. - _set_error_mode(_OUT_TO_STDERR); -# endif - -# if _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE - // In the debug version, Visual Studio pops up a separate dialog - // offering a choice to debug the aborted program. We need to suppress - // this dialog or it will pop up for every EXPECT/ASSERT_DEATH statement - // executed. Google Test will notify the user of any unexpected - // failure via stderr. - // - // VC++ doesn't define _set_abort_behavior() prior to the version 8.0. - // Users of prior VC versions shall suffer the agony and pain of - // clicking through the countless debug dialogs. - // TODO(vladl@google.com): find a way to suppress the abort dialog() in the - // debug mode when compiled with VC 7.1 or lower. - if (!GTEST_FLAG(break_on_failure)) - _set_abort_behavior( - 0x0, // Clear the following flags: - _WRITE_ABORT_MSG | _CALL_REPORTFAULT); // pop-up window, core dump. -# endif - } -#endif // GTEST_HAS_SEH - - return internal::HandleExceptionsInMethodIfSupported( - impl(), - &internal::UnitTestImpl::RunAllTests, - "auxiliary test code (environments or event listeners)") ? 0 : 1; -} - -// Returns the working directory when the first TEST() or TEST_F() was -// executed. -const char* UnitTest::original_working_dir() const { - return impl_->original_working_dir_.c_str(); -} - -// Returns the TestCase object for the test that's currently running, -// or NULL if no test is running. -const TestCase* UnitTest::current_test_case() const - GTEST_LOCK_EXCLUDED_(mutex_) { - internal::MutexLock lock(&mutex_); - return impl_->current_test_case(); -} - -// Returns the TestInfo object for the test that's currently running, -// or NULL if no test is running. -const TestInfo* UnitTest::current_test_info() const - GTEST_LOCK_EXCLUDED_(mutex_) { - internal::MutexLock lock(&mutex_); - return impl_->current_test_info(); -} - -// Returns the random seed used at the start of the current test run. -int UnitTest::random_seed() const { return impl_->random_seed(); } - -#if GTEST_HAS_PARAM_TEST -// Returns ParameterizedTestCaseRegistry object used to keep track of -// value-parameterized tests and instantiate and register them. -internal::ParameterizedTestCaseRegistry& - UnitTest::parameterized_test_registry() - GTEST_LOCK_EXCLUDED_(mutex_) { - return impl_->parameterized_test_registry(); -} -#endif // GTEST_HAS_PARAM_TEST - -// Creates an empty UnitTest. -UnitTest::UnitTest() { - impl_ = new internal::UnitTestImpl(this); -} - -// Destructor of UnitTest. -UnitTest::~UnitTest() { - delete impl_; -} - -// Pushes a trace defined by SCOPED_TRACE() on to the per-thread -// Google Test trace stack. -void UnitTest::PushGTestTrace(const internal::TraceInfo& trace) - GTEST_LOCK_EXCLUDED_(mutex_) { - internal::MutexLock lock(&mutex_); - impl_->gtest_trace_stack().push_back(trace); -} - -// Pops a trace from the per-thread Google Test trace stack. -void UnitTest::PopGTestTrace() - GTEST_LOCK_EXCLUDED_(mutex_) { - internal::MutexLock lock(&mutex_); - impl_->gtest_trace_stack().pop_back(); -} - -namespace internal { - -UnitTestImpl::UnitTestImpl(UnitTest* parent) - : parent_(parent), -#ifdef _MSC_VER -# pragma warning(push) // Saves the current warning state. -# pragma warning(disable:4355) // Temporarily disables warning 4355 - // (using this in initializer). - default_global_test_part_result_reporter_(this), - default_per_thread_test_part_result_reporter_(this), -# pragma warning(pop) // Restores the warning state again. -#else - default_global_test_part_result_reporter_(this), - default_per_thread_test_part_result_reporter_(this), -#endif // _MSC_VER - global_test_part_result_repoter_( - &default_global_test_part_result_reporter_), - per_thread_test_part_result_reporter_( - &default_per_thread_test_part_result_reporter_), -#if GTEST_HAS_PARAM_TEST - parameterized_test_registry_(), - parameterized_tests_registered_(false), -#endif // GTEST_HAS_PARAM_TEST - last_death_test_case_(-1), - current_test_case_(NULL), - current_test_info_(NULL), - ad_hoc_test_result_(), - os_stack_trace_getter_(NULL), - post_flag_parse_init_performed_(false), - random_seed_(0), // Will be overridden by the flag before first use. - random_(0), // Will be reseeded before first use. - start_timestamp_(0), - elapsed_time_(0), -#if GTEST_HAS_DEATH_TEST - death_test_factory_(new DefaultDeathTestFactory), -#endif - // Will be overridden by the flag before first use. - catch_exceptions_(false) { - listeners()->SetDefaultResultPrinter(new PrettyUnitTestResultPrinter); -} - -UnitTestImpl::~UnitTestImpl() { - // Deletes every TestCase. - ForEach(test_cases_, internal::Delete); - - // Deletes every Environment. - ForEach(environments_, internal::Delete); - - delete os_stack_trace_getter_; -} - -// Adds a TestProperty to the current TestResult object when invoked in a -// context of a test, to current test case's ad_hoc_test_result when invoke -// from SetUpTestCase/TearDownTestCase, or to the global property set -// otherwise. If the result already contains a property with the same key, -// the value will be updated. -void UnitTestImpl::RecordProperty(const TestProperty& test_property) { - std::string xml_element; - TestResult* test_result; // TestResult appropriate for property recording. - - if (current_test_info_ != NULL) { - xml_element = "testcase"; - test_result = &(current_test_info_->result_); - } else if (current_test_case_ != NULL) { - xml_element = "testsuite"; - test_result = &(current_test_case_->ad_hoc_test_result_); - } else { - xml_element = "testsuites"; - test_result = &ad_hoc_test_result_; - } - test_result->RecordProperty(xml_element, test_property); -} - -#if GTEST_HAS_DEATH_TEST -// Disables event forwarding if the control is currently in a death test -// subprocess. Must not be called before InitGoogleTest. -void UnitTestImpl::SuppressTestEventsIfInSubprocess() { - if (internal_run_death_test_flag_.get() != NULL) - listeners()->SuppressEventForwarding(); -} -#endif // GTEST_HAS_DEATH_TEST - -// Initializes event listeners performing XML output as specified by -// UnitTestOptions. Must not be called before InitGoogleTest. -void UnitTestImpl::ConfigureXmlOutput() { - const std::string& output_format = UnitTestOptions::GetOutputFormat(); - if (output_format == "xml") { - listeners()->SetDefaultXmlGenerator(new XmlUnitTestResultPrinter( - UnitTestOptions::GetAbsolutePathToOutputFile().c_str())); - } else if (output_format != "") { - printf("WARNING: unrecognized output format \"%s\" ignored.\n", - output_format.c_str()); - fflush(stdout); - } -} - -#if GTEST_CAN_STREAM_RESULTS_ -// Initializes event listeners for streaming test results in string form. -// Must not be called before InitGoogleTest. -void UnitTestImpl::ConfigureStreamingOutput() { - const std::string& target = GTEST_FLAG(stream_result_to); - if (!target.empty()) { - const size_t pos = target.find(':'); - if (pos != std::string::npos) { - listeners()->Append(new StreamingListener(target.substr(0, pos), - target.substr(pos+1))); - } else { - printf("WARNING: unrecognized streaming target \"%s\" ignored.\n", - target.c_str()); - fflush(stdout); - } - } -} -#endif // GTEST_CAN_STREAM_RESULTS_ - -// Performs initialization dependent upon flag values obtained in -// ParseGoogleTestFlagsOnly. Is called from InitGoogleTest after the call to -// ParseGoogleTestFlagsOnly. In case a user neglects to call InitGoogleTest -// this function is also called from RunAllTests. Since this function can be -// called more than once, it has to be idempotent. -void UnitTestImpl::PostFlagParsingInit() { - // Ensures that this function does not execute more than once. - if (!post_flag_parse_init_performed_) { - post_flag_parse_init_performed_ = true; - -#if GTEST_HAS_DEATH_TEST - InitDeathTestSubprocessControlInfo(); - SuppressTestEventsIfInSubprocess(); -#endif // GTEST_HAS_DEATH_TEST - - // Registers parameterized tests. This makes parameterized tests - // available to the UnitTest reflection API without running - // RUN_ALL_TESTS. - RegisterParameterizedTests(); - - // Configures listeners for XML output. This makes it possible for users - // to shut down the default XML output before invoking RUN_ALL_TESTS. - ConfigureXmlOutput(); - -#if GTEST_CAN_STREAM_RESULTS_ - // Configures listeners for streaming test results to the specified server. - ConfigureStreamingOutput(); -#endif // GTEST_CAN_STREAM_RESULTS_ - } -} - -// A predicate that checks the name of a TestCase against a known -// value. -// -// This is used for implementation of the UnitTest class only. We put -// it in the anonymous namespace to prevent polluting the outer -// namespace. -// -// TestCaseNameIs is copyable. -class TestCaseNameIs { - public: - // Constructor. - explicit TestCaseNameIs(const std::string& name) - : name_(name) {} - - // Returns true iff the name of test_case matches name_. - bool operator()(const TestCase* test_case) const { - return test_case != NULL && strcmp(test_case->name(), name_.c_str()) == 0; - } - - private: - std::string name_; -}; - -// Finds and returns a TestCase with the given name. If one doesn't -// exist, creates one and returns it. It's the CALLER'S -// RESPONSIBILITY to ensure that this function is only called WHEN THE -// TESTS ARE NOT SHUFFLED. -// -// Arguments: -// -// test_case_name: name of the test case -// type_param: the name of the test case's type parameter, or NULL if -// this is not a typed or a type-parameterized test case. -// set_up_tc: pointer to the function that sets up the test case -// tear_down_tc: pointer to the function that tears down the test case -TestCase* UnitTestImpl::GetTestCase(const char* test_case_name, - const char* type_param, - Test::SetUpTestCaseFunc set_up_tc, - Test::TearDownTestCaseFunc tear_down_tc) { - // Can we find a TestCase with the given name? - const std::vector::const_iterator test_case = - std::find_if(test_cases_.begin(), test_cases_.end(), - TestCaseNameIs(test_case_name)); - - if (test_case != test_cases_.end()) - return *test_case; - - // No. Let's create one. - TestCase* const new_test_case = - new TestCase(test_case_name, type_param, set_up_tc, tear_down_tc); - - // Is this a death test case? - if (internal::UnitTestOptions::MatchesFilter(test_case_name, - kDeathTestCaseFilter)) { - // Yes. Inserts the test case after the last death test case - // defined so far. This only works when the test cases haven't - // been shuffled. Otherwise we may end up running a death test - // after a non-death test. - ++last_death_test_case_; - test_cases_.insert(test_cases_.begin() + last_death_test_case_, - new_test_case); - } else { - // No. Appends to the end of the list. - test_cases_.push_back(new_test_case); - } - - test_case_indices_.push_back(static_cast(test_case_indices_.size())); - return new_test_case; -} - -// Helpers for setting up / tearing down the given environment. They -// are for use in the ForEach() function. -static void SetUpEnvironment(Environment* env) { env->SetUp(); } -static void TearDownEnvironment(Environment* env) { env->TearDown(); } - -// Runs all tests in this UnitTest object, prints the result, and -// returns true if all tests are successful. If any exception is -// thrown during a test, the test is considered to be failed, but the -// rest of the tests will still be run. -// -// When parameterized tests are enabled, it expands and registers -// parameterized tests first in RegisterParameterizedTests(). -// All other functions called from RunAllTests() may safely assume that -// parameterized tests are ready to be counted and run. -bool UnitTestImpl::RunAllTests() { - // Makes sure InitGoogleTest() was called. - if (!GTestIsInitialized()) { - printf("%s", - "\nThis test program did NOT call ::testing::InitGoogleTest " - "before calling RUN_ALL_TESTS(). Please fix it.\n"); - return false; - } - - // Do not run any test if the --help flag was specified. - if (g_help_flag) - return true; - - // Repeats the call to the post-flag parsing initialization in case the - // user didn't call InitGoogleTest. - PostFlagParsingInit(); - - // Even if sharding is not on, test runners may want to use the - // GTEST_SHARD_STATUS_FILE to query whether the test supports the sharding - // protocol. - internal::WriteToShardStatusFileIfNeeded(); - - // True iff we are in a subprocess for running a thread-safe-style - // death test. - bool in_subprocess_for_death_test = false; - -#if GTEST_HAS_DEATH_TEST - in_subprocess_for_death_test = (internal_run_death_test_flag_.get() != NULL); -#endif // GTEST_HAS_DEATH_TEST - - const bool should_shard = ShouldShard(kTestTotalShards, kTestShardIndex, - in_subprocess_for_death_test); - - // Compares the full test names with the filter to decide which - // tests to run. - const bool has_tests_to_run = FilterTests(should_shard - ? HONOR_SHARDING_PROTOCOL - : IGNORE_SHARDING_PROTOCOL) > 0; - - // Lists the tests and exits if the --gtest_list_tests flag was specified. - if (GTEST_FLAG(list_tests)) { - // This must be called *after* FilterTests() has been called. - ListTestsMatchingFilter(); - return true; - } - - random_seed_ = GTEST_FLAG(shuffle) ? - GetRandomSeedFromFlag(GTEST_FLAG(random_seed)) : 0; - - // True iff at least one test has failed. - bool failed = false; - - TestEventListener* repeater = listeners()->repeater(); - - start_timestamp_ = GetTimeInMillis(); - repeater->OnTestProgramStart(*parent_); - - // How many times to repeat the tests? We don't want to repeat them - // when we are inside the subprocess of a death test. - const int repeat = in_subprocess_for_death_test ? 1 : GTEST_FLAG(repeat); - // Repeats forever if the repeat count is negative. - const bool forever = repeat < 0; - for (int i = 0; forever || i != repeat; i++) { - // We want to preserve failures generated by ad-hoc test - // assertions executed before RUN_ALL_TESTS(). - ClearNonAdHocTestResult(); - - const TimeInMillis start = GetTimeInMillis(); - - // Shuffles test cases and tests if requested. - if (has_tests_to_run && GTEST_FLAG(shuffle)) { - random()->Reseed(random_seed_); - // This should be done before calling OnTestIterationStart(), - // such that a test event listener can see the actual test order - // in the event. - ShuffleTests(); - } - - // Tells the unit test event listeners that the tests are about to start. - repeater->OnTestIterationStart(*parent_, i); - - // Runs each test case if there is at least one test to run. - if (has_tests_to_run) { - // Sets up all environments beforehand. - repeater->OnEnvironmentsSetUpStart(*parent_); - ForEach(environments_, SetUpEnvironment); - repeater->OnEnvironmentsSetUpEnd(*parent_); - - // Runs the tests only if there was no fatal failure during global - // set-up. - if (!Test::HasFatalFailure()) { - for (int test_index = 0; test_index < total_test_case_count(); - test_index++) { - GetMutableTestCase(test_index)->Run(); - } - } - - // Tears down all environments in reverse order afterwards. - repeater->OnEnvironmentsTearDownStart(*parent_); - std::for_each(environments_.rbegin(), environments_.rend(), - TearDownEnvironment); - repeater->OnEnvironmentsTearDownEnd(*parent_); - } - - elapsed_time_ = GetTimeInMillis() - start; - - // Tells the unit test event listener that the tests have just finished. - repeater->OnTestIterationEnd(*parent_, i); - - // Gets the result and clears it. - if (!Passed()) { - failed = true; - } - - // Restores the original test order after the iteration. This - // allows the user to quickly repro a failure that happens in the - // N-th iteration without repeating the first (N - 1) iterations. - // This is not enclosed in "if (GTEST_FLAG(shuffle)) { ... }", in - // case the user somehow changes the value of the flag somewhere - // (it's always safe to unshuffle the tests). - UnshuffleTests(); - - if (GTEST_FLAG(shuffle)) { - // Picks a new random seed for each iteration. - random_seed_ = GetNextRandomSeed(random_seed_); - } - } - - repeater->OnTestProgramEnd(*parent_); - - return !failed; -} - -// Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file -// if the variable is present. If a file already exists at this location, this -// function will write over it. If the variable is present, but the file cannot -// be created, prints an error and exits. -void WriteToShardStatusFileIfNeeded() { - const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile); - if (test_shard_file != NULL) { - FILE* const file = posix::FOpen(test_shard_file, "w"); - if (file == NULL) { - ColoredPrintf(COLOR_RED, - "Could not write to the test shard status file \"%s\" " - "specified by the %s environment variable.\n", - test_shard_file, kTestShardStatusFile); - fflush(stdout); - exit(EXIT_FAILURE); - } - fclose(file); - } -} - -// Checks whether sharding is enabled by examining the relevant -// environment variable values. If the variables are present, -// but inconsistent (i.e., shard_index >= total_shards), prints -// an error and exits. If in_subprocess_for_death_test, sharding is -// disabled because it must only be applied to the original test -// process. Otherwise, we could filter out death tests we intended to execute. -bool ShouldShard(const char* total_shards_env, - const char* shard_index_env, - bool in_subprocess_for_death_test) { - if (in_subprocess_for_death_test) { - return false; - } - - const Int32 total_shards = Int32FromEnvOrDie(total_shards_env, -1); - const Int32 shard_index = Int32FromEnvOrDie(shard_index_env, -1); - - if (total_shards == -1 && shard_index == -1) { - return false; - } else if (total_shards == -1 && shard_index != -1) { - const Message msg = Message() - << "Invalid environment variables: you have " - << kTestShardIndex << " = " << shard_index - << ", but have left " << kTestTotalShards << " unset.\n"; - ColoredPrintf(COLOR_RED, msg.GetString().c_str()); - fflush(stdout); - exit(EXIT_FAILURE); - } else if (total_shards != -1 && shard_index == -1) { - const Message msg = Message() - << "Invalid environment variables: you have " - << kTestTotalShards << " = " << total_shards - << ", but have left " << kTestShardIndex << " unset.\n"; - ColoredPrintf(COLOR_RED, msg.GetString().c_str()); - fflush(stdout); - exit(EXIT_FAILURE); - } else if (shard_index < 0 || shard_index >= total_shards) { - const Message msg = Message() - << "Invalid environment variables: we require 0 <= " - << kTestShardIndex << " < " << kTestTotalShards - << ", but you have " << kTestShardIndex << "=" << shard_index - << ", " << kTestTotalShards << "=" << total_shards << ".\n"; - ColoredPrintf(COLOR_RED, msg.GetString().c_str()); - fflush(stdout); - exit(EXIT_FAILURE); - } - - return total_shards > 1; -} - -// Parses the environment variable var as an Int32. If it is unset, -// returns default_val. If it is not an Int32, prints an error -// and aborts. -Int32 Int32FromEnvOrDie(const char* var, Int32 default_val) { - const char* str_val = posix::GetEnv(var); - if (str_val == NULL) { - return default_val; - } - - Int32 result; - if (!ParseInt32(Message() << "The value of environment variable " << var, - str_val, &result)) { - exit(EXIT_FAILURE); - } - return result; -} - -// Given the total number of shards, the shard index, and the test id, -// returns true iff the test should be run on this shard. The test id is -// some arbitrary but unique non-negative integer assigned to each test -// method. Assumes that 0 <= shard_index < total_shards. -bool ShouldRunTestOnShard(int total_shards, int shard_index, int test_id) { - return (test_id % total_shards) == shard_index; -} - -// Compares the name of each test with the user-specified filter to -// decide whether the test should be run, then records the result in -// each TestCase and TestInfo object. -// If shard_tests == true, further filters tests based on sharding -// variables in the environment - see -// http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide. -// Returns the number of tests that should run. -int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) { - const Int32 total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ? - Int32FromEnvOrDie(kTestTotalShards, -1) : -1; - const Int32 shard_index = shard_tests == HONOR_SHARDING_PROTOCOL ? - Int32FromEnvOrDie(kTestShardIndex, -1) : -1; - - // num_runnable_tests are the number of tests that will - // run across all shards (i.e., match filter and are not disabled). - // num_selected_tests are the number of tests to be run on - // this shard. - int num_runnable_tests = 0; - int num_selected_tests = 0; - for (size_t i = 0; i < test_cases_.size(); i++) { - TestCase* const test_case = test_cases_[i]; - const std::string &test_case_name = test_case->name(); - test_case->set_should_run(false); - - for (size_t j = 0; j < test_case->test_info_list().size(); j++) { - TestInfo* const test_info = test_case->test_info_list()[j]; - const std::string test_name(test_info->name()); - // A test is disabled if test case name or test name matches - // kDisableTestFilter. - const bool is_disabled = - internal::UnitTestOptions::MatchesFilter(test_case_name, - kDisableTestFilter) || - internal::UnitTestOptions::MatchesFilter(test_name, - kDisableTestFilter); - test_info->is_disabled_ = is_disabled; - - const bool matches_filter = - internal::UnitTestOptions::FilterMatchesTest(test_case_name, - test_name); - test_info->matches_filter_ = matches_filter; - - const bool is_runnable = - (GTEST_FLAG(also_run_disabled_tests) || !is_disabled) && - matches_filter; - - const bool is_selected = is_runnable && - (shard_tests == IGNORE_SHARDING_PROTOCOL || - ShouldRunTestOnShard(total_shards, shard_index, - num_runnable_tests)); - - num_runnable_tests += is_runnable; - num_selected_tests += is_selected; - - test_info->should_run_ = is_selected; - test_case->set_should_run(test_case->should_run() || is_selected); - } - } - return num_selected_tests; -} - -// Prints the given C-string on a single line by replacing all '\n' -// characters with string "\\n". If the output takes more than -// max_length characters, only prints the first max_length characters -// and "...". -static void PrintOnOneLine(const char* str, int max_length) { - if (str != NULL) { - for (int i = 0; *str != '\0'; ++str) { - if (i >= max_length) { - printf("..."); - break; - } - if (*str == '\n') { - printf("\\n"); - i += 2; - } else { - printf("%c", *str); - ++i; - } - } - } -} - -// Prints the names of the tests matching the user-specified filter flag. -void UnitTestImpl::ListTestsMatchingFilter() { - // Print at most this many characters for each type/value parameter. - const int kMaxParamLength = 250; - - for (size_t i = 0; i < test_cases_.size(); i++) { - const TestCase* const test_case = test_cases_[i]; - bool printed_test_case_name = false; - - for (size_t j = 0; j < test_case->test_info_list().size(); j++) { - const TestInfo* const test_info = - test_case->test_info_list()[j]; - if (test_info->matches_filter_) { - if (!printed_test_case_name) { - printed_test_case_name = true; - printf("%s.", test_case->name()); - if (test_case->type_param() != NULL) { - printf(" # %s = ", kTypeParamLabel); - // We print the type parameter on a single line to make - // the output easy to parse by a program. - PrintOnOneLine(test_case->type_param(), kMaxParamLength); - } - printf("\n"); - } - printf(" %s", test_info->name()); - if (test_info->value_param() != NULL) { - printf(" # %s = ", kValueParamLabel); - // We print the value parameter on a single line to make the - // output easy to parse by a program. - PrintOnOneLine(test_info->value_param(), kMaxParamLength); - } - printf("\n"); - } - } - } - fflush(stdout); -} - -// Sets the OS stack trace getter. -// -// Does nothing if the input and the current OS stack trace getter are -// the same; otherwise, deletes the old getter and makes the input the -// current getter. -void UnitTestImpl::set_os_stack_trace_getter( - OsStackTraceGetterInterface* getter) { - if (os_stack_trace_getter_ != getter) { - delete os_stack_trace_getter_; - os_stack_trace_getter_ = getter; - } -} - -// Returns the current OS stack trace getter if it is not NULL; -// otherwise, creates an OsStackTraceGetter, makes it the current -// getter, and returns it. -OsStackTraceGetterInterface* UnitTestImpl::os_stack_trace_getter() { - if (os_stack_trace_getter_ == NULL) { - os_stack_trace_getter_ = new OsStackTraceGetter; - } - - return os_stack_trace_getter_; -} - -// Returns the TestResult for the test that's currently running, or -// the TestResult for the ad hoc test if no test is running. -TestResult* UnitTestImpl::current_test_result() { - return current_test_info_ ? - &(current_test_info_->result_) : &ad_hoc_test_result_; -} - -// Shuffles all test cases, and the tests within each test case, -// making sure that death tests are still run first. -void UnitTestImpl::ShuffleTests() { - // Shuffles the death test cases. - ShuffleRange(random(), 0, last_death_test_case_ + 1, &test_case_indices_); - - // Shuffles the non-death test cases. - ShuffleRange(random(), last_death_test_case_ + 1, - static_cast(test_cases_.size()), &test_case_indices_); - - // Shuffles the tests inside each test case. - for (size_t i = 0; i < test_cases_.size(); i++) { - test_cases_[i]->ShuffleTests(random()); - } -} - -// Restores the test cases and tests to their order before the first shuffle. -void UnitTestImpl::UnshuffleTests() { - for (size_t i = 0; i < test_cases_.size(); i++) { - // Unshuffles the tests in each test case. - test_cases_[i]->UnshuffleTests(); - // Resets the index of each test case. - test_case_indices_[i] = static_cast(i); - } -} - -// Returns the current OS stack trace as an std::string. -// -// The maximum number of stack frames to be included is specified by -// the gtest_stack_trace_depth flag. The skip_count parameter -// specifies the number of top frames to be skipped, which doesn't -// count against the number of frames to be included. -// -// For example, if Foo() calls Bar(), which in turn calls -// GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in -// the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't. -std::string GetCurrentOsStackTraceExceptTop(UnitTest* /*unit_test*/, - int skip_count) { - // We pass skip_count + 1 to skip this wrapper function in addition - // to what the user really wants to skip. - return GetUnitTestImpl()->CurrentOsStackTraceExceptTop(skip_count + 1); -} - -// Used by the GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_ macro to -// suppress unreachable code warnings. -namespace { -class ClassUniqueToAlwaysTrue {}; -} - -bool IsTrue(bool condition) { return condition; } - -bool AlwaysTrue() { -#if GTEST_HAS_EXCEPTIONS - // This condition is always false so AlwaysTrue() never actually throws, - // but it makes the compiler think that it may throw. - if (IsTrue(false)) - throw ClassUniqueToAlwaysTrue(); -#endif // GTEST_HAS_EXCEPTIONS - return true; -} - -// If *pstr starts with the given prefix, modifies *pstr to be right -// past the prefix and returns true; otherwise leaves *pstr unchanged -// and returns false. None of pstr, *pstr, and prefix can be NULL. -bool SkipPrefix(const char* prefix, const char** pstr) { - const size_t prefix_len = strlen(prefix); - if (strncmp(*pstr, prefix, prefix_len) == 0) { - *pstr += prefix_len; - return true; - } - return false; -} - -// Parses a string as a command line flag. The string should have -// the format "--flag=value". When def_optional is true, the "=value" -// part can be omitted. -// -// Returns the value of the flag, or NULL if the parsing failed. -const char* ParseFlagValue(const char* str, - const char* flag, - bool def_optional) { - // str and flag must not be NULL. - if (str == NULL || flag == NULL) return NULL; - - // The flag must start with "--" followed by GTEST_FLAG_PREFIX_. - const std::string flag_str = std::string("--") + GTEST_FLAG_PREFIX_ + flag; - const size_t flag_len = flag_str.length(); - if (strncmp(str, flag_str.c_str(), flag_len) != 0) return NULL; - - // Skips the flag name. - const char* flag_end = str + flag_len; - - // When def_optional is true, it's OK to not have a "=value" part. - if (def_optional && (flag_end[0] == '\0')) { - return flag_end; - } - - // If def_optional is true and there are more characters after the - // flag name, or if def_optional is false, there must be a '=' after - // the flag name. - if (flag_end[0] != '=') return NULL; - - // Returns the string after "=". - return flag_end + 1; -} - -// Parses a string for a bool flag, in the form of either -// "--flag=value" or "--flag". -// -// In the former case, the value is taken as true as long as it does -// not start with '0', 'f', or 'F'. -// -// In the latter case, the value is taken as true. -// -// On success, stores the value of the flag in *value, and returns -// true. On failure, returns false without changing *value. -bool ParseBoolFlag(const char* str, const char* flag, bool* value) { - // Gets the value of the flag as a string. - const char* const value_str = ParseFlagValue(str, flag, true); - - // Aborts if the parsing failed. - if (value_str == NULL) return false; - - // Converts the string value to a bool. - *value = !(*value_str == '0' || *value_str == 'f' || *value_str == 'F'); - return true; -} - -// Parses a string for an Int32 flag, in the form of -// "--flag=value". -// -// On success, stores the value of the flag in *value, and returns -// true. On failure, returns false without changing *value. -bool ParseInt32Flag(const char* str, const char* flag, Int32* value) { - // Gets the value of the flag as a string. - const char* const value_str = ParseFlagValue(str, flag, false); - - // Aborts if the parsing failed. - if (value_str == NULL) return false; - - // Sets *value to the value of the flag. - return ParseInt32(Message() << "The value of flag --" << flag, - value_str, value); -} - -// Parses a string for a string flag, in the form of -// "--flag=value". -// -// On success, stores the value of the flag in *value, and returns -// true. On failure, returns false without changing *value. -bool ParseStringFlag(const char* str, const char* flag, std::string* value) { - // Gets the value of the flag as a string. - const char* const value_str = ParseFlagValue(str, flag, false); - - // Aborts if the parsing failed. - if (value_str == NULL) return false; - - // Sets *value to the value of the flag. - *value = value_str; - return true; -} - -// Determines whether a string has a prefix that Google Test uses for its -// flags, i.e., starts with GTEST_FLAG_PREFIX_ or GTEST_FLAG_PREFIX_DASH_. -// If Google Test detects that a command line flag has its prefix but is not -// recognized, it will print its help message. Flags starting with -// GTEST_INTERNAL_PREFIX_ followed by "internal_" are considered Google Test -// internal flags and do not trigger the help message. -static bool HasGoogleTestFlagPrefix(const char* str) { - return (SkipPrefix("--", &str) || - SkipPrefix("-", &str) || - SkipPrefix("/", &str)) && - !SkipPrefix(GTEST_FLAG_PREFIX_ "internal_", &str) && - (SkipPrefix(GTEST_FLAG_PREFIX_, &str) || - SkipPrefix(GTEST_FLAG_PREFIX_DASH_, &str)); -} - -// Prints a string containing code-encoded text. The following escape -// sequences can be used in the string to control the text color: -// -// @@ prints a single '@' character. -// @R changes the color to red. -// @G changes the color to green. -// @Y changes the color to yellow. -// @D changes to the default terminal text color. -// -// TODO(wan@google.com): Write tests for this once we add stdout -// capturing to Google Test. -static void PrintColorEncoded(const char* str) { - GTestColor color = COLOR_DEFAULT; // The current color. - - // Conceptually, we split the string into segments divided by escape - // sequences. Then we print one segment at a time. At the end of - // each iteration, the str pointer advances to the beginning of the - // next segment. - for (;;) { - const char* p = strchr(str, '@'); - if (p == NULL) { - ColoredPrintf(color, "%s", str); - return; - } - - ColoredPrintf(color, "%s", std::string(str, p).c_str()); - - const char ch = p[1]; - str = p + 2; - if (ch == '@') { - ColoredPrintf(color, "@"); - } else if (ch == 'D') { - color = COLOR_DEFAULT; - } else if (ch == 'R') { - color = COLOR_RED; - } else if (ch == 'G') { - color = COLOR_GREEN; - } else if (ch == 'Y') { - color = COLOR_YELLOW; - } else { - --str; - } - } -} - -static const char kColorEncodedHelpMessage[] = -"This program contains tests written using " GTEST_NAME_ ". You can use the\n" -"following command line flags to control its behavior:\n" -"\n" -"Test Selection:\n" -" @G--" GTEST_FLAG_PREFIX_ "list_tests@D\n" -" List the names of all tests instead of running them. The name of\n" -" TEST(Foo, Bar) is \"Foo.Bar\".\n" -" @G--" GTEST_FLAG_PREFIX_ "filter=@YPOSTIVE_PATTERNS" - "[@G-@YNEGATIVE_PATTERNS]@D\n" -" Run only the tests whose name matches one of the positive patterns but\n" -" none of the negative patterns. '?' matches any single character; '*'\n" -" matches any substring; ':' separates two patterns.\n" -" @G--" GTEST_FLAG_PREFIX_ "also_run_disabled_tests@D\n" -" Run all disabled tests too.\n" -"\n" -"Test Execution:\n" -" @G--" GTEST_FLAG_PREFIX_ "repeat=@Y[COUNT]@D\n" -" Run the tests repeatedly; use a negative count to repeat forever.\n" -" @G--" GTEST_FLAG_PREFIX_ "shuffle@D\n" -" Randomize tests' orders on every iteration.\n" -" @G--" GTEST_FLAG_PREFIX_ "random_seed=@Y[NUMBER]@D\n" -" Random number seed to use for shuffling test orders (between 1 and\n" -" 99999, or 0 to use a seed based on the current time).\n" -"\n" -"Test Output:\n" -" @G--" GTEST_FLAG_PREFIX_ "color=@Y(@Gyes@Y|@Gno@Y|@Gauto@Y)@D\n" -" Enable/disable colored output. The default is @Gauto@D.\n" -" -@G-" GTEST_FLAG_PREFIX_ "print_time=0@D\n" -" Don't print the elapsed time of each test.\n" -" @G--" GTEST_FLAG_PREFIX_ "output=xml@Y[@G:@YDIRECTORY_PATH@G" - GTEST_PATH_SEP_ "@Y|@G:@YFILE_PATH]@D\n" -" Generate an XML report in the given directory or with the given file\n" -" name. @YFILE_PATH@D defaults to @Gtest_details.xml@D.\n" -#if GTEST_CAN_STREAM_RESULTS_ -" @G--" GTEST_FLAG_PREFIX_ "stream_result_to=@YHOST@G:@YPORT@D\n" -" Stream test results to the given server.\n" -#endif // GTEST_CAN_STREAM_RESULTS_ -"\n" -"Assertion Behavior:\n" -#if GTEST_HAS_DEATH_TEST && !GTEST_OS_WINDOWS -" @G--" GTEST_FLAG_PREFIX_ "death_test_style=@Y(@Gfast@Y|@Gthreadsafe@Y)@D\n" -" Set the default death test style.\n" -#endif // GTEST_HAS_DEATH_TEST && !GTEST_OS_WINDOWS -" @G--" GTEST_FLAG_PREFIX_ "break_on_failure@D\n" -" Turn assertion failures into debugger break-points.\n" -" @G--" GTEST_FLAG_PREFIX_ "throw_on_failure@D\n" -" Turn assertion failures into C++ exceptions.\n" -" @G--" GTEST_FLAG_PREFIX_ "catch_exceptions=0@D\n" -" Do not report exceptions as test failures. Instead, allow them\n" -" to crash the program or throw a pop-up (on Windows).\n" -"\n" -"Except for @G--" GTEST_FLAG_PREFIX_ "list_tests@D, you can alternatively set " - "the corresponding\n" -"environment variable of a flag (all letters in upper-case). For example, to\n" -"disable colored text output, you can either specify @G--" GTEST_FLAG_PREFIX_ - "color=no@D or set\n" -"the @G" GTEST_FLAG_PREFIX_UPPER_ "COLOR@D environment variable to @Gno@D.\n" -"\n" -"For more information, please read the " GTEST_NAME_ " documentation at\n" -"@G" GTEST_PROJECT_URL_ "@D. If you find a bug in " GTEST_NAME_ "\n" -"(not one in your own code or tests), please report it to\n" -"@G<" GTEST_DEV_EMAIL_ ">@D.\n"; - -// Parses the command line for Google Test flags, without initializing -// other parts of Google Test. The type parameter CharType can be -// instantiated to either char or wchar_t. -template -void ParseGoogleTestFlagsOnlyImpl(int* argc, CharType** argv) { - for (int i = 1; i < *argc; i++) { - const std::string arg_string = StreamableToString(argv[i]); - const char* const arg = arg_string.c_str(); - - using internal::ParseBoolFlag; - using internal::ParseInt32Flag; - using internal::ParseStringFlag; - - // Do we see a Google Test flag? - if (ParseBoolFlag(arg, kAlsoRunDisabledTestsFlag, - >EST_FLAG(also_run_disabled_tests)) || - ParseBoolFlag(arg, kBreakOnFailureFlag, - >EST_FLAG(break_on_failure)) || - ParseBoolFlag(arg, kCatchExceptionsFlag, - >EST_FLAG(catch_exceptions)) || - ParseStringFlag(arg, kColorFlag, >EST_FLAG(color)) || - ParseStringFlag(arg, kDeathTestStyleFlag, - >EST_FLAG(death_test_style)) || - ParseBoolFlag(arg, kDeathTestUseFork, - >EST_FLAG(death_test_use_fork)) || - ParseStringFlag(arg, kFilterFlag, >EST_FLAG(filter)) || - ParseStringFlag(arg, kInternalRunDeathTestFlag, - >EST_FLAG(internal_run_death_test)) || - ParseBoolFlag(arg, kListTestsFlag, >EST_FLAG(list_tests)) || - ParseStringFlag(arg, kOutputFlag, >EST_FLAG(output)) || - ParseBoolFlag(arg, kPrintTimeFlag, >EST_FLAG(print_time)) || - ParseInt32Flag(arg, kRandomSeedFlag, >EST_FLAG(random_seed)) || - ParseInt32Flag(arg, kRepeatFlag, >EST_FLAG(repeat)) || - ParseBoolFlag(arg, kShuffleFlag, >EST_FLAG(shuffle)) || - ParseInt32Flag(arg, kStackTraceDepthFlag, - >EST_FLAG(stack_trace_depth)) || - ParseStringFlag(arg, kStreamResultToFlag, - >EST_FLAG(stream_result_to)) || - ParseBoolFlag(arg, kThrowOnFailureFlag, - >EST_FLAG(throw_on_failure)) - ) { - // Yes. Shift the remainder of the argv list left by one. Note - // that argv has (*argc + 1) elements, the last one always being - // NULL. The following loop moves the trailing NULL element as - // well. - for (int j = i; j != *argc; j++) { - argv[j] = argv[j + 1]; - } - - // Decrements the argument count. - (*argc)--; - - // We also need to decrement the iterator as we just removed - // an element. - i--; - } else if (arg_string == "--help" || arg_string == "-h" || - arg_string == "-?" || arg_string == "/?" || - HasGoogleTestFlagPrefix(arg)) { - // Both help flag and unrecognized Google Test flags (excluding - // internal ones) trigger help display. - g_help_flag = true; - } - } - - if (g_help_flag) { - // We print the help here instead of in RUN_ALL_TESTS(), as the - // latter may not be called at all if the user is using Google - // Test with another testing framework. - PrintColorEncoded(kColorEncodedHelpMessage); - } -} - -// Parses the command line for Google Test flags, without initializing -// other parts of Google Test. -void ParseGoogleTestFlagsOnly(int* argc, char** argv) { - ParseGoogleTestFlagsOnlyImpl(argc, argv); -} -void ParseGoogleTestFlagsOnly(int* argc, wchar_t** argv) { - ParseGoogleTestFlagsOnlyImpl(argc, argv); -} - -// The internal implementation of InitGoogleTest(). -// -// The type parameter CharType can be instantiated to either char or -// wchar_t. -template -void InitGoogleTestImpl(int* argc, CharType** argv) { - g_init_gtest_count++; - - // We don't want to run the initialization code twice. - if (g_init_gtest_count != 1) return; - - if (*argc <= 0) return; - - internal::g_executable_path = internal::StreamableToString(argv[0]); - -#if GTEST_HAS_DEATH_TEST - - g_argvs.clear(); - for (int i = 0; i != *argc; i++) { - g_argvs.push_back(StreamableToString(argv[i])); - } - -#endif // GTEST_HAS_DEATH_TEST - - ParseGoogleTestFlagsOnly(argc, argv); - GetUnitTestImpl()->PostFlagParsingInit(); -} - -} // namespace internal - -// Initializes Google Test. This must be called before calling -// RUN_ALL_TESTS(). In particular, it parses a command line for the -// flags that Google Test recognizes. Whenever a Google Test flag is -// seen, it is removed from argv, and *argc is decremented. -// -// No value is returned. Instead, the Google Test flag variables are -// updated. -// -// Calling the function for the second time has no user-visible effect. -void InitGoogleTest(int* argc, char** argv) { - internal::InitGoogleTestImpl(argc, argv); -} - -// This overloaded version can be used in Windows programs compiled in -// UNICODE mode. -void InitGoogleTest(int* argc, wchar_t** argv) { - internal::InitGoogleTestImpl(argc, argv); -} - -} // namespace testing -// Copyright 2005, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. 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. -// -// Author: wan@google.com (Zhanyong Wan), vladl@google.com (Vlad Losev) -// -// This file implements death tests. - - -#if GTEST_HAS_DEATH_TEST - -# if GTEST_OS_MAC -# include -# endif // GTEST_OS_MAC - -# include -# include -# include - -# if GTEST_OS_LINUX -# include -# endif // GTEST_OS_LINUX - -# include - -# if GTEST_OS_WINDOWS -# include -# else -# include -# include -# endif // GTEST_OS_WINDOWS - -# if GTEST_OS_QNX -# include -# endif // GTEST_OS_QNX - -#endif // GTEST_HAS_DEATH_TEST - - -// Indicates that this translation unit is part of Google Test's -// implementation. It must come before gtest-internal-inl.h is -// included, or there will be a compiler error. This trick is to -// prevent a user from accidentally including gtest-internal-inl.h in -// his code. -#define GTEST_IMPLEMENTATION_ 1 -#undef GTEST_IMPLEMENTATION_ - -namespace testing { - -// Constants. - -// The default death test style. -static const char kDefaultDeathTestStyle[] = "fast"; - -GTEST_DEFINE_string_( - death_test_style, - internal::StringFromGTestEnv("death_test_style", kDefaultDeathTestStyle), - "Indicates how to run a death test in a forked child process: " - "\"threadsafe\" (child process re-executes the test binary " - "from the beginning, running only the specific death test) or " - "\"fast\" (child process runs the death test immediately " - "after forking)."); - -GTEST_DEFINE_bool_( - death_test_use_fork, - internal::BoolFromGTestEnv("death_test_use_fork", false), - "Instructs to use fork()/_exit() instead of clone() in death tests. " - "Ignored and always uses fork() on POSIX systems where clone() is not " - "implemented. Useful when running under valgrind or similar tools if " - "those do not support clone(). Valgrind 3.3.1 will just fail if " - "it sees an unsupported combination of clone() flags. " - "It is not recommended to use this flag w/o valgrind though it will " - "work in 99% of the cases. Once valgrind is fixed, this flag will " - "most likely be removed."); - -namespace internal { -GTEST_DEFINE_string_( - internal_run_death_test, "", - "Indicates the file, line number, temporal index of " - "the single death test to run, and a file descriptor to " - "which a success code may be sent, all separated by " - "the '|' characters. This flag is specified if and only if the current " - "process is a sub-process launched for running a thread-safe " - "death test. FOR INTERNAL USE ONLY."); -} // namespace internal - -#if GTEST_HAS_DEATH_TEST - -namespace internal { - -// Valid only for fast death tests. Indicates the code is running in the -// child process of a fast style death test. -static bool g_in_fast_death_test_child = false; - -// Returns a Boolean value indicating whether the caller is currently -// executing in the context of the death test child process. Tools such as -// Valgrind heap checkers may need this to modify their behavior in death -// tests. IMPORTANT: This is an internal utility. Using it may break the -// implementation of death tests. User code MUST NOT use it. -bool InDeathTestChild() { -# if GTEST_OS_WINDOWS - - // On Windows, death tests are thread-safe regardless of the value of the - // death_test_style flag. - return !GTEST_FLAG(internal_run_death_test).empty(); - -# else - - if (GTEST_FLAG(death_test_style) == "threadsafe") - return !GTEST_FLAG(internal_run_death_test).empty(); - else - return g_in_fast_death_test_child; -#endif -} - -} // namespace internal - -// ExitedWithCode constructor. -ExitedWithCode::ExitedWithCode(int exit_code) : exit_code_(exit_code) { -} - -// ExitedWithCode function-call operator. -bool ExitedWithCode::operator()(int exit_status) const { -# if GTEST_OS_WINDOWS - - return exit_status == exit_code_; - -# else - - return WIFEXITED(exit_status) && WEXITSTATUS(exit_status) == exit_code_; - -# endif // GTEST_OS_WINDOWS -} - -# if !GTEST_OS_WINDOWS -// KilledBySignal constructor. -KilledBySignal::KilledBySignal(int signum) : signum_(signum) { -} - -// KilledBySignal function-call operator. -bool KilledBySignal::operator()(int exit_status) const { - return WIFSIGNALED(exit_status) && WTERMSIG(exit_status) == signum_; -} -# endif // !GTEST_OS_WINDOWS - -namespace internal { - -// Utilities needed for death tests. - -// Generates a textual description of a given exit code, in the format -// specified by wait(2). -static std::string ExitSummary(int exit_code) { - Message m; - -# if GTEST_OS_WINDOWS - - m << "Exited with exit status " << exit_code; - -# else - - if (WIFEXITED(exit_code)) { - m << "Exited with exit status " << WEXITSTATUS(exit_code); - } else if (WIFSIGNALED(exit_code)) { - m << "Terminated by signal " << WTERMSIG(exit_code); - } -# ifdef WCOREDUMP - if (WCOREDUMP(exit_code)) { - m << " (core dumped)"; - } -# endif -# endif // GTEST_OS_WINDOWS - - return m.GetString(); -} - -// Returns true if exit_status describes a process that was terminated -// by a signal, or exited normally with a nonzero exit code. -bool ExitedUnsuccessfully(int exit_status) { - return !ExitedWithCode(0)(exit_status); -} - -# if !GTEST_OS_WINDOWS -// Generates a textual failure message when a death test finds more than -// one thread running, or cannot determine the number of threads, prior -// to executing the given statement. It is the responsibility of the -// caller not to pass a thread_count of 1. -static std::string DeathTestThreadWarning(size_t thread_count) { - Message msg; - msg << "Death tests use fork(), which is unsafe particularly" - << " in a threaded context. For this test, " << GTEST_NAME_ << " "; - if (thread_count == 0) - msg << "couldn't detect the number of threads."; - else - msg << "detected " << thread_count << " threads."; - return msg.GetString(); -} -# endif // !GTEST_OS_WINDOWS - -// Flag characters for reporting a death test that did not die. -static const char kDeathTestLived = 'L'; -static const char kDeathTestReturned = 'R'; -static const char kDeathTestThrew = 'T'; -static const char kDeathTestInternalError = 'I'; - -// An enumeration describing all of the possible ways that a death test can -// conclude. DIED means that the process died while executing the test -// code; LIVED means that process lived beyond the end of the test code; -// RETURNED means that the test statement attempted to execute a return -// statement, which is not allowed; THREW means that the test statement -// returned control by throwing an exception. IN_PROGRESS means the test -// has not yet concluded. -// TODO(vladl@google.com): Unify names and possibly values for -// AbortReason, DeathTestOutcome, and flag characters above. -enum DeathTestOutcome { IN_PROGRESS, DIED, LIVED, RETURNED, THREW }; - -// Routine for aborting the program which is safe to call from an -// exec-style death test child process, in which case the error -// message is propagated back to the parent process. Otherwise, the -// message is simply printed to stderr. In either case, the program -// then exits with status 1. -void DeathTestAbort(const std::string& message) { - // On a POSIX system, this function may be called from a threadsafe-style - // death test child process, which operates on a very small stack. Use - // the heap for any additional non-minuscule memory requirements. - const InternalRunDeathTestFlag* const flag = - GetUnitTestImpl()->internal_run_death_test_flag(); - if (flag != NULL) { - FILE* parent = posix::FDOpen(flag->write_fd(), "w"); - fputc(kDeathTestInternalError, parent); - fprintf(parent, "%s", message.c_str()); - fflush(parent); - _exit(1); - } else { - fprintf(stderr, "%s", message.c_str()); - fflush(stderr); - posix::Abort(); - } -} - -// A replacement for CHECK that calls DeathTestAbort if the assertion -// fails. -# define GTEST_DEATH_TEST_CHECK_(expression) \ - do { \ - if (!::testing::internal::IsTrue(expression)) { \ - DeathTestAbort( \ - ::std::string("CHECK failed: File ") + __FILE__ + ", line " \ - + ::testing::internal::StreamableToString(__LINE__) + ": " \ - + #expression); \ - } \ - } while (::testing::internal::AlwaysFalse()) - -// This macro is similar to GTEST_DEATH_TEST_CHECK_, but it is meant for -// evaluating any system call that fulfills two conditions: it must return -// -1 on failure, and set errno to EINTR when it is interrupted and -// should be tried again. The macro expands to a loop that repeatedly -// evaluates the expression as long as it evaluates to -1 and sets -// errno to EINTR. If the expression evaluates to -1 but errno is -// something other than EINTR, DeathTestAbort is called. -# define GTEST_DEATH_TEST_CHECK_SYSCALL_(expression) \ - do { \ - int gtest_retval; \ - do { \ - gtest_retval = (expression); \ - } while (gtest_retval == -1 && errno == EINTR); \ - if (gtest_retval == -1) { \ - DeathTestAbort( \ - ::std::string("CHECK failed: File ") + __FILE__ + ", line " \ - + ::testing::internal::StreamableToString(__LINE__) + ": " \ - + #expression + " != -1"); \ - } \ - } while (::testing::internal::AlwaysFalse()) - -// Returns the message describing the last system error in errno. -std::string GetLastErrnoDescription() { - return errno == 0 ? "" : posix::StrError(errno); -} - -// This is called from a death test parent process to read a failure -// message from the death test child process and log it with the FATAL -// severity. On Windows, the message is read from a pipe handle. On other -// platforms, it is read from a file descriptor. -static void FailFromInternalError(int fd) { - Message error; - char buffer[256]; - int num_read; - - do { - while ((num_read = posix::Read(fd, buffer, 255)) > 0) { - buffer[num_read] = '\0'; - error << buffer; - } - } while (num_read == -1 && errno == EINTR); - - if (num_read == 0) { - GTEST_LOG_(FATAL) << error.GetString(); - } else { - const int last_error = errno; - GTEST_LOG_(FATAL) << "Error while reading death test internal: " - << GetLastErrnoDescription() << " [" << last_error << "]"; - } -} - -// Death test constructor. Increments the running death test count -// for the current test. -DeathTest::DeathTest() { - TestInfo* const info = GetUnitTestImpl()->current_test_info(); - if (info == NULL) { - DeathTestAbort("Cannot run a death test outside of a TEST or " - "TEST_F construct"); - } -} - -// Creates and returns a death test by dispatching to the current -// death test factory. -bool DeathTest::Create(const char* statement, const RE* regex, - const char* file, int line, DeathTest** test) { - return GetUnitTestImpl()->death_test_factory()->Create( - statement, regex, file, line, test); -} - -const char* DeathTest::LastMessage() { - return last_death_test_message_.c_str(); -} - -void DeathTest::set_last_death_test_message(const std::string& message) { - last_death_test_message_ = message; -} - -std::string DeathTest::last_death_test_message_; - -// Provides cross platform implementation for some death functionality. -class DeathTestImpl : public DeathTest { - protected: - DeathTestImpl(const char* a_statement, const RE* a_regex) - : statement_(a_statement), - regex_(a_regex), - spawned_(false), - status_(-1), - outcome_(IN_PROGRESS), - read_fd_(-1), - write_fd_(-1) {} - - // read_fd_ is expected to be closed and cleared by a derived class. - ~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); } - - void Abort(AbortReason reason); - virtual bool Passed(bool status_ok); - - const char* statement() const { return statement_; } - const RE* regex() const { return regex_; } - bool spawned() const { return spawned_; } - void set_spawned(bool is_spawned) { spawned_ = is_spawned; } - int status() const { return status_; } - void set_status(int a_status) { status_ = a_status; } - DeathTestOutcome outcome() const { return outcome_; } - void set_outcome(DeathTestOutcome an_outcome) { outcome_ = an_outcome; } - int read_fd() const { return read_fd_; } - void set_read_fd(int fd) { read_fd_ = fd; } - int write_fd() const { return write_fd_; } - void set_write_fd(int fd) { write_fd_ = fd; } - - // Called in the parent process only. Reads the result code of the death - // test child process via a pipe, interprets it to set the outcome_ - // member, and closes read_fd_. Outputs diagnostics and terminates in - // case of unexpected codes. - void ReadAndInterpretStatusByte(); - - private: - // The textual content of the code this object is testing. This class - // doesn't own this string and should not attempt to delete it. - const char* const statement_; - // The regular expression which test output must match. DeathTestImpl - // doesn't own this object and should not attempt to delete it. - const RE* const regex_; - // True if the death test child process has been successfully spawned. - bool spawned_; - // The exit status of the child process. - int status_; - // How the death test concluded. - DeathTestOutcome outcome_; - // Descriptor to the read end of the pipe to the child process. It is - // always -1 in the child process. The child keeps its write end of the - // pipe in write_fd_. - int read_fd_; - // Descriptor to the child's write end of the pipe to the parent process. - // It is always -1 in the parent process. The parent keeps its end of the - // pipe in read_fd_. - int write_fd_; -}; - -// Called in the parent process only. Reads the result code of the death -// test child process via a pipe, interprets it to set the outcome_ -// member, and closes read_fd_. Outputs diagnostics and terminates in -// case of unexpected codes. -void DeathTestImpl::ReadAndInterpretStatusByte() { - char flag; - int bytes_read; - - // The read() here blocks until data is available (signifying the - // failure of the death test) or until the pipe is closed (signifying - // its success), so it's okay to call this in the parent before - // the child process has exited. - do { - bytes_read = posix::Read(read_fd(), &flag, 1); - } while (bytes_read == -1 && errno == EINTR); - - if (bytes_read == 0) { - set_outcome(DIED); - } else if (bytes_read == 1) { - switch (flag) { - case kDeathTestReturned: - set_outcome(RETURNED); - break; - case kDeathTestThrew: - set_outcome(THREW); - break; - case kDeathTestLived: - set_outcome(LIVED); - break; - case kDeathTestInternalError: - FailFromInternalError(read_fd()); // Does not return. - break; - default: - GTEST_LOG_(FATAL) << "Death test child process reported " - << "unexpected status byte (" - << static_cast(flag) << ")"; - } - } else { - GTEST_LOG_(FATAL) << "Read from death test child process failed: " - << GetLastErrnoDescription(); - } - GTEST_DEATH_TEST_CHECK_SYSCALL_(posix::Close(read_fd())); - set_read_fd(-1); -} - -// Signals that the death test code which should have exited, didn't. -// Should be called only in a death test child process. -// Writes a status byte to the child's status file descriptor, then -// calls _exit(1). -void DeathTestImpl::Abort(AbortReason reason) { - // The parent process considers the death test to be a failure if - // it finds any data in our pipe. So, here we write a single flag byte - // to the pipe, then exit. - const char status_ch = - reason == TEST_DID_NOT_DIE ? kDeathTestLived : - reason == TEST_THREW_EXCEPTION ? kDeathTestThrew : kDeathTestReturned; - - GTEST_DEATH_TEST_CHECK_SYSCALL_(posix::Write(write_fd(), &status_ch, 1)); - // We are leaking the descriptor here because on some platforms (i.e., - // when built as Windows DLL), destructors of global objects will still - // run after calling _exit(). On such systems, write_fd_ will be - // indirectly closed from the destructor of UnitTestImpl, causing double - // close if it is also closed here. On debug configurations, double close - // may assert. As there are no in-process buffers to flush here, we are - // relying on the OS to close the descriptor after the process terminates - // when the destructors are not run. - _exit(1); // Exits w/o any normal exit hooks (we were supposed to crash) -} - -// Returns an indented copy of stderr output for a death test. -// This makes distinguishing death test output lines from regular log lines -// much easier. -static ::std::string FormatDeathTestOutput(const ::std::string& output) { - ::std::string ret; - for (size_t at = 0; ; ) { - const size_t line_end = output.find('\n', at); - ret += "[ DEATH ] "; - if (line_end == ::std::string::npos) { - ret += output.substr(at); - break; - } - ret += output.substr(at, line_end + 1 - at); - at = line_end + 1; - } - return ret; -} - -// Assesses the success or failure of a death test, using both private -// members which have previously been set, and one argument: -// -// Private data members: -// outcome: An enumeration describing how the death test -// concluded: DIED, LIVED, THREW, or RETURNED. The death test -// fails in the latter three cases. -// status: The exit status of the child process. On *nix, it is in the -// in the format specified by wait(2). On Windows, this is the -// value supplied to the ExitProcess() API or a numeric code -// of the exception that terminated the program. -// regex: A regular expression object to be applied to -// the test's captured standard error output; the death test -// fails if it does not match. -// -// Argument: -// status_ok: true if exit_status is acceptable in the context of -// this particular death test, which fails if it is false -// -// Returns true iff all of the above conditions are met. Otherwise, the -// first failing condition, in the order given above, is the one that is -// reported. Also sets the last death test message string. -bool DeathTestImpl::Passed(bool status_ok) { - if (!spawned()) - return false; - - const std::string error_message = GetCapturedStderr(); - - bool success = false; - Message buffer; - - buffer << "Death test: " << statement() << "\n"; - switch (outcome()) { - case LIVED: - buffer << " Result: failed to die.\n" - << " Error msg:\n" << FormatDeathTestOutput(error_message); - break; - case THREW: - buffer << " Result: threw an exception.\n" - << " Error msg:\n" << FormatDeathTestOutput(error_message); - break; - case RETURNED: - buffer << " Result: illegal return in test statement.\n" - << " Error msg:\n" << FormatDeathTestOutput(error_message); - break; - case DIED: - if (status_ok) { - const bool matched = RE::PartialMatch(error_message.c_str(), *regex()); - if (matched) { - success = true; - } else { - buffer << " Result: died but not with expected error.\n" - << " Expected: " << regex()->pattern() << "\n" - << "Actual msg:\n" << FormatDeathTestOutput(error_message); - } - } else { - buffer << " Result: died but not with expected exit code:\n" - << " " << ExitSummary(status()) << "\n" - << "Actual msg:\n" << FormatDeathTestOutput(error_message); - } - break; - case IN_PROGRESS: - default: - GTEST_LOG_(FATAL) - << "DeathTest::Passed somehow called before conclusion of test"; - } - - DeathTest::set_last_death_test_message(buffer.GetString()); - return success; -} - -# if GTEST_OS_WINDOWS -// WindowsDeathTest implements death tests on Windows. Due to the -// specifics of starting new processes on Windows, death tests there are -// always threadsafe, and Google Test considers the -// --gtest_death_test_style=fast setting to be equivalent to -// --gtest_death_test_style=threadsafe there. -// -// A few implementation notes: Like the Linux version, the Windows -// implementation uses pipes for child-to-parent communication. But due to -// the specifics of pipes on Windows, some extra steps are required: -// -// 1. The parent creates a communication pipe and stores handles to both -// ends of it. -// 2. The parent starts the child and provides it with the information -// necessary to acquire the handle to the write end of the pipe. -// 3. The child acquires the write end of the pipe and signals the parent -// using a Windows event. -// 4. Now the parent can release the write end of the pipe on its side. If -// this is done before step 3, the object's reference count goes down to -// 0 and it is destroyed, preventing the child from acquiring it. The -// parent now has to release it, or read operations on the read end of -// the pipe will not return when the child terminates. -// 5. The parent reads child's output through the pipe (outcome code and -// any possible error messages) from the pipe, and its stderr and then -// determines whether to fail the test. -// -// Note: to distinguish Win32 API calls from the local method and function -// calls, the former are explicitly resolved in the global namespace. -// -class WindowsDeathTest : public DeathTestImpl { - public: - WindowsDeathTest(const char* a_statement, - const RE* a_regex, - const char* file, - int line) - : DeathTestImpl(a_statement, a_regex), file_(file), line_(line) {} - - // All of these virtual functions are inherited from DeathTest. - virtual int Wait(); - virtual TestRole AssumeRole(); - - private: - // The name of the file in which the death test is located. - const char* const file_; - // The line number on which the death test is located. - const int line_; - // Handle to the write end of the pipe to the child process. - AutoHandle write_handle_; - // Child process handle. - AutoHandle child_handle_; - // Event the child process uses to signal the parent that it has - // acquired the handle to the write end of the pipe. After seeing this - // event the parent can release its own handles to make sure its - // ReadFile() calls return when the child terminates. - AutoHandle event_handle_; -}; - -// Waits for the child in a death test to exit, returning its exit -// status, or 0 if no child process exists. As a side effect, sets the -// outcome data member. -int WindowsDeathTest::Wait() { - if (!spawned()) - return 0; - - // Wait until the child either signals that it has acquired the write end - // of the pipe or it dies. - const HANDLE wait_handles[2] = { child_handle_.Get(), event_handle_.Get() }; - switch (::WaitForMultipleObjects(2, - wait_handles, - FALSE, // Waits for any of the handles. - INFINITE)) { - case WAIT_OBJECT_0: - case WAIT_OBJECT_0 + 1: - break; - default: - GTEST_DEATH_TEST_CHECK_(false); // Should not get here. - } - - // The child has acquired the write end of the pipe or exited. - // We release the handle on our side and continue. - write_handle_.Reset(); - event_handle_.Reset(); - - ReadAndInterpretStatusByte(); - - // Waits for the child process to exit if it haven't already. This - // returns immediately if the child has already exited, regardless of - // whether previous calls to WaitForMultipleObjects synchronized on this - // handle or not. - GTEST_DEATH_TEST_CHECK_( - WAIT_OBJECT_0 == ::WaitForSingleObject(child_handle_.Get(), - INFINITE)); - DWORD status_code; - GTEST_DEATH_TEST_CHECK_( - ::GetExitCodeProcess(child_handle_.Get(), &status_code) != FALSE); - child_handle_.Reset(); - set_status(static_cast(status_code)); - return status(); -} - -// The AssumeRole process for a Windows death test. It creates a child -// process with the same executable as the current process to run the -// death test. The child process is given the --gtest_filter and -// --gtest_internal_run_death_test flags such that it knows to run the -// current death test only. -DeathTest::TestRole WindowsDeathTest::AssumeRole() { - const UnitTestImpl* const impl = GetUnitTestImpl(); - const InternalRunDeathTestFlag* const flag = - impl->internal_run_death_test_flag(); - const TestInfo* const info = impl->current_test_info(); - const int death_test_index = info->result()->death_test_count(); - - if (flag != NULL) { - // ParseInternalRunDeathTestFlag() has performed all the necessary - // processing. - set_write_fd(flag->write_fd()); - return EXECUTE_TEST; - } - - // WindowsDeathTest uses an anonymous pipe to communicate results of - // a death test. - SECURITY_ATTRIBUTES handles_are_inheritable = { - sizeof(SECURITY_ATTRIBUTES), NULL, TRUE }; - HANDLE read_handle, write_handle; - GTEST_DEATH_TEST_CHECK_( - ::CreatePipe(&read_handle, &write_handle, &handles_are_inheritable, - 0) // Default buffer size. - != FALSE); - set_read_fd(::_open_osfhandle(reinterpret_cast(read_handle), - O_RDONLY)); - write_handle_.Reset(write_handle); - event_handle_.Reset(::CreateEvent( - &handles_are_inheritable, - TRUE, // The event will automatically reset to non-signaled state. - FALSE, // The initial state is non-signalled. - NULL)); // The even is unnamed. - GTEST_DEATH_TEST_CHECK_(event_handle_.Get() != NULL); - const std::string filter_flag = - std::string("--") + GTEST_FLAG_PREFIX_ + kFilterFlag + "=" + - info->test_case_name() + "." + info->name(); - const std::string internal_flag = - std::string("--") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag + - "=" + file_ + "|" + StreamableToString(line_) + "|" + - StreamableToString(death_test_index) + "|" + - StreamableToString(static_cast(::GetCurrentProcessId())) + - // size_t has the same width as pointers on both 32-bit and 64-bit - // Windows platforms. - // See http://msdn.microsoft.com/en-us/library/tcxf1dw6.aspx. - "|" + StreamableToString(reinterpret_cast(write_handle)) + - "|" + StreamableToString(reinterpret_cast(event_handle_.Get())); - - char executable_path[_MAX_PATH + 1]; // NOLINT - GTEST_DEATH_TEST_CHECK_( - _MAX_PATH + 1 != ::GetModuleFileNameA(NULL, - executable_path, - _MAX_PATH)); - - std::string command_line = - std::string(::GetCommandLineA()) + " " + filter_flag + " \"" + - internal_flag + "\""; - - DeathTest::set_last_death_test_message(""); - - CaptureStderr(); - // Flush the log buffers since the log streams are shared with the child. - FlushInfoLog(); - - // The child process will share the standard handles with the parent. - STARTUPINFOA startup_info; - memset(&startup_info, 0, sizeof(STARTUPINFO)); - startup_info.dwFlags = STARTF_USESTDHANDLES; - startup_info.hStdInput = ::GetStdHandle(STD_INPUT_HANDLE); - startup_info.hStdOutput = ::GetStdHandle(STD_OUTPUT_HANDLE); - startup_info.hStdError = ::GetStdHandle(STD_ERROR_HANDLE); - - PROCESS_INFORMATION process_info; - GTEST_DEATH_TEST_CHECK_(::CreateProcessA( - executable_path, - const_cast(command_line.c_str()), - NULL, // Retuned process handle is not inheritable. - NULL, // Retuned thread handle is not inheritable. - TRUE, // Child inherits all inheritable handles (for write_handle_). - 0x0, // Default creation flags. - NULL, // Inherit the parent's environment. - UnitTest::GetInstance()->original_working_dir(), - &startup_info, - &process_info) != FALSE); - child_handle_.Reset(process_info.hProcess); - ::CloseHandle(process_info.hThread); - set_spawned(true); - return OVERSEE_TEST; -} -# else // We are not on Windows. - -// ForkingDeathTest provides implementations for most of the abstract -// methods of the DeathTest interface. Only the AssumeRole method is -// left undefined. -class ForkingDeathTest : public DeathTestImpl { - public: - ForkingDeathTest(const char* statement, const RE* regex); - - // All of these virtual functions are inherited from DeathTest. - virtual int Wait(); - - protected: - void set_child_pid(pid_t child_pid) { child_pid_ = child_pid; } - - private: - // PID of child process during death test; 0 in the child process itself. - pid_t child_pid_; -}; - -// Constructs a ForkingDeathTest. -ForkingDeathTest::ForkingDeathTest(const char* a_statement, const RE* a_regex) - : DeathTestImpl(a_statement, a_regex), - child_pid_(-1) {} - -// Waits for the child in a death test to exit, returning its exit -// status, or 0 if no child process exists. As a side effect, sets the -// outcome data member. -int ForkingDeathTest::Wait() { - if (!spawned()) - return 0; - - ReadAndInterpretStatusByte(); - - int status_value; - GTEST_DEATH_TEST_CHECK_SYSCALL_(waitpid(child_pid_, &status_value, 0)); - set_status(status_value); - return status_value; -} - -// A concrete death test class that forks, then immediately runs the test -// in the child process. -class NoExecDeathTest : public ForkingDeathTest { - public: - NoExecDeathTest(const char* a_statement, const RE* a_regex) : - ForkingDeathTest(a_statement, a_regex) { } - virtual TestRole AssumeRole(); -}; - -// The AssumeRole process for a fork-and-run death test. It implements a -// straightforward fork, with a simple pipe to transmit the status byte. -DeathTest::TestRole NoExecDeathTest::AssumeRole() { - const size_t thread_count = GetThreadCount(); - if (thread_count != 1) { - GTEST_LOG_(WARNING) << DeathTestThreadWarning(thread_count); - } - - int pipe_fd[2]; - GTEST_DEATH_TEST_CHECK_(pipe(pipe_fd) != -1); - - DeathTest::set_last_death_test_message(""); - CaptureStderr(); - // When we fork the process below, the log file buffers are copied, but the - // file descriptors are shared. We flush all log files here so that closing - // the file descriptors in the child process doesn't throw off the - // synchronization between descriptors and buffers in the parent process. - // This is as close to the fork as possible to avoid a race condition in case - // there are multiple threads running before the death test, and another - // thread writes to the log file. - FlushInfoLog(); - - const pid_t child_pid = fork(); - GTEST_DEATH_TEST_CHECK_(child_pid != -1); - set_child_pid(child_pid); - if (child_pid == 0) { - GTEST_DEATH_TEST_CHECK_SYSCALL_(close(pipe_fd[0])); - set_write_fd(pipe_fd[1]); - // Redirects all logging to stderr in the child process to prevent - // concurrent writes to the log files. We capture stderr in the parent - // process and append the child process' output to a log. - LogToStderr(); - // Event forwarding to the listeners of event listener API mush be shut - // down in death test subprocesses. - GetUnitTestImpl()->listeners()->SuppressEventForwarding(); - g_in_fast_death_test_child = true; - return EXECUTE_TEST; - } else { - GTEST_DEATH_TEST_CHECK_SYSCALL_(close(pipe_fd[1])); - set_read_fd(pipe_fd[0]); - set_spawned(true); - return OVERSEE_TEST; - } -} - -// A concrete death test class that forks and re-executes the main -// program from the beginning, with command-line flags set that cause -// only this specific death test to be run. -class ExecDeathTest : public ForkingDeathTest { - public: - ExecDeathTest(const char* a_statement, const RE* a_regex, - const char* file, int line) : - ForkingDeathTest(a_statement, a_regex), file_(file), line_(line) { } - virtual TestRole AssumeRole(); - private: - static ::std::vector - GetArgvsForDeathTestChildProcess() { - ::std::vector args = GetInjectableArgvs(); - return args; - } - // The name of the file in which the death test is located. - const char* const file_; - // The line number on which the death test is located. - const int line_; -}; - -// Utility class for accumulating command-line arguments. -class Arguments { - public: - Arguments() { - args_.push_back(NULL); - } - - ~Arguments() { - for (std::vector::iterator i = args_.begin(); i != args_.end(); - ++i) { - free(*i); - } - } - void AddArgument(const char* argument) { - args_.insert(args_.end() - 1, posix::StrDup(argument)); - } - - template - void AddArguments(const ::std::vector& arguments) { - for (typename ::std::vector::const_iterator i = arguments.begin(); - i != arguments.end(); - ++i) { - args_.insert(args_.end() - 1, posix::StrDup(i->c_str())); - } - } - char* const* Argv() { - return &args_[0]; - } - - private: - std::vector args_; -}; - -// A struct that encompasses the arguments to the child process of a -// threadsafe-style death test process. -struct ExecDeathTestArgs { - char* const* argv; // Command-line arguments for the child's call to exec - int close_fd; // File descriptor to close; the read end of a pipe -}; - -# if GTEST_OS_MAC -inline char** GetEnviron() { - // When Google Test is built as a framework on MacOS X, the environ variable - // is unavailable. Apple's documentation (man environ) recommends using - // _NSGetEnviron() instead. - return *_NSGetEnviron(); -} -# else -// Some POSIX platforms expect you to declare environ. extern "C" makes -// it reside in the global namespace. -extern "C" char** environ; -inline char** GetEnviron() { return environ; } -# endif // GTEST_OS_MAC - -# if !GTEST_OS_QNX -// The main function for a threadsafe-style death test child process. -// This function is called in a clone()-ed process and thus must avoid -// any potentially unsafe operations like malloc or libc functions. -static int ExecDeathTestChildMain(void* child_arg) { - ExecDeathTestArgs* const args = static_cast(child_arg); - GTEST_DEATH_TEST_CHECK_SYSCALL_(close(args->close_fd)); - - // We need to execute the test program in the same environment where - // it was originally invoked. Therefore we change to the original - // working directory first. - const char* const original_dir = - UnitTest::GetInstance()->original_working_dir(); - // We can safely call chdir() as it's a direct system call. - if (chdir(original_dir) != 0) { - DeathTestAbort(std::string("chdir(\"") + original_dir + "\") failed: " + - GetLastErrnoDescription()); - return EXIT_FAILURE; - } - - // We can safely call execve() as it's a direct system call. We - // cannot use execvp() as it's a libc function and thus potentially - // unsafe. Since execve() doesn't search the PATH, the user must - // invoke the test program via a valid path that contains at least - // one path separator. - execve(args->argv[0], args->argv, GetEnviron()); - DeathTestAbort(std::string("execve(") + args->argv[0] + ", ...) in " + - original_dir + " failed: " + - GetLastErrnoDescription()); - return EXIT_FAILURE; -} -# endif // !GTEST_OS_QNX - -// Two utility routines that together determine the direction the stack -// grows. -// This could be accomplished more elegantly by a single recursive -// function, but we want to guard against the unlikely possibility of -// a smart compiler optimizing the recursion away. -// -// GTEST_NO_INLINE_ is required to prevent GCC 4.6 from inlining -// StackLowerThanAddress into StackGrowsDown, which then doesn't give -// correct answer. -void StackLowerThanAddress(const void* ptr, bool* result) GTEST_NO_INLINE_; -void StackLowerThanAddress(const void* ptr, bool* result) { - int dummy; - *result = (&dummy < ptr); -} - -bool StackGrowsDown() { - int dummy; - bool result; - StackLowerThanAddress(&dummy, &result); - return result; -} - -// Spawns a child process with the same executable as the current process in -// a thread-safe manner and instructs it to run the death test. The -// implementation uses fork(2) + exec. On systems where clone(2) is -// available, it is used instead, being slightly more thread-safe. On QNX, -// fork supports only single-threaded environments, so this function uses -// spawn(2) there instead. The function dies with an error message if -// anything goes wrong. -static pid_t ExecDeathTestSpawnChild(char* const* argv, int close_fd) { - ExecDeathTestArgs args = { argv, close_fd }; - pid_t child_pid = -1; - -# if GTEST_OS_QNX - // Obtains the current directory and sets it to be closed in the child - // process. - const int cwd_fd = open(".", O_RDONLY); - GTEST_DEATH_TEST_CHECK_(cwd_fd != -1); - GTEST_DEATH_TEST_CHECK_SYSCALL_(fcntl(cwd_fd, F_SETFD, FD_CLOEXEC)); - // We need to execute the test program in the same environment where - // it was originally invoked. Therefore we change to the original - // working directory first. - const char* const original_dir = - UnitTest::GetInstance()->original_working_dir(); - // We can safely call chdir() as it's a direct system call. - if (chdir(original_dir) != 0) { - DeathTestAbort(std::string("chdir(\"") + original_dir + "\") failed: " + - GetLastErrnoDescription()); - return EXIT_FAILURE; - } - - int fd_flags; - // Set close_fd to be closed after spawn. - GTEST_DEATH_TEST_CHECK_SYSCALL_(fd_flags = fcntl(close_fd, F_GETFD)); - GTEST_DEATH_TEST_CHECK_SYSCALL_(fcntl(close_fd, F_SETFD, - fd_flags | FD_CLOEXEC)); - struct inheritance inherit = {0}; - // spawn is a system call. - child_pid = spawn(args.argv[0], 0, NULL, &inherit, args.argv, GetEnviron()); - // Restores the current working directory. - GTEST_DEATH_TEST_CHECK_(fchdir(cwd_fd) != -1); - GTEST_DEATH_TEST_CHECK_SYSCALL_(close(cwd_fd)); - -# else // GTEST_OS_QNX -# if GTEST_OS_LINUX - // When a SIGPROF signal is received while fork() or clone() are executing, - // the process may hang. To avoid this, we ignore SIGPROF here and re-enable - // it after the call to fork()/clone() is complete. - struct sigaction saved_sigprof_action; - struct sigaction ignore_sigprof_action; - memset(&ignore_sigprof_action, 0, sizeof(ignore_sigprof_action)); - sigemptyset(&ignore_sigprof_action.sa_mask); - ignore_sigprof_action.sa_handler = SIG_IGN; - GTEST_DEATH_TEST_CHECK_SYSCALL_(sigaction( - SIGPROF, &ignore_sigprof_action, &saved_sigprof_action)); -# endif // GTEST_OS_LINUX - -# if GTEST_HAS_CLONE - const bool use_fork = GTEST_FLAG(death_test_use_fork); - - if (!use_fork) { - static const bool stack_grows_down = StackGrowsDown(); - const size_t stack_size = getpagesize(); - // MMAP_ANONYMOUS is not defined on Mac, so we use MAP_ANON instead. - void* const stack = mmap(NULL, stack_size, PROT_READ | PROT_WRITE, - MAP_ANON | MAP_PRIVATE, -1, 0); - GTEST_DEATH_TEST_CHECK_(stack != MAP_FAILED); - - // Maximum stack alignment in bytes: For a downward-growing stack, this - // amount is subtracted from size of the stack space to get an address - // that is within the stack space and is aligned on all systems we care - // about. As far as I know there is no ABI with stack alignment greater - // than 64. We assume stack and stack_size already have alignment of - // kMaxStackAlignment. - const size_t kMaxStackAlignment = 64; - void* const stack_top = - static_cast(stack) + - (stack_grows_down ? stack_size - kMaxStackAlignment : 0); - GTEST_DEATH_TEST_CHECK_(stack_size > kMaxStackAlignment && - reinterpret_cast(stack_top) % kMaxStackAlignment == 0); - - child_pid = clone(&ExecDeathTestChildMain, stack_top, SIGCHLD, &args); - - GTEST_DEATH_TEST_CHECK_(munmap(stack, stack_size) != -1); - } -# else - const bool use_fork = true; -# endif // GTEST_HAS_CLONE - - if (use_fork && (child_pid = fork()) == 0) { - ExecDeathTestChildMain(&args); - _exit(0); - } -# endif // GTEST_OS_QNX -# if GTEST_OS_LINUX - GTEST_DEATH_TEST_CHECK_SYSCALL_( - sigaction(SIGPROF, &saved_sigprof_action, NULL)); -# endif // GTEST_OS_LINUX - - GTEST_DEATH_TEST_CHECK_(child_pid != -1); - return child_pid; -} - -// The AssumeRole process for a fork-and-exec death test. It re-executes the -// main program from the beginning, setting the --gtest_filter -// and --gtest_internal_run_death_test flags to cause only the current -// death test to be re-run. -DeathTest::TestRole ExecDeathTest::AssumeRole() { - const UnitTestImpl* const impl = GetUnitTestImpl(); - const InternalRunDeathTestFlag* const flag = - impl->internal_run_death_test_flag(); - const TestInfo* const info = impl->current_test_info(); - const int death_test_index = info->result()->death_test_count(); - - if (flag != NULL) { - set_write_fd(flag->write_fd()); - return EXECUTE_TEST; - } - - int pipe_fd[2]; - GTEST_DEATH_TEST_CHECK_(pipe(pipe_fd) != -1); - // Clear the close-on-exec flag on the write end of the pipe, lest - // it be closed when the child process does an exec: - GTEST_DEATH_TEST_CHECK_(fcntl(pipe_fd[1], F_SETFD, 0) != -1); - - const std::string filter_flag = - std::string("--") + GTEST_FLAG_PREFIX_ + kFilterFlag + "=" - + info->test_case_name() + "." + info->name(); - const std::string internal_flag = - std::string("--") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag + "=" - + file_ + "|" + StreamableToString(line_) + "|" - + StreamableToString(death_test_index) + "|" - + StreamableToString(pipe_fd[1]); - Arguments args; - args.AddArguments(GetArgvsForDeathTestChildProcess()); - args.AddArgument(filter_flag.c_str()); - args.AddArgument(internal_flag.c_str()); - - DeathTest::set_last_death_test_message(""); - - CaptureStderr(); - // See the comment in NoExecDeathTest::AssumeRole for why the next line - // is necessary. - FlushInfoLog(); - - const pid_t child_pid = ExecDeathTestSpawnChild(args.Argv(), pipe_fd[0]); - GTEST_DEATH_TEST_CHECK_SYSCALL_(close(pipe_fd[1])); - set_child_pid(child_pid); - set_read_fd(pipe_fd[0]); - set_spawned(true); - return OVERSEE_TEST; -} - -# endif // !GTEST_OS_WINDOWS - -// Creates a concrete DeathTest-derived class that depends on the -// --gtest_death_test_style flag, and sets the pointer pointed to -// by the "test" argument to its address. If the test should be -// skipped, sets that pointer to NULL. Returns true, unless the -// flag is set to an invalid value. -bool DefaultDeathTestFactory::Create(const char* statement, const RE* regex, - const char* file, int line, - DeathTest** test) { - UnitTestImpl* const impl = GetUnitTestImpl(); - const InternalRunDeathTestFlag* const flag = - impl->internal_run_death_test_flag(); - const int death_test_index = impl->current_test_info() - ->increment_death_test_count(); - - if (flag != NULL) { - if (death_test_index > flag->index()) { - DeathTest::set_last_death_test_message( - "Death test count (" + StreamableToString(death_test_index) - + ") somehow exceeded expected maximum (" - + StreamableToString(flag->index()) + ")"); - return false; - } - - if (!(flag->file() == file && flag->line() == line && - flag->index() == death_test_index)) { - *test = NULL; - return true; - } - } - -# if GTEST_OS_WINDOWS - - if (GTEST_FLAG(death_test_style) == "threadsafe" || - GTEST_FLAG(death_test_style) == "fast") { - *test = new WindowsDeathTest(statement, regex, file, line); - } - -# else - - if (GTEST_FLAG(death_test_style) == "threadsafe") { - *test = new ExecDeathTest(statement, regex, file, line); - } else if (GTEST_FLAG(death_test_style) == "fast") { - *test = new NoExecDeathTest(statement, regex); - } - -# endif // GTEST_OS_WINDOWS - - else { // NOLINT - this is more readable than unbalanced brackets inside #if. - DeathTest::set_last_death_test_message( - "Unknown death test style \"" + GTEST_FLAG(death_test_style) - + "\" encountered"); - return false; - } - - return true; -} - -// Splits a given string on a given delimiter, populating a given -// vector with the fields. GTEST_HAS_DEATH_TEST implies that we have -// ::std::string, so we can use it here. -static void SplitString(const ::std::string& str, char delimiter, - ::std::vector< ::std::string>* dest) { - ::std::vector< ::std::string> parsed; - ::std::string::size_type pos = 0; - while (::testing::internal::AlwaysTrue()) { - const ::std::string::size_type colon = str.find(delimiter, pos); - if (colon == ::std::string::npos) { - parsed.push_back(str.substr(pos)); - break; - } else { - parsed.push_back(str.substr(pos, colon - pos)); - pos = colon + 1; - } - } - dest->swap(parsed); -} - -# if GTEST_OS_WINDOWS -// Recreates the pipe and event handles from the provided parameters, -// signals the event, and returns a file descriptor wrapped around the pipe -// handle. This function is called in the child process only. -int GetStatusFileDescriptor(unsigned int parent_process_id, - size_t write_handle_as_size_t, - size_t event_handle_as_size_t) { - AutoHandle parent_process_handle(::OpenProcess(PROCESS_DUP_HANDLE, - FALSE, // Non-inheritable. - parent_process_id)); - if (parent_process_handle.Get() == INVALID_HANDLE_VALUE) { - DeathTestAbort("Unable to open parent process " + - StreamableToString(parent_process_id)); - } - - // TODO(vladl@google.com): Replace the following check with a - // compile-time assertion when available. - GTEST_CHECK_(sizeof(HANDLE) <= sizeof(size_t)); - - const HANDLE write_handle = - reinterpret_cast(write_handle_as_size_t); - HANDLE dup_write_handle; - - // The newly initialized handle is accessible only in in the parent - // process. To obtain one accessible within the child, we need to use - // DuplicateHandle. - if (!::DuplicateHandle(parent_process_handle.Get(), write_handle, - ::GetCurrentProcess(), &dup_write_handle, - 0x0, // Requested privileges ignored since - // DUPLICATE_SAME_ACCESS is used. - FALSE, // Request non-inheritable handler. - DUPLICATE_SAME_ACCESS)) { - DeathTestAbort("Unable to duplicate the pipe handle " + - StreamableToString(write_handle_as_size_t) + - " from the parent process " + - StreamableToString(parent_process_id)); - } - - const HANDLE event_handle = reinterpret_cast(event_handle_as_size_t); - HANDLE dup_event_handle; - - if (!::DuplicateHandle(parent_process_handle.Get(), event_handle, - ::GetCurrentProcess(), &dup_event_handle, - 0x0, - FALSE, - DUPLICATE_SAME_ACCESS)) { - DeathTestAbort("Unable to duplicate the event handle " + - StreamableToString(event_handle_as_size_t) + - " from the parent process " + - StreamableToString(parent_process_id)); - } - - const int write_fd = - ::_open_osfhandle(reinterpret_cast(dup_write_handle), O_APPEND); - if (write_fd == -1) { - DeathTestAbort("Unable to convert pipe handle " + - StreamableToString(write_handle_as_size_t) + - " to a file descriptor"); - } - - // Signals the parent that the write end of the pipe has been acquired - // so the parent can release its own write end. - ::SetEvent(dup_event_handle); - - return write_fd; -} -# endif // GTEST_OS_WINDOWS - -// Returns a newly created InternalRunDeathTestFlag object with fields -// initialized from the GTEST_FLAG(internal_run_death_test) flag if -// the flag is specified; otherwise returns NULL. -InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag() { - if (GTEST_FLAG(internal_run_death_test) == "") return NULL; - - // GTEST_HAS_DEATH_TEST implies that we have ::std::string, so we - // can use it here. - int line = -1; - int index = -1; - ::std::vector< ::std::string> fields; - SplitString(GTEST_FLAG(internal_run_death_test).c_str(), '|', &fields); - int write_fd = -1; - -# if GTEST_OS_WINDOWS - - unsigned int parent_process_id = 0; - size_t write_handle_as_size_t = 0; - size_t event_handle_as_size_t = 0; - - if (fields.size() != 6 - || !ParseNaturalNumber(fields[1], &line) - || !ParseNaturalNumber(fields[2], &index) - || !ParseNaturalNumber(fields[3], &parent_process_id) - || !ParseNaturalNumber(fields[4], &write_handle_as_size_t) - || !ParseNaturalNumber(fields[5], &event_handle_as_size_t)) { - DeathTestAbort("Bad --gtest_internal_run_death_test flag: " + - GTEST_FLAG(internal_run_death_test)); - } - write_fd = GetStatusFileDescriptor(parent_process_id, - write_handle_as_size_t, - event_handle_as_size_t); -# else - - if (fields.size() != 4 - || !ParseNaturalNumber(fields[1], &line) - || !ParseNaturalNumber(fields[2], &index) - || !ParseNaturalNumber(fields[3], &write_fd)) { - DeathTestAbort("Bad --gtest_internal_run_death_test flag: " - + GTEST_FLAG(internal_run_death_test)); - } - -# endif // GTEST_OS_WINDOWS - - return new InternalRunDeathTestFlag(fields[0], line, index, write_fd); -} - -} // namespace internal - -#endif // GTEST_HAS_DEATH_TEST - -} // namespace testing -// Copyright 2008, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. 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. -// -// Authors: keith.ray@gmail.com (Keith Ray) - - -#include - -#if GTEST_OS_WINDOWS_MOBILE -# include -#elif GTEST_OS_WINDOWS -# include -# include -#elif GTEST_OS_SYMBIAN -// Symbian OpenC has PATH_MAX in sys/syslimits.h -# include -#else -# include -# include // Some Linux distributions define PATH_MAX here. -#endif // GTEST_OS_WINDOWS_MOBILE - -#if GTEST_OS_WINDOWS -# define GTEST_PATH_MAX_ _MAX_PATH -#elif defined(PATH_MAX) -# define GTEST_PATH_MAX_ PATH_MAX -#elif defined(_XOPEN_PATH_MAX) -# define GTEST_PATH_MAX_ _XOPEN_PATH_MAX -#else -# define GTEST_PATH_MAX_ _POSIX_PATH_MAX -#endif // GTEST_OS_WINDOWS - - -namespace testing { -namespace internal { - -#if GTEST_OS_WINDOWS -// On Windows, '\\' is the standard path separator, but many tools and the -// Windows API also accept '/' as an alternate path separator. Unless otherwise -// noted, a file path can contain either kind of path separators, or a mixture -// of them. -const char kPathSeparator = '\\'; -const char kAlternatePathSeparator = '/'; -//const char kPathSeparatorString[] = "\\"; -const char kAlternatePathSeparatorString[] = "/"; -# if GTEST_OS_WINDOWS_MOBILE -// Windows CE doesn't have a current directory. You should not use -// the current directory in tests on Windows CE, but this at least -// provides a reasonable fallback. -const char kCurrentDirectoryString[] = "\\"; -// Windows CE doesn't define INVALID_FILE_ATTRIBUTES -const DWORD kInvalidFileAttributes = 0xffffffff; -# else -const char kCurrentDirectoryString[] = ".\\"; -# endif // GTEST_OS_WINDOWS_MOBILE -#else -const char kPathSeparator = '/'; -//const char kPathSeparatorString[] = "/"; -const char kCurrentDirectoryString[] = "./"; -#endif // GTEST_OS_WINDOWS - -// Returns whether the given character is a valid path separator. -static bool IsPathSeparator(char c) { -#if GTEST_HAS_ALT_PATH_SEP_ - return (c == kPathSeparator) || (c == kAlternatePathSeparator); -#else - return c == kPathSeparator; -#endif -} - -// Returns the current working directory, or "" if unsuccessful. -FilePath FilePath::GetCurrentDir() { -#if GTEST_OS_WINDOWS_MOBILE - // Windows CE doesn't have a current directory, so we just return - // something reasonable. - return FilePath(kCurrentDirectoryString); -#elif GTEST_OS_WINDOWS - char cwd[GTEST_PATH_MAX_ + 1] = { '\0' }; - return FilePath(_getcwd(cwd, sizeof(cwd)) == NULL ? "" : cwd); -#else - char cwd[GTEST_PATH_MAX_ + 1] = { '\0' }; - return FilePath(getcwd(cwd, sizeof(cwd)) == NULL ? "" : cwd); -#endif // GTEST_OS_WINDOWS_MOBILE -} - -// Returns a copy of the FilePath with the case-insensitive extension removed. -// Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns -// FilePath("dir/file"). If a case-insensitive extension is not -// found, returns a copy of the original FilePath. -FilePath FilePath::RemoveExtension(const char* extension) const { - const std::string dot_extension = std::string(".") + extension; - if (String::EndsWithCaseInsensitive(pathname_, dot_extension)) { - return FilePath(pathname_.substr( - 0, pathname_.length() - dot_extension.length())); - } - return *this; -} - -// Returns a pointer to the last occurence of a valid path separator in -// the FilePath. On Windows, for example, both '/' and '\' are valid path -// separators. Returns NULL if no path separator was found. -const char* FilePath::FindLastPathSeparator() const { - const char* const last_sep = strrchr(c_str(), kPathSeparator); -#if GTEST_HAS_ALT_PATH_SEP_ - const char* const last_alt_sep = strrchr(c_str(), kAlternatePathSeparator); - // Comparing two pointers of which only one is NULL is undefined. - if (last_alt_sep != NULL && - (last_sep == NULL || last_alt_sep > last_sep)) { - return last_alt_sep; - } -#endif - return last_sep; -} - -// Returns a copy of the FilePath with the directory part removed. -// Example: FilePath("path/to/file").RemoveDirectoryName() returns -// FilePath("file"). If there is no directory part ("just_a_file"), it returns -// the FilePath unmodified. If there is no file part ("just_a_dir/") it -// returns an empty FilePath (""). -// On Windows platform, '\' is the path separator, otherwise it is '/'. -FilePath FilePath::RemoveDirectoryName() const { - const char* const last_sep = FindLastPathSeparator(); - return last_sep ? FilePath(last_sep + 1) : *this; -} - -// RemoveFileName returns the directory path with the filename removed. -// Example: FilePath("path/to/file").RemoveFileName() returns "path/to/". -// If the FilePath is "a_file" or "/a_file", RemoveFileName returns -// FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does -// not have a file, like "just/a/dir/", it returns the FilePath unmodified. -// On Windows platform, '\' is the path separator, otherwise it is '/'. -FilePath FilePath::RemoveFileName() const { - const char* const last_sep = FindLastPathSeparator(); - std::string dir; - if (last_sep) { - dir = std::string(c_str(), last_sep + 1 - c_str()); - } else { - dir = kCurrentDirectoryString; - } - return FilePath(dir); -} - -// Helper functions for naming files in a directory for xml output. - -// Given directory = "dir", base_name = "test", number = 0, -// extension = "xml", returns "dir/test.xml". If number is greater -// than zero (e.g., 12), returns "dir/test_12.xml". -// On Windows platform, uses \ as the separator rather than /. -FilePath FilePath::MakeFileName(const FilePath& directory, - const FilePath& base_name, - int number, - const char* extension) { - std::string file; - if (number == 0) { - file = base_name.string() + "." + extension; - } else { - file = base_name.string() + "_" + StreamableToString(number) - + "." + extension; - } - return ConcatPaths(directory, FilePath(file)); -} - -// Given directory = "dir", relative_path = "test.xml", returns "dir/test.xml". -// On Windows, uses \ as the separator rather than /. -FilePath FilePath::ConcatPaths(const FilePath& directory, - const FilePath& relative_path) { - if (directory.IsEmpty()) - return relative_path; - const FilePath dir(directory.RemoveTrailingPathSeparator()); - return FilePath(dir.string() + kPathSeparator + relative_path.string()); -} - -// Returns true if pathname describes something findable in the file-system, -// either a file, directory, or whatever. -bool FilePath::FileOrDirectoryExists() const { -#if GTEST_OS_WINDOWS_MOBILE - LPCWSTR unicode = String::AnsiToUtf16(pathname_.c_str()); - const DWORD attributes = GetFileAttributes(unicode); - delete [] unicode; - return attributes != kInvalidFileAttributes; -#else - posix::StatStruct file_stat; - return posix::Stat(pathname_.c_str(), &file_stat) == 0; -#endif // GTEST_OS_WINDOWS_MOBILE -} - -// Returns true if pathname describes a directory in the file-system -// that exists. -bool FilePath::DirectoryExists() const { - bool result = false; -#if GTEST_OS_WINDOWS - // Don't strip off trailing separator if path is a root directory on - // Windows (like "C:\\"). - const FilePath& path(IsRootDirectory() ? *this : - RemoveTrailingPathSeparator()); -#else - const FilePath& path(*this); -#endif - -#if GTEST_OS_WINDOWS_MOBILE - LPCWSTR unicode = String::AnsiToUtf16(path.c_str()); - const DWORD attributes = GetFileAttributes(unicode); - delete [] unicode; - if ((attributes != kInvalidFileAttributes) && - (attributes & FILE_ATTRIBUTE_DIRECTORY)) { - result = true; - } -#else - posix::StatStruct file_stat; - result = posix::Stat(path.c_str(), &file_stat) == 0 && - posix::IsDir(file_stat); -#endif // GTEST_OS_WINDOWS_MOBILE - - return result; -} - -// Returns true if pathname describes a root directory. (Windows has one -// root directory per disk drive.) -bool FilePath::IsRootDirectory() const { -#if GTEST_OS_WINDOWS - // TODO(wan@google.com): on Windows a network share like - // \\server\share can be a root directory, although it cannot be the - // current directory. Handle this properly. - return pathname_.length() == 3 && IsAbsolutePath(); -#else - return pathname_.length() == 1 && IsPathSeparator(pathname_.c_str()[0]); -#endif -} - -// Returns true if pathname describes an absolute path. -bool FilePath::IsAbsolutePath() const { - const char* const name = pathname_.c_str(); -#if GTEST_OS_WINDOWS - return pathname_.length() >= 3 && - ((name[0] >= 'a' && name[0] <= 'z') || - (name[0] >= 'A' && name[0] <= 'Z')) && - name[1] == ':' && - IsPathSeparator(name[2]); -#else - return IsPathSeparator(name[0]); -#endif -} - -// Returns a pathname for a file that does not currently exist. The pathname -// will be directory/base_name.extension or -// directory/base_name_.extension if directory/base_name.extension -// already exists. The number will be incremented until a pathname is found -// that does not already exist. -// Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. -// There could be a race condition if two or more processes are calling this -// function at the same time -- they could both pick the same filename. -FilePath FilePath::GenerateUniqueFileName(const FilePath& directory, - const FilePath& base_name, - const char* extension) { - FilePath full_pathname; - int number = 0; - do { - full_pathname.Set(MakeFileName(directory, base_name, number++, extension)); - } while (full_pathname.FileOrDirectoryExists()); - return full_pathname; -} - -// Returns true if FilePath ends with a path separator, which indicates that -// it is intended to represent a directory. Returns false otherwise. -// This does NOT check that a directory (or file) actually exists. -bool FilePath::IsDirectory() const { - return !pathname_.empty() && - IsPathSeparator(pathname_.c_str()[pathname_.length() - 1]); -} - -// Create directories so that path exists. Returns true if successful or if -// the directories already exist; returns false if unable to create directories -// for any reason. -bool FilePath::CreateDirectoriesRecursively() const { - if (!this->IsDirectory()) { - return false; - } - - if (pathname_.length() == 0 || this->DirectoryExists()) { - return true; - } - - const FilePath parent(this->RemoveTrailingPathSeparator().RemoveFileName()); - return parent.CreateDirectoriesRecursively() && this->CreateFolder(); -} - -// Create the directory so that path exists. Returns true if successful or -// if the directory already exists; returns false if unable to create the -// directory for any reason, including if the parent directory does not -// exist. Not named "CreateDirectory" because that's a macro on Windows. -bool FilePath::CreateFolder() const { -#if GTEST_OS_WINDOWS_MOBILE - FilePath removed_sep(this->RemoveTrailingPathSeparator()); - LPCWSTR unicode = String::AnsiToUtf16(removed_sep.c_str()); - int result = CreateDirectory(unicode, NULL) ? 0 : -1; - delete [] unicode; -#elif GTEST_OS_WINDOWS - int result = _mkdir(pathname_.c_str()); -#else - int result = mkdir(pathname_.c_str(), 0777); -#endif // GTEST_OS_WINDOWS_MOBILE - - if (result == -1) { - return this->DirectoryExists(); // An error is OK if the directory exists. - } - return true; // No error. -} - -// If input name has a trailing separator character, remove it and return the -// name, otherwise return the name string unmodified. -// On Windows platform, uses \ as the separator, other platforms use /. -FilePath FilePath::RemoveTrailingPathSeparator() const { - return IsDirectory() - ? FilePath(pathname_.substr(0, pathname_.length() - 1)) - : *this; -} - -// Removes any redundant separators that might be in the pathname. -// For example, "bar///foo" becomes "bar/foo". Does not eliminate other -// redundancies that might be in a pathname involving "." or "..". -// TODO(wan@google.com): handle Windows network shares (e.g. \\server\share). -void FilePath::Normalize() { - if (pathname_.c_str() == NULL) { - pathname_ = ""; - return; - } - const char* src = pathname_.c_str(); - char* const dest = new char[pathname_.length() + 1]; - char* dest_ptr = dest; - memset(dest_ptr, 0, pathname_.length() + 1); - - while (*src != '\0') { - *dest_ptr = *src; - if (!IsPathSeparator(*src)) { - src++; - } else { -#if GTEST_HAS_ALT_PATH_SEP_ - if (*dest_ptr == kAlternatePathSeparator) { - *dest_ptr = kPathSeparator; - } -#endif - while (IsPathSeparator(*src)) - src++; - } - dest_ptr++; - } - *dest_ptr = '\0'; - pathname_ = dest; - delete[] dest; -} - -} // namespace internal -} // namespace testing -// Copyright 2008, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. 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. -// -// Author: wan@google.com (Zhanyong Wan) - - -#include -#include -#include -#include - -#if GTEST_OS_WINDOWS_MOBILE -# include // For TerminateProcess() -#elif GTEST_OS_WINDOWS -# include -# include -#else -# include -#endif // GTEST_OS_WINDOWS_MOBILE - -#if GTEST_OS_MAC -# include -# include -# include -#endif // GTEST_OS_MAC - -#if GTEST_OS_QNX -# include -# include -#endif // GTEST_OS_QNX - - -// Indicates that this translation unit is part of Google Test's -// implementation. It must come before gtest-internal-inl.h is -// included, or there will be a compiler error. This trick is to -// prevent a user from accidentally including gtest-internal-inl.h in -// his code. -#define GTEST_IMPLEMENTATION_ 1 -#undef GTEST_IMPLEMENTATION_ - -namespace testing { -namespace internal { - -#if defined(_MSC_VER) || defined(__BORLANDC__) -// MSVC and C++Builder do not provide a definition of STDERR_FILENO. -const int kStdOutFileno = 1; -const int kStdErrFileno = 2; -#else -const int kStdOutFileno = STDOUT_FILENO; -const int kStdErrFileno = STDERR_FILENO; -#endif // _MSC_VER - -#if GTEST_OS_MAC - -// Returns the number of threads running in the process, or 0 to indicate that -// we cannot detect it. -size_t GetThreadCount() { - const task_t task = mach_task_self(); - mach_msg_type_number_t thread_count; - thread_act_array_t thread_list; - const kern_return_t status = task_threads(task, &thread_list, &thread_count); - if (status == KERN_SUCCESS) { - // task_threads allocates resources in thread_list and we need to free them - // to avoid leaks. - vm_deallocate(task, - reinterpret_cast(thread_list), - sizeof(thread_t) * thread_count); - return static_cast(thread_count); - } else { - return 0; - } -} - -#elif GTEST_OS_QNX - -// Returns the number of threads running in the process, or 0 to indicate that -// we cannot detect it. -size_t GetThreadCount() { - const int fd = open("/proc/self/as", O_RDONLY); - if (fd < 0) { - return 0; - } - procfs_info process_info; - const int status = - devctl(fd, DCMD_PROC_INFO, &process_info, sizeof(process_info), NULL); - close(fd); - if (status == EOK) { - return static_cast(process_info.num_threads); - } else { - return 0; - } -} - -#else - -size_t GetThreadCount() { - // There's no portable way to detect the number of threads, so we just - // return 0 to indicate that we cannot detect it. - return 0; -} - -#endif // GTEST_OS_MAC - -#if GTEST_USES_POSIX_RE - -// Implements RE. Currently only needed for death tests. - -RE::~RE() { - if (is_valid_) { - // regfree'ing an invalid regex might crash because the content - // of the regex is undefined. Since the regex's are essentially - // the same, one cannot be valid (or invalid) without the other - // being so too. - regfree(&partial_regex_); - regfree(&full_regex_); - } - free(const_cast(pattern_)); -} - -// Returns true iff regular expression re matches the entire str. -bool RE::FullMatch(const char* str, const RE& re) { - if (!re.is_valid_) return false; - - regmatch_t match; - return regexec(&re.full_regex_, str, 1, &match, 0) == 0; -} - -// Returns true iff regular expression re matches a substring of str -// (including str itself). -bool RE::PartialMatch(const char* str, const RE& re) { - if (!re.is_valid_) return false; - - regmatch_t match; - return regexec(&re.partial_regex_, str, 1, &match, 0) == 0; -} - -// Initializes an RE from its string representation. -void RE::Init(const char* regex) { - pattern_ = posix::StrDup(regex); - - // Reserves enough bytes to hold the regular expression used for a - // full match. - const size_t full_regex_len = strlen(regex) + 10; - char* const full_pattern = new char[full_regex_len]; - - snprintf(full_pattern, full_regex_len, "^(%s)$", regex); - is_valid_ = regcomp(&full_regex_, full_pattern, REG_EXTENDED) == 0; - // We want to call regcomp(&partial_regex_, ...) even if the - // previous expression returns false. Otherwise partial_regex_ may - // not be properly initialized can may cause trouble when it's - // freed. - // - // Some implementation of POSIX regex (e.g. on at least some - // versions of Cygwin) doesn't accept the empty string as a valid - // regex. We change it to an equivalent form "()" to be safe. - if (is_valid_) { - const char* const partial_regex = (*regex == '\0') ? "()" : regex; - is_valid_ = regcomp(&partial_regex_, partial_regex, REG_EXTENDED) == 0; - } - EXPECT_TRUE(is_valid_) - << "Regular expression \"" << regex - << "\" is not a valid POSIX Extended regular expression."; - - delete[] full_pattern; -} - -#elif GTEST_USES_SIMPLE_RE - -// Returns true iff ch appears anywhere in str (excluding the -// terminating '\0' character). -bool IsInSet(char ch, const char* str) { - return ch != '\0' && strchr(str, ch) != NULL; -} - -// Returns true iff ch belongs to the given classification. Unlike -// similar functions in , these aren't affected by the -// current locale. -bool IsAsciiDigit(char ch) { return '0' <= ch && ch <= '9'; } -bool IsAsciiPunct(char ch) { - return IsInSet(ch, "^-!\"#$%&'()*+,./:;<=>?@[\\]_`{|}~"); -} -bool IsRepeat(char ch) { return IsInSet(ch, "?*+"); } -bool IsAsciiWhiteSpace(char ch) { return IsInSet(ch, " \f\n\r\t\v"); } -bool IsAsciiWordChar(char ch) { - return ('a' <= ch && ch <= 'z') || ('A' <= ch && ch <= 'Z') || - ('0' <= ch && ch <= '9') || ch == '_'; -} - -// Returns true iff "\\c" is a supported escape sequence. -bool IsValidEscape(char c) { - return (IsAsciiPunct(c) || IsInSet(c, "dDfnrsStvwW")); -} - -// Returns true iff the given atom (specified by escaped and pattern) -// matches ch. The result is undefined if the atom is invalid. -bool AtomMatchesChar(bool escaped, char pattern_char, char ch) { - if (escaped) { // "\\p" where p is pattern_char. - switch (pattern_char) { - case 'd': return IsAsciiDigit(ch); - case 'D': return !IsAsciiDigit(ch); - case 'f': return ch == '\f'; - case 'n': return ch == '\n'; - case 'r': return ch == '\r'; - case 's': return IsAsciiWhiteSpace(ch); - case 'S': return !IsAsciiWhiteSpace(ch); - case 't': return ch == '\t'; - case 'v': return ch == '\v'; - case 'w': return IsAsciiWordChar(ch); - case 'W': return !IsAsciiWordChar(ch); - } - return IsAsciiPunct(pattern_char) && pattern_char == ch; - } - - return (pattern_char == '.' && ch != '\n') || pattern_char == ch; -} - -// Helper function used by ValidateRegex() to format error messages. -std::string FormatRegexSyntaxError(const char* regex, int index) { - return (Message() << "Syntax error at index " << index - << " in simple regular expression \"" << regex << "\": ").GetString(); -} - -// Generates non-fatal failures and returns false if regex is invalid; -// otherwise returns true. -bool ValidateRegex(const char* regex) { - if (regex == NULL) { - // TODO(wan@google.com): fix the source file location in the - // assertion failures to match where the regex is used in user - // code. - ADD_FAILURE() << "NULL is not a valid simple regular expression."; - return false; - } - - bool is_valid = true; - - // True iff ?, *, or + can follow the previous atom. - bool prev_repeatable = false; - for (int i = 0; regex[i]; i++) { - if (regex[i] == '\\') { // An escape sequence - i++; - if (regex[i] == '\0') { - ADD_FAILURE() << FormatRegexSyntaxError(regex, i - 1) - << "'\\' cannot appear at the end."; - return false; - } - - if (!IsValidEscape(regex[i])) { - ADD_FAILURE() << FormatRegexSyntaxError(regex, i - 1) - << "invalid escape sequence \"\\" << regex[i] << "\"."; - is_valid = false; - } - prev_repeatable = true; - } else { // Not an escape sequence. - const char ch = regex[i]; - - if (ch == '^' && i > 0) { - ADD_FAILURE() << FormatRegexSyntaxError(regex, i) - << "'^' can only appear at the beginning."; - is_valid = false; - } else if (ch == '$' && regex[i + 1] != '\0') { - ADD_FAILURE() << FormatRegexSyntaxError(regex, i) - << "'$' can only appear at the end."; - is_valid = false; - } else if (IsInSet(ch, "()[]{}|")) { - ADD_FAILURE() << FormatRegexSyntaxError(regex, i) - << "'" << ch << "' is unsupported."; - is_valid = false; - } else if (IsRepeat(ch) && !prev_repeatable) { - ADD_FAILURE() << FormatRegexSyntaxError(regex, i) - << "'" << ch << "' can only follow a repeatable token."; - is_valid = false; - } - - prev_repeatable = !IsInSet(ch, "^$?*+"); - } - } - - return is_valid; -} - -// Matches a repeated regex atom followed by a valid simple regular -// expression. The regex atom is defined as c if escaped is false, -// or \c otherwise. repeat is the repetition meta character (?, *, -// or +). The behavior is undefined if str contains too many -// characters to be indexable by size_t, in which case the test will -// probably time out anyway. We are fine with this limitation as -// std::string has it too. -bool MatchRepetitionAndRegexAtHead( - bool escaped, char c, char repeat, const char* regex, - const char* str) { - const size_t min_count = (repeat == '+') ? 1 : 0; - const size_t max_count = (repeat == '?') ? 1 : - static_cast(-1) - 1; - // We cannot call numeric_limits::max() as it conflicts with the - // max() macro on Windows. - - for (size_t i = 0; i <= max_count; ++i) { - // We know that the atom matches each of the first i characters in str. - if (i >= min_count && MatchRegexAtHead(regex, str + i)) { - // We have enough matches at the head, and the tail matches too. - // Since we only care about *whether* the pattern matches str - // (as opposed to *how* it matches), there is no need to find a - // greedy match. - return true; - } - if (str[i] == '\0' || !AtomMatchesChar(escaped, c, str[i])) - return false; - } - return false; -} - -// Returns true iff regex matches a prefix of str. regex must be a -// valid simple regular expression and not start with "^", or the -// result is undefined. -bool MatchRegexAtHead(const char* regex, const char* str) { - if (*regex == '\0') // An empty regex matches a prefix of anything. - return true; - - // "$" only matches the end of a string. Note that regex being - // valid guarantees that there's nothing after "$" in it. - if (*regex == '$') - return *str == '\0'; - - // Is the first thing in regex an escape sequence? - const bool escaped = *regex == '\\'; - if (escaped) - ++regex; - if (IsRepeat(regex[1])) { - // MatchRepetitionAndRegexAtHead() calls MatchRegexAtHead(), so - // here's an indirect recursion. It terminates as the regex gets - // shorter in each recursion. - return MatchRepetitionAndRegexAtHead( - escaped, regex[0], regex[1], regex + 2, str); - } else { - // regex isn't empty, isn't "$", and doesn't start with a - // repetition. We match the first atom of regex with the first - // character of str and recurse. - return (*str != '\0') && AtomMatchesChar(escaped, *regex, *str) && - MatchRegexAtHead(regex + 1, str + 1); - } -} - -// Returns true iff regex matches any substring of str. regex must be -// a valid simple regular expression, or the result is undefined. -// -// The algorithm is recursive, but the recursion depth doesn't exceed -// the regex length, so we won't need to worry about running out of -// stack space normally. In rare cases the time complexity can be -// exponential with respect to the regex length + the string length, -// but usually it's must faster (often close to linear). -bool MatchRegexAnywhere(const char* regex, const char* str) { - if (regex == NULL || str == NULL) - return false; - - if (*regex == '^') - return MatchRegexAtHead(regex + 1, str); - - // A successful match can be anywhere in str. - do { - if (MatchRegexAtHead(regex, str)) - return true; - } while (*str++ != '\0'); - return false; -} - -// Implements the RE class. - -RE::~RE() { - free(const_cast(pattern_)); - free(const_cast(full_pattern_)); -} - -// Returns true iff regular expression re matches the entire str. -bool RE::FullMatch(const char* str, const RE& re) { - return re.is_valid_ && MatchRegexAnywhere(re.full_pattern_, str); -} - -// Returns true iff regular expression re matches a substring of str -// (including str itself). -bool RE::PartialMatch(const char* str, const RE& re) { - return re.is_valid_ && MatchRegexAnywhere(re.pattern_, str); -} - -// Initializes an RE from its string representation. -void RE::Init(const char* regex) { - pattern_ = full_pattern_ = NULL; - if (regex != NULL) { - pattern_ = posix::StrDup(regex); - } - - is_valid_ = ValidateRegex(regex); - if (!is_valid_) { - // No need to calculate the full pattern when the regex is invalid. - return; - } - - const size_t len = strlen(regex); - // Reserves enough bytes to hold the regular expression used for a - // full match: we need space to prepend a '^', append a '$', and - // terminate the string with '\0'. - char* buffer = static_cast(malloc(len + 3)); - full_pattern_ = buffer; - - if (*regex != '^') - *buffer++ = '^'; // Makes sure full_pattern_ starts with '^'. - - // We don't use snprintf or strncpy, as they trigger a warning when - // compiled with VC++ 8.0. - memcpy(buffer, regex, len); - buffer += len; - - if (len == 0 || regex[len - 1] != '$') - *buffer++ = '$'; // Makes sure full_pattern_ ends with '$'. - - *buffer = '\0'; -} - -#endif // GTEST_USES_POSIX_RE - -const char kUnknownFile[] = "unknown file"; - -// Formats a source file path and a line number as they would appear -// in an error message from the compiler used to compile this code. -GTEST_API_ ::std::string FormatFileLocation(const char* file, int line) { - const std::string file_name(file == NULL ? kUnknownFile : file); - - if (line < 0) { - return file_name + ":"; - } -#ifdef _MSC_VER - return file_name + "(" + StreamableToString(line) + "):"; -#else - return file_name + ":" + StreamableToString(line) + ":"; -#endif // _MSC_VER -} - -// Formats a file location for compiler-independent XML output. -// Although this function is not platform dependent, we put it next to -// FormatFileLocation in order to contrast the two functions. -// Note that FormatCompilerIndependentFileLocation() does NOT append colon -// to the file location it produces, unlike FormatFileLocation(). -GTEST_API_ ::std::string FormatCompilerIndependentFileLocation( - const char* file, int line) { - const std::string file_name(file == NULL ? kUnknownFile : file); - - if (line < 0) - return file_name; - else - return file_name + ":" + StreamableToString(line); -} - - -GTestLog::GTestLog(GTestLogSeverity severity, const char* file, int line) - : severity_(severity) { - const char* const marker = - severity == GTEST_INFO ? "[ INFO ]" : - severity == GTEST_WARNING ? "[WARNING]" : - severity == GTEST_ERROR ? "[ ERROR ]" : "[ FATAL ]"; - GetStream() << ::std::endl << marker << " " - << FormatFileLocation(file, line).c_str() << ": "; -} - -// Flushes the buffers and, if severity is GTEST_FATAL, aborts the program. -GTestLog::~GTestLog() { - GetStream() << ::std::endl; - if (severity_ == GTEST_FATAL) { - fflush(stderr); - posix::Abort(); - } -} -// Disable Microsoft deprecation warnings for POSIX functions called from -// this class (creat, dup, dup2, and close) -#ifdef _MSC_VER -# pragma warning(push) -# pragma warning(disable: 4996) -#endif // _MSC_VER - -#if GTEST_HAS_STREAM_REDIRECTION - -// Object that captures an output stream (stdout/stderr). -class CapturedStream { - public: - // The ctor redirects the stream to a temporary file. - explicit CapturedStream(int fd) : fd_(fd), uncaptured_fd_(dup(fd)) { -# if GTEST_OS_WINDOWS - char temp_dir_path[MAX_PATH + 1] = { '\0' }; // NOLINT - char temp_file_path[MAX_PATH + 1] = { '\0' }; // NOLINT - - ::GetTempPathA(sizeof(temp_dir_path), temp_dir_path); - const UINT success = ::GetTempFileNameA(temp_dir_path, - "gtest_redir", - 0, // Generate unique file name. - temp_file_path); - GTEST_CHECK_(success != 0) - << "Unable to create a temporary file in " << temp_dir_path; - const int captured_fd = creat(temp_file_path, _S_IREAD | _S_IWRITE); - GTEST_CHECK_(captured_fd != -1) << "Unable to open temporary file " - << temp_file_path; - filename_ = temp_file_path; -# else - // There's no guarantee that a test has write access to the current - // directory, so we create the temporary file in the /tmp directory - // instead. We use /tmp on most systems, and /sdcard on Android. - // That's because Android doesn't have /tmp. -# if GTEST_OS_LINUX_ANDROID - // Note: Android applications are expected to call the framework's - // Context.getExternalStorageDirectory() method through JNI to get - // the location of the world-writable SD Card directory. However, - // this requires a Context handle, which cannot be retrieved - // globally from native code. Doing so also precludes running the - // code as part of a regular standalone executable, which doesn't - // run in a Dalvik process (e.g. when running it through 'adb shell'). - // - // The location /sdcard is directly accessible from native code - // and is the only location (unofficially) supported by the Android - // team. It's generally a symlink to the real SD Card mount point - // which can be /mnt/sdcard, /mnt/sdcard0, /system/media/sdcard, or - // other OEM-customized locations. Never rely on these, and always - // use /sdcard. - char name_template[] = "/sdcard/gtest_captured_stream.XXXXXX"; -# else - char name_template[] = "/tmp/captured_stream.XXXXXX"; -# endif // GTEST_OS_LINUX_ANDROID - const int captured_fd = mkstemp(name_template); - filename_ = name_template; -# endif // GTEST_OS_WINDOWS - fflush(NULL); - dup2(captured_fd, fd_); - close(captured_fd); - } - - ~CapturedStream() { - remove(filename_.c_str()); - } - - std::string GetCapturedString() { - if (uncaptured_fd_ != -1) { - // Restores the original stream. - fflush(NULL); - dup2(uncaptured_fd_, fd_); - close(uncaptured_fd_); - uncaptured_fd_ = -1; - } - - FILE* const file = posix::FOpen(filename_.c_str(), "r"); - const std::string content = ReadEntireFile(file); - posix::FClose(file); - return content; - } - - private: - // Reads the entire content of a file as an std::string. - static std::string ReadEntireFile(FILE* file); - - // Returns the size (in bytes) of a file. - static size_t GetFileSize(FILE* file); - - const int fd_; // A stream to capture. - int uncaptured_fd_; - // Name of the temporary file holding the stderr output. - ::std::string filename_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(CapturedStream); -}; - -// Returns the size (in bytes) of a file. -size_t CapturedStream::GetFileSize(FILE* file) { - fseek(file, 0, SEEK_END); - return static_cast(ftell(file)); -} - -// Reads the entire content of a file as a string. -std::string CapturedStream::ReadEntireFile(FILE* file) { - const size_t file_size = GetFileSize(file); - char* const buffer = new char[file_size]; - - size_t bytes_last_read = 0; // # of bytes read in the last fread() - size_t bytes_read = 0; // # of bytes read so far - - fseek(file, 0, SEEK_SET); - - // Keeps reading the file until we cannot read further or the - // pre-determined file size is reached. - do { - bytes_last_read = fread(buffer+bytes_read, 1, file_size-bytes_read, file); - bytes_read += bytes_last_read; - } while (bytes_last_read > 0 && bytes_read < file_size); - - const std::string content(buffer, bytes_read); - delete[] buffer; - - return content; -} - -# ifdef _MSC_VER -# pragma warning(pop) -# endif // _MSC_VER - -static CapturedStream* g_captured_stderr = NULL; -static CapturedStream* g_captured_stdout = NULL; - -// Starts capturing an output stream (stdout/stderr). -void CaptureStream(int fd, const char* stream_name, CapturedStream** stream) { - if (*stream != NULL) { - GTEST_LOG_(FATAL) << "Only one " << stream_name - << " capturer can exist at a time."; - } - *stream = new CapturedStream(fd); -} - -// Stops capturing the output stream and returns the captured string. -std::string GetCapturedStream(CapturedStream** captured_stream) { - const std::string content = (*captured_stream)->GetCapturedString(); - - delete *captured_stream; - *captured_stream = NULL; - - return content; -} - -// Starts capturing stdout. -void CaptureStdout() { - CaptureStream(kStdOutFileno, "stdout", &g_captured_stdout); -} - -// Starts capturing stderr. -void CaptureStderr() { - CaptureStream(kStdErrFileno, "stderr", &g_captured_stderr); -} - -// Stops capturing stdout and returns the captured string. -std::string GetCapturedStdout() { - return GetCapturedStream(&g_captured_stdout); -} - -// Stops capturing stderr and returns the captured string. -std::string GetCapturedStderr() { - return GetCapturedStream(&g_captured_stderr); -} - -#endif // GTEST_HAS_STREAM_REDIRECTION - -#if GTEST_HAS_DEATH_TEST - -// A copy of all command line arguments. Set by InitGoogleTest(). -::std::vector g_argvs; - -static const ::std::vector* g_injected_test_argvs = - NULL; // Owned. - -void SetInjectableArgvs(const ::std::vector* argvs) { - if (g_injected_test_argvs != argvs) - delete g_injected_test_argvs; - g_injected_test_argvs = argvs; -} - -const ::std::vector& GetInjectableArgvs() { - if (g_injected_test_argvs != NULL) { - return *g_injected_test_argvs; - } - return g_argvs; -} -#endif // GTEST_HAS_DEATH_TEST - -#if GTEST_OS_WINDOWS_MOBILE -namespace posix { -void Abort() { - DebugBreak(); - TerminateProcess(GetCurrentProcess(), 1); -} -} // namespace posix -#endif // GTEST_OS_WINDOWS_MOBILE - -// Returns the name of the environment variable corresponding to the -// given flag. For example, FlagToEnvVar("foo") will return -// "GTEST_FOO" in the open-source version. -static std::string FlagToEnvVar(const char* flag) { - const std::string full_flag = - (Message() << GTEST_FLAG_PREFIX_ << flag).GetString(); - - Message env_var; - for (size_t i = 0; i != full_flag.length(); i++) { - env_var << ToUpper(full_flag.c_str()[i]); - } - - return env_var.GetString(); -} - -// Parses 'str' for a 32-bit signed integer. If successful, writes -// the result to *value and returns true; otherwise leaves *value -// unchanged and returns false. -bool ParseInt32(const Message& src_text, const char* str, Int32* value) { - // Parses the environment variable as a decimal integer. - char* end = NULL; - const long long_value = strtol(str, &end, 10); // NOLINT - - // Has strtol() consumed all characters in the string? - if (*end != '\0') { - // No - an invalid character was encountered. - Message msg; - msg << "WARNING: " << src_text - << " is expected to be a 32-bit integer, but actually" - << " has value \"" << str << "\".\n"; - printf("%s", msg.GetString().c_str()); - fflush(stdout); - return false; - } - - // Is the parsed value in the range of an Int32? - const Int32 result = static_cast(long_value); - if (long_value == LONG_MAX || long_value == LONG_MIN || - // The parsed value overflows as a long. (strtol() returns - // LONG_MAX or LONG_MIN when the input overflows.) - result != long_value - // The parsed value overflows as an Int32. - ) { - Message msg; - msg << "WARNING: " << src_text - << " is expected to be a 32-bit integer, but actually" - << " has value " << str << ", which overflows.\n"; - printf("%s", msg.GetString().c_str()); - fflush(stdout); - return false; - } - - *value = result; - return true; -} - -// Reads and returns the Boolean environment variable corresponding to -// the given flag; if it's not set, returns default_value. -// -// The value is considered true iff it's not "0". -bool BoolFromGTestEnv(const char* flag, bool default_value) { - const std::string env_var = FlagToEnvVar(flag); - const char* const string_value = posix::GetEnv(env_var.c_str()); - return string_value == NULL ? - default_value : strcmp(string_value, "0") != 0; -} - -// Reads and returns a 32-bit integer stored in the environment -// variable corresponding to the given flag; if it isn't set or -// doesn't represent a valid 32-bit integer, returns default_value. -Int32 Int32FromGTestEnv(const char* flag, Int32 default_value) { - const std::string env_var = FlagToEnvVar(flag); - const char* const string_value = posix::GetEnv(env_var.c_str()); - if (string_value == NULL) { - // The environment variable is not set. - return default_value; - } - - Int32 result = default_value; - if (!ParseInt32(Message() << "Environment variable " << env_var, - string_value, &result)) { - printf("The default value %s is used.\n", - (Message() << default_value).GetString().c_str()); - fflush(stdout); - return default_value; - } - - return result; -} - -// Reads and returns the string environment variable corresponding to -// the given flag; if it's not set, returns default_value. -const char* StringFromGTestEnv(const char* flag, const char* default_value) { - const std::string env_var = FlagToEnvVar(flag); - const char* const value = posix::GetEnv(env_var.c_str()); - return value == NULL ? default_value : value; -} - -} // namespace internal -} // namespace testing -// Copyright 2007, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. 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. -// -// Author: wan@google.com (Zhanyong Wan) - -// Google Test - The Google C++ Testing Framework -// -// This file implements a universal value printer that can print a -// value of any type T: -// -// void ::testing::internal::UniversalPrinter::Print(value, ostream_ptr); -// -// It uses the << operator when possible, and prints the bytes in the -// object otherwise. A user can override its behavior for a class -// type Foo by defining either operator<<(::std::ostream&, const Foo&) -// or void PrintTo(const Foo&, ::std::ostream*) in the namespace that -// defines Foo. - -#include -#include -#include // NOLINT -#include - -namespace testing { - -namespace { - -using ::std::ostream; - -// Prints a segment of bytes in the given object. -void PrintByteSegmentInObjectTo(const unsigned char* obj_bytes, size_t start, - size_t count, ostream* os) { - char text[5] = ""; - for (size_t i = 0; i != count; i++) { - const size_t j = start + i; - if (i != 0) { - // Organizes the bytes into groups of 2 for easy parsing by - // human. - if ((j % 2) == 0) - *os << ' '; - else - *os << '-'; - } - GTEST_SNPRINTF_(text, sizeof(text), "%02X", obj_bytes[j]); - *os << text; - } -} - -// Prints the bytes in the given value to the given ostream. -void PrintBytesInObjectToImpl(const unsigned char* obj_bytes, size_t count, - ostream* os) { - // Tells the user how big the object is. - *os << count << "-byte object <"; - - const size_t kThreshold = 132; - const size_t kChunkSize = 64; - // If the object size is bigger than kThreshold, we'll have to omit - // some details by printing only the first and the last kChunkSize - // bytes. - // TODO(wan): let the user control the threshold using a flag. - if (count < kThreshold) { - PrintByteSegmentInObjectTo(obj_bytes, 0, count, os); - } else { - PrintByteSegmentInObjectTo(obj_bytes, 0, kChunkSize, os); - *os << " ... "; - // Rounds up to 2-byte boundary. - const size_t resume_pos = (count - kChunkSize + 1)/2*2; - PrintByteSegmentInObjectTo(obj_bytes, resume_pos, count - resume_pos, os); - } - *os << ">"; -} - -} // namespace - -namespace internal2 { - -// Delegates to PrintBytesInObjectToImpl() to print the bytes in the -// given object. The delegation simplifies the implementation, which -// uses the << operator and thus is easier done outside of the -// ::testing::internal namespace, which contains a << operator that -// sometimes conflicts with the one in STL. -void PrintBytesInObjectTo(const unsigned char* obj_bytes, size_t count, - ostream* os) { - PrintBytesInObjectToImpl(obj_bytes, count, os); -} - -} // namespace internal2 - -namespace internal { - -// Depending on the value of a char (or wchar_t), we print it in one -// of three formats: -// - as is if it's a printable ASCII (e.g. 'a', '2', ' '), -// - as a hexidecimal escape sequence (e.g. '\x7F'), or -// - as a special escape sequence (e.g. '\r', '\n'). -enum CharFormat { - kAsIs, - kHexEscape, - kSpecialEscape -}; - -// Returns true if c is a printable ASCII character. We test the -// value of c directly instead of calling isprint(), which is buggy on -// Windows Mobile. -inline bool IsPrintableAscii(wchar_t c) { - return 0x20 <= c && c <= 0x7E; -} - -// Prints a wide or narrow char c as a character literal without the -// quotes, escaping it when necessary; returns how c was formatted. -// The template argument UnsignedChar is the unsigned version of Char, -// which is the type of c. -template -static CharFormat PrintAsCharLiteralTo(Char c, ostream* os) { - switch (static_cast(c)) { - case L'\0': - *os << "\\0"; - break; - case L'\'': - *os << "\\'"; - break; - case L'\\': - *os << "\\\\"; - break; - case L'\a': - *os << "\\a"; - break; - case L'\b': - *os << "\\b"; - break; - case L'\f': - *os << "\\f"; - break; - case L'\n': - *os << "\\n"; - break; - case L'\r': - *os << "\\r"; - break; - case L'\t': - *os << "\\t"; - break; - case L'\v': - *os << "\\v"; - break; - default: - if (IsPrintableAscii(c)) { - *os << static_cast(c); - return kAsIs; - } else { - *os << "\\x" + String::FormatHexInt(static_cast(c)); - return kHexEscape; - } - } - return kSpecialEscape; -} - -// Prints a wchar_t c as if it's part of a string literal, escaping it when -// necessary; returns how c was formatted. -static CharFormat PrintAsStringLiteralTo(wchar_t c, ostream* os) { - switch (c) { - case L'\'': - *os << "'"; - return kAsIs; - case L'"': - *os << "\\\""; - return kSpecialEscape; - default: - return PrintAsCharLiteralTo(c, os); - } -} - -// Prints a char c as if it's part of a string literal, escaping it when -// necessary; returns how c was formatted. -static CharFormat PrintAsStringLiteralTo(char c, ostream* os) { - return PrintAsStringLiteralTo( - static_cast(static_cast(c)), os); -} - -// Prints a wide or narrow character c and its code. '\0' is printed -// as "'\\0'", other unprintable characters are also properly escaped -// using the standard C++ escape sequence. The template argument -// UnsignedChar is the unsigned version of Char, which is the type of c. -template -void PrintCharAndCodeTo(Char c, ostream* os) { - // First, print c as a literal in the most readable form we can find. - *os << ((sizeof(c) > 1) ? "L'" : "'"); - const CharFormat format = PrintAsCharLiteralTo(c, os); - *os << "'"; - - // To aid user debugging, we also print c's code in decimal, unless - // it's 0 (in which case c was printed as '\\0', making the code - // obvious). - if (c == 0) - return; - *os << " (" << static_cast(c); - - // For more convenience, we print c's code again in hexidecimal, - // unless c was already printed in the form '\x##' or the code is in - // [1, 9]. - if (format == kHexEscape || (1 <= c && c <= 9)) { - // Do nothing. - } else { - *os << ", 0x" << String::FormatHexInt(static_cast(c)); - } - *os << ")"; -} - -void PrintTo(unsigned char c, ::std::ostream* os) { - PrintCharAndCodeTo(c, os); -} -void PrintTo(signed char c, ::std::ostream* os) { - PrintCharAndCodeTo(c, os); -} - -// Prints a wchar_t as a symbol if it is printable or as its internal -// code otherwise and also as its code. L'\0' is printed as "L'\\0'". -void PrintTo(wchar_t wc, ostream* os) { - PrintCharAndCodeTo(wc, os); -} - -// Prints the given array of characters to the ostream. CharType must be either -// char or wchar_t. -// The array starts at begin, the length is len, it may include '\0' characters -// and may not be NUL-terminated. -template -static void PrintCharsAsStringTo( - const CharType* begin, size_t len, ostream* os) { - const char* const kQuoteBegin = sizeof(CharType) == 1 ? "\"" : "L\""; - *os << kQuoteBegin; - bool is_previous_hex = false; - for (size_t index = 0; index < len; ++index) { - const CharType cur = begin[index]; - if (is_previous_hex && IsXDigit(cur)) { - // Previous character is of '\x..' form and this character can be - // interpreted as another hexadecimal digit in its number. Break string to - // disambiguate. - *os << "\" " << kQuoteBegin; - } - is_previous_hex = PrintAsStringLiteralTo(cur, os) == kHexEscape; - } - *os << "\""; -} - -// Prints a (const) char/wchar_t array of 'len' elements, starting at address -// 'begin'. CharType must be either char or wchar_t. -template -static void UniversalPrintCharArray( - const CharType* begin, size_t len, ostream* os) { - // The code - // const char kFoo[] = "foo"; - // generates an array of 4, not 3, elements, with the last one being '\0'. - // - // Therefore when printing a char array, we don't print the last element if - // it's '\0', such that the output matches the string literal as it's - // written in the source code. - if (len > 0 && begin[len - 1] == '\0') { - PrintCharsAsStringTo(begin, len - 1, os); - return; - } - - // If, however, the last element in the array is not '\0', e.g. - // const char kFoo[] = { 'f', 'o', 'o' }; - // we must print the entire array. We also print a message to indicate - // that the array is not NUL-terminated. - PrintCharsAsStringTo(begin, len, os); - *os << " (no terminating NUL)"; -} - -// Prints a (const) char array of 'len' elements, starting at address 'begin'. -void UniversalPrintArray(const char* begin, size_t len, ostream* os) { - UniversalPrintCharArray(begin, len, os); -} - -// Prints a (const) wchar_t array of 'len' elements, starting at address -// 'begin'. -void UniversalPrintArray(const wchar_t* begin, size_t len, ostream* os) { - UniversalPrintCharArray(begin, len, os); -} - -// Prints the given C string to the ostream. -void PrintTo(const char* s, ostream* os) { - if (s == NULL) { - *os << "NULL"; - } else { - *os << ImplicitCast_(s) << " pointing to "; - PrintCharsAsStringTo(s, strlen(s), os); - } -} - -// MSVC compiler can be configured to define whar_t as a typedef -// of unsigned short. Defining an overload for const wchar_t* in that case -// would cause pointers to unsigned shorts be printed as wide strings, -// possibly accessing more memory than intended and causing invalid -// memory accesses. MSVC defines _NATIVE_WCHAR_T_DEFINED symbol when -// wchar_t is implemented as a native type. -#if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) -// Prints the given wide C string to the ostream. -void PrintTo(const wchar_t* s, ostream* os) { - if (s == NULL) { - *os << "NULL"; - } else { - *os << ImplicitCast_(s) << " pointing to "; - PrintCharsAsStringTo(s, wcslen(s), os); - } -} -#endif // wchar_t is native - -// Prints a ::string object. -#if GTEST_HAS_GLOBAL_STRING -void PrintStringTo(const ::string& s, ostream* os) { - PrintCharsAsStringTo(s.data(), s.size(), os); -} -#endif // GTEST_HAS_GLOBAL_STRING - -void PrintStringTo(const ::std::string& s, ostream* os) { - PrintCharsAsStringTo(s.data(), s.size(), os); -} - -// Prints a ::wstring object. -#if GTEST_HAS_GLOBAL_WSTRING -void PrintWideStringTo(const ::wstring& s, ostream* os) { - PrintCharsAsStringTo(s.data(), s.size(), os); -} -#endif // GTEST_HAS_GLOBAL_WSTRING - -#if GTEST_HAS_STD_WSTRING -void PrintWideStringTo(const ::std::wstring& s, ostream* os) { - PrintCharsAsStringTo(s.data(), s.size(), os); -} -#endif // GTEST_HAS_STD_WSTRING - -} // namespace internal - -} // namespace testing -// Copyright 2008, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. 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. -// -// Author: mheule@google.com (Markus Heule) -// -// The Google C++ Testing Framework (Google Test) - - -// Indicates that this translation unit is part of Google Test's -// implementation. It must come before gtest-internal-inl.h is -// included, or there will be a compiler error. This trick is to -// prevent a user from accidentally including gtest-internal-inl.h in -// his code. -#define GTEST_IMPLEMENTATION_ 1 -#undef GTEST_IMPLEMENTATION_ - -namespace testing { - -using internal::GetUnitTestImpl; - -// Gets the summary of the failure message by omitting the stack trace -// in it. -std::string TestPartResult::ExtractSummary(const char* message) { - const char* const stack_trace = strstr(message, internal::kStackTraceMarker); - return stack_trace == NULL ? message : - std::string(message, stack_trace); -} - -// Prints a TestPartResult object. -std::ostream& operator<<(std::ostream& os, const TestPartResult& result) { - return os - << result.file_name() << ":" << result.line_number() << ": " - << (result.type() == TestPartResult::kSuccess ? "Success" : - result.type() == TestPartResult::kFatalFailure ? "Fatal failure" : - "Non-fatal failure") << ":\n" - << result.message() << std::endl; -} - -// Appends a TestPartResult to the array. -void TestPartResultArray::Append(const TestPartResult& result) { - array_.push_back(result); -} - -// Returns the TestPartResult at the given index (0-based). -const TestPartResult& TestPartResultArray::GetTestPartResult(int index) const { - if (index < 0 || index >= size()) { - printf("\nInvalid index (%d) into TestPartResultArray.\n", index); - internal::posix::Abort(); - } - - return array_[index]; -} - -// Returns the number of TestPartResult objects in the array. -int TestPartResultArray::size() const { - return static_cast(array_.size()); -} - -namespace internal { - -HasNewFatalFailureHelper::HasNewFatalFailureHelper() - : has_new_fatal_failure_(false), - original_reporter_(GetUnitTestImpl()-> - GetTestPartResultReporterForCurrentThread()) { - GetUnitTestImpl()->SetTestPartResultReporterForCurrentThread(this); -} - -HasNewFatalFailureHelper::~HasNewFatalFailureHelper() { - GetUnitTestImpl()->SetTestPartResultReporterForCurrentThread( - original_reporter_); -} - -void HasNewFatalFailureHelper::ReportTestPartResult( - const TestPartResult& result) { - if (result.fatally_failed()) - has_new_fatal_failure_ = true; - original_reporter_->ReportTestPartResult(result); -} - -} // namespace internal - -} // namespace testing -// Copyright 2008 Google Inc. -// All Rights Reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. 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. -// -// Author: wan@google.com (Zhanyong Wan) - - -namespace testing { -namespace internal { - -#if GTEST_HAS_TYPED_TEST_P - -// Skips to the first non-space char in str. Returns an empty string if str -// contains only whitespace characters. -static const char* SkipSpaces(const char* str) { - while (IsSpace(*str)) - str++; - return str; -} - -// Verifies that registered_tests match the test names in -// defined_test_names_; returns registered_tests if successful, or -// aborts the program otherwise. -const char* TypedTestCasePState::VerifyRegisteredTestNames( - const char* file, int line, const char* registered_tests) { - typedef ::std::set::const_iterator DefinedTestIter; - registered_ = true; - - // Skip initial whitespace in registered_tests since some - // preprocessors prefix stringizied literals with whitespace. - registered_tests = SkipSpaces(registered_tests); - - Message errors; - ::std::set tests; - for (const char* names = registered_tests; names != NULL; - names = SkipComma(names)) { - const std::string name = GetPrefixUntilComma(names); - if (tests.count(name) != 0) { - errors << "Test " << name << " is listed more than once.\n"; - continue; - } - - bool found = false; - for (DefinedTestIter it = defined_test_names_.begin(); - it != defined_test_names_.end(); - ++it) { - if (name == *it) { - found = true; - break; - } - } - - if (found) { - tests.insert(name); - } else { - errors << "No test named " << name - << " can be found in this test case.\n"; - } - } - - for (DefinedTestIter it = defined_test_names_.begin(); - it != defined_test_names_.end(); - ++it) { - if (tests.count(*it) == 0) { - errors << "You forgot to list test " << *it << ".\n"; - } - } - - const std::string& errors_str = errors.GetString(); - if (errors_str != "") { - fprintf(stderr, "%s %s", FormatFileLocation(file, line).c_str(), - errors_str.c_str()); - fflush(stderr); - posix::Abort(); - } - - return registered_tests; -} - -#endif // GTEST_HAS_TYPED_TEST_P - -} // namespace internal -} // namespace testing diff --git a/lib/kokkos/tpls/gtest/gtest/gtest-test-part.h b/lib/kokkos/tpls/gtest/gtest/gtest-test-part.h deleted file mode 120000 index 48d39090f1..0000000000 --- a/lib/kokkos/tpls/gtest/gtest/gtest-test-part.h +++ /dev/null @@ -1 +0,0 @@ -gtest.h \ No newline at end of file diff --git a/lib/kokkos/tpls/gtest/gtest/gtest.h b/lib/kokkos/tpls/gtest/gtest/gtest.h deleted file mode 100644 index c74d098fa9..0000000000 --- a/lib/kokkos/tpls/gtest/gtest/gtest.h +++ /dev/null @@ -1,20065 +0,0 @@ -// Copyright 2005, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. 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. -// -// Author: wan@google.com (Zhanyong Wan) -// -// The Google C++ Testing Framework (Google Test) -// -// This header file defines the public API for Google Test. It should be -// included by any test program that uses Google Test. -// -// IMPORTANT NOTE: Due to limitation of the C++ language, we have to -// leave some internal implementation details in this header file. -// They are clearly marked by comments like this: -// -// // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -// -// Such code is NOT meant to be used by a user directly, and is subject -// to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user -// program! -// -// Acknowledgment: Google Test borrowed the idea of automatic test -// registration from Barthelemy Dagenais' (barthelemy@prologique.com) -// easyUnit framework. - -#ifdef __GNUC__ -#pragma GCC system_header -#endif - -#ifndef GTEST_INCLUDE_GTEST_GTEST_H_ -#define GTEST_INCLUDE_GTEST_GTEST_H_ - -#include -#include -#include - -// Copyright 2005, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. 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. -// -// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee) -// -// The Google C++ Testing Framework (Google Test) -// -// This header file declares functions and macros used internally by -// Google Test. They are subject to change without notice. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_ - -// Copyright 2005, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. 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. -// -// Authors: wan@google.com (Zhanyong Wan) -// -// Low-level types and utilities for porting Google Test to various -// platforms. They are subject to change without notice. DO NOT USE -// THEM IN USER CODE. -// -// This file is fundamental to Google Test. All other Google Test source -// files are expected to #include this. Therefore, it cannot #include -// any other Google Test header. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_ - -// The user can define the following macros in the build script to -// control Google Test's behavior. If the user doesn't define a macro -// in this list, Google Test will define it. -// -// GTEST_HAS_CLONE - Define it to 1/0 to indicate that clone(2) -// is/isn't available. -// GTEST_HAS_EXCEPTIONS - Define it to 1/0 to indicate that exceptions -// are enabled. -// GTEST_HAS_GLOBAL_STRING - Define it to 1/0 to indicate that ::string -// is/isn't available (some systems define -// ::string, which is different to std::string). -// GTEST_HAS_GLOBAL_WSTRING - Define it to 1/0 to indicate that ::string -// is/isn't available (some systems define -// ::wstring, which is different to std::wstring). -// GTEST_HAS_POSIX_RE - Define it to 1/0 to indicate that POSIX regular -// expressions are/aren't available. -// GTEST_HAS_PTHREAD - Define it to 1/0 to indicate that -// is/isn't available. -// GTEST_HAS_RTTI - Define it to 1/0 to indicate that RTTI is/isn't -// enabled. -// GTEST_HAS_STD_WSTRING - Define it to 1/0 to indicate that -// std::wstring does/doesn't work (Google Test can -// be used where std::wstring is unavailable). -// GTEST_HAS_TR1_TUPLE - Define it to 1/0 to indicate tr1::tuple -// is/isn't available. -// GTEST_HAS_SEH - Define it to 1/0 to indicate whether the -// compiler supports Microsoft's "Structured -// Exception Handling". -// GTEST_HAS_STREAM_REDIRECTION -// - Define it to 1/0 to indicate whether the -// platform supports I/O stream redirection using -// dup() and dup2(). -// GTEST_USE_OWN_TR1_TUPLE - Define it to 1/0 to indicate whether Google -// Test's own tr1 tuple implementation should be -// used. Unused when the user sets -// GTEST_HAS_TR1_TUPLE to 0. -// GTEST_LANG_CXX11 - Define it to 1/0 to indicate that Google Test -// is building in C++11/C++98 mode. -// GTEST_LINKED_AS_SHARED_LIBRARY -// - Define to 1 when compiling tests that use -// Google Test as a shared library (known as -// DLL on Windows). -// GTEST_CREATE_SHARED_LIBRARY -// - Define to 1 when compiling Google Test itself -// as a shared library. - -// This header defines the following utilities: -// -// Macros indicating the current platform (defined to 1 if compiled on -// the given platform; otherwise undefined): -// GTEST_OS_AIX - IBM AIX -// GTEST_OS_CYGWIN - Cygwin -// GTEST_OS_HPUX - HP-UX -// GTEST_OS_LINUX - Linux -// GTEST_OS_LINUX_ANDROID - Google Android -// GTEST_OS_MAC - Mac OS X -// GTEST_OS_IOS - iOS -// GTEST_OS_IOS_SIMULATOR - iOS simulator -// GTEST_OS_NACL - Google Native Client (NaCl) -// GTEST_OS_OPENBSD - OpenBSD -// GTEST_OS_QNX - QNX -// GTEST_OS_SOLARIS - Sun Solaris -// GTEST_OS_SYMBIAN - Symbian -// GTEST_OS_WINDOWS - Windows (Desktop, MinGW, or Mobile) -// GTEST_OS_WINDOWS_DESKTOP - Windows Desktop -// GTEST_OS_WINDOWS_MINGW - MinGW -// GTEST_OS_WINDOWS_MOBILE - Windows Mobile -// GTEST_OS_ZOS - z/OS -// -// Among the platforms, Cygwin, Linux, Max OS X, and Windows have the -// most stable support. Since core members of the Google Test project -// don't have access to other platforms, support for them may be less -// stable. If you notice any problems on your platform, please notify -// googletestframework@googlegroups.com (patches for fixing them are -// even more welcome!). -// -// Note that it is possible that none of the GTEST_OS_* macros are defined. -// -// Macros indicating available Google Test features (defined to 1 if -// the corresponding feature is supported; otherwise undefined): -// GTEST_HAS_COMBINE - the Combine() function (for value-parameterized -// tests) -// GTEST_HAS_DEATH_TEST - death tests -// GTEST_HAS_PARAM_TEST - value-parameterized tests -// GTEST_HAS_TYPED_TEST - typed tests -// GTEST_HAS_TYPED_TEST_P - type-parameterized tests -// GTEST_USES_POSIX_RE - enhanced POSIX regex is used. Do not confuse with -// GTEST_HAS_POSIX_RE (see above) which users can -// define themselves. -// GTEST_USES_SIMPLE_RE - our own simple regex is used; -// the above two are mutually exclusive. -// GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ(). -// -// Macros for basic C++ coding: -// GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning. -// GTEST_ATTRIBUTE_UNUSED_ - declares that a class' instances or a -// variable don't have to be used. -// GTEST_DISALLOW_ASSIGN_ - disables operator=. -// GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=. -// GTEST_MUST_USE_RESULT_ - declares that a function's result must be used. -// -// Synchronization: -// Mutex, MutexLock, ThreadLocal, GetThreadCount() -// - synchronization primitives. -// GTEST_IS_THREADSAFE - defined to 1 to indicate that the above -// synchronization primitives have real implementations -// and Google Test is thread-safe; or 0 otherwise. -// -// Template meta programming: -// is_pointer - as in TR1; needed on Symbian and IBM XL C/C++ only. -// IteratorTraits - partial implementation of std::iterator_traits, which -// is not available in libCstd when compiled with Sun C++. -// -// Smart pointers: -// scoped_ptr - as in TR2. -// -// Regular expressions: -// RE - a simple regular expression class using the POSIX -// Extended Regular Expression syntax on UNIX-like -// platforms, or a reduced regular exception syntax on -// other platforms, including Windows. -// -// Logging: -// GTEST_LOG_() - logs messages at the specified severity level. -// LogToStderr() - directs all log messages to stderr. -// FlushInfoLog() - flushes informational log messages. -// -// Stdout and stderr capturing: -// CaptureStdout() - starts capturing stdout. -// GetCapturedStdout() - stops capturing stdout and returns the captured -// string. -// CaptureStderr() - starts capturing stderr. -// GetCapturedStderr() - stops capturing stderr and returns the captured -// string. -// -// Integer types: -// TypeWithSize - maps an integer to a int type. -// Int32, UInt32, Int64, UInt64, TimeInMillis -// - integers of known sizes. -// BiggestInt - the biggest signed integer type. -// -// Command-line utilities: -// GTEST_FLAG() - references a flag. -// GTEST_DECLARE_*() - declares a flag. -// GTEST_DEFINE_*() - defines a flag. -// GetInjectableArgvs() - returns the command line as a vector of strings. -// -// Environment variable utilities: -// GetEnv() - gets the value of an environment variable. -// BoolFromGTestEnv() - parses a bool environment variable. -// Int32FromGTestEnv() - parses an Int32 environment variable. -// StringFromGTestEnv() - parses a string environment variable. - -#include // for isspace, etc -#include // for ptrdiff_t -#include -#include -#include -#ifndef _WIN32_WCE -# include -# include -#endif // !_WIN32_WCE - -#if defined __APPLE__ -# include -# include -#endif - -#include // NOLINT -#include // NOLINT -#include // NOLINT - -#define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com" -#define GTEST_FLAG_PREFIX_ "gtest_" -#define GTEST_FLAG_PREFIX_DASH_ "gtest-" -#define GTEST_FLAG_PREFIX_UPPER_ "GTEST_" -#define GTEST_NAME_ "Google Test" -#define GTEST_PROJECT_URL_ "http://code.google.com/p/googletest/" - -// Determines the version of gcc that is used to compile this. -#ifdef __GNUC__ -// 40302 means version 4.3.2. -# define GTEST_GCC_VER_ \ - (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__) -#endif // __GNUC__ - -// Determines the platform on which Google Test is compiled. -#ifdef __CYGWIN__ -# define GTEST_OS_CYGWIN 1 -#elif defined __SYMBIAN32__ -# define GTEST_OS_SYMBIAN 1 -#elif defined _WIN32 -# define GTEST_OS_WINDOWS 1 -# ifdef _WIN32_WCE -# define GTEST_OS_WINDOWS_MOBILE 1 -# elif defined(__MINGW__) || defined(__MINGW32__) -# define GTEST_OS_WINDOWS_MINGW 1 -# else -# define GTEST_OS_WINDOWS_DESKTOP 1 -# endif // _WIN32_WCE -#elif defined __APPLE__ -# define GTEST_OS_MAC 1 -# if TARGET_OS_IPHONE -# define GTEST_OS_IOS 1 -# if TARGET_IPHONE_SIMULATOR -# define GTEST_OS_IOS_SIMULATOR 1 -# endif -# endif -#elif defined __linux__ -# define GTEST_OS_LINUX 1 -# if defined __ANDROID__ -# define GTEST_OS_LINUX_ANDROID 1 -# endif -#elif defined __MVS__ -# define GTEST_OS_ZOS 1 -#elif defined(__sun) && defined(__SVR4) -# define GTEST_OS_SOLARIS 1 -#elif defined(_AIX) -# define GTEST_OS_AIX 1 -#elif defined(__hpux) -# define GTEST_OS_HPUX 1 -#elif defined __native_client__ -# define GTEST_OS_NACL 1 -#elif defined __OpenBSD__ -# define GTEST_OS_OPENBSD 1 -#elif defined __QNX__ -# define GTEST_OS_QNX 1 -#endif // __CYGWIN__ - -#ifndef GTEST_LANG_CXX11 -// gcc and clang define __GXX_EXPERIMENTAL_CXX0X__ when -// -std={c,gnu}++{0x,11} is passed. The C++11 standard specifies a -// value for __cplusplus, and recent versions of clang, gcc, and -// probably other compilers set that too in C++11 mode. -# if __GXX_EXPERIMENTAL_CXX0X__ || __cplusplus >= 201103L -// Compiling in at least C++11 mode. -# define GTEST_LANG_CXX11 1 -# else -# define GTEST_LANG_CXX11 0 -# endif -#endif - -// Brings in definitions for functions used in the testing::internal::posix -// namespace (read, write, close, chdir, isatty, stat). We do not currently -// use them on Windows Mobile. -#if !GTEST_OS_WINDOWS -// This assumes that non-Windows OSes provide unistd.h. For OSes where this -// is not the case, we need to include headers that provide the functions -// mentioned above. -# include -# include -#elif !GTEST_OS_WINDOWS_MOBILE -# include -# include -#endif - -#if GTEST_OS_LINUX_ANDROID -// Used to define __ANDROID_API__ matching the target NDK API level. -# include // NOLINT -#endif - -// Defines this to true iff Google Test can use POSIX regular expressions. -#ifndef GTEST_HAS_POSIX_RE -# if GTEST_OS_LINUX_ANDROID -// On Android, is only available starting with Gingerbread. -# define GTEST_HAS_POSIX_RE (__ANDROID_API__ >= 9) -# else -# define GTEST_HAS_POSIX_RE (!GTEST_OS_WINDOWS) -# endif -#endif - -#if GTEST_HAS_POSIX_RE - -// On some platforms, needs someone to define size_t, and -// won't compile otherwise. We can #include it here as we already -// included , which is guaranteed to define size_t through -// . -# include // NOLINT - -# define GTEST_USES_POSIX_RE 1 - -#elif GTEST_OS_WINDOWS - -// is not available on Windows. Use our own simple regex -// implementation instead. -# define GTEST_USES_SIMPLE_RE 1 - -#else - -// may not be available on this platform. Use our own -// simple regex implementation instead. -# define GTEST_USES_SIMPLE_RE 1 - -#endif // GTEST_HAS_POSIX_RE - -#ifndef GTEST_HAS_EXCEPTIONS -// The user didn't tell us whether exceptions are enabled, so we need -// to figure it out. -# if defined(_MSC_VER) || defined(__BORLANDC__) -// MSVC's and C++Builder's implementations of the STL use the _HAS_EXCEPTIONS -// macro to enable exceptions, so we'll do the same. -// Assumes that exceptions are enabled by default. -# ifndef _HAS_EXCEPTIONS -# define _HAS_EXCEPTIONS 1 -# endif // _HAS_EXCEPTIONS -# define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS -# elif defined(__GNUC__) && __EXCEPTIONS -// gcc defines __EXCEPTIONS to 1 iff exceptions are enabled. -# define GTEST_HAS_EXCEPTIONS 1 -# elif defined(__SUNPRO_CC) -// Sun Pro CC supports exceptions. However, there is no compile-time way of -// detecting whether they are enabled or not. Therefore, we assume that -// they are enabled unless the user tells us otherwise. -# define GTEST_HAS_EXCEPTIONS 1 -# elif defined(__IBMCPP__) && __EXCEPTIONS -// xlC defines __EXCEPTIONS to 1 iff exceptions are enabled. -# define GTEST_HAS_EXCEPTIONS 1 -# elif defined(__HP_aCC) -// Exception handling is in effect by default in HP aCC compiler. It has to -// be turned of by +noeh compiler option if desired. -# define GTEST_HAS_EXCEPTIONS 1 -# else -// For other compilers, we assume exceptions are disabled to be -// conservative. -# define GTEST_HAS_EXCEPTIONS 0 -# endif // defined(_MSC_VER) || defined(__BORLANDC__) -#endif // GTEST_HAS_EXCEPTIONS - -#if !defined(GTEST_HAS_STD_STRING) -// Even though we don't use this macro any longer, we keep it in case -// some clients still depend on it. -# define GTEST_HAS_STD_STRING 1 -#elif !GTEST_HAS_STD_STRING -// The user told us that ::std::string isn't available. -# error "Google Test cannot be used where ::std::string isn't available." -#endif // !defined(GTEST_HAS_STD_STRING) - -#ifndef GTEST_HAS_GLOBAL_STRING -// The user didn't tell us whether ::string is available, so we need -// to figure it out. - -# define GTEST_HAS_GLOBAL_STRING 0 - -#endif // GTEST_HAS_GLOBAL_STRING - -#ifndef GTEST_HAS_STD_WSTRING -// The user didn't tell us whether ::std::wstring is available, so we need -// to figure it out. -// TODO(wan@google.com): uses autoconf to detect whether ::std::wstring -// is available. - -// Cygwin 1.7 and below doesn't support ::std::wstring. -// Solaris' libc++ doesn't support it either. Android has -// no support for it at least as recent as Froyo (2.2). -# define GTEST_HAS_STD_WSTRING \ - (!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS)) - -#endif // GTEST_HAS_STD_WSTRING - -#ifndef GTEST_HAS_GLOBAL_WSTRING -// The user didn't tell us whether ::wstring is available, so we need -// to figure it out. -# define GTEST_HAS_GLOBAL_WSTRING \ - (GTEST_HAS_STD_WSTRING && GTEST_HAS_GLOBAL_STRING) -#endif // GTEST_HAS_GLOBAL_WSTRING - -// Determines whether RTTI is available. -#ifndef GTEST_HAS_RTTI -// The user didn't tell us whether RTTI is enabled, so we need to -// figure it out. - -# ifdef _MSC_VER - -# ifdef _CPPRTTI // MSVC defines this macro iff RTTI is enabled. -# define GTEST_HAS_RTTI 1 -# else -# define GTEST_HAS_RTTI 0 -# endif - -// Starting with version 4.3.2, gcc defines __GXX_RTTI iff RTTI is enabled. -# elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40302) - -# ifdef __GXX_RTTI -// When building against STLport with the Android NDK and with -// -frtti -fno-exceptions, the build fails at link time with undefined -// references to __cxa_bad_typeid. Note sure if STL or toolchain bug, -// so disable RTTI when detected. -# if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR) && \ - !defined(__EXCEPTIONS) -# define GTEST_HAS_RTTI 0 -# else -# define GTEST_HAS_RTTI 1 -# endif // GTEST_OS_LINUX_ANDROID && __STLPORT_MAJOR && !__EXCEPTIONS -# else -# define GTEST_HAS_RTTI 0 -# endif // __GXX_RTTI - -// Clang defines __GXX_RTTI starting with version 3.0, but its manual recommends -// using has_feature instead. has_feature(cxx_rtti) is supported since 2.7, the -// first version with C++ support. -# elif defined(__clang__) - -# define GTEST_HAS_RTTI __has_feature(cxx_rtti) - -// Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if -// both the typeid and dynamic_cast features are present. -# elif defined(__IBMCPP__) && (__IBMCPP__ >= 900) - -# ifdef __RTTI_ALL__ -# define GTEST_HAS_RTTI 1 -# else -# define GTEST_HAS_RTTI 0 -# endif - -# else - -// For all other compilers, we assume RTTI is enabled. -# define GTEST_HAS_RTTI 1 - -# endif // _MSC_VER - -#endif // GTEST_HAS_RTTI - -// It's this header's responsibility to #include when RTTI -// is enabled. -#if GTEST_HAS_RTTI -# include -#endif - -// Determines whether Google Test can use the pthreads library. -#ifndef GTEST_HAS_PTHREAD -// The user didn't tell us explicitly, so we assume pthreads support is -// available on Linux and Mac. -// -// To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0 -// to your compiler flags. -# define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX \ - || GTEST_OS_QNX) -#endif // GTEST_HAS_PTHREAD - -#if GTEST_HAS_PTHREAD -// gtest-port.h guarantees to #include when GTEST_HAS_PTHREAD is -// true. -# include // NOLINT - -// For timespec and nanosleep, used below. -# include // NOLINT -#endif - -// Determines whether Google Test can use tr1/tuple. You can define -// this macro to 0 to prevent Google Test from using tuple (any -// feature depending on tuple with be disabled in this mode). -#ifndef GTEST_HAS_TR1_TUPLE -# if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR) -// STLport, provided with the Android NDK, has neither or . -# define GTEST_HAS_TR1_TUPLE 0 -# else -// The user didn't tell us not to do it, so we assume it's OK. -# define GTEST_HAS_TR1_TUPLE 1 -# endif -#endif // GTEST_HAS_TR1_TUPLE - -// Determines whether Google Test's own tr1 tuple implementation -// should be used. -#ifndef GTEST_USE_OWN_TR1_TUPLE -// The user didn't tell us, so we need to figure it out. - -// We use our own TR1 tuple if we aren't sure the user has an -// implementation of it already. At this time, libstdc++ 4.0.0+ and -// MSVC 2010 are the only mainstream standard libraries that come -// with a TR1 tuple implementation. NVIDIA's CUDA NVCC compiler -// pretends to be GCC by defining __GNUC__ and friends, but cannot -// compile GCC's tuple implementation. MSVC 2008 (9.0) provides TR1 -// tuple in a 323 MB Feature Pack download, which we cannot assume the -// user has. QNX's QCC compiler is a modified GCC but it doesn't -// support TR1 tuple. libc++ only provides std::tuple, in C++11 mode, -// and it can be used with some compilers that define __GNUC__. -# if (defined(__GNUC__) && !defined(__CUDACC__) && (GTEST_GCC_VER_ >= 40000) \ - && !GTEST_OS_QNX && !defined(_LIBCPP_VERSION)) || _MSC_VER >= 1600 -# define GTEST_ENV_HAS_TR1_TUPLE_ 1 -# endif - -// C++11 specifies that provides std::tuple. Use that if gtest is used -// in C++11 mode and libstdc++ isn't very old (binaries targeting OS X 10.6 -// can build with clang but need to use gcc4.2's libstdc++). -# if GTEST_LANG_CXX11 && (!defined(__GLIBCXX__) || __GLIBCXX__ > 20110325) -# define GTEST_ENV_HAS_STD_TUPLE_ 1 -# endif - -# if GTEST_ENV_HAS_TR1_TUPLE_ || GTEST_ENV_HAS_STD_TUPLE_ -# define GTEST_USE_OWN_TR1_TUPLE 0 -# else -# define GTEST_USE_OWN_TR1_TUPLE 1 -# endif - -#endif // GTEST_USE_OWN_TR1_TUPLE - -// To avoid conditional compilation everywhere, we make it -// gtest-port.h's responsibility to #include the header implementing -// tr1/tuple. -#if GTEST_HAS_TR1_TUPLE - -# if GTEST_USE_OWN_TR1_TUPLE -// This file was GENERATED by command: -// pump.py gtest-tuple.h.pump -// DO NOT EDIT BY HAND!!! - -// Copyright 2009 Google Inc. -// All Rights Reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. 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. -// -// Author: wan@google.com (Zhanyong Wan) - -// Implements a subset of TR1 tuple needed by Google Test and Google Mock. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_ - -#include // For ::std::pair. - -// The compiler used in Symbian has a bug that prevents us from declaring the -// tuple template as a friend (it complains that tuple is redefined). This -// hack bypasses the bug by declaring the members that should otherwise be -// private as public. -// Sun Studio versions < 12 also have the above bug. -#if defined(__SYMBIAN32__) || (defined(__SUNPRO_CC) && __SUNPRO_CC < 0x590) -# define GTEST_DECLARE_TUPLE_AS_FRIEND_ public: -#else -# define GTEST_DECLARE_TUPLE_AS_FRIEND_ \ - template friend class tuple; \ - private: -#endif - -// GTEST_n_TUPLE_(T) is the type of an n-tuple. -#define GTEST_0_TUPLE_(T) tuple<> -#define GTEST_1_TUPLE_(T) tuple -#define GTEST_2_TUPLE_(T) tuple -#define GTEST_3_TUPLE_(T) tuple -#define GTEST_4_TUPLE_(T) tuple -#define GTEST_5_TUPLE_(T) tuple -#define GTEST_6_TUPLE_(T) tuple -#define GTEST_7_TUPLE_(T) tuple -#define GTEST_8_TUPLE_(T) tuple -#define GTEST_9_TUPLE_(T) tuple -#define GTEST_10_TUPLE_(T) tuple - -// GTEST_n_TYPENAMES_(T) declares a list of n typenames. -#define GTEST_0_TYPENAMES_(T) -#define GTEST_1_TYPENAMES_(T) typename T##0 -#define GTEST_2_TYPENAMES_(T) typename T##0, typename T##1 -#define GTEST_3_TYPENAMES_(T) typename T##0, typename T##1, typename T##2 -#define GTEST_4_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ - typename T##3 -#define GTEST_5_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ - typename T##3, typename T##4 -#define GTEST_6_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ - typename T##3, typename T##4, typename T##5 -#define GTEST_7_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ - typename T##3, typename T##4, typename T##5, typename T##6 -#define GTEST_8_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ - typename T##3, typename T##4, typename T##5, typename T##6, typename T##7 -#define GTEST_9_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ - typename T##3, typename T##4, typename T##5, typename T##6, \ - typename T##7, typename T##8 -#define GTEST_10_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ - typename T##3, typename T##4, typename T##5, typename T##6, \ - typename T##7, typename T##8, typename T##9 - -// In theory, defining stuff in the ::std namespace is undefined -// behavior. We can do this as we are playing the role of a standard -// library vendor. -namespace std { -namespace tr1 { - -template -class tuple; - -// Anything in namespace gtest_internal is Google Test's INTERNAL -// IMPLEMENTATION DETAIL and MUST NOT BE USED DIRECTLY in user code. -namespace gtest_internal { - -// ByRef::type is T if T is a reference; otherwise it's const T&. -template -struct ByRef { typedef const T& type; }; // NOLINT -template -struct ByRef { typedef T& type; }; // NOLINT - -// A handy wrapper for ByRef. -#define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef::type - -// AddRef::type is T if T is a reference; otherwise it's T&. This -// is the same as tr1::add_reference::type. -template -struct AddRef { typedef T& type; }; // NOLINT -template -struct AddRef { typedef T& type; }; // NOLINT - -// A handy wrapper for AddRef. -#define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef::type - -// A helper for implementing get(). -template class Get; - -// A helper for implementing tuple_element. kIndexValid is true -// iff k < the number of fields in tuple type T. -template -struct TupleElement; - -template -struct TupleElement { - typedef T0 type; -}; - -template -struct TupleElement { - typedef T1 type; -}; - -template -struct TupleElement { - typedef T2 type; -}; - -template -struct TupleElement { - typedef T3 type; -}; - -template -struct TupleElement { - typedef T4 type; -}; - -template -struct TupleElement { - typedef T5 type; -}; - -template -struct TupleElement { - typedef T6 type; -}; - -template -struct TupleElement { - typedef T7 type; -}; - -template -struct TupleElement { - typedef T8 type; -}; - -template -struct TupleElement { - typedef T9 type; -}; - -} // namespace gtest_internal - -template <> -class tuple<> { - public: - tuple() {} - tuple(const tuple& /* t */) {} - tuple& operator=(const tuple& /* t */) { return *this; } -}; - -template -class GTEST_1_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0) : f0_(f0) {} - - tuple(const tuple& t) : f0_(t.f0_) {} - - template - tuple(const GTEST_1_TUPLE_(U)& t) : f0_(t.f0_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_1_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_1_TUPLE_(U)& t) { - f0_ = t.f0_; - return *this; - } - - T0 f0_; -}; - -template -class GTEST_2_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1) : f0_(f0), - f1_(f1) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_) {} - - template - tuple(const GTEST_2_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_) {} - template - tuple(const ::std::pair& p) : f0_(p.first), f1_(p.second) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_2_TUPLE_(U)& t) { - return CopyFrom(t); - } - template - tuple& operator=(const ::std::pair& p) { - f0_ = p.first; - f1_ = p.second; - return *this; - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_2_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - return *this; - } - - T0 f0_; - T1 f1_; -}; - -template -class GTEST_3_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_(), f2_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, - GTEST_BY_REF_(T2) f2) : f0_(f0), f1_(f1), f2_(f2) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {} - - template - tuple(const GTEST_3_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_3_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_3_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - f2_ = t.f2_; - return *this; - } - - T0 f0_; - T1 f1_; - T2 f2_; -}; - -template -class GTEST_4_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_(), f2_(), f3_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, - GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3) : f0_(f0), f1_(f1), f2_(f2), - f3_(f3) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_) {} - - template - tuple(const GTEST_4_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), - f3_(t.f3_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_4_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_4_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - f2_ = t.f2_; - f3_ = t.f3_; - return *this; - } - - T0 f0_; - T1 f1_; - T2 f2_; - T3 f3_; -}; - -template -class GTEST_5_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_(), f2_(), f3_(), f4_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, - GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, - GTEST_BY_REF_(T4) f4) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), - f4_(t.f4_) {} - - template - tuple(const GTEST_5_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), - f3_(t.f3_), f4_(t.f4_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_5_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_5_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - f2_ = t.f2_; - f3_ = t.f3_; - f4_ = t.f4_; - return *this; - } - - T0 f0_; - T1 f1_; - T2 f2_; - T3 f3_; - T4 f4_; -}; - -template -class GTEST_6_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, - GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4, - GTEST_BY_REF_(T5) f5) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4), - f5_(f5) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), - f4_(t.f4_), f5_(t.f5_) {} - - template - tuple(const GTEST_6_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), - f3_(t.f3_), f4_(t.f4_), f5_(t.f5_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_6_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_6_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - f2_ = t.f2_; - f3_ = t.f3_; - f4_ = t.f4_; - f5_ = t.f5_; - return *this; - } - - T0 f0_; - T1 f1_; - T2 f2_; - T3 f3_; - T4 f4_; - T5 f5_; -}; - -template -class GTEST_7_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, - GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4, - GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6) : f0_(f0), f1_(f1), f2_(f2), - f3_(f3), f4_(f4), f5_(f5), f6_(f6) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), - f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {} - - template - tuple(const GTEST_7_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), - f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_7_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_7_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - f2_ = t.f2_; - f3_ = t.f3_; - f4_ = t.f4_; - f5_ = t.f5_; - f6_ = t.f6_; - return *this; - } - - T0 f0_; - T1 f1_; - T2 f2_; - T3 f3_; - T4 f4_; - T5 f5_; - T6 f6_; -}; - -template -class GTEST_8_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, - GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4, - GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, - GTEST_BY_REF_(T7) f7) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4), - f5_(f5), f6_(f6), f7_(f7) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), - f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {} - - template - tuple(const GTEST_8_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), - f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_8_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_8_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - f2_ = t.f2_; - f3_ = t.f3_; - f4_ = t.f4_; - f5_ = t.f5_; - f6_ = t.f6_; - f7_ = t.f7_; - return *this; - } - - T0 f0_; - T1 f1_; - T2 f2_; - T3 f3_; - T4 f4_; - T5 f5_; - T6 f6_; - T7 f7_; -}; - -template -class GTEST_9_TUPLE_(T) { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, - GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4, - GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7, - GTEST_BY_REF_(T8) f8) : f0_(f0), f1_(f1), f2_(f2), f3_(f3), f4_(f4), - f5_(f5), f6_(f6), f7_(f7), f8_(f8) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), - f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {} - - template - tuple(const GTEST_9_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), - f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_9_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_9_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - f2_ = t.f2_; - f3_ = t.f3_; - f4_ = t.f4_; - f5_ = t.f5_; - f6_ = t.f6_; - f7_ = t.f7_; - f8_ = t.f8_; - return *this; - } - - T0 f0_; - T1 f1_; - T2 f2_; - T3 f3_; - T4 f4_; - T5 f5_; - T6 f6_; - T7 f7_; - T8 f8_; -}; - -template -class tuple { - public: - template friend class gtest_internal::Get; - - tuple() : f0_(), f1_(), f2_(), f3_(), f4_(), f5_(), f6_(), f7_(), f8_(), - f9_() {} - - explicit tuple(GTEST_BY_REF_(T0) f0, GTEST_BY_REF_(T1) f1, - GTEST_BY_REF_(T2) f2, GTEST_BY_REF_(T3) f3, GTEST_BY_REF_(T4) f4, - GTEST_BY_REF_(T5) f5, GTEST_BY_REF_(T6) f6, GTEST_BY_REF_(T7) f7, - GTEST_BY_REF_(T8) f8, GTEST_BY_REF_(T9) f9) : f0_(f0), f1_(f1), f2_(f2), - f3_(f3), f4_(f4), f5_(f5), f6_(f6), f7_(f7), f8_(f8), f9_(f9) {} - - tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_), - f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), f9_(t.f9_) {} - - template - tuple(const GTEST_10_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), - f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), - f9_(t.f9_) {} - - tuple& operator=(const tuple& t) { return CopyFrom(t); } - - template - tuple& operator=(const GTEST_10_TUPLE_(U)& t) { - return CopyFrom(t); - } - - GTEST_DECLARE_TUPLE_AS_FRIEND_ - - template - tuple& CopyFrom(const GTEST_10_TUPLE_(U)& t) { - f0_ = t.f0_; - f1_ = t.f1_; - f2_ = t.f2_; - f3_ = t.f3_; - f4_ = t.f4_; - f5_ = t.f5_; - f6_ = t.f6_; - f7_ = t.f7_; - f8_ = t.f8_; - f9_ = t.f9_; - return *this; - } - - T0 f0_; - T1 f1_; - T2 f2_; - T3 f3_; - T4 f4_; - T5 f5_; - T6 f6_; - T7 f7_; - T8 f8_; - T9 f9_; -}; - -// 6.1.3.2 Tuple creation functions. - -// Known limitations: we don't support passing an -// std::tr1::reference_wrapper to make_tuple(). And we don't -// implement tie(). - -inline tuple<> make_tuple() { return tuple<>(); } - -template -inline GTEST_1_TUPLE_(T) make_tuple(const T0& f0) { - return GTEST_1_TUPLE_(T)(f0); -} - -template -inline GTEST_2_TUPLE_(T) make_tuple(const T0& f0, const T1& f1) { - return GTEST_2_TUPLE_(T)(f0, f1); -} - -template -inline GTEST_3_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2) { - return GTEST_3_TUPLE_(T)(f0, f1, f2); -} - -template -inline GTEST_4_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, - const T3& f3) { - return GTEST_4_TUPLE_(T)(f0, f1, f2, f3); -} - -template -inline GTEST_5_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, - const T3& f3, const T4& f4) { - return GTEST_5_TUPLE_(T)(f0, f1, f2, f3, f4); -} - -template -inline GTEST_6_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, - const T3& f3, const T4& f4, const T5& f5) { - return GTEST_6_TUPLE_(T)(f0, f1, f2, f3, f4, f5); -} - -template -inline GTEST_7_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, - const T3& f3, const T4& f4, const T5& f5, const T6& f6) { - return GTEST_7_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6); -} - -template -inline GTEST_8_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, - const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7) { - return GTEST_8_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7); -} - -template -inline GTEST_9_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, - const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7, - const T8& f8) { - return GTEST_9_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8); -} - -template -inline GTEST_10_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2, - const T3& f3, const T4& f4, const T5& f5, const T6& f6, const T7& f7, - const T8& f8, const T9& f9) { - return GTEST_10_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9); -} - -// 6.1.3.3 Tuple helper classes. - -template struct tuple_size; - -template -struct tuple_size { - static const int value = 0; -}; - -template -struct tuple_size { - static const int value = 1; -}; - -template -struct tuple_size { - static const int value = 2; -}; - -template -struct tuple_size { - static const int value = 3; -}; - -template -struct tuple_size { - static const int value = 4; -}; - -template -struct tuple_size { - static const int value = 5; -}; - -template -struct tuple_size { - static const int value = 6; -}; - -template -struct tuple_size { - static const int value = 7; -}; - -template -struct tuple_size { - static const int value = 8; -}; - -template -struct tuple_size { - static const int value = 9; -}; - -template -struct tuple_size { - static const int value = 10; -}; - -template -struct tuple_element { - typedef typename gtest_internal::TupleElement< - k < (tuple_size::value), k, Tuple>::type type; -}; - -#define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element::type - -// 6.1.3.4 Element access. - -namespace gtest_internal { - -template <> -class Get<0> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple)) - Field(Tuple& t) { return t.f0_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(0, Tuple)) - ConstField(const Tuple& t) { return t.f0_; } -}; - -template <> -class Get<1> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple)) - Field(Tuple& t) { return t.f1_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(1, Tuple)) - ConstField(const Tuple& t) { return t.f1_; } -}; - -template <> -class Get<2> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple)) - Field(Tuple& t) { return t.f2_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(2, Tuple)) - ConstField(const Tuple& t) { return t.f2_; } -}; - -template <> -class Get<3> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple)) - Field(Tuple& t) { return t.f3_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(3, Tuple)) - ConstField(const Tuple& t) { return t.f3_; } -}; - -template <> -class Get<4> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple)) - Field(Tuple& t) { return t.f4_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(4, Tuple)) - ConstField(const Tuple& t) { return t.f4_; } -}; - -template <> -class Get<5> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple)) - Field(Tuple& t) { return t.f5_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(5, Tuple)) - ConstField(const Tuple& t) { return t.f5_; } -}; - -template <> -class Get<6> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple)) - Field(Tuple& t) { return t.f6_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(6, Tuple)) - ConstField(const Tuple& t) { return t.f6_; } -}; - -template <> -class Get<7> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple)) - Field(Tuple& t) { return t.f7_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(7, Tuple)) - ConstField(const Tuple& t) { return t.f7_; } -}; - -template <> -class Get<8> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple)) - Field(Tuple& t) { return t.f8_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(8, Tuple)) - ConstField(const Tuple& t) { return t.f8_; } -}; - -template <> -class Get<9> { - public: - template - static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple)) - Field(Tuple& t) { return t.f9_; } // NOLINT - - template - static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(9, Tuple)) - ConstField(const Tuple& t) { return t.f9_; } -}; - -} // namespace gtest_internal - -template -GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T))) -get(GTEST_10_TUPLE_(T)& t) { - return gtest_internal::Get::Field(t); -} - -template -GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T))) -get(const GTEST_10_TUPLE_(T)& t) { - return gtest_internal::Get::ConstField(t); -} - -// 6.1.3.5 Relational operators - -// We only implement == and !=, as we don't have a need for the rest yet. - -namespace gtest_internal { - -// SameSizeTuplePrefixComparator::Eq(t1, t2) returns true if the -// first k fields of t1 equals the first k fields of t2. -// SameSizeTuplePrefixComparator(k1, k2) would be a compiler error if -// k1 != k2. -template -struct SameSizeTuplePrefixComparator; - -template <> -struct SameSizeTuplePrefixComparator<0, 0> { - template - static bool Eq(const Tuple1& /* t1 */, const Tuple2& /* t2 */) { - return true; - } -}; - -template -struct SameSizeTuplePrefixComparator { - template - static bool Eq(const Tuple1& t1, const Tuple2& t2) { - return SameSizeTuplePrefixComparator::Eq(t1, t2) && - ::std::tr1::get(t1) == ::std::tr1::get(t2); - } -}; - -} // namespace gtest_internal - -template -inline bool operator==(const GTEST_10_TUPLE_(T)& t, - const GTEST_10_TUPLE_(U)& u) { - return gtest_internal::SameSizeTuplePrefixComparator< - tuple_size::value, - tuple_size::value>::Eq(t, u); -} - -template -inline bool operator!=(const GTEST_10_TUPLE_(T)& t, - const GTEST_10_TUPLE_(U)& u) { return !(t == u); } - -// 6.1.4 Pairs. -// Unimplemented. - -} // namespace tr1 -} // namespace std - -#undef GTEST_0_TUPLE_ -#undef GTEST_1_TUPLE_ -#undef GTEST_2_TUPLE_ -#undef GTEST_3_TUPLE_ -#undef GTEST_4_TUPLE_ -#undef GTEST_5_TUPLE_ -#undef GTEST_6_TUPLE_ -#undef GTEST_7_TUPLE_ -#undef GTEST_8_TUPLE_ -#undef GTEST_9_TUPLE_ -#undef GTEST_10_TUPLE_ - -#undef GTEST_0_TYPENAMES_ -#undef GTEST_1_TYPENAMES_ -#undef GTEST_2_TYPENAMES_ -#undef GTEST_3_TYPENAMES_ -#undef GTEST_4_TYPENAMES_ -#undef GTEST_5_TYPENAMES_ -#undef GTEST_6_TYPENAMES_ -#undef GTEST_7_TYPENAMES_ -#undef GTEST_8_TYPENAMES_ -#undef GTEST_9_TYPENAMES_ -#undef GTEST_10_TYPENAMES_ - -#undef GTEST_DECLARE_TUPLE_AS_FRIEND_ -#undef GTEST_BY_REF_ -#undef GTEST_ADD_REF_ -#undef GTEST_TUPLE_ELEMENT_ - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TUPLE_H_ -# elif GTEST_ENV_HAS_STD_TUPLE_ -# include -// C++11 puts its tuple into the ::std namespace rather than -// ::std::tr1. gtest expects tuple to live in ::std::tr1, so put it there. -// This causes undefined behavior, but supported compilers react in -// the way we intend. -namespace std { -namespace tr1 { -using ::std::get; -using ::std::make_tuple; -using ::std::tuple; -using ::std::tuple_element; -using ::std::tuple_size; -} -} - -# elif GTEST_OS_SYMBIAN - -// On Symbian, BOOST_HAS_TR1_TUPLE causes Boost's TR1 tuple library to -// use STLport's tuple implementation, which unfortunately doesn't -// work as the copy of STLport distributed with Symbian is incomplete. -// By making sure BOOST_HAS_TR1_TUPLE is undefined, we force Boost to -// use its own tuple implementation. -# ifdef BOOST_HAS_TR1_TUPLE -# undef BOOST_HAS_TR1_TUPLE -# endif // BOOST_HAS_TR1_TUPLE - -// This prevents , which defines -// BOOST_HAS_TR1_TUPLE, from being #included by Boost's . -# define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED -# include - -# elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000) -// GCC 4.0+ implements tr1/tuple in the header. This does -// not conform to the TR1 spec, which requires the header to be . - -# if !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302 -// Until version 4.3.2, gcc has a bug that causes , -// which is #included by , to not compile when RTTI is -// disabled. _TR1_FUNCTIONAL is the header guard for -// . Hence the following #define is a hack to prevent -// from being included. -# define _TR1_FUNCTIONAL 1 -# include -# undef _TR1_FUNCTIONAL // Allows the user to #include - // if he chooses to. -# else -# include // NOLINT -# endif // !GTEST_HAS_RTTI && GTEST_GCC_VER_ < 40302 - -# else -// If the compiler is not GCC 4.0+, we assume the user is using a -// spec-conforming TR1 implementation. -# include // NOLINT -# endif // GTEST_USE_OWN_TR1_TUPLE - -#endif // GTEST_HAS_TR1_TUPLE - -// Determines whether clone(2) is supported. -// Usually it will only be available on Linux, excluding -// Linux on the Itanium architecture. -// Also see http://linux.die.net/man/2/clone. -#ifndef GTEST_HAS_CLONE -// The user didn't tell us, so we need to figure it out. - -# if GTEST_OS_LINUX && !defined(__ia64__) -# if GTEST_OS_LINUX_ANDROID -// On Android, clone() is only available on ARM starting with Gingerbread. -# if defined(__arm__) && __ANDROID_API__ >= 9 -# define GTEST_HAS_CLONE 1 -# else -# define GTEST_HAS_CLONE 0 -# endif -# else -# define GTEST_HAS_CLONE 1 -# endif -# else -# define GTEST_HAS_CLONE 0 -# endif // GTEST_OS_LINUX && !defined(__ia64__) - -#endif // GTEST_HAS_CLONE - -// Determines whether to support stream redirection. This is used to test -// output correctness and to implement death tests. -#ifndef GTEST_HAS_STREAM_REDIRECTION -// By default, we assume that stream redirection is supported on all -// platforms except known mobile ones. -# if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN -# define GTEST_HAS_STREAM_REDIRECTION 0 -# else -# define GTEST_HAS_STREAM_REDIRECTION 1 -# endif // !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_SYMBIAN -#endif // GTEST_HAS_STREAM_REDIRECTION - -// Determines whether to support death tests. -// Google Test does not support death tests for VC 7.1 and earlier as -// abort() in a VC 7.1 application compiled as GUI in debug config -// pops up a dialog window that cannot be suppressed programmatically. -#if (GTEST_OS_LINUX || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \ - (GTEST_OS_MAC && !GTEST_OS_IOS) || GTEST_OS_IOS_SIMULATOR || \ - (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \ - GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \ - GTEST_OS_OPENBSD || GTEST_OS_QNX) -# define GTEST_HAS_DEATH_TEST 1 -# include // NOLINT -#endif - -// We don't support MSVC 7.1 with exceptions disabled now. Therefore -// all the compilers we care about are adequate for supporting -// value-parameterized tests. -#define GTEST_HAS_PARAM_TEST 1 - -// Determines whether to support type-driven tests. - -// Typed tests need and variadic macros, which GCC, VC++ 8.0, -// Sun Pro CC, IBM Visual Age, and HP aCC support. -#if defined(__GNUC__) || (_MSC_VER >= 1400) || defined(__SUNPRO_CC) || \ - defined(__IBMCPP__) || defined(__HP_aCC) -# define GTEST_HAS_TYPED_TEST 1 -# define GTEST_HAS_TYPED_TEST_P 1 -#endif - -// Determines whether to support Combine(). This only makes sense when -// value-parameterized tests are enabled. The implementation doesn't -// work on Sun Studio since it doesn't understand templated conversion -// operators. -#if GTEST_HAS_PARAM_TEST && GTEST_HAS_TR1_TUPLE && !defined(__SUNPRO_CC) -# define GTEST_HAS_COMBINE 1 -#endif - -// Determines whether the system compiler uses UTF-16 for encoding wide strings. -#define GTEST_WIDE_STRING_USES_UTF16_ \ - (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || GTEST_OS_AIX) - -// Determines whether test results can be streamed to a socket. -#if GTEST_OS_LINUX -# define GTEST_CAN_STREAM_RESULTS_ 1 -#endif - -// Defines some utility macros. - -// The GNU compiler emits a warning if nested "if" statements are followed by -// an "else" statement and braces are not used to explicitly disambiguate the -// "else" binding. This leads to problems with code like: -// -// if (gate) -// ASSERT_*(condition) << "Some message"; -// -// The "switch (0) case 0:" idiom is used to suppress this. -#ifdef __INTEL_COMPILER -# define GTEST_AMBIGUOUS_ELSE_BLOCKER_ -#else -# define GTEST_AMBIGUOUS_ELSE_BLOCKER_ switch (0) case 0: default: // NOLINT -#endif - -// Use this annotation at the end of a struct/class definition to -// prevent the compiler from optimizing away instances that are never -// used. This is useful when all interesting logic happens inside the -// c'tor and / or d'tor. Example: -// -// struct Foo { -// Foo() { ... } -// } GTEST_ATTRIBUTE_UNUSED_; -// -// Also use it after a variable or parameter declaration to tell the -// compiler the variable/parameter does not have to be used. -#if defined(__GNUC__) && !defined(COMPILER_ICC) -# define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused)) -#else -# define GTEST_ATTRIBUTE_UNUSED_ -#endif - -// A macro to disallow operator= -// This should be used in the private: declarations for a class. -#define GTEST_DISALLOW_ASSIGN_(type)\ - void operator=(type const &) - -// A macro to disallow copy constructor and operator= -// This should be used in the private: declarations for a class. -#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)\ - type(type const &);\ - GTEST_DISALLOW_ASSIGN_(type) - -// Tell the compiler to warn about unused return values for functions declared -// with this macro. The macro should be used on function declarations -// following the argument list: -// -// Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_; -#if defined(__GNUC__) && (GTEST_GCC_VER_ >= 30400) && !defined(COMPILER_ICC) -# define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result)) -#else -# define GTEST_MUST_USE_RESULT_ -#endif // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC - -// Determine whether the compiler supports Microsoft's Structured Exception -// Handling. This is supported by several Windows compilers but generally -// does not exist on any other system. -#ifndef GTEST_HAS_SEH -// The user didn't tell us, so we need to figure it out. - -# if defined(_MSC_VER) || defined(__BORLANDC__) -// These two compilers are known to support SEH. -# define GTEST_HAS_SEH 1 -# else -// Assume no SEH. -# define GTEST_HAS_SEH 0 -# endif - -#endif // GTEST_HAS_SEH - -#ifdef _MSC_VER - -# if GTEST_LINKED_AS_SHARED_LIBRARY -# define GTEST_API_ __declspec(dllimport) -# elif GTEST_CREATE_SHARED_LIBRARY -# define GTEST_API_ __declspec(dllexport) -# endif - -#endif // _MSC_VER - -#ifndef GTEST_API_ -# define GTEST_API_ -#endif - -#ifdef __GNUC__ -// Ask the compiler to never inline a given function. -# define GTEST_NO_INLINE_ __attribute__((noinline)) -#else -# define GTEST_NO_INLINE_ -#endif - -// _LIBCPP_VERSION is defined by the libc++ library from the LLVM project. -#if defined(__GLIBCXX__) || defined(_LIBCPP_VERSION) -# define GTEST_HAS_CXXABI_H_ 1 -#else -# define GTEST_HAS_CXXABI_H_ 0 -#endif - -namespace testing { - -class Message; - -namespace internal { - -// A secret type that Google Test users don't know about. It has no -// definition on purpose. Therefore it's impossible to create a -// Secret object, which is what we want. -class Secret; - -// The GTEST_COMPILE_ASSERT_ macro can be used to verify that a compile time -// expression is true. For example, you could use it to verify the -// size of a static array: -// -// GTEST_COMPILE_ASSERT_(ARRAYSIZE(content_type_names) == CONTENT_NUM_TYPES, -// content_type_names_incorrect_size); -// -// or to make sure a struct is smaller than a certain size: -// -// GTEST_COMPILE_ASSERT_(sizeof(foo) < 128, foo_too_large); -// -// The second argument to the macro is the name of the variable. If -// the expression is false, most compilers will issue a warning/error -// containing the name of the variable. - -template -struct CompileAssert { -}; - -#define GTEST_COMPILE_ASSERT_(expr, msg) \ - typedef ::testing::internal::CompileAssert<(static_cast(expr))> \ - msg[static_cast(expr) ? 1 : -1] GTEST_ATTRIBUTE_UNUSED_ - -// Implementation details of GTEST_COMPILE_ASSERT_: -// -// - GTEST_COMPILE_ASSERT_ works by defining an array type that has -1 -// elements (and thus is invalid) when the expression is false. -// -// - The simpler definition -// -// #define GTEST_COMPILE_ASSERT_(expr, msg) typedef char msg[(expr) ? 1 : -1] -// -// does not work, as gcc supports variable-length arrays whose sizes -// are determined at run-time (this is gcc's extension and not part -// of the C++ standard). As a result, gcc fails to reject the -// following code with the simple definition: -// -// int foo; -// GTEST_COMPILE_ASSERT_(foo, msg); // not supposed to compile as foo is -// // not a compile-time constant. -// -// - By using the type CompileAssert<(bool(expr))>, we ensures that -// expr is a compile-time constant. (Template arguments must be -// determined at compile-time.) -// -// - The outter parentheses in CompileAssert<(bool(expr))> are necessary -// to work around a bug in gcc 3.4.4 and 4.0.1. If we had written -// -// CompileAssert -// -// instead, these compilers will refuse to compile -// -// GTEST_COMPILE_ASSERT_(5 > 0, some_message); -// -// (They seem to think the ">" in "5 > 0" marks the end of the -// template argument list.) -// -// - The array size is (bool(expr) ? 1 : -1), instead of simply -// -// ((expr) ? 1 : -1). -// -// This is to avoid running into a bug in MS VC 7.1, which -// causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1. - -// StaticAssertTypeEqHelper is used by StaticAssertTypeEq defined in gtest.h. -// -// This template is declared, but intentionally undefined. -template -struct StaticAssertTypeEqHelper; - -template -struct StaticAssertTypeEqHelper {}; - -#if GTEST_HAS_GLOBAL_STRING -typedef ::string string; -#else -typedef ::std::string string; -#endif // GTEST_HAS_GLOBAL_STRING - -#if GTEST_HAS_GLOBAL_WSTRING -typedef ::wstring wstring; -#elif GTEST_HAS_STD_WSTRING -typedef ::std::wstring wstring; -#endif // GTEST_HAS_GLOBAL_WSTRING - -// A helper for suppressing warnings on constant condition. It just -// returns 'condition'. -GTEST_API_ bool IsTrue(bool condition); - -// Defines scoped_ptr. - -// This implementation of scoped_ptr is PARTIAL - it only contains -// enough stuff to satisfy Google Test's need. -template -class scoped_ptr { - public: - typedef T element_type; - - explicit scoped_ptr(T* p = NULL) : ptr_(p) {} - ~scoped_ptr() { reset(); } - - T& operator*() const { return *ptr_; } - T* operator->() const { return ptr_; } - T* get() const { return ptr_; } - - T* release() { - T* const ptr = ptr_; - ptr_ = NULL; - return ptr; - } - - void reset(T* p = NULL) { - if (p != ptr_) { - if (IsTrue(sizeof(T) > 0)) { // Makes sure T is a complete type. - delete ptr_; - } - ptr_ = p; - } - } - - private: - T* ptr_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(scoped_ptr); -}; - -// Defines RE. - -// A simple C++ wrapper for . It uses the POSIX Extended -// Regular Expression syntax. -class GTEST_API_ RE { - public: - // A copy constructor is required by the Standard to initialize object - // references from r-values. - RE(const RE& other) { Init(other.pattern()); } - - // Constructs an RE from a string. - RE(const ::std::string& regex) { Init(regex.c_str()); } // NOLINT - -#if GTEST_HAS_GLOBAL_STRING - - RE(const ::string& regex) { Init(regex.c_str()); } // NOLINT - -#endif // GTEST_HAS_GLOBAL_STRING - - RE(const char* regex) { Init(regex); } // NOLINT - ~RE(); - - // Returns the string representation of the regex. - const char* pattern() const { return pattern_; } - - // FullMatch(str, re) returns true iff regular expression re matches - // the entire str. - // PartialMatch(str, re) returns true iff regular expression re - // matches a substring of str (including str itself). - // - // TODO(wan@google.com): make FullMatch() and PartialMatch() work - // when str contains NUL characters. - static bool FullMatch(const ::std::string& str, const RE& re) { - return FullMatch(str.c_str(), re); - } - static bool PartialMatch(const ::std::string& str, const RE& re) { - return PartialMatch(str.c_str(), re); - } - -#if GTEST_HAS_GLOBAL_STRING - - static bool FullMatch(const ::string& str, const RE& re) { - return FullMatch(str.c_str(), re); - } - static bool PartialMatch(const ::string& str, const RE& re) { - return PartialMatch(str.c_str(), re); - } - -#endif // GTEST_HAS_GLOBAL_STRING - - static bool FullMatch(const char* str, const RE& re); - static bool PartialMatch(const char* str, const RE& re); - - private: - void Init(const char* regex); - - // We use a const char* instead of an std::string, as Google Test used to be - // used where std::string is not available. TODO(wan@google.com): change to - // std::string. - const char* pattern_; - bool is_valid_; - -#if GTEST_USES_POSIX_RE - - regex_t full_regex_; // For FullMatch(). - regex_t partial_regex_; // For PartialMatch(). - -#else // GTEST_USES_SIMPLE_RE - - const char* full_pattern_; // For FullMatch(); - -#endif - - GTEST_DISALLOW_ASSIGN_(RE); -}; - -// Formats a source file path and a line number as they would appear -// in an error message from the compiler used to compile this code. -GTEST_API_ ::std::string FormatFileLocation(const char* file, int line); - -// Formats a file location for compiler-independent XML output. -// Although this function is not platform dependent, we put it next to -// FormatFileLocation in order to contrast the two functions. -GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(const char* file, - int line); - -// Defines logging utilities: -// GTEST_LOG_(severity) - logs messages at the specified severity level. The -// message itself is streamed into the macro. -// LogToStderr() - directs all log messages to stderr. -// FlushInfoLog() - flushes informational log messages. - -enum GTestLogSeverity { - GTEST_INFO, - GTEST_WARNING, - GTEST_ERROR, - GTEST_FATAL -}; - -// Formats log entry severity, provides a stream object for streaming the -// log message, and terminates the message with a newline when going out of -// scope. -class GTEST_API_ GTestLog { - public: - GTestLog(GTestLogSeverity severity, const char* file, int line); - - // Flushes the buffers and, if severity is GTEST_FATAL, aborts the program. - ~GTestLog(); - - ::std::ostream& GetStream() { return ::std::cerr; } - - private: - const GTestLogSeverity severity_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestLog); -}; - -#define GTEST_LOG_(severity) \ - ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \ - __FILE__, __LINE__).GetStream() - -inline void LogToStderr() {} -inline void FlushInfoLog() { fflush(NULL); } - -// INTERNAL IMPLEMENTATION - DO NOT USE. -// -// GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition -// is not satisfied. -// Synopsys: -// GTEST_CHECK_(boolean_condition); -// or -// GTEST_CHECK_(boolean_condition) << "Additional message"; -// -// This checks the condition and if the condition is not satisfied -// it prints message about the condition violation, including the -// condition itself, plus additional message streamed into it, if any, -// and then it aborts the program. It aborts the program irrespective of -// whether it is built in the debug mode or not. -#define GTEST_CHECK_(condition) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (::testing::internal::IsTrue(condition)) \ - ; \ - else \ - GTEST_LOG_(FATAL) << "Condition " #condition " failed. " - -// An all-mode assert to verify that the given POSIX-style function -// call returns 0 (indicating success). Known limitation: this -// doesn't expand to a balanced 'if' statement, so enclose the macro -// in {} if you need to use it as the only statement in an 'if' -// branch. -#define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \ - if (const int gtest_error = (posix_call)) \ - GTEST_LOG_(FATAL) << #posix_call << "failed with error " \ - << gtest_error - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Use ImplicitCast_ as a safe version of static_cast for upcasting in -// the type hierarchy (e.g. casting a Foo* to a SuperclassOfFoo* or a -// const Foo*). When you use ImplicitCast_, the compiler checks that -// the cast is safe. Such explicit ImplicitCast_s are necessary in -// surprisingly many situations where C++ demands an exact type match -// instead of an argument type convertable to a target type. -// -// The syntax for using ImplicitCast_ is the same as for static_cast: -// -// ImplicitCast_(expr) -// -// ImplicitCast_ would have been part of the C++ standard library, -// but the proposal was submitted too late. It will probably make -// its way into the language in the future. -// -// This relatively ugly name is intentional. It prevents clashes with -// similar functions users may have (e.g., implicit_cast). The internal -// namespace alone is not enough because the function can be found by ADL. -template -inline To ImplicitCast_(To x) { return x; } - -// When you upcast (that is, cast a pointer from type Foo to type -// SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts -// always succeed. When you downcast (that is, cast a pointer from -// type Foo to type SubclassOfFoo), static_cast<> isn't safe, because -// how do you know the pointer is really of type SubclassOfFoo? It -// could be a bare Foo, or of type DifferentSubclassOfFoo. Thus, -// when you downcast, you should use this macro. In debug mode, we -// use dynamic_cast<> to double-check the downcast is legal (we die -// if it's not). In normal mode, we do the efficient static_cast<> -// instead. Thus, it's important to test in debug mode to make sure -// the cast is legal! -// This is the only place in the code we should use dynamic_cast<>. -// In particular, you SHOULDN'T be using dynamic_cast<> in order to -// do RTTI (eg code like this: -// if (dynamic_cast(foo)) HandleASubclass1Object(foo); -// if (dynamic_cast(foo)) HandleASubclass2Object(foo); -// You should design the code some other way not to need this. -// -// This relatively ugly name is intentional. It prevents clashes with -// similar functions users may have (e.g., down_cast). The internal -// namespace alone is not enough because the function can be found by ADL. -template // use like this: DownCast_(foo); -inline To DownCast_(From* f) { // so we only accept pointers - // Ensures that To is a sub-type of From *. This test is here only - // for compile-time type checking, and has no overhead in an - // optimized build at run-time, as it will be optimized away - // completely. - if (false) { - const To to = NULL; - ::testing::internal::ImplicitCast_(to); - } - -#if GTEST_HAS_RTTI - // RTTI: debug mode only! - GTEST_CHECK_(f == NULL || dynamic_cast(f) != NULL); -#endif - return static_cast(f); -} - -// Downcasts the pointer of type Base to Derived. -// Derived must be a subclass of Base. The parameter MUST -// point to a class of type Derived, not any subclass of it. -// When RTTI is available, the function performs a runtime -// check to enforce this. -template -Derived* CheckedDowncastToActualType(Base* base) { -#if GTEST_HAS_RTTI - GTEST_CHECK_(typeid(*base) == typeid(Derived)); - return dynamic_cast(base); // NOLINT -#else - return static_cast(base); // Poor man's downcast. -#endif -} - -#if GTEST_HAS_STREAM_REDIRECTION - -// Defines the stderr capturer: -// CaptureStdout - starts capturing stdout. -// GetCapturedStdout - stops capturing stdout and returns the captured string. -// CaptureStderr - starts capturing stderr. -// GetCapturedStderr - stops capturing stderr and returns the captured string. -// -GTEST_API_ void CaptureStdout(); -GTEST_API_ std::string GetCapturedStdout(); -GTEST_API_ void CaptureStderr(); -GTEST_API_ std::string GetCapturedStderr(); - -#endif // GTEST_HAS_STREAM_REDIRECTION - - -#if GTEST_HAS_DEATH_TEST - -const ::std::vector& GetInjectableArgvs(); -void SetInjectableArgvs(const ::std::vector* - new_argvs); - -// A copy of all command line arguments. Set by InitGoogleTest(). -extern ::std::vector g_argvs; - -#endif // GTEST_HAS_DEATH_TEST - -// Defines synchronization primitives. - -#if GTEST_HAS_PTHREAD - -// Sleeps for (roughly) n milli-seconds. This function is only for -// testing Google Test's own constructs. Don't use it in user tests, -// either directly or indirectly. -inline void SleepMilliseconds(int n) { - const timespec time = { - 0, // 0 seconds. - n * 1000L * 1000L, // And n ms. - }; - nanosleep(&time, NULL); -} - -// Allows a controller thread to pause execution of newly created -// threads until notified. Instances of this class must be created -// and destroyed in the controller thread. -// -// This class is only for testing Google Test's own constructs. Do not -// use it in user tests, either directly or indirectly. -class Notification { - public: - Notification() : notified_(false) { - GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL)); - } - ~Notification() { - pthread_mutex_destroy(&mutex_); - } - - // Notifies all threads created with this notification to start. Must - // be called from the controller thread. - void Notify() { - pthread_mutex_lock(&mutex_); - notified_ = true; - pthread_mutex_unlock(&mutex_); - } - - // Blocks until the controller thread notifies. Must be called from a test - // thread. - void WaitForNotification() { - for (;;) { - pthread_mutex_lock(&mutex_); - const bool notified = notified_; - pthread_mutex_unlock(&mutex_); - if (notified) - break; - SleepMilliseconds(10); - } - } - - private: - pthread_mutex_t mutex_; - bool notified_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification); -}; - -// As a C-function, ThreadFuncWithCLinkage cannot be templated itself. -// Consequently, it cannot select a correct instantiation of ThreadWithParam -// in order to call its Run(). Introducing ThreadWithParamBase as a -// non-templated base class for ThreadWithParam allows us to bypass this -// problem. -class ThreadWithParamBase { - public: - virtual ~ThreadWithParamBase() {} - virtual void Run() = 0; -}; - -// pthread_create() accepts a pointer to a function type with the C linkage. -// According to the Standard (7.5/1), function types with different linkages -// are different even if they are otherwise identical. Some compilers (for -// example, SunStudio) treat them as different types. Since class methods -// cannot be defined with C-linkage we need to define a free C-function to -// pass into pthread_create(). -extern "C" inline void* ThreadFuncWithCLinkage(void* thread) { - static_cast(thread)->Run(); - return NULL; -} - -// Helper class for testing Google Test's multi-threading constructs. -// To use it, write: -// -// void ThreadFunc(int param) { /* Do things with param */ } -// Notification thread_can_start; -// ... -// // The thread_can_start parameter is optional; you can supply NULL. -// ThreadWithParam thread(&ThreadFunc, 5, &thread_can_start); -// thread_can_start.Notify(); -// -// These classes are only for testing Google Test's own constructs. Do -// not use them in user tests, either directly or indirectly. -template -class ThreadWithParam : public ThreadWithParamBase { - public: - typedef void (*UserThreadFunc)(T); - - ThreadWithParam( - UserThreadFunc func, T param, Notification* thread_can_start) - : func_(func), - param_(param), - thread_can_start_(thread_can_start), - finished_(false) { - ThreadWithParamBase* const base = this; - // The thread can be created only after all fields except thread_ - // have been initialized. - GTEST_CHECK_POSIX_SUCCESS_( - pthread_create(&thread_, 0, &ThreadFuncWithCLinkage, base)); - } - ~ThreadWithParam() { Join(); } - - void Join() { - if (!finished_) { - GTEST_CHECK_POSIX_SUCCESS_(pthread_join(thread_, 0)); - finished_ = true; - } - } - - virtual void Run() { - if (thread_can_start_ != NULL) - thread_can_start_->WaitForNotification(); - func_(param_); - } - - private: - const UserThreadFunc func_; // User-supplied thread function. - const T param_; // User-supplied parameter to the thread function. - // When non-NULL, used to block execution until the controller thread - // notifies. - Notification* const thread_can_start_; - bool finished_; // true iff we know that the thread function has finished. - pthread_t thread_; // The native thread object. - - GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam); -}; - -// MutexBase and Mutex implement mutex on pthreads-based platforms. They -// are used in conjunction with class MutexLock: -// -// Mutex mutex; -// ... -// MutexLock lock(&mutex); // Acquires the mutex and releases it at the end -// // of the current scope. -// -// MutexBase implements behavior for both statically and dynamically -// allocated mutexes. Do not use MutexBase directly. Instead, write -// the following to define a static mutex: -// -// GTEST_DEFINE_STATIC_MUTEX_(g_some_mutex); -// -// You can forward declare a static mutex like this: -// -// GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex); -// -// To create a dynamic mutex, just define an object of type Mutex. -class MutexBase { - public: - // Acquires this mutex. - void Lock() { - GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_)); - owner_ = pthread_self(); - has_owner_ = true; - } - - // Releases this mutex. - void Unlock() { - // Since the lock is being released the owner_ field should no longer be - // considered valid. We don't protect writing to has_owner_ here, as it's - // the caller's responsibility to ensure that the current thread holds the - // mutex when this is called. - has_owner_ = false; - GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_)); - } - - // Does nothing if the current thread holds the mutex. Otherwise, crashes - // with high probability. - void AssertHeld() const { - GTEST_CHECK_(has_owner_ && pthread_equal(owner_, pthread_self())) - << "The current thread is not holding the mutex @" << this; - } - - // A static mutex may be used before main() is entered. It may even - // be used before the dynamic initialization stage. Therefore we - // must be able to initialize a static mutex object at link time. - // This means MutexBase has to be a POD and its member variables - // have to be public. - public: - pthread_mutex_t mutex_; // The underlying pthread mutex. - // has_owner_ indicates whether the owner_ field below contains a valid thread - // ID and is therefore safe to inspect (e.g., to use in pthread_equal()). All - // accesses to the owner_ field should be protected by a check of this field. - // An alternative might be to memset() owner_ to all zeros, but there's no - // guarantee that a zero'd pthread_t is necessarily invalid or even different - // from pthread_self(). - bool has_owner_; - pthread_t owner_; // The thread holding the mutex. -}; - -// Forward-declares a static mutex. -# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \ - extern ::testing::internal::MutexBase mutex - -// Defines and statically (i.e. at link time) initializes a static mutex. -// The initialization list here does not explicitly initialize each field, -// instead relying on default initialization for the unspecified fields. In -// particular, the owner_ field (a pthread_t) is not explicitly initialized. -// This allows initialization to work whether pthread_t is a scalar or struct. -// The flag -Wmissing-field-initializers must not be specified for this to work. -# define GTEST_DEFINE_STATIC_MUTEX_(mutex) \ - ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, false } - -// The Mutex class can only be used for mutexes created at runtime. It -// shares its API with MutexBase otherwise. -class Mutex : public MutexBase { - public: - Mutex() { - GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, NULL)); - has_owner_ = false; - } - ~Mutex() { - GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&mutex_)); - } - - private: - GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex); -}; - -// We cannot name this class MutexLock as the ctor declaration would -// conflict with a macro named MutexLock, which is defined on some -// platforms. Hence the typedef trick below. -class GTestMutexLock { - public: - explicit GTestMutexLock(MutexBase* mutex) - : mutex_(mutex) { mutex_->Lock(); } - - ~GTestMutexLock() { mutex_->Unlock(); } - - private: - MutexBase* const mutex_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock); -}; - -typedef GTestMutexLock MutexLock; - -// Helpers for ThreadLocal. - -// pthread_key_create() requires DeleteThreadLocalValue() to have -// C-linkage. Therefore it cannot be templatized to access -// ThreadLocal. Hence the need for class -// ThreadLocalValueHolderBase. -class ThreadLocalValueHolderBase { - public: - virtual ~ThreadLocalValueHolderBase() {} -}; - -// Called by pthread to delete thread-local data stored by -// pthread_setspecific(). -extern "C" inline void DeleteThreadLocalValue(void* value_holder) { - delete static_cast(value_holder); -} - -// Implements thread-local storage on pthreads-based systems. -// -// // Thread 1 -// ThreadLocal tl(100); // 100 is the default value for each thread. -// -// // Thread 2 -// tl.set(150); // Changes the value for thread 2 only. -// EXPECT_EQ(150, tl.get()); -// -// // Thread 1 -// EXPECT_EQ(100, tl.get()); // In thread 1, tl has the original value. -// tl.set(200); -// EXPECT_EQ(200, tl.get()); -// -// The template type argument T must have a public copy constructor. -// In addition, the default ThreadLocal constructor requires T to have -// a public default constructor. -// -// An object managed for a thread by a ThreadLocal instance is deleted -// when the thread exits. Or, if the ThreadLocal instance dies in -// that thread, when the ThreadLocal dies. It's the user's -// responsibility to ensure that all other threads using a ThreadLocal -// have exited when it dies, or the per-thread objects for those -// threads will not be deleted. -// -// Google Test only uses global ThreadLocal objects. That means they -// will die after main() has returned. Therefore, no per-thread -// object managed by Google Test will be leaked as long as all threads -// using Google Test have exited when main() returns. -template -class ThreadLocal { - public: - ThreadLocal() : key_(CreateKey()), - default_() {} - explicit ThreadLocal(const T& value) : key_(CreateKey()), - default_(value) {} - - ~ThreadLocal() { - // Destroys the managed object for the current thread, if any. - DeleteThreadLocalValue(pthread_getspecific(key_)); - - // Releases resources associated with the key. This will *not* - // delete managed objects for other threads. - GTEST_CHECK_POSIX_SUCCESS_(pthread_key_delete(key_)); - } - - T* pointer() { return GetOrCreateValue(); } - const T* pointer() const { return GetOrCreateValue(); } - const T& get() const { return *pointer(); } - void set(const T& value) { *pointer() = value; } - - private: - // Holds a value of type T. - class ValueHolder : public ThreadLocalValueHolderBase { - public: - explicit ValueHolder(const T& value) : value_(value) {} - - T* pointer() { return &value_; } - - private: - T value_; - GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder); - }; - - static pthread_key_t CreateKey() { - pthread_key_t key; - // When a thread exits, DeleteThreadLocalValue() will be called on - // the object managed for that thread. - GTEST_CHECK_POSIX_SUCCESS_( - pthread_key_create(&key, &DeleteThreadLocalValue)); - return key; - } - - T* GetOrCreateValue() const { - ThreadLocalValueHolderBase* const holder = - static_cast(pthread_getspecific(key_)); - if (holder != NULL) { - return CheckedDowncastToActualType(holder)->pointer(); - } - - ValueHolder* const new_holder = new ValueHolder(default_); - ThreadLocalValueHolderBase* const holder_base = new_holder; - GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base)); - return new_holder->pointer(); - } - - // A key pthreads uses for looking up per-thread values. - const pthread_key_t key_; - const T default_; // The default value for each thread. - - GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal); -}; - -# define GTEST_IS_THREADSAFE 1 - -#else // GTEST_HAS_PTHREAD - -// A dummy implementation of synchronization primitives (mutex, lock, -// and thread-local variable). Necessary for compiling Google Test where -// mutex is not supported - using Google Test in multiple threads is not -// supported on such platforms. - -class Mutex { - public: - Mutex() {} - void Lock() {} - void Unlock() {} - void AssertHeld() const {} -}; - -# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \ - extern ::testing::internal::Mutex mutex - -# define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex - -class GTestMutexLock { - public: - explicit GTestMutexLock(Mutex*) {} // NOLINT -}; - -typedef GTestMutexLock MutexLock; - -template -class ThreadLocal { - public: - ThreadLocal() : value_() {} - explicit ThreadLocal(const T& value) : value_(value) {} - T* pointer() { return &value_; } - const T* pointer() const { return &value_; } - const T& get() const { return value_; } - void set(const T& value) { value_ = value; } - private: - T value_; -}; - -// The above synchronization primitives have dummy implementations. -// Therefore Google Test is not thread-safe. -# define GTEST_IS_THREADSAFE 0 - -#endif // GTEST_HAS_PTHREAD - -// Returns the number of threads running in the process, or 0 to indicate that -// we cannot detect it. -GTEST_API_ size_t GetThreadCount(); - -// Passing non-POD classes through ellipsis (...) crashes the ARM -// compiler and generates a warning in Sun Studio. The Nokia Symbian -// and the IBM XL C/C++ compiler try to instantiate a copy constructor -// for objects passed through ellipsis (...), failing for uncopyable -// objects. We define this to ensure that only POD is passed through -// ellipsis on these systems. -#if defined(__SYMBIAN32__) || defined(__IBMCPP__) || defined(__SUNPRO_CC) -// We lose support for NULL detection where the compiler doesn't like -// passing non-POD classes through ellipsis (...). -# define GTEST_ELLIPSIS_NEEDS_POD_ 1 -#else -# define GTEST_CAN_COMPARE_NULL 1 -#endif - -// The Nokia Symbian and IBM XL C/C++ compilers cannot decide between -// const T& and const T* in a function template. These compilers -// _can_ decide between class template specializations for T and T*, -// so a tr1::type_traits-like is_pointer works. -#if defined(__SYMBIAN32__) || defined(__IBMCPP__) -# define GTEST_NEEDS_IS_POINTER_ 1 -#endif - -template -struct bool_constant { - typedef bool_constant type; - static const bool value = bool_value; -}; -template const bool bool_constant::value; - -typedef bool_constant false_type; -typedef bool_constant true_type; - -template -struct is_pointer : public false_type {}; - -template -struct is_pointer : public true_type {}; - -template -struct IteratorTraits { - typedef typename Iterator::value_type value_type; -}; - -template -struct IteratorTraits { - typedef T value_type; -}; - -template -struct IteratorTraits { - typedef T value_type; -}; - -#if GTEST_OS_WINDOWS -# define GTEST_PATH_SEP_ "\\" -# define GTEST_HAS_ALT_PATH_SEP_ 1 -// The biggest signed integer type the compiler supports. -typedef __int64 BiggestInt; -#else -# define GTEST_PATH_SEP_ "/" -# define GTEST_HAS_ALT_PATH_SEP_ 0 -typedef long long BiggestInt; // NOLINT -#endif // GTEST_OS_WINDOWS - -// Utilities for char. - -// isspace(int ch) and friends accept an unsigned char or EOF. char -// may be signed, depending on the compiler (or compiler flags). -// Therefore we need to cast a char to unsigned char before calling -// isspace(), etc. - -inline bool IsAlpha(char ch) { - return isalpha(static_cast(ch)) != 0; -} -inline bool IsAlNum(char ch) { - return isalnum(static_cast(ch)) != 0; -} -inline bool IsDigit(char ch) { - return isdigit(static_cast(ch)) != 0; -} -inline bool IsLower(char ch) { - return islower(static_cast(ch)) != 0; -} -inline bool IsSpace(char ch) { - return isspace(static_cast(ch)) != 0; -} -inline bool IsUpper(char ch) { - return isupper(static_cast(ch)) != 0; -} -inline bool IsXDigit(char ch) { - return isxdigit(static_cast(ch)) != 0; -} -inline bool IsXDigit(wchar_t ch) { - const unsigned char low_byte = static_cast(ch); - return ch == low_byte && isxdigit(low_byte) != 0; -} - -inline char ToLower(char ch) { - return static_cast(tolower(static_cast(ch))); -} -inline char ToUpper(char ch) { - return static_cast(toupper(static_cast(ch))); -} - -// The testing::internal::posix namespace holds wrappers for common -// POSIX functions. These wrappers hide the differences between -// Windows/MSVC and POSIX systems. Since some compilers define these -// standard functions as macros, the wrapper cannot have the same name -// as the wrapped function. - -namespace posix { - -// Functions with a different name on Windows. - -#if GTEST_OS_WINDOWS - -typedef struct _stat StatStruct; - -# ifdef __BORLANDC__ -inline int IsATTY(int fd) { return isatty(fd); } -inline int StrCaseCmp(const char* s1, const char* s2) { - return stricmp(s1, s2); -} -inline char* StrDup(const char* src) { return strdup(src); } -# else // !__BORLANDC__ -# if GTEST_OS_WINDOWS_MOBILE -inline int IsATTY(int /* fd */) { return 0; } -# else -inline int IsATTY(int fd) { return _isatty(fd); } -# endif // GTEST_OS_WINDOWS_MOBILE -inline int StrCaseCmp(const char* s1, const char* s2) { - return _stricmp(s1, s2); -} -inline char* StrDup(const char* src) { return _strdup(src); } -# endif // __BORLANDC__ - -# if GTEST_OS_WINDOWS_MOBILE -inline int FileNo(FILE* file) { return reinterpret_cast(_fileno(file)); } -// Stat(), RmDir(), and IsDir() are not needed on Windows CE at this -// time and thus not defined there. -# else -inline int FileNo(FILE* file) { return _fileno(file); } -inline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); } -inline int RmDir(const char* dir) { return _rmdir(dir); } -inline bool IsDir(const StatStruct& st) { - return (_S_IFDIR & st.st_mode) != 0; -} -# endif // GTEST_OS_WINDOWS_MOBILE - -#else - -typedef struct stat StatStruct; - -inline int FileNo(FILE* file) { return fileno(file); } -inline int IsATTY(int fd) { return isatty(fd); } -inline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); } -inline int StrCaseCmp(const char* s1, const char* s2) { - return strcasecmp(s1, s2); -} -inline char* StrDup(const char* src) { return strdup(src); } -inline int RmDir(const char* dir) { return rmdir(dir); } -inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); } - -#endif // GTEST_OS_WINDOWS - -// Functions deprecated by MSVC 8.0. - -#ifdef _MSC_VER -// Temporarily disable warning 4996 (deprecated function). -# pragma warning(push) -# pragma warning(disable:4996) -#endif - -inline const char* StrNCpy(char* dest, const char* src, size_t n) { - return strncpy(dest, src, n); -} - -// ChDir(), FReopen(), FDOpen(), Read(), Write(), Close(), and -// StrError() aren't needed on Windows CE at this time and thus not -// defined there. - -#if !GTEST_OS_WINDOWS_MOBILE -inline int ChDir(const char* dir) { return chdir(dir); } -#endif -inline FILE* FOpen(const char* path, const char* mode) { - return fopen(path, mode); -} -#if !GTEST_OS_WINDOWS_MOBILE -inline FILE *FReopen(const char* path, const char* mode, FILE* stream) { - return freopen(path, mode, stream); -} -inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); } -#endif -inline int FClose(FILE* fp) { return fclose(fp); } -#if !GTEST_OS_WINDOWS_MOBILE -inline int Read(int fd, void* buf, unsigned int count) { - return static_cast(read(fd, buf, count)); -} -inline int Write(int fd, const void* buf, unsigned int count) { - return static_cast(write(fd, buf, count)); -} -inline int Close(int fd) { return close(fd); } -inline const char* StrError(int errnum) { return strerror(errnum); } -#endif -inline const char* GetEnv(const char* name) { -#if GTEST_OS_WINDOWS_MOBILE - // We are on Windows CE, which has no environment variables. - return NULL; -#elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9) - // Environment variables which we programmatically clear will be set to the - // empty string rather than unset (NULL). Handle that case. - const char* const env = getenv(name); - return (env != NULL && env[0] != '\0') ? env : NULL; -#else - return getenv(name); -#endif -} - -#ifdef _MSC_VER -# pragma warning(pop) // Restores the warning state. -#endif - -#if GTEST_OS_WINDOWS_MOBILE -// Windows CE has no C library. The abort() function is used in -// several places in Google Test. This implementation provides a reasonable -// imitation of standard behaviour. -void Abort(); -#else -inline void Abort() { abort(); } -#endif // GTEST_OS_WINDOWS_MOBILE - -} // namespace posix - -// MSVC "deprecates" snprintf and issues warnings wherever it is used. In -// order to avoid these warnings, we need to use _snprintf or _snprintf_s on -// MSVC-based platforms. We map the GTEST_SNPRINTF_ macro to the appropriate -// function in order to achieve that. We use macro definition here because -// snprintf is a variadic function. -#if _MSC_VER >= 1400 && !GTEST_OS_WINDOWS_MOBILE -// MSVC 2005 and above support variadic macros. -# define GTEST_SNPRINTF_(buffer, size, format, ...) \ - _snprintf_s(buffer, size, size, format, __VA_ARGS__) -#elif defined(_MSC_VER) -// Windows CE does not define _snprintf_s and MSVC prior to 2005 doesn't -// complain about _snprintf. -# define GTEST_SNPRINTF_ _snprintf -#else -# define GTEST_SNPRINTF_ snprintf -#endif - -// The maximum number a BiggestInt can represent. This definition -// works no matter BiggestInt is represented in one's complement or -// two's complement. -// -// We cannot rely on numeric_limits in STL, as __int64 and long long -// are not part of standard C++ and numeric_limits doesn't need to be -// defined for them. -const BiggestInt kMaxBiggestInt = - ~(static_cast(1) << (8*sizeof(BiggestInt) - 1)); - -// This template class serves as a compile-time function from size to -// type. It maps a size in bytes to a primitive type with that -// size. e.g. -// -// TypeWithSize<4>::UInt -// -// is typedef-ed to be unsigned int (unsigned integer made up of 4 -// bytes). -// -// Such functionality should belong to STL, but I cannot find it -// there. -// -// Google Test uses this class in the implementation of floating-point -// comparison. -// -// For now it only handles UInt (unsigned int) as that's all Google Test -// needs. Other types can be easily added in the future if need -// arises. -template -class TypeWithSize { - public: - // This prevents the user from using TypeWithSize with incorrect - // values of N. - typedef void UInt; -}; - -// The specialization for size 4. -template <> -class TypeWithSize<4> { - public: - // unsigned int has size 4 in both gcc and MSVC. - // - // As base/basictypes.h doesn't compile on Windows, we cannot use - // uint32, uint64, and etc here. - typedef int Int; - typedef unsigned int UInt; -}; - -// The specialization for size 8. -template <> -class TypeWithSize<8> { - public: -#if GTEST_OS_WINDOWS - typedef __int64 Int; - typedef unsigned __int64 UInt; -#else - typedef long long Int; // NOLINT - typedef unsigned long long UInt; // NOLINT -#endif // GTEST_OS_WINDOWS -}; - -// Integer types of known sizes. -typedef TypeWithSize<4>::Int Int32; -typedef TypeWithSize<4>::UInt UInt32; -typedef TypeWithSize<8>::Int Int64; -typedef TypeWithSize<8>::UInt UInt64; -typedef TypeWithSize<8>::Int TimeInMillis; // Represents time in milliseconds. - -// Utilities for command line flags and environment variables. - -// Macro for referencing flags. -#define GTEST_FLAG(name) FLAGS_gtest_##name - -// Macros for declaring flags. -#define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name) -#define GTEST_DECLARE_int32_(name) \ - GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name) -#define GTEST_DECLARE_string_(name) \ - GTEST_API_ extern ::std::string GTEST_FLAG(name) - -// Macros for defining flags. -#define GTEST_DEFINE_bool_(name, default_val, doc) \ - GTEST_API_ bool GTEST_FLAG(name) = (default_val) -#define GTEST_DEFINE_int32_(name, default_val, doc) \ - GTEST_API_ ::testing::internal::Int32 GTEST_FLAG(name) = (default_val) -#define GTEST_DEFINE_string_(name, default_val, doc) \ - GTEST_API_ ::std::string GTEST_FLAG(name) = (default_val) - -// Thread annotations -#define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks) -#define GTEST_LOCK_EXCLUDED_(locks) - -// Parses 'str' for a 32-bit signed integer. If successful, writes the result -// to *value and returns true; otherwise leaves *value unchanged and returns -// false. -// TODO(chandlerc): Find a better way to refactor flag and environment parsing -// out of both gtest-port.cc and gtest.cc to avoid exporting this utility -// function. -bool ParseInt32(const Message& src_text, const char* str, Int32* value); - -// Parses a bool/Int32/string from the environment variable -// corresponding to the given Google Test flag. -bool BoolFromGTestEnv(const char* flag, bool default_val); -GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val); -const char* StringFromGTestEnv(const char* flag, const char* default_val); - -} // namespace internal -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_ - -#if GTEST_OS_LINUX -# include -# include -# include -# include -#endif // GTEST_OS_LINUX - -#if GTEST_HAS_EXCEPTIONS -# include -#endif - -#include -#include -#include -#include -#include -#include - -// Copyright 2005, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. 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. -// -// Author: wan@google.com (Zhanyong Wan) -// -// The Google C++ Testing Framework (Google Test) -// -// This header file defines the Message class. -// -// IMPORTANT NOTE: Due to limitation of the C++ language, we have to -// leave some internal implementation details in this header file. -// They are clearly marked by comments like this: -// -// // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -// -// Such code is NOT meant to be used by a user directly, and is subject -// to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user -// program! - -#ifndef GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_ -#define GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_ - -#include - - -// Ensures that there is at least one operator<< in the global namespace. -// See Message& operator<<(...) below for why. -void operator<<(const testing::internal::Secret&, int); - -namespace testing { - -// The Message class works like an ostream repeater. -// -// Typical usage: -// -// 1. You stream a bunch of values to a Message object. -// It will remember the text in a stringstream. -// 2. Then you stream the Message object to an ostream. -// This causes the text in the Message to be streamed -// to the ostream. -// -// For example; -// -// testing::Message foo; -// foo << 1 << " != " << 2; -// std::cout << foo; -// -// will print "1 != 2". -// -// Message is not intended to be inherited from. In particular, its -// destructor is not virtual. -// -// Note that stringstream behaves differently in gcc and in MSVC. You -// can stream a NULL char pointer to it in the former, but not in the -// latter (it causes an access violation if you do). The Message -// class hides this difference by treating a NULL char pointer as -// "(null)". -class GTEST_API_ Message { - private: - // The type of basic IO manipulators (endl, ends, and flush) for - // narrow streams. - typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&); - - public: - // Constructs an empty Message. - Message(); - - // Copy constructor. - Message(const Message& msg) : ss_(new ::std::stringstream) { // NOLINT - *ss_ << msg.GetString(); - } - - // Constructs a Message from a C-string. - explicit Message(const char* str) : ss_(new ::std::stringstream) { - *ss_ << str; - } - -#if GTEST_OS_SYMBIAN - // Streams a value (either a pointer or not) to this object. - template - inline Message& operator <<(const T& value) { - StreamHelper(typename internal::is_pointer::type(), value); - return *this; - } -#else - // Streams a non-pointer value to this object. - template - inline Message& operator <<(const T& val) { - // Some libraries overload << for STL containers. These - // overloads are defined in the global namespace instead of ::std. - // - // C++'s symbol lookup rule (i.e. Koenig lookup) says that these - // overloads are visible in either the std namespace or the global - // namespace, but not other namespaces, including the testing - // namespace which Google Test's Message class is in. - // - // To allow STL containers (and other types that has a << operator - // defined in the global namespace) to be used in Google Test - // assertions, testing::Message must access the custom << operator - // from the global namespace. With this using declaration, - // overloads of << defined in the global namespace and those - // visible via Koenig lookup are both exposed in this function. - using ::operator <<; - *ss_ << val; - return *this; - } - - // Streams a pointer value to this object. - // - // This function is an overload of the previous one. When you - // stream a pointer to a Message, this definition will be used as it - // is more specialized. (The C++ Standard, section - // [temp.func.order].) If you stream a non-pointer, then the - // previous definition will be used. - // - // The reason for this overload is that streaming a NULL pointer to - // ostream is undefined behavior. Depending on the compiler, you - // may get "0", "(nil)", "(null)", or an access violation. To - // ensure consistent result across compilers, we always treat NULL - // as "(null)". - template - inline Message& operator <<(T* const& pointer) { // NOLINT - if (pointer == NULL) { - *ss_ << "(null)"; - } else { - *ss_ << pointer; - } - return *this; - } -#endif // GTEST_OS_SYMBIAN - - // Since the basic IO manipulators are overloaded for both narrow - // and wide streams, we have to provide this specialized definition - // of operator <<, even though its body is the same as the - // templatized version above. Without this definition, streaming - // endl or other basic IO manipulators to Message will confuse the - // compiler. - Message& operator <<(BasicNarrowIoManip val) { - *ss_ << val; - return *this; - } - - // Instead of 1/0, we want to see true/false for bool values. - Message& operator <<(bool b) { - return *this << (b ? "true" : "false"); - } - - // These two overloads allow streaming a wide C string to a Message - // using the UTF-8 encoding. - Message& operator <<(const wchar_t* wide_c_str); - Message& operator <<(wchar_t* wide_c_str); - -#if GTEST_HAS_STD_WSTRING - // Converts the given wide string to a narrow string using the UTF-8 - // encoding, and streams the result to this Message object. - Message& operator <<(const ::std::wstring& wstr); -#endif // GTEST_HAS_STD_WSTRING - -#if GTEST_HAS_GLOBAL_WSTRING - // Converts the given wide string to a narrow string using the UTF-8 - // encoding, and streams the result to this Message object. - Message& operator <<(const ::wstring& wstr); -#endif // GTEST_HAS_GLOBAL_WSTRING - - // Gets the text streamed to this object so far as an std::string. - // Each '\0' character in the buffer is replaced with "\\0". - // - // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. - std::string GetString() const; - - private: - -#if GTEST_OS_SYMBIAN - // These are needed as the Nokia Symbian Compiler cannot decide between - // const T& and const T* in a function template. The Nokia compiler _can_ - // decide between class template specializations for T and T*, so a - // tr1::type_traits-like is_pointer works, and we can overload on that. - template - inline void StreamHelper(internal::true_type /*is_pointer*/, T* pointer) { - if (pointer == NULL) { - *ss_ << "(null)"; - } else { - *ss_ << pointer; - } - } - template - inline void StreamHelper(internal::false_type /*is_pointer*/, - const T& value) { - // See the comments in Message& operator <<(const T&) above for why - // we need this using statement. - using ::operator <<; - *ss_ << value; - } -#endif // GTEST_OS_SYMBIAN - - // We'll hold the text streamed to this object here. - const internal::scoped_ptr< ::std::stringstream> ss_; - - // We declare (but don't implement) this to prevent the compiler - // from implementing the assignment operator. - void operator=(const Message&); -}; - -// Streams a Message to an ostream. -inline std::ostream& operator <<(std::ostream& os, const Message& sb) { - return os << sb.GetString(); -} - -namespace internal { - -// Converts a streamable value to an std::string. A NULL pointer is -// converted to "(null)". When the input value is a ::string, -// ::std::string, ::wstring, or ::std::wstring object, each NUL -// character in it is replaced with "\\0". -template -std::string StreamableToString(const T& streamable) { - return (Message() << streamable).GetString(); -} - -} // namespace internal -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_GTEST_MESSAGE_H_ -// Copyright 2005, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. 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. -// -// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee) -// -// The Google C++ Testing Framework (Google Test) -// -// This header file declares the String class and functions used internally by -// Google Test. They are subject to change without notice. They should not used -// by code external to Google Test. -// -// This header file is #included by . -// It should not be #included by other files. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_ - -#ifdef __BORLANDC__ -// string.h is not guaranteed to provide strcpy on C++ Builder. -# include -#endif - -#include -#include - - -namespace testing { -namespace internal { - -// String - an abstract class holding static string utilities. -class GTEST_API_ String { - public: - // Static utility methods - - // Clones a 0-terminated C string, allocating memory using new. The - // caller is responsible for deleting the return value using - // delete[]. Returns the cloned string, or NULL if the input is - // NULL. - // - // This is different from strdup() in string.h, which allocates - // memory using malloc(). - static const char* CloneCString(const char* c_str); - -#if GTEST_OS_WINDOWS_MOBILE - // Windows CE does not have the 'ANSI' versions of Win32 APIs. To be - // able to pass strings to Win32 APIs on CE we need to convert them - // to 'Unicode', UTF-16. - - // Creates a UTF-16 wide string from the given ANSI string, allocating - // memory using new. The caller is responsible for deleting the return - // value using delete[]. Returns the wide string, or NULL if the - // input is NULL. - // - // The wide string is created using the ANSI codepage (CP_ACP) to - // match the behaviour of the ANSI versions of Win32 calls and the - // C runtime. - static LPCWSTR AnsiToUtf16(const char* c_str); - - // Creates an ANSI string from the given wide string, allocating - // memory using new. The caller is responsible for deleting the return - // value using delete[]. Returns the ANSI string, or NULL if the - // input is NULL. - // - // The returned string is created using the ANSI codepage (CP_ACP) to - // match the behaviour of the ANSI versions of Win32 calls and the - // C runtime. - static const char* Utf16ToAnsi(LPCWSTR utf16_str); -#endif - - // Compares two C strings. Returns true iff they have the same content. - // - // Unlike strcmp(), this function can handle NULL argument(s). A - // NULL C string is considered different to any non-NULL C string, - // including the empty string. - static bool CStringEquals(const char* lhs, const char* rhs); - - // Converts a wide C string to a String using the UTF-8 encoding. - // NULL will be converted to "(null)". If an error occurred during - // the conversion, "(failed to convert from wide string)" is - // returned. - static std::string ShowWideCString(const wchar_t* wide_c_str); - - // Compares two wide C strings. Returns true iff they have the same - // content. - // - // Unlike wcscmp(), this function can handle NULL argument(s). A - // NULL C string is considered different to any non-NULL C string, - // including the empty string. - static bool WideCStringEquals(const wchar_t* lhs, const wchar_t* rhs); - - // Compares two C strings, ignoring case. Returns true iff they - // have the same content. - // - // Unlike strcasecmp(), this function can handle NULL argument(s). - // A NULL C string is considered different to any non-NULL C string, - // including the empty string. - static bool CaseInsensitiveCStringEquals(const char* lhs, - const char* rhs); - - // Compares two wide C strings, ignoring case. Returns true iff they - // have the same content. - // - // Unlike wcscasecmp(), this function can handle NULL argument(s). - // A NULL C string is considered different to any non-NULL wide C string, - // including the empty string. - // NB: The implementations on different platforms slightly differ. - // On windows, this method uses _wcsicmp which compares according to LC_CTYPE - // environment variable. On GNU platform this method uses wcscasecmp - // which compares according to LC_CTYPE category of the current locale. - // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the - // current locale. - static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs, - const wchar_t* rhs); - - // Returns true iff the given string ends with the given suffix, ignoring - // case. Any string is considered to end with an empty suffix. - static bool EndsWithCaseInsensitive( - const std::string& str, const std::string& suffix); - - // Formats an int value as "%02d". - static std::string FormatIntWidth2(int value); // "%02d" for width == 2 - - // Formats an int value as "%X". - static std::string FormatHexInt(int value); - - // Formats a byte as "%02X". - static std::string FormatByte(unsigned char value); - - private: - String(); // Not meant to be instantiated. -}; // class String - -// Gets the content of the stringstream's buffer as an std::string. Each '\0' -// character in the buffer is replaced with "\\0". -GTEST_API_ std::string StringStreamToString(::std::stringstream* stream); - -} // namespace internal -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_ -// Copyright 2008, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. 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. -// -// Author: keith.ray@gmail.com (Keith Ray) -// -// Google Test filepath utilities -// -// This header file declares classes and functions used internally by -// Google Test. They are subject to change without notice. -// -// This file is #included in . -// Do not include this header file separately! - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_ - - -namespace testing { -namespace internal { - -// FilePath - a class for file and directory pathname manipulation which -// handles platform-specific conventions (like the pathname separator). -// Used for helper functions for naming files in a directory for xml output. -// Except for Set methods, all methods are const or static, which provides an -// "immutable value object" -- useful for peace of mind. -// A FilePath with a value ending in a path separator ("like/this/") represents -// a directory, otherwise it is assumed to represent a file. In either case, -// it may or may not represent an actual file or directory in the file system. -// Names are NOT checked for syntax correctness -- no checking for illegal -// characters, malformed paths, etc. - -class GTEST_API_ FilePath { - public: - FilePath() : pathname_("") { } - FilePath(const FilePath& rhs) : pathname_(rhs.pathname_) { } - - explicit FilePath(const std::string& pathname) : pathname_(pathname) { - Normalize(); - } - - FilePath& operator=(const FilePath& rhs) { - Set(rhs); - return *this; - } - - void Set(const FilePath& rhs) { - pathname_ = rhs.pathname_; - } - - const std::string& string() const { return pathname_; } - const char* c_str() const { return pathname_.c_str(); } - - // Returns the current working directory, or "" if unsuccessful. - static FilePath GetCurrentDir(); - - // Given directory = "dir", base_name = "test", number = 0, - // extension = "xml", returns "dir/test.xml". If number is greater - // than zero (e.g., 12), returns "dir/test_12.xml". - // On Windows platform, uses \ as the separator rather than /. - static FilePath MakeFileName(const FilePath& directory, - const FilePath& base_name, - int number, - const char* extension); - - // Given directory = "dir", relative_path = "test.xml", - // returns "dir/test.xml". - // On Windows, uses \ as the separator rather than /. - static FilePath ConcatPaths(const FilePath& directory, - const FilePath& relative_path); - - // Returns a pathname for a file that does not currently exist. The pathname - // will be directory/base_name.extension or - // directory/base_name_.extension if directory/base_name.extension - // already exists. The number will be incremented until a pathname is found - // that does not already exist. - // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. - // There could be a race condition if two or more processes are calling this - // function at the same time -- they could both pick the same filename. - static FilePath GenerateUniqueFileName(const FilePath& directory, - const FilePath& base_name, - const char* extension); - - // Returns true iff the path is "". - bool IsEmpty() const { return pathname_.empty(); } - - // If input name has a trailing separator character, removes it and returns - // the name, otherwise return the name string unmodified. - // On Windows platform, uses \ as the separator, other platforms use /. - FilePath RemoveTrailingPathSeparator() const; - - // Returns a copy of the FilePath with the directory part removed. - // Example: FilePath("path/to/file").RemoveDirectoryName() returns - // FilePath("file"). If there is no directory part ("just_a_file"), it returns - // the FilePath unmodified. If there is no file part ("just_a_dir/") it - // returns an empty FilePath (""). - // On Windows platform, '\' is the path separator, otherwise it is '/'. - FilePath RemoveDirectoryName() const; - - // RemoveFileName returns the directory path with the filename removed. - // Example: FilePath("path/to/file").RemoveFileName() returns "path/to/". - // If the FilePath is "a_file" or "/a_file", RemoveFileName returns - // FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does - // not have a file, like "just/a/dir/", it returns the FilePath unmodified. - // On Windows platform, '\' is the path separator, otherwise it is '/'. - FilePath RemoveFileName() const; - - // Returns a copy of the FilePath with the case-insensitive extension removed. - // Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns - // FilePath("dir/file"). If a case-insensitive extension is not - // found, returns a copy of the original FilePath. - FilePath RemoveExtension(const char* extension) const; - - // Creates directories so that path exists. Returns true if successful or if - // the directories already exist; returns false if unable to create - // directories for any reason. Will also return false if the FilePath does - // not represent a directory (that is, it doesn't end with a path separator). - bool CreateDirectoriesRecursively() const; - - // Create the directory so that path exists. Returns true if successful or - // if the directory already exists; returns false if unable to create the - // directory for any reason, including if the parent directory does not - // exist. Not named "CreateDirectory" because that's a macro on Windows. - bool CreateFolder() const; - - // Returns true if FilePath describes something in the file-system, - // either a file, directory, or whatever, and that something exists. - bool FileOrDirectoryExists() const; - - // Returns true if pathname describes a directory in the file-system - // that exists. - bool DirectoryExists() const; - - // Returns true if FilePath ends with a path separator, which indicates that - // it is intended to represent a directory. Returns false otherwise. - // This does NOT check that a directory (or file) actually exists. - bool IsDirectory() const; - - // Returns true if pathname describes a root directory. (Windows has one - // root directory per disk drive.) - bool IsRootDirectory() const; - - // Returns true if pathname describes an absolute path. - bool IsAbsolutePath() const; - - private: - // Replaces multiple consecutive separators with a single separator. - // For example, "bar///foo" becomes "bar/foo". Does not eliminate other - // redundancies that might be in a pathname involving "." or "..". - // - // A pathname with multiple consecutive separators may occur either through - // user error or as a result of some scripts or APIs that generate a pathname - // with a trailing separator. On other platforms the same API or script - // may NOT generate a pathname with a trailing "/". Then elsewhere that - // pathname may have another "/" and pathname components added to it, - // without checking for the separator already being there. - // The script language and operating system may allow paths like "foo//bar" - // but some of the functions in FilePath will not handle that correctly. In - // particular, RemoveTrailingPathSeparator() only removes one separator, and - // it is called in CreateDirectoriesRecursively() assuming that it will change - // a pathname from directory syntax (trailing separator) to filename syntax. - // - // On Windows this method also replaces the alternate path separator '/' with - // the primary path separator '\\', so that for example "bar\\/\\foo" becomes - // "bar\\foo". - - void Normalize(); - - // Returns a pointer to the last occurence of a valid path separator in - // the FilePath. On Windows, for example, both '/' and '\' are valid path - // separators. Returns NULL if no path separator was found. - const char* FindLastPathSeparator() const; - - std::string pathname_; -}; // class FilePath - -} // namespace internal -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_ -// This file was GENERATED by command: -// pump.py gtest-type-util.h.pump -// DO NOT EDIT BY HAND!!! - -// Copyright 2008 Google Inc. -// All Rights Reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. 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. -// -// Author: wan@google.com (Zhanyong Wan) - -// Type utilities needed for implementing typed and type-parameterized -// tests. This file is generated by a SCRIPT. DO NOT EDIT BY HAND! -// -// Currently we support at most 50 types in a list, and at most 50 -// type-parameterized tests in one type-parameterized test case. -// Please contact googletestframework@googlegroups.com if you need -// more. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_ - - -// #ifdef __GNUC__ is too general here. It is possible to use gcc without using -// libstdc++ (which is where cxxabi.h comes from). -# if GTEST_HAS_CXXABI_H_ -# include -# elif defined(__HP_aCC) -# include -# endif // GTEST_HASH_CXXABI_H_ - -namespace testing { -namespace internal { - -// GetTypeName() returns a human-readable name of type T. -// NB: This function is also used in Google Mock, so don't move it inside of -// the typed-test-only section below. -template -std::string GetTypeName() { -# if GTEST_HAS_RTTI - - const char* const name = typeid(T).name(); -# if GTEST_HAS_CXXABI_H_ || defined(__HP_aCC) - int status = 0; - // gcc's implementation of typeid(T).name() mangles the type name, - // so we have to demangle it. -# if GTEST_HAS_CXXABI_H_ - using abi::__cxa_demangle; -# endif // GTEST_HAS_CXXABI_H_ - char* const readable_name = __cxa_demangle(name, 0, 0, &status); - const std::string name_str(status == 0 ? readable_name : name); - free(readable_name); - return name_str; -# else - return name; -# endif // GTEST_HAS_CXXABI_H_ || __HP_aCC - -# else - - return ""; - -# endif // GTEST_HAS_RTTI -} - -#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P - -// AssertyTypeEq::type is defined iff T1 and T2 are the same -// type. This can be used as a compile-time assertion to ensure that -// two types are equal. - -template -struct AssertTypeEq; - -template -struct AssertTypeEq { - typedef bool type; -}; - -// A unique type used as the default value for the arguments of class -// template Types. This allows us to simulate variadic templates -// (e.g. Types, Type, and etc), which C++ doesn't -// support directly. -struct None {}; - -// The following family of struct and struct templates are used to -// represent type lists. In particular, TypesN -// represents a type list with N types (T1, T2, ..., and TN) in it. -// Except for Types0, every struct in the family has two member types: -// Head for the first type in the list, and Tail for the rest of the -// list. - -// The empty type list. -struct Types0 {}; - -// Type lists of length 1, 2, 3, and so on. - -template -struct Types1 { - typedef T1 Head; - typedef Types0 Tail; -}; -template -struct Types2 { - typedef T1 Head; - typedef Types1 Tail; -}; - -template -struct Types3 { - typedef T1 Head; - typedef Types2 Tail; -}; - -template -struct Types4 { - typedef T1 Head; - typedef Types3 Tail; -}; - -template -struct Types5 { - typedef T1 Head; - typedef Types4 Tail; -}; - -template -struct Types6 { - typedef T1 Head; - typedef Types5 Tail; -}; - -template -struct Types7 { - typedef T1 Head; - typedef Types6 Tail; -}; - -template -struct Types8 { - typedef T1 Head; - typedef Types7 Tail; -}; - -template -struct Types9 { - typedef T1 Head; - typedef Types8 Tail; -}; - -template -struct Types10 { - typedef T1 Head; - typedef Types9 Tail; -}; - -template -struct Types11 { - typedef T1 Head; - typedef Types10 Tail; -}; - -template -struct Types12 { - typedef T1 Head; - typedef Types11 Tail; -}; - -template -struct Types13 { - typedef T1 Head; - typedef Types12 Tail; -}; - -template -struct Types14 { - typedef T1 Head; - typedef Types13 Tail; -}; - -template -struct Types15 { - typedef T1 Head; - typedef Types14 Tail; -}; - -template -struct Types16 { - typedef T1 Head; - typedef Types15 Tail; -}; - -template -struct Types17 { - typedef T1 Head; - typedef Types16 Tail; -}; - -template -struct Types18 { - typedef T1 Head; - typedef Types17 Tail; -}; - -template -struct Types19 { - typedef T1 Head; - typedef Types18 Tail; -}; - -template -struct Types20 { - typedef T1 Head; - typedef Types19 Tail; -}; - -template -struct Types21 { - typedef T1 Head; - typedef Types20 Tail; -}; - -template -struct Types22 { - typedef T1 Head; - typedef Types21 Tail; -}; - -template -struct Types23 { - typedef T1 Head; - typedef Types22 Tail; -}; - -template -struct Types24 { - typedef T1 Head; - typedef Types23 Tail; -}; - -template -struct Types25 { - typedef T1 Head; - typedef Types24 Tail; -}; - -template -struct Types26 { - typedef T1 Head; - typedef Types25 Tail; -}; - -template -struct Types27 { - typedef T1 Head; - typedef Types26 Tail; -}; - -template -struct Types28 { - typedef T1 Head; - typedef Types27 Tail; -}; - -template -struct Types29 { - typedef T1 Head; - typedef Types28 Tail; -}; - -template -struct Types30 { - typedef T1 Head; - typedef Types29 Tail; -}; - -template -struct Types31 { - typedef T1 Head; - typedef Types30 Tail; -}; - -template -struct Types32 { - typedef T1 Head; - typedef Types31 Tail; -}; - -template -struct Types33 { - typedef T1 Head; - typedef Types32 Tail; -}; - -template -struct Types34 { - typedef T1 Head; - typedef Types33 Tail; -}; - -template -struct Types35 { - typedef T1 Head; - typedef Types34 Tail; -}; - -template -struct Types36 { - typedef T1 Head; - typedef Types35 Tail; -}; - -template -struct Types37 { - typedef T1 Head; - typedef Types36 Tail; -}; - -template -struct Types38 { - typedef T1 Head; - typedef Types37 Tail; -}; - -template -struct Types39 { - typedef T1 Head; - typedef Types38 Tail; -}; - -template -struct Types40 { - typedef T1 Head; - typedef Types39 Tail; -}; - -template -struct Types41 { - typedef T1 Head; - typedef Types40 Tail; -}; - -template -struct Types42 { - typedef T1 Head; - typedef Types41 Tail; -}; - -template -struct Types43 { - typedef T1 Head; - typedef Types42 Tail; -}; - -template -struct Types44 { - typedef T1 Head; - typedef Types43 Tail; -}; - -template -struct Types45 { - typedef T1 Head; - typedef Types44 Tail; -}; - -template -struct Types46 { - typedef T1 Head; - typedef Types45 Tail; -}; - -template -struct Types47 { - typedef T1 Head; - typedef Types46 Tail; -}; - -template -struct Types48 { - typedef T1 Head; - typedef Types47 Tail; -}; - -template -struct Types49 { - typedef T1 Head; - typedef Types48 Tail; -}; - -template -struct Types50 { - typedef T1 Head; - typedef Types49 Tail; -}; - - -} // namespace internal - -// We don't want to require the users to write TypesN<...> directly, -// as that would require them to count the length. Types<...> is much -// easier to write, but generates horrible messages when there is a -// compiler error, as gcc insists on printing out each template -// argument, even if it has the default value (this means Types -// will appear as Types in the compiler -// errors). -// -// Our solution is to combine the best part of the two approaches: a -// user would write Types, and Google Test will translate -// that to TypesN internally to make error messages -// readable. The translation is done by the 'type' member of the -// Types template. -template -struct Types { - typedef internal::Types50 type; -}; - -template <> -struct Types { - typedef internal::Types0 type; -}; -template -struct Types { - typedef internal::Types1 type; -}; -template -struct Types { - typedef internal::Types2 type; -}; -template -struct Types { - typedef internal::Types3 type; -}; -template -struct Types { - typedef internal::Types4 type; -}; -template -struct Types { - typedef internal::Types5 type; -}; -template -struct Types { - typedef internal::Types6 type; -}; -template -struct Types { - typedef internal::Types7 type; -}; -template -struct Types { - typedef internal::Types8 type; -}; -template -struct Types { - typedef internal::Types9 type; -}; -template -struct Types { - typedef internal::Types10 type; -}; -template -struct Types { - typedef internal::Types11 type; -}; -template -struct Types { - typedef internal::Types12 type; -}; -template -struct Types { - typedef internal::Types13 type; -}; -template -struct Types { - typedef internal::Types14 type; -}; -template -struct Types { - typedef internal::Types15 type; -}; -template -struct Types { - typedef internal::Types16 type; -}; -template -struct Types { - typedef internal::Types17 type; -}; -template -struct Types { - typedef internal::Types18 type; -}; -template -struct Types { - typedef internal::Types19 type; -}; -template -struct Types { - typedef internal::Types20 type; -}; -template -struct Types { - typedef internal::Types21 type; -}; -template -struct Types { - typedef internal::Types22 type; -}; -template -struct Types { - typedef internal::Types23 type; -}; -template -struct Types { - typedef internal::Types24 type; -}; -template -struct Types { - typedef internal::Types25 type; -}; -template -struct Types { - typedef internal::Types26 type; -}; -template -struct Types { - typedef internal::Types27 type; -}; -template -struct Types { - typedef internal::Types28 type; -}; -template -struct Types { - typedef internal::Types29 type; -}; -template -struct Types { - typedef internal::Types30 type; -}; -template -struct Types { - typedef internal::Types31 type; -}; -template -struct Types { - typedef internal::Types32 type; -}; -template -struct Types { - typedef internal::Types33 type; -}; -template -struct Types { - typedef internal::Types34 type; -}; -template -struct Types { - typedef internal::Types35 type; -}; -template -struct Types { - typedef internal::Types36 type; -}; -template -struct Types { - typedef internal::Types37 type; -}; -template -struct Types { - typedef internal::Types38 type; -}; -template -struct Types { - typedef internal::Types39 type; -}; -template -struct Types { - typedef internal::Types40 type; -}; -template -struct Types { - typedef internal::Types41 type; -}; -template -struct Types { - typedef internal::Types42 type; -}; -template -struct Types { - typedef internal::Types43 type; -}; -template -struct Types { - typedef internal::Types44 type; -}; -template -struct Types { - typedef internal::Types45 type; -}; -template -struct Types { - typedef internal::Types46 type; -}; -template -struct Types { - typedef internal::Types47 type; -}; -template -struct Types { - typedef internal::Types48 type; -}; -template -struct Types { - typedef internal::Types49 type; -}; - -namespace internal { - -# define GTEST_TEMPLATE_ template class - -// The template "selector" struct TemplateSel is used to -// represent Tmpl, which must be a class template with one type -// parameter, as a type. TemplateSel::Bind::type is defined -// as the type Tmpl. This allows us to actually instantiate the -// template "selected" by TemplateSel. -// -// This trick is necessary for simulating typedef for class templates, -// which C++ doesn't support directly. -template -struct TemplateSel { - template - struct Bind { - typedef Tmpl type; - }; -}; - -# define GTEST_BIND_(TmplSel, T) \ - TmplSel::template Bind::type - -// A unique struct template used as the default value for the -// arguments of class template Templates. This allows us to simulate -// variadic templates (e.g. Templates, Templates, -// and etc), which C++ doesn't support directly. -template -struct NoneT {}; - -// The following family of struct and struct templates are used to -// represent template lists. In particular, TemplatesN represents a list of N templates (T1, T2, ..., and TN). Except -// for Templates0, every struct in the family has two member types: -// Head for the selector of the first template in the list, and Tail -// for the rest of the list. - -// The empty template list. -struct Templates0 {}; - -// Template lists of length 1, 2, 3, and so on. - -template -struct Templates1 { - typedef TemplateSel Head; - typedef Templates0 Tail; -}; -template -struct Templates2 { - typedef TemplateSel Head; - typedef Templates1 Tail; -}; - -template -struct Templates3 { - typedef TemplateSel Head; - typedef Templates2 Tail; -}; - -template -struct Templates4 { - typedef TemplateSel Head; - typedef Templates3 Tail; -}; - -template -struct Templates5 { - typedef TemplateSel Head; - typedef Templates4 Tail; -}; - -template -struct Templates6 { - typedef TemplateSel Head; - typedef Templates5 Tail; -}; - -template -struct Templates7 { - typedef TemplateSel Head; - typedef Templates6 Tail; -}; - -template -struct Templates8 { - typedef TemplateSel Head; - typedef Templates7 Tail; -}; - -template -struct Templates9 { - typedef TemplateSel Head; - typedef Templates8 Tail; -}; - -template -struct Templates10 { - typedef TemplateSel Head; - typedef Templates9 Tail; -}; - -template -struct Templates11 { - typedef TemplateSel Head; - typedef Templates10 Tail; -}; - -template -struct Templates12 { - typedef TemplateSel Head; - typedef Templates11 Tail; -}; - -template -struct Templates13 { - typedef TemplateSel Head; - typedef Templates12 Tail; -}; - -template -struct Templates14 { - typedef TemplateSel Head; - typedef Templates13 Tail; -}; - -template -struct Templates15 { - typedef TemplateSel Head; - typedef Templates14 Tail; -}; - -template -struct Templates16 { - typedef TemplateSel Head; - typedef Templates15 Tail; -}; - -template -struct Templates17 { - typedef TemplateSel Head; - typedef Templates16 Tail; -}; - -template -struct Templates18 { - typedef TemplateSel Head; - typedef Templates17 Tail; -}; - -template -struct Templates19 { - typedef TemplateSel Head; - typedef Templates18 Tail; -}; - -template -struct Templates20 { - typedef TemplateSel Head; - typedef Templates19 Tail; -}; - -template -struct Templates21 { - typedef TemplateSel Head; - typedef Templates20 Tail; -}; - -template -struct Templates22 { - typedef TemplateSel Head; - typedef Templates21 Tail; -}; - -template -struct Templates23 { - typedef TemplateSel Head; - typedef Templates22 Tail; -}; - -template -struct Templates24 { - typedef TemplateSel Head; - typedef Templates23 Tail; -}; - -template -struct Templates25 { - typedef TemplateSel Head; - typedef Templates24 Tail; -}; - -template -struct Templates26 { - typedef TemplateSel Head; - typedef Templates25 Tail; -}; - -template -struct Templates27 { - typedef TemplateSel Head; - typedef Templates26 Tail; -}; - -template -struct Templates28 { - typedef TemplateSel Head; - typedef Templates27 Tail; -}; - -template -struct Templates29 { - typedef TemplateSel Head; - typedef Templates28 Tail; -}; - -template -struct Templates30 { - typedef TemplateSel Head; - typedef Templates29 Tail; -}; - -template -struct Templates31 { - typedef TemplateSel Head; - typedef Templates30 Tail; -}; - -template -struct Templates32 { - typedef TemplateSel Head; - typedef Templates31 Tail; -}; - -template -struct Templates33 { - typedef TemplateSel Head; - typedef Templates32 Tail; -}; - -template -struct Templates34 { - typedef TemplateSel Head; - typedef Templates33 Tail; -}; - -template -struct Templates35 { - typedef TemplateSel Head; - typedef Templates34 Tail; -}; - -template -struct Templates36 { - typedef TemplateSel Head; - typedef Templates35 Tail; -}; - -template -struct Templates37 { - typedef TemplateSel Head; - typedef Templates36 Tail; -}; - -template -struct Templates38 { - typedef TemplateSel Head; - typedef Templates37 Tail; -}; - -template -struct Templates39 { - typedef TemplateSel Head; - typedef Templates38 Tail; -}; - -template -struct Templates40 { - typedef TemplateSel Head; - typedef Templates39 Tail; -}; - -template -struct Templates41 { - typedef TemplateSel Head; - typedef Templates40 Tail; -}; - -template -struct Templates42 { - typedef TemplateSel Head; - typedef Templates41 Tail; -}; - -template -struct Templates43 { - typedef TemplateSel Head; - typedef Templates42 Tail; -}; - -template -struct Templates44 { - typedef TemplateSel Head; - typedef Templates43 Tail; -}; - -template -struct Templates45 { - typedef TemplateSel Head; - typedef Templates44 Tail; -}; - -template -struct Templates46 { - typedef TemplateSel Head; - typedef Templates45 Tail; -}; - -template -struct Templates47 { - typedef TemplateSel Head; - typedef Templates46 Tail; -}; - -template -struct Templates48 { - typedef TemplateSel Head; - typedef Templates47 Tail; -}; - -template -struct Templates49 { - typedef TemplateSel Head; - typedef Templates48 Tail; -}; - -template -struct Templates50 { - typedef TemplateSel Head; - typedef Templates49 Tail; -}; - - -// We don't want to require the users to write TemplatesN<...> directly, -// as that would require them to count the length. Templates<...> is much -// easier to write, but generates horrible messages when there is a -// compiler error, as gcc insists on printing out each template -// argument, even if it has the default value (this means Templates -// will appear as Templates in the compiler -// errors). -// -// Our solution is to combine the best part of the two approaches: a -// user would write Templates, and Google Test will translate -// that to TemplatesN internally to make error messages -// readable. The translation is done by the 'type' member of the -// Templates template. -template -struct Templates { - typedef Templates50 type; -}; - -template <> -struct Templates { - typedef Templates0 type; -}; -template -struct Templates { - typedef Templates1 type; -}; -template -struct Templates { - typedef Templates2 type; -}; -template -struct Templates { - typedef Templates3 type; -}; -template -struct Templates { - typedef Templates4 type; -}; -template -struct Templates { - typedef Templates5 type; -}; -template -struct Templates { - typedef Templates6 type; -}; -template -struct Templates { - typedef Templates7 type; -}; -template -struct Templates { - typedef Templates8 type; -}; -template -struct Templates { - typedef Templates9 type; -}; -template -struct Templates { - typedef Templates10 type; -}; -template -struct Templates { - typedef Templates11 type; -}; -template -struct Templates { - typedef Templates12 type; -}; -template -struct Templates { - typedef Templates13 type; -}; -template -struct Templates { - typedef Templates14 type; -}; -template -struct Templates { - typedef Templates15 type; -}; -template -struct Templates { - typedef Templates16 type; -}; -template -struct Templates { - typedef Templates17 type; -}; -template -struct Templates { - typedef Templates18 type; -}; -template -struct Templates { - typedef Templates19 type; -}; -template -struct Templates { - typedef Templates20 type; -}; -template -struct Templates { - typedef Templates21 type; -}; -template -struct Templates { - typedef Templates22 type; -}; -template -struct Templates { - typedef Templates23 type; -}; -template -struct Templates { - typedef Templates24 type; -}; -template -struct Templates { - typedef Templates25 type; -}; -template -struct Templates { - typedef Templates26 type; -}; -template -struct Templates { - typedef Templates27 type; -}; -template -struct Templates { - typedef Templates28 type; -}; -template -struct Templates { - typedef Templates29 type; -}; -template -struct Templates { - typedef Templates30 type; -}; -template -struct Templates { - typedef Templates31 type; -}; -template -struct Templates { - typedef Templates32 type; -}; -template -struct Templates { - typedef Templates33 type; -}; -template -struct Templates { - typedef Templates34 type; -}; -template -struct Templates { - typedef Templates35 type; -}; -template -struct Templates { - typedef Templates36 type; -}; -template -struct Templates { - typedef Templates37 type; -}; -template -struct Templates { - typedef Templates38 type; -}; -template -struct Templates { - typedef Templates39 type; -}; -template -struct Templates { - typedef Templates40 type; -}; -template -struct Templates { - typedef Templates41 type; -}; -template -struct Templates { - typedef Templates42 type; -}; -template -struct Templates { - typedef Templates43 type; -}; -template -struct Templates { - typedef Templates44 type; -}; -template -struct Templates { - typedef Templates45 type; -}; -template -struct Templates { - typedef Templates46 type; -}; -template -struct Templates { - typedef Templates47 type; -}; -template -struct Templates { - typedef Templates48 type; -}; -template -struct Templates { - typedef Templates49 type; -}; - -// The TypeList template makes it possible to use either a single type -// or a Types<...> list in TYPED_TEST_CASE() and -// INSTANTIATE_TYPED_TEST_CASE_P(). - -template -struct TypeList { - typedef Types1 type; -}; - -template -struct TypeList > { - typedef typename Types::type type; -}; - -#endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P - -} // namespace internal -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_ - -// Due to C++ preprocessor weirdness, we need double indirection to -// concatenate two tokens when one of them is __LINE__. Writing -// -// foo ## __LINE__ -// -// will result in the token foo__LINE__, instead of foo followed by -// the current line number. For more details, see -// http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6 -#define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar) -#define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar - -class ProtocolMessage; -namespace proto2 { class Message; } - -namespace testing { - -// Forward declarations. - -class AssertionResult; // Result of an assertion. -class Message; // Represents a failure message. -class Test; // Represents a test. -class TestInfo; // Information about a test. -class TestPartResult; // Result of a test part. -class UnitTest; // A collection of test cases. - -template -::std::string PrintToString(const T& value); - -namespace internal { - -struct TraceInfo; // Information about a trace point. -class ScopedTrace; // Implements scoped trace. -class TestInfoImpl; // Opaque implementation of TestInfo -class UnitTestImpl; // Opaque implementation of UnitTest - -// How many times InitGoogleTest() has been called. -GTEST_API_ extern int g_init_gtest_count; - -// The text used in failure messages to indicate the start of the -// stack trace. -GTEST_API_ extern const char kStackTraceMarker[]; - -// Two overloaded helpers for checking at compile time whether an -// expression is a null pointer literal (i.e. NULL or any 0-valued -// compile-time integral constant). Their return values have -// different sizes, so we can use sizeof() to test which version is -// picked by the compiler. These helpers have no implementations, as -// we only need their signatures. -// -// Given IsNullLiteralHelper(x), the compiler will pick the first -// version if x can be implicitly converted to Secret*, and pick the -// second version otherwise. Since Secret is a secret and incomplete -// type, the only expression a user can write that has type Secret* is -// a null pointer literal. Therefore, we know that x is a null -// pointer literal if and only if the first version is picked by the -// compiler. -char IsNullLiteralHelper(Secret* p); -char (&IsNullLiteralHelper(...))[2]; // NOLINT - -// A compile-time bool constant that is true if and only if x is a -// null pointer literal (i.e. NULL or any 0-valued compile-time -// integral constant). -#ifdef GTEST_ELLIPSIS_NEEDS_POD_ -// We lose support for NULL detection where the compiler doesn't like -// passing non-POD classes through ellipsis (...). -# define GTEST_IS_NULL_LITERAL_(x) false -#else -# define GTEST_IS_NULL_LITERAL_(x) \ - (sizeof(::testing::internal::IsNullLiteralHelper(x)) == 1) -#endif // GTEST_ELLIPSIS_NEEDS_POD_ - -// Appends the user-supplied message to the Google-Test-generated message. -GTEST_API_ std::string AppendUserMessage( - const std::string& gtest_msg, const Message& user_msg); - -#if GTEST_HAS_EXCEPTIONS - -// This exception is thrown by (and only by) a failed Google Test -// assertion when GTEST_FLAG(throw_on_failure) is true (if exceptions -// are enabled). We derive it from std::runtime_error, which is for -// errors presumably detectable only at run time. Since -// std::runtime_error inherits from std::exception, many testing -// frameworks know how to extract and print the message inside it. -class GTEST_API_ GoogleTestFailureException : public ::std::runtime_error { - public: - explicit GoogleTestFailureException(const TestPartResult& failure); -}; - -#endif // GTEST_HAS_EXCEPTIONS - -// A helper class for creating scoped traces in user programs. -class GTEST_API_ ScopedTrace { - public: - // The c'tor pushes the given source file location and message onto - // a trace stack maintained by Google Test. - ScopedTrace(const char* file, int line, const Message& message); - - // The d'tor pops the info pushed by the c'tor. - // - // Note that the d'tor is not virtual in order to be efficient. - // Don't inherit from ScopedTrace! - ~ScopedTrace(); - - private: - GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace); -} GTEST_ATTRIBUTE_UNUSED_; // A ScopedTrace object does its job in its - // c'tor and d'tor. Therefore it doesn't - // need to be used otherwise. - -// Constructs and returns the message for an equality assertion -// (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure. -// -// The first four parameters are the expressions used in the assertion -// and their values, as strings. For example, for ASSERT_EQ(foo, bar) -// where foo is 5 and bar is 6, we have: -// -// expected_expression: "foo" -// actual_expression: "bar" -// expected_value: "5" -// actual_value: "6" -// -// The ignoring_case parameter is true iff the assertion is a -// *_STRCASEEQ*. When it's true, the string " (ignoring case)" will -// be inserted into the message. -GTEST_API_ AssertionResult EqFailure(const char* expected_expression, - const char* actual_expression, - const std::string& expected_value, - const std::string& actual_value, - bool ignoring_case); - -// Constructs a failure message for Boolean assertions such as EXPECT_TRUE. -GTEST_API_ std::string GetBoolAssertionFailureMessage( - const AssertionResult& assertion_result, - const char* expression_text, - const char* actual_predicate_value, - const char* expected_predicate_value); - -// This template class represents an IEEE floating-point number -// (either single-precision or double-precision, depending on the -// template parameters). -// -// The purpose of this class is to do more sophisticated number -// comparison. (Due to round-off error, etc, it's very unlikely that -// two floating-points will be equal exactly. Hence a naive -// comparison by the == operation often doesn't work.) -// -// Format of IEEE floating-point: -// -// The most-significant bit being the leftmost, an IEEE -// floating-point looks like -// -// sign_bit exponent_bits fraction_bits -// -// Here, sign_bit is a single bit that designates the sign of the -// number. -// -// For float, there are 8 exponent bits and 23 fraction bits. -// -// For double, there are 11 exponent bits and 52 fraction bits. -// -// More details can be found at -// http://en.wikipedia.org/wiki/IEEE_floating-point_standard. -// -// Template parameter: -// -// RawType: the raw floating-point type (either float or double) -template -class FloatingPoint { - public: - // Defines the unsigned integer type that has the same size as the - // floating point number. - typedef typename TypeWithSize::UInt Bits; - - // Constants. - - // # of bits in a number. - static const size_t kBitCount = 8*sizeof(RawType); - - // # of fraction bits in a number. - static const size_t kFractionBitCount = - std::numeric_limits::digits - 1; - - // # of exponent bits in a number. - static const size_t kExponentBitCount = kBitCount - 1 - kFractionBitCount; - - // The mask for the sign bit. - static const Bits kSignBitMask = static_cast(1) << (kBitCount - 1); - - // The mask for the fraction bits. - static const Bits kFractionBitMask = - ~static_cast(0) >> (kExponentBitCount + 1); - - // The mask for the exponent bits. - static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask); - - // How many ULP's (Units in the Last Place) we want to tolerate when - // comparing two numbers. The larger the value, the more error we - // allow. A 0 value means that two numbers must be exactly the same - // to be considered equal. - // - // The maximum error of a single floating-point operation is 0.5 - // units in the last place. On Intel CPU's, all floating-point - // calculations are done with 80-bit precision, while double has 64 - // bits. Therefore, 4 should be enough for ordinary use. - // - // See the following article for more details on ULP: - // http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/ - static const size_t kMaxUlps = 4; - - // Constructs a FloatingPoint from a raw floating-point number. - // - // On an Intel CPU, passing a non-normalized NAN (Not a Number) - // around may change its bits, although the new value is guaranteed - // to be also a NAN. Therefore, don't expect this constructor to - // preserve the bits in x when x is a NAN. - explicit FloatingPoint(const RawType& x) { u_.value_ = x; } - - // Static methods - - // Reinterprets a bit pattern as a floating-point number. - // - // This function is needed to test the AlmostEquals() method. - static RawType ReinterpretBits(const Bits bits) { - FloatingPoint fp(0); - fp.u_.bits_ = bits; - return fp.u_.value_; - } - - // Returns the floating-point number that represent positive infinity. - static RawType Infinity() { - return ReinterpretBits(kExponentBitMask); - } - - // Returns the maximum representable finite floating-point number. - static RawType Max(); - - // Non-static methods - - // Returns the bits that represents this number. - const Bits &bits() const { return u_.bits_; } - - // Returns the exponent bits of this number. - Bits exponent_bits() const { return kExponentBitMask & u_.bits_; } - - // Returns the fraction bits of this number. - Bits fraction_bits() const { return kFractionBitMask & u_.bits_; } - - // Returns the sign bit of this number. - Bits sign_bit() const { return kSignBitMask & u_.bits_; } - - // Returns true iff this is NAN (not a number). - bool is_nan() const { - // It's a NAN if the exponent bits are all ones and the fraction - // bits are not entirely zeros. - return (exponent_bits() == kExponentBitMask) && (fraction_bits() != 0); - } - - // Returns true iff this number is at most kMaxUlps ULP's away from - // rhs. In particular, this function: - // - // - returns false if either number is (or both are) NAN. - // - treats really large numbers as almost equal to infinity. - // - thinks +0.0 and -0.0 are 0 DLP's apart. - bool AlmostEquals(const FloatingPoint& rhs) const { - // The IEEE standard says that any comparison operation involving - // a NAN must return false. - if (is_nan() || rhs.is_nan()) return false; - - return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_) - <= kMaxUlps; - } - - private: - // The data type used to store the actual floating-point number. - union FloatingPointUnion { - RawType value_; // The raw floating-point number. - Bits bits_; // The bits that represent the number. - }; - - // Converts an integer from the sign-and-magnitude representation to - // the biased representation. More precisely, let N be 2 to the - // power of (kBitCount - 1), an integer x is represented by the - // unsigned number x + N. - // - // For instance, - // - // -N + 1 (the most negative number representable using - // sign-and-magnitude) is represented by 1; - // 0 is represented by N; and - // N - 1 (the biggest number representable using - // sign-and-magnitude) is represented by 2N - 1. - // - // Read http://en.wikipedia.org/wiki/Signed_number_representations - // for more details on signed number representations. - static Bits SignAndMagnitudeToBiased(const Bits &sam) { - if (kSignBitMask & sam) { - // sam represents a negative number. - return ~sam + 1; - } else { - // sam represents a positive number. - return kSignBitMask | sam; - } - } - - // Given two numbers in the sign-and-magnitude representation, - // returns the distance between them as an unsigned number. - static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1, - const Bits &sam2) { - const Bits biased1 = SignAndMagnitudeToBiased(sam1); - const Bits biased2 = SignAndMagnitudeToBiased(sam2); - return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1); - } - - FloatingPointUnion u_; -}; - -// We cannot use std::numeric_limits::max() as it clashes with the max() -// macro defined by . -template <> -inline float FloatingPoint::Max() { return FLT_MAX; } -template <> -inline double FloatingPoint::Max() { return DBL_MAX; } - -// Typedefs the instances of the FloatingPoint template class that we -// care to use. -typedef FloatingPoint Float; -typedef FloatingPoint Double; - -// In order to catch the mistake of putting tests that use different -// test fixture classes in the same test case, we need to assign -// unique IDs to fixture classes and compare them. The TypeId type is -// used to hold such IDs. The user should treat TypeId as an opaque -// type: the only operation allowed on TypeId values is to compare -// them for equality using the == operator. -typedef const void* TypeId; - -template -class TypeIdHelper { - public: - // dummy_ must not have a const type. Otherwise an overly eager - // compiler (e.g. MSVC 7.1 & 8.0) may try to merge - // TypeIdHelper::dummy_ for different Ts as an "optimization". - static bool dummy_; -}; - -template -bool TypeIdHelper::dummy_ = false; - -// GetTypeId() returns the ID of type T. Different values will be -// returned for different types. Calling the function twice with the -// same type argument is guaranteed to return the same ID. -template -TypeId GetTypeId() { - // The compiler is required to allocate a different - // TypeIdHelper::dummy_ variable for each T used to instantiate - // the template. Therefore, the address of dummy_ is guaranteed to - // be unique. - return &(TypeIdHelper::dummy_); -} - -// Returns the type ID of ::testing::Test. Always call this instead -// of GetTypeId< ::testing::Test>() to get the type ID of -// ::testing::Test, as the latter may give the wrong result due to a -// suspected linker bug when compiling Google Test as a Mac OS X -// framework. -GTEST_API_ TypeId GetTestTypeId(); - -// Defines the abstract factory interface that creates instances -// of a Test object. -class TestFactoryBase { - public: - virtual ~TestFactoryBase() {} - - // Creates a test instance to run. The instance is both created and destroyed - // within TestInfoImpl::Run() - virtual Test* CreateTest() = 0; - - protected: - TestFactoryBase() {} - - private: - GTEST_DISALLOW_COPY_AND_ASSIGN_(TestFactoryBase); -}; - -// This class provides implementation of TeastFactoryBase interface. -// It is used in TEST and TEST_F macros. -template -class TestFactoryImpl : public TestFactoryBase { - public: - virtual Test* CreateTest() { return new TestClass; } -}; - -#if GTEST_OS_WINDOWS - -// Predicate-formatters for implementing the HRESULT checking macros -// {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED} -// We pass a long instead of HRESULT to avoid causing an -// include dependency for the HRESULT type. -GTEST_API_ AssertionResult IsHRESULTSuccess(const char* expr, - long hr); // NOLINT -GTEST_API_ AssertionResult IsHRESULTFailure(const char* expr, - long hr); // NOLINT - -#endif // GTEST_OS_WINDOWS - -// Types of SetUpTestCase() and TearDownTestCase() functions. -typedef void (*SetUpTestCaseFunc)(); -typedef void (*TearDownTestCaseFunc)(); - -// Creates a new TestInfo object and registers it with Google Test; -// returns the created object. -// -// Arguments: -// -// test_case_name: name of the test case -// name: name of the test -// type_param the name of the test's type parameter, or NULL if -// this is not a typed or a type-parameterized test. -// value_param text representation of the test's value parameter, -// or NULL if this is not a type-parameterized test. -// fixture_class_id: ID of the test fixture class -// set_up_tc: pointer to the function that sets up the test case -// tear_down_tc: pointer to the function that tears down the test case -// factory: pointer to the factory that creates a test object. -// The newly created TestInfo instance will assume -// ownership of the factory object. -GTEST_API_ TestInfo* MakeAndRegisterTestInfo( - const char* test_case_name, - const char* name, - const char* type_param, - const char* value_param, - TypeId fixture_class_id, - SetUpTestCaseFunc set_up_tc, - TearDownTestCaseFunc tear_down_tc, - TestFactoryBase* factory); - -// If *pstr starts with the given prefix, modifies *pstr to be right -// past the prefix and returns true; otherwise leaves *pstr unchanged -// and returns false. None of pstr, *pstr, and prefix can be NULL. -GTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr); - -#if GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P - -// State of the definition of a type-parameterized test case. -class GTEST_API_ TypedTestCasePState { - public: - TypedTestCasePState() : registered_(false) {} - - // Adds the given test name to defined_test_names_ and return true - // if the test case hasn't been registered; otherwise aborts the - // program. - bool AddTestName(const char* file, int line, const char* case_name, - const char* test_name) { - if (registered_) { - fprintf(stderr, "%s Test %s must be defined before " - "REGISTER_TYPED_TEST_CASE_P(%s, ...).\n", - FormatFileLocation(file, line).c_str(), test_name, case_name); - fflush(stderr); - posix::Abort(); - } - defined_test_names_.insert(test_name); - return true; - } - - // Verifies that registered_tests match the test names in - // defined_test_names_; returns registered_tests if successful, or - // aborts the program otherwise. - const char* VerifyRegisteredTestNames( - const char* file, int line, const char* registered_tests); - - private: - bool registered_; - ::std::set defined_test_names_; -}; - -// Skips to the first non-space char after the first comma in 'str'; -// returns NULL if no comma is found in 'str'. -inline const char* SkipComma(const char* str) { - const char* comma = strchr(str, ','); - if (comma == NULL) { - return NULL; - } - while (IsSpace(*(++comma))) {} - return comma; -} - -// Returns the prefix of 'str' before the first comma in it; returns -// the entire string if it contains no comma. -inline std::string GetPrefixUntilComma(const char* str) { - const char* comma = strchr(str, ','); - return comma == NULL ? str : std::string(str, comma); -} - -// TypeParameterizedTest::Register() -// registers a list of type-parameterized tests with Google Test. The -// return value is insignificant - we just need to return something -// such that we can call this function in a namespace scope. -// -// Implementation note: The GTEST_TEMPLATE_ macro declares a template -// template parameter. It's defined in gtest-type-util.h. -template -class TypeParameterizedTest { - public: - // 'index' is the index of the test in the type list 'Types' - // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase, - // Types). Valid values for 'index' are [0, N - 1] where N is the - // length of Types. - static bool Register(const char* prefix, const char* case_name, - const char* test_names, int index) { - typedef typename Types::Head Type; - typedef Fixture FixtureClass; - typedef typename GTEST_BIND_(TestSel, Type) TestClass; - - // First, registers the first type-parameterized test in the type - // list. - MakeAndRegisterTestInfo( - (std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name + "/" - + StreamableToString(index)).c_str(), - GetPrefixUntilComma(test_names).c_str(), - GetTypeName().c_str(), - NULL, // No value parameter. - GetTypeId(), - TestClass::SetUpTestCase, - TestClass::TearDownTestCase, - new TestFactoryImpl); - - // Next, recurses (at compile time) with the tail of the type list. - return TypeParameterizedTest - ::Register(prefix, case_name, test_names, index + 1); - } -}; - -// The base case for the compile time recursion. -template -class TypeParameterizedTest { - public: - static bool Register(const char* /*prefix*/, const char* /*case_name*/, - const char* /*test_names*/, int /*index*/) { - return true; - } -}; - -// TypeParameterizedTestCase::Register() -// registers *all combinations* of 'Tests' and 'Types' with Google -// Test. The return value is insignificant - we just need to return -// something such that we can call this function in a namespace scope. -template -class TypeParameterizedTestCase { - public: - static bool Register(const char* prefix, const char* case_name, - const char* test_names) { - typedef typename Tests::Head Head; - - // First, register the first test in 'Test' for each type in 'Types'. - TypeParameterizedTest::Register( - prefix, case_name, test_names, 0); - - // Next, recurses (at compile time) with the tail of the test list. - return TypeParameterizedTestCase - ::Register(prefix, case_name, SkipComma(test_names)); - } -}; - -// The base case for the compile time recursion. -template -class TypeParameterizedTestCase { - public: - static bool Register(const char* /*prefix*/, const char* /*case_name*/, - const char* /*test_names*/) { - return true; - } -}; - -#endif // GTEST_HAS_TYPED_TEST || GTEST_HAS_TYPED_TEST_P - -// Returns the current OS stack trace as an std::string. -// -// The maximum number of stack frames to be included is specified by -// the gtest_stack_trace_depth flag. The skip_count parameter -// specifies the number of top frames to be skipped, which doesn't -// count against the number of frames to be included. -// -// For example, if Foo() calls Bar(), which in turn calls -// GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in -// the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't. -GTEST_API_ std::string GetCurrentOsStackTraceExceptTop( - UnitTest* unit_test, int skip_count); - -// Helpers for suppressing warnings on unreachable code or constant -// condition. - -// Always returns true. -GTEST_API_ bool AlwaysTrue(); - -// Always returns false. -inline bool AlwaysFalse() { return !AlwaysTrue(); } - -// Helper for suppressing false warning from Clang on a const char* -// variable declared in a conditional expression always being NULL in -// the else branch. -struct GTEST_API_ ConstCharPtr { - ConstCharPtr(const char* str) : value(str) {} - operator bool() const { return true; } - const char* value; -}; - -// A simple Linear Congruential Generator for generating random -// numbers with a uniform distribution. Unlike rand() and srand(), it -// doesn't use global state (and therefore can't interfere with user -// code). Unlike rand_r(), it's portable. An LCG isn't very random, -// but it's good enough for our purposes. -class GTEST_API_ Random { - public: - static const UInt32 kMaxRange = 1u << 31; - - explicit Random(UInt32 seed) : state_(seed) {} - - void Reseed(UInt32 seed) { state_ = seed; } - - // Generates a random number from [0, range). Crashes if 'range' is - // 0 or greater than kMaxRange. - UInt32 Generate(UInt32 range); - - private: - UInt32 state_; - GTEST_DISALLOW_COPY_AND_ASSIGN_(Random); -}; - -// Defining a variable of type CompileAssertTypesEqual will cause a -// compiler error iff T1 and T2 are different types. -template -struct CompileAssertTypesEqual; - -template -struct CompileAssertTypesEqual { -}; - -// Removes the reference from a type if it is a reference type, -// otherwise leaves it unchanged. This is the same as -// tr1::remove_reference, which is not widely available yet. -template -struct RemoveReference { typedef T type; }; // NOLINT -template -struct RemoveReference { typedef T type; }; // NOLINT - -// A handy wrapper around RemoveReference that works when the argument -// T depends on template parameters. -#define GTEST_REMOVE_REFERENCE_(T) \ - typename ::testing::internal::RemoveReference::type - -// Removes const from a type if it is a const type, otherwise leaves -// it unchanged. This is the same as tr1::remove_const, which is not -// widely available yet. -template -struct RemoveConst { typedef T type; }; // NOLINT -template -struct RemoveConst { typedef T type; }; // NOLINT - -// MSVC 8.0, Sun C++, and IBM XL C++ have a bug which causes the above -// definition to fail to remove the const in 'const int[3]' and 'const -// char[3][4]'. The following specialization works around the bug. -template -struct RemoveConst { - typedef typename RemoveConst::type type[N]; -}; - -#if defined(_MSC_VER) && _MSC_VER < 1400 -// This is the only specialization that allows VC++ 7.1 to remove const in -// 'const int[3] and 'const int[3][4]'. However, it causes trouble with GCC -// and thus needs to be conditionally compiled. -template -struct RemoveConst { - typedef typename RemoveConst::type type[N]; -}; -#endif - -// A handy wrapper around RemoveConst that works when the argument -// T depends on template parameters. -#define GTEST_REMOVE_CONST_(T) \ - typename ::testing::internal::RemoveConst::type - -// Turns const U&, U&, const U, and U all into U. -#define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \ - GTEST_REMOVE_CONST_(GTEST_REMOVE_REFERENCE_(T)) - -// Adds reference to a type if it is not a reference type, -// otherwise leaves it unchanged. This is the same as -// tr1::add_reference, which is not widely available yet. -template -struct AddReference { typedef T& type; }; // NOLINT -template -struct AddReference { typedef T& type; }; // NOLINT - -// A handy wrapper around AddReference that works when the argument T -// depends on template parameters. -#define GTEST_ADD_REFERENCE_(T) \ - typename ::testing::internal::AddReference::type - -// Adds a reference to const on top of T as necessary. For example, -// it transforms -// -// char ==> const char& -// const char ==> const char& -// char& ==> const char& -// const char& ==> const char& -// -// The argument T must depend on some template parameters. -#define GTEST_REFERENCE_TO_CONST_(T) \ - GTEST_ADD_REFERENCE_(const GTEST_REMOVE_REFERENCE_(T)) - -// ImplicitlyConvertible::value is a compile-time bool -// constant that's true iff type From can be implicitly converted to -// type To. -template -class ImplicitlyConvertible { - private: - // We need the following helper functions only for their types. - // They have no implementations. - - // MakeFrom() is an expression whose type is From. We cannot simply - // use From(), as the type From may not have a public default - // constructor. - static From MakeFrom(); - - // These two functions are overloaded. Given an expression - // Helper(x), the compiler will pick the first version if x can be - // implicitly converted to type To; otherwise it will pick the - // second version. - // - // The first version returns a value of size 1, and the second - // version returns a value of size 2. Therefore, by checking the - // size of Helper(x), which can be done at compile time, we can tell - // which version of Helper() is used, and hence whether x can be - // implicitly converted to type To. - static char Helper(To); - static char (&Helper(...))[2]; // NOLINT - - // We have to put the 'public' section after the 'private' section, - // or MSVC refuses to compile the code. - public: - // MSVC warns about implicitly converting from double to int for - // possible loss of data, so we need to temporarily disable the - // warning. -#ifdef _MSC_VER -# pragma warning(push) // Saves the current warning state. -# pragma warning(disable:4244) // Temporarily disables warning 4244. - - static const bool value = - sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1; -# pragma warning(pop) // Restores the warning state. -#elif defined(__BORLANDC__) - // C++Builder cannot use member overload resolution during template - // instantiation. The simplest workaround is to use its C++0x type traits - // functions (C++Builder 2009 and above only). - static const bool value = __is_convertible(From, To); -#else - static const bool value = - sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1; -#endif // _MSV_VER -}; -template -const bool ImplicitlyConvertible::value; - -// IsAProtocolMessage::value is a compile-time bool constant that's -// true iff T is type ProtocolMessage, proto2::Message, or a subclass -// of those. -template -struct IsAProtocolMessage - : public bool_constant< - ImplicitlyConvertible::value || - ImplicitlyConvertible::value> { -}; - -// When the compiler sees expression IsContainerTest(0), if C is an -// STL-style container class, the first overload of IsContainerTest -// will be viable (since both C::iterator* and C::const_iterator* are -// valid types and NULL can be implicitly converted to them). It will -// be picked over the second overload as 'int' is a perfect match for -// the type of argument 0. If C::iterator or C::const_iterator is not -// a valid type, the first overload is not viable, and the second -// overload will be picked. Therefore, we can determine whether C is -// a container class by checking the type of IsContainerTest(0). -// The value of the expression is insignificant. -// -// Note that we look for both C::iterator and C::const_iterator. The -// reason is that C++ injects the name of a class as a member of the -// class itself (e.g. you can refer to class iterator as either -// 'iterator' or 'iterator::iterator'). If we look for C::iterator -// only, for example, we would mistakenly think that a class named -// iterator is an STL container. -// -// Also note that the simpler approach of overloading -// IsContainerTest(typename C::const_iterator*) and -// IsContainerTest(...) doesn't work with Visual Age C++ and Sun C++. -typedef int IsContainer; -template -IsContainer IsContainerTest(int /* dummy */, - typename C::iterator* /* it */ = NULL, - typename C::const_iterator* /* const_it */ = NULL) { - return 0; -} - -typedef char IsNotContainer; -template -IsNotContainer IsContainerTest(long /* dummy */) { return '\0'; } - -// EnableIf::type is void when 'Cond' is true, and -// undefined when 'Cond' is false. To use SFINAE to make a function -// overload only apply when a particular expression is true, add -// "typename EnableIf::type* = 0" as the last parameter. -template struct EnableIf; -template<> struct EnableIf { typedef void type; }; // NOLINT - -// Utilities for native arrays. - -// ArrayEq() compares two k-dimensional native arrays using the -// elements' operator==, where k can be any integer >= 0. When k is -// 0, ArrayEq() degenerates into comparing a single pair of values. - -template -bool ArrayEq(const T* lhs, size_t size, const U* rhs); - -// This generic version is used when k is 0. -template -inline bool ArrayEq(const T& lhs, const U& rhs) { return lhs == rhs; } - -// This overload is used when k >= 1. -template -inline bool ArrayEq(const T(&lhs)[N], const U(&rhs)[N]) { - return internal::ArrayEq(lhs, N, rhs); -} - -// This helper reduces code bloat. If we instead put its logic inside -// the previous ArrayEq() function, arrays with different sizes would -// lead to different copies of the template code. -template -bool ArrayEq(const T* lhs, size_t size, const U* rhs) { - for (size_t i = 0; i != size; i++) { - if (!internal::ArrayEq(lhs[i], rhs[i])) - return false; - } - return true; -} - -// Finds the first element in the iterator range [begin, end) that -// equals elem. Element may be a native array type itself. -template -Iter ArrayAwareFind(Iter begin, Iter end, const Element& elem) { - for (Iter it = begin; it != end; ++it) { - if (internal::ArrayEq(*it, elem)) - return it; - } - return end; -} - -// CopyArray() copies a k-dimensional native array using the elements' -// operator=, where k can be any integer >= 0. When k is 0, -// CopyArray() degenerates into copying a single value. - -template -void CopyArray(const T* from, size_t size, U* to); - -// This generic version is used when k is 0. -template -inline void CopyArray(const T& from, U* to) { *to = from; } - -// This overload is used when k >= 1. -template -inline void CopyArray(const T(&from)[N], U(*to)[N]) { - internal::CopyArray(from, N, *to); -} - -// This helper reduces code bloat. If we instead put its logic inside -// the previous CopyArray() function, arrays with different sizes -// would lead to different copies of the template code. -template -void CopyArray(const T* from, size_t size, U* to) { - for (size_t i = 0; i != size; i++) { - internal::CopyArray(from[i], to + i); - } -} - -// The relation between an NativeArray object (see below) and the -// native array it represents. -enum RelationToSource { - kReference, // The NativeArray references the native array. - kCopy // The NativeArray makes a copy of the native array and - // owns the copy. -}; - -// Adapts a native array to a read-only STL-style container. Instead -// of the complete STL container concept, this adaptor only implements -// members useful for Google Mock's container matchers. New members -// should be added as needed. To simplify the implementation, we only -// support Element being a raw type (i.e. having no top-level const or -// reference modifier). It's the client's responsibility to satisfy -// this requirement. Element can be an array type itself (hence -// multi-dimensional arrays are supported). -template -class NativeArray { - public: - // STL-style container typedefs. - typedef Element value_type; - typedef Element* iterator; - typedef const Element* const_iterator; - - // Constructs from a native array. - NativeArray(const Element* array, size_t count, RelationToSource relation) { - Init(array, count, relation); - } - - // Copy constructor. - NativeArray(const NativeArray& rhs) { - Init(rhs.array_, rhs.size_, rhs.relation_to_source_); - } - - ~NativeArray() { - // Ensures that the user doesn't instantiate NativeArray with a - // const or reference type. - static_cast(StaticAssertTypeEqHelper()); - if (relation_to_source_ == kCopy) - delete[] array_; - } - - // STL-style container methods. - size_t size() const { return size_; } - const_iterator begin() const { return array_; } - const_iterator end() const { return array_ + size_; } - bool operator==(const NativeArray& rhs) const { - return size() == rhs.size() && - ArrayEq(begin(), size(), rhs.begin()); - } - - private: - // Initializes this object; makes a copy of the input array if - // 'relation' is kCopy. - void Init(const Element* array, size_t a_size, RelationToSource relation) { - if (relation == kReference) { - array_ = array; - } else { - Element* const copy = new Element[a_size]; - CopyArray(array, a_size, copy); - array_ = copy; - } - size_ = a_size; - relation_to_source_ = relation; - } - - const Element* array_; - size_t size_; - RelationToSource relation_to_source_; - - GTEST_DISALLOW_ASSIGN_(NativeArray); -}; - -} // namespace internal -} // namespace testing - -#define GTEST_MESSAGE_AT_(file, line, message, result_type) \ - ::testing::internal::AssertHelper(result_type, file, line, message) \ - = ::testing::Message() - -#define GTEST_MESSAGE_(message, result_type) \ - GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type) - -#define GTEST_FATAL_FAILURE_(message) \ - return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure) - -#define GTEST_NONFATAL_FAILURE_(message) \ - GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure) - -#define GTEST_SUCCESS_(message) \ - GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess) - -// Suppresses MSVC warnings 4072 (unreachable code) for the code following -// statement if it returns or throws (or doesn't return or throw in some -// situations). -#define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \ - if (::testing::internal::AlwaysTrue()) { statement; } - -#define GTEST_TEST_THROW_(statement, expected_exception, fail) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (::testing::internal::ConstCharPtr gtest_msg = "") { \ - bool gtest_caught_expected = false; \ - try { \ - GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ - } \ - catch (expected_exception const&) { \ - gtest_caught_expected = true; \ - } \ - catch (...) { \ - gtest_msg.value = \ - "Expected: " #statement " throws an exception of type " \ - #expected_exception ".\n Actual: it throws a different type."; \ - goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \ - } \ - if (!gtest_caught_expected) { \ - gtest_msg.value = \ - "Expected: " #statement " throws an exception of type " \ - #expected_exception ".\n Actual: it throws nothing."; \ - goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \ - } \ - } else \ - GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__): \ - fail(gtest_msg.value) - -#define GTEST_TEST_NO_THROW_(statement, fail) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (::testing::internal::AlwaysTrue()) { \ - try { \ - GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ - } \ - catch (...) { \ - goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \ - } \ - } else \ - GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \ - fail("Expected: " #statement " doesn't throw an exception.\n" \ - " Actual: it throws.") - -#define GTEST_TEST_ANY_THROW_(statement, fail) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (::testing::internal::AlwaysTrue()) { \ - bool gtest_caught_any = false; \ - try { \ - GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ - } \ - catch (...) { \ - gtest_caught_any = true; \ - } \ - if (!gtest_caught_any) { \ - goto GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__); \ - } \ - } else \ - GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \ - fail("Expected: " #statement " throws an exception.\n" \ - " Actual: it doesn't.") - - -// Implements Boolean test assertions such as EXPECT_TRUE. expression can be -// either a boolean expression or an AssertionResult. text is a textual -// represenation of expression as it was passed into the EXPECT_TRUE. -#define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (const ::testing::AssertionResult gtest_ar_ = \ - ::testing::AssertionResult(expression)) \ - ; \ - else \ - fail(::testing::internal::GetBoolAssertionFailureMessage(\ - gtest_ar_, text, #actual, #expected).c_str()) - -#define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (::testing::internal::AlwaysTrue()) { \ - ::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \ - GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ - if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \ - goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \ - } \ - } else \ - GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__): \ - fail("Expected: " #statement " doesn't generate new fatal " \ - "failures in the current thread.\n" \ - " Actual: it does.") - -// Expands to the name of the class that implements the given test. -#define GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \ - test_case_name##_##test_name##_Test - -// Helper macro for defining tests. -#define GTEST_TEST_(test_case_name, test_name, parent_class, parent_id)\ -class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\ - public:\ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {}\ - private:\ - virtual void TestBody();\ - static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_;\ - GTEST_DISALLOW_COPY_AND_ASSIGN_(\ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name));\ -};\ -\ -::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_case_name, test_name)\ - ::test_info_ =\ - ::testing::internal::MakeAndRegisterTestInfo(\ - #test_case_name, #test_name, NULL, NULL, \ - (parent_id), \ - parent_class::SetUpTestCase, \ - parent_class::TearDownTestCase, \ - new ::testing::internal::TestFactoryImpl<\ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>);\ -void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody() - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_ -// Copyright 2005, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. 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. -// -// Author: wan@google.com (Zhanyong Wan) -// -// The Google C++ Testing Framework (Google Test) -// -// This header file defines the public API for death tests. It is -// #included by gtest.h so a user doesn't need to include this -// directly. - -#ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_ -#define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_ - -// Copyright 2005, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. 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. -// -// Authors: wan@google.com (Zhanyong Wan), eefacm@gmail.com (Sean Mcafee) -// -// The Google C++ Testing Framework (Google Test) -// -// This header file defines internal utilities needed for implementing -// death tests. They are subject to change without notice. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_ - - -#include - -namespace testing { -namespace internal { - -GTEST_DECLARE_string_(internal_run_death_test); - -// Names of the flags (needed for parsing Google Test flags). -const char kDeathTestStyleFlag[] = "death_test_style"; -const char kDeathTestUseFork[] = "death_test_use_fork"; -const char kInternalRunDeathTestFlag[] = "internal_run_death_test"; - -#if GTEST_HAS_DEATH_TEST - -// DeathTest is a class that hides much of the complexity of the -// GTEST_DEATH_TEST_ macro. It is abstract; its static Create method -// returns a concrete class that depends on the prevailing death test -// style, as defined by the --gtest_death_test_style and/or -// --gtest_internal_run_death_test flags. - -// In describing the results of death tests, these terms are used with -// the corresponding definitions: -// -// exit status: The integer exit information in the format specified -// by wait(2) -// exit code: The integer code passed to exit(3), _exit(2), or -// returned from main() -class GTEST_API_ DeathTest { - public: - // Create returns false if there was an error determining the - // appropriate action to take for the current death test; for example, - // if the gtest_death_test_style flag is set to an invalid value. - // The LastMessage method will return a more detailed message in that - // case. Otherwise, the DeathTest pointer pointed to by the "test" - // argument is set. If the death test should be skipped, the pointer - // is set to NULL; otherwise, it is set to the address of a new concrete - // DeathTest object that controls the execution of the current test. - static bool Create(const char* statement, const RE* regex, - const char* file, int line, DeathTest** test); - DeathTest(); - virtual ~DeathTest() { } - - // A helper class that aborts a death test when it's deleted. - class ReturnSentinel { - public: - explicit ReturnSentinel(DeathTest* test) : test_(test) { } - ~ReturnSentinel() { test_->Abort(TEST_ENCOUNTERED_RETURN_STATEMENT); } - private: - DeathTest* const test_; - GTEST_DISALLOW_COPY_AND_ASSIGN_(ReturnSentinel); - } GTEST_ATTRIBUTE_UNUSED_; - - // An enumeration of possible roles that may be taken when a death - // test is encountered. EXECUTE means that the death test logic should - // be executed immediately. OVERSEE means that the program should prepare - // the appropriate environment for a child process to execute the death - // test, then wait for it to complete. - enum TestRole { OVERSEE_TEST, EXECUTE_TEST }; - - // An enumeration of the three reasons that a test might be aborted. - enum AbortReason { - TEST_ENCOUNTERED_RETURN_STATEMENT, - TEST_THREW_EXCEPTION, - TEST_DID_NOT_DIE - }; - - // Assumes one of the above roles. - virtual TestRole AssumeRole() = 0; - - // Waits for the death test to finish and returns its status. - virtual int Wait() = 0; - - // Returns true if the death test passed; that is, the test process - // exited during the test, its exit status matches a user-supplied - // predicate, and its stderr output matches a user-supplied regular - // expression. - // The user-supplied predicate may be a macro expression rather - // than a function pointer or functor, or else Wait and Passed could - // be combined. - virtual bool Passed(bool exit_status_ok) = 0; - - // Signals that the death test did not die as expected. - virtual void Abort(AbortReason reason) = 0; - - // Returns a human-readable outcome message regarding the outcome of - // the last death test. - static const char* LastMessage(); - - static void set_last_death_test_message(const std::string& message); - - private: - // A string containing a description of the outcome of the last death test. - static std::string last_death_test_message_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(DeathTest); -}; - -// Factory interface for death tests. May be mocked out for testing. -class DeathTestFactory { - public: - virtual ~DeathTestFactory() { } - virtual bool Create(const char* statement, const RE* regex, - const char* file, int line, DeathTest** test) = 0; -}; - -// A concrete DeathTestFactory implementation for normal use. -class DefaultDeathTestFactory : public DeathTestFactory { - public: - virtual bool Create(const char* statement, const RE* regex, - const char* file, int line, DeathTest** test); -}; - -// Returns true if exit_status describes a process that was terminated -// by a signal, or exited normally with a nonzero exit code. -GTEST_API_ bool ExitedUnsuccessfully(int exit_status); - -// Traps C++ exceptions escaping statement and reports them as test -// failures. Note that trapping SEH exceptions is not implemented here. -# if GTEST_HAS_EXCEPTIONS -# define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \ - try { \ - GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ - } catch (const ::std::exception& gtest_exception) { \ - fprintf(\ - stderr, \ - "\n%s: Caught std::exception-derived exception escaping the " \ - "death test statement. Exception message: %s\n", \ - ::testing::internal::FormatFileLocation(__FILE__, __LINE__).c_str(), \ - gtest_exception.what()); \ - fflush(stderr); \ - death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \ - } catch (...) { \ - death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \ - } - -# else -# define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \ - GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) - -# endif - -// This macro is for implementing ASSERT_DEATH*, EXPECT_DEATH*, -// ASSERT_EXIT*, and EXPECT_EXIT*. -# define GTEST_DEATH_TEST_(statement, predicate, regex, fail) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (::testing::internal::AlwaysTrue()) { \ - const ::testing::internal::RE& gtest_regex = (regex); \ - ::testing::internal::DeathTest* gtest_dt; \ - if (!::testing::internal::DeathTest::Create(#statement, >est_regex, \ - __FILE__, __LINE__, >est_dt)) { \ - goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \ - } \ - if (gtest_dt != NULL) { \ - ::testing::internal::scoped_ptr< ::testing::internal::DeathTest> \ - gtest_dt_ptr(gtest_dt); \ - switch (gtest_dt->AssumeRole()) { \ - case ::testing::internal::DeathTest::OVERSEE_TEST: \ - if (!gtest_dt->Passed(predicate(gtest_dt->Wait()))) { \ - goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \ - } \ - break; \ - case ::testing::internal::DeathTest::EXECUTE_TEST: { \ - ::testing::internal::DeathTest::ReturnSentinel \ - gtest_sentinel(gtest_dt); \ - GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, gtest_dt); \ - gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \ - break; \ - } \ - default: \ - break; \ - } \ - } \ - } else \ - GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__): \ - fail(::testing::internal::DeathTest::LastMessage()) -// The symbol "fail" here expands to something into which a message -// can be streamed. - -// This macro is for implementing ASSERT/EXPECT_DEBUG_DEATH when compiled in -// NDEBUG mode. In this case we need the statements to be executed, the regex is -// ignored, and the macro must accept a streamed message even though the message -// is never printed. -# define GTEST_EXECUTE_STATEMENT_(statement, regex) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (::testing::internal::AlwaysTrue()) { \ - GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ - } else \ - ::testing::Message() - -// A class representing the parsed contents of the -// --gtest_internal_run_death_test flag, as it existed when -// RUN_ALL_TESTS was called. -class InternalRunDeathTestFlag { - public: - InternalRunDeathTestFlag(const std::string& a_file, - int a_line, - int an_index, - int a_write_fd) - : file_(a_file), line_(a_line), index_(an_index), - write_fd_(a_write_fd) {} - - ~InternalRunDeathTestFlag() { - if (write_fd_ >= 0) - posix::Close(write_fd_); - } - - const std::string& file() const { return file_; } - int line() const { return line_; } - int index() const { return index_; } - int write_fd() const { return write_fd_; } - - private: - std::string file_; - int line_; - int index_; - int write_fd_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag); -}; - -// Returns a newly created InternalRunDeathTestFlag object with fields -// initialized from the GTEST_FLAG(internal_run_death_test) flag if -// the flag is specified; otherwise returns NULL. -InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag(); - -#else // GTEST_HAS_DEATH_TEST - -// This macro is used for implementing macros such as -// EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where -// death tests are not supported. Those macros must compile on such systems -// iff EXPECT_DEATH and ASSERT_DEATH compile with the same parameters on -// systems that support death tests. This allows one to write such a macro -// on a system that does not support death tests and be sure that it will -// compile on a death-test supporting system. -// -// Parameters: -// statement - A statement that a macro such as EXPECT_DEATH would test -// for program termination. This macro has to make sure this -// statement is compiled but not executed, to ensure that -// EXPECT_DEATH_IF_SUPPORTED compiles with a certain -// parameter iff EXPECT_DEATH compiles with it. -// regex - A regex that a macro such as EXPECT_DEATH would use to test -// the output of statement. This parameter has to be -// compiled but not evaluated by this macro, to ensure that -// this macro only accepts expressions that a macro such as -// EXPECT_DEATH would accept. -// terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED -// and a return statement for ASSERT_DEATH_IF_SUPPORTED. -// This ensures that ASSERT_DEATH_IF_SUPPORTED will not -// compile inside functions where ASSERT_DEATH doesn't -// compile. -// -// The branch that has an always false condition is used to ensure that -// statement and regex are compiled (and thus syntactically correct) but -// never executed. The unreachable code macro protects the terminator -// statement from generating an 'unreachable code' warning in case -// statement unconditionally returns or throws. The Message constructor at -// the end allows the syntax of streaming additional messages into the -// macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH. -# define GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, terminator) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (::testing::internal::AlwaysTrue()) { \ - GTEST_LOG_(WARNING) \ - << "Death tests are not supported on this platform.\n" \ - << "Statement '" #statement "' cannot be verified."; \ - } else if (::testing::internal::AlwaysFalse()) { \ - ::testing::internal::RE::PartialMatch(".*", (regex)); \ - GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ - terminator; \ - } else \ - ::testing::Message() - -#endif // GTEST_HAS_DEATH_TEST - -} // namespace internal -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_ - -namespace testing { - -// This flag controls the style of death tests. Valid values are "threadsafe", -// meaning that the death test child process will re-execute the test binary -// from the start, running only a single death test, or "fast", -// meaning that the child process will execute the test logic immediately -// after forking. -GTEST_DECLARE_string_(death_test_style); - -#if GTEST_HAS_DEATH_TEST - -namespace internal { - -// Returns a Boolean value indicating whether the caller is currently -// executing in the context of the death test child process. Tools such as -// Valgrind heap checkers may need this to modify their behavior in death -// tests. IMPORTANT: This is an internal utility. Using it may break the -// implementation of death tests. User code MUST NOT use it. -GTEST_API_ bool InDeathTestChild(); - -} // namespace internal - -// The following macros are useful for writing death tests. - -// Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is -// executed: -// -// 1. It generates a warning if there is more than one active -// thread. This is because it's safe to fork() or clone() only -// when there is a single thread. -// -// 2. The parent process clone()s a sub-process and runs the death -// test in it; the sub-process exits with code 0 at the end of the -// death test, if it hasn't exited already. -// -// 3. The parent process waits for the sub-process to terminate. -// -// 4. The parent process checks the exit code and error message of -// the sub-process. -// -// Examples: -// -// ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number"); -// for (int i = 0; i < 5; i++) { -// EXPECT_DEATH(server.ProcessRequest(i), -// "Invalid request .* in ProcessRequest()") -// << "Failed to die on request " << i; -// } -// -// ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting"); -// -// bool KilledBySIGHUP(int exit_code) { -// return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP; -// } -// -// ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!"); -// -// On the regular expressions used in death tests: -// -// On POSIX-compliant systems (*nix), we use the library, -// which uses the POSIX extended regex syntax. -// -// On other platforms (e.g. Windows), we only support a simple regex -// syntax implemented as part of Google Test. This limited -// implementation should be enough most of the time when writing -// death tests; though it lacks many features you can find in PCRE -// or POSIX extended regex syntax. For example, we don't support -// union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and -// repetition count ("x{5,7}"), among others. -// -// Below is the syntax that we do support. We chose it to be a -// subset of both PCRE and POSIX extended regex, so it's easy to -// learn wherever you come from. In the following: 'A' denotes a -// literal character, period (.), or a single \\ escape sequence; -// 'x' and 'y' denote regular expressions; 'm' and 'n' are for -// natural numbers. -// -// c matches any literal character c -// \\d matches any decimal digit -// \\D matches any character that's not a decimal digit -// \\f matches \f -// \\n matches \n -// \\r matches \r -// \\s matches any ASCII whitespace, including \n -// \\S matches any character that's not a whitespace -// \\t matches \t -// \\v matches \v -// \\w matches any letter, _, or decimal digit -// \\W matches any character that \\w doesn't match -// \\c matches any literal character c, which must be a punctuation -// . matches any single character except \n -// A? matches 0 or 1 occurrences of A -// A* matches 0 or many occurrences of A -// A+ matches 1 or many occurrences of A -// ^ matches the beginning of a string (not that of each line) -// $ matches the end of a string (not that of each line) -// xy matches x followed by y -// -// If you accidentally use PCRE or POSIX extended regex features -// not implemented by us, you will get a run-time failure. In that -// case, please try to rewrite your regular expression within the -// above syntax. -// -// This implementation is *not* meant to be as highly tuned or robust -// as a compiled regex library, but should perform well enough for a -// death test, which already incurs significant overhead by launching -// a child process. -// -// Known caveats: -// -// A "threadsafe" style death test obtains the path to the test -// program from argv[0] and re-executes it in the sub-process. For -// simplicity, the current implementation doesn't search the PATH -// when launching the sub-process. This means that the user must -// invoke the test program via a path that contains at least one -// path separator (e.g. path/to/foo_test and -// /absolute/path/to/bar_test are fine, but foo_test is not). This -// is rarely a problem as people usually don't put the test binary -// directory in PATH. -// -// TODO(wan@google.com): make thread-safe death tests search the PATH. - -// Asserts that a given statement causes the program to exit, with an -// integer exit status that satisfies predicate, and emitting error output -// that matches regex. -# define ASSERT_EXIT(statement, predicate, regex) \ - GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_) - -// Like ASSERT_EXIT, but continues on to successive tests in the -// test case, if any: -# define EXPECT_EXIT(statement, predicate, regex) \ - GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_) - -// Asserts that a given statement causes the program to exit, either by -// explicitly exiting with a nonzero exit code or being killed by a -// signal, and emitting error output that matches regex. -# define ASSERT_DEATH(statement, regex) \ - ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) - -// Like ASSERT_DEATH, but continues on to successive tests in the -// test case, if any: -# define EXPECT_DEATH(statement, regex) \ - EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex) - -// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*: - -// Tests that an exit code describes a normal exit with a given exit code. -class GTEST_API_ ExitedWithCode { - public: - explicit ExitedWithCode(int exit_code); - bool operator()(int exit_status) const; - private: - // No implementation - assignment is unsupported. - void operator=(const ExitedWithCode& other); - - const int exit_code_; -}; - -# if !GTEST_OS_WINDOWS -// Tests that an exit code describes an exit due to termination by a -// given signal. -class GTEST_API_ KilledBySignal { - public: - explicit KilledBySignal(int signum); - bool operator()(int exit_status) const; - private: - const int signum_; -}; -# endif // !GTEST_OS_WINDOWS - -// EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode. -// The death testing framework causes this to have interesting semantics, -// since the sideeffects of the call are only visible in opt mode, and not -// in debug mode. -// -// In practice, this can be used to test functions that utilize the -// LOG(DFATAL) macro using the following style: -// -// int DieInDebugOr12(int* sideeffect) { -// if (sideeffect) { -// *sideeffect = 12; -// } -// LOG(DFATAL) << "death"; -// return 12; -// } -// -// TEST(TestCase, TestDieOr12WorksInDgbAndOpt) { -// int sideeffect = 0; -// // Only asserts in dbg. -// EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death"); -// -// #ifdef NDEBUG -// // opt-mode has sideeffect visible. -// EXPECT_EQ(12, sideeffect); -// #else -// // dbg-mode no visible sideeffect. -// EXPECT_EQ(0, sideeffect); -// #endif -// } -// -// This will assert that DieInDebugReturn12InOpt() crashes in debug -// mode, usually due to a DCHECK or LOG(DFATAL), but returns the -// appropriate fallback value (12 in this case) in opt mode. If you -// need to test that a function has appropriate side-effects in opt -// mode, include assertions against the side-effects. A general -// pattern for this is: -// -// EXPECT_DEBUG_DEATH({ -// // Side-effects here will have an effect after this statement in -// // opt mode, but none in debug mode. -// EXPECT_EQ(12, DieInDebugOr12(&sideeffect)); -// }, "death"); -// -# ifdef NDEBUG - -# define EXPECT_DEBUG_DEATH(statement, regex) \ - GTEST_EXECUTE_STATEMENT_(statement, regex) - -# define ASSERT_DEBUG_DEATH(statement, regex) \ - GTEST_EXECUTE_STATEMENT_(statement, regex) - -# else - -# define EXPECT_DEBUG_DEATH(statement, regex) \ - EXPECT_DEATH(statement, regex) - -# define ASSERT_DEBUG_DEATH(statement, regex) \ - ASSERT_DEATH(statement, regex) - -# endif // NDEBUG for EXPECT_DEBUG_DEATH -#endif // GTEST_HAS_DEATH_TEST - -// EXPECT_DEATH_IF_SUPPORTED(statement, regex) and -// ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if -// death tests are supported; otherwise they just issue a warning. This is -// useful when you are combining death test assertions with normal test -// assertions in one test. -#if GTEST_HAS_DEATH_TEST -# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \ - EXPECT_DEATH(statement, regex) -# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \ - ASSERT_DEATH(statement, regex) -#else -# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \ - GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, ) -# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \ - GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, return) -#endif - -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_ -// This file was GENERATED by command: -// pump.py gtest-param-test.h.pump -// DO NOT EDIT BY HAND!!! - -// Copyright 2008, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. 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. -// -// Authors: vladl@google.com (Vlad Losev) -// -// Macros and functions for implementing parameterized tests -// in Google C++ Testing Framework (Google Test) -// -// This file is generated by a SCRIPT. DO NOT EDIT BY HAND! -// -#ifndef GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ -#define GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ - - -// Value-parameterized tests allow you to test your code with different -// parameters without writing multiple copies of the same test. -// -// Here is how you use value-parameterized tests: - -#if 0 - -// To write value-parameterized tests, first you should define a fixture -// class. It is usually derived from testing::TestWithParam (see below for -// another inheritance scheme that's sometimes useful in more complicated -// class hierarchies), where the type of your parameter values. -// TestWithParam is itself derived from testing::Test. T can be any -// copyable type. If it's a raw pointer, you are responsible for managing the -// lifespan of the pointed values. - -class FooTest : public ::testing::TestWithParam { - // You can implement all the usual class fixture members here. -}; - -// Then, use the TEST_P macro to define as many parameterized tests -// for this fixture as you want. The _P suffix is for "parameterized" -// or "pattern", whichever you prefer to think. - -TEST_P(FooTest, DoesBlah) { - // Inside a test, access the test parameter with the GetParam() method - // of the TestWithParam class: - EXPECT_TRUE(foo.Blah(GetParam())); - ... -} - -TEST_P(FooTest, HasBlahBlah) { - ... -} - -// Finally, you can use INSTANTIATE_TEST_CASE_P to instantiate the test -// case with any set of parameters you want. Google Test defines a number -// of functions for generating test parameters. They return what we call -// (surprise!) parameter generators. Here is a summary of them, which -// are all in the testing namespace: -// -// -// Range(begin, end [, step]) - Yields values {begin, begin+step, -// begin+step+step, ...}. The values do not -// include end. step defaults to 1. -// Values(v1, v2, ..., vN) - Yields values {v1, v2, ..., vN}. -// ValuesIn(container) - Yields values from a C-style array, an STL -// ValuesIn(begin,end) container, or an iterator range [begin, end). -// Bool() - Yields sequence {false, true}. -// Combine(g1, g2, ..., gN) - Yields all combinations (the Cartesian product -// for the math savvy) of the values generated -// by the N generators. -// -// For more details, see comments at the definitions of these functions below -// in this file. -// -// The following statement will instantiate tests from the FooTest test case -// each with parameter values "meeny", "miny", and "moe". - -INSTANTIATE_TEST_CASE_P(InstantiationName, - FooTest, - Values("meeny", "miny", "moe")); - -// To distinguish different instances of the pattern, (yes, you -// can instantiate it more then once) the first argument to the -// INSTANTIATE_TEST_CASE_P macro is a prefix that will be added to the -// actual test case name. Remember to pick unique prefixes for different -// instantiations. The tests from the instantiation above will have -// these names: -// -// * InstantiationName/FooTest.DoesBlah/0 for "meeny" -// * InstantiationName/FooTest.DoesBlah/1 for "miny" -// * InstantiationName/FooTest.DoesBlah/2 for "moe" -// * InstantiationName/FooTest.HasBlahBlah/0 for "meeny" -// * InstantiationName/FooTest.HasBlahBlah/1 for "miny" -// * InstantiationName/FooTest.HasBlahBlah/2 for "moe" -// -// You can use these names in --gtest_filter. -// -// This statement will instantiate all tests from FooTest again, each -// with parameter values "cat" and "dog": - -const char* pets[] = {"cat", "dog"}; -INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest, ValuesIn(pets)); - -// The tests from the instantiation above will have these names: -// -// * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat" -// * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog" -// * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat" -// * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog" -// -// Please note that INSTANTIATE_TEST_CASE_P will instantiate all tests -// in the given test case, whether their definitions come before or -// AFTER the INSTANTIATE_TEST_CASE_P statement. -// -// Please also note that generator expressions (including parameters to the -// generators) are evaluated in InitGoogleTest(), after main() has started. -// This allows the user on one hand, to adjust generator parameters in order -// to dynamically determine a set of tests to run and on the other hand, -// give the user a chance to inspect the generated tests with Google Test -// reflection API before RUN_ALL_TESTS() is executed. -// -// You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc -// for more examples. -// -// In the future, we plan to publish the API for defining new parameter -// generators. But for now this interface remains part of the internal -// implementation and is subject to change. -// -// -// A parameterized test fixture must be derived from testing::Test and from -// testing::WithParamInterface, where T is the type of the parameter -// values. Inheriting from TestWithParam satisfies that requirement because -// TestWithParam inherits from both Test and WithParamInterface. In more -// complicated hierarchies, however, it is occasionally useful to inherit -// separately from Test and WithParamInterface. For example: - -class BaseTest : public ::testing::Test { - // You can inherit all the usual members for a non-parameterized test - // fixture here. -}; - -class DerivedTest : public BaseTest, public ::testing::WithParamInterface { - // The usual test fixture members go here too. -}; - -TEST_F(BaseTest, HasFoo) { - // This is an ordinary non-parameterized test. -} - -TEST_P(DerivedTest, DoesBlah) { - // GetParam works just the same here as if you inherit from TestWithParam. - EXPECT_TRUE(foo.Blah(GetParam())); -} - -#endif // 0 - - -#if !GTEST_OS_SYMBIAN -# include -#endif - -// scripts/fuse_gtest.py depends on gtest's own header being #included -// *unconditionally*. Therefore these #includes cannot be moved -// inside #if GTEST_HAS_PARAM_TEST. -// Copyright 2008 Google Inc. -// All Rights Reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. 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. -// -// Author: vladl@google.com (Vlad Losev) - -// Type and function utilities for implementing parameterized tests. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_ - -#include -#include -#include - -// scripts/fuse_gtest.py depends on gtest's own header being #included -// *unconditionally*. Therefore these #includes cannot be moved -// inside #if GTEST_HAS_PARAM_TEST. -// Copyright 2003 Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. 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. -// -// Authors: Dan Egnor (egnor@google.com) -// -// A "smart" pointer type with reference tracking. Every pointer to a -// particular object is kept on a circular linked list. When the last pointer -// to an object is destroyed or reassigned, the object is deleted. -// -// Used properly, this deletes the object when the last reference goes away. -// There are several caveats: -// - Like all reference counting schemes, cycles lead to leaks. -// - Each smart pointer is actually two pointers (8 bytes instead of 4). -// - Every time a pointer is assigned, the entire list of pointers to that -// object is traversed. This class is therefore NOT SUITABLE when there -// will often be more than two or three pointers to a particular object. -// - References are only tracked as long as linked_ptr<> objects are copied. -// If a linked_ptr<> is converted to a raw pointer and back, BAD THINGS -// will happen (double deletion). -// -// A good use of this class is storing object references in STL containers. -// You can safely put linked_ptr<> in a vector<>. -// Other uses may not be as good. -// -// Note: If you use an incomplete type with linked_ptr<>, the class -// *containing* linked_ptr<> must have a constructor and destructor (even -// if they do nothing!). -// -// Bill Gibbons suggested we use something like this. -// -// Thread Safety: -// Unlike other linked_ptr implementations, in this implementation -// a linked_ptr object is thread-safe in the sense that: -// - it's safe to copy linked_ptr objects concurrently, -// - it's safe to copy *from* a linked_ptr and read its underlying -// raw pointer (e.g. via get()) concurrently, and -// - it's safe to write to two linked_ptrs that point to the same -// shared object concurrently. -// TODO(wan@google.com): rename this to safe_linked_ptr to avoid -// confusion with normal linked_ptr. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_ - -#include -#include - - -namespace testing { -namespace internal { - -// Protects copying of all linked_ptr objects. -GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_linked_ptr_mutex); - -// This is used internally by all instances of linked_ptr<>. It needs to be -// a non-template class because different types of linked_ptr<> can refer to -// the same object (linked_ptr(obj) vs linked_ptr(obj)). -// So, it needs to be possible for different types of linked_ptr to participate -// in the same circular linked list, so we need a single class type here. -// -// DO NOT USE THIS CLASS DIRECTLY YOURSELF. Use linked_ptr. -class linked_ptr_internal { - public: - // Create a new circle that includes only this instance. - void join_new() { - next_ = this; - } - - // Many linked_ptr operations may change p.link_ for some linked_ptr - // variable p in the same circle as this object. Therefore we need - // to prevent two such operations from occurring concurrently. - // - // Note that different types of linked_ptr objects can coexist in a - // circle (e.g. linked_ptr, linked_ptr, and - // linked_ptr). Therefore we must use a single mutex to - // protect all linked_ptr objects. This can create serious - // contention in production code, but is acceptable in a testing - // framework. - - // Join an existing circle. - void join(linked_ptr_internal const* ptr) - GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) { - MutexLock lock(&g_linked_ptr_mutex); - - linked_ptr_internal const* p = ptr; - while (p->next_ != ptr) p = p->next_; - p->next_ = this; - next_ = ptr; - } - - // Leave whatever circle we're part of. Returns true if we were the - // last member of the circle. Once this is done, you can join() another. - bool depart() - GTEST_LOCK_EXCLUDED_(g_linked_ptr_mutex) { - MutexLock lock(&g_linked_ptr_mutex); - - if (next_ == this) return true; - linked_ptr_internal const* p = next_; - while (p->next_ != this) p = p->next_; - p->next_ = next_; - return false; - } - - private: - mutable linked_ptr_internal const* next_; -}; - -template -class linked_ptr { - public: - typedef T element_type; - - // Take over ownership of a raw pointer. This should happen as soon as - // possible after the object is created. - explicit linked_ptr(T* ptr = NULL) { capture(ptr); } - ~linked_ptr() { depart(); } - - // Copy an existing linked_ptr<>, adding ourselves to the list of references. - template linked_ptr(linked_ptr const& ptr) { copy(&ptr); } - linked_ptr(linked_ptr const& ptr) { // NOLINT - assert(&ptr != this); - copy(&ptr); - } - - // Assignment releases the old value and acquires the new. - template linked_ptr& operator=(linked_ptr const& ptr) { - depart(); - copy(&ptr); - return *this; - } - - linked_ptr& operator=(linked_ptr const& ptr) { - if (&ptr != this) { - depart(); - copy(&ptr); - } - return *this; - } - - // Smart pointer members. - void reset(T* ptr = NULL) { - depart(); - capture(ptr); - } - T* get() const { return value_; } - T* operator->() const { return value_; } - T& operator*() const { return *value_; } - - bool operator==(T* p) const { return value_ == p; } - bool operator!=(T* p) const { return value_ != p; } - template - bool operator==(linked_ptr const& ptr) const { - return value_ == ptr.get(); - } - template - bool operator!=(linked_ptr const& ptr) const { - return value_ != ptr.get(); - } - - private: - template - friend class linked_ptr; - - T* value_; - linked_ptr_internal link_; - - void depart() { - if (link_.depart()) delete value_; - } - - void capture(T* ptr) { - value_ = ptr; - link_.join_new(); - } - - template void copy(linked_ptr const* ptr) { - value_ = ptr->get(); - if (value_) - link_.join(&ptr->link_); - else - link_.join_new(); - } -}; - -template inline -bool operator==(T* ptr, const linked_ptr& x) { - return ptr == x.get(); -} - -template inline -bool operator!=(T* ptr, const linked_ptr& x) { - return ptr != x.get(); -} - -// A function to convert T* into linked_ptr -// Doing e.g. make_linked_ptr(new FooBarBaz(arg)) is a shorter notation -// for linked_ptr >(new FooBarBaz(arg)) -template -linked_ptr make_linked_ptr(T* ptr) { - return linked_ptr(ptr); -} - -} // namespace internal -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_LINKED_PTR_H_ -// Copyright 2007, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. 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. -// -// Author: wan@google.com (Zhanyong Wan) - -// Google Test - The Google C++ Testing Framework -// -// This file implements a universal value printer that can print a -// value of any type T: -// -// void ::testing::internal::UniversalPrinter::Print(value, ostream_ptr); -// -// A user can teach this function how to print a class type T by -// defining either operator<<() or PrintTo() in the namespace that -// defines T. More specifically, the FIRST defined function in the -// following list will be used (assuming T is defined in namespace -// foo): -// -// 1. foo::PrintTo(const T&, ostream*) -// 2. operator<<(ostream&, const T&) defined in either foo or the -// global namespace. -// -// If none of the above is defined, it will print the debug string of -// the value if it is a protocol buffer, or print the raw bytes in the -// value otherwise. -// -// To aid debugging: when T is a reference type, the address of the -// value is also printed; when T is a (const) char pointer, both the -// pointer value and the NUL-terminated string it points to are -// printed. -// -// We also provide some convenient wrappers: -// -// // Prints a value to a string. For a (const or not) char -// // pointer, the NUL-terminated string (but not the pointer) is -// // printed. -// std::string ::testing::PrintToString(const T& value); -// -// // Prints a value tersely: for a reference type, the referenced -// // value (but not the address) is printed; for a (const or not) char -// // pointer, the NUL-terminated string (but not the pointer) is -// // printed. -// void ::testing::internal::UniversalTersePrint(const T& value, ostream*); -// -// // Prints value using the type inferred by the compiler. The difference -// // from UniversalTersePrint() is that this function prints both the -// // pointer and the NUL-terminated string for a (const or not) char pointer. -// void ::testing::internal::UniversalPrint(const T& value, ostream*); -// -// // Prints the fields of a tuple tersely to a string vector, one -// // element for each field. Tuple support must be enabled in -// // gtest-port.h. -// std::vector UniversalTersePrintTupleFieldsToStrings( -// const Tuple& value); -// -// Known limitation: -// -// The print primitives print the elements of an STL-style container -// using the compiler-inferred type of *iter where iter is a -// const_iterator of the container. When const_iterator is an input -// iterator but not a forward iterator, this inferred type may not -// match value_type, and the print output may be incorrect. In -// practice, this is rarely a problem as for most containers -// const_iterator is a forward iterator. We'll fix this if there's an -// actual need for it. Note that this fix cannot rely on value_type -// being defined as many user-defined container types don't have -// value_type. - -#ifndef GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_ -#define GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_ - -#include // NOLINT -#include -#include -#include -#include - -namespace testing { - -// Definitions in the 'internal' and 'internal2' name spaces are -// subject to change without notice. DO NOT USE THEM IN USER CODE! -namespace internal2 { - -// Prints the given number of bytes in the given object to the given -// ostream. -GTEST_API_ void PrintBytesInObjectTo(const unsigned char* obj_bytes, - size_t count, - ::std::ostream* os); - -// For selecting which printer to use when a given type has neither << -// nor PrintTo(). -enum TypeKind { - kProtobuf, // a protobuf type - kConvertibleToInteger, // a type implicitly convertible to BiggestInt - // (e.g. a named or unnamed enum type) - kOtherType // anything else -}; - -// TypeWithoutFormatter::PrintValue(value, os) is called -// by the universal printer to print a value of type T when neither -// operator<< nor PrintTo() is defined for T, where kTypeKind is the -// "kind" of T as defined by enum TypeKind. -template -class TypeWithoutFormatter { - public: - // This default version is called when kTypeKind is kOtherType. - static void PrintValue(const T& value, ::std::ostream* os) { - PrintBytesInObjectTo(reinterpret_cast(&value), - sizeof(value), os); - } -}; - -// We print a protobuf using its ShortDebugString() when the string -// doesn't exceed this many characters; otherwise we print it using -// DebugString() for better readability. -const size_t kProtobufOneLinerMaxLength = 50; - -template -class TypeWithoutFormatter { - public: - static void PrintValue(const T& value, ::std::ostream* os) { - const ::testing::internal::string short_str = value.ShortDebugString(); - const ::testing::internal::string pretty_str = - short_str.length() <= kProtobufOneLinerMaxLength ? - short_str : ("\n" + value.DebugString()); - *os << ("<" + pretty_str + ">"); - } -}; - -template -class TypeWithoutFormatter { - public: - // Since T has no << operator or PrintTo() but can be implicitly - // converted to BiggestInt, we print it as a BiggestInt. - // - // Most likely T is an enum type (either named or unnamed), in which - // case printing it as an integer is the desired behavior. In case - // T is not an enum, printing it as an integer is the best we can do - // given that it has no user-defined printer. - static void PrintValue(const T& value, ::std::ostream* os) { - const internal::BiggestInt kBigInt = value; - *os << kBigInt; - } -}; - -// Prints the given value to the given ostream. If the value is a -// protocol message, its debug string is printed; if it's an enum or -// of a type implicitly convertible to BiggestInt, it's printed as an -// integer; otherwise the bytes in the value are printed. This is -// what UniversalPrinter::Print() does when it knows nothing about -// type T and T has neither << operator nor PrintTo(). -// -// A user can override this behavior for a class type Foo by defining -// a << operator in the namespace where Foo is defined. -// -// We put this operator in namespace 'internal2' instead of 'internal' -// to simplify the implementation, as much code in 'internal' needs to -// use << in STL, which would conflict with our own << were it defined -// in 'internal'. -// -// Note that this operator<< takes a generic std::basic_ostream type instead of the more restricted std::ostream. If -// we define it to take an std::ostream instead, we'll get an -// "ambiguous overloads" compiler error when trying to print a type -// Foo that supports streaming to std::basic_ostream, as the compiler cannot tell whether -// operator<<(std::ostream&, const T&) or -// operator<<(std::basic_stream, const Foo&) is more -// specific. -template -::std::basic_ostream& operator<<( - ::std::basic_ostream& os, const T& x) { - TypeWithoutFormatter::value ? kProtobuf : - internal::ImplicitlyConvertible::value ? - kConvertibleToInteger : kOtherType)>::PrintValue(x, &os); - return os; -} - -} // namespace internal2 -} // namespace testing - -// This namespace MUST NOT BE NESTED IN ::testing, or the name look-up -// magic needed for implementing UniversalPrinter won't work. -namespace testing_internal { - -// Used to print a value that is not an STL-style container when the -// user doesn't define PrintTo() for it. -template -void DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) { - // With the following statement, during unqualified name lookup, - // testing::internal2::operator<< appears as if it was declared in - // the nearest enclosing namespace that contains both - // ::testing_internal and ::testing::internal2, i.e. the global - // namespace. For more details, refer to the C++ Standard section - // 7.3.4-1 [namespace.udir]. This allows us to fall back onto - // testing::internal2::operator<< in case T doesn't come with a << - // operator. - // - // We cannot write 'using ::testing::internal2::operator<<;', which - // gcc 3.3 fails to compile due to a compiler bug. - using namespace ::testing::internal2; // NOLINT - - // Assuming T is defined in namespace foo, in the next statement, - // the compiler will consider all of: - // - // 1. foo::operator<< (thanks to Koenig look-up), - // 2. ::operator<< (as the current namespace is enclosed in ::), - // 3. testing::internal2::operator<< (thanks to the using statement above). - // - // The operator<< whose type matches T best will be picked. - // - // We deliberately allow #2 to be a candidate, as sometimes it's - // impossible to define #1 (e.g. when foo is ::std, defining - // anything in it is undefined behavior unless you are a compiler - // vendor.). - *os << value; -} - -} // namespace testing_internal - -namespace testing { -namespace internal { - -// UniversalPrinter::Print(value, ostream_ptr) prints the given -// value to the given ostream. The caller must ensure that -// 'ostream_ptr' is not NULL, or the behavior is undefined. -// -// We define UniversalPrinter as a class template (as opposed to a -// function template), as we need to partially specialize it for -// reference types, which cannot be done with function templates. -template -class UniversalPrinter; - -template -void UniversalPrint(const T& value, ::std::ostream* os); - -// Used to print an STL-style container when the user doesn't define -// a PrintTo() for it. -template -void DefaultPrintTo(IsContainer /* dummy */, - false_type /* is not a pointer */, - const C& container, ::std::ostream* os) { - const size_t kMaxCount = 32; // The maximum number of elements to print. - *os << '{'; - size_t count = 0; - for (typename C::const_iterator it = container.begin(); - it != container.end(); ++it, ++count) { - if (count > 0) { - *os << ','; - if (count == kMaxCount) { // Enough has been printed. - *os << " ..."; - break; - } - } - *os << ' '; - // We cannot call PrintTo(*it, os) here as PrintTo() doesn't - // handle *it being a native array. - internal::UniversalPrint(*it, os); - } - - if (count > 0) { - *os << ' '; - } - *os << '}'; -} - -// Used to print a pointer that is neither a char pointer nor a member -// pointer, when the user doesn't define PrintTo() for it. (A member -// variable pointer or member function pointer doesn't really point to -// a location in the address space. Their representation is -// implementation-defined. Therefore they will be printed as raw -// bytes.) -template -void DefaultPrintTo(IsNotContainer /* dummy */, - true_type /* is a pointer */, - T* p, ::std::ostream* os) { - if (p == NULL) { - *os << "NULL"; - } else { - // C++ doesn't allow casting from a function pointer to any object - // pointer. - // - // IsTrue() silences warnings: "Condition is always true", - // "unreachable code". - if (IsTrue(ImplicitlyConvertible::value)) { - // T is not a function type. We just call << to print p, - // relying on ADL to pick up user-defined << for their pointer - // types, if any. - *os << p; - } else { - // T is a function type, so '*os << p' doesn't do what we want - // (it just prints p as bool). We want to print p as a const - // void*. However, we cannot cast it to const void* directly, - // even using reinterpret_cast, as earlier versions of gcc - // (e.g. 3.4.5) cannot compile the cast when p is a function - // pointer. Casting to UInt64 first solves the problem. - *os << reinterpret_cast( - reinterpret_cast(p)); - } - } -} - -// Used to print a non-container, non-pointer value when the user -// doesn't define PrintTo() for it. -template -void DefaultPrintTo(IsNotContainer /* dummy */, - false_type /* is not a pointer */, - const T& value, ::std::ostream* os) { - ::testing_internal::DefaultPrintNonContainerTo(value, os); -} - -// Prints the given value using the << operator if it has one; -// otherwise prints the bytes in it. This is what -// UniversalPrinter::Print() does when PrintTo() is not specialized -// or overloaded for type T. -// -// A user can override this behavior for a class type Foo by defining -// an overload of PrintTo() in the namespace where Foo is defined. We -// give the user this option as sometimes defining a << operator for -// Foo is not desirable (e.g. the coding style may prevent doing it, -// or there is already a << operator but it doesn't do what the user -// wants). -template -void PrintTo(const T& value, ::std::ostream* os) { - // DefaultPrintTo() is overloaded. The type of its first two - // arguments determine which version will be picked. If T is an - // STL-style container, the version for container will be called; if - // T is a pointer, the pointer version will be called; otherwise the - // generic version will be called. - // - // Note that we check for container types here, prior to we check - // for protocol message types in our operator<<. The rationale is: - // - // For protocol messages, we want to give people a chance to - // override Google Mock's format by defining a PrintTo() or - // operator<<. For STL containers, other formats can be - // incompatible with Google Mock's format for the container - // elements; therefore we check for container types here to ensure - // that our format is used. - // - // The second argument of DefaultPrintTo() is needed to bypass a bug - // in Symbian's C++ compiler that prevents it from picking the right - // overload between: - // - // PrintTo(const T& x, ...); - // PrintTo(T* x, ...); - DefaultPrintTo(IsContainerTest(0), is_pointer(), value, os); -} - -// The following list of PrintTo() overloads tells -// UniversalPrinter::Print() how to print standard types (built-in -// types, strings, plain arrays, and pointers). - -// Overloads for various char types. -GTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os); -GTEST_API_ void PrintTo(signed char c, ::std::ostream* os); -inline void PrintTo(char c, ::std::ostream* os) { - // When printing a plain char, we always treat it as unsigned. This - // way, the output won't be affected by whether the compiler thinks - // char is signed or not. - PrintTo(static_cast(c), os); -} - -// Overloads for other simple built-in types. -inline void PrintTo(bool x, ::std::ostream* os) { - *os << (x ? "true" : "false"); -} - -// Overload for wchar_t type. -// Prints a wchar_t as a symbol if it is printable or as its internal -// code otherwise and also as its decimal code (except for L'\0'). -// The L'\0' char is printed as "L'\\0'". The decimal code is printed -// as signed integer when wchar_t is implemented by the compiler -// as a signed type and is printed as an unsigned integer when wchar_t -// is implemented as an unsigned type. -GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os); - -// Overloads for C strings. -GTEST_API_ void PrintTo(const char* s, ::std::ostream* os); -inline void PrintTo(char* s, ::std::ostream* os) { - PrintTo(ImplicitCast_(s), os); -} - -// signed/unsigned char is often used for representing binary data, so -// we print pointers to it as void* to be safe. -inline void PrintTo(const signed char* s, ::std::ostream* os) { - PrintTo(ImplicitCast_(s), os); -} -inline void PrintTo(signed char* s, ::std::ostream* os) { - PrintTo(ImplicitCast_(s), os); -} -inline void PrintTo(const unsigned char* s, ::std::ostream* os) { - PrintTo(ImplicitCast_(s), os); -} -inline void PrintTo(unsigned char* s, ::std::ostream* os) { - PrintTo(ImplicitCast_(s), os); -} - -// MSVC can be configured to define wchar_t as a typedef of unsigned -// short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native -// type. When wchar_t is a typedef, defining an overload for const -// wchar_t* would cause unsigned short* be printed as a wide string, -// possibly causing invalid memory accesses. -#if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED) -// Overloads for wide C strings -GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os); -inline void PrintTo(wchar_t* s, ::std::ostream* os) { - PrintTo(ImplicitCast_(s), os); -} -#endif - -// Overload for C arrays. Multi-dimensional arrays are printed -// properly. - -// Prints the given number of elements in an array, without printing -// the curly braces. -template -void PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) { - UniversalPrint(a[0], os); - for (size_t i = 1; i != count; i++) { - *os << ", "; - UniversalPrint(a[i], os); - } -} - -// Overloads for ::string and ::std::string. -#if GTEST_HAS_GLOBAL_STRING -GTEST_API_ void PrintStringTo(const ::string&s, ::std::ostream* os); -inline void PrintTo(const ::string& s, ::std::ostream* os) { - PrintStringTo(s, os); -} -#endif // GTEST_HAS_GLOBAL_STRING - -GTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os); -inline void PrintTo(const ::std::string& s, ::std::ostream* os) { - PrintStringTo(s, os); -} - -// Overloads for ::wstring and ::std::wstring. -#if GTEST_HAS_GLOBAL_WSTRING -GTEST_API_ void PrintWideStringTo(const ::wstring&s, ::std::ostream* os); -inline void PrintTo(const ::wstring& s, ::std::ostream* os) { - PrintWideStringTo(s, os); -} -#endif // GTEST_HAS_GLOBAL_WSTRING - -#if GTEST_HAS_STD_WSTRING -GTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os); -inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) { - PrintWideStringTo(s, os); -} -#endif // GTEST_HAS_STD_WSTRING - -#if GTEST_HAS_TR1_TUPLE -// Overload for ::std::tr1::tuple. Needed for printing function arguments, -// which are packed as tuples. - -// Helper function for printing a tuple. T must be instantiated with -// a tuple type. -template -void PrintTupleTo(const T& t, ::std::ostream* os); - -// Overloaded PrintTo() for tuples of various arities. We support -// tuples of up-to 10 fields. The following implementation works -// regardless of whether tr1::tuple is implemented using the -// non-standard variadic template feature or not. - -inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, - ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, - ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, - ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, - ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo(const ::std::tr1::tuple& t, - ::std::ostream* os) { - PrintTupleTo(t, os); -} - -template -void PrintTo( - const ::std::tr1::tuple& t, - ::std::ostream* os) { - PrintTupleTo(t, os); -} -#endif // GTEST_HAS_TR1_TUPLE - -// Overload for std::pair. -template -void PrintTo(const ::std::pair& value, ::std::ostream* os) { - *os << '('; - // We cannot use UniversalPrint(value.first, os) here, as T1 may be - // a reference type. The same for printing value.second. - UniversalPrinter::Print(value.first, os); - *os << ", "; - UniversalPrinter::Print(value.second, os); - *os << ')'; -} - -// Implements printing a non-reference type T by letting the compiler -// pick the right overload of PrintTo() for T. -template -class UniversalPrinter { - public: - // MSVC warns about adding const to a function type, so we want to - // disable the warning. -#ifdef _MSC_VER -# pragma warning(push) // Saves the current warning state. -# pragma warning(disable:4180) // Temporarily disables warning 4180. -#endif // _MSC_VER - - // Note: we deliberately don't call this PrintTo(), as that name - // conflicts with ::testing::internal::PrintTo in the body of the - // function. - static void Print(const T& value, ::std::ostream* os) { - // By default, ::testing::internal::PrintTo() is used for printing - // the value. - // - // Thanks to Koenig look-up, if T is a class and has its own - // PrintTo() function defined in its namespace, that function will - // be visible here. Since it is more specific than the generic ones - // in ::testing::internal, it will be picked by the compiler in the - // following statement - exactly what we want. - PrintTo(value, os); - } - -#ifdef _MSC_VER -# pragma warning(pop) // Restores the warning state. -#endif // _MSC_VER -}; - -// UniversalPrintArray(begin, len, os) prints an array of 'len' -// elements, starting at address 'begin'. -template -void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) { - if (len == 0) { - *os << "{}"; - } else { - *os << "{ "; - const size_t kThreshold = 18; - const size_t kChunkSize = 8; - // If the array has more than kThreshold elements, we'll have to - // omit some details by printing only the first and the last - // kChunkSize elements. - // TODO(wan@google.com): let the user control the threshold using a flag. - if (len <= kThreshold) { - PrintRawArrayTo(begin, len, os); - } else { - PrintRawArrayTo(begin, kChunkSize, os); - *os << ", ..., "; - PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os); - } - *os << " }"; - } -} -// This overload prints a (const) char array compactly. -GTEST_API_ void UniversalPrintArray( - const char* begin, size_t len, ::std::ostream* os); - -// This overload prints a (const) wchar_t array compactly. -GTEST_API_ void UniversalPrintArray( - const wchar_t* begin, size_t len, ::std::ostream* os); - -// Implements printing an array type T[N]. -template -class UniversalPrinter { - public: - // Prints the given array, omitting some elements when there are too - // many. - static void Print(const T (&a)[N], ::std::ostream* os) { - UniversalPrintArray(a, N, os); - } -}; - -// Implements printing a reference type T&. -template -class UniversalPrinter { - public: - // MSVC warns about adding const to a function type, so we want to - // disable the warning. -#ifdef _MSC_VER -# pragma warning(push) // Saves the current warning state. -# pragma warning(disable:4180) // Temporarily disables warning 4180. -#endif // _MSC_VER - - static void Print(const T& value, ::std::ostream* os) { - // Prints the address of the value. We use reinterpret_cast here - // as static_cast doesn't compile when T is a function type. - *os << "@" << reinterpret_cast(&value) << " "; - - // Then prints the value itself. - UniversalPrint(value, os); - } - -#ifdef _MSC_VER -# pragma warning(pop) // Restores the warning state. -#endif // _MSC_VER -}; - -// Prints a value tersely: for a reference type, the referenced value -// (but not the address) is printed; for a (const) char pointer, the -// NUL-terminated string (but not the pointer) is printed. - -template -class UniversalTersePrinter { - public: - static void Print(const T& value, ::std::ostream* os) { - UniversalPrint(value, os); - } -}; -template -class UniversalTersePrinter { - public: - static void Print(const T& value, ::std::ostream* os) { - UniversalPrint(value, os); - } -}; -template -class UniversalTersePrinter { - public: - static void Print(const T (&value)[N], ::std::ostream* os) { - UniversalPrinter::Print(value, os); - } -}; -template <> -class UniversalTersePrinter { - public: - static void Print(const char* str, ::std::ostream* os) { - if (str == NULL) { - *os << "NULL"; - } else { - UniversalPrint(string(str), os); - } - } -}; -template <> -class UniversalTersePrinter { - public: - static void Print(char* str, ::std::ostream* os) { - UniversalTersePrinter::Print(str, os); - } -}; - -#if GTEST_HAS_STD_WSTRING -template <> -class UniversalTersePrinter { - public: - static void Print(const wchar_t* str, ::std::ostream* os) { - if (str == NULL) { - *os << "NULL"; - } else { - UniversalPrint(::std::wstring(str), os); - } - } -}; -#endif - -template <> -class UniversalTersePrinter { - public: - static void Print(wchar_t* str, ::std::ostream* os) { - UniversalTersePrinter::Print(str, os); - } -}; - -template -void UniversalTersePrint(const T& value, ::std::ostream* os) { - UniversalTersePrinter::Print(value, os); -} - -// Prints a value using the type inferred by the compiler. The -// difference between this and UniversalTersePrint() is that for a -// (const) char pointer, this prints both the pointer and the -// NUL-terminated string. -template -void UniversalPrint(const T& value, ::std::ostream* os) { - // A workarond for the bug in VC++ 7.1 that prevents us from instantiating - // UniversalPrinter with T directly. - typedef T T1; - UniversalPrinter::Print(value, os); -} - -#if GTEST_HAS_TR1_TUPLE -typedef ::std::vector Strings; - -// This helper template allows PrintTo() for tuples and -// UniversalTersePrintTupleFieldsToStrings() to be defined by -// induction on the number of tuple fields. The idea is that -// TuplePrefixPrinter::PrintPrefixTo(t, os) prints the first N -// fields in tuple t, and can be defined in terms of -// TuplePrefixPrinter. - -// The inductive case. -template -struct TuplePrefixPrinter { - // Prints the first N fields of a tuple. - template - static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) { - TuplePrefixPrinter::PrintPrefixTo(t, os); - *os << ", "; - UniversalPrinter::type> - ::Print(::std::tr1::get(t), os); - } - - // Tersely prints the first N fields of a tuple to a string vector, - // one element for each field. - template - static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) { - TuplePrefixPrinter::TersePrintPrefixToStrings(t, strings); - ::std::stringstream ss; - UniversalTersePrint(::std::tr1::get(t), &ss); - strings->push_back(ss.str()); - } -}; - -// Base cases. -template <> -struct TuplePrefixPrinter<0> { - template - static void PrintPrefixTo(const Tuple&, ::std::ostream*) {} - - template - static void TersePrintPrefixToStrings(const Tuple&, Strings*) {} -}; -// We have to specialize the entire TuplePrefixPrinter<> class -// template here, even though the definition of -// TersePrintPrefixToStrings() is the same as the generic version, as -// Embarcadero (formerly CodeGear, formerly Borland) C++ doesn't -// support specializing a method template of a class template. -template <> -struct TuplePrefixPrinter<1> { - template - static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) { - UniversalPrinter::type>:: - Print(::std::tr1::get<0>(t), os); - } - - template - static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) { - ::std::stringstream ss; - UniversalTersePrint(::std::tr1::get<0>(t), &ss); - strings->push_back(ss.str()); - } -}; - -// Helper function for printing a tuple. T must be instantiated with -// a tuple type. -template -void PrintTupleTo(const T& t, ::std::ostream* os) { - *os << "("; - TuplePrefixPrinter< ::std::tr1::tuple_size::value>:: - PrintPrefixTo(t, os); - *os << ")"; -} - -// Prints the fields of a tuple tersely to a string vector, one -// element for each field. See the comment before -// UniversalTersePrint() for how we define "tersely". -template -Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) { - Strings result; - TuplePrefixPrinter< ::std::tr1::tuple_size::value>:: - TersePrintPrefixToStrings(value, &result); - return result; -} -#endif // GTEST_HAS_TR1_TUPLE - -} // namespace internal - -template -::std::string PrintToString(const T& value) { - ::std::stringstream ss; - internal::UniversalTersePrinter::Print(value, &ss); - return ss.str(); -} - -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_ - -#if GTEST_HAS_PARAM_TEST - -namespace testing { -namespace internal { - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Outputs a message explaining invalid registration of different -// fixture class for the same test case. This may happen when -// TEST_P macro is used to define two tests with the same name -// but in different namespaces. -GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name, - const char* file, int line); - -template class ParamGeneratorInterface; -template class ParamGenerator; - -// Interface for iterating over elements provided by an implementation -// of ParamGeneratorInterface. -template -class ParamIteratorInterface { - public: - virtual ~ParamIteratorInterface() {} - // A pointer to the base generator instance. - // Used only for the purposes of iterator comparison - // to make sure that two iterators belong to the same generator. - virtual const ParamGeneratorInterface* BaseGenerator() const = 0; - // Advances iterator to point to the next element - // provided by the generator. The caller is responsible - // for not calling Advance() on an iterator equal to - // BaseGenerator()->End(). - virtual void Advance() = 0; - // Clones the iterator object. Used for implementing copy semantics - // of ParamIterator. - virtual ParamIteratorInterface* Clone() const = 0; - // Dereferences the current iterator and provides (read-only) access - // to the pointed value. It is the caller's responsibility not to call - // Current() on an iterator equal to BaseGenerator()->End(). - // Used for implementing ParamGenerator::operator*(). - virtual const T* Current() const = 0; - // Determines whether the given iterator and other point to the same - // element in the sequence generated by the generator. - // Used for implementing ParamGenerator::operator==(). - virtual bool Equals(const ParamIteratorInterface& other) const = 0; -}; - -// Class iterating over elements provided by an implementation of -// ParamGeneratorInterface. It wraps ParamIteratorInterface -// and implements the const forward iterator concept. -template -class ParamIterator { - public: - typedef T value_type; - typedef const T& reference; - typedef ptrdiff_t difference_type; - - // ParamIterator assumes ownership of the impl_ pointer. - ParamIterator(const ParamIterator& other) : impl_(other.impl_->Clone()) {} - ParamIterator& operator=(const ParamIterator& other) { - if (this != &other) - impl_.reset(other.impl_->Clone()); - return *this; - } - - const T& operator*() const { return *impl_->Current(); } - const T* operator->() const { return impl_->Current(); } - // Prefix version of operator++. - ParamIterator& operator++() { - impl_->Advance(); - return *this; - } - // Postfix version of operator++. - ParamIterator operator++(int /*unused*/) { - ParamIteratorInterface* clone = impl_->Clone(); - impl_->Advance(); - return ParamIterator(clone); - } - bool operator==(const ParamIterator& other) const { - return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_); - } - bool operator!=(const ParamIterator& other) const { - return !(*this == other); - } - - private: - friend class ParamGenerator; - explicit ParamIterator(ParamIteratorInterface* impl) : impl_(impl) {} - scoped_ptr > impl_; -}; - -// ParamGeneratorInterface is the binary interface to access generators -// defined in other translation units. -template -class ParamGeneratorInterface { - public: - typedef T ParamType; - - virtual ~ParamGeneratorInterface() {} - - // Generator interface definition - virtual ParamIteratorInterface* Begin() const = 0; - virtual ParamIteratorInterface* End() const = 0; -}; - -// Wraps ParamGeneratorInterface and provides general generator syntax -// compatible with the STL Container concept. -// This class implements copy initialization semantics and the contained -// ParamGeneratorInterface instance is shared among all copies -// of the original object. This is possible because that instance is immutable. -template -class ParamGenerator { - public: - typedef ParamIterator iterator; - - explicit ParamGenerator(ParamGeneratorInterface* impl) : impl_(impl) {} - ParamGenerator(const ParamGenerator& other) : impl_(other.impl_) {} - - ParamGenerator& operator=(const ParamGenerator& other) { - impl_ = other.impl_; - return *this; - } - - iterator begin() const { return iterator(impl_->Begin()); } - iterator end() const { return iterator(impl_->End()); } - - private: - linked_ptr > impl_; -}; - -// Generates values from a range of two comparable values. Can be used to -// generate sequences of user-defined types that implement operator+() and -// operator<(). -// This class is used in the Range() function. -template -class RangeGenerator : public ParamGeneratorInterface { - public: - RangeGenerator(T begin, T end, IncrementT step) - : begin_(begin), end_(end), - step_(step), end_index_(CalculateEndIndex(begin, end, step)) {} - virtual ~RangeGenerator() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, begin_, 0, step_); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, end_, end_index_, step_); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, T value, int index, - IncrementT step) - : base_(base), value_(value), index_(index), step_(step) {} - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - virtual void Advance() { - value_ = value_ + step_; - index_++; - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const T* Current() const { return &value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const int other_index = - CheckedDowncastToActualType(&other)->index_; - return index_ == other_index; - } - - private: - Iterator(const Iterator& other) - : ParamIteratorInterface(), - base_(other.base_), value_(other.value_), index_(other.index_), - step_(other.step_) {} - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - T value_; - int index_; - const IncrementT step_; - }; // class RangeGenerator::Iterator - - static int CalculateEndIndex(const T& begin, - const T& end, - const IncrementT& step) { - int end_index = 0; - for (T i = begin; i < end; i = i + step) - end_index++; - return end_index; - } - - // No implementation - assignment is unsupported. - void operator=(const RangeGenerator& other); - - const T begin_; - const T end_; - const IncrementT step_; - // The index for the end() iterator. All the elements in the generated - // sequence are indexed (0-based) to aid iterator comparison. - const int end_index_; -}; // class RangeGenerator - - -// Generates values from a pair of STL-style iterators. Used in the -// ValuesIn() function. The elements are copied from the source range -// since the source can be located on the stack, and the generator -// is likely to persist beyond that stack frame. -template -class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface { - public: - template - ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end) - : container_(begin, end) {} - virtual ~ValuesInIteratorRangeGenerator() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, container_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, container_.end()); - } - - private: - typedef typename ::std::vector ContainerType; - - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - typename ContainerType::const_iterator iterator) - : base_(base), iterator_(iterator) {} - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - virtual void Advance() { - ++iterator_; - value_.reset(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - // We need to use cached value referenced by iterator_ because *iterator_ - // can return a temporary object (and of type other then T), so just - // having "return &*iterator_;" doesn't work. - // value_ is updated here and not in Advance() because Advance() - // can advance iterator_ beyond the end of the range, and we cannot - // detect that fact. The client code, on the other hand, is - // responsible for not calling Current() on an out-of-range iterator. - virtual const T* Current() const { - if (value_.get() == NULL) - value_.reset(new T(*iterator_)); - return value_.get(); - } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - return iterator_ == - CheckedDowncastToActualType(&other)->iterator_; - } - - private: - Iterator(const Iterator& other) - // The explicit constructor call suppresses a false warning - // emitted by gcc when supplied with the -Wextra option. - : ParamIteratorInterface(), - base_(other.base_), - iterator_(other.iterator_) {} - - const ParamGeneratorInterface* const base_; - typename ContainerType::const_iterator iterator_; - // A cached value of *iterator_. We keep it here to allow access by - // pointer in the wrapping iterator's operator->(). - // value_ needs to be mutable to be accessed in Current(). - // Use of scoped_ptr helps manage cached value's lifetime, - // which is bound by the lifespan of the iterator itself. - mutable scoped_ptr value_; - }; // class ValuesInIteratorRangeGenerator::Iterator - - // No implementation - assignment is unsupported. - void operator=(const ValuesInIteratorRangeGenerator& other); - - const ContainerType container_; -}; // class ValuesInIteratorRangeGenerator - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Stores a parameter value and later creates tests parameterized with that -// value. -template -class ParameterizedTestFactory : public TestFactoryBase { - public: - typedef typename TestClass::ParamType ParamType; - explicit ParameterizedTestFactory(ParamType parameter) : - parameter_(parameter) {} - virtual Test* CreateTest() { - TestClass::SetParam(¶meter_); - return new TestClass(); - } - - private: - const ParamType parameter_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestFactory); -}; - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// TestMetaFactoryBase is a base class for meta-factories that create -// test factories for passing into MakeAndRegisterTestInfo function. -template -class TestMetaFactoryBase { - public: - virtual ~TestMetaFactoryBase() {} - - virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0; -}; - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// TestMetaFactory creates test factories for passing into -// MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives -// ownership of test factory pointer, same factory object cannot be passed -// into that method twice. But ParameterizedTestCaseInfo is going to call -// it for each Test/Parameter value combination. Thus it needs meta factory -// creator class. -template -class TestMetaFactory - : public TestMetaFactoryBase { - public: - typedef typename TestCase::ParamType ParamType; - - TestMetaFactory() {} - - virtual TestFactoryBase* CreateTestFactory(ParamType parameter) { - return new ParameterizedTestFactory(parameter); - } - - private: - GTEST_DISALLOW_COPY_AND_ASSIGN_(TestMetaFactory); -}; - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// ParameterizedTestCaseInfoBase is a generic interface -// to ParameterizedTestCaseInfo classes. ParameterizedTestCaseInfoBase -// accumulates test information provided by TEST_P macro invocations -// and generators provided by INSTANTIATE_TEST_CASE_P macro invocations -// and uses that information to register all resulting test instances -// in RegisterTests method. The ParameterizeTestCaseRegistry class holds -// a collection of pointers to the ParameterizedTestCaseInfo objects -// and calls RegisterTests() on each of them when asked. -class ParameterizedTestCaseInfoBase { - public: - virtual ~ParameterizedTestCaseInfoBase() {} - - // Base part of test case name for display purposes. - virtual const string& GetTestCaseName() const = 0; - // Test case id to verify identity. - virtual TypeId GetTestCaseTypeId() const = 0; - // UnitTest class invokes this method to register tests in this - // test case right before running them in RUN_ALL_TESTS macro. - // This method should not be called more then once on any single - // instance of a ParameterizedTestCaseInfoBase derived class. - virtual void RegisterTests() = 0; - - protected: - ParameterizedTestCaseInfoBase() {} - - private: - GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfoBase); -}; - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// ParameterizedTestCaseInfo accumulates tests obtained from TEST_P -// macro invocations for a particular test case and generators -// obtained from INSTANTIATE_TEST_CASE_P macro invocations for that -// test case. It registers tests with all values generated by all -// generators when asked. -template -class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase { - public: - // ParamType and GeneratorCreationFunc are private types but are required - // for declarations of public methods AddTestPattern() and - // AddTestCaseInstantiation(). - typedef typename TestCase::ParamType ParamType; - // A function that returns an instance of appropriate generator type. - typedef ParamGenerator(GeneratorCreationFunc)(); - - explicit ParameterizedTestCaseInfo(const char* name) - : test_case_name_(name) {} - - // Test case base name for display purposes. - virtual const string& GetTestCaseName() const { return test_case_name_; } - // Test case id to verify identity. - virtual TypeId GetTestCaseTypeId() const { return GetTypeId(); } - // TEST_P macro uses AddTestPattern() to record information - // about a single test in a LocalTestInfo structure. - // test_case_name is the base name of the test case (without invocation - // prefix). test_base_name is the name of an individual test without - // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is - // test case base name and DoBar is test base name. - void AddTestPattern(const char* test_case_name, - const char* test_base_name, - TestMetaFactoryBase* meta_factory) { - tests_.push_back(linked_ptr(new TestInfo(test_case_name, - test_base_name, - meta_factory))); - } - // INSTANTIATE_TEST_CASE_P macro uses AddGenerator() to record information - // about a generator. - int AddTestCaseInstantiation(const string& instantiation_name, - GeneratorCreationFunc* func, - const char* /* file */, - int /* line */) { - instantiations_.push_back(::std::make_pair(instantiation_name, func)); - return 0; // Return value used only to run this method in namespace scope. - } - // UnitTest class invokes this method to register tests in this test case - // test cases right before running tests in RUN_ALL_TESTS macro. - // This method should not be called more then once on any single - // instance of a ParameterizedTestCaseInfoBase derived class. - // UnitTest has a guard to prevent from calling this method more then once. - virtual void RegisterTests() { - for (typename TestInfoContainer::iterator test_it = tests_.begin(); - test_it != tests_.end(); ++test_it) { - linked_ptr test_info = *test_it; - for (typename InstantiationContainer::iterator gen_it = - instantiations_.begin(); gen_it != instantiations_.end(); - ++gen_it) { - const string& instantiation_name = gen_it->first; - ParamGenerator generator((*gen_it->second)()); - - string test_case_name; - if ( !instantiation_name.empty() ) - test_case_name = instantiation_name + "/"; - test_case_name += test_info->test_case_base_name; - - int i = 0; - for (typename ParamGenerator::iterator param_it = - generator.begin(); - param_it != generator.end(); ++param_it, ++i) { - Message test_name_stream; - test_name_stream << test_info->test_base_name << "/" << i; - MakeAndRegisterTestInfo( - test_case_name.c_str(), - test_name_stream.GetString().c_str(), - NULL, // No type parameter. - PrintToString(*param_it).c_str(), - GetTestCaseTypeId(), - TestCase::SetUpTestCase, - TestCase::TearDownTestCase, - test_info->test_meta_factory->CreateTestFactory(*param_it)); - } // for param_it - } // for gen_it - } // for test_it - } // RegisterTests - - private: - // LocalTestInfo structure keeps information about a single test registered - // with TEST_P macro. - struct TestInfo { - TestInfo(const char* a_test_case_base_name, - const char* a_test_base_name, - TestMetaFactoryBase* a_test_meta_factory) : - test_case_base_name(a_test_case_base_name), - test_base_name(a_test_base_name), - test_meta_factory(a_test_meta_factory) {} - - const string test_case_base_name; - const string test_base_name; - const scoped_ptr > test_meta_factory; - }; - typedef ::std::vector > TestInfoContainer; - // Keeps pairs of - // received from INSTANTIATE_TEST_CASE_P macros. - typedef ::std::vector > - InstantiationContainer; - - const string test_case_name_; - TestInfoContainer tests_; - InstantiationContainer instantiations_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseInfo); -}; // class ParameterizedTestCaseInfo - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// ParameterizedTestCaseRegistry contains a map of ParameterizedTestCaseInfoBase -// classes accessed by test case names. TEST_P and INSTANTIATE_TEST_CASE_P -// macros use it to locate their corresponding ParameterizedTestCaseInfo -// descriptors. -class ParameterizedTestCaseRegistry { - public: - ParameterizedTestCaseRegistry() {} - ~ParameterizedTestCaseRegistry() { - for (TestCaseInfoContainer::iterator it = test_case_infos_.begin(); - it != test_case_infos_.end(); ++it) { - delete *it; - } - } - - // Looks up or creates and returns a structure containing information about - // tests and instantiations of a particular test case. - template - ParameterizedTestCaseInfo* GetTestCasePatternHolder( - const char* test_case_name, - const char* file, - int line) { - ParameterizedTestCaseInfo* typed_test_info = NULL; - for (TestCaseInfoContainer::iterator it = test_case_infos_.begin(); - it != test_case_infos_.end(); ++it) { - if ((*it)->GetTestCaseName() == test_case_name) { - if ((*it)->GetTestCaseTypeId() != GetTypeId()) { - // Complain about incorrect usage of Google Test facilities - // and terminate the program since we cannot guaranty correct - // test case setup and tear-down in this case. - ReportInvalidTestCaseType(test_case_name, file, line); - posix::Abort(); - } else { - // At this point we are sure that the object we found is of the same - // type we are looking for, so we downcast it to that type - // without further checks. - typed_test_info = CheckedDowncastToActualType< - ParameterizedTestCaseInfo >(*it); - } - break; - } - } - if (typed_test_info == NULL) { - typed_test_info = new ParameterizedTestCaseInfo(test_case_name); - test_case_infos_.push_back(typed_test_info); - } - return typed_test_info; - } - void RegisterTests() { - for (TestCaseInfoContainer::iterator it = test_case_infos_.begin(); - it != test_case_infos_.end(); ++it) { - (*it)->RegisterTests(); - } - } - - private: - typedef ::std::vector TestCaseInfoContainer; - - TestCaseInfoContainer test_case_infos_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestCaseRegistry); -}; - -} // namespace internal -} // namespace testing - -#endif // GTEST_HAS_PARAM_TEST - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_ -// This file was GENERATED by command: -// pump.py gtest-param-util-generated.h.pump -// DO NOT EDIT BY HAND!!! - -// Copyright 2008 Google Inc. -// All Rights Reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. 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. -// -// Author: vladl@google.com (Vlad Losev) - -// Type and function utilities for implementing parameterized tests. -// This file is generated by a SCRIPT. DO NOT EDIT BY HAND! -// -// Currently Google Test supports at most 50 arguments in Values, -// and at most 10 arguments in Combine. Please contact -// googletestframework@googlegroups.com if you need more. -// Please note that the number of arguments to Combine is limited -// by the maximum arity of the implementation of tr1::tuple which is -// currently set at 10. - -#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_ -#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_ - -// scripts/fuse_gtest.py depends on gtest's own header being #included -// *unconditionally*. Therefore these #includes cannot be moved -// inside #if GTEST_HAS_PARAM_TEST. - -#if GTEST_HAS_PARAM_TEST - -namespace testing { - -// Forward declarations of ValuesIn(), which is implemented in -// include/gtest/gtest-param-test.h. -template -internal::ParamGenerator< - typename ::testing::internal::IteratorTraits::value_type> -ValuesIn(ForwardIterator begin, ForwardIterator end); - -template -internal::ParamGenerator ValuesIn(const T (&array)[N]); - -template -internal::ParamGenerator ValuesIn( - const Container& container); - -namespace internal { - -// Used in the Values() function to provide polymorphic capabilities. -template -class ValueArray1 { - public: - explicit ValueArray1(T1 v1) : v1_(v1) {} - - template - operator ParamGenerator() const { return ValuesIn(&v1_, &v1_ + 1); } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray1& other); - - const T1 v1_; -}; - -template -class ValueArray2 { - public: - ValueArray2(T1 v1, T2 v2) : v1_(v1), v2_(v2) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray2& other); - - const T1 v1_; - const T2 v2_; -}; - -template -class ValueArray3 { - public: - ValueArray3(T1 v1, T2 v2, T3 v3) : v1_(v1), v2_(v2), v3_(v3) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray3& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; -}; - -template -class ValueArray4 { - public: - ValueArray4(T1 v1, T2 v2, T3 v3, T4 v4) : v1_(v1), v2_(v2), v3_(v3), - v4_(v4) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray4& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; -}; - -template -class ValueArray5 { - public: - ValueArray5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) : v1_(v1), v2_(v2), v3_(v3), - v4_(v4), v5_(v5) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray5& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; -}; - -template -class ValueArray6 { - public: - ValueArray6(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) : v1_(v1), v2_(v2), - v3_(v3), v4_(v4), v5_(v5), v6_(v6) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray6& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; -}; - -template -class ValueArray7 { - public: - ValueArray7(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) : v1_(v1), - v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray7& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; -}; - -template -class ValueArray8 { - public: - ValueArray8(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray8& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; -}; - -template -class ValueArray9 { - public: - ValueArray9(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, - T9 v9) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray9& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; -}; - -template -class ValueArray10 { - public: - ValueArray10(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray10& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; -}; - -template -class ValueArray11 { - public: - ValueArray11(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), - v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray11& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; -}; - -template -class ValueArray12 { - public: - ValueArray12(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), - v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray12& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; -}; - -template -class ValueArray13 { - public: - ValueArray13(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), - v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), - v12_(v12), v13_(v13) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray13& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; -}; - -template -class ValueArray14 { - public: - ValueArray14(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) : v1_(v1), v2_(v2), v3_(v3), - v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray14& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; -}; - -template -class ValueArray15 { - public: - ValueArray15(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) : v1_(v1), v2_(v2), - v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray15& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; -}; - -template -class ValueArray16 { - public: - ValueArray16(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) : v1_(v1), - v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), - v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), - v16_(v16) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray16& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; -}; - -template -class ValueArray17 { - public: - ValueArray17(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, - T17 v17) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray17& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; -}; - -template -class ValueArray18 { - public: - ValueArray18(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray18& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; -}; - -template -class ValueArray19 { - public: - ValueArray19(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), - v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), - v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray19& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; -}; - -template -class ValueArray20 { - public: - ValueArray20(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), - v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), - v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), - v19_(v19), v20_(v20) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray20& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; -}; - -template -class ValueArray21 { - public: - ValueArray21(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), - v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), - v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), - v18_(v18), v19_(v19), v20_(v20), v21_(v21) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray21& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; -}; - -template -class ValueArray22 { - public: - ValueArray22(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) : v1_(v1), v2_(v2), v3_(v3), - v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), - v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray22& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; -}; - -template -class ValueArray23 { - public: - ValueArray23(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) : v1_(v1), v2_(v2), - v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), - v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), - v23_(v23) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray23& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; -}; - -template -class ValueArray24 { - public: - ValueArray24(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) : v1_(v1), - v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), - v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), - v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), - v22_(v22), v23_(v23), v24_(v24) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray24& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; -}; - -template -class ValueArray25 { - public: - ValueArray25(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, - T25 v25) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), - v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray25& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; -}; - -template -class ValueArray26 { - public: - ValueArray26(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), - v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray26& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; -}; - -template -class ValueArray27 { - public: - ValueArray27(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), - v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), - v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), - v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), - v26_(v26), v27_(v27) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray27& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; -}; - -template -class ValueArray28 { - public: - ValueArray28(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), - v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), - v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), - v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), - v25_(v25), v26_(v26), v27_(v27), v28_(v28) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray28& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; -}; - -template -class ValueArray29 { - public: - ValueArray29(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), - v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), - v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), - v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), - v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray29& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; -}; - -template -class ValueArray30 { - public: - ValueArray30(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) : v1_(v1), v2_(v2), v3_(v3), - v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), - v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), - v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), - v29_(v29), v30_(v30) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray30& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; -}; - -template -class ValueArray31 { - public: - ValueArray31(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) : v1_(v1), v2_(v2), - v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), - v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), - v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), - v29_(v29), v30_(v30), v31_(v31) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray31& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; -}; - -template -class ValueArray32 { - public: - ValueArray32(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) : v1_(v1), - v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), - v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), - v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), - v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), - v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray32& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; -}; - -template -class ValueArray33 { - public: - ValueArray33(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, - T33 v33) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), - v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), - v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), - v33_(v33) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray33& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; -}; - -template -class ValueArray34 { - public: - ValueArray34(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), - v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), - v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), - v33_(v33), v34_(v34) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray34& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; -}; - -template -class ValueArray35 { - public: - ValueArray35(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), - v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), - v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), - v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), - v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), - v32_(v32), v33_(v33), v34_(v34), v35_(v35) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray35& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; -}; - -template -class ValueArray36 { - public: - ValueArray36(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), - v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), - v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), - v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), - v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), - v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray36& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; -}; - -template -class ValueArray37 { - public: - ValueArray37(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), - v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), - v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), - v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), - v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), - v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), - v36_(v36), v37_(v37) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray37& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; -}; - -template -class ValueArray38 { - public: - ValueArray38(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) : v1_(v1), v2_(v2), v3_(v3), - v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), - v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), - v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), - v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), - v35_(v35), v36_(v36), v37_(v37), v38_(v38) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray38& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; -}; - -template -class ValueArray39 { - public: - ValueArray39(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) : v1_(v1), v2_(v2), - v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), - v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), - v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), - v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), - v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray39& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; -}; - -template -class ValueArray40 { - public: - ValueArray40(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) : v1_(v1), - v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), - v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), - v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), - v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), - v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), - v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), - v40_(v40) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_), static_cast(v40_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray40& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; -}; - -template -class ValueArray41 { - public: - ValueArray41(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, - T41 v41) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), - v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), - v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), - v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), - v39_(v39), v40_(v40), v41_(v41) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_), static_cast(v40_), static_cast(v41_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray41& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; -}; - -template -class ValueArray42 { - public: - ValueArray42(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), - v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), - v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), - v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), - v39_(v39), v40_(v40), v41_(v41), v42_(v42) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_), static_cast(v40_), static_cast(v41_), - static_cast(v42_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray42& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; -}; - -template -class ValueArray43 { - public: - ValueArray43(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), - v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), - v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), - v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), - v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), - v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), - v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_), static_cast(v40_), static_cast(v41_), - static_cast(v42_), static_cast(v43_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray43& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; - const T43 v43_; -}; - -template -class ValueArray44 { - public: - ValueArray44(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43, T44 v44) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), - v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), - v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), - v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), - v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), - v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), - v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), - v43_(v43), v44_(v44) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_), static_cast(v40_), static_cast(v41_), - static_cast(v42_), static_cast(v43_), static_cast(v44_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray44& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; - const T43 v43_; - const T44 v44_; -}; - -template -class ValueArray45 { - public: - ValueArray45(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43, T44 v44, T45 v45) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), - v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), - v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), - v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), - v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), - v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), - v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), - v42_(v42), v43_(v43), v44_(v44), v45_(v45) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_), static_cast(v40_), static_cast(v41_), - static_cast(v42_), static_cast(v43_), static_cast(v44_), - static_cast(v45_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray45& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; - const T43 v43_; - const T44 v44_; - const T45 v45_; -}; - -template -class ValueArray46 { - public: - ValueArray46(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) : v1_(v1), v2_(v2), v3_(v3), - v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), - v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), - v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), - v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), - v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), - v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_), static_cast(v40_), static_cast(v41_), - static_cast(v42_), static_cast(v43_), static_cast(v44_), - static_cast(v45_), static_cast(v46_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray46& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; - const T43 v43_; - const T44 v44_; - const T45 v45_; - const T46 v46_; -}; - -template -class ValueArray47 { - public: - ValueArray47(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) : v1_(v1), v2_(v2), - v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), - v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), - v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), - v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), - v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), - v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), - v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46), - v47_(v47) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_), static_cast(v40_), static_cast(v41_), - static_cast(v42_), static_cast(v43_), static_cast(v44_), - static_cast(v45_), static_cast(v46_), static_cast(v47_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray47& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; - const T43 v43_; - const T44 v44_; - const T45 v45_; - const T46 v46_; - const T47 v47_; -}; - -template -class ValueArray48 { - public: - ValueArray48(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) : v1_(v1), - v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), - v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), - v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), - v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), - v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), - v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), - v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), - v46_(v46), v47_(v47), v48_(v48) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_), static_cast(v40_), static_cast(v41_), - static_cast(v42_), static_cast(v43_), static_cast(v44_), - static_cast(v45_), static_cast(v46_), static_cast(v47_), - static_cast(v48_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray48& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; - const T43 v43_; - const T44 v44_; - const T45 v45_; - const T46 v46_; - const T47 v47_; - const T48 v48_; -}; - -template -class ValueArray49 { - public: - ValueArray49(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, - T49 v49) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), - v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), - v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), - v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), - v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), - v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_), static_cast(v40_), static_cast(v41_), - static_cast(v42_), static_cast(v43_), static_cast(v44_), - static_cast(v45_), static_cast(v46_), static_cast(v47_), - static_cast(v48_), static_cast(v49_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray49& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; - const T43 v43_; - const T44 v44_; - const T45 v45_; - const T46 v46_; - const T47 v47_; - const T48 v48_; - const T49 v49_; -}; - -template -class ValueArray50 { - public: - ValueArray50(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49, - T50 v50) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), - v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), - v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), - v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), - v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), - v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), - v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), - v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49), v50_(v50) {} - - template - operator ParamGenerator() const { - const T array[] = {static_cast(v1_), static_cast(v2_), - static_cast(v3_), static_cast(v4_), static_cast(v5_), - static_cast(v6_), static_cast(v7_), static_cast(v8_), - static_cast(v9_), static_cast(v10_), static_cast(v11_), - static_cast(v12_), static_cast(v13_), static_cast(v14_), - static_cast(v15_), static_cast(v16_), static_cast(v17_), - static_cast(v18_), static_cast(v19_), static_cast(v20_), - static_cast(v21_), static_cast(v22_), static_cast(v23_), - static_cast(v24_), static_cast(v25_), static_cast(v26_), - static_cast(v27_), static_cast(v28_), static_cast(v29_), - static_cast(v30_), static_cast(v31_), static_cast(v32_), - static_cast(v33_), static_cast(v34_), static_cast(v35_), - static_cast(v36_), static_cast(v37_), static_cast(v38_), - static_cast(v39_), static_cast(v40_), static_cast(v41_), - static_cast(v42_), static_cast(v43_), static_cast(v44_), - static_cast(v45_), static_cast(v46_), static_cast(v47_), - static_cast(v48_), static_cast(v49_), static_cast(v50_)}; - return ValuesIn(array); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const ValueArray50& other); - - const T1 v1_; - const T2 v2_; - const T3 v3_; - const T4 v4_; - const T5 v5_; - const T6 v6_; - const T7 v7_; - const T8 v8_; - const T9 v9_; - const T10 v10_; - const T11 v11_; - const T12 v12_; - const T13 v13_; - const T14 v14_; - const T15 v15_; - const T16 v16_; - const T17 v17_; - const T18 v18_; - const T19 v19_; - const T20 v20_; - const T21 v21_; - const T22 v22_; - const T23 v23_; - const T24 v24_; - const T25 v25_; - const T26 v26_; - const T27 v27_; - const T28 v28_; - const T29 v29_; - const T30 v30_; - const T31 v31_; - const T32 v32_; - const T33 v33_; - const T34 v34_; - const T35 v35_; - const T36 v36_; - const T37 v37_; - const T38 v38_; - const T39 v39_; - const T40 v40_; - const T41 v41_; - const T42 v42_; - const T43 v43_; - const T44 v44_; - const T45 v45_; - const T46 v46_; - const T47 v47_; - const T48 v48_; - const T49 v49_; - const T50 v50_; -}; - -# if GTEST_HAS_COMBINE -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Generates values from the Cartesian product of values produced -// by the argument generators. -// -template -class CartesianProductGenerator2 - : public ParamGeneratorInterface< ::std::tr1::tuple > { - public: - typedef ::std::tr1::tuple ParamType; - - CartesianProductGenerator2(const ParamGenerator& g1, - const ParamGenerator& g2) - : g1_(g1), g2_(g2) {} - virtual ~CartesianProductGenerator2() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current2_; - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - ParamType current_value_; - }; // class CartesianProductGenerator2::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator2& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; -}; // class CartesianProductGenerator2 - - -template -class CartesianProductGenerator3 - : public ParamGeneratorInterface< ::std::tr1::tuple > { - public: - typedef ::std::tr1::tuple ParamType; - - CartesianProductGenerator3(const ParamGenerator& g1, - const ParamGenerator& g2, const ParamGenerator& g3) - : g1_(g1), g2_(g2), g3_(g3) {} - virtual ~CartesianProductGenerator3() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, - g3_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2, - const ParamGenerator& g3, - const typename ParamGenerator::iterator& current3) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2), - begin3_(g3.begin()), end3_(g3.end()), current3_(current3) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current3_; - if (current3_ == end3_) { - current3_ = begin3_; - ++current2_; - } - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_ && - current3_ == typed_other->current3_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_), - begin3_(other.begin3_), - end3_(other.end3_), - current3_(other.current3_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_, *current3_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_ || - current3_ == end3_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - const typename ParamGenerator::iterator begin3_; - const typename ParamGenerator::iterator end3_; - typename ParamGenerator::iterator current3_; - ParamType current_value_; - }; // class CartesianProductGenerator3::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator3& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; - const ParamGenerator g3_; -}; // class CartesianProductGenerator3 - - -template -class CartesianProductGenerator4 - : public ParamGeneratorInterface< ::std::tr1::tuple > { - public: - typedef ::std::tr1::tuple ParamType; - - CartesianProductGenerator4(const ParamGenerator& g1, - const ParamGenerator& g2, const ParamGenerator& g3, - const ParamGenerator& g4) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {} - virtual ~CartesianProductGenerator4() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, - g3_.begin(), g4_, g4_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), - g4_, g4_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2, - const ParamGenerator& g3, - const typename ParamGenerator::iterator& current3, - const ParamGenerator& g4, - const typename ParamGenerator::iterator& current4) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2), - begin3_(g3.begin()), end3_(g3.end()), current3_(current3), - begin4_(g4.begin()), end4_(g4.end()), current4_(current4) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current4_; - if (current4_ == end4_) { - current4_ = begin4_; - ++current3_; - } - if (current3_ == end3_) { - current3_ = begin3_; - ++current2_; - } - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_ && - current3_ == typed_other->current3_ && - current4_ == typed_other->current4_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_), - begin3_(other.begin3_), - end3_(other.end3_), - current3_(other.current3_), - begin4_(other.begin4_), - end4_(other.end4_), - current4_(other.current4_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_, *current3_, - *current4_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_ || - current3_ == end3_ || - current4_ == end4_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - const typename ParamGenerator::iterator begin3_; - const typename ParamGenerator::iterator end3_; - typename ParamGenerator::iterator current3_; - const typename ParamGenerator::iterator begin4_; - const typename ParamGenerator::iterator end4_; - typename ParamGenerator::iterator current4_; - ParamType current_value_; - }; // class CartesianProductGenerator4::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator4& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; - const ParamGenerator g3_; - const ParamGenerator g4_; -}; // class CartesianProductGenerator4 - - -template -class CartesianProductGenerator5 - : public ParamGeneratorInterface< ::std::tr1::tuple > { - public: - typedef ::std::tr1::tuple ParamType; - - CartesianProductGenerator5(const ParamGenerator& g1, - const ParamGenerator& g2, const ParamGenerator& g3, - const ParamGenerator& g4, const ParamGenerator& g5) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {} - virtual ~CartesianProductGenerator5() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, - g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), - g4_, g4_.end(), g5_, g5_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2, - const ParamGenerator& g3, - const typename ParamGenerator::iterator& current3, - const ParamGenerator& g4, - const typename ParamGenerator::iterator& current4, - const ParamGenerator& g5, - const typename ParamGenerator::iterator& current5) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2), - begin3_(g3.begin()), end3_(g3.end()), current3_(current3), - begin4_(g4.begin()), end4_(g4.end()), current4_(current4), - begin5_(g5.begin()), end5_(g5.end()), current5_(current5) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current5_; - if (current5_ == end5_) { - current5_ = begin5_; - ++current4_; - } - if (current4_ == end4_) { - current4_ = begin4_; - ++current3_; - } - if (current3_ == end3_) { - current3_ = begin3_; - ++current2_; - } - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_ && - current3_ == typed_other->current3_ && - current4_ == typed_other->current4_ && - current5_ == typed_other->current5_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_), - begin3_(other.begin3_), - end3_(other.end3_), - current3_(other.current3_), - begin4_(other.begin4_), - end4_(other.end4_), - current4_(other.current4_), - begin5_(other.begin5_), - end5_(other.end5_), - current5_(other.current5_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_, *current3_, - *current4_, *current5_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_ || - current3_ == end3_ || - current4_ == end4_ || - current5_ == end5_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - const typename ParamGenerator::iterator begin3_; - const typename ParamGenerator::iterator end3_; - typename ParamGenerator::iterator current3_; - const typename ParamGenerator::iterator begin4_; - const typename ParamGenerator::iterator end4_; - typename ParamGenerator::iterator current4_; - const typename ParamGenerator::iterator begin5_; - const typename ParamGenerator::iterator end5_; - typename ParamGenerator::iterator current5_; - ParamType current_value_; - }; // class CartesianProductGenerator5::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator5& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; - const ParamGenerator g3_; - const ParamGenerator g4_; - const ParamGenerator g5_; -}; // class CartesianProductGenerator5 - - -template -class CartesianProductGenerator6 - : public ParamGeneratorInterface< ::std::tr1::tuple > { - public: - typedef ::std::tr1::tuple ParamType; - - CartesianProductGenerator6(const ParamGenerator& g1, - const ParamGenerator& g2, const ParamGenerator& g3, - const ParamGenerator& g4, const ParamGenerator& g5, - const ParamGenerator& g6) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {} - virtual ~CartesianProductGenerator6() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, - g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), - g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2, - const ParamGenerator& g3, - const typename ParamGenerator::iterator& current3, - const ParamGenerator& g4, - const typename ParamGenerator::iterator& current4, - const ParamGenerator& g5, - const typename ParamGenerator::iterator& current5, - const ParamGenerator& g6, - const typename ParamGenerator::iterator& current6) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2), - begin3_(g3.begin()), end3_(g3.end()), current3_(current3), - begin4_(g4.begin()), end4_(g4.end()), current4_(current4), - begin5_(g5.begin()), end5_(g5.end()), current5_(current5), - begin6_(g6.begin()), end6_(g6.end()), current6_(current6) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current6_; - if (current6_ == end6_) { - current6_ = begin6_; - ++current5_; - } - if (current5_ == end5_) { - current5_ = begin5_; - ++current4_; - } - if (current4_ == end4_) { - current4_ = begin4_; - ++current3_; - } - if (current3_ == end3_) { - current3_ = begin3_; - ++current2_; - } - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_ && - current3_ == typed_other->current3_ && - current4_ == typed_other->current4_ && - current5_ == typed_other->current5_ && - current6_ == typed_other->current6_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_), - begin3_(other.begin3_), - end3_(other.end3_), - current3_(other.current3_), - begin4_(other.begin4_), - end4_(other.end4_), - current4_(other.current4_), - begin5_(other.begin5_), - end5_(other.end5_), - current5_(other.current5_), - begin6_(other.begin6_), - end6_(other.end6_), - current6_(other.current6_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_, *current3_, - *current4_, *current5_, *current6_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_ || - current3_ == end3_ || - current4_ == end4_ || - current5_ == end5_ || - current6_ == end6_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - const typename ParamGenerator::iterator begin3_; - const typename ParamGenerator::iterator end3_; - typename ParamGenerator::iterator current3_; - const typename ParamGenerator::iterator begin4_; - const typename ParamGenerator::iterator end4_; - typename ParamGenerator::iterator current4_; - const typename ParamGenerator::iterator begin5_; - const typename ParamGenerator::iterator end5_; - typename ParamGenerator::iterator current5_; - const typename ParamGenerator::iterator begin6_; - const typename ParamGenerator::iterator end6_; - typename ParamGenerator::iterator current6_; - ParamType current_value_; - }; // class CartesianProductGenerator6::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator6& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; - const ParamGenerator g3_; - const ParamGenerator g4_; - const ParamGenerator g5_; - const ParamGenerator g6_; -}; // class CartesianProductGenerator6 - - -template -class CartesianProductGenerator7 - : public ParamGeneratorInterface< ::std::tr1::tuple > { - public: - typedef ::std::tr1::tuple ParamType; - - CartesianProductGenerator7(const ParamGenerator& g1, - const ParamGenerator& g2, const ParamGenerator& g3, - const ParamGenerator& g4, const ParamGenerator& g5, - const ParamGenerator& g6, const ParamGenerator& g7) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {} - virtual ~CartesianProductGenerator7() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, - g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_, - g7_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), - g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2, - const ParamGenerator& g3, - const typename ParamGenerator::iterator& current3, - const ParamGenerator& g4, - const typename ParamGenerator::iterator& current4, - const ParamGenerator& g5, - const typename ParamGenerator::iterator& current5, - const ParamGenerator& g6, - const typename ParamGenerator::iterator& current6, - const ParamGenerator& g7, - const typename ParamGenerator::iterator& current7) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2), - begin3_(g3.begin()), end3_(g3.end()), current3_(current3), - begin4_(g4.begin()), end4_(g4.end()), current4_(current4), - begin5_(g5.begin()), end5_(g5.end()), current5_(current5), - begin6_(g6.begin()), end6_(g6.end()), current6_(current6), - begin7_(g7.begin()), end7_(g7.end()), current7_(current7) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current7_; - if (current7_ == end7_) { - current7_ = begin7_; - ++current6_; - } - if (current6_ == end6_) { - current6_ = begin6_; - ++current5_; - } - if (current5_ == end5_) { - current5_ = begin5_; - ++current4_; - } - if (current4_ == end4_) { - current4_ = begin4_; - ++current3_; - } - if (current3_ == end3_) { - current3_ = begin3_; - ++current2_; - } - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_ && - current3_ == typed_other->current3_ && - current4_ == typed_other->current4_ && - current5_ == typed_other->current5_ && - current6_ == typed_other->current6_ && - current7_ == typed_other->current7_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_), - begin3_(other.begin3_), - end3_(other.end3_), - current3_(other.current3_), - begin4_(other.begin4_), - end4_(other.end4_), - current4_(other.current4_), - begin5_(other.begin5_), - end5_(other.end5_), - current5_(other.current5_), - begin6_(other.begin6_), - end6_(other.end6_), - current6_(other.current6_), - begin7_(other.begin7_), - end7_(other.end7_), - current7_(other.current7_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_, *current3_, - *current4_, *current5_, *current6_, *current7_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_ || - current3_ == end3_ || - current4_ == end4_ || - current5_ == end5_ || - current6_ == end6_ || - current7_ == end7_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - const typename ParamGenerator::iterator begin3_; - const typename ParamGenerator::iterator end3_; - typename ParamGenerator::iterator current3_; - const typename ParamGenerator::iterator begin4_; - const typename ParamGenerator::iterator end4_; - typename ParamGenerator::iterator current4_; - const typename ParamGenerator::iterator begin5_; - const typename ParamGenerator::iterator end5_; - typename ParamGenerator::iterator current5_; - const typename ParamGenerator::iterator begin6_; - const typename ParamGenerator::iterator end6_; - typename ParamGenerator::iterator current6_; - const typename ParamGenerator::iterator begin7_; - const typename ParamGenerator::iterator end7_; - typename ParamGenerator::iterator current7_; - ParamType current_value_; - }; // class CartesianProductGenerator7::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator7& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; - const ParamGenerator g3_; - const ParamGenerator g4_; - const ParamGenerator g5_; - const ParamGenerator g6_; - const ParamGenerator g7_; -}; // class CartesianProductGenerator7 - - -template -class CartesianProductGenerator8 - : public ParamGeneratorInterface< ::std::tr1::tuple > { - public: - typedef ::std::tr1::tuple ParamType; - - CartesianProductGenerator8(const ParamGenerator& g1, - const ParamGenerator& g2, const ParamGenerator& g3, - const ParamGenerator& g4, const ParamGenerator& g5, - const ParamGenerator& g6, const ParamGenerator& g7, - const ParamGenerator& g8) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), - g8_(g8) {} - virtual ~CartesianProductGenerator8() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, - g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_, - g7_.begin(), g8_, g8_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), - g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_, - g8_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2, - const ParamGenerator& g3, - const typename ParamGenerator::iterator& current3, - const ParamGenerator& g4, - const typename ParamGenerator::iterator& current4, - const ParamGenerator& g5, - const typename ParamGenerator::iterator& current5, - const ParamGenerator& g6, - const typename ParamGenerator::iterator& current6, - const ParamGenerator& g7, - const typename ParamGenerator::iterator& current7, - const ParamGenerator& g8, - const typename ParamGenerator::iterator& current8) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2), - begin3_(g3.begin()), end3_(g3.end()), current3_(current3), - begin4_(g4.begin()), end4_(g4.end()), current4_(current4), - begin5_(g5.begin()), end5_(g5.end()), current5_(current5), - begin6_(g6.begin()), end6_(g6.end()), current6_(current6), - begin7_(g7.begin()), end7_(g7.end()), current7_(current7), - begin8_(g8.begin()), end8_(g8.end()), current8_(current8) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current8_; - if (current8_ == end8_) { - current8_ = begin8_; - ++current7_; - } - if (current7_ == end7_) { - current7_ = begin7_; - ++current6_; - } - if (current6_ == end6_) { - current6_ = begin6_; - ++current5_; - } - if (current5_ == end5_) { - current5_ = begin5_; - ++current4_; - } - if (current4_ == end4_) { - current4_ = begin4_; - ++current3_; - } - if (current3_ == end3_) { - current3_ = begin3_; - ++current2_; - } - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_ && - current3_ == typed_other->current3_ && - current4_ == typed_other->current4_ && - current5_ == typed_other->current5_ && - current6_ == typed_other->current6_ && - current7_ == typed_other->current7_ && - current8_ == typed_other->current8_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_), - begin3_(other.begin3_), - end3_(other.end3_), - current3_(other.current3_), - begin4_(other.begin4_), - end4_(other.end4_), - current4_(other.current4_), - begin5_(other.begin5_), - end5_(other.end5_), - current5_(other.current5_), - begin6_(other.begin6_), - end6_(other.end6_), - current6_(other.current6_), - begin7_(other.begin7_), - end7_(other.end7_), - current7_(other.current7_), - begin8_(other.begin8_), - end8_(other.end8_), - current8_(other.current8_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_, *current3_, - *current4_, *current5_, *current6_, *current7_, *current8_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_ || - current3_ == end3_ || - current4_ == end4_ || - current5_ == end5_ || - current6_ == end6_ || - current7_ == end7_ || - current8_ == end8_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - const typename ParamGenerator::iterator begin3_; - const typename ParamGenerator::iterator end3_; - typename ParamGenerator::iterator current3_; - const typename ParamGenerator::iterator begin4_; - const typename ParamGenerator::iterator end4_; - typename ParamGenerator::iterator current4_; - const typename ParamGenerator::iterator begin5_; - const typename ParamGenerator::iterator end5_; - typename ParamGenerator::iterator current5_; - const typename ParamGenerator::iterator begin6_; - const typename ParamGenerator::iterator end6_; - typename ParamGenerator::iterator current6_; - const typename ParamGenerator::iterator begin7_; - const typename ParamGenerator::iterator end7_; - typename ParamGenerator::iterator current7_; - const typename ParamGenerator::iterator begin8_; - const typename ParamGenerator::iterator end8_; - typename ParamGenerator::iterator current8_; - ParamType current_value_; - }; // class CartesianProductGenerator8::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator8& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; - const ParamGenerator g3_; - const ParamGenerator g4_; - const ParamGenerator g5_; - const ParamGenerator g6_; - const ParamGenerator g7_; - const ParamGenerator g8_; -}; // class CartesianProductGenerator8 - - -template -class CartesianProductGenerator9 - : public ParamGeneratorInterface< ::std::tr1::tuple > { - public: - typedef ::std::tr1::tuple ParamType; - - CartesianProductGenerator9(const ParamGenerator& g1, - const ParamGenerator& g2, const ParamGenerator& g3, - const ParamGenerator& g4, const ParamGenerator& g5, - const ParamGenerator& g6, const ParamGenerator& g7, - const ParamGenerator& g8, const ParamGenerator& g9) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8), - g9_(g9) {} - virtual ~CartesianProductGenerator9() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, - g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_, - g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), - g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_, - g8_.end(), g9_, g9_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2, - const ParamGenerator& g3, - const typename ParamGenerator::iterator& current3, - const ParamGenerator& g4, - const typename ParamGenerator::iterator& current4, - const ParamGenerator& g5, - const typename ParamGenerator::iterator& current5, - const ParamGenerator& g6, - const typename ParamGenerator::iterator& current6, - const ParamGenerator& g7, - const typename ParamGenerator::iterator& current7, - const ParamGenerator& g8, - const typename ParamGenerator::iterator& current8, - const ParamGenerator& g9, - const typename ParamGenerator::iterator& current9) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2), - begin3_(g3.begin()), end3_(g3.end()), current3_(current3), - begin4_(g4.begin()), end4_(g4.end()), current4_(current4), - begin5_(g5.begin()), end5_(g5.end()), current5_(current5), - begin6_(g6.begin()), end6_(g6.end()), current6_(current6), - begin7_(g7.begin()), end7_(g7.end()), current7_(current7), - begin8_(g8.begin()), end8_(g8.end()), current8_(current8), - begin9_(g9.begin()), end9_(g9.end()), current9_(current9) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current9_; - if (current9_ == end9_) { - current9_ = begin9_; - ++current8_; - } - if (current8_ == end8_) { - current8_ = begin8_; - ++current7_; - } - if (current7_ == end7_) { - current7_ = begin7_; - ++current6_; - } - if (current6_ == end6_) { - current6_ = begin6_; - ++current5_; - } - if (current5_ == end5_) { - current5_ = begin5_; - ++current4_; - } - if (current4_ == end4_) { - current4_ = begin4_; - ++current3_; - } - if (current3_ == end3_) { - current3_ = begin3_; - ++current2_; - } - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_ && - current3_ == typed_other->current3_ && - current4_ == typed_other->current4_ && - current5_ == typed_other->current5_ && - current6_ == typed_other->current6_ && - current7_ == typed_other->current7_ && - current8_ == typed_other->current8_ && - current9_ == typed_other->current9_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_), - begin3_(other.begin3_), - end3_(other.end3_), - current3_(other.current3_), - begin4_(other.begin4_), - end4_(other.end4_), - current4_(other.current4_), - begin5_(other.begin5_), - end5_(other.end5_), - current5_(other.current5_), - begin6_(other.begin6_), - end6_(other.end6_), - current6_(other.current6_), - begin7_(other.begin7_), - end7_(other.end7_), - current7_(other.current7_), - begin8_(other.begin8_), - end8_(other.end8_), - current8_(other.current8_), - begin9_(other.begin9_), - end9_(other.end9_), - current9_(other.current9_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_, *current3_, - *current4_, *current5_, *current6_, *current7_, *current8_, - *current9_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_ || - current3_ == end3_ || - current4_ == end4_ || - current5_ == end5_ || - current6_ == end6_ || - current7_ == end7_ || - current8_ == end8_ || - current9_ == end9_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - const typename ParamGenerator::iterator begin3_; - const typename ParamGenerator::iterator end3_; - typename ParamGenerator::iterator current3_; - const typename ParamGenerator::iterator begin4_; - const typename ParamGenerator::iterator end4_; - typename ParamGenerator::iterator current4_; - const typename ParamGenerator::iterator begin5_; - const typename ParamGenerator::iterator end5_; - typename ParamGenerator::iterator current5_; - const typename ParamGenerator::iterator begin6_; - const typename ParamGenerator::iterator end6_; - typename ParamGenerator::iterator current6_; - const typename ParamGenerator::iterator begin7_; - const typename ParamGenerator::iterator end7_; - typename ParamGenerator::iterator current7_; - const typename ParamGenerator::iterator begin8_; - const typename ParamGenerator::iterator end8_; - typename ParamGenerator::iterator current8_; - const typename ParamGenerator::iterator begin9_; - const typename ParamGenerator::iterator end9_; - typename ParamGenerator::iterator current9_; - ParamType current_value_; - }; // class CartesianProductGenerator9::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator9& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; - const ParamGenerator g3_; - const ParamGenerator g4_; - const ParamGenerator g5_; - const ParamGenerator g6_; - const ParamGenerator g7_; - const ParamGenerator g8_; - const ParamGenerator g9_; -}; // class CartesianProductGenerator9 - - -template -class CartesianProductGenerator10 - : public ParamGeneratorInterface< ::std::tr1::tuple > { - public: - typedef ::std::tr1::tuple ParamType; - - CartesianProductGenerator10(const ParamGenerator& g1, - const ParamGenerator& g2, const ParamGenerator& g3, - const ParamGenerator& g4, const ParamGenerator& g5, - const ParamGenerator& g6, const ParamGenerator& g7, - const ParamGenerator& g8, const ParamGenerator& g9, - const ParamGenerator& g10) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8), - g9_(g9), g10_(g10) {} - virtual ~CartesianProductGenerator10() {} - - virtual ParamIteratorInterface* Begin() const { - return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, - g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_, - g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin(), g10_, g10_.begin()); - } - virtual ParamIteratorInterface* End() const { - return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), - g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_, - g8_.end(), g9_, g9_.end(), g10_, g10_.end()); - } - - private: - class Iterator : public ParamIteratorInterface { - public: - Iterator(const ParamGeneratorInterface* base, - const ParamGenerator& g1, - const typename ParamGenerator::iterator& current1, - const ParamGenerator& g2, - const typename ParamGenerator::iterator& current2, - const ParamGenerator& g3, - const typename ParamGenerator::iterator& current3, - const ParamGenerator& g4, - const typename ParamGenerator::iterator& current4, - const ParamGenerator& g5, - const typename ParamGenerator::iterator& current5, - const ParamGenerator& g6, - const typename ParamGenerator::iterator& current6, - const ParamGenerator& g7, - const typename ParamGenerator::iterator& current7, - const ParamGenerator& g8, - const typename ParamGenerator::iterator& current8, - const ParamGenerator& g9, - const typename ParamGenerator::iterator& current9, - const ParamGenerator& g10, - const typename ParamGenerator::iterator& current10) - : base_(base), - begin1_(g1.begin()), end1_(g1.end()), current1_(current1), - begin2_(g2.begin()), end2_(g2.end()), current2_(current2), - begin3_(g3.begin()), end3_(g3.end()), current3_(current3), - begin4_(g4.begin()), end4_(g4.end()), current4_(current4), - begin5_(g5.begin()), end5_(g5.end()), current5_(current5), - begin6_(g6.begin()), end6_(g6.end()), current6_(current6), - begin7_(g7.begin()), end7_(g7.end()), current7_(current7), - begin8_(g8.begin()), end8_(g8.end()), current8_(current8), - begin9_(g9.begin()), end9_(g9.end()), current9_(current9), - begin10_(g10.begin()), end10_(g10.end()), current10_(current10) { - ComputeCurrentValue(); - } - virtual ~Iterator() {} - - virtual const ParamGeneratorInterface* BaseGenerator() const { - return base_; - } - // Advance should not be called on beyond-of-range iterators - // so no component iterators must be beyond end of range, either. - virtual void Advance() { - assert(!AtEnd()); - ++current10_; - if (current10_ == end10_) { - current10_ = begin10_; - ++current9_; - } - if (current9_ == end9_) { - current9_ = begin9_; - ++current8_; - } - if (current8_ == end8_) { - current8_ = begin8_; - ++current7_; - } - if (current7_ == end7_) { - current7_ = begin7_; - ++current6_; - } - if (current6_ == end6_) { - current6_ = begin6_; - ++current5_; - } - if (current5_ == end5_) { - current5_ = begin5_; - ++current4_; - } - if (current4_ == end4_) { - current4_ = begin4_; - ++current3_; - } - if (current3_ == end3_) { - current3_ = begin3_; - ++current2_; - } - if (current2_ == end2_) { - current2_ = begin2_; - ++current1_; - } - ComputeCurrentValue(); - } - virtual ParamIteratorInterface* Clone() const { - return new Iterator(*this); - } - virtual const ParamType* Current() const { return ¤t_value_; } - virtual bool Equals(const ParamIteratorInterface& other) const { - // Having the same base generator guarantees that the other - // iterator is of the same type and we can downcast. - GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) - << "The program attempted to compare iterators " - << "from different generators." << std::endl; - const Iterator* typed_other = - CheckedDowncastToActualType(&other); - // We must report iterators equal if they both point beyond their - // respective ranges. That can happen in a variety of fashions, - // so we have to consult AtEnd(). - return (AtEnd() && typed_other->AtEnd()) || - ( - current1_ == typed_other->current1_ && - current2_ == typed_other->current2_ && - current3_ == typed_other->current3_ && - current4_ == typed_other->current4_ && - current5_ == typed_other->current5_ && - current6_ == typed_other->current6_ && - current7_ == typed_other->current7_ && - current8_ == typed_other->current8_ && - current9_ == typed_other->current9_ && - current10_ == typed_other->current10_); - } - - private: - Iterator(const Iterator& other) - : base_(other.base_), - begin1_(other.begin1_), - end1_(other.end1_), - current1_(other.current1_), - begin2_(other.begin2_), - end2_(other.end2_), - current2_(other.current2_), - begin3_(other.begin3_), - end3_(other.end3_), - current3_(other.current3_), - begin4_(other.begin4_), - end4_(other.end4_), - current4_(other.current4_), - begin5_(other.begin5_), - end5_(other.end5_), - current5_(other.current5_), - begin6_(other.begin6_), - end6_(other.end6_), - current6_(other.current6_), - begin7_(other.begin7_), - end7_(other.end7_), - current7_(other.current7_), - begin8_(other.begin8_), - end8_(other.end8_), - current8_(other.current8_), - begin9_(other.begin9_), - end9_(other.end9_), - current9_(other.current9_), - begin10_(other.begin10_), - end10_(other.end10_), - current10_(other.current10_) { - ComputeCurrentValue(); - } - - void ComputeCurrentValue() { - if (!AtEnd()) - current_value_ = ParamType(*current1_, *current2_, *current3_, - *current4_, *current5_, *current6_, *current7_, *current8_, - *current9_, *current10_); - } - bool AtEnd() const { - // We must report iterator past the end of the range when either of the - // component iterators has reached the end of its range. - return - current1_ == end1_ || - current2_ == end2_ || - current3_ == end3_ || - current4_ == end4_ || - current5_ == end5_ || - current6_ == end6_ || - current7_ == end7_ || - current8_ == end8_ || - current9_ == end9_ || - current10_ == end10_; - } - - // No implementation - assignment is unsupported. - void operator=(const Iterator& other); - - const ParamGeneratorInterface* const base_; - // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. - // current[i]_ is the actual traversing iterator. - const typename ParamGenerator::iterator begin1_; - const typename ParamGenerator::iterator end1_; - typename ParamGenerator::iterator current1_; - const typename ParamGenerator::iterator begin2_; - const typename ParamGenerator::iterator end2_; - typename ParamGenerator::iterator current2_; - const typename ParamGenerator::iterator begin3_; - const typename ParamGenerator::iterator end3_; - typename ParamGenerator::iterator current3_; - const typename ParamGenerator::iterator begin4_; - const typename ParamGenerator::iterator end4_; - typename ParamGenerator::iterator current4_; - const typename ParamGenerator::iterator begin5_; - const typename ParamGenerator::iterator end5_; - typename ParamGenerator::iterator current5_; - const typename ParamGenerator::iterator begin6_; - const typename ParamGenerator::iterator end6_; - typename ParamGenerator::iterator current6_; - const typename ParamGenerator::iterator begin7_; - const typename ParamGenerator::iterator end7_; - typename ParamGenerator::iterator current7_; - const typename ParamGenerator::iterator begin8_; - const typename ParamGenerator::iterator end8_; - typename ParamGenerator::iterator current8_; - const typename ParamGenerator::iterator begin9_; - const typename ParamGenerator::iterator end9_; - typename ParamGenerator::iterator current9_; - const typename ParamGenerator::iterator begin10_; - const typename ParamGenerator::iterator end10_; - typename ParamGenerator::iterator current10_; - ParamType current_value_; - }; // class CartesianProductGenerator10::Iterator - - // No implementation - assignment is unsupported. - void operator=(const CartesianProductGenerator10& other); - - const ParamGenerator g1_; - const ParamGenerator g2_; - const ParamGenerator g3_; - const ParamGenerator g4_; - const ParamGenerator g5_; - const ParamGenerator g6_; - const ParamGenerator g7_; - const ParamGenerator g8_; - const ParamGenerator g9_; - const ParamGenerator g10_; -}; // class CartesianProductGenerator10 - - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Helper classes providing Combine() with polymorphic features. They allow -// casting CartesianProductGeneratorN to ParamGenerator if T is -// convertible to U. -// -template -class CartesianProductHolder2 { - public: -CartesianProductHolder2(const Generator1& g1, const Generator2& g2) - : g1_(g1), g2_(g2) {} - template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( - new CartesianProductGenerator2( - static_cast >(g1_), - static_cast >(g2_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder2& other); - - const Generator1 g1_; - const Generator2 g2_; -}; // class CartesianProductHolder2 - -template -class CartesianProductHolder3 { - public: -CartesianProductHolder3(const Generator1& g1, const Generator2& g2, - const Generator3& g3) - : g1_(g1), g2_(g2), g3_(g3) {} - template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( - new CartesianProductGenerator3( - static_cast >(g1_), - static_cast >(g2_), - static_cast >(g3_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder3& other); - - const Generator1 g1_; - const Generator2 g2_; - const Generator3 g3_; -}; // class CartesianProductHolder3 - -template -class CartesianProductHolder4 { - public: -CartesianProductHolder4(const Generator1& g1, const Generator2& g2, - const Generator3& g3, const Generator4& g4) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {} - template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( - new CartesianProductGenerator4( - static_cast >(g1_), - static_cast >(g2_), - static_cast >(g3_), - static_cast >(g4_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder4& other); - - const Generator1 g1_; - const Generator2 g2_; - const Generator3 g3_; - const Generator4 g4_; -}; // class CartesianProductHolder4 - -template -class CartesianProductHolder5 { - public: -CartesianProductHolder5(const Generator1& g1, const Generator2& g2, - const Generator3& g3, const Generator4& g4, const Generator5& g5) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {} - template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( - new CartesianProductGenerator5( - static_cast >(g1_), - static_cast >(g2_), - static_cast >(g3_), - static_cast >(g4_), - static_cast >(g5_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder5& other); - - const Generator1 g1_; - const Generator2 g2_; - const Generator3 g3_; - const Generator4 g4_; - const Generator5 g5_; -}; // class CartesianProductHolder5 - -template -class CartesianProductHolder6 { - public: -CartesianProductHolder6(const Generator1& g1, const Generator2& g2, - const Generator3& g3, const Generator4& g4, const Generator5& g5, - const Generator6& g6) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {} - template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( - new CartesianProductGenerator6( - static_cast >(g1_), - static_cast >(g2_), - static_cast >(g3_), - static_cast >(g4_), - static_cast >(g5_), - static_cast >(g6_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder6& other); - - const Generator1 g1_; - const Generator2 g2_; - const Generator3 g3_; - const Generator4 g4_; - const Generator5 g5_; - const Generator6 g6_; -}; // class CartesianProductHolder6 - -template -class CartesianProductHolder7 { - public: -CartesianProductHolder7(const Generator1& g1, const Generator2& g2, - const Generator3& g3, const Generator4& g4, const Generator5& g5, - const Generator6& g6, const Generator7& g7) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {} - template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( - new CartesianProductGenerator7( - static_cast >(g1_), - static_cast >(g2_), - static_cast >(g3_), - static_cast >(g4_), - static_cast >(g5_), - static_cast >(g6_), - static_cast >(g7_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder7& other); - - const Generator1 g1_; - const Generator2 g2_; - const Generator3 g3_; - const Generator4 g4_; - const Generator5 g5_; - const Generator6 g6_; - const Generator7 g7_; -}; // class CartesianProductHolder7 - -template -class CartesianProductHolder8 { - public: -CartesianProductHolder8(const Generator1& g1, const Generator2& g2, - const Generator3& g3, const Generator4& g4, const Generator5& g5, - const Generator6& g6, const Generator7& g7, const Generator8& g8) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), - g8_(g8) {} - template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( - new CartesianProductGenerator8( - static_cast >(g1_), - static_cast >(g2_), - static_cast >(g3_), - static_cast >(g4_), - static_cast >(g5_), - static_cast >(g6_), - static_cast >(g7_), - static_cast >(g8_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder8& other); - - const Generator1 g1_; - const Generator2 g2_; - const Generator3 g3_; - const Generator4 g4_; - const Generator5 g5_; - const Generator6 g6_; - const Generator7 g7_; - const Generator8 g8_; -}; // class CartesianProductHolder8 - -template -class CartesianProductHolder9 { - public: -CartesianProductHolder9(const Generator1& g1, const Generator2& g2, - const Generator3& g3, const Generator4& g4, const Generator5& g5, - const Generator6& g6, const Generator7& g7, const Generator8& g8, - const Generator9& g9) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8), - g9_(g9) {} - template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( - new CartesianProductGenerator9( - static_cast >(g1_), - static_cast >(g2_), - static_cast >(g3_), - static_cast >(g4_), - static_cast >(g5_), - static_cast >(g6_), - static_cast >(g7_), - static_cast >(g8_), - static_cast >(g9_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder9& other); - - const Generator1 g1_; - const Generator2 g2_; - const Generator3 g3_; - const Generator4 g4_; - const Generator5 g5_; - const Generator6 g6_; - const Generator7 g7_; - const Generator8 g8_; - const Generator9 g9_; -}; // class CartesianProductHolder9 - -template -class CartesianProductHolder10 { - public: -CartesianProductHolder10(const Generator1& g1, const Generator2& g2, - const Generator3& g3, const Generator4& g4, const Generator5& g5, - const Generator6& g6, const Generator7& g7, const Generator8& g8, - const Generator9& g9, const Generator10& g10) - : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8), - g9_(g9), g10_(g10) {} - template - operator ParamGenerator< ::std::tr1::tuple >() const { - return ParamGenerator< ::std::tr1::tuple >( - new CartesianProductGenerator10( - static_cast >(g1_), - static_cast >(g2_), - static_cast >(g3_), - static_cast >(g4_), - static_cast >(g5_), - static_cast >(g6_), - static_cast >(g7_), - static_cast >(g8_), - static_cast >(g9_), - static_cast >(g10_))); - } - - private: - // No implementation - assignment is unsupported. - void operator=(const CartesianProductHolder10& other); - - const Generator1 g1_; - const Generator2 g2_; - const Generator3 g3_; - const Generator4 g4_; - const Generator5 g5_; - const Generator6 g6_; - const Generator7 g7_; - const Generator8 g8_; - const Generator9 g9_; - const Generator10 g10_; -}; // class CartesianProductHolder10 - -# endif // GTEST_HAS_COMBINE - -} // namespace internal -} // namespace testing - -#endif // GTEST_HAS_PARAM_TEST - -#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_ - -#if GTEST_HAS_PARAM_TEST - -namespace testing { - -// Functions producing parameter generators. -// -// Google Test uses these generators to produce parameters for value- -// parameterized tests. When a parameterized test case is instantiated -// with a particular generator, Google Test creates and runs tests -// for each element in the sequence produced by the generator. -// -// In the following sample, tests from test case FooTest are instantiated -// each three times with parameter values 3, 5, and 8: -// -// class FooTest : public TestWithParam { ... }; -// -// TEST_P(FooTest, TestThis) { -// } -// TEST_P(FooTest, TestThat) { -// } -// INSTANTIATE_TEST_CASE_P(TestSequence, FooTest, Values(3, 5, 8)); -// - -// Range() returns generators providing sequences of values in a range. -// -// Synopsis: -// Range(start, end) -// - returns a generator producing a sequence of values {start, start+1, -// start+2, ..., }. -// Range(start, end, step) -// - returns a generator producing a sequence of values {start, start+step, -// start+step+step, ..., }. -// Notes: -// * The generated sequences never include end. For example, Range(1, 5) -// returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2) -// returns a generator producing {1, 3, 5, 7}. -// * start and end must have the same type. That type may be any integral or -// floating-point type or a user defined type satisfying these conditions: -// * It must be assignable (have operator=() defined). -// * It must have operator+() (operator+(int-compatible type) for -// two-operand version). -// * It must have operator<() defined. -// Elements in the resulting sequences will also have that type. -// * Condition start < end must be satisfied in order for resulting sequences -// to contain any elements. -// -template -internal::ParamGenerator Range(T start, T end, IncrementT step) { - return internal::ParamGenerator( - new internal::RangeGenerator(start, end, step)); -} - -template -internal::ParamGenerator Range(T start, T end) { - return Range(start, end, 1); -} - -// ValuesIn() function allows generation of tests with parameters coming from -// a container. -// -// Synopsis: -// ValuesIn(const T (&array)[N]) -// - returns a generator producing sequences with elements from -// a C-style array. -// ValuesIn(const Container& container) -// - returns a generator producing sequences with elements from -// an STL-style container. -// ValuesIn(Iterator begin, Iterator end) -// - returns a generator producing sequences with elements from -// a range [begin, end) defined by a pair of STL-style iterators. These -// iterators can also be plain C pointers. -// -// Please note that ValuesIn copies the values from the containers -// passed in and keeps them to generate tests in RUN_ALL_TESTS(). -// -// Examples: -// -// This instantiates tests from test case StringTest -// each with C-string values of "foo", "bar", and "baz": -// -// const char* strings[] = {"foo", "bar", "baz"}; -// INSTANTIATE_TEST_CASE_P(StringSequence, SrtingTest, ValuesIn(strings)); -// -// This instantiates tests from test case StlStringTest -// each with STL strings with values "a" and "b": -// -// ::std::vector< ::std::string> GetParameterStrings() { -// ::std::vector< ::std::string> v; -// v.push_back("a"); -// v.push_back("b"); -// return v; -// } -// -// INSTANTIATE_TEST_CASE_P(CharSequence, -// StlStringTest, -// ValuesIn(GetParameterStrings())); -// -// -// This will also instantiate tests from CharTest -// each with parameter values 'a' and 'b': -// -// ::std::list GetParameterChars() { -// ::std::list list; -// list.push_back('a'); -// list.push_back('b'); -// return list; -// } -// ::std::list l = GetParameterChars(); -// INSTANTIATE_TEST_CASE_P(CharSequence2, -// CharTest, -// ValuesIn(l.begin(), l.end())); -// -template -internal::ParamGenerator< - typename ::testing::internal::IteratorTraits::value_type> -ValuesIn(ForwardIterator begin, ForwardIterator end) { - typedef typename ::testing::internal::IteratorTraits - ::value_type ParamType; - return internal::ParamGenerator( - new internal::ValuesInIteratorRangeGenerator(begin, end)); -} - -template -internal::ParamGenerator ValuesIn(const T (&array)[N]) { - return ValuesIn(array, array + N); -} - -template -internal::ParamGenerator ValuesIn( - const Container& container) { - return ValuesIn(container.begin(), container.end()); -} - -// Values() allows generating tests from explicitly specified list of -// parameters. -// -// Synopsis: -// Values(T v1, T v2, ..., T vN) -// - returns a generator producing sequences with elements v1, v2, ..., vN. -// -// For example, this instantiates tests from test case BarTest each -// with values "one", "two", and "three": -// -// INSTANTIATE_TEST_CASE_P(NumSequence, BarTest, Values("one", "two", "three")); -// -// This instantiates tests from test case BazTest each with values 1, 2, 3.5. -// The exact type of values will depend on the type of parameter in BazTest. -// -// INSTANTIATE_TEST_CASE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5)); -// -// Currently, Values() supports from 1 to 50 parameters. -// -template -internal::ValueArray1 Values(T1 v1) { - return internal::ValueArray1(v1); -} - -template -internal::ValueArray2 Values(T1 v1, T2 v2) { - return internal::ValueArray2(v1, v2); -} - -template -internal::ValueArray3 Values(T1 v1, T2 v2, T3 v3) { - return internal::ValueArray3(v1, v2, v3); -} - -template -internal::ValueArray4 Values(T1 v1, T2 v2, T3 v3, T4 v4) { - return internal::ValueArray4(v1, v2, v3, v4); -} - -template -internal::ValueArray5 Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5) { - return internal::ValueArray5(v1, v2, v3, v4, v5); -} - -template -internal::ValueArray6 Values(T1 v1, T2 v2, T3 v3, - T4 v4, T5 v5, T6 v6) { - return internal::ValueArray6(v1, v2, v3, v4, v5, v6); -} - -template -internal::ValueArray7 Values(T1 v1, T2 v2, T3 v3, - T4 v4, T5 v5, T6 v6, T7 v7) { - return internal::ValueArray7(v1, v2, v3, v4, v5, - v6, v7); -} - -template -internal::ValueArray8 Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8) { - return internal::ValueArray8(v1, v2, v3, v4, - v5, v6, v7, v8); -} - -template -internal::ValueArray9 Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9) { - return internal::ValueArray9(v1, v2, v3, - v4, v5, v6, v7, v8, v9); -} - -template -internal::ValueArray10 Values(T1 v1, - T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10) { - return internal::ValueArray10(v1, - v2, v3, v4, v5, v6, v7, v8, v9, v10); -} - -template -internal::ValueArray11 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11) { - return internal::ValueArray11(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11); -} - -template -internal::ValueArray12 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12) { - return internal::ValueArray12(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12); -} - -template -internal::ValueArray13 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13) { - return internal::ValueArray13(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13); -} - -template -internal::ValueArray14 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) { - return internal::ValueArray14(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, - v14); -} - -template -internal::ValueArray15 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, - T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) { - return internal::ValueArray15(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, - v13, v14, v15); -} - -template -internal::ValueArray16 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16) { - return internal::ValueArray16(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, - v12, v13, v14, v15, v16); -} - -template -internal::ValueArray17 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17) { - return internal::ValueArray17(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, - v11, v12, v13, v14, v15, v16, v17); -} - -template -internal::ValueArray18 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, - T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18) { - return internal::ValueArray18(v1, v2, v3, v4, v5, v6, v7, v8, v9, - v10, v11, v12, v13, v14, v15, v16, v17, v18); -} - -template -internal::ValueArray19 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, - T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, - T15 v15, T16 v16, T17 v17, T18 v18, T19 v19) { - return internal::ValueArray19(v1, v2, v3, v4, v5, v6, v7, v8, - v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19); -} - -template -internal::ValueArray20 Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, - T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20) { - return internal::ValueArray20(v1, v2, v3, v4, v5, v6, v7, - v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20); -} - -template -internal::ValueArray21 Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, - T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21) { - return internal::ValueArray21(v1, v2, v3, v4, v5, v6, - v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21); -} - -template -internal::ValueArray22 Values(T1 v1, T2 v2, T3 v3, - T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22) { - return internal::ValueArray22(v1, v2, v3, v4, - v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, - v20, v21, v22); -} - -template -internal::ValueArray23 Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22, T23 v23) { - return internal::ValueArray23(v1, v2, v3, - v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, - v20, v21, v22, v23); -} - -template -internal::ValueArray24 Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22, T23 v23, T24 v24) { - return internal::ValueArray24(v1, v2, - v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, - v19, v20, v21, v22, v23, v24); -} - -template -internal::ValueArray25 Values(T1 v1, - T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, - T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, - T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25) { - return internal::ValueArray25(v1, - v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, - v18, v19, v20, v21, v22, v23, v24, v25); -} - -template -internal::ValueArray26 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26) { - return internal::ValueArray26(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, - v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26); -} - -template -internal::ValueArray27 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27) { - return internal::ValueArray27(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, - v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27); -} - -template -internal::ValueArray28 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28) { - return internal::ValueArray28(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, - v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, - v28); -} - -template -internal::ValueArray29 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29) { - return internal::ValueArray29(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, - v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, - v27, v28, v29); -} - -template -internal::ValueArray30 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, - T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, - T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, - T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) { - return internal::ValueArray30(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, - v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, - v26, v27, v28, v29, v30); -} - -template -internal::ValueArray31 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) { - return internal::ValueArray31(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, - v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, - v25, v26, v27, v28, v29, v30, v31); -} - -template -internal::ValueArray32 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, - T32 v32) { - return internal::ValueArray32(v1, v2, v3, v4, v5, v6, v7, v8, v9, - v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, - v24, v25, v26, v27, v28, v29, v30, v31, v32); -} - -template -internal::ValueArray33 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, - T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, - T32 v32, T33 v33) { - return internal::ValueArray33(v1, v2, v3, v4, v5, v6, v7, v8, - v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, - v24, v25, v26, v27, v28, v29, v30, v31, v32, v33); -} - -template -internal::ValueArray34 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, - T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, - T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, - T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, - T31 v31, T32 v32, T33 v33, T34 v34) { - return internal::ValueArray34(v1, v2, v3, v4, v5, v6, v7, - v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, - v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34); -} - -template -internal::ValueArray35 Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, - T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, - T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, - T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35) { - return internal::ValueArray35(v1, v2, v3, v4, v5, v6, - v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, - v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35); -} - -template -internal::ValueArray36 Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, - T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, - T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, - T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36) { - return internal::ValueArray36(v1, v2, v3, v4, - v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, - v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, - v34, v35, v36); -} - -template -internal::ValueArray37 Values(T1 v1, T2 v2, T3 v3, - T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, - T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, - T37 v37) { - return internal::ValueArray37(v1, v2, v3, - v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, - v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, - v34, v35, v36, v37); -} - -template -internal::ValueArray38 Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, - T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, - T37 v37, T38 v38) { - return internal::ValueArray38(v1, v2, - v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, - v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, - v33, v34, v35, v36, v37, v38); -} - -template -internal::ValueArray39 Values(T1 v1, T2 v2, - T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, - T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, - T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, - T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, - T37 v37, T38 v38, T39 v39) { - return internal::ValueArray39(v1, - v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, - v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, - v32, v33, v34, v35, v36, v37, v38, v39); -} - -template -internal::ValueArray40 Values(T1 v1, - T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, - T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, - T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, - T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, - T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) { - return internal::ValueArray40(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, - v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, - v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40); -} - -template -internal::ValueArray41 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41) { - return internal::ValueArray41(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, - v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, - v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41); -} - -template -internal::ValueArray42 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42) { - return internal::ValueArray42(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, - v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, - v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, - v42); -} - -template -internal::ValueArray43 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43) { - return internal::ValueArray43(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, - v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, - v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v40, - v41, v42, v43); -} - -template -internal::ValueArray44 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, - T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, - T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, - T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, - T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, - T42 v42, T43 v43, T44 v44) { - return internal::ValueArray44(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, - v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, - v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, - v40, v41, v42, v43, v44); -} - -template -internal::ValueArray45 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, - T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, - T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, - T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, - T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, - T41 v41, T42 v42, T43 v43, T44 v44, T45 v45) { - return internal::ValueArray45(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, - v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, - v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, v38, - v39, v40, v41, v42, v43, v44, v45); -} - -template -internal::ValueArray46 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, - T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, - T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) { - return internal::ValueArray46(v1, v2, v3, v4, v5, v6, v7, v8, v9, - v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, - v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, - v38, v39, v40, v41, v42, v43, v44, v45, v46); -} - -template -internal::ValueArray47 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, - T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, - T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, - T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) { - return internal::ValueArray47(v1, v2, v3, v4, v5, v6, v7, v8, - v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, - v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, v37, - v38, v39, v40, v41, v42, v43, v44, v45, v46, v47); -} - -template -internal::ValueArray48 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, - T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, - T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, - T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, - T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, - T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, - T48 v48) { - return internal::ValueArray48(v1, v2, v3, v4, v5, v6, v7, - v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, - v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, v36, - v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48); -} - -template -internal::ValueArray49 Values(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, - T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, - T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, - T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, - T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, - T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, - T47 v47, T48 v48, T49 v49) { - return internal::ValueArray49(v1, v2, v3, v4, v5, v6, - v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, - v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, v34, v35, - v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49); -} - -template -internal::ValueArray50 Values(T1 v1, T2 v2, T3 v3, T4 v4, - T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, T10 v10, T11 v11, T12 v12, T13 v13, - T14 v14, T15 v15, T16 v16, T17 v17, T18 v18, T19 v19, T20 v20, T21 v21, - T22 v22, T23 v23, T24 v24, T25 v25, T26 v26, T27 v27, T28 v28, T29 v29, - T30 v30, T31 v31, T32 v32, T33 v33, T34 v34, T35 v35, T36 v36, T37 v37, - T38 v38, T39 v39, T40 v40, T41 v41, T42 v42, T43 v43, T44 v44, T45 v45, - T46 v46, T47 v47, T48 v48, T49 v49, T50 v50) { - return internal::ValueArray50(v1, v2, v3, v4, - v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, - v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31, v32, v33, - v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, - v48, v49, v50); -} - -// Bool() allows generating tests with parameters in a set of (false, true). -// -// Synopsis: -// Bool() -// - returns a generator producing sequences with elements {false, true}. -// -// It is useful when testing code that depends on Boolean flags. Combinations -// of multiple flags can be tested when several Bool()'s are combined using -// Combine() function. -// -// In the following example all tests in the test case FlagDependentTest -// will be instantiated twice with parameters false and true. -// -// class FlagDependentTest : public testing::TestWithParam { -// virtual void SetUp() { -// external_flag = GetParam(); -// } -// } -// INSTANTIATE_TEST_CASE_P(BoolSequence, FlagDependentTest, Bool()); -// -inline internal::ParamGenerator Bool() { - return Values(false, true); -} - -# if GTEST_HAS_COMBINE -// Combine() allows the user to combine two or more sequences to produce -// values of a Cartesian product of those sequences' elements. -// -// Synopsis: -// Combine(gen1, gen2, ..., genN) -// - returns a generator producing sequences with elements coming from -// the Cartesian product of elements from the sequences generated by -// gen1, gen2, ..., genN. The sequence elements will have a type of -// tuple where T1, T2, ..., TN are the types -// of elements from sequences produces by gen1, gen2, ..., genN. -// -// Combine can have up to 10 arguments. This number is currently limited -// by the maximum number of elements in the tuple implementation used by Google -// Test. -// -// Example: -// -// This will instantiate tests in test case AnimalTest each one with -// the parameter values tuple("cat", BLACK), tuple("cat", WHITE), -// tuple("dog", BLACK), and tuple("dog", WHITE): -// -// enum Color { BLACK, GRAY, WHITE }; -// class AnimalTest -// : public testing::TestWithParam > {...}; -// -// TEST_P(AnimalTest, AnimalLooksNice) {...} -// -// INSTANTIATE_TEST_CASE_P(AnimalVariations, AnimalTest, -// Combine(Values("cat", "dog"), -// Values(BLACK, WHITE))); -// -// This will instantiate tests in FlagDependentTest with all variations of two -// Boolean flags: -// -// class FlagDependentTest -// : public testing::TestWithParam > { -// virtual void SetUp() { -// // Assigns external_flag_1 and external_flag_2 values from the tuple. -// tie(external_flag_1, external_flag_2) = GetParam(); -// } -// }; -// -// TEST_P(FlagDependentTest, TestFeature1) { -// // Test your code using external_flag_1 and external_flag_2 here. -// } -// INSTANTIATE_TEST_CASE_P(TwoBoolSequence, FlagDependentTest, -// Combine(Bool(), Bool())); -// -template -internal::CartesianProductHolder2 Combine( - const Generator1& g1, const Generator2& g2) { - return internal::CartesianProductHolder2( - g1, g2); -} - -template -internal::CartesianProductHolder3 Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3) { - return internal::CartesianProductHolder3( - g1, g2, g3); -} - -template -internal::CartesianProductHolder4 Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4) { - return internal::CartesianProductHolder4( - g1, g2, g3, g4); -} - -template -internal::CartesianProductHolder5 Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5) { - return internal::CartesianProductHolder5( - g1, g2, g3, g4, g5); -} - -template -internal::CartesianProductHolder6 Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5, const Generator6& g6) { - return internal::CartesianProductHolder6( - g1, g2, g3, g4, g5, g6); -} - -template -internal::CartesianProductHolder7 Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5, const Generator6& g6, - const Generator7& g7) { - return internal::CartesianProductHolder7( - g1, g2, g3, g4, g5, g6, g7); -} - -template -internal::CartesianProductHolder8 Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5, const Generator6& g6, - const Generator7& g7, const Generator8& g8) { - return internal::CartesianProductHolder8( - g1, g2, g3, g4, g5, g6, g7, g8); -} - -template -internal::CartesianProductHolder9 Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5, const Generator6& g6, - const Generator7& g7, const Generator8& g8, const Generator9& g9) { - return internal::CartesianProductHolder9( - g1, g2, g3, g4, g5, g6, g7, g8, g9); -} - -template -internal::CartesianProductHolder10 Combine( - const Generator1& g1, const Generator2& g2, const Generator3& g3, - const Generator4& g4, const Generator5& g5, const Generator6& g6, - const Generator7& g7, const Generator8& g8, const Generator9& g9, - const Generator10& g10) { - return internal::CartesianProductHolder10( - g1, g2, g3, g4, g5, g6, g7, g8, g9, g10); -} -# endif // GTEST_HAS_COMBINE - - - -# define TEST_P(test_case_name, test_name) \ - class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) \ - : public test_case_name { \ - public: \ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name)() {} \ - virtual void TestBody(); \ - private: \ - static int AddToRegistry() { \ - ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ - GetTestCasePatternHolder(\ - #test_case_name, __FILE__, __LINE__)->AddTestPattern(\ - #test_case_name, \ - #test_name, \ - new ::testing::internal::TestMetaFactory< \ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>()); \ - return 0; \ - } \ - static int gtest_registering_dummy_; \ - GTEST_DISALLOW_COPY_AND_ASSIGN_(\ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \ - }; \ - int GTEST_TEST_CLASS_NAME_(test_case_name, \ - test_name)::gtest_registering_dummy_ = \ - GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \ - void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody() - -# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \ - ::testing::internal::ParamGenerator \ - gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \ - int gtest_##prefix##test_case_name##_dummy_ = \ - ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \ - GetTestCasePatternHolder(\ - #test_case_name, __FILE__, __LINE__)->AddTestCaseInstantiation(\ - #prefix, \ - >est_##prefix##test_case_name##_EvalGenerator_, \ - __FILE__, __LINE__) - -} // namespace testing - -#endif // GTEST_HAS_PARAM_TEST - -#endif // GTEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_ -// Copyright 2006, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. 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. -// -// Author: wan@google.com (Zhanyong Wan) -// -// Google C++ Testing Framework definitions useful in production code. - -#ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_ -#define GTEST_INCLUDE_GTEST_GTEST_PROD_H_ - -// When you need to test the private or protected members of a class, -// use the FRIEND_TEST macro to declare your tests as friends of the -// class. For example: -// -// class MyClass { -// private: -// void MyMethod(); -// FRIEND_TEST(MyClassTest, MyMethod); -// }; -// -// class MyClassTest : public testing::Test { -// // ... -// }; -// -// TEST_F(MyClassTest, MyMethod) { -// // Can call MyClass::MyMethod() here. -// } - -#define FRIEND_TEST(test_case_name, test_name)\ -friend class test_case_name##_##test_name##_Test - -#endif // GTEST_INCLUDE_GTEST_GTEST_PROD_H_ -// Copyright 2008, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. 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. -// -// Author: mheule@google.com (Markus Heule) -// - -#ifndef GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_ -#define GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_ - -#include -#include - -namespace testing { - -// A copyable object representing the result of a test part (i.e. an -// assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()). -// -// Don't inherit from TestPartResult as its destructor is not virtual. -class GTEST_API_ TestPartResult { - public: - // The possible outcomes of a test part (i.e. an assertion or an - // explicit SUCCEED(), FAIL(), or ADD_FAILURE()). - enum Type { - kSuccess, // Succeeded. - kNonFatalFailure, // Failed but the test can continue. - kFatalFailure // Failed and the test should be terminated. - }; - - // C'tor. TestPartResult does NOT have a default constructor. - // Always use this constructor (with parameters) to create a - // TestPartResult object. - TestPartResult(Type a_type, - const char* a_file_name, - int a_line_number, - const char* a_message) - : type_(a_type), - file_name_(a_file_name == NULL ? "" : a_file_name), - line_number_(a_line_number), - summary_(ExtractSummary(a_message)), - message_(a_message) { - } - - // Gets the outcome of the test part. - Type type() const { return type_; } - - // Gets the name of the source file where the test part took place, or - // NULL if it's unknown. - const char* file_name() const { - return file_name_.empty() ? NULL : file_name_.c_str(); - } - - // Gets the line in the source file where the test part took place, - // or -1 if it's unknown. - int line_number() const { return line_number_; } - - // Gets the summary of the failure message. - const char* summary() const { return summary_.c_str(); } - - // Gets the message associated with the test part. - const char* message() const { return message_.c_str(); } - - // Returns true iff the test part passed. - bool passed() const { return type_ == kSuccess; } - - // Returns true iff the test part failed. - bool failed() const { return type_ != kSuccess; } - - // Returns true iff the test part non-fatally failed. - bool nonfatally_failed() const { return type_ == kNonFatalFailure; } - - // Returns true iff the test part fatally failed. - bool fatally_failed() const { return type_ == kFatalFailure; } - - private: - Type type_; - - // Gets the summary of the failure message by omitting the stack - // trace in it. - static std::string ExtractSummary(const char* message); - - // The name of the source file where the test part took place, or - // "" if the source file is unknown. - std::string file_name_; - // The line in the source file where the test part took place, or -1 - // if the line number is unknown. - int line_number_; - std::string summary_; // The test failure summary. - std::string message_; // The test failure message. -}; - -// Prints a TestPartResult object. -std::ostream& operator<<(std::ostream& os, const TestPartResult& result); - -// An array of TestPartResult objects. -// -// Don't inherit from TestPartResultArray as its destructor is not -// virtual. -class GTEST_API_ TestPartResultArray { - public: - TestPartResultArray() {} - - // Appends the given TestPartResult to the array. - void Append(const TestPartResult& result); - - // Returns the TestPartResult at the given index (0-based). - const TestPartResult& GetTestPartResult(int index) const; - - // Returns the number of TestPartResult objects in the array. - int size() const; - - private: - std::vector array_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray); -}; - -// This interface knows how to report a test part result. -class TestPartResultReporterInterface { - public: - virtual ~TestPartResultReporterInterface() {} - - virtual void ReportTestPartResult(const TestPartResult& result) = 0; -}; - -namespace internal { - -// This helper class is used by {ASSERT|EXPECT}_NO_FATAL_FAILURE to check if a -// statement generates new fatal failures. To do so it registers itself as the -// current test part result reporter. Besides checking if fatal failures were -// reported, it only delegates the reporting to the former result reporter. -// The original result reporter is restored in the destructor. -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -class GTEST_API_ HasNewFatalFailureHelper - : public TestPartResultReporterInterface { - public: - HasNewFatalFailureHelper(); - virtual ~HasNewFatalFailureHelper(); - virtual void ReportTestPartResult(const TestPartResult& result); - bool has_new_fatal_failure() const { return has_new_fatal_failure_; } - private: - bool has_new_fatal_failure_; - TestPartResultReporterInterface* original_reporter_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(HasNewFatalFailureHelper); -}; - -} // namespace internal - -} // namespace testing - -#endif // GTEST_INCLUDE_GTEST_GTEST_TEST_PART_H_ -// Copyright 2008 Google Inc. -// All Rights Reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. 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. -// -// Author: wan@google.com (Zhanyong Wan) - -#ifndef GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_ -#define GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_ - -// This header implements typed tests and type-parameterized tests. - -// Typed (aka type-driven) tests repeat the same test for types in a -// list. You must know which types you want to test with when writing -// typed tests. Here's how you do it: - -#if 0 - -// First, define a fixture class template. It should be parameterized -// by a type. Remember to derive it from testing::Test. -template -class FooTest : public testing::Test { - public: - ... - typedef std::list List; - static T shared_; - T value_; -}; - -// Next, associate a list of types with the test case, which will be -// repeated for each type in the list. The typedef is necessary for -// the macro to parse correctly. -typedef testing::Types MyTypes; -TYPED_TEST_CASE(FooTest, MyTypes); - -// If the type list contains only one type, you can write that type -// directly without Types<...>: -// TYPED_TEST_CASE(FooTest, int); - -// Then, use TYPED_TEST() instead of TEST_F() to define as many typed -// tests for this test case as you want. -TYPED_TEST(FooTest, DoesBlah) { - // Inside a test, refer to TypeParam to get the type parameter. - // Since we are inside a derived class template, C++ requires use to - // visit the members of FooTest via 'this'. - TypeParam n = this->value_; - - // To visit static members of the fixture, add the TestFixture:: - // prefix. - n += TestFixture::shared_; - - // To refer to typedefs in the fixture, add the "typename - // TestFixture::" prefix. - typename TestFixture::List values; - values.push_back(n); - ... -} - -TYPED_TEST(FooTest, HasPropertyA) { ... } - -#endif // 0 - -// Type-parameterized tests are abstract test patterns parameterized -// by a type. Compared with typed tests, type-parameterized tests -// allow you to define the test pattern without knowing what the type -// parameters are. The defined pattern can be instantiated with -// different types any number of times, in any number of translation -// units. -// -// If you are designing an interface or concept, you can define a -// suite of type-parameterized tests to verify properties that any -// valid implementation of the interface/concept should have. Then, -// each implementation can easily instantiate the test suite to verify -// that it conforms to the requirements, without having to write -// similar tests repeatedly. Here's an example: - -#if 0 - -// First, define a fixture class template. It should be parameterized -// by a type. Remember to derive it from testing::Test. -template -class FooTest : public testing::Test { - ... -}; - -// Next, declare that you will define a type-parameterized test case -// (the _P suffix is for "parameterized" or "pattern", whichever you -// prefer): -TYPED_TEST_CASE_P(FooTest); - -// Then, use TYPED_TEST_P() to define as many type-parameterized tests -// for this type-parameterized test case as you want. -TYPED_TEST_P(FooTest, DoesBlah) { - // Inside a test, refer to TypeParam to get the type parameter. - TypeParam n = 0; - ... -} - -TYPED_TEST_P(FooTest, HasPropertyA) { ... } - -// Now the tricky part: you need to register all test patterns before -// you can instantiate them. The first argument of the macro is the -// test case name; the rest are the names of the tests in this test -// case. -REGISTER_TYPED_TEST_CASE_P(FooTest, - DoesBlah, HasPropertyA); - -// Finally, you are free to instantiate the pattern with the types you -// want. If you put the above code in a header file, you can #include -// it in multiple C++ source files and instantiate it multiple times. -// -// To distinguish different instances of the pattern, the first -// argument to the INSTANTIATE_* macro is a prefix that will be added -// to the actual test case name. Remember to pick unique prefixes for -// different instances. -typedef testing::Types MyTypes; -INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes); - -// If the type list contains only one type, you can write that type -// directly without Types<...>: -// INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, int); - -#endif // 0 - - -// Implements typed tests. - -#if GTEST_HAS_TYPED_TEST - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Expands to the name of the typedef for the type parameters of the -// given test case. -# define GTEST_TYPE_PARAMS_(TestCaseName) gtest_type_params_##TestCaseName##_ - -// The 'Types' template argument below must have spaces around it -// since some compilers may choke on '>>' when passing a template -// instance (e.g. Types) -# define TYPED_TEST_CASE(CaseName, Types) \ - typedef ::testing::internal::TypeList< Types >::type \ - GTEST_TYPE_PARAMS_(CaseName) - -# define TYPED_TEST(CaseName, TestName) \ - template \ - class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \ - : public CaseName { \ - private: \ - typedef CaseName TestFixture; \ - typedef gtest_TypeParam_ TypeParam; \ - virtual void TestBody(); \ - }; \ - bool gtest_##CaseName##_##TestName##_registered_ GTEST_ATTRIBUTE_UNUSED_ = \ - ::testing::internal::TypeParameterizedTest< \ - CaseName, \ - ::testing::internal::TemplateSel< \ - GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \ - GTEST_TYPE_PARAMS_(CaseName)>::Register(\ - "", #CaseName, #TestName, 0); \ - template \ - void GTEST_TEST_CLASS_NAME_(CaseName, TestName)::TestBody() - -#endif // GTEST_HAS_TYPED_TEST - -// Implements type-parameterized tests. - -#if GTEST_HAS_TYPED_TEST_P - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Expands to the namespace name that the type-parameterized tests for -// the given type-parameterized test case are defined in. The exact -// name of the namespace is subject to change without notice. -# define GTEST_CASE_NAMESPACE_(TestCaseName) \ - gtest_case_##TestCaseName##_ - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// -// Expands to the name of the variable used to remember the names of -// the defined tests in the given test case. -# define GTEST_TYPED_TEST_CASE_P_STATE_(TestCaseName) \ - gtest_typed_test_case_p_state_##TestCaseName##_ - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY. -// -// Expands to the name of the variable used to remember the names of -// the registered tests in the given test case. -# define GTEST_REGISTERED_TEST_NAMES_(TestCaseName) \ - gtest_registered_test_names_##TestCaseName##_ - -// The variables defined in the type-parameterized test macros are -// static as typically these macros are used in a .h file that can be -// #included in multiple translation units linked together. -# define TYPED_TEST_CASE_P(CaseName) \ - static ::testing::internal::TypedTestCasePState \ - GTEST_TYPED_TEST_CASE_P_STATE_(CaseName) - -# define TYPED_TEST_P(CaseName, TestName) \ - namespace GTEST_CASE_NAMESPACE_(CaseName) { \ - template \ - class TestName : public CaseName { \ - private: \ - typedef CaseName TestFixture; \ - typedef gtest_TypeParam_ TypeParam; \ - virtual void TestBody(); \ - }; \ - static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \ - GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).AddTestName(\ - __FILE__, __LINE__, #CaseName, #TestName); \ - } \ - template \ - void GTEST_CASE_NAMESPACE_(CaseName)::TestName::TestBody() - -# define REGISTER_TYPED_TEST_CASE_P(CaseName, ...) \ - namespace GTEST_CASE_NAMESPACE_(CaseName) { \ - typedef ::testing::internal::Templates<__VA_ARGS__>::type gtest_AllTests_; \ - } \ - static const char* const GTEST_REGISTERED_TEST_NAMES_(CaseName) = \ - GTEST_TYPED_TEST_CASE_P_STATE_(CaseName).VerifyRegisteredTestNames(\ - __FILE__, __LINE__, #__VA_ARGS__) - -// The 'Types' template argument below must have spaces around it -// since some compilers may choke on '>>' when passing a template -// instance (e.g. Types) -# define INSTANTIATE_TYPED_TEST_CASE_P(Prefix, CaseName, Types) \ - bool gtest_##Prefix##_##CaseName GTEST_ATTRIBUTE_UNUSED_ = \ - ::testing::internal::TypeParameterizedTestCase::type>::Register(\ - #Prefix, #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName)) - -#endif // GTEST_HAS_TYPED_TEST_P - -#endif // GTEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_ - -// Depending on the platform, different string classes are available. -// On Linux, in addition to ::std::string, Google also makes use of -// class ::string, which has the same interface as ::std::string, but -// has a different implementation. -// -// The user can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that -// ::string is available AND is a distinct type to ::std::string, or -// define it to 0 to indicate otherwise. -// -// If the user's ::std::string and ::string are the same class due to -// aliasing, he should define GTEST_HAS_GLOBAL_STRING to 0. -// -// If the user doesn't define GTEST_HAS_GLOBAL_STRING, it is defined -// heuristically. - -namespace testing { - -// Declares the flags. - -// This flag temporary enables the disabled tests. -GTEST_DECLARE_bool_(also_run_disabled_tests); - -// This flag brings the debugger on an assertion failure. -GTEST_DECLARE_bool_(break_on_failure); - -// This flag controls whether Google Test catches all test-thrown exceptions -// and logs them as failures. -GTEST_DECLARE_bool_(catch_exceptions); - -// This flag enables using colors in terminal output. Available values are -// "yes" to enable colors, "no" (disable colors), or "auto" (the default) -// to let Google Test decide. -GTEST_DECLARE_string_(color); - -// This flag sets up the filter to select by name using a glob pattern -// the tests to run. If the filter is not given all tests are executed. -GTEST_DECLARE_string_(filter); - -// This flag causes the Google Test to list tests. None of the tests listed -// are actually run if the flag is provided. -GTEST_DECLARE_bool_(list_tests); - -// This flag controls whether Google Test emits a detailed XML report to a file -// in addition to its normal textual output. -GTEST_DECLARE_string_(output); - -// This flags control whether Google Test prints the elapsed time for each -// test. -GTEST_DECLARE_bool_(print_time); - -// This flag specifies the random number seed. -GTEST_DECLARE_int32_(random_seed); - -// This flag sets how many times the tests are repeated. The default value -// is 1. If the value is -1 the tests are repeating forever. -GTEST_DECLARE_int32_(repeat); - -// This flag controls whether Google Test includes Google Test internal -// stack frames in failure stack traces. -GTEST_DECLARE_bool_(show_internal_stack_frames); - -// When this flag is specified, tests' order is randomized on every iteration. -GTEST_DECLARE_bool_(shuffle); - -// This flag specifies the maximum number of stack frames to be -// printed in a failure message. -GTEST_DECLARE_int32_(stack_trace_depth); - -// When this flag is specified, a failed assertion will throw an -// exception if exceptions are enabled, or exit the program with a -// non-zero code otherwise. -GTEST_DECLARE_bool_(throw_on_failure); - -// When this flag is set with a "host:port" string, on supported -// platforms test results are streamed to the specified port on -// the specified host machine. -GTEST_DECLARE_string_(stream_result_to); - -// The upper limit for valid stack trace depths. -const int kMaxStackTraceDepth = 100; - -namespace internal { - -class AssertHelper; -class DefaultGlobalTestPartResultReporter; -class ExecDeathTest; -class NoExecDeathTest; -class FinalSuccessChecker; -class GTestFlagSaver; -class StreamingListenerTest; -class TestResultAccessor; -class TestEventListenersAccessor; -class TestEventRepeater; -class UnitTestRecordPropertyTestHelper; -class WindowsDeathTest; -class UnitTestImpl* GetUnitTestImpl(); -void ReportFailureInUnknownLocation(TestPartResult::Type result_type, - const std::string& message); - -} // namespace internal - -// The friend relationship of some of these classes is cyclic. -// If we don't forward declare them the compiler might confuse the classes -// in friendship clauses with same named classes on the scope. -class Test; -class TestCase; -class TestInfo; -class UnitTest; - -// A class for indicating whether an assertion was successful. When -// the assertion wasn't successful, the AssertionResult object -// remembers a non-empty message that describes how it failed. -// -// To create an instance of this class, use one of the factory functions -// (AssertionSuccess() and AssertionFailure()). -// -// This class is useful for two purposes: -// 1. Defining predicate functions to be used with Boolean test assertions -// EXPECT_TRUE/EXPECT_FALSE and their ASSERT_ counterparts -// 2. Defining predicate-format functions to be -// used with predicate assertions (ASSERT_PRED_FORMAT*, etc). -// -// For example, if you define IsEven predicate: -// -// testing::AssertionResult IsEven(int n) { -// if ((n % 2) == 0) -// return testing::AssertionSuccess(); -// else -// return testing::AssertionFailure() << n << " is odd"; -// } -// -// Then the failed expectation EXPECT_TRUE(IsEven(Fib(5))) -// will print the message -// -// Value of: IsEven(Fib(5)) -// Actual: false (5 is odd) -// Expected: true -// -// instead of a more opaque -// -// Value of: IsEven(Fib(5)) -// Actual: false -// Expected: true -// -// in case IsEven is a simple Boolean predicate. -// -// If you expect your predicate to be reused and want to support informative -// messages in EXPECT_FALSE and ASSERT_FALSE (negative assertions show up -// about half as often as positive ones in our tests), supply messages for -// both success and failure cases: -// -// testing::AssertionResult IsEven(int n) { -// if ((n % 2) == 0) -// return testing::AssertionSuccess() << n << " is even"; -// else -// return testing::AssertionFailure() << n << " is odd"; -// } -// -// Then a statement EXPECT_FALSE(IsEven(Fib(6))) will print -// -// Value of: IsEven(Fib(6)) -// Actual: true (8 is even) -// Expected: false -// -// NB: Predicates that support negative Boolean assertions have reduced -// performance in positive ones so be careful not to use them in tests -// that have lots (tens of thousands) of positive Boolean assertions. -// -// To use this class with EXPECT_PRED_FORMAT assertions such as: -// -// // Verifies that Foo() returns an even number. -// EXPECT_PRED_FORMAT1(IsEven, Foo()); -// -// you need to define: -// -// testing::AssertionResult IsEven(const char* expr, int n) { -// if ((n % 2) == 0) -// return testing::AssertionSuccess(); -// else -// return testing::AssertionFailure() -// << "Expected: " << expr << " is even\n Actual: it's " << n; -// } -// -// If Foo() returns 5, you will see the following message: -// -// Expected: Foo() is even -// Actual: it's 5 -// -class GTEST_API_ AssertionResult { - public: - // Copy constructor. - // Used in EXPECT_TRUE/FALSE(assertion_result). - AssertionResult(const AssertionResult& other); - // Used in the EXPECT_TRUE/FALSE(bool_expression). - explicit AssertionResult(bool success) : success_(success) {} - - // Returns true iff the assertion succeeded. - operator bool() const { return success_; } // NOLINT - - // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE. - AssertionResult operator!() const; - - // Returns the text streamed into this AssertionResult. Test assertions - // use it when they fail (i.e., the predicate's outcome doesn't match the - // assertion's expectation). When nothing has been streamed into the - // object, returns an empty string. - const char* message() const { - return message_.get() != NULL ? message_->c_str() : ""; - } - // TODO(vladl@google.com): Remove this after making sure no clients use it. - // Deprecated; please use message() instead. - const char* failure_message() const { return message(); } - - // Streams a custom failure message into this object. - template AssertionResult& operator<<(const T& value) { - AppendMessage(Message() << value); - return *this; - } - - // Allows streaming basic output manipulators such as endl or flush into - // this object. - AssertionResult& operator<<( - ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) { - AppendMessage(Message() << basic_manipulator); - return *this; - } - - private: - // Appends the contents of message to message_. - void AppendMessage(const Message& a_message) { - if (message_.get() == NULL) - message_.reset(new ::std::string); - message_->append(a_message.GetString().c_str()); - } - - // Stores result of the assertion predicate. - bool success_; - // Stores the message describing the condition in case the expectation - // construct is not satisfied with the predicate's outcome. - // Referenced via a pointer to avoid taking too much stack frame space - // with test assertions. - internal::scoped_ptr< ::std::string> message_; - - GTEST_DISALLOW_ASSIGN_(AssertionResult); -}; - -// Makes a successful assertion result. -GTEST_API_ AssertionResult AssertionSuccess(); - -// Makes a failed assertion result. -GTEST_API_ AssertionResult AssertionFailure(); - -// Makes a failed assertion result with the given failure message. -// Deprecated; use AssertionFailure() << msg. -GTEST_API_ AssertionResult AssertionFailure(const Message& msg); - -// The abstract class that all tests inherit from. -// -// In Google Test, a unit test program contains one or many TestCases, and -// each TestCase contains one or many Tests. -// -// When you define a test using the TEST macro, you don't need to -// explicitly derive from Test - the TEST macro automatically does -// this for you. -// -// The only time you derive from Test is when defining a test fixture -// to be used a TEST_F. For example: -// -// class FooTest : public testing::Test { -// protected: -// virtual void SetUp() { ... } -// virtual void TearDown() { ... } -// ... -// }; -// -// TEST_F(FooTest, Bar) { ... } -// TEST_F(FooTest, Baz) { ... } -// -// Test is not copyable. -class GTEST_API_ Test { - public: - friend class TestInfo; - - // Defines types for pointers to functions that set up and tear down - // a test case. - typedef internal::SetUpTestCaseFunc SetUpTestCaseFunc; - typedef internal::TearDownTestCaseFunc TearDownTestCaseFunc; - - // The d'tor is virtual as we intend to inherit from Test. - virtual ~Test(); - - // Sets up the stuff shared by all tests in this test case. - // - // Google Test will call Foo::SetUpTestCase() before running the first - // test in test case Foo. Hence a sub-class can define its own - // SetUpTestCase() method to shadow the one defined in the super - // class. - static void SetUpTestCase() {} - - // Tears down the stuff shared by all tests in this test case. - // - // Google Test will call Foo::TearDownTestCase() after running the last - // test in test case Foo. Hence a sub-class can define its own - // TearDownTestCase() method to shadow the one defined in the super - // class. - static void TearDownTestCase() {} - - // Returns true iff the current test has a fatal failure. - static bool HasFatalFailure(); - - // Returns true iff the current test has a non-fatal failure. - static bool HasNonfatalFailure(); - - // Returns true iff the current test has a (either fatal or - // non-fatal) failure. - static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); } - - // Logs a property for the current test, test case, or for the entire - // invocation of the test program when used outside of the context of a - // test case. Only the last value for a given key is remembered. These - // are public static so they can be called from utility functions that are - // not members of the test fixture. Calls to RecordProperty made during - // lifespan of the test (from the moment its constructor starts to the - // moment its destructor finishes) will be output in XML as attributes of - // the element. Properties recorded from fixture's - // SetUpTestCase or TearDownTestCase are logged as attributes of the - // corresponding element. Calls to RecordProperty made in the - // global context (before or after invocation of RUN_ALL_TESTS and from - // SetUp/TearDown method of Environment objects registered with Google - // Test) will be output as attributes of the element. - static void RecordProperty(const std::string& key, const std::string& value); - static void RecordProperty(const std::string& key, int value); - - protected: - // Creates a Test object. - Test(); - - // Sets up the test fixture. - virtual void SetUp(); - - // Tears down the test fixture. - virtual void TearDown(); - - private: - // Returns true iff the current test has the same fixture class as - // the first test in the current test case. - static bool HasSameFixtureClass(); - - // Runs the test after the test fixture has been set up. - // - // A sub-class must implement this to define the test logic. - // - // DO NOT OVERRIDE THIS FUNCTION DIRECTLY IN A USER PROGRAM. - // Instead, use the TEST or TEST_F macro. - virtual void TestBody() = 0; - - // Sets up, executes, and tears down the test. - void Run(); - - // Deletes self. We deliberately pick an unusual name for this - // internal method to avoid clashing with names used in user TESTs. - void DeleteSelf_() { delete this; } - - // Uses a GTestFlagSaver to save and restore all Google Test flags. - const internal::GTestFlagSaver* const gtest_flag_saver_; - - // Often a user mis-spells SetUp() as Setup() and spends a long time - // wondering why it is never called by Google Test. The declaration of - // the following method is solely for catching such an error at - // compile time: - // - // - The return type is deliberately chosen to be not void, so it - // will be a conflict if a user declares void Setup() in his test - // fixture. - // - // - This method is private, so it will be another compiler error - // if a user calls it from his test fixture. - // - // DO NOT OVERRIDE THIS FUNCTION. - // - // If you see an error about overriding the following function or - // about it being private, you have mis-spelled SetUp() as Setup(). - struct Setup_should_be_spelled_SetUp {}; - virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; } - - // We disallow copying Tests. - GTEST_DISALLOW_COPY_AND_ASSIGN_(Test); -}; - -typedef internal::TimeInMillis TimeInMillis; - -// A copyable object representing a user specified test property which can be -// output as a key/value string pair. -// -// Don't inherit from TestProperty as its destructor is not virtual. -class TestProperty { - public: - // C'tor. TestProperty does NOT have a default constructor. - // Always use this constructor (with parameters) to create a - // TestProperty object. - TestProperty(const std::string& a_key, const std::string& a_value) : - key_(a_key), value_(a_value) { - } - - // Gets the user supplied key. - const char* key() const { - return key_.c_str(); - } - - // Gets the user supplied value. - const char* value() const { - return value_.c_str(); - } - - // Sets a new value, overriding the one supplied in the constructor. - void SetValue(const std::string& new_value) { - value_ = new_value; - } - - private: - // The key supplied by the user. - std::string key_; - // The value supplied by the user. - std::string value_; -}; - -// The result of a single Test. This includes a list of -// TestPartResults, a list of TestProperties, a count of how many -// death tests there are in the Test, and how much time it took to run -// the Test. -// -// TestResult is not copyable. -class GTEST_API_ TestResult { - public: - // Creates an empty TestResult. - TestResult(); - - // D'tor. Do not inherit from TestResult. - ~TestResult(); - - // Gets the number of all test parts. This is the sum of the number - // of successful test parts and the number of failed test parts. - int total_part_count() const; - - // Returns the number of the test properties. - int test_property_count() const; - - // Returns true iff the test passed (i.e. no test part failed). - bool Passed() const { return !Failed(); } - - // Returns true iff the test failed. - bool Failed() const; - - // Returns true iff the test fatally failed. - bool HasFatalFailure() const; - - // Returns true iff the test has a non-fatal failure. - bool HasNonfatalFailure() const; - - // Returns the elapsed time, in milliseconds. - TimeInMillis elapsed_time() const { return elapsed_time_; } - - // Returns the i-th test part result among all the results. i can range - // from 0 to test_property_count() - 1. If i is not in that range, aborts - // the program. - const TestPartResult& GetTestPartResult(int i) const; - - // Returns the i-th test property. i can range from 0 to - // test_property_count() - 1. If i is not in that range, aborts the - // program. - const TestProperty& GetTestProperty(int i) const; - - private: - friend class TestInfo; - friend class TestCase; - friend class UnitTest; - friend class internal::DefaultGlobalTestPartResultReporter; - friend class internal::ExecDeathTest; - friend class internal::TestResultAccessor; - friend class internal::UnitTestImpl; - friend class internal::WindowsDeathTest; - - // Gets the vector of TestPartResults. - const std::vector& test_part_results() const { - return test_part_results_; - } - - // Gets the vector of TestProperties. - const std::vector& test_properties() const { - return test_properties_; - } - - // Sets the elapsed time. - void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; } - - // Adds a test property to the list. The property is validated and may add - // a non-fatal failure if invalid (e.g., if it conflicts with reserved - // key names). If a property is already recorded for the same key, the - // value will be updated, rather than storing multiple values for the same - // key. xml_element specifies the element for which the property is being - // recorded and is used for validation. - void RecordProperty(const std::string& xml_element, - const TestProperty& test_property); - - // Adds a failure if the key is a reserved attribute of Google Test - // testcase tags. Returns true if the property is valid. - // TODO(russr): Validate attribute names are legal and human readable. - static bool ValidateTestProperty(const std::string& xml_element, - const TestProperty& test_property); - - // Adds a test part result to the list. - void AddTestPartResult(const TestPartResult& test_part_result); - - // Returns the death test count. - int death_test_count() const { return death_test_count_; } - - // Increments the death test count, returning the new count. - int increment_death_test_count() { return ++death_test_count_; } - - // Clears the test part results. - void ClearTestPartResults(); - - // Clears the object. - void Clear(); - - // Protects mutable state of the property vector and of owned - // properties, whose values may be updated. - internal::Mutex test_properites_mutex_; - - // The vector of TestPartResults - std::vector test_part_results_; - // The vector of TestProperties - std::vector test_properties_; - // Running count of death tests. - int death_test_count_; - // The elapsed time, in milliseconds. - TimeInMillis elapsed_time_; - - // We disallow copying TestResult. - GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult); -}; // class TestResult - -// A TestInfo object stores the following information about a test: -// -// Test case name -// Test name -// Whether the test should be run -// A function pointer that creates the test object when invoked -// Test result -// -// The constructor of TestInfo registers itself with the UnitTest -// singleton such that the RUN_ALL_TESTS() macro knows which tests to -// run. -class GTEST_API_ TestInfo { - public: - // Destructs a TestInfo object. This function is not virtual, so - // don't inherit from TestInfo. - ~TestInfo(); - - // Returns the test case name. - const char* test_case_name() const { return test_case_name_.c_str(); } - - // Returns the test name. - const char* name() const { return name_.c_str(); } - - // Returns the name of the parameter type, or NULL if this is not a typed - // or a type-parameterized test. - const char* type_param() const { - if (type_param_.get() != NULL) - return type_param_->c_str(); - return NULL; - } - - // Returns the text representation of the value parameter, or NULL if this - // is not a value-parameterized test. - const char* value_param() const { - if (value_param_.get() != NULL) - return value_param_->c_str(); - return NULL; - } - - // Returns true if this test should run, that is if the test is not - // disabled (or it is disabled but the also_run_disabled_tests flag has - // been specified) and its full name matches the user-specified filter. - // - // Google Test allows the user to filter the tests by their full names. - // The full name of a test Bar in test case Foo is defined as - // "Foo.Bar". Only the tests that match the filter will run. - // - // A filter is a colon-separated list of glob (not regex) patterns, - // optionally followed by a '-' and a colon-separated list of - // negative patterns (tests to exclude). A test is run if it - // matches one of the positive patterns and does not match any of - // the negative patterns. - // - // For example, *A*:Foo.* is a filter that matches any string that - // contains the character 'A' or starts with "Foo.". - bool should_run() const { return should_run_; } - - // Returns true iff this test will appear in the XML report. - bool is_reportable() const { - // For now, the XML report includes all tests matching the filter. - // In the future, we may trim tests that are excluded because of - // sharding. - return matches_filter_; - } - - // Returns the result of the test. - const TestResult* result() const { return &result_; } - - private: -#if GTEST_HAS_DEATH_TEST - friend class internal::DefaultDeathTestFactory; -#endif // GTEST_HAS_DEATH_TEST - friend class Test; - friend class TestCase; - friend class internal::UnitTestImpl; - friend class internal::StreamingListenerTest; - friend TestInfo* internal::MakeAndRegisterTestInfo( - const char* test_case_name, - const char* name, - const char* type_param, - const char* value_param, - internal::TypeId fixture_class_id, - Test::SetUpTestCaseFunc set_up_tc, - Test::TearDownTestCaseFunc tear_down_tc, - internal::TestFactoryBase* factory); - - // Constructs a TestInfo object. The newly constructed instance assumes - // ownership of the factory object. - TestInfo(const std::string& test_case_name, - const std::string& name, - const char* a_type_param, // NULL if not a type-parameterized test - const char* a_value_param, // NULL if not a value-parameterized test - internal::TypeId fixture_class_id, - internal::TestFactoryBase* factory); - - // Increments the number of death tests encountered in this test so - // far. - int increment_death_test_count() { - return result_.increment_death_test_count(); - } - - // Creates the test object, runs it, records its result, and then - // deletes it. - void Run(); - - static void ClearTestResult(TestInfo* test_info) { - test_info->result_.Clear(); - } - - // These fields are immutable properties of the test. - const std::string test_case_name_; // Test case name - const std::string name_; // Test name - // Name of the parameter type, or NULL if this is not a typed or a - // type-parameterized test. - const internal::scoped_ptr type_param_; - // Text representation of the value parameter, or NULL if this is not a - // value-parameterized test. - const internal::scoped_ptr value_param_; - const internal::TypeId fixture_class_id_; // ID of the test fixture class - bool should_run_; // True iff this test should run - bool is_disabled_; // True iff this test is disabled - bool matches_filter_; // True if this test matches the - // user-specified filter. - internal::TestFactoryBase* const factory_; // The factory that creates - // the test object - - // This field is mutable and needs to be reset before running the - // test for the second time. - TestResult result_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo); -}; - -// A test case, which consists of a vector of TestInfos. -// -// TestCase is not copyable. -class GTEST_API_ TestCase { - public: - // Creates a TestCase with the given name. - // - // TestCase does NOT have a default constructor. Always use this - // constructor to create a TestCase object. - // - // Arguments: - // - // name: name of the test case - // a_type_param: the name of the test's type parameter, or NULL if - // this is not a type-parameterized test. - // set_up_tc: pointer to the function that sets up the test case - // tear_down_tc: pointer to the function that tears down the test case - TestCase(const char* name, const char* a_type_param, - Test::SetUpTestCaseFunc set_up_tc, - Test::TearDownTestCaseFunc tear_down_tc); - - // Destructor of TestCase. - virtual ~TestCase(); - - // Gets the name of the TestCase. - const char* name() const { return name_.c_str(); } - - // Returns the name of the parameter type, or NULL if this is not a - // type-parameterized test case. - const char* type_param() const { - if (type_param_.get() != NULL) - return type_param_->c_str(); - return NULL; - } - - // Returns true if any test in this test case should run. - bool should_run() const { return should_run_; } - - // Gets the number of successful tests in this test case. - int successful_test_count() const; - - // Gets the number of failed tests in this test case. - int failed_test_count() const; - - // Gets the number of disabled tests that will be reported in the XML report. - int reportable_disabled_test_count() const; - - // Gets the number of disabled tests in this test case. - int disabled_test_count() const; - - // Gets the number of tests to be printed in the XML report. - int reportable_test_count() const; - - // Get the number of tests in this test case that should run. - int test_to_run_count() const; - - // Gets the number of all tests in this test case. - int total_test_count() const; - - // Returns true iff the test case passed. - bool Passed() const { return !Failed(); } - - // Returns true iff the test case failed. - bool Failed() const { return failed_test_count() > 0; } - - // Returns the elapsed time, in milliseconds. - TimeInMillis elapsed_time() const { return elapsed_time_; } - - // Returns the i-th test among all the tests. i can range from 0 to - // total_test_count() - 1. If i is not in that range, returns NULL. - const TestInfo* GetTestInfo(int i) const; - - // Returns the TestResult that holds test properties recorded during - // execution of SetUpTestCase and TearDownTestCase. - const TestResult& ad_hoc_test_result() const { return ad_hoc_test_result_; } - - private: - friend class Test; - friend class internal::UnitTestImpl; - - // Gets the (mutable) vector of TestInfos in this TestCase. - std::vector& test_info_list() { return test_info_list_; } - - // Gets the (immutable) vector of TestInfos in this TestCase. - const std::vector& test_info_list() const { - return test_info_list_; - } - - // Returns the i-th test among all the tests. i can range from 0 to - // total_test_count() - 1. If i is not in that range, returns NULL. - TestInfo* GetMutableTestInfo(int i); - - // Sets the should_run member. - void set_should_run(bool should) { should_run_ = should; } - - // Adds a TestInfo to this test case. Will delete the TestInfo upon - // destruction of the TestCase object. - void AddTestInfo(TestInfo * test_info); - - // Clears the results of all tests in this test case. - void ClearResult(); - - // Clears the results of all tests in the given test case. - static void ClearTestCaseResult(TestCase* test_case) { - test_case->ClearResult(); - } - - // Runs every test in this TestCase. - void Run(); - - // Runs SetUpTestCase() for this TestCase. This wrapper is needed - // for catching exceptions thrown from SetUpTestCase(). - void RunSetUpTestCase() { (*set_up_tc_)(); } - - // Runs TearDownTestCase() for this TestCase. This wrapper is - // needed for catching exceptions thrown from TearDownTestCase(). - void RunTearDownTestCase() { (*tear_down_tc_)(); } - - // Returns true iff test passed. - static bool TestPassed(const TestInfo* test_info) { - return test_info->should_run() && test_info->result()->Passed(); - } - - // Returns true iff test failed. - static bool TestFailed(const TestInfo* test_info) { - return test_info->should_run() && test_info->result()->Failed(); - } - - // Returns true iff the test is disabled and will be reported in the XML - // report. - static bool TestReportableDisabled(const TestInfo* test_info) { - return test_info->is_reportable() && test_info->is_disabled_; - } - - // Returns true iff test is disabled. - static bool TestDisabled(const TestInfo* test_info) { - return test_info->is_disabled_; - } - - // Returns true iff this test will appear in the XML report. - static bool TestReportable(const TestInfo* test_info) { - return test_info->is_reportable(); - } - - // Returns true if the given test should run. - static bool ShouldRunTest(const TestInfo* test_info) { - return test_info->should_run(); - } - - // Shuffles the tests in this test case. - void ShuffleTests(internal::Random* random); - - // Restores the test order to before the first shuffle. - void UnshuffleTests(); - - // Name of the test case. - std::string name_; - // Name of the parameter type, or NULL if this is not a typed or a - // type-parameterized test. - const internal::scoped_ptr type_param_; - // The vector of TestInfos in their original order. It owns the - // elements in the vector. - std::vector test_info_list_; - // Provides a level of indirection for the test list to allow easy - // shuffling and restoring the test order. The i-th element in this - // vector is the index of the i-th test in the shuffled test list. - std::vector test_indices_; - // Pointer to the function that sets up the test case. - Test::SetUpTestCaseFunc set_up_tc_; - // Pointer to the function that tears down the test case. - Test::TearDownTestCaseFunc tear_down_tc_; - // True iff any test in this test case should run. - bool should_run_; - // Elapsed time, in milliseconds. - TimeInMillis elapsed_time_; - // Holds test properties recorded during execution of SetUpTestCase and - // TearDownTestCase. - TestResult ad_hoc_test_result_; - - // We disallow copying TestCases. - GTEST_DISALLOW_COPY_AND_ASSIGN_(TestCase); -}; - -// An Environment object is capable of setting up and tearing down an -// environment. The user should subclass this to define his own -// environment(s). -// -// An Environment object does the set-up and tear-down in virtual -// methods SetUp() and TearDown() instead of the constructor and the -// destructor, as: -// -// 1. You cannot safely throw from a destructor. This is a problem -// as in some cases Google Test is used where exceptions are enabled, and -// we may want to implement ASSERT_* using exceptions where they are -// available. -// 2. You cannot use ASSERT_* directly in a constructor or -// destructor. -class Environment { - public: - // The d'tor is virtual as we need to subclass Environment. - virtual ~Environment() {} - - // Override this to define how to set up the environment. - virtual void SetUp() {} - - // Override this to define how to tear down the environment. - virtual void TearDown() {} - private: - // If you see an error about overriding the following function or - // about it being private, you have mis-spelled SetUp() as Setup(). - struct Setup_should_be_spelled_SetUp {}; - virtual Setup_should_be_spelled_SetUp* Setup() { return NULL; } -}; - -// The interface for tracing execution of tests. The methods are organized in -// the order the corresponding events are fired. -class TestEventListener { - public: - virtual ~TestEventListener() {} - - // Fired before any test activity starts. - virtual void OnTestProgramStart(const UnitTest& unit_test) = 0; - - // Fired before each iteration of tests starts. There may be more than - // one iteration if GTEST_FLAG(repeat) is set. iteration is the iteration - // index, starting from 0. - virtual void OnTestIterationStart(const UnitTest& unit_test, - int iteration) = 0; - - // Fired before environment set-up for each iteration of tests starts. - virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) = 0; - - // Fired after environment set-up for each iteration of tests ends. - virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0; - - // Fired before the test case starts. - virtual void OnTestCaseStart(const TestCase& test_case) = 0; - - // Fired before the test starts. - virtual void OnTestStart(const TestInfo& test_info) = 0; - - // Fired after a failed assertion or a SUCCEED() invocation. - virtual void OnTestPartResult(const TestPartResult& test_part_result) = 0; - - // Fired after the test ends. - virtual void OnTestEnd(const TestInfo& test_info) = 0; - - // Fired after the test case ends. - virtual void OnTestCaseEnd(const TestCase& test_case) = 0; - - // Fired before environment tear-down for each iteration of tests starts. - virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) = 0; - - // Fired after environment tear-down for each iteration of tests ends. - virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) = 0; - - // Fired after each iteration of tests finishes. - virtual void OnTestIterationEnd(const UnitTest& unit_test, - int iteration) = 0; - - // Fired after all test activities have ended. - virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0; -}; - -// The convenience class for users who need to override just one or two -// methods and are not concerned that a possible change to a signature of -// the methods they override will not be caught during the build. For -// comments about each method please see the definition of TestEventListener -// above. -class EmptyTestEventListener : public TestEventListener { - public: - virtual void OnTestProgramStart(const UnitTest& /*unit_test*/) {} - virtual void OnTestIterationStart(const UnitTest& /*unit_test*/, - int /*iteration*/) {} - virtual void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) {} - virtual void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) {} - virtual void OnTestCaseStart(const TestCase& /*test_case*/) {} - virtual void OnTestStart(const TestInfo& /*test_info*/) {} - virtual void OnTestPartResult(const TestPartResult& /*test_part_result*/) {} - virtual void OnTestEnd(const TestInfo& /*test_info*/) {} - virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {} - virtual void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) {} - virtual void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) {} - virtual void OnTestIterationEnd(const UnitTest& /*unit_test*/, - int /*iteration*/) {} - virtual void OnTestProgramEnd(const UnitTest& /*unit_test*/) {} -}; - -// TestEventListeners lets users add listeners to track events in Google Test. -class GTEST_API_ TestEventListeners { - public: - TestEventListeners(); - ~TestEventListeners(); - - // Appends an event listener to the end of the list. Google Test assumes - // the ownership of the listener (i.e. it will delete the listener when - // the test program finishes). - void Append(TestEventListener* listener); - - // Removes the given event listener from the list and returns it. It then - // becomes the caller's responsibility to delete the listener. Returns - // NULL if the listener is not found in the list. - TestEventListener* Release(TestEventListener* listener); - - // Returns the standard listener responsible for the default console - // output. Can be removed from the listeners list to shut down default - // console output. Note that removing this object from the listener list - // with Release transfers its ownership to the caller and makes this - // function return NULL the next time. - TestEventListener* default_result_printer() const { - return default_result_printer_; - } - - // Returns the standard listener responsible for the default XML output - // controlled by the --gtest_output=xml flag. Can be removed from the - // listeners list by users who want to shut down the default XML output - // controlled by this flag and substitute it with custom one. Note that - // removing this object from the listener list with Release transfers its - // ownership to the caller and makes this function return NULL the next - // time. - TestEventListener* default_xml_generator() const { - return default_xml_generator_; - } - - private: - friend class TestCase; - friend class TestInfo; - friend class internal::DefaultGlobalTestPartResultReporter; - friend class internal::NoExecDeathTest; - friend class internal::TestEventListenersAccessor; - friend class internal::UnitTestImpl; - - // Returns repeater that broadcasts the TestEventListener events to all - // subscribers. - TestEventListener* repeater(); - - // Sets the default_result_printer attribute to the provided listener. - // The listener is also added to the listener list and previous - // default_result_printer is removed from it and deleted. The listener can - // also be NULL in which case it will not be added to the list. Does - // nothing if the previous and the current listener objects are the same. - void SetDefaultResultPrinter(TestEventListener* listener); - - // Sets the default_xml_generator attribute to the provided listener. The - // listener is also added to the listener list and previous - // default_xml_generator is removed from it and deleted. The listener can - // also be NULL in which case it will not be added to the list. Does - // nothing if the previous and the current listener objects are the same. - void SetDefaultXmlGenerator(TestEventListener* listener); - - // Controls whether events will be forwarded by the repeater to the - // listeners in the list. - bool EventForwardingEnabled() const; - void SuppressEventForwarding(); - - // The actual list of listeners. - internal::TestEventRepeater* repeater_; - // Listener responsible for the standard result output. - TestEventListener* default_result_printer_; - // Listener responsible for the creation of the XML output file. - TestEventListener* default_xml_generator_; - - // We disallow copying TestEventListeners. - GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners); -}; - -// A UnitTest consists of a vector of TestCases. -// -// This is a singleton class. The only instance of UnitTest is -// created when UnitTest::GetInstance() is first called. This -// instance is never deleted. -// -// UnitTest is not copyable. -// -// This class is thread-safe as long as the methods are called -// according to their specification. -class GTEST_API_ UnitTest { - public: - // Gets the singleton UnitTest object. The first time this method - // is called, a UnitTest object is constructed and returned. - // Consecutive calls will return the same object. - static UnitTest* GetInstance(); - - // Runs all tests in this UnitTest object and prints the result. - // Returns 0 if successful, or 1 otherwise. - // - // This method can only be called from the main thread. - // - // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. - int Run() GTEST_MUST_USE_RESULT_; - - // Returns the working directory when the first TEST() or TEST_F() - // was executed. The UnitTest object owns the string. - const char* original_working_dir() const; - - // Returns the TestCase object for the test that's currently running, - // or NULL if no test is running. - const TestCase* current_test_case() const - GTEST_LOCK_EXCLUDED_(mutex_); - - // Returns the TestInfo object for the test that's currently running, - // or NULL if no test is running. - const TestInfo* current_test_info() const - GTEST_LOCK_EXCLUDED_(mutex_); - - // Returns the random seed used at the start of the current test run. - int random_seed() const; - -#if GTEST_HAS_PARAM_TEST - // Returns the ParameterizedTestCaseRegistry object used to keep track of - // value-parameterized tests and instantiate and register them. - // - // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. - internal::ParameterizedTestCaseRegistry& parameterized_test_registry() - GTEST_LOCK_EXCLUDED_(mutex_); -#endif // GTEST_HAS_PARAM_TEST - - // Gets the number of successful test cases. - int successful_test_case_count() const; - - // Gets the number of failed test cases. - int failed_test_case_count() const; - - // Gets the number of all test cases. - int total_test_case_count() const; - - // Gets the number of all test cases that contain at least one test - // that should run. - int test_case_to_run_count() const; - - // Gets the number of successful tests. - int successful_test_count() const; - - // Gets the number of failed tests. - int failed_test_count() const; - - // Gets the number of disabled tests that will be reported in the XML report. - int reportable_disabled_test_count() const; - - // Gets the number of disabled tests. - int disabled_test_count() const; - - // Gets the number of tests to be printed in the XML report. - int reportable_test_count() const; - - // Gets the number of all tests. - int total_test_count() const; - - // Gets the number of tests that should run. - int test_to_run_count() const; - - // Gets the time of the test program start, in ms from the start of the - // UNIX epoch. - TimeInMillis start_timestamp() const; - - // Gets the elapsed time, in milliseconds. - TimeInMillis elapsed_time() const; - - // Returns true iff the unit test passed (i.e. all test cases passed). - bool Passed() const; - - // Returns true iff the unit test failed (i.e. some test case failed - // or something outside of all tests failed). - bool Failed() const; - - // Gets the i-th test case among all the test cases. i can range from 0 to - // total_test_case_count() - 1. If i is not in that range, returns NULL. - const TestCase* GetTestCase(int i) const; - - // Returns the TestResult containing information on test failures and - // properties logged outside of individual test cases. - const TestResult& ad_hoc_test_result() const; - - // Returns the list of event listeners that can be used to track events - // inside Google Test. - TestEventListeners& listeners(); - - private: - // Registers and returns a global test environment. When a test - // program is run, all global test environments will be set-up in - // the order they were registered. After all tests in the program - // have finished, all global test environments will be torn-down in - // the *reverse* order they were registered. - // - // The UnitTest object takes ownership of the given environment. - // - // This method can only be called from the main thread. - Environment* AddEnvironment(Environment* env); - - // Adds a TestPartResult to the current TestResult object. All - // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) - // eventually call this to report their results. The user code - // should use the assertion macros instead of calling this directly. - void AddTestPartResult(TestPartResult::Type result_type, - const char* file_name, - int line_number, - const std::string& message, - const std::string& os_stack_trace) - GTEST_LOCK_EXCLUDED_(mutex_); - - // Adds a TestProperty to the current TestResult object when invoked from - // inside a test, to current TestCase's ad_hoc_test_result_ when invoked - // from SetUpTestCase or TearDownTestCase, or to the global property set - // when invoked elsewhere. If the result already contains a property with - // the same key, the value will be updated. - void RecordProperty(const std::string& key, const std::string& value); - - // Gets the i-th test case among all the test cases. i can range from 0 to - // total_test_case_count() - 1. If i is not in that range, returns NULL. - TestCase* GetMutableTestCase(int i); - - // Accessors for the implementation object. - internal::UnitTestImpl* impl() { return impl_; } - const internal::UnitTestImpl* impl() const { return impl_; } - - // These classes and funcions are friends as they need to access private - // members of UnitTest. - friend class Test; - friend class internal::AssertHelper; - friend class internal::ScopedTrace; - friend class internal::StreamingListenerTest; - friend class internal::UnitTestRecordPropertyTestHelper; - friend Environment* AddGlobalTestEnvironment(Environment* env); - friend internal::UnitTestImpl* internal::GetUnitTestImpl(); - friend void internal::ReportFailureInUnknownLocation( - TestPartResult::Type result_type, - const std::string& message); - - // Creates an empty UnitTest. - UnitTest(); - - // D'tor - virtual ~UnitTest(); - - // Pushes a trace defined by SCOPED_TRACE() on to the per-thread - // Google Test trace stack. - void PushGTestTrace(const internal::TraceInfo& trace) - GTEST_LOCK_EXCLUDED_(mutex_); - - // Pops a trace from the per-thread Google Test trace stack. - void PopGTestTrace() - GTEST_LOCK_EXCLUDED_(mutex_); - - // Protects mutable state in *impl_. This is mutable as some const - // methods need to lock it too. - mutable internal::Mutex mutex_; - - // Opaque implementation object. This field is never changed once - // the object is constructed. We don't mark it as const here, as - // doing so will cause a warning in the constructor of UnitTest. - // Mutable state in *impl_ is protected by mutex_. - internal::UnitTestImpl* impl_; - - // We disallow copying UnitTest. - GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest); -}; - -// A convenient wrapper for adding an environment for the test -// program. -// -// You should call this before RUN_ALL_TESTS() is called, probably in -// main(). If you use gtest_main, you need to call this before main() -// starts for it to take effect. For example, you can define a global -// variable like this: -// -// testing::Environment* const foo_env = -// testing::AddGlobalTestEnvironment(new FooEnvironment); -// -// However, we strongly recommend you to write your own main() and -// call AddGlobalTestEnvironment() there, as relying on initialization -// of global variables makes the code harder to read and may cause -// problems when you register multiple environments from different -// translation units and the environments have dependencies among them -// (remember that the compiler doesn't guarantee the order in which -// global variables from different translation units are initialized). -inline Environment* AddGlobalTestEnvironment(Environment* env) { - return UnitTest::GetInstance()->AddEnvironment(env); -} - -// Initializes Google Test. This must be called before calling -// RUN_ALL_TESTS(). In particular, it parses a command line for the -// flags that Google Test recognizes. Whenever a Google Test flag is -// seen, it is removed from argv, and *argc is decremented. -// -// No value is returned. Instead, the Google Test flag variables are -// updated. -// -// Calling the function for the second time has no user-visible effect. -GTEST_API_ void InitGoogleTest(int* argc, char** argv); - -// This overloaded version can be used in Windows programs compiled in -// UNICODE mode. -GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv); - -namespace internal { - -// FormatForComparison::Format(value) formats a -// value of type ToPrint that is an operand of a comparison assertion -// (e.g. ASSERT_EQ). OtherOperand is the type of the other operand in -// the comparison, and is used to help determine the best way to -// format the value. In particular, when the value is a C string -// (char pointer) and the other operand is an STL string object, we -// want to format the C string as a string, since we know it is -// compared by value with the string object. If the value is a char -// pointer but the other operand is not an STL string object, we don't -// know whether the pointer is supposed to point to a NUL-terminated -// string, and thus want to print it as a pointer to be safe. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. - -// The default case. -template -class FormatForComparison { - public: - static ::std::string Format(const ToPrint& value) { - return ::testing::PrintToString(value); - } -}; - -// Array. -template -class FormatForComparison { - public: - static ::std::string Format(const ToPrint* value) { - return FormatForComparison::Format(value); - } -}; - -// By default, print C string as pointers to be safe, as we don't know -// whether they actually point to a NUL-terminated string. - -#define GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(CharType) \ - template \ - class FormatForComparison { \ - public: \ - static ::std::string Format(CharType* value) { \ - return ::testing::PrintToString(static_cast(value)); \ - } \ - } - -GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char); -GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const char); -GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(wchar_t); -GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const wchar_t); - -#undef GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_ - -// If a C string is compared with an STL string object, we know it's meant -// to point to a NUL-terminated string, and thus can print it as a string. - -#define GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType) \ - template <> \ - class FormatForComparison { \ - public: \ - static ::std::string Format(CharType* value) { \ - return ::testing::PrintToString(value); \ - } \ - } - -GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::std::string); -GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::std::string); - -#if GTEST_HAS_GLOBAL_STRING -GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::string); -GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::string); -#endif - -#if GTEST_HAS_GLOBAL_WSTRING -GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::wstring); -GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::wstring); -#endif - -#if GTEST_HAS_STD_WSTRING -GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::std::wstring); -GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::std::wstring); -#endif - -#undef GTEST_IMPL_FORMAT_C_STRING_AS_STRING_ - -// Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc) -// operand to be used in a failure message. The type (but not value) -// of the other operand may affect the format. This allows us to -// print a char* as a raw pointer when it is compared against another -// char* or void*, and print it as a C string when it is compared -// against an std::string object, for example. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -template -std::string FormatForComparisonFailureMessage( - const T1& value, const T2& /* other_operand */) { - return FormatForComparison::Format(value); -} - -// The helper function for {ASSERT|EXPECT}_EQ. -template -AssertionResult CmpHelperEQ(const char* expected_expression, - const char* actual_expression, - const T1& expected, - const T2& actual) { -#ifdef _MSC_VER -# pragma warning(push) // Saves the current warning state. -# pragma warning(disable:4389) // Temporarily disables warning on - // signed/unsigned mismatch. -#endif - - if (expected == actual) { - return AssertionSuccess(); - } - -#ifdef _MSC_VER -# pragma warning(pop) // Restores the warning state. -#endif - - return EqFailure(expected_expression, - actual_expression, - FormatForComparisonFailureMessage(expected, actual), - FormatForComparisonFailureMessage(actual, expected), - false); -} - -// With this overloaded version, we allow anonymous enums to be used -// in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums -// can be implicitly cast to BiggestInt. -GTEST_API_ AssertionResult CmpHelperEQ(const char* expected_expression, - const char* actual_expression, - BiggestInt expected, - BiggestInt actual); - -// The helper class for {ASSERT|EXPECT}_EQ. The template argument -// lhs_is_null_literal is true iff the first argument to ASSERT_EQ() -// is a null pointer literal. The following default implementation is -// for lhs_is_null_literal being false. -template -class EqHelper { - public: - // This templatized version is for the general case. - template - static AssertionResult Compare(const char* expected_expression, - const char* actual_expression, - const T1& expected, - const T2& actual) { - return CmpHelperEQ(expected_expression, actual_expression, expected, - actual); - } - - // With this overloaded version, we allow anonymous enums to be used - // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous - // enums can be implicitly cast to BiggestInt. - // - // Even though its body looks the same as the above version, we - // cannot merge the two, as it will make anonymous enums unhappy. - static AssertionResult Compare(const char* expected_expression, - const char* actual_expression, - BiggestInt expected, - BiggestInt actual) { - return CmpHelperEQ(expected_expression, actual_expression, expected, - actual); - } -}; - -// This specialization is used when the first argument to ASSERT_EQ() -// is a null pointer literal, like NULL, false, or 0. -template <> -class EqHelper { - public: - // We define two overloaded versions of Compare(). The first - // version will be picked when the second argument to ASSERT_EQ() is - // NOT a pointer, e.g. ASSERT_EQ(0, AnIntFunction()) or - // EXPECT_EQ(false, a_bool). - template - static AssertionResult Compare( - const char* expected_expression, - const char* actual_expression, - const T1& expected, - const T2& actual, - // The following line prevents this overload from being considered if T2 - // is not a pointer type. We need this because ASSERT_EQ(NULL, my_ptr) - // expands to Compare("", "", NULL, my_ptr), which requires a conversion - // to match the Secret* in the other overload, which would otherwise make - // this template match better. - typename EnableIf::value>::type* = 0) { - return CmpHelperEQ(expected_expression, actual_expression, expected, - actual); - } - - // This version will be picked when the second argument to ASSERT_EQ() is a - // pointer, e.g. ASSERT_EQ(NULL, a_pointer). - template - static AssertionResult Compare( - const char* expected_expression, - const char* actual_expression, - // We used to have a second template parameter instead of Secret*. That - // template parameter would deduce to 'long', making this a better match - // than the first overload even without the first overload's EnableIf. - // Unfortunately, gcc with -Wconversion-null warns when "passing NULL to - // non-pointer argument" (even a deduced integral argument), so the old - // implementation caused warnings in user code. - Secret* /* expected (NULL) */, - T* actual) { - // We already know that 'expected' is a null pointer. - return CmpHelperEQ(expected_expression, actual_expression, - static_cast(NULL), actual); - } -}; - -// A macro for implementing the helper functions needed to implement -// ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste -// of similar code. -// -// For each templatized helper function, we also define an overloaded -// version for BiggestInt in order to reduce code bloat and allow -// anonymous enums to be used with {ASSERT|EXPECT}_?? when compiled -// with gcc 4. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -#define GTEST_IMPL_CMP_HELPER_(op_name, op)\ -template \ -AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \ - const T1& val1, const T2& val2) {\ - if (val1 op val2) {\ - return AssertionSuccess();\ - } else {\ - return AssertionFailure() \ - << "Expected: (" << expr1 << ") " #op " (" << expr2\ - << "), actual: " << FormatForComparisonFailureMessage(val1, val2)\ - << " vs " << FormatForComparisonFailureMessage(val2, val1);\ - }\ -}\ -GTEST_API_ AssertionResult CmpHelper##op_name(\ - const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2) - -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. - -// Implements the helper function for {ASSERT|EXPECT}_NE -GTEST_IMPL_CMP_HELPER_(NE, !=); -// Implements the helper function for {ASSERT|EXPECT}_LE -GTEST_IMPL_CMP_HELPER_(LE, <=); -// Implements the helper function for {ASSERT|EXPECT}_LT -GTEST_IMPL_CMP_HELPER_(LT, <); -// Implements the helper function for {ASSERT|EXPECT}_GE -GTEST_IMPL_CMP_HELPER_(GE, >=); -// Implements the helper function for {ASSERT|EXPECT}_GT -GTEST_IMPL_CMP_HELPER_(GT, >); - -#undef GTEST_IMPL_CMP_HELPER_ - -// The helper function for {ASSERT|EXPECT}_STREQ. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression, - const char* actual_expression, - const char* expected, - const char* actual); - -// The helper function for {ASSERT|EXPECT}_STRCASEEQ. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* expected_expression, - const char* actual_expression, - const char* expected, - const char* actual); - -// The helper function for {ASSERT|EXPECT}_STRNE. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, - const char* s2_expression, - const char* s1, - const char* s2); - -// The helper function for {ASSERT|EXPECT}_STRCASENE. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression, - const char* s2_expression, - const char* s1, - const char* s2); - - -// Helper function for *_STREQ on wide strings. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression, - const char* actual_expression, - const wchar_t* expected, - const wchar_t* actual); - -// Helper function for *_STRNE on wide strings. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression, - const char* s2_expression, - const wchar_t* s1, - const wchar_t* s2); - -} // namespace internal - -// IsSubstring() and IsNotSubstring() are intended to be used as the -// first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by -// themselves. They check whether needle is a substring of haystack -// (NULL is considered a substring of itself only), and return an -// appropriate error message when they fail. -// -// The {needle,haystack}_expr arguments are the stringified -// expressions that generated the two real arguments. -GTEST_API_ AssertionResult IsSubstring( - const char* needle_expr, const char* haystack_expr, - const char* needle, const char* haystack); -GTEST_API_ AssertionResult IsSubstring( - const char* needle_expr, const char* haystack_expr, - const wchar_t* needle, const wchar_t* haystack); -GTEST_API_ AssertionResult IsNotSubstring( - const char* needle_expr, const char* haystack_expr, - const char* needle, const char* haystack); -GTEST_API_ AssertionResult IsNotSubstring( - const char* needle_expr, const char* haystack_expr, - const wchar_t* needle, const wchar_t* haystack); -GTEST_API_ AssertionResult IsSubstring( - const char* needle_expr, const char* haystack_expr, - const ::std::string& needle, const ::std::string& haystack); -GTEST_API_ AssertionResult IsNotSubstring( - const char* needle_expr, const char* haystack_expr, - const ::std::string& needle, const ::std::string& haystack); - -#if GTEST_HAS_STD_WSTRING -GTEST_API_ AssertionResult IsSubstring( - const char* needle_expr, const char* haystack_expr, - const ::std::wstring& needle, const ::std::wstring& haystack); -GTEST_API_ AssertionResult IsNotSubstring( - const char* needle_expr, const char* haystack_expr, - const ::std::wstring& needle, const ::std::wstring& haystack); -#endif // GTEST_HAS_STD_WSTRING - -namespace internal { - -// Helper template function for comparing floating-points. -// -// Template parameter: -// -// RawType: the raw floating-point type (either float or double) -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -template -AssertionResult CmpHelperFloatingPointEQ(const char* expected_expression, - const char* actual_expression, - RawType expected, - RawType actual) { - const FloatingPoint lhs(expected), rhs(actual); - - if (lhs.AlmostEquals(rhs)) { - return AssertionSuccess(); - } - - ::std::stringstream expected_ss; - expected_ss << std::setprecision(std::numeric_limits::digits10 + 2) - << expected; - - ::std::stringstream actual_ss; - actual_ss << std::setprecision(std::numeric_limits::digits10 + 2) - << actual; - - return EqFailure(expected_expression, - actual_expression, - StringStreamToString(&expected_ss), - StringStreamToString(&actual_ss), - false); -} - -// Helper function for implementing ASSERT_NEAR. -// -// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM. -GTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1, - const char* expr2, - const char* abs_error_expr, - double val1, - double val2, - double abs_error); - -// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. -// A class that enables one to stream messages to assertion macros -class GTEST_API_ AssertHelper { - public: - // Constructor. - AssertHelper(TestPartResult::Type type, - const char* file, - int line, - const char* message); - ~AssertHelper(); - - // Message assignment is a semantic trick to enable assertion - // streaming; see the GTEST_MESSAGE_ macro below. - void operator=(const Message& message) const; - - private: - // We put our data in a struct so that the size of the AssertHelper class can - // be as small as possible. This is important because gcc is incapable of - // re-using stack space even for temporary variables, so every EXPECT_EQ - // reserves stack space for another AssertHelper. - struct AssertHelperData { - AssertHelperData(TestPartResult::Type t, - const char* srcfile, - int line_num, - const char* msg) - : type(t), file(srcfile), line(line_num), message(msg) { } - - TestPartResult::Type const type; - const char* const file; - int const line; - std::string const message; - - private: - GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData); - }; - - AssertHelperData* const data_; - - GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper); -}; - -} // namespace internal - -#if GTEST_HAS_PARAM_TEST -// The pure interface class that all value-parameterized tests inherit from. -// A value-parameterized class must inherit from both ::testing::Test and -// ::testing::WithParamInterface. In most cases that just means inheriting -// from ::testing::TestWithParam, but more complicated test hierarchies -// may need to inherit from Test and WithParamInterface at different levels. -// -// This interface has support for accessing the test parameter value via -// the GetParam() method. -// -// Use it with one of the parameter generator defining functions, like Range(), -// Values(), ValuesIn(), Bool(), and Combine(). -// -// class FooTest : public ::testing::TestWithParam { -// protected: -// FooTest() { -// // Can use GetParam() here. -// } -// virtual ~FooTest() { -// // Can use GetParam() here. -// } -// virtual void SetUp() { -// // Can use GetParam() here. -// } -// virtual void TearDown { -// // Can use GetParam() here. -// } -// }; -// TEST_P(FooTest, DoesBar) { -// // Can use GetParam() method here. -// Foo foo; -// ASSERT_TRUE(foo.DoesBar(GetParam())); -// } -// INSTANTIATE_TEST_CASE_P(OneToTenRange, FooTest, ::testing::Range(1, 10)); - -template -class WithParamInterface { - public: - typedef T ParamType; - virtual ~WithParamInterface() {} - - // The current parameter value. Is also available in the test fixture's - // constructor. This member function is non-static, even though it only - // references static data, to reduce the opportunity for incorrect uses - // like writing 'WithParamInterface::GetParam()' for a test that - // uses a fixture whose parameter type is int. - const ParamType& GetParam() const { - GTEST_CHECK_(parameter_ != NULL) - << "GetParam() can only be called inside a value-parameterized test " - << "-- did you intend to write TEST_P instead of TEST_F?"; - return *parameter_; - } - - private: - // Sets parameter value. The caller is responsible for making sure the value - // remains alive and unchanged throughout the current test. - static void SetParam(const ParamType* parameter) { - parameter_ = parameter; - } - - // Static value used for accessing parameter during a test lifetime. - static const ParamType* parameter_; - - // TestClass must be a subclass of WithParamInterface and Test. - template friend class internal::ParameterizedTestFactory; -}; - -template -const T* WithParamInterface::parameter_ = NULL; - -// Most value-parameterized classes can ignore the existence of -// WithParamInterface, and can just inherit from ::testing::TestWithParam. - -template -class TestWithParam : public Test, public WithParamInterface { -}; - -#endif // GTEST_HAS_PARAM_TEST - -// Macros for indicating success/failure in test code. - -// ADD_FAILURE unconditionally adds a failure to the current test. -// SUCCEED generates a success - it doesn't automatically make the -// current test successful, as a test is only successful when it has -// no failure. -// -// EXPECT_* verifies that a certain condition is satisfied. If not, -// it behaves like ADD_FAILURE. In particular: -// -// EXPECT_TRUE verifies that a Boolean condition is true. -// EXPECT_FALSE verifies that a Boolean condition is false. -// -// FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except -// that they will also abort the current function on failure. People -// usually want the fail-fast behavior of FAIL and ASSERT_*, but those -// writing data-driven tests often find themselves using ADD_FAILURE -// and EXPECT_* more. - -// Generates a nonfatal failure with a generic message. -#define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed") - -// Generates a nonfatal failure at the given source file location with -// a generic message. -#define ADD_FAILURE_AT(file, line) \ - GTEST_MESSAGE_AT_(file, line, "Failed", \ - ::testing::TestPartResult::kNonFatalFailure) - -// Generates a fatal failure with a generic message. -#define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed") - -// Define this macro to 1 to omit the definition of FAIL(), which is a -// generic name and clashes with some other libraries. -#if !GTEST_DONT_DEFINE_FAIL -# define FAIL() GTEST_FAIL() -#endif - -// Generates a success with a generic message. -#define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded") - -// Define this macro to 1 to omit the definition of SUCCEED(), which -// is a generic name and clashes with some other libraries. -#if !GTEST_DONT_DEFINE_SUCCEED -# define SUCCEED() GTEST_SUCCEED() -#endif - -// Macros for testing exceptions. -// -// * {ASSERT|EXPECT}_THROW(statement, expected_exception): -// Tests that the statement throws the expected exception. -// * {ASSERT|EXPECT}_NO_THROW(statement): -// Tests that the statement doesn't throw any exception. -// * {ASSERT|EXPECT}_ANY_THROW(statement): -// Tests that the statement throws an exception. - -#define EXPECT_THROW(statement, expected_exception) \ - GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_) -#define EXPECT_NO_THROW(statement) \ - GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_) -#define EXPECT_ANY_THROW(statement) \ - GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_) -#define ASSERT_THROW(statement, expected_exception) \ - GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_) -#define ASSERT_NO_THROW(statement) \ - GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_) -#define ASSERT_ANY_THROW(statement) \ - GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_) - -// Boolean assertions. Condition can be either a Boolean expression or an -// AssertionResult. For more information on how to use AssertionResult with -// these macros see comments on that class. -#define EXPECT_TRUE(condition) \ - GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \ - GTEST_NONFATAL_FAILURE_) -#define EXPECT_FALSE(condition) \ - GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \ - GTEST_NONFATAL_FAILURE_) -#define ASSERT_TRUE(condition) \ - GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \ - GTEST_FATAL_FAILURE_) -#define ASSERT_FALSE(condition) \ - GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \ - GTEST_FATAL_FAILURE_) - -// Includes the auto-generated header that implements a family of -// generic predicate assertion macros. -// Copyright 2006, Google Inc. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * 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. -// * Neither the name of Google Inc. 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. - -// This file is AUTOMATICALLY GENERATED on 10/31/2011 by command -// 'gen_gtest_pred_impl.py 5'. DO NOT EDIT BY HAND! -// -// Implements a family of generic predicate assertion macros. - -#ifndef GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_ -#define GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_ - -// Makes sure this header is not included before gtest.h. -#ifndef GTEST_INCLUDE_GTEST_GTEST_H_ -# error Do not include gtest_pred_impl.h directly. Include gtest.h instead. -#endif // GTEST_INCLUDE_GTEST_GTEST_H_ - -// This header implements a family of generic predicate assertion -// macros: -// -// ASSERT_PRED_FORMAT1(pred_format, v1) -// ASSERT_PRED_FORMAT2(pred_format, v1, v2) -// ... -// -// where pred_format is a function or functor that takes n (in the -// case of ASSERT_PRED_FORMATn) values and their source expression -// text, and returns a testing::AssertionResult. See the definition -// of ASSERT_EQ in gtest.h for an example. -// -// If you don't care about formatting, you can use the more -// restrictive version: -// -// ASSERT_PRED1(pred, v1) -// ASSERT_PRED2(pred, v1, v2) -// ... -// -// where pred is an n-ary function or functor that returns bool, -// and the values v1, v2, ..., must support the << operator for -// streaming to std::ostream. -// -// We also define the EXPECT_* variations. -// -// For now we only support predicates whose arity is at most 5. -// Please email googletestframework@googlegroups.com if you need -// support for higher arities. - -// GTEST_ASSERT_ is the basic statement to which all of the assertions -// in this file reduce. Don't use this in your code. - -#define GTEST_ASSERT_(expression, on_failure) \ - GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ - if (const ::testing::AssertionResult gtest_ar = (expression)) \ - ; \ - else \ - on_failure(gtest_ar.failure_message()) - - -// Helper function for implementing {EXPECT|ASSERT}_PRED1. Don't use -// this in your code. -template -AssertionResult AssertPred1Helper(const char* pred_text, - const char* e1, - Pred pred, - const T1& v1) { - if (pred(v1)) return AssertionSuccess(); - - return AssertionFailure() << pred_text << "(" - << e1 << ") evaluates to false, where" - << "\n" << e1 << " evaluates to " << v1; -} - -// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1. -// Don't use this in your code. -#define GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)\ - GTEST_ASSERT_(pred_format(#v1, v1), \ - on_failure) - -// Internal macro for implementing {EXPECT|ASSERT}_PRED1. Don't use -// this in your code. -#define GTEST_PRED1_(pred, v1, on_failure)\ - GTEST_ASSERT_(::testing::AssertPred1Helper(#pred, \ - #v1, \ - pred, \ - v1), on_failure) - -// Unary predicate assertion macros. -#define EXPECT_PRED_FORMAT1(pred_format, v1) \ - GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_) -#define EXPECT_PRED1(pred, v1) \ - GTEST_PRED1_(pred, v1, GTEST_NONFATAL_FAILURE_) -#define ASSERT_PRED_FORMAT1(pred_format, v1) \ - GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_FATAL_FAILURE_) -#define ASSERT_PRED1(pred, v1) \ - GTEST_PRED1_(pred, v1, GTEST_FATAL_FAILURE_) - - - -// Helper function for implementing {EXPECT|ASSERT}_PRED2. Don't use -// this in your code. -template -AssertionResult AssertPred2Helper(const char* pred_text, - const char* e1, - const char* e2, - Pred pred, - const T1& v1, - const T2& v2) { - if (pred(v1, v2)) return AssertionSuccess(); - - return AssertionFailure() << pred_text << "(" - << e1 << ", " - << e2 << ") evaluates to false, where" - << "\n" << e1 << " evaluates to " << v1 - << "\n" << e2 << " evaluates to " << v2; -} - -// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2. -// Don't use this in your code. -#define GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)\ - GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2), \ - on_failure) - -// Internal macro for implementing {EXPECT|ASSERT}_PRED2. Don't use -// this in your code. -#define GTEST_PRED2_(pred, v1, v2, on_failure)\ - GTEST_ASSERT_(::testing::AssertPred2Helper(#pred, \ - #v1, \ - #v2, \ - pred, \ - v1, \ - v2), on_failure) - -// Binary predicate assertion macros. -#define EXPECT_PRED_FORMAT2(pred_format, v1, v2) \ - GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_) -#define EXPECT_PRED2(pred, v1, v2) \ - GTEST_PRED2_(pred, v1, v2, GTEST_NONFATAL_FAILURE_) -#define ASSERT_PRED_FORMAT2(pred_format, v1, v2) \ - GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_) -#define ASSERT_PRED2(pred, v1, v2) \ - GTEST_PRED2_(pred, v1, v2, GTEST_FATAL_FAILURE_) - - - -// Helper function for implementing {EXPECT|ASSERT}_PRED3. Don't use -// this in your code. -template -AssertionResult AssertPred3Helper(const char* pred_text, - const char* e1, - const char* e2, - const char* e3, - Pred pred, - const T1& v1, - const T2& v2, - const T3& v3) { - if (pred(v1, v2, v3)) return AssertionSuccess(); - - return AssertionFailure() << pred_text << "(" - << e1 << ", " - << e2 << ", " - << e3 << ") evaluates to false, where" - << "\n" << e1 << " evaluates to " << v1 - << "\n" << e2 << " evaluates to " << v2 - << "\n" << e3 << " evaluates to " << v3; -} - -// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3. -// Don't use this in your code. -#define GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)\ - GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3), \ - on_failure) - -// Internal macro for implementing {EXPECT|ASSERT}_PRED3. Don't use -// this in your code. -#define GTEST_PRED3_(pred, v1, v2, v3, on_failure)\ - GTEST_ASSERT_(::testing::AssertPred3Helper(#pred, \ - #v1, \ - #v2, \ - #v3, \ - pred, \ - v1, \ - v2, \ - v3), on_failure) - -// Ternary predicate assertion macros. -#define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3) \ - GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_) -#define EXPECT_PRED3(pred, v1, v2, v3) \ - GTEST_PRED3_(pred, v1, v2, v3, GTEST_NONFATAL_FAILURE_) -#define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3) \ - GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_FATAL_FAILURE_) -#define ASSERT_PRED3(pred, v1, v2, v3) \ - GTEST_PRED3_(pred, v1, v2, v3, GTEST_FATAL_FAILURE_) - - - -// Helper function for implementing {EXPECT|ASSERT}_PRED4. Don't use -// this in your code. -template -AssertionResult AssertPred4Helper(const char* pred_text, - const char* e1, - const char* e2, - const char* e3, - const char* e4, - Pred pred, - const T1& v1, - const T2& v2, - const T3& v3, - const T4& v4) { - if (pred(v1, v2, v3, v4)) return AssertionSuccess(); - - return AssertionFailure() << pred_text << "(" - << e1 << ", " - << e2 << ", " - << e3 << ", " - << e4 << ") evaluates to false, where" - << "\n" << e1 << " evaluates to " << v1 - << "\n" << e2 << " evaluates to " << v2 - << "\n" << e3 << " evaluates to " << v3 - << "\n" << e4 << " evaluates to " << v4; -} - -// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4. -// Don't use this in your code. -#define GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)\ - GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4), \ - on_failure) - -// Internal macro for implementing {EXPECT|ASSERT}_PRED4. Don't use -// this in your code. -#define GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure)\ - GTEST_ASSERT_(::testing::AssertPred4Helper(#pred, \ - #v1, \ - #v2, \ - #v3, \ - #v4, \ - pred, \ - v1, \ - v2, \ - v3, \ - v4), on_failure) - -// 4-ary predicate assertion macros. -#define EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \ - GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_) -#define EXPECT_PRED4(pred, v1, v2, v3, v4) \ - GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_) -#define ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \ - GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_FATAL_FAILURE_) -#define ASSERT_PRED4(pred, v1, v2, v3, v4) \ - GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_FATAL_FAILURE_) - - - -// Helper function for implementing {EXPECT|ASSERT}_PRED5. Don't use -// this in your code. -template -AssertionResult AssertPred5Helper(const char* pred_text, - const char* e1, - const char* e2, - const char* e3, - const char* e4, - const char* e5, - Pred pred, - const T1& v1, - const T2& v2, - const T3& v3, - const T4& v4, - const T5& v5) { - if (pred(v1, v2, v3, v4, v5)) return AssertionSuccess(); - - return AssertionFailure() << pred_text << "(" - << e1 << ", " - << e2 << ", " - << e3 << ", " - << e4 << ", " - << e5 << ") evaluates to false, where" - << "\n" << e1 << " evaluates to " << v1 - << "\n" << e2 << " evaluates to " << v2 - << "\n" << e3 << " evaluates to " << v3 - << "\n" << e4 << " evaluates to " << v4 - << "\n" << e5 << " evaluates to " << v5; -} - -// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5. -// Don't use this in your code. -#define GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)\ - GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5), \ - on_failure) - -// Internal macro for implementing {EXPECT|ASSERT}_PRED5. Don't use -// this in your code. -#define GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure)\ - GTEST_ASSERT_(::testing::AssertPred5Helper(#pred, \ - #v1, \ - #v2, \ - #v3, \ - #v4, \ - #v5, \ - pred, \ - v1, \ - v2, \ - v3, \ - v4, \ - v5), on_failure) - -// 5-ary predicate assertion macros. -#define EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \ - GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_) -#define EXPECT_PRED5(pred, v1, v2, v3, v4, v5) \ - GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_) -#define ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \ - GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_) -#define ASSERT_PRED5(pred, v1, v2, v3, v4, v5) \ - GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_) - - - -#endif // GTEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_ - -// Macros for testing equalities and inequalities. -// -// * {ASSERT|EXPECT}_EQ(expected, actual): Tests that expected == actual -// * {ASSERT|EXPECT}_NE(v1, v2): Tests that v1 != v2 -// * {ASSERT|EXPECT}_LT(v1, v2): Tests that v1 < v2 -// * {ASSERT|EXPECT}_LE(v1, v2): Tests that v1 <= v2 -// * {ASSERT|EXPECT}_GT(v1, v2): Tests that v1 > v2 -// * {ASSERT|EXPECT}_GE(v1, v2): Tests that v1 >= v2 -// -// When they are not, Google Test prints both the tested expressions and -// their actual values. The values must be compatible built-in types, -// or you will get a compiler error. By "compatible" we mean that the -// values can be compared by the respective operator. -// -// Note: -// -// 1. It is possible to make a user-defined type work with -// {ASSERT|EXPECT}_??(), but that requires overloading the -// comparison operators and is thus discouraged by the Google C++ -// Usage Guide. Therefore, you are advised to use the -// {ASSERT|EXPECT}_TRUE() macro to assert that two objects are -// equal. -// -// 2. The {ASSERT|EXPECT}_??() macros do pointer comparisons on -// pointers (in particular, C strings). Therefore, if you use it -// with two C strings, you are testing how their locations in memory -// are related, not how their content is related. To compare two C -// strings by content, use {ASSERT|EXPECT}_STR*(). -// -// 3. {ASSERT|EXPECT}_EQ(expected, actual) is preferred to -// {ASSERT|EXPECT}_TRUE(expected == actual), as the former tells you -// what the actual value is when it fails, and similarly for the -// other comparisons. -// -// 4. Do not depend on the order in which {ASSERT|EXPECT}_??() -// evaluate their arguments, which is undefined. -// -// 5. These macros evaluate their arguments exactly once. -// -// Examples: -// -// EXPECT_NE(5, Foo()); -// EXPECT_EQ(NULL, a_pointer); -// ASSERT_LT(i, array_size); -// ASSERT_GT(records.size(), 0) << "There is no record left."; - -#define EXPECT_EQ(expected, actual) \ - EXPECT_PRED_FORMAT2(::testing::internal:: \ - EqHelper::Compare, \ - expected, actual) -#define EXPECT_NE(expected, actual) \ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, expected, actual) -#define EXPECT_LE(val1, val2) \ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2) -#define EXPECT_LT(val1, val2) \ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2) -#define EXPECT_GE(val1, val2) \ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2) -#define EXPECT_GT(val1, val2) \ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2) - -#define GTEST_ASSERT_EQ(expected, actual) \ - ASSERT_PRED_FORMAT2(::testing::internal:: \ - EqHelper::Compare, \ - expected, actual) -#define GTEST_ASSERT_NE(val1, val2) \ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2) -#define GTEST_ASSERT_LE(val1, val2) \ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2) -#define GTEST_ASSERT_LT(val1, val2) \ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2) -#define GTEST_ASSERT_GE(val1, val2) \ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2) -#define GTEST_ASSERT_GT(val1, val2) \ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2) - -// Define macro GTEST_DONT_DEFINE_ASSERT_XY to 1 to omit the definition of -// ASSERT_XY(), which clashes with some users' own code. - -#if !GTEST_DONT_DEFINE_ASSERT_EQ -# define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2) -#endif - -#if !GTEST_DONT_DEFINE_ASSERT_NE -# define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2) -#endif - -#if !GTEST_DONT_DEFINE_ASSERT_LE -# define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2) -#endif - -#if !GTEST_DONT_DEFINE_ASSERT_LT -# define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2) -#endif - -#if !GTEST_DONT_DEFINE_ASSERT_GE -# define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2) -#endif - -#if !GTEST_DONT_DEFINE_ASSERT_GT -# define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2) -#endif - -// C-string Comparisons. All tests treat NULL and any non-NULL string -// as different. Two NULLs are equal. -// -// * {ASSERT|EXPECT}_STREQ(s1, s2): Tests that s1 == s2 -// * {ASSERT|EXPECT}_STRNE(s1, s2): Tests that s1 != s2 -// * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring case -// * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring case -// -// For wide or narrow string objects, you can use the -// {ASSERT|EXPECT}_??() macros. -// -// Don't depend on the order in which the arguments are evaluated, -// which is undefined. -// -// These macros evaluate their arguments exactly once. - -#define EXPECT_STREQ(expected, actual) \ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual) -#define EXPECT_STRNE(s1, s2) \ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2) -#define EXPECT_STRCASEEQ(expected, actual) \ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual) -#define EXPECT_STRCASENE(s1, s2)\ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2) - -#define ASSERT_STREQ(expected, actual) \ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual) -#define ASSERT_STRNE(s1, s2) \ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2) -#define ASSERT_STRCASEEQ(expected, actual) \ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual) -#define ASSERT_STRCASENE(s1, s2)\ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2) - -// Macros for comparing floating-point numbers. -// -// * {ASSERT|EXPECT}_FLOAT_EQ(expected, actual): -// Tests that two float values are almost equal. -// * {ASSERT|EXPECT}_DOUBLE_EQ(expected, actual): -// Tests that two double values are almost equal. -// * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error): -// Tests that v1 and v2 are within the given distance to each other. -// -// Google Test uses ULP-based comparison to automatically pick a default -// error bound that is appropriate for the operands. See the -// FloatingPoint template class in gtest-internal.h if you are -// interested in the implementation details. - -#define EXPECT_FLOAT_EQ(expected, actual)\ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ, \ - expected, actual) - -#define EXPECT_DOUBLE_EQ(expected, actual)\ - EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ, \ - expected, actual) - -#define ASSERT_FLOAT_EQ(expected, actual)\ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ, \ - expected, actual) - -#define ASSERT_DOUBLE_EQ(expected, actual)\ - ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ, \ - expected, actual) - -#define EXPECT_NEAR(val1, val2, abs_error)\ - EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \ - val1, val2, abs_error) - -#define ASSERT_NEAR(val1, val2, abs_error)\ - ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \ - val1, val2, abs_error) - -// These predicate format functions work on floating-point values, and -// can be used in {ASSERT|EXPECT}_PRED_FORMAT2*(), e.g. -// -// EXPECT_PRED_FORMAT2(testing::DoubleLE, Foo(), 5.0); - -// Asserts that val1 is less than, or almost equal to, val2. Fails -// otherwise. In particular, it fails if either val1 or val2 is NaN. -GTEST_API_ AssertionResult FloatLE(const char* expr1, const char* expr2, - float val1, float val2); -GTEST_API_ AssertionResult DoubleLE(const char* expr1, const char* expr2, - double val1, double val2); - - -#if GTEST_OS_WINDOWS - -// Macros that test for HRESULT failure and success, these are only useful -// on Windows, and rely on Windows SDK macros and APIs to compile. -// -// * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr) -// -// When expr unexpectedly fails or succeeds, Google Test prints the -// expected result and the actual result with both a human-readable -// string representation of the error, if available, as well as the -// hex result code. -# define EXPECT_HRESULT_SUCCEEDED(expr) \ - EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) - -# define ASSERT_HRESULT_SUCCEEDED(expr) \ - ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) - -# define EXPECT_HRESULT_FAILED(expr) \ - EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) - -# define ASSERT_HRESULT_FAILED(expr) \ - ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) - -#endif // GTEST_OS_WINDOWS - -// Macros that execute statement and check that it doesn't generate new fatal -// failures in the current thread. -// -// * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement); -// -// Examples: -// -// EXPECT_NO_FATAL_FAILURE(Process()); -// ASSERT_NO_FATAL_FAILURE(Process()) << "Process() failed"; -// -#define ASSERT_NO_FATAL_FAILURE(statement) \ - GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_) -#define EXPECT_NO_FATAL_FAILURE(statement) \ - GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_) - -// Causes a trace (including the source file path, the current line -// number, and the given message) to be included in every test failure -// message generated by code in the current scope. The effect is -// undone when the control leaves the current scope. -// -// The message argument can be anything streamable to std::ostream. -// -// In the implementation, we include the current line number as part -// of the dummy variable name, thus allowing multiple SCOPED_TRACE()s -// to appear in the same block - as long as they are on different -// lines. -#define SCOPED_TRACE(message) \ - ::testing::internal::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\ - __FILE__, __LINE__, ::testing::Message() << (message)) - -// Compile-time assertion for type equality. -// StaticAssertTypeEq() compiles iff type1 and type2 are -// the same type. The value it returns is not interesting. -// -// Instead of making StaticAssertTypeEq a class template, we make it a -// function template that invokes a helper class template. This -// prevents a user from misusing StaticAssertTypeEq by -// defining objects of that type. -// -// CAVEAT: -// -// When used inside a method of a class template, -// StaticAssertTypeEq() is effective ONLY IF the method is -// instantiated. For example, given: -// -// template class Foo { -// public: -// void Bar() { testing::StaticAssertTypeEq(); } -// }; -// -// the code: -// -// void Test1() { Foo foo; } -// -// will NOT generate a compiler error, as Foo::Bar() is never -// actually instantiated. Instead, you need: -// -// void Test2() { Foo foo; foo.Bar(); } -// -// to cause a compiler error. -template -bool StaticAssertTypeEq() { - (void)internal::StaticAssertTypeEqHelper(); - return true; -} - -// Defines a test. -// -// The first parameter is the name of the test case, and the second -// parameter is the name of the test within the test case. -// -// The convention is to end the test case name with "Test". For -// example, a test case for the Foo class can be named FooTest. -// -// The user should put his test code between braces after using this -// macro. Example: -// -// TEST(FooTest, InitializesCorrectly) { -// Foo foo; -// EXPECT_TRUE(foo.StatusIsOK()); -// } - -// Note that we call GetTestTypeId() instead of GetTypeId< -// ::testing::Test>() here to get the type ID of testing::Test. This -// is to work around a suspected linker bug when using Google Test as -// a framework on Mac OS X. The bug causes GetTypeId< -// ::testing::Test>() to return different values depending on whether -// the call is from the Google Test framework itself or from user test -// code. GetTestTypeId() is guaranteed to always return the same -// value, as it always calls GetTypeId<>() from the Google Test -// framework. -#define GTEST_TEST(test_case_name, test_name)\ - GTEST_TEST_(test_case_name, test_name, \ - ::testing::Test, ::testing::internal::GetTestTypeId()) - -// Define this macro to 1 to omit the definition of TEST(), which -// is a generic name and clashes with some other libraries. -#if !GTEST_DONT_DEFINE_TEST -# define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name) -#endif - -// Defines a test that uses a test fixture. -// -// The first parameter is the name of the test fixture class, which -// also doubles as the test case name. The second parameter is the -// name of the test within the test case. -// -// A test fixture class must be declared earlier. The user should put -// his test code between braces after using this macro. Example: -// -// class FooTest : public testing::Test { -// protected: -// virtual void SetUp() { b_.AddElement(3); } -// -// Foo a_; -// Foo b_; -// }; -// -// TEST_F(FooTest, InitializesCorrectly) { -// EXPECT_TRUE(a_.StatusIsOK()); -// } -// -// TEST_F(FooTest, ReturnsElementCountCorrectly) { -// EXPECT_EQ(0, a_.size()); -// EXPECT_EQ(1, b_.size()); -// } - -#define TEST_F(test_fixture, test_name)\ - GTEST_TEST_(test_fixture, test_name, test_fixture, \ - ::testing::internal::GetTypeId()) - -} // namespace testing - -// Use this function in main() to run all tests. It returns 0 if all -// tests are successful, or 1 otherwise. -// -// RUN_ALL_TESTS() should be invoked after the command line has been -// parsed by InitGoogleTest(). -// -// This function was formerly a macro; thus, it is in the global -// namespace and has an all-caps name. -int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_; - -inline int RUN_ALL_TESTS() { - return ::testing::UnitTest::GetInstance()->Run(); -} - -#endif // GTEST_INCLUDE_GTEST_GTEST_H_ diff --git a/potentials/He_He_JW2013.table b/potentials/He_He_JW2013.table new file mode 100644 index 0000000000..415492d911 --- /dev/null +++ b/potentials/He_He_JW2013.table @@ -0,0 +1,5008 @@ +# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Juslin, N. and Wirth, B. D. Journal of Nuclear Materials, 423, (2013) p61-63 +# +# # Helium-Helium potential, courtesy of N. Juslin and A. Kohnert. +# D.E. Beck, Mol. Phys. 14 (4): 311-315 (1968) as modified by +# [NIKLAS: WHAT IS THE CITATION FOR THE MODIFICATION?]. + +HeHe +N 4999 + +1 0.000000001 75519.84343541 66456437 +2 0.001520304 37631.7120347908 33228235 +3 0.002280456 25002.8254988559 12459985 +4 0.003040608 18688.7473128597 6644878.5 +5 0.00380076 14900.590193906 4152692.9 +6 0.004560912 12375.3917309215 2847264.7 +7 0.005321064 10571.8823332253 2075877.3 +8 0.006081216 9219.42721767206 1581399.9 +9 0.006841368 8167.67373770059 1245156.8 +10 0.00760152 7326.41031495415 1006012.1 +11 0.008361672 6638.22959001766 829801.35 +12 0.009121824 6064.85999778702 696192.17 +13 0.009881976 5579.80584651465 592459.37 +14 0.010642128 5164.14164869331 510303.94 +15 0.01140228 4803.9887195868 444124.07 +16 0.012162432 4488.93805131225 390026.53 +17 0.012922584 4211.02981959958 345236.87 +18 0.013682736 3964.07305496495 307734.29 +19 0.014442888 3743.1801545667 276018.49 +20 0.01520304 3544.44104050478 248956.62 +21 0.015963192 3364.69041574939 225680.22 +22 0.016723344 3201.33849572566 205514.5 +23 0.017483496 3052.24589687661 187928.66 +24 0.018243648 2915.62980308569 172500.53 +25 0.0190038 2789.99265215812 158890.93 +26 0.019763952 2674.06727926841 146824.85 +27 0.020524104 2566.7742507531 136077.35 +28 0.021284256 2467.18834066244 126463.07 +29 0.022044408 2374.51194319818 117828.1 +30 0.02280456 2288.05380266404 110043.84 +31 0.023564712 2207.21186020013 103002.09 +32 0.024324864 2131.45931675491 96611.355 +33 0.025085016 2060.33323006244 90793.81 +34 0.025845168 1993.42512391793 85482.918 +35 0.02660532 1930.37320729201 80621.529 +36 0.027365472 1870.85589025938 76160.331 +37 0.028125624 1814.58635139873 72056.593 +38 0.028885776 1761.30796297177 68273.142 +39 0.029645928 1710.790419921 64777.514 +40 0.03040608 1662.82644951799 61541.256 +41 0.031166232 1617.22900252672 58539.347 +42 0.031926384 1573.82884562939 55749.714 +43 0.032686536 1532.47248979297 53152.82 +44 0.033446688 1493.02040113142 50731.327 +45 0.03420684 1455.34545031963 48469.804 +46 0.034966992 1419.33156425792 46354.479 +47 0.035727144 1384.87254986461 44373.033 +48 0.036487296 1351.87106489457 42514.415 +49 0.037247448 1320.23771478016 40768.693 +50 0.0380076 1289.89025785135 39126.919 +51 0.038767752 1260.75290405945 37581.012 +52 0.039527904 1232.75569461749 36123.665 +53 0.040288056 1205.83395187003 34748.251 +54 0.041048208 1179.92779028867 33448.752 +55 0.04180836 1154.98168081362 32219.693 +56 0.042568512 1130.94406187304 31056.084 +57 0.043328664 1107.76699134779 29953.369 +58 0.044088816 1085.40583453996 28907.381 +59 0.044848968 1063.81898387343 27914.304 +60 0.04560912 1042.96760662453 26970.636 +61 0.046369272 1022.81541746614 26073.163 +62 0.047129424 1003.3284730237 25218.924 +63 0.047889576 984.474985997409 24405.195 +64 0.048649728 966.225156710593 23629.462 +65 0.04940988 948.551020207457 22889.402 +66 0.050170032 931.426307251157 22182.868 +67 0.050930184 914.826317769866 21507.871 +68 0.051690336 898.727805469435 20862.568 +69 0.052450488 883.108872479803 20245.249 +70 0.05321064 867.948873031782 19654.324 +71 0.053970792 853.228325273896 19088.316 +72 0.054730944 838.928830437882 18545.848 +73 0.055491096 825.032998648183 18025.638 +74 0.056251248 811.524380746945 17526.49 +75 0.0570114 798.387405573084 17047.287 +76 0.057771552 785.607322193051 16586.985 +77 0.058531704 773.17014663316 16144.606 +78 0.059291856 761.062612709482 15719.238 +79 0.060052008 749.272126592235 15310.022 +80 0.06081216 737.786724777893 14916.156 +81 0.061572312 726.595035174528 14536.885 +82 0.062332464 715.686241034613 14171.5 +83 0.063092616 705.050047495149 13819.335 +84 0.063852768 694.67665050782 13479.764 +85 0.06461292 684.556707962377 13152.197 +86 0.065373072 674.681312824697 12836.077 +87 0.066133224 665.041968127458 12530.881 +88 0.066893376 655.630563666017 12236.115 +89 0.067653528 646.439354265416 11951.31 +90 0.06841368 637.460939496282 11676.026 +91 0.069173832 628.688244728194 11409.847 +92 0.069933984 620.114503418735 11152.378 +93 0.070694136 611.733240545225 10903.245 +94 0.071454288 603.53825709405 10662.095 +95 0.07221444 595.523615529642 10428.593 +96 0.072974592 587.683626171693 10202.421 +97 0.073734744 580.012834415052 9983.278 +98 0.074494896 572.506008732108 9770.8781 +99 0.075255048 565.158129402347 9564.9494 +100 0.0760152 557.96437791816 9365.2338 +101 0.076775352 550.920127020055 9171.4858 +102 0.077535504 544.020931318057 8983.4721 +103 0.078295656 537.262518459473 8800.9704 +104 0.079055808 530.640780806244 8623.7692 +105 0.07981596 524.151767587898 8451.6671 +106 0.080576112 517.791677498722 8284.472 +107 0.081336264 511.556851710066 8122.0007 +108 0.082096416 505.443767270885 7964.0788 +109 0.082856568 499.449030871588 7810.5394 +110 0.08361672 493.569372948063 7661.2235 +111 0.084376872 487.80164210444 7515.9791 +112 0.085137024 482.142799834653 7374.661 +113 0.085897176 476.589915524312 7237.1303 +114 0.086657328 471.140161715654 7103.2543 +115 0.08741748 465.790809619566 6972.906 +116 0.088177632 460.539224859779 6845.9638 +117 0.088937784 455.382863435324 6722.3114 +118 0.089697936 450.31926788832 6601.8374 +119 0.090458088 445.346063665003 6484.4348 +120 0.09121824 440.460955658732 6370.0015 +121 0.091978392 435.661724924438 6258.4392 +122 0.092738544 430.946225554678 6149.6538 +123 0.093498696 426.312381708107 6043.555 +124 0.094258848 421.758184781751 5940.0561 +125 0.095019 417.281690719033 5839.0739 +126 0.095779152 412.881017446016 5740.5284 +127 0.096539304 408.554342428782 5644.3429 +128 0.097299456 404.299900345337 5550.4436 +129 0.098059608 400.115980865817 5458.7594 +130 0.09881976 396.000926535166 5369.2223 +131 0.099579912 391.953130752817 5281.7665 +132 0.100340064 387.971035844212 5196.3288 +133 0.101100216 384.053131219361 5112.8486 +134 0.101860368 380.197951613849 5031.2673 +135 0.10262052 376.404075408063 4951.5285 +136 0.103380672 372.67012302057 4873.5779 +137 0.104140824 368.994755371888 4797.3633 +138 0.104900976 365.376672415063 4722.8341 +139 0.105661128 361.814611729696 4649.9419 +140 0.10642128 358.307347176234 4578.6396 +141 0.107181432 354.853687607556 4508.8821 +142 0.107941584 351.452475635006 4440.6258 +143 0.108701736 348.102586446216 4373.8285 +144 0.109461888 344.802926672215 4308.4496 +145 0.11022204 341.552433301419 4244.4498 +146 0.110982192 338.350072638272 4181.7913 +147 0.111742344 335.194839304412 4120.4373 +148 0.112502496 332.085755280337 4060.3526 +149 0.113262648 329.021868985683 4001.5029 +150 0.1140228 326.002254396305 3943.8552 +151 0.114782952 323.026010196449 3887.3774 +152 0.115543104 320.092258964419 3832.0387 +153 0.116303256 317.200146390174 3777.8092 +154 0.117063408 314.348840523443 3724.6599 +155 0.11782356 311.537531050938 3672.5628 +156 0.118583712 308.765428601398 3621.4908 +157 0.119343864 306.031764077195 3571.4177 +158 0.120104016 303.335788011338 3522.318 +159 0.120864168 300.676769948751 3474.1671 +160 0.12162432 298.053997850773 3426.9412 +161 0.122384472 295.466777521852 3380.6172 +162 0.123144624 292.914432057498 3335.1726 +163 0.123904776 290.396301312558 3290.5857 +164 0.124664928 287.911741388961 3246.8356 +165 0.12542508 285.460124142102 3203.9018 +166 0.126185232 283.040836705077 3161.7644 +167 0.126945384 280.653281030027 3120.4044 +168 0.127705536 278.296873445871 3079.803 +169 0.128465688 275.971044231749 3039.9422 +170 0.12922584 273.675237205537 3000.8044 +171 0.129985992 271.408909326807 2962.3726 +172 0.130746144 269.171530313647 2924.6302 +173 0.131506296 266.962582272785 2887.5613 +174 0.132266448 264.781559342472 2851.1501 +175 0.1330266 262.627967347625 2815.3816 +176 0.133786752 260.50132346673 2780.241 +177 0.134546904 258.401155910056 2745.7139 +178 0.135307056 256.32700360871 2711.7866 +179 0.136067208 254.278415914143 2678.4454 +180 0.13682736 252.254952307665 2645.6773 +181 0.137587512 250.25618211961 2613.4694 +182 0.138347664 248.281684257763 2581.8094 +183 0.139107816 246.331046944699 2550.6851 +184 0.139867968 244.403867463705 2520.0848 +185 0.14062812 242.499751912934 2489.9971 +186 0.141388272 240.618314967519 2460.4107 +187 0.142148424 238.759179649308 2431.315 +188 0.142908576 236.921977103973 2402.6992 +189 0.143668728 235.106346385193 2374.5533 +190 0.14442888 233.311934245662 2346.8671 +191 0.145189032 231.538394934673 2319.631 +192 0.145949184 229.785390002034 2292.8354 +193 0.146709336 228.052588108088 2266.4712 +194 0.147469488 226.339664839612 2240.5292 +195 0.14822964 224.646302531397 2215.0009 +196 0.148989792 222.972190093289 2189.8776 +197 0.149749944 221.317022842509 2165.151 +198 0.150510096 219.680502341062 2140.813 +199 0.151270248 218.062336238053 2116.8557 +200 0.152030400000001 216.46223811674 2093.2714 +201 0.152790552000001 214.879927346167 2070.0526 +202 0.153550704000001 213.315128937196 2047.1918 +203 0.154310856000001 211.76757340282 2024.6821 +204 0.155071008000001 210.236996622572 2002.5164 +205 0.155831160000001 208.723139710923 1980.6879 +206 0.156591312000001 207.225748889516 1959.19 +207 0.157351464000001 205.744575363102 1938.0161 +208 0.158111616000001 204.279375199073 1917.1601 +209 0.158871768000001 202.829909210453 1896.6156 +210 0.159631920000001 201.395942842237 1876.3768 +211 0.160392072000001 199.977246060971 1856.4377 +212 0.161152224000001 198.573593247463 1836.7925 +213 0.161912376000001 197.184763092521 1817.4357 +214 0.162672528000001 195.810538495621 1798.3618 +215 0.163432680000001 194.450706466405 1779.5654 +216 0.164192832000001 193.105058028928 1761.0414 +217 0.164952984000001 191.773388128549 1742.7847 +218 0.165713136000001 190.455495541399 1724.7901 +219 0.166473288000001 189.151182786329 1707.053 +220 0.167233440000001 187.860256039265 1689.5685 +221 0.167993592000001 186.582525049895 1672.332 +222 0.168753744000001 185.317803060615 1655.3389 +223 0.169513896000001 184.065906727656 1638.5848 +224 0.170274048000001 182.826656044333 1622.0654 +225 0.171034200000001 181.599874266341 1605.7763 +226 0.171794352000001 180.385387839045 1589.7136 +227 0.172554504000001 179.183026326692 1573.8731 +228 0.173314656000001 177.992622343493 1558.2507 +229 0.174074808000001 176.814011486516 1542.8428 +230 0.174834960000001 175.64703227033 1527.6454 +231 0.175595112000001 174.491526063356 1512.6549 +232 0.176355264000001 173.347337025865 1497.8675 +233 0.177115416000001 172.214312049584 1483.2799 +234 0.177875568000001 171.092300698842 1468.8884 +235 0.178635720000001 169.981155153237 1454.6897 +236 0.179395872000001 168.880730151754 1440.6804 +237 0.180156024000001 167.79088293831 1426.8574 +238 0.180916176000001 166.711473208672 1413.2173 +239 0.181676328000001 165.642363058711 1399.7571 +240 0.182436480000001 164.583416933955 1386.4737 +241 0.183196632000001 163.534501580401 1373.3641 +242 0.183956784000001 162.495485996557 1360.4254 +243 0.184716936000001 161.466241386657 1347.6547 +244 0.185477088000001 160.446641115047 1335.0493 +245 0.186237240000001 159.436560661684 1322.6062 +246 0.186997392000001 158.435877578721 1310.3229 +247 0.187757544000001 157.444471448156 1298.1968 +248 0.188517696000001 156.462223840507 1286.2251 +249 0.189277848000001 155.489018274489 1274.4054 +250 0.190038000000001 154.524740177656 1262.7352 +251 0.190798152000001 153.569276847992 1251.2121 +252 0.191558304000001 152.622517416424 1239.8336 +253 0.192318456000001 151.684352810215 1228.5975 +254 0.193078608000001 150.75467571724 1217.5014 +255 0.193838760000001 149.833380551092 1206.5431 +256 0.194598912000001 148.920363417022 1195.7204 +257 0.195359064000001 148.015522078667 1185.0311 +258 0.196119216000001 147.118755925559 1174.4731 +259 0.196879368000001 146.229965941394 1164.0443 +260 0.197639520000001 145.349054673027 1153.7428 +261 0.198399672000001 144.475926200192 1143.5664 +262 0.199159824000001 143.610486105913 1133.5133 +263 0.199919976000001 142.752641447594 1123.5815 +264 0.200680128000001 141.902300728773 1113.7691 +265 0.201440280000001 141.059373871511 1104.0743 +266 0.202200432000001 140.223772189411 1094.4953 +267 0.202960584000001 139.395408361251 1085.0302 +268 0.203720736000001 138.574196405196 1075.6774 +269 0.204480888000001 137.760051653608 1066.4352 +270 0.205241040000001 136.952890728398 1057.3018 +271 0.206001192000001 136.152631516942 1048.2756 +272 0.206761344000002 135.35919314852 1039.355 +273 0.207521496000002 134.572495971285 1030.5384 +274 0.208281648000002 133.792461529731 1021.8242 +275 0.209041800000002 133.019012542661 1013.2109 +276 0.209801952000002 132.25207288163 1004.6971 +277 0.210562104000002 131.491567549865 996.28115 +278 0.211322256000002 130.737422661638 987.9617 +279 0.212082408000002 129.989565422084 979.73731 +280 0.212842560000002 129.247924107457 971.60658 +281 0.213602712000002 128.512428045809 963.56815 +282 0.214362864000002 127.78300759808 955.62066 +283 0.215123016000002 127.059594139597 947.76279 +284 0.215883168000002 126.342120041958 939.99324 +285 0.216643320000002 125.630518655307 932.31074 +286 0.217403472000002 124.92472429098 924.71404 +287 0.218163624000002 124.224672204513 917.2019 +288 0.218923776000002 123.530298579014 909.77311 +289 0.219683928000002 122.841540508876 902.42649 +290 0.220444080000002 122.158335983827 895.16086 +291 0.221204232000002 121.480623873321 887.97508 +292 0.221964384000002 120.808343911241 880.86803 +293 0.222724536000002 120.141436680923 873.83859 +294 0.223484688000002 119.479843600487 866.88568 +295 0.224244840000002 118.823506908468 860.00823 +296 0.225004992000002 118.172369649738 853.20518 +297 0.225765144000002 117.52637566172 846.4755 +298 0.226525296000002 116.885469560874 839.81818 +299 0.227285448000002 116.249596729462 833.23221 +300 0.228045600000002 115.618703302578 826.71661 +301 0.228805752000002 114.992736155434 820.27043 +302 0.229565904000002 114.371642890912 813.8927 +303 0.230326056000002 113.755371827347 807.5825 +304 0.231086208000002 113.143871986571 801.33891 +305 0.231846360000002 112.53709308218 795.16102 +306 0.232606512000002 111.93498550804 789.04795 +307 0.233366664000002 111.337500327019 782.99883 +308 0.234126816000002 110.744589259935 777.01279 +309 0.234886968000002 110.156204674729 771.089 +310 0.235647120000002 109.572299575841 765.22661 +311 0.236407272000002 108.992827593794 759.42483 +312 0.237167424000002 108.417742974988 753.68283 +313 0.237927576000002 107.84700057168 747.99984 +314 0.238687728000002 107.280555832162 742.37506 +315 0.239447880000002 106.71836479113 736.80775 +316 0.240208032000002 106.160384060235 731.29714 +317 0.240968184000002 105.606570818813 725.8425 +318 0.241728336000002 105.056882804792 720.44309 +319 0.242488488000002 104.511278305776 715.0982 +320 0.243248640000002 103.969716150289 709.80712 +321 0.244008792000002 103.432155699194 704.56916 +322 0.244768944000002 102.898556837265 699.38363 +323 0.245529096000002 102.368879964922 694.24987 +324 0.246289248000002 101.843085990117 689.1672 +325 0.247049400000002 101.321136320376 684.13497 +326 0.247809552000002 100.802992854983 679.15255 +327 0.248569704000002 100.288617977312 674.21931 +328 0.249329856000002 99.7779745473017 669.33461 +329 0.250090008000002 99.2710258940651 664.49785 +330 0.250850160000002 98.7677358086385 659.70842 +331 0.251610312000002 98.2680685368607 654.96574 +332 0.252370464000002 97.7719887723829 650.26921 +333 0.253130616000002 97.2794616498065 645.61827 +334 0.253890768000002 96.7904527379441 641.01233 +335 0.254650920000002 96.3049280332035 636.45086 +336 0.255411072000002 95.8228539530906 631.93329 +337 0.256171224000002 95.344197329829 627.45908 +338 0.256931376000002 94.8689254040944 623.0277 +339 0.257691528000002 94.3970058188609 618.63863 +340 0.258451680000002 93.9284066133568 614.29135 +341 0.259211832000002 93.4630962171284 609.98535 +342 0.259971984000002 93.0010434442086 605.72013 +343 0.260732136000003 92.5422174873886 601.49518 +344 0.261492288000003 92.0865879125911 597.31003 +345 0.262252440000003 91.6341246533418 593.1642 +346 0.263012592000003 91.1847980053384 589.05721 +347 0.263772744000003 90.7385786211141 584.98859 +348 0.264532896000003 90.2954375047943 580.9579 +349 0.265293048000003 89.8553460069446 576.96466 +350 0.266053200000003 89.4182758195081 573.00845 +351 0.266813352000003 88.98419897083 569.08881 +352 0.267573504000003 88.5530878207684 565.20532 +353 0.268333656000003 88.1249150558887 561.35755 +354 0.269093808000003 87.699653684741 557.54508 +355 0.269853960000003 87.2772770332174 553.7675 +356 0.270614112000003 86.8577587399898 550.02439 +357 0.271374264000003 86.4410727520238 546.31536 +358 0.272134416000003 86.0271933201699 542.64 +359 0.272894568000003 85.6160949948288 538.99792 +360 0.273654720000003 85.2077526216896 535.38875 +361 0.274414872000003 84.8021413375405 531.8121 +362 0.275175024000003 84.3992365661486 528.26759 +363 0.275935176000003 83.9990140142104 524.75485 +364 0.276695328000003 83.6014496673678 521.27353 +365 0.277455480000003 83.2065197862924 517.82325 +366 0.278215632000003 82.8142009028335 514.40368 +367 0.278975784000003 82.4244698162306 511.01445 +368 0.279735936000003 82.037303589388 507.65523 +369 0.280496088000003 81.6526795452112 504.32567 +370 0.281256240000003 81.2705752630035 501.02543 +371 0.282016392000003 80.8909685749209 497.7542 +372 0.282776544000003 80.5138375624862 494.51164 +373 0.283536696000003 80.1391605531591 491.29743 +374 0.284296848000003 79.7669161169621 488.11125 +375 0.285057000000003 79.3970830631614 484.9528 +376 0.285817152000003 79.0296404370017 481.82176 +377 0.286577304000003 78.6645675164929 478.71783 +378 0.287337456000003 78.3018438092495 475.64071 +379 0.288097608000003 77.9414490493805 472.5901 +380 0.288857760000003 77.5833631944281 469.56571 +381 0.289617912000003 77.227566422357 466.56726 +382 0.290378064000003 76.8740391285905 463.59445 +383 0.291138216000003 76.5227619230939 460.64702 +384 0.291898368000003 76.1737156275044 457.72467 +385 0.292658520000003 75.8268812723066 454.82715 +386 0.293418672000003 75.4822400940518 451.95417 +387 0.294178824000003 75.1397735326215 449.10549 +388 0.294938976000003 74.7994632285345 446.28082 +389 0.295699128000003 74.4612910202948 443.47991 +390 0.296459280000003 74.1252389417822 440.70252 +391 0.297219432000003 73.7912892196827 437.94838 +392 0.297979584000003 73.4594242709597 435.21725 +393 0.298739736000003 73.1296267003634 432.50888 +394 0.299499888000003 72.8018792979795 429.82302 +395 0.300260040000003 72.4761650368155 427.15945 +396 0.301020192000003 72.152467070424 424.51793 +397 0.301780344000003 71.8307687305627 421.89822 +398 0.302540496000003 71.5110535248905 419.30008 +399 0.303300648000003 71.193305134698 416.72331 +400 0.304060800000003 70.8775074126734 414.16766 +401 0.304820952000003 70.563644380702 411.63293 +402 0.305581104000003 70.2517002276993 409.11888 +403 0.306341256000003 69.9416593074768 406.62531 +404 0.307101408000003 69.6335061366398 404.15201 +405 0.307861560000003 69.3272253925173 401.69876 +406 0.308621712000003 69.022801911123 399.26535 +407 0.309381864000003 68.720220685146 396.85158 +408 0.310142016000003 68.4194668619732 394.45726 +409 0.310902168000003 68.1205257417395 392.08217 +410 0.311662320000003 67.8233827754081 389.72612 +411 0.312422472000003 67.5280235628793 387.38892 +412 0.313182624000003 67.2344338511264 385.07037 +413 0.313942776000003 66.9425995323605 382.77029 +414 0.314702928000003 66.6525066422212 380.48849 +415 0.315463080000004 66.3641413579948 378.22478 +416 0.316223232000004 66.0774899968579 375.97898 +417 0.316983384000004 65.7925390141476 373.7509 +418 0.317743536000004 65.5092750016562 371.54038 +419 0.318503688000004 65.227684685951 369.34723 +420 0.319263840000004 64.9477549267189 367.17128 +421 0.320023992000004 64.6694727151346 365.01236 +422 0.320784144000004 64.3928251722528 362.8703 +423 0.321544296000004 64.1177995474231 360.74493 +424 0.322304448000004 63.8443832167285 358.63608 +425 0.323064600000004 63.5725636814455 356.54359 +426 0.323824752000004 63.3023285665273 354.46731 +427 0.324584904000004 63.0336656191077 352.40706 +428 0.325345056000004 62.7665627070274 350.36269 +429 0.326105208000004 62.5010078173802 348.33405 +430 0.326865360000004 62.2369890550809 346.32098 +431 0.327625512000004 61.974494641453 344.32333 +432 0.328385664000004 61.7135129128363 342.34095 +433 0.329145816000004 61.4540323192149 340.37369 +434 0.329905968000004 61.1960414228635 338.42141 +435 0.330666120000004 60.9395288970134 336.48395 +436 0.331426272000004 60.6844835245373 334.56118 +437 0.332186424000004 60.4308941966524 332.65295 +438 0.332946576000004 60.178749911641 330.75913 +439 0.333706728000004 59.9280397735904 328.87957 +440 0.334466880000004 59.6787529911486 327.01413 +441 0.335227032000004 59.4308788762987 325.1627 +442 0.335987184000004 59.1844068431495 323.32512 +443 0.336747336000004 58.9393264067429 321.50127 +444 0.337507488000004 58.6956271818782 319.69101 +445 0.338267640000004 58.4532988819521 317.89423 +446 0.339027792000004 58.212331317815 316.11078 +447 0.339787944000004 57.9727143966425 314.34055 +448 0.340548096000004 57.7344381208227 312.58341 +449 0.341308248000004 57.4974925868589 310.83924 +450 0.342068400000004 57.2618679842869 309.10791 +451 0.342828552000004 57.0275545946068 307.38931 +452 0.343588704000004 56.7945427902299 305.68331 +453 0.344348856000004 56.5628230334394 303.9898 +454 0.345109008000004 56.3323858753653 302.30867 +455 0.345869160000004 56.1032219549731 300.63979 +456 0.346629312000004 55.8753219980663 298.98306 +457 0.347389464000004 55.6486768163015 297.33836 +458 0.348149616000004 55.4232773062182 295.70557 +459 0.348909768000004 55.1991144482798 294.0846 +460 0.349669920000004 54.9761793059286 292.47534 +461 0.350430072000004 54.754463024653 290.87766 +462 0.351190224000004 54.5339568310674 289.29148 +463 0.351950376000004 54.3146520320034 287.71668 +464 0.352710528000004 54.0965400136141 286.15316 +465 0.353470680000004 53.8796122404898 284.60082 +466 0.354230832000004 53.6638602547849 283.05955 +467 0.354990984000004 53.4492756753571 281.52926 +468 0.355751136000004 53.2358501969173 280.00984 +469 0.356511288000004 53.023575589191 278.50121 +470 0.357271440000004 52.81244369609 277.00325 +471 0.358031592000004 52.6024464348962 275.51588 +472 0.358791744000004 52.3935757954543 274.03901 +473 0.359551896000004 52.1858238393767 272.57252 +474 0.360312048000004 51.9791826992572 271.11634 +475 0.361072200000004 51.7736445778962 269.67038 +476 0.361832352000004 51.5692017475347 268.23453 +477 0.362592504000004 51.3658465490993 266.80871 +478 0.363352656000004 51.1635713914559 265.39284 +479 0.364112808000004 50.9623687506736 263.98682 +480 0.364872960000004 50.762231169298 262.59057 +481 0.365633112000004 50.5631512556336 261.204 +482 0.366393264000004 50.365121683035 259.82703 +483 0.367153416000004 50.1681351892083 258.45956 +484 0.367913568000004 49.9721845755198 257.10153 +485 0.368673720000004 49.7772627063148 255.75284 +486 0.369433872000004 49.5833625082446 254.41342 +487 0.370194024000005 49.3904769696012 253.08318 +488 0.370954176000005 49.1985991396618 251.76204 +489 0.371714328000005 49.0077221280405 250.44993 +490 0.372474480000005 48.8178391040487 249.14677 +491 0.373234632000005 48.6289432960629 247.85248 +492 0.373994784000005 48.4410279909012 246.56698 +493 0.374754936000005 48.2540865332071 245.2902 +494 0.375515088000005 48.0681123248408 244.02206 +495 0.376275240000005 47.8830988242787 242.76249 +496 0.377035392000005 47.6990395460198 241.51141 +497 0.377795544000005 47.5159280599996 240.26876 +498 0.378555696000005 47.3337579910116 239.03446 +499 0.379315848000005 47.1525230181352 237.80844 +500 0.380076000000005 46.9722168741714 236.59062 +501 0.380836152000005 46.7928333450848 235.38095 +502 0.381596304000005 46.6143662694533 234.17935 +503 0.382356456000005 46.4368095379235 232.98576 +504 0.383116608000005 46.2601570926735 231.80009 +505 0.383876760000005 46.0844029268819 230.6223 +506 0.384636912000005 45.9095410842036 229.45231 +507 0.385397064000005 45.7355656582515 228.29006 +508 0.386157216000005 45.562470792085 227.13548 +509 0.386917368000005 45.3902506777042 225.98851 +510 0.387677520000005 45.2188995555506 224.84909 +511 0.388437672000005 45.0484117140137 223.71714 +512 0.389197824000005 44.8787814889435 222.59262 +513 0.389957976000005 44.7100032631686 221.47546 +514 0.390718128000005 44.5420714660211 220.36559 +515 0.391478280000005 44.3749805728656 219.26296 +516 0.392238432000005 44.2087251046351 218.16751 +517 0.392998584000005 44.0432996273722 217.07918 +518 0.393758736000005 43.8786987517752 215.99792 +519 0.394518888000005 43.7149171327502 214.92365 +520 0.395279040000005 43.5519494689683 213.85633 +521 0.396039192000005 43.3897905024279 212.7959 +522 0.396799344000005 43.2284350180224 211.7423 +523 0.397559496000005 43.0678778431131 210.69547 +524 0.398319648000005 42.9081138471066 209.65537 +525 0.399079800000005 42.7491379410376 208.62194 +526 0.399839952000005 42.5909450771569 207.59512 +527 0.400600104000005 42.4335302485233 206.57486 +528 0.401360256000005 42.276888488601 205.56111 +529 0.402120408000005 42.1210148708617 204.55381 +530 0.402880560000005 41.9659045083911 203.55292 +531 0.403640712000005 41.8115525534996 202.55838 +532 0.404400864000005 41.6579541973385 201.57014 +533 0.405161016000005 41.5051046695197 200.58815 +534 0.405921168000005 41.3529992377405 199.61236 +535 0.406681320000005 41.2016332074121 198.64272 +536 0.407441472000005 41.0510019212931 197.67918 +537 0.408201624000005 40.9011007591262 196.7217 +538 0.408961776000005 40.7519251372804 195.77022 +539 0.409721928000005 40.603470508396 194.8247 +540 0.410482080000005 40.4557323610349 193.8851 +541 0.411242232000005 40.3087062193334 192.95136 +542 0.412002384000005 40.1623876426606 192.02343 +543 0.412762536000005 40.0167722252794 191.10128 +544 0.413522688000005 39.8718555960123 190.18486 +545 0.414282840000005 39.7276334179099 189.27412 +546 0.415042992000005 39.5841013879244 188.36902 +547 0.415803144000005 39.441255236586 187.46952 +548 0.416563296000005 39.2990907276829 186.57557 +549 0.417323448000005 39.1576036579454 185.68712 +550 0.418083600000005 39.0167898567334 184.80414 +551 0.418843752000005 38.8766451857269 183.92658 +552 0.419603904000005 38.7371655386208 183.05441 +553 0.420364056000005 38.5983468408223 182.18757 +554 0.421124208000005 38.4601850491525 181.32603 +555 0.421884360000005 38.3226761515503 180.46975 +556 0.422644512000005 38.185816166781 179.61869 +557 0.423404664000005 38.0496011441464 178.7728 +558 0.424164816000005 37.9140271631997 177.93205 +559 0.424924968000006 37.7790903334627 177.0964 +560 0.425685120000006 37.6447867941464 176.26581 +561 0.426445272000006 37.5111127138743 175.44024 +562 0.427205424000006 37.3780642904093 174.61966 +563 0.427965576000006 37.2456377503834 173.80402 +564 0.428725728000006 37.1138293490302 172.99328 +565 0.429485880000006 36.9826353699205 172.18742 +566 0.430246032000006 36.8520521247007 171.38639 +567 0.431006184000006 36.7220759528341 170.59016 +568 0.431766336000006 36.5927032213451 169.79869 +569 0.432526488000006 36.463930324566 169.01195 +570 0.433286640000006 36.3357536838867 168.22989 +571 0.434046792000006 36.2081697475072 167.45249 +572 0.434806944000006 36.0811749901924 166.67971 +573 0.435567096000006 35.9547659130299 165.91152 +574 0.436327248000006 35.8289390431905 165.14788 +575 0.437087400000006 35.7036909336908 164.38875 +576 0.437847552000006 35.5790181631589 163.63411 +577 0.438607704000006 35.4549173356021 162.88393 +578 0.439367856000006 35.3313850801777 162.13815 +579 0.440128008000006 35.2084180509657 161.39677 +580 0.440888160000006 35.0860129267438 160.65974 +581 0.441648312000006 34.9641664107661 159.92703 +582 0.442408464000006 34.8428752305421 159.1986 +583 0.443168616000006 34.7221361376199 158.47444 +584 0.443928768000006 34.6019459073706 157.7545 +585 0.444688920000006 34.4823013387753 157.03876 +586 0.445449072000006 34.3631992542147 156.32718 +587 0.446209224000006 34.2446364992603 155.61974 +588 0.446969376000006 34.1266099424681 154.9164 +589 0.447729528000006 34.0091164751749 154.21714 +590 0.448489680000006 33.8921530112957 153.52192 +591 0.449249832000006 33.7757164871243 152.83072 +592 0.450009984000006 33.6598038611353 152.1435 +593 0.450770136000006 33.5444121137886 151.46024 +594 0.451530288000006 33.4295382473356 150.78091 +595 0.452290440000006 33.3151792856276 150.10549 +596 0.453050592000006 33.2013322739262 149.43393 +597 0.453810744000006 33.0879942787157 148.76622 +598 0.454570896000006 32.975162387517 148.10233 +599 0.455331048000006 32.8628337087045 147.44223 +600 0.456091200000006 32.7510053713234 146.7859 +601 0.456851352000006 32.6396745249103 146.13329 +602 0.457611504000006 32.5288383393148 145.4844 +603 0.458371656000006 32.4184940045231 144.8392 +604 0.459131808000006 32.3086387304837 144.19765 +605 0.459891960000006 32.1992697469345 143.55973 +606 0.460652112000006 32.0903843032317 142.92541 +607 0.461412264000006 31.9819796681811 142.29468 +608 0.462172416000006 31.87405312987 141.6675 +609 0.462932568000006 31.7666019955019 141.04386 +610 0.463692720000006 31.6596235912321 140.42371 +611 0.464452872000006 31.5531152620057 139.80705 +612 0.465213024000006 31.447074371396 139.19385 +613 0.465973176000006 31.3414983014465 138.58407 +614 0.466733328000006 31.2363844525123 137.97771 +615 0.467493480000006 31.1317302431049 137.37472 +616 0.468253632000006 31.0275331097374 136.7751 +617 0.469013784000006 30.9237905067719 136.17882 +618 0.469773936000006 30.820499906268 135.58585 +619 0.470534088000006 30.7176587978333 134.99617 +620 0.471294240000006 30.6152646884751 134.40976 +621 0.472054392000006 30.5133151024534 133.82659 +622 0.472814544000006 30.4118075811357 133.24665 +623 0.473574696000006 30.3107396828532 132.66991 +624 0.474334848000006 30.2101089827584 132.09635 +625 0.475095000000006 30.1099130726839 131.52595 +626 0.475855152000006 30.0101495610027 130.95868 +627 0.476615304000006 29.9108160724906 130.39452 +628 0.477375456000006 29.8119102481885 129.83346 +629 0.478135608000006 29.7134297452675 129.27547 +630 0.478895760000006 29.6153722368941 128.72053 +631 0.479655912000007 29.5177354120983 128.16862 +632 0.480416064000007 29.420516975641 127.61972 +633 0.481176216000007 29.3237146478845 127.0738 +634 0.481936368000007 29.227326164663 126.53086 +635 0.482696520000007 29.1313492771553 125.99086 +636 0.483456672000007 29.0357817517581 125.4538 +637 0.484216824000007 28.9406213699608 124.91964 +638 0.484976976000007 28.8458659282215 124.38837 +639 0.485737128000007 28.7515132378441 123.85997 +640 0.486497280000007 28.6575611248569 123.33442 +641 0.487257432000007 28.5640074298919 122.8117 +642 0.488017584000007 28.4708500080658 122.29179 +643 0.488777736000007 28.3780867288615 121.77468 +644 0.489537888000007 28.2857154760117 121.26034 +645 0.490298040000007 28.1937341473823 120.74876 +646 0.491058192000007 28.1021406548585 120.23991 +647 0.491818344000007 28.0109329242303 119.73379 +648 0.492578496000007 27.9201088950807 119.23037 +649 0.493338648000007 27.829666520674 118.72963 +650 0.494098800000007 27.739603767845 118.23155 +651 0.494858952000007 27.6499186168902 117.73613 +652 0.495619104000007 27.5606090614595 117.24333 +653 0.496379256000007 27.4716731084483 116.75315 +654 0.497139408000007 27.3831087778921 116.26557 +655 0.497899560000007 27.2949141028605 115.78056 +656 0.498659712000007 27.2070871293535 115.29812 +657 0.499419864000007 27.1196259161981 114.81822 +658 0.500180016000007 27.0325285349458 114.34085 +659 0.500940168000007 26.9457930697716 113.86599 +660 0.501700320000007 26.8594176173735 113.39363 +661 0.502460472000007 26.773400286873 112.92374 +662 0.503220624000007 26.6877391997169 112.45632 +663 0.503980776000007 26.6024324895793 111.99135 +664 0.504740928000007 26.5174783022655 111.52881 +665 0.505501080000007 26.4328747956159 111.06868 +666 0.506261232000007 26.3486201394112 110.61096 +667 0.507021384000007 26.2647125152785 110.15562 +668 0.507781536000007 26.1811501165983 109.70264 +669 0.508541688000007 26.0979311484122 109.25202 +670 0.509301840000007 26.0150538273315 108.80374 +671 0.510061992000007 25.9325163814467 108.35779 +672 0.510822144000007 25.850317050238 107.91414 +673 0.511582296000007 25.7684540844863 107.47278 +674 0.512342448000007 25.6869257461851 107.03371 +675 0.513102600000007 25.6057303084534 106.5969 +676 0.513862752000007 25.5248660554495 106.16234 +677 0.514622904000007 25.4443312822849 105.73001 +678 0.515383056000007 25.3641242949399 105.29991 +679 0.516143208000007 25.2842434101794 104.87201 +680 0.516903360000007 25.2046869554696 104.44631 +681 0.517663512000007 25.1254532688955 104.02279 +682 0.518423664000007 25.0465406990791 103.60143 +683 0.519183816000007 24.9679476050986 103.18222 +684 0.519943968000007 24.8896723564077 102.76515 +685 0.520704120000007 24.8117133327565 102.35021 +686 0.521464272000007 24.7340689241122 101.93738 +687 0.522224424000007 24.6567375305816 101.52664 +688 0.522984576000007 24.5797175623331 101.11799 +689 0.523744728000007 24.5030074395202 100.71142 +690 0.524504880000007 24.4266055922057 100.3069 +691 0.525265032000007 24.3505104602859 99.904426 +692 0.526025184000007 24.2747204934167 99.503987 +693 0.526785336000007 24.1992341509386 99.105568 +694 0.527545488000007 24.1240499018042 98.709157 +695 0.528305640000007 24.0491662245054 98.314742 +696 0.529065792000007 23.9745816070011 97.922309 +697 0.529825944000007 23.9002945466459 97.531847 +698 0.530586096000007 23.8263035501196 97.143343 +699 0.531346248000007 23.752607133357 96.756786 +700 0.532106400000007 23.6792038214782 96.372163 +701 0.532866552000007 23.6060921487201 95.989462 +702 0.533626704000007 23.533270658368 95.608672 +703 0.534386856000007 23.4607379026877 95.22978 +704 0.535147008000007 23.388492442859 94.852775 +705 0.535907160000007 23.3165328489086 94.477646 +706 0.536667312000008 23.2448576996449 94.104381 +707 0.537427464000008 23.1734655825922 93.732968 +708 0.538187616000008 23.1023550939262 93.363396 +709 0.538947768000008 23.03152483841 92.995654 +710 0.539707920000008 22.96097342933 92.629731 +711 0.540468072000008 22.8906994884336 92.265615 +712 0.541228224000008 22.8207016458661 91.903296 +713 0.541988376000008 22.7509785401093 91.542762 +714 0.542748528000008 22.6815288179196 91.184004 +715 0.543508680000008 22.6123511342675 90.827009 +716 0.544268832000008 22.5434441522773 90.471768 +717 0.545028984000008 22.474806543167 90.11827 +718 0.545789136000008 22.4064369861894 89.766504 +719 0.546549288000008 22.338334168573 89.416459 +720 0.547309440000008 22.270496785464 89.068126 +721 0.548069592000008 22.2029235398684 88.721494 +722 0.548829744000008 22.1356131425947 88.376553 +723 0.549589896000008 22.0685643121975 88.033293 +724 0.550350048000008 22.0017757749208 87.691703 +725 0.551110200000008 21.9352462646423 87.351774 +726 0.551870352000008 21.8689745228183 87.013496 +727 0.552630504000008 21.8029592984287 86.676859 +728 0.553390656000008 21.7371993479228 86.341852 +729 0.554150808000008 21.671693435165 86.008467 +730 0.554910960000008 21.606440331382 85.676694 +731 0.555671112000008 21.5414388151091 85.346522 +732 0.556431264000008 21.4766876721383 85.017944 +733 0.557191416000008 21.4121856954658 84.690948 +734 0.557951568000008 21.3479316852405 84.365526 +735 0.558711720000008 21.2839244487129 84.041669 +736 0.559471872000008 21.2201628001841 83.719366 +737 0.560232024000008 21.1566455609557 83.39861 +738 0.560992176000008 21.0933715592796 83.079391 +739 0.561752328000008 21.0303396303089 82.7617 +740 0.562512480000008 20.9675486160484 82.445527 +741 0.563272632000008 20.9049973653061 82.130865 +742 0.564032784000008 20.8426847336453 81.817704 +743 0.564792936000008 20.780609583336 81.506035 +744 0.565553088000008 20.718770783308 81.195849 +745 0.566313240000008 20.6571672091039 80.887139 +746 0.567073392000008 20.5957977428321 80.579895 +747 0.567833544000008 20.5346612731207 80.274108 +748 0.568593696000008 20.4737566950716 79.969771 +749 0.569353848000008 20.4130829102149 79.666875 +750 0.570114000000008 20.3526388264641 79.365411 +751 0.570874152000008 20.292423358071 79.065372 +752 0.571634304000008 20.2324354255813 78.766748 +753 0.572394456000008 20.1726739557909 78.469532 +754 0.573154608000008 20.1131378817022 78.173716 +755 0.573914760000008 20.0538261424804 77.879291 +756 0.574674912000008 19.994737683411 77.58625 +757 0.575435064000008 19.9358714558572 77.294585 +758 0.576195216000008 19.8772264172174 77.004287 +759 0.576955368000008 19.8188015308835 76.715348 +760 0.577715520000008 19.7605957661995 76.427762 +761 0.578475672000008 19.7026080984199 76.14152 +762 0.579235824000008 19.6448375086694 75.856615 +763 0.579995976000008 19.5872829839018 75.573038 +764 0.580756128000008 19.5299435168602 75.290783 +765 0.581516280000008 19.472818106037 75.009841 +766 0.582276432000008 19.4159057556344 74.730206 +767 0.583036584000008 19.3592054755251 74.451869 +768 0.583796736000008 19.3027162812135 74.174824 +769 0.584556888000008 19.2464371937969 73.899063 +770 0.585317040000008 19.1903672399277 73.624579 +771 0.586077192000008 19.1345054517748 73.351365 +772 0.586837344000008 19.0788508669865 73.079412 +773 0.587597496000008 19.0234025286527 72.808716 +774 0.588357648000008 18.9681594852684 72.539267 +775 0.589117800000008 18.9131207906962 72.27106 +776 0.589877952000008 18.8582855041306 72.004086 +777 0.590638104000008 18.8036526900613 71.73834 +778 0.591398256000009 18.7492214182375 71.473815 +779 0.592158408000009 18.6949907636324 71.210503 +780 0.592918560000009 18.6409598064079 70.948397 +781 0.593678712000009 18.5871276318792 70.687491 +782 0.594438864000009 18.5334933304806 70.427779 +783 0.595199016000009 18.4800559977308 70.169253 +784 0.595959168000009 18.4268147341986 69.911907 +785 0.596719320000009 18.373768645469 69.655735 +786 0.597479472000009 18.3209168421098 69.400729 +787 0.598239624000009 18.268258439638 69.146884 +788 0.598999776000009 18.2157925584865 68.894192 +789 0.599759928000009 18.1635183239718 68.625994 +790 0.600520080000009 18.1114601849061 68.375921 +791 0.601280232000009 18.0595661373698 68.144101 +792 0.602040384000009 18.0078604353563 67.897161 +793 0.602800536000009 17.9563418124902 67.651878 +794 0.603560688000009 17.9050090139242 67.40824 +795 0.604320840000009 17.8538607962331 67.166229 +796 0.605080992000009 17.8028959273069 66.925832 +797 0.605841144000009 17.7521131862474 66.687034 +798 0.606601296000009 17.7015113632629 66.44982 +799 0.607361448000009 17.6510892595673 66.214176 +800 0.608121600000009 17.6008456872772 65.980087 +801 0.608881752000009 17.5507794693122 65.74754 +802 0.609641904000009 17.5008894392945 65.51652 +803 0.610402056000009 17.4511744414517 65.287014 +804 0.611162208000009 17.4016333305174 65.059008 +805 0.611922360000009 17.3522649716365 64.832488 +806 0.612682512000009 17.3030682402685 64.60744 +807 0.613442664000009 17.2540420220926 64.383852 +808 0.614202816000009 17.2051852129151 64.161709 +809 0.614962968000009 17.1564967185753 63.941 +810 0.615723120000009 17.1079754548548 63.72171 +811 0.616483272000009 17.0596203473856 63.503828 +812 0.617243424000009 17.0114303315605 63.287339 +813 0.618003576000009 16.963404352444 63.072232 +814 0.618763728000009 16.9155413646837 62.858494 +815 0.619523880000009 16.8678403324228 62.646113 +816 0.620284032000009 16.8203002292139 62.435075 +817 0.621044184000009 16.7729200379327 62.22537 +818 0.621804336000009 16.7256987506939 62.016984 +819 0.622564488000009 16.6786353687662 61.809907 +820 0.623324640000009 16.6317289024894 61.604125 +821 0.624084792000009 16.5849783711924 61.399628 +822 0.624844944000009 16.538382803111 61.196403 +823 0.625605096000009 16.4919412353065 60.994439 +824 0.626365248000009 16.4456527135871 60.793725 +825 0.627125400000009 16.3995162924268 60.594249 +826 0.627885552000009 16.3535310348888 60.396 +827 0.628645704000009 16.3076960125455 60.198966 +828 0.629405856000009 16.2620103054031 60.003138 +829 0.630166008000009 16.2164730018245 59.808503 +830 0.630926160000009 16.1710831984538 59.615052 +831 0.631686312000009 16.1258400001414 59.422772 +832 0.632446464000009 16.0807425198699 59.231655 +833 0.633206616000009 16.0357898786805 59.041688 +834 0.633966768000009 15.9909812056003 58.852862 +835 0.634726920000009 15.9463156375697 58.665166 +836 0.635487072000009 15.9017923193721 58.47859 +837 0.636247224000009 15.8574104035616 58.293124 +838 0.637007376000009 15.8131690503943 58.108757 +839 0.637767528000009 15.7690674277579 57.92548 +840 0.638527680000009 15.7251047111033 57.743283 +841 0.639287832000009 15.6812800833764 57.562156 +842 0.640047984000009 15.6375927349504 57.382089 +843 0.640808136000009 15.5940418635593 57.203073 +844 0.641568288000009 15.5506266742307 57.025098 +845 0.642328440000009 15.5073463792215 56.848154 +846 0.643088592000009 15.4642001979512 56.672233 +847 0.643848744000009 15.4211873569392 56.497324 +848 0.644608896000009 15.3783070897392 56.32342 +849 0.645369048000009 15.3355586368772 56.150509 +850 0.64612920000001 15.2929412457879 55.978585 +851 0.64688935200001 15.2504541707531 55.807636 +852 0.64764950400001 15.2080966728397 55.637656 +853 0.64840965600001 15.1658680198395 55.468634 +854 0.64916980800001 15.123767486207 55.300563 +855 0.64992996000001 15.0817943530017 55.133433 +856 0.65069011200001 15.0399479078268 54.967236 +857 0.65145026400001 14.9982274447715 54.801963 +858 0.65221041600001 14.9566322643522 54.637606 +859 0.65297056800001 14.9151616734549 54.474157 +860 0.65373072000001 14.8738149852777 54.311608 +861 0.65449087200001 14.8325915192741 54.149949 +862 0.65525102400001 14.7914906010969 53.989174 +863 0.65601117600001 14.7505115625423 53.829273 +864 0.65677132800001 14.7096537414946 53.67024 +865 0.65753148000001 14.6689164818715 53.512066 +866 0.65829163200001 14.6282991335696 53.354743 +867 0.65905178400001 14.5878010524111 53.198264 +868 0.65981193600001 14.5474216000899 53.042621 +869 0.66057208800001 14.5071601441187 52.887806 +870 0.66133224000001 14.4670160577774 52.733811 +871 0.66209239200001 14.4269887200601 52.58063 +872 0.66285254400001 14.3870775156245 52.428255 +873 0.66361269600001 14.3472818347401 52.276678 +874 0.66437284800001 14.3076010732381 52.125892 +875 0.66513300000001 14.2680346324614 51.97589 +876 0.66589315200001 14.2285819192142 51.826665 +877 0.66665330400001 14.1892423457131 51.67821 +878 0.66741345600001 14.1500153295387 51.530518 +879 0.66817360800001 14.1109002935862 51.383581 +880 0.66893376000001 14.0718966660182 51.237393 +881 0.66969391200001 14.0330038802168 51.091947 +882 0.67045406400001 13.994221374736 50.947236 +883 0.67121421600001 13.9555485932558 50.803254 +884 0.67197436800001 13.9169849845352 50.659994 +885 0.67273452000001 13.878530002366 50.517448 +886 0.67349467200001 13.8401831055278 50.375612 +887 0.67425482400001 13.8019437577426 50.234478 +888 0.67501497600001 13.7638114276296 50.09404 +889 0.67577512800001 13.7257855886611 49.954291 +890 0.67653528000001 13.6878657191186 49.815226 +891 0.67729543200001 13.6500513020487 49.676837 +892 0.67805558400001 13.6123418252201 49.539119 +893 0.67881573600001 13.5747367810802 49.402066 +894 0.67957588800001 13.5372356667132 49.265671 +895 0.68033604000001 13.4998379837971 49.129929 +896 0.68109619200001 13.4625432385624 48.994834 +897 0.68185634400001 13.4253509417505 48.860379 +898 0.68261649600001 13.388260608572 48.726559 +899 0.68337664800001 13.3512717586666 48.593369 +900 0.68413680000001 13.314383916062 48.460801 +901 0.68489695200001 13.2775966091343 48.328851 +902 0.68565710400001 13.2409093705675 48.197513 +903 0.68641725600001 13.2043217373146 48.066781 +904 0.68717740800001 13.1678332505583 47.936651 +905 0.68793756000001 13.1314434556718 47.807115 +906 0.68869771200001 13.0951519021809 47.67817 +907 0.68945786400001 13.0589581437251 47.549809 +908 0.69021801600001 13.0228617380205 47.422027 +909 0.69097816800001 12.9868622468218 47.294819 +910 0.69173832000001 12.9509592358847 47.168179 +911 0.69249847200001 12.9151522749294 47.042104 +912 0.69325862400001 12.8794409376043 46.916586 +913 0.69401877600001 12.8438248014488 46.791622 +914 0.69477892800001 12.8083034478578 46.667206 +915 0.69553908000001 12.772876462046 46.543333 +916 0.69629923200001 12.737543433012 46.419998 +917 0.69705938400001 12.7023039535036 46.297197 +918 0.69781953600001 12.6671576199828 46.174924 +919 0.69857968800001 12.6321040325908 46.053174 +920 0.69933984000001 12.5971427951142 45.931944 +921 0.70009999200001 12.5622735149508 45.811227 +922 0.700860144000011 12.527495803076 45.69102 +923 0.701620296000011 12.4928092740087 45.571318 +924 0.702380448000011 12.4582135457786 45.452116 +925 0.703140600000011 12.4237082398937 45.33341 +926 0.703900752000011 12.3892929813065 45.215195 +927 0.704660904000011 12.3549673983826 45.097466 +928 0.705421056000011 12.3207311228677 44.98022 +929 0.706181208000011 12.2865837898568 44.863452 +930 0.706941360000011 12.2525250377611 44.747157 +931 0.707701512000011 12.218554508278 44.631331 +932 0.708461664000011 12.1846718463593 44.515971 +933 0.709221816000011 12.1508767001807 44.401071 +934 0.709981968000011 12.1171687211102 44.286627 +935 0.710742120000011 12.0835475636791 44.172636 +936 0.711502272000011 12.050012885551 44.059094 +937 0.712262424000011 12.016564347492 43.945995 +938 0.713022576000011 11.9832016133413 43.833337 +939 0.713782728000011 11.9499243499816 43.721115 +940 0.714542880000011 11.9167322273098 43.609325 +941 0.715303032000011 11.8836249182085 43.497964 +942 0.716063184000011 11.8506020985169 43.387027 +943 0.716823336000011 11.8176634470022 43.276511 +944 0.717583488000011 11.7848086453318 43.166412 +945 0.718343640000011 11.7520373780451 43.056726 +946 0.719103792000011 11.7193493325251 42.947449 +947 0.719863944000011 11.6867441989721 42.838578 +948 0.720624096000011 11.6542216703749 42.73011 +949 0.721384248000011 11.6217814424848 42.622039 +950 0.722144400000011 11.5894232137878 42.514364 +951 0.722904552000011 11.5571466854786 42.407079 +952 0.723664704000011 11.5249515614335 42.300183 +953 0.724424856000011 11.4928375481846 42.193671 +954 0.725185008000011 11.4608043548933 42.08754 +955 0.725945160000011 11.4288516933248 41.981786 +956 0.726705312000011 11.3969792778223 41.876406 +957 0.727465464000011 11.3651868252812 41.771397 +958 0.728225616000011 11.3334740551243 41.666756 +959 0.728985768000011 11.3018406892767 41.562479 +960 0.729745920000011 11.2702864521405 41.458563 +961 0.730506072000011 11.2388110705709 41.355004 +962 0.731266224000011 11.2074142738508 41.2518 +963 0.732026376000011 11.1760957936672 41.148948 +964 0.732786528000011 11.1448553640869 41.046443 +965 0.733546680000011 11.1136927215328 40.944284 +966 0.734306832000011 11.0826076047599 40.842467 +967 0.735066984000011 11.0515997548319 40.74099 +968 0.735827136000011 11.020668915098 40.639848 +969 0.736587288000011 10.9898148311696 40.53904 +970 0.737347440000011 10.9590372508974 40.438562 +971 0.738107592000011 10.9283359243486 40.338411 +972 0.738867744000011 10.8977106037848 40.238584 +973 0.739627896000011 10.8671610436385 40.13908 +974 0.740388048000011 10.836687000492 40.039894 +975 0.741148200000011 10.8062882330548 39.941024 +976 0.741908352000011 10.7759645021417 39.842467 +977 0.742668504000011 10.7457155706511 39.744221 +978 0.743428656000011 10.7155412035438 39.646283 +979 0.744188808000011 10.6854411678214 39.54865 +980 0.744948960000011 10.6554152325051 39.45132 +981 0.745709112000011 10.6254631686144 39.354289 +982 0.746469264000011 10.5955847491471 39.257556 +983 0.747229416000011 10.5657797490576 39.161118 +984 0.747989568000011 10.5360479452373 39.064972 +985 0.748749720000011 10.5063891164936 38.969115 +986 0.749509872000011 10.4768030435299 38.873546 +987 0.750270024000011 10.4472895089256 38.778262 +988 0.751030176000011 10.4178482971165 38.68326 +989 0.751790328000011 10.3884791943743 38.588538 +990 0.752550480000011 10.3591819887884 38.494093 +991 0.753310632000011 10.3299564702448 38.399924 +992 0.754070784000011 10.3008024304085 38.306028 +993 0.754830936000011 10.2717196627033 38.212402 +994 0.755591088000012 10.2427079622934 38.119045 +995 0.756351240000012 10.2137671260642 38.025954 +996 0.757111392000012 10.1848969526047 37.933126 +997 0.757871544000012 10.1560972421874 37.840561 +998 0.758631696000012 10.1273677967517 37.748254 +999 0.759391848000012 10.0987084198844 37.656206 +1000 0.760152000000012 10.0701189168025 37.564412 +1001 0.760912152000012 10.0415990943347 37.472871 +1002 0.761672304000012 10.0131487609043 37.381581 +1003 0.762432456000012 9.98476772651106 37.290541 +1004 0.763192608000012 9.95645580271441 37.199747 +1005 0.763952760000012 9.92821280261518 37.109198 +1006 0.764712912000012 9.90003854083943 37.018892 +1007 0.765473064000012 9.87193283352087 36.928826 +1008 0.766233216000012 9.84389549828415 36.839 +1009 0.766993368000012 9.81592635422802 36.749411 +1010 0.767753520000012 9.78802522190896 36.660057 +1011 0.768513672000012 9.76019192332431 36.570936 +1012 0.769273824000012 9.7324262818965 36.482046 +1013 0.770033976000012 9.70472812245607 36.393386 +1014 0.770794128000012 9.67709727122682 36.304954 +1015 0.771554280000012 9.64953355580833 36.216747 +1016 0.772314432000012 9.6220368051615 36.128765 +1017 0.773074584000012 9.59460684959226 36.041005 +1018 0.773834736000012 9.56724352073597 35.953466 +1019 0.774594888000012 9.53994665154256 35.866146 +1020 0.775355040000012 9.51271607626052 35.779042 +1021 0.776115192000012 9.4855516304222 35.692155 +1022 0.776875344000012 9.45845315082883 35.605481 +1023 0.777635496000012 9.43142047553547 35.519019 +1024 0.778395648000012 9.40445344383622 35.432768 +1025 0.779155800000012 9.37755189624974 35.346726 +1026 0.779915952000012 9.35071567450431 35.260892 +1027 0.780676104000012 9.32394462152419 35.175263 +1028 0.781436256000012 9.29723858141465 35.089839 +1029 0.782196408000012 9.27059739944806 35.004617 +1030 0.782956560000012 9.24402092204981 34.919597 +1031 0.783716712000012 9.2175089967849 34.834776 +1032 0.784476864000012 9.19106147234286 34.750154 +1033 0.785237016000012 9.16467819852582 34.665729 +1034 0.785997168000012 9.13835902623334 34.581499 +1035 0.786757320000012 9.11210380744999 34.497463 +1036 0.787517472000012 9.08591239523176 34.41362 +1037 0.788277624000012 9.05978464369257 34.329968 +1038 0.789037776000012 9.03372040799148 34.246506 +1039 0.789797928000012 9.00771954431968 34.163232 +1040 0.790558080000012 8.98178190988762 34.080145 +1041 0.791318232000012 8.95590736291192 33.997245 +1042 0.792078384000012 8.93009576260326 33.914529 +1043 0.792838536000012 8.90434696915344 33.831996 +1044 0.793598688000012 8.87866084372309 33.749645 +1045 0.794358840000012 8.85303724842941 33.667475 +1046 0.795118992000012 8.8274760463341 33.585485 +1047 0.795879144000012 8.8019771014306 33.503673 +1048 0.796639296000012 8.77654027863295 33.422038 +1049 0.797399448000012 8.7511654437633 33.340579 +1050 0.798159600000012 8.72585246354078 33.259294 +1051 0.798919752000012 8.70060120556871 33.178184 +1052 0.799679904000012 8.67541153832437 33.097245 +1053 0.800440056000012 8.65028333114661 33.016478 +1054 0.801200208000012 8.62521645422446 32.935882 +1055 0.801960360000012 8.60021077858671 32.855454 +1056 0.802720512000012 8.57526617608994 32.775194 +1057 0.803480664000012 8.55038251940783 32.695102 +1058 0.804240816000012 8.52555968202007 32.615175 +1059 0.805000968000012 8.50079753820143 32.535413 +1060 0.805761120000012 8.47609596301143 32.455815 +1061 0.806521272000012 8.451454832283 32.37638 +1062 0.807281424000012 8.42687402261284 32.297107 +1063 0.808041576000012 8.40235341134972 32.217995 +1064 0.808801728000012 8.37789287658533 32.139042 +1065 0.809561880000013 8.35349229714341 32.060248 +1066 0.810322032000013 8.32915155256961 31.981613 +1067 0.811082184000013 8.30487052312144 31.903134 +1068 0.811842336000013 8.28064908975828 31.824812 +1069 0.812602488000013 8.25648713413173 31.746645 +1070 0.813362640000013 8.23238453857554 31.668632 +1071 0.814122792000013 8.20834118609592 31.590773 +1072 0.814882944000013 8.18435696036211 31.513066 +1073 0.815643096000013 8.16043174569666 31.435511 +1074 0.816403248000013 8.13656542706615 31.358107 +1075 0.817163400000013 8.11275789007172 31.280853 +1076 0.817923552000013 8.08900902094015 31.203748 +1077 0.818683704000013 8.0653187065142 31.126792 +1078 0.819443856000013 8.04168683424408 31.049984 +1079 0.820204008000013 8.01811329217779 30.973322 +1080 0.820964160000013 7.9945979689532 30.896806 +1081 0.821724312000013 7.97114075378817 30.820436 +1082 0.822484464000013 7.94774153647275 30.744211 +1083 0.823244616000013 7.92440020735981 30.668129 +1084 0.824004768000013 7.90111665735719 30.59219 +1085 0.824764920000013 7.8778907779185 30.516394 +1086 0.825525072000013 7.85472246103549 30.44074 +1087 0.826285224000013 7.83161159922918 30.365227 +1088 0.827045376000013 7.80855808554214 30.289854 +1089 0.827805528000013 7.78556181352968 30.21462 +1090 0.828565680000013 7.76262267725265 30.139526 +1091 0.829325832000013 7.73974057126874 30.06457 +1092 0.830085984000013 7.71691539062519 29.989752 +1093 0.830846136000013 7.69414703085037 29.915071 +1094 0.831606288000013 7.67143538794688 29.840527 +1095 0.832366440000013 7.64878035838305 29.766118 +1096 0.833126592000013 7.62618183908604 29.691845 +1097 0.833886744000013 7.60363972743382 29.617707 +1098 0.834646896000013 7.58115392124842 29.543702 +1099 0.835407048000013 7.55872431878794 29.469831 +1100 0.836167200000013 7.53635081873974 29.396094 +1101 0.836927352000013 7.51403332021296 29.322488 +1102 0.837687504000013 7.49177172273184 29.249015 +1103 0.838447656000013 7.46956592622824 29.175673 +1104 0.839207808000013 7.44741583103512 29.102461 +1105 0.839967960000013 7.42532133787931 29.02938 +1106 0.840728112000013 7.40328234787498 28.956429 +1107 0.841488264000013 7.38129876251671 28.883608 +1108 0.842248416000013 7.35937048367293 28.810915 +1109 0.843008568000013 7.33749741357968 28.73835 +1110 0.843768720000013 7.31567945483344 28.665914 +1111 0.844528872000013 7.29391651038526 28.593605 +1112 0.845289024000013 7.27220848353415 28.521422 +1113 0.846049176000013 7.25055527792088 28.449367 +1114 0.846809328000013 7.22895679752158 28.377437 +1115 0.847569480000013 7.20741294664209 28.305633 +1116 0.848329632000013 7.18592362991127 28.233955 +1117 0.849089784000013 7.16448875227526 28.162401 +1118 0.849849936000013 7.14310821899183 28.090972 +1119 0.850610088000013 7.121781935624 28.019666 +1120 0.851370240000013 7.1005098080344 27.948485 +1121 0.852130392000013 7.07929174237997 27.877426 +1122 0.852890544000013 7.05812764510563 27.806491 +1123 0.853650696000013 7.03701742293905 27.735678 +1124 0.854410848000013 7.01596098288516 27.664987 +1125 0.855171000000013 6.99495823222052 27.594418 +1126 0.855931152000013 6.97400907848786 27.523971 +1127 0.856691304000013 6.95311342949093 27.453644 +1128 0.857451456000013 6.9322711932893 27.383439 +1129 0.858211608000013 6.91148227819285 27.313353 +1130 0.858971760000013 6.89074659275674 27.243388 +1131 0.859731912000013 6.8700640457764 27.173543 +1132 0.860492064000013 6.84943454628268 27.103818 +1133 0.861252216000013 6.82885800353624 27.034211 +1134 0.862012368000013 6.80833432702333 26.964724 +1135 0.862772520000013 6.78786342645094 26.895355 +1136 0.863532672000013 6.76744521174133 26.826104 +1137 0.864292824000014 6.74707959302825 26.756972 +1138 0.865052976000014 6.72676648065142 26.687957 +1139 0.865813128000014 6.70650578515252 26.61906 +1140 0.866573280000014 6.68629741727057 26.55028 +1141 0.867333432000014 6.66614128793704 26.481617 +1142 0.868093584000014 6.64603730827217 26.413072 +1143 0.868853736000014 6.62598538957975 26.344642 +1144 0.869613888000014 6.60598544334341 26.276329 +1145 0.870374040000014 6.58603738122231 26.208132 +1146 0.871134192000014 6.56614111504668 26.140051 +1147 0.871894344000014 6.54629655681391 26.072086 +1148 0.872654496000014 6.52650361868446 26.004236 +1149 0.873414648000014 6.5067622129777 25.936501 +1150 0.874174800000014 6.48707225216809 25.868882 +1151 0.874934952000014 6.46743364888106 25.801377 +1152 0.875695104000014 6.44784631588943 25.733987 +1153 0.876455256000014 6.42831016610967 25.666711 +1154 0.877215408000014 6.40882511259737 25.59955 +1155 0.877975560000014 6.38939106854471 25.532502 +1156 0.878735712000014 6.37000794727585 25.465569 +1157 0.879495864000014 6.35067566224398 25.398749 +1158 0.880256016000014 6.3313941270272 25.332043 +1159 0.881016168000014 6.31216325532553 25.265451 +1160 0.881776320000014 6.29298296095713 25.198972 +1161 0.882536472000014 6.27385315785538 25.132606 +1162 0.883296624000014 6.25477376006464 25.066353 +1163 0.884056776000014 6.23574468173809 25.000212 +1164 0.884816928000014 6.2167658371336 24.934185 +1165 0.885577080000014 6.1978371406111 24.86827 +1166 0.886337232000014 6.17895850662897 24.802468 +1167 0.887097384000014 6.16012984974123 24.736778 +1168 0.887857536000014 6.14135108459475 24.6712 +1169 0.888617688000014 6.12262212592548 24.605734 +1170 0.889377840000014 6.10394288855629 24.54038 +1171 0.890137992000014 6.08531328739367 24.475139 +1172 0.890898144000014 6.066733237425 24.410009 +1173 0.891658296000014 6.04820265371557 24.34499 +1174 0.892418448000014 6.02972145140598 24.280083 +1175 0.893178600000014 6.01128954570939 24.215288 +1176 0.893938752000014 5.99290685190882 24.150604 +1177 0.894698904000014 5.97457328535459 24.086032 +1178 0.895459056000014 5.95628876146149 24.02157 +1179 0.896219208000014 5.93805319570663 23.95722 +1180 0.896979360000014 5.91986650362654 23.892981 +1181 0.897739512000014 5.90172860081505 23.828853 +1182 0.898499664000014 5.88363940292072 23.764836 +1183 0.899259816000014 5.8655988256443 23.70093 +1184 0.900019968000014 5.84760678473685 23.637134 +1185 0.900780120000014 5.82966319599697 23.573449 +1186 0.901540272000014 5.81176797526885 23.509875 +1187 0.902300424000014 5.79392103844002 23.446412 +1188 0.903060576000014 5.77612230143903 23.383059 +1189 0.903820728000014 5.75837168023367 23.319817 +1190 0.904580880000014 5.74066909082851 23.256685 +1191 0.905341032000014 5.72301444926296 23.193663 +1192 0.906101184000014 5.70540767160953 23.130752 +1193 0.906861336000014 5.6878486739714 23.067952 +1194 0.907621488000014 5.67033737248103 23.005261 +1195 0.908381640000014 5.65287368329778 22.942681 +1196 0.909141792000014 5.63545752260625 22.880211 +1197 0.909901944000014 5.61808880661482 22.817852 +1198 0.910662096000014 5.60076745155312 22.755602 +1199 0.911422248000014 5.58349337367094 22.693463 +1200 0.912182400000014 5.5662664892363 22.631434 +1201 0.912942552000014 5.54908671453385 22.569515 +1202 0.913702704000014 5.53195396586318 22.507706 +1203 0.914462856000014 5.51486815953694 22.446007 +1204 0.915223008000014 5.49782921188004 22.384418 +1205 0.915983160000014 5.48083703922732 22.322939 +1206 0.916743312000014 5.46389155792252 22.261571 +1207 0.917503464000014 5.44699268431673 22.200312 +1208 0.918263616000014 5.43014033476694 22.139163 +1209 0.919023768000015 5.41333442563466 22.078125 +1210 0.919783920000015 5.39657487328449 22.017196 +1211 0.920544072000015 5.37986159408313 21.956378 +1212 0.921304224000015 5.36319450439762 21.895669 +1213 0.922064376000015 5.34657352059434 21.835071 +1214 0.922824528000015 5.32999855903788 21.774582 +1215 0.923584680000015 5.31346953608967 21.714204 +1216 0.924344832000015 5.29698636810677 21.653935 +1217 0.925104984000015 5.28054897144099 21.593777 +1218 0.925865136000015 5.2641572624377 21.533729 +1219 0.926625288000015 5.2478111574347 21.473791 +1220 0.927385440000015 5.23151057276105 21.413962 +1221 0.928145592000015 5.21525542473638 21.354244 +1222 0.928905744000015 5.19904562966968 21.294636 +1223 0.929665896000015 5.18288110385861 21.235139 +1224 0.930426048000015 5.1667617635881 21.175751 +1225 0.931186200000015 5.15068752513015 21.116473 +1226 0.931946352000015 5.13465830474207 21.057306 +1227 0.932706504000015 5.11867401866664 20.998249 +1228 0.933466656000015 5.10273458313071 20.939302 +1229 0.934226808000015 5.08683991434433 20.880465 +1230 0.934986960000015 5.07098992850043 20.821739 +1231 0.935747112000015 5.05518454177387 20.763122 +1232 0.936507264000015 5.03942367032068 20.704617 +1233 0.937267416000015 5.02370723027743 20.646221 +1234 0.938027568000015 5.00803513776092 20.587936 +1235 0.938787720000015 4.99240730886675 20.529761 +1236 0.939547872000015 4.97682365966967 20.471697 +1237 0.940308024000015 4.96128410622242 20.413743 +1238 0.941068176000015 4.94578856455552 20.3559 +1239 0.941828328000015 4.93033695067638 20.298167 +1240 0.942588480000015 4.9149291805691 20.240544 +1241 0.943348632000015 4.89956517019394 20.183033 +1242 0.944108784000015 4.88424483548703 20.125631 +1243 0.944868936000015 4.86896809235938 20.068341 +1244 0.945629088000015 4.85373485669735 20.011161 +1245 0.946389240000015 4.83854504436162 19.954092 +1246 0.947149392000015 4.8233985711868 19.897133 +1247 0.947909544000015 4.80829535298161 19.840286 +1248 0.948669696000015 4.79323530552843 19.783549 +1249 0.949429848000015 4.77821834458248 19.726923 +1250 0.950190000000015 4.76324438587229 19.670408 +1251 0.950950152000015 4.74831334509891 19.614003 +1252 0.951710304000015 4.7334251379362 19.55771 +1253 0.952470456000015 4.71857968003007 19.501528 +1254 0.953230608000015 4.70377688699881 19.445457 +1255 0.953990760000015 4.6890166744325 19.389497 +1256 0.954750912000015 4.67429895789328 19.333647 +1257 0.955511064000015 4.65962365291474 19.277909 +1258 0.956271216000015 4.64499067500261 19.222283 +1259 0.957031368000015 4.63039993963364 19.166767 +1260 0.957791520000015 4.61585136225645 19.111363 +1261 0.958551672000015 4.60134485829104 19.05607 +1262 0.959311824000015 4.5868803431288 19.000888 +1263 0.960071976000015 4.5724577321327 18.945818 +1264 0.960832128000015 4.55807694063717 18.890859 +1265 0.961592280000015 4.54373788394811 18.836011 +1266 0.962352432000015 4.52944047734274 18.781275 +1267 0.963112584000015 4.51518463607037 18.726651 +1268 0.963872736000015 4.50097027535164 18.672138 +1269 0.964632888000015 4.48679731037929 18.617736 +1270 0.965393040000015 4.47266565631791 18.563447 +1271 0.966153192000015 4.45857522830405 18.509268 +1272 0.966913344000015 4.44452594144662 18.455202 +1273 0.967673496000015 4.43051771082694 18.401247 +1274 0.968433648000015 4.41655045149889 18.347404 +1275 0.969193800000015 4.40262407848919 18.293673 +1276 0.969953952000015 4.38873850679743 18.240054 +1277 0.970714104000015 4.37489365139675 18.186547 +1278 0.971474256000015 4.36108942723351 18.133151 +1279 0.972234408000015 4.34732574922798 18.079868 +1280 0.972994560000015 4.33360253227432 18.026696 +1281 0.973754712000016 4.31991969124118 17.973636 +1282 0.974514864000016 4.30627714097182 17.920689 +1283 0.975275016000016 4.29267479628441 17.867853 +1284 0.976035168000016 4.27911257197244 17.81513 +1285 0.976795320000016 4.26559038280497 17.762519 +1286 0.977555472000016 4.25210814352722 17.71002 +1287 0.978315624000016 4.23866576886063 17.657633 +1288 0.979075776000016 4.22526317350348 17.605358 +1289 0.979835928000016 4.21190027213126 17.553196 +1290 0.980596080000016 4.19857697939687 17.501146 +1291 0.981356232000016 4.18529320993129 17.449208 +1292 0.982116384000016 4.1720488783441 17.397383 +1293 0.982876536000016 4.15884389922351 17.34567 +1294 0.983636688000016 4.1456781871372 17.294069 +1295 0.984396840000016 4.13255165663255 17.242581 +1296 0.985156992000016 4.11946422223748 17.191205 +1297 0.985917144000016 4.1064157984606 17.139942 +1298 0.986677296000016 4.09340629979166 17.088791 +1299 0.987437448000016 4.08043564070236 17.037753 +1300 0.988197600000016 4.06750373564665 16.986827 +1301 0.988957752000016 4.05461049906158 16.936014 +1302 0.989717904000016 4.04175584536729 16.885314 +1303 0.990478056000016 4.02893968896826 16.834726 +1304 0.991238208000016 4.01616194425316 16.784251 +1305 0.991998360000016 4.00342252559598 16.733888 +1306 0.992758512000016 3.99072134735645 16.683638 +1307 0.993518664000016 3.97805832388046 16.633501 +1308 0.994278816000016 3.96543336950097 16.583476 +1309 0.995038968000016 3.95284639853823 16.533564 +1310 0.995799120000016 3.94029732530089 16.483765 +1311 0.996559272000016 3.92778606408616 16.434079 +1312 0.997319424000016 3.9153125291807 16.384505 +1313 0.998079576000016 3.90287663486137 16.335045 +1314 0.998839728000016 3.89047829539551 16.285697 +1315 0.999599880000016 3.87811742504202 16.236462 +1316 1.00036003200002 3.86579393772429 16.187346 +1317 1.00112018400002 3.85350773884626 16.13836 +1318 1.00188033600002 3.84125872483556 16.08951 +1319 1.00264048800002 3.82904679191626 16.040797 +1320 1.00340064000002 3.81687183655886 15.99222 +1321 1.00416079200002 3.80473375547986 15.943779 +1322 1.00492094400002 3.79263244564147 15.895473 +1323 1.00568109600002 3.78056780425113 15.847302 +1324 1.00644124800002 3.76853972876115 15.799266 +1325 1.00720140000002 3.75654811686839 15.751364 +1326 1.00796155200002 3.74459286651379 15.703597 +1327 1.00872170400002 3.73267387588201 15.655963 +1328 1.00948185600002 3.72079104340107 15.608463 +1329 1.01024200800002 3.70894426774194 15.561095 +1330 1.01100216000002 3.69713344781816 15.513861 +1331 1.01176231200002 3.68535848278544 15.466759 +1332 1.01252246400002 3.6736192720413 15.419789 +1333 1.01328261600002 3.66191571522467 15.372952 +1334 1.01404276800002 3.6502477122155 15.326245 +1335 1.01480292000002 3.63861516313439 15.27967 +1336 1.01556307200002 3.62701796834217 15.233226 +1337 1.01632322400002 3.61545602843955 15.186913 +1338 1.01708337600002 3.60392924426671 15.140729 +1339 1.01784352800002 3.59243751690292 15.094676 +1340 1.01860368000002 3.58098074766615 15.048753 +1341 1.01936383200002 3.56955883811271 15.002958 +1342 1.02012398400002 3.55817169003681 14.957293 +1343 1.02088413600002 3.54681920547021 14.911757 +1344 1.02164428800002 3.53550128668183 14.866349 +1345 1.02240444000002 3.52421783617734 14.821069 +1346 1.02316459200002 3.51296875669882 14.775916 +1347 1.02392474400002 3.5017539512243 14.730892 +1348 1.02468489600002 3.49057332296744 14.685994 +1349 1.02544504800002 3.47942677537711 14.641224 +1350 1.02620520000002 3.468314212137 14.59658 +1351 1.02696535200002 3.45723553716523 14.552062 +1352 1.02772550400002 3.44619065461401 14.50767 +1353 1.02848565600002 3.43517946886915 14.463403 +1354 1.02924580800002 3.42420188454978 14.419262 +1355 1.03000596000002 3.4132578065079 14.375246 +1356 1.03076611200002 3.402347139828 14.331355 +1357 1.03152626400002 3.39146978982667 14.287588 +1358 1.03228641600002 3.38062566205224 14.243946 +1359 1.03304656800002 3.36981466228434 14.200427 +1360 1.03380672000002 3.35903669653357 14.157031 +1361 1.03456687200002 3.34829167104106 14.113759 +1362 1.03532702400002 3.3375794922781 14.07061 +1363 1.03608717600002 3.32690006694574 14.027583 +1364 1.03684732800002 3.31625330197445 13.984678 +1365 1.03760748000002 3.30563910452366 13.941896 +1366 1.03836763200002 3.29505738198141 13.899235 +1367 1.03912778400002 3.28450804196395 13.856696 +1368 1.03988793600002 3.27399099231535 13.814277 +1369 1.04064808800002 3.26350614110713 13.77198 +1370 1.04140824000002 3.25305339663783 13.729803 +1371 1.04216839200002 3.24263266743267 13.687746 +1372 1.04292854400002 3.23224386224309 13.645809 +1373 1.04368869600002 3.22188689004644 13.603991 +1374 1.04444884800002 3.21156166004554 13.562293 +1375 1.04520900000002 3.20126808166831 13.520714 +1376 1.04596915200002 3.19100606456735 13.479254 +1377 1.04672930400002 3.18077551861957 13.437912 +1378 1.04748945600002 3.17057635392584 13.396688 +1379 1.04824960800002 3.16040848081052 13.355582 +1380 1.04900976000002 3.15027180982111 13.314593 +1381 1.04976991200002 3.14016625172788 13.273722 +1382 1.05053006400002 3.13009171752345 13.232967 +1383 1.05129021600002 3.1200481184224 13.19233 +1384 1.05205036800002 3.11003536586088 13.151808 +1385 1.05281052000002 3.10005337149623 13.111403 +1386 1.05357067200002 3.09010204720661 13.071114 +1387 1.05433082400002 3.08018130509054 13.03094 +1388 1.05509097600002 3.07029105746657 12.990881 +1389 1.05585112800002 3.06043121687288 12.950937 +1390 1.05661128000002 3.05060169606686 12.911108 +1391 1.05737143200002 3.04080240802477 12.871393 +1392 1.05813158400002 3.03103326594128 12.831792 +1393 1.05889173600002 3.02129418322913 12.792305 +1394 1.05965188800002 3.01158507351873 12.752931 +1395 1.06041204000002 3.00190585065777 12.713671 +1396 1.06117219200002 2.99225642871081 12.674523 +1397 1.06193234400002 2.9826367219589 12.635489 +1398 1.06269249600002 2.97304664489919 12.596566 +1399 1.06345264800002 2.96348611224455 12.557756 +1400 1.06421280000002 2.95395503892315 12.519057 +1401 1.06497295200002 2.94445334007811 12.48047 +1402 1.06573310400002 2.93498093106706 12.441994 +1403 1.06649325600002 2.92553772746178 12.403628 +1404 1.06725340800002 2.91612364504781 12.365374 +1405 1.06801356000002 2.90673859982404 12.32723 +1406 1.06877371200002 2.89738250800234 12.289196 +1407 1.06953386400002 2.88805528600715 12.251272 +1408 1.07029401600002 2.87875685047509 12.213457 +1409 1.07105416800002 2.8694871182546 12.175752 +1410 1.07181432000002 2.8602460064055 12.138155 +1411 1.07257447200002 2.85103343219863 12.100668 +1412 1.07333462400002 2.84184931311545 12.063288 +1413 1.07409477600002 2.83269356684767 12.026017 +1414 1.07485492800002 2.8235661112968 11.988854 +1415 1.07561508000002 2.81446686457385 11.951798 +1416 1.07637523200002 2.80539574499883 11.91485 +1417 1.07713538400002 2.79635267110046 11.878008 +1418 1.07789553600002 2.78733756161572 11.841274 +1419 1.07865568800002 2.77835033548948 11.804645 +1420 1.07941584000002 2.76939091187408 11.768124 +1421 1.08017599200002 2.760459210129 11.731708 +1422 1.08093614400002 2.75155514982041 11.695397 +1423 1.08169629600002 2.7426786507208 11.659193 +1424 1.08245644800002 2.73382963280859 11.623093 +1425 1.08321660000002 2.72500801626775 11.587098 +1426 1.08397675200002 2.71621372148739 11.551208 +1427 1.08473690400002 2.7074466690614 11.515422 +1428 1.08549705600002 2.69870677978799 11.47974 +1429 1.08625720800002 2.68999397466941 11.444162 +1430 1.08701736000002 2.68130817491145 11.408687 +1431 1.08777751200002 2.67264930192312 11.373316 +1432 1.08853766400002 2.66401727731624 11.338048 +1433 1.08929781600002 2.65541202290502 11.302882 +1434 1.09005796800002 2.64683346070575 11.267819 +1435 1.09081812000002 2.63828151293629 11.232858 +1436 1.09157827200002 2.62975610201582 11.197999 +1437 1.09233842400002 2.62125715056432 11.163241 +1438 1.09309857600002 2.61278458140227 11.128585 +1439 1.09385872800002 2.60433831755023 11.094031 +1440 1.09461888000002 2.59591828222842 11.059577 +1441 1.09537903200002 2.58752439885641 11.025223 +1442 1.09613918400002 2.57915659105265 10.99097 +1443 1.09689933600002 2.57081478263411 10.956817 +1444 1.09765948800002 2.56249889761592 10.922764 +1445 1.09841964000002 2.55420886021093 10.888811 +1446 1.09917979200002 2.54594459482935 10.854957 +1447 1.09993994400002 2.53770602607839 10.821202 +1448 1.10070009600002 2.52949307876179 10.787545 +1449 1.10146024800002 2.52130567787952 10.753987 +1450 1.10222040000002 2.51314374862735 10.720528 +1451 1.10298055200002 2.50500721639644 10.687166 +1452 1.10374070400002 2.49689600677302 10.653903 +1453 1.10450085600002 2.48881004553792 10.620736 +1454 1.10526100800002 2.48074925866625 10.587667 +1455 1.10602116000002 2.47271357232698 10.554695 +1456 1.10678131200002 2.46470291288255 10.52182 +1457 1.10754146400002 2.4567172068885 10.489042 +1458 1.10830161600002 2.44875638109308 10.456359 +1459 1.10906176800002 2.44082036243685 10.423773 +1460 1.10982192000002 2.4329090780523 10.391282 +1461 1.11058207200002 2.42502245526347 10.358886 +1462 1.11134222400002 2.41716042158557 10.326586 +1463 1.11210237600002 2.40932290472455 10.294381 +1464 1.11286252800002 2.40150983257679 10.262271 +1465 1.11362268000002 2.39372113322864 10.230255 +1466 1.11438283200002 2.38595673495609 10.198333 +1467 1.11514298400002 2.37821656622434 10.166506 +1468 1.11590313600002 2.37050055568745 10.134772 +1469 1.11666328800002 2.36280863218794 10.103131 +1470 1.11742344000002 2.35514072475641 10.071584 +1471 1.11818359200002 2.34749676261113 10.04013 +1472 1.11894374400002 2.33987667515771 10.008768 +1473 1.11970389600002 2.33228039198866 9.9774994 +1474 1.12046404800002 2.32470784288304 9.9463227 +1475 1.12122420000002 2.31715895780607 9.915238 +1476 1.12198435200002 2.30963366690874 9.884245 +1477 1.12274450400002 2.30213190052743 9.8533436 +1478 1.12350465600002 2.29465358918351 9.8225335 +1479 1.12426480800002 2.28719866358301 9.7918144 +1480 1.12502496000002 2.27976705461617 9.7611861 +1481 1.12578511200002 2.27235869335711 9.7306483 +1482 1.12654526400002 2.2649735110634 9.7002009 +1483 1.12730541600002 2.25761143917574 9.6698435 +1484 1.12806556800002 2.25027240931753 9.639576 +1485 1.12882572000002 2.24295635329449 9.609398 +1486 1.12958587200002 2.2356632030943 9.5793094 +1487 1.13034602400002 2.22839289088622 9.5493099 +1488 1.13110617600002 2.22114534902069 9.5193993 +1489 1.13186632800002 2.21392051002895 9.4895773 +1490 1.13262648000002 2.2067183066227 9.4598438 +1491 1.13338663200002 2.19953867169367 9.4301984 +1492 1.13414678400002 2.19238153831324 9.4006409 +1493 1.13490693600002 2.18524683973212 9.3711711 +1494 1.13566708800002 2.17813450937991 9.3417888 +1495 1.13642724000002 2.17104448086474 9.3124937 +1496 1.13718739200002 2.16397668797291 9.2832856 +1497 1.13794754400002 2.15693106466847 9.2541642 +1498 1.13870769600002 2.1499075450929 9.2251294 +1499 1.13946784800002 2.14290606356468 9.1961808 +1500 1.14022800000002 2.13592655457893 9.1673184 +1501 1.14098815200002 2.12896895280706 9.1385417 +1502 1.14174830400002 2.12203319309634 9.1098506 +1503 1.14250845600002 2.11511921046956 9.0812449 +1504 1.14326860800002 2.10822694012467 9.0527243 +1505 1.14402876000002 2.10135631743435 9.0242887 +1506 1.14478891200002 2.09450727794567 8.9959377 +1507 1.14554906400002 2.08767975737972 8.9676711 +1508 1.14630921600002 2.08087369163122 8.9394888 +1509 1.14706936800002 2.07408901676815 8.9113905 +1510 1.14782952000002 2.06732566903137 8.8833759 +1511 1.14858967200002 2.06058358483425 8.8554449 +1512 1.14934982400002 2.05386270076231 8.8275972 +1513 1.15010997600002 2.04716295357282 8.7998325 +1514 1.15087012800002 2.04048428019443 8.7721507 +1515 1.15163028000002 2.03382661772684 8.7445516 +1516 1.15239043200002 2.02718990344037 8.7170349 +1517 1.15315058400002 2.02057407477561 8.6896003 +1518 1.15391073600002 2.01397906934306 8.6622477 +1519 1.15467088800002 2.00740482492275 8.6349769 +1520 1.15543104000002 2.00085127946387 8.6077875 +1521 1.15619119200002 1.99431837108438 8.5806795 +1522 1.15695134400002 1.98780603807068 8.5536526 +1523 1.15771149600002 1.98131421887718 8.5267065 +1524 1.15847164800002 1.97484285212602 8.499841 +1525 1.15923180000002 1.96839187660658 8.4730559 +1526 1.15999195200002 1.96196123127524 8.4463511 +1527 1.16075210400002 1.95555085525491 8.4197262 +1528 1.16151225600002 1.94916068783471 8.3931811 +1529 1.16227240800002 1.94279066846959 8.3667155 +1530 1.16303256000002 1.93644073677996 8.3403292 +1531 1.16379271200002 1.93011083255133 8.3140221 +1532 1.16455286400002 1.92380089573396 8.2877938 +1533 1.16531301600002 1.91751086644243 8.2616442 +1534 1.16607316800002 1.91124068495535 8.2355731 +1535 1.16683332000002 1.90499029171494 8.2095802 +1536 1.16759347200002 1.8987596273267 8.1836653 +1537 1.16835362400002 1.89254863255901 8.1578283 +1538 1.16911377600002 1.88635724834281 8.1320688 +1539 1.16987392800002 1.88018541577118 8.1063868 +1540 1.17063408000002 1.87403307609903 8.0807819 +1541 1.17139423200002 1.8679001707427 8.055254 +1542 1.17215438400002 1.86178664127962 8.0298028 +1543 1.17291453600002 1.8556924294479 8.0044281 +1544 1.17367468800002 1.84961747714605 7.9791298 +1545 1.17443484000002 1.84356172643253 7.9539077 +1546 1.17519499200002 1.83752511952547 7.9287614 +1547 1.17595514400002 1.83150759880222 7.9036908 +1548 1.17671529600002 1.82550910679907 7.8786957 +1549 1.17747544800002 1.81952958621085 7.8537759 +1550 1.17823560000002 1.81356897989056 7.8289312 +1551 1.17899575200002 1.80762723084903 7.8041613 +1552 1.17975590400002 1.80170428225458 7.7794661 +1553 1.18051605600002 1.79580007743259 7.7548453 +1554 1.18127620800002 1.78991455986524 7.7302988 +1555 1.18203636000002 1.78404767319105 7.7058264 +1556 1.18279651200002 1.77819936120462 7.6814278 +1557 1.18355666400002 1.77236956785618 7.6571028 +1558 1.18431681600002 1.76655823725131 7.6328512 +1559 1.18507696800002 1.76076531365052 7.6086729 +1560 1.18583712000002 1.75499074146896 7.5845675 +1561 1.18659727200002 1.74923446527601 7.560535 +1562 1.18735742400002 1.74349642979493 7.5365752 +1563 1.18811757600002 1.73777657990255 7.5126877 +1564 1.18887772800002 1.73207486062885 7.4888725 +1565 1.18963788000002 1.72639121715666 7.4651292 +1566 1.19039803200002 1.72072559482128 7.4414578 +1567 1.19115818400002 1.71507793911014 7.417858 +1568 1.19191833600002 1.70944819566242 7.3943296 +1569 1.19267848800002 1.70383631026875 7.3708724 +1570 1.19343864000002 1.6982422288708 7.3474862 +1571 1.19419879200002 1.69266589756095 7.3241709 +1572 1.19495894400002 1.68710726258196 7.3009262 +1573 1.19571909600002 1.68156627032661 7.2777518 +1574 1.19647924800002 1.67604286733731 7.2546478 +1575 1.19723940000002 1.6705370003058 7.2316137 +1576 1.19799955200002 1.66504861607279 7.2086495 +1577 1.19875970400002 1.6595776616276 7.1857549 +1578 1.19951985600002 1.65412408410781 7.1629298 +1579 1.20028000800002 1.64868783079893 7.1401739 +1580 1.20104016000002 1.64326884913401 7.1174871 +1581 1.20180031200002 1.63786708669336 7.0948691 +1582 1.20256046400002 1.63248249120415 7.0723198 +1583 1.20332061600002 1.62711501054007 7.049839 +1584 1.20408076800002 1.62176459272102 7.0274265 +1585 1.20484092000002 1.61643118591272 7.0050821 +1586 1.20560107200002 1.61111473842639 6.9828055 +1587 1.20636122400002 1.60581519871839 6.9605967 +1588 1.20712137600002 1.60053251538991 6.9384554 +1589 1.20788152800002 1.59526663718658 6.9163815 +1590 1.20864168000002 1.59001751299816 6.8943746 +1591 1.20940183200002 1.58478509185819 6.8724348 +1592 1.21016198400002 1.57956932294364 6.8505617 +1593 1.21092213600002 1.57437015557458 6.8287551 +1594 1.21168228800002 1.56918753921382 6.807015 +1595 1.21244244000002 1.5640214234666 6.785341 +1596 1.21320259200002 1.55887175808022 6.7637331 +1597 1.21396274400002 1.55373849294371 6.742191 +1598 1.21472289600002 1.54862157808751 6.7207146 +1599 1.21548304800002 1.54352096368309 6.6993036 +1600 1.21624320000002 1.53843660004266 6.6779579 +1601 1.21700335200002 1.53336843761879 6.6566772 +1602 1.21776350400002 1.5283164270041 6.6354615 +1603 1.21852365600002 1.52328051893093 6.6143105 +1604 1.21928380800002 1.51826066427095 6.593224 +1605 1.22004396000002 1.5132568140349 6.5722019 +1606 1.22080411200002 1.50826891937219 6.551244 +1607 1.22156426400002 1.50329693157062 6.5303501 +1608 1.22232441600002 1.49834080205598 6.5095199 +1609 1.22308456800002 1.4934004823918 6.4887534 +1610 1.22384472000002 1.48847592427892 6.4680504 +1611 1.22460487200002 1.48356707955526 6.4474106 +1612 1.22536502400002 1.47867390019539 6.4268339 +1613 1.22612517600002 1.47379633831028 6.4063201 +1614 1.22688532800002 1.4689343461469 6.385869 +1615 1.22764548000002 1.46408787608794 6.3654805 +1616 1.22840563200002 1.45925688065146 6.3451544 +1617 1.22916578400002 1.45444131249055 6.3248905 +1618 1.22992593600002 1.44964112439303 6.3046885 +1619 1.23068608800002 1.44485626928108 6.2845485 +1620 1.23144624000002 1.44008670021095 6.2644701 +1621 1.23220639200002 1.43533237037261 6.2444532 +1622 1.23296654400002 1.43059323308943 6.2244976 +1623 1.23372669600002 1.42586924181785 6.2046031 +1624 1.23448684800002 1.42116035014706 6.1847696 +1625 1.23524700000002 1.41646651179866 6.1649969 +1626 1.23600715200002 1.41178768062636 6.1452849 +1627 1.23676730400002 1.40712381061563 6.1256333 +1628 1.23752745600002 1.40247485588337 6.1060419 +1629 1.23828760800002 1.39784077067763 6.0865107 +1630 1.23904776000002 1.39322150937723 6.0670393 +1631 1.23980791200002 1.38861702649149 6.0476278 +1632 1.24056806400002 1.38402727665986 6.0282758 +1633 1.24132821600002 1.37945221465164 6.0089833 +1634 1.24208836800002 1.37489179536562 5.98975 +1635 1.24284852000002 1.3703459738298 5.9705757 +1636 1.24360867200002 1.36581470520102 5.9514604 +1637 1.24436882400002 1.3612979447647 5.9324038 +1638 1.24512897600002 1.35679564793446 5.9134058 +1639 1.24588912800002 1.35230777025186 5.8944662 +1640 1.24664928000002 1.34783426738603 5.8755848 +1641 1.24740943200002 1.34337509513337 5.8567615 +1642 1.24816958400002 1.33893020941727 5.8379961 +1643 1.24892973600002 1.33449956628773 5.8192884 +1644 1.24968988800002 1.33008312192108 5.8006383 +1645 1.25045004000002 1.32568083261967 5.7820456 +1646 1.25121019200002 1.32129265481153 5.7635102 +1647 1.25197034400002 1.31691854505009 5.7450318 +1648 1.25273049600002 1.31255846001382 5.7266103 +1649 1.25349064800002 1.30821235650596 5.7082456 +1650 1.25425080000002 1.30388019145418 5.6899374 +1651 1.25501095200002 1.29956192191028 5.6716857 +1652 1.25577110400002 1.29525750504988 5.6534902 +1653 1.25653125600002 1.29096689817209 5.6353508 +1654 1.25729140800002 1.28669005869923 5.6172673 +1655 1.25805156000002 1.28242694417648 5.5992396 +1656 1.25881171200002 1.27817751227161 5.5812676 +1657 1.25957186400002 1.27394172077465 5.5633509 +1658 1.26033201600002 1.26971952759757 5.5454896 +1659 1.26109216800002 1.26551089077402 5.5276834 +1660 1.26185232000002 1.26131576845894 5.5099321 +1661 1.26261247200002 1.25713411892834 5.4922357 +1662 1.26337262400002 1.25296590057894 5.4745939 +1663 1.26413277600002 1.24881107192788 5.4570066 +1664 1.26489292800002 1.2446695916124 5.4394736 +1665 1.26565308000002 1.24054141838959 5.4219949 +1666 1.26641323200002 1.23642651113598 5.4045701 +1667 1.26717338400002 1.23232482884736 5.3871992 +1668 1.26793353600002 1.22823633063838 5.369882 +1669 1.26869368800002 1.22416097574229 5.3526184 +1670 1.26945384000002 1.22009872351063 5.3354081 +1671 1.27021399200002 1.21604953341294 5.3182511 +1672 1.27097414400002 1.21201336503645 5.3011472 +1673 1.27173429600002 1.20799017808575 5.2840962 +1674 1.27249444800002 1.20397993238254 5.267098 +1675 1.27325460000002 1.19998258786531 5.2501525 +1676 1.27401475200002 1.19599810458902 5.2332594 +1677 1.27477490400002 1.19202644272484 5.2164186 +1678 1.27553505600002 1.18806756255981 5.19963 +1679 1.27629520800002 1.18412142449659 5.1828934 +1680 1.27705536000002 1.18018798905311 5.1662086 +1681 1.27781551200002 1.17626721686232 5.1495756 +1682 1.27857566400002 1.17235906867188 5.1329941 +1683 1.27933581600002 1.16846350534383 5.1164641 +1684 1.28009596800002 1.16458048785435 5.0999853 +1685 1.28085612000002 1.16070997729344 5.0835576 +1686 1.28161627200002 1.15685193486461 5.0671809 +1687 1.28237642400002 1.15300632188463 5.050855 +1688 1.28313657600002 1.14917309978319 5.0345798 +1689 1.28389672800002 1.14535223010263 5.0183551 +1690 1.28465688000002 1.14154367449767 5.0021807 +1691 1.28541703200002 1.13774739473506 4.9860566 +1692 1.28617718400002 1.13396335269335 4.9699826 +1693 1.28693733600002 1.13019151036259 4.9539585 +1694 1.28769748800002 1.12643182984399 4.9379841 +1695 1.28845764000002 1.1226842733497 4.9220594 +1696 1.28921779200002 1.11894880320248 4.9061842 +1697 1.28997794400002 1.11522538183542 4.8903584 +1698 1.29073809600002 1.11151397179165 4.8745817 +1699 1.29149824800002 1.10781453572407 4.8588541 +1700 1.29225840000002 1.10412703639504 4.8431755 +1701 1.29301855200002 1.10045143667613 4.8275456 +1702 1.29377870400002 1.09678769954779 4.8119643 +1703 1.29453885600002 1.09313578809909 4.7964315 +1704 1.29529900800002 1.08949566552744 4.7809471 +1705 1.29605916000002 1.0858672951383 4.7655108 +1706 1.29681931200002 1.0822506403449 4.7501227 +1707 1.29757946400002 1.07864566466794 4.7347824 +1708 1.29833961600002 1.07505233173536 4.7194899 +1709 1.29909976800002 1.07147060528198 4.7042451 +1710 1.29985992000002 1.06790044914928 4.6890477 +1711 1.30062007200002 1.06434182728511 4.6738977 +1712 1.30138022400002 1.0607947037434 4.658795 +1713 1.30214037600002 1.05725904268387 4.6437393 +1714 1.30290052800002 1.05373480837177 4.6287305 +1715 1.30366068000002 1.05022196517762 4.6137686 +1716 1.30442083200002 1.04672047757688 4.5988533 +1717 1.30518098400002 1.04323031014971 4.5839845 +1718 1.30594113600002 1.0397514275807 4.5691621 +1719 1.30670128800002 1.03628379465857 4.554386 +1720 1.30746144000002 1.03282737627592 4.539656 +1721 1.30822159200002 1.02938213742891 4.524972 +1722 1.30898174400002 1.02594804321706 4.5103338 +1723 1.30974189600002 1.02252505884291 4.4957414 +1724 1.31050204800002 1.01911314961177 4.4811945 +1725 1.31126220000002 1.01571228093145 4.466693 +1726 1.31202235200002 1.012322418312 4.4522369 +1727 1.31278250400002 1.00894352736541 4.4378259 +1728 1.31354265600002 1.00557557380537 4.42346 +1729 1.31430280800002 1.00221852344697 4.409139 +1730 1.31506296000002 0.998872342206448 4.3948627 +1731 1.31582311200002 0.995536996100931 4.3806311 +1732 1.31658326400002 0.99221245124814 4.366444 +1733 1.31734341600002 0.988898673866141 4.3523012 +1734 1.31810356800002 0.985595630273072 4.3382027 +1735 1.31886372000002 0.982303286886876 4.3241484 +1736 1.31962387200002 0.979021610225034 4.310138 +1737 1.32038402400002 0.975750566904298 4.2961714 +1738 1.32114417600002 0.972490123640435 4.2822486 +1739 1.32190432800002 0.969240247247948 4.2683694 +1740 1.32266448000002 0.966000904639821 4.2545336 +1741 1.32342463200002 0.962772062827253 4.2407411 +1742 1.32418478400002 0.959553688919395 4.2269919 +1743 1.32494493600002 0.95634575012309 4.2132857 +1744 1.32570508800002 0.953148213742606 4.1996225 +1745 1.32646524000002 0.949961047179377 4.1860021 +1746 1.32722539200002 0.946784217931744 4.1724245 +1747 1.32798554400002 0.943617693594692 4.1588893 +1748 1.32874569600002 0.94046144185959 4.1453966 +1749 1.32950584800002 0.937315430513933 4.1319463 +1750 1.33026600000002 0.934179627441085 4.1185381 +1751 1.33102615200002 0.931054000620018 4.1051719 +1752 1.33178630400002 0.927938518125052 4.0918477 +1753 1.33254645600002 0.924833148125606 4.0785654 +1754 1.33330660800002 0.921737858885934 4.0653247 +1755 1.33406676000002 0.918652618764871 4.0521255 +1756 1.33482691200002 0.915577396215579 4.0389679 +1757 1.33558706400002 0.91251215978529 4.0258515 +1758 1.33634721600002 0.909456878115053 4.0127763 +1759 1.33710736800002 0.906411519939484 3.9997422 +1760 1.33786752000002 0.903376054086501 3.986749 +1761 1.33862767200002 0.900350449477083 3.9737967 +1762 1.33938782400002 0.897334675125014 3.960885 +1763 1.34014797600002 0.894328700136631 3.948014 +1764 1.34090812800002 0.89133249371057 3.9351834 +1765 1.34166828000002 0.888346025137519 3.9223931 +1766 1.34242843200002 0.885369263799969 3.909643 +1767 1.34318858400002 0.882402179171963 3.8969331 +1768 1.34394873600002 0.879444740818841 3.8842631 +1769 1.34470888800002 0.876496918397002 3.871633 +1770 1.34546904000002 0.87355868165365 3.8590426 +1771 1.34622919200002 0.870630000426549 3.8464919 +1772 1.34698934400002 0.867710844643771 3.8339806 +1773 1.34774949600002 0.864801184323458 3.8215088 +1774 1.34850964800002 0.861900989573569 3.8090762 +1775 1.34926980000002 0.859010230591639 3.7966827 +1776 1.35002995200002 0.856128877664531 3.7843283 +1777 1.35079010400002 0.853256901168198 3.7720128 +1778 1.35155025600002 0.85039427156743 3.759736 +1779 1.35231040800002 0.84754095941562 3.747498 +1780 1.35307056000002 0.844696935354514 3.7352985 +1781 1.35383071200002 0.841862170113976 3.7231375 +1782 1.35459086400002 0.83903663451174 3.7110148 +1783 1.35535101600002 0.836220299453175 3.6989303 +1784 1.35611116800002 0.833413135931039 3.686884 +1785 1.35687132000002 0.830615115025241 3.6748756 +1786 1.35763147200002 0.827826207902607 3.6629051 +1787 1.35839162400002 0.825046385816635 3.6509723 +1788 1.35915177600002 0.822275620107252 3.6390772 +1789 1.35991192800002 0.81951388220059 3.6272196 +1790 1.36067208000002 0.816761143608739 3.6153995 +1791 1.36143223200002 0.814017375929511 3.6036166 +1792 1.36219238400002 0.811282550846208 3.591871 +1793 1.36295253600002 0.808556640127381 3.5801624 +1794 1.36371268800002 0.8058396156266 3.5684908 +1795 1.36447284000002 0.803131449282215 3.5568561 +1796 1.36523299200002 0.800432113117127 3.5452581 +1797 1.36599314400002 0.797741579238548 3.5336967 +1798 1.36675329600002 0.795059819837772 3.5221719 +1799 1.36751344800002 0.792386807189943 3.5106835 +1800 1.36827360000002 0.789722513653825 3.4992314 +1801 1.36903375200002 0.78706691167156 3.4878155 +1802 1.36979390400002 0.784419973768451 3.4764357 +1803 1.37055405600002 0.781781672552724 3.4650919 +1804 1.37131420800002 0.779151980715299 3.4537839 +1805 1.37207436000002 0.776530871029558 3.4425117 +1806 1.37283451200002 0.773918316351126 3.4312752 +1807 1.37359466400002 0.771314289617628 3.4200742 +1808 1.37435481600002 0.768718763848477 3.4089087 +1809 1.37511496800002 0.766131712144634 3.3977784 +1810 1.37587512000002 0.763553107688385 3.3866835 +1811 1.37663527200002 0.760982923743123 3.3756236 +1812 1.37739542400002 0.758421133653109 3.3645987 +1813 1.37815557600002 0.755867710843253 3.3536088 +1814 1.37891572800002 0.753322628818894 3.3426536 +1815 1.37967588000002 0.750785861165568 3.3317332 +1816 1.38043603200002 0.748257381548789 3.3208473 +1817 1.38119618400002 0.745737163713825 3.3099959 +1818 1.38195633600002 0.743225181485474 3.2991789 +1819 1.38271648800002 0.740721408767842 3.2883962 +1820 1.38347664000002 0.738225819544126 3.2776477 +1821 1.38423679200002 0.735738387876387 3.2669332 +1822 1.38499694400002 0.733259087905331 3.2562527 +1823 1.38575709600002 0.730787893850092 3.2456061 +1824 1.38651724800002 0.728324780008012 3.2349932 +1825 1.38727740000002 0.725869720754413 3.224414 +1826 1.38803755200002 0.723422690542393 3.2138683 +1827 1.38879770400002 0.720983663902599 3.2033561 +1828 1.38955785600002 0.718552615443012 3.1928772 +1829 1.39031800800002 0.716129519848727 3.1824316 +1830 1.39107816000002 0.713714351881743 3.1720192 +1831 1.39183831200002 0.711307086380739 3.1616398 +1832 1.39259846400002 0.708907698260866 3.1512933 +1833 1.39335861600002 0.706516162513527 3.1409797 +1834 1.39411876800002 0.704132454206166 3.1306989 +1835 1.39487892000002 0.701756548482051 3.1204507 +1836 1.39563907200002 0.699388420560064 3.110235 +1837 1.39639922400002 0.697028045734483 3.1000518 +1838 1.39715937600002 0.694675399374775 3.089901 +1839 1.39791952800002 0.692330456925384 3.0797824 +1840 1.39867968000002 0.689993193905514 3.0696959 +1841 1.39943983200002 0.687663585908924 3.0596416 +1842 1.40019998400002 0.685341608603713 3.0496191 +1843 1.40096013600002 0.683027237732116 3.0396286 +1844 1.40172028800002 0.680720449110289 3.0296698 +1845 1.40248044000002 0.678421218628099 3.0197427 +1846 1.40324059200002 0.676129522248926 3.0098471 +1847 1.40400074400002 0.673845336009442 2.999983 +1848 1.40476089600002 0.671568636019414 2.9901504 +1849 1.40552104800002 0.669299398461487 2.9803489 +1850 1.40628120000002 0.667037599590989 2.9705787 +1851 1.40704135200002 0.664783215735717 2.9608396 +1852 1.40780150400002 0.662536223295733 2.9511315 +1853 1.40856165600002 0.660296598743162 2.9414543 +1854 1.40932180800002 0.658064318621985 2.9318078 +1855 1.41008196000002 0.655839359547836 2.9221921 +1856 1.41084211200002 0.653621698207798 2.9126071 +1857 1.41160226400002 0.651411311360199 2.9030525 +1858 1.41236241600002 0.649208175834413 2.8935284 +1859 1.41312256800002 0.647012268530657 2.8840347 +1860 1.41388272000002 0.644823566419786 2.8745711 +1861 1.41464287200002 0.642642046543097 2.8651378 +1862 1.41540302400002 0.640467686012122 2.8557345 +1863 1.41616317600002 0.638300462008438 2.8463611 +1864 1.41692332800002 0.636140351783457 2.8370177 +1865 1.41768348000002 0.633987332658233 2.827704 +1866 1.41844363200002 0.631841382023263 2.8184201 +1867 1.41920378400002 0.629702477338287 2.8091657 +1868 1.41996393600002 0.627570596132092 2.7999409 +1869 1.42072408800002 0.625445716002313 2.7907455 +1870 1.42148424000002 0.62332781461524 2.7815794 +1871 1.42224439200002 0.621216869705616 2.7724426 +1872 1.42300454400002 0.619112859076451 2.7633349 +1873 1.42376469600002 0.617015760598814 2.7542563 +1874 1.42452484800002 0.61492555221165 2.7452067 +1875 1.42528500000002 0.612842211921579 2.7361859 +1876 1.42604515200002 0.610765717802704 2.727194 +1877 1.42680530400002 0.608696047996418 2.7182308 +1878 1.42756545600002 0.606633180711211 2.7092961 +1879 1.42832560800002 0.604577094222481 2.7003901 +1880 1.42908576000002 0.602527766872334 2.6915125 +1881 1.42984591200002 0.600485177069403 2.6826632 +1882 1.43060606400002 0.598449303288646 2.6738422 +1883 1.43136621600002 0.596420124071167 2.6650494 +1884 1.43212636800002 0.594397618024017 2.6562847 +1885 1.43288652000002 0.592381763820011 2.647548 +1886 1.43364667200002 0.590372540197533 2.6388392 +1887 1.43440682400002 0.588369925960353 2.6301583 +1888 1.43516697600002 0.586373899977434 2.6215052 +1889 1.43592712800002 0.58438444118275 2.6128797 +1890 1.43668728000002 0.582401528575095 2.6042818 +1891 1.43744743200002 0.580425141217896 2.5957113 +1892 1.43820758400002 0.57845525823903 2.5871683 +1893 1.43896773600002 0.576491858830634 2.5786527 +1894 1.43972788800002 0.574534922248923 2.5701643 +1895 1.44048804000002 0.572584427814007 2.561703 +1896 1.44124819200002 0.5706403549097 2.5532688 +1897 1.44200834400002 0.568702682983344 2.5448617 +1898 1.44276849600002 0.566771391545619 2.5364814 +1899 1.44352864800002 0.564846460170362 2.528128 +1900 1.44428880000002 0.56292786849439 2.5198013 +1901 1.44504895200002 0.561015596217312 2.5115012 +1902 1.44580910400002 0.559109623101344 2.5032278 +1903 1.44656925600002 0.557209928971138 2.4949809 +1904 1.44732940800002 0.555316493713594 2.4867603 +1905 1.44808956000002 0.553429297277685 2.4785662 +1906 1.44884971200002 0.55154831967427 2.4703982 +1907 1.44960986400002 0.549673540975921 2.4622565 +1908 1.45037001600002 0.547804941316743 2.4541408 +1909 1.45113016800002 0.545942500892193 2.4460512 +1910 1.45189032000002 0.544086199958906 2.4379874 +1911 1.45265047200002 0.542236018834513 2.4299496 +1912 1.45341062400002 0.54039193789747 2.4219375 +1913 1.45417077600002 0.538553937586875 2.4139511 +1914 1.45493092800002 0.536721998402295 2.4059903 +1915 1.45569108000002 0.534896100903592 2.3980551 +1916 1.45645123200002 0.533076225710745 2.3901453 +1917 1.45721138400002 0.531262353503676 2.3822608 +1918 1.45797153600002 0.529454465022077 2.3744017 +1919 1.45873168800002 0.527652541065234 2.3665678 +1920 1.45949184000002 0.525856562491854 2.3587591 +1921 1.46025199200002 0.524066510219895 2.3509754 +1922 1.46101214400002 0.522282365226389 2.3432167 +1923 1.46177229600002 0.520504108547273 2.3354829 +1924 1.46253244800002 0.518731721277218 2.3277739 +1925 1.46329260000002 0.516965184569453 2.3200897 +1926 1.46405275200002 0.515204479635599 2.3124302 +1927 1.46481290400002 0.513449587745499 2.3047952 +1928 1.46557305600002 0.511700490227043 2.2971848 +1929 1.46633320800002 0.509957168466004 2.2895989 +1930 1.46709336000002 0.508219603905865 2.2820373 +1931 1.46785351200002 0.506487778047655 2.2745 +1932 1.46861366400002 0.504761672449776 2.2669869 +1933 1.46937381600002 0.503041268727839 2.259498 +1934 1.47013396800002 0.501326548554492 2.2520332 +1935 1.47089412000002 0.499617493659259 2.2445923 +1936 1.47165427200002 0.497914085828371 2.2371754 +1937 1.47241442400002 0.4962163069046 2.2297824 +1938 1.47317457600002 0.49452413878709 2.2224131 +1939 1.47393472800002 0.4928375634312 2.2150675 +1940 1.47469488000002 0.491156562848332 2.2077455 +1941 1.47545503200002 0.489481119105769 2.2004471 +1942 1.47621518400002 0.487811214326513 2.1931722 +1943 1.47697533600002 0.486146830689119 2.1859206 +1944 1.47773548800002 0.484487950427534 2.1786925 +1945 1.47849564000002 0.482834555830933 2.1714875 +1946 1.47925579200002 0.481186629243557 2.1643058 +1947 1.48001594400002 0.479544153064553 2.1571472 +1948 1.48077609600002 0.477907109747811 2.1500116 +1949 1.48153624800002 0.476275481801804 2.142899 +1950 1.48229640000002 0.474649251789425 2.1358093 +1951 1.48305655200002 0.473028402327832 2.1287425 +1952 1.48381670400002 0.471412916088284 2.1216984 +1953 1.48457685600002 0.469802775795985 2.114677 +1954 1.48533700800002 0.468197964229922 2.1076782 +1955 1.48609716000002 0.466598464222709 2.1007019 +1956 1.48685731200002 0.465004258660427 2.0937482 +1957 1.48761746400002 0.463415330482473 2.0868168 +1958 1.48837761600002 0.46183166268139 2.0799078 +1959 1.48913776800002 0.460253238302723 2.0730211 +1960 1.48989792000002 0.458680040444859 2.0661565 +1961 1.49065807200002 0.457112052258867 2.0593141 +1962 1.49141822400002 0.455549256948346 2.0524938 +1963 1.49217837600002 0.45399163776927 2.0456954 +1964 1.49293852800002 0.452439178029835 2.038919 +1965 1.49369868000002 0.450891861090299 2.0321644 +1966 1.49445883200002 0.449349670362835 2.0254316 +1967 1.49521898400002 0.447812589311371 2.0187205 +1968 1.49597913600002 0.446280601451445 2.0120311 +1969 1.49673928800002 0.444753690350045 2.0053633 +1970 1.49749944000002 0.44323183962546 1.998717 +1971 1.49825959200003 0.441715032947129 1.9920921 +1972 1.49901974400003 0.440203254035487 1.9854886 +1973 1.49977989600003 0.438696486661817 1.9789064 +1974 1.50054004800003 0.437194714648099 1.9723455 +1975 1.50130020000003 0.435697921866856 1.9658058 +1976 1.50206035200003 0.434206092241009 1.9592872 +1977 1.50282050400003 0.432719209743726 1.9527896 +1978 1.50358065600003 0.431237258398273 1.946313 +1979 1.50434080800003 0.429760222277862 1.9398574 +1980 1.50510096000003 0.428288085505512 1.9334225 +1981 1.50586111200003 0.42682083225389 1.9270085 +1982 1.50662126400003 0.425358446745171 1.9206152 +1983 1.50738141600003 0.42390091325089 1.9142426 +1984 1.50814156800003 0.422448216091791 1.9078905 +1985 1.50890172000003 0.421000339637688 1.901559 +1986 1.50966187200003 0.419557268307313 1.895248 +1987 1.51042202400003 0.418118986568174 1.8889573 +1988 1.51118217600003 0.416685478936408 1.882687 +1989 1.51194232800003 0.415256729976638 1.876437 +1990 1.51270248000003 0.413832724301827 1.8702071 +1991 1.51346263200003 0.412413446573137 1.8639975 +1992 1.51422278400003 0.410998881499781 1.8578079 +1993 1.51498293600003 0.409589013838885 1.8516383 +1994 1.51574308800003 0.408183828395342 1.8454887 +1995 1.51650324000003 0.406783310021671 1.839359 +1996 1.51726339200003 0.405387443617872 1.8332491 +1997 1.51802354400003 0.403996214131293 1.827159 +1998 1.51878369600003 0.402609606556476 1.8210885 +1999 1.51954384800003 0.401227605935028 1.8150378 +2000 1.52030400000003 0.399850197355474 1.8090066 +2001 1.52106415200003 0.398477365953119 1.802995 +2002 1.52182430400003 0.397109096909908 1.7970028 +2003 1.52258445600003 0.395745375454286 1.79103 +2004 1.52334460800003 0.394386186861062 1.7850765 +2005 1.52410476000003 0.393031516451267 1.7791424 +2006 1.52486491200003 0.391681349592017 1.7732274 +2007 1.52562506400003 0.390335671696376 1.7673316 +2008 1.52638521600003 0.388994468223219 1.761455 +2009 1.52714536800003 0.387657724677092 1.7555973 +2010 1.52790552000003 0.386325426608081 1.7497586 +2011 1.52866567200003 0.384997559611669 1.7439389 +2012 1.52942582400003 0.383674109328604 1.738138 +2013 1.53018597600003 0.382355061444764 1.7323559 +2014 1.53094612800003 0.381040401691019 1.7265926 +2015 1.53170628000003 0.3797301158431 1.7208479 +2016 1.53246643200003 0.378424189721462 1.7151219 +2017 1.53322658400003 0.377122609191147 1.7094144 +2018 1.53398673600003 0.37582536016166 1.7037254 +2019 1.53474688800003 0.374532428586823 1.6980549 +2020 1.53550704000003 0.373243800464653 1.6924028 +2021 1.53626719200003 0.371959461837223 1.686769 +2022 1.53702734400003 0.370679398790532 1.6811535 +2023 1.53778749600003 0.369403597454372 1.6755562 +2024 1.53854764800003 0.368132044002199 1.6699771 +2025 1.53930780000003 0.366864724650998 1.664416 +2026 1.54006795200003 0.365601625661157 1.658873 +2027 1.54082810400003 0.364342733336332 1.653348 +2028 1.54158825600003 0.363088034023319 1.647841 +2029 1.54234840800003 0.361837514111924 1.6423518 +2030 1.54310856000003 0.360591160034836 1.6368804 +2031 1.54386871200003 0.359348958267493 1.6314268 +2032 1.54462886400003 0.358110895327957 1.6259909 +2033 1.54538901600003 0.356876957776787 1.6205727 +2034 1.54614916800003 0.355647132216906 1.615172 +2035 1.54690932000003 0.354421405293478 1.6097889 +2036 1.54766947200003 0.35319976369378 1.6044233 +2037 1.54842962400003 0.351982194147071 1.5990751 +2038 1.54918977600003 0.350768683424474 1.5937443 +2039 1.54994992800003 0.349559218338839 1.5884308 +2040 1.55071008000003 0.348353785744626 1.5831346 +2041 1.55147023200003 0.347152372537777 1.5778555 +2042 1.55223038400003 0.345954965655589 1.5725937 +2043 1.55299053600003 0.344761552076589 1.5673489 +2044 1.55375068800003 0.343572118820413 1.5621212 +2045 1.55451084000003 0.34238665294768 1.5569105 +2046 1.55527099200003 0.341205141559867 1.5517167 +2047 1.55603114400003 0.340027571799187 1.5465398 +2048 1.55679129600003 0.338853930848467 1.5413798 +2049 1.55755144800003 0.337684205931021 1.5362365 +2050 1.55831160000003 0.336518384310534 1.53111 +2051 1.55907175200003 0.335356453290934 1.5260001 +2052 1.55983190400003 0.334198400216275 1.5209069 +2053 1.56059205600003 0.333044212470612 1.5158302 +2054 1.56135220800003 0.331893877477881 1.5107701 +2055 1.56211236000003 0.33074738270178 1.5057264 +2056 1.56287251200003 0.329604715645648 1.5006991 +2057 1.56363266400003 0.328465863852343 1.4956882 +2058 1.56439281600003 0.327330814904125 1.4906936 +2059 1.56515296800003 0.326199556422534 1.4857152 +2060 1.56591312000003 0.325072076068274 1.4807531 +2061 1.56667327200003 0.323948361541091 1.4758071 +2062 1.56743342400003 0.322828400579659 1.4708773 +2063 1.56819357600003 0.321712180961456 1.4659634 +2064 1.56895372800003 0.320599690502653 1.4610656 +2065 1.56971388000003 0.319490917057991 1.4561838 +2066 1.57047403200003 0.318385848520667 1.4513178 +2067 1.57123418400003 0.317284472822219 1.4464677 +2068 1.57199433600003 0.316186777932402 1.4416334 +2069 1.57275448800003 0.315092751859083 1.4368148 +2070 1.57351464000003 0.314002382648115 1.4320119 +2071 1.57427479200003 0.312915658383231 1.4272247 +2072 1.57503494400003 0.311832567185918 1.4224531 +2073 1.57579509600003 0.310753097215313 1.4176971 +2074 1.57655524800003 0.309677236668082 1.4129565 +2075 1.57731540000003 0.308604973778309 1.4082314 +2076 1.57807555200003 0.30753629681738 1.4035217 +2077 1.57883570400003 0.306471194093869 1.3988274 +2078 1.57959585600003 0.305409653953431 1.3941484 +2079 1.58035600800003 0.304351664778681 1.3894846 +2080 1.58111616000003 0.303297214989086 1.384836 +2081 1.58187631200003 0.302246293040851 1.3802026 +2082 1.58263646400003 0.30119888742681 1.3755843 +2083 1.58339661600003 0.300154986676311 1.3709811 +2084 1.58415676800003 0.299114579355108 1.3663929 +2085 1.58491692000003 0.298077654065246 1.3618197 +2086 1.58567707200003 0.297044199444954 1.3572614 +2087 1.58643722400003 0.296014204168535 1.3527179 +2088 1.58719737600003 0.294987656946251 1.3481893 +2089 1.58795752800003 0.29396454652422 1.3436755 +2090 1.58871768000003 0.292944861684302 1.3391764 +2091 1.58947783200003 0.291928591243992 1.334692 +2092 1.59023798400003 0.290915724056309 1.3302223 +2093 1.59099813600003 0.289906249009693 1.3257671 +2094 1.59175828800003 0.288900155027888 1.3213265 +2095 1.59251844000003 0.287897431069845 1.3169004 +2096 1.59327859200003 0.286898066129602 1.3124887 +2097 1.59403874400003 0.285902049236191 1.3080915 +2098 1.59479889600003 0.284909369453518 1.3037086 +2099 1.59555904800003 0.283920015880264 1.29934 +2100 1.59631920000003 0.282933977649778 1.2949857 +2101 1.59707935200003 0.281951243929969 1.2906456 +2102 1.59783950400003 0.2809718039232 1.2863198 +2103 1.59859965600003 0.279995646866184 1.282008 +2104 1.59935980800003 0.279022762029881 1.2777103 +2105 1.60011996000003 0.278053138719387 1.2734267 +2106 1.60088011200003 0.277086766273837 1.2691571 +2107 1.60164026400003 0.276123634066295 1.2649015 +2108 1.60240041600003 0.275163731503652 1.2606597 +2109 1.60316056800003 0.274207048026526 1.2564319 +2110 1.60392072000003 0.27325357310915 1.2522178 +2111 1.60468087200003 0.272303296259279 1.2480176 +2112 1.60544102400003 0.27135620701808 1.243831 +2113 1.60620117600003 0.270412294960034 1.2396582 +2114 1.60696132800003 0.269471549692831 1.235499 +2115 1.60772148000003 0.268533960857269 1.2313534 +2116 1.60848163200003 0.267599518127154 1.2272214 +2117 1.60924178400003 0.266668211209196 1.2231029 +2118 1.61000193600003 0.265740029842912 1.2189979 +2119 1.61076208800003 0.264814963800519 1.2149063 +2120 1.61152224000003 0.263893002886841 1.2108281 +2121 1.61228239200003 0.262974136939204 1.2067633 +2122 1.61304254400003 0.262058355827337 1.2027118 +2123 1.61380269600003 0.261145649453274 1.1986735 +2124 1.61456284800003 0.260236007751254 1.1946484 +2125 1.61532300000003 0.25932942068762 1.1906365 +2126 1.61608315200003 0.258425878260725 1.1866378 +2127 1.61684330400003 0.257525370500829 1.1826521 +2128 1.61760345600003 0.256627887470003 1.1786796 +2129 1.61836360800003 0.255733419262031 1.17472 +2130 1.61912376000003 0.254841956002313 1.1707734 +2131 1.61988391200003 0.253953487847765 1.1668397 +2132 1.62064406400003 0.253068004986728 1.1629189 +2133 1.62140421600003 0.252185497638864 1.1590109 +2134 1.62216436800003 0.251305956055064 1.1551158 +2135 1.62292452000003 0.250429370517352 1.1512334 +2136 1.62368467200003 0.249555731338787 1.1473637 +2137 1.62444482400003 0.248685028863369 1.1435067 +2138 1.62520497600003 0.247817253465942 1.1396624 +2139 1.62596512800003 0.246952395552102 1.1358307 +2140 1.62672528000003 0.246090445558099 1.1320115 +2141 1.62748543200003 0.245231393950745 1.1282048 +2142 1.62824558400003 0.244375231227317 1.1244107 +2143 1.62900573600003 0.243521947915467 1.1206289 +2144 1.62976588800003 0.242671534573125 1.1168596 +2145 1.63052604000003 0.241823981788406 1.1131026 +2146 1.63128619200003 0.240979280179518 1.109358 +2147 1.63204634400003 0.240137420394669 1.1056256 +2148 1.63280649600003 0.239298393111975 1.1019055 +2149 1.63356664800003 0.238462189039366 1.0981976 +2150 1.63432680000003 0.237628798914494 1.0945018 +2151 1.63508695200003 0.236798213504643 1.0908182 +2152 1.63584710400003 0.235970423606636 1.0871467 +2153 1.63660725600003 0.235145420046746 1.0834872 +2154 1.63736740800003 0.2343231936806 1.0798397 +2155 1.63812756000003 0.233503735393095 1.0762042 +2156 1.63888771200003 0.232687036098302 1.0725807 +2157 1.63964786400003 0.231873086739377 1.068969 +2158 1.64040801600003 0.231061878288476 1.0653692 +2159 1.64116816800003 0.230253401746656 1.0617812 +2160 1.64192832000003 0.229447648143796 1.0582049 +2161 1.64268847200003 0.228644608538499 1.0546405 +2162 1.64344862400003 0.227844274018008 1.0510877 +2163 1.64420877600003 0.227046635698118 1.0475466 +2164 1.64496892800003 0.226251684723083 1.0440171 +2165 1.64572908000003 0.225459412265533 1.0404993 +2166 1.64648923200003 0.224669809526383 1.036993 +2167 1.64724938400003 0.223882867734746 1.0334982 +2168 1.64800953600003 0.223098578147847 1.0300148 +2169 1.64876968800003 0.222316932050934 1.026543 +2170 1.64952984000003 0.221537920757193 1.0230825 +2171 1.65028999200003 0.220761535607658 1.0196334 +2172 1.65105014400003 0.219987767971132 1.0161957 +2173 1.65181029600003 0.219216609244091 1.0127692 +2174 1.65257044800003 0.218448050850605 1.0093541 +2175 1.65333060000003 0.217682084242253 1.0059501 +2176 1.65409075200003 0.216918700898033 1.0025573 +2177 1.65485090400003 0.216157892324279 0.99917572 +2178 1.65561105600003 0.215399650054577 0.99580523 +2179 1.65637120800003 0.214643965649682 0.99244582 +2180 1.65713136000003 0.213890830697428 0.98909747 +2181 1.65789151200003 0.213140236812651 0.98576012 +2182 1.65865166400003 0.212392175637098 0.98243376 +2183 1.65941181600003 0.211646638839351 0.97911834 +2184 1.66017196800003 0.210903618114737 0.97581382 +2185 1.66093212000003 0.210163105185249 0.97252018 +2186 1.66169227200003 0.209425091799461 0.96923737 +2187 1.66245242400003 0.208689569732447 0.96596537 +2188 1.66321257600003 0.207956530785698 0.96270413 +2189 1.66397272800003 0.207225966787038 0.95945363 +2190 1.66473288000003 0.206497869590546 0.95621383 +2191 1.66549303200003 0.205772231076471 0.95298469 +2192 1.66625318400003 0.205049043151153 0.94976618 +2193 1.66701333600003 0.204328297746938 0.94655827 +2194 1.66777348800003 0.203609986822103 0.94336092 +2195 1.66853364000003 0.20289410236077 0.9401741 +2196 1.66929379200003 0.202180636372828 0.93699778 +2197 1.67005394400003 0.201469580893853 0.93383191 +2198 1.67081409600003 0.200760927985027 0.93067647 +2199 1.67157424800003 0.200054669733059 0.92753142 +2200 1.67233440000003 0.199350798250104 0.92439674 +2201 1.67309455200003 0.198649305673687 0.92127238 +2202 1.67385470400003 0.19795018416662 0.91815831 +2203 1.67461485600003 0.197253425916926 0.91505451 +2204 1.67537500800003 0.19655902313776 0.91196093 +2205 1.67613516000003 0.195866968067328 0.90887755 +2206 1.67689531200003 0.195177252968815 0.90580432 +2207 1.67765546400003 0.194489870130299 0.90274123 +2208 1.67841561600003 0.193804811864681 0.89968823 +2209 1.67917576800003 0.193122070509602 0.8966453 +2210 1.67993592000003 0.192441638427369 0.8936124 +2211 1.68069607200003 0.191763508004876 0.8905895 +2212 1.68145622400003 0.19108767165353 0.88757656 +2213 1.68221637600003 0.190414121809172 0.88457356 +2214 1.68297652800003 0.189742850932001 0.88158046 +2215 1.68373668000003 0.189073851506499 0.87859723 +2216 1.68449683200003 0.188407116041356 0.87562385 +2217 1.68525698400003 0.187742637069389 0.87266027 +2218 1.68601713600003 0.187080407147476 0.86970646 +2219 1.68677728800003 0.186420418856472 0.8667624 +2220 1.68753744000003 0.185762664801139 0.86382805 +2221 1.68829759200003 0.18510713761007 0.86090339 +2222 1.68905774400003 0.184453829935614 0.85798837 +2223 1.68981789600003 0.183802734453802 0.85508298 +2224 1.69057804800003 0.183153843864273 0.85218717 +2225 1.69133820000003 0.182507150890203 0.84930092 +2226 1.69209835200003 0.181862648278224 0.8464242 +2227 1.69285850400003 0.18122032879836 0.84355697 +2228 1.69361865600003 0.180580185243946 0.84069921 +2229 1.69437880800003 0.17994221043156 0.83785088 +2230 1.69513896000003 0.179306397200948 0.83501196 +2231 1.69589911200003 0.178672738414952 0.83218241 +2232 1.69665926400003 0.178041226959438 0.8293622 +2233 1.69741941600003 0.177411855743224 0.82655131 +2234 1.69817956800003 0.176784617698006 0.8237497 +2235 1.69893972000003 0.17615950577829 0.82095735 +2236 1.69969987200003 0.175536512961318 0.81817421 +2237 1.70046002400003 0.174915632246997 0.81540028 +2238 1.70122017600003 0.174296856657831 0.8126355 +2239 1.70198032800003 0.173680179238844 0.80987987 +2240 1.70274048000003 0.173065593057515 0.80713333 +2241 1.70350063200003 0.172453091203706 0.80439588 +2242 1.70426078400003 0.171842666789591 0.80166747 +2243 1.70502093600003 0.171234312949587 0.79894807 +2244 1.70578108800003 0.170628022840282 0.79623767 +2245 1.70654124000003 0.170023789640371 0.79353622 +2246 1.70730139200003 0.169421606550578 0.7908437 +2247 1.70806154400003 0.168821466793597 0.78816009 +2248 1.70882169600003 0.168223363614015 0.78548535 +2249 1.70958184800003 0.167627290278246 0.78281945 +2250 1.71034200000003 0.167033240074464 0.78016237 +2251 1.71110215200003 0.166441206312532 0.77751407 +2252 1.71186230400003 0.165851182323937 0.77487453 +2253 1.71262245600003 0.165263161461719 0.77224372 +2254 1.71338260800003 0.164677137100406 0.76962162 +2255 1.71414276000003 0.164093102635943 0.76700819 +2256 1.71490291200003 0.16351105148563 0.7644034 +2257 1.71566306400003 0.16293097708805 0.76180723 +2258 1.71642321600003 0.162352872903004 0.75921965 +2259 1.71718336800003 0.161776732411444 0.75664064 +2260 1.71794352000003 0.161202549115408 0.75407016 +2261 1.71870367200003 0.160630316537953 0.75150818 +2262 1.71946382400003 0.160060028223086 0.74895468 +2263 1.72022397600003 0.159491677735702 0.74640964 +2264 1.72098412800003 0.158925258661518 0.74387302 +2265 1.72174428000003 0.158360764607005 0.7413448 +2266 1.72250443200003 0.157798189199324 0.73882495 +2267 1.72326458400003 0.157237526086261 0.73631344 +2268 1.72402473600003 0.156678768936164 0.73381024 +2269 1.72478488800003 0.156121911437875 0.73131534 +2270 1.72554504000003 0.155566947300665 0.7288287 +2271 1.72630519200003 0.155013870254175 0.72635029 +2272 1.72706534400003 0.154462674048347 0.72388009 +2273 1.72782549600003 0.153913352453361 0.72141808 +2274 1.72858564800003 0.153365899259572 0.71896422 +2275 1.72934580000003 0.152820308277448 0.71651849 +2276 1.73010595200003 0.152276573337502 0.71408086 +2277 1.73086610400003 0.151734688290234 0.71165131 +2278 1.73162625600003 0.151194647006065 0.70922981 +2279 1.73238640800003 0.150656443375275 0.70681633 +2280 1.73314656000003 0.150120071307939 0.70441086 +2281 1.73390671200003 0.14958552473387 0.70201335 +2282 1.73466686400003 0.149052797602548 0.69962379 +2283 1.73542701600003 0.148521883883066 0.69724216 +2284 1.73618716800003 0.147992777564063 0.69486841 +2285 1.73694732000003 0.147465472653666 0.69250254 +2286 1.73770747200003 0.146939963179426 0.69014451 +2287 1.73846762400003 0.146416243188256 0.6877943 +2288 1.73922777600003 0.145894306746374 0.68545189 +2289 1.73998792800003 0.145374147939237 0.68311724 +2290 1.74074808000003 0.144855760871486 0.68079034 +2291 1.74150823200003 0.144339139666879 0.67847115 +2292 1.74226838400003 0.143824278468235 0.67615966 +2293 1.74302853600003 0.143311171437374 0.67385583 +2294 1.74378868800003 0.142799812755054 0.67155965 +2295 1.74454884000003 0.142290196620912 0.66927108 +2296 1.74530899200003 0.141782317253409 0.66699011 +2297 1.74606914400003 0.141276168889763 0.66471671 +2298 1.74682929600003 0.140771745785895 0.66245085 +2299 1.74758944800003 0.140269042216369 0.66019251 +2300 1.74834960000003 0.139768052474332 0.65794166 +2301 1.74910975200003 0.139268770871455 0.65569829 +2302 1.74986990400003 0.138771191737875 0.65346237 +2303 1.75063005600003 0.13827530942214 0.65123386 +2304 1.75139020800003 0.137781118291144 0.64901276 +2305 1.75215036000003 0.137288612730073 0.64679903 +2306 1.75291051200003 0.13679778714235 0.64459265 +2307 1.75367066400003 0.13630863594957 0.64239359 +2308 1.75443081600003 0.135821153591449 0.64020184 +2309 1.75519096800003 0.135335334525764 0.63801737 +2310 1.75595112000003 0.134851173228295 0.63584016 +2311 1.75671127200003 0.13436866419277 0.63367017 +2312 1.75747142400003 0.133887801930807 0.6315074 +2313 1.75823157600003 0.133408580971858 0.62935181 +2314 1.75899172800003 0.132930995863153 0.62720338 +2315 1.75975188000003 0.132455041169641 0.62506209 +2316 1.76051203200003 0.131980711473936 0.62292791 +2317 1.76127218400003 0.131508001376264 0.62080083 +2318 1.76203233600003 0.1310369054944 0.61868081 +2319 1.76279248800003 0.130567418463618 0.61656784 +2320 1.76355264000003 0.130099534936637 0.6144619 +2321 1.76431279200003 0.129633249583557 0.61236295 +2322 1.76507294400003 0.129168557091815 0.61027098 +2323 1.76583309600003 0.128705452166121 0.60818597 +2324 1.76659324800003 0.12824392952841 0.60610789 +2325 1.76735340000003 0.127783983917783 0.60403672 +2326 1.76811355200003 0.127325610090453 0.60197243 +2327 1.76887370400003 0.126868802819692 0.59991501 +2328 1.76963385600003 0.12641355689578 0.59786444 +2329 1.77039400800003 0.125959867125942 0.59582068 +2330 1.77115416000003 0.125507728334305 0.59378372 +2331 1.77191431200003 0.125057135361836 0.59175354 +2332 1.77267446400003 0.124608083066293 0.58973011 +2333 1.77343461600003 0.12416056632217 0.58771341 +2334 1.77419476800003 0.123714580020647 0.58570342 +2335 1.77495492000003 0.12327011906953 0.58370012 +2336 1.77571507200003 0.122827178393206 0.58170349 +2337 1.77647522400003 0.122385752932587 0.5797135 +2338 1.77723537600003 0.121945837645056 0.57773013 +2339 1.77799552800003 0.121507427504418 0.57575337 +2340 1.77875568000003 0.121070517500844 0.57378318 +2341 1.77951583200003 0.120635102640823 0.57181955 +2342 1.78027598400003 0.120201177947108 0.56986246 +2343 1.78103613600003 0.119768738458664 0.56791189 +2344 1.78179628800003 0.119337779230618 0.56596781 +2345 1.78255644000003 0.118908295334205 0.5640302 +2346 1.78331659200003 0.118480281856721 0.56209905 +2347 1.78407674400003 0.118053733901467 0.56017433 +2348 1.78483689600003 0.117628646587704 0.55825601 +2349 1.78559704800003 0.117205015050594 0.55634409 +2350 1.78635720000003 0.11678283444116 0.55443854 +2351 1.78711735200003 0.116362099926226 0.55253933 +2352 1.78787750400003 0.115942806688371 0.55064645 +2353 1.78863765600003 0.11552494992588 0.54875988 +2354 1.78939780800003 0.115108524852692 0.54687959 +2355 1.79015796000003 0.114693526698349 0.54500557 +2356 1.79091811200003 0.114279950707952 0.54313779 +2357 1.79167826400003 0.113867792142103 0.54127624 +2358 1.79243841600003 0.113457046276865 0.53942089 +2359 1.79319856800003 0.113047708403703 0.53757173 +2360 1.79395872000003 0.112639773829444 0.53572873 +2361 1.79471887200003 0.112233237876223 0.53389187 +2362 1.79547902400003 0.111828095881434 0.53206114 +2363 1.79623917600003 0.111424343197684 0.53023651 +2364 1.79699932800003 0.111021975192744 0.52841797 +2365 1.79775948000003 0.110620987249498 0.52660549 +2366 1.79851963200003 0.110221374765899 0.52479905 +2367 1.79927978400003 0.109823133154918 0.52299864 +2368 1.80003993600003 0.109426257844496 0.52120423 +2369 1.80080008800003 0.109030744277499 0.51941581 +2370 1.80156024000003 0.108636587911668 0.51763335 +2371 1.80232039200003 0.108243784219573 0.51585684 +2372 1.80308054400003 0.107852328688563 0.51408626 +2373 1.80384069600003 0.107462216820722 0.51232159 +2374 1.80460084800003 0.107073444132824 0.5105628 +2375 1.80536100000003 0.106686006156278 0.50880988 +2376 1.80612115200003 0.10629989843709 0.50706281 +2377 1.80688130400003 0.105915116535811 0.50532157 +2378 1.80764145600003 0.105531656027494 0.50358615 +2379 1.80840160800003 0.105149512501646 0.50185651 +2380 1.80916176000003 0.104768681562181 0.50013265 +2381 1.80992191200003 0.104389158827376 0.49841455 +2382 1.81068206400003 0.104010939929824 0.49670218 +2383 1.81144221600003 0.103634020516389 0.49499553 +2384 1.81220236800003 0.10325839624816 0.49329458 +2385 1.81296252000003 0.102884062800406 0.4915993 +2386 1.81372267200003 0.102511015862528 0.48990969 +2387 1.81448282400003 0.10213925113802 0.48822572 +2388 1.81524297600003 0.101768764344419 0.48654738 +2389 1.81600312800003 0.101399551213259 0.48487464 +2390 1.81676328000003 0.101031607490031 0.48320749 +2391 1.81752343200003 0.100664928934137 0.48154591 +2392 1.81828358400003 0.100299511318843 0.47988988 +2393 1.81904373600003 0.0999353504312363 0.47823938 +2394 1.81980388800003 0.0995724420721821 0.4765944 +2395 1.82056404000003 0.0992107820562789 0.47495492 +2396 1.82132419200003 0.0988503662118142 0.47332091 +2397 1.82208434400003 0.0984911903807212 0.47169237 +2398 1.82284449600003 0.0981332504185349 0.47006927 +2399 1.82360464800003 0.0977765421943493 0.46845159 +2400 1.82436480000003 0.0974210615907723 0.46683932 +2401 1.82512495200003 0.0970668045038847 0.46523245 +2402 1.82588510400003 0.0967137668431962 0.46363094 +2403 1.82664525600003 0.0963619445316016 0.46203479 +2404 1.82740540800003 0.0960113335053394 0.46044398 +2405 1.82816556000003 0.0956619297139481 0.45885848 +2406 1.82892571200003 0.0953137291202238 0.45727829 +2407 1.82968586400003 0.0949667277001787 0.45570338 +2408 1.83044601600003 0.0946209214429973 0.45413375 +2409 1.83120616800003 0.0942763063509957 0.45256936 +2410 1.83196632000003 0.093932878439578 0.4510102 +2411 1.83272647200003 0.0935906337371965 0.44945626 +2412 1.83348662400003 0.0932495682853078 0.44790752 +2413 1.83424677600003 0.0929096781383324 0.44636397 +2414 1.83500692800003 0.0925709593636129 0.44482557 +2415 1.83576708000003 0.0922334080413731 0.44329233 +2416 1.83652723200003 0.0918970202646752 0.44176421 +2417 1.83728738400003 0.0915617921393803 0.44024122 +2418 1.83804753600003 0.0912277197841072 0.43872331 +2419 1.83880768800003 0.0908947993301906 0.43721049 +2420 1.83956784000003 0.0905630269216412 0.43570274 +2421 1.84032799200003 0.0902323987151046 0.43420003 +2422 1.84108814400003 0.0899029108798213 0.43270235 +2423 1.84184829600003 0.089574559597586 0.43120969 +2424 1.84260844800003 0.0892473410627071 0.42972203 +2425 1.84336860000003 0.0889212514819673 0.42823934 +2426 1.84412875200003 0.0885962870745832 0.42676163 +2427 1.84488890400003 0.0882724440721652 0.42528886 +2428 1.84564905600003 0.0879497187186776 0.42382103 +2429 1.84640920800003 0.0876281072704006 0.42235811 +2430 1.84716936000003 0.0873076059958886 0.42090009 +2431 1.84792951200003 0.0869882111759321 0.41944696 +2432 1.84868966400003 0.0866699191035182 0.4179987 +2433 1.84944981600003 0.0863527260837915 0.41655529 +2434 1.85020996800003 0.0860366284340147 0.41511671 +2435 1.85097012000003 0.0857216224835309 0.41368296 +2436 1.85173027200003 0.0854077045737227 0.41225401 +2437 1.85249042400003 0.0850948710579759 0.41082986 +2438 1.85325057600003 0.0847831183016397 0.40941047 +2439 1.85401072800003 0.0844724426819882 0.40799584 +2440 1.85477088000003 0.0841628405881828 0.40658596 +2441 1.85553103200003 0.0838543084212334 0.4051808 +2442 1.85629118400003 0.0835468425939609 0.40378036 +2443 1.85705133600003 0.0832404395309589 0.40238461 +2444 1.85781148800003 0.0829350956685558 0.40099354 +2445 1.85857164000003 0.0826308074547775 0.39960713 +2446 1.85933179200003 0.0823275713493096 0.39822538 +2447 1.86009194400003 0.0820253838234601 0.39684825 +2448 1.86085209600003 0.0817242413601219 0.39547575 +2449 1.86161224800003 0.0814241404537353 0.39410786 +2450 1.86237240000003 0.0811250776102515 0.39274455 +2451 1.86313255200003 0.0808270493470957 0.39138581 +2452 1.86389270400003 0.0805300521931287 0.39003164 +2453 1.86465285600003 0.0802340826886125 0.38868201 +2454 1.86541300800003 0.0799391373851719 0.3873369 +2455 1.86617316000003 0.0796452128457584 0.38599631 +2456 1.86693331200003 0.0793523056446141 0.38466022 +2457 1.86769346400003 0.0790604123672349 0.38332862 +2458 1.86845361600003 0.0787695296103353 0.38200148 +2459 1.86921376800003 0.0784796539818105 0.3806788 +2460 1.86997392000003 0.0781907821007026 0.37936057 +2461 1.87073407200003 0.0779029105971634 0.37804675 +2462 1.87149422400003 0.0776160361124185 0.37673735 +2463 1.87225437600003 0.0773301552987327 0.37543234 +2464 1.87301452800003 0.0770452648193736 0.37413172 +2465 1.87377468000003 0.0767613613485764 0.37283546 +2466 1.87453483200003 0.0764784415715092 0.37154356 +2467 1.87529498400003 0.0761965021842369 0.370256 +2468 1.87605513600003 0.0759155398936867 0.36897276 +2469 1.87681528800003 0.075635551417613 0.36769384 +2470 1.87757544000003 0.0753565334845625 0.36641921 +2471 1.87833559200003 0.0750784828338396 0.36514886 +2472 1.87909574400003 0.0748013962154712 0.36388278 +2473 1.87985589600003 0.0745252703901732 0.36262095 +2474 1.88061604800003 0.0742501021293151 0.36136337 +2475 1.88137620000003 0.0739758882148861 0.36011001 +2476 1.88213635200003 0.0737026254394614 0.35886087 +2477 1.88289650400003 0.0734303106061667 0.35761592 +2478 1.88365665600003 0.0731589405286456 0.35637516 +2479 1.88441680800003 0.0728885120310253 0.35513856 +2480 1.88517696000003 0.0726190219478828 0.35390613 +2481 1.88593711200003 0.0723504671242102 0.35267784 +2482 1.88669726400003 0.072082844415383 0.35145368 +2483 1.88745741600003 0.0718161506871255 0.35023364 +2484 1.88821756800003 0.0715503828154775 0.3490177 +2485 1.88897772000003 0.0712855376867614 0.34780585 +2486 1.88973787200003 0.0710216121975486 0.34659807 +2487 1.89049802400003 0.0707586032546269 0.34539436 +2488 1.89125817600003 0.0704965077749672 0.34419469 +2489 1.89201832800003 0.0702353226856909 0.34299907 +2490 1.89277848000003 0.0699750449240369 0.34180746 +2491 1.89353863200003 0.0697156714373295 0.34061986 +2492 1.89429878400003 0.0694571991829454 0.33943626 +2493 1.89505893600003 0.0691996251282809 0.33825665 +2494 1.89581908800003 0.0689429462507206 0.337081 +2495 1.89657924000003 0.0686871595376045 0.33590931 +2496 1.89733939200003 0.068432261986196 0.33474156 +2497 1.89809954400003 0.0681782506036498 0.33357774 +2498 1.89885969600003 0.0679251224069802 0.33241785 +2499 1.89961984800003 0.067672874423029 0.33126185 +2500 1.90038000000003 0.0674215036884341 0.33010975 +2501 1.90114015200003 0.0671710072495973 0.32896153 +2502 1.90190030400003 0.0669213821626536 0.32781717 +2503 1.90266045600003 0.0666726254934391 0.32667667 +2504 1.90342060800003 0.0664247343174599 0.32554001 +2505 1.90418076000003 0.0661777057198612 0.32440717 +2506 1.90494091200003 0.0659315367953954 0.32327815 +2507 1.90570106400003 0.0656862246483918 0.32215294 +2508 1.90646121600003 0.0654417663927256 0.32103152 +2509 1.90722136800003 0.0651981591517862 0.31991387 +2510 1.90798152000003 0.0649554000584477 0.31879999 +2511 1.90874167200003 0.0647134862550375 0.31768986 +2512 1.90950182400003 0.0644724148933059 0.31658347 +2513 1.91026197600003 0.0642321831343956 0.31548081 +2514 1.91102212800003 0.0639927881488118 0.31438187 +2515 1.91178228000003 0.0637542271163909 0.31328663 +2516 1.91254243200003 0.0635164972262719 0.31219509 +2517 1.91330258400003 0.0632795956768645 0.31110722 +2518 1.91406273600003 0.0630435196758205 0.31002302 +2519 1.91482288800003 0.0628082664400035 0.30894247 +2520 1.91558304000003 0.0625738331954593 0.30786557 +2521 1.91634319200003 0.0623402171773852 0.3067923 +2522 1.91710334400003 0.0621074156301022 0.30572265 +2523 1.91786349600003 0.0618754258070239 0.30465661 +2524 1.91862364800003 0.0616442449706278 0.30359416 +2525 1.91938380000003 0.0614138703924259 0.30253529 +2526 1.92014395200003 0.0611842993529356 0.30148 +2527 1.92090410400003 0.0609555291416499 0.30042827 +2528 1.92166425600003 0.0607275570570098 0.29938008 +2529 1.92242440800003 0.0605003804063731 0.29833543 +2530 1.92318456000003 0.0602739965059879 0.29729431 +2531 1.92394471200003 0.0600484026809626 0.2962567 +2532 1.92470486400003 0.059823596265237 0.29522259 +2533 1.92546501600003 0.0595995746015544 0.29419197 +2534 1.92622516800003 0.059376335041433 0.29316483 +2535 1.92698532000003 0.0591538749451369 0.29214115 +2536 1.92774547200003 0.0589321916816486 0.29112093 +2537 1.92850562400003 0.0587112826286398 0.29010416 +2538 1.92926577600003 0.0584911451724446 0.28909081 +2539 1.93002592800003 0.05827177670803 0.28808089 +2540 1.93078608000003 0.058053174638969 0.28707438 +2541 1.93154623200003 0.0578353363774123 0.28607127 +2542 1.93230638400003 0.0576182593440601 0.28507154 +2543 1.93306653600003 0.0574019409681358 0.2840752 +2544 1.93382668800003 0.0571863786873566 0.28308221 +2545 1.93458684000003 0.0569715699479071 0.28209258 +2546 1.93534699200003 0.0567575122044116 0.2811063 +2547 1.93610714400003 0.0565442029199067 0.28012334 +2548 1.93686729600003 0.0563316395658142 0.27914371 +2549 1.93762744800003 0.0561198196219137 0.27816739 +2550 1.93838760000003 0.0559087405763159 0.27719436 +2551 1.93914775200003 0.0556983999254345 0.27622463 +2552 1.93990790400003 0.0554887951739611 0.27525817 +2553 1.94066805600003 0.0552799238348366 0.27429497 +2554 1.94142820800003 0.0550717834292255 0.27333504 +2555 1.94218836000003 0.054864371486489 0.27237834 +2556 1.94294851200003 0.0546576855441585 0.27142489 +2557 1.94370866400003 0.0544517231479082 0.27047465 +2558 1.94446881600003 0.0542464818515302 0.26952763 +2559 1.94522896800003 0.0540419592169073 0.26858381 +2560 1.94598912000003 0.0538381528139869 0.26764318 +2561 1.94674927200003 0.0536350602207542 0.26670573 +2562 1.94750942400003 0.0534326790232078 0.26577145 +2563 1.94826957600003 0.0532310068153316 0.26484034 +2564 1.94902972800003 0.0530300411990706 0.26391237 +2565 1.94978988000003 0.0528297797843041 0.26298754 +2566 1.95055003200003 0.0526302201888203 0.26206584 +2567 1.95131018400003 0.0524313600382903 0.26114726 +2568 1.95207033600003 0.0522331969662434 0.26023179 +2569 1.95283048800003 0.0520357286140405 0.25931941 +2570 1.95359064000003 0.0518389526308492 0.25841012 +2571 1.95435079200003 0.0516428666736184 0.25750391 +2572 1.95511094400003 0.0514474684070533 0.25660077 +2573 1.95587109600003 0.0512527555035897 0.25570068 +2574 1.95663124800003 0.0510587256433688 0.25480364 +2575 1.95739140000003 0.0508653765142134 0.25390963 +2576 1.95815155200003 0.0506727058116014 0.25301866 +2577 1.95891170400003 0.0504807112386417 0.2521307 +2578 1.95967185600003 0.0502893905060496 0.25124574 +2579 1.96043200800003 0.0500987413321215 0.25036378 +2580 1.96119216000003 0.0499087614427108 0.24948481 +2581 1.96195231200003 0.049719448571203 0.24860882 +2582 1.96271246400003 0.0495308004584913 0.24773579 +2583 1.96347261600003 0.0493428148529524 0.24686572 +2584 1.96423276800003 0.049155489510422 0.2459986 +2585 1.96499292000003 0.0489688221941705 0.24513442 +2586 1.96575307200003 0.048782810674879 0.24427316 +2587 1.96651322400003 0.0485974527306154 0.24341482 +2588 1.96727337600003 0.0484127461468096 0.24255939 +2589 1.96803352800003 0.0482286887162304 0.24170686 +2590 1.96879368000003 0.0480452782389612 0.24085722 +2591 1.96955383200003 0.0478625125223766 0.24001046 +2592 1.97031398400003 0.0476803893811183 0.23916656 +2593 1.97107413600003 0.0474989066370715 0.23832553 +2594 1.97183428800003 0.0473180621193415 0.23748735 +2595 1.97259444000003 0.0471378536642301 0.23665201 +2596 1.97335459200003 0.0469582791152126 0.23581951 +2597 1.97411474400003 0.0467793363229138 0.23498982 +2598 1.97487489600003 0.0466010231450849 0.23416295 +2599 1.97563504800003 0.046423337446581 0.23333889 +2600 1.97639520000003 0.046246277099337 0.23251762 +2601 1.97715535200003 0.0460698399823454 0.23169913 +2602 1.97791550400003 0.0458940239816325 0.23088342 +2603 1.97867565600003 0.0457188269902364 0.23007048 +2604 1.97943580800003 0.0455442469081835 0.2292603 +2605 1.98019596000003 0.045370281642466 0.22845286 +2606 1.98095611200003 0.0451969291070195 0.22764817 +2607 1.98171626400003 0.0450241872226998 0.2268462 +2608 1.98247641600003 0.0448520539172609 0.22604696 +2609 1.98323656800003 0.0446805271253323 0.22525043 +2610 1.98399672000003 0.0445096047883962 0.2244566 +2611 1.98475687200003 0.0443392848547666 0.22366547 +2612 1.98551702400003 0.0441695652795652 0.22287702 +2613 1.98627717600003 0.0440004440247004 0.22209125 +2614 1.98703732800003 0.0438319190588453 0.22130815 +2615 1.98779748000003 0.0436639883574146 0.22052771 +2616 1.98855763200003 0.0434966499025437 0.21974991 +2617 1.98931778400003 0.0433299016830665 0.21897476 +2618 1.99007793600003 0.0431637416944932 0.21820224 +2619 1.99083808800003 0.042998167938989 0.21743235 +2620 1.99159824000003 0.0428331784253525 0.21666507 +2621 1.99235839200003 0.0426687711689936 0.21590039 +2622 1.99311854400003 0.0425049441919119 0.21513832 +2623 1.99387869600003 0.0423416955226761 0.21437883 +2624 1.99463884800003 0.0421790231964017 0.21362193 +2625 1.99539900000003 0.0420169252547301 0.21286759 +2626 1.99615915200003 0.041855399745807 0.21211582 +2627 1.99691930400003 0.0416944447242618 0.2113666 +2628 1.99767945600003 0.0415340582511855 0.21061994 +2629 1.99843960800003 0.0413742383941107 0.2098758 +2630 1.99919976000003 0.0412149832269896 0.2091342 +2631 1.99995991200003 0.0410562908301741 0.20839512 +2632 2.00072006400003 0.0408981592903941 0.20765855 +2633 2.00148021600003 0.0407405867007369 0.20692449 +2634 2.00224036800003 0.0405835711606267 0.20619292 +2635 2.00300052000003 0.0404271107758036 0.20546384 +2636 2.00376067200003 0.0402712036583034 0.20473724 +2637 2.00452082400003 0.0401158479264367 0.20401311 +2638 2.00528097600003 0.0399610417047686 0.20329145 +2639 2.00604112800003 0.0398067831240983 0.20257224 +2640 2.00680128000003 0.0396530703214386 0.20185547 +2641 2.00756143200003 0.0394999014399958 0.20114115 +2642 2.00832158400003 0.0393472746291494 0.20042925 +2643 2.00908173600003 0.0391951880444323 0.19971978 +2644 2.00984188800003 0.0390436398475098 0.19901272 +2645 2.01060204000003 0.0388926282061606 0.19830807 +2646 2.01136219200003 0.0387421512942564 0.19760582 +2647 2.01212234400003 0.0385922072917419 0.19690595 +2648 2.01288249600003 0.0384427943846152 0.19620847 +2649 2.01364264800003 0.0382939107649078 0.19551337 +2650 2.01440280000003 0.0381455546306653 0.19482063 +2651 2.01516295200003 0.0379977241859272 0.19413025 +2652 2.01592310400003 0.037850417640708 0.19344222 +2653 2.01668325600003 0.037703633210977 0.19275653 +2654 2.01744340800003 0.0375573691186392 0.19207318 +2655 2.01820356000003 0.0374116235915161 0.19139215 +2656 2.01896371200003 0.0372663948633259 0.19071345 +2657 2.01972386400003 0.0371216811736647 0.19003706 +2658 2.02048401600003 0.0369774807679869 0.18936297 +2659 2.02124416800003 0.0368337918975865 0.18869118 +2660 2.02200432000003 0.0366906128195774 0.18802167 +2661 2.02276447200003 0.0365479417968751 0.18735445 +2662 2.02352462400003 0.0364057770981771 0.1866895 +2663 2.02428477600003 0.0362641169979446 0.18602682 +2664 2.02504492800003 0.0361229597763833 0.1853664 +2665 2.02580508000003 0.0359823037194244 0.18470823 +2666 2.02656523200003 0.0358421471187064 0.1840523 +2667 2.02732538400003 0.0357024882715563 0.18339861 +2668 2.02808553600003 0.0355633254809707 0.18274715 +2669 2.02884568800003 0.0354246570555975 0.1820979 +2670 2.02960584000003 0.0352864813097175 0.18145088 +2671 2.03036599200003 0.035148796563226 0.18080605 +2672 2.03112614400003 0.0350116011416141 0.18016343 +2673 2.03188629600003 0.0348748933759506 0.179523 +2674 2.03264644800003 0.034738671602864 0.17888476 +2675 2.03340660000003 0.0346029341645239 0.17824869 +2676 2.03416675200002 0.0344676794086233 0.17761479 +2677 2.03492690400002 0.0343329056883601 0.17698305 +2678 2.03568705600002 0.0341986113624193 0.17635347 +2679 2.03644720800002 0.0340647947949552 0.17572604 +2680 2.03720736000002 0.0339314543555731 0.17510075 +2681 2.03796751200002 0.0337985884193122 0.1744776 +2682 2.03872766400002 0.0336661953666268 0.17385657 +2683 2.03948781600002 0.0335342735833694 0.17323766 +2684 2.04024796800002 0.0334028214607727 0.17262086 +2685 2.04100812000002 0.0332718373954321 0.17200617 +2686 2.04176827200002 0.0331413197892878 0.17139358 +2687 2.04252842400002 0.0330112670496081 0.17078308 +2688 2.04328857600002 0.032881677588971 0.17017467 +2689 2.04404872800002 0.0327525498252476 0.16956833 +2690 2.04480888000002 0.0326238821815843 0.16896406 +2691 2.04556903200002 0.0324956730863856 0.16836186 +2692 2.04632918400002 0.0323679209732971 0.16776171 +2693 2.04708933600002 0.0322406242811879 0.16716362 +2694 2.04784948800002 0.0321137814541343 0.16656757 +2695 2.04860964000002 0.0319873909414018 0.16597355 +2696 2.04936979200002 0.0318614511974287 0.16538157 +2697 2.05012994400002 0.031735960681809 0.16479161 +2698 2.05089009600002 0.0316109178592756 0.16420366 +2699 2.05165024800002 0.0314863211996832 0.16361772 +2700 2.05241040000002 0.0313621691779917 0.16303379 +2701 2.05317055200002 0.0312384602742497 0.16245185 +2702 2.05393070400002 0.0311151929735773 0.16187191 +2703 2.05469085600002 0.03099236576615 0.16129394 +2704 2.05545100800002 0.0308699771471819 0.16071795 +2705 2.05621116000002 0.030748025616909 0.16014394 +2706 2.05697131200002 0.0306265096805733 0.15957188 +2707 2.05773146400002 0.0305054278484058 0.15900178 +2708 2.05849161600002 0.0303847786356103 0.15843363 +2709 2.05925176800002 0.0302645605623474 0.15786743 +2710 2.06001192000002 0.0301447721537179 0.15730316 +2711 2.06077207200002 0.0300254119397469 0.15674082 +2712 2.06153222400002 0.0299064784553675 0.15618041 +2713 2.06229237600002 0.0297879702404043 0.15562191 +2714 2.06305252800002 0.0296698858395584 0.15506533 +2715 2.06381268000002 0.0295522238023903 0.15451065 +2716 2.06457283200002 0.0294349826833049 0.15395787 +2717 2.06533298400002 0.0293181610415344 0.15340698 +2718 2.06609313600002 0.029201757441124 0.15285797 +2719 2.06685328800002 0.0290857704509152 0.15231085 +2720 2.06761344000002 0.0289701986445296 0.1517656 +2721 2.06837359200002 0.0288550406003546 0.15122222 +2722 2.06913374400002 0.0287402949015267 0.1506807 +2723 2.06989389600002 0.028625960135916 0.15014103 +2724 2.07065404800001 0.0285120348961112 0.14960321 +2725 2.07141420000001 0.0283985177794037 0.14906723 +2726 2.07217435200001 0.0282854073877721 0.14853309 +2727 2.07293450400001 0.0281727023278672 0.14800078 +2728 2.07369465600001 0.0280604012109964 0.14747029 +2729 2.07445480800001 0.0279485026531084 0.14694162 +2730 2.07521496000001 0.0278370052747783 0.14641476 +2731 2.07597511200001 0.0277259077011917 0.14588971 +2732 2.07673526400001 0.0276152085621304 0.14536646 +2733 2.07749541600001 0.0275049064919569 0.144845 +2734 2.07825556800001 0.0273950001295991 0.14432533 +2735 2.07901572000001 0.0272854881185358 0.14380744 +2736 2.07977587200001 0.0271763691067819 0.14329132 +2737 2.08053602400001 0.0270676417468724 0.14277698 +2738 2.08129617600001 0.0269593046958491 0.1422644 +2739 2.08205632800001 0.0268513566152446 0.14175357 +2740 2.08281648000001 0.026743796171068 0.1412445 +2741 2.08357663200001 0.0266366220337904 0.14073718 +2742 2.08433678400001 0.0265298328783297 0.14023159 +2743 2.08509693600001 0.0264234273840366 0.13972774 +2744 2.08585708800001 0.0263174042346795 0.13922562 +2745 2.08661724000001 0.0262117621184305 0.13872522 +2746 2.08737739200001 0.0261064997278506 0.13822654 +2747 2.08813754400001 0.0260016157598751 0.13772957 +2748 2.08889769600001 0.0258971089157999 0.1372343 +2749 2.08965784800001 0.0257929779012664 0.13674074 +2750 2.09041800000001 0.0256892214262477 0.13624887 +2751 2.09117815200001 0.0255858382050341 0.13575868 +2752 2.09193830400001 0.0254828269562195 0.13527018 +2753 2.09269845600001 0.0253801864026863 0.13478336 +2754 2.09345860800001 0.0252779152715921 0.13429821 +2755 2.09421876000001 0.0251760122943551 0.13381473 +2756 2.09497891200001 0.0250744762066406 0.1333329 +2757 2.09573906400001 0.0249733057483468 0.13285273 +2758 2.09649921600001 0.0248724996635904 0.13237421 +2759 2.09725936800001 0.0247720567006939 0.13189734 +2760 2.09801952000001 0.0246719756121704 0.1314221 +2761 2.09877967200001 0.024572255154711 0.1309485 +2762 2.09953982400001 0.0244728940891704 0.13047652 +2763 2.10029997600001 0.0243738911805533 0.13000616 +2764 2.10106012800001 0.0242752451980007 0.12953743 +2765 2.10182028000001 0.0241769549147766 0.1290703 +2766 2.10258043200001 0.0240790191082543 0.12860478 +2767 2.10334058400001 0.0239814365599025 0.12814085 +2768 2.10410073600001 0.0238842060552725 0.12767853 +2769 2.10486088800001 0.0237873263839842 0.12721779 +2770 2.10562104000001 0.023690796339713 0.12675864 +2771 2.10638119200001 0.0235946147201765 0.12630106 +2772 2.107141344 0.0234987803271209 0.12584506 +2773 2.107901496 0.0234032919663082 0.12539063 +2774 2.108661648 0.0233081484475023 0.12493776 +2775 2.1094218 0.0232133485844567 0.12448645 +2776 2.110181952 0.0231188911949007 0.1240367 +2777 2.110942104 0.0230247751005265 0.12358848 +2778 2.111702256 0.0229309991269763 0.12314182 +2779 2.112462408 0.022837562103829 0.12269669 +2780 2.11322256 0.0227444628645878 0.12225309 +2781 2.113982712 0.0226517002466667 0.12181101 +2782 2.114742864 0.0225592730913774 0.12137046 +2783 2.115503016 0.0224671802439177 0.12093143 +2784 2.116263168 0.0223754205533573 0.12049391 +2785 2.11702332 0.022283992872626 0.12005789 +2786 2.117783472 0.0221928960585004 0.11962338 +2787 2.118543624 0.0221021289715916 0.11919036 +2788 2.119303776 0.0220116904763324 0.11875883 +2789 2.120063928 0.0219215794409649 0.11832879 +2790 2.12082408 0.0218317947375275 0.11790024 +2791 2.121584232 0.021742335241843 0.11747315 +2792 2.122344384 0.0216531998335058 0.11704754 +2793 2.123104536 0.0215643873958693 0.1166234 +2794 2.123864688 0.0214758968160338 0.11620071 +2795 2.12462484 0.0213877269848344 0.11577949 +2796 2.125384992 0.0212998767968278 0.11535971 +2797 2.126145144 0.0212123451502813 0.11494139 +2798 2.126905296 0.0211251309471593 0.1145245 +2799 2.127665448 0.0210382330931119 0.11410905 +2800 2.1284256 0.0209516504974626 0.11369504 +2801 2.129185752 0.0208653820731961 0.11328245 +2802 2.129945904 0.0207794267369464 0.11287128 +2803 2.130706056 0.0206937834089844 0.11246154 +2804 2.131466208 0.0206084510132064 0.1120532 +2805 2.13222636 0.0205234284771218 0.11164628 +2806 2.132986512 0.0204387147318413 0.11124076 +2807 2.133746664 0.0203543087120649 0.11083663 +2808 2.134506816 0.0202702093560704 0.1104339 +2809 2.135266968 0.0201864156057013 0.11003257 +2810 2.13602712 0.0201029264063552 0.10963261 +2811 2.136787272 0.0200197407069718 0.10923404 +2812 2.137547424 0.0199368574600217 0.10883684 +2813 2.138307576 0.0198542756214942 0.10844102 +2814 2.139067728 0.0197719941508862 0.10804656 +2815 2.13982788 0.0196900120111902 0.10765346 +2816 2.140588032 0.0196083281688833 0.10726172 +2817 2.141348184 0.0195269415939151 0.10687133 +2818 2.142108336 0.0194458512596965 0.10648229 +2819 2.142868488 0.0193650561430885 0.10609459 +2820 2.14362863999999 0.0192845552243905 0.10570824 +2821 2.14438879199999 0.0192043474873291 0.10532322 +2822 2.14514894399999 0.0191244319190468 0.10493952 +2823 2.14590909599999 0.0190448075100905 0.10455716 +2824 2.14666924799999 0.0189654732544006 0.10417611 +2825 2.14742939999999 0.0188864281492998 0.10379638 +2826 2.14818955199999 0.0188076711954815 0.10341797 +2827 2.14894970399999 0.0187292013969992 0.10304086 +2828 2.14970985599999 0.0186510177612551 0.10266506 +2829 2.15047000799999 0.018573119298989 0.10229055 +2830 2.15123015999999 0.0184955050242676 0.10191734 +2831 2.15199031199999 0.0184181739544731 0.10154542 +2832 2.15275046399999 0.0183411251102926 0.10117479 +2833 2.15351061599999 0.0182643575157071 0.10080544 +2834 2.15427076799999 0.0181878701979805 0.10043737 +2835 2.15503091999999 0.0181116621876488 0.10007056 +2836 2.15579107199999 0.0180357325185094 0.099705033 +2837 2.15655122399999 0.0179600802276104 0.099340766 +2838 2.15731137599999 0.0178847043552394 0.098977759 +2839 2.15807152799999 0.0178096039449132 0.098616008 +2840 2.15883167999999 0.0177347780433674 0.09825551 +2841 2.15959183199999 0.0176602257005451 0.097896259 +2842 2.16035198399999 0.0175859459695867 0.097538251 +2843 2.16111213599999 0.0175119379068192 0.097181483 +2844 2.16187228799999 0.0174382005717457 0.09682595 +2845 2.16263243999999 0.0173647330270353 0.096471649 +2846 2.16339259199999 0.017291534338512 0.096118574 +2847 2.16415274399999 0.0172186035751444 0.095766721 +2848 2.16491289599999 0.0171459398090358 0.095416088 +2849 2.16567304799999 0.0170735421154132 0.095066669 +2850 2.16643319999999 0.0170014095726175 0.09471846 +2851 2.16719335199999 0.016929541262093 0.094371457 +2852 2.16795350399999 0.0168579362683769 0.094025657 +2853 2.16871365599999 0.0167865936790896 0.093681056 +2854 2.16947380799999 0.0167155125849239 0.093337648 +2855 2.17023395999999 0.0166446920796355 0.09299543 +2856 2.17099411199999 0.0165741312600322 0.092654399 +2857 2.17175426399999 0.0165038292259642 0.09231455 +2858 2.17251441599999 0.0164337850803144 0.091975879 +2859 2.17327456799999 0.0163639979289873 0.091638382 +2860 2.17403471999999 0.0162944668809 0.091302056 +2861 2.17479487199999 0.016225191047972 0.090966896 +2862 2.17555502399999 0.016156169545115 0.090632898 +2863 2.17631517599999 0.0160874014902232 0.090300059 +2864 2.17707532799999 0.0160188860041633 0.089968374 +2865 2.17783547999999 0.015950622210765 0.08963784 +2866 2.17859563199999 0.0158826092368108 0.089308453 +2867 2.17935578399999 0.0158148462120265 0.088980209 +2868 2.18011593599998 0.0157473322690712 0.088653104 +2869 2.18087608799998 0.0156800665435279 0.088327134 +2870 2.18163623999998 0.0156130481738938 0.088002296 +2871 2.18239639199998 0.0155462763015703 0.087678585 +2872 2.18315654399998 0.0154797500708537 0.087355998 +2873 2.18391669599998 0.0154134686289257 0.087034531 +2874 2.18467684799998 0.0153474311258435 0.08671418 +2875 2.18543699999998 0.0152816367145306 0.086394941 +2876 2.18619715199998 0.0152160845507673 0.086076812 +2877 2.18695730399998 0.0151507737931808 0.085759787 +2878 2.18771745599998 0.0150857036032366 0.085443864 +2879 2.18847760799998 0.0150208731452282 0.085129038 +2880 2.18923775999998 0.0149562815862684 0.084815306 +2881 2.18999791199998 0.0148919280962798 0.084502664 +2882 2.19075806399998 0.014827811847985 0.084191109 +2883 2.19151821599998 0.0147639320168983 0.083880636 +2884 2.19227836799998 0.0147002877813156 0.083571243 +2885 2.19303851999998 0.0146368783223056 0.083262925 +2886 2.19379867199998 0.0145737028237005 0.082955679 +2887 2.19455882399998 0.0145107604720868 0.082649501 +2888 2.19531897599998 0.0144480504567963 0.082344388 +2889 2.19607912799998 0.014385571969897 0.082040336 +2890 2.19683927999998 0.0143233242061839 0.081737341 +2891 2.19759943199998 0.0142613063631702 0.0814354 +2892 2.19835958399998 0.014199517641078 0.08113451 +2893 2.19911973599998 0.0141379572428296 0.080834667 +2894 2.19987988799998 0.0140766243740383 0.080535866 +2895 2.20064003999998 0.0140155182429997 0.080238106 +2896 2.20140019199998 0.0139546380606827 0.079941382 +2897 2.20216034399998 0.0138939830407208 0.07964569 +2898 2.20292049599998 0.0138335523994029 0.079351028 +2899 2.20368064799998 0.0137733453556649 0.079057391 +2900 2.20444079999998 0.0137133611310808 0.078764777 +2901 2.20520095199998 0.013653598949854 0.078473182 +2902 2.20596110399998 0.0135940580388081 0.078182602 +2903 2.20672125599998 0.0135347376273792 0.077893034 +2904 2.20748140799998 0.0134756369476063 0.077604475 +2905 2.20824155999998 0.0134167552341231 0.07731692 +2906 2.20900171199998 0.0133580917241493 0.077030368 +2907 2.20976186399998 0.0132996456574822 0.076744814 +2908 2.21052201599998 0.013241416276488 0.076460255 +2909 2.21128216799998 0.0131834028260932 0.076176687 +2910 2.21204231999998 0.0131256045537763 0.075894108 +2911 2.21280247199998 0.0130680207095593 0.075612514 +2912 2.21356262399998 0.0130106505459989 0.075331902 +2913 2.21432277599998 0.0129534933181788 0.075052267 +2914 2.21508292799998 0.0128965482837008 0.074773608 +2915 2.21584307999998 0.0128398147026764 0.074495921 +2916 2.21660323199997 0.012783291837719 0.074219201 +2917 2.21736338399997 0.0127269789539349 0.073943447 +2918 2.21812353599997 0.0126708753189156 0.073668655 +2919 2.21888368799997 0.0126149802027293 0.073394822 +2920 2.21964383999997 0.0125592928779126 0.073121944 +2921 2.22040399199997 0.0125038126194627 0.072850018 +2922 2.22116414399997 0.0124485387048287 0.07257904 +2923 2.22192429599997 0.0123934704139039 0.072309009 +2924 2.22268444799997 0.0123386070290174 0.07203992 +2925 2.22344459999997 0.0122839478349263 0.071771771 +2926 2.22420475199997 0.0122294921188073 0.071504557 +2927 2.22496490399997 0.012175239170249 0.071238277 +2928 2.22572505599997 0.0121211882812436 0.070972927 +2929 2.22648520799997 0.0120673387461793 0.070708503 +2930 2.22724535999997 0.0120136898618319 0.070445002 +2931 2.22800551199997 0.0119602409273572 0.070182422 +2932 2.22876566399997 0.011906991244283 0.06992076 +2933 2.22952581599997 0.0118539401165011 0.069660011 +2934 2.23028596799997 0.0118010868502598 0.069400174 +2935 2.23104611999997 0.0117484307541555 0.069141245 +2936 2.23180627199997 0.0116959711391255 0.068883221 +2937 2.23256642399997 0.01164370731844 0.068626098 +2938 2.23332657599997 0.0115916386076941 0.068369874 +2939 2.23408672799997 0.0115397643248006 0.068114547 +2940 2.23484687999997 0.0114880837899818 0.067860112 +2941 2.23560703199997 0.0114365963257621 0.067606566 +2942 2.23636718399997 0.0113853012569602 0.067353908 +2943 2.23712733599997 0.0113341979106819 0.067102133 +2944 2.23788748799997 0.0112832856163117 0.066851238 +2945 2.23864763999997 0.0112325637055061 0.066601222 +2946 2.23940779199997 0.0111820315121854 0.06635208 +2947 2.24016794399997 0.0111316883725266 0.06610381 +2948 2.24092809599997 0.0110815336249556 0.065856409 +2949 2.24168824799997 0.0110315666101401 0.065609874 +2950 2.24244839999997 0.0109817866709817 0.065364202 +2951 2.24320855199997 0.0109321931526087 0.06511939 +2952 2.24396870399997 0.0108827854023688 0.064875435 +2953 2.24472885599997 0.0108335627698215 0.064632334 +2954 2.24548900799997 0.0107845246067311 0.064390084 +2955 2.24624915999997 0.0107356702670589 0.064148683 +2956 2.24700931199997 0.0106869991069562 0.063908128 +2957 2.24776946399997 0.010638510484757 0.063668415 +2958 2.24852961599997 0.0105902037609707 0.063429542 +2959 2.24928976799997 0.0105420782982748 0.063191506 +2960 2.25004991999997 0.0104941334615079 0.062954304 +2961 2.25081007199997 0.0104463686176622 0.062717934 +2962 2.25157022399997 0.0103987831358767 0.062482392 +2963 2.25233037599997 0.0103513763874298 0.062247676 +2964 2.25309052799996 0.0103041477457322 0.062013782 +2965 2.25385067999996 0.01025709658632 0.061780709 +2966 2.25461083199996 0.0102102222868473 0.061548453 +2967 2.25537098399996 0.0101635242270796 0.061317012 +2968 2.25613113599996 0.0101170017888865 0.061086382 +2969 2.25689128799996 0.0100706543562346 0.060856561 +2970 2.25765143999996 0.0100244813151808 0.060627547 +2971 2.25841159199996 0.00997848205386508 0.060399336 +2972 2.25917174399996 0.00993265596250387 0.060171926 +2973 2.25993189599996 0.0098870024333829 0.059945315 +2974 2.26069204799996 0.00984152086085035 0.059719498 +2975 2.26145219999996 0.00979621064131014 0.059494475 +2976 2.26221235199996 0.00975107117321482 0.059270241 +2977 2.26297250399996 0.00970610185705905 0.059046794 +2978 2.26373265599996 0.00966130209537258 0.058824133 +2979 2.26449280799996 0.00961667129271363 0.058602253 +2980 2.26525295999996 0.00957220885566204 0.058381153 +2981 2.26601311199996 0.0095279141928126 0.058160829 +2982 2.26677326399996 0.00948378671476829 0.057941279 +2983 2.26753341599996 0.00943982583413365 0.057722501 +2984 2.26829356799996 0.00939603096550804 0.057504492 +2985 2.26905371999996 0.00935240152547918 0.057287248 +2986 2.26981387199996 0.00930893693261624 0.057070769 +2987 2.27057402399996 0.00926563660746348 0.05685505 +2988 2.27133417599996 0.00922249997253368 0.05664009 +2989 2.27209432799996 0.00917952645230137 0.056425885 +2990 2.27285447999996 0.00913671547319651 0.056212434 +2991 2.27361463199996 0.0090940664635979 0.055999734 +2992 2.27437478399996 0.00905157885382672 0.055787782 +2993 2.27513493599996 0.00900925207613993 0.055576575 +2994 2.27589508799996 0.00896708556472401 0.055366111 +2995 2.27665523999996 0.00892507875568846 0.055156388 +2996 2.27741539199996 0.00888323108705937 0.054947403 +2997 2.27817554399996 0.00884154199877302 0.054739154 +2998 2.27893569599996 0.00880001093266958 0.054531637 +2999 2.27969584799996 0.00875863733248674 0.054324851 +3000 2.28045599999996 0.00871742064385346 0.054118793 +3001 2.28121615199996 0.00867636031428336 0.053913461 +3002 2.28197630399996 0.00863545579316892 0.053708852 +3003 2.28273645599996 0.0085947065317749 0.053504963 +3004 2.28349660799996 0.0085541119832321 0.053301793 +3005 2.28425675999996 0.00851367160253136 0.053099338 +3006 2.28501691199996 0.00847338484651708 0.052897597 +3007 2.28577706399996 0.00843325117388126 0.052696567 +3008 2.28653721599996 0.00839327004515724 0.052496245 +3009 2.28729736799996 0.00835344092271363 0.052296629 +3010 2.28805751999996 0.00831376327074806 0.052097717 +3011 2.28881767199996 0.00827423655528129 0.051899506 +3012 2.28957782399995 0.00823486024415093 0.051701994 +3013 2.29033797599995 0.00819563380700546 0.051505178 +3014 2.29109812799995 0.00815655671529831 0.051309057 +3015 2.29185827999995 0.00811762844228164 0.051113627 +3016 2.29261843199995 0.00807884846300044 0.050918887 +3017 2.29337858399995 0.00804021625428658 0.050724834 +3018 2.29413873599995 0.00800173129475284 0.050531466 +3019 2.29489888799995 0.0079633930647869 0.05033878 +3020 2.29565903999995 0.00792520104654549 0.050146774 +3021 2.29641919199995 0.00788715472394852 0.049955446 +3022 2.29717934399995 0.00784925358267307 0.049764793 +3023 2.29793949599995 0.00781149711014771 0.049574813 +3024 2.29869964799995 0.0077738847955465 0.049385505 +3025 2.29945979999995 0.0077364161297832 0.049196865 +3026 2.30021995199995 0.00769909060550554 0.049008891 +3027 2.30098010399995 0.00766190771708941 0.048821581 +3028 2.30174025599995 0.00762486696063301 0.048634933 +3029 2.30250040799995 0.00758796783395123 0.048448944 +3030 2.30326055999995 0.00755120983656981 0.048263613 +3031 2.30402071199995 0.00751459246971972 0.048078937 +3032 2.30478086399995 0.00747811523633142 0.047894914 +3033 2.30554101599995 0.00744177764102915 0.047711541 +3034 2.30630116799995 0.00740557919012543 0.047528816 +3035 2.30706131999995 0.00736951939161518 0.047346738 +3036 2.30782147199995 0.0073335977551704 0.047165303 +3037 2.30858162399995 0.00729781379213432 0.046984511 +3038 2.30934177599995 0.00726216701551598 0.046804358 +3039 2.31010192799995 0.00722665693998451 0.046624842 +3040 2.31086207999995 0.00719128308186387 0.046445961 +3041 2.31162223199995 0.00715604495912689 0.046267714 +3042 2.31238238399995 0.00712094209139028 0.046090097 +3043 2.31314253599995 0.00708597399990869 0.045913109 +3044 2.31390268799995 0.00705114020756954 0.045736748 +3045 2.31466283999995 0.0070164402388874 0.045561011 +3046 2.31542299199995 0.00698187361999865 0.045385897 +3047 2.31618314399995 0.00694743987865597 0.045211402 +3048 2.31694329599995 0.00691313854422314 0.045037526 +3049 2.31770344799995 0.00687896914766933 0.044864266 +3050 2.31846359999995 0.00684493122156406 0.044691619 +3051 2.31922375199995 0.00681102430007171 0.044519585 +3052 2.31998390399995 0.00677724791894615 0.04434816 +3053 2.32074405599995 0.00674360161552553 0.044177342 +3054 2.32150420799995 0.00671008492872697 0.04400713 +3055 2.32226435999995 0.00667669739904117 0.043837522 +3056 2.32302451199995 0.00664343856852732 0.043668515 +3057 2.32378466399995 0.00661030798080774 0.043500108 +3058 2.32454481599995 0.0065773051810627 0.043332297 +3059 2.32530496799995 0.00654442971602523 0.043165082 +3060 2.32606511999994 0.0065116811339759 0.04299846 +3061 2.32682527199994 0.00647905898473767 0.04283243 +3062 2.32758542399994 0.00644656281967072 0.042666988 +3063 2.32834557599994 0.00641419219166728 0.042502134 +3064 2.32910572799994 0.00638194665514666 0.042337865 +3065 2.32986587999994 0.00634982576604986 0.042174179 +3066 2.33062603199994 0.00631782908183482 0.042011074 +3067 2.33138618399994 0.00628595616147106 0.041848549 +3068 2.33214633599994 0.00625420656543486 0.041686601 +3069 2.33290648799994 0.006222579855704 0.041525228 +3070 2.33366663999994 0.00619107559575298 0.041364428 +3071 2.33442679199994 0.0061596933505478 0.041204199 +3072 2.33518694399994 0.00612843268654107 0.04104454 +3073 2.33594709599994 0.00609729317166703 0.040885449 +3074 2.33670724799994 0.00606627437533667 0.040726923 +3075 2.33746739999994 0.00603537586843261 0.04056896 +3076 2.33822755199994 0.00600459722330433 0.040411559 +3077 2.33898770399994 0.00597393801376325 0.040254718 +3078 2.33974785599994 0.00594339781507779 0.040098434 +3079 2.34050800799994 0.00591297620396846 0.039942707 +3080 2.34126815999994 0.00588267275860316 0.039787533 +3081 2.34202831199994 0.00585248705859217 0.039632911 +3082 2.34278846399994 0.00582241868498338 0.03947884 +3083 2.34354861599994 0.0057924672202575 0.039325317 +3084 2.34430876799994 0.0057626322483233 0.03917234 +3085 2.34506891999994 0.00573291335451276 0.039019908 +3086 2.34582907199994 0.0057033101255763 0.038868019 +3087 2.34658922399994 0.00567382214967813 0.038716671 +3088 2.34734937599994 0.00564444901639144 0.038565861 +3089 2.34810952799994 0.00561519031669367 0.038415589 +3090 2.34886967999994 0.00558604564296185 0.038265852 +3091 2.34962983199994 0.00555701458896794 0.038116648 +3092 2.35038998399994 0.00552809674987412 0.037967977 +3093 2.35115013599994 0.00549929172222812 0.037819835 +3094 2.35191028799994 0.00547059910395861 0.037672221 +3095 2.35267043999994 0.00544201849437061 0.037525133 +3096 2.35343059199994 0.00541354949414083 0.03737857 +3097 2.35419074399994 0.00538519170531308 0.037232529 +3098 2.35495089599994 0.00535694473129367 0.037087009 +3099 2.35571104799994 0.00532880817684697 0.036942008 +3100 2.35647119999994 0.00530078164809067 0.036797525 +3101 2.35723135199994 0.00527286475249147 0.036653557 +3102 2.35799150399994 0.00524505709886037 0.036510103 +3103 2.35875165599994 0.00521735829734823 0.03636716 +3104 2.35951180799994 0.00518976795944136 0.036224728 +3105 2.36027195999994 0.00516228569795696 0.036082805 +3106 2.36103211199994 0.00513491112703865 0.035941388 +3107 2.36179226399994 0.00510764386215208 0.035800476 +3108 2.36255241599993 0.0050804835200805 0.035660067 +3109 2.36331256799993 0.0050534297189203 0.03552016 +3110 2.36407271999993 0.00502648207807668 0.035380753 +3111 2.36483287199993 0.00499964021825918 0.035241844 +3112 2.36559302399993 0.00497290376147736 0.035103431 +3113 2.36635317599993 0.00494627233103646 0.034965513 +3114 2.36711332799993 0.00491974555153303 0.034828088 +3115 2.36787347999993 0.00489332304885057 0.034691155 +3116 2.36863363199993 0.00486700445015533 0.034554711 +3117 2.36939378399993 0.00484078938389182 0.034418755 +3118 2.37015393599993 0.00481467747977876 0.034283285 +3119 2.37091408799993 0.00478866836880462 0.0341483 +3120 2.37167423999993 0.00476276168322343 0.034013797 +3121 2.37243439199993 0.00473695705655061 0.033879776 +3122 2.37319454399993 0.00471125412355857 0.033746235 +3123 2.37395469599993 0.00468565252027269 0.033613172 +3124 2.37471484799993 0.00466015188396693 0.033480585 +3125 2.37547499999993 0.00463475185315985 0.033348473 +3126 2.37623515199993 0.00460945206761024 0.033216834 +3127 2.37699530399993 0.00458425216831307 0.033085666 +3128 2.37775545599993 0.00455915179749536 0.032954968 +3129 2.37851560799993 0.00453415059861199 0.032824738 +3130 2.37927575999993 0.00450924821634154 0.032694975 +3131 2.38003591199993 0.00448444429658233 0.032565678 +3132 2.38079606399993 0.00445973848644822 0.032436843 +3133 2.38155621599993 0.00443513043426455 0.03230847 +3134 2.38231636799993 0.00441061978956408 0.032180558 +3135 2.38307651999993 0.00438620620308298 0.032053104 +3136 2.38383667199993 0.00436188932675669 0.031926108 +3137 2.38459682399993 0.00433766881371605 0.031799567 +3138 2.38535697599993 0.00431354431828311 0.03167348 +3139 2.38611712799993 0.00428951549596731 0.031547845 +3140 2.38687727999993 0.00426558200346135 0.031422661 +3141 2.38763743199993 0.00424174349863731 0.031297927 +3142 2.38839758399993 0.00421799964054265 0.03117364 +3143 2.38915773599993 0.0041943500893963 0.031049799 +3144 2.38991788799993 0.00417079450658466 0.030926403 +3145 2.39067803999993 0.00414733255465777 0.030803451 +3146 2.39143819199993 0.00412396389732535 0.03068094 +3147 2.39219834399993 0.00410068819945289 0.030558869 +3148 2.39295849599993 0.00407750512705784 0.030437236 +3149 2.39371864799993 0.00405441434730568 0.030316041 +3150 2.39447879999993 0.0040314155285061 0.030195281 +3151 2.39523895199993 0.00400850834010909 0.030074956 +3152 2.39599910399993 0.00398569245270125 0.029955063 +3153 2.39675925599993 0.00396296753800184 0.029835601 +3154 2.39751940799993 0.00394033326885902 0.029716569 +3155 2.39827955999993 0.00391778931924607 0.029597965 +3156 2.39903971199992 0.00389533536425762 0.029479788 +3157 2.39979986399992 0.00387297108010587 0.029362036 +3158 2.40056001599992 0.00385069614411683 0.029244707 +3159 2.40132016799992 0.00382851023472656 0.029127801 +3160 2.40208031999992 0.0038064130314775 0.029011316 +3161 2.40284047199992 0.00378440421501471 0.02889525 +3162 2.40360062399992 0.00376248346708219 0.028779602 +3163 2.40436077599992 0.00374065047051911 0.028664371 +3164 2.40512092799992 0.00371890490925625 0.028549555 +3165 2.40588107999992 0.00369724646831227 0.028435152 +3166 2.40664123199992 0.00367567483379006 0.028321162 +3167 2.40740138399992 0.00365418969287306 0.028207582 +3168 2.40816153599992 0.00363279073382172 0.028094412 +3169 2.40892168799992 0.00361147764596977 0.02798165 +3170 2.40968183999992 0.00359025011972075 0.027869294 +3171 2.41044199199992 0.00356910784654418 0.027757344 +3172 2.41120214399992 0.0035480505189723 0.027645797 +3173 2.41196229599992 0.00352707783059623 0.027534653 +3174 2.41272244799992 0.00350618947606252 0.02742391 +3175 2.41348259999992 0.00348538515106964 0.027313566 +3176 2.41424275199992 0.00346466455236431 0.027203621 +3177 2.41500290399992 0.0034440273777381 0.027094072 +3178 2.41576305599992 0.00342347332602392 0.026984919 +3179 2.41652320799992 0.00340300209709239 0.02687616 +3180 2.41728335999992 0.00338261339184847 0.026767794 +3181 2.41804351199992 0.00336230691222795 0.02665982 +3182 2.41880366399992 0.00334208236119399 0.026552235 +3183 2.41956381599992 0.00332193944273364 0.02644504 +3184 2.42032396799992 0.00330187786185439 0.026338231 +3185 2.42108411999992 0.0032818973245808 0.026231809 +3186 2.42184427199992 0.003261997537951 0.026125771 +3187 2.42260442399992 0.00324217821001332 0.026020117 +3188 2.42336457599992 0.00322243904982292 0.025914845 +3189 2.42412472799992 0.00320277976743834 0.025809954 +3190 2.42488487999992 0.00318320007391815 0.025705442 +3191 2.42564503199992 0.00316369968131759 0.025601308 +3192 2.42640518399992 0.00314427830268527 0.025497551 +3193 2.42716533599992 0.00312493565205972 0.02539417 +3194 2.42792548799992 0.0031056714444661 0.025291163 +3195 2.42868563999992 0.00308648539591293 0.025188529 +3196 2.42944579199992 0.00306737722338873 0.025086266 +3197 2.43020594399992 0.00304834664485873 0.024984374 +3198 2.43096609599992 0.00302939337926159 0.024882851 +3199 2.43172624799992 0.00301051714650612 0.024781696 +3200 2.43248639999992 0.00299171766746799 0.024680908 +3201 2.43324655199992 0.00297299466398656 0.024580484 +3202 2.43400670399992 0.00295434785886151 0.024480425 +3203 2.43476685599992 0.00293577697584968 0.024380729 +3204 2.43552700799991 0.00291728173966188 0.024281394 +3205 2.43628715999991 0.00289886187595959 0.024182419 +3206 2.43704731199991 0.00288051711135184 0.024083803 +3207 2.43780746399991 0.00286224717339194 0.023985546 +3208 2.43856761599991 0.00284405179057441 0.023887644 +3209 2.43932776799991 0.00282593069233167 0.023790098 +3210 2.44008791999991 0.00280788360903102 0.023692906 +3211 2.44084807199991 0.00278991027197136 0.023596067 +3212 2.44160822399991 0.00277201041338017 0.02349958 +3213 2.44236837599991 0.00275418376641032 0.023403443 +3214 2.44312852799991 0.00273643006513694 0.023307655 +3215 2.44388867999991 0.00271874904455434 0.023212216 +3216 2.44464883199991 0.00270114044057296 0.023117123 +3217 2.44540898399991 0.00268360399001613 0.023022376 +3218 2.44616913599991 0.0026661394306172 0.022927973 +3219 2.44692928799991 0.00264874650101628 0.022833913 +3220 2.44768943999991 0.00263142494075734 0.022740196 +3221 2.44844959199991 0.00261417449028505 0.022646819 +3222 2.44920974399991 0.00259699489094183 0.022553782 +3223 2.44996989599991 0.00257988588496476 0.022461084 +3224 2.45073004799991 0.00256284721548258 0.022368723 +3225 2.45149019999991 0.00254587862651274 0.022276698 +3226 2.45225035199991 0.0025289798629583 0.022185008 +3227 2.45301050399991 0.00251215067060504 0.022093652 +3228 2.45377065599991 0.00249539079611842 0.022002628 +3229 2.45453080799991 0.00247869998704067 0.021911936 +3230 2.45529095999991 0.00246207799178776 0.021821575 +3231 2.45605111199991 0.00244552455964657 0.021731543 +3232 2.45681126399991 0.00242903944077181 0.021641838 +3233 2.45757141599991 0.0024126223861832 0.021552461 +3234 2.45833156799991 0.00239627314776252 0.02146341 +3235 2.45909171999991 0.00237999147825065 0.021374683 +3236 2.45985187199991 0.00236377713124478 0.02128628 +3237 2.46061202399991 0.00234762986119545 0.0211982 +3238 2.46137217599991 0.00233154942340366 0.021110441 +3239 2.46213232799991 0.00231553557401805 0.021023002 +3240 2.46289247999991 0.00229958807003201 0.020935882 +3241 2.46365263199991 0.00228370666928083 0.02084908 +3242 2.46441278399991 0.00226789113043888 0.020762595 +3243 2.46517293599991 0.00225214121301674 0.020676426 +3244 2.46593308799991 0.00223645667735842 0.020590572 +3245 2.46669323999991 0.00222083728463854 0.020505031 +3246 2.46745339199991 0.00220528279685947 0.020419803 +3247 2.46821354399991 0.00218979297684864 0.020334886 +3248 2.46897369599991 0.00217436758825569 0.02025028 +3249 2.46973384799991 0.00215900639554965 0.020165983 +3250 2.47049399999991 0.0021437091640163 0.020081994 +3251 2.47125415199991 0.00212847565975529 0.019998312 +3252 2.4720143039999 0.00211330564967745 0.019914937 +3253 2.4727744559999 0.00209819890150207 0.019831866 +3254 2.4735346079999 0.00208315518375411 0.0197491 +3255 2.4742947599999 0.00206817426576154 0.019666636 +3256 2.4750549119999 0.00205325591765258 0.019584475 +3257 2.4758150639999 0.00203839991035307 0.019502614 +3258 2.4765752159999 0.00202360601558365 0.019421053 +3259 2.4773353679999 0.00200887400585722 0.019339791 +3260 2.4780955199999 0.00199420365447617 0.019258826 +3261 2.4788556719999 0.00197959473552972 0.019178158 +3262 2.4796158239999 0.00196504702389132 0.019097786 +3263 2.4803759759999 0.00195056029521595 0.019017708 +3264 2.4811361279999 0.00193613432593748 0.018937924 +3265 2.4818962799999 0.00192176889326607 0.018858433 +3266 2.4826564319999 0.00190746377518551 0.018779233 +3267 2.4834165839999 0.00189321875045066 0.018700323 +3268 2.4841767359999 0.00187903359858476 0.018621704 +3269 2.4849368879999 0.00186490809987693 0.018543372 +3270 2.4856970399999 0.0018508420353795 0.018465329 +3271 2.4864571919999 0.0018368351869055 0.018387571 +3272 2.4872173439999 0.00182288733702602 0.0183101 +3273 2.4879774959999 0.00180899826906771 0.018232913 +3274 2.4887376479999 0.00179516776711019 0.018156009 +3275 2.4894977999999 0.00178139561598351 0.018079388 +3276 2.4902579519999 0.00176768160126563 0.018003049 +3277 2.4910181039999 0.00175402550927985 0.01792699 +3278 2.4917782559999 0.00174042712709236 0.017851211 +3279 2.4925384079999 0.00172688624250965 0.01777571 +3280 2.4932985599999 0.00171340264407608 0.017700487 +3281 2.4940587119999 0.0016999761210713 0.017625541 +3282 2.4948188639999 0.00168660646350787 0.017550871 +3283 2.4955790159999 0.00167329346212869 0.017476475 +3284 2.4963391679999 0.00166003690840455 0.017402353 +3285 2.4970993199999 0.00164683659453173 0.017328505 +3286 2.4978594719999 0.00163369231342946 0.017254928 +3287 2.4986196239999 0.00162060385873751 0.017181622 +3288 2.4993797759999 0.00160757102481379 0.017108586 +3289 2.5001399279999 0.00159459360673185 0.01703582 +3290 2.5009000799999 0.00158167140027853 0.016963321 +3291 2.5016602319999 0.0015688042019515 0.01689109 +3292 2.5024203839999 0.00155599180895681 0.016819125 +3293 2.5031805359999 0.00154323401920665 0.016747425 +3294 2.5039406879999 0.00153053063131679 0.01667599 +3295 2.5047008399999 0.00151788144460428 0.016604819 +3296 2.5054609919999 0.0015052862590851 0.01653391 +3297 2.5062211439999 0.00149274487547172 0.016463263 +3298 2.5069812959999 0.00148025709517079 0.016392876 +3299 2.5077414479999 0.00146782272028082 0.01632275 +3300 2.50850159999989 0.00145544155358974 0.016252882 +3301 2.50926175199989 0.00144311339857268 0.016183273 +3302 2.51002190399989 0.00143083805938955 0.01611392 +3303 2.51078205599989 0.00141861534088281 0.016044824 +3304 2.51154220799989 0.00140644504857508 0.015975984 +3305 2.51230235999989 0.00139432698866687 0.015907398 +3306 2.51306251199989 0.00138226096803428 0.015839065 +3307 2.51382266399989 0.00137024679422675 0.015770986 +3308 2.51458281599989 0.00135828427546467 0.015703158 +3309 2.51534296799989 0.00134637322063726 0.015635581 +3310 2.51610311999989 0.00133451343930019 0.015568254 +3311 2.51686327199989 0.00132270474167337 0.015501177 +3312 2.51762342399989 0.00131094693863868 0.015434347 +3313 2.51838357599989 0.00129923984173773 0.015367766 +3314 2.51914372799989 0.00128758326316967 0.01530143 +3315 2.51990387999989 0.00127597701578891 0.015235341 +3316 2.52066403199989 0.00126442091310285 0.015169497 +3317 2.52142418399989 0.00125291476926982 0.015103896 +3318 2.52218433599989 0.00124145839909674 0.015038539 +3319 2.52294448799989 0.00123005161803699 0.014973424 +3320 2.52370463999989 0.00121869424218818 0.014908551 +3321 2.52446479199989 0.00120738608828997 0.014843918 +3322 2.52522494399989 0.00119612697372195 0.014779526 +3323 2.52598509599989 0.00118491671650139 0.014715372 +3324 2.52674524799989 0.00117375513528113 0.014651456 +3325 2.52750539999989 0.00116264204934742 0.014587778 +3326 2.52826555199989 0.00115157727861776 0.014524336 +3327 2.52902570399989 0.00114056064363874 0.01446113 +3328 2.52978585599989 0.00112959196558399 0.014398158 +3329 2.53054600799989 0.00111867106625191 0.014335421 +3330 2.53130615999989 0.00110779776806372 0.014272917 +3331 2.53206631199989 0.00109697189406123 0.014210645 +3332 2.53282646399989 0.00108619326790476 0.014148605 +3333 2.53358661599989 0.00107546171387106 0.014086795 +3334 2.53434676799989 0.00106477705685121 0.014025216 +3335 2.53510691999989 0.00105413912234854 0.013963865 +3336 2.53586707199989 0.00104354773647657 0.013902743 +3337 2.53662722399989 0.00103300272595688 0.013841849 +3338 2.53738737599989 0.00102250391811712 0.013781181 +3339 2.53814752799989 0.00101205114088891 0.01372074 +3340 2.53890767999989 0.00100164422280581 0.013660523 +3341 2.53966783199989 0.000991282993001247 0.013600531 +3342 2.54042798399989 0.00098096728120653 0.013540762 +3343 2.54118813599989 0.000970696917748788 0.013481217 +3344 2.54194828799989 0.000960471733548925 0.013421893 +3345 2.54270843999989 0.00095029156011967 0.013362791 +3346 2.54346859199989 0.000940156229563518 0.013303909 +3347 2.54422874399989 0.000930065574570717 0.013245246 +3348 2.54498889599988 0.00092001942841735 0.013186803 +3349 2.54574904799988 0.000910017624963226 0.013128578 +3350 2.54650919999988 0.000900059998650021 0.01307057 +3351 2.54726935199988 0.000890146384499225 0.013012779 +3352 2.54802950399988 0.000880276618110181 0.012955204 +3353 2.54878965599988 0.000870450535658167 0.012897844 +3354 2.54954980799988 0.000860667973892382 0.012840699 +3355 2.55030995999988 0.000850928770134042 0.012783767 +3356 2.55107011199988 0.000841232762274411 0.012727048 +3357 2.55183026399988 0.000831579788772884 0.012670541 +3358 2.55259041599988 0.000821969688655032 0.012614245 +3359 2.55335056799988 0.000812402301510702 0.01255816 +3360 2.55411071999988 0.000802877467492105 0.012502285 +3361 2.55487087199988 0.00079339502731186 0.012446619 +3362 2.55563102399988 0.00078395482224116 0.012391162 +3363 2.55639117599988 0.000774556694107809 0.012335912 +3364 2.55715132799988 0.000765200485294371 0.01228087 +3365 2.55791147999988 0.000755886038736273 0.012226033 +3366 2.55867163199988 0.000746613197919901 0.012171402 +3367 2.55943178399988 0.000737381806880799 0.012116976 +3368 2.56019193599988 0.000728191710201709 0.012062754 +3369 2.56095208799988 0.00071904275301078 0.012008736 +3370 2.56171223999988 0.000709934780979693 0.01195492 +3371 2.56247239199988 0.000700867640321803 0.011901306 +3372 2.56323254399988 0.000691841177790331 0.011847893 +3373 2.56399269599988 0.000682855240676444 0.011794681 +3374 2.56475284799988 0.000673909676807546 0.011741669 +3375 2.56551299999988 0.000665004334545373 0.011688856 +3376 2.56627315199988 0.000656139062784196 0.011636241 +3377 2.56703330399988 0.000647313710949008 0.011583824 +3378 2.56779345599988 0.000638528128993741 0.011531604 +3379 2.56855360799988 0.000629782167399422 0.01147958 +3380 2.56931375999988 0.000621075677172425 0.011427752 +3381 2.57007391199988 0.00061240850984267 0.011376119 +3382 2.57083406399988 0.000603780517461812 0.011324681 +3383 2.57159421599988 0.000595191552601525 0.011273436 +3384 2.57235436799988 0.000586641468351674 0.011222383 +3385 2.57311451999988 0.000578130118318594 0.011171523 +3386 2.57387467199988 0.00056965735662331 0.011120855 +3387 2.57463482399988 0.000561223037899798 0.011070378 +3388 2.57539497599988 0.000552827017293217 0.01102009 +3389 2.57615512799988 0.000544469150458201 0.010969993 +3390 2.57691527999988 0.000536149293557111 0.010920084 +3391 2.57767543199988 0.000527867303258293 0.010870363 +3392 2.57843558399988 0.000519623036734392 0.01082083 +3393 2.57919573599988 0.000511416351660573 0.010771484 +3394 2.57995588799988 0.000503247106212891 0.010722324 +3395 2.58071603999988 0.000495115159066521 0.01067335 +3396 2.58147619199987 0.00048702036939409 0.010624561 +3397 2.58223634399987 0.000478962596863969 0.010575956 +3398 2.58299649599987 0.000470941701638585 0.010527534 +3399 2.58375664799987 0.000462957544372758 0.010479296 +3400 2.58451679999987 0.000455009986212002 0.01043124 +3401 2.58527695199987 0.000447098888790874 0.010383365 +3402 2.58603710399987 0.000439224114231274 0.010335672 +3403 2.58679725599987 0.000431385525140832 0.010288159 +3404 2.58755740799987 0.000423582984611211 0.010240826 +3405 2.58831755999987 0.00041581635621648 0.010193672 +3406 2.58907771199987 0.00040808550401148 0.010146697 +3407 2.58983786399987 0.000400390292530156 0.010099899 +3408 2.59059801599987 0.000392730586783947 0.010053279 +3409 2.59135816799987 0.000385106252260154 0.010006835 +3410 2.59211831999987 0.000377517154920314 0.0099605678 +3411 2.59287847199987 0.000369963161198589 0.0099144756 +3412 2.59363862399987 0.000362444138000159 0.0098685582 +3413 2.59439877599987 0.000354959952699608 0.009822815 +3414 2.59515892799987 0.000347510473139316 0.0097772453 +3415 2.59591907999987 0.000340095567627891 0.0097318485 +3416 2.59667923199987 0.000332715104938554 0.0096866241 +3417 2.59743938399987 0.000325368954307569 0.0096415714 +3418 2.59819953599987 0.000318056985432669 0.0095966898 +3419 2.59895968799987 0.000310779068471447 0.0095519787 +3420 2.59971983999987 0.000303535074039848 0.0095074375 +3421 2.60047999199987 0.000296324873210557 0.0094630656 +3422 2.60124014399987 0.000289148337511446 0.0094188625 +3423 2.60200029599987 0.000282005338924049 0.0093748274 +3424 2.60276044799987 0.000274895749881994 0.0093309599 +3425 2.60352059999987 0.000267819443269461 0.0092872593 +3426 2.60428075199987 0.000260776292419657 0.009243725 +3427 2.60504090399987 0.00025376617111327 0.0092003565 +3428 2.60580105599987 0.000246788953576944 0.0091571532 +3429 2.60656120799987 0.000239844514481773 0.0091141144 +3430 2.60732135999987 0.000232932728941773 0.0090712397 +3431 2.60808151199987 0.000226053472512363 0.0090285283 +3432 2.60884166399987 0.000219206621188864 0.0089859798 +3433 2.60960181599987 0.000212392051405013 0.0089435936 +3434 2.61036196799987 0.000205609640031443 0.0089013691 +3435 2.61112211999987 0.00019885926437422 0.0088593057 +3436 2.61188227199987 0.000192140802173318 0.0088174028 +3437 2.61264242399987 0.000185454131601181 0.0087756599 +3438 2.61340257599987 0.00017879913126119 0.0087340765 +3439 2.61416272799987 0.000172175680186265 0.0086926519 +3440 2.61492287999987 0.000165583657837344 0.0086513856 +3441 2.61568303199987 0.000159022944101935 0.008610277 +3442 2.61644318399987 0.000152493419292655 0.0085693256 +3443 2.61720333599987 0.000145994964145814 0.0085285308 +3444 2.61796348799987 0.000139527459819906 0.0084878921 +3445 2.61872363999986 0.000133090787894224 0.0084474088 +3446 2.61948379199986 0.00012668483036738 0.0084070806 +3447 2.62024394399986 0.000120309469655895 0.0083669067 +3448 2.62100409599986 0.00011396458859278 0.0083268867 +3449 2.62176424799986 0.000107650070426092 0.0082870201 +3450 2.62252439999986 0.000101365798817519 0.0082473062 +3451 2.62328455199986 0.00009511165784098021 0.0082077445 +3452 2.62404470399986 0.00008888753198121271 0.0081683346 +3453 2.62480485599986 0.0000826933061323595 0.0081290758 +3454 2.62556500799986 0.00007652886559657511 0.0080899676 +3455 2.62632515999986 0.0000703940960826155 0.0080510095 +3456 2.62708531199986 0.00006428888370449721 0.0080122009 +3457 2.62784546399986 0.00005821311498004901 0.0079735414 +3458 2.62860561599986 0.000052166676829579106 0.0079350304 +3459 2.62936576799986 0.000046149456574465804 0.0078966673 +3460 2.63012591999986 0.000040161341935818605 0.0078584517 +3461 2.63088607199986 0.000034202221033089905 0.007820383 +3462 2.63164622399986 0.0000282719823827002 0.0077824607 +3463 2.63240637599986 0.000022370514896721503 0.0077446843 +3464 2.63316652799986 0.0000164977078814825 0.0077070532 +3465 2.63392667999986 0.000010653451036252 0.007669567 +3466 2.63468683199986 4.8376344518727105e-6 0.0076322252 +3467 2.63544698399986 -9.498513905653419e-7 0.0075950271 +3468 2.63620713599986 -6.709115621071889e-6 0.0075579723 +3469 2.63696728799986 -0.000012440266982064303 0.0075210604 +3470 2.63772743999986 -0.000018143413829729103 0.0074842907 +3471 2.63848759199986 -0.0000238186641353007 0.0074476629 +3472 2.63924774399986 -0.000029466125486422603 0.0074111763 +3473 2.64000789599986 -0.0000350859050884224 0.0073748305 +3474 2.64076804799986 -0.00004067810976564721 0.007338625 +3475 2.64152819999986 -0.000046242845962743604 0.0073025592 +3476 2.64228835199986 -0.00005178021974597401 0.0072666328 +3477 2.64304850399986 -0.00005729033680451981 0.0072308451 +3478 2.64380865599986 -0.00006277330245175581 0.0071951957 +3479 2.64456880799986 -0.0000682292216265222 0.0071596841 +3480 2.64532895999986 -0.00007365819889445721 0.0071243099 +3481 2.64608911199986 -0.00007906033844921541 0.0070890725 +3482 2.64684926399986 -0.00008443574411379172 0.0070539714 +3483 2.64760941599986 -0.00008978451934175091 0.0070190061 +3484 2.64836956799986 -0.0000951067672185198 0.0069841763 +3485 2.64912971999986 -0.000100402590462642 0.0069494813 +3486 2.64988987199986 -0.000105672091427028 0.0069149207 +3487 2.65065002399986 -0.000110915372100205 0.0068804941 +3488 2.65141017599986 -0.000116132534107582 0.0068462009 +3489 2.65217032799986 -0.000121323678712675 0.0068120407 +3490 2.65293047999986 -0.000126488906818353 0.006778013 +3491 2.65369063199986 -0.000131628318968081 0.0067441173 +3492 2.65445078399986 -0.000136742015347155 0.0067103532 +3493 2.65521093599985 -0.000141830095783892 0.0066767202 +3494 2.65597108799985 -0.000146892659750917 0.0066432178 +3495 2.65673123999985 -0.000151929806366321 0.0066098456 +3496 2.65749139199985 -0.000156941634394912 0.006576603 +3497 2.65825154399985 -0.000161928242249415 0.0065434897 +3498 2.65901169599985 -0.000166889727991675 0.0065105052 +3499 2.65977184799985 -0.000171826189333882 0.006477649 +3500 2.66053199999985 -0.000176737723639727 0.0064449206 +3501 2.66129215199985 -0.000181624427925644 0.0064123197 +3502 2.66205230399985 -0.000186486398861968 0.0063798456 +3503 2.66281245599985 -0.000191323732774135 0.0063474981 +3504 2.66357260799985 -0.000196136525643872 0.0063152766 +3505 2.66433275999985 -0.000200924873110347 0.0062831808 +3506 2.66509291199985 -0.000205688870471388 0.00625121 +3507 2.66585306399985 -0.000210428612684616 0.006219364 +3508 2.66661321599985 -0.000215144194368621 0.0061876422 +3509 2.66737336799985 -0.000219835709804137 0.0061560442 +3510 2.66813351999985 -0.000224503252935197 0.0061245695 +3511 2.66889367199985 -0.000229146917370286 0.0060932178 +3512 2.66965382399985 -0.000233766796383483 0.0060619886 +3513 2.67041397599985 -0.000238362982915628 0.0060308815 +3514 2.67117412799985 -0.000242935569575445 0.0059998959 +3515 2.67193427999985 -0.000247484648640697 0.0059690315 +3516 2.67269443199985 -0.000252010312059318 0.0059382879 +3517 2.67345458399985 -0.000256512651450538 0.0059076646 +3518 2.67421473599985 -0.000260991758106025 0.0058771611 +3519 2.67497488799985 -0.000265447722991003 0.0058467771 +3520 2.67573503999985 -0.00026988063674537 0.0058165122 +3521 2.67649519199985 -0.000274290589684811 0.0057863658 +3522 2.67725534399985 -0.000278677671801921 0.0057563376 +3523 2.67801549599985 -0.000283041972767319 0.0057264272 +3524 2.67877564799985 -0.000287383581930734 0.0056966341 +3525 2.67953579999985 -0.000291702588322129 0.0056669579 +3526 2.68029595199985 -0.00029599908065278 0.0056373982 +3527 2.68105610399985 -0.000300273147316388 0.0056079546 +3528 2.68181625599985 -0.000304524876390162 0.0055786266 +3529 2.68257640799985 -0.000308754355635901 0.0055494139 +3530 2.68333655999985 -0.000312961672501089 0.005520316 +3531 2.68409671199985 -0.000317146914119966 0.0054913325 +3532 2.68485686399985 -0.00032131016731461 0.0054624631 +3533 2.68561701599985 -0.000325451518596003 0.0054337072 +3534 2.68637716799985 -0.000329571054165108 0.0054050646 +3535 2.68713731999985 -0.000333668859913943 0.0053765347 +3536 2.68789747199985 -0.000337745021426615 0.0053481173 +3537 2.68865762399985 -0.000341799623980398 0.0053198118 +3538 2.68941777599985 -0.000345832752546794 0.0052916179 +3539 2.69017792799985 -0.000349844491792573 0.0052635351 +3540 2.69093807999985 -0.000353834926080812 0.0052355632 +3541 2.69169823199984 -0.000357804139471965 0.0052077016 +3542 2.69245838399984 -0.000361752215724879 0.0051799501 +3543 2.69321853599984 -0.000365679238297851 0.0051523081 +3544 2.69397868799984 -0.000369585290349646 0.0051247753 +3545 2.69473883999984 -0.000373470454740541 0.0050973514 +3546 2.69549899199984 -0.000377334814033331 0.0050700358 +3547 2.69625914399984 -0.00038117845049438 0.0050428283 +3548 2.69701929599984 -0.000385001446094625 0.0050157284 +3549 2.69777944799984 -0.000388803882510582 0.0049887358 +3550 2.69853959999984 -0.000392585841125388 0.0049618501 +3551 2.69929975199984 -0.000396347403029792 0.0049350708 +3552 2.70005990399984 -0.000400088649023152 0.0049083977 +3553 2.70082005599984 -0.000403809659614462 0.0048818302 +3554 2.70158020799984 -0.000407510515023338 0.0048553681 +3555 2.70234035999984 -0.000411191295181002 0.004829011 +3556 2.70310051199984 -0.000414852079731306 0.0048027584 +3557 2.70386066399984 -0.000418492948031694 0.0047766101 +3558 2.70462081599984 -0.000422113979154202 0.0047505656 +3559 2.70538096799984 -0.000425715251886436 0.0047246245 +3560 2.70614111999984 -0.00042929684473255 0.0046987866 +3561 2.70690127199984 -0.000432858835914224 0.0046730513 +3562 2.70766142399984 -0.000436401303371643 0.0046474184 +3563 2.70842157599984 -0.000439924324764452 0.0046218875 +3564 2.70918172799984 -0.000443427977472744 0.0045964582 +3565 2.70994187999984 -0.000446912338597998 0.0045711302 +3566 2.71070203199984 -0.000450377484964058 0.004545903 +3567 2.71146218399984 -0.000453823493118084 0.0045207763 +3568 2.71222233599984 -0.000457250439331507 0.0044957499 +3569 2.71298248799984 -0.000460658399600971 0.0044708231 +3570 2.71374263999984 -0.000464047449649284 0.0044459959 +3571 2.71450279199984 -0.000467417664926372 0.0044212677 +3572 2.71526294399984 -0.000470769120610206 0.0043966382 +3573 2.71602309599984 -0.000474101891607748 0.0043721071 +3574 2.71678324799984 -0.000477416052555873 0.004347674 +3575 2.71754339999984 -0.000480711677822333 0.0043233386 +3576 2.71830355199984 -0.000483988841506634 0.0042991005 +3577 2.71906370399984 -0.000487247617441008 0.0042749593 +3578 2.71982385599984 -0.000490488079191304 0.0042509147 +3579 2.72058400799984 -0.000493710300057919 0.0042269664 +3580 2.72134415999984 -0.000496914353076724 0.004203114 +3581 2.72210431199984 -0.000500100311019949 0.0041793571 +3582 2.72286446399984 -0.000503268246397117 0.0041556955 +3583 2.72362461599984 -0.000506418231455945 0.0041321287 +3584 2.72438476799984 -0.000509550338183243 0.0041086565 +3585 2.72514491999984 -0.00051266463830581 0.0040852784 +3586 2.72590507199984 -0.000515761203291336 0.0040619942 +3587 2.72666522399984 -0.00051884010434931 0.0040388035 +3588 2.72742537599984 -0.000521901412431887 0.004015706 +3589 2.72818552799983 -0.000524945198234791 0.0039927013 +3590 2.72894567999983 -0.000527971532198192 0.0039697891 +3591 2.72970583199983 -0.0005309804845076 0.0039469691 +3592 2.73046598399983 -0.000533972125094736 0.0039242409 +3593 2.73122613599983 -0.000536946523638406 0.0039016042 +3594 2.73198628799983 -0.000539903749565385 0.0038790587 +3595 2.73274643999983 -0.000542843872051265 0.003856604 +3596 2.73350659199983 -0.000545766960021355 0.0038342398 +3597 2.73426674399983 -0.000548673082151519 0.0038119658 +3598 2.73502689599983 -0.000551562306869048 0.0037897817 +3599 2.73578704799983 -0.000554434702353524 0.003767687 +3600 2.73654719999983 -0.000557290336537655 0.0037456816 +3601 2.73730735199983 -0.00056012927710816 0.0037237651 +3602 2.73806750399983 -0.000562951591506586 0.0037019371 +3603 2.73882765599983 -0.000565757346930181 0.0036801974 +3604 2.73958780799983 -0.000568546610332719 0.0036585456 +3605 2.74034795999983 -0.000571319448425365 0.0036369814 +3606 2.74110811199983 -0.000574075927677477 0.0036155045 +3607 2.74186826399983 -0.000576816114317483 0.0035941145 +3608 2.74262841599983 -0.000579540074333686 0.0035728112 +3609 2.74338856799983 -0.000582247873475107 0.0035515942 +3610 2.74414871999983 -0.000584939577252299 0.0035304633 +3611 2.74490887199983 -0.000587615250938197 0.0035094181 +3612 2.74566902399983 -0.000590274959568911 0.0034884582 +3613 2.74642917599983 -0.000592918767944556 0.0034675835 +3614 2.74718932799983 -0.00059554674063008 0.0034467935 +3615 2.74794947999983 -0.000598158941956061 0.0034260881 +3616 2.74870963199983 -0.000600755436019526 0.0034054668 +3617 2.74946978399983 -0.000603336286684758 0.0033849293 +3618 2.75022993599983 -0.000605901557584098 0.0033644754 +3619 2.75099008799983 -0.000608451312118753 0.0033441048 +3620 2.75175023999983 -0.000610985613459591 0.0033238171 +3621 2.75251039199983 -0.000613504524547942 0.0033036121 +3622 2.75327054399983 -0.000616008108096382 0.0032834894 +3623 2.75403069599983 -0.000618496426589548 0.0032634488 +3624 2.75479084799983 -0.000620969542284901 0.0032434899 +3625 2.75555099999983 -0.000623427517213533 0.0032236124 +3626 2.75631115199983 -0.000625870413180931 0.0032038162 +3627 2.75707130399983 -0.000628298291767778 0.0031841008 +3628 2.75783145599983 -0.000630711214330721 0.0031644659 +3629 2.75859160799983 -0.00063310924200314 0.0031449114 +3630 2.75935175999983 -0.000635492435695941 0.0031254368 +3631 2.76011191199983 -0.000637860856098306 0.0031060419 +3632 2.76087206399983 -0.000640214563678478 0.0030867265 +3633 2.76163221599983 -0.000642553618684511 0.0030674901 +3634 2.76239236799983 -0.000644878081145049 0.0030483326 +3635 2.76315251999983 -0.000647188010870071 0.0030292536 +3636 2.76391267199983 -0.000649483467451656 0.0030102528 +3637 2.76467282399982 -0.00065176451026474 0.00299133 +3638 2.76543297599982 -0.000654031198467867 0.0029724849 +3639 2.76619312799982 -0.000656283591003934 0.0029537172 +3640 2.76695327999982 -0.000658521746600949 0.0029350267 +3641 2.76771343199982 -0.000660745723772769 0.0029164129 +3642 2.76847358399982 -0.000662955580819833 0.0028978757 +3643 2.76923373599982 -0.000665151375829927 0.0028794148 +3644 2.76999388799982 -0.000667333166678899 0.0028610299 +3645 2.77075403999982 -0.000669501011031399 0.0028427207 +3646 2.77151419199982 -0.000671654966341622 0.002824487 +3647 2.77227434399982 -0.000673795089854022 0.0028063284 +3648 2.77303449599982 -0.000675921438604057 0.0027882447 +3649 2.77379464799982 -0.0006780340694189 0.0027702356 +3650 2.77455479999982 -0.000680133038918163 0.0027523009 +3651 2.77531495199982 -0.000682218403514627 0.0027344403 +3652 2.77607510399982 -0.000684290219414946 0.0027166534 +3653 2.77683525599982 -0.000686348542620379 0.0026989402 +3654 2.77759540799982 -0.000688393428927489 0.0026813001 +3655 2.77835555999982 -0.000690424933928853 0.0026637331 +3656 2.77911571199982 -0.000692443113013786 0.0026462388 +3657 2.77987586399982 -0.00069444802136903 0.002628817 +3658 2.78063601599982 -0.000696439713979462 0.0026114674 +3659 2.78139616799982 -0.0006984182456288 0.0025941897 +3660 2.78215631999982 -0.000700383670900294 0.0025769836 +3661 2.78291647199982 -0.00070233604417743 0.002559849 +3662 2.78367662399982 -0.000704275419644613 0.0025427856 +3663 2.78443677599982 -0.000706201851287872 0.002525793 +3664 2.78519692799982 -0.000708115392895545 0.0025088711 +3665 2.78595707999982 -0.000710016098058954 0.0024920195 +3666 2.78671723199982 -0.000711904020173106 0.0024752381 +3667 2.78747738399982 -0.000713779212437362 0.0024585265 +3668 2.78823753599982 -0.00071564172785613 0.0024418845 +3669 2.78899768799982 -0.00071749161923953 0.0024253119 +3670 2.78975783999982 -0.000719328939204075 0.0024088083 +3671 2.79051799199982 -0.000721153740173349 0.0023923736 +3672 2.79127814399982 -0.000722966074378666 0.0023760075 +3673 2.79203829599982 -0.000724765993859749 0.0023597097 +3674 2.79279844799982 -0.000726553550465388 0.00234348 +3675 2.79355859999982 -0.000728328795854109 0.0023273181 +3676 2.79431875199982 -0.000730091781494842 0.0023112238 +3677 2.79507890399982 -0.000731842558667566 0.0022951969 +3678 2.79583905599982 -0.000733581178463968 0.002279237 +3679 2.79659920799982 -0.000735307691788115 0.002263344 +3680 2.79735935999982 -0.000737022149357085 0.0022475175 +3681 2.79811951199982 -0.000738724601701639 0.0022317575 +3682 2.79887966399982 -0.000740415099166847 0.0022160635 +3683 2.79963981599982 -0.00074209369191275 0.0022004354 +3684 2.80039996799982 -0.000743760429914994 0.0021848729 +3685 2.80116011999981 -0.000745415362965486 0.0021693758 +3686 2.80192027199981 -0.000747058540673022 0.0021539439 +3687 2.80268042399981 -0.000748690012463915 0.0021385768 +3688 2.80344057599981 -0.000750309827582657 0.0021232744 +3689 2.80420072799981 -0.00075191803509253 0.0021080365 +3690 2.80496087999981 -0.000753514683876246 0.0020928627 +3691 2.80572103199981 -0.000755099822636573 0.0020777529 +3692 2.80648118399981 -0.000756673499896965 0.0020627068 +3693 2.80724133599981 -0.000758235764002183 0.0020477242 +3694 2.80800148799981 -0.00075978666311892 0.0020328048 +3695 2.80876163999981 -0.000761326245236413 0.0020179484 +3696 2.80952179199981 -0.000762854558167081 0.0020031548 +3697 2.81028194399981 -0.000764371649547116 0.0019884238 +3698 2.81104209599981 -0.000765877566837121 0.0019737551 +3699 2.81180224799981 -0.000767372357322703 0.0019591485 +3700 2.81256239999981 -0.000768856068115093 0.0019446037 +3701 2.81332255199981 -0.000770328746151751 0.0019301206 +3702 2.81408270399981 -0.000771790438196974 0.0019156989 +3703 2.81484285599981 -0.000773241190842497 0.0019013384 +3704 2.81560300799981 -0.00077468105050809 0.0018870388 +3705 2.81636315999981 -0.000776110063442177 0.0018727999 +3706 2.81712331199981 -0.000777528275722405 0.0018586216 +3707 2.81788346399981 -0.000778935733256265 0.0018445035 +3708 2.81864361599981 -0.000780332481781668 0.0018304455 +3709 2.81940376799981 -0.000781718566867549 0.0018164473 +3710 2.82016391999981 -0.00078309403391445 0.0018025088 +3711 2.82092407199981 -0.000784458928155102 0.0017886296 +3712 2.82168422399981 -0.000785813294655025 0.0017748096 +3713 2.82244437599981 -0.000787157178313112 0.0017610486 +3714 2.82320452799981 -0.000788490623862179 0.0017473463 +3715 2.82396467999981 -0.000789813675869589 0.0017337025 +3716 2.82472483199981 -0.000791126378737797 0.0017201171 +3717 2.82548498399981 -0.000792428776704945 0.0017065897 +3718 2.82624513599981 -0.000793720913845421 0.0016931202 +3719 2.82700528799981 -0.000795002834070444 0.0016797083 +3720 2.82776543999981 -0.000796274581128623 0.0016663539 +3721 2.82852559199981 -0.000797536198606537 0.0016530568 +3722 2.82928574399981 -0.000798787729929283 0.0016398166 +3723 2.83004589599981 -0.00080002921836106 0.0016266333 +3724 2.83080604799981 -0.000801260707005715 0.0016135065 +3725 2.83156619999981 -0.00080248223880732 0.0016004362 +3726 2.83232635199981 -0.000803693856550705 0.001587422 +3727 2.83308650399981 -0.000804895602862043 0.0015744638 +3728 2.83384665599981 -0.000806087520209387 0.0015615614 +3729 2.83460680799981 -0.000807269650903231 0.0015487145 +3730 2.83536695999981 -0.000808442037097047 0.001535923 +3731 2.83612711199981 -0.000809604720787856 0.0015231866 +3732 2.83688726399981 -0.000810757743816751 0.0015105052 +3733 2.8376474159998 -0.000811901147869465 0.0014978785 +3734 2.8384075679998 -0.000813034974476897 0.0014853063 +3735 2.8391677199998 -0.000814159265015663 0.0014727885 +3736 2.8399278719998 -0.000815274060708627 0.0014603248 +3737 2.8406880239998 -0.000816379402625454 0.001447915 +3738 2.8414481759998 -0.00081747533168313 0.001435559 +3739 2.8422083279998 -0.000818561888646501 0.0014232564 +3740 2.8429684799998 -0.000819639114128811 0.0014110072 +3741 2.8437286319998 -0.000820707048592229 0.0013988112 +3742 2.8444887839998 -0.000821765732348376 0.001386668 +3743 2.8452489359998 -0.00082281520555885 0.0013745776 +3744 2.8460090879998 -0.000823855508235761 0.0013625398 +3745 2.8467692399998 -0.000824886680242245 0.0013505543 +3746 2.8475293919998 -0.000825908761292984 0.0013386209 +3747 2.8482895439998 -0.000826921790954739 0.0013267395 +3748 2.8490496959998 -0.000827925808646851 0.0013149098 +3749 2.8498098479998 -0.000828920853641768 0.0013031318 +3750 2.8505699999998 -0.000829906965065566 0.001291405 +3751 2.8513301519998 -0.000830884181898437 0.0012797295 +3752 2.8520903039998 -0.000831852542975231 0.001268105 +3753 2.8528504559998 -0.000832812086985941 0.0012565313 +3754 2.8536106079998 -0.000833762852476223 0.0012450081 +3755 2.8543707599998 -0.000834704877847903 0.0012335355 +3756 2.8551309119998 -0.000835638201359464 0.001222113 +3757 2.8558910639998 -0.000836562861126579 0.0012107406 +3758 2.8566512159998 -0.000837478895122583 0.001199418 +3759 2.8574113679998 -0.000838386341178987 0.0011881452 +3760 2.8581715199998 -0.000839285236985967 0.0011769218 +3761 2.8589316719998 -0.000840175620092868 0.0011657477 +3762 2.8596918239998 -0.000841057527908694 0.0011546228 +3763 2.8604519759998 -0.000841930997702604 0.0011435467 +3764 2.8612121279998 -0.000842796066604387 0.0011325195 +3765 2.8619722799998 -0.000843652771604975 0.0011215408 +3766 2.8627324319998 -0.000844501149556914 0.0011106105 +3767 2.8634925839998 -0.000845341237174851 0.0010997284 +3768 2.8642527359998 -0.000846173071036024 0.0010888943 +3769 2.8650128879998 -0.000846996687580739 0.0010781081 +3770 2.8657730399998 -0.000847812123112852 0.0010673696 +3771 2.8665331919998 -0.000848619413800255 0.0010566785 +3772 2.8672933439998 -0.000849418595675337 0.0010460348 +3773 2.8680534959998 -0.000850209704635477 0.0010354382 +3774 2.8688136479998 -0.000850992776443505 0.0010248885 +3775 2.8695737999998 -0.000851767846728189 0.0010143856 +3776 2.8703339519998 -0.000852534950984688 0.0010039294 +3777 2.8710941039998 -0.000853294124575036 0.00099351955 +3778 2.8718542559998 -0.000854045402728604 0.00098315598 +3779 2.8726144079998 -0.000854788820542566 0.00097283849 +3780 2.8733745599998 -0.000855524412982363 0.00096256692 +3781 2.87413471199979 -0.000856252214882167 0.00095234109 +3782 2.87489486399979 -0.000856972260945344 0.00094216082 +3783 2.87565501599979 -0.000857684585744912 0.00093202595 +3784 2.87641516799979 -0.000858389223723998 0.0009219363 +3785 2.87717531999979 -0.000859086209196297 0.00091189172 +3786 2.87793547199979 -0.000859775576346528 0.00090189201 +3787 2.87869562399979 -0.000860457359230881 0.00089193703 +3788 2.87945577599979 -0.000861131591777476 0.00088202659 +3789 2.88021592799979 -0.000861798307786815 0.00087216054 +3790 2.88097607999979 -0.000862457540932226 0.0008623387 +3791 2.88173623199979 -0.000863109324760305 0.00085256091 +3792 2.88249638399979 -0.000863753692691378 0.000842827 +3793 2.88325653599979 -0.000864390678019927 0.00083313681 +3794 2.88401668799979 -0.000865020313915052 0.00082349017 +3795 2.88477683999979 -0.000865642633420895 0.00081388692 +3796 2.88553699199979 -0.000866257669457089 0.0008043269 +3797 2.88629714399979 -0.000866865454819192 0.00079480993 +3798 2.88705729599979 -0.000867466022179133 0.00078533587 +3799 2.88781744799979 -0.000868059404085632 0.00077590455 +3800 2.88857759999979 -0.000868645632964652 0.0007665158 +3801 2.88933775199979 -0.000869224741119814 0.00075716947 +3802 2.89009790399979 -0.000869796760732838 0.00074786539 +3803 2.89085805599979 -0.000870361723863973 0.00073860341 +3804 2.89161820799979 -0.000870919662452419 0.00072938337 +3805 2.89237835999979 -0.000871470608316762 0.00072020511 +3806 2.89313851199979 -0.000872014593155386 0.00071106846 +3807 2.89389866399979 -0.000872551648546913 0.00070197329 +3808 2.89465881599979 -0.000873081805950612 0.00069291942 +3809 2.89541896799979 -0.000873605096706823 0.0006839067 +3810 2.89617911999979 -0.000874121552037383 0.00067493497 +3811 2.89693927199979 -0.000874631203046035 0.00066600409 +3812 2.89769942399979 -0.00087513408071885 0.00065711389 +3813 2.89845957599979 -0.00087563021592464 0.00064826423 +3814 2.89921972799979 -0.000876119639415372 0.00063945494 +3815 2.89997987999979 -0.000876602381826581 0.00063068588 +3816 2.90074003199979 -0.000877078473677774 0.00062195689 +3817 2.90150018399979 -0.000877547945372852 0.00061326782 +3818 2.90226033599979 -0.000878010827200512 0.00060461852 +3819 2.90302048799979 -0.000878467149334647 0.00059600885 +3820 2.90378063999979 -0.000878916941834763 0.00058743864 +3821 2.90454079199979 -0.00087936023464637 0.00057890775 +3822 2.90530094399979 -0.000879797057601401 0.00057041603 +3823 2.90606109599979 -0.000880227440418593 0.00056196333 +3824 2.90682124799979 -0.000880651412703908 0.00055354951 +3825 2.90758139999979 -0.000881069003950911 0.00054517441 +3826 2.90834155199979 -0.000881480243541182 0.00053683789 +3827 2.90910170399979 -0.000881885160744705 0.0005285398 +3828 2.90986185599979 -0.000882283784720264 0.00052028 +3829 2.91062200799978 -0.000882676144515836 0.00051205834 +3830 2.91138215999978 -0.000883062269068978 0.00050387468 +3831 2.91214231199978 -0.000883442187207227 0.00049572887 +3832 2.91290246399978 -0.000883815927648478 0.00048762076 +3833 2.91366261599978 -0.000884183519001383 0.00047955022 +3834 2.91442276799978 -0.000884544989765726 0.0004715171 +3835 2.91518291999978 -0.000884900368332813 0.00046352126 +3836 2.91594307199978 -0.00088524968298586 0.00045556255 +3837 2.91670322399978 -0.000885592961900367 0.00044764084 +3838 2.91746337599978 -0.000885930233144504 0.00043975598 +3839 2.91822352799978 -0.000886261524679492 0.00043190784 +3840 2.91898367999978 -0.000886586864359978 0.00042409627 +3841 2.91974383199978 -0.00088690627993441 0.00041632113 +3842 2.92050398399978 -0.000887219799045422 0.00040858229 +3843 2.92126413599978 -0.000887527449230198 0.00040087961 +3844 2.92202428799978 -0.000887829257920853 0.00039321295 +3845 2.92278443999978 -0.0008881252524448 0.00038558216 +3846 2.92354459199978 -0.000888415460025124 0.00037798712 +3847 2.92430474399978 -0.00088869990778095 0.00037042769 +3848 2.92506489599978 -0.00088897862272781 0.00036290373 +3849 2.92582504799978 -0.000889251631778013 0.00035541511 +3850 2.92658519999978 -0.000889518961741009 0.00034796169 +3851 2.92734535199978 -0.000889780639323754 0.00034054333 +3852 2.92810550399978 -0.00089003669113107 0.00033315991 +3853 2.92886565599978 -0.000890287143666012 0.00032581128 +3854 2.92962580799978 -0.000890532023330226 0.00031849733 +3855 2.93038595999978 -0.000890771356424305 0.0003112179 +3856 2.93114611199978 -0.000891005169148158 0.00030397287 +3857 2.93190626399978 -0.000891233487601355 0.00029676212 +3858 2.93266641599978 -0.000891456337783488 0.0002895855 +3859 2.93342656799978 -0.000891673745594528 0.00028244289 +3860 2.93418671999978 -0.000891885736835172 0.00027533415 +3861 2.93494687199978 -0.000892092337207204 0.00026825916 +3862 2.93570702399978 -0.000892293572313835 0.00026121779 +3863 2.93646717599978 -0.000892489467660063 0.00025420991 +3864 2.93722732799978 -0.000892680048653016 0.00024723538 +3865 2.93798747999978 -0.000892865340602299 0.00024029409 +3866 2.93874763199978 -0.000893045368720344 0.0002333859 +3867 2.93950778399978 -0.000893220158122749 0.00022651069 +3868 2.94026793599978 -0.000893389733828631 0.00021966833 +3869 2.94102808799978 -0.000893554120760958 0.00021285869 +3870 2.94178823999978 -0.000893713343746898 0.00020608165 +3871 2.94254839199978 -0.000893867427518157 0.00019933708 +3872 2.94330854399978 -0.000894016396711314 0.00019262486 +3873 2.94406869599978 -0.000894160275868171 0.00018594487 +3874 2.94482884799978 -0.000894299089436073 0.00017929697 +3875 2.94558899999978 -0.000894432861768258 0.00017268105 +3876 2.94634915199978 -0.000894561617124183 0.00016609698 +3877 2.94710930399977 -0.000894685379669864 0.00015954464 +3878 2.94786945599977 -0.000894804173478196 0.00015302391 +3879 2.94862960799977 -0.000894918022529302 0.00014653466 +3880 2.94938975999977 -0.000895026950710848 0.00014007678 +3881 2.95014991199977 -0.000895130981818381 0.00013365014 +3882 2.95091006399977 -0.000895230139555646 0.00012725463 +3883 2.95167021599977 -0.000895324447534927 0.00012089011 +3884 2.95243036799977 -0.00089541392927736 0.00011455648 +3885 2.95319051999977 -0.000895498608213265 0.00010825362 +3886 2.95395067199977 -0.000895578507682464 0.00010198139 +3887 2.95471082399977 -0.000895653650934607 9.5739699e-05 +3888 2.95547097599977 -0.000895724061129494 8.9528412e-05 +3889 2.95623112799977 -0.000895789761337383 8.3347416e-05 +3890 2.95699127999977 -0.000895850774539331 7.7196594e-05 +3891 2.95775143199977 -0.000895907123627489 7.1075828e-05 +3892 2.95851158399977 -0.000895958831405434 6.4985004e-05 +3893 2.95927173599977 -0.000896005920588476 5.8924004e-05 +3894 2.96003188799977 -0.000896048413803977 5.2892713e-05 +3895 2.96079203999977 -0.000896086333591661 4.6891017e-05 +3896 2.96155219199977 -0.000896119702403932 4.0918799e-05 +3897 2.96231234399977 -0.000896148542606176 3.4975948e-05 +3898 2.96307249599977 -0.000896172876477081 2.9062347e-05 +3899 2.96383264799977 -0.000896192726208939 2.3177885e-05 +3900 2.96459279999977 -0.000896208113907958 1.7322447e-05 +3901 2.96535295199977 -0.000896219061594568 1.1495922e-05 +3902 2.96611310399977 -0.000896225591203724 5.6981963e-06 +3903 2.96687325599977 -0.000896227724585216 -7.0840934e-08 +3904 2.96763340799977 -0.000896225483503969 -5.8113015e-06 +3905 2.96839355999977 -0.000896218889640347 -1.1523296e-05 +3906 2.96915371199977 -0.000896207964590458 -1.7206936e-05 +3907 2.96991386399977 -0.000896192729866444 -2.2862331e-05 +3908 2.97067401599977 -0.000896173206896793 -2.8489591e-05 +3909 2.97143416799977 -0.000896149417026635 -3.4088826e-05 +3910 2.97219431999977 -0.000896121381518033 -3.9660145e-05 +3911 2.97295447199977 -0.000896089121550288 -4.5203655e-05 +3912 2.97371462399977 -0.000896052658220225 -5.0719466e-05 +3913 2.97447477599977 -0.000896012012542497 -5.6207686e-05 +3914 2.97523492799977 -0.000895967205449876 -6.1668422e-05 +3915 2.97599507999977 -0.000895918257793541 -6.7101781e-05 +3916 2.97675523199977 -0.000895865190343374 -7.250787e-05 +3917 2.97751538399977 -0.000895808023788251 -7.7886796e-05 +3918 2.97827553599977 -0.000895746778736325 -8.3238663e-05 +3919 2.97903568799977 -0.000895681475715326 -8.8563579e-05 +3920 2.97979583999977 -0.000895612135172836 -9.3861648e-05 +3921 2.98055599199977 -0.000895538777476585 -9.9132975e-05 +3922 2.98131614399977 -0.000895461422914734 -0.00010437766 +3923 2.98207629599977 -0.000895380091696154 -0.00010959582 +3924 2.98283644799977 -0.000895294803950719 -0.00011478755 +3925 2.98359659999976 -0.00089520557972958 -0.00011995295 +3926 2.98435675199976 -0.000895112439005455 -0.00012509212 +3927 2.98511690399976 -0.000895015401672902 -0.00013020518 +3928 2.98587705599976 -0.000894914487548603 -0.00013529222 +3929 2.98663720799976 -0.000894809716371644 -0.00014035334 +3930 2.98739735999976 -0.000894701107803786 -0.00014538865 +3931 2.98815751199976 -0.000894588681429752 -0.00015039824 +3932 2.98891766399976 -0.000894472456757492 -0.00015538222 +3933 2.98967781599976 -0.000894352453218469 -0.00016034069 +3934 2.99043796799976 -0.000894228690167922 -0.00016527374 +3935 2.99119811999976 -0.000894101186885151 -0.00017018149 +3936 2.99195827199976 -0.000893969962573775 -0.00017506402 +3937 2.99271842399976 -0.000893835036362015 -0.00017992143 +3938 2.99347857599976 -0.000893696427302963 -0.00018475383 +3939 2.99423872799976 -0.000893554154374844 -0.00018956131 +3940 2.99499887999976 -0.000893408236481289 -0.00019434398 +3941 2.99575903199976 -0.000893258692451607 -0.00019910192 +3942 2.99651918399976 -0.000893105541041039 -0.00020383523 +3943 2.99727933599976 -0.000892948800931039 -0.00020854402 +3944 2.99803948799976 -0.00089278849072953 -0.00021322838 +3945 2.99879963999976 -0.000892624628971165 -0.0002178884 +3946 2.99955979199976 -0.0008924572341176 -0.00022252419 +3947 3.00031994399976 -0.000892286324557744 -0.00022713583 +3948 3.00108009599976 -0.000892111918608032 -0.00023172342 +3949 3.00184024799976 -0.000891934034512673 -0.00023628706 +3950 3.00260039999976 -0.000891752690443923 -0.00024082684 +3951 3.00336055199976 -0.000891567904502333 -0.00024534286 +3952 3.00412070399976 -0.000891379694717006 -0.0002498352 +3953 3.00488085599976 -0.000891188079045862 -0.00025430397 +3954 3.00564100799976 -0.000890993075375889 -0.00025874925 +3955 3.00640115999976 -0.000890794701523397 -0.00026317114 +3956 3.00716131199976 -0.00089059297523427 -0.00026756974 +3957 3.00792146399976 -0.000890387914184229 -0.00027194512 +3958 3.00868161599976 -0.000890179535979069 -0.00027629739 +3959 3.00944176799976 -0.000889967858154927 -0.00028062664 +3960 3.01020191999976 -0.000889752898178518 -0.00028493295 +3961 3.01096207199976 -0.000889534673447395 -0.00028921643 +3962 3.01172222399976 -0.000889313201290189 -0.00029347715 +3963 3.01248237599976 -0.00088908849896687 -0.00029771521 +3964 3.01324252799976 -0.000888860583668975 -0.0003019307 +3965 3.01400267999976 -0.000888629472519874 -0.00030612371 +3966 3.01476283199976 -0.000888395182575002 -0.00031029432 +3967 3.01552298399976 -0.00088815773082211 -0.00031444263 +3968 3.01628313599976 -0.000887917134181503 -0.00031856873 +3969 3.01704328799976 -0.000887673409506291 -0.0003226727 +3970 3.01780343999976 -0.000887426573582625 -0.00032675463 +3971 3.01856359199976 -0.000887176643129938 -0.00033081461 +3972 3.01932374399976 -0.000886923634801189 -0.00033485273 +3973 3.02008389599975 -0.0008866675651831 -0.00033886907 +3974 3.02084404799975 -0.000886408450796394 -0.00034286372 +3975 3.02160419999975 -0.000886146308096035 -0.00034683677 +3976 3.02236435199975 -0.000885881153471467 -0.0003507883 +3977 3.02312450399975 -0.000885613003246843 -0.00035471839 +3978 3.02388465599975 -0.000885341873681267 -0.00035862714 +3979 3.02464480799975 -0.000885067780969026 -0.00036251463 +3980 3.02540495999975 -0.000884790741239825 -0.00036638094 +3981 3.02616511199975 -0.000884510770559018 -0.00037022616 +3982 3.02692526399975 -0.000884227884927842 -0.00037405037 +3983 3.02768541599975 -0.000883942100283649 -0.00037785366 +3984 3.02844556799975 -0.000883653432500134 -0.0003816361 +3985 3.02920571999975 -0.000883361897387565 -0.00038539779 +3986 3.02996587199975 -0.000883067510693017 -0.00038913881 +3987 3.03072602399975 -0.000882770288100592 -0.00039285923 +3988 3.03148617599975 -0.000882470245231654 -0.00039655915 +3989 3.03224632799975 -0.00088216739764505 -0.00040023863 +3990 3.03300647999975 -0.000881861760837343 -0.00040389777 +3991 3.03376663199975 -0.000881553350243027 -0.00040753665 +3992 3.03452678399975 -0.000881242181234758 -0.00041115535 +3993 3.03528693599975 -0.000880928269123578 -0.00041475394 +3994 3.03604708799975 -0.000880611629159133 -0.00041833251 +3995 3.03680723999975 -0.000880292276529904 -0.00042189115 +3996 3.03756739199975 -0.000879970226363413 -0.00042542992 +3997 3.03832754399975 -0.00087964549372646 -0.00042894891 +3998 3.03908769599975 -0.000879318093625332 -0.00043244819 +3999 3.03984784799975 -0.000878988041006026 -0.00043592786 +4000 3.04060799999975 -0.000878655350754466 -0.00043938798 +4001 3.04136815199975 -0.000878320037696721 -0.00044282864 +4002 3.04212830399975 -0.000877982116599223 -0.00044624991 +4003 3.04288845599975 -0.000877641602168978 -0.00044965188 +4004 3.04364860799975 -0.000877298509053785 -0.00045303461 +4005 3.04440875999975 -0.000876952851842454 -0.00045639819 +4006 3.04516891199975 -0.000876604645065011 -0.00045974269 +4007 3.04592906399975 -0.000876253903192916 -0.00046306819 +4008 3.04668921599975 -0.00087590064063928 -0.00046637477 +4009 3.04744936799975 -0.000875544871759064 -0.00046966251 +4010 3.04820951999975 -0.000875186610849301 -0.00047293147 +4011 3.04896967199975 -0.000874825872149301 -0.00047618174 +4012 3.04972982399975 -0.000874462669840863 -0.00047941339 +4013 3.05048997599975 -0.000874097018048479 -0.0004826265 +4014 3.05125012799975 -0.000873728930839545 -0.00048582114 +4015 3.05201027999975 -0.000873358422224571 -0.00048899739 +4016 3.05277043199975 -0.00087298550615738 -0.00049215531 +4017 3.05353058399975 -0.000872610196535322 -0.00049529499 +4018 3.05429073599975 -0.00087223250719947 -0.0004984165 +4019 3.05505088799975 -0.000871852451934834 -0.00050151991 +4020 3.05581103999975 -0.000871470044470556 -0.0005046053 +4021 3.05657119199974 -0.000871085298480119 -0.00050767273 +4022 3.05733134399974 -0.000870698227581547 -0.00051072229 +4023 3.05809149599974 -0.000870308845337601 -0.00051375404 +4024 3.05885164799974 -0.000869917165255992 -0.00051676806 +4025 3.05961179999974 -0.00086952320078957 -0.00051976442 +4026 3.06037195199974 -0.000869126965336527 -0.00052274318 +4027 3.06113210399974 -0.0008687284722406 -0.00052570443 +4028 3.06189225599974 -0.000868327734791258 -0.00052864823 +4029 3.06265240799974 -0.000867924766223915 -0.00053157465 +4030 3.06341255999974 -0.000867519579720109 -0.00053448377 +4031 3.06417271199974 -0.000867112188407714 -0.00053737566 +4032 3.06493286399974 -0.000866702605361124 -0.00054025038 +4033 3.06569301599974 -0.000866290843601454 -0.000543108 +4034 3.06645316799974 -0.00086587691609673 -0.0005459486 +4035 3.06721331999974 -0.000865460835762084 -0.00054877224 +4036 3.06797347199974 -0.000865042615459949 -0.000551579 +4037 3.06873362399974 -0.000864622268000243 -0.00055436894 +4038 3.06949377599974 -0.000864199806140572 -0.00055714213 +4039 3.07025392799974 -0.000863775242586409 -0.00055989864 +4040 3.07101407999974 -0.00086334858999129 -0.00056263854 +4041 3.07177423199974 -0.000862919860957006 -0.0005653619 +4042 3.07253438399974 -0.000862489068033784 -0.00056806878 +4043 3.07329453599974 -0.00086205622372048 -0.00057075925 +4044 3.07405468799974 -0.000861621340464765 -0.00057343338 +4045 3.07481483999974 -0.00086118443066331 -0.00057609123 +4046 3.07557499199974 -0.000860745506661977 -0.00057873288 +4047 3.07633514399974 -0.000860304580756001 -0.00058135838 +4048 3.07709529599974 -0.000859861665190171 -0.00058396781 +4049 3.07785544799974 -0.000859416772159022 -0.00058656123 +4050 3.07861559999974 -0.000858969913807011 -0.00058913871 +4051 3.07937575199974 -0.000858521102228706 -0.0005917003 +4052 3.08013590399974 -0.000858070349468963 -0.00059424609 +4053 3.08089605599974 -0.000857617667523111 -0.00059677613 +4054 3.08165620799974 -0.000857163068337132 -0.00059929048 +4055 3.08241635999974 -0.000856706563807838 -0.00060178922 +4056 3.08317651199974 -0.000856248165783058 -0.0006042724 +4057 3.08393666399974 -0.000855787886061807 -0.00060674009 +4058 3.08469681599974 -0.000855325736394476 -0.00060919236 +4059 3.08545696799974 -0.000854861728483 -0.00061162926 +4060 3.08621711999974 -0.000854395873981039 -0.00061405087 +4061 3.08697727199974 -0.000853928184494156 -0.00061645724 +4062 3.08773742399974 -0.00085345867157999 -0.00061884843 +4063 3.08849757599974 -0.000852987346748432 -0.00062122452 +4064 3.08925772799974 -0.000852514221461803 -0.00062358555 +4065 3.09001787999974 -0.000852039307135023 -0.00062593161 +4066 3.09077803199974 -0.000851562615135787 -0.00062826274 +4067 3.09153818399974 -0.000851084156784739 -0.000630579 +4068 3.09229833599974 -0.000850603943355645 -0.00063288047 +4069 3.09305848799973 -0.000850121986075557 -0.0006351672 +4070 3.09381863999973 -0.000849638296124995 -0.00063743925 +4071 3.09457879199973 -0.00084915288463811 -0.00063969668 +4072 3.09533894399973 -0.000848665762702858 -0.00064193956 +4073 3.09609909599973 -0.000848176941361167 -0.00064416794 +4074 3.09685924799973 -0.000847686431609104 -0.00064638188 +4075 3.09761939999973 -0.000847194244397049 -0.00064858145 +4076 3.09837955199973 -0.000846700390629857 -0.00065076671 +4077 3.09913970399973 -0.00084620488116703 -0.00065293771 +4078 3.09989985599973 -0.000845707726822873 -0.00065509451 +4079 3.10066000799973 -0.000845208938366676 -0.00065723717 +4080 3.10142015999973 -0.000844708526522865 -0.00065936576 +4081 3.10218031199973 -0.000844206501971174 -0.00066148032 +4082 3.10294046399973 -0.000843702875346807 -0.00066358092 +4083 3.10370061599973 -0.000843197657240603 -0.00066566762 +4084 3.10446076799973 -0.000842690858199193 -0.00066774048 +4085 3.10522091999973 -0.000842182488725173 -0.00066979954 +4086 3.10598107199973 -0.000841672559277256 -0.00067184488 +4087 3.10674122399973 -0.000841161080270437 -0.00067387654 +4088 3.10750137599973 -0.000840648062076158 -0.00067589459 +4089 3.10826152799973 -0.000840133515022458 -0.00067789908 +4090 3.10902167999973 -0.000839617449394144 -0.00067989007 +4091 3.10978183199973 -0.00083909987543294 -0.00068186761 +4092 3.11054198399973 -0.000838580803337652 -0.00068383177 +4093 3.11130213599973 -0.000838060243264325 -0.00068578259 +4094 3.11206228799973 -0.000837538205326396 -0.00068772013 +4095 3.11282243999973 -0.000837014699594858 -0.00068964446 +4096 3.11358259199973 -0.000836489736098409 -0.00069155562 +4097 3.11434274399973 -0.000835963324823613 -0.00069345367 +4098 3.11510289599973 -0.000835435475715052 -0.00069533866 +4099 3.11586304799973 -0.000834906198675485 -0.00069721066 +4100 3.11662319999973 -0.000834375503565993 -0.00069906971 +4101 3.11738335199973 -0.000833843400206143 -0.00070091586 +4102 3.11814350399973 -0.000833309898374136 -0.00070274919 +4103 3.11890365599973 -0.000832775007806959 -0.00070456973 +4104 3.11966380799973 -0.000832238738200539 -0.00070637754 +4105 3.12042395999973 -0.000831701099209892 -0.00070817268 +4106 3.12118411199973 -0.000831162100449277 -0.00070995519 +4107 3.12194426399973 -0.000830621751492344 -0.00071172514 +4108 3.12270441599973 -0.000830080061872285 -0.00071348257 +4109 3.12346456799973 -0.00082953704108198 -0.00071522755 +4110 3.12422471999973 -0.000828992698574154 -0.00071696011 +4111 3.12498487199973 -0.000828447043761513 -0.00071868031 +4112 3.12574502399973 -0.000827900086016908 -0.00072038822 +4113 3.12650517599973 -0.000827351834673463 -0.00072208387 +4114 3.12726532799973 -0.00082680229902474 -0.00072376732 +4115 3.12802547999973 -0.000826251488324872 -0.00072543862 +4116 3.12878563199973 -0.000825699411788714 -0.00072709783 +4117 3.12954578399972 -0.000825146078591991 -0.00072874499 +4118 3.13030593599972 -0.000824591497871438 -0.00073038015 +4119 3.13106608799972 -0.000824035678724943 -0.00073200338 +4120 3.13182623999972 -0.000823478630211697 -0.00073361471 +4121 3.13258639199972 -0.000822920361352334 -0.0007352142 +4122 3.13334654399972 -0.00082236088112907 -0.00073680189 +4123 3.13410669599972 -0.000821800198485852 -0.00073837785 +4124 3.13486684799972 -0.000821238322328494 -0.00073994212 +4125 3.13562699999972 -0.000820675261524823 -0.00074149474 +4126 3.13638715199972 -0.000820111024904813 -0.00074303578 +4127 3.13714730399972 -0.000819545621260734 -0.00074456527 +4128 3.13790745599972 -0.000818979059347284 -0.00074608327 +4129 3.13866760799972 -0.000818411347881732 -0.00074758983 +4130 3.13942775999972 -0.000817842495544057 -0.00074908499 +4131 3.14018791199972 -0.000817272510977087 -0.00075056881 +4132 3.14094806399972 -0.000816701402786629 -0.00075204133 +4133 3.14170821599972 -0.000816129179541619 -0.0007535026 +4134 3.14246836799972 -0.00081555584977425 -0.00075495267 +4135 3.14322851999972 -0.000814981421980109 -0.00075639159 +4136 3.14398867199972 -0.000814405904618316 -0.0007578194 +4137 3.14474882399972 -0.000813829306111659 -0.00075923616 +4138 3.14550897599972 -0.000813251634846725 -0.00076064191 +4139 3.14626912799972 -0.00081267289917404 -0.0007620367 +4140 3.14702927999972 -0.000812093107408198 -0.00076342057 +4141 3.14778943199972 -0.000811512267828 -0.00076479358 +4142 3.14854958399972 -0.000810930388676579 -0.00076615576 +4143 3.14930973599972 -0.00081034747816154 -0.00076750717 +4144 3.15006988799972 -0.00080976354445509 -0.00076884785 +4145 3.15083003999972 -0.000809178595694167 -0.00077017786 +4146 3.15159019199972 -0.000808592639980577 -0.00077149722 +4147 3.15235034399972 -0.000808005685381117 -0.000772806 +4148 3.15311049599972 -0.000807417739927711 -0.00077410423 +4149 3.15387064799972 -0.000806828811617538 -0.00077539197 +4150 3.15463079999972 -0.000806238908413161 -0.00077666925 +4151 3.15539095199972 -0.000805648038242657 -0.00077793613 +4152 3.15615110399972 -0.000805056208999745 -0.00077919265 +4153 3.15691125599972 -0.000804463428543912 -0.00078043885 +4154 3.15767140799972 -0.000803869704700543 -0.00078167477 +4155 3.15843155999972 -0.00080327504526105 -0.00078290047 +4156 3.15919171199972 -0.000802679457982994 -0.00078411599 +4157 3.15995186399972 -0.000802082950590211 -0.00078532136 +4158 3.16071201599972 -0.000801485530772945 -0.00078651665 +4159 3.16147216799972 -0.000800887206187965 -0.00078770188 +4160 3.16223231999972 -0.000800287984458694 -0.0007888771 +4161 3.16299247199972 -0.000799687873175333 -0.00079004236 +4162 3.16375262399972 -0.000799086879894985 -0.0007911977 +4163 3.16451277599972 -0.000798485012141779 -0.00079234317 +4164 3.16527292799972 -0.000797882277406991 -0.0007934788 +4165 3.16603307999971 -0.000797278683149169 -0.00079460464 +4166 3.16679323199971 -0.000796674236794255 -0.00079572073 +4167 3.16755338399971 -0.000796068945735705 -0.00079682712 +4168 3.16831353599971 -0.000795462817334614 -0.00079792385 +4169 3.16907368799971 -0.000794855858919832 -0.00079901095 +4170 3.16983383999971 -0.000794248077788091 -0.00080008848 +4171 3.17059399199971 -0.000793639481204118 -0.00080115647 +4172 3.17135414399971 -0.00079303007640076 -0.00080221497 +4173 3.17211429599971 -0.000792419870579103 -0.00080326401 +4174 3.17287444799971 -0.000791808870908587 -0.00080430365 +4175 3.17363459999971 -0.000791197084527128 -0.00080533391 +4176 3.17439475199971 -0.000790584518541236 -0.00080635485 +4177 3.17515490399971 -0.00078997118002613 -0.0008073665 +4178 3.17591505599971 -0.000789357076025857 -0.0008083689 +4179 3.17667520799971 -0.000788742213553412 -0.0008093621 +4180 3.17743535999971 -0.000788126599590847 -0.00081034613 +4181 3.17819551199971 -0.000787510241089393 -0.00081132104 +4182 3.17895566399971 -0.000786893144969575 -0.00081228686 +4183 3.17971581599971 -0.000786275318121324 -0.00081324364 +4184 3.18047596799971 -0.000785656767404093 -0.00081419142 +4185 3.18123611999971 -0.000785037499646977 -0.00081513023 +4186 3.18199627199971 -0.000784417521648815 -0.00081606012 +4187 3.18275642399971 -0.000783796840178317 -0.00081698113 +4188 3.18351657599971 -0.000783175461974167 -0.00081789329 +4189 3.18427672799971 -0.000782553393745143 -0.00081879664 +4190 3.18503687999971 -0.000781930642170222 -0.00081969122 +4191 3.18579703199971 -0.000781307213898699 -0.00082057708 +4192 3.18655718399971 -0.000780683115550294 -0.00082145425 +4193 3.18731733599971 -0.000780058353715267 -0.00082232277 +4194 3.18807748799971 -0.000779432934954523 -0.00082318268 +4195 3.18883763999971 -0.00077880686579973 -0.00082403401 +4196 3.18959779199971 -0.000778180152753422 -0.00082487681 +4197 3.19035794399971 -0.000777552802289114 -0.00082571111 +4198 3.19111809599971 -0.000776924820851409 -0.00082653695 +4199 3.19187824799971 -0.000776296214856104 -0.00082735437 +4200 3.19263839999971 -0.000775666990690305 -0.00082816341 +4201 3.19339855199971 -0.000775037154712528 -0.0008289641 +4202 3.19415870399971 -0.000774406713252814 -0.00082975648 +4203 3.19491885599971 -0.000773775672612829 -0.00083054059 +4204 3.19567900799971 -0.000773144039065976 -0.00083131647 +4205 3.19643915999971 -0.000772511818857501 -0.00083208415 +4206 3.19719931199971 -0.000771879018204599 -0.00083284367 +4207 3.19795946399971 -0.000771245643296515 -0.00083359506 +4208 3.19871961599971 -0.000770611700294658 -0.00083433837 +4209 3.19947976799971 -0.000769977195332698 -0.00083507363 +4210 3.20023991999971 -0.00076934213451668 -0.00083580087 +4211 3.20100007199971 -0.000768706523925117 -0.00083652014 +4212 3.20176022399971 -0.000768070369609102 -0.00083723146 +4213 3.2025203759997 -0.000767433677592412 -0.00083793487 +4214 3.2032805279997 -0.000766796453871604 -0.00083863042 +4215 3.2040406799997 -0.000766158704416126 -0.00083931813 +4216 3.2048008319997 -0.000765520435168416 -0.00083999803 +4217 3.2055609839997 -0.000764881652044002 -0.00084067018 +4218 3.2063211359997 -0.000764242360931609 -0.0008413346 +4219 3.2070812879997 -0.000763602567693256 -0.00084199132 +4220 3.2078414399997 -0.000762962278164357 -0.00084264038 +4221 3.2086015919997 -0.000762321498153828 -0.00084328182 +4222 3.2093617439997 -0.000761680233444178 -0.00084391567 +4223 3.2101218959997 -0.000761038489791617 -0.00084454196 +4224 3.2108820479997 -0.00076039627292615 -0.00084516073 +4225 3.2116421999997 -0.000759753588551682 -0.00084577202 +4226 3.2124023519997 -0.000759110442346111 -0.00084637585 +4227 3.2131625039997 -0.000758466839961431 -0.00084697226 +4228 3.2139226559997 -0.000757822787023826 -0.0008475613 +4229 3.2146828079997 -0.000757178289133775 -0.00084814298 +4230 3.2154429599997 -0.000756533351866142 -0.00084871734 +4231 3.2162031119997 -0.000755887980770276 -0.00084928442 +4232 3.2169632639997 -0.00075524218137011 -0.00084984425 +4233 3.2177234159997 -0.000754595959164257 -0.00085039686 +4234 3.2184835679997 -0.000753949319626101 -0.00085094229 +4235 3.2192437199997 -0.000753302268203901 -0.00085148056 +4236 3.2200038719997 -0.00075265481032088 -0.00085201172 +4237 3.2207640239997 -0.000752006951375323 -0.0008525358 +4238 3.2215241759997 -0.000751358696740673 -0.00085305282 +4239 3.2222843279997 -0.000750710051765622 -0.00085356282 +4240 3.2230444799997 -0.000750061021774209 -0.00085406583 +4241 3.2238046319997 -0.00074941161206591 -0.00085456189 +4242 3.2245647839997 -0.000748761827915734 -0.00085505102 +4243 3.2253249359997 -0.000748111674574319 -0.00085553327 +4244 3.2260850879997 -0.000747461157268018 -0.00085600865 +4245 3.2268452399997 -0.000746810281198995 -0.00085647721 +4246 3.2276053919997 -0.00074615905154532 -0.00085693897 +4247 3.2283655439997 -0.000745507473461056 -0.00085739396 +4248 3.2291256959997 -0.000744855552076354 -0.00085784222 +4249 3.2298858479997 -0.000744203292497542 -0.00085828378 +4250 3.2306459999997 -0.000743550699807219 -0.00085871867 +4251 3.2314061519997 -0.00074289777906434 -0.00085914692 +4252 3.2321663039997 -0.000742244535304312 -0.00085956856 +4253 3.2329264559997 -0.000741590973539083 -0.00085998363 +4254 3.2336866079997 -0.000740937098757226 -0.00086039214 +4255 3.2344467599997 -0.000740282915924038 -0.00086079414 +4256 3.2352069119997 -0.000739628429981618 -0.00086118965 +4257 3.2359670639997 -0.000738973645848967 -0.00086157871 +4258 3.2367272159997 -0.000738318568422067 -0.00086196134 +4259 3.2374873679997 -0.000737663202573972 -0.00086233758 +4260 3.2382475199997 -0.000737007553154898 -0.00086270745 +4261 3.23900767199969 -0.00073635162499231 -0.00086307098 +4262 3.23976782399969 -0.000735695422891007 -0.00086342821 +4263 3.24052797599969 -0.000735038951633207 -0.00086377916 +4264 3.24128812799969 -0.00073438221597864 -0.00086412387 +4265 3.24204827999969 -0.000733725220664629 -0.00086446235 +4266 3.24280843199969 -0.000733067970406177 -0.00086479465 +4267 3.24356858399969 -0.000732410469896053 -0.00086512079 +4268 3.24432873599969 -0.000731752723804878 -0.0008654408 +4269 3.24508888799969 -0.000731094736781208 -0.00086575471 +4270 3.24584903999969 -0.00073043651345162 -0.00086606255 +4271 3.24660919199969 -0.000729778058420797 -0.00086636435 +4272 3.24736934399969 -0.000729119376271609 -0.00086666013 +4273 3.24812949599969 -0.000728460471565203 -0.00086694992 +4274 3.24888964799969 -0.000727801348841079 -0.00086723376 +4275 3.24964979999969 -0.000727142012617177 -0.00086751166 +4276 3.25040995199969 -0.000726482467389962 -0.00086778367 +4277 3.25117010399969 -0.000725822717634501 -0.0008680498 +4278 3.25193025599969 -0.00072516276780455 -0.00086831009 +4279 3.25269040799969 -0.000724502622332634 -0.00086856456 +4280 3.25345055999969 -0.000723842285630131 -0.00086881324 +4281 3.25421071199969 -0.000723181762087347 -0.00086905616 +4282 3.25497086399969 -0.000722521056073608 -0.00086929335 +4283 3.25573101599969 -0.000721860171937328 -0.00086952482 +4284 3.25649116799969 -0.0007211991140061 -0.00086975062 +4285 3.25725131999969 -0.000720537886586772 -0.00086997077 +4286 3.25801147199969 -0.000719876493965527 -0.00087018529 +4287 3.25877162399969 -0.000719214940407962 -0.00087039421 +4288 3.25953177599969 -0.000718553230159169 -0.00087059757 +4289 3.26029192799969 -0.000717891367443814 -0.00087079538 +4290 3.26105207999969 -0.000717229356466216 -0.00087098767 +4291 3.26181223199969 -0.000716567201410423 -0.00087117447 +4292 3.26257238399969 -0.000715904906440292 -0.0008713558 +4293 3.26333253599969 -0.000715242475699571 -0.0008715317 +4294 3.26409268799969 -0.00071457991331197 -0.00087170218 +4295 3.26485283999969 -0.000713917223381242 -0.00087186728 +4296 3.26561299199969 -0.000713254409991258 -0.00087202703 +4297 3.26637314399969 -0.000712591477206089 -0.00087218143 +4298 3.26713329599969 -0.000711928429070077 -0.00087233053 +4299 3.26789344799969 -0.000711265269607912 -0.00087247435 +4300 3.26865359999969 -0.000710602002824714 -0.00087261291 +4301 3.26941375199969 -0.000709938632706101 -0.00087274624 +4302 3.27017390399969 -0.000709275163218269 -0.00087287437 +4303 3.27093405599969 -0.000708611598308065 -0.00087299732 +4304 3.27169420799969 -0.000707947941903065 -0.00087311511 +4305 3.27245435999969 -0.000707284197911646 -0.00087322778 +4306 3.27321451199969 -0.000706620370223062 -0.00087333534 +4307 3.27397466399969 -0.000705956462707518 -0.00087343782 +4308 3.27473481599969 -0.000705292479216242 -0.00087353524 +4309 3.27549496799968 -0.00070462842358156 -0.00087362764 +4310 3.27625511999968 -0.000703964299616973 -0.00087371504 +4311 3.27701527199968 -0.000703300111117225 -0.00087379745 +4312 3.27777542399968 -0.000702635861858376 -0.00087387491 +4313 3.27853557599968 -0.000701971555597878 -0.00087394744 +4314 3.27929572799968 -0.000701307196074647 -0.00087401506 +4315 3.28005587999968 -0.000700642787009131 -0.0008740778 +4316 3.28081603199968 -0.000699978332103386 -0.00087413568 +4317 3.28157618399968 -0.000699313835041147 -0.00087418873 +4318 3.28233633599968 -0.000698649299487899 -0.00087423696 +4319 3.28309648799968 -0.000697984729090945 -0.00087428041 +4320 3.28385663999968 -0.000697320127479483 -0.0008743191 +4321 3.28461679199968 -0.00069665549826467 -0.00087435305 +4322 3.28537694399968 -0.000695990845039698 -0.00087438228 +4323 3.28613709599968 -0.000695326171379861 -0.00087440683 +4324 3.28689724799968 -0.000694661480842624 -0.0008744267 +4325 3.28765739999968 -0.000693996776967696 -0.00087444193 +4326 3.28841755199968 -0.000693332063277094 -0.00087445254 +4327 3.28917770399968 -0.000692667343275221 -0.00087445975 +4328 3.28993785599968 -0.000692002618618903 -0.00087448338 +4329 3.29069800799968 -0.000691337862694597 -0.00087457741 +4330 3.29145815999968 -0.000690672995090957 -0.00087477869 +4331 3.29221831199968 -0.000690007933147996 -0.0008750882 +4332 3.29297846399968 -0.000689342595004194 -0.00087550487 +4333 3.29373861599968 -0.000688676899594287 -0.00087602766 +4334 3.29449876799968 -0.000688010766646596 -0.00087665553 +4335 3.29525891999968 -0.00068734411668081 -0.00087738744 +4336 3.29601907199968 -0.000686676871004988 -0.00087822236 +4337 3.29677922399968 -0.000686008951714001 -0.00087915925 +4338 3.29753937599968 -0.000685340281686209 -0.00088019707 +4339 3.29829952799968 -0.000684670784581121 -0.00088133482 +4340 3.29905967999968 -0.000684000384837513 -0.00088257145 +4341 3.29981983199968 -0.000683329007670319 -0.00088390596 +4342 3.30057998399968 -0.000682656579068408 -0.00088533733 +4343 3.30134013599968 -0.000681983025791921 -0.00088686453 +4344 3.30210028799968 -0.000681308275370163 -0.00088848657 +4345 3.30286043999968 -0.000680632256098823 -0.00089020244 +4346 3.30362059199968 -0.00067995489703776 -0.00089201113 +4347 3.30438074399968 -0.000679276128008 -0.00089391164 +4348 3.30514089599968 -0.00067859587958996 -0.00089590298 +4349 3.30590104799968 -0.000677914083120679 -0.00089798415 +4350 3.30666119999968 -0.00067723067069092 -0.00090015416 +4351 3.30742135199968 -0.000676545575143406 -0.00090241203 +4352 3.30818150399968 -0.000675858730070034 -0.00090475677 +4353 3.30894165599968 -0.000675170069809217 -0.0009071874 +4354 3.30970180799968 -0.00067447952944355 -0.00090970294 +4355 3.31046195999968 -0.000673787044797702 -0.00091230241 +4356 3.31122211199968 -0.000673092552435306 -0.00091498486 +4357 3.31198226399967 -0.000672395989656738 -0.0009177493 +4358 3.31274241599967 -0.000671697294497009 -0.00092059479 +4359 3.31350256799967 -0.000670996405722546 -0.00092352034 +4360 3.31426271999967 -0.000670293262829524 -0.00092652501 +4361 3.31502287199967 -0.000669587806040872 -0.00092960785 +4362 3.31578302399967 -0.000668879976303827 -0.00093276789 +4363 3.31654317599967 -0.000668169715287825 -0.0009360042 +4364 3.31730332799967 -0.000667456965381397 -0.00093931582 +4365 3.31806347999967 -0.000666741669690385 -0.00094270182 +4366 3.31882363199967 -0.000666023772035063 -0.00094616126 +4367 3.31958378399967 -0.000665303216947688 -0.0009496932 +4368 3.32034393599967 -0.000664579949670174 -0.00095329671 +4369 3.32110408799967 -0.000663853916151536 -0.00095697086 +4370 3.32186423999967 -0.000663125063045222 -0.00096071473 +4371 3.32262439199967 -0.000662393337707123 -0.00096452739 +4372 3.32338454399967 -0.000661658688192568 -0.00096840793 +4373 3.32414469599967 -0.000660921063254105 -0.00097235543 +4374 3.32490484799967 -0.000660180412339173 -0.00097636898 +4375 3.32566499999967 -0.000659436685587322 -0.00098044767 +4376 3.32642515199967 -0.000658689833827997 -0.00098459059 +4377 3.32718530399967 -0.000657939808577646 -0.00098879684 +4378 3.32794545599967 -0.000657186562037837 -0.00099306552 +4379 3.32870560799967 -0.000656430047092371 -0.00099739574 +4380 3.32946575999967 -0.000655670217304949 -0.0010017866 +4381 3.33022591199967 -0.000654907026916729 -0.0010062372 +4382 3.33098606399967 -0.000654140430843553 -0.0010107467 +4383 3.33174621599967 -0.000653370384674168 -0.0010153142 +4384 3.33250636799967 -0.000652596844666786 -0.0010199387 +4385 3.33326651999967 -0.000651819767747419 -0.0010246195 +4386 3.33402667199967 -0.000651039111507101 -0.0010293557 +4387 3.33478682399967 -0.000650254834199337 -0.0010341463 +4388 3.33554697599967 -0.00064946689473766 -0.0010389906 +4389 3.33630712799967 -0.000648675252693298 -0.0010438876 +4390 3.33706727999967 -0.000647879868292622 -0.0010488365 +4391 3.33782743199967 -0.000647080702414593 -0.0010538364 +4392 3.33858758399967 -0.000646277716588317 -0.0010588865 +4393 3.33934773599967 -0.000645470872990717 -0.001063986 +4394 3.34010788799967 -0.000644660134443975 -0.0010691339 +4395 3.34086803999967 -0.000643845464412762 -0.0010743295 +4396 3.34162819199967 -0.000643026827002346 -0.0010795719 +4397 3.34238834399967 -0.000642204186955486 -0.0010848602 +4398 3.34314849599967 -0.000641377509650654 -0.0010901937 +4399 3.34390864799967 -0.000640546761098926 -0.0010955715 +4400 3.34466879999967 -0.000639711907941654 -0.0011009927 +4401 3.34542895199967 -0.000638872917448352 -0.0011064566 +4402 3.34618910399967 -0.000638029757513925 -0.0011119623 +4403 3.34694925599967 -0.000637182396656 -0.0011175091 +4404 3.34770940799967 -0.000636330804013041 -0.001123096 +4405 3.34846955999967 -0.000635474949341241 -0.0011287223 +4406 3.34922971199966 -0.000634614803012523 -0.0011343872 +4407 3.34998986399966 -0.00063375033601154 -0.0011400898 +4408 3.35075001599966 -0.000632881519934014 -0.0011458294 +4409 3.35151016799966 -0.000632008326983402 -0.0011516052 +4410 3.35227031999966 -0.000631130729969009 -0.0011574163 +4411 3.35303047199966 -0.000630248702303104 -0.0011632621 +4412 3.35379062399966 -0.000629362217998808 -0.0011691416 +4413 3.35455077599966 -0.000628471251667539 -0.0011750541 +4414 3.35531092799966 -0.000627575778516021 -0.0011809989 +4415 3.35607107999966 -0.000626675774344831 -0.0011869751 +4416 3.35683123199966 -0.000625771215544968 -0.001192982 +4417 3.35759138399966 -0.000624862079095734 -0.0011990187 +4418 3.35835153599966 -0.000623948342562408 -0.0012050846 +4419 3.35911168799966 -0.000623029984093693 -0.0012111789 +4420 3.35987183999966 -0.000622106982419046 -0.0012173008 +4421 3.36063199199966 -0.000621179316846354 -0.0012234495 +4422 3.36139214399966 -0.000620246967259486 -0.0012296243 +4423 3.36215229599966 -0.00061930991411574 -0.0012358244 +4424 3.36291244799966 -0.000618368138443626 -0.0012420491 +4425 3.36367259999966 -0.000617421621839864 -0.0012482977 +4426 3.36443275199966 -0.000616470346467501 -0.0012545693 +4427 3.36519290399966 -0.000615514295052799 -0.0012608633 +4428 3.36595305599966 -0.00061455345088357 -0.001267179 +4429 3.36671320799966 -0.000613587797805959 -0.0012735155 +4430 3.36747335999966 -0.000612617320222331 -0.0012798721 +4431 3.36823351199966 -0.000611642003088719 -0.0012862482 +4432 3.36899366399966 -0.000610661831912385 -0.001292643 +4433 3.36975381599966 -0.000609676792749481 -0.0012990558 +4434 3.37051396799966 -0.000608686872201947 -0.0013054858 +4435 3.37127411999966 -0.000607692057416065 -0.0013119324 +4436 3.37203427199966 -0.000606692336079129 -0.0013183949 +4437 3.37279442399966 -0.000605687696417223 -0.0013248725 +4438 3.37355457599966 -0.000604678127193115 -0.0013313645 +4439 3.37431472799966 -0.000603663617703032 -0.0013378702 +4440 3.37507487999966 -0.000602644157774779 -0.001344389 +4441 3.37583503199966 -0.000601619737765402 -0.0013509201 +4442 3.37659518399966 -0.000600590348557972 -0.0013574629 +4443 3.37735533599966 -0.000599555981559918 -0.0013640166 +4444 3.37811548799966 -0.000598516628699808 -0.0013705806 +4445 3.37887563999966 -0.000597472282425571 -0.0013771542 +4446 3.37963579199966 -0.000596422935701613 -0.0013837367 +4447 3.38039594399966 -0.000595368582006373 -0.0013903274 +4448 3.38115609599966 -0.000594309215330102 -0.0013969258 +4449 3.38191624799966 -0.000593244830171979 -0.001403531 +4450 3.38267639999966 -0.00059217542153811 -0.0014101425 +4451 3.38343655199966 -0.00059110098493842 -0.0014167595 +4452 3.38419670399966 -0.000590021516384986 -0.0014233815 +4453 3.38495685599966 -0.000588937012389046 -0.0014300077 +4454 3.38571700799965 -0.000587847469958325 -0.0014366375 +4455 3.38647715999965 -0.000586752886595265 -0.0014432703 +4456 3.38723731199965 -0.000585653260293806 -0.0014499055 +4457 3.38799746399965 -0.000584548589537603 -0.0014565422 +4458 3.38875761599965 -0.000583438873296926 -0.0014631801 +4459 3.38951776799965 -0.000582324111026544 -0.0014698183 +4460 3.39027791999965 -0.000581204302663285 -0.0014764563 +4461 3.39103807199965 -0.00058007944862315 -0.0014830934 +4462 3.39179822399965 -0.000578949549799535 -0.0014897291 +4463 3.39255837599965 -0.000577814607560012 -0.0014963626 +4464 3.39331852799965 -0.000576674623744555 -0.0015029934 +4465 3.39407867999965 -0.000575529600662317 -0.0015096209 +4466 3.39483883199965 -0.000574379541089964 -0.0015162444 +4467 3.39559898399965 -0.00057322444826835 -0.0015228633 +4468 3.39635913599965 -0.000572064325901067 -0.0015294771 +4469 3.39711928799965 -0.000570899178150786 -0.0015360851 +4470 3.39787943999965 -0.000569729009637809 -0.0015426867 +4471 3.39863959199965 -0.000568553825437079 -0.0015492813 +4472 3.39939974399965 -0.000567373631075729 -0.0015558684 +4473 3.40015989599965 -0.000566188432530645 -0.0015624473 +4474 3.40092004799965 -0.000564998236226244 -0.0015690174 +4475 3.40168019999965 -0.000563803049031586 -0.0015755783 +4476 3.40244035199965 -0.000562602878258378 -0.0015821292 +4477 3.40320050399965 -0.000561397731657864 -0.0015886697 +4478 3.40396065599965 -0.000560187617418939 -0.001595199 +4479 3.40472080799965 -0.000558972544165481 -0.0016017168 +4480 3.40548095999965 -0.000557752520953692 -0.0016082224 +4481 3.40624111199965 -0.000556527557269981 -0.0016147152 +4482 3.40700126399965 -0.000555297663028198 -0.0016211946 +4483 3.40776141599965 -0.000554062848567294 -0.0016276602 +4484 3.40852156799965 -0.00055282312464866 -0.0016341114 +4485 3.40928171999965 -0.00055157850245402 -0.0016405476 +4486 3.41004187199965 -0.000550328993582649 -0.0016469682 +4487 3.41080202399965 -0.000549074610048939 -0.0016533728 +4488 3.41156217599965 -0.000547815364280169 -0.0016597608 +4489 3.41232232799965 -0.000546551269113627 -0.0016661316 +4490 3.41308247999965 -0.000545282337794606 -0.0016724847 +4491 3.41384263199965 -0.000544008583973299 -0.0016788196 +4492 3.41460278399965 -0.000542730021703242 -0.0016851357 +4493 3.41536293599965 -0.000541446665437761 -0.0016914326 +4494 3.41612308799965 -0.000540158530028423 -0.0016977096 +4495 3.41688323999965 -0.00053886563072203 -0.0017039664 +4496 3.41764339199965 -0.000537567983158294 -0.0017102023 +4497 3.41840354399965 -0.000536265603367503 -0.0017164168 +4498 3.41916369599965 -0.000534958507767858 -0.0017226096 +4499 3.41992384799965 -0.000533646713163027 -0.0017287799 +4500 3.42068399999965 -0.000532330236739598 -0.0017349274 +4501 3.42144415199965 -0.00053100909606496 -0.0017410516 +4502 3.42220430399964 -0.000529683309084428 -0.0017471518 +4503 3.42296445599964 -0.000528352894119011 -0.0017532278 +4504 3.42372460799964 -0.000527017869862756 -0.0017592789 +4505 3.42448475999964 -0.000525678255380413 -0.0017653047 +4506 3.42524491199964 -0.000524334070104882 -0.0017713047 +4507 3.42600506399964 -0.000522985333834991 -0.0017772783 +4508 3.42676521599964 -0.000521632066732614 -0.0017832253 +4509 3.42752536799964 -0.000520274289320444 -0.001789145 +4510 3.42828551999964 -0.000518912022479445 -0.001795037 +4511 3.42904567199964 -0.000517545287446408 -0.0018009008 +4512 3.42980582399964 -0.000516174105811618 -0.001806736 +4513 3.43056597599964 -0.000514798499516189 -0.0018125421 +4514 3.43132612799964 -0.000513418490849404 -0.0018183186 +4515 3.43208627999964 -0.000512034102446823 -0.0018240652 +4516 3.43284643199964 -0.000510645357287398 -0.0018297813 +4517 3.43360658399964 -0.000509252278690808 -0.0018354664 +4518 3.43436673599964 -0.000507854890315573 -0.0018411203 +4519 3.43512688799964 -0.000506453216156166 -0.0018467423 +4520 3.43588703999964 -0.00050504728054046 -0.0018523322 +4521 3.43664719199964 -0.00050363710812773 -0.0018578894 +4522 3.43740734399964 -0.000502222723905765 -0.0018634135 +4523 3.43816749599964 -0.000500804153188206 -0.001868904 +4524 3.43892764799964 -0.000499381421612988 -0.0018743607 +4525 3.43968779999964 -0.00049795455513868 -0.001879783 +4526 3.44044795199964 -0.000496523580042818 -0.0018851705 +4527 3.44120810399964 -0.000495088522919351 -0.0018905228 +4528 3.44196825599964 -0.000493649410675756 -0.0018958395 +4529 3.44272840799964 -0.000492206270531037 -0.0019011202 +4530 3.44348855999964 -0.000490759130012952 -0.0019063645 +4531 3.44424871199964 -0.000489308016955459 -0.001911572 +4532 3.44500886399964 -0.000487852959496826 -0.0019167422 +4533 3.44576901599964 -0.000486393986076417 -0.0019218749 +4534 3.44652916799964 -0.000484931125432686 -0.0019269695 +4535 3.44728931999964 -0.00048346440660052 -0.0019320258 +4536 3.44804947199964 -0.000481993858908902 -0.0019370433 +4537 3.44880962399964 -0.000480519511978139 -0.0019420216 +4538 3.44956977599964 -0.000479041395717861 -0.0019469604 +4539 3.45032992799964 -0.000477559540324135 -0.0019518593 +4540 3.45109007999964 -0.000476073976277247 -0.0019567179 +4541 3.45185023199964 -0.000474584734339034 -0.0019615358 +4542 3.45261038399964 -0.000473091845550444 -0.0019663127 +4543 3.45337053599964 -0.000471595341229314 -0.0019710483 +4544 3.45413068799964 -0.000470095252967706 -0.0019757421 +4545 3.45489083999964 -0.000468591612629132 -0.0019803938 +4546 3.45565099199964 -0.000467084452346778 -0.0019850031 +4547 3.45641114399964 -0.000465573804520392 -0.0019895695 +4548 3.45717129599964 -0.000464059701814068 -0.0019940929 +4549 3.45793144799964 -0.000462542177153802 -0.0019985727 +4550 3.45869159999963 -0.000461021263725048 -0.0020030087 +4551 3.45945175199963 -0.000459496994970165 -0.0020074006 +4552 3.46021190399963 -0.000457969404585867 -0.0020117479 +4553 3.46097205599963 -0.000456438526520775 -0.0020160505 +4554 3.46173220799963 -0.000454904394973199 -0.0020203079 +4555 3.46249235999963 -0.000453367044388253 -0.0020245198 +4556 3.46325251199963 -0.000451826509455966 -0.0020286859 +4557 3.46401266399963 -0.00045028282510795 -0.0020328059 +4558 3.46477281599963 -0.00044873602651585 -0.0020368795 +4559 3.46553296799963 -0.000447186149088119 -0.0020409063 +4560 3.46629311999963 -0.000445633228468134 -0.0020448861 +4561 3.46705327199963 -0.000444077300531198 -0.0020488186 +4562 3.46781342399963 -0.00044251840138243 -0.0020527034 +4563 3.46857357599963 -0.000440956567354434 -0.0020565403 +4564 3.46933372799963 -0.000439391835004077 -0.0020603289 +4565 3.47009387999963 -0.00043782424111094 -0.002064069 +4566 3.47085403199963 -0.000436253822674204 -0.0020677603 +4567 3.47161418399963 -0.000434680616910432 -0.0020714024 +4568 3.47237433599963 -0.000433104661251127 -0.0020749952 +4569 3.47313448799963 -0.000431525993340176 -0.0020785384 +4570 3.47389463999963 -0.0004299446510313 -0.0020820316 +4571 3.47465479199963 -0.000428360672385608 -0.0020854746 +4572 3.47541494399963 -0.00042677409566938 -0.0020888671 +4573 3.47617509599963 -0.000425184959351288 -0.0020922089 +4574 3.47693524799963 -0.000423593302100178 -0.0020954997 +4575 3.47769539999963 -0.000421999162782072 -0.0020987392 +4576 3.47845555199963 -0.00042040258045839 -0.0021019272 +4577 3.47921570399963 -0.000418803594383288 -0.0021050635 +4578 3.47997585599963 -0.000417202244000547 -0.0021081477 +4579 3.48073600799963 -0.000415598568942022 -0.0021111797 +4580 3.48149615999963 -0.000413992609024749 -0.0021141592 +4581 3.48225631199963 -0.000412384404248178 -0.0021170859 +4582 3.48301646399963 -0.000410773994792279 -0.0021199597 +4583 3.48377661599963 -0.000409161421014659 -0.0021227803 +4584 3.48453676799963 -0.000407546723448227 -0.0021255474 +4585 3.48529691999963 -0.000405929942798644 -0.0021282609 +4586 3.48605707199963 -0.000404311119942102 -0.0021309204 +4587 3.48681722399963 -0.000402690295922437 -0.0021335259 +4588 3.48757737599963 -0.000401067511949016 -0.0021360771 +4589 3.48833752799963 -0.000399442809394079 -0.0021385737 +4590 3.48909767999963 -0.000397816229790293 -0.0021410156 +4591 3.48985783199963 -0.000396187814828197 -0.0021434025 +4592 3.49061798399963 -0.000394557606354207 -0.0021457343 +4593 3.49137813599963 -0.00039292564636717 -0.0021480108 +4594 3.49213828799963 -0.000391291977017039 -0.0021502316 +4595 3.49289843999963 -0.000389656640601421 -0.0021523968 +4596 3.49365859199963 -0.000388019679563811 -0.002154506 +4597 3.49441874399963 -0.000386381136490588 -0.0021565591 +4598 3.49517889599962 -0.000384741054109017 -0.0021585559 +4599 3.49593904799962 -0.000383099475284365 -0.0021604963 +4600 3.49669919999962 -0.000381456443017569 -0.0021623799 +4601 3.49745935199962 -0.000379812000443014 -0.0021642068 +4602 3.49821950399962 -0.000378166190825535 -0.0021659766 +4603 3.49897965599962 -0.000376519057558422 -0.0021676893 +4604 3.49973980799962 -0.000374870644160752 -0.0021693446 +4605 3.50049995999962 -0.000373220994274948 -0.0021709425 +4606 3.50126011199962 -0.000371570151664224 -0.0021724827 +4607 3.50202026399962 -0.000369918160210037 -0.002173965 +4608 3.50278041599962 -0.000368265063910078 -0.0021753895 +4609 3.50354056799962 -0.000366610906875176 -0.0021767558 +4610 3.50430071999962 -0.000364955733327288 -0.0021780639 +4611 3.50506087199962 -0.000363299587596622 -0.0021793136 +4612 3.50582102399962 -0.000361642514119631 -0.0021805048 +4613 3.50658117599962 -0.000359984557436133 -0.0021816373 +4614 3.50734132799962 -0.000358325762187195 -0.002182711 +4615 3.50810147999962 -0.00035666617311203 -0.0021837258 +4616 3.50886163199962 -0.00035500583504644 -0.0021846816 +4617 3.50962178399962 -0.000353344792919597 -0.0021855782 +4618 3.51038193599962 -0.00035168309175182 -0.0021864155 +4619 3.51114208799962 -0.000350020776652138 -0.0021871934 +4620 3.51190223999962 -0.000348357892815843 -0.0021879118 +4621 3.51266239199962 -0.000346694485521826 -0.0021885706 +4622 3.51342254399962 -0.000345030600130358 -0.0021891697 +4623 3.51418269599962 -0.000343366282080315 -0.0021897089 +4624 3.51494284799962 -0.000341701576886955 -0.0021901882 +4625 3.51570299999962 -0.000340036530139365 -0.0021906075 +4626 3.51646315199962 -0.000338371187498021 -0.0021909667 +4627 3.51722330399962 -0.000336705594692122 -0.0021912657 +4628 3.51798345599962 -0.000335039797517367 -0.0021915044 +4629 3.51874360799962 -0.000333373841833406 -0.0021916827 +4630 3.51950375999962 -0.000331707773561285 -0.0021918006 +4631 3.52026391199962 -0.000330041638680778 -0.0021918579 +4632 3.52102406399962 -0.000328375483228616 -0.0021918546 +4633 3.52178421599962 -0.000326709353295151 -0.0021917907 +4634 3.52254436799962 -0.000325043295022587 -0.0021916661 +4635 3.52330451999962 -0.00032337735460175 -0.0021914806 +4636 3.52406467199962 -0.000321711578270434 -0.0021912343 +4637 3.52482482399962 -0.000320046012310393 -0.0021909271 +4638 3.52558497599962 -0.000318380703045018 -0.0021905589 +4639 3.52634512799962 -0.000316715696836889 -0.0021901297 +4640 3.52710527999962 -0.000315051040085224 -0.0021896394 +4641 3.52786543199962 -0.000313386779223435 -0.0021890881 +4642 3.52862558399962 -0.000311722960716798 -0.0021884756 +4643 3.52938573599962 -0.000310059631059567 -0.0021878019 +4644 3.53014588799962 -0.000308396836772973 -0.002187067 +4645 3.53090603999962 -0.000306734624402449 -0.0021862708 +4646 3.53166619199961 -0.000305073040515413 -0.0021854134 +4647 3.53242634399961 -0.000303412131698377 -0.0021844947 +4648 3.53318649599961 -0.000301751944554729 -0.0021835146 +4649 3.53394664799961 -0.000300092525702622 -0.0021824732 +4650 3.53470679999961 -0.000298433921771646 -0.0021813705 +4651 3.53546695199961 -0.000296776179401159 -0.0021802064 +4652 3.53622710399961 -0.000295119345237183 -0.002178981 +4653 3.53698725599961 -0.00029346346593051 -0.0021776941 +4654 3.53774740799961 -0.000291808588133713 -0.0021763459 +4655 3.53850755999961 -0.000290154758499028 -0.0021749364 +4656 3.53926771199961 -0.000288502023675696 -0.0021734654 +4657 3.54002786399961 -0.000286850430307517 -0.0021719331 +4658 3.54078801599961 -0.000285200025030519 -0.0021703395 +4659 3.54154816799961 -0.000283550854469961 -0.0021686845 +4660 3.54230831999961 -0.000281902965238778 -0.0021669683 +4661 3.54306847199961 -0.000280256403934032 -0.0021651907 +4662 3.54382862399961 -0.00027861121713546 -0.0021633519 +4663 3.54458877599961 -0.000276967451402155 -0.0021614518 +4664 3.54534892799961 -0.000275325153270556 -0.0021594906 +4665 3.54610907999961 -0.000273684369251903 -0.0021574681 +4666 3.54686923199961 -0.00027204514582968 -0.0021553846 +4667 3.54762938399961 -0.000270407529457062 -0.0021532399 +4668 3.54838953599961 -0.000268771566554804 -0.0021510342 +4669 3.54914968799961 -0.000267137303508136 -0.0021487675 +4670 3.54990983999961 -0.000265504786664983 -0.0021464399 +4671 3.55066999199961 -0.000263874062332969 -0.0021440514 +4672 3.55143014399961 -0.000262245176777309 -0.002141602 +4673 3.55219029599961 -0.000260618176217808 -0.0021390919 +4674 3.55295044799961 -0.000258993106827088 -0.002136521 +4675 3.55371059999961 -0.000257370014727587 -0.0021338896 +4676 3.55447075199961 -0.00025574894598912 -0.0021311975 +4677 3.55523090399961 -0.000254129946626769 -0.002128445 +4678 3.55599105599961 -0.000252513062598103 -0.002125632 +4679 3.55675120799961 -0.000250898339800409 -0.0021227587 +4680 3.55751135999961 -0.000249285824069134 -0.0021198251 +4681 3.55827151199961 -0.000247675561174332 -0.0021168314 +4682 3.55903166399961 -0.000246067596818889 -0.0021137776 +4683 3.55979181599961 -0.000244461976635968 -0.0021106638 +4684 3.56055196799961 -0.000242858746186125 -0.0021074901 +4685 3.56131211999961 -0.00024125795095542 -0.0021042567 +4686 3.56207227199961 -0.000239659636352196 -0.0021009635 +4687 3.56283242399961 -0.000238063847705416 -0.0020976108 +4688 3.56359257599961 -0.000236470630261776 -0.0020941986 +4689 3.56435272799961 -0.000234880029183038 -0.0020907271 +4690 3.56511287999961 -0.000233292089543813 -0.0020871963 +4691 3.56587303199961 -0.000231706856329228 -0.0020836064 +4692 3.56663318399961 -0.000230124374432039 -0.0020799575 +4693 3.56739333599961 -0.000228544688650523 -0.0020762497 +4694 3.5681534879996 -0.000226967843685588 -0.0020724832 +4695 3.5689136399996 -0.000225393884138891 -0.0020686581 +4696 3.5696737919996 -0.000223822854509725 -0.0020647745 +4697 3.5704339439996 -0.000222254799193022 -0.0020608326 +4698 3.5711940959996 -0.000220689762476578 -0.0020568325 +4699 3.5719542479996 -0.00021912778853872 -0.0020527743 +4700 3.5727143999996 -0.000217568921445754 -0.0020486583 +4701 3.5734745519996 -0.000216013205149523 -0.0020444845 +4702 3.5742347039996 -0.000214460683484963 -0.0020402531 +4703 3.5749948559996 -0.000212911400167548 -0.0020359643 +4704 3.5757550079996 -0.000211365398790964 -0.0020316182 +4705 3.5765151599996 -0.000209822722824216 -0.0020272151 +4706 3.5772753119996 -0.000208283415609856 -0.002022755 +4707 3.5780354639996 -0.000206747520360651 -0.0020182381 +4708 3.5787956159996 -0.000205215080157806 -0.0020136646 +4709 3.5795557679996 -0.0002036861379483 -0.0020090348 +4710 3.5803159199996 -0.000202160736542112 -0.0020043487 +4711 3.5810760719996 -0.000200638918610108 -0.0019996066 +4712 3.5818362239996 -0.000199120726681268 -0.0019948086 +4713 3.5825963759996 -0.000197606203140577 -0.0019899549 +4714 3.5833565279996 -0.000196095390226136 -0.0019850458 +4715 3.5841166799996 -0.000194588330026946 -0.0019800814 +4716 3.5848768319996 -0.000193085064480347 -0.001975062 +4717 3.5856369839996 -0.000191585635369362 -0.0019699877 +4718 3.5863971359996 -0.000190090084320804 -0.0019648587 +4719 3.5871572879996 -0.000188598452801947 -0.0019596753 +4720 3.5879174399996 -0.000187110782118638 -0.0019544377 +4721 3.5886775919996 -0.000185627113412967 -0.001949146 +4722 3.5894377439996 -0.000184147487659936 -0.0019438005 +4723 3.5901978959996 -0.000182671945666013 -0.0019384015 +4724 3.5909580479996 -0.000181200528065917 -0.0019329492 +4725 3.5917181999996 -0.000179733275320504 -0.0019274437 +4726 3.5924783519996 -0.000178270227713995 -0.0019218853 +4727 3.5932385039996 -0.000176811425351864 -0.0019162743 +4728 3.5939986559996 -0.000175356908158175 -0.001910611 +4729 3.5947588079996 -0.000173906715873029 -0.0019048954 +4730 3.5955189599996 -0.000172460888050008 -0.001899128 +4731 3.5962791119996 -0.000171019464054067 -0.0018933088 +4732 3.5970392639996 -0.000169582483058761 -0.0018874383 +4733 3.5977994159996 -0.000168149984043797 -0.0018815166 +4734 3.5985595679996 -0.000166722005792597 -0.0018755441 +4735 3.5993197199996 -0.000165298586889739 -0.0018695209 +4736 3.6000798719996 -0.000163879765718633 -0.0018634473 +4737 3.6008400239996 -0.00016246558045907 -0.0018573237 +4738 3.6016001759996 -0.000161056069084231 -0.0018511502 +4739 3.6023603279996 -0.000159651269359018 -0.0018449272 +4740 3.6031204799996 -0.000158251218837058 -0.001838655 +4741 3.6038806319996 -0.000156855954858037 -0.0018323337 +4742 3.60464078399959 -0.000155465514545816 -0.0018259638 +4743 3.60540093599959 -0.000154079934805651 -0.0018195454 +4744 3.60616108799959 -0.00015269925232142 -0.001813079 +4745 3.60692123999959 -0.000151323503553735 -0.0018065647 +4746 3.60768139199959 -0.000149952724736946 -0.0018000029 +4747 3.60844154399959 -0.000148586951876806 -0.0017933939 +4748 3.60920169599959 -0.000147226220748364 -0.001786738 +4749 3.60996184799959 -0.000145870566892858 -0.0017800355 +4750 3.61072199999959 -0.000144520025615713 -0.0017732867 +4751 3.61148215199959 -0.000143174631983767 -0.001766492 +4752 3.61224230399959 -0.00014183442082305 -0.0017596515 +4753 3.61300245599959 -0.000140499426716123 -0.0017527658 +4754 3.61376260799959 -0.000139169683999518 -0.001745835 +4755 3.61452275999959 -0.000137845226761635 -0.0017388596 +4756 3.61528291199959 -0.00013652608883985 -0.0017318398 +4757 3.61604306399959 -0.000135212303818077 -0.001724776 +4758 3.61680321599959 -0.000133903905024768 -0.0017176685 +4759 3.61756336799959 -0.000132600925529691 -0.0017105177 +4760 3.61832351999959 -0.000131303398141935 -0.0017033239 +4761 3.61908367199959 -0.000130011355407578 -0.0016960875 +4762 3.61984382399959 -0.000128724829606575 -0.0016888087 +4763 3.62060397599959 -0.000127443852750986 -0.0016814881 +4764 3.62136412799959 -0.000126168456581865 -0.0016741258 +4765 3.62212427999959 -0.000124898672567264 -0.0016667224 +4766 3.62288443199959 -0.000123634531899564 -0.0016592781 +4767 3.62364458399959 -0.000122376065492924 -0.0016517933 +4768 3.62440473599959 -0.000121123303980841 -0.0016442684 +4769 3.62516488799959 -0.000119876277713926 -0.0016367037 +4770 3.62592503999959 -0.000118635016756907 -0.0016290997 +4771 3.62668519199959 -0.000117399550886521 -0.0016214567 +4772 3.62744534399959 -0.000116169909589181 -0.0016137752 +4773 3.62820549599959 -0.000114946122057979 -0.0016060554 +4774 3.62896564799959 -0.000113728217190689 -0.0015982978 +4775 3.62972579999959 -0.000112516223586989 -0.0015905027 +4776 3.63048595199959 -0.000111310169546019 -0.0015826707 +4777 3.63124610399959 -0.000110110083064052 -0.001574802 +4778 3.63200625599959 -0.000108915991832048 -0.001566897 +4779 3.63276640799959 -0.00010772792323277 -0.0015589563 +4780 3.63352655999959 -0.000106545904338895 -0.0015509801 +4781 3.63428671199959 -0.000105369961909907 -0.001542969 +4782 3.63504686399959 -0.000104200122390208 -0.0015349233 +4783 3.63580701599959 -0.000103036411906343 -0.0015268434 +4784 3.63656716799959 -0.000101878856264115 -0.0015187298 +4785 3.63732731999959 -0.000100727480947249 -0.0015105829 +4786 3.63808747199959 -0.00009958231111351082 -0.001502403 +4787 3.63884762399959 -0.0000984433715932598 -0.0014941908 +4788 3.63960777599959 -0.0000973106868865647 -0.0014859465 +4789 3.64036792799959 -0.00009618428116076051 -0.0014776707 +4790 3.64112807999958 -0.00009506417824800552 -0.0014693637 +4791 3.64188823199958 -0.00009395040164272841 -0.0014610261 +4792 3.64264838399958 -0.00009284297449918541 -0.0014526582 +4793 3.64340853599958 -0.00009174191962890711 -0.0014442605 +4794 3.64416868799958 -0.00009064725949858851 -0.0014358335 +4795 3.64492883999958 -0.0000895590162270921 -0.0014273776 +4796 3.64568899199958 -0.0000884772115832266 -0.0014188934 +4797 3.64644914399958 -0.0000874018669831944 -0.0014103811 +4798 3.64720929599958 -0.00008633300348814822 -0.0014018415 +4799 3.64796944799958 -0.00008527064180197111 -0.0013932748 +4800 3.64872959999958 -0.0000842148022682787 -0.0013846816 +4801 3.64948975199958 -0.00008316550486808791 -0.0013760623 +4802 3.65024990399958 -0.0000821227692178184 -0.0013674175 +4803 3.65101005599958 -0.0000810866145661837 -0.0013587476 +4804 3.65177020799958 -0.00008005705979208241 -0.0013500531 +4805 3.65253035999958 -0.0000790341234018221 -0.0013413345 +4806 3.65329051199958 -0.00007801782352712121 -0.0013325923 +4807 3.65405066399958 -0.000077008177922 -0.0013238271 +4808 3.65481081599958 -0.00007600520396078281 -0.0013150392 +4809 3.65557096799958 -0.0000750089186356551 -0.0013062292 +4810 3.65633111999958 -0.0000740193385536658 -0.0012973976 +4811 3.65709127199958 -0.0000730364799347294 -0.0012885449 +4812 3.65785142399958 -0.00007206035860907181 -0.0012796716 +4813 3.65861157599958 -0.00007109099001434421 -0.0012707784 +4814 3.65937172799958 -0.0000701283891939575 -0.0012618655 +4815 3.66013187999958 -0.0000691725707937518 -0.0012529337 +4816 3.66089203199958 -0.00006822354905988701 -0.0012439834 +4817 3.66165218399958 -0.00006728133783651111 -0.0012350152 +4818 3.66241233599958 -0.0000663459505630959 -0.0012260295 +4819 3.66317248799958 -0.00006541740027188331 -0.001217027 +4820 3.66393263999958 -0.0000644956995855539 -0.0012080081 +4821 3.66469279199958 -0.0000635808607146737 -0.0011989734 +4822 3.66545294399958 -0.0000626728954553624 -0.0011899235 +4823 3.66621309599958 -0.0000617718151865176 -0.001180859 +4824 3.66697324799958 -0.0000608776308675951 -0.0011717802 +4825 3.66773339999958 -0.00005999035303594361 -0.0011626879 +4826 3.66849355199958 -0.000059109991804584505 -0.0011535826 +4827 3.66925370399958 -0.0000582365568595478 -0.0011444648 +4828 3.67001385599958 -0.000057370057457206705 -0.0011353351 +4829 3.67077400799958 -0.0000565105024222801 -0.001126194 +4830 3.67153415999958 -0.0000556579001449453 -0.0011170423 +4831 3.67229431199958 -0.0000548122585782851 -0.0011078803 +4832 3.67305446399958 -0.000053973585236510904 -0.0010987088 +4833 3.67381461599958 -0.000053141887191410206 -0.0010895283 +4834 3.67457476799958 -0.0000523171710710146 -0.0010803393 +4835 3.67533491999958 -0.00005149944305604671 -0.0010711425 +4836 3.67609507199958 -0.00005068870887825481 -0.0010619384 +4837 3.67685522399958 -0.0000498849738174156 -0.0010527277 +4838 3.67761537599957 -0.000049088242699335504 -0.001043511 +4839 3.67837552799957 -0.000048298519892853205 -0.0010342888 +4840 3.67913567999957 -0.00004751580930761891 -0.0010250618 +4841 3.67989583199957 -0.000046740114391652404 -0.0010158305 +4842 3.68065598399957 -0.0000459714381289 -0.0010065956 +4843 3.68141613599957 -0.0000452097830364595 -0.00099735774 +4844 3.68217628799957 -0.0000444551511625813 -0.00098811748 +4845 3.68293643999957 -0.000043707544083670905 -0.00097887545 +4846 3.68369659199957 -0.000042966962902180105 -0.00096963228 +4847 3.68445674399957 -0.0000422334082438303 -0.00096038861 +4848 3.68521689599957 -0.0000415068802556151 -0.00095114506 +4849 3.68597704799957 -0.000040787378602691306 -0.00094190227 +4850 3.68673719999957 -0.0000400749024664915 -0.00093266088 +4851 3.68749735199957 -0.0000393694505417264 -0.00092342152 +4852 3.68825750399957 -0.000038671021034386604 -0.00091418485 +4853 3.68901765599957 -0.000037979611658745 -0.00090495151 +4854 3.68977780799957 -0.0000372952196354692 -0.00089572215 +4855 3.69053795999957 -0.00003661784168862431 -0.00088649743 +4856 3.69129811199957 -0.0000359474740435628 -0.00087727801 +4857 3.69205826399957 -0.000035284112424038804 -0.00086806454 +4858 3.69281841599957 -0.000034627752050320204 -0.00085885769 +4859 3.69357856799957 -0.000033978387636191 -0.00084965814 +4860 3.69433871999957 -0.000033336013386509004 -0.00084046654 +4861 3.69509887199957 -0.0000327006229950966 -0.00083128358 +4862 3.69585902399957 -0.000032072209641853506 -0.00082210992 +4863 3.69661917599957 -0.000031450765990759203 -0.00081294626 +4864 3.69737932799957 -0.0000308362841867638 -0.00080379328 +4865 3.69813947999957 -0.000030228755853789503 -0.00079465166 +4866 3.69889963199957 -0.0000296281720920666 -0.00078552209 +4867 3.69965978399957 -0.0000290345234756906 -0.00077640527 +4868 3.70041993599957 -0.0000284478000502908 -0.0007673019 +4869 3.70118008799957 -0.000027867991330143804 -0.00075821267 +4870 3.70194023999957 -0.0000272950862961752 -0.00074913829 +4871 3.70270039199957 -0.0000267290733931835 -0.00074007946 +4872 3.70346054399957 -0.0000261699405275095 -0.0007310369 +4873 3.70422069599957 -0.00002561767506426 -0.00072201132 +4874 3.70498084799957 -0.0000250722638253098 -0.00071300344 +4875 3.70574099999957 -0.000024533693086636904 -0.00070401397 +4876 3.70650115199957 -0.0000240019485754361 -0.00069504363 +4877 3.70726130399957 -0.000023477015468342802 -0.00068609317 +4878 3.70802145599957 -0.0000229588783884349 -0.00067716329 +4879 3.70878160799957 -0.0000224475214029018 -0.00066825475 +4880 3.70954175999957 -0.000021942928020601803 -0.00065936827 +4881 3.71030191199957 -0.0000214450811897304 -0.00065050459 +4882 3.71106206399957 -0.0000209539632950451 -0.00064166445 +4883 3.71182221599957 -0.0000204695561553114 -0.00063284861 +4884 3.71258236799957 -0.0000199918410215272 -0.00062405781 +4885 3.71334251999957 -0.000019520798573591202 -0.0006152928 +4886 3.71410267199956 -0.000019056408918194402 -0.00060655434 +4887 3.71486282399956 -0.000018598651586487803 -0.00059784319 +4888 3.71562297599956 -0.0000181475055314184 -0.0005891601 +4889 3.71638312799956 -0.0000177029491252867 -0.00058050586 +4890 3.71714327999956 -0.000017264960157303802 -0.00057188121 +4891 3.71790343199956 -0.0000168335158309274 -0.00056328695 +4892 3.71866358399956 -0.000016408592761640902 -0.00055472383 +4893 3.71942373599956 -0.0000159901669745111 -0.00054619264 +4894 3.72018388799956 -0.0000155782139014127 -0.00053769417 +4895 3.72094403999956 -0.0000151727083786968 -0.00052922919 +4896 3.72170419199956 -0.0000147736246447483 -0.0005207985 +4897 3.72246434399956 -0.0000143809363376546 -0.00051240288 +4898 3.72322449599956 -0.000013994616492429802 -0.00050404314 +4899 3.72398464799956 -0.0000136146375385726 -0.00049572006 +4900 3.72474479999956 -0.000013240971297956402 -0.00048743446 +4901 3.72550495199956 -0.000012873588981832102 -0.00047918713 +4902 3.72626510399956 -0.000012512461188718401 -0.00047097888 +4903 3.72702525599956 -0.0000121575579018485 -0.00046281053 +4904 3.72778540799956 -0.0000118088484867274 -0.00045468289 +4905 3.72854555999956 -0.0000114663016883565 -0.00044659677 +4906 3.72930571199956 -0.000011129885629124202 -0.000438553 +4907 3.73006586399956 -0.0000107995678061412 -0.0004305524 +4908 3.73082601599956 -0.000010475315088909202 -0.0004225958 +4909 3.73158616799956 -0.000010157093716767202 -0.00041468403 +4910 3.73234631999956 -9.84486929633821e-6 -0.00040681792 +4911 3.73310647199956 -9.538606798975559e-6 -0.00039899832 +4912 3.73386662399956 -9.23827055854254e-6 -0.00039122605 +4913 3.73462677599956 -8.94382426896989e-6 -0.00038350197 +4914 3.73538692799956 -8.65523098148024e-6 -0.00037582692 +4915 3.73614707999956 -8.37245310225665e-6 -0.00036820175 +4916 3.73690723199956 -8.09545238988907e-6 -0.00036062731 +4917 3.73766738399956 -7.82418995315393e-6 -0.00035310447 +4918 3.73842753599956 -7.558626248238549e-6 -0.00034563408 +4919 3.73918768799956 -7.2987210765207405e-6 -0.00033821701 +4920 3.73994783999956 -7.04443358190421e-6 -0.00033085411 +4921 3.74070799199956 -6.79572224826508e-6 -0.00032354627 +4922 3.74146814399956 -6.55254489723145e-6 -0.00031629435 +4923 3.74222829599956 -6.314858685629859e-6 -0.00030909923 +4924 3.74298844799956 -6.08262010293181e-6 -0.00030196179 +4925 3.74374859999956 -5.8557849687002095e-6 -0.00029488291 +4926 3.74450875199956 -5.63430843047996e-6 -0.00028786349 +4927 3.74526890399956 -5.4181449608004e-6 -0.0002809044 +4928 3.74602905599956 -5.20724835506581e-6 -0.00027400654 +4929 3.74678920799956 -5.0015717291129696e-6 -0.0002671708 +4930 3.74754935999956 -4.8010675164356095e-6 -0.00026039809 +4931 3.74830951199956 -4.60568746585288e-6 -0.00025368931 +4932 3.74906966399956 -4.41538263928898e-6 -0.00024704537 +4933 3.74982981599956 -4.2301034087755e-6 -0.00024046716 +4934 3.75058996799955 -4.04979945456407e-6 -0.00023395561 +4935 3.75135011999955 -3.874419762128769e-6 -0.00022751163 +4936 3.75211027199955 -3.7039126199456296e-6 -0.00022113613 +4937 3.75287042399955 -3.5382256170501896e-6 -0.00021483005 +4938 3.75363057599955 -3.37730564059502e-6 -0.0002085943 +4939 3.75439072799955 -3.22109887307409e-6 -0.00020242981 +4940 3.75515087999955 -3.0695507902134297e-6 -0.00019633752 +4941 3.75591103199955 -2.92260615819551e-6 -0.00019031836 +4942 3.75667118399955 -2.78020903143883e-6 -0.00018437326 +4943 3.75743133599955 -2.64230274993338e-6 -0.00017850318 +4944 3.75819148799955 -2.50882993690915e-6 -0.00017270905 +4945 3.75895163999955 -2.37973249639367e-6 -0.00016699182 +4946 3.75971179199955 -2.25495161021438e-6 -0.00016135244 +4947 3.76047194399955 -2.1344277364443396e-6 -0.00015579187 +4948 3.76123209599955 -2.01810060618257e-6 -0.00015031107 +4949 3.76199224799955 -1.90590922122258e-6 -0.00014491099 +4950 3.76275239999955 -1.7977918520539798e-6 -0.0001395926 +4951 3.76351255199955 -1.69368603442077e-6 -0.00013435687 +4952 3.76427270399955 -1.59352856810013e-6 -0.00012920477 +4953 3.76503285599955 -1.49725551323865e-6 -0.00012413726 +4954 3.76579300799955 -1.4048021886869899e-6 -0.00011915534 +4955 3.76655315999955 -1.31610316900233e-6 -0.00011425998 +4956 3.76731331199955 -1.23109228256091e-6 -0.00010945216 +4957 3.76807346399955 -1.1497026084494898e-6 -0.00010473287 +4958 3.76883361599955 -1.07186647435586e-6 -0.00010010311 +4959 3.76959376799955 -9.97515454015385e-7 -9.5563854e-05 +4960 3.77035391999955 -9.26580364546403e-7 -9.1116112e-05 +4961 3.77111407199955 -8.589912646739251e-7 -8.676088e-05 +4962 3.77187422399955 -7.946774510658729e-7 -8.2499163e-05 +4963 3.77263437599955 -7.335674570008169e-7 -7.8331966e-05 +4964 3.77339452799955 -6.75589049370373e-7 -7.42603e-05 +4965 3.77415467999955 -6.2066922601467e-7 -7.0285177e-05 +4966 3.77491483199955 -5.687342137239429e-7 -6.6407614e-05 +4967 3.77567498399955 -5.19709465351958e-7 -6.2628629e-05 +4968 3.77643513599955 -4.7351965781761194e-7 -5.8949247e-05 +4969 3.77719528799955 -4.3008868888527703e-7 -5.5370493e-05 +4970 3.77795543999955 -3.8933967549947797e-7 -5.1893396e-05 +4971 3.77871559199955 -3.51194950898304e-7 -4.8518989e-05 +4972 3.77947574399955 -3.15576061837852e-7 -4.5248308e-05 +4973 3.78023589599955 -2.8240376703791996e-7 -4.2082392e-05 +4974 3.78099604799955 -2.51598033518263e-7 -3.9022282e-05 +4975 3.78175619999955 -2.2307803515531098e-7 -3.6069025e-05 +4976 3.78251635199955 -1.9676214979558198e-7 -3.322367e-05 +4977 3.78327650399955 -1.7256795636910698e-7 -3.0487269e-05 +4978 3.78403665599955 -1.50412233224095e-7 -2.7860876e-05 +4979 3.78479680799955 -1.30210955129328e-7 -2.5345551e-05 +4980 3.78555695999955 -1.11879290831673e-7 -2.2942355e-05 +4981 3.78631711199955 -9.53316006135907e-8 -2.0652354e-05 +4982 3.78707726399954 -8.048143418371011e-8 -1.8476616e-05 +4983 3.78783741599954 -6.72415274571847e-8 -1.6416212e-05 +4984 3.78859756799954 -5.5523800668311196e-8 -1.4472218e-05 +4985 3.78935771999954 -4.5239355928039495e-8 -1.2645712e-05 +4986 3.79011787199954 -3.62984743373929e-8 -1.0937774e-05 +4987 3.79087802399954 -2.86106136559994e-8 -9.3494907e-06 +4988 3.79163817599954 -2.2084406192668402e-8 -7.8819487e-06 +4989 3.79239832799954 -1.66276555857436e-8 -6.5362395e-06 +4990 3.79315847999954 -1.2147335137768801e-8 -5.3134574e-06 +4991 3.79391863199954 -8.54958503992975e-9 -4.2147004e-06 +4992 3.79467878399954 -5.73970926343037e-9 -3.2410693e-06 +4993 3.79543893599954 -3.62217444926927e-9 -2.3936683e-06 +4994 3.79619908799954 -2.10060580041471e-9 -1.6736049e-06 +4995 3.79695923999954 -1.0777861936262002e-9 -1.0819899e-06 +4996 3.79771939199954 -4.5565229367383603e-10 -6.1993718e-07 +4997 3.79847954399954 -1.3529322107075403e-10 -2.8856397e-07 +4998 3.79923969599954 -1.69473324262981e-11 -8.89909e-08 +4999 3.79999984799954 0 0 diff --git a/potentials/W.SNAP_HePair.pot b/potentials/W.SNAP_HePair.pot new file mode 100644 index 0000000000..eb5ee4dfbe --- /dev/null +++ b/potentials/W.SNAP_HePair.pot @@ -0,0 +1,17 @@ +# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. to appear in arxiv Feb2017, W-He and He-He from Juslin, N. and Wirth, B. D. Journal of Nuclear Materials, 423, (2013) p61-63 +# +# Definition of SNAP+ZBL+Tabulated potential. +variable zblcutinner equal 4 +variable zblcutouter equal 4.8 +variable zblz equal 74 + +# Specify hybrid with SNAP, ZBL, and long-range Coulomb + +pair_style hybrid/overlay zbl ${zblcutinner} ${zblcutouter} snap table spline 10000 table spline 10000 +pair_coeff 1 1 zbl ${zblz} ${zblz} +pair_coeff * * snap W_2940_2017_2.snapcoeff W W_2940_2017_2.snapparam W NULL +pair_coeff 2 2 table 1 He_He_JW2013.table HeHe +pair_coeff 1 2 table 2 W_He_JW2013.table WHe +#Hybrid/overlay will take all pair styles and add their contributions equally, order of pair_coeff doesnt matter here +#This is not the case for pair_style hybrid ... where only one pair_coeff is read for each type combination, order matters here. + diff --git a/potentials/W_2940_2017_2.pot.snap b/potentials/W_2940_2017_2.pot.snap new file mode 100644 index 0000000000..ea98d65c9e --- /dev/null +++ b/potentials/W_2940_2017_2.pot.snap @@ -0,0 +1,16 @@ +# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. to appear in arxiv Feb2017 +# +# Definition of SNAP+ZBL potential. +variable zblcutinner equal 4 +variable zblcutouter equal 4.8 +variable zblz equal 74 + +# Specify hybrid with SNAP, ZBL, and long-range Coulomb + +pair_style hybrid/overlay & +zbl ${zblcutinner} ${zblcutouter} & +snap +pair_coeff 1 1 zbl ${zblz} ${zblz} +pair_coeff * * snap W_2940_2017_2.snapcoeff W W_2940_2017_2.snapparam W + +#Nomenclature on the snap files are Element_DakotaID_Year_Month diff --git a/potentials/W_2940_2017_2.snapcoeff b/potentials/W_2940_2017_2.snapcoeff new file mode 100644 index 0000000000..98a5c50635 --- /dev/null +++ b/potentials/W_2940_2017_2.snapcoeff @@ -0,0 +1,62 @@ +# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. to appear in arxiv Feb2017 +# +# LAMMPS SNAP coefficients for W + +1 56 +W 0.5 1 + 0.781170857801 + -0.001794941735 + -0.016628679036 + -0.066625537037 + -0.073716343967 + -0.062913923923 + 0.032552694672 + -0.134901744419 + -0.075076334103 + -0.148558616547 + -0.140808831101 + -0.166749145704 + -0.047487675984 + -0.049892090603 + -0.032483739965 + -0.114766534860 + -0.106759718242 + -0.125894850485 + -0.103409735225 + -0.095247335447 + -0.061998736346 + -0.053895610976 + -0.010799734206 + -0.011644828900 + -0.028316826924 + 0.011176085541 + 0.064619474684 + -0.023886279996 + -0.004099224312 + -0.056084222496 + -0.035551497650 + -0.056678501024 + -0.004905851656 + -0.015701146162 + -0.008462280779 + 0.016429018676 + 0.032432633993 + -0.010805361272 + -0.014841893457 + 0.019414134562 + -0.008112452759 + -0.002700775447 + 0.007032887063 + -0.009706065042 + 0.008385967833 + 0.028606085876 + -0.007003591067 + 0.006467260152 + -0.006666986361 + 0.029243285316 + 0.002477673872 + -0.000199497504 + 0.004068954075 + 0.006036129972 + -0.013010633924 + -0.008314173699 diff --git a/potentials/W_2940_2017_2.snapparam b/potentials/W_2940_2017_2.snapparam new file mode 100644 index 0000000000..7ff57c905d --- /dev/null +++ b/potentials/W_2940_2017_2.snapparam @@ -0,0 +1,12 @@ +# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Wood, M. A. and Thompson, A. P. to appear in arxiv Feb2017 +# +# required +rcutfac 4.73442 +twojmax 8 + +# optional + +gamma 1 +rfac0 0.99363 +rmin0 0 +diagonalstyle 3 diff --git a/potentials/W_He_JW2013.table b/potentials/W_He_JW2013.table new file mode 100644 index 0000000000..8caec71935 --- /dev/null +++ b/potentials/W_He_JW2013.table @@ -0,0 +1,333 @@ +# DATE: 2017-02-20 CONTRIBUTOR: Mitchell Wood mitwood@sandia.gov CITATION: Juslin, N. and Wirth, B. D. Journal of Nuclear Materials, 423, (2013) p61-63 +# +#-> LAMMPS Potential File in tabular format. <-# +# N. Juslin and B.D. Wirth, J. Nucl. Mater. 432: 61-66 (2013). # +# Implemented by K.D. Hammond (2013) karlh@utk.edu +WHe +N 325 + +1 0.000001 193967.941432641 21165142.7035409 +2 0.02 88781.7058271842 5199760.86773195 +3 0.03 54461.7226844158 2255783.27652381 +4 0.04 37754.4525147374 1233285.07338825 +5 0.05 28027.0551422937 765154.791685769 +6 0.06 21746.7711436002 514318.047209743 +7 0.07 17407.2122555268 365457.111099578 +8 0.08 14260.380890756 270524.172812057 +9 0.09 11894.315375388 206649.630589727 +10 0.1 10064.3593879466 161847.200920021 +11 0.11 8616.61401638085 129358.142417815 +12 0.12 7449.7679909506 105145.917230655 +13 0.13 6494.61875555217 86685.1834957916 +14 0.14 5702.42313976808 72334.2424211515 +15 0.15 5037.94580316996 60990.8171175998 +16 0.16 4475.14199778904 51894.0939422829 +17 0.17 3994.38401078788 44506.229619365 +18 0.18 3580.62666819885 38438.9489608325 +19 0.19 3222.16279673461 33406.7013437966 +20 0.2 2909.75986785247 29195.976537891 +21 0.21 2636.04908399207 25644.7364933058 +22 0.22 2395.08534986163 22628.3414553063 +23 0.23 2182.02521022247 20049.740107058 +24 0.24 1992.88767473625 17832.5164484929 +25 0.25 1824.374223221 15915.8858113167 +26 0.26 1673.73168801722 14251.0430039002 +27 0.27 1538.64662154286 12798.4627755747 +28 0.28 1417.16307190682 11525.8804272463 +29 0.29 1307.61796220838 10406.7644777657 +30 0.3 1208.58985019291 9419.14958758174 +31 0.31 1118.8579596074 8544.73619272459 +32 0.32 1037.36917029033 7768.18965475981 +33 0.33 963.211228625566 7076.59012069084 +34 0.34 895.590859433663 6458.9972713357 +35 0.35 833.815769676712 5906.10340798657 +36 0.36 777.27976462076 5409.9550164674 +37 0.37 725.450370074705 4963.72782166695 +38 0.38 677.858485369477 4561.54392990095 +39 0.39 634.089691821654 4198.3223154716 +40 0.4 593.776918443069 3869.65589682796 +41 0.41 556.594226358163 3571.70994736531 +42 0.42 522.251519987548 3301.13772506169 +43 0.43 490.490029664824 3055.01007668961 +44 0.44 461.07843929567 2830.75644369566 +45 0.45 433.809555685745 2626.11521737135 +46 0.46 408.497434574275 2439.09179705296 +47 0.47 384.974893215623 2267.92302383156 +48 0.48 363.091351319355 2111.04691385653 +49 0.49 342.710951882019 1967.07681501168 +50 0.5 323.710921379843 1834.77927007332 +51 0.51 305.980135298364 1713.05499722693 +52 0.52 289.417860333203 1600.9225017701 +53 0.53 273.932649026687 1497.50391617084 +54 0.54 259.44136628296 1402.0127334168 +55 0.55 245.86833026895 1313.74315392891 +56 0.56 233.144552771494 1232.06081168718 +57 0.57 221.207066231741 1156.3946825672 +58 0.58 209.998326488761 1086.23000874818 +59 0.59 199.465681793803 1021.10209864685 +60 0.6 189.560899952328 960.590883129588 +61 0.61 180.239746551915 904.316126537919 +62 0.62 171.461608172096 851.933205957983 +63 0.63 163.189155273495 803.129384679904 +64 0.64 155.388040149985 757.62051633995 +65 0.65 148.026625916815 715.148125151611 +66 0.66 141.075743014823 675.476815185188 +67 0.67 134.508470148273 638.391968073426 +68 0.68 128.299936952045 603.697693987706 +69 0.69 122.427146011509 571.215005397664 +70 0.7 116.868812142757 540.780187122909 +71 0.71 111.605217088269 512.243339613345 +72 0.72 106.618077998551 485.467075341772 +73 0.73 101.890428258492 460.32535073159 +74 0.74 97.4065093817089 436.702418234594 +75 0.75 93.1516728402801 414.491885070093 +76 0.76 89.1122908237631 393.595866780115 +77 0.77 85.2756750325343 373.92422518237 +78 0.78 81.6300027083206 355.393881543952 +79 0.79 78.1642491910339 337.928196880203 +80 0.8 74.8681263671512 321.456412227117 +81 0.81 71.7320264421784 305.913142560798 +82 0.82 68.7469705293107 291.237918759986 +83 0.83 65.9045615992059 277.374772641144 +84 0.84 63.1969413826496 264.271860652001 +85 0.85 60.6167508595336 251.881122298665 +86 0.86 58.1570940046202 240.157969812335 +87 0.87 55.8115044935616 229.061005941579 +88 0.88 53.5739151020755 218.551767091662 +89 0.89 51.4386295574478 208.594489329042 +90 0.9 49.400296625012 199.15589503172 +91 0.91 47.4538862332645 190.204998198848 +92 0.92 45.5946674600827 181.712926639528 +93 0.93 43.818188219384 173.652759444123 +94 0.94 42.1202565026948 165.999378304597 +95 0.95 40.4969230436942 158.729331395598 +96 0.96 38.944465286023 151.820708657476 +97 0.97 37.4593725456438 145.253027437895 +98 0.98 36.03833226895 139.00712755184 +99 0.99 34.6782172967515 133.065074912029 +100 1 33.3760740523261 127.410072964226 +101 1.01 32.1291115790037 122.026381235854 +102 1.02 30.9346913593292 116.899240372539 +103 1.03 29.7903178538011 112.014803096661 +104 1.04 28.6936297025718 107.360070575369 +105 1.05 27.6423915383737 102.922833733498 +106 1.06 26.6344863633652 98.69161908997 +107 1.07 25.6679084466039 94.6556387351718 +108 1.08 24.7407567025028 90.804744101767 +109 1.09 23.8272933774771 87.0424919424945 +110 1.1 22.9746938084833 83.501083250349 +111 1.11 22.1568053467682 80.0995862713648 +112 1.12 21.372249301539 76.8339257499533 +113 1.13 20.6196874341871 73.7000865054019 +114 1.14 19.8978213575361 70.6941134318681 +115 1.15 19.2053919350916 67.8121114983956 +116 1.16 18.5411786802966 65.0502457488983 +117 1.17 17.9039991557794 62.4047413021631 +118 1.18 17.2927083726064 59.8718833518619 +119 1.19 16.7061981895337 57.4480171665332 +120 1.2 16.1433967122567 55.1295480895992 +121 1.21 15.6032676926612 52.9129415393513 +122 1.22 15.0848099280771 50.7947230089626 +123 1.23 14.5870566605305 48.7714780664787 +124 1.24 14.1090749759875 46.8398523548244 +125 1.25 13.6499652036138 44.9965515917961 +126 1.26 13.2088603150229 43.2383415700692 +127 1.27 12.784925323525 41.5620481571964 +128 1.28 12.3773566833817 39.9645572956038 +129 1.29 11.9853816890583 38.4428150025965 +130 1.3 11.60825787447 36.9938273703497 +131 1.31 11.2452724122346 35.6146605659201 +132 1.32 10.8957415129272 34.3024408312399 +133 1.33 10.5590098243284 33.0543544831148 +134 1.34 10.234449830679 31.8676479132323 +135 1.35 9.92146125192414 30.739627588146 +136 1.36 9.61947044297006 29.6676600492951 +137 1.37 9.32792979293674 28.6491719129885 +138 1.38 9.04631712440562 27.6816498704143 +139 1.39 8.77413509267092 26.7626406876384 +140 1.4 8.51091058499253 25.8897512055996 +141 1.41 8.25619411984519 25.0606483401084 +142 1.42 8.00955924617449 24.2730590818669 +143 1.43 7.77060194264106 23.524770496429 +144 1.44 7.53894001687615 22.8136297242495 +145 1.45 7.31421250473534 22.1375439806457 +146 1.46 7.09607906954318 21.4944805558102 +147 1.47 6.88421940134788 20.8824668148159 +148 1.48 6.678332616175 20.2995901976151 +149 1.49 6.47813665527576 19.743998219024 +150 1.5 6.28336768437487 19.2138984687485 +151 1.51 6.09377949293196 18.7075586113629 +152 1.52 5.90914289338127 18.2233063863173 +153 1.53 5.72924512039265 17.759529607943 +154 1.54 5.55388923011117 17.3146761654411 +155 1.55 5.38289349942409 16.8872540228954 +156 1.56 5.21609082520001 16.4758312192575 +157 1.57 5.05332812353902 16.0790358683639 +158 1.58 4.89446572903546 15.6955561589207 +159 1.59 4.73937679401809 15.3241403545121 +160 1.6 4.58794668780786 14.9635967935988 +161 1.61 4.44007239596442 14.6127938895147 +162 1.62 4.29566191954302 14.2706601304803 +163 1.63 4.15463367433779 13.9361840795741 +164 1.64 4.01691589014092 13.6084143747644 +165 1.65 3.88244600998598 13.2864597288958 +166 1.66 3.75117008941481 12.9694889296766 +167 1.67 3.62304219570535 12.6567308397093 +168 1.68 3.49802380713948 12.3474743964548 +169 1.69 3.37608321225264 12.04106861226 +170 1.7 3.25719490908079 11.7369225743464 +171 1.71 3.14133900441368 11.4345054448136 +172 1.72 3.02850061304264 11.1333464606264 +173 1.73 2.91866925702027 10.8330349336425 +174 1.74 2.81183826489826 10.533220250582 +175 1.75 2.70800417099883 10.233611873045 +176 1.76 2.60716611463897 9.93397933750975 +177 1.77 2.50932523941003 9.63415225533254 +178 1.78 2.41448409240832 9.3340203127359 +179 1.79 2.3226460234938 9.03353327083141 +180 1.8 2.23381458454253 8.732700965596 +181 1.81 2.14799292869986 8.43159330788831 +182 1.82 2.06518320961743 8.13034028344418 +183 1.83 1.98538598072548 7.82913195286937 +184 1.84 1.90859959447164 7.52821845164772 +185 1.85 1.83481960157053 7.2279099901466 +186 1.86 1.7640381502589 6.92857685359786 +187 1.87 1.69624338555161 6.63064940211416 +188 1.88 1.63141884849222 6.33461807069079 +189 1.89 1.56954287538349 6.04103336918388 +190 1.9 1.51058799706618 5.75050588234672 +191 1.91 1.45452033816503 5.46370626978796 +192 1.92 1.40129901631838 5.18136526601165 +193 1.93 1.35087554145878 4.90427368037354 +194 1.94 1.30319321504351 4.63328239712837 +195 1.95 1.25818652931969 4.36930237539354 +196 1.96 1.21578056655756 4.11330464916909 +197 1.97 1.17589039832831 3.86632032733041 +198 1.98 1.13842048472736 3.62944059362462 +199 1.99 1.10326407363948 3.4038167066833 +200 2 1.07030260000113 3.19065999999702 +201 2.01 1.03940508502285 2.99124188195356 +202 2.02 1.01042753546074 2.80689383580147 +203 2.03 0.98321234287971 2.63900741967382 +204 2.04 0.957587682867711 2.48903426657353 +205 2.05 0.93336691431989 2.35848608439528 +206 2.06 0.910347978676441 2.24893465587638 +207 2.07 0.888312799175878 2.16201183866769 +208 2.08 0.867026680100139 2.09940956527362 +209 2.09 0.846311972535292 2.0501194750481 +210 2.1 0.826052090711088 2.00205155230487 +211 2.11 0.806267097861257 1.95513674544071 +212 2.12 0.786945609506685 1.90934585391834 +213 2.13 0.7680765291529 1.86465047725327 +214 2.14 0.749649040410966 1.82102299086693 +215 2.15 0.731652599355765 1.77843652275056 +216 2.16 0.714076927113717 1.73686493090964 +217 2.17 0.696912002672274 1.69628278155967 +218 2.18 0.680148055903811 1.65666532804561 +219 2.19 0.663775560796824 1.61798849045792 +220 2.2 0.647785228887586 1.5802288359199 +221 2.21 0.632168002885678 1.54336355952145 +222 2.22 0.616915050487049 1.50737046587586 +223 2.23 0.602017758368489 1.47222795127685 +224 2.24 0.587467726357617 1.43791498643425 +225 2.25 0.573256761772716 1.40441109976729 +226 2.26 0.559376873926913 1.37169636123572 +227 2.27 0.54582026879146 1.33975136668933 +228 2.28 0.532579343812991 1.30855722271748 +229 2.29 0.519646682879861 1.27809553198093 +230 2.3 0.507015051432831 1.24834837900889 +231 2.31 0.494677391715517 1.21929831644497 +232 2.32 0.482626818160208 1.19092835172618 +233 2.33 0.470856612904789 1.16322193418007 +234 2.34 0.459360221436662 1.1361629425252 +235 2.35 0.448131248359705 1.10973567276124 +236 2.36 0.437163453280438 1.08392482643501 +237 2.37 0.426450746809703 1.05871549926971 +238 2.38 0.415987186676291 1.0340931701448 +239 2.39 0.405766973949056 1.01004369041464 +240 2.4 0.395784449364215 0.986553273554313 +241 2.41 0.38603408975458 0.963608485121541 +242 2.42 0.376510504577652 0.941196233024116 +243 2.43 0.367208432539548 0.919303758082476 +244 2.44 0.358122738311864 0.897918624877599 +245 2.45 0.349248409338683 0.877028712874665 +246 2.46 0.340580552730998 0.85662220781334 +247 2.47 0.332114392245936 0.83668759335581 +248 2.48 0.323845265348255 0.8172136429841 +249 2.49 0.315768620351645 0.798189412138432 +250 2.5 0.307880013637488 0.779604230588763 +251 2.51 0.300175106948751 0.761447695031842 +252 2.52 0.292649664756829 0.743709661906479 +253 2.53 0.285299551699157 0.726380240419923 +254 2.54 0.278120730085547 0.70944978577854 +255 2.55 0.271109257471214 0.69290889261619 +256 2.56 0.264149883217677 0.704309455966822 +257 2.57 0.257023670963235 0.720548414483017 +258 2.58 0.249746544950963 0.73449858053557 +259 2.59 0.242341191411443 0.746201328856265 +260 2.6 0.234829852474346 0.755704032488528 +261 2.61 0.227234268357011 0.763059628544665 +262 2.62 0.219575623890343 0.768326185205915 +263 2.63 0.211874499363033 0.771566471270733 +264 2.64 0.204150825652343 0.772847529495918 +265 2.65 0.196423843597567 0.772240254912945 +266 2.66 0.188712067560753 0.769818979238484 +267 2.67 0.181033253108439 0.765661062433794 +268 2.68 0.17340436873789 0.759846492402718 +269 2.69 0.165841571561793 0.752457493752577 +270 2.7 0.158360186856416 0.743578146476553 +271 2.71 0.150974691370005 0.733294015350452 +272 2.72 0.14369870028059 0.721691790771177 +273 2.73 0.136544957685405 0.708858941699004 +274 2.74 0.129525330497857 0.69488338130108 +275 2.75 0.122650805622294 0.679853145829612 +276 2.76 0.115931490271846 0.663856087205069 +277 2.77 0.10937661529017 0.646979579712699 +278 2.78 0.102994541334199 0.629310241159726 +279 2.79 0.0967927677717845 0.610933668781077 +280 2.8 0.0907779441455664 0.591934190123306 +281 2.81 0.0849558840523623 0.572394629079895 +282 2.82 0.0793315812859323 0.552396087196204 +283 2.83 0.0739092280900552 0.532017740309284 +284 2.84 0.0686922353684514 0.51133665053656 +285 2.85 0.0636832546982004 0.490427593578163 +286 2.86 0.058884201993894 0.469362901250494 +287 2.87 0.0542962826708072 0.448212319123508 +288 2.88 0.0499200181568738 0.427042879091302 +289 2.89 0.04575527360515 0.405918786664859 +290 2.9 0.0418012866607671 0.384901322737369 +291 2.91 0.0380566971390415 0.364048759536354 +292 2.92 0.0345195774744505 0.343416290443013 +293 2.93 0.0311874638035265 0.323055973327595 +294 2.94 0.0280573875483925 0.303016687020528 +295 2.95 0.0251259073715924 0.283344100512051 +296 2.96 0.0223891413770724 0.264080654448684 +297 2.97 0.0198427994365954 0.245265554472591 +298 2.98 0.017482215525515 0.226934775930029 +299 2.99 0.0153023799566589 0.20912107945741 +300 3 0.0132979714060716 0.191854036938167 +301 3.01 0.0114633886294948 0.175160067310366 +302 3.02 0.009792781773727 0.159062481694054 +303 3.03 0.00828008319235769 0.143581537298372 +304 3.04 0.00691903768080766 0.128734499561665 +305 3.05 0.00570323205109961 0.114535711972949 +306 3.06 0.0046261239723178 0.100996673020243 +307 3.07 0.00368107000826405 0.088126119710232 +308 3.08 0.00286135278937321 0.0759301171045549 +309 3.09 0.00216020726148435 0.0644121533205429 +310 3.1 0.00157084595956787 0.0535732394484653 +311 3.11 0.00108648325995938 0.0434120138431347 +312 3.12 0.000700358570037423 0.0339248502550448 +313 3.13 0.000405758419588332 0.0251059692749879 +314 3.14 0.000196037423311657 0.0169475525761798 +315 3.15 6.46380890244662E-05 0.00943985944932857 +316 3.16 5.1094511057313E-06 0.00257134513861945 +317 3.17 0 0 +318 3.18 0 0 +319 3.19 0 0 +320 3.2 0 0 +321 3.21 0 0 +322 3.22 0 0 +323 3.23 0 0 +324 3.24 0 0 +325 3.25 0 0 diff --git a/src/CLASS2/angle_class2.cpp b/src/CLASS2/angle_class2.cpp index 0315e6601f..7dfdaa17f4 100644 --- a/src/CLASS2/angle_class2.cpp +++ b/src/CLASS2/angle_class2.cpp @@ -41,6 +41,8 @@ AngleClass2::AngleClass2(LAMMPS *lmp) : Angle(lmp) {} AngleClass2::~AngleClass2() { + if (copymode) return; + if (allocated) { memory->destroy(setflag); memory->destroy(setflag_a); diff --git a/src/CLASS2/bond_class2.cpp b/src/CLASS2/bond_class2.cpp index f358720e7f..b016de0206 100644 --- a/src/CLASS2/bond_class2.cpp +++ b/src/CLASS2/bond_class2.cpp @@ -36,6 +36,8 @@ BondClass2::BondClass2(LAMMPS *lmp) : Bond(lmp) {} BondClass2::~BondClass2() { + if (copymode) return; + if (allocated) { memory->destroy(setflag); memory->destroy(r0); diff --git a/src/CLASS2/dihedral_class2.cpp b/src/CLASS2/dihedral_class2.cpp index 78be10fbca..b985a862d2 100644 --- a/src/CLASS2/dihedral_class2.cpp +++ b/src/CLASS2/dihedral_class2.cpp @@ -46,6 +46,8 @@ DihedralClass2::DihedralClass2(LAMMPS *lmp) : Dihedral(lmp) DihedralClass2::~DihedralClass2() { + if (copymode) return; + if (allocated) { memory->destroy(setflag); memory->destroy(setflag_d); diff --git a/src/CLASS2/improper_class2.cpp b/src/CLASS2/improper_class2.cpp index 618e20f6c3..e7c4aa94be 100644 --- a/src/CLASS2/improper_class2.cpp +++ b/src/CLASS2/improper_class2.cpp @@ -45,6 +45,8 @@ ImproperClass2::ImproperClass2(LAMMPS *lmp) : Improper(lmp) ImproperClass2::~ImproperClass2() { + if (copymode) return; + if (allocated) { memory->destroy(setflag); memory->destroy(setflag_i); diff --git a/src/COMPRESS/README b/src/COMPRESS/README index f53e3385d2..1a31445d0b 100644 --- a/src/COMPRESS/README +++ b/src/COMPRESS/README @@ -1,13 +1,14 @@ -This package provides alternative styles that allow compressed file I/O -via compression libraries. This is similar to what is enabled through -using the -DLAMMPS_GZIP preprocessor flag, but it does not open a pipe -to an external executable that handles the compression. These styles -use library calls to libraries like zlib instead and thus have to be -compiled using the library header files and linked to the respective -library. This provides an alternative for compressed file I/O on systems -where using a pipe can cause problems, e.g. when using RDMA communication -with pinned memory like clusters with Infiniband or Myrinet. - -At the moment a few selected dump styles are supported -for writing via this packaging. +This package provides derived dump styles that allow compressed file +I/O via compression libraries. This is similar to what is enabled +through using the -DLAMMPS_GZIP preprocessor flag and a *.gz suffix on +a dump file name when using a non-gz dump style (e.g. custom instead +of custom/gz), but it does not open a pipe to an external executable +that handles the compression. Instead these styles use library calls +to libraries like zlib, and thus have to be compiled using the library +header files and linked to the corresponding library. This provides an +alternative for compressed file I/O on systems where using a pipe can +cause problems, e.g. when using RDMA communication with pinned memory +like clusters with Infiniband or Myrinet. +Currently a few selected dump styles are supported for writing via +this packaging. diff --git a/src/GPU/pppm_gpu.cpp b/src/GPU/pppm_gpu.cpp index 12baec456c..99f61a7fc9 100644 --- a/src/GPU/pppm_gpu.cpp +++ b/src/GPU/pppm_gpu.cpp @@ -49,7 +49,7 @@ using namespace MathConst; #define LARGE 10000.0 #define EPS_HOC 1.0e-7 -enum{REVERSE_RHO}; +enum{REVERSE_RHO_GPU,REVERSE_RHO}; enum{FORWARD_IK,FORWARD_AD,FORWARD_IK_PERATOM,FORWARD_AD_PERATOM}; #ifdef FFT_SINGLE @@ -254,8 +254,8 @@ void PPPMGPU::compute(int eflag, int vflag) // to fully sum contribution in their 3d bricks // remap from 3d decomposition to FFT decomposition - cg->reverse_comm(this,REVERSE_RHO); - brick2fft(); + cg->reverse_comm(this,REVERSE_RHO_GPU); + brick2fft_gpu(); // compute potential gradient on my FFT grid and // portion of e_long on this proc's FFT grid @@ -355,7 +355,7 @@ void PPPMGPU::compute(int eflag, int vflag) remap density from 3d brick decomposition to FFT decomposition ------------------------------------------------------------------------- */ -void PPPMGPU::brick2fft() +void PPPMGPU::brick2fft_gpu() { int n,ix,iy,iz; @@ -619,10 +619,14 @@ void PPPMGPU::unpack_forward(int flag, FFT_SCALAR *buf, int nlist, int *list) void PPPMGPU::pack_reverse(int flag, FFT_SCALAR *buf, int nlist, int *list) { - if (flag == REVERSE_RHO) { + if (flag == REVERSE_RHO_GPU) { FFT_SCALAR *src = &density_brick_gpu[nzlo_out][nylo_out][nxlo_out]; for (int i = 0; i < nlist; i++) buf[i] = src[list[i]]; + } else if (flag == REVERSE_RHO) { + FFT_SCALAR *src = &density_brick[nzlo_out][nylo_out][nxlo_out]; + for (int i = 0; i < nlist; i++) + buf[i] = src[list[i]]; } } @@ -632,10 +636,14 @@ void PPPMGPU::pack_reverse(int flag, FFT_SCALAR *buf, int nlist, int *list) void PPPMGPU::unpack_reverse(int flag, FFT_SCALAR *buf, int nlist, int *list) { - if (flag == REVERSE_RHO) { + if (flag == REVERSE_RHO_GPU) { FFT_SCALAR *dest = &density_brick_gpu[nzlo_out][nylo_out][nxlo_out]; for (int i = 0; i < nlist; i++) dest[list[i]] += buf[i]; + } else if (flag == REVERSE_RHO) { + FFT_SCALAR *dest = &density_brick[nzlo_out][nylo_out][nxlo_out]; + for (int i = 0; i < nlist; i++) + dest[list[i]] += buf[i]; } } @@ -736,3 +744,117 @@ void PPPMGPU::setup() if (im_real_space) return; PPPM::setup(); } + +/* ---------------------------------------------------------------------- + group-group interactions + ------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + compute the PPPM total long-range force and energy for groups A and B + ------------------------------------------------------------------------- */ + +void PPPMGPU::compute_group_group(int groupbit_A, int groupbit_B, int AA_flag) +{ + if (slabflag && triclinic) + error->all(FLERR,"Cannot (yet) use K-space slab " + "correction with compute group/group for triclinic systems"); + + if (differentiation_flag) + error->all(FLERR,"Cannot (yet) use kspace_modify " + "diff ad with compute group/group"); + + if (!group_allocate_flag) allocate_groups(); + + // convert atoms from box to lamda coords + + if (triclinic == 0) boxlo = domain->boxlo; + else { + boxlo = domain->boxlo_lamda; + domain->x2lamda(atom->nlocal); + } + + // extend size of per-atom arrays if necessary + // part2grid needs to be allocated + + if (atom->nmax > nmax || part2grid == NULL) { + memory->destroy(part2grid); + nmax = atom->nmax; + memory->create(part2grid,nmax,3,"pppm:part2grid"); + } + + particle_map(); + + e2group = 0.0; //energy + f2group[0] = 0.0; //force in x-direction + f2group[1] = 0.0; //force in y-direction + f2group[2] = 0.0; //force in z-direction + + // map my particle charge onto my local 3d density grid + + make_rho_groups(groupbit_A,groupbit_B,AA_flag); + + // all procs communicate density values from their ghost cells + // to fully sum contribution in their 3d bricks + // remap from 3d decomposition to FFT decomposition + + // temporarily store and switch pointers so we can + // use brick2fft() for groups A and B (without + // writing an additional function) + + FFT_SCALAR ***density_brick_real = density_brick; + FFT_SCALAR *density_fft_real = density_fft; + + // group A + + density_brick = density_A_brick; + density_fft = density_A_fft; + + cg->reverse_comm(this,REVERSE_RHO); + brick2fft(); + + // group B + + density_brick = density_B_brick; + density_fft = density_B_fft; + + cg->reverse_comm(this,REVERSE_RHO); + brick2fft(); + + // switch back pointers + + density_brick = density_brick_real; + density_fft = density_fft_real; + + // compute potential gradient on my FFT grid and + // portion of group-group energy/force on this proc's FFT grid + + poisson_groups(AA_flag); + + const double qscale = qqrd2e * scale; + + // total group A <--> group B energy + // self and boundary correction terms are in compute_group_group.cpp + + double e2group_all; + MPI_Allreduce(&e2group,&e2group_all,1,MPI_DOUBLE,MPI_SUM,world); + e2group = e2group_all; + + e2group *= qscale*0.5*volume; + + // total group A <--> group B force + + double f2group_all[3]; + MPI_Allreduce(f2group,f2group_all,3,MPI_DOUBLE,MPI_SUM,world); + + f2group[0] = qscale*volume*f2group_all[0]; + f2group[1] = qscale*volume*f2group_all[1]; + if (slabflag != 2) f2group[2] = qscale*volume*f2group_all[2]; + + // convert atoms back from lamda to box coords + + if (triclinic) domain->lamda2x(atom->nlocal); + + if (slabflag == 1) + slabcorr_groups(groupbit_A, groupbit_B, AA_flag); +} + diff --git a/src/GPU/pppm_gpu.h b/src/GPU/pppm_gpu.h index 3a9b537487..b37358e091 100644 --- a/src/GPU/pppm_gpu.h +++ b/src/GPU/pppm_gpu.h @@ -35,13 +35,15 @@ class PPPMGPU : public PPPM { int timing_3d(int, double &); double memory_usage(); + virtual void compute_group_group(int, int, int); + protected: FFT_SCALAR ***density_brick_gpu, ***vd_brick; bool kspace_split, im_real_space; int old_nlocal; double poisson_time; - void brick2fft(); + void brick2fft_gpu(); virtual void poisson_ik(); void pack_forward(int, FFT_SCALAR *, int, int *); diff --git a/src/GRANULAR/fix_wall_gran_region.cpp b/src/GRANULAR/fix_wall_gran_region.cpp index 996708c1a6..e9e27b90e6 100644 --- a/src/GRANULAR/fix_wall_gran_region.cpp +++ b/src/GRANULAR/fix_wall_gran_region.cpp @@ -279,7 +279,7 @@ void FixWallGranRegion::update_contacts(int i, int nc) while (iold < ncontact[i]) { for (m = 0; m < nc; m++) if (region->contact[m].iwall == walls[i][iold]) break; - if (m < nc) { + if (m >= nc) { ilast = ncontact[i]-1; for (j = 0; j < sheardim; j++) shearmany[i][iold][j] = shearmany[i][ilast][j]; diff --git a/src/GRANULAR/pair_gran_hertz_history.cpp b/src/GRANULAR/pair_gran_hertz_history.cpp index bcb895ac72..e52aac10db 100644 --- a/src/GRANULAR/pair_gran_hertz_history.cpp +++ b/src/GRANULAR/pair_gran_hertz_history.cpp @@ -95,8 +95,8 @@ void PairGranHertzHistory::compute(int eflag, int vflag) ilist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; - firsttouch = list->listgranhistory->firstneigh; - firstshear = list->listgranhistory->firstdouble; + firsttouch = list->listhistory->firstneigh; + firstshear = list->listhistory->firstdouble; // loop over neighbors of my atoms @@ -407,7 +407,7 @@ double PairGranHertzHistory::single(int i, int j, int itype, int jtype, int jnum = list->numneigh[i]; int *jlist = list->firstneigh[i]; - double *allshear = list->listgranhistory->firstdouble[i]; + double *allshear = list->listhistory->firstdouble[i]; for (int jj = 0; jj < jnum; jj++) { neighprev++; diff --git a/src/GRANULAR/pair_gran_hooke_history.cpp b/src/GRANULAR/pair_gran_hooke_history.cpp index ac5efb48df..6f2d3d69ce 100644 --- a/src/GRANULAR/pair_gran_hooke_history.cpp +++ b/src/GRANULAR/pair_gran_hooke_history.cpp @@ -137,8 +137,8 @@ void PairGranHookeHistory::compute(int eflag, int vflag) ilist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; - firsttouch = listgranhistory->firstneigh; - firstshear = listgranhistory->firstdouble; + firsttouch = listhistory->firstneigh; + firstshear = listhistory->firstdouble; // loop over neighbors of my atoms @@ -403,13 +403,11 @@ void PairGranHookeHistory::init_style() // need a granular neigh list and optionally a granular history neigh list int irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->gran = 1; + neighbor->requests[irequest]->size = 1; if (history) { irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 1; - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->granhistory = 1; + neighbor->requests[irequest]->history = 1; neighbor->requests[irequest]->dnum = 3; } @@ -510,7 +508,7 @@ void PairGranHookeHistory::init_style() void PairGranHookeHistory::init_list(int id, NeighList *ptr) { if (id == 0) list = ptr; - else if (id == 1) listgranhistory = ptr; + else if (id == 1) listhistory = ptr; } /* ---------------------------------------------------------------------- @@ -706,7 +704,7 @@ double PairGranHookeHistory::single(int i, int j, int itype, int jtype, int jnum = list->numneigh[i]; int *jlist = list->firstneigh[i]; - double *allshear = list->listgranhistory->firstdouble[i]; + double *allshear = list->listhistory->firstdouble[i]; for (int jj = 0; jj < jnum; jj++) { neighprev++; diff --git a/src/KOKKOS/Install.sh b/src/KOKKOS/Install.sh index f53f8624c4..abe7b47e72 100644 --- a/src/KOKKOS/Install.sh +++ b/src/KOKKOS/Install.sh @@ -35,6 +35,8 @@ touch ../memory.h action angle_charmm_kokkos.cpp angle_charmm.cpp action angle_charmm_kokkos.h angle_charmm.h +action angle_class2_kokkos.cpp angle_class2.cpp +action angle_class2_kokkos.h angle_class2.h action angle_harmonic_kokkos.cpp angle_harmonic.cpp action angle_harmonic_kokkos.h angle_harmonic.h action atom_kokkos.cpp @@ -55,6 +57,8 @@ action atom_vec_kokkos.cpp action atom_vec_kokkos.h action atom_vec_molecular_kokkos.cpp atom_vec_molecular.cpp action atom_vec_molecular_kokkos.h atom_vec_molecular.h +action bond_class2_kokkos.cpp bond_class2.cpp +action bond_class2_kokkos.h bond_class2.h action bond_fene_kokkos.cpp bond_fene.cpp action bond_fene_kokkos.h bond_fene.h action bond_harmonic_kokkos.cpp bond_harmonic.cpp @@ -67,6 +71,8 @@ action compute_temp_kokkos.cpp action compute_temp_kokkos.h action dihedral_charmm_kokkos.cpp dihedral_charmm.cpp action dihedral_charmm_kokkos.h dihedral_charmm.h +action dihedral_class2_kokkos.cpp dihedral_class2.cpp +action dihedral_class2_kokkos.h dihedral_class2.h action dihedral_opls_kokkos.cpp dihedral_opls.cpp action dihedral_opls_kokkos.h dihedral_opls.h action domain_kokkos.cpp @@ -105,6 +111,8 @@ action fix_dpd_energy_kokkos.cpp fix_dpd_energy.cpp action fix_dpd_energy_kokkos.h fix_dpd_energy.h action gridcomm_kokkos.cpp gridcomm.cpp action gridcomm_kokkos.h gridcomm.h +action improper_class2_kokkos.cpp improper_class2.cpp +action improper_class2_kokkos.h improper_class2.h action improper_harmonic_kokkos.cpp improper_harmonic.cpp action improper_harmonic_kokkos.h improper_harmonic.h action kokkos.cpp diff --git a/src/KOKKOS/angle_class2_kokkos.cpp b/src/KOKKOS/angle_class2_kokkos.cpp new file mode 100644 index 0000000000..0232571bcc --- /dev/null +++ b/src/KOKKOS/angle_class2_kokkos.cpp @@ -0,0 +1,526 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: Ray Shan (Materials Design) +------------------------------------------------------------------------- */ + +#include +#include +#include "angle_class2_kokkos.h" +#include "atom_kokkos.h" +#include "neighbor_kokkos.h" +#include "domain.h" +#include "comm.h" +#include "force.h" +#include "math_const.h" +#include "memory.h" +#include "error.h" +#include "atom_masks.h" + +using namespace LAMMPS_NS; +using namespace MathConst; + +#define SMALL 0.001 + +/* ---------------------------------------------------------------------- */ + +template +AngleClass2Kokkos::AngleClass2Kokkos(LAMMPS *lmp) : AngleClass2(lmp) +{ + atomKK = (AtomKokkos *) atom; + neighborKK = (NeighborKokkos *) neighbor; + execution_space = ExecutionSpaceFromDevice::space; + datamask_read = X_MASK | F_MASK | ENERGY_MASK | VIRIAL_MASK; + datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; +} + +/* ---------------------------------------------------------------------- */ + +template +AngleClass2Kokkos::~AngleClass2Kokkos() +{ + if (!copymode) { + memory->destroy_kokkos(k_eatom,eatom); + memory->destroy_kokkos(k_vatom,vatom); + } +} + +/* ---------------------------------------------------------------------- */ + +template +void AngleClass2Kokkos::compute(int eflag_in, int vflag_in) +{ + eflag = eflag_in; + vflag = vflag_in; + + if (eflag || vflag) ev_setup(eflag,vflag); + else evflag = 0; + + // reallocate per-atom arrays if necessary + + if (eflag_atom) { + memory->destroy_kokkos(k_eatom,eatom); + memory->create_kokkos(k_eatom,eatom,maxeatom,"angle:eatom"); + d_eatom = k_eatom.template view(); + } + if (vflag_atom) { + memory->destroy_kokkos(k_vatom,vatom); + memory->create_kokkos(k_vatom,vatom,maxvatom,6,"angle:vatom"); + d_vatom = k_vatom.template view(); + } + + //atomKK->sync(execution_space,datamask_read); + //if (eflag || vflag) atomKK->modified(execution_space,datamask_modify); + //else atomKK->modified(execution_space,F_MASK); + + k_theta0.template sync(); + k_k2.template sync(); + k_k3.template sync(); + k_k4.template sync(); + k_bb_k.template sync(); + k_bb_r1.template sync(); + k_bb_r2.template sync(); + k_ba_k1.template sync(); + k_ba_k2.template sync(); + k_ba_r1.template sync(); + k_ba_r2.template sync(); + k_setflag.template sync(); + k_setflag_a.template sync(); + k_setflag_bb.template sync(); + k_setflag_ba.template sync(); + + x = atomKK->k_x.template view(); + f = atomKK->k_f.template view(); + neighborKK->k_anglelist.template sync(); + anglelist = neighborKK->k_anglelist.template view(); + int nanglelist = neighborKK->nanglelist; + nlocal = atom->nlocal; + newton_bond = force->newton_bond; + + copymode = 1; + + // loop over neighbors of my atoms + + EV_FLOAT ev; + + if (evflag) { + if (newton_bond) { + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,nanglelist),*this,ev); + } else { + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,nanglelist),*this,ev); + } + } else { + if (newton_bond) { + Kokkos::parallel_for(Kokkos::RangePolicy >(0,nanglelist),*this); + } else { + Kokkos::parallel_for(Kokkos::RangePolicy >(0,nanglelist),*this); + } + } + + if (eflag_global) energy += ev.evdwl; + if (vflag_global) { + virial[0] += ev.v[0]; + virial[1] += ev.v[1]; + virial[2] += ev.v[2]; + virial[3] += ev.v[3]; + virial[4] += ev.v[4]; + virial[5] += ev.v[5]; + } + + if (eflag_atom) { + k_eatom.template modify(); + k_eatom.template sync(); + } + + if (vflag_atom) { + k_vatom.template modify(); + k_vatom.template sync(); + } + + copymode = 0; +} + +/* ---------------------------------------------------------------------- */ + +template +template +KOKKOS_INLINE_FUNCTION +void AngleClass2Kokkos::operator()(TagAngleClass2Compute, const int &n, EV_FLOAT& ev) const { + + // The f array is atomic + Kokkos::View > a_f = f; + + const int i1 = anglelist(n,0); + const int i2 = anglelist(n,1); + const int i3 = anglelist(n,2); + const int type = anglelist(n,3); + + // 1st bond + + const F_FLOAT delx1 = x(i1,0) - x(i2,0); + const F_FLOAT dely1 = x(i1,1) - x(i2,1); + const F_FLOAT delz1 = x(i1,2) - x(i2,2); + + const F_FLOAT rsq1 = delx1*delx1 + dely1*dely1 + delz1*delz1; + const F_FLOAT r1 = sqrt(rsq1); + + // 2nd bond + + const F_FLOAT delx2 = x(i3,0) - x(i2,0); + const F_FLOAT dely2 = x(i3,1) - x(i2,1); + const F_FLOAT delz2 = x(i3,2) - x(i2,2); + + const F_FLOAT rsq2 = delx2*delx2 + dely2*dely2 + delz2*delz2; + const F_FLOAT r2 = sqrt(rsq2); + + // angle (cos and sin) + + F_FLOAT c = delx1*delx2 + dely1*dely2 + delz1*delz2; + c /= r1*r2; + + if (c > 1.0) c = 1.0; + if (c < -1.0) c = -1.0; + + F_FLOAT s = sqrt(1.0 - c*c); + if (s < SMALL) s = SMALL; + s = 1.0/s; + + // force & energy for angle term + + const F_FLOAT dtheta = acos(c) - d_theta0[type]; + const F_FLOAT dtheta2 = dtheta*dtheta; + const F_FLOAT dtheta3 = dtheta2*dtheta; + const F_FLOAT dtheta4 = dtheta3*dtheta; + + const F_FLOAT de_angle = 2.0*d_k2[type]*dtheta + 3.0*d_k3[type]*dtheta2 + 4.0*d_k4[type]*dtheta3; + + const F_FLOAT a = -de_angle*s; + const F_FLOAT a11 = a*c / rsq1; + const F_FLOAT a12 = -a / (r1*r2); + const F_FLOAT a22 = a*c / rsq2; + + F_FLOAT f1[3],f3[3]; + f1[0] = a11*delx1 + a12*delx2; + f1[1] = a11*dely1 + a12*dely2; + f1[2] = a11*delz1 + a12*delz2; + f3[0] = a22*delx2 + a12*delx1; + f3[1] = a22*dely2 + a12*dely1; + f3[2] = a22*delz2 + a12*delz1; + + F_FLOAT eangle = 0.0; + if (eflag) eangle = d_k2[type]*dtheta2 + d_k3[type]*dtheta3 + d_k4[type]*dtheta4; + + // force & energy for bond-bond term + + const F_FLOAT dr1 = r1 - d_bb_r1[type]; + const F_FLOAT dr2 = r2 - d_bb_r2[type]; + const F_FLOAT tk1 = d_bb_k[type] * dr1; + const F_FLOAT tk2 = d_bb_k[type] * dr2; + + f1[0] -= delx1*tk2/r1; + f1[1] -= dely1*tk2/r1; + f1[2] -= delz1*tk2/r1; + + f3[0] -= delx2*tk1/r2; + f3[1] -= dely2*tk1/r2; + f3[2] -= delz2*tk1/r2; + + if (eflag) eangle += d_bb_k[type]*dr1*dr2; + + // force & energy for bond-angle term + + const F_FLOAT aa1 = s * dr1 * d_ba_k1[type]; + const F_FLOAT aa2 = s * dr2 * d_ba_k2[type]; + + F_FLOAT aa11 = aa1 * c / rsq1; + F_FLOAT aa12 = -aa1 / (r1 * r2); + F_FLOAT aa21 = aa2 * c / rsq1; + F_FLOAT aa22 = -aa2 / (r1 * r2); + + const F_FLOAT vx11 = (aa11 * delx1) + (aa12 * delx2); + const F_FLOAT vx12 = (aa21 * delx1) + (aa22 * delx2); + const F_FLOAT vy11 = (aa11 * dely1) + (aa12 * dely2); + const F_FLOAT vy12 = (aa21 * dely1) + (aa22 * dely2); + const F_FLOAT vz11 = (aa11 * delz1) + (aa12 * delz2); + const F_FLOAT vz12 = (aa21 * delz1) + (aa22 * delz2); + + aa11 = aa1 * c / rsq2; + aa21 = aa2 * c / rsq2; + + const F_FLOAT vx21 = (aa11 * delx2) + (aa12 * delx1); + const F_FLOAT vx22 = (aa21 * delx2) + (aa22 * delx1); + const F_FLOAT vy21 = (aa11 * dely2) + (aa12 * dely1); + const F_FLOAT vy22 = (aa21 * dely2) + (aa22 * dely1); + const F_FLOAT vz21 = (aa11 * delz2) + (aa12 * delz1); + const F_FLOAT vz22 = (aa21 * delz2) + (aa22 * delz1); + + const F_FLOAT b1 = d_ba_k1[type] * dtheta / r1; + const F_FLOAT b2 = d_ba_k2[type] * dtheta / r2; + + f1[0] -= vx11 + b1*delx1 + vx12; + f1[1] -= vy11 + b1*dely1 + vy12; + f1[2] -= vz11 + b1*delz1 + vz12; + + f3[0] -= vx21 + b2*delx2 + vx22; + f3[1] -= vy21 + b2*dely2 + vy22; + f3[2] -= vz21 + b2*delz2 + vz22; + + if (eflag) eangle += d_ba_k1[type]*dr1*dtheta + d_ba_k2[type]*dr2*dtheta; + + // apply force to each of 3 atoms + + if (NEWTON_BOND || i1 < nlocal) { + a_f(i1,0) += f1[0]; + a_f(i1,1) += f1[1]; + a_f(i1,2) += f1[2]; + } + + if (NEWTON_BOND || i2 < nlocal) { + a_f(i2,0) -= f1[0] + f3[0]; + a_f(i2,1) -= f1[1] + f3[1]; + a_f(i2,2) -= f1[2] + f3[2]; + } + + if (NEWTON_BOND || i3 < nlocal) { + a_f(i3,0) += f3[0]; + a_f(i3,1) += f3[1]; + a_f(i3,2) += f3[2]; + } + + if (EVFLAG) ev_tally(ev,i1,i2,i3,eangle,f1,f3, + delx1,dely1,delz1,delx2,dely2,delz2); +} + +/* ---------------------------------------------------------------------- */ + +template +template +KOKKOS_INLINE_FUNCTION +void AngleClass2Kokkos::operator()(TagAngleClass2Compute, const int &n) const { + EV_FLOAT ev; + this->template operator()(TagAngleClass2Compute(), n, ev); +} + +/* ---------------------------------------------------------------------- */ + +template +void AngleClass2Kokkos::allocate() +{ + AngleClass2::allocate(); + +} + +/* ---------------------------------------------------------------------- + set coeffs for one or more types +------------------------------------------------------------------------- */ + +template +void AngleClass2Kokkos::coeff(int narg, char **arg) +{ + AngleClass2::coeff(narg, arg); + + int n = atom->nangletypes; + k_k2 = typename ArrayTypes::tdual_ffloat_1d("AngleClass2::k2",n+1); + k_k3 = typename ArrayTypes::tdual_ffloat_1d("AngleClass2::k3",n+1); + k_k4 = typename ArrayTypes::tdual_ffloat_1d("AngleClass2::k4",n+1); + k_bb_k = typename ArrayTypes::tdual_ffloat_1d("AngleClass2::bb_k",n+1); + k_bb_r1 = typename ArrayTypes::tdual_ffloat_1d("AngleClass2::bb_r1",n+1); + k_bb_r2 = typename ArrayTypes::tdual_ffloat_1d("AngleClass2::bb_r2",n+1); + k_ba_k1 = typename ArrayTypes::tdual_ffloat_1d("AngleClass2::ba_k1",n+1); + k_ba_k2 = typename ArrayTypes::tdual_ffloat_1d("AngleClass2::ba_k2",n+1); + k_ba_r1 = typename ArrayTypes::tdual_ffloat_1d("AngleClass2::ba_r1",n+1); + k_ba_r2 = typename ArrayTypes::tdual_ffloat_1d("AngleClass2::ba_r2",n+1); + k_setflag = typename ArrayTypes::tdual_ffloat_1d("AngleClass2::setflag",n+1); + k_setflag_a = typename ArrayTypes::tdual_ffloat_1d("AngleClass2::setflag_a",n+1); + k_setflag_bb = typename ArrayTypes::tdual_ffloat_1d("AngleClass2::setflag_bb",n+1); + k_setflag_ba = typename ArrayTypes::tdual_ffloat_1d("AngleClass2::setflag_ba",n+1); + k_theta0 = typename ArrayTypes::tdual_ffloat_1d("AngleClass2::theta0",n+1); + + d_k2 = k_k2.template view(); + d_k3 = k_k3.template view(); + d_k4 = k_k4.template view(); + d_bb_k = k_bb_k.template view(); + d_bb_r1 = k_bb_r1.template view(); + d_bb_r2 = k_bb_r2.template view(); + d_ba_k1 = k_ba_k1.template view(); + d_ba_k2 = k_ba_k2.template view(); + d_ba_r1 = k_ba_r1.template view(); + d_ba_r2 = k_ba_r2.template view(); + d_ba_r2 = k_ba_r2.template view(); + d_setflag = k_setflag.template view(); + d_setflag_a = k_setflag_a.template view(); + d_setflag_bb = k_setflag_bb.template view(); + d_setflag_ba = k_setflag_ba.template view(); + d_theta0 = k_theta0.template view(); + + //int n = atom->nangletypes; + for (int i = 1; i <= n; i++) { + k_k2.h_view[i] = k2[i]; + k_k3.h_view[i] = k3[i]; + k_k4.h_view[i] = k4[i]; + k_bb_k.h_view[i] = bb_k[i]; + k_bb_r1.h_view[i] = bb_r1[i]; + k_bb_r2.h_view[i] = bb_r2[i]; + k_ba_k1.h_view[i] = ba_k1[i]; + k_ba_k2.h_view[i] = ba_k2[i]; + k_ba_r1.h_view[i] = ba_r1[i]; + k_ba_r2.h_view[i] = ba_r2[i]; + k_setflag.h_view[i] = setflag[i]; + k_setflag_a.h_view[i] = setflag_a[i]; + k_setflag_bb.h_view[i] = setflag_bb[i]; + k_setflag_ba.h_view[i] = setflag_ba[i]; + k_theta0.h_view[i] = theta0[i]; + } + + k_k2.template modify(); + k_k3.template modify(); + k_k4.template modify(); + k_bb_k.template modify(); + k_bb_r1.template modify(); + k_bb_r2.template modify(); + k_ba_k1.template modify(); + k_ba_k2.template modify(); + k_ba_r1.template modify(); + k_ba_r2.template modify(); + k_setflag.template modify(); + k_setflag_a.template modify(); + k_setflag_bb.template modify(); + k_setflag_ba.template modify(); + k_theta0.template modify(); +} + +/* ---------------------------------------------------------------------- + tally energy and virial into global and per-atom accumulators + virial = r1F1 + r2F2 + r3F3 = (r1-r2) F1 + (r3-r2) F3 = del1*f1 + del2*f3 +------------------------------------------------------------------------- */ + +template +//template +KOKKOS_INLINE_FUNCTION +void AngleClass2Kokkos::ev_tally(EV_FLOAT &ev, const int i, const int j, const int k, + F_FLOAT &eangle, F_FLOAT *f1, F_FLOAT *f3, + const F_FLOAT &delx1, const F_FLOAT &dely1, const F_FLOAT &delz1, + const F_FLOAT &delx2, const F_FLOAT &dely2, const F_FLOAT &delz2) const +{ + E_FLOAT eanglethird; + F_FLOAT v[6]; + + // The eatom and vatom arrays are atomic + Kokkos::View > v_eatom = k_eatom.template view(); + Kokkos::View > v_vatom = k_vatom.template view(); + + if (eflag_either) { + if (eflag_global) { + if (newton_bond) ev.evdwl += eangle; + else { + eanglethird = THIRD*eangle; + + if (i < nlocal) ev.evdwl += eanglethird; + if (j < nlocal) ev.evdwl += eanglethird; + if (k < nlocal) ev.evdwl += eanglethird; + } + } + if (eflag_atom) { + eanglethird = THIRD*eangle; + + if (newton_bond || i < nlocal) v_eatom[i] += eanglethird; + if (newton_bond || j < nlocal) v_eatom[j] += eanglethird; + if (newton_bond || k < nlocal) v_eatom[k] += eanglethird; + } + } + + if (vflag_either) { + v[0] = delx1*f1[0] + delx2*f3[0]; + v[1] = dely1*f1[1] + dely2*f3[1]; + v[2] = delz1*f1[2] + delz2*f3[2]; + v[3] = delx1*f1[1] + delx2*f3[1]; + v[4] = delx1*f1[2] + delx2*f3[2]; + v[5] = dely1*f1[2] + dely2*f3[2]; + + if (vflag_global) { + if (newton_bond) { + ev.v[0] += v[0]; + ev.v[1] += v[1]; + ev.v[2] += v[2]; + ev.v[3] += v[3]; + ev.v[4] += v[4]; + ev.v[5] += v[5]; + } else { + if (i < nlocal) { + ev.v[0] += THIRD*v[0]; + ev.v[1] += THIRD*v[1]; + ev.v[2] += THIRD*v[2]; + ev.v[3] += THIRD*v[3]; + ev.v[4] += THIRD*v[4]; + ev.v[5] += THIRD*v[5]; + } + if (j < nlocal) { + ev.v[0] += THIRD*v[0]; + ev.v[1] += THIRD*v[1]; + ev.v[2] += THIRD*v[2]; + ev.v[3] += THIRD*v[3]; + ev.v[4] += THIRD*v[4]; + ev.v[5] += THIRD*v[5]; + } + if (k < nlocal) { + ev.v[0] += THIRD*v[0]; + + ev.v[1] += THIRD*v[1]; + ev.v[2] += THIRD*v[2]; + ev.v[3] += THIRD*v[3]; + ev.v[4] += THIRD*v[4]; + ev.v[5] += THIRD*v[5]; + } + } + } + + if (vflag_atom) { + if (newton_bond || i < nlocal) { + v_vatom(i,0) += THIRD*v[0]; + v_vatom(i,1) += THIRD*v[1]; + v_vatom(i,2) += THIRD*v[2]; + v_vatom(i,3) += THIRD*v[3]; + v_vatom(i,4) += THIRD*v[4]; + v_vatom(i,5) += THIRD*v[5]; + } + if (newton_bond || j < nlocal) { + v_vatom(j,0) += THIRD*v[0]; + v_vatom(j,1) += THIRD*v[1]; + v_vatom(j,2) += THIRD*v[2]; + v_vatom(j,3) += THIRD*v[3]; + v_vatom(j,4) += THIRD*v[4]; + v_vatom(j,5) += THIRD*v[5]; + } + if (newton_bond || k < nlocal) { + v_vatom(k,0) += THIRD*v[0]; + v_vatom(k,1) += THIRD*v[1]; + v_vatom(k,2) += THIRD*v[2]; + v_vatom(k,3) += THIRD*v[3]; + v_vatom(k,4) += THIRD*v[4]; + v_vatom(k,5) += THIRD*v[5]; + + } + } + } +} + +/* ---------------------------------------------------------------------- */ + +namespace LAMMPS_NS { +template class AngleClass2Kokkos; +#ifdef KOKKOS_HAVE_CUDA +template class AngleClass2Kokkos; +#endif +} + diff --git a/src/KOKKOS/angle_class2_kokkos.h b/src/KOKKOS/angle_class2_kokkos.h new file mode 100644 index 0000000000..b65609b415 --- /dev/null +++ b/src/KOKKOS/angle_class2_kokkos.h @@ -0,0 +1,99 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef ANGLE_CLASS + +AngleStyle(class2/kk,AngleClass2Kokkos) +AngleStyle(class2/kk/device,AngleClass2Kokkos) +AngleStyle(class2/kk/host,AngleClass2Kokkos) + +#else + +#ifndef LMP_ANGLE_CLASS2_KOKKOS_H +#define LMP_ANGLE_CLASS2_KOKKOS_H + +#include "angle_class2.h" +#include "kokkos_type.h" + +namespace LAMMPS_NS { + +template +struct TagAngleClass2Compute{}; + +template +class AngleClass2Kokkos : public AngleClass2 { + + public: + typedef DeviceType device_type; + typedef ArrayTypes AT; + typedef EV_FLOAT value_type; + + AngleClass2Kokkos(class LAMMPS *); + virtual ~AngleClass2Kokkos(); + virtual void compute(int, int); + virtual void coeff(int, char **); + + template + KOKKOS_INLINE_FUNCTION + void operator()(TagAngleClass2Compute, const int&, EV_FLOAT&) const; + + template + KOKKOS_INLINE_FUNCTION + void operator()(TagAngleClass2Compute, const int&) const; + + //template + KOKKOS_INLINE_FUNCTION + void ev_tally(EV_FLOAT &ev, const int i, const int j, const int k, + F_FLOAT &eangle, F_FLOAT *f1, F_FLOAT *f3, + const F_FLOAT &delx1, const F_FLOAT &dely1, const F_FLOAT &delz1, + const F_FLOAT &delx2, const F_FLOAT &dely2, const F_FLOAT &delz2) const; + + protected: + + class NeighborKokkos *neighborKK; + + typename AT::t_x_array_randomread x; + typename AT::t_f_array f; + typename AT::t_int_2d anglelist; + + typename AT::tdual_efloat_1d k_eatom; + typename AT::tdual_virial_array k_vatom; + typename AT::t_efloat_1d d_eatom; + typename AT::t_virial_array d_vatom; + + int nlocal,newton_bond; + int eflag,vflag; + + typename AT::tdual_ffloat_1d k_theta0; + typename AT::tdual_ffloat_1d k_k2, k_k3, k_k4; + typename AT::tdual_ffloat_1d k_bb_k, k_bb_r1, k_bb_r2; + typename AT::tdual_ffloat_1d k_ba_k1, k_ba_k2, k_ba_r1, k_ba_r2; + typename AT::tdual_ffloat_1d k_setflag, k_setflag_a, k_setflag_bb, k_setflag_ba; + + typename AT::t_ffloat_1d d_theta0; + typename AT::t_ffloat_1d d_k2, d_k3, d_k4; + typename AT::t_ffloat_1d d_bb_k, d_bb_r1, d_bb_r2; + typename AT::t_ffloat_1d d_ba_k1, d_ba_k2, d_ba_r1, d_ba_r2; + typename AT::t_ffloat_1d d_setflag, d_setflag_a, d_setflag_bb, d_setflag_ba; + + virtual void allocate(); +}; + +} + +#endif +#endif + +/* ERROR/WARNING messages: + +*/ diff --git a/src/KOKKOS/bond_class2_kokkos.cpp b/src/KOKKOS/bond_class2_kokkos.cpp new file mode 100644 index 0000000000..82dc3f382a --- /dev/null +++ b/src/KOKKOS/bond_class2_kokkos.cpp @@ -0,0 +1,338 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: Ray Shan (Materials Design) +------------------------------------------------------------------------- */ + +#include +#include +#include "bond_class2_kokkos.h" +#include "atom_kokkos.h" +#include "neighbor_kokkos.h" +#include "domain.h" +#include "comm.h" +#include "force.h" +#include "memory.h" +#include "error.h" +#include "atom_masks.h" + +using namespace LAMMPS_NS; + +/* ---------------------------------------------------------------------- */ + +template +BondClass2Kokkos::BondClass2Kokkos(LAMMPS *lmp) : BondClass2(lmp) +{ + atomKK = (AtomKokkos *) atom; + neighborKK = (NeighborKokkos *) neighbor; + execution_space = ExecutionSpaceFromDevice::space; + datamask_read = X_MASK | F_MASK | ENERGY_MASK | VIRIAL_MASK; + datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; +} + +/* ---------------------------------------------------------------------- */ + +template +BondClass2Kokkos::~BondClass2Kokkos() +{ + if (!copymode) { + memory->destroy_kokkos(k_eatom,eatom); + memory->destroy_kokkos(k_vatom,vatom); + } +} + +/* ---------------------------------------------------------------------- */ + +template +void BondClass2Kokkos::compute(int eflag_in, int vflag_in) +{ + eflag = eflag_in; + vflag = vflag_in; + + if (eflag || vflag) ev_setup(eflag,vflag); + else evflag = 0; + + // reallocate per-atom arrays if necessary + + if (eflag_atom) { + //if(k_eatom.dimension_0()destroy_kokkos(k_eatom,eatom); + memory->create_kokkos(k_eatom,eatom,maxeatom,"improper:eatom"); + d_eatom = k_eatom.template view(); + //} + } + if (vflag_atom) { + //if(k_vatom.dimension_0()destroy_kokkos(k_vatom,vatom); + memory->create_kokkos(k_vatom,vatom,maxvatom,6,"improper:vatom"); + d_vatom = k_vatom.template view(); + //} + } + +// if (eflag || vflag) atomKK->modified(execution_space,datamask_modify); +// else atomKK->modified(execution_space,F_MASK); + + x = atomKK->k_x.template view(); + f = atomKK->k_f.template view(); + neighborKK->k_bondlist.template sync(); + bondlist = neighborKK->k_bondlist.template view(); + int nbondlist = neighborKK->nbondlist; + nlocal = atom->nlocal; + newton_bond = force->newton_bond; + + copymode = 1; + + // loop over neighbors of my atoms + + EV_FLOAT ev; + + if (evflag) { + if (newton_bond) { + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,nbondlist),*this,ev); + } else { + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,nbondlist),*this,ev); + } + } else { + if (newton_bond) { + Kokkos::parallel_for(Kokkos::RangePolicy >(0,nbondlist),*this); + } else { + Kokkos::parallel_for(Kokkos::RangePolicy >(0,nbondlist),*this); + } + } + //DeviceType::fence(); + + if (eflag_global) energy += ev.evdwl; + if (vflag_global) { + virial[0] += ev.v[0]; + virial[1] += ev.v[1]; + virial[2] += ev.v[2]; + virial[3] += ev.v[3]; + virial[4] += ev.v[4]; + virial[5] += ev.v[5]; + } + + if (eflag_atom) { + k_eatom.template modify(); + k_eatom.template sync(); + } + + if (vflag_atom) { + k_vatom.template modify(); + k_vatom.template sync(); + } + + copymode = 0; +} + +/* ---------------------------------------------------------------------- */ + +template +template +KOKKOS_INLINE_FUNCTION +void BondClass2Kokkos::operator()(TagBondClass2Compute, const int &n, EV_FLOAT& ev) const { + + const int i1 = bondlist(n,0); + const int i2 = bondlist(n,1); + const int type = bondlist(n,2); + + const F_FLOAT delx = x(i1,0) - x(i2,0); + const F_FLOAT dely = x(i1,1) - x(i2,1); + const F_FLOAT delz = x(i1,2) - x(i2,2); + + const F_FLOAT rsq = delx*delx + dely*dely + delz*delz; + const F_FLOAT r = sqrt(rsq); + const F_FLOAT dr = r - d_r0[type]; + const F_FLOAT dr2 = dr*dr; + const F_FLOAT dr3 = dr2*dr; + const F_FLOAT dr4 = dr3*dr; + + // force & energy + + F_FLOAT ebond, fbond, de_bond; + + de_bond = 2.0*d_k2[type]*dr + 3.0*d_k3[type]*dr2 + 4.0*d_k4[type]*dr3; + if (r > 0.0) fbond = -de_bond/r; + else fbond = 0.0; + + if (eflag) ebond = d_k2[type]*dr2 + d_k3[type]*dr3 + d_k4[type]*dr4; + + // apply force to each of 2 atoms + + if (NEWTON_BOND || i1 < nlocal) { + f(i1,0) += delx*fbond; + f(i1,1) += dely*fbond; + f(i1,2) += delz*fbond; + } + + if (NEWTON_BOND || i2 < nlocal) { + f(i2,0) -= delx*fbond; + f(i2,1) -= dely*fbond; + f(i2,2) -= delz*fbond; + } + + if (EVFLAG) ev_tally(ev,i1,i2,ebond,fbond,delx,dely,delz); +} + +/* ---------------------------------------------------------------------- */ + +template +template +KOKKOS_INLINE_FUNCTION +void BondClass2Kokkos::operator()(TagBondClass2Compute, const int &n) const { + EV_FLOAT ev; + this->template operator()(TagBondClass2Compute(), n, ev); +} + +/* ---------------------------------------------------------------------- */ + +template +void BondClass2Kokkos::allocate() +{ + BondClass2::allocate(); +} + +/* ---------------------------------------------------------------------- + set coeffs for one type +------------------------------------------------------------------------- */ + +template +void BondClass2Kokkos::coeff(int narg, char **arg) +{ + BondClass2::coeff(narg, arg); + + int n = atom->nbondtypes; + Kokkos::DualView k_k2("BondClass2::k2",n+1); + Kokkos::DualView k_k3("BondClass2::k3",n+1); + Kokkos::DualView k_k4("BondClass2::k4",n+1); + Kokkos::DualView k_r0("BondClass2::r0",n+1); + + d_k2 = k_k2.template view(); + d_k3 = k_k3.template view(); + d_k4 = k_k4.template view(); + d_r0 = k_r0.template view(); + + for (int i = 1; i <= n; i++) { + k_k2.h_view[i] = k2[i]; + k_k3.h_view[i] = k3[i]; + k_k4.h_view[i] = k4[i]; + k_r0.h_view[i] = r0[i]; + } + + k_k2.template modify(); + k_k2.template sync(); + k_k3.template modify(); + k_k3.template sync(); + k_k4.template modify(); + k_k4.template sync(); + k_r0.template modify(); + k_r0.template sync(); + +} + +/* ---------------------------------------------------------------------- + tally energy and virial into global and per-atom accumulators +------------------------------------------------------------------------- */ + +template +//template +KOKKOS_INLINE_FUNCTION +void BondClass2Kokkos::ev_tally(EV_FLOAT &ev, const int &i, const int &j, + const F_FLOAT &ebond, const F_FLOAT &fbond, const F_FLOAT &delx, + const F_FLOAT &dely, const F_FLOAT &delz) const +{ + E_FLOAT ebondhalf; + F_FLOAT v[6]; + + if (eflag_either) { + if (eflag_global) { + if (newton_bond) ev.evdwl += ebond; + else { + ebondhalf = 0.5*ebond; + if (i < nlocal) ev.evdwl += ebondhalf; + if (j < nlocal) ev.evdwl += ebondhalf; + } + } + if (eflag_atom) { + ebondhalf = 0.5*ebond; + if (newton_bond || i < nlocal) d_eatom[i] += ebondhalf; + if (newton_bond || j < nlocal) d_eatom[j] += ebondhalf; + } + } + + if (vflag_either) { + v[0] = delx*delx*fbond; + v[1] = dely*dely*fbond; + v[2] = delz*delz*fbond; + v[3] = delx*dely*fbond; + v[4] = delx*delz*fbond; + v[5] = dely*delz*fbond; + + if (vflag_global) { + if (newton_bond) { + ev.v[0] += v[0]; + ev.v[1] += v[1]; + ev.v[2] += v[2]; + ev.v[3] += v[3]; + ev.v[4] += v[4]; + ev.v[5] += v[5]; + } else { + if (i < nlocal) { + ev.v[0] += 0.5*v[0]; + ev.v[1] += 0.5*v[1]; + ev.v[2] += 0.5*v[2]; + ev.v[3] += 0.5*v[3]; + ev.v[4] += 0.5*v[4]; + ev.v[5] += 0.5*v[5]; + } + if (j < nlocal) { + ev.v[0] += 0.5*v[0]; + ev.v[1] += 0.5*v[1]; + ev.v[2] += 0.5*v[2]; + ev.v[3] += 0.5*v[3]; + ev.v[4] += 0.5*v[4]; + ev.v[5] += 0.5*v[5]; + } + } + } + + if (vflag_atom) { + if (newton_bond || i < nlocal) { + d_vatom(i,0) += 0.5*v[0]; + d_vatom(i,1) += 0.5*v[1]; + d_vatom(i,2) += 0.5*v[2]; + d_vatom(i,3) += 0.5*v[3]; + d_vatom(i,4) += 0.5*v[4]; + d_vatom(i,5) += 0.5*v[5]; + } + if (newton_bond || j < nlocal) { + d_vatom(j,0) += 0.5*v[0]; + d_vatom(j,1) += 0.5*v[1]; + d_vatom(j,2) += 0.5*v[2]; + d_vatom(j,3) += 0.5*v[3]; + d_vatom(j,4) += 0.5*v[4]; + d_vatom(j,5) += 0.5*v[5]; + } + } + } +} + +/* ---------------------------------------------------------------------- */ + +namespace LAMMPS_NS { +template class BondClass2Kokkos; +#ifdef KOKKOS_HAVE_CUDA +template class BondClass2Kokkos; +#endif +} + diff --git a/src/KOKKOS/bond_class2_kokkos.h b/src/KOKKOS/bond_class2_kokkos.h new file mode 100644 index 0000000000..accb9ffe4e --- /dev/null +++ b/src/KOKKOS/bond_class2_kokkos.h @@ -0,0 +1,89 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef BOND_CLASS + +BondStyle(class2/kk,BondClass2Kokkos) +BondStyle(class2/kk/device,BondClass2Kokkos) +BondStyle(class2/kk/host,BondClass2Kokkos) + +#else + +#ifndef LMP_BOND_CLASS2_KOKKOS_H +#define LMP_BOND_CLASS2_KOKKOS_H + +#include "bond_class2.h" +#include "kokkos_type.h" + +namespace LAMMPS_NS { + +template +struct TagBondClass2Compute{}; + +template +class BondClass2Kokkos : public BondClass2 { + + public: + typedef DeviceType device_type; + typedef ArrayTypes AT; + typedef EV_FLOAT value_type; + + BondClass2Kokkos(class LAMMPS *); + virtual ~BondClass2Kokkos(); + virtual void compute(int, int); + virtual void coeff(int, char **); + + template + KOKKOS_INLINE_FUNCTION + void operator()(TagBondClass2Compute, const int&, EV_FLOAT&) const; + + template + KOKKOS_INLINE_FUNCTION + void operator()(TagBondClass2Compute, const int&) const; + + //template + KOKKOS_INLINE_FUNCTION + void ev_tally(EV_FLOAT &ev, const int &i, const int &j, + const F_FLOAT &ebond, const F_FLOAT &fbond, const F_FLOAT &delx, + const F_FLOAT &dely, const F_FLOAT &delz) const; + + protected: + + class NeighborKokkos *neighborKK; + + typename AT::t_x_array_randomread x; + typename Kokkos::View > f; + typename AT::t_int_2d bondlist; + + Kokkos::DualView k_eatom; + Kokkos::DualView k_vatom; + Kokkos::View > d_eatom; + Kokkos::View > d_vatom; + + int nlocal,newton_bond; + int eflag,vflag; + + typename AT::t_ffloat_1d d_k2, d_k3, d_k4; + typename AT::t_ffloat_1d d_r0; + + virtual void allocate(); +}; + +} + +#endif +#endif + +/* ERROR/WARNING messages: + +*/ diff --git a/src/KOKKOS/dihedral_class2_kokkos.cpp b/src/KOKKOS/dihedral_class2_kokkos.cpp new file mode 100644 index 0000000000..9f7ef52cb0 --- /dev/null +++ b/src/KOKKOS/dihedral_class2_kokkos.cpp @@ -0,0 +1,965 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: Ray Shan (Materials Design) +------------------------------------------------------------------------- */ + +#include +#include +#include "dihedral_class2_kokkos.h" +#include "atom_kokkos.h" +#include "comm.h" +#include "neighbor_kokkos.h" +#include "domain.h" +#include "force.h" +#include "update.h" +#include "memory.h" +#include "error.h" +#include "atom_masks.h" + +using namespace LAMMPS_NS; + +#define TOLERANCE 0.05 +#define SMALL 0.001 +#define SMALLER 0.00001 + +/* ---------------------------------------------------------------------- */ + +template +DihedralClass2Kokkos::DihedralClass2Kokkos(LAMMPS *lmp) : DihedralClass2(lmp) +{ + atomKK = (AtomKokkos *) atom; + neighborKK = (NeighborKokkos *) neighbor; + execution_space = ExecutionSpaceFromDevice::space; + datamask_read = X_MASK | F_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; + datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; + + k_warning_flag = DAT::tdual_int_scalar("Dihedral:warning_flag"); + d_warning_flag = k_warning_flag.view(); + h_warning_flag = k_warning_flag.h_view; +} + +/* ---------------------------------------------------------------------- */ + +template +DihedralClass2Kokkos::~DihedralClass2Kokkos() +{ + if (!copymode) { + memory->destroy_kokkos(k_eatom,eatom); + memory->destroy_kokkos(k_vatom,vatom); + } +} + +/* ---------------------------------------------------------------------- */ + +template +void DihedralClass2Kokkos::compute(int eflag_in, int vflag_in) +{ + eflag = eflag_in; + vflag = vflag_in; + + if (eflag || vflag) ev_setup(eflag,vflag); + else evflag = 0; + + // reallocate per-atom arrays if necessary + + if (eflag_atom) { + memory->destroy_kokkos(k_eatom,eatom); + memory->create_kokkos(k_eatom,eatom,maxeatom,"dihedral:eatom"); + d_eatom = k_eatom.template view(); + } + if (vflag_atom) { + memory->destroy_kokkos(k_vatom,vatom); + memory->create_kokkos(k_vatom,vatom,maxvatom,6,"dihedral:vatom"); + d_vatom = k_vatom.template view(); + } + + //atomKK->sync(execution_space,datamask_read); + k_k1.template sync(); + k_k2.template sync(); + k_k3.template sync(); + k_phi1.template sync(); + k_phi2.template sync(); + k_phi3.template sync(); + k_mbt_f1.template sync(); + k_mbt_f2.template sync(); + k_mbt_f3.template sync(); + k_mbt_r0.template sync(); + k_ebt_f1_1.template sync(); + k_ebt_f2_1.template sync(); + k_ebt_f3_1.template sync(); + k_ebt_r0_1.template sync(); + k_ebt_f1_2.template sync(); + k_ebt_f2_2.template sync(); + k_ebt_f3_2.template sync(); + k_ebt_r0_2.template sync(); + k_at_f1_1.template sync(); + k_at_f2_1.template sync(); + k_at_f3_1.template sync(); + k_at_f1_2.template sync(); + k_at_f2_2.template sync(); + k_at_f3_2.template sync(); + k_at_theta0_1.template sync(); + k_at_theta0_2.template sync(); + k_aat_k.template sync(); + k_aat_theta0_1.template sync(); + k_aat_theta0_2.template sync(); + k_bb13t_k.template sync(); + k_bb13t_r10.template sync(); + k_bb13t_r30.template sync(); + k_setflag_d.template sync(); + k_setflag_mbt.template sync(); + k_setflag_ebt.template sync(); + k_setflag_at.template sync(); + k_setflag_aat.template sync(); + k_setflag_bb13t.template sync(); + + //if (eflag || vflag) atomKK->modified(execution_space,datamask_modify); + //else atomKK->modified(execution_space,F_MASK); + + x = atomKK->k_x.view(); + f = atomKK->k_f.view(); + neighborKK->k_dihedrallist.template sync(); + dihedrallist = neighborKK->k_dihedrallist.view(); + int ndihedrallist = neighborKK->ndihedrallist; + nlocal = atom->nlocal; + newton_bond = force->newton_bond; + + h_warning_flag() = 0; + k_warning_flag.template modify(); + k_warning_flag.template sync(); + + copymode = 1; + + // loop over neighbors of my atoms + + EV_FLOAT ev; + + if (evflag) { + if (newton_bond) { + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,ndihedrallist),*this,ev); + } else { + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,ndihedrallist),*this,ev); + } + } else { + if (newton_bond) { + Kokkos::parallel_for(Kokkos::RangePolicy >(0,ndihedrallist),*this); + } else { + Kokkos::parallel_for(Kokkos::RangePolicy >(0,ndihedrallist),*this); + } + } + DeviceType::fence(); + + // error check + + k_warning_flag.template modify(); + k_warning_flag.template sync(); + if (h_warning_flag()) + error->warning(FLERR,"Dihedral problem",0); + + if (eflag_global) energy += ev.evdwl; + if (vflag_global) { + virial[0] += ev.v[0]; + virial[1] += ev.v[1]; + virial[2] += ev.v[2]; + virial[3] += ev.v[3]; + virial[4] += ev.v[4]; + virial[5] += ev.v[5]; + } + + if (eflag_atom) { + k_eatom.template modify(); + k_eatom.template sync(); + } + + if (vflag_atom) { + k_vatom.template modify(); + k_vatom.template sync(); + } + + copymode = 0; +} + +/* ---------------------------------------------------------------------- */ + +template +template +KOKKOS_INLINE_FUNCTION +void DihedralClass2Kokkos::operator()(TagDihedralClass2Compute, const int &n, EV_FLOAT& ev) const { + + // The f array is atomic + Kokkos::View > a_f = f; + + const int i1 = dihedrallist(n,0); + const int i2 = dihedrallist(n,1); + const int i3 = dihedrallist(n,2); + const int i4 = dihedrallist(n,3); + const int type = dihedrallist(n,4); + + // 1st bond + + const F_FLOAT vb1x = x(i1,0) - x(i2,0); + const F_FLOAT vb1y = x(i1,1) - x(i2,1); + const F_FLOAT vb1z = x(i1,2) - x(i2,2); + + // 2nd bond + + const F_FLOAT vb2x = x(i3,0) - x(i2,0); + const F_FLOAT vb2y = x(i3,1) - x(i2,1); + const F_FLOAT vb2z = x(i3,2) - x(i2,2); + + const F_FLOAT vb2xm = -vb2x; + const F_FLOAT vb2ym = -vb2y; + const F_FLOAT vb2zm = -vb2z; + + // 3rd bond + + const F_FLOAT vb3x = x(i4,0) - x(i3,0); + const F_FLOAT vb3y = x(i4,1) - x(i3,1); + const F_FLOAT vb3z = x(i4,2) - x(i3,2); + + // distance: c0 calculation + + const F_FLOAT r1mag2 = vb1x*vb1x + vb1y*vb1y + vb1z*vb1z; + const F_FLOAT r1 = sqrt(r1mag2); + const F_FLOAT r2mag2 = vb2x*vb2x + vb2y*vb2y + vb2z*vb2z; + const F_FLOAT r2 = sqrt(r2mag2); + const F_FLOAT r3mag2 = vb3x*vb3x + vb3y*vb3y + vb3z*vb3z; + const F_FLOAT r3 = sqrt(r3mag2); + + const F_FLOAT sb1 = 1.0/r1mag2; + const F_FLOAT rb1 = 1.0/r1; + const F_FLOAT sb2 = 1.0/r2mag2; + const F_FLOAT rb2 = 1.0/r2; + const F_FLOAT sb3 = 1.0/r3mag2; + const F_FLOAT rb3 = 1.0/r3; + + const F_FLOAT c0 = (vb1x*vb3x + vb1y*vb3y + vb1z*vb3z) * rb1*rb3; + + // 1st and 2nd angle + + const F_FLOAT r12c1 = rb1*rb2; + const F_FLOAT r12c2 = rb2*rb3; + const F_FLOAT costh12 = (vb1x*vb2x + vb1y*vb2y + vb1z*vb2z) * r12c1; + const F_FLOAT costh13 = c0; + const F_FLOAT costh23 = (vb2xm*vb3x + vb2ym*vb3y + vb2zm*vb3z) * r12c2; + + // cos and sin of 2 angles and final c + + F_FLOAT sin2 = MAX(1.0 - costh12*costh12,0.0); + F_FLOAT sc1 = sqrt(sin2); + if (sc1 < SMALL) sc1 = SMALL; + sc1 = 1.0/sc1; + + sin2 = MAX(1.0 - costh23*costh23,0.0); + F_FLOAT sc2 = sqrt(sin2); + if (sc2 < SMALL) sc2 = SMALL; + sc2 = 1.0/sc2; + + const F_FLOAT s1 = sc1 * sc1; + const F_FLOAT s2 = sc2 * sc2; + const F_FLOAT s12 = sc1 * sc2; + F_FLOAT c = (c0 + costh12*costh23) * s12; + + // error check + + if ((c > 1.0 + TOLERANCE || c < (-1.0 - TOLERANCE)) && !d_warning_flag()) + Kokkos::atomic_fetch_add(&d_warning_flag(),1); + + if (c > 1.0) c = 1.0; + if (c < -1.0) c = -1.0; + const F_FLOAT cosphi = c; + F_FLOAT phi = acos(c); + + F_FLOAT sinphi = sqrt(1.0 - c*c); + sinphi = MAX(sinphi,SMALL); + + // n123 = vb1 x vb2 + + const F_FLOAT n123x = vb1y*vb2z - vb1z*vb2y; + const F_FLOAT n123y = vb1z*vb2x - vb1x*vb2z; + const F_FLOAT n123z = vb1x*vb2y - vb1y*vb2x; + const F_FLOAT n123_dot_vb3 = n123x*vb3x + n123y*vb3y + n123z*vb3z; + if (n123_dot_vb3 > 0.0) { + phi = -phi; + sinphi = -sinphi; + } + + const F_FLOAT a11 = -c*sb1*s1; + const F_FLOAT a22 = sb2 * (2.0*costh13*s12 - c*(s1+s2)); + const F_FLOAT a33 = -c*sb3*s2; + const F_FLOAT a12 = r12c1 * (costh12*c*s1 + costh23*s12); + const F_FLOAT a13 = rb1*rb3*s12; + const F_FLOAT a23 = r12c2 * (-costh23*c*s2 - costh12*s12); + + const F_FLOAT sx1 = a11*vb1x + a12*vb2x + a13*vb3x; + const F_FLOAT sx2 = a12*vb1x + a22*vb2x + a23*vb3x; + const F_FLOAT sx12 = a13*vb1x + a23*vb2x + a33*vb3x; + const F_FLOAT sy1 = a11*vb1y + a12*vb2y + a13*vb3y; + const F_FLOAT sy2 = a12*vb1y + a22*vb2y + a23*vb3y; + const F_FLOAT sy12 = a13*vb1y + a23*vb2y + a33*vb3y; + const F_FLOAT sz1 = a11*vb1z + a12*vb2z + a13*vb3z; + const F_FLOAT sz2 = a12*vb1z + a22*vb2z + a23*vb3z; + const F_FLOAT sz12 = a13*vb1z + a23*vb2z + a33*vb3z; + + // set up d(cos(phi))/d(r) and dphi/dr arrays + + F_FLOAT dcosphidr[4][3], dphidr[4][3]; + + dcosphidr[0][0] = -sx1; + dcosphidr[0][1] = -sy1; + dcosphidr[0][2] = -sz1; + dcosphidr[1][0] = sx2 + sx1; + dcosphidr[1][1] = sy2 + sy1; + dcosphidr[1][2] = sz2 + sz1; + dcosphidr[2][0] = sx12 - sx2; + dcosphidr[2][1] = sy12 - sy2; + dcosphidr[2][2] = sz12 - sz2; + dcosphidr[3][0] = -sx12; + dcosphidr[3][1] = -sy12; + dcosphidr[3][2] = -sz12; + + for (int i = 0; i < 4; i++) + for (int j = 0; j < 3; j++) + dphidr[i][j] = -dcosphidr[i][j] / sinphi; + + // energy + + F_FLOAT edihedral = 0.0; + + const F_FLOAT dphi1 = phi - d_phi1[type]; + const F_FLOAT dphi2 = 2.0*phi - d_phi2[type]; + const F_FLOAT dphi3 = 3.0*phi - d_phi3[type]; + + if (eflag) edihedral = d_k1[type]*(1.0 - cos(dphi1)) + + d_k2[type]*(1.0 - cos(dphi2)) + + d_k3[type]*(1.0 - cos(dphi3)); + + const F_FLOAT de_dihedral = d_k1[type]*sin(dphi1) + 2.0*d_k2[type]*sin(dphi2) + + 3.0*d_k3[type]*sin(dphi3); + + // torsion forces on all 4 atoms + + F_FLOAT dbonddr[3][4][3], fabcd[4][3]; + + for (int i = 0; i < 4; i++) + for (int j = 0; j < 3; j++) + fabcd[i][j] = de_dihedral*dphidr[i][j]; + + // set up d(bond)/d(r) array + // dbonddr(i,j,k) = bond i, atom j, coordinate k + + for (int i = 0; i < 3; i++) + for (int j = 0; j < 4; j++) + for (int k = 0; k < 3; k++) + dbonddr[i][j][k] = 0.0; + + // bond1 + + dbonddr[0][0][0] = vb1x / r1; + dbonddr[0][0][1] = vb1y / r1; + dbonddr[0][0][2] = vb1z / r1; + dbonddr[0][1][0] = -vb1x / r1; + dbonddr[0][1][1] = -vb1y / r1; + dbonddr[0][1][2] = -vb1z / r1; + + // bond2 + + dbonddr[1][1][0] = vb2x / r2; + dbonddr[1][1][1] = vb2y / r2; + dbonddr[1][1][2] = vb2z / r2; + dbonddr[1][2][0] = -vb2x / r2; + dbonddr[1][2][1] = -vb2y / r2; + dbonddr[1][2][2] = -vb2z / r2; + + // bond3 + + dbonddr[2][2][0] = vb3x / r3; + dbonddr[2][2][1] = vb3y / r3; + dbonddr[2][2][2] = vb3z / r3; + dbonddr[2][3][0] = -vb3x / r3; + dbonddr[2][3][1] = -vb3y / r3; + dbonddr[2][3][2] = -vb3z / r3; + + // set up d(theta)/d(r) array + // dthetadr(i,j,k) = angle i, atom j, coordinate k + + F_FLOAT dthetadr[2][4][3]; + + for (int i = 0; i < 2; i++) + for (int j = 0; j < 4; j++) + for (int k = 0; k < 3; k++) + dthetadr[i][j][k] = 0.0; + + const F_FLOAT t1 = costh12 / r1mag2; + const F_FLOAT t2 = costh23 / r2mag2; + const F_FLOAT t3 = costh12 / r2mag2; + const F_FLOAT t4 = costh23 / r3mag2; + + // angle12 + + dthetadr[0][0][0] = sc1 * ((t1 * vb1x) - (vb2x * r12c1)); + dthetadr[0][0][1] = sc1 * ((t1 * vb1y) - (vb2y * r12c1)); + dthetadr[0][0][2] = sc1 * ((t1 * vb1z) - (vb2z * r12c1)); + + dthetadr[0][1][0] = sc1 * ((-t1 * vb1x) + (vb2x * r12c1) + + (-t3 * vb2x) + (vb1x * r12c1)); + dthetadr[0][1][1] = sc1 * ((-t1 * vb1y) + (vb2y * r12c1) + + (-t3 * vb2y) + (vb1y * r12c1)); + dthetadr[0][1][2] = sc1 * ((-t1 * vb1z) + (vb2z * r12c1) + + (-t3 * vb2z) + (vb1z * r12c1)); + + dthetadr[0][2][0] = sc1 * ((t3 * vb2x) - (vb1x * r12c1)); + dthetadr[0][2][1] = sc1 * ((t3 * vb2y) - (vb1y * r12c1)); + dthetadr[0][2][2] = sc1 * ((t3 * vb2z) - (vb1z * r12c1)); + + // angle23 + + dthetadr[1][1][0] = sc2 * ((t2 * vb2x) + (vb3x * r12c2)); + dthetadr[1][1][1] = sc2 * ((t2 * vb2y) + (vb3y * r12c2)); + dthetadr[1][1][2] = sc2 * ((t2 * vb2z) + (vb3z * r12c2)); + + dthetadr[1][2][0] = sc2 * ((-t2 * vb2x) - (vb3x * r12c2) + + (t4 * vb3x) + (vb2x * r12c2)); + dthetadr[1][2][1] = sc2 * ((-t2 * vb2y) - (vb3y * r12c2) + + (t4 * vb3y) + (vb2y * r12c2)); + dthetadr[1][2][2] = sc2 * ((-t2 * vb2z) - (vb3z * r12c2) + + (t4 * vb3z) + (vb2z * r12c2)); + + dthetadr[1][3][0] = -sc2 * ((t4 * vb3x) + (vb2x * r12c2)); + dthetadr[1][3][1] = -sc2 * ((t4 * vb3y) + (vb2y * r12c2)); + dthetadr[1][3][2] = -sc2 * ((t4 * vb3z) + (vb2z * r12c2)); + + // mid-bond/torsion coupling + // energy on bond2 (middle bond) + + F_FLOAT cos2phi = cos(2.0*phi); + F_FLOAT cos3phi = cos(3.0*phi); + + F_FLOAT bt1 = d_mbt_f1[type] * cosphi; + F_FLOAT bt2 = d_mbt_f2[type] * cos2phi; + F_FLOAT bt3 = d_mbt_f3[type] * cos3phi; + F_FLOAT sumbte = bt1 + bt2 + bt3; + F_FLOAT db = r2 - d_mbt_r0[type]; + if (eflag) edihedral += db * sumbte; + + // force on bond2 + + bt1 = -d_mbt_f1[type] * sinphi; + bt2 = -2.0 * d_mbt_f2[type] * sin(2.0*phi); + bt3 = -3.0 * d_mbt_f3[type] * sin(3.0*phi); + F_FLOAT sumbtf = bt1 + bt2 + bt3; + + for (int i = 0; i < 4; i++) + for (int j = 0; j < 3; j++) + fabcd[i][j] += db*sumbtf*dphidr[i][j] + sumbte*dbonddr[1][i][j]; + + // end-bond/torsion coupling + // energy on bond1 (first bond) + + bt1 = d_ebt_f1_1[type] * cosphi; + bt2 = d_ebt_f2_1[type] * cos2phi; + bt3 = d_ebt_f3_1[type] * cos3phi; + sumbte = bt1 + bt2 + bt3; + + db = r1 - d_ebt_r0_1[type]; + if (eflag) edihedral += db * (bt1+bt2+bt3); + + // force on bond1 + + bt1 = d_ebt_f1_1[type] * sinphi; + bt2 = 2.0 * d_ebt_f2_1[type] * sin(2.0*phi); + bt3 = 3.0 * d_ebt_f3_1[type] * sin(3.0*phi); + sumbtf = bt1 + bt2 + bt3; + + for (int i = 0; i < 4; i++) + for (int j = 0; j < 3; j++) + fabcd[i][j] -= db*sumbtf*dphidr[i][j] + sumbte*dbonddr[0][i][j]; + + // end-bond/torsion coupling + // energy on bond3 (last bond) + + bt1 = d_ebt_f1_2[type] * cosphi; + bt2 = d_ebt_f2_2[type] * cos2phi; + bt3 = d_ebt_f3_2[type] * cos3phi; + sumbte = bt1 + bt2 + bt3; + + db = r3 - d_ebt_r0_2[type]; + if (eflag) edihedral += db * (bt1+bt2+bt3); + + // force on bond3 + + bt1 = -d_ebt_f1_2[type] * sinphi; + bt2 = -2.0 * d_ebt_f2_2[type] * sin(2.0*phi); + bt3 = -3.0 * d_ebt_f3_2[type] * sin(3.0*phi); + sumbtf = bt1 + bt2 + bt3; + + for (int i = 0; i < 4; i++) + for (int j = 0; j < 3; j++) + fabcd[i][j] += db*sumbtf*dphidr[i][j] + sumbte*dbonddr[2][i][j]; + + // angle/torsion coupling + // energy on angle1 + + F_FLOAT at1 = d_at_f1_1[type] * cosphi; + F_FLOAT at2 = d_at_f2_1[type] * cos2phi; + F_FLOAT at3 = d_at_f3_1[type] * cos3phi; + sumbte = at1 + at2 + at3; + + F_FLOAT da = acos(costh12) - d_at_theta0_1[type]; + if (eflag) edihedral += da * (at1+at2+at3); + + // force on angle1 + + bt1 = d_at_f1_1[type] * sinphi; + bt2 = 2.0 * d_at_f2_1[type] * sin(2.0*phi); + bt3 = 3.0 * d_at_f3_1[type] * sin(3.0*phi); + sumbtf = bt1 + bt2 + bt3; + + for (int i = 0; i < 4; i++) + for (int j = 0; j < 3; j++) + fabcd[i][j] -= da*sumbtf*dphidr[i][j] + sumbte*dthetadr[0][i][j]; + + // energy on angle2 + + at1 = d_at_f1_2[type] * cosphi; + at2 = d_at_f2_2[type] * cos2phi; + at3 = d_at_f3_2[type] * cos3phi; + sumbte = at1 + at2 + at3; + + da = acos(costh23) - d_at_theta0_2[type]; + if (eflag) edihedral += da * (at1+at2+at3); + + // force on angle2 + + bt1 = -d_at_f1_2[type] * sinphi; + bt2 = -2.0 * d_at_f2_2[type] * sin(2.0*phi); + bt3 = -3.0 * d_at_f3_2[type] * sin(3.0*phi); + sumbtf = bt1 + bt2 + bt3; + + for (int i = 0; i < 4; i++) + for (int j = 0; j < 3; j++) + fabcd[i][j] += da*sumbtf*dphidr[i][j] + sumbte*dthetadr[1][i][j]; + + // angle/angle/torsion coupling + + const F_FLOAT da1 = acos(costh12) - d_aat_theta0_1[type]; + const F_FLOAT da2 = acos(costh23) - d_aat_theta0_2[type]; + + if (eflag) edihedral += d_aat_k[type]*da1*da2*cosphi; + + for (int i = 0; i < 4; i++) + for (int j = 0; j < 3; j++) + fabcd[i][j] -= d_aat_k[type] * + (cosphi * (da2*dthetadr[0][i][j] - da1*dthetadr[1][i][j]) + + sinphi * da1*da2*dphidr[i][j]); + + // bond1/bond3 coupling + + if (fabs(d_bb13t_k[type]) > SMALL) { + + const F_FLOAT r1_0 = d_bb13t_r10[type]; + const F_FLOAT r3_0 = d_bb13t_r30[type]; + const F_FLOAT dr1 = r1 - r1_0; + const F_FLOAT dr2 = r3 - r3_0; + const F_FLOAT tk1 = -d_bb13t_k[type] * dr1 / r3; + const F_FLOAT tk2 = -d_bb13t_k[type] * dr2 / r1; + + if (eflag) edihedral += d_bb13t_k[type]*dr1*dr2; + + fabcd[0][0] += tk2 * vb1x; + fabcd[0][1] += tk2 * vb1y; + fabcd[0][2] += tk2 * vb1z; + + fabcd[1][0] -= tk2 * vb1x; + fabcd[1][1] -= tk2 * vb1y; + fabcd[1][2] -= tk2 * vb1z; + + fabcd[2][0] -= tk1 * vb3x; + fabcd[2][1] -= tk1 * vb3y; + fabcd[2][2] -= tk1 * vb3z; + + fabcd[3][0] += tk1 * vb3x; + fabcd[3][1] += tk1 * vb3y; + fabcd[3][2] += tk1 * vb3z; + } + + F_FLOAT f1[3],f2[3],f3[3],f4[3]; + + for (int i = 0; i < 3; i++) { + f1[i] = fabcd[0][i]; + f2[i] = fabcd[1][i]; + f3[i] = fabcd[2][i]; + f4[i] = fabcd[3][i]; + } + + // apply force to each of 4 atoms + + if (NEWTON_BOND || i1 < nlocal) { + a_f(i1,0) += f1[0]; + a_f(i1,1) += f1[1]; + a_f(i1,2) += f1[2]; + } + + if (NEWTON_BOND || i2 < nlocal) { + a_f(i2,0) += f2[0]; + a_f(i2,1) += f2[1]; + a_f(i2,2) += f2[2]; + } + + if (NEWTON_BOND || i3 < nlocal) { + a_f(i3,0) += f3[0]; + a_f(i3,1) += f3[1]; + a_f(i3,2) += f3[2]; + } + + if (NEWTON_BOND || i4 < nlocal) { + a_f(i4,0) += f4[0]; + a_f(i4,1) += f4[1]; + a_f(i4,2) += f4[2]; + } + + if (EVFLAG) + ev_tally(ev,i1,i2,i3,i4,edihedral,f1,f3,f4, + vb1x,vb1y,vb1z,vb2x,vb2y,vb2z,vb3x,vb3y,vb3z); +} + +/* ---------------------------------------------------------------------- */ + +template +template +KOKKOS_INLINE_FUNCTION +void DihedralClass2Kokkos::operator()(TagDihedralClass2Compute, const int &n) const { + EV_FLOAT ev; + this->template operator()(TagDihedralClass2Compute(), n, ev); +} + +/* ---------------------------------------------------------------------- */ + +template +void DihedralClass2Kokkos::allocate() +{ + DihedralClass2::allocate(); +} + +/* ---------------------------------------------------------------------- + set coeffs for one type +------------------------------------------------------------------------- */ + +template +void DihedralClass2Kokkos::coeff(int narg, char **arg) +{ + DihedralClass2::coeff(narg, arg); + + int n = atom->ndihedraltypes; + k_k1 = typename ArrayTypes::tdual_ffloat_1d("DihedralClass2::k1",n+1); + k_k2 = typename ArrayTypes::tdual_ffloat_1d("DihedralClass2::k2",n+1); + k_k3 = typename ArrayTypes::tdual_ffloat_1d("DihedralClass2::k3",n+1); + k_phi1 = typename ArrayTypes::tdual_ffloat_1d("DihedralClass2::phi1",n+1); + k_phi2 = typename ArrayTypes::tdual_ffloat_1d("DihedralClass2::phi2",n+1); + k_phi3 = typename ArrayTypes::tdual_ffloat_1d("DihedralClass2::phi3",n+1); + k_mbt_f1 = typename ArrayTypes::tdual_ffloat_1d("DihedralClass2::mbt_f1",n+1); + k_mbt_f2 = typename ArrayTypes::tdual_ffloat_1d("DihedralClass2::mbt_f2",n+1); + k_mbt_f3 = typename ArrayTypes::tdual_ffloat_1d("DihedralClass2::mbt_f3",n+1); + k_mbt_r0 = typename ArrayTypes::tdual_ffloat_1d("DihedralClass2::mbt_r0",n+1); + k_ebt_f1_1 = typename ArrayTypes::tdual_ffloat_1d("DihedralClass2::ebt_f1_1",n+1); + k_ebt_f2_1 = typename ArrayTypes::tdual_ffloat_1d("DihedralClass2::ebt_f2_1",n+1); + k_ebt_f3_1 = typename ArrayTypes::tdual_ffloat_1d("DihedralClass2::ebt_f3_1",n+1); + k_ebt_r0_1 = typename ArrayTypes::tdual_ffloat_1d("DihedralClass2::ebt_r0_1",n+1); + k_ebt_f1_2 = typename ArrayTypes::tdual_ffloat_1d("DihedralClass2::ebt_f1_2",n+1); + k_ebt_f2_2 = typename ArrayTypes::tdual_ffloat_1d("DihedralClass2::ebt_f2_2",n+1); + k_ebt_f3_2 = typename ArrayTypes::tdual_ffloat_1d("DihedralClass2::ebt_f3_2",n+1); + k_ebt_r0_2 = typename ArrayTypes::tdual_ffloat_1d("DihedralClass2::ebt_r0_2",n+1); + k_at_f1_1 = typename ArrayTypes::tdual_ffloat_1d("DihedralClass2::at_f1_1",n+1); + k_at_f2_1 = typename ArrayTypes::tdual_ffloat_1d("DihedralClass2::at_f2_1",n+1); + k_at_f3_1 = typename ArrayTypes::tdual_ffloat_1d("DihedralClass2::at_f3_1",n+1); + k_at_f1_2 = typename ArrayTypes::tdual_ffloat_1d("DihedralClass2::at_f1_2",n+1); + k_at_f2_2 = typename ArrayTypes::tdual_ffloat_1d("DihedralClass2::at_f2_2",n+1); + k_at_f3_2 = typename ArrayTypes::tdual_ffloat_1d("DihedralClass2::at_f3_2",n+1); + k_at_theta0_1 = typename ArrayTypes::tdual_ffloat_1d("DihedralClass2::at_theta0_1",n+1); + k_at_theta0_2 = typename ArrayTypes::tdual_ffloat_1d("DihedralClass2::at_theta0_2",n+1); + k_aat_k = typename ArrayTypes::tdual_ffloat_1d("DihedralClass2::aat_k",n+1); + k_aat_theta0_1 = typename ArrayTypes::tdual_ffloat_1d("DihedralClass2::aat_theta0_1",n+1); + k_aat_theta0_2 = typename ArrayTypes::tdual_ffloat_1d("DihedralClass2::aat_theta0_2",n+1); + k_bb13t_k = typename ArrayTypes::tdual_ffloat_1d("DihedralClass2::bb13t_k",n+1); + k_bb13t_r10 = typename ArrayTypes::tdual_ffloat_1d("DihedralClass2::bb13t_r10",n+1); + k_bb13t_r30 = typename ArrayTypes::tdual_ffloat_1d("DihedralClass2::bb13t_r30",n+1); + k_setflag_d = typename ArrayTypes::tdual_ffloat_1d("AngleClass2::setflag_d",n+1); + k_setflag_mbt = typename ArrayTypes::tdual_ffloat_1d("AngleClass2::setflag_mbt",n+1); + k_setflag_ebt = typename ArrayTypes::tdual_ffloat_1d("AngleClass2::setflag_ebt",n+1); + k_setflag_at = typename ArrayTypes::tdual_ffloat_1d("AngleClass2::setflag_at",n+1); + k_setflag_aat = typename ArrayTypes::tdual_ffloat_1d("AngleClass2::setflag_aat",n+1); + k_setflag_bb13t = typename ArrayTypes::tdual_ffloat_1d("AngleClass2::setflag_bb13t",n+1); + + d_k1 = k_k1.template view(); + d_k2 = k_k2.template view(); + d_k3 = k_k3.template view(); + d_phi1 = k_phi1.template view(); + d_phi2 = k_phi2.template view(); + d_phi3 = k_phi3.template view(); + d_mbt_f1 = k_mbt_f1.template view(); + d_mbt_f2 = k_mbt_f2.template view(); + d_mbt_f3 = k_mbt_f3.template view(); + d_mbt_r0 = k_mbt_r0.template view(); + d_ebt_f1_1 = k_ebt_f1_1.template view(); + d_ebt_f2_1 = k_ebt_f2_1.template view(); + d_ebt_f3_1 = k_ebt_f3_1.template view(); + d_ebt_r0_1 = k_ebt_r0_1.template view(); + d_ebt_f1_2 = k_ebt_f1_2.template view(); + d_ebt_f2_2 = k_ebt_f2_2.template view(); + d_ebt_f3_2 = k_ebt_f3_2.template view(); + d_ebt_r0_2 = k_ebt_r0_2.template view(); + d_at_f1_1 = k_at_f1_1.template view(); + d_at_f2_1 = k_at_f2_1.template view(); + d_at_f3_1 = k_at_f3_1.template view(); + d_at_f1_2 = k_at_f1_2.template view(); + d_at_f2_2 = k_at_f2_2.template view(); + d_at_f3_2 = k_at_f3_2.template view(); + d_at_theta0_1 = k_at_theta0_1.template view(); + d_at_theta0_2 = k_at_theta0_2.template view(); + d_aat_k = k_aat_k.template view(); + d_aat_theta0_1 = k_aat_theta0_1.template view(); + d_aat_theta0_2 = k_aat_theta0_2.template view(); + d_bb13t_k = k_bb13t_k.template view(); + d_bb13t_r10 = k_bb13t_r10.template view(); + d_bb13t_r30 = k_bb13t_r30.template view(); + d_setflag_d = k_setflag_d.template view(); + d_setflag_mbt = k_setflag_mbt.template view(); + d_setflag_ebt = k_setflag_ebt.template view(); + d_setflag_at = k_setflag_at.template view(); + d_setflag_aat = k_setflag_aat.template view(); + d_setflag_bb13t = k_setflag_bb13t.template view(); + + for (int i = 1; i <= n; i++) { + k_k1.h_view[i] = k1[i]; + k_k2.h_view[i] = k2[i]; + k_k3.h_view[i] = k3[i]; + k_phi1.h_view[i] = phi1[i]; + k_phi2.h_view[i] = phi2[i]; + k_phi3.h_view[i] = phi3[i]; + k_mbt_f1.h_view[i] = mbt_f1[i]; + k_mbt_f2.h_view[i] = mbt_f2[i]; + k_mbt_f3.h_view[i] = mbt_f3[i]; + k_mbt_r0.h_view[i] = mbt_r0[i]; + k_ebt_f1_1.h_view[i] = ebt_f1_1[i]; + k_ebt_f2_1.h_view[i] = ebt_f2_1[i]; + k_ebt_f3_1.h_view[i] = ebt_f3_1[i]; + k_ebt_r0_1.h_view[i] = ebt_r0_1[i]; + k_ebt_f1_2.h_view[i] = ebt_f1_2[i]; + k_ebt_f2_2.h_view[i] = ebt_f2_2[i]; + k_ebt_f3_2.h_view[i] = ebt_f3_2[i]; + k_ebt_r0_2.h_view[i] = ebt_r0_2[i]; + k_at_f1_1.h_view[i] = at_f1_1[i]; + k_at_f2_1.h_view[i] = at_f2_1[i]; + k_at_f3_1.h_view[i] = at_f3_1[i]; + k_at_f1_2.h_view[i] = at_f1_2[i]; + k_at_f2_2.h_view[i] = at_f2_2[i]; + k_at_f3_2.h_view[i] = at_f3_2[i]; + k_at_theta0_1.h_view[i] = at_theta0_1[i]; + k_at_theta0_2.h_view[i] = at_theta0_2[i]; + k_aat_k.h_view[i] = aat_k[i]; + k_aat_theta0_1.h_view[i] = aat_theta0_1[i]; + k_aat_theta0_2.h_view[i] = aat_theta0_2[i]; + k_bb13t_k.h_view[i] = bb13t_k[i]; + k_bb13t_r10.h_view[i] = bb13t_r10[i]; + k_bb13t_r30.h_view[i] = bb13t_r30[i]; + k_setflag_d.h_view[i] = setflag_d[i]; + k_setflag_mbt.h_view[i] = setflag_mbt[i]; + k_setflag_ebt.h_view[i] = setflag_ebt[i]; + k_setflag_at.h_view[i] = setflag_at[i]; + k_setflag_aat.h_view[i] = setflag_aat[i]; + k_setflag_bb13t.h_view[i] = setflag_bb13t[i]; + } + + k_k1.template modify(); + k_k2.template modify(); + k_k3.template modify(); + k_phi1.template modify(); + k_phi2.template modify(); + k_phi3.template modify(); + k_mbt_f1.template modify(); + k_mbt_f2.template modify(); + k_mbt_f3.template modify(); + k_mbt_r0.template modify(); + k_ebt_f1_1.template modify(); + k_ebt_f2_1.template modify(); + k_ebt_f3_1.template modify(); + k_ebt_r0_1.template modify(); + k_ebt_f1_2.template modify(); + k_ebt_f2_2.template modify(); + k_ebt_f3_2.template modify(); + k_ebt_r0_2.template modify(); + k_at_f1_1.template modify(); + k_at_f2_1.template modify(); + k_at_f3_1.template modify(); + k_at_f1_2.template modify(); + k_at_f2_2.template modify(); + k_at_f3_2.template modify(); + k_at_theta0_1.template modify(); + k_at_theta0_2.template modify(); + k_aat_k.template modify(); + k_aat_theta0_1.template modify(); + k_aat_theta0_2.template modify(); + k_bb13t_k.template modify(); + k_bb13t_r10.template modify(); + k_bb13t_r30.template modify(); + k_setflag_d.template modify(); + k_setflag_mbt.template modify(); + k_setflag_ebt.template modify(); + k_setflag_at.template modify(); + k_setflag_aat.template modify(); + k_setflag_bb13t.template modify(); +} + +/* ---------------------------------------------------------------------- + tally energy and virial into global and per-atom accumulators + virial = r1F1 + r2F2 + r3F3 + r4F4 = (r1-r2) F1 + (r3-r2) F3 + (r4-r2) F4 + = (r1-r2) F1 + (r3-r2) F3 + (r4-r3 + r3-r2) F4 + = vb1*f1 + vb2*f3 + (vb3+vb2)*f4 +------------------------------------------------------------------------- */ + +template +//template +KOKKOS_INLINE_FUNCTION +void DihedralClass2Kokkos::ev_tally(EV_FLOAT &ev, const int i1, const int i2, const int i3, const int i4, + F_FLOAT &edihedral, F_FLOAT *f1, F_FLOAT *f3, F_FLOAT *f4, + const F_FLOAT &vb1x, const F_FLOAT &vb1y, const F_FLOAT &vb1z, + const F_FLOAT &vb2x, const F_FLOAT &vb2y, const F_FLOAT &vb2z, + const F_FLOAT &vb3x, const F_FLOAT &vb3y, const F_FLOAT &vb3z) const +{ + E_FLOAT edihedralquarter; + F_FLOAT v[6]; + + // The eatom and vatom arrays are atomic + Kokkos::View > v_eatom = k_eatom.view(); + Kokkos::View > v_vatom = k_vatom.view(); + + if (eflag_either) { + if (eflag_global) { + if (newton_bond) ev.evdwl += edihedral; + else { + edihedralquarter = 0.25*edihedral; + if (i1 < nlocal) ev.evdwl += edihedralquarter; + if (i2 < nlocal) ev.evdwl += edihedralquarter; + if (i3 < nlocal) ev.evdwl += edihedralquarter; + if (i4 < nlocal) ev.evdwl += edihedralquarter; + } + } + if (eflag_atom) { + edihedralquarter = 0.25*edihedral; + if (newton_bond || i1 < nlocal) v_eatom[i1] += edihedralquarter; + if (newton_bond || i2 < nlocal) v_eatom[i2] += edihedralquarter; + if (newton_bond || i3 < nlocal) v_eatom[i3] += edihedralquarter; + if (newton_bond || i4 < nlocal) v_eatom[i4] += edihedralquarter; + } + } + + if (vflag_either) { + v[0] = vb1x*f1[0] + vb2x*f3[0] + (vb3x+vb2x)*f4[0]; + v[1] = vb1y*f1[1] + vb2y*f3[1] + (vb3y+vb2y)*f4[1]; + v[2] = vb1z*f1[2] + vb2z*f3[2] + (vb3z+vb2z)*f4[2]; + v[3] = vb1x*f1[1] + vb2x*f3[1] + (vb3x+vb2x)*f4[1]; + v[4] = vb1x*f1[2] + vb2x*f3[2] + (vb3x+vb2x)*f4[2]; + v[5] = vb1y*f1[2] + vb2y*f3[2] + (vb3y+vb2y)*f4[2]; + + if (vflag_global) { + if (newton_bond) { + ev.v[0] += v[0]; + ev.v[1] += v[1]; + ev.v[2] += v[2]; + ev.v[3] += v[3]; + ev.v[4] += v[4]; + ev.v[5] += v[5]; + } else { + if (i1 < nlocal) { + ev.v[0] += 0.25*v[0]; + ev.v[1] += 0.25*v[1]; + ev.v[2] += 0.25*v[2]; + ev.v[3] += 0.25*v[3]; + ev.v[4] += 0.25*v[4]; + ev.v[5] += 0.25*v[5]; + } + if (i2 < nlocal) { + ev.v[0] += 0.25*v[0]; + ev.v[1] += 0.25*v[1]; + ev.v[2] += 0.25*v[2]; + ev.v[3] += 0.25*v[3]; + ev.v[4] += 0.25*v[4]; + ev.v[5] += 0.25*v[5]; + } + if (i3 < nlocal) { + ev.v[0] += 0.25*v[0]; + ev.v[1] += 0.25*v[1]; + ev.v[2] += 0.25*v[2]; + ev.v[3] += 0.25*v[3]; + ev.v[4] += 0.25*v[4]; + ev.v[5] += 0.25*v[5]; + } + if (i4 < nlocal) { + ev.v[0] += 0.25*v[0]; + ev.v[1] += 0.25*v[1]; + ev.v[2] += 0.25*v[2]; + ev.v[3] += 0.25*v[3]; + ev.v[4] += 0.25*v[4]; + ev.v[5] += 0.25*v[5]; + } + } + } + + if (vflag_atom) { + if (newton_bond || i1 < nlocal) { + v_vatom(i1,0) += 0.25*v[0]; + v_vatom(i1,1) += 0.25*v[1]; + v_vatom(i1,2) += 0.25*v[2]; + v_vatom(i1,3) += 0.25*v[3]; + v_vatom(i1,4) += 0.25*v[4]; + v_vatom(i1,5) += 0.25*v[5]; + } + if (newton_bond || i2 < nlocal) { + v_vatom(i2,0) += 0.25*v[0]; + v_vatom(i2,1) += 0.25*v[1]; + v_vatom(i2,2) += 0.25*v[2]; + v_vatom(i2,3) += 0.25*v[3]; + v_vatom(i2,4) += 0.25*v[4]; + v_vatom(i2,5) += 0.25*v[5]; + } + if (newton_bond || i3 < nlocal) { + v_vatom(i3,0) += 0.25*v[0]; + v_vatom(i3,1) += 0.25*v[1]; + v_vatom(i3,2) += 0.25*v[2]; + v_vatom(i3,3) += 0.25*v[3]; + v_vatom(i3,4) += 0.25*v[4]; + v_vatom(i3,5) += 0.25*v[5]; + } + if (newton_bond || i4 < nlocal) { + v_vatom(i4,0) += 0.25*v[0]; + v_vatom(i4,1) += 0.25*v[1]; + v_vatom(i4,2) += 0.25*v[2]; + v_vatom(i4,3) += 0.25*v[3]; + v_vatom(i4,4) += 0.25*v[4]; + v_vatom(i4,5) += 0.25*v[5]; + } + } + } +} + +/* ---------------------------------------------------------------------- */ + +namespace LAMMPS_NS { +template class DihedralClass2Kokkos; +#ifdef KOKKOS_HAVE_CUDA +template class DihedralClass2Kokkos; +#endif +} + diff --git a/src/KOKKOS/dihedral_class2_kokkos.h b/src/KOKKOS/dihedral_class2_kokkos.h new file mode 100644 index 0000000000..4c9b097057 --- /dev/null +++ b/src/KOKKOS/dihedral_class2_kokkos.h @@ -0,0 +1,120 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef DIHEDRAL_CLASS + +DihedralStyle(class2/kk,DihedralClass2Kokkos) +DihedralStyle(class2/kk/device,DihedralClass2Kokkos) +DihedralStyle(class2/kk/host,DihedralClass2Kokkos) + +#else + +#ifndef LMP_DIHEDRAL_CLASS2_KOKKOS_H +#define LMP_DIHEDRAL_CLASS2_KOKKOS_H + +#include "dihedral_class2.h" +#include "kokkos_type.h" + +namespace LAMMPS_NS { + +template +struct TagDihedralClass2Compute{}; + +template +class DihedralClass2Kokkos : public DihedralClass2 { + public: + typedef DeviceType device_type; + typedef EV_FLOAT value_type; + typedef ArrayTypes AT; + + DihedralClass2Kokkos(class LAMMPS *); + virtual ~DihedralClass2Kokkos(); + virtual void compute(int, int); + virtual void coeff(int, char **); + + template + KOKKOS_INLINE_FUNCTION + void operator()(TagDihedralClass2Compute, const int&, EV_FLOAT&) const; + + template + KOKKOS_INLINE_FUNCTION + void operator()(TagDihedralClass2Compute, const int&) const; + + //template + KOKKOS_INLINE_FUNCTION + void ev_tally(EV_FLOAT &ev, const int i1, const int i2, const int i3, const int i4, + F_FLOAT &edihedral, F_FLOAT *f1, F_FLOAT *f3, F_FLOAT *f4, + const F_FLOAT &vb1x, const F_FLOAT &vb1y, const F_FLOAT &vb1z, + const F_FLOAT &vb2x, const F_FLOAT &vb2y, const F_FLOAT &vb2z, + const F_FLOAT &vb3x, const F_FLOAT &vb3y, const F_FLOAT &vb3z) const; + + protected: + + class NeighborKokkos *neighborKK; + + typename AT::t_x_array_randomread x; + typename AT::t_f_array f; + typename AT::t_int_2d dihedrallist; + + DAT::tdual_efloat_1d k_eatom; + DAT::tdual_virial_array k_vatom; + typename AT::t_efloat_1d d_eatom; + typename AT::t_virial_array d_vatom; + + int nlocal,newton_bond; + int eflag,vflag; + + DAT::tdual_int_scalar k_warning_flag; + typename AT::t_int_scalar d_warning_flag; + HAT::t_int_scalar h_warning_flag; + + typename AT::tdual_ffloat_1d k_k2, k_k3, k_k1; + typename AT::tdual_ffloat_1d k_phi1, k_phi2, k_phi3; + typename AT::tdual_ffloat_1d k_mbt_f1, k_mbt_f2, k_mbt_f3, k_mbt_r0; + typename AT::tdual_ffloat_1d k_ebt_f1_1, k_ebt_f2_1, k_ebt_f3_1, k_ebt_r0_1; + typename AT::tdual_ffloat_1d k_ebt_f1_2, k_ebt_f2_2, k_ebt_f3_2, k_ebt_r0_2; + typename AT::tdual_ffloat_1d k_at_f1_1, k_at_f2_1, k_at_f3_1, k_at_theta0_1; + typename AT::tdual_ffloat_1d k_at_f1_2, k_at_f2_2, k_at_f3_2, k_at_theta0_2; + typename AT::tdual_ffloat_1d k_aat_k, k_aat_theta0_1, k_aat_theta0_2; + typename AT::tdual_ffloat_1d k_bb13t_k, k_bb13t_r10, k_bb13t_r30; + typename AT::tdual_ffloat_1d k_setflag_d, k_setflag_mbt, k_setflag_ebt; + typename AT::tdual_ffloat_1d k_setflag_at, k_setflag_aat, k_setflag_bb13t; + + typename AT::t_ffloat_1d d_k2, d_k3, d_k1; + typename AT::t_ffloat_1d d_phi1, d_phi2, d_phi3; + typename AT::t_ffloat_1d d_mbt_f1, d_mbt_f2, d_mbt_f3, d_mbt_r0; + typename AT::t_ffloat_1d d_ebt_f1_1, d_ebt_f2_1, d_ebt_f3_1, d_ebt_r0_1; + typename AT::t_ffloat_1d d_ebt_f1_2, d_ebt_f2_2, d_ebt_f3_2, d_ebt_r0_2; + typename AT::t_ffloat_1d d_at_f1_1, d_at_f2_1, d_at_f3_1, d_at_theta0_1; + typename AT::t_ffloat_1d d_at_f1_2, d_at_f2_2, d_at_f3_2, d_at_theta0_2; + typename AT::t_ffloat_1d d_aat_k, d_aat_theta0_1, d_aat_theta0_2; + typename AT::t_ffloat_1d d_bb13t_k, d_bb13t_r10, d_bb13t_r30; + typename AT::t_ffloat_1d d_setflag_d, d_setflag_mbt, d_setflag_ebt; + typename AT::t_ffloat_1d d_setflag_at, d_setflag_aat, d_setflag_bb13t; + + virtual void allocate(); +}; + +} + +#endif +#endif + +/* ERROR/WARNING messages: + +W: Dihedral problem + +Conformation of the 4 listed dihedral atoms is extreme; you may want +to check your simulation geometry. + +*/ diff --git a/src/KOKKOS/fix_qeq_reax_kokkos.cpp b/src/KOKKOS/fix_qeq_reax_kokkos.cpp index 8e155b4158..cf75a0424e 100644 --- a/src/KOKKOS/fix_qeq_reax_kokkos.cpp +++ b/src/KOKKOS/fix_qeq_reax_kokkos.cpp @@ -98,6 +98,7 @@ void FixQEqReaxKokkos::init() neighbor->requests[irequest]->half = 0; } else { //if (neighflag == HALF || neighflag == HALFTHREAD) neighbor->requests[irequest]->fix = 1; + neighbor->requests[irequest]->pair = 0; neighbor->requests[irequest]->full = 0; neighbor->requests[irequest]->half = 1; neighbor->requests[irequest]->ghost = 1; diff --git a/src/KOKKOS/improper_class2_kokkos.cpp b/src/KOKKOS/improper_class2_kokkos.cpp new file mode 100644 index 0000000000..60e2133984 --- /dev/null +++ b/src/KOKKOS/improper_class2_kokkos.cpp @@ -0,0 +1,1082 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: Ray Shan (Materials Design) +------------------------------------------------------------------------- */ + +#include +#include +#include +#include "improper_class2_kokkos.h" +#include "atom_kokkos.h" +#include "comm.h" +#include "neighbor_kokkos.h" +#include "domain.h" +#include "force.h" +#include "update.h" +#include "math_const.h" +#include "memory.h" +#include "error.h" +#include "atom_masks.h" + +using namespace LAMMPS_NS; +using namespace MathConst; + +#define TOLERANCE 0.05 +#define SMALL 0.001 + +/* ---------------------------------------------------------------------- */ + +template +ImproperClass2Kokkos::ImproperClass2Kokkos(LAMMPS *lmp) : ImproperClass2(lmp) +{ + atomKK = (AtomKokkos *) atom; + neighborKK = (NeighborKokkos *) neighbor; + execution_space = ExecutionSpaceFromDevice::space; + datamask_read = X_MASK | F_MASK | ENERGY_MASK | VIRIAL_MASK; + datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; + + k_warning_flag = DAT::tdual_int_scalar("Dihedral:warning_flag"); + d_warning_flag = k_warning_flag.view(); + h_warning_flag = k_warning_flag.h_view; +} + +/* ---------------------------------------------------------------------- */ + +template +ImproperClass2Kokkos::~ImproperClass2Kokkos() +{ + if (!copymode) { + memory->destroy_kokkos(k_eatom,eatom); + memory->destroy_kokkos(k_vatom,vatom); + } +} + +/* ---------------------------------------------------------------------- */ + +template +void ImproperClass2Kokkos::compute(int eflag_in, int vflag_in) +{ + eflag = eflag_in; + vflag = vflag_in; + + if (eflag || vflag) ev_setup(eflag,vflag); + else evflag = 0; + + // reallocate per-atom arrays if necessary + + if (eflag_atom) { + //if(k_eatom.dimension_0()destroy_kokkos(k_eatom,eatom); + memory->create_kokkos(k_eatom,eatom,maxeatom,"improper:eatom"); + d_eatom = k_eatom.template view(); + //} + } + if (vflag_atom) { + //if(k_vatom.dimension_0()destroy_kokkos(k_vatom,vatom); + memory->create_kokkos(k_vatom,vatom,maxvatom,6,"improper:vatom"); + d_vatom = k_vatom.template view(); + //} + } + + //atomKK->sync(execution_space,datamask_read); + k_k0.template sync(); + k_chi0.template sync(); + k_aa_k1.template sync(); + k_aa_k2.template sync(); + k_aa_k3.template sync(); + k_aa_theta0_1.template sync(); + k_aa_theta0_2.template sync(); + k_aa_theta0_3 .template sync(); + k_setflag.template sync(); + k_setflag_i.template sync(); + k_setflag_aa.template sync(); + + //if (eflag || vflag) atomKK->modified(execution_space,datamask_modify); + //else atomKK->modified(execution_space,F_MASK); + + x = atomKK->k_x.view(); + f = atomKK->k_f.view(); + neighborKK->k_improperlist.template sync(); + improperlist = neighborKK->k_improperlist.view(); + int nimproperlist = neighborKK->nimproperlist; + nlocal = atom->nlocal; + newton_bond = force->newton_bond; + + h_warning_flag() = 0; + k_warning_flag.template modify(); + k_warning_flag.template sync(); + + copymode = 1; + + // loop over neighbors of my atoms + + EV_FLOAT ev; + + // Improper energy/force + + if (evflag) { + if (newton_bond) { + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,nimproperlist),*this,ev); + } else { + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,nimproperlist),*this,ev); + } + } else { + if (newton_bond) { + Kokkos::parallel_for(Kokkos::RangePolicy >(0,nimproperlist),*this); + } else { + Kokkos::parallel_for(Kokkos::RangePolicy >(0,nimproperlist),*this); + } + } + DeviceType::fence(); + if (eflag_global) energy += ev.evdwl; + + // error check + + k_warning_flag.template modify(); + k_warning_flag.template sync(); + if (h_warning_flag()) + error->warning(FLERR,"Improper problem",0); + + // Angle-Angle energy/force + + if (evflag) { + if (newton_bond) { + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,nimproperlist),*this,ev); + } else { + Kokkos::parallel_reduce(Kokkos::RangePolicy >(0,nimproperlist),*this,ev); + } + } else { + if (newton_bond) { + Kokkos::parallel_for(Kokkos::RangePolicy >(0,nimproperlist),*this); + } else { + Kokkos::parallel_for(Kokkos::RangePolicy >(0,nimproperlist),*this); + } + } + DeviceType::fence(); + if (eflag_global) energy += ev.evdwl; + + if (vflag_global) { + virial[0] += ev.v[0]; + virial[1] += ev.v[1]; + virial[2] += ev.v[2]; + virial[3] += ev.v[3]; + virial[4] += ev.v[4]; + virial[5] += ev.v[5]; + } + + if (eflag_atom) { + k_eatom.template modify(); + k_eatom.template sync(); + } + + if (vflag_atom) { + k_vatom.template modify(); + k_vatom.template sync(); + } + + copymode = 0; +} + +/* ---------------------------------------------------------------------- */ + +template +template +KOKKOS_INLINE_FUNCTION +void ImproperClass2Kokkos::operator()(TagImproperClass2Compute, const int &n, EV_FLOAT& ev) const { + + // The f array is atomic + Kokkos::View > a_f = f; + + int i, j, k; + F_FLOAT delr[3][3],rmag[3],rinvmag[3],rmag2[3]; + F_FLOAT theta[3],costheta[3],sintheta[3]; + F_FLOAT cossqtheta[3],sinsqtheta[3],invstheta[3]; + F_FLOAT rABxrCB[3],rDBxrAB[3],rCBxrDB[3]; + F_FLOAT ddelr[3][4],dr[3][4][3],dinvr[3][4][3]; + F_FLOAT dthetadr[3][4][3],dinvsth[3][4][3]; + F_FLOAT dinv3r[4][3],dinvs3r[3][4][3]; + F_FLOAT drCBxrDB[3],rCBxdrDB[3],drDBxrAB[3],rDBxdrAB[3]; + F_FLOAT drABxrCB[3],rABxdrCB[3]; + F_FLOAT dot1,dot2,dd[3]; + F_FLOAT fdot[3][4][3],ftmp,invs3r[3],inv3r; + F_FLOAT drAB[3][4][3],drCB[3][4][3],drDB[3][4][3]; + F_FLOAT dchi[3][4][3],dtotalchi[4][3]; + F_FLOAT fabcd[4][3]; + + F_FLOAT t,tt1,tt3,sc1; + F_FLOAT dotCBDBAB,dotDBABCB,dotABCBDB; + F_FLOAT schiABCD,chiABCD,schiCBDA,chiCBDA,schiDBAC,chiDBAC; + F_FLOAT chi,deltachi,d2chi,cossin2; + F_FLOAT eimproper; + + const int i1 = improperlist(n,0); + const int i2 = improperlist(n,1); + const int i3 = improperlist(n,2); + const int i4 = improperlist(n,3); + const int type = improperlist(n,4); + + if (d_k0[type] != 0.0) { + + for (i = 0; i < 3; i++) + for (j = 0; j < 4; j++) + for (k = 0; k < 3; k++) { + dthetadr[i][j][k] = 0.0; + drAB[i][j][k] = 0.0; + drCB[i][j][k] = 0.0; + drDB[i][j][k] = 0.0; + } + + // difference vectors + + delr[0][0] = x(i1,0) - x(i2,0); + delr[0][1] = x(i1,1) - x(i2,1); + delr[0][2] = x(i1,2) - x(i2,2); + + delr[1][0] = x(i3,0) - x(i2,0); + delr[1][1] = x(i3,1) - x(i2,1); + delr[1][2] = x(i3,2) - x(i2,2); + + delr[2][0] = x(i4,0) - x(i2,0); + delr[2][1] = x(i4,1) - x(i2,1); + delr[2][2] = x(i4,2) - x(i2,2); + + // bond lengths and associated values + + for (i = 0; i < 3; i++) { + rmag2[i] = delr[i][0]*delr[i][0] + delr[i][1]*delr[i][1] + delr[i][2]*delr[i][2]; + rmag[i] = sqrt(rmag2[i]); + rinvmag[i] = 1.0/rmag[i]; + } + + // angle ABC, CBD, ABD + + costheta[0] = (delr[0][0]*delr[1][0] + delr[0][1]*delr[1][1] + + delr[0][2]*delr[1][2]) / (rmag[0]*rmag[1]); + costheta[1] = (delr[1][0]*delr[2][0] + delr[1][1]*delr[2][1] + + delr[1][2]*delr[2][2]) / (rmag[1]*rmag[2]); + costheta[2] = (delr[0][0]*delr[2][0] + delr[0][1]*delr[2][1] + + delr[0][2]*delr[2][2]) / (rmag[0]*rmag[2]); + + // sin and cos of improper + + F_FLOAT s1 = 1.0 - costheta[1]*costheta[1]; + if (s1 < SMALL) s1 = SMALL; + s1 = 1.0 / s1; + + F_FLOAT s2 = 1.0 - costheta[2]*costheta[2]; + if (s2 < SMALL) s2 = SMALL; + s2 = 1.0 / s2; + + F_FLOAT s12 = sqrt(s1*s2); + F_FLOAT c = (costheta[1]*costheta[2] + costheta[0]) * s12; + + // error check + + /* + if ((c > 1.0 + TOLERANCE || c < (-1.0 - TOLERANCE)) && !d_warning_flag()) + Kokkos::atomic_fetch_add(&d_warning_flag(),1); + */ + if ((costheta[0] == -1.0 || costheta[1] == -1.0 || costheta[2] == -1.0) && !d_warning_flag()) + Kokkos::atomic_fetch_add(&d_warning_flag(),1); + + if (c > 1.0) c = 1.0; + if (c < -1.0) c = -1.0; + + F_FLOAT s = sqrt(1.0 - c*c); + if (s < SMALL) s = SMALL; + + for (i = 0; i < 3; i++) { + if (costheta[i] > 1.0) costheta[i] = 1.0; + if (costheta[i] < -1.0) costheta[i] = -1.0; + theta[i] = acos(costheta[i]); + cossqtheta[i] = costheta[i]*costheta[i]; + sintheta[i] = sin(theta[i]); + invstheta[i] = 1.0/sintheta[i]; + sinsqtheta[i] = sintheta[i]*sintheta[i]; + } + + // cross & dot products + + //cross(delr[0],delr[1],rABxrCB); + rABxrCB[0] = delr[0][1]*delr[1][2] - delr[0][2]*delr[1][1]; + rABxrCB[1] = delr[0][2]*delr[1][0] - delr[0][0]*delr[1][2]; + rABxrCB[2] = delr[0][0]*delr[1][1] - delr[0][1]*delr[1][0]; + + //cross(delr[2],delr[0],rDBxrAB); + rDBxrAB[0] = delr[2][1]*delr[0][2] - delr[2][2]*delr[0][1]; + rDBxrAB[1] = delr[2][2]*delr[0][0] - delr[2][0]*delr[0][2]; + rDBxrAB[2] = delr[2][0]*delr[0][1] - delr[2][1]*delr[0][0]; + + //cross(delr[1],delr[2],rCBxrDB); + rCBxrDB[0] = delr[1][1]*delr[2][2] - delr[1][2]*delr[2][1]; + rCBxrDB[1] = delr[1][2]*delr[2][0] - delr[1][0]*delr[2][2]; + rCBxrDB[2] = delr[1][0]*delr[2][1] - delr[1][1]*delr[2][0]; + + //dotCBDBAB = dot(rCBxrDB,delr[0]); + dotCBDBAB = rCBxrDB[0]*delr[0][0] + rCBxrDB[1]*delr[0][1] + rCBxrDB[2]*delr[0][2]; + + //dotDBABCB = dot(rDBxrAB,delr[1]); + dotDBABCB = rDBxrAB[0]*delr[1][0] + rDBxrAB[1]*delr[1][1] + rDBxrAB[2]*delr[1][2]; + + //dotABCBDB = dot(rABxrCB,delr[2]); + dotABCBDB = rABxrCB[0]*delr[2][0] + rABxrCB[1]*delr[2][1] + rABxrCB[2]*delr[2][2]; + + t = rmag[0] * rmag[1] * rmag[2]; + inv3r = 1.0/t; + invs3r[0] = invstheta[1] * inv3r; + invs3r[1] = invstheta[2] * inv3r; + invs3r[2] = invstheta[0] * inv3r; + + // chi ABCD, CBDA, DBAC: final chi is average of three + + schiABCD = dotCBDBAB * invs3r[0]; + chiABCD = asin(schiABCD); + schiCBDA = dotDBABCB * invs3r[1]; + chiCBDA = asin(schiCBDA); + schiDBAC = dotABCBDB * invs3r[2]; + chiDBAC = asin(schiDBAC); + + chi = (chiABCD + chiCBDA + chiDBAC) / 3.0; + deltachi = chi - d_chi0[type]; + d2chi = deltachi * deltachi; + + // energy + + if (eflag) eimproper = d_k0[type]*d2chi; + + // forces + + for (i = 0; i < 3; i++) + for (j = 0; j < 4; j++) + ddelr[i][j] = 0.0; + + ddelr[0][0] = 1.0; + ddelr[0][1] = -1.0; + ddelr[1][1] = -1.0; + ddelr[1][2] = 1.0; + ddelr[2][1] = -1.0; + ddelr[2][3] = 1.0; + + // compute d(|r|)/dr and d(1/|r|)/dr for each direction, bond and atom + + for (i = 0; i < 3; i++) + for (j = 0; j < 4; j++) + for (k = 0; k < 3; k++) { + dr[i][j][k] = delr[i][k] * ddelr[i][j] / rmag[i]; + dinvr[i][j][k] = -dr[i][j][k] / rmag2[i]; + } + + // compute d(1 / (|r_AB| * |r_CB| * |r_DB|) / dr + + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + dinv3r[i][j] = rinvmag[1] * (rinvmag[2] * dinvr[0][i][j] + + rinvmag[0] * dinvr[2][i][j]) + + rinvmag[2] * rinvmag[0] * dinvr[1][i][j]; + + // compute d(theta)/d(r) for 3 angles + // angleABC + + tt1 = costheta[0] / rmag2[0]; + tt3 = costheta[0] / rmag2[1]; + sc1 = 1.0 / sqrt(1.0 - cossqtheta[0]); + + dthetadr[0][0][0] = sc1 * ((tt1 * delr[0][0]) - + (delr[1][0] * rinvmag[0] * rinvmag[1])); + dthetadr[0][0][1] = sc1 * ((tt1 * delr[0][1]) - + (delr[1][1] * rinvmag[0] * rinvmag[1])); + dthetadr[0][0][2] = sc1 * ((tt1 * delr[0][2]) - + (delr[1][2] * rinvmag[0] * rinvmag[1])); + dthetadr[0][1][0] = -sc1 * ((tt1 * delr[0][0]) - + (delr[1][0] * rinvmag[0] * rinvmag[1]) + + (tt3 * delr[1][0]) - + (delr[0][0] * rinvmag[0] * rinvmag[1])); + dthetadr[0][1][1] = -sc1 * ((tt1 * delr[0][1]) - + (delr[1][1] * rinvmag[0] * rinvmag[1]) + + (tt3 * delr[1][1]) - + (delr[0][1] * rinvmag[0] * rinvmag[1])); + dthetadr[0][1][2] = -sc1 * ((tt1 * delr[0][2]) - + (delr[1][2] * rinvmag[0] * rinvmag[1]) + + (tt3 * delr[1][2]) - + (delr[0][2] * rinvmag[0] * rinvmag[1])); + dthetadr[0][2][0] = sc1 * ((tt3 * delr[1][0]) - + (delr[0][0] * rinvmag[0] * rinvmag[1])); + dthetadr[0][2][1] = sc1 * ((tt3 * delr[1][1]) - + (delr[0][1] * rinvmag[0] * rinvmag[1])); + dthetadr[0][2][2] = sc1 * ((tt3 * delr[1][2]) - + (delr[0][2] * rinvmag[0] * rinvmag[1])); + + + // angleCBD + + tt1 = costheta[1] / rmag2[1]; + tt3 = costheta[1] / rmag2[2]; + sc1 = 1.0 / sqrt(1.0 - cossqtheta[1]); + + dthetadr[1][2][0] = sc1 * ((tt1 * delr[1][0]) - + (delr[2][0] * rinvmag[1] * rinvmag[2])); + dthetadr[1][2][1] = sc1 * ((tt1 * delr[1][1]) - + (delr[2][1] * rinvmag[1] * rinvmag[2])); + dthetadr[1][2][2] = sc1 * ((tt1 * delr[1][2]) - + (delr[2][2] * rinvmag[1] * rinvmag[2])); + dthetadr[1][1][0] = -sc1 * ((tt1 * delr[1][0]) - + (delr[2][0] * rinvmag[1] * rinvmag[2]) + + (tt3 * delr[2][0]) - + (delr[1][0] * rinvmag[2] * rinvmag[1])); + dthetadr[1][1][1] = -sc1 * ((tt1 * delr[1][1]) - + (delr[2][1] * rinvmag[1] * rinvmag[2]) + + (tt3 * delr[2][1]) - + (delr[1][1] * rinvmag[2] * rinvmag[1])); + dthetadr[1][1][2] = -sc1 * ((tt1 * delr[1][2]) - + (delr[2][2] * rinvmag[1] * rinvmag[2]) + + (tt3 * delr[2][2]) - + (delr[1][2] * rinvmag[2] * rinvmag[1])); + dthetadr[1][3][0] = sc1 * ((tt3 * delr[2][0]) - + (delr[1][0] * rinvmag[2] * rinvmag[1])); + dthetadr[1][3][1] = sc1 * ((tt3 * delr[2][1]) - + (delr[1][1] * rinvmag[2] * rinvmag[1])); + dthetadr[1][3][2] = sc1 * ((tt3 * delr[2][2]) - + (delr[1][2] * rinvmag[2] * rinvmag[1])); + + // angleABD + + tt1 = costheta[2] / rmag2[0]; + tt3 = costheta[2] / rmag2[2]; + sc1 = 1.0 / sqrt(1.0 - cossqtheta[2]); + + dthetadr[2][0][0] = sc1 * ((tt1 * delr[0][0]) - + (delr[2][0] * rinvmag[0] * rinvmag[2])); + dthetadr[2][0][1] = sc1 * ((tt1 * delr[0][1]) - + (delr[2][1] * rinvmag[0] * rinvmag[2])); + dthetadr[2][0][2] = sc1 * ((tt1 * delr[0][2]) - + (delr[2][2] * rinvmag[0] * rinvmag[2])); + dthetadr[2][1][0] = -sc1 * ((tt1 * delr[0][0]) - + (delr[2][0] * rinvmag[0] * rinvmag[2]) + + (tt3 * delr[2][0]) - + (delr[0][0] * rinvmag[2] * rinvmag[0])); + dthetadr[2][1][1] = -sc1 * ((tt1 * delr[0][1]) - + (delr[2][1] * rinvmag[0] * rinvmag[2]) + + (tt3 * delr[2][1]) - + (delr[0][1] * rinvmag[2] * rinvmag[0])); + dthetadr[2][1][2] = -sc1 * ((tt1 * delr[0][2]) - + (delr[2][2] * rinvmag[0] * rinvmag[2]) + + (tt3 * delr[2][2]) - + (delr[0][2] * rinvmag[2] * rinvmag[0])); + dthetadr[2][3][0] = sc1 * ((tt3 * delr[2][0]) - + (delr[0][0] * rinvmag[2] * rinvmag[0])); + dthetadr[2][3][1] = sc1 * ((tt3 * delr[2][1]) - + (delr[0][1] * rinvmag[2] * rinvmag[0])); + dthetadr[2][3][2] = sc1 * ((tt3 * delr[2][2]) - + (delr[0][2] * rinvmag[2] * rinvmag[0])); + + // compute d( 1 / sin(theta))/dr + // i = angle, j = atom, k = direction + + for (i = 0; i < 3; i++) { + cossin2 = -costheta[i] / sinsqtheta[i]; + for (j = 0; j < 4; j++) + for (k = 0; k < 3; k++) + dinvsth[i][j][k] = cossin2 * dthetadr[i][j][k]; + } + + // compute d(1 / sin(theta) * |r_AB| * |r_CB| * |r_DB|)/dr + // i = angle, j = atom + + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) { + dinvs3r[0][i][j] = (invstheta[1] * dinv3r[i][j]) + + (inv3r * dinvsth[1][i][j]); + dinvs3r[1][i][j] = (invstheta[2] * dinv3r[i][j]) + + (inv3r * dinvsth[2][i][j]); + dinvs3r[2][i][j] = (invstheta[0] * dinv3r[i][j]) + + (inv3r * dinvsth[0][i][j]); + } + + // drCB(i,j,k), etc + // i = vector X'/Y'/Z', j = atom A/B/C/D, k = direction X/Y/Z + + for (i = 0; i < 3; i++) { + drCB[i][1][i] = -1.0; + drAB[i][1][i] = -1.0; + drDB[i][1][i] = -1.0; + drDB[i][3][i] = 1.0; + drCB[i][2][i] = 1.0; + drAB[i][0][i] = 1.0; + } + + // d((r_CB x r_DB) dot r_AB) + + for (i = 0; i < 3; i++) + for (j = 0; j < 4; j++) { + //cross(delr[1],drDB[i][j],rCBxdrDB); + rCBxdrDB[0] = delr[1][1]*drDB[i][j][2] - delr[1][2]*drDB[i][j][1]; + rCBxdrDB[1] = delr[1][2]*drDB[i][j][0] - delr[1][0]*drDB[i][j][2]; + rCBxdrDB[2] = delr[1][0]*drDB[i][j][1] - delr[1][1]*drDB[i][j][0]; + + //cross(drCB[i][j],delr[2],drCBxrDB); + drCBxrDB[0] = drCB[i][j][1]*delr[2][2] - drCB[i][j][2]*delr[2][1]; + drCBxrDB[1] = drCB[i][j][2]*delr[2][0] - drCB[i][j][0]*delr[2][2]; + drCBxrDB[2] = drCB[i][j][0]*delr[2][1] - drCB[i][j][1]*delr[2][0]; + + for (k = 0; k < 3; k++) dd[k] = rCBxdrDB[k] + drCBxrDB[k]; + //dot1 = dot(dd,delr[0]); + dot1 = dd[0]*delr[0][0] + dd[1]*delr[0][1] + dd[2]*delr[0][2]; + + //dot2 = dot(rCBxrDB,drAB[i][j]); + dot2 = rCBxrDB[0]*drAB[i][j][0] + rCBxrDB[1]*drAB[i][j][1] + rCBxrDB[2]*drAB[i][j][2]; + + fdot[0][j][i] = dot1 + dot2; + } + + // d((r_DB x r_AB) dot r_CB) + + for (i = 0; i < 3; i++) + for (j = 0; j < 4; j++) { + //cross(delr[2],drAB[i][j],rDBxdrAB); + rDBxdrAB[0] = delr[2][1]*drAB[i][j][2] - delr[2][2]*drAB[i][j][1]; + rDBxdrAB[1] = delr[2][2]*drAB[i][j][0] - delr[2][0]*drAB[i][j][2]; + rDBxdrAB[2] = delr[2][0]*drAB[i][j][1] - delr[2][1]*drAB[i][j][0]; + + //cross(drDB[i][j],delr[0],drDBxrAB); + drDBxrAB[0] = drDB[i][j][1]*delr[0][2] - drDB[i][j][2]*delr[0][1]; + drDBxrAB[1] = drDB[i][j][2]*delr[0][0] - drDB[i][j][0]*delr[0][2]; + drDBxrAB[2] = drDB[i][j][0]*delr[0][1] - drDB[i][j][1]*delr[0][0]; + + for (k = 0; k < 3; k++) dd[k] = rDBxdrAB[k] + drDBxrAB[k]; + + //dot1 = dot(dd,delr[1]); + dot1 = dd[0]*delr[1][0] + dd[1]*delr[1][1] + dd[2]*delr[1][2]; + + //dot2 = dot(rDBxrAB,drCB[i][j]); + dot2 = rDBxrAB[0]*drCB[i][j][0] + rDBxrAB[1]*drCB[i][j][1] + rDBxrAB[2]*drCB[i][j][2]; + + fdot[1][j][i] = dot1 + dot2; + } + + // d((r_AB x r_CB) dot r_DB) + + for (i = 0; i < 3; i++) + for (j = 0; j < 4; j++) { + //cross(delr[0],drCB[i][j],rABxdrCB); + rABxdrCB[0] = delr[0][1]*drCB[i][j][2] - delr[0][2]*drCB[i][j][1]; + rABxdrCB[1] = delr[0][2]*drCB[i][j][0] - delr[0][0]*drCB[i][j][2]; + rABxdrCB[2] = delr[0][0]*drCB[i][j][1] - delr[0][1]*drCB[i][j][0]; + + //cross(drAB[i][j],delr[1],drABxrCB); + drABxrCB[0] = drAB[i][j][1]*delr[1][2] - drAB[i][j][2]*delr[1][1]; + drABxrCB[1] = drAB[i][j][2]*delr[1][0] - drAB[i][j][0]*delr[1][2]; + drABxrCB[2] = drAB[i][j][0]*delr[1][1] - drAB[i][j][1]*delr[1][0]; + + for (k = 0; k < 3; k++) dd[k] = rABxdrCB[k] + drABxrCB[k]; + + //dot1 = dot(dd,delr[2]); + dot1 = dd[0]*delr[2][0] + dd[1]*delr[2][1] + dd[2]*delr[2][2]; + + //dot2 = dot(rABxrCB,drDB[i][j]); + dot2 = rABxrCB[0]*drDB[i][j][0] +rABxrCB[1]*drDB[i][j][1] +rABxrCB[2]*drDB[i][j][2]; + + fdot[2][j][i] = dot1 + dot2; + } + + // force on each atom + + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) { + ftmp = (fdot[0][i][j] * invs3r[0]) + (dinvs3r[0][i][j] * dotCBDBAB); + dchi[0][i][j] = ftmp / cos(chiABCD); + ftmp = (fdot[1][i][j] * invs3r[1]) + (dinvs3r[1][i][j] * dotDBABCB); + dchi[1][i][j] = ftmp / cos(chiCBDA); + ftmp = (fdot[2][i][j] * invs3r[2]) + (dinvs3r[2][i][j] * dotABCBDB); + dchi[2][i][j] = ftmp / cos(chiDBAC); + dtotalchi[i][j] = (dchi[0][i][j]+dchi[1][i][j]+dchi[2][i][j]) / 3.0; + } + + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + fabcd[i][j] = -2.0*d_k0[type] * deltachi*dtotalchi[i][j]; + + // apply force to each of 4 atoms + + F_FLOAT f1[3],f2[3],f3[3],f4[3]; + + for (i = 0; i < 3; i++) { + f1[i] = fabcd[0][i]; + f2[i] = fabcd[1][i]; + f3[i] = fabcd[2][i]; + f4[i] = fabcd[3][i]; + } + + if (NEWTON_BOND || i1 < nlocal) { + a_f(i1,0) += f1[0]; + a_f(i1,1) += f1[1]; + a_f(i1,2) += f1[2]; + } + + if (NEWTON_BOND || i2 < nlocal) { + a_f(i2,0) += f2[0]; + a_f(i2,1) += f2[1]; + a_f(i2,2) += f2[2]; + } + + if (NEWTON_BOND || i3 < nlocal) { + a_f(i3,0) += f3[0]; + a_f(i3,1) += f3[1]; + a_f(i3,2) += f3[2]; + } + + if (NEWTON_BOND || i4 < nlocal) { + a_f(i4,0) += f4[0]; + a_f(i4,1) += f4[1]; + a_f(i4,2) += f4[2]; + } + + if (EVFLAG) + ev_tally(ev,i1,i2,i3,i4,eimproper,f1,f3,f4, + delr[0][0], delr[0][1], delr[0][2], + delr[1][0], delr[1][1], delr[1][2], + delr[2][0]- delr[1][0], delr[2][1]-delr[1][1], delr[2][2]-delr[1][2]); + } + +} + +/* ---------------------------------------------------------------------- */ + +template +template +KOKKOS_INLINE_FUNCTION +void ImproperClass2Kokkos::operator()(TagImproperClass2Compute, const int &n) const { + EV_FLOAT ev; + this->template operator()(TagImproperClass2Compute(), n, ev); +} + +/* ---------------------------------------------------------------------- */ + +template +template +KOKKOS_INLINE_FUNCTION +void ImproperClass2Kokkos::operator()(TagImproperClass2AngleAngle, const int &n, EV_FLOAT& ev) const { + + // The f array is atomic + Kokkos::View > a_f = f; + + int i,j,k; + F_FLOAT eimproper; + F_FLOAT delxAB,delyAB,delzAB,rABmag2,rAB; + F_FLOAT delxBC,delyBC,delzBC,rBCmag2,rBC; + F_FLOAT delxBD,delyBD,delzBD,rBDmag2,rBD; + F_FLOAT costhABC,thetaABC,costhABD; + F_FLOAT thetaABD,costhCBD,thetaCBD,dthABC,dthCBD,dthABD; + F_FLOAT sc1,t1,t3,r12; + F_FLOAT dthetadr[3][4][3],fabcd[4][3]; + + const int i1 = improperlist(n,0); + const int i2 = improperlist(n,1); + const int i3 = improperlist(n,2); + const int i4 = improperlist(n,3); + const int type = improperlist(n,4); + + if ((d_aa_k1[type] != 0.0) || (d_aa_k2[type] != 0.0) || (d_aa_k3[type] != 0.0)) { + + // difference vectors + + delxAB = x(i1,0) - x(i2,0); + delyAB = x(i1,1) - x(i2,1); + delzAB = x(i1,2) - x(i2,2); + + delxBC = x(i3,0) - x(i2,0); + delyBC = x(i3,1) - x(i2,1); + delzBC = x(i3,2) - x(i2,2); + + delxBD = x(i4,0) - x(i2,0); + delyBD = x(i4,1) - x(i2,1); + delzBD = x(i4,2) - x(i2,2); + + // bond lengths + + rABmag2 = delxAB*delxAB + delyAB*delyAB + delzAB*delzAB; + rAB = sqrt(rABmag2); + rBCmag2 = delxBC*delxBC + delyBC*delyBC + delzBC*delzBC; + rBC = sqrt(rBCmag2); + rBDmag2 = delxBD*delxBD + delyBD*delyBD + delzBD*delzBD; + rBD = sqrt(rBDmag2); + + // angle ABC, ABD, CBD + + costhABC = (delxAB*delxBC + delyAB*delyBC + delzAB*delzBC) / (rAB * rBC); + if (costhABC > 1.0) costhABC = 1.0; + if (costhABC < -1.0) costhABC = -1.0; + thetaABC = acos(costhABC); + + costhABD = (delxAB*delxBD + delyAB*delyBD + delzAB*delzBD) / (rAB * rBD); + if (costhABD > 1.0) costhABD = 1.0; + if (costhABD < -1.0) costhABD = -1.0; + thetaABD = acos(costhABD); + + costhCBD = (delxBC*delxBD + delyBC*delyBD + delzBC*delzBD) /(rBC * rBD); + if (costhCBD > 1.0) costhCBD = 1.0; + if (costhCBD < -1.0) costhCBD = -1.0; + thetaCBD = acos(costhCBD); + + dthABC = thetaABC - d_aa_theta0_1[type]; + dthABD = thetaABD - d_aa_theta0_2[type]; + dthCBD = thetaCBD - d_aa_theta0_3[type]; + + // energy + + if (eflag) eimproper = d_aa_k2[type] * dthABC * dthABD + + d_aa_k1[type] * dthABC * dthCBD + + d_aa_k3[type] * dthABD * dthCBD; + + // d(theta)/d(r) array + + for (i = 0; i < 3; i++) + for (j = 0; j < 4; j++) + for (k = 0; k < 3; k++) + dthetadr[i][j][k] = 0.0; + + // angle ABC + + sc1 = sqrt(1.0/(1.0 - costhABC*costhABC)); + t1 = costhABC / rABmag2; + t3 = costhABC / rBCmag2; + r12 = 1.0 / (rAB * rBC); + + dthetadr[0][0][0] = sc1 * ((t1 * delxAB) - (delxBC * r12)); + dthetadr[0][0][1] = sc1 * ((t1 * delyAB) - (delyBC * r12)); + dthetadr[0][0][2] = sc1 * ((t1 * delzAB) - (delzBC * r12)); + dthetadr[0][1][0] = sc1 * ((-t1 * delxAB) + (delxBC * r12) + + (-t3 * delxBC) + (delxAB * r12)); + dthetadr[0][1][1] = sc1 * ((-t1 * delyAB) + (delyBC * r12) + + (-t3 * delyBC) + (delyAB * r12)); + dthetadr[0][1][2] = sc1 * ((-t1 * delzAB) + (delzBC * r12) + + (-t3 * delzBC) + (delzAB * r12)); + dthetadr[0][2][0] = sc1 * ((t3 * delxBC) - (delxAB * r12)); + dthetadr[0][2][1] = sc1 * ((t3 * delyBC) - (delyAB * r12)); + dthetadr[0][2][2] = sc1 * ((t3 * delzBC) - (delzAB * r12)); + + // angle CBD + + sc1 = sqrt(1.0/(1.0 - costhCBD*costhCBD)); + t1 = costhCBD / rBCmag2; + t3 = costhCBD / rBDmag2; + r12 = 1.0 / (rBC * rBD); + + dthetadr[1][2][0] = sc1 * ((t1 * delxBC) - (delxBD * r12)); + dthetadr[1][2][1] = sc1 * ((t1 * delyBC) - (delyBD * r12)); + dthetadr[1][2][2] = sc1 * ((t1 * delzBC) - (delzBD * r12)); + dthetadr[1][1][0] = sc1 * ((-t1 * delxBC) + (delxBD * r12) + + (-t3 * delxBD) + (delxBC * r12)); + dthetadr[1][1][1] = sc1 * ((-t1 * delyBC) + (delyBD * r12) + + (-t3 * delyBD) + (delyBC * r12)); + dthetadr[1][1][2] = sc1 * ((-t1 * delzBC) + (delzBD * r12) + + (-t3 * delzBD) + (delzBC * r12)); + dthetadr[1][3][0] = sc1 * ((t3 * delxBD) - (delxBC * r12)); + dthetadr[1][3][1] = sc1 * ((t3 * delyBD) - (delyBC * r12)); + dthetadr[1][3][2] = sc1 * ((t3 * delzBD) - (delzBC * r12)); + + // angle ABD + + sc1 = sqrt(1.0/(1.0 - costhABD*costhABD)); + t1 = costhABD / rABmag2; + t3 = costhABD / rBDmag2; + r12 = 1.0 / (rAB * rBD); + + dthetadr[2][0][0] = sc1 * ((t1 * delxAB) - (delxBD * r12)); + dthetadr[2][0][1] = sc1 * ((t1 * delyAB) - (delyBD * r12)); + dthetadr[2][0][2] = sc1 * ((t1 * delzAB) - (delzBD * r12)); + dthetadr[2][1][0] = sc1 * ((-t1 * delxAB) + (delxBD * r12) + + (-t3 * delxBD) + (delxAB * r12)); + dthetadr[2][1][1] = sc1 * ((-t1 * delyAB) + (delyBD * r12) + + (-t3 * delyBD) + (delyAB * r12)); + dthetadr[2][1][2] = sc1 * ((-t1 * delzAB) + (delzBD * r12) + + (-t3 * delzBD) + (delzAB * r12)); + dthetadr[2][3][0] = sc1 * ((t3 * delxBD) - (delxAB * r12)); + dthetadr[2][3][1] = sc1 * ((t3 * delyBD) - (delyAB * r12)); + dthetadr[2][3][2] = sc1 * ((t3 * delzBD) - (delzAB * r12)); + + // angleangle forces + + for (i = 0; i < 4; i++) + for (j = 0; j < 3; j++) + fabcd[i][j] = - + ((d_aa_k1[type] * (dthABC*dthetadr[1][i][j] + dthCBD*dthetadr[0][i][j])) + + (d_aa_k2[type] * (dthABC*dthetadr[2][i][j] + dthABD*dthetadr[0][i][j])) + + (d_aa_k3[type] * (dthABD*dthetadr[1][i][j] + dthCBD*dthetadr[2][i][j]))); + + // apply force to each of 4 atoms + + F_FLOAT f1[3],f2[3],f3[3],f4[3]; + + for (i = 0; i < 3; i++) { + f1[i] = fabcd[0][i]; + f2[i] = fabcd[1][i]; + f3[i] = fabcd[2][i]; + f4[i] = fabcd[3][i]; + } + + if (NEWTON_BOND || i1 < nlocal) { + a_f(i1,0) += f1[0]; + a_f(i1,1) += f1[1]; + a_f(i1,2) += f1[2]; + } + + if (NEWTON_BOND || i2 < nlocal) { + a_f(i2,0) += f2[0]; + a_f(i2,1) += f2[1]; + a_f(i2,2) += f2[2]; + } + + if (NEWTON_BOND || i3 < nlocal) { + a_f(i3,0) += f3[0]; + a_f(i3,1) += f3[1]; + a_f(i3,2) += f3[2]; + } + + if (NEWTON_BOND || i4 < nlocal) { + a_f(i4,0) += f4[0]; + a_f(i4,1) += f4[1]; + a_f(i4,2) += f4[2]; + } + + if (EVFLAG) + ev_tally(ev,i1,i2,i3,i4,eimproper, + fabcd[0],fabcd[2],fabcd[3], + delxAB,delyAB,delzAB,delxBC,delyBC,delzBC, + delxBD-delxBC,delyBD-delyBC,delzBD-delzBC); + } + +} + +/* ---------------------------------------------------------------------- */ + +template +template +KOKKOS_INLINE_FUNCTION +void ImproperClass2Kokkos::operator()(TagImproperClass2AngleAngle, const int &n) const { + EV_FLOAT ev; + this->template operator()(TagImproperClass2AngleAngle(), n, ev); +} + +/* ---------------------------------------------------------------------- */ + +template +void ImproperClass2Kokkos::allocate() +{ + ImproperClass2::allocate(); +} + +/* ---------------------------------------------------------------------- + set coeffs for one type +------------------------------------------------------------------------- */ + +template +void ImproperClass2Kokkos::coeff(int narg, char **arg) +{ + ImproperClass2::coeff(narg, arg); + + int n = atom->nimpropertypes; + k_k0 = typename ArrayTypes::tdual_ffloat_1d("ImproperClass2::k0",n+1); + k_chi0 = typename ArrayTypes::tdual_ffloat_1d("ImproperClass2::chi0",n+1); + k_aa_k1 = typename ArrayTypes::tdual_ffloat_1d("ImproperClass2::aa_k1",n+1); + k_aa_k2 = typename ArrayTypes::tdual_ffloat_1d("ImproperClass2::aa_k2",n+1); + k_aa_k3 = typename ArrayTypes::tdual_ffloat_1d("ImproperClass2::aa_k3",n+1); + k_aa_theta0_1 = typename ArrayTypes::tdual_ffloat_1d("ImproperClass2::aa_theta0_1",n+1); + k_aa_theta0_2 = typename ArrayTypes::tdual_ffloat_1d("ImproperClass2::aa_theta0_2",n+1); + k_aa_theta0_3 = typename ArrayTypes::tdual_ffloat_1d("ImproperClass2::aa_theta0_3",n+1); + k_setflag = typename ArrayTypes::tdual_ffloat_1d("ImproperClass2::setflag",n+1); + k_setflag_i = typename ArrayTypes::tdual_ffloat_1d("ImproperClass2::setflag_i",n+1); + k_setflag_aa = typename ArrayTypes::tdual_ffloat_1d("ImproperClass2::setflag_aa",n+1); + + d_k0 = k_k0.template view(); + d_chi0 = k_chi0.template view(); + d_aa_k1 = k_aa_k1.template view(); + d_aa_k2 = k_aa_k2.template view(); + d_aa_k3 = k_aa_k3.template view(); + d_aa_theta0_1 = k_aa_theta0_1.template view(); + d_aa_theta0_2 = k_aa_theta0_2.template view(); + d_aa_theta0_3 = k_aa_theta0_3.template view(); + d_setflag = k_setflag.template view(); + d_setflag_i = k_setflag_i.template view(); + d_setflag_aa = k_setflag_aa.template view(); + + for (int i = 1; i <= n; i++) { + k_k0.h_view[i] = k0[i]; + k_chi0.h_view[i] = chi0[i]; + k_aa_k1.h_view[i] = aa_k1[i]; + k_aa_k2.h_view[i] = aa_k2[i]; + k_aa_k3.h_view[i] = aa_k3[i]; + k_aa_theta0_1.h_view[i] = aa_theta0_1[i]; + k_aa_theta0_2.h_view[i] = aa_theta0_2[i]; + k_aa_theta0_3.h_view[i] = aa_theta0_3[i]; + k_setflag.h_view[i] = setflag[i]; + k_setflag_i.h_view[i] = setflag_i[i]; + k_setflag_aa.h_view[i] = setflag_aa[i]; + } + + k_k0.template modify(); + k_chi0.template modify(); + k_aa_k1.template modify(); + k_aa_k2.template modify(); + k_aa_k3.template modify(); + k_aa_theta0_1.template modify(); + k_aa_theta0_2.template modify(); + k_aa_theta0_3 .template modify(); + k_setflag.template modify(); + k_setflag_i.template modify(); + k_setflag_aa.template modify(); +} + +/* ---------------------------------------------------------------------- + tally energy and virial into global and per-atom accumulators + virial = r1F1 + r2F2 + r3F3 + r4F4 = (r1-r2) F1 + (r3-r2) F3 + (r4-r2) F4 + = (r1-r2) F1 + (r3-r2) F3 + (r4-r3 + r3-r2) F4 + = vb1*f1 + vb2*f3 + (vb3+vb2)*f4 +------------------------------------------------------------------------- */ + +template +//template +KOKKOS_INLINE_FUNCTION +void ImproperClass2Kokkos::ev_tally(EV_FLOAT &ev, const int i1, const int i2, const int i3, const int i4, + F_FLOAT &eimproper, F_FLOAT *f1, F_FLOAT *f3, F_FLOAT *f4, + const F_FLOAT &vb1x, const F_FLOAT &vb1y, const F_FLOAT &vb1z, + const F_FLOAT &vb2x, const F_FLOAT &vb2y, const F_FLOAT &vb2z, + const F_FLOAT &vb3x, const F_FLOAT &vb3y, const F_FLOAT &vb3z) const +{ + E_FLOAT eimproperquarter; + F_FLOAT v[6]; + + // The eatom and vatom arrays are atomic + Kokkos::View > v_eatom = k_eatom.view(); + Kokkos::View > v_vatom = k_vatom.view(); + + if (eflag_either) { + if (eflag_global) { + if (newton_bond) ev.evdwl += eimproper; + else { + eimproperquarter = 0.25*eimproper; + if (i1 < nlocal) ev.evdwl += eimproperquarter; + if (i2 < nlocal) ev.evdwl += eimproperquarter; + if (i3 < nlocal) ev.evdwl += eimproperquarter; + if (i4 < nlocal) ev.evdwl += eimproperquarter; + } + } + if (eflag_atom) { + eimproperquarter = 0.25*eimproper; + if (newton_bond || i1 < nlocal) v_eatom[i1] += eimproperquarter; + if (newton_bond || i2 < nlocal) v_eatom[i2] += eimproperquarter; + if (newton_bond || i3 < nlocal) v_eatom[i3] += eimproperquarter; + if (newton_bond || i4 < nlocal) v_eatom[i4] += eimproperquarter; + } + } + + if (vflag_either) { + v[0] = vb1x*f1[0] + vb2x*f3[0] + (vb3x+vb2x)*f4[0]; + v[1] = vb1y*f1[1] + vb2y*f3[1] + (vb3y+vb2y)*f4[1]; + v[2] = vb1z*f1[2] + vb2z*f3[2] + (vb3z+vb2z)*f4[2]; + v[3] = vb1x*f1[1] + vb2x*f3[1] + (vb3x+vb2x)*f4[1]; + v[4] = vb1x*f1[2] + vb2x*f3[2] + (vb3x+vb2x)*f4[2]; + v[5] = vb1y*f1[2] + vb2y*f3[2] + (vb3y+vb2y)*f4[2]; + + if (vflag_global) { + if (newton_bond) { + ev.v[0] += v[0]; + ev.v[1] += v[1]; + ev.v[2] += v[2]; + ev.v[3] += v[3]; + ev.v[4] += v[4]; + ev.v[5] += v[5]; + } else { + if (i1 < nlocal) { + ev.v[0] += 0.25*v[0]; + ev.v[1] += 0.25*v[1]; + ev.v[2] += 0.25*v[2]; + ev.v[3] += 0.25*v[3]; + ev.v[4] += 0.25*v[4]; + ev.v[5] += 0.25*v[5]; + } + if (i2 < nlocal) { + ev.v[0] += 0.25*v[0]; + ev.v[1] += 0.25*v[1]; + ev.v[2] += 0.25*v[2]; + ev.v[3] += 0.25*v[3]; + ev.v[4] += 0.25*v[4]; + ev.v[5] += 0.25*v[5]; + } + if (i3 < nlocal) { + ev.v[0] += 0.25*v[0]; + ev.v[1] += 0.25*v[1]; + ev.v[2] += 0.25*v[2]; + ev.v[3] += 0.25*v[3]; + ev.v[4] += 0.25*v[4]; + ev.v[5] += 0.25*v[5]; + } + if (i4 < nlocal) { + ev.v[0] += 0.25*v[0]; + ev.v[1] += 0.25*v[1]; + ev.v[2] += 0.25*v[2]; + ev.v[3] += 0.25*v[3]; + ev.v[4] += 0.25*v[4]; + ev.v[5] += 0.25*v[5]; + } + } + } + + if (vflag_atom) { + if (newton_bond || i1 < nlocal) { + v_vatom(i1,0) += 0.25*v[0]; + v_vatom(i1,1) += 0.25*v[1]; + v_vatom(i1,2) += 0.25*v[2]; + v_vatom(i1,3) += 0.25*v[3]; + v_vatom(i1,4) += 0.25*v[4]; + v_vatom(i1,5) += 0.25*v[5]; + } + if (newton_bond || i2 < nlocal) { + v_vatom(i2,0) += 0.25*v[0]; + v_vatom(i2,1) += 0.25*v[1]; + v_vatom(i2,2) += 0.25*v[2]; + v_vatom(i2,3) += 0.25*v[3]; + v_vatom(i2,4) += 0.25*v[4]; + v_vatom(i2,5) += 0.25*v[5]; + } + if (newton_bond || i3 < nlocal) { + v_vatom(i3,0) += 0.25*v[0]; + v_vatom(i3,1) += 0.25*v[1]; + v_vatom(i3,2) += 0.25*v[2]; + v_vatom(i3,3) += 0.25*v[3]; + v_vatom(i3,4) += 0.25*v[4]; + v_vatom(i3,5) += 0.25*v[5]; + } + if (newton_bond || i4 < nlocal) { + v_vatom(i4,0) += 0.25*v[0]; + v_vatom(i4,1) += 0.25*v[1]; + v_vatom(i4,2) += 0.25*v[2]; + v_vatom(i4,3) += 0.25*v[3]; + v_vatom(i4,4) += 0.25*v[4]; + v_vatom(i4,5) += 0.25*v[5]; + } + } + } +} + +/* ---------------------------------------------------------------------- */ + +namespace LAMMPS_NS { +template class ImproperClass2Kokkos; +#ifdef KOKKOS_HAVE_CUDA +template class ImproperClass2Kokkos; +#endif +} + diff --git a/src/KOKKOS/improper_class2_kokkos.h b/src/KOKKOS/improper_class2_kokkos.h new file mode 100644 index 0000000000..8effe2950d --- /dev/null +++ b/src/KOKKOS/improper_class2_kokkos.h @@ -0,0 +1,115 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef IMPROPER_CLASS + +ImproperStyle(class2/kk,ImproperClass2Kokkos) +ImproperStyle(class2/kk/device,ImproperClass2Kokkos) +ImproperStyle(class2/kk/host,ImproperClass2Kokkos) + +#else + +#ifndef LMP_IMPROPER_CLASS2_KOKKOS_H +#define LMP_IMPROPER_CLASS2_KOKKOS_H + +#include "improper_class2.h" +#include "kokkos_type.h" + +namespace LAMMPS_NS { + +template +struct TagImproperClass2Compute{}; + +template +struct TagImproperClass2AngleAngle{}; + +template +class ImproperClass2Kokkos : public ImproperClass2 { + public: + typedef DeviceType device_type; + typedef EV_FLOAT value_type; + typedef ArrayTypes AT; + + ImproperClass2Kokkos(class LAMMPS *); + virtual ~ImproperClass2Kokkos(); + virtual void compute(int, int); + virtual void coeff(int, char **); + + template + KOKKOS_INLINE_FUNCTION + void operator()(TagImproperClass2Compute, const int&, EV_FLOAT&) const; + + template + KOKKOS_INLINE_FUNCTION + void operator()(TagImproperClass2Compute, const int&) const; + + template + KOKKOS_INLINE_FUNCTION + void operator()(TagImproperClass2AngleAngle, const int&, EV_FLOAT&) const; + + template + KOKKOS_INLINE_FUNCTION + void operator()(TagImproperClass2AngleAngle, const int&) const; + + //template + KOKKOS_INLINE_FUNCTION + void ev_tally(EV_FLOAT &ev, const int i1, const int i2, const int i3, const int i4, + F_FLOAT &eimproper, F_FLOAT *f1, F_FLOAT *f3, F_FLOAT *f4, + const F_FLOAT &vb1x, const F_FLOAT &vb1y, const F_FLOAT &vb1z, + const F_FLOAT &vb2x, const F_FLOAT &vb2y, const F_FLOAT &vb2z, + const F_FLOAT &vb3x, const F_FLOAT &vb3y, const F_FLOAT &vb3z) const; + + protected: + + class NeighborKokkos *neighborKK; + + typename AT::t_x_array_randomread x; + typename Kokkos::View > f; + typename AT::t_int_2d improperlist; + + DAT::tdual_efloat_1d k_eatom; + DAT::tdual_virial_array k_vatom; + typename AT::t_efloat_1d d_eatom; + typename AT::t_virial_array d_vatom; + + int nlocal,newton_bond; + int eflag,vflag; + + DAT::tdual_int_scalar k_warning_flag; + typename AT::t_int_scalar d_warning_flag; + HAT::t_int_scalar h_warning_flag; + + typename AT::tdual_ffloat_1d k_k0,k_chi0; + typename AT::tdual_ffloat_1d k_aa_k1,k_aa_k2,k_aa_k3,k_aa_theta0_1,k_aa_theta0_2,k_aa_theta0_3; + typename AT::tdual_ffloat_1d k_setflag_i,k_setflag_aa,k_setflag; + + typename AT::t_ffloat_1d d_k0,d_chi0; + typename AT::t_ffloat_1d d_aa_k1,d_aa_k2,d_aa_k3,d_aa_theta0_1,d_aa_theta0_2,d_aa_theta0_3; + typename AT::t_ffloat_1d d_setflag_i,d_setflag_aa,d_setflag; + + virtual void allocate(); +}; + +} + +#endif +#endif + +/* ERROR/WARNING messages: + +W: Dihedral problem + +Conformation of the 4 listed dihedral atoms is extreme; you may want +to check your simulation geometry. + +*/ diff --git a/src/KOKKOS/neighbor_kokkos.cpp b/src/KOKKOS/neighbor_kokkos.cpp index 1bf3f2ef39..2a85255e12 100644 --- a/src/KOKKOS/neighbor_kokkos.cpp +++ b/src/KOKKOS/neighbor_kokkos.cpp @@ -306,7 +306,7 @@ void NeighborKokkos::build_kokkos(int topoflag) atomKK->sync(Host,ALL_MASK); for (i = 0; i < npair_perpetual; i++) { m = plist[i]; - lists[m]->grow(nlocal,nall); + if (!lists[m]->copy) lists[m]->grow(nlocal,nall); neigh_pair[m]->build_setup(); neigh_pair[m]->build(lists[m]); } diff --git a/src/KSPACE/pair_buck_long_coul_long.cpp b/src/KSPACE/pair_buck_long_coul_long.cpp index eb311fe3db..26bcb136b3 100644 --- a/src/KSPACE/pair_buck_long_coul_long.cpp +++ b/src/KSPACE/pair_buck_long_coul_long.cpp @@ -268,24 +268,19 @@ void PairBuckLongCoulLong::init_style() else if (respa == 1) { irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 1; - neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->respainner = 1; irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 3; - neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->respaouter = 1; } else { irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 1; - neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->respainner = 1; irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 2; - neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->respamiddle = 1; irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 3; - neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->respaouter = 1; } diff --git a/src/KSPACE/pair_lj_charmm_coul_long.cpp b/src/KSPACE/pair_lj_charmm_coul_long.cpp index bd020a439a..7b3fdd4b5f 100644 --- a/src/KSPACE/pair_lj_charmm_coul_long.cpp +++ b/src/KSPACE/pair_lj_charmm_coul_long.cpp @@ -700,24 +700,19 @@ void PairLJCharmmCoulLong::init_style() else if (respa == 1) { irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 1; - neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->respainner = 1; irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 3; - neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->respaouter = 1; } else { irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 1; - neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->respainner = 1; irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 2; - neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->respamiddle = 1; irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 3; - neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->respaouter = 1; } diff --git a/src/KSPACE/pair_lj_cut_coul_long.cpp b/src/KSPACE/pair_lj_cut_coul_long.cpp index 0d0649fe6a..764aebc522 100644 --- a/src/KSPACE/pair_lj_cut_coul_long.cpp +++ b/src/KSPACE/pair_lj_cut_coul_long.cpp @@ -669,24 +669,19 @@ void PairLJCutCoulLong::init_style() else if (respa == 1) { irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 1; - neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->respainner = 1; irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 3; - neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->respaouter = 1; } else { irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 1; - neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->respainner = 1; irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 2; - neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->respamiddle = 1; irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 3; - neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->respaouter = 1; } diff --git a/src/KSPACE/pair_lj_long_coul_long.cpp b/src/KSPACE/pair_lj_long_coul_long.cpp index 90d517ca28..e474347935 100644 --- a/src/KSPACE/pair_lj_long_coul_long.cpp +++ b/src/KSPACE/pair_lj_long_coul_long.cpp @@ -263,24 +263,19 @@ void PairLJLongCoulLong::init_style() else if (respa == 1) { irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 1; - neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->respainner = 1; irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 3; - neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->respaouter = 1; } else { irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 1; - neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->respainner = 1; irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 2; - neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->respamiddle = 1; irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 3; - neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->respaouter = 1; } diff --git a/src/MAKE/OPTIONS/Makefile.kokkos_phi b/src/MAKE/OPTIONS/Makefile.kokkos_phi index 7e69cc033f..7dc0bb091a 100644 --- a/src/MAKE/OPTIONS/Makefile.kokkos_phi +++ b/src/MAKE/OPTIONS/Makefile.kokkos_phi @@ -113,10 +113,13 @@ shlib: $(OBJ) $(EXTRA_LINK_DEPENDS) # Individual dependencies -depend : fastdep.exe $(SRC) - @./fastdep.exe $(EXTRA_INC) -- $^ > .depend || exit 1 +#depend : fastdep.exe $(SRC) +# @./fastdep.exe $(EXTRA_INC) -- $^ > .depend || exit 1 -fastdep.exe: ../DEPEND/fastdep.c - cc -O -o $@ $< +#fastdep.exe: ../DEPEND/fastdep.c +# cc -O -o $@ $< -sinclude .depend +#sinclude .depend + +DEPENDS = $(OBJ:.o=.d) +sinclude $(DEPENDS) \ No newline at end of file diff --git a/src/MAKE/OPTIONS/Makefile.omp b/src/MAKE/OPTIONS/Makefile.omp index fd485d5416..5c25c8e41c 100644 --- a/src/MAKE/OPTIONS/Makefile.omp +++ b/src/MAKE/OPTIONS/Makefile.omp @@ -7,7 +7,7 @@ SHELL = /bin/sh # specify flags and libraries needed for your compiler CC = mpicxx -CCFLAGS = -g -O3 -restrict -fopenmp +CCFLAGS = -g -O3 -fopenmp SHFLAGS = -fPIC DEPFLAGS = -M diff --git a/src/MC/fix_gcmc.cpp b/src/MC/fix_gcmc.cpp index 8e19928e0a..470896815a 100644 --- a/src/MC/fix_gcmc.cpp +++ b/src/MC/fix_gcmc.cpp @@ -2246,7 +2246,11 @@ void FixGCMC::update_gas_atoms_list() double com[3]; com[0] = com[1] = com[2] = 0.0; group->xcm(molecule_group,gas_mass,com); - comx[imolecule] = com[0]; + + // remap unwrapped com into periodic box + + domain->remap(com); + comx[imolecule] = com[0]; comy[imolecule] = com[1]; comz[imolecule] = com[2]; } diff --git a/src/MEAM/pair_meam.cpp b/src/MEAM/pair_meam.cpp index 46c3792f7c..ede89a83c2 100644 --- a/src/MEAM/pair_meam.cpp +++ b/src/MEAM/pair_meam.cpp @@ -421,9 +421,6 @@ void PairMEAM::init_style() neighbor->requests[irequest_full]->full = 1; int irequest_half = neighbor->request(this,instance_me); neighbor->requests[irequest_half]->id = 2; - neighbor->requests[irequest_half]->half = 0; - neighbor->requests[irequest_half]->half_from_full = 1; - neighbor->requests[irequest_half]->otherlist = irequest_full; // setup Fortran-style mapping array needed by MEAM package // fmap is indexed from 1:ntypes by Fortran and stores a Fortran index diff --git a/src/USER-DPD/npair_halffull_newton_ssa.h b/src/USER-DPD/npair_halffull_newton_ssa.h index 8608164950..03903815b1 100644 --- a/src/USER-DPD/npair_halffull_newton_ssa.h +++ b/src/USER-DPD/npair_halffull_newton_ssa.h @@ -15,7 +15,7 @@ NPairStyle(halffull/newton/ssa, NPairHalffullNewtonSSA, - NP_HALFFULL | NP_NSQ | NP_BIN | NP_MULTI | NP_NEWTON | + NP_HALF_FULL | NP_NSQ | NP_BIN | NP_MULTI | NP_NEWTON | NP_ORTHO | NP_TRI | NP_SSA) #else diff --git a/src/USER-MGPT/pair_mgpt.cpp b/src/USER-MGPT/pair_mgpt.cpp index 97c5c16e70..bac405bcbb 100644 --- a/src/USER-MGPT/pair_mgpt.cpp +++ b/src/USER-MGPT/pair_mgpt.cpp @@ -2010,10 +2010,6 @@ void PairMGPT::init_style() // Also need half neighbor list. int irequest_half = neighbor->request(this); neighbor->requests[irequest_half]->id = 2; - neighbor->requests[irequest_half]->half = 0; - neighbor->requests[irequest_half]->half_from_full = 1; - neighbor->requests[irequest_half]->otherlist = irequest_full; - } /* ---------------------------------------------------------------------- diff --git a/src/USER-MISC/pair_meam_spline.cpp b/src/USER-MISC/pair_meam_spline.cpp index cb6ddbd2ae..614661ad55 100644 --- a/src/USER-MISC/pair_meam_spline.cpp +++ b/src/USER-MISC/pair_meam_spline.cpp @@ -501,9 +501,6 @@ void PairMEAMSpline::init_style() neighbor->requests[irequest_full]->full = 1; int irequest_half = neighbor->request(this,instance_me); neighbor->requests[irequest_half]->id = 2; - neighbor->requests[irequest_half]->half = 0; - neighbor->requests[irequest_half]->half_from_full = 1; - neighbor->requests[irequest_half]->otherlist = irequest_full; } /* ---------------------------------------------------------------------- diff --git a/src/USER-MISC/pair_meam_sw_spline.cpp b/src/USER-MISC/pair_meam_sw_spline.cpp index 8ae9a3b7d9..3eda3ea45d 100644 --- a/src/USER-MISC/pair_meam_sw_spline.cpp +++ b/src/USER-MISC/pair_meam_sw_spline.cpp @@ -537,9 +537,6 @@ void PairMEAMSWSpline::init_style() neighbor->requests[irequest_full]->full = 1; int irequest_half = neighbor->request(this,instance_me); neighbor->requests[irequest_half]->id = 2; - neighbor->requests[irequest_half]->half = 0; - neighbor->requests[irequest_half]->half_from_full = 1; - neighbor->requests[irequest_half]->otherlist = irequest_full; } /* ---------------------------------------------------------------------- diff --git a/src/USER-OMP/fix_shear_history_omp.cpp b/src/USER-OMP/fix_shear_history_omp.cpp index fa9ca0711c..4180e0af41 100644 --- a/src/USER-OMP/fix_shear_history_omp.cpp +++ b/src/USER-OMP/fix_shear_history_omp.cpp @@ -72,8 +72,8 @@ void FixShearHistoryOMP::pre_exchange() ilist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; - firsttouch = list->listgranhistory->firstneigh; - firstshear = list->listgranhistory->firstdouble; + firsttouch = list->listhistory->firstneigh; + firstshear = list->listhistory->firstdouble; int nlocal_neigh = 0; if (inum) nlocal_neigh = ilist[inum-1] + 1; diff --git a/src/USER-OMP/npair_half_size_bin_newtoff_omp.cpp b/src/USER-OMP/npair_half_size_bin_newtoff_omp.cpp index 89a677806a..699d347db5 100644 --- a/src/USER-OMP/npair_half_size_bin_newtoff_omp.cpp +++ b/src/USER-OMP/npair_half_size_bin_newtoff_omp.cpp @@ -44,13 +44,13 @@ void NPairHalfSizeBinNewtoffOmp::build(NeighList *list) { const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; - FixShearHistory * const fix_history = list->fix_history; - NeighList * listgranhistory = list->listgranhistory; + FixShearHistory * const fix_history = (FixShearHistory *) list->fix_history; + NeighList * listhistory = list->listhistory; NPAIR_OMP_INIT; #if defined(_OPENMP) -#pragma omp parallel default(none) shared(list,listgranhistory) +#pragma omp parallel default(none) shared(list,listhistory) #endif NPAIR_OMP_SETUP(nlocal); @@ -89,11 +89,11 @@ void NPairHalfSizeBinNewtoffOmp::build(NeighList *list) npartner = fix_history->npartner; partner = fix_history->partner; shearpartner = fix_history->shearpartner; - firsttouch = listgranhistory->firstneigh; - firstshear = listgranhistory->firstdouble; - ipage_touch = listgranhistory->ipage+tid; - dpage_shear = listgranhistory->dpage+tid; - dnum = listgranhistory->dnum; + firsttouch = listhistory->firstneigh; + firstshear = listhistory->firstdouble; + ipage_touch = listhistory->ipage+tid; + dpage_shear = listhistory->dpage+tid; + dnum = listhistory->dnum; dnumbytes = dnum * sizeof(double); ipage_touch->reset(); dpage_shear->reset(); diff --git a/src/USER-OMP/npair_half_size_bin_newton_omp.cpp b/src/USER-OMP/npair_half_size_bin_newton_omp.cpp index 66aa573ca8..0d7e4e68da 100644 --- a/src/USER-OMP/npair_half_size_bin_newton_omp.cpp +++ b/src/USER-OMP/npair_half_size_bin_newton_omp.cpp @@ -43,8 +43,8 @@ void NPairHalfSizeBinNewtonOmp::build(NeighList *list) { const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; - FixShearHistory * const fix_history = list->fix_history; - NeighList * listgranhistory = list->listgranhistory; + FixShearHistory * const fix_history = (FixShearHistory *) list->fix_history; + NeighList * listhistory = list->listhistory; if (fix_history) { fix_history->nlocal_neigh = nlocal; fix_history->nall_neigh = nlocal + atom->nghost; @@ -53,7 +53,7 @@ void NPairHalfSizeBinNewtonOmp::build(NeighList *list) NPAIR_OMP_INIT; #if defined(_OPENMP) -#pragma omp parallel default(none) shared(list,listgranhistory) +#pragma omp parallel default(none) shared(list,listhistory) #endif NPAIR_OMP_SETUP(nlocal); @@ -92,11 +92,11 @@ void NPairHalfSizeBinNewtonOmp::build(NeighList *list) npartner = fix_history->npartner; partner = fix_history->partner; shearpartner = fix_history->shearpartner; - firsttouch = listgranhistory->firstneigh; - firstshear = listgranhistory->firstdouble; - ipage_touch = listgranhistory->ipage+tid; - dpage_shear = listgranhistory->dpage+tid; - dnum = listgranhistory->dnum; + firsttouch = listhistory->firstneigh; + firstshear = listhistory->firstdouble; + ipage_touch = listhistory->ipage+tid; + dpage_shear = listhistory->dpage+tid; + dnum = listhistory->dnum; dnumbytes = dnum * sizeof(double); ipage_touch->reset(); dpage_shear->reset(); diff --git a/src/USER-OMP/npair_half_size_nsq_newtoff_omp.cpp b/src/USER-OMP/npair_half_size_nsq_newtoff_omp.cpp index 48fc846c52..70caa23527 100644 --- a/src/USER-OMP/npair_half_size_nsq_newtoff_omp.cpp +++ b/src/USER-OMP/npair_half_size_nsq_newtoff_omp.cpp @@ -45,8 +45,8 @@ void NPairHalfSizeNsqNewtoffOmp::build(NeighList *list) const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; const int bitmask = (includegroup) ? group->bitmask[includegroup] : 0; - FixShearHistory * const fix_history = list->fix_history; - NeighList * listgranhistory = list->listgranhistory; + FixShearHistory * const fix_history = (FixShearHistory *) list->fix_history; + NeighList * listhistory = list->listhistory; if (fix_history) { fix_history->nlocal_neigh = nlocal; fix_history->nall_neigh = nlocal + atom->nghost; @@ -55,7 +55,7 @@ void NPairHalfSizeNsqNewtoffOmp::build(NeighList *list) NPAIR_OMP_INIT; #if defined(_OPENMP) -#pragma omp parallel default(none) shared(list,listgranhistory) +#pragma omp parallel default(none) shared(list,listhistory) #endif NPAIR_OMP_SETUP(nlocal); @@ -93,11 +93,11 @@ void NPairHalfSizeNsqNewtoffOmp::build(NeighList *list) npartner = fix_history->npartner; partner = fix_history->partner; shearpartner = fix_history->shearpartner; - firsttouch = listgranhistory->firstneigh; - firstshear = listgranhistory->firstdouble; - ipage_touch = listgranhistory->ipage+tid; - dpage_shear = listgranhistory->dpage+tid; - dnum = listgranhistory->dnum; + firsttouch = listhistory->firstneigh; + firstshear = listhistory->firstdouble; + ipage_touch = listhistory->ipage+tid; + dpage_shear = listhistory->dpage+tid; + dnum = listhistory->dnum; dnumbytes = dnum * sizeof(double); ipage_touch->reset(); dpage_shear->reset(); diff --git a/src/USER-OMP/npair_half_size_nsq_newton_omp.cpp b/src/USER-OMP/npair_half_size_nsq_newton_omp.cpp index 086f08a601..f2aa807981 100644 --- a/src/USER-OMP/npair_half_size_nsq_newton_omp.cpp +++ b/src/USER-OMP/npair_half_size_nsq_newton_omp.cpp @@ -46,8 +46,8 @@ void NPairHalfSizeNsqNewtonOmp::build(NeighList *list) const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; const int bitmask = (includegroup) ? group->bitmask[includegroup] : 0;; - FixShearHistory * const fix_history = list->fix_history; - NeighList * listgranhistory = list->listgranhistory; + FixShearHistory * const fix_history = (FixShearHistory *) list->fix_history; + NeighList * listhistory = list->listhistory; if (fix_history) { fix_history->nlocal_neigh = nlocal; fix_history->nall_neigh = nlocal+atom->nghost; @@ -56,7 +56,7 @@ void NPairHalfSizeNsqNewtonOmp::build(NeighList *list) NPAIR_OMP_INIT; #if defined(_OPENMP) -#pragma omp parallel default(none) shared(list,listgranhistory) +#pragma omp parallel default(none) shared(list,listhistory) #endif NPAIR_OMP_SETUP(nlocal); @@ -94,11 +94,11 @@ void NPairHalfSizeNsqNewtonOmp::build(NeighList *list) npartner = fix_history->npartner; partner = fix_history->partner; shearpartner = fix_history->shearpartner; - firsttouch = listgranhistory->firstneigh; - firstshear = listgranhistory->firstdouble; - ipage_touch = listgranhistory->ipage+tid; - dpage_shear = listgranhistory->dpage+tid; - dnum = listgranhistory->dnum; + firsttouch = listhistory->firstneigh; + firstshear = listhistory->firstdouble; + ipage_touch = listhistory->ipage+tid; + dpage_shear = listhistory->dpage+tid; + dnum = listhistory->dnum; dnumbytes = dnum * sizeof(double); ipage_touch->reset(); dpage_shear->reset(); diff --git a/src/USER-OMP/npair_halffull_newtoff_omp.h b/src/USER-OMP/npair_halffull_newtoff_omp.h index dffef2c3d3..2df055af35 100644 --- a/src/USER-OMP/npair_halffull_newtoff_omp.h +++ b/src/USER-OMP/npair_halffull_newtoff_omp.h @@ -15,7 +15,7 @@ NPairStyle(halffull/newtoff/omp, NPairHalffullNewtoffOmp, - NP_HALFFULL | NP_NEWTOFF | NP_OMP | + NP_HALF_FULL | NP_NEWTOFF | NP_OMP | NP_HALF | NP_NSQ | NP_BIN | NP_MULTI | NP_ORTHO | NP_TRI) #else diff --git a/src/USER-OMP/npair_halffull_newton_omp.h b/src/USER-OMP/npair_halffull_newton_omp.h index f7fc7c1ec7..968aa53e14 100644 --- a/src/USER-OMP/npair_halffull_newton_omp.h +++ b/src/USER-OMP/npair_halffull_newton_omp.h @@ -15,7 +15,7 @@ NPairStyle(halffull/newton/omp, NPairHalffullNewtonOmp, - NP_HALFFULL | NP_NEWTON | NP_OMP | + NP_HALF_FULL | NP_NEWTON | NP_OMP | NP_HALF | NP_NSQ | NP_BIN | NP_MULTI | NP_ORTHO | NP_TRI) #else diff --git a/src/USER-OMP/npair_skip_omp.h b/src/USER-OMP/npair_skip_omp.h index d3bc9b75ca..a6ee1930d4 100644 --- a/src/USER-OMP/npair_skip_omp.h +++ b/src/USER-OMP/npair_skip_omp.h @@ -18,7 +18,7 @@ NPairStyle(skip/omp, NPairSkip, - NP_SKIP | NP_HALF | NP_FULL | NP_HALFFULL | + NP_SKIP | NP_HALF | NP_FULL | NP_NSQ | NP_BIN | NP_MULTI | NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI | NP_OMP) @@ -47,7 +47,7 @@ NPairStyle(skip/size/off2on/oneside/omp, NPairStyle(skip/ghost/omp, NPairSkip, - NP_SKIP | NP_HALF | NP_FULL | NP_HALFFULL | + NP_SKIP | NP_HALF | NP_FULL | NP_NSQ | NP_BIN | NP_MULTI | NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI | NP_OMP | NP_GHOST) diff --git a/src/USER-OMP/pair_gran_hertz_history_omp.cpp b/src/USER-OMP/pair_gran_hertz_history_omp.cpp index 5689782590..ac40e29edf 100644 --- a/src/USER-OMP/pair_gran_hertz_history_omp.cpp +++ b/src/USER-OMP/pair_gran_hertz_history_omp.cpp @@ -134,8 +134,8 @@ void PairGranHertzHistoryOMP::eval(int iifrom, int iito, ThrData * const thr) ilist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; - firsttouch = list->listgranhistory->firstneigh; - firstshear = list->listgranhistory->firstdouble; + firsttouch = list->listhistory->firstneigh; + firstshear = list->listhistory->firstdouble; // loop over neighbors of my atoms diff --git a/src/USER-OMP/pair_gran_hooke_history_omp.cpp b/src/USER-OMP/pair_gran_hooke_history_omp.cpp index 906e52cfa8..e507a63f7c 100644 --- a/src/USER-OMP/pair_gran_hooke_history_omp.cpp +++ b/src/USER-OMP/pair_gran_hooke_history_omp.cpp @@ -137,8 +137,8 @@ void PairGranHookeHistoryOMP::eval(int iifrom, int iito, ThrData * const thr) ilist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; - firsttouch = listgranhistory->firstneigh; - firstshear = listgranhistory->firstdouble; + firsttouch = listhistory->firstneigh; + firstshear = listhistory->firstdouble; // loop over neighbors of my atoms diff --git a/src/USER-SMD/pair_smd_hertz.cpp b/src/USER-SMD/pair_smd_hertz.cpp index 76143d6395..b5bae7ef47 100644 --- a/src/USER-SMD/pair_smd_hertz.cpp +++ b/src/USER-SMD/pair_smd_hertz.cpp @@ -334,8 +334,7 @@ void PairHertz::init_style() { error->all(FLERR, "Pair style smd/hertz requires atom style with contact_radius"); int irequest = neighbor->request(this); - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->gran = 1; + neighbor->requests[irequest]->size = 1; // set maxrad_dynamic and maxrad_frozen for each type // include future Fix pour particles as dynamic diff --git a/src/USER-SMD/pair_smd_tlsph.cpp b/src/USER-SMD/pair_smd_tlsph.cpp index aee5eefcc2..1900519935 100644 --- a/src/USER-SMD/pair_smd_tlsph.cpp +++ b/src/USER-SMD/pair_smd_tlsph.cpp @@ -1731,8 +1731,7 @@ void PairTlsph::init_style() { // request a granular neighbor list int irequest = neighbor->request(this); - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->gran = 1; + neighbor->requests[irequest]->size = 1; // set maxrad_dynamic and maxrad_frozen for each type // include future Fix pour particles as dynamic diff --git a/src/USER-SMD/pair_smd_triangulated_surface.cpp b/src/USER-SMD/pair_smd_triangulated_surface.cpp index b4e63dd11d..e4a7ea1c12 100644 --- a/src/USER-SMD/pair_smd_triangulated_surface.cpp +++ b/src/USER-SMD/pair_smd_triangulated_surface.cpp @@ -419,8 +419,7 @@ void PairTriSurf::init_style() { // old: half list int irequest = neighbor->request(this); - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->gran = 1; + neighbor->requests[irequest]->size = 1; // need a full neighbor list // int irequest = neighbor->request(this); diff --git a/src/USER-SMD/pair_smd_ulsph.cpp b/src/USER-SMD/pair_smd_ulsph.cpp index d048d0b8e7..b983620a02 100644 --- a/src/USER-SMD/pair_smd_ulsph.cpp +++ b/src/USER-SMD/pair_smd_ulsph.cpp @@ -1443,8 +1443,7 @@ void PairULSPH::init_style() { //printf(" in init style\n"); // request a granular neighbor list int irequest = neighbor->request(this); - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->gran = 1; + neighbor->requests[irequest]->size = 1; // set maxrad_dynamic and maxrad_frozen for each type // include future Fix pour particles as dynamic diff --git a/src/compute_contact_atom.cpp b/src/compute_contact_atom.cpp index c86829bc14..b2186bd175 100644 --- a/src/compute_contact_atom.cpp +++ b/src/compute_contact_atom.cpp @@ -72,8 +72,7 @@ void ComputeContactAtom::init() // need an occasional neighbor list int irequest = neighbor->request(this,instance_me); - neighbor->requests[irequest]->half = 0; - neighbor->requests[irequest]->gran = 1; + neighbor->requests[irequest]->size = 1; neighbor->requests[irequest]->pair = 0; neighbor->requests[irequest]->compute = 1; neighbor->requests[irequest]->occasional = 1; diff --git a/src/compute_rdf.cpp b/src/compute_rdf.cpp index 27fd09f5e0..fc6ad6d8b6 100644 --- a/src/compute_rdf.cpp +++ b/src/compute_rdf.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include "compute_rdf.h" #include "atom.h" #include "update.h" @@ -51,8 +52,32 @@ ComputeRDF::ComputeRDF(LAMMPS *lmp, int narg, char **arg) : nbin = force->inumeric(FLERR,arg[3]); if (nbin < 1) error->all(FLERR,"Illegal compute rdf command"); - if (narg == 4) npairs = 1; - else npairs = (narg-4)/2; + + // optional args + // nargpair = # of pairwise args, starting at iarg = 4 + + cutflag = 0; + + int iarg; + for (iarg = 4; iarg < narg; iarg++) + if (strcmp(arg[iarg],"cutoff") == 0) break; + + int nargpair = iarg - 4; + + while (iarg < narg) { + if (strcmp(arg[iarg],"cutoff") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal compute rdf command"); + cutoff_user = force->numeric(FLERR,arg[iarg+1]); + if (cutoff_user <= 0.0) cutflag = 0; + else cutflag = 1; + iarg += 2; + } else error->all(FLERR,"Illegal compute rdf command"); + } + + // pairwise args + + if (nargpair == 0) npairs = 1; + else npairs = nargpair/2; size_array_rows = nbin; size_array_cols = 1 + 2*npairs; @@ -65,15 +90,15 @@ ComputeRDF::ComputeRDF(LAMMPS *lmp, int narg, char **arg) : jlo = new int[npairs]; jhi = new int[npairs]; - if (narg == 4) { + if (nargpair == 0) { ilo[0] = 1; ihi[0] = ntypes; jlo[0] = 1; jhi[0] = ntypes; npairs = 1; } else { npairs = 0; - int iarg = 4; - while (iarg < narg) { + iarg = 4; + while (iarg < 4+nargpair) { force->bounds(FLERR,arg[iarg],atom->ntypes,ilo[npairs],ihi[npairs]); force->bounds(FLERR,arg[iarg+1],atom->ntypes,jlo[npairs],jhi[npairs]); if (ilo[npairs] > ihi[npairs] || jlo[npairs] > jhi[npairs]) @@ -127,8 +152,31 @@ void ComputeRDF::init() { int i,j,m; - if (force->pair) delr = force->pair->cutforce / nbin; - else error->all(FLERR,"Compute rdf requires a pair style be defined"); + if (!force->pair && !cutflag) + error->all(FLERR,"Compute rdf requires a pair style be defined " + "or cutoff specified"); + + if (cutflag) { + double skin = neighbor->skin; + mycutneigh = cutoff_user + skin; + + double cutghost; // as computed by Neighbor and Comm + if (force->pair) + cutghost = MAX(force->pair->cutforce+skin,comm->cutghostuser); + else + cutghost = comm->cutghostuser; + + if (mycutneigh > cutghost) + error->all(FLERR,"Compure rdf cutoff exceeds ghost atom range - " + "use comm_modify cutoff command"); + if (force->pair && mycutneigh < force->pair->cutforce + skin) + if (comm->me == 0) + error->warning(FLERR,"Compute rdf cutoff less than neighbor cutoff - " + "forcing a needless neighbor list build"); + + delr = cutoff_user / nbin; + } else delr = force->pair->cutforce / nbin; + delrinv = 1.0/delr; // set 1st column of output array to bin coords @@ -172,11 +220,21 @@ void ComputeRDF::init() delete [] scratch; // need an occasional half neighbor list + // if user specified, request a cutoff = cutoff_user + skin + // skin is included b/c Neighbor uses this value similar + // to its cutneighmax = force cutoff + skin + // also, this NeighList may be used by this compute for multiple steps + // (until next reneighbor), so it needs to contain atoms further + // than cutoff_user apart, just like a normal neighbor list does int irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->pair = 0; neighbor->requests[irequest]->compute = 1; neighbor->requests[irequest]->occasional = 1; + if (cutflag) { + neighbor->requests[irequest]->cut = 1; + neighbor->requests[irequest]->cutoff = mycutneigh; + } } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_rdf.h b/src/compute_rdf.h index 3f9fde7cad..61d99e0881 100644 --- a/src/compute_rdf.h +++ b/src/compute_rdf.h @@ -35,8 +35,11 @@ class ComputeRDF : public Compute { private: int nbin; // # of rdf bins + int cutflag; // user cutoff flag int npairs; // # of rdf pairs double delr,delrinv; // bin width and its inverse + double cutoff_user; // user-specified cutoff + double mycutneigh; // user-specified cutoff + neighbor skin int ***rdfpair; // map 2 type pair to rdf pair for each histo int **nrdfpair; // # of histograms for each type pair int *ilo,*ihi,*jlo,*jhi; diff --git a/src/finish.cpp b/src/finish.cpp index 015ac46cac..b81b5e6785 100644 --- a/src/finish.cpp +++ b/src/finish.cpp @@ -687,10 +687,7 @@ void Finish::end(int flag) // allow it to be Kokkos neigh list as well for (m = 0; m < neighbor->old_nrequest; m++) - if ((neighbor->old_requests[m]->half || - neighbor->old_requests[m]->gran || - neighbor->old_requests[m]->respaouter || - neighbor->old_requests[m]->half_from_full) && + if (neighbor->old_requests[m]->half && neighbor->old_requests[m]->skip == 0 && neighbor->lists[m] && neighbor->lists[m]->numneigh) break; diff --git a/src/fix_shear_history.cpp b/src/fix_shear_history.cpp index 379de9bcd3..e885392c41 100644 --- a/src/fix_shear_history.cpp +++ b/src/fix_shear_history.cpp @@ -206,8 +206,8 @@ void FixShearHistory::pre_exchange_onesided() ilist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; - firsttouch = list->listgranhistory->firstneigh; - firstshear = list->listgranhistory->firstdouble; + firsttouch = list->listhistory->firstneigh; + firstshear = list->listhistory->firstdouble; for (ii = 0; ii < inum; ii++) { i = ilist[ii]; @@ -302,8 +302,8 @@ void FixShearHistory::pre_exchange_newton() ilist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; - firsttouch = list->listgranhistory->firstneigh; - firstshear = list->listgranhistory->firstdouble; + firsttouch = list->listhistory->firstneigh; + firstshear = list->listhistory->firstdouble; for (ii = 0; ii < inum; ii++) { i = ilist[ii]; @@ -430,8 +430,8 @@ void FixShearHistory::pre_exchange_no_newton() ilist = list->ilist; numneigh = list->numneigh; firstneigh = list->firstneigh; - firsttouch = list->listgranhistory->firstneigh; - firstshear = list->listgranhistory->firstdouble; + firsttouch = list->listhistory->firstneigh; + firstshear = list->listhistory->firstdouble; for (ii = 0; ii < inum; ii++) { i = ilist[ii]; diff --git a/src/imbalance_neigh.cpp b/src/imbalance_neigh.cpp index 24a6be2698..9246e083c7 100644 --- a/src/imbalance_neigh.cpp +++ b/src/imbalance_neigh.cpp @@ -52,12 +52,10 @@ void ImbalanceNeigh::compute(double *weight) // find suitable neighbor list // can only use certain conventional neighbor lists - + // NOTE: why not full list, if half does not exist? + for (req = 0; req < neighbor->old_nrequest; ++req) { - if ((neighbor->old_requests[req]->half || - neighbor->old_requests[req]->gran || - neighbor->old_requests[req]->respaouter || - neighbor->old_requests[req]->half_from_full) && + if (neighbor->old_requests[req]->half && neighbor->old_requests[req]->skip == 0 && neighbor->lists[req] && neighbor->lists[req]->numneigh) break; } diff --git a/src/nbin.cpp b/src/nbin.cpp index aa7f6954d4..6aa37a4c43 100644 --- a/src/nbin.cpp +++ b/src/nbin.cpp @@ -13,6 +13,7 @@ #include "nbin.h" #include "neighbor.h" +#include "neigh_request.h" #include "domain.h" #include "update.h" #include "memory.h" @@ -43,6 +44,14 @@ NBin::~NBin() memory->destroy(bins); } +/* ---------------------------------------------------------------------- */ + +void NBin::post_constructor(NeighRequest *nrq) +{ + cutoff_custom = 0.0; + if (nrq->cut) cutoff_custom = nrq->cutoff; +} + /* ---------------------------------------------------------------------- copy needed info from Neighbor class ------------------------------------------------------------------------- */ @@ -56,6 +65,11 @@ void NBin::copy_neighbor_info() binsize_user = neighbor->binsize_user; bboxlo = neighbor->bboxlo; bboxhi = neighbor->bboxhi; + + // overwrite Neighbor cutoff with custom value set by requestor + // only works for style = BIN (checked by Neighbor class) + + if (cutoff_custom > 0.0) cutneighmax = cutoff_custom; } /* ---------------------------------------------------------------------- diff --git a/src/nbin.h b/src/nbin.h index 0599bd0a99..9871a229d8 100644 --- a/src/nbin.h +++ b/src/nbin.h @@ -34,9 +34,12 @@ class NBin : protected Pointers { int *binhead; // index of first atom in each bin int *bins; // index of next atom in same bin + double cutoff_custom; // cutoff set by requestor + NBin(class LAMMPS *); ~NBin(); - void copy_neighbor_info(); + void post_constructor(class NeighRequest *); + virtual void copy_neighbor_info(); virtual void bin_atoms_setup(int); bigint memory_usage(); diff --git a/src/neigh_list.cpp b/src/neigh_list.cpp index a66c85ba75..edc8634373 100644 --- a/src/neigh_list.cpp +++ b/src/neigh_list.cpp @@ -15,6 +15,7 @@ #include "atom.h" #include "comm.h" #include "update.h" +#include "pair.h" #include "neighbor.h" #include "neigh_request.h" #include "my_page.h" @@ -54,15 +55,18 @@ NeighList::NeighList(LAMMPS *lmp) : Pointers(lmp) iskip = NULL; ijskip = NULL; - listgranhistory = NULL; + listcopy = NULL; + listskip = NULL; + listfull = NULL; + + listhistory = NULL; fix_history = NULL; respamiddle = 0; listinner = NULL; listmiddle = NULL; - listfull = NULL; - listcopy = NULL; - listskip = NULL; + + fix_bond = NULL; ipage = NULL; dpage = NULL; @@ -103,14 +107,17 @@ NeighList::~NeighList() adjust settings to match corresponding NeighRequest cannot do this in constructor b/c not all NeighLists are allocated yet copy -> set listcopy for list to copy from - skip -> set listskip and create local copy of itype,ijtype - halffull -> preceeding list must be full - granhistory -> preceeding list must be gran, set its LGH and FH ptrs - respaouter -> preceeding list(s) must be inner or middle, set LM/LI ptrs + skip -> set listskip for list to skip from, create copy of itype,ijtype + halffull -> set listfull for full list to derive from + history -> set LH and FH ptrs in partner list that uses the history info + respaouter -> set listinner/listmiddle for other rRESPA lists + bond -> set fix_bond to Fix that made the request ------------------------------------------------------------------------- */ void NeighList::post_constructor(NeighRequest *nq) { + // copy request settings used by list itself + occasional = nq->occasional; ghost = nq->ghost; ssa = nq->ssa; @@ -118,10 +125,10 @@ void NeighList::post_constructor(NeighRequest *nq) dnum = nq->dnum; if (nq->copy) - listcopy = neighbor->lists[nq->otherlist]; + listcopy = neighbor->lists[nq->copylist]; if (nq->skip) { - listskip = neighbor->lists[nq->otherlist]; + listskip = neighbor->lists[nq->skiplist]; int ntypes = atom->ntypes; iskip = new int[ntypes+1]; memory->create(ijskip,ntypes+1,ntypes+1,"neigh_list:ijskip"); @@ -132,38 +139,28 @@ void NeighList::post_constructor(NeighRequest *nq) ijskip[i][j] = nq->ijskip[i][j]; } - if (nq->half_from_full) { - NeighRequest *oq = neighbor->requests[nq->index-1]; - if (oq->full != 1) - error->all(FLERR,"Neighbor half-from-full list does not follow " - "full list"); - listfull = neighbor->lists[nq->index-1]; - } + if (nq->halffull) + listfull = neighbor->lists[nq->halffulllist]; - if (nq->granhistory) { - NeighRequest *oq = neighbor->requests[nq->index-1]; - if (oq->gran != 1) - error->all(FLERR,"Neighbor granhistory list does not follow gran list"); - neighbor->lists[nq->index-1]->listgranhistory = this; - neighbor->lists[nq->index-1]->fix_history = nq->fix_history; + if (nq->history) { + neighbor->lists[nq->historylist]->listhistory = this; + int tmp; + neighbor->lists[nq->historylist]->fix_history = + (Fix *) ((Pair *) nq->requestor)->extract("history",tmp); } if (nq->respaouter) { - NeighRequest *oq = neighbor->requests[nq->index-1]; - if (oq->respainner) { + if (nq->respamiddlelist < 0) { respamiddle = 0; - listinner = neighbor->lists[nq->index-1]; - } else if (oq->respamiddle) { + listinner = neighbor->lists[nq->respainnerlist]; + } else { respamiddle = 1; - listmiddle = neighbor->lists[nq->index-1]; - oq = neighbor->requests[nq->index-2]; - if (!oq->respainner) - error->all(FLERR,"Neighbor respa outer list does not follow " - "respa list"); - listinner = neighbor->lists[nq->index-2]; - } else - error->all(FLERR,"Neighbor respa outer list does not follow respa list"); + listmiddle = neighbor->lists[nq->respamiddlelist]; + listinner = neighbor->lists[nq->respainnerlist]; + } } + + if (nq->bond) fix_bond = (Fix *) nq->requestor; } /* ---------------------------------------------------------------------- */ @@ -189,7 +186,7 @@ void NeighList::setup_pages(int pgsize_caller, int oneatom_caller) grow per-atom data to allow for nlocal/nall atoms for parent lists: also trigger grow in child list(s) which are not built themselves - gran calls grow() in granhistory + history calls grow() in listhistory respaouter calls grow() in respainner, respamiddle triggered by neighbor list build not called if a copy list @@ -199,7 +196,7 @@ void NeighList::grow(int nlocal, int nall) { // trigger grow() in children before possible return - if (listgranhistory) listgranhistory->grow(nlocal,nall); + if (listhistory) listhistory->grow(nlocal,nall); if (listinner) listinner->grow(nlocal,nall); if (listmiddle) listmiddle->grow(nlocal,nall); @@ -246,35 +243,37 @@ void NeighList::print_attributes() printf("Neighbor list/request %d:\n",index); printf(" %p = requestor ptr (instance %d id %d)\n", rq->requestor,rq->requestor_instance,rq->id); - printf(" %d = occasional\n",occasional); - printf(" %d = ghost flag\n",ghost); - printf(" %d = ssa flag\n",ssa); - printf(" %d = copy flag\n",copy); - printf(" %d = dnum\n",dnum); - printf("\n"); printf(" %d = pair\n",rq->pair); printf(" %d = fix\n",rq->fix); printf(" %d = compute\n",rq->compute); printf(" %d = command\n",rq->command); + printf(" %d = neigh\n",rq->neigh); printf("\n"); printf(" %d = half\n",rq->half); printf(" %d = full\n",rq->full); - printf(" %d = gran\n",rq->gran); - printf(" %d = granhistory\n",rq->granhistory); + printf("\n"); + printf(" %d = occasional\n",occasional); + printf(" %d = newton\n",rq->newton); + printf(" %d = ghost flag\n",ghost); + printf(" %d = size\n",rq->size); + printf(" %d = history\n",rq->history); + printf(" %d = granonesided\n",rq->granonesided); printf(" %d = respainner\n",rq->respainner); printf(" %d = respamiddle\n",rq->respamiddle); printf(" %d = respaouter\n",rq->respaouter); - printf(" %d = half_from_full\n",rq->half_from_full); - printf("\n"); - printf(" %d = newton\n",rq->newton); - printf(" %d = granonesided\n",rq->granonesided); + printf(" %d = bond\n",rq->bond); printf(" %d = omp\n",rq->omp); printf(" %d = intel\n",rq->intel); printf(" %d = kokkos host\n",rq->kokkos_host); printf(" %d = kokkos device\n",rq->kokkos_device); - printf(" %d = skip\n",rq->skip); - printf(" %d = otherlist\n",rq->otherlist); - printf(" %p = listskip\n",(void *)listskip); + printf(" %d = ssa flag\n",ssa); + printf(" %d = dnum\n",dnum); + printf("\n"); + printf(" %d = skip flag\n",rq->skip); + printf(" %d = off2on\n",rq->off2on); + printf(" %d = copy flag\n",rq->copy); + printf(" %d = half/full\n",rq->halffull); + printf(" %d = history/partner\n",rq->history_partner); printf("\n"); } diff --git a/src/neigh_list.h b/src/neigh_list.h index 3b6a4d6760..9a77a0311d 100644 --- a/src/neigh_list.h +++ b/src/neigh_list.h @@ -45,6 +45,7 @@ class NeighList : protected Pointers { int *numneigh; // # of J neighbors for each I atom int **firstneigh; // ptr to 1st J int value of each I atom double **firstdouble; // ptr to 1st J double value of each I atom + int maxatom; // size of allocated per-atom arrays int pgsize; // size of each page int oneatom; // max size for one atom @@ -59,15 +60,18 @@ class NeighList : protected Pointers { // settings and pointers for related neighbor lists and fixes - NeighList *listgranhistory; // point at list storing shear history - class FixShearHistory *fix_history; // fix that stores history info + NeighList *listcopy; // me = copy list, point to list I copy from + NeighList *listskip; // me = skip list, point to list I skip from + NeighList *listfull; // me = half list, point to full I derive from + + NeighList *listhistory; // list storing neigh history + class Fix *fix_history; // fix that stores history info int respamiddle; // 1 if this respaouter has middle list NeighList *listinner; // me = respaouter, point to respainner NeighList *listmiddle; // me = respaouter, point to respamiddle - NeighList *listfull; // me = half list, point to full I derive from - NeighList *listcopy; // me = copy list, point to list I copy from - NeighList *listskip; // me = skip list, point to list I skip from + + class Fix *fix_bond; // fix that stores bond info // Kokkos package @@ -88,9 +92,6 @@ class NeighList : protected Pointers { void print_attributes(); // debug routine int get_maxlocal() {return maxatom;} bigint memory_usage(); - - protected: - int maxatom; // size of allocated per-atom arrays }; } diff --git a/src/neigh_request.cpp b/src/neigh_request.cpp index bdcfa8c14d..5e77c23077 100644 --- a/src/neigh_request.cpp +++ b/src/neigh_request.cpp @@ -29,53 +29,74 @@ NeighRequest::NeighRequest(LAMMPS *lmp) : Pointers(lmp) // only one is set to 1 pair = 1; - fix = compute = command = 0; + fix = compute = command = neigh = 0; // kind of list: default is half neighbor list // only one is set to 1 half = 1; full = 0; - gran = granhistory = 0; + + // attribute flags, mutiple can be set to 1 + // default is every reneighboring, not occasional + // default is use newton_pair setting in force + // default is no neighbors of ghosts + // default is use cutoffs, not size of particles + // default is no additional neighbor history info + // default is no one-sided sphere/surface interactions (when size = 1) + // default is neighbors of atoms, not bonds + // default is no multilevel rRESPA neighbors + // default is no OpenMP multi-threaded neighbor list build + // default is no Intel-specific neighbor list build + // default is no Kokkos neighbor list build + // default is no Shardlow Splitting Algorithm (SSA) neighbor list build + // default is no storage of auxiliary floating point values + + occasional = 0; + newton = 0; + ghost = 0; + size = 0; + history = 0; + granonesided = 0; respainner = respamiddle = respaouter = 0; - half_from_full = 0; + bond = 0; + omp = 0; + intel = 0; + kokkos_host = kokkos_device = 0; + ssa = 0; + cut = 0; + cutoff = 0.0; + + dnum = 0; + + // skip info, default is no skipping + + skip = 0; + iskip = NULL; + ijskip = NULL; // only set when command = 1; command_style = NULL; - // combination of settings, mutiple can be set to 1 - // default is every reneighboring, not occasional - // default is use newton_pair setting in force - // default is no size history (when gran = 1) - // default is no one-sided sphere/surface interactions (when gran = 1) - // default is no auxiliary floating point values - // default is no neighbors of ghosts - // default is no multi-threaded neighbor list build - // default is no Kokkos neighbor list build - // default is no Shardlow Splitting Algorithm (SSA) neighbor list build - // default is neighbors of atoms, not bonds + // info set by Neighbor class when morphing original requests - occasional = 0; - newton = 0; - granonesided = 0; - dnum = 0; - ghost = 0; - omp = 0; - intel = 0; - kokkos_host = kokkos_device = 0; - ssa = 0; - bond = 0; - - // copy/skip/derive info, default is no copy or skip - // none or only one option is set - - copy = 0; - skip = 0; - iskip = NULL; - ijskip = NULL; + skiplist = -1; off2on = 0; - otherlist = -1; + copy = 0; + copylist = -1; + halffull = 0; + halffulllist = -1; + history_partner = 0; + historylist = -1; + respaouterlist = -1; + respamiddlelist = -1; + respainnerlist = -1; + unique = 0; + + // internal settings + + index_bin = index_stencil = index_pair = -1; } /* ---------------------------------------------------------------------- */ @@ -86,22 +107,10 @@ NeighRequest::~NeighRequest() memory->destroy(ijskip); } -/* ---------------------------------------------------------------------- - archive request params that Neighbor may change after call to identical() -------------------------------------------------------------------------- */ - -void NeighRequest::archive() -{ - half_original = half; - half_from_full_original = half_from_full; - copy_original = copy; - otherlist_original = otherlist; -} - /* ---------------------------------------------------------------------- compare this request to other request - identical means all params set by requestor are the same - compare to original values in other if Neighbor may have changed them + identical means requestor identity and all params it sets are the same + do not check other params that Neighbor can change after requests are made return 1 if identical, 0 if not ------------------------------------------------------------------------- */ @@ -109,136 +118,135 @@ int NeighRequest::identical(NeighRequest *other) { int same = 1; - // set same = 0 if old list was never processed - // use of requestor_instance and instance counter - // prevents an old fix from being unfix/refix in same memory location - // and appearing to be old, when it is really new - // only needed for classes with persistent neigh lists: Fix, Compute, Pair + // check for match of requestor_instance and instance counter + // prevents an old fix from being unfix/refix in same memory location + // stored in requestor, and thus appearing old, when really new + // only needed for classes with persistent neigh lists: Pair, Fix, Compute if (requestor != other->requestor) same = 0; if (requestor_instance != other->requestor_instance) same = 0; if (id != other->id) same = 0; + // only compare settings made by requestors + // not settings made later by Neighbor class + if (pair != other->pair) same = 0; if (fix != other->fix) same = 0; if (compute != other->compute) same = 0; if (command != other->command) same = 0; - - if (half != other->half_original) same = 0; - if (full != other->full) same = 0; - if (gran != other->gran) same = 0; - if (respainner != other->respainner) same = 0; - if (respamiddle != other->respamiddle) same = 0; - if (respaouter != other->respaouter) same = 0; - if (half_from_full != other->half_from_full_original) same = 0; - - if (newton != other->newton) same = 0; - if (occasional != other->occasional) same = 0; - if (granhistory != other->granhistory) same = 0; - if (granonesided != other->granonesided) same = 0; - if (dnum != other->dnum) same = 0; - if (ghost != other->ghost) same = 0; - if (omp != other->omp) same = 0; - if (intel != other->intel) same = 0; - if (kokkos_host != other->kokkos_host) same = 0; - if (kokkos_device != other->kokkos_device) same = 0; - if (ssa != other->ssa) same = 0; - if (bond != other->bond) same = 0; - - if (copy != other->copy_original) same = 0; - if (same_skip(other) == 0) same = 0; - if (otherlist != other->otherlist_original) same = 0; - - return same; -} - -/* ---------------------------------------------------------------------- - compare kind of this request to other request - return 1 if same, 0 if different -------------------------------------------------------------------------- */ - -int NeighRequest::same_kind(NeighRequest *other) -{ - int same = 1; - - // class caller will be same (pair), b/c called by pair hybrid styles - - // kind must be the the same + if (neigh != other->neigh) same = 0; if (half != other->half) same = 0; if (full != other->full) same = 0; - if (gran != other->gran) same = 0; - if (granhistory != other->granhistory) same = 0; + + if (occasional != other->occasional) same = 0; + if (newton != other->newton) same = 0; + if (ghost != other->ghost) same = 0; + if (size != other->size) same = 0; + if (history != other->history) same = 0; + if (granonesided != other->granonesided) same = 0; if (respainner != other->respainner) same = 0; if (respamiddle != other->respamiddle) same = 0; if (respaouter != other->respaouter) same = 0; - if (half_from_full != other->half_from_full) same = 0; - - // settings that must be the same - // other settings do not need to be the same (e.g. granonesided) - - if (newton != other->newton) same = 0; - if (ghost != other->ghost) same = 0; + if (bond != other->bond) same = 0; if (omp != other->omp) same = 0; if (intel != other->intel) same = 0; if (kokkos_host != other->kokkos_host) same = 0; if (kokkos_device != other->kokkos_device) same = 0; if (ssa != other->ssa) same = 0; - if (bond != other->bond) same = 0; + if (copy != other->copy) same = 0; + if (cutoff != other->cutoff) same = 0; - // copy/skip/derive info does not need to be the same + if (dnum != other->dnum) same = 0; + + if (skip != other->skip) same = 0; + if (skip) same = same_skip(other); return same; } /* ---------------------------------------------------------------------- - compare skip attributes of this request to other request - return 1 if same, 0 if different + compare same info for two requests that have skip = 1 + return 1 if identical, 0 if not ------------------------------------------------------------------------- */ int NeighRequest::same_skip(NeighRequest *other) { int i,j; + int ntypes = atom->ntypes; int same = 1; - if (skip != other->skip) same = 0; - if (skip && other->skip) { - int ntypes = atom->ntypes; - for (i = 1; i <= ntypes; i++) - if (iskip[i] != other->iskip[i]) same = 0; - for (i = 1; i <= ntypes; i++) - for (j = 1; j <= ntypes; j++) - if (ijskip[i][j] != other->ijskip[i][j]) same = 0; - } + for (i = 1; i <= ntypes; i++) + if (iskip[i] != other->iskip[i]) same = 0; + for (i = 1; i <= ntypes; i++) + for (j = 1; j <= ntypes; j++) + if (ijskip[i][j] != other->ijskip[i][j]) same = 0; return same; } /* ---------------------------------------------------------------------- - set kind and optional values in this request to those of other request - not copy/skip/derive values since this may be non-skip parent of child + set params in this request to those of other request + copy same fields that are checked in identical() + purpose is to allow comparison of new requests to old requests + skipflag = 1 to copy skip vector/array ------------------------------------------------------------------------- */ -void NeighRequest::copy_request(NeighRequest *other) +void NeighRequest::copy_request(NeighRequest *other, int skipflag) { + requestor = other->requestor; + requestor_instance = other->requestor_instance; + id = other->id; + + pair = other->pair; + fix = other->fix; + compute = other->compute; + command = other->command; + half = other->half; full = other->full; - gran = other->gran; - granhistory = other->granhistory; + + occasional = other->occasional; + newton = other->newton; + ghost = other->ghost; + size = other->size; + history = other->history; + granonesided = other->granonesided; respainner = other->respainner; respamiddle = other->respamiddle; respaouter = other->respaouter; - half_from_full = other->half_from_full; - - newton = other->newton; - granonesided = other->granonesided; - dnum = other->dnum; - ghost = other->ghost; + bond = other->bond; omp = other->omp; intel = other->intel; kokkos_host = other->kokkos_host; kokkos_device = other->kokkos_device; ssa = other->ssa; - bond = other->bond; + cut = other->cut; + cutoff = other->cutoff; + + dnum = other->dnum; + + iskip = other->iskip; + iskip = NULL; + ijskip = NULL; + + if (!skipflag) return; + + int i,j; + int ntypes = atom->ntypes; + + if (other->iskip) { + iskip = new int[ntypes+1]; + for (i = 1; i <= ntypes; i++) + iskip[i] = other->iskip[i]; + } + + if (other->ijskip) { + memory->create(ijskip,ntypes+1,ntypes+1,"neigh_request:ijskip"); + for (i = 1; i <= ntypes; i++) + for (j = 1; j <= ntypes; j++) + ijskip[i][j] = other->ijskip[i][j]; + } } + diff --git a/src/neigh_request.h b/src/neigh_request.h index 7accc6dcff..70f7783a70 100644 --- a/src/neigh_request.h +++ b/src/neigh_request.h @@ -26,105 +26,102 @@ class NeighRequest : protected Pointers { int id; // ID of request as stored by requestor // used to track multiple requests from one class - // which class style requests the list, one flag is 1, others are 0 + // ----------------------------- + // flags set by requesting class for attributes of neighor list they need + // all must be set appropriately, all have defaults + // ----------------------------- - int pair; // set by default + // which class style requests the list + // one flag is 1, others are 0 + + int pair; // pair is set by default int fix; int compute; int command; + int neigh; - // kind of list requested, one flag is 1, others are 0 - // NOTE: should make only the first 3 settings be unique, - // allow others as add-on flags - // this will require changed flags in pair requestors - // this will lead to simpler logic in Neighbor::choose_build() + // half/full setting, determines which neighbors appear in list + // one flag is 1, other is 0 - int half; // 1 if half neigh list (set by default) - int full; // 1 if full neigh list - int half_from_full; // 1 if half list computed from previous full list - int gran; // 1 if granular list - int granhistory; // 1 if history info for granular contact pairs + int half; // half neigh list (set by default) + int full; // full neigh list + + // attribute flags, all are 0 by default + + int occasional; // how often list is built + // 0 if needed every reneighboring during run + // 1 if only occasionally needed by a fix, compute, etc + + int newton; // which owned/ghost pairs appear in list + // 0 if use force::newton_pair setting + // 1 if override with pair newton on + // 2 if override with pair newton off + + int ghost; // 1 if includes ghost atom neighbors + int size; // 1 if pair cutoff set by particle radius + int history; // 1 if stores neighbor history info + int granonesided; // 1 if one-sided granular list for + // sphere/surf interactions int respainner; // 1 if a rRESPA inner list int respamiddle; // 1 if a rRESPA middle list int respaouter; // 1 if a rRESPA outer list + int bond; // 1 if store bond neighbors instead of atom neighs + int omp; // set by USER-OMP package + int intel; // set by USER-INTEL package + int kokkos_host; // set by KOKKOS package + int kokkos_device; + int ssa; // set by USER-DPD package, for Shardlow lists + int cut; // 1 if use a non-standard cutoff length + double cutoff; // special cutoff distance for this list + + int dnum; // # of extra floating point values stored in list + + // flags set by pair hybrid + + int skip; // 1 if this list skips atom types from another list + int *iskip; // iskip[i] if atoms of type I are not in list + int **ijskip; // ijskip[i][j] if pairs of type I,J are not in list // command_style only set if command = 1 // allows print_pair_info() to access command name const char *command_style; - // ----------------- - // optional settings, set by caller, all are 0 by default - // ----------------- + // ----------------------------- + // flags set by Neighbor class to morph original requests + // ----------------------------- - // 0 if needed every reneighboring during run - // 1 if occasionally needed by a fix, compute, etc - - int occasional; - - // 0 if use force::newton_pair setting - // 1 if override with pair newton on - // 2 if override with pair newton off - - int newton; - - // 1 if one-sided granular list for sphere/surf interactions (gran = 1) - - int granonesided; - - // number of auxiliary floating point values to store, 0 if none set - - int dnum; - - // 1 if also need neighbors of ghosts - - int ghost; - - // 1 if using multi-threaded neighbor list build for USER-OMP or USER-INTEL - - int omp; - int intel; - - // 1 if using Kokkos neighbor build - - int kokkos_host; - int kokkos_device; - - // 1 if using Shardlow Splitting Algorithm (SSA) neighbor list build - - int ssa; - - // 1 if bond neighbors, not atom neighbors - - int bond; - - // ----------------- - // end of optional settings - // ----------------- - - // set by pair_hybrid and neighbor after all requests are made - // these settings do not change kind value or optional settings - - int copy; // 1 if this list copied from another list - - int skip; // 1 if this list skips atom types from another list - int *iskip; // iskip[i] if atoms of type I are not in list - int **ijskip; // ijskip[i][j] if pairs of type I,J are not in list + int skiplist; // index of list to skip from int off2on; // 1 if this is newton on list, but skips from off list - int otherlist; // index of other list to copy or skip from + int copy; // 1 if this list copied from another list + int copylist; // index of list to copy from - // original params by requestor - // stored to compare against in identical() in case Neighbor changes them + int halffull; // 1 if half list computed from another full list + int halffulllist; // index of full list to derive half from - int half_original; - int half_from_full_original; - int copy_original; - int otherlist_original; + int history_partner; // 1 if this list partners with a history list + int historylist; // index of the associated history list + // for history = 1, index of the non-history partner - // pointer to FSH class, set by caller + int respaouterlist; // index of respaouter/middle/inner lists + int respamiddlelist; // which this rREPSA list is associated with + int respainnerlist; // each rRESPA style list points at the others - class FixShearHistory *fix_history; // fix that stores history info + int unique; // 1 if this list requires its own + // NStencil, Nbin class - because of requestor cutoff + + // pointer to FSH class, set by requestor class (not by Neighbor) + + class FixShearHistory *fix_history; // fix that stores per-atom history info + + // ----------------------------- + // internal settings made by Neighbor class + // ----------------------------- + + int index_bin; // index of NBin class assigned to this request + int index_stencil; // index of NStencil class assigned to this request + int index_pair; // index of NPair class assigned to this request // methods @@ -132,9 +129,8 @@ class NeighRequest : protected Pointers { ~NeighRequest(); void archive(); int identical(NeighRequest *); - int same_kind(NeighRequest *); int same_skip(NeighRequest *); - void copy_request(NeighRequest *); + void copy_request(NeighRequest *, int); }; } diff --git a/src/neighbor.cpp b/src/neighbor.cpp index 79958a29f4..e0b84cc410 100644 --- a/src/neighbor.cpp +++ b/src/neighbor.cpp @@ -197,9 +197,11 @@ Neighbor::~Neighbor() delete [] slist; delete [] plist; - for (int i = 0; i < nrequest; i++) delete requests[i]; + for (int i = 0; i < nlist; i++) + if (requests[i]) delete requests[i]; memory->sfree(requests); - for (int i = 0; i < old_nrequest; i++) delete old_requests[i]; + for (int i = 0; i < old_nrequest; i++) + if (old_requests[i]) delete old_requests[i]; memory->sfree(old_requests); delete [] zeroes; @@ -477,7 +479,7 @@ void Neighbor::init() if (firsttime) init_styles(); firsttime = 0; - init_pair(); + int same = init_pair(); // invoke copy_neighbor_info() in Bin,Stencil,Pair classes // copied once per run in case any cutoff, exclusion, special info changed @@ -488,7 +490,16 @@ void Neighbor::init() if (neigh_pair[i]) neigh_pair[i]->copy_neighbor_info(); if (!same && comm->me == 0) print_pairwise_info(); - requests_new2old(); + + // can now delete requests so next run can make new ones + // print_pairwise_info() made use of requests + // set of NeighLists now stores all needed info + + for (int i = 0; i < nrequest; i++) { + delete requests[i]; + requests[i] = NULL; + } + nrequest = 0; // ------------------------------------------------------------------ // create topology lists @@ -582,7 +593,7 @@ void Neighbor::init_styles() create and initialize NPair classes ------------------------------------------------------------------------- */ -void Neighbor::init_pair() +int Neighbor::init_pair() { int i,j,k,m; @@ -590,16 +601,21 @@ void Neighbor::init_pair() // no need to re-create if: // neigh style, triclinic, pgsize, oneatom have not changed // current requests = old requests - // first archive request params for current requests - // before possibly changing them below + // so just return: + // delete requests so next run can make new ones + // current set of NeighLists already stores all needed info + // requests are compared via identical() before: + // any requests are morphed using logic below + // any requests are added below, e.g. as parents of pair hybrid skip lists + // copy them via requests_new2old() BEFORE any changes made to requests + // necessary b/c morphs can change requestor settings (see comment below) - for (i = 0; i < nrequest; i++) requests[i]->archive(); - - same = 1; + int same = 1; if (style != old_style) same = 0; if (triclinic != old_triclinic) same = 0; if (pgsize != old_pgsize) same = 0; if (oneatom != old_oneatom) same = 0; + if (nrequest != old_nrequest) same = 0; else for (i = 0; i < nrequest; i++) @@ -609,9 +625,10 @@ void Neighbor::init_pair() if (comm->me == 0) printf("SAME flag %d\n",same); #endif - if (same) return; - - // delete old lists and create new ones + if (same) return same; + requests_new2old(); + + // delete old lists since creating new ones for (i = 0; i < nlist; i++) delete lists[i]; for (i = 0; i < nbin; i++) delete neigh_bin[i]; @@ -622,147 +639,69 @@ void Neighbor::init_pair() delete [] neigh_stencil; delete [] neigh_pair; + // morph requests in various ways + // purpose is to avoid duplicate or inefficient builds + // may add new requests if a needed request to derive from does not exist + // methods: + // (1) other = point history and rRESPA lists at their partner lists + // (2) skip = create any new non-skip lists needed by pair hybrid skip lists + // (3) granular = adjust parent and skip lists for granular onesided usage + // (4) h/f = pair up any matching half/full lists + // (5) copy = convert as many lists as possible to copy lists + // order of morph methods matters: + // (1) before (2), b/c (2) needs to know history partner pairings + // (2) after (1), b/c (2) may also need to create new history lists + // (3) after (2), b/c it adjusts lists created by (2) + // (4) after (2) and (3), + // b/c (2) may create new full lists, (3) may change them + // (5) last, after all lists are finalized, so all possible copies found + + int nrequest_original = nrequest; + + morph_other(); + morph_skip(); + morph_granular(); // this method can change flags set by requestor + morph_halffull(); + morph_copy(); + + // create new lists, one per request including added requests + // wait to allocate initial pages until copy lists are detected + // NOTE: can I allocation now, instead of down below? + nlist = nrequest; lists = new NeighList*[nrequest]; neigh_bin = new NBin*[nrequest]; neigh_stencil = new NStencil*[nrequest]; neigh_pair = new NPair*[nrequest]; - - // create individual lists, one per request + + // allocate new lists // pass list ptr back to requestor (except for Command class) - // wait to allocate initial pages until copy lists are detected - + // only for original requests, not ones added by Neighbor class + for (i = 0; i < nrequest; i++) { - if (requests[i]->kokkos_host || requests[i]->kokkos_device) + if (requests[i]->kokkos_host || requests[i]->kokkos_device) create_kokkos_list(i); - else - lists[i] = new NeighList(lmp); + else lists[i] = new NeighList(lmp); lists[i]->index = i; - if (requests[i]->pair) { + if (requests[i]->pair && i < nrequest_original) { Pair *pair = (Pair *) requests[i]->requestor; pair->init_list(requests[i]->id,lists[i]); - } else if (requests[i]->fix) { + } else if (requests[i]->fix && i < nrequest_original) { Fix *fix = (Fix *) requests[i]->requestor; fix->init_list(requests[i]->id,lists[i]); - } else if (requests[i]->compute) { + } else if (requests[i]->compute && i < nrequest_original) { Compute *compute = (Compute *) requests[i]->requestor; compute->init_list(requests[i]->id,lists[i]); } } - // morph requests via A,B,C rules - // this is to avoid duplicate or inefficient builds - // update both request and list when morph - - // (A) rule: // invoke post_constructor() for all lists - // processes copy,skip,half_from_full,granhistory,respaouter lists - // error checks and resets internal ptrs to other lists that now exist + // copies info from requests to lists, sets ptrs to related lists for (i = 0; i < nrequest; i++) lists[i]->post_constructor(requests[i]); - - // (B) rule: - // if request = pair, half, newton != 2 - // and full perpetual non-skip/copy list exists, - // then morph to half_from_full of matching parent list - // NOTE: should be OK if parent is skip list? - // see build method comments - // parent can be pair or fix, so long as perpetual fix - // NOTE: could remove newton != 2 restriction if added - // half_from_full_newtoff_ghost NPair class - // this would require full list having ghost info - // would be useful when reax/c used in hybrid mode, e.g. with airebo - - for (i = 0; i < nrequest; i++) { - if (requests[i]->pair && requests[i]->half && requests[i]->newton != 2) { - for (j = 0; j < nrequest; j++) { - // Kokkos doesn't yet support half from full - if (requests[i]->kokkos_device || requests[j]->kokkos_device) continue; - if (requests[i]->kokkos_host || requests[j]->kokkos_host) continue; - - if (requests[j]->full && requests[j]->occasional == 0 && - !requests[j]->skip && !requests[j]->copy) break; - } - if (j < nrequest) { - requests[i]->half = 0; - requests[i]->half_from_full = 1; - lists[i]->listfull = lists[j]; - } - } - } - - // (C) rule: - // for fix/compute requests to be copied: - // 1st check: - // occasional or not does not matter - // Kokkos host/device flags must match - // SSA flag must match - // newton setting must match (else list has different neighbors in it) - // 2nd check: - // if request = half and non-skip/copy pair half/respaouter request exists, - // or if request = full and non-skip/copy pair full request exists, - // or if request = gran and non-skip/copy pair gran request exists, - // then morph to copy of the matching parent list - // 3rd check: only if no match to 1st check - // if request = half and non-skip/copy pair full request exists, - // then morph to half_from_full of the matching parent list - // for 1st or 2nd check, parent can be copy list or pair or fix - - int inewton,jnewton; - - for (i = 0; i < nrequest; i++) { - if (!requests[i]->fix && !requests[i]->compute) continue; - for (j = 0; j < nrequest; j++) { - if (requests[i]->kokkos_device != requests[j]->kokkos_device) continue; - if (requests[i]->kokkos_host != requests[j]->kokkos_host) continue; - - if (requests[i]->ssa != requests[j]->ssa) continue; - - // IJ newton = 1 for newton on, 2 for newton off - inewton = requests[i]->newton; - if (inewton == 0) inewton = force->newton_pair ? 1 : 2; - jnewton = requests[j]->newton; - if (jnewton == 0) jnewton = force->newton_pair ? 1 : 2; - if (inewton != jnewton) continue; - - if (requests[i]->half && requests[j]->pair && - !requests[j]->skip && requests[j]->half && !requests[j]->copy) - break; - if (requests[i]->half && requests[j]->pair && - !requests[j]->skip && requests[j]->respaouter && !requests[j]->copy) - break; - if (requests[i]->full && requests[j]->pair && - !requests[j]->skip && requests[j]->full && !requests[j]->copy) - break; - if (requests[i]->gran && requests[j]->pair && - !requests[j]->skip && requests[j]->gran && !requests[j]->copy) - break; - } - if (j < nrequest) { - requests[i]->copy = 1; - requests[i]->otherlist = j; - lists[i]->copy = 1; - lists[i]->listcopy = lists[j]; - continue; - } - for (j = 0; j < nrequest; j++) { - // Kokkos doesn't yet support half from full - if (requests[i]->kokkos_device || requests[j]->kokkos_device) continue; - if (requests[i]->kokkos_host || requests[j]->kokkos_host) continue; - - if (requests[i]->half && requests[j]->pair && - !requests[j]->skip && requests[j]->full && !requests[j]->copy) - break; - } - if (j < nrequest) { - requests[i]->half = 0; - requests[i]->half_from_full = 1; - lists[i]->listfull = lists[j]; - } - } // assign Bin,Stencil,Pair style to each list @@ -785,77 +724,83 @@ void Neighbor::init_pair() } // instantiate unique Bin,Stencil classes in neigh_bin & neigh_stencil vecs - // instantiate one Pair class per list in neigh_pair vec + // unique = only one of its style, or request unique flag set (custom cutoff) nbin = 0; for (i = 0; i < nrequest; i++) { + requests[i]->index_bin = -1; flag = lists[i]->bin_method; if (flag == 0) continue; for (j = 0; j < nbin; j++) if (neigh_bin[j]->istyle == flag) break; - if (j < nbin) continue; + if (j < nbin && !requests[i]->unique) { + requests[i]->index_bin = j; + continue; + } + BinCreator bin_creator = binclass[flag-1]; neigh_bin[nbin] = bin_creator(lmp); + neigh_bin[nbin]->post_constructor(requests[i]); neigh_bin[nbin]->istyle = flag; + + requests[i]->index_bin = nbin; nbin++; } nstencil = 0; for (i = 0; i < nrequest; i++) { + requests[i]->index_stencil = -1; flag = lists[i]->stencil_method; if (flag == 0) continue; for (j = 0; j < nstencil; j++) if (neigh_stencil[j]->istyle == flag) break; - if (j < nstencil) continue; + if (j < nstencil && !requests[i]->unique) { + requests[i]->index_stencil = j; + continue; + } + StencilCreator stencil_creator = stencilclass[flag-1]; neigh_stencil[nstencil] = stencil_creator(lmp); + neigh_stencil[nstencil]->post_constructor(requests[i]); neigh_stencil[nstencil]->istyle = flag; - int bin_method = lists[i]->bin_method; - for (k = 0; k < nbin; k++) { - if (neigh_bin[k]->istyle == bin_method) { - neigh_stencil[nstencil]->nb = neigh_bin[k]; - break; - } + + if (lists[i]->bin_method > 0) { + neigh_stencil[nstencil]->nb = neigh_bin[requests[i]->index_bin]; + if (neigh_stencil[nstencil]->nb == NULL) + error->all(FLERR,"Could not assign bin method to neighbor stencil"); } - if (k == nbin) - error->all(FLERR,"Could not assign bin method to neighbor stencil"); + + requests[i]->index_stencil = nstencil; nstencil++; } + // instantiate one Pair class per list in neigh_pair vec + for (i = 0; i < nrequest; i++) { + requests[i]->index_pair = -1; flag = lists[i]->pair_method; if (flag == 0) { neigh_pair[i] = NULL; continue; } + PairCreator pair_creator = pairclass[flag-1]; neigh_pair[i] = pair_creator(lmp); + neigh_pair[i]->post_constructor(requests[i]); neigh_pair[i]->istyle = flag; - int bin_method = lists[i]->bin_method; - if (bin_method == 0) neigh_pair[i]->nb = NULL; - else { - for (k = 0; k < nbin; k++) { - if (neigh_bin[k]->istyle == bin_method) { - neigh_pair[i]->nb = neigh_bin[k]; - break; - } - } - if (k == nbin) + if (lists[i]->bin_method > 0) { + neigh_pair[i]->nb = neigh_bin[requests[i]->index_bin]; + if (neigh_pair[i]->nb == NULL) error->all(FLERR,"Could not assign bin method to neighbor pair"); } - int stencil_method = lists[i]->stencil_method; - if (stencil_method == 0) neigh_pair[i]->ns = NULL; - else { - for (k = 0; k < nstencil; k++) { - if (neigh_stencil[k]->istyle == stencil_method) { - neigh_pair[i]->ns = neigh_stencil[k]; - break; - } - } - if (k == nstencil) + if (lists[i]->stencil_method > 0) { + neigh_pair[i]->ns = neigh_stencil[requests[i]->index_stencil]; + if (neigh_pair[i]->ns == NULL) error->all(FLERR,"Could not assign stencil method to neighbor pair"); } + + requests[i]->index_pair = i; } // allocate initial pages for each list, except if copy flag set @@ -949,6 +894,393 @@ void Neighbor::init_pair() #ifdef NEIGH_LIST_DEBUG for (i = 0; i < nrequest; i++) lists[i]->print_attributes(); #endif + + return same; +} + +/* ---------------------------------------------------------------------- + scan NeighRequests to set additional flags + only for history, respaouter, custom cutoff lists +------------------------------------------------------------------------- */ + +void Neighbor::morph_other() +{ + NeighRequest *irq; + + for (int i = 0; i < nrequest; i++) { + irq = requests[i]; + + // if history, point this list and partner list at each other + + if (irq->history) { + irq->historylist = i-1; + requests[i-1]->history_partner = 1; + requests[i-1]->historylist = i; + } + + // if respaouter, point all asociated rRESPA lists at each other + + if (irq->respaouter) { + if (requests[i-1]->respainner) { + irq->respainnerlist = i-1; + requests[i-1]->respaouterlist = i; + } else { + irq->respamiddlelist = i-1; + requests[i-1]->respaouterlist = i; + requests[i-1]->respainnerlist = i-1; + irq->respainnerlist = i-2; + requests[i-2]->respaouterlist = i; + requests[i-2]->respamiddlelist = i-1; + } + } + + // if cut flag set by requestor, set unique flag + // this forces Pair,Stencil,Bin styles to be instantiated separately + + if (irq->cut) irq->unique = 1; + } +} + +/* ---------------------------------------------------------------------- + scan NeighRequests to process all skip lists + look for a matching non-skip list + if one exists, point at it via skiplist + else make new parent via copy_request() and point at it +------------------------------------------------------------------------- */ + +void Neighbor::morph_skip() +{ + int i,j,inewton,jnewton; + NeighRequest *irq,*jrq,*nrq; + + for (int i = 0; i < nrequest; i++) { + irq = requests[i]; + + // only processing skip lists + + if (!irq->skip) continue; + + // these lists are created other ways, no need for skipping + // halffull list and its full parent may both skip, + // but are checked to insure matching skip info + + if (irq->history) continue; + if (irq->respainner || irq->respamiddle) continue; + if (irq->halffull) continue; + if (irq->copy) continue; + + // check all other lists + + for (j = 0; j < nrequest; j++) { + if (i == j) continue; + jrq = requests[j]; + + // can only skip from a perpetual non-skip list + + if (jrq->occasional) continue; + if (jrq->skip) continue; + + // both lists must be half, or both full + + if (irq->half != jrq->half) continue; + if (irq->full != jrq->full) continue; + + // both lists must be newton on, or both newton off + // IJ newton = 1 for newton on, 2 for newton off + + inewton = irq->newton; + if (inewton == 0) inewton = force->newton_pair ? 1 : 2; + jnewton = jrq->newton; + if (jnewton == 0) jnewton = force->newton_pair ? 1 : 2; + if (inewton != jnewton) continue; + + // these flags must be same, + // else 2 lists do not store same pairs + // or their data structures are different + // this includes custom cutoff set by requestor + // no need to check respaouter b/c it stores same pairs + // no need to check dnum b/c only set for history + // NOTE: need check for 2 Kokkos flags? + + if (irq->ghost != jrq->ghost) continue; + if (irq->size != jrq->size) continue; + if (irq->bond != jrq->bond) continue; + if (irq->omp != jrq->omp) continue; + if (irq->intel != jrq->intel) continue; + if (irq->kokkos_host != jrq->kokkos_host) continue; + if (irq->kokkos_device != jrq->kokkos_device) continue; + if (irq->ssa != jrq->ssa) continue; + if (irq->cut != jrq->cut) continue; + if (irq->cutoff != jrq->cutoff) continue; + + // 2 lists are a match + + break; + } + + // if matching list exists, point to it + // else create a new identical list except non-skip + // for new list, set neigh = 1, skip = 0, no skip vec/array, + // copy unique flag (since copy_request() will not do it) + // note: parents of skip lists do not have associated history list + // b/c child skip lists store their own history info + + if (j < nrequest) irq->skiplist = j; + else { + int newrequest = request(this,-1); + irq->skiplist = newrequest; + + nrq = requests[newrequest]; + nrq->copy_request(irq,0); + nrq->pair = nrq->fix = nrq->compute = nrq->command = 0; + nrq->neigh = 1; + nrq->skip = 0; + if (irq->unique) nrq->unique = 1; + } + } +} + +/* ---------------------------------------------------------------------- + scan NeighRequests just added by morph_skip for hybrid granular + adjust newton/oneside parent settings if children require onesided skipping + also set children off2on flag if parent becomes a newton off list + this is needed because line/gran and tri/gran pair styles + require onesided neigh lists and system newton on, + but parent list must be newton off to enable the onesided skipping +------------------------------------------------------------------------- */ + +void Neighbor::morph_granular() +{ + int i,j; + NeighRequest *irq,*jrq,*nrq; + + for (i = 0; i < nrequest; i++) { + irq = requests[i]; + + // only examine NeighRequests added by morph_skip() + // only those with size attribute for granular systems + + if (!irq->neigh) continue; + if (!irq->size) continue; + + // check children of this list + + int onesided = -1; + for (j = 0; j < nrequest; j++) { + jrq = requests[j]; + + // only consider JRQ pair, size lists that skip from Irq list + + if (!jrq->pair) continue; + if (!jrq->size) continue; + if (!jrq->skip || jrq->skiplist != i) continue; + + // onesided = -1 if no children + // onesided = 0/1 = child granonesided value if same for all children + // onesided = 2 if children have different granonesided values + + if (onesided < 0) onesided = jrq->granonesided; + else if (onesided != jrq->granonesided) onesided = 2; + if (onesided == 2) break; + } + + + // if onesided = 2, parent has children with both granonesided = 0/1 + // force parent newton off (newton = 2) to enable onesided skip by child + // set parent granonesided = 0, so it stores all neighs in usual manner + // set off2on = 1 for all children, since they expect newton on lists + // this is b/c granonesided only set by line/gran and tri/gran which + // both require system newton on + + if (onesided == 2) { + irq->newton = 2; + irq->granonesided = 0; + + for (j = 0; j < nrequest; j++) { + jrq = requests[j]; + + // only consider JRQ pair, size lists that skip from Irq list + + if (!jrq->pair) continue; + if (!jrq->size) continue; + if (!jrq->skip || jrq->skiplist != i) continue; + + jrq->off2on = 1; + } + } + } +} + +/* ---------------------------------------------------------------------- + scan NeighRequests for possible half lists to derive from full lists + if 2 requests match, set half list to derive from full list +------------------------------------------------------------------------- */ + +void Neighbor::morph_halffull() +{ + int i,j; + NeighRequest *irq,*jrq; + + for (i = 0; i < nrequest; i++) { + irq = requests[i]; + + // only processing half lists + + if (!irq->half) continue; + + // these lists are created other ways, no need for halffull + // do want to process skip lists + + if (irq->history) continue; + if (irq->respainner || irq->respamiddle) continue; + if (irq->copy) continue; + + // check all other lists + + for (j = 0; j < nrequest; j++) { + if (i == j) continue; + jrq = requests[j]; + + // can only derive from a perpetual full list + // newton setting of derived list does not matter + + if (jrq->occasional) continue; + if (!jrq->full) continue; + + // these flags must be same, + // else 2 lists do not store same pairs + // or their data structures are different + // this includes custom cutoff set by requestor + // no need to check respaouter b/c it stores same pairs + // no need to check dnum b/c only set for history + // NOTE: need check for 2 Kokkos flags? + // Kokkos doesn't yet support half from full? + + if (irq->ghost != jrq->ghost) continue; + if (irq->size != jrq->size) continue; + if (irq->bond != jrq->bond) continue; + if (irq->omp != jrq->omp) continue; + if (irq->intel != jrq->intel) continue; + if (irq->kokkos_host != jrq->kokkos_host) continue; + if (irq->kokkos_device != jrq->kokkos_device) continue; + if (irq->ssa != jrq->ssa) continue; + if (irq->cut != jrq->cut) continue; + if (irq->cutoff != jrq->cutoff) continue; + + // skip flag must be same + // if both are skip lists, skip info must match + + if (irq->skip != jrq->skip) continue; + if (irq->skip && irq->same_skip(jrq) == 0) continue; + + // 2 lists are a match + + break; + } + + // if matching list exists, point to it + + if (j < nrequest) { + irq->halffull = 1; + irq->halffulllist = j; + } + } +} + +/* ---------------------------------------------------------------------- + scan NeighRequests for possible copies + if 2 requests match, turn one into a copy of the other +------------------------------------------------------------------------- */ + +void Neighbor::morph_copy() +{ + int i,j,inewton,jnewton; + NeighRequest *irq,*jrq; + + for (i = 0; i < nrequest; i++) { + irq = requests[i]; + + // this list is already a copy list due to another morph method + + if (irq->copy) continue; + + // these lists are created other ways, no need to copy + // skip lists are eligible to become a copy list + + if (irq->history) continue; + if (irq->respainner || irq->respamiddle) continue; + + // check all other lists + + for (j = 0; j < i; j++) { + if (i == j) continue; + jrq = requests[j]; + + // other list is already copied from this one + + if (jrq->copy && jrq->copylist == i) continue; + + // parent list must be perpetual + // copied list can be perpetual or occasional + + if (jrq->occasional) continue; + + // both lists must be half, or both full + + if (irq->half != jrq->half) continue; + if (irq->full != jrq->full) continue; + + // both lists must be newton on, or both newton off + // IJ newton = 1 for newton on, 2 for newton off + + inewton = irq->newton; + if (inewton == 0) inewton = force->newton_pair ? 1 : 2; + jnewton = jrq->newton; + if (jnewton == 0) jnewton = force->newton_pair ? 1 : 2; + if (inewton != jnewton) continue; + + // ok for non-ghost list to copy from ghost list, but not vice versa + + if (irq->ghost && !jrq->ghost) continue; + + // these flags must be same, + // else 2 lists do not store same pairs + // or their data structures are different + // this includes custom cutoff set by requestor + // no need to check respaouter b/c it stores same pairs + // no need to check omp b/c it stores same pairs + // no need to check dnum b/c only set for history + // NOTE: need check for 2 Kokkos flags? + + if (irq->size != jrq->size) continue; + if (irq->bond != jrq->bond) continue; + if (irq->intel != jrq->intel) continue; + if (irq->kokkos_host != jrq->kokkos_host) continue; + if (irq->kokkos_device != jrq->kokkos_device) continue; + if (irq->ssa != jrq->ssa) continue; + if (irq->cut != jrq->cut) continue; + if (irq->cutoff != jrq->cutoff) continue; + + // skip flag must be same + // if both are skip lists, skip info must match + + if (irq->skip != jrq->skip) continue; + if (irq->skip && irq->same_skip(jrq) == 0) continue; + + // 2 lists are a match + + break; + } + + // turn list I into a copy of list J + // do not copy a list from another copy list, but from its parent list + + if (j < i) { + irq->copy = 1; + if (jrq->copy) irq->copylist = jrq->copylist; + else irq->copylist = j; + } + } } /* ---------------------------------------------------------------------- @@ -1102,7 +1434,7 @@ void Neighbor::print_pairwise_info() { int i,m; char str[128]; - const char *kind; + NeighRequest *rq; FILE *out; const double cutghost = MAX(cutneighmax,comm->cutghostuser); @@ -1145,55 +1477,81 @@ void Neighbor::print_pairwise_info() fprintf(out," %d neighbor lists, " "perpetual/occasional/extra = %d %d %d\n", nlist,nperpetual,noccasional,nextra); - + for (i = 0; i < nlist; i++) { - if (requests[i]->pair) { - char *pname = force->pair_match_ptr((Pair *) requests[i]->requestor); + rq = requests[i]; + if (rq->pair) { + char *pname = force->pair_match_ptr((Pair *) rq->requestor); sprintf(str," (%d) pair %s",i+1,pname); - } else if (requests[i]->fix) { - sprintf(str," (%d) fix %s",i+1, - ((Fix *) requests[i]->requestor)->style); - } else if (requests[i]->compute) { + } else if (rq->fix) { + sprintf(str," (%d) fix %s",i+1,((Fix *) rq->requestor)->style); + } else if (rq->compute) { sprintf(str," (%d) compute %s",i+1, - ((Compute *) requests[i]->requestor)->style); - } else { - sprintf(str," (%d) command %s",i+1,requests[i]->command_style); + ((Compute *) rq->requestor)->style); + } else if (rq->command) { + sprintf(str," (%d) command %s",i+1,rq->command_style); + } else if (rq->neigh) { + sprintf(str," (%d) neighbor class addition",i+1); } fprintf(out,"%s",str); - if (requests[i]->half) kind = "half"; - else if (requests[i]->full) kind = "full"; - else if (requests[i]->gran) kind = "size"; - else if (requests[i]->granhistory) kind = "size/history"; - else if (requests[i]->respainner) kind = "respa/inner"; - else if (requests[i]->respamiddle) kind = "respa/middle"; - else if (requests[i]->respaouter) kind = "respa/outer"; - else if (requests[i]->half_from_full) kind = "half/from/full"; - if (requests[i]->occasional) fprintf(out,", %s, occasional",kind); - else fprintf(out,", %s, perpetual",kind); - if (requests[i]->ghost) fprintf(out,", ghost"); - if (requests[i]->ssa) fprintf(out,", ssa"); - if (requests[i]->omp) fprintf(out,", omp"); - if (requests[i]->intel) fprintf(out,", intel"); - if (requests[i]->kokkos_device) fprintf(out,", kokkos_device"); - if (requests[i]->kokkos_host) fprintf(out,", kokkos_host"); - if (requests[i]->copy) - fprintf(out,", copy from (%d)",requests[i]->otherlist+1); - if (requests[i]->skip) - fprintf(out,", skip from (%d)",requests[i]->otherlist+1); - if (requests[i]->off2on) fprintf(out,", off2on"); + if (rq->occasional) fprintf(out,", occasional"); + else fprintf(out,", perpetual"); + + // order these to get single output of most relevant + + if (rq->history) + fprintf(out,", history for (%d)",rq->historylist+1); + else if (rq->copy) + fprintf(out,", copy from (%d)",rq->copylist+1); + else if (rq->halffull) + fprintf(out,", half/full from (%d)",rq->halffulllist+1); + else if (rq->skip) + fprintf(out,", skip from (%d)",rq->skiplist+1); + fprintf(out,"\n"); + + // list of neigh list attributes + + fprintf(out," attributes: "); + if (rq->half) fprintf(out,"half"); + else if (rq->full) fprintf(out,"full"); + + if (rq->newton == 0) { + if (force->newton_pair) fprintf(out,", newton on"); + else fprintf(out,", newton off"); + } else if (rq->newton == 1) fprintf(out,", newton on"); + else if (rq->newton == 2) fprintf(out,", newton off"); + + if (rq->ghost) fprintf(out,", ghost"); + if (rq->size) fprintf(out,", size"); + if (rq->history) fprintf(out,", history"); + if (rq->granonesided) fprintf(out,", onesided"); + if (rq->respainner) fprintf(out,", respa outer"); + if (rq->respamiddle) fprintf(out,", respa middle"); + if (rq->respaouter) fprintf(out,", respa inner"); + if (rq->bond) fprintf(out,", bond"); + if (rq->omp) fprintf(out,", omp"); + if (rq->intel) fprintf(out,", intel"); + if (rq->kokkos_device) fprintf(out,", kokkos_device"); + if (rq->kokkos_host) fprintf(out,", kokkos_host"); + if (rq->ssa) fprintf(out,", ssa"); + if (rq->cut) fprintf(out,", cut %g",rq->cutoff); + if (rq->off2on) fprintf(out,", off2on"); + fprintf(out,"\n"); + + fprintf(out," "); + if (lists[i]->pair_method == 0) fprintf(out,"pair build: none\n"); + else fprintf(out,"pair build: %s\n",pairnames[lists[i]->pair_method-1]); - if (lists[i]->pair_method == 0) fprintf(out," pair build: none\n"); - else fprintf(out," pair build: %s\n", - pairnames[lists[i]->pair_method-1]); - - if (lists[i]->stencil_method == 0) fprintf(out," stencil: none\n"); - else fprintf(out," stencil: %s\n", + fprintf(out," "); + if (lists[i]->stencil_method == 0) fprintf(out,"stencil: none\n"); + else fprintf(out,"stencil: %s\n", stencilnames[lists[i]->stencil_method-1]); - if (lists[i]->bin_method == 0) fprintf(out," bin: none\n"); - else fprintf(out," bin: %s\n",binnames[lists[i]->bin_method-1]); + fprintf(out," "); + if (lists[i]->bin_method == 0) fprintf(out,"bin: none\n"); + else fprintf(out,"bin: %s\n",binnames[lists[i]->bin_method-1]); } /* @@ -1211,8 +1569,8 @@ void Neighbor::print_pairwise_info() } /* ---------------------------------------------------------------------- - delete old NeighRequests - copy current requests and params to old for next run + make copy of current requests and Neighbor params + used to compare to when next run occurs ------------------------------------------------------------------------- */ void Neighbor::requests_new2old() @@ -1221,9 +1579,15 @@ void Neighbor::requests_new2old() memory->sfree(old_requests); old_nrequest = nrequest; - old_requests = requests; - nrequest = maxrequest = 0; - requests = NULL; + old_requests = (NeighRequest **) + memory->smalloc(old_nrequest*sizeof(NeighRequest *), + "neighbor:old_requests"); + + for (int i = 0; i < old_nrequest; i++) { + old_requests[i] = new NeighRequest(lmp); + old_requests[i]->copy_request(requests[i],1); + } + old_style = style; old_triclinic = triclinic; old_pgsize = pgsize; @@ -1244,36 +1608,25 @@ int Neighbor::choose_bin(NeighRequest *rq) // no binning needed if (style == NSQ) return 0; - if (rq->skip || rq->copy || rq->half_from_full) return 0; - if (rq->granhistory) return 0; + if (rq->skip || rq->copy || rq->halffull) return 0; + if (rq->history) return 0; if (rq->respainner || rq->respamiddle) return 0; - // flags for settings the request + system requires of NBin class - // ssaflag = no/yes ssa request - // intelflag = no/yes intel request - // kokkos_device_flag = no/yes kokkos device request - // kokkos_host_flag = no/yes kokkos host request - - int ssaflag,intelflag,kokkos_device_flag,kokkos_host_flag; - - ssaflag = intelflag = kokkos_device_flag = kokkos_host_flag = 0; - - if (rq->ssa) ssaflag = NB_SSA; - if (rq->intel) intelflag = NB_INTEL; - if (rq->kokkos_device) kokkos_device_flag = NB_KOKKOS_DEVICE; - if (rq->kokkos_host) kokkos_host_flag = NB_KOKKOS_HOST; - - // use flags to match exactly one of NBin class masks, bit by bit + // use request settings to match exactly one NBin class mask + // checks are bitwise using NeighConst bit masks int mask; for (int i = 0; i < nbclass; i++) { mask = binmasks[i]; - if (ssaflag != (mask & NB_SSA)) continue; - if (intelflag != (mask & NB_INTEL)) continue; - if (kokkos_device_flag != (mask & NB_KOKKOS_DEVICE)) continue; - if (kokkos_host_flag != (mask & NB_KOKKOS_HOST)) continue; + // require match of these request flags and mask bits + // (!A != !B) is effectively a logical xor + + if (!rq->intel != !(mask & NB_INTEL)) continue; + if (!rq->ssa != !(mask & NB_SSA)) continue; + if (!rq->kokkos_device != !(mask & NB_KOKKOS_DEVICE)) continue; + if (!rq->kokkos_host != !(mask & NB_KOKKOS_HOST)) continue; return i+1; } @@ -1297,30 +1650,11 @@ int Neighbor::choose_stencil(NeighRequest *rq) // no stencil creation needed if (style == NSQ) return 0; - if (rq->skip || rq->copy || rq->half_from_full) return 0; - if (rq->granhistory) return 0; + if (rq->skip || rq->copy || rq->halffull) return 0; + if (rq->history) return 0; if (rq->respainner || rq->respamiddle) return 0; - // flags for settings the request + system requires of NStencil class - // halfflag = half request (gran and respa are also half lists) - // fullflag = full request - // ghostflag = no/yes ghost request - // ssaflag = no/yes ssa request - // dimension = 2d/3d - // newtflag = newton off/on request - // triclinic = orthgonal/triclinic box - - int halfflag,fullflag,ghostflag,ssaflag; - - halfflag = fullflag = ghostflag = ssaflag = 0; - - if (rq->half) halfflag = 1; - if (rq->full) fullflag = 1; - if (rq->gran) halfflag = 1; - if (rq->respaouter) halfflag = 1; - - if (rq->ghost) ghostflag = NS_GHOST; - if (rq->ssa) ssaflag = NS_SSA; + // convert newton request to newtflag = on or off int newtflag; if (rq->newton == 0 && newton_pair) newtflag = 1; @@ -1328,34 +1662,68 @@ int Neighbor::choose_stencil(NeighRequest *rq) else if (rq->newton == 1) newtflag = 1; else if (rq->newton == 2) newtflag = 0; - // use flags to match exactly one of NStencil class masks, bit by bit - // exactly one of halfflag,fullflag is set and thus must match + + //printf("STENCIL RQ FLAGS: hff %d %d n %d g %d s %d newtflag %d\n", + // rq->half,rq->full,rq->newton,rq->ghost,rq->ssa, + // newtflag); + + // use request and system settings to match exactly one NStencil class mask + // checks are bitwise using NeighConst bit masks int mask; for (int i = 0; i < nsclass; i++) { mask = stencilmasks[i]; - if (halfflag) { + //printf("III %d: half %d full %d newton %d newtoff %d ghost %d ssa %d\n", + // i,mask & NS_HALF,mask & NS_FULL,mask & NS_NEWTON, + // mask & NS_NEWTOFF,mask & NS_GHOST,mask & NS_SSA); + + // exactly one of half or full is set and must match + + if (rq->half) { if (!(mask & NS_HALF)) continue; - } else if (fullflag) { + } else if (rq->full) { if (!(mask & NS_FULL)) continue; } - if (ghostflag != (mask & NS_GHOST)) continue; - if (ssaflag != (mask & NS_SSA)) continue; + // newtflag is on or off and must match - if (style == BIN && !(mask & NS_BIN)) continue; - if (style == MULTI && !(mask & NS_MULTI)) continue; + if (newtflag) { + if (!(mask & NS_NEWTON)) continue; + } else if (!newtflag) { + if (!(mask & NS_NEWTOFF)) continue; + } - if (dimension == 2 && !(mask & NS_2D)) continue; - if (dimension == 3 && !(mask & NS_3D)) continue; + // require match of these request flags and mask bits + // (!A != !B) is effectively a logical xor - if (newtflag && !(mask & NS_NEWTON)) continue; - if (!newtflag && !(mask & NS_NEWTOFF)) continue; + if (!rq->ghost != !(mask & NS_GHOST)) continue; + if (!rq->ssa != !(mask & NS_SSA)) continue; - if (!triclinic && !(mask & NS_ORTHO)) continue; - if (triclinic && !(mask & NS_TRI)) continue; + // neighbor style is BIN or MULTI and must match + + if (style == BIN) { + if (!(mask & NS_BIN)) continue; + } else if (style == MULTI) { + if (!(mask & NS_MULTI)) continue; + } + + // dimension is 2 or 3 and must match + + if (dimension == 2) { + if (!(mask & NS_2D)) continue; + } else if (dimension == 3) { + if (!(mask & NS_3D)) continue; + } + + // domain triclinic flag is on or off and must match + + if (triclinic) { + if (!(mask & NS_TRI)) continue; + } else if (!triclinic) { + if (!(mask & NS_ORTHO)) continue; + } return i+1; } @@ -1376,78 +1744,17 @@ int Neighbor::choose_stencil(NeighRequest *rq) int Neighbor::choose_pair(NeighRequest *rq) { - // no NPair build performed + // no neighbor list build performed - if (rq->granhistory) return 0; + if (rq->history) return 0; if (rq->respainner || rq->respamiddle) return 0; // error check for includegroup with ghost neighbor request if (includegroup && rq->ghost) - error->all(FLERR,"Neighbor include group not allowed " - "with ghost neighbors"); + error->all(FLERR,"Neighbor include group not allowed with ghost neighbors"); - // flags for settings the request + system requires of NPair class - // some are set to 0/1, others are set to mask bit - // comparisons below in loop over classes reflect that - // copyflag = no/yes copy request - // skipflag = no/yes skip request - // halfflag = half request (gran and respa are also half lists) - // fullflag = full request - // halffullflag = half_from_full request - // sizeflag = no/yes gran request for finite-size particles - // ghostflag = no/yes ghost request - // respaflag = no/yes respa request - // off2onflag = no/yes off2on request - // onesideflag = no/yes granonesided request - // ssaflag = no/yes request - // ompflag = no/yes omp request - // intelflag = no/yes intel request - // kokkos_device_flag = no/yes Kokkos device request - // kokkos_host_flag = no/yes Kokkos host request - // newtflag = newton off/on request - // style = NSQ/BIN/MULTI neighbor style - // triclinic = orthgonal/triclinic box - - int copyflag,skipflag,halfflag,fullflag,halffullflag,sizeflag,respaflag, - ghostflag,off2onflag,onesideflag,ssaflag,ompflag,intelflag, - kokkos_device_flag,kokkos_host_flag,bondflag; - - copyflag = skipflag = halfflag = fullflag = halffullflag = sizeflag = - ghostflag = respaflag = off2onflag = onesideflag = ssaflag = - ompflag = intelflag = kokkos_device_flag = kokkos_host_flag = bondflag = 0; - - if (rq->copy) copyflag = NP_COPY; - if (rq->skip) skipflag = NP_SKIP; - - // NOTE: exactly one of these request flags is set (see neigh_request.h) - // this requires gran/respaouter also set halfflag - // can simplify this logic, if follow NOTE in neigh_request.h - // why do size/off2on and size/off2on/oneside set NP_HALF - // either should set both half & full, or half should be in file name - // to be consistent with how other NP classes use "half" - - if (rq->half) halfflag = 1; - if (rq->full) fullflag = 1; - if (rq->half_from_full) halffullflag = 1; - if (rq->gran) { - sizeflag = NP_SIZE; - halfflag = 1; - } - if (rq->respaouter) { - respaflag = NP_RESPA; - halfflag = 1; - } - - if (rq->ghost) ghostflag = NP_GHOST; - if (rq->off2on) off2onflag = NP_OFF2ON; - if (rq->granonesided) onesideflag = NP_ONESIDE; - if (rq->ssa) ssaflag = NP_SSA; - if (rq->omp) ompflag = NP_OMP; - if (rq->intel) intelflag = NP_INTEL; - if (rq->kokkos_device) kokkos_device_flag = NP_KOKKOS_DEVICE; - if (rq->kokkos_host) kokkos_host_flag = NP_KOKKOS_HOST; - if (rq->bond) bondflag = NP_BOND; + // convert newton request to newtflag = on or off int newtflag; if (rq->newton == 0 && newton_pair) newtflag = 1; @@ -1455,60 +1762,42 @@ int Neighbor::choose_pair(NeighRequest *rq) else if (rq->newton == 1) newtflag = 1; else if (rq->newton == 2) newtflag = 0; - // use flags to match exactly one of NPair class masks - // sequence of checks is bit by bit in NeighConst + int molecular = atom->molecular; + + //printf("PAIR RQ FLAGS: hf %d %d n %d g %d sz %d gos %d r %d b %d o %d i %d " + // "kk %d %d ss %d dn %d sk %d cp %d hf %d oo %d\n", + // rq->half,rq->full,rq->newton,rq->ghost,rq->size, + // rq->granonesided,rq->respaouter,rq->bond,rq->omp,rq->intel, + // rq->kokkos_host,rq->kokkos_device,rq->ssa,rq->dnum, + // rq->skip,rq->copy,rq->halffull,rq->off2on); + + // use request and system settings to match exactly one NPair class mask + // checks are bitwise using NeighConst bit masks int mask; - //printf("FLAGS: %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n", - // copyflag,skipflag,halfflag,fullflag,halffullflag, - // sizeflag,respaflag,ghostflag,off2onflag,onesideflag,ssaflag, - // ompflag,intelflag,newtflag,bondflag); - for (int i = 0; i < npclass; i++) { mask = pairmasks[i]; - // if copyflag set, return or continue with no further checks + //printf(" PAIR NAMES i %d %d name %s mask %d\n",i,nrequest, + // pairnames[i],pairmasks[i]); - if (copyflag) { + // if copy request, no further checks needed, just return or continue + // Kokkos device/host flags must also match in order to copy + + if (rq->copy) { if (!(mask & NP_COPY)) continue; - if (kokkos_device_flag != (mask & NP_KOKKOS_DEVICE)) continue; - if (kokkos_host_flag != (mask & NP_KOKKOS_HOST)) continue; + if (!rq->kokkos_device != !(mask & NP_KOKKOS_DEVICE)) continue; + if (!rq->kokkos_host != !(mask & NP_KOKKOS_HOST)) continue; return i+1; } - // skipflag must match along with other flags, so do not return + // exactly one of half or full is set and must match - if (skipflag != (mask & NP_SKIP)) continue; - - // exactly one of halfflag,fullflag,halffullflag is set and must match - - if (halfflag) { + if (rq->half) { if (!(mask & NP_HALF)) continue; - } else if (fullflag) { + } else if (rq->full) { if (!(mask & NP_FULL)) continue; - } else if (halffullflag) { - if (!(mask & NP_HALFFULL)) continue; - } - - if (sizeflag != (mask & NP_SIZE)) continue; - if (respaflag != (mask & NP_RESPA)) continue; - if (ghostflag != (mask & NP_GHOST)) continue; - if (off2onflag != (mask & NP_OFF2ON)) continue; - if (onesideflag != (mask & NP_ONESIDE)) continue; - if (ssaflag != (mask & NP_SSA)) continue; - if (bondflag != (mask & NP_BOND)) continue; - if (ompflag != (mask & NP_OMP)) continue; - if (intelflag != (mask & NP_INTEL)) continue; - - // style is one of NSQ,BIN,MULTI and must match - - if (style == NSQ) { - if (!(mask & NP_NSQ)) continue; - } else if (style == BIN) { - if (!(mask & NP_BIN)) continue; - } else if (style == MULTI) { - if (!(mask & NP_MULTI)) continue; } // newtflag is on or off and must match @@ -1519,7 +1808,46 @@ int Neighbor::choose_pair(NeighRequest *rq) if (!(mask & NP_NEWTOFF)) continue; } - // triclinic flag is on or off and must match + // if molecular on, do not match ATOMONLY (b/c a MOLONLY Npair exists) + // if molecular off, do not match MOLONLY (b/c an ATOMONLY Npair exists) + + if (molecular) { + if (mask & NP_ATOMONLY) continue; + } else if (!molecular) { + if (mask & NP_MOLONLY) continue; + } + + // require match of these request flags and mask bits + // (!A != !B) is effectively a logical xor + + if (!rq->ghost != !(mask & NP_GHOST)) continue; + if (!rq->size != !(mask & NP_SIZE)) continue; + if (!rq->respaouter != !(mask & NP_RESPA)) continue; + if (!rq->granonesided != !(mask & NP_ONESIDE)) continue; + if (!rq->respaouter != !(mask & NP_RESPA)) continue; + if (!rq->bond != !(mask & NP_BOND)) continue; + if (!rq->omp != !(mask & NP_OMP)) continue; + if (!rq->intel != !(mask & NP_INTEL)) continue; + if (!rq->kokkos_device != !(mask & NP_KOKKOS_DEVICE)) continue; + if (!rq->kokkos_host != !(mask & NP_KOKKOS_HOST)) continue; + if (!rq->ssa != !(mask & NP_SSA)) continue; + + if (!rq->skip != !(mask & NP_SKIP)) continue; + + if (!rq->halffull != !(mask & NP_HALF_FULL)) continue; + if (!rq->off2on != !(mask & NP_OFF2ON)) continue; + + // neighbor style is one of NSQ,BIN,MULTI and must match + + if (style == NSQ) { + if (!(mask & NP_NSQ)) continue; + } else if (style == BIN) { + if (!(mask & NP_BIN)) continue; + } else if (style == MULTI) { + if (!(mask & NP_MULTI)) continue; + } + + // domain triclinic flag is on or off and must match if (triclinic) { if (!(mask & NP_TRI)) continue; @@ -1527,16 +1855,9 @@ int Neighbor::choose_pair(NeighRequest *rq) if (!(mask & NP_ORTHO)) continue; } - // Kokkos flags - - if (kokkos_device_flag != (mask & NP_KOKKOS_DEVICE)) continue; - if (kokkos_host_flag != (mask & NP_KOKKOS_HOST)) continue; - return i+1; } - //printf("NO MATCH\n"); - // error return if matched none return -1; @@ -1847,7 +2168,7 @@ void Neighbor::build_one(class NeighList *mylist, int preflag) } // if this is copy list and parent is occasional list, - // or this is half_from_full and parent is occasional list, + // or this is halffull and parent is occasional list, // insure parent is current if (mylist->listcopy && mylist->listcopy->occasional) diff --git a/src/neighbor.h b/src/neighbor.h index d087af9ed5..8e2fad1f1b 100644 --- a/src/neighbor.h +++ b/src/neighbor.h @@ -84,11 +84,11 @@ class Neighbor : protected Pointers { int nlist; // # of pairwise neighbor lists int nrequest; // # of requests, same as nlist - int old_nrequest; // RQ count for run that just finished + int old_nrequest; // # of requests for previous run class NeighList **lists; class NeighRequest **requests; // from Pair,Fix,Compute,Command classes - class NeighRequest **old_requests; // accessed by Finish + class NeighRequest **old_requests; // copy of requests to compare to // data from topology neighbor lists @@ -150,12 +150,11 @@ class Neighbor : protected Pointers { double inner[2],middle[2]; // rRESPA cutoffs for extra lists - int same; // 1 if NeighRequests are same as last run int old_style,old_triclinic; // previous run info int old_pgsize,old_oneatom; // used to avoid re-creating neigh lists int nstencil_perpetual; // # of perpetual NeighStencil classes - int npair_perpetual; // # of perpetual NeighPair classes + int npair_perpetual; // #x of perpetual NeighPair classes int *slist; // indices of them in neigh_stencil int *plist; // indices of them in neigh_pair @@ -163,8 +162,8 @@ class Neighbor : protected Pointers { int maxex_group; // max # in exclusion group list int maxex_mol; // max # in exclusion molecule list - int maxatom; // size of atom-based NeighList arrays - int maxrequest; // size of NeighRequest list + int maxatom; // max size of atom-based NeighList arrays + int maxrequest; // max size of NeighRequest list int maxwt; // max weighting factor applied + 1 // info for other Neigh classes: NBin,NStencil,NPair,NTopo @@ -200,9 +199,15 @@ class Neighbor : protected Pointers { // including creator methods for Nbin,Nstencil,Npair instances void init_styles(); - void init_pair(); + int init_pair(); virtual void init_topology(); + void morph_other(); + void morph_skip(); + void morph_granular(); + void morph_halffull(); + void morph_copy(); + void print_pairwise_info(); void requests_new2old(); @@ -227,47 +232,49 @@ class Neighbor : protected Pointers { }; namespace NeighConst { - static const int NB_SSA = 1<<0; - static const int NB_INTEL = 1<<1; - static const int NB_KOKKOS_DEVICE = 1<<2; - static const int NB_KOKKOS_HOST = 1<<3; + static const int NB_INTEL = 1<<0; + static const int NB_KOKKOS_DEVICE = 1<<1; + static const int NB_KOKKOS_HOST = 1<<2; + static const int NB_SSA = 1<<3; - static const int NS_HALF = 1<<0; - static const int NS_FULL = 1<<1; - static const int NS_GHOST = 1<<2; - static const int NS_SSA = 1<<3; - static const int NS_BIN = 1<<4; - static const int NS_MULTI = 1<<5; - static const int NS_2D = 1<<6; - static const int NS_3D = 1<<7; - static const int NS_NEWTON = 1<<8; - static const int NS_NEWTOFF = 1<<9; - static const int NS_ORTHO = 1<<10; - static const int NS_TRI = 1<<11; + static const int NS_BIN = 1<<0; + static const int NS_MULTI = 1<<1; + static const int NS_HALF = 1<<2; + static const int NS_FULL = 1<<3; + static const int NS_2D = 1<<4; + static const int NS_3D = 1<<5; + static const int NS_NEWTON = 1<<6; + static const int NS_NEWTOFF = 1<<7; + static const int NS_ORTHO = 1<<8; + static const int NS_TRI = 1<<9; + static const int NS_GHOST = 1<<10; + static const int NS_SSA = 1<<11; - static const int NP_COPY = 1<<0; - static const int NP_SKIP = 1<<1; - static const int NP_HALF = 1<<2; - static const int NP_FULL = 1<<3; - static const int NP_HALFFULL = 1<<4; - static const int NP_SIZE = 1<<5; - static const int NP_RESPA = 1<<6; - static const int NP_GHOST = 1<<7; - static const int NP_OFF2ON = 1<<8; - static const int NP_ONESIDE = 1<<9; - static const int NP_SSA = 1<<10; - static const int NP_OMP = 1<<11; - static const int NP_INTEL = 1<<12; - static const int NP_NSQ = 1<<13; - static const int NP_BIN = 1<<14; - static const int NP_MULTI = 1<<15; - static const int NP_NEWTON = 1<<16; - static const int NP_NEWTOFF = 1<<17; - static const int NP_ORTHO = 1<<18; - static const int NP_TRI = 1<<19; - static const int NP_KOKKOS_DEVICE = 1<<20; - static const int NP_KOKKOS_HOST = 1<<21; - static const int NP_BOND = 1<<22; + static const int NP_NSQ = 1<<0; + static const int NP_BIN = 1<<1; + static const int NP_MULTI = 1<<2; + static const int NP_HALF = 1<<3; + static const int NP_FULL = 1<<4; + static const int NP_ORTHO = 1<<5; + static const int NP_TRI = 1<<6; + static const int NP_ATOMONLY = 1<<7; + static const int NP_MOLONLY = 1<<8; + static const int NP_NEWTON = 1<<9; + static const int NP_NEWTOFF = 1<<10; + static const int NP_GHOST = 1<<11; + static const int NP_SIZE = 1<<12; + static const int NP_ONESIDE = 1<<13; + static const int NP_RESPA = 1<<14; + static const int NP_BOND = 1<<15; + static const int NP_OMP = 1<<16; + static const int NP_INTEL = 1<<17; + static const int NP_KOKKOS_DEVICE = 1<<18; + static const int NP_KOKKOS_HOST = 1<<19; + static const int NP_SSA = 1<<20; + static const int NP_COPY = 1<<21; + static const int NP_SKIP = 1<<22; + static const int NP_HALF_FULL = 1<<23; + static const int NP_OFF2ON = 1<<24; } } diff --git a/src/npair.cpp b/src/npair.cpp index bba3a2567f..9fe326cbd1 100644 --- a/src/npair.cpp +++ b/src/npair.cpp @@ -14,10 +14,12 @@ #include #include "npair.h" #include "neighbor.h" +#include "neigh_request.h" #include "nbin.h" #include "nstencil.h" #include "atom.h" #include "update.h" +#include "memory.h" #include "error.h" using namespace LAMMPS_NS; @@ -28,11 +30,28 @@ NPair::NPair(LAMMPS *lmp) : Pointers(lmp), nb(NULL), ns(NULL), bins(NULL), stencil(NULL) { last_build = -1; + mycutneighsq = NULL; molecular = atom->molecular; } +/* ---------------------------------------------------------------------- */ + +NPair::~NPair() +{ + memory->destroy(mycutneighsq); +} + +/* ---------------------------------------------------------------------- */ + +void NPair::post_constructor(NeighRequest *nrq) +{ + cutoff_custom = 0.0; + if (nrq->cut) cutoff_custom = nrq->cutoff; +} + /* ---------------------------------------------------------------------- copy needed info from Neighbor class to this build class + done once per run ------------------------------------------------------------------------- */ void NPair::copy_neighbor_info() @@ -71,6 +90,20 @@ void NPair::copy_neighbor_info() // special info special_flag = neighbor->special_flag; + + // overwrite per-type Neighbor cutoffs with custom value set by requestor + // only works for style = BIN (checked by Neighbor class) + + if (cutoff_custom > 0.0) { + memory->destroy(mycutneighsq); + int n = atom->ntypes; + memory->create(mycutneighsq,n+1,n+1,"npair:cutneighsq"); + int i,j; + for (i = 1; i <= n; i++) + for (j = 1; j <= n; j++) + mycutneighsq[i][j] = cutoff_custom * cutoff_custom; + cutneighsq = mycutneighsq; + } } /* ---------------------------------------------------------------------- diff --git a/src/npair.h b/src/npair.h index 0c8dee5e2b..cdb8b3061d 100644 --- a/src/npair.h +++ b/src/npair.h @@ -25,13 +25,17 @@ class NPair : protected Pointers { class NStencil *ns; // ptr to NStencil instance I depend on bigint last_build; // last timestep build performed + double cutoff_custom; // cutoff set by requestor + NPair(class LAMMPS *); - virtual ~NPair() {} + virtual ~NPair(); + void post_constructor(class NeighRequest *); virtual void copy_neighbor_info(); void build_setup(); virtual void build(class NeighList *) = 0; protected: + double **mycutneighsq; // per-type cutoffs when user specified // data from Neighbor class diff --git a/src/npair_full_bin.h b/src/npair_full_bin.h index c6acde578c..432fb3cbf8 100644 --- a/src/npair_full_bin.h +++ b/src/npair_full_bin.h @@ -15,7 +15,8 @@ NPairStyle(full/bin, NPairFullBin, - NP_FULL | NP_BIN | NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI) + NP_FULL | NP_BIN | NP_MOLONLY | + NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI) #else diff --git a/src/npair_full_bin_atomonly.cpp b/src/npair_full_bin_atomonly.cpp new file mode 100644 index 0000000000..36f0ab8d66 --- /dev/null +++ b/src/npair_full_bin_atomonly.cpp @@ -0,0 +1,96 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include "npair_full_bin_atomonly.h" +#include "neighbor.h" +#include "neigh_list.h" +#include "atom.h" +#include "atom_vec.h" +#include "domain.h" +#include "my_page.h" +#include "error.h" + +using namespace LAMMPS_NS; + +/* ---------------------------------------------------------------------- */ + +NPairFullBinAtomonly::NPairFullBinAtomonly(LAMMPS *lmp) : NPair(lmp) {} + +/* ---------------------------------------------------------------------- + binned neighbor list construction for all neighbors + every neighbor pair appears in list of both atoms i and j +------------------------------------------------------------------------- */ + +void NPairFullBinAtomonly::build(NeighList *list) +{ + int i,j,k,n,itype,jtype,ibin; + double xtmp,ytmp,ztmp,delx,dely,delz,rsq; + int *neighptr; + + double **x = atom->x; + int *type = atom->type; + int *mask = atom->mask; + tagint *tag = atom->tag; + tagint *molecule = atom->molecule; + int nlocal = atom->nlocal; + if (includegroup) nlocal = atom->nfirst; + + int *ilist = list->ilist; + int *numneigh = list->numneigh; + int **firstneigh = list->firstneigh; + MyPage *ipage = list->ipage; + + int inum = 0; + ipage->reset(); + + for (i = 0; i < nlocal; i++) { + n = 0; + neighptr = ipage->vget(); + + itype = type[i]; + xtmp = x[i][0]; + ytmp = x[i][1]; + ztmp = x[i][2]; + + // loop over all atoms in surrounding bins in stencil including self + // skip i = j + + ibin = coord2bin(x[i]); + + for (k = 0; k < nstencil; k++) { + for (j = binhead[ibin+stencil[k]]; j >= 0; j = bins[j]) { + if (i == j) continue; + + jtype = type[j]; + if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue; + + delx = xtmp - x[j][0]; + dely = ytmp - x[j][1]; + delz = ztmp - x[j][2]; + rsq = delx*delx + dely*dely + delz*delz; + + if (rsq <= cutneighsq[itype][jtype]) neighptr[n++] = j; + } + } + + ilist[inum++] = i; + firstneigh[i] = neighptr; + numneigh[i] = n; + ipage->vgot(n); + if (ipage->status()) + error->one(FLERR,"Neighbor list overflow, boost neigh_modify one"); + } + + list->inum = inum; + list->gnum = 0; +} diff --git a/src/npair_full_bin_atomonly.h b/src/npair_full_bin_atomonly.h new file mode 100644 index 0000000000..7ca5d667c7 --- /dev/null +++ b/src/npair_full_bin_atomonly.h @@ -0,0 +1,44 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef NPAIR_CLASS + +NPairStyle(full/bin/atomonly, + NPairFullBin, + NP_FULL | NP_BIN | NP_ATOMONLY | + NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI) + +#else + +#ifndef LMP_NPAIR_FULL_BIN_ATOMONLY_H +#define LMP_NPAIR_FULL_BIN_ATOMONLY_H + +#include "npair.h" + +namespace LAMMPS_NS { + +class NPairFullBinAtomonly : public NPair { + public: + NPairFullBinAtomonly(class LAMMPS *); + ~NPairFullBinAtomonly() {} + void build(class NeighList *); +}; + +} + +#endif +#endif + +/* ERROR/WARNING messages: + +*/ diff --git a/src/npair_half_bin_atomonly_newton.cpp b/src/npair_half_bin_atomonly_newton.cpp new file mode 100644 index 0000000000..bc425cd22e --- /dev/null +++ b/src/npair_half_bin_atomonly_newton.cpp @@ -0,0 +1,117 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include "npair_half_bin_atomonly_newton.h" +#include "neighbor.h" +#include "neigh_list.h" +#include "atom.h" +#include "atom_vec.h" +#include "molecule.h" +#include "domain.h" +#include "my_page.h" +#include "error.h" + +using namespace LAMMPS_NS; + +/* ---------------------------------------------------------------------- */ + +NPairHalfBinAtomonlyNewton::NPairHalfBinAtomonlyNewton(LAMMPS *lmp) : + NPair(lmp) {} + +/* ---------------------------------------------------------------------- + binned neighbor list construction with full Newton's 3rd law + each owned atom i checks its own bin and other bins in Newton stencil + every pair stored exactly once by some processor +------------------------------------------------------------------------- */ + +void NPairHalfBinAtomonlyNewton::build(NeighList *list) +{ + int i,j,k,n,itype,jtype,ibin; + double xtmp,ytmp,ztmp,delx,dely,delz,rsq; + int *neighptr; + + double **x = atom->x; + int *type = atom->type; + int *mask = atom->mask; + tagint *molecule = atom->molecule; + int nlocal = atom->nlocal; + if (includegroup) nlocal = atom->nfirst; + + int *ilist = list->ilist; + int *numneigh = list->numneigh; + int **firstneigh = list->firstneigh; + MyPage *ipage = list->ipage; + + int inum = 0; + ipage->reset(); + + for (i = 0; i < nlocal; i++) { + n = 0; + neighptr = ipage->vget(); + + itype = type[i]; + xtmp = x[i][0]; + ytmp = x[i][1]; + ztmp = x[i][2]; + + // loop over rest of atoms in i's bin, ghosts are at end of linked list + // if j is owned atom, store it, since j is beyond i in linked list + // if j is ghost, only store if j coords are "above and to the right" of i + + for (j = bins[i]; j >= 0; j = bins[j]) { + if (j >= nlocal) { + if (x[j][2] < ztmp) continue; + if (x[j][2] == ztmp) { + if (x[j][1] < ytmp) continue; + if (x[j][1] == ytmp && x[j][0] < xtmp) continue; + } + } + + jtype = type[j]; + if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue; + + delx = xtmp - x[j][0]; + dely = ytmp - x[j][1]; + delz = ztmp - x[j][2]; + rsq = delx*delx + dely*dely + delz*delz; + + if (rsq <= cutneighsq[itype][jtype]) neighptr[n++] = j; + } + + // loop over all atoms in other bins in stencil, store every pair + + ibin = coord2bin(x[i]); + for (k = 0; k < nstencil; k++) { + for (j = binhead[ibin+stencil[k]]; j >= 0; j = bins[j]) { + jtype = type[j]; + if (exclude && exclusion(i,j,itype,jtype,mask,molecule)) continue; + + delx = xtmp - x[j][0]; + dely = ytmp - x[j][1]; + delz = ztmp - x[j][2]; + rsq = delx*delx + dely*dely + delz*delz; + + if (rsq <= cutneighsq[itype][jtype]) neighptr[n++] = j; + } + } + + ilist[inum++] = i; + firstneigh[i] = neighptr; + numneigh[i] = n; + ipage->vgot(n); + if (ipage->status()) + error->one(FLERR,"Neighbor list overflow, boost neigh_modify one"); + } + + list->inum = inum; +} diff --git a/src/npair_half_bin_atomonly_newton.h b/src/npair_half_bin_atomonly_newton.h new file mode 100644 index 0000000000..a5771e19e2 --- /dev/null +++ b/src/npair_half_bin_atomonly_newton.h @@ -0,0 +1,43 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef NPAIR_CLASS + +NPairStyle(half/bin/atomonly/newton, + NPairHalfBinAtomonlyNewton, + NP_HALF | NP_BIN | NP_ATOMONLY | NP_NEWTON | NP_ORTHO) + +#else + +#ifndef LMP_NPAIR_HALF_BIN_ATOMONLY_NEWTON_H +#define LMP_NPAIR_HALF_BIN_ATOMONLY_NEWTON_H + +#include "npair.h" + +namespace LAMMPS_NS { + +class NPairHalfBinAtomonlyNewton : public NPair { + public: + NPairHalfBinAtomonlyNewton(class LAMMPS *); + ~NPairHalfBinAtomonlyNewton() {} + void build(class NeighList *); +}; + +} + +#endif +#endif + +/* ERROR/WARNING messages: + +*/ diff --git a/src/npair_half_bin_newton.h b/src/npair_half_bin_newton.h index c20e3dbef5..12d8d6e4de 100644 --- a/src/npair_half_bin_newton.h +++ b/src/npair_half_bin_newton.h @@ -15,7 +15,7 @@ NPairStyle(half/bin/newton, NPairHalfBinNewton, - NP_HALF | NP_BIN | NP_NEWTON | NP_ORTHO) + NP_HALF | NP_BIN | NP_MOLONLY | NP_NEWTON | NP_ORTHO) #else diff --git a/src/npair_half_size_bin_newtoff.cpp b/src/npair_half_size_bin_newtoff.cpp index b87bede312..e98923cd11 100644 --- a/src/npair_half_size_bin_newtoff.cpp +++ b/src/npair_half_size_bin_newtoff.cpp @@ -53,7 +53,7 @@ void NPairHalfSizeBinNewtoff::build(NeighList *list) double **firstshear; MyPage *ipage_touch; MyPage *dpage_shear; - NeighList *listgranhistory; + NeighList *listhistory; double **x = atom->x; double *radius = atom->radius; @@ -69,19 +69,19 @@ void NPairHalfSizeBinNewtoff::build(NeighList *list) int **firstneigh = list->firstneigh; MyPage *ipage = list->ipage; - FixShearHistory *fix_history = list->fix_history; + FixShearHistory *fix_history = (FixShearHistory *) list->fix_history; if (fix_history) { fix_history->nlocal_neigh = nlocal; fix_history->nall_neigh = nlocal + atom->nghost; npartner = fix_history->npartner; partner = fix_history->partner; shearpartner = fix_history->shearpartner; - listgranhistory = list->listgranhistory; - firsttouch = listgranhistory->firstneigh; - firstshear = listgranhistory->firstdouble; - ipage_touch = listgranhistory->ipage; - dpage_shear = listgranhistory->dpage; - dnum = listgranhistory->dnum; + listhistory = list->listhistory; + firsttouch = listhistory->firstneigh; + firstshear = listhistory->firstdouble; + ipage_touch = listhistory->ipage; + dpage_shear = listhistory->dpage; + dnum = listhistory->dnum; dnumbytes = dnum * sizeof(double); } diff --git a/src/npair_half_size_bin_newton.cpp b/src/npair_half_size_bin_newton.cpp index 8a32f4e6d6..2cd0943ac2 100644 --- a/src/npair_half_size_bin_newton.cpp +++ b/src/npair_half_size_bin_newton.cpp @@ -52,7 +52,7 @@ void NPairHalfSizeBinNewton::build(NeighList *list) double **firstshear; MyPage *ipage_touch; MyPage *dpage_shear; - NeighList *listgranhistory; + NeighList *listhistory; double **x = atom->x; double *radius = atom->radius; @@ -68,19 +68,19 @@ void NPairHalfSizeBinNewton::build(NeighList *list) int **firstneigh = list->firstneigh; MyPage *ipage = list->ipage; - FixShearHistory *fix_history = list->fix_history; + FixShearHistory *fix_history = (FixShearHistory *) list->fix_history; if (fix_history) { fix_history->nlocal_neigh = nlocal; fix_history->nall_neigh = nlocal + atom->nghost; npartner = fix_history->npartner; partner = fix_history->partner; shearpartner = fix_history->shearpartner; - listgranhistory = list->listgranhistory; - firsttouch = listgranhistory->firstneigh; - firstshear = listgranhistory->firstdouble; - ipage_touch = listgranhistory->ipage; - dpage_shear = listgranhistory->dpage; - dnum = listgranhistory->dnum; + listhistory = list->listhistory; + firsttouch = listhistory->firstneigh; + firstshear = listhistory->firstdouble; + ipage_touch = listhistory->ipage; + dpage_shear = listhistory->dpage; + dnum = listhistory->dnum; dnumbytes = dnum * sizeof(double); } diff --git a/src/npair_half_size_bin_newton_tri.cpp b/src/npair_half_size_bin_newton_tri.cpp index 620a07159e..054487d31f 100644 --- a/src/npair_half_size_bin_newton_tri.cpp +++ b/src/npair_half_size_bin_newton_tri.cpp @@ -53,7 +53,7 @@ void NPairHalfSizeBinNewtonTri::build(NeighList *list) double **firstshear; MyPage *ipage_touch; MyPage *dpage_shear; - NeighList *listgranhistory; + NeighList *listhistory; double **x = atom->x; double *radius = atom->radius; @@ -69,19 +69,19 @@ void NPairHalfSizeBinNewtonTri::build(NeighList *list) int **firstneigh = list->firstneigh; MyPage *ipage = list->ipage; - FixShearHistory *fix_history = list->fix_history; + FixShearHistory *fix_history = (FixShearHistory *) list->fix_history; if (fix_history) { fix_history->nlocal_neigh = nlocal; fix_history->nall_neigh = nlocal + atom->nghost; npartner = fix_history->npartner; partner = fix_history->partner; shearpartner = fix_history->shearpartner; - listgranhistory = list->listgranhistory; - firsttouch = listgranhistory->firstneigh; - firstshear = listgranhistory->firstdouble; - ipage_touch = listgranhistory->ipage; - dpage_shear = listgranhistory->dpage; - dnum = listgranhistory->dnum; + listhistory = list->listhistory; + firsttouch = listhistory->firstneigh; + firstshear = listhistory->firstdouble; + ipage_touch = listhistory->ipage; + dpage_shear = listhistory->dpage; + dnum = listhistory->dnum; dnumbytes = dnum * sizeof(double); } diff --git a/src/npair_half_size_nsq_newtoff.cpp b/src/npair_half_size_nsq_newtoff.cpp index 1c2d079893..56630a9dc8 100644 --- a/src/npair_half_size_nsq_newtoff.cpp +++ b/src/npair_half_size_nsq_newtoff.cpp @@ -53,7 +53,7 @@ void NPairHalfSizeNsqNewtoff::build(NeighList *list) double **firstshear; MyPage *ipage_touch; MyPage *dpage_shear; - NeighList *listgranhistory; + NeighList *listhistory; double **x = atom->x; double *radius = atom->radius; @@ -73,19 +73,19 @@ void NPairHalfSizeNsqNewtoff::build(NeighList *list) int **firstneigh = list->firstneigh; MyPage *ipage = list->ipage; - FixShearHistory *fix_history = list->fix_history; + FixShearHistory *fix_history = (FixShearHistory *) list->fix_history; if (fix_history) { fix_history->nlocal_neigh = nlocal; fix_history->nall_neigh = nall; npartner = fix_history->npartner; partner = fix_history->partner; shearpartner = fix_history->shearpartner; - listgranhistory = list->listgranhistory; - firsttouch = listgranhistory->firstneigh; - firstshear = listgranhistory->firstdouble; - ipage_touch = listgranhistory->ipage; - dpage_shear = listgranhistory->dpage; - dnum = listgranhistory->dnum; + listhistory = list->listhistory; + firsttouch = listhistory->firstneigh; + firstshear = listhistory->firstdouble; + ipage_touch = listhistory->ipage; + dpage_shear = listhistory->dpage; + dnum = listhistory->dnum; dnumbytes = dnum * sizeof(double); } diff --git a/src/npair_half_size_nsq_newton.cpp b/src/npair_half_size_nsq_newton.cpp index 914a4e7e7d..177685b9fc 100644 --- a/src/npair_half_size_nsq_newton.cpp +++ b/src/npair_half_size_nsq_newton.cpp @@ -54,7 +54,7 @@ void NPairHalfSizeNsqNewton::build(NeighList *list) double **firstshear; MyPage *ipage_touch; MyPage *dpage_shear; - NeighList *listgranhistory; + NeighList *listhistory; double **x = atom->x; double *radius = atom->radius; @@ -74,19 +74,19 @@ void NPairHalfSizeNsqNewton::build(NeighList *list) int **firstneigh = list->firstneigh; MyPage *ipage = list->ipage; - FixShearHistory *fix_history = list->fix_history; + FixShearHistory *fix_history = (FixShearHistory *) list->fix_history; if (fix_history) { fix_history->nlocal_neigh = nlocal; fix_history->nall_neigh = nall; npartner = fix_history->npartner; partner = fix_history->partner; shearpartner = fix_history->shearpartner; - listgranhistory = list->listgranhistory; - firsttouch = listgranhistory->firstneigh; - firstshear = listgranhistory->firstdouble; - ipage_touch = listgranhistory->ipage; - dpage_shear = listgranhistory->dpage; - dnum = listgranhistory->dnum; + listhistory = list->listhistory; + firsttouch = listhistory->firstneigh; + firstshear = listhistory->firstdouble; + ipage_touch = listhistory->ipage; + dpage_shear = listhistory->dpage; + dnum = listhistory->dnum; dnumbytes = dnum * sizeof(double); } diff --git a/src/npair_halffull_newtoff.h b/src/npair_halffull_newtoff.h index 20ceeabaad..24d439a331 100644 --- a/src/npair_halffull_newtoff.h +++ b/src/npair_halffull_newtoff.h @@ -15,9 +15,14 @@ NPairStyle(halffull/newtoff, NPairHalffullNewtoff, - NP_HALFFULL | NP_NSQ | NP_BIN | NP_MULTI | NP_NEWTOFF | + NP_HALF_FULL | NP_NEWTOFF | NP_NSQ | NP_BIN | NP_MULTI | NP_HALF | NP_ORTHO | NP_TRI) +NPairStyle(halffull/newtoff/skip, + NPairHalffullNewtoff, + NP_HALF_FULL | NP_NEWTOFF | NP_NSQ | NP_BIN | NP_MULTI | NP_HALF | + NP_ORTHO | NP_TRI | NP_SKIP) + #else #ifndef LMP_NPAIR_HALFFULL_NEWTOFF_H diff --git a/src/npair_halffull_newton.h b/src/npair_halffull_newton.h index 0f0aee58dc..3d20d686c3 100644 --- a/src/npair_halffull_newton.h +++ b/src/npair_halffull_newton.h @@ -15,9 +15,14 @@ NPairStyle(halffull/newton, NPairHalffullNewton, - NP_HALFFULL | NP_NSQ | NP_BIN | NP_MULTI | NP_NEWTON | + NP_HALF_FULL | NP_NEWTON | NP_HALF | NP_NSQ | NP_BIN | NP_MULTI | NP_ORTHO | NP_TRI) +NPairStyle(halffull/newton/skip, + NPairHalffullNewton, + NP_HALF_FULL | NP_NEWTON | NP_HALF | NP_NSQ | NP_BIN | NP_MULTI | + NP_ORTHO | NP_TRI | NP_SKIP) + #else #ifndef LMP_NPAIR_HALFFULL_NEWTON_H diff --git a/src/npair_skip.cpp b/src/npair_skip.cpp index 3048460859..1fe202537a 100644 --- a/src/npair_skip.cpp +++ b/src/npair_skip.cpp @@ -29,8 +29,9 @@ NPairSkip::NPairSkip(LAMMPS *lmp) : NPair(lmp) {} /* ---------------------------------------------------------------------- build skip list for subset of types from parent list + works for half and full lists + works for owned (non-ghost) list, also for ghost list iskip and ijskip flag which atom types and type pairs to skip - this is for half and full lists if ghost, also store neighbors of ghost atoms & set inum,gnum correctly ------------------------------------------------------------------------- */ diff --git a/src/npair_skip.h b/src/npair_skip.h index 5dfa3b2bf0..e62debd6bd 100644 --- a/src/npair_skip.h +++ b/src/npair_skip.h @@ -15,13 +15,13 @@ NPairStyle(skip, NPairSkip, - NP_SKIP | NP_HALF | NP_FULL | NP_HALFFULL | + NP_SKIP | NP_HALF | NP_FULL | NP_NSQ | NP_BIN | NP_MULTI | NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI) NPairStyle(skip/ghost, NPairSkip, - NP_SKIP | NP_HALF | NP_FULL | NP_HALFFULL | + NP_SKIP | NP_HALF | NP_FULL | NP_NSQ | NP_BIN | NP_MULTI | NP_NEWTON | NP_NEWTOFF | NP_ORTHO | NP_TRI | NP_GHOST) diff --git a/src/npair_skip_size.cpp b/src/npair_skip_size.cpp index c69b16d1df..98e757e5c7 100644 --- a/src/npair_skip_size.cpp +++ b/src/npair_skip_size.cpp @@ -49,7 +49,7 @@ void NPairSkipSize::build(NeighList *list) double **firstshear; MyPage *ipage_touch; MyPage *dpage_shear; - NeighList *listgranhistory; + NeighList *listhistory; tagint *tag = atom->tag; int *type = atom->type; @@ -68,19 +68,19 @@ void NPairSkipSize::build(NeighList *list) int *iskip = list->iskip; int **ijskip = list->ijskip; - FixShearHistory *fix_history = list->fix_history; + FixShearHistory *fix_history = (FixShearHistory *) list->fix_history; if (fix_history) { fix_history->nlocal_neigh = nlocal; fix_history->nall_neigh = nlocal + atom->nghost; npartner = fix_history->npartner; partner = fix_history->partner; shearpartner = fix_history->shearpartner; - listgranhistory = list->listgranhistory; - firsttouch = listgranhistory->firstneigh; - firstshear = listgranhistory->firstdouble; - ipage_touch = listgranhistory->ipage; - dpage_shear = listgranhistory->dpage; - dnum = listgranhistory->dnum; + listhistory = list->listhistory; + firsttouch = listhistory->firstneigh; + firstshear = listhistory->firstdouble; + ipage_touch = listhistory->ipage; + dpage_shear = listhistory->dpage; + dnum = listhistory->dnum; dnumbytes = dnum * sizeof(double); } diff --git a/src/npair_skip_size_off2on.cpp b/src/npair_skip_size_off2on.cpp index bd509327f1..996e9939df 100644 --- a/src/npair_skip_size_off2on.cpp +++ b/src/npair_skip_size_off2on.cpp @@ -50,7 +50,7 @@ void NPairSkipSizeOff2on::build(NeighList *list) double **firstshear; MyPage *ipage_touch; MyPage *dpage_shear; - NeighList *listgranhistory; + NeighList *listhistory; tagint *tag = atom->tag; int *type = atom->type; @@ -69,19 +69,19 @@ void NPairSkipSizeOff2on::build(NeighList *list) int *iskip = list->iskip; int **ijskip = list->ijskip; - FixShearHistory *fix_history = list->fix_history; + FixShearHistory *fix_history = (FixShearHistory *) list->fix_history; if (fix_history) { fix_history->nlocal_neigh = nlocal; fix_history->nall_neigh = nlocal + atom->nghost; npartner = fix_history->npartner; partner = fix_history->partner; shearpartner = fix_history->shearpartner; - listgranhistory = list->listgranhistory; - firsttouch = listgranhistory->firstneigh; - firstshear = listgranhistory->firstdouble; - ipage_touch = listgranhistory->ipage; - dpage_shear = listgranhistory->dpage; - dnum = listgranhistory->dnum; + listhistory = list->listhistory; + firsttouch = listhistory->firstneigh; + firstshear = listhistory->firstdouble; + ipage_touch = listhistory->ipage; + dpage_shear = listhistory->dpage; + dnum = listhistory->dnum; dnumbytes = dnum * sizeof(double); } diff --git a/src/npair_skip_size_off2on_oneside.cpp b/src/npair_skip_size_off2on_oneside.cpp index 12123741d0..a4c1625590 100644 --- a/src/npair_skip_size_off2on_oneside.cpp +++ b/src/npair_skip_size_off2on_oneside.cpp @@ -51,7 +51,7 @@ void NPairSkipSizeOff2onOneside::build(NeighList *list) double **firstshear; MyPage *ipage_touch; MyPage *dpage_shear; - NeighList *listgranhistory; + NeighList *listhistory; tagint *tag = atom->tag; int *type = atom->type; @@ -73,19 +73,19 @@ void NPairSkipSizeOff2onOneside::build(NeighList *list) if (domain->dimension == 2) surf = atom->line; else surf = atom->tri; - FixShearHistory *fix_history = list->fix_history; + FixShearHistory *fix_history = (FixShearHistory *) list->fix_history; if (fix_history) { fix_history->nlocal_neigh = nlocal; fix_history->nall_neigh = nlocal + atom->nghost; npartner = fix_history->npartner; partner = fix_history->partner; shearpartner = fix_history->shearpartner; - listgranhistory = list->listgranhistory; - firsttouch = listgranhistory->firstneigh; - firstshear = listgranhistory->firstdouble; - ipage_touch = listgranhistory->ipage; - dpage_shear = listgranhistory->dpage; - dnum = listgranhistory->dnum; + listhistory = list->listhistory; + firsttouch = listhistory->firstneigh; + firstshear = listhistory->firstdouble; + ipage_touch = listhistory->ipage; + dpage_shear = listhistory->dpage; + dnum = listhistory->dnum; dnumbytes = dnum * sizeof(double); } diff --git a/src/nstencil.cpp b/src/nstencil.cpp index 4ad2cbe56c..18e815d0c9 100644 --- a/src/nstencil.cpp +++ b/src/nstencil.cpp @@ -13,6 +13,7 @@ #include "nstencil.h" #include "neighbor.h" +#include "neigh_request.h" #include "nbin.h" #include "atom.h" #include "update.h" @@ -88,6 +89,14 @@ NStencil::~NStencil() delete [] distsq_multi; } +/* ---------------------------------------------------------------------- */ + +void NStencil::post_constructor(NeighRequest *nrq) +{ + cutoff_custom = 0.0; + if (nrq->cut) cutoff_custom = nrq->cutoff; +} + /* ---------------------------------------------------------------------- copy needed info from Neighbor class to this stencil class ------------------------------------------------------------------------- */ @@ -98,6 +107,14 @@ void NStencil::copy_neighbor_info() cutneighmax = neighbor->cutneighmax; cutneighmaxsq = neighbor->cutneighmaxsq; cuttypesq = neighbor->cuttypesq; + + // overwrite Neighbor cutoff with custom value set by requestor + // only works for style = BIN (checked by Neighbor class) + + if (cutoff_custom > 0.0) { + cutneighmax = cutoff_custom; + cutneighmaxsq = cutneighmax * cutneighmax; + } } /* ---------------------------------------------------------------------- diff --git a/src/nstencil.h b/src/nstencil.h index e71cf163c5..7985d23202 100644 --- a/src/nstencil.h +++ b/src/nstencil.h @@ -31,8 +31,11 @@ class NStencil : protected Pointers { int **stencil_multi; // list of bin offsets in each stencil double **distsq_multi; // sq distances to bins in each stencil + double cutoff_custom; // cutoff set by requestor + NStencil(class LAMMPS *); virtual ~NStencil(); + void post_constructor(class NeighRequest *); void copy_neighbor_info(); virtual void create_setup(); bigint memory_usage(); diff --git a/src/pair.h b/src/pair.h index ecb54bcf4d..ac86acf394 100644 --- a/src/pair.h +++ b/src/pair.h @@ -92,7 +92,7 @@ class Pair : protected Pointers { class NeighList *list; // standard neighbor list used by most pairs class NeighList *listhalf; // half list used by some pairs class NeighList *listfull; // full list used by some pairs - class NeighList *listgranhistory; // granular history list used by some pairs + class NeighList *listhistory; // neighbor history list used by some pairs class NeighList *listinner; // rRESPA lists used by some pairs class NeighList *listmiddle; class NeighList *listouter; diff --git a/src/pair_coul_streitz.cpp b/src/pair_coul_streitz.cpp index 6eab90234b..6b9ba9df9c 100644 --- a/src/pair_coul_streitz.cpp +++ b/src/pair_coul_streitz.cpp @@ -206,7 +206,6 @@ void PairCoulStreitz::init_style() if (!atom->q_flag) error->all(FLERR,"Pair style coul/streitz requires atom attribute q"); - //neighbor->request(this); int irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->full = 1; diff --git a/src/pair_hybrid.cpp b/src/pair_hybrid.cpp index d756b9be98..5ff48a2d08 100644 --- a/src/pair_hybrid.cpp +++ b/src/pair_hybrid.cpp @@ -486,12 +486,12 @@ void PairHybrid::init_style() for (istyle = 0; istyle < nstyles; istyle++) styles[istyle]->init_style(); // create skip lists inside each pair neigh request - // any kind of list can have its skip flag set at this stage + // any kind of list can have its skip flag set in this loop for (i = 0; i < neighbor->nrequest; i++) { if (!neighbor->requests[i]->pair) continue; - // istyle = associated sub-style for that request + // istyle = associated sub-style for the request for (istyle = 0; istyle < nstyles; istyle++) if (styles[istyle] == neighbor->requests[i]->requestor) break; @@ -549,10 +549,6 @@ void PairHybrid::init_style() memory->destroy(ijskip); } } - - // combine sub-style neigh list requests and create new ones if needed - - modify_requests(); } /* ---------------------------------------------------------------------- @@ -612,110 +608,6 @@ void PairHybrid::setup() for (int m = 0; m < nstyles; m++) styles[m]->setup(); } -/* ---------------------------------------------------------------------- - examine sub-style neigh list requests - create new parent requests if needed, to derive sub-style requests from -------------------------------------------------------------------------- */ - -void PairHybrid::modify_requests() -{ - int i,j; - NeighRequest *irq,*jrq; - - // loop over pair requests only, including those added during looping - - int nrequest_original = neighbor->nrequest; - - for (i = 0; i < neighbor->nrequest; i++) { - if (!neighbor->requests[i]->pair) continue; - - // nothing more to do if this request: - // is not a skip list - // is a copy or half_from_full or granhistory list - // copy list setup is from pair style = hybrid/overlay - // which invokes this method at end of its modify_requests() - // if granhistory, turn off skip, since each gran sub-style - // its own history list, parent gran list does not have history - // if half_from_full, turn off skip, since it will derive - // from its full parent and its skip status - - irq = neighbor->requests[i]; - if (irq->skip == 0) continue; - if (irq->copy) continue; - if (irq->granhistory || irq->half_from_full) { - irq->skip = 0; - continue; - } - - // look for another list that matches via same_kind() and is not a skip list - // if one exists, point at that one via otherlist - // else make new parent request via copy_request() and point at that one - // new parent list is not a skip list - // parent does not need its ID set, since pair hybrid does not use it - - for (j = 0; j < neighbor->nrequest; j++) { - if (!neighbor->requests[j]->pair) continue; - jrq = neighbor->requests[j]; - if (irq->same_kind(jrq) && jrq->skip == 0) break; - } - - if (j < neighbor->nrequest) irq->otherlist = j; - else { - int newrequest = neighbor->request(this,instance_me); - neighbor->requests[newrequest]->copy_request(irq); - irq->otherlist = newrequest; - } - - // for rRESPA inner/middle lists, - // which just created or set otherlist to parent: - // unset skip flag and otherlist - // this prevents neighbor from treating them as skip lists - - if (irq->respainner || irq->respamiddle) { - irq->skip = 0; - irq->otherlist = -1; - } - } - - // adjustments to newly added granular parent requests (gran = 1) - // set parent newton = 2 if has children with granonesided = 0 and 1 - // else newton = 0 = setting of children - // if 2, also set child off2on for both granonesided kinds of children - // set parent gran onesided = 0 if has children with granonesided = 0 and 1 - // else onesided = setting of children - - for (i = nrequest_original; i < neighbor->nrequest; i++) { - if (!neighbor->requests[i]->pair) continue; - if (!neighbor->requests[i]->gran) continue; - irq = neighbor->requests[i]; - - int onesided = -1; - for (j = 0; j < nrequest_original; j++) { - if (!neighbor->requests[j]->pair) continue; - if (!neighbor->requests[j]->gran) continue; - if (neighbor->requests[j]->otherlist != i) continue; - jrq = neighbor->requests[j]; - - if (onesided < 0) onesided = jrq->granonesided; - else if (onesided != jrq->granonesided) onesided = 2; - if (onesided == 2) break; - } - - if (onesided == 2) { - irq->newton = 2; - irq->granonesided = 0; - - for (j = 0; j < nrequest_original; j++) { - if (!neighbor->requests[j]->pair) continue; - if (!neighbor->requests[j]->gran) continue; - if (neighbor->requests[j]->otherlist != i) continue; - jrq = neighbor->requests[j]; - jrq->off2on = 1; - } - } - } -} - /* ---------------------------------------------------------------------- proc 0 writes to restart file ------------------------------------------------------------------------- */ diff --git a/src/pair_hybrid.h b/src/pair_hybrid.h index a7a236d269..7b92505dc4 100644 --- a/src/pair_hybrid.h +++ b/src/pair_hybrid.h @@ -77,8 +77,6 @@ class PairHybrid : public Pair { double *save_special(); void set_special(int); void restore_special(double *); - - virtual void modify_requests(); }; } diff --git a/src/pair_hybrid_overlay.cpp b/src/pair_hybrid_overlay.cpp index 6ffd6a19d6..6776e90ff4 100644 --- a/src/pair_hybrid_overlay.cpp +++ b/src/pair_hybrid_overlay.cpp @@ -105,38 +105,3 @@ void PairHybridOverlay::coeff(int narg, char **arg) if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients"); } - -/* ---------------------------------------------------------------------- - combine sub-style neigh list requests and create new ones if needed -------------------------------------------------------------------------- */ - -void PairHybridOverlay::modify_requests() -{ - int i,j; - NeighRequest *irq,*jrq; - - // loop over pair requests only - // if a previous list is same kind with same skip attributes - // then make this one a copy list of that one - // works whether both lists are no-skip or yes-skip - // will not point a list at a copy list, but at copy list's parent - - for (i = 0; i < neighbor->nrequest; i++) { - if (!neighbor->requests[i]->pair) continue; - - irq = neighbor->requests[i]; - for (j = 0; j < i; j++) { - if (!neighbor->requests[j]->pair) continue; - jrq = neighbor->requests[j]; - if (irq->same_kind(jrq) && irq->same_skip(jrq)) { - irq->copy = 1; - irq->otherlist = j; - break; - } - } - } - - // perform same operations on skip lists as pair style = hybrid - - PairHybrid::modify_requests(); -} diff --git a/src/pair_hybrid_overlay.h b/src/pair_hybrid_overlay.h index 169583a48b..934be05365 100644 --- a/src/pair_hybrid_overlay.h +++ b/src/pair_hybrid_overlay.h @@ -29,9 +29,6 @@ class PairHybridOverlay : public PairHybrid { PairHybridOverlay(class LAMMPS *); virtual ~PairHybridOverlay() {} void coeff(int, char **); - - private: - void modify_requests(); }; } diff --git a/src/pair_lj96_cut.cpp b/src/pair_lj96_cut.cpp index 1579a9fbf4..1f79226e64 100644 --- a/src/pair_lj96_cut.cpp +++ b/src/pair_lj96_cut.cpp @@ -500,24 +500,19 @@ void PairLJ96Cut::init_style() else if (respa == 1) { irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 1; - neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->respainner = 1; irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 3; - neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->respaouter = 1; } else { irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 1; - neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->respainner = 1; irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 2; - neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->respamiddle = 1; irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 3; - neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->respaouter = 1; } diff --git a/src/pair_lj_cut.cpp b/src/pair_lj_cut.cpp index b8ea4a72b6..bffdd7fff4 100644 --- a/src/pair_lj_cut.cpp +++ b/src/pair_lj_cut.cpp @@ -494,24 +494,19 @@ void PairLJCut::init_style() else if (respa == 1) { irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 1; - neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->respainner = 1; irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 3; - neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->respaouter = 1; } else { irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 1; - neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->respainner = 1; irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 2; - neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->respamiddle = 1; irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 3; - neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->respaouter = 1; } diff --git a/src/pair_mie_cut.cpp b/src/pair_mie_cut.cpp index b79c6c9bf9..3c13c19a3b 100644 --- a/src/pair_mie_cut.cpp +++ b/src/pair_mie_cut.cpp @@ -509,24 +509,19 @@ void PairMIECut::init_style() else if (respa == 1) { irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 1; - neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->respainner = 1; irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 3; - neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->respaouter = 1; } else { irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 1; - neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->respainner = 1; irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 2; - neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->respamiddle = 1; irequest = neighbor->request(this,instance_me); neighbor->requests[irequest]->id = 3; - neighbor->requests[irequest]->half = 0; neighbor->requests[irequest]->respaouter = 1; } diff --git a/src/version.h b/src/version.h index 10c42e4de7..9f6021787c 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define LAMMPS_VERSION "13 Feb 2017" +#define LAMMPS_VERSION "21 Feb 2017"