本文整理汇总了C++中BOOST_PREVENT_MACRO_SUBSTITUTION函数的典型用法代码示例。如果您正苦于以下问题:C++ BOOST_PREVENT_MACRO_SUBSTITUTION函数的具体用法?C++ BOOST_PREVENT_MACRO_SUBSTITUTION怎么用?C++ BOOST_PREVENT_MACRO_SUBSTITUTION使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了BOOST_PREVENT_MACRO_SUBSTITUTION函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: apply
static inline void apply(std::basic_ostream<Char, Traits>& os,
Box const& box, std::string const& style, int size)
{
// Prevent invisible boxes, making them >=1, using "max"
BOOST_USING_STD_MAX();
typedef typename coordinate_type<Box>::type ct;
ct x = geometry::get<geometry::min_corner, 0>(box);
ct y = geometry::get<geometry::min_corner, 1>(box);
ct width = max BOOST_PREVENT_MACRO_SUBSTITUTION(1,
geometry::get<geometry::max_corner, 0>(box) - x);
ct height = max BOOST_PREVENT_MACRO_SUBSTITUTION (1,
geometry::get<geometry::max_corner, 1>(box) - y);
os << "<rect x=\"" << x << "\" y=\"" << y
<< "\" width=\"" << width << "\" height=\"" << height
<< "\" style=\"" << style << "\"/>";
}
示例2: max_wavefront
typename graph_traits<Graph>::vertices_size_type
max_wavefront(const Graph& g, VertexIndexMap index)
{
BOOST_USING_STD_MAX();
typename graph_traits<Graph>::vertices_size_type b = 0;
typename graph_traits<Graph>::vertex_iterator i, end;
for (boost::tie(i, end) = vertices(g); i != end; ++i)
b = max BOOST_PREVENT_MACRO_SUBSTITUTION(b, ith_wavefront(*i, g, index));
return b;
}
示例3: sequential_vertex_coloring
typename property_traits<ColorMap>::value_type
sequential_vertex_coloring(const VertexListGraph& G, OrderPA order,
ColorMap color)
{
typedef graph_traits<VertexListGraph> GraphTraits;
typedef typename GraphTraits::vertex_descriptor Vertex;
typedef typename property_traits<ColorMap>::value_type size_type;
size_type max_color = 0;
const size_type V = num_vertices(G);
// We need to keep track of which colors are used by
// adjacent vertices. We do this by marking the colors
// that are used. The mark array contains the mark
// for each color. The length of mark is the
// number of vertices since the maximum possible number of colors
// is the number of vertices.
std::vector<size_type> mark(V,
std::numeric_limits<size_type>::max BOOST_PREVENT_MACRO_SUBSTITUTION());
//Initialize colors
typename GraphTraits::vertex_iterator v, vend;
for (tie(v, vend) = vertices(G); v != vend; ++v)
put(color, *v, V-1);
//Determine the color for every vertex one by one
for ( size_type i = 0; i < V; i++) {
Vertex current = get(order,i);
typename GraphTraits::adjacency_iterator v, vend;
//Mark the colors of vertices adjacent to current.
//i can be the value for marking since i increases successively
for (tie(v,vend) = adjacent_vertices(current, G); v != vend; ++v)
mark[get(color,*v)] = i;
//Next step is to assign the smallest un-marked color
//to the current vertex.
size_type j = 0;
//Scan through all useable colors, find the smallest possible
//color that is not used by neighbors. Note that if mark[j]
//is equal to i, color j is used by one of the current vertex's
//neighbors.
while ( j < max_color && mark[j] == i )
++j;
if ( j == max_color ) //All colors are used up. Add one more color
++max_color;
//At this point, j is the smallest possible color
put(color, current, j); //Save the color of vertex current
}
return max_color;
}
示例4: norm
template<class T, class Policies> inline
T norm(const interval<T, Policies>& x)
{
typedef interval<T, Policies> I;
if (interval_lib::detail::test_input(x)) {
typedef typename Policies::checking checking;
return checking::nan();
}
BOOST_USING_STD_MAX();
return max BOOST_PREVENT_MACRO_SUBSTITUTION(static_cast<T>(-x.lower()), x.upper());
}
示例5: abs
template<class T, class Policies> inline
interval<T, Policies> abs(const interval<T, Policies>& x)
{
typedef interval<T, Policies> I;
if (interval_lib::detail::test_input(x))
return I::empty();
if (!interval_lib::user::is_neg(x.lower())) return x;
if (!interval_lib::user::is_pos(x.upper())) return -x;
BOOST_USING_STD_MAX();
return I(static_cast<T>(0), max BOOST_PREVENT_MACRO_SUBSTITUTION(static_cast<T>(-x.lower()), x.upper()), true);
}
示例6: back_edge
void back_edge(const Edge& e, Graph& g)
{
BOOST_USING_STD_MIN();
if ( target(e, g) != get(pred, source(e, g)) ) {
S.push(e);
put(lowpt, source(e, g),
min BOOST_PREVENT_MACRO_SUBSTITUTION(get(lowpt, source(e, g)),
get(dtm, target(e, g))));
}
}
示例7: radius_and_diameter
inline std::pair<typename property_traits<EccentricityMap>::value_type,
typename property_traits<EccentricityMap>::value_type>
radius_and_diameter(const Graph& g, EccentricityMap ecc)
{
function_requires< VertexListGraphConcept<Graph> >();
typedef typename graph_traits<Graph>::vertex_descriptor Vertex;
typedef typename graph_traits<Graph>::vertex_iterator VertexIterator;
function_requires< ReadablePropertyMapConcept<EccentricityMap, Vertex> >();
typedef typename property_traits<EccentricityMap>::value_type Eccentricity;
VertexIterator i, end;
tie(i, end) = vertices(g);
Eccentricity radius = get(ecc, *i);
Eccentricity diameter = get(ecc, *i);
for(i = boost::next(i); i != end; ++i) {
Eccentricity cur = get(ecc, *i);
radius = min BOOST_PREVENT_MACRO_SUBSTITUTION (radius, cur);
diameter = max BOOST_PREVENT_MACRO_SUBSTITUTION (diameter, cur);
}
return std::make_pair(radius, diameter);
}
示例8: size
typename std::basic_string<Ch, Tr, Alloc>::size_type basic_format<Ch,Tr, Alloc>::
size () const {
BOOST_USING_STD_MAX();
size_type sz = prefix_.size();
unsigned long i;
for(i=0; i < items_.size(); ++i) {
const format_item_t& item = items_[i];
sz += item.res_.size();
if( item.argN_ == format_item_t::argN_tabulation)
sz = max BOOST_PREVENT_MACRO_SUBSTITUTION (sz,
static_cast<size_type>(item.fmtstate_.width_) );
sz += item.appendix_.size();
}
return sz;
}
示例9: floyd_warshall_noninit_dispatch
bool floyd_warshall_noninit_dispatch(const VertexAndEdgeListGraph& g,
DistanceMatrix& d, WeightMap w,
const bgl_named_params<P, T, R>& params)
{
typedef typename property_traits<WeightMap>::value_type WM;
return floyd_warshall_all_pairs_shortest_paths(g, d, w,
choose_param(get_param(params, distance_compare_t()),
std::less<WM>()),
choose_param(get_param(params, distance_combine_t()),
closed_plus<WM>()),
choose_param(get_param(params, distance_inf_t()),
std::numeric_limits<WM>::max BOOST_PREVENT_MACRO_SUBSTITUTION()),
choose_param(get_param(params, distance_zero_t()),
WM()));
}
示例10: johnson_dispatch
bool
johnson_dispatch(VertexAndEdgeListGraph& g,
DistanceMatrix& D,
const bgl_named_params<P, T, R>& params,
Weight w, VertexID id)
{
typedef typename property_traits<Weight>::value_type WT;
return johnson_all_pairs_shortest_paths
(g, D, id, w,
choose_param(get_param(params, distance_compare_t()),
std::less<WT>()),
choose_param(get_param(params, distance_combine_t()),
closed_plus<WT>()),
choose_param(get_param(params, distance_inf_t()),
std::numeric_limits<WT>::max BOOST_PREVENT_MACRO_SUBSTITUTION()),
choose_param(get_param(params, distance_zero_t()), WT()) );
}
示例11: finish_vertex
void finish_vertex(const Vertex& u, Graph& g)
{
BOOST_USING_STD_MIN();
Vertex parent = get(pred, u);
bool is_art_point = false;
if ( get(dtm, parent) > get(dtm, u) ) {
parent = get(pred, parent);
is_art_point = true;
}
if ( parent == u ) { // at top
if ( get(dtm, u) + 1 == get(dtm, get(pred, u)) )
is_art_point = false;
} else {
put(lowpt, parent,
min BOOST_PREVENT_MACRO_SUBSTITUTION(get(lowpt, parent),
get(lowpt, u)));
if (get(lowpt, u) >= get(dtm, parent)) {
if ( get(dtm, parent) > get(dtm, get(pred, parent)) ) {
put(pred, u, get(pred, parent));
put(pred, parent, u);
}
while ( get(dtm, source(S.top(), g)) >= get(dtm, u) ) {
put(comp, S.top(), c);
S.pop();
}
put(comp, S.top(), c);
S.pop();
++c;
if ( S.empty() ) {
put(pred, u, parent);
put(pred, parent, u);
}
}
}
if ( is_art_point )
*out++ = u;
}
示例12: clique
inline void
clique (const Clique& c, Graph2& g)
{
if (c.size () >= min_size)
{
BOOST_USING_STD_MAX();
maximum = std::max BOOST_PREVENT_MACRO_SUBSTITUTION (maximum, c.size());
//save clique...
typename Clique::const_iterator i, end = c.end ();
//std::vector<void *> * cc = new std::vector<void *> (c.size ());
std::vector<size_t> * cc = new std::vector<size_t> (c.size ());
cliques.push_back (cc);
size_t p;
for (i = c.begin (); i != end; ++i, ++p)
{
//cc->at (p) = static_cast<void *> (*i);
cc->at (p) = (*i);
}
n_cliques++;
}
else
{
return;
}
// Simply assert that each vertex in the clique is connected
// to all others in the clique.
/*typename Clique::const_iterator i, j, end = c.end();
for(i = c.begin(); i != end; ++i) {
for(j = c.begin(); j != end; ++j) {
if(i != j) {
BOOST_ASSERT(edge(*i, *j, g).second);
}
}
}*/
}
示例13: clique
inline void
clique (const Clique& c, Graph2& g)
{
if (c.size () >= min_size_)
{
BOOST_USING_STD_MAX();
maximum_ = std::max BOOST_PREVENT_MACRO_SUBSTITUTION (maximum_, c.size());
//save clique...
typename Clique::const_iterator i, end = c.end ();
std::vector<size_t> * cc = new std::vector<size_t> (c.size ());
cliques_.push_back (cc);
size_t p;
for (i = c.begin (); i != end; ++i, ++p)
cc->at (p) = (*i);
n_cliques_++;
}
else
return;
}
示例14: BOOST_PREVENT_MACRO_SUBSTITUTION
extern "C" double BOOST_MATH_TR1_DECL acosh BOOST_PREVENT_MACRO_SUBSTITUTION(double x)
{
return c_policies::acosh BOOST_PREVENT_MACRO_SUBSTITUTION(x);
}
示例15: BOOST_PREVENT_MACRO_SUBSTITUTION
extern "C" float BOOST_MATH_TR1_DECL comp_ellint_1f BOOST_PREVENT_MACRO_SUBSTITUTION(float x)
{
return c_policies::ellint_1 BOOST_PREVENT_MACRO_SUBSTITUTION(x);
}