cru_cqop - conditional quarternary operator for the cru library
#include <cru/cru.h>
typedef struct
cru_cqop_s
{
cru_qpred
qpred;
cru_qop
qop;
} *cru_cqop;
A conditional ternary operator represents a quarternary operator whose result is required only if some predicate is true of its operands. When conditional operators are passed to cru library functions, they are used only as follows:
A NULL qpred field causes the operator to be invoked unconditionally. When operating on a graph created with scalar edge labels, cru infers a quartenary operator that unconditionally returns its second operand if none is specified. That is, if applied to the quadruple of operands (w,x,y,z) in that order, the inferred quartenary operator returns x.
Except as noted above, there is no default value for the qop field, which must be initialized to something other than NULL. Otherwise, an error of CRU_UNDCQO is reported for an undefined conditional quartenary operator.
Conditional quarternary operands are the labeler field in a cru_composer structure used during composition operations. The first two operands are properties of a local and an adjacent vertex, respectively, computed according to the co_props field of the same composer. The other two operands are the label of an edge from the local vertex and one from the adjacent vertex. The predicate decides whether to create a new edge, and the operator determines its label. The default operator creates an edge with the same label as the outgoing edge from the local vertex, but only if the edge labels are of scalar types and not dynamically allocated.
/usr/local/include/cru/function_types.h
/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_crossed, cru_crosser, cru_ctop, cru_ctop_pair, 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