Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Data structures 这段代码是如何生成随机数的?_Data Structures_Treap - Fatal编程技术网

Data structures 这段代码是如何生成随机数的?

Data structures 这段代码是如何生成随机数的?,data-structures,treap,Data Structures,Treap,我现在正在学习treap,我得到了一个实现,在这个实现中,这个家伙使用了一些奇怪的方法来生成随机数作为优先级。我无法获得它。有人介意解释一下它是如何工作的吗 struct xor_128 { ull x,y,z,w; xor_128(): x(1234567892851659llu), y(3631515817918578190llu),z(711737163082llu), w(916951651388197517llu) {}

我现在正在学习treap,我得到了一个实现,在这个实现中,这个家伙使用了一些奇怪的方法来生成随机数作为优先级。我无法获得它。有人介意解释一下它是如何工作的吗

     struct xor_128
     {
         ull x,y,z,w;
         xor_128(): x(1234567892851659llu), y(3631515817918578190llu),z(711737163082llu), w(916951651388197517llu) {}
         ull next()
       {
          ull t=x^(x<<11);// ull is unsigned long long he used
          x=y;
          y=z;
          z=w;
          return w=w^(w>>19)^t^(t>>8);
       }
    };
结构异或128 { ull x,y,z,w; xor_128():x(123456782851659LLU),y(3631515817918578190llu),z(711737163082llu),w(91695165138819517LLU){} 下一步() { ull t=x^(x19)^t^(t>>8); } };