本文整理汇总了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);
}
示例2: make
StatisticsVector StatisticsVector::make(
const string& name,
const Statistics& stats)
{
StatisticsVector vec;
vec.insert(name, stats);
return vec;
}
示例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());
}
示例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();
}
示例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;
}
示例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;
示例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;