<commit_before>// This file is part of the dune-stuff project:
//   https://users.dune-project.org/projects/dune-stuff
// Copyright holders: <NAME>, <NAME>
// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)

#ifndef DUNE_STUFF_GRID_OUTPUT_PGF_HH
#define DUNE_STUFF_GRID_OUTPUT_PGF_HH

#include <dune/stuff/common/disable_warnings.hh>
# include <dune/common/fvector.hh>
#include <dune/stuff/common/reenable_warnings.hh>
#include <dune/common/array.hh>
#include <dune/stuff/grid/walk.hh>
#include <dune/stuff/grid/walk_functors.hh>
#include <dune/stuff/common/fvector.hh>

#include <ostream>
#include <cstdio>
#include <limits>
#include <array>

namespace Dune {
namespace Stuff {
namespace Grid {

typedef std::array<std::string,7>
  TexColorArrayType;
namespace {
  const TexColorArrayType texcolors_ = {{ "black","red","blue","green","yellow","cyan","magenta" }};
}


//! A means to ensure we have exactly 2 coords for tikz to draw, even in 1D
struct PgfCoordWrapper : FieldVector<double,2>{
  template < int wdim >
  PgfCoordWrapper( const FieldVector<double,wdim>& vector )
    : FieldVector<double,2>( 0.0 )
  {
    for( size_t i = 0; i < size_t(std::min(wdim, 2)); ++i )
      (*this)[i] = vector[i];
  }
};

/** \brief print a tex(tikz) representation of an entity to stream
 *  \ingroup Latex
 *  \param output the ostream used for output
 *
 *  A functor to be used in a \ref GridWalk
 **/
class PgfEntityFunctor {
public:
  PgfEntityFunctor( std::ostream& output )
    : file_(output)
  {}

  template <class Entity><commit_msg>[grid:output.pgf] fix for compilation failure<commit_after>// This file is part of the dune-stuff project:
//   https://users.dune-project.org/projects/dune-stuff
// Copyright holders: <NAME>, <NAME>
// License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)

#ifndef DUNE_STUFF_GRID_OUTPUT_PGF_HH
#define DUNE_STUFF_GRID_OUTPUT_PGF_HH

#include <dune/stuff/common/disable_warnings.hh>
# include <dune/common/fvector.hh>
#include <dune/stuff/common/reenable_warnings.hh>
#include <dune/common/array.hh>
#include <dune/stuff/grid/walk.hh>
#include <dune/stuff/grid/walk_functors.hh>

#include <ostream>
#include <cstdio>
#include <limits>
#include <array>

namespace Dune {
namespace Stuff {
namespace Grid {

typedef std::array<std::string,7>
  TexColorArrayType;
namespace {
  const TexColorArrayType texcolors_ = {{ "black","red","blue","green","yellow","cyan","magenta" }};
}


//! A means to ensure we have exactly 2 coords for tikz to draw, even in 1D
struct PgfCoordWrapper : Dune::FieldVector<double,2>{
  template < int wdim >
  PgfCoordWrapper( const Dune::FieldVector<double,wdim>& vector )
    : Dune::FieldVector<double,2>( 0.0 )
  {
    for( size_t i = 0; i < size_t(std::min(wdim, 2)); ++i )
      (*this)[i] = vector[i];
  }
};

/** \brief print a tex(tikz) representation of an entity to stream
 *  \ingroup Latex
 *  \param output the ostream used for output
 *
 *  A functor to be used in a \ref GridWalk
 **/
class PgfEntityFunctor {
public:
  PgfEntityFunctor( std::ostream& output )
    : file_(output)
  {}

  template <class Entity>
{'fraction_non_alphanumeric': 0.14235668789808917, 'fraction_numerical': 0.0070063694267515925, 'mean_word_length': 4.510526315789473, 'pattern_counts': {'":': 0, '<': 42, '<?xml version=': 0, '>': 40, 'https://': 2, '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': '3924738', 'n_tokens_mistral': 1164, 'n_tokens_neox': 1116, 'n_words': 271}