当前位置: 首页>>代码示例>>C++>>正文


C++ StatisticsVector类代码示例

本文整理汇总了C++中StatisticsVector的典型用法代码示例。如果您正苦于以下问题:C++ StatisticsVector类的具体用法?C++ StatisticsVector怎么用?C++ StatisticsVector使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了StatisticsVector类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

void StatisticsVector<T>::histogram(std::vector<dof_id_type>& bin_members,
				    unsigned int n_bins) const
{
  StatisticsVector<T> sv = (*this);

  return sv.histogram(bin_members, n_bins);
}
开发者ID:ZJLi2013,项目名称:libmesh,代码行数:7,代码来源:statistics.C

示例2: make

StatisticsVector StatisticsVector::make(
    const string&               name,
    const Statistics&           stats)
{
    StatisticsVector vec;
    vec.insert(name, stats);
    return vec;
}
开发者ID:boberfly,项目名称:gafferDependencies,代码行数:8,代码来源:statistics.cpp

示例3: print_tile_renderers_stats

        void print_tile_renderers_stats() const
        {
            assert(!m_tile_renderers.empty());

            StatisticsVector stats;

            for (size_t i = 0; i < m_tile_renderers.size(); ++i)
                stats.merge(m_tile_renderers[i]->get_statistics());

            RENDERER_LOG_DEBUG("%s", stats.to_string().c_str());
        }
开发者ID:mistajuliax,项目名称:appleseed,代码行数:11,代码来源:genericframerenderer.cpp

示例4: median

Real ErrorVector::median()
{
  const unsigned int n   = this->size();

  if (n == 0)
    return 0.;


  // Build a StatisticsVector<ErrorVectorReal> containing
  // only our active entries and take its mean
  StatisticsVector<ErrorVectorReal> sv;

  sv.reserve (n);

  for (unsigned int i=0; i<n; i++)
    if(this->is_active_elem(i))
      sv.push_back((*this)[i]);

  return sv.median();
}
开发者ID:paulovieira,项目名称:libmesh,代码行数:20,代码来源:error_vector.C

示例5: RayCountStatisticsEntry

StatisticsVector Intersector::get_statistics() const
{
    const uint64 total_ray_count = m_shading_ray_count + m_probe_ray_count;

    Statistics intersection_stats;
    intersection_stats.insert<uint64>("total rays", total_ray_count);
    intersection_stats.insert(
        auto_ptr<RayCountStatisticsEntry>(
            new RayCountStatisticsEntry(
                "shading rays",
                m_shading_ray_count,
                total_ray_count)));
    intersection_stats.insert(
        auto_ptr<RayCountStatisticsEntry>(
            new RayCountStatisticsEntry(
                "probe rays",
                m_probe_ray_count,
                total_ray_count)));

    StatisticsVector vec;

    vec.insert("intersection statistics", intersection_stats);

#ifdef FOUNDATION_BVH_ENABLE_TRAVERSAL_STATS
    vec.insert(
        "assembly tree intersection statistics",
        m_assembly_tree_traversal_stats.get_statistics());

    vec.insert(
        "triangle tree intersection statistics",
        m_triangle_tree_traversal_stats.get_statistics());
#endif

    vec.insert(
        "region tree access cache statistics",
        make_dual_stage_cache_stats(m_region_tree_cache));

    vec.insert(
        "triangle tree access cache statistics",
        make_dual_stage_cache_stats(m_triangle_tree_cache));

    vec.insert(
        "region kit access cache statistics",
        make_dual_stage_cache_stats(m_region_kit_cache));

    vec.insert(
        "tessellation access cache statistics",
        make_dual_stage_cache_stats(m_tess_cache));

    return vec;
}
开发者ID:EgoIncarnate,项目名称:appleseed,代码行数:51,代码来源:intersector.cpp

示例6: main


//.........这里部分代码省略.........
      exit(1);
    }

#endif


  /**
   * Possibly read the solution
   */
  if (names.size() == 3)
    LegacyXdrIO(mesh,true).read_mgf_soln(names[2],
                                         soln,
                                         var_names);



  /**
   * Maybe Triangulate
   */
  //  if (dim == 2 && triangulate)
  if (triangulate)
    {
      if (verbose)
        libMesh::out << "...Converting to all simplices...\n";

      MeshTools::Modification::all_tri(mesh);
    }

  /**
   * Compute Shape quality metrics
   */
  if (do_quality)
    {
      StatisticsVector<Real> sv;
      sv.reserve(mesh.n_elem());

      libMesh::out << "Quality type is: " << Quality::name(quality_type) << std::endl;

      // What are the quality bounds for this element?
      std::pair<Real, Real> bounds = mesh.elem(0)->qual_bounds(quality_type);
      libMesh::out << "Quality bounds for this element type are: (" << bounds.first
                   << ", " << bounds.second << ") "
                   << std::endl;

      MeshBase::const_element_iterator it  = mesh.active_elements_begin(),
        end = mesh.active_elements_end();
      for (; it != end; ++it)
        {
          Elem *e = *it;
          sv.push_back(e->quality(quality_type));
        }

      const unsigned int n_bins = 10;
      libMesh::out << "Avg. shape quality: " << sv.mean() << std::endl;

      // Find element indices below the specified cutoff.
      // These might be considered "bad" elements which need refinement.
      std::vector<dof_id_type> bad_elts  = sv.cut_below(0.8);
      libMesh::out << "Found " << bad_elts.size()
                   << " of " << mesh.n_elem()
                   << " elements below the cutoff." << std::endl;

      /*
        for (unsigned int i=0; i<bad_elts.size(); i++)
        libMesh::out << bad_elts[i] << " ";
        libMesh::out << std::endl;
开发者ID:maxis112,项目名称:libmesh,代码行数:67,代码来源:meshtool.C

示例7: main


//.........这里部分代码省略.........
      InfElemBuilder(mesh).build_inf_elem(origin_x, origin_y, origin_z,
                                          x_sym, y_sym, z_sym,
                                          verbose);

      if (verbose)
        {
          mesh.print_info();
          mesh.get_boundary_info().print_summary();
        }

    }

  // sanity check
  else if ((origin_x.first ||  origin_y.first || origin_z.first) ||
           (x_sym          ||  y_sym          || z_sym))
    libmesh_error_msg("ERROR:  -x/-y/-z/-X/-Y/-Z is only to be used when\n"
                      << "the option -a is also specified!");

#endif


  // Maybe Triangulate
  if (triangulate)
    {
      if (verbose)
        libMesh::out << "...Converting to all simplices...\n";

      MeshTools::Modification::all_tri(mesh);
    }

  // Compute Shape quality metrics
  if (do_quality)
    {
      StatisticsVector<Real> sv;
      sv.reserve(mesh.n_elem());

      libMesh::out << "Quality type is: " << Quality::name(quality_type) << std::endl;

      // What are the quality bounds for this element?
      std::pair<Real, Real> bounds = mesh.elem_ref(0).qual_bounds(quality_type);
      libMesh::out << "Quality bounds for this element type are: ("
                   << bounds.first
                   << ", "
                   << bounds.second
                   << ") "
                   << std::endl;

      for (const auto & elem : mesh.active_element_ptr_range())
        sv.push_back(elem->quality(quality_type));

      const unsigned int n_bins = 10;
      libMesh::out << "Avg. shape quality: " << sv.mean() << std::endl;

      // Find element indices below the specified cutoff.
      // These might be considered "bad" elements which need refinement.
      std::vector<dof_id_type> bad_elts  = sv.cut_below(0.8);
      libMesh::out << "Found " << bad_elts.size()
                   << " of " << mesh.n_elem()
                   << " elements below the cutoff." << std::endl;

      // Compute the histogram for this distribution
      std::vector<dof_id_type> histogram;
      sv.histogram(histogram, n_bins);

      const bool do_matlab = true;
开发者ID:dschwen,项目名称:libmesh,代码行数:66,代码来源:meshtool.C


注:本文中的StatisticsVector类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。