cru_ctop_pair - pair of conditional ternary operators
#include <cru/cru.h>
typedef struct
cru_ctop_pair_s
{
struct
cru_ctop_s
ana_labeler;
struct
cru_ctop_s
cata_labeler;
} *cru_ctop_pair;
Applications initialize this structure for use by the cru_split library function as a way of specifying the edge labels in a graph to correspond with vertices it creates. There is one conditional ternary operator for each member of a pair of vertices derived from a common vertex.
For each edge connected to a created vertex, the corresponding ternary predicate ana_labeler.tpred or cata_labeler.tpred is passed an edge label as its middle operand and the properties of the edge's origin and terminus respectively as its left and right operands. Per usual cru_ctop calling conventions, if the predicate returns a non-zero value, then the operator ana_labeler.top or cata_labeler.top is called with the same operands to produce a replacement for the given edge label. If the predicate returns zero, then the given edge is deleted.
For splitting a graph whose edge labels are scalar values, either or both fields can be omitted or zero-filled. In that case, a copy of the given edge is made unconditionally.
The cru_ctop_pair structure is a field in the cru_ctop_quad structure, which is part of the cru_splitter top level structure. Whether the created vertex is the origin or the terminus of the edge whose label is passed to the operator depends on whether it is an incoming or an outgoing edge from the created vertex, which depends on whether the cru_ctop_pair structure is in the inward or the outward field of the cru_ctop_quad structure.
/usr/local/include/cru/data_types.h
cru, cru_bop, cru_bpred, cru_builder, cru_built, cru_cbop, cru_classifier, cru_class_of, cru_class_size, cru_composed, cru_composer, cru_connect, cru_connector, cru_cqop, cru_crossed, cru_crosser, cru_ctop, cru_ctop_quad, cru_data_types, cru_deduplicated, cru_destructor, cru_destructor_pair, cru_edge_count, cru_fabricated, cru_fabricator, cru_filter, cru_filtered, cru_fold, cru_free_kill_switch, cru_free_later, cru_free_now, cru_free_partition, cru_function_types, cru_get, cru_hash, cru_induced, cru_inducer, cru_kernel, cru_kill, cru_killed, cru_mapreduced, cru_mapreducer, cru_merged, cru_merger, cru_mutated, cru_mutator, cru_new_kill_switch, cru_nop, cru_order, cru_order_pair, cru_partition_of, cru_plan, cru_postponed, cru_postponer, cru_prop, cru_prop_pair, cru_pruner, cru_qop, cru_qpred, cru_set, cru_sig, cru_singleton, cru_split, cru_splitter, cru_spread, cru_strerror, cru_stretch, cru_stretched, cru_stretcher, cru_subconnector, cru_terminus_count, cru_top, cru_tpred, cru_united, cru_uop, cru_vertex_count, cru_zone
Dennis Furey (milonga@delayinsensitive.com)
https://github.com/gueststar/cru