// Copyright 2017 The Abseil Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Generates gaussian_distribution.cc // // $ blaze run :gaussian_distribution_gentables > gaussian_distribution.cc // #include "absl/random/gaussian_distribution.h" #include <cmath> #include <cstddef> #include <iostream> #include <limits> #include <string> #include "absl/base/macros.h" namespace absl { ABSL_NAMESPACE_BEGIN namespace random_internal { namespace { template <typename T, size_t N> void FormatArrayContents(std::ostream* os, T (&data)[N]) { … } } // namespace class TableGenerator : public gaussian_distribution_base { … }; // Ziggurat gaussian initialization. For an explanation of the algorithm, see // the Marsaglia paper, "The Ziggurat Method for Generating Random Variables". // http://www.jstatsoft.org/v05/i08/ // // Further details are available in the Doornik paper // https://www.doornik.com/research/ziggurat.pdf // TableGenerator::TableGenerator() { … } void TableGenerator::Print(std::ostream* os) { … } } // namespace random_internal ABSL_NAMESPACE_END } // namespace absl int main(int, char**) { … }