<commit_before>// ========================================================================== //
// This file is part of Sara, a basic set of libraries in C++ for computer
// vision.
//
// Copyright (C) 2017 <NAME> <<EMAIL>>
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License v. 2.0. If a copy of the MPL was not distributed with this file,
// you can obtain one at http://mozilla.org/MPL/2.0/.
// ========================================================================== //

//! @file

#pragma once

#include <random>

#include <DO/Sara/Core/Image.hpp>


namespace DO { namespace Sara {


  struct NormalDistribution
  {
    NormalDistribution()
    {
    }

    float operator()() const
    {
      return _dist(_gen);
    }

    template <int M, int N>
    void operator()(Matrix<float, M, N>& m) const
    {
      auto a = m.array();
      for (auto i = long{0}, sz = a.size(); i < sz; ++i)
        a[i] = _dist(_gen);
    }

    void operator()(MatrixXf& m) const
    {
      auto a = m.array();
      for (auto i = long{0}, sz = a.size(); i < sz; ++i)
        a(i) = _dist(_gen);
    }

    template <int N>
    void operator()(Image<Rgb32f, N>& image) const
    {
      const auto randn_fill = [&](Rgb32f& v) {
        v[0] = _dist(_gen);
        v[1] = _dist(_gen);
        v[2] = _dist(_gen);
      };<commit_msg>MAINT: tentative fix for VS 2015 build.<commit_after>// ========================================================================== //
// This file is part of Sara, a basic set of libraries in C++ for computer
// vision.
//
// Copyright (C) 2017 <NAME> <<EMAIL>>
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License v. 2.0. If a copy of the MPL was not distributed with this file,
// you can obtain one at http://mozilla.org/MPL/2.0/.
// ========================================================================== //

//! @file

#pragma once

#include <random>

#include <DO/Sara/Core/Image.hpp>


namespace DO { namespace Sara {


  struct NormalDistribution
  {
    NormalDistribution()
    {
    }

    float operator()() const
    {
      return _dist(_gen);
    }

    template <int M, int N>
    void operator()(Matrix<float, M, N>& m) const
    {
      auto a = m.array();
      for (size_t i = decltype(a.size()){0}, sz = a.size(); i < sz; ++i)
        a[i] = _dist(_gen);
    }

    void operator()(MatrixXf& m) const
    {
      auto a = m.array();
      for (auto i = decltype(a.size()){0}, sz = a.size(); i < sz; ++i)
        a(i) = _dist(_gen);
    }

    template <int N>
    void operator()(Image<Rgb32f, N>& image) const
    {
      const auto randn_fill = [&](Rgb32f& v) {
        v[0] = _dist(_gen);
        v[1] = _dist(_gen);
        v[2] = _dist(_gen);
      };
{'fraction_non_alphanumeric': 0.25216763005780346, 'fraction_numerical': 0.013728323699421965, 'mean_word_length': 2.540920716112532, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '363122', 'n_tokens_mistral': 939, 'n_tokens_neox': 872, 'n_words': 280}