<?xml version="1.0" encoding="utf-8"?>
<refentry xml:id="random-engine-xoshiro256starstar.jumplong" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
 <refnamediv>
  <refname>Random\Engine\Xoshiro256StarStar::jumpLong</refname>
  <refpurpose>Efficiently move the engine ahead by 2^192 steps</refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis role="Random\\Engine\\Xoshiro256StarStar">
   <modifier>public</modifier> <type>void</type><methodname>Random\Engine\Xoshiro256StarStar::jumpLong</methodname>
   <void/>
  </methodsynopsis>
  <para>
   Moves the algorithm’s state ahead by 2<superscript>192</superscript> steps, as if
   <function>Random\Engine\Xoshiro256StarStar::generate</function> was called
   2<superscript>192</superscript> times.
  </para>
  <para>
   The purpose of a long jump is to facilitate the creation of a new <classname>Random\Engine\Xoshiro256StarStar</classname>
   engine from an existing seeded <classname>Random\Engine\Xoshiro256StarStar</classname> engine.
   The seeded engine acts as a blueprint, which can be <link linkend="language.oop5.cloning">cloned</link>
   and repeatedly jumped to create 2<superscript>64</superscript> non-overlapping sequences with
   2<superscript>192</superscript> values each.
  </para>
  <para>
   Long jumping may be combined with <function>Random\Engine\Xoshiro256StarStar::jump</function>ing
   to further split each of the 2<superscript>64</superscript> sequences generated by long jumping,
   into 2<superscript>64</superscript> sequences of 2<superscript>128</superscript> values each.
  </para>
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  &no.function.parameters;
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   &return.void;
  </para>
 </refsect1>

 <refsect1 role="examples">
  &reftitle.examples;
  <example>
   <title><function>Random\Engine\Xoshiro256StarStar::jumpLong</function> example</title>
   <programlisting role="php">
<![CDATA[
<?php
$blueprintRng = new \Random\Engine\Xoshiro256StarStar(0);

// Each parent engine will have its own chunk of 2**192 values.
$parent1 = clone $blueprintRng;
$blueprintRng->jumpLong();

$parent2 = clone $blueprintRng;
$blueprintRng->jumpLong();

// Each of the child engines will have its own chunk of 2**128 values
// taken from their parent engine’s chunk of 2**192 values.
$child1a = clone $parent1;
$parent1->jump();
$child1b = clone $parent1;
$parent1->jump();

$child2a = clone $parent2;
$parent2->jump();
$child2b = clone $parent2;
$parent2->jump();

echo "Child 1A: ", bin2hex($child1a->generate()), "\n";
echo "Child 1B: ", bin2hex($child1b->generate()), "\n";
echo "Child 2A: ", bin2hex($child2a->generate()), "\n";
echo "Child 2B: ", bin2hex($child2b->generate()), "\n";
?>
]]>
   </programlisting>
   &example.outputs;
   <screen>
<![CDATA[
Child 1A: b4f275cb365fec99
Child 1B: 2cd646c8ed156237
Child 2A: eb3729a722a504e7
Child 2B: d4208dc85bdd6dc3
]]>
   </screen>
  </example>
 </refsect1>

 <refsect1 role="seealso">
  &reftitle.seealso;
  <simplelist>
   <member><function>Random\Engine\Xoshiro256StarStar::jump</function></member>
  </simplelist>
 </refsect1>

</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
