|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Main namespace for Aleph-w library functions. More...
Classes | |
| struct | __const_iterator |
| STL-compatible const iterator wrapper. More... | |
| class | __In_Filt |
| Filter the incoming arcs. More... | |
| struct | __iterator |
| STL-compatible mutable iterator wrapper. More... | |
| class | __Out_Filt |
| Filter the outcoming arcs. More... | |
| struct | __Res_Arc |
| Arc of the residual network of the preflow-push algorithms. More... | |
| struct | __Shade_Arc |
| struct | __Shade_Node |
| struct | _Identity |
| struct | _Select1st |
| struct | _Select2nd |
| class | AABBTree |
| Axis-aligned bounding box tree for spatial queries. More... | |
| struct | AABBTreeQueryVizResult |
| Result bundle for AABB query visualization. More... | |
| class | Abstract_Euclidian_Plane |
| class | AbstractTreeNodeAllocator |
| class | Adaptive_Huffman_Decoder |
| Incremental FGK decoder accepting arbitrarily fragmented bits. More... | |
| class | Adaptive_Huffman_Encoder |
| Stateful, one-pass FGK Huffman encoder for binary byte strings. More... | |
| struct | Add_Max_Policy |
| Range add + range max policy. More... | |
| struct | Add_Min_Policy |
| Range add + range min policy. More... | |
| struct | Add_Sum_Policy |
| Range add + range sum policy. More... | |
| struct | AddLazyTag |
| Additive lazy tag: adds a delta to every node on a path. More... | |
| struct | AdversarialIterativeDeepeningIteration |
| Result of one iterative-deepening iteration. More... | |
| struct | AdversarialIterativeDeepeningOptions |
| Controls for adversarial iterative deepening. More... | |
| struct | AdversarialIterativeDeepeningResult |
| Aggregate result of adversarial iterative deepening. More... | |
| struct | AdversarialSearchResult |
| Result of one adversarial search execution. More... | |
| struct | AdversarialSearchStats |
| Statistics collected by adversarial search engines. More... | |
| class | AdversarialTraceCollector |
| Collector that stores trace events in an Aleph list. More... | |
| struct | AdversarialTraceEvent |
| One trace event produced by an adversarial search. More... | |
| struct | AdversarialTranspositionEntry |
| Cached adversarial-search entry stored in transposition tables. More... | |
| struct | AdversarialTranspositionKey |
| Convenience alias for adversarial transposition tables. More... | |
| class | Ady_Mat |
| Auxiliary adjacency matrix with custom entry type. More... | |
| class | Ady_MaT |
| class | AhArenaAllocator |
| Arena allocator for fast bump-pointer allocation. More... | |
| class | AHMapping |
| A generic key-value mapping container with inverse operation support. More... | |
| class | Aho_Corasick |
| Aho-Corasick multi-pattern automaton. More... | |
| class | AlDomain |
| Generic domain class based on hash set. More... | |
| struct | Aleph_Hash |
Primary hash functor used internally by dft_hash_fct / snd_hash_fct. More... | |
| struct | Aleph_Hash< double > |
| struct | Aleph_Hash< float > |
| class | Alpha_Beta |
| Adversarial search engine with Alpha-Beta pruning. More... | |
| class | AlphaShape |
| Alpha shape of a point set. More... | |
| class | AndrewMonotonicChainConvexHull |
| Andrew's monotonic chain convex hull algorithm. More... | |
| struct | Arc_Iterator |
| Filtered iterator on all the arcs of a graph. More... | |
| struct | Arc_List_Order |
The order of the arc iterator of the graph, as a comparison for Bounded_Cycle_Index: it tells no arc apart from another. More... | |
| class | Arc_Node |
| class | Arcs_Index |
| Builds an arc index for fast lookup by source/target nodes. More... | |
| struct | ArenaTreeAllocator |
| Allocator of the nodes of a tree in an arena. More... | |
| class | Array |
| Simple dynamic array with automatic resizing and functional operations. More... | |
| class | Array_Container |
| Lightweight wrapper that provides Aleph-w container interface for raw arrays. More... | |
| class | Array_Graph |
| class | Array_Iterator |
| Iterator wrapper for C++ raw arrays. More... | |
| class | ArrayHeap |
| Fixed-capacity binary heap backed by a raw array. More... | |
| class | ArrayQueue |
| Queue implemented with a single dynamic array. More... | |
| class | ArrayStack |
| Stack implemented with simple dynamic array and with bounds verification. More... | |
| struct | AspirationWindow |
| Aspiration-window configuration for iterative deepening. More... | |
| struct | Assign_Sum_Policy |
| Range assign + range sum policy. More... | |
| struct | AssignLazyTag |
| Assignment lazy tag: sets every node on a path to a fixed value. More... | |
| struct | AssignmentResult |
| Result of assignment problem. More... | |
| class | AStar_Min_Path |
| A* algorithm for finding the shortest path between two nodes. More... | |
| struct | Attr |
| struct | Avl_Tree |
| AVL binary search tree with nodes without a virtual destructor. More... | |
| struct | Avl_Tree_Rk |
| Ranked AVL tree with nodes without a virtual destructor. More... | |
| struct | Avl_Tree_Rk_Vtl |
| Ranked AVL tree with nodes with a virtual destructor. More... | |
| struct | Avl_Tree_Vtl |
| AVL binary search tree with nodes with a virtual destructor. More... | |
| class | AvlNodeRk |
| Extended AVL node with subtree counter. More... | |
| class | AvlNodeRk_Data |
| AVL node data with balance factor and subtree count. More... | |
| class | AvlNodeRkVtl |
| class | bad_expected_access |
Exception thrown by expected::value() when no value is held. More... | |
| struct | BaseballEliminationResult |
| Result of baseball elimination check. More... | |
| class | Bellman_Ford |
| Bellman-Ford algorithm for shortest paths with negative weights. More... | |
| struct | Bellman_Ford_Negative_Cycle |
| Detects if a negative cycle exists and eventually computes it. More... | |
| class | BestSolution |
| Tracks the best solution seen so far according to a comparator. More... | |
| class | BezierCurve |
| Quadratic and cubic Bézier curves with exact rational arithmetic. More... | |
| class | Bidirectional_BFS |
| Bidirectional BFS for finding shortest unweighted paths. More... | |
| struct | binary_function |
| class | binary_negate |
| class | binder1st |
| class | binder2nd |
| struct | BinHeap |
| Node heap without virtual destructor. More... | |
| class | BinHeapNode |
| class | BinHeapNode_Data |
| class | BinHeapNodeVtl |
| struct | BinHeapVtl |
| Heap of nodes with virtual destructor. More... | |
| class | BinNode |
| Node for binary search tree. More... | |
| class | BinNodeInfixIterator |
| Inorder iterator on the nodes of a binary tree. More... | |
| class | BinNodePrefixIterator |
| Preorder iterator on the nodes of a binary tree. More... | |
| class | BinNodeVtl |
| class | BinNodeXt |
| Node for extended binary search tree. More... | |
| class | BinNodeXt_Data |
| class | BinNodeXtVtl |
| struct | BinTree |
| Binary search tree with nodes without virtual destructors,. More... | |
| class | BinTree_Operation |
| Functor encompassing basic operation for binary search trees. More... | |
| struct | BinTreeVtl |
| Binary search tree with nodes with virtual destructors,. More... | |
| class | BinTreeXt_Iterator |
| Base iterator template for ranked binary search trees. More... | |
| class | BinTreeXt_Operation |
| Functor encompassing basic operation for extended binary search trees. More... | |
| struct | Bit_Column |
| Inclusive range of the integers that a column holds. More... | |
| class | Bit_Fields |
| Bit fields for nodes and arcs used for marking visit state during processing. More... | |
| class | Bit_Mat_Graph |
| Bit matrix for graph connectivity. More... | |
| class | BitArray |
| Contiguous array of bits. More... | |
| class | Bloom_Filter |
| Bloom filter implementation. More... | |
| struct | Blossom_Weighted_Result |
| Result of weighted matching. More... | |
| class | BooleanPolygonOperations |
| Boolean operations on simple polygons (union, intersection, difference) using the Greiner-Hormann algorithm. More... | |
| class | Bounded_Cycle_Index |
| Index of the simple cycles of bounded length of a digraph. More... | |
| struct | Bounded_Cycle_Result |
Result of most_negative_cycle_bounded(). More... | |
| class | BoundedChannel |
| Bounded blocking channel for producer-consumer workflows. More... | |
| class | Branch_And_Bound |
| Reusable branch-and-bound engine over implicit state spaces. More... | |
| struct | BranchAndBoundResult |
| Result of a branch-and-bound execution. More... | |
| struct | BranchAndBoundStats |
| Branch-and-bound specific statistics. More... | |
| class | Breadth_First_Traversal |
| Stateful breadth-first traversal functor. More... | |
| class | BruteForceConvexHull |
| Brute force convex hull algorithm. More... | |
| struct | Buf128Bits |
| class | Build_Grid |
| Functor to build a 2D grid graph with 8-connectivity. More... | |
| class | Build_Spanning_Tree |
| Build a spanning tree from an array of arcs. More... | |
| class | Build_Subgraph |
| Build a mapped subgraph from a graph starting at a given node. More... | |
| class | Byte |
| class | CancellationSource |
| Cooperative cancellation source paired with CancellationToken. More... | |
| struct | CancellationState |
| Shared state for cooperative cancellation. More... | |
| class | CancellationToken |
| Read-only cooperative cancellation token. More... | |
| struct | Capacity_Scaling_Maximum_Flow |
| Functor wrapper for capacity scaling. More... | |
| struct | Cartesian_Tree |
| Cartesian Tree for min-heap (range minimum). More... | |
| struct | Cartesian_Tree_RMaxQ |
| Range maximum queries via Cartesian Tree. More... | |
| struct | Cartesian_Tree_RMQ |
| Range minimum queries via Cartesian Tree. More... | |
| class | ChaikinSmoothing |
| Chaikin corner-cutting subdivision for polygon smoothing. More... | |
| struct | Chebyshev_Heuristic |
| Chebyshev (L-infinity) distance heuristic for 8-connected grids. More... | |
| struct | CirculationResult |
| Result of a circulation problem. More... | |
| class | ClosestPairDivideAndConquer |
| Closest pair of points via divide and conquer. More... | |
| struct | CmpContainer |
| class | Cnode |
| Low-level prefix tree node for storing character sequences. More... | |
| struct | Commodity |
| Commodity definition for multi-commodity flow. More... | |
| class | Compact_Cuckoo_Filter |
| Memory-optimized Cuckoo Filter with bit-packed fingerprints. More... | |
| class | Compact_Quotient_Filter |
| Memory-optimized quotient filter with bit-packed slots. More... | |
| struct | Compare_Dnode |
| Comparator specialization for Dnode objects. More... | |
| struct | Compare_Dup |
| struct | Compare_Height |
| Compare nodes by height (higher first). More... | |
| class | Compare_Tnode |
| Helper class to compare nodes of a linked list. More... | |
| class | Compiler_Ast_Context |
| Arena-backed ownership context for AST nodes. More... | |
| struct | Compiler_Ast_Node |
| Abstract base class for all AST nodes. More... | |
| struct | Compiler_Binary_Expr |
| Node representing an infix binary operation. More... | |
| struct | Compiler_Block_Stmt |
| Node representing a braced sequence of statements. More... | |
| struct | Compiler_Break_Stmt |
| Node representing a loop break. More... | |
| struct | Compiler_Bytecode_Block_Info |
| Debug metadata that maps original IR basic blocks to bytecode PCs. More... | |
| struct | Compiler_Bytecode_Constant |
| One constant stored in a function-level constant pool. More... | |
| class | Compiler_Bytecode_Context |
| Arena-backed ownership context for bytecode functions and modules. More... | |
| struct | Compiler_Bytecode_Execution_Result |
| Result of one bytecode execution request. More... | |
| struct | Compiler_Bytecode_Function |
| Bytecode for one lowered function or top-level body. More... | |
| struct | Compiler_Bytecode_Instruction |
| One lowered bytecode instruction. More... | |
| class | Compiler_Bytecode_Lowering |
| Lowers explicit IR into register-based bytecode. More... | |
| struct | Compiler_Bytecode_Module |
| Bytecode module sharing global slot layout with the source IR module. More... | |
| struct | Compiler_Bytecode_Runtime_Error |
| Structured runtime error produced by the bytecode VM. More... | |
| struct | Compiler_Bytecode_Validation_Report |
| Structural validation report for one bytecode function or module. More... | |
| struct | Compiler_Bytecode_Value |
| One value stored in bytecode registers, locals, or globals. More... | |
| class | Compiler_Bytecode_VM |
Small portable VM for executing one Compiler_Bytecode_Module. More... | |
| class | Compiler_C_Backend |
Emits portable C from one validated Compiler_IR_Module. More... | |
| struct | Compiler_C_Backend_Emission |
| Result of one C backend emission request. More... | |
| struct | Compiler_C_Backend_Options |
| Options that control one C backend emission request. More... | |
| struct | Compiler_Call_Expr |
| Node representing a function or method call. More... | |
| struct | Compiler_CFG_Block |
| Represents a single basic block in a CFG. More... | |
| class | Compiler_CFG_Context |
| Arena-backed ownership context for CFG objects. More... | |
| struct | Compiler_CFG_Function |
| CFG representation of a single function or top-level body. More... | |
| class | Compiler_CFG_Lowering |
| Transformation engine that lowers typed HIR into reusable CFGs. More... | |
| struct | Compiler_CFG_Module |
| Aggregates all lowered CFGs for a compilation unit. More... | |
| struct | Compiler_CFG_Terminator |
| Detailed information about a block's termination. More... | |
| struct | Compiler_CFG_Validation_Report |
| Detailed results of a CFG structural validation. More... | |
| struct | Compiler_Continue_Stmt |
| Node representing a loop continuation. More... | |
| struct | Compiler_Dataflow_Bit_Set |
| Small reusable bit-set for slot-domain dataflow analyses. More... | |
| struct | Compiler_Dataflow_Constant |
| One propagated constant value in the local-slot lattice. More... | |
| struct | Compiler_Dataflow_Function_Analysis |
| Full dataflow result for one IR function or top-level body. More... | |
| struct | Compiler_Dataflow_Uninitialized_Read |
| One definite-assignment finding for an uninitialized local read. More... | |
| struct | Compiler_Dataflow_Validation_Report |
| Validation report for analysis and optimization passes. More... | |
| struct | Compiler_Dead_Code_Elimination_Result |
| Result of applying dead-code elimination to one IR function. More... | |
| class | Compiler_Driver |
| Reusable orchestration object for compiler pipeline experiments. More... | |
| struct | Compiler_Driver_Artifact |
| Stable text artifact produced during one pipeline run. More... | |
| struct | Compiler_Driver_Options |
| Immutable configuration shared by all runs of one driver object. More... | |
| struct | Compiler_Driver_Run_Output |
Structured output of a run action. More... | |
| struct | Compiler_Driver_Source |
| One logical input source handled by a compiler frontend. More... | |
| struct | Compiler_Enum_Decl |
Nominal top-level enum declaration with unit variants. More... | |
| struct | Compiler_Enum_Variant |
One named variant inside a parsed enum declaration. More... | |
| struct | Compiler_Expr |
| Abstract base class for expression nodes. More... | |
| struct | Compiler_Expr_Stmt |
| Node representing an expression evaluated as a statement. More... | |
| struct | Compiler_Expr_Type_Assignment |
| Recorded inferred type for one expression node. More... | |
| class | Compiler_Frontend |
| Abstract language frontend that can feed reusable drivers. More... | |
| struct | Compiler_Function_Decl |
| Node representing a top-level function declaration. More... | |
| struct | Compiler_Function_Type_Assignment |
| Recorded inferred type for one function declaration. More... | |
| struct | Compiler_Function_Type_Expr |
Function type syntax such as fn(Int, T) -> Bool. More... | |
| class | Compiler_Generic_Driver |
Reusable orchestration object built on top of Compiler_Frontend. More... | |
| struct | Compiler_Generic_Driver_Options |
Configuration shared by all runs of Compiler_Generic_Driver. More... | |
| struct | Compiler_Grouping_Expr |
| Node representing an expression explicitly wrapped in parentheses. More... | |
| struct | Compiler_HIR_Binary_Expr |
| Typed binary expression. More... | |
| struct | Compiler_HIR_Block_Stmt |
| Structured block statement. More... | |
| struct | Compiler_HIR_Break_Stmt |
break statement in HIR. More... | |
| class | Compiler_HIR_Builder |
| Small reusable helper that allocates and connects HIR nodes. More... | |
| struct | Compiler_HIR_Call_Expr |
| Typed function call expression. More... | |
| struct | Compiler_HIR_Constant_Expr |
| Typed constant expression. More... | |
| class | Compiler_HIR_Context |
| Arena-backed ownership context for HIR nodes. More... | |
| struct | Compiler_HIR_Continue_Stmt |
continue statement in HIR. More... | |
| struct | Compiler_HIR_Eval_Stmt |
| Expression statement in HIR. More... | |
| struct | Compiler_HIR_Expr |
| Base class for HIR expressions. More... | |
| struct | Compiler_HIR_Function |
| Typed HIR function. More... | |
| struct | Compiler_HIR_If_Stmt |
| Structured conditional statement. More... | |
| struct | Compiler_HIR_Invalid_Expr |
| Invalid HIR expression placeholder. More... | |
| struct | Compiler_HIR_Invalid_Stmt |
| Invalid HIR statement placeholder. More... | |
| struct | Compiler_HIR_Let_Stmt |
| Typed lexical binding statement. More... | |
| class | Compiler_HIR_Lowering |
| Lowers the MVP typed AST into HIR. More... | |
| struct | Compiler_HIR_Module |
| Top-level HIR module. More... | |
| struct | Compiler_HIR_Node |
| Base node carrying a source span. More... | |
| struct | Compiler_HIR_Param |
| Parameter metadata for one HIR function. More... | |
| struct | Compiler_HIR_Return_Stmt |
| Return statement in HIR. More... | |
| struct | Compiler_HIR_Stmt |
| Base class for HIR statements. More... | |
| struct | Compiler_HIR_Unary_Expr |
| Typed unary expression. More... | |
| struct | Compiler_HIR_Variable_Expr |
| Typed variable reference expression. More... | |
| struct | Compiler_HIR_While_Stmt |
| Structured while-loop statement. More... | |
| struct | Compiler_Identifier_Expr |
| Node representing a named identifier reference. More... | |
| struct | Compiler_If_Stmt |
| Node representing a conditional branch. More... | |
| struct | Compiler_Import_Decl |
| Abstract base class for top-level import declarations. More... | |
| struct | Compiler_Integer_Result |
| Result of compiler_integer_binary() and compiler_integer_negate(). More... | |
| struct | Compiler_Invalid_Expr |
| Placeholder node for expressions that failed to parse. More... | |
| struct | Compiler_Invalid_Import_Decl |
| Placeholder node for malformed import declarations. More... | |
| struct | Compiler_Invalid_Stmt |
| Placeholder node for statements that failed to parse. More... | |
| struct | Compiler_Invalid_Type_Decl |
| Placeholder node for malformed type declarations. More... | |
| struct | Compiler_Invalid_Type_Expr |
| Placeholder node for type syntax that failed to parse. More... | |
| struct | Compiler_IR_Block |
| One basic block of IR instructions. More... | |
| class | Compiler_IR_Builder |
| Small reusable helper that allocates and connects IR nodes. More... | |
| class | Compiler_IR_Context |
| Arena-backed ownership context for IR nodes. More... | |
| struct | Compiler_IR_Function |
| Lowered IR for one function or top-level body. More... | |
| struct | Compiler_IR_Instruction |
| One instruction producing an optional explicit result value. More... | |
| class | Compiler_IR_Lowering |
| Lowers typed HIR into explicit-value IR. More... | |
| struct | Compiler_IR_Module |
| Lowered IR module with shared global slots and functions. More... | |
| struct | Compiler_IR_Slot |
| One storage slot used by the IR. More... | |
| struct | Compiler_IR_Terminator |
| Explicit terminator for one IR basic block. More... | |
| struct | Compiler_IR_Validation_Report |
| Structural validation report for one IR module or function. More... | |
| struct | Compiler_Let_Stmt |
| Node representing a local variable binding. More... | |
| struct | Compiler_Let_Type_Assignment |
Recorded inferred type for one let binding. More... | |
| class | Compiler_Lexer |
| Token generator for a single source file. More... | |
| struct | Compiler_Lexer_Options |
| Configuration options for lexer behavior. More... | |
| class | Compiler_Line_Frontend |
| Small example frontend for a line-oriented language. More... | |
| struct | Compiler_Literal_Expr |
| Node representing a literal value. More... | |
| struct | Compiler_Module |
| Node representing a complete translation unit or module. More... | |
| struct | Compiler_Module_Ambiguous_Name |
| One ambiguous name tracked in a per-module name table. More... | |
| struct | Compiler_Module_Binding_Issue |
| One structural issue reported by the reusable module binder. More... | |
| struct | Compiler_Module_Binding_Result |
| Binding result over one linked module-surface view. More... | |
| struct | Compiler_Module_Bindings |
| Bound top-level names visible from one module. More... | |
| struct | Compiler_Module_Bound_Name |
| One top-level name successfully bound in a module namespace. More... | |
| struct | Compiler_Module_Dependency |
| One source-name dependency edge originating from one module. More... | |
| struct | Compiler_Module_Descriptor |
| One module descriptor consumed by the reusable resolver. More... | |
| struct | Compiler_Module_Export |
| One reusable top-level declaration exposed by a module surface. More... | |
| struct | Compiler_Module_Link_Result |
| Link result over module descriptors and module metadata. More... | |
| struct | Compiler_Module_Linkage |
| One linked module view under direct-import surface rules. More... | |
| struct | Compiler_Module_Linkage_Issue |
| One structural issue reported by the reusable module linker. More... | |
| struct | Compiler_Module_Metadata |
| Reusable metadata describing one parsed or analyzed module surface. More... | |
| struct | Compiler_Module_Name_Resolution |
| Structured result returned by reusable module-name resolution. More... | |
| struct | Compiler_Module_Name_Table |
| Cached top-level name table over all visible modules. More... | |
| struct | Compiler_Module_Name_Table_Entry |
| Cached top-level names for one module. More... | |
| struct | Compiler_Module_Resolution_Issue |
| One structured issue emitted by the reusable module resolver. More... | |
| struct | Compiler_Module_Resolution_Result |
| Resolution result for one set of source-name module descriptors. More... | |
| struct | Compiler_Module_Semantic_Environment |
| Semantic environments for all modules in one compilation unit set. More... | |
| struct | Compiler_Module_Semantic_Module |
| One namespace-separated semantic environment for a module. More... | |
| struct | Compiler_Module_Visible_Export |
| One visible top-level declaration in a linked module surface. More... | |
| class | Compiler_MVP_Frontend |
Compiler_Frontend implementation backed by the current MVP language stack. More... | |
| struct | Compiler_MVP_Frontend_Options |
| Options used by the MVP frontend adapter. More... | |
| struct | Compiler_Name_Resolution |
| Mapping from an identifier expression to its resolved symbol. More... | |
| struct | Compiler_Named_Type_Expr |
Named type syntax such as Int, Bool, or T. More... | |
| struct | Compiler_Param |
| Representation of a function parameter. More... | |
| struct | Compiler_Param_Type_Assignment |
| Recorded inferred type for one function parameter. More... | |
| class | Compiler_Parser |
Recursive-descent parser that produces an AST in Compiler_Ast_Context. More... | |
| struct | Compiler_Parser_Options |
| Parser configuration knobs for the MVP grammar. More... | |
| class | Compiler_Parser_Stream |
| Lightweight token stream facade for recursive-descent parsers. More... | |
| struct | Compiler_Return_Stmt |
| Node representing a return from the current function. More... | |
| class | Compiler_Semantic_Analyzer |
| Name-resolution and basic semantic checker for the MVP AST. More... | |
| struct | Compiler_Semantic_Options |
| Options controlling semantic analyzer behavior. More... | |
| struct | Compiler_Source_Import_Decl |
| Top-level import declaration naming one other source unit. More... | |
| struct | Compiler_SSA_Block |
| One SSA basic block containing phis, instructions, and a terminator. More... | |
| class | Compiler_SSA_Context |
| Arena-backed ownership context for SSA functions and modules. More... | |
| struct | Compiler_SSA_Dominance_Info |
| Dominance metadata computed for one SSA function. More... | |
| struct | Compiler_SSA_Function |
| SSA form for one function or top-level body lowered from IR. More... | |
| struct | Compiler_SSA_Instruction |
| One SSA instruction producing an optional explicit result value. More... | |
| class | Compiler_SSA_Lowering |
| Lowers non-SSA IR to SSA form for all reachable blocks. More... | |
| struct | Compiler_SSA_Module |
| SSA module sharing global slots with the source IR module. More... | |
| struct | Compiler_SSA_Parameter |
| SSA parameter definition that seeds renaming for one IR parameter slot. More... | |
| struct | Compiler_SSA_Phi |
| Phi node merging values for one original IR local slot. More... | |
| struct | Compiler_SSA_Terminator |
| Explicit terminator for one SSA basic block. More... | |
| struct | Compiler_SSA_Validation_Report |
| Validation report for one SSA function or module. More... | |
| struct | Compiler_Stmt |
| Abstract base class for statement nodes. More... | |
| struct | Compiler_Struct_Decl |
Nominal top-level struct declaration. More... | |
| struct | Compiler_Struct_Field |
One named field inside a parsed struct declaration. More... | |
| struct | Compiler_Symbol |
| One reusable symbol record tracked by lexical bindings. More... | |
| class | Compiler_Symbol_Bindings |
| Reusable lexical symbol table with stable ids and scope tracking. More... | |
| struct | Compiler_Symbol_Declare_Result |
| Structured result returned after one declaration attempt. More... | |
| struct | Compiler_Token |
| Lexical token representation with its value and location. More... | |
| struct | Compiler_Tuple_Type_Expr |
Tuple type syntax such as (Int, Bool). More... | |
| struct | Compiler_Type |
| One node inside the type graph. More... | |
| struct | Compiler_Type_Alias_Decl |
| Transparent top-level type alias declaration. More... | |
| class | Compiler_Type_Context |
| Context owning all compiler type nodes. More... | |
| struct | Compiler_Type_Decl |
| Abstract base class for top-level type declarations. More... | |
| struct | Compiler_Type_Expr |
| Abstract base class for parsed type-annotation syntax. More... | |
| class | Compiler_Type_Substitution |
| Mutable substitution from type variables to replacement types. More... | |
| class | Compiler_Type_Unifier |
| Structural unifier for compiler types. More... | |
| class | Compiler_Typed_Semantic_Analyzer |
| Inference-oriented semantic pass for the MVP compiler front-end. More... | |
| struct | Compiler_Typed_Semantic_Options |
| Options controlling the typed semantic pass. More... | |
| struct | Compiler_Unary_Expr |
| Node representing a prefix unary operation. More... | |
| struct | Compiler_Unify_Result |
| Outcome of one type-unification attempt. More... | |
| struct | Compiler_While_Stmt |
| Node representing a while-loop. More... | |
| class | Compute_Bipartite |
| Class that takes a bipartite graph and computes the partition sets. More... | |
| class | Compute_Bridges |
| Find bridge edges (isthmuses) of a connected undirected graph. More... | |
| class | Compute_Cut_Nodes |
| Computation of cut nodes (articulation points) of a graph. More... | |
| class | Compute_Cycle_In_Digraph |
| Determines if a digraph contains a cycle and constructs it. More... | |
| class | Compute_Maximum_Cardinality_Bipartite_Matching |
| Class for computing the maximum cardinality matching of a bipartite graph. More... | |
| class | Compute_Maximum_Cardinality_General_Matching |
| Functor wrapper for maximum cardinality general matching. More... | |
| class | Compute_Maximum_Weight_General_Matching |
| Functor wrapper for weighted blossom matching. More... | |
| class | Compute_Min_Cut |
| Functor wrapper for compute_min_cut(). More... | |
| class | Compute_Minimum_Cost_General_Matching |
| Functor wrapper for minimum-cost general matching. More... | |
| class | Compute_Minimum_Cost_Perfect_General_Matching |
| Functor wrapper for minimum-cost perfect general matching. More... | |
| class | ConcurrentHashMap |
Sharded concurrent hash map: Shards independently-locked DynMapHashTable partitions, no single global lock. More... | |
| class | Const_Arc_Iterator |
| Read-only iterator on the arcs of a graph. More... | |
| class | Const_Graph_View |
| Strict read-only view of a graph. More... | |
| class | Const_Iterator |
| Read-only view of an Aleph iterator: the iterator of a constant container. More... | |
| class | const_mem_fun1_ref_t |
| class | const_mem_fun1_ref_t< void, _Tp, _Arg > |
| class | const_mem_fun1_t |
| class | const_mem_fun1_t< void, _Tp, _Arg > |
| class | const_mem_fun_ref_t |
| class | const_mem_fun_ref_t< void, _Tp > |
| class | const_mem_fun_t |
| class | const_mem_fun_t< void, _Tp > |
| class | Const_Node_Arc_Iterator |
| Read-only iterator on the arcs of a node. More... | |
| class | Const_Node_Iterator |
| Read-only iterator on the nodes of a graph. More... | |
| class | ConstrainedDelaunayTriangulation |
| Constrained Delaunay Triangulation via Sloan's flip-based method. More... | |
| class | Constraint_Set |
| Ordered collection of equality constraints. More... | |
| struct | ContinueSearch |
| Default solution visitor that always continues the search. More... | |
| class | Convex_Hull_Trick |
| Convex Hull Trick for minimum queries. More... | |
| class | ConvexPolygonDecomposition |
| Decompose a simple polygon into convex parts using Hertel-Mehlhorn. More... | |
| class | ConvexPolygonDistanceGJK |
| Distance between two closed convex polygons using GJK. More... | |
| class | ConvexPolygonIntersectionBasic |
| Basic exact intersection for closed convex polygons. More... | |
| class | ConvexPolygonOffset |
| Inward (erosion) and outward (dilation) offset of convex polygons. More... | |
| class | Cookie_Guard |
| RAII guard that clears graph cookies on destruction. More... | |
| class | Cookie_Saver |
| RAII guard that saves and restores graph cookies. More... | |
| class | Copy_Graph |
| Filtered copy of graphs. More... | |
| class | Count_Min_Sketch |
| Count-Min Sketch frequency estimator. More... | |
| class | CsvReader |
| Lazy CSV reader for large files. More... | |
| class | CsvRow |
| A CSV row with header-based field access. More... | |
| class | Cuckoo_Filter |
| Industrial-grade Cuckoo Filter implementation. More... | |
| class | CuttingEarsTriangulation |
| Polygon triangulation using the ear-cutting algorithm. More... | |
| struct | Decompose_Flow |
| Functor wrapper for flow decomposition. More... | |
| struct | default_accessor |
Trivial accessor policy: access(p, i) is just p[i]. More... | |
| struct | Default_Col_Formatter |
| Default column index formatter. More... | |
| struct | Default_Entry_Formatter |
| Default entry formatter. More... | |
| struct | Default_Operation_On_Arc |
| Default no-op operation for arc initialization. More... | |
| struct | Default_Operation_On_Node |
| Default no-op operation for node initialization. More... | |
| struct | Default_Row_Formatter |
| Default row index formatter. More... | |
| struct | Default_Visit_Op |
| Default visit operation for traversals (never stops). More... | |
| struct | DefaultMonoid |
| Default (no-op) monoid for connectivity-only usage. More... | |
| class | DelaunayTriangulationBowyerWatson |
| Exact Delaunay triangulation using the Bowyer-Watson incremental algorithm. More... | |
| class | DelaunayTriangulationRandomizedIncremental |
| O(n log n) expected-time Delaunay's triangulation. More... | |
| class | Depth_First_Backtracking |
| Recursive depth-first backtracking over an implicit state space. More... | |
| class | Depth_First_Traversal |
| Stateful depth-first traversal functor. More... | |
| struct | Df_Low_Key |
| Key of a node of a depth-first tree with df and low numbers. More... | |
| struct | Dfs_Arc_Frame |
| The next arc of a node to look at, for a depth-first search that keeps only that in a frame. More... | |
| class | Dfs_Stack |
| Stack of the frames of a depth-first search that does not recurse. More... | |
| struct | Dft_Arc_Attr |
| struct | Dft_Arc_Cmp |
| Default arc comparison class for Arcs_Index. More... | |
| struct | Dft_Arc_Reader |
| struct | Dft_Arc_Writer |
| struct | Dft_Certificate_Node_Label |
| Default node labeler for certificate export. More... | |
| struct | Dft_Copy_Arc |
| Default copy arc functor. More... | |
| struct | Dft_Copy_Node |
| Default copy node functor. More... | |
| struct | Dft_Df_Tree_Label |
Default label of a graph node: its information, written with operator <<. More... | |
| class | Dft_Dist |
| Default distance accessor for arc weights. More... | |
| struct | Dft_Filter_Op |
| Default filter operation (always true). More... | |
| struct | Dft_Fold_Op |
| Default folding operation (returns default-constructed accumulator). More... | |
| struct | Dft_Goal_Node |
| struct | Dft_Init_Rand_Arc |
| Default arc initializer for random graph generation. More... | |
| struct | Dft_Init_Rand_Node |
| Default node initializer for random graph generation. More... | |
| struct | Dft_Load_Arc |
| Default arc loading functor for binary and text modes. More... | |
| struct | Dft_Load_Node |
| Default node loading functor for binary and text modes. More... | |
| struct | Dft_Map_Op |
| Default mapping operation: the conversion of the item, which is its copy when the two types are the same. More... | |
| struct | Dft_Node_Attr |
| struct | Dft_Node_Cmp |
| Default node comparison class for Nodes_Index. More... | |
| struct | Dft_Node_Reader |
| struct | Dft_Node_Writer |
| struct | Dft_Pair_Cmp |
| Default comparator for pair types in hash maps. More... | |
| struct | Dft_Show_Arc |
| Default filter for filtered iterators on arcs. More... | |
| struct | Dft_Show_Node |
| Default filter for the graph nodes. More... | |
| struct | Dft_Store_Arc |
| Default arc storage functor for binary and text modes. More... | |
| struct | Dft_Store_Node |
| Default node storage functor for binary and text modes. More... | |
| struct | Dft_Write |
| class | DftTreeNodeAllocator |
| struct | Diagnostic |
| Fully accumulated diagnostic. More... | |
| class | Diagnostic_Builder |
| Fluent builder used to enrich a just-created diagnostic. More... | |
| class | Diagnostic_Engine |
| Diagnostic accumulator and renderer. More... | |
| struct | Diagnostic_Label |
| Span annotation attached to a diagnostic. More... | |
| class | Dial_Min_Paths |
| Dial's algorithm for shortest paths with integer weights. More... | |
| class | Digraph |
| Generic directed graph (digraph) wrapper template. More... | |
| class | Digraph_Iterator |
| Filtered iterator on directed graphs. More... | |
| class | Dijkstra_Min_Paths |
| Spanning tree calculation of all shortest paths from a given node according to Dijkstra's algorithm. More... | |
| struct | Dinic_Maximum_Flow |
| Functor wrapper for Dinic's algorithm. More... | |
| struct | Dinic_Node_Info |
| Level information for Dinic's algorithm. More... | |
| class | Directed_Find_Path |
| Path search on directed graphs defined through a graph class (not a digraph). More... | |
| struct | Distance_Compare |
| Comparison functor for arc weights/distances. More... | |
| struct | Distinct_Count_Policy |
| Policy: count distinct elements in a range. More... | |
| struct | Divide_Conquer_DP_Result |
| Result of divide-and-conquer partition DP optimization. More... | |
| struct | divides |
| class | Dlink |
| Doubly linked circular list node. More... | |
| class | Dnode |
| Node belonging to a double circular linked list with header node. More... | |
| struct | DotExportOptions |
| Options for DOT export. More... | |
| class | DouglasPeuckerSimplification |
| Douglas-Peucker polyline simplification. More... | |
| class | DSatur_Coloring |
| Functor wrapper for dsatur_coloring. More... | |
| struct | Dummy_Attr |
| class | Dyn_Slist_Nc |
Dynamic list of elements of type T. More... | |
| class | DynArray |
| class | DynArray_Set |
| Set-like container backed by a dynamic array. More... | |
| class | DynArrayHeap |
Dynamic heap (priority queue) backed by DynArray. More... | |
| class | DynBinHeap |
Dynamic heap of elements of type T ordered by a comparison functor. More... | |
| class | DynDlist |
| Dynamic doubly linked list with O(1) size and bidirectional access. More... | |
| class | DynHashTable |
| Self-adjusting dynamic hash table. More... | |
| class | DynIntervalTree |
| High-level interval tree with automatic memory management. More... | |
| class | DynLhashTable |
| Dynamic hash table mapping keys to records with separate chaining. More... | |
| class | DynList |
| Doubly-linked list (defined in tpl_dynList.H). More... | |
| class | DynListQueue |
Dynamic queue of elements of generic type T based on single linked list. More... | |
| class | DynListStack |
| Dynamic stack of elements of generic type T based on a singly linked list. More... | |
| class | DynMapAvlTree |
| Dynamic map implemented with an AVL tree. More... | |
| class | DynMapBinTree |
| Dynamic map implemented with a classic binary search tree. More... | |
| class | DynMapHashTable |
| class | DynMapRandTree |
| Dynamic map implemented with a randomized BST. More... | |
| class | DynMapRbTree |
| Dynamic map implemented with a red-black tree. More... | |
| class | DynMapSplayTree |
| Dynamic map implemented with a splay tree. More... | |
| class | DynMapTreap |
| Dynamic map implemented with a treap. More... | |
| class | DynMapTreapRk |
| Dynamic map implemented with a ranked treap. More... | |
| class | DynMapTree |
| Generic key-value map implemented on top of a binary search tree. More... | |
| class | DynMatrix |
| Dynamic matrix with sparse storage. More... | |
| class | DynSetAvlRkTree |
| Dynamic set implemented using extended AVL binary search trees with rank support of type Avl_Tree_Rk<Key>. More... | |
| class | DynSetAvlTree |
| Dynamic set implemented using AVL binary search trees of type Avl_Tree<Key>. More... | |
| class | DynSetBinTree |
| Dynamic set implemented using binary search trees of type BinTree<Key>. More... | |
| class | DynSetHtdRbRkTree |
| Dynamic set implemented using Hybrid Red-Black trees with rank support of type HtdRbTreeRk<Key>. More... | |
| class | DynSetHtdRbTree |
| Dynamic set implemented using Hybrid Top-Down/Bottom-Up Red-Black trees of type HtdRbTree<Key>. More... | |
| struct | DynSetLhash |
| Hash-based dynamic set (defined in tpl_dynSetHash.H). More... | |
| struct | DynSetLinHash |
| class | DynSetRandTree |
| Dynamic set implemented using randomized binary search trees of type Rand_Tree<Key>. More... | |
| class | DynSetRbRkTree |
| Dynamic set implemented using extended Red-Black binary search trees with rank support of type Rb_Tree_Rk<Key> (bottom-up implementation). More... | |
| class | DynSetRbTree |
| Dynamic set implemented using Red-Black binary search trees of type Rb_Tree<Key> (bottom-up implementation). More... | |
| class | DynSetSplayRkTree |
| Dynamic set implemented using splay trees with rank support of type Splay_Tree_Rk<Key>. More... | |
| class | DynSetSplayTree |
| Dynamic set implemented using splay binary search trees of type Splay_Tree<Key>. More... | |
| class | DynSetTdRbRkTree |
| Dynamic set implemented using Top-Down Red-Black binary search trees with rank support of type TdRbTreeRk<Key>. More... | |
| class | DynSetTdRbTree |
| Dynamic set implemented using Top-Down Red-Black binary search trees of type TdRbTree<Key>. More... | |
| class | DynSetTreap |
| Dynamic set implemented using randomized treap binary search trees of type Treap<Key>. More... | |
| class | DynSetTreapRk |
| Dynamic set implemented using extended treap binary search trees with rank support of type Treap_Rk<Key>. More... | |
| class | DynSetTree |
| Dynamic set backed by balanced binary search trees with automatic memory management. More... | |
| class | DynSkipList |
| Dynamic ordered set implemented with a Skip List. More... | |
| class | DynSlist |
Dynamic list of elements of type T implemented with a singly linked list of nodes. More... | |
| struct | DynTreapTree |
| Dynamic mapping implemented with treap trees. More... | |
| class | Edge_Connectivity |
| Functor wrapper for edge_connectivity(). More... | |
| struct | Edmonds_Karp_Maximum_Flow |
| Functor wrapper for edmonds_karp_maximum_flow(). More... | |
| class | Ellipse |
| An axis-aligned ellipse. More... | |
| struct | Empty_Class |
| Empty placeholder class with no data members. More... | |
| struct | Empty_Node |
| class | EnumZipIterator< C > |
| Base case of EnumZipIterator: the read-only iterator of the last container, which also counts the position. More... | |
| class | Eppstein_K_Shortest_Paths |
| Functor wrapper for Eppstein-style k-shortest paths API. More... | |
| struct | Equal_Node |
| Functor to compare nodes by their ID. More... | |
| struct | equal_to |
| struct | Equality_Constraint |
Equality constraint between two values of type T. More... | |
| struct | Euclidean_Heuristic |
| Euclidean distance heuristic for A* in 2D grids. More... | |
| class | Euclidian_Arc |
| class | Euclidian_Digraph |
| class | Euclidian_Graph |
| class | Euclidian_Node |
| struct | Euler_Tour_LCA |
| LCA on a min-heap Cartesian Tree. More... | |
| struct | ExceptionBuilder |
| Exception constructor with formatted message. More... | |
| class | expected |
Minimal std::expected-style result type for C++20. More... | |
| class | expected< void, E > |
Specialization of expected for void value type. More... | |
| struct | ExplorationPolicy |
| Exploration controls shared across engines. More... | |
| class | extents |
Shape (per-axis sizes) of an mdspan, mixing compile-time and run-time extents. More... | |
| struct | Fenwick_Tree |
| Fenwick tree for arithmetic types with find_kth support. More... | |
| class | FFT |
| Fast Fourier Transform (FFT) and DSP Toolkit. More... | |
| class | Fibonacci_Heap |
| Implementation of a Fibonacci Heap priority queue. More... | |
| class | Field |
| struct | Fifo_Preflow_Maximum_Flow |
| Functor wrapper for fifo_preflow_maximum_flow(). More... | |
| class | Filter_Iterator |
| Generic filter iterator wrapper. More... | |
| class | Find_Aumenting_Path |
| Augmenting-path search over a directed network. More... | |
| class | Find_Breadth_First_Spanning_Tree |
| Compute a breadth-first spanning tree of a graph. More... | |
| class | Find_Depth_First_Spanning_Tree |
| Compute a depth-first spanning tree of a graph. More... | |
| class | Find_Eulerian_Path |
| Finds and constructs an Eulerian path or cycle using Hierholzer's algorithm. More... | |
| class | Find_Min_Path |
| Functor wrapper for find_min_path. More... | |
| class | Find_Path_Breadth_First |
| Performs a breadth-first search for a path between a pair of nodes. More... | |
| class | Find_Path_Depth_First |
| Performs a depth-first search for a path between a pair of nodes. More... | |
| class | FixedQueue |
| Very simple queue implemented with a contiguous array. More... | |
| class | FixedStack |
| Fixed length stack. More... | |
| class | FlatMap |
| Ordered map stored as two parallel sorted contiguous arrays. More... | |
| class | FlatSet |
| Ordered set stored as a sorted contiguous array. More... | |
| struct | FlowCycle |
| Represents a flow cycle in the network. More... | |
| struct | FlowDecomposition |
| Result of flow decomposition. More... | |
| struct | FlowPath |
| Represents a flow path from source to sink. More... | |
| struct | FlowStatistics |
| Statistics about a network flow. More... | |
| class | Floyd_All_Shortest_Paths |
Compute the all-pairs shortest path distance matrix and the path reconstruction matrix for a graph g using the Floyd-Warshall algorithm. More... | |
| class | For_Each_In_Order |
| Generic inorder traversal of a binary tree. More... | |
| class | For_Each_Postorder |
| Generic postorder traversal of a binary tree. More... | |
| class | For_Each_Preorder |
| Generic preorder traversal of a binary tree. More... | |
| struct | Ford_Fulkerson_Maximum_Flow |
| Functor wrapper for ford_fulkerson_maximum_flow(). More... | |
| struct | Found_Item |
| Abstract base class for optional-like results. More... | |
| class | FunctionalMixin |
| CRTP Mixin providing functional programming operations. More... | |
| struct | FunnelTraceResult |
| Full trace for shortest-path funnel processing. More... | |
| struct | FunnelTraceStep |
| One SSFA (funnel) iteration snapshot. More... | |
| struct | GcdMonoid |
| GCD monoid: identity = 0 (since gcd(0, x) = x), combine = gcd. More... | |
| class | Gen_Avl_Tree |
| AVL balanced binary search tree. More... | |
| class | Gen_Avl_Tree_Rk |
| AVL balanced binary search tree with rank (order statistics). More... | |
| class | Gen_B_Tree |
| Generic B-Tree with configurable minimum degree. More... | |
| class | Gen_Binary_Lifting_LCA |
| LCA via binary lifting on a rooted tree. More... | |
| class | Gen_BPlus_Tree |
| Generic B+ Tree with configurable minimum degree. More... | |
| class | Gen_Cartesian_Tree |
| Explicit Cartesian Tree built in O(n) with a monotonic stack. More... | |
| class | Gen_Cartesian_Tree_RMQ |
| O(1) static range queries via the Cartesian Tree reduction. More... | |
| class | Gen_Centroid_Decomposition |
| Centroid decomposition over a rooted tree represented as an Aleph graph. More... | |
| class | Gen_Disjoint_Sparse_Table |
| Disjoint Sparse Table over an arbitrary associative binary operation. More... | |
| class | Gen_Euler_RMQ_LCA |
| LCA via Euler tour + RMQ on depth in a rooted tree. More... | |
| class | Gen_Euler_Tour_LCA |
| Lowest Common Ancestor queries in O(1) via Euler Tour reduction to RMQ on a Cartesian Tree. More... | |
| class | Gen_Fenwick_Tree |
| Fenwick tree over an arbitrary abelian group. More... | |
| class | Gen_File_B_Map |
| Persistent ordered map backed by a paged File_B_Tree. More... | |
| class | Gen_File_B_Tree |
| Persistent page-managed B-Tree stored in a single binary file. More... | |
| class | Gen_File_BPlus_Map |
| Persistent ordered map backed by a paged File_BPlus_Tree. More... | |
| class | Gen_File_BPlus_Tree |
| Persistent page-managed B+ Tree stored in a single binary file. More... | |
| class | Gen_Heavy_Light_Decomposition |
| Heavy-Light Decomposition over a rooted tree represented as an Aleph graph. More... | |
| class | Gen_HLD |
| Heavy-Light Decomposition with segment tree for path/subtree queries. More... | |
| class | Gen_HLD_Path_Query |
| Segment-tree-powered path/subtree queries over an HLD layout. More... | |
| class | Gen_Interval_Tree |
| Augmented treap storing intervals with overlap/stabbing queries. More... | |
| class | Gen_Lazy_Segment_Tree |
| Lazy segment tree with range update and range query. More... | |
| class | Gen_Link_Cut_Tree |
| Dynamic forest with path queries via Link-Cut Trees. More... | |
| class | Gen_Link_Cut_Tree_WithEdges |
| Link-Cut Tree with edge weights and path aggregations. More... | |
| class | Gen_Mo_Algorithm |
| Offline range query engine using Mo's algorithm. More... | |
| class | Gen_Mo_On_Tree_Node |
| Offline subtree and path queries on N-ary trees (Tree_Node). More... | |
| class | Gen_Mo_On_Trees |
| Offline subtree and path queries on trees via Mo's algorithm. More... | |
| class | Gen_MultiPolynomial |
| Sparse multivariate polynomial. More... | |
| class | Gen_Polynomial |
| Univariate polynomial over a generic coefficient ring. More... | |
| class | Gen_Rand_Tree |
| Randomized binary search tree with rank support. More... | |
| class | Gen_Rb_Tree |
| Red-black binary search tree implementation (bottom-up). More... | |
| class | Gen_Rb_Tree_Rk |
| Red-black tree with rank support (select/position operations). More... | |
| class | Gen_Reroot_DP |
| Generic rerooting dynamic programming (all-roots DP). More... | |
| class | Gen_Segment_Tree |
| Segment tree over an arbitrary associative binary operation. More... | |
| class | Gen_Sparse_Table |
| Sparse Table over an arbitrary associative and idempotent binary operation. More... | |
| class | Gen_Treap |
| Treap - A randomized binary search tree using heap-ordered priorities. More... | |
| class | Gen_Treap_Rk |
| Extended Treap with rank support for O(log n) indexed access. More... | |
| class | Gen_Tree_DP |
| Generic bottom-up tree dynamic programming. More... | |
| class | GenBinHeap |
| Generic heap of nodes. More... | |
| class | GenBinTree |
| Simple (unbalanced) binary search tree. More... | |
| struct | Generate_Graphviz |
| Functor for generating Graphviz specifications. More... | |
| class | Generator |
Lazy, single-pass sequence of T values produced by a coroutine. More... | |
| class | GenLhashTable |
| Generic hash table with collision resolution by separate chaining. More... | |
| class | GenLinearHashTable |
| Generic linear hash table. More... | |
| class | GenTdRbTree |
| Top-down red-black binary search tree implementation. More... | |
| class | GenTdRbTreeRk |
| Top-down red-black tree with rank support (select/position). More... | |
| struct | Geom_Object |
| Base class for all geometric objects. More... | |
| class | GeomBowyerWatsonUtils |
| Shared Bowyer-Watson core parameterized by in-circle predicate. More... | |
| class | GeomPolygonUtils |
| Shared polygon helpers used across multiple geometry algorithms. More... | |
| class | GeomSerializer |
| Serialization utilities for geometry objects. More... | |
| class | GeomTriangleAdjacencyUtils |
| Shared edge-group extraction for triangle meshes. More... | |
| class | GiftWrappingConvexHull |
| Gift wrapping (Jarvis march) convex hull algorithm. More... | |
| class | GrahamScanConvexHull |
| Graham scan convex hull algorithm. More... | |
| class | Graph_Aarc |
| class | Graph_Anode |
Node of Array_Graph More... | |
| struct | Graph_Arc |
| Arc of graph implemented with double-linked adjacency lists. More... | |
| struct | Graph_Attr |
| General attributes for nodes and arc of graphs. More... | |
| struct | Graph_Node |
| Node belonging to a graph implemented with a double linked adjacency list. More... | |
| class | Graph_Sarc |
| Arc for graphs implemented with simple adjacency lists. More... | |
| struct | Graph_Snode |
| Node for graphs implemented with simple adjacency lists. More... | |
| class | Graph_To_Tree_Node |
| Functor class to convert a tree graph to Tree_Node structure. More... | |
| class | Graph_Traverse_Generator |
| Lazily traverse a graph depth-first or breadth-first. More... | |
| class | GraphCopyWithMapping |
| Graph copy with explicit node mapping. More... | |
| struct | greater |
| struct | greater_equal |
| class | Greedy_Coloring |
| Functor wrapper for greedy_coloring. More... | |
| struct | Grevlex_Order |
| Graded reverse lexicographic monomial order (default). More... | |
| struct | Grlex_Order |
| Graded lexicographic monomial order. More... | |
| class | Gsl_Compatible_Rng |
A random number generator with the sequences of GSL's gsl_rng_mt19937. More... | |
| class | Gsl_Compatible_Rng_Owner |
A Gsl_Compatible_Rng in dynamic memory, so that what holds it grows only by a pointer, as with the gsl_rng of before. More... | |
| class | HalfPlaneIntersection |
| Exact bounded intersection of half-planes. More... | |
| class | Has_Cycle |
| Determines whether a graph contains cycles. More... | |
| struct | HashMap |
| struct | HashSet |
| struct | Heap_Preflow_Maximum_Flow |
| Functor wrapper for heap_preflow_maximum_flow(). More... | |
| class | History_Heuristic_Table |
| Sparse history heuristic table over Aleph hash maps. More... | |
| struct | HLD_Max |
| HLD with path/subtree max queries. More... | |
| struct | HLD_Min |
| HLD with path/subtree min queries. More... | |
| struct | HLD_Sum |
| HLD with path/subtree sum queries. More... | |
| struct | HLPP_Maximum_Flow |
| Functor wrapper for HLPP. More... | |
| struct | HLPP_Node_Info |
| Node info for HLPP algorithm. More... | |
| struct | HLPP_Node_Info< Flow_Type, true > |
| Node information of HLPP for a floating flow. More... | |
| struct | Hopcroft_Karp_Frame |
| A left node that the search for an augmenting path goes through, and the next of its arcs to look at, with a copy of the filter of the search. More... | |
| class | Hopcroft_Karp_Matching |
| Functor wrapper for hopcroft_karp_matching. More... | |
| struct | Howard_Mean_Cycle_Result |
Result of howard_minimum_mean_cycle(). More... | |
| class | HtdRbTree |
| Hybrid top-down/bottom-up red-black tree. More... | |
| class | HtdRbTreeRk |
| Hybrid top-down/bottom-up red-black tree with rank support. More... | |
| class | HtdRbTreeRkVtl |
| Hybrid RB tree with rank and virtual destructor. More... | |
| class | HtdRbTreeVtl |
| Hybrid red-black tree with virtual node destructor. More... | |
| class | HTList |
| Single linked list of nodes. More... | |
| class | Huffman_Decoder_Engine |
| Huffman decoder. More... | |
| class | Huffman_Encoder_Engine |
| Huffman encoder. More... | |
| struct | Huffman_Node |
| class | Hungarian_Assignment |
| Implementation of the Hungarian (Munkres) algorithm. More... | |
| struct | Hungarian_Result |
| Result of the Hungarian assignment algorithm. More... | |
| class | HyperLogLog |
| HyperLogLog cardinality estimator. More... | |
| class | IDA_Star |
| IDA* algorithm for memory-efficient shortest path search. More... | |
| class | IDA_Star_State_Search |
| IDA* engine for implicit state spaces with an admissible heuristic. More... | |
| struct | IDAStarIteration |
| Result of one threshold pass of IDA*. More... | |
| struct | IDAStarResult |
| Aggregated result of a complete IDA* run. More... | |
| class | In_Arcs_Index |
| Index of the arcs that go into each node of a graph. More... | |
| class | In_Iterator |
| Filtered iterator for incoming arcs of a node. More... | |
| class | In_Iterator< GT, SA > |
| Filtered iterator for incoming arcs of a node of a digraph type. More... | |
| class | Index_Graph |
| Builds node and arc indices for fast lookup and retrieval. More... | |
| struct | index_tuple |
| A type that represents a parameter pack of zero or more integers. More... | |
| class | IndexArc |
| Index for fast arc lookup by its endpoint nodes. More... | |
| class | IndexNode |
| Builds an index of nodes for fast search and retrieval. More... | |
| struct | Init_Arc |
| class | Init_Guard |
| RAII guard for graph algorithm initialization. More... | |
| struct | Init_P |
| struct | Init_Prim_Info |
| struct | Initialize_Dist |
| Matrix initialization functor for Floyd-Warshall. More... | |
| class | InlineStack |
| Stack of fixed capacity whose storage is inside the object. More... | |
| struct | Interpreter_Binding |
| One lexical binding inside an interpreter environment. More... | |
| class | Interpreter_Environment |
| Nested runtime environment with lexical lookup semantics. More... | |
| struct | Interpreter_Execution_Result |
| Result of evaluating one expression, statement, module, or call. More... | |
| class | Interpreter_Runtime |
| Structured runtime for executing typed HIR. More... | |
| struct | Interpreter_Runtime_Error |
| Structured runtime error. More... | |
| struct | Interpreter_Runtime_Options |
| Runtime options for the HIR evaluator. More... | |
| struct | Interpreter_Tuple_Storage |
| Heap-owned tuple payload for recursive runtime values. More... | |
| struct | Interpreter_Value |
| One runtime value. More... | |
| struct | Interval |
| Closed interval [low, high]. More... | |
| struct | interval_endpoint |
| Trait to extract endpoint type from Interval<T>. More... | |
| struct | interval_endpoint< Interval< T > > |
| Specialization for Interval<T>. More... | |
| struct | Interval_Less |
| BST comparator for intervals: order by (low, then high). More... | |
| struct | Interval_Tree |
| Interval tree using nodes without virtual destructor. More... | |
| class | Interval_Tree_Node |
| Interval tree node with sentinel support. More... | |
| class | Interval_Tree_Node_Data |
| Data portion of an interval tree node. More... | |
| class | Interval_Tree_NodeVtl |
| Interval tree node with virtual destructor. More... | |
| struct | Interval_Tree_Vtl |
| Interval tree using nodes with virtual destructor. More... | |
| struct | IntRange |
| Integer range domain [start, end] with optional step. More... | |
| class | Inversed_Compare |
| Performs order reversal of Compare by swapping operands. More... | |
| class | Invert_Digraph |
| Functor for computing the transposed digraph, filtering arcs. More... | |
| class | IO_Graph |
| Graph serialization and deserialization class. More... | |
| struct | is_counted_lazy_tag |
| Metafunction to check if a tag is a counted lazy tag. More... | |
| struct | is_counted_lazy_tag< AddLazyTag< T >, T > |
| Specialization for AddLazyTag. More... | |
| struct | is_counted_lazy_tag< AssignLazyTag< T >, T > |
| Specialization for AssignLazyTag. More... | |
| class | Is_Graph_Acyclique |
| Determines whether a graph is acyclic (contains no cycles). More... | |
| class | Is_Planar_Graph |
Functor wrapper for is_planar_graph(). More... | |
| struct | is_stream_insertable |
| struct | iterator_traits |
| Iterator traits for Aleph-w iterators. More... | |
| class | Johnson |
| Johnson's algorithm for all-pairs shortest paths. More... | |
| struct | K_Shortest_Path_Item |
| A shortest-path item returned by k-shortest algorithms. More... | |
| class | Karger_Min_Cut |
| Karger's randomized minimum cut algorithm. More... | |
| class | Karp_Minimum_Mean_Cycle |
| Functor wrapper for Karp minimum mean cycle. More... | |
| class | Karp_Minimum_Mean_Cycle_Value |
| Functor wrapper for value-only minimum mean cycle. More... | |
| class | KDTreePointSearch |
| Spatial point index for O(log n) nearest-neighbor queries. More... | |
| struct | KeepFirstSolution |
| Comparison policy that keeps the first solution seen. More... | |
| class | Kept_Filter |
| A filter that an algorithm object keeps: one given as an lvalue is used where it is, so that the caller sees what the algorithm does to it; one given as an rvalue is moved into the keeper, so that it lives as long as the object. More... | |
| class | Kept_Initializer |
| An initializer that a random generator keeps: one given as a modifiable lvalue is used where it is, so that the caller sees what the generator does to it; a temporary, or a const lvalue, is moved or copied into the generator, so that it lives as long as the generator. More... | |
| class | KeysMixin |
| CRTP Mixin for extracting keys from set-like containers. More... | |
| class | Killer_Move_Table |
| Two-slot killer heuristic table indexed by search depth. More... | |
| class | Killer_Move_Table< Move, false > |
| Specialized killer table for moves without equality support (no-op). More... | |
| class | Killer_Move_Table< Move, true > |
| Killer heuristic table for equality-comparable moves. More... | |
| struct | Knapsack_Item |
| An item for knapsack problems. More... | |
| struct | Knapsack_Result |
| Result of a knapsack computation. More... | |
| struct | Knuth_Optimization_Result |
| Result of Knuth interval-DP optimization. More... | |
| struct | Kosaraju_Connected_Components |
| Functor wrapper for Kosaraju's algorithm. More... | |
| class | Kruskal_Min_Spanning_Tree |
| Computes the minimum spanning tree of a graph using Kruskal's algorithm. More... | |
| struct | layout_left |
| Column-major layout: the first axis varies fastest (Fortran convention). More... | |
| struct | layout_right |
| Row-major layout: the last axis varies fastest (C convention). More... | |
| struct | Lazy_Max_Segment_Tree |
| Lazy segment tree for range add + range max. More... | |
| struct | Lazy_Min_Segment_Tree |
| Lazy segment tree for range add + range min. More... | |
| struct | Lazy_Sum_Segment_Tree |
| Lazy segment tree for range add + range sum. More... | |
| struct | LCS_Result |
| Result for Longest Common Subsequence (LCS). More... | |
| class | Lengauer_Tarjan_Dominators |
| Computes dominator tree and dominance frontiers of a digraph using the Lengauer-Tarjan algorithm. More... | |
| class | Lengauer_Tarjan_Post_Dominators |
| Computes post-dominator tree and post-dominance frontiers of a digraph using the Lengauer-Tarjan algorithm on the reversed graph. More... | |
| struct | less |
| struct | less_equal |
| struct | Lex_Order |
| Lexicographic monomial order. More... | |
| struct | LhashBucketVtl |
| Bucket with virtual destructor for a hash table with collision resolution by separate chaining. More... | |
| struct | LhashTable |
| Generic hash table with collision resolution by separate chaining and buckets without virtual destructor. More... | |
| struct | LhashTableVtl |
| Generic hash table with collision resolution by separate chaining and buckets with virtual destructor. More... | |
| class | Li_Chao_Tree |
| Li Chao tree for min line queries on an integral x-domain. More... | |
| struct | LineEq |
| 2D infinite line in slope-intercept form. More... | |
| class | LineSweepFramework |
| Reusable event-driven sweep line framework. More... | |
| class | LinHashBucket |
| Bucket without virtual destructor for a hash table with collision resolution by separate chaining. More... | |
| class | LinHashBucketVtl |
| Bucket with virtual destructor for a hash table with collision resolution by separate chaining. More... | |
| struct | LIS_Result |
| Result of a Longest Increasing Subsequence computation. More... | |
| class | List_Graph |
| Graph implemented with double-linked adjacency lists. More... | |
| class | List_SGraph |
| Graph class implemented with singly-linked adjacency lists. More... | |
| class | LocateMixin |
| CRTP Mixin providing element location operations. More... | |
| struct | logical_and |
| struct | logical_not |
| struct | logical_or |
| struct | Longest_Common_Substring_Result |
| Result for longest common substring. More... | |
| struct | make_index_tuple |
| Unary metafunction that generates an index_tuple containing [0, Size). More... | |
| struct | Manacher_Result |
| Result object for Manacher's algorithm. More... | |
| struct | Manhattan_Heuristic |
| Manhattan distance heuristic for A* in grid graphs. More... | |
| class | Map_Matrix_Graph |
| Adjacency matrix mapped to an adjacency list graph. More... | |
| struct | MapODhash |
| Open addressing hash map using double hashing. More... | |
| struct | MapOLhash |
| Open addressing hash map using linear probing. More... | |
| struct | MapOpenHash |
| Open addressing hash map for key-value pairs. More... | |
| class | Mat_Graph |
| class | Matrix |
| Sparse matrix with generic row and column domains. More... | |
| struct | Matrix_Chain_Result |
| Result of matrix-chain multiplication optimization. More... | |
| class | Matrix_Graph |
| Adjacency matrix storing copies of graph attributes. More... | |
| struct | Max_Cartesian_Tree |
| Cartesian Tree for max-heap (range maximum). More... | |
| struct | Max_Euler_Tour_LCA |
| LCA on a max-heap Cartesian Tree. More... | |
| struct | Max_Flow_Min_Cost_By_Cycle_Canceling |
| Functor wrapper for maximum flow minimum cost algorithm. More... | |
| struct | Max_Flow_Min_Cost_By_Network_Simplex |
| Functor wrapper for Network Simplex algorithm. More... | |
| struct | Max_Op |
| Functor returning the maximum of two values. More... | |
| struct | Max_Segment_Tree |
| Max Segment Tree for range maximum queries with point updates. More... | |
| struct | Max_Sparse_Table |
| Sparse Table for range maximum queries. More... | |
| struct | MaxFlowBenchmarkResult |
| Result of running a max-flow algorithm. More... | |
| struct | Maximize_Objective |
| Objective policy for maximization problems. More... | |
| struct | MaxMonoid |
| Max monoid: identity = numeric lowest, combine = max(a, b). More... | |
| struct | MCF_Arc |
| Arc information for multi-commodity flow. More... | |
| class | MCF_Graph |
| Multi-commodity flow network (directed graph). More... | |
| class | MCF_LP_Solver |
| Multi-commodity flow solver using LP formulation. More... | |
| struct | MCF_Result |
| Multi-commodity flow result. More... | |
| class | mdspan |
| Non-owning view of a contiguous buffer as a multidimensional grid. More... | |
| class | mem_fun1_ref_t |
| class | mem_fun1_ref_t< void, _Tp, _Arg > |
| class | mem_fun1_t |
| class | mem_fun1_t< void, _Tp, _Arg > |
| class | mem_fun_ref_t |
| class | mem_fun_ref_t< void, _Tp > |
| class | mem_fun_t |
| class | mem_fun_t< void, _Tp > |
| class | MemArray |
| Simple, scalable and fast dynamic array. More... | |
| struct | Min_Cost_Matching_Result |
| Result of minimum-cost matching. More... | |
| struct | Min_Cost_Perfect_Matching_Result |
| Result of minimum-cost perfect matching. More... | |
| struct | Min_Cut |
| Functor wrapper for min_cut(). More... | |
| struct | Min_Mean_Cycle_Result |
| Result of minimum mean cycle computation. More... | |
| struct | Min_Mean_Cycle_Value_Result |
| Lightweight minimum-mean-cycle value result. More... | |
| struct | Min_Op |
| Functor returning the minimum of two values. More... | |
| struct | Min_Segment_Tree |
| Min Segment Tree for range minimum queries with point updates. More... | |
| struct | MinCostFlowStats |
| Statistics for min-cost flow algorithms. More... | |
| class | MinHash |
| MinHash signature generator. More... | |
| struct | Minimize_Objective |
| Objective policy for minimization problems. More... | |
| class | MinimumEnclosingCircle |
| Smallest circle enclosing a point set (Welzl's algorithm). More... | |
| class | MinkowskiSumConvex |
| Exact Minkowski sum of two closed convex polygons. More... | |
| struct | MinMonoid |
| Min monoid: identity = numeric max, combine = min(a, b). More... | |
| struct | minus |
| struct | Mo_Query |
| A query for Mo's algorithm: inclusive range [l, r] with id. More... | |
| class | Modular_Matrix |
| Matrix operations modulo a prime. More... | |
| class | ModularCombinatorics |
| High-performance combinatorics operations modulo a prime. More... | |
| struct | modulus |
| struct | monoid_supports_counted_lazy |
| Metafunction to check if a monoid supports counted lazy tags. More... | |
| struct | monoid_supports_counted_lazy< Monoid, std::void_t< typename Monoid::supports_counted_lazy > > |
| Specialization for monoids with supports_counted_lazy member. More... | |
| struct | Monotone_Queue_DP_Result |
| Result of monotone-queue windowed DP transition. More... | |
| class | MonotonePolygonTriangulation |
| O(n log n) triangulation of simple polygons via y-monotone partition + linear-time monotone triangulation. More... | |
| struct | MoveOrderingStats |
| Statistics collected by engines that reorder successor batches. More... | |
| class | MpscQueue |
| Unbounded lock-free multi-producer/single-consumer queue. More... | |
| struct | multiplies |
| struct | My_P |
| Simple integer point used as node payload by the helper functors in this header. More... | |
| class | Naive_Suffix_Tree |
| Naive compressed suffix tree (didactic implementation). More... | |
| class | Negamax |
| Pure Negamax search over an implicit game tree. More... | |
| struct | negate |
| class | Negate_Compare |
| Comparator wrapper that inverts the comparison order. More... | |
| struct | Negative_Cycle_Item |
One negative cycle reported by find_disjoint_negative_cycles(). More... | |
| struct | Net_Arc |
| Arc of a flow network implemented with adjacency lists. More... | |
| struct | Net_Arc_Info |
| Arc info extension that stores capacity and flow values. More... | |
| class | Net_Cap_Graph |
| Capacitated network with node capacity constraints. More... | |
| class | Net_Cap_Node |
| Node with capacity constraint for flow networks. More... | |
| struct | Net_Cost_Arc |
| Arc type for maximum flow minimum cost networks. More... | |
| struct | Net_Cost_Graph |
| Capacitated flow network with costs associated to arcs. More... | |
| struct | Net_Filt |
| Arc filter for residual traversal in flow networks. More... | |
| struct | Net_Graph |
| Flow network implemented with adjacency lists. More... | |
| class | Net_Sup_Dem_Graph |
| Network graph with supply and demand nodes. More... | |
| class | Net_Sup_Dem_Node |
| Node with supply/demand flow value. More... | |
| class | Network_Simplex |
| Network Simplex algorithm for minimum cost flow. More... | |
| struct | NetworkGenParams |
| Parameters for random network generation. More... | |
| struct | NetworkSimplexStats |
| Execution statistics for Network Simplex algorithm. More... | |
| struct | Node_Arc_Iterator |
| Filtered iterator of adjacent arcs of a node. More... | |
| class | Node_Iterator |
| Filtered iterator on the nodes of a graph. More... | |
| struct | node_traits |
| class | Nodes_Index |
| Builds a node index for fast lookup and retrieval. More... | |
| struct | NoLazyTag |
| No-op lazy tag (default — no deferred path updates). More... | |
| struct | None |
| Represents a missing value. More... | |
| struct | NonPlanar_Certificate_Export_Options |
| Export options for non-planar certificate serializers. More... | |
| struct | NonPlanar_Certificate_Validation |
| Structural validation report for non-planar certificates. More... | |
| struct | not_equal_to |
| class | Now |
| Class Now is a practical class for timing based in a high resolution clock. More... | |
| class | NTT |
Number Theoretic Transform over Z / MOD Z. More... | |
| class | NTTExact |
| Exact polynomial multiplication via three-prime NTT + CRT. More... | |
| struct | NTTPrime |
| Metadata for an NTT-friendly prime used in CRT reconstruction. More... | |
| struct | Null_Adversarial_Search_Tracer |
| Default no-op tracer used when the caller does not request tracing. More... | |
| struct | Null_History_Heuristic_Table |
| Null history heuristic hook used when a domain has no move key. More... | |
| class | ObjectiveIncumbent |
| Global incumbent manager for branch and bound. More... | |
| class | ODhashTable |
| Open addressing hash table with double hashing collision resolution. More... | |
| class | OLhashTable |
| Open addressing hash table with linear probing collision resolution. More... | |
| class | Operate_On_Arcs |
| Functor that traverses the arcs of a graph and performs an operation. More... | |
| class | Operate_On_Nodes |
| Functor that traverses the nodes of a graph and performs an operation. More... | |
| class | operation_canceled |
| Exception thrown when cooperative cancellation is observed. More... | |
| struct | OptimizationSolution |
| Snapshot of a complete optimization solution. More... | |
| class | Out_Iterator |
| Filtered iterator for outcoming arcs of a node. More... | |
| class | Packed_Matrix |
| Matrix whose columns are bit fields: an Aleph::Array of Packed_Row. More... | |
| class | Packed_Row |
| Tuple of small integers packed into the fewest whole words. More... | |
| struct | Painted_Min_Spanning_Tree |
| Filter of painter arcs with that are set the Spanning_Tree control bit. More... | |
| class | Pair_Iterator |
| Iterator that zips two other iterators. More... | |
| struct | ParallelOptions |
| Common configuration object for parallel algorithms. More... | |
| class | ParseError |
| Exception class for parsing errors with location information. More... | |
| class | Path |
| Path on a graph. More... | |
| class | PatriciaMap |
| Compressed bitwise map for unsigned integral keys. More... | |
| class | PatriciaSet |
| Compressed bitwise set for unsigned integral keys. More... | |
| class | PersistentHashMap |
| Immutable unordered map backed by a Hash Array Mapped Trie (HAMT). More... | |
| class | PersistentTreapMap |
| Immutable ordered map backed by a path-copying treap. More... | |
| class | PersistentTreapSet |
| Immutable ordered set backed by a path-copying treap. More... | |
| class | PersistentVector |
| Immutable vector backed by a 32-way bitmapped trie. More... | |
| struct | Planar_Dual_Edge_Info |
| Dual-edge payload linked to a primal simplified edge. More... | |
| struct | Planar_Dual_Metadata |
| Metadata extracted from a planar embedding for face/dual analysis. More... | |
| struct | Planar_Geometric_Drawing |
| Embedding-aware geometric drawing result. More... | |
| struct | Planar_Geometric_Drawing_Options |
| Options for embedding-aware 2D drawing extraction. More... | |
| class | Planarity_Test |
Functor wrapper for planarity_test(). More... | |
| struct | Planarity_Test_Options |
| Configuration options for planarity testing and auxiliary outputs. More... | |
| struct | Planarity_Test_Result |
| Complete result of a planarity test execution. More... | |
| struct | plus |
| class | Point |
| Represents a point with rectangular coordinates in a 2D plane. More... | |
| class | Point3D |
| Represents a point in 3D space with exact rational coordinates. More... | |
| class | pointer_to_binary_function |
| class | pointer_to_unary_function |
| class | PointInPolygonWinding |
| Exact point-in-polygon classification via winding number. More... | |
| class | Polar_Point |
| Polar representation of a 2D point. More... | |
| struct | PolyFitAnalysis |
| Structure holding residual analysis for polynomial fits. More... | |
| class | Polygon |
| A general (irregular) 2D polygon defined by a sequence of vertices. More... | |
| class | PolygonOffset |
| Offset (inflate/deflate) an arbitrary simple polygon. More... | |
| class | PowerDiagram |
| Power diagram (weighted Voronoi diagram). More... | |
| struct | Powerful_Array_Policy |
| Policy: "powerful array" sum = sum(cnt[x]^2 * x). More... | |
| struct | PP_Res_Node |
| Residual node used by preflow-push algorithms. More... | |
| struct | Prefer_Deeper_Entry |
| Replacement policy that prefers entries searched to greater depth. More... | |
| struct | Prefer_Exact_Adversarial_Entry |
| Replacement policy for adversarial transposition entries. More... | |
| struct | PreferBetterObjective |
| Compare two optimization solutions by objective quality. More... | |
| class | Prefix_Tree |
| Owning prefix tree wrapper. More... | |
| class | Prefix_Tree_Map |
| Owning prefix tree map from strings to values. More... | |
| struct | Prim_Heap_Info |
| struct | Prim_Info |
| class | Prim_Min_Spanning_Tree |
| Computes the minimum spanning tree of a graph using Prim's algorithm. More... | |
| struct | Product_Disjoint_Sparse_Table |
| Disjoint Sparse Table for range product queries. More... | |
| struct | ProductMonoid |
| Product monoid: identity = 1, combine = a * b. More... | |
| struct | Project |
| Project with profit and dependencies. More... | |
| struct | ProjectSelectionResult |
| Result of project selection. More... | |
| class | Q_Topological_Sort |
| Computes topological ordering using breadth-first search (Kahn's algorithm). More... | |
| class | queue_overflow_error |
| Exception thrown when the task queue exceeds its hard limit. More... | |
| class | QuickHull |
| QuickHull convex hull algorithm. More... | |
| class | Quotient_Filter |
| Quotient filter for probabilistic set membership with deletion. More... | |
| class | RadixTree |
Compressed prefix tree mapping std::basic_string<Char> keys to values of type T. More... | |
| struct | Rand_Tree |
| Randomized binary search tree. More... | |
| struct | Rand_Tree_Vtl |
| Randomized binary search tree. More... | |
| class | RandNode |
| class | RandNodeVtl |
| class | Random_Digraph |
| Random directed graph (digraph) generator. More... | |
| class | Random_Graph |
| Random undirected graph generator. More... | |
| class | Random_Graph_Base |
| struct | Random_Preflow_Maximum_Flow |
| Functor wrapper for random_preflow_maximum_flow(). More... | |
| class | Random_Set |
| Random queue. More... | |
| class | Random_Source |
| The source of random numbers of a randomized structure, which draws from one of two generators. More... | |
| class | Range_Fenwick_Tree |
| Fenwick tree supporting range updates and range queries. More... | |
| struct | Range_Mode_Policy |
| Policy: range mode (most frequent element). More... | |
| class | RangeTree2D |
| Static 2D range tree for orthogonal range queries. More... | |
| struct | RangeTreeQueryVizResult |
| Result bundle for range-tree query visualization. More... | |
| struct | RankedMove |
| One move plus the metadata used by ordering comparators. More... | |
| struct | Rarc |
| struct | Rb_Tree |
| Red-black tree with nodes without virtual destructor. More... | |
| struct | Rb_Tree_Rk |
| Red-Black binary search tree with nodes without virtual destructor and with subtree counters for select/position operations. More... | |
| struct | Rb_Tree_Rk_Vtl |
| Red-Black binary search tree with virtual destructor in its nodes and with subtree counters for select/position operations. More... | |
| struct | Rb_Tree_Vtl |
| Red-black tree with virtual destructor in nodes. More... | |
| class | RbNodeRk |
| Extended Red-Black node with subtree counter. More... | |
| class | RbNodeRk_Data |
| Red-Black node data with color and subtree count. More... | |
| class | RbNodeRkVtl |
| struct | Rcost |
| Cost distance functor for Bellman-Ford on residual networks. More... | |
| struct | Rcost_With_Tolerance |
| Cost of a residual arc, with a tolerance for the relaxations of Bellman-Ford (see the parameter Distance of Bellman_Ford), which the cycle canceling takes for a floating flow. More... | |
| class | Rectangle |
| An axis-aligned rectangle. More... | |
| class | Regular_Polygon |
| A regular polygon defined by center, side length, and vertex count. More... | |
| class | RegularTriangulationBowyerWatson |
| Exact regular triangulation (weighted Delaunay) via Bowyer-Watson. More... | |
| struct | Replace_Always |
| Minimal replacement policy: always replace the current entry. More... | |
| struct | Res_Arc |
| Residual arc type with mirror pointer. More... | |
| struct | Res_F |
| Residual arc filter: keep arcs with residual capacity. More... | |
| struct | Res_Filt |
| Arc filter for residual networks. More... | |
| struct | Res_Filt_With_Tolerance |
| Arc filter for the residual networks of a floating flow, which the cycle canceling takes: an arc has residual capacity if it has more than a tolerance left. More... | |
| class | Reservoir_Sampler |
| Incremental reservoir sampler (Algorithm R). More... | |
| class | RevisedSimplex |
| Revised Simplex algorithm for linear programming. More... | |
| class | RingBuffer |
| Fixed-capacity circular FIFO buffer over contiguous storage. More... | |
| struct | Rnode |
| class | Rope |
Immutable, structurally-shared rope over a sequence of Char. More... | |
| class | RotatedEllipse |
| An ellipse with arbitrary rotation. More... | |
| class | RotatingCalipersConvexPolygon |
| Rotating calipers metrics for convex polygons. More... | |
| struct | RotatingCalipersResult |
| Bundle of rotating-calipers results used by visualization helpers. More... | |
| class | RTree |
| Dynamic R-tree indexing axis-aligned rectangles by payload. More... | |
| struct | RTreeQueryVizResult |
| Result bundle for R-tree/R*-tree query visualization. More... | |
| class | RwSynchronized |
| Read/write-lock protected shared object wrapper. More... | |
| class | Scope |
Lexical scope stack for Key to Value associations. More... | |
| class | Scope_Guard |
| Generic RAII scope guard for cleanup operations on graphs. More... | |
| struct | SearchLimits |
| Hard bounds applied by the search engine. More... | |
| struct | SearchResult |
| Aggregates the outcome of one search execution. More... | |
| struct | SearchSolution |
| Snapshot of a concrete solution encountered during the traversal. More... | |
| class | SearchSolutionCollector |
| Collector that stores accepted solutions in an Aleph list. More... | |
| struct | SearchStats |
| Counters collected during a search run. More... | |
| class | Segment |
| Represents a line segment between two points. More... | |
| class | Segment3D |
| Represents a line segment in 3D space. More... | |
| class | Segment_Tree_Beats |
| Ji Driver's Segment Tree (Segment Tree Beats). More... | |
| class | SegmentArrangement |
| Compute the full planar subdivision induced by a set of segments. More... | |
| struct | SegmentationResult |
| Result of binary image segmentation. More... | |
| class | SegmentSegmentIntersection |
| Dedicated exact intersection for a single pair of segments. More... | |
| struct | SensitivityRange |
| Sensitivity analysis result for a coefficient. More... | |
| struct | Short_Cycle_Result |
| Exact optimum returned by most_negative_cycle_up_to_3(). More... | |
| class | Shortest_Path_Base |
| Base class providing common infrastructure for shortest path algorithms. More... | |
| struct | ShortestPathDebugResult |
| Result bundle for shortest-path + funnel portal visualization. More... | |
| class | ShortestPathInPolygon |
| Compute the shortest Euclidean path between two points inside a simple polygon. More... | |
| struct | Show_All |
| Default filter functor that shows all elements. More... | |
| struct | Show_None |
| Filter functor that hides all elements. More... | |
| class | SimHash |
| SimHash fingerprint generator. More... | |
| struct | Simple_Prim_Heap |
| class | Simplex |
| Linear program solver using the Simplex method. More... | |
| struct | Simplex_Arc_Info |
| Arc information for Network Simplex algorithm. More... | |
| struct | Simplex_Node_Info |
| Node information for Network Simplex algorithm. More... | |
| struct | SimplexStats |
| Execution statistics for the Simplex algorithm. More... | |
| class | SkipList |
| Skip List - a probabilistic ordered data structure. More... | |
| class | Slink |
| Singly linked handle to list nodes. More... | |
| class | Slink_Nc |
| Singly linked list node (non-circular). More... | |
| class | Slinknc |
| Link of a single linked list non-circular and without header node. More... | |
| class | Slist |
Singly linked list of nodes that store values of type T. More... | |
| class | SmallVector |
Contiguous dynamic array with N elements of inline storage. More... | |
| class | Snode |
Singly linked node that stores data of type T. More... | |
| class | Snode_Nc |
| class | Snodenc |
| struct | Some |
| Represents a found value (stored by reference). More... | |
| struct | Source_File |
| Registered source file with cached line starts. More... | |
| class | Source_Manager |
| Stores source files and resolves offsets into human-readable data. More... | |
| struct | Source_Position |
| Fully resolved source position. More... | |
| struct | Source_Snippet |
| Render-ready excerpt for a single source line. More... | |
| struct | Source_Span |
| Half-open byte range inside a source file. More... | |
| struct | SourceLocation |
| Represents a location in source code. More... | |
| struct | Sparse_Table |
| Sparse Table for range minimum queries. More... | |
| class | SplitMix64_Rng |
| SplitMix64: a random number generator whose state is a word of 64 bits. More... | |
| class | SpscQueue |
| Bounded single-producer/single-consumer queue. More... | |
| struct | SSP_Node_Info |
| Node info for SSP algorithm. More... | |
| struct | Stats |
| Container for comprehensive statistical results. More... | |
| class | StlEnumerateIterator |
| Iterator that pairs each element with its index. More... | |
| class | StlEnumerateView |
| Lazy view that pairs each element with its index. More... | |
| class | StlZipIterator |
| Lazy iterator that traverses multiple STL containers in lockstep. More... | |
| class | StlZipView |
| Lazy view over multiple zipped STL containers. More... | |
| class | Stoer_Wagner_Min_Cut |
| Stoer-Wagner deterministic minimum cut algorithm. More... | |
| struct | StreamPosition |
| Structure to save stream position for backtracking. More... | |
| struct | Subset_Sum_Result |
| Result of a subset sum computation. More... | |
| struct | Successive_Shortest_Paths |
| Functor wrapper for SSP algorithm. More... | |
| class | Suffix_Automaton |
| Suffix automaton (SAM) over byte alphabet. More... | |
| struct | Sum_Disjoint_Sparse_Table |
| Disjoint Sparse Table for range sum queries. More... | |
| struct | Sum_Segment_Tree |
| Sum Segment Tree for range sum queries with point updates. More... | |
| struct | SumMonoid |
| Sum monoid: identity = 0, combine = a + b. More... | |
| struct | SurveyDesignResult |
| Result of survey design. More... | |
| struct | SurveyQuestion |
| Survey question with constraints. More... | |
| struct | SurveyRespondent |
| Survey respondent with constraints. More... | |
| class | SweepLineSegmentIntersection |
| Report all pairwise intersection points among a set of segments. More... | |
| class | Synchronized |
| Mutex-protected shared object wrapper. More... | |
| class | Tarjan_Connected_Components |
| Computes strongly connected components (SCCs) in a directed graph using Tarjan's algorithm. More... | |
| class | TaskGroup |
| Minimal structured-concurrency helper over ThreadPool futures. More... | |
| class | TdRbTree |
| Top-down red-black tree without virtual destructor. More... | |
| class | TdRbTreeRk |
| Top-down red-black tree with rank (no virtual destructor). More... | |
| class | TdRbTreeRkVtl |
| Top-down red-black tree with rank (virtual destructor). More... | |
| class | TdRbTreeVtl |
| Top-down red-black tree with virtual destructor. More... | |
| struct | Team |
| Team information for baseball elimination. More... | |
| class | Test_Dirac_Condition |
| Tests Dirac's sufficient condition for Hamiltonian graphs. More... | |
| class | Test_Eulerian |
| Tests whether a graph or digraph is Eulerian. More... | |
| class | Test_For_Cycle |
| Test whether a cycle is reachable from a given node. More... | |
| class | Test_For_Path |
| Checks whether a path exists between two nodes. More... | |
| class | Test_Hamiltonian_Sufficiency |
| Tests Ore's sufficient condition for Hamiltonian graphs. More... | |
| class | Test_Single_Graph |
| Determines whether a graph or digraph is simple. More... | |
| class | Tetrahedron |
| Represents a tetrahedron in 3D space defined by four points. More... | |
| class | Text |
| Represents a text string positioned at a 2D point. More... | |
| class | ThreadPool |
| A reusable thread pool for efficient parallel task execution. More... | |
| struct | ThreadPoolStats |
| Statistics collected by ThreadPool. More... | |
| struct | Tikz_Beamer_Document_Options |
| Options used by Tikz_Scene beamer/handout export helpers. More... | |
| struct | Tikz_Cubic_Bezier |
| Represents a cubic Bézier curve for native TikZ rendering. More... | |
| class | Tikz_Plane |
| 2D TikZ canvas storing geometry objects and emitting LaTeX output. More... | |
| struct | Tikz_Polyline |
| An open or closed polyline for TikZ rendering. More... | |
| struct | Tikz_Quadratic_Bezier |
| Represents a quadratic Bézier curve for native TikZ rendering. More... | |
| class | Tikz_Scene |
| High-level scene wrapper to compose objects and algorithm visualizations. More... | |
| struct | Tikz_Standalone_Document_Options |
| Options used by Tikz_Scene standalone document export. More... | |
| struct | Tikz_Style |
| Style descriptor for TikZ primitives. More... | |
| struct | To_Graphviz |
| Functor class for generating Graphviz DOT specifications. More... | |
| struct | Token |
| Structure representing a lexical token. More... | |
| class | Topological_Sort |
| Computes topological ordering using depth-first search. More... | |
| class | Total_Cost |
| Compute the total cost (sum of arc weights) of a graph. More... | |
| struct | TransportationResult |
| Result of transportation problem. More... | |
| class | Transposition_Table |
| Transposition-table container built on top of Aleph hash maps. More... | |
| struct | TranspositionStats |
| Statistics collected by memo/transposition storage. More... | |
| struct | Transshipment_Node_Info |
| Node with supply/demand for transshipment problems. More... | |
| struct | TransshipmentResult |
| Result of transshipment problem. More... | |
| class | TrapezoidalMapPointLocation |
| O(log n) point location via trapezoidal map with DAG search. More... | |
| class | TraverseMixin |
| CRTP Mixin providing traversal operations. More... | |
| struct | Treap |
| Treap (a special type of randomized binary search tree) using nodes without virtual destructor. More... | |
| struct | Treap_Rk |
| Extended treap (a special type of randomized binary search tree) which manages selection and splitting for inorder position. More... | |
| class | Treap_Rk_Node |
| class | Treap_Rk_NodeVtl |
| struct | Treap_Rk_Vtl |
| Extended treap (a special type of randomized binary search tree) which manages selection and splitting for inorder position. More... | |
| struct | Treap_Vtl |
| Treap (a special type of randomized binary search tree) using nodes with virtual destructors. More... | |
| class | TreapNode |
| Declare TreapNode type with 80-byte pool allocation. More... | |
| class | TreapNode_Data |
| Data portion of a treap node. More... | |
| class | TreapNodeVtl |
| class | TreapRkNode_Data |
| class | Tree_Node |
| Forward declaration used by CRTP helpers before the full node definition. More... | |
| struct | Tree_Node_Vtl |
| Tree_Node variant with a virtual destructor. More... | |
| class | Triangle |
| A non-degenerate triangle defined by three points. More... | |
| class | Triangle3D |
| Represents a triangle in 3D space defined by three points. More... | |
| class | Two_Sat |
| 2-SAT solver using Tarjan's SCC algorithm. More... | |
| struct | unary_function |
| class | unary_negate |
| class | Unconnected_Components |
| Compute the connected components of a graph. More... | |
| struct | unexpect_t |
Tag type used to construct an expected holding an error in place. More... | |
| class | unexpected |
Wrapper for the error value used to initialize an expected. More... | |
| struct | Uninit_Prim_Info |
| struct | Unit_Weight |
| Unit weight functor for unweighted graphs. More... | |
| class | UniZipIterator |
| Iterator that traverses multiple containers (STL or Aleph) in lockstep. More... | |
| class | UniZipSentinel |
| Sentinel type for UniZipIterator end comparison. More... | |
| class | UniZipView |
| Lazy view over multiple zipped containers (STL or Aleph). More... | |
| class | Vector |
| Sparse vector implementation with domain-based indexing. More... | |
| class | Vertex |
| A vertex in a polygon's doubly linked vertex list. More... | |
| class | VisibilityPolygon |
| Compute the visibility polygon from a point inside a simple polygon. More... | |
| class | VisvalingamWhyattSimplification |
| Visvalingam-Whyatt polyline simplification. More... | |
| class | VoronoiDiagram |
| O(n log n) Voronoi diagram construction. More... | |
| class | VoronoiDiagramFortune |
| The Voronoi diagram, as VoronoiDiagram computes it. More... | |
| class | VoronoiDiagramFromDelaunay |
| Voronoi diagram derived as the dual of a Delaunay triangulation. More... | |
| struct | Warc |
| class | Warshall_Compute_Transitive_Clausure |
| Computes the transitive closure of a graph using Warshall's algorithm. More... | |
| class | Welsh_Powell_Coloring |
| Functor wrapper for welsh_powell_coloring. More... | |
| struct | Wnode |
| struct | Write_Df_Tree_Df |
Writer for generate_tree() that shows the label and the df number of each node, as (label,df). More... | |
| struct | Write_Df_Tree_Label |
| Writer for generate_tree() that shows the label of each node. More... | |
| struct | Write_Df_Tree_Low |
Writer for generate_tree() that shows the label, the df and the low numbers of each node, as label,df,low. More... | |
| class | Xml_Graph |
| Class that writes and reads a graph (in a very elementary way) as XML. More... | |
| struct | XorMonoid |
| XOR monoid: identity = 0, combine = a ^ b. More... | |
| class | Yen_K_Shortest_Paths |
| Functor wrapper for Yen's k-shortest loopless paths algorithm. More... | |
| struct | Zero_Heuristic |
| Default heuristic for A* (zero heuristic, degrades to Dijkstra). More... | |
| class | Zero_One_BFS |
| 0-1 BFS algorithm for shortest paths in graphs with 0/1 weights. More... | |
| class | ZipIterator< C > |
| Base case of ZipIterator: the read-only iterator of the last container. More... | |
Concepts | |
| concept | BinaryPredicate |
A callable that takes two const T& and returns bool. | |
| concept | StrictWeakOrder |
| Strict weak ordering constraint for BST comparators. | |
| concept | EqualityComparator |
| Equivalence relation constraint for equality comparators. | |
| concept | BSTPolicy |
Concept for BST tree policies used by DynSetTree. | |
| concept | AlephArrayConvertible |
| Concept that identifies types that can be converted or used as an Aleph Array. | |
| concept | AlephSequentialContainer |
| Concept for Aleph-w mutable sequential containers. | |
| concept | AlephSequentialIterableContainer |
| Concept for Aleph-w sequential containers that can be iterated. | |
| concept | AlephIterator |
| An Aleph cursor-style iterator, as generic library code uses it. | |
| concept | AlephUncheckedIterator |
An AlephIterator whose get_curr_ne() gives what get_curr() gives, without its check. | |
| concept | AlephIterable |
A type that yields an AlephIterator over its Item_Types. | |
| concept | AlephTraversable |
A container whose items can be visited with traverse(). | |
| concept | AlephIterableContainer |
A traversable, AlephIterable container with a size. | |
| concept | AlephSequence |
An iterable container that grows at its back with append(). | |
| concept | AppendableWith |
A container whose append() accepts an argument of type Item. | |
| concept | InsertableWith |
A container whose insert() accepts an argument of type Item. | |
| concept | StlIterableContainer |
A container with STL-style begin()/end() and value_type. | |
| concept | IntegerSortableValue |
| Integral value accepted by linear-time integer sorting algorithms. | |
| concept | ArrayStorable |
| An element type the Aleph arrays can store. | |
| concept | ClosedBinaryOp |
A binary functor closed over T. | |
| concept | StaticMonoid |
A static monoid: M::identity() and M::combine(a, b). | |
| concept | CallableWith |
f(args...) is a valid call expression, exactly as written. | |
| concept | PredicateWith |
f(args...) is a valid call whose result is usable as a condition. | |
| concept | InvocableWith |
std::invoke(f, args...) is valid. | |
| concept | InvocablePredicateWith |
std::invoke(f, args...) is valid and usable as a condition. | |
| concept | NothrowPredicateWith |
PredicateWith<F, Args...>, and neither the call nor the conversion of its result to bool can throw. | |
| concept | BinNodeLike |
A binary tree node usable by tpl_binNodeUtils.H. | |
| concept | RankedBinNodeLike |
| A binary tree node that also keeps subtree sizes (rank). | |
| concept | AlephGraph |
| A graph usable by the graph algorithms. | |
| concept | NodeFilter |
A node filter (SN) for graph GT. | |
| concept | ArcFilter |
An arc filter (SA) for graph GT. | |
| concept | ArcDistance |
An arc distance (Distance) for graph GT. | |
| concept | DigraphType |
A graph type built with the Digraph template. | |
| concept | FlowNetwork |
| A flow network usable by the max-flow and min-cost algorithms. | |
| concept | AlephSequential |
| Concept for Aleph sequential containers with traversal and append semantics. | |
| concept | AlDomainKey |
| A key of a domain: of an AlDomain, and so an index of a Vector or of a Matrix. | |
| concept | AlOrderedDomainKey |
A key of a domain that < orders: what AlDomain::keys(), and the members that take the keys in their order, need. | |
| concept | AlStreamable |
A value that << writes to a stream: what the members that print keys or numbers need. | |
| concept | AlNumber |
| A number of the entries of a Vector or of a Matrix. | |
| concept | AlAdditiveNumber |
| A number that adds and subtracts: what the sums, the differences and the comparisons of vectors and matrices need. | |
| concept | AlMultiplicativeNumber |
| A number that multiplies: what the products by a scalar, and the products of vectors and matrices, need. | |
| concept | AlDivisibleNumber |
| A number that divides: what the division of a vector by a scalar needs. | |
| concept | BranchAndBoundObjectivePolicy |
| Concept for objective policies used by branch and bound. | |
| concept | CompleteSolutionPredicate |
| Concept for complete-solution predicates in optimization domains. | |
| concept | OptimizationEvaluator |
| Concept for domains that provide an objective and an optimistic bound. | |
| concept | BranchAndBoundDomain |
| Minimal contract for branch-and-bound domains. | |
| concept | HashableByADL |
| Concept: T provides a semantic hash via ADL. | |
| concept | SparseMatrix |
| Expresses requirements for sparse matrix backends like DynMatrix. | |
| concept | DenseMatrix |
| Expresses requirements for dense matrix backends like Array<Array<uint64_t>>. | |
| concept | ModularMatrixBackend |
| Union of supported matrix backends for modular operations. | |
| concept | AdversarialScore |
| Score type accepted by adversarial search engines. | |
| concept | AdversarialTranspositionMemo |
| Concept for memo tables storing adversarial-search entries. | |
| concept | AdversarialSearchTracer |
| Concept for adversarial-search trace sinks. | |
| concept | AdversarialSearchKeyer |
| Concept for explicit state-key providers used by adversarial TT overloads. | |
| concept | GameEvaluator |
| Required evaluator contract for zero-sum games. | |
| concept | AdversarialGameDomain |
| Minimal contract for alternating-turn zero-sum games. | |
| concept | SearchState |
| Minimal requirement for mutable search states. | |
| concept | SearchMove |
| Minimal requirement for search moves. | |
| concept | VisitedStateSet |
| Concept for a set suitable for tracking globally visited states. | |
| concept | VisitedBoundMap |
| Concept for a map tracking the best bound seen per visited state. | |
| concept | IncrementalBoundProvider |
| Concept for domains that can estimate a move's bound without modifying state (incremental bound for Branch-and-Bound ordering). | |
| concept | IncrementalEvaluator |
Concept for adversarial-search domains that can estimate a child score without modifying state (incremental evaluator for Alpha_Beta Estimated_Score move ordering). | |
| concept | SupportsBestFirst |
Concept that checks whether a search engine supports the Best_First exploration strategy at compile time. | |
| concept | SearchSolutionVisitor |
| Concept for callbacks invoked on each accepted solution. | |
| concept | SuccessorGenerator |
| Concept for lazy successor generation. | |
| concept | GoalPredicate |
| Concept for domains that can recognize goal states. | |
| concept | TerminalPredicate |
| Optional concept for explicit non-solution terminal states. | |
| concept | DomainPruner |
| Optional concept for domain-side pruning hooks. | |
| concept | MoveKeyProvider |
| Optional concept for domains that can key moves for history heuristics. | |
| concept | SearchStateKeyProvider |
| Generic concept for domains that can expose a stable state key. | |
| concept | HeuristicEvaluator |
| Concept for domains that provide an admissible heuristic. | |
| concept | ActionCostProvider |
| Concept for domains that provide the cost of applying a move. | |
| concept | BacktrackingDomain |
| Minimal contract for DFS/backtracking domains. | |
| concept | IDAStarDomain |
| Minimal contract for IDA* domains. | |
| concept | TikzDrawable |
A geometry type that Tikz_Plane::Object can wrap. | |
| concept | DisjointSparseTableOp |
| Binary operation compatible with Disjoint Sparse Table queries. | |
| concept | FenwickArithmetic |
| Arithmetic domain accepted by Fenwick specializations. | |
| concept | FenwickBinaryOp |
| Binary operation compatible with Fenwick tree group functors. | |
| concept | LCTMonoid |
| Concept for a monoidal combiner over path values. | |
| concept | LCTLazyTag |
| Concept for a lazy-tag policy used in deferred path updates. | |
| concept | MoPolicy |
| Concept constraining a policy for Mo's algorithm. | |
| concept | MoTreeGraph |
| Concept constraining a graph type usable for Mo on Trees. | |
| concept | RopeCharTraitsCompatible |
True exactly for the character types std::char_traits is specialized for by the standard (char, wchar_t, char8_t, char16_t, char32_t), i.e. | |
| concept | SegmentTreeOp |
| Binary operation compatible with Segment Tree queries. | |
| concept | SegmentTreePolicy |
| Policy concept for lazy segment tree. | |
| concept | CountingSortable |
| Value concept accepted by counting sort overloads. | |
| concept | RadixSortable |
| Value concept accepted by radix sort overloads. | |
| concept | IdempotentOp |
| A closed binary operation not known to break idempotency. | |
| concept | SparseTableOp |
| Binary operation compatible with Sparse Table queries. | |
| concept | TranspositionReplacementPolicy |
| Minimal protocol for replacement policies. | |
| concept | MemoTable |
| Minimal protocol for memo tables used by search engines. | |
Typedefs | |
| template<class C > | |
| using | const_iterator_t = Const_Iterator< typename C::Iterator > |
The read-only iterator of the container C. | |
| template<class IndexType , size_t Rank> | |
| using | dextents = typename decltype(mdspan_detail::dextents_of< IndexType >(std::make_index_sequence< Rank >{}))::type |
extents<IndexType, ...> with all Rank axes dynamic — the common case. | |
| using | Source_File_Id = size_t |
| using | Source_Offset = size_t |
| template<typename... Types> | |
| using | to_index_tuple = typename make_index_tuple< sizeof...(Types)>::type |
| Convenience alias to generate an index tuple from a parameter pack. | |
| using | T = std::decay_t< typename HeadC::Item_Type > |
| using | Tuple_Type = decltype(std::tuple_cat(std::declval< std::tuple< T > >(), std::declval< typename ZipIterator< TailC... >::Tuple_Type >())) |
| The tuple type returned by get_curr() and get_curr_ne() | |
| using | Item_Type = T |
| Type of elements from the first container. | |
| using | size_type = size_t |
| typedef uint32_t | IPv4_Address |
| Type alias for IPv4 addresses stored as 32-bit integers. | |
| typedef Field< int > | Integer |
| typedef Field< short > | Short |
| typedef Field< float > | Float |
| typedef Field< double > | Double |
| typedef Field< long double > | Ldouble |
| template<typename First , typename Second > | |
| using | pair = std::pair< First, Second > |
Alias to std::pair kept for backwards compatibility. | |
| using | Compiler_Bytecode_Register_Id = size_t |
| using | Compiler_Bytecode_Constant_Id = size_t |
| using | Compiler_Bytecode_Function_Id = size_t |
| using | Compiler_Bytecode_Block_Id = size_t |
| using | Compiler_Bytecode_PC = size_t |
| using | Compiler_CFG_Block_Id = size_t |
| Typedef for unique block identifiers within a function. | |
| using | Compiler_IR_Value_Id = size_t |
| using | Compiler_IR_Local_Slot_Id = size_t |
| using | Compiler_IR_Global_Slot_Id = size_t |
| using | Compiler_IR_Function_Id = size_t |
| using | Compiler_IR_Block_Id = size_t |
| using | Compiler_Symbol_Id = size_t |
| using | Compiler_Type_Id = size_t |
| template<typename T > | |
| using | bounded_channel = BoundedChannel< T > |
| Alias for Aleph::BoundedChannel. | |
| template<typename T , typename Mutex = std::mutex> | |
| using | synchronized = Synchronized< T, Mutex > |
| Alias for Aleph::Synchronized. | |
| template<typename T , typename SharedMutex = std::shared_mutex> | |
| using | rw_synchronized = RwSynchronized< T, SharedMutex > |
| Alias for Aleph::RwSynchronized. | |
| template<typename T > | |
| using | spsc_queue = SpscQueue< T > |
| Alias for Aleph::SpscQueue. | |
| using | Df_Low_Tree_Node = Tree_Node< Df_Low_Key > |
| Node of the depth-first tree that build_df_low_tree() returns. | |
| using | Df_Low_Non_Tree_Arc = std::pair< Df_Low_Tree_Node *, Df_Low_Tree_Node * > |
| Arc of the graph that is not in the depth-first tree. | |
| template<class GT , class Itor , class Show_Arc = Dft_Show_Arc<GT>> | |
| using | Graph_Traverse_DFS_Generator = Graph_Traverse_Generator< GT, Itor, DynListStack, Show_Arc > |
Lazy depth-first traversal: Graph_Traverse_Generator with a DynListStack frontier. | |
| template<class GT , class Itor , class Show_Arc = Dft_Show_Arc<GT>> | |
| using | Graph_Traverse_BFS_Generator = Graph_Traverse_Generator< GT, Itor, DynListQueue, Show_Arc > |
Lazy breadth-first traversal: Graph_Traverse_Generator with a DynListQueue frontier. | |
| using | Symbol_Map = DynMapTree< std::string, Huffman_Node *, Treap_Vtl > |
| using | Freq_Node = BinNode< std::pair< std::string, size_t > > |
| typedef BinHeap< size_t > | Huffman_Heap |
| typedef DynMapTree< std::string, BitArray, Treap_Vtl > | Code_Map |
| using | Interpreter_Host_Function = bool(*)(void *user_data, const DynArray< Interpreter_Value > &arguments, Interpreter_Value &result, Interpreter_Runtime_Error &error) |
| Host callback signature used by runtime built-ins or embeddings. | |
| template<class GT , class SA = Dft_Show_Arc<GT>> | |
| using | Karger_Stein_Min_Cut = Karger_Min_Cut< GT, SA > |
| Alias for Karger_Min_Cut (use fast() method for Karger-Stein) | |
| template<class GT , class SA = Dft_Show_Arc<GT>> | |
| using | Binary_Lifting_LCA = Gen_Binary_Lifting_LCA< GT, SA > |
| Convenience alias for binary-lifting LCA. | |
| template<class GT , class SA = Dft_Show_Arc<GT>> | |
| using | Euler_RMQ_LCA = Gen_Euler_RMQ_LCA< GT, SA > |
| Convenience alias for Euler+RMQ LCA. | |
| using | Info_Nodo = std::pair< std::string, DynDlist< std::string > > |
| Node payload: (id, fields) where fields come from the input row. | |
| using | Nodo = Graph_Node< Info_Nodo > |
| Node type for the digraph. | |
| using | Arco = Graph_Arc< std::string > |
| Arc type for the digraph (edge info is a string). | |
| using | Digrafo = List_Digraph< Nodo, Arco > |
| Digraph type used by the loader. | |
| using | ModularMatrix = Modular_Matrix< Array< Array< uint64_t > > > |
| Alias for common Array-based modular matrix. | |
| using | ModularSparseMatrix = Modular_Matrix< DynMatrix< uint64_t > > |
| Alias for sparse DynMatrix-based modular matrix. | |
| template<typename StateKey , SearchMove Move, AdversarialScore Score, template< typename, typename, class > class HashMapTable = MapOLhash, class Cmp = Aleph::equal_to<AdversarialTranspositionKey<StateKey>>> | |
| using | AdversarialTranspositionTable = Transposition_Table< AdversarialTranspositionKey< StateKey >, AdversarialTranspositionEntry< Move, Score >, HashMapTable, Cmp, Prefer_Exact_Adversarial_Entry< Move, Score > > |
| template<class GT > | |
| using | Default_Planar_Dual_Graph = List_Graph< Graph_Node< size_t >, Graph_Arc< Planar_Dual_Edge_Info< GT > > > |
| using | Geom_Number = mpq_class |
| Numeric type used by the geometry module. | |
| typedef unsigned char | Color |
| using | Compiler_SSA_Value_Id = size_t |
| using | Compiler_SSA_Block_Id = size_t |
| template<SearchMove Move> | |
| using | SearchPath = Array< Move > |
| Default Aleph container used to store a move path. | |
| using | SearchClock = std::chrono::steady_clock |
| Monotonic clock used for search timings. | |
| template<typename Key , typename Data , template< typename, typename, class > class HashMapTable = MapOLhash, class Cmp = Aleph::equal_to<Key>> | |
| using | SearchStorageMap = DynHashMap< Key, Data, HashMapTable, Cmp > |
| Aleph hash map alias for memoization/transposition storage. | |
| template<typename Key , template< typename, class > class HashSetTable = OLhashTable, class Cmp = Aleph::equal_to<Key>> | |
| using | SearchStorageSet = DynHashSet< Key, HashSetTable, Cmp > |
| Aleph hash set alias for visited-state storage. | |
| template<typename Solution , typename Compare = KeepFirstSolution<Solution>> | |
| using | Incumbent = BestSolution< Solution, Compare > |
| Alias used by optimization/search engines for their current best. | |
| using | ExceptionCallback = std::function< void(std::exception_ptr)> |
| Type for exception callback in detached tasks. | |
| using | FunnelPortal = detail::SPP_Portal |
| template<typename __Graph_Node = Graph_Anode<int>, typename __Graph_Arc = Graph_Aarc<int>> | |
| using | Array_Digraph = Digraph< Array_Graph< __Graph_Node, __Graph_Arc > > |
| Directed graph (digraph) implemented with array-based adjacency lists. | |
| template<typename Key , class Compare = Aleph::less<Key>, size_t MinDegree = 16> | |
| using | B_Tree = Gen_B_Tree< Key, Compare, MinDegree > |
| Convenient B-Tree alias. | |
| template<typename Key , class Compare = Aleph::less<Key>, size_t MinDegree = 16> | |
| using | BPlus_Tree = Gen_BPlus_Tree< Key, Compare, MinDegree > |
| Convenient B+ Tree alias. | |
| using | Compiler_Type_Constraint = Equality_Constraint< Compiler_Type_Id > |
| using | Compiler_Type_Constraint_Set = Constraint_Set< Compiler_Type_Id > |
| template<class T > | |
| using | Dfs_Here = std::conditional_t< std::is_move_assignable_v< T >, T, std::optional< T > > |
| The variable that holds the frame of the node that a depth-first search visits. | |
| template<typename Key , class Cmp = Aleph::equal_to<Key>> | |
| using | DynSetHash = DynHashTable< Key, LhashTable, Cmp > |
| template<typename Key , typename Data , class Cmp = Aleph::equal_to<Key>> | |
| using | DynMapLinHash = DynMapHashTable< Key, Data, LinearHashTable, Cmp > |
| template<typename Key , typename Data , class Cmp = Aleph::equal_to<Key>> | |
| using | DynMapHash = DynMapHashTable< Key, Data, LhashTable, Cmp > |
| template<typename Key , typename Value , class Compare = Aleph::less<Key>, size_t MinDegree = 16, typename KeyCodec = detail::Paged_Value_Codec<Key>, typename ValueCodec = detail::Paged_Value_Codec<Value>> | |
| using | File_B_Map = Gen_File_B_Map< Key, Value, Compare, MinDegree, KeyCodec, ValueCodec > |
| Convenient alias for a persistent B-Tree map. | |
| template<typename Key , class Compare = Aleph::less<Key>, size_t MinDegree = 16, typename Codec = detail::Paged_Value_Codec<Key>> | |
| using | File_B_Tree = Gen_File_B_Tree< Key, Compare, MinDegree, Codec > |
| Convenient alias for a page-managed persistent B-Tree. | |
| template<typename Key , typename Value , class Compare = Aleph::less<Key>, size_t MinDegree = 16, typename KeyCodec = detail::Paged_Value_Codec<Key>, typename ValueCodec = detail::Paged_Value_Codec<Value>> | |
| using | File_BPlus_Map = Gen_File_BPlus_Map< Key, Value, Compare, MinDegree, KeyCodec, ValueCodec > |
| Convenient alias for a persistent B+ Tree map. | |
| template<typename Key , class Compare = Aleph::less<Key>, size_t MinDegree = 16, typename Codec = detail::Paged_Value_Codec<Key>> | |
| using | File_BPlus_Tree = Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec > |
| Convenient alias for a page-managed persistent B+ Tree. | |
| template<typename __Graph_Node = Graph_Node<int>, typename __Graph_Arc = Graph_Arc<int>> | |
| using | List_Digraph = Digraph< List_Graph< __Graph_Node, __Graph_Arc > > |
| Directed graph (digraph) implemented with double-linked adjacency lists. | |
| template<class GT > | |
| using | ArcPair = std::tuple< typename GT::Arc *, typename GT::Node * > |
| Alias used for encapsulating a pair of arc and node (related between them). | |
| template<class GT > | |
| using | _Out_Iterator = Digraph_Iterator< GT, __Out_Filt< GT > > |
| Basic iterator for outcoming arcs of a node. | |
| template<class GT > | |
| using | _In_Iterator = Digraph_Iterator< GT, __In_Filt< GT > > |
| Basic iterator for incoming arcs of a node. | |
| template<typename Key , template< typename, class > class HashSetTable = OLhashTable, class Cmp = Aleph::equal_to<Key>> | |
| using | DynHashSet = HashSet< Key, HashSetTable, Cmp > |
| Alias for HashSet (for consistency with other Dyn containers). | |
| template<typename Key , typename Data , template< typename, typename, class > class HashMapTable = MapOLhash, class Cmp = Aleph::equal_to<Key>> | |
| using | DynHashMap = HashMap< Key, Data, HashMapTable, Cmp > |
| Alias for HashMap (for consistency with other Dyn containers). | |
| template<typename Key > | |
| using | interval_endpoint_t = typename interval_endpoint< Key >::type |
| template<typename Key > | |
| using | LhashBucket = Dnode< Key > |
| Bucket without virtual destructor for a hash table with collision resolution by separate chaining. | |
| template<typename Key , class Cmp = Aleph::equal_to<Key>> | |
| using | LinearHashTable = GenLinearHashTable< Key, LinHashBucket, Cmp > |
| Linear hash table with buckets without virtual destructor. | |
| template<typename Key , class Cmp = Aleph::equal_to<Key>> | |
| using | LinearHashTableVtl = GenLinearHashTable< Key, LinHashBucketVtl, Cmp > |
| Linear hash table with virtual destructor in its buckets. | |
| using | Link_Cut_Tree = Gen_Link_Cut_Tree< int > |
| Convenience alias for a connectivity-only Link-Cut Tree. | |
| template<typename EdgeT = int, class Monoid = DefaultMonoid<EdgeT>> | |
| using | Link_Cut_Tree_WithEdges = Gen_Link_Cut_Tree_WithEdges< int, EdgeT, Monoid > |
| Convenience alias for edge-weighted Link-Cut Tree. | |
| template<typename T > | |
| using | Distinct_Count_Mo = Gen_Mo_Algorithm< T, Distinct_Count_Policy< T > > |
| Mo's algorithm specialised for counting distinct elements. | |
| template<typename T > | |
| using | Powerful_Array_Mo = Gen_Mo_Algorithm< T, Powerful_Array_Policy< T > > |
| Mo's algorithm specialised for the "powerful array" query. | |
| template<typename T > | |
| using | Range_Mode_Mo = Gen_Mo_Algorithm< T, Range_Mode_Policy< T > > |
| Mo's algorithm specialised for range mode queries. | |
| template<class GT > | |
| using | Distinct_Count_Mo_On_Trees = Gen_Mo_On_Trees< GT, Distinct_Count_Policy< typename GT::Node::Node_Type > > |
| Mo on Trees specialised for counting distinct node values. | |
| template<class GT > | |
| using | Powerful_Array_Mo_On_Trees = Gen_Mo_On_Trees< GT, Powerful_Array_Policy< typename GT::Node::Node_Type > > |
| Mo on Trees specialised for the "powerful array" query. | |
| template<class GT > | |
| using | Range_Mode_Mo_On_Trees = Gen_Mo_On_Trees< GT, Range_Mode_Policy< typename GT::Node::Node_Type > > |
| Mo on Trees specialised for range mode queries. | |
| template<typename T > | |
| using | Distinct_Count_Mo_On_Tree_Node = Gen_Mo_On_Tree_Node< T, Distinct_Count_Policy< T > > |
| Mo on Tree_Node specialised for counting distinct values. | |
| template<typename T > | |
| using | Powerful_Array_Mo_On_Tree_Node = Gen_Mo_On_Tree_Node< T, Powerful_Array_Policy< T > > |
| Mo on Tree_Node specialised for the "powerful array" query. | |
| template<typename T > | |
| using | Range_Mode_Mo_On_Tree_Node = Gen_Mo_On_Tree_Node< T, Range_Mode_Policy< T > > |
| Mo on Tree_Node specialised for range mode queries. | |
| template<typename T > | |
| using | mpsc_queue = MpscQueue< T > |
| Alias for Aleph::MpscQueue. | |
| using | MultiPolynomial = Gen_MultiPolynomial< double, Grevlex_Order > |
| Multivariate polynomial with double coefficients, grevlex. | |
| using | MultiPolynomial_Lex = Gen_MultiPolynomial< double, Lex_Order > |
| Multivariate polynomial with lex ordering. | |
| using | MultiPolynomial_Grlex = Gen_MultiPolynomial< double, Grlex_Order > |
| Multivariate polynomial with grlex ordering. | |
| using | IntMultiPolynomial = Gen_MultiPolynomial< long long, Grevlex_Order > |
| Multivariate polynomial with integer (long long) coefficients, grevlex. | |
| using | IntMultiPolynomial_Lex = Gen_MultiPolynomial< long long, Lex_Order > |
| Multivariate polynomial with integer (long long) coefficients, lex. | |
| template<class Net > | |
| using | __Net_Iterator = Digraph_Iterator< Net, Net_Filt< Net > > |
| template<class Net , class Show_Arc = Dft_Show_Arc<Net>> | |
| using | Net_Iterator = Filter_Iterator< typename Net::Node *, __Net_Iterator< Net >, Show_Arc > |
| Residual-graph iterator adapter for flow networks. | |
| template<typename Node_Info = Empty_Class> | |
| using | Net_Node = Graph_Anode< Node_Info > |
| Node type for flow networks. | |
| template<class Net > | |
| using | Parc = std::tuple< typename Net::Arc *, bool > |
| Arc entry for a semi-path. | |
| template<class Net > | |
| using | SemiPath = std::tuple< bool, typename Net::Flow_Type, DynList< Parc< Net > > > |
| Semi-path tuple: | |
| template<class Net > | |
| using | Find_Aumenting_Path_DFS = Find_Aumenting_Path< Net, DynListStack > |
| Augmenting-path finder using DFS (stack). | |
| template<class Net > | |
| using | Find_Aumenting_Path_BFS = Find_Aumenting_Path< Net, DynListQueue > |
| Augmenting-path finder using BFS (queue). | |
| template<class Net > | |
| using | AP_Res_Net = Array_Digraph< Net_Node< Empty_Class >, __Res_Arc< Net > > |
| Residual network for augmenting-path algorithms. | |
| template<class Net > | |
| using | PP_Res_Net = Array_Digraph< PP_Res_Node< Net >, __Res_Arc< Net > > |
| Residual network for preflow-push algorithms. | |
| template<typename Node_Info = Empty_Class> | |
| using | Net_Cost_Node = Net_Node< Node_Info > |
| Node type alias for cost networks. | |
| template<typename Ftype > | |
| using | Residual_Net = Net_Cost_Graph< Net_Node< Empty_Class >, Res_Arc< Ftype > > |
| Residual network type alias. | |
| template<class Net > | |
| using | Feasible_Tree = std::tuple< DynList< typename Net::Arc * >, DynList< typename Net::Arc * >, DynList< typename Net::Arc * > > |
| Feasible spanning tree classification. | |
| template<typename Key , class Cmp = Aleph::equal_to<Key>> | |
| using | SetODhash = ODhashTable< Key, Cmp > |
| template<typename Key , class Cmp = Aleph::equal_to<Key>> | |
| using | SetOLhash = OLhashTable< Key, Cmp > |
| template<packed_matrix_detail::Column_Array auto Columns> | |
| using | Packed_Row_Of = typename packed_matrix_detail::Columns_At< Columns, std::make_index_sequence< Columns.size()> >::Row |
| Packed_Row whose columns are the entries of an array. | |
| template<packed_matrix_detail::Column_Array auto Columns> | |
| using | Packed_Matrix_Of = typename packed_matrix_detail::Columns_At< Columns, std::make_index_sequence< Columns.size()> >::Matrix |
| Packed_Matrix whose columns are the entries of an array. | |
| using | Polynomial = Gen_Polynomial< double > |
Polynomial with double coefficients. | |
| using | PolynomialF = Gen_Polynomial< float > |
Polynomial with float coefficients. | |
| using | PolynomialLD = Gen_Polynomial< long double > |
Polynomial with long double coefficients. | |
| using | IntPolynomial = Gen_Polynomial< long long > |
Polynomial with long long (integer) coefficients. | |
| template<typename Payload , size_t MaxEntries = 16, size_t MinEntries = MaxEntries / 2> | |
| using | RStarTree = RTree< Payload, MaxEntries, MinEntries, RTreeVariant::RStar > |
| Dynamic R*-tree spatial index (R-tree with the R*-tree heuristics). | |
| template<typename __Graph_Node = Graph_Snode<int>, typename __Graph_Arc = Graph_Sarc<int>> | |
| using | List_SDigraph = Digraph< List_SGraph< __Graph_Node, __Graph_Arc > > |
| Directed graph (digraph) implemented with simple adjacency lists. | |
| template<typename T , class Compare > | |
| using | Compare_Snodenc = Compare_Tnode< Slinknc, Snodenc, T, Compare > |
| Comparator specialization for Snodenc objects. | |
| template<class GT , class SA = Dft_Show_Arc<GT>> | |
| using | Heavy_Light_Decomposition = Gen_Heavy_Light_Decomposition< GT, SA > |
| Convenience alias for heavy-light decomposition. | |
| template<class GT , typename T = typename GT::Node::Node_Type, class Op = Aleph::plus<T>, class SA = Dft_Show_Arc<GT>> | |
| using | HLD_Path_Query = Gen_HLD_Path_Query< GT, T, Op, SA > |
| Convenience alias for segment-tree-backed HLD queries. | |
| template<class GT , class SA = Dft_Show_Arc<GT>> | |
| using | Centroid_Decomposition = Gen_Centroid_Decomposition< GT, SA > |
| Convenience alias for centroid decomposition. | |
| template<class GT , typename T , class SA = Dft_Show_Arc<GT>> | |
| using | Tree_DP = Gen_Tree_DP< GT, T, SA > |
| Convenient alias for Gen_Tree_DP. | |
| template<class GT , typename T , class SA = Dft_Show_Arc<GT>> | |
| using | Reroot_DP = Gen_Reroot_DP< GT, T, SA > |
| Convenient alias for Gen_Reroot_DP. | |
Functions | |
| template<class T , typename... Args> | |
| T * | allocate (AhArenaAllocator &arena, Args &&... args) |
| Allocate and construct an object in an arena. | |
| template<class T > | |
| void | deallocate (AhArenaAllocator &arena, T *ptr) noexcept |
| Destruct and deallocate an object from an arena. | |
| template<class T > | |
| void | dealloc (AhArenaAllocator &arena, T *ptr) noexcept |
| Alias for deallocate (backward compatibility). | |
| double | duration_to_seconds (const std::chrono::duration< double > &d) |
| double | duration_to_milliseconds (const std::chrono::duration< double > &d) |
| double | duration_to_microseconds (const std::chrono::duration< double > &d) |
| double | duration_to_nanoseconds (const std::chrono::duration< double > &d) |
| double | duration_to_minutes (const std::chrono::duration< double > &d) |
| double | duration_to_hours (const std::chrono::duration< double > &d) |
| double | duration_to_days (const std::chrono::duration< double > &d) |
| template<typename T , class Compare = Aleph::less<T>> | |
| Aleph::Generator< Array< T > > | lazy_permutations (Array< T > a, Compare cmp=Compare()) |
Lazily enumerate all permutations of a, in lexicographic order. | |
| template<typename T > | |
| Aleph::Generator< Array< T > > | lazy_combinations (Array< T > a, size_t k) |
Lazily enumerate all k-element combinations of a's elements. | |
| template<typename T > | |
| DynList< DynList< T > > | transpose (const DynList< DynList< T > > &l) |
| */ | |
| template<template< typename > class C, typename T > | |
| void | in_place_transpose (C< C< T > > &l) |
| In-place transpose of a rectangular matrix stored as a nested container. | |
| template<typename T > | |
| void | in_place_transpose (DynList< DynList< T > > &l) |
In-place transpose of a matrix stored as DynList<DynList<T>>. | |
| template<typename T , class Op > | |
| bool | traverse_perm (const DynList< DynList< T > > &l, Op &op) |
| */ | |
| template<typename T , class Op > | |
| bool | traverse_perm (const DynList< DynList< T > > &l, Op &&op) |
| Convenience overload accepting an rvalue callable. | |
| template<typename T , class Op > | |
| void | for_each_perm (const DynList< DynList< T > > &l, Op &op) |
Apply a procedure to every permutation produced by traverse_perm. | |
| template<typename T , class Op > | |
| void | for_each_perm (const DynList< DynList< T > > &l, Op &&op) |
| Convenience overload accepting an rvalue callable. | |
| template<typename T > | |
| DynList< DynList< T > > | build_perms (const DynList< DynList< T > > &l) |
| Materialize all permutations from a list of lists. | |
| template<typename T > | |
| DynList< DynList< T > > | build_combs (const DynList< DynList< T > > &l) |
| Build the set of unique combinations from a list of lists. | |
| template<typename T , typename Tc , class Op = Dft_Fold_Op<Tc, T>> | |
| T | fold_perm (const T &init, const DynList< DynList< Tc > > &l, Op &op) |
| Left-fold over all permutations. | |
| template<typename T , typename Tc , class Op = Dft_Fold_Op<Tc, T>> | |
| T | fold_perm (const T &init, const DynList< DynList< Tc > > &l, Op &&op) |
| Convenience overload accepting an rvalue callable. | |
| template<typename T > | |
| size_t | perm_count (const DynList< DynList< T > > &l) |
| Count the total number of permutations from a list of lists. | |
| template<typename T , class Pred > | |
| bool | exists_perm (const DynList< DynList< T > > &l, Pred &pred) |
| Check if any permutation satisfies a predicate. | |
| template<typename T , class Pred > | |
| bool | exists_perm (const DynList< DynList< T > > &l, Pred &&pred) |
| Convenience overload accepting an rvalue callable. | |
| template<typename T , class Pred > | |
| bool | all_perm (const DynList< DynList< T > > &l, Pred &pred) |
| Check if all permutations satisfy a predicate. | |
| template<typename T , class Pred > | |
| bool | all_perm (const DynList< DynList< T > > &l, Pred &&pred) |
| Convenience overload accepting an rvalue callable. | |
| template<typename T , class Pred > | |
| bool | none_perm (const DynList< DynList< T > > &l, Pred &pred) |
| Check if no permutation satisfies a predicate. | |
| template<typename T , class Pred > | |
| bool | none_perm (const DynList< DynList< T > > &l, Pred &&pred) |
| Convenience overload accepting an rvalue callable. | |
| template<typename T , class Pred > | |
| DynList< DynList< T > > | filter_perm (const DynList< DynList< T > > &l, Pred &pred) |
| Filter permutations that satisfy a predicate. | |
| template<typename T , class Pred > | |
| DynList< DynList< T > > | filter_perm (const DynList< DynList< T > > &l, Pred &&pred) |
| Convenience overload accepting an rvalue callable. | |
| template<typename R , typename T , class Op > | |
| DynList< R > | map_perm (const DynList< DynList< T > > &l, Op &op) |
| Transform each permutation via a mapping operation. | |
| template<typename R , typename T , class Op > | |
| DynList< R > | map_perm (const DynList< DynList< T > > &l, Op &&op) |
| Convenience overload accepting an rvalue callable. | |
| template<typename T , class Compare = Aleph::less<T>> | |
| bool | next_permutation (Array< T > &a, Compare cmp=Compare(), const bool reset_on_last=true) |
Compute the next lexicographic permutation of an Array. | |
| template<typename T , class Compare = Aleph::less<T>> | |
| bool | next_permutation (DynArray< T > &a, Compare cmp=Compare(), const bool reset_on_last=true) |
Overload of next_permutation for DynArray. | |
| size_t | combination_count (size_t n, size_t k) |
Compute n choose k with overflow checks. | |
| bool | next_combination_indices (Array< size_t > &idx, const size_t n, const bool reset_on_last=true) |
Advance an index-combination [i0 < i1 < ... < i(k-1)] to the next one. | |
| bool | next_combination_indices (DynArray< size_t > &idx, const size_t n, const bool reset_on_last=true) |
Overload of next_combination_indices for DynArray<size_t>. | |
| uint64_t | first_combination_mask (const size_t k) |
Build the first k-of-64 combination mask (k low bits set). | |
| bool | next_combination_mask (uint64_t &mask, const size_t n, const bool reset_on_last=true) |
| Advance a fixed-popcount bitmask to the next combination (Gosper hack). | |
| template<typename T , class Op > | |
| bool | for_each_combination (const Array< T > &values, const size_t k, Op &&op) |
| */ | |
| template<typename T , class Op > | |
| bool | for_each_combination (const DynArray< T > &values, const size_t k, Op &&op) |
Overload of for_each_combination for DynArray<T>. | |
| template<typename T > | |
| Array< Array< T > > | build_combinations (const Array< T > &values, const size_t k) |
Materialize all k-combinations of Array<T>. | |
| template<typename T > | |
| Array< Array< T > > | build_combinations (const DynArray< T > &values, const size_t k) |
Overload of build_combinations for DynArray<T>. | |
| template<std::unsigned_integral T> | |
| constexpr T | bin_to_gray (const T n) noexcept |
| Convert a binary number to its Gray code representation. | |
| template<std::unsigned_integral T> | |
| constexpr T | gray_to_bin (T g) noexcept |
| Convert a Gray code number to its binary representation. | |
| Array< uint32_t > | build_gray_code (const size_t n) |
| Generate the sequence of n-bit Gray codes. | |
| template<class C > | |
| std::vector< typename C::Item_Type > | to_vector (const C &c) |
| Convert a container to a std::vector. | |
| template<class T > | |
| DynList< T > | vector_to_DynList (const std::vector< T > &v) |
| Convert a std::vector to a DynList. | |
| template<class T > | |
| DynArray< T > | vector_to_DynArray (const std::vector< T > &v) |
| Convert a std::vector to a DynArray. | |
| template<class T > | |
| DynList< T > | to_DynList (const Array< T > &a) |
| Convert an Array to a DynList. | |
| template<class C > requires AlephArrayConvertible<C> | |
| Array< typename C::Item_Type > | to_Array (const C &c) |
| Convert a container to an Array. | |
| template<class C > | |
| Array< typename C::Item_Type > | to_array (const C &c) |
| Convenience wrapper identical to to_Array (copy contents). | |
| template<class T > | |
| DynList< T > | dynarray_to_DynList (const DynArray< T > &a) |
| Convert a DynArray to a DynList. | |
| template<class T > | |
| DynArray< T > | dynlist_to_DynArray (const DynList< T > &l) |
| Convert a DynList to a DynArray. | |
| template<class T > | |
| Array< T > | vector_to_Array (const std::vector< T > &v) |
| Convert a std::vector to an Array. | |
| template<class C > | |
| DynArray< typename C::Item_Type > | to_DynArray (const C &c) |
| Convert a container to a DynArray. | |
| template<class T > | |
| DynArray< T > | array_to_DynArray (const Array< T > &a) |
| Convert an Array to a DynArray. | |
| template<class T > | |
| Array< T > | dynarray_to_Array (const DynArray< T > &a) |
| Convert a DynArray to an Array. | |
| template<class C > | |
| std::deque< typename C::Item_Type > | to_deque (const C &c) |
| Convert a container to a std::deque. | |
| template<class T > | |
| DynList< T > | deque_to_DynList (const std::deque< T > &d) |
| Convert a std::deque to a DynList. | |
| template<class T > | |
| Array< T > | deque_to_Array (const std::deque< T > &d) |
| Convert a std::deque to an Array. | |
| template<class T > | |
| DynArray< T > | deque_to_DynArray (const std::deque< T > &d) |
| Convert a std::deque to a DynArray. | |
| template<class T > | |
| DynList< T > | dyndlist_to_DynList (const DynDlist< T > &l) |
| Convert a DynDlist to a DynList. | |
| template<class T > | |
| DynDlist< T > | dynlist_to_DynDlist (const DynList< T > &l) |
| Convert a DynList to a DynDlist. | |
| template<class T > | |
| DynArray< T > | dyndlist_to_DynArray (const DynDlist< T > &l) |
| Convert a DynDlist to a DynArray. | |
| template<class T > | |
| DynDlist< T > | dynarray_to_DynDlist (const DynArray< T > &a) |
| Convert a DynArray to a DynDlist. | |
| template<class T > | |
| DynDlist< T > | vector_to_DynDlist (const std::vector< T > &v) |
| Convert a std::vector to a DynDlist. | |
| template<class T > | |
| DynList< T > | vector_to_DynList (std::vector< T > &&v) |
| Convert a std::vector to a DynList using move semantics. | |
| template<class T > | |
| Array< T > | vector_to_Array (std::vector< T > &&v) |
| Convert a std::vector to an Array using move semantics. | |
| template<class T > | |
| DynArray< T > | vector_to_DynArray (std::vector< T > &&v) |
| Convert a std::vector to a DynArray using move semantics. | |
| template<class T > | |
| DynDlist< T > | vector_to_DynDlist (std::vector< T > &&v) |
| Convert a std::vector to a DynDlist using move semantics. | |
| template<class T , class Compare , class Alloc > | |
| DynList< T > | set_to_DynList (const std::set< T, Compare, Alloc > &s) |
| Convert a std::set to a DynList. | |
| template<class T , class Compare , class Alloc > | |
| Array< T > | set_to_Array (const std::set< T, Compare, Alloc > &s) |
| Convert a std::set to an Array. | |
| template<class T , class Compare , class Alloc > | |
| DynArray< T > | set_to_DynArray (const std::set< T, Compare, Alloc > &s) |
| Convert a std::set to a DynArray. | |
| template<class C > | |
| std::set< typename C::Item_Type > | to_set (const C &c) |
| Convert a container to a std::set. | |
| template<class K , class V , class Compare , class Alloc > | |
| DynList< std::pair< K, V > > | map_to_DynList (const std::map< K, V, Compare, Alloc > &m) |
| Convert a std::map to a DynList of pairs. | |
| template<class K , class V , class Compare , class Alloc > | |
| Array< std::pair< K, V > > | map_to_Array (const std::map< K, V, Compare, Alloc > &m) |
| Convert a std::map to an Array of pairs. | |
| template<class K , class V , class Compare , class Alloc > | |
| DynList< K > | map_keys_to_DynList (const std::map< K, V, Compare, Alloc > &m) |
| Extract keys from a std::map to a DynList. | |
| template<class K , class V , class Compare , class Alloc > | |
| DynList< V > | map_values_to_DynList (const std::map< K, V, Compare, Alloc > &m) |
| Extract values from a std::map to a DynList. | |
| template<class T > | |
| DynList< T > | init_to_DynList (std::initializer_list< T > il) |
| Convert an initializer_list to a DynList. | |
| template<class T > | |
| Array< T > | init_to_Array (std::initializer_list< T > il) |
| Convert an initializer_list to an Array. | |
| template<class T > | |
| DynArray< T > | init_to_DynArray (std::initializer_list< T > il) |
| Convert an initializer_list to a DynArray. | |
| template<class T > | |
| DynDlist< T > | init_to_DynDlist (std::initializer_list< T > il) |
| Convert an initializer_list to a DynDlist. | |
| template<typename Key , template< typename, class > class Tree, class Compare > | |
| DynList< Key > | settree_to_DynList (const DynSetTree< Key, Tree, Compare > &s) |
| Convert a DynSetTree to a DynList. | |
| template<typename Key , template< typename, class > class Tree, class Compare > | |
| Array< Key > | settree_to_Array (const DynSetTree< Key, Tree, Compare > &s) |
| Convert a DynSetTree to an Array. | |
| template<typename Key , template< typename, class > class Tree, class Compare > | |
| DynArray< Key > | settree_to_DynArray (const DynSetTree< Key, Tree, Compare > &s) |
| Convert a DynSetTree to a DynArray. | |
| template<typename Key , template< typename, class > class Tree, class Compare > | |
| std::vector< Key > | settree_to_vector (const DynSetTree< Key, Tree, Compare > &s) |
| Convert a DynSetTree to a std::vector. | |
| template<typename Key , template< typename, class > class Tree, class Compare > | |
| std::set< Key > | settree_to_stdset (const DynSetTree< Key, Tree, Compare > &s) |
| Convert a DynSetTree to a std::set. | |
| template<class C > | |
| DynSetTree< typename C::Item_Type > | to_DynSetTree (const C &c) |
| Convert a container to a DynSetTree (AVL by default). | |
| template<class T > | |
| DynSetTree< T > | vector_to_DynSetTree (const std::vector< T > &v) |
| Convert a std::vector to a DynSetTree. | |
| template<typename Key , template< typename, class > class HashTable, class Cmp > | |
| DynList< Key > | sethash_to_DynList (const DynHashTable< Key, HashTable, Cmp > &s) |
| Convert a DynHashTable (hash set) to a DynList. | |
| template<typename Key , template< typename, class > class HashTable, class Cmp > | |
| Array< Key > | sethash_to_Array (const DynHashTable< Key, HashTable, Cmp > &s) |
| Convert a DynHashTable (hash set) to an Array. | |
| template<typename Key , template< typename, class > class HashTable, class Cmp > | |
| DynArray< Key > | sethash_to_DynArray (const DynHashTable< Key, HashTable, Cmp > &s) |
| Convert a DynHashTable (hash set) to a DynArray. | |
| template<typename Key , template< typename, class > class HashTable, class Cmp > | |
| std::vector< Key > | sethash_to_vector (const DynHashTable< Key, HashTable, Cmp > &s) |
| Convert a DynHashTable (hash set) to a std::vector. | |
| template<typename Key , typename Data , template< typename, class > class Tree, class Compare > | |
| DynList< std::pair< Key, Data > > | maptree_to_DynList (const DynMapTree< Key, Data, Tree, Compare > &m) |
| Convert a DynMapTree to a DynList of pairs. | |
| template<typename Key , typename Data , template< typename, class > class Tree, class Compare > | |
| Array< std::pair< Key, Data > > | maptree_to_Array (const DynMapTree< Key, Data, Tree, Compare > &m) |
| Convert a DynMapTree to an Array of pairs. | |
| template<typename Key , typename Data , template< typename, class > class Tree, class Compare > | |
| std::map< Key, Data > | maptree_to_stdmap (const DynMapTree< Key, Data, Tree, Compare > &m) |
| Convert a DynMapTree to a std::map. | |
| template<typename Key , typename Data , template< typename, class > class Tree, class Compare > | |
| DynList< Key > | maptree_keys_to_DynList (const DynMapTree< Key, Data, Tree, Compare > &m) |
| Extract keys from a DynMapTree to a DynList. | |
| template<typename Key , typename Data , template< typename, class > class Tree, class Compare > | |
| DynList< Data > | maptree_values_to_DynList (const DynMapTree< Key, Data, Tree, Compare > &m) |
| Extract values from a DynMapTree to a DynList. | |
| template<class K , class V , class Compare , class Alloc > | |
| DynMapTree< K, V > | stdmap_to_DynMapTree (const std::map< K, V, Compare, Alloc > &m) |
| Convert a std::map to a DynMapTree. | |
| template<typename Key , typename Data , class Cmp , template< typename, class > class HashTable> | |
| DynList< std::pair< Key, Data > > | maphash_to_DynList (const MapOpenHash< Key, Data, Cmp, HashTable > &m) |
| Convert a MapOpenHash to a DynList of pairs. | |
| template<typename Key , typename Data , class Cmp , template< typename, class > class HashTable> | |
| Array< std::pair< Key, Data > > | maphash_to_Array (const MapOpenHash< Key, Data, Cmp, HashTable > &m) |
| Convert a MapOpenHash to an Array of pairs. | |
| template<typename Key , typename Data , class Cmp , template< typename, class > class HashTable> | |
| std::map< Key, Data > | maphash_to_stdmap (const MapOpenHash< Key, Data, Cmp, HashTable > &m) |
| Convert a MapOpenHash to a std::map. | |
| template<typename Key , typename Data , class Cmp , template< typename, class > class HashTable> | |
| DynList< Key > | maphash_keys_to_DynList (const MapOpenHash< Key, Data, Cmp, HashTable > &m) |
| Extract keys from a MapOpenHash to a DynList. | |
| template<typename Key , typename Data , class Cmp , template< typename, class > class HashTable> | |
| DynList< Data > | maphash_values_to_DynList (const MapOpenHash< Key, Data, Cmp, HashTable > &m) |
| Extract values from a MapOpenHash to a DynList. | |
| template<class E > | |
| unexpected (E) -> unexpected< E > | |
| bool | is_leap_year (const size_t yy) noexcept |
| Return true if the provided year is a leap year. | |
| bool | valid_month (const size_t mm) noexcept |
| Check whether the month number is within the [1, 12] range. | |
| bool | valid_day (const size_t yy, const size_t mm, const size_t dd) noexcept |
| Check whether a given day exists for the supplied month/year. | |
| time_t | to_time_t (const size_t dd, const size_t mm, const size_t yy) |
Convert a (day, month, year) triple to a POSIX time_t value. | |
| time_t | to_time_t (const std::string &s, const std::string &format) |
Convert a formatted string to time_t using the provided format. | |
| time_t | to_time_t (const std::string &s) |
| Convenience overload for ISO strings (YYYY-MM-DD HH:MM:SS). | |
| size_t | to_days (const time_t t) |
Return the number of whole days represented by t. | |
| std::string | to_string (const time_t t, const std::string &format) |
Format a time_t value into a string using format. | |
| template<class C > requires (not std::is_const_v<C>) | |
| auto | iterator_for (C &c) |
Iterator on c positioned on its first item: the container's own iterator on a modifiable container. | |
| template<class C > | |
| auto | iterator_for (const C &c) |
Iterator on c positioned on its first item: the read-only view on a constant container. | |
| template<typename... Args> | |
| std::string | build_string (Args &&... args) |
| Concatenate arbitrary streamable arguments into a string. | |
| template<typename... Args> | |
| std::string | build_error_msg (Args &&... args) |
| Alias kept for backwards compatibility with historic API. | |
| template<typename ResultT = void, typename Container , typename Op > | |
| auto | pmaps (ThreadPool &pool, const Container &c, Op op, size_t chunk_size=0) |
| Parallel map operation. | |
| template<typename ResultT = void, typename Container , typename Op > | |
| auto | pmaps (const Container &c, Op op, const ParallelOptions &options={}) |
| template<typename Container , typename Pred > | |
| auto | pfilter (ThreadPool &pool, const Container &c, Pred pred, size_t chunk_size=0) |
| Parallel filter operation. | |
| template<typename Container , typename Pred > | |
| auto | pfilter (const Container &c, Pred pred, const ParallelOptions &options={}) |
| template<typename T , typename Container , typename BinaryOp > | |
| T | pfoldl (ThreadPool &pool, const Container &c, T init, BinaryOp op, size_t chunk_size=0) |
| Parallel left fold (reduce). | |
| template<typename T , typename Container , typename BinaryOp > | |
| T | pfoldl (const Container &c, T init, BinaryOp op, const ParallelOptions &options={}) |
| template<typename Container , typename Op > | |
| void | pfor_each (ThreadPool &pool, Container &c, Op op, size_t chunk_size=0) |
| Parallel for_each operation. | |
| template<typename Container , typename Op > | |
| void | pfor_each (Container &c, Op op, const ParallelOptions &options={}) |
| template<typename Container , typename Op > | |
| void | pfor_each (ThreadPool &pool, const Container &c, Op op, size_t chunk_size=0) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Parallel for_each for const containers. | |
| template<typename Container , typename Op > | |
| void | pfor_each (const Container &c, Op op, const ParallelOptions &options={}) |
| template<typename Container , typename Pred > | |
| bool | pall (ThreadPool &pool, const Container &c, Pred pred, size_t chunk_size=0) |
| Parallel all predicate (short-circuit). | |
| template<typename Container , typename Pred > | |
| bool | pall (const Container &c, Pred pred, const ParallelOptions &options={}) |
| template<typename Container , typename Pred > | |
| bool | pexists (ThreadPool &pool, const Container &c, Pred pred, size_t chunk_size=0) |
| Parallel exists predicate (short-circuit). | |
| template<typename Container , typename Pred > | |
| bool | pexists (const Container &c, Pred pred, const ParallelOptions &options={}) |
| template<typename Container , typename Pred > | |
| bool | pnone (ThreadPool &pool, const Container &c, Pred pred, size_t chunk_size=0) |
| Parallel none predicate. | |
| template<typename Container , typename Pred > | |
| bool | pnone (const Container &c, Pred pred, const ParallelOptions &options={}) |
| template<typename Container , typename Pred > | |
| size_t | pcount_if (ThreadPool &pool, const Container &c, Pred pred, size_t chunk_size=0) |
| Parallel count_if operation. | |
| template<typename Container , typename Pred > | |
| size_t | pcount_if (const Container &c, Pred pred, const ParallelOptions &options={}) |
| template<typename Container , typename Pred > | |
| std::optional< size_t > | pfind (ThreadPool &pool, const Container &c, Pred pred, size_t chunk_size=0) |
| Parallel find operation (returns index). | |
| template<typename Container , typename Pred > | |
| std::optional< size_t > | pfind (const Container &c, Pred pred, const ParallelOptions &options={}) |
| template<typename Container , typename Pred > | |
| auto | pfind_value (ThreadPool &pool, const Container &c, Pred pred, size_t chunk_size=0) |
| Parallel find with value return. | |
| template<typename Container , typename Pred > | |
| auto | pfind_value (const Container &c, Pred pred, const ParallelOptions &options={}) |
| template<typename Container , typename T = std::decay_t<decltype(*std::begin(std::declval<Container>()))>> | |
| T | psum (ThreadPool &pool, const Container &c, T init=T{}, size_t chunk_size=0) |
| Parallel sum of elements. | |
| template<typename Container , typename T = std::decay_t<decltype(*std::begin(std::declval<Container>()))>> | |
| T | psum (const Container &c, T init, const ParallelOptions &options) |
| template<typename Container , typename T = std::decay_t<decltype(*std::begin(std::declval<Container>()))>> | |
| T | pproduct (ThreadPool &pool, const Container &c, T init=T{1}, size_t chunk_size=0) |
| Parallel product of elements. | |
| template<typename Container , typename T = std::decay_t<decltype(*std::begin(std::declval<Container>()))>> | |
| T | pproduct (const Container &c, T init, const ParallelOptions &options) |
| template<typename Container > | |
| auto | pmin (ThreadPool &pool, const Container &c, size_t chunk_size=0) |
| Parallel minimum element. | |
| template<typename Container > | |
| auto | pmin (const Container &c, const ParallelOptions &options={}) |
| template<typename Container > | |
| auto | pmax (ThreadPool &pool, const Container &c, size_t chunk_size=0) |
| Parallel maximum element. | |
| template<typename Container > | |
| auto | pmax (const Container &c, const ParallelOptions &options={}) |
| template<typename Container > | |
| auto | pminmax (ThreadPool &pool, const Container &c, size_t chunk_size=0) |
| Parallel min and max elements. | |
| template<typename Container , typename Compare = std::less<>> | |
| void | psort (ThreadPool &pool, Container &c, Compare cmp=Compare{}, const size_t min_parallel_size=1024) |
| Parallel sort (in-place). | |
| template<typename Container , typename Compare = std::less<>> | |
| void | psort (Container &c, Compare cmp=Compare{}, const ParallelOptions &options={}) |
| template<typename Container1 , typename Container2 , typename Op > | |
| void | pzip_for_each (ThreadPool &pool, const Container1 &c1, const Container2 &c2, Op op, size_t chunk_size=0) |
| Parallel zip + for_each. | |
| template<typename Container1 , typename Container2 , typename Op > | |
| void | pzip_for_each (const Container1 &c1, const Container2 &c2, Op op, const ParallelOptions &options={}) |
| template<typename Container1 , typename Container2 , typename Op > | |
| auto | pzip_maps (ThreadPool &pool, const Container1 &c1, const Container2 &c2, Op op, size_t chunk_size=0) |
| Parallel zip + map. | |
| template<typename Container1 , typename Container2 , typename Op > | |
| auto | pzip_maps (const Container1 &c1, const Container2 &c2, Op op, const ParallelOptions &options={}) |
| template<typename Container1 , typename Container2 , typename T , typename Op > | |
| T | pzip_foldl (ThreadPool &pool, const Container1 &c1, const Container2 &c2, T init, Op op, size_t chunk_size=0) |
| Parallel zip + fold. | |
| template<typename Container1 , typename Container2 , typename T , typename Op > | |
| T | pzip_foldl (const Container1 &c1, const Container2 &c2, T init, Op op, const ParallelOptions &options={}) |
| template<typename Container , typename Pred > | |
| auto | ppartition (ThreadPool &pool, const Container &c, Pred pred, size_t chunk_size=0) |
| Parallel partition (stable). | |
| template<typename Container , typename Pred > | |
| auto | ppartition (const Container &c, Pred pred, const ParallelOptions &options={}) |
| template<typename Container , typename BinaryOp > | |
| auto | pscan (ThreadPool &pool, const Container &c, BinaryOp op, size_t chunk_size=0) |
| Parallel inclusive scan over a container. | |
| template<typename Container , typename BinaryOp > | |
| auto | pscan (const Container &c, BinaryOp op, const ParallelOptions &options={}) |
| Parallel inclusive scan over a container with explicit options. | |
| template<typename Container , typename T , typename BinaryOp > | |
| auto | pexclusive_scan (ThreadPool &pool, const Container &c, T init, BinaryOp op, size_t chunk_size=0) |
| Parallel exclusive scan over a container. | |
| template<typename Container , typename T , typename BinaryOp > | |
| auto | pexclusive_scan (const Container &c, T init, BinaryOp op, const ParallelOptions &options={}) |
| Parallel exclusive scan over a container with explicit options. | |
| template<typename Container1 , typename Container2 , typename Compare = std::less<>> | |
| auto | pmerge (ThreadPool &pool, const Container1 &c1, const Container2 &c2, Compare comp=Compare{}, size_t chunk_size=0) |
| Parallel merge of two sorted containers. | |
| template<typename Container1 , typename Container2 , typename Compare = std::less<>> | |
| auto | pmerge (const Container1 &c1, const Container2 &c2, Compare comp=Compare{}, const ParallelOptions &options={}) |
| Parallel merge of two sorted containers with explicit options. | |
| template<typename Op , typename... Containers> | |
| void | pzip_for_each_n (ThreadPool &pool, Op op, const Containers &... cs) |
| Parallel for_each over N zipped containers (variadic). | |
| template<typename Op , typename... Containers> | |
| void | pzip_for_each_n (Op op, const ParallelOptions &options, const Containers &... cs) |
| template<typename Op , typename... Containers> | |
| auto | pzip_maps_n (ThreadPool &pool, Op op, const Containers &... cs) |
| Parallel map over N zipped containers (variadic). | |
| template<typename Op , typename... Containers> | |
| auto | pzip_maps_n (Op op, const ParallelOptions &options, const Containers &... cs) |
| template<typename T , typename Op , typename Combiner , typename... Containers> | |
| T | pzip_foldl_n (ThreadPool &pool, T init, Op op, Combiner combiner, const Containers &... cs) |
| Parallel fold/reduce over N zipped containers (variadic). | |
| template<typename T , typename Op , typename Combiner , typename... Containers> | |
| T | pzip_foldl_n (T init, Op op, Combiner combiner, const ParallelOptions &options, const Containers &... cs) |
| template<typename Pred , typename... Containers> | |
| bool | pzip_all_n (ThreadPool &pool, Pred pred, const Containers &... cs) |
| Parallel all predicate over N zipped containers (variadic). | |
| template<typename Pred , typename... Containers> | |
| bool | pzip_all_n (Pred pred, const ParallelOptions &options, const Containers &... cs) |
| template<typename Pred , typename... Containers> | |
| bool | pzip_exists_n (ThreadPool &pool, Pred pred, const Containers &... cs) |
| Parallel exists predicate over N zipped containers (variadic). | |
| template<typename Pred , typename... Containers> | |
| bool | pzip_exists_n (Pred pred, const ParallelOptions &options, const Containers &... cs) |
| template<typename Pred , typename... Containers> | |
| size_t | pzip_count_if_n (ThreadPool &pool, Pred pred, const Containers &... cs) |
| Parallel count over N zipped containers (variadic). | |
| template<typename Pred , typename... Containers> | |
| size_t | pzip_count_if_n (Pred pred, const ParallelOptions &options, const Containers &... cs) |
| template<typename Container , typename Op > | |
| void | penumerate_for_each (ThreadPool &pool, Container &c, Op op, size_t chunk_size=0) |
| Parallel for_each with index (enumerate). | |
| template<typename Container , typename Op > | |
| void | penumerate_for_each (Container &c, Op op, const ParallelOptions &options={}) |
| template<typename Container , typename Op > | |
| void | penumerate_for_each (ThreadPool &pool, const Container &c, Op op, size_t chunk_size=0) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Parallel enumerate_for_each for const containers. | |
| template<typename Container , typename Op > | |
| void | penumerate_for_each (const Container &c, Op op, const ParallelOptions &options={}) |
| template<typename Container , typename Op > | |
| auto | penumerate_maps (ThreadPool &pool, const Container &c, Op op, size_t chunk_size=0) |
| Parallel enumerate with map. | |
| template<typename Container , typename Op > | |
| auto | penumerate_maps (const Container &c, Op op, const ParallelOptions &options={}) |
| ThreadPool & | parallel_default_pool () |
| Global default pool for parallel operations. | |
| template<typename Range , typename Cmp > | |
| void | sort_range (Range &r, Cmp cmp) |
| Sort a whole range in place, portably across the ranges divide. | |
| template<typename Range > | |
| void | sort_range (Range &r) |
Sort a whole range in place using the default < ordering. | |
| template<typename T = int> | |
| std::vector< T > | stl_range (T start, T end, T step=1) |
| Generate a range of values [start, end] with given step. | |
| template<typename T = int> | |
| std::vector< T > | stl_range (T n) |
| Generate a range [0, n-1]. | |
| template<typename T = double> | |
| std::vector< T > | stl_linspace (T start, T end, size_t n) |
| Generate n evenly spaced values between start and end. | |
| template<typename T > | |
| std::vector< T > | stl_rep (size_t n, const T &value) |
| Generate a vector of n repeated values. | |
| template<typename Gen > | |
| auto | stl_generate (size_t n, Gen &&gen) |
| Generate a vector using a generator function. | |
| template<typename Op , typename Container > | |
| void | stl_for_each (Op &&op, const Container &c) |
| Apply operation to each element (for_each). | |
| template<typename Op , typename Container > | |
| void | stl_for_each_indexed (Op &&op, const Container &c) |
| Apply operation to each element with index. | |
| template<typename Op , typename Container > | |
| auto | stl_map (Op &&op, const Container &c) |
| Map operation - transform each element. | |
| template<typename Op , typename Container > | |
| auto | stl_mapi (Op &&op, const Container &c) |
| Map with index (mapi in ML). | |
| template<typename Pred , typename Container > | |
| auto | stl_filter (Pred &&pred, const Container &c) |
| Filter elements satisfying predicate. | |
| template<typename Pred , typename Container > | |
| auto | stl_filteri (Pred &&pred, const Container &c) |
| Filter with index (filteri in ML). | |
| template<typename T , typename Op , typename Container > | |
| T | stl_foldl (T init, Op &&op, const Container &c) |
| Left fold (foldl) - reduce from left to right. | |
| template<typename T , typename Op , typename Container > | |
| T | stl_foldr (T init, Op &&op, const Container &c) |
| Right fold (foldr) - reduce from right to left. | |
| template<typename T , typename Op , typename Container > | |
| std::vector< T > | stl_scan_left (T init, Op &&op, const Container &c) |
| Scan left - fold with all intermediate results. | |
| template<typename T , typename Op , typename Container > | |
| std::vector< T > | stl_scan_right (T init, Op &&op, const Container &c) |
| Scan right - right fold with all intermediate results. | |
| template<typename T , typename Op , typename Container > | |
| T | stl_reduce (T init, Op &&op, const Container &c) |
| Alias for stl_foldl. | |
| template<typename Pred , typename Container > | |
| bool | stl_all (Pred &&pred, const Container &c) |
| Check if all elements satisfy predicate. | |
| template<typename Pred , typename Container > | |
| bool | stl_exists (Pred &&pred, const Container &c) |
| Check if any element satisfies predicate. | |
| template<typename Pred , typename Container > | |
| bool | stl_any (Pred &&pred, const Container &c) |
| Alias for stl_exists. | |
| template<typename Pred , typename Container > | |
| bool | stl_none (Pred &&pred, const Container &c) |
| Check if no element satisfies predicate. | |
| template<typename Pred , typename Container > | |
| auto | stl_find (Pred &&pred, const Container &c) |
| Find first element satisfying predicate. | |
| template<typename Pred , typename Container > | |
| auto | stl_find_last (Pred &&pred, const Container &c) |
| Find last element satisfying predicate. | |
| template<typename Pred , typename Container > | |
| std::optional< size_t > | stl_find_index (Pred &&pred, const Container &c) |
| Find index of first element satisfying predicate. | |
| template<typename Op , typename Container > | |
| auto | stl_find_mapi (Op &&op, const Container &c) |
| Find and map with index (find_mapi in ML). | |
| template<typename T , typename Container > | |
| bool | stl_mem (const T &target, const Container &c) |
| Check if element exists in container (mem in ML). | |
| template<typename Pred , typename Container > | |
| size_t | stl_count (Pred &&pred, const Container &c) |
| Count elements satisfying predicate. | |
| template<typename T , typename Container > | |
| size_t | stl_count_value (const T &target, const Container &c) |
| Count occurrences of a value. | |
| template<typename Container > | |
| auto | stl_take (size_t n, const Container &c) |
| Take first n elements. | |
| template<typename Container > | |
| auto | stl_drop (size_t n, const Container &c) |
| Drop first n elements, return the rest. | |
| template<typename Container > | |
| auto | stl_take_last (size_t n, const Container &c) |
| Take last n elements. | |
| template<typename Pred , typename Container > | |
| auto | stl_take_while (Pred &&pred, const Container &c) |
| Take elements while predicate is true. | |
| template<typename Pred , typename Container > | |
| auto | stl_drop_while (Pred &&pred, const Container &c) |
| Drop elements while predicate is true, return the rest. | |
| template<typename Container > | |
| auto | stl_first (const Container &c) |
| Get first element. | |
| template<typename Container > | |
| auto | stl_last (const Container &c) |
| Get last element. | |
| template<typename Container > | |
| auto | stl_nth (const size_t n, const Container &c) |
| Get n-th element. | |
| template<typename Container > | |
| auto | stl_min (const Container &c) |
| Get minimum element. | |
| template<typename Container > | |
| auto | stl_max (const Container &c) |
| Get maximum element. | |
| template<typename Container > | |
| auto | stl_min_max (const Container &c) |
| Get both min and max in a single pass. | |
| template<typename Key , typename Container > | |
| auto | stl_min_by (Key &&key, const Container &c) |
| Get minimum element by key function. | |
| template<typename Key , typename Container > | |
| auto | stl_max_by (Key &&key, const Container &c) |
| Get maximum element by key function. | |
| template<typename Container > | |
| auto | stl_sum (const Container &c) |
| Sum all elements. | |
| template<typename Container > | |
| auto | stl_product (const Container &c) |
| Product of all elements. | |
| template<typename Pred , typename Container > | |
| auto | stl_partition (Pred &&pred, const Container &c) |
| Partition elements by predicate. | |
| template<typename Container1 , typename Container2 > | |
| auto | stl_zip_to_pairs (const Container1 &c1, const Container2 &c2) |
| Zip two containers into pairs. | |
| template<typename Container > | |
| auto | stl_unzip_pairs (const Container &c) |
| Unzip pairs into two vectors. | |
| template<typename Container > | |
| auto | stl_enumerate_to_pairs (const Container &c) |
| Enumerate container (return pairs of index and element). | |
| template<typename Container1 , typename Container2 > | |
| bool | stl_equal (const Container1 &c1, const Container2 &c2) |
| Check equality of two containers. | |
| template<typename Container1 , typename Container2 > | |
| int | stl_compare (const Container1 &c1, const Container2 &c2) |
| Compare two containers lexicographically. | |
| template<typename Container > | |
| auto | stl_reverse (const Container &c) |
| Return reversed copy of container. | |
| template<typename Container > | |
| auto | stl_sort (const Container &c) |
| Return sorted copy of container. | |
| template<typename Cmp , typename Container > | |
| auto | stl_sort_by (Cmp &&cmp, const Container &c) |
| Return sorted copy using custom comparator. | |
| template<typename Container > | |
| auto | stl_unique (const Container &c) |
| Remove consecutive duplicates. | |
| template<typename Container > | |
| auto | stl_distinct (const Container &c) |
| Remove all duplicates (keeps first occurrence). | |
| template<typename Container1 , typename Container2 > | |
| auto | stl_concat (const Container1 &c1, const Container2 &c2) |
| Concatenate two containers. | |
| template<typename Container > | |
| auto | stl_flatten (const Container &c) |
| Flatten a container of containers. | |
| template<typename Op , typename Container > | |
| auto | stl_flat_map (Op &&op, const Container &c) |
| Flat map - map then flatten. | |
| template<typename Container > | |
| auto | stl_group (const Container &c) |
| Group consecutive equal elements. | |
| template<typename Key , typename Container > | |
| auto | stl_group_by (Key &&key, const Container &c) |
| Group elements by key function. | |
| template<typename Op , typename Container > | |
| bool | stl_traverse_permutations (Op &&op, const Container &c) |
| Traverse all permutations of a container. | |
| template<typename Container > | |
| auto | stl_permutations (const Container &c) |
| Generate all permutations of a container. | |
| template<typename Op , typename Container > | |
| bool | stl_traverse_combinations (size_t k, Op &&op, const Container &c) |
| Traverse all k-combinations of a container. | |
| template<typename Container > | |
| auto | stl_combinations (size_t k, const Container &c) |
| Generate all k-combinations of a container. | |
| template<typename Op , typename Container > | |
| bool | stl_traverse_arrangements (size_t k, Op &&op, const Container &c) |
| Traverse all k-arrangements (k-permutations) of a container. | |
| template<typename Container > | |
| auto | stl_arrangements (size_t k, const Container &c) |
| Generate all k-arrangements (k-permutations) of a container. | |
| template<typename T > | |
| auto | stl_cartesian_product (const std::vector< std::vector< T > > &containers) |
| Generate cartesian product of multiple containers. | |
| template<typename Container > | |
| auto | stl_power_set (const Container &c) |
| Generate power set (all subsets) of a container. | |
| template<typename Container > | |
| auto | stl_sliding_window (size_t n, const Container &c) |
| Sliding window of size n over container (each_cons in Ruby). | |
| template<typename Container > | |
| auto | stl_chunks (size_t n, const Container &c) |
| Split container into chunks of size n (each_slice in Ruby). | |
| template<typename T , typename Container > | |
| auto | stl_intersperse (const T &sep, const Container &c) |
| Insert element between each pair (intersperse in Haskell). | |
| template<typename Container > | |
| auto | stl_split_at (size_t n, const Container &c) |
| Split at position n, returning (take n, drop n) in one pass. | |
| template<typename Pred , typename Container > | |
| auto | stl_span (Pred &&pred, const Container &c) |
| Split at predicate boundary (span in Haskell). | |
| template<typename Container > | |
| auto | stl_init (const Container &c) |
| Get all elements except the last (init in Haskell). | |
| template<typename Container > | |
| auto | stl_tail (const Container &c) |
| Get all elements except the first (tail in Haskell). | |
| template<typename Container > | |
| auto | stl_tally (const Container &c) |
| Count occurrences of each element (tally in Ruby, frequencies). | |
| template<typename Pred , typename Container > | |
| auto | stl_reject (Pred &&pred, const Container &c) |
| Filter out elements (reject in Ruby, opposite of filter). | |
| template<class F , class... Ts, std::size_t... Is> | |
| void | tuple_for_each (const std::tuple< Ts... > &tuple, F func, std::index_sequence< Is... >) |
| Apply a function to each element in a tuple (tuple first). | |
| template<class F , class... Ts> | |
| void | tuple_for_each (const std::tuple< Ts... > &tuple, F func) |
| Convenience overload that automatically generates the index sequence. | |
| template<typename T > | |
| DynList< T > | to_DynList (const std::vector< T > &v) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Alias for vector_to_DynList. | |
| template<typename Iterator > | |
| auto | range_to_DynList (Iterator begin, Iterator end) -> DynList< std::decay_t< decltype(*begin)> > |
| Convert an iterator range to a DynList. | |
| template<typename T > | |
| Array< T > | to_Array (const std::vector< T > &v) |
| Convert a std::vector to an Array. | |
| template<typename T , class Op > | |
| auto | map_vector (const std::vector< T > &v, Op op) -> std::vector< std::decay_t< decltype(op(v[0]))> > |
| Map a function over a std::vector. | |
| template<typename T , typename... Args> | |
| std::vector< T > | variadic_to_vector (Args &&... args) |
| Convert a variadic parameter pack to a std::vector. | |
| template<typename T , typename... Args> | |
| DynList< T > | variadic_to_DynList (Args &&... args) |
| Convert a variadic parameter pack to a DynList. | |
| template<class Container , typename T , typename... U> | |
| Container | tuple_to_container (const std::tuple< T, U... > &t) |
| Convert a tuple to an Aleph-w container. | |
| template<typename T , typename... U> | |
| DynList< T > | tuple_to_dynlist (const std::tuple< T, U... > &t) |
| Convert a tuple to a DynList. | |
| template<typename T , typename... U> | |
| Array< T > | tuple_to_array (const std::tuple< T, U... > &t) |
| Convert a tuple to an Array. | |
| template<typename StlContainer > | |
| auto | stl_container_to_dynList (const StlContainer &container) -> DynList< typename StlContainer::value_type > |
| Convert any STL container to a DynList. | |
| template<typename T > | |
| DynList< T > | list_to_DynList (const std::list< T > &l) |
| Convert a std::list to a DynList. | |
| template<typename T > | |
| std::list< T > | DynList_to_list (const DynList< T > &l) |
| Convert a DynList to a std::list. | |
| template<typename T > | |
| std::vector< T > | DynArray_to_vector (const DynArray< T > &arr) |
| Convert a DynArray to a std::vector. | |
| template<typename... Containers> | |
| constexpr auto | stl_zip (const Containers &... cs) |
| Create a lazy zip view over STL containers. | |
| template<typename... Containers> | |
| constexpr auto | stl_zip_it (const Containers &... cs) |
| Get a zip iterator over STL containers. | |
| template<typename Pred , typename... Containers> | |
| bool | stl_zip_all (Pred &&pred, const Containers &... cs) |
| Check if predicate holds for all zipped tuples. | |
| template<typename Pred , typename... Containers> | |
| bool | stl_zip_all_eq (Pred &&pred, const Containers &... cs) |
| Check if predicate holds for all tuples AND containers have equal length. | |
| template<typename Pred , typename... Containers> | |
| bool | stl_zip_exists (Pred &&pred, const Containers &... cs) |
| Check if predicate holds for any zipped tuple. | |
| template<typename Pred , typename... Containers> | |
| bool | stl_zip_any (Pred &&pred, const Containers &... cs) |
| Alias for stl_zip_exists (Python/JS style name) | |
| template<typename Pred , typename... Containers> | |
| bool | stl_zip_none (Pred &&pred, const Containers &... cs) |
| Check if no tuple satisfies the predicate. | |
| template<typename Op , typename... Containers> | |
| void | stl_zip_for_each (Op &&op, const Containers &... cs) |
| Apply operation to each zipped tuple (for side effects). | |
| template<typename Op , typename... Containers> | |
| void | stl_zip_for_each_indexed (Op &&op, const Containers &... cs) |
| Apply operation to each tuple with its index. | |
| template<typename T , typename Op , typename... Containers> | |
| T | stl_zip_foldl (T init, Op &&op, const Containers &... cs) |
| Left fold over zipped tuples. | |
| template<typename T , typename Op , typename... Containers> | |
| T | stl_zip_reduce (T init, Op &&op, const Containers &... cs) |
| Alias for stl_zip_foldl (alternative name) | |
| template<typename Op , typename... Containers> | |
| auto | stl_zip_map (Op &&op, const Containers &... cs) |
| Map operation over zipped tuples, returning a vector. | |
| template<typename Pred , typename... Containers> | |
| auto | stl_zip_filter (Pred &&pred, const Containers &... cs) |
| Filter zipped tuples by predicate. | |
| template<typename Pred , typename... Containers> | |
| auto | stl_zip_find_first (Pred &&pred, const Containers &... cs) |
| Find first tuple satisfying predicate. | |
| template<typename Pred , typename... Containers> | |
| size_t | stl_zip_count (Pred &&pred, const Containers &... cs) |
| Count tuples satisfying predicate. | |
| template<typename... Containers> | |
| size_t | stl_zip_length (const Containers &... cs) |
| Count total tuples (minimum length of containers). | |
| template<typename... Containers> | |
| bool | stl_zip_equal_length (const Containers &... cs) |
| Check if all containers have equal length. | |
| template<typename... Containers> | |
| auto | stl_zip_nth (const size_t n, const Containers &... cs) |
| Get n-th tuple from zipped containers. | |
| template<typename... Containers> | |
| auto | stl_zip_take (const size_t n, const Containers &... cs) |
| Take first n tuples from zipped containers. | |
| template<typename... Containers> | |
| auto | stl_zip_drop (const size_t n, const Containers &... cs) |
| Skip first n tuples, return the rest. | |
| template<typename Pred , typename... Containers> | |
| auto | stl_zip_partition (Pred &&pred, const Containers &... cs) |
| Partition tuples by predicate. | |
| template<typename... Containers> | |
| auto | stl_zip_to_vector (const Containers &... cs) |
| Materialize zipped tuples into a vector. | |
| template<typename Pred , typename... Containers> | |
| bool | stl_zip_traverse (Pred &&pred, const Containers &... cs) |
| Traverse while predicate returns true. | |
| template<typename Pred , typename... Containers> | |
| bool | stl_zip_traverse_eq (Pred &&pred, const Containers &... cs) |
| Traverse while predicate returns true, verify equal lengths. | |
| template<typename Cmp , typename... Containers> | |
| bool | stl_zip_cmp (Cmp &&cmp, const Containers &... cs) |
| Compare elements across containers using a comparator. | |
| template<typename Container > | |
| constexpr auto | stl_enumerate (const Container &c) |
| Create an enumerate view over a container. | |
| template<typename Pred , typename... Containers> | |
| auto | stl_zip_take_while (Pred &&pred, const Containers &... cs) |
| Take tuples while predicate returns true. | |
| template<typename Pred , typename... Containers> | |
| auto | stl_zip_drop_while (Pred &&pred, const Containers &... cs) |
| Skip tuples while predicate returns true, then return the rest. | |
| template<typename... Containers> | |
| auto | stl_zip_first (const Containers &... cs) |
| Get first tuple from zipped containers. | |
| template<typename... Containers> | |
| auto | stl_zip_last (const Containers &... cs) |
| Get last tuple from zipped containers. | |
| template<typename Pred , typename... Containers> | |
| auto | stl_zip_find_last (Pred &&pred, const Containers &... cs) |
| Find last tuple satisfying predicate. | |
| template<typename Pred , typename... Containers> | |
| size_t | stl_zip_find_index (Pred &&pred, const Containers &... cs) |
| Find index of first tuple satisfying predicate. | |
| template<typename T , typename U > | |
| auto | stl_unzip (const std::vector< std::pair< T, U > > &pairs) |
| Unzip a vector of pairs into two vectors. | |
| template<typename... Ts> | |
| auto | stl_unzip_tuple (const std::vector< std::tuple< Ts... > > &tuples) |
| Unzip a vector of tuples into a tuple of vectors. | |
| template<typename Container > | |
| auto | stl_adjacent (const Container &c) |
| Zip adjacent (consecutive) elements of a container. | |
| template<typename Op , typename Container > | |
| auto | stl_adjacent_map (Op &&op, const Container &c) |
| Apply function to adjacent pairs of elements. | |
| template<typename Pred , typename Container > | |
| bool | stl_adjacent_all (Pred &&pred, const Container &c) |
| Check if predicate holds for all adjacent pairs. | |
| template<typename Pred , typename Container > | |
| bool | stl_adjacent_exists (Pred &&pred, const Container &c) |
| Check if predicate holds for any adjacent pair. | |
| template<typename Op , typename... Containers> | |
| auto | stl_zip_mapi (Op &&op, const Containers &... cs) |
| Map with index (mapi in ML). | |
| template<typename Pred , typename... Containers> | |
| auto | stl_zip_filteri (Pred &&pred, const Containers &... cs) |
| Filter with index (filteri in ML). | |
| template<typename T , typename Op , typename... Containers> | |
| auto | stl_zip_scan_left (T init, Op &&op, const Containers &... cs) |
| Scan left (scan_left in ML) - fold with intermediate results. | |
| template<typename Op , typename... Containers> | |
| auto | stl_zip_find_mapi (Op &&op, const Containers &... cs) |
| Find and map with index (find_mapi in ML). | |
| template<typename... Containers> | |
| bool | stl_zip_equal (const Containers &... cs) |
| Check equality of zipped sequences. | |
| template<typename Eq , typename... Containers> | |
| bool | stl_zip_equal_by (Eq &&eq, const Containers &... cs) |
| Check equality with custom comparator. | |
| template<typename... Containers1, typename... Containers2> | |
| int | stl_zip_compare (const std::tuple< const Containers1 &... > &cs1, const std::tuple< const Containers2 &... > &cs2) |
| Compare two zipped sequences lexicographically. | |
| template<typename Tuple , typename... Containers> | |
| bool | stl_zip_mem (const Tuple &target, const Containers &... cs) |
| Check if a tuple exists in the zipped sequence (mem in ML). | |
| template<typename Key , typename... Containers> | |
| auto | stl_zip_assoc (const Key &key, const Containers &... cs) |
| Find value associated with key in zipped pairs (assoc in ML). | |
| template<typename... Containers> | |
| auto | stl_zip_min (const Containers &... cs) |
| Get minimum tuple according to comparator. | |
| template<typename... Containers> | |
| auto | stl_zip_max (const Containers &... cs) |
| Get maximum tuple according to comparator. | |
| template<typename... Containers> | |
| auto | stl_zip_min_max (const Containers &... cs) |
| Get both min and max in a single pass. | |
| template<typename... Containers> | |
| auto | stl_zip_sum (const Containers &... cs) |
| Sum all tuples element-wise (requires + operator on tuple elements). | |
| template<typename T > | |
| std::string | to_string (const std::vector< T > &v) |
Convert a std::vector<T> to a comma-separated std::string. | |
| template<typename T > | |
| std::string | to_string (const Array< T > &v) |
Convert an Aleph::Array<T> to a comma-separated std::string. | |
| void | ltrim (std::string &s) |
| Remove leading whitespace from a std::string in-place. | |
| void | rtrim (std::string &s) |
| Remove trailing whitespace from a std::string in-place. | |
| template<class... Args> | |
| std::string | concat (const Args &...args) |
| Concatenate multiple arguments into a single std::string. | |
| std::string | trim (const std::string &s) |
| Return a trimmed copy of a std::string (leading + trailing whitespace removed). | |
| std::string & | trim_in_place (std::string &s) |
| Trim a std::string in-place (leading + trailing whitespace removed). | |
| bool | contains (const std::string_view &str, const std::string_view &substr) |
Check if substr appears inside str. | |
| std::string | to_string (const double d, const size_t precision) |
Format a double using fixed notation with the given precision. | |
| std::string | to_str (const double d) |
Convert double to a std::string with maximum round-trip precision. | |
| std::string | tolower (const char *str) |
| Convert a C std::string to lower-case. | |
| std::string | toupper (const char *str) |
| Convert a C std::string to upper-case. | |
| std::string | tolower (const std::string &str) |
Convert a std::string to lower-case. | |
| std::string | toupper (const std::string &str) |
Convert a std::string to upper-case. | |
| std::string & | mutable_tolower (std::string &str) |
| Convert a std::string to lower-case in-place. | |
| std::string & | mutable_toupper (std::string &str) |
| Convert a std::string to upper-case in-place. | |
| std::string | only_alpha (const std::string &str) |
| Extract alphanumeric ASCII characters and normalize letters to lower-case. | |
| std::string | remove_spaces (const std::string &str) |
| Remove all whitespace characters from a std::string. | |
| std::string | remove_symbols (const std::string &str, const std::string &symbols) |
Remove any character appearing in symbols. | |
| template<class C > | |
| std::ostream & | join (const C &c, const std::string &sep, std::ostream &out) |
| Join elements of an Aleph-style container into a stream. | |
| template<class C > | |
| std::string | join (const C &c, const std::string &sep=" ") |
| Join elements of an Aleph-style container into a std::string. | |
| bool | is_double (const std::string &str) |
Check whether a std::string fully parses as a finite double. | |
| bool | is_float (const std::string &str) |
Check whether a std::string fully parses as a finite float. | |
| bool | is_long (const std::string &str) |
Check whether a std::string fully parses as a long. | |
| bool | is_size_t (const std::string &str) |
Check whether a std::string fully parses as a non-negative size_t. | |
| long | safe_atol (const std::string &s) |
Convert a std::string to long and throw on parse errors. | |
| double | safe_atof (const std::string &s) |
Convert a std::string to double and throw on parse errors. | |
| bool | is_prefix (const std::string &str, const std::string &prefix) |
Check whether prefix is a prefix of str. | |
| std::string | remove_prefix (std::string &str, const std::string &prefix) |
Remove prefix from str if present. | |
| std::string | to_lower (const std::string &str) |
| Convert a std::string to lower-case (byte-wise). | |
| std::string | to_upper (const std::string &str) |
| Convert a std::string to upper-case (byte-wise). | |
| std::string | to_name (const std::string &str) |
Uppercase the first character of str and return the resulting copy. | |
| DynList< std::string > | split_camel_case (const char *const str) |
| Split a camelCase / PascalCase std::string into tokens. | |
| DynList< std::string > | split_camel_case (const std::string &str) |
| Split a camelCase / PascalCase std::string into tokens. | |
| void | fill_string (std::string &str, char sym) |
| Fill all the content of std::string with a defined char. | |
| std::vector< std::string > & | split (const std::string &s, const char delim, std::vector< std::string > &elems) |
| Split a std::string by a single delimiter character. | |
| std::vector< std::string > | split (const std::string &s, const char delim) |
| Split a std::string by a single delimiter character. | |
| template<template< typename > class Container = DynList> | |
| Container< std::string > | split_string (const std::string &s, const std::string &delim) |
| Split a std::string by a set of delimiter characters. | |
| DynList< std::string > | split_to_list (const std::string &s, const std::string &delim) |
Split a std::string into an Aleph::DynList<std::string>. | |
| std::string | to_Pascalcase (const std::string &str) |
| Convert an identifier-like std::string to PascalCase. | |
| Array< std::string > | split_to_array (const std::string &s, const std::string &delim) |
Split a std::string into an Aleph::Array<std::string>. | |
| std::pair< std::string, std::string > | split_pos (const std::string &str, const size_t pos) |
| Split a std::string at a fixed position. | |
| DynList< std::string > | split_n (const std::string &str, const size_t n) |
Split a std::string into n parts. | |
| template<typename T > | |
| DynList< DynList< T > > | complete_rows (DynList< DynList< T > > &m) |
| Pad all rows of a matrix to the maximum row length. | |
| DynList< DynList< std::string > > | format_string (const DynList< size_t > &lens, const DynList< DynList< std::string > > &mat) |
| std::ostream & | format_string (std::ostream &out, const DynList< size_t > &lens, const DynList< DynList< std::string > > &mat) |
| Write a formatted matrix to a stream. | |
| DynList< DynList< std::string > > | format_string (const DynList< DynList< std::string > > &mat) |
| Format a matrix by computing column widths. | |
| DynList< DynList< std::string > > | format_string_csv (const DynList< DynList< std::string > > &mat) |
| Produce a CSV-like matrix (commas added to all but last element in each row). | |
| std::string | to_string (const DynList< DynList< std::string > > &mat) |
| Convert a matrix of strings to a single std::string. | |
| DynList< std::string > | split_text_into_words (const std::string &text) |
| Split a text into whitespace-separated words. | |
| DynList< std::string > | split_text_into_lines (const std::string &text) |
Split a text into lines by "\n". | |
| std::string | to_string (const DynList< std::string > &lines) |
| Join lines into a single std::string separated by newlines. | |
| std::string | justify_line (std::string line, const size_t page_width) |
| Justify a single line by inserting extra spaces. | |
| std::string | justify_text (const std::string &text, const size_t width, const size_t left_margin=0) |
| Justify a text to a target width. | |
| std::string | justify_line_except_first (const std::string &text, const size_t width, const size_t left_margin=0) |
| Justify all lines except the first one. | |
| std::string | align_text_to_left (const std::string &text, const size_t page_width, const size_t left_margin=0) |
Align text to the left by wrapping lines at page_width. | |
| std::string | align_text_to_left_except_first (const std::string &text, const size_t width, const size_t left_margin=0) |
| Align all lines except the first one. | |
| std::string | shift_lines_to_left (const std::string &str, const size_t n) |
Indent every line in a multi-line std::string by n spaces. | |
| void | build_pars_list (std::string &unused) |
Base case for build_pars_list(std::string&, ...). | |
| template<typename T > requires requires(std::ostream &out, const T &v) { out << v; } | |
| void | build_pars_list (std::string &str, const T &item) |
| template<class T , class... Args> | |
| void | build_pars_list (std::string &str, const T &item, Args... args) |
| Append multiple parameters to a comma-separated parameter list. | |
| template<class First , class... Rest> requires (not requires(const std::remove_reference_t<First> &c) { c.is_empty(); c.get_last(); c.get_it(); }) | |
| std::string | build_pars_list (const First &first, const Rest &...rest) |
| Build a stringified parameters' list. | |
| template<class C > requires requires(const C &c) { c.is_empty(); c.get_last(); c.get_it(); } | |
| std::string | build_pars_list (const C &c, const std::string &sep=",") |
| template<typename Op , typename Container > | |
| void | uni_for_each (Op &&op, const Container &c) |
| Apply operation to each element (for_each). | |
| template<typename Op , typename Container > | |
| void | uni_for_each_indexed (Op &&op, const Container &c) |
| Apply operation to each element with index. | |
| template<typename Op , typename Container > | |
| auto | uni_map (Op &&op, const Container &c) |
| Map operation - transform each element. | |
| template<typename Op , typename Container > | |
| auto | uni_mapi (Op &&op, const Container &c) |
| Map with index (mapi in ML). | |
| template<typename Pred , typename Container > | |
| auto | uni_filter (Pred &&pred, const Container &c) |
| Filter elements satisfying predicate. | |
| template<typename Pred , typename Container > | |
| auto | uni_filteri (Pred &&pred, const Container &c) |
| Filter with index (filteri in ML). | |
| template<typename T , typename Op , typename Container > | |
| T | uni_foldl (T init, Op &&op, const Container &c) |
| Left fold (foldl) - reduce from left to right. | |
| template<typename T , typename Op , typename Container > | |
| T | uni_reduce (T init, Op &&op, const Container &c) |
| Alias for uni_foldl. | |
| template<typename T , typename Op , typename Container > | |
| std::vector< T > | uni_scan_left (T init, Op &&op, const Container &c) |
| Scan left - fold with all intermediate results. | |
| template<typename Pred , typename Container > | |
| bool | uni_all (Pred &&pred, const Container &c) |
| Check if all elements satisfy predicate. | |
| template<typename Pred , typename Container > | |
| bool | uni_exists (Pred &&pred, const Container &c) |
| Check if any element satisfies predicate. | |
| template<typename Pred , typename Container > | |
| bool | uni_any (Pred &&pred, const Container &c) |
| Alias for uni_exists. | |
| template<typename Pred , typename Container > | |
| bool | uni_none (Pred &&pred, const Container &c) |
| Check if no element satisfies predicate. | |
| template<typename Pred , typename Container > | |
| auto | uni_find (Pred &&pred, const Container &c) |
| Find first element satisfying predicate. | |
| template<typename Pred , typename Container > | |
| std::optional< size_t > | uni_find_index (Pred &&pred, const Container &c) |
| Find index of first element satisfying predicate. | |
| template<typename Op , typename Container > | |
| auto | uni_find_mapi (Op &&op, const Container &c) |
| Find and map with index (find_mapi in ML). | |
| template<typename T , typename Container > | |
| bool | uni_mem (const T &target, const Container &c) |
| Check if element exists in container (mem in ML). | |
| template<typename Pred , typename Container > | |
| size_t | uni_count (Pred &&pred, const Container &c) |
| Count elements satisfying predicate. | |
| template<typename Container > | |
| size_t | uni_length (const Container &c) |
| Get container length. | |
| template<typename Container > | |
| auto | uni_take (size_t n, const Container &c) |
| Take first n elements. | |
| template<typename Container > | |
| auto | uni_drop (size_t n, const Container &c) |
| Drop first n elements, return the rest. | |
| template<typename Pred , typename Container > | |
| auto | uni_take_while (Pred &&pred, const Container &c) |
| Take elements while predicate is true. | |
| template<typename Pred , typename Container > | |
| auto | uni_drop_while (Pred &&pred, const Container &c) |
| Drop elements while predicate is true, return the rest. | |
| template<typename Container > | |
| auto | uni_first (const Container &c) |
| Get first element. | |
| template<typename Container > | |
| auto | uni_last (const Container &c) |
| Get last element. | |
| template<typename Container > | |
| auto | uni_nth (size_t n, const Container &c) |
| Get n-th element. | |
| template<typename Container > | |
| auto | uni_min (const Container &c) |
| Get minimum element. | |
| template<typename Container > | |
| auto | uni_max (const Container &c) |
| Get maximum element. | |
| template<typename Container > | |
| auto | uni_min_max (const Container &c) |
| Get both min and max in a single pass. | |
| template<typename Container > | |
| auto | uni_sum (const Container &c) |
| Sum all elements. | |
| template<typename Container > | |
| auto | uni_product (const Container &c) |
| Product of all elements. | |
| template<typename Pred , typename Container > | |
| auto | uni_partition (Pred &&pred, const Container &c) |
| Partition elements by predicate. | |
| template<typename Container1 , typename Container2 > | |
| auto | uni_concat (const Container1 &c1, const Container2 &c2) |
| Concatenate two containers. | |
| template<typename Container > | |
| auto | uni_flatten (const Container &c) |
| Flatten a container of containers. | |
| template<typename Op , typename Container > | |
| auto | uni_flat_map (Op &&op, const Container &c) |
| Flat map - map then flatten. | |
| template<typename Container > | |
| auto | uni_distinct (const Container &c) |
| Remove all duplicates (keeps first occurrence). | |
| template<typename Key , typename Container > | |
| auto | uni_group_by (Key &&key, const Container &c) |
| Group elements by key function. | |
| template<typename Container > | |
| auto | uni_tally (const Container &c) |
| Count occurrences of each element (frequency count). | |
| template<typename Container > | |
| auto | uni_to_vector (const Container &c) |
| Convert container to std::vector. | |
| template<typename Container1 , typename Container2 > | |
| bool | uni_equal (const Container1 &c1, const Container2 &c2) |
| Check equality of two containers. | |
| template<typename Container1 , typename Container2 > | |
| int | uni_compare (const Container1 &c1, const Container2 &c2) |
| Compare two containers lexicographically. | |
| template<AlephSequential Container, class Compare = std::less<typename Container::Key_Type>> requires Aleph::StrictWeakOrder<Compare, typename Container::Key_Type> | |
| void | in_place_unique (Container &c, Compare cmp={}) |
| Remove duplicates in-place preserving first occurrence order. | |
| template<typename... Containers> | |
| auto | uni_zip (const Containers &...cs) |
| Create a lazy zip view over any combination of STL/Aleph containers. | |
| template<typename... Containers> | |
| auto | uni_zip_it (const Containers &...cs) |
| Get a unified zip iterator. | |
| template<typename Pred , typename... Containers> | |
| bool | uni_zip_all (Pred &&pred, const Containers &...cs) |
| Check if predicate holds for all zipped tuples. | |
| template<typename Pred , typename... Containers> | |
| bool | uni_zip_all_eq (Pred &&pred, const Containers &...cs) |
| Check if all tuples satisfy predicate AND containers have equal length. | |
| template<typename Pred , typename... Containers> | |
| bool | uni_zip_exists (Pred &&pred, const Containers &...cs) |
| Check if predicate holds for any zipped tuple. | |
| template<typename Pred , typename... Containers> | |
| bool | uni_zip_any (Pred &&pred, const Containers &...cs) |
| Alias for uni_zip_exists. | |
| template<typename Pred , typename... Containers> | |
| bool | uni_zip_none (Pred &&pred, const Containers &...cs) |
| Check if no tuple satisfies the predicate. | |
| template<typename Op , typename... Containers> | |
| void | uni_zip_for_each (Op &&op, const Containers &...cs) |
| Apply operation to each zipped tuple. | |
| template<typename Op , typename... Containers> | |
| void | uni_zip_for_each_indexed (Op &&op, const Containers &...cs) |
| Apply operation to each tuple with index. | |
| template<typename T , typename Op , typename... Containers> | |
| T | uni_zip_foldl (T init, Op &&op, const Containers &...cs) |
| Left fold over zipped tuples. | |
| template<typename T , typename Op , typename... Containers> | |
| T | uni_zip_reduce (T init, Op &&op, const Containers &...cs) |
| Alias for uni_zip_foldl. | |
| template<typename Op , typename... Containers> | |
| auto | uni_zip_map (Op &&op, const Containers &...cs) |
| Map operation over zipped tuples. | |
| template<typename Pred , typename... Containers> | |
| auto | uni_zip_filter (Pred &&pred, const Containers &...cs) |
| Filter zipped tuples by predicate. | |
| template<typename Pred , typename... Containers> | |
| auto | uni_zip_find_first (Pred &&pred, const Containers &...cs) |
| Find first tuple satisfying predicate. | |
| template<typename Pred , typename... Containers> | |
| size_t | uni_zip_count (Pred &&pred, const Containers &...cs) |
| Count tuples satisfying predicate. | |
| template<typename... Containers> | |
| size_t | uni_zip_length (const Containers &...cs) |
| Get zip length (minimum of all container sizes). | |
| template<typename... Containers> | |
| bool | uni_zip_equal_length (const Containers &...cs) |
| Check if all containers have equal length. | |
| template<typename... Containers> | |
| auto | uni_zip_nth (size_t n, const Containers &...cs) |
| Get n-th tuple from zipped containers. | |
| template<typename... Containers> | |
| auto | uni_zip_take (size_t n, const Containers &...cs) |
| Take first n tuples. | |
| template<typename... Containers> | |
| auto | uni_zip_drop (size_t n, const Containers &...cs) |
| Skip first n tuples, return the rest. | |
| template<typename Pred , typename... Containers> | |
| auto | uni_zip_take_while (Pred &&pred, const Containers &...cs) |
| Take tuples while predicate is true. | |
| template<typename Pred , typename... Containers> | |
| auto | uni_zip_drop_while (Pred &&pred, const Containers &...cs) |
| Skip tuples while predicate is true, return the rest. | |
| template<typename... Containers> | |
| auto | uni_zip_first (const Containers &...cs) |
| Get first tuple. | |
| template<typename... Containers> | |
| auto | uni_zip_last (const Containers &...cs) |
| Get last tuple. | |
| template<typename Pred , typename... Containers> | |
| auto | uni_zip_partition (Pred &&pred, const Containers &...cs) |
| Partition tuples by predicate. | |
| template<typename... Containers> | |
| auto | uni_zip_to_vector (const Containers &...cs) |
| Materialize zipped tuples into a vector. | |
| template<typename Pred , typename... Containers> | |
| bool | uni_zip_traverse (Pred &&pred, const Containers &...cs) |
| Traverse while predicate returns true. | |
| template<typename Op , typename... Containers> | |
| auto | uni_zip_mapi (Op &&op, const Containers &...cs) |
| Map with index (mapi in ML). | |
| template<typename Pred , typename... Containers> | |
| auto | uni_zip_filteri (Pred &&pred, const Containers &...cs) |
| Filter with index (filteri in ML). | |
| template<typename T , typename Op , typename... Containers> | |
| auto | uni_zip_scan_left (T init, Op &&op, const Containers &...cs) |
| Scan left - fold with intermediate results. | |
| template<typename Op , typename... Containers> | |
| auto | uni_zip_find_mapi (Op &&op, const Containers &...cs) |
| Find and map with index (find_mapi in ML). | |
| template<typename Eq , typename... Containers> | |
| bool | uni_zip_equal_by (Eq &&eq, const Containers &...cs) |
| Check equality with custom comparator. | |
| template<typename Tuple , typename... Containers> | |
| bool | uni_zip_mem (const Tuple &target, const Containers &...cs) |
| Check if a tuple exists in the zipped sequence (mem in ML). | |
| template<typename Key , typename... Containers> | |
| auto | uni_zip_assoc (const Key &key, const Containers &...cs) |
| Find value associated with key in zipped pairs (assoc in ML). | |
| template<typename... Containers> | |
| auto | uni_zip_min (const Containers &...cs) |
| Get minimum tuple. | |
| template<typename... Containers> | |
| auto | uni_zip_max (const Containers &...cs) |
| Get maximum tuple. | |
| template<typename... Containers> | |
| auto | uni_zip_min_max (const Containers &...cs) |
| Get both min and max in a single pass. | |
| template<typename Container > | |
| auto | uni_unzip (const Container &c) |
| Unzip a container of pairs into two DynLists. | |
| template<typename Container > | |
| auto | uni_unzip_tuple (const Container &c) |
| Unzip a container of tuples into a tuple of DynLists. | |
| template<typename... Containers> | |
| auto | uni_zip_to_dynlist (const Containers &...cs) |
| Materialize a zipped view into a DynList of tuples. | |
| ZipIterator (const HeadC &head, const TailC &...tail) | |
| Construct a zip iterator over multiple Aleph containers. | |
| bool | has_curr () const noexcept |
Return true if all underlying iterators are positioned on a valid item. | |
| bool | completed () const noexcept |
Return true if all underlying iterators are finished. | |
| auto | get_curr () const |
| Return the current tuple (bounds-checked). | |
| auto | get_curr_ne () const noexcept(zip_detail::nothrow_curr_copy< Aleph::const_iterator_t< HeadC >, T > and zip_detail::nothrow_item_copy< T > and zip_detail::nothrow_tail_curr< ZipIterator< TailC... > >) |
| Return the current tuple (unchecked variant). | |
| DynList< T > | get_curr_list () const |
| Returns current elements as a DynList (requires homogeneous Item_Type) | |
| void | next () |
| Advance all underlying iterators (bounds-checked). | |
| void | next_ne () noexcept(noexcept(std::declval< Aleph::const_iterator_t< HeadC > & >().next_ne()) and noexcept(std::declval< ZipIterator< TailC... > & >().next_ne())) |
| Advance all underlying iterators (unchecked variant). | |
| template<class... Cs> | |
| ZipIterator< Cs... > | get_zip_it (const Cs &...cs) |
| Create a ZipIterator over the given containers. | |
| template<class... Cs> | |
| ZipIterator< Cs... > | get_zip_it_pos (size_t pos, const Cs &...cs) |
Create a ZipIterator positioned at index pos. | |
| template<class... Cs> | |
| ZipIterator< Cs... > | zip_it (const Cs &...cs) |
Alias for get_zip_it. | |
| template<class... Cs> | |
| ZipIterator< Cs... > | zip_it_pos (size_t pos, const Cs &...cs) |
Alias for get_zip_it_pos. | |
| template<class... Cs> | |
| bool | equal_length (const Cs &...cs) |
Return true if all containers have the same length. | |
| template<class Op , class... Cs> | |
| bool | zip_traverse (Op &&op, const Cs &...cs) |
Traverse zipped containers while op returns true. | |
| template<class Op , class... Cs> | |
| bool | zip_traverse_eq (Op &&op, const Cs &...cs) |
Traverse zipped containers while op returns true; verify equal lengths. | |
| template<class Op , class... Cs> | |
| void | zip_for_each (Op &&op, const Cs &...cs) |
Apply op to every zipped tuple. | |
| template<class Op , class... Cs> | |
| void | zip_for_each_eq (Op &&op, const Cs &...cs) |
Apply op to every zipped tuple; throw if containers differ in length. | |
| template<class Op , class... Cs> | |
| bool | zip_all (Op &&op, const Cs &...cs) |
Return true if op returns true for all tuples and containers have equal length. | |
| template<class Op , class... Cs> | |
| bool | zip_all_short (Op &&op, const Cs &...cs) |
Return true if op returns true for all tuples (without length check). | |
| template<class Op , class... Cs> | |
| bool | zip_forall (Op &&op, const Cs &...cs) |
Alias for zip_all. | |
| template<class Op , class... Cs> | |
| bool | zip_forall_short (Op &&op, const Cs &...cs) |
Alias for zip_all_short. | |
| template<class Op , class... Cs> | |
| bool | zip_exists (Op &&op, const Cs &...cs) |
Return true if op returns true for at least one tuple. | |
| template<class Op , class... Cs> | |
| bool | zip_any (Op &&op, const Cs &...cs) |
Alias for zip_exists. | |
| template<class Op , class... Cs> | |
| bool | zip_none (Op &&op, const Cs &...cs) |
Return true if op returns false for all tuples. | |
| template<class Op , class... Cs> | |
| size_t | zip_count (Op &&op, const Cs &...cs) |
Count tuples that satisfy predicate op. | |
| template<class... Cs> | |
| size_t | zip_length (const Cs &...cs) |
| Count all tuples (minimum length of containers). | |
| template<class Op , class... Cs> | |
| auto | zip_find_first (Op &&op, const Cs &...cs) |
Return the first tuple that satisfies predicate op. | |
| template<class Op , class... Cs> | |
| auto | zip_find_last (Op &&op, const Cs &...cs) |
Return the last tuple that satisfies predicate op. | |
| template<class... Cs> | |
| auto | zip_nth (size_t n, const Cs &...cs) |
| Return the n-th tuple from zipped containers. | |
| template<class... Cs> | |
| auto | zip_first (const Cs &...cs) |
| Return the first tuple from zipped containers. | |
| template<typename T , class Op , class... Cs> | |
| DynList< T > | zip_maps (Op op, const Cs &...cs) |
Map op over zipped tuples, returning a list of results. | |
| template<typename T , class Prop , class Op , class... Cs> | |
| DynList< T > | zip_maps_if (Prop prop, Op op, const Cs &...cs) |
Map op over zipped tuples that satisfy prop. | |
| template<typename T , class Op , class... Cs> | |
| T | zip_foldl (const T &init, Op op, const Cs &...cs) |
| Left fold (reduce) over zipped tuples. | |
| template<typename T , class Op , class... Cs> | |
| T | zip_foldl_eq (const T &init, Op op, const Cs &...cs) |
| Left fold over zipped tuples; throw if containers differ in length. | |
| template<typename T , class Op , class... Cs> | |
| DynList< T > | zip_maps_eq (Op op, const Cs &...cs) |
Map op over zipped tuples; throw if containers differ in length. | |
| template<typename T , class Prop , class Op , class... Cs> | |
| DynList< T > | zip_maps_if_eq (Prop prop, Op op, const Cs &...cs) |
Map op over zipped tuples that satisfy prop; throw if lengths differ. | |
| template<class Op , class... Cs> | |
| auto | zip_map (Op &&op, const Cs &...cs) |
Map op over zipped tuples with auto-deduced return type. | |
| template<class Op , class... Cs> | |
| auto | zip_map_eq (Op &&op, const Cs &...cs) |
Map op over zipped tuples with auto-deduced return type; throw if lengths differ. | |
| template<class Op , class... Cs> | |
| auto | zip_filter (Op op, const Cs &...cs) |
Filter zipped tuples by predicate op. | |
| template<class Op , class... Cs> | |
| auto | zip_filter_eq (Op op, const Cs &...cs) |
Filter zipped tuples by predicate op; throw if containers differ in length. | |
| template<class Cmp , class... Cs> | |
| bool | zip_cmp (Cmp cmp, const Cs &...cs) |
Return true if cmp(t) is true for each built tuple t. | |
| template<class Op , class... Cs> | |
| size_t | zip_find_index (Op op, const Cs &...cs) |
Find the first index where op returns true. | |
| template<class Op , class... Cs> | |
| auto | zip_partition (Op op, const Cs &...cs) |
Partition zipped tuples by predicate op. | |
| template<class... Cs> | |
| auto | t_zip (const Cs &...cs) |
| Materialize zipped tuples into a DynList. | |
| template<class... Cs> | |
| auto | t_zip_eq (const Cs &...cs) |
| Materialize zipped tuples; throw if containers differ in length. | |
| EnumZipIterator (const HeadC &head, const TailC &...tail) | |
| Construct an enumerating zip iterator over multiple containers. | |
| template<class... Cs> | |
| EnumZipIterator< Cs... > | get_enum_zip_it (const Cs &...cs) |
| Create an EnumZipIterator over the given containers. | |
| template<class C , class... Cs> | |
| EnumZipIterator< C, Cs... > | get_enum_zip_it_pos (size_t pos, const C &c, const Cs &...cs) |
Create an EnumZipIterator positioned at index pos. | |
| template<class... Cs> | |
| EnumZipIterator< Cs... > | enum_zip_it (const Cs &...cs) |
Alias for get_enum_zip_it. | |
| template<class... Cs> | |
| EnumZipIterator< Cs... > | enum_zip_it_pos (size_t pos, const Cs &...cs) |
Alias for get_enum_zip_it_pos. | |
| template<class... Cs> | |
| auto | t_enum_zip (const Cs &...cs) |
| Materialize enumerated zipped tuples into a DynList. | |
| template<class... Cs> | |
| auto | t_enum_zip_eq (const Cs &...cs) |
| Materialize enumerated zipped tuples; throw if containers differ in length. | |
| template<typename... Ts, size_t... is> | |
| static auto | t_unzip_impl (const DynList< std::tuple< Ts... > > &l, std::index_sequence< is... >) |
| template<class... Ts> | |
| auto | t_unzip (const DynList< std::tuple< Ts... > > &tuples) |
| Unzip a list of tuples into a tuple of lists. | |
| template<class C , typename... Lists> | |
| auto | zip_lists (const C &c, const Lists &...lists) |
| Take several container of same type and some length and builds a list of lists. | |
| template<class C , typename... Lists> | |
| auto | zip_lists_eq (const C &c, const Lists &...lists) |
Like zip_lists but throws if containers differ in length. | |
| template<typename C1 , typename C2 > | |
| auto | std_zip (const C1 &c1, const C2 &c2) |
| Build a vector of pairs from two STL containers. | |
| template<typename... Cs> | |
| auto | tzip_std (const Cs &...cs) |
| Build a vector of tuples from 2 or more STL containers (variadic). | |
| template<typename... Cs> | |
| auto | std_zip_n (const Cs &...cs) |
| Build a vector of tuples from 2 or more STL containers (variadic). | |
| template<class Op , class... Cs> | |
| auto | zip_transform (Op &&op, const Cs &...cs) |
Transform zipped tuples using op and return results in a vector. | |
| template<class Op , class... Cs> | |
| auto | zip_transform_eq (Op &&op, const Cs &...cs) |
| Transform zipped tuples; throw if containers differ in length. | |
| template<class Op , class... Cs> | |
| void | zip_for_each_indexed (Op &&op, const Cs &...cs) |
Apply op to each zipped tuple along with its index. | |
| template<class Op , class... Cs> | |
| void | zip_for_each_indexed_eq (Op &&op, const Cs &...cs) |
Apply op to each zipped tuple with index; throw if lengths differ. | |
| template<class... Cs> | |
| auto | zip_take (size_t n, const Cs &...cs) |
Take at most n tuples from the zipped containers. | |
| template<class... Cs> | |
| auto | zip_drop (const size_t n, const Cs &...cs) |
Skip n tuples and return the rest. | |
| template<class Pred , class... Cs> | |
| auto | zip_take_while (Pred &&pred, const Cs &...cs) |
Take tuples while predicate pred returns true. | |
| template<class Pred , class... Cs> | |
| auto | zip_drop_while (Pred &&pred, const Cs &...cs) |
Skip tuples while predicate pred returns true, then return the rest. | |
| template<class Op , class Tuple > | |
| void | for_each_in_tuple (Op &&op, Tuple &&t) |
Apply op to each element of a tuple. | |
| template<class Op , class Tuple > | |
| auto | transform_tuple (Op &&op, Tuple &&t) |
| Transform each element of a tuple, returning a new tuple. | |
| template<class Pred , class Tuple > | |
| bool | all_of_tuple (Pred &&pred, const Tuple &t) |
Return true if all tuple elements satisfy pred. | |
| template<class Pred , class Tuple > | |
| bool | any_of_tuple (Pred &&pred, const Tuple &t) |
Return true if any tuple element satisfies pred. | |
| template<class Pred , class Tuple > | |
| bool | none_of_tuple (Pred &&pred, const Tuple &t) |
Return true if no tuple element satisfies pred. | |
| template<typename CleanupFunc > | |
| Init_Guard (CleanupFunc) -> Init_Guard< CleanupFunc > | |
| Deduction guide for Init_Guard. | |
| template<typename CleanupFunc > | |
| auto | make_init_guard (CleanupFunc f) |
| Create an Init_Guard with a cleanup function. | |
| template<typename Container , typename Iterator > | |
| void | verify_container_and_iterator (const Container &container, const Iterator &itor) |
| Verifies that an iterator belongs to a specific container. | |
| template<typename Iterator > | |
| void | verify_iterators (const Iterator &itor1, const Iterator &itor2) |
| Verifies that two iterators belong to the same container. | |
| template<typename Container , typename Iterator > | |
| void | verify_container_and_iterators (const Container &container, const Iterator &itor_container, const Iterator &itor1, const Iterator &itor2) |
| Verifies container-iterator relationships with distinctness check. | |
| template<typename Container , typename Iterator > | |
| void | verify_container_and_iterators (const Container &container, const Iterator &itor1, const Iterator &itor2) |
| Verifies that two iterators both belong to a specific container. | |
| template<class Itor , class Operation > | |
| Operation | for_each (Itor beg, const Itor &end, Operation op) |
| Apply an operation to each element in a range. | |
| template<class Itor , class Operation > | |
| Itor::difference_type | count_if (Itor beg, const Itor &end, Operation op) |
| Count elements satisfying a predicate. | |
| template<class Itor , class T > | |
| Itor::difference_type | count (const Itor &beg, const Itor &end, const T &value) |
| Count elements equal to a value. | |
| template<class Itor , class CompFunc = Aleph::less<typename Itor::value_type>> | |
| Itor | min_element (Itor beg, const Itor &end, CompFunc op=CompFunc()) |
| Find the minimum element in a range. | |
| template<class Itor , class CompFunc = Aleph::greater<typename Itor::value_type>> | |
| Itor | max_element (const Itor &beg, const Itor &end, CompFunc op=CompFunc()) |
| Find the maximum element in a range. | |
| template<class Itor , class UnaryPredicate > | |
| Itor | find_if (Itor beg, const Itor &end, UnaryPredicate op) |
| Find the first element satisfying a predicate. | |
| template<class Itor , class T > | |
| Itor | find (const Itor &beg, const Itor &end, const T &value) |
| Find the first element equal to a value. | |
| template<class Itor , class Size , class T , class BinaryPredicate = Aleph::equal_to<T>> | |
| Itor | search_n (Itor beg, const Itor &end, Size count, const T &value, BinaryPredicate op=BinaryPredicate()) |
| Find n consecutive elements equal to a value. | |
| template<class Itor1 , class Itor2 , class BinaryPredicate = Aleph::equal_to<typename Itor1::value_type>> | |
| Itor1 | search (Itor1 beg, const Itor1 &end, Itor2 searchBeg, const Itor2 &searchEnd, BinaryPredicate op=BinaryPredicate()) |
| Search for a subrange within a range. | |
| template<class Itor1 , class Itor2 , class BinaryPredicate = Aleph::equal_to<typename Itor1::value_type>> | |
| Itor1 | find_end (Itor1 beg, Itor1 end, Itor2 searchBeg, Itor2 searchEnd, BinaryPredicate op=BinaryPredicate()) |
| Find the last occurrence of a subrange. | |
| template<class Itor1 , class Itor2 , class BinaryPredicate = Aleph::equal_to<typename Itor1::value_type>> | |
| Itor1 | find_first_of (const Itor1 &beg, const Itor1 &end, Itor2 searchBeg, const Itor2 &searchEnd, BinaryPredicate op=BinaryPredicate()) |
| Find first element from a set. | |
| template<class Itor , class BinaryPredicate = Aleph::equal_to<typename Itor::value_type>> | |
| Itor | adjacent_find (Itor beg, const Itor &end, BinaryPredicate op=BinaryPredicate()) |
| Find first pair of adjacent equal elements. | |
| template<class Itor1 , class Itor2 , class BinaryPredicate = Aleph::equal_to<typename Itor1::value_type>> | |
| bool | equal (Itor1 beg, const Itor1 &end, Itor2 cmpBeg, BinaryPredicate op=BinaryPredicate()) |
| Test if two ranges are equal. | |
| template<class Itor1 , class Itor2 , class BinaryPredicate = Aleph::equal_to<typename Itor1::value_type>> | |
| std::pair< Itor1, Itor2 > | mismatch (Itor1 beg, const Itor1 &end, Itor2 cmpBeg, BinaryPredicate op=BinaryPredicate()) |
| Find the first mismatching elements in two ranges. | |
| template<class Itor1 , class Itor2 , class Comp = Aleph::less<typename Itor1::value_type>> | |
| bool | lexicographical_compare (Itor1 beg1, const Itor1 &end1, Itor2 beg2, const Itor2 &end2, Comp op=Comp()) |
| Lexicographical comparison of two ranges. | |
| template<class Itor1 , class Itor2 > | |
| Itor2 | copy (Itor1 sourceBeg, const Itor1 &sourceEnd, Itor2 destBeg) |
| Copy elements from one range to another. | |
| template<class Itor1 , class Itor2 > | |
| Itor2 | copy_backward (const Itor1 &sourceBeg, Itor1 sourceEnd, Itor2 destEnd) |
| Copy elements backward from one range to another. | |
| template<class Itor1 , class Itor2 , class UnaryFunc > | |
| Itor2 | transform (Itor1 sourceBeg, Itor1 sourceEnd, Itor2 destBeg, UnaryFunc op) |
| Transform elements using a unary operation. | |
| template<class Itor1 , class Itor2 , class Itor3 , class BinaryFunc > | |
| Itor3 | transform (Itor1 source1Beg, Itor1 source1End, Itor2 source2Beg, Itor3 destBeg, BinaryFunc op) |
| Transform elements using a binary operation. | |
| template<class Itor1 , class Itor2 > | |
| Itor2 | swap_ranges (Itor1 beg1, const Itor1 &end1, Itor2 beg2) |
| Swap elements between two ranges. | |
| template<class Itor , class T > | |
| void | fill (Itor beg, const Itor &end, const T &value) |
| Fill a range with a value. | |
| template<class Itor , class T , class Size > | |
| void | fill_n (Itor beg, Size num, const T &value) |
| Fill n elements with a value. | |
| template<class Itor , class Func > | |
| void | generate (Itor beg, const Itor &end, Func op) |
| Generate values for a range. | |
| template<class Itor , class Size , class Func > | |
| void | generate_n (Itor beg, Size num, Func op) |
| Generate values for n elements. | |
| template<class Itor , class UnaryPredicate , class T > | |
| void | replace_if (Itor beg, const Itor &end, UnaryPredicate op, const T &value) |
| Replace elements satisfying a predicate. | |
| template<class Itor , class T > | |
| void | replace (Itor beg, const Itor &end, const T &old_value, const T &new_value) |
| Replace elements equal to a value. | |
| template<class Itor1 , class Itor2 , class UnaryPredicate , class T > | |
| Itor2 | replace_copy_if (Itor1 sourceBeg, const Itor1 &sourceEnd, Itor2 destBeg, UnaryPredicate op, const T &value) |
| Copy and replace elements satisfying a predicate. | |
| template<class Itor1 , class Itor2 , class T > | |
| Itor2 | replace_copy (const Itor1 &sourceBeg, const Itor1 &sourceEnd, Itor2 destBeg, const T &old_value, const T &new_value) |
| Copy and replace elements equal to a value. | |
| template<class In_Itor , class Out_Itor , class Predicate > | |
| Out_Itor | remove_copy_if (In_Itor __first, const In_Itor &__last, Out_Itor __result, Predicate __pred) |
| Copy elements not satisfying a predicate. | |
| template<class Fw_Itor , class Predicate > | |
| Fw_Itor | remove_if (Fw_Itor __first, const Fw_Itor &__last, Predicate __pred) |
| Remove elements satisfying a predicate. | |
| template<class Fw_Itor , class T > | |
| Fw_Itor | remove (Fw_Itor __first, const Fw_Itor &__last, const T &__value) |
| Remove elements equal to a value. | |
| template<class In_Itor , class Out_Itor > | |
| Out_Itor | unique_copy (In_Itor __first, In_Itor __last, Out_Itor __result) |
| Copy unique elements. | |
| template<class In_Itor , class Out_Itor , class BinaryPredicate > | |
| Out_Itor | unique_copy (In_Itor __first, In_Itor __last, Out_Itor __result, BinaryPredicate __binary_pred) |
| Copy unique elements with custom comparison. | |
| template<class Itor , class BinaryPredicate = Aleph::equal_to<typename Itor::value_type>> | |
| Itor | unique (Itor __first, Itor __last, BinaryPredicate __binary_pred=BinaryPredicate()) |
| Remove consecutive duplicates in place. | |
| template<class Itor > | |
| void | reverse (Itor beg, Itor end) |
| Reverse elements in a range. | |
| template<class Itor1 , class Itor2 > | |
| Itor2 | reverse_copy (Itor1 sourceBeg, Itor1 sourceEnd, Itor2 destBeg) |
| Copy elements in reverse order. | |
| template<class Itor > | |
| void | rotate (Itor beg, Itor pos, Itor end) |
| Rotate elements in a range. | |
| template<class Itor1 , class Itor2 > | |
| Itor2 | rotate_copy (const Itor1 &beg, const Itor1 &pos, const Itor1 &end, Itor2 tgt_beg) |
| Copy and rotate elements. | |
| template<class Itor , class T > | |
| Itor | lower_bound (Itor beg, Itor end, const T &value) |
| Find lower bound in a sorted range. | |
| template<class Itor , class T , class BinaryPredicate > | |
| Itor | lower_bound (Itor beg, Itor end, const T &value, BinaryPredicate op) |
| Find lower bound with custom comparison. | |
| template<class Itor , class T > | |
| Itor | upper_bound (Itor beg, Itor end, const T &value) |
| Find upper bound in a sorted range. | |
| template<class Itor , class T , class BinaryPredicate > | |
| Itor | upper_bound (Itor beg, Itor end, const T &value, BinaryPredicate op) |
| Find upper bound with custom comparison. | |
| template<class Itor , class T > | |
| bool | binary_search (Itor beg, Itor end, const T &value) |
| Binary search for a value. | |
| template<class Itor , class T , class BinaryPredicate > | |
| bool | binary_search (Itor beg, Itor end, const T &value, BinaryPredicate op) |
| Binary search with custom comparison. | |
| template<class Itor , class T > | |
| std::pair< Itor, Itor > | equal_range (Itor beg, Itor end, const T &value) |
| Find equal range in a sorted sequence. | |
| template<class Itor , class T , class BinaryPredicate > | |
| std::pair< Itor, Itor > | equal_range (Itor beg, Itor end, const T &value, BinaryPredicate op) |
| Find equal range with custom comparison. | |
| template<class Itor1 , class Itor2 > | |
| bool | includes (Itor1 beg, Itor1 end, Itor2 searchBeg, Itor2 searchEnd) |
| Test if one sorted range includes another. | |
| template<class Itor1 , class Itor2 , class Itor3 > | |
| Itor3 | merge (Itor1 source1Beg, Itor1 source1End, Itor2 source2Beg, Itor2 source2End, Itor3 destBeg) |
| Merge two sorted ranges. | |
| template<class Itor1 , class Itor2 , class Itor3 , class BinaryPredicate > | |
| Itor3 | merge (Itor1 source1Beg, Itor1 source1End, Itor2 source2Beg, Itor2 source2End, Itor3 destBeg, BinaryPredicate op) |
| Merge two sorted ranges with custom comparison. | |
| template<class Itor , class T > | |
| T | accumulate (Itor beg, Itor end, T initValue) |
| Accumulate values in a range. | |
| template<class Itor , class T , class BinaryFunc > | |
| T | accumulate (Itor beg, Itor end, T initValue, BinaryFunc op) |
| Accumulate values with custom operation. | |
| template<class Itor1 , class Itor2 , class T > | |
| T | inner_product (Itor1 beg1, Itor1 end1, Itor2 beg2, T initValue) |
| Compute inner product of two ranges. | |
| template<class Itor1 , class Itor2 , class T , class BinaryFunc1 , class BinaryFunc2 > | |
| T | inner_product (Itor1 beg1, Itor1 end1, Itor2 beg2, T initValue, BinaryFunc1 op1, BinaryFunc2 op2) |
| Compute inner product with custom operations. | |
| template<class Itor1 , class Itor2 > | |
| Itor2 | partial_sum (Itor1 sourceBeg, Itor1 sourceEnd, Itor2 destBeg) |
| Compute partial sums of a range. | |
| template<class Itor1 , class Itor2 , class BinaryFunc > | |
| Itor2 | partial_sum (Itor1 sourceBeg, Itor1 sourceEnd, Itor2 destBeg, BinaryFunc op) |
| Compute partial sums with custom operation. | |
| template<class Itor1 , class Itor2 > | |
| Itor2 | adjacent_difference (Itor1 sourceBeg, Itor1 sourceEnd, Itor2 destBeg) |
| Compute adjacent differences. | |
| template<class Itor1 , class Itor2 , class BinaryFunc > | |
| Itor2 | adjacent_difference (Itor1 sourceBeg, Itor1 sourceEnd, Itor2 destBeg, BinaryFunc op) |
| Compute adjacent differences with custom operation. | |
| void | message (const char *file, int line, const char *format,...) |
| Print an informational message with file and line info. | |
| void | error (const char *file, int line, const char *format,...) |
| Print an error message with file and line info. | |
| void | exit (const char *file, int line, const char *format,...) |
| Print a message and exit the program. | |
| void | warning (const char *file, int line, const char *format,...) |
| Print a warning message with file and line info. | |
| void | syslog (const char *format, va_list ap) |
| Write a message to syslog. | |
| template<typename Type > | |
| std::string | to_str (const Type &d) |
| Converts any streamable value to string. | |
| template<typename Key , typename Data > | |
| std::pair< Key, Data > * | key_to_pair (Key *ptr) |
| Converts a pointer to Key to a pointer to the containing pair. | |
| template<typename Key , typename Data > | |
| const std::pair< Key, Data > * | key_to_pair (const Key *ptr) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| template<typename Key , typename Data > | |
| std::pair< Key, Data > * | data_to_pair (Data *ptr) |
| Converts a pointer to Data to a pointer to the containing pair. | |
| template<typename Key , typename Data > | |
| const std::pair< Key, Data > * | data_to_pair (const Data *ptr) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| template<class T > | |
| std::ostream & | operator<< (std::ostream &osObject, const Field< T > &rightOp) |
| template<class _Predicate > | |
| unary_negate< _Predicate > | not1 (const _Predicate &__pred) |
| template<class _Predicate > | |
| binary_negate< _Predicate > | not2 (const _Predicate &__pred) |
| template<class _Operation , class _Tp > | |
| binder1st< _Operation > | bind1st (const _Operation &__fn, const _Tp &__x) |
| template<class _Operation , class _Tp > | |
| binder2nd< _Operation > | bind2nd (const _Operation &__fn, const _Tp &__x) |
| template<class _Arg , class _Result > | |
| pointer_to_unary_function< _Arg, _Result > | ptr_fun (_Result(*__x)(_Arg)) |
| template<class _Arg1 , class _Arg2 , class _Result > | |
| pointer_to_binary_function< _Arg1, _Arg2, _Result > | ptr_fun (_Result(*__x)(_Arg1, _Arg2)) |
| template<class _Ret , class _Tp > | |
| mem_fun_t< _Ret, _Tp > | mem_fun (_Ret(_Tp::*__f)()) |
| template<class _Ret , class _Tp > | |
| const_mem_fun_t< _Ret, _Tp > | mem_fun (_Ret(_Tp::*__f)() const) |
| template<class _Ret , class _Tp > | |
| mem_fun_ref_t< _Ret, _Tp > | mem_fun_ref (_Ret(_Tp::*__f)()) |
| template<class _Ret , class _Tp > | |
| const_mem_fun_ref_t< _Ret, _Tp > | mem_fun_ref (_Ret(_Tp::*__f)() const) |
| template<class _Ret , class _Tp , class _Arg > | |
| mem_fun1_t< _Ret, _Tp, _Arg > | mem_fun (_Ret(_Tp::*__f)(_Arg)) |
| template<class _Ret , class _Tp , class _Arg > | |
| const_mem_fun1_t< _Ret, _Tp, _Arg > | mem_fun (_Ret(_Tp::*__f)(_Arg) const) |
| template<class _Ret , class _Tp , class _Arg > | |
| mem_fun1_ref_t< _Ret, _Tp, _Arg > | mem_fun_ref (_Ret(_Tp::*__f)(_Arg)) |
| template<class _Ret , class _Tp , class _Arg > | |
| const_mem_fun1_ref_t< _Ret, _Tp, _Arg > | mem_fun_ref (_Ret(_Tp::*__f)(_Arg) const) |
| template<class T , class Compare > | |
| bool | less_than (const T &op1, const T &op2, Compare &cmp) |
| Determines if op1 is less than op2 using a comparison operator. | |
| template<class T , class Compare > | |
| bool | less_than (const T &op1, const T &op2, Compare &&cmp=Compare()) |
See less_than(). | |
| template<class T , class Compare > | |
| bool | less_or_equal_than (const T &op1, const T &op2, Compare &cmp) |
| Determines if op1 is less than or equal to op2 using a comparison operator. | |
| template<class T , class Compare > | |
| bool | less_or_equal_than (const T &op1, const T &op2, Compare &&cmp=Compare()) |
See less_or_equal_than(). | |
| template<class T , class Compare > | |
| bool | greater_than (const T &op1, const T &op2, Compare &&cmp=Compare()) |
| Determines if op1 is greater than op2 using a comparison operator. | |
| template<class T , class Compare > | |
| bool | greater_than (const T &op1, const T &op2, Compare &cmp) |
See greater_than(). | |
| template<class T , class Compare > | |
| bool | greater_or_equal_than (const T &op1, const T &op2, Compare &&cmp=Compare()) |
| Determines if op1 is greater than or equal to op2 using a comparison operator. | |
| template<class T , class Compare > | |
| bool | greater_or_equal_than (const T &op1, const T &op2, Compare &cmp) |
See greater_or_equal_than(). | |
| template<class T , class Compare > | |
| bool | no_equals (const T &op1, const T &op2, Compare &&cmp=Compare()) |
| Determines if operands are not equal using a comparison operator. | |
| template<class T , class Compare > | |
| bool | no_equals (const T &op1, const T &op2, Compare &cmp) |
See no_equals(). | |
| template<class T , class Compare > | |
| bool | are_equals (const T &op1, const T &op2, Compare &&cmp=Compare()) |
| Determines if operands are equal using a comparison operator. | |
| template<class T , class Compare > | |
| bool | are_equals (const T &op1, const T &op2, Compare &cmp) |
See are_equals(). | |
| template<typename T = int, template< typename > class Container = DynList> | |
| Container< T > | range (const T start, const T end, const T step=1) |
| Generate a range of values [start, end] with a given step. | |
| template<typename T = int, template< typename > class Container = DynList> | |
| Container< T > | nrange (const T start, const T end, const size_t n) |
| Generate exactly n values evenly spaced between [start, end]. | |
| template<typename T = int, template< typename > class Container = DynList, class Op > | |
| auto | set_range (const T start, const T end, const T step, Op &op) -> Container< std::decay_t< decltype(op(start))> > |
| Generate a range [start, end] and apply an operation to each value. | |
| template<typename T = int, template< typename > class Container = DynList, class Op > | |
| auto | set_range (const T start, const T end, const T step=1, Op &&op=Op()) -> Container< std::decay_t< decltype(op(start))> > |
Overload of set_range. | |
| template<typename T = int, template< typename > class Container = DynList> | |
| Container< T > | contiguous_range (T start, const size_t n) |
| Generate n contiguous values starting from start. | |
| template<typename T = int, template< typename > class Container = DynList> | |
| Container< T > | range (const T n) |
| Return a range 0, 1, ... n - 1. | |
| template<typename T = int> | |
| DynList< T > | rep (const size_t n, const T &item) |
| Create a sequence of repeated items. | |
| template<typename T = int> | |
| DynList< T > | rep (const size_t n, T &&item=T()) |
Overload of rep. | |
| template<AlephSequentialContainer C> | |
| void | fill (C &container, const typename C::Item_Type &value) |
| Fill all elements of a container with a fixed value. | |
| template<AlephSequentialContainer C> requires requires(typename C::Item_Type v) { ++v; } | |
| void | iota (C &container, typename C::Item_Type start) |
| Fill all elements of a container with unit-step sequential values. | |
| template<AlephSequentialContainer C> requires requires(typename C::Item_Type v, typename C::Item_Type s) { v += s; } | |
| void | iota (C &container, typename C::Item_Type start, const typename C::Item_Type step) |
| Fill all elements of a container with custom-step sequential values. | |
| template<class Container > | |
| DynList< typename Container::Item_Type * > | pointers_list (Container &c) |
| Create a list of pointers to items in a container. | |
| template<class Container > | |
| DynList< const typename Container::Item_Type * > | pointers_list (const Container &c) |
| Const container overload. | |
| template<class Op > requires CallableWith<Op &> | |
| void | each (const size_t start, const size_t end, Op &op) |
| Execute an operation repeatedly over a range of indices. | |
| template<class Op > requires CallableWith<Op &> | |
| void | each (size_t start, size_t end, Op &&op) |
Overload of each. | |
| template<class Op > requires CallableWith<Op &> | |
| void | each (const size_t n, Op &op) |
Overload of each. | |
| template<class Op > requires CallableWith<Op &> | |
| void | each (size_t n, Op &&op) |
Overload of each. | |
| template<class Container > | |
| DynList< typename Container::Item_Type > | sublist (const Container &c, size_t pos, const size_t stride) |
| Extract a sublist using a stride. | |
| template<class Container > | |
| DynList< typename Container::Item_Type > | sublist (const Container &c, size_t stride) |
Overload of sublist from start. | |
| template<class Container , class Operation > | |
| Container & | for_each (Container &container, Operation &operation) |
| Apply an operation to each element in a container. | |
| template<class Container , class Operation > | |
| const Container & | for_each (const Container &container, Operation &operation) |
Overload of for_each. | |
| template<class Container , class Operation > | |
| Container & | for_each (Container &container, Operation &&operation=Operation()) |
Overload of for_each. | |
| template<class Container , class Operation > | |
| const Container & | for_each (const Container &container, Operation &&operation=Operation()) |
Overload of for_each. | |
| template<class Container , class Operation > requires CallableWith<Operation &, functional_detail::get_curr_t<Container>, std::size_t &> | |
| void | enum_for_each (const Container &container, Operation &operation) |
| Apply an operation to each element and its index. | |
| template<class Container , class Operation > requires CallableWith<Operation &, functional_detail::get_curr_t<Container>, std::size_t &> | |
| void | enum_for_each (const Container &container, Operation &&operation) |
Overload of enum_for_each. | |
| template<class Container , class Operation > requires requires(Container &c, Operation &op) { { c.traverse(op) } -> std::convertible_to<bool>; } | |
| bool | all (Container &container, Operation &operation) |
| Return true if all elements satisfy a predicate. | |
| template<class Container , class Operation > requires requires(const Container &c, Operation &op) { { c.template traverse<Operation>(op) } -> std::convertible_to<bool>; } | |
| bool | all (const Container &container, Operation &operation) |
Overload of all. | |
| template<class Container , class Operation > requires requires(Container &c, Operation &op) { { c.traverse(op) } -> std::convertible_to<bool>; } | |
| bool | all (Container &container, Operation &&operation=Operation()) |
Overload of all. | |
| template<class Container , class Operation > requires requires(const Container &c, Operation &op) { { c.template traverse<Operation>(op) } -> std::convertible_to<bool>; } | |
| bool | all (const Container &container, Operation &&operation=Operation()) |
Overload of all. | |
| template<class Container , class Operation > | |
| bool | exists (Container &container, Operation &operation) |
| Return true if at least one element satisfies a predicate. | |
| template<class Container , class Operation > | |
| bool | exists (const Container &container, Operation &operation) |
Overload of exists. | |
| template<class Container , class Operation > | |
| bool | exists (Container &container, Operation &&operation=Operation()) |
Overload of exists. | |
| template<class Container , class Operation > | |
| bool | exists (const Container &container, Operation &&operation=Operation()) |
Overload of exists. | |
| template<class Container1 , template< typename > class Container2 = Aleph::DynList, class Operation = Dft_Filter_Op<typename Container1::Item_Type>> | |
| Container2< typename Container1::Item_Type > | filter (Container1 &container, Operation &operation) |
| Filter elements that satisfy operation. | |
| template<class Container1 , template< typename > class Container2 = Aleph::DynList, class Operation = Dft_Filter_Op<typename Container1::Item_Type>> | |
| Container2< typename Container1::Item_Type > | filter (const Container1 &container, Operation &operation) |
Overload of filter. | |
| template<class Container1 , template< typename > class Container2 = Aleph::DynList, class Operation = Dft_Filter_Op<typename Container1::Item_Type>> | |
| Container2< typename Container1::Item_Type > | filter (Container1 &container, Operation &&operation) |
Overload of filter. | |
| template<class Container1 , template< typename > class Container2 = Aleph::DynList, class Operation = Dft_Filter_Op<typename Container1::Item_Type>> | |
| Container2< typename Container1::Item_Type > | filter (const Container1 &container, Operation &&operation) |
Overload of filter. | |
| template<typename T , class C , class Op > requires requires(DynList<T> &ret, Op &op) { ret.append(op(std::declval<functional_detail::get_curr_t<C>>())); } | |
| DynList< T > | maps (const C &c, Op op) |
| Classic map operation. | |
| template<typename T , class Container , class Operation > | |
| T | foldl (const Container &container, const T &init, Operation operation) |
| Classic left fold (reduce). | |
| template<class Container1 , class Container2 > | |
| DynList< std::pair< typename Container1::Item_Type, typename Container2::Item_Type > > | zip (const Container1 &a, const Container2 &b) |
| Zip two containers into a list of pairs. | |
| template<class Container1 , class Container2 > | |
| DynList< std::tuple< typename Container1::Item_Type, typename Container2::Item_Type > > | tzip (const Container1 &a, const Container2 &b) |
| Zip two containers into a list of tuples. | |
| template<class Container1 , class Container2 > | |
| DynList< std::pair< typename Container1::Item_Type, typename Container2::Item_Type > > | zipEq (const Container1 &a, const Container2 &b) |
| Zip two containers; throw if lengths differ. | |
| template<class Container1 , class Container2 > | |
| DynList< std::tuple< typename Container1::Item_Type, typename Container2::Item_Type > > | tzipEq (const Container1 &a, const Container2 &b) |
| Zip two containers into tuples; throw if lengths differ. | |
| template<class Container > | |
| auto | enumerate (const Container &c) |
| Return pairs of (element, index). | |
| template<class C1 , class C2 , class Eq = std::equal_to<typename C1::Item_Type>> | |
| bool | eq (const C1 &c1, const C2 &c2, Eq e=Eq()) |
| Check equality of two containers using a predicate. | |
| template<typename T > | |
| bool | operator== (const DynList< T > &l1, const DynList< T > &l2) |
| Equality operator for DynList. | |
| template<class C1 , class C2 , class Eq > | |
| bool | containers_eq (const C1 &c1, const C2 &c2, Eq e) |
See eq. | |
| template<class C1 , class C2 , class Eq = std::equal_to<typename C1::Item_Type>> | |
| std::tuple< bool, size_t, typename C1::Item_Type, typename C2::Item_Type > | are_eq (const C1 &c1, const C2 &c2, Eq e=Eq()) |
| Detailed equality check returning mismatch position and values. | |
| template<class C1 , class C2 , class Cmp = std::less<typename C1::Item_Type>> | |
| bool | lesser (const C1 &c1, const C2 &c2, Cmp cmp=Cmp()) |
| Lexicographical comparison between two containers. | |
| template<class C1 , class C2 , class Eq = std::equal_to<typename C1::Item_Type>> | |
| bool | diff (const C1 &c1, const C2 &c2, Eq e=Eq()) |
| Check if two containers differ. | |
| template<class Container > | |
| auto | unzip (const Container &l) |
| Separate a list of pairs into two lists. | |
| template<template< typename > class Container, typename T1 , typename T2 > | |
| std::tuple< Container< T1 >, Container< T2 > > | tunzip (const Container< std::tuple< T1, T2 > > &l) |
| Separate a list of tuples into two containers. | |
| template<class SrcContainer , template< typename > class TgtContainer = Aleph::DynList> | |
| std::pair< TgtContainer< typename SrcContainer::Item_Type >, TgtContainer< typename SrcContainer::Item_Type > > | partition (const SrcContainer &c, std::function< bool(const typename SrcContainer::Item_Type &)> operation) |
| Partition a container into two based on a predicate. | |
| template<class Container > | |
| DynList< std::pair< size_t, typename Container::Key_Type > > | indexes (const Container &c) |
| Return pairs of (index, key). | |
| template<class Container > | |
| DynList< std::tuple< size_t, typename Container::Key_Type > > | tindexes (const Container &c) |
| Return tuples of (index, key). | |
| template<typename T , template< typename > class Container> | |
| Container< T > | reverse (const Container< T > &l) |
| Return a reversed copy of the container. | |
| template<class Container > | |
| auto | gen_seq_list_tuples (const Container &c, size_t n) |
| Generate all sequential tuples (sliding windows) of size n. | |
| template<typename T , template< typename > class Container, class Equal > | |
| std::pair< DynList< DynList< T > >, size_t > | sequential_groups (const Container< T > &c, Equal &eq) |
| Group consecutive equal elements together. | |
| template<typename T , template< typename > class Container, class Equal = std::equal_to<T>> | |
| std::pair< DynList< DynList< T > >, size_t > | sequential_groups (const Container< T > &c, Equal &&eq=Equal()) |
Overload of sequential_groups. | |
| template<typename T , template< typename > class Container, class Equal > | |
| std::pair< DynList< T >, size_t > | unique_sequential (const Container< T > &c, Equal &eq) |
| Extract unique consecutive items. | |
| template<typename T , template< typename > class Container, class Equal = std::equal_to<T>> | |
| std::pair< DynList< T >, size_t > | unique_sequential (const Container< T > &c, Equal &&eq=Equal()) |
Overload of unique_sequential. | |
| template<class C1 , class C2 > | |
| auto | get_pair_it (C1 &c1, C2 &c2) |
| Create a Pair_Iterator for two containers. | |
| template<class C1 , class C2 > | |
| auto | get_pair_it (C1 &c1, C2 &c2, const size_t pos) |
Overload of get_pair_it with start position. | |
| template<class C , typename... Args> | |
| size_t | insert_in_container (C &c, Args &&... args) |
| Insert multiple items into a container. | |
| template<class C , typename... Args> | |
| size_t | append_in_container (C &c, Args &&... args) |
| Append multiple items into a container. | |
| template<class C , typename... Args> | |
| C | build_container (Args &&... args) |
| Build a container with the given items. | |
| template<class SrcC , class TgtC > | |
| TgtC | assign_container (const SrcC &srcc) |
| Convert one container type to another. | |
| template<typename T , typename... Args> | |
| DynList< T > | build_dynlist (Args &&... args) |
| Build a DynList with the given items; an rvalue is moved. | |
| template<class C , typename... Args> | |
| size_t | remove_from_container (C &c, Args... args) |
| Remove multiple items from a container. | |
| template<typename T , template< typename > class Container> | |
| DynList< T > | join (const Container< T > &c1, const Container< T > &c2) |
| Return union of two containers as a DynList (no duplicates). | |
| template<typename T , template< typename > class Container> | |
| DynList< T > | intercept (const Container< T > &c1, const Container< T > &c2) |
| Return intersection of two containers as a DynList. | |
| template<typename T , template< typename > class Container> | |
| DynList< T > | unique (const Container< T > &c) |
| Return elements that appear exactly once across the container. | |
| template<typename T , template< typename > class Container> | |
| DynList< T > | repeated (const Container< T > &c) |
| Return elements that appear more than once in the container. | |
| template<typename T , template< typename > class Container> | |
| DynList< std::pair< T, size_t > > | repeated_with_index (const Container< T > &c) |
| Return repeated elements paired with their occurrence count. | |
| template<typename T , template< typename > class C1, template< typename > class C2> | |
| DynList< T > | flatten (const C2< C1< T > > &c) |
| Flatten a nested container of one level. | |
| template<typename T , template< typename > class C1, template< typename > class C2, template< typename > class C3> | |
| DynList< T > | flatten (const C3< C2< C1< T > > > &c) |
| Flatten a nested container of two levels. | |
| template<typename T , template< typename > class C1, template< typename > class C2, template< typename > class C3, template< typename > class C4> | |
| DynList< T > | flatten (const C4< C3< C2< C1< T > > > > &c) |
| Flatten a nested container of three levels. | |
| template<typename T , template< typename > class C1, template< typename > class C2, template< typename > class C3, template< typename > class C4, template< typename > class C5> | |
| DynList< T > | flatten (const C5< C4< C3< C2< C1< T > > > > > &c) |
| Flatten a nested container of four levels. | |
| template<typename T > | |
| bool | is_inside (const T &val, const DynList< T > &values) |
| Check if a value is present in a list. | |
| template<typename T > | |
| bool | is_equal (const T &val) |
| Variadic check for equality against multiple values. | |
| template<typename T , typename U , typename... Args> | |
| bool | is_equal (const T &val, const U &rhs, const Args &...args) |
Overload of is_equal. | |
| template<class Container , class Operation > | |
| bool | none (const Container &container, Operation &operation) |
| Return true if no element satisfies operation. | |
| template<class Container , class Operation > | |
| bool | none (const Container &container, Operation &&operation=Operation()) |
Overload of none. | |
| template<class Container , class Pred > | |
| Container::Item_Type * | find_ptr (Container &container, Pred &pred) |
| Find the first element satisfying pred. | |
| template<class Container , class Pred > | |
| const Container::Item_Type * | find_ptr (const Container &container, Pred &pred) |
Overload of find_ptr. | |
| template<class Container , class Pred > | |
| Container::Item_Type * | find_ptr (Container &container, Pred &&pred) |
Overload of find_ptr. | |
| template<class Container , class Pred > | |
| const Container::Item_Type * | find_ptr (const Container &container, Pred &&pred) |
Overload of find_ptr. | |
| template<class Container , class Pred > | |
| std::optional< typename Container::Item_Type > | find_opt (const Container &container, Pred &pred) |
| Find the first element satisfying pred (safe version). | |
| template<class Container , class Pred > | |
| std::optional< typename Container::Item_Type > | find_opt (const Container &container, Pred &&pred) |
Overload of find_opt. | |
| template<typename T , class Container , class Operation > requires requires(T &acc, Operation &op, T &x) { acc = op(x, acc); } | |
| T | foldr (const Container &container, const T &init, Operation operation) |
| Right fold (reduce). | |
| template<class Container , typename T = typename Container::Item_Type> | |
| T | sum (const Container &container, const T &init=T{}) |
| Compute sum of all elements. | |
| template<class Container , typename T = typename Container::Item_Type> | |
| T | product (const Container &container, const T &init=T{1}) |
| Compute product of all elements. | |
| template<class C1 , class C2 > | |
| DynList< typename C1::Item_Type > | concat (const C1 &c1, const C2 &c2) |
| Concatenate two containers into a new DynList. | |
| template<class Container , class Pred > requires PredicateWith<Pred &, functional_detail::get_curr_cref_t<Container>> | |
| DynList< typename Container::Item_Type > | take_while (const Container &c, Pred pred) |
| Return elements while predicate is true (take_while). | |
| template<class Container , class Pred > requires PredicateWith<Pred &, functional_detail::get_curr_cref_t<Container>> | |
| DynList< typename Container::Item_Type > | drop_while (const Container &c, Pred pred) |
| Skip elements while predicate is true (drop_while). | |
| template<class Container , class Op > | |
| auto | flat_map (const Container &container, Op op) -> DynList< typename std::decay_t< decltype(op(std::declval< typename Container::Item_Type >()))>::Item_Type > |
| Apply operation and flatten results (flatMap/concatMap). | |
| template<typename T , class Container > | |
| DynList< T > | scanl_sum (const Container &container, const T &init) |
| Compute running sums (scanl with addition). | |
| template<typename T , class Container , class Op > requires requires(T &acc, Op &op) { acc = op(acc, std::declval<functional_detail::get_curr_t<Container>>()); } | |
| DynList< T > | scanl (const Container &container, const T &init, Op op) |
| Prefix scan with custom operation. | |
| template<class Container , class Cmp = std::less<typename Container::Item_Type>> requires PredicateWith<Cmp &, functional_detail::get_curr_cref_t<Container>, const typename Container::Item_Type &> | |
| const Container::Item_Type * | min_ptr (const Container &container, Cmp cmp=Cmp()) |
| Find the minimum element in a container. | |
| template<class Container , class Cmp = std::less<typename Container::Item_Type>> requires PredicateWith<Cmp &, const typename Container::Item_Type &, functional_detail::get_curr_cref_t<Container>> | |
| const Container::Item_Type * | max_ptr (const Container &container, Cmp cmp=Cmp()) |
| Find the maximum element in a container. | |
| template<class Container , class Cmp = std::less<typename Container::Item_Type>> requires PredicateWith<Cmp &, functional_detail::get_curr_cref_t<Container>, const typename Container::Item_Type &> | |
| and PredicateWith< Cmp &, const typename Container::Item_Type &, functional_detail::get_curr_cref_t< Container > > std::pair< const typename Container::Item_Type *, const typename Container::Item_Type * > | minmax_ptr (const Container &container, Cmp cmp=Cmp()) |
| Find both min and max elements in a single pass. | |
| template<class Container , class Pred > requires PredicateWith<Pred &, functional_detail::get_curr_t<Container>> | |
| size_t | count_if (const Container &container, Pred pred) |
| Count elements satisfying a predicate. | |
| template<AlephSequentialIterableContainer Container, class Equal > | |
| bool | all_unique (const Container &container, Equal &eq) |
| Check if all elements in a container are unique using a comparator. | |
| template<AlephSequentialIterableContainer Container, class Equal = std::equal_to<typename Container::Item_Type>> | |
| bool | all_unique (const Container &container, Equal &&eq=Equal()) |
| Check if all elements in a container are unique using an rvalue/lvalue comparator. | |
| bool | all_unique (const Container &container, Hash &hash, Equal &eq) |
| bool | all_unique (const Container &container, Hash &&hash, Equal &&eq) |
See all_unique(container, hash, eq). | |
| template<class Container > | |
| bool | contains (const Container &container, const typename Container::Item_Type &value) |
| Check if container contains a specific value. | |
| template<class Container > | |
| DynList< std::tuple< size_t, typename Container::Item_Type > > | enumerate_tuple (const Container &container) |
| Zip containers with an index (enumerate with zip). | |
| template<class Container1 , class Container2 > | |
| DynList< std::pair< typename Container1::Item_Type, typename Container2::Item_Type > > | zip_longest (const Container1 &a, const Container2 &b, const typename Container1::Item_Type &fill_a=typename Container1::Item_Type(), const typename Container2::Item_Type &fill_b=typename Container2::Item_Type()) |
| Zip two containers, padding the shorter one with a fill value. | |
| template<class Container1 , class Container2 > | |
| DynList< std::tuple< typename Container1::Item_Type, typename Container2::Item_Type > > | tzip_longest (const Container1 &a, const Container2 &b, const typename Container1::Item_Type &fill_a=typename Container1::Item_Type(), const typename Container2::Item_Type &fill_b=typename Container2::Item_Type()) |
| Zip two containers into tuples, padding the shorter one. | |
| template<class Container1 , class Container2 > | |
| DynList< std::pair< std::optional< typename Container1::Item_Type >, std::optional< typename Container2::Item_Type > > > | zip_longest_opt (const Container1 &a, const Container2 &b) |
| Zip two containers using optionals for missing values. | |
| template<typename T , template< typename > class Container, class KeyFunc > | |
| DynList< std::pair< std::invoke_result_t< KeyFunc, const T & >, DynList< T > > > | group_by (const Container< T > &c, KeyFunc key_func) |
| Group consecutive elements by a key function. | |
| template<typename T , template< typename > class Container, class KeyFunc , class KeyEqual > | |
| DynList< std::pair< std::invoke_result_t< KeyFunc, const T & >, DynList< T > > > | group_by_eq (const Container< T > &c, KeyFunc key_func, KeyEqual key_equal) |
| Group consecutive elements by a key function with custom equality. | |
| template<typename T , template< typename > class Container, class KeyFunc , class Reducer > | |
| auto | group_by_reduce (const Container< T > &c, KeyFunc key_func, Reducer reducer) -> DynList< std::pair< std::invoke_result_t< KeyFunc, const T & >, std::invoke_result_t< Reducer, const DynList< T > & > > > |
| Group consecutive elements and apply a reducer to each group. | |
| void * | allocate (const std::size_t size) |
Allocate size bytes using the C heap. | |
| void * | allocate_zeroed (const std::size_t size) |
Allocate size zero-initialized bytes. | |
| void | deallocate (void *ptr) noexcept |
| Release memory previously obtained through Aleph allocation helpers. | |
| List_Sort (DynList) | |
| List_Sort (DynDlist) | |
| template<typename T , class Cmp = Aleph::less<T>> | |
| DynArray< T > | sort (const DynArray< T > &a, Cmp &&cmp=Cmp()) |
| Returns a sorted copy of a DynArray. | |
| template<typename T , class Cmp = Aleph::less<T>> | |
| DynArray< T > | sort (DynArray< T > &&a, Cmp &&cmp=Cmp()) |
| Sorts an rvalue DynArray in place and returns it. | |
| template<typename T , class Cmp = Aleph::less<T>> | |
| Array< T > | sort (const Array< T > &a, Cmp &&cmp=Cmp()) |
| Returns a sorted copy of an Array. | |
| template<typename T , class Cmp = Aleph::less<T>> | |
| Array< T > | sort (Array< T > &&a, Cmp &&cmp=Cmp()) |
| Sorts an rvalue Array in place and returns it. | |
| template<typename Container , class Cmp = std::less<typename Container::value_type>> | |
| Container | stdsort (const Container &c, Cmp cmp=Cmp()) |
| Sorts an STL-compatible container using std::sort. | |
| template<typename T , class Cmp = Aleph::less<T>> | |
| DynArray< T > & | in_place_sort (DynArray< T > &c, Cmp cmp=Cmp()) |
| Sorts a DynArray in place. | |
| template<typename T , class Cmp = Aleph::less<T>> | |
| Array< T > & | in_place_sort (Array< T > &c, Cmp cmp=Cmp()) |
| Sorts an Array in place. | |
| template<class C , class Compare = Aleph::less<sort_utils_detail::Indexed_Value_Type<C>>> | |
| Array< size_t > | argsort (const C &a, const Compare &cmp=Compare()) |
| Return indices that visit an array-like container in sorted order. | |
| template<class C , class Compare = Aleph::less<sort_utils_detail::Indexed_Value_Type<C>>> | |
| Array< size_t > | stable_argsort (const C &a, const Compare &cmp=Compare()) |
| Return stable sorted-order indices for an array-like container. | |
| template<typename T > | |
| Array< size_t > | ranks (const Array< T > &array) |
| Computes the rank of each element in an Array. | |
| template<typename T > | |
| DynArray< size_t > | ranks (const DynArray< T > &array) |
| Computes the rank of each element in a DynArray. | |
| template<typename T > | |
| DynArray< size_t > | ranks (const DynList< T > &l) |
| Computes the rank of each element in a DynList. | |
| template<typename T > | |
| DynArray< size_t > | ranks (const DynDlist< T > &l) |
| Computes the rank of each element in a DynDlist. | |
| template<typename T > | |
| auto | pair_ranks (const Array< T > &c) |
| Computes (value, rank) pairs for each element in an Array. | |
| template<typename T > | |
| auto | pair_ranks (const DynArray< T > &c) |
| Computes (value, rank) pairs for each element in a DynArray. | |
| template<typename T > | |
| auto | pair_ranks (const DynList< T > &l) |
| Computes (value, rank) pairs for each element in a DynList. | |
| template<typename T > | |
| auto | pair_ranks (const DynDlist< T > &l) |
| Computes (value, rank) pairs for each element in a DynDlist. | |
| template<typename C , typename... Args, typename Cmp = std::less<typename C::value_type>> | |
| void | in_place_multisort_arrays (Cmp cmp, const bool stable, C &first, Args &... args) |
| Sorts multiple arrays in place, using the first array as the key. | |
| template<typename C , typename... Args, typename Cmp = std::less<typename C::value_type>> | |
| void | in_place_multisort_arrays (Cmp cmp, C &first, Args &... args) |
| template<typename T > | |
| bool | is_primitive_type () |
| Check if type T is a primitive C++ type. | |
| template<> | |
| bool | is_primitive_type< char > () |
| template<> | |
| bool | is_primitive_type< unsigned char > () |
| template<> | |
| bool | is_primitive_type< short > () |
| template<> | |
| bool | is_primitive_type< unsigned short > () |
| template<> | |
| bool | is_primitive_type< int > () |
| template<> | |
| bool | is_primitive_type< unsigned int > () |
| template<> | |
| bool | is_primitive_type< long > () |
| template<> | |
| bool | is_primitive_type< unsigned long > () |
| template<> | |
| bool | is_primitive_type< long long > () |
| template<> | |
| bool | is_primitive_type< unsigned long long > () |
| template<> | |
| bool | is_primitive_type< float > () |
| template<> | |
| bool | is_primitive_type< double > () |
| template<> | |
| bool | is_primitive_type< long double > () |
| template<class T > | |
| T & | swap (T &t1, T &t2) |
| Generic swap using object's swap method. | |
| template<> | |
| char & | swap< char > (char &t1, char &t2) |
| template<> | |
| unsigned char & | swap< unsigned char > (unsigned char &t1, unsigned char &t2) |
| template<> | |
| short & | swap< short > (short &t1, short &t2) |
| template<> | |
| unsigned short & | swap< unsigned short > (unsigned short &t1, unsigned short &t2) |
| template<> | |
| int & | swap< int > (int &t1, int &t2) |
| template<> | |
| unsigned int & | swap< unsigned int > (unsigned int &t1, unsigned int &t2) |
| template<> | |
| long & | swap< long > (long &t1, long &t2) |
| template<> | |
| unsigned long & | swap< unsigned long > (unsigned long &t1, unsigned long &t2) |
| template<> | |
| long long & | swap< long long > (long long &t1, long long &t2) |
| template<> | |
| unsigned long long & | swap< unsigned long long > (unsigned long long &t1, unsigned long long &t2) |
| template<> | |
| float & | swap< float > (float &t1, float &t2) |
| template<> | |
| double & | swap< double > (double &t1, double &t2) |
| template<> | |
| long double & | swap< long double > (long double &t1, long double &t2) |
| template<class T , class Compare = Aleph::less<T>> | |
| const T * | median (const T &a, const T &b, const T &c, const Compare &cmp=Compare()) |
| Return a pointer to the median value among three elements. | |
| bool | is_even (const long n) |
Return true if n is even. | |
| bool | is_odd (const long n) |
Return true if n is odd. | |
| char | nibble_to_char (const int i) |
Convert a 4-bit nibble stored in an int to its hex character. | |
| int | char_to_nibble (const char c) |
Convert a hex character in 0..9A..F to its 4-bit nibble value. | |
| bool | resize_process_stack (size_t new_size) |
Resize the process stack to new_size. | |
| constexpr size_t | u_index (const size_t &i) |
| Map a binary heap index to the index of its parent. | |
| constexpr size_t | l_index (const size_t i) |
| Map a binary heap index to the index of its left child. | |
| bool | is_power_of_2 (size_t x) |
| Taken from http://stackoverflow.com/questions/3638431/determine-if-an-int-is-a-power-of-2-or-not-in-a-single-line. | |
| size_t | next_power_of_2 (size_t x) |
Return the smallest power of 2 that is not less than x. | |
| std::string | demangle (const char *name) |
| Given a linker symbol name generated by a c++ compiler, this functions decodes it into a user level name. | |
| void | error_msg (const std::string &msg) |
| Display message and abort program execution. | |
| bool | exists_file (const std::string &name) |
Return true if it exists a file of name | |
| template<class C > | |
| std::string | Rvector (const std::string &name, const C &c) |
Return a string with R specification of a vector with name and data stored in container c | |
| template<class C > | |
| std::string | Rvector (const C &c) |
Return a string with an R assignment for a container interpreted as [name, value1, value2, ...]. | |
| double | interpolate (const double x1, const double x2, const double y1, const double y2, const double x) |
| Basic linear interpolation. | |
| double | extrapolate_left (const double x1, const double x2, const double y1, const double y2, const double x) |
| Basic linear extrapolation. | |
| double | pow2 (const double x) |
| Return x^2. | |
| double | pow3 (const double x) |
| Return x^3. | |
| double | extrapolate_right (const double x1, const double x2, const double y1, const double y2, const double x) |
| Basic linear extrapolation. | |
| double | next_value (const double val) |
Return the next representable floating-point value to val | |
| double | prev_value (const double val) |
Return the next representable floating-point value of val towards the smallest positive normal number. | |
| constexpr bool | are_near (const double v1, const double v2, const double e) noexcept |
Return true if v1 is within absolute distance e of v2. | |
| void | execute_R_script (const std::string &scr, const std::string &file_name="tmp.R") |
| Generate and execute a R script from a string (containing the script) | |
| bool | is_normal_number (const double n) |
Return true if a floating-point number is normal or zero. | |
| template<typename T > requires AlOrderedDomainKey<T> | |
| and AlStreamable< T > std::ostream & | operator<< (std::ostream &s, const AlDomain< T > &dom) |
| Output stream operator for AlDomain. | |
| template<typename Trow , typename Tcol , typename NumType > requires AlMultiplicativeNumber<NumType> | |
| Matrix< Trow, Tcol, NumType > | operator* (const NumType &scalar, const Matrix< Trow, Tcol, NumType > &m) |
| Scalar-matrix multiplication (scalar * matrix). | |
| template<typename Trow , typename Tcol , typename NumType > requires AlAdditiveNumber<NumType> | |
| and AlMultiplicativeNumber< NumType > Vector< Tcol, NumType > | operator* (const Vector< Trow, NumType > &vec, const Matrix< Trow, Tcol, NumType > &m) |
| Vector-matrix multiplication (vector * matrix). | |
| template<typename Trow , typename Tcol , typename NumType > requires AlOrderedDomainKey<Trow> | |
| and AlOrderedDomainKey< Tcol > and AlStreamable< Trow > and AlStreamable< Tcol > and AlStreamable< NumType > std::ostream & | operator<< (std::ostream &s, const Matrix< Trow, Tcol, NumType > &m) |
| Stream output operator for Matrix. | |
| template<typename Trow , typename Tcol , typename NumType = double> requires AlMultiplicativeNumber<NumType> | |
| Matrix< Trow, Tcol, NumType > | outer_product (const Vector< Trow, NumType > &v1, const Vector< Tcol, NumType > &v2) |
| Compute the outer product of two vectors. | |
| template<typename T , typename NumType > requires AlMultiplicativeNumber<NumType> | |
| Vector< T, NumType > | operator* (const NumType &scalar, const Vector< T, NumType > &v) |
The vector v multiplied by scalar. | |
| std::ostream & | operator<< (std::ostream &s, const Vector< T, NumType > &vec) |
| template<AdversarialGameDomain Domain> | |
| auto | alpha_beta_search (Domain domain, typename Domain::State initial_state, ExplorationPolicy policy=Alpha_Beta< Domain >::default_policy(), SearchLimits limits={}) |
| Convenience wrapper for one-shot Alpha-Beta search. | |
| template<AdversarialGameDomain Domain, typename Tracer > requires AdversarialSearchTracer<Tracer, typename Domain::Move, typename Domain::Score> | |
| auto | alpha_beta_search (Domain domain, typename Domain::State initial_state, Tracer &tracer, ExplorationPolicy policy=Alpha_Beta< Domain >::default_policy(), SearchLimits limits={}) |
| Convenience wrapper for one-shot Alpha-Beta search with tracing. | |
| template<AdversarialGameDomain Domain, typename Table , typename Keyer > requires AdversarialSearchKeyer<Table, Keyer, typename Domain::State, typename Domain::Move, typename Domain::Score> | |
| auto | alpha_beta_search (Domain domain, typename Domain::State initial_state, Table &table, Keyer keyer, ExplorationPolicy policy=Alpha_Beta< Domain >::default_policy(), SearchLimits limits={}) |
| Convenience wrapper for Alpha-Beta search with transposition table. | |
| template<AdversarialGameDomain Domain, typename Table , typename Keyer , typename Tracer > requires AdversarialSearchKeyer<Table, Keyer, typename Domain::State, typename Domain::Move, typename Domain::Score> | |
| and AdversarialSearchTracer< Tracer, typename Domain::Move, typename Domain::Score > auto | alpha_beta_search (Domain domain, typename Domain::State initial_state, Table &table, Keyer keyer, Tracer &tracer, ExplorationPolicy policy=Alpha_Beta< Domain >::default_policy(), SearchLimits limits={}) |
| Convenience wrapper for Alpha-Beta search with TT/keyer and tracing. | |
| template<AdversarialGameDomain Domain, typename Table > requires SearchStateKeyProvider<Domain> | |
| and AdversarialTranspositionMemo< Table, typename Domain::State_Key, typename Domain::Move, typename Domain::Score > auto | alpha_beta_search (Domain domain, typename Domain::State initial_state, Table &table, ExplorationPolicy policy=Alpha_Beta< Domain >::default_policy(), SearchLimits limits={}) |
| Convenience wrapper for Alpha-Beta search with domain-provided state key. | |
| template<AdversarialGameDomain Domain, typename Table , typename Tracer > requires SearchStateKeyProvider<Domain> | |
| and AdversarialTranspositionMemo< Table, typename Domain::State_Key, typename Domain::Move, typename Domain::Score > and AdversarialSearchTracer< Tracer, typename Domain::Move, typename Domain::Score > auto | alpha_beta_search (Domain domain, typename Domain::State initial_state, Table &table, Tracer &tracer, ExplorationPolicy policy=Alpha_Beta< Domain >::default_policy(), SearchLimits limits={}) |
| Convenience wrapper for Alpha-Beta search with domain-provided key and tracing. | |
| template<AdversarialGameDomain Domain, typename Tracer > requires AdversarialSearchTracer<Tracer, typename Domain::Move, typename Domain::Score> | |
| auto | iterative_deepening_alpha_beta_search (Domain domain, typename Domain::State initial_state, Tracer &tracer, ExplorationPolicy policy=Alpha_Beta< Domain >::default_policy(), SearchLimits limits={}, AdversarialIterativeDeepeningOptions< typename Domain::Score > options={}) |
| Iterative deepening over Alpha-Beta with optional aspiration windows. | |
| template<AdversarialGameDomain Domain, typename Table , typename Keyer , typename Tracer > requires AdversarialSearchKeyer<Table, Keyer, typename Domain::State, typename Domain::Move, typename Domain::Score> | |
| and AdversarialSearchTracer< Tracer, typename Domain::Move, typename Domain::Score > auto | iterative_deepening_alpha_beta_search (Domain domain, typename Domain::State initial_state, Table &table, Keyer keyer, Tracer &tracer, ExplorationPolicy policy=Alpha_Beta< Domain >::default_policy(), SearchLimits limits={}, AdversarialIterativeDeepeningOptions< typename Domain::Score > options={}) |
| Iterative deepening over Alpha-Beta with TT/keyer reuse. | |
| template<AdversarialGameDomain Domain, typename Table , typename Tracer > requires SearchStateKeyProvider<Domain> | |
| and AdversarialTranspositionMemo< Table, typename Domain::State_Key, typename Domain::Move, typename Domain::Score > and AdversarialSearchTracer< Tracer, typename Domain::Move, typename Domain::Score > auto | iterative_deepening_alpha_beta_search (Domain domain, typename Domain::State initial_state, Table &table, Tracer &tracer, ExplorationPolicy policy=Alpha_Beta< Domain >::default_policy(), SearchLimits limits={}, AdversarialIterativeDeepeningOptions< typename Domain::Score > options={}) |
Iterative deepening over Alpha-Beta using domain.state_key(). | |
| template<AdversarialGameDomain Domain> | |
| auto | iterative_deepening_alpha_beta_search (Domain domain, typename Domain::State initial_state, ExplorationPolicy policy=Alpha_Beta< Domain >::default_policy(), SearchLimits limits={}, AdversarialIterativeDeepeningOptions< typename Domain::Score > options={}) |
| Iterative deepening over Alpha-Beta without tracing. | |
| template<AdversarialGameDomain Domain, typename Table , typename Keyer > requires AdversarialSearchKeyer<Table, Keyer, typename Domain::State, typename Domain::Move, typename Domain::Score> | |
| auto | iterative_deepening_alpha_beta_search (Domain domain, typename Domain::State initial_state, Table &table, Keyer keyer, ExplorationPolicy policy=Alpha_Beta< Domain >::default_policy(), SearchLimits limits={}, AdversarialIterativeDeepeningOptions< typename Domain::Score > options={}) |
| Iterative deepening over Alpha-Beta with TT/keyer reuse and no tracing. | |
| template<AdversarialGameDomain Domain, typename Table > requires SearchStateKeyProvider<Domain> | |
| and AdversarialTranspositionMemo< Table, typename Domain::State_Key, typename Domain::Move, typename Domain::Score > auto | iterative_deepening_alpha_beta_search (Domain domain, typename Domain::State initial_state, Table &table, ExplorationPolicy policy=Alpha_Beta< Domain >::default_policy(), SearchLimits limits={}, AdversarialIterativeDeepeningOptions< typename Domain::Score > options={}) |
Iterative deepening over Alpha-Beta using domain.state_key() and no tracing. | |
| template<typename T > | |
| Array_Iterator< T > | get_array_it (const T *array, size_t n) |
| Create an iterator for a raw array. | |
| template<typename T > | |
| Array_Container< T > | make_array_container (T *array, size_t n) |
| Create an Array_Container from a raw array. | |
| template<class Tarray > | |
| void | open_gap (Tarray &ptr, size_t n, size_t pos=0, size_t num_entries=1) |
| Open a gap in an array by shifting elements right. | |
| template<typename T > | |
| void | close_gap (T *ptr, size_t n, size_t pos, size_t num_entries=1) |
| Close a gap in an array by shifting elements left. | |
| template<typename T > | |
| void | reverse (T *ptr, const size_t n) noexcept |
| Reverse an array in-place. | |
| template<typename T > | |
| void | rotate_left (T *ptr, const size_t n, size_t m) noexcept |
| Rotate array elements left by m positions. | |
| template<typename T > | |
| void | rotate_right (T *ptr, const size_t n, size_t m) noexcept |
| Rotate array elements right by m positions. | |
| template<class Node > | |
| int | checked_avl_height_rk (Node *p) noexcept |
| Height of a ranked AVL subtree, checking all its nodes. | |
| template<class Node > | |
| bool | is_avl_rk (Node *p) |
| Verify if tree rooted at p is a valid AVL tree with correct counters. | |
| template<BacktrackingDomain Domain> | |
| auto | backtracking_search (Domain domain, typename Domain::State initial_state, ExplorationPolicy policy={}, SearchLimits limits={}) |
| Convenience wrapper that runs a one-shot DFS/backtracking search. | |
| template<BacktrackingDomain Domain, typename OnSolution > requires SearchSolutionVisitor<OnSolution, SearchSolution<typename Domain::State, typename Domain::Move>> | |
| auto | backtracking_search (Domain domain, typename Domain::State initial_state, OnSolution &on_solution, ExplorationPolicy policy={}, SearchLimits limits={}) |
| Convenience wrapper with a solution callback/collector. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| size_t | compute_maximum_cardinality_general_matching (const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA()) |
| Computes a maximum cardinality matching in a general graph. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| size_t | blossom_maximum_cardinality_matching (const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA()) |
| Alias of compute_maximum_cardinality_general_matching(). | |
| template<AlephGraph GT, class Weight = Dft_Dist<GT>, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| Blossom_Weighted_Result< long long > | compute_maximum_weight_general_matching (const GT &g, DynDlist< typename GT::Arc * > &matching, Weight weight=Weight(), SA sa=SA(), const bool max_cardinality=false) |
| Compute maximum-weight matching in a general undirected graph. | |
| template<AlephGraph GT, class Weight = Dft_Dist<GT>, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| Blossom_Weighted_Result< long long > | blossom_maximum_weight_matching (const GT &g, DynDlist< typename GT::Arc * > &matching, Weight weight=Weight(), SA sa=SA(), const bool max_cardinality=false) |
| Alias for compute_maximum_weight_general_matching(). | |
| template<BranchAndBoundDomain Domain, typename ObjectivePolicy = Maximize_Objective<typename Domain::Objective>> requires BranchAndBoundObjectivePolicy<ObjectivePolicy, typename Domain::Objective> | |
| auto | branch_and_bound_search (Domain domain, typename Domain::State initial_state, ExplorationPolicy policy=Branch_And_Bound< Domain, ObjectivePolicy >::default_policy(), SearchLimits limits={}, ObjectivePolicy objective={}) |
| Convenience wrapper for one-shot branch and bound. | |
| template<BranchAndBoundDomain Domain, typename OnSolution , typename ObjectivePolicy = Maximize_Objective<typename Domain::Objective>> requires BranchAndBoundObjectivePolicy<ObjectivePolicy, typename Domain::Objective> | |
| and SearchSolutionVisitor< OnSolution, OptimizationSolution< typename Domain::State, typename Domain::Move, typename Domain::Objective > > auto | branch_and_bound_search (Domain domain, typename Domain::State initial_state, OnSolution &on_solution, ExplorationPolicy policy=Branch_And_Bound< Domain, ObjectivePolicy >::default_policy(), SearchLimits limits={}, ObjectivePolicy objective={}) |
| Convenience wrapper for branch and bound with a solution callback. | |
| constexpr size_t | compiler_bytecode_invalid_id () noexcept |
| Returns the sentinel invalid bytecode id. | |
| const char * | compiler_bytecode_constant_kind_name (const Compiler_Bytecode_Constant_Kind kind) noexcept |
| Stable debug name for one constant kind. | |
| const char * | compiler_bytecode_opcode_name (const Compiler_Bytecode_Opcode opcode) noexcept |
| Stable debug name for one bytecode opcode. | |
| Compiler_Bytecode_Validation_Report | validate_bytecode_function (const Compiler_Bytecode_Function &function, const Compiler_Bytecode_Module *module=nullptr) |
| Validates one lowered bytecode function structurally. | |
| Compiler_Bytecode_Validation_Report | validate_bytecode_module (const Compiler_Bytecode_Module &module) |
| Validates all bytecode functions in one module. | |
| std::string | compiler_dump_bytecode_function (const Compiler_Bytecode_Function *function, const Compiler_Bytecode_Module *module=nullptr, const Compiler_Type_Context *types=nullptr) |
| Dumps one lowered bytecode function deterministically. | |
| std::string | compiler_dump_bytecode_module (const Compiler_Bytecode_Module *module, const Compiler_Type_Context *types=nullptr) |
| Dumps all lowered bytecode in one module deterministically. | |
| const char * | compiler_bytecode_value_kind_name (const Compiler_Bytecode_Value_Kind kind) noexcept |
| Stable debug name for one bytecode runtime value kind. | |
| const char * | compiler_bytecode_completion_kind_name (const Compiler_Bytecode_Completion_Kind kind) noexcept |
| Stable debug name for one execution completion kind. | |
| bool | compiler_bytecode_values_equal (const Compiler_Bytecode_Value &lhs, const Compiler_Bytecode_Value &rhs) |
| Returns whether two bytecode values compare equal. | |
| std::string | compiler_bytecode_value_to_string (const Compiler_Bytecode_Value &value, const Compiler_Bytecode_Module *module=nullptr) |
| Renders one bytecode value deterministically. | |
| std::string | compiler_dump_bytecode_globals (const Compiler_Bytecode_Module *module, const DynArray< Compiler_Bytecode_Value > &globals) |
| Dumps the current global state associated with one bytecode module. | |
| Source_Span | compiler_merge_spans (const Source_Span &lhs, const Source_Span &rhs) noexcept |
| Merges two spans from the same source file. | |
| const char * | compiler_expr_kind_name (const Compiler_Expr_Kind kind) noexcept |
| Returns a stable debug name for an expression kind. | |
| const char * | compiler_stmt_kind_name (const Compiler_Stmt_Kind kind) noexcept |
| Returns a stable debug name for a statement kind. | |
| const char * | compiler_type_expr_kind_name (const Compiler_Type_Expr_Kind kind) noexcept |
| Returns a stable debug name for a type-expression kind. | |
| const char * | compiler_type_decl_kind_name (const Compiler_Type_Decl_Kind kind) noexcept |
| Returns a stable debug name for a type-declaration kind. | |
| std::string | compiler_dump_expr (const Compiler_Expr *expr) |
| Dumps an expression subtree in a deterministic text format. | |
| std::string | compiler_dump_stmt (const Compiler_Stmt *stmt) |
| Dumps a statement subtree in a deterministic text format. | |
| std::string | compiler_dump_import_decl (const Compiler_Import_Decl *decl) |
| Dumps an import declaration subtree in a deterministic text format. | |
| std::string | compiler_dump_type_decl (const Compiler_Type_Decl *decl) |
| Dumps a type declaration subtree in a deterministic text format. | |
| std::string | compiler_dump_function (const Compiler_Function_Decl *fn) |
| Dumps a function declaration in a deterministic text format. | |
| std::string | compiler_dump_module (const Compiler_Module *module) |
| Dumps a parsed module in a deterministic text format. | |
| Compiler_C_Backend_Emission | compiler_emit_c_module (const Compiler_IR_Module *module, const Compiler_C_Backend_Options &options={}, const Compiler_Type_Context *types=nullptr) |
| Convenience wrapper that emits one IR module to portable C. | |
| constexpr Compiler_CFG_Block_Id | compiler_cfg_invalid_block_id () noexcept |
| Returns the sentinel value for an invalid block ID. | |
| const char * | compiler_cfg_terminator_kind_name (const Compiler_CFG_Terminator_Kind kind) noexcept |
| Returns a stable string name for a CFG terminator kind. | |
| Compiler_CFG_Validation_Report | validate_cfg_function (const Compiler_CFG_Function &function) |
| Validates one lowered CFG function structurally. | |
| Compiler_CFG_Validation_Report | validate_cfg_module (const Compiler_CFG_Module &module) |
| Validates all CFGs in a lowered module. | |
| std::string | compiler_dump_cfg_function (const Compiler_CFG_Function *function, const Compiler_Type_Context *types=nullptr) |
| Dumps a single CFG function in text format for debugging. | |
| std::string | compiler_dump_cfg_module (const Compiler_CFG_Module *module, const Compiler_Type_Context *types=nullptr) |
| Dumps a complete CFG module in text format for debugging. | |
| const char * | compiler_dataflow_constant_kind_name (const Compiler_Dataflow_Constant_Kind kind) noexcept |
| Returns a stable debug name for one constant-lattice kind. | |
| Compiler_Dataflow_Function_Analysis | analyze_dataflow_function (const Compiler_IR_Function &function) |
| Computes reachability, liveness, definite assignment, and constant propagation for one IR function. | |
| Compiler_Dataflow_Validation_Report | validate_dataflow_analysis (const Compiler_IR_Function &function, const Compiler_Dataflow_Function_Analysis &analysis) |
| Validates structural invariants of a dataflow result against its source function. | |
| std::string | compiler_dump_dataflow_analysis (const Compiler_IR_Function *function, const Compiler_Dataflow_Function_Analysis &analysis, const Compiler_Type_Context *types=nullptr) |
| Produces a deterministic, human-readable dump of a dataflow result. | |
| Compiler_Dead_Code_Elimination_Result | eliminate_dead_code (const Compiler_IR_Function &function) |
| Eliminates unreachable blocks, dead pure instructions, dead local stores, and folds constant-condition branches. | |
| Compiler_Dataflow_Validation_Report | validate_dead_code_elimination (const Compiler_Dead_Code_Elimination_Result &result, const Compiler_IR_Module *module=nullptr) |
| Validates the result of dead-code elimination. | |
| const char * | compiler_driver_action_name (const Compiler_Driver_Action action) noexcept |
| Returns the canonical external spelling for one driver action. | |
| bool | compiler_parse_driver_action (std::string_view text, Compiler_Driver_Action &action) noexcept |
| Parses one canonical driver action spelling. | |
| Source_Span | compiler_hir_merge_spans (const Source_Span &lhs, const Source_Span &rhs) noexcept |
| Merges two spans without depending on the parser-oriented AST layer. | |
| const char * | compiler_hir_expr_kind_name (const Compiler_HIR_Expr_Kind kind) noexcept |
| Returns a stable debug name for an HIR expression kind. | |
| const char * | compiler_hir_stmt_kind_name (const Compiler_HIR_Stmt_Kind kind) noexcept |
| Returns a stable debug name for an HIR statement kind. | |
| const char * | compiler_hir_constant_kind_name (const Compiler_HIR_Constant_Kind kind) noexcept |
| Returns a stable debug name for an HIR constant kind. | |
| std::string | compiler_dump_hir_expr (const Compiler_HIR_Expr *expr, const Compiler_Type_Context &types) |
| Dumps one HIR expression in a deterministic text format. | |
| std::string | compiler_dump_hir_stmt (const Compiler_HIR_Stmt *stmt, const Compiler_Type_Context &types) |
| Dumps one HIR statement in a deterministic text format. | |
| std::string | compiler_dump_hir_function (const Compiler_HIR_Function *function, const Compiler_Type_Context &types) |
| Dumps one HIR function in a deterministic text format. | |
| std::string | compiler_dump_hir_module (const Compiler_HIR_Module *module, const Compiler_Type_Context &types) |
| Dumps one HIR module in a deterministic text format. | |
| constexpr size_t | compiler_ir_invalid_id () noexcept |
| Returns the sentinel invalid IR id. | |
| const char * | compiler_ir_slot_kind_name (const Compiler_IR_Slot_Kind kind) noexcept |
| Stable debug name for one slot kind. | |
| const char * | compiler_ir_instruction_kind_name (const Compiler_IR_Instruction_Kind kind) noexcept |
| Stable debug name for one instruction kind. | |
| const char * | compiler_ir_terminator_kind_name (const Compiler_IR_Terminator_Kind kind) noexcept |
| Stable debug name for one terminator kind. | |
| Compiler_IR_Validation_Report | validate_ir_function (const Compiler_IR_Function &function, const Compiler_IR_Module *module=nullptr) |
| Validates one lowered IR function structurally. | |
| Compiler_IR_Validation_Report | validate_ir_module (const Compiler_IR_Module &module) |
| Validates all functions in one lowered IR module. | |
| std::string | compiler_dump_ir_function (const Compiler_IR_Function *function, const Compiler_IR_Module *module=nullptr, const Compiler_Type_Context *types=nullptr) |
| Dumps one lowered IR function deterministically. | |
| std::string | compiler_dump_ir_module (const Compiler_IR_Module *module, const Compiler_Type_Context *types=nullptr) |
| Dumps all lowered IR in one module deterministically. | |
| const char * | compiler_module_binding_issue_name (const Compiler_Module_Binding_Issue_Kind kind) noexcept |
| Returns the stable debug name for one module-binding issue kind. | |
| Compiler_Module_Binding_Result | compiler_bind_module_surfaces (const Compiler_Module_Link_Result &linkage) |
| Binds linked module surfaces into one deterministic name view. | |
| std::string | compiler_render_module_bindings (const Compiler_Module_Binding_Result &result) |
| Renders one deterministic text artifact for bound module names. | |
| const char * | compiler_module_linkage_issue_name (const Compiler_Module_Linkage_Issue_Kind kind) noexcept |
| Returns the stable debug name for one linkage issue kind. | |
| Compiler_Module_Link_Result | compiler_link_module_surfaces (const DynArray< Compiler_Module_Descriptor > &descriptors, const DynArray< Compiler_Module_Metadata > &metadata, const DynArray< size_t > &order) |
| Links direct-import module surfaces into visible top-level views. | |
| std::string | compiler_render_module_linkage (const Compiler_Module_Link_Result &result) |
| Renders one deterministic text artifact for linked module surfaces. | |
| const char * | compiler_module_export_kind_name (const Compiler_Module_Export_Kind kind) noexcept |
| Returns the stable debug name for one module-export kind. | |
| std::string | compiler_render_module_metadata (const DynArray< Compiler_Module_Metadata > &modules) |
| Renders one deterministic text artifact for module metadata. | |
| size_t | compiler_emit_module_name_resolution_diagnostic (Diagnostic_Engine &diagnostics, const Source_Span &span, const Compiler_Module_Name_Resolution &resolution, const std::string &code, const std::string &subject) |
| Emits one structured diagnostic for a module-name resolution failure. | |
| const char * | compiler_module_name_filter_name (const Compiler_Module_Name_Filter filter) noexcept |
| Returns the stable debug name for one module-name filter. | |
| const char * | compiler_module_name_resolution_status_name (const Compiler_Module_Name_Resolution_Status status) noexcept |
| Returns the stable debug name for one module-name resolution status. | |
| Compiler_Module_Name_Resolution | compiler_resolve_module_name (const Compiler_Module_Binding_Result &bindings, const std::string_view module_name, const std::string_view symbol_name, const Compiler_Module_Name_Filter filter=Compiler_Module_Name_Filter::Any) |
| Resolves one top-level name through reusable per-module bindings. | |
| Compiler_Module_Name_Resolution | compiler_resolve_module_name (const Compiler_Module_Name_Table &table, const std::string_view module_name, const std::string_view symbol_name, const Compiler_Module_Name_Filter filter=Compiler_Module_Name_Filter::Any) |
| Resolves one top-level name through a cached per-module name table. | |
| Compiler_Module_Name_Table | compiler_build_module_name_table (const Compiler_Module_Binding_Result &bindings) |
| Builds one reusable per-module name table from bindings. | |
| std::string | compiler_render_module_name_table (const Compiler_Module_Name_Table &table) |
| Renders one deterministic text artifact for cached module names. | |
| const char * | compiler_module_resolution_issue_name (const Compiler_Module_Resolution_Issue_Kind kind) noexcept |
| Returns the stable debug name of one module-resolution issue kind. | |
| std::string | compiler_render_module_order (const DynArray< size_t > &order, const DynArray< Compiler_Module_Descriptor > &modules) |
| Renders one deterministic text artifact for a module order. | |
| Compiler_Module_Resolution_Result | compiler_resolve_module_order (const DynArray< Compiler_Module_Descriptor > &modules) |
| Resolves one dependency-first order for exact-name module imports. | |
| Compiler_Module_Semantic_Environment | compiler_build_module_semantic_environment (const Compiler_Module_Name_Table &table) |
| Builds one namespace-separated semantic environment from a name table. | |
| const Compiler_Module_Semantic_Module * | compiler_find_module_semantic_environment (const Compiler_Module_Semantic_Environment &env, const std::string_view module_name) noexcept |
| Finds one semantic environment by module name. | |
| const Compiler_Module_Bound_Name * | compiler_lookup_module_value (const Compiler_Module_Semantic_Environment &env, const std::string_view module_name, const std::string_view symbol_name) noexcept |
| Looks up one visible value-namespace binding in a module environment. | |
| const Compiler_Module_Bound_Name * | compiler_lookup_module_type (const Compiler_Module_Semantic_Environment &env, const std::string_view module_name, const std::string_view symbol_name) noexcept |
| Looks up one visible type-namespace binding in a module environment. | |
| std::string | compiler_render_module_semantic_environment (const Compiler_Module_Semantic_Environment &env) |
| Renders one deterministic text artifact for semantic environments. | |
| const char * | compiler_operator_name (const Compiler_Operator_Kind kind) noexcept |
| Returns a stable debug name for one operator kind. | |
| Compiler_Operator_Kind | compiler_operator_from_token_kind (const Compiler_Token_Kind kind) noexcept |
| Maps one reference-frontend token kind into a reusable operator kind. | |
| Compiler_Token_Kind | compiler_operator_to_token_kind (const Compiler_Operator_Kind kind) noexcept |
| Maps one reusable operator kind back into the MVP token kind. | |
| bool | compiler_operator_is_compound_assignment (const Compiler_Operator_Kind kind) noexcept |
Returns whether kind is one compound-assignment operator. | |
| Compiler_Operator_Kind | compiler_operator_compound_base (const Compiler_Operator_Kind kind) noexcept |
| Returns the arithmetic operator underlying one compound assignment. | |
| Compiler_Integer_Result | compiler_integer_binary (const Compiler_Operator_Kind op, const long long lhs, const long long rhs) noexcept |
| Applies one integer operator of the language to two values. | |
| Compiler_Integer_Result | compiler_integer_negate (const long long operand) noexcept |
| Negates one integer of the language. | |
| bool | compiler_is_expression_start (const Compiler_Token_Kind kind) noexcept |
| Returns whether a token kind can start an expression in the MVP grammar. | |
| bool | compiler_is_statement_start (const Compiler_Token_Kind kind) noexcept |
| Returns whether a token kind can start a statement in the MVP grammar. | |
| bool | compiler_is_top_level_declaration_start (const Compiler_Token_Kind kind) noexcept |
| Returns whether a token kind starts one top-level declaration. | |
| std::string | compiler_unquote_string_token (const Compiler_Token &token) |
| Removes surrounding double quotes from one string-literal token. | |
| const char * | compiler_symbol_kind_name (const Compiler_Symbol_Kind kind) noexcept |
| Returns a stable debug name for a symbol kind. | |
| const char * | compiler_token_kind_name (Compiler_Token_Kind kind) |
| Returns a human-readable name for a token kind. | |
| Compiler_Token_Kind | classify_compiler_keyword (std::string_view lexeme) noexcept |
| Classifies a lexeme as a keyword or Identifier. | |
| bool | compiler_token_is_keyword (Compiler_Token_Kind kind) noexcept |
| Predicate: Is the kind a reserved keyword? | |
| bool | compiler_token_is_literal (Compiler_Token_Kind kind) noexcept |
| Predicate: Is the kind a literal (number, string, bool, etc.)? | |
| bool | compiler_token_is_comment (Compiler_Token_Kind kind) noexcept |
| Predicate: Is the kind a comment? | |
| bool | compiler_token_is_operator (Compiler_Token_Kind kind) noexcept |
| Predicate: Is the kind an operator (arithmetic, logical, etc.)? | |
| int | compiler_binary_precedence (Compiler_Token_Kind kind) noexcept |
| Returns binary precedence for an operator. | |
| Compiler_Associativity | compiler_binary_associativity (Compiler_Token_Kind kind) noexcept |
| Returns binary associativity for an operator. | |
| const char * | compiler_type_kind_name (const Compiler_Type_Kind kind) noexcept |
| Returns a stable debug name for a type kind. | |
| const char * | compiler_builtin_type_name (const Compiler_Builtin_Type builtin) noexcept |
| Returns a stable debug name for a built-in type. | |
| template<class GT , class Func > | |
| auto | with_clean_cookies (GT &g, Func &&func) -> decltype(func()) |
| Convenience function to run an algorithm with automatic cookie cleanup. | |
| template<class GT , class Func > | |
| auto | with_saved_cookies (GT &g, Func &&func) -> decltype(func()) |
| Convenience function to run an algorithm preserving existing cookies. | |
| template<class GT , class Cleanup > | |
| Scope_Guard (const GT &, Cleanup) -> Scope_Guard< GT, Cleanup > | |
| Deduction guide for Scope_Guard. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| DynList< std::pair< typename GT::Node *, typename GT::Node * > > | compute_dominators (GT &g, typename GT::Node *root, SA sa=SA()) |
| Compute immediate dominators of a digraph from a root node. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| void | build_dominator_tree (GT &g, typename GT::Node *root, GT &tree, SA sa=SA()) |
| Build the dominator tree of a digraph. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| DynMapTree< typename GT::Node *, DynSetTree< typename GT::Node * > > | compute_dominance_frontiers (GT &g, typename GT::Node *root, SA sa=SA()) |
| Compute dominance frontiers of a digraph. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| DynList< std::pair< typename GT::Node *, typename GT::Node * > > | compute_post_dominators (const GT &g, typename GT::Node *exit_node, SA sa=SA()) |
| Compute immediate post-dominators of a digraph from an exit node. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| void | build_post_dominator_tree (const GT &g, typename GT::Node *exit_node, GT &tree, SA sa=SA()) |
| Build the post-dominator tree of a digraph. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| DynMapTree< typename GT::Node *, DynSetTree< typename GT::Node * > > | compute_post_dominance_frontiers (const GT &g, typename GT::Node *exit_node, SA sa=SA()) |
| Compute post-dominance frontiers of a digraph. | |
| template<typename Cost , class Transition_Cost_Fn > | |
| Divide_Conquer_DP_Result< Cost > | divide_and_conquer_partition_dp (const size_t groups, const size_t n, Transition_Cost_Fn transition_cost, const Cost inf=dp_optimization_detail::default_inf< Cost >()) |
| Optimize partition DP using divide-and-conquer optimization. | |
| template<typename Cost , class Interval_Cost_Fn > | |
| Knuth_Optimization_Result< Cost > | knuth_optimize_interval (const size_t n, Interval_Cost_Fn interval_cost, const Cost inf=dp_optimization_detail::default_inf< Cost >()) |
| Optimize interval DP with Knuth optimization. | |
| Knuth_Optimization_Result< size_t > | optimal_merge_knuth (const Array< size_t > &weights) |
| Optimal adjacent merge cost via Knuth optimization. | |
| template<typename Cost > | |
| Monotone_Queue_DP_Result< Cost > | monotone_queue_min_dp (const Array< Cost > &base_cost, const size_t window, const Cost inf=dp_optimization_detail::default_inf< Cost >()) |
| Optimize windowed min-transition DP with a monotone queue. | |
| template<typename T > | |
| Array< T > | min_weighted_squared_distance_1d (const Array< T > &xs, const Array< T > &weights) |
| Weighted squared-distance lower envelope on a line. | |
| template<AlephGraph GT> | |
| GT | gen_random_euclidian_graph (size_t n, size_t m, int w, int h, unsigned int seed) |
| void | print_rule () |
| Prints a horizontal rule for example output separation. | |
| template<typename T > | |
| DynList< T > | get_futures (DynList< std::future< T > > &future_list) |
| Collect results from a list of futures. | |
| template<typename T > | |
| DynList< T > | get_futures (DynList< std::future< T > > &&future_list) |
| Collect results from a list of futures (rvalue overload). | |
| void | get_futures (DynList< std::future< void > > &future_list) |
| Wait for all void futures to complete. | |
| void | get_futures (DynList< std::future< void > > &&future_list) |
| Wait for all void futures to complete (rvalue overload). | |
| template<typename T > | |
| bool | all_ready (DynList< std::future< T > > &future_list) |
| Check if all futures in a list are ready. | |
| template<typename T > | |
| size_t | count_ready (DynList< std::future< T > > &future_list) |
| Count how many futures are ready. | |
| template<AlephGraph GT, class Node_Label = Dft_Df_Tree_Label<GT>, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| Df_Low_Tree_Node * | build_df_low_tree (const GT &g, typename GT::Node *src, DynList< Df_Low_Non_Tree_Arc > &non_tree_arcs, Node_Label node_label=Node_Label(), SA sa=SA()) |
| Build the depth-first spanning tree of an undirected graph, with the df and low numbers of its nodes. | |
| template<class Write = Write_Df_Tree_Low, AlephGraph GT, class Node_Label = Dft_Df_Tree_Label<GT>, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| void | write_df_low_tree (const GT &g, typename GT::Node *src, std::ostream &out, Node_Label node_label=Node_Label(), SA sa=SA()) |
Write, for ntreepic, the depth-first spanning tree of an undirected graph with the df and low numbers of its nodes. | |
| template<AlephGraph GT, ArcFilter< GT > SA> | |
| static bool | is_there_a_double_arc (const GT *g, typename GT::Node *src, typename GT::Node *tgt, const SA &sa) noexcept(nothrow_arc_filter_v< GT, SA >) |
| Whether the digraph g has, among the arcs that sa shows, an arc from src to tgt and another from tgt to src; false if g is not a digraph. | |
| template<AlephGraph GT> | |
| static int | search_node (DynArray< typename GT::Node * > &nodes, typename GT::Node *p) noexcept |
| template<AlephGraph GT, class Write_Node , class Write_Arc , class Shade_Node , class Shade_Arc , ArcFilter< GT > SA> | |
| void | generate_graphpic (const GT &g, const double &xdist, const double &ydist, std::ostream &output, SA sa=SA()) |
| Generate a graphpic specification for graph visualization. | |
| template<AlephGraph GT, class Write_Node , class Write_Arc , class Shade_Node , class Shade_Arc , class Dashed_Node , class Dashed_Arc , ArcFilter< GT > SA, NodeFilter< GT > SN> | |
| void | generate_graphviz (const GT &g, std::ostream &output, const std::string &rankdir="TB", float ranksep=0.2, float nodesep=0.2, SA sa=SA()) |
| Generate a Graphviz DOT specification for graph visualization. | |
| template<AlephGraph GT, class Node_Attr , class Arc_Attr , NodeFilter< GT > SN, ArcFilter< GT > SA> | |
| void | generate_graphviz (const GT &g, std::ostream &out, Node_Attr node_attr=Node_Attr(), Arc_Attr arc_attr=Arc_Attr(), const std::string &rankdir="TB", SA sa=SA()) |
| Generate Graphviz DOT output with custom attribute functors. | |
| template<AlephGraph GT, class Node_Attr , class Arc_Attr , NodeFilter< GT > SN, ArcFilter< GT > SA> | |
| void | digraph_graphviz (const GT &g, std::ostream &out, Node_Attr node_attr=Node_Attr(), Arc_Attr arc_attr=Arc_Attr(), const std::string &rankdir="LR", SA sa=SA()) |
| Generate Graphviz DOT output specifically for digraphs. | |
| template<AlephGraph GT, class Node_Attr , class Arc_Attr , NodeFilter< GT > SN, ArcFilter< GT > SA> | |
| size_t | rank_graphviz (const GT &g, std::ostream &out, Node_Attr node_attr=Node_Attr(), Arc_Attr arc_attr=Arc_Attr(), const std::string &rankdir="LR", SA sa=SA()) |
| Generate Graphviz DOT output with topological ranking. | |
| template<AlephGraph GT, class Write_Node , class Write_Arc , class Shade_Node , class Shade_Arc , ArcFilter< GT > SA> | |
| void | generate_cross_graph (GT &g, const size_t &nodes_by_level, const double &xdist, const double &ydist, std::ostream &out, SA sa=SA()) |
| Generate a cross-graph layout specification for graphpic. | |
| template<AlephGraph GT, class Write_Node , class Write_Arc , class Shade_Node , class Shade_Arc > | |
| void | generate_cross_graph (GT &g, const size_t &nodes_by_level, const double &xdist, const double &ydist, std::ostream &out) |
| template<AlephGraph GT, class Write_Node , class Write_Arc , class Shade_Node , class Shade_Arc , ArcFilter< GT > SA> | |
| void | generate_net_graph (GT &g, const size_t &nodes_by_level, const double &xdist, const double &ydist, std::ostream &out, SA sa=SA()) |
| Generate a net-graph layout specification for graphpic. | |
| template<AlephGraph GT, class Write_Node , class Write_Arc , class Shade_Node , class Shade_Arc > | |
| void | generate_net_graph (GT &g, const size_t &nodes_by_level, const double &xdist, const double &ydist, std::ostream &out) |
| template<AlephGraph GT, class Write_Node , class Write_Arc , ArcFilter< GT > SA> | |
| void | generate_cross_graph (GT &g, const size_t &nodes_by_level, const double &xdist, const double &ydist, std::ostream &out, SA sa=SA()) |
| template<AlephGraph GT, class Write_Node , class Write_Arc , ArcFilter< GT > SA> | |
| void | generate_net_graph (GT &g, const size_t &nodes_by_level, const double &xdist, const double &ydist, std::ostream &out, SA sa=SA()) |
| template<AlephGraph GT, class Write_Node , class Write_Arc > | |
| void | generate_cross_graph (GT &g, const size_t &nodes_by_level, const double &xdist, const double &ydist, std::ostream &out) |
| template<AlephGraph GT, class Write_Node , class Write_Arc > | |
| void | generate_net_graph (GT &g, const size_t &nodes_by_level, const double &xdist, const double &ydist, std::ostream &out) |
| std::string | escape_dot_label (const std::string &text) |
| template<typename Node , class Write > | |
| static void | __generate_tree (Node *node, int deway[], const size_t ¤t_level, const size_t &size, std::ostream &output) |
| template<typename Node , class Write = Dft_Write<Node>> | |
| void | generate_tree (Node *root, std::ostream &out, const int &tree_number=0) |
| Generate a tree specification for the ntreepic drawing tool. | |
| template<typename Node , class Write = Dft_Write<Node>> | |
| void | generate_forest (Node *root, std::ostream &out) |
| Generate a forest specification for the ntreepic drawing tool. | |
| template<typename Node , class Write > | |
| void | generate_btree (Node *root, std::ostream &out) |
| Generate a binary tree specification for the btreepic drawing tool. | |
| template<typename Node , class Write = Dft_Write<Node>> | |
| void | generate_tree_graphviz (Node *root, std::ostream &out) |
| Generate a Graphviz DOT specification for a tree. | |
| SegmentSegmentIntersection::Result | segment_segment_intersection (const Segment &s1, const Segment &s2) |
| Convenience free-function wrapper for SegmentSegmentIntersection. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| size_t | greedy_coloring (const GT &g, DynMapTree< typename GT::Node *, size_t > &colors, SA sa=SA()) |
| Greedy graph coloring in iteration order. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| size_t | welsh_powell_coloring (const GT &g, DynMapTree< typename GT::Node *, size_t > &colors, SA sa=SA()) |
| Welsh-Powell graph coloring. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| size_t | dsatur_coloring (const GT &g, DynMapTree< typename GT::Node *, size_t > &colors, SA sa=SA()) |
| DSatur graph coloring (saturation-degree heuristic). | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| bool | is_valid_coloring (const GT &g, const DynMapTree< typename GT::Node *, size_t > &colors, SA sa=SA()) |
| Validates a graph coloring. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| size_t | chromatic_number (const GT &g, DynMapTree< typename GT::Node *, size_t > &colors, SA sa=SA()) |
| Computes the exact chromatic number of a small graph. | |
| template<AlephGraph GT, typename Key , typename Convert , ArcFilter< GT > SA> | |
| static void | __graph_to_tree_node (GT &g, typename GT::Node *groot, Tree_Node< Key > *troot, const SA &sa) |
| template<AlephGraph GT, typename Key , class Convert , ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| Tree_Node< Key > * | graph_to_tree_node (GT &g, typename GT::Node *groot, SA sa=SA()) |
| Convert a tree graph to a Tree_Node structure. | |
| static uint32_t | rotl32 (uint32_t x, int8_t r) |
| static uint64_t | rotl64 (uint64_t x, int8_t r) |
| static uint32_t | fmix32 (uint32_t h) |
| static uint64_t | fmix64 (uint64_t k) |
| static size_t | fold_hash64_to_size_t (std::uint64_t hash) noexcept |
| static std::uint32_t | read_le32 (const std::uint8_t *p) noexcept |
| static std::uint64_t | read_le64 (const std::uint8_t *p) noexcept |
| static void | write_le32 (std::uint8_t *p, std::uint32_t value) noexcept |
| static void | write_le64 (std::uint8_t *p, std::uint64_t value) noexcept |
| static std::uint64_t | mul_xor_fold64 (std::uint64_t lhs, std::uint64_t rhs) noexcept |
| static std::uint64_t | xxh64_round (std::uint64_t acc, std::uint64_t input) noexcept |
| static std::uint64_t | xxh64_merge_round (std::uint64_t acc, std::uint64_t value) noexcept |
| static std::uint64_t | wyhash_mix (std::uint64_t lhs, std::uint64_t rhs) noexcept |
| static void | jsw_fill_table (std::uint32_t seed) noexcept |
| bool | is_jsw_initialized () noexcept |
| Checks if the jsw_hash() lookup table has been initialized. | |
| void | init_jsw () noexcept |
| Initializes the randomized lookup table used by jsw_hash(). | |
| void | init_jsw (std::uint32_t seed) noexcept |
| Initializes the randomized lookup table used by jsw_hash(). | |
| size_t | jsw_hash (const void *key, size_t len) noexcept |
| JSW hash (Julienne Walker) | |
| size_t | jsw_hash (const char *key) noexcept |
| Compute a 32-bit JSW hash for a null-terminated string. | |
| size_t | jen_hash (const void *key, size_t len, unsigned initval) noexcept |
| Jenkins hash (lookup3) | |
| void | MurmurHash3_x86_32 (const void *key, int len, uint32_t seed, void *out) |
| void | MurmurHash3_x86_128 (const void *key, const int len, uint32_t seed, void *out) |
| void | MurmurHash3_x64_128 (const void *key, const int len, const uint32_t seed, void *out) |
| size_t | xxhash64_hash (const void *key, size_t len, std::uint64_t seed=Default_Hash_Seed) noexcept |
| xxHash64 from the xxHash family. | |
| size_t | wyhash_hash (const void *key, size_t len, std::uint64_t seed=Default_Hash_Seed) noexcept |
| wyhash non-cryptographic hash. | |
| size_t | siphash24_hash (const void *key, size_t len, std::uint64_t key0=0x0706050403020100ULL, std::uint64_t key1=0x0f0e0d0c0b0a0908ULL) noexcept |
| SipHash-2-4 keyed hash. | |
| size_t | add_hash (const void *key, const size_t len) noexcept |
| Additive hash. | |
| size_t | xor_hash (const void *key, const size_t len) noexcept |
| XOR hash. | |
| size_t | rot_hash (const void *key, const size_t len) noexcept |
| Rotating hash. | |
| size_t | djb_hash (const void *key, const size_t len) noexcept |
| Bernstein's hash (DJB hash) | |
| size_t | sax_hash (const void *key, const size_t len) noexcept |
| Shift-Add-XOR hash (SAX hash) | |
| size_t | fnv_hash (const void *key, const size_t len) noexcept |
| FNV-1a hash. | |
| size_t | oat_hash (const void *key, const size_t len) noexcept |
| One-at-a-Time hash (OAT hash) | |
| size_t | elf_hash (const void *key, const size_t len) noexcept |
| ELF hash. | |
| template<typename Key > requires std::is_trivially_copyable_v<Key> | |
| size_t | murmur3hash (const Key &key, std::uint32_t seed) |
| size_t | murmur3hash (const char *key, const std::uint32_t seed) |
| size_t | murmur3hash (const std::string &key, const std::uint32_t seed) |
| std::uint16_t | get16bits (const void *p) noexcept |
| size_t | SuperFastHash (const void *key, const size_t len, std::uint32_t seed=0) noexcept |
| Paul Hsieh super fast hash function. | |
| template<typename Key > requires std::is_trivially_copyable_v<Key> | |
| size_t | add_hash (const Key &key) noexcept |
| template<typename Key > requires std::is_trivially_copyable_v<Key> | |
| size_t | xor_hash (const Key &key) noexcept |
| template<typename Key > requires std::is_trivially_copyable_v<Key> | |
| size_t | rot_hash (const Key &key) noexcept |
| template<typename Key > requires std::is_trivially_copyable_v<Key> | |
| size_t | djb_hash (const Key &key) noexcept |
| template<typename Key > requires std::is_trivially_copyable_v<Key> | |
| size_t | sax_hash (const Key &key) noexcept |
| template<typename Key > requires std::is_trivially_copyable_v<Key> | |
| size_t | fnv_hash (const Key &key) noexcept |
| template<typename Key > requires std::is_trivially_copyable_v<Key> | |
| size_t | oat_hash (const Key &key) noexcept |
| template<typename Key > requires std::is_trivially_copyable_v<Key> | |
| size_t | jsw_hash (const Key &key) noexcept |
| JSW hash for arbitrary key types. | |
| template<typename Key > requires std::is_trivially_copyable_v<Key> | |
| size_t | elf_hash (const Key &key) noexcept |
| template<typename Key > requires std::is_trivially_copyable_v<Key> | |
| size_t | jen_hash (const Key &key, const unsigned initval) noexcept |
| template<typename Key > requires (std::is_trivially_copyable_v<Key> and (not std::is_pointer_v<Key>) and (not std::is_array_v<Key>)) | |
| size_t | SuperFastHash (const Key &key, std::uint32_t seed=0) noexcept |
| template<typename Key > requires std::is_trivially_copyable_v<Key> | |
| size_t | xxhash64_hash (const Key &key, std::uint64_t seed=Default_Hash_Seed) noexcept |
| template<typename Key > requires std::is_trivially_copyable_v<Key> | |
| size_t | wyhash_hash (const Key &key, std::uint64_t seed=Default_Hash_Seed) noexcept |
| template<typename Key > requires std::is_trivially_copyable_v<Key> | |
| size_t | siphash24_hash (const Key &key, std::uint64_t key0=0x0706050403020100ULL, std::uint64_t key1=0x0f0e0d0c0b0a0908ULL) noexcept |
| size_t | add_hash (const char *key) noexcept |
| size_t | xor_hash (const char *key) noexcept |
| size_t | rot_hash (const char *key) noexcept |
| size_t | djb_hash (const char *key) noexcept |
| size_t | sax_hash (const char *key) noexcept |
| size_t | fnv_hash (const char *key) noexcept |
| size_t | oat_hash (const char *key) noexcept |
| size_t | elf_hash (const char *key) noexcept |
| size_t | SuperFastHash (const char *key, std::uint32_t seed=0) noexcept |
| size_t | xxhash64_hash (const char *key, std::uint64_t seed=Default_Hash_Seed) noexcept |
| size_t | wyhash_hash (const char *key, std::uint64_t seed=Default_Hash_Seed) noexcept |
| size_t | siphash24_hash (const char *key, std::uint64_t key0=0x0706050403020100ULL, std::uint64_t key1=0x0f0e0d0c0b0a0908ULL) noexcept |
| size_t | add_hash (const std::string &key) noexcept |
| size_t | xor_hash (const std::string &key) noexcept |
| size_t | rot_hash (const std::string &key) noexcept |
| size_t | djb_hash (const std::string &key) noexcept |
| size_t | sax_hash (const std::string &key) noexcept |
| size_t | fnv_hash (const std::string &key) noexcept |
| size_t | oat_hash (const std::string &key) noexcept |
| size_t | jsw_hash (const std::string &key) noexcept |
| JSW hash for std::string. | |
| size_t | elf_hash (const std::string &key) noexcept |
| size_t | jen_hash (const std::string &key, unsigned initval) noexcept |
| size_t | SuperFastHash (const std::string &key, std::uint32_t seed=0) noexcept |
| size_t | xxhash64_hash (const std::string &key, std::uint64_t seed=Default_Hash_Seed) noexcept |
| size_t | wyhash_hash (const std::string &key, std::uint64_t seed=Default_Hash_Seed) noexcept |
| size_t | siphash24_hash (const std::string &key, std::uint64_t key0=0x0706050403020100ULL, std::uint64_t key1=0x0f0e0d0c0b0a0908ULL) noexcept |
| void | hash_combine (size_t &seed, size_t h) noexcept |
| Non-commutative hash combiner (Boost-style golden-ratio mix). | |
| template<typename Key > requires (not std::is_pointer_v<Key> and not std::is_array_v<Key> and not std::is_same_v<std::remove_cvref_t<Key>, std::string>) | |
| size_t | dft_hash_fct (const Key &key) noexcept |
| Primary default hash: best speed/quality trade-off. | |
| template<typename Key > requires std::is_pointer_v<Key> | |
| size_t | dft_hash_fct (const Key &key) noexcept |
| size_t | dft_hash_fct (const char *key) noexcept |
| size_t | dft_hash_fct (const std::string &key) noexcept |
| template<typename Key > requires (not std::is_pointer_v<Key> and not std::is_array_v<Key> and not std::is_same_v<std::remove_cvref_t<Key>, std::string>) | |
| size_t | dft_hash_fct (const Key &key, std::uint32_t seed) noexcept |
| Primary default hash with explicit seed. | |
| template<typename Key > requires std::is_pointer_v<Key> | |
| size_t | dft_hash_fct (const Key &key, std::uint32_t seed) noexcept |
| size_t | dft_hash_fct (const char *key, std::uint32_t seed) noexcept |
| size_t | dft_hash_fct (const std::string &key, std::uint32_t seed) noexcept |
| template<typename Key > | |
| size_t | dft_hash_ptr_fct (const Key &key) noexcept |
| template<typename Key > | |
| size_t | dft_seed_hash_ptr_fct (const Key &key, const unsigned long seed) noexcept |
| template<typename Key > requires (not std::is_pointer_v<Key> and not std::is_array_v<Key> and not std::is_same_v<std::remove_cvref_t<Key>, std::string>) | |
| size_t | snd_hash_fct (const Key &key) noexcept |
Secondary default hash: different distribution from dft_hash_fct. | |
| template<typename Key > requires std::is_pointer_v<Key> | |
| size_t | snd_hash_fct (const Key &key) noexcept |
| size_t | snd_hash_fct (const char *key) noexcept |
| size_t | snd_hash_fct (const std::string &key) noexcept |
| template<typename Key > | |
| size_t | snd_hash_ptr_fct (const Key &key) noexcept |
| template<typename Key , typename Data , typename Fct > | |
| size_t | map_hash_fct (Fct fct, const std::pair< Key, Data > &p) noexcept |
| template<typename K1 , typename K2 > requires requires(const K1 & k1, const K2 & k2) { dft_hash_fct(k1); dft_hash_fct(k2); } | |
| size_t | pair_dft_hash_fct (const std::pair< K1, K2 > &p) noexcept |
| template<typename K1 , typename K2 > requires requires(const K1 & k1, const K2 & k2) { dft_hash_fct(k1); snd_hash_fct(k2); } | |
| size_t | pair_snd_hash_fct (const std::pair< K1, K2 > &p) noexcept |
| template<typename K1 , typename K2 > | |
| size_t | pair_dft_hash_ptr_fct (const std::pair< K1, K2 > &p) noexcept |
| template<typename K1 , typename K2 > | |
| size_t | pair_snd_hash_ptr_fct (const std::pair< K1, K2 > &p) noexcept |
| template<AlephGraph GT, ArcDistance< GT > Distance = Dft_Dist<GT>, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| Howard_Mean_Cycle_Result< GT, typename Distance::Distance_Type > | howard_minimum_mean_cycle (const GT &g, Distance distance=Distance(), SA sa=SA(), const size_t max_fallback_bytes=std::numeric_limits< size_t >::max()) |
| Minimum mean cycle by Howard's policy iteration. | |
| template<AlephGraph GT, ArcDistance< GT > Distance = Dft_Dist<GT>, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| Min_Mean_Cycle_Value_Result | howard_minimum_mean_cycle_value (const GT &g, Distance distance=Distance(), SA sa=SA(), const size_t max_fallback_bytes=std::numeric_limits< size_t >::max()) |
| Minimum mean cycle value by Howard's policy iteration, without the witness. | |
| template<class Container > | |
| DynList< typename Container::Item_Type > | to_dynlist (const Container &c) |
| template<typename T > | |
| DynList< T > | get_unitarian_DynList (const T &item) |
| template<typename T > | |
| DynList< T > | unitarian_DynList (const T &item) |
| static const size_t & | get_freq (Huffman_Node *huffman_node) noexcept |
| static void | increase_freq (Huffman_Node *huffman_node) noexcept |
| static void | set_freq (Huffman_Node *huffman_node, const size_t &freq) noexcept |
| static bool | is_leaf (BinNode< std::string > *p) noexcept |
| template<typename Cost_Type > | |
| Hungarian_Result< Cost_Type > | hungarian_assignment (const DynMatrix< Cost_Type > &cost) |
| Compute minimum-cost assignment (free function). | |
| template<typename Cost_Type > | |
| Hungarian_Result< Cost_Type > | hungarian_max_assignment (const DynMatrix< Cost_Type > &cost) |
| Compute maximum-profit assignment (free function). | |
| const char * | interpreter_value_kind_name (const Interpreter_Value_Kind kind) noexcept |
| Stable debug name for one runtime value kind. | |
| const char * | interpreter_control_flow_name (const Interpreter_Control_Flow_Kind kind) noexcept |
| Stable debug name for one control-flow outcome. | |
| bool | interpreter_values_equal (const Interpreter_Value &lhs, const Interpreter_Value &rhs) |
| Returns whether two runtime values compare equal. | |
| std::string | interpreter_value_to_string (const Interpreter_Value &value) |
| Formats one runtime value deterministically for dumps and tests. | |
| std::string | interpreter_dump_environment (const Interpreter_Environment &env) |
| Dumps one environment deterministically. | |
| std::string | interpreter_dump_globals (const Interpreter_Runtime &runtime) |
| Dumps the globals currently installed in one runtime. | |
| template<AlephGraph GT, ArcDistance< GT > Distance = Dft_Dist<GT>, ArcFilter< GT > SA = Dft_Show_Arc<GT>> requires std::is_arithmetic_v<typename Distance::Distance_Type> | |
| DynList< K_Shortest_Path_Item< GT, typename Distance::Distance_Type > > | yen_k_shortest_paths (const GT &g, typename GT::Node *source, typename GT::Node *target, const size_t k, Distance distance=Distance(), SA sa=SA()) |
| Compute k shortest loopless paths using Yen's algorithm. | |
| template<AlephGraph GT, ArcDistance< GT > Distance = Dft_Dist<GT>, ArcFilter< GT > SA = Dft_Show_Arc<GT>> requires std::is_arithmetic_v<typename Distance::Distance_Type> | |
| DynList< K_Shortest_Path_Item< GT, typename Distance::Distance_Type > > | eppstein_k_shortest_paths (const GT &g, typename GT::Node *source, typename GT::Node *target, const size_t k, Distance distance=Distance(), SA sa=SA()) |
| Compute k shortest general (loopy) paths. | |
| template<typename V , std::integral W> | |
| Knapsack_Result< V > | knapsack_01 (const Array< Knapsack_Item< W, V > > &items, W capacity) |
| Solve the 0/1 Knapsack problem with item reconstruction. | |
| template<typename V , std::integral W> | |
| V | knapsack_01_value (const Array< Knapsack_Item< W, V > > &items, W capacity) |
| Solve the 0/1 Knapsack problem (value only, space-optimized). | |
| template<typename V , std::integral W> | |
| Knapsack_Result< V > | knapsack_unbounded (const Array< Knapsack_Item< W, V > > &items, W capacity) |
| Solve the Unbounded Knapsack problem with reconstruction. | |
| template<typename V , std::integral W> | |
| Knapsack_Result< V > | knapsack_bounded (const Array< Knapsack_Item< W, V > > &items, const Array< size_t > &counts, W capacity) |
| Solve the Bounded Knapsack problem with reconstruction. | |
| template<AlephGraph GT> | |
| static void | __dfp_phase1 (const GT &g, typename GT::Node *p, DynArray< typename GT::Node * > &df) |
| template<AlephGraph GT> | |
| static void | __dfp_phase2_subgraph (const GT &g, typename GT::Node *p, GT &blk, const int &color) |
| DFS on transposed graph that builds an SCC subgraph (Phase 2). | |
| template<AlephGraph GT> | |
| static void | __dfp_phase2_list (const GT &g, typename GT::Node *p, DynList< typename GT::Node * > &list) |
| DFS on transposed graph that builds an SCC node list (Phase 2). | |
| template<AlephGraph GT> | |
| void | kosaraju_connected_components (const GT &g, DynList< GT > &blk_list, DynList< typename GT::Arc * > &arc_list) |
| Compute strongly connected components using Kosaraju's algorithm. | |
| template<AlephGraph GT> | |
| DynList< DynList< typename GT::Node * > > | kosaraju_connected_components (const GT &g) |
| Compute strongly connected components as lists of nodes. | |
| template<AlephGraph GT> | |
| size_t | kosaraju_scc_count (const GT &g) |
| Count the number of strongly connected components. | |
| template<AlephGraph GT> | |
| bool | is_strongly_connected (const GT &g) |
| Check if a directed graph is strongly connected. | |
| template<AlephGraph GT, class Compare , class Plus > | |
| void | floyd_all_shortest_paths (GT &g, Ady_Mat< GT, typename GT::Arc_Type::Distance_Type > &dist, Ady_Mat< GT, long > &path) |
| Compute all-pairs shortest paths using Floyd-Warshall algorithm. | |
| template<AlephGraph GT> | |
| void | floyd_all_shortest_paths (GT &g, Ady_Mat< GT, typename GT::Arc_Type::Distance_Type > &dist, Ady_Mat< GT, long > &path) |
| Overload using default comparison (less) and addition (plus). | |
| template<AlephGraph GT, class Compare , class Plus , template< class > class P_i, template< class > class P_ij, template< class > class D_ij> | |
| void | floyd_all_shortest_paths_latex (GT &g, Ady_Mat< GT, typename GT::Arc_Type::Distance_Type > &dist, Ady_Mat< GT, long > &path, std::ofstream &output) |
| Floyd-Warshall algorithm with LaTeX step-by-step output. | |
| template<AlephGraph GT, template< class > class P_i, template< class > class P_ij, template< class > class D_ij> | |
| void | floyd_all_shortest_paths_latex (GT &g, Ady_Mat< GT, typename GT::Arc_Type::Distance_Type > &dist, Ady_Mat< GT, long > &path, std::ofstream &output) |
| Overload using default comparison (less) and addition (plus). | |
| template<typename T , class Compare = Aleph::less<T>> | |
| LIS_Result< T > | longest_increasing_subsequence (const Array< T > &seq, Compare cmp=Compare()) |
| Compute the Longest Increasing Subsequence (strictly increasing). | |
| template<typename T , class Compare = Aleph::less<T>> | |
| size_t | lis_length (const Array< T > &seq, Compare cmp=Compare()) |
| Compute only the length of the LIS (no reconstruction). | |
| template<typename T , class Compare = Aleph::less<T>> | |
| LIS_Result< T > | longest_nondecreasing_subsequence (const Array< T > &seq, Compare cmp=Compare()) |
| Compute the Longest Non-Decreasing Subsequence. | |
| void | split (const std::string &text, const std::string &separators, DynDlist< std::string > &words) |
| Split a text into tokens using a separator set. | |
| Digrafo::Node * | search_node (Digrafo &g, const std::string &s) |
| Find or create a node by ID. | |
| void | load_digraph (Digrafo &g, std::istream &nodes_input, std::istream &arcs_input) |
| Load nodes and arcs from streams into the directed graph. | |
| void | generate_dot_file (Digrafo &g, std::ostream &output) |
| Generate a DOT representation of the digraph. | |
| template<typename Mat , class RowIndexFormatter , class ColIndexFormatter , class EntryFormatter > | |
| void | mat_to_latex (Mat &mat, long n, long m, std::ostream &out, const std::string &prefix="", const std::string &suffix="") |
| Generate LaTeX tabular representation of a matrix. | |
| template<typename Mat , class RowIndexFormatter , class ColIndexFormatter , class EntryFormatter > | |
| void | mat_to_latex (Mat &mat, long n, long m, std::ofstream &out, const std::string &prefix="", const std::string &suffix="") |
| Overload for std::ofstream output. | |
| template<typename Mat > | |
| void | mat_to_latex_simple (Mat &mat, long n, long m, std::ostream &out, const std::string &prefix="", const std::string &suffix="") |
| Generate LaTeX table with default formatters. | |
| template<class Mat , class Compare = std::less<>> | |
| void | find_min_path (Mat &p, long src_idx, long tgt_idx, Path< typename Mat::Graph_Type > &path) |
| Build a minimum path from Floyd-Warshall path matrix using indices. | |
| template<class Mat , class Compare = std::less<>> | |
| void | find_min_path (Mat &p, typename Mat::Node *src_node, typename Mat::Node *tgt_node, Path< typename Mat::Graph_Type > &path) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Build a minimum path using node pointers instead of indices. | |
| Matrix_Chain_Result | matrix_chain_order (const Array< size_t > &dims) |
| Compute the optimal matrix-chain multiplication order. | |
| size_t | matrix_chain_min_cost (const Array< size_t > &dims) |
| Compute only the minimum multiplication cost (value only). | |
| template<AlephGraph GT, class Cost = Dft_Dist<GT>, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| Min_Cost_Matching_Result< long long > | compute_minimum_cost_general_matching (const GT &g, DynDlist< typename GT::Arc * > &matching, Cost cost=Cost(), SA sa=SA(), const bool max_cardinality=false) |
| Compute minimum-cost matching in a general undirected graph. | |
| template<AlephGraph GT, class Cost = Dft_Dist<GT>, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| Min_Cost_Matching_Result< long long > | blossom_minimum_cost_matching (const GT &g, DynDlist< typename GT::Arc * > &matching, Cost cost=Cost(), SA sa=SA(), const bool max_cardinality=false) |
| Alias for compute_minimum_cost_general_matching(). | |
| template<AlephGraph GT, class Cost = Dft_Dist<GT>, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| Min_Cost_Perfect_Matching_Result< long long > | compute_minimum_cost_perfect_general_matching (const GT &g, DynDlist< typename GT::Arc * > &matching, Cost cost=Cost(), SA sa=SA()) |
| Compute minimum-cost perfect matching in a general undirected graph. | |
| template<AlephGraph GT, class Cost = Dft_Dist<GT>, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| Min_Cost_Perfect_Matching_Result< long long > | blossom_minimum_cost_perfect_matching (const GT &g, DynDlist< typename GT::Arc * > &matching, Cost cost=Cost(), SA sa=SA()) |
| Alias for compute_minimum_cost_perfect_general_matching(). | |
| template<AlephGraph GT, ArcDistance< GT > Distance = Dft_Dist<GT>, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| Min_Mean_Cycle_Result< GT, typename Distance::Distance_Type > | karp_minimum_mean_cycle (const GT &g, Distance distance=Distance(), SA sa=SA()) |
| Compute minimum mean cycle by Karp's algorithm. | |
| template<AlephGraph GT, ArcDistance< GT > Distance = Dft_Dist<GT>, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| Min_Mean_Cycle_Value_Result | karp_minimum_mean_cycle_value (const GT &g, Distance distance=Distance(), SA sa=SA()) |
| Compute only the minimum mean value (without witness walk). | |
| template<AlephGraph GT, ArcDistance< GT > Distance = Dft_Dist<GT>, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| Min_Mean_Cycle_Value_Result | minimum_mean_cycle_value (const GT &g, Distance distance=Distance(), SA sa=SA()) |
Alias for karp_minimum_mean_cycle_value(). | |
| template<AlephGraph GT, ArcDistance< GT > Distance = Dft_Dist<GT>, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| Min_Mean_Cycle_Result< GT, typename Distance::Distance_Type > | minimum_mean_cycle (const GT &g, Distance distance=Distance(), SA sa=SA()) |
Alias for karp_minimum_mean_cycle(). | |
| uint64_t | mod_mul (uint64_t a, uint64_t b, uint64_t m) |
| Safe 64-bit modular multiplication. | |
| uint64_t | mod_exp (uint64_t base, uint64_t exp, const uint64_t m) |
| Modular exponentiation. | |
| template<typename T > requires (std::is_integral_v<T> and std::is_signed_v<T>) | |
| T | ext_gcd (T a, T b, T &x, T &y) noexcept |
| Extended Euclidean Algorithm. | |
| uint64_t | mod_inv (const uint64_t a, const uint64_t m) |
| Modular Inverse. | |
| uint64_t | crt (const Array< uint64_t > &rem, const Array< uint64_t > &mod) |
| Chinese Remainder Theorem (CRT). | |
| template<DenseMatrix MatrixT> | |
| constexpr std::pair< size_t, size_t > | matrix_dims (const MatrixT &m) noexcept |
| Get dimensions of a matrix (dense or sparse). | |
| template<typename StateKey > | |
| size_t | aleph_hash_value (const AdversarialTranspositionKey< StateKey > &key) noexcept |
| template<AdversarialGameDomain Domain> | |
| auto | negamax_search (Domain domain, typename Domain::State initial_state, ExplorationPolicy policy=Negamax< Domain >::default_policy(), SearchLimits limits={}) |
| Convenience wrapper for one-shot Negamax search. | |
| template<AdversarialGameDomain Domain, typename Tracer > requires AdversarialSearchTracer<Tracer, typename Domain::Move, typename Domain::Score> | |
| auto | negamax_search (Domain domain, typename Domain::State initial_state, Tracer &tracer, ExplorationPolicy policy=Negamax< Domain >::default_policy(), SearchLimits limits={}) |
| Convenience wrapper for one-shot Negamax search with tracing. | |
| template<AdversarialGameDomain Domain, typename Table , typename Keyer > requires AdversarialSearchKeyer<Table, Keyer, typename Domain::State, typename Domain::Move, typename Domain::Score> | |
| auto | negamax_search (Domain domain, typename Domain::State initial_state, Table &table, Keyer keyer, ExplorationPolicy policy=Negamax< Domain >::default_policy(), SearchLimits limits={}) |
| Convenience wrapper for Negamax search with transposition table. | |
| template<AdversarialGameDomain Domain, typename Table , typename Keyer , typename Tracer > requires AdversarialSearchKeyer<Table, Keyer, typename Domain::State, typename Domain::Move, typename Domain::Score> | |
| and AdversarialSearchTracer< Tracer, typename Domain::Move, typename Domain::Score > auto | negamax_search (Domain domain, typename Domain::State initial_state, Table &table, Keyer keyer, Tracer &tracer, ExplorationPolicy policy=Negamax< Domain >::default_policy(), SearchLimits limits={}) |
| Convenience wrapper for Negamax search with TT/keyer and tracing. | |
| template<AdversarialGameDomain Domain, typename Table > requires SearchStateKeyProvider<Domain> | |
| and AdversarialTranspositionMemo< Table, typename Domain::State_Key, typename Domain::Move, typename Domain::Score > auto | negamax_search (Domain domain, typename Domain::State initial_state, Table &table, ExplorationPolicy policy=Negamax< Domain >::default_policy(), SearchLimits limits={}) |
| Convenience wrapper for Negamax search with domain-provided state key. | |
| template<AdversarialGameDomain Domain, typename Table , typename Tracer > requires SearchStateKeyProvider<Domain> | |
| and AdversarialTranspositionMemo< Table, typename Domain::State_Key, typename Domain::Move, typename Domain::Score > and AdversarialSearchTracer< Tracer, typename Domain::Move, typename Domain::Score > auto | negamax_search (Domain domain, typename Domain::State initial_state, Table &table, Tracer &tracer, ExplorationPolicy policy=Negamax< Domain >::default_policy(), SearchLimits limits={}) |
| Convenience wrapper for Negamax search with domain-provided key and tracing. | |
| template<AdversarialGameDomain Domain> | |
| auto | iterative_deepening_negamax_search (Domain domain, typename Domain::State initial_state, ExplorationPolicy policy=Negamax< Domain >::default_policy(), SearchLimits limits={}, AdversarialIterativeDeepeningOptions< typename Domain::Score > options={}) |
| Iterative deepening over Negamax without transposition table. | |
| template<AdversarialGameDomain Domain, typename Tracer > requires AdversarialSearchTracer<Tracer, typename Domain::Move, typename Domain::Score> | |
| auto | iterative_deepening_negamax_search (Domain domain, typename Domain::State initial_state, Tracer &tracer, ExplorationPolicy policy=Negamax< Domain >::default_policy(), SearchLimits limits={}, AdversarialIterativeDeepeningOptions< typename Domain::Score > options={}) |
| Iterative deepening over Negamax with tracing. | |
| template<AdversarialGameDomain Domain, typename Table , typename Keyer > requires AdversarialSearchKeyer<Table, Keyer, typename Domain::State, typename Domain::Move, typename Domain::Score> | |
| auto | iterative_deepening_negamax_search (Domain domain, typename Domain::State initial_state, Table &table, Keyer keyer, ExplorationPolicy policy=Negamax< Domain >::default_policy(), SearchLimits limits={}, AdversarialIterativeDeepeningOptions< typename Domain::Score > options={}) |
| Iterative deepening over Negamax with TT/keyer reuse across iterations. | |
| template<AdversarialGameDomain Domain, typename Table , typename Keyer , typename Tracer > requires AdversarialSearchKeyer<Table, Keyer, typename Domain::State, typename Domain::Move, typename Domain::Score> | |
| and AdversarialSearchTracer< Tracer, typename Domain::Move, typename Domain::Score > auto | iterative_deepening_negamax_search (Domain domain, typename Domain::State initial_state, Table &table, Keyer keyer, Tracer &tracer, ExplorationPolicy policy=Negamax< Domain >::default_policy(), SearchLimits limits={}, AdversarialIterativeDeepeningOptions< typename Domain::Score > options={}) |
| Iterative deepening over Negamax with TT/keyer reuse and tracing. | |
| template<AdversarialGameDomain Domain, typename Table > requires SearchStateKeyProvider<Domain> | |
| and AdversarialTranspositionMemo< Table, typename Domain::State_Key, typename Domain::Move, typename Domain::Score > auto | iterative_deepening_negamax_search (Domain domain, typename Domain::State initial_state, Table &table, ExplorationPolicy policy=Negamax< Domain >::default_policy(), SearchLimits limits={}, AdversarialIterativeDeepeningOptions< typename Domain::Score > options={}) |
Iterative deepening over Negamax using domain.state_key(). | |
| template<AdversarialGameDomain Domain, typename Table , typename Tracer > requires SearchStateKeyProvider<Domain> | |
| and AdversarialTranspositionMemo< Table, typename Domain::State_Key, typename Domain::Move, typename Domain::Score > and AdversarialSearchTracer< Tracer, typename Domain::Move, typename Domain::Score > auto | iterative_deepening_negamax_search (Domain domain, typename Domain::State initial_state, Table &table, Tracer &tracer, ExplorationPolicy policy=Negamax< Domain >::default_policy(), SearchLimits limits={}, AdversarialIterativeDeepeningOptions< typename Domain::Score > options={}) |
Iterative deepening over Negamax using domain.state_key() and tracing. | |
| template<AlephGraph GT, ArcDistance< GT > Distance = Dft_Dist<GT>, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| DynList< Negative_Cycle_Item< GT, typename Distance::Distance_Type > > | find_disjoint_negative_cycles (const GT &g, const size_t max_cycles, const Negative_Cycle_Exclusion exclusion=Negative_Cycle_Exclusion::Min_Weight_Arc, Distance distance=Distance(), SA sa=SA()) |
Find up to max_cycles negative cycles, excluding arcs of each cycle found before searching for the next one. | |
| template<AlephGraph GT, ArcDistance< GT > Distance = Dft_Dist<GT>, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| Bounded_Cycle_Result< GT, typename Distance::Distance_Type > | most_negative_cycle_bounded (const GT &g, const size_t max_length, Distance distance=Distance(), SA sa=SA()) |
Most negative simple cycle of at most max_length arcs, ranked by total cost (not by mean cost as Karp's algorithm does). | |
| template<AlephGraph GT, ArcDistance< GT > Distance = Dft_Dist<GT>, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| Short_Cycle_Result< GT, typename Distance::Distance_Type > | most_negative_cycle_up_to_3 (const GT &g, const size_t max_length=3, Distance distance=Distance(), SA sa=SA()) |
| Minimum-total-cost simple cycle with at most one, two or three arcs. | |
| template<class Net , class GetDemand , class GetLower , template< class > class Maxflow = Dinic_Maximum_Flow> | |
| CirculationResult< typename Net::Flow_Type > | solve_circulation (Net &net, GetDemand get_demand, GetLower get_lower) |
| Solve a circulation problem with demands. | |
| template<typename Value_Type > | |
| ProjectSelectionResult< Value_Type > | solve_project_selection (const std::vector< Project< Value_Type > > &projects) |
| Solve project selection problem using max-flow. | |
| BaseballEliminationResult | check_baseball_elimination (const std::vector< Team > &teams, size_t team_idx) |
| Check if a team is mathematically eliminated from winning. | |
| template<typename Value_Type > | |
| SegmentationResult | segment_image (size_t rows, size_t cols, const std::vector< std::vector< std::array< Value_Type, 2 > > > &data_cost, Value_Type smoothness) |
| Segment image using graph cuts. | |
| SurveyDesignResult | design_survey (const std::vector< SurveyQuestion > &questions, const std::vector< SurveyRespondent > &respondents) |
| Design survey assignment using network flow. | |
| template<class Net > | |
| Net | generate_random_network (const NetworkGenParams ¶ms) |
| Generate a random flow network. | |
| template<class Net > | |
| Net | generate_random_network (size_t num_nodes, size_t num_arcs, double min_cap=1.0, double max_cap=100.0, unsigned seed=0) |
| Generate a random flow network (convenience overload). | |
| template<class Net > | |
| Net | generate_grid_network (size_t rows, size_t cols, typename Net::Flow_Type capacity, bool bidirectional=true) |
| Generate a grid network. | |
| template<class Net > | |
| Net | generate_bipartite_network (size_t left_size, size_t right_size, double edge_prob=0.5, unsigned seed=0) |
| Generate a bipartite network for matching. | |
| template<class Net > | |
| Net | generate_layered_network (const std::vector< size_t > &layer_sizes, typename Net::Flow_Type capacity, double edge_prob=0.5, unsigned seed=0) |
| Generate a layered network. | |
| template<class Net > | |
| void | export_network_to_dot (const Net &net, const std::string &filename, const DotExportOptions &options=DotExportOptions()) |
| Export network to DOT format for GraphViz visualization. | |
| template<class Net > | |
| std::string | network_to_dot_string (const Net &net, const DotExportOptions &options=DotExportOptions()) |
| Generate DOT string for network (instead of file). | |
| template<class Net > | |
| void | export_network_to_json (const Net &net, const std::string &filename) |
| Export network to JSON format. | |
| template<class Net > | |
| std::string | network_to_json_string (const Net &net) |
| Export network to JSON string. | |
| template<class Net > | |
| void | export_network_to_dimacs (const Net &net, const std::string &filename) |
| Export network to DIMACS max-flow format. | |
| template<class Net > | |
| Net | import_network_from_dimacs (const std::string &filename) |
| Import network from DIMACS max-flow format. | |
| template<class Net , class Algo > | |
| MaxFlowBenchmarkResult< typename Net::Flow_Type > | benchmark_maxflow (Net &net, Algo algo, const std::string &name) |
| Run and time a max-flow algorithm. | |
| template<typename Flow_Type > | |
| void | print_benchmark_results (const std::vector< MaxFlowBenchmarkResult< Flow_Type > > &results) |
| Print benchmark results. | |
| static void | compute_optimal_costs (DynArray< double > &cost, double p[], const size_t n, DynArray< int > &tree) |
| Compute optimal costs and tree structure using dynamic programming. | |
| template<class Node , typename Key > | |
| static Node * | compute_tree (Key keys[], DynArray< int > &tree, const size_t n, const size_t i, const size_t j) |
| Recursively construct the optimal BST from the tree matrix. | |
| template<class Node , typename Key > | |
| Node * | build_optimal_tree (Key keys[], double p[], const size_t n) |
| Build an optimal binary search tree based on access probabilities. | |
| Array< std::string > | csv_read_row (std::istream &in, char delimiter=',') |
| Read a single CSV row from an input stream. | |
| Array< std::string > | csv_read_row (const std::string &line, char delimiter=',') |
| Read a single CSV row from a string. | |
| Array< Array< std::string > > | csv_read_all (std::istream &in, char delimiter=',') |
| Read all rows from a CSV input stream. | |
| Array< Array< std::string > > | csv_read_file (const std::string &filename, char delimiter=',') |
| Read all rows from a CSV file. | |
| std::string | csv_escape (const std::string &field, char delimiter=',') |
| Escape a string for CSV output. | |
| void | csv_write_row (std::ostream &out, const Array< std::string > &row, char delimiter=',', const std::string &line_ending="\n") |
| Write a CSV row to an output stream. | |
| void | csv_write_all (std::ostream &out, const Array< Array< std::string > > &rows, char delimiter=',', const std::string &line_ending="\n") |
| Write multiple CSV rows to an output stream. | |
| void | csv_write_file (const std::string &filename, const Array< Array< std::string > > &rows, char delimiter=',', const std::string &line_ending="\n") |
| Write CSV data to a file. | |
| size_t | csv_num_columns (const Array< std::string > &row) |
| Get the number of columns in a CSV row. | |
| bool | csv_is_rectangular (const Array< Array< std::string > > &rows) |
| Check if all rows have the same number of columns. | |
| Array< std::string > | csv_get_column (const Array< Array< std::string > > &rows, size_t col_index) |
| Get a column from CSV data. | |
| template<typename T > | |
| T | csv_to_number (const std::string &field) |
| Convert a CSV field to a numeric type. | |
| template<> | |
| int | csv_to_number< int > (const std::string &field) |
| template<> | |
| long | csv_to_number< long > (const std::string &field) |
| template<> | |
| double | csv_to_number< double > (const std::string &field) |
| template<> | |
| float | csv_to_number< float > (const std::string &field) |
| template<typename Pred > | |
| Array< Array< std::string > > | csv_filter (const Array< Array< std::string > > &rows, Pred predicate) |
| Filter CSV rows by a predicate. | |
| Array< Array< std::string > > | csv_filter_by_value (const Array< Array< std::string > > &rows, size_t col_index, const std::string &value) |
| Filter CSV rows by column value. | |
| Array< Array< std::string > > | csv_select_columns (const Array< Array< std::string > > &rows, const Array< size_t > &col_indices) |
| Select specific columns from CSV data. | |
| Array< Array< std::string > > | csv_skip_rows (const Array< Array< std::string > > &rows, size_t n) |
| Skip the first N rows of CSV data. | |
| Array< Array< std::string > > | csv_take_rows (const Array< Array< std::string > > &rows, size_t n) |
| Take only the first N rows of CSV data. | |
| size_t | csv_count_rows (const Array< Array< std::string > > &rows) |
| Count total number of rows. | |
| size_t | csv_count_empty (const Array< Array< std::string > > &rows) |
| Count empty fields in CSV data. | |
| template<typename Pred > | |
| size_t | csv_count_if (const Array< Array< std::string > > &rows, Pred predicate) |
| Count rows matching a predicate. | |
| template<typename Pred > | |
| size_t | csv_find_row (const Array< Array< std::string > > &rows, Pred predicate) |
| Find first row matching a predicate. | |
| size_t | csv_find_by_value (const Array< Array< std::string > > &rows, size_t col_index, const std::string &value) |
| Find row where column equals value. | |
| Array< std::string > | csv_distinct (const Array< Array< std::string > > &rows, size_t col_index) |
| Get distinct values in a column. | |
| Array< Array< std::string > > | csv_transpose (const Array< Array< std::string > > &rows) |
| Transpose CSV data (swap rows and columns). | |
| Array< Array< std::string > > | csv_sort_by_column (const Array< Array< std::string > > &rows, size_t col_index, bool ascending=true) |
| Sort CSV data by a column. | |
| template<typename T > | |
| Array< Array< std::string > > | csv_sort_by_column_numeric (const Array< Array< std::string > > &rows, size_t col_index, bool ascending=true) |
| Sort CSV data by a column with numeric comparison. | |
| Array< Array< std::string > > | csv_unique (const Array< Array< std::string > > &rows) |
| Remove duplicate rows. | |
| template<typename Func > | |
| Array< Array< std::string > > | csv_transform (const Array< Array< std::string > > &rows, Func func) |
| Apply a transformation to each field. | |
| bool | csv_skip_bom (std::istream &in) |
| Skip UTF-8 BOM if present. | |
| Array< Array< std::string > > | csv_trim_fields (const Array< Array< std::string > > &rows) |
| Trim whitespace from all fields. | |
| Array< Array< std::string > > | csv_fill_empty (const Array< Array< std::string > > &rows, const std::string &default_value) |
| Replace empty fields with a default value. | |
| Array< Array< std::string > > | csv_join_horizontal (const Array< Array< std::string > > &left, const Array< Array< std::string > > &right) |
| Join two CSV datasets horizontally (add columns). | |
| Array< Array< std::string > > | csv_join_vertical (const Array< Array< std::string > > &top, const Array< Array< std::string > > &bottom) |
| Join two CSV datasets vertically (add rows). | |
| Array< Array< std::string > > | csv_inner_join (const Array< Array< std::string > > &left, size_t left_key_col, const Array< Array< std::string > > &right, size_t right_key_col) |
| Inner join two CSV datasets by a key column. | |
| Array< Array< Array< std::string > > > | csv_group_by (const Array< Array< std::string > > &rows, size_t col_index) |
| Group rows by a column value. | |
| template<typename Func > | |
| Array< Array< std::string > > | csv_add_column (const Array< Array< std::string > > &rows, Func func) |
| Add a new column with computed values. | |
| Array< Array< std::string > > | csv_rename_column (const Array< Array< std::string > > &rows, const std::string &old_name, const std::string &new_name) |
| Rename a column (in the header row). | |
| void | put_char_in_buffer (char *&start_addr, const char *end_addr, int c) |
| Append a character to a buffer with bounds checking. | |
| void | init_token_scanning () |
| Initialize token scanning by recording current position. | |
| void | close_token_scanning (const char *buffer, char *&start_addr, const char *end_addr) |
| Finalize token scanning by null-terminating and saving the token. | |
| int | read_char_from_stream (std::ifstream &input_stream) |
| Read a single character from an input stream with position tracking. | |
| void | skip_white_spaces (std::ifstream &input_stream) |
| Skip whitespace characters in the input stream. | |
| long | load_number (std::ifstream &input_stream) |
| Load an integer number from the input stream. | |
| std::string | load_string (std::ifstream &input_stream) |
| Load a string from the input stream. | |
| void | print_parse_error_and_exit (const std::string &str) |
| Print a parse error message and terminate the program. | |
| void | print_parse_warning (const std::string &str) |
| Print a parse warning message. | |
| std::string | command_line_to_string (int argc, char *argv[]) |
| Convert command line arguments to a single string. | |
| void | reset_parse_state () |
| Reset the parsing state to initial values. | |
| int | peek_char (std::ifstream &input_stream) |
| Peek at the next character without consuming it. | |
| StreamPosition | mark_position (std::ifstream &input_stream) |
| Mark the current position for potential backtracking. | |
| void | restore_position (std::ifstream &input_stream, const StreamPosition &pos) |
| Restore a previously marked position. | |
| void | skip_line_comment (std::ifstream &input_stream) |
| Skip a line comment (// style or # style) | |
| void | skip_block_comment (std::ifstream &input_stream, const std::string &open="/" "*", const std::string &close="*" "/") |
| Skip a block comment (C-style) | |
| void | skip_whitespace_and_comments (std::ifstream &input_stream) |
| Skip whitespace and comments (C/C++ style) | |
| double | load_double (std::ifstream &input_stream) |
| Load a floating-point number from the input stream. | |
| long | load_hex_number (std::ifstream &input_stream) |
| Load a hexadecimal number from the input stream. | |
| long | load_octal_number (std::ifstream &input_stream) |
| Load an octal number from the input stream. | |
| long | load_binary_number (std::ifstream &input_stream) |
| Load a binary number from the input stream. | |
| std::string | load_identifier (std::ifstream &input_stream) |
| Load an identifier from the input stream. | |
| bool | is_keyword (const std::string &s, const std::vector< std::string > &keywords) |
| Check if a string is in a list of keywords. | |
| void | expect_char (std::ifstream &input_stream, char expected) |
| Expect and consume a specific character. | |
| void | expect (std::ifstream &input_stream, const std::string &expected) |
| Expect and consume a specific string/keyword. | |
| bool | try_char (std::ifstream &input_stream, char ch) |
| Try to match a character without throwing. | |
| char | process_escape (const int c) |
| Process an escape sequence. | |
| std::string | load_escaped_string (std::ifstream &input_stream) |
| Load a string with escape sequence processing. | |
| char | load_char_literal (std::ifstream &input_stream) |
| Load a character literal. | |
| std::string | token_type_to_string (TokenType type) |
| Convert TokenType to string for debugging. | |
| std::string | load_file_contents (const std::string &filename) |
| Load entire file contents into a string. | |
| DynList< std::string > | load_file_lines (const std::string &filename) |
| Load file as a list of lines. | |
| DynList< std::string > | split_string (const std::string &str, char delimiter) |
| Split a string by a delimiter. | |
| const char * | to_string (const Planarity_Certificate_Type type) noexcept |
| Return readable name for certificate type. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| Planarity_Test_Result< GT > | planarity_test (const GT &g, SA sa=SA(), const Planarity_Test_Options &options=Planarity_Test_Options()) |
| Execute a comprehensive planarity test on an Aleph graph. | |
| template<AlephGraph GT> | |
| Planarity_Test_Result< GT > | planarity_test (const GT &g, const Planarity_Test_Options &options) |
| Overload with default arc selector. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| bool | is_planar_graph (const GT &g, SA sa=SA(), const Planarity_Test_Options &options=Planarity_Test_Options()) |
| High-level boolean check for graph planarity. | |
| template<AlephGraph GT> | |
| bool | is_planar_graph (const GT &g, const Planarity_Test_Options &options) |
| Overload with default arc selector. | |
| template<AlephGraph GT> | |
| Planar_Dual_Metadata< GT > | planar_dual_metadata (const Planarity_Test_Result< GT > &result) |
| Build face and dual-edge metadata from a planar embedding result. | |
| template<AlephGraph GT, class DGT = Default_Planar_Dual_Graph<GT>> | |
| DGT | build_planar_dual_graph (const Planar_Dual_Metadata< GT > &md) |
| Build an Aleph dual graph from face/dual metadata. | |
| template<AlephGraph GT, class DGT = Default_Planar_Dual_Graph<GT>> | |
| DGT | build_planar_dual_graph (const Planarity_Test_Result< GT > &result) |
| Build an Aleph dual graph directly from a planarity result. | |
| template<AlephGraph GT> | |
| Planar_Geometric_Drawing< GT > | planar_geometric_drawing (const Planarity_Test_Result< GT > &result, const Planar_Geometric_Drawing_Options &options=Planar_Geometric_Drawing_Options()) |
| Build embedding-aware 2D node coordinates from a planar result. | |
| template<AlephGraph GT, class Node_Label = Dft_Certificate_Node_Label<GT>> | |
| std::string | nonplanar_certificate_to_json (const Planarity_Test_Result< GT > &result, Node_Label node_label=Node_Label(), const NonPlanar_Certificate_Export_Options &options=NonPlanar_Certificate_Export_Options()) |
| Export non-planar certificate as JSON. | |
| template<AlephGraph GT, class Node_Label = Dft_Certificate_Node_Label<GT>> | |
| std::string | nonplanar_certificate_to_dot (const Planarity_Test_Result< GT > &result, Node_Label node_label=Node_Label(), const NonPlanar_Certificate_Export_Options &options=NonPlanar_Certificate_Export_Options()) |
| Export non-planar certificate as GraphViz DOT. | |
| template<AlephGraph GT> | |
| NonPlanar_Certificate_Validation< GT > | validate_nonplanar_certificate (const Planarity_Test_Result< GT > &result) |
| Validate structural consistency of a non-planar certificate. | |
| template<AlephGraph GT> | |
| bool | nonplanar_certificate_is_valid (const Planarity_Test_Result< GT > &result) |
Convenience predicate over validate_nonplanar_certificate(). | |
| template<AlephGraph GT, class Node_Label = Dft_Certificate_Node_Label<GT>> | |
| std::string | nonplanar_certificate_to_graphml (const Planarity_Test_Result< GT > &result, Node_Label node_label=Node_Label(), const NonPlanar_Certificate_Export_Options &options=NonPlanar_Certificate_Export_Options()) |
| Export non-planar certificate as GraphML. | |
| template<AlephGraph GT, class Node_Label = Dft_Certificate_Node_Label<GT>> | |
| std::string | nonplanar_certificate_to_gexf (const Planarity_Test_Result< GT > &result, Node_Label node_label=Node_Label(), const NonPlanar_Certificate_Export_Options &options=NonPlanar_Certificate_Export_Options()) |
| Export non-planar certificate as GEXF. | |
| double | geom_number_to_double (const Geom_Number &n) |
| Converts a Geom_Number to its double precision representation. | |
| const Geom_Number & | geom_pi () |
| High-precision pi value for computations that require Geom_Number. | |
| Geom_Number | area_of_parallelogram (const Point &a, const Point &b, const Point &c) |
| Compute the signed area of the parallelogram defined by vectors a->b and a->c. | |
| Geom_Number | euclidean_distance (const Geom_Number &x, const Geom_Number &y) |
| Euclidean distance (hypotenuse) of the vector (x, y). | |
| Geom_Number | pitag (const Geom_Number &x, const Geom_Number &y) |
| Geom_Number | arctan (const Geom_Number &m) |
Arc tangent of m (wrapper over mpfr). | |
| Geom_Number | arctan2 (const Geom_Number &m, const Geom_Number &n) |
| Two-argument arc tangent (wrapper over mpfr). | |
| Geom_Number | sinus (const Geom_Number &x) |
Sine of x (wrapper over mpfr). | |
| Geom_Number | cosinus (const Geom_Number &x) |
Cosine of x (wrapper over mpfr). | |
| Geom_Number | square_root (const Geom_Number &x) |
Square root of x (wrapper over mpfr). | |
| Point | operator* (const Geom_Number &s, const Point &p) |
| Scalar multiplication with commutative order. | |
| size_t | approximate_string_size (const std::string &str) |
| Estimate the count of printable characters in a LaTeX string. | |
| Orientation | orientation (const Point &a, const Point &b, const Point &c) |
| Return the orientation of the triple (a, b, c). | |
| Geom_Number | in_circle_determinant (const Point &a, const Point &b, const Point &c, const Point &p) |
| Return the exact in-circle determinant for (a,b,c,p). | |
| InCircleResult | in_circle (const Point &a, const Point &b, const Point &c, const Point &p) |
| Classify point p against circumcircle of triangle (a,b,c), exactly. | |
| bool | on_segment (const Segment &s, const Point &p) |
Return true if p lies on segment s (exact). | |
| bool | segments_intersect (const Segment &s1, const Segment &s2) |
Return true if segments s1 and s2 intersect (including endpoints). | |
| bool | segments_intersect (const Point &a, const Point &b, const Point &c, const Point &d) |
| Return true if segments (a,b) and (c,d) intersect (including endpoints). | |
| Point | segment_intersection_point (const Segment &s1, const Segment &s2) |
Compute the exact intersection point of segments s1 and s2. | |
| Geom_Number | area_of_triangle (const Point &a, const Point &b, const Point &c) |
| Return the (unsigned) area of triangle (a, b, c) as an exact rational. | |
| Geom_Number | scalar_triple_product (const Point3D &a, const Point3D &b, const Point3D &c) |
| Scalar triple product: a · (b × c). | |
| std::ostream & | operator<< (std::ostream &o, const Point &p) |
| std::ostream & | operator<< (std::ostream &o, const Segment &s) |
| std::ostream & | operator<< (std::ostream &o, const Triangle &t) |
| std::ostream & | operator<< (std::ostream &o, const Rectangle &r) |
| std::ostream & | operator<< (std::ostream &o, const Ellipse &e) |
| std::ostream & | operator<< (std::ostream &o, const RotatedEllipse &e) |
| std::ostream & | operator<< (std::ostream &o, const Point3D &p) |
| std::ostream & | operator<< (std::ostream &o, const Segment3D &s) |
| std::ostream & | operator<< (std::ostream &o, const Triangle3D &t) |
| std::ostream & | operator<< (std::ostream &o, const Tetrahedron &t) |
| Geom_Number | area_of_triangle_legacy (const Point &a, const Point &b, const Point &c) |
| bool | points_are_colinear (const Point &a, const Point &b, const Point &c) |
| bool | c_is_to_left_ (const Point &a, const Point &b, const Point &c) |
| bool | is_clockwise (const Point &a, const Point &b, const Point &c) |
| bool | left_on (const Point &a, const Point &b, const Point &c) |
| bool | proper_intersection (const Point &a, const Point &b, const Point &c, const Point &d) |
| bool | between (const Point &a, const Point &b, const Point &c) |
| bool | intersect_improp (const Point &a, const Point &b, const Point &c, const Point &d) |
| bool | intersectp (const Point &a, const Point &b, const Point &c, const Point &d) |
| Array< uint64_t > | pollard_rho (uint64_t n) |
| Compute the prime factorization of a number using Pollard's rho. | |
| std::ostream & | operator<< (std::ostream &o, const Polygon &p) |
| Output stream operator for Polygon. | |
| std::ostream & | operator<< (std::ostream &o, const Regular_Polygon &p) |
| Output stream operator for Regular_Polygon. | |
| bool | miller_rabin (uint64_t n) noexcept |
| Miller-Rabin primality test for 64-bit integers. | |
| template<class Node > | |
| bool | test_black_condition_rk (Node *p, int &max, int bh=0) |
| Test the black height condition for a red-black tree. | |
| template<class Node > | |
| int | red_black_height_rk (Node *p) noexcept |
| Black height of a ranked red-black subtree, checking all its nodes. | |
| template<class Node > | |
| bool | is_red_black_rk (Node *node) |
| Verify if tree rooted at node is a valid red-black tree. | |
| template<class Node > | |
| bool | is_red_black_tree_rk (Node *node) |
| Verify if tree is a valid red-black tree with correct counters. | |
| template<class Node , class Compare > | |
| bool | is_red_black_bst_rk (Node *node, Compare &cmp) |
| Verify that tree rooted at node is a valid red-black BST with counters. | |
| template<std::input_iterator Itor, std::sentinel_for< Itor > Sent> | |
| auto | reservoir_sample (Itor beg, Sent end, size_t k, unsigned long seed=static_cast< unsigned long >(std::chrono::high_resolution_clock::now().time_since_epoch().count())) |
| Convenience function to sample k elements from a range. | |
| template<typename Move , typename Priority , typename BetterPriority > | |
| void | sort_ranked_moves (Array< RankedMove< Move, Priority > > &moves, BetterPriority better_priority, const bool prefer_killer, const bool prefer_history) |
| Sort one materialized move batch using priority and optional hooks. | |
| constexpr size_t | compiler_ssa_invalid_id () noexcept |
| Returns the sentinel invalid SSA id. | |
| const char * | compiler_ssa_instruction_kind_name (const Compiler_SSA_Instruction_Kind kind) noexcept |
| Returns a stable debug name for an SSA instruction kind. | |
| Compiler_SSA_Validation_Report | validate_ssa_function (const Compiler_SSA_Function &function, const Compiler_SSA_Module *module=nullptr) |
| Validates one SSA function structurally and semantically. | |
| Compiler_SSA_Validation_Report | validate_ssa_module (const Compiler_SSA_Module &module) |
| Validates all functions in one SSA module. | |
| std::string | compiler_dump_ssa_function (const Compiler_SSA_Function *function, const Compiler_SSA_Module *module=nullptr, const Compiler_Type_Context *types=nullptr) |
| Dumps one SSA function deterministically. | |
| std::string | compiler_dump_ssa_module (const Compiler_SSA_Module *module, const Compiler_Type_Context *types=nullptr) |
| Dumps all SSA functions in one module deterministically. | |
| template<typename Container > | |
| auto | sum (const Container &data) -> std::decay_t< decltype(*std::begin(data))> |
| Compute the sum of elements. | |
| template<typename Container > | |
| auto | mean (const Container &data) -> std::decay_t< decltype(*std::begin(data))> |
| Compute the arithmetic mean. | |
| template<typename Container > | |
| auto | variance (const Container &data, bool population=false) -> std::decay_t< decltype(*std::begin(data))> |
| Compute variance using Welford's numerically stable algorithm. | |
| template<typename Container > | |
| auto | stddev (const Container &data, bool population=false) -> std::decay_t< decltype(*std::begin(data))> |
| Compute standard deviation. | |
| template<typename Container > | |
| auto | min_value (const Container &data) -> std::decay_t< decltype(*std::begin(data))> |
| Compute minimum value. | |
| template<typename Container > | |
| auto | max_value (const Container &data) -> std::decay_t< decltype(*std::begin(data))> |
| Compute maximum value. | |
| template<typename Container > | |
| auto | min_max (const Container &data) -> std::pair< std::decay_t< decltype(*std::begin(data))>, std::decay_t< decltype(*std::begin(data))> > |
| Compute minimum and maximum values in one pass. | |
| template<typename Container > | |
| auto | percentile (const Container &data, double p) -> std::decay_t< decltype(*std::begin(data))> |
| Compute a percentile value. | |
| template<typename Container > | |
| auto | median (const Container &data) -> std::decay_t< decltype(*std::begin(data))> |
| Compute the median (50th percentile). | |
| template<typename Container > | |
| auto | quartiles (const Container &data) -> std::tuple< std::decay_t< decltype(*std::begin(data))>, std::decay_t< decltype(*std::begin(data))>, std::decay_t< decltype(*std::begin(data))> > |
| Compute quartiles (Q1, Q2, Q3). | |
| template<typename Container > | |
| auto | iqr (const Container &data) -> std::decay_t< decltype(*std::begin(data))> |
| Compute the interquartile range (IQR = Q3 - Q1). | |
| template<typename Container > | |
| auto | mode (const Container &data) -> std::decay_t< decltype(*std::begin(data))> |
| Compute the mode (most frequent value). | |
| template<typename Container > | |
| bool | is_multimodal (const Container &data) |
| Check if data is multimodal. | |
| template<typename Container > | |
| auto | skewness (const Container &data) -> std::decay_t< decltype(*std::begin(data))> |
| Compute skewness (measure of asymmetry). | |
| template<typename Container > | |
| auto | kurtosis (const Container &data) -> std::decay_t< decltype(*std::begin(data))> |
| Compute excess kurtosis (measure of tailedness). | |
| template<typename Container > | |
| auto | coefficient_of_variation (const Container &data) -> std::decay_t< decltype(*std::begin(data))> |
| Compute coefficient of variation (CV = stddev / mean). | |
| template<typename Container1 , typename Container2 > | |
| auto | covariance (const Container1 &x, const Container2 &y, bool population=false) -> std::decay_t< decltype(*std::begin(x))> |
| Compute covariance between two datasets. | |
| template<typename Container1 , typename Container2 > | |
| auto | correlation (const Container1 &x, const Container2 &y) -> std::decay_t< decltype(*std::begin(x))> |
| Compute Pearson correlation coefficient. | |
| template<typename Container > | |
| auto | histogram (const Container &data, size_t num_bins) -> std::vector< std::pair< std::decay_t< decltype(*std::begin(data))>, size_t > > |
| Compute a histogram of the data. | |
| template<typename Container > | |
| auto | compute_all_stats (const Container &data) -> Stats< std::decay_t< decltype(*std::begin(data))> > |
| Compute all statistics for a dataset. | |
| template<class T > | |
| void | compute_stats (T *data, int l, int r, T &avg, T &var, T &med, T &_min, T &_max) |
| Compute basic descriptive statistics for an array range. | |
| template<typename Container > | |
| void | compute_stats (const Container &data, std::decay_t< decltype(*std::begin(data))> &avg, std::decay_t< decltype(*std::begin(data))> &var, std::decay_t< decltype(*std::begin(data))> &med, std::decay_t< decltype(*std::begin(data))> &_min, std::decay_t< decltype(*std::begin(data))> &_max) |
| Compute basic descriptive statistics for a container. | |
| double | search_elapsed_ms (const SearchClock::duration &duration) noexcept |
| template<SearchMove Move> | |
| void | reserve_search_path (SearchPath< Move > &path, const SearchLimits &limits) |
| template<IDAStarDomain Domain> | |
| auto | ida_star_search (Domain domain, typename Domain::State initial_state, ExplorationPolicy policy={}, SearchLimits limits={}) |
| Convenience wrapper for a one-shot IDA* search. | |
| template<IDAStarDomain Domain, typename OnSolution > requires SearchSolutionVisitor<OnSolution, SearchSolution<typename Domain::State, typename Domain::Move>> | |
| auto | ida_star_search (Domain domain, typename Domain::State initial_state, OnSolution &on_solution, ExplorationPolicy policy={}, SearchLimits limits={}) |
| Convenience wrapper for IDA* with a solution callback. | |
| size_t | levenshtein_distance (const std::string_view a, const std::string_view b) |
| Levenshtein distance (insert/delete/substitute each cost 1). | |
| size_t | edit_distance (const std::string_view a, const std::string_view b) |
| Alias for Levenshtein distance. | |
| size_t | damerau_levenshtein_distance (const std::string_view a, const std::string_view b) |
| Damerau-Levenshtein distance with adjacent transpositions. | |
| LCS_Result | longest_common_subsequence (const std::string_view a, const std::string_view b) |
| Compute Longest Common Subsequence. | |
| Longest_Common_Substring_Result | longest_common_substring (const std::string_view a, const std::string_view b) |
| Compute the longest common substring (contiguous) between two strings. | |
| Manacher_Result | manacher (const std::string_view text) |
| Compute palindromic radii and the longest palindrome with Manacher. | |
| std::string | longest_palindromic_substring (const std::string_view text) |
| Convenience wrapper returning only the longest palindromic substring. | |
| Array< size_t > | kmp_prefix_function (const std::string_view pattern) |
| Prefix-function used by KMP. | |
| Array< size_t > | kmp_search (const std::string_view text, const std::string_view pattern) |
| Find all occurrences of a pattern using KMP. | |
| Array< size_t > | z_algorithm (const std::string_view s) |
| Compute Z-array for a string. | |
| Array< size_t > | z_search (const std::string_view text, const std::string_view pattern) |
| Find all occurrences of a pattern using the Z-algorithm. | |
| Array< size_t > | boyer_moore_horspool_search (const std::string_view text, const std::string_view pattern) |
| Find all occurrences using Boyer-Moore-Horspool. | |
| Array< size_t > | rabin_karp_search (const std::string_view text, const std::string_view pattern, const uint64_t base=911382323ull) |
| Find all occurrences using Rabin-Karp with rolling hash. | |
| template<std::integral T> | |
| Subset_Sum_Result< T > | subset_sum (const Array< T > &values, T target) |
| Solve the subset sum problem via classical DP with reconstruction. | |
| template<std::integral T> | |
| bool | subset_sum_exists (const Array< T > &values, T target) |
| Check if a subset summing to target exists (space-optimized). | |
| template<std::integral T> | |
| size_t | subset_sum_count (const Array< T > &values, T target) |
| Count the number of subsets that sum to target. | |
| template<std::integral T> | |
| Subset_Sum_Result< T > | subset_sum_mitm (const Array< T > &values, T target) |
| Solve the subset sum problem via meet-in-the-middle (MITM). | |
| Array< size_t > | suffix_array (const std::string_view text) |
| Build suffix array with doubling algorithm. | |
| Array< size_t > | lcp_array_kasai (const std::string_view text, const Array< size_t > &sa) |
| Compute LCP array from text and suffix array using Kasai. | |
| std::string | longest_common_substring_sam (const std::string_view a, const std::string_view b) |
| Convenience function: LCS via suffix automaton. | |
| ThreadPool & | default_pool () |
| Return the default shared thread pool instance. | |
| template<typename Iterator , typename F > | |
| void | parallel_for (ThreadPool &pool, Iterator begin, Iterator end, F &&f, size_t chunk_size=0) |
| Execute a function in parallel over a range. | |
| template<typename Iterator , typename F > | |
| void | parallel_for (Iterator begin, Iterator end, F &&f, const ParallelOptions &options={}) |
| Execute a function in parallel over a range with explicit options. | |
| template<typename InputIt , typename OutputIt , typename F > | |
| OutputIt | parallel_transform (ThreadPool &pool, InputIt first, InputIt last, OutputIt d_first, F &&f, size_t chunk_size=0) |
| Transform elements in parallel and store results. | |
| template<typename InputIt , typename OutputIt , typename F > | |
| OutputIt | parallel_transform (InputIt first, InputIt last, OutputIt d_first, F &&f, const ParallelOptions &options={}) |
| Parallel transform with explicit options. | |
| template<typename Iterator , typename T , typename BinaryOp > | |
| T | parallel_reduce (ThreadPool &pool, Iterator first, Iterator last, T init, BinaryOp op, size_t chunk_size=0) |
| Reduce elements in parallel. | |
| template<typename Iterator , typename T , typename BinaryOp > | |
| T | parallel_reduce (Iterator first, Iterator last, T init, BinaryOp op, const ParallelOptions &options={}) |
| Parallel reduce with explicit options. | |
| template<typename F > | |
| void | parallel_for_index (ThreadPool &pool, size_t start, size_t end, F &&f, size_t chunk_size=0) |
| Apply a function to each element in parallel (index-based). | |
| template<typename F > | |
| void | parallel_for_index (size_t start, size_t end, F &&f, const ParallelOptions &options={}) |
| Parallel index loop with explicit options. | |
| template<typename... Fs> | |
| void | parallel_invoke (ThreadPool &pool, Fs &&... fs) |
| Invoke a small set of related callables in parallel. | |
| template<typename... Fs> | |
| void | parallel_invoke (const ParallelOptions &options, Fs &&... fs) |
| parallel_invoke with explicit options. | |
| template<typename InputIt , typename OutputIt , typename BinaryOp > | |
| OutputIt | pscan (ThreadPool &pool, InputIt first, InputIt last, OutputIt d_first, BinaryOp op, size_t chunk_size=0) |
| Inclusive prefix scan over a range. | |
| template<typename InputIt , typename OutputIt , typename BinaryOp > | |
| OutputIt | pscan (InputIt first, InputIt last, OutputIt d_first, BinaryOp op, const ParallelOptions &options={}) |
| Inclusive prefix scan with explicit options. | |
| template<typename InputIt , typename OutputIt , typename T , typename BinaryOp > | |
| OutputIt | pexclusive_scan (ThreadPool &pool, InputIt first, InputIt last, OutputIt d_first, T init, BinaryOp op, size_t chunk_size=0) |
| Exclusive prefix scan over a range. | |
| template<typename InputIt , typename OutputIt , typename T , typename BinaryOp > | |
| OutputIt | pexclusive_scan (InputIt first, InputIt last, OutputIt d_first, T init, BinaryOp op, const ParallelOptions &options={}) |
| Exclusive prefix scan with explicit options. | |
| template<typename InputIt1 , typename InputIt2 , typename OutputIt , typename Compare = std::less<>> | |
| OutputIt | pmerge (ThreadPool &pool, InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, OutputIt d_first, Compare comp=Compare{}, size_t chunk_size=0) |
| Merge two sorted ranges in parallel. | |
| template<typename InputIt1 , typename InputIt2 , typename OutputIt , typename Compare = std::less<>> | |
| OutputIt | pmerge (InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, OutputIt d_first, Compare comp=Compare{}, const ParallelOptions &options={}) |
| Parallel merge with explicit options. | |
| void | append_unique_tikz_library (Array< std::string > &libraries, const std::string &library) |
Append library into libraries unless already present. | |
| Tikz_Style | make_tikz_draw_style (const std::string &draw_color) |
| Create a basic draw style with a custom color. | |
| Tikz_Style | make_tikz_fill_style (const std::string &draw_color, const std::string &fill_color) |
| Create a basic fill style with custom draw/fill colors. | |
| template<TikzDrawable Geom> | |
| void | put_in_plane (Tikz_Plane &plane, const Geom &geom_obj) |
| Insert any supported geometry type in a Tikz_Plane. | |
| template<TikzDrawable Geom> | |
| void | put_in_plane (Tikz_Plane &plane, const Geom &geom_obj, const Tikz_Style &style, const int layer=Tikz_Plane::Layer_Default) |
| Insert any supported geometry type with style/layer. | |
| void | put_quadratic_bezier_in_plane (Tikz_Plane &plane, const Point &p0, const Point &p1, const Point &p2, const size_t subdivisions=64, const Tikz_Style &style={}, const int layer=Tikz_Plane::Layer_Default) |
| Approximate and insert a quadratic Bézier as an open polyline. | |
| void | put_cubic_bezier_in_plane (Tikz_Plane &plane, const Point &p0, const Point &p1, const Point &p2, const Point &p3, const size_t subdivisions=64, const Tikz_Style &style={}, const int layer=Tikz_Plane::Layer_Default) |
| Approximate and insert a cubic Bézier as an open polyline. | |
| void | put_quadratic_bezier_native_in_plane (Tikz_Plane &plane, const Point &p0, const Point &p1, const Point &p2, const Tikz_Style &style={}, const int layer=Tikz_Plane::Layer_Default) |
| Insert a quadratic Bézier using native TikZ controls syntax. | |
| void | put_cubic_bezier_native_in_plane (Tikz_Plane &plane, const Point &p0, const Point &p1, const Point &p2, const Point &p3, const Tikz_Style &style={}, const int layer=Tikz_Plane::Layer_Default) |
| Insert a cubic Bézier using native TikZ controls syntax. | |
| void | put_point_label_in_plane (Tikz_Plane &plane, const Point &point, const std::string &label, const std::string &placement="above", const Tikz_Style &style=make_tikz_draw_style("black"), const int layer=Tikz_Plane::Layer_Overlay) |
Insert a point label with configurable placement (above, etc.). | |
| Tikz_Style | tikz_points_style (const std::string &color="black", const double opacity=-1.0) |
| Creates a style optimized for point clouds. | |
| Tikz_Style | tikz_wire_style (const std::string &color="black", const bool dashed=false, const bool with_arrow=false) |
| Creates a style optimized for wireframe segments and polygons. | |
| Tikz_Style | tikz_path_style (const std::string &color="red", const bool with_arrow=false) |
| Creates a style optimized for polyline paths. | |
| Tikz_Style | tikz_bold_wire_style (const std::string &color, const double width_mm=1.2) |
| Creates a solid wireframe style with an explicit line width. | |
| Tikz_Style | tikz_area_style (const std::string &draw_color="black", const std::string &fill_color="gray!25", const double opacity=0.6) |
| Creates a style for drawing filled polygons. | |
| void | put_points (Tikz_Plane &plane, const Array< Point > &pts, const Tikz_Style &style=tikz_points_style(), const int layer=Tikz_Plane::Layer_Default) |
Inserts all points from an Array<Point> into the plane. | |
| void | put_points (Tikz_Plane &plane, const DynList< Point > &pts, const Tikz_Style &style=tikz_points_style(), const int layer=Tikz_Plane::Layer_Default) |
Inserts all points from a DynList<Point> into the plane. | |
| void | put_point_labels (Tikz_Plane &plane, const Array< Point > &pts, const std::string &prefix="p", const std::string &placement="above right", const Tikz_Style &style=make_tikz_draw_style("black"), const int layer=Tikz_Plane::Layer_Overlay) |
Adds a text label to each point in an Array<Point>. | |
| void | put_point_labels (Tikz_Plane &plane, const DynList< Point > &pts, const std::string &prefix="p", const std::string &placement="above right", const Tikz_Style &style=make_tikz_draw_style("black"), const int layer=Tikz_Plane::Layer_Overlay) |
Adds a text label to each point in a DynList<Point>. | |
| void | put_polygons (Tikz_Plane &plane, const Array< Polygon > &polys, const Tikz_Style &style=tikz_wire_style(), const int layer=Tikz_Plane::Layer_Default) |
Inserts all polygons from an Array<Polygon> into the plane. | |
| void | put_polygon_vertices (Tikz_Plane &plane, const Polygon &poly, const Tikz_Style &style=tikz_points_style(), const int layer=Tikz_Plane::Layer_Overlay) |
| Inserts the vertices of a polygon as styled points. | |
| void | put_polygon_vertices (Tikz_Plane &plane, const Regular_Polygon &poly, const Tikz_Style &style=tikz_points_style(), const int layer=Tikz_Plane::Layer_Overlay) |
| Inserts the vertices of a regular polygon as styled points. | |
| Polygon | polygon_from_vertices (const Array< Point > &vertices, const bool close=true) |
Constructs a Polygon from an ordered array of vertices. | |
| Polygon | polygon_from_vertex_indices (const Array< Point > &vertices, const DynList< size_t > &indices, const bool close=true) |
Constructs a Polygon from a list of indices into a vertex array. | |
| template<typename HullAlgorithm > | |
| Polygon | visualize_convex_hull (Tikz_Plane &plane, const DynList< Point > &points, const HullAlgorithm &hull_algorithm, const Tikz_Style &point_style=tikz_points_style("black", 0.6), const Tikz_Style &hull_style=tikz_wire_style("red"), const Tikz_Style &hull_vertex_style=tikz_points_style("red"), const int point_layer=Tikz_Plane::Layer_Default, const int hull_layer=Tikz_Plane::Layer_Foreground, const bool draw_hull_vertices=true) |
| Runs a convex hull algorithm and visualizes the result. | |
| Polygon | visualize_convex_intersection (Tikz_Plane &plane, const Polygon &subject, const Polygon &clip, const ConvexPolygonIntersectionBasic &intersection_algorithm={}, const Tikz_Style &subject_style=tikz_area_style("blue", "blue!15", 0.45), const Tikz_Style &clip_style=tikz_area_style("orange", "orange!20", 0.45), const Tikz_Style &result_style=tikz_area_style("red", "red!30", 0.60), const int input_layer=Tikz_Plane::Layer_Default, const int result_layer=Tikz_Plane::Layer_Foreground) |
| Visualizes the intersection of two convex polygons. | |
| Array< Polygon > | visualize_boolean_operation (Tikz_Plane &plane, const Polygon &a, const Polygon &b, const BooleanPolygonOperations::Op op, const BooleanPolygonOperations &bop={}, const Tikz_Style &a_style=tikz_area_style("blue", "blue!15", 0.35), const Tikz_Style &b_style=tikz_area_style("green!60!black", "green!20", 0.35), const Tikz_Style &result_style=tikz_area_style("red", "red!35", 0.65), const int input_layer=Tikz_Plane::Layer_Default, const int result_layer=Tikz_Plane::Layer_Foreground) |
| Visualizes a boolean operation (union, intersection, difference) on two polygons. | |
| void | put_delaunay_result (Tikz_Plane &plane, const DelaunayTriangulationBowyerWatson::Result &dt, const Tikz_Style &triangle_style=tikz_wire_style("blue"), const bool draw_sites=true, const Tikz_Style &site_style=tikz_points_style("black"), const int triangle_layer=Tikz_Plane::Layer_Default, const int site_layer=Tikz_Plane::Layer_Foreground) |
| Insert Delaunay triangulation as triangle outlines. | |
| DelaunayTriangulationBowyerWatson::Result | visualize_delaunay (Tikz_Plane &plane, const DynList< Point > &points, const DelaunayTriangulationBowyerWatson &algorithm={}, const Tikz_Style &triangle_style=tikz_wire_style("blue"), const bool draw_sites=true, const Tikz_Style &site_style=tikz_points_style("black")) |
| Compute and insert Delaunay triangulation as triangle outlines. | |
| Point | ray_endpoint (const Point &src, const Point &direction, const Geom_Number &length) |
| template<typename VoronoiResult > | |
| void | put_voronoi_result (Tikz_Plane &plane, const VoronoiResult &vor, const bool draw_cells=false, const Tikz_Style &cell_style=tikz_area_style("gray!50!black", "gray!15", 0.35), const Tikz_Style &edge_style=tikz_wire_style("black"), const Tikz_Style &unbounded_edge_style=tikz_wire_style("black", true, true), const Tikz_Style &site_style=tikz_points_style("red"), const Geom_Number &unbounded_ray_length=Geom_Number(50), const int cell_layer=Tikz_Plane::Layer_Background, const int edge_layer=Tikz_Plane::Layer_Default, const int site_layer=Tikz_Plane::Layer_Foreground) |
| Insert Voronoi diagram structures (cells, edges, sites). | |
| VoronoiDiagram::Result | visualize_voronoi (Tikz_Plane &plane, const DynList< Point > &sites, const VoronoiDiagram &algorithm={}, const bool draw_cells=false, const Tikz_Style &cell_style=tikz_area_style("gray!50!black", "gray!15", 0.35), const Tikz_Style &edge_style=tikz_wire_style("black"), const Tikz_Style &unbounded_edge_style=tikz_wire_style("black", true, true), const Tikz_Style &site_style=tikz_points_style("red"), const Geom_Number &unbounded_ray_length=Geom_Number(50)) |
| Compute and insert Voronoi diagram for input sites. | |
| void | put_power_diagram_result (Tikz_Plane &plane, const PowerDiagram::Result &pd, const bool draw_cells=true, const Tikz_Style &cell_style=tikz_area_style("violet", "violet!18", 0.35), const Tikz_Style &edge_style=tikz_wire_style("violet"), const Tikz_Style &site_style=tikz_points_style("purple"), const int cell_layer=Tikz_Plane::Layer_Background, const int edge_layer=Tikz_Plane::Layer_Default, const int site_layer=Tikz_Plane::Layer_Foreground) |
| Insert Power diagram structures (cells, edges, weighted sites). | |
| PowerDiagram::Result | visualize_power_diagram (Tikz_Plane &plane, const Array< PowerDiagram::WeightedSite > &sites, const PowerDiagram &algorithm={}, const bool draw_cells=true, const Tikz_Style &cell_style=tikz_area_style("violet", "violet!18", 0.35), const Tikz_Style &edge_style=tikz_wire_style("violet"), const Tikz_Style &site_style=tikz_points_style("purple")) |
| Compute and insert Power diagram for weighted sites. | |
| void | put_segment_arrangement_result (Tikz_Plane &plane, const SegmentArrangement::Result &arrangement, const bool draw_faces=true, const bool draw_vertices=true, const bool draw_unbounded_face=false, const Tikz_Style &face_style=tikz_area_style("teal!60!black", "teal!12", 0.30), const Tikz_Style &edge_style=tikz_wire_style("teal!70!black"), const Tikz_Style &vertex_style=tikz_points_style("teal!70!black"), const int face_layer=Tikz_Plane::Layer_Background, const int edge_layer=Tikz_Plane::Layer_Default, const int vertex_layer=Tikz_Plane::Layer_Foreground, const bool color_faces_by_index=false) |
| Insert segment arrangement structures (faces, edges, vertices). | |
| SegmentArrangement::Result | visualize_segment_arrangement (Tikz_Plane &plane, const Array< Segment > &segments, const SegmentArrangement &algorithm={}, const bool draw_faces=true, const bool draw_vertices=true, const bool draw_unbounded_face=false, const Tikz_Style &face_style=tikz_area_style("teal!60!black", "teal!12", 0.30), const Tikz_Style &edge_style=tikz_wire_style("teal!70!black"), const Tikz_Style &vertex_style=tikz_points_style("teal!70!black"), const bool color_faces_by_index=false) |
| Compute and insert arrangement for input segments. | |
| void | put_kdtree_partitions_result (Tikz_Plane &plane, const KDTreePointSearch::DebugSnapshot &snapshot, const bool draw_partition_boxes=false, const bool draw_points=true, const Tikz_Style &partition_style=tikz_wire_style("gray!55", true), const Tikz_Style &split_style=tikz_wire_style("blue!70"), const Tikz_Style &point_style=tikz_points_style("red"), const int partition_layer=Tikz_Plane::Layer_Background, const int split_layer=Tikz_Plane::Layer_Default, const int point_layer=Tikz_Plane::Layer_Foreground) |
| Draw KD-tree partitions from a debug snapshot. | |
| KDTreePointSearch::DebugSnapshot | visualize_kdtree_partitions (Tikz_Plane &plane, const KDTreePointSearch &kd_tree, const bool draw_partition_boxes=false, const bool draw_points=true, const Tikz_Style &partition_style=tikz_wire_style("gray!55", true), const Tikz_Style &split_style=tikz_wire_style("blue!70"), const Tikz_Style &point_style=tikz_points_style("red")) |
| Visualize KD-tree recursive space partitions. | |
| void | put_range_tree_result (Tikz_Plane &plane, const RangeTree2D::DebugSnapshot &snapshot, const bool draw_points=true, const Rectangle *query_rect=nullptr, const DynList< Point > *query_hits=nullptr, const Tikz_Style &split_style=tikz_wire_style("purple"), const Tikz_Style &point_style=tikz_points_style("black"), const Tikz_Style &query_rect_style=tikz_wire_style("red", true), const Tikz_Style &query_hit_style=tikz_points_style("red"), const int split_layer=Tikz_Plane::Layer_Default, const int point_layer=Tikz_Plane::Layer_Foreground) |
| Draw range-tree X-axis hierarchy and optional query highlights. | |
| RangeTree2D::DebugSnapshot | visualize_range_tree (Tikz_Plane &plane, const RangeTree2D &tree, const bool draw_points=true, const Tikz_Style &split_style=tikz_wire_style("purple"), const Tikz_Style &point_style=tikz_points_style("black")) |
| Visualize range-tree structure without a query overlay. | |
| RangeTreeQueryVizResult | visualize_range_tree_query (Tikz_Plane &plane, const RangeTree2D &tree, const Rectangle &query_rect, const bool draw_points=true, const Tikz_Style &split_style=tikz_wire_style("purple"), const Tikz_Style &point_style=tikz_points_style("black"), const Tikz_Style &query_rect_style=tikz_wire_style("red", true), const Tikz_Style &query_hit_style=tikz_points_style("red")) |
| Visualize range-tree plus a query rectangle and matching points. | |
| void | put_aabb_tree_result (Tikz_Plane &plane, const AABBTree::DebugSnapshot &snapshot, const Rectangle *query_rect=nullptr, const Array< size_t > *query_hit_ids=nullptr, const Tikz_Style &node_bbox_style=tikz_wire_style("teal!70!black"), const Tikz_Style &leaf_bbox_style=tikz_wire_style("blue!70"), const Tikz_Style &query_rect_style=tikz_wire_style("red", true), const Tikz_Style &query_hit_style=tikz_wire_style("red"), const int node_layer=Tikz_Plane::Layer_Default, const int query_layer=Tikz_Plane::Layer_Foreground) |
| Draw AABB tree hierarchy and optional query results. | |
| AABBTree::DebugSnapshot | visualize_aabb_tree (Tikz_Plane &plane, const AABBTree &tree, const Tikz_Style &node_bbox_style=tikz_wire_style("teal!70!black"), const Tikz_Style &leaf_bbox_style=tikz_wire_style("blue!70")) |
| Visualize AABB tree hierarchy. | |
| AABBTreeQueryVizResult | visualize_aabb_tree_query (Tikz_Plane &plane, const AABBTree &tree, const Rectangle &query_rect, const Tikz_Style &node_bbox_style=tikz_wire_style("teal!70!black"), const Tikz_Style &leaf_bbox_style=tikz_wire_style("blue!70"), const Tikz_Style &query_rect_style=tikz_wire_style("red", true), const Tikz_Style &query_hit_style=tikz_wire_style("red")) |
| Visualize AABB tree with a rectangle query overlay. | |
| template<typename Snapshot > | |
| void | put_rtree_result (Tikz_Plane &plane, const Snapshot &snapshot, const Rectangle *query_rect=nullptr, const Array< Rectangle > *query_hit_boxes=nullptr, const Tikz_Style &node_bbox_style=tikz_wire_style("teal!70!black"), const Tikz_Style &leaf_bbox_style=tikz_wire_style("blue!70"), const Tikz_Style &entry_bbox_style=tikz_wire_style("gray!55"), const Tikz_Style &query_rect_style=tikz_wire_style("red", true), const Tikz_Style &query_hit_style=tikz_wire_style("red"), const int node_layer=Tikz_Plane::Layer_Default, const int entry_layer=Tikz_Plane::Layer_Default, const int query_layer=Tikz_Plane::Layer_Foreground) |
| Draw every node MBR (colored by depth) of an R-tree/R*-tree snapshot, plus its leaf entry boxes, an optional query rectangle, and its optional hit boxes. | |
| template<typename Payload , size_t MaxEntries, size_t MinEntries, RTreeVariant Variant> | |
| RTree< Payload, MaxEntries, MinEntries, Variant >::DebugSnapshot | visualize_rtree (Tikz_Plane &plane, const RTree< Payload, MaxEntries, MinEntries, Variant > &tree, const Tikz_Style &node_bbox_style=tikz_wire_style("teal!70!black"), const Tikz_Style &leaf_bbox_style=tikz_wire_style("blue!70"), const Tikz_Style &entry_bbox_style=tikz_wire_style("gray!55")) |
| Visualize an R-tree/R*-tree hierarchy (node MBRs by depth, plus leaf entry boxes). | |
| template<typename Payload , size_t MaxEntries, size_t MinEntries, RTreeVariant Variant> | |
| RTreeQueryVizResult< Payload, MaxEntries, MinEntries, Variant > | visualize_rtree_query (Tikz_Plane &plane, const RTree< Payload, MaxEntries, MinEntries, Variant > &tree, const Rectangle &query_rect, const Tikz_Style &node_bbox_style=tikz_wire_style("teal!70!black"), const Tikz_Style &leaf_bbox_style=tikz_wire_style("blue!70"), const Tikz_Style &entry_bbox_style=tikz_wire_style("gray!55"), const Tikz_Style &query_rect_style=tikz_wire_style("red", true), const Tikz_Style &query_hit_style=tikz_wire_style("red")) |
Visualize an R-tree/R*-tree with a rectangle query overlay, highlighting every entry whose bbox intersects query_rect. | |
| void | put_path (Tikz_Plane &plane, const DynList< Point > &path, const Tikz_Style &segment_style=tikz_path_style("red"), const bool draw_waypoints=true, const Tikz_Style &waypoint_style=tikz_points_style("red"), const int segment_layer=Tikz_Plane::Layer_Foreground, const int waypoint_layer=Tikz_Plane::Layer_Overlay) |
| Insert a point path as connected segments and optional waypoints. | |
| void | put_path (Tikz_Plane &plane, const Array< Point > &path, const Tikz_Style &segment_style=tikz_path_style("red"), const bool draw_waypoints=true, const Tikz_Style &waypoint_style=tikz_points_style("red"), const int segment_layer=Tikz_Plane::Layer_Foreground, const int waypoint_layer=Tikz_Plane::Layer_Overlay) |
Insert an Array<Point> path as connected segments and waypoints. | |
| void | put_portals (Tikz_Plane &plane, const Array< FunnelPortal > &portals, const bool skip_degenerate=true, const Tikz_Style &portal_style=tikz_wire_style("purple", true), const int portal_layer=Tikz_Plane::Layer_Default) |
| Insert funnel portals as segment connectors. | |
| FunnelTraceResult | compute_shortest_path_funnel_trace (const Polygon &polygon, const Point &source, const Point &target) |
| Compute a full SSFA trace (portal-by-portal states). | |
| void | put_funnel_trace_step (Tikz_Plane &plane, const Polygon &polygon, const Point &source, const Point &target, const FunnelTraceResult &trace, size_t step_index, const Tikz_Style &polygon_style=tikz_area_style("black", "gray!15", 0.22), const Tikz_Style &source_style=tikz_points_style("green!50!black"), const Tikz_Style &target_style=tikz_points_style("blue"), const Tikz_Style &all_portals_style=tikz_wire_style("purple", true), const Tikz_Style &active_portal_style=tikz_path_style("purple"), const Tikz_Style &funnel_leg_style=tikz_path_style("orange!90!black"), const Tikz_Style &committed_style=tikz_path_style("red"), const bool draw_waypoints=true, const Tikz_Style &waypoint_style=tikz_points_style("red"), const int polygon_layer=Tikz_Plane::Layer_Default, const int portal_layer=Tikz_Plane::Layer_Foreground, const int highlight_layer=Tikz_Plane::Layer_Overlay) |
| Render one funnel-trace frame in a plane. | |
| DynList< Point > | visualize_shortest_path_in_polygon (Tikz_Plane &plane, const Polygon &polygon, const Point &source, const Point &target, const ShortestPathInPolygon &algorithm={}, const Tikz_Style &polygon_style=tikz_area_style("black", "gray!15", 0.25), const Tikz_Style &source_style=tikz_points_style("green!50!black"), const Tikz_Style &target_style=tikz_points_style("blue"), const Tikz_Style &path_style=tikz_path_style("red"), const bool draw_waypoints=true, const Tikz_Style &waypoint_style=tikz_points_style("red"), const int polygon_layer=Tikz_Plane::Layer_Default, const int path_layer=Tikz_Plane::Layer_Foreground) |
| Visualize the shortest path inside a simple polygon. | |
| ShortestPathDebugResult | visualize_shortest_path_with_portals (Tikz_Plane &plane, const Polygon &polygon, const Point &source, const Point &target, const ShortestPathInPolygon &algorithm={}, const Tikz_Style &polygon_style=tikz_area_style("black", "gray!15", 0.25), const Tikz_Style &source_style=tikz_points_style("green!50!black"), const Tikz_Style &target_style=tikz_points_style("blue"), const Tikz_Style &portal_style=tikz_wire_style("purple", true), const Tikz_Style &path_style=tikz_path_style("red"), const bool draw_waypoints=true, const Tikz_Style &waypoint_style=tikz_points_style("red"), const int polygon_layer=Tikz_Plane::Layer_Default, const int portal_layer=Tikz_Plane::Layer_Foreground, const int path_layer=Tikz_Plane::Layer_Overlay) |
| Visualize the shortest path plus funnel portals. | |
| void | put_convex_decomposition_result (Tikz_Plane &plane, const Array< Polygon > &parts, const bool color_parts_by_index=true, const Tikz_Style &part_style=tikz_area_style("blue!60!black", "blue!15", 0.40), const int part_layer=Tikz_Plane::Layer_Default) |
| Insert convex decomposition polygons. | |
| Array< Polygon > | visualize_convex_decomposition (Tikz_Plane &plane, const Polygon &polygon, const ConvexPolygonDecomposition &algorithm={}, const bool draw_input_polygon=true, const Tikz_Style &input_style=tikz_wire_style("black", true), const bool color_parts_by_index=true, const Tikz_Style &part_style=tikz_area_style("blue!60!black", "blue!15", 0.40), const int input_layer=Tikz_Plane::Layer_Default, const int part_layer=Tikz_Plane::Layer_Foreground) |
| Compute and insert convex decomposition for a polygon. | |
| void | put_alpha_shape_result (Tikz_Plane &plane, const AlphaShape::Result &alpha_shape, const bool draw_kept_triangles=false, const Tikz_Style &triangle_style=tikz_wire_style("gray!55"), const Tikz_Style &boundary_style=tikz_path_style("orange!90!black"), const bool draw_sites=true, const Tikz_Style &site_style=tikz_points_style("black"), const int triangle_layer=Tikz_Plane::Layer_Background, const int boundary_layer=Tikz_Plane::Layer_Foreground, const int site_layer=Tikz_Plane::Layer_Overlay) |
| Insert alpha-shape structures (kept triangles, boundary, sites). | |
| AlphaShape::Result | visualize_alpha_shape (Tikz_Plane &plane, const DynList< Point > &points, const Geom_Number &alpha_squared, const AlphaShape &algorithm={}, const bool draw_kept_triangles=false, const Tikz_Style &triangle_style=tikz_wire_style("gray!55"), const Tikz_Style &boundary_style=tikz_path_style("orange!90!black"), const bool draw_sites=true, const Tikz_Style &site_style=tikz_points_style("black")) |
| Compute and insert alpha-shape for input points. | |
| void | put_regular_triangulation_result (Tikz_Plane &plane, const RegularTriangulationBowyerWatson::Result &rt, const Tikz_Style &triangle_style=tikz_wire_style("blue!60"), const bool draw_sites=true, const Tikz_Style &site_style=tikz_points_style("black"), const int triangle_layer=Tikz_Plane::Layer_Default, const int site_layer=Tikz_Plane::Layer_Foreground) |
| Draw regular (weighted Delaunay) triangulation output. | |
| RegularTriangulationBowyerWatson::Result | visualize_regular_triangulation (Tikz_Plane &plane, const Array< RegularTriangulationBowyerWatson::WeightedSite > &weighted_sites, const RegularTriangulationBowyerWatson &algorithm={}, const Tikz_Style &triangle_style=tikz_wire_style("blue!60"), const bool draw_sites=true, const Tikz_Style &site_style=tikz_points_style("black")) |
| Compute and insert regular (weighted Delaunay) triangulation. | |
| void | put_closest_pair_result (Tikz_Plane &plane, const DynList< Point > &points, const ClosestPairDivideAndConquer::Result &result, const Tikz_Style &points_style=tikz_points_style("black"), const Tikz_Style &pair_style=tikz_path_style("red"), const Tikz_Style &pair_points_style=tikz_points_style("red"), const int points_layer=Tikz_Plane::Layer_Default, const int pair_layer=Tikz_Plane::Layer_Foreground) |
| Draw closest-pair result over the full point set. | |
| ClosestPairDivideAndConquer::Result | visualize_closest_pair (Tikz_Plane &plane, const DynList< Point > &points, const ClosestPairDivideAndConquer &algorithm={}, const Tikz_Style &points_style=tikz_points_style("black"), const Tikz_Style &pair_style=tikz_path_style("red"), const Tikz_Style &pair_points_style=tikz_points_style("red")) |
| Compute and draw the closest pair from an input point set. | |
| void | put_rotating_calipers_result (Tikz_Plane &plane, const Polygon &polygon, const RotatingCalipersResult &result, const Tikz_Style &polygon_style=tikz_wire_style("gray!55"), const Tikz_Style &diameter_style=tikz_path_style("red"), const Tikz_Style &width_style=tikz_path_style("blue"), const Tikz_Style &witness_style=tikz_points_style("orange!90!black"), const int polygon_layer=Tikz_Plane::Layer_Default, const int witness_layer=Tikz_Plane::Layer_Foreground) |
| Draw diameter and minimum-width witnesses for a convex polygon. | |
| RotatingCalipersResult | visualize_rotating_calipers (Tikz_Plane &plane, const Polygon &polygon, const Tikz_Style &polygon_style=tikz_wire_style("gray!55"), const Tikz_Style &diameter_style=tikz_path_style("red"), const Tikz_Style &width_style=tikz_path_style("blue"), const Tikz_Style &witness_style=tikz_points_style("orange!90!black")) |
| Compute and draw rotating-calipers diameter and minimum width. | |
| void | put_half_plane_intersection_result (Tikz_Plane &plane, const Array< HalfPlaneIntersection::HalfPlane > &halfplanes, const Polygon &intersection, const Tikz_Style &boundary_style=tikz_wire_style("gray!60", true, true), const Tikz_Style &result_style=tikz_area_style("red", "red!25", 0.50), const int boundary_layer=Tikz_Plane::Layer_Default, const int result_layer=Tikz_Plane::Layer_Foreground) |
| Draw half-plane boundaries and their bounded intersection polygon. | |
| Polygon | visualize_half_plane_intersection (Tikz_Plane &plane, const Array< HalfPlaneIntersection::HalfPlane > &halfplanes, const HalfPlaneIntersection &algorithm={}, const Tikz_Style &boundary_style=tikz_wire_style("gray!60", true, true), const Tikz_Style &result_style=tikz_area_style("red", "red!25", 0.50)) |
| Compute and draw bounded half-plane intersection. | |
| void | put_minkowski_sum_result (Tikz_Plane &plane, const Polygon &first, const Polygon &second, const Polygon &result, const Tikz_Style &first_style=tikz_area_style("blue", "blue!14", 0.30), const Tikz_Style &second_style=tikz_area_style("green!60!black", "green!16", 0.30), const Tikz_Style &result_style=tikz_area_style("red", "red!26", 0.60), const int input_layer=Tikz_Plane::Layer_Default, const int result_layer=Tikz_Plane::Layer_Foreground) |
| Draw input polygons and their Minkowski sum result. | |
| Polygon | visualize_minkowski_sum (Tikz_Plane &plane, const Polygon &first, const Polygon &second, const MinkowskiSumConvex &algorithm={}, const Tikz_Style &first_style=tikz_area_style("blue", "blue!14", 0.30), const Tikz_Style &second_style=tikz_area_style("green!60!black", "green!16", 0.30), const Tikz_Style &result_style=tikz_area_style("red", "red!26", 0.60)) |
| Compute and draw Minkowski sum of two convex polygons. | |
| void | put_monotone_triangulation_result (Tikz_Plane &plane, const Polygon &polygon, const DynList< Triangle > &triangles, const Tikz_Style &polygon_style=tikz_wire_style("black"), const Tikz_Style &triangle_style=tikz_wire_style("blue!65"), const int polygon_layer=Tikz_Plane::Layer_Default, const int triangle_layer=Tikz_Plane::Layer_Foreground) |
| Draw a monotone triangulation result plus polygon boundary. | |
| DynList< Triangle > | visualize_monotone_triangulation (Tikz_Plane &plane, const Polygon &polygon, const MonotonePolygonTriangulation &algorithm={}, const Tikz_Style &polygon_style=tikz_wire_style("black"), const Tikz_Style &triangle_style=tikz_wire_style("blue!65")) |
| Compute and draw triangulation via monotone partition pipeline. | |
| void | put_visibility_polygon_result (Tikz_Plane &plane, const Polygon &polygon, const Point &query_point, const Polygon &visibility_polygon, const Tikz_Style &polygon_style=tikz_wire_style("black"), const Tikz_Style &visibility_style=tikz_area_style("orange!90!black", "orange!25", 0.50), const Tikz_Style &query_style=tikz_points_style("red"), const int polygon_layer=Tikz_Plane::Layer_Default, const int visibility_layer=Tikz_Plane::Layer_Foreground) |
| Draw visibility polygon with source polygon and query point. | |
| Polygon | visualize_visibility_polygon (Tikz_Plane &plane, const Polygon &polygon, const Point &query_point, const VisibilityPolygon &algorithm={}, const Tikz_Style &polygon_style=tikz_wire_style("black"), const Tikz_Style &visibility_style=tikz_area_style("orange!90!black", "orange!25", 0.50), const Tikz_Style &query_style=tikz_points_style("red")) |
| Compute and draw visibility polygon from a query point. | |
| void | put_line_sweep_result (Tikz_Plane &plane, const Array< Segment > &segments, const Array< SweepLineSegmentIntersection::Intersection > &intersections, const Tikz_Style &segment_style=tikz_wire_style("blue!60"), const Tikz_Style &intersection_style=tikz_points_style("red"), const int segment_layer=Tikz_Plane::Layer_Default, const int intersection_layer=Tikz_Plane::Layer_Foreground) |
| Draw line segments and all sweep-line intersection points. | |
| Array< SweepLineSegmentIntersection::Intersection > | visualize_line_sweep (Tikz_Plane &plane, const Array< Segment > &segments, const SweepLineSegmentIntersection &algorithm={}, const Tikz_Style &segment_style=tikz_wire_style("blue!60"), const Tikz_Style &intersection_style=tikz_points_style("red")) |
| Compute and draw Bentley-Ottmann line-sweep intersections. | |
| void | put_cdt_result (Tikz_Plane &plane, const ConstrainedDelaunayTriangulation::Result &cdt, const Tikz_Style &triangle_style=tikz_wire_style("blue!60"), const Tikz_Style &constraint_style=tikz_path_style("red"), const bool draw_sites=true, const Tikz_Style &site_style=tikz_points_style("black"), const int triangle_layer=Tikz_Plane::Layer_Default, const int constraint_layer=Tikz_Plane::Layer_Foreground, const int site_layer=Tikz_Plane::Layer_Overlay) |
| Insert constrained Delaunay triangulation result. | |
| ConstrainedDelaunayTriangulation::Result | visualize_cdt (Tikz_Plane &plane, const DynList< Point > &points, const DynList< Segment > &constraints, const ConstrainedDelaunayTriangulation &algorithm={}, const Tikz_Style &triangle_style=tikz_wire_style("blue!60"), const Tikz_Style &constraint_style=tikz_path_style("red"), const bool draw_sites=true, const Tikz_Style &site_style=tikz_points_style("black")) |
| Compute and insert constrained Delaunay triangulation. | |
| void | put_mec_result (Tikz_Plane &plane, const MinimumEnclosingCircle::Circle &circle, const DynList< Point > &points, const Tikz_Style &circle_style=tikz_wire_style("blue!70"), const bool draw_sites=true, const Tikz_Style &site_style=tikz_points_style("black"), const int circle_layer=Tikz_Plane::Layer_Default, const int site_layer=Tikz_Plane::Layer_Overlay) |
| Draw a precomputed minimum enclosing circle result. | |
| MinimumEnclosingCircle::Circle | visualize_mec (Tikz_Plane &plane, const DynList< Point > &points, const MinimumEnclosingCircle &algorithm={}, const Tikz_Style &circle_style=tikz_wire_style("blue!70"), const bool draw_sites=true, const Tikz_Style &site_style=tikz_points_style("black")) |
Compute minimum enclosing circle and insert into plane. | |
| void | put_simplification_result (Tikz_Plane &plane, const Polygon &original, const Polygon &simplified, const Tikz_Style &original_style=tikz_wire_style("gray!50"), const Tikz_Style &simplified_style=tikz_bold_wire_style("blue!80"), const bool draw_vertices=true, const Tikz_Style &vertex_style=tikz_points_style("red")) |
| Draw original and simplified polygons overlaid. | |
| Polygon | visualize_douglas_peucker (Tikz_Plane &plane, const Polygon &poly, const Geom_Number &epsilon, const DouglasPeuckerSimplification &algorithm={}, const Tikz_Style &original_style=tikz_wire_style("gray!50"), const Tikz_Style &simplified_style=tikz_bold_wire_style("blue!80"), const bool draw_vertices=true, const Tikz_Style &vertex_style=tikz_points_style("red")) |
| Simplify a polygon with Douglas-Peucker and draw the result. | |
| Polygon | visualize_visvalingam_whyatt (Tikz_Plane &plane, const Polygon &poly, const Geom_Number &area_threshold, const VisvalingamWhyattSimplification &algorithm={}, const Tikz_Style &original_style=tikz_wire_style("gray!50"), const Tikz_Style &simplified_style=tikz_bold_wire_style("green!70!black"), const bool draw_vertices=true, const Tikz_Style &vertex_style=tikz_points_style("red")) |
| Simplify a polygon with Visvalingam-Whyatt and draw the result. | |
| void | put_offset_result (Tikz_Plane &plane, const Polygon &original, const PolygonOffset::Result &result, const Tikz_Style &original_style=tikz_wire_style("gray!50"), const Tikz_Style &offset_style=tikz_bold_wire_style("blue!80"), const bool draw_vertices=true, const Tikz_Style &vertex_style=tikz_points_style("red")) |
| Draw a polygon offset result overlaid on the original polygon. | |
| PolygonOffset::Result | visualize_polygon_offset (Tikz_Plane &plane, const Polygon &poly, const Geom_Number &distance, const PolygonOffset &algorithm={}, PolygonOffset::JoinType join=PolygonOffset::JoinType::Miter, const Geom_Number &miter_limit=Geom_Number(2), const Tikz_Style &original_style=tikz_wire_style("gray!50"), const Tikz_Style &offset_style=tikz_bold_wire_style("blue!80"), const bool draw_vertices=true, const Tikz_Style &vertex_style=tikz_points_style("red")) |
| Offset a polygon and draw the result. | |
| void | put_smoothing_result (Tikz_Plane &plane, const Polygon &original, const Polygon &smoothed, const Tikz_Style &original_style=tikz_wire_style("gray!50"), const Tikz_Style &smoothed_style=tikz_bold_wire_style("violet!80"), const bool draw_vertices=true, const Tikz_Style &vertex_style=tikz_points_style("red")) |
| Draw original and smoothed polygons overlaid. | |
| Polygon | visualize_chaikin_smoothing (Tikz_Plane &plane, const Polygon &poly, const size_t iterations, const Geom_Number &ratio=Geom_Number(1, 4), const Tikz_Style &original_style=tikz_wire_style("gray!50"), const Tikz_Style &smoothed_style=tikz_bold_wire_style("violet!80"), const bool draw_vertices=true, const Tikz_Style &vertex_style=tikz_points_style("red")) |
| Smooth a polygon with Chaikin subdivision and draw the result. | |
| void | put_trapezoidal_map_result (Tikz_Plane &plane, const TrapezoidalMapPointLocation::Result &res, const Tikz_Style &segment_style=tikz_path_style("red"), const Tikz_Style &extension_style=tikz_wire_style("gray!60", true), const bool draw_trapezoids=true, const double trapezoid_opacity=0.3, const int trap_layer=Tikz_Plane::Layer_Background, const int seg_layer=Tikz_Plane::Layer_Foreground, const int ext_layer=Tikz_Plane::Layer_Default) |
| Draw the trapezoidal map result into a Tikz_Plane. | |
| TrapezoidalMapPointLocation::Result | visualize_trapezoidal_map (Tikz_Plane &plane, const Array< Segment > &segments, const Tikz_Style &segment_style=tikz_path_style("red"), const Tikz_Style &extension_style=tikz_wire_style("gray!60", true), const bool draw_trapezoids=true, const double trapezoid_opacity=0.3) |
| Build a trapezoidal map and draw it. | |
| TrapezoidalMapPointLocation::Result | visualize_trapezoidal_map (Tikz_Plane &plane, const Polygon &polygon, const Tikz_Style &segment_style=tikz_path_style("red"), const Tikz_Style &extension_style=tikz_wire_style("gray!60", true), const bool draw_trapezoids=true, const double trapezoid_opacity=0.3) |
| Build a trapezoidal map from a polygon and draw it. | |
| template<typename T , typename... Args> | |
| Array< T > | build_array (Args &&... args) |
| template<class Container > | |
| std::vector< typename Container::Item_Type > | to_stdvector (const Container &c) |
| template<typename T , class Compare > | |
| T & | sift_up (T *ptr, const size_t l, const size_t r, Compare &cmp) |
Restore the heap property by moving the element at position r upwards. | |
| template<typename T , class Compare > | |
| void | sift_down (T *ptr, const size_t l, const size_t r, Compare &cmp) |
Restore the heap property by moving the element at position l downwards. | |
| template<typename T , class Compare > | |
| void | sift_down_up (T *ptr, const size_t l, const size_t i, const size_t r, Compare &cmp) |
| Restore the heap property by sifting down and then sifting up. | |
| template<typename T , class Compare = Aleph::less<T>> requires StrictWeakOrder<Compare, T> | |
| constexpr void | heapsort (T *array, const size_t n, const Compare &cmp=Compare()) |
| Sort an array using the heapsort algorithm. | |
| template<typename T , class Compare = Aleph::less<T>> requires StrictWeakOrder<Compare, T> | |
| constexpr void | faster_heapsort (T *array, const size_t n, const Compare &cmp=Compare()) |
| Optimized version of heapsort. | |
| template<typename T , class Compare = Aleph::less<T>> requires StrictWeakOrder<Compare, T> | |
| bool | valid_heap (T *array, const size_t l, const size_t r, const Compare &cmp=Compare()) |
| Check whether a range satisfies the heap property. | |
| template<class Node > | |
| Node * | select_gotoup_root (Node *root, const size_t &i) |
| Select a node of a binary tree by its inorder position and make it the root. | |
| template<class Node > | |
| Node * | balance_tree (Node *root) |
| Rebalance a binary search tree. | |
| template<class Node > | |
| constexpr Node *& | LLINK (Node *p) noexcept |
| Return a pointer to left subtree. | |
| template<class Node > | |
| constexpr const Node * | LLINK (const Node *p) noexcept |
| template<class Node > | |
| constexpr Node *& | RLINK (Node *p) noexcept |
| Return the right tree of p. | |
| template<class Node > | |
| constexpr const Node * | RLINK (const Node *p) noexcept |
| template<class Node > | |
| constexpr Node::Key_Type & | KEY (Node *p) noexcept |
| Return a modifiable reference to the key stored in the node. | |
| template<class Node > | |
| constexpr const Node::Key_Type & | KEY (const Node *p) noexcept |
| template<class Node > | |
| Aleph::Generator< Node * > | lazy_in_order (Node *root) |
| Lazily traverse a binary tree in-order (left, node, right). | |
| template<class Node > | |
| Aleph::Generator< Node * > | lazy_pre_order (Node *root) |
| Lazily traverse a binary tree pre-order (node, left, right). | |
| template<class Node > | |
| Aleph::Generator< Node * > | lazy_post_order (Node *root) |
| Lazily traverse a binary tree post-order (left, right, node). | |
| template<BinNodeLike Node> | |
| void | assert_valid_tree_root (const Node *root) noexcept |
Debug-only check that root is a valid tree for Node. | |
| template<BinNodeLike Node> | |
| void | inorder_rec_helper (Node *node, const int &level, int &position, void(*visitFct)(Node *, int, int)) |
| template<BinNodeLike Node> | |
| int | inOrderRec (Node *root, void(*visitFct)(Node *, int, int)) |
| Traverse recursively inorder a binary tree. | |
| template<BinNodeLike Node> | |
| void | preorder_rec_helper (Node *p, const int &level, int &position, void(*visitFct)(Node *, int, int)) |
| template<BinNodeLike Node> | |
| int | preOrderRec (Node *root, void(*visitFct)(Node *, int, int)) |
| Traverse recursively in preorder a binary tree. | |
| template<BinNodeLike Node> | |
| void | postorder_rec_helper (Node *node, const int &level, int &position, void(*visitFct)(Node *, int, int)) |
| template<BinNodeLike Node> | |
| int | postOrderRec (Node *root, void(*visitFct)(Node *, int, int)) |
| Traverse recursively in postorder a binary tree. | |
| template<BinNodeLike Node, class Op > | |
| void | for_each_in_order (Node *root, Op &&op) |
| Execute an operation in order sense for each node of tree. | |
| template<BinNodeLike Node, class Op > | |
| void | for_each_preorder (Node *root, Op &&op) |
| Execute an operation in preorder sense for each node of tree. | |
| template<BinNodeLike Node, class Op > | |
| void | for_each_postorder (Node *root, Op &&op) |
| Execute an operation in postorder sense for each node of tree. | |
| template<BinNodeLike Node> | |
| static void | prefix (Node *root, DynList< Node * > &acc) |
| template<BinNodeLike Node> | |
| static void | infix (Node *root, DynList< Node * > &acc) |
| template<BinNodeLike Node> | |
| static void | suffix (Node *root, DynList< Node * > &acc) |
| template<BinNodeLike Node> | |
| DynList< Node * > | prefix (Node *root) |
| Return a list with preorder traversal of a tree. | |
| template<BinNodeLike Node> | |
| DynList< Node * > | infix (Node *root) |
| Return a list with inorder traversal of a tree. | |
| template<BinNodeLike Node> | |
| DynList< Node * > | suffix (Node *root) |
| Return a list with postorder traversal of a tree. | |
| template<BinNodeLike Node> | |
| size_t | compute_cardinality_rec (Node *root) noexcept |
| Count the number of nodes of a binary tree. | |
| template<BinNodeLike Node> | |
| size_t | size (Node *root) noexcept |
See compute_cardinality_rec(Node * root). | |
| template<BinNodeLike Node> | |
| size_t | compute_height_with_stack (Node *root) noexcept |
| Compute the height of a tree with an explicit stack of pending subtrees. | |
| template<BinNodeLike Node> | |
| size_t | compute_height_bounded (Node *root, const size_t levels) noexcept |
| Compute the height of a tree by a recursion of bounded depth. | |
| template<BinNodeLike Node> | |
| size_t | computeHeightRec (Node *root) noexcept |
Compute the height of root | |
| template<BinNodeLike Node, class Dispose > | |
| void | dispose_tree_by_link_inversion (Node *root, Dispose &dispose) noexcept |
| Dispose of every node of a tree in postorder with \(O(1)\) additional memory. | |
| template<BinNodeLike Node, class Dispose > | |
| void | dispose_tree_nodes (Node *root, Dispose &dispose, const size_t levels=Bin_Tree_Depth_Bound) noexcept |
| Dispose of every node of a tree in postorder. | |
| template<BinNodeLike Node> | |
| void | destroyRec (Node *&root) noexcept |
Free all the memory occupied by the tree root | |
| template<BinNodeLike Node> | |
| void | callKeyDestructorsRec (Node *&root) noexcept |
| Traverses the tree and calls key's destructors. | |
| template<BinNodeLike Node> | |
| Node * | copyRec (Node *root) |
| Copy a tree. | |
| template<BinNodeLike Node> | |
| bool | areSimilar (Node *t1, Node *t2) noexcept |
Return true if both trees are similar. | |
| template<BinNodeLike Node, class Equal > | |
| bool | areEquivalents (Node *t1, Node *t2, Equal &op) noexcept |
Return true if trees are equivalents. | |
| template<BinNodeLike Node, class Equal = std::equal_to<typename Node::key_type>> | |
| bool | areEquivalents (Node *t1, Node *t2, Equal &&op=Equal()) noexcept |
See areEquivalents(Node * t1, Node * t2, Equal & op). | |
| template<BinNodeLike Node> | |
| void | levelOrder (Node *root, void(*visitFct)(Node *, int, bool)) |
| Traverse a binary tree by levels. | |
| template<BinNodeLike Node, class Operation > | |
| bool | level_traverse (Node *root, Operation &operation) |
| Level traverse a tree and execute an operation. | |
| template<BinNodeLike Node, class Operation > | |
| bool | level_traverse (Node *root, Operation &&operation) |
| template<template< class > class Node, typename Key > | |
| Node< Key > * | build_tree (const DynArray< Key > &preorder, long l_p, long r_p, const DynArray< Key > &inorder, long l_i, long r_i) |
| Build a binary tree form its preorder and inorder traversals. | |
| template<template< class > class Node, typename Key > | |
| Node< Key > * | build_postorder (const DynArray< Key > &post, long lp, long rp, const DynArray< Key > &in, long li, long ri) |
| template<BinNodeLike Node> | |
| void | compute_nodes_in_level_helper (Node *root, long level, const long current_level, DynDlist< Node * > &level_list) |
| template<BinNodeLike Node> | |
| DynDlist< Node * > | compute_nodes_in_level (Node *root, const int &level) |
| Count the number of nodes in a specific tree level. | |
| template<BinNodeLike Node> | |
| void | inOrderThreaded (Node *root, void(*visitFct)(Node *)) |
| Traverse inorder a binary tree without recursion and without stack. | |
| template<BinNodeLike Node> | |
| void | preOrderThreaded (Node *node, void(*visitFct)(Node *)) |
| Traverse preorder a binary tree without recursion and without stack. | |
| template<BinNodeLike Node> | |
| size_t | internal_path_length_helper (Node *p, const size_t &level) noexcept |
| template<BinNodeLike Node> | |
| size_t | internal_path_length (Node *p) noexcept |
| Compute the internal path length. | |
| template<BinNodeLike Node> | |
| void | tree_to_bits (Node *root, BitArray &array) |
| Compute a bit code for the binary tree. | |
| template<BinNodeLike Node> | |
| BitArray | tree_to_bits (Node *root) |
| Compute a bit code for the binary tree. | |
| template<BinNodeLike Node> | |
| std::string | code (Node *root) |
| Compute a string with the Lukasiewicz`s word of a tree. | |
| template<BinNodeLike Node> | |
| Node * | bits_to_tree_helper (const BitArray &array, int &i) |
| template<BinNodeLike Node> | |
| Node * | bits_to_tree (const BitArray &array, int idx=0) |
| Build a binary tree given its bits code. | |
| template<BinNodeLike Node> | |
| void | save_tree_keys_in_prefix (Node *root, std::ostream &output) |
| Store in output stream the tree keys in preorder. | |
| template<BinNodeLike Node> | |
| void | load_tree_keys_in_prefix (Node *root, std::istream &input) |
| Load the keys stored in preorder from an input stream. | |
| template<BinNodeLike Node> | |
| void | save_tree (Node *root, std::ostream &output) |
| Store a binary tree in a stream. | |
| template<BinNodeLike Node> | |
| Node * | load_tree (std::istream &input) |
| Load and build a binary tree from a stream. | |
| template<BinNodeLike Node, class Get_Key > | |
| void | put_tree_keys_in_array (Node *root, std::ostream &out) |
| template<BinNodeLike Node, class Load_Key > | |
| void | load_tree_keys_from_array (Node *root, const char *keys[], int &idx) |
| template<BinNodeLike Node, class Get_Key > | |
| void | save_tree_in_array_of_chars (Node *root, const std::string &array_name, std::ostream &output) |
| Generate C++ array declarations for a binary tree. | |
| template<BinNodeLike Node, class Load_Key > | |
| Node * | load_tree_from_array (const unsigned char bits[], const size_t &num_bits, const char *keys[]) |
| Build a binary tree from two arrays. | |
| template<BinNodeLike Node, class Compare > | |
| bool | check_bst_range (Node *p, const typename Node::key_type *min_key, const typename Node::key_type *max_key, const Compare &cmp) |
| template<BinNodeLike Node, class Compare = Aleph::less<typename Node::key_type>> | |
| bool | check_bst (Node *p, const Compare &cmp=Compare()) |
Return true if p is a binary search tree. | |
| template<BinNodeLike Node, class Compare = Aleph::less<typename Node::key_type>> | |
| Node * | preorder_to_bst (DynArray< typename Node::key_type > &preorder, int l, int r, const Compare &cmp=Compare()) |
| Build a binary search tree from its preorder traversal. | |
| template<typename T , class Compare = Aleph::less<T>> | |
| ThreeWayCmp | three_way_compare (const T &a, const T &b, const Compare &cmp=Compare()) noexcept(nothrow_compare_v< Compare, T >) |
| Three-way comparison using a binary comparator. | |
| template<BinNodeLike Node, class Compare = Aleph::less<typename Node::key_type>> | |
| Node * | searchInBinTree (Node *root, const typename Node::key_type &key, const Compare &cmp=Compare()) noexcept(nothrow_compare_v< Compare, typename Node::key_type >) |
| Search a key in a binary search tree using optimistic search. | |
| template<BinNodeLike Node> | |
| Node * | find_min (Node *root) noexcept |
| Return the minimum key contained in a binary search tree. | |
| template<BinNodeLike Node> | |
| Node * | find_max (Node *root) noexcept |
| Return the maximum key contained in a binary search tree. | |
| template<BinNodeLike Node> | |
| Node * | find_successor (Node *p, Node *&pp) noexcept |
Find the inorder successor of p | |
| template<BinNodeLike Node> | |
| Node * | find_predecessor (Node *p, Node *&pp) noexcept |
Find the inorder predecessor of p | |
| template<BinNodeLike Node, class Compare = Aleph::less<typename Node::key_type>> | |
| Node * | search_parent (Node *root, const typename Node::key_type &key, Node *&parent, const Compare &cmp=Compare()) noexcept(nothrow_compare_v< Compare, typename Node::key_type >) |
| Search a key and find its node and parent. | |
| template<BinNodeLike Node, class Compare = Aleph::less<typename Node::key_type>> | |
| Node * | search_rank_parent (Node *root, const typename Node::key_type &key, const Compare &cmp=Compare()) noexcept(nothrow_compare_v< Compare, typename Node::key_type >) |
| Rank search of a key in a binary search tree. | |
| template<BinNodeLike Node, class Compare = Aleph::less<typename Node::key_type>> | |
| Node * | insert_in_bst (Node *&r, Node *p, const Compare &cmp=Compare()) noexcept |
Insert a node p in a binary search tree. | |
| template<BinNodeLike Node, class Compare = Aleph::less<typename Node::key_type>> | |
| Node * | insert_dup_in_bst (Node *&root, Node *p, const Compare &cmp=Compare()) noexcept |
Insert a node p in a binary search tree. | |
| template<BinNodeLike Node, class Compare = Aleph::less<typename Node::key_type>> | |
| Node * | search_or_insert_in_bst (Node *&r, Node *p, const Compare &cmp=Compare()) noexcept |
| Search or insert a node in a binary search tree. | |
| template<BinNodeLike Node, class Compare > | |
| bool | split_key_rec_helper (Node *root, const typename Node::key_type &key, Node *&ts, Node *&tg, Compare &cmp) noexcept(nothrow_compare_v< Compare, typename Node::key_type >) |
| The recursion of split_key_rec(). | |
| template<BinNodeLike Node, class Compare = Aleph::less<typename Node::key_type>> | |
| bool | split_key_rec (Node *&root, const typename Node::key_type &key, Node *&ts, Node *&tg, const Compare &cmp=Compare()) noexcept(nothrow_compare_v< Compare, typename Node::key_type >) |
| Split recursively according to a key. | |
| template<BinNodeLike Node, class Compare > | |
| void | split_key_dup_rec_helper (Node *root, const typename Node::key_type &key, Node *&ts, Node *&tg, Compare &cmp) noexcept(nothrow_compare_v< Compare, typename Node::key_type >) |
| The recursion of split_key_dup_rec(). | |
| template<BinNodeLike Node, class Compare = Aleph::less<typename Node::key_type>> | |
| void | split_key_dup_rec (Node *&root, const typename Node::key_type &key, Node *&ts, Node *&tg, const Compare &cmp=Compare()) noexcept(nothrow_compare_v< Compare, typename Node::key_type >) |
| Split a tree according to a key value. | |
| template<BinNodeLike Node> | |
| Node * | join_exclusive (Node *&ts, Node *&tg) noexcept |
| Exclusive join of two binary trees. | |
| template<BinNodeLike Node, class Compare = Aleph::less<typename Node::key_type>> | |
| Node * | remove_from_bst (Node *&root, const typename Node::key_type &key, const Compare &cmp=Compare()) noexcept |
| Remove a key from a binary search tree. | |
| template<BinNodeLike Node, class Compare = Aleph::less<typename Node::key_type>> | |
| Node * | insert_root (Node *&root, Node *p, const Compare &cmp=Compare()) noexcept |
Insert the node p as root of a binary search tree. | |
| template<BinNodeLike Node, class Compare = Aleph::less<typename Node::key_type>> | |
| Node * | insert_dup_root (Node *&root, Node *p, const Compare &cmp=Compare()) noexcept |
Insert node p as root of a binary search tree. | |
| template<BinNodeLike Node, class Compare = Aleph::less<typename Node::key_type>> | |
| Node * | join_preorder (Node *t1, Node *t2, Node *&dup, const Compare &cmp=Compare()) noexcept |
| Union of two binary search trees. | |
| template<BinNodeLike Node, class Compare = Aleph::less<typename Node::key_type>> | |
| Node * | join (Node *t1, Node *t2, Node *&dup, const Compare &cmp=Compare()) noexcept |
| Fast union of two binary search trees. | |
| template<BinNodeLike Node> | |
| Node * | rotate_to_right (Node *p) noexcept |
Rotate to the right the tree with root p | |
| template<BinNodeLike Node> | |
| Node * | rotate_to_right (Node *p, Node *pp) noexcept |
Rotate to the right the tree with root p and update its parent. | |
| template<BinNodeLike Node> | |
| Node * | rotate_to_left (Node *p) noexcept |
Rotate to the left the tree with root p | |
| template<BinNodeLike Node> | |
| Node * | rotate_to_left (Node *p, Node *pp) noexcept |
Rotate to the left the tree with root p and update its parent. | |
| template<BinNodeLike Node, class Key , class Compare = Aleph::less<typename Node::key_type>> | |
| void | split_key (Node *&root, const Key &key, Node *&l, Node *&r, const Compare &cmp=Compare()) noexcept |
| Split a binary search tree according to a key. | |
| template<BinNodeLike Node> | |
| void | swap_node_with_successor (Node *p, Node *&pp, Node *q, Node *&pq) noexcept |
| Swap a node with its successor inorder. | |
| template<BinNodeLike Node> | |
| void | swap_node_with_predecessor (Node *p, Node *&pp, Node *q, Node *&pq) noexcept |
| Swap a node with its predecessor inorder. | |
| template<BinNodeLike Node, class Key = typename Node::key_type, class Compare = Aleph::less<typename Node::key_type>> | |
| Node * | insert_root_rec (Node *root, Node *p, const Compare &cmp=Compare()) noexcept |
| Insert a node as root in a binary search tree. | |
| template<BinNodeLike Node, class Key = typename Node::key_type, class Compare = Aleph::less<typename Node::key_type>> | |
| Node * | search_or_insert_root_rec (Node *root, Node *p, const Compare &cmp=Compare()) noexcept |
Search and eventually insert p as root in a binary search tree. | |
| template<BinNodeLike Node, class Op > | |
| bool | prefix_traverse (Node *root, Op op) |
| Traverse a tree in preorder via its iterator and performs a conditioned operation on each item. | |
| template<BinNodeLike Node, class Op > | |
| void | prefix_for_each (Node *root, Op op) |
| Traverse in preorder all the container and performs an operation on each element. | |
| template<BinNodeLike Node, class Op > | |
| bool | infix_traverse (Node *root, Op op) |
| Traverse a tree in inorder via its iterator and performs a conditioned operation on each item. | |
| template<BinNodeLike Node, class Op > | |
| bool | traverse (Node *root, Op op) |
See infix_traverse(). | |
| template<BinNodeLike Node, class Op > | |
| void | infix_for_each (Node *root, Op op) |
| Traverse all the container and performs an operation on each element. | |
| template<RankedBinNodeLike Node> | |
| auto & | COUNT (Node *p) noexcept |
Return the number of nodes of the tree fron p is root. | |
| template<RankedBinNodeLike Node> | |
| static Node * | __select_rec (Node *r, const size_t i) noexcept |
| template<RankedBinNodeLike Node> | |
| Node * | select_rec (Node *r, const size_t i) |
| Recursively select the i-th node inorder sense. | |
| template<RankedBinNodeLike Node> | |
| Node * | select_ne (Node *r, const size_t pos) noexcept |
| Iterative selection of a node according to inorder position without exception. | |
| template<RankedBinNodeLike Node> | |
| Node * | select (Node *r, const size_t pos) |
| Iterative selection of a node according to inorder position. | |
| template<RankedBinNodeLike Node> | |
| Node * | select (Node *root, const size_t pos, Node *&parent) |
| Iterative selection of a node according to inorder psoition and determination of parent of selected node. | |
| template<RankedBinNodeLike Node, class Compare > | |
| long | inorder_position (Node *r, const typename Node::key_type &key, Node *&p, Compare &cmp) noexcept(nothrow_compare_v< Compare, typename Node::key_type >) |
| Compute the inorder position of a key. | |
| template<BinNodeLike Node, class Compare = Aleph::less<typename Node::key_type>> | |
| long | inorder_position (Node *r, const typename Node::key_type &key, Node *&p, Compare &&cmp=Compare()) noexcept(nothrow_compare_v< Compare, typename Node::key_type >) |
See inorder_position(). | |
| template<BinNodeLike Node, class Compare > | |
| long | inorder_position (Node *r, const typename Node::key_type &key, Compare &cmp) noexcept(nothrow_compare_v< Compare, typename Node::key_type >) |
See inorder_position(). | |
| template<BinNodeLike Node, class Compare = Aleph::less<typename Node::key_type>> | |
| long | inorder_position (Node *r, const typename Node::key_type &key, Compare &&cmp=Compare()) noexcept(nothrow_compare_v< Compare, typename Node::key_type >) |
See inorder_position(). | |
| template<RankedBinNodeLike Node, class Compare = Aleph::less<typename Node::key_type>> | |
| long | find_position (Node *r, const typename Node::key_type &key, Node *&p, Compare &cmp) noexcept(nothrow_compare_v< Compare, typename Node::key_type >) |
| Find the inorder position of a key in an extended binary search tree. | |
| template<BinNodeLike Node, class Compare = Aleph::less<typename Node::key_type>> | |
| long | find_position (Node *r, const typename Node::key_type &key, Node *&p, Compare &&cmp=Compare()) noexcept(nothrow_compare_v< Compare, typename Node::key_type >) |
See find_position(). | |
| template<RankedBinNodeLike Node, class Compare > | |
| long | inorder_position_of_node (Node *r, Node *p, Compare &cmp) noexcept(nothrow_compare_v< Compare, typename Node::key_type >) |
The inorder position of the node p, in a tree that may have keys equivalent to that of p. | |
| template<RankedBinNodeLike Node, class Compare > | |
| Node * | insert_by_key_xt (Node *&r, Node *p, Compare &cmp) noexcept |
| Insert a node in an extended binary search tree. | |
| template<BinNodeLike Node, class Compare = Aleph::less<typename Node::key_type>> | |
| Node * | insert_by_key_xt (Node *&r, Node *p, Compare &&cmp=Compare()) noexcept |
See insert_by_key_xt(Node *& r, Node * p, Compare & cmp). | |
| template<RankedBinNodeLike Node, class Compare > | |
| Node * | insert_dup_by_key_xt (Node *&r, Node *p, Compare &cmp) noexcept |
| Insert a node in an extended binary search tree without testing for duplicity. | |
| template<BinNodeLike Node, class Compare = Aleph::less<typename Node::key_type>> | |
| Node * | insert_dup_by_key_xt (Node *&r, Node *p, Compare &&cmp=Compare()) noexcept |
See insert_dup_by_key_xt(Node *& r, Node * p, Compare & cmp). | |
| template<RankedBinNodeLike Node, class Compare > | |
| Node * | search_or_insert_by_key_xt (Node *&r, Node *p, Compare &cmp) noexcept |
| Search or insert a node in an extended binary search tree. | |
| template<BinNodeLike Node, class Compare = Aleph::less<typename Node::key_type>> | |
| Node * | search_or_insert_by_key_xt (Node *&r, Node *p, Compare &&cmp=Compare()) noexcept |
See search_or_insert_by_key_xt(Node *& r, Node * p, Compare & cmp). | |
| template<RankedBinNodeLike Node, class Compare > | |
| static bool | __split_key_rec_xt (Node *root, const typename Node::key_type &key, Node *&l, Node *&r, Compare &cmp) noexcept(nothrow_compare_v< Compare, typename Node::key_type >) |
| The recursion of split_key_rec_xt(). | |
| template<BinNodeLike Node, class Compare > | |
| bool | split_key_rec_xt (Node *&root, const typename Node::key_type &key, Node *&l, Node *&r, Compare &cmp) noexcept(nothrow_compare_v< Compare, typename Node::key_type >) |
| Split an extended binary search tree according to a key. | |
| template<BinNodeLike Node, class Compare = Aleph::less<typename Node::key_type>> | |
| bool | split_key_rec_xt (Node *&root, const typename Node::key_type &key, Node *&l, Node *&r, Compare &&cmp=Compare()) noexcept(nothrow_compare_v< Compare, typename Node::key_type >) |
| Split an extended binary search tree according to a key, with a temporary comparison criteria. | |
| template<RankedBinNodeLike Node, class Compare > | |
| static void | __split_key_dup_rec_xt (Node *root, const typename Node::key_type &key, Node *&l, Node *&r, Compare &cmp) noexcept(nothrow_compare_v< Compare, typename Node::key_type >) |
| The recursion of split_key_dup_rec_xt(). | |
| template<BinNodeLike Node, class Compare > | |
| void | split_key_dup_rec_xt (Node *&root, const typename Node::key_type &key, Node *&l, Node *&r, Compare &cmp) noexcept(nothrow_compare_v< Compare, typename Node::key_type >) |
| Split an extended binary search tree according to a key which can be in the tree. | |
| template<BinNodeLike Node, class Compare = Aleph::less<typename Node::key_type>> | |
| void | split_key_dup_rec_xt (Node *&root, const typename Node::key_type &key, Node *&l, Node *&r, Compare &&cmp=Compare()) noexcept(nothrow_compare_v< Compare, typename Node::key_type >) |
| Split an extended binary search tree according to a key which can be in the tree, with a temporary comparison criteria. | |
| template<RankedBinNodeLike Node, class Compare > | |
| Node * | insert_root_xt (Node *&root, Node *p, Compare &cmp) noexcept |
Insert a node p as root of an extended binary search tree. | |
| template<BinNodeLike Node, class Compare = Aleph::less<typename Node::key_type>> | |
| Node * | insert_root_xt (Node *&root, Node *p, Compare &&cmp=Compare()) noexcept |
See insert_root_xt(Node *& root, Node * p, Compare & cmp). | |
| template<RankedBinNodeLike Node, class Compare > | |
| Node * | insert_dup_root_xt (Node *&root, Node *p, Compare &cmp) noexcept |
| Insert a node as root of an extended binary search tree. | |
| template<BinNodeLike Node, class Compare = Aleph::less<typename Node::key_type>> | |
| Node * | insert_dup_root_xt (Node *&root, Node *p, Compare &&cmp=Compare()) noexcept |
See insert_dup_root_xt(Node *& root, Node * p, Compare & cmp). | |
| template<RankedBinNodeLike Node> | |
| static void | __split_pos_rec (Node *r, size_t i, Node *&ts, Node *&tg) noexcept |
| template<RankedBinNodeLike Node> | |
| void | split_pos_rec (Node *&r, const size_t i, Node *&ts, Node *&tg) |
| Split a extended binary tree according to a position. | |
| template<RankedBinNodeLike Node> | |
| void | insert_by_pos_xt (Node *&r, Node *p, size_t pos) |
| Insert a node in a specific inorder position in a binary tree. | |
| template<RankedBinNodeLike Node> | |
| Node * | join_exclusive_xt (Node *&ts, Node *&tg) noexcept |
| Exclusive union of two extended binary search trees. | |
| template<RankedBinNodeLike Node, class Compare = Aleph::less<typename Node::key_type>> | |
| Node * | remove_by_key_xt (Node *&root, const typename Node::key_type &key, Compare &cmp) noexcept |
| Remove a key of extended binary tree. | |
| template<BinNodeLike Node, class Compare = Aleph::less<typename Node::key_type>> | |
| Node * | remove_by_key_xt (Node *&root, const typename Node::key_type &key, Compare &&cmp=Compare()) noexcept |
See remove_by_key_xt(). | |
| template<RankedBinNodeLike Node> | |
| static Node * | __remove_by_pos_xt (Node *&root, size_t pos) noexcept |
| template<RankedBinNodeLike Node> | |
| Node * | remove_by_pos_xt (Node *&root, size_t pos) |
Remove from a extended binary tree the node whose inorder position is pos. | |
| template<RankedBinNodeLike Node> | |
| bool | check_rank_tree (Node *root) noexcept |
Return true if root is a valid extended binary tree. | |
| template<RankedBinNodeLike Node> | |
| Node * | rotate_to_right_xt (Node *p) noexcept |
Rotate to right the extended bianry tree with root p | |
| template<RankedBinNodeLike Node> | |
| Node * | rotate_to_left_xt (Node *p) noexcept |
Rotate to left the extended binary tree with root p. | |
| template<RankedBinNodeLike Node, class Key , class Compare > | |
| Node * | search_or_insert_root_rec_xt (Node *root, Node *p, Compare &cmp) noexcept |
| Search or insert a key in an extended binary search tree. | |
| template<BinNodeLike Node, class Key , class Compare = Aleph::less<typename Node::key_type>> | |
| Node * | search_or_insert_root_rec_xt (Node *root, Node *p, Compare &&cmp=Compare()) noexcept |
See search_or_insert_root_rec_xt(). | |
| template<AlephGraph GT> | |
| static long & | color (typename GT::Node *p) |
| template<AlephGraph GT> | |
| static long & | color (typename GT::Arc *a) |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| void | compute_bipartite (const GT &g, DynDlist< typename GT::Node * > &l, DynDlist< typename GT::Node * > &r, SA sa=SA()) |
| Computes the partition sets of a bipartite graph. | |
| template<AlephGraph GT, template< class > class Max_Flow = Ford_Fulkerson_Maximum_Flow, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| void | compute_maximum_cardinality_bipartite_matching (const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA()) |
| Computes the maximum cardinality matching of a bipartite graph. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| bool | compute_bipartite_all_components (const GT &g, DynDlist< typename GT::Node * > &l, DynDlist< typename GT::Node * > &r, SA sa=SA()) |
| Computes the partition sets of a bipartite graph handling all connected components. | |
| template<AlephGraph GT, ArcFilter< GT > SA> | |
| GT::Node * | hopcroft_karp_next (const GT &g, Hopcroft_Karp_Frame< GT, SA > &f, bool &free) noexcept(noexcept(f.it.next_ne())) |
| template<AlephGraph GT, ArcFilter< GT > SA> | |
| void | hopcroft_karp_match (const GT &g, Hopcroft_Karp_Frame< GT, SA > &f) noexcept |
| template<AlephGraph GT, ArcFilter< GT > SA> | |
| static bool | hopcroft_karp_dfs (const GT &g, typename GT::Node *u, Dfs_Stack< Hopcroft_Karp_Frame< GT, SA > > &frames, const SA &sa) |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| void | hopcroft_karp_matching (const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA()) |
| Computes a maximum cardinality matching on a bipartite graph using the Hopcroft-Karp algorithm. | |
| template<AlephGraph GT> | |
| Const_Graph_View< GT > | const_view (const GT &g) noexcept |
| Strict read-only view of a graph. | |
| template<AlephGraph GT> | |
| void | const_view (const GT &&)=delete |
| A view of a temporary graph would dangle. | |
| const char * | compiler_unify_result_kind_name (const Compiler_Unify_Result_Kind kind) noexcept |
| Returns a stable debug name for one unification result kind. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| DynList< typename GT::Arc * > | find_bridges (const GT &g, typename GT::Node *start, SA sa=SA()) |
| Find all bridge edges in a connected undirected graph. | |
| template<AlephGraph GT> | |
| DynList< typename GT::Arc * > | find_bridges (const GT &g) |
| Starts from the first node of the graph. | |
| template<class T , class... Args> | |
| Dfs_Here< T > | dfs_here (Args &&...args) |
| Builds the variable of the frame of a search, with the frame built with args. | |
| template<class T > | |
| T & | dfs_frame (T &here) noexcept |
| The frame that a Dfs_Here holds. | |
| template<class T > | |
| T & | dfs_frame (std::optional< T > &here) noexcept |
| The frame that a Dfs_Here holds. | |
| template<class T , class... Args> | |
| void | dfs_replace (T &here, Args &&...args) |
| Replaces the frame that a Dfs_Here holds with one built with args, by assignment. | |
| template<class T , class... Args> | |
| void | dfs_replace (std::optional< T > &here, Args &&...args) |
| Replaces the frame that a Dfs_Here holds with one built in its place with args. | |
| template<class It > | |
| decltype(auto) | dfs_curr (const It &it) |
| The current item of an iterator that has one. | |
| template<typename T , class Compare > | |
| size_t | sift_up (DynArray< T > &a, const size_t l, const size_t r, Compare &cmp) noexcept(Aleph::NothrowPredicateWith< Compare &, T &, T & >) |
| Restore heap order by moving an element up. | |
| template<typename T , class Compare > | |
| void | sift_down (DynArray< T > &a, const size_t l, const size_t r, Compare &cmp) noexcept(Aleph::NothrowPredicateWith< Compare &, T &, T & >) |
| Restore heap order by moving an element down. | |
| template<typename T , class Op , class C > | |
| DynMapTree< typename C::Item_Type, T > | map_unify (const C &c, Op op) |
| template<typename T , class Op , class C > | |
| DynSetTree< T > | set_unify (const C &c, Op op) |
| template<AlephGraph GT, NodeFilter< GT > SN = Dft_Show_Node<GT>, class Op > requires std::is_invocable_r_v<void, Op &, typename GT::Node *> | |
| void | for_each_node (const GT &g, Op operation, SN sn=SN()) |
| Traverse all the nodes of graph filtering some ones according to a condition and executing an operation on them. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>, class Op > requires std::is_invocable_r_v<void, Op &, typename GT::Arc *> | |
| void | for_each_arc (const GT &g, Op operation, SA sa=SA()) |
| Traverse all the arcs of graph filtering some ones according to a condition and executing an operation on them. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>, class Op > requires std::is_invocable_r_v<void, Op &, typename GT::Arc *> | |
| void | for_each_arc (const GT &g, typename GT::Node *p, Op operation, SA sa=SA()) |
| Traverse all the arcs adjacent to a node filtering some ones according to a condition and executing an operation on them. | |
| template<AlephGraph GT, NodeFilter< GT > SN = Dft_Show_Node<GT>, class Op > requires std::is_invocable_r_v<bool, Op &, typename GT::Node *> | |
| bool | forall_node (const GT &g, Op cond, SN sn=SN()) |
Return true if condition cond is met on every filtered node of the graph. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>, class Op > requires std::is_invocable_r_v<bool, Op &, typename GT::Arc *> | |
| bool | forall_arc (const GT &g, Op cond, SA sa=SA()) |
Return true if condition cond is met on every filtered arc of the graph. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>, class Op > requires std::is_invocable_r_v<bool, Op &, typename GT::Arc *> | |
| bool | forall_arc (typename GT::Node *p, Op cond, SA sa=SA()) |
Return true if the condition cond is met on every filtered arc of a node. | |
| template<AlephGraph GT, typename T , template< typename > class Container = DynList, NodeFilter< GT > SN = Dft_Show_Node<GT>, class Op > requires std::is_invocable_r_v<T, Op &, typename GT::Node *> | |
| Container< T > | nodes_map (GT &g, Op transformation, SN sn=SN()) |
| Map the filtered nodes of a graph to a transformed type. | |
| template<AlephGraph GT, typename T , template< typename > class Container = DynList, NodeFilter< GT > SN = Dft_Show_Node<GT>> | |
| Container< T > | nodes_map (GT &g, std::function< T(typename GT::Node *)> transformation, SN sn=SN()) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Compatibility overload for callers that pass an actual std::function<T (typename GT::Node *)> (rather than a lambda or other callable) and rely on T being deduced from it, as the generic overload above cannot: T appears only in its return type and requires clause, never in a parameter, so it is not a deduced context there. | |
| template<AlephGraph GT, typename T , template< typename > class Container = DynList, ArcFilter< GT > SA = Dft_Show_Arc<GT>, class Op > requires std::is_invocable_r_v<T, Op &, typename GT::Arc *> | |
| Container< T > | arcs_map (GT &g, Op transformation, SA sa=SA()) |
| Map the filtered arcs of a graph to a transformed type. | |
| template<AlephGraph GT, typename T , template< typename > class Container = DynList, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| Container< T > | arcs_map (GT &g, std::function< T(typename GT::Arc *)> transformation, SA sa=SA()) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Compatibility overload deducing T from an actual std::function<T (typename GT::Arc *)> argument; see the equivalent nodes_map overload for why the generic one above cannot deduce it. | |
| template<AlephGraph GT, typename T , template< typename > class Container = DynList, ArcFilter< GT > SA = Dft_Show_Arc<GT>, class Op > requires std::is_invocable_r_v<T, Op &, typename GT::Arc *> | |
| Container< T > | arcs_map (GT &g, typename GT::Node *p, Op transformation, SA sa=SA()) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Map the filtered arcs of a specific node in a graph to a transformed type. | |
| template<AlephGraph GT, typename T , template< typename > class Container = DynList, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| Container< T > | arcs_map (GT &g, typename GT::Node *p, std::function< T(typename GT::Arc *)> transformation, SA sa=SA()) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Compatibility overload deducing T from an actual std::function<T (typename GT::Arc *)> argument; see the equivalent nodes_map overload for why the generic one above cannot deduce it. | |
| template<AlephGraph GT, typename T , NodeFilter< GT > SN = Dft_Show_Node<GT>, class Op > requires std::is_invocable_r_v<T, Op &, const T &, typename GT::Node *> | |
| T | foldl_nodes (GT &g, const T &init, Op operation, SN sn=SN()) |
| Fold the filtered nodes of a graph. | |
| template<AlephGraph GT, typename T , ArcFilter< GT > SA = Dft_Show_Arc<GT>, class Op > requires std::is_invocable_r_v<T, Op &, const T &, typename GT::Arc *> | |
| T | foldl_arcs (GT &g, const T &init, Op operation, SA sa=SA()) |
| Fold the filtered arcs of a graph. | |
| template<AlephGraph GT, typename T , ArcFilter< GT > SA = Dft_Show_Arc<GT>, class Op > requires std::is_invocable_r_v<T, Op &, const T &, typename GT::Arc *> | |
| T | foldl_arcs (GT &g, typename GT::Node *p, const T &init, Op operation, SA sa=SA()) |
| Fold the filtered adjacent arcs of a node. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| DynList< typename GT::Node * > | out_nodes (typename GT::Node *p, SA sa=SA()) |
Return the nodes connected to the filtered outcoming arcs of p. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| DynList< typename GT::Node * > | in_nodes (typename GT::Node *p, SA sa=SA()) |
Return the nodes connected to the filtered incoming arcs to p. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| DynList< typename GT::Node * > | in_nodes (const GT &g, typename GT::Node *p, SA sa=SA()) |
Return the sources of the arcs of g into p that sa shows. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| DynList< typename GT::Arc * > | out_arcs (typename GT::Node *p, SA sa=SA()) |
Return the filtered incoming arcs of p. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| DynList< typename GT::Arc * > | in_arcs (typename GT::Node *p, SA sa=SA()) |
Return the filtered incoming arcs of p. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| DynList< typename GT::Arc * > | in_arcs (const GT &g, typename GT::Node *p, SA sa=SA()) |
Return the arcs of g into p that sa shows. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| DynList< typename GT::Arc * > | arcs (typename GT::Node *p, SA sa=SA()) |
Return all the filtered arcs related to p | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| DynList< ArcPair< GT > > | in_pairs (typename GT::Node *p, SA sa=SA()) |
Return the filtered incoming pairs of (arc,node) related to node p | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| DynList< ArcPair< GT > > | in_pairs (const GT &g, typename GT::Node *p, SA sa=SA()) |
Return the pairs (arc, source) of the arcs of g into p that sa shows. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| DynList< ArcPair< GT > > | out_pairs (typename GT::Node *p, SA sa=SA()) |
Return the filtered outcoming pairs of (arc,node) related to node p | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| size_t | in_degree (typename GT::Node *p, SA sa=SA()) |
Compute the filtered in degree of node p. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| size_t | in_degree (const GT &g, typename GT::Node *p, SA sa=SA()) |
Compute the number of arcs of g into p that sa shows. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| size_t | out_degree (typename GT::Node *p, SA sa=SA()) |
Compute the filtered out degree of node p | |
| template<AlephGraph GT, class Itor , class Operation > | |
| bool | traverse_arcs (typename GT::Node *p, Operation op=Operation()) |
| Generic arcs traverse of a node. | |
| template<AlephGraph GT, class Itor , class Operation > | |
| void | for_each_arc (typename GT::Node *p, Operation op=Operation()) |
| Execute an operation on each arc of a node. | |
| template<AlephGraph GT, class Op > | |
| bool | traverse_in_arcs (typename GT::Node *p, Op op=Op()) |
| Conditioned traversal of incoming arcs of a node. | |
| template<AlephGraph GT, class Op > | |
| bool | traverse_in_arcs (const GT &g, typename GT::Node *p, Op op=Op()) |
Conditioned traversal of the arcs of g into p. | |
| template<AlephGraph GT, class Op > | |
| void | for_each_in_arc (typename GT::Node *p, Op op=Op()) |
| Traverse the incoming arcs of a node and executes an operation. | |
| template<AlephGraph GT, class Op > | |
| void | for_each_in_arc (const GT &g, typename GT::Node *p, Op op=Op()) |
Executes an operation on each arc of g into p: on a digraph, which the function tells at run time, among the arcs of the graph, in \(O(E)\). | |
| template<AlephGraph GT, class Op > | |
| bool | all_in_arc (typename GT::Node *p, Op op=Op()) |
| Test if the incoming arcs meet a condition. | |
| template<AlephGraph GT, class Op > | |
| bool | all_in_arc (const GT &g, typename GT::Node *p, Op op=Op()) |
Test if the arcs of g into p meet a condition; on a digraph, in \(O(E)\). | |
| template<AlephGraph GT, class Op > | |
| bool | exists_in_arc (typename GT::Node *p, Op op=Op()) |
| Test if it exists an incoming arc satisfying an operation. | |
| template<AlephGraph GT, class Op > | |
| bool | exists_in_arc (const GT &g, typename GT::Node *p, Op op=Op()) |
Test if an arc of g into p satisfies an operation; on a digraph, in \(O(E)\). | |
| template<AlephGraph GT, class Op > | |
| auto | search_in_arc (typename GT::Node *p, Op op=Op()) |
Search an incoming arc to a node satisfying a condition op. | |
| template<AlephGraph GT, class Op > | |
| auto | search_in_arc (const GT &g, typename GT::Node *p, Op op=Op()) |
Search an arc of g into p that satisfies op; on a digraph, in \(O(E)\). | |
| template<AlephGraph GT, typename T , class Op > requires (std::is_invocable_r_v<T, Op &, typename GT::Arc *> and not std::is_same_v<Op, std::function<T (typename GT::Arc *)>>) | |
| auto | map_in_arcs (typename GT::Node *p, Op op) |
| Map the incoming arcs to a transformation,. | |
| template<AlephGraph GT, typename T , class Op = std::function<T (typename GT::Arc *)>> requires std::is_same_v<Op, std::function<T (typename GT::Arc *)>> | |
| auto | map_in_arcs (typename GT::Node *p, std::function< T(typename GT::Arc *)> op) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Compatibility overload deducing T from an actual std::function<T (typename GT::Arc *)> argument; see the equivalent nodes_map overload for why the generic one above cannot deduce it. | |
| template<AlephGraph GT, typename T , class Op > requires std::is_invocable_r_v<T, Op &, typename GT::Arc *> | |
| auto | map_in_arcs (const GT &g, typename GT::Node *p, Op op) |
Map the arcs of g into p to a transformation op, which must have the signature T op(Arc * arc); on a digraph, in \(O(E)\). | |
| template<AlephGraph GT, typename T > | |
| auto | map_in_arcs (const GT &g, typename GT::Node *p, std::function< T(typename GT::Arc *)> op) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Compatibility overload deducing T from an actual std::function<T (typename GT::Arc *)> argument. | |
| template<AlephGraph GT, typename T , class Op > requires std::is_invocable_r_v<T, Op &, const T &, typename GT::Arc *> | |
| T | foldl_in_arcs (typename GT::Node *p, const T &init, Op op) |
| Fold the incoming arcs of a node. | |
| template<AlephGraph GT, typename T , class Op > requires std::is_invocable_r_v<T, Op &, const T &, typename GT::Arc *> | |
| T | foldl_in_arcs (const GT &g, typename GT::Node *p, const T &init, Op op) |
Fold the arcs of g into p with op, which must have the signature T op(const T & acc, Arc * arc); on a digraph, in \(O(E)\). | |
| template<AlephGraph GT, class Op > | |
| DynList< typename GT::Arc * > | filter_in_arcs (typename GT::Node *p, Op cond) |
| Filter the incoming arcs meeting an condition. | |
| template<AlephGraph GT, class Op > | |
| DynList< typename GT::Arc * > | filter_in_arcs (const GT &g, typename GT::Node *p, Op cond) |
Return the arcs of g into p that meet a condition; on a digraph, in \(O(E)\). | |
| template<AlephGraph GT, class Op > | |
| bool | traverse_out_arcs (typename GT::Node *p, Op op=Op()) |
| Conditioned traversal of outcoming arcs of a node. | |
| template<AlephGraph GT, class Op > | |
| void | for_each_out_arc (typename GT::Node *p, Op op=Op()) |
| Traverse the outcoming arcs of a node and executes an operation. | |
| template<AlephGraph GT, class Op > | |
| bool | all_out_arc (typename GT::Node *p, Op op=Op()) |
| Test if the outcoming arcs meet a condition. | |
| template<AlephGraph GT, class Op > | |
| bool | exists_out_arc (typename GT::Node *p, Op op=Op()) |
| Test if it exists an outcoming arc satisfying an operation. | |
| template<AlephGraph GT, class Op > | |
| auto | search_out_arc (typename GT::Node *p, Op op=Op()) |
Search an outcoming arc to a node satisfying a condition op. | |
| template<AlephGraph GT, typename T , class Op > requires (std::is_invocable_r_v<T, Op &, typename GT::Arc *> and not std::is_same_v<Op, std::function<T (typename GT::Arc *)>>) | |
| auto | map_out_arcs (typename GT::Node *p, Op op) |
| Map the outcoming arcs to a transformation,. | |
| template<AlephGraph GT, typename T , class Op = std::function<T (typename GT::Arc *)>> requires std::is_same_v<Op, std::function<T (typename GT::Arc *)>> | |
| auto | map_out_arcs (typename GT::Node *p, std::function< T(typename GT::Arc *)> op) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Compatibility overload deducing T from an actual std::function<T (typename GT::Arc *)> argument; see the equivalent nodes_map overload for why the generic one above cannot deduce it. | |
| template<AlephGraph GT, typename T , class Op > requires std::is_invocable_r_v<T, Op &, const T &, typename GT::Arc *> | |
| T | foldl_out_arcs (typename GT::Node *p, const T &init, Op op) |
| Fold the outcoming arcs of a node. | |
| template<AlephGraph GT, class Op > | |
| DynList< typename GT::Arc * > | filter_out_arcs (typename GT::Node *p, Op cond) |
| Filter the outcoming arcs meeting an condition. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| GT::Arc * | search_arc (const GT &g, typename GT::Node *src, typename GT::Node *tgt, SA sa=SA()) noexcept(nothrow_arc_filter_v< GT, SA >) |
| Arc filtered searching given two nodes. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| GT::Arc * | search_directed_arc (const GT &g, typename GT::Node *src, typename GT::Node *tgt, SA sa=SA()) noexcept(nothrow_arc_filter_v< GT, SA >) |
| Searching of directed arc linking two nodes. | |
| template<AlephGraph GT> | |
| GT::Node * | mapped_node (typename GT::Node *p) noexcept |
Return the mapped node through the cookie of p | |
| template<AlephGraph GT> | |
| GT::Arc * | mapped_arc (typename GT::Arc *a) noexcept |
Return the mapped arc through the cookie of p | |
| template<AlephGraph GTSRC, AlephGraph GTTGT> | |
| GTTGT::Node * | mapped_node (typename GTSRC::Node *p) noexcept |
See mapped_node(typename GT::Node * p). | |
| template<AlephGraph GTSRC, AlephGraph GTTGT> | |
| GTTGT::Arc * | mapped_arc (typename GTSRC::Arc *a) noexcept |
See mapped_arc(typename GT::Arc * a). | |
| template<AlephGraph GT> | |
| void | copy_graph (GT >gt, const GT &gsrc, bool cookie_map=false) |
| Explicit copy of graph. | |
| template<AlephGraph GT> | |
| void | clear_graph (GT &g) |
| Clean a graph: all its nodes and arcs are removed and freed. | |
| template<AlephGraph GT> | |
| Path< GT > | find_path_depth_first (const GT &g, typename GT::Node *start_node, typename GT::Node *end_node) |
| Depth-first search of a path between two nodes. | |
| template<class GT > | |
| static bool | __find_path_depth_first (const GT &g, typename GT::Node *curr_node, typename GT::Arc *curr_arc, typename GT::Node *end_node, Path< GT > &path) |
| template<AlephGraph GTS, AlephGraph GTT> | |
| void | map_nodes (typename GTS::Node *p, typename GTT::Node *q) noexcept |
| Map two nodes of different types of graphs through their cookies. | |
| template<AlephGraph GTS, AlephGraph GTT> | |
| void | map_arcs (typename GTS::Arc *p, typename GTT::Arc *q) noexcept |
| Map two arcs of different types of graphs through their cookies. | |
| template<AlephGraph GTT, AlephGraph GTS, class Copy_Node = Dft_Copy_Node<GTT, GTS>, class Copy_Arc = Dft_Copy_Arc<GTT, GTS>> | |
| void | inter_copy_graph (GTT >gt, const GTS &gsrc, const bool cookie_map=false) |
| Copy between different types of graphs. | |
| template<AlephGraph GT> | |
| bool | are_equal (const GT &g1, const GT &g2) |
| Fast graph comparison. | |
| template<AlephGraph GT> | |
| static bool | __depth_first_traversal (const GT &g, typename GT::Node *node, typename GT::Arc *arc, bool(*visit)(const GT &g, typename GT::Node *, typename GT::Arc *), size_t &count) |
| Internal DFS used by depth_first_traversal(). | |
| template<AlephGraph GT> | |
| size_t | depth_first_traversal (const GT &g, typename GT::Node *start_node, bool(*visit)(const GT &g, typename GT::Node *, typename GT::Arc *)) |
| Depth-first traversal starting from a given node. | |
| template<AlephGraph GT> | |
| size_t | depth_first_traversal (const GT &g, bool(*visit)(const GT &, typename GT::Node *, typename GT::Arc *)) |
See depth_first_traversal(const GT&, typename GT::Node*, bool (*)(...)). | |
| template<AlephGraph GT> | |
| size_t | breadth_first_traversal (const GT &g, typename GT::Node *start, bool(*visit)(const GT &, typename GT::Node *, typename GT::Arc *)) |
| Breadth-first traversal starting from a given node. | |
| template<AlephGraph GT> | |
| size_t | breadth_first_traversal (GT &g, bool(*visit)(const GT &, typename GT::Node *, typename GT::Arc *)) |
See breadth_first_traversal(const GT&, typename GT::Node*, bool (*)(...)). | |
| template<AlephGraph GT> | |
| Path< GT > | find_path_breadth_first (const GT &g, typename GT::Node *start, typename GT::Node *end) |
| Breadth-first search of a (shortest-by-edges) path between two nodes. | |
| template<AlephGraph GT> | |
| bool | test_connectivity (const GT &g) |
| Connectivity test for undirected graphs. | |
| template<AlephGraph GT> | |
| static bool | __test_cycle (const GT &g, typename GT::Node *, typename GT::Node *) |
| Internal helper used by test_for_cycle(). | |
| template<AlephGraph GT> | |
| bool | test_for_cycle (const GT &g, typename GT::Node *src) |
| Search for a cycle reachable from a given node. | |
| template<AlephGraph GT> | |
| static bool | __is_graph_acyclique (const GT &g, typename GT::Node *curr_node) |
| Internal DFS used by is_graph_acyclique(). | |
| template<AlephGraph GT> | |
| bool | is_graph_acyclique (const GT &g, typename GT::Node *start_node) |
Return true if an undirected graph is acyclic. | |
| template<AlephGraph GT> | |
| bool | is_graph_acyclique (const GT &g) |
Return true if an undirected graph is acyclic. | |
| template<AlephGraph GT> | |
| bool | has_cycle (const GT &g) |
Return true if an undirected graph has at least one cycle. | |
| template<AlephGraph GT> | |
| bool | test_for_path (const GT &g, typename GT::Node *start_node, typename GT::Node *end_node) |
Return true if there is a path between two nodes. | |
| template<AlephGraph GT> | |
| static bool | __test_for_path (const GT &g, typename GT::Node *curr_node, typename GT::Node *end_node) |
| Internal DFS used by test_for_path(). | |
| template<AlephGraph GT> | |
| DynList< GT > | inconnected_components (const GT &g) |
| Forward declaration for inconnected_components(). | |
| template<AlephGraph GT> | |
| void | build_subgraph (const GT &g, GT &sg, typename GT::Node *g_src, size_t &node_count) |
| Forward declaration for build_subgraph(). | |
| template<AlephGraph GT> | |
| static bool | __find_depth_first_spanning_tree (const GT &g, typename GT::Node *gnode, typename GT::Arc *garc, GT &tree, typename GT::Node *tnode) |
| Internal DFS used by find_depth_first_spanning_tree(). | |
| template<AlephGraph GT> | |
| GT | find_depth_first_spanning_tree (const GT &g, typename GT::Node *gnode) |
| Build a depth-first spanning tree (mapped to the original graph). | |
| template<AlephGraph GT> | |
| GT | find_depth_first_spanning_tree (const GT &g) |
See find_depth_first_spanning_tree(). | |
| template<AlephGraph GT> | |
| GT | find_breadth_first_spanning_tree (GT &g, typename GT::Node *gp) |
| Build a breadth-first spanning tree (mapped to the original graph). | |
| template<AlephGraph GT> | |
| GT | build_spanning_tree (const DynArray< typename GT::Arc * > &arcs) |
| Build a graph from a list of arcs (typically a spanning tree). | |
| template<AlephGraph GT> | |
| static long & | df (typename GT::Node *p) |
Internal helper: DFS discovery time stored in NODE_COUNTER(p). | |
| template<AlephGraph GT> | |
| static long & | low (typename GT::Node *p) |
Internal helper: low-link value stored directly in NODE_COOKIE(p). | |
| template<AlephGraph GT> | |
| static void | __compute_cut_nodes (const GT &g, DynList< typename GT::Node * > &list, Dfs_Stack< graph_utils_detail::Cut_Frame< GT > > &frames, typename GT::Node *p, typename GT::Arc *a, long &curr_df) |
| Internal DFS step used by compute_cut_nodes(). | |
| template<AlephGraph GT> | |
| DynList< typename GT::Node * > | compute_cut_nodes (const GT &g, typename GT::Node *start) |
| Compute articulation points (cut vertices) of an undirected graph. | |
| template<AlephGraph GT> | |
| DynList< typename GT::Node * > | compute_cut_nodes (const GT &g) |
See compute_cut_nodes(const GT & g, typename GT::Node * start). | |
| template<AlephGraph GT> | |
| static bool | is_a_cross_arc (typename GT::Arc *a) |
Return true if the arc is marked as a cross-arc by paint_subgraphs(). | |
| template<AlephGraph GT> | |
| static bool | is_a_cut_node (typename GT::Node *p) |
Return true if the node is marked as an articulation point. | |
| template<AlephGraph GT> | |
| static bool | is_an_cut_arc (typename GT::Arc *a) |
Return true if the arc is marked as a cut-arc (between cut nodes). | |
| template<AlephGraph GT> | |
| static bool | is_node_painted (typename GT::Node *p) |
Return true if the node has a positive color. | |
| template<AlephGraph GT> | |
| static bool | is_arc_painted (typename GT::Arc *arc) |
Return true if the arc has a positive color. | |
| template<AlephGraph GT> | |
| static void | paint_node (typename GT::Node *p, const long &color) |
Set the node color (stored in NODE_COUNTER). | |
| template<AlephGraph GT> | |
| static void | paint_arc (typename GT::Arc *a, const long &color) |
Set the arc color (stored in ARC_COUNTER). | |
| template<AlephGraph GT> | |
| static const long & | get_color (typename GT::Node *p) |
Return the node color (stored in NODE_COUNTER). | |
| template<AlephGraph GT> | |
| static const long & | get_color (typename GT::Arc *a) |
Return the arc color (stored in ARC_COUNTER). | |
| template<AlephGraph GT> | |
| static void | __paint_subgraph (const GT &g, Dfs_Stack< graph_utils_detail::Paint_Frame< GT > > &frames, typename GT::Node *p, long current_color) |
Internal DFS that paints a non-cut block with current_color. | |
| template<AlephGraph GT> | |
| static void | __paint_from_cut_node (const GT &g, Dfs_Stack< graph_utils_detail::Paint_Frame< GT > > &frames, typename GT::Node *p, long ¤t_color) |
| Internal step that paints all blocks adjacent to a cut node. | |
| template<AlephGraph GT> | |
| long | paint_subgraphs (const GT &g, const DynList< typename GT::Node * > &cut_node_list) |
| Paint connected blocks around articulation points. | |
| template<AlephGraph GT> | |
| static void | __map_subgraph (const GT &g, GT &sg, typename GT::Node *gsrc, const long color) |
| Internal step used by map_subgraph(). | |
| template<AlephGraph GT> | |
| GT | map_subgraph (const GT &g, const long color) |
| Extract a mapped subgraph containing a given color. | |
| template<AlephGraph GT> | |
| std::tuple< GT, DynList< typename GT::Arc * > > | map_cut_graph (const GT &g, const DynList< typename GT::Node * > &cut_node_list) |
| Extract the cut graph and cross-arc list. | |
| template<AlephGraph GT> | |
| GT | invert_digraph (const GT &g) |
| Compute the transpose (arc-reversed) digraph. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| GT::Arc * | search_spanning_tree_arc (const GT &g, typename GT::Node *src, typename GT::Node *tgt, SA sa=SA()) noexcept(nothrow_arc_filter_v< GT, SA >) |
| Helper to find the spanning tree arc between two nodes in a multigraph. | |
| template<AlephGraph GT, ArcDistance< GT > Distance = Dft_Dist<GT>> | |
| Distance::Distance_Type | get_min_path (typename GT::Node *s, typename GT::Node *end, Path< GT > &path, Distance distance=Distance()) |
| Extracts a shortest path from a graph painted by a shortest paths algorithm. | |
| template<class Node > | |
| auto & | MAX_EP (Node *p) noexcept |
| Access max_endpoint of an interval tree node. | |
| template<class Node > | |
| const auto & | MAX_EP (const Node *p) noexcept |
| template<AlephGraph GT, template< class > class Max_Flow = Random_Preflow_Maximum_Flow, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| long | edge_connectivity (GT &g, SA sa=SA()) |
| Compute edge connectivity (arc connectivity) of an undirected graph. | |
| template<AlephGraph GT, template< class > class Max_Flow = Heap_Preflow_Maximum_Flow, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| long | compute_min_cut (GT &g, DynSetTree< typename GT::Node * > &l, DynSetTree< typename GT::Node * > &r, DynDlist< typename GT::Arc * > &cut, SA sa=SA()) |
| Compute a minimum edge cut of an undirected graph. | |
| template<AlephGraph GT, template< class > class Max_Flow = Random_Preflow_Maximum_Flow, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| long | vertex_connectivity (GT &g, SA sa=SA()) |
| Compute vertex connectivity of an undirected graph. | |
| template<class Net > | |
| long & | dinic_level (typename Net::Node *p) noexcept |
| Access the node level in Dinic's algorithm. | |
| template<class Net > | |
| bool & | dinic_blocked (typename Net::Node *p) noexcept |
| Check if a node is blocked in Dinic's algorithm. | |
| template<class Net > | |
| size_t & | dinic_current_arc (typename Net::Node *p) noexcept |
| Access the current arc index in Dinic's algorithm. | |
| template<class Net > | |
| bool | is_dinic_cookie_valid (typename Net::Node *p) noexcept |
| Check if a node's cookie is properly initialized for Dinic's algorithm. | |
| template<class Net > | |
| bool | build_level_graph (Net &net, typename Net::Node *source, typename Net::Node *sink) |
| Build level graph using BFS from source. | |
| template<class Net > | |
| Net::Flow_Type | dinic_blocking_flow (Net &net, typename Net::Node *source, typename Net::Node *sink) |
| Find all blocking flows using iterative DFS with current-arc optimization. | |
| template<FlowNetwork Net> | |
| Net::Flow_Type | dinic_maximum_flow (Net &net) |
| Compute maximum flow using Dinic's algorithm. | |
| template<FlowNetwork Net> | |
| Net::Flow_Type | capacity_scaling_maximum_flow (Net &net) |
| Compute maximum flow using capacity scaling. | |
| template<FlowNetwork Net> | |
| FlowDecomposition< Net > | decompose_flow (const Net &net) |
| Decompose network flow into paths and cycles. | |
| template<class Net > | |
| long & | hlpp_height (typename Net::Node *p) noexcept |
| Access the height label stored in the node's cookie. | |
| template<class Net > | |
| Net::Flow_Type & | hlpp_excess (typename Net::Node *p) noexcept |
| Access the excess flow stored in the node's cookie. | |
| template<FlowNetwork Net> | |
| Net::Flow_Type | hlpp_maximum_flow (Net &net) |
| Compute maximum flow using Highest-Label Preflow-Push. | |
| template<class Net > | |
| FlowStatistics< typename Net::Flow_Type > | compute_flow_statistics (const Net &net) |
| Compute statistics about the current flow in a network. | |
| template<class Net > | |
| SSP_Node_Info< typename Net::Flow_Type > & | ssp_info (typename Net::Node *p) noexcept |
| Access SSP node info. | |
| template<class Net > | |
| Net::Flow_Type | reduced_cost (const Net &net, typename Net::Arc *arc, bool forward) |
| Compute reduced cost of an arc. | |
| template<class Net > | |
| bool | ssp_shortest_path (Net &net, typename Net::Node *source, typename Net::Node *sink) |
| template<class Net > | |
| std::pair< typename Net::Flow_Type, typename Net::Flow_Type > | successive_shortest_paths (Net &net) |
| Compute minimum cost maximum flow using Successive Shortest Paths. | |
| template<class Net > | |
| bool | ssp_init_potentials (Net &net, typename Net::Node *source) |
| Initialize potentials using Bellman-Ford. | |
| template<class Net , class GetDemand > | |
| TransshipmentResult< typename Net::Flow_Type > | solve_transshipment (Net &net, GetDemand get_demand) |
| Solve minimum cost transshipment problem. | |
| template<typename Cost_Type > | |
| AssignmentResult< Cost_Type > | solve_assignment (const std::vector< std::vector< Cost_Type > > &costs) |
| Solve the assignment problem using min-cost flow. | |
| template<typename Cost_Type > | |
| TransportationResult< Cost_Type > | solve_transportation (const std::vector< Cost_Type > &supplies, const std::vector< Cost_Type > &demands, const std::vector< std::vector< Cost_Type > > &costs) |
| Solve the transportation problem using min-cost flow. | |
| template<class Net > | |
| DynMapTree< typename Net::Arc *, typename Net::Flow_Type > | save_flow_solution (const Net &net) |
| Save network simplex solution for warm start. | |
| template<class Net > | |
| void | restore_flow_solution (Net &net, const DynMapTree< typename Net::Arc *, typename Net::Flow_Type > &solution) |
| Restore network simplex solution from warm start. | |
| template<typename C , class M > | |
| PolyFitAnalysis< C > | analyze_fit (const Gen_MultiPolynomial< C, M > &poly, const Array< std::pair< Array< C >, C > > &data) |
| Compute residual analysis for a polynomial fit. | |
| template<typename C , class M > | |
| Gen_MultiPolynomial< C, M > | operator* (const C &s, const Gen_MultiPolynomial< C, M > &p) |
| Scalar * polynomial (commutative). | |
| template<typename C , class M > | |
| Gen_MultiPolynomial< C, M > | operator+ (const C &s, const Gen_MultiPolynomial< C, M > &p) |
| Scalar + polynomial (commutative). | |
| template<typename C , class M > | |
| Gen_MultiPolynomial< C, M > | operator- (const C &s, const Gen_MultiPolynomial< C, M > &p) |
| Scalar - polynomial. | |
| template<typename C , class M > | |
| std::ostream & | operator<< (std::ostream &out, const Gen_MultiPolynomial< C, M > &p) |
| Stream insertion. | |
| template<class Net > | |
| MCF_Result< typename Net::Flow_Type > | solve_multicommodity_flow (Net &net) |
| Solve multi-commodity flow problem. | |
| template<class Net > | |
| bool | is_residual (typename Net::Node *src, typename Net::Arc *a) noexcept |
Return true if arc a is residual with respect to src. | |
| template<class Net > | |
| Net::Flow_Type | remaining_flow (typename Net::Node *src, typename Net::Arc *a) noexcept |
Return the remaining flow of a as seen from src. | |
| template<class Net > | |
| void | print (const DynList< Parc< Net > > &sp) |
| Print a semi-path to stdout. | |
| template<class Net > | |
| Net::Flow_Type | increase_flow (Net &net, const Path< Net > &path) |
| Increase flow along an augmenting path. | |
| template<class Net > | |
| void | increase_flow (Net &net, const DynList< Parc< Net > > &semi_path, const typename Net::Flow_Type slack) |
| Increase flow along a semi-path by a given slack. | |
| template<class Net > | |
| void | decrease_flow (Net &net, const DynList< Parc< Net > > &semi_path, const typename Net::Flow_Type slack) |
| Decrease flow along a semi-path by a given slack. | |
| template<class Net , template< typename T > class Q> | |
| Path< Net > | find_aumenting_path (const Net &net, const typename Net::Flow_Type &min_slack) |
Find an augmenting path using DFS or BFS based on Q. | |
| template<class Net > | |
| Path< Net > | find_aumenting_path_dfs (const Net &net, const typename Net::Flow_Type &min_slack) |
| Find an augmenting path using DFS. | |
| template<class Net > | |
| Path< Net > | find_aumenting_path_bfs (const Net &net, const typename Net::Flow_Type &min_slack) |
| Find an augmenting path using BFS. | |
| template<class Net , template< typename T > class Q> | |
| SemiPath< Net > | find_aumenting_semi_path (const Net &net, const typename Net::Flow_Type &slack) |
Find an augmenting semi-path using DFS or BFS based on Q. | |
| template<class Net > | |
| SemiPath< Net > | find_aumenting_semi_path_dfs (const Net &net, const typename Net::Flow_Type &slack) |
| Find an augmenting semi-path using DFS. | |
| template<class Net > | |
| SemiPath< Net > | find_aumenting_semi_path_bfs (const Net &net, const typename Net::Flow_Type &slack) |
| Find an augmenting semi-path using BFS. | |
| template<class Net , template< typename T > class Q> | |
| SemiPath< Net > | find_decrementing_path (const Net &net, const typename Net::Flow_Type &slack) |
Find a decrementing semi-path using DFS or BFS based on Q. | |
| template<class Net > | |
| SemiPath< Net > | find_decrementing_path_dfs (const Net &net, const typename Net::Flow_Type &slack) |
| Find a decrementing semi-path using DFS. | |
| template<class Net > | |
| SemiPath< Net > | find_decrementing_path_bfs (const Net &net, const typename Net::Flow_Type &slack) |
| Find a decrementing semi-path using BFS. | |
| template<class Net > | |
| void | create_residual_arc (const Net &net, PP_Res_Net< Net > &rnet, typename Net::Arc *a) |
Create residual arcs for a in the residual network. | |
| template<class Net > | |
| std::tuple< PP_Res_Net< Net >, typename PP_Res_Net< Net >::Node *, typename PP_Res_Net< Net >::Node * > | preflow_create_residual_net (Net &net) |
| Build the residual network for preflow-push algorithms. | |
| template<class Rnet > | |
| void | update_flow (const Rnet &rnet) |
| Propagate residual arc flows back to their original arcs. | |
| template<class Net , template< class > class Find_Path> | |
| Net::Flow_Type | aumenting_path_maximum_flow (Net &net) |
| Maximize flow using repeated augmenting-path searches. | |
| template<class Net > | |
| Net::Flow_Type | ford_fulkerson_maximum_flow (Net &net) |
| Maximize flow using the Ford-Fulkerson algorithm. | |
| template<class Net > | |
| Net::Flow_Type | edmonds_karp_maximum_flow (Net &net) |
| Maximize flow using the Edmonds-Karp algorithm. | |
| template<class Net > | |
| static bool | is_node_active (const Net &net, typename Net::Node *p) |
Return true if p has excess flow in net. | |
| template<class Rnet > | |
| static bool | is_node_active (typename Rnet::Node *p) |
Return true if residual node p has excess flow. | |
| template<class Net > | |
| static long & | node_height (typename Net::Node *p) |
| Access the height label stored in NODE_COUNTER. | |
| template<class Net > | |
| static void | init_height_in_nodes (Net &net) |
| Initialize node heights with BFS distance to the sink. | |
| template<class Q_Type > | |
| static void | put_in_active_queue (Q_Type &q, typename Q_Type::Item_Type &p) |
| Enqueue an active node if it is not already enqueued. | |
| template<class Q_Type > | |
| static Q_Type::Item_Type | get_from_active_queue (Q_Type &q) |
| Dequeue an active node and clear its queue mark. | |
| template<class Q_Type > | |
| static void | remove_from_active_queue (Q_Type &q, typename Q_Type::Item_Type &p) |
| Remove a node from the active queue and clear its queue mark. | |
| template<class Net , class Q_Type > | |
| Net::Flow_Type | generic_preflow_vertex_push_maximum_flow (Net &net, Q_Type q=Q_Type()) |
| Generic preflow-push maximum flow (vertex-oriented). | |
| template<class Rnet > | |
| void | init_height_in_nodes (Rnet &rnet, typename Rnet::Node *sink) |
Initialize node heights in a residual network from sink. | |
| template<class Net > | |
| Net::Flow_Type | fifo_preflow_maximum_flow (Net &net) |
| Preflow-push maximum flow using a FIFO queue of active nodes. | |
| template<class Net > | |
| Net::Flow_Type | heap_preflow_maximum_flow (Net &net) |
| Preflow-push maximum flow using a height-ordered heap. | |
| template<class Net > | |
| Net::Flow_Type | random_preflow_maximum_flow (Net &net) |
| Preflow-push maximum flow using a random active-node queue. | |
| template<class Net > | |
| Net::Flow_Type | random_preflow_maximum_flow (Net &net, const unsigned long seed) |
Preflow-push maximum flow using a random active-node queue whose order takes the seed seed. | |
| template<class Net , template< class > class Maxflow> | |
| Net::Flow_Type | min_cut (Net &net, DynSetTree< typename Net::Node * > &vs, DynSetTree< typename Net::Node * > &vt, DynList< typename Net::Arc * > &cuts, DynList< typename Net::Arc * > &cutt) |
| Compute max flow and the corresponding minimum cut. | |
| template<class Res_Net > | |
| Res_Net::Arc * | create_residual_arc (Res_Net &residual_net, typename Res_Net::Node *src, typename Res_Net::Node *tgt, const typename Res_Net::Flow_Type cap, const typename Res_Net::Flow_Type flow, const typename Res_Net::Flow_Type cost) |
| Create a pair of residual arcs in the residual network. | |
| template<class Net > | |
| Residual_Net< typenameNet::Flow_Type >::Node * | build_residual_net (const Net &net, Residual_Net< typename Net::Flow_Type > &rnet, DynMapTree< void *, void * > &arcs) |
| Build a residual network from a flow network. | |
| template<class Res_Net > | |
| bool | check_residual_net (const Res_Net &net) |
| Verify residual network consistency. | |
| template<class Res_Net > | |
| void | cancel_cycle (const Res_Net &, const Path< Res_Net > &path) |
| Cancel a negative cycle by augmenting flow. | |
| template<class Net > | |
| void | residual_to_net (const DynMapTree< void *, void * > &arcs) |
| Transfer flow values from residual network back to original. | |
| template<FlowNetwork Net, template< class > class Max_Flow_Algo = Ford_Fulkerson_Maximum_Flow> | |
| std::tuple< size_t, double > | max_flow_min_cost_by_cycle_canceling (Net &net, double it_factor=0.4, size_t step=10) |
| Compute maximum flow at minimum cost using cycle canceling. | |
| template<class Net > | |
| void | print_net_cost (const Net &net, std::ostream &out) |
| Output a flow network to Graphviz format. | |
| template<class Net > | |
| void | print_residual_net (const Residual_Net< typename Net::Flow_Type > &net, std::ostream &out) |
| Output a residual network to Graphviz format. | |
| template<class Net > | |
| Feasible_Tree< Net > | build_feasible_spanning_tree (const Net &net) |
| Build feasible spanning tree classification. | |
| template<class Net > | |
| DynList< typename Net::Arc * > | get_partial_arcs (const Net &net) |
| Get arcs with partial flow (0 < flow < cap). | |
| template<FlowNetwork Net, template< class > class Max_Flow_Algo = Ford_Fulkerson_Maximum_Flow> | |
| size_t | max_flow_min_cost_by_network_simplex (Net &net) |
| Compute maximum flow at minimum cost using Network Simplex. | |
| constexpr Bit_Column | between (const std::int64_t lo, const std::int64_t hi) |
Column that holds the integers of [lo, hi]. | |
| constexpr Bit_Column | bits (const unsigned n) |
Column of n bits without sign: the integers of [0, 2^n - 1]. | |
| constexpr Bit_Column | signed_bits (const unsigned n) |
Column of n bits with sign: the integers of [-2^(n-1), 2^(n-1) - 1]. | |
| template<typename C > | |
| Gen_Polynomial< C > | operator* (const C &s, const Gen_Polynomial< C > &p) |
| Scalar times polynomial (commutative form). | |
| template<typename C > | |
| Gen_Polynomial< C > | operator+ (const C &s, const Gen_Polynomial< C > &p) |
| Scalar plus polynomial (commutative form). | |
| template<typename C > | |
| Gen_Polynomial< C > | operator- (const C &s, const Gen_Polynomial< C > &p) |
| Scalar minus polynomial. | |
| template<typename C > | |
| std::ostream & | operator<< (std::ostream &out, const Gen_Polynomial< C > &p) |
| Stream output. | |
| template<typename T , template< typename > class C> | |
| auto | shuffle (const C< T > &c) |
| Randomly shuffle a sequence. | |
| template<typename T , template< typename > class C> | |
| C< T * > | shuffle_ptr (const C< T > &c) |
| Return a random sequence of pointers to items of a sequence. | |
| template<template< typename > class Container, typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| bool | is_sorted (const Container< T > &cont, const Compare &cmp=Compare()) |
| Check if a container is sorted in ascending order. | |
| template<template< typename > class Container, typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| std::pair< bool, size_t > | search_inversion (const Container< T > &cont, const Compare &cmp=Compare()) |
| Find the first inversion in a container. | |
| template<template< typename > class Container, typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| bool | is_inversely_sorted (const Container< T > &cont, const Compare &cmp=Compare()) |
| Check if a container is sorted in descending order. | |
| template<template< typename > class Container, typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| std::pair< bool, size_t > | test_sorted (const Container< T > &cont, const Compare &cmp=Compare()) |
| Test if a container is sorted, returning the inversion position. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | selection_sort (T *a, const size_t n, const Compare &cmp=Compare()) noexcept(noexcept(static_cast< bool >(cmp(a[0], a[0]))) and std::is_nothrow_swappable_v< T >) |
| Sort an array using the selection sort algorithm. | |
| template<class Link , class Compare > | |
| Link * | search_extreme (const Link &list, const Compare &cmp) |
| Find the extreme (minimum or maximum) element in a linked list. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| const T * | search_extreme (const DynList< T > &list, const Compare &cmp=Compare()) |
| template<class Compare > | |
| Dlink * | search_extreme (const Dlink &list, const Compare &cmp=Compare()) |
| template<class Compare > | |
| Slinknc * | search_extreme (const Slinknc &list, const Compare &cmp=Compare()) |
| template<class Compare > | |
| void | selection_sort (Dlink &list, Compare cmp) |
Selection sort for doubly-linked lists (Dlink). | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | selection_sort (Dnode< T > &list, Compare cmp) |
| Selection sort for Dnode-based doubly-linked lists. | |
| template<typename T , class Equal = Aleph::equal_to<T>> | |
| long | sequential_search (T *a, const T &x, const long l, const long r, Equal eq=Equal()) |
| Linear search for an element in an array. | |
| template<typename T , class Equal = Aleph::equal_to<T>> | |
| long | sequential_search (const DynArray< T > &a, const T &x, const long l, const long r, Equal eq=Equal()) |
| Linear search for an element in a dynamic array. | |
| template<class Link , typename T , class Equal > | |
| Link * | sequential_search (const Link &list, const T &x, Equal &eq) |
| Linear search for an element in a linked list. | |
| template<typename T , class Equal = Aleph::equal_to<T>> | |
| Dlink * | sequential_search (const Dlink &list, const T &x, Equal eq=Equal()) |
| Linear search for an element in a Dlink list. | |
| template<typename T , class Equal = Aleph::equal_to<T>> | |
| Slinknc * | sequential_search (const Slinknc &list, const T &x, Equal eq=Equal()) |
| Linear search for an element in an Slinknc list. | |
| template<typename T , class Equal = Aleph::equal_to<T>> | |
| Dnode< T > * | sequential_search (Dnode< T > &list, const T &x, Equal &eq) |
| Linear search over a list of Dnodes. | |
| template<typename T , class Equal = Aleph::equal_to<T>> | |
| Dnode< T > * | sequential_search (Dnode< T > &list, const T &x, Equal &&eq=Equal()) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| template<typename T , class Equal = Aleph::equal_to<T>> | |
| const Dnode< T > * | sequential_search (const Dnode< T > &list, const T &x, Equal &eq) |
| Linear search over a list of Dnodes. | |
| template<typename T , class Equal = Aleph::equal_to<T>> | |
| const Dnode< T > * | sequential_search (const Dnode< T > &list, const T &x, Equal &&eq=Equal()) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| template<typename T , class Equal = Aleph::equal_to<T>> | |
| T * | sequential_search (DynDlist< T > &list, const T &x, Equal eq=Equal()) |
| Linear search on a DynDlist. | |
| template<typename T , class Equal = Aleph::equal_to<T>> | |
| const T * | sequential_search (const DynDlist< T > &list, const T &x, Equal eq=Equal()) |
| Linear search on a DynDlist (const version). | |
| template<typename T , class Equal = Aleph::equal_to<T>> | |
| T * | sequential_search (DynList< T > &list, const T &x, Equal eq=Equal()) |
| Linear search on a DynList. | |
| template<typename T , class Equal = Aleph::equal_to<T>> | |
| const T * | sequential_search (const DynList< T > &list, const T &x, Equal eq=Equal()) |
| Linear search on a DynList (const version). | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| long | search_extreme (T *a, const long l, const long r, const Compare &cmp=Compare()) |
| Generic search in an array of an extreme element. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| long | search_min (T *a, const long l, const long r, const Compare &cmp=Compare()) |
| Returns the smallest element of the array a between l and r. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::greater<T>> | |
| long | search_max (T *a, const long l, const long r, const Compare &cmp=Compare()) |
| Returns the maximum element of the array a between l and r. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| Dnode< T > * | search_extreme (const Dnode< T > &list, const Compare &cmp=Compare()) |
Overload of search_extreme. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| T * | search_extreme (DynDlist< T > &list, const Compare &cmp=Compare()) |
| Search for an extreme element in a DynDlist. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| const T * | search_extreme (const DynDlist< T > &list, const Compare &cmp=Compare()) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| T * | search_extreme (DynList< T > &list, const Compare &cmp=Compare()) |
| Search for an extreme element in a DynList. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| T * | search_min (DynDlist< T > &list, const Compare &cmp=Compare()) |
| Search for the minimum element in a DynDlist. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| const T * | search_min (const DynDlist< T > &list, const Compare &cmp=Compare()) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::greater<T>> | |
| T * | search_max (DynDlist< T > &list, const Compare &cmp=Compare()) |
| Search for the maximum element in a DynDlist. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::greater<T>> | |
| const T * | search_max (const DynDlist< T > &list, const Compare &cmp=Compare()) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | insertion_sort (T *a, const long l, const long r, const Compare &cmp=Compare()) noexcept(noexcept(static_cast< bool >(cmp(std::declval< T & >(), std::declval< T & >()))) and std::is_nothrow_move_constructible_v< T > and std::is_nothrow_move_assignable_v< T >) |
| Sort an array using insertion sort. | |
| template<class Compare > | |
| void | insert_sorted (Dlink &list, Dlink *p, const Compare &cmp) |
| Inserts a node orderly into a doubly linked list. | |
| template<class Compare > | |
| void | insert_sorted (HTList &list, Slinknc *p, const Compare &cmp) |
| template<class ListType , class Compare > | |
| void | list_insertion_sort (ListType &list, const Compare &cmp) |
| Generic insertion sort for linked lists. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | insertion_sort (DynList< T > &l, const Compare &cmp=Compare()) |
| Insertion sort for DynList. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| DynList< T > | insertion_sort (DynList< T > &&l, const Compare &cmp=Compare()) |
| Insertion sort for DynList (rvalue overload). | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | insertion_sort (Dnode< T > &list, const Compare &cmp=Compare()) |
| Insertion sort for Dnode-based lists. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | insertion_sort (DynDlist< T > &list, const Compare &cmp=Compare()) |
| Insertion sort for DynDlist. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | merge (T *a, const long l, const long m, const long r, Array< T > &buf, const Compare &cmp=Compare()) |
| Merge two sorted partitions of an array using a buffer. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | merge (T *a, const long l, const long m, const long r, const Compare &cmp=Compare()) |
| Merges two ordered partitions stored in an array. | |
| template<typename T , class Compare > | |
| void | mergesort (T *a, const long l, const long r, Array< T > &buf, Compare cmp) |
| Sort an array using merge sort with a reusable buffer. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | mergesort (T *a, const long l, const long r, const Compare &cmp=Compare()) |
| Sort an array using merge sort. | |
| template<typename Tlist , class Compare > | |
| void | merge_lists (Tlist &l1, Tlist &l2, Tlist &result, const Compare &cmp=Compare()) |
| Merge two sorted lists into a single sorted list. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | merge_lists (Dnode< T > &l1, Dnode< T > &l2, Dnode< T > &result, const Compare &cmp=Compare()) |
| Merge two sorted Dnode-based lists. | |
| template<typename Tlist , class Compare > | |
| void | mergesort (Tlist &list, const Compare &cmp=Compare()) |
| Sort a linked list using merge sort. | |
| template<class Tlist , class Tlink , class Compare > | |
| void | __link_mergeinsertsort (Tlist &list, const size_t n, const Compare &cmp, const size_t lsz) |
| template<template< typename > class Tlist, typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | mergeinsertsort (Tlist< T > &list, const Compare &cmp=Compare(), const size_t lsz=Aleph::Insertion_Threshold) |
| Sort a list by mergesort combined with the insert method. | |
| template<template< typename > class Tlist, typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | mergesort (Tlist< T > &list, const Compare &cmp=Compare()) |
| Merge sort for generic list templates. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | mergesort (Dnode< T > &list, const Compare &cmp=Compare()) |
| Merge sort for Dnode-based lists. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | mergesort (DynDlist< T > &list, const Compare &cmp=Compare()) |
| Merge sort for DynDlist. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | mergesort (DynList< T > &list, const Compare &cmp=Compare()) |
| Merge sort for DynList. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| DynList< T > | mergesort (DynList< T > &&list, const Compare &cmp=Compare()) |
| Merge sort for DynList (rvalue overload). | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| long | select_pivot (T *a, long l, long r, const Compare &cmp=Compare()) noexcept(noexcept(static_cast< bool >(cmp(a[0], a[0]))) and std::is_nothrow_swappable_v< T >) |
| Select a pivot for partitioning using median-of-three. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| long | partition (T *a, const long l, const long r, const Compare &cmp=Compare()) noexcept(noexcept(static_cast< bool >(cmp(a[0], a[0]))) and std::is_nothrow_swappable_v< T >) |
| Partition an array range [l, r] around a pivot. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | quicksort_rec (T *a, const long l, const long r, const Compare &cmp=Compare()) |
| Recursively sort an array using quicksort. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | quicksort_no_tail (T *a, long l, long r, const Compare &cmp=Compare()) |
| Quicksort implementation with tail-recursion optimization. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | quicksort_rec_min (T *a, const long l, const long r, const Compare &cmp=Compare()) |
| Sorts an array according to the quicksort method with minimum space consumption. | |
| size_t | introsort_depth_limit (size_t n) noexcept |
| Forward declaration. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | quicksort (T *a, const long l, const long r, const Compare &cmp=Compare()) |
| Sort an array using iterative quicksort with optimizations. | |
| template<typename T , class Compare > | |
| void | introsort_loop (T *a, long l, long r, size_t depth_limit, const Compare &cmp) |
| Quicksort loop with a depth limit, after which heapsort sorts the range: the loop of introsort() before pattern-defeating quicksort. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | introsort (T *a, const long l, const long r, const Compare &cmp=Compare()) |
| Sort an array using introsort (introspective sort). | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | introsort (T *a, const size_t n, const Compare &cmp=Compare()) |
| Sort an array using introsort (convenience overload). | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | introsort (T *begin, T *end, const Compare &cmp=Compare()) |
| Sort a range using introsort (STL-style iterator interface). | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | introsort (Array< T > &arr, const Compare &cmp=Compare()) |
| Introsort for Aleph Array. | |
| template<class Compare > | |
| void | quicksort (Dlink &list, const Compare &cmp=Compare()) |
| Sorts a linked list by the quicksort method. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | quicksort (Dnode< T > &list, const Compare &cmp=Compare()) |
| Sorts a list by the quicksort method. | |
| template<typename T , class Compare > | |
| void | quicksort (HTList &list, const Compare &cmp=Compare()) |
| Sort an HTList using the quicksort method. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | quicksort (DynList< T > &list, const Compare &cmp=Compare()) |
| Sort a DynList using the quicksort method. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | quicksort_insertion (T *a, const long l, const long r, const Compare &cmp=Compare()) |
| Sorts an array by the improved quicksort method. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| long | random_search (T *a, const T &x, const long l, const long r, const Compare &cmp=Compare()) |
| Random search for an element in an array. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| long | random_search (DynArray< T > &a, const T &x, const long l, const long r, const Compare &cmp=Compare()) |
| Random search for an element in a dynamic array. | |
| template<typename T , class Compare > | |
| Dnode< T > * | dlink_random_search (Dlink &list, const T &x, const Compare &cmp=Compare()) |
| Random search for an element in a dlink list. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| Dnode< T > * | random_search (Dlink &list, const T &x, const Compare &cmp=Compare()) |
| Random search for an element in a Dnode<T> list. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| T * | random_search (DynDlist< T > &list, const T &x, const Compare &cmp=Compare()) |
| Random search for an element in a dynamic list. | |
| template<typename T , class Compare > | |
| static std::pair< long, long > | partition_three_way (T *a, long l, long r, const Compare &cmp) |
| template<class Container , typename T , class Compare > | |
| static std::pair< long, long > | partition_three_way_op (Container &a, long l, long r, const Compare &cmp) |
| template<typename T , class Compare > | |
| static const T & | __random_select (T *a, const long i, long l, long r, const Compare &cmp) |
| template<typename T , class Compare , typename Container > | |
| long | select_pivot_op_impl (const Container &a, const long l, const long r, const Compare &cmp) |
| Implementation of pivot selection using operator(). | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| long | select_pivot_op (const DynArray< T > &a, const long l, const long r, const Compare &cmp=Compare()) |
| Selects a pivot element as the median between the ends and the center. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| long | select_pivot_op (const Array< T > &a, const long l, const long r, const Compare &cmp=Compare()) |
| Selects a pivot element as the median between the ends and the center. | |
| template<typename T , class Compare , typename Container > | |
| long | partition_op_impl (Container &a, const long l, const long r, const Compare &cmp) |
| Implementation of partitioning using operator(). | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| long | partition_op (DynArray< T > &a, const long l, const long r, const Compare &cmp=Compare()) |
| Partition a DynArray using operator(). | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| long | partition_op (Array< T > &a, const long l, const long r, const Compare &cmp=Compare()) |
| Partition an Array using operator(). | |
| template<typename Container , class Compare > | |
| static void | insertion_sort_range (Container &a, long l, long r, const Compare &cmp) |
| template<typename T , class Compare > | |
| static const T & | __random_select (DynArray< T > &a, const long i, long l, long r, const Compare &cmp=Compare()) |
| template<typename T , class Compare > | |
| static const T & | __random_select (Array< T > &a, const long i, long l, long r, const Compare &cmp=Compare()) |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| const T & | random_select (DynArray< T > &a, const long i, const Compare &cmp=Compare()) |
| Select the i-th smallest element in a DynArray. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| const T & | random_select (Array< T > &a, const long i, const Compare &cmp=Compare()) |
| Select the i-th smallest element in an Array. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| const T & | random_select (T *a, const long i, const long n, const Compare &cmp=Compare()) |
| Select the k-th smallest element in an array (Quickselect). | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| const T & | random_select (T *a, const long i, const long n, Compare &&cmp=Compare()) |
| Select the k-th smallest element in an array (convenience overload). | |
| template<class Compare > | |
| Dlink * | dlink_random_select (Dlink &list, const size_t i, const Compare &cmp=Compare()) |
| Random selection of the ith element from a list based on Dlink. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| Dnode< T > * | random_select (Dlink &list, const size_t i, const Compare &cmp=Compare()) |
| Random selection of the ith element from a list based on Dlink. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| T * | random_select (DynDlist< T > &list, const size_t i, const Compare &cmp=Compare()) |
| Random selection of the ith element from a dynamic list. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | selection_sort (DynArray< T > &a, const Compare &cmp=Compare()) |
| Sorts a dynamic array by the selection method. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | bubble_sort (DynArray< T > &a, const Compare &cmp=Compare()) |
| Sort a dynamic array using bubble sort. | |
| template<template< typename > class C, typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | insertion_sort (C< T > &a, const long l, const long r, const Compare &cmp=Compare()) |
| Sorts a dynamic array by the insert method. | |
| template<template< typename > class C, typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | insertion_sort (C< T > &a, const Compare &cmp=Compare()) |
See insertion_sort(). | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | shellsort (DynArray< T > &a, const Compare &cmp=Compare()) |
| Sort a dynamic array using Shell sort. | |
| static long | back_index (const long i) noexcept |
| Convert a 1-based heap index to a 0-based array index. | |
| template<typename T , class Compare > | |
| void | sift_up (DynArray< T > &table, const long n, const Compare &cmp) |
| Move an element up in a heap to restore heap property. | |
| template<typename T , class Compare > | |
| void | sift_down (DynArray< T > &table, const long start, const long n, const Compare &cmp) |
| Move an element down in a heap to restore heap property. | |
| template<typename T , class Compare > | |
| void | sift_down (DynArray< T > &table, const long n, const Compare &cmp) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | heapsort (DynArray< T > &a, const Compare &cmp=Compare()) |
| Sort a dynamic array using heapsort. | |
| template<template< typename > class C, typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| long | partition (C< T > &a, const long l, const long r, const Compare &cmp=Compare()) |
| Partition a container using the last element as pivot. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | quicksort_rec (DynArray< T > &a, const long l, const long r, const Compare &cmp=Compare()) |
| Recursively sort a dynamic array using quicksort. | |
| template<class Stack , class A , class B > | |
| void | push2 (Stack &stack, const A &a, const B &b) |
| Push two values onto a stack. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | quicksort (DynArray< T > &a, const Compare &cmp=Compare()) |
| Sorts a dynamic array by the quicksort method without recursion. | |
| template<typename T , class Compare > | |
| void | sift_down_subrange (DynArray< T > &a, long start, const long n, const long offset, const Compare &cmp) |
| Sift down operation for heapsort on a DynArray subrange. | |
| template<typename T , class Compare > | |
| void | heapsort_subrange (DynArray< T > &a, const long l, const long r, const Compare &cmp) |
| Heapsort implementation for a subrange of a DynArray. | |
| template<typename T , class Compare > | |
| void | introsort_loop (DynArray< T > &a, long l, long r, size_t depth_limit, const Compare &cmp) |
| Internal recursive function for introsort on DynArray. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | introsort (DynArray< T > &a, const Compare &cmp=Compare()) |
| Sort a dynamic array using introsort (introspective sort). | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| long | search_extreme (const DynArray< T > &a, const long l, const long r, const Compare &cmp=Compare()) |
| Generic search in a dynamic array of an extreme element. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::greater<T>> | |
| long | search_max (const DynArray< T > &a, const long l, const long r, const Compare &cmp=Compare()) |
| Returns the maximum element of the array a between l and r. | |
| template<template< typename > class C, typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| long | binary_search (const C< T > &a, const T &x, long l, long r, const Compare &cmp=Compare()) |
| Binary search on a sorted container. | |
| template<template< typename > class C, typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| long | binary_search (const C< T * > &a, const T &x, long l, long r, const Compare &cmp=Compare()) |
| Binary search on a sorted container of pointers. | |
| template<template< typename > class C, typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| long | binary_search (const C< T * > &a, const T &x, Compare &&cmp=Compare()) |
| Binary search on a sorted container of pointers (full range). | |
| template<template< typename > class C, typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| long | binary_search (const C< T > &a, const T &x, const Compare &cmp=Compare()) |
| Binary search on a dynamic ordered array. | |
| template<template< typename > class C, typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| DynList< size_t > | binary_search_dup (const C< T > &a, const T &x, const Compare &cmp=Compare()) |
| Binary search for all occurrences of a value. | |
| template<template< typename > class C, typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| Array< const T * > | build_index_ptr (const C< T > &a, const Compare &cmp=Compare()) |
| Build an index array of pointers for indirect sorting (const version). | |
| template<template< typename > class C, typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| DynList< const T * > | bsearch_dup (const C< T > &a, const T &x, const Compare &cmp=Compare()) |
| Search for all occurrences of a value returning pointers (const version). | |
| template<template< typename > class C, typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| T * | bsearch (C< T > &a, const T &x, const Compare &cmp=Compare()) |
| Search for a value in a sorted container returning a pointer. | |
| template<template< typename > class C, typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| const T * | bsearch (const C< T > &a, const T &x, const Compare &cmp=Compare()) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| template<template< typename > class C, typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| T * | bsearch (const C< T * > &a, const T &x, const Compare &cmp=Compare()) |
| Search for a value in a sorted container of pointers. | |
| template<template< typename > class C, typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| DynList< T * > | bsearch_dup (C< T > &a, const T &x, const Compare &cmp=Compare()) |
| Search for all occurrences of a value returning pointers. | |
| template<template< typename > class C, typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| DynList< T * > | bsearch_dup (const C< T * > &a, const T &x, const Compare &cmp=Compare()) |
| Search for all occurrences of a value in a container of pointers. | |
| template<template< typename > class C, typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| long | binindex (const C< T > &a, const T &x, const Compare &cmp=Compare()) |
| Returns the index where a value appears (or should be inserted) in a sorted container. | |
| template<template< typename > class C, typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| DynList< long > | binindex_dup (const C< T > &a, const T &x, const Compare &cmp=Compare()) |
| Returns the indices of all occurrences of a value in a sorted container. | |
| template<template< typename > class C, typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| DynList< long > | binindex_dup (const C< T * > &a, const T &x, const Compare &cmp=Compare()) |
| Search for all indices of a value in a sorted container of pointers. | |
| template<class C , StrictWeakOrder< sort_utils_detail::Indexed_Value_Type< C > > Compare = Aleph::less<sort_utils_detail::Indexed_Value_Type<C>>> | |
| Array< size_t > | build_index (const C &a, const Compare &cmp=Compare()) |
| Build an index array for indirect sorting. | |
| template<class C , StrictWeakOrder< sort_utils_detail::Indexed_Value_Type< C > > Compare = Aleph::less<sort_utils_detail::Indexed_Value_Type<C>>> | |
| Array< size_t > | stable_build_index (const C &a, const Compare &cmp=Compare()) |
| Build a stable index array for indirect sorting. | |
| template<template< typename > class C, typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| Array< T * > | build_index_ptr (C< T > &a, const Compare &cmp=Compare()) |
Builds and returns an array of pointers to the elements of container a sorted according to the comparison functor. | |
| template<template< typename > class C, typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| Array< const T * > | stable_build_index_ptr (const C< T > &a, const Compare &cmp=Compare()) |
| Build a stable index array of pointers for indirect sorting (const version). | |
| template<template< typename > class C, typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| Array< T * > | stable_build_index_ptr (C< T > &a, const Compare &cmp=Compare()) |
| Build a stable index array of pointers for indirect sorting. | |
| template<template< typename > class C, typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | quicksort_op (C< T > &a, const Compare &cmp=Compare(), const size_t threshold=Quicksort_Threshold) |
| Optimized quicksort for containers using operator(). | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| long | binary_search_rec (T *a, const T &x, const long l, const long r, const Compare &cmp=Compare()) |
| Recursive binary search on an ordered array. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| long | binary_search (T *a, const T &x, long l, long r, const Compare &cmp=Compare()) |
| Iterative binary search on an ordered array. | |
| template<typename KeyFn > requires std::invocable<const KeyFn &, size_t> | |
| and std::convertible_to< std::invoke_result_t< const KeyFn &, size_t >, int > void | counting_sort_indices (Array< size_t > &sa, Array< size_t > &tmp, const size_t n, const int min_key, const int max_key, const KeyFn &key_of) |
| Stable counting sort on an index array by integer keys. | |
| template<typename T > requires CountingSortable<T> | |
| void | counting_sort (DynArray< T > &a) |
| Stable counting sort for integral DynArray values. | |
| template<typename T > requires CountingSortable<T> | |
| void | counting_sort (Array< T > &a) |
| Stable counting sort for integral Array values. | |
| template<typename T > requires CountingSortable<T> | |
| void | counting_sort (DynList< T > &list) |
| Stable counting sort for integral DynList values. | |
| template<typename T > requires CountingSortable<T> | |
| void | counting_sort (DynDlist< T > &list) |
| Stable counting sort for integral DynDlist values. | |
| template<typename T > requires CountingSortable<T> | |
| void | counting_sort (T *a, const size_t n) |
| Stable counting sort for raw integral arrays. | |
| template<typename T , size_t N> requires CountingSortable<T> | |
| void | counting_sort (T(&a)[N]) |
| Stable counting sort for fixed-size integral C arrays. | |
| template<typename T > requires RadixSortable<T> | |
| void | radix_sort (DynArray< T > &a) |
| LSD radix sort for integral DynArray values. | |
| template<typename T > requires RadixSortable<T> | |
| void | radix_sort (Array< T > &a) |
| LSD radix sort for integral Array values. | |
| template<typename T > requires RadixSortable<T> | |
| void | radix_sort (DynList< T > &list) |
| LSD radix sort for integral DynList values. | |
| template<typename T > requires RadixSortable<T> | |
| void | radix_sort (DynDlist< T > &list) |
| LSD radix sort for integral DynDlist values. | |
| template<typename T > requires RadixSortable<T> | |
| void | radix_sort (T *a, const size_t n) |
| LSD radix sort for raw integral arrays. | |
| template<typename T , size_t N> requires RadixSortable<T> | |
| void | radix_sort (T(&a)[N]) |
| LSD radix sort for fixed-size integral C arrays. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>, class BucketKey > | |
| void | bucket_sort (T *a, const size_t n, const size_t num_buckets, const BucketKey &bucket_key, const Compare &cmp=Compare()) |
| Bucket sort with user-supplied bucket mapping. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> requires std::floating_point<T> | |
| void | bucket_sort (T *a, const size_t n, const Compare &cmp=Compare()) |
| Bucket sort convenience for floating-point arrays. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> requires std::floating_point<T> | |
| void | bucket_sort (DynArray< T > &a, const Compare &cmp=Compare()) |
| Bucket sort for DynArray (floating-point convenience). | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> requires std::floating_point<T> | |
| void | bucket_sort (Array< T > &a, const Compare &cmp=Compare()) |
| Bucket sort for Array (floating-point convenience). | |
| template<typename T , size_t N, StrictWeakOrder< T > Compare = Aleph::less<T>> requires std::floating_point<T> | |
| void | bucket_sort (T(&a)[N], const Compare &cmp=Compare()) |
| Bucket sort for fixed-size C arrays (floating-point convenience). | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> requires std::floating_point<T> | |
| void | bucket_sort (DynList< T > &list, const Compare &cmp=Compare()) |
| Bucket sort for DynList (floating-point convenience). | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>, class BucketKey > | |
| void | bucket_sort (DynArray< T > &a, const size_t num_buckets, const BucketKey &bucket_key, const Compare &cmp=Compare()) |
| Bucket sort for DynArray with user-supplied bucket mapping. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>, class BucketKey > | |
| void | bucket_sort (Array< T > &a, const size_t num_buckets, const BucketKey &bucket_key, const Compare &cmp=Compare()) |
| Bucket sort for Array with user-supplied bucket mapping. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | timsort (T *a, const size_t n, const Compare &cmp=Compare()) |
| Timsort — adaptive, stable, natural merge sort. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | timsort (T *a, const long l, const long r, const Compare &cmp=Compare()) |
| Timsort on a sub-range [l, r] (inclusive indices). | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | timsort (DynArray< T > &a, const Compare &cmp=Compare()) |
| Timsort for DynArray. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | timsort (Array< T > &a, const Compare &cmp=Compare()) |
| Timsort for Array. | |
| template<typename T , size_t N, StrictWeakOrder< T > Compare = Aleph::less<T>> requires std::is_invocable_r_v<bool, Compare, const T &, const T &> | |
| void | timsort (T(&a)[N], const Compare &cmp=Compare()) |
| Timsort for fixed-size C arrays. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | timsort (DynList< T > &list, const Compare &cmp=Compare()) |
| Timsort for DynList. | |
| template<typename T , StrictWeakOrder< T > Compare = Aleph::less<T>> | |
| void | timsort (DynDlist< T > &list, const Compare &cmp=Compare()) |
| Timsort for DynDlist. | |
| template<class Node > | |
| static void | clone_tree (Node *src, Node *tgt) |
| Copies the subtrees of the children of src as children of tgt. | |
| template<class Node > | |
| Node * | clone_tree (Node *root) |
| Returns a copy of the tree rooted at root. | |
| template<class Node > | |
| static void | __tree_preorder_traversal (Node *root, const int &level, const int &child_index, void(*visitFct)(Node *, int, int)) |
| template<class Node > | |
| void | tree_preorder_traversal (Node *root, void(*visitFct)(Node *, int, int)) |
| Preorder traversal of a tree. | |
| template<class Node > | |
| void | forest_preorder_traversal (Node *root, void(*visitFct)(Node *, int, int)) |
| Preorder traversal of a forest. | |
| template<class Node > | |
| static void | __tree_postorder_traversal (Node *node, const int &level, const int &child_index, void(*visitFct)(Node *, int, int)) |
| template<class Node > | |
| void | tree_postorder_traversal (Node *root, void(*visitFct)(Node *, int, int)) |
| Postorder traversal of a tree. | |
| template<class Node > | |
| void | forest_postorder_traversal (Node *root, void(*visitFct)(Node *, int, int)) |
| Postorder traversal of a forest. | |
| template<class Node , class Eq > | |
| bool | are_tree_equal (Node *t1, Node *t2, Eq &eq) |
| Returns true if t1 is equal to t2. | |
| template<class Node , class Eq = std::equal_to<typename Node::key_type>> | |
| bool | are_tree_equal (Node *t1, Node *t2, Eq &&eq=Eq()) |
| template<class Node > | |
| void | destroy_tree (Node *root) |
| Destroys (frees memory) the tree whose root is root. | |
| template<class Node > | |
| void | destroy_forest (Node *root) |
| Destroys (frees memory) the forest whose first tree is root. | |
| template<class Node > | |
| size_t | compute_height (Node *root) |
| Computes the height of the tree root. | |
| template<class Node > | |
| static Node * | __deway_search (Node *node, int path[], const int &idx, const size_t &size) |
| template<class Node > | |
| Node * | deway_search (Node *root, int path[], const size_t &size) |
| Returns a node of a forest given its Dewey number. | |
| template<class Node , class Equal > | |
| static Node * | __search_deway (Node *root, const typename Node::key_type &key, const size_t ¤t_level, int deway[], const size_t &size, size_t &n) |
| template<class Node , class Equal = Aleph::equal_to<typename Node::key_type>> | |
| Node * | search_deway (Node *root, const typename Node::key_type &key, int deway[], const size_t &size, size_t &n) |
| Searches key in a forest and computes the Dewey number of the node containing the key. | |
| template<class TNode , class BNode > | |
| BNode * | forest_to_bin (TNode *root) |
| Converts a forest to its equivalent binary tree. | |
| template<class TNode , class BNode > | |
| static void | insert_child (BNode *lnode, TNode *tree_node) |
| template<class TNode , class BNode > | |
| static void | insert_sibling (BNode *rnode, TNode *tree_node) |
| template<class TNode , class BNode > | |
| static void | bin_to_tree (BNode *broot, TNode *troot) |
| template<class TNode , class BNode > | |
| TNode * | bin_to_forest (BNode *broot) |
| Converts a binary tree to its equivalent forest. | |
| template<class Node > | |
| unsigned long & | PRIO (Node *p) noexcept |
| Access the priority of a treap node. | |
| template<class Node > | |
| bool | is_treap (Node *root) noexcept |
| Validate that a tree satisfies treap (heap) property. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| Array< size_t > | tree_subtree_sizes (const GT &g, typename GT::Node *root, SA sa=SA()) |
| Compute subtree sizes for every node. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| Array< size_t > | tree_max_distance (const GT &g, typename GT::Node *root, SA sa=SA()) |
| Compute the maximum distance from each node to any leaf. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| Array< size_t > | tree_sum_of_distances (const GT &g, typename GT::Node *root, SA sa=SA()) |
| Compute sum of distances from each node to all others. | |
| template<AlephGraph GT, ArcFilter< GT > SA = Dft_Show_Arc<GT>> | |
| void | warshall_compute_transitive_clausure (GT &g, Bit_Mat_Graph< GT, SA > &mat, SA sa=SA()) |
| Computes the transitive closure of a graph using Warshall's algorithm. | |
Variables | |
| constexpr unexpect_t | unexpect {} |
Tag value of type unexpect_t. | |
| constexpr size_t | dynamic_extent = static_cast<size_t>(-1) |
| Sentinel marking an axis whose extent is only known at run time. | |
| template<typename... Args> | |
| constexpr bool | are_stream_insertable_v |
| bool | daemonized = false |
| Flag indicating if the process is running as a daemon. | |
| const IPv4_Address | Null_IPv4_Address = 0 |
| Null/invalid IPv4 address constant. | |
| bool | verbose = false |
| Flag enabling verbose output. | |
| double | max_time = 300 |
| Maximum allowed execution time (in seconds). | |
| const int | UnknownSize = -1 |
| Constant indicating unknown size. | |
| const int | UnknownLine = -1 |
| Constant indicating unknown line number. | |
| const int | UnknownLoad = -1 |
| Constant indicating unknown load factor. | |
| template<AlephSequentialIterableContainer Container, class Hash , class Equal > requires (const typename Container::Item_Type &v, Hash h, Equal e) | |
| and | |
| Check uniqueness with explicit hash + equality functors. | |
| const unsigned char | Unprocessed = 0 |
| The node have not bees processed. | |
| const unsigned char | Processing = 1 |
| The node are being processed; probably it is inside a queue, stack or heap. | |
| const unsigned char | Processed = 2 |
| The node or arc has already been processed. | |
| static const long | No_Visited = 0 |
| Gsl_Compatible_Rng * | rand_gen = nullptr |
| Internal RNG handle used by the helper functors in this header. | |
| template<class Container > | |
| constexpr bool | filter_iterator_keeps_copy |
| Whether a Filter_Iterator keeps a copy of its container, and not its address. | |
| constexpr size_t | Max_Tree_Node_Depth = 1024 |
| The depth of the trees that generate_tree() wrote before 7.3.2; it writes trees of any depth now. | |
| const float | hash_default_lower_alpha = 0.25 |
| const float | hash_default_upper_alpha = 0.90 |
| const unsigned | Default_Hash_Seed = 52679987 |
| static long | tab [256] |
| static std::once_flag | jsw_init_flag |
| static std::atomic< bool > | init {false} |
| static std::shared_mutex | jsw_mtx |
| static constexpr std::uint32_t | Aleph_Snd_Hash_Seed = 0x9e3779b9u |
| Fixed seed used by the secondary hash function. | |
| const Geom_Number | LINE_EPSILON (0) |
| Default epsilon for geometric comparisons. | |
| constexpr size_t | MIN_NODE_FIELDS = 7 |
| Minimum expected columns for a node record. | |
| constexpr size_t | Buffer_Size = 512 |
| Default buffer size for token parsing. | |
| int | current_line_number = 1 |
| Current line number in the input stream. | |
| int | current_col_number = 1 |
| Current column number in the input stream. | |
| int | previous_line_number = 1 |
| Line number at the start of the current token. | |
| int | previous_col_number = 1 |
| Column number at the start of the current token. | |
| std::string | token_instance |
| The most recently scanned token. | |
| constexpr double | PI = 3.1415926535897932384626433832795028841971693993751 |
| constexpr double | PI_2 = PI / 2.0 |
| constexpr double | PI_4 = PI / 4.0 |
| constexpr size_t | Search_Unlimited = std::numeric_limits<size_t>::max() |
| Sentinel used by SearchLimits to mean "no bound". | |
| template<class Fct , class... Args> | |
| constexpr bool | nothrow_condition_v |
Whether calling Fct with Args, and taking its result as a bool in either way, cannot throw. | |
| template<class Cmp , class Key > | |
| constexpr bool | nothrow_compare_keys_v |
Whether the calls of Cmp that compare two keys of type Key, constant or not, give a bool without throwing. | |
| template<class Compare , class Key > | |
| constexpr bool | nothrow_compare_v |
Whether Compare compares two keys of type Key without throwing, as the operations of the trees call it. | |
| template<class Compare , class Key > | |
| constexpr bool | nothrow_compare_copy_v |
Whether Compare compares two keys of type Key without throwing, as nothrow_compare_v, and can be copied without throwing. | |
| constexpr size_t | Bin_Tree_Depth_Bound = 128 |
| Depth up to which the traversals below work inside the call stack. | |
| template<class GT , class SA > | |
| constexpr bool | nothrow_arc_filter_v |
| Whether a filter of type SA of the arcs of GT is copied, moved and called without exceptions: then an iterator that it filters, and a search through one, throw nothing. | |
| constexpr long | Cross_Arc = -1 |
| Special marker for arcs connecting a cut node to a non-cut block. | |
| size_t | Insertion_Threshold = 40 |
| Threshold for switching to insertion sort in hybrid algorithms. | |
| size_t | Quicksort_Threshold = 40 |
| Threshold for using quicksort vs simpler algorithms. | |
| const int | Not_Found = -1 |
| Return value for search functions when element is not found. | |
| template<typename F , typename T > | |
| constexpr bool | is_known_non_idempotent_op |
True if F is known not to be idempotent over T. | |
| const long | Max_Priority = ULONG_MAX |
| Maximum priority value (used for sentinel/leaves) | |
| const long | Min_Priority = 0 |
| Minimum priority value. | |
| bool | with_power = false |
| Configuration options for DOT file generation. | |
| bool | with_nes = false |
| If true, include NES percentage in node labels. | |
| bool | only_num = false |
| If true, show only the node number, not the full label. | |
| bool | with_class = false |
| If true, set node shapes based on class field. | |
| size_t | font_size = 6 |
| Font size for the DOT output. | |
| bool | vertical = true |
| If true, use vertical layout (default). | |
Main namespace for Aleph-w library functions.
When compiling with libc++, the gmpxx library's low-level stream operators (compiled against libstdc++) are unavailable.
The gmpxx header template operator<<(__gmp_expr<T,U>) ultimately calls o << temp.__get_mp(), which resolves to these overloads. Provide them here so that all GMP expression types can be printed, not just mpq_class.
| using Aleph::__Net_Iterator = typedef Digraph_Iterator<Net, Net_Filt<Net> > |
| using Aleph::AdversarialTranspositionTable = typedef Transposition_Table<AdversarialTranspositionKey<StateKey>, AdversarialTranspositionEntry<Move, Score>, HashMapTable, Cmp, Prefer_Exact_Adversarial_Entry<Move, Score> > |
| using Aleph::AP_Res_Net = typedef Array_Digraph<Net_Node<Empty_Class>, __Res_Arc<Net> > |
| using Aleph::Arco = typedef Graph_Arc<std::string> |
Arc type for the digraph (edge info is a string).
Definition at line 99 of file load_digraph.H.
| using Aleph::B_Tree = typedef Gen_B_Tree<Key, Compare, MinDegree> |
Convenient B-Tree alias.
| Key | Key type stored in the tree. |
| Compare | Ordering functor. |
| MinDegree | Minimum degree t. |
Definition at line 940 of file tpl_b_tree.H.
| using Aleph::Binary_Lifting_LCA = typedef Gen_Binary_Lifting_LCA<GT, SA> |
| using Aleph::bounded_channel = typedef BoundedChannel<T> |
Alias for Aleph::BoundedChannel.
| T | Value type stored in the channel. |
BoundedChannel<T>. Definition at line 1452 of file concurrency_utils.H.
| using Aleph::BPlus_Tree = typedef Gen_BPlus_Tree<Key, Compare, MinDegree> |
Convenient B+ Tree alias.
| Key | Key type stored in the tree. |
| Compare | Ordering functor. |
| MinDegree | Minimum degree t. |
Definition at line 1175 of file tpl_bplus_tree.H.
| using Aleph::Centroid_Decomposition = typedef Gen_Centroid_Decomposition<GT, SA> |
Convenience alias for centroid decomposition.
Definition at line 1669 of file Tree_Decomposition.H.
| typedef DynMapTree<std::string, BitArray, Treap_Vtl> Aleph::Code_Map |
| typedef unsigned char Aleph::Color |
Definition at line 50 of file rbNodeRk.H.
| using Aleph::Compare_Snodenc = typedef Compare_Tnode<Slinknc, Snodenc, T, Compare> |
Comparator specialization for Snodenc objects.
Definition at line 520 of file tpl_sort_utils.H.
| using Aleph::Compiler_Bytecode_Block_Id = typedef size_t |
Definition at line 79 of file Bytecode.H.
| using Aleph::Compiler_Bytecode_Constant_Id = typedef size_t |
Definition at line 77 of file Bytecode.H.
| using Aleph::Compiler_Bytecode_Function_Id = typedef size_t |
Definition at line 78 of file Bytecode.H.
| using Aleph::Compiler_Bytecode_PC = typedef size_t |
Definition at line 80 of file Bytecode.H.
| using Aleph::Compiler_Bytecode_Register_Id = typedef size_t |
Definition at line 76 of file Bytecode.H.
| using Aleph::Compiler_CFG_Block_Id = typedef size_t |
Typedef for unique block identifiers within a function.
Definition at line 71 of file Compiler_CFG.H.
| using Aleph::Compiler_IR_Block_Id = typedef size_t |
Definition at line 69 of file Compiler_IR_Model.H.
| using Aleph::Compiler_IR_Function_Id = typedef size_t |
Definition at line 68 of file Compiler_IR_Model.H.
| using Aleph::Compiler_IR_Global_Slot_Id = typedef size_t |
Definition at line 67 of file Compiler_IR_Model.H.
| using Aleph::Compiler_IR_Local_Slot_Id = typedef size_t |
Definition at line 66 of file Compiler_IR_Model.H.
| using Aleph::Compiler_IR_Value_Id = typedef size_t |
Definition at line 65 of file Compiler_IR_Model.H.
| using Aleph::Compiler_SSA_Block_Id = typedef size_t |
| using Aleph::Compiler_SSA_Value_Id = typedef size_t |
| using Aleph::Compiler_Symbol_Id = typedef size_t |
Definition at line 52 of file Compiler_Symbol_Bindings.H.
| using Aleph::Compiler_Type_Constraint = typedef Equality_Constraint<Compiler_Type_Id> |
Definition at line 142 of file tpl_constraints.H.
| using Aleph::Compiler_Type_Constraint_Set = typedef Constraint_Set<Compiler_Type_Id> |
Definition at line 143 of file tpl_constraints.H.
| using Aleph::Compiler_Type_Id = typedef size_t |
Definition at line 64 of file Compiler_Types.H.
| using Aleph::const_iterator_t = typedef Const_Iterator<typename C::Iterator> |
The read-only iterator of the container C.
| C | a container with a nested Iterator. |
Definition at line 538 of file ah-iterator.H.
| using Aleph::Default_Planar_Dual_Graph = typedef List_Graph<Graph_Node<size_t>, Graph_Arc<Planar_Dual_Edge_Info<GT> >> |
Definition at line 454 of file Planarity_Test.H.
| using Aleph::dextents = typedef typename decltype(mdspan_detail::dextents_of<IndexType>( std::make_index_sequence<Rank>{}))::type |
extents<IndexType, ...> with all Rank axes dynamic — the common case.
Definition at line 402 of file ah-mdspan.H.
| using Aleph::Df_Low_Non_Tree_Arc = typedef std::pair<Df_Low_Tree_Node *, Df_Low_Tree_Node *> |
Arc of the graph that is not in the depth-first tree.
The tree nodes of its two ends: first the descendant, then the ancestor.
Definition at line 117 of file generate_df_tree.H.
| using Aleph::Df_Low_Tree_Node = typedef Tree_Node<Df_Low_Key> |
Node of the depth-first tree that build_df_low_tree() returns.
Definition at line 110 of file generate_df_tree.H.
| using Aleph::Digrafo = typedef List_Digraph<Nodo, Arco> |
Digraph type used by the loader.
Definition at line 102 of file load_digraph.H.
| using Aleph::Distinct_Count_Mo = typedef Gen_Mo_Algorithm<T, Distinct_Count_Policy<T> > |
Mo's algorithm specialised for counting distinct elements.
| T | Element type (must be hashable). |
Definition at line 583 of file tpl_mo_algorithm.H.
| typedef Field<double> Aleph::Double |
| using Aleph::DynHashMap = typedef HashMap<Key, Data, HashMapTable, Cmp> |
Alias for HashMap (for consistency with other Dyn containers).
Defaults to MapOLhash (linear probing) for better cache locality. Use MapODhash explicitly when double-hashing distribution is preferred.
Definition at line 183 of file tpl_hash.H.
| using Aleph::DynHashSet = typedef HashSet<Key, HashSetTable, Cmp> |
Alias for HashSet (for consistency with other Dyn containers).
Defaults to OLhashTable (linear probing) for better cache locality. Use ODhashTable explicitly when double-hashing distribution is preferred.
Definition at line 174 of file tpl_hash.H.
| using Aleph::Euler_RMQ_LCA = typedef Gen_Euler_RMQ_LCA<GT, SA> |
| using Aleph::ExceptionCallback = typedef std::function<void(std::exception_ptr)> |
Type for exception callback in detached tasks.
Definition at line 606 of file thread_pool.H.
| using Aleph::Feasible_Tree = typedef std::tuple<DynList<typename Net::Arc *>, DynList<typename Net::Arc *>, DynList<typename Net::Arc *> > |
Feasible spanning tree classification.
Tuple of (empty arcs, full arcs, partial arcs) where:
| Net | Network type. |
Definition at line 1081 of file tpl_netcost.H.
| using Aleph::File_B_Map = typedef Gen_File_B_Map<Key, Value, Compare, MinDegree, KeyCodec, ValueCodec> |
Convenient alias for a persistent B-Tree map.
Definition at line 715 of file tpl_file_b_map.H.
| using Aleph::File_B_Tree = typedef Gen_File_B_Tree<Key, Compare, MinDegree, Codec> |
Convenient alias for a page-managed persistent B-Tree.
Definition at line 2663 of file tpl_file_b_tree.H.
| using Aleph::File_BPlus_Map = typedef Gen_File_BPlus_Map<Key, Value, Compare, MinDegree, KeyCodec, ValueCodec> |
Convenient alias for a persistent B+ Tree map.
Definition at line 744 of file tpl_file_bplus_map.H.
| using Aleph::File_BPlus_Tree = typedef Gen_File_BPlus_Tree<Key, Compare, MinDegree, Codec> |
Convenient alias for a page-managed persistent B+ Tree.
Definition at line 2881 of file tpl_file_bplus_tree.H.
| using Aleph::Find_Aumenting_Path_BFS = typedef Find_Aumenting_Path<Net, DynListQueue> |
| using Aleph::Find_Aumenting_Path_DFS = typedef Find_Aumenting_Path<Net, DynListStack> |
Augmenting-path finder using DFS (stack).
| typedef Field<float> Aleph::Float |
| using Aleph::Freq_Node = typedef BinNode<std::pair<std::string, size_t> > |
| using Aleph::FunnelPortal = typedef detail::SPP_Portal |
Definition at line 1237 of file tikzgeom_algorithms.H.
| using Aleph::Geom_Number = typedef mpq_class |
| using Aleph::Graph_Traverse_BFS_Generator = typedef Graph_Traverse_Generator<GT, Itor, DynListQueue, Show_Arc> |
Lazy breadth-first traversal: Graph_Traverse_Generator with a DynListQueue frontier.
Mirrors Graph_Traverse_BFS.
Definition at line 252 of file graph-traverse-generators.H.
| using Aleph::Graph_Traverse_DFS_Generator = typedef Graph_Traverse_Generator<GT, Itor, DynListStack, Show_Arc> |
Lazy depth-first traversal: Graph_Traverse_Generator with a DynListStack frontier.
Mirrors Graph_Traverse_DFS.
Definition at line 246 of file graph-traverse-generators.H.
| using Aleph::Heavy_Light_Decomposition = typedef Gen_Heavy_Light_Decomposition<GT, SA> |
Convenience alias for heavy-light decomposition.
Definition at line 1658 of file Tree_Decomposition.H.
| using Aleph::HLD_Path_Query = typedef Gen_HLD_Path_Query<GT, T, Op, SA> |
Convenience alias for segment-tree-backed HLD queries.
Definition at line 1665 of file Tree_Decomposition.H.
| typedef BinHeap<size_t> Aleph::Huffman_Heap |
| using Aleph::Incumbent = typedef BestSolution<Solution, Compare> |
Alias used by optimization/search engines for their current best.
Definition at line 604 of file state_search_common.H.
| using Aleph::Info_Nodo = typedef std::pair<std::string, DynDlist<std::string> > |
Node payload: (id, fields) where fields come from the input row.
Definition at line 93 of file load_digraph.H.
| typedef Field<int> Aleph::Integer |
| using Aleph::Interpreter_Host_Function = typedef bool (*)(void *user_data, const DynArray<Interpreter_Value> &arguments, Interpreter_Value &result, Interpreter_Runtime_Error &error) |
Host callback signature used by runtime built-ins or embeddings.
| user_data | Opaque embedding-owned pointer. |
| arguments | Positional arguments already evaluated by the runtime. |
| result | Output slot for the produced runtime value. |
| error | Output slot for structured runtime failures. |
true on success, false if error was populated. Definition at line 179 of file Interpreter_Runtime.H.
| using Aleph::interval_endpoint_t = typedef typename interval_endpoint<Key>::type |
Definition at line 251 of file tpl_interval_tree.H.
| using Aleph::IntMultiPolynomial = typedef Gen_MultiPolynomial<long long, Grevlex_Order> |
Multivariate polynomial with integer (long long) coefficients, grevlex.
Definition at line 4606 of file tpl_multi_polynomial.H.
| using Aleph::IntMultiPolynomial_Lex = typedef Gen_MultiPolynomial<long long, Lex_Order> |
Multivariate polynomial with integer (long long) coefficients, lex.
Definition at line 4609 of file tpl_multi_polynomial.H.
| using Aleph::IntPolynomial = typedef Gen_Polynomial<long long> |
Polynomial with long long (integer) coefficients.
Definition at line 2940 of file tpl_polynomial.H.
| typedef uint32_t Aleph::IPv4_Address |
| using Aleph::Item_Type = typedef T |
| using Aleph::Karger_Stein_Min_Cut = typedef Karger_Min_Cut<GT, SA> |
Alias for Karger_Min_Cut (use fast() method for Karger-Stein)
The Karger-Stein algorithm is implemented as the fast() method in Karger_Min_Cut. This alias is provided for clarity.
| GT | Graph type |
| SA | Arc filter (default: show all arcs) |
Definition at line 105 of file Karger_Stein.H.
| typedef Field<long double> Aleph::Ldouble |
| using Aleph::Link_Cut_Tree = typedef Gen_Link_Cut_Tree<int> |
Convenience alias for a connectivity-only Link-Cut Tree.
Uses the DefaultMonoid and NoLazyTag, meaning it only stores an int per vertex and is typically used just for structural operations (link, cut, connected, lca).
Definition at line 1143 of file tpl_link_cut_tree.H.
| using Aleph::Link_Cut_Tree_WithEdges = typedef Gen_Link_Cut_Tree_WithEdges<int, EdgeT, Monoid> |
Convenience alias for edge-weighted Link-Cut Tree.
Definition at line 581 of file tpl_link_cut_tree_with_edges.H.
| using Aleph::ModularMatrix = typedef Modular_Matrix<Array<Array<uint64_t> >> |
Alias for common Array-based modular matrix.
Recommended for dense matrices where O(1) access is prioritized over memory efficiency for zeros.
Definition at line 393 of file modular_linalg.H.
| using Aleph::ModularSparseMatrix = typedef Modular_Matrix<DynMatrix<uint64_t> > |
Alias for sparse DynMatrix-based modular matrix.
Recommended for large sparse matrices where unwritten entries (zeros) should not consume memory.
Definition at line 400 of file modular_linalg.H.
| using Aleph::mpsc_queue = typedef MpscQueue<T> |
Alias for Aleph::MpscQueue.
| T | Value type stored in the queue. |
MpscQueue<T>. Definition at line 354 of file tpl_mpsc_queue.H.
| using Aleph::MultiPolynomial = typedef Gen_MultiPolynomial<double, Grevlex_Order> |
Multivariate polynomial with double coefficients, grevlex.
Definition at line 4597 of file tpl_multi_polynomial.H.
| using Aleph::MultiPolynomial_Grlex = typedef Gen_MultiPolynomial<double, Grlex_Order> |
Multivariate polynomial with grlex ordering.
Definition at line 4603 of file tpl_multi_polynomial.H.
| using Aleph::MultiPolynomial_Lex = typedef Gen_MultiPolynomial<double, Lex_Order> |
Multivariate polynomial with lex ordering.
Definition at line 4600 of file tpl_multi_polynomial.H.
| using Aleph::Net_Cost_Node = typedef Net_Node<Node_Info> |
Node type alias for cost networks.
Uses the same node type as regular flow networks.
| Node_Info | Type of information stored in the node. |
Definition at line 74 of file tpl_netcost.H.
| using Aleph::Net_Iterator = typedef Filter_Iterator<typename Net::Node *, __Net_Iterator<Net>, Show_Arc> |
| using Aleph::Net_Node = typedef Graph_Anode<Node_Info> |
| using Aleph::Nodo = typedef Graph_Node<Info_Nodo> |
Node type for the digraph.
Definition at line 96 of file load_digraph.H.
| using Aleph::Packed_Matrix_Of = typedef typename packed_matrix_detail::Columns_At<Columns, std::make_index_sequence<Columns.size()> >::Matrix |
Packed_Matrix whose columns are the entries of an array.
The same type as Packed_Matrix<Columns[0], Columns[1], ...>; see Packed_Row_Of for the array. A whole row of many columns is best written on a copy, column by column:
| Columns | A std::array<Bit_Column, N>, with N from 1 to 65535, given by any constant expression. |
Definition at line 1295 of file tpl_packed_matrix.H.
| using Aleph::Packed_Row_Of = typedef typename packed_matrix_detail::Columns_At<Columns, std::make_index_sequence<Columns.size()> >::Row |
Packed_Row whose columns are the entries of an array.
The same type as Packed_Row<Columns[0], Columns[1], ...>. A row of many columns is easier to describe with code than with one template argument per column:
Two arrays with the same columns give the same type, whatever their names. A few columns can be written in place: Packed_Row_Of<std::array{bits(1), bits(8), signed_bits(11)}>.
| Columns | A std::array<Bit_Column, N>, with N from 1 to 65535, given by any constant expression. A C array decays to a pointer, which is refused: pass std::to_array(columns). |
Definition at line 1268 of file tpl_packed_matrix.H.
| using Aleph::pair = typedef std::pair<First, Second> |
Alias to std::pair kept for backwards compatibility.
Aleph historically provided its own pair type prior to C++11. Modern compilers already ship a standards-compliant implementation in <utility>, so this header simply re-exports that type within the Aleph namespace to avoid code churn in legacy headers.
All constructors, assignment operators and comparison operators behave exactly like the ones provided by std::pair.
| First | First element type. |
| Second | Second element type. |
| using Aleph::Parc = typedef std::tuple<typename Net::Arc *, bool> |
| using Aleph::Polynomial = typedef Gen_Polynomial<double> |
Polynomial with double coefficients.
Definition at line 2931 of file tpl_polynomial.H.
| using Aleph::PolynomialF = typedef Gen_Polynomial<float> |
Polynomial with float coefficients.
Definition at line 2934 of file tpl_polynomial.H.
| using Aleph::PolynomialLD = typedef Gen_Polynomial<long double> |
Polynomial with long double coefficients.
Definition at line 2937 of file tpl_polynomial.H.
| using Aleph::Powerful_Array_Mo = typedef Gen_Mo_Algorithm<T, Powerful_Array_Policy<T> > |
Mo's algorithm specialised for the "powerful array" query.
| T | Arithmetic element type. |
Definition at line 590 of file tpl_mo_algorithm.H.
| using Aleph::PP_Res_Net = typedef Array_Digraph<PP_Res_Node<Net>, __Res_Arc<Net> > |
| using Aleph::Range_Mode_Mo = typedef Gen_Mo_Algorithm<T, Range_Mode_Policy<T> > |
Mo's algorithm specialised for range mode queries.
| T | Element type (must be hashable). |
Definition at line 597 of file tpl_mo_algorithm.H.
| using Aleph::Reroot_DP = typedef Gen_Reroot_DP<GT, T, SA> |
Convenient alias for Gen_Reroot_DP.
| GT | Graph type. |
| T | Value type. |
| SA | Arc filter. |
| using Aleph::Residual_Net = typedef Net_Cost_Graph<Net_Node<Empty_Class>, Res_Arc<Ftype> > |
Residual network type alias.
| Ftype | Flow/cost numeric type. |
Definition at line 560 of file tpl_netcost.H.
| using Aleph::RStarTree = typedef RTree<Payload, MaxEntries, MinEntries, RTreeVariant::RStar> |
Dynamic R*-tree spatial index (R-tree with the R*-tree heuristics).
| Payload | Value associated with each stored bounding box. |
| MaxEntries | Maximum number of entries per node (>= 2). |
| MinEntries | Minimum number of entries per non-root node. Defaults to MaxEntries / 2; must satisfy 2 * MinEntries <= MaxEntries + 1. |
Definition at line 82 of file tpl_r_star_tree.H.
| using Aleph::rw_synchronized = typedef RwSynchronized<T, SharedMutex> |
Alias for Aleph::RwSynchronized.
| T | Protected value type. |
| SharedMutex | Shared mutex type guarding the value. |
RwSynchronized<T, SharedMutex>. Definition at line 1470 of file concurrency_utils.H.
| using Aleph::SearchClock = typedef std::chrono::steady_clock |
Monotonic clock used for search timings.
Definition at line 105 of file state_search_common.H.
| using Aleph::SearchPath = typedef Array<Move> |
Default Aleph container used to store a move path.
Definition at line 103 of file state_search_common.H.
| using Aleph::SearchStorageMap = typedef DynHashMap<Key, Data, HashMapTable, Cmp> |
Aleph hash map alias for memoization/transposition storage.
| Key | Cache key type. |
| Data | Stored value type. |
| HashMapTable | Aleph hash-table backend. |
| Cmp | Equality comparator for keys. |
Definition at line 123 of file state_search_common.H.
| using Aleph::SearchStorageSet = typedef DynHashSet<Key, HashSetTable, Cmp> |
Aleph hash set alias for visited-state storage.
| Key | Key type to store in the set. |
| HashSetTable | Aleph hash-table backend. |
| Cmp | Equality comparator for keys. |
Definition at line 134 of file state_search_common.H.
| using Aleph::SemiPath = typedef std::tuple<bool, typename Net::Flow_Type, DynList<Parc<Net> >> |
| using Aleph::SetODhash = typedef ODhashTable<Key, Cmp> |
Definition at line 1233 of file tpl_odhash.H.
| using Aleph::SetOLhash = typedef OLhashTable<Key, Cmp> |
Definition at line 781 of file tpl_olhash.H.
| typedef Field<short> Aleph::Short |
| using Aleph::size_type = typedef size_t |
| using Aleph::Source_File_Id = typedef size_t |
Definition at line 61 of file ah-source.H.
| using Aleph::Source_Offset = typedef size_t |
Definition at line 62 of file ah-source.H.
| using Aleph::spsc_queue = typedef SpscQueue<T> |
Alias for Aleph::SpscQueue.
| T | Value type stored in the queue. |
SpscQueue<T>. Definition at line 1478 of file concurrency_utils.H.
| using Aleph::Symbol_Map = typedef DynMapTree<std::string, Huffman_Node *, Treap_Vtl> |
| using Aleph::synchronized = typedef Synchronized<T, Mutex> |
Alias for Aleph::Synchronized.
| T | Protected value type. |
| Mutex | Mutex type guarding the value. |
Synchronized<T, Mutex>. Definition at line 1461 of file concurrency_utils.H.
| typedef std::decay_t< typename HeadC::Item_Type > Aleph::T |
| using Aleph::to_index_tuple = typedef typename make_index_tuple<sizeof...(Types)>::type |
Convenience alias to generate an index tuple from a parameter pack.
| Types | The types whose count determines the index sequence length. |
Definition at line 292 of file ah-stl-utils.H.
| using Aleph::Tree_DP = typedef Gen_Tree_DP<GT, T, SA> |
Convenient alias for Gen_Tree_DP.
| GT | Graph type. |
| T | Value type. |
| SA | Arc filter. |
| using Aleph::Tuple_Type = typedef decltype(std::tuple_cat(std::declval<std::tuple<T> >(), std::declval<typename ZipIterator<TailC...>::Tuple_Type>())) |
The tuple type returned by get_curr() and get_curr_ne()
|
strong |
Trace event kinds emitted by adversarial search engines.
| Enumerator | |
|---|---|
| Enter_Node | One search node has just been entered. |
| Exit_Node | One search node finished with an exact local result. |
| Terminal_Node | A terminal state was evaluated. |
| Depth_Cutoff | Search stopped at the configured horizon. |
| Domain_Prune | Domain-side pruning hook discarded the state. |
| Expansion_Limit | Search stopped because the expansion limit was hit. |
| Alpha_Beta_Cutoff | One Alpha-Beta fail-high cutoff occurred. |
| Transposition_Hit | One cached transposition entry was reused. |
| Iteration_Begin | One iterative-deepening iteration started. |
| Iteration_End | One iterative-deepening iteration completed. |
| Aspiration_Retry | An aspiration window failed and was widened. |
| Enumerator | |
|---|---|
| Bp_White | |
| Bp_Red | |
| Bp_Blue | |
Definition at line 63 of file tpl_bipartite.H.
|
strong |
Associativity metadata for binary operators.
Determines how operators of the same precedence are grouped (e.g., a - b - c).
| Enumerator | |
|---|---|
| None | The operator is not associative (e.g., chained comparators prohibited). |
| Left | Left-associative: |
| Right | Right-associative: |
Definition at line 53 of file Compiler_Token.H.
|
strong |
Built-in scalar types available in the MVP type graph.
| Enumerator | |
|---|---|
| Invalid | |
| Unit | |
| Bool | |
| Integer | |
| String | |
| Character | |
Definition at line 78 of file Compiler_Types.H.
|
strong |
Final status produced by one VM execution request.
| Enumerator | |
|---|---|
| Returned | Execution finished with an explicit |
| Halted | Execution reached |
| Runtime_Error | Execution failed with a structured runtime error. |
Definition at line 81 of file Bytecode_Interpreter.H.
|
strong |
Constant kinds supported by the bytecode constant pool.
Definition at line 90 of file Bytecode.H.
|
strong |
VM opcodes supported by the bytecode MVP.
Definition at line 101 of file Bytecode.H.
|
strong |
Runtime categories that can live inside bytecode registers/slots.
Bytecode execution needs one extra case that Interpreter_Value does not model: references to bytecode functions addressed by function_id. Those references are not interchangeable with HIR callables, so the VM wraps both concepts in a distinct tagged value.
| Enumerator | |
|---|---|
| Invalid | Uninitialized register/slot or explicit invalid placeholder. |
| Value | Regular runtime payload stored as |
| Function_Ref | Reference to one bytecode function in the current module. |
Definition at line 73 of file Bytecode_Interpreter.H.
|
strong |
Categories of basic block terminators.
Every basic block must end with exactly one terminator that defines how control flow proceeds to successors.
Definition at line 87 of file Compiler_CFG.H.
|
strong |
Constant-lattice states used by local constant propagation.
| Enumerator | |
|---|---|
| Unknown | A value exists but is not known to be constant. |
| Undefined | A slot has not been definitely initialized yet. |
| Integer | Integer constant. |
| Boolean | Boolean constant. |
| Unit | Unit constant. |
Definition at line 135 of file Compiler_Dataflow.H.
|
strong |
High-level actions supported by compiler pipeline drivers.
| Enumerator | |
|---|---|
| Parse_Only | Stop after parsing and publish AST/frontend artifacts. |
| Sema_Only | Stop after semantic analysis. |
| HIR | Stop after lowering to typed HIR. |
| IR | Stop after lowering to explicit IR. |
| Run | Execute the lowered HIR module with |
| Emit_C | Lower to IR and emit portable C. |
| Emit_Bytecode | Lower to IR and emit reusable bytecode. |
Definition at line 55 of file Compiler_Driver_Contracts.H.
|
strong |
Enumeration of expression node kinds.
Distinguishes between different types of expressions in the AST for runtime type identification and dispatch.
Definition at line 104 of file Compiler_AST.H.
|
strong |
Kinds of HIR constants.
| Enumerator | |
|---|---|
| Integer | |
| String | |
| Character | |
| Bool | |
| Unit | |
Definition at line 98 of file Compiler_HIR_Model.H.
|
strong |
Kinds of HIR expressions.
| Enumerator | |
|---|---|
| Invalid | |
| Constant | |
| Variable | |
| Unary | |
| Binary | |
| Call | |
Definition at line 73 of file Compiler_HIR_Model.H.
|
strong |
Kinds of HIR statements.
| Enumerator | |
|---|---|
| Invalid | |
| Eval | |
| Let | |
| Return | |
| Block | |
| If | |
| While | |
| Break | |
| Continue | |
Definition at line 84 of file Compiler_HIR_Model.H.
|
strong |
Enumeration of top-level import declaration node kinds.
Imports are intentionally small in the current MVP: they name one other source unit through a string literal such as import "math.aw";.
| Enumerator | |
|---|---|
| Invalid | Placeholder for malformed import declarations. |
| Import | One concrete |
Definition at line 179 of file Compiler_AST.H.
|
strong |
Outcome of one integer operation of the language.
| Enumerator | |
|---|---|
| Ok | The result is in |
| Overflow | The result does not fit in a signed 64-bit integer. |
| Division_By_Zero |
|
| Modulo_By_Zero |
|
Definition at line 316 of file Compiler_Operator.H.
|
strong |
Instruction kinds supported by the MVP IR.
| Enumerator | |
|---|---|
| Constant | |
| Load | |
| Store | |
| Unary | |
| Binary | |
| Call | |
| Function_Ref | |
Definition at line 86 of file Compiler_IR_Model.H.
|
strong |
Storage-space classification for slots.
| Enumerator | |
|---|---|
| Parameter | |
| Local | |
| Global | |
Definition at line 78 of file Compiler_IR_Model.H.
|
strong |
Terminator kinds supported by the MVP IR.
| Enumerator | |
|---|---|
| None | |
| Jump | |
| Branch | |
| Return | |
| Exit | |
| Unreachable | |
Definition at line 98 of file Compiler_IR_Model.H.
|
strong |
Structural issues emitted while binding linked module surfaces.
| Enumerator | |
|---|---|
| Missing_Metadata | |
| Ambiguous_Value_Name | |
| Ambiguous_Type_Name | |
Definition at line 74 of file Compiler_Module_Binder.H.
|
strong |
Export kinds currently modeled by reusable module metadata.
| Enumerator | |
|---|---|
| Function | |
| Global | |
| Type | |
Definition at line 52 of file Compiler_Module_Metadata.H.
|
strong |
Structural issues emitted while linking module surfaces.
| Enumerator | |
|---|---|
| Missing_Metadata | |
| Duplicate_Value_Export | |
| Duplicate_Type_Export | |
Definition at line 75 of file Compiler_Module_Linker.H.
|
strong |
Query filters supported by reusable module-name resolution.
| Enumerator | |
|---|---|
| Any | |
| Value | |
| Function | |
| Global | |
| Type | |
Definition at line 53 of file Compiler_Module_Name_Resolver.H.
|
strong |
Result status for one module-name query.
| Enumerator | |
|---|---|
| Resolved | |
| Missing_Module | |
| Missing_Name | |
| Wrong_Kind | |
| Ambiguous_Name | |
Definition at line 63 of file Compiler_Module_Name_Resolver.H.
|
strong |
Structural issue kinds produced by module dependency resolution.
| Enumerator | |
|---|---|
| Missing_Dependency | |
| Cyclic_Dependency | |
Definition at line 67 of file Compiler_Module_Resolver.H.
|
strong |
Stable operator kinds shared by reusable compiler layers.
| Enumerator | |
|---|---|
| Invalid | |
| Assign | |
| Plus | |
| Minus | |
| Star | |
| Slash | |
| Percent | |
| EqEq | |
| NotEq | |
| Less | |
| LessEq | |
| Greater | |
| GreaterEq | |
| AndAnd | |
| OrOr | |
| Bang | |
| Amp | |
| Pipe | |
| Caret | |
| Tilde | |
| PlusEq | |
| MinusEq | |
| StarEq | |
| SlashEq | |
| PercentEq | |
| PlusPlus | |
| MinusMinus | |
Definition at line 52 of file Compiler_Operator.H.
|
strong |
|
strong |
Enumeration of statement node kinds.
Identifies the type of a statement for structured control flow analysis and execution.
Definition at line 126 of file Compiler_AST.H.
|
strong |
Result status for one declaration attempt.
| Enumerator | |
|---|---|
| Inserted | |
| Duplicate_Local | |
| Inserted_Shadowing | |
Definition at line 95 of file Compiler_Symbol_Bindings.H.
|
strong |
Generic symbol kinds reusable across multiple frontends.
| Enumerator | |
|---|---|
| Function | |
| Parameter | |
| Local | |
| Global | |
| Type | |
Definition at line 55 of file Compiler_Symbol_Bindings.H.
|
strong |
Token kinds supported by the compiler MVP.
Includes keywords, literals, operators, and punctuation. Keywords have their own enumerators to avoid string comparisons in the parser.
Definition at line 68 of file Compiler_Token.H.
|
strong |
Enumeration of top-level type declaration node kinds.
These declarations introduce named surface-level types such as aliases, nominal structs, and nominal enums.
| Enumerator | |
|---|---|
| Invalid | Placeholder for malformed type declarations. |
| Alias | Transparent type alias declaration. |
| Struct | Nominal |
| Enum | Nominal |
Definition at line 163 of file Compiler_AST.H.
|
strong |
Enumeration of parsed type-expression node kinds.
Type expressions represent explicit source-level annotations and are later resolved into Compiler_Types.H.
| Enumerator | |
|---|---|
| Invalid | Placeholder for malformed type syntax. |
| Named | Named type such as |
| Tuple | Tuple type such as |
| Function | Function type such as |
Definition at line 147 of file Compiler_AST.H.
|
strong |
Category of one stored type node.
| Enumerator | |
|---|---|
| Builtin | |
| Tuple | |
| Function | |
| Struct | |
| Enum | |
| Type_Variable | |
Definition at line 67 of file Compiler_Types.H.
|
strong |
Result category returned by type unification.
| Enumerator | |
|---|---|
| Success | |
| Invalid_Type | |
| Kind_Mismatch | |
| Arity_Mismatch | |
| Occurs_Check_Failed | |
| Rigid_Variable | |
Definition at line 146 of file tpl_constraints.H.
|
strong |
|
strong |
Kind of source label attached to a diagnostic.
| Enumerator | |
|---|---|
| Primary | |
| Secondary | |
Definition at line 68 of file ah-diagnostics.H.
|
strong |
Severity level of a diagnostic message.
| Enumerator | |
|---|---|
| Note | |
| Warning | |
| Error | |
| Fatal | |
Definition at line 59 of file ah-diagnostics.H.
|
strong |
Enumeration for Eulerian graph classification.
Represents the three possible Eulerian states of a graph:
| Enumerator | |
|---|---|
| Cycle | Graph has an Eulerian cycle. |
| Path | Graph has an Eulerian path but not a cycle. |
| None | Graph is not Eulerian. |
Definition at line 113 of file eulerian.H.
|
strong |
|
strong |
Structured control-flow outcomes during evaluation.
| Enumerator | |
|---|---|
| None | |
| Return | |
| Break | |
| Continue | |
| Runtime_Error | |
Definition at line 95 of file Interpreter_Runtime.H.
|
strong |
Runtime categories supported by the interpreter MVP.
| Enumerator | |
|---|---|
| Invalid | |
| Unit | |
| Bool | |
| Integer | |
| String | |
| Character | |
| Tuple | |
| Function | |
| Host_Function | |
Definition at line 81 of file Interpreter_Runtime.H.
|
strong |
Built-in move-ordering modes supported by the framework.
| Enumerator | |
|---|---|
| Domain | Preserve the order emitted by |
| Estimated_Score | Rank successors by a cheap heuristic score estimate. |
| Estimated_Bound | Rank successors by an optimistic child bound. |
Definition at line 63 of file search_move_ordering.H.
|
strong |
Optimization direction supported by branch and bound.
| Enumerator | |
|---|---|
| Minimize | Smaller objective values are better. |
| Maximize | Larger objective values are better. |
Definition at line 61 of file Branch_And_Bound.H.
|
strong |
|
strong |
|
strong |
Open mode for paged persistent tree files.
Read_Write opens the backing file for mutations and durable commits. Read_Only opens an existing clean file for read-only access under a shared advisory lock.
| Enumerator | |
|---|---|
| Read_Write | |
| Read_Only | |
Definition at line 75 of file tpl_paged_tree_durability.H.
|
strong |
Node-split / insertion strategy for RTree.
Guttman uses the original quadratic split. RStar uses the R*-tree heuristics (overlap-minimizing subtree choice, margin/overlap/area split and leaf-level forced reinsertion). See RStarTree in tpl_r_star_tree.H.
| Enumerator | |
|---|---|
| Guttman | |
| RStar | |
Definition at line 99 of file tpl_r_tree.H.
|
strong |
Final state of a search execution.
| Enumerator | |
|---|---|
| NotStarted | Search object exists but no traversal has run yet. |
| Exhausted | Search space within the configured bounds was exhausted. |
| StoppedOnSolution | Search stopped because solution handling requested it. |
| LimitReached | Search stopped because an external hard limit was hit. |
Definition at line 73 of file state_search_common.H.
|
strong |
Arc state in Network Simplex.
Indicates whether an arc is in the basis (tree) and its bound state.
| Enumerator | |
|---|---|
| Lower | Non-basic arc at lower bound (flow = 0). |
| Upper | Non-basic arc at upper bound (flow = cap). |
| Tree | Basic arc (in spanning tree). |
Definition at line 1170 of file tpl_netcost.H.
| enum Aleph::ThreeWayCmp : int |
Constants for three-way comparison results.
| Enumerator | |
|---|---|
| CmpLess | First argument is less than second. |
| CmpEqual | Arguments are equal. |
| CmpGreater | First argument is greater than second. |
Definition at line 1711 of file tpl_binNodeUtils.H.
|
strong |
Enumeration of basic token types.
Definition at line 1500 of file parse_utils.H.
|
strong |
Stored bound classification for memoized search entries.
| Enumerator | |
|---|---|
| Exact | Exact value for the stored search configuration. |
| Lower_Bound | Value is a lower bound (fail-high style). |
| Upper_Bound | Value is an upper bound (fail-low style). |
Definition at line 59 of file Transposition_Table.H.
|
strong |
Outcome of one store/update attempt in a transposition table.
| Enumerator | |
|---|---|
| Inserted | A new key was inserted. |
| Replaced | An existing key was updated according to replacement policy. |
| Rejected | Existing entry was kept and candidate was discarded. |
Definition at line 67 of file Transposition_Table.H.
|
inlinestatic |
Internal DFS step used by compute_cut_nodes().
Internal step for compute_cut_nodes(): the search from p.
Visits p, reached through a, and what it reaches, and appends to list the cut nodes among them. A path can have as many nodes as the graph, too many for recursion, so that the search keeps its frames in frames; the order of the visits is that of a recursion.
Definition at line 1774 of file tpl_graph_utils.H.
References and, Aleph::DynList< T >::append(), Cut, low(), Aleph::graph_utils_detail::next_cut_child(), NODE_BITS, and Aleph::graph_utils_detail::visit_cut().
Referenced by compute_cut_nodes().
|
inlinestatic |
Internal DFS used by depth_first_traversal().
| GT | Graph type. |
| [in] | g | Graph being traversed. |
| [in] | node | Current node. |
| [in] | arc | Arc used to discover node (nullptr for the root call). |
| [in] | visit | Optional callback invoked when a node is discovered. |
| [in,out] | count | Number of discovered nodes so far. |
true if the traversal must stop early; false otherwise.Depth_First control bit on both nodes and arcs. Definition at line 309 of file tpl_graph_utils.H.
References count(), Depth_First, GraphCommon< GT, Node, Arc >::get_arc_it(), GraphCommon< GT, Node, Arc >::get_num_nodes(), Aleph::Dfs_Stack< T >::is_empty(), IS_NODE_VISITED, NODE_BITS, Aleph::Dfs_Stack< T >::pop(), Aleph::Dfs_Stack< T >::push(), and Aleph::Dfs_Stack< T >::top().
Referenced by depth_first_traversal().
|
inlinestatic |
Definition at line 1548 of file tpl_tree_node.H.
References ah_out_of_range_error_if, and, and size().
Referenced by deway_search().
|
inlinestatic |
Definition at line 163 of file kosaraju.H.
References Aleph::Dlink::append(), df(), NODE_COUNTER, and Aleph::kosaraju_detail::search().
Referenced by kosaraju_connected_components(), and kosaraju_connected_components().
|
inlinestatic |
DFS on transposed graph that builds an SCC node list (Phase 2).
Traverses the transposed graph starting from node p, appending all reachable nodes (mapped back to original graph) to the list.
This is the second phase of Kosaraju's algorithm (lightweight version).
| GT | Graph type. |
| [in] | g | The transposed directed graph. |
| [in] | p | Starting node for the DFS. |
| [out] | list | List where nodes of this SCC are appended. |
Definition at line 217 of file kosaraju.H.
References Aleph::DynList< T >::append(), and Aleph::kosaraju_detail::search().
Referenced by kosaraju_connected_components().
|
inlinestatic |
DFS on transposed graph that builds an SCC subgraph (Phase 2).
Traverses the transposed graph starting from node p, inserting all reachable nodes into the block subgraph. Each node in the block is assigned the same color (component ID) and mapped to the original graph.
This is the second phase of Kosaraju's algorithm (subgraph version).
| GT | Graph type. |
| [in] | g | The transposed directed graph. |
| [in] | p | Starting node for the DFS. |
| [out] | blk | Subgraph where nodes of this SCC are inserted. |
| [in] | color | Component ID assigned to all nodes in this SCC. |
Definition at line 190 of file kosaraju.H.
References color(), GTNodeCommon< NodeInfo >::get_info(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), GraphCommon< GT, Node, Arc >::map_nodes(), NODE_COUNTER, and Aleph::kosaraju_detail::search().
Referenced by kosaraju_connected_components().
|
inlinestatic |
Internal DFS used by find_depth_first_spanning_tree().
Definition at line 1334 of file tpl_graph_utils.H.
References ALEPH_FLATTEN, ARC_BITS, GraphCommon< GT, Node, Arc >::get_arc_it(), GTNodeCommon< NodeInfo >::get_info(), GTArcCommon< ArcInfo >::get_info(), GraphCommon< GT, Node, Arc >::get_num_arcs(), GraphCommon< GT, Node, Arc >::get_num_nodes(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), IS_ARC_VISITED, Aleph::Dfs_Stack< T >::is_empty(), IS_NODE_VISITED, GraphCommon< GT, Node, Arc >::map_arcs(), GraphCommon< GT, Node, Arc >::map_nodes(), NODE_BITS, Aleph::Dfs_Stack< T >::pop(), Aleph::Dfs_Stack< T >::push(), Spanning_Tree, and Aleph::Dfs_Stack< T >::top().
Referenced by find_depth_first_spanning_tree().
|
inlinestatic |
Definition at line 4619 of file tpl_graph.H.
References Aleph::Path< GT >::append(), Find_Path, GraphCommon< GT, Node, Arc >::get_arc_it(), Aleph::Dfs_Stack< T >::is_empty(), IS_NODE_VISITED, NODE_BITS, Aleph::Dfs_Stack< T >::pop(), Aleph::Dfs_Stack< T >::push(), Aleph::Path< GT >::remove_last_node(), and Aleph::Dfs_Stack< T >::top().
|
static |
Definition at line 107 of file generate_tree.H.
References ah_overflow_error_if, and, deway(), output, and size().
|
inlinestatic |
Definition at line 392 of file graph_to_tree.H.
|
inlinestatic |
Internal DFS used by is_graph_acyclique().
A path can have as many nodes as the graph, too many for recursion, so that the search keeps its own stack; the order of the visits is that of a recursion.
Definition at line 840 of file tpl_graph_utils.H.
References GraphCommon< GT, Node, Arc >::get_arc_it(), Aleph::Dfs_Stack< T >::is_empty(), IS_NODE_VISITED, NODE_BITS, Aleph::Dfs_Stack< T >::pop(), Aleph::Dfs_Stack< T >::push(), Test_Cycle, and Aleph::Dfs_Stack< T >::top().
Referenced by is_graph_acyclique(), and is_graph_acyclique().
|
inline |
Definition at line 1427 of file tpl_sort_utils.H.
References cmp(), Aleph::DynList< T >::get_first_ne(), l, and r.
|
inlinestatic |
Internal step used by map_subgraph().
Copies into sg, from gsrc, whose image is in sg, the arcs of the given color not copied yet, with the nodes that they reach; the search goes on from the target of each arc that it copies. A path can have as many nodes as the graph, too many for recursion, so that the search keeps its own stack; the order of the visits is that of a recursion.
Definition at line 2066 of file tpl_graph_utils.H.
References ALEPH_FLATTEN, ARC_BITS, ARC_COOKIE, Build_Subtree, color(), GraphCommon< GT, Node, Arc >::get_arc_it(), GTNodeCommon< NodeInfo >::get_info(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), IS_ARC_VISITED, Aleph::Dfs_Stack< T >::is_empty(), IS_NODE_VISITED, GraphCommon< GT, Node, Arc >::map_arcs(), GraphCommon< GT, Node, Arc >::map_nodes(), NODE_BITS, NODE_COOKIE, Aleph::Dfs_Stack< T >::pop(), Aleph::Dfs_Stack< T >::push(), and Aleph::Dfs_Stack< T >::top().
Referenced by map_subgraph().
|
inlinestatic |
Internal step that paints all blocks adjacent to a cut node.
Definition at line 1977 of file tpl_graph_utils.H.
References __paint_subgraph(), ARC_BITS, Cross_Arc, Cut, and GraphCommon< GT, Node, Arc >::get_arc_it().
Referenced by paint_subgraphs().
|
inlinestatic |
Internal DFS that paints a non-cut block with current_color.
A path can have as many nodes as the graph, too many for recursion, so that the search keeps its own stack; the order of the visits is that of a recursion.
Definition at line 1932 of file tpl_graph_utils.H.
Referenced by __paint_from_cut_node().
|
inlinestatic |
Definition at line 3214 of file tpl_sort_utils.H.
References and, cmp(), insertion_sort_range(), l, and r.
|
inlinestatic |
Definition at line 3186 of file tpl_sort_utils.H.
References and, cmp(), insertion_sort_range(), l, and r.
|
inlinestaticnoexcept |
Definition at line 986 of file tpl_binNodeXt.H.
References __remove_by_pos_xt(), COUNT(), join_exclusive_xt(), LLINK, RLINK, and root().
Referenced by __remove_by_pos_xt(), and remove_by_pos_xt().
|
inlinestatic |
Definition at line 1640 of file tpl_tree_node.H.
References ah_overflow_error_if, and, deway(), root(), and size().
|
inlinestaticnoexcept |
Definition at line 92 of file tpl_binNodeXt.H.
References __select_rec(), COUNT(), LLINK, r, and RLINK.
Referenced by __select_rec(), and select_rec().
|
inlinestaticnoexcept |
Definition at line 809 of file tpl_binNodeXt.H.
References __split_pos_rec(), COUNT(), LLINK, r, and RLINK.
Referenced by __split_pos_rec().
|
inlinestatic |
Internal helper used by test_for_cycle().
Definition at line 781 of file tpl_graph_utils.H.
References GraphCommon< GT, Node, Arc >::get_arc_it(), Aleph::Dfs_Stack< T >::is_empty(), IS_NODE_VISITED, NODE_BITS, Aleph::Dfs_Stack< T >::pop(), Aleph::Dfs_Stack< T >::push(), Test_Cycle, and Aleph::Dfs_Stack< T >::top().
Referenced by test_for_cycle().
|
inlinestatic |
Internal DFS used by test_for_path().
A path can have as many nodes as the graph, too many for recursion, so that the search keeps its own stack; the order of the visits is that of a recursion.
Definition at line 1035 of file tpl_graph_utils.H.
References Find_Path, GraphCommon< GT, Node, Arc >::get_arc_it(), Aleph::Dfs_Stack< T >::is_empty(), IS_NODE_VISITED, NODE_BITS, Aleph::Dfs_Stack< T >::pop(), Aleph::Dfs_Stack< T >::push(), and Aleph::Dfs_Stack< T >::top().
Referenced by test_for_path().
|
inlinestatic |
Definition at line 1189 of file tpl_tree_node.H.
References Aleph::Dfs_Stack< T >::pop(), Aleph::Dfs_Stack< T >::push(), and Aleph::Dfs_Stack< T >::top().
Referenced by forest_postorder_traversal(), and tree_postorder_traversal().
|
inlinestatic |
Definition at line 1078 of file tpl_tree_node.H.
References and, Aleph::Dfs_Stack< T >::pop(), Aleph::Dfs_Stack< T >::push(), root(), and Aleph::Dfs_Stack< T >::top().
Referenced by forest_preorder_traversal(), and tree_preorder_traversal().
Accumulate values in a range.
Computes the sum of initValue and all elements in [beg, end).
| Itor | Iterator type. |
| T | Accumulator type. |
| beg | Iterator to the first element. |
| end | Iterator past the last element. |
| initValue | Initial value for the accumulation. |
Definition at line 1493 of file ahAlgo.H.
Referenced by demo_vector_dynarray(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TYPED_TEST_P().
|
inline |
Accumulate values with custom operation.
Computes the generalized sum of initValue and all elements in [beg, end) using the binary operation op.
| Itor | Iterator type. |
| T | Accumulator type. |
| BinaryFunc | Binary operation type. |
| beg | Iterator to the first element. |
| end | Iterator past the last element. |
| initValue | Initial value for the accumulation. |
| op | Binary operation for combining values. |
|
inlinenoexcept |
Definition at line 647 of file hash-fct.H.
References h.
|
inlinenoexcept |
Definition at line 544 of file hash-fct.H.
References add_hash().
|
inlinenoexcept |
Definition at line 786 of file hash-fct.H.
References add_hash().
|
inline |
Compute adjacent differences.
Computes differences between consecutive elements in [sourceBeg, sourceEnd) and writes them to the range starting at destBeg. The first element is copied unchanged.
| Itor1 | Source iterator type. |
| Itor2 | Destination iterator type. |
| sourceBeg | Iterator to the first source element. |
| sourceEnd | Iterator past the last source element. |
| destBeg | Iterator to the first destination position. |
|
inline |
Compute adjacent differences with custom operation.
Computes differences using the binary operation op.
| Itor1 | Source iterator type. |
| Itor2 | Destination iterator type. |
| BinaryFunc | Binary operation type. |
| sourceBeg | Iterator to the first source element. |
| sourceEnd | Iterator past the last source element. |
| destBeg | Iterator to the first destination position. |
| op | Binary operation for computing differences. |
|
inline |
Find first pair of adjacent equal elements.
Searches the range [beg, end) for two consecutive elements that are equal according to the predicate.
| Itor | Iterator type. |
| BinaryPredicate | Comparison predicate. |
| beg | Iterator to the first element. |
| end | Iterator past the last element. |
| op | Binary predicate for comparison. |
Definition at line 443 of file ahAlgo.H.
References next().
|
inlinenoexcept |
Definition at line 134 of file Negamax.H.
References dft_hash_fct(), hash_combine(), and seed.
Referenced by Aleph::Aleph_Hash< T >::operator()(), and Aleph::Aleph_Hash< T >::operator()().
|
inline |
Align text to the left by wrapping lines at page_width.
| [in] | text | Input text. |
| [in] | page_width | Maximum line width. |
| [in] | left_margin | Optional left margin (spaces). |
Definition at line 1180 of file ah-string-utils.H.
References split_text_into_words().
Referenced by align_text_to_left_except_first(), demo_formatting(), and TEST().
|
inline |
Align all lines except the first one.
| [in] | text | Input text. |
| [in] | width | Maximum line width. |
| [in] | left_margin | Left margin for lines after the first. |
Definition at line 1219 of file ah-string-utils.H.
References align_text_to_left(), split_text_into_lines(), and to_string().
Referenced by TEST().
|
inline |
Overload of all.
Definition at line 828 of file ahFunctional.H.
|
inline |
Overload of all.
Definition at line 812 of file ahFunctional.H.
|
inline |
Overload of all.
Definition at line 820 of file ahFunctional.H.
|
inline |
Return true if all elements satisfy a predicate.
Tests whether the predicate returns true for every element in the container. Short-circuits on the first false result. Returns true for empty containers (vacuous truth).
| Container | Container type with traverse() method. |
| Operation | Predicate type (const Item_Type&) -> bool. |
| container | Source container. |
| operation | Predicate to test each element. |
Definition at line 804 of file ahFunctional.H.
Referenced by graph_oracles::dominators(), for_each_in_arc(), main(), main(), Aleph::ConstrainedDelaunayTriangulation::merge_and_deduplicate(), Aleph::DelaunayTriangulationRandomizedIncremental::operator()(), stl_take_last(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), test_DynMap(), test_DynMapLinHash(), test_DynSet(), test_DynSetLinHash(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), traverse_in_arcs(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST_P(), TYPED_TEST_P(), Aleph::DelaunayTriangulationBowyerWatson::unique_points(), and Aleph::RegularTriangulationBowyerWatson::unique_sites().
|
inline |
Test if the arcs of g into p meet a condition; on a digraph, in \(O(E)\).
| [in] | g | the graph of p |
| [in] | p | node pointer |
| [in] | op | testing operation |
true if op returns true for all the incoming arcs Definition at line 3053 of file tpl_graph.H.
References traverse_in_arcs().
|
inline |
Test if the incoming arcs meet a condition.
op must have the following signature:
bool op(Arc * arc)
It does not compile on a digraph type: use all_in_arc(g, p, op).
| [in] | p | node pointer |
| [in] | op | testing operation |
true if op returns true for all the incoming arcs Definition at line 3032 of file tpl_graph.H.
Referenced by TYPED_TEST(), and TYPED_TEST().
Return true if all tuple elements satisfy pred.
Checks if every element in the tuple satisfies the given predicate. Uses fold expressions for compile-time iteration over tuple elements. For an empty tuple, returns true (vacuous truth).
| Pred | Predicate type (must be callable with each tuple element type). |
| Tuple | Tuple type to check. |
| pred | Predicate to test on each element. |
| t | Tuple to check. |
true if pred returns true for all elements.Definition at line 1982 of file ah-zip.H.
References Aleph::zip_index_detail::all_of_tuple_impl(), and pred.
|
inline |
Test if the outcoming arcs meet a condition.
op must have the following signature:
bool op(Arc * arc)
| [in] | p | node pointer |
| [in] | op | testing operation |
true if op returns true for all the incoming arcs Definition at line 3403 of file tpl_graph.H.
| bool Aleph::all_perm | ( | const DynList< DynList< T > > & | l, |
| Pred && | pred | ||
| ) |
Convenience overload accepting an rvalue callable.
Definition at line 675 of file ah-comb.H.
References all_perm(), l, and pred.
| bool Aleph::all_perm | ( | const DynList< DynList< T > > & | l, |
| Pred & | pred | ||
| ) |
Check if all permutations satisfy a predicate.
Stops as soon as a permutation makes pred return false.
| T | Element type. |
| Pred | Callable with signature bool(const DynList<T>&). |
| [in] | l | List of lists. |
| [in] | pred | Predicate to test. |
true if all permutations satisfy pred. Definition at line 666 of file ah-comb.H.
References l, pred, and traverse_perm().
Referenced by all_perm(), demo_perm_predicates(), TEST(), TEST(), TEST(), and TEST().
Check if all futures in a list are ready.
Non-blocking check to determine if all futures have completed. Does not consume the futures, but may modify their internal state (wait_for is not const in the standard).
| T | The result type of the futures. |
| [in,out] | future_list | List of futures to check. |
Definition at line 174 of file future_utils.H.
|
inline |
Check if all elements in a container are unique using an rvalue/lvalue comparator.
This overload accepts comparators by forwarding reference and also provides a default comparator (std::equal_to<Item_Type>).
all_unique(const Container &, Equal &)This function determines whether all elements in the container are unique according to the provided equality comparator.
| container | Source container to check. |
| eq | Equality comparator used to compare elements (may be rvalue or lvalue; defaults to std::equal_to). |
Definition at line 2686 of file ahFunctional.H.
References eq().
|
inline |
Check if all elements in a container are unique using a comparator.
This function determines whether all elements in the container are unique according to the provided equality comparator.
Complexity:
Equal is std::equal_to<T>, std::hash<T> is available, and DynSetLhash is complete in the current translation unit, the check runs in expected O(n).| container | Source container to check. |
| eq | Equality comparator used to compare elements. |
Definition at line 2650 of file ahFunctional.H.
References Aleph::functional_detail::all_unique_hash_path(), and, eq(), Aleph::functional_detail::pairwise_all_unique(), and value.
Referenced by all_unique(), Aleph::blossom_weighted_detail::mwmatching::impl::check_input_graph(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
See all_unique(container, hash, eq).
Definition at line 2724 of file ahFunctional.H.
References all_unique(), and eq().
|
inline |
Definition at line 2712 of file ahFunctional.H.
References Aleph::functional_detail::all_unique_hash_path(), and eq().
| T * Aleph::allocate | ( | AhArenaAllocator & | arena, |
| Args &&... | args | ||
| ) |
Allocate and construct an object in an arena.
Convenience function that allocates and constructs an object of type T in the given arena.
| T | Type to construct. |
| Args | Constructor argument types. |
| [in] | arena | Arena allocator to use. |
| [in] | args | Constructor arguments. |
Definition at line 478 of file ah-arena.H.
References Aleph::AhArenaAllocator::alloc(), and Aleph::AhArenaAllocator::TEMPLATE.
Referenced by Node_Pool< Node >::allocate(), Node_Pool< Node >::allocate(), Aleph::Simplex< T >::create_restriction(), operator new(), operator new(), operator new[](), operator new[](), TEST(), and TEST().
|
inline |
Allocate size bytes using the C heap.
| size | Number of bytes to allocate. Must be greater than zero. |
size bytes. | std::invalid_argument | when size == 0. |
| std::bad_alloc | when the underlying allocation fails. |
Definition at line 73 of file ahMem.H.
References ah_bad_alloc_if, ah_invalid_argument_if, and size().
|
inline |
Allocate size zero-initialized bytes.
| size | Number of bytes to allocate and clear. |
size bytes. | std::invalid_argument | when size == 0. |
| std::bad_alloc | when the underlying allocation fails. |
Definition at line 91 of file ahMem.H.
References ah_bad_alloc_if, ah_invalid_argument_if, and size().
| auto Aleph::alpha_beta_search | ( | Domain | domain, |
| typename Domain::State | initial_state, | ||
| ExplorationPolicy | policy = Alpha_Beta<Domain>::default_policy(), |
||
| SearchLimits | limits = {} |
||
| ) |
Convenience wrapper for one-shot Alpha-Beta search.
Definition at line 797 of file Alpha_Beta.H.
References alpha_beta_search().
Referenced by alpha_beta_search(), alpha_beta_search(), alpha_beta_search(), alpha_beta_search(), alpha_beta_search(), alpha_beta_search(), main(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
| and AdversarialTranspositionMemo< Table, typename Domain::State_Key, typename Domain::Move, typename Domain::Score > auto Aleph::alpha_beta_search | ( | Domain | domain, |
| typename Domain::State | initial_state, | ||
| Table & | table, | ||
| ExplorationPolicy | policy = Alpha_Beta<Domain>::default_policy(), |
||
| SearchLimits | limits = {} |
||
| ) |
Convenience wrapper for Alpha-Beta search with domain-provided state key.
Definition at line 853 of file Alpha_Beta.H.
References alpha_beta_search().
| auto Aleph::alpha_beta_search | ( | Domain | domain, |
| typename Domain::State | initial_state, | ||
| Table & | table, | ||
| Keyer | keyer, | ||
| ExplorationPolicy | policy = Alpha_Beta<Domain>::default_policy(), |
||
| SearchLimits | limits = {} |
||
| ) |
Convenience wrapper for Alpha-Beta search with transposition table.
Definition at line 822 of file Alpha_Beta.H.
References alpha_beta_search().
| and AdversarialSearchTracer< Tracer, typename Domain::Move, typename Domain::Score > auto Aleph::alpha_beta_search | ( | Domain | domain, |
| typename Domain::State | initial_state, | ||
| Table & | table, | ||
| Keyer | keyer, | ||
| Tracer & | tracer, | ||
| ExplorationPolicy | policy = Alpha_Beta<Domain>::default_policy(), |
||
| SearchLimits | limits = {} |
||
| ) |
Convenience wrapper for Alpha-Beta search with TT/keyer and tracing.
Definition at line 837 of file Alpha_Beta.H.
References alpha_beta_search().
| and AdversarialTranspositionMemo< Table, typename Domain::State_Key, typename Domain::Move, typename Domain::Score > and AdversarialSearchTracer< Tracer, typename Domain::Move, typename Domain::Score > auto Aleph::alpha_beta_search | ( | Domain | domain, |
| typename Domain::State | initial_state, | ||
| Table & | table, | ||
| Tracer & | tracer, | ||
| ExplorationPolicy | policy = Alpha_Beta<Domain>::default_policy(), |
||
| SearchLimits | limits = {} |
||
| ) |
Convenience wrapper for Alpha-Beta search with domain-provided key and tracing.
Definition at line 868 of file Alpha_Beta.H.
References alpha_beta_search().
| auto Aleph::alpha_beta_search | ( | Domain | domain, |
| typename Domain::State | initial_state, | ||
| Tracer & | tracer, | ||
| ExplorationPolicy | policy = Alpha_Beta<Domain>::default_policy(), |
||
| SearchLimits | limits = {} |
||
| ) |
Convenience wrapper for one-shot Alpha-Beta search with tracing.
Definition at line 809 of file Alpha_Beta.H.
References alpha_beta_search().
|
inline |
Computes reachability, liveness, definite assignment, and constant propagation for one IR function.
| function | IR function to analyse; must have a valid entry and exit block. |
function. Definition at line 978 of file Compiler_Dataflow.H.
References Aleph::DynArray< T >::access(), Aleph::DynArray< T >::append(), Aleph::Compiler_Dataflow_Function_Analysis::assigned_in_slots, Aleph::Compiler_Dataflow_Function_Analysis::assigned_out_slots, Aleph::Compiler_Dataflow_Detail::bit_set_equals(), Aleph::Compiler_Dataflow_Detail::bit_set_intersection(), Aleph::Compiler_Dataflow_Detail::bit_set_subtract(), Aleph::Compiler_Dataflow_Detail::bit_set_union(), Aleph::Compiler_IR_Function::blocks, Boolean, Aleph::Compiler_Dataflow_Detail::compute_block_use_def(), Aleph::Compiler_Dataflow_Detail::compute_predecessor_lists(), Aleph::Compiler_Dataflow_Detail::compute_reachability(), Aleph::Compiler_Dataflow_Function_Analysis::constant_in_slots, Aleph::Compiler_Dataflow_Function_Analysis::constant_out_slots, Aleph::Compiler_Dataflow_Detail::constant_vector_equals(), Aleph::Compiler_IR_Function::entry_block, Aleph::Compiler_Dataflow_Function_Analysis::foldable_branch_count, Aleph::Compiler_Dataflow_Detail::initial_assigned_state(), Aleph::Compiler_Dataflow_Detail::initial_constant_state(), Aleph::Compiler_Dataflow_Function_Analysis::live_in_slots, Aleph::Compiler_Dataflow_Function_Analysis::live_out_slots, Aleph::Compiler_Dataflow_Function_Analysis::local_slot_count, Aleph::Compiler_IR_Function::local_slots, Aleph::Compiler_Dataflow_Detail::make_bit_set(), Aleph::Compiler_Dataflow_Detail::make_constant_vector(), Aleph::Compiler_Dataflow_Detail::meet_constants(), pred, Aleph::Compiler_Dataflow_Function_Analysis::reachable_blocks, Aleph::Compiler_Dataflow_Detail::simulate_block(), Aleph::DynArray< T >::size(), Aleph::Compiler_SSA_Terminator::successors, Aleph::Compiler_SSA_Block::terminator, Aleph::Compiler_Dataflow_Function_Analysis::uninitialized_reads, and Aleph::Compiler_Dataflow_Detail::unknown_constant().
Referenced by eliminate_dead_code(), main(), TEST(), TEST(), TEST(), and validate_dead_code_elimination().
| PolyFitAnalysis< C > Aleph::analyze_fit | ( | const Gen_MultiPolynomial< C, M > & | poly, |
| const Array< std::pair< Array< C >, C > > & | data | ||
| ) |
Compute residual analysis for a polynomial fit.
| C | Coefficient type. |
| M | Monomial ordering. |
| [in] | poly | Fitted polynomial. |
| [in] | data | Original (point, value) pairs. |
Definition at line 4497 of file tpl_multi_polynomial.H.
References Aleph::PolyFitAnalysis< C >::ess, Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::eval(), m, Aleph::PolyFitAnalysis< C >::mean_y, pred, Aleph::PolyFitAnalysis< C >::r_squared, Aleph::PolyFitAnalysis< C >::residuals, Aleph::PolyFitAnalysis< C >::rmse, Aleph::PolyFitAnalysis< C >::rss, OhashCommon< HashTbl, Key >::size(), and Aleph::PolyFitAnalysis< C >::tss.
Return true if any tuple element satisfies pred.
Checks if at least one element in the tuple satisfies the given predicate. Uses fold expressions for compile-time iteration over tuple elements.
| Pred | Predicate type (must be callable with each tuple element type). |
| Tuple | Tuple type to check. |
| pred | Predicate to test on each element. |
| t | Tuple to check. |
true if pred returns true for at least one element.Definition at line 2012 of file ah-zip.H.
References Aleph::zip_index_detail::any_of_tuple_impl(), and pred.
Referenced by none_of_tuple(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Append multiple items into a container.
Each item is passed to c.append(), in argument order; an rvalue is moved.
append() returns a null pointer then). Definition at line 1930 of file ahFunctional.H.
Referenced by build_container(), TEST(), TEST(), and TEST().
|
inline |
Append library into libraries unless already present.
Shared by Tikz_Plane::required_tikz_libraries and Tikz_Scene's overlay/beamer export helpers so both single-item and bulk-merge callers use the same "already present" scan.
Definition at line 86 of file tikzgeom.H.
References Aleph::Array< T >::append(), and Aleph::Array< T >::size().
Referenced by Aleph::Tikz_Scene::append_unique_libraries(), and Aleph::Tikz_Plane::required_tikz_libraries().
|
inline |
|
inline |
|
inline |
Two-argument arc tangent (wrapper over mpfr).
Definition at line 179 of file point.H.
Referenced by Aleph::Polar_Point::Polar_Point(), Aleph::Segment::counterclockwise_angle_with(), and TEST().
|
inline |
Detailed equality check returning mismatch position and values.
Like eq() but returns detailed information about the comparison:
| C1 | Type of the first container. |
| C2 | Type of the second container. |
| Eq | Equality predicate type. |
| c1 | First container. |
| c2 | Second container. |
| e | Equality predicate. |
Definition at line 1283 of file ahFunctional.H.
References and.
Referenced by TEST().
Fast graph comparison.
If the data types stored in the nodes are sortable then this method can respond if two graphs are isomorphic in \(O(V \lg V) + O(E)\).
Both graphs must be of same type.
Since this function uses node indexes, this is defined in tpl_indexGraph.H.
| [in] | g1 | a graph |
| [in] | g2 | a graph |
true if the graphs are equal; false otherwise Definition at line 242 of file tpl_indexGraph.H.
References GraphCommon< GT, Node, Arc >::all_arcs(), GraphCommon< GT, Node, Arc >::all_nodes(), GraphCommon< GT, Node, Arc >::esize(), GraphCommon< GT, Node, Arc >::get_src_node(), GraphCommon< GT, Node, Arc >::get_tgt_node(), and GraphCommon< GT, Node, Arc >::vsize().
|
inline |
Determines if operands are equal using a comparison operator.
| op1 | First operand |
| op2 | Second operand |
| cmp | Comparison functor |
Definition at line 1126 of file ahFunction.H.
References cmp().
Referenced by binary_search_dup(), binindex_dup(), binindex_dup(), bsearch(), bsearch(), bsearch(), bsearch_dup(), bsearch_dup(), and bsearch_dup().
|
constexprnoexcept |
|
inline |
Definition at line 1362 of file tpl_tree_node.H.
References eq().
|
inline |
Compute the signed area of the parallelogram defined by vectors a->b and a->c.
Equivalent to the 2D cross product (b-a) x (c-a).
| a | The first point. |
| b | The second point. |
| c | The third point. |
Definition at line 2886 of file point.H.
References Aleph::Point::get_x(), and Aleph::Point::get_y().
Referenced by Aleph::Triangle::Triangle(), Aleph::Triangle::Triangle(), Aleph::Triangle::Triangle(), area_of_triangle(), c_is_to_left_(), Aleph::TrapezoidalMapPointLocation::dag_locate(), Aleph::RotatingCalipersConvexPolygon::diameter(), Aleph::VisvalingamWhyattSimplification::effective_area(), Aleph::QuickHull::get_farthest_point(), Aleph::QuickHull::get_right_points(), Aleph::Segment::intersects_properly_with(), is_clockwise(), Aleph::Point::is_clockwise_with(), Aleph::Point::is_colinear_with(), Aleph::Polygon::is_convex(), Aleph::GeomPolygonUtils::is_convex(), Aleph::Point::is_left_of(), Aleph::Point::is_right_of(), Aleph::Point::is_to_right_from(), left_on(), Aleph::TrapezoidalMapPointLocation::Result::locate(), Aleph::RotatingCalipersConvexPolygon::minimum_width(), Aleph::GrahamScanConvexHull::operator()(), Aleph::AlphaShape::operator()(), orientation(), Aleph::QuickHull::partition(), Aleph::TrapezoidalMapPointLocation::point_above_segment(), Aleph::BooleanPolygonOperations::point_inside_ccw(), points_are_colinear(), TEST(), TEST(), TEST_F(), Aleph::MonotonePolygonTriangulation::triangulate_monotone(), Aleph::AndrewMonotonicChainConvexHull::turn(), and Aleph::GrahamScanConvexHull::turn().
|
inline |
Return the (unsigned) area of triangle (a, b, c) as an exact rational.
Definition at line 3037 of file point.H.
References abs(), and area_of_parallelogram().
Referenced by area_of_triangle_legacy(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Definition at line 54 of file point_utils.H.
References area_of_triangle(), and area_of_triangle_legacy().
Referenced by area_of_triangle_legacy().
|
inlinenoexcept |
See areEquivalents(Node * t1, Node * t2, Equal & op).
Definition at line 952 of file tpl_binNodeUtils.H.
References areEquivalents().
|
inlinenoexcept |
Return true if trees are equivalents.
Two binary tree are similar if they are similar and each pair of nodes in preorder traversal have the same keys
| [in] | t1 | root of first tree |
| [in] | t2 | root of second tree |
| [in] | op | comparison operation |
true t1 and t2 are equivalents; false otherwise Definition at line 936 of file tpl_binNodeUtils.H.
References and, areEquivalents(), KEY, LLINK, and RLINK.
Referenced by areEquivalents(), areEquivalents(), and main().
Return true if both trees are similar.
Two binary tree are similar if they have the same topological form.
| [in] | t1 | root of first tree |
| [in] | t2 | root of second tree |
true if t1 and t2 are similar; false otherwise Definition at line 912 of file tpl_binNodeUtils.H.
References and, areSimilar(), LLINK, and RLINK.
Referenced by areSimilar(), main(), and TEST().
|
inline |
Return indices that visit an array-like container in sorted order.
This is the high-level ahSort.H synonym for build_index() from tpl_sort_utils.H. It works with both Aleph arrays (Array, DynArray, and other containers exposing operator()) and STL-style random-access containers such as std::vector (via operator[]). It returns an Array<size_t> because the number of indices is fixed once the source container size is known.
The returned index array has the direction idx[sorted_pos] = original_pos. In other words, iterating a(idx(i)) for Aleph arrays, or a[idx(i)] for STL arrays, observes the original container in sorted order without moving its elements.
| C | Array-like container type. Must provide size() and either operator()(size_t) or operator[](size_t). |
| Compare | Strict weak ordering over the element type. |
| a | Container whose elements define the ordering. |
| cmp | Comparator used to order elements. |
Array<size_t> of original positions in sorted order.quicksort_op().tpl_sort_utils.H. rank[original_pos] = sorted_pos. Definition at line 385 of file ahSort.H.
References build_index(), and cmp().
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
Convert an Array to a DynArray.
Creates a new DynArray containing copies of all elements from the given Array.
| T | The element type. |
| a | The source Array. |
Definition at line 285 of file ah-convert.H.
References Aleph::DynArray< T >::append(), and Aleph::Array< T >::size().
| TgtC Aleph::assign_container | ( | const SrcC & | srcc | ) |
Convert one container type to another.
Definition at line 1953 of file ahFunctional.H.
| Net::Flow_Type Aleph::aumenting_path_maximum_flow | ( | Net & | net | ) |
Maximize flow using repeated augmenting-path searches.
With a floating type of flow, the residues of rounding that the paths leave go back at the end, as those of the preflows (see net_detail::return_dust()): every node keeps its flow within the tolerance of check_node(). What a node keeps within it stays, as the rounding of the sums of its flows: returning it lowered by an ulp arcs that the paths had filled, and min_cut() put the sink with the source.
| [in,out] | net | Flow network (must have a single source and sink). |
Definition at line 2258 of file tpl_net.H.
References ah_domain_error_if, and, Aleph::Net_Graph< NodeT, ArcT >::check_network(), Aleph::Net_Graph< NodeT, ArcT >::get_out_flow(), Aleph::Net_Graph< NodeT, ArcT >::get_sink(), Aleph::Net_Graph< NodeT, ArcT >::get_source(), Aleph::Net_Graph< NodeT, ArcT >::is_single_sink(), Aleph::Net_Graph< NodeT, ArcT >::is_single_source(), and Aleph::net_detail::return_dust().
|
inlinestaticnoexcept |
Convert a 1-based heap index to a 0-based array index.
Definition at line 3689 of file tpl_sort_utils.H.
Referenced by sift_down(), and sift_up().
| auto Aleph::backtracking_search | ( | Domain | domain, |
| typename Domain::State | initial_state, | ||
| ExplorationPolicy | policy = {}, |
||
| SearchLimits | limits = {} |
||
| ) |
Convenience wrapper that runs a one-shot DFS/backtracking search.
Definition at line 560 of file Backtracking.H.
References backtracking_search().
Referenced by backtracking_search(), and backtracking_search().
| auto Aleph::backtracking_search | ( | Domain | domain, |
| typename Domain::State | initial_state, | ||
| OnSolution & | on_solution, | ||
| ExplorationPolicy | policy = {}, |
||
| SearchLimits | limits = {} |
||
| ) |
Convenience wrapper with a solution callback/collector.
Definition at line 572 of file Backtracking.H.
References backtracking_search().
Rebalance a binary search tree.
balance_tree(root) takes the binary search tree rooted at root and rebalances it "perfectly", in the sense that, for every node, the sizes of its two subtrees differ by at most one.
The operation takes \(O(n\; \lg n)\) time.
| [in] | root | the root of the binary search tree to rebalance. |
Definition at line 110 of file tpl_balanceXt.H.
References balance_tree(), COUNT(), LLINK, RLINK, root(), and select_gotoup_root().
Referenced by balance_tree(), and main().
| MaxFlowBenchmarkResult< typename Net::Flow_Type > Aleph::benchmark_maxflow | ( | Net & | net, |
| Algo | algo, | ||
| const std::string & | name | ||
| ) |
Run and time a max-flow algorithm.
| Net | Network type. |
| Algo | Algorithm functor type. |
| net | Network (will be modified). |
| algo | Algorithm functor. |
| name | Algorithm name for reporting. |
Definition at line 971 of file net_utils.H.
References Aleph::MaxFlowBenchmarkResult< Flow_Type >::algorithm_name, Aleph::MaxFlowBenchmarkResult< Flow_Type >::elapsed_ms, and Aleph::MaxFlowBenchmarkResult< Flow_Type >::flow_value.
Referenced by TEST_F().
Definition at line 103 of file point_utils.H.
References between(), and Aleph::Point::is_between().
Referenced by between(), between(), Aleph::net_detail::return_dust(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), and TYPED_TEST().
|
constexpr |
Column that holds the integers of [lo, hi].
It takes std::bit_width(hi - lo) bits: none if lo == hi, and 64 if the range spans every std::int64_t.
| [in] | lo | Lowest value. |
| [in] | hi | Highest value. |
| std::domain_error | if lo > hi. As a template argument, that is a compile-time error. |
Definition at line 116 of file tpl_packed_matrix.H.
References ah_domain_error_if, and between().
Convert a binary number to its Gray code representation.
The i-th bit of the Gray code is 1 if the i-th and (i+1)-th bits of the binary number are different.
| T | Unsigned integral type. |
| n | Binary number. |
Definition at line 1071 of file ah-comb.H.
Referenced by build_gray_code(), main(), TEST(), and TEST().
|
inlinestatic |
Definition at line 1816 of file tpl_tree_node.H.
References insert_child(), insert_sibling(), Aleph::Dfs_Stack< T >::is_empty(), LLINK, Aleph::Dfs_Stack< T >::pop(), Aleph::Dfs_Stack< T >::push(), RLINK, and Aleph::Dfs_Stack< T >::top().
Referenced by bin_to_forest(), and RandTree< T >::operator()().
Binary search on a sorted container of pointers (full range).
| C | Container template. |
| T | Element type. |
| Compare | Comparison functor type. |
| a | Sorted container of pointers. |
| x | Element to search for. |
| cmp | Comparison functor. |
Definition at line 4301 of file tpl_sort_utils.H.
References binary_search(), and cmp().
|
inline |
Binary search on a sorted container of pointers.
Performs binary search to find an element or its insertion point in a sorted container that stores pointers to elements. Comparisons are performed on the pointed-to values.
| C | Container template (must support operator() and size()). |
| T | Element type. |
| Compare | Comparison functor type. |
| a | Sorted container of pointers. |
| x | Element to search for. |
| l | Left index (inclusive). |
| r | Right index (inclusive). |
| cmp | Comparison functor. |
Definition at line 4273 of file tpl_sort_utils.H.
Binary search on a dynamic ordered array.
binary_search(a,x) searches for x in the array a between 0 and size().
The routine uses the binary search algorithm, which requires that the arrangement is orderly. This condition is not verified in the algorithm.
The method always returns an integer between [0..size()). If the element is found, then the value of return is the index where this is located; otherwise, the index where x would be inserted is returned so that the array was ordered.
| [in] | a | the dynamic array on which to perform the search. |
| [in] | x | the element to search for. |
| cmp | comparison object. |
Definition at line 4337 of file tpl_sort_utils.H.
References binary_search(), and cmp().
|
inline |
Binary search on a sorted container.
Performs binary search to find an element or its insertion point in a sorted container. This is the fundamental search algorithm for sorted data, achieving O(log n) time complexity.
The return value has two meanings:
To check if the element was actually found:
Time complexity: O(log n) Space complexity: O(1)
| C | Container template (must support operator() and size()). |
| T | Element type. |
| Compare | Comparison functor type (default: Aleph::less<T>). |
| a | Sorted container to search. |
| x | Element to search for. |
| l | Left index (inclusive) of the search range. |
| r | Right index (inclusive) of the search range. |
| cmp | Comparison functor. |
Definition at line 4239 of file tpl_sort_utils.H.
|
inline |
Binary search for a value.
Tests whether value exists in the sorted range [beg, end).
| Itor | Forward iterator type. |
| T | Value type. |
| beg | Iterator to the first element. |
| end | Iterator past the last element. |
| value | Value to search for. |
Definition at line 1284 of file ahAlgo.H.
References and, lower_bound(), and value.
Referenced by binary_search(), binary_search(), binary_search_dup(), binindex(), binindex_dup(), binindex_dup(), bsearch(), bsearch(), bsearch(), bsearch_dup(), bsearch_dup(), bsearch_dup(), Aleph::Floyd_All_Shortest_Paths< GT, Distance, SA >::index_node(), Aleph::matgraph_detail::node_index(), TEST(), TEST(), test_DynSet(), test_DynSetLinHash(), and test_hash_table().
|
inline |
Binary search with custom comparison.
Tests whether value exists in the sorted range [beg, end) according to the comparison predicate.
| Itor | Forward iterator type. |
| T | Value type. |
| BinaryPredicate | Comparison predicate. |
| beg | Iterator to the first element. |
| end | Iterator past the last element. |
| value | Value to search for. |
| op | Binary comparison predicate. |
Definition at line 1307 of file ahAlgo.H.
References and, lower_bound(), and value.
|
inline |
Iterative binary search on an ordered array.
| a | Pointer to the sorted array. |
| x | Value to search for. |
| l | Left index. |
| r | Right index. |
| cmp | Comparison functor. |
Definition at line 5204 of file tpl_sort_utils.H.
|
inline |
Binary search for all occurrences of a value.
Finds all indices in a sorted container that contain a value equal to x.
| C | Container template. |
| T | Element type. |
| Compare | Comparison functor type. |
| a | Sorted container. |
| x | Element to search for. |
| cmp | Comparison functor. |
x is found. Definition at line 4360 of file tpl_sort_utils.H.
References Aleph::DynList< T >::append(), are_equals(), binary_search(), cmp(), Aleph::DynList< T >::insert(), and Aleph::DynList< T >::size().
|
inline |
Recursive binary search on an ordered array.
| a | Pointer to the sorted array. |
| x | Value to search for. |
| l | Left index. |
| r | Right index. |
| cmp | Comparison functor. |
Definition at line 5179 of file tpl_sort_utils.H.
|
inline |
Definition at line 479 of file ahFunction.H.
|
inline |
Definition at line 518 of file ahFunction.H.
Referenced by count(), find(), remove(), replace(), and replace_copy().
Returns the index where a value appears (or should be inserted) in a sorted container.
This function performs a binary search over the container a to locate the element x. The container is assumed to be ordered according to the comparison functor cmp.
The search is delegated to binary_search, and therefore follows the same semantics:
x is found, the returned value is the index at which it is located.x is not found, the returned value is the index at which x should be inserted to keep the container ordered.The function does not check that a is actually sorted.
| C | Template for the container type. It must support random access via operator() and provide size(). |
| T | Type of the stored elements. |
| Compare | Comparison functor type; by default Aleph::less<T>. |
| [in] | a | Sorted container in which the search is performed. |
| [in] | x | Value to search for. |
| cmp | Comparison functor that defines the ordering. |
Definition at line 4654 of file tpl_sort_utils.H.
References binary_search(), and cmp().
|
inline |
Search for all indices of a value in a sorted container of pointers.
| C | Container template. |
| T | Element type. |
| Compare | Comparison functor type. |
| a | Sorted container of pointers. |
| x | Value to search for. |
| cmp | Comparison functor. |
x. Definition at line 4732 of file tpl_sort_utils.H.
References Aleph::DynList< T >::append(), are_equals(), binary_search(), cmp(), and Aleph::DynList< T >::insert().
|
inline |
Returns the indices of all occurrences of a value in a sorted container.
This function performs a binary search on the sorted container a to locate the value x. If x is found, it then scans linearly to the left and right of the first found position to collect the indices of all elements equal to x.
The container is assumed to be sorted according to the comparison functor cmp. No verification of this precondition is performed.
The returned list of indices is ordered from smallest to largest.
| C | Template for the container type. It must support random access via operator() and provide size(). |
| T | Type of the stored elements. |
| Compare | Comparison functor type; by default Aleph::less<T>. |
| [in] | a | Sorted container in which the search is performed. |
| [in] | x | Value to search for. |
| cmp | Comparison functor that defines the ordering. |
x. If x is not found, the returned list is empty.Definition at line 4689 of file tpl_sort_utils.H.
References Aleph::DynList< T >::append(), are_equals(), binary_search(), cmp(), and Aleph::DynList< T >::insert().
|
constexpr |
Column of n bits without sign: the integers of [0, 2^n - 1].
| [in] | n | Number of bits, at most 63. |
| std::domain_error | if n > 63: the highest value would not fit in std::int64_t. As a template argument, that is a compile-time error. |
Definition at line 131 of file tpl_packed_matrix.H.
References ah_domain_error_if.
Referenced by Aleph::Bounded_Cycle_Index< GT >::Bounded_Cycle_Index(), Aleph::negative_cycles_detail::bit_span(), Aleph::CA::ca_gif_detail::ceil_log2(), code(), Aleph::detail::Paged_Value_Codec< T >::decode(), Aleph::detail::Paged_Value_Codec< T >::encode(), fold_hash64_to_size_t(), Aleph::Rope< Char, LeafSize >::is_balanced(), is_normal_number(), Aleph::Bounded_Cycle_Index< GT >::length_bits(), load_tree_from_array(), Aleph::CA::ca_gif_detail::lzw_bytes(), Aleph::CA::Hashlife_Engine::make_leaf(), adaptive_huffman_demo::next_code(), Aleph::negative_cycles_detail::odd_significand(), Aleph::Aleph_Hash< double >::operator()(), Aleph::Aleph_Hash< double >::operator()(), Aleph::Aleph_Hash< float >::operator()(), Aleph::Aleph_Hash< float >::operator()(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), adaptive_huffman_demo::trace(), TYPED_TEST(), TYPED_TEST(), and Aleph::howard_detail::verify_exactly().
|
inline |
Definition at line 1361 of file tpl_binNodeUtils.H.
References ah_domain_error_if, destroyRec(), LLINK, Aleph::BitArray::read_bit(), RLINK, and Aleph::BitArray::size().
|
inline |
Find all occurrences using Boyer-Moore-Horspool.
| [in] | text | Text where matches are searched. |
| [in] | pattern | Pattern to find. |
| None. |
pattern is empty, returns all positions in [0, text.size()].Definition at line 313 of file String_Search.H.
References Aleph::string_search_detail::all_match_positions(), and, Aleph::Array< T >::append(), Aleph::Array< T >::create(), m, OhashCommon< HashTbl, Key >::size(), and Aleph::Array< T >::size().
Referenced by main(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
| auto Aleph::branch_and_bound_search | ( | Domain | domain, |
| typename Domain::State | initial_state, | ||
| ExplorationPolicy | policy = Branch_And_Bound<Domain, ObjectivePolicy>::default_policy(), |
||
| SearchLimits | limits = {}, |
||
| ObjectivePolicy | objective = {} |
||
| ) |
Convenience wrapper for one-shot branch and bound.
Definition at line 990 of file Branch_And_Bound.H.
References branch_and_bound_search().
Referenced by branch_and_bound_search(), branch_and_bound_search(), main(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
| and SearchSolutionVisitor< OnSolution, OptimizationSolution< typename Domain::State, typename Domain::Move, typename Domain::Objective > > auto Aleph::branch_and_bound_search | ( | Domain | domain, |
| typename Domain::State | initial_state, | ||
| OnSolution & | on_solution, | ||
| ExplorationPolicy | policy = Branch_And_Bound<Domain, ObjectivePolicy>::default_policy(), |
||
| SearchLimits | limits = {}, |
||
| ObjectivePolicy | objective = {} |
||
| ) |
Convenience wrapper for branch and bound with a solution callback.
Definition at line 1012 of file Branch_And_Bound.H.
References branch_and_bound_search().
|
inline |
See breadth_first_traversal(const GT&, typename GT::Node*, bool (*)(...)).
Definition at line 461 of file tpl_graph_utils.H.
References breadth_first_traversal(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::get_first_node().
Search for a value in a sorted container returning a pointer.
| C | Container template. |
| T | Element type. |
| Compare | Comparison functor type. |
| a | Sorted container. |
| x | Value to search for. |
| cmp | Comparison functor. |
Definition at line 4487 of file tpl_sort_utils.H.
References are_equals(), binary_search(), and cmp().
Search for a value in a sorted container of pointers.
| C | Container template. |
| T | Element type. |
| Compare | Comparison functor type. |
| a | Sorted container of pointers. |
| x | Value to search for. |
| cmp | Comparison functor. |
Definition at line 4519 of file tpl_sort_utils.H.
References are_equals(), binary_search(), and cmp().
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 4498 of file tpl_sort_utils.H.
References are_equals(), binary_search(), and cmp().
|
inline |
Search for all occurrences of a value returning pointers.
| C | Container template. |
| T | Element type. |
| Compare | Comparison functor type. |
| a | Sorted container. |
| x | Value to search for. |
| cmp | Comparison functor. |
Definition at line 4540 of file tpl_sort_utils.H.
References Aleph::DynList< T >::append(), are_equals(), binary_search(), cmp(), and Aleph::DynList< T >::insert().
|
inline |
Search for all occurrences of a value in a container of pointers.
| C | Container template. |
| T | Element type. |
| Compare | Comparison functor type. |
| a | Sorted container of pointers. |
| x | Value to search for. |
| cmp | Comparison functor. |
Definition at line 4584 of file tpl_sort_utils.H.
References Aleph::DynList< T >::append(), are_equals(), binary_search(), cmp(), Aleph::DynList< T >::insert(), and Aleph::DynList< T >::size().
|
inline |
Search for all occurrences of a value returning pointers (const version).
Performs binary search on a and collects pointers to all elements equal to x.
| C | Container template. |
| T | Element type. |
| Compare | Comparison functor type. |
| a | Sorted container. |
| x | Value to search for. |
| cmp | Comparison functor. |
Definition at line 4443 of file tpl_sort_utils.H.
References Aleph::DynList< T >::append(), are_equals(), binary_search(), cmp(), and Aleph::DynList< T >::insert().
Sort a dynamic array using bubble sort.
Bubble sort repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order. The pass through the list is repeated until the list is sorted.
| T | Element type (must be swappable and comparable). |
| Compare | Comparison functor type (default: Aleph::less<T>). |
| a | The dynamic array to sort. |
| cmp | Comparison functor. |
Bubble the smaller element one position toward the front.
Definition at line 3549 of file tpl_sort_utils.H.
References cmp(), and Aleph::DynArray< T >::size().
Referenced by benchmark_array_algorithms().
| void Aleph::bucket_sort | ( | Array< T > & | a, |
| const Compare & | cmp = Compare() |
||
| ) |
Bucket sort for Array (floating-point convenience).
| T | Floating-point type. |
| Compare | Comparison functor. |
| [in,out] | a | Array to sort. |
| [in] | cmp | Comparison functor. |
Definition at line 6399 of file tpl_sort_utils.H.
References bucket_sort(), cmp(), and Aleph::Array< T >::size().
| void Aleph::bucket_sort | ( | Array< T > & | a, |
| const size_t | num_buckets, | ||
| const BucketKey & | bucket_key, | ||
| const Compare & | cmp = Compare() |
||
| ) |
Bucket sort for Array with user-supplied bucket mapping.
| T | Element type. |
| Compare | Comparison functor. |
| BucketKey | Callable mapping T -> size_t. |
| [in,out] | a | Array to sort. |
| [in] | num_buckets | Number of buckets. |
| [in] | bucket_key | Mapping function. |
| [in] | cmp | Comparison functor. |
Definition at line 6479 of file tpl_sort_utils.H.
References bucket_sort(), cmp(), and Aleph::Array< T >::size().
| void Aleph::bucket_sort | ( | DynArray< T > & | a, |
| const Compare & | cmp = Compare() |
||
| ) |
Bucket sort for DynArray (floating-point convenience).
| T | Floating-point type. |
| Compare | Comparison functor. |
| [in,out] | a | DynArray to sort. |
| [in] | cmp | Comparison functor. |
Definition at line 6379 of file tpl_sort_utils.H.
References bucket_sort(), and cmp().
| void Aleph::bucket_sort | ( | DynArray< T > & | a, |
| const size_t | num_buckets, | ||
| const BucketKey & | bucket_key, | ||
| const Compare & | cmp = Compare() |
||
| ) |
Bucket sort for DynArray with user-supplied bucket mapping.
| T | Element type. |
| Compare | Comparison functor. |
| BucketKey | Callable mapping T -> size_t. |
| [in,out] | a | DynArray to sort. |
| [in] | num_buckets | Number of buckets. |
| [in] | bucket_key | Mapping function. |
| [in] | cmp | Comparison functor. |
Definition at line 6459 of file tpl_sort_utils.H.
References cmp().
| void Aleph::bucket_sort | ( | DynList< T > & | list, |
| const Compare & | cmp = Compare() |
||
| ) |
Bucket sort for DynList (floating-point convenience).
Copies elements to an Array, sorts with bucket sort, then writes sorted values back into the list nodes.
| T | Floating-point type. |
| Compare | Comparison functor. |
| [in,out] | list | DynList to sort. |
| [in] | cmp | Comparison functor. |
Definition at line 6437 of file tpl_sort_utils.H.
References bucket_sort(), and cmp().
| void Aleph::bucket_sort | ( | T * | a, |
| const size_t | n, | ||
| const Compare & | cmp = Compare() |
||
| ) |
Bucket sort convenience for floating-point arrays.
How Floating-Point Bucket Sort Works: This overload automatically handles the distribution logic for floating-point numbers without requiring a custom bucket_key.
n buckets based on its relative position in the [min, max] range.This is highly efficient for uniformly distributed floats (e.g., random numbers in [0.0, 1.0)).
| T | Floating-point type (float, double, long double). |
| Compare | Comparison functor (default: Aleph::less<T>). |
| [in,out] | a | Pointer to the array to sort. |
| [in] | n | Number of elements. |
| [in] | cmp | Comparison functor. |
| std::invalid_argument | if a is null and n > 0. |
Definition at line 6309 of file tpl_sort_utils.H.
References ah_invalid_argument_if, and, Aleph::bucket_sort_detail::bucket_sort_impl(), cmp(), range(), and timsort().
| void Aleph::bucket_sort | ( | T * | a, |
| const size_t | n, | ||
| const size_t | num_buckets, | ||
| const BucketKey & | bucket_key, | ||
| const Compare & | cmp = Compare() |
||
| ) |
Bucket sort with user-supplied bucket mapping.
How Bucket Sort Works: Instead of dealing with all elements at once, Bucket Sort divides the sorting workload into smaller, manageable chunks called "buckets". The core idea is:
bucket_key function) to scatter each element into its corresponding bucket. Elements that are mathematically close to each other will end up in the same bucket.This algorithm shines when elements are uniformly distributed across a known range. If elements cluster into a single bucket, performance degrades to that of the internal sorting algorithm (O(n^2) for Insertion Sort).
| T | Element type. |
| Compare | Comparison functor (default: Aleph::less<T>). |
| BucketKey | Callable: bucket_key(element) -> size_t in [0, num_buckets). |
| [in,out] | a | Pointer to the array to sort. |
| [in] | n | Number of elements. |
| [in] | num_buckets | Number of buckets to distribute into. |
| [in] | bucket_key | Mapping function from element to bucket index. |
| [in] | cmp | Comparison functor. |
cmp(x,y) is true then bucket_key(x) <= bucket_key(y) (i.e., bucket_key is monotonic with respect to cmp). cmp after sorting.| std::invalid_argument | if a is null and n > 0. |
| std::domain_error | if bucket_key returns an out-of-range index. |
Delegate to the shared bucket-distribute-and-merge implementation.
Definition at line 6265 of file tpl_sort_utils.H.
References ah_invalid_argument_if, and, Aleph::bucket_sort_detail::bucket_sort_impl(), and cmp().
Referenced by bucket_sort(), bucket_sort(), bucket_sort(), bucket_sort(), bucket_sort(), and Aleph::bucket_sort_detail::bucket_sort_invoker_factory< BucketKey >::operator()().
| void Aleph::bucket_sort | ( | T(&) | a[N], |
| const Compare & | cmp = Compare() |
||
| ) |
Bucket sort for fixed-size C arrays (floating-point convenience).
| T | Floating-point type. |
| N | Array size. |
| Compare | Comparison functor. |
| [in,out] | a | The array to sort. |
| [in] | cmp | Comparison functor. |
Definition at line 6418 of file tpl_sort_utils.H.
References bucket_sort(), and cmp().
Definition at line 723 of file tpl_array.H.
|
inline |
Materialize all k-combinations of Array<T>.
| T | Element type. |
| [in] | values | Source values. |
| [in] | k | Combination size. |
Definition at line 1035 of file ah-comb.H.
References Aleph::Array< T >::append(), for_each_combination(), and k.
Referenced by TEST().
|
inline |
Overload of build_combinations for DynArray<T>.
Definition at line 1048 of file ah-comb.H.
References Aleph::Array< T >::append(), for_each_combination(), and k.
| DynList< DynList< T > > Aleph::build_combs | ( | const DynList< DynList< T > > & | l | ) |
Build the set of unique combinations from a list of lists.
Each permutation is sorted (to remove ordering) and inserted into a set, so duplicates are eliminated.
| T | Element type. Must be sortable by sort() and comparable by CmpContainer. |
| [in] | l | List of lists. |
Definition at line 535 of file ah-comb.H.
References for_each_perm(), Aleph::DynSetTree< Key, Tree, Compare >::insert(), l, and sort().
| C Aleph::build_container | ( | Args &&... | args | ) |
Build a container with the given items.
Each item is passed to the append() of C, in argument order; an rvalue is moved. C::build(), when C has it, does the same and also converts each item to the item type first.
Definition at line 1944 of file ahFunctional.H.
References append_in_container().
Build a DynList with the given items; an rvalue is moved.
Definition at line 1964 of file ahFunctional.H.
|
inline |
|
inline |
Build feasible spanning tree classification.
Classifies all arcs into empty (flow=0), full (flow=cap), and partial.
| Net | Network type. |
| [in] | net | Network to classify. |
Definition at line 1096 of file tpl_netcost.H.
References Aleph::DynList< T >::append().
|
inline |
Generate the sequence of n-bit Gray codes.
Returns an array containing all 2^n Gray codes in sequence, where each successive value differs by exactly one bit.
| n | Number of bits (must be <= 31 to fit in Array). |
| ah_domain_error | if n > 31 (exceeds Array size limits). |
Definition at line 1107 of file ah-comb.H.
References ah_domain_error_if, Aleph::Array< T >::append(), bin_to_gray(), count(), and Aleph::Array< T >::reserve().
|
inline |
Build an index array for indirect sorting.
Creates an array of indices that represents the sorted order of the container's elements without actually moving them. This is useful for:
Time complexity: O(n log n) for the sort Space complexity: O(n) for the index array
The returned Array is created with its final logical size before the indices are initialized, so index construction does not grow or reallocate the result.
quicksort_op().| C | Array-like container type. Must provide size() and either operator()(size_t) or operator[](size_t). |
| Compare | Strict weak ordering over the element type. |
| a | Container whose elements will be indexed. |
| cmp | Comparison functor for element ordering. |
Array<size_t> of indices such that accessing a through these indices yields elements in sorted order.ahSort.H. Definition at line 4885 of file tpl_sort_utils.H.
References cmp(), Aleph::Array< T >::create(), quicksort_op(), and Aleph::Array< T >::size().
Builds and returns an array of pointers to the elements of container a sorted according to the comparison functor.
This function does not move or copy the elements contained in a. Instead, it creates an Array of pointers to the elements in a and sorts those pointers using cmp(*ptr1, *ptr2) as the ordering criterion. The resulting array allows iteration over the elements of a in sorted order without modifying the original container.
The returned Array is created with its final logical size before the pointers are initialized, so index construction does not grow or reallocate the result (see build_index()).
| C | Template parameter of the container type. The container must provide size() and operator() for random access. |
| T | Element type stored in the container. |
| Compare | Comparison functor type, defaulting to Aleph::less<T>. |
| a | Reference to the container whose elements are to be indirectly sorted. |
| cmp | Comparison functor that defines a strict weak ordering on elements of type T. |
Array<T *> where each entry is a pointer to an element of a such that *ret(0), *ret(1), ..., *ret(n-1) are in non-decreasing order according to cmp.Definition at line 4990 of file tpl_sort_utils.H.
References cmp(), Aleph::Array< T >::create(), quicksort_op(), and Aleph::Array< T >::size().
|
inline |
Build an index array of pointers for indirect sorting (const version).
Creates an Array of constant pointers to the elements of container a, sorted according to cmp.
The returned Array is created with its final logical size before the pointers are initialized, so index construction does not grow or reallocate the result (see build_index()).
| C | Container template. |
| T | Element type. |
| Compare | Comparison functor type. |
| a | Container to index. |
| cmp | Comparison functor. |
Array<const T *> of sorted pointers.Definition at line 4413 of file tpl_sort_utils.H.
References cmp(), Aleph::Array< T >::create(), quicksort_op(), and Aleph::Array< T >::size().
| bool Aleph::build_level_graph | ( | Net & | net, |
| typename Net::Node * | source, | ||
| typename Net::Node * | sink | ||
| ) |
Build level graph using BFS from source.
Assigns levels to nodes based on the shortest path distance from the source in the residual network. Only considers edges with positive residual capacity.
| Net | Network type. |
| net | Flow network. |
| source | Source node. |
| sink | Sink node. |
| std::bad_alloc | if memory allocation for the queue fails. |
Definition at line 223 of file tpl_maxflow.H.
References Aleph::DynListQueue< T >::front(), Aleph::DynListQueue< T >::get(), GraphCommon< GT, Node, Arc >::get_connected_node(), GraphCommon< GT, Node, Arc >::get_src_node(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::has_curr(), Aleph::DynListQueue< T >::is_empty(), next(), Aleph::Filter_Iterator< Container, It, Show_Item >::next_ne(), and Aleph::DynListQueue< T >::put().
Referenced by dinic_maximum_flow().
|
inline |
Definition at line 1333 of file ah-string-utils.H.
|
inline |
Build a stringified parameters' list.
Definition at line 1313 of file ah-string-utils.H.
References build_pars_list().
|
inline |
Definition at line 1270 of file ah-string-utils.H.
|
inline |
Append multiple parameters to a comma-separated parameter list.
| T | First value type. |
| Args | Remaining value types. |
| [in,out] | str | Accumulator. |
| [in] | item | First value. |
| [in] | args | Remaining values. |
Definition at line 1288 of file ah-string-utils.H.
References build_pars_list().
|
inline |
Base case for build_pars_list(std::string&, ...).
| [in,out] | unused | Terminates recursion (not used). |
Definition at line 1256 of file ah-string-utils.H.
Referenced by build_pars_list(), build_pars_list(), demo_conversion(), TEST(), TEST(), and TEST().
| DynList< DynList< T > > Aleph::build_perms | ( | const DynList< DynList< T > > & | l | ) |
Materialize all permutations from a list of lists.
| T | Element type. |
| [in] | l | List of lists. |
Definition at line 511 of file ah-comb.H.
References Aleph::DynList< T >::append(), for_each_perm(), and l.
Referenced by demo_build(), TEST(), TEST(), and TEST().
|
inline |
Definition at line 1095 of file tpl_binNodeUtils.H.
References ah_domain_error_if, LLINK, RLINK, and root().
| Residual_Net< typenameNet::Flow_Type >::Node * Aleph::build_residual_net | ( | const Net & | net, |
| Residual_Net< typename Net::Flow_Type > & | rnet, | ||
| DynMapTree< void *, void * > & | arcs | ||
| ) |
Build a residual network from a flow network.
Creates a residual network with forward and backward arcs for each arc in the original network. Also builds a mapping from original arcs to residual arcs.
| Net | Original network type. |
| [in] | net | The original flow network. |
| [out] | rnet | The residual network to populate. |
| [out] | arcs | Mapping from original arcs to residual arcs. |
| domain_error | If network is not single source and single sink. |
Definition at line 627 of file tpl_netcost.H.
References ah_domain_error_if, and, arcs, check_residual_net(), create_residual_arc(), Aleph::Net_Graph< NodeT, ArcT >::get_source(), Aleph::Net_Graph< NodeT, ArcT >::insert_node(), Aleph::Net_Graph< NodeT, ArcT >::is_single_sink(), Aleph::Net_Graph< NodeT, ArcT >::is_single_source(), and NODE_COOKIE.
Referenced by max_flow_min_cost_by_cycle_canceling(), and TYPED_TEST().
|
inline |
Concatenate arbitrary streamable arguments into a string.
This helper is primarily used for building exception messages and logging strings without incurring temporary string allocations for each component.
| Args | Variadic pack of objects insertable into std::ostream. |
| args | Values to append in order. |
Definition at line 70 of file point_utils.H.
References area_of_parallelogram(), and c_is_to_left_().
Referenced by c_is_to_left_().
|
inlinenoexcept |
Traverses the tree and calls key's destructors.
The keys are destroyed in postorder and the links of every node are left as Node::NullPtr, as in destroyRec(). The depth of the recursion is bounded and nothing is allocated.
@param[in,out] root of tree whose keys are destroyed; it is left as `Node::NullPtr` @ingroup Trees @Warning This function does not free the memory occupied by the nodes. It only calls the key destructors. Be careful about double frees if Node calls key destructor in its own destructor. The function is useful when nodes are allocated in a memory pool, and you want to free only the keys or an arena allocator is used for nodes.
Definition at line 835 of file tpl_binNodeUtils.H.
References assert_valid_tree_root(), dispose_tree_nodes(), and root().
Referenced by Aleph::DynSetTree< Key, Tree, Compare >::empty(), TEST(), and TEST().
| void Aleph::cancel_cycle | ( | const Res_Net & | , |
| const Path< Res_Net > & | path | ||
| ) |
Cancel a negative cycle by augmenting flow.
Finds the minimum slack (residual capacity) along the cycle and augments flow by that amount, which cancels the negative cycle.
| Res_Net | Residual network type. |
| [in] | path | The cycle path to cancel. |
| domain_error | If the path is empty or not a cycle, or if it has no bound: each of its arcs goes forward, through an arc without capacity (infinite or max()). |
Definition at line 699 of file tpl_netcost.H.
References ah_domain_error_if, Aleph::Path< GT >::for_each_arc(), Aleph::Path< GT >::is_cycle(), Aleph::Path< GT >::is_empty(), Aleph::net_detail::residual_room(), and Aleph::net_detail::without_capacity().
Referenced by max_flow_min_cost_by_cycle_canceling().
| Net::Flow_Type Aleph::capacity_scaling_maximum_flow | ( | Net & | net | ) |
Compute maximum flow using capacity scaling.
Capacity scaling improves augmenting path algorithms by only considering edges with "significant" residual capacity in each phase. This reduces the number of augmenting paths found.
With a floating flow, the residues of rounding that the paths leave go back at the end (see net_detail::return_dust()): every node keeps its flow within the tolerance of check_node(), so that the network simplex takes the flow. An infinite capacity gives no scale, and Δ starts from the largest finite one, or from 1 if there is none; the arc takes flow in every phase, and a path from the source to the sink of arcs of infinite capacity makes the maximum flow infinite, which the function returns, as the augmenting paths and the preflows do.
O(E² log U) where U is the maximum capacity.
| Net | Network type. |
| net | Flow network. |
| domain_error | If network is not single source/sink. |
| std::bad_alloc | If memory allocation fails during algorithm execution. |
Definition at line 573 of file tpl_maxflow.H.
References Aleph::net_detail::add_flow(), ah_domain_error_if, and, Aleph::Net_Graph< NodeT, ArcT >::flow_value(), Aleph::DynListQueue< T >::front(), Aleph::DynListQueue< T >::get(), GraphCommon< GT, Node, Arc >::get_connected_node(), Aleph::Net_Graph< NodeT, ArcT >::get_sink(), Aleph::Net_Graph< NodeT, ArcT >::get_source(), GraphCommon< GT, Node, Arc >::get_src_node(), Aleph::DynMapTree< Key, Data, Tree, Compare >::has(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::has_curr(), Aleph::DynListQueue< T >::is_empty(), Aleph::Net_Graph< NodeT, ArcT >::is_single_sink(), Aleph::Net_Graph< NodeT, ArcT >::is_single_source(), next(), Aleph::Filter_Iterator< Container, It, Show_Item >::next_ne(), Aleph::DynListQueue< T >::put(), Aleph::net_detail::return_dust(), and Aleph::net_detail::subtract_flow().
Referenced by main(), Aleph::Capacity_Scaling_Maximum_Flow< Net >::operator()(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Convert a hex character in 0..9A..F to its 4-bit nibble value.
Definition at line 141 of file ahUtils.H.
References and.
Referenced by TEST(), and unhexadecimalize().
|
inline |
Check if a team is mathematically eliminated from winning.
A team x is eliminated if there is no possible outcome of remaining games where x finishes first (or tied for first).
Construct a flow network:
Team x is eliminated iff max-flow < total remaining games among others.
| teams | Vector of team information. |
| team_idx | Index of team to check. |
Definition at line 562 of file net_apps.H.
References and, Aleph::BaseballEliminationResult::certificate, Aleph::DynSetTree< Key, Tree, Compare >::contains(), dinic_maximum_flow(), Aleph::BaseballEliminationResult::eliminated, Aleph::DynListQueue< T >::front(), Aleph::DynListQueue< T >::get(), GraphCommon< GT, Node, Arc >::get_connected_node(), Aleph::Net_Graph< NodeT, ArcT >::get_in_degree(), GraphCommon< GT, Node, Arc >::get_src_node(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::has_curr(), Aleph::DynSetTree< Key, Tree, Compare >::insert(), Aleph::Net_Graph< NodeT, ArcT >::insert_arc(), Aleph::Net_Graph< NodeT, ArcT >::insert_node(), Aleph::DynListQueue< T >::is_empty(), Aleph::BaseballEliminationResult::max_possible_wins, Aleph::DynListQueue< T >::put(), Aleph::Team::remaining, and Aleph::Team::wins.
Referenced by demo_baseball_elimination(), TEST(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Definition at line 1645 of file tpl_binNodeUtils.H.
References and, cmp(), KEY, less_or_equal_than(), LLINK, and RLINK.
| bool Aleph::check_residual_net | ( | const Res_Net & | net | ) |
Verify residual network consistency.
Checks that each arc's mirror pointer forms a valid bidirectional link.
| Res_Net | Residual network type. |
| [in] | net | The residual network to check. |
Definition at line 674 of file tpl_netcost.H.
References and.
Referenced by build_residual_net(), and TYPED_TEST().
Height of a ranked AVL subtree, checking all its nodes.
In one traversal, checks at every node of the subtree rooted at p that the heights of its two subtrees differ by at most one, that its stored balance factor is that difference, and that its counter is the size of its subtree.
| p | root of subtree to validate |
Definition at line 95 of file avlNodeRk.H.
References checked_avl_height_rk(), diff(), DIFF, LLINK, and RLINK.
Referenced by checked_avl_height_rk(), and is_avl_rk().
|
inlinenoexcept |
Classifies a lexeme as a keyword or Identifier.
Classifies one identifier lexeme as a keyword when applicable.
The lexer uses this function to decide if "if" is a Kw_If or an Identifier.
| lexeme | Raw lexeme text. |
Identifier if no match. Definition at line 473 of file Compiler_Token.H.
References Identifier, Kw_Break, Kw_Catch, Kw_Class, Kw_Const, Kw_Continue, Kw_Else, Kw_Enum, Kw_Export, Kw_False, Kw_Fn, Kw_For, Kw_If, Kw_Import, Kw_Let, Kw_Namespace, Kw_Return, Kw_Struct, Kw_Throw, Kw_True, Kw_Try, Kw_Type, Kw_Var, and Kw_While.
Referenced by Aleph::Compiler_Lexer::lex_identifier_or_keyword(), and TEST().
|
inline |
Close a gap in an array by shifting elements left.
Removes num_entries elements starting at pos by shifting subsequent elements left.
| T | Element type |
| ptr | Pointer to array |
| n | Number of elements |
| pos | Position of gap to close |
| num_entries | Number of positions to close (default 1) |
| std::out_of_range | if pos >= n or num_entries > remaining elements |
Definition at line 125 of file array_utils.H.
References ah_out_of_range_error_if.
Referenced by Aleph::MemArray< T >::close_gap(), Aleph::Gen_B_Tree< Key, Compare, MinDegree >::erase_at(), Aleph::Gen_BPlus_Tree< Key, Compare, MinDegree >::erase_at(), main(), Aleph::CA::Stationary_Detector::push(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Finalize token scanning by null-terminating and saving the token.
Call this after reading all characters of a token. It adds a null terminator to the buffer and saves the token string for error reporting.
| buffer | Start of the buffer containing the token |
| start_addr | Reference to current write position; used to add null terminator |
| end_addr | Pointer to one past the end of the buffer |
Definition at line 250 of file parse_utils.H.
References close_token_scanning(), put_char_in_buffer(), and token_instance.
Referenced by close_token_scanning(), get_token(), load_binary_number(), load_double(), load_escaped_string(), load_hex_number(), load_identifier(), load_number(), load_octal_number(), load_string(), TEST(), and TEST().
|
inline |
Compute a string with the Lukasiewicz`s word of a tree.
| [in] | root | of tree |
| bad_alloc | if there is no enough memory |
Definition at line 1348 of file tpl_binNodeUtils.H.
References bits(), root(), and tree_to_bits().
Referenced by Aleph::Interpreter_Runtime::call_host_function(), compiler_emit_module_name_resolution_diagnostic(), demo_department_codes(), demo_encoding_decoding(), Aleph::Compiler_Driver::emit_driver_diagnostic(), Aleph::Compiler_MVP_Frontend::emit_driver_diagnostic(), Aleph::Compiler_Line_Frontend::emit_error(), Aleph::Compiler_Typed_Semantic_Analyzer::emit_error(), Aleph::Compiler_Lexer::emit_error(), Aleph::Compiler_Parser::emit_error(), Aleph::Compiler_Parser_Stream::emit_error(), Aleph::Compiler_Semantic_Analyzer::emit_error(), Aleph::Compiler_Parser::expect(), Aleph::Compiler_Parser_Stream::expect(), Aleph::Compiler_Parser::expect_identifier(), Aleph::Compiler_Parser_Stream::expect_identifier(), adaptive_huffman_demo::insert_code(), main(), main(), Aleph::Compiler_Bytecode_VM::make_error(), Aleph::Compiler_Typed_Semantic_Analyzer::require_unify(), Aleph::Interpreter_Runtime::runtime_error(), adaptive_huffman_demo::snapshot(), TEST(), and Aleph::CA::ca_gif_detail::Bit_Writer::write().
| auto Aleph::coefficient_of_variation | ( | const Container & | data | ) | -> std::decay_t<decltype(*std::begin(data))> |
Compute coefficient of variation (CV = stddev / mean).
Useful for comparing variability of datasets with different means.
| data | Input container |
| std::invalid_argument | if mean is zero |
Definition at line 605 of file stat_utils.H.
References ah_invalid_argument_if, coefficient_of_variation(), m, mean(), and stddev().
Referenced by coefficient_of_variation(), TEST(), TEST(), and TEST().
|
static |
Definition at line 77 of file tpl_bipartite.H.
References ARC_COUNTER.
|
static |
Definition at line 71 of file tpl_bipartite.H.
References NODE_COUNTER.
Referenced by __dfp_phase2_subgraph(), __map_subgraph(), Aleph::planarity_detail::LR_Planarity_Checker< GT, SA >::classify_k33(), Aleph::Tikz_Plane::collect_legend_entries(), Aleph::Compute_Cut_Nodes< GT, SA >::compute_blocks(), Aleph::Compute_Cut_Nodes< GT, SA >::create_and_map_node(), demo_biconnected_components(), export_network_to_dot(), graph_oracles::is_bipartite(), kosaraju_connected_components(), main(), map_subgraph(), Aleph::Compute_Cut_Nodes< GT, SA >::map_subgraph(), Aleph::Compute_Cut_Nodes< GT, SA >::map_subgraph(), network_to_dot_string(), Aleph::Compute_Cut_Nodes< GT, SA >::next_to_map(), Aleph::graph_utils_detail::Paint_Frame< GT >::next_to_paint(), nonplanar_certificate_to_dot(), paint_arc(), paint_node(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), tikz_bold_wire_style(), tikz_path_style(), tikz_points_style(), tikz_wire_style(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), and write_colored_node().
|
inline |
Compute n choose k with overflow checks.
| [in] | n | Universe size. |
| [in] | k | Selection size. |
k > n.| ah_runtime_error | if the exact result does not fit in size_t. |
Definition at line 824 of file ah-comb.H.
References ah_runtime_error_if, and k.
|
inline |
Convert command line arguments to a single string.
Concatenates all command line arguments into a single space-separated string. Useful for logging or displaying the command that was invoked.
Definition at line 556 of file parse_utils.H.
References command_line, and command_line_to_string().
Referenced by command_line_to_string(), main(), TEST(), TEST(), and TEST().
|
inlinenoexcept |
Returns binary associativity for an operator.
Returns associativity metadata for binary operators.
| kind | Token kind. |
Definition at line 656 of file Compiler_Token.H.
References AndAnd, Assign, EqEq, Greater, GreaterEq, Left, Less, LessEq, Minus, MinusEq, None, NotEq, OrOr, Percent, PercentEq, Plus, PlusEq, Right, Slash, SlashEq, Star, and StarEq.
Referenced by Aleph::Compiler_Parser::parse_expression(), and TEST().
|
inlinenoexcept |
Returns binary precedence for an operator.
Returns the precedence used by the precedence-climbing parser.
Higher values indicate tighter binding (e.g., * has more precedence than +). Returns 0 if the token is not a valid binary operator.
| kind | Token kind. |
Definition at line 620 of file Compiler_Token.H.
References AndAnd, Assign, EqEq, Greater, GreaterEq, Less, LessEq, Minus, MinusEq, NotEq, OrOr, Percent, PercentEq, Plus, PlusEq, Slash, SlashEq, Star, and StarEq.
Referenced by Aleph::Compiler_Parser::parse_expression(), and TEST().
|
inline |
Binds linked module surfaces into one deterministic name view.
Every visible top-level declaration with no namespace conflict becomes one binding entry in the corresponding module. Ambiguous names and missing metadata remain in issues and are omitted from the resulting bindings.
| linkage | Linked direct-import surface result. |
Definition at line 165 of file Compiler_Module_Binder.H.
References Aleph::DynSetTree< Key, Tree, Compare >::access(), exp(), Aleph::Compiler_Module_Binder_Detail::export_namespace_bucket(), Aleph::Compiler_Module_Binding_Result::issues, Aleph::Compiler_Module_Link_Result::issues, Aleph::Compiler_Module_Bindings::module_index, Aleph::Compiler_Module_Bindings::module_name, Aleph::Compiler_Module_Binding_Result::modules, Aleph::Compiler_Module_Link_Result::modules, Aleph::Compiler_Module_Bindings::names, Aleph::Compiler_Module_Bindings::order_index, Aleph::DynMapTree< Key, Data, Tree, Compare >::search(), Aleph::Compiler_Module_Binder_Detail::translate_issue(), Aleph::Compiler_Module_Binding_Result::valid, and Aleph::Compiler_Module_Link_Result::valid.
Referenced by Aleph::Compiler_Line_Frontend::analyze(), main(), Aleph::Compiler_Generic_Driver::record_module_bindings_artifact(), Aleph::Compiler_Generic_Driver::record_module_name_table_artifact(), Aleph::Compiler_Generic_Driver::record_module_semantic_environment_artifact(), TEST(), TEST(), and TEST().
|
inline |
Builds one reusable per-module name table from bindings.
| bindings | Bound module surfaces. |
Definition at line 88 of file Compiler_Module_Name_Table.H.
References Aleph::Compiler_Module_Name_Table_Entry::ambiguous_names, Ambiguous_Type_Name, Ambiguous_Value_Name, and, Aleph::Compiler_Module_Name_Table_Detail::issue_namespace_kind(), Aleph::Compiler_Module_Binding_Result::issues, k, Aleph::Compiler_Module_Name_Table_Entry::module_index, Aleph::Compiler_Module_Name_Table_Entry::module_name, Aleph::Compiler_Module_Binding_Result::modules, Aleph::Compiler_Module_Name_Table::modules, Aleph::Compiler_Module_Name_Table_Entry::names, and Aleph::Compiler_Module_Name_Table_Entry::order_index.
Referenced by Aleph::Compiler_Line_Frontend::analyze(), main(), Aleph::Compiler_Generic_Driver::record_module_name_table_artifact(), and Aleph::Compiler_Generic_Driver::record_module_semantic_environment_artifact().
|
inline |
Builds one namespace-separated semantic environment from a name table.
| table | Per-module name table. |
Definition at line 85 of file Compiler_Module_Semantic_Environment.H.
References Aleph::Compiler_Module_Semantic_Environment_Detail::append_unique_name(), Aleph::Compiler_Module_Name_Table::modules, Aleph::Compiler_Module_Semantic_Environment::modules, and Type.
Referenced by Aleph::Compiler_Line_Frontend::analyze(), main(), and Aleph::Compiler_Generic_Driver::record_module_semantic_environment_artifact().
|
inlinenoexcept |
Returns a stable debug name for a built-in type.
Definition at line 111 of file Compiler_Types.H.
References Bool, Character, Integer, Invalid, String, and Unit.
Referenced by Aleph::Compiler_Type_Context::append_type_text().
|
inlinenoexcept |
Stable debug name for one execution completion kind.
Definition at line 107 of file Bytecode_Interpreter.H.
References Halted, Returned, and Runtime_Error.
|
inlinenoexcept |
|
inlineconstexprnoexcept |
Returns the sentinel invalid bytecode id.
Definition at line 84 of file Bytecode.H.
Referenced by Aleph::Compiler_Bytecode_VM::execute_entry(), Aleph::Compiler_Bytecode_Lowering::lower_function(), and TEST().
|
inlinenoexcept |
Stable debug name for one bytecode opcode.
Definition at line 144 of file Bytecode.H.
References Binary, Branch, Call, Halt, Jump, Load_Constant, Load_Function, Load_Global, Load_Local, Return, Store_Global, Store_Local, Trap, and Unary.
Referenced by compiler_dump_bytecode_function().
|
inlinenoexcept |
Stable debug name for one bytecode runtime value kind.
Definition at line 90 of file Bytecode_Interpreter.H.
References Function_Ref, Invalid, and Value.
|
inline |
Renders one bytecode value deterministically.
| value | Value to render. |
| module | Optional module used to enrich bytecode function references with function names. |
Definition at line 347 of file Bytecode_Interpreter.H.
References and, Function_Ref, interpreter_value_to_string(), Invalid, out, Value, and value.
Referenced by compiler_dump_bytecode_globals(), Aleph::Compiler_Bytecode_VM::execute_loop(), Aleph::Compiler_Bytecode_VM::require_bool(), and Aleph::Compiler_Bytecode_VM::require_integer().
|
inline |
Returns whether two bytecode values compare equal.
Equality is structural for wrapped Interpreter_Value payloads and exact by function id for bytecode function references.
Definition at line 320 of file Bytecode_Interpreter.H.
References Aleph::Compiler_Bytecode_Value::function_id, Function_Ref, interpreter_values_equal(), Invalid, Aleph::Compiler_Bytecode_Value::kind, Aleph::Compiler_Bytecode_Value::runtime_value, and Value.
Referenced by Aleph::Compiler_Bytecode_VM::execute_loop().
|
inlineconstexprnoexcept |
Returns the sentinel value for an invalid block ID.
Compiler_CFG_Block_Id. Definition at line 77 of file Compiler_CFG.H.
Referenced by Aleph::Compiler_CFG_Lowering::ensure_current_block(), Aleph::Compiler_CFG_Lowering::lower_statement_sequence(), and Aleph::Compiler_CFG_Lowering::lower_stmt().
|
inlinenoexcept |
Returns a stable string name for a CFG terminator kind.
| kind | Terminator kind to convert. |
Definition at line 102 of file Compiler_CFG.H.
References Branch, Exit, Jump, None, Return, and Unreachable.
Referenced by compiler_dump_cfg_function().
|
inlinenoexcept |
|
inlinenoexcept |
Returns the canonical external spelling for one driver action.
Definition at line 67 of file Compiler_Driver_Contracts.H.
References Emit_Bytecode, Emit_C, HIR, IR, Parse_Only, Run, and Sema_Only.
Referenced by TEST().
|
inline |
Dumps one lowered bytecode function deterministically.
Definition at line 923 of file Bytecode.H.
References and, Binary, Aleph::Compiler_Bytecode_Detail::block_name(), Aleph::Compiler_IR_Detail::block_name(), Aleph::Compiler_Bytecode_Function::blocks, Branch, Call, Aleph::Compiler_Bytecode_Function::code, compiler_bytecode_opcode_name(), compiler_ir_slot_kind_name(), Aleph::Compiler_Bytecode_Detail::constant_name(), Aleph::Compiler_Bytecode_Detail::constant_to_string(), Aleph::Compiler_Bytecode_Function::constants, Aleph::Compiler_Bytecode_Function::entry_pc, Aleph::Compiler_Bytecode_Function::exit_pc, Aleph::Compiler_Bytecode_Detail::function_name(), Aleph::Compiler_Bytecode_Detail::global_slot_name(), Halt, Aleph::Compiler_SSA_Block::id, Jump, Aleph::Compiler_SSA_Block::label, Load_Constant, Load_Function, Load_Global, Load_Local, Aleph::Compiler_Bytecode_Detail::local_slot_name(), Aleph::Compiler_Bytecode_Function::local_slots, Aleph::Compiler_Bytecode_Function::name, out, Aleph::Compiler_Bytecode_Function::register_count, Aleph::Compiler_Bytecode_Detail::register_name(), Return, Aleph::Compiler_SSA_Block::source_block_id, Store_Global, Store_Local, Aleph::Compiler_Bytecode_Detail::token_name(), Trap, Aleph::Compiler_Bytecode_Function::type_id, and Unary.
Referenced by compiler_dump_bytecode_module().
|
inline |
Dumps the current global state associated with one bytecode module.
| module | Bytecode module that owns the slot layout. |
| globals | Runtime values stored in each global slot. |
Definition at line 379 of file Bytecode_Interpreter.H.
References Aleph::DynArray< T >::access(), compiler_bytecode_value_to_string(), Aleph::Compiler_Bytecode_Module::global_slots, out, and Aleph::DynArray< T >::size().
Referenced by Aleph::Compiler_Bytecode_VM::dump_globals().
|
inline |
Dumps all lowered bytecode in one module deterministically.
Definition at line 1081 of file Bytecode.H.
References and, Aleph::Compiler_Bytecode_Detail::append_indented_text(), compiler_dump_bytecode_function(), Aleph::Compiler_Bytecode_Module::functions, Aleph::Compiler_Bytecode_Detail::global_slot_name(), Aleph::Compiler_Bytecode_Module::global_slots, out, and Aleph::Compiler_Bytecode_Module::top_level.
Referenced by Aleph::Compiler_Driver::lower_bytecode(), Aleph::Compiler_Generic_Driver::lower_bytecode(), main(), and TEST().
|
inline |
Dumps a single CFG function in text format for debugging.
| function | CFG to dump. |
| types | Optional type context to resolve type IDs. |
Definition at line 873 of file Compiler_CFG.H.
References Aleph::DynArray< T >::access(), and, Aleph::Compiler_CFG_Detail::append_hir_expr_dump(), Aleph::Compiler_CFG_Detail::append_hir_stmt_dump(), Aleph::Compiler_CFG_Detail::block_name(), Aleph::Compiler_CFG_Function::blocks, Branch, compiler_cfg_terminator_kind_name(), Aleph::Compiler_CFG_Function::entry_block, Aleph::Compiler_CFG_Function::exit_block, Aleph::Compiler_SSA_Block::id, Aleph::DynArray< T >::is_empty(), Aleph::Compiler_SSA_Terminator::kind, Aleph::Compiler_SSA_Block::label, Aleph::Compiler_CFG_Function::name, out, Aleph::Compiler_SSA_Block::predecessors, Return, Aleph::DynArray< T >::size(), Aleph::Compiler_SSA_Terminator::successors, Aleph::Compiler_SSA_Block::terminator, and Aleph::Compiler_CFG_Function::type_id.
Referenced by compiler_dump_cfg_module().
|
inline |
Dumps a complete CFG module in text format for debugging.
| module | Module to dump. |
| types | Optional type context. |
Definition at line 955 of file Compiler_CFG.H.
References Aleph::Compiler_CFG_Detail::append_indented_text(), compiler_dump_cfg_function(), Aleph::Compiler_CFG_Module::functions, out, and Aleph::Compiler_CFG_Module::top_level.
|
inline |
Produces a deterministic, human-readable dump of a dataflow result.
| function | Pointer to the IR function; may be nullptr (function name is omitted from the output in that case). |
| analysis | Dataflow result to render. |
| types | Optional type context used to render type names; nullptr causes types to be rendered as numeric IDs. |
Definition at line 1294 of file Compiler_Dataflow.H.
References Aleph::DynArray< T >::access(), and, Aleph::Compiler_Dataflow_Function_Analysis::assigned_in_slots, Aleph::Compiler_Dataflow_Function_Analysis::assigned_out_slots, Aleph::Compiler_IR_Detail::block_name(), Aleph::Compiler_IR_Function::blocks, compiler_ir_slot_kind_name(), Aleph::Compiler_Dataflow_Function_Analysis::constant_in_slots, Aleph::Compiler_Dataflow_Function_Analysis::constant_out_slots, Aleph::Compiler_Dataflow_Function_Analysis::foldable_branch_count, Aleph::Compiler_Dataflow_Detail::format_slot_constants(), Aleph::Compiler_Dataflow_Detail::format_slot_set(), Aleph::Compiler_SSA_Block::label, Aleph::Compiler_Dataflow_Function_Analysis::live_in_slots, Aleph::Compiler_Dataflow_Function_Analysis::live_out_slots, Aleph::Compiler_IR_Detail::local_slot_name(), Aleph::Compiler_IR_Function::local_slots, Aleph::Compiler_IR_Function::name, out, Aleph::Compiler_Dataflow_Function_Analysis::reachable_blocks, Aleph::DynArray< T >::size(), and Aleph::Compiler_Dataflow_Function_Analysis::uninitialized_reads.
|
inline |
Dumps an expression subtree in a deterministic text format.
| expr | Root of the expression tree. |
Definition at line 1457 of file Compiler_AST.H.
References Aleph::Compiler_Ast_Detail::dump_expr(), and out.
Referenced by TEST().
|
inline |
Dumps a function declaration in a deterministic text format.
| fn | Function declaration node. |
Definition at line 1513 of file Compiler_AST.H.
References Aleph::Compiler_Function_Decl::body, Aleph::Compiler_Ast_Detail::dump_stmt(), Aleph::Compiler_Ast_Detail::dump_type_expr(), Aleph::Compiler_Function_Decl::name, out, Aleph::Compiler_Function_Decl::parameters, and Aleph::Compiler_Function_Decl::return_annotation.
Referenced by TEST().
|
inline |
Dumps one HIR expression in a deterministic text format.
Definition at line 777 of file Compiler_HIR_Model.H.
References Aleph::Compiler_HIR_Detail::dump_expr(), and out.
Referenced by Aleph::Compiler_CFG_Detail::append_hir_expr_dump().
|
inline |
Dumps one HIR function in a deterministic text format.
Definition at line 795 of file Compiler_HIR_Model.H.
References Aleph::Compiler_HIR_Function::body, Aleph::Compiler_HIR_Detail::dump_stmt(), Aleph::Compiler_HIR_Function::name, out, Aleph::Compiler_HIR_Function::parameters, Aleph::Compiler_Type_Context::to_string(), and Aleph::Compiler_HIR_Function::type_id.
|
inline |
Dumps one HIR module in a deterministic text format.
Definition at line 824 of file Compiler_HIR_Model.H.
References Aleph::Compiler_HIR_Detail::append_indent(), Aleph::Compiler_HIR_Detail::dump_stmt(), out, Aleph::Compiler_HIR_Module::statements, and Aleph::Compiler_Type_Context::to_string().
Referenced by Aleph::Compiler_Driver::lower_hir(), Aleph::Compiler_Line_Frontend::lower_hir(), Aleph::Compiler_MVP_Frontend::lower_hir(), main(), TEST(), and TEST().
|
inline |
Dumps one HIR statement in a deterministic text format.
Definition at line 786 of file Compiler_HIR_Model.H.
References Aleph::Compiler_HIR_Detail::dump_stmt(), and out.
Referenced by Aleph::Compiler_CFG_Detail::append_hir_stmt_dump().
|
inline |
Dumps an import declaration subtree in a deterministic text format.
| decl | Root of the import declaration subtree. |
Definition at line 1485 of file Compiler_AST.H.
References Aleph::Compiler_Ast_Detail::dump_import_decl(), and out.
|
inline |
Dumps one lowered IR function deterministically.
Definition at line 535 of file Compiler_IR_Model.H.
References Aleph::DynArray< T >::access(), and, Binary, Aleph::Compiler_IR_Detail::block_name(), Aleph::Compiler_IR_Function::blocks, Branch, compiler_ir_instruction_kind_name(), compiler_ir_invalid_id(), compiler_ir_slot_kind_name(), compiler_ir_terminator_kind_name(), compiler_operator_name(), Aleph::Compiler_SSA_Terminator::condition_value, Constant, Aleph::Compiler_IR_Function::entry_block, Aleph::Compiler_IR_Function::exit_block, Aleph::Compiler_IR_Detail::function_name(), Function_Ref, Aleph::Compiler_IR_Detail::global_slot_name(), Aleph::Compiler_SSA_Block::id, Aleph::Compiler_SSA_Block::instructions, Aleph::DynArray< T >::is_empty(), k, Aleph::Compiler_SSA_Terminator::kind, Aleph::Compiler_SSA_Block::label, Load, Aleph::Compiler_IR_Detail::local_slot_name(), Aleph::Compiler_IR_Function::local_slots, Aleph::Compiler_IR_Function::name, out, Return, Aleph::Compiler_SSA_Terminator::return_value, Aleph::DynArray< T >::size(), Store, Aleph::Compiler_SSA_Terminator::successors, Aleph::Compiler_SSA_Block::terminator, Aleph::Compiler_IR_Function::type_id, Unary, and Aleph::Compiler_IR_Detail::value_name().
Referenced by compiler_dump_ir_module().
|
inline |
Dumps all lowered IR in one module deterministically.
Definition at line 653 of file Compiler_IR_Model.H.
References and, Aleph::Compiler_IR_Detail::append_indented_text(), compiler_dump_ir_function(), Aleph::Compiler_IR_Module::functions, Aleph::Compiler_IR_Detail::global_slot_name(), Aleph::Compiler_IR_Module::global_slots, out, and Aleph::Compiler_IR_Module::top_level.
Referenced by Aleph::Compiler_Driver::lower_ir(), Aleph::Compiler_Line_Frontend::lower_ir(), Aleph::Compiler_MVP_Frontend::lower_ir(), main(), TEST(), and TEST().
|
inline |
Dumps a parsed module in a deterministic text format.
| module | Module node. |
Definition at line 1558 of file Compiler_AST.H.
References Aleph::Compiler_Ast_Detail::append_indent(), Aleph::Compiler_Ast_Detail::dump_import_decl(), Aleph::Compiler_Ast_Detail::dump_stmt(), Aleph::Compiler_Ast_Detail::dump_type_decl(), Aleph::Compiler_Ast_Detail::dump_type_expr(), Aleph::Compiler_Module::imports, out, Aleph::Compiler_Module::statements, and Aleph::Compiler_Module::type_declarations.
Referenced by main(), Aleph::Compiler_Driver::record_ast_artifacts(), Aleph::Compiler_MVP_Frontend::record_ast_artifacts(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Dumps one SSA function deterministically.
Definition at line 1254 of file SSA.H.
References Aleph::DynArray< T >::access(), and, Aleph::Compiler_IR_Detail::block_name(), Aleph::Compiler_SSA_Detail::block_name(), Aleph::Compiler_SSA_Function::blocks, compiler_ir_terminator_kind_name(), compiler_ssa_instruction_kind_name(), compiler_ssa_invalid_id(), Aleph::Compiler_SSA_Terminator::condition_value, Aleph::Compiler_SSA_Function::dominance, Aleph::Compiler_SSA_Dominance_Info::dominance_frontiers, Aleph::Compiler_SSA_Function::entry_block, Aleph::Compiler_SSA_Function::exit_block, Aleph::Compiler_SSA_Detail::function_name(), Aleph::Compiler_SSA_Detail::global_slot_name(), Aleph::Compiler_SSA_Dominance_Info::immediate_dominators, Aleph::Compiler_SSA_Block::instructions, Aleph::DynArray< T >::is_empty(), Aleph::Compiler_SSA_Terminator::kind, Aleph::Compiler_SSA_Block::label, Aleph::Compiler_SSA_Detail::local_slot_name(), Aleph::Compiler_SSA_Parameter::name, Aleph::Compiler_SSA_Function::name, out, Aleph::Compiler_SSA_Function::parameters, Aleph::Compiler_SSA_Block::phis, Aleph::Compiler_SSA_Block::predecessors, Aleph::Compiler_SSA_Terminator::return_value, Aleph::DynArray< T >::size(), size(), Aleph::Compiler_SSA_Parameter::slot_id, Aleph::Compiler_SSA_Block::source_block_id, Aleph::Compiler_SSA_Terminator::successors, Aleph::Compiler_SSA_Block::terminator, Aleph::Compiler_SSA_Detail::token_name(), Aleph::Compiler_SSA_Parameter::type_id, Aleph::Compiler_SSA_Function::type_id, Aleph::Compiler_SSA_Parameter::value_id, and Aleph::Compiler_SSA_Detail::value_name().
Referenced by compiler_dump_ssa_module(), and TEST().
|
inline |
Dumps all SSA functions in one module deterministically.
Definition at line 1410 of file SSA.H.
References and, Aleph::Compiler_SSA_Detail::append_indented_text(), compiler_dump_ssa_function(), Aleph::Compiler_SSA_Module::functions, Aleph::Compiler_SSA_Detail::global_slot_name(), Aleph::Compiler_SSA_Module::global_slots, out, and Aleph::Compiler_SSA_Module::top_level.
Referenced by main().
|
inline |
Dumps a statement subtree in a deterministic text format.
| stmt | Root of the statement tree. |
Definition at line 1471 of file Compiler_AST.H.
References Aleph::Compiler_Ast_Detail::dump_stmt(), and out.
|
inline |
Dumps a type declaration subtree in a deterministic text format.
| decl | Root of the type declaration subtree. |
Definition at line 1499 of file Compiler_AST.H.
References Aleph::Compiler_Ast_Detail::dump_type_decl(), and out.
|
inline |
Convenience wrapper that emits one IR module to portable C.
Definition at line 1375 of file Compiler_Backend_C.H.
Referenced by Aleph::Compiler_Driver::emit_c(), Aleph::Compiler_Generic_Driver::emit_c(), main(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Emits one structured diagnostic for a module-name resolution failure.
When resolution.ok() is true, this helper emits nothing and returns 0.
| diagnostics | Diagnostic engine receiving the error. |
| span | Source span of the failed use site. |
| resolution | Structured module-name resolution result. |
| code | Stable frontend-specific diagnostic code. |
| subject | User-facing noun phrase such as "line-frontend callee". |
0 if no diagnostic was emitted. Definition at line 63 of file Compiler_Module_Name_Diagnostics.H.
References Ambiguous_Name, Aleph::Diagnostic_Builder::code(), code(), compiler_module_export_kind_name(), Aleph::Diagnostic_Builder::emit(), Aleph::Diagnostic_Engine::error(), Aleph::Diagnostic_Builder::help(), Missing_Module, Missing_Name, Aleph::Diagnostic_Builder::note(), resolution, Resolved, and Wrong_Kind.
Referenced by main(), TEST(), TEST(), and Aleph::Compiler_Line_Frontend::validate_top_level_calls().
|
inlinenoexcept |
Returns a stable debug name for an expression kind.
| kind | Expression kind to convert to string. |
Definition at line 192 of file Compiler_AST.H.
References Binary, Bool_Literal, Call, Char_Literal, Grouping, Identifier, Integer_Literal, Invalid, String_Literal, and Unary.
|
inlinenoexcept |
Finds one semantic environment by module name.
Definition at line 125 of file Compiler_Module_Semantic_Environment.H.
|
inlinenoexcept |
Returns a stable debug name for an HIR constant kind.
Definition at line 158 of file Compiler_HIR_Model.H.
References Bool, Character, Integer, String, and Unit.
Referenced by Aleph::Compiler_HIR_Detail::dump_expr().
|
inlinenoexcept |
|
inlinenoexcept |
Merges two spans without depending on the parser-oriented AST layer.
Definition at line 57 of file Compiler_HIR_Model.H.
References Aleph::Source_Span::file_id.
Referenced by Aleph::Compiler_CFG_Lowering::merge_span(), Aleph::Compiler_IR_Lowering::Module_Builder::merge_span(), Aleph::Compiler_HIR_Builder::merge_span(), and Aleph::Compiler_IR_Builder::merge_span().
|
inlinenoexcept |
|
inlinenoexcept |
Applies one integer operator of the language to two values.
Integers are signed 64-bit values. An operation whose result does not fit is an error, not a wrap-around: the HIR interpreter, the bytecode VM and the generated C report it at run time, and the optimizer leaves it unfolded. LLONG_MIN / -1 overflows; LLONG_MIN % -1 is 0, which fits.
| op | Plus, Minus, Star, Slash, Percent, Amp, Pipe or Caret. |
| lhs | left operand. |
| rhs | right operand. |
Definition at line 345 of file Compiler_Operator.H.
References Amp, and, Caret, max(), min(), Minus, Percent, Pipe, Plus, Slash, and Star.
Referenced by Aleph::Interpreter_Runtime::evaluate_expr(), and Aleph::Compiler_Bytecode_VM::execute_loop().
|
inlinenoexcept |
Negates one integer of the language.
| operand | the value to negate. |
-operand, or Overflow if operand is LLONG_MIN. Definition at line 408 of file Compiler_Operator.H.
Referenced by Aleph::Interpreter_Runtime::evaluate_expr(), and Aleph::Compiler_Bytecode_VM::execute_loop().
|
inlinenoexcept |
Stable debug name for one instruction kind.
Definition at line 124 of file Compiler_IR_Model.H.
References Binary, Call, Constant, Function_Ref, Load, Store, and Unary.
Referenced by compiler_dump_ir_function(), and Aleph::Compiler_C_Backend::Emitter::emit_instruction_comment().
|
inlineconstexprnoexcept |
Returns the sentinel invalid IR id.
Definition at line 72 of file Compiler_IR_Model.H.
Referenced by compiler_dump_ir_function(), Aleph::Compiler_Dataflow_Detail::compute_block_use_def(), eliminate_dead_code(), Aleph::Compiler_C_Backend::Emitter::emit_instruction(), Aleph::Compiler_IR_Lowering::Module_Builder::ensure_block(), Aleph::Compiler_IR_Lowering::Module_Builder::find_function_id(), Aleph::Compiler_IR_Lowering::Module_Builder::find_global_slot_id(), Aleph::Compiler_Dataflow_Detail::instruction_is_trivially_dead(), Aleph::Compiler_IR_Lowering::Module_Builder::lower_expr(), Aleph::Compiler_Bytecode_Lowering::lower_function(), Aleph::Compiler_IR_Lowering::Module_Builder::lower_function_body(), Aleph::Compiler_SSA_Lowering::lower_function_internal(), Aleph::Compiler_Line_Frontend::lower_ir(), Aleph::Compiler_IR_Lowering::lower_module(), Aleph::Compiler_IR_Lowering::Module_Builder::lower_stmt(), Aleph::Compiler_SSA_Detail::normalize_ir_function(), Aleph::Compiler_IR_Lowering::Module_Builder::predeclare_function(), Aleph::Compiler_SSA_Detail::rename_recursive(), Aleph::Compiler_IR_Builder::set_top_level(), Aleph::Compiler_Dataflow_Detail::simulate_block(), TEST(), TEST(), validate_dead_code_elimination(), and validate_ir_function().
|
inlinenoexcept |
Stable debug name for one slot kind.
Definition at line 109 of file Compiler_IR_Model.H.
References Global, Local, and Parameter.
Referenced by compiler_dump_bytecode_function(), compiler_dump_dataflow_analysis(), compiler_dump_ir_function(), and Aleph::Compiler_C_Backend::Emitter::emit_slot_declarations().
|
inlinenoexcept |
Stable debug name for one terminator kind.
Definition at line 147 of file Compiler_IR_Model.H.
References Branch, Exit, Jump, None, Return, and Unreachable.
Referenced by compiler_dump_ir_function(), compiler_dump_ssa_function(), Aleph::Compiler_C_Backend::Emitter::emit_terminator(), and main().
|
inlinenoexcept |
Returns whether a token kind can start an expression in the MVP grammar.
Frontends may reuse this predicate directly or use it as a reference when defining a custom expression-entry policy.
Definition at line 57 of file Compiler_Parser_Utils.H.
References Bang, Char_Literal, Identifier, Integer_Literal, Kw_False, Kw_True, LParen, Minus, Plus, String_Literal, and Tilde.
Referenced by compiler_is_statement_start(), Aleph::Compiler_Parser::parse_statement(), and TEST().
|
inlinenoexcept |
Returns whether a token kind can start a statement in the MVP grammar.
Definition at line 79 of file Compiler_Parser_Utils.H.
References compiler_is_expression_start(), Kw_Break, Kw_Continue, Kw_If, Kw_Let, Kw_Return, Kw_While, and LBrace.
Referenced by Aleph::Compiler_Parser::parse_statement_terminator(), and TEST().
|
inlinenoexcept |
Returns whether a token kind starts one top-level declaration.
Definition at line 97 of file Compiler_Parser_Utils.H.
References Kw_Enum, Kw_Fn, Kw_Import, Kw_Struct, and Kw_Type.
Referenced by Aleph::Compiler_Parser_Stream::synchronize_statement(), and TEST().
|
inline |
Links direct-import module surfaces into visible top-level views.
Definition at line 135 of file Compiler_Module_Linker.H.
References Aleph::DynArray< T >::access(), and, Aleph::DynArray< T >::append(), Aleph::Compiler_Module_Linkage::direct_import_indexes, Duplicate_Type_Export, Duplicate_Value_Export, exp(), Aleph::Compiler_Module_Linker_Detail::export_namespace_bucket(), Aleph::Compiler_Module_Linker_Detail::find_metadata_index(), Aleph::Compiler_Module_Link_Result::issues, Missing_Metadata, Aleph::Compiler_Module_Linkage::module_index, Aleph::Compiler_Module_Linkage::module_name, Aleph::Compiler_Module_Link_Result::modules, Aleph::Compiler_Module_Linkage::order_index, Aleph::DynMapTree< Key, Data, Tree, Compare >::search(), Aleph::DynArray< T >::size(), Type, Aleph::Compiler_Module_Link_Result::valid, and Aleph::Compiler_Module_Linkage::visible_exports.
Referenced by Aleph::Compiler_Line_Frontend::analyze(), main(), Aleph::Compiler_Generic_Driver::record_module_bindings_artifact(), Aleph::Compiler_Generic_Driver::record_module_linkage_artifact(), Aleph::Compiler_Generic_Driver::record_module_name_table_artifact(), Aleph::Compiler_Generic_Driver::record_module_semantic_environment_artifact(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inlinenoexcept |
Looks up one visible type-namespace binding in a module environment.
Definition at line 151 of file Compiler_Module_Semantic_Environment.H.
Referenced by TEST().
|
inlinenoexcept |
Looks up one visible value-namespace binding in a module environment.
Definition at line 135 of file Compiler_Module_Semantic_Environment.H.
Referenced by TEST(), and Aleph::Compiler_Line_Frontend::validate_top_level_calls().
|
inlinenoexcept |
Merges two spans from the same source file.
Calculates a span that encompasses both input spans. If either span is invalid, the other is returned unchanged.
| lhs | Left-hand side span. |
| rhs | Right-hand side span. |
Definition at line 83 of file Compiler_AST.H.
References Aleph::Source_Span::file_id.
Referenced by Aleph::Compiler_Driver::merge_modules_from_order(), Aleph::Compiler_MVP_Frontend::merge_modules_from_order(), Aleph::Compiler_Parser::parse_block_statement(), Aleph::Compiler_Parser::parse_call_suffix(), Aleph::Compiler_Parser::parse_enum_declaration(), Aleph::Compiler_Parser::parse_function(), Aleph::Compiler_Parser::parse_function_type(), Aleph::Compiler_Parser::parse_import_declaration(), Aleph::Compiler_Parser::parse_parenthesized_type(), and Aleph::Compiler_Parser::parse_struct_declaration().
|
inlinenoexcept |
Returns the stable debug name for one module-binding issue kind.
Definition at line 103 of file Compiler_Module_Binder.H.
References Ambiguous_Type_Name, Ambiguous_Value_Name, and Missing_Metadata.
Referenced by compiler_render_module_bindings().
|
inlinenoexcept |
Returns the stable debug name for one module-export kind.
Definition at line 60 of file Compiler_Module_Metadata.H.
References Function, Global, and Type.
Referenced by compiler_emit_module_name_resolution_diagnostic(), compiler_render_module_bindings(), compiler_render_module_linkage(), compiler_render_module_metadata(), compiler_render_module_name_table(), and compiler_render_module_semantic_environment().
|
inlinenoexcept |
Returns the stable debug name for one linkage issue kind.
Definition at line 103 of file Compiler_Module_Linker.H.
References Duplicate_Type_Export, Duplicate_Value_Export, and Missing_Metadata.
Referenced by compiler_render_module_linkage().
|
inlinenoexcept |
|
inlinenoexcept |
Returns the stable debug name for one module-name resolution status.
Definition at line 110 of file Compiler_Module_Name_Resolver.H.
References Ambiguous_Name, Missing_Module, Missing_Name, Resolved, and Wrong_Kind.
Referenced by main().
|
inlinenoexcept |
Returns the stable debug name of one module-resolution issue kind.
Definition at line 94 of file Compiler_Module_Resolver.H.
References Cyclic_Dependency, and Missing_Dependency.
|
inlinenoexcept |
Returns the arithmetic operator underlying one compound assignment.
Definition at line 294 of file Compiler_Operator.H.
References Invalid, Minus, MinusEq, Percent, PercentEq, Plus, PlusEq, Slash, SlashEq, Star, and StarEq.
Referenced by Aleph::Interpreter_Runtime::evaluate_expr(), and Aleph::Compiler_IR_Lowering::Module_Builder::lower_expr().
|
inlinenoexcept |
Maps one reference-frontend token kind into a reusable operator kind.
Definition at line 148 of file Compiler_Operator.H.
References Amp, AndAnd, Assign, Bang, Caret, EqEq, Greater, GreaterEq, Invalid, Less, LessEq, Minus, MinusEq, MinusMinus, NotEq, OrOr, Percent, PercentEq, Pipe, Plus, PlusEq, PlusPlus, Slash, SlashEq, Star, StarEq, and Tilde.
Referenced by Aleph::Compiler_HIR_Lowering::lower_expr().
|
inlinenoexcept |
Returns whether kind is one compound-assignment operator.
Definition at line 276 of file Compiler_Operator.H.
References MinusEq, PercentEq, PlusEq, SlashEq, and StarEq.
Referenced by Aleph::Interpreter_Runtime::evaluate_expr(), and Aleph::Compiler_IR_Lowering::Module_Builder::lower_expr().
|
inlinenoexcept |
Returns a stable debug name for one operator kind.
Definition at line 84 of file Compiler_Operator.H.
References Amp, AndAnd, Assign, Bang, Caret, EqEq, Greater, GreaterEq, Invalid, Less, LessEq, Minus, MinusEq, MinusMinus, NotEq, OrOr, Percent, PercentEq, Pipe, Plus, PlusEq, PlusPlus, Slash, SlashEq, Star, StarEq, and Tilde.
Referenced by compiler_dump_ir_function(), Aleph::Compiler_HIR_Detail::dump_expr(), Aleph::Compiler_Line_Frontend::dump_parsed_program(), Aleph::Interpreter_Runtime::evaluate_expr(), TEST(), Aleph::Compiler_Bytecode_Detail::token_name(), Aleph::Compiler_Backend_C_Detail::token_name(), and Aleph::Compiler_SSA_Detail::token_name().
|
inlinenoexcept |
Maps one reusable operator kind back into the MVP token kind.
Definition at line 212 of file Compiler_Operator.H.
References Amp, AndAnd, Assign, Bang, Caret, EqEq, Greater, GreaterEq, Invalid, Less, LessEq, Minus, MinusEq, MinusMinus, NotEq, OrOr, Percent, PercentEq, Pipe, Plus, PlusEq, PlusPlus, Slash, SlashEq, Star, StarEq, and Tilde.
|
inlinenoexcept |
Parses one canonical driver action spelling.
Accepted spellings include parse-only, sema-only, hir, ir, run, emit-c, and emit-bytecode. Short aliases such as parse, sema, c, and bytecode are accepted as convenience spellings.
| text | User-facing action spelling. |
| action | Output action updated on success. |
true if text is recognized. Definition at line 100 of file Compiler_Driver_Contracts.H.
References Emit_Bytecode, Emit_C, HIR, IR, Parse_Only, Run, and Sema_Only.
Referenced by TEST().
|
inline |
Renders one deterministic text artifact for bound module names.
| result | Binding result to render. |
Definition at line 235 of file Compiler_Module_Binder.H.
References compiler_module_binding_issue_name(), compiler_module_export_kind_name(), Aleph::Compiler_Module_Binding_Result::issues, Aleph::Compiler_Module_Binding_Result::modules, and out.
Referenced by main(), and Aleph::Compiler_Generic_Driver::record_module_bindings_artifact().
|
inline |
Renders one deterministic text artifact for linked module surfaces.
Definition at line 253 of file Compiler_Module_Linker.H.
References compiler_module_export_kind_name(), compiler_module_linkage_issue_name(), Aleph::Compiler_Module_Link_Result::issues, Aleph::Compiler_Module_Link_Result::modules, and out.
Referenced by main(), and Aleph::Compiler_Generic_Driver::record_module_linkage_artifact().
|
inline |
Renders one deterministic text artifact for module metadata.
Definition at line 92 of file Compiler_Module_Metadata.H.
References compiler_module_export_kind_name(), out, and Aleph::DynArray< T >::size().
Referenced by Aleph::Compiler_Generic_Driver::record_module_metadata_artifact(), and TEST().
|
inline |
Renders one deterministic text artifact for cached module names.
| table | Cached table to render. |
Definition at line 143 of file Compiler_Module_Name_Table.H.
References compiler_module_export_kind_name(), Aleph::Compiler_Module_Name_Table::modules, and out.
Referenced by main(), and Aleph::Compiler_Generic_Driver::record_module_name_table_artifact().
|
inline |
Renders one deterministic text artifact for a module order.
Definition at line 109 of file Compiler_Module_Resolver.H.
References Aleph::DynArray< T >::access(), out, and Aleph::DynArray< T >::size().
Referenced by main(), Aleph::Compiler_Generic_Driver::record_import_order_artifact(), Aleph::Compiler_Line_Frontend::record_import_order_artifact(), Aleph::Compiler_MVP_Frontend::record_import_order_artifact(), and TEST().
|
inline |
Renders one deterministic text artifact for semantic environments.
Definition at line 167 of file Compiler_Module_Semantic_Environment.H.
References compiler_module_export_kind_name(), Aleph::Compiler_Module_Semantic_Environment::modules, Aleph::Compiler_Module_Bound_Name::name, and out.
Referenced by main(), and Aleph::Compiler_Generic_Driver::record_module_semantic_environment_artifact().
|
inline |
Resolves one top-level name through reusable per-module bindings.
| bindings | Binding result produced by compiler_bind_module_surfaces. |
| module_name | Query module. |
| symbol_name | Query symbol. |
| filter | Optional kind filter for values/functions/globals/types. |
Definition at line 178 of file Compiler_Module_Name_Resolver.H.
References Ambiguous_Name, Aleph::Compiler_Module_Name_Resolution::binding, filter(), Aleph::Compiler_Module_Name_Resolution::filter, Aleph::Compiler_Module_Name_Resolver_Detail::issue_matches_query(), Aleph::Compiler_Module_Binding_Result::issues, Aleph::Compiler_Module_Name_Resolver_Detail::matches_filter(), Missing_Module, Missing_Name, Aleph::Compiler_Module_Name_Resolution::module_name, Aleph::Compiler_Module_Binding_Result::modules, Aleph::Compiler_Module_Bindings::names, Resolved, Aleph::Compiler_Module_Name_Resolution::status, Aleph::Compiler_Module_Name_Resolution::symbol_name, and Wrong_Kind.
Referenced by main(), TEST(), TEST(), TEST(), TEST(), and Aleph::Compiler_Line_Frontend::validate_top_level_calls().
|
inline |
Resolves one top-level name through a cached per-module name table.
| table | Cached name table built by compiler_build_module_name_table. |
| module_name | Query module. |
| symbol_name | Query symbol. |
| filter | Optional kind filter for values/functions/globals/types. |
Definition at line 242 of file Compiler_Module_Name_Resolver.H.
References Ambiguous_Name, Aleph::Compiler_Module_Name_Table_Entry::ambiguous_names, and, Any, Aleph::Compiler_Module_Name_Resolution::binding, filter(), Aleph::Compiler_Module_Name_Resolution::filter, Function, Global, Aleph::Compiler_Module_Name_Resolver_Detail::matches_filter(), Missing_Module, Missing_Name, Aleph::Compiler_Module_Name_Resolution::module_name, Aleph::Compiler_Module_Name_Table::modules, Aleph::Compiler_Module_Name_Table_Entry::names, Resolved, Aleph::Compiler_Module_Name_Resolution::status, Aleph::Compiler_Module_Name_Resolution::symbol_name, Type, Value, and Wrong_Kind.
|
inline |
Resolves one dependency-first order for exact-name module imports.
Missing dependencies are reported and skipped so the caller can still get a best-effort order. Cycles stop DFS along the offending path because no valid dependency-first ordering exists for that strongly connected region.
Definition at line 206 of file Compiler_Module_Resolver.H.
References Aleph::DynArray< T >::access(), Aleph::DynArray< T >::append(), Aleph::Compiler_Module_Resolver_Detail::resolve_visit(), and Aleph::DynArray< T >::size().
Referenced by main(), Aleph::Compiler_Driver::resolve_import_order(), Aleph::Compiler_Line_Frontend::resolve_import_order(), Aleph::Compiler_MVP_Frontend::resolve_import_order(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inlinenoexcept |
Returns a stable debug name for an SSA instruction kind.
Definition at line 92 of file SSA.H.
References Binary, Call, Constant, Function_Ref, Load_Global, Store_Global, and Unary.
Referenced by compiler_dump_ssa_function().
|
inlineconstexprnoexcept |
Returns the sentinel invalid SSA id.
Definition at line 73 of file SSA.H.
Referenced by compiler_dump_ssa_function(), Aleph::Compiler_SSA_Detail::compute_dominance_info(), Aleph::Compiler_SSA_Detail::predecessor_index(), Aleph::Compiler_SSA_Detail::rename_recursive(), TEST(), and validate_ssa_function().
|
inlinenoexcept |
Returns a stable debug name for a statement kind.
| kind | Statement kind to convert to string. |
Definition at line 228 of file Compiler_AST.H.
References Block, Break, Continue, Expr, If, Invalid, Let, Return, and While.
|
inlinenoexcept |
Returns a stable debug name for a symbol kind.
Definition at line 65 of file Compiler_Symbol_Bindings.H.
References Function, Global, Local, Parameter, and Type.
Referenced by Aleph::Compiler_Symbol_Bindings::dump_symbols().
|
inlinenoexcept |
Predicate: Is the kind a comment?
Returns whether kind denotes comment trivia.
| kind | Token kind. |
true if it is a comment (line or block). Definition at line 576 of file Compiler_Token.H.
References Block_Comment, and Line_Comment.
Referenced by TEST().
|
inlinenoexcept |
Predicate: Is the kind a reserved keyword?
Returns whether kind is one reserved keyword.
| kind | Token kind. |
true if it is a keyword. Definition at line 526 of file Compiler_Token.H.
References Kw_Break, Kw_Catch, Kw_Class, Kw_Const, Kw_Continue, Kw_Else, Kw_Enum, Kw_Export, Kw_False, Kw_Fn, Kw_For, Kw_If, Kw_Import, Kw_Let, Kw_Namespace, Kw_Return, Kw_Struct, Kw_Throw, Kw_True, Kw_Try, Kw_Type, Kw_Var, and Kw_While.
Referenced by TEST().
|
inlinenoexcept |
Predicate: Is the kind a literal (number, string, bool, etc.)?
Returns whether kind is one literal token.
| kind | Token kind. |
true if it is a literal. Definition at line 560 of file Compiler_Token.H.
References Char_Literal, Integer_Literal, Kw_False, Kw_True, and String_Literal.
Referenced by TEST().
|
inlinenoexcept |
Predicate: Is the kind an operator (arithmetic, logical, etc.)?
Returns whether kind participates in the operator surface syntax.
| kind | Token kind. |
true if it is a recognized operator. Definition at line 582 of file Compiler_Token.H.
References Amp, AndAnd, Arrow, Assign, Bang, Caret, EqEq, Greater, GreaterEq, Less, LessEq, Minus, MinusEq, MinusMinus, NotEq, OrOr, Percent, PercentEq, Pipe, Plus, PlusEq, PlusPlus, Slash, SlashEq, Star, StarEq, and Tilde.
Referenced by TEST().
|
inline |
Returns a human-readable name for a token kind.
Returns a stable debug name for one token kind.
Useful for error messages and debugging (e.g., "expected RParen, found Semicolon").
| kind | Token kind to format. |
Definition at line 323 of file Compiler_Token.H.
References Amp, AndAnd, Arrow, Assign, Bang, Block_Comment, Caret, Char_Literal, Colon, Comma, Dot, Double_Colon, End_Of_File, EqEq, Greater, GreaterEq, Identifier, Integer_Literal, Invalid, Kw_Break, Kw_Catch, Kw_Class, Kw_Const, Kw_Continue, Kw_Else, Kw_Enum, Kw_Export, Kw_False, Kw_Fn, Kw_For, Kw_If, Kw_Import, Kw_Let, Kw_Namespace, Kw_Return, Kw_Struct, Kw_Throw, Kw_True, Kw_Try, Kw_Type, Kw_Var, Kw_While, LBrace, LBracket, Less, LessEq, Line_Comment, LParen, Minus, MinusEq, MinusMinus, NotEq, OrOr, Percent, PercentEq, Pipe, Plus, PlusEq, PlusPlus, Question, RBrace, RBracket, RParen, Semicolon, Slash, SlashEq, Star, StarEq, String_Literal, and Tilde.
Referenced by Aleph::Compiler_Typed_Semantic_Analyzer::analyze_expr(), Aleph::Compiler_Ast_Detail::dump_expr(), and Aleph::Compiler_Token::to_string().
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
Returns a stable debug name for a type kind.
Definition at line 89 of file Compiler_Types.H.
References Builtin, Enum, Function, Struct, Tuple, and Type_Variable.
Referenced by Aleph::Compiler_Type_Context::dump_types().
|
inlinenoexcept |
Returns a stable debug name for one unification result kind.
Definition at line 158 of file tpl_constraints.H.
References Arity_Mismatch, Invalid_Type, Kind_Mismatch, Occurs_Check_Failed, Rigid_Variable, and Success.
Referenced by main().
|
inline |
Removes surrounding double quotes from one string-literal token.
Definition at line 113 of file Compiler_Parser_Utils.H.
References and, Aleph::Compiler_Token::kind, Aleph::Compiler_Token::lexeme, and String_Literal.
Referenced by Aleph::Compiler_Parser::parse_import_declaration(), and TEST().
|
inline |
Pad all rows of a matrix to the maximum row length.
Each row is extended with default-constructed T() until all rows have equal size.
| T | Cell type. |
| [in,out] | m | Matrix to normalize. |
Definition at line 907 of file ah-string-utils.H.
References Aleph::DynList< T >::append(), l, m, Aleph::DynList< T >::size(), and zip_it().
Referenced by TEST().
|
noexcept |
Return true if all underlying iterators are finished.
This can be used to detect length mismatches after traversing with has_curr().
Definition at line 183 of file ah-zip.H.
References and.
Referenced by Aleph::Compiler_Bytecode_VM::complete_current_frame(), example_structured_concurrency(), Aleph::Compiler_Bytecode_VM::execute_loop(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TYPED_TEST(), TYPED_TEST(), and TYPED_TEST().
| auto Aleph::compute_all_stats | ( | const Container & | data | ) | -> Stats<std::decay_t<decltype(*std::begin(data))>> |
Compute all statistics for a dataset.
| data | Input container |
Definition at line 769 of file stat_utils.H.
References compute_all_stats(), kurtosis(), min_max(), percentile(), skewness(), Aleph::Stats< T >::sum, and variance().
Referenced by compute_all_stats(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
See compute_cut_nodes(const GT & g, typename GT::Node * start).
Definition at line 1761 of file tpl_graph_utils.H.
References compute_cut_nodes(), and GraphCommon< GT, Node, Arc >::get_node().
| FlowStatistics< typename Net::Flow_Type > Aleph::compute_flow_statistics | ( | const Net & | net | ) |
Compute statistics about the current flow in a network.
| Net | Network type. |
| net | Network with flow values. |
| none |
Definition at line 1623 of file tpl_maxflow.H.
References Aleph::Net_Graph< NodeT, ArcT >::flow_value(), Aleph::Net_Graph< NodeT, ArcT >::is_single_source(), Aleph::Filter_Iterator< Container, It, Show_Item >::next_ne(), Aleph::FlowStatistics< Flow_Type >::num_empty_arcs, Aleph::FlowStatistics< Flow_Type >::num_partial_arcs, Aleph::FlowStatistics< Flow_Type >::num_saturated_arcs, Aleph::FlowStatistics< Flow_Type >::total_capacity, Aleph::FlowStatistics< Flow_Type >::total_flow, and Aleph::FlowStatistics< Flow_Type >::utilization.
Referenced by TEST(), TEST(), TEST(), and TYPED_TEST().
|
inline |
Definition at line 1122 of file tpl_binNodeUtils.H.
References Aleph::DynDlist< T >::append(), compute_nodes_in_level_helper(), LLINK, RLINK, and root().
Referenced by compute_nodes_in_level(), and compute_nodes_in_level_helper().
|
inlinestatic |
Compute optimal costs and tree structure using dynamic programming.
Fills the cost and tree matrices using the recurrence: cost[i,j] = min over k in [i,j] of (cost[i,k-1] + cost[k+1,j]) + sum(p[i..j])
Uses two key optimizations:
| [out] | cost | Matrix storing optimal costs for subproblems. |
| [in] | p | Array of access probabilities (0-indexed, size n). |
| [in] | n | Number of keys. |
| [out] | tree | Matrix storing optimal root indices for subproblems. |
Definition at line 86 of file opBinTree.H.
References COST, COST_OF, prefix(), r, ROOT_OF, and TREE.
Referenced by build_optimal_tree().
|
inline |
Compute a full SSFA trace (portal-by-portal states).
This is useful for didactic/animation rendering.
Definition at line 1290 of file tikzgeom_algorithms.H.
References and, Aleph::FunnelTraceStep::apex, Aleph::Array< T >::append(), Aleph::FunnelTraceStep::committed_path, Aleph::FunnelTraceStep::emitted_left, Aleph::FunnelTraceStep::emitted_right, Aleph::FunnelTraceStep::left_boundary, Aleph::FunnelTraceStep::portal_index, Aleph::FunnelTraceStep::portal_left, Aleph::FunnelTraceStep::portal_right, Aleph::FunnelTraceStep::right_boundary, Aleph::detail::shortest_path_portals(), Aleph::detail::spp_cross(), Aleph::FunnelTraceStep::tightened_left, and Aleph::FunnelTraceStep::tightened_right.
| void Aleph::compute_stats | ( | const Container & | data, |
| std::decay_t< decltype(*std::begin(data))> & | avg, | ||
| std::decay_t< decltype(*std::begin(data))> & | var, | ||
| std::decay_t< decltype(*std::begin(data))> & | med, | ||
| std::decay_t< decltype(*std::begin(data))> & | _min, | ||
| std::decay_t< decltype(*std::begin(data))> & | _max | ||
| ) |
Compute basic descriptive statistics for a container.
Non-destructive version that copies data before sorting.
| data | Input container |
| avg | Output: arithmetic mean |
| var | Output: sample variance |
| med | Output: median value |
| _min | Output: minimum value |
| _max | Output: maximum value |
Definition at line 899 of file stat_utils.H.
References Aleph::Array< T >::append(), compute_stats(), in_place_sort(), k, and m.
| void Aleph::compute_stats | ( | T * | data, |
| int | l, | ||
| int | r, | ||
| T & | avg, | ||
| T & | var, | ||
| T & | med, | ||
| T & | _min, | ||
| T & | _max | ||
| ) |
Compute basic descriptive statistics for an array range.
Calculates average, variance, median, minimum, and maximum for the elements in data[l..r].
| T | Numeric type supporting arithmetic operations |
| data | Array of values (will be sorted) |
| l | Left index (inclusive) |
| r | Right index (inclusive) |
| avg | Output: arithmetic mean |
| var | Output: sample variance |
| med | Output: median value |
| _min | Output: minimum value |
| _max | Output: maximum value |
Definition at line 847 of file stat_utils.H.
References compute_stats(), introsort(), k, l, m, and r.
Referenced by compute_stats(), compute_stats(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inlinestatic |
Recursively construct the optimal BST from the tree matrix.
| Node | Binary tree node type (must have NullPtr, LLINK, RLINK). |
| Key | Key type stored in nodes. |
| [in] | keys | Array of keys (0-indexed). |
| [in] | tree | Matrix of optimal root indices. |
| [in] | n | Total number of keys. |
| [in] | i | Start index of current subproblem. |
| [in] | j | End index of current subproblem. |
Definition at line 155 of file opBinTree.H.
|
inline |
Concatenate multiple arguments into a single std::string.
When all arguments are string-like (std::string, std::string_view, const char *, char), the result is pre-sized with a single heap allocation, and pieces are appended directly — no locale overhead.
For mixed arguments (numeric, streamable types), each piece is converted individually via std::to_string (arithmetic) or a single-shot ostringstream (exotic types), then the total size is computed and the result is assembled in one allocation.
| Args | Types that are either string-like or streamable to std::ostream. |
| [in] | args | Values to concatenate. |
Definition at line 213 of file ah-string-utils.H.
References and, Aleph::concat_detail::append_to(), Aleph::concat_detail::piece_size(), and Aleph::concat_detail::stringify().
Referenced by demo_folding(), demo_joining(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Concatenate two containers into a new DynList.
| c1 | First container. |
| c2 | Second container. |
Definition at line 2403 of file ahFunctional.H.
References Aleph::DynList< T >::append().
|
delete |
A view of a temporary graph would dangle.
|
inline |
|
inline |
Check if container contains a specific value.
| container | Source container. |
| value | Value to search for. |
Definition at line 2742 of file ahFunctional.H.
References value.
|
inline |
Check if substr appears inside str.
| [in] | str | Haystack. |
| [in] | substr | Needle. |
true if substr is a substring of str. Definition at line 270 of file ah-string-utils.H.
Referenced by demo_predicates(), demo_validation(), Aleph::SweepLineSegmentIntersection::operator()(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), test_DynSet(), and test_DynSetLinHash().
|
inline |
Generate n contiguous values starting from start.
Creates a sequence of consecutive values: start, start+1, start+2, ..., start+n-1.
| T | Numeric type (must support increment operator). |
| Container | Container type (defaults to DynList). |
| start | Starting value. |
| n | Number of values to generate. |
Definition at line 382 of file ahFunctional.H.
Referenced by demo_ranges(), and TEST().
|
inline |
Copy elements from one range to another.
Copies elements from [sourceBeg, sourceEnd) to the range starting at destBeg.
| Itor1 | Source iterator type. |
| Itor2 | Destination iterator type. |
| sourceBeg | Iterator to the first source element. |
| sourceEnd | Iterator past the last source element. |
| destBeg | Iterator to the first destination position. |
Definition at line 584 of file ahAlgo.H.
Referenced by Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Johnson(), Aleph::DynList< T >::append(), Aleph::PersistentVector< T >::clear_rec(), Aleph::RTree< Payload, MaxEntries, MinEntries, Variant >::clone_node(), Aleph::Gen_B_Tree< Key, Compare, MinDegree >::clone_node(), Aleph::Gen_BPlus_Tree< Key, Compare, MinDegree >::clone_node(), Aleph::Euclidian_Graph< __Euclidian_Node, __Euclidian_Arc >::copy_from(), Moved_From_Case< F::ISTFTProcessor >::fingerprint(), Moved_From_Case< F::LFilter >::fingerprint(), Moved_From_Case< F::SOSFilter >::fingerprint(), Moved_From_Case< F::STFTProcessor >::fingerprint(), Aleph::interval_tree_detail::Pending_Max< T, false >::give(), Aleph::Gen_B_Tree< Key, Compare, MinDegree >::insert(), Aleph::Gen_BPlus_Tree< Key, Compare, MinDegree >::insert(), Aleph::Gen_File_B_Tree< Key, Compare, MinDegree, Codec >::insert(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::insert(), Aleph::Gen_BPlus_Tree< Key, Compare, MinDegree >::insert_nonfull(), main(), Aleph::Compute_Cut_Nodes< GT, SA >::map_subgraph(), merge(), merge(), adaptive_huffman_demo::next_code(), Aleph::ArrayQueue< T >::operator=(), Aleph::DynArray< T >::operator=(), Aleph::DynSetTree< Key, Tree, Compare >::operator=(), Aleph::Euclidian_Graph< __Euclidian_Node, __Euclidian_Arc >::operator=(), Aleph::MemArray< T >::operator=(), rotate_copy(), Aleph::interval_tree_detail::Pending_Max< T, false >::set(), Aleph::PersistentVector< T >::set_rec(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), test_copy_constructor(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), Cuckoo_Filter_Case< Filter >::use(), Quotient_Filter_Case< Filter >::use(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::write_info(), and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::write_info().
|
inline |
Copy elements backward from one range to another.
Copies elements from [sourceBeg, sourceEnd) to the range ending at destEnd, copying from back to front.
| Itor1 | Source iterator type. |
| Itor2 | Destination iterator type. |
| sourceBeg | Iterator to the first source element. |
| sourceEnd | Iterator past the last source element. |
| destEnd | Iterator past the last destination position. |
Definition at line 607 of file ahAlgo.H.
Referenced by TEST().
| auto Aleph::correlation | ( | const Container1 & | x, |
| const Container2 & | y | ||
| ) | -> std::decay_t<decltype(*std::begin(x))> |
Compute Pearson correlation coefficient.
Returns a value in [-1, 1]:
| Container1 | First container type |
| Container2 | Second container type |
| x | First dataset |
| y | Second dataset |
| std::invalid_argument | if containers have different sizes or constant values |
Definition at line 688 of file stat_utils.H.
References ah_invalid_argument_if, correlation(), covariance(), stddev(), and y.
Referenced by correlation(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Cosine of x (wrapper over mpfr).
Definition at line 191 of file point.H.
References cos().
Referenced by Aleph::Point::rotate(), Aleph::Ellipse::sample(), Aleph::RotatedEllipse::sample(), and TEST().
|
inline |
Count elements equal to a value.
Counts the number of elements in the range [beg, end) that are equal to the specified value.
| Itor | Iterator type. |
| T | Value type. |
| beg | Iterator to the first element. |
| end | Iterator past the last element. |
| value | Value to compare against. |
Definition at line 127 of file ahAlgo.H.
References bind2nd(), count_if(), and value.
Referenced by __depth_first_traversal(), Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::_count_active_vars(), Aleph::SmallVector< T, N >::append_range(), Aleph::Assign_Sum_Policy< T >::apply(), Aleph::Add_Sum_Policy< T >::apply(), HashAvalancheTest::bitDifference(), HashStats< HashTbl >::bucket_length(), Aleph::Bounded_Cycle_Index< GT >::build(), build_gray_code(), build_subgraph(), check(), Aleph::FunctionalMixin< Derived, Type >::chunk(), Aleph::OLhashTable< Key, Cmp >::cleanup_deleted_chain(), TimeoutQueue::clear_all(), Aleph::Unconnected_Components< GT, SA >::compute_blocks(), Aleph::Unconnected_Components< GT, SA >::compute_lists(), Aleph::DynArray< T >::const_traverse(), Aleph::detail::copy_file_contents(), count_active_trapezoids(), Aleph::Const_Graph_View< GT >::count_arcs(), Aleph::Net_Sup_Dem_Graph< NodeT, ArcT >::count_demand_nodes(), count_elements(), count_if(), Aleph::FunctionalMixin< Derived, Type >::count_if(), Aleph::Const_Graph_View< GT >::count_nodes(), RandomTreeTest::count_nodes(), Aleph::FFT< Real >::count_non_empty_real_batch(), Aleph::Network_Simplex< Net >::count_non_tree_partial_arcs(), Aleph::Compiler_Bytecode_Interpreter_Detail::count_parameters(), Aleph::Compiler_Backend_C_Detail::count_parameters(), count_ready(), Aleph::Gen_Polynomial< Coefficient >::count_real_roots(), Aleph::Net_Sup_Dem_Graph< NodeT, ArcT >::count_supply_nodes(), count_total_nodes(), Aleph::PersistentVector< T >::count_values_rec(), Aleph::sort_utils_detail::counting_sort_impl(), Aleph::sort_utils_detail::counting_sort_impl(), Aleph::sort_utils_detail::counting_sort_impl(), Aleph::sort_utils_detail::counting_sort_impl(), counting_sort_indices(), csv_count_empty(), csv_count_if(), demo_log_buffer(), demo_permutations(), demo_practical(), demo_statistics(), demo_structured_data(), demo_survey_design(), demo_text_processor(), Aleph::in_arcs_detail::digraph_in_degree(), Aleph::Gen_File_B_Tree< Key, Compare, MinDegree, Codec >::dirty_page_count(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::dirty_page_count(), Aleph::FFT< Real >::drop_prefix(), Aleph::TestVisual::emit_case_svg(), Aleph::Adaptive_Huffman_Encoder::encode(), Aleph::subset_sum_detail::enumerate_sums(), Aleph::CA::Hashlife_Engine::evolve_level_2(), example_channels_and_shared_state(), example_variadic_zip(), Graph_Traverse< GT, Itor, Q, Show_Arc >::exec(), Aleph::NTT< MOD, ROOT >::Plan::for_each_index(), graph_harness::for_each_simple_graph(), graph_harness::for_each_spec(), QueueTheadsPool< T >::ConsumerQueueEvent::get_count(), Aleph::Tarjan_Connected_Components< GT, Itor, SA >::has_cycle(), in_degree(), in_degree(), inconnected_components(), QueueTheadsPool< T >::ConsumerQueueEvent::increment_count(), Aleph::Compiler_Backend_C_Detail::indent(), Aleph::Segment::intersection_with(), is_multimodal(), is_simple_graph(), Aleph::detail::PersistentTreapNodeOps< Node, Key, Compare >::is_valid_under(), least_nanoseconds(), Aleph::FunctionalMixin< Derived, Type >::length(), LLVMFuzzerTestOneInput(), main(), main(), Aleph::Compiler_Dataflow_Detail::make_bit_set(), Aleph::Compiler_Dataflow_Detail::make_constant_vector(), Aleph::NTT< MOD, ROOT >::make_product_tree_storage(), Aleph::CA::ca_checkpoint_detail::make_tmp_path(), max_flow_min_cost_by_cycle_canceling(), Aleph::CA::Bench::measure(), Aleph::Stoer_Wagner_Min_Cut< GT, Distance, SA >::minimum_cut_phase(), mode(), Aleph::DynArray< T >::mutable_traverse(), Aleph::FFT< Real >::ISTFTProcessor::normalize_prefix(), Graph_Traverse< GT, Itor, Q, Show_Arc >::operator()(), operator<<(), out_degree(), Aleph::Prim_Min_Spanning_Tree< GT, Distance, SA >::paint_min_spanning_tree(), path_edge_count(), perm_count(), Aleph::FFT< Real >::pole_zero_pairs_impl(), Aleph::FixedStack< T >::popn(), DlinkListOperationsTest::populateList(), pzip_count_if_n(), Aleph::sort_utils_detail::radix_sort_impl(), Aleph::sort_utils_detail::radix_sort_impl(), Aleph::detail::ranges_count_if(), Aleph::Compiler_Bytecode_Interpreter_Detail::reset_values(), Aleph::Compiler_Dataflow_Bit_Set::resize(), Aleph::HTList::reverse(), sample_tree(), Aleph::Tarjan_Connected_Components< GT, Itor, SA >::scc_by_len(), Aleph::ODhashTable< Key, Cmp >::search(), search(), search_n(), sequential_groups(), Aleph::StlZipView< Containers >::size(), Aleph::UniZipView< Containers >::size(), Aleph::HTList::size(), adaptive_huffman_demo::snapshot(), Aleph::HTList::split_list(), Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::split_pos(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::split_pos(), Aleph::GenTdRbTreeRk< NodeType, Key, Compare >::split_pos(), Aleph::GenTdRbTreeRk< NodeType, Key, Compare >::split_pos_inorder(), Aleph::ODhashTable< Key, Cmp >::stats(), Aleph::OLhashTable< Key, Cmp >::stats(), stl_count(), stl_count_value(), stl_drop(), stl_take(), stl_take_last(), stl_zip_count(), stl_zip_length(), stl_zip_take(), subset_sum_count(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), test_hash_table(), Aleph::FFT< Real >::transform_stft_frames(), Aleph::Graph_Traverse_Generator< GT, Itor, Q, Show_Arc >::traverse(), Aleph::Gen_Link_Cut_Tree< T, Monoid, LazyTag >::tree_size(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), Aleph::OLhashTable< Key, Cmp >::undo_allocate_bucket(), uni_count(), uni_drop(), uni_length(), uni_take(), uni_zip_count(), uni_zip_length(), uni_zip_take(), unique_sequential(), Aleph::Count_Min_Sketch< T, CounterT >::update(), Moved_From_Case< DynArrayHeap< int > >::use(), Moved_From_Case< DynSkipList< int > >::use(), Moved_From_Case< Random_Set< int > >::use(), Aleph::FFT< Real >::LFilterBank::validate_channel_count(), Aleph::FFT< Real >::SOSFilterBank::validate_channel_count(), Aleph::FFT< Real >::OverlapAddBank::validate_channel_count(), verify(), Aleph::PersistentHashMap< Key, T, Cmp >::verify(), Aleph::PersistentTreapSet< Key, Compare >::verify(), Aleph::PersistentTreapMap< Key, T, Compare >::verify(), Aleph::RTree< Payload, MaxEntries, MinEntries, Variant >::verify(), Aleph::PersistentVector< T >::verify(), Aleph::RTree< Payload, MaxEntries, MinEntries, Variant >::verify_rec(), Aleph::detail::PersistentTreapNodeOps< Node, Key, Compare >::verify_rec(), Aleph::PersistentHashMap< Key, T, Cmp >::verify_rec(), write_avl(), write_bin(), Aleph::CA::Reproductions::write_histogram_csv(), write_rb(), write_splay(), write_treap(), zip_count(), zip_length(), and zip_take().
|
inline |
Count elements satisfying a predicate.
| container | Source container. |
| pred | Predicate to test. |
Definition at line 2624 of file ahFunctional.H.
|
inline |
Count elements satisfying a predicate.
Counts the number of elements in the range [beg, end) for which the predicate op returns true.
| Itor | Iterator type. |
| Operation | Predicate type. |
| beg | Iterator to the first element. |
| end | Iterator past the last element. |
| op | Unary predicate to test elements. |
Definition at line 100 of file ahAlgo.H.
Referenced by count(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TYPED_TEST_P().
Count how many futures are ready.
Non-blocking count of futures that have completed.
| T | The result type of the futures. |
| [in,out] | future_list | List of futures to check. |
Definition at line 194 of file future_utils.H.
References count().
Stable counting sort for integral Array values.
Sorts in ascending order by counting frequencies of each distinct integer value in the observed key range [min(a), max(a)].
| T | Value type. |
| [in,out] | a | The Array to sort. |
| std::domain_error | if max(a) < min(a). |
| std::runtime_error | if the key range is too large to fit in size_t. |
k = max(a) - min(a) + 1. Delegate to the shared count-then-place implementation.
Definition at line 5835 of file tpl_sort_utils.H.
References Aleph::sort_utils_detail::counting_sort_impl().
Stable counting sort for integral DynArray values.
How Counting Sort Works: Instead of comparing elements against each other (like QuickSort or MergeSort), Counting Sort works by counting the exact occurrences of each distinct value. The core idea is:
This algorithm is extremely fast (linear time) when the difference between the maximum and minimum values (the range k) is not excessively large.
| T | Value type. |
| [in,out] | a | The DynArray to sort. |
| std::domain_error | if max(a) < min(a). |
| std::runtime_error | if the key range is too large to fit in size_t. |
k = max(a) - min(a) + 1. Delegate to the shared count-then-place implementation.
Definition at line 5812 of file tpl_sort_utils.H.
References Aleph::sort_utils_detail::counting_sort_impl().
Referenced by counting_sort().
Stable counting sort for integral DynDlist values.
This overload performs an in-place value-replacement pass directly into existing list nodes. It preserves stability for plain integral types or when simple value equality semantics suffice. However, user-defined types wrapping keys may not observe true stability (preservation of original object identity and memory locations) because list nodes are not rearranged; only their data is updated.
| T | Value type (must satisfy CountingSortable). |
| [in,out] | list | The DynDlist to sort. |
| std::domain_error | if max(list) < min(list). |
| std::runtime_error | if the key range is too large to fit in size_t. |
Delegate to the shared count-then-place implementation.
Definition at line 5889 of file tpl_sort_utils.H.
References Aleph::sort_utils_detail::counting_sort_impl().
Stable counting sort for integral DynList values.
This overload performs an in-place value-replacement pass directly into existing list nodes. It preserves stability for plain integral types or when simple value equality semantics suffice. However, user-defined types wrapping keys may not observe true stability (preservation of original object identity and memory locations) because list nodes are not rearranged; only their data is updated.
| T | Value type (must satisfy CountingSortable). |
| [in,out] | list | The DynList to sort. |
| std::domain_error | if max(list) < min(list). |
| std::runtime_error | if the key range is too large to fit in size_t. |
Delegate to the shared count-then-place implementation.
Definition at line 5862 of file tpl_sort_utils.H.
References Aleph::sort_utils_detail::counting_sort_impl().
| void Aleph::counting_sort | ( | T * | a, |
| const size_t | n | ||
| ) |
Stable counting sort for raw integral arrays.
| T | Value type. |
| [in,out] | a | Pointer to the first element. |
| [in] | n | Number of elements. |
| std::domain_error | if max(a) < min(a). |
| std::runtime_error | if the key range is too large to fit in size_t. |
| std::invalid_argument | if a is null and n > 0. |
k = max(a) - min(a) + 1. Delegate to the shared count-then-place implementation.
Definition at line 5911 of file tpl_sort_utils.H.
References ah_invalid_argument_if, and, and Aleph::sort_utils_detail::counting_sort_impl().
Stable counting sort for fixed-size integral C arrays.
| T | Value type. |
| N | Array size. |
| [in,out] | a | The fixed-size array to sort. |
| std::domain_error | if max(a) < min(a). |
| std::runtime_error | if the key range is too large to fit in size_t. |
Definition at line 5930 of file tpl_sort_utils.H.
References counting_sort().
| and std::convertible_to< std::invoke_result_t< const KeyFn &, size_t >, int > void Aleph::counting_sort_indices | ( | Array< size_t > & | sa, |
| Array< size_t > & | tmp, | ||
| const size_t | n, | ||
| const int | min_key, | ||
| const int | max_key, | ||
| const KeyFn & | key_of | ||
| ) |
Stable counting sort on an index array by integer keys.
Reorders sa[0..n-1] so that the elements appear sorted by key_of(sa[i]). Keys must lie in [min_key, max_key].
| KeyFn | Callable (size_t) -> int returning the sort key. |
| [in,out] | sa | Index array to reorder. |
| [out] | tmp | Scratch array (same size as sa). |
| [in] | n | Number of elements to sort. |
| [in] | min_key | Minimum key value (inclusive). |
| [in] | max_key | Maximum key value (inclusive). |
| [in] | key_of | Maps sa[i] to its integer sort key. |
| std::domain_error | if max_key < min_key. |
| std::out_of_range | if sa.size() < n or tmp.size() < n. |
| std::runtime_error | if the key range is too large to fit in size_t. |
| std::out_of_range | if a computed key is outside [min_key, max_key]. |
sa.size() >= n, tmp.size() >= n. i < n: min_key <= key_of(sa[i]) <= max_key. sa is stably sorted by key_of.k = max_key - min_key + 1. Largest range representable without overflowing a size_t index count.
Definition at line 5248 of file tpl_sort_utils.H.
References ah_domain_error_if, ah_out_of_range_error_if, ah_runtime_error_unless, count(), Aleph::Array< T >::create(), k, and Aleph::Array< T >::size().
Referenced by suffix_array().
| auto Aleph::covariance | ( | const Container1 & | x, |
| const Container2 & | y, | ||
| bool | population = false |
||
| ) | -> std::decay_t<decltype(*std::begin(x))> |
Compute covariance between two datasets.
| Container1 | First container type |
| Container2 | Second container type |
| x | First dataset |
| y | Second dataset |
| population | If true, population covariance; if false (default), sample covariance |
| std::invalid_argument | if containers have different sizes or fewer than 2 elements |
Definition at line 630 of file stat_utils.H.
References ah_invalid_argument_if, and, covariance(), and y.
Referenced by correlation(), covariance(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Create residual arcs for a in the residual network.
Definition at line 2152 of file tpl_net.H.
References and, GraphCommon< GT, Node, Arc >::get_src_node(), GraphCommon< GT, Node, Arc >::get_tgt_node(), and NODE_COOKIE.
Referenced by build_residual_net(), and preflow_create_residual_net().
| Res_Net::Arc * Aleph::create_residual_arc | ( | Res_Net & | residual_net, |
| typename Res_Net::Node * | src, | ||
| typename Res_Net::Node * | tgt, | ||
| const typename Res_Net::Flow_Type | cap, | ||
| const typename Res_Net::Flow_Type | flow, | ||
| const typename Res_Net::Flow_Type | cost | ||
| ) |
Create a pair of residual arcs in the residual network.
For each arc in the original network, creates two arcs in the residual network: a forward arc with the same cost and a backward (residual) arc with negative cost.
| Res_Net | Residual network type. |
| [in,out] | residual_net | The residual network to insert arcs into. |
| [in] | src | Source node in residual network. |
| [in] | tgt | Target node in residual network. |
| [in] | cap | Capacity of the arc. |
| [in] | flow | Current flow on the arc. |
| [in] | cost | Cost per unit of flow. |
Definition at line 583 of file tpl_netcost.H.
References and.
Chinese Remainder Theorem (CRT).
Finds a number x such that x = rem[i] (mod mod[i]) for all i. Assumes all moduli are pairwise coprime.
| std::invalid_argument | if input arrays have different sizes. |
| std::overflow_error | if the product of moduli overflows uint64_t. |
Definition at line 478 of file modular_arithmetic.H.
References ah_invalid_argument_if, ah_overflow_error_if, mod_inv(), mod_mul(), and Aleph::Array< T >::size().
Referenced by demo_modular_arithmetic(), and TEST().
|
inline |
Add a new column with computed values.
| Func | Function type (takes row, returns string). |
| rows | The CSV data. |
| func | Function to compute new column value. |
Definition at line 1516 of file parse-csv.H.
References Aleph::Array< T >::append(), csv_add_column(), and rows.
Referenced by csv_add_column(), and TEST_F().
Count empty fields in CSV data.
Definition at line 1028 of file parse-csv.H.
References count(), csv_count_empty(), and rows.
Referenced by csv_count_empty(), and TEST_F().
|
inline |
Count rows matching a predicate.
Definition at line 1042 of file parse-csv.H.
References count(), csv_count_if(), and rows.
Referenced by csv_count_if(), and TEST_F().
Count total number of rows.
Definition at line 1020 of file parse-csv.H.
References csv_count_rows(), and rows.
Referenced by csv_count_rows(), and TEST_F().
|
inline |
Get distinct values in a column.
Definition at line 1083 of file parse-csv.H.
References Aleph::Array< T >::append(), csv_distinct(), rows, Aleph::Array< T >::size(), and size().
Referenced by csv_distinct(), csv_group_by(), and TEST_F().
|
inline |
Escape a string for CSV output.
If the input string contains the delimiter, double quotes, or newlines, the string is enclosed in double quotes and internal quotes are escaped by doubling them.
| field | The string to escape. |
| delimiter | The field delimiter character (default: comma). |
Definition at line 321 of file parse-csv.H.
References csv_escape().
Referenced by csv_escape(), csv_write_row(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Replace empty fields with a default value.
| rows | The CSV data. |
| default_value | Value to use for empty fields. |
Definition at line 1352 of file parse-csv.H.
References csv_fill_empty(), csv_transform(), and rows.
Referenced by csv_fill_empty(), and TEST_F().
|
inline |
Filter CSV rows by a predicate.
Returns only rows for which the predicate returns true.
| Pred | Predicate type (callable taking const Array<std::string>&). |
| rows | The CSV data. |
| predicate | Function returning true for rows to keep. |
Definition at line 906 of file parse-csv.H.
References Aleph::Array< T >::append(), csv_filter(), and rows.
Referenced by csv_filter(), csv_filter_by_value(), main(), and TEST_F().
|
inline |
Filter CSV rows by column value.
Returns rows where the specified column equals the given value.
| rows | The CSV data. |
| col_index | Column index to check. |
| value | Value to match. |
Definition at line 927 of file parse-csv.H.
References and, csv_filter(), csv_filter_by_value(), row, rows, and value.
Referenced by csv_filter_by_value(), and TEST_F().
|
inline |
Find row where column equals value.
Definition at line 1070 of file parse-csv.H.
References and, csv_find_by_value(), csv_find_row(), row, rows, and value.
Referenced by csv_find_by_value(), TEST_F(), and TEST_F().
|
inline |
Find first row matching a predicate.
Definition at line 1057 of file parse-csv.H.
References csv_find_row(), and rows.
Referenced by csv_find_by_value(), csv_find_row(), and TEST_F().
|
inline |
Get a column from CSV data.
Extracts all values from a specific column across all rows.
| rows | An Array of row Arrays. |
| col_index | The column index (0-based). |
| std::out_of_range | If col_index is out of bounds for any row. |
Definition at line 498 of file parse-csv.H.
References Aleph::Array< T >::append(), csv_get_column(), rows, and size().
Referenced by csv_get_column(), TEST(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Group rows by a column value.
| rows | The CSV data. |
| col_index | Column to group by. |
Definition at line 1477 of file parse-csv.H.
References and, Aleph::Array< T >::append(), csv_distinct(), csv_group_by(), k, keys, rows, and size().
Referenced by csv_group_by(), and TEST_F().
|
inline |
Inner join two CSV datasets by a key column.
| left | First dataset. |
| left_key_col | Key column index in left dataset. |
| right | Second dataset. |
| right_key_col | Key column index in right dataset. |
Definition at line 1432 of file parse-csv.H.
References Aleph::Array< T >::append(), csv_inner_join(), k, and size().
Referenced by csv_inner_join(), and TEST_F().
Check if all rows have the same number of columns.
Validates that a CSV dataset is rectangular (all rows have the same number of columns).
| rows | An Array of row Arrays. |
Definition at line 467 of file parse-csv.H.
References csv_is_rectangular(), rows, and size().
Referenced by csv_is_rectangular(), csv_transpose(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Join two CSV datasets horizontally (add columns).
| left | First dataset. |
| right | Second dataset. |
Definition at line 1372 of file parse-csv.H.
References Aleph::Array< T >::append(), csv_join_horizontal(), and Aleph::Array< T >::size().
Referenced by csv_join_horizontal(), and TEST_F().
|
inline |
Join two CSV datasets vertically (add rows).
| top | First dataset. |
| bottom | Second dataset. |
Definition at line 1407 of file parse-csv.H.
References Aleph::Array< T >::append(), and csv_join_vertical().
Referenced by csv_join_vertical(), and TEST_F().
|
inline |
Get the number of columns in a CSV row.
Returns the number of fields in the given row.
| row | A CSV row. |
Definition at line 445 of file parse-csv.H.
References csv_num_columns(), and row.
Referenced by csv_num_columns(), TEST(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Read all rows from a CSV input stream.
Reads all remaining rows from the input stream and returns them as an array of arrays.
| in | The input stream to read from. |
| delimiter | The field delimiter character (default: comma). |
Definition at line 254 of file parse-csv.H.
References and, Aleph::Array< T >::append(), csv_read_all(), csv_read_row(), and row.
Referenced by csv_read_all(), csv_read_file(), main(), CsvFilterTest::SetUp(), CsvStatisticsTest::SetUp(), CsvTransformationTest::SetUp(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Read all rows from a CSV file.
Opens the specified file and reads all CSV rows from it.
| filename | Path to the CSV file. |
| delimiter | The field delimiter character (default: comma). |
| std::runtime_error | If the file cannot be opened. |
Definition at line 291 of file parse-csv.H.
References csv_read_all(), csv_read_file(), and file.
Referenced by csv_read_file(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Read a single CSV row from a string.
Convenience overload that parses a CSV row from a string instead of a stream.
| line | The string containing the CSV row. |
| delimiter | The field delimiter character. |
Definition at line 225 of file parse-csv.H.
References csv_read_row().
|
inline |
Read a single CSV row from an input stream.
Parses one row of CSV data from the given input stream. The function handles:
| in | The input stream to read from. |
| delimiter | The field delimiter character (default: comma). |
Example: reading two CSV rows from a stream.
Definition at line 159 of file parse-csv.H.
References and, Aleph::Array< T >::append(), csv_read_row(), and row.
Referenced by csv_read_all(), csv_read_row(), csv_read_row(), LLVMFuzzerTestOneInput(), Aleph::CsvReader::next(), Aleph::CsvReader::next_row(), Aleph::CsvReader::read_header(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Rename a column (in the header row).
| rows | The CSV data (first row is header). |
| old_name | Current column name. |
| new_name | New column name. |
Definition at line 1543 of file parse-csv.H.
References Aleph::Array< T >::append(), csv_rename_column(), and rows.
Referenced by csv_rename_column(), and TEST_F().
|
inline |
Select specific columns from CSV data.
| rows | The CSV data. |
| col_indices | Indices of columns to select. |
Definition at line 953 of file parse-csv.H.
References Aleph::Array< T >::append(), csv_select_columns(), rows, Aleph::Array< T >::size(), and size().
Referenced by csv_select_columns(), and TEST_F().
|
inline |
Skip UTF-8 BOM if present.
Checks for and skips the UTF-8 Byte Order Mark (EF BB BF) at the beginning of a stream. A stream that does not start with it keeps all its bytes, however short it is.
| in | The input stream. |
Definition at line 1298 of file parse-csv.H.
References and, and csv_skip_bom().
Referenced by csv_skip_bom(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Skip the first N rows of CSV data.
| rows | The CSV data. |
| n | Number of rows to skip. |
Definition at line 984 of file parse-csv.H.
References Aleph::Array< T >::append(), csv_skip_rows(), and rows.
Referenced by csv_skip_rows(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Sort CSV data by a column.
| rows | The CSV data. |
| col_index | Column to sort by. |
| ascending | Sort in ascending order (default true). |
Definition at line 1147 of file parse-csv.H.
References Aleph::Array< T >::append(), csv_sort_by_column(), rows, and Aleph::Array< T >::size().
Referenced by csv_sort_by_column(), and TEST_F().
|
inline |
Sort CSV data by a column with numeric comparison.
| T | Numeric type for comparison. |
| rows | The CSV data. |
| col_index | Column to sort by. |
| ascending | Sort in ascending order (default true). |
Definition at line 1190 of file parse-csv.H.
References Aleph::Array< T >::append(), csv_sort_by_column_numeric(), rows, and Aleph::Array< T >::size().
Referenced by csv_sort_by_column_numeric().
|
inline |
Take only the first N rows of CSV data.
| rows | The CSV data. |
| n | Number of rows to take. |
Definition at line 1002 of file parse-csv.H.
References Aleph::Array< T >::append(), csv_take_rows(), and rows.
Referenced by csv_take_rows(), and TEST_F().
Convert a CSV field to a numeric type.
Parses a string field as a numeric value.
| T | The numeric type (int, long, double, etc.). |
| field | The string to convert. |
| std::invalid_argument | If the string cannot be parsed. |
| std::out_of_range | If the value is out of range for the type. |
Definition at line 535 of file parse-csv.H.
References csv_to_number(), and value.
Referenced by csv_to_number().
|
inline |
Definition at line 563 of file parse-csv.H.
|
inline |
Definition at line 570 of file parse-csv.H.
Referenced by TEST_F().
|
inline |
|
inline |
Definition at line 556 of file parse-csv.H.
Referenced by TEST_F().
|
inline |
Apply a transformation to each field.
| Func | Transformation function type. |
| rows | The CSV data. |
| func | Function taking string and returning string. |
Definition at line 1266 of file parse-csv.H.
References Aleph::Array< T >::append(), csv_transform(), and rows.
Referenced by csv_fill_empty(), csv_transform(), csv_trim_fields(), and TEST_F().
|
inline |
Transpose CSV data (swap rows and columns).
| rows | The CSV data (must be rectangular). |
| std::runtime_error | If data is not rectangular. |
Definition at line 1114 of file parse-csv.H.
References Aleph::Array< T >::append(), csv_is_rectangular(), csv_transpose(), rows, and Aleph::Array< T >::size().
Referenced by csv_transpose(), and TEST_F().
|
inline |
Trim whitespace from all fields.
| rows | The CSV data. |
Definition at line 1326 of file parse-csv.H.
References and, csv_transform(), csv_trim_fields(), rows, and trim().
Referenced by csv_trim_fields(), and TEST_F().
|
inline |
Remove duplicate rows.
| rows | The CSV data. |
Definition at line 1230 of file parse-csv.H.
References Aleph::Array< T >::append(), csv_unique(), equal(), k, rows, Aleph::Array< T >::size(), and size().
Referenced by csv_unique(), and TEST_F().
|
inline |
Write multiple CSV rows to an output stream.
Writes all given rows to the output stream.
| out | The output stream to write to. |
| rows | An Array of row Arrays. |
| delimiter | The field delimiter character (default: comma). |
| line_ending | The line ending string (default: "\n"). |
Definition at line 403 of file parse-csv.H.
References csv_write_all(), csv_write_row(), out, and rows.
Referenced by csv_write_all(), csv_write_file(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Write CSV data to a file.
Opens the specified file and writes all rows to it.
| filename | Path to the output file. |
| rows | An Array of row Arrays. |
| delimiter | The field delimiter character (default: comma). |
| line_ending | The line ending string (default: "\n"). |
| std::runtime_error | If the file cannot be opened. |
Definition at line 425 of file parse-csv.H.
References csv_write_all(), csv_write_file(), file, and rows.
Referenced by csv_write_file(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Write a CSV row to an output stream.
Writes a row of fields to the output stream, properly escaping fields that need quoting.
| out | The output stream to write to. |
| row | An Array of strings representing the fields. |
| delimiter | The field delimiter character (default: comma). |
| line_ending | The line ending string (default: "\n"). |
Definition at line 377 of file parse-csv.H.
References csv_escape(), csv_write_row(), out, and row.
Referenced by csv_write_all(), csv_write_row(), LLVMFuzzerTestOneInput(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Damerau-Levenshtein distance with adjacent transpositions.
This implementation follows the "full" dynamic-programming model using last-seen positions and supports multiple transpositions.
| [in] | a | First string. |
| [in] | b | Second string. |
| None. |
Definition at line 167 of file String_DP.H.
References j1(), m, Aleph::string_dp_detail::make_zero_matrix(), and OhashCommon< HashTbl, Key >::size().
| const std::pair< Key, Data > * Aleph::data_to_pair | ( | const Data * | ptr | ) |
| std::pair< Key, Data > * Aleph::data_to_pair | ( | Data * | ptr | ) |
|
noexcept |
Alias for deallocate (backward compatibility).
Definition at line 501 of file ah-arena.H.
Referenced by TEST().
|
noexcept |
Destruct and deallocate an object from an arena.
Calls the destructor and attempts to reclaim memory (LIFO pattern only).
| T | Type of object. |
| [in] | arena | Arena that owns the object. |
| [in] | ptr | Pointer to object. |
Definition at line 494 of file ah-arena.H.
References Aleph::AhArenaAllocator::TEMPLATE.
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), and TEST_F().
|
inlinenoexcept |
Release memory previously obtained through Aleph allocation helpers.
| ptr | Pointer obtained from allocate or allocate_zeroed. Passing nullptr is a no-op (mirrors std::free semantics). |
| FlowDecomposition< Net > Aleph::decompose_flow | ( | const Net & | net | ) |
Decompose network flow into paths and cycles.
Given a network with a feasible flow, this function decomposes the flow into a set of source-to-sink paths (and possibly cycles). Each unit of the flow is assigned to exactly one path.
| Net | Network type. |
| net | Network with a feasible flow. Creates a working copy of flow values for decomposition; the original network flow values remain unchanged. |
| domain_error | If network is not single source/sink, or if the flow is not conserved at a node between the source and the sink beyond the tolerance of check_node(): a node that receives more than it sends. What a floating flow keeps within that tolerance is a residue of rounding and is left out of the paths. |
Definition at line 902 of file tpl_maxflow.H.
References ah_domain_error_if, and, Aleph::DynList< T >::append(), Aleph::FlowPath< Net >::arcs, Aleph::FlowCycle< Net >::arcs, Aleph::DynMapTree< Key, Data, Tree, Compare >::contains(), Aleph::FlowDecomposition< Net >::cycles, Aleph::FlowPath< Net >::flow, Aleph::FlowCycle< Net >::flow, Aleph::Net_Graph< NodeT, ArcT >::get_in_flow(), LocateFunctions< Container, Type >::get_it(), Aleph::DynList< T >::get_last(), Aleph::Net_Graph< NodeT, ArcT >::get_out_flow(), Aleph::Net_Graph< NodeT, ArcT >::get_sink(), Aleph::Net_Graph< NodeT, ArcT >::get_source(), GraphCommon< GT, Node, Arc >::get_src_node(), GraphCommon< GT, Node, Arc >::get_tgt_node(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::has_curr(), Aleph::Net_Graph< NodeT, ArcT >::is_single_sink(), Aleph::Net_Graph< NodeT, ArcT >::is_single_source(), Aleph::Filter_Iterator< Container, It, Show_Item >::next_ne(), Aleph::Net_Graph< NodeT, ArcT >::node_tolerance(), Aleph::FlowPath< Net >::nodes, Aleph::FlowCycle< Net >::nodes, out, Aleph::FlowDecomposition< Net >::paths, remaining_flow(), and Aleph::DynList< T >::size().
Referenced by demonstrate_flow_decomposition(), Aleph::Decompose_Flow< Net >::operator()(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TYPED_TEST(), and TYPED_TEST().
| void Aleph::decrease_flow | ( | Net & | net, |
| const DynList< Parc< Net > > & | semi_path, | ||
| const typename Net::Flow_Type | slack | ||
| ) |
Decrease flow along a semi-path by a given slack.
This reverses the effect of increase_flow by negating forward/residual arc directions. With a floating type of flow, a flow that rounding leaves next to the capacity of its arc, or next to zero, is set to it.
| [in,out] | net | Flow network to update. |
| [in] | semi_path | Semi-path arc list. |
| [in] | slack | Slack to apply (not validated). |
Definition at line 1796 of file tpl_net.H.
References Aleph::net_detail::add_flow(), and Aleph::net_detail::subtract_flow().
Referenced by TYPED_TEST().
|
inline |
Return the default shared thread pool instance.
Global default thread pool.
A lazily-initialized global thread pool for convenience. Uses hardware concurrency for the number of threads.
Definition at line 2524 of file thread_pool.H.
References default_pool().
Referenced by Aleph::TaskGroup::TaskGroup(), default_pool(), main(), parallel_default_pool(), Aleph::parallel_detail::select_pool(), Aleph::parallel_detail::selected_parallel_pool(), Aleph::CA::Parallel_Synchronous_Engine< Lattice, Rule, Neighborhood, Order >::step(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
|
inline |
See depth_first_traversal(const GT&, typename GT::Node*, bool (*)(...)).
Definition at line 129 of file tpl_graph_utils.H.
References depth_first_traversal(), and Aleph::List_Graph< _Graph_Node, _Graph_Arc >::get_first_node().
Convert a std::deque to an Array.
Creates a new Array containing copies of all elements from the given std::deque.
| T | The element type. |
| d | The source std::deque. |
Definition at line 366 of file ah-convert.H.
References Aleph::Array< T >::append(), and Aleph::Array< T >::reserve().
Convert a std::deque to a DynArray.
Creates a new DynArray containing copies of all elements from the given std::deque.
| T | The element type. |
| d | The source std::deque. |
Definition at line 387 of file ah-convert.H.
References Aleph::DynArray< T >::append().
Convert a std::deque to a DynList.
Creates a new DynList containing copies of all elements from the given std::deque.
| T | The element type. |
| d | The source std::deque. |
Definition at line 346 of file ah-convert.H.
References Aleph::DynList< T >::append().
|
inline |
Design survey assignment using network flow.
Assign respondents to questions such that:
The minimums are the lower bounds of a circulation, which solve_circulation() finds. There is none if a minimum is negative or above its maximum.
| questions | Vector of questions with constraints. |
| respondents | Vector of respondents with constraints and eligibility. |
Definition at line 890 of file net_apps.H.
References Aleph::SurveyDesignResult::assignments, Aleph::SurveyDesignResult::feasible, Aleph::DynMapTree< Key, Data, Tree, Compare >::insert(), Aleph::Net_Graph< NodeT, ArcT >::insert_arc(), Aleph::Net_Graph< NodeT, ArcT >::insert_node(), r, Aleph::DynMapTree< Key, Data, Tree, Compare >::search(), and solve_circulation().
Referenced by demo_survey_design(), TEST(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inlinestatic |
Internal helper: DFS discovery time stored in NODE_COUNTER(p).
Definition at line 1590 of file tpl_graph_utils.H.
References NODE_COUNTER.
Referenced by __dfp_phase1(), graph_oracles::dominance_frontiers(), Aleph::Lengauer_Tarjan_Dominators< GT, SA >::dominance_frontiers(), kosaraju_connected_components(), kosaraju_connected_components(), main(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inlinenoexcept |
Definition at line 1042 of file hash-fct.H.
References wyhash_hash().
|
inlinenoexcept |
Definition at line 1071 of file hash-fct.H.
References seed, and wyhash_hash().
|
inlinenoexcept |
Primary default hash: best speed/quality trade-off.
Routes through Aleph_Hash<Key>:
wyhash_hash for trivially-copyable types and strings (64-bit, ~1045 MiB/s)SuperFastHash(&key, sizeof(key)) for pointer keysOLhashTable / ODhashTable / Map*Hash users that depend on stable probe sequences or on consistent hashing across wrapper call paths (dft_hash_fct, dft_hash_ptr_fct, pair_dft_hash_fct, etc.). If you touch this policy, rerun at least: hash_fct_test, hash_statistical_test, hash-it, tree_dp_test, tree_decomposition_test, and cuckoo-filter tests. Definition at line 1030 of file hash-fct.H.
Referenced by Aleph::Count_Min_Sketch< T, CounterT >::Count_Min_Sketch(), Aleph::MinHash< T >::MinHash(), aleph_hash_value(), UserTypeNS::aleph_hash_value(), dft_hash_ptr_fct(), dft_seed_hash_ptr_fct(), AhHashDispatcher< Key, Operation >::fst_hash(), fst_hast(), Aleph::Compact_Cuckoo_Filter< T, FingerprintBits, EntriesPerBucket >::get_fingerprint(), Aleph::Cuckoo_Filter< T, FingerprintBits, EntriesPerBucket >::get_fingerprint(), Aleph::Compact_Cuckoo_Filter< T, FingerprintBits, EntriesPerBucket >::index_hash(), Aleph::Cuckoo_Filter< T, FingerprintBits, EntriesPerBucket >::index_hash(), my_hash(), pair_dft_hash_fct(), pair_snd_hash_fct(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), and TEST_F().
|
inlinenoexcept |
Definition at line 1037 of file hash-fct.H.
References SuperFastHash().
|
inlinenoexcept |
Primary default hash with explicit seed.
Definition at line 1059 of file hash-fct.H.
References seed.
|
inlinenoexcept |
Definition at line 1066 of file hash-fct.H.
References seed, and SuperFastHash().
|
inlinenoexcept |
Definition at line 1047 of file hash-fct.H.
References wyhash_hash().
|
inlinenoexcept |
Definition at line 1076 of file hash-fct.H.
References seed, and wyhash_hash().
|
inlinenoexcept |
|
inlinenoexcept |
Definition at line 1088 of file hash-fct.H.
References dft_hash_fct(), and seed.
|
inline |
Check if two containers differ.
Complement of eq(). Returns true if containers have different lengths or any corresponding elements differ.
| C1 | Type of the first container. |
| C2 | Type of the second container. |
| Eq | Equality predicate type. |
| c1 | First container. |
| c2 | Second container. |
| e | Equality predicate. |
Definition at line 1364 of file ahFunctional.H.
References eq().
Referenced by Aleph::Test_Eulerian< GT, SN, SA >::analyze_digraph(), Aleph::CA::apply_delta_checkpoint(), HashAvalancheTest::bitDifference(), Aleph::k_shortest_paths_detail::build_suffix_index_digraph(), Aleph::k_shortest_paths_detail::build_suffix_index_with_itor(), Aleph::CA::cell_diff_count(), checked_avl_height(), checked_avl_height_rk(), demo_comparison(), demo_matrix_arithmetic(), demo_vector_arithmetic(), Aleph::LineEq::distance_to(), Aleph::CA::Block_Partition_2D::factor_partitions(), Aleph::patricia_trie_detail::Bitwise_Trie_Utils< UInt >::first_differing_bit(), kurtosis(), Aleph::Gen_Mo_On_Trees< GT, Policy >::lca(), Aleph::Gen_Mo_On_Tree_Node< T, Policy >::lca(), main(), Aleph::detail::pollard_rho_step(), Aleph::RTree< Payload, MaxEntries, MinEntries, Variant >::quadratic_split(), quicksort(), Aleph::Net_Graph< NodeT, ArcT >::same_totals(), skewness(), sparse_polynomials(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
Check if a node is blocked in Dinic's algorithm.
Retrieves a reference to the blocked flag stored in the node's cookie.
| Net | Network type. |
| p | Pointer to network node. |
| none |
Definition at line 159 of file tpl_maxflow.H.
References NODE_COOKIE.
| Net::Flow_Type Aleph::dinic_blocking_flow | ( | Net & | net, |
| typename Net::Node * | source, | ||
| typename Net::Node * | sink | ||
| ) |
Find all blocking flows using iterative DFS with current-arc optimization.
Uses an explicit stack and per-node current-arc indices to find all augmenting paths in the level graph without re-examining dead arcs. After each augmentation, retreats to the node before the bottleneck arc and continues scanning from its current-arc position.
| Net | Network type. |
| net | Flow network. |
| source | Source node. |
| sink | Sink node. |
Definition at line 296 of file tpl_maxflow.H.
References Aleph::net_detail::add_flow(), Aleph::Array< T >::create(), GraphCommon< GT, Node, Arc >::get_connected_node(), GraphCommon< GT, Node, Arc >::get_src_node(), next(), Aleph::net_detail::subtract_flow(), and GraphCommon< GT, Node, Arc >::vsize().
Referenced by dinic_maximum_flow().
Access the current arc index in Dinic's algorithm.
Retrieves a reference to the current_arc field stored in the node's cookie. Used for the current-arc optimization in the iterative blocking flow.
| Net | Network type. |
| p | Pointer to network node. |
Definition at line 178 of file tpl_maxflow.H.
References NODE_COOKIE.
Access the node level in Dinic's algorithm.
Retrieves a reference to the level field stored in the node's cookie.
| Net | Network type. |
| p | Pointer to network node. |
| none |
Definition at line 138 of file tpl_maxflow.H.
References NODE_COOKIE.
| Net::Flow_Type Aleph::dinic_maximum_flow | ( | Net & | net | ) |
Compute maximum flow using Dinic's algorithm.
Dinic's algorithm computes maximum flow by repeatedly:
This is more efficient than Ford-Fulkerson for dense graphs.
With a floating flow, the residues of rounding that the blocking flows leave go back at the end, as those of the augmenting paths (see net_detail::return_dust()): every node keeps its flow within the tolerance of check_node(), so that the network simplex takes the flow. An arc of infinite capacity takes flow as any other; a path from the source to the sink of arcs of infinite capacity makes the maximum flow infinite, and the function returns it, as the augmenting paths and the preflows do.
| Net | Network type (must be Net_Graph or compatible). |
| net | Flow network with source and sink. |
| domain_error | If network is not single source/sink. |
| std::bad_alloc | If memory allocation fails during algorithm execution. |
Definition at line 462 of file tpl_maxflow.H.
References ah_domain_error_if, and, build_level_graph(), dinic_blocking_flow(), Aleph::Net_Graph< NodeT, ArcT >::flow_value(), Aleph::Net_Graph< NodeT, ArcT >::get_sink(), Aleph::Net_Graph< NodeT, ArcT >::get_source(), Aleph::Net_Graph< NodeT, ArcT >::is_single_sink(), Aleph::Net_Graph< NodeT, ArcT >::is_single_source(), Aleph::Filter_Iterator< Container, It, Show_Item >::next_ne(), NODE_COOKIE, Aleph::net_detail::return_dust(), and GraphCommon< GT, Node, Arc >::vsize().
Referenced by check_baseball_elimination(), demo_benchmarking(), demo_dot_export(), demo_grid_networks(), demo_json_export(), demo_layered_networks(), demo_random_networks(), main(), Aleph::Dinic_Maximum_Flow< Net >::operator()(), segment_image(), solve_project_selection(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TYPED_TEST().
|
inline |
Optimize partition DP using divide-and-conquer optimization.
Computes DP of the form:
for g = 1..groups, i = 0..n, where each partition is non-empty.
Correctness and complexity rely on the monotonicity of argmins: opt[g][i] <= opt[g][i+1].
| Cost | Numeric DP cost type. |
| Transition_Cost_Fn | Callable returning Cost given (k, i). |
| [in] | groups | Number of groups/segments. |
| [in] | n | Number of elements/states in prefix space. |
| [in] | transition_cost | Cost for segment [k, i). |
| [in] | inf | Sentinel for unreachable states. |
dp[0][0] = 0, dp[0][i>0] = inf. O(groups * n * log n) with O(1) transition. Definition at line 137 of file DP_Optimizations.H.
References Aleph::Array< T >::create(), k, row, split(), and Aleph::Array< T >::swap().
|
inlinenoexcept |
Definition at line 680 of file hash-fct.H.
References h.
|
inlinenoexcept |
Definition at line 565 of file hash-fct.H.
References djb_hash().
|
inlinenoexcept |
Definition at line 801 of file hash-fct.H.
References djb_hash().
|
inline |
Random search for an element in a dlink list.
dlink_random_search(list,x) uses the algorithm quicksort partition to find element x in the list.
The method uses two type parameters:
The procedure has an expected complexity of \(O(n \; \lg n)\), which is greater than mere search sequential, but with the addition that after the search the list is partially ordered.
| [in,out] | list | list in which the search is performed; is partially modified after the search. |
| [in] | x | element to search for. |
| cmp | comparison object. |
Wraps x in a node so it can be compared via cmp the same way as the list's own nodes.
Definition at line 2803 of file tpl_sort_utils.H.
References Aleph::Dlink::append(), cmp(), Aleph::Dlink::concat_list(), Aleph::Dlink::is_empty(), Aleph::Dlink::remove_next(), and Aleph::Dlink::swap().
| Dlink * Aleph::dlink_random_select | ( | Dlink & | list, |
| const size_t | i, | ||
| const Compare & | cmp = Compare() |
||
| ) |
Random selection of the ith element from a list based on Dlink.
random_select(list,i) returns the ith smallest element content in the list according to order criteria determined by the Compare class.
The routine uses the quicksort partition to search for position i in time \(O(n \; \lg n)\), which It is a substantially better time than the search sequential ( \(O(n^2)\)).
| [in,out] | list | the list to select from (will be partially reordered). The list is left semi-ordered through successive partitions that have been made. |
| [in] | i | position to be accessed (0-based). |
| cmp | Comparison functor defining "less than" relationship. |
Definition at line 3365 of file tpl_sort_utils.H.
References ah_out_of_range_error, Aleph::Dlink::append(), cmp(), Aleph::Dlink::concat_list(), Aleph::Dlink::is_empty(), and Aleph::Dlink::remove_next().
|
inline |
Skip elements while predicate is true (drop_while).
| c | Source container. |
| pred | Predicate to test. |
Definition at line 2444 of file ahFunctional.H.
References and, Aleph::DynList< T >::append(), and pred.
Referenced by demo_grouping(), TEST(), and TEST().
|
inline |
Definition at line 91 of file ah-chronos-utils.H.
Referenced by TEST().
|
inline |
Definition at line 85 of file ah-chronos-utils.H.
Referenced by TEST().
|
inline |
Definition at line 67 of file ah-chronos-utils.H.
Referenced by TEST().
|
inline |
Definition at line 61 of file ah-chronos-utils.H.
Referenced by TEST().
|
inline |
Definition at line 79 of file ah-chronos-utils.H.
Referenced by TEST().
|
inline |
Definition at line 73 of file ah-chronos-utils.H.
Referenced by TEST().
|
inline |
Definition at line 55 of file ah-chronos-utils.H.
Referenced by TEST().
Convert a DynArray to an Array.
Creates a new Array containing copies of all elements from the given DynArray.
| T | The element type. |
| a | The source DynArray. |
Definition at line 305 of file ah-convert.H.
References Aleph::Array< T >::append(), and Aleph::DynArray< T >::size().
Convert a DynArray to a DynDlist.
Creates a new DynDlist containing copies of all elements from the given DynArray.
| T | The element type. |
| a | The source DynArray. |
Definition at line 466 of file ah-convert.H.
References Aleph::DynDlist< T >::append(), and Aleph::DynArray< T >::size().
Convert a DynArray to a DynList.
Creates a new DynList containing copies of all elements from the given DynArray.
| T | The element type. |
| a | The source DynArray. |
Definition at line 198 of file ah-convert.H.
References Aleph::DynList< T >::append(), and Aleph::DynArray< T >::size().
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Convert a DynArray to a std::vector.
Uses the operator[] which safely returns the default value for unallocated entries.
| T | Element type. |
| arr | Source DynArray. |
Definition at line 422 of file ah-stl-utils.H.
References Aleph::DynArray< T >::size().
Referenced by demo_vector_dynarray(), TEST(), TEST(), and TEST().
Convert a DynDlist to a DynArray.
Creates a new DynArray containing copies of all elements from the given DynDlist.
| T | The element type. |
| l | The source DynDlist. |
Definition at line 447 of file ah-convert.H.
References Aleph::DynArray< T >::append(), FunctionalMethods< Container, T >::for_each(), and l.
Convert a DynDlist to a DynList.
Creates a new DynList containing copies of all elements from the given DynDlist.
| T | The element type. |
| l | The source DynDlist. |
Definition at line 409 of file ah-convert.H.
References Aleph::DynList< T >::append(), FunctionalMethods< Container, T >::for_each(), and l.
Convert a DynList to a DynArray.
Creates a new DynArray containing copies of all elements from the given DynList.
| T | The element type. |
| l | The source DynList. |
Definition at line 218 of file ah-convert.H.
References Aleph::DynArray< T >::append(), LocateFunctions< Container, Type >::get_it(), and l.
Convert a DynList to a DynDlist.
Creates a new DynDlist containing copies of all elements from the given DynList.
| T | The element type. |
| l | The source DynList. |
Definition at line 428 of file ah-convert.H.
References Aleph::DynDlist< T >::append(), FunctionalMethods< Container, T >::for_each(), and l.
Convert a DynList to a std::list.
| T | Element type. |
| l | Source DynList. |
Definition at line 402 of file ah-stl-utils.H.
References l.
Referenced by demo_list_dynlist(), TEST(), TEST(), and TEST().
| void Aleph::each | ( | const size_t | n, |
| Op & | op | ||
| ) |
| void Aleph::each | ( | const size_t | start, |
| const size_t | end, | ||
| Op & | op | ||
| ) |
Execute an operation repeatedly over a range of indices.
Calls op() for each index from start to end (inclusive). The operation receives no arguments; this is purely for side effects.
| Op | Callable type with signature void(). |
| start | Starting index (inclusive). |
| end | Ending index (inclusive). |
| op | Operation to execute at each iteration. |
Definition at line 609 of file ahFunctional.H.
Referenced by each(), each(), each(), sublist(), TEST(), TEST(), TEST(), TEST(), TYPED_TEST(), TYPED_TEST(), and TYPED_TEST().
| void Aleph::each | ( | size_t | n, |
| Op && | op | ||
| ) |
| void Aleph::each | ( | size_t | start, |
| size_t | end, | ||
| Op && | op | ||
| ) |
|
inline |
Alias for Levenshtein distance.
| [in] | a | First string. |
| [in] | b | Second string. |
| None. |
Definition at line 147 of file String_DP.H.
References levenshtein_distance().
| Net::Flow_Type Aleph::edmonds_karp_maximum_flow | ( | Net & | net | ) |
Maximize flow using the Edmonds-Karp algorithm.
| [in,out] | net | Flow network (must have a single source and sink). |
Definition at line 2336 of file tpl_net.H.
Referenced by main(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TYPED_TEST(), TYPED_TEST(), and TYPED_TEST().
|
inlinenoexcept |
Definition at line 739 of file hash-fct.H.
References h.
|
inlinenoexcept |
Definition at line 602 of file hash-fct.H.
References elf_hash().
|
inlinenoexcept |
Definition at line 828 of file hash-fct.H.
References elf_hash().
|
inline |
Eliminates unreachable blocks, dead pure instructions, dead local stores, and folds constant-condition branches.
Integer arithmetic that can overflow or divide by zero is not pure: it stays even when its value is dead, since it can stop the program.
| function | Source IR function; not modified in place. |
Definition at line 1409 of file Compiler_Dataflow.H.
References Aleph::DynArray< T >::access(), analyze_dataflow_function(), and, Aleph::DynArray< T >::append(), Aleph::Compiler_IR_Function::blocks, Boolean, Branch, compiler_ir_invalid_id(), Aleph::Compiler_Dataflow_Detail::compute_reachability(), Aleph::Compiler_Dataflow_Detail::count_instructions(), Aleph::Compiler_IR_Function::entry_block, Aleph::Compiler_IR_Function::exit_block, Aleph::Compiler_Dead_Code_Elimination_Result::folded_branches, Aleph::Compiler_Dead_Code_Elimination_Result::function, Aleph::Compiler_SSA_Block::instructions, Aleph::Compiler_Dataflow_Detail::is_pure_instruction(), Aleph::Compiler_Dataflow_Detail::is_value_used(), Jump, Load, Aleph::Compiler_IR_Function::local_slots, Aleph::Compiler_Dataflow_Detail::make_bit_set(), Aleph::Compiler_Dataflow_Detail::mark_value_used(), Aleph::Compiler_IR_Function::next_value_id, Aleph::Compiler_Dataflow_Detail::rebuild_predecessors(), Aleph::Compiler_Dead_Code_Elimination_Result::removed_blocks, Aleph::Compiler_Dead_Code_Elimination_Result::removed_instructions, Return, Aleph::Compiler_Dataflow_Detail::simulate_block(), Aleph::DynArray< T >::size(), Store, Aleph::Compiler_SSA_Terminator::successors, and Aleph::Compiler_SSA_Block::terminator.
Referenced by main(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Overload of enum_for_each.
Definition at line 774 of file ahFunctional.H.
References enum_for_each().
|
inline |
Apply an operation to each element and its index.
Like for_each(), but also passes the zero-based index of each element to the operation. Useful when you need to know the position of each element during iteration.
| Container | Container type with get_it() method. |
| Operation | Callable type (const Item_Type&, size_t) -> void. |
| container | Source container. |
| operation | Operation receiving (element, index). |
Definition at line 764 of file ahFunctional.H.
Referenced by demo_iteration(), enum_for_each(), and TEST_F().
|
inline |
|
inline |
Alias for get_enum_zip_it_pos.
Definition at line 1428 of file ah-zip.H.
References get_enum_zip_it_pos().
Referenced by TEST_F().
Return pairs of (element, index).
Creates a list of pairs where each pair contains an element and its zero-based index in the container. Similar to Python's enumerate() but returns pairs instead of tuples.
| Container | Container type with for_each() method. |
| c | Source container. |
Definition at line 1188 of file ahFunctional.H.
References Aleph::DynList< T >::append().
Referenced by Aleph::CA::Ghost_Lattice< Storage, Boundary, Halo >::for_each_halo_cell(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST_F().
|
inline |
Zip containers with an index (enumerate with zip).
Returns list of tuples (index, element).
| container | Source container. |
Definition at line 2760 of file ahFunctional.H.
References Aleph::DynList< T >::append(), and Tuple.
Referenced by TEST().
| Aleph::EnumZipIterator | ( | const HeadC & | head, |
| const TailC &... | tail | ||
| ) |
|
inline |
Check equality of two containers using a predicate.
Compares two containers element-by-element using the given equality predicate. Returns true only if both containers have the same length and all corresponding pairs are equal.
| C1 | Type of the first container. |
| C2 | Type of the second container. |
| Eq | Equality predicate type (defaults to std::equal_to). |
| c1 | First container. |
| c2 | Second container. |
| e | Equality predicate for comparing elements. |
Definition at line 1230 of file ahFunctional.H.
References and, and LocateFunctions< Container, Type >::get_it().
Referenced by all_unique(), all_unique(), all_unique(), all_unique(), Aleph::functional_detail::all_unique_hash_path(), are_tree_equal(), are_tree_equal(), Aleph::SweepLineSegmentIntersection::check_and_enqueue(), containers_eq(), demo_comparison(), diff(), Aleph::CA::ca_io_detail::header_value(), Aleph::Path< GT >::operator!=(), Aleph::SweepLineSegmentIntersection::operator()(), Aleph::MinkowskiSumConvex::operator()(), operator==(), Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::operator==(), Aleph::Path< GT >::operator==(), Aleph::functional_detail::pairwise_all_unique(), Aleph::DynList< T >::remove(), Aleph::DynList< T >::remove_ne(), sequential_groups(), sequential_groups(), sequential_search(), sequential_search(), sequential_search(), sequential_search(), sequential_search(), sequential_search(), sequential_search(), sequential_search(), sequential_search(), sequential_search(), sequential_search(), sequential_search(), sequential_search(), stl_zip_equal_by(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), uni_zip_equal_by(), Aleph::FunctionalMixin< Derived, Type >::unique_by(), unique_sequential(), and unique_sequential().
|
inline |
Test if two ranges are equal.
Compares elements in the range [beg, end) with elements starting at cmpBeg.
| Itor1 | First range iterator type. |
| Itor2 | Second range iterator type. |
| BinaryPredicate | Comparison predicate. |
| beg | Iterator to the first element of the first range. |
| end | Iterator past the last element of the first range. |
| cmpBeg | Iterator to the first element of the second range. |
| op | Binary predicate for comparison. |
Definition at line 482 of file ahAlgo.H.
Referenced by csv_unique(), Aleph::howard_detail::Arithmetic< Cost_Type, true >::less(), Aleph::Compiler_Parser::parse_type_alias_declaration(), TEST(), TEST(), TEST(), and TYPED_TEST().
|
inline |
Return true if all containers have the same length.
| cs | Containers to compare. |
true iff all containers have equal size. Definition at line 378 of file ah-zip.H.
References get_zip_it().
Referenced by demo_length_checking(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), and TEST_F().
|
inline |
Find equal range in a sorted sequence.
Returns a pair of iterators defining the subrange of elements equal to value.
| Itor | Forward iterator type. |
| T | Value type. |
| beg | Iterator to the first element. |
| end | Iterator past the last element. |
| value | Value to search for. |
Definition at line 1330 of file ahAlgo.H.
References lower_bound(), upper_bound(), and value.
Referenced by TEST().
|
inline |
Find equal range with custom comparison.
| Itor | Forward iterator type. |
| T | Value type. |
| BinaryPredicate | Comparison predicate. |
| beg | Iterator to the first element. |
| end | Iterator past the last element. |
| value | Value to search for. |
| op | Binary comparison predicate. |
Definition at line 1351 of file ahAlgo.H.
References lower_bound(), upper_bound(), and value.
|
extern |
Print an error message with file and line info.
| file | Source file name (use FILE). |
| line | Line number (use LINE). |
| format | Printf-style format string. |
| ... | Format arguments. |
Definition at line 100 of file ahDefs.C.
References aleph_message_mutex, and file.
Referenced by Aleph::Interpreter_Runtime::call_host_function(), Aleph::Compiler_Bytecode_VM::complete_current_frame(), Aleph::Compiler_Bytecode_Interpreter_Detail::constant_to_value(), Aleph::Interpreter_Runtime::decode_escaped_text(), Aleph::Compiler_C_Backend::Emitter::emit_constant_expression(), Aleph::Compiler_C_Backend::Emitter::emit_instruction(), Aleph::FFT< Real >::enforce_conjugate_symmetry(), Aleph::FFT< Real >::enforce_real_polynomial_symmetry(), Aleph::Compiler_Bytecode_VM::execute_entry(), Aleph::Compiler_Bytecode_VM::execute_host_call(), Aleph::Compiler_Bytecode_VM::execute_loop(), main(), Aleph::Compiler_Bytecode_VM::make_error(), Aleph::Compiler_Bytecode_VM::module_is_valid(), Aleph::Compiler_Bytecode_VM::push_frame(), Aleph::Compiler_Bytecode_VM::read_callee_and_arguments(), Aleph::Compiler_Bytecode_VM::read_global(), Aleph::Compiler_Bytecode_VM::read_local(), Aleph::Compiler_Bytecode_VM::read_register(), Aleph::Compiler_Bytecode_VM::require_bool(), Aleph::Compiler_Bytecode_VM::require_integer(), Aleph::FFT< Real >::root_groups_impl(), TEST(), TYPED_TEST(), Aleph::Compiler_Bytecode_VM::write_global(), Aleph::Compiler_Bytecode_VM::write_local(), and Aleph::Compiler_Bytecode_VM::write_register().
|
inline |
|
inline |
Definition at line 56 of file generate_tree.H.
Referenced by generate_tree_graphviz().
|
inline |
Euclidean distance (hypotenuse) of the vector (x, y).
Definition at line 160 of file point.H.
Referenced by Aleph::Polar_Point::Polar_Point(), Aleph::Point::distance_to(), Aleph::Segment::length(), Aleph::Point::norm(), pitag(), process_tag_node(), TEST(), and TEST().
|
inline |
|
inline |
Overload of exists.
Definition at line 884 of file ahFunctional.H.
|
inline |
Overload of exists.
Definition at line 867 of file ahFunctional.H.
|
inline |
Overload of exists.
Definition at line 877 of file ahFunctional.H.
|
inline |
Return true if at least one element satisfies a predicate.
Tests whether the predicate returns true for at least one element in the container. Short-circuits on the first true result. Returns false for empty containers.
| Container | Container type with traverse() method. |
| Operation | Predicate type (const Item_Type&) -> bool. |
| container | Source container. |
| operation | Predicate to test each element. |
Definition at line 857 of file ahFunctional.H.
Referenced by none(), TEST(), TEST(), TEST(), TEST(), and TEST_F().
|
inline |
|
inline |
Test if an arc of g into p satisfies an operation; on a digraph, in \(O(E)\).
| [in] | g | the graph of p |
| [in] | p | node pointer |
| [in] | op | operation for testing on each arc |
true if there is at least an arc satisfying the operation Definition at line 3096 of file tpl_graph.H.
References traverse_in_arcs().
|
inline |
Test if it exists an incoming arc satisfying an operation.
op must have the following signature:
bool op(Arc * arc)
It does not compile on a digraph type: use exists_in_arc(g, p, op).
| [in] | p | node pointer |
| [in] | op | operation for testing on each arc |
true if there is at least an arc satisfying the operation Definition at line 3075 of file tpl_graph.H.
Referenced by TYPED_TEST(), and TYPED_TEST().
|
inline |
Test if it exists an outcoming arc satisfying an operation.
op must have the following signature:
bool op(Arc * arc)
| [in] | p | node pointer |
| [in] | op | operation for testing on each arc |
true if there is at least an arc satisfying the operation Definition at line 3423 of file tpl_graph.H.
| bool Aleph::exists_perm | ( | const DynList< DynList< T > > & | l, |
| Pred && | pred | ||
| ) |
Convenience overload accepting an rvalue callable.
Definition at line 647 of file ah-comb.H.
References exists_perm(), l, and pred.
| bool Aleph::exists_perm | ( | const DynList< DynList< T > > & | l, |
| Pred & | pred | ||
| ) |
Check if any permutation satisfies a predicate.
Stops as soon as a permutation makes pred return true.
| T | Element type. |
| Pred | Callable with signature bool(const DynList<T>&). |
| [in] | l | List of lists. |
| [in] | pred | Predicate to test. |
true if at least one permutation satisfies pred. Definition at line 628 of file ah-comb.H.
References l, pred, and traverse_perm().
Referenced by demo_perm_predicates(), exists_perm(), none_perm(), TEST(), TEST(), TEST(), and TEST().
|
extern |
Print a message and exit the program.
| file | Source file name (use FILE). |
| line | Line number (use LINE). |
| format | Printf-style format string. |
| ... | Format arguments. |
Definition at line 125 of file ahDefs.C.
References aleph_message_mutex, and file.
Referenced by Aleph::Compiler_Line_Frontend::lower_ir(), main(), main(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and usage().
|
inline |
Expect and consume a specific string/keyword.
Reads characters and verifies they match the expected string. If not, throws an error.
| input_stream | The input file stream |
| expected | The string that must appear next |
| ParseError | if the input doesn't match |
Definition at line 1303 of file parse_utils.H.
References ah_parse_error_unless, expect(), init_token_scanning(), read_char_from_stream(), skip_white_spaces(), and token_instance.
|
inline |
Expect and consume a specific character.
Reads the next non-whitespace character and verifies it matches the expected character. If not, throws an error.
| input_stream | The input file stream |
| expected | The character that must appear next |
| ParseError | if the next character doesn't match |
Definition at line 1278 of file parse_utils.H.
References ah_parse_error_unless, expect_char(), read_char_from_stream(), and skip_white_spaces().
Referenced by expect_char(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
| void Aleph::export_network_to_dimacs | ( | const Net & | net, |
| const std::string & | filename | ||
| ) |
Export network to DIMACS max-flow format.
DIMACS is a standard benchmark format for network flow problems. Many benchmark instances are available in this format.
| Net | Network type. |
| net | Network to export. |
| filename | Output filename. |
Definition at line 821 of file net_utils.H.
References GraphCommon< GT, Node, Arc >::esize(), Aleph::Net_Graph< NodeT, ArcT >::get_sink(), Aleph::Net_Graph< NodeT, ArcT >::get_source(), GraphCommon< GT, Node, Arc >::get_src_node(), GraphCommon< GT, Node, Arc >::get_tgt_node(), Aleph::Net_Graph< NodeT, ArcT >::is_single_sink(), Aleph::Net_Graph< NodeT, ArcT >::is_single_source(), Aleph::Filter_Iterator< Container, It, Show_Item >::next_ne(), out, and GraphCommon< GT, Node, Arc >::vsize().
| void Aleph::export_network_to_dot | ( | const Net & | net, |
| const std::string & | filename, | ||
| const DotExportOptions & | options = DotExportOptions() |
||
| ) |
Export network to DOT format for GraphViz visualization.
Creates a DOT file that can be rendered with GraphViz tools (dot, neato, etc.) to visualize the network structure and flow.
| Net | Network type. |
| net | Network to export. |
| filename | Output filename (should end with .dot). |
| options | Export options. |
Definition at line 485 of file net_utils.H.
References and, color(), Aleph::Net_Graph< NodeT, ArcT >::get_sink(), Aleph::Net_Graph< NodeT, ArcT >::get_source(), GraphCommon< GT, Node, Arc >::get_src_node(), GraphCommon< GT, Node, Arc >::get_tgt_node(), Aleph::Net_Graph< NodeT, ArcT >::is_single_sink(), Aleph::Net_Graph< NodeT, ArcT >::is_single_source(), Aleph::Filter_Iterator< Container, It, Show_Item >::next_ne(), options, and out.
| void Aleph::export_network_to_json | ( | const Net & | net, |
| const std::string & | filename | ||
| ) |
Export network to JSON format.
Creates a JSON file with network structure including:
| Net | Network type. |
| net | Network to export. |
| filename | Output filename (should end with .json). |
Definition at line 695 of file net_utils.H.
References GraphCommon< GT, Node, Arc >::esize(), Aleph::Net_Graph< NodeT, ArcT >::get_sink(), Aleph::Net_Graph< NodeT, ArcT >::get_source(), GraphCommon< GT, Node, Arc >::get_src_node(), GraphCommon< GT, Node, Arc >::get_tgt_node(), Aleph::Net_Graph< NodeT, ArcT >::is_single_sink(), Aleph::Net_Graph< NodeT, ArcT >::is_single_source(), Aleph::Filter_Iterator< Container, It, Show_Item >::next_ne(), out, and GraphCommon< GT, Node, Arc >::vsize().
Referenced by TEST_F().
Extended Euclidean Algorithm.
Computes gcd(a, b) and the coefficients x, y such that a*x + b*y = gcd(a, b).
| a | First number. |
| b | Second number. |
| x | Reference to store the coefficient of a. |
| y | Reference to store the coefficient of b. |
Definition at line 138 of file modular_arithmetic.H.
References ext_gcd(), y, and y1().
Referenced by ext_gcd().
|
inline |
Basic linear extrapolation.
This function receives a pair of points in a plane plus a x point less than x1 and x2 and computes the value of f(x)
| [in] | x1 | minimum in x |
| [in] | x2 | maximum in x |
| [in] | y1 | value of f(x1) |
| [in] | y2 | value of f(x2) |
| [in] | x | for which f(x) should be computed |
x2 > x1 and x < x1. Definition at line 391 of file ahUtils.H.
Referenced by TEST().
|
inline |
Basic linear extrapolation.
This function receives a pair of points in a plane plus a x point less than x1 and x2 and computes the value of f(x)
| [in] | x1 | minimum in x |
| [in] | x2 | maximum in x |
| [in] | y1 | value of f(x1) |
| [in] | y2 | value of f(x2) |
| [in] | x | for which f(x) should be computed |
x2 > x1 and x > x2. Definition at line 431 of file ahUtils.H.
Referenced by TEST().
|
inlineconstexpr |
Optimized version of heapsort.
faster_heapsort(array, n) builds the heap bottom-up (starting at n / 2) and therefore performs fewer comparisons during the build phase.
| T | element type |
| Compare | comparator defining the heap order |
| [in,out] | array | pointer to the first element to sort |
| [in] | n | number of elements in the range |
| [in] | cmp | comparison function (default: Aleph::less<T>) |
Definition at line 371 of file tpl_arrayHeap.H.
References cmp(), and Aleph::arrayheap_detail::sift_down().
Referenced by benchmark_contiguous_array(), introsort_loop(), main(), Aleph::pdq_detail::sort_loop(), TEST(), TEST(), TEST(), TEST(), and TEST().
| Net::Flow_Type Aleph::fifo_preflow_maximum_flow | ( | Net & | net | ) |
Preflow-push maximum flow using a FIFO queue of active nodes.
| [in,out] | net | Flow network (must have a single source and sink). |
Definition at line 2668 of file tpl_net.H.
Referenced by Aleph::Fifo_Preflow_Maximum_Flow< Net >::operator()(), and TEST().
| void Aleph::fill | ( | C & | container, |
| const typename C::Item_Type & | value | ||
| ) |
Fill all elements of a container with a fixed value.
Sets every element currently in container to value in traversal order (front to back). The container size is unchanged; if it is empty this is a no-op.
Analogous to std::fill, but works with any Aleph-w sequential container via the AlephSequentialContainer concept.
| C | Container type satisfying AlephSequentialContainer. |
| [in,out] | container | The container whose elements are overwritten. |
| [in] | value | The value assigned to every element. |
rep(). Definition at line 463 of file ahFunctional.H.
References value.
|
inline |
Fill a range with a value.
Assigns the specified value to all elements in [beg, end).
| Itor | Iterator type. |
| T | Value type. |
| beg | Iterator to the first element. |
| end | Iterator past the last element. |
| value | Value to assign. |
Definition at line 707 of file ahAlgo.H.
References value.
Referenced by Aleph::negative_cycles_detail::build_out_adjacency(), Aleph::TestVisual::emit_case_svg(), main(), Aleph::Compiler_Dataflow_Detail::make_constant_vector(), most_negative_cycle_up_to_3(), Aleph::Compiler_Bytecode_Interpreter_Detail::reset_values(), shift_lines_to_left(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), and TYPED_TEST().
|
inline |
Fill n elements with a value.
Assigns the specified value to the first n elements starting at beg.
| Itor | Iterator type. |
| T | Value type. |
| Size | Integer type. |
| beg | Iterator to the first element. |
| num | Number of elements to fill. |
| value | Value to assign. |
Definition at line 727 of file ahAlgo.H.
References value.
Referenced by TEST().
|
inline |
Fill all the content of std::string with a defined char.
Use for deleting sensitive data; for example, passwords
Definition at line 710 of file ah-string-utils.H.
Referenced by demo_filtering(), and TEST().
|
inline |
Overload of filter.
Definition at line 953 of file ahFunctional.H.
|
inline |
Overload of filter.
Definition at line 927 of file ahFunctional.H.
References FunctionalMethods< Container, T >::for_each().
|
inline |
Overload of filter.
Definition at line 943 of file ahFunctional.H.
|
inline |
Filter elements that satisfy operation.
| Container1 | Source container. |
| Container2 | Result container (defaults to DynList). |
| Operation | Predicate. |
| container | Source container. |
| operation | Predicate to test each element. |
Definition at line 911 of file ahFunctional.H.
References FunctionalMethods< Container, T >::for_each().
Referenced by compiler_module_name_filter_name(), compiler_resolve_module_name(), compiler_resolve_module_name(), demo_basic(), demo_false_positives(), demo_practical(), Aleph::Compiler_Module_Name_Resolver_Detail::issue_matches_query(), main(), Aleph::Compiler_Module_Name_Resolver_Detail::matches_filter(), Aleph::k_shortest_paths_detail::shortest_path_filtered(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), test_DynSet(), test_DynSetLinHash(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Return the arcs of g into p that meet a condition; on a digraph, in \(O(E)\).
| [in] | g | the graph of p |
| [in] | p | node pointer |
| [in] | cond | filtering condition |
Definition at line 3348 of file tpl_graph.H.
References Aleph::DynList< T >::append(), and for_each_in_arc().
|
inline |
Filter the incoming arcs meeting an condition.
It does not compile on a digraph type: use filter_in_arcs(g, p, cond).
| [in] | p | node pointer |
| [in] | cond | filtering condition |
Definition at line 3324 of file tpl_graph.H.
References Aleph::DynList< T >::append().
Referenced by TYPED_TEST().
|
inline |
Filter the outcoming arcs meeting an condition.
| [in] | p | node pointer |
| [in] | cond | filtering condition |
Definition at line 3547 of file tpl_graph.H.
References Aleph::DynList< T >::append().
| DynList< DynList< T > > Aleph::filter_perm | ( | const DynList< DynList< T > > & | l, |
| Pred && | pred | ||
| ) |
Convenience overload accepting an rvalue callable.
Definition at line 735 of file ah-comb.H.
References filter_perm(), l, and pred.
| DynList< DynList< T > > Aleph::filter_perm | ( | const DynList< DynList< T > > & | l, |
| Pred & | pred | ||
| ) |
Filter permutations that satisfy a predicate.
| T | Element type. |
| Pred | Callable with signature bool(const DynList<T>&). |
| [in] | l | List of lists. |
| [in] | pred | Predicate to select permutations. |
pred returned true. Definition at line 720 of file ah-comb.H.
References Aleph::DynList< T >::append(), for_each_perm(), l, and pred.
Referenced by filter_perm(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Find the first element equal to a value.
Searches the range [beg, end) for the first element equal to the specified value.
| Itor | Iterator type. |
| T | Value type. |
| beg | Iterator to the first element. |
| end | Iterator past the last element. |
| value | Value to search for. |
Definition at line 230 of file ahAlgo.H.
References bind2nd(), find_if(), and value.
Referenced by Aleph::PatriciaMap< UInt, T >::contains(), Aleph::PatriciaMap< UInt, T >::insert_or_assign(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), and TYPED_TEST().
| Path< Net > Aleph::find_aumenting_path | ( | const Net & | net, |
| const typename Net::Flow_Type & | min_slack | ||
| ) |
Find an augmenting path using DFS or BFS based on Q.
| [in] | net | Flow network. |
| [in] | min_slack | Minimum slack required. |
Definition at line 2018 of file tpl_net.H.
References Aleph::Net_Graph< NodeT, ArcT >::get_sink(), and Aleph::Net_Graph< NodeT, ArcT >::get_source().
| Path< Net > Aleph::find_aumenting_path_bfs | ( | const Net & | net, |
| const typename Net::Flow_Type & | min_slack | ||
| ) |
Find an augmenting path using BFS.
Definition at line 2034 of file tpl_net.H.
Referenced by TYPED_TEST().
| Path< Net > Aleph::find_aumenting_path_dfs | ( | const Net & | net, |
| const typename Net::Flow_Type & | min_slack | ||
| ) |
Find an augmenting path using DFS.
Definition at line 2027 of file tpl_net.H.
Referenced by TEST(), and TYPED_TEST().
| SemiPath< Net > Aleph::find_aumenting_semi_path | ( | const Net & | net, |
| const typename Net::Flow_Type & | slack | ||
| ) |
Find an augmenting semi-path using DFS or BFS based on Q.
| [in] | net | Flow network. |
| [in] | slack | Minimum slack required. |
Definition at line 2048 of file tpl_net.H.
References Aleph::Find_Aumenting_Path< Net, Q >::find_aum_path().
| SemiPath< Net > Aleph::find_aumenting_semi_path_bfs | ( | const Net & | net, |
| const typename Net::Flow_Type & | slack | ||
| ) |
Find an augmenting semi-path using BFS.
Definition at line 2062 of file tpl_net.H.
Referenced by TYPED_TEST().
| SemiPath< Net > Aleph::find_aumenting_semi_path_dfs | ( | const Net & | net, |
| const typename Net::Flow_Type & | slack | ||
| ) |
Find an augmenting semi-path using DFS.
Definition at line 2055 of file tpl_net.H.
Referenced by TYPED_TEST().
Starts from the first node of the graph.
find_bridges(const GT &, typename GT::Node *, SA) Definition at line 1097 of file tpl_cut_nodes.H.
References Aleph::Compute_Bridges< GT, SA >::find_bridges().
| SemiPath< Net > Aleph::find_decrementing_path | ( | const Net & | net, |
| const typename Net::Flow_Type & | slack | ||
| ) |
Find a decrementing semi-path using DFS or BFS based on Q.
| [in] | net | Flow network. |
| [in] | slack | Minimum slack required. |
Definition at line 2076 of file tpl_net.H.
References Aleph::Find_Aumenting_Path< Net, Q >::find_dec_path().
| SemiPath< Net > Aleph::find_decrementing_path_bfs | ( | const Net & | net, |
| const typename Net::Flow_Type & | slack | ||
| ) |
Find a decrementing semi-path using BFS.
Definition at line 2090 of file tpl_net.H.
Referenced by TYPED_TEST().
| SemiPath< Net > Aleph::find_decrementing_path_dfs | ( | const Net & | net, |
| const typename Net::Flow_Type & | slack | ||
| ) |
Find a decrementing semi-path using DFS.
Definition at line 2083 of file tpl_net.H.
Referenced by TYPED_TEST().
See find_depth_first_spanning_tree().
Definition at line 1327 of file tpl_graph_utils.H.
References find_depth_first_spanning_tree(), and GraphCommon< GT, Node, Arc >::get_node().
|
inline |
Find the last occurrence of a subrange.
Searches for the last occurrence of the subrange [searchBeg, searchEnd) within the range [beg, end).
| Itor1 | Main range iterator type. |
| Itor2 | Subrange iterator type. |
| BinaryPredicate | Comparison predicate. |
| beg | Iterator to the first element of the main range. |
| end | Iterator past the last element of the main range. |
| searchBeg | Iterator to the first element of the subrange. |
| searchEnd | Iterator past the last element of the subrange. |
| op | Binary predicate for comparison. |
Definition at line 364 of file ahAlgo.H.
References search().
|
inline |
Find first element from a set.
Searches the range [beg, end) for the first element that matches any element in [searchBeg, searchEnd).
| Itor1 | Main range iterator type. |
| Itor2 | Search set iterator type. |
| BinaryPredicate | Comparison predicate. |
| beg | Iterator to the first element of the main range. |
| end | Iterator past the last element of the main range. |
| searchBeg | Iterator to the first element of the search set. |
| searchEnd | Iterator past the last element of the search set. |
| op | Binary predicate for comparison. |
|
inline |
Find the first element satisfying a predicate.
Searches the range [beg, end) for the first element for which the predicate op returns true.
| Itor | Iterator type. |
| UnaryPredicate | Predicate type. |
| beg | Iterator to the first element. |
| end | Iterator past the last element. |
| op | Unary predicate to test elements. |
Definition at line 205 of file ahAlgo.H.
References and.
Referenced by find(), remove_if(), TEST(), and TEST().
|
inline |
Find the first element satisfying pred (safe version).
Returns a copy of the first element in container for which pred returns true, wrapped in std::optional. Returns std::nullopt if no such element exists.
Unlike find_ptr(), this function is safe to use with temporary containers because it returns a copy of the element, not a pointer.
| container | Source container. |
| pred | Predicate to test each element. |
Definition at line 2302 of file ahFunctional.H.
References pred.
|
inlinenoexcept |
See find_position().
Definition at line 348 of file tpl_binNodeXt.H.
References cmp(), find_position(), and r.
|
inlinenoexcept |
Find the inorder position of a key in an extended binary search tree.
`find_position(r, key, p, cmp)` searches `key` in the tree with root `r`. If `key` is found then its inorder position is returned and a pointer to the node containing the key is written in output parameter `p`. Otherwise, the function returns the position that would have `key` if this was in the tree. At this regard, there are three cases: -# if `key` is lesser than the minimum key of tree, then -1 is returned and `p` is the node with the smallest key. -# If `key` is greater than the maximum key in the tree, then the number of keys is returned and `p` is the node with the maximum key in the tree. -# For any other case, the returned value is the position that would have `key` if this was in the tree and `p` is the node whose key is immediately greater than `key`. @param[in] r root of tree @param[in] key to be searched @param[out] p reference to pointer to node @param[in] cmp comparison criteria @return the positions of `key` in the tree @throws anything that `cmp` throws; the search does not modify the tree. It is `noexcept` only if `cmp` cannot throw, so that what a comparison throws reaches the caller. @ingroup Trees
Definition at line 309 of file tpl_binNodeXt.H.
References cmp(), COUNT(), KEY, LLINK, offset, r, and RLINK.
Referenced by find_position(), main(), and TEST().
|
inline |
Find the first element satisfying pred.
Returns a pointer to the first element in container for which pred returns true, or nullptr if no such element exists.
| container | Source container (must outlive the returned pointer). |
| pred | Predicate to test each element. |
Definition at line 2229 of file ahFunctional.H.
References pred.
Referenced by TEST().
|
inline |
Build the first k-of-64 combination mask (k low bits set).
Definition at line 892 of file ah-comb.H.
References ah_out_of_range_error_if, and k.
Referenced by next_combination_mask(), and TEST().
|
inline |
Apply operation and flatten results (flatMap/concatMap).
For each element, apply op to get a container, then flatten all results.
| container | Source container. |
| op | Operation returning a container for each element. |
Definition at line 2469 of file ahFunctional.H.
References Aleph::DynList< T >::append().
Referenced by demo_transformation(), TEST(), TEST(), TEST(), and TEST().
| DynList< T > Aleph::flatten | ( | const C2< C1< T > > & | c | ) |
Flatten a nested container of one level.
Concatenates all inner containers into a single flat list.
| T | Element type. |
| C1 | Inner container template. |
| C2 | Outer container template. |
| c | Nested container (container of containers). |
Definition at line 2037 of file ahFunctional.H.
References Aleph::DynList< T >::append().
Referenced by demo_transformation(), flatten(), flatten(), flatten(), TEST(), and TEST().
| DynList< T > Aleph::flatten | ( | const C3< C2< C1< T > > > & | c | ) |
Flatten a nested container of two levels.
Recursively flattens a container nested two levels deep.
| T | Element type. |
| C1,C2,C3 | Container template types (innermost to outermost). |
| c | Triply-nested container. |
Definition at line 2061 of file ahFunctional.H.
References Aleph::DynList< T >::append(), and flatten().
| DynList< T > Aleph::flatten | ( | const C4< C3< C2< C1< T > > > > & | c | ) |
Flatten a nested container of three levels.
Recursively flattens a container nested three levels deep.
| T | Element type. |
| C1,C2,C3,C4 | Container template types (innermost to outermost). |
| c | Quadruply-nested container. |
Definition at line 2085 of file ahFunctional.H.
References Aleph::DynList< T >::append(), and flatten().
| DynList< T > Aleph::flatten | ( | const C5< C4< C3< C2< C1< T > > > > > & | c | ) |
Flatten a nested container of four levels.
Recursively flattens a container nested four levels deep.
| T | Element type. |
| C1,C2,C3,C4,C5 | Container template types (innermost to outermost). |
| c | Five-times-nested container. |
Definition at line 2110 of file ahFunctional.H.
References Aleph::DynList< T >::append(), and flatten().
| void Aleph::floyd_all_shortest_paths | ( | GT & | g, |
| Ady_Mat< GT, typename GT::Arc_Type::Distance_Type > & | dist, | ||
| Ady_Mat< GT, long > & | path | ||
| ) |
Overload using default comparison (less) and addition (plus).
Definition at line 290 of file latex_floyd.H.
| void Aleph::floyd_all_shortest_paths_latex | ( | GT & | g, |
| Ady_Mat< GT, typename GT::Arc_Type::Distance_Type > & | dist, | ||
| Ady_Mat< GT, long > & | path, | ||
| std::ofstream & | output | ||
| ) |
Overload using default comparison (less) and addition (plus).
Definition at line 413 of file latex_floyd.H.
References output.
|
inlinestatic |
Definition at line 94 of file hash-fct.C.
References h.
Referenced by MurmurHash3_x86_128(), and MurmurHash3_x86_32().
|
inlinestatic |
Definition at line 105 of file hash-fct.C.
References BIG_CONSTANT, and k.
Referenced by MurmurHash3_x64_128().
|
inlinenoexcept |
Definition at line 702 of file hash-fct.H.
References h.
|
inlinenoexcept |
Definition at line 579 of file hash-fct.H.
References fnv_hash().
|
inlinenoexcept |
Definition at line 811 of file hash-fct.H.
References fnv_hash().
|
inlinestaticnoexcept |
| T Aleph::fold_perm | ( | const T & | init, |
| const DynList< DynList< Tc > > & | l, | ||
| Op && | op | ||
| ) |
Convenience overload accepting an rvalue callable.
Definition at line 583 of file ah-comb.H.
References fold_perm(), init, and l.
| T Aleph::fold_perm | ( | const T & | init, |
| const DynList< DynList< Tc > > & | l, | ||
| Op & | op | ||
| ) |
Left-fold over all permutations.
For each permutation p, the accumulator is updated as: acu = op(acu, p).
| T | Accumulator type. |
| Tc | Element type stored in the input lists. |
| Op | Callable with signature T op(T acu, const DynList<Tc>& perm). |
| [in] | init | Initial accumulator value. |
| [in] | l | List of lists. |
| [in] | op | Folding operation. |
Definition at line 568 of file ah-comb.H.
References init, l, and traverse_perm().
Referenced by demo_fold(), and fold_perm().
Classic left fold (reduce).
Computes f(...f(f(init, x1), x2), ..., xn).
Definition at line 984 of file ahFunctional.H.
References init, and Aleph::detail::ranges_fold_left().
Referenced by TEST(), and TYPED_TEST_P().
|
inline |
Fold the arcs of g into p with op, which must have the signature T op(const T & acc, Arc * arc); on a digraph, in \(O(E)\).
| [in] | g | the graph of p |
| [in] | p | node pointer |
| [in] | init | initial value of folding |
| [in] | op | folding operation |
Definition at line 3302 of file tpl_graph.H.
References Call, for_each_in_arc(), and init.
|
inline |
Fold the incoming arcs of a node.
This method folds the incoming arcs to a final folded type T. Each folding is done by an operation op, which must have the following signature:
T op(const T & acc, Arc * arc)
acc often is called an accumulator. op should take the accumulator and the arc and to produce a folded result. It does not compile on a digraph type: use foldl_in_arcs<GT, T>(g, p, init,
op).
| [in] | p | node pointer |
| [in] | init | initial value of folding |
| [in] | op | folding operation |
Definition at line 3275 of file tpl_graph.H.
References init.
|
inline |
Fold the outcoming arcs of a node.
This method folds the outcoming arcs to a final folded type T. Each folding is done by an operation op, which must have the following signature:
T op(const T & acc, Arc * arc)
acc often is called an accumulator. op should take the accumulator and the arc and to produce a folded result.
| [in] | p | node pointer |
| [in] | init | initial value of folding |
| [in] | op | folding operation |
Definition at line 3528 of file tpl_graph.H.
References init.
|
inline |
Right fold (reduce).
Computes f(x1, f(x2, ... f(xn, init)...)).
Definition at line 2337 of file ahFunctional.H.
References init.
|
inline |
Overload of for_each.
Definition at line 730 of file ahFunctional.H.
|
inline |
Overload of for_each.
Definition at line 711 of file ahFunctional.H.
|
inline |
Overload of for_each.
Definition at line 723 of file ahFunctional.H.
|
inline |
Apply an operation to each element in a container.
Traverses all elements in the container and applies the given operation to each one. This is a side-effect operation that returns the container for chaining.
| Container | Container type with traverse() method. |
| Operation | Callable type (const Item_Type&) -> void. |
| container | Source container. |
| operation | Operation to apply to each element. |
Definition at line 699 of file ahFunctional.H.
|
inline |
Apply an operation to each element in a range.
Iterates through all elements in the range [beg, end) and applies the given operation to each one.
| Itor | Iterator type. |
| Operation | Callable type. |
| beg | Iterator to the first element. |
| end | Iterator past the last element. |
| op | Operation to apply to each element. |
Definition at line 76 of file ahAlgo.H.
Referenced by Aleph::Matrix< Trow, Tcol, NumType >::Matrix(), main(), main(), Aleph::Matrix< Trow, Tcol, NumType >::matrix_vector_mult(), partition(), TEST(), TEST(), TEST(), test_DynMapLinHash(), test_DynSet(), test_DynSetLinHash(), TEST_F(), Aleph::Matrix< Trow, Tcol, NumType >::to_collist(), Aleph::Matrix< Trow, Tcol, NumType >::to_rowlist(), TYPED_TEST(), TYPED_TEST_P(), and Aleph::Matrix< Trow, Tcol, NumType >::vector_matrix_mult().
|
inline |
*/
Enumerate all k-combinations of an Array<T> in lexicographic index order.
The callback receives each materialized combination as Array<T> and can stop early by returning false.
| T | Element type. |
| Op | Callable with the signature bool(const Array<T>&). |
| [in] | values | Source values. |
| [in] | k | Combination size. |
| [in] | op | Callback invoked for each combination. |
true if fully traversed; false if the callback stopped early. Definition at line 1013 of file ah-comb.H.
References k.
Referenced by build_combinations(), build_combinations(), TEST(), and TEST().
Apply op to each element of a tuple.
Iterates over all elements in the tuple at compile-time using std::index_sequence, applying the callable op to each element. The operation can modify elements if the tuple is passed by reference.
| Op | Callable type (must be invocable with each tuple element type). |
| Tuple | Tuple type to iterate over. |
| op | Callable to apply to each element. |
| t | Tuple to iterate over (can be lvalue or rvalue reference). |
Definition at line 1911 of file ah-zip.H.
References Aleph::zip_index_detail::for_each_in_tuple_impl().
|
inline |
Convenience overload accepting an rvalue callable.
Definition at line 494 of file ah-comb.H.
References for_each_perm(), and l.
|
inline |
Apply a procedure to every permutation produced by traverse_perm.
Unlike traverse_perm, the operation cannot stop the traversal early.
| T | Element type. |
| Op | Callable with signature void(const DynList<T>&). |
| [in] | l | List of lists. |
| [in] | op | Operation to run on each permutation. |
Definition at line 482 of file ah-comb.H.
References l, row, and traverse_perm().
Referenced by build_combs(), build_perms(), demo_permutations(), demo_practical(), filter_perm(), for_each_perm(), map_perm(), TEST(), and TEST().
| Net::Flow_Type Aleph::ford_fulkerson_maximum_flow | ( | Net & | net | ) |
Maximize flow using the Ford-Fulkerson algorithm.
With an integer flow, it takes the augmenting paths of a depth-first search. With a floating flow, it takes the shortest ones, those of edmonds_karp_maximum_flow(): rounding leaves residues of the order of an ulp on the arcs, which the paths of a depth-first search take and spread, taking the flows off the multiples of the data, so that the augmentations, bounded only by the value of the flow over the least of its units, did not end on networks of some hundreds of nodes with capacities in tenths. The number of shortest augmentations is O(V E), whatever the capacities.
| [in,out] | net | Flow network (must have a single source and sink). |
Definition at line 2306 of file tpl_net.H.
Referenced by demo_benchmarking(), demonstrate_bipartite_matching(), main(), Aleph::Ford_Fulkerson_Maximum_Flow< Net >::operator()(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Format a matrix by computing column widths.
| [in] | mat | Input matrix. |
Definition at line 984 of file ah-string-utils.H.
References FunctionalMethods< Container, T >::foldl(), format_string(), l, FunctionalMethods< Container, T >::maps(), and zip().
|
inline |
| [in] | lens | parallel row containing the maximum length of each column |
| [in] | mat | matrix of strings to format |
Definition at line 937 of file ah-string-utils.H.
References l, FunctionalMethods< Container, T >::maps(), and zip().
Referenced by format_string(), TEST(), TEST(), and TEST().
|
inline |
Write a formatted matrix to a stream.
| [in,out] | out | Output stream. |
| [in] | lens | Column widths. |
| [in] | mat | Matrix. |
out. Definition at line 957 of file ah-string-utils.H.
References FunctionalMethods< Container, T >::for_each(), out, row, and zip().
|
inline |
Produce a CSV-like matrix (commas added to all but last element in each row).
| [in] | mat | Input matrix. |
"," appended to non-last cells. Definition at line 1007 of file ah-string-utils.H.
References Aleph::DynList< T >::append(), LocateFunctions< Container, Type >::get_it(), Aleph::DynList< T >::get_last(), and row.
Referenced by TEST().
|
inline |
Definition at line 180 of file euclidian-graph-common.H.
References ah_domain_error_if, h, m, Aleph::Gsl_Compatible_Rng::max(), rand_gen, rng, seed, and w.
Generate all sequential tuples (sliding windows) of size n.
Creates a list of lists where each inner list is a consecutive sequence of n elements from the source container. This is a sliding window operation.
| c | Source container. |
| n | Size of each tuple (window size). |
Definition at line 1560 of file ahFunctional.H.
References Aleph::DynList< T >::append(), l, and Aleph::DynList< T >::remove_first().
Referenced by TEST_F().
|
inline |
Generate values for a range.
Assigns the result of successive calls to op to each element in [beg, end).
| Itor | Iterator type. |
| Func | Generator function type. |
| beg | Iterator to the first element. |
| end | Iterator past the last element. |
| op | Generator function. |
Definition at line 746 of file ahAlgo.H.
Referenced by TEST(), and TYPED_TEST().
| Net Aleph::generate_bipartite_network | ( | size_t | left_size, |
| size_t | right_size, | ||
| double | edge_prob = 0.5, |
||
| unsigned | seed = 0 |
||
| ) |
Generate a bipartite network for matching.
Creates a bipartite graph with:
Useful for testing maximum bipartite matching.
| Net | Network type. |
| left_size | Number of nodes on left side. |
| right_size | Number of nodes on right side. |
| edge_prob | Probability of edge between left-right pair. |
| seed | Random seed. |
Definition at line 302 of file net_utils.H.
References Aleph::Net_Graph< NodeT, ArcT >::insert_arc(), Aleph::Net_Graph< NodeT, ArcT >::insert_node(), and seed.
| void Aleph::generate_cross_graph | ( | GT & | g, |
| const size_t & | nodes_by_level, | ||
| const double & | xdist, | ||
| const double & | ydist, | ||
| std::ostream & | out | ||
| ) |
Definition at line 846 of file generate_graph.H.
References out.
| void Aleph::generate_cross_graph | ( | GT & | g, |
| const size_t & | nodes_by_level, | ||
| const double & | xdist, | ||
| const double & | ydist, | ||
| std::ostream & | out | ||
| ) |
Definition at line 962 of file generate_graph.H.
References generate_cross_graph(), and out.
| void Aleph::generate_cross_graph | ( | GT & | g, |
| const size_t & | nodes_by_level, | ||
| const double & | xdist, | ||
| const double & | ydist, | ||
| std::ostream & | out, | ||
| SA | sa = SA() |
||
| ) |
Definition at line 935 of file generate_graph.H.
References generate_cross_graph(), and out.
| Net Aleph::generate_grid_network | ( | size_t | rows, |
| size_t | cols, | ||
| typename Net::Flow_Type | capacity, | ||
| bool | bidirectional = true |
||
| ) |
Generate a grid network.
Creates a rows × cols grid with arcs connecting adjacent nodes. Source is top-left (0,0), sink is bottom-right (rows-1, cols-1).
Grid networks are useful for benchmarking because they have predictable structure and many augmenting paths.
| Net | Network type. |
| rows | Number of rows. |
| cols | Number of columns. |
| capacity | Capacity for all arcs. |
| bidirectional | If true, create arcs in both directions. |
Definition at line 245 of file net_utils.H.
References cols, Aleph::Net_Graph< NodeT, ArcT >::insert_arc(), Aleph::Net_Graph< NodeT, ArcT >::insert_node(), nodes, and rows.
| Net Aleph::generate_layered_network | ( | const std::vector< size_t > & | layer_sizes, |
| typename Net::Flow_Type | capacity, | ||
| double | edge_prob = 0.5, |
||
| unsigned | seed = 0 |
||
| ) |
Generate a layered network.
Creates a network with multiple layers, where each node in layer i is connected to some nodes in layer i+1.
| Net | Network type. |
| layer_sizes | Vector of sizes for each layer. |
| capacity | Arc capacity. |
| edge_prob | Probability of arc between adjacent layers. |
| seed | Random seed. |
Definition at line 364 of file net_utils.H.
References ah_invalid_argument_if, and, Aleph::Net_Graph< NodeT, ArcT >::insert_arc(), Aleph::Net_Graph< NodeT, ArcT >::insert_node(), l, seed, Aleph::DynList< T >::size(), and size().
|
inline |
Generate values for n elements.
Assigns the result of successive calls to op to the first n elements.
| Itor | Iterator type. |
| Size | Integer type. |
| Func | Generator function type. |
| beg | Iterator to the first element. |
| num | Number of elements to generate. |
| op | Generator function. |
Definition at line 766 of file ahAlgo.H.
Referenced by TEST().
| void Aleph::generate_net_graph | ( | GT & | g, |
| const size_t & | nodes_by_level, | ||
| const double & | xdist, | ||
| const double & | ydist, | ||
| std::ostream & | out | ||
| ) |
Definition at line 904 of file generate_graph.H.
References out.
| void Aleph::generate_net_graph | ( | GT & | g, |
| const size_t & | nodes_by_level, | ||
| const double & | xdist, | ||
| const double & | ydist, | ||
| std::ostream & | out | ||
| ) |
Definition at line 975 of file generate_graph.H.
References generate_net_graph(), and out.
| void Aleph::generate_net_graph | ( | GT & | g, |
| const size_t & | nodes_by_level, | ||
| const double & | xdist, | ||
| const double & | ydist, | ||
| std::ostream & | out, | ||
| SA | sa = SA() |
||
| ) |
Definition at line 948 of file generate_graph.H.
References generate_net_graph(), and out.
| Net Aleph::generate_random_network | ( | const NetworkGenParams & | params | ) |
Generate a random flow network.
Creates a network with random topology and capacities. Guarantees that the source can reach the sink if ensure_connected is true.
| Net | Network type. |
| params | Generation parameters. |
Definition at line 135 of file net_utils.H.
References Aleph::NetworkGenParams::ensure_connected, Aleph::Net_Graph< NodeT, ArcT >::insert_arc(), Aleph::Net_Graph< NodeT, ArcT >::insert_node(), Aleph::NetworkGenParams::max_capacity, Aleph::NetworkGenParams::min_capacity, nodes, Aleph::NetworkGenParams::num_arcs, Aleph::NetworkGenParams::num_nodes, seed, and Aleph::NetworkGenParams::seed.
| Net Aleph::generate_random_network | ( | size_t | num_nodes, |
| size_t | num_arcs, | ||
| double | min_cap = 1.0, |
||
| double | max_cap = 100.0, |
||
| unsigned | seed = 0 |
||
| ) |
Generate a random flow network (convenience overload).
| Net | Network type. |
| num_nodes | Number of nodes. |
| num_arcs | Number of arcs. |
| min_cap | Minimum capacity. |
| max_cap | Maximum capacity. |
| seed | Random seed (0 = use time). |
Definition at line 208 of file net_utils.H.
References Aleph::NetworkGenParams::max_capacity, Aleph::NetworkGenParams::min_capacity, Aleph::NetworkGenParams::num_arcs, num_nodes, Aleph::NetworkGenParams::num_nodes, seed, and Aleph::NetworkGenParams::seed.
| Net::Flow_Type Aleph::generic_preflow_vertex_push_maximum_flow | ( | Net & | net, |
| Q_Type | q = Q_Type() |
||
| ) |
Generic preflow-push maximum flow (vertex-oriented).
Q_Type is the active-node container and must support:
The Maximum_Flow bit is used to track whether a node is in the queue.
With a floating flow, the flows of the node that a discharge pushes from are summed keeping what their rounding loses, so that a small flow beside a large one is not lost; an excess of a node up to a residue of rounding of its own flows, an epsilon of the larger of its flows in and out by each of its arcs and two more, is not pushed; and at the end what the nodes keep or lack of it goes back toward the source, or forward toward the sink, so that every node keeps its flow within the tolerance of check_node(), as check_network() takes it, and a network whose maximum flow is 0 gives 0.
An arc of infinite capacity out of the source starts with a bound of the maximum flow, the capacity of the arcs into the sink, if they are finite, or else the sum of the finite capacities: filled with infinity, a node that could not send it on could not send it back either, as inf - inf is NaN, and the flow came out infinite on networks whose maximum flow is finite. A path of arcs of infinite capacity from the source to the sink makes the maximum flow infinite: its arcs take an infinite flow, and the function returns it, as the augmenting paths do.
| [in,out] | net | Flow network (must have a single source and sink). |
| [in] | q | the queue of the active nodes, empty, which the push takes; by default Q_Type(), and with a seed for the random order of random_preflow_maximum_flow(net, seed). |
Definition at line 2526 of file tpl_net.H.
References ah_domain_error_if, and, Aleph::Net_Graph< NodeT, ArcT >::check_network(), Aleph::net_detail::fill_infinite_path(), Aleph::Net_Graph< NodeT, ArcT >::flow_value(), GraphCommon< GT, Node, Arc >::get_connected_node(), get_from_active_queue(), Aleph::Net_Graph< NodeT, ArcT >::get_in_flow(), GraphCommon< GT, Node, Arc >::get_num_arcs(), Aleph::Net_Graph< NodeT, ArcT >::get_out_flow(), Aleph::Net_Graph< NodeT, ArcT >::get_sink(), Aleph::Net_Graph< NodeT, ArcT >::get_source(), GraphCommon< GT, Node, Arc >::get_tgt_node(), Aleph::net_detail::infinite_arc_preflow(), init_height_in_nodes(), Aleph::Net_Graph< NodeT, ArcT >::is_single_sink(), Aleph::Net_Graph< NodeT, ArcT >::is_single_source(), m, Aleph::net_detail::Flow_Sum< Flow_Type >::minus(), Aleph::net_detail::node_flows(), Aleph::net_detail::node_residue(), Aleph::net_detail::not_short(), out, Aleph::net_detail::push_excess(), put_in_active_queue(), GraphCommon< GT, Node, Arc >::reset_nodes(), Aleph::net_detail::return_dust(), Aleph::net_detail::Flow_Sum< Flow_Type >::value(), and GraphCommon< GT, Node, Arc >::vsize().
|
inline |
Converts a Geom_Number to its double precision representation.
| n | The Geom_Number to convert. |
Definition at line 120 of file point.H.
References __gmp_expr< mpq_t, mpq_t >::get_d().
Referenced by Eepic_Plane::compute_geom_plane(), Aleph::Tikz_Plane::compute_mapping(), Aleph::Segment::counterclockwise_angle_with(), Aleph::GeomSerializer::dbl(), Aleph::Tikz_Plane::draw_coordinate_grid(), export_cells_csv(), export_csv(), Eepic_Plane::geom_number_to_plane(), main(), main(), main(), Aleph::Tikz_Plane::map_x(), Aleph::Tikz_Plane::map_x_length(), Aleph::Tikz_Plane::map_y(), Aleph::Tikz_Plane::map_y_length(), SegmentTest::near_equal(), print_point(), print_point(), print_polygon(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), Aleph::ConvexPolygonDistanceGJK::to_double(), Aleph::GeomSerializer::to_geojson(), Aleph::Point::to_string(), Aleph::Polar_Point::to_string(), Aleph::Rectangle::to_string(), Aleph::Ellipse::to_string(), Aleph::RotatedEllipse::to_string(), Aleph::GeomSerializer::to_wkt(), write_polygon_wkt(), write_polygon_wkt(), and write_polygon_wkt().
|
inline |
High-precision pi value for computations that require Geom_Number.
Definition at line 137 of file point.H.
References acos().
Referenced by Aleph::Ellipse::area(), Aleph::RotatedEllipse::area(), Aleph::Segment::counterclockwise_angle_with(), Aleph::Ellipse::perimeter(), and Aleph::RotatedEllipse::sample().
|
inlinenoexcept |
Definition at line 420 of file hash-fct.H.
Referenced by SuperFastHash().
|
inline |
Create an iterator for a raw array.
| T | Element type. |
| array | Pointer to the array. |
| n | Number of elements. |
Definition at line 379 of file array_it.H.
|
inlinestatic |
Return the arc color (stored in ARC_COUNTER).
Definition at line 1878 of file tpl_graph_utils.H.
References ARC_COUNTER.
|
inlinestatic |
Return the node color (stored in NODE_COUNTER).
Definition at line 1871 of file tpl_graph_utils.H.
References NODE_COUNTER.
| auto Aleph::get_curr | ( | ) | const |
Return the current tuple (bounds-checked).
| std::overflow_error | if any underlying iterator is past the end. |
Definition at line 192 of file ah-zip.H.
Referenced by Aleph::Filter_Iterator< Container, It, Show_Item >::find_if(), Aleph::Filter_Iterator< Container, It, Show_Item >::for_each(), Aleph::List_SGraph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::get_current_arc(), Aleph::List_SGraph< __Graph_Node, __Graph_Arc >::Arc_Iterator::get_current_arc(), Aleph::List_SGraph< __Graph_Node, __Graph_Arc >::Node_Iterator::get_current_node(), Aleph::SkipList< Key, Type >::Iterator::get_data(), Aleph::SkipList< Key, Type >::Iterator::get_key(), Aleph::List_SGraph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::get_tgt_node(), Aleph::__iterator< Set_Type >::operator*(), Aleph::SkipList< Key, Type >::Iterator::operator*(), Aleph::__const_iterator< Set_Type >::operator*(), Aleph::__iterator< Set_Type >::operator->(), Aleph::SkipList< Key, Type >::Iterator::operator->(), Aleph::__const_iterator< Set_Type >::operator->(), TEST(), TEST(), and TEST().
Returns current elements as a DynList (requires homogeneous Item_Type)
Definition at line 227 of file ah-zip.H.
References Aleph::DynList< T >::append(), and l.
|
noexcept |
Return the current tuple (unchecked variant).
Return the current tuple, with the index last (unchecked variant).
Requires has_curr().
| what | reading the current items throws, as the get_curr_ne() of the iterator of a container that the user wrote may do even when its items are arithmetic; what copying them throws: the std::bad_alloc of copying a std::string or a DynArray, or what the copy of a type of the user throws; and what moving the items of the other containers throws, as std::tuple_cat() moves them from the tuple of the rest of the zip into this one: an item whose copy cannot throw may have a move that does. |
noexcept only when none of these readings, copies and moves can throw, as with the arithmetic items of the containers of Aleph, so that what they throw reaches the caller instead of ending the program.Requires has_curr().
| what | reading, copying or moving the current items throws, as ZipIterator::get_curr_ne(): the reading of a container that the user wrote may throw even when its items are arithmetic, and std::tuple_cat() moves the items of the other containers, whose move may throw even when their copy cannot. |
noexcept only when none of these readings, copies and moves can throw, as ZipIterator::get_curr_ne(), so that what they throw reaches the caller instead of ending the program. Definition at line 216 of file ah-zip.H.
Referenced by Aleph::List_SGraph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::get_current_arc_ne(), Aleph::List_SGraph< __Graph_Node, __Graph_Arc >::Arc_Iterator::get_current_arc_ne(), Aleph::List_SGraph< __Graph_Node, __Graph_Arc >::Node_Iterator::get_current_node_ne(), Aleph::List_SGraph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::get_tgt_node_ne(), and TEST().
|
inline |
Create an EnumZipIterator over the given containers.
| cs | Containers to zip. |
Definition at line 1394 of file ah-zip.H.
Referenced by t_enum_zip(), and t_enum_zip_eq().
|
inline |
Create an EnumZipIterator positioned at index pos.
| pos | Starting position. |
| c | First container. |
| cs | Additional containers. |
pos positions. Definition at line 1408 of file ah-zip.H.
Referenced by enum_zip_it_pos().
|
inlinestaticnoexcept |
Definition at line 93 of file Huffman.H.
Referenced by Aleph::Huffman_Encoder_Engine::merge_two_nodes().
|
inlinestatic |
Dequeue an active node and clear its queue mark.
Definition at line 2401 of file tpl_net.H.
References Maximum_Flow, and NODE_BITS.
Referenced by generic_preflow_vertex_push_maximum_flow().
|
inline |
Collect results from a list of futures (rvalue overload).
Overload for rvalue references, allowing temporary lists to be passed.
| T | The result type of the futures. |
| [in] | future_list | Temporary list of futures to collect. |
| Any | exception thrown by any of the futures will propagate. |
Definition at line 119 of file future_utils.H.
References get_futures().
|
inline |
Collect results from a list of futures.
Waits for each future in the list to complete and collects all results into a new DynList. The futures are consumed (removed) from the input list in FIFO order.
| T | The result type of the futures. |
| [in,out] | future_list | List of futures to collect. Will be empty after the call. |
| Any | exception thrown by any of the futures will propagate. |
Definition at line 94 of file future_utils.H.
References Aleph::DynList< T >::append().
Referenced by get_futures(), get_futures(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Wait for all void futures to complete (rvalue overload).
Overload for rvalue references, allowing temporary lists to be passed.
| [in] | future_list | Temporary list of void futures to wait for. |
| Any | exception thrown by any of the futures will propagate. |
Definition at line 155 of file future_utils.H.
References get_futures().
|
inline |
Wait for all void futures to complete.
Waits for each void future in the list to complete. Since void futures don't return values, this function simply ensures all async operations have finished. The futures are consumed from the input list.
| [in,out] | future_list | List of void futures to wait for. Will be empty after the call. |
| Any | exception thrown by any of the futures will propagate. |
Definition at line 139 of file future_utils.H.
References Aleph::DynList< T >::remove_first().
| Distance::Distance_Type Aleph::get_min_path | ( | typename GT::Node * | s, |
| typename GT::Node * | end, | ||
| Path< GT > & | path, | ||
| Distance | distance = Distance() |
||
| ) |
Extracts a shortest path from a graph painted by a shortest paths algorithm.
Follows the node cookies, which point to the parent of each node in the painted tree, from end back to s.
| [in] | s | Start node of the painted tree. |
| [in] | end | Destination node of the path. |
| [out] | path | Path where the shortest path is stored. |
| [in] | distance | Distance functor that gives the weight of each arc; it should be the one the tree was painted with. |
| std::invalid_argument | If s or end is null. |
| std::domain_error | If the cookies do not lead from end to s. |
| std::bad_alloc | If there is not enough memory. |
Definition at line 2515 of file tpl_graph_utils.H.
References ah_domain_error_if, ah_invalid_argument_if, Aleph::Path< GT >::append(), Aleph::Path< GT >::empty(), Aleph::Path< GT >::get_graph(), LocateFunctions< Container, Type >::get_it(), Aleph::Path< GT >::init(), Aleph::DynList< T >::insert(), and NODE_COOKIE.
|
inline |
Create a Pair_Iterator for two containers.
Factory function that creates a Pair_Iterator from two containers, automatically deducing the iterator types.
| C1 | Type of first container. |
| C2 | Type of second container. |
| c1 | First container. |
| c2 | Second container. |
Definition at line 1841 of file ahFunctional.H.
References iterator_for().
|
inline |
Overload of get_pair_it with start position.
Definition at line 1850 of file ahFunctional.H.
References iterator_for().
|
inline |
Get arcs with partial flow (0 < flow < cap).
| Net | Network type. |
| [in] | net | Network to scan. |
Definition at line 1123 of file tpl_netcost.H.
References and, and Aleph::DynList< T >::append().
Definition at line 2095 of file htlist.H.
References Aleph::DynList< T >::append().
|
inline |
Create a ZipIterator over the given containers.
| cs | Containers to zip. |
Definition at line 336 of file ah-zip.H.
Referenced by equal_length(), main(), zip_cmp(), zip_for_each_eq(), zip_it(), zip_lists(), and zip_lists_eq().
|
inline |
Create a ZipIterator positioned at index pos.
| pos | Starting position. |
| cs | Containers to zip. |
pos positions. Definition at line 349 of file ah-zip.H.
Referenced by zip_it_pos().
Convert a Gray code number to its binary representation.
The conversion is performed by iteratively XORing the Gray code with right-shifted versions of itself.
| T | Unsigned integral type. |
| g | Gray code number. |
|
inline |
Determines if op1 is greater than or equal to op2 using a comparison operator.
| op1 | First operand |
| op2 | Second operand |
| cmp | Comparison functor |
Definition at line 1077 of file ahFunction.H.
References cmp().
|
inline |
Determines if op1 is greater than op2 using a comparison operator.
| op1 | First operand |
| op2 | Second operand |
| cmp | Comparison functor |
Definition at line 1052 of file ahFunction.H.
References cmp().
| DynList< std::pair< std::invoke_result_t< KeyFunc, const T & >, DynList< T > > > Aleph::group_by | ( | const Container< T > & | c, |
| KeyFunc | key_func | ||
| ) |
Group consecutive elements by a key function.
Partitions a container into groups of consecutive elements that share the same key (as computed by the key function). Each group is a DynList containing all consecutive elements with the same key.
This is similar to Python's itertools.groupby() or SQL's GROUP BY (but only for consecutive elements with the same key).
| T | Element type of the container. |
| Container | Container type (template parameter). |
| KeyFunc | Function type (const T&) -> Key. |
| c | Source container. |
| key_func | Function that extracts the grouping key from each element. |
Definition at line 3034 of file ahFunctional.H.
Referenced by demo_grouping(), group_by_reduce(), TEST(), TEST(), TEST(), TEST(), and TEST().
| DynList< std::pair< std::invoke_result_t< KeyFunc, const T & >, DynList< T > > > Aleph::group_by_eq | ( | const Container< T > & | c, |
| KeyFunc | key_func, | ||
| KeyEqual | key_equal | ||
| ) |
Group consecutive elements by a key function with custom equality.
Like group_by() but uses a custom equality predicate for comparing keys instead of operator==. This is useful when the key type doesn't have operator== defined, or when you need custom comparison semantics.
| T | Element type of the container. |
| Container | Container type (template parameter). |
| KeyFunc | Function type (const T&) -> Key. |
| KeyEqual | Predicate type (const Key&, const Key&) -> bool. |
| c | Source container. |
| key_func | Function that extracts the grouping key from each element. |
| key_equal | Predicate that returns true if two keys are equal. |
Definition at line 3101 of file ahFunctional.H.
| auto Aleph::group_by_reduce | ( | const Container< T > & | c, |
| KeyFunc | key_func, | ||
| Reducer | reducer | ||
| ) | -> DynList< std::pair<std::invoke_result_t<KeyFunc, const T &>, std::invoke_result_t<Reducer, const DynList<T> &>>> |
Group consecutive elements and apply a reducer to each group.
Combines group_by() with a reduction operation. For each group of consecutive elements sharing the same key, applies a reducer function to produce a single output value.
This is similar to SQL's GROUP BY ... aggregate() pattern.
| T | Element type of the container. |
| Container | Container type (template parameter). |
| KeyFunc | Function type (const T&) -> Key. |
| Reducer | Function type (const DynList<T>&) -> R. |
| c | Source container. |
| key_func | Function that extracts the grouping key from each element. |
| reducer | Function that reduces each group to a single value. |
Definition at line 3172 of file ahFunctional.H.
References group_by().
Referenced by TEST().
|
noexcept |
Return true if all underlying iterators are positioned on a valid item.
Return true if all underlying iterators have a current element.
Definition at line 173 of file ah-zip.H.
References and.
Referenced by Aleph::ZipIterator< C >::completed(), Aleph::EnumZipIterator< C >::completed(), compute_maximum_cardinality_bipartite_matching(), Aleph::Filter_Iterator< Container, It, Show_Item >::count(), Aleph::Filter_Iterator< Container, It, Show_Item >::empty(), Aleph::Filter_Iterator< Container, It, Show_Item >::find_if(), Aleph::Filter_Iterator< Container, It, Show_Item >::for_each(), Aleph::Slinknc::Iterator::get_curr(), Aleph::Slinknc::Iterator::next(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inlinenoexcept |
Non-commutative hash combiner (Boost-style golden-ratio mix).
Folds h into seed: seed ^= h + 0x9e3779b97f4a7c15 + (seed << 12) + (seed >> 4)
The magic constant is the nearest prime to 2^64 / phi.
| seed | Accumulator; updated in place. |
| h | Hash value to fold in. |
Definition at line 877 of file hash-fct.H.
Referenced by aleph_hash_value(), UserTypeNS::aleph_hash_value(), Aleph::Aleph_Hash< T >::operator()(), pair_dft_hash_fct(), and pair_snd_hash_fct().
| Net::Flow_Type Aleph::heap_preflow_maximum_flow | ( | Net & | net | ) |
Preflow-push maximum flow using a height-ordered heap.
| [in,out] | net | Flow network (must have a single source and sink). |
Definition at line 2706 of file tpl_net.H.
Referenced by Aleph::Heap_Preflow_Maximum_Flow< Net >::operator()(), and TEST().
Sort a dynamic array using heapsort.
Heapsort uses the heap data structure to sort an array. It first builds a max-heap using Floyd's algorithm (O(n)), then repeatedly extracts the maximum element.
| T | Element type (must be swappable and comparable). |
| Compare | Comparison functor type (default: Aleph::less<T>). |
| [in,out] | a | The dynamic array to sort. |
| cmp | Comparison functor. |
Definition at line 3827 of file tpl_sort_utils.H.
References cmp(), sift_down(), and Aleph::DynArray< T >::size().
|
inlineconstexpr |
Sort an array using the heapsort algorithm.
heapsort(array, n) builds a heap on top of the range and performs repeated extractions. The running time is \(O(n \log n)\) and does not require additional memory.
| T | element type |
| Compare | comparator defining the heap order |
| [in,out] | array | pointer to the first element to sort |
| [in] | n | number of elements in the range |
| [in] | cmp | comparison function (default: Aleph::less<T>) |
Definition at line 335 of file tpl_arrayHeap.H.
References cmp(), Aleph::arrayheap_detail::sift_down(), and Aleph::arrayheap_detail::sift_up().
Referenced by benchmark_array_algorithms(), main(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Heapsort implementation for a subrange of a DynArray.
Sorts the elements in the range [l, r] (inclusive) using the heapsort algorithm.
Time complexity: O(n log n). Space complexity: O(1).
| T | Element type. |
| Compare | Comparison functor. |
| [in,out] | a | The dynamic array. |
| [in] | l | Left index (inclusive). |
| [in] | r | Right index (inclusive). |
| [in] | cmp | Comparison functor. |
Definition at line 4046 of file tpl_sort_utils.H.
References cmp(), l, r, and sift_down_subrange().
| auto Aleph::histogram | ( | const Container & | data, |
| size_t | num_bins | ||
| ) | -> std::vector<std::pair<std::decay_t<decltype(*std::begin(data))>, size_t>> |
Compute a histogram of the data.
| data | Input container |
| num_bins | Number of bins |
| std::invalid_argument | if container is empty or num_bins is 0 |
Definition at line 717 of file stat_utils.H.
References ah_invalid_argument_if, histogram(), min_max(), and range().
Referenced by histogram(), TEST(), TEST(), TEST(), TEST(), TEST(), and Aleph::CA::Reproductions::write_histogram_csv().
|
inlinenoexcept |
Access the excess flow stored in the node's cookie.
Definition at line 1231 of file tpl_maxflow.H.
References NODE_COOKIE.
Access the height label stored in the node's cookie.
Definition at line 1224 of file tpl_maxflow.H.
References NODE_COOKIE.
| Net::Flow_Type Aleph::hlpp_maximum_flow | ( | Net & | net | ) |
Compute maximum flow using Highest-Label Preflow-Push.
This variant of preflow-push always processes the active node with the highest label (distance from sink). This leads to better practical performance than generic preflow-push.
O(V²√E) - often fastest in practice for dense graphs.
With a floating flow, the excess of a node is that of its flows in and out, which each push updates keeping what their rounding loses, so that a small flow beside a large one is not lost; an excess up to a residue of rounding of its own flows, an epsilon of the larger of its flows in and out by each of its arcs and two more, is not pushed; and at the end what the nodes keep or lack of it goes back toward the source, or forward toward the sink, so that every node keeps its flow within the tolerance of check_node(), as check_network() takes it, and a network whose maximum flow is 0 gives 0.
An arc of infinite capacity out of the source starts with a bound of the maximum flow, as in generic_preflow_vertex_push_maximum_flow(): filled with infinity, the flow came out infinite on networks whose maximum flow is finite; and a path of arcs of infinite capacity from the source to the sink makes the maximum flow infinite, which the function returns.
| Net | Network type. |
| net | Flow network. |
Definition at line 1269 of file tpl_maxflow.H.
References ah_domain_error_if, and, Aleph::net_detail::fill_infinite_path(), Aleph::Net_Graph< NodeT, ArcT >::flow_value(), Aleph::DynListQueue< T >::get(), GraphCommon< GT, Node, Arc >::get_connected_node(), GraphCommon< GT, Node, Arc >::get_num_arcs(), Aleph::Net_Graph< NodeT, ArcT >::get_sink(), Aleph::Net_Graph< NodeT, ArcT >::get_source(), GraphCommon< GT, Node, Arc >::get_src_node(), GraphCommon< GT, Node, Arc >::get_tgt_node(), h, Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::has_curr(), Aleph::net_detail::infinite_arc_preflow(), Aleph::DynListQueue< T >::is_empty(), Aleph::Net_Graph< NodeT, ArcT >::is_single_sink(), Aleph::Net_Graph< NodeT, ArcT >::is_single_source(), next(), Aleph::Filter_Iterator< Container, It, Show_Item >::next_ne(), NODE_COOKIE, Aleph::net_detail::node_residue(), out, Aleph::net_detail::push_excess(), Aleph::DynListQueue< T >::put(), Aleph::net_detail::return_dust(), and GraphCommon< GT, Node, Arc >::vsize().
Referenced by main(), Aleph::HLPP_Maximum_Flow< Net >::operator()(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
static |
Definition at line 495 of file tpl_bipartite.H.
References dfs_frame(), dfs_replace(), hopcroft_karp_match(), hopcroft_karp_next(), next(), and NODE_COUNTER.
|
inlinenoexcept |
Definition at line 476 of file tpl_bipartite.H.
References GraphCommon< GT, Node, Arc >::get_connected_node(), NODE_COOKIE, and NODE_COUNTER.
Referenced by hopcroft_karp_dfs().
|
inlinenoexcept |
Definition at line 446 of file tpl_bipartite.H.
References GraphCommon< GT, Node, Arc >::get_connected_node(), NODE_COOKIE, and NODE_COUNTER.
Referenced by hopcroft_karp_dfs().
| auto Aleph::ida_star_search | ( | Domain | domain, |
| typename Domain::State | initial_state, | ||
| ExplorationPolicy | policy = {}, |
||
| SearchLimits | limits = {} |
||
| ) |
Convenience wrapper for a one-shot IDA* search.
Definition at line 462 of file State_Search_IDA_Star.H.
References ida_star_search().
Referenced by ida_star_search(), and ida_star_search().
| auto Aleph::ida_star_search | ( | Domain | domain, |
| typename Domain::State | initial_state, | ||
| OnSolution & | on_solution, | ||
| ExplorationPolicy | policy = {}, |
||
| SearchLimits | limits = {} |
||
| ) |
Convenience wrapper for IDA* with a solution callback.
Definition at line 474 of file State_Search_IDA_Star.H.
References ida_star_search().
Import network from DIMACS max-flow format.
| Net | Network type. |
| filename | Input filename. |
| std::runtime_error | If file cannot be opened or parsed: a line whose fields cannot be read, a second problem line, a node or arc line before the problem line, or a node number outside [1, n]. |
Definition at line 869 of file net_utils.H.
References ah_runtime_error_if, and, OhashCommon< HashTbl, Key >::append(), Aleph::Net_Graph< NodeT, ArcT >::insert_arc(), Aleph::Net_Graph< NodeT, ArcT >::insert_node(), m, and nodes.
|
inline |
Classify point p against circumcircle of triangle (a,b,c), exactly.
Definition at line 2943 of file point.H.
References CCW, COLLINEAR, DEGENERATE, in_circle_determinant(), INSIDE, ON_CIRCLE, orientation(), and OUTSIDE.
Referenced by scenario_in_circle_in_delaunay_context(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST_F().
|
inline |
Return the exact in-circle determinant for (a,b,c,p).
The sign depends on triangle orientation (a,b,c).
Definition at line 2923 of file point.H.
References Aleph::Point::get_x(), and Aleph::Point::get_y().
Referenced by check_delaunay_for_non_constrained(), Aleph::DelaunayTriangulationRandomizedIncremental::in_cc(), in_circle(), Aleph::ConstrainedDelaunayTriangulation::lawson_flip(), Aleph::DelaunayTriangulationBowyerWatson::point_in_circumcircle(), and TEST().
|
inline |
Definition at line 896 of file ahSort.H.
References cmp(), and in_place_multisort_arrays().
|
inline |
Sorts multiple arrays in place, using the first array as the key.
This function sorts multiple arrays together, keeping them synchronized. The first array provides the sort keys, and all other arrays are rearranged to maintain the correspondence between elements.
By default this uses stable sort, preserving relative order of equal elements. You can disable stability to reduce time and memory overhead.
| C | Container type for the first array (must have operator[], size()) |
| Args | Container types for additional arrays |
| Cmp | Comparison functor type (default: std::less) |
| cmp | Comparison functor for elements of the first array |
| stable | If true, preserve the relative order of equal keys. |
| first | The array providing sort keys (modified in place) |
| args | Additional arrays to sort in sync (modified in place) |
| std::invalid_argument | if arrays have different sizes |
Definition at line 842 of file ahSort.H.
References ah_invalid_argument_if, cmp(), Aleph::Array< T >::create(), introsort(), mergesort(), and swap().
Referenced by in_place_multisort_arrays(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), and TEST_F().
Sorts an Array in place.
Modifies the array directly without creating a copy.
| T | Element type |
| Cmp | Comparison functor type |
| c | The array to sort (modified in place) |
| cmp | Comparison functor |
Definition at line 339 of file ahSort.H.
References cmp(), and introsort().
Sorts a DynArray in place.
Modifies the array directly without creating a copy.
| T | Element type |
| Cmp | Comparison functor type |
| c | The array to sort (modified in place) |
| cmp | Comparison functor |
Definition at line 328 of file ahSort.H.
References cmp(), and introsort().
Referenced by Aleph::Floyd_All_Shortest_Paths< GT, Distance, SA >::Floyd_All_Shortest_Paths(), Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::_collect_sorted_primitive_factor_groups(), benchmark_list_algorithms(), K2Tree< T >::build(), Aleph::MonotonePolygonTriangulation::build_faces_from_diagonals(), Aleph::blossom_weighted_detail::mwmatching::impl::check_input_graph(), compute_maximum_weight_general_matching(), compute_stats(), LLVMFuzzerTestOneInput(), Aleph::TrapezoidalMapPointLocation::operator()(), percentile(), pollard_rho(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
In-place transpose of a rectangular matrix stored as a nested container.
Transposes the matrix by moving elements. The matrix is represented as a container of containers (e.g., Array<Array<T>>).
| C | Container template (must support size(), append(), swap(), and random access). |
| T | Element type. |
| [in,out] | l | Matrix to transpose in-place. |
Definition at line 294 of file ah-comb.H.
References Aleph::DynList< T >::get_first(), l, row, Aleph::DynList< T >::size(), size(), and Aleph::DynList< T >::swap().
Referenced by demo_transpose(), test(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
In-place transpose of a matrix stored as DynList<DynList<T>>.
This overload preserves list nodes by physically moving the internal Slinknc nodes instead of copying values.
| T | Element type. |
| [in,out] | l | Matrix to transpose. |
l is empty, the function is a no-op. Definition at line 332 of file ah-comb.H.
References Aleph::Array< T >::append(), Aleph::DynList< T >::append(), col, Aleph::HTList::is_empty(), l, Aleph::DynList< T >::remove_first(), Aleph::DynList< T >::remove_head(), Aleph::Array< T >::reserve(), and row.
| void Aleph::in_place_unique | ( | Container & | c, |
| Compare | cmp = {} |
||
| ) |
Remove duplicates in-place preserving first occurrence order.
| Container | AlephSequential container type (Array, DynArray, DynList, DynDlist). |
| Compare | Strict weak ordering on Key_Type (defaults to std::less<Key>). |
| c | Container to deduplicate. |
| cmp | Comparator for keys. |
Definition at line 74 of file ah-unique.H.
Referenced by Aleph::MonotonePolygonTriangulation::build_faces_from_diagonals(), TEST(), and TEST().
|
inline |
Test if one sorted range includes another.
Tests whether all elements in [searchBeg, searchEnd) are contained in the sorted range [beg, end).
| Itor1 | Main range iterator type. |
| Itor2 | Search range iterator type. |
| beg | Iterator to the first element of the main range. |
| end | Iterator past the last element of the main range. |
| searchBeg | Iterator to the first element of the search range. |
| searchEnd | Iterator past the last element of the search range. |
Definition at line 1373 of file ahAlgo.H.
References and.
| void Aleph::increase_flow | ( | Net & | net, |
| const DynList< Parc< Net > > & | semi_path, | ||
| const typename Net::Flow_Type | slack | ||
| ) |
Increase flow along a semi-path by a given slack.
With a floating type of flow, a flow that rounding leaves next to the capacity of its arc, or next to zero, is set to it. A node may then keep or lack a residue of rounding beyond the tolerance of check_node(), when its flows are such residues, which came from arcs of larger flows: aumenting_path_maximum_flow() returns them at its end.
| [in,out] | net | Flow network to update. |
| [in] | semi_path | Semi-path arc list. |
| [in] | slack | Slack to apply (not validated). |
Definition at line 1763 of file tpl_net.H.
References Aleph::net_detail::add_flow(), Aleph::Net_Graph< NodeT, ArcT >::check_network(), and Aleph::net_detail::subtract_flow().
| Net::Flow_Type Aleph::increase_flow | ( | Net & | net, |
| const Path< Net > & | path | ||
| ) |
Increase flow along an augmenting path.
With a floating type of flow, a flow that rounding leaves next to the capacity of its arc, or next to zero, is set to it.
| [in,out] | net | Flow network to update. |
| [in] | path | Augmenting path. |
Definition at line 1714 of file tpl_net.H.
References Aleph::net_detail::add_flow(), Aleph::Path< GT >::Iterator::has_current_arc(), Aleph::Net_Graph< NodeT, ArcT >::Infinity, Aleph::net_detail::subtract_flow(), Tuple, and w.
Referenced by TEST(), TEST(), and TYPED_TEST().
|
inlinestaticnoexcept |
Definition at line 98 of file Huffman.H.
Referenced by Aleph::Huffman_Encoder_Engine::update_freq().
|
inline |
Return pairs of (index, key).
Definition at line 1480 of file ahFunctional.H.
Definition at line 502 of file tpl_binNodeUtils.H.
References Aleph::DynList< T >::append(), infix(), LLINK, RLINK, and root().
| void Aleph::infix_for_each | ( | Node * | root, |
| Op | op | ||
| ) |
Traverse all the container and performs an operation on each element.
for_each(operation) traverses the container and on each element item is performed operation(item).
operation must have the following signature:
void operation(Node * p)
Overloading of this method allow that the signature can be lightly different; for example, remove the reference or the const.
| root | ||
| [in] | op | operation to be done on each element. |
| anything | that can throw operation |
Definition at line 3226 of file tpl_binNodeUtils.H.
References Aleph::BinNodeInfixIterator< Node >::has_curr(), and root().
| Aleph::Init_Guard | ( | CleanupFunc | ) | -> Init_Guard< CleanupFunc > |
Deduction guide for Init_Guard.
Initialize node heights with BFS distance to the sink.
Definition at line 2378 of file tpl_net.H.
References Aleph::Net_Graph< NodeT, ArcT >::get_sink(), and GraphCommon< GT, Node, Arc >::get_tgt_node().
Referenced by generic_preflow_vertex_push_maximum_flow().
|
inline |
Convert an initializer_list to an Array.
Creates a new Array containing copies of all elements from the given initializer_list.
| T | The element type. |
| il | The source initializer_list. |
Definition at line 810 of file ah-convert.H.
References Aleph::Array< T >::append().
Referenced by TEST().
Convert an initializer_list to a DynArray.
Creates a new DynArray containing copies of all elements from the given initializer_list.
| T | The element type. |
| il | The source initializer_list. |
Definition at line 835 of file ah-convert.H.
References Aleph::DynArray< T >::append().
Referenced by TEST().
Convert an initializer_list to a DynDlist.
Creates a new DynDlist containing copies of all elements from the given initializer_list.
| T | The element type. |
| il | The source initializer_list. |
Definition at line 860 of file ah-convert.H.
References Aleph::DynDlist< T >::append().
Convert an initializer_list to a DynList.
Creates a new DynList containing copies of all elements from the given initializer_list.
| T | The element type. |
| il | The source initializer_list. |
Definition at line 785 of file ah-convert.H.
References Aleph::DynList< T >::append().
Referenced by TEST().
|
inline |
Initialize token scanning by recording current position.
Call this before starting to read a new token. It saves the current line and column numbers so that error messages can report where the token began.
Definition at line 232 of file parse_utils.H.
References current_col_number, current_line_number, previous_col_number, and previous_line_number.
Referenced by expect(), get_token(), load_binary_number(), load_char_literal(), load_deway_number(), load_double(), load_escaped_string(), load_hex_number(), load_identifier(), load_number(), load_octal_number(), load_string(), and TEST().
|
inline |
Compute inner product of two ranges.
Computes the inner product of elements from [beg1, end1) with elements starting at beg2, initialized with initValue.
| Itor1 | First range iterator type. |
| Itor2 | Second range iterator type. |
| T | Accumulator type. |
| beg1 | Iterator to the first element of the first range. |
| end1 | Iterator past the last element of the first range. |
| beg2 | Iterator to the first element of the second range. |
| initValue | Initial value for the accumulation. |
|
inline |
Compute inner product with custom operations.
Computes a generalized inner product using op1 for accumulation and op2 for combining element pairs.
| Itor1 | First range iterator type. |
| Itor2 | Second range iterator type. |
| T | Accumulator type. |
| BinaryFunc1 | Accumulation operation type. |
| BinaryFunc2 | Combination operation type. |
| beg1 | Iterator to the first element of the first range. |
| end1 | Iterator past the last element of the first range. |
| beg2 | Iterator to the first element of the second range. |
| initValue | Initial value for the accumulation. |
| op1 | Binary operation for accumulation. |
| op2 | Binary operation for combining element pairs. |
|
inlinenoexcept |
See inorder_position().
Definition at line 271 of file tpl_binNodeXt.H.
References cmp(), inorder_position(), and r.
|
inlinenoexcept |
See inorder_position().
Definition at line 261 of file tpl_binNodeXt.H.
References cmp(), inorder_position(), and r.
|
inlinenoexcept |
See inorder_position().
Definition at line 251 of file tpl_binNodeXt.H.
References cmp(), inorder_position(), and r.
|
inline |
Definition at line 162 of file tpl_binNodeUtils.H.
References inorder_rec_helper(), LLINK, and RLINK.
Referenced by inorder_rec_helper(), and inOrderRec().
|
inlinenoexcept |
See insert_by_key_xt(Node *& r, Node * p, Compare & cmp).
Definition at line 442 of file tpl_binNodeXt.H.
References cmp(), insert_by_key_xt(), and r.
|
inlinestatic |
|
inlinenoexcept |
See insert_dup_by_key_xt(Node *& r, Node * p, Compare & cmp).
Definition at line 480 of file tpl_binNodeXt.H.
References cmp(), insert_dup_by_key_xt(), and r.
|
inlinenoexcept |
See insert_dup_root_xt(Node *& root, Node * p, Compare & cmp).
Definition at line 801 of file tpl_binNodeXt.H.
References cmp(), insert_dup_root_xt(), and root().
|
inline |
Insert multiple items into a container.
Each item is passed to c.insert(), in argument order; an rvalue is moved.
insert() returns a null pointer then). Definition at line 1915 of file ahFunctional.H.
|
inlinenoexcept |
See insert_root_xt(Node *& root, Node * p, Compare & cmp).
Definition at line 762 of file tpl_binNodeXt.H.
References cmp(), insert_root_xt(), and root().
|
inlinestatic |
|
inline |
Inserts a node orderly into a doubly linked list.
insert_sorted(list,p) inserts into a list based on Dlink the node pointed to by p.
The ordering criterion is given by the comparison class Compare.
| [in,out] | list | the list to which p will be inserted. |
| [in] | p | the node to be inserted. |
| cmp | comparison object. |
Definition at line 968 of file tpl_sort_utils.H.
References and, cmp(), Aleph::Dlink::get_last(), Aleph::Dlink::get_prev(), and Aleph::Dlink::insert().
|
inline |
Definition at line 979 of file tpl_sort_utils.H.
References ah_logic_error, Aleph::HTList::append(), cmp(), Aleph::HTList::Iterator::get_curr(), Aleph::HTList::get_first(), Aleph::HTList::get_last(), Aleph::HTList::Iterator::has_curr(), Aleph::HTList::insert(), Aleph::Slinknc::insert(), Aleph::HTList::is_empty(), Aleph::HTList::Iterator::next(), and Aleph::HTList::Iterator::next_ne().
|
inline |
See insertion_sort().
Definition at line 3607 of file tpl_sort_utils.H.
References cmp(), and insertion_sort().
|
inline |
Sorts a dynamic array by the insert method.
insertion_sort(a) uses the selection method to sort the dynamic arrangement a.
The insert method has a performance of \(O(n^2)\). It is a simple method, so it consumes little constant time. On average, it performs half as many exchanges as the method of selection. Its time tends to be linear if the arrangement is semi-ordered. It is a good method for small arrangements and for partitions made by superior methods but with longer constant times.
The method uses two type parameters:
| [in,out] | a | the array to sort. |
| [in] | l | left index of the array art to be would you like to order |
| [in] | r | right index of the desired part of the array order. |
| cmp | comparison object. |
Definition at line 3589 of file tpl_sort_utils.H.
Insertion sort for Dnode-based lists.
| T | Element type. |
| Compare | Comparison functor. |
| [in,out] | list | The list to sort. |
| [in] | cmp | Comparison functor. |
Definition at line 1097 of file tpl_sort_utils.H.
References cmp().
Insertion sort for DynDlist.
Without it, a DynDlist would take the template of the arrays.
| T | Element type. |
| Compare | Comparison functor. |
| [in,out] | list | The list to sort. |
| [in] | cmp | Comparison functor. |
Definition at line 1114 of file tpl_sort_utils.H.
References cmp().
Insertion sort for DynList (rvalue overload).
Moves the input list into the sorted result. Useful for sorting temporary lists efficiently.
| T | Element type. |
| Compare | Comparison functor. |
| [in,out] | l | The list to sort (rvalue). |
| [in] | cmp | Comparison functor. |
Definition at line 1081 of file tpl_sort_utils.H.
Insertion sort for DynList.
| T | Element type. |
| Compare | Comparison functor. |
| [in,out] | l | The list to sort. |
| [in] | cmp | Comparison functor. |
Definition at line 1062 of file tpl_sort_utils.H.
|
inlinenoexcept |
Sort an array using insertion sort.
Insertion sort builds the sorted array one element at a time by repeatedly taking the next element and inserting it into its correct position among the previously sorted elements.
For each element from position l+1 to r:
| T | Element type (must be copy-assignable and comparable). |
| Compare | Comparison functor type (default: Aleph::less<T>). |
| [in,out] | a | Pointer to the array to sort. |
| [in] | l | Left index (inclusive) of the range to sort. |
| [in] | r | Right index (inclusive) of the range to sort. |
| cmp | Comparison functor; cmp(x, y) returns true if x < y. |
Definition at line 938 of file tpl_sort_utils.H.
References and, cmp(), l, and r.
Referenced by benchmark_array_algorithms(), benchmark_list_algorithms(), insertion_sort(), introsort(), quicksort(), quicksort_op(), TEST(), TEST(), and TEST_F().
|
inlinestatic |
Definition at line 3169 of file tpl_sort_utils.H.
References and, cmp(), l, and r.
Referenced by __random_select(), and __random_select().
|
inline |
Return intersection of two containers as a DynList.
Definition at line 1075 of file tpl_dynSetHash.H.
References Aleph::DynHashTable< Key, HashTable, Cmp >::contains(), and FunctionalMethods< Container, T >::filter().
Referenced by Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::_build_affine_factor(), Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::_build_affine_factor_from_linear_data(), Aleph::Convex_Hull_Trick< T >::add_line(), Aleph::Li_Chao_Tree< T >::add_line(), Aleph::Bloom_Filter< T >::common_hashes(), and TEST().
|
inlinenoexcept |
Definition at line 1269 of file tpl_binNodeUtils.H.
References internal_path_length_helper(), LLINK, and RLINK.
Referenced by internal_path_length(), and internal_path_length_helper().
|
inline |
Basic linear interpolation.
This function receives a pair of points in a plane plus a x point and computes the value of f(x) through linear interpolation
| [in] | x1 | minimum in x |
| [in] | x2 | maximum in x |
| [in] | y1 | value of f(x1) |
| [in] | y2 | value of f(x2) |
| [in] | x | for which f(x) should be computed |
x2 > x1 and x in [x1, x2]. Definition at line 367 of file ahUtils.H.
Referenced by TEST().
|
inlinenoexcept |
Stable debug name for one control-flow outcome.
Definition at line 133 of file Interpreter_Runtime.H.
References Break, Continue, None, Return, and Runtime_Error.
Referenced by Aleph::Compiler_Driver_Detail::render_run_result().
|
inline |
Dumps one environment deterministically.
| env | Environment to render. |
Definition at line 1541 of file Interpreter_Runtime.H.
References Aleph::Interpreter_Environment::bindings(), interpreter_value_to_string(), out, and size().
|
inline |
Dumps the globals currently installed in one runtime.
Definition at line 1554 of file Interpreter_Runtime.H.
References Aleph::Interpreter_Environment::bindings(), Aleph::Interpreter_Runtime::global_environment(), interpreter_value_to_string(), out, and size().
Referenced by Aleph::Compiler_Driver::execute_hir_runtime(), Aleph::Compiler_Generic_Driver::execute_hir_runtime(), main(), TEST(), and TEST().
|
inlinenoexcept |
Stable debug name for one runtime value kind.
Definition at line 105 of file Interpreter_Runtime.H.
References Bool, Character, Function, Host_Function, Integer, Invalid, String, Tuple, and Unit.
Referenced by Aleph::Interpreter_Runtime::call_value(), Aleph::Interpreter_Runtime::require_bool(), and Aleph::Interpreter_Runtime::require_integer().
|
inline |
Formats one runtime value deterministically for dumps and tests.
| value | Runtime value to render. |
Definition at line 485 of file Interpreter_Runtime.H.
References Bool, Character, Function, Host_Function, Integer, interpreter_value_to_string(), Invalid, out, size(), String, Tuple, Unit, and value.
Referenced by compiler_bytecode_value_to_string(), Aleph::Compiler_Driver::execute_hir_runtime(), Aleph::Compiler_Generic_Driver::execute_hir_runtime(), interpreter_dump_environment(), interpreter_dump_globals(), interpreter_value_to_string(), main(), and TEST().
|
inline |
Returns whether two runtime values compare equal.
Tuples are compared element-wise. Function values compare by the underlying function pointer and captured environment pointer.
| lhs | Left runtime value. |
| rhs | Right runtime value. |
true when the runtime values compare equal. Definition at line 436 of file Interpreter_Runtime.H.
References Aleph::DynArray< T >::access(), and, Bool, Aleph::Interpreter_Value::bool_value, Character, Aleph::Interpreter_Value::character_value, Aleph::Interpreter_Value::closure_environment, Function, Aleph::Interpreter_Value::function, Host_Function, Aleph::Interpreter_Value::host_function, Aleph::Interpreter_Value::host_user_data, Integer, Aleph::Interpreter_Value::integer_value, interpreter_values_equal(), Invalid, Aleph::Interpreter_Value::kind, Aleph::DynArray< T >::size(), size(), String, Aleph::Interpreter_Value::string_value, Tuple, Aleph::Interpreter_Value::tuple_elements(), and Unit.
Referenced by compiler_bytecode_values_equal(), Aleph::Interpreter_Runtime::evaluate_expr(), and interpreter_values_equal().
|
inline |
Definition at line 109 of file point_utils.H.
References intersect_improp(), and Aleph::Point::is_between().
Referenced by intersect_improp().
|
inline |
Definition at line 117 of file point_utils.H.
References intersectp(), and segments_intersect().
Referenced by intersectp().
| T | Element type. |
| Compare | Comparison functor. |
| [in,out] | arr | Array to sort. |
| [in] | cmp | Comparison functor. |
Definition at line 2500 of file tpl_sort_utils.H.
References cmp(), introsort(), and Aleph::Array< T >::size().
Sort a dynamic array using introsort (introspective sort).
Introsort is a hybrid sorting algorithm that combines quicksort, heapsort, and insertion sort. It provides guaranteed O(n log n) worst-case performance while maintaining quicksort's excellent average-case performance.
This is the recommended general-purpose sorting algorithm.
The pivot of each partition is the median of the first, the middle and the last items of its range.
| T | Element type. |
| Compare | Comparison functor type (default: Aleph::less<T>). |
| [in,out] | a | The dynamic array to sort. |
| cmp | Comparison functor. |
Main introsort loop with depth limit.
Definition at line 4136 of file tpl_sort_utils.H.
References cmp(), insertion_sort(), introsort_depth_limit(), Quicksort_Threshold, and Aleph::DynArray< T >::size().
|
inline |
Sort an array using introsort (introspective sort).
Sorts a[l..r] with pattern-defeating quicksort (O. R. L. Peters, 2021), an introsort that adapts to the patterns of its input.
On random input it takes from a third (numbers, pointers, small records) to four fifths (strings) of the time of std::sort of libstdc++, and less than it on sorted, reversed, nearly sorted or repeated input.
| T | Element type (must be movable and comparable). |
| Compare | Comparison functor type (default: Aleph::less<T>). |
| [in,out] | a | Pointer to the array to sort. |
| [in] | l | Left index (inclusive) of the range to sort. |
| [in] | r | Right index (inclusive) of the range to sort. |
| cmp | Comparison functor. |
| Anything | that cmp throws; a[l..r] then holds its items in some order, as long as moving a T does not throw. |
Definition at line 2427 of file tpl_sort_utils.H.
References cmp(), l, r, and Aleph::pdq_detail::sort_loop().
Referenced by benchmark_array_algorithms(), benchmark_contiguous_array(), compute_stats(), demonstrate_complexity(), in_place_multisort_arrays(), in_place_sort(), in_place_sort(), introsort(), introsort(), introsort(), main(), Aleph::Gen_Mo_On_Trees< GT, Policy >::mo_sweep(), Aleph::Gen_Mo_On_Tree_Node< T, Policy >::mo_sweep(), Aleph::Gen_Mo_On_Trees< GT, Policy >::path_solve(), Aleph::Gen_Mo_On_Tree_Node< T, Policy >::path_solve(), Aleph::RTree< Payload, MaxEntries, MinEntries, Variant >::reinsert_farthest(), Aleph::net_detail::return_dust(), Aleph::RTree< Payload, MaxEntries, MinEntries, Variant >::rstar_split(), Aleph::Gen_Mo_Algorithm< T, Policy >::solve(), sort(), sort(), sort(), sort(), Aleph::suffix_structures_detail::sort_matches(), sort_ranked_moves(), subset_sum_mitm(), and TEST().
|
inline |
Sort an array using introsort (convenience overload).
This overload sorts the entire array [0, n-1].
| [in,out] | a | Pointer to the array to sort. |
| [in] | n | Number of elements in the array. |
| cmp | Comparison functor. |
Definition at line 2449 of file tpl_sort_utils.H.
References cmp(), and introsort().
Sort a range using introsort (STL-style iterator interface).
This overload provides an STL-compatible interface using begin/end pointers, similar to std::sort(begin, end).
| T | Element type (must be swappable and comparable). |
| Compare | Comparison functor type (default: Aleph::less<T>). |
| [in] | begin | Pointer to the first element. |
| [in] | end | Pointer to one past the last element. |
| cmp | Comparison functor. |
Definition at line 2484 of file tpl_sort_utils.H.
References cmp(), and introsort().
|
inlinenoexcept |
Forward declaration.
Compute the depth limit for introsort.
Returns 2 * floor(log2(n)), which is the maximum recursion depth before introsort switches to heapsort.
| n | The number of elements. |
Definition at line 1885 of file tpl_sort_utils.H.
Referenced by introsort(), quicksort(), quicksort(), and quicksort_op().
| void Aleph::introsort_loop | ( | DynArray< T > & | a, |
| long | l, | ||
| long | r, | ||
| size_t | depth_limit, | ||
| const Compare & | cmp | ||
| ) |
Internal recursive function for introsort on DynArray.
Definition at line 4071 of file tpl_sort_utils.H.
References cmp(), l, Aleph::sort_utils_detail::median_of_three_to_last(), partition(), Quicksort_Threshold, and r.
| void Aleph::introsort_loop | ( | T * | a, |
| long | l, | ||
| long | r, | ||
| size_t | depth_limit, | ||
| const Compare & | cmp | ||
| ) |
Quicksort loop with a depth limit, after which heapsort sorts the range: the loop of introsort() before pattern-defeating quicksort.
Definition at line 1902 of file tpl_sort_utils.H.
References cmp(), faster_heapsort(), l, Quicksort_Threshold, and r.
| void Aleph::iota | ( | C & | container, |
| typename C::Item_Type | start | ||
| ) |
Fill all elements of a container with unit-step sequential values.
Assigns start, start+1, start+2, … to successive elements of container in traversal order (front to back). The container size is unchanged; if it is empty this is a no-op.
Analogous to std::iota but for Aleph-w sequential containers.
| C | Container type satisfying AlephSequentialContainer. Additionally, C::Item_Type must support prefix ++. |
| [in,out] | container | Container whose elements are overwritten. |
| [in] | start | First value written to the first element. |
Definition at line 499 of file ahFunctional.H.
Referenced by RankTreeTest< Tree >::SetUp(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and test_sorted_ascending().
| void Aleph::iota | ( | C & | container, |
| typename C::Item_Type | start, | ||
| const typename C::Item_Type | step | ||
| ) |
Fill all elements of a container with custom-step sequential values.
Assigns start, start + step, start + 2*step, … to successive elements of container in traversal order. The container size is unchanged; if it is empty this is a no-op.
| C | Container type satisfying AlephSequentialContainer. Additionally, C::Item_Type must support +=. |
| [in,out] | container | Container whose elements are overwritten. |
| [in] | start | First value written to the first element. |
| [in] | step | Increment added after each element. |
Definition at line 534 of file ahFunctional.H.
| auto Aleph::iqr | ( | const Container & | data | ) | -> std::decay_t<decltype(*std::begin(data))> |
Compute the interquartile range (IQR = Q3 - Q1).
| data | Input container |
Definition at line 426 of file stat_utils.H.
References iqr(), and percentile().
|
inlinestatic |
Return true if the arc is marked as a cross-arc by paint_subgraphs().
Definition at line 1822 of file tpl_graph_utils.H.
References ARC_COUNTER, and Cross_Arc.
|
inlinestatic |
Return true if the node is marked as an articulation point.
Definition at line 1829 of file tpl_graph_utils.H.
|
inlinestatic |
Return true if the arc is marked as a cut-arc (between cut nodes).
Definition at line 1836 of file tpl_graph_utils.H.
|
inlinestatic |
Return true if the arc has a positive color.
Definition at line 1850 of file tpl_graph_utils.H.
References ARC_COUNTER.
Verify if tree rooted at p is a valid AVL tree with correct counters.
| p | root of tree to verify |
Definition at line 124 of file avlNodeRk.H.
References checked_avl_height_rk().
Referenced by TEST(), TEST(), and Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::verify().
Definition at line 76 of file point_utils.H.
References area_of_parallelogram(), and is_clockwise().
Referenced by is_clockwise().
Check if a node's cookie is properly initialized for Dinic's algorithm.
Validates that NODE_COOKIE points to a valid Dinic_Node_Info structure.
| Net | Network type. |
| p | Pointer to network node. |
| none |
Definition at line 199 of file tpl_maxflow.H.
References NODE_COOKIE.
|
inline |
Check whether a std::string fully parses as a finite double.
Parses using std::strtod and requires that the entire std::string is consumed. Values that overflow/underflow (ERANGE) are rejected.
| [in] | str | Input std::string. |
true if str fully parses as a double and is in range. Definition at line 485 of file ah-string-utils.H.
References and.
Referenced by demo_validation(), TEST(), and TEST().
Variadic check for equality against multiple values.
Tests if a value equals any of the provided comparison values. Short-circuits on first match.
| T | Type of value to test. |
| val | Value to compare (no comparisons, returns false). |
Definition at line 2164 of file ahFunctional.H.
Referenced by is_equal(), and TEST().
|
inline |
Overload of is_equal.
| val | Value to compare. |
| rhs | First comparison value. |
| args | Additional comparison values. |
Definition at line 2177 of file ahFunctional.H.
References is_equal().
|
inline |
Return true if n is even.
Definition at line 106 of file ahUtils.H.
Referenced by demo_predicates(), is_odd(), main(), TEST(), and Aleph::Random_Graph< GT, Init_Node, Init_Arc >::update_parity_after_arc_insertion().
|
inline |
Check whether a std::string fully parses as a finite float.
Parses using std::strtof and requires that the entire std::string is consumed. Values that overflow/underflow (ERANGE) are rejected.
| [in] | str | Input std::string. |
true if str fully parses as a float and is in range. Definition at line 504 of file ah-string-utils.H.
References and.
Referenced by TEST().
Check if a value is present in a list.
Linear search through the list to find the value.
| T | Element type (must support operator==). |
| val | Value to search for. |
| values | List to search in. |
Definition at line 2138 of file ahFunctional.H.
Referenced by TEST().
| bool Aleph::is_inversely_sorted | ( | const Container< T > & | cont, |
| const Compare & | cmp = Compare() |
||
| ) |
Check if a container is sorted in descending order.
Tests whether all elements in the container are arranged in non-increasing order according to the comparison functor.
Time complexity: O(n), where n is the container size.
| Container | Template container type. |
| T | Element type stored in the container. |
| Compare | Comparison functor type (default: Aleph::less<T>). |
| cont | The container to check. |
| cmp | Comparison functor defining "less than" relationship. |
true if container is empty or inversely sorted; false otherwise.Definition at line 248 of file tpl_sort_utils.H.
References cmp(), Aleph::Const_Iterator< It >::get_curr(), Aleph::Const_Iterator< It >::has_curr(), and Aleph::Const_Iterator< It >::next_ne().
|
inline |
Check if a string is in a list of keywords.
| [in] | s | The string to check |
| [in] | keywords | Vector of keywords to match against |
Definition at line 1251 of file parse_utils.H.
References is_keyword().
Referenced by is_keyword(), TEST(), and TEST().
|
inlinestaticnoexcept |
Definition at line 109 of file Huffman.H.
References and, LLINK, and RLINK.
Referenced by Aleph::Huffman_Encoder_Engine::build_prefix_encoding(), Aleph::Huffman_Decoder_Engine::decode(), Aleph::Huffman_Encoder_Engine::generate_huffman_tree(), QuadTree::join(), Aleph::Huffman_Encoder_Engine::load_leaf_keys_in_prefix(), Aleph::Huffman_Encoder_Engine::merge_two_nodes(), Aleph::Huffman_Encoder_Engine::Get_Key::operator()(), Aleph::Huffman_Encoder_Engine::Load_Key::operator()(), Aleph::Huffman_Encoder_Engine::save_leaf_keys_in_prefix(), TEST(), TEST(), and Aleph::Huffman_Encoder_Engine::undo_generation().
|
inlinenoexcept |
Return true if the provided year is a leap year.
Definition at line 65 of file ah-date.H.
References and.
Referenced by TEST(), and valid_day().
|
inline |
Check whether a std::string fully parses as a long.
Parses using std::strtol and requires that the entire std::string is consumed. Values that overflow/underflow (ERANGE) are rejected.
| [in] | str | Input std::string. |
true if str fully parses as a long and is in range. Definition at line 523 of file ah-string-utils.H.
Referenced by demo_validation(), TEST(), and TEST().
|
inlinestatic |
Return true if p has excess flow in net.
Definition at line 2357 of file tpl_net.H.
References Aleph::Net_Graph< NodeT, ArcT >::get_in_flow(), and Aleph::Net_Graph< NodeT, ArcT >::get_out_flow().
|
inlinestatic |
|
inlinestatic |
Return true if the node has a positive color.
Definition at line 1843 of file tpl_graph_utils.H.
References NODE_COUNTER.
|
inline |
Return true if a floating-point number is normal or zero.
This excludes NaN, infinities, and subnormal.
| [in] | n | Value to classify. |
true if n is a finite number classified as FP_NORMAL or FP_ZERO. Definition at line 509 of file ahUtils.H.
References bits(), exp(), and frac().
Referenced by LFit::LFit(), and TEST().
|
inline |
|
inline |
Taken from http://stackoverflow.com/questions/3638431/determine-if-an-int-is-a-power-of-2-or-not-in-a-single-line.
Definition at line 229 of file ahUtils.H.
Referenced by Aleph::MemArray< T >::allocate(), Aleph::MemArray< T >::expand(), Aleph::MemArray< T >::init_dim(), next_power_of_2(), Aleph::MemArray< T >::reserve(), and TEST().
|
inline |
Check whether prefix is a prefix of str.
| [in] | str | Input std::string. |
| [in] | prefix | Prefix to test. |
true if str begins with prefix. Definition at line 601 of file ah-string-utils.H.
References prefix().
Referenced by demo_validation(), remove_prefix(), and TEST().
| bool Aleph::is_primitive_type | ( | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| bool Aleph::is_red_black_bst_rk | ( | Node * | node, |
| Compare & | cmp | ||
| ) |
Verify that tree rooted at node is a valid red-black BST with counters.
| node | root of tree |
| cmp | comparison criteria |
Definition at line 201 of file rbNodeRk.H.
References check_bst(), cmp(), and is_red_black_tree_rk().
Referenced by Aleph::HtdRbTreeRk< Key, Compare >::verify(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::verify(), and Aleph::GenTdRbTreeRk< NodeType, Key, Compare >::verify().
Verify if tree rooted at node is a valid red-black tree.
| node | root of tree |
Definition at line 162 of file rbNodeRk.H.
References BLACK, COLOR, LLINK, max(), RED, RLINK, and test_black_condition_rk().
Verify if tree is a valid red-black tree with correct counters.
Checks every node: valid colors, no red node with a red child, the same number of black nodes on every path down to Node::NullPtr, and the counter of each subtree. node itself can be red or black.
| node | root of tree |
Definition at line 189 of file rbNodeRk.H.
References red_black_height_rk().
Referenced by is_red_black_bst_rk(), and TEST().
|
inline |
Check whether a std::string fully parses as a non-negative size_t.
Parses using std::strtoull and requires that the entire std::string is consumed. Negative strings are rejected.
| [in] | str | Input std::string. |
true if str parses as size_t and is in range. Definition at line 542 of file ah-string-utils.H.
Referenced by demo_practical(), demo_validation(), TEST(), and TEST().
| bool Aleph::is_sorted | ( | const Container< T > & | cont, |
| const Compare & | cmp = Compare() |
||
| ) |
Check if a container is sorted in ascending order.
Tests whether all elements in the container are arranged in non-decreasing order according to the comparison functor.
Time complexity: O(n), where n is the container size.
| Container | Template container type (must provide Iterator). |
| T | Element type stored in the container. |
| Compare | Comparison functor type (default: Aleph::less<T>). |
| cont | The container to check. |
| cmp | Comparison functor defining "less than" relationship. |
true if container is empty or sorted; false if an inversion is found.Definition at line 164 of file tpl_sort_utils.H.
References cmp(), Aleph::Const_Iterator< It >::get_curr(), Aleph::Const_Iterator< It >::has_curr(), and Aleph::Const_Iterator< It >::next_ne().
Referenced by benchmark_array_algorithms(), benchmark_contiguous_array(), benchmark_list_algorithms(), example_parallel_sort(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inlinestaticnoexcept |
Whether the digraph g has, among the arcs that sa shows, an arc from src to tgt and another from tgt to src; false if g is not a digraph.
| anything | that sa throws |
Definition at line 120 of file generate_graph.H.
References and.
Validate that a tree satisfies treap (heap) property.
Checks that every parent has priority ≤ both children's priorities. This is the min-heap property that treaps maintain along with the BST property.
| Node | Treap node type |
| root | Root of subtree to validate |
Definition at line 144 of file treapNode.H.
References and, is_treap(), LLINK, PRIO(), RLINK, and root().
Referenced by is_treap(), main(), TEST(), TEST(), Aleph::Gen_Interval_Tree< NodeType, T, Compare >::verify(), Aleph::Gen_Treap< NodeType, Key, Compare >::verify(), and Aleph::Gen_Treap_Rk< NodeType, Key, Compare >::verify().
| auto Aleph::iterative_deepening_alpha_beta_search | ( | Domain | domain, |
| typename Domain::State | initial_state, | ||
| ExplorationPolicy | policy = Alpha_Beta<Domain>::default_policy(), |
||
| SearchLimits | limits = {}, |
||
| AdversarialIterativeDeepeningOptions< typename Domain::Score > | options = {} |
||
| ) |
Iterative deepening over Alpha-Beta without tracing.
Definition at line 1117 of file Alpha_Beta.H.
References iterative_deepening_alpha_beta_search().
| and AdversarialTranspositionMemo< Table, typename Domain::State_Key, typename Domain::Move, typename Domain::Score > auto Aleph::iterative_deepening_alpha_beta_search | ( | Domain | domain, |
| typename Domain::State | initial_state, | ||
| Table & | table, | ||
| ExplorationPolicy | policy = Alpha_Beta<Domain>::default_policy(), |
||
| SearchLimits | limits = {}, |
||
| AdversarialIterativeDeepeningOptions< typename Domain::Score > | options = {} |
||
| ) |
Iterative deepening over Alpha-Beta using domain.state_key() and no tracing.
Definition at line 1150 of file Alpha_Beta.H.
References iterative_deepening_alpha_beta_search().
| auto Aleph::iterative_deepening_alpha_beta_search | ( | Domain | domain, |
| typename Domain::State | initial_state, | ||
| Table & | table, | ||
| Keyer | keyer, | ||
| ExplorationPolicy | policy = Alpha_Beta<Domain>::default_policy(), |
||
| SearchLimits | limits = {}, |
||
| AdversarialIterativeDeepeningOptions< typename Domain::Score > | options = {} |
||
| ) |
Iterative deepening over Alpha-Beta with TT/keyer reuse and no tracing.
Definition at line 1132 of file Alpha_Beta.H.
References iterative_deepening_alpha_beta_search().
| and AdversarialSearchTracer< Tracer, typename Domain::Move, typename Domain::Score > auto Aleph::iterative_deepening_alpha_beta_search | ( | Domain | domain, |
| typename Domain::State | initial_state, | ||
| Table & | table, | ||
| Keyer | keyer, | ||
| Tracer & | tracer, | ||
| ExplorationPolicy | policy = Alpha_Beta<Domain>::default_policy(), |
||
| SearchLimits | limits = {}, |
||
| AdversarialIterativeDeepeningOptions< typename Domain::Score > | options = {} |
||
| ) |
Iterative deepening over Alpha-Beta with TT/keyer reuse.
Definition at line 985 of file Alpha_Beta.H.
References iterative_deepening_alpha_beta_search().
| and AdversarialTranspositionMemo< Table, typename Domain::State_Key, typename Domain::Move, typename Domain::Score > and AdversarialSearchTracer< Tracer, typename Domain::Move, typename Domain::Score > auto Aleph::iterative_deepening_alpha_beta_search | ( | Domain | domain, |
| typename Domain::State | initial_state, | ||
| Table & | table, | ||
| Tracer & | tracer, | ||
| ExplorationPolicy | policy = Alpha_Beta<Domain>::default_policy(), |
||
| SearchLimits | limits = {}, |
||
| AdversarialIterativeDeepeningOptions< typename Domain::Score > | options = {} |
||
| ) |
Iterative deepening over Alpha-Beta using domain.state_key().
Definition at line 1092 of file Alpha_Beta.H.
References iterative_deepening_alpha_beta_search().
| auto Aleph::iterative_deepening_alpha_beta_search | ( | Domain | domain, |
| typename Domain::State | initial_state, | ||
| Tracer & | tracer, | ||
| ExplorationPolicy | policy = Alpha_Beta<Domain>::default_policy(), |
||
| SearchLimits | limits = {}, |
||
| AdversarialIterativeDeepeningOptions< typename Domain::Score > | options = {} |
||
| ) |
Iterative deepening over Alpha-Beta with optional aspiration windows.
Definition at line 882 of file Alpha_Beta.H.
References iterative_deepening_alpha_beta_search().
Referenced by iterative_deepening_alpha_beta_search(), iterative_deepening_alpha_beta_search(), iterative_deepening_alpha_beta_search(), iterative_deepening_alpha_beta_search(), iterative_deepening_alpha_beta_search(), iterative_deepening_alpha_beta_search(), TEST(), TEST(), TEST(), and TEST().
| auto Aleph::iterative_deepening_negamax_search | ( | Domain | domain, |
| typename Domain::State | initial_state, | ||
| ExplorationPolicy | policy = Negamax<Domain>::default_policy(), |
||
| SearchLimits | limits = {}, |
||
| AdversarialIterativeDeepeningOptions< typename Domain::Score > | options = {} |
||
| ) |
Iterative deepening over Negamax without transposition table.
Definition at line 1317 of file Negamax.H.
References iterative_deepening_negamax_search().
Referenced by iterative_deepening_negamax_search(), iterative_deepening_negamax_search(), iterative_deepening_negamax_search(), iterative_deepening_negamax_search(), iterative_deepening_negamax_search(), iterative_deepening_negamax_search(), TEST(), and TEST().
| and AdversarialTranspositionMemo< Table, typename Domain::State_Key, typename Domain::Move, typename Domain::Score > auto Aleph::iterative_deepening_negamax_search | ( | Domain | domain, |
| typename Domain::State | initial_state, | ||
| Table & | table, | ||
| ExplorationPolicy | policy = Negamax<Domain>::default_policy(), |
||
| SearchLimits | limits = {}, |
||
| AdversarialIterativeDeepeningOptions< typename Domain::Score > | options = {} |
||
| ) |
Iterative deepening over Negamax using domain.state_key().
Definition at line 1429 of file Negamax.H.
References iterative_deepening_negamax_search().
| auto Aleph::iterative_deepening_negamax_search | ( | Domain | domain, |
| typename Domain::State | initial_state, | ||
| Table & | table, | ||
| Keyer | keyer, | ||
| ExplorationPolicy | policy = Negamax<Domain>::default_policy(), |
||
| SearchLimits | limits = {}, |
||
| AdversarialIterativeDeepeningOptions< typename Domain::Score > | options = {} |
||
| ) |
Iterative deepening over Negamax with TT/keyer reuse across iterations.
Definition at line 1370 of file Negamax.H.
References iterative_deepening_negamax_search().
| and AdversarialSearchTracer< Tracer, typename Domain::Move, typename Domain::Score > auto Aleph::iterative_deepening_negamax_search | ( | Domain | domain, |
| typename Domain::State | initial_state, | ||
| Table & | table, | ||
| Keyer | keyer, | ||
| Tracer & | tracer, | ||
| ExplorationPolicy | policy = Negamax<Domain>::default_policy(), |
||
| SearchLimits | limits = {}, |
||
| AdversarialIterativeDeepeningOptions< typename Domain::Score > | options = {} |
||
| ) |
Iterative deepening over Negamax with TT/keyer reuse and tracing.
Definition at line 1388 of file Negamax.H.
References iterative_deepening_negamax_search().
| and AdversarialTranspositionMemo< Table, typename Domain::State_Key, typename Domain::Move, typename Domain::Score > and AdversarialSearchTracer< Tracer, typename Domain::Move, typename Domain::Score > auto Aleph::iterative_deepening_negamax_search | ( | Domain | domain, |
| typename Domain::State | initial_state, | ||
| Table & | table, | ||
| Tracer & | tracer, | ||
| ExplorationPolicy | policy = Negamax<Domain>::default_policy(), |
||
| SearchLimits | limits = {}, |
||
| AdversarialIterativeDeepeningOptions< typename Domain::Score > | options = {} |
||
| ) |
Iterative deepening over Negamax using domain.state_key() and tracing.
Definition at line 1447 of file Negamax.H.
References iterative_deepening_negamax_search().
| auto Aleph::iterative_deepening_negamax_search | ( | Domain | domain, |
| typename Domain::State | initial_state, | ||
| Tracer & | tracer, | ||
| ExplorationPolicy | policy = Negamax<Domain>::default_policy(), |
||
| SearchLimits | limits = {}, |
||
| AdversarialIterativeDeepeningOptions< typename Domain::Score > | options = {} |
||
| ) |
Iterative deepening over Negamax with tracing.
Definition at line 1332 of file Negamax.H.
References iterative_deepening_negamax_search().
| auto Aleph::iterator_for | ( | C & | c | ) |
Iterator on c positioned on its first item: the container's own iterator on a modifiable container.
| [in] | c | the container. |
typename C::Iterator. Definition at line 547 of file ah-iterator.H.
Referenced by get_pair_it(), get_pair_it(), TEST(), Aleph::TraverseMixin< Derived, Type >::traverse(), Aleph::TraverseMixin< Derived, Type >::traverse(), and GenericTraverse< Container >::traverse().
| auto Aleph::iterator_for | ( | const C & | c | ) |
Iterator on c positioned on its first item: the read-only view on a constant container.
| [in] | c | the container. |
const_iterator_t<C>. Definition at line 558 of file ah-iterator.H.
|
inlinenoexcept |
Definition at line 609 of file hash-fct.H.
References jen_hash().
|
inlinenoexcept |
Definition at line 833 of file hash-fct.H.
References jen_hash().
|
inline |
Join elements of an Aleph-style container into a stream.
The container is expected to support is_empty(), get_last(), and get_it() with has_curr()/next_ne()/get_curr().
| C | Container type. |
| [in] | c | Container to join. |
| [in] | sep | Separator inserted between elements. |
| [in,out] | out | Output stream. |
out. Definition at line 445 of file ah-string-utils.H.
References out.
Referenced by Aleph::PolygonOffset::compute_raw_offset(), demo_joining(), join(), join(), main(), main(), Aleph::PolygonOffset::offset_polygon(), Aleph::PolygonOffset::operator()(), ComplexArray::print(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Join elements of an Aleph-style container into a std::string.
| C | Container type. |
| [in] | c | Container to join. |
| [in] | sep | Separator inserted between elements (defaults to a space). |
Definition at line 469 of file ah-string-utils.H.
References join().
|
inline |
Return union of two containers as a DynList (no duplicates).
Definition at line 1063 of file tpl_dynSetHash.H.
References Aleph::DynHashTable< Key, HashTable, Cmp >::insert(), and GenericItems< Container, T >::keys().
|
staticnoexcept |
Definition at line 228 of file hash-fct.C.
References Aleph::Gsl_Compatible_Rng::get(), init, Aleph::Gsl_Compatible_Rng::max(), r, seed, and tab.
Referenced by init_jsw(), init_jsw(), jsw_hash(), and jsw_hash().
|
noexcept |
Compute a 32-bit JSW hash for a null-terminated string.
| key | Null-terminated string to hash. |
| Nothing. |
Definition at line 304 of file hash-fct.C.
References Default_Hash_Seed, h, init, jsw_fill_table(), jsw_init_flag, jsw_mtx, and tab.
|
inline |
Justify a single line by inserting extra spaces.
| [in] | line | Input line. |
| [in] | page_width | Desired width. |
Definition at line 1099 of file ah-string-utils.H.
Referenced by justify_text().
|
inline |
Justify all lines except the first one.
| [in] | text | Input text. |
| [in] | width | Target width. |
| [in] | left_margin | Left margin for lines after the first. |
Definition at line 1161 of file ah-string-utils.H.
References justify_text(), split_text_into_lines(), and to_string().
Referenced by TEST().
|
inline |
Justify a text to a target width.
| [in] | text | Input text. |
| [in] | width | Target width. |
| [in] | left_margin | Optional left margin (spaces). |
Definition at line 1123 of file ah-string-utils.H.
References justify_line(), and split_text_into_words().
Referenced by demo_formatting(), justify_line_except_first(), TEST(), and TEST().
|
inlineconstexprnoexcept |
Definition at line 510 of file tpl_binNode.H.
| const std::pair< Key, Data > * Aleph::key_to_pair | ( | const Key * | ptr | ) |
| std::pair< Key, Data > * Aleph::key_to_pair | ( | Key * | ptr | ) |
|
inline |
Prefix-function used by KMP.
For each index i, returns the length of the longest proper prefix of pattern[0..i] which is also a suffix of pattern[0..i].
| [in] | pattern | Pattern to preprocess. |
pattern.size(). | None. |
m = pattern.size(). Definition at line 141 of file String_Search.H.
References and, and Aleph::Array< T >::create().
Referenced by kmp_search(), main(), and TEST().
|
inline |
Find all occurrences of a pattern using KMP.
| [in] | text | Text where matches are searched. |
| [in] | pattern | Pattern to find. |
| None. |
pattern is empty, returns all positions in [0, text.size()].Definition at line 178 of file String_Search.H.
References Aleph::string_search_detail::all_match_positions(), and, Aleph::Array< T >::append(), and kmp_prefix_function().
Referenced by main(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and z_search().
| Knapsack_Result< V > Aleph::knapsack_01 | ( | const Array< Knapsack_Item< W, V > > & | items, |
| W | capacity | ||
| ) |
Solve the 0/1 Knapsack problem with item reconstruction.
In the 0/1 variant, each item can be selected at most once.
| V | Value type (must support addition and comparison). |
| W | Weight type (integral, must support comparison). |
| [in] | items | Array of Knapsack_Item representing the available items. |
| [in] | capacity | Maximum total weight allowed. |
| ah_domain_error | if capacity or any item weight is negative. |
| ah_bad_alloc | if memory allocation for the DP table fails. |
Definition at line 166 of file Knapsack.H.
References Aleph::Array< T >::append(), Aleph::Array< T >::create(), Aleph::knapsack_detail::dp_add(), Aleph::knapsack_detail::extract_weights_checked(), k, Aleph::Array< T >::reserve(), row, Aleph::Array< T >::size(), Aleph::knapsack_detail::to_size_checked(), V, and w.
Referenced by knapsack_bounded(), main(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
| V Aleph::knapsack_01_value | ( | const Array< Knapsack_Item< W, V > > & | items, |
| W | capacity | ||
| ) |
Solve the 0/1 Knapsack problem (value only, space-optimized).
This version only computes the maximum value, using O(capacity) space.
| V | Value type. |
| W | Weight type. |
| [in] | items | Array of Knapsack_Item. |
| [in] | capacity | Maximum total weight allowed. |
| ah_domain_error | if capacity or any item weight is negative. |
Definition at line 237 of file Knapsack.H.
References and, Aleph::Array< T >::create(), Aleph::knapsack_detail::dp_add(), Aleph::knapsack_detail::extract_weights_checked(), Aleph::Array< T >::size(), Aleph::knapsack_detail::to_size_checked(), V, and w.
Referenced by main(), TEST(), TEST(), TEST(), TEST(), and TEST().
| Knapsack_Result< V > Aleph::knapsack_bounded | ( | const Array< Knapsack_Item< W, V > > & | items, |
| const Array< size_t > & | counts, | ||
| W | capacity | ||
| ) |
Solve the Bounded Knapsack problem with reconstruction.
In the bounded variant, each item i can be taken at most counts[i] times. This algorithm internally uses binary decomposition to reduce the problem to a 0/1 Knapsack problem efficiently.
| V | Value type. |
| W | Weight type. |
| [in] | items | Array of Knapsack_Item. |
| [in] | counts | Array of maximum counts allowed for each corresponding item. |
| [in] | capacity | Maximum total weight allowed. |
| std::domain_error | if capacity or any item weight is negative. |
| std::invalid_argument | if items.size() != counts.size(). |
Definition at line 357 of file Knapsack.H.
References ah_invalid_argument_if, and, Aleph::Array< T >::append(), Aleph::knapsack_detail::extract_weights_checked(), k, knapsack_01(), Aleph::Knapsack_Result< V >::optimal_value, Aleph::Array< T >::size(), Aleph::knapsack_detail::to_size_checked(), V, and value.
| Knapsack_Result< V > Aleph::knapsack_unbounded | ( | const Array< Knapsack_Item< W, V > > & | items, |
| W | capacity | ||
| ) |
Solve the Unbounded Knapsack problem with reconstruction.
In the unbounded variant, an unlimited number of copies of each item is available.
| V | Value type. |
| W | Weight type. |
| [in] | items | Array of Knapsack_Item. |
| [in] | capacity | Maximum total weight allowed. |
| ah_domain_error | if capacity or any item weight is negative. |
| ah_domain_error | if an item with weight 0 has a positive value (as the problem would have an infinite optimal value). |
Definition at line 286 of file Knapsack.H.
References ah_domain_error_if, and, Aleph::Array< T >::append(), Aleph::Array< T >::create(), Aleph::knapsack_detail::dp_add(), Aleph::knapsack_detail::extract_weights_checked(), Aleph::knapsack_detail::to_size_checked(), V, value, and w.
Referenced by main(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Optimize interval DP with Knuth optimization.
Solves recurrences of the form:
for intervals [i, j) over n atomic elements.
Requires the standard Knuth assumptions to hold for interval_cost: quadrangle inequality and monotone optima.
| Cost | Numeric DP cost type. |
| Interval_Cost_Fn | Callable returning Cost given (i, j). |
| [in] | n | Number of atomic elements. |
| [in] | interval_cost | Cost term depending only on interval [i, j). |
| [in] | inf | Sentinel for unreachable states. |
dp[i][i] = 0, dp[i][i+1] = 0. Definition at line 252 of file DP_Optimizations.H.
References ah_runtime_error_if, Aleph::Array< T >::append(), Aleph::Array< T >::create(), k, Aleph::Array< T >::reserve(), row, and w.
| auto Aleph::kurtosis | ( | const Container & | data | ) | -> std::decay_t<decltype(*std::begin(data))> |
Compute excess kurtosis (measure of tailedness).
Positive kurtosis: heavy tails (leptokurtic) Negative kurtosis: light tails (platykurtic) Zero kurtosis: normal distribution (mesokurtic)
Returns excess kurtosis (kurtosis - 3).
| data | Input container |
| std::invalid_argument | if container has fewer than 4 elements |
Definition at line 564 of file stat_utils.H.
References ah_invalid_argument_if, diff(), kurtosis(), m, mean(), and stddev().
Referenced by compute_all_stats(), kurtosis(), TEST(), TEST(), and TEST().
|
inlineconstexpr |
Map a binary heap index to the index of its left child.
For 1-based heaps, l_index(i) returns 2*i.
| [in] | i | Node index. |
Definition at line 218 of file ahUtils.H.
Referenced by Aleph::dynarrayheap_detail::down_index(), Aleph::arrayheap_detail::sift_down(), TEST(), and valid_heap().
| Aleph::Generator< Array< T > > Aleph::lazy_combinations | ( | Array< T > | a, |
| size_t | k | ||
| ) |
Lazily enumerate all k-element combinations of a's elements.
Combinations are drawn positionally (index-based, via next_combination_indices) and yielded in the same relative order as a: for input [x0, x1, ..., x(n-1)], the first combination is [x0, ..., x(k-1)] and the last is [x(n-k), ..., x(n-1)]. Yields exactly combination_count(n, k) combinations for k <= n (1 when k == 0).
| T | Element type. Must be copyable. |
| a | Source sequence (taken by value: the generator owns and reads from its own copy — see the note on coroutine reference parameters below). |
| k | Size of each combination. |
C(a.size(), k) combinations, each a fresh Array<T> of size k. | std::domain_error | if k > a.size(). |
next_combination_indices bound) plus O(k) to materialize each combination's values. Array<T> before it is yielded (materializing values from indices requires a copy anyway). The iterator still returns a reference into the suspended coroutine frame, so that reference is valid only until the generator advances. Copy it (Array<T> snapshot = c;) if you need to keep it. a is taken by value, not by reference, on purpose: a coroutine's reference parameters bind to whatever the caller passed, but the coroutine body doesn't start running until the first resume (it starts suspended) — by which point a temporary argument (e.g. lazy_combinations(Array<int>{1,2,3}, 2)) has already been destroyed. Taking a by value sidesteps this well-known C++20 coroutine pitfall entirely, at the cost of one copy of the source sequence.Start from the first k-combination: indices [0, 1, ..., k-1].
Definition at line 157 of file ah-comb-generators.H.
References ah_domain_error_if, Aleph::Array< T >::create(), Aleph::Array< T >::create_reserved(), k, next_combination_indices(), and Aleph::Array< T >::size().
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
| Aleph::Generator< Array< T > > Aleph::lazy_permutations | ( | Array< T > | a, |
| Compare | cmp = Compare() |
||
| ) |
Lazily enumerate all permutations of a, in lexicographic order.
Sorts a working copy of a ascending (per cmp) — the lexicographic starting point — then repeatedly applies next_permutation to advance it, co_yielding after each step. For n elements with no ties, this yields exactly n! permutations.
| T | Element type. Must be movable and comparable via Compare. |
| Compare | Strict weak ordering over T. Defaults to Aleph::less<T>. Duplicate-valued elements (ties under Compare) collapse permutations exactly as next_permutation does — the yielded count is n! divided by the multinomial of tie-group sizes, matching std::next_permutation. |
| a | Sequence to permute (taken by value: the generator owns and mutates its own copy). |
| cmp | Comparator instance (defaulted). |
n! permutations (or fewer, with ties).co_yield exposes the same backing Array<T>, mutated one step further on each resume. This avoids an O(n) copy per permutation, but means the reference is only valid between resumes — copy it (Array<T> snapshot = *it;) if you need to keep more than one permutation alive at a time. next_permutation bound); O(n log n) once up front to sort the starting point.Start from the lexicographically smallest permutation so the loop below enumerates the complete sequence.
Definition at line 104 of file ah-comb-generators.H.
References cmp(), next_permutation(), and timsort().
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Compute LCP array from text and suffix array using Kasai.
Calculates the Longest Common Prefix (LCP) values for adjacent suffixes in the suffix array. The resulting array lcp has size n, where lcp[i] is the length of the LCP of text[sa[i]...] and text[sa[i+1]...].
| [in] | text | Input text string. |
| [in] | sa | Suffix array for text. |
text.size().| std::domain_error | if sa.size() != text.size(). |
| std::out_of_range | if sa contains an index >= text.size() or if sa contains duplicate indices. |
Definition at line 183 of file Suffix_Structures.H.
References ah_domain_error_if, ah_out_of_range_error_if, and, Aleph::Array< T >::create(), k, r, and Aleph::Array< T >::size().
Definition at line 82 of file point_utils.H.
References area_of_parallelogram(), and left_on().
Referenced by left_on().
|
inline |
Determines if op1 is less than or equal to op2 using a comparison operator.
Uses an exclusive comparison operator (< or >). For use with generic programs that need comparison functionality.
| op1 | First operand |
| op2 | Second operand |
| cmp | Comparison functor |
Definition at line 1020 of file ahFunction.H.
References cmp().
Referenced by check_bst_range().
|
inline |
Determines if op1 is less than op2 using a comparison operator.
Uses an exclusive comparison operator (< or >). For use with generic programs that need comparison functionality.
| op1 | First operand |
| op2 | Second operand |
| cmp | Comparison functor |
Definition at line 991 of file ahFunction.H.
References cmp().
|
inline |
Lexicographical comparison between two containers.
Compares two containers lexicographically (dictionary order). Returns true if c1 is lexicographically less than c2.
| C1 | Type of the first container. |
| C2 | Type of the second container. |
| Cmp | Comparator type (defaults to std::less). |
| c1 | First container. |
| c2 | Second container. |
| cmp | Comparator for element comparison. |
Definition at line 1327 of file ahFunctional.H.
Referenced by demo_comparison(), and TEST().
|
inline |
Definition at line 1037 of file tpl_binNodeUtils.H.
References root().
|
inline |
Levenshtein distance (insert/delete/substitute each cost 1).
| [in] | a | First string. |
| [in] | b | Second string. |
| None. |
Definition at line 94 of file String_DP.H.
References Aleph::Array< T >::create(), Aleph::Array< T >::size(), and Aleph::Array< T >::swap().
Referenced by edit_distance(), main(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Lexicographical comparison of two ranges.
Compares two ranges lexicographically.
| Itor1 | First range iterator type. |
| Itor2 | Second range iterator type. |
| Comp | Comparison functor. |
| beg1 | Iterator to the first element of the first range. |
| end1 | Iterator past the last element of the first range. |
| beg2 | Iterator to the first element of the second range. |
| end2 | Iterator past the last element of the second range. |
| op | Comparison function. |
Definition at line 547 of file ahAlgo.H.
References and.
| size_t Aleph::lis_length | ( | const Array< T > & | seq, |
| Compare | cmp = Compare() |
||
| ) |
Compute only the length of the LIS (no reconstruction).
A space-optimized version that returns the maximum length of a strictly increasing subsequence without storing extra info for reconstruction.
| T | Element type. |
| Compare | Strict weak ordering instance. |
| [in] | seq | Input sequence to analyze. |
| [in] | cmp | Comparator instance defining the order. |
Definition at line 212 of file LIS.H.
References Aleph::Array< T >::append(), cmp(), Aleph::lis_detail::lower_bound_pos(), Aleph::Array< T >::reserve(), and Aleph::Array< T >::size().
|
inline |
Generic insertion sort for linked lists.
| ListType | The list container type (e.g., DynList, DynDlist). |
| Compare | Comparison functor. |
| [in,out] | list | The list to sort. |
| [in] | cmp | Comparison functor. |
Definition at line 1018 of file tpl_sort_utils.H.
References cmp().
| Aleph::List_Sort | ( | DynDlist | ) |
| Aleph::List_Sort | ( | DynList | ) |
Convert a std::list to a DynList.
| T | Element type. |
| l | Source std::list. |
Definition at line 385 of file ah-stl-utils.H.
References Aleph::DynList< T >::append(), and l.
Referenced by demo_list_dynlist(), TEST(), TEST(), and TEST().
Definition at line 476 of file tpl_binNode.H.
|
inline |
Load a binary number from the input stream.
Parses a number in binary format (0b or 0B prefix).
| input_stream | The input file stream |
| ParseError | if format is invalid |
0b10100B11110000 Definition at line 1148 of file parse_utils.H.
References ah_parse_error_unless, Buffer_Size, close_token_scanning(), current_col_number, init_token_scanning(), load_binary_number(), put_char_in_buffer(), read_char_from_stream(), and skip_white_spaces().
Referenced by load_binary_number(), TEST_F(), and TEST_F().
|
inline |
Load a character literal.
Parses a character literal enclosed in single quotes. Supports escape sequences.
| input_stream | The input file stream |
| ParseError | if the format is invalid |
-'\n' -'\t'` Definition at line 1464 of file parse_utils.H.
References ah_parse_error_unless, init_token_scanning(), load_char_literal(), process_escape(), read_char_from_stream(), skip_white_spaces(), and token_instance.
Referenced by load_char_literal(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Load a floating-point number from the input stream.
Parses and returns a double-precision floating-point number. Supports optional sign, decimal point, and scientific notation.
| input_stream | The input file stream |
| ParseError | if the format is invalid |
123.456-3.141e10, 1E101.5e-3.5 (leading decimal)5. (trailing decimal)Definition at line 958 of file parse_utils.H.
References ah_parse_error_unless, Buffer_Size, close_token_scanning(), current_col_number, init_token_scanning(), load_double(), put_char_in_buffer(), read_char_from_stream(), and skip_white_spaces().
Referenced by load_double(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Load a string with escape sequence processing.
Like load_string() but processes escape sequences like \n, \t, etc. Only works with quoted strings.
| input_stream | The input file stream |
| ParseError | if string is unterminated |
Definition at line 1411 of file parse_utils.H.
References ah_parse_error_if, ah_parse_error_unless, Buffer_Size, close_token_scanning(), init_token_scanning(), load_escaped_string(), process_escape(), put_char_in_buffer(), read_char_from_stream(), and skip_white_spaces().
Referenced by load_escaped_string(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Load entire file contents into a string.
| filename | Path to the file |
| std::runtime_error | if file cannot be opened |
Definition at line 1591 of file parse_utils.H.
References ah_runtime_error_unless, file, and load_file_contents().
Referenced by load_file_contents(), TEST(), and TEST_F().
|
inline |
Load file as a list of lines.
| filename | Path to the file |
| std::runtime_error | if file cannot be opened |
Definition at line 1609 of file parse_utils.H.
References ah_runtime_error_unless, Aleph::DynList< T >::append(), file, and load_file_lines().
Referenced by load_file_lines(), and TEST_F().
|
inline |
Load a hexadecimal number from the input stream.
Parses a number in hexadecimal format (0x or 0X prefix).
| input_stream | The input file stream |
| ParseError | if format is invalid |
0xFF, 0XFF0x1a2b Definition at line 1049 of file parse_utils.H.
References ah_parse_error_unless, Buffer_Size, close_token_scanning(), current_col_number, init_token_scanning(), load_hex_number(), put_char_in_buffer(), read_char_from_stream(), and skip_white_spaces().
Referenced by load_hex_number(), TEST_F(), and TEST_F().
|
inline |
Load an identifier from the input stream.
Parses an identifier (variable name, function name, etc.). Identifiers start with a letter or underscore, followed by letters, digits, or underscores.
| input_stream | The input file stream |
| ParseError | if no valid identifier found |
foo, _bar, camelCase, snake_case, var123 Definition at line 1201 of file parse_utils.H.
References ah_parse_error_unless, Buffer_Size, close_token_scanning(), current_col_number, init_token_scanning(), load_identifier(), put_char_in_buffer(), read_char_from_stream(), and skip_white_spaces().
Referenced by load_identifier(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Load an integer number from the input stream.
Parses and returns a signed integer from the input stream. Leading whitespace is automatically skipped. The number may optionally be preceded by a minus sign for negative values.
| input_stream | The input file stream |
| std::domain_error | if the number format is invalid |
| std::out_of_range | if EOF is reached unexpectedly |
123, 0, 42-123, -1Definition at line 356 of file parse_utils.H.
References ah_domain_error_if, Buffer_Size, close_token_scanning(), init_token_scanning(), load_number(), put_char_in_buffer(), read_char_from_stream(), and skip_white_spaces().
Referenced by build_cross_net_graph(), build_net_graph(), build_poly_graph(), file_to_dynarrays(), load_arc_option(), load_distance_option(), load_key_option(), load_node(), load_nodes(), load_number(), load_offset_option(), load_parrectangle_option(), load_rectangle_option(), load_split_option(), load_tag_option(), load_thread_option(), load_triangle_option(), load_triangleh_option(), parse_arc_text_definition(), parse_curve_arc_definition(), parse_graph_definition(), parse_hradio(), parse_hradio_definition(), parse_node_definition(), parse_node_text_definition(), parse_tag(), parse_tag_definition(), parse_vradio(), parse_vradio_definition(), parse_xoffset(), parse_yoffset(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Load an octal number from the input stream.
Parses a number in octal format (leading 0).
| input_stream | The input file stream |
| ParseError | if format is invalid |
07550123 Definition at line 1098 of file parse_utils.H.
References ah_parse_error_if, ah_parse_error_unless, and, Buffer_Size, close_token_scanning(), current_col_number, init_token_scanning(), load_octal_number(), put_char_in_buffer(), read_char_from_stream(), and skip_white_spaces().
Referenced by load_octal_number(), TEST_F(), and TEST_F().
|
inline |
Load a string from the input stream.
Parses and returns a string from the input stream. The string may be quoted with double quotes or unquoted.
| input_stream | The input file stream |
| std::out_of_range | if EOF is reached unexpectedly |
Definition at line 439 of file parse_utils.H.
References and, Buffer_Size, close_token_scanning(), init_token_scanning(), load_string(), put_char_in_buffer(), read_char_from_stream(), and skip_white_spaces().
Referenced by load_distance_option(), load_key_option(), load_split_option(), load_string(), load_tag_option(), parse_arc_text_definition(), parse_key_node_and_allocate(), parse_node_definition(), parse_node_text_definition(), parse_tag(), parse_tag_definition(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
|
inline |
Compute Longest Common Subsequence.
| [in] | a | First string. |
| [in] | b | Second string. |
| None. |
Definition at line 241 of file String_DP.H.
References and, m, Aleph::string_dp_detail::make_zero_matrix(), and OhashCommon< HashTbl, Key >::size().
|
inline |
Compute the longest common substring (contiguous) between two strings.
| [in] | a | First string. |
| [in] | b | Second string. |
| None. |
Definition at line 301 of file String_DP.H.
References Aleph::Longest_Common_Substring_Result::begin_a, Aleph::Longest_Common_Substring_Result::begin_b, Aleph::Array< T >::create(), Aleph::Longest_Common_Substring_Result::length, m, OhashCommon< HashTbl, Key >::size(), Aleph::Longest_Common_Substring_Result::substring, and Aleph::Array< T >::swap().
|
inline |
Convenience function: LCS via suffix automaton.
Computes the longest common substring between a and b in linear time by building a suffix automaton for a and processing b.
| [in] | a | First string. |
| [in] | b | Second string. |
a and b.| std::bad_alloc | if memory allocation fails. |
Definition at line 933 of file Suffix_Structures.H.
References Aleph::Suffix_Automaton::build(), and Aleph::Suffix_Automaton::longest_common_substring().
| LIS_Result< T > Aleph::longest_increasing_subsequence | ( | const Array< T > & | seq, |
| Compare | cmp = Compare() |
||
| ) |
Compute the Longest Increasing Subsequence (strictly increasing).
Uses the patience sorting algorithm to find a strictly increasing subsequence of maximum length.
| T | Element type (must be comparable via Compare). |
| Compare | Strict weak ordering (default Aleph::less<T>). |
| [in] | seq | Input sequence to analyze. |
| [in] | cmp | Comparator instance defining the order. |
Definition at line 149 of file LIS.H.
References Aleph::Array< T >::append(), cmp(), Aleph::Array< T >::create(), k, Aleph::lis_detail::lower_bound_pos(), Aleph::Array< T >::reserve(), and Aleph::Array< T >::size().
Referenced by main(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
| LIS_Result< T > Aleph::longest_nondecreasing_subsequence | ( | const Array< T > & | seq, |
| Compare | cmp = Compare() |
||
| ) |
Compute the Longest Non-Decreasing Subsequence.
Finds a subsequence where each element is greater than or equal to the previous one (a <= b <= c).
| T | Element type. |
| Compare | Strict weak ordering (default Aleph::less<T>). |
| [in] | seq | Input sequence to analyze. |
| [in] | cmp | Comparator instance defining the order. |
Definition at line 249 of file LIS.H.
References Aleph::Array< T >::append(), cmp(), Aleph::Array< T >::create(), k, Aleph::Array< T >::reserve(), Aleph::Array< T >::size(), and Aleph::lis_detail::upper_bound_pos().
|
inline |
Convenience wrapper returning only the longest palindromic substring.
| [in] | text | Input text. |
Definition at line 194 of file String_Palindromes.H.
References Aleph::Manacher_Result::longest_palindrome, and manacher().
|
inlinestatic |
Internal helper: low-link value stored directly in NODE_COOKIE(p).
The cookie pointer itself is reinterpreted as a long value.
Definition at line 1598 of file tpl_graph_utils.H.
References NODE_COOKIE.
Referenced by __compute_cut_nodes(), Aleph::Gen_Interval_Tree< NodeType, T, Compare >::all_overlaps(), Aleph::negative_cycles_detail::bit_span(), Aleph::adaptive_huffman_detail::Model::block_leader(), Aleph::FFT< Real >::build_weighted_frequency_grid(), Aleph::negative_cycles_detail::cyclic_core(), Aleph::FFT< Real >::firwin_bandpass(), mul_xor_fold64(), Aleph::negative_cycles_detail::odd_significand(), Aleph::negative_cycles_detail::short_sums_are_exact(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), Aleph::howard_detail::try_exact(), TYPED_TEST(), Aleph::howard_detail::verify_exactly(), and Aleph::df_tree_detail::Df_Low_Builder< GT, Node_Label, SA >::visit().
|
inline |
Find lower bound in a sorted range.
Returns an iterator to the first element not less than value in the sorted range [beg, end).
| Itor | Forward iterator type. |
| T | Value type. |
| beg | Iterator to the first element. |
| end | Iterator past the last element. |
| value | Value to compare against. |
Definition at line 1190 of file ahAlgo.H.
Referenced by binary_search(), binary_search(), equal_range(), equal_range(), Aleph::Bidirectional_BFS< GT, Fwd_Itor, Bck_Itor, SA >::find_path(), Aleph::Network_Simplex< Net >::set_lower_bound(), TEST(), and TEST().
|
inline |
Find lower bound with custom comparison.
Returns an iterator to the first element for which op(*beg, value) is false in the sorted range [beg, end).
| Itor | Forward iterator type. |
| T | Value type. |
| BinaryPredicate | Comparison predicate. |
| beg | Iterator to the first element. |
| end | Iterator past the last element. |
| value | Value to compare against. |
| op | Binary comparison predicate. |
|
inline |
Remove leading whitespace from a std::string in-place.
Whitespace is defined by std::isspace in the current C locale.
| [in,out] | s | String to modify. |
Definition at line 124 of file ah-string-utils.H.
Referenced by demo_trimming(), trim(), and trim_in_place().
|
inline |
Create an Array_Container from a raw array.
| T | Element type. |
| array | Pointer to the array. |
| n | Number of elements. |
Definition at line 394 of file array_it.H.
Referenced by TEST().
|
inline |
Create an Init_Guard with a cleanup function.
Convenience factory function that creates an Init_Guard.
| CleanupFunc | Callable type. |
| f | Cleanup function. |
Definition at line 169 of file ah_init_guard.H.
|
inline |
Create a basic draw style with a custom color.
Definition at line 172 of file tikzgeom.H.
References Aleph::Tikz_Style::draw_color.
|
inline |
Create a basic fill style with custom draw/fill colors.
Definition at line 180 of file tikzgeom.H.
References Aleph::Tikz_Style::draw_color, Aleph::Tikz_Style::fill, and Aleph::Tikz_Style::fill_color.
Referenced by TEST().
|
inline |
Compute palindromic radii and the longest palindrome with Manacher.
| [in] | text | Input text. |
Definition at line 81 of file String_Palindromes.H.
References and, Aleph::Array< T >::create(), Aleph::Manacher_Result::even_radius, k, l, Aleph::Manacher_Result::longest_begin, Aleph::Manacher_Result::longest_length, Aleph::Manacher_Result::longest_palindrome, Aleph::Manacher_Result::odd_radius, and r.
Referenced by longest_palindromic_substring(), main(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inlinenoexcept |
Definition at line 1137 of file hash-fct.H.
|
inline |
Map the arcs of g into p to a transformation op, which must have the signature T op(Arc * arc); on a digraph, in \(O(E)\).
| [in] | g | the graph of p |
| [in] | p | node pointer |
| [in] | op | transformation |
DynList<T> containing the mapping. Definition at line 3229 of file tpl_graph.H.
References Aleph::DynList< T >::append(), Call, and for_each_in_arc().
|
inline |
Map the incoming arcs to a transformation,.
The transformation is called op and must have the following signature:
T op(Arc * arc)
Where T is the transformed type from the arc. It does not compile on a digraph type: use map_in_arcs<GT, T>(g, p, op).
| [in] | p | node pointer |
| [in] | op | transformation |
DynList<T> containing the mapping. Definition at line 3183 of file tpl_graph.H.
References Aleph::DynList< T >::append().
Referenced by TEST().
| DynList< K > Aleph::map_keys_to_DynList | ( | const std::map< K, V, Compare, Alloc > & | m | ) |
Extract keys from a std::map to a DynList.
Creates a new DynList containing copies of all keys from the given std::map. Keys are inserted in sorted order.
| K | The key type. |
| V | The value type. |
| Compare | The comparison function type. |
| Alloc | The allocator type. |
| m | The source std::map. |
Definition at line 735 of file ah-convert.H.
References Aleph::DynList< T >::append(), m, and value.
Referenced by TEST().
|
inline |
Map the outcoming arcs to a transformation,.
The transformation is called op and must have the following signature:
T op(Arc * arc)
Where T is the transformed type from the arc.
| [in] | p | node pointer |
| [in] | op | transformation |
DynList<T> containing the mapping. Definition at line 3478 of file tpl_graph.H.
References Aleph::DynList< T >::append().
Referenced by TEST().
| DynList< R > Aleph::map_perm | ( | const DynList< DynList< T > > & | l, |
| Op & | op | ||
| ) |
Transform each permutation via a mapping operation.
| R | Result element type. |
| T | Element type in input lists. |
| Op | Callable with signature R(const DynList<T>&). |
| [in] | l | List of lists. |
| [in] | op | Mapping operation. |
op to each permutation. Definition at line 753 of file ah-comb.H.
References Aleph::DynList< T >::append(), for_each_perm(), and l.
| Array< std::pair< K, V > > Aleph::map_to_Array | ( | const std::map< K, V, Compare, Alloc > & | m | ) |
Convert a std::map to an Array of pairs.
Creates a new Array containing copies of all key-value pairs from the given std::map. Elements are inserted in key-sorted order.
| K | The key type. |
| V | The value type. |
| Compare | The comparison function type. |
| Alloc | The allocator type. |
| m | The source std::map. |
Definition at line 711 of file ah-convert.H.
References Aleph::Array< T >::append(), m, Aleph::Array< T >::reserve(), OhashCommon< HashTbl, Key >::size(), and value.
Referenced by TEST().
| DynList< std::pair< K, V > > Aleph::map_to_DynList | ( | const std::map< K, V, Compare, Alloc > & | m | ) |
Convert a std::map to a DynList of pairs.
Creates a new DynList containing copies of all key-value pairs from the given std::map. Elements are inserted in key-sorted order.
| K | The key type. |
| V | The value type. |
| Compare | The comparison function type. |
| Alloc | The allocator type. |
| m | The source std::map. |
Definition at line 687 of file ah-convert.H.
References Aleph::DynList< T >::append(), m, and value.
| DynMapTree< typename C::Item_Type, T > Aleph::map_unify | ( | const C & | c, |
| Op | op | ||
| ) |
Definition at line 566 of file tpl_dynMapTree.H.
References Aleph::DynMapTree< Key, Data, Tree, Compare >::insert().
| DynList< V > Aleph::map_values_to_DynList | ( | const std::map< K, V, Compare, Alloc > & | m | ) |
Extract values from a std::map to a DynList.
Creates a new DynList containing copies of all values from the given std::map. Values are inserted in key-sorted order.
| K | The key type. |
| V | The value type. |
| Compare | The comparison function type. |
| Alloc | The allocator type. |
| m | The source std::map. |
Definition at line 758 of file ah-convert.H.
References Aleph::DynList< T >::append(), m, and value.
Referenced by TEST().
|
inline |
Map a function over a std::vector.
| T | Element type of input vector. |
| Op | Callable type. |
| v | Source vector. |
| op | Function to apply to each element. |
Definition at line 174 of file ah-stl-utils.H.
References Aleph::Array< T >::reserve().
Referenced by demo_map_transformations(), TEST(), TEST(), and TEST().
| DynList< Key > Aleph::maphash_keys_to_DynList | ( | const MapOpenHash< Key, Data, Cmp, HashTable > & | m | ) |
Extract keys from a MapOpenHash to a DynList.
| Key | The key type. |
| Data | The data type. |
| Cmp | The equality comparator. |
| HashTable | The hash table template. |
| m | The source MapOpenHash. |
Definition at line 1300 of file ah-convert.H.
References Aleph::DynList< T >::append(), FunctionalMethods< Container, T >::for_each(), and m.
Referenced by TEST().
| Array< std::pair< Key, Data > > Aleph::maphash_to_Array | ( | const MapOpenHash< Key, Data, Cmp, HashTable > & | m | ) |
Convert a MapOpenHash to an Array of pairs.
| Key | The key type. |
| Data | The data type. |
| Cmp | The equality comparator. |
| HashTable | The hash table template. |
| m | The source MapOpenHash. |
Definition at line 1255 of file ah-convert.H.
References Aleph::Array< T >::append(), FunctionalMethods< Container, T >::for_each(), m, Aleph::Array< T >::reserve(), and OhashCommon< HashTbl, Key >::size().
Referenced by TEST().
| DynList< std::pair< Key, Data > > Aleph::maphash_to_DynList | ( | const MapOpenHash< Key, Data, Cmp, HashTable > & | m | ) |
Convert a MapOpenHash to a DynList of pairs.
| Key | The key type. |
| Data | The data type. |
| Cmp | The equality comparator. |
| HashTable | The hash table template. |
| m | The source MapOpenHash. |
Definition at line 1234 of file ah-convert.H.
References Aleph::DynList< T >::append(), FunctionalMethods< Container, T >::for_each(), and m.
Referenced by TEST().
| std::map< Key, Data > Aleph::maphash_to_stdmap | ( | const MapOpenHash< Key, Data, Cmp, HashTable > & | m | ) |
Convert a MapOpenHash to a std::map.
| Key | The key type. |
| Data | The data type. |
| Cmp | The equality comparator. |
| HashTable | The hash table template. |
| m | The source MapOpenHash. |
Definition at line 1277 of file ah-convert.H.
References FunctionalMethods< Container, T >::for_each(), and m.
Referenced by TEST().
| DynList< Data > Aleph::maphash_values_to_DynList | ( | const MapOpenHash< Key, Data, Cmp, HashTable > & | m | ) |
Extract values from a MapOpenHash to a DynList.
| Key | The key type. |
| Data | The data type. |
| Cmp | The equality comparator. |
| HashTable | The hash table template. |
| m | The source MapOpenHash. |
Definition at line 1321 of file ah-convert.H.
References Aleph::DynList< T >::append(), FunctionalMethods< Container, T >::for_each(), and m.
Referenced by TEST().
Return the mapped arc through the cookie of p
Definition at line 3629 of file tpl_graph.H.
References ARC_COOKIE.
|
noexcept |
See mapped_arc(typename GT::Arc * a).
Definition at line 3643 of file tpl_graph.H.
References ARC_COOKIE.
|
noexcept |
See mapped_node(typename GT::Node * p).
Definition at line 3636 of file tpl_graph.H.
References NODE_COOKIE.
| DynList< T > Aleph::maps | ( | const C & | c, |
| Op | op | ||
| ) |
Classic map operation.
Return a new list with each element of container mapped to the result of op(item).
Definition at line 969 of file ahFunctional.H.
References Aleph::DynList< T >::append().
Referenced by TEST().
| DynList< Key > Aleph::maptree_keys_to_DynList | ( | const DynMapTree< Key, Data, Tree, Compare > & | m | ) |
Extract keys from a DynMapTree to a DynList.
| Key | The key type. |
| Data | The data type. |
| Tree | The tree implementation template. |
| Compare | The comparison functor. |
| m | The source DynMapTree. |
Definition at line 1169 of file ah-convert.H.
References Aleph::DynList< T >::append(), FunctionalMethods< Container, T >::for_each(), and m.
Referenced by TEST().
| Array< std::pair< Key, Data > > Aleph::maptree_to_Array | ( | const DynMapTree< Key, Data, Tree, Compare > & | m | ) |
Convert a DynMapTree to an Array of pairs.
| Key | The key type. |
| Data | The data type. |
| Tree | The tree implementation template. |
| Compare | The comparison functor. |
| m | The source DynMapTree. |
Definition at line 1124 of file ah-convert.H.
References Aleph::Array< T >::append(), FunctionalMethods< Container, T >::for_each(), m, Aleph::Array< T >::reserve(), and OhashCommon< HashTbl, Key >::size().
Referenced by TEST().
| DynList< std::pair< Key, Data > > Aleph::maptree_to_DynList | ( | const DynMapTree< Key, Data, Tree, Compare > & | m | ) |
Convert a DynMapTree to a DynList of pairs.
Creates a new DynList containing copies of all key-value pairs from the given DynMapTree. Elements are in tree traversal order (in-order).
| Key | The key type. |
| Data | The data type. |
| Tree | The tree implementation template. |
| Compare | The comparison functor. |
| m | The source DynMapTree. |
Definition at line 1103 of file ah-convert.H.
References Aleph::DynList< T >::append(), FunctionalMethods< Container, T >::for_each(), and m.
| std::map< Key, Data > Aleph::maptree_to_stdmap | ( | const DynMapTree< Key, Data, Tree, Compare > & | m | ) |
Convert a DynMapTree to a std::map.
| Key | The key type. |
| Data | The data type. |
| Tree | The tree implementation template. |
| Compare | The comparison functor. |
| m | The source DynMapTree. |
Definition at line 1146 of file ah-convert.H.
References FunctionalMethods< Container, T >::for_each(), and m.
Referenced by TEST().
| DynList< Data > Aleph::maptree_values_to_DynList | ( | const DynMapTree< Key, Data, Tree, Compare > & | m | ) |
Extract values from a DynMapTree to a DynList.
| Key | The key type. |
| Data | The data type. |
| Tree | The tree implementation template. |
| Compare | The comparison functor. |
| m | The source DynMapTree. |
Definition at line 1190 of file ah-convert.H.
References Aleph::DynList< T >::append(), FunctionalMethods< Container, T >::for_each(), and m.
Referenced by TEST().
|
inline |
Mark the current position for potential backtracking.
Saves the current stream position and line/column state so that it can be restored later if needed.
| input_stream | The input file stream |
Definition at line 760 of file parse_utils.H.
References Aleph::StreamPosition::column, current_col_number, current_line_number, Aleph::StreamPosition::line, mark_position(), and Aleph::StreamPosition::pos.
Referenced by mark_position(), TEST_F(), and try_char().
| void Aleph::mat_to_latex | ( | Mat & | mat, |
| long | n, | ||
| long | m, | ||
| std::ofstream & | out, | ||
| const std::string & | prefix = "", |
||
| const std::string & | suffix = "" |
||
| ) |
Overload for std::ofstream output.
Convenience overload that accepts std::ofstream directly.
Definition at line 198 of file mat_latex.H.
References m, mat_to_latex(), out, prefix(), and suffix().
| void Aleph::mat_to_latex | ( | Mat & | mat, |
| long | n, | ||
| long | m, | ||
| std::ostream & | out, | ||
| const std::string & | prefix = "", |
||
| const std::string & | suffix = "" |
||
| ) |
Generate LaTeX tabular representation of a matrix.
Converts a matrix to a LaTeX tabular environment with customizable formatting for row indices, column indices, and matrix entries.
| Mat | Matrix type (must support operator()(long, long) for entry access) |
| RowIndexFormatter | Functor type for formatting row indices. Must provide: std::string operator()(Mat&, long) const |
| ColIndexFormatter | Functor type for formatting column indices. Must provide: std::string operator()(Mat&, long) const |
| EntryFormatter | Functor type for formatting matrix entries. Must provide: std::string operator()(Mat&, long, long) const |
| [in] | mat | The matrix to convert (passed by reference for efficiency) |
| [in] | n | Number of rows |
| [in] | m | Number of columns |
| [out] | out | Output stream to write LaTeX content |
| [in] | prefix | Optional LaTeX content to prepend (e.g., "\\begin{center}") |
| [in] | suffix | Optional LaTeX content to append (e.g., "\\end{center}") |
Definition at line 144 of file mat_latex.H.
References m, mat_to_latex(), out, prefix(), and suffix().
Referenced by mat_to_latex(), mat_to_latex(), and mat_to_latex_simple().
| void Aleph::mat_to_latex_simple | ( | Mat & | mat, |
| long | n, | ||
| long | m, | ||
| std::ostream & | out, | ||
| const std::string & | prefix = "", |
||
| const std::string & | suffix = "" |
||
| ) |
Generate LaTeX table with default formatters.
Simplified version using default integer formatters for indices and stream-based formatting for entries.
| Mat | Matrix type |
| mat | The matrix to convert |
| n | Number of rows |
| m | Number of columns |
| out | Output stream |
| prefix | Optional LaTeX prefix |
| suffix | Optional LaTeX suffix |
Definition at line 276 of file mat_latex.H.
References m, mat_to_latex(), mat_to_latex_simple(), out, prefix(), and suffix().
Referenced by mat_to_latex_simple(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Compute only the minimum multiplication cost (value only).
A convenience version that delegates to matrix_chain_order and returns the min_multiplications value computed there.
| [in] | dims | Array of matrix dimensions ( \(n+1\)entries for \(n\)matrices). |
| ah_domain_error | if dims has fewer than 2 entries. |
| ah_runtime_error | if the cost calculation overflows size_t. |
Definition at line 225 of file Matrix_Chain.H.
References matrix_chain_order(), and Aleph::Matrix_Chain_Result::min_multiplications.
|
inline |
Compute the optimal matrix-chain multiplication order.
Finds the parenthesization that minimizes the total number of scalar multiplications.
| [in] | dims | Array of matrix dimensions. Matrix \(A_i\)is assumed to have dimensions \(dims[i] \times dims[i+1]\). Therefore, for \(n\)matrices, dims must contain \(n+1\)elements. |
| ah_domain_error | if dims has fewer than 2 entries. |
| ah_domain_error | if any dims dimension is zero. |
| ah_runtime_error | if the cost calculation overflows size_t. |
Definition at line 153 of file Matrix_Chain.H.
References ah_domain_error_if, Aleph::Array< T >::append(), Aleph::matrix_chain_detail::build_parens(), Aleph::matrix_chain_detail::checked_add(), Aleph::Array< T >::create(), dim(), k, l, Aleph::Array< T >::reserve(), row, Aleph::matrix_chain_detail::scalar_cost(), Aleph::Array< T >::size(), and split().
Referenced by matrix_chain_min_cost(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
constexprnoexcept |
Get dimensions of a matrix (dense or sparse).
| MatrixT | The matrix type (must satisfy ModularMatrixBackend). |
| [in] | m | The input matrix. |
| none | Does not throw (noexcept). |
Definition at line 95 of file modular_linalg.H.
References m, rows, and OhashCommon< HashTbl, Key >::size().
Referenced by Aleph::Modular_Matrix< MatrixT >::Modular_Matrix(), Aleph::Modular_Matrix< MatrixT >::determinant(), and Aleph::Modular_Matrix< MatrixT >::inverse().
|
inline |
Find the maximum element in a range.
Returns an iterator to the largest element in the range [beg, end) according to the comparison function.
| Itor | Iterator type. |
| CompFunc | Comparison functor type. |
| beg | Iterator to the first element. |
| end | Iterator past the last element. |
| op | Comparison function (defaults to greater-than). |
Definition at line 184 of file ahAlgo.H.
References min_element().
Referenced by TEST().
Definition at line 499 of file tpl_interval_tree.H.
Access max_endpoint of an interval tree node.
Definition at line 496 of file tpl_interval_tree.H.
References Aleph::Interval_Tree_Node_Data< T >::getMaxEndpoint().
Referenced by Aleph::Gen_Interval_Tree< NodeType, T, Compare >::all_overlaps(), Aleph::Gen_Interval_Tree< NodeType, T, Compare >::check_max(), Aleph::Gen_Interval_Tree< NodeType, T, Compare >::join(), Aleph::Gen_Interval_Tree< NodeType, T, Compare >::overlap_search(), Aleph::Gen_Interval_Tree< NodeType, T, Compare >::place(), TEST(), and Aleph::Gen_Interval_Tree< NodeType, T, Compare >::unlink().
| std::tuple< size_t, double > Aleph::max_flow_min_cost_by_cycle_canceling | ( | Net & | net, |
| double | it_factor = 0.4, |
||
| size_t | step = 10 |
||
| ) |
Compute maximum flow at minimum cost using cycle canceling.
This algorithm first computes a maximum flow using a max-flow algorithm (Ford-Fulkerson by default), then iteratively finds and cancels negative cost cycles in the residual network using the Bellman-Ford algorithm until no more negative cycles exist.
The algorithm guarantees that the final flow is:
The costs may be negative: the cheapest maximum flow saturates the cycles of negative cost, also those apart from the source.
| Net | Network type (must be Net_Cost_Graph or compatible). |
| Max_Flow_Algo | Maximum flow algorithm template (default: Ford_Fulkerson_Maximum_Flow). |
| [in,out] | net | The network to compute max-flow min-cost on. Flow values are modified in place. |
| [in] | it_factor | Initial iteration factor for Bellman-Ford's early cycle detection (default: 0.4). |
| [in] | step | Step increment for iteration threshold (default: 10). |
| bad_alloc | If there is not enough memory. |
| domain_error | If network is not single source and single sink, if the maximum flow is infinite, as through a path from the source to the sink of arcs of infinite capacity, which has no cost to minimize, or if the program is unbounded: a cycle of negative cost through arcs without capacity. The network keeps then the maximum flow. |
Definition at line 864 of file tpl_netcost.H.
References arcs_map(), build_residual_net(), cancel_cycle(), count(), Aleph::Net_Graph< NodeT, ArcT >::get_sink(), Aleph::Net_Graph< NodeT, ArcT >::get_source(), Aleph::net_detail::refuse_infinite_maximum_flow(), Aleph::net_detail::return_dust(), GraphCommon< GT, Node, Arc >::vsize(), and Aleph::net_detail::without_capacity().
Referenced by demo_compare_algorithms_on_logistics(), demo_mincost_maxflow(), TEST(), TEST(), TEST(), and TEST().
| size_t Aleph::max_flow_min_cost_by_network_simplex | ( | Net & | net | ) |
Compute maximum flow at minimum cost using Network Simplex.
This algorithm first computes a maximum flow using a max-flow algorithm (Ford-Fulkerson by default), then optimizes cost using the Network Simplex algorithm with a two-phase approach:
| Net | Network type (must be Net_Cost_Graph or compatible). |
| Max_Flow_Algo | Maximum flow algorithm template. |
| [in,out] | net | The network to compute max-flow min-cost on. Flow values are modified in place. |
| bad_alloc | If there is not enough memory. |
| domain_error | If network is not single source and single sink, if the maximum flow is infinite, as through a path from the source to the sink of arcs of infinite capacity, which has no cost to minimize, and which the network keeps; if the flow that Max_Flow_Algo leaves is not feasible (see Network_Simplex::run()), which the maximum flows of the library do not leave; or if the program is unbounded: a cycle of negative cost through arcs without capacity. |
| runtime_error | If the pivots reach their bound before the optimum (see Network_Simplex::run()). |
Definition at line 2601 of file tpl_netcost.H.
References Aleph::net_detail::refuse_infinite_maximum_flow(), and Aleph::Network_Simplex< Net >::run().
Referenced by demo_compare_algorithms_on_logistics(), and TEST().
|
inline |
Find the maximum element in a container.
| container | Source container. |
| cmp | Comparator (defaults to std::less, finds max by reversing comparison). |
Definition at line 2567 of file ahFunctional.H.
References cmp().
| auto Aleph::max_value | ( | const Container & | data | ) | -> std::decay_t<decltype(*std::begin(data))> |
Compute maximum value.
| data | Input container |
| std::invalid_argument | if container is empty |
Definition at line 294 of file stat_utils.H.
References ah_invalid_argument_if, and max_value().
Referenced by Aleph::CA::Reproductions::fit_log_log_histogram(), Aleph::FFT< Real >::max_abs_value(), max_value(), TEST(), TEST(), TEST(), TEST(), TEST_F(), and TEST_F().
| auto Aleph::mean | ( | const Container & | data | ) | -> std::decay_t<decltype(*std::begin(data))> |
Compute the arithmetic mean.
| data | Input container |
| std::invalid_argument | if container is empty |
Definition at line 190 of file stat_utils.H.
References ah_invalid_argument_if, and mean().
Referenced by coefficient_of_variation(), Aleph::FFT< Real >::demean_copy(), demo_practical(), example_parallel_aggregations(), Aleph::howard_detail::karp_by_component(), kurtosis(), mean(), monte_carlo_simulation(), Aleph::CA::Reproductions::morans_i_binary(), Aleph::FFT< Real >::overlap_profile_has_cola(), skewness(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TYPED_TEST(), and TYPED_TEST().
| auto Aleph::median | ( | const Container & | data | ) | -> std::decay_t<decltype(*std::begin(data))> |
Compute the median (50th percentile).
| data | Input container (will be copied and sorted) |
| std::invalid_argument | if container is empty |
Definition at line 393 of file stat_utils.H.
References median(), and percentile().
|
inline |
Return a pointer to the median value among three elements.
A pointer is returned to avoid copies and to allow pointer equality comparisons.
Definition at line 85 of file ahUtils.H.
References cmp(), and median().
Referenced by main(), Aleph::CA::Bench::measure(), median(), median(), Aleph::Gen_File_B_Tree< Key, Compare, MinDegree, Codec >::split_child(), Aleph::Gen_B_Tree< Key, Compare, MinDegree >::split_child(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Definition at line 936 of file ahFunction.H.
|
inline |
Definition at line 930 of file ahFunction.H.
|
inline |
Definition at line 960 of file ahFunction.H.
|
inline |
Definition at line 954 of file ahFunction.H.
|
inline |
Definition at line 948 of file ahFunction.H.
|
inline |
Definition at line 942 of file ahFunction.H.
|
inline |
Definition at line 973 of file ahFunction.H.
|
inline |
Definition at line 966 of file ahFunction.H.
|
inline |
Merge two sorted ranges.
Merges elements from [source1Beg, source1End) and [source2Beg, source2End) into a single sorted sequence starting at destBeg.
| Itor1 | First source iterator type. |
| Itor2 | Second source iterator type. |
| Itor3 | Destination iterator type. |
| source1Beg | Iterator to the first element of the first source. |
| source1End | Iterator past the last element of the first source. |
| source2Beg | Iterator to the first element of the second source. |
| source2End | Iterator past the last element of the second source. |
| destBeg | Iterator to the first destination position. |
Definition at line 1410 of file ahAlgo.H.
Referenced by Aleph::Gen_Reroot_DP< GT, T, SA >::Gen_Reroot_DP(), merge(), TEST(), TEST(), TEST(), validate_bytecode_module(), validate_cfg_module(), validate_ir_module(), and validate_ssa_module().
|
inline |
Merge two sorted ranges with custom comparison.
Merges elements from two sorted ranges into a single sorted sequence using the given comparison function.
| Itor1 | First source iterator type. |
| Itor2 | Second source iterator type. |
| Itor3 | Destination iterator type. |
| BinaryPredicate | Comparison predicate. |
| source1Beg | Iterator to the first element of the first source. |
| source1End | Iterator past the last element of the first source. |
| source2Beg | Iterator to the first element of the second source. |
| source2End | Iterator past the last element of the second source. |
| destBeg | Iterator to the first destination position. |
| op | Binary comparison predicate. |
|
inline |
Merge two sorted partitions of an array using a buffer.
Merges the sorted subarrays [l..m] and [m+1..r] into a single sorted subarray [l..r]. Uses a provided buffer to avoid repeated allocations.
This is the core operation of merge sort. The first partition is moved to the buffer and merged back with the second, which is in place; with equal elements, those of the first partition go first, so that the merge is stable.
Time complexity: O(n), where n = r - l + 1 Space complexity: O(n) for the buffer, which needs room for the first partition
| T | Element type (must be move-assignable and comparable). |
| Compare | Comparison functor type (default: Aleph::less<T>). |
| [in,out] | a | Pointer to the array containing both partitions. |
| [in] | l | Left index of the first partition. |
| [in] | m | Last index of the first partition (m+1 is start of second). |
| [in] | r | Right index of the second partition. |
| [in,out] | buf | Buffer for temporary storage (cleared and reused). |
| cmp | Comparison functor. |
Definition at line 1150 of file tpl_sort_utils.H.
References and, Aleph::Array< T >::base(), cmp(), k, l, m, Aleph::Array< T >::putn(), r, and Aleph::Array< T >::size().
|
inline |
Merges two ordered partitions stored in an array.
merge() assumes as input two partitions ordered between the ranges [l..m] and [m+1..r] and mixes them in an ordering between [l..r].
| [in] | a | the array |
| [in] | l | left index of the array |
| [in] | m | center of the array, of the partition |
| [in] | r | right index of the array |
| cmp | comparison object. |
Definition at line 1219 of file tpl_sort_utils.H.
References cmp(), Aleph::Array< T >::create_reserved(), l, m, merge(), and r.
|
inline |
Merge two sorted Dnode-based lists.
| T | Element type. |
| Compare | Comparison functor. |
| [in,out] | l1 | First sorted list. |
| [in,out] | l2 | Second sorted list. |
| [out] | result | Empty list to receive merged result. |
| [in] | cmp | Comparison functor. |
Definition at line 1350 of file tpl_sort_utils.H.
|
inline |
Merge two sorted lists into a single sorted list.
Takes two sorted lists and merges them into a single sorted list. The input lists are emptied and their nodes are transferred to the result list. This is an O(n) operation with O(1) extra space.
Time complexity: O(n + m), where n and m are the list sizes Space complexity: O(1) - nodes are moved, not copied
| Tlist | List type (e.g., Dlink, HTList). |
| Compare | Comparison functor for list elements. |
| [in,out] | l1 | First sorted list (will be emptied). |
| [in,out] | l2 | Second sorted list (will be emptied). |
| [out] | result | Empty list to receive merged result. |
| cmp | Comparison functor. |
Definition at line 1321 of file tpl_sort_utils.H.
References and, cmp(), Aleph::DynList< T >::get_first_ne(), Aleph::HTList::is_empty(), l1, l2, and Aleph::DynList< T >::remove_first_ne().
|
inline |
Sort a list by mergesort combined with the insert method.
Sort a list using the mergesort method dynamic (DynList or DynDlist) according to comparison criteria Compare.
This method has a deterministic performance of \(O(n \; \lg n)\) and space consumption of \(O(\lg n)\) due to the recursive call stack. It is a very good method for lists.
| [in,out] | list | the list to be sorted. |
| lsz | size threshold to switch to insertion sort. | |
| cmp | comparison object. |
Definition at line 1482 of file tpl_sort_utils.H.
Merge sort for Dnode-based lists.
| T | Element type. |
| Compare | Comparison functor. |
| [in,out] | list | The list to sort. |
| [in] | cmp | Comparison functor. |
Definition at line 1550 of file tpl_sort_utils.H.
References cmp().
Merge sort for DynDlist.
| T | Element type. |
| Compare | Comparison functor. |
| [in,out] | list | The list to sort. |
| [in] | cmp | Comparison functor. |
Definition at line 1563 of file tpl_sort_utils.H.
References cmp().
Merge sort for DynList (rvalue overload).
Moves the input list into the sorted result.
| T | Element type. |
| Compare | Comparison functor. |
| [in,out] | list | The list to sort (rvalue). |
| [in] | cmp | Comparison functor. |
Definition at line 1600 of file tpl_sort_utils.H.
References cmp().
Merge sort for DynList.
The nodes are linked again, so that nothing is allocated and the references to the items stay valid.
| T | Element type. |
| Compare | Comparison functor. |
| [in,out] | list | The list to sort. |
| [in] | cmp | Comparison functor. |
| anything | that cmp throws. Then list keeps all its items, in an unspecified order. |
Definition at line 1581 of file tpl_sort_utils.H.
References cmp().
| void Aleph::mergesort | ( | T * | a, |
| const long | l, | ||
| const long | r, | ||
| Array< T > & | buf, | ||
| Compare | cmp | ||
| ) |
Sort an array using merge sort with a reusable buffer.
| a | Pointer to the array. |
| l | Left index (inclusive). |
| r | Right index (inclusive). |
| buf | Reusable buffer for merging. |
| cmp | Comparison functor. |
Definition at line 1233 of file tpl_sort_utils.H.
References cmp(), l, m, and r.
Referenced by benchmark_list_algorithms(), demonstrate_complexity(), in_place_multisort_arrays(), main(), mergesort(), Aleph::Random_Graph_Base< GT, Init_Node, Init_Arc >::sort_components(), TEST(), TEST_F(), and welsh_powell_coloring().
|
inline |
Sort an array using merge sort.
Merge sort is a divide-and-conquer algorithm that recursively divides the array in half, sorts each half, and merges the sorted halves.
| T | Element type (must be move-assignable and comparable). |
| Compare | Comparison functor type (default: Aleph::less<T>). |
| [in,out] | a | Pointer to the array to sort. |
| [in] | l | Left index (inclusive) of the range to sort. |
| [in] | r | Right index (inclusive) of the range to sort. |
| cmp | Comparison functor. |
Definition at line 1284 of file tpl_sort_utils.H.
References cmp(), Aleph::Array< T >::create_reserved(), l, mergesort(), and r.
|
inline |
Sort a linked list using merge sort.
Merge sort is particularly efficient for linked lists because:
This is often the best sorting algorithm for linked lists.
| [in,out] | list | The list to sort. |
| cmp | Comparison functor. |
| anything | that cmp throws. Then list keeps all its elements, in an unspecified order. |
Definition at line 1388 of file tpl_sort_utils.H.
References cmp(), Aleph::DynList< T >::get_first_ne(), l, and r.
|
inline |
Merge sort for generic list templates.
| Tlist | List template type. |
| T | Element type. |
| Compare | Comparison functor. |
| [in,out] | list | The list to sort. |
| [in] | cmp | Comparison functor. |
Definition at line 1534 of file tpl_sort_utils.H.
References cmp().
|
extern |
Print an informational message with file and line info.
| file | Source file name (use FILE). |
| line | Line number (use LINE). |
| format | Printf-style format string. |
| ... | Format arguments. |
Definition at line 95 of file ahDefs.C.
Referenced by Aleph::Compiler_Driver::append_run_failure_if_needed(), Aleph::Compiler_Generic_Driver::append_run_failure_if_needed(), Aleph::Interpreter_Runtime::call_host_function(), demo_basic_operations(), Aleph::Compiler_Driver::emit_driver_diagnostic(), Aleph::Compiler_MVP_Frontend::emit_driver_diagnostic(), Aleph::Compiler_Line_Frontend::emit_error(), Aleph::Compiler_Typed_Semantic_Analyzer::emit_error(), Aleph::Compiler_Lexer::emit_error(), Aleph::Compiler_Parser::emit_error(), Aleph::Compiler_Parser_Stream::emit_error(), Aleph::Compiler_Semantic_Analyzer::emit_error(), Aleph::Compiler_Parser::expect(), Aleph::Compiler_Parser_Stream::expect(), Aleph::Compiler_C_Backend::Emitter::fail(), Aleph::Compiler_Bytecode_VM::make_error(), Aleph::Compiler_Bytecode_VM::make_validation_error(), Aleph::Interpreter_Runtime::runtime_error(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), validate_bytecode_function(), validate_dataflow_analysis(), validate_dead_code_elimination(), validate_ssa_function(), and Aleph::Compiler_C_Backend::Emitter::warn().
|
inlinenoexcept |
Miller-Rabin primality test for 64-bit integers.
A deterministic primality test for any 64-bit unsigned integer. It uses a known sufficient set of 7 bases (Jim Sinclair's set) to guarantee correctness for all n < 2^64.
| n | The number to test for primality. |
Definition at line 88 of file primality.H.
References Aleph::detail::check_composite().
Referenced by Aleph::Modular_Matrix< MatrixT >::Modular_Matrix(), Aleph::ModularCombinatorics::ModularCombinatorics(), demo_primality_factorization(), Aleph::detail::extract_prime_factors(), TEST(), and TEST().
| Net::Flow_Type Aleph::min_cut | ( | Net & | net, |
| DynSetTree< typename Net::Node * > & | vs, | ||
| DynSetTree< typename Net::Node * > & | vt, | ||
| DynList< typename Net::Arc * > & | cuts, | ||
| DynList< typename Net::Arc * > & | cutt | ||
| ) |
Compute max flow and the corresponding minimum cut.
| [in,out] | net | Flow network (must have a single source and sink). |
| [out] | vs | Set of nodes in V_s. |
| [out] | vt | Set of nodes in V_t. |
| [out] | cuts | Arcs from V_s to V_t (the cut). |
| [out] | cutt | Arcs from V_t to V_s. |
Definition at line 2790 of file tpl_net.H.
References and, Aleph::DynSetTree< Key, Tree, Compare >::contains(), Aleph::Net_Graph< NodeT, ArcT >::flow_value(), GraphCommon< GT, Node, Arc >::get_num_nodes(), Aleph::Net_Graph< NodeT, ArcT >::get_source(), GraphCommon< GT, Node, Arc >::get_src_node(), GraphCommon< GT, Node, Arc >::get_tgt_node(), Aleph::DynSetTree< Key, Tree, Compare >::insert(), Aleph::DynList< T >::insert(), Aleph::Filter_Iterator< Container, It, Show_Item >::next_ne(), Aleph::DynSetTree< Key, Tree, Compare >::size(), and Unprocessed.
Referenced by Aleph::Karger_Min_Cut< GT, SA >::compute_min_cut_size(), example_network_reliability(), Aleph::Karger_Min_Cut< GT, SA >::karger_min_cut(), segment_image(), solve_project_selection(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), test_sw_chain_weighted(), test_sw_complete_k4(), test_sw_empty_graph(), test_sw_min_cut_weight_only(), test_sw_single_edge(), test_sw_triangle_weighted(), test_sw_two_heavy_clusters(), test_sw_unit_weight(), TYPED_TEST(), TYPED_TEST(), and verify_max_flow_min_cut().
|
inline |
Find the minimum element in a range.
Returns an iterator to the smallest element in the range [beg, end) according to the comparison function.
| Itor | Iterator type. |
| CompFunc | Comparison functor type. |
| beg | Iterator to the first element. |
| end | Iterator past the last element. |
| op | Comparison function (defaults to less-than). |
Definition at line 148 of file ahAlgo.H.
References min().
Referenced by max_element(), TEST(), TEST(), TEST(), test_non_power_of_two_sizes(), test_performance_build_large(), and test_power_of_two_sizes().
| auto Aleph::min_max | ( | const Container & | data | ) | -> std::pair<std::decay_t<decltype(*std::begin(data))>, std::decay_t<decltype(*std::begin(data))>> |
Compute minimum and maximum values in one pass.
| data | Input container |
| std::invalid_argument | if container is empty |
Definition at line 316 of file stat_utils.H.
References ah_invalid_argument_if, and min_max().
Referenced by compute_all_stats(), histogram(), min_max(), TEST(), TEST(), and TEST().
|
inline |
Find the minimum element in a container.
| container | Source container. |
| cmp | Comparator (defaults to std::less). |
Definition at line 2541 of file ahFunctional.H.
References cmp().
| auto Aleph::min_value | ( | const Container & | data | ) | -> std::decay_t<decltype(*std::begin(data))> |
Compute minimum value.
| data | Input container |
| std::invalid_argument | if container is empty |
Definition at line 272 of file stat_utils.H.
References ah_invalid_argument_if, and min_value().
Referenced by Aleph::CA::Reproductions::fit_log_log_histogram(), min_value(), TEST(), TEST(), TEST(), TEST(), TEST_F(), and TEST_F().
|
inline |
Weighted squared-distance lower envelope on a line.
For each query coordinate x_i, computes:
by transforming each site (x_j, weight_j) into a line: m = -2*x_j, b = x_j^2 + weight_j, then adding back x_i^2.
This is a geometric application of CHT/Li Chao (lower envelope of parabolas) and also a common DP optimization pattern.
| T | Signed integral numeric type. |
| [in] | xs | Signed integral coordinates. |
| [in] | weights | Additive weights per coordinate. |
| ah_domain_error | if array sizes differ. |
Definition at line 850 of file DP_Optimizations.H.
References Aleph::Li_Chao_Tree< T >::add_line(), ah_domain_error_if, and, Aleph::Array< T >::create(), m, Aleph::Li_Chao_Tree< T >::query(), and Aleph::Array< T >::size().
|
inline |
Find both min and max elements in a single pass.
| container | Source container. |
| cmp | Comparator (defaults to std::less). |
Definition at line 2595 of file ahFunctional.H.
References cmp().
|
inline |
Find the first mismatching elements in two ranges.
Compares elements in the range [beg, end) with elements starting at cmpBeg and returns the first pair that differs.
| Itor1 | First range iterator type. |
| Itor2 | Second range iterator type. |
| BinaryPredicate | Comparison predicate. |
| beg | Iterator to the first element of the first range. |
| end | Iterator past the last element of the first range. |
| cmpBeg | Iterator to the first element of the second range. |
| op | Binary predicate for comparison. |
Definition at line 516 of file ahAlgo.H.
References and.
|
inline |
Modular exponentiation.
Computes (base^exp) % m in O(log exp) time.
| base | The base. |
| exp | The exponent. |
| m | The modulus. |
| std::invalid_argument | if m == 0. |
Definition at line 110 of file modular_arithmetic.H.
References ah_invalid_argument_if, exp(), m, and mod_mul().
Referenced by Aleph::detail::check_composite(), Aleph::Gen_Polynomial< Coefficient >::eval_mod_u64(), Aleph::NTT< MOD, ROOT >::Plan::initialize_bluestein_plan(), Aleph::NTT< MOD, ROOT >::poly_power(), TEST(), TEST_F(), and Aleph::NTT< MOD, ROOT >::tonelli_shanks().
|
inline |
Modular Inverse.
Computes the modular inverse of a modulo m using an iterative extended Euclidean algorithm that works entirely in unsigned arithmetic. Safe for all 64-bit values including m >= 2^63.
Requires gcd(a, m) == 1 (i.e., a and m must be coprime).
| a | The number to find the inverse of. |
| m | The modulus (must be > 0). |
| std::domain_error | if m == 0. |
| std::invalid_argument | if the inverse does not exist (a and m are not coprime, or a == 0 mod m). |
Definition at line 169 of file modular_arithmetic.H.
References ah_domain_error_if, ah_invalid_argument_if, m, and mod_mul().
Referenced by Aleph::ModularCombinatorics::ModularCombinatorics(), Aleph::NTT< MOD, ROOT >::Plan::Plan(), crt(), Aleph::Modular_Matrix< MatrixT >::determinant(), Aleph::Gen_Polynomial< Coefficient >::hensel_lift(), Aleph::NTT< MOD, ROOT >::Plan::initialize_bluestein_plan(), Aleph::NTT< MOD, ROOT >::Plan::initialize_power_of_two_plan(), Aleph::NTT< MOD, ROOT >::Plan::initialize_twiddles(), Aleph::NTT< MOD, ROOT >::interpolate(), Aleph::Modular_Matrix< MatrixT >::inverse(), Aleph::NTT< MOD, ROOT >::negacyclic_multiply(), Aleph::NTT< MOD, ROOT >::poly_integral(), Aleph::NTT< MOD, ROOT >::poly_inverse(), Aleph::NTT< MOD, ROOT >::poly_power(), Aleph::NTT< MOD, ROOT >::poly_sqrt(), Aleph::NTTExact::reconstruct_coefficient(), and TEST().
|
inline |
Safe 64-bit modular multiplication.
Computes (a * b) % m without overflow. Uses 128-bit integer types internally when available.
| a | First multiplier. |
| b | Second multiplier. |
| m | Modulus. |
| std::invalid_argument | if m == 0. |
Definition at line 67 of file modular_arithmetic.H.
References ah_invalid_argument_if, and m.
Referenced by Aleph::ModularCombinatorics::ModularCombinatorics(), Aleph::NTT< MOD, ROOT >::Plan::apply_bluestein_transform(), Aleph::detail::check_composite(), crt(), demo_modular_arithmetic(), Aleph::Modular_Matrix< MatrixT >::determinant(), Aleph::Gen_Polynomial< Coefficient >::eval_mod_u64(), Aleph::Gen_Polynomial< Coefficient >::hensel_lift(), Aleph::NTT< MOD, ROOT >::interpolate(), Aleph::Modular_Matrix< MatrixT >::inverse(), Aleph::ModularCombinatorics::lucas_nCk(), mod_exp(), mod_inv(), Aleph::NTT< MOD, ROOT >::Plan::multiply_impl(), Aleph::ModularCombinatorics::nCk(), Aleph::NTT< MOD, ROOT >::negacyclic_multiply(), Aleph::detail::pollard_rho_step(), Aleph::NTT< MOD, ROOT >::poly_derivative(), Aleph::NTT< MOD, ROOT >::poly_eval(), Aleph::NTT< MOD, ROOT >::poly_integral(), Aleph::NTT< MOD, ROOT >::poly_power(), Aleph::NTT< MOD, ROOT >::poly_scalar_mul_series(), Aleph::NTTExact::reconstruct_coefficient(), TEST(), and Aleph::NTT< MOD, ROOT >::tonelli_shanks().
| auto Aleph::mode | ( | const Container & | data | ) | -> std::decay_t<decltype(*std::begin(data))> |
Compute the mode (most frequent value).
For continuous data, consider discretizing first. If multiple values have the same frequency, returns the first one encountered.
| data | Input container |
| std::invalid_argument | if container is empty |
Definition at line 447 of file stat_utils.H.
References ah_invalid_argument_if, StlAlephIterator< SetName >::begin(), count(), and mode().
Referenced by Aleph::detail::Pid_File_Lock::acquire(), main(), mode(), Aleph::Gen_File_B_Tree< Key, Compare, MinDegree, Codec >::open_storage(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::open_storage(), Aleph::detail::Pid_File_Lock::register_path(), Aleph::FFT< Real >::simd_preference(), Aleph::NTT< MOD, ROOT >::simd_preference(), TEST(), TEST(), TEST(), TEST(), TEST(), and Aleph::detail::Pid_File_Lock::unregister_path().
|
inline |
Optimize windowed min-transition DP with a monotone queue.
Solves:
| Cost | Numeric DP cost type. |
| [in] | base_cost | Additive base cost per state. |
| [in] | window | Maximum predecessor distance. |
| [in] | inf | Sentinel for unreachable states. |
| ah_domain_error | if window == 0 and size > 1. |
Definition at line 779 of file DP_Optimizations.H.
References ah_domain_error_if, ah_runtime_error_if, and, Aleph::Array< T >::append(), Aleph::Array< T >::create(), Aleph::Array< T >::remove_last(), and Aleph::Array< T >::size().
|
inlinestaticnoexcept |
|
inline |
Definition at line 378 of file hash-fct.H.
References MurmurHash3_x64_128(), MurmurHash3_x86_32(), and seed.
|
inline |
Definition at line 361 of file hash-fct.H.
References MurmurHash3_x64_128(), MurmurHash3_x86_32(), and seed.
Referenced by Aleph::Compact_Cuckoo_Filter< T, FingerprintBits, EntriesPerBucket >::alt_index(), Aleph::Cuckoo_Filter< T, FingerprintBits, EntriesPerBucket >::alt_index(), Aleph::Count_Min_Sketch< T, CounterT >::estimate(), Aleph::Compact_Quotient_Filter< T >::fingerprint(), Aleph::Quotient_Filter< T >::fingerprint(), Aleph::HyperLogLog< T >::hash64(), Aleph::SimHash< T >::hash64(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), Aleph::MinHash< T >::update(), and Aleph::Count_Min_Sketch< T, CounterT >::update().
|
inline |
Definition at line 395 of file hash-fct.H.
References MurmurHash3_x64_128(), MurmurHash3_x86_32(), and seed.
| void Aleph::MurmurHash3_x64_128 | ( | const void * | key, |
| const int | len, | ||
| const uint32_t | seed, | ||
| void * | out | ||
| ) |
Definition at line 556 of file hash-fct.C.
References BIG_CONSTANT, fmix64(), out, read_le64(), ROTL64, seed, and write_le64().
Referenced by murmur3hash(), murmur3hash(), and murmur3hash().
| void Aleph::MurmurHash3_x86_128 | ( | const void * | key, |
| const int | len, | ||
| uint32_t | seed, | ||
| void * | out | ||
| ) |
Definition at line 452 of file hash-fct.C.
References fmix32(), out, read_le32(), ROTL32, seed, and write_le32().
| void Aleph::MurmurHash3_x86_32 | ( | const void * | key, |
| int | len, | ||
| uint32_t | seed, | ||
| void * | out | ||
| ) |
Definition at line 399 of file hash-fct.C.
References fmix32(), out, read_le32(), ROTL32, seed, and write_le32().
Referenced by murmur3hash(), murmur3hash(), and murmur3hash().
|
inline |
Convert a std::string to lower-case in-place.
| [in,out] | str | String to modify. |
str. Definition at line 352 of file ah-string-utils.H.
Referenced by TEST().
|
inline |
Convert a std::string to upper-case in-place.
| [in,out] | str | String to modify. |
str. Definition at line 364 of file ah-string-utils.H.
Referenced by TEST().
| auto Aleph::negamax_search | ( | Domain | domain, |
| typename Domain::State | initial_state, | ||
| ExplorationPolicy | policy = Negamax<Domain>::default_policy(), |
||
| SearchLimits | limits = {} |
||
| ) |
Convenience wrapper for one-shot Negamax search.
Definition at line 1233 of file Negamax.H.
References negamax_search().
Referenced by main(), negamax_search(), negamax_search(), negamax_search(), negamax_search(), negamax_search(), negamax_search(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
| and AdversarialTranspositionMemo< Table, typename Domain::State_Key, typename Domain::Move, typename Domain::Score > auto Aleph::negamax_search | ( | Domain | domain, |
| typename Domain::State | initial_state, | ||
| Table & | table, | ||
| ExplorationPolicy | policy = Negamax<Domain>::default_policy(), |
||
| SearchLimits | limits = {} |
||
| ) |
Convenience wrapper for Negamax search with domain-provided state key.
Definition at line 1289 of file Negamax.H.
References negamax_search().
| auto Aleph::negamax_search | ( | Domain | domain, |
| typename Domain::State | initial_state, | ||
| Table & | table, | ||
| Keyer | keyer, | ||
| ExplorationPolicy | policy = Negamax<Domain>::default_policy(), |
||
| SearchLimits | limits = {} |
||
| ) |
Convenience wrapper for Negamax search with transposition table.
Definition at line 1258 of file Negamax.H.
References negamax_search().
| and AdversarialSearchTracer< Tracer, typename Domain::Move, typename Domain::Score > auto Aleph::negamax_search | ( | Domain | domain, |
| typename Domain::State | initial_state, | ||
| Table & | table, | ||
| Keyer | keyer, | ||
| Tracer & | tracer, | ||
| ExplorationPolicy | policy = Negamax<Domain>::default_policy(), |
||
| SearchLimits | limits = {} |
||
| ) |
Convenience wrapper for Negamax search with TT/keyer and tracing.
Definition at line 1273 of file Negamax.H.
References negamax_search().
| and AdversarialTranspositionMemo< Table, typename Domain::State_Key, typename Domain::Move, typename Domain::Score > and AdversarialSearchTracer< Tracer, typename Domain::Move, typename Domain::Score > auto Aleph::negamax_search | ( | Domain | domain, |
| typename Domain::State | initial_state, | ||
| Table & | table, | ||
| Tracer & | tracer, | ||
| ExplorationPolicy | policy = Negamax<Domain>::default_policy(), |
||
| SearchLimits | limits = {} |
||
| ) |
Convenience wrapper for Negamax search with domain-provided key and tracing.
Definition at line 1304 of file Negamax.H.
References negamax_search().
| auto Aleph::negamax_search | ( | Domain | domain, |
| typename Domain::State | initial_state, | ||
| Tracer & | tracer, | ||
| ExplorationPolicy | policy = Negamax<Domain>::default_policy(), |
||
| SearchLimits | limits = {} |
||
| ) |
Convenience wrapper for one-shot Negamax search with tracing.
Definition at line 1245 of file Negamax.H.
References negamax_search().
| std::string Aleph::network_to_dot_string | ( | const Net & | net, |
| const DotExportOptions & | options = DotExportOptions() |
||
| ) |
Generate DOT string for network (instead of file).
| Net | Network type. |
| net | Network to export. |
| options | Export options. |
Definition at line 580 of file net_utils.H.
References and, color(), Aleph::Net_Graph< NodeT, ArcT >::get_sink(), Aleph::Net_Graph< NodeT, ArcT >::get_source(), GraphCommon< GT, Node, Arc >::get_src_node(), GraphCommon< GT, Node, Arc >::get_tgt_node(), Aleph::Net_Graph< NodeT, ArcT >::is_single_sink(), Aleph::Net_Graph< NodeT, ArcT >::is_single_source(), Aleph::Filter_Iterator< Container, It, Show_Item >::next_ne(), options, and out.
Referenced by demo_dot_export(), and TEST_F().
Export network to JSON string.
| Net | Network type. |
| net | Network to export. |
Definition at line 751 of file net_utils.H.
References GraphCommon< GT, Node, Arc >::esize(), Aleph::Net_Graph< NodeT, ArcT >::get_sink(), Aleph::Net_Graph< NodeT, ArcT >::get_source(), GraphCommon< GT, Node, Arc >::get_src_node(), GraphCommon< GT, Node, Arc >::get_tgt_node(), Aleph::Net_Graph< NodeT, ArcT >::is_single_sink(), Aleph::Net_Graph< NodeT, ArcT >::is_single_source(), Aleph::Filter_Iterator< Container, It, Show_Item >::next_ne(), out, and GraphCommon< GT, Node, Arc >::vsize().
Referenced by demo_json_export(), and TEST_F().
| void Aleph::next | ( | ) |
Advance all underlying iterators (bounds-checked).
Definition at line 236 of file ah-zip.H.
Referenced by Aleph::DynSlist< T >::DynSlist(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Johnson(), Aleph::MpscQueue< T >::~MpscQueue(), adjacent_find(), Aleph::CA::Sequential_Update< Order >::apply(), Aleph::CA::Random_Asynchronous_Update< Engine_Type >::apply(), Aleph::eulerian_detail::arcs_are_together(), Aleph::dry_detail::assign_fold(), Aleph::blossom_detail::Edmonds_Blossom_Matcher< GT, SA >::augment_matching(), Aleph::random_detail::bounded(), Aleph::random_detail::bounded_after_a_low_product(), Aleph::Aho_Corasick::build(), Aleph::Bounded_Cycle_Index< GT >::build(), Aleph::planarity_detail::LR_Planarity_Checker< GT, SA >::build_combinatorial_embedding_linear_lr(), build_cycle_graph(), build_level_graph(), Aleph::k_shortest_paths_detail::build_suffix_state(), capacity_scaling_maximum_flow(), Aleph::MonotonePolygonTriangulation::classify_vertex(), Aleph::planarity_detail::LR_Planarity_Checker< GT, SA >::compute_faces_from_rotation(), Aleph::Suffix_Automaton::contains(), Aleph::Aho_Corasick::contains_any(), Aleph::negative_cycles_detail::cyclic_core(), Aleph::Fibonacci_Heap< T, Compare >::delete_all_nodes(), delete_tree(), demo_practical(), RandomTreeTest::destroy_tree(), Aleph::tree_node_detail::detach_tree(), dinic_blocking_flow(), Aleph::Gen_Polynomial< Coefficient >::divide_by_monic_linear_mod(), Aleph::SpscQueue< T >::emplace_impl(), Aleph::DynSkipList< Key, Compare >::empty(), Aleph::howard_detail::Solver< Cost_Type >::evaluate(), Aleph::Suffix_Automaton::extend(), Aleph::Fenwick_Tree< T >::find_kth(), Aleph::Find_Path_Depth_First< GT, Itor, SA >::find_path(), Aleph::BinTreeXt_Operation< Node, Cmp >::find_position(), Aleph::Testing::LayeredNetworkGenerator< Net >::generate(), Aleph::SkipList< Key, Type >::Node::get_next(), Aleph::Find_Eulerian_Path< GT, SN, SA >::hierholzer_directed(), Aleph::Find_Eulerian_Path< GT, SN, SA >::hierholzer_undirected(), hlpp_maximum_flow(), hopcroft_karp_dfs(), Aleph::CuttingEarsTriangulation::init_ears(), Aleph::SkipList< Key, Type >::Iterator::is_last(), Aleph::MonotonePolygonTriangulation::is_y_monotone(), Aleph::Suffix_Automaton::longest_common_substring(), main(), Aleph::random_detail::masked(), Aleph::Stoer_Wagner_Min_Cut< GT, Distance, SA >::minimum_cut_phase(), next_combination_mask(), Aleph::Tarjan_Connected_Components< GT, Itor, SA >::next_target(), Aleph::cancellation_detail::Exact_State::notify_locked_observers(), Aleph::GiftWrappingConvexHull::operator()(), Aleph::CA::History_Rule< Depth, F >::operator()(), Aleph::CuttingEarsTriangulation::operator()(), Aleph::CA::Continuous_Rule< F, Kernel >::operator()(), Aleph::DynSlist< T >::operator=(), Aleph::Network_Simplex< Net >::pivot_tree(), planar_dual_metadata(), Aleph::FFT< Real >::polynomial_from_roots_complex(), Aleph::MpscQueue< T >::pop_node(), Aleph::GenLinearHashTable< Key, BucketType, Cmp >::remove_bucket(), Aleph::CA::ca_checkpoint_detail::restore_frame_from_bytes(), Aleph::net_detail::return_dust(), Aleph::Aho_Corasick::search(), Aleph::VisvalingamWhyattSimplification::simplify_open_array(), Aleph::VisvalingamWhyattSimplification::simplify_polygon(), skip_whitespace_and_comments(), Aleph::howard_detail::Arithmetic< Cost_Type, true >::step(), Aleph::howard_detail::Arithmetic< Cost_Type, false >::step(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), Aleph::Test_For_Path< GT, SA >::test_path(), TimeoutQueue::triggerEvent(), TYPED_TEST(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::verify_leaf_chain(), Aleph::df_tree_detail::Df_Low_Builder< GT, Node_Label, SA >::visit(), and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::wide_arcs().
|
inline |
Advance an index-combination [i0 < i1 < ... < i(k-1)] to the next one.
idx must contain valid strictly increasing indices in [0, n).
| [in,out] | idx | Current combination indices. |
| [in] | n | Universe size. |
| [in] | reset_on_last | Whether to reset to {0,1,...,k-1} at the end. |
true if advanced; false if idx was already the last one.| ah_domain_error | if idx is not strictly increasing. |
| ah_out_of_range_error | if an index is outside [0, n). |
Definition at line 878 of file ah-comb.H.
Referenced by lazy_combinations(), TEST(), TEST(), TEST(), and TEST().
|
inline |
|
inline |
Advance a fixed-popcount bitmask to the next combination (Gosper hack).
The mask is interpreted over the low n bits.
| [in,out] | mask | Current mask. |
| [in] | n | Number of active low bits (domain size). |
| [in] | reset_on_last | Whether to reset to the first mask when done. |
true if advanced; false if already last within n bits.| ah_out_of_range_error | if n > 64. |
| ah_domain_error | if mask has bits outside the low n bits. |
Definition at line 919 of file ah-comb.H.
References ah_domain_error_if, ah_out_of_range_error_if, first_combination_mask(), k, next(), and r.
|
noexcept |
Advance all underlying iterators (unchecked variant).
Requires has_curr().
| what | next_ne() of the underlying iterators throws; nothing with most of them. The inorder iterator of a binary tree (Aleph::BinNodeInfixIterator) throws std::bad_alloc if the tree is deeper than its inline capacity and the pending nodes cannot be moved to the heap. |
Requires has_curr().
| what | next_ne() of the underlying iterators throws, as ZipIterator::next_ne() does. |
Definition at line 252 of file ah-zip.H.
Referenced by Aleph::SkipList< Key, Type >::Iterator::next(), Aleph::SkipList< Key, Type >::Iterator::operator++(), Aleph::SkipList< Key, Type >::Iterator::operator++(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST_F().
|
inline |
Compute the next lexicographic permutation of an Array.
This function follows the classical linear-time pivot/successor/suffix algorithm.
true is returned.reset_on_last == true, the array is reset to the first permutation and false is returned;reset_on_last == false, the array is left unchanged and false is returned.Duplicate values are fully supported. Starting from a sorted array yields each distinct permutation exactly once.
| T | Element type. |
| Compare | Strict weak ordering comparator. |
| [in,out] | a | Sequence to transform. |
| [in] | cmp | Ordering relation. |
| [in] | reset_on_last | Whether to reset to the first permutation. |
true if advanced to a new permutation; false otherwise.Definition at line 800 of file ah-comb.H.
References cmp().
Referenced by lazy_permutations(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Return the smallest power of 2 that is not less than x.
| [in] | x | value to round up; 0 gives 1. |
x if it is a power of 2, otherwise the next power of 2. | std::overflow_error | if x is greater than the largest power of 2 that a size_t can hold. |
Definition at line 243 of file ahUtils.H.
References ah_overflow_error_if, and is_power_of_2().
Referenced by Aleph::Compact_Cuckoo_Filter< T, FingerprintBits, EntriesPerBucket >::Compact_Cuckoo_Filter(), Aleph::Cuckoo_Filter< T, FingerprintBits, EntriesPerBucket >::Cuckoo_Filter(), and TEST().
|
inline |
|
inline |
Convert a 4-bit nibble stored in an int to its hex character.
Valid values are 0..15; the result is in 0..9A..F.
Definition at line 126 of file ahUtils.H.
References and.
Referenced by hexadecimalize(), and TEST().
|
inline |
Determines if operands are not equal using a comparison operator.
| op1 | First operand |
| op2 | Second operand |
| cmp | Comparison functor |
Definition at line 1102 of file ahFunction.H.
References cmp().
Access the height label stored in NODE_COUNTER.
Definition at line 2371 of file tpl_net.H.
References NODE_COUNTER.
|
inline |
Overload of none.
Definition at line 2196 of file ahFunctional.H.
|
inline |
Return true if no element satisfies operation.
This is the complement of exists().
Definition at line 2189 of file ahFunctional.H.
References exists().
Referenced by Aleph::negative_cycles_detail::cheapest_parallel_arcs(), demo_predicates(), diamond_backward(), find_disjoint_negative_cycles(), Aleph::min_mean_cycle_detail::karp_answer(), Aleph::min_mean_cycle_detail::karp_table(), most_negative_cycle_bounded(), most_negative_cycle_up_to_3(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), Moved_From_Case< F::OverlapAddBank >::use(), and Moved_From_Case< ModularCombinatorics >::use().
Return true if no tuple element satisfies pred.
This is the complement of any_of_tuple. Returns true if the predicate returns false for all elements in the tuple.
| Pred | Predicate type (must be callable with each tuple element type). |
| Tuple | Tuple type to check. |
| pred | Predicate to test on each element. |
| t | Tuple to check. |
true if pred returns false for all elements.Definition at line 2042 of file ah-zip.H.
References any_of_tuple(), and pred.
| bool Aleph::none_perm | ( | const DynList< DynList< T > > & | l, |
| Pred && | pred | ||
| ) |
Convenience overload accepting an rvalue callable.
Definition at line 703 of file ah-comb.H.
References l, none_perm(), and pred.
| bool Aleph::none_perm | ( | const DynList< DynList< T > > & | l, |
| Pred & | pred | ||
| ) |
Check if no permutation satisfies a predicate.
Equivalent to !exists_perm(l, pred).
| T | Element type. |
| Pred | Callable with signature bool(const DynList<T>&). |
| [in] | l | List of lists. |
| [in] | pred | Predicate to test. |
true if no permutation satisfies pred. Definition at line 694 of file ah-comb.H.
References exists_perm(), l, and pred.
Referenced by demo_perm_predicates(), none_perm(), TEST(), TEST(), and TEST().
|
inline |
Definition at line 411 of file ahFunction.H.
|
inline |
Definition at line 441 of file ahFunction.H.
|
inline |
Generate exactly n values evenly spaced between [start, end].
| start | Start value. |
| end | End value. |
| n | Number of values to generate. |
| std::domain_error | if n < 1. |
Definition at line 315 of file ahFunctional.H.
References ah_domain_error_if.
Referenced by demo_ranges(), TEST(), and TEST().
|
inlinenoexcept |
Definition at line 713 of file hash-fct.H.
References h.
|
inlinenoexcept |
Definition at line 586 of file hash-fct.H.
References oat_hash().
|
inlinenoexcept |
Definition at line 816 of file hash-fct.H.
References oat_hash().
Return true if p lies on segment s (exact).
Definition at line 2961 of file point.H.
References Aleph::Segment::contains().
Referenced by Aleph::Polygon::locate_point(), Aleph::ConvexPolygonIntersectionBasic::push_clean(), Aleph::HalfPlaneIntersection::push_clean(), segment_intersection_point(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Extract alphanumeric ASCII characters and normalize letters to lower-case.
0..9a..z as-isA..Z to lower-case| [in] | str | Input std::string. |
Definition at line 381 of file ah-string-utils.H.
References and.
Referenced by demo_filtering(), and TEST().
|
inline |
Open a gap in an array by shifting elements right.
Moves elements from [pos, n-num_entries) to [pos+num_entries, n), creating space for num_entries new elements at position pos.
| Tarray | Array-like type with operator[] |
| ptr | Array to modify |
| n | Current number of elements |
| pos | Position where to open gap (default 0) |
| num_entries | Number of positions to open (default 1) |
| std::out_of_range | if pos >= n or num_entries > available space |
Definition at line 96 of file array_utils.H.
References ah_out_of_range_error_if, and k.
Referenced by Aleph::DynArray< T >::insert(), Aleph::DynArray< T >::insert(), Aleph::Gen_B_Tree< Key, Compare, MinDegree >::insert_at(), Aleph::Gen_BPlus_Tree< Key, Compare, MinDegree >::insert_at(), main(), Aleph::MemArray< T >::open_gap(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
| Gen_MultiPolynomial< C, M > Aleph::operator* | ( | const C & | s, |
| const Gen_MultiPolynomial< C, M > & | p | ||
| ) |
Scalar * polynomial (commutative).
| [in] | s | Scalar. |
| [in] | p | Polynomial. |
Definition at line 4554 of file tpl_multi_polynomial.H.
| Gen_Polynomial< C > Aleph::operator* | ( | const C & | s, |
| const Gen_Polynomial< C > & | p | ||
| ) |
Scalar times polynomial (commutative form).
Definition at line 2900 of file tpl_polynomial.H.
|
inline |
|
inline |
Scalar-matrix multiplication (scalar * matrix).
Definition at line 1228 of file al-matrix.H.
References m, and Aleph::Matrix< Trow, Tcol, NumType >::mult_by_scalar().
|
inline |
The vector v multiplied by scalar.
Definition at line 903 of file al-vector.H.
References Aleph::Vector< T, NumType >::product_by_scalar().
|
inline |
Vector-matrix multiplication (vector * matrix).
Definition at line 1239 of file al-matrix.H.
References m.
| Gen_MultiPolynomial< C, M > Aleph::operator+ | ( | const C & | s, |
| const Gen_MultiPolynomial< C, M > & | p | ||
| ) |
Scalar + polynomial (commutative).
| [in] | s | Scalar. |
| [in] | p | Polynomial. |
s plus p. Definition at line 4565 of file tpl_multi_polynomial.H.
| Gen_Polynomial< C > Aleph::operator+ | ( | const C & | s, |
| const Gen_Polynomial< C > & | p | ||
| ) |
Scalar plus polynomial (commutative form).
Definition at line 2907 of file tpl_polynomial.H.
| Gen_MultiPolynomial< C, M > Aleph::operator- | ( | const C & | s, |
| const Gen_MultiPolynomial< C, M > & | p | ||
| ) |
Scalar - polynomial.
| [in] | s | Scalar minuend. |
| [in] | p | Polynomial subtrahend. |
s minus p. Definition at line 4576 of file tpl_multi_polynomial.H.
References Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::num_vars().
| Gen_Polynomial< C > Aleph::operator- | ( | const C & | s, |
| const Gen_Polynomial< C > & | p | ||
| ) |
Scalar minus polynomial.
Definition at line 2914 of file tpl_polynomial.H.
|
inline |
Definition at line 3731 of file point.H.
References Aleph::Ellipse::to_string().
|
inline |
Definition at line 3707 of file point.H.
References Aleph::Point::get_x(), and Aleph::Point::get_y().
|
inline |
Definition at line 3743 of file point.H.
References Aleph::Point3D::get_x(), Aleph::Point3D::get_y(), and Aleph::Point3D::get_z().
|
inline |
Output stream operator for Polygon.
| o | The output stream. |
| p | The polygon to output. |
Definition at line 1428 of file polygon.H.
References count(), Aleph::Dlink::Iterator::has_curr(), Aleph::Polygon::is_closed(), and Aleph::Polygon::size().
|
inline |
|
inline |
Output stream operator for Regular_Polygon.
| o | The output stream. |
| p | The regular polygon to output. |
Definition at line 1449 of file polygon.H.
References Aleph::Regular_Polygon::get_center(), Aleph::Regular_Polygon::radius(), and Aleph::Regular_Polygon::size().
|
inline |
Definition at line 3737 of file point.H.
References Aleph::RotatedEllipse::to_string().
|
inline |
Definition at line 3713 of file point.H.
References Aleph::Segment::get_src_point(), and Aleph::Segment::get_tgt_point().
|
inline |
Definition at line 3749 of file point.H.
References Aleph::Segment3D::get_src(), and Aleph::Segment3D::get_tgt().
|
inline |
Definition at line 3761 of file point.H.
References Aleph::Tetrahedron::get_p1(), Aleph::Tetrahedron::get_p2(), Aleph::Tetrahedron::get_p3(), and Aleph::Tetrahedron::get_p4().
|
inline |
Definition at line 3719 of file point.H.
References Aleph::Triangle::get_p1(), Aleph::Triangle::get_p2(), and Aleph::Triangle::get_p3().
|
inline |
Definition at line 3755 of file point.H.
References Aleph::Triangle3D::get_p1(), Aleph::Triangle3D::get_p2(), and Aleph::Triangle3D::get_p3().
| std::ostream & Aleph::operator<< | ( | std::ostream & | osObject, |
| const Field< T > & | rightOp | ||
| ) |
Definition at line 121 of file ahField.H.
References Aleph::Field< Dtype >::get_value().
| std::ostream & Aleph::operator<< | ( | std::ostream & | out, |
| const Gen_MultiPolynomial< C, M > & | p | ||
| ) |
Stream insertion.
| [out] | out | Output stream. |
| [in] | p | Polynomial. |
out. Definition at line 4587 of file tpl_multi_polynomial.H.
References out, and Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::to_str().
| std::ostream & Aleph::operator<< | ( | std::ostream & | out, |
| const Gen_Polynomial< C > & | p | ||
| ) |
Stream output.
Definition at line 2921 of file tpl_polynomial.H.
References out, and Aleph::Gen_Polynomial< Coefficient >::to_str().
|
inline |
Output stream operator for AlDomain.
| T | Element type |
| s | Output stream |
| dom | Domain to output |
Definition at line 289 of file al-domain.H.
References Aleph::AlDomain< T >::to_str().
|
inline |
Definition at line 915 of file al-vector.H.
References Aleph::Vector< T, NumType >::to_str().
|
inline |
Optimal adjacent merge cost via Knuth optimization.
Given item weights, computes minimum total merge cost when only adjacent groups can be merged (optimal alphabetic merge / interval merge DP).
| [in] | weights | Atomic interval weights. |
| ah_runtime_error | on prefix-sum overflow. |
Definition at line 342 of file DP_Optimizations.H.
References ah_runtime_error_if, Aleph::Array< T >::create(), prefix(), and Aleph::Array< T >::size().
|
inline |
Return the orientation of the triple (a, b, c).
Based on the sign of the cross product (b-a)x(c-a).
Definition at line 2902 of file point.H.
References area_of_parallelogram(), CCW, COLLINEAR, and CW.
Referenced by Aleph::DelaunayTriangulationBowyerWatson::all_collinear(), Aleph::RegularTriangulationBowyerWatson::all_collinear(), Aleph::ConvexPolygonDecomposition::can_merge(), check_delaunay_for_non_constrained(), Aleph::MonotonePolygonTriangulation::classify_vertex(), Aleph::DelaunayTriangulationRandomizedIncremental::in_cc(), in_circle(), Aleph::ConvexPolygonIntersectionBasic::inside_half_plane(), Aleph::ConstrainedDelaunayTriangulation::is_convex_quad(), Aleph::ConstrainedDelaunayTriangulation::lawson_flip(), Aleph::ConvexPolygonIntersectionBasic::line_intersection(), Aleph::Polygon::locate_point(), Aleph::VoronoiDiagramFromDelaunay::operator()(), Aleph::DelaunayTriangulationRandomizedIncremental::operator()(), Aleph::GiftWrappingConvexHull::operator()(), Aleph::ConstrainedDelaunayTriangulation::operator()(), Aleph::ConvexPolygonDecomposition::operator()(), Aleph::HalfPlaneIntersection::HalfPlane::outside(), Aleph::DelaunayTriangulationBowyerWatson::point_in_circumcircle(), Aleph::RegularTriangulationBowyerWatson::point_in_power_circle(), Aleph::DelaunayTriangulationRandomizedIncremental::point_in_tri(), Aleph::ShortestPathInPolygon::point_in_triangle(), proper_intersection(), Aleph::ConvexPolygonIntersectionBasic::push_clean(), Aleph::HalfPlaneIntersection::push_clean(), scenario_orientation(), Aleph::detail::spp_point_in_triangle(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and Aleph::GeomBowyerWatsonUtils::triangulate().
|
inline |
Compute the outer product of two vectors.
| Trow | Row domain type (from first vector) |
| Tcol | Column domain type (from second vector) |
| NumType | Numeric type |
| v1 | First vector (becomes rows) |
| v2 | Second vector (becomes columns) |
Definition at line 1270 of file al-matrix.H.
References Aleph::FunctionalMixin< Derived, Type >::for_each(), Aleph::Vector< T, NumType >::get_domain_ptr(), and Aleph::Matrix< Trow, Tcol, NumType >::set_entry().
Referenced by demo_outer_product(), and TEST().
|
inlinestatic |
Set the arc color (stored in ARC_COUNTER).
Definition at line 1864 of file tpl_graph_utils.H.
References ARC_COUNTER, and color().
|
inlinestatic |
Set the node color (stored in NODE_COUNTER).
Definition at line 1857 of file tpl_graph_utils.H.
References color(), and NODE_COUNTER.
|
inlinenoexcept |
Definition at line 1169 of file hash-fct.H.
References dft_hash_fct(), hash_combine(), and seed.
Referenced by fst_unit_pair_hash(), pair_dft_hash_ptr_fct(), TEST(), TEST(), and TEST().
|
inlinenoexcept |
Map*Hash adaptors hash only pair.first, while generic pair hashing folds both elements with hash_combine(). Do not change this behavior casually: it affects lookup compatibility and collision structure in existing tables. Definition at line 1197 of file hash-fct.H.
References pair_dft_hash_fct().
Computes (value, rank) pairs for each element in an Array.
Similar to ranks(), but returns pairs containing both the original value and its rank for convenience.
| T | Element type |
| c | The array to compute ranks for |
Definition at line 759 of file ahSort.H.
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
Computes (value, rank) pairs for each element in a DynArray.
Similar to ranks(), but returns pairs containing both the original value and its rank for convenience.
| T | Element type |
| c | The array to compute ranks for |
|
inlinenoexcept |
Definition at line 1182 of file hash-fct.H.
References dft_hash_fct(), hash_combine(), seed, and snd_hash_fct().
Referenced by pair_snd_hash_ptr_fct(), snd_unit_pair_hash(), TEST(), TEST(), and TEST().
|
inlinenoexcept |
Definition at line 1203 of file hash-fct.H.
References pair_snd_hash_fct().
| bool Aleph::pall | ( | const Container & | c, |
| Pred | pred, | ||
| const ParallelOptions & | options = {} |
||
| ) |
Definition at line 783 of file ah-parallel.H.
References pall().
| bool Aleph::pall | ( | ThreadPool & | pool, |
| const Container & | c, | ||
| Pred | pred, | ||
| size_t | chunk_size = 0 |
||
| ) |
Parallel all predicate (short-circuit).
Tests if all elements satisfy a predicate. Stops early if any chunk finds a non-satisfying element.
| pool | Thread pool to use. |
| c | Source container. |
| pred | Predicate: bool pred(const T&). |
| chunk_size | Elements per chunk (0 = auto). |
Definition at line 773 of file ah-parallel.H.
References options, pall(), Aleph::ParallelOptions::pool, and pred.
Referenced by example_parallel_predicates(), pall(), pall(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Global default pool for parallel operations.
Uses the default ThreadPool for operations when no pool is specified.
Definition at line 3486 of file ah-parallel.H.
References default_pool(), and parallel_default_pool().
Referenced by parallel_default_pool().
| void Aleph::parallel_for | ( | Iterator | begin, |
| Iterator | end, | ||
| F && | f, | ||
| const ParallelOptions & | options = {} |
||
| ) |
Execute a function in parallel over a range with explicit options.
Definition at line 1725 of file thread_pool.H.
| void Aleph::parallel_for | ( | ThreadPool & | pool, |
| Iterator | begin, | ||
| Iterator | end, | ||
| F && | f, | ||
| size_t | chunk_size = 0 |
||
| ) |
Execute a function in parallel over a range.
Divides the range [begin, end) into chunks and executes the function on each chunk in parallel using the thread pool.
| Iterator | Random access iterator type. |
| F | Function type: void(Iterator begin, Iterator end) or void(T&). |
| pool | Thread pool to use. |
| begin | Start of range. |
| end | End of range. |
| f | Function to apply. Can be:
|
| chunk_size | Number of elements per chunk (0 = auto-calculate). |
Definition at line 1714 of file thread_pool.H.
References options, parallel_for(), and Aleph::ParallelOptions::pool.
Referenced by parallel_for(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
| void Aleph::parallel_for_index | ( | size_t | start, |
| size_t | end, | ||
| F && | f, | ||
| const ParallelOptions & | options = {} |
||
| ) |
Parallel index loop with explicit options.
Definition at line 2047 of file thread_pool.H.
References parallel_for_index().
| void Aleph::parallel_for_index | ( | ThreadPool & | pool, |
| size_t | start, | ||
| size_t | end, | ||
| F && | f, | ||
| size_t | chunk_size = 0 |
||
| ) |
Apply a function to each element in parallel (index-based).
Convenience function for parallel loops with index access.
| pool | Thread pool to use. |
| start | Start index (inclusive). |
| end | End index (exclusive). |
| f | Function: void(size_t index). |
| chunk_size | Iterations per chunk (0 = auto). |
Definition at line 2036 of file thread_pool.H.
References options, parallel_for_index(), and Aleph::ParallelOptions::pool.
Referenced by Aleph::FFT< Real >::Plan::apply_bluestein_transform(), Aleph::FFT< Real >::Plan::apply_butterflies(), Aleph::NTT< MOD, ROOT >::Plan::for_each_index(), Aleph::FFT< Real >::inverse_transform_real_optimized_impl(), Aleph::FFT< Real >::multiply_complex_impl(), Aleph::FFT< Real >::multiply_real_optimized(), parallel_for_index(), parallel_for_index(), Aleph::FFT< Real >::pbatched_sosfilt(), Aleph::FFT< Real >::pbatched_stft(), Aleph::FFT< Real >::LFilterBank::pfilter(), Aleph::FFT< Real >::SOSFilterBank::pfilter(), Aleph::FFT< Real >::BatchedSTFTProcessor::pflush(), Aleph::FFT< Real >::BatchedISTFTProcessor::pflush(), Aleph::FFT< Real >::OverlapAddBank::pflush(), Aleph::FFT< Real >::Plan::pinverse_transform_real_batch(), Aleph::FFT< Real >::OverlapAdd::pointwise_multiply(), Aleph::FFT< Real >::OverlapAddBank::pointwise_multiply_batch(), Aleph::FFT< Real >::BatchedISTFTProcessor::pprocess_block(), Aleph::FFT< Real >::BatchedSTFTProcessor::pprocess_block(), Aleph::FFT< Real >::Plan::ptransform_batch(), Aleph::NTT< MOD, ROOT >::Plan::ptransform_batch(), Aleph::NTTExact::reconstruct_product(), TEST_F(), TEST_F(), TEST_F(), Aleph::FFT< Real >::transform_axis_impl(), Aleph::FFT< Real >::transform_impl(), Aleph::FFT< Real >::transform_real_optimized(), and Aleph::FFT< Real >::transform_stft_frames().
| void Aleph::parallel_invoke | ( | const ParallelOptions & | options, |
| Fs &&... | fs | ||
| ) |
parallel_invoke with explicit options.
Definition at line 2112 of file thread_pool.H.
References Aleph::ThreadPool::enqueue(), options, and parallel_invoke().
| void Aleph::parallel_invoke | ( | ThreadPool & | pool, |
| Fs &&... | fs | ||
| ) |
Invoke a small set of related callables in parallel.
This is a low-level building block for divide-and-conquer and orchestration code. All callables are launched, then the function waits for completion and rethrows the first exception observed.
Definition at line 2103 of file thread_pool.H.
References options, parallel_invoke(), and Aleph::ParallelOptions::pool.
Referenced by example_parallel_building_blocks(), parallel_invoke(), parallel_invoke(), TEST_F(), TEST_F(), and TEST_F().
| T Aleph::parallel_reduce | ( | Iterator | first, |
| Iterator | last, | ||
| T | init, | ||
| BinaryOp | op, | ||
| const ParallelOptions & | options = {} |
||
| ) |
Parallel reduce with explicit options.
Definition at line 1958 of file thread_pool.H.
References parallel_reduce().
| T Aleph::parallel_reduce | ( | ThreadPool & | pool, |
| Iterator | first, | ||
| Iterator | last, | ||
| T | init, | ||
| BinaryOp | op, | ||
| size_t | chunk_size = 0 |
||
| ) |
Reduce elements in parallel.
Computes a reduction (like std::reduce) but parallelized. The binary operation must be associative and commutative.
| Iterator | Iterator type. |
| T | Value type for result. |
| BinaryOp | Binary operation type. |
| pool | Thread pool to use. |
| first | Start of range. |
| last | End of range. |
| init | Initial value. |
| op | Binary operation (must be associative & commutative). |
| chunk_size | Elements per chunk (0 = auto). |
Definition at line 1947 of file thread_pool.H.
References options, parallel_reduce(), and Aleph::ParallelOptions::pool.
Referenced by parallel_reduce(), parallel_reduce(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
| OutputIt Aleph::parallel_transform | ( | InputIt | first, |
| InputIt | last, | ||
| OutputIt | d_first, | ||
| F && | f, | ||
| const ParallelOptions & | options = {} |
||
| ) |
Parallel transform with explicit options.
Definition at line 1847 of file thread_pool.H.
References parallel_transform().
| OutputIt Aleph::parallel_transform | ( | ThreadPool & | pool, |
| InputIt | first, | ||
| InputIt | last, | ||
| OutputIt | d_first, | ||
| F && | f, | ||
| size_t | chunk_size = 0 |
||
| ) |
Transform elements in parallel and store results.
Applies a transformation function to each element and stores the result. Similar to std::transform but parallelized.
| InputIt | Input iterator type. |
| OutputIt | Output iterator type. |
| F | Transformation function type. |
| pool | Thread pool to use. |
| first | Start of input range. |
| last | End of input range. |
| d_first | Start of output range. |
| f | Transformation function. |
| chunk_size | Elements per chunk (0 = auto). |
Definition at line 1836 of file thread_pool.H.
References options, parallel_transform(), and Aleph::ParallelOptions::pool.
Referenced by parallel_transform(), parallel_transform(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Compute partial sums of a range.
Computes cumulative sums of elements in [sourceBeg, sourceEnd) and writes them to the range starting at destBeg.
| Itor1 | Source iterator type. |
| Itor2 | Destination iterator type. |
| sourceBeg | Iterator to the first source element. |
| sourceEnd | Iterator past the last source element. |
| destBeg | Iterator to the first destination position. |
Definition at line 1596 of file ahAlgo.H.
References sum().
|
inline |
Compute partial sums with custom operation.
Computes cumulative sums using the binary operation op.
| Itor1 | Source iterator type. |
| Itor2 | Destination iterator type. |
| BinaryFunc | Binary operation type. |
| sourceBeg | Iterator to the first source element. |
| sourceEnd | Iterator past the last source element. |
| destBeg | Iterator to the first destination position. |
| op | Binary operation for combining values. |
Definition at line 1631 of file ahAlgo.H.
References sum().
|
inline |
Partition a container using the last element as pivot.
| C | Container template (must support random access). |
| a | The container. |
| l | Left index. |
| r | Right index. |
| cmp | Comparison functor. |
Definition at line 3857 of file tpl_sort_utils.H.
|
inline |
Partition a container into two based on a predicate.
| c | Source container. |
| operation | Predicate (true goes to first list, false to second). |
Definition at line 1461 of file ahFunctional.H.
References for_each(), and Type.
Referenced by Aleph::FFT< Real >::PartitionedConvolver::PartitionedConvolver(), demo_grouping(), introsort_loop(), print_partition(), quicksort(), quicksort_rec(), random_search(), TEST(), and TEST_F().
|
inlinenoexcept |
Partition an array range [l, r] around a pivot.
Rearranges elements such that all elements less than the pivot are on the left, and elements greater or equal are on the right.
Time complexity: O(n). Space complexity: O(1).
| T | Element type. |
| Compare | Comparison functor. |
| [in,out] | a | Pointer to the array. |
| [in] | l | Left index. |
| [in] | r | Right index. |
| [in] | cmp | Comparison functor. |
Move the pivot to the end so the sweep below only handles [l, r-1].
At this point there is an inversion a[i] > pivot > a[j].
Place the pivot in its final sorted position.
Definition at line 1635 of file tpl_sort_utils.H.
|
inline |
Implementation of partitioning using operator().
| a | The container. |
| l | Left index. |
| r | Right index. |
| cmp | Comparison functor. |
Restore the pivot to its final sorted position at index i.
Definition at line 3109 of file tpl_sort_utils.H.
References cmp(), l, Aleph::sort_utils_detail::median_of_three_to_last(), and r.
|
inlinestatic |
Move the pivot to the end so the sweep below only handles [l, r-1].
Restore the pivot (parked at r) to its final sorted position.
Definition at line 2914 of file tpl_sort_utils.H.
|
inlinestatic |
Move the pivot to the end so the sweep below only handles [l, r-1].
Restore the pivot (parked at r) to its final sorted position.
Definition at line 2945 of file tpl_sort_utils.H.
| size_t Aleph::pcount_if | ( | const Container & | c, |
| Pred | pred, | ||
| const ParallelOptions & | options = {} |
||
| ) |
Definition at line 1010 of file ah-parallel.H.
References pcount_if().
| size_t Aleph::pcount_if | ( | ThreadPool & | pool, |
| const Container & | c, | ||
| Pred | pred, | ||
| size_t | chunk_size = 0 |
||
| ) |
Parallel count_if operation.
Counts elements satisfying a predicate using multiple threads.
| pool | Thread pool to use. |
| c | Source container. |
| pred | Predicate: bool pred(const T&). |
| chunk_size | Elements per chunk (0 = auto). |
Definition at line 1000 of file ah-parallel.H.
References options, pcount_if(), Aleph::ParallelOptions::pool, and pred.
Referenced by example_parallel_predicates(), pcount_if(), pcount_if(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Peek at the next character without consuming it.
Returns the next character in the stream without advancing the stream position. Useful for lookahead decisions.
| input_stream | The input file stream |
Definition at line 744 of file parse_utils.H.
References peek_char().
Referenced by peek_char(), skip_whitespace_and_comments(), and TEST_F().
| void Aleph::penumerate_for_each | ( | const Container & | c, |
| Op | op, | ||
| const ParallelOptions & | options = {} |
||
| ) |
Definition at line 3319 of file ah-parallel.H.
References penumerate_for_each().
| void Aleph::penumerate_for_each | ( | Container & | c, |
| Op | op, | ||
| const ParallelOptions & | options = {} |
||
| ) |
Definition at line 3246 of file ah-parallel.H.
References penumerate_for_each().
| void Aleph::penumerate_for_each | ( | ThreadPool & | pool, |
| const Container & | c, | ||
| Op | op, | ||
| size_t | chunk_size = 0 |
||
| ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Parallel enumerate_for_each for const containers.
| pool | Thread pool to use. |
| c | Container. |
| op | Function: void(size_t index, const T& element). |
| chunk_size | Elements per chunk (0 = auto). |
Definition at line 3309 of file ah-parallel.H.
References options, penumerate_for_each(), and Aleph::ParallelOptions::pool.
| void Aleph::penumerate_for_each | ( | ThreadPool & | pool, |
| Container & | c, | ||
| Op | op, | ||
| size_t | chunk_size = 0 |
||
| ) |
Parallel for_each with index (enumerate).
Applies a function to each element along with its index, in parallel.
| Container | Container type. |
| Op | Operation type: void(size_t index, const T&) or void(size_t, T&). |
| pool | Thread pool to use. |
| c | Container. |
| op | Function: void(size_t index, const T& element). |
| chunk_size | Elements per chunk (0 = auto). |
Definition at line 3236 of file ah-parallel.H.
References options, penumerate_for_each(), and Aleph::ParallelOptions::pool.
Referenced by example_parallel_enumerate(), penumerate_for_each(), penumerate_for_each(), penumerate_for_each(), penumerate_for_each(), TEST_F(), TEST_F(), and TEST_F().
| auto Aleph::penumerate_maps | ( | const Container & | c, |
| Op | op, | ||
| const ParallelOptions & | options = {} |
||
| ) |
Definition at line 3411 of file ah-parallel.H.
References penumerate_maps().
| auto Aleph::penumerate_maps | ( | ThreadPool & | pool, |
| const Container & | c, | ||
| Op | op, | ||
| size_t | chunk_size = 0 |
||
| ) |
Parallel enumerate with map.
Maps each element along with its index to a result.
| pool | Thread pool to use. |
| c | Container. |
| op | Function: R(size_t index, const T& element). |
| chunk_size | Elements per chunk (0 = auto). |
Definition at line 3401 of file ah-parallel.H.
References options, penumerate_maps(), and Aleph::ParallelOptions::pool.
Referenced by example_parallel_enumerate(), penumerate_maps(), penumerate_maps(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
| auto Aleph::percentile | ( | const Container & | data, |
| double | p | ||
| ) | -> std::decay_t<decltype(*std::begin(data))> |
Compute a percentile value.
Uses linear interpolation between data points.
| data | Input container (will be copied and sorted) |
| p | Percentile (0-100) |
| std::invalid_argument | if container is empty or p is out of range |
Definition at line 352 of file stat_utils.H.
References ah_invalid_argument_if, Aleph::Array< T >::append(), in_place_sort(), Aleph::Array< T >::is_empty(), percentile(), and Aleph::Array< T >::size().
Referenced by compute_all_stats(), iqr(), median(), percentile(), quartiles(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
Count the total number of permutations from a list of lists.
The result is the product of all list sizes. If the input is empty, returns 1 (there is exactly one empty permutation).
| T | Element type. |
| [in] | l | List of lists. |
Definition at line 601 of file ah-comb.H.
References count(), LocateFunctions< Container, Type >::get_it(), and l.
Referenced by demo_permutations(), demo_practical(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
| auto Aleph::pexclusive_scan | ( | const Container & | c, |
| T | init, | ||
| BinaryOp | op, | ||
| const ParallelOptions & | options = {} |
||
| ) |
Parallel exclusive scan over a container with explicit options.
Overload that accepts a fully specified ParallelOptions instead of a bare ThreadPool.
| c | Input container. Must be non-mutating during the call. |
| init | Initial value (identity for op); sets accumulator type. |
| op | Associative binary operation. |
| options | Parallel execution options (pool, chunk_size, cancel token…). |
std::vector<T> of exclusive prefix values. | Any | exception propagated from Aleph::pexclusive_scan, from op, or from element move/copy construction into the result vector. |
| Aleph::operation_canceled | if the token inside the options is canceled before or during execution. |
c. Safe to call concurrently on different containers. The pool in options must be a properly synchronized shared ThreadPool if shared. Definition at line 2298 of file ah-parallel.H.
References pexclusive_scan().
| OutputIt Aleph::pexclusive_scan | ( | InputIt | first, |
| InputIt | last, | ||
| OutputIt | d_first, | ||
| T | init, | ||
| BinaryOp | op, | ||
| const ParallelOptions & | options = {} |
||
| ) |
Exclusive prefix scan with explicit options.
Definition at line 2341 of file thread_pool.H.
References pexclusive_scan().
| auto Aleph::pexclusive_scan | ( | ThreadPool & | pool, |
| const Container & | c, | ||
| T | init, | ||
| BinaryOp | op, | ||
| size_t | chunk_size = 0 |
||
| ) |
Parallel exclusive scan over a container.
Computes an exclusive prefix scan of c starting from init and returns the result as a std::vector<T>. Element result[0] is init; element result[i] (i > 0) equals op(init, op(...op(c[0], c[1])..., c[i-1])).
| pool | Thread pool to use for parallel execution. |
| c | Input container. Must be non-mutating during the call. |
| init | Initial value (identity for op). Also determines the accumulator/result type T. |
| op | Associative binary operation. |
| chunk_size | Optional override for the number of elements per chunk; 0 (default) lets the implementation choose. When set it overrides ParallelOptions::chunk_size. |
std::vector<T> of exclusive prefix values. Empty if c is empty. | Any | exception propagated from Aleph::pexclusive_scan, from op, or from element move/copy construction into the result vector. |
| Aleph::operation_canceled | if the token inside the derived ParallelOptions is canceled before or during execution. |
pool threads and chunks. c. Safe to call concurrently on different containers. pool must be a properly synchronized shared ThreadPool if shared. Definition at line 2268 of file ah-parallel.H.
References options, pexclusive_scan(), and Aleph::ParallelOptions::pool.
Referenced by example_parallel_building_blocks(), example_parallel_scan_merge_partition(), pexclusive_scan(), pexclusive_scan(), pexclusive_scan(), pexclusive_scan(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
| OutputIt Aleph::pexclusive_scan | ( | ThreadPool & | pool, |
| InputIt | first, | ||
| InputIt | last, | ||
| OutputIt | d_first, | ||
| T | init, | ||
| BinaryOp | op, | ||
| size_t | chunk_size = 0 |
||
| ) |
Exclusive prefix scan over a range.
Computes prefixes such that out[0] = init and out[i] = op(init, x0, ..., x{i-1}) for i > 0.
Definition at line 2329 of file thread_pool.H.
References options, pexclusive_scan(), and Aleph::ParallelOptions::pool.
| bool Aleph::pexists | ( | const Container & | c, |
| Pred | pred, | ||
| const ParallelOptions & | options = {} |
||
| ) |
Definition at line 881 of file ah-parallel.H.
References pexists().
| bool Aleph::pexists | ( | ThreadPool & | pool, |
| const Container & | c, | ||
| Pred | pred, | ||
| size_t | chunk_size = 0 |
||
| ) |
Parallel exists predicate (short-circuit).
Tests if any element satisfies a predicate. Stops early when found.
| pool | Thread pool to use. |
| c | Source container. |
| pred | Predicate: bool pred(const T&). |
| chunk_size | Elements per chunk (0 = auto). |
Definition at line 871 of file ah-parallel.H.
References options, pexists(), Aleph::ParallelOptions::pool, and pred.
Referenced by example_parallel_predicates(), pexists(), pexists(), pnone(), TEST_F(), TEST_F(), and TEST_F().
| auto Aleph::pfilter | ( | const Container & | c, |
| Pred | pred, | ||
| const ParallelOptions & | options = {} |
||
| ) |
Definition at line 397 of file ah-parallel.H.
References pfilter().
| auto Aleph::pfilter | ( | ThreadPool & | pool, |
| const Container & | c, | ||
| Pred | pred, | ||
| size_t | chunk_size = 0 |
||
| ) |
Parallel filter operation.
Filters elements that satisfy a predicate, processing in parallel. The relative order of elements is preserved.
| Container | Input container type. |
| Pred | Predicate type. |
| pool | Thread pool to use. |
| c | Source container. |
| pred | Predicate: bool pred(const T&). |
| chunk_size | Elements per chunk (0 = auto). |
Definition at line 387 of file ah-parallel.H.
References options, pfilter(), Aleph::ParallelOptions::pool, and pred.
Referenced by example_parallel_filter(), pfilter(), pfilter(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
| std::optional< size_t > Aleph::pfind | ( | const Container & | c, |
| Pred | pred, | ||
| const ParallelOptions & | options = {} |
||
| ) |
Definition at line 1110 of file ah-parallel.H.
References pfind().
| std::optional< size_t > Aleph::pfind | ( | ThreadPool & | pool, |
| const Container & | c, | ||
| Pred | pred, | ||
| size_t | chunk_size = 0 |
||
| ) |
Parallel find operation (returns index).
Searches for an element satisfying a predicate in parallel. Returns the index of the first match (by position in container).
| pool | Thread pool to use. |
| c | Source container. |
| pred | Predicate: bool pred(const T&). |
| chunk_size | Elements per chunk (0 = auto). |
Definition at line 1100 of file ah-parallel.H.
References options, pfind(), Aleph::ParallelOptions::pool, and pred.
Referenced by example_parallel_find(), pfind(), pfind(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
| auto Aleph::pfind_value | ( | const Container & | c, |
| Pred | pred, | ||
| const ParallelOptions & | options = {} |
||
| ) |
Definition at line 1222 of file ah-parallel.H.
References pfind_value().
| auto Aleph::pfind_value | ( | ThreadPool & | pool, |
| const Container & | c, | ||
| Pred | pred, | ||
| size_t | chunk_size = 0 |
||
| ) |
Parallel find with value return.
Like pfind, but returns an optional containing the found value.
| pool | Thread pool to use. |
| c | Source container. |
| pred | Predicate: bool pred(const T&). |
| chunk_size | Elements per chunk (0 = auto). |
Definition at line 1212 of file ah-parallel.H.
References options, pfind_value(), Aleph::ParallelOptions::pool, and pred.
Referenced by example_parallel_find(), pfind_value(), pfind_value(), and TEST_F().
| T Aleph::pfoldl | ( | const Container & | c, |
| T | init, | ||
| BinaryOp | op, | ||
| const ParallelOptions & | options = {} |
||
| ) |
Definition at line 518 of file ah-parallel.H.
References pfoldl().
| T Aleph::pfoldl | ( | ThreadPool & | pool, |
| const Container & | c, | ||
| T | init, | ||
| BinaryOp | op, | ||
| size_t | chunk_size = 0 |
||
| ) |
Parallel left fold (reduce).
Computes a reduction over the container using multiple threads. The binary operation must be associative for correct results.
| pool | Thread pool to use. |
| c | Source container. |
| init | Initial accumulator value. |
| op | Binary operation: T op(T acc, const ElemT&). |
| chunk_size | Elements per chunk (0 = auto). |
Definition at line 508 of file ah-parallel.H.
References options, pfoldl(), and Aleph::ParallelOptions::pool.
Referenced by example_parallel_fold(), pfoldl(), pfoldl(), pproduct(), psum(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
| void Aleph::pfor_each | ( | const Container & | c, |
| Op | op, | ||
| const ParallelOptions & | options = {} |
||
| ) |
Definition at line 694 of file ah-parallel.H.
References pfor_each().
| void Aleph::pfor_each | ( | Container & | c, |
| Op | op, | ||
| const ParallelOptions & | options = {} |
||
| ) |
Definition at line 623 of file ah-parallel.H.
References pfor_each().
| void Aleph::pfor_each | ( | ThreadPool & | pool, |
| const Container & | c, | ||
| Op | op, | ||
| size_t | chunk_size = 0 |
||
| ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Parallel for_each for const containers.
| pool | Thread pool to use. |
| c | Container (elements accessed by const reference). |
| op | Function to apply: void op(const T&). |
| chunk_size | Elements per chunk (0 = auto). |
Definition at line 685 of file ah-parallel.H.
References options, pfor_each(), and Aleph::ParallelOptions::pool.
| void Aleph::pfor_each | ( | ThreadPool & | pool, |
| Container & | c, | ||
| Op | op, | ||
| size_t | chunk_size = 0 |
||
| ) |
Parallel for_each operation.
Applies a function to each element in parallel. Use this for side effects; for transformations, prefer pmaps.
| pool | Thread pool to use. |
| c | Container (elements accessed by non-const reference). |
| op | Function to apply: void op(T&) or void op(const T&). |
| chunk_size | Elements per chunk (0 = auto). |
Definition at line 614 of file ah-parallel.H.
References options, pfor_each(), and Aleph::ParallelOptions::pool.
Referenced by pfor_each(), pfor_each(), pfor_each(), pfor_each(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Definition at line 167 of file point.H.
References euclidean_distance(), and y.
| auto Aleph::pmaps | ( | const Container & | c, |
| Op | op, | ||
| const ParallelOptions & | options = {} |
||
| ) |
Definition at line 279 of file ah-parallel.H.
| auto Aleph::pmaps | ( | ThreadPool & | pool, |
| const Container & | c, | ||
| Op | op, | ||
| size_t | chunk_size = 0 |
||
| ) |
Parallel map operation.
Applies a function to each element in parallel and returns a new container with the results.
| ResultT | Result element type (deduced from Op if not specified). |
| Container | Input container type. |
| Op | Mapping operation type. |
| pool | Thread pool to use. |
| c | Source container. |
| op | Function to apply: ResultT op(const T&). |
| chunk_size | Elements per chunk (0 = auto). |
Definition at line 269 of file ah-parallel.H.
References options, and Aleph::ParallelOptions::pool.
Referenced by example_parallel_map(), example_performance_comparison(), Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::fit_parallel(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
| auto Aleph::pmax | ( | const Container & | c, |
| const ParallelOptions & | options = {} |
||
| ) |
Definition at line 1408 of file ah-parallel.H.
References pmax().
| auto Aleph::pmax | ( | ThreadPool & | pool, |
| const Container & | c, | ||
| size_t | chunk_size = 0 |
||
| ) |
Parallel maximum element.
| pool | Thread pool to use. |
| c | Source container. |
| chunk_size | Elements per chunk (0 = auto). |
Definition at line 1399 of file ah-parallel.H.
References options, pmax(), and Aleph::ParallelOptions::pool.
Referenced by K2Tree< T >::build(), example_parallel_aggregations(), pmax(), pmax(), K2Tree< T >::Node::set_rect(), TEST_F(), and TEST_F().
| auto Aleph::pmerge | ( | const Container1 & | c1, |
| const Container2 & | c2, | ||
| Compare | comp = Compare{}, |
||
| const ParallelOptions & | options = {} |
||
| ) |
Parallel merge of two sorted containers with explicit options.
Overload that accepts a fully specified ParallelOptions instead of a bare ThreadPool.
| c1 | First sorted input container. |
| c2 | Second sorted input container. |
| comp | Strict-weak-order comparator. |
| options | Parallel execution options (pool, chunk_size, cancel token…). |
std::vector with all elements merged in sorted order. | Any | exception propagated from Aleph::pmerge, from comp, or from element move/copy construction into the result vector. |
| Aleph::operation_canceled | if the token inside the options is canceled before or during execution. |
c1 or c2. Safe to call concurrently on different container pairs. The pool in options must be a properly synchronized shared ThreadPool if shared. Definition at line 2372 of file ah-parallel.H.
References pmerge().
| OutputIt Aleph::pmerge | ( | InputIt1 | first1, |
| InputIt1 | last1, | ||
| InputIt2 | first2, | ||
| InputIt2 | last2, | ||
| OutputIt | d_first, | ||
| Compare | comp = Compare{}, |
||
| const ParallelOptions & | options = {} |
||
| ) |
Parallel merge with explicit options.
Definition at line 2404 of file thread_pool.H.
References pmerge().
| auto Aleph::pmerge | ( | ThreadPool & | pool, |
| const Container1 & | c1, | ||
| const Container2 & | c2, | ||
| Compare | comp = Compare{}, |
||
| size_t | chunk_size = 0 |
||
| ) |
Parallel merge of two sorted containers.
Merges two sorted ranges c1 and c2 into a single sorted std::vector using comparator comp. Both containers must already be sorted in ascending order according to comp.
| pool | Thread pool to use for parallel execution. |
| c1 | First sorted input container. |
| c2 | Second sorted input container. |
| comp | Strict-weak-order comparator (default: std::less<>). |
| chunk_size | Optional override for the merge task granularity; 0 (default) lets the implementation choose. When set it overrides ParallelOptions::chunk_size. |
std::vector with element type std::common_type_t<T1,T2> containing all elements from c1 and c2 in sorted order. Size equals c1.size() + c2.size(). | Any | exception propagated from Aleph::pmerge, from comp, or from element move/copy construction into the result vector. |
| Aleph::operation_canceled | if the token inside the derived ParallelOptions is canceled before or during execution. |
pool threads and chunks. c1 or c2. Safe to call concurrently on different container pairs. pool must be a properly synchronized shared ThreadPool if shared. Definition at line 2342 of file ah-parallel.H.
References pmerge().
Referenced by example_parallel_building_blocks(), example_parallel_scan_merge_partition(), pmerge(), pmerge(), pmerge(), pmerge(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
| OutputIt Aleph::pmerge | ( | ThreadPool & | pool, |
| InputIt1 | first1, | ||
| InputIt1 | last1, | ||
| InputIt2 | first2, | ||
| InputIt2 | last2, | ||
| OutputIt | d_first, | ||
| Compare | comp = Compare{}, |
||
| size_t | chunk_size = 0 |
||
| ) |
Merge two sorted ranges in parallel.
The input ranges must already be sorted according to comp. The output range must have room for distance(first1, last1) + distance(first2, last2) elements.
Definition at line 2389 of file thread_pool.H.
References pmerge().
| auto Aleph::pmin | ( | const Container & | c, |
| const ParallelOptions & | options = {} |
||
| ) |
Definition at line 1321 of file ah-parallel.H.
References pmin().
| auto Aleph::pmin | ( | ThreadPool & | pool, |
| const Container & | c, | ||
| size_t | chunk_size = 0 |
||
| ) |
Parallel minimum element.
| pool | Thread pool to use. |
| c | Source container. |
| chunk_size | Elements per chunk (0 = auto). |
Definition at line 1312 of file ah-parallel.H.
References options, pmin(), and Aleph::ParallelOptions::pool.
Referenced by K2Tree< T >::build(), example_parallel_aggregations(), pmin(), pmin(), K2Tree< T >::Node::set_rect(), TEST_F(), and TEST_F().
| auto Aleph::pminmax | ( | ThreadPool & | pool, |
| const Container & | c, | ||
| size_t | chunk_size = 0 |
||
| ) |
Parallel min and max elements.
| pool | Thread pool to use. |
| c | Source container. |
| chunk_size | Elements per chunk (0 = auto). |
Definition at line 1486 of file ah-parallel.H.
References Aleph::ThreadPool::enqueue(), Aleph::ThreadPool::num_threads(), offset, and pminmax().
Referenced by example_parallel_aggregations(), pminmax(), TEST_F(), TEST_F(), and TEST_F().
| bool Aleph::pnone | ( | const Container & | c, |
| Pred | pred, | ||
| const ParallelOptions & | options = {} |
||
| ) |
Definition at line 968 of file ah-parallel.H.
References pnone().
| bool Aleph::pnone | ( | ThreadPool & | pool, |
| const Container & | c, | ||
| Pred | pred, | ||
| size_t | chunk_size = 0 |
||
| ) |
Parallel none predicate.
Tests if no element satisfies a predicate.
| pool | Thread pool to use. |
| c | Source container. |
| pred | Predicate: bool pred(const T&). |
| chunk_size | Elements per chunk (0 = auto). |
Definition at line 961 of file ah-parallel.H.
References pexists(), pnone(), and pred.
Referenced by example_parallel_predicates(), pnone(), pnone(), TEST_F(), and TEST_F().
| DynList< const typename Container::Item_Type * > Aleph::pointers_list | ( | const Container & | c | ) |
Const container overload.
Definition at line 580 of file ahFunctional.H.
References Aleph::DynList< T >::append().
| DynList< typename Container::Item_Type * > Aleph::pointers_list | ( | Container & | c | ) |
Create a list of pointers to items in a container.
Traverses the container and collects pointers to each element. Useful for algorithms that need to modify elements in-place or for creating indirect access patterns.
| c | Source container. |
Definition at line 567 of file ahFunctional.H.
References Aleph::DynList< T >::append().
Referenced by TEST_F().
Definition at line 62 of file point_utils.H.
References area_of_parallelogram(), and points_are_colinear().
Referenced by points_are_colinear().
|
inline |
Compute the prime factorization of a number using Pollard's rho.
Computes all prime factors of a 64-bit integer n using recursive application of Pollard's rho algorithm combined with the Miller-Rabin primality test.
| n | The number to factor. |
| std::invalid_argument | if n < 2 (cannot factor numbers < 2). |
| std::runtime_error | if the algorithm fails to find a factor after the maximum number of attempts (extremely unlikely). |
Definition at line 184 of file pollard_rho.H.
References ah_invalid_argument_if, Aleph::detail::extract_prime_factors(), and in_place_sort().
Referenced by demo_primality_factorization(), TEST(), and TEST().
|
inline |
Constructs a Polygon from a list of indices into a vertex array.
This is useful for algorithms that return faces or boundaries as lists of indices (e.g., SegmentArrangement).
| vertices | The master array of Point vertices. |
| indices | The indices of the vertices that form this polygon. |
| close | If true, closes the polygon. |
Polygon. Definition at line 550 of file tikzgeom_algorithms.H.
References Aleph::Polygon::add_vertex(), and, Aleph::Polygon::close(), LocateFunctions< Container, Type >::get_it(), Aleph::Polygon::size(), and Aleph::Array< T >::size().
Referenced by put_segment_arrangement_result().
|
inline |
Constructs a Polygon from an ordered array of vertices.
| vertices | An array of Points in the desired order. |
| close | If true, closes the polygon by adding an edge from the last vertex back to the first. |
Polygon. Definition at line 528 of file tikzgeom_algorithms.H.
References Aleph::Polygon::add_vertex(), and, Aleph::Polygon::close(), Aleph::Polygon::size(), and Aleph::Array< T >::size().
Referenced by put_power_diagram_result(), and put_voronoi_result().
|
inline |
Definition at line 253 of file tpl_binNodeUtils.H.
References LLINK, postorder_rec_helper(), and RLINK.
Referenced by postorder_rec_helper(), and postOrderRec().
|
inline |
|
inline |
| auto Aleph::ppartition | ( | const Container & | c, |
| Pred | pred, | ||
| const ParallelOptions & | options = {} |
||
| ) |
Definition at line 2033 of file ah-parallel.H.
References ppartition().
| auto Aleph::ppartition | ( | ThreadPool & | pool, |
| const Container & | c, | ||
| Pred | pred, | ||
| size_t | chunk_size = 0 |
||
| ) |
Parallel partition (stable).
Partitions elements based on a predicate, preserving relative order.
| pool | Thread pool to use. |
| c | Source container. |
| pred | Predicate: bool pred(const T&). |
| chunk_size | Elements per chunk (0 = auto). |
Definition at line 2023 of file ah-parallel.H.
References options, Aleph::ParallelOptions::pool, ppartition(), and pred.
Referenced by example_parallel_scan_merge_partition(), ppartition(), ppartition(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
| T Aleph::pproduct | ( | const Container & | c, |
| T | init, | ||
| const ParallelOptions & | options | ||
| ) |
Definition at line 1296 of file ah-parallel.H.
References options, pfoldl(), and pproduct().
| T Aleph::pproduct | ( | ThreadPool & | pool, |
| const Container & | c, | ||
| T | init = T{1}, |
||
| size_t | chunk_size = 0 |
||
| ) |
Parallel product of elements.
| pool | Thread pool to use. |
| c | Source container. |
| init | Initial value (default 1). |
| chunk_size | Elements per chunk (0 = auto). |
Definition at line 1288 of file ah-parallel.H.
References pproduct().
Referenced by pproduct(), pproduct(), TEST_F(), and TEST_F().
|
static |
Definition at line 491 of file tpl_binNodeUtils.H.
References Aleph::DynList< T >::append(), LLINK, prefix(), RLINK, and root().
Referenced by Aleph::Gen_Reroot_DP< GT, T, SA >::Gen_Reroot_DP(), Aleph::Compiler_Driver_Detail::artifact_label(), compute_optimal_costs(), demo_grouping(), demo_performance(), demo_prefix_search(), demo_spell_checker(), deway(), deway(), draw_children(), export_variant(), is_prefix(), Aleph::RadixTree< T, Char >::keys_with_prefix(), Aleph::Huffman_Encoder_Engine::load_tree(), load_tree(), load_tree_from_array(), main(), main(), mat_to_latex(), mat_to_latex(), mat_to_latex_simple(), optimal_merge_knuth(), prefix(), prefix(), put_point_labels(), put_point_labels(), Aleph::Gen_Fenwick_Tree< T, Plus, Minus >::query(), remove_prefix(), Aleph::Compiler_Typed_Semantic_Analyzer::require_unify(), Aleph::RTree< Payload, MaxEntries, MinEntries, Variant >::rstar_split(), save_tree(), Aleph::Huffman_Encoder_Engine::save_tree(), save_tree_in_array_of_chars(), Aleph::Cnode::search_prefix(), Aleph::Prefix_Tree_Map< T >::Node::search_prefix(), Aleph::Cnode::search_prefix(), Aleph::Prefix_Tree_Map< T >::Node::search_prefix(), Aleph::Cnode::search_prefix_impl(), Aleph::Prefix_Tree_Map< T >::Node::search_prefix_impl(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TYPED_TEST(), TYPED_TEST_P(), Aleph::Prefix_Tree_Map< T >::words_with_prefix(), Aleph::Cnode::words_with_prefix(), Aleph::Prefix_Tree::words_with_prefix(), write_avl(), write_bin(), write_rand(), write_rb(), write_splay(), and write_treap().
| void Aleph::prefix_for_each | ( | Node * | root, |
| Op | op | ||
| ) |
Traverse in preorder all the container and performs an operation on each element.
prefix_for_each(operation) traverses the container and on each element item is performed operation(item).
operation must have the following signature:
void operation(Node * p)
Overloading of this method allow that the signature can be lightly different; for example, remove the reference or the const.
| root | |
| op | operation to be performed on each item |
| anything | that can throw operation |
Definition at line 2963 of file tpl_binNodeUtils.H.
References Aleph::BinNodePrefixIterator< Node >::has_curr(), and root().
|
inline |
Build the residual network for preflow-push algorithms.
Returns the residual network and the mapped source/sink nodes.
Definition at line 2195 of file tpl_net.H.
References create_residual_arc(), Aleph::Net_Graph< NodeT, ArcT >::get_in_flow(), Aleph::Net_Graph< NodeT, ArcT >::get_out_flow(), Aleph::Net_Graph< NodeT, ArcT >::get_sink(), Aleph::Net_Graph< NodeT, ArcT >::get_source(), NODE_COOKIE, and GraphCommon< GT, Node, Arc >::reset_nodes().
Referenced by TEST(), and TYPED_TEST().
|
inline |
Definition at line 208 of file tpl_binNodeUtils.H.
References LLINK, preorder_rec_helper(), and RLINK.
Referenced by preorder_rec_helper(), and preOrderRec().
|
inline |
Print a semi-path to stdout.
Definition at line 1202 of file tpl_net.H.
Referenced by main(), and test_map_tree().
| void Aleph::print_benchmark_results | ( | const std::vector< MaxFlowBenchmarkResult< Flow_Type > > & | results | ) |
Print benchmark results.
Definition at line 990 of file net_utils.H.
References r.
Referenced by TEST_F().
Output a flow network to Graphviz format.
Generates a DOT format representation of the network showing flow/capacity/cost labels on arcs.
| Net | Network type. |
| [in] | net | The network to output. |
| [out] | out | Output stream. |
Definition at line 994 of file tpl_netcost.H.
References Aleph::To_Graphviz< GT, Node_Attr, Arc_Attr, SN, SA >::digraph(), NODE_COUNTER, GraphCommon< GT, Node, Arc >::nodes(), and out.
|
inline |
Print a parse error message and terminate the program.
Outputs a formatted error message including the current file position (line:column) and the last token that was scanned, then exits with status code 1.
| str | The error message to display |
Definition at line 500 of file parse_utils.H.
References previous_col_number, previous_line_number, print_parse_error_and_exit(), and token_instance.
Referenced by generate_tree(), load_tag_option(), parse_arc(), parse_connexion(), parse_dashed_arc(), parse_deway_number(), parse_first_root_definition(), parse_graph_definition(), parse_tag(), parse_tag_definition(), parse_without_arc(), print_parse_error_and_exit(), read_input_and_build_graph(), and read_input_and_build_tree().
|
inline |
Print a parse warning message.
Outputs a formatted warning message including the current file position (line:column) and the last token that was scanned. Unlike print_parse_error_and_exit(), this function returns normally.
| str | The warning message to display |
Definition at line 524 of file parse_utils.H.
References previous_col_number, previous_line_number, print_parse_warning(), and token_instance.
Referenced by parse_arc(), and print_parse_warning().
| void Aleph::print_residual_net | ( | const Residual_Net< typename Net::Flow_Type > & | net, |
| std::ostream & | out | ||
| ) |
Output a residual network to Graphviz format.
Generates a DOT format representation showing residual arcs in red.
| Net | Original network type (used for Flow_Type). |
| [in] | net | The residual network to output. |
| [out] | out | Output stream. |
Definition at line 1032 of file tpl_netcost.H.
References NODE_COUNTER, GraphCommon< GT, Node, Arc >::nodes(), and out.
|
inline |
Prints a horizontal rule for example output separation.
Definition at line 39 of file print_rule.H.
Referenced by demo_modular_arithmetic(), demo_modular_combinatorics(), demo_modular_linalg(), demo_ntt(), demo_primality_factorization(), and main().
|
inline |
Process an escape sequence.
Given a character after a backslash, returns the corresponding escaped character.
| c | The character after the backslash |
\\n → newline\\t → tab\\r → carriage return\\\\ → backslash\\\" → double quote→ single quote -\0` → null Definition at line 1362 of file parse_utils.H.
References process_escape().
Referenced by load_char_literal(), load_escaped_string(), process_escape(), TEST(), and TEST().
Compute product of all elements.
| container | Source container. |
| init | Starting value (defaults to T{1}). |
Definition at line 2380 of file ahFunctional.H.
Referenced by Aleph::random_detail::bounded(), Aleph::random_detail::bounded_after_a_low_product(), demo_conversion(), demo_fold(), demo_fold_reduce(), demo_folding(), example_parallel_building_blocks(), Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::factor_recombination(), main(), Aleph::Gsl_Compatible_Rng::rounded(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and Moved_From_Case< N::Plan >::use().
|
inline |
Definition at line 88 of file point_utils.H.
References and, COLLINEAR, orientation(), and proper_intersection().
Referenced by proper_intersection().
| auto Aleph::pscan | ( | const Container & | c, |
| BinaryOp | op, | ||
| const ParallelOptions & | options = {} |
||
| ) |
Parallel inclusive scan over a container with explicit options.
Overload that accepts a fully specified ParallelOptions instead of a bare ThreadPool.
| c | Input container. Must be non-mutating during the call. |
| op | Associative binary operation. |
| options | Parallel execution options (pool, chunk_size, cancel token…). |
std::vector of the same value type as c, containing the inclusive prefix sums. Empty if c is empty. | Any | exception propagated from Aleph::pscan, from op, or from element move/copy construction into the result vector. |
| Aleph::operation_canceled | if the token inside the options is canceled before or during execution. |
c. Safe to call concurrently on different containers. The pool in options must be a properly synchronized shared ThreadPool if shared. Definition at line 2222 of file ah-parallel.H.
References pscan().
| OutputIt Aleph::pscan | ( | InputIt | first, |
| InputIt | last, | ||
| OutputIt | d_first, | ||
| BinaryOp | op, | ||
| const ParallelOptions & | options = {} |
||
| ) |
Inclusive prefix scan with explicit options.
Definition at line 2197 of file thread_pool.H.
References pscan().
| auto Aleph::pscan | ( | ThreadPool & | pool, |
| const Container & | c, | ||
| BinaryOp | op, | ||
| size_t | chunk_size = 0 |
||
| ) |
Parallel inclusive scan over a container.
Computes an inclusive prefix scan of c using binary operation op and returns the result as a std::vector. Element result[i] equals op(op(...op(c[0], c[1])...), c[i]).
| pool | Thread pool to use for parallel execution. |
| c | Input container. Must be non-mutating during the call. |
| op | Associative binary operation. |
| chunk_size | Optional override for the number of elements per chunk; 0 (default) lets the implementation choose. When set it overrides ParallelOptions::chunk_size. |
std::vector of the same value type as c, containing the inclusive prefix sums. Empty if c is empty. | Any | exception propagated from Aleph::pscan, from op, or from element move/copy construction into the result vector. |
| Aleph::operation_canceled | if the token inside the derived ParallelOptions is canceled before or during execution. |
pool threads and chunks. c. Safe to call concurrently on different containers. pool must be a properly synchronized shared ThreadPool if shared. Definition at line 2192 of file ah-parallel.H.
References options, Aleph::ParallelOptions::pool, and pscan().
Referenced by example_parallel_building_blocks(), example_parallel_scan_merge_partition(), pscan(), pscan(), pscan(), pscan(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
| OutputIt Aleph::pscan | ( | ThreadPool & | pool, |
| InputIt | first, | ||
| InputIt | last, | ||
| OutputIt | d_first, | ||
| BinaryOp | op, | ||
| size_t | chunk_size = 0 |
||
| ) |
Inclusive prefix scan over a range.
Computes partial prefixes such that out[i] = op(x0, x1, ..., xi). Requires random-access iterators, matching the rest of the low-level parallel primitives in this header.
Definition at line 2186 of file thread_pool.H.
References options, Aleph::ParallelOptions::pool, and pscan().
| void Aleph::psort | ( | Container & | c, |
| Compare | cmp = Compare{}, |
||
| const ParallelOptions & | options = {} |
||
| ) |
Definition at line 1577 of file ah-parallel.H.
References psort().
| void Aleph::psort | ( | ThreadPool & | pool, |
| Container & | c, | ||
| Compare | cmp = Compare{}, |
||
| const size_t | min_parallel_size = 1024 |
||
| ) |
Parallel sort (in-place).
Sorts a container using multiple threads for the comparison work. Uses a parallel merge sort approach.
| Container | Container with random access iterators. |
| Compare | Comparison function type. |
| pool | Thread pool to use. |
| c | Container to sort. |
| cmp | Comparison function (default: std::less<>). |
| min_parallel_size | Minimum size for parallel recursion. |
Definition at line 1567 of file ah-parallel.H.
References psort().
Referenced by example_parallel_sort(), psort(), psort(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
| T Aleph::psum | ( | const Container & | c, |
| T | init, | ||
| const ParallelOptions & | options | ||
| ) |
Definition at line 1270 of file ah-parallel.H.
| T Aleph::psum | ( | ThreadPool & | pool, |
| const Container & | c, | ||
| T | init = T{}, |
||
| size_t | chunk_size = 0 |
||
| ) |
Parallel sum of elements.
| pool | Thread pool to use. |
| c | Source container. |
| init | Initial value (default 0). |
| chunk_size | Elements per chunk (0 = auto). |
Definition at line 1262 of file ah-parallel.H.
References psum().
Referenced by example_parallel_aggregations(), example_parallel_fold(), psum(), psum(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Definition at line 548 of file ahFunction.H.
|
inline |
Definition at line 578 of file ahFunction.H.
|
inline |
Push two values onto a stack.
Convenience helper for iterative quicksort implementations.
| Stack | Stack container type. |
| A | First value type. |
| B | Second value type. |
| stack | The stack to push onto. |
| a | First value. |
| b | Second value. |
Definition at line 3927 of file tpl_sort_utils.H.
Referenced by quicksort(), and quicksort_op().
|
inline |
Draw AABB tree hierarchy and optional query results.
Definition at line 1035 of file tikzgeom_algorithms.H.
References Aleph::Tikz_Style::draw_color, adaptive_huffman_demo::Snapshot::nodes, put_in_plane(), and Aleph::detail::tikz_palette_color().
Referenced by visualize_aabb_tree(), and visualize_aabb_tree_query().
|
inline |
Insert alpha-shape structures (kept triangles, boundary, sites).
Definition at line 1539 of file tikzgeom_algorithms.H.
References Aleph::AlphaShape::Result::boundary_edges, k, put_in_plane(), put_points(), Aleph::AlphaShape::Result::sites, and Aleph::AlphaShape::Result::triangles.
|
inline |
Insert constrained Delaunay triangulation result.
Draws all triangles in wire style, constrained edges in a distinct foreground style, and optionally sites as points.
Definition at line 1822 of file tikzgeom_algorithms.H.
References Aleph::ConstrainedDelaunayTriangulation::Result::constrained_edges, put_in_plane(), put_points(), Aleph::ConstrainedDelaunayTriangulation::Result::sites, and Aleph::ConstrainedDelaunayTriangulation::Result::triangles.
|
inline |
Append a character to a buffer with bounds checking.
Safely adds a character to a buffer, checking that the buffer has not been exceeded. If the buffer is full, an error is raised.
| start_addr | Reference to the current write position; incremented after write |
| end_addr | Pointer to one past the end of the buffer |
| c | Character to append |
| Terminates | program if buffer overflow would occur |
Definition at line 204 of file parse_utils.H.
References AH_ERROR, and put_char_in_buffer().
Referenced by close_token_scanning(), get_token(), load_binary_number(), load_deway_number(), load_double(), load_escaped_string(), load_hex_number(), load_identifier(), load_number(), load_octal_number(), load_string(), put_char_in_buffer(), TEST(), TEST(), and TEST().
|
inline |
Draw closest-pair result over the full point set.
Definition at line 1616 of file tikzgeom_algorithms.H.
References Aleph::ClosestPairDivideAndConquer::Result::first, put_in_plane(), put_points(), and Aleph::ClosestPairDivideAndConquer::Result::second.
|
inline |
Insert convex decomposition polygons.
Each convex part can be colored using a repeating palette.
Definition at line 1499 of file tikzgeom_algorithms.H.
References Aleph::Tikz_Style::draw_color, Aleph::Tikz_Style::fill, Aleph::Tikz_Style::fill_color, put_in_plane(), Aleph::Array< T >::size(), and Aleph::detail::tikz_palette_color().
|
inline |
Approximate and insert a cubic Bézier as an open polyline.
Definition at line 1556 of file tikzgeom.H.
Referenced by TEST().
|
inline |
Insert a cubic Bézier using native TikZ controls syntax.
Definition at line 1603 of file tikzgeom.H.
|
inline |
Insert Delaunay triangulation as triangle outlines.
Optionally draws sites as points on top.
Definition at line 680 of file tikzgeom_algorithms.H.
References put_in_plane(), put_points(), Aleph::DelaunayTriangulationBowyerWatson::Result::sites, and Aleph::DelaunayTriangulationBowyerWatson::Result::triangles.
Referenced by main().
|
inline |
Render one funnel-trace frame in a plane.
step_index is clamped to the last available step.
Definition at line 1392 of file tikzgeom_algorithms.H.
References Aleph::FunnelTraceStep::apex, Aleph::FunnelTraceStep::committed_path, Aleph::FunnelTraceStep::left_boundary, Aleph::FunnelTraceStep::portal_left, Aleph::FunnelTraceStep::portal_right, put_in_plane(), put_path(), put_portals(), Aleph::FunnelTraceStep::right_boundary, and tikz_points_style().
Referenced by main(), Aleph::Tikz_Scene::put_funnel_trace_step(), and TEST().
|
inline |
Draw half-plane boundaries and their bounded intersection polygon.
Definition at line 1683 of file tikzgeom_algorithms.H.
References put_in_plane(), Aleph::Polygon::size(), and Aleph::Array< T >::size().
|
inlinestatic |
Enqueue an active node if it is not already enqueued.
Definition at line 2391 of file tpl_net.H.
References Maximum_Flow, and NODE_BITS.
Referenced by generic_preflow_vertex_push_maximum_flow().
|
inline |
Insert any supported geometry type in a Tikz_Plane.
Definition at line 1511 of file tikzgeom.H.
References Aleph::Tikz_Plane::put().
Referenced by Aleph::Tikz_Scene::add(), Aleph::Tikz_Scene::add(), main(), main(), process_arc(), process_node(), process_tag_node(), process_text_arc(), put_aabb_tree_result(), put_alpha_shape_result(), put_cdt_result(), put_closest_pair_result(), put_convex_decomposition_result(), put_delaunay_result(), put_funnel_trace_step(), put_half_plane_intersection_result(), put_kdtree_partitions_result(), put_line_sweep_result(), put_mec_result(), put_minkowski_sum_result(), put_monotone_triangulation_result(), put_offset_result(), put_path(), put_path(), put_point_label_in_plane(), put_points(), put_points(), put_polygon_vertices(), put_polygon_vertices(), put_polygons(), put_portals(), put_power_diagram_result(), put_range_tree_result(), put_regular_triangulation_result(), put_rotating_calipers_result(), put_rtree_result(), put_segment_arrangement_result(), put_simplification_result(), put_smoothing_result(), put_trapezoidal_map_result(), put_visibility_polygon_result(), put_voronoi_result(), TextVariantsTest::SetUp(), CoordinateTransformTest::SetUp(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and visualize_convex_hull().
|
inline |
Insert any supported geometry type with style/layer.
Definition at line 1518 of file tikzgeom.H.
References Aleph::Tikz_Plane::put().
|
inline |
Draw KD-tree partitions from a debug snapshot.
Definition at line 901 of file tikzgeom_algorithms.H.
References Aleph::Tikz_Style::draw_color, put_in_plane(), put_points(), Aleph::detail::tikz_palette_color(), y0(), and y1().
Referenced by visualize_kdtree_partitions().
|
inline |
Draw line segments and all sweep-line intersection points.
Definition at line 1791 of file tikzgeom_algorithms.H.
References put_in_plane(), and Aleph::Array< T >::size().
|
inline |
Draw a precomputed minimum enclosing circle result.
Draws the enclosing circle as an Ellipse and optionally the input points on top.
Definition at line 1870 of file tikzgeom_algorithms.H.
References Aleph::MinimumEnclosingCircle::Circle::center, put_in_plane(), put_points(), r, and Aleph::MinimumEnclosingCircle::Circle::radius().
|
inline |
Draw input polygons and their Minkowski sum result.
Definition at line 1711 of file tikzgeom_algorithms.H.
References put_in_plane(), and Aleph::Polygon::size().
|
inline |
Draw a monotone triangulation result plus polygon boundary.
Definition at line 1739 of file tikzgeom_algorithms.H.
References LocateFunctions< Container, Type >::get_it(), and put_in_plane().
|
inline |
Draw a polygon offset result overlaid on the original polygon.
| plane | Target TikZ canvas. |
| original | The original polygon (drawn faded). |
| result | The offset result (one or more polygons). |
| original_style | Style for the original polygon. |
| offset_style | Style for offset polygon(s). |
| draw_vertices | Whether to draw vertices of offset polygon(s). |
| vertex_style | Style for offset polygon vertices. |
Definition at line 1978 of file tikzgeom_algorithms.H.
References Aleph::PolygonOffset::Result::polygons, put_in_plane(), and put_polygon_vertices().
|
inline |
Insert an Array<Point> path as connected segments and waypoints.
Definition at line 1220 of file tikzgeom_algorithms.H.
References put_in_plane(), put_points(), and Aleph::Array< T >::size().
|
inline |
Insert a point path as connected segments and optional waypoints.
Definition at line 1195 of file tikzgeom_algorithms.H.
References LocateFunctions< Container, Type >::get_it(), put_in_plane(), and put_points().
Referenced by put_funnel_trace_step().
|
inline |
Insert a point label with configurable placement (above, etc.).
Definition at line 1616 of file tikzgeom.H.
References put_in_plane(), and Aleph::Tikz_Style::text_placement.
Referenced by main(), put_point_labels(), and put_point_labels().
|
inline |
Adds a text label to each point in an Array<Point>.
Labels are generated as prefix + index. For example, p0, p1, etc.
| plane | The target TikZ plane. |
| pts | The array of points to label. |
| prefix | A string prefix for each label. |
| placement | The TikZ placement string (e.g., "above", "below left"). |
| style | The style for the text labels. |
| layer | The layer on which to draw the labels. |
Definition at line 443 of file tikzgeom_algorithms.H.
References prefix(), put_point_label_in_plane(), and Aleph::Array< T >::size().
|
inline |
Adds a text label to each point in a DynList<Point>.
Labels are generated as prefix + index based on iteration order.
| plane | The target TikZ plane. |
| pts | The list of points to label. |
| prefix | A string prefix for each label. |
| placement | The TikZ placement string (e.g., "above", "below left"). |
| style | The style for the text labels. |
| layer | The layer on which to draw the labels. |
Definition at line 464 of file tikzgeom_algorithms.H.
References LocateFunctions< Container, Type >::get_it(), prefix(), and put_point_label_in_plane().
|
inline |
Inserts all points from an Array<Point> into the plane.
| plane | The target TikZ plane. |
| pts | An array of points to insert. |
| style | The style to apply to each point. |
| layer | The layer on which to draw the points. |
Definition at line 409 of file tikzgeom_algorithms.H.
References put_in_plane(), and Aleph::Array< T >::size().
Referenced by Aleph::Tikz_Scene::add_points(), Aleph::Tikz_Scene::add_points(), main(), put_alpha_shape_result(), put_cdt_result(), put_closest_pair_result(), put_delaunay_result(), put_kdtree_partitions_result(), put_mec_result(), put_path(), put_path(), put_range_tree_result(), put_segment_arrangement_result(), put_voronoi_result(), and visualize_convex_hull().
|
inline |
Inserts all points from a DynList<Point> into the plane.
| plane | The target TikZ plane. |
| pts | A dynamic list of points to insert. |
| style | The style to apply to each point. |
| layer | The layer on which to draw the points. |
Definition at line 424 of file tikzgeom_algorithms.H.
References LocateFunctions< Container, Type >::get_it(), and put_in_plane().
|
inline |
Inserts the vertices of a polygon as styled points.
| plane | The target TikZ plane. |
| poly | The polygon whose vertices are to be drawn. |
| style | The style for the vertex points. |
| layer | The layer on which to draw the points. |
Definition at line 498 of file tikzgeom_algorithms.H.
References Aleph::Dlink::Iterator::has_curr(), and put_in_plane().
Referenced by main(), put_offset_result(), put_simplification_result(), put_smoothing_result(), and visualize_convex_hull().
|
inline |
Inserts the vertices of a regular polygon as styled points.
| plane | The target TikZ plane. |
| poly | The regular polygon whose vertices are to be drawn. |
| style | The style for the vertex points. |
| layer | The layer on which to draw the points. |
Definition at line 513 of file tikzgeom_algorithms.H.
References Aleph::Regular_Polygon::get_vertex(), put_in_plane(), and Aleph::Regular_Polygon::size().
|
inline |
Inserts all polygons from an Array<Polygon> into the plane.
| plane | The target TikZ plane. |
| polys | An array of polygons to insert. |
| style | The style to apply to each polygon. |
| layer | The layer on which to draw the polygons. |
Definition at line 483 of file tikzgeom_algorithms.H.
References put_in_plane(), and Aleph::Array< T >::size().
Referenced by Aleph::Tikz_Scene::add_polygons().
|
inline |
Insert funnel portals as segment connectors.
Definition at line 1240 of file tikzgeom_algorithms.H.
References and, put_in_plane(), and Aleph::Array< T >::size().
Referenced by put_funnel_trace_step().
|
inline |
Insert Power diagram structures (cells, edges, weighted sites).
Definition at line 786 of file tikzgeom_algorithms.H.
References cell(), Aleph::PowerDiagram::Result::cells, Aleph::PowerDiagram::Result::edges, polygon_from_vertices(), put_in_plane(), and Aleph::PowerDiagram::Result::sites.
|
inline |
Approximate and insert a quadratic Bézier as an open polyline.
Definition at line 1526 of file tikzgeom.H.
Referenced by TEST().
|
inline |
Insert a quadratic Bézier using native TikZ controls syntax.
Definition at line 1591 of file tikzgeom.H.
Referenced by TEST().
|
inline |
Draw range-tree X-axis hierarchy and optional query highlights.
Definition at line 951 of file tikzgeom_algorithms.H.
References Aleph::Tikz_Style::draw_color, adaptive_huffman_demo::Snapshot::nodes, put_in_plane(), put_points(), and Aleph::detail::tikz_palette_color().
Referenced by visualize_range_tree(), and visualize_range_tree_query().
|
inline |
Draw regular (weighted Delaunay) triangulation output.
Definition at line 1584 of file tikzgeom_algorithms.H.
References put_in_plane(), Aleph::RegularTriangulationBowyerWatson::Result::sites, and Aleph::RegularTriangulationBowyerWatson::Result::triangles.
|
inline |
Draw diameter and minimum-width witnesses for a convex polygon.
Definition at line 1650 of file tikzgeom_algorithms.H.
References Aleph::RotatingCalipersConvexPolygon::WidthResult::antipodal, Aleph::RotatingCalipersResult::diameter, Aleph::RotatingCalipersConvexPolygon::WidthResult::edge_first, Aleph::RotatingCalipersConvexPolygon::WidthResult::edge_second, Aleph::RotatingCalipersConvexPolygon::DiameterResult::first, put_in_plane(), Aleph::RotatingCalipersConvexPolygon::DiameterResult::second, and Aleph::RotatingCalipersResult::width.
Referenced by visualize_rotating_calipers().
|
inline |
Draw every node MBR (colored by depth) of an R-tree/R*-tree snapshot, plus its leaf entry boxes, an optional query rectangle, and its optional hit boxes.
RTree::DebugSnapshot deliberately omits Payload (see RTree::DebugSnapshot), so this stays usable for any payload type, including move-only ones. Definition at line 1113 of file tikzgeom_algorithms.H.
References Aleph::Tikz_Style::draw_color, adaptive_huffman_demo::Snapshot::nodes, put_in_plane(), and Aleph::detail::tikz_palette_color().
Referenced by visualize_rtree(), and visualize_rtree_query().
|
inline |
Insert segment arrangement structures (faces, edges, vertices).
Definition at line 832 of file tikzgeom_algorithms.H.
References and, Aleph::Tikz_Style::draw_color, Aleph::SegmentArrangement::Result::edges, Aleph::SegmentArrangement::Result::faces, Aleph::Tikz_Style::fill, Aleph::Tikz_Style::fill_color, polygon_from_vertex_indices(), put_in_plane(), put_points(), Aleph::Polygon::size(), Aleph::detail::tikz_palette_color(), and Aleph::SegmentArrangement::Result::vertices.
|
inline |
Draw original and simplified polygons overlaid.
| plane | Target TikZ canvas. |
| original | The original polygon (drawn faded). |
| simplified | The simplified polygon (drawn bold). |
| original_style | Style for the original polygon. |
| simplified_style | Style for the simplified polygon. |
| draw_vertices | Whether to draw vertices of the simplified polygon. |
| vertex_style | Style for simplified polygon vertices. |
Definition at line 1915 of file tikzgeom_algorithms.H.
References put_in_plane(), and put_polygon_vertices().
Referenced by main().
|
inline |
Draw original and smoothed polygons overlaid.
| plane | Target TikZ canvas. |
| original | The original polygon (drawn faded). |
| smoothed | The smoothed polygon (drawn bold). |
| original_style | Style for the original polygon. |
| smoothed_style | Style for the smoothed polygon. |
| draw_vertices | Whether to draw vertices of the smoothed polygon. |
| vertex_style | Style for smoothed polygon vertices. |
Definition at line 2027 of file tikzgeom_algorithms.H.
References put_in_plane(), and put_polygon_vertices().
Referenced by main(), and visualize_chaikin_smoothing().
|
inline |
Draw the trapezoidal map result into a Tikz_Plane.
Definition at line 2071 of file tikzgeom_algorithms.H.
References Aleph::Polygon::add_vertex(), Aleph::Polygon::close(), Aleph::Tikz_Style::draw_color, Aleph::Tikz_Style::fill, Aleph::Tikz_Style::fill_color, Aleph::Segment::get_src_point(), Aleph::Segment::get_tgt_point(), Aleph::Point::get_x(), Aleph::Point::get_y(), Aleph::TrapezoidalMapPointLocation::NONE, Aleph::TrapezoidalMapPointLocation::Result::num_input_points, Aleph::TrapezoidalMapPointLocation::Result::num_input_segments, Aleph::Tikz_Style::opacity, Aleph::TrapezoidalMapPointLocation::Result::points, put_in_plane(), Aleph::TrapezoidalMapPointLocation::Result::segments, Aleph::detail::tikz_palette_color(), Trap, Aleph::TrapezoidalMapPointLocation::Result::trapezoids, and y1().
Referenced by main(), visualize_trapezoidal_map(), and visualize_trapezoidal_map().
|
inline |
|
inline |
Draw visibility polygon with source polygon and query point.
Definition at line 1763 of file tikzgeom_algorithms.H.
References put_in_plane(), and Aleph::Polygon::size().
| void Aleph::put_voronoi_result | ( | Tikz_Plane & | plane, |
| const VoronoiResult & | vor, | ||
| const bool | draw_cells = false, |
||
| const Tikz_Style & | cell_style = tikz_area_style("gray!50!black", "gray!15", 0.35), |
||
| const Tikz_Style & | edge_style = tikz_wire_style("black"), |
||
| const Tikz_Style & | unbounded_edge_style = tikz_wire_style("black", true, true), |
||
| const Tikz_Style & | site_style = tikz_points_style("red"), |
||
| const Geom_Number & | unbounded_ray_length = Geom_Number(50), |
||
| const int | cell_layer = Tikz_Plane::Layer_Background, |
||
| const int | edge_layer = Tikz_Plane::Layer_Default, |
||
| const int | site_layer = Tikz_Plane::Layer_Foreground |
||
| ) |
Insert Voronoi diagram structures (cells, edges, sites).
Works with VoronoiDiagram::Result and VoronoiDiagramFromDelaunay::Result.
Definition at line 731 of file tikzgeom_algorithms.H.
References cell(), polygon_from_vertices(), put_in_plane(), put_points(), and ray_endpoint().
| bool Aleph::pzip_all_n | ( | Pred | pred, |
| const ParallelOptions & | options, | ||
| const Containers &... | cs | ||
| ) |
Definition at line 2908 of file ah-parallel.H.
References Aleph::ThreadPool::enqueue(), Aleph::ThreadPool::num_threads(), offset, options, pred, and pzip_all_n().
| bool Aleph::pzip_all_n | ( | ThreadPool & | pool, |
| Pred | pred, | ||
| const Containers &... | cs | ||
| ) |
Parallel all predicate over N zipped containers (variadic).
Tests if a predicate holds for all corresponding tuples of elements. Short-circuits when a false result is found.
| Pred | Predicate type: bool(const T1&, ..., const TN&) |
| Containers | Container types (variadic). |
| pool | Thread pool to use. |
| pred | Predicate to test. |
| cs | Containers to zip (2 or more). |
Definition at line 2900 of file ah-parallel.H.
References options, Aleph::ParallelOptions::pool, pred, and pzip_all_n().
Referenced by example_variadic_zip(), pzip_all_n(), pzip_all_n(), TEST_F(), TEST_F(), and TEST_F().
| size_t Aleph::pzip_count_if_n | ( | Pred | pred, |
| const ParallelOptions & | options, | ||
| const Containers &... | cs | ||
| ) |
Definition at line 3131 of file ah-parallel.H.
References count(), Aleph::ThreadPool::enqueue(), Aleph::ThreadPool::num_threads(), offset, options, pred, and pzip_count_if_n().
| size_t Aleph::pzip_count_if_n | ( | ThreadPool & | pool, |
| Pred | pred, | ||
| const Containers &... | cs | ||
| ) |
Parallel count over N zipped containers (variadic).
Counts tuples that satisfy a predicate.
| Pred | Predicate type: bool(const T1&, ..., const TN&) |
| Containers | Container types (variadic). |
| pool | Thread pool to use. |
| pred | Predicate to test. |
| cs | Containers to zip (2 or more). |
Definition at line 3122 of file ah-parallel.H.
References options, Aleph::ParallelOptions::pool, pred, and pzip_count_if_n().
Referenced by example_variadic_zip(), pzip_count_if_n(), pzip_count_if_n(), TEST_F(), TEST_F(), and TEST_F().
| bool Aleph::pzip_exists_n | ( | Pred | pred, |
| const ParallelOptions & | options, | ||
| const Containers &... | cs | ||
| ) |
Definition at line 3026 of file ah-parallel.H.
References Aleph::ThreadPool::enqueue(), Aleph::ThreadPool::num_threads(), offset, options, pred, and pzip_exists_n().
| bool Aleph::pzip_exists_n | ( | ThreadPool & | pool, |
| Pred | pred, | ||
| const Containers &... | cs | ||
| ) |
Parallel exists predicate over N zipped containers (variadic).
Tests if a predicate holds for any corresponding tuple of elements. Short-circuits when a true result is found.
| Pred | Predicate type: bool(const T1&, ..., const TN&) |
| Containers | Container types (variadic). |
| pool | Thread pool to use. |
| pred | Predicate to test. |
| cs | Containers to zip (2 or more). |
Definition at line 3018 of file ah-parallel.H.
References options, Aleph::ParallelOptions::pool, pred, and pzip_exists_n().
Referenced by pzip_exists_n(), pzip_exists_n(), TEST_F(), TEST_F(), and TEST_F().
| T Aleph::pzip_foldl | ( | const Container1 & | c1, |
| const Container2 & | c2, | ||
| T | init, | ||
| Op | op, | ||
| const ParallelOptions & | options = {} |
||
| ) |
Definition at line 1922 of file ah-parallel.H.
References pzip_foldl().
| T Aleph::pzip_foldl | ( | ThreadPool & | pool, |
| const Container1 & | c1, | ||
| const Container2 & | c2, | ||
| T | init, | ||
| Op | op, | ||
| size_t | chunk_size = 0 |
||
| ) |
Parallel zip + fold.
Reduces corresponding elements of two containers using a ternary function.
| pool | Thread pool to use. |
| c1 | First container. |
| c2 | Second container. |
| init | Initial value. |
| op | Ternary function: R op(R acc, const T1&, const T2&). |
| chunk_size | Elements per chunk (0 = auto). |
Definition at line 1911 of file ah-parallel.H.
References options, Aleph::ParallelOptions::pool, and pzip_foldl().
Referenced by example_parallel_zip(), pzip_foldl(), pzip_foldl(), and TEST_F().
| T Aleph::pzip_foldl_n | ( | T | init, |
| Op | op, | ||
| Combiner | combiner, | ||
| const ParallelOptions & | options, | ||
| const Containers &... | cs | ||
| ) |
Definition at line 2776 of file ah-parallel.H.
References Aleph::ThreadPool::enqueue(), Aleph::ThreadPool::num_threads(), offset, options, and pzip_foldl_n().
| T Aleph::pzip_foldl_n | ( | ThreadPool & | pool, |
| T | init, | ||
| Op | op, | ||
| Combiner | combiner, | ||
| const Containers &... | cs | ||
| ) |
Parallel fold/reduce over N zipped containers (variadic).
Reduces corresponding elements from multiple containers using a function, processing in parallel. Requires a binary combiner for merging partial results.
| T | Accumulator type. |
| Op | Operation type: T(T acc, const T1&, ..., const TN&) |
| Combiner | Binary combiner: T(T, T) |
| Containers | Container types (variadic). |
| pool | Thread pool to use. |
| init | Initial accumulator value. |
| op | Function: T op(T acc, const T1&, ..., const TN&). |
| combiner | Binary function to combine partial results: T(T, T). |
| cs | Containers to zip (2 or more). |
pzip_foldl for 2 containers, pzip_foldl_n for 3+. Definition at line 2767 of file ah-parallel.H.
References options, Aleph::ParallelOptions::pool, and pzip_foldl_n().
Referenced by pzip_foldl_n(), pzip_foldl_n(), TEST_F(), and TEST_F().
| void Aleph::pzip_for_each | ( | const Container1 & | c1, |
| const Container2 & | c2, | ||
| Op | op, | ||
| const ParallelOptions & | options = {} |
||
| ) |
Definition at line 1711 of file ah-parallel.H.
References pzip_for_each().
| void Aleph::pzip_for_each | ( | ThreadPool & | pool, |
| const Container1 & | c1, | ||
| const Container2 & | c2, | ||
| Op | op, | ||
| size_t | chunk_size = 0 |
||
| ) |
Parallel zip + for_each.
Applies a function to corresponding elements of two containers in parallel.
| pool | Thread pool to use. |
| c1 | First container. |
| c2 | Second container. |
| op | Function: void op(const T1&, const T2&). |
| chunk_size | Elements per chunk (0 = auto). |
Definition at line 1701 of file ah-parallel.H.
References options, Aleph::ParallelOptions::pool, and pzip_for_each().
Referenced by example_parallel_zip(), pzip_for_each(), pzip_for_each(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
| void Aleph::pzip_for_each_n | ( | Op | op, |
| const ParallelOptions & | options, | ||
| const Containers &... | cs | ||
| ) |
Definition at line 2540 of file ah-parallel.H.
References Aleph::ThreadPool::enqueue(), Aleph::ThreadPool::num_threads(), offset, options, and pzip_for_each_n().
| void Aleph::pzip_for_each_n | ( | ThreadPool & | pool, |
| Op | op, | ||
| const Containers &... | cs | ||
| ) |
Parallel for_each over N zipped containers (variadic).
Applies a function to corresponding elements from multiple containers in parallel. Stops at the shortest container.
| Op | Operation type: void(const T1&, const T2&, ..., const TN&) |
| Containers | Container types (variadic). |
| pool | Thread pool to use. |
| op | Function to apply to each tuple of elements. |
| cs | Containers to zip (2 or more). |
pzip_for_each for 2 containers, pzip_for_each_n for 3+. Definition at line 2532 of file ah-parallel.H.
References options, Aleph::ParallelOptions::pool, and pzip_for_each_n().
Referenced by pzip_for_each_n(), pzip_for_each_n(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
| auto Aleph::pzip_maps | ( | const Container1 & | c1, |
| const Container2 & | c2, | ||
| Op | op, | ||
| const ParallelOptions & | options = {} |
||
| ) |
Definition at line 1807 of file ah-parallel.H.
References pzip_maps().
| auto Aleph::pzip_maps | ( | ThreadPool & | pool, |
| const Container1 & | c1, | ||
| const Container2 & | c2, | ||
| Op | op, | ||
| size_t | chunk_size = 0 |
||
| ) |
Parallel zip + map.
Maps corresponding elements of two containers using a binary function.
| pool | Thread pool to use. |
| c1 | First container. |
| c2 | Second container. |
| op | Function: R op(const T1&, const T2&). |
| chunk_size | Elements per chunk (0 = auto). |
Definition at line 1797 of file ah-parallel.H.
References options, Aleph::ParallelOptions::pool, and pzip_maps().
Referenced by example_parallel_zip(), pzip_maps(), pzip_maps(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
| auto Aleph::pzip_maps_n | ( | Op | op, |
| const ParallelOptions & | options, | ||
| const Containers &... | cs | ||
| ) |
Definition at line 2646 of file ah-parallel.H.
References Aleph::ThreadPool::enqueue(), Aleph::ThreadPool::num_threads(), offset, options, and pzip_maps_n().
| auto Aleph::pzip_maps_n | ( | ThreadPool & | pool, |
| Op | op, | ||
| const Containers &... | cs | ||
| ) |
Parallel map over N zipped containers (variadic).
Maps corresponding elements from multiple containers using a function, processing in parallel.
| Op | Operation type: R(const T1&, const T2&, ..., const TN&) |
| Containers | Container types (variadic). |
| pool | Thread pool to use. |
| op | Function to apply to each tuple of elements. |
| cs | Containers to zip (2 or more). |
pzip_maps for 2 containers, pzip_maps_n for 3+. Definition at line 2638 of file ah-parallel.H.
References options, Aleph::ParallelOptions::pool, and pzip_maps_n().
Referenced by example_variadic_zip(), pzip_maps_n(), pzip_maps_n(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
| auto Aleph::quartiles | ( | const Container & | data | ) | -> std::tuple<std::decay_t<decltype(*std::begin(data))>, std::decay_t<decltype(*std::begin(data))>, std::decay_t<decltype(*std::begin(data))>> |
Compute quartiles (Q1, Q2, Q3).
| data | Input container |
Definition at line 406 of file stat_utils.H.
References percentile(), and quartiles().
Referenced by quartiles(), TEST(), and TEST().
| void Aleph::quicksort | ( | Dlink & | list, |
| const Compare & | cmp = Compare() |
||
| ) |
Sorts a linked list by the quicksort method.
quicksort(list) sorts a list according to the quicksort method according to comparison criteria Compare.
This method has an expected performance of \(O(n \; \lg n)\) and is considered the fastest ordering method.
| [in,out] | list | the list to sort. |
| cmp | Comparison functor defining "less than" relationship. |
Definition at line 2523 of file tpl_sort_utils.H.
References Aleph::Dlink::append(), cmp(), Aleph::Dlink::concat_list(), Aleph::Dlink::is_empty(), Aleph::Dlink::is_unitarian_or_empty(), and Aleph::Dlink::remove_next().
Sorts a list by the quicksort method.
quicksort(list) sorts a list using the method quicksort according to comparison criteria Compare.
The method uses two type parameters:
This method has an expected performance of \(O(n \; \lg n)\) and is considered the fastest ordering method.
This primitive can be used for lists of type Dlist and DynDlist.
| [in,out] | list | the list to sort. |
| cmp | Comparison functor defining "less than" relationship. |
Definition at line 2567 of file tpl_sort_utils.H.
References cmp().
Sorts a dynamic array by the quicksort method without recursion.
quicksort(a) sorts the dynamic array according to the method quicksort according to comparison criteria Compare.
The method uses two type parameters:
This method has an expected performance of \(O(n \; \lg n)\) and is considered the fastest ordering method.
This version of quicksort takes up maximum space of \(O(\lg n)\).
The pivot is the median of the first, the middle and the last items of each range, so that a sorted or a reversed array splits in halves.
Quicksort is a probabilistic method. In a very bad case -very bad luck- can be degraded to \(O(n^2)\). To alleviate, to the extent of luck, the bad cases, use quicksort_insertion() which runs heuristics to alleviate the bad cases and invoke the insert method to small array partitions.
| [in,out] | a | the array to be ordered. |
| cmp | comparison object. |
Explicit partition stack, sized to introsort's worst-case depth.
Definition at line 3965 of file tpl_sort_utils.H.
References cmp(), introsort_depth_limit(), Aleph::FixedStack< T >::is_empty(), l, Aleph::sort_utils_detail::median_of_three_to_last(), partition(), Aleph::FixedStack< T >::pop(), push2(), r, and Aleph::DynArray< T >::size().
Sort a DynList using the quicksort method.
| list | The list to sort. |
| cmp | Comparison functor for the data type T. |
Definition at line 2605 of file tpl_sort_utils.H.
References cmp().
| void Aleph::quicksort | ( | HTList & | list, |
| const Compare & | cmp = Compare() |
||
| ) |
Sort an HTList using the quicksort method.
| list | The list to sort. |
| cmp | Comparison functor for the data type T. |
Definition at line 2577 of file tpl_sort_utils.H.
References Aleph::HTList::append(), cmp(), Aleph::HTList::concat_list(), Aleph::HTList::is_empty(), Aleph::HTList::is_unitarian_or_empty(), and Aleph::HTList::remove_first_ne().
|
inline |
Sort an array using iterative quicksort with optimizations.
This is the main quicksort implementation, featuring:
| T | Element type (must be swappable and comparable). |
| Compare | Comparison functor type (default: Aleph::less<T>). |
| [in,out] | a | Pointer to the array to sort. |
| [in] | l | Left index (inclusive) of the range to sort. |
| [in] | r | Right index (inclusive) of the range to sort. |
| cmp | Comparison functor. |
Explicit partition stack, sized to introsort's worst-case depth.
Definition at line 1834 of file tpl_sort_utils.H.
References cmp(), diff(), insertion_sort(), introsort_depth_limit(), l, Aleph::FixedStack< T >::pop(), Aleph::FixedStack< T >::push(), Quicksort_Threshold, r, and Aleph::FixedStack< T >::size().
Referenced by benchmark_list_algorithms(), Aleph::Matrix_Graph< GT, SA >::copy(), Aleph::Map_Matrix_Graph< GT, SA >::copy_list_graph(), Aleph::Bit_Mat_Graph< GT, SA >::copy_list_graph(), Aleph::Ady_Mat< GT, __Entry_Type, SA >::copy_nodes(), main(), and main().
|
inline |
Sorts an array by the improved quicksort method.
quicksort_insertion(a,l,r) sorts the array a among the indexes l and r according to the quicksort method according to criteria comparison Compare.
The procedure combines various techniques to accelerate the ordering and at the same time avoid degradation due to bad cases.
Bad cases are treated by pivot selection consisting of the median between l, r and the center of the partition.
To ensure a maximum battery consumption of \(O(\lg n)\), the method always proceeds recursively to sort the partition smaller.
When the partition reaches a size less than or equal to the sim_id constant Aleph::Insertion_Threshold, then The partition is sorted by the insert method, which It is faster than quicksort for small sizes.
The method uses two type parameters:
This method has an expected performance of \(O(n \; \lg n)\) and is considered the fastest ordering method.
| [in,out] | a | the array to sort. |
| [in] | l | lower index. |
| [in] | r | top index. |
| cmp | comparison object. |
Definition at line 2649 of file tpl_sort_utils.H.
References and, cmp(), Insertion_Threshold, l, and r.
|
inline |
Quicksort implementation with tail-recursion optimization.
Recursively sorts the smaller partition and iterates on the larger one to guarantee O(log n) stack depth.
| T | Element type. |
| Compare | Comparison functor. |
| [in,out] | a | Pointer to the array. |
| [in] | l | Left index. |
| [in] | r | Right index. |
| [in] | cmp | Comparison functor. |
Definition at line 1716 of file tpl_sort_utils.H.
|
inline |
Optimized quicksort for containers using operator().
This is the preferred quicksort implementation for Aleph containers like DynArray and Array. It uses the operator() access method instead of pointer arithmetic, allowing compatibility with various container types.
Time complexity: O(n log n) expected Space complexity: O(log n) for the stack
| C | Container template (must support operator() and size()). |
| T | Element type. |
| Compare | Comparison functor type (default: Aleph::less<T>). |
| [in,out] | a | Container to sort. |
| cmp | Comparison functor. | |
| threshold | Size below which insertion sort is used. |
Definition at line 5119 of file tpl_sort_utils.H.
References cmp(), insertion_sort(), introsort_depth_limit(), Aleph::FixedStack< T >::is_empty(), l, Aleph::FixedStack< T >::pop(), push2(), and r.
Referenced by benchmark_array_algorithms(), Aleph::RangeTree2D::build(), Aleph::Bounded_Cycle_Index< GT >::build(), build_index(), build_index_ptr(), build_index_ptr(), Aleph::ShortestPathInPolygon::build_tris(), Aleph::KDTreePointSearch::debug_snapshot(), Aleph::MonotonePolygonTriangulation::decompose_to_monotone_faces(), demonstrate_complexity(), Aleph::Tikz_Plane::draw(), Aleph::GeomTriangleAdjacencyUtils::for_each_sorted_edge_group(), hull_signature(), main(), Aleph::ConstrainedDelaunayTriangulation::map_constraints(), Aleph::ConstrainedDelaunayTriangulation::merge_and_deduplicate(), Aleph::HalfPlaneIntersection::operator()(), Aleph::SweepLineSegmentIntersection::operator()(), Aleph::SegmentArrangement::operator()(), Aleph::ClosestPairDivideAndConquer::operator()(), Aleph::DelaunayTriangulationRandomizedIncremental::operator()(), Aleph::GrahamScanConvexHull::operator()(), Aleph::AlphaShape::operator()(), Aleph::VisibilityPolygon::operator()(), sorted_hull_vertices(), Aleph::AndrewMonotonicChainConvexHull::sorted_unique_points(), Aleph::GrahamScanConvexHull::sorted_unique_points(), Aleph::detail::spp_build_tris(), stable_build_index(), stable_build_index_ptr(), stable_build_index_ptr(), TEST(), test_hash_table(), Aleph::MonotonePolygonTriangulation::triangulate_monotone(), Aleph::KDTreePointSearch::unique_points(), Aleph::DelaunayTriangulationBowyerWatson::unique_points(), and Aleph::RegularTriangulationBowyerWatson::unique_sites().
|
inline |
Recursively sort a dynamic array using quicksort.
The pivot is the median of the first, the middle and the last items of each range.
| a | The dynamic array. |
| l | Left index. |
| r | Right index. |
| cmp | Comparison functor. |
Definition at line 3897 of file tpl_sort_utils.H.
References cmp(), l, Aleph::sort_utils_detail::median_of_three_to_last(), partition(), and r.
|
inline |
Recursively sort an array using quicksort.
This method has an expected performance of \(O(n \; \lg n)\) and is considered the fastest ordering method.
This version of quicksort can take up \(O(n)\) space. Use quicksort_rec_min() if you want to guarantee consumption maximum space of \(O(\lg n)\).
| a | Pointer to the array to sort. |
| l | Left index (inclusive). |
| r | Right index (inclusive). |
| cmp | Comparison functor defining "less than" relationship. |
Definition at line 1691 of file tpl_sort_utils.H.
|
inline |
Sorts an array according to the quicksort method with minimum space consumption.
Purely recursive quicksort can consume proportional stack to the size of the arrangement to be ordered. To avoid this problem, at the expense of a slight execution cost, quicksort_rec_min() always sorts the smallest partition first. For others, The same considerations as for quicksort_rec() apply.
| [in,out] | a | the array to sort. |
| [in] | l | initial index by which to sort. |
| [in] | r | final index by which to sort. |
| cmp | comparison object. |
Definition at line 1755 of file tpl_sort_utils.H.
|
inline |
Find all occurrences using Rabin-Karp with rolling hash.
Hash collisions are filtered by exact character-by-character verification, so returned matches are exact.
| [in] | text | Text where matches are searched. |
| [in] | pattern | Pattern to find. |
| [in] | base | Rolling-hash base. |
| None. |
pattern is empty, returns all positions in [0, text.size()]. uint64_t overflow (no explicit prime modulus). This is sufficient for general use but may produce more collisions on adversarial inputs.Definition at line 371 of file String_Search.H.
References Aleph::string_search_detail::all_match_positions(), and, Aleph::Array< T >::append(), Aleph::string_search_detail::equals_at(), m, OhashCommon< HashTbl, Key >::size(), and Aleph::Array< T >::size().
Referenced by main(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
LSD radix sort for integral Array values.
Sorts in ascending order. Signed integers are supported by applying a monotone bit transform on the sign bit.
| T | Value type. |
| [in,out] | a | The Array to sort. |
| std::domain_error | if an internal domain error occurs. |
| std::runtime_error | if an internal runtime error occurs. |
w = sizeof(T). Delegate to the shared LSD bucket-distribution implementation.
Definition at line 5989 of file tpl_sort_utils.H.
References Aleph::sort_utils_detail::radix_sort_impl().
LSD radix sort for integral DynArray values.
How Radix Sort Works: When sorting large numbers, the range k in Counting Sort would consume an unreasonable amount of memory. Radix Sort solves this by sorting numbers "digit by digit" (or more precisely, byte by byte) in multiple passes.
The core idea behind this LSD (Least Significant Digit) Radix Sort is:
To sort by each individual byte, the algorithm uses Counting Sort internally (with 256 buckets). Because Counting Sort is stable, sorting by a more significant byte does not scramble the relative order previously established by the less significant bytes. Signed integers are fully supported by applying a monotone bit transform on the sign bit before extracting the keys.
| T | Value type. |
| [in,out] | a | The DynArray to sort. |
| std::domain_error | if an internal domain error occurs. |
| std::runtime_error | if an internal runtime error occurs. |
w = sizeof(T). Delegate to the shared LSD bucket-distribution implementation.
Definition at line 5967 of file tpl_sort_utils.H.
References Aleph::sort_utils_detail::radix_sort_impl().
Referenced by radix_sort().
LSD radix sort for integral DynDlist values.
This overload performs stable bucket distribution directly on list nodes.
| T | Value type. |
| [in,out] | list | The DynDlist to sort. |
| std::domain_error | if an internal domain error occurs. |
| std::runtime_error | if an internal runtime error occurs. |
Delegate to the shared LSD bucket-distribution implementation.
Definition at line 6025 of file tpl_sort_utils.H.
References Aleph::sort_utils_detail::radix_sort_impl().
LSD radix sort for integral DynList values.
This overload performs stable bucket distribution directly on list nodes.
| T | Value type. |
| [in,out] | list | The DynList to sort. |
| std::domain_error | if an internal domain error occurs. |
| std::runtime_error | if an internal runtime error occurs. |
Delegate to the shared LSD bucket-distribution implementation.
Definition at line 6007 of file tpl_sort_utils.H.
References Aleph::sort_utils_detail::radix_sort_impl().
LSD radix sort for raw integral arrays.
| T | Value type. |
| [in,out] | a | Pointer to the first element. |
| [in] | n | Number of elements. |
| std::domain_error | if an internal domain error occurs. |
| std::invalid_argument | if a is null and n > 0. |
w = sizeof(T). Delegate to the shared LSD bucket-distribution implementation.
Definition at line 6045 of file tpl_sort_utils.H.
References ah_invalid_argument_if, and, and Aleph::sort_utils_detail::radix_sort_impl().
LSD radix sort for fixed-size integral C arrays.
| T | Value type. |
| N | Array size. |
| [in,out] | a | The fixed-size array to sort. |
| std::domain_error | if an internal domain error occurs. |
| std::runtime_error | if an internal runtime error occurs. |
Definition at line 6064 of file tpl_sort_utils.H.
References radix_sort().
| Net::Flow_Type Aleph::random_preflow_maximum_flow | ( | Net & | net | ) |
Preflow-push maximum flow using a random active-node queue.
The order of the active nodes takes its seed from the time, so that two runs may push the flow along other arcs; the overload with a seed repeats them.
| [in,out] | net | Flow network (must have a single source and sink). |
Definition at line 2738 of file tpl_net.H.
Referenced by Aleph::Random_Preflow_Maximum_Flow< Net >::operator()(), TEST(), and TEST().
| Net::Flow_Type Aleph::random_preflow_maximum_flow | ( | Net & | net, |
| const unsigned long | seed | ||
| ) |
Preflow-push maximum flow using a random active-node queue whose order takes the seed seed.
Two runs on equal networks with the same seed push the same flows.
| [in,out] | net | Flow network (must have a single source and sink). |
| [in] | seed | the seed of the order of the active nodes. |
Definition at line 2756 of file tpl_net.H.
References seed, and Aleph::Random_Set< T >::set_seed().
Random search for an element in a Dnode<T> list.
random_search(list,x) uses the partition algorithm quicksort to find element x in the list.
The method uses two type parameters:
The procedure has an expected complexity of \(O(n \; \lg n)\), which is greater than mere search sequential, but with the addition that after the search the list is partially ordered.
A specialization uses the "less than" relationship as comparison criterion and saves writing that class.
| [in,out] | list | list in which the search is performed; is partially modified after the search. |
| [in] | x | element to search for. |
| cmp | Comparison functor defining "less than" relationship. |
Definition at line 2871 of file tpl_sort_utils.H.
References cmp().
|
inline |
Random search for an element in a dynamic array.
| a | The dynamic array to search. |
| x | The element to search for. |
| l | Left index (inclusive). |
| r | Right index (inclusive). |
| cmp | Comparison functor. |
Definition at line 2760 of file tpl_sort_utils.H.
References cmp(), l, Not_Found, partition(), and r.
|
inline |
Random search for an element in a dynamic list.
random_search(list,x) uses the partition algorithm quicksort to find element x in the dynamic list list.
The method uses two type parameters:
The procedure has an expected complexity of \(O(n \; \lg n)\), which is greater than mere search sequential, but with the addition that after the search the list is partially ordered.
A specialization uses the "less than" relationship as a comparison criterion and saves writing that class.
| [in,out] | list | dynamic list in which to perform the search; is partially modified after the search. |
| [in] | x | element to search for. |
| cmp | comparison object. |
Definition at line 2906 of file tpl_sort_utils.H.
References cmp(), and Aleph::Dnode< T >::get_data().
|
inline |
Random search for an element in an array.
random_search(a,x,l,r) uses the partition algorithm quicksort to find element x in the array a between the limits l and r.
The method uses two type parameters:
For a single search, use sequential_search() instead. For searches on an already sorted array, use binary_search().
| [in,out] | a | array to search for; is partially modified after the search. |
| [in] | x | element to search for. |
| [in] | l | lower index of the start of the search. |
| [in] | r | top index of search term. |
| cmp | Comparison functor defining "less than" relationship. |
Definition at line 2735 of file tpl_sort_utils.H.
References cmp(), l, Not_Found, and r.
Referenced by main().
Select the i-th smallest element in an Array.
| a | The array. |
| i | Position to select. |
| cmp | Comparison functor. |
| out_of_range | if index is invalid. |
Definition at line 3268 of file tpl_sort_utils.H.
References ah_out_of_range_error_if, cmp(), and Aleph::Array< T >::size().
Random selection of the ith element from a list based on Dlink.
random_select(list,i) returns the ith smallest element content in the list.
The routine uses the quicksort partition to search for position i in time \(O(n \; \lg n)\), which It is a substantially better time than the search sequential ( \(O(n^2)\)).
The method uses two type parameters:
| [in,out] | list | list where the ith element will be searched. The list is left semi-ordered through successive partitions that have been made. |
| [in] | i | position to be accessed. |
| cmp | comparison object. |
Definition at line 3439 of file tpl_sort_utils.H.
References cmp().
Select the i-th smallest element in a DynArray.
| a | The dynamic array. |
| i | Position to select. |
| cmp | Comparison functor. |
| out_of_range | if index is invalid. |
Definition at line 3249 of file tpl_sort_utils.H.
References ah_out_of_range_error_if, cmp(), and Aleph::DynArray< T >::size().
Referenced by main().
Random selection of the ith element from a dynamic list.
random_select(list,i) returns the ith smallest element content in the dynamic list.
The routine uses the quicksort partition to search for position i in time \(O(n \; \lg n)\), which It is a substantially better time than the search sequential ( \(O(n^2)\)).
The method uses two type parameters:
| [in,out] | list | dynamic list where the ith element. The list is semi-sorted through of the successive partitions that have been made. |
| [in] | i | position to be accessed. |
| cmp | comparison object. |
Definition at line 3470 of file tpl_sort_utils.H.
References cmp().
Select the k-th smallest element in an array (convenience overload).
| a | Pointer to the array. |
| i | Position to select. |
| n | Number of elements. |
| cmp | Comparison functor. |
Definition at line 3337 of file tpl_sort_utils.H.
References cmp().
| const T & Aleph::random_select | ( | T * | a, |
| const long | i, | ||
| const long | n, | ||
| const Compare & | cmp = Compare() |
||
| ) |
Select the k-th smallest element in an array (Quickselect).
Finds the k-th smallest element without fully sorting the array. This is a selection algorithm based on quicksort's partition scheme.
random_select(a, n/2, n)| T | Element type (must be swappable and comparable). |
| Compare | Comparison functor type (default: Aleph::less<T>). |
| [in,out] | a | Array to search (will be partially reordered). |
| [in] | i | Position to select (0-indexed, so 0 = minimum). |
| [in] | n | Number of elements in the array. |
| cmp | Comparison functor. |
| out_of_range | if i >= n. |
Definition at line 3320 of file tpl_sort_utils.H.
References ah_invalid_argument_if, ah_out_of_range_error_if, and, and cmp().
| Container< T > Aleph::range | ( | const T | n | ) |
Return a range 0, 1, ... n - 1.
| [in] | n | size of range. |
Definition at line 398 of file ahFunctional.H.
|
inline |
Generate a range of values [start, end] with a given step.
| start | Start value (inclusive). |
| end | End value (inclusive). |
| step | Increment between values. |
Definition at line 296 of file ahFunctional.H.
Referenced by Aleph::Hungarian_Assignment< Cost_Type >::Hungarian_Assignment(), Aleph::Hungarian_Assignment< Cost_Type >::Hungarian_Assignment(), bucket_sort(), demo_practical(), demo_ranges(), histogram(), main(), Aleph::Simplex< T >::print_sensitivity_analysis(), Aleph::Gen_HLD_Path_Query< GT, T, Op, SA >::query_subtree_id(), scenario_3(), Aleph::Hungarian_Assignment< Cost_Type >::solve(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TYPED_TEST(), and Moved_From_Case< Heavy_Light_Decomposition< Graph > >::use().
|
inline |
Convert an iterator range to a DynList.
| Iterator | Iterator type (must be dereferenceable). |
| begin | Start iterator. |
| end | End iterator. |
Definition at line 137 of file ah-stl-utils.H.
References Aleph::DynList< T >::append().
Referenced by demo_range_conversions(), TEST(), TEST(), TEST(), and TEST().
Computes the rank of each element in an Array.
The rank of an element is its position in the sorted order. For n elements, ranks range from 0 (smallest) to n-1 (largest).
| T | Element type (must be comparable with operator<) |
| array | The array to compute ranks for |
Definition at line 696 of file ahSort.H.
Referenced by demo_bfs_topological_sort(), generate_dot_file(), rank_graphviz(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TYPED_TEST(), and TYPED_TEST().
Computes the rank of each element in a DynArray.
The rank of an element is its position in the sorted order. For n elements, ranks range from 0 (smallest) to n-1 (largest).
| T | Element type (must be comparable with operator<) |
| array | The array to compute ranks for |
Computes the rank of each element in a DynDlist.
| T | Element type |
| l | The list to compute ranks for |
Definition at line 733 of file ahSort.H.
References l.
Computes the rank of each element in a DynList.
| T | Element type |
| l | The list to compute ranks for |
Definition at line 719 of file ahSort.H.
References l.
|
inline |
Definition at line 711 of file tikzgeom_algorithms.H.
References Aleph::Point::get_x(), Aleph::Point::get_y(), and square_root().
Referenced by put_voronoi_result().
|
inline |
Read a single character from an input stream with position tracking.
Reads one character from the stream and updates the current line and column tracking. Handles newline characters by incrementing the line number and resetting the column.
| input_stream | The input file stream to read from |
| std::out_of_range | if the stream is already at EOF before reading |
Definition at line 282 of file parse_utils.H.
References ah_out_of_range_error_if, current_col_number, current_line_number, and read_char_from_stream().
Referenced by expect(), expect_char(), get_token(), load_binary_number(), load_char_literal(), load_deway_number(), load_double(), load_escaped_string(), load_hex_number(), load_identifier(), load_number(), load_octal_number(), load_string(), read_char_from_stream(), skip_white_spaces(), skip_whitespace_and_comments(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and try_char().
|
inlinestaticnoexcept |
Definition at line 129 of file hash-fct.C.
Referenced by MurmurHash3_x86_128(), MurmurHash3_x86_32(), wyhash_hash(), and xxhash64_hash().
|
inlinestaticnoexcept |
Definition at line 137 of file hash-fct.C.
Referenced by MurmurHash3_x64_128(), siphash24_hash(), wyhash_hash(), and xxhash64_hash().
Black height of a ranked red-black subtree, checking all its nodes.
In one traversal, checks every node of the subtree rooted at p: its counter is the size of its subtree, its color is RED or BLACK, a red node has no red child, and every path from p down to Node::NullPtr crosses the same number of black nodes.
| p | root of subtree |
Definition at line 127 of file rbNodeRk.H.
References and, BLACK, COLOR, LLINK, RED, red_black_height_rk(), and RLINK.
Referenced by is_red_black_tree_rk(), and red_black_height_rk().
| Net::Flow_Type Aleph::reduced_cost | ( | const Net & | net, |
| typename Net::Arc * | arc, | ||
| bool | forward | ||
| ) |
Compute reduced cost of an arc.
The reduced cost is: c(u,v) + π(u) - π(v) where c is the original cost and π are the node potentials.
For SSP algorithm, potentials are shortest path distances from source. This formula guarantees non-negative reduced costs when potentials are optimal.
Definition at line 134 of file tpl_mincost.H.
References GraphCommon< GT, Node, Arc >::get_src_node(), and GraphCommon< GT, Node, Arc >::get_tgt_node().
Referenced by Aleph::Network_Simplex< Net >::build_spanning_tree(), Aleph::Network_Simplex< Net >::find_entering_arc(), Aleph::Simplex< T >::get_all_reduced_costs(), Aleph::Network_Simplex< Net >::print_diagnostics(), Aleph::Simplex< T >::print_sensitivity_analysis(), and Aleph::Network_Simplex< Net >::verify_tree_reduced_costs().
|
noexcept |
Return the remaining flow of a as seen from src.
If a is residual with respect to src, the remaining flow is the current flow. Otherwise, it is the residual capacity.
Definition at line 283 of file tpl_net.H.
Referenced by decompose_flow().
|
inline |
Remove elements equal to a value.
Removes all elements in [first, last) equal to value by moving the remaining elements forward.
| Fw_Itor | Forward iterator type. |
| T | Value type. |
| __first | Iterator to the first element. |
| __last | Iterator past the last element. |
| __value | Value to remove. |
Definition at line 962 of file ahAlgo.H.
References bind2nd(), and remove_if().
Referenced by ParseUtilsTest::TearDown(), TEST(), TEST(), and TYPED_TEST().
|
inlinenoexcept |
See remove_by_key_xt().
Definition at line 977 of file tpl_binNodeXt.H.
References cmp(), remove_by_key_xt(), and root().
|
inline |
Copy elements not satisfying a predicate.
Copies elements from [first, last) to result, excluding those for which pred returns true.
| In_Itor | Input iterator type. |
| Out_Itor | Output iterator type. |
| Predicate | Predicate type. |
| __first | Iterator to the first source element. |
| __last | Iterator past the last source element. |
| __result | Iterator to the first destination position. |
| __pred | Unary predicate to test elements. |
Definition at line 905 of file ahAlgo.H.
Referenced by remove_if(), and TEST().
|
inlinestatic |
Remove a node from the active queue and clear its queue mark.
Definition at line 2411 of file tpl_net.H.
References Maximum_Flow, and NODE_BITS.
|
inline |
Remove multiple items from a container.
Definition at line 1987 of file ahFunctional.H.
References remove_from_container().
Referenced by remove_from_container(), and TEST().
|
inline |
Remove elements satisfying a predicate.
Removes all elements in [first, last) for which pred returns true by moving the remaining elements forward.
| Fw_Itor | Forward iterator type. |
| Predicate | Predicate type. |
| __first | Iterator to the first element. |
| __last | Iterator past the last element. |
| __pred | Unary predicate to test elements. |
Definition at line 934 of file ahAlgo.H.
References find_if(), and remove_copy_if().
|
inline |
Remove prefix from str if present.
| [in,out] | str | String to modify. |
| [in] | prefix | Prefix to remove. |
str. Definition at line 614 of file ah-string-utils.H.
References is_prefix(), and prefix().
Referenced by TEST().
|
inline |
Remove all whitespace characters from a std::string.
Whitespace is defined by std::isspace in the current C locale.
| [in] | str | Input std::string. |
str with whitespace removed. Definition at line 404 of file ah-string-utils.H.
Referenced by demo_filtering(), and TEST().
|
inline |
Remove any character appearing in symbols.
| [in] | str | Input std::string. |
| [in] | symbols | Set of characters to remove. |
str without any character present in symbols. Definition at line 421 of file ah-string-utils.H.
Referenced by demo_filtering(), and TEST().
Create a sequence of repeated items.
| [in] | n | number of items. |
| [in] | item | the value to be repeated. |
Definition at line 415 of file ahFunctional.H.
References Aleph::DynList< T >::append().
Referenced by demo_ranges(), main(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST_F().
Overload of rep.
Definition at line 425 of file ahFunctional.H.
|
inline |
Return elements that appear more than once in the container.
Definition at line 1091 of file tpl_dynSetHash.H.
References Aleph::DynList< T >::append(), and Aleph::DynHashTable< Key, HashTable, Cmp >::insert().
Referenced by main(), Aleph::FFT< Real >::polynomial_roots_impl(), TEST(), TEST(), TEST(), and TYPED_TEST().
|
inline |
Return repeated elements paired with their occurrence count.
Definition at line 1108 of file tpl_dynSetHash.H.
References Aleph::DynList< T >::append(), and Aleph::DynHashTable< Key, HashTable, Cmp >::insert().
Referenced by TEST().
|
inline |
Replace elements equal to a value.
Replaces all elements in [beg, end) equal to old_value with new_value.
| Itor | Iterator type. |
| T | Value type. |
| beg | Iterator to the first element. |
| end | Iterator past the last element. |
| old_value | Value to be replaced. |
| new_value | Replacement value. |
Definition at line 815 of file ahAlgo.H.
References bind2nd(), and replace_if().
Referenced by Aleph::PersistentHashMap< Key, T, Cmp >::insert_impl(), and TEST().
|
inline |
Copy and replace elements equal to a value.
Copies elements from source to destination, replacing those equal to old_value with new_value.
| Itor1 | Source iterator type. |
| Itor2 | Destination iterator type. |
| T | Value type. |
| sourceBeg | Iterator to the first source element. |
| sourceEnd | Iterator past the last source element. |
| destBeg | Iterator to the first destination position. |
| old_value | Value to be replaced. |
| new_value | Replacement value. |
Definition at line 878 of file ahAlgo.H.
References bind2nd(), and replace_copy_if().
|
inline |
Copy and replace elements satisfying a predicate.
Copies elements from source to destination, replacing those for which op returns true with the specified value.
| Itor1 | Source iterator type. |
| Itor2 | Destination iterator type. |
| UnaryPredicate | Predicate type. |
| T | Value type. |
| sourceBeg | Iterator to the first source element. |
| sourceEnd | Iterator past the last source element. |
| destBeg | Iterator to the first destination position. |
| op | Unary predicate to test elements. |
| value | Replacement value. |
Definition at line 842 of file ahAlgo.H.
References value.
Referenced by replace_copy(), and TEST().
|
inline |
Replace elements satisfying a predicate.
Replaces all elements in [beg, end) for which op returns true with the specified value.
| Itor | Iterator type. |
| UnaryPredicate | Predicate type. |
| T | Value type. |
| beg | Iterator to the first element. |
| end | Iterator past the last element. |
| op | Unary predicate to test elements. |
| value | Replacement value. |
Definition at line 788 of file ahAlgo.H.
References value.
|
inline |
Definition at line 280 of file state_search_common.H.
References Aleph::SearchLimits::max_depth, Aleph::Array< T >::reserve(), and Search_Unlimited.
Referenced by Aleph::Depth_First_Backtracking< Domain >::search(), Aleph::IDA_Star_State_Search< Domain >::search(), Aleph::Branch_And_Bound< Domain, ObjectivePolicy >::search(), Aleph::Depth_First_Backtracking< Domain >::search(), Aleph::Branch_And_Bound< Domain, ObjectivePolicy >::search_best_first(), and Aleph::Branch_And_Bound< Domain, ObjectivePolicy >::search_depth_first().
|
inline |
Convenience function to sample k elements from a range.
| Itor | Input iterator type. |
| Sent | Sentinel type for Itor. |
| [in] | beg | Start of the range. |
| [in] | end | End of the range. |
| [in] | k | Number of elements to sample. |
| [in] | seed | Random seed. |
| std::bad_alloc | if there is not enough memory. |
| std::overflow_error | if stream length exceeds safe limits. |
Definition at line 287 of file reservoir-sampling.H.
References Aleph::Reservoir_Sampler< T >::get_sample(), k, seed, and Aleph::Reservoir_Sampler< T >::update().
|
inline |
Reset the parsing state to initial values.
Resets line/column counters and clears the token instance. Call this before parsing a new file.
Definition at line 582 of file parse_utils.H.
References current_col_number, current_line_number, previous_col_number, previous_line_number, and token_instance.
Referenced by ParseUtilsTest::SetUp(), TEST(), TEST(), and TEST().
| void Aleph::residual_to_net | ( | const DynMapTree< void *, void * > & | arcs | ) |
Transfer flow values from residual network back to original.
Updates the original network's flow values based on the residual network's flow values after cycle canceling.
| Net | Original network type. |
| [in] | arcs | Mapping from original arcs to residual arcs. |
Definition at line 773 of file tpl_netcost.H.
References arcs.
|
extern |
| void Aleph::restore_flow_solution | ( | Net & | net, |
| const DynMapTree< typename Net::Arc *, typename Net::Flow_Type > & | solution | ||
| ) |
Restore network simplex solution from warm start.
Restores previously saved flow values. Useful when solving similar problems (e.g., after small modifications).
| Net | Network type. |
| net | Network to restore solution to. |
| solution | Previously saved solution. |
Definition at line 1173 of file tpl_mincost.H.
References Aleph::DynMapTree< Key, Data, Tree, Compare >::has(), and Aleph::Filter_Iterator< Container, It, Show_Item >::next_ne().
|
inline |
Restore a previously marked position.
Seeks the stream back to a saved position and restores the line/column tracking state.
| input_stream | The input file stream |
| pos | Position previously returned by mark_position() |
Definition at line 780 of file parse_utils.H.
References Aleph::StreamPosition::column, current_col_number, current_line_number, Aleph::StreamPosition::line, Aleph::StreamPosition::pos, and restore_position().
Referenced by restore_position(), TEST_F(), and try_char().
|
inline |
Return a reversed copy of the container.
Creates a new container with elements in reverse order. The original container is not modified.
| l | Source container. |
Definition at line 1527 of file ahFunctional.H.
References FunctionalMethods< Container, T >::for_each(), and l.
|
inline |
Reverse elements in a range.
Reverses the order of elements in the range [beg, end).
| Itor | Bidirectional iterator type. |
| beg | Iterator to the first element. |
| end | Iterator past the last element. |
Definition at line 1094 of file ahAlgo.H.
References and.
Referenced by demo_folding(), demo_transformation(), main(), rotate(), rotate_left(), rotate_right(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), and TEST_F().
Reverse an array in-place.
Swaps elements symmetrically around the center.
| T | Element type |
| ptr | Pointer to array |
| n | Number of elements |
Definition at line 155 of file array_utils.H.
|
inline |
Copy elements in reverse order.
Copies elements from [sourceBeg, sourceEnd) to destBeg in reverse order.
| Itor1 | Source iterator type. |
| Itor2 | Destination iterator type. |
| sourceBeg | Iterator to the first source element. |
| sourceEnd | Iterator past the last source element. |
| destBeg | Iterator to the first destination position. |
Definition at line 1114 of file ahAlgo.H.
Referenced by TEST().
Definition at line 492 of file tpl_binNode.H.
|
inlinenoexcept |
Definition at line 669 of file hash-fct.H.
References h.
|
inlinenoexcept |
Definition at line 558 of file hash-fct.H.
References rot_hash().
|
inlinenoexcept |
Definition at line 796 of file hash-fct.H.
References rot_hash().
|
inline |
Rotate elements in a range.
Rotates the elements in [beg, end) such that pos becomes the first element.
| Itor | Forward iterator type. |
| beg | Iterator to the first element. |
| pos | Iterator to the new first element. |
| end | Iterator past the last element. |
Definition at line 1138 of file ahAlgo.H.
References reverse().
Referenced by TEST().
|
inline |
Copy and rotate elements.
Copies elements from [beg, end) to tgt_beg, rotating so that pos becomes the first element.
| Itor1 | Source iterator type. |
| Itor2 | Destination iterator type. |
| beg | Iterator to the first source element. |
| pos | Iterator to the new first element. |
| end | Iterator past the last source element. |
| tgt_beg | Iterator to the first destination position. |
Definition at line 1161 of file ahAlgo.H.
References copy().
Rotate array elements left by m positions.
Uses the three-reversal algorithm for O(n) time and O(1) space.
| T | Element type |
| ptr | Pointer to array |
| n | Number of elements |
| m | Number of positions to rotate (wrapped if > n) |
Definition at line 180 of file array_utils.H.
Rotate array elements right by m positions.
Uses the three-reversal algorithm for O(n) time and O(1) space.
| T | Element type |
| ptr | Pointer to array |
| n | Number of elements |
| m | Number of positions to rotate (wrapped if > n) |
Definition at line 213 of file array_utils.H.
|
inlinestatic |
Definition at line 70 of file hash-fct.C.
References r.
|
inlinestatic |
Definition at line 75 of file hash-fct.C.
References r.
|
inline |
Remove trailing whitespace from a std::string in-place.
Whitespace is defined by std::isspace in the current C locale.
| [in,out] | s | String to modify. |
Definition at line 140 of file ah-string-utils.H.
Referenced by demo_trimming(), trim(), and trim_in_place().
|
inline |
|
inline |
|
inline |
Convert a std::string to double and throw on parse errors.
| [in] | s | Input std::string. |
double value. | std::runtime_error | If s does not contain a valid double. |
Definition at line 582 of file ah-string-utils.H.
References ah_runtime_error_if, and and.
Referenced by TEST().
|
inline |
Convert a std::string to long and throw on parse errors.
| [in] | s | Input std::string. |
long value. | std::runtime_error | If s does not contain a valid long. |
Definition at line 564 of file ah-string-utils.H.
References ah_runtime_error_if, and and.
| DynMapTree< typename Net::Arc *, typename Net::Flow_Type > Aleph::save_flow_solution | ( | const Net & | net | ) |
Save network simplex solution for warm start.
Saves the current flow values so they can be restored later when solving a modified problem.
| Net | Network type. |
| net | Network with solution. |
Definition at line 1148 of file tpl_mincost.H.
References Aleph::Filter_Iterator< Container, It, Show_Item >::next_ne().
|
inlinenoexcept |
Definition at line 691 of file hash-fct.H.
References h.
|
inlinenoexcept |
Definition at line 572 of file hash-fct.H.
References sax_hash().
|
inlinenoexcept |
Definition at line 806 of file hash-fct.H.
References sax_hash().
|
inline |
Scalar triple product: a · (b × c).
Definition at line 3291 of file point.H.
References Aleph::Point3D::cross(), and Aleph::Point3D::dot().
Referenced by Aleph::Tetrahedron::contains(), Aleph::Tetrahedron::signed_volume_x6(), and TEST_F().
|
inline |
Prefix scan with custom operation.
Computes running accumulation: [init, op(init, x1), op(op(init, x1), x2), ...]
| container | Source container. |
| init | Initial accumulator value. |
| op | Binary operation. |
Definition at line 2519 of file ahFunctional.H.
References Aleph::DynList< T >::append(), and init.
Compute running sums (scanl with addition).
Returns a list of partial sums including init.
| container | Source container. |
| init | Starting value. |
Definition at line 2494 of file ahFunctional.H.
References Aleph::DynList< T >::append(), and init.
| Aleph::Scope_Guard | ( | const GT & | , |
| Cleanup | |||
| ) | -> Scope_Guard< GT, Cleanup > |
Deduction guide for Scope_Guard.
|
inline |
Search for a subrange within a range.
Searches for the first occurrence of the subrange [searchBeg, searchEnd) within the range [beg, end).
| Itor1 | Main range iterator type. |
| Itor2 | Subrange iterator type. |
| BinaryPredicate | Comparison predicate. |
| beg | Iterator to the first element of the main range. |
| end | Iterator past the last element of the main range. |
| searchBeg | Iterator to the first element of the subrange. |
| searchEnd | Iterator past the last element of the subrange. |
| op | Binary predicate for comparison (defaults to equality). |
Definition at line 309 of file ahAlgo.H.
Referenced by Aleph::planarity_detail::LR_Planarity_Checker< GT, SA >::build_combinatorial_embedding_bruteforce(), find_end(), Aleph::net_detail::return_dust(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), and TYPED_TEST().
|
inlinenoexcept |
Definition at line 107 of file state_search_common.H.
Referenced by Aleph::Depth_First_Backtracking< Domain >::search(), Aleph::Branch_And_Bound< Domain, ObjectivePolicy >::search(), Aleph::IDA_Star_State_Search< Domain >::search(), Aleph::Branch_And_Bound< Domain, ObjectivePolicy >::search(), Aleph::Depth_First_Backtracking< Domain >::search(), Aleph::Negamax< Domain >::search_impl(), and Aleph::Alpha_Beta< Domain >::search_impl().
|
inline |
Definition at line 423 of file tpl_sort_utils.H.
References cmp().
|
inline |
Generic search in a dynamic array of an extreme element.
search_extreme(a, l, r) searches the array sequentially a between the indices l and r, the extreme, minimum or element maximum according to the comparison criterion Compare.
| [in] | a | the dynamic array in which to perform the search. |
| [in] | l | starting index of the search. |
| [in] | r | search term index. |
| cmp | comparison object. |
Definition at line 4170 of file tpl_sort_utils.H.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 834 of file tpl_sort_utils.H.
References cmp(), and Aleph::Dnode< T >::get_data().
|
inline |
Iterator positioned at the first element, used as the initial extreme.
Definition at line 403 of file tpl_sort_utils.H.
References cmp(), Aleph::Const_Iterator< It >::get_curr(), Aleph::Const_Iterator< It >::has_curr(), Aleph::HTList::is_empty(), and Aleph::Const_Iterator< It >::next_ne().
|
inline |
Find the extreme (minimum or maximum) element in a linked list.
Performs a linear scan through the list to find the element that compares as "smallest" according to the provided comparator. By changing the comparator, you can find either minimum or maximum.
Time complexity: O(n), where n is the number of nodes in the list.
| Link | Link node type (e.g., Dlink, Slinknc). |
| Compare | Comparison functor that compares Link pointers. |
| list | The list header to search. |
| cmp | Comparator: cmp(p1, p2) returns true if p1 is "more extreme". |
list is only read, but the generic Iterator interface requires a non-const list; the const_cast is safe since nothing mutates through it.
Definition at line 385 of file tpl_sort_utils.H.
References cmp().
Referenced by main().
|
inline |
Definition at line 429 of file tpl_sort_utils.H.
References cmp().
Search for an extreme element in a DynDlist.
Performs a linear scan to find the minimum or maximum element according to the comparison criterion Compare.
| [in] | list | the list to search on. |
| cmp | comparison object. |
Definition at line 824 of file tpl_sort_utils.H.
References cmp(), and Aleph::Dnode< T >::get_data().
Search for an extreme element in a DynList.
| list | The list header. |
| cmp | Comparison functor. |
Definition at line 848 of file tpl_sort_utils.H.
References cmp(), Aleph::DynList< T >::Iterator::get_curr_ne(), Aleph::HTList::Iterator::has_curr(), Aleph::HTList::is_empty(), and Aleph::HTList::Iterator::next_ne().
|
inline |
Generic search in an array of an extreme element.
search_extreme(a, l, r) searches the array sequentially a, between the indices l and r, the extreme, minimum or element maximum according to the comparison criterion Compare.
| [in] | a | the array on which to search. |
| [in] | l | starting index of the search. |
| [in] | r | search term index. |
| cmp | comparison object. |
Definition at line 770 of file tpl_sort_utils.H.
|
inline |
Search an arc of g into p that satisfies op; on a digraph, in \(O(E)\).
| [in] | g | the graph of p |
| [in] | p | node pointer |
| [in] | op | operation for testing on each arc |
op, or nullptr Definition at line 3147 of file tpl_graph.H.
References traverse_in_arcs().
|
inline |
Search an incoming arc to a node satisfying a condition op.
op must have the following signature:
bool op(Arc * arc)
It does not compile on a digraph type: use search_in_arc(g, p, op).
| [in] | p | node pointer |
| [in] | op | operation for testing on each arc |
nullptr otherwise Definition at line 3119 of file tpl_graph.H.
Referenced by TYPED_TEST().
| std::pair< bool, size_t > Aleph::search_inversion | ( | const Container< T > & | cont, |
| const Compare & | cmp = Compare() |
||
| ) |
Find the first inversion in a container.
Searches for the first position where an element is less than its predecessor, indicating that the container is not sorted at that point.
Time complexity: O(n), where n is the container size.
| Container | Template container type. |
| T | Element type stored in the container. |
| Compare | Comparison functor type (default: Aleph::less<T>). |
| cont | The container to check. |
| cmp | Comparison functor defining "less than" relationship. |
first is true if the container is sorted, false otherwise.second is the index of the inversion (if found), or the container size (if sorted).Definition at line 206 of file tpl_sort_utils.H.
References cmp(), Aleph::Const_Iterator< It >::get_curr(), Aleph::Const_Iterator< It >::has_curr(), and Aleph::Const_Iterator< It >::next_ne().
|
inline |
Returns the maximum element of the array a between l and r.
Definition at line 4187 of file tpl_sort_utils.H.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 897 of file tpl_sort_utils.H.
References cmp().
Search for the maximum element in a DynDlist.
| list | The list header. |
| cmp | Comparison functor. |
Definition at line 890 of file tpl_sort_utils.H.
References cmp().
|
inline |
Returns the maximum element of the array a between l and r.
Definition at line 795 of file tpl_sort_utils.H.
Referenced by main(), and set_picture_size().
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 879 of file tpl_sort_utils.H.
References cmp().
Search for the minimum element in a DynDlist.
| list | The list header. |
| cmp | Comparison functor. |
Definition at line 872 of file tpl_sort_utils.H.
References cmp().
|
inline |
Returns the smallest element of the array a between l and r.
Definition at line 785 of file tpl_sort_utils.H.
|
inline |
Find n consecutive elements equal to a value.
Searches for the first occurrence of count consecutive elements equal to value in the range [beg, end).
| Itor | Iterator type. |
| Size | Integer type for count. |
| T | Value type. |
| BinaryPredicate | Comparison predicate. |
| beg | Iterator to the first element. |
| end | Iterator past the last element. |
| count | Number of consecutive elements to find. |
| value | Value to compare against. |
| op | Binary predicate for comparison (defaults to equality). |
Definition at line 255 of file ahAlgo.H.
|
staticnoexcept |
Definition at line 134 of file generate_graph.H.
References nodes, search_node(), and sequential_search().
Referenced by search_node().
|
inlinenoexcept |
See search_or_insert_by_key_xt(Node *& r, Node * p, Compare & cmp).
Definition at line 529 of file tpl_binNodeXt.H.
References cmp(), r, and search_or_insert_by_key_xt().
|
inlinenoexcept |
Search or insert a node in an extended binary search tree.
search_or_insert_by_key_xt(r, p, cmp) searches in the extended tree with root r the key contained in node p. If the key is found, the function returns the node containing the key; otherwise p is inserted in the tree and this pointer is returned.
| r | root of tree (reference to pointer, may be modified) |
| p | pointer to node to search or insert |
| cmp | comparison functor for key ordering |
p is inserted, then this is returned; otherwise the pointer to the node containing the key is returned Definition at line 500 of file tpl_binNodeXt.H.
References cmp(), COUNT(), KEY, LLINK, r, RLINK, and search_or_insert_by_key_xt().
Referenced by search_or_insert_by_key_xt(), search_or_insert_by_key_xt(), and TEST().
|
inlinenoexcept |
See search_or_insert_root_rec_xt().
Definition at line 1137 of file tpl_binNodeXt.H.
|
inlinenoexcept |
Search or insert a key in an extended binary search tree.
| [in] | root | of the tree |
| [in] | p | pointer to the node whose key must be searched and eventually, if not found, be inserted |
| [in] | cmp | comparison criteria |
Definition at line 1098 of file tpl_binNodeXt.H.
References cmp(), COUNT(), KEY, LLINK, RLINK, root(), rotate_to_left_xt(), and rotate_to_right_xt().
|
inline |
Search an outcoming arc to a node satisfying a condition op.
op must have the following signature:
bool op(Arc * arc)
| [in] | p | node pointer |
| [in] | op | operation for testing on each arc |
nullptr otherwise Definition at line 3444 of file tpl_graph.H.
|
noexcept |
Helper to find the spanning tree arc between two nodes in a multigraph.
When there are parallel arcs between two nodes, this function searches for the arc that is marked as part of the spanning tree.
| [in] | g | The graph |
| [in] | src | Source node |
| [in] | tgt | Target node |
| [in] | sa | Arc filter (default: Dft_Show_Arc<GT>) |
| anything | that sa throws |
Definition at line 2468 of file tpl_graph_utils.H.
References and, IS_ARC_VISITED, GraphCommon< GT, Node, Arc >::is_digraph(), Aleph::Filter_Iterator< Container, It, Show_Item >::next_ne(), GTNodeCommon< NodeInfo >::num_arcs, and Spanning_Tree.
Referenced by TEST().
| SegmentationResult Aleph::segment_image | ( | size_t | rows, |
| size_t | cols, | ||
| const std::vector< std::vector< std::array< Value_Type, 2 > > > & | data_cost, | ||
| Value_Type | smoothness | ||
| ) |
Segment image using graph cuts.
Solves the binary labeling problem for image segmentation:
The energy to minimize is: E(L) = Σ D_p(L_p) + Σ V_{p,q}(L_p, L_q)
where D is data cost and V is smoothness cost.
| Value_Type | Cost type. |
| rows | Image height. |
| cols | Image width. |
| data_cost | data_cost[i][j][k] = cost of pixel (i,j) having label k. |
| smoothness | Cost of adjacent pixels having different labels. |
Definition at line 735 of file net_apps.H.
References cols, Aleph::DynSetTree< Key, Tree, Compare >::contains(), dinic_maximum_flow(), Aleph::SegmentationResult::energy, Aleph::DynListQueue< T >::front(), Aleph::DynListQueue< T >::get(), GraphCommon< GT, Node, Arc >::get_connected_node(), GraphCommon< GT, Node, Arc >::get_src_node(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::has_curr(), Aleph::DynSetTree< Key, Tree, Compare >::insert(), Aleph::Net_Graph< NodeT, ArcT >::insert_arc(), Aleph::Net_Graph< NodeT, ArcT >::insert_node(), Aleph::DynListQueue< T >::is_empty(), Aleph::SegmentationResult::labels, Aleph::Net_Graph< NodeT, ArcT >::make_super_sink(), Aleph::Net_Graph< NodeT, ArcT >::make_super_source(), min_cut(), Aleph::DynListQueue< T >::put(), and rows.
Referenced by demo_image_segmentation(), TEST(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
Compute the exact intersection point of segments s1 and s2.
| std::domain_error | if segments do not intersect. |
| std::domain_error | if the intersection set is not a unique point. |
Definition at line 2982 of file point.H.
References ah_domain_error_if, and, Aleph::Segment::get_src_point(), Aleph::Segment::get_tgt_point(), Aleph::Segment::intersection_with(), Aleph::Segment::is_parallel_with(), on_segment(), and segments_intersect().
Referenced by Aleph::ConstrainedDelaunayTriangulation::merge_and_deduplicate(), scenario_exact_intersection(), scenario_road_network(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Convenience free-function wrapper for SegmentSegmentIntersection.
Definition at line 5258 of file geom_algorithms.H.
Referenced by Aleph::SweepLineSegmentIntersection::check_and_enqueue(), main(), and TEST_F().
|
inline |
Return true if segments (a,b) and (c,d) intersect (including endpoints).
Definition at line 2973 of file point.H.
References Aleph::Segment::intersects_with().
Return true if segments s1 and s2 intersect (including endpoints).
Definition at line 2967 of file point.H.
References Aleph::Segment::intersects_with().
Referenced by intersectp(), Aleph::SegmentSegmentIntersection::operator()(), scenario_intersection_detection(), scenario_road_network(), segment_intersection_point(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Iterative selection of a node according to inorder psoition and determination of parent of selected node.
@param[in] root root of tree @param[in] pos position inorder whose node wants to be located @param[out] parent of selected node @return a pointer to the node at the inorder position pos @throw out_of_range if pos is greater or equal than the number of nodes. @see select_rec() @ingroup Trees
Definition at line 189 of file tpl_binNodeXt.H.
References ah_out_of_range_error_if, and, COUNT(), LLINK, RLINK, and root().
|
inlinenoexcept |
Select a pivot for partitioning using median-of-three.
| a | Pointer to the array. |
| l | Left index. |
| r | Right index. |
| cmp | Comparison functor. |
Median-of-three: sort a[l], a[m], a[r] in place, then use the middle value's index as the pivot.
Second comparison of the median-of-three ordering pass.
Third comparison of the median-of-three ordering pass.
Median-of-three: sort a[l], a[m], a[r] in place, then use the middle value's index as the pivot.
Second comparison of the median-of-three ordering pass.
Third comparison of the median-of-three ordering pass.
Definition at line 1774 of file tpl_sort_utils.H.
References cmp(), l, m, and r.
Referenced by TEST().
|
inline |
Selects a pivot element as the median between the ends and the center.
Definition at line 3055 of file tpl_sort_utils.H.
|
inline |
Selects a pivot element as the median between the ends and the center.
Definition at line 3043 of file tpl_sort_utils.H.
|
inline |
|
inline |
Selection sort for doubly-linked lists (Dlink).
Sorts the list by repeatedly finding the extreme element and appending it to a temporary auxiliary list.
| Compare | Comparison functor. |
| [in,out] | list | The list to sort. |
| [in] | cmp | Comparison functor. |
Definition at line 444 of file tpl_sort_utils.H.
References Aleph::Dlink::append(), cmp(), Aleph::Dlink::del(), Aleph::Dlink::is_empty(), and Aleph::Dlink::swap().
Selection sort for Dnode-based doubly-linked lists.
| T | Element type. |
| Compare | Comparison functor. |
| [in,out] | list | The list to sort. |
| [in] | cmp | Comparison functor. |
Definition at line 530 of file tpl_sort_utils.H.
References cmp().
Sorts a dynamic array by the selection method.
selection_sort(a) uses the selection method to sort the dynamic array of n elements.
The selection method has a performance of \(O(n^2)\). Due to its simplicity of implementation, its constant cost is low, so it is a good method for arrangements of very small dimension.
The method uses two type parameters:
| cmp | comparison object. | |
| [in,out] | a | the array to sort. |
Definition at line 3499 of file tpl_sort_utils.H.
References cmp(), min(), and Aleph::DynArray< T >::size().
|
inlinenoexcept |
Sort an array using the selection sort algorithm.
Selection sort works by repeatedly finding the minimum element from the unsorted portion and placing it at the beginning. It has O(n²) time complexity but minimal memory overhead and a simple implementation.
| T | Element type (must be swappable and comparable). |
| Compare | Comparison functor type (default: Aleph::less<T>). |
| [in,out] | a | Pointer to the array to sort. |
| [in] | n | Number of elements in the array. |
| cmp | Comparison functor; cmp(x, y) returns true if x < y. |
Definition at line 345 of file tpl_sort_utils.H.
Referenced by benchmark_array_algorithms(), and TEST().
| std::pair< DynList< DynList< T > >, size_t > Aleph::sequential_groups | ( | const Container< T > & | c, |
| Equal && | eq = Equal() |
||
| ) |
Overload of sequential_groups.
Definition at line 1641 of file ahFunctional.H.
References eq(), and sequential_groups().
| std::pair< DynList< DynList< T > >, size_t > Aleph::sequential_groups | ( | const Container< T > & | c, |
| Equal & | eq | ||
| ) |
Group consecutive equal elements together.
Partitions a container into groups of consecutive elements that are equal according to the given equality predicate. Each group is a DynList containing all consecutive equal elements.
| c | Source container. |
| eq | Equality predicate for comparing elements. |
Definition at line 1606 of file ahFunctional.H.
References Aleph::DynList< T >::append(), count(), and eq().
Referenced by sequential_groups(), and TEST().
| Dlink * Aleph::sequential_search | ( | const Dlink & | list, |
| const T & | x, | ||
| Equal | eq = Equal() |
||
| ) |
Linear search for an element in a Dlink list.
| list | The list header. |
| x | The element to search for. |
| eq | Equality comparator. |
Adapt the element-equality comparator into a node-vs-node comparator.
Definition at line 625 of file tpl_sort_utils.H.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 688 of file tpl_sort_utils.H.
References eq().
|
inline |
Linear search over a list of Dnodes.
| list | The list header. |
| x | The element to search for. |
| eq | Equality comparator. |
Adapt the element-equality comparator into a node-vs-node comparator.
Definition at line 676 of file tpl_sort_utils.H.
|
inline |
Linear search for an element in a dynamic array.
Scans the dynamic array between indices l and r looking for the first occurrence of the specified element.
| T | Element type. |
| Equal | Equality comparison functor (default: Aleph::equal_to<T>). |
| a | Pointer to the dynamic array. |
| x | The element to search for. |
| l | Left index (inclusive). |
| r | Right index (inclusive). |
| eq | Equality comparator. |
Not_Found if not found. Definition at line 585 of file tpl_sort_utils.H.
References eq(), Aleph::DynArray< T >::exist(), l, Not_Found, and r.
|
inline |
Linear search on a DynDlist (const version).
| list | The list header. |
| x | The element to search for. |
| eq | Equality comparator. |
Definition at line 713 of file tpl_sort_utils.H.
References eq(), and Aleph::Dnode< T >::get_data().
|
inline |
Linear search on a DynList (const version).
| list | The list header. |
| x | The element to search for. |
| eq | Equality comparator. |
Definition at line 744 of file tpl_sort_utils.H.
References eq(), and Aleph::Const_Iterator< It >::has_curr().
| Link * Aleph::sequential_search | ( | const Link & | list, |
| const T & | x, | ||
| Equal & | eq | ||
| ) |
Linear search for an element in a linked list.
| Link | Link node type (e.g., Dlink, Slinknc). |
| T | Element type. |
| Equal | Equality comparison functor. |
| list | The list header. |
| x | The element to search for. |
| eq | Equality comparator. |
Definition at line 609 of file tpl_sort_utils.H.
References eq().
| Slinknc * Aleph::sequential_search | ( | const Slinknc & | list, |
| const T & | x, | ||
| Equal | eq = Equal() |
||
| ) |
Linear search for an element in an Slinknc list.
| list | The list header. |
| x | The element to search for. |
| eq | Equality comparator. |
Adapt the element-equality comparator into a node-vs-node comparator.
Definition at line 639 of file tpl_sort_utils.H.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 664 of file tpl_sort_utils.H.
References eq().
|
inline |
Linear search over a list of Dnodes.
| list | The list header. |
| x | The element to search for. |
| eq | Equality comparator. |
Adapt the element-equality comparator into a node-vs-node comparator.
Definition at line 653 of file tpl_sort_utils.H.
|
inline |
Linear search on a DynDlist.
| list | The list header. |
| x | The element to search for. |
| eq | Equality comparator. |
Definition at line 700 of file tpl_sort_utils.H.
References eq(), and Aleph::Dnode< T >::get_data().
|
inline |
Linear search on a DynList.
| list | The list header. |
| x | The element to search for. |
| eq | Equality comparator. |
Definition at line 726 of file tpl_sort_utils.H.
References eq(), and Aleph::HTList::Iterator::has_curr().
|
inline |
Linear search for an element in an array.
Scans the array from left to right looking for the first occurrence of the specified element.
Time complexity: O(n), where n = r - l + 1
| T | Element type. |
| Equal | Equality comparison functor (default: Aleph::equal_to<T>). |
| a | Pointer to the array. |
| x | The element to search for. |
| l | Left index (inclusive) where search begins. |
| r | Right index (inclusive) where search ends. |
| eq | Equality comparator; eq(a[i], x) returns true if equal. |
Not_Found (-1) if not found.Definition at line 557 of file tpl_sort_utils.H.
References eq(), l, Not_Found, and r.
Referenced by aleatorio(), main(), and search_node().
|
inlinestaticnoexcept |
Definition at line 103 of file Huffman.H.
Referenced by Aleph::Huffman_Encoder_Engine::insert_symbol_node(), and Aleph::Huffman_Encoder_Engine::merge_two_nodes().
|
inline |
Generate a range [start, end] and apply an operation to each value.
| T | Numeric type. |
| Container | Result container type. |
| Op | Mapping operation. |
| start | Start value (inclusive). |
| end | End value (inclusive). |
| step | Increment. |
| op | Operation to apply. |
Definition at line 345 of file ahFunctional.H.
|
inline |
Overload of set_range.
Definition at line 356 of file ahFunctional.H.
| Array< T > Aleph::set_to_Array | ( | const std::set< T, Compare, Alloc > & | s | ) |
Convert a std::set to an Array.
Creates a new Array containing copies of all elements from the given std::set. Elements are inserted in sorted order.
| T | The element type. |
| Compare | The comparison function type. |
| Alloc | The allocator type. |
| s | The source std::set. |
Definition at line 618 of file ah-convert.H.
References Aleph::Array< T >::append(), and Aleph::Array< T >::reserve().
Referenced by TEST().
| DynArray< T > Aleph::set_to_DynArray | ( | const std::set< T, Compare, Alloc > & | s | ) |
Convert a std::set to a DynArray.
Creates a new DynArray containing copies of all elements from the given std::set. Elements are inserted in sorted order.
| T | The element type. |
| Compare | The comparison function type. |
| Alloc | The allocator type. |
| s | The source std::set. |
Definition at line 641 of file ah-convert.H.
References Aleph::DynArray< T >::append().
Referenced by TEST().
| DynList< T > Aleph::set_to_DynList | ( | const std::set< T, Compare, Alloc > & | s | ) |
Convert a std::set to a DynList.
Creates a new DynList containing copies of all elements from the given std::set. Elements are inserted in sorted order.
| T | The element type. |
| Compare | The comparison function type. |
| Alloc | The allocator type. |
| s | The source std::set. |
Definition at line 596 of file ah-convert.H.
References Aleph::DynList< T >::append().
| DynSetTree< T > Aleph::set_unify | ( | const C & | c, |
| Op | op | ||
| ) |
Definition at line 2073 of file tpl_dynSetTree.H.
References Aleph::DynSetTree< Key, Tree, Compare >::insert().
| Array< Key > Aleph::sethash_to_Array | ( | const DynHashTable< Key, HashTable, Cmp > & | s | ) |
Convert a DynHashTable (hash set) to an Array.
| Key | The key type. |
| HashTable | The hash table template. |
| Cmp | The equality comparator. |
| s | The source DynHashTable. |
Definition at line 1039 of file ah-convert.H.
References Aleph::Array< T >::append(), FunctionalMethods< Container, T >::for_each(), and Aleph::Array< T >::reserve().
Referenced by TEST().
| DynArray< Key > Aleph::sethash_to_DynArray | ( | const DynHashTable< Key, HashTable, Cmp > & | s | ) |
Convert a DynHashTable (hash set) to a DynArray.
| Key | The key type. |
| HashTable | The hash table template. |
| Cmp | The equality comparator. |
| s | The source DynHashTable. |
Definition at line 1058 of file ah-convert.H.
References Aleph::DynArray< T >::append(), and FunctionalMethods< Container, T >::for_each().
Referenced by TEST().
| DynList< Key > Aleph::sethash_to_DynList | ( | const DynHashTable< Key, HashTable, Cmp > & | s | ) |
Convert a DynHashTable (hash set) to a DynList.
| Key | The key type. |
| HashTable | The hash table template. |
| Cmp | The equality comparator. |
| s | The source DynHashTable. |
Definition at line 1021 of file ah-convert.H.
References Aleph::DynList< T >::append(), and FunctionalMethods< Container, T >::for_each().
Referenced by TEST().
| std::vector< Key > Aleph::sethash_to_vector | ( | const DynHashTable< Key, HashTable, Cmp > & | s | ) |
Convert a DynHashTable (hash set) to a std::vector.
| Key | The key type. |
| HashTable | The hash table template. |
| Cmp | The equality comparator. |
| s | The source DynHashTable. |
Definition at line 1076 of file ah-convert.H.
References FunctionalMethods< Container, T >::for_each().
Referenced by TEST().
| Array< Key > Aleph::settree_to_Array | ( | const DynSetTree< Key, Tree, Compare > & | s | ) |
Convert a DynSetTree to an Array.
Creates a new Array containing copies of all elements from the given DynSetTree. Elements are in tree traversal order (in-order).
| Key | The key type. |
| Tree | The tree implementation template. |
| Compare | The comparison functor. |
| s | The source DynSetTree. |
Definition at line 905 of file ah-convert.H.
References Aleph::Array< T >::append(), FunctionalMethods< Container, T >::for_each(), Aleph::Array< T >::reserve(), and Aleph::DynSetTree< Key, Tree, Compare >::size().
Referenced by TEST().
| DynArray< Key > Aleph::settree_to_DynArray | ( | const DynSetTree< Key, Tree, Compare > & | s | ) |
Convert a DynSetTree to a DynArray.
Creates a new DynArray containing copies of all elements from the given DynSetTree. Elements are in tree traversal order (in-order).
| Key | The key type. |
| Tree | The tree implementation template. |
| Compare | The comparison functor. |
| s | The source DynSetTree. |
Definition at line 927 of file ah-convert.H.
References Aleph::DynArray< T >::append(), and FunctionalMethods< Container, T >::for_each().
Referenced by TEST().
| DynList< Key > Aleph::settree_to_DynList | ( | const DynSetTree< Key, Tree, Compare > & | s | ) |
Convert a DynSetTree to a DynList.
Creates a new DynList containing copies of all elements from the given DynSetTree. Elements are in tree traversal order (in-order).
| Key | The key type. |
| Tree | The tree implementation template. |
| Compare | The comparison functor. |
| s | The source DynSetTree. |
Definition at line 884 of file ah-convert.H.
References Aleph::DynList< T >::append(), and FunctionalMethods< Container, T >::for_each().
| std::set< Key > Aleph::settree_to_stdset | ( | const DynSetTree< Key, Tree, Compare > & | s | ) |
Convert a DynSetTree to a std::set.
| Key | The key type. |
| Tree | The tree implementation template. |
| Compare | The comparison functor. |
| s | The source DynSetTree. |
Definition at line 964 of file ah-convert.H.
References FunctionalMethods< Container, T >::for_each().
Referenced by TEST().
| std::vector< Key > Aleph::settree_to_vector | ( | const DynSetTree< Key, Tree, Compare > & | s | ) |
Convert a DynSetTree to a std::vector.
| Key | The key type. |
| Tree | The tree implementation template. |
| Compare | The comparison functor. |
| s | The source DynSetTree. |
Definition at line 945 of file ah-convert.H.
References FunctionalMethods< Container, T >::for_each(), Aleph::DynArray< T >::reserve(), and Aleph::DynSetTree< Key, Tree, Compare >::size().
Sort a dynamic array using Shell sort.
Shell sort is an optimization of insertion sort that allows exchange of elements that are far apart. It works by sorting elements at various gap intervals, progressively reducing the gap until it becomes 1.
Uses Ciura's gap sequence (empirically optimal): 1, 4, 10, 23, 57, 132, ... Extended with 2.25x multiplier for larger arrays. For each gap h (from largest to smallest): Perform h-sorting (insertion sort with stride h) When h=1, the array becomes fully sorted.
| T | Element type (must be copy-assignable and comparable). |
| Compare | Comparison functor type (default: Aleph::less<T>). |
| [in,out] | a | The dynamic array to sort. |
| cmp | Comparison functor. |
Definition at line 3650 of file tpl_sort_utils.H.
References and, cmp(), h, and Aleph::DynArray< T >::size().
Referenced by benchmark_array_algorithms().
|
inline |
Indent every line in a multi-line std::string by n spaces.
| [in] | str | Input text. |
| [in] | n | Number of spaces. |
Definition at line 1237 of file ah-string-utils.H.
References fill(), and split_to_list().
Referenced by TEST().
Randomly shuffle a sequence.
shuffle(c) produces a random permutation of container c
| [in] | c | container to be shuffled |
c Definition at line 419 of file tpl_random_queue.H.
References FunctionalMethods< Container, T >::for_each(), Aleph::Random_Set< T >::get(), Aleph::Random_Set< T >::is_empty(), and Aleph::Random_Set< T >::put().
Referenced by generate_random_data(), run_experiment(), RankTreeTest< Tree >::SetUp(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), and visual_demonstration().
Return a random sequence of pointers to items of a sequence.
| [in] | c | container to be shuffled |
c Definition at line 440 of file tpl_random_queue.H.
References FunctionalMethods< Container, T >::for_each(), Aleph::Random_Set< T >::get(), Aleph::Random_Set< T >::is_empty(), and Aleph::Random_Set< T >::put().
|
inlinenoexcept |
Restore heap order by moving an element down.
Restores the heap invariant in the subrange [l, r] by sifting the element initially at index l downward until the heap property holds. All the comparisons come before the moves, so that if one throws, nothing has moved.
| what | the comparison throws, with the subrange as it was; nothing when it is noexcept. |
Definition at line 239 of file tpl_dynArrayHeap.H.
References cmp(), Aleph::dynarrayheap_detail::down_index(), l, r, and Aleph::dynarrayheap_detail::shift().
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 3749 of file tpl_sort_utils.H.
References cmp().
|
inline |
Move an element down in a heap to restore heap property.
| table | The dynamic array containing the heap. |
| start | The index of the element to sift down (1-based). |
| n | The current size of the heap. |
| cmp | Comparison functor. |
Definition at line 3723 of file tpl_sort_utils.H.
References back_index(), and cmp().
|
inline |
Restore the heap property by moving the element at position l downwards.
This operation assumes the subtrees below l satisfy the heap property and then restores it for the whole range [l, r]. If the comparison throws, the element goes back to l.
| T | element type |
| Compare | comparator defining the heap order |
| [in,out] | ptr | 1-based array backing the heap |
| [in] | l | left boundary (inclusive) / starting index |
| [in] | r | right boundary (inclusive) |
| [in] | cmp | comparison criteria |
| what | the comparison throws, with the range as it was if the exchange of two items does not throw. |
Definition at line 280 of file tpl_arrayHeap.H.
References cmp(), l, r, and Aleph::arrayheap_detail::sift_down().
Referenced by Aleph::ArrayHeap< T, Compare >::getMin(), heapsort(), TEST(), TEST(), and TEST().
|
inline |
Sift down operation for heapsort on a DynArray subrange.
Definition at line 4007 of file tpl_sort_utils.H.
Referenced by heapsort_subrange().
|
inline |
Restore the heap property by sifting down and then sifting up.
Used when the element at i might need to move in either direction.
| T | element type |
| Compare | comparator defining the heap order |
| [in,out] | ptr | 1-based array backing the heap |
| [in] | l | left boundary (inclusive) |
| [in] | i | position to update |
| [in] | r | right boundary (inclusive) |
| [in] | cmp | comparison criteria |
| what | the comparison throws, with the range as it was if the exchange of two items does not throw. |
Definition at line 302 of file tpl_arrayHeap.H.
References cmp(), l, r, Aleph::arrayheap_detail::sift_down(), and Aleph::arrayheap_detail::undo_sift_down().
Referenced by Aleph::ArrayHeap< T, Compare >::remove(), TEST(), and Aleph::ArrayHeap< T, Compare >::update().
|
inlinenoexcept |
Restore heap order by moving an element up.
Restores the heap invariant in the subrange [l, r] by sifting the element initially at index r upward until the heap property holds. All the comparisons come before the moves, so that if one throws, nothing has moved.
| what | the comparison throws, with the subrange as it was; nothing when it is noexcept. |
Definition at line 211 of file tpl_dynArrayHeap.H.
References cmp(), l, r, Aleph::dynarrayheap_detail::shift(), and Aleph::dynarrayheap_detail::up_index().
|
inline |
Move an element up in a heap to restore heap property.
| table | The dynamic array containing the heap. |
| n | The index of the element to sift up (1-based). |
| cmp | Comparison functor. |
Definition at line 3701 of file tpl_sort_utils.H.
References back_index(), and cmp().
|
inline |
Restore the heap property by moving the element at position r upwards.
This operation assumes the range [l, r-1] already satisfies the heap property and then restores it for the whole range [l, r]. If the comparison throws, the element goes back to r.
| T | element type |
| Compare | comparator defining the heap order |
| [in,out] | ptr | 1-based array backing the heap |
| [in] | l | left boundary (inclusive) |
| [in] | r | right boundary (inclusive) |
| [in] | cmp | comparison criteria |
| what | the comparison throws, with the range as it was if the exchange of two items does not throw. |
Definition at line 257 of file tpl_arrayHeap.H.
References cmp(), l, r, and Aleph::arrayheap_detail::sift_up().
Referenced by Aleph::ArrayHeap< T, Compare >::insert_ne(), Aleph::ArrayHeap< T, Compare >::insert_ne(), TEST(), TEST(), and TEST().
|
constexpr |
Column of n bits with sign: the integers of [-2^(n-1), 2^(n-1) - 1].
| [in] | n | Number of bits, from 1 to 64. |
| std::domain_error | if n is 0 or greater than 64. As a template argument, that is a compile-time error. |
Definition at line 146 of file tpl_packed_matrix.H.
References ah_domain_error_if.
|
inline |
Sine of x (wrapper over mpfr).
Definition at line 185 of file point.H.
References sin().
Referenced by Aleph::Point::rotate(), Aleph::Ellipse::sample(), Aleph::RotatedEllipse::sample(), and TEST().
|
inlinenoexcept |
Definition at line 775 of file hash-fct.H.
References siphash24_hash().
|
noexcept |
Definition at line 640 of file hash-fct.H.
References siphash24_hash().
|
inlinenoexcept |
Definition at line 855 of file hash-fct.H.
References siphash24_hash().
|
inlinenoexcept |
See compute_cardinality_rec(Node * root).
Definition at line 586 of file tpl_binNodeUtils.H.
References compute_cardinality_rec(), and root().
Referenced by Aleph::AhArenaAllocator::AhArenaAllocator(), Aleph::Modular_Matrix< MatrixT >::Modular_Matrix(), __deway_search(), __generate_tree(), __search_deway(), Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::_collect_sorted_primitive_factor_groups(), Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::_interpolated_factors_for_main_var(), Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::_try_lift_primitive_affine_linear_factor_for_main_var(), Aleph::AhArenaAllocator::alloc(), Aleph::AhArenaAllocator::alloc_aligned(), allocate(), Aleph::AhArenaAllocator::allocate(), allocate_zeroed(), Event_Table< void *(void *)>::append_event_to_table(), Aleph::planarity_detail::LR_Planarity_Checker< GT, SA >::build_combinatorial_embedding_bruteforce(), Aleph::planarity_detail::LR_Planarity_Checker< GT, SA >::build_combinatorial_embedding_linear_lr(), Aleph::planarity_detail::LR_Planarity_Checker< GT, SA >::build_nonplanar_certificate(), Event_Table< void *(void *)>::check(), Aleph::parallel_detail::chunk_size(), compiler_dump_ssa_function(), Aleph::FFT< Real >::OverlapAddBank::convolve_impl(), Aleph::detail::crc32_add_bytes(), csv_distinct(), csv_get_column(), csv_group_by(), csv_inner_join(), csv_is_rectangular(), csv_select_columns(), csv_unique(), Aleph::AhArenaAllocator::dealloc(), Aleph::AhArenaAllocator::deallocate(), Aleph::detail::Paged_Bounded_String_Codec< Capacity, SizeType >::decode(), demo_grid_networks(), demo_memory_stats(), demo_modular_linalg(), deway_search(), Aleph::Lengauer_Tarjan_Dominators< GT, SA >::dominance_frontiers(), Aleph::Compiler_C_Backend::Emitter::emit_prototypes(), Aleph::FFT< Real >::ISTFTProcessor::ensure_pending_size(), Aleph::patricia_trie_detail::Bitwise_Trie_Utils< UInt >::erase_key(), Event_Table< void *(void *)>::execute_event(), Moved_From_Case< Graph_Life >::fingerprint(), generate_graphpic(), generate_layered_network(), generate_tree(), Aleph::BinNodeInfixIterator< Node >::get_pos(), in_place_transpose(), interpreter_dump_environment(), interpreter_dump_globals(), interpreter_value_to_string(), interpreter_values_equal(), Moved_From_Case< Field_Grid >::is_empty(), Event_Table< void *(void *)>::is_registered(), Aleph::FFT< Real >::istft_impl(), Aleph::howard_detail::karp_by_component(), LLVMFuzzerTestOneInput(), Aleph::Compiler_SSA_Lowering::lower_function_internal(), main(), main(), Aleph::FFT< Real >::matrix_shape(), Aleph::FFT< Real >::OverlapAddBank::max_batch_length(), Aleph::Gen_Centroid_Decomposition< GT, SA >::max_centroid_level(), graph_oracles::max_matching(), Aleph::NTT< MOD, ROOT >::max_transform_size_impl(), Aleph::NTT< MOD, ROOT >::multipoint_eval_recursive(), Aleph::BinNodeInfixIterator< Node >::next_ne(), operator new(), operator new(), operator new(), operator new(), operator new[](), operator new[](), operator new[](), operator new[](), Aleph::MonotonePolygonTriangulation::operator()(), Aleph::FFT< Real >::overlap_add_frames(), Aleph::FFT< Real >::OverlapAddBank::pprocess_block(), Aleph::FFT< Real >::prfft_batch(), Aleph::FFT< Real >::OverlapAddBank::process_block(), Aleph::FFT< Real >::OverlapAddBank::process_chunk_batch_impl(), Aleph::FFT< Real >::ptransform_batch(), Aleph::NTT< MOD, ROOT >::ptransform_batch(), Event_Table< void *(void *)>::register_event(), Event_Table< void *(void *)>::register_event(), Aleph::Compiler_SSA_Detail::rename_recursive(), Aleph::Compiler_Lexer::reset(), Aleph::FFT< Real >::rfft_batch(), search_deway(), Aleph::FunctionalMixin< Derived, Type >::sliding(), solve_transportation(), Aleph::pdq_detail::sort_loop(), stl_distinct(), stl_drop(), stl_group_by(), stl_take_last(), stl_tally(), Aleph::FFT< Real >::tensor3_shape(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), Aleph::FFT< Real >::transform_batch(), Aleph::NTT< MOD, ROOT >::transform_batch(), Aleph::NTT< MOD, ROOT >::transformed_batch(), transpose(), Aleph::FFT< Real >::transpose_spectrogram_layout_impl(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), Event_Table< void *(void *)>::unregister_event(), Moved_From_Case< AABBTree >::use(), Moved_From_Case< F::STFTProcessor >::use(), Moved_From_Case< Graph_Life >::use(), Aleph::FFT< Real >::BatchedSTFTProcessor::validate_batch_size(), Aleph::FFT< Real >::BatchedISTFTProcessor::validate_batch_size(), Aleph::Simplex< T >::verify_solution(), Aleph::RevisedSimplex< T >::verify_solution(), welsh_powell_coloring(), and Aleph::CA::Reproductions::write_histogram_csv().
| auto Aleph::skewness | ( | const Container & | data | ) | -> std::decay_t<decltype(*std::begin(data))> |
Compute skewness (measure of asymmetry).
Positive skewness: right tail is longer Negative skewness: left tail is longer Zero skewness: symmetric distribution
Uses the adjusted Fisher-Pearson standardized moment coefficient.
| data | Input container |
| std::invalid_argument | if container has fewer than 3 elements |
Definition at line 523 of file stat_utils.H.
References ah_invalid_argument_if, diff(), m, mean(), skewness(), and stddev().
Referenced by compute_all_stats(), skewness(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Skip a block comment (C-style)
Reads and discards characters until the closing sequence is found. Updates line/column tracking appropriately.
| input_stream | The input file stream |
| open | Opening sequence (default "/ *") |
| close | Closing sequence (default "* /") |
| ParseError | if EOF is reached before comment closes |
Definition at line 837 of file parse_utils.H.
References ah_parse_error, current_col_number, current_line_number, and skip_block_comment().
Referenced by skip_block_comment(), skip_whitespace_and_comments(), TEST_F(), and TEST_F().
|
inline |
Skip a line comment (// style or # style)
Assumes the comment marker has already been read. Advances the stream to the end of the line (or EOF).
| input_stream | The input file stream |
Definition at line 808 of file parse_utils.H.
References current_col_number, current_line_number, and skip_line_comment().
Referenced by skip_line_comment(), skip_whitespace_and_comments(), and TEST_F().
|
inline |
Skip whitespace characters in the input stream.
Advances the stream position past any whitespace characters (spaces, tabs, newlines, etc.). After this call, the next character in the stream will be non-whitespace (or EOF).
| input_stream | The input file stream |
| std::out_of_range | if EOF is reached while skipping |
Definition at line 317 of file parse_utils.H.
References read_char_from_stream(), and skip_white_spaces().
Referenced by expect(), expect_char(), get_token(), load_binary_number(), load_char_literal(), load_deway_number(), load_double(), load_escaped_string(), load_hex_number(), load_identifier(), load_number(), load_octal_number(), load_string(), skip_white_spaces(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and try_char().
|
inline |
Skip whitespace and comments (C/C++ style)
Skips spaces, tabs, newlines, line comments (//), and block comments. This is a common operation in lexers.
| input_stream | The input file stream |
Definition at line 888 of file parse_utils.H.
References current_col_number, next(), peek_char(), read_char_from_stream(), skip_block_comment(), skip_line_comment(), and skip_whitespace_and_comments().
Referenced by skip_whitespace_and_comments(), TEST_F(), TEST_F(), and TEST_F().
|
inlinenoexcept |
Definition at line 1120 of file hash-fct.H.
References Aleph_Snd_Hash_Seed, and wyhash_hash().
|
inlinenoexcept |
Secondary default hash: different distribution from dft_hash_fct.
Uses Aleph_Hash<Key> with a fixed secondary seed so that snd_hash_fct(x) != dft_hash_fct(x) for virtually all inputs. Suitable as the second hash in double-hashing schemes.
SuperFastHash(&key, sizeof(key), Aleph_Snd_Hash_Seed) path to preserve consistency with the open-addressing hash tables used across the repo. Definition at line 1108 of file hash-fct.H.
References Aleph_Snd_Hash_Seed.
Referenced by pair_snd_hash_fct(), snd_hash(), AhHashDispatcher< Key, Operation >::snd_hash(), snd_hash_ptr_fct(), TEST(), TEST(), TEST(), and TEST_F().
|
inlinenoexcept |
Definition at line 1115 of file hash-fct.H.
References Aleph_Snd_Hash_Seed, and SuperFastHash().
|
inlinenoexcept |
Definition at line 1125 of file hash-fct.H.
References Aleph_Snd_Hash_Seed, and wyhash_hash().
|
inlinenoexcept |
| AssignmentResult< Cost_Type > Aleph::solve_assignment | ( | const std::vector< std::vector< Cost_Type > > & | costs | ) |
Solve the assignment problem using min-cost flow.
Given n workers and n tasks with cost matrix C, find an assignment that minimizes total cost where each worker is assigned exactly one task.
This is modeled as min-cost bipartite matching:
| Cost_Type | Type for costs. |
| costs | Cost matrix (costs[i][j] = cost of assigning worker i to task j). |
| std::invalid_argument | if costs is not a square matrix (any row has a different size than costs.size()). |
Definition at line 872 of file tpl_mincost.H.
References ah_invalid_argument_if, Aleph::DynList< T >::append(), Aleph::AssignmentResult< Cost_Type >::assignments, Aleph::DynMapTree< Key, Data, Tree, Compare >::contains(), Aleph::Array< T >::create(), Aleph::AssignmentResult< Cost_Type >::feasible, Aleph::DynMapTree< Key, Data, Tree, Compare >::find(), GraphCommon< GT, Node, Arc >::get_tgt_node(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::has_curr(), Aleph::DynMapTree< Key, Data, Tree, Compare >::insert(), Aleph::Net_Graph< NodeT, ArcT >::insert_arc(), Aleph::Net_Graph< NodeT, ArcT >::insert_node(), row, successive_shortest_paths(), and Aleph::AssignmentResult< Cost_Type >::total_cost.
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TYPED_TEST().
| CirculationResult< typename Net::Flow_Type > Aleph::solve_circulation | ( | Net & | net, |
| GetDemand | get_demand, | ||
| GetLower | get_lower | ||
| ) |
Solve a circulation problem with demands.
Given a network where:
Find a circulation f such that:
There is no circulation if a lower bound is negative or above the capacity of its arc, or if the demands do not add up to 0. With a floating flow, an adjusted demand within the rounding of its sum of the demand and the lower bounds of its node, an epsilon of the sum of their magnitudes by each of them and two more, is 0, so that bounds that balance but for rounding are a circulation.
| Net | Network type. |
| GetDemand | Functor returning node demand. |
| GetLower | Functor returning edge lower bound. |
| Maxflow | Max-flow algorithm to use. |
| net | Network (modified during computation). |
| get_demand | Returns demand for each node. |
| get_lower | Returns the lower bound for each arc. |
| std::bad_alloc | if there is not enough memory. Then the network is as it was, but for its flows, which are 0, unless the removal of the super nodes, which allocates, fails too. |
Definition at line 151 of file net_apps.H.
References and, Aleph::DynList< T >::append(), Aleph::CirculationResult< Flow_Type >::feasible, Aleph::CirculationResult< Flow_Type >::flow, LocateFunctions< Container, Type >::get_it(), Aleph::Net_Graph< NodeT, ArcT >::get_sink_nodes(), GraphCommon< GT, Node, Arc >::get_src_node(), Aleph::Net_Graph< NodeT, ArcT >::get_src_nodes(), GraphCommon< GT, Node, Arc >::get_tgt_node(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::has_curr(), Aleph::Net_Graph< NodeT, ArcT >::insert_arc(), Aleph::Net_Graph< NodeT, ArcT >::insert_node(), Aleph::Filter_Iterator< Container, It, Show_Item >::next_ne(), and Aleph::Net_Graph< NodeT, ArcT >::remove_node().
Referenced by design_survey(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
| MCF_Result< typename Net::Flow_Type > Aleph::solve_multicommodity_flow | ( | Net & | net | ) |
Solve multi-commodity flow problem.
Convenience function to solve MCF on a network.
| Net | Network type. |
| [in,out] | net | Network with commodities defined. |
Definition at line 695 of file tpl_multicommodity.H.
References Aleph::MCF_LP_Solver< Net >::solve().
Referenced by TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
| ProjectSelectionResult< Value_Type > Aleph::solve_project_selection | ( | const std::vector< Project< Value_Type > > & | projects | ) |
Solve project selection problem using max-flow.
Given a set of projects with profits/costs and prerequisite constraints, select a subset of projects to maximize total profit.
Constraint: If project A is selected, all its prerequisites must also be selected.
This is the "closure" problem, solved by min-cut:
| Value_Type | Type for profit values. |
| projects | Vector of projects. |
Definition at line 397 of file net_apps.H.
References Aleph::DynSetTree< Key, Tree, Compare >::contains(), dinic_maximum_flow(), Aleph::DynListQueue< T >::front(), Aleph::DynListQueue< T >::get(), GraphCommon< GT, Node, Arc >::get_connected_node(), GraphCommon< GT, Node, Arc >::get_src_node(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::has_curr(), Aleph::DynSetTree< Key, Tree, Compare >::insert(), Aleph::Net_Graph< NodeT, ArcT >::insert_arc(), Aleph::Net_Graph< NodeT, ArcT >::insert_node(), Aleph::DynListQueue< T >::is_empty(), Aleph::ProjectSelectionResult< Value_Type >::max_profit, min_cut(), Aleph::DynListQueue< T >::put(), Aleph::ProjectSelectionResult< Value_Type >::selected, Aleph::ProjectSelectionResult< Value_Type >::total_cost, and Aleph::ProjectSelectionResult< Value_Type >::total_revenue.
Referenced by demo_project_selection(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
| TransportationResult< Cost_Type > Aleph::solve_transportation | ( | const std::vector< Cost_Type > & | supplies, |
| const std::vector< Cost_Type > & | demands, | ||
| const std::vector< std::vector< Cost_Type > > & | costs | ||
| ) |
Solve the transportation problem using min-cost flow.
Given:
Find the minimum cost way to satisfy all demands.
| Cost_Type | Type for costs and quantities. |
| supplies | Supply at each source. |
| demands | Demand at each destination. |
| costs | Cost matrix (costs[i][j] = unit cost from i to j). |
| std::invalid_argument | if costs.size() != supplies.size(), any costs[i].size() != demands.size(), or any supply/demand is negative. |
Definition at line 1003 of file tpl_mincost.H.
References ah_invalid_argument_if, arcs, Aleph::Array< T >::create(), Aleph::TransportationResult< Cost_Type >::feasible, Aleph::Net_Graph< NodeT, ArcT >::insert_arc(), Aleph::Net_Graph< NodeT, ArcT >::insert_node(), m, Aleph::mincost_detail::same_total(), Aleph::TransportationResult< Cost_Type >::shipments, OhashCommon< HashTbl, Key >::size(), size(), successive_shortest_paths(), and Aleph::TransportationResult< Cost_Type >::total_cost.
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TYPED_TEST().
| TransshipmentResult< typename Net::Flow_Type > Aleph::solve_transshipment | ( | Net & | net, |
| GetDemand | get_demand | ||
| ) |
Solve minimum cost transshipment problem.
Given a network where nodes have supply/demand values, find the minimum cost way to satisfy all demands from supplies.
This is solved by:
| Net | Network type with cost. |
| GetDemand | Functor to get node demand. |
| net | Network with costs. |
| get_demand | Function returning demand for each node. |
| std::bad_alloc | if there is not enough memory. Then the super nodes are removed, unless their removal, which allocates, fails too. |
arc->flow fields on original arcs are modified to reflect the optimal transshipment flow. NODE_COOKIE on all nodes is overwritten during computation and should not be relied upon after the call.Definition at line 706 of file tpl_mincost.H.
References Aleph::DynList< T >::append(), Aleph::TransshipmentResult< Flow_Type >::feasible, LocateFunctions< Container, Type >::get_it(), Aleph::Net_Graph< NodeT, ArcT >::get_sink_nodes(), Aleph::Net_Graph< NodeT, ArcT >::get_src_nodes(), Aleph::Net_Graph< NodeT, ArcT >::insert_arc(), Aleph::Net_Graph< NodeT, ArcT >::insert_node(), Aleph::Filter_Iterator< Container, It, Show_Item >::next_ne(), Aleph::Net_Graph< NodeT, ArcT >::remove_node(), Aleph::mincost_detail::same_total(), successive_shortest_paths(), Aleph::TransshipmentResult< Flow_Type >::total_cost, and Aleph::TransshipmentResult< Flow_Type >::total_flow.
Referenced by TEST_F(), and TYPED_TEST().
Sorts an rvalue Array in place and returns it.
Efficient move-based sorting that avoids copying.
| T | Element type |
| Cmp | Comparison functor type |
| a | The array to sort (will be moved from) |
| cmp | Comparison functor |
Definition at line 278 of file ahSort.H.
References cmp(), and introsort().
Returns a sorted copy of an Array.
Creates a copy of the input array and sorts it using quicksort.
| T | Element type |
| Cmp | Comparison functor type (default: Aleph::less<T>) |
| a | The array to sort (not modified) |
| cmp | Comparison functor |
Definition at line 266 of file ahSort.H.
References cmp(), and introsort().
Returns a sorted copy of a DynArray.
Creates a copy of the input array and sorts it using quicksort.
| T | Element type |
| Cmp | Comparison functor type (default: Aleph::less<T>) |
| a | The array to sort (not modified) |
| cmp | Comparison functor |
Definition at line 234 of file ahSort.H.
References cmp(), and introsort().
Referenced by Container< Ctype >::Container(), build_combs(), demo_kruskal_simulation(), generate_random_data(), insert_n_random_items_in_map(), Aleph::AlDomain< T >::keys(), LLVMFuzzerTestOneInput(), main(), run_performance_comparison(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), Aleph::AlDomain< T >::to_str(), TYPED_TEST_P(), TYPED_TEST_P(), TYPED_TEST_P(), TYPED_TEST_P(), TYPED_TEST_P(), TYPED_TEST_P(), TYPED_TEST_P(), and TYPED_TEST_P().
Sorts an rvalue DynArray in place and returns it.
Efficient move-based sorting that avoids copying.
| T | Element type |
| Cmp | Comparison functor type |
| a | The array to sort (will be moved from) |
| cmp | Comparison functor |
Definition at line 255 of file ahSort.H.
References cmp(), and introsort().
|
inline |
Sort a whole range in place using the default < ordering.
| Range | a sortable random-access range. |
| [in,out] | r | range to sort in place. |
Definition at line 243 of file ah-ranges.H.
References r.
Sort a whole range in place, portably across the ranges divide.
Uses std::ranges::sort when the toolchain provides reliable ranges support (ALEPH_HAS_RANGES) — which is what clang-tidy's use-ranges check recommends — and falls back to std::sort otherwise, so the call still compiles on C++20 toolchains without a complete <ranges> implementation.
Intended for sorting an entire container in place. For sub-ranges or raw pointer ranges, call std::sort directly.
| Range | a sortable random-access range. |
| Cmp | a strict-weak-ordering comparator. |
| [in,out] | r | range to sort in place. |
| [in] | cmp | comparator (a, b) -> bool (true if a precedes b). |
Definition at line 227 of file ah-ranges.H.
Referenced by stl_sort(), and stl_sort_by().
| void Aleph::sort_ranked_moves | ( | Array< RankedMove< Move, Priority > > & | moves, |
| BetterPriority | better_priority, | ||
| const bool | prefer_killer, | ||
| const bool | prefer_history | ||
| ) |
Sort one materialized move batch using priority and optional hooks.
The ordering is:
better_priority,| Move | Concrete move type. |
| Priority | Numeric priority type. |
| BetterPriority | Binary predicate (Priority, Priority) -> bool. |
| moves | Batch of ranked moves to sort in-place. |
| better_priority | Comparator where true means the first priority is better. |
| prefer_killer | If true, moves with .killer == true are promoted. |
| prefer_history | If true, moves are ordered by descending .history_score. |
Definition at line 295 of file search_move_ordering.H.
References and, Aleph::RankedMove< Move, Priority >::history_score, introsort(), Aleph::RankedMove< Move, Priority >::killer, Aleph::RankedMove< Move, Priority >::ordinal, and Aleph::RankedMove< Move, Priority >::priority.
Referenced by Aleph::Alpha_Beta< Domain >::collect_ordered_moves(), Aleph::Branch_And_Bound< Domain, ObjectivePolicy >::collect_ordered_moves(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Split a std::string by a single delimiter character.
| [in] | s | Input std::string. |
| [in] | delim | Delimiter character. |
getline produces). Definition at line 743 of file ah-string-utils.H.
References split().
|
inline |
Split a std::string by a single delimiter character.
This overload appends tokens to an existing vector.
| [in] | s | Input std::string. |
| [in] | delim | Delimiter character. |
| [in,out] | elems | Output vector; tokens are appended. |
elems. Definition at line 725 of file ah-string-utils.H.
References split().
Referenced by demo_formatting(), demo_practical(), demo_splitting(), divide_and_conquer_partition_dp(), Aleph::RTree< Payload, MaxEntries, MinEntries, Variant >::insert_descend(), Aleph::RadixTree< T, Char >::insert_impl(), Aleph::RTree< Payload, MaxEntries, MinEntries, Variant >::insert_one(), Aleph::Naive_Suffix_Tree::insert_suffix(), load_digraph(), main(), matrix_chain_order(), split(), split(), split(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TYPED_TEST().
|
inline |
Split a camelCase / PascalCase std::string into tokens.
A new token starts at each upper-case character.
| [in] | str | Null-terminated input std::string. |
Definition at line 673 of file ah-string-utils.H.
References Aleph::DynList< T >::append().
Referenced by split_camel_case(), and TEST().
|
inline |
Split a camelCase / PascalCase std::string into tokens.
| [in] | str | Input std::string. |
Definition at line 700 of file ah-string-utils.H.
References split_camel_case().
|
inline |
Split a std::string into n parts.
The first n-1 parts have length str.size() / n. The last part receives the remainder.
| [in] | str | Input std::string. |
| [in] | n | Number of parts. |
n elements. | std::range_error | If n == 0 or n > str.size(). |
Definition at line 868 of file ah-string-utils.H.
References ah_range_error_if, and, Aleph::DynList< T >::append(), k, and Aleph::DynList< T >::size().
|
inline |
Split a std::string at a fixed position.
| [in] | str | Input std::string. |
| [in] | pos | Split position (0..str.size()). |
{left, right} where left.size() == pos. | std::range_error | If pos > str.size(). |
Definition at line 839 of file ah-string-utils.H.
References ah_range_error_if.
Referenced by demo_splitting(), main(), TEST(), and TEST().
|
inline |
Split a std::string by a set of delimiter characters.
The delimiter std::string is treated as a set: any character in delim separates tokens.
| Container | Output container template accepting std::string and supporting append(const std::string&). |
| [in] | s | Input std::string. |
| [in] | delim | Delimiter character set. |
Definition at line 762 of file ah-string-utils.H.
References split_string().
Referenced by split_string(), split_string(), TEST(), and TEST().
|
inline |
Split a string by a delimiter.
| str | The string to split |
| delimiter | Character to split on |
Definition at line 1630 of file parse_utils.H.
References Aleph::DynList< T >::append(), and split_string().
|
inline |
Split a text into lines by "\n".
| [in] | text | Input text. |
Definition at line 1069 of file ah-string-utils.H.
References split_to_list().
Referenced by align_text_to_left_except_first(), justify_line_except_first(), TEST(), and TEST().
|
inline |
Split a text into whitespace-separated words.
| [in] | text | Input text. |
Definition at line 1055 of file ah-string-utils.H.
References Aleph::DynList< T >::append().
Referenced by align_text_to_left(), justify_text(), and TEST().
|
inline |
Split a std::string into an Aleph::Array<std::string>.
| [in] | s | Input std::string. |
| [in] | delim | Delimiter character set. |
Definition at line 827 of file ah-string-utils.H.
|
inline |
Split a std::string into an Aleph::DynList<std::string>.
| [in] | s | Input std::string. |
| [in] | delim | Delimiter character set. |
Definition at line 793 of file ah-string-utils.H.
Referenced by shift_lines_to_left(), split_text_into_lines(), TEST(), TEST(), TEST(), TEST(), and to_Pascalcase().
|
inline |
Square root of x (wrapper over mpfr).
Definition at line 197 of file point.H.
References sqrt().
Referenced by Aleph::Ellipse::compute_tangents(), Aleph::Segment::compute_tgt_point(), Aleph::Point3D::distance_to(), Aleph::ConvexPolygonDistanceGJK::exact_refine_disjoint(), Aleph::RotatedEllipse::extremal_points(), Aleph::Ellipse::intersection_with(), Aleph::Ellipse::intersects_with(), Aleph::Point3D::norm(), Aleph::RotatedEllipse::normalize_rotation(), Aleph::Ellipse::perimeter(), Aleph::MinimumEnclosingCircle::Circle::radius(), ray_endpoint(), TEST(), and TEST_F().
|
inlinenoexcept |
Initialize potentials using Bellman-Ford.
Computes the shortest path distances in the residual graph of the flow of the network from a virtual node joined to every node by an arc of cost 0, which serve as initial potentials to ensure reduced costs are non-negative. From the source, it did not see the negative cycles that the source does not reach. With floating costs, a relaxation must improve a distance by more than 4 n^2 epsilons of the largest cost, so that the rounding of the sums does not make a cycle of cost zero, as an arc with a partial flow and its residual, negative.
| Net | Network type (must be Net_Cost_Graph or compatible). |
| [in,out] | net | Flow network with costs. |
| [in] | source | Kept for compatibility: the distances are not from it. |
Definition at line 344 of file tpl_mincost.H.
References and, GraphCommon< GT, Node, Arc >::get_src_node(), GraphCommon< GT, Node, Arc >::get_tgt_node(), Aleph::Filter_Iterator< Container, It, Show_Item >::next_ne(), and GraphCommon< GT, Node, Arc >::vsize().
Referenced by successive_shortest_paths().
| bool Aleph::ssp_shortest_path | ( | Net & | net, |
| typename Net::Node * | source, | ||
| typename Net::Node * | sink | ||
| ) |
Definition at line 176 of file tpl_mincost.H.
References and, GraphCommon< GT, Node, Arc >::get_connected_node(), GraphCommon< GT, Node, Arc >::get_src_node(), Aleph::DynBinHeap< T, Compare >::getMin(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::has_curr(), Aleph::DynBinHeap< T, Compare >::insert(), Aleph::GenBinHeap< NodeType, Key, Compare >::is_empty(), and Aleph::Filter_Iterator< Container, It, Show_Item >::next_ne().
Referenced by successive_shortest_paths().
|
inline |
Return stable sorted-order indices for an array-like container.
This is the high-level ahSort.H synonym for stable_build_index() from tpl_sort_utils.H. It works with Aleph arrays (Array, DynArray, and other containers exposing operator()) and with STL-style random-access containers such as std::vector (via operator[]). It returns an Array<size_t> because the number of indices is fixed once the source container size is known.
The returned index array has the direction idx[sorted_pos] = original_pos. Iterating a(idx(i)) for Aleph arrays, or a[idx(i)] for STL arrays, observes the original container in sorted order without moving its elements.
Stability means that elements equivalent according to cmp keep their original relative order in the returned index array. This is useful when sorting by a projection or partial key while preserving a previous order.
| C | Array-like container type. Must provide size() and either operator()(size_t) or operator[](size_t). |
| Compare | Strict weak ordering over the element type. |
| a | Container whose elements define the ordering. |
| cmp | Comparator used to order elements. |
Array<size_t> of original positions in stable sorted order.tpl_sort_utils.H. rank[original_pos] = sorted_pos. Definition at line 433 of file ahSort.H.
References cmp(), and stable_build_index().
Referenced by LLVMFuzzerTestOneInput(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Build a stable index array for indirect sorting.
Creates an array of indices that visits an array-like container in sorted order without moving or copying its elements. Unlike build_index(), this function preserves the original relative order of elements that are equivalent according to cmp.
The returned array has the direction idx[sorted_pos] = original_pos. For Aleph arrays, iterate with a(idx(i)); for STL-style arrays such as std::vector, iterate with a[idx(i)].
Stability is enforced by sorting indices with a deterministic tie-break: when neither cmp(a[i], a[j]) nor cmp(a[j], a[i]) is true, the smaller original index is ordered first.
| C | Array-like container type. Must provide size() and either operator()(size_t) or operator[](size_t). |
| Compare | Strict weak ordering over the element type. |
| a | Container whose elements define the ordering. |
| cmp | Comparator used to order elements. |
Array<size_t> of original positions in stable sorted order.Array is created with its final logical size before initialization, so index construction does not grow or reallocate the result. ahSort.H. Definition at line 4942 of file tpl_sort_utils.H.
References cmp(), Aleph::Array< T >::create(), quicksort_op(), and Aleph::Array< T >::size().
Referenced by stable_argsort(), and TEST().
Build a stable index array of pointers for indirect sorting.
Mutable-reference counterpart of the const stable_build_index_ptr() overload above — see its documentation for the stability guarantee and the index-then-materialize technique used to provide it.
| C | Container template. |
| T | Element type. |
| Compare | Comparison functor type. |
| a | Container to index. |
| cmp | Comparison functor. |
Array<T *> of sorted pointers, stable with respect to cmp.Definition at line 5072 of file tpl_sort_utils.H.
References cmp(), Aleph::Array< T >::create(), quicksort_op(), and Aleph::Array< T >::size().
|
inline |
Build a stable index array of pointers for indirect sorting (const version).
Like build_index_ptr(), but preserves the original relative order of elements that are equivalent according to cmp — the same stability guarantee stable_build_index() provides for plain indices, applied to pointers instead. This does not move or copy the elements of a.
Sorting pointers directly cannot use their addresses as a tie-break (nothing guarantees a container lays out elements in address order, and C<T> is generic), so this sorts an internal index array with stable_index_less() first, then materializes the sorted pointers from those indices — the same technique stable_build_index() uses, plus one extra O(n) pass to turn indices into pointers.
| C | Container template. |
| T | Element type. |
| Compare | Comparison functor type. |
| a | Container to index. |
| cmp | Comparison functor. |
Array<const T *> of sorted pointers, stable with respect to cmp.Definition at line 5034 of file tpl_sort_utils.H.
References cmp(), Aleph::Array< T >::create(), quicksort_op(), and Aleph::Array< T >::size().
| auto Aleph::std_zip | ( | const C1 & | c1, |
| const C2 & | c2 | ||
| ) |
| auto Aleph::std_zip_n | ( | const Cs &... | cs | ) |
Build a vector of tuples from 2 or more STL containers (variadic).
This is a convenience alias for tzip_std() with a more explicit name (and to avoid ambiguity with the legacy 2-container std_zip() that returns std::vector<std::pair<...>>).
| cs | STL-compatible containers. |
std::vector<std::tuple<...>> stopping at the shortest container. Definition at line 1650 of file ah-zip.H.
References tzip_std().
| auto Aleph::stddev | ( | const Container & | data, |
| bool | population = false |
||
| ) | -> std::decay_t<decltype(*std::begin(data))> |
Compute standard deviation.
| data | Input container |
| population | If true, compute population stddev; if false (default), sample stddev |
Definition at line 257 of file stat_utils.H.
References stddev(), and variance().
Referenced by coefficient_of_variation(), correlation(), demo_practical(), kurtosis(), monte_carlo_simulation(), skewness(), stddev(), TEST(), TEST(), and TEST_F().
| DynMapTree< K, V > Aleph::stdmap_to_DynMapTree | ( | const std::map< K, V, Compare, Alloc > & | m | ) |
Convert a std::map to a DynMapTree.
| K | The key type. |
| V | The value type. |
| Compare | The comparison function type. |
| Alloc | The allocator type. |
| m | The source std::map. |
Definition at line 1210 of file ah-convert.H.
References Aleph::DynMapTree< Key, Data, Tree, Compare >::insert(), m, and value.
Referenced by TEST().
Sorts an STL-compatible container using std::sort.
This function provides a convenient way to sort STL containers (std::vector, std::deque, etc.) with a consistent interface.
| Container | STL-compatible container type with begin()/end() |
| Cmp | Comparison functor type (default: std::less) |
| c | The container to sort (not modified) |
| cmp | Comparison functor |
Definition at line 307 of file ahSort.H.
References cmp().
Zip adjacent (consecutive) elements of a container.
Creates pairs of consecutive elements: (e[0], e[1]), (e[1], e[2]), etc. Useful for computing differences, detecting changes, etc.
| c | Container with elements. |
Definition at line 1433 of file ah-stl-zip.H.
| bool Aleph::stl_adjacent_all | ( | Pred && | pred, |
| const Container & | c | ||
| ) |
Check if predicate holds for all adjacent pairs.
| pred | Predicate (prev, curr) -> bool. |
| c | Container. |
true if predicate holds for all consecutive pairs.Definition at line 1515 of file ah-stl-zip.H.
References pred.
Referenced by TEST().
| bool Aleph::stl_adjacent_exists | ( | Pred && | pred, |
| const Container & | c | ||
| ) |
Check if predicate holds for any adjacent pair.
| pred | Predicate (prev, curr) -> bool. |
| c | Container. |
true if any consecutive pair satisfies predicate.Definition at line 1544 of file ah-stl-zip.H.
References pred.
Referenced by TEST().
| auto Aleph::stl_adjacent_map | ( | Op && | op, |
| const Container & | c | ||
| ) |
Apply function to adjacent pairs of elements.
| op | Function (prev, curr) -> R. |
| c | Container. |
Definition at line 1471 of file ah-stl-zip.H.
Referenced by TEST().
| bool Aleph::stl_all | ( | Pred && | pred, |
| const Container & | c | ||
| ) |
Check if all elements satisfy predicate.
| pred | Predicate (element) -> bool. |
| c | Container. |
true if all elements satisfy predicate.Definition at line 582 of file ah-stl-functional.H.
References pred, and Aleph::detail::ranges_all_of().
| bool Aleph::stl_any | ( | Pred && | pred, |
| const Container & | c | ||
| ) |
Alias for stl_exists.
Definition at line 627 of file ah-stl-functional.H.
References pred, and stl_exists().
Generate all k-arrangements (k-permutations) of a container.
| k | Number of elements to choose. |
| c | Container. |
Definition at line 2014 of file ah-stl-functional.H.
References k, and stl_traverse_arrangements().
| auto Aleph::stl_cartesian_product | ( | const std::vector< std::vector< T > > & | containers | ) |
Generate cartesian product of multiple containers.
| containers | Vector of containers. |
Definition at line 2045 of file ah-stl-functional.H.
Split container into chunks of size n (each_slice in Ruby).
| n | Chunk size. |
| c | Container. |
Definition at line 2164 of file ah-stl-functional.H.
References stl_chunks().
Referenced by main(), stl_chunks(), TEST(), and TEST().
Generate all k-combinations of a container.
| k | Number of elements to choose. |
| c | Container. |
Definition at line 1949 of file ah-stl-functional.H.
References k, and stl_traverse_combinations().
| int Aleph::stl_compare | ( | const Container1 & | c1, |
| const Container2 & | c2 | ||
| ) |
| auto Aleph::stl_concat | ( | const Container1 & | c1, |
| const Container2 & | c2 | ||
| ) |
Concatenate two containers.
| c1 | First container. |
| c2 | Second container. |
Definition at line 1583 of file ah-stl-functional.H.
|
inline |
Convert any STL container to a DynList.
Works with any container that exposes value_type and supports range-based for loops (std::vector, std::list, std::set, etc.).
| StlContainer | STL container type (must have value_type typedef). |
| container | Source container. |
Definition at line 367 of file ah-stl-utils.H.
References Aleph::DynList< T >::append().
Referenced by demo_list_dynlist(), TEST(), TEST(), TEST(), and TEST().
Remove all duplicates (keeps first occurrence).
Uses an adaptive algorithm:
| Container | Container type with value_type that supports equality comparison. For hash optimization, value_type must also be hashable via std::hash. |
| c | Input container. |
Definition at line 1533 of file ah-stl-functional.H.
References Aleph::stl_detail::ADAPTIVE_THRESHOLD, Aleph::stl_detail::safe_size(), and size().
Referenced by main(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
Create an enumerate view over a container.
Like Python's enumerate(). Produces tuples of (index, element).
| c | Container to enumerate. |
Definition at line 1154 of file ah-stl-zip.H.
Enumerate container (return pairs of index and element).
| c | Container. |
Definition at line 1356 of file ah-stl-functional.H.
References Aleph::stl_detail::try_reserve().
| bool Aleph::stl_equal | ( | const Container1 & | c1, |
| const Container2 & | c2 | ||
| ) |
Check equality of two containers.
| c1 | First container. |
| c2 | Second container. |
true if containers have same elements in same order.Definition at line 1383 of file ah-stl-functional.H.
References and.
| bool Aleph::stl_exists | ( | Pred && | pred, |
| const Container & | c | ||
| ) |
Check if any element satisfies predicate.
| pred | Predicate (element) -> bool. |
| c | Container. |
true if any element satisfies predicate.Definition at line 609 of file ah-stl-functional.H.
References pred, and Aleph::detail::ranges_any_of().
Referenced by main(), stl_any(), stl_none(), TEST(), TEST(), and TEST().
| auto Aleph::stl_find_mapi | ( | Op && | op, |
| const Container & | c | ||
| ) |
Find and map with index (find_mapi in ML).
| op | Callable (size_t idx, element) -> std::optional<R>. |
| c | Container. |
Definition at line 728 of file ah-stl-functional.H.
Referenced by TEST().
Flatten a container of containers.
| c | Container of containers. |
Definition at line 1607 of file ah-stl-functional.H.
Left fold (foldl) - reduce from left to right.
Computes: op(...op(op(init, x1), x2)..., xn)
| init | Initial accumulator value. |
| op | Binary operation (acc, element) -> acc. |
| c | Container. |
Definition at line 442 of file ah-stl-functional.H.
References init, and Aleph::detail::ranges_fold_left().
Referenced by main(), stl_reduce(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
Right fold (foldr) - reduce from right to left.
Computes: op(x1, op(x2, ...op(xn, init)...))
| init | Initial accumulator value. |
| op | Binary operation (element, acc) -> acc. |
| c | Container (must support rbegin()/rend()). |
Definition at line 480 of file ah-stl-functional.H.
References init.
| void Aleph::stl_for_each | ( | Op && | op, |
| const Container & | c | ||
| ) |
Apply operation to each element (for_each).
| op | Callable (element) -> void. |
| c | Container. |
Definition at line 294 of file ah-stl-functional.H.
| void Aleph::stl_for_each_indexed | ( | Op && | op, |
| const Container & | c | ||
| ) |
Apply operation to each element with index.
| op | Callable (size_t idx, element) -> void. |
| c | Container. |
Definition at line 311 of file ah-stl-functional.H.
Referenced by TEST().
| auto Aleph::stl_generate | ( | size_t | n, |
| Gen && | gen | ||
| ) |
Generate a vector using a generator function.
| n | Number of elements. |
| gen | Generator function (size_t index) -> T. |
Definition at line 269 of file ah-stl-functional.H.
Group consecutive equal elements.
| c | Container. |
Definition at line 1658 of file ah-stl-functional.H.
| auto Aleph::stl_group_by | ( | Key && | key, |
| const Container & | c | ||
| ) |
Group elements by key function.
Uses an adaptive algorithm:
| key | Key extractor (element) -> K. The key type K must be hashable via std::hash for the optimized path. |
| c | Input container. |
Definition at line 1713 of file ah-stl-functional.H.
References Aleph::stl_detail::ADAPTIVE_THRESHOLD, k, Aleph::stl_detail::safe_size(), and size().
Referenced by main(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
Get all elements except the last (init in Haskell).
| c | Container. |
Definition at line 2287 of file ah-stl-functional.H.
References stl_init().
Referenced by main(), stl_init(), and TEST().
Insert element between each pair (intersperse in Haskell).
| sep | Separator element. |
| c | Container. |
Definition at line 2199 of file ah-stl-functional.H.
References stl_intersperse().
Referenced by main(), stl_intersperse(), TEST(), and TEST().
Generate n evenly spaced values between start and end.
| start | Start value. |
| end | End value. |
| n | Number of values to generate. |
Definition at line 224 of file ah-stl-functional.H.
Map operation - transform each element.
| op | Callable (element) -> R. |
| c | Container. |
Definition at line 335 of file ah-stl-functional.H.
References Aleph::stl_detail::try_reserve().
Referenced by main(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
Map with index (mapi in ML).
| op | Callable (size_t idx, element) -> R. |
| c | Container. |
Definition at line 359 of file ah-stl-functional.H.
References Aleph::stl_detail::try_reserve().
Check if element exists in container (mem in ML).
| target | Element to search for. |
| c | Container. |
true if target is found.Definition at line 754 of file ah-stl-functional.H.
Get both min and max in a single pass.
| c | Container. |
Definition at line 1119 of file ah-stl-functional.H.
| bool Aleph::stl_none | ( | Pred && | pred, |
| const Container & | c | ||
| ) |
Check if no element satisfies predicate.
Definition at line 639 of file ah-stl-functional.H.
References pred, and stl_exists().
Generate all permutations of a container.
| c | Container. |
Definition at line 1885 of file ah-stl-functional.H.
References stl_traverse_permutations().
Generate power set (all subsets) of a container.
| c | Container. |
Definition at line 2083 of file ah-stl-functional.H.
References stl_power_set().
Referenced by main(), stl_power_set(), TEST(), TEST(), and TEST().
Generate a range [0, n-1].
| n | Number of elements. |
Definition at line 203 of file ah-stl-functional.H.
Generate a range of values [start, end] with given step.
| T | Numeric type. |
| start | Start value (inclusive). |
| end | End value (inclusive). |
| step | Increment between values (default 1). |
Definition at line 175 of file ah-stl-functional.H.
References and.
Alias for stl_foldl.
Definition at line 562 of file ah-stl-functional.H.
References init, and stl_foldl().
| auto Aleph::stl_reject | ( | Pred && | pred, |
| const Container & | c | ||
| ) |
Filter out elements (reject in Ruby, opposite of filter).
| pred | Predicate - elements where pred is TRUE are removed. |
| c | Container. |
Definition at line 2419 of file ah-stl-functional.H.
References pred, and stl_reject().
Referenced by main(), stl_reject(), and TEST().
Generate a vector of n repeated values.
| n | Number of repetitions. |
| value | Value to repeat. |
Definition at line 253 of file ah-stl-functional.H.
References value.
Return reversed copy of container.
| c | Container. |
Definition at line 1433 of file ah-stl-functional.H.
Scan left - fold with all intermediate results.
| init | Initial value. |
| op | Binary operation (acc, element) -> acc. |
| c | Container. |
Definition at line 509 of file ah-stl-functional.H.
References init.
Scan right - right fold with all intermediate results.
| init | Initial value. |
| op | Binary operation (element, acc) -> acc. |
| c | Container. |
Definition at line 538 of file ah-stl-functional.H.
References init.
Sliding window of size n over container (each_cons in Ruby).
| n | Window size. |
| c | Container. |
Definition at line 2131 of file ah-stl-functional.H.
References stl_sliding_window().
Referenced by main(), stl_sliding_window(), TEST(), and TEST().
Return sorted copy of container.
| c | Container. |
Definition at line 1452 of file ah-stl-functional.H.
References sort_range().
Return sorted copy using custom comparator.
| cmp | Comparator (a, b) -> bool (true if a < b). |
| c | Container. |
Definition at line 1472 of file ah-stl-functional.H.
References cmp(), and sort_range().
| auto Aleph::stl_span | ( | Pred && | pred, |
| const Container & | c | ||
| ) |
Split at predicate boundary (span in Haskell).
Returns (takeWhile pred, dropWhile pred) in one pass.
| pred | Predicate. |
| c | Container. |
Definition at line 2257 of file ah-stl-functional.H.
References pred, and stl_span().
Referenced by main(), stl_span(), and TEST().
Split at position n, returning (take n, drop n) in one pass.
| n | Position to split at. |
| c | Container. |
Definition at line 2226 of file ah-stl-functional.H.
References stl_split_at().
Referenced by main(), stl_split_at(), and TEST().
Get all elements except the first (tail in Haskell).
| c | Container. |
Definition at line 2308 of file ah-stl-functional.H.
References stl_tail().
Referenced by main(), stl_tail(), and TEST().
Take last n elements.
| n | Number of elements to take. |
| c | Container. |
Definition at line 880 of file ah-stl-functional.H.
References all(), count(), Aleph::stl_detail::safe_size(), and size().
Count occurrences of each element (tally in Ruby, frequencies).
Uses an adaptive algorithm:
| c | Input container. |
Definition at line 2350 of file ah-stl-functional.H.
References size(), and stl_tally().
Referenced by main(), stl_tally(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
| bool Aleph::stl_traverse_arrangements | ( | size_t | k, |
| Op && | op, | ||
| const Container & | c | ||
| ) |
Traverse all k-arrangements (k-permutations) of a container.
Generates all P(n,k) = n!/(n-k)! ways to choose k elements from n WITH order. The operation can return false to stop early.
| k | Number of elements to choose. |
| op | Callable (const std::vector<T>&) -> bool. Return false to stop. |
| c | Container. |
true if all arrangements were visited, false if stopped early.Definition at line 1988 of file ah-stl-functional.H.
References Aleph::stl_comb_detail::arrangements_impl(), and k.
Referenced by stl_arrangements().
| bool Aleph::stl_traverse_combinations | ( | size_t | k, |
| Op && | op, | ||
| const Container & | c | ||
| ) |
Traverse all k-combinations of a container.
Generates all C(n,k) ways to choose k elements from n, without regard to order. The operation can return false to stop early.
| k | Number of elements to choose. |
| op | Callable (const std::vector<T>&) -> bool. Return false to stop. |
| c | Container. |
true if all combinations were visited, false if stopped early.Definition at line 1924 of file ah-stl-functional.H.
References Aleph::stl_comb_detail::combinations_impl(), and k.
Referenced by stl_combinations().
| bool Aleph::stl_traverse_permutations | ( | Op && | op, |
| const Container & | c | ||
| ) |
Traverse all permutations of a container.
Generates all n! permutations (orderings) of the elements. The operation can return false to stop early.
| op | Callable (const std::vector<T>&) -> bool. Return false to stop. |
| c | Container. |
true if all permutations were visited, false if stopped early.Definition at line 1865 of file ah-stl-functional.H.
References Aleph::stl_comb_detail::permutations_impl().
Referenced by stl_permutations(), and TEST().
Remove consecutive duplicates.
| c | Container. |
Definition at line 1495 of file ah-stl-functional.H.
| auto Aleph::stl_unzip | ( | const std::vector< std::pair< T, U > > & | pairs | ) |
Unzip a vector of pairs into two vectors.
Inverse operation of zip for pairs.
| pairs | Vector of pairs to unzip. |
Definition at line 1344 of file ah-stl-zip.H.
Referenced by TEST().
Unzip pairs into two vectors.
| c | Container of pairs. |
Definition at line 1327 of file ah-stl-functional.H.
References Aleph::stl_detail::try_reserve().
| auto Aleph::stl_unzip_tuple | ( | const std::vector< std::tuple< Ts... > > & | tuples | ) |
Unzip a vector of tuples into a tuple of vectors.
Inverse operation of zip for tuples.
| tuples | Vector of tuples to unzip. |
Definition at line 1380 of file ah-stl-zip.H.
Referenced by TEST().
|
constexpr |
Create a lazy zip view over STL containers.
Returns a view that can be iterated with range-based for loops or used with functional operations. No memory is allocated for the zipped result - iteration happens inline.
| Containers | Types of containers to zip. |
| cs | Containers to zip together. |
Definition at line 421 of file ah-stl-zip.H.
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
| bool Aleph::stl_zip_all | ( | Pred && | pred, |
| const Containers &... | cs | ||
| ) |
Check if predicate holds for all zipped tuples.
Iterates over zipped containers and tests each tuple with the predicate. Returns true only if the predicate returns true for every tuple. Short-circuits on first false.
This is similar to ML's forall or Haskell's all.
| Pred | Predicate type (tuple) -> bool. |
| Containers | Container types. |
| pred | Predicate to test each tuple. |
| cs | Containers to zip. |
true if pred is true for all tuples; false otherwise.Definition at line 479 of file ah-stl-zip.H.
References pred, and stl_zip_it().
| bool Aleph::stl_zip_all_eq | ( | Pred && | pred, |
| const Containers &... | cs | ||
| ) |
Check if predicate holds for all tuples AND containers have equal length.
Like stl_zip_all but also verifies that all containers have the same size.
| pred | Predicate to test. |
| cs | Containers to zip. |
true if pred is true for all tuples and lengths match.Definition at line 500 of file ah-stl-zip.H.
References pred, and stl_zip_it().
Referenced by TEST().
| bool Aleph::stl_zip_any | ( | Pred && | pred, |
| const Containers &... | cs | ||
| ) |
Alias for stl_zip_exists (Python/JS style name)
Definition at line 546 of file ah-stl-zip.H.
References pred, and stl_zip_exists().
Referenced by TEST().
| auto Aleph::stl_zip_assoc | ( | const Key & | key, |
| const Containers &... | cs | ||
| ) |
Find value associated with key in zipped pairs (assoc in ML).
Searches for a tuple where the first element equals the key.
| key | The key to search for. |
| cs | Containers to zip (first container contains keys). |
Definition at line 1795 of file ah-stl-zip.H.
References stl_zip_it().
| bool Aleph::stl_zip_cmp | ( | Cmp && | cmp, |
| const Containers &... | cs | ||
| ) |
Compare elements across containers using a comparator.
For each position, checks if all elements from different containers satisfy the comparator pairwise. Useful for checking if multiple containers have equal elements at each position.
| cmp | Binary comparator (a, b) -> bool. |
| cs | Containers to compare (must have same element type). |
true if comparator holds for all adjacent pairs at all positions.Definition at line 1015 of file ah-stl-zip.H.
References cmp(), Aleph::stl_zip_detail::compare_adjacent_impl(), and stl_zip_it().
| int Aleph::stl_zip_compare | ( | const std::tuple< const Containers1 &... > & | cs1, |
| const std::tuple< const Containers2 &... > & | cs2 | ||
| ) |
Compare two zipped sequences lexicographically.
Uses default comparison (operator<) for elements at corresponding positions.
| Containers1 | Types of first set of containers. |
| Containers2 | Types of second set of containers. |
| cs1 | First set of containers (as tuple). |
| cs2 | Second set of containers (as tuple). |
Definition at line 1741 of file ah-stl-zip.H.
References and, and stl_zip_it().
| size_t Aleph::stl_zip_count | ( | Pred && | pred, |
| const Containers &... | cs | ||
| ) |
Count tuples satisfying predicate.
| pred | Predicate to test. |
| cs | Containers to zip. |
Definition at line 759 of file ah-stl-zip.H.
References count(), pred, and stl_zip_it().
| auto Aleph::stl_zip_drop | ( | const size_t | n, |
| const Containers &... | cs | ||
| ) |
Skip first n tuples, return the rest.
| n | Number of tuples to skip. |
| cs | Containers to zip. |
Definition at line 860 of file ah-stl-zip.H.
References and, and stl_zip_it().
| auto Aleph::stl_zip_drop_while | ( | Pred && | pred, |
| const Containers &... | cs | ||
| ) |
Skip tuples while predicate returns true, then return the rest.
Skips tuples from the beginning while the predicate is satisfied, then collects all remaining tuples.
| pred | Predicate (tuple) -> bool. |
| cs | Containers to zip. |
Definition at line 1218 of file ah-stl-zip.H.
References and, pred, and stl_zip_it().
| bool Aleph::stl_zip_equal | ( | const Containers &... | cs | ) |
Check equality of zipped sequences.
Two zipped sequences are equal if they have the same length and all corresponding tuples are equal (or satisfy the given predicate).
| cs | Containers to zip. |
true if sequences are equal.Definition at line 1697 of file ah-stl-zip.H.
References stl_zip_it().
| bool Aleph::stl_zip_equal_by | ( | Eq && | eq, |
| const Containers &... | cs | ||
| ) |
Check equality with custom comparator.
| eq | Equality predicate (tuple) -> bool. |
| cs | Containers to zip. |
true if all tuples satisfy eq AND containers have equal length.Definition at line 1717 of file ah-stl-zip.H.
References eq(), and stl_zip_it().
| bool Aleph::stl_zip_equal_length | ( | const Containers &... | cs | ) |
Check if all containers have equal length.
| cs | Containers to compare. |
true if all containers have the same size.Definition at line 796 of file ah-stl-zip.H.
References stl_zip_it().
| bool Aleph::stl_zip_exists | ( | Pred && | pred, |
| const Containers &... | cs | ||
| ) |
Check if predicate holds for any zipped tuple.
Returns true if at least one tuple satisfies the predicate. Short-circuits on first true.
This is similar to ML's exists or Haskell's any.
| pred | Predicate to test. |
| cs | Containers to zip. |
true if any tuple satisfies pred.Definition at line 536 of file ah-stl-zip.H.
References pred, and stl_zip_it().
Referenced by stl_zip_any(), stl_zip_none(), TEST(), TEST(), and TEST().
| auto Aleph::stl_zip_filter | ( | Pred && | pred, |
| const Containers &... | cs | ||
| ) |
Filter zipped tuples by predicate.
Selects tuples for which the predicate returns true.
| pred | Predicate (tuple) -> bool. |
| cs | Containers to zip. |
Definition at line 716 of file ah-stl-zip.H.
References pred, and stl_zip_it().
| auto Aleph::stl_zip_filteri | ( | Pred && | pred, |
| const Containers &... | cs | ||
| ) |
Filter with index (filteri in ML).
Filters tuples using a predicate that receives both index and tuple.
| pred | Predicate (size_t idx, tuple) -> bool. |
| cs | Containers to zip. |
Definition at line 1611 of file ah-stl-zip.H.
References pred, and stl_zip_it().
Referenced by TEST().
| auto Aleph::stl_zip_find_first | ( | Pred && | pred, |
| const Containers &... | cs | ||
| ) |
Find first tuple satisfying predicate.
| pred | Predicate to test. |
| cs | Containers to zip. |
Definition at line 738 of file ah-stl-zip.H.
References pred, and stl_zip_it().
| size_t Aleph::stl_zip_find_index | ( | Pred && | pred, |
| const Containers &... | cs | ||
| ) |
Find index of first tuple satisfying predicate.
| pred | Predicate to test. |
| cs | Containers to zip. |
Definition at line 1312 of file ah-stl-zip.H.
References pred, and stl_zip_it().
| auto Aleph::stl_zip_find_last | ( | Pred && | pred, |
| const Containers &... | cs | ||
| ) |
Find last tuple satisfying predicate.
| pred | Predicate to test. |
| cs | Containers to zip. |
Definition at line 1287 of file ah-stl-zip.H.
References Aleph::StlZipIterator< Containers >::get_curr(), pred, and stl_zip_it().
Referenced by TEST().
| auto Aleph::stl_zip_find_mapi | ( | Op && | op, |
| const Containers &... | cs | ||
| ) |
Find and map with index (find_mapi in ML).
Finds the first element where the function returns a non-empty optional.
| op | Callable (size_t idx, tuple) -> std::optional<R>. |
| cs | Containers to zip. |
Definition at line 1672 of file ah-stl-zip.H.
References stl_zip_it().
| auto Aleph::stl_zip_first | ( | const Containers &... | cs | ) |
Get first tuple from zipped containers.
| cs | Containers to zip. |
Definition at line 1249 of file ah-stl-zip.H.
References stl_zip_nth().
| T Aleph::stl_zip_foldl | ( | T | init, |
| Op && | op, | ||
| const Containers &... | cs | ||
| ) |
Left fold over zipped tuples.
Accumulates a value by applying a binary operation to the accumulator and each tuple, from left to right.
This is equivalent to ML's foldl or JavaScript's reduce.
| T | Accumulator type. |
| Op | Binary operation (T, tuple) -> T. |
| init | Initial accumulator value. |
| op | Binary operation. |
| cs | Containers to zip. |
Definition at line 648 of file ah-stl-zip.H.
References init, and stl_zip_it().
Referenced by stl_zip_reduce(), TEST(), TEST(), and TEST().
| void Aleph::stl_zip_for_each | ( | Op && | op, |
| const Containers &... | cs | ||
| ) |
Apply operation to each zipped tuple (for side effects).
Iterates over all zipped tuples, applying the callable to each. This is a side effect operation that returns void.
| op | Callable to apply to each tuple. |
| cs | Containers to zip. |
Definition at line 594 of file ah-stl-zip.H.
References stl_zip_it().
Referenced by TEST().
| void Aleph::stl_zip_for_each_indexed | ( | Op && | op, |
| const Containers &... | cs | ||
| ) |
Apply operation to each tuple with its index.
| op | Callable (size_t index, tuple) -> void. |
| cs | Containers to zip. |
Definition at line 610 of file ah-stl-zip.H.
References stl_zip_it().
Referenced by TEST().
|
constexpr |
Get a zip iterator over STL containers.
Similar to stl_zip() but returns an iterator directly instead of a view. Useful for algorithms that need explicit iterator control.
| cs | Containers to zip. |
Definition at line 440 of file ah-stl-zip.H.
Referenced by stl_zip_all(), stl_zip_all_eq(), stl_zip_assoc(), stl_zip_cmp(), stl_zip_compare(), stl_zip_count(), stl_zip_drop(), stl_zip_drop_while(), stl_zip_equal(), stl_zip_equal_by(), stl_zip_equal_length(), stl_zip_exists(), stl_zip_filter(), stl_zip_filteri(), stl_zip_find_first(), stl_zip_find_index(), stl_zip_find_last(), stl_zip_find_mapi(), stl_zip_foldl(), stl_zip_for_each(), stl_zip_for_each_indexed(), stl_zip_last(), stl_zip_length(), stl_zip_map(), stl_zip_mapi(), stl_zip_max(), stl_zip_mem(), stl_zip_min(), stl_zip_min_max(), stl_zip_nth(), stl_zip_partition(), stl_zip_scan_left(), stl_zip_sum(), stl_zip_take(), stl_zip_take_while(), stl_zip_to_vector(), stl_zip_traverse(), stl_zip_traverse_eq(), and TEST().
| auto Aleph::stl_zip_last | ( | const Containers &... | cs | ) |
Get last tuple from zipped containers.
| cs | Containers to zip. |
Definition at line 1266 of file ah-stl-zip.H.
References Aleph::StlZipIterator< Containers >::get_curr(), and stl_zip_it().
Referenced by TEST().
| size_t Aleph::stl_zip_length | ( | const Containers &... | cs | ) |
Count total tuples (minimum length of containers).
| cs | Containers to zip. |
Definition at line 778 of file ah-stl-zip.H.
References count(), and stl_zip_it().
Referenced by TEST().
| auto Aleph::stl_zip_map | ( | Op && | op, |
| const Containers &... | cs | ||
| ) |
Map operation over zipped tuples, returning a vector.
Applies a transformation to each tuple and collects results in a vector. The result type is automatically deduced from the transformation.
| op | Transformation (tuple) -> R. |
| cs | Containers to zip. |
Definition at line 692 of file ah-stl-zip.H.
References stl_zip_it().
| auto Aleph::stl_zip_mapi | ( | Op && | op, |
| const Containers &... | cs | ||
| ) |
Map with index (mapi in ML).
Applies a function that receives both the index and the tuple.
| op | Callable (size_t idx, tuple) -> R. |
| cs | Containers to zip. |
Definition at line 1586 of file ah-stl-zip.H.
References stl_zip_it().
Referenced by TEST().
| auto Aleph::stl_zip_max | ( | const Containers &... | cs | ) |
Get maximum tuple according to comparator.
| cs | Containers to zip. |
Definition at line 1845 of file ah-stl-zip.H.
References stl_zip_it().
Referenced by TEST().
| bool Aleph::stl_zip_mem | ( | const Tuple & | target, |
| const Containers &... | cs | ||
| ) |
Check if a tuple exists in the zipped sequence (mem in ML).
| target | The tuple to search for. |
| cs | Containers to zip. |
true if target is found.Definition at line 1774 of file ah-stl-zip.H.
References stl_zip_it().
Referenced by TEST().
| auto Aleph::stl_zip_min | ( | const Containers &... | cs | ) |
Get minimum tuple according to comparator.
| cs | Containers to zip. |
Definition at line 1815 of file ah-stl-zip.H.
References stl_zip_it().
Referenced by TEST().
| auto Aleph::stl_zip_min_max | ( | const Containers &... | cs | ) |
Get both min and max in a single pass.
| cs | Containers to zip. |
Definition at line 1875 of file ah-stl-zip.H.
References stl_zip_it().
| bool Aleph::stl_zip_none | ( | Pred && | pred, |
| const Containers &... | cs | ||
| ) |
Check if no tuple satisfies the predicate.
Returns true if the predicate returns false for all tuples. This is the complement of stl_zip_exists.
| pred | Predicate to test. |
| cs | Containers to zip. |
true if no tuple satisfies pred.Definition at line 565 of file ah-stl-zip.H.
References pred, and stl_zip_exists().
Referenced by TEST().
| auto Aleph::stl_zip_nth | ( | const size_t | n, |
| const Containers &... | cs | ||
| ) |
Get n-th tuple from zipped containers.
| n | Index (0-based). |
| cs | Containers to zip. |
Definition at line 815 of file ah-stl-zip.H.
References stl_zip_it().
Referenced by stl_zip_first(), TEST(), and TEST().
| auto Aleph::stl_zip_partition | ( | Pred && | pred, |
| const Containers &... | cs | ||
| ) |
Partition tuples by predicate.
Separates tuples into two groups: those satisfying the predicate and those that don't.
| pred | Predicate to partition by. |
| cs | Containers to zip. |
Definition at line 891 of file ah-stl-zip.H.
References pred, and stl_zip_it().
Referenced by TEST().
| T Aleph::stl_zip_reduce | ( | T | init, |
| Op && | op, | ||
| const Containers &... | cs | ||
| ) |
Alias for stl_zip_foldl (alternative name)
Definition at line 658 of file ah-stl-zip.H.
References init, and stl_zip_foldl().
Referenced by TEST().
| auto Aleph::stl_zip_scan_left | ( | T | init, |
| Op && | op, | ||
| const Containers &... | cs | ||
| ) |
Scan left (scan_left in ML) - fold with intermediate results.
Like foldl but returns all intermediate accumulator values.
| init | Initial value. |
| op | Binary operation (acc, tuple) -> acc. |
| cs | Containers to zip. |
Definition at line 1645 of file ah-stl-zip.H.
References init, and stl_zip_it().
| auto Aleph::stl_zip_sum | ( | const Containers &... | cs | ) |
Sum all tuples element-wise (requires + operator on tuple elements).
For numeric containers, computes the sum of each position.
| cs | Containers to zip. |
Definition at line 1909 of file ah-stl-zip.H.
References stl_zip_it(), and sum().
| auto Aleph::stl_zip_take | ( | const size_t | n, |
| const Containers &... | cs | ||
| ) |
Take first n tuples from zipped containers.
| n | Maximum number of tuples to take. |
| cs | Containers to zip. |
Definition at line 837 of file ah-stl-zip.H.
References and, count(), and stl_zip_it().
| auto Aleph::stl_zip_take_while | ( | Pred && | pred, |
| const Containers &... | cs | ||
| ) |
Take tuples while predicate returns true.
Collects tuples from the beginning while the predicate is satisfied. Stops at the first tuple where predicate returns false.
| pred | Predicate (tuple) -> bool. |
| cs | Containers to zip. |
Definition at line 1189 of file ah-stl-zip.H.
References Aleph::StlZipIterator< Containers >::get_curr(), pred, and stl_zip_it().
| auto Aleph::stl_zip_to_pairs | ( | const Container1 & | c1, |
| const Container2 & | c2 | ||
| ) |
Zip two containers into pairs.
| c1 | First container. |
| c2 | Second container. |
Definition at line 1302 of file ah-stl-functional.H.
References and.
| auto Aleph::stl_zip_to_vector | ( | const Containers &... | cs | ) |
Materialize zipped tuples into a vector.
Collects all zipped tuples into a std::vector. Use this when you need to iterate multiple times or pass the result to other functions.
| cs | Containers to zip. |
Definition at line 919 of file ah-stl-zip.H.
References stl_zip_it().
Referenced by TEST().
| bool Aleph::stl_zip_traverse | ( | Pred && | pred, |
| const Containers &... | cs | ||
| ) |
Traverse while predicate returns true.
Iterates over zipped tuples, calling the predicate for each. Stops early if predicate returns false.
| pred | Predicate (tuple) -> bool. |
| cs | Containers to zip. |
true if pred was true for all tuples, false if stopped early.Definition at line 947 of file ah-stl-zip.H.
References pred, and stl_zip_it().
| bool Aleph::stl_zip_traverse_eq | ( | Pred && | pred, |
| const Containers &... | cs | ||
| ) |
Traverse while predicate returns true, verify equal lengths.
| pred | Predicate (tuple) -> bool. |
| cs | Containers to zip. |
true if pred was true for all AND containers have equal length.Definition at line 966 of file ah-stl-zip.H.
References pred, and stl_zip_it().
| DynList< typename Container::Item_Type > Aleph::sublist | ( | const Container & | c, |
| size_t | pos, | ||
| const size_t | stride | ||
| ) |
Extract a sublist using a stride.
| c | Source container. |
| pos | Start position. |
| stride | Number of elements to skip between picks. |
Definition at line 650 of file ahFunctional.H.
References Aleph::DynList< T >::append(), and each().
| DynList< typename Container::Item_Type > Aleph::sublist | ( | const Container & | c, |
| size_t | stride | ||
| ) |
Overload of sublist from start.
Definition at line 671 of file ahFunctional.H.
References sublist().
| Subset_Sum_Result< T > Aleph::subset_sum | ( | const Array< T > & | values, |
| T | target | ||
| ) |
Solve the subset sum problem via classical DP with reconstruction.
Finds if there exists a subset of values that sums exactly to target. If it exists, the indices of the elements are returned.
| T | Integral type (must support comparison and addition). |
| [in] | values | Array of non-negative integers. |
| [in] | target | Target sum to achieve. |
| ah_domain_error | if target or any value is negative. |
| ah_bad_alloc | if memory allocation for the DP table fails. |
Definition at line 166 of file Subset_Sum.H.
References and, Aleph::Array< T >::append(), Aleph::Array< T >::create(), Aleph::subset_sum_detail::extract_values_checked(), k, Aleph::Array< T >::reserve(), row, Aleph::Array< T >::size(), and Aleph::subset_sum_detail::to_size_checked().
Referenced by main(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
Count the number of subsets that sum to target.
| T | Integral type. |
| [in] | values | Array of non-negative integers. |
| [in] | target | Target sum to achieve. |
std::numeric_limits<size_t>::max().| ah_domain_error | if target or any value is negative. |
Definition at line 282 of file Subset_Sum.H.
References and, count(), Aleph::Array< T >::create(), Aleph::subset_sum_detail::extract_values_checked(), Aleph::Array< T >::size(), and Aleph::subset_sum_detail::to_size_checked().
Referenced by main(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
Check if a subset summing to target exists (space-optimized).
Similar to subset_sum() but only checks for existence, using O(target) space.
| T | Integral type. |
| [in] | values | Array of non-negative integers. |
| [in] | target | Target sum to achieve. |
true if a subset summing to target exists, false otherwise.| ah_domain_error | if target or any value is negative. |
Definition at line 240 of file Subset_Sum.H.
References and, Aleph::Array< T >::create(), Aleph::subset_sum_detail::extract_values_checked(), Aleph::Array< T >::size(), and Aleph::subset_sum_detail::to_size_checked().
Referenced by main(), TEST(), TEST(), TEST(), TEST(), and TEST().
| Subset_Sum_Result< T > Aleph::subset_sum_mitm | ( | const Array< T > & | values, |
| T | target | ||
| ) |
Solve the subset sum problem via meet-in-the-middle (MITM).
This algorithm is efficient when the target sum is very large, making classical DP impractical, but the number of elements is small. It splits the input into two halves, enumerates all 2^(n/2) sums for each half, and uses sorting and binary search to find complementary pairs.
| T | Integral type. |
| [in] | values | Array of integers. |
| [in] | target | Target sum to achieve. |
| ah_out_of_range_error | if either half of the input would contain 64 or more elements (limited by 64-bit mask representation), which effectively restricts the total size to at most 127 elements. |
Definition at line 329 of file Subset_Sum.H.
References and, Aleph::Array< T >::append(), Aleph::subset_sum_detail::enumerate_sums(), introsort(), and Aleph::Array< T >::size().
Referenced by main(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
| std::pair< typename Net::Flow_Type, typename Net::Flow_Type > Aleph::successive_shortest_paths | ( | Net & | net | ) |
Compute minimum cost maximum flow using Successive Shortest Paths.
The SSP algorithm works by repeatedly:
This is equivalent to primal-dual method for min-cost flow.
With a floating flow, the arc that bounds a path is filled to its capacity exactly, and the residues of rounding that the paths leave go back at the end, as those of the maximum flows (see net_detail::return_dust()): every arc keeps its flow within [0, cap], and every node within the tolerance of check_node(), so that the network simplex takes the flow.
O(V * U * (E + V log V)) where U is the max flow value. Best when flow value is small.
| Net | Network type (must be Net_Cost_Graph or compatible). |
| [in,out] | net | Flow network with costs (flow values are modified in place). |
| std::domain_error | If the network does not have a single source and single sink, if the initial residual graph has a negative-cost cycle, wherever it is (via ssp_init_potentials): no path from the source cancels it, and the flow would not be of least cost; or if the maximum flow is infinite, as through a path from the source to the sink of arcs of infinite capacity, which has no cost to minimize: the paths of less cost may have been taken before it, and their flows go back. |
Definition at line 467 of file tpl_mincost.H.
References Aleph::net_detail::add_flow(), ah_domain_error_if, and, Aleph::Net_Graph< NodeT, ArcT >::flow_value(), GraphCommon< GT, Node, Arc >::get_num_arcs(), Aleph::Net_Graph< NodeT, ArcT >::get_sink(), Aleph::Net_Graph< NodeT, ArcT >::get_source(), Aleph::Net_Graph< NodeT, ArcT >::is_single_sink(), Aleph::Net_Graph< NodeT, ArcT >::is_single_source(), Aleph::Filter_Iterator< Container, It, Show_Item >::next_ne(), NODE_COOKIE, Aleph::net_detail::return_dust(), ssp_init_potentials(), ssp_shortest_path(), Aleph::net_detail::subtract_flow(), and GraphCommon< GT, Node, Arc >::vsize().
Referenced by Aleph::Successive_Shortest_Paths< Net >::operator()(), solve_assignment(), solve_transportation(), solve_transshipment(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST_F().
|
static |
Definition at line 513 of file tpl_binNodeUtils.H.
References Aleph::DynList< T >::append(), LLINK, RLINK, root(), and suffix().
Referenced by Aleph::Gen_Reroot_DP< GT, T, SA >::Gen_Reroot_DP(), demo_grouping(), export_variant(), Aleph::Prefix_Tree_Map< T >::Node::insert_suffix(), Aleph::CA::ca_checkpoint_detail::make_tmp_path(), mat_to_latex(), mat_to_latex(), mat_to_latex_simple(), Aleph::RTree< Payload, MaxEntries, MinEntries, Variant >::rstar_split(), suffix(), suffix(), TEST(), TEST_F(), and TYPED_TEST_P().
|
inline |
Build suffix array with doubling algorithm.
Uses two-pass counting sort per doubling phase, achieving O(n) per phase and O(n log n) total.
| [in] | text | Input text. |
sa where sa[i] is the start index of the i-th suffix in lexicographic order.Definition at line 98 of file Suffix_Structures.H.
References counting_sort_indices(), Aleph::Array< T >::create(), k, and Aleph::Array< T >::size().
Referenced by main(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
Compute sum of all elements.
| container | Source container. |
| init | Starting value (defaults to T{}). |
Definition at line 2357 of file ahFunctional.H.
References sum().
Referenced by __advance_to_leftmost_in_level(), __advance_to_rightmost_in_level(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::add(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::add(), Aleph::NTT< MOD, ROOT >::add_mod(), advance_to_leftmost_in_level(), advance_to_rightmost_in_level(), Aleph::howard_detail::best_cycle_exactly(), Aleph::RevisedSimplex< T >::btran(), Aleph::Bellman_Ford< GT, Distance, Ait, NAit, SA >::check_finite(), Aleph::FFT< Real >::choose_remez_extrema(), compute_maximum_weight_general_matching(), compute_minimum_cost_general_matching(), Aleph::negative_cycles_detail::cycle_cost(), Aleph::CA::ca_ising_detail::delta_energy(), demo_dynarray(), demo_fold_reduce(), demo_folding(), demo_matrix_arithmetic(), demo_perm_predicates(), demo_practical(), demo_traverse(), demo_vector_arithmetic(), demonstrate_functional(), demonstrate_functional_features(), example_parallel_aggregations(), example_parallel_building_blocks(), example_parallel_fold(), example_parallel_zip(), Moved_From_Case< Dense_Cell_Storage< int, 2 > >::fingerprint(), Moved_From_Case< Entropy >::fingerprint(), Moved_From_Case< Ghost_Grid >::fingerprint(), Moved_From_Case< Graph_Lattice< int > >::fingerprint(), Aleph::Bounded_Cycle_Index< GT >::for_each_cycle_below(), Aleph::RevisedSimplex< T >::ftran(), Aleph::Net_Graph< NodeT, ArcT >::get_in_cap(), Aleph::Net_Graph< NodeT, ArcT >::get_in_flow(), Aleph::Net_Graph< NodeT, ArcT >::get_out_cap(), Aleph::Net_Graph< NodeT, ArcT >::get_out_flow(), Aleph::Triangle::incenter(), Aleph::howard_detail::karp_by_component(), Aleph::Bellman_Ford< GT, Distance, Ait, NAit, SA >::last_relax_and_prepare_check_negative_cycle(), Aleph::Bellman_Ford< GT, Distance, Ait, NAit, SA >::last_relax_and_test_negative_cycle(), Aleph::Bounded_Cycle_Index< GT >::look_at(), main(), main(), Aleph::FFT< Real >::Plan::mixed_radix_transform_recursive(), Aleph::FFT< Real >::modified_bessel_i0(), monte_carlo_simulation(), Aleph::CA::Reproductions::morans_i_binary(), Aleph::Net_Graph< NodeT, ArcT >::nodes_tolerance(), Aleph::RevisedSimplex< T >::objective_value(), Aleph::Simplex< T >::objetive_value(), Aleph::negative_cycles_detail::Short_Cycle_Best< Cost_Type >::offer(), Aleph::CA::Totalistic_Rule< F >::operator()(), partial_sum(), partial_sum(), Aleph::Polygon::perimeter(), Aleph::negative_cycles_detail::Short_Cycle_Best< Cost_Type >::plain_sum(), Aleph::Bellman_Ford< GT, Distance, Ait, NAit, SA >::relax_arcs(), Aleph::Bellman_Ford< GT, Distance, Ait, NAit, SA >::relax_arcs(), Aleph::Bellman_Ford< GT, Distance, Ait, NAit, SA >::relaxes(), Aleph::Polygon::signed_area(), Aleph::GeomPolygonUtils::signed_double_area(), Aleph::RevisedSimplex< T >::solve(), Aleph::FFT< Real >::solve_dense_system(), HashStats< HashTbl >::stats(), Aleph::ODhashTable< Key, Cmp >::stats(), Aleph::OLhashTable< Key, Cmp >::stats(), stl_sum(), stl_zip_sum(), sum(), sum(), Aleph::Bounded_Cycle_Index< GT >::sum_at(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), Aleph::MCF_Graph< NodeT, ArcT >::total_cost(), Aleph::multi_poly_detail::total_degree(), Aleph::MCF_Arc< Arc_Info, FT >::total_flow(), Aleph::FlowDecomposition< Net >::total_flow(), Aleph::Net_Graph< NodeT, ArcT >::total_sink_in_flow(), Aleph::Net_Graph< NodeT, ArcT >::total_source_out_flow(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST_P(), TYPED_TEST_P(), uni_sum(), Aleph::Simplex< T >::verify_solution(), and Aleph::Johnson< GT, Distance, Ait, NAit, SA >::wide_potentials().
| auto Aleph::sum | ( | const Container & | data | ) | -> std::decay_t<decltype(*std::begin(data))> |
Compute the sum of elements.
| data | Input container |
Definition at line 172 of file stat_utils.H.
References sum().
|
inlinenoexcept |
Definition at line 758 of file hash-fct.H.
References seed, and SuperFastHash().
|
inlinenoexcept |
Definition at line 617 of file hash-fct.H.
References seed, and SuperFastHash().
|
inlinenoexcept |
Definition at line 838 of file hash-fct.H.
References seed, and SuperFastHash().
Generic swap using object's swap method.
Default template calls t1.swap(t2) for class types.
| T | Type with swap() method |
| t1 | First object |
| t2 | Second object |
Definition at line 123 of file ahTypes.H.
Referenced by ArcHeap< GT, Distance, Access_Heap_Node >::ArcHeap(), Aleph::DynBinHeap< T, Compare >::DynBinHeap(), Aleph::DynHashTable< Key, HashTable, Cmp >::DynHashTable(), Aleph::Simplex< T >::Simplex(), in_place_multisort_arrays(), DataGenerator::nearly_sorted(), ArcHeap< GT, Distance, Access_Heap_Node >::operator=(), Aleph::DynHashTable< Key, HashTable, Cmp >::operator=(), Aleph::DynBinHeap< T, Compare >::operator=(), Aleph::DynHashTable< Key, HashTable, Cmp >::operator=(), Aleph::Gen_Centroid_Decomposition< GT, SA >::operator=(), Aleph::Gen_Fenwick_Tree< T, Plus, Minus >::operator=(), Aleph::Simplex< T >::operator=(), run_performance_comparison(), Aleph::Gen_Fenwick_Tree< T, Plus, Minus >::swap_operations(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), test_all_constructors_agree(), test_bitwise_and_stress(), test_bitwise_or_stress(), test_double_stress(), TEST_F(), test_gcd_stress(), test_max_cross_validation(), test_min_cross_validation(), test_perf_queries(), test_performance_queries(), test_stress_double_sum(), test_stress_max_small(), test_stress_min_medium(), test_stress_min_small(), test_stress_product_small(), test_stress_sum_large(), test_stress_sum_small(), test_xor_stress(), and TYPED_TEST().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Swap elements between two ranges.
Swaps elements in the range [beg1, end1) with corresponding elements starting at beg2.
| Itor1 | First range iterator type. |
| Itor2 | Second range iterator type. |
| beg1 | Iterator to the first element of the first range. |
| end1 | Iterator past the last element of the first range. |
| beg2 | Iterator to the first element of the second range. |
Definition at line 686 of file ahAlgo.H.
Referenced by TEST().
|
extern |
Write a message to syslog.
| format | Printf-style format string. |
| ap | Variable argument list. |
|
inline |
Materialize enumerated zipped tuples into a DynList.
Each tuple includes the index as its last element.
| cs | Containers to zip. |
Definition at line 1442 of file ah-zip.H.
References Aleph::DynList< T >::append(), and get_enum_zip_it().
Referenced by demo_enum_zip(), main(), and TEST_F().
|
inline |
Materialize enumerated zipped tuples; throw if containers differ in length.
| cs | Containers to zip. |
| std::length_error | if container sizes mismatch. |
Definition at line 1461 of file ah-zip.H.
References ah_length_error_if, Aleph::DynList< T >::append(), and get_enum_zip_it().
|
inline |
Unzip a list of tuples into a tuple of lists.
| tuples | Input list of tuples. |
Definition at line 1491 of file ah-zip.H.
References t_unzip_impl().
Referenced by demo_tuple_operations(), main(), TEST(), TEST(), and TEST_F().
|
inlinestatic |
Definition at line 1475 of file ah-zip.H.
References LocateFunctions< Container, Type >::get_it(), and l.
Referenced by t_unzip().
|
inline |
Materialize zipped tuples into a DynList.
Collects all zipped tuples into a DynList. This is useful when you need to store the zipped result for later use or multiple iterations. Iterates over the minimum length of all containers.
| Cs | Container types. |
| cs | Containers to zip together. |
Definition at line 1174 of file ah-zip.H.
References Aleph::DynList< T >::append(), and zip_it().
Referenced by demo_practical_example(), demo_tuple_operations(), demo_zip_utilities(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST_F().
|
inline |
Materialize zipped tuples; throw if containers differ in length.
| cs | Containers to zip. |
| std::length_error | if container sizes mismatch. |
Definition at line 1193 of file ah-zip.H.
References ah_length_error_if, Aleph::DynList< T >::append(), and zip_it().
Referenced by demo_length_checking(), and TEST_F().
|
inline |
Return elements while predicate is true (take_while).
| c | Source container. |
| pred | Predicate to test. |
Definition at line 2422 of file ahFunctional.H.
References Aleph::DynList< T >::append(), and pred.
Referenced by demo_grouping(), TEST(), and TEST().
Test the black height condition for a red-black tree.
| p | root of tree |
| max | reference to store the black height |
| bh | current black height |
Definition at line 95 of file rbNodeRk.H.
References and, BLACK, COLOR, LLINK, max(), RLINK, and test_black_condition_rk().
Referenced by is_red_black_rk(), and test_black_condition_rk().
| std::pair< bool, size_t > Aleph::test_sorted | ( | const Container< T > & | cont, |
| const Compare & | cmp = Compare() |
||
| ) |
Test if a container is sorted, returning the inversion position.
Similar to is_sorted() but returns additional information about where the ordering test failed or how many elements were checked.
Time complexity: O(n), where n is the container size.
| Container | Template container type. |
| T | Element type stored in the container. |
| Compare | Comparison functor type (default: Aleph::less<T>). |
| cont | The container to test. |
| cmp | Comparison functor defining "less than" relationship. |
first is true if sorted, false if an inversion exists.second is the index where the test failed (if not sorted), or the total number of elements (if sorted).Definition at line 290 of file tpl_sort_utils.H.
References cmp(), Aleph::Const_Iterator< It >::get_curr(), Aleph::Const_Iterator< It >::has_curr(), and Aleph::Const_Iterator< It >::next_ne().
|
inline |
Creates a style for drawing filled polygons.
This style is used for representing areas, like polygon intersections or Voronoi cells. It enables filling and sets an opacity for visualization.
| draw_color | The stroke color for the polygon boundary. |
| fill_color | The fill color for the polygon's interior. |
| opacity | The opacity of the fill (0.0 to 1.0). |
Definition at line 390 of file tikzgeom_algorithms.H.
References Aleph::Tikz_Style::draw_color, Aleph::Tikz_Style::fill, Aleph::Tikz_Style::fill_color, and Aleph::Tikz_Style::opacity.
Referenced by main(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Creates a solid wireframe style with an explicit line width.
Used to visually distinguish a "result" outline (e.g. a simplified, offset, or smoothed polygon) from a faded original, without relying on dashed. tikz_wire_style(color, width) would silently set dashed instead (its second parameter is a bool), which is why this exists.
| color | The stroke color. |
| width_mm | Line width in millimeters (see Tikz_Style::line_width_mm). |
Definition at line 373 of file tikzgeom_algorithms.H.
References color(), Aleph::Tikz_Style::line_width_mm, and tikz_wire_style().
|
inline |
Creates a style optimized for polyline paths.
This style is intended for highlighting paths, such as the result of a shortest-path algorithm. It defaults to a thick, solid line.
| color | The path color. |
| with_arrow | Whether to add an arrowhead to the path segments. |
Definition at line 355 of file tikzgeom_algorithms.H.
References color(), Aleph::Tikz_Style::thick, tikz_wire_style(), and with_arrow.
Referenced by main().
|
inline |
Creates a style optimized for point clouds.
Generates a Tikz_Style where points are drawn as small filled circles. The draw and fill colors are set to the same value.
| color | The color for the points. |
| opacity | The opacity for the points (0.0 to 1.0). -1 means default. |
put_points. Definition at line 320 of file tikzgeom_algorithms.H.
References color(), Aleph::Tikz_Style::draw_color, Aleph::Tikz_Style::fill_color, and Aleph::Tikz_Style::opacity.
Referenced by main(), main(), put_funnel_trace_step(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Creates a style optimized for wireframe segments and polygons.
| color | The stroke color. |
| dashed | Whether to use a dashed line style. |
| with_arrow | Whether to add an arrowhead to segments. |
Definition at line 336 of file tikzgeom_algorithms.H.
References color(), Aleph::Tikz_Style::dashed, Aleph::Tikz_Style::draw_color, Aleph::Tikz_Style::with_arrow, and with_arrow.
Referenced by main(), main(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), tikz_bold_wire_style(), and tikz_path_style().
Timsort for Array.
| T | Element type. |
| Compare | Comparison functor (default: Aleph::less<T>). |
| [in,out] | a | Array to sort. |
| [in] | cmp | Comparison functor. |
Definition at line 7051 of file tpl_sort_utils.H.
References cmp(), Aleph::Array< T >::size(), and timsort().
Timsort for DynArray.
| T | Element type. |
| Compare | Comparison functor (default: Aleph::less<T>). |
| [in,out] | a | DynArray to sort. |
| [in] | cmp | Comparison functor. |
Definition at line 7032 of file tpl_sort_utils.H.
Timsort for DynDlist.
| T | Element type. |
| Compare | Comparison functor (default: Aleph::less<T>). |
| [in,out] | list | DynDlist to sort. |
| [in] | cmp | Comparison functor. |
Definition at line 7110 of file tpl_sort_utils.H.
Timsort for DynList.
| T | Element type. |
| Compare | Comparison functor (default: Aleph::less<T>). |
| [in,out] | list | DynList to sort. |
| [in] | cmp | Comparison functor. |
Definition at line 7088 of file tpl_sort_utils.H.
| void Aleph::timsort | ( | T * | a, |
| const long | l, | ||
| const long | r, | ||
| const Compare & | cmp = Compare() |
||
| ) |
Timsort on a sub-range [l, r] (inclusive indices).
| T | Element type. |
| Compare | Comparison functor (default: Aleph::less<T>). |
| [in,out] | a | Pointer to the array. |
| [in] | l | Left index (inclusive). |
| [in] | r | Right index (inclusive). |
| [in] | cmp | Comparison functor. |
Delegate to the shared implementation over the [l, r] sub-range.
Definition at line 7006 of file tpl_sort_utils.H.
References ah_invalid_argument_if, ah_range_error_if, cmp(), l, r, and Aleph::timsort_detail::timsort_impl().
| void Aleph::timsort | ( | T * | a, |
| const size_t | n, | ||
| const Compare & | cmp = Compare() |
||
| ) |
Timsort — adaptive, stable, natural merge sort.
Timsort is a hybrid sorting algorithm derived from merge sort and insertion sort. It identifies existing ordered subsequences (runs) in the data and merges them efficiently. This makes it particularly fast for real-world data that often contains pre-existing order.
| T | Element type (must be move-assignable). |
| Compare | Comparison functor (default: Aleph::less<T>). |
| [in,out] | a | Pointer to the array to sort. |
| [in] | n | Number of elements. |
| [in] | cmp | Comparison functor. |
| std::invalid_argument | if a is null and n > 0. |
Delegate to the shared run-detection-and-merge implementation.
Definition at line 6979 of file tpl_sort_utils.H.
References ah_invalid_argument_if, cmp(), and Aleph::timsort_detail::timsort_impl().
Referenced by bucket_sort(), lazy_permutations(), Aleph::Kruskal_Min_Spanning_Tree< GT, Distance, SA >::paint_min_spanning_tree(), Aleph::FlatMap< Key, T, Compare >::sort_and_unique(), Aleph::FlatSet< Key, Compare >::sort_and_unique(), Aleph::planarity_detail::LR_Planarity_Checker< GT, SA >::sort_by(), timsort(), timsort(), timsort(), timsort(), and timsort().
| void Aleph::timsort | ( | T(&) | a[N], |
| const Compare & | cmp = Compare() |
||
| ) |
Timsort for fixed-size C arrays.
| T | Element type. |
| N | Array size. |
| Compare | Comparison functor (default: Aleph::less<T>). |
| [in,out] | a | The array to sort. |
| [in] | cmp | Comparison functor. |
Definition at line 7070 of file tpl_sort_utils.H.
|
inline |
Return tuples of (index, key).
Definition at line 1494 of file ahFunctional.H.
References Tuple.
Referenced by TEST_F().
| Array< typename C::Item_Type > Aleph::to_Array | ( | const C & | c | ) |
Convert a container to an Array.
Creates a new Array containing copies of all elements from the given container. The container must provide a get_it() method that returns an iterator with has_curr(), next_ne(), and get_curr() methods.
| C | The container type. Must expose Item_Type and provide a compatible iterator interface. |
| c | The source container. |
Definition at line 168 of file ah-convert.H.
References Aleph::Array< T >::append().
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and to_array().
| Array< typename C::Item_Type > Aleph::to_array | ( | const C & | c | ) |
Convenience wrapper identical to to_Array (copy contents).
Accepts any Aleph container with Item_Type and get_it().
Definition at line 181 of file ah-convert.H.
References to_Array().
Referenced by benchmark_contiguous_array(), demonstrate_complexity(), TEST(), and TEST().
Convert a std::vector to an Array.
| T | Element type. |
| v | Source vector. |
Definition at line 155 of file ah-stl-utils.H.
References Aleph::Array< T >::append().
|
inline |
Return the number of whole days represented by t.
Definition at line 131 of file ah-date.H.
References ah_domain_error_if, and Aleph::detail::seconds_per_day.
Referenced by TEST().
| std::deque< typename C::Item_Type > Aleph::to_deque | ( | const C & | c | ) |
Convert a container to a std::deque.
Creates a new std::deque containing copies of all elements from the given Aleph-w container.
| C | The container type. Must expose Item_Type and provide a compatible iterator interface. |
| c | The source container. |
Definition at line 326 of file ah-convert.H.
| DynArray< typename C::Item_Type > Aleph::to_DynArray | ( | const C & | c | ) |
Convert a container to a DynArray.
Creates a new DynArray containing copies of all elements from the given container. The container must provide a get_it() method that returns an iterator with has_curr(), next_ne(), and get_curr().
| C | The container type. Must expose Item_Type and provide a compatible iterator interface. |
| c | The source container. |
Definition at line 265 of file ah-convert.H.
References Aleph::DynArray< T >::append().
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
Convert an Array to a DynList.
Creates a new DynList containing copies of all elements from the given Array.
| T | The element type. |
| a | The source Array. |
Definition at line 148 of file ah-convert.H.
Referenced by demo_integration(), demo_map_transformations(), demo_vector_dynlist(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Definition at line 2086 of file htlist.H.
Referenced by TEST(), TEST(), TEST(), TYPED_TEST_P(), TYPED_TEST_P(), TYPED_TEST_P(), TYPED_TEST_P(), and TYPED_TEST_P().
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Alias for vector_to_DynList.
Accepts the same parameters.
| T | Element type. |
Definition at line 122 of file ah-stl-utils.H.
References vector_to_DynList().
| DynSetTree< typename C::Item_Type > Aleph::to_DynSetTree | ( | const C & | c | ) |
Convert a container to a DynSetTree (AVL by default).
Creates a new DynSetTree containing unique elements from the given container.
| C | The container type. Must expose Item_Type. |
| c | The source container. |
Definition at line 983 of file ah-convert.H.
References Aleph::DynSetTree< Key, Tree, Compare >::insert().
Referenced by TEST().
|
inline |
Convert a std::string to lower-case (byte-wise).
| [in] | str | Input std::string. |
Definition at line 626 of file ah-string-utils.H.
|
inline |
Uppercase the first character of str and return the resulting copy.
| [in] | str | Input std::string. |
Definition at line 652 of file ah-string-utils.H.
Referenced by demo_case_conversion(), and TEST().
|
inline |
Convert an identifier-like std::string to PascalCase.
Splits on the delimiter set " _-" and uppercases the first character of each token.
| [in] | str | Input std::string. |
Definition at line 806 of file ah-string-utils.H.
References FunctionalMethods< Container, T >::foldl(), FunctionalMethods< Container, T >::mutable_for_each(), split_to_list(), and toupper().
Referenced by demo_case_conversion(), and TEST().
| std::set< typename C::Item_Type > Aleph::to_set | ( | const C & | c | ) |
Convert a container to a std::set.
Creates a new std::set containing copies of all unique elements from the given Aleph-w container. Duplicates are automatically removed.
| C | The container type. Must expose Item_Type. |
| c | The source container. |
Definition at line 661 of file ah-convert.H.
References Aleph::DynArray< T >::insert().
|
inline |
Definition at line 729 of file tpl_array.H.
|
inline |
Convert double to a std::string with maximum round-trip precision.
Uses std::numeric_limits<double>::max_digits10.
| [in] | d | Value to format. |
Definition at line 296 of file ah-string-utils.H.
References to_string().
Referenced by main(), Aleph::Dft_Write< Node >::operator()(), ProcessWriter::operator()(), Aleph::Matrix< Trow, Tcol, NumType >::print(), TEST(), Aleph::Matrix< Trow, Tcol, NumType >::to_str(), and Aleph::AlDomain< T >::to_str().
Convert an Aleph::Array<T> to a comma-separated std::string.
| T | Element type streamable to std::ostream. |
| [in] | v | Array to stringify. |
v is empty). Definition at line 105 of file ah-string-utils.H.
References LocateFunctions< Container, Type >::get_it().
|
inline |
Format a double using fixed notation with the given precision.
| [in] | d | Value to format. |
| [in] | precision | Number of digits after the decimal point. |
Definition at line 281 of file ah-string-utils.H.
Convert a matrix of strings to a single std::string.
Rows are concatenated as-is and separated by newlines.
| [in] | mat | Input matrix. |
Definition at line 1036 of file ah-string-utils.H.
References FunctionalMethods< Container, T >::for_each(), and row.
|
inline |
Join lines into a single std::string separated by newlines.
| [in] | lines | Lines to join. |
"\n" separators. Definition at line 1079 of file ah-string-utils.H.
References LocateFunctions< Container, Type >::get_it(), and Aleph::DynList< T >::get_last().
Convert a std::vector<T> to a comma-separated std::string.
| T | Element type streamable to std::ostream. |
| [in] | v | Vector to stringify. |
v is empty). Definition at line 86 of file ah-string-utils.H.
|
inline |
Format a time_t value into a string using format.
Definition at line 140 of file ah-date.H.
References ah_range_error_if, and ah_runtime_error_if.
Referenced by OHashTest< HashTbl >::OHashTest(), align_text_to_left_except_first(), build_complete_graph(), build_crown_graph(), build_grid_network(), build_random_graph(), build_random_graph(), build_tree_graph(), color_legend(), demo_algorithm_comparison(), demo_conversion(), demo_density(), demo_dirac(), demo_erdos_renyi(), demo_folding(), demo_map_filter(), demo_map_transformations(), demo_text_processor(), demo_transformation(), demo_transformations(), demo_variadic_dispatcher(), destroy_mutex(), example_spfa_comparison(), generate_random_graph(), init_mutex(), justify_line_except_first(), FloydIntGraphTest::latex_temp_filename(), main(), nonplanar_certificate_to_dot(), nonplanar_certificate_to_json(), on_temp_up(), TestIndexFormatter< Mat >::operator()(), TestPathFormatter< Mat >::operator()(), TestDistFormatter< Mat >::operator()(), WriteNode::operator()(), Write::operator()(), parse_graph_definition(), print_dewey_view(), run_modern_example(), ParseUtilsTest::SetUp(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), test(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), test_performance_sw(), to_str(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST_P(), and write_coloring_dot().
|
inline |
Convert a (day, month, year) triple to a POSIX time_t value.
Definition at line 92 of file ah-date.H.
References ah_domain_error_if, Aleph::detail::max_supported_year, Aleph::detail::tm_epoch_year, and valid_day().
Referenced by TEST(), TEST(), TEST(), TEST(), and to_time_t().
|
inline |
Convenience overload for ISO strings (YYYY-MM-DD HH:MM:SS).
Definition at line 125 of file ah-date.H.
References to_time_t().
|
inline |
Convert a formatted string to time_t using the provided format.
Definition at line 113 of file ah-date.H.
References ah_domain_error_if.
|
inline |
Convert a std::string to upper-case (byte-wise).
| [in] | str | Input std::string. |
Definition at line 639 of file ah-string-utils.H.
Referenced by TEST().
| std::vector< typename C::Item_Type > Aleph::to_vector | ( | const C & | c | ) |
Convert a container to a std::vector.
Creates a new std::vector containing copies of all elements from the given container, in the order of its iterator. The container is traversed with get_it() if it has it, as the Aleph-w containers do, and with a range-based for loop otherwise.
| C | The container type. Must expose Item_Type and either get_it(), whose iterator has has_curr(), next_ne() and get_curr(), or begin() and end(). |
| c | The source container. |
Definition at line 72 of file ah-convert-common.H.
Referenced by demo_integration(), demo_vector_dynlist(), other_unit_to_vector(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Convert TokenType to string for debugging.
Definition at line 1518 of file parse_utils.H.
References CHAR, COMMENT, END_OF_FILE, FLOAT, IDENTIFIER, INTEGER, KEYWORD, OPERATOR, PUNCTUATION, STRING, token_type_to_string(), and UNKNOWN.
Referenced by TEST(), Aleph::Token::to_string(), and token_type_to_string().
|
inline |
Convert a C std::string to lower-case.
| [in] | str | Null-terminated input std::string. |
Definition at line 306 of file ah-string-utils.H.
Referenced by demo_case_conversion(), demo_practical(), demo_text_processor(), TEST(), TEST(), and tolower().
|
inline |
Convert a std::string to lower-case.
| [in] | str | Input std::string. |
Definition at line 332 of file ah-string-utils.H.
References tolower().
|
inline |
Convert a C std::string to upper-case.
| [in] | str | Null-terminated input std::string. |
Definition at line 319 of file ah-string-utils.H.
Referenced by demo_case_conversion(), demo_text_processor(), TEST(), TEST(), to_Pascalcase(), and toupper().
|
inline |
Convert a std::string to upper-case.
| [in] | str | Input std::string. |
Definition at line 342 of file ah-string-utils.H.
References toupper().
|
inline |
Transform elements using a binary operation.
Applies op to corresponding elements from two ranges and stores the result starting at destBeg.
| Itor1 | First source iterator type. |
| Itor2 | Second source iterator type. |
| Itor3 | Destination iterator type. |
| BinaryFunc | Transformation function type. |
| source1Beg | Iterator to the first element of the first source. |
| source1End | Iterator past the last element of the first source. |
| source2Beg | Iterator to the first element of the second source. |
| destBeg | Iterator to the first destination position. |
| op | Binary operation to apply. |
|
inline |
Transform elements using a unary operation.
Applies op to each element in [sourceBeg, sourceEnd) and stores the result in the range starting at destBeg.
| Itor1 | Source iterator type. |
| Itor2 | Destination iterator type. |
| UnaryFunc | Transformation function type. |
| sourceBeg | Iterator to the first source element. |
| sourceEnd | Iterator past the last source element. |
| destBeg | Iterator to the first destination position. |
| op | Unary operation to apply. |
Transform each element of a tuple, returning a new tuple.
Creates a new tuple by applying a transformation function to each element of the input tuple. The result types are deduced from the return type of the transformation applied to each element. Uses std::index_sequence for compile-time iteration.
| Op | Transformation callable type. |
| Tuple | Input tuple type. |
| op | Transformation to apply to each element. |
| t | Input tuple. |
Definition at line 1951 of file ah-zip.H.
References Aleph::zip_index_detail::transform_tuple_impl().
|
inline |
*/
Transpose a matrix represented as a list of lists.
Given a matrix \(M\), returns \(M^T\). The input is expected to be rectangular (all rows with the same length).
| T | Element type. |
l is empty, an empty matrix is returned. Definition at line 250 of file ah-comb.H.
References Aleph::Array< T >::append(), Aleph::DynList< T >::append(), LocateFunctions< Container, Type >::get_it(), Aleph::HTList::is_empty(), l, row, Aleph::Array< T >::size(), and size().
Referenced by demo_transpose(), test(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Convenience overload accepting an rvalue callable.
Definition at line 465 of file ah-comb.H.
References l, and traverse_perm().
|
inline |
*/
Traverse the Cartesian product of a list of lists.
Given a list of lists \(L = \{l_1, l_2, \dots, l_n\}\), this function generates all possible sequences \(\{a_1, a_2, \dots, a_n\}\)where each \(a_i \in l_i\).
For each generated sequence, it invokes op(sequence).
| T | Element type. |
| Op | Callable signature: bool op(const DynList<T> &). |
| [in] | l | A DynList containing multiple DynLists of elements. |
| [in] | op | Callback function. If it returns false, traversal stops. |
true if all sequences were traversed; false if op aborted.Definition at line 443 of file ah-comb.H.
References LocateFunctions< Container, Type >::get_it(), l, and Aleph::DynList< T >::rev().
Referenced by all_perm(), demo_traverse(), exists_perm(), fold_perm(), for_each_perm(), test(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and traverse_perm().
| Array< size_t > Aleph::tree_max_distance | ( | const GT & | g, |
| typename GT::Node * | root, | ||
| SA | sa = SA() |
||
| ) |
Compute the maximum distance from each node to any leaf.
Uses rerooting DP to compute the eccentricity (max distance) for every node.
| [in] | g | The graph (tree). |
| [in] | root | Root node. |
| [in] | sa | Arc filter. |
Definition at line 767 of file Tree_DP.H.
References Aleph::Array< T >::create(), root(), Aleph::Gen_Reroot_DP< GT, T, SA >::size(), and Aleph::Gen_Reroot_DP< GT, T, SA >::values().
Referenced by main(), TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), and TYPED_TEST().
| Array< size_t > Aleph::tree_subtree_sizes | ( | const GT & | g, |
| typename GT::Node * | root, | ||
| SA | sa = SA() |
||
| ) |
Compute subtree sizes for every node.
| [in] | g | The graph (tree). |
| [in] | root | Root node. |
| [in] | sa | Arc filter. |
Definition at line 732 of file Tree_DP.H.
References Aleph::Array< T >::create(), root(), Aleph::Gen_Tree_DP< GT, T, SA >::size(), and Aleph::Gen_Tree_DP< GT, T, SA >::values().
Referenced by main(), TEST(), TEST(), TEST(), TEST(), TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), and TYPED_TEST().
| Array< size_t > Aleph::tree_sum_of_distances | ( | const GT & | g, |
| typename GT::Node * | root, | ||
| SA | sa = SA() |
||
| ) |
Compute sum of distances from each node to all others.
Uses rerooting DP with (count, sum_dist) pairs.
| [in] | g | The graph (tree). |
| [in] | root | Root node. |
| [in] | sa | Arc filter. |
Definition at line 805 of file Tree_DP.H.
References Aleph::Array< T >::create(), root(), Aleph::Gen_Reroot_DP< GT, T, SA >::size(), and Aleph::Gen_Reroot_DP< GT, T, SA >::values().
Referenced by main(), TEST(), TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), and TYPED_TEST().
|
inline |
Return a trimmed copy of a std::string (leading + trailing whitespace removed).
| [in] | s | Input std::string. |
s. Definition at line 244 of file ah-string-utils.H.
References ltrim(), rtrim(), and trim().
Referenced by csv_trim_fields(), demo_practical(), demo_trimming(), TEST(), TEST(), TEST(), TEST(), and trim().
|
inline |
Trim a std::string in-place (leading + trailing whitespace removed).
| [in,out] | s | String to modify. |
s. Definition at line 257 of file ah-string-utils.H.
References ltrim(), and rtrim().
Referenced by TEST().
|
inline |
Try to match a character without throwing.
Checks if the next non-whitespace character matches. If it does, consumes it and returns true. Otherwise, returns false without consuming anything.
| input_stream | The input file stream |
| ch | The character to try to match |
Definition at line 1328 of file parse_utils.H.
References mark_position(), read_char_from_stream(), restore_position(), skip_white_spaces(), and try_char().
Referenced by TEST_F(), TEST_F(), and try_char().
|
inline |
Separate a list of tuples into two containers.
The inverse of tzip(). Takes a container of 2-tuples and produces two separate containers with the first and second elements respectively.
| Container | Container template type. |
| T1 | Type of first tuple elements. |
| T2 | Type of second tuple elements. |
| l | Source container of tuples. |
Definition at line 1437 of file ahFunctional.H.
References Aleph::DynList< T >::append(), LocateFunctions< Container, Type >::get_it(), l, l1, and l2.
Referenced by TEST_F().
|
inline |
Convenience overload that automatically generates the index sequence.
| F | Callable type. |
| Ts | Types in the tuple. |
| tuple | The tuple to iterate over. |
| func | Function to apply to each element. |
Definition at line 105 of file ah-stl-utils.H.
References tuple_for_each().
|
inline |
Apply a function to each element in a tuple (tuple first).
Iterates over all elements in a tuple and applies the given function to each one.
| F | Callable type. |
| Ts | Types in the tuple. |
| Is | Index sequence. |
| tuple | The tuple to iterate over. |
| func | Function to apply to each element. |
Definition at line 85 of file ah-stl-utils.H.
Referenced by demo_tuple_conversions(), TEST(), TEST(), TEST(), TEST(), and tuple_for_each().
|
inline |
Convert a tuple to an Array.
| T | First element type (determines array element type). |
| U | Remaining element types (must all be T). |
| t | Source tuple. |
Definition at line 350 of file ah-stl-utils.H.
Referenced by demo_tuple_conversions(), and TEST().
Convert a tuple to an Aleph-w container.
Converts all elements of a homogeneous tuple to the specified container type.
| Container | Target container type (must support build_container). |
| T | First element type (determines container element type). |
| U | Remaining element types (must all be T). |
| t | Source tuple. |
Definition at line 319 of file ah-stl-utils.H.
|
inline |
Convert a tuple to a DynList.
| T | First element type (determines list element type). |
| U | Remaining element types (must all be T). |
| t | Source tuple. |
Definition at line 335 of file ah-stl-utils.H.
Referenced by demo_tuple_conversions(), TEST(), TEST(), and TEST().
|
inline |
Zip two containers into a list of tuples.
Like zip() but returns tuples instead of pairs. Tuples provide better integration with structured bindings and tuple utilities.
| Container1 | Type of the first container. |
| Container2 | Type of the second container. |
| a | First container. |
| b | Second container. |
Definition at line 1067 of file ahFunctional.H.
References and, Aleph::DynList< T >::append(), LocateFunctions< Container, Type >::get_it(), and Tuple.
Referenced by TEST_F().
|
inline |
Zip two containers into tuples, padding the shorter one.
Like zip_longest() but returns tuples instead of pairs. This provides better integration with structured bindings and tuple utilities.
| Container1 | Type of the first container. |
| Container2 | Type of the second container. |
| a | First container. |
| b | Second container. |
| fill_a | Value to use when container a is exhausted. |
| fill_b | Value to use when container b is exhausted. |
Definition at line 2878 of file ahFunctional.H.
References and, Aleph::DynList< T >::append(), LocateFunctions< Container, Type >::get_it(), and Tuple.
Referenced by TEST().
| auto Aleph::tzip_std | ( | const Cs &... | cs | ) |
Build a vector of tuples from 2 or more STL containers (variadic).
Works with any STL-compatible containers that have begin(), end(), and value_type. Stops at the shortest container.
Example:
Definition at line 1615 of file ah-zip.H.
References Aleph::std_zip_detail::advance_all(), Aleph::std_zip_detail::all_valid(), and Aleph::std_zip_detail::deref_all().
Referenced by demo_stl_compatibility(), std_zip_n(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Zip two containers into tuples; throw if lengths differ.
Like tzip() but verifies that both containers have equal length. Throws std::length_error if container sizes don't match.
| Container1 | Type of the first container. |
| Container2 | Type of the second container. |
| a | First container. |
| b | Second container. |
| std::length_error | if container sizes mismatch. |
Definition at line 1144 of file ahFunctional.H.
References ah_length_error_if, and, Aleph::DynList< T >::append(), LocateFunctions< Container, Type >::get_it(), and Tuple.
Referenced by TEST_F().
|
inlineconstexpr |
Map a binary heap index to the index of its parent.
For 1-based heaps, u_index(i) returns i/2.
| [in] | i | Node index. |
Definition at line 204 of file ahUtils.H.
Referenced by Aleph::arrayheap_detail::sift_up(), TEST(), Aleph::arrayheap_detail::undo_sift_down(), Aleph::dynarrayheap_detail::up_index(), and valid_heap().
| Aleph::unexpected | ( | E | ) | -> unexpected< E > |
| bool Aleph::uni_all | ( | Pred && | pred, |
| const Container & | c | ||
| ) |
Check if all elements satisfy predicate.
| pred | Predicate (element) -> bool. |
| c | Container. |
true if all elements satisfy predicate. Definition at line 404 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator(), and pred.
Referenced by demo_predicates(), main(), TEST(), and TEST().
| bool Aleph::uni_any | ( | Pred && | pred, |
| const Container & | c | ||
| ) |
Alias for uni_exists.
Definition at line 452 of file ah-uni-functional.H.
References pred, and uni_exists().
Referenced by demo_predicates().
| int Aleph::uni_compare | ( | const Container1 & | c1, |
| const Container2 & | c2 | ||
| ) |
Compare two containers lexicographically.
Efficiently compares containers element-by-element without materializing intermediate vectors. Handles all combinations of STL and Aleph containers.
| c1 | First container. |
| c2 | Second container. |
Definition at line 1535 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator(), and and.
Referenced by TEST().
| auto Aleph::uni_concat | ( | const Container1 & | c1, |
| const Container2 & | c2 | ||
| ) |
Concatenate two containers.
| c1 | First container. |
| c2 | Second container. |
Definition at line 1177 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator().
| size_t Aleph::uni_count | ( | Pred && | pred, |
| const Container & | c | ||
| ) |
Count elements satisfying predicate.
| pred | Predicate (element) -> bool. |
| c | Container. |
Definition at line 609 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator(), count(), and pred.
Referenced by demo_predicates(), and TEST().
Remove all duplicates (keeps first occurrence).
Uses linear search for all containers since we cannot assume hashability or consistent ordering across STL and Aleph containers.
| c | Container. |
Definition at line 1310 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator().
Drop first n elements, return the rest.
| n | Number of elements to skip. |
| c | Container. |
Definition at line 702 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator(), and count().
Referenced by demo_slicing(), and TEST().
| auto Aleph::uni_drop_while | ( | Pred && | pred, |
| const Container & | c | ||
| ) |
Drop elements while predicate is true, return the rest.
| pred | Predicate (element) -> bool. |
| c | Container. |
Definition at line 776 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator(), and, and pred.
Referenced by demo_slicing(), and TEST().
| bool Aleph::uni_equal | ( | const Container1 & | c1, |
| const Container2 & | c2 | ||
| ) |
Check equality of two containers.
Efficiently compares containers element-by-element without materializing intermediate vectors. Handles all combinations of STL and Aleph containers.
| c1 | First container. |
| c2 | Second container. |
true if containers have same elements in same order. Definition at line 1475 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator(), and and.
| bool Aleph::uni_exists | ( | Pred && | pred, |
| const Container & | c | ||
| ) |
Check if any element satisfies predicate.
| pred | Predicate (element) -> bool. |
| c | Container. |
true if any element satisfies predicate. Definition at line 432 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator(), and pred.
Referenced by demo_predicates(), main(), TEST(), TEST(), uni_any(), and uni_none().
| auto Aleph::uni_filter | ( | Pred && | pred, |
| const Container & | c | ||
| ) |
Filter elements satisfying predicate.
| pred | Predicate (element) -> bool. |
| c | Container. |
Definition at line 269 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator(), and pred.
Referenced by demo_conversion(), demo_map_filter(), main(), TEST(), TEST(), TEST(), TEST(), and TEST().
| auto Aleph::uni_filteri | ( | Pred && | pred, |
| const Container & | c | ||
| ) |
Filter with index (filteri in ML).
| pred | Predicate (size_t idx, element) -> bool. |
| c | Container. |
Definition at line 301 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator(), and pred.
Referenced by demo_map_filter(), and TEST().
| auto Aleph::uni_find | ( | Pred && | pred, |
| const Container & | c | ||
| ) |
Find first element satisfying predicate.
| pred | Predicate (element) -> bool. |
| c | Container. |
Definition at line 482 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator(), and pred.
Referenced by demo_access(), and TEST().
| std::optional< size_t > Aleph::uni_find_index | ( | Pred && | pred, |
| const Container & | c | ||
| ) |
Find index of first element satisfying predicate.
| pred | Predicate (element) -> bool. |
| c | Container. |
Definition at line 512 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator(), and pred.
Referenced by TEST().
| auto Aleph::uni_find_mapi | ( | Op && | op, |
| const Container & | c | ||
| ) |
Find and map with index (find_mapi in ML).
| op | Callable (size_t idx, element) -> std::optional<R>. |
| c | Container. |
Definition at line 545 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator().
Get first element.
| c | Container. |
Definition at line 821 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator().
Referenced by demo_access(), TEST(), TEST(), TEST(), and TEST().
| auto Aleph::uni_flat_map | ( | Op && | op, |
| const Container & | c | ||
| ) |
Flat map - map then flatten.
Definition at line 1255 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator().
Flatten a container of containers.
| c | Container of containers. |
Definition at line 1209 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator().
Left fold (foldl) - reduce from left to right.
| init | Initial accumulator value. |
| op | Binary operation (acc, element) -> acc. |
| c | Container. |
Definition at line 335 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator(), and init.
Referenced by demo_fold_reduce(), demo_statistics(), demo_unified_api(), main(), TEST(), TEST(), TEST(), TEST(), TEST(), and uni_reduce().
| void Aleph::uni_for_each | ( | Op && | op, |
| const Container & | c | ||
| ) |
Apply operation to each element (for_each).
Works with both STL and Aleph containers.
Definition at line 164 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator().
Referenced by TEST().
| void Aleph::uni_for_each_indexed | ( | Op && | op, |
| const Container & | c | ||
| ) |
Apply operation to each element with index.
| op | Callable (size_t idx, element) -> void. |
| c | Container. |
Definition at line 184 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator().
| auto Aleph::uni_group_by | ( | Key && | key, |
| const Container & | c | ||
| ) |
Group elements by key function.
| key | Key extractor (element) -> K. |
| c | Container. |
Definition at line 1342 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator(), and k.
Get last element.
| c | Container. |
Definition at line 850 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator().
Referenced by demo_access(), TEST(), and TEST().
Get container length.
| c | Container. |
Definition at line 638 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator(), and count().
Referenced by demo_access(), demo_practical(), demo_statistics(), and TEST().
Map operation - transform each element.
| op | Callable (element) -> R. |
| c | Container. |
Definition at line 206 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator().
Referenced by demo_conversion(), demo_map_filter(), demo_unified_api(), main(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
Map with index (mapi in ML).
| op | Callable (size_t idx, element) -> R. |
| c | Container. |
Definition at line 237 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator().
Referenced by demo_map_filter(), and TEST().
Get maximum element.
| c | Container. |
Definition at line 962 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator().
Referenced by demo_practical(), demo_statistics(), TEST(), and TEST().
Check if element exists in container (mem in ML).
| target | Element to search for. |
| c | Container. |
true if target is found. Definition at line 578 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator().
Referenced by demo_predicates(), and TEST().
Get minimum element.
| c | Container. |
Definition at line 916 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator().
Referenced by demo_statistics(), main(), TEST(), and TEST().
Get both min and max in a single pass.
| c | Container. |
Definition at line 1008 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator().
Referenced by demo_statistics(), and TEST().
| bool Aleph::uni_none | ( | Pred && | pred, |
| const Container & | c | ||
| ) |
Check if no element satisfies predicate.
Definition at line 463 of file ah-uni-functional.H.
References pred, and uni_exists().
Referenced by demo_predicates().
Get n-th element.
| n | Index (0-based). |
| c | Container. |
Definition at line 879 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator().
Referenced by demo_access(), and TEST().
| auto Aleph::uni_partition | ( | Pred && | pred, |
| const Container & | c | ||
| ) |
Partition elements by predicate.
| pred | Predicate (element) -> bool. |
| c | Container. |
Definition at line 1132 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator(), and pred.
Referenced by demo_slicing(), and TEST().
Product of all elements.
| c | Container of numeric values. |
Definition at line 1090 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator().
Referenced by demo_fold_reduce(), and TEST().
Alias for uni_foldl.
Definition at line 351 of file ah-uni-functional.H.
References init, and uni_foldl().
Scan left - fold with all intermediate results.
| init | Initial value. |
| op | Binary operation (acc, element) -> acc. |
| c | Container. |
Definition at line 367 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator(), and init.
Referenced by TEST().
Sum all elements.
| c | Container of numeric values. |
Definition at line 1063 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator(), and sum().
Referenced by demo_fold_reduce(), demo_practical(), main(), and TEST().
Take first n elements.
| n | Number of elements to take. |
| c | Container. |
Definition at line 667 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator(), and, and count().
Referenced by demo_slicing(), main(), and TEST().
| auto Aleph::uni_take_while | ( | Pred && | pred, |
| const Container & | c | ||
| ) |
Take elements while predicate is true.
| pred | Predicate (element) -> bool. |
| c | Container. |
Definition at line 737 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator(), and pred.
Referenced by demo_slicing(), and TEST().
Count occurrences of each element (frequency count).
| c | Container. |
Definition at line 1390 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator().
Convert container to std::vector.
Definition at line 1438 of file ah-uni-functional.H.
References Aleph::uni_functional_detail::aleph_iterator().
Referenced by demo_conversion(), demo_practical(), and TEST().
Unzip a container of pairs into two DynLists.
Works with any container (STL or Aleph) containing pairs. Returns DynList since this is for mixed container scenarios.
| c | Container of pairs to unzip. |
Definition at line 1331 of file ah-zip-utils.H.
References Aleph::DynList< T >::append(), and value.
Unzip a container of tuples into a tuple of DynLists.
Works with any container (STL or Aleph) containing tuples. Returns tuple of DynLists since this is for mixed container scenarios.
| c | Container of tuples to unzip. |
Definition at line 1399 of file ah-zip-utils.H.
References Aleph::uni_unzip_detail::append_tuple_elements(), and value.
| auto Aleph::uni_zip | ( | const Containers &... | cs | ) |
Create a lazy zip view over any combination of STL/Aleph containers.
| cs | Containers to zip (any mix of STL and Aleph). |
Definition at line 557 of file ah-zip-utils.H.
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
| bool Aleph::uni_zip_all | ( | Pred && | pred, |
| const Containers &... | cs | ||
| ) |
Check if predicate holds for all zipped tuples.
| pred | Predicate (tuple) -> bool. |
| cs | Containers to zip (STL or Aleph). |
true if pred is true for all tuples.Definition at line 593 of file ah-zip-utils.H.
References pred, and uni_zip_it().
Referenced by demo_predicates(), TEST(), TEST(), and TEST().
| bool Aleph::uni_zip_all_eq | ( | Pred && | pred, |
| const Containers &... | cs | ||
| ) |
Check if all tuples satisfy predicate AND containers have equal length.
Definition at line 609 of file ah-zip-utils.H.
References pred, and uni_zip_it().
Referenced by TEST().
| bool Aleph::uni_zip_any | ( | Pred && | pred, |
| const Containers &... | cs | ||
| ) |
Alias for uni_zip_exists.
Definition at line 641 of file ah-zip-utils.H.
References pred, and uni_zip_exists().
| auto Aleph::uni_zip_assoc | ( | const Key & | key, |
| const Containers &... | cs | ||
| ) |
Find value associated with key in zipped pairs (assoc in ML).
| key | The key to search for. |
| cs | Containers to zip (first container contains keys). |
Definition at line 1193 of file ah-zip-utils.H.
References Aleph::UniZipIterator< Containers >::get_curr(), and uni_zip_it().
Referenced by TEST().
| size_t Aleph::uni_zip_count | ( | Pred && | pred, |
| const Containers &... | cs | ||
| ) |
Count tuples satisfying predicate.
Definition at line 802 of file ah-zip-utils.H.
References count(), pred, and uni_zip_it().
Referenced by TEST().
| auto Aleph::uni_zip_drop | ( | size_t | n, |
| const Containers &... | cs | ||
| ) |
Skip first n tuples, return the rest.
Definition at line 886 of file ah-zip-utils.H.
References uni_zip_it().
Referenced by demo_utilities(), TEST(), and TEST().
| auto Aleph::uni_zip_drop_while | ( | Pred && | pred, |
| const Containers &... | cs | ||
| ) |
Skip tuples while predicate is true, return the rest.
Definition at line 931 of file ah-zip-utils.H.
References pred, and uni_zip_it().
| bool Aleph::uni_zip_equal_by | ( | Eq && | eq, |
| const Containers &... | cs | ||
| ) |
Check equality with custom comparator.
| eq | Equality predicate (tuple) -> bool. |
| cs | Containers to zip. |
true if all tuples satisfy eq AND containers have equal length.Definition at line 1153 of file ah-zip-utils.H.
References eq(), and uni_zip_it().
| bool Aleph::uni_zip_equal_length | ( | const Containers &... | cs | ) |
Check if all containers have equal length.
Definition at line 834 of file ah-zip-utils.H.
References uni_zip_it().
Referenced by demo_advanced(), TEST(), and TEST().
| bool Aleph::uni_zip_exists | ( | Pred && | pred, |
| const Containers &... | cs | ||
| ) |
Check if predicate holds for any zipped tuple.
| pred | Predicate (tuple) -> bool. |
| cs | Containers to zip. |
true if any tuple satisfies pred.Definition at line 630 of file ah-zip-utils.H.
References pred, and uni_zip_it().
Referenced by demo_predicates(), TEST(), uni_zip_any(), and uni_zip_none().
| auto Aleph::uni_zip_filter | ( | Pred && | pred, |
| const Containers &... | cs | ||
| ) |
Filter zipped tuples by predicate.
| pred | Predicate (tuple) -> bool. |
| cs | Containers to zip. |
Definition at line 755 of file ah-zip-utils.H.
References pred, and uni_zip_it().
Referenced by demo_practical(), demo_transformations(), TEST(), TEST(), and TEST().
| auto Aleph::uni_zip_filteri | ( | Pred && | pred, |
| const Containers &... | cs | ||
| ) |
Filter with index (filteri in ML).
| pred | Predicate (size_t idx, tuple) -> bool. |
| cs | Containers to zip. |
Definition at line 1072 of file ah-zip-utils.H.
References pred, and uni_zip_it().
Referenced by TEST().
| auto Aleph::uni_zip_find_first | ( | Pred && | pred, |
| const Containers &... | cs | ||
| ) |
Find first tuple satisfying predicate.
| pred | Predicate to test. |
| cs | Containers to zip. |
Definition at line 781 of file ah-zip-utils.H.
References pred, and uni_zip_it().
Referenced by TEST().
| auto Aleph::uni_zip_find_mapi | ( | Op && | op, |
| const Containers &... | cs | ||
| ) |
Find and map with index (find_mapi in ML).
| op | Callable (size_t idx, tuple) -> std::optional<R>. |
| cs | Containers to zip. |
Definition at line 1126 of file ah-zip-utils.H.
References uni_zip_it().
Referenced by TEST().
| auto Aleph::uni_zip_first | ( | const Containers &... | cs | ) |
| T Aleph::uni_zip_foldl | ( | T | init, |
| Op && | op, | ||
| const Containers &... | cs | ||
| ) |
Left fold over zipped tuples.
| init | Initial value. |
| op | Binary operation (acc, tuple) -> acc. |
| cs | Containers to zip. |
Definition at line 705 of file ah-zip-utils.H.
References init, and uni_zip_it().
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), and uni_zip_reduce().
| void Aleph::uni_zip_for_each | ( | Op && | op, |
| const Containers &... | cs | ||
| ) |
Apply operation to each zipped tuple.
| op | Callable (tuple) -> void. |
| cs | Containers to zip. |
Definition at line 668 of file ah-zip-utils.H.
References uni_zip_it().
Referenced by demo_practical(), demo_predicates(), TEST(), TEST(), TEST(), TEST(), and TEST().
| void Aleph::uni_zip_for_each_indexed | ( | Op && | op, |
| const Containers &... | cs | ||
| ) |
Apply operation to each tuple with index.
| op | Callable (size_t idx, tuple) -> void. |
| cs | Containers to zip. |
Definition at line 685 of file ah-zip-utils.H.
References uni_zip_it().
| auto Aleph::uni_zip_it | ( | const Containers &... | cs | ) |
Get a unified zip iterator.
| cs | Containers to zip. |
Definition at line 573 of file ah-zip-utils.H.
Referenced by demo_advanced(), demo_mixed_containers(), TEST(), TEST(), TEST(), TEST(), uni_zip_all(), uni_zip_all_eq(), uni_zip_assoc(), uni_zip_count(), uni_zip_drop(), uni_zip_drop_while(), uni_zip_equal_by(), uni_zip_equal_length(), uni_zip_exists(), uni_zip_filter(), uni_zip_filteri(), uni_zip_find_first(), uni_zip_find_mapi(), uni_zip_foldl(), uni_zip_for_each(), uni_zip_for_each_indexed(), uni_zip_last(), uni_zip_length(), uni_zip_map(), uni_zip_mapi(), uni_zip_max(), uni_zip_mem(), uni_zip_min(), uni_zip_min_max(), uni_zip_nth(), uni_zip_partition(), uni_zip_scan_left(), uni_zip_take(), uni_zip_take_while(), uni_zip_to_dynlist(), uni_zip_to_vector(), and uni_zip_traverse().
| auto Aleph::uni_zip_last | ( | const Containers &... | cs | ) |
Get last tuple.
Definition at line 966 of file ah-zip-utils.H.
References Aleph::UniZipIterator< Containers >::get_curr(), and uni_zip_it().
Referenced by TEST().
| size_t Aleph::uni_zip_length | ( | const Containers &... | cs | ) |
Get zip length (minimum of all container sizes).
Definition at line 819 of file ah-zip-utils.H.
References count(), and uni_zip_it().
| auto Aleph::uni_zip_map | ( | Op && | op, |
| const Containers &... | cs | ||
| ) |
Map operation over zipped tuples.
| op | Transformation (tuple) -> R. |
| cs | Containers to zip. |
Definition at line 732 of file ah-zip-utils.H.
References uni_zip_it().
Referenced by demo_practical(), demo_transformations(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
| auto Aleph::uni_zip_mapi | ( | Op && | op, |
| const Containers &... | cs | ||
| ) |
Map with index (mapi in ML).
| op | Callable (size_t idx, tuple) -> R. |
| cs | Containers to zip (STL or Aleph). |
Definition at line 1048 of file ah-zip-utils.H.
References uni_zip_it().
Referenced by demo_transformations(), and TEST().
| auto Aleph::uni_zip_max | ( | const Containers &... | cs | ) |
Get maximum tuple.
| cs | Containers to zip. |
Definition at line 1246 of file ah-zip-utils.H.
References uni_zip_it().
Referenced by demo_utilities(), and TEST().
| bool Aleph::uni_zip_mem | ( | const Tuple & | target, |
| const Containers &... | cs | ||
| ) |
Check if a tuple exists in the zipped sequence (mem in ML).
| target | The tuple to search for. |
| cs | Containers to zip. |
true if target is found.Definition at line 1174 of file ah-zip-utils.H.
References uni_zip_it().
Referenced by TEST().
| auto Aleph::uni_zip_min | ( | const Containers &... | cs | ) |
Get minimum tuple.
| cs | Containers to zip. |
Definition at line 1216 of file ah-zip-utils.H.
References uni_zip_it().
Referenced by demo_utilities(), and TEST().
| auto Aleph::uni_zip_min_max | ( | const Containers &... | cs | ) |
Get both min and max in a single pass.
| cs | Containers to zip. |
Definition at line 1276 of file ah-zip-utils.H.
References uni_zip_it().
Referenced by TEST().
| bool Aleph::uni_zip_none | ( | Pred && | pred, |
| const Containers &... | cs | ||
| ) |
Check if no tuple satisfies the predicate.
Definition at line 653 of file ah-zip-utils.H.
References pred, and uni_zip_exists().
Referenced by demo_predicates().
| auto Aleph::uni_zip_nth | ( | size_t | n, |
| const Containers &... | cs | ||
| ) |
Get n-th tuple from zipped containers.
Definition at line 849 of file ah-zip-utils.H.
References uni_zip_it().
Referenced by TEST(), and uni_zip_first().
| auto Aleph::uni_zip_partition | ( | Pred && | pred, |
| const Containers &... | cs | ||
| ) |
Partition tuples by predicate.
Definition at line 983 of file ah-zip-utils.H.
References pred, and uni_zip_it().
| T Aleph::uni_zip_reduce | ( | T | init, |
| Op && | op, | ||
| const Containers &... | cs | ||
| ) |
Alias for uni_zip_foldl.
Definition at line 716 of file ah-zip-utils.H.
References init, and uni_zip_foldl().
| auto Aleph::uni_zip_scan_left | ( | T | init, |
| Op && | op, | ||
| const Containers &... | cs | ||
| ) |
Scan left - fold with intermediate results.
| init | Initial value. |
| op | Binary operation (acc, tuple) -> acc. |
| cs | Containers to zip. |
Definition at line 1100 of file ah-zip-utils.H.
References init, and uni_zip_it().
Referenced by demo_advanced(), and TEST().
| auto Aleph::uni_zip_take | ( | size_t | n, |
| const Containers &... | cs | ||
| ) |
Take first n tuples.
Definition at line 867 of file ah-zip-utils.H.
References count(), and uni_zip_it().
Referenced by demo_utilities(), TEST(), and TEST().
| auto Aleph::uni_zip_take_while | ( | Pred && | pred, |
| const Containers &... | cs | ||
| ) |
Take tuples while predicate is true.
Definition at line 908 of file ah-zip-utils.H.
References pred, and uni_zip_it().
| auto Aleph::uni_zip_to_dynlist | ( | const Containers &... | cs | ) |
Materialize a zipped view into a DynList of tuples.
Converts a lazy zip view into a concrete DynList.
| cs | Containers to zip (STL or Aleph). |
Definition at line 1432 of file ah-zip-utils.H.
References Aleph::DynList< T >::append(), and uni_zip_it().
Referenced by demo_conversion(), and TEST().
| auto Aleph::uni_zip_to_vector | ( | const Containers &... | cs | ) |
Materialize zipped tuples into a vector.
Definition at line 1007 of file ah-zip-utils.H.
References uni_zip_it().
Referenced by demo_conversion(), and TEST().
| bool Aleph::uni_zip_traverse | ( | Pred && | pred, |
| const Containers &... | cs | ||
| ) |
Traverse while predicate returns true.
Definition at line 1024 of file ah-zip-utils.H.
References pred, and uni_zip_it().
|
inline |
Return elements that appear exactly once across the container.
Definition at line 1084 of file tpl_dynSetHash.H.
References GenericItems< Container, T >::keys().
|
inline |
Remove consecutive duplicates in place.
Removes consecutive elements that compare equal according to the predicate by moving unique elements forward.
| Itor | Iterator type. |
| BinaryPredicate | Comparison predicate. |
| __first | Iterator to the first element. |
| __last | Iterator past the last element. |
| __binary_pred | Binary predicate for comparison. |
Definition at line 1058 of file ahAlgo.H.
References adjacent_find().
Referenced by generate_random_data(), hull_signature(), Aleph::HalfPlaneIntersection::operator()(), run_performance_comparison(), Aleph::AndrewMonotonicChainConvexHull::sorted_unique_points(), Aleph::GrahamScanConvexHull::sorted_unique_points(), TEST(), TEST(), TEST(), TEST_F(), and TEST_F().
|
inline |
Copy unique elements.
Copies elements from [first, last) to result, eliminating consecutive duplicates.
| In_Itor | Input iterator type. |
| Out_Itor | Output iterator type. |
| __first | Iterator to the first source element. |
| __last | Iterator past the last source element. |
| __result | Iterator to the first destination position. |
Definition at line 1006 of file ahAlgo.H.
Referenced by TEST().
|
inline |
Copy unique elements with custom comparison.
Copies elements from [first, last) to result, eliminating consecutive elements that compare equal according to the predicate.
| In_Itor | Input iterator type. |
| Out_Itor | Output iterator type. |
| BinaryPredicate | Comparison predicate. |
| __first | Iterator to the first source element. |
| __last | Iterator past the last source element. |
| __result | Iterator to the first destination position. |
| __binary_pred | Binary predicate for comparison. |
| std::pair< DynList< T >, size_t > Aleph::unique_sequential | ( | const Container< T > & | c, |
| Equal && | eq = Equal() |
||
| ) |
Overload of unique_sequential.
Definition at line 1705 of file ahFunctional.H.
References eq(), and unique_sequential().
| std::pair< DynList< T >, size_t > Aleph::unique_sequential | ( | const Container< T > & | c, |
| Equal & | eq | ||
| ) |
Extract unique consecutive items.
Removes consecutive duplicates from a container, keeping only the first element of each run of equal elements. Similar to Unix uniq command.
| c | Source container. |
| eq | Equality predicate for comparing elements. |
Definition at line 1675 of file ahFunctional.H.
References Aleph::DynList< T >::append(), count(), and eq().
Referenced by TEST(), and unique_sequential().
Separate a list of pairs into two lists.
The inverse of zip(). Takes a container of pairs and produces two separate containers with the first and second elements respectively.
| l | Source container of pairs. |
Definition at line 1394 of file ahFunctional.H.
References Aleph::DynList< T >::append(), Aleph::DynList< T >::get_first(), LocateFunctions< Container, Type >::get_it(), l, l1, and l2.
Referenced by demo_zipping(), and TEST_F().
|
inline |
Propagate residual arc flows back to their original arcs.
Definition at line 2223 of file tpl_net.H.
Referenced by TEST(), and TYPED_TEST().
|
inline |
Find upper bound in a sorted range.
Returns an iterator to the first element greater than value in the sorted range [beg, end).
| Itor | Forward iterator type. |
| T | Value type. |
| beg | Iterator to the first element. |
| end | Iterator past the last element. |
| value | Value to compare against. |
Definition at line 1239 of file ahAlgo.H.
Referenced by equal_range(), equal_range(), TEST(), and Aleph::Reservoir_Sampler< T >::update().
|
inline |
Find upper bound with custom comparison.
| Itor | Forward iterator type. |
| T | Value type. |
| BinaryPredicate | Comparison predicate. |
| beg | Iterator to the first element. |
| end | Iterator past the last element. |
| value | Value to compare against. |
| op | Binary comparison predicate. |
|
inlinenoexcept |
Check whether a given day exists for the supplied month/year.
Definition at line 77 of file ah-date.H.
References and, is_leap_year(), and valid_month().
Referenced by TEST(), and to_time_t().
| bool Aleph::valid_heap | ( | T * | array, |
| const size_t | l, | ||
| const size_t | r, | ||
| const Compare & | cmp = Compare() |
||
| ) |
Check whether a range satisfies the heap property.
| T | element type |
| Compare | comparator defining the heap order |
| [in] | array | 1-based array backing the heap |
| [in] | l | left boundary (inclusive) |
| [in] | r | right boundary (inclusive) |
| [in] | cmp | comparison criteria |
[l, r] satisfies the heap property under cmp Definition at line 402 of file tpl_arrayHeap.H.
References cmp(), l, l_index(), r, and u_index().
Referenced by is_min_heap(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inlinenoexcept |
Check whether the month number is within the [1, 12] range.
Definition at line 71 of file ah-date.H.
References and.
Referenced by valid_day().
|
inline |
Validates one lowered bytecode function structurally.
Definition at line 782 of file Bytecode.H.
References and, Aleph::DynArray< T >::append(), Binary, Aleph::Compiler_Bytecode_Detail::block_name(), Aleph::Compiler_Bytecode_Function::blocks, Branch, Call, Aleph::Compiler_Bytecode_Function::code, Aleph::Compiler_Bytecode_Detail::contains_pc(), Aleph::Compiler_Bytecode_Function::entry_pc, Aleph::Compiler_Bytecode_Validation_Report::errors, Aleph::Compiler_Bytecode_Function::exit_pc, Aleph::Compiler_SSA_Block::id, Jump, Load_Constant, Load_Function, Load_Global, Load_Local, message(), Aleph::Compiler_Bytecode_Function::name, Store_Global, Store_Local, Unary, and Aleph::Compiler_Bytecode_Validation_Report::valid.
Referenced by TEST(), TEST(), and validate_bytecode_module().
|
inline |
Validates all bytecode functions in one module.
Definition at line 900 of file Bytecode.H.
References Aleph::DynArray< T >::append(), Aleph::Compiler_Bytecode_Validation_Report::errors, Aleph::Compiler_Bytecode_Module::functions, merge(), Aleph::Compiler_Bytecode_Module::top_level, Aleph::Compiler_Bytecode_Validation_Report::valid, validate_bytecode_function(), and Aleph::Compiler_Bytecode_Validation_Report::warnings.
Referenced by Aleph::Compiler_Driver::lower_bytecode(), Aleph::Compiler_Generic_Driver::lower_bytecode(), main(), Aleph::Compiler_Bytecode_VM::module_is_valid(), and TEST().
|
inline |
Validates one lowered CFG function structurally.
The validator checks entry/exit IDs, terminator shapes, edge consistency, and reports unreachable blocks as warnings.
| function | CFG function to validate. |
Definition at line 704 of file Compiler_CFG.H.
References Aleph::DynArray< T >::access(), and, Aleph::DynArray< T >::append(), Aleph::Compiler_CFG_Detail::block_name(), Aleph::Compiler_CFG_Function::blocks, Branch, Aleph::Compiler_CFG_Detail::contains_block_id(), Aleph::Compiler_CFG_Function::entry_block, Aleph::Compiler_CFG_Validation_Report::errors, Exit, Aleph::Compiler_CFG_Function::exit_block, Aleph::Compiler_SSA_Block::id, Aleph::DynArray< T >::is_empty(), Jump, Aleph::Compiler_SSA_Terminator::kind, Aleph::Compiler_CFG_Function::name, None, Aleph::DynArray< T >::pop(), pred, Aleph::Compiler_SSA_Block::predecessors, Return, Aleph::DynArray< T >::size(), Aleph::Compiler_SSA_Terminator::successors, Aleph::Compiler_SSA_Block::terminator, Unreachable, Aleph::Compiler_CFG_Validation_Report::valid, and Aleph::Compiler_CFG_Validation_Report::warnings.
Referenced by TEST(), TEST(), TEST(), and validate_cfg_module().
|
inline |
Validates all CFGs in a lowered module.
| module | CFG module to validate. |
Definition at line 846 of file Compiler_CFG.H.
References Aleph::DynArray< T >::append(), Aleph::Compiler_CFG_Validation_Report::errors, Aleph::Compiler_CFG_Module::functions, merge(), Aleph::Compiler_CFG_Module::top_level, Aleph::Compiler_CFG_Validation_Report::valid, validate_cfg_function(), and Aleph::Compiler_CFG_Validation_Report::warnings.
|
inline |
Validates structural invariants of a dataflow result against its source function.
| function | IR function that was analysed. |
| analysis | Result produced by analyze_dataflow_function() for function. |
Definition at line 1206 of file Compiler_Dataflow.H.
References Aleph::DynArray< T >::access(), and, Aleph::DynArray< T >::append(), Aleph::Compiler_Dataflow_Function_Analysis::assigned_in_slots, Aleph::Compiler_Dataflow_Function_Analysis::assigned_out_slots, Aleph::Compiler_IR_Detail::block_name(), Aleph::Compiler_IR_Function::blocks, Aleph::Compiler_Dataflow_Function_Analysis::constant_in_slots, Aleph::Compiler_Dataflow_Function_Analysis::constant_out_slots, Aleph::Compiler_IR_Function::entry_block, Aleph::Compiler_Dataflow_Validation_Report::errors, Aleph::Compiler_Dataflow_Function_Analysis::live_in_slots, Aleph::Compiler_Dataflow_Function_Analysis::live_out_slots, Aleph::Compiler_IR_Function::local_slots, message(), Aleph::Compiler_IR_Function::name, Aleph::Compiler_Dataflow_Function_Analysis::reachable_blocks, Aleph::DynArray< T >::size(), Aleph::Compiler_Dataflow_Function_Analysis::uninitialized_reads, and Aleph::Compiler_Dataflow_Validation_Report::valid.
|
inline |
Validates the result of dead-code elimination.
Checks that the optimised function has valid IR, that no foldable branches remain, and (when a module is provided) that global slot counts are consistent.
| result | DCE result produced by eliminate_dead_code(). |
| module | Optional IR module used to validate global-slot consistency; pass nullptr to skip module-level checks. |
Definition at line 1601 of file Compiler_Dataflow.H.
References Aleph::DynArray< T >::access(), analyze_dataflow_function(), and, Aleph::DynArray< T >::append(), Aleph::Compiler_IR_Detail::block_name(), Aleph::Compiler_IR_Function::blocks, Branch, compiler_ir_invalid_id(), Aleph::Compiler_Dataflow_Detail::compute_reachability(), Aleph::Compiler_SSA_Terminator::condition_value, Aleph::Compiler_Dataflow_Validation_Report::errors, Aleph::Compiler_IR_Function::exit_block, Aleph::Compiler_Dead_Code_Elimination_Result::function, Aleph::Compiler_Dataflow_Detail::instruction_is_trivially_dead(), Aleph::Compiler_SSA_Block::instructions, Aleph::Compiler_SSA_Terminator::kind, Load, Aleph::Compiler_IR_Function::local_slots, Aleph::Compiler_Dataflow_Detail::mark_value_used(), message(), Aleph::Compiler_IR_Function::name, Aleph::Compiler_IR_Function::next_value_id, Return, Aleph::Compiler_SSA_Terminator::return_value, Store, Aleph::Compiler_SSA_Block::terminator, Aleph::Compiler_Dataflow_Validation_Report::valid, validate_ir_function(), and Aleph::Compiler_Dataflow_Validation_Report::warnings.
Referenced by main(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Validates one lowered IR function structurally.
Definition at line 376 of file Compiler_IR_Model.H.
References Aleph::DynArray< T >::access(), and, Aleph::DynArray< T >::append(), Binary, Aleph::Compiler_IR_Detail::block_name(), Aleph::Compiler_IR_Function::blocks, Branch, Call, compiler_ir_invalid_id(), Aleph::Compiler_SSA_Terminator::condition_value, Constant, Aleph::Compiler_IR_Function::entry_block, Aleph::Compiler_IR_Validation_Report::errors, Exit, Aleph::Compiler_IR_Function::exit_block, Function_Ref, Aleph::Compiler_SSA_Block::id, Aleph::Compiler_SSA_Block::instructions, Aleph::DynArray< T >::is_empty(), Jump, Aleph::Compiler_SSA_Terminator::kind, Load, Aleph::Compiler_IR_Function::local_slots, Aleph::Compiler_IR_Function::name, None, Aleph::DynArray< T >::pop(), Return, Aleph::Compiler_SSA_Terminator::return_value, Aleph::DynArray< T >::size(), Aleph::Compiler_SSA_Terminator::successors, Aleph::Compiler_SSA_Block::terminator, Unary, Unreachable, Aleph::Compiler_IR_Validation_Report::valid, and Aleph::Compiler_IR_Validation_Report::warnings.
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), validate_dead_code_elimination(), and validate_ir_module().
|
inline |
Validates all functions in one lowered IR module.
Definition at line 513 of file Compiler_IR_Model.H.
References Aleph::DynArray< T >::append(), Aleph::Compiler_IR_Validation_Report::errors, Aleph::Compiler_IR_Module::functions, merge(), Aleph::Compiler_IR_Module::top_level, Aleph::Compiler_IR_Validation_Report::valid, validate_ir_function(), and Aleph::Compiler_IR_Validation_Report::warnings.
Referenced by Aleph::Compiler_Driver::lower_ir(), Aleph::Compiler_Line_Frontend::lower_ir(), Aleph::Compiler_MVP_Frontend::lower_ir(), main(), TEST(), TEST(), TEST(), and Aleph::Compiler_C_Backend::Emitter::validate_input().
|
inline |
Validates one SSA function structurally and semantically.
Definition at line 996 of file SSA.H.
References Aleph::DynArray< T >::access(), and, Aleph::DynArray< T >::append(), Aleph::Compiler_SSA_Detail::block_name(), Aleph::Compiler_SSA_Function::blocks, compiler_ssa_invalid_id(), Aleph::Compiler_SSA_Terminator::condition_value, Aleph::Compiler_SSA_Function::dominance, Aleph::Compiler_SSA_Dominance_Info::dominance_frontiers, Aleph::Compiler_SSA_Dominance_Info::dominator_tree_children, Aleph::Compiler_SSA_Dominance_Info::dominators, Aleph::Compiler_SSA_Function::entry_block, Aleph::Compiler_SSA_Validation_Report::errors, Aleph::Compiler_SSA_Function::exit_block, Aleph::Compiler_SSA_Block::id, Aleph::Compiler_SSA_Dominance_Info::immediate_dominators, Aleph::Compiler_SSA_Block::instructions, Aleph::Compiler_SSA_Terminator::kind, Aleph::Compiler_SSA_Function::local_slots, message(), Aleph::Compiler_SSA_Function::name, Aleph::Compiler_SSA_Function::next_value_id, Aleph::Compiler_SSA_Function::parameters, Aleph::Compiler_SSA_Block::phis, Aleph::Compiler_SSA_Block::predecessors, Aleph::Compiler_SSA_Dominance_Info::reachable_blocks, Aleph::Compiler_SSA_Terminator::return_value, Aleph::DynArray< T >::size(), Aleph::Compiler_SSA_Block::terminator, Aleph::Compiler_SSA_Validation_Report::valid, Aleph::Compiler_SSA_Parameter::value_id, and Aleph::Compiler_SSA_Detail::value_name().
Referenced by TEST(), TEST(), TEST(), and validate_ssa_module().
|
inline |
Validates all functions in one SSA module.
Definition at line 1231 of file SSA.H.
References Aleph::DynArray< T >::append(), Aleph::Compiler_SSA_Validation_Report::errors, Aleph::Compiler_SSA_Module::functions, merge(), Aleph::Compiler_SSA_Module::top_level, Aleph::Compiler_SSA_Validation_Report::valid, validate_ssa_function(), and Aleph::Compiler_SSA_Validation_Report::warnings.
Referenced by main().
|
inline |
Convert a variadic parameter pack to a DynList.
| T | Target element type. |
| Args | Argument types (must be convertible to T). |
| args | Arguments to pack into a DynList. |
Definition at line 210 of file ah-stl-utils.H.
|
inline |
Convert a variadic parameter pack to a std::vector.
| T | Target element type. |
| Args | Argument types (must be convertible to T). |
| args | Arguments to pack into a vector. |
Definition at line 195 of file ah-stl-utils.H.
| auto Aleph::variance | ( | const Container & | data, |
| bool | population = false |
||
| ) | -> std::decay_t<decltype(*std::begin(data))> |
Compute variance using Welford's numerically stable algorithm.
This algorithm avoids numerical instability that can occur with the traditional formula when dealing with large values or values close to each other.
| data | Input container |
| population | If true, compute population variance (divide by n); if false (default), compute sample variance (divide by n-1) |
| std::invalid_argument | if container has fewer than 2 elements (sample) or is empty (population) |
Definition at line 220 of file stat_utils.H.
References ah_invalid_argument_if, m, and variance().
Referenced by compute_all_stats(), demo_practical(), monte_carlo_simulation(), stddev(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), and variance().
Convert a std::vector to an Array.
Creates a new Array containing copies of all elements from the given std::vector.
| T | The element type. |
| v | The source std::vector. |
Definition at line 240 of file ah-convert.H.
References Aleph::Array< T >::append(), and Aleph::Array< T >::reserve().
Convert a std::vector to an Array using move semantics.
Creates a new Array by moving all elements from the given std::vector. After conversion, the source vector's elements are in a valid but unspecified state.
| T | The element type. |
| v | The source std::vector (rvalue reference). |
Definition at line 530 of file ah-convert.H.
References Aleph::Array< T >::append().
Convert a std::vector to a DynArray.
Creates a new DynArray containing copies of all elements from the given std::vector.
| T | The element type. |
| v | The source std::vector. |
Definition at line 122 of file ah-convert-common.H.
References Aleph::DynArray< T >::append().
Referenced by demo_vector_dynarray(), other_unit_vector_to_DynArray(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
Convert a std::vector to a DynArray using move semantics.
Creates a new DynArray by moving all elements from the given std::vector. After conversion, the source vector's elements are in a valid but unspecified state.
| T | The element type. |
| v | The source std::vector (rvalue reference). |
Definition at line 551 of file ah-convert.H.
References Aleph::DynArray< T >::append().
Convert a std::vector to a DynDlist.
Creates a new DynDlist containing copies of all elements from the given std::vector.
| T | The element type. |
| v | The source std::vector. |
Definition at line 486 of file ah-convert.H.
References Aleph::DynDlist< T >::append().
Convert a std::vector to a DynDlist using move semantics.
Creates a new DynDlist by moving all elements from the given std::vector. After conversion, the source vector's elements are in a valid but unspecified state.
| T | The element type. |
| v | The source std::vector (rvalue reference). |
Definition at line 572 of file ah-convert.H.
References Aleph::DynDlist< T >::append().
Convert a std::vector to a DynList.
Creates a new DynList containing copies of all elements from the given std::vector.
| T | The element type. |
| v | The source std::vector. |
Definition at line 102 of file ah-convert-common.H.
References Aleph::DynList< T >::append().
Referenced by demo_vector_dynlist(), other_unit_vector_to_DynList(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and to_DynList().
Convert a std::vector to a DynList using move semantics.
Creates a new DynList by moving all elements from the given std::vector. After conversion, the source vector's elements are in a valid but unspecified state.
| T | The element type. |
| v | The source std::vector (rvalue reference). |
Definition at line 509 of file ah-convert.H.
References Aleph::DynList< T >::append().
| DynSetTree< T > Aleph::vector_to_DynSetTree | ( | const std::vector< T > & | v | ) |
Convert a std::vector to a DynSetTree.
| T | The element type. |
| v | The source std::vector. |
Definition at line 1000 of file ah-convert.H.
References Aleph::DynSetTree< Key, Tree, Compare >::insert().
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Verifies that an iterator belongs to a specific container.
Checks that the iterator is associated with the given container. Throws std::domain_error if the verification fails.
| Container | The container type. |
| Iterator | The iterator type (must have verify(Container&) method). |
| container | The container to check against. |
| itor | The iterator to verify. |
| std::domain_error | if the iterator does not belong to the container. |
Definition at line 105 of file ah_stdc++_utils.H.
References ah_domain_error_if.
Referenced by TEST(), TEST(), TEST(), TEST(), verify_container_and_iterators(), and verify_container_and_iterators().
|
inline |
Verifies that two iterators both belong to a specific container.
A simpler overload that just checks both iterators belong to the given container.
| Container | The container type. |
| Iterator | The iterator type. |
| container | The container to check against. |
| itor1 | First iterator. |
| itor2 | Second iterator. |
| std::domain_error | if either iterator doesn't belong to the container. |
Definition at line 198 of file ah_stdc++_utils.H.
References verify_container_and_iterator().
|
inline |
Verifies container-iterator relationships with distinctness check.
This overload performs three verifications:
itor_container belongs to containeritor1 and itor2 belong to the same container (as each other)itor_container is distinct from itor1 (they reference different containers)This is useful when you have a "destination" iterator (itor_container) and a "source" range (itor1, itor2), and you need to ensure they don't overlap.
| Container | The container type. |
| Iterator | The iterator type. |
| container | The destination container. |
| itor_container | Iterator into the destination container. |
| itor1 | Start of source range. |
| itor2 | End of source range. |
| std::domain_error | if any verification fails. |
Definition at line 163 of file ah_stdc++_utils.H.
References ah_domain_error_if, verify_container_and_iterator(), and verify_iterators().
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Verifies that two iterators belong to the same container.
Checks that both iterators are associated with the same underlying container. Throws std::domain_error if they belong to different containers.
| Iterator | The iterator type (must have verify(Iterator&) method). |
| itor1 | First iterator. |
| itor2 | Second iterator. |
| std::domain_error | if iterators belong to different containers. |
Definition at line 137 of file ah_stdc++_utils.H.
References ah_domain_error_if.
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), and verify_container_and_iterators().
|
inline |
Visualize AABB tree hierarchy.
Definition at line 1068 of file tikzgeom_algorithms.H.
References Aleph::AABBTree::debug_snapshot(), and put_aabb_tree_result().
Referenced by Aleph::Tikz_Scene::visualize_aabb_tree().
|
inline |
Visualize AABB tree with a rectangle query overlay.
Definition at line 1087 of file tikzgeom_algorithms.H.
References Aleph::AABBTree::debug_snapshot(), out, put_aabb_tree_result(), Aleph::AABBTree::query(), and Aleph::AABBTreeQueryVizResult::snapshot.
Referenced by main(), TEST(), and Aleph::Tikz_Scene::visualize_aabb_tree_query().
|
inline |
Compute and insert alpha-shape for input points.
Definition at line 1569 of file tikzgeom_algorithms.H.
Referenced by main(), TEST(), and Aleph::Tikz_Scene::visualize_alpha_shape().
|
inline |
Visualizes a boolean operation (union, intersection, difference) on two polygons.
Draws the two input polygons (a and b) with semi-transparent fills and overlays the result of the boolean operation with a distinct style. This function can handle non-convex polygons.
| plane | The target TikZ plane. |
| a | The subject polygon. |
| b | The clip polygon. |
| op | The boolean operation to perform (e.g., Op::Union). |
| bop | The boolean operations algorithm object. |
| a_style | The style for polygon a. |
| b_style | The style for polygon b. |
| result_style | The style for the resulting polygon(s). |
| input_layer | The base layer for the input polygons. |
| result_layer | The layer for the resulting polygon(s). |
Array<Polygon> containing the result of the operation. The result can be multiple disjoint polygons. Definition at line 659 of file tikzgeom_algorithms.H.
Referenced by main(), and Aleph::Tikz_Scene::visualize_boolean_operation().
|
inline |
Compute and insert constrained Delaunay triangulation.
Definition at line 1850 of file tikzgeom_algorithms.H.
Referenced by main().
|
inline |
Smooth a polygon with Chaikin subdivision and draw the result.
Definition at line 2044 of file tikzgeom_algorithms.H.
References put_smoothing_result(), and Aleph::ChaikinSmoothing::smooth_polygon().
Referenced by main().
|
inline |
Compute and draw the closest pair from an input point set.
Definition at line 1631 of file tikzgeom_algorithms.H.
Referenced by main(), TEST(), and Aleph::Tikz_Scene::visualize_closest_pair().
|
inline |
Compute and insert convex decomposition for a polygon.
Definition at line 1521 of file tikzgeom_algorithms.H.
Referenced by main(), TEST(), and Aleph::Tikz_Scene::visualize_convex_decomposition().
| Polygon Aleph::visualize_convex_hull | ( | Tikz_Plane & | plane, |
| const DynList< Point > & | points, | ||
| const HullAlgorithm & | hull_algorithm, | ||
| const Tikz_Style & | point_style = tikz_points_style("black", 0.6), |
||
| const Tikz_Style & | hull_style = tikz_wire_style("red"), |
||
| const Tikz_Style & | hull_vertex_style = tikz_points_style("red"), |
||
| const int | point_layer = Tikz_Plane::Layer_Default, |
||
| const int | hull_layer = Tikz_Plane::Layer_Foreground, |
||
| const bool | draw_hull_vertices = true |
||
| ) |
Runs a convex hull algorithm and visualizes the result.
This helper function takes a list of points, computes their convex hull using the provided algorithm object, and inserts both the original points and the resulting hull polygon into the Tikz_Plane.
| HullAlgorithm | The type of the convex hull algorithm object. It must be a callable that takes a DynList<Point> and returns a Polygon. |
| plane | The target TikZ plane. |
| points | The input point cloud. |
| hull_algorithm | An instance of the hull algorithm to use. |
| point_style | The style for the input points. |
| hull_style | The style for the convex hull polygon's outline. |
| hull_vertex_style | The style for the vertices of the hull. |
| point_layer | The layer for the input points. |
| hull_layer | The layer for the hull polygon and its vertices. |
| draw_hull_vertices | If true, the vertices of the hull are drawn. |
Polygon. Definition at line 584 of file tikzgeom_algorithms.H.
References and, put_in_plane(), put_points(), put_polygon_vertices(), and Aleph::Polygon::size().
Referenced by main(), TEST(), and Aleph::Tikz_Scene::visualize_convex_hull().
|
inline |
Visualizes the intersection of two convex polygons.
Draws the subject and clip polygons with semi-transparent fills and overlays their intersection with a distinct, solid fill.
| plane | The target TikZ plane. |
| subject | The subject polygon. |
| clip | The clipping polygon. |
| intersection_algorithm | The algorithm to use for intersection. |
| subject_style | The style for the subject polygon. |
| clip_style | The style for the clip polygon. |
| result_style | The style for the resulting intersection polygon. |
| input_layer | The base layer for the input polygons. |
| result_layer | The layer for the intersection polygon. |
Polygon representing the intersection. Definition at line 621 of file tikzgeom_algorithms.H.
Referenced by main(), TEST(), and Aleph::Tikz_Scene::visualize_convex_intersection().
|
inline |
Compute and insert Delaunay triangulation as triangle outlines.
Definition at line 700 of file tikzgeom_algorithms.H.
Referenced by main(), TEST(), and Aleph::Tikz_Scene::visualize_delaunay().
|
inline |
Simplify a polygon with Douglas-Peucker and draw the result.
Definition at line 1932 of file tikzgeom_algorithms.H.
Referenced by main().
|
inline |
Compute and draw bounded half-plane intersection.
Definition at line 1699 of file tikzgeom_algorithms.H.
Referenced by main(), TEST(), and Aleph::Tikz_Scene::visualize_half_plane_intersection().
|
inline |
Visualize KD-tree recursive space partitions.
Definition at line 938 of file tikzgeom_algorithms.H.
References Aleph::KDTreePointSearch::debug_snapshot(), and put_kdtree_partitions_result().
Referenced by main(), TEST(), and Aleph::Tikz_Scene::visualize_kdtree_partitions().
|
inline |
Compute and draw Bentley-Ottmann line-sweep intersections.
Definition at line 1806 of file tikzgeom_algorithms.H.
Referenced by main(), TEST(), and Aleph::Tikz_Scene::visualize_line_sweep().
|
inline |
Compute minimum enclosing circle and insert into plane.
Definition at line 1890 of file tikzgeom_algorithms.H.
Referenced by main().
|
inline |
Compute and draw Minkowski sum of two convex polygons.
Definition at line 1726 of file tikzgeom_algorithms.H.
Referenced by main(), TEST(), and Aleph::Tikz_Scene::visualize_minkowski_sum().
|
inline |
Compute and draw triangulation via monotone partition pipeline.
Definition at line 1752 of file tikzgeom_algorithms.H.
Referenced by TEST(), and Aleph::Tikz_Scene::visualize_monotone_triangulation().
|
inline |
Offset a polygon and draw the result.
Definition at line 1999 of file tikzgeom_algorithms.H.
Referenced by main().
|
inline |
Compute and insert Power diagram for weighted sites.
Definition at line 817 of file tikzgeom_algorithms.H.
Referenced by main(), TEST(), and Aleph::Tikz_Scene::visualize_power_diagram().
|
inline |
Visualize range-tree structure without a query overlay.
Definition at line 998 of file tikzgeom_algorithms.H.
References Aleph::RangeTree2D::debug_snapshot(), and put_range_tree_result().
Referenced by Aleph::Tikz_Scene::visualize_range_tree().
|
inline |
Visualize range-tree plus a query rectangle and matching points.
Definition at line 1017 of file tikzgeom_algorithms.H.
References Aleph::RangeTree2D::debug_snapshot(), Aleph::Rectangle::get_xmax(), Aleph::Rectangle::get_xmin(), Aleph::Rectangle::get_ymax(), Aleph::Rectangle::get_ymin(), out, put_range_tree_result(), Aleph::RangeTree2D::query(), and Aleph::RangeTreeQueryVizResult::snapshot.
Referenced by main(), TEST(), and Aleph::Tikz_Scene::visualize_range_tree_query().
|
inline |
Compute and insert regular (weighted Delaunay) triangulation.
Definition at line 1604 of file tikzgeom_algorithms.H.
Referenced by TEST(), and Aleph::Tikz_Scene::visualize_regular_triangulation().
|
inline |
Compute and draw rotating-calipers diameter and minimum width.
Definition at line 1668 of file tikzgeom_algorithms.H.
References Aleph::RotatingCalipersConvexPolygon::diameter(), Aleph::RotatingCalipersConvexPolygon::minimum_width(), and put_rotating_calipers_result().
Referenced by main(), TEST(), and Aleph::Tikz_Scene::visualize_rotating_calipers().
|
inline |
Visualize an R-tree/R*-tree hierarchy (node MBRs by depth, plus leaf entry boxes).
Definition at line 1149 of file tikzgeom_algorithms.H.
References Aleph::RTree< Payload, MaxEntries, MinEntries, Variant >::debug_snapshot(), and put_rtree_result().
Referenced by TEST().
|
inline |
Visualize an R-tree/R*-tree with a rectangle query overlay, highlighting every entry whose bbox intersects query_rect.
Definition at line 1174 of file tikzgeom_algorithms.H.
References Aleph::RTree< Payload, MaxEntries, MinEntries, Variant >::debug_snapshot(), Aleph::RTree< Payload, MaxEntries, MinEntries, Variant >::for_each_intersecting(), out, put_rtree_result(), and Aleph::RTreeQueryVizResult< Payload, MaxEntries, MinEntries, Variant >::snapshot.
|
inline |
Compute and insert arrangement for input segments.
Definition at line 883 of file tikzgeom_algorithms.H.
Referenced by main(), TEST(), TEST(), and Aleph::Tikz_Scene::visualize_segment_arrangement().
|
inline |
Visualize the shortest path inside a simple polygon.
Definition at line 1442 of file tikzgeom_algorithms.H.
Referenced by TEST(), and Aleph::Tikz_Scene::visualize_shortest_path_in_polygon().
|
inline |
Visualize the shortest path plus funnel portals.
This helper draws:
Definition at line 1469 of file tikzgeom_algorithms.H.
Referenced by main(), TEST(), and Aleph::Tikz_Scene::visualize_shortest_path_with_portals().
|
inline |
Build a trapezoidal map and draw it.
Convenience wrapper that constructs the map and draws it in one call.
Definition at line 2214 of file tikzgeom_algorithms.H.
References put_trapezoidal_map_result().
Referenced by main().
|
inline |
Build a trapezoidal map from a polygon and draw it.
Definition at line 2230 of file tikzgeom_algorithms.H.
References put_trapezoidal_map_result().
|
inline |
Compute and draw visibility polygon from a query point.
Definition at line 1778 of file tikzgeom_algorithms.H.
Referenced by main(), TEST(), and Aleph::Tikz_Scene::visualize_visibility_polygon().
|
inline |
Simplify a polygon with Visvalingam-Whyatt and draw the result.
Definition at line 1950 of file tikzgeom_algorithms.H.
|
inline |
Compute and insert Voronoi diagram for input sites.
Returns the generated Voronoi result so callers can reuse it.
Definition at line 769 of file tikzgeom_algorithms.H.
Referenced by main(), TEST(), and Aleph::Tikz_Scene::visualize_voronoi().
|
extern |
Print a warning message with file and line info.
| file | Source file name (use FILE). |
| line | Line number (use LINE). |
| format | Printf-style format string. |
| ... | Format arguments. |
Definition at line 151 of file ahDefs.C.
References aleph_message_mutex, and file.
|
inlinestaticnoexcept |
Definition at line 149 of file hash-fct.C.
References value.
Referenced by MurmurHash3_x86_128(), MurmurHash3_x86_32(), and write_le64().
|
inlinestaticnoexcept |
Definition at line 157 of file hash-fct.C.
References value, and write_le32().
Referenced by MurmurHash3_x64_128().
|
inlinenoexcept |
Definition at line 769 of file hash-fct.H.
References seed, and wyhash_hash().
|
noexcept |
Definition at line 632 of file hash-fct.H.
References seed, and wyhash_hash().
|
inlinenoexcept |
Definition at line 849 of file hash-fct.H.
References seed, and wyhash_hash().
|
inlinestaticnoexcept |
Definition at line 215 of file hash-fct.C.
References mul_xor_fold64().
Referenced by wyhash_hash().
|
inlinenoexcept |
Definition at line 658 of file hash-fct.H.
References h.
|
inlinenoexcept |
Definition at line 551 of file hash-fct.H.
References xor_hash().
|
inlinenoexcept |
Definition at line 791 of file hash-fct.H.
References xor_hash().
|
inlinestaticnoexcept |
Definition at line 204 of file hash-fct.C.
References value, and xxh64_round().
Referenced by xxhash64_hash().
|
inlinestaticnoexcept |
Definition at line 193 of file hash-fct.C.
References ROTL64.
Referenced by xxh64_merge_round(), and xxhash64_hash().
|
inlinenoexcept |
Definition at line 763 of file hash-fct.H.
References seed, and xxhash64_hash().
|
noexcept |
Definition at line 624 of file hash-fct.H.
References seed, and xxhash64_hash().
|
inlinenoexcept |
Definition at line 843 of file hash-fct.H.
References seed, and xxhash64_hash().
|
inline |
Compute Z-array for a string.
z[i] equals the longest length L such that s[0..L-1] == s[i..i+L-1].
| [in] | s | Input string. |
s.size(). When non-empty, z[0] = s.size(). | None. |
Definition at line 222 of file String_Search.H.
References and, Aleph::Array< T >::create(), l, r, and Aleph::Array< T >::size().
Referenced by main(), TEST(), and z_search().
|
inline |
Find all occurrences of a pattern using the Z-algorithm.
| [in] | text | Text where matches are searched. |
| [in] | pattern | Pattern to find. |
| None. |
pattern and text, this function falls back to kmp_search. pattern is empty, returns all positions in [0, text.size()].Definition at line 269 of file String_Search.H.
References Aleph::string_search_detail::all_match_positions(), Aleph::Array< T >::append(), Aleph::string_search_detail::find_unused_delimiter(), kmp_search(), offset, Aleph::Array< T >::size(), and z_algorithm().
Referenced by main(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().
|
inline |
Zip two containers into a list of pairs.
Combines elements from two containers pairwise. Iteration stops when the shorter container is exhausted.
| Container1 | Type of the first container. |
| Container2 | Type of the second container. |
| a | First container. |
| b | Second container. |
Definition at line 1025 of file ahFunctional.H.
References and, Aleph::DynList< T >::append(), and LocateFunctions< Container, Type >::get_it().
Referenced by Aleph::Net_Cost_Graph< NodeT, ArcT >::Net_Cost_Graph(), Aleph::Net_Graph< NodeT, ArcT >::Net_Graph(), demo_zipping(), format_string(), format_string(), format_string(), main(), TEST(), TEST(), TEST_F(), Aleph::Matrix< Trow, Tcol, NumType >::to_str(), TYPED_TEST_P(), and TYPED_TEST_P().
|
inline |
Return true if op returns true for all tuples and containers have equal length.
This is like ML's forall but also verifies that all containers have the same length. Use zip_all_short if you don't need length verification.
| op | Predicate. |
| cs | Containers to zip. |
true iff op is true for all tuples and lengths match. Definition at line 505 of file ah-zip.H.
References zip_it().
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TYPED_TEST_P(), TYPED_TEST_P(), and zip_forall().
|
inline |
Return true if op returns true for all tuples (without length check).
Like ML's forall. Iterates over the minimum length of all containers. Does NOT verify that containers have equal length.
| op | Predicate. |
| cs | Containers to zip. |
true iff op is true for all tuples. Definition at line 526 of file ah-zip.H.
References zip_it().
Referenced by TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and zip_forall_short().
|
inline |
Alias for zip_exists.
Like Python/JS any().
Definition at line 579 of file ah-zip.H.
References zip_exists().
Return true if cmp(t) is true for each built tuple t.
Let us suppose 3 containers of the same internal type T.
l1 = { 1, 2, 3}; l2 = { 1, 2, 3}; l3 = { 1, 2, 3};
This function, which receives a comparator cmp(i1, i2), returns true if the elements of each tuple resulting of the zip of three containers are the same. So, in the previous case the result is true.
If any item of any list variates, then the result should be false. For example with l2 = { 1, 4, 3}.
Definition at line 1054 of file ah-zip.H.
References cmp(), Aleph::zip_detail::compare_adjacent(), and get_zip_it().
Referenced by TEST(), TEST(), TEST(), TEST_F(), and TEST_F().
|
inline |
| auto Aleph::zip_drop | ( | const size_t | n, |
| const Cs &... | cs | ||
| ) |
Skip n tuples and return the rest.
| n | Number of tuples to skip. |
| cs | Containers to zip. |
n. Definition at line 1765 of file ah-zip.H.
References and, Aleph::DynList< T >::append(), and zip_it().
Referenced by demo_zip_utilities(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
| auto Aleph::zip_drop_while | ( | Pred && | pred, |
| const Cs &... | cs | ||
| ) |
Skip tuples while predicate pred returns true, then return the rest.
| pred | Predicate (tuple) -> bool. |
| cs | Containers to zip. |
pred becomes false. Definition at line 1813 of file ah-zip.H.
References and, Aleph::DynList< T >::append(), pred, and zip_it().
Referenced by TEST(), TEST(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Return true if op returns true for at least one tuple.
Like ML's exists. Iterates over the minimum length of all containers.
| op | Predicate. |
| cs | Containers to zip. |
true if any tuple satisfies op. Definition at line 565 of file ah-zip.H.
References zip_it().
Referenced by TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), zip_any(), and zip_none().
| auto Aleph::zip_filter | ( | Op | op, |
| const Cs &... | cs | ||
| ) |
Filter zipped tuples by predicate op.
Selects tuples from the zipped containers where the predicate returns true. Iterates over the minimum length of all containers.
| op | Predicate function that takes a tuple and returns bool. |
| cs | Containers to zip together. |
op returned true.Definition at line 959 of file ah-zip.H.
References Aleph::DynList< T >::append(), and zip_it().
Referenced by demo_zip_transformation(), main(), TEST(), TEST(), TEST(), and TEST_F().
| auto Aleph::zip_filter_eq | ( | Op | op, |
| const Cs &... | cs | ||
| ) |
Filter zipped tuples by predicate op; throw if containers differ in length.
Like zip_filter, but additionally verifies that all containers have the same length after iteration.
| op | Predicate function that takes a tuple and returns bool. |
| cs | Containers to zip together. |
op returned true. | std::length_error | if container sizes mismatch. |
Definition at line 1000 of file ah-zip.H.
References ah_length_error_if, Aleph::DynList< T >::append(), and zip_it().
Referenced by TEST(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
| auto Aleph::zip_find_first | ( | Op && | op, |
| const Cs &... | cs | ||
| ) |
Return the first tuple that satisfies predicate op.
| op | Predicate. |
| cs | Containers to zip. |
Definition at line 641 of file ah-zip.H.
References zip_it().
Referenced by TEST(), TEST(), TEST_F(), TEST_F(), and TEST_F().
| size_t Aleph::zip_find_index | ( | Op | op, |
| const Cs &... | cs | ||
| ) |
| auto Aleph::zip_find_last | ( | Op && | op, |
| const Cs &... | cs | ||
| ) |
Return the last tuple that satisfies predicate op.
| op | Predicate. |
| cs | Containers to zip. |
Definition at line 662 of file ah-zip.H.
References zip_it().
Referenced by TEST(), TEST(), TEST_F(), TEST_F(), and TEST_F().
| auto Aleph::zip_first | ( | const Cs &... | cs | ) |
| T Aleph::zip_foldl | ( | const T & | init, |
| Op | op, | ||
| const Cs &... | cs | ||
| ) |
Left fold (reduce) over zipped tuples.
Accumulates a value by applying a binary operation to the accumulator and each tuple from the zipped containers, from left to right. This is equivalent to ML's foldl or JavaScript's reduce.
| T | Accumulator type. |
| Op | Binary operation type (T, tuple) -> T. |
| Cs | Container types. |
| init | Initial accumulator value. |
| op | Binary operation that combines accumulator with each tuple. |
| cs | Containers to zip together. |
Definition at line 806 of file ah-zip.H.
References init, and zip_it().
Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), and TEST_F().
| T Aleph::zip_foldl_eq | ( | const T & | init, |
| Op | op, | ||
| const Cs &... | cs | ||
| ) |
Left fold over zipped tuples; throw if containers differ in length.
| T | Accumulator type. |
| init | Initial accumulator value. |
| op | Binary operation (T, tuple) -> T. |
| cs | Containers to zip. |
| std::length_error | if container sizes mismatch. |
Definition at line 826 of file ah-zip.H.
References ah_length_error_if, init, and zip_it().
|
inline |
Apply op to every zipped tuple.
Iterates over all zipped tuples, applying the callable to each. This is a side-effect operation (returns void). Iterates over the minimum length of all containers.
| Op | Callable type (tuple) -> void. |
| Cs | Container types. |
| op | Callable to invoke on each tuple (for side effects). |
| cs | Containers to zip together. |
Definition at line 471 of file ah-zip.H.
References zip_it().
Referenced by main(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Apply op to every zipped tuple; throw if containers differ in length.
| op | Callable to invoke on each tuple. |
| cs | Containers to zip. |
| std::length_error | if container sizes mismatch. |
Definition at line 485 of file ah-zip.H.
References ah_length_error_if, and get_zip_it().
|
inline |
|
inline |
Apply op to each zipped tuple with index; throw if lengths differ.
| op | Callable (size_t index, tuple) -> void. |
| cs | Containers to zip. |
| std::length_error | if container sizes mismatch. |
Definition at line 1727 of file ah-zip.H.
References ah_length_error_if, and zip_it().
|
inline |
|
inline |
Alias for zip_all_short.
Like ML's forall without length verification.
Definition at line 550 of file ah-zip.H.
References zip_all_short().
Referenced by TEST_F().
|
inline |
Alias for get_zip_it.
Definition at line 359 of file ah-zip.H.
References get_zip_it().
Referenced by Aleph::Matrix< Trow, Tcol, NumType >::Matrix(), Aleph::Vector< T, NumType >::Vector(), complete_rows(), Aleph::Matrix< Trow, Tcol, NumType >::create_by_columns_impl(), Aleph::Matrix< Trow, Tcol, NumType >::create_by_rows_impl(), t_zip(), t_zip_eq(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), zip_all(), zip_all_short(), zip_count(), zip_drop(), zip_drop_while(), zip_exists(), zip_filter(), zip_filter_eq(), zip_find_first(), zip_find_index(), zip_find_last(), zip_foldl(), zip_foldl_eq(), zip_for_each(), zip_for_each_indexed(), zip_for_each_indexed_eq(), zip_length(), zip_map(), zip_map_eq(), zip_maps(), zip_maps_eq(), zip_maps_if(), zip_maps_if_eq(), zip_nth(), zip_partition(), zip_take(), zip_take_while(), zip_transform(), zip_transform_eq(), zip_traverse(), and zip_traverse_eq().
|
inline |
|
inline |
| auto Aleph::zip_lists | ( | const C & | c, |
| const Lists &... | lists | ||
| ) |
Take several container of same type and some length and builds a list of lists.
Example: l1 = { 1, 2, 3, 4} l2 = { 5, 6, 7, 8} l3 = { 9, 0, 10, 11}
Where each li is a DynList<int> (but they could be heterogeneous; i.e. they could be DynList, DynSetTree, etc)
Then zip_list(l1, l2, l3) produces a DynList<DynList<int>> with the following content:
{ {1, 5, 9}, {2, 6, 0}, {3, 7, 10}, {4, 8, 11} }
Definition at line 1515 of file ah-zip.H.
References Aleph::DynList< T >::append(), and get_zip_it().
| auto Aleph::zip_lists_eq | ( | const C & | c, |
| const Lists &... | lists | ||
| ) |
Like zip_lists but throws if containers differ in length.
| c | First container. |
| lists | Additional containers. |
| std::length_error | if container sizes mismatch. |
Definition at line 1534 of file ah-zip.H.
References ah_length_error_if, Aleph::DynList< T >::append(), and get_zip_it().
|
inline |
Zip two containers, padding the shorter one with a fill value.
Unlike zip() which stops at the shorter container, zip_longest() continues until both containers are exhausted. When one container is exhausted before the other, its corresponding values in the resulting pairs are filled with the specified fill value.
This is similar to Python's itertools.zip_longest().
| Container1 | Type of the first container. |
| Container2 | Type of the second container. |
| a | First container. |
| b | Second container. |
| fill_a | Value to use when container a is exhausted. |
| fill_b | Value to use when container b is exhausted. |
Definition at line 2808 of file ahFunctional.H.
References and, Aleph::DynList< T >::append(), and LocateFunctions< Container, Type >::get_it().
|
inline |
Zip two containers using optionals for missing values.
Like zip_longest() but uses std::optional to represent missing values instead of requiring explicit fill values. This is useful when there's no sensible default value, or when you need to distinguish between a real value and a fill value.
| Container1 | Type of the first container. |
| Container2 | Type of the second container. |
| a | First container. |
| b | Second container. |
Definition at line 2951 of file ahFunctional.H.
References and, Aleph::DynList< T >::append(), and LocateFunctions< Container, Type >::get_it().
Referenced by TEST().
| auto Aleph::zip_map | ( | Op && | op, |
| const Cs &... | cs | ||
| ) |
Map op over zipped tuples with auto-deduced return type.
Unlike zip_maps<T>, this version automatically deduces the result type from the return type of op.
| op | Transformation callable. |
| cs | Containers to zip. |
Definition at line 898 of file ah-zip.H.
References Aleph::DynList< T >::append(), and zip_it().
Referenced by demo_zip_transformation(), TEST(), TEST(), TEST_F(), and TEST_F().
| auto Aleph::zip_map_eq | ( | Op && | op, |
| const Cs &... | cs | ||
| ) |
Map op over zipped tuples with auto-deduced return type; throw if lengths differ.
| op | Transformation callable. |
| cs | Containers to zip. |
| std::length_error | if container sizes mismatch. |
Definition at line 919 of file ah-zip.H.
References ah_length_error_if, Aleph::DynList< T >::append(), and zip_it().
| DynList< T > Aleph::zip_maps | ( | Op | op, |
| const Cs &... | cs | ||
| ) |
Map op over zipped tuples, returning a list of results.
Applies a transformation function to each tuple from the zipped containers and collects the results in a DynList. The result type must be explicitly specified. For auto-deduced return type, use zip_map instead.
| T | Result type (must be explicitly specified). |
| Op | Transformation callable type. |
| Cs | Container types. |
| op | Transformation callable that takes a tuple and returns T. |
| cs | Containers to zip together. |
Definition at line 747 of file ah-zip.H.
References Aleph::DynList< T >::append(), and zip_it().
| DynList< T > Aleph::zip_maps_eq | ( | Op | op, |
| const Cs &... | cs | ||
| ) |
Map op over zipped tuples; throw if containers differ in length.
| T | Result type. |
| op | Transformation callable. |
| cs | Containers to zip. |
| std::length_error | if container sizes mismatch. |
Definition at line 849 of file ah-zip.H.
References ah_length_error_if, Aleph::DynList< T >::append(), and zip_it().
| DynList< T > Aleph::zip_maps_if | ( | Prop | prop, |
| Op | op, | ||
| const Cs &... | cs | ||
| ) |
Map op over zipped tuples that satisfy prop.
| T | Result type. |
| prop | Predicate selecting which tuples to transform. |
| op | Transformation callable. |
| cs | Containers to zip. |
prop is true. Definition at line 766 of file ah-zip.H.
References Aleph::DynList< T >::append(), and zip_it().
| DynList< T > Aleph::zip_maps_if_eq | ( | Prop | prop, |
| Op | op, | ||
| const Cs &... | cs | ||
| ) |
Map op over zipped tuples that satisfy prop; throw if lengths differ.
| T | Result type. |
| prop | Predicate selecting which tuples to transform. |
| op | Transformation callable. |
| cs | Containers to zip. |
prop is true. | std::length_error | if container sizes mismatch. |
Definition at line 873 of file ah-zip.H.
References ah_length_error_if, Aleph::DynList< T >::append(), and zip_it().
|
inline |
Return true if op returns false for all tuples.
This is the complement of zip_exists().
| op | Predicate. |
| cs | Containers to zip. |
true if no tuple satisfies op. Definition at line 594 of file ah-zip.H.
References zip_exists().
Referenced by TEST(), TEST(), TEST(), TEST_F(), and TEST_F().
| auto Aleph::zip_nth | ( | size_t | n, |
| const Cs &... | cs | ||
| ) |
Return the n-th tuple from zipped containers.
| n | Index (0-based). |
| cs | Containers to zip. |
Definition at line 689 of file ah-zip.H.
References zip_it().
Referenced by TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and zip_first().
| auto Aleph::zip_partition | ( | Op | op, |
| const Cs &... | cs | ||
| ) |
Partition zipped tuples by predicate op.
Separates zipped tuples into two groups based on a predicate: those for which the predicate returns true, and those for which it returns false. Also returns the count of each group.
| Op | Predicate type (tuple) -> bool. |
| Cs | Container types. |
| op | Predicate to partition by. |
| cs | Containers to zip together. |
Definition at line 1124 of file ah-zip.H.
References Aleph::DynList< T >::append(), and zip_it().
| auto Aleph::zip_take | ( | size_t | n, |
| const Cs &... | cs | ||
| ) |
Take at most n tuples from the zipped containers.
| n | Maximum number of tuples to take. |
| cs | Containers to zip. |
n tuples. Definition at line 1746 of file ah-zip.H.
References and, Aleph::DynList< T >::append(), count(), and zip_it().
Referenced by demo_zip_utilities(), TEST(), TEST(), TEST_F(), TEST_F(), and TEST_F().
| auto Aleph::zip_take_while | ( | Pred && | pred, |
| const Cs &... | cs | ||
| ) |
Take tuples while predicate pred returns true.
| pred | Predicate (tuple) -> bool. |
| cs | Containers to zip. |
pred is satisfied. Definition at line 1790 of file ah-zip.H.
References Aleph::DynList< T >::append(), pred, and zip_it().
Referenced by demo_zip_utilities(), TEST(), TEST(), TEST_F(), TEST_F(), and TEST_F().
| auto Aleph::zip_transform | ( | Op && | op, |
| const Cs &... | cs | ||
| ) |
Transform zipped tuples using op and return results in a vector.
Similar to std::ranges::transform but operates on zipped containers.
| Op | Transformation callable (tuple) -> R. |
| op | Transformation to apply. |
| cs | Containers to zip. |
std::vector of transformed values. Definition at line 1667 of file ah-zip.H.
References zip_it().
| auto Aleph::zip_transform_eq | ( | Op && | op, |
| const Cs &... | cs | ||
| ) |
Transform zipped tuples; throw if containers differ in length.
| Op | Transformation callable. |
| op | Transformation to apply. |
| cs | Containers to zip. |
std::vector of transformed values. | std::length_error | if container sizes mismatch. |
Definition at line 1689 of file ah-zip.H.
References ah_length_error_if, and zip_it().
|
inline |
Traverse zipped containers while op returns true.
Iterates over zipped tuples, calling the predicate for each. Stops early if the predicate returns false. Iterates over the minimum length of all containers.
| Op | Predicate type (tuple) -> bool. |
| Cs | Container types. |
| op | Callable returning bool; traversal stops on false. |
| cs | Containers to zip together. |
true if op returned true for every tuple, false otherwise.Definition at line 415 of file ah-zip.H.
References zip_it().
Referenced by TEST(), TEST(), TEST(), TEST(), TEST_F(), and TEST_F().
|
inline |
Traverse zipped containers while op returns true; verify equal lengths.
| op | Callable returning bool; traversal stops on false. |
| cs | Containers to zip. |
true if all containers have equal length and op returned true for every tuple. Definition at line 432 of file ah-zip.H.
References zip_it().
|
inline |
Zip two containers; throw if lengths differ.
Like zip() but verifies that both containers have equal length. Throws std::length_error if container sizes don't match.
| Container1 | Type of the first container. |
| Container2 | Type of the second container. |
| a | First container. |
| b | Second container. |
| std::length_error | if container sizes mismatch. |
Definition at line 1110 of file ahFunctional.H.
References ah_length_error_if, and, Aleph::DynList< T >::append(), and LocateFunctions< Container, Type >::get_it().
Referenced by TEST_F().
| Aleph::ZipIterator | ( | const HeadC & | head, |
| const TailC &... | tail | ||
| ) |
|
staticconstexpr |
Fixed seed used by the secondary hash function.
Definition at line 1006 of file hash-fct.H.
Referenced by snd_hash_fct(), snd_hash_fct(), snd_hash_fct(), TEST(), and TEST_F().
| and AlStreamable<T> Aleph::and |
Check uniqueness with explicit hash + equality functors.
Write vec, as Vector::to_str() gives it, to s.
This overload is intended for custom equivalence relations where a matching hash function is available (for example, case-insensitive string equality).
Complexity:
DynSetLhash is complete in the current translation unit.| container | Source container to check. |
| hash | Hash functor compatible with eq. |
| eq | Equality comparator compatible with hash. |
Definition at line 2708 of file ahFunctional.H.
Referenced by Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Array_Graph(), Aleph::Array_Iterator< T >::Array_Iterator(), Aleph::Array_Iterator< T >::Array_Iterator(), Aleph::FFT< Real >::BatchedISTFTProcessor::BatchedISTFTProcessor(), TimeoutQueue::Event::Event(), TimeoutQueue::Event::Event(), Aleph::Floyd_All_Shortest_Paths< GT, Distance, SA >::Floyd_All_Shortest_Paths(), Aleph::CsvReader::Iterator::Iterator(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::Johnson(), Aleph::hamiltonian_detail::Simple_Graph< GT, SA >::Simple_Graph(), Aleph::SkipList< Key, Type >::SkipList(), Aleph::SkipList< Key, Type >::SkipList(), Aleph::AhArenaAllocator::~AhArenaAllocator(), Aleph::CA::JSON_Frame_Stream_Writer::~JSON_Frame_Stream_Writer(), __compute_cut_nodes(), __deway_search(), __generate_tree(), __random_select(), __random_select(), __random_select(), __search_deway(), __tree_preorder_traversal(), Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::_interpolated_factors_for_main_var(), Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::_try_lift_affine_linear_factor_for_main_var(), Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::_try_lift_primitive_affine_linear_factor_for_main_var(), Aleph::CA::Composite_Frame_Sink< Sinks >::accept(), Aleph::FFT< Real >::ISTFTProcessor::accumulate_frame(), Aleph::Bellman_Ford< GT, Distance, Ait, NAit, SA >::add_if_fits(), Aleph::shortest_path_detail::add_if_fits(), Aleph::Shortest_Path_Base< GT, Distance, Itor, SA, HeapT >::add_if_fits(), Aleph::negative_cycles_detail::Exact_Sum< T >::add_multiple(), Aleph::howard_detail::Arithmetic< Cost_Type, true >::add_overflows(), adjust_minimal_separation_with_letf_sibling(), Aleph::blossom_weighted_detail::mwmatching::adjust_weights_for_maximum_cardinality_matching(), Aleph::zip_index_detail::all_of_tuple_impl(), all_unique(), Aleph::stl_zip_detail::all_valid(), Aleph::std_zip_detail::all_valid(), Pointer_Table::allocate_above_heap(), Aleph::Test_Eulerian< GT, SN, SA >::analyze_digraph(), Aleph::Compiler_Typed_Semantic_Analyzer::analyze_function(), Aleph::Test_Eulerian< GT, SN, SA >::analyze_graph(), Aleph::Compiler_Semantic_Analyzer::analyze_imports(), Aleph::Compiler_Typed_Semantic_Analyzer::analyze_stmt(), Aleph::SegmentArrangement::angle_quad(), Aleph::VisibilityPolygon::angle_quadrant(), Aleph::MemArray< T >::annotate(), Aleph::Path< GT >::append(), Aleph::Dlink::append(), Aleph::HTList::append(), Aleph::Floyd_All_Shortest_Paths< GT, Distance, SA >::append_lightest_arc(), Aleph::mat_path_detail::append_node(), Aleph::Compiler_Typed_Semantic_Analyzer::append_unique_type_id(), Aleph::CA::Kernel2D< T, Rows, Cols >::apply(), Aleph::FFT< Real >::Plan::apply_bluestein_transform(), Aleph::NTT< MOD, ROOT >::Plan::apply_bluestein_transform(), Aleph::FFT< Real >::Plan::apply_butterflies(), Aleph::LineEq::approx_equal(), approximate_string_size(), Aleph::eulerian_detail::arcs_are_together(), are_eq(), are_tree_equal(), areEquivalents(), areSimilar(), assert_valid_tree_root(), assign_distance(), Aleph::blossom_weighted_detail::mwmatching::impl::MatchingContext< WeightType >::assign_label_t(), assign_parrectangle(), assign_rectangle(), assign_triangle(), Aleph::Network_Simplex< Net >::augment_and_find_leaving(), Aleph::blossom_weighted_detail::mwmatching::impl::MatchingContext< WeightType >::augment_blossom_rec(), aumenting_path_maximum_flow(), Aleph::FFT< Real >::Plan::automatic_batch_simd_candidate(), Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::autoreduce_groebner_basis(), Aleph::GenBinHeap< NodeType, Key, Compare >::back_under(), Aleph::Filter_Iterator< Container, It, Show_Item >::backward(), Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::backward(), Aleph::Random_Digraph< GT, Init_Node, Init_Arc >::balance_digraph_node(), Aleph::FFT< Real >::balance_polynomial_for_roots(), Aleph::Generator< T >::begin(), benchmark_array_algorithms(), benchmark_list_algorithms(), Aleph::Breadth_First_Traversal< GT, Operation, SA >::bft(), Aleph::NTT< MOD, ROOT >::bigint_multiply(), binary_search(), binary_search(), Aleph::Gen_Polynomial< Coefficient >::bisect_root(), Aleph::Compiler_Dataflow_Detail::bit_set_intersection(), Aleph::Compiler_Dataflow_Detail::bit_set_subtract(), Aleph::negative_cycles_detail::bit_span(), KnapsackDomain::bound(), Aleph::planarity_detail::bounding_boxes_intersect(), Aleph::RTree< Payload, MaxEntries, MinEntries, Variant >::box_contains_box(), Aleph::AABBTree::box_contains_point(), Aleph::AABBTree::boxes_overlap(), boyer_moore_horspool_search(), Aleph::detail::bplus_equiv(), breadth_first_traversal(), bucket_sort(), bucket_sort(), Aleph::Aho_Corasick::build(), Aleph::Gen_Cartesian_Tree< T, Comp >::build(), Aleph::Gen_Mo_On_Trees< GT, Policy >::build(), Aleph::RangeTree2D::build(), Aleph::Bounded_Cycle_Index< GT >::build(), Aleph::tree_dp_detail::Tree_Topology< GT, SA >::build_adjacency(), Aleph::planarity_detail::LR_Planarity_Checker< GT, SA >::build_combinatorial_embedding(), Aleph::planarity_detail::LR_Planarity_Checker< GT, SA >::build_combinatorial_embedding_bruteforce(), Aleph::planarity_detail::LR_Planarity_Checker< GT, SA >::build_combinatorial_embedding_linear_lr(), build_cross_net_graph(), Aleph::Gen_Heavy_Light_Decomposition< GT, SA >::build_decomposition(), Aleph::MonotonePolygonTriangulation::build_faces_from_diagonals(), Aleph::RangeTree2D::build_node(), Aleph::planarity_detail::LR_Planarity_Checker< GT, SA >::build_nonplanar_certificate(), build_residual_net(), Aleph::hld_detail::HLD_Tree_Data< GT, SA >::build_simple_adjacency(), Aleph::lca_detail::Rooted_Tree_Data< GT, SA >::build_simple_adjacency(), Aleph::tree_decomposition_detail::Rooted_Tree_Topology< GT, SA >::build_simple_adjacency(), Aleph::Network_Simplex< Net >::build_spanning_tree(), Aleph::k_shortest_paths_detail::build_suffix_index_with_itor(), Aleph::Find_Depth_First_Spanning_Tree< GT, SA >::build_tree(), Aleph::Find_Breadth_First_Spanning_Tree< GT, SA >::build_tree(), Aleph::Bellman_Ford< GT, Distance, Ait, NAit, SA >::build_tree(), Aleph::ShortestPathInPolygon::build_tris(), Aleph::FFT< Real >::build_weighted_frequency_grid(), adaptive_huffman_demo::byte_label(), capacity_scaling_maximum_flow(), cdt_has_edge(), char_to_nibble(), Aleph::Path< GT >::check(), OhashCommon< HashTbl, Key >::Iterator::check(), Aleph::Net_Arc< Arc_Info, F_Type >::check_arc(), check_baseball_elimination(), check_bst_range(), check_delaunay_for_non_constrained(), Aleph::Path< GT >::check_directed(), Aleph::blossom_weighted_detail::mwmatching::impl::check_input_graph(), Aleph::PatriciaSet< UInt >::check_invariants(), Aleph::PatriciaMap< UInt, T >::check_invariants(), Aleph::patricia_trie_detail::Bitwise_Trie_Utils< UInt >::check_invariants_rec(), Aleph::Gen_Interval_Tree< NodeType, T, Compare >::check_max(), Aleph::Net_Graph< NodeT, ArcT >::check_network(), Aleph::Net_Graph< NodeT, ArcT >::check_node(), Aleph::Bellman_Ford< GT, Distance, Ait, NAit, SA >::check_painted_arcs(), check_rank_tree(), check_residual_net(), Aleph::shortest_path_detail::checked_add(), Aleph::CA::ca_io_detail::checked_coord_add(), Aleph::Source_Manager::checked_index(), Aleph::Segment_Tree_Beats< T >::chmax_impl(), Aleph::Segment_Tree_Beats< T >::chmin_impl(), Aleph::FFT< Real >::choose_remez_extrema(), Aleph::RTree< Payload, MaxEntries, MinEntries, Variant >::choose_subtree(), chromatic_number(), Aleph::Compiler_Bytecode_Detail::classify_constant(), Aleph::planarity_detail::LR_Planarity_Checker< GT, SA >::classify_k33(), Aleph::MonotonePolygonTriangulation::classify_vertex(), clone_tree(), Aleph::ConvexPolygonDistanceGJK::closest_from_simplex(), Aleph::BruteForceConvexHull::CmpSegment::cmp_point(), Aleph::Tikz_Plane::collect_legend_entries(), Aleph::GenTdRbTree< NodeType, Key, Compare >::colorRootAsRed(), Aleph::GenTdRbTreeRk< NodeType, Key, Compare >::colorRootAsRed(), Aleph::RadixTree< T, Char >::common_prefix_length(), Aleph::FFT< Real >::comp_ellint_1_impl(), Aleph::zip_detail::compare_adjacent(), Aleph::stl_zip_detail::compare_adjacent_impl(), Aleph::howard_detail::Arithmetic< Cost_Type, true >::compare_fractions(), compiler_build_module_name_table(), compiler_bytecode_value_to_string(), compiler_dump_bytecode_function(), compiler_dump_bytecode_module(), compiler_dump_cfg_function(), compiler_dump_dataflow_analysis(), compiler_dump_ir_function(), compiler_dump_ir_module(), compiler_dump_ssa_function(), compiler_dump_ssa_module(), compiler_integer_binary(), compiler_link_module_surfaces(), compiler_resolve_module_name(), compiler_unquote_string_token(), completed(), Aleph::StlZipIterator< Containers >::completed_impl(), Aleph::Lengauer_Tarjan_Dominators< GT, SA >::compress(), Aleph::Compiler_Dataflow_Detail::compute_block_use_def(), Aleph::Unconnected_Components< GT, SA >::compute_blocks(), compute_cut_nodes(), Aleph::Compiler_SSA_Detail::compute_dominance_info(), compute_height(), Aleph::hld_detail::HLD_Tree_Data< GT, SA >::compute_hld_positions(), Aleph::Unconnected_Components< GT, SA >::compute_lists(), Aleph::Tikz_Plane::compute_mapping(), compute_maximum_cardinality_general_matching(), compute_maximum_weight_general_matching(), Aleph::AStar_Min_Path< GT, Distance, Heuristic, Itor, SA, HeapT >::compute_min_paths_tree(), Aleph::Dijkstra_Min_Paths< GT, Distance, Itor, SA, HeapT >::compute_min_paths_tree(), compute_minimum_cost_general_matching(), Aleph::AStar_Min_Path< GT, Distance, Heuristic, Itor, SA, HeapT >::compute_partial_min_paths_tree(), Aleph::Dijkstra_Min_Paths< GT, Distance, Itor, SA, HeapT >::compute_partial_min_paths_tree(), Aleph::AStar_Min_Path< GT, Distance, Heuristic, Itor, SA, HeapT >::compute_partial_path(), Aleph::Simplex< T >::compute_pivot_col(), Aleph::Simplex< T >::compute_pivot_row(), Aleph::Compiler_Dataflow_Detail::compute_reachability(), Aleph::Compiler_SSA_Detail::compute_reachable_blocks(), compute_shortest_path_funnel_trace(), Aleph::CA::ca_neighborhood_detail::compute_von_neumann_offsets(), concat(), Aleph::Compiler_Bytecode_Interpreter_Detail::constant_to_value(), Aleph::Filter_Iterator< Container, It, Show_Item >::container_set(), Aleph::OLhashTable< int >::contains(), Aleph::Gen_File_B_Tree< Key, Compare, MinDegree, Codec >::contains(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::contains(), Aleph::PatriciaSet< UInt >::contains(), Aleph::Triangle::contains(), Aleph::Rectangle::contains(), QuadNode::contains(), QuadTree::contains(), Aleph::Tetrahedron::contains(), Aleph::Segment::contains(), Aleph::Source_Span::contains(), Aleph::Naive_Suffix_Tree::contains(), Aleph::Compact_Cuckoo_Filter< T, FingerprintBits, EntriesPerBucket >::contains(), Aleph::Cuckoo_Filter< T, FingerprintBits, EntriesPerBucket >::contains(), Aleph::Interval< T >::contains(), Aleph::AhArenaAllocator::contains(), Aleph::Aho_Corasick::contains_any(), Aleph::Gen_B_Tree< Key, Compare, MinDegree >::contains_in(), Aleph::Gen_BPlus_Tree< Key, Compare, MinDegree >::contains_in(), QuadTree::contains_only(), Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::content(), Aleph::Gen_Polynomial< Coefficient >::content(), Aleph::GenLinearHashTable< Key, BucketType, Cmp >::contract(), Aleph::detail::copy_file_contents(), OhashCommon< HashTbl, Key >::copy_from_table(), QuadTree::copy_tree(), Aleph::MCF_Arc< Arc_Info, FT >::cost(), Aleph::Network_Simplex< Net >::count_non_tree_partial_arcs(), Aleph::timsort_detail::count_run_and_make_ascending(), Aleph::IO_Graph< GT, Load_Node, Store_Node, Load_Arc, Store_Arc, NF, AF >::count_shown_arcs(), counting_sort(), covariance(), Aleph::CA::Bench::cpu_string(), Aleph::Random_Digraph< GT, Init_Node, Init_Arc >::create_p(), create_residual_arc(), create_residual_arc(), csv_filter_by_value(), csv_find_by_value(), csv_group_by(), csv_read_all(), csv_read_row(), csv_skip_bom(), csv_trim_fields(), Aleph::Dlink::cut_list(), Aleph::Compute_Cut_Nodes< GT, SA >::cut_nodes(), Aleph::Compute_Cut_Nodes< GT, SA >::cut_nodes(), Aleph::Bellman_Ford< GT, Distance, Ait, NAit, SA >::cycle_of_predecessors(), Aleph::negative_cycles_detail::cyclic_core(), Aleph::Compiler_Semantic_Analyzer::declare_symbol(), Aleph::Compiler_Bytecode_Detail::decode_escape_string(), decompose_flow(), Aleph::MonotonePolygonTriangulation::decompose_to_monotone_faces(), Aleph::Fibonacci_Heap< T, Compare >::decrease_key(), Aleph::Fibonacci_Heap< T, Compare >::decrease_key(), Aleph::eulerian_detail::degree(), Aleph::Dlink::Iterator::del(), Aleph::Dlink::del(), Aleph::Dlink::Iterator::del_ne(), demo_cache_filter(), demo_density(), demo_practical(), demo_prefix_search(), demo_set_operations(), demo_simple_bloom_filter(), demo_spell_checker(), demo_trie_structure(), Aleph::Gen_Link_Cut_Tree< T, Monoid, LazyTag >::destroy_vertex(), Aleph::tree_node_detail::detach_tree(), Aleph::Bellman_Ford< GT, Distance, Ait, NAit, SA >::detect_negative_cycle(), Aleph::Depth_First_Backtracking< Domain >::dfs_visited(), Aleph::CuttingEarsTriangulation::diagonal(), Aleph::CuttingEarsTriangulation::diagonalize(), Aleph::RotatingCalipersConvexPolygon::diameter(), Aleph::in_arcs_detail::digraph_in_degree(), dinic_maximum_flow(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::disconnect_arc(), Aleph::List_SGraph< __Graph_Node, __Graph_Arc >::disconnect_arc(), Weighted_Graph::distances_from(), Aleph::Lengauer_Tarjan_Dominators< GT, SA >::do_compute(), graph_oracles::dominance_frontiers(), Aleph::Lengauer_Tarjan_Dominators< GT, SA >::dominance_frontiers(), graph_oracles::dominators(), Aleph::Gen_Avl_Tree< NodeType, Key, Compare >::doubleRotateLeft(), Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::doubleRotateLeft(), Aleph::Gen_Avl_Tree< NodeType, Key, Compare >::doubleRotateRight(), Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::doubleRotateRight(), Aleph::knapsack_detail::dp_add(), Aleph::FFT< Real >::ISTFTProcessor::drain_ready_samples(), Aleph::Tikz_Plane::draw_cartesian_axis(), Aleph::Tikz_Plane::draw_coordinate_grid(), Aleph::Tikz_Plane::draw_line_eq(), Aleph::Tikz_Plane::draw_options(), drop_while(), dsatur_coloring(), Aleph::Simplex< T >::dual_solve(), Aleph::ConstrainedDelaunayTriangulation::edge_opposite(), Aleph::FFT< Real >::effective_coeff_length(), eliminate_dead_code(), Aleph::TestVisual::emit_case_svg(), Aleph::Compiler_C_Backend::Emitter::emit_constant_expression(), Aleph::FFT< Real >::STFTProcessor::emit_ready_frames(), Aleph::FFT< Real >::ISTFTProcessor::emit_samples(), Aleph::ThreadPool::enqueue(), Aleph::ThreadPool::enqueue_batch(), Aleph::ThreadPool::enqueue_detached(), Aleph::Gen_File_B_Tree< Key, Compare, MinDegree, Codec >::ensure_child_has_extra(), Aleph::Gen_B_Tree< Key, Compare, MinDegree >::ensure_child_has_extra(), Aleph::Lengauer_Tarjan_Dominators< GT, SA >::ensure_computed(), eppstein_k_shortest_paths(), eq(), Aleph::howard_detail::Arithmetic< Cost_Type, true >::equal(), Aleph::Matrix< Trow, Tcol, NumType >::equal_to(), Aleph::GenTdRbTree< NodeType, Key, Compare >::equals(), Aleph::GenTdRbTreeRk< NodeType, Key, Compare >::equals(), Aleph::HtdRbTreeRk< Key, Compare >::equals(), Aleph::Gen_File_B_Tree< Key, Compare, MinDegree, Codec >::equals(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::equals(), Aleph::Gen_File_B_Map< Key, Value, Compare, MinDegree, KeyCodec, ValueCodec >::equals_key(), Aleph::Gen_File_BPlus_Map< Key, Value, Compare, MinDegree, KeyCodec, ValueCodec >::equals_key(), Aleph::detail::equiv(), Aleph::RadixTree< T, Char >::erase(), Aleph::RTree< Payload, MaxEntries, MinEntries, Variant >::erase(), Aleph::RTree< Payload, MaxEntries, MinEntries, Variant >::erase_descend(), Aleph::PersistentHashMap< Key, T, Cmp >::erase_impl(), Aleph::Bloom_Filter< T >::estimate(), Aleph::Compact_Quotient_Filter< T >::estimate(), Aleph::Quotient_Filter< T >::estimate(), graph_oracles::euler_class(), Aleph::Compiler_Dataflow_Detail::evaluate_binary(), Aleph::Interpreter_Runtime::evaluate_expr(), Graph_Traverse< GT, Itor, Q, Show_Arc >::exec(), Aleph::Compiler_Bytecode_VM::execute_host_call(), Aleph::Compiler_Bytecode_VM::execute_loop(), Aleph::MemArray< T >::expand(), Aleph::Bidirectional_BFS< GT, Fwd_Itor, Bck_Itor, SA >::expand_frontier(), export_network_to_dot(), Aleph::Gen_Link_Cut_Tree_WithEdges< VT, ET, EdgeMonoid, LazyTag >::export_to_tree_node(), Aleph::Suffix_Automaton::extend(), Aleph::Bounded_Cycle_Index< GT >::extend(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::extract_max_rb(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::extract_min_rb(), Aleph::FFT< Real >::extract_repeated_unit_roots(), extrapolate_left(), extrapolate_right(), Aleph::Gen_Polynomial< Coefficient >::factor_mod_p(), Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::factor_recombination(), Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::factorize(), Aleph::Gen_Polynomial< Coefficient >::factorize(), Aleph::planarity_detail::LR_Planarity_Checker< GT, SA >::fails_component_euler_bound(), Aleph::Packed_Row< Cols >::fast_make(), Aleph::Bellman_Ford< GT, Distance, Ait, NAit, SA >::faster_paint_spanning_tree(), file_to_dynarrays(), Aleph::net_detail::fill_infinite_path(), Aleph::Net_Sup_Dem_Graph< NodeT, ArcT >::filled(), Aleph::RadixTree< T, Char >::find(), Aleph::RadixTree< T, Char >::find(), Aleph::PatriciaMap< UInt, T >::find(), Aleph::PatriciaMap< UInt, T >::find(), Aleph::Naive_Suffix_Tree::find_all(), Aleph::blossom_detail::Edmonds_Blossom_Matcher< GT, SA >::find_augmenting_path(), find_breadth_first_spanning_tree(), TimeoutQueue::find_by_id(), Aleph::TrapezoidalMapPointLocation::find_crossed_trapezoids(), Aleph::ConstrainedDelaunayTriangulation::find_crossing_edges(), find_disjoint_negative_cycles(), Aleph::Network_Simplex< Net >::find_entering_arc(), find_if(), Aleph::Network_Simplex< Net >::find_lca(), Aleph::Gen_BPlus_Tree< Key, Compare, MinDegree >::find_leaf(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::find_leaf_page(), Aleph::Bidirectional_BFS< GT, Fwd_Itor, Bck_Itor, SA >::find_path(), Aleph::Find_Path_Breadth_First< GT, Itor, SA >::find_path(), find_path_breadth_first(), Aleph::Gen_File_B_Map< Key, Value, Compare, MinDegree, KeyCodec, ValueCodec >::find_record(), Aleph::Gen_File_BPlus_Map< Key, Value, Compare, MinDegree, KeyCodec, ValueCodec >::find_record(), Aleph::planarity_detail::LR_Planarity_Checker< GT, SA >::find_simplified_edge_id(), Aleph::ShortestPathInPolygon::find_sleeve(), find_test(), Aleph::planarity_detail::LR_Planarity_Checker< GT, SA >::finish_test(), Aleph::FFT< Real >::firls_impl(), Aleph::Diagnostic_Engine::first_primary_label(), Aleph::CA::Reproductions::fit_log_log_histogram(), Aleph::packed_matrix_detail::fits_in_int64(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::fix_red_condition(), Aleph::Gen_Rb_Tree< NodeType, Key, Compare >::fix_red_condition(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::fix_red_violation(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::fix_underflow(), Aleph::Gen_BPlus_Tree< Key, Compare, MinDegree >::fix_underflow(), Aleph::GenTdRbTree< NodeType, Key, Compare >::flipColors(), Aleph::GenTdRbTreeRk< NodeType, Key, Compare >::flipColors(), Aleph::CA::Ffmpeg_Frame_Sink< Mapper >::flush(), Aleph::FFT< Real >::OverlapAddBank::flush(), Aleph::Tikz_Plane::fmt_double(), Aleph::NTT< MOD, ROOT >::Plan::for_each_index(), Aleph::GeomTriangleAdjacencyUtils::for_each_sorted_edge_group(), graph_harness::for_each_spec(), Aleph::Network_Simplex< Net >::force_partial_arcs_into_tree(), forest_to_bin(), Aleph::Filter_Iterator< Container, It, Show_Item >::forward(), Aleph::graph_dry_detail::In_Arcs_Walk< GT, SA >::forward(), Aleph::FFT< Real >::frame_offsets_impl(), Aleph::Huffman_Encoder_Engine::free_inner_nodes(), Aleph::SweepLineSegmentIntersection::StatusTree::fresh_label_between(), Aleph::MonotonePolygonTriangulation::EdgeStatusTree::fresh_label_between(), Aleph::Compact_Quotient_Filter< T >::from_capacity(), Aleph::Quotient_Filter< T >::from_capacity(), Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::from_json(), Aleph::timsort_detail::gallop_left(), Aleph::timsort_detail::gallop_right(), generate_curve(), Aleph::k_shortest_paths_detail::generate_general_deviation_candidates(), generate_layered_network(), generate_tree(), generate_tree(), generate_tree_graphviz(), Aleph::SkipList< Key, Type >::generateRandomLevel(), generic_preflow_vertex_push_maximum_flow(), Aleph::Hungarian_Assignment< Cost_Type >::get_assignments(), Aleph::Dlink::Iterator::get_curr_ne(), Aleph::Slink_Nc::Iterator::get_curr_ne(), Aleph::Dial_Min_Paths< GT, Distance, Itor, SA >::get_distance(), Aleph::Shortest_Path_Base< GT, Distance, Itor, SA, HeapT >::get_distance(), Aleph::Matrix< Trow, Tcol, NumType >::get_entry(), Aleph::Matrix< Trow, Tcol, NumType >::get_entry(), Aleph::GiftWrappingConvexHull::get_lowest_point(), Aleph::Zero_One_BFS< GT, Distance, Itor, SA >::get_min_path(), Aleph::Dlink::get_next(), Aleph::Hungarian_Result< Cost_Type >::get_pairs(), get_partial_arcs(), Aleph::Dlink::get_prev(), Aleph::DynSlist< T >::get_previous_to_pos(), Aleph::PersistentVector< T >::get_ptr(), Aleph::Polar_Point::get_quadrant(), Aleph::QuickHull::get_right_points(), get_token(), Aleph::ArenaTreeAllocator< Node >::give_back(), Aleph::Dfs_Stack< T >::give_room_back(), Aleph::TestVisual::golden_output_dir(), Aleph::Out_Iterator< GT, Show_Arc >::goto_first_valid(), Aleph::In_Iterator< GT, SA >::goto_first_valid(), Aleph::Filter_Iterator< Container, It, Show_Item >::goto_first_valid_item(), Aleph::Out_Iterator< GT, Show_Arc >::goto_last_valid(), Aleph::In_Iterator< GT, SA >::goto_last_valid(), Aleph::Filter_Iterator< Container, It, Show_Item >::goto_last_valid_item(), Aleph::GenTdRbTree< NodeType, Key, Compare >::gotoLeftAndColorRed(), Aleph::GenTdRbTreeRk< NodeType, Key, Compare >::gotoLeftAndColorRed(), Aleph::GenTdRbTree< NodeType, Key, Compare >::gotoRightAndColorRed(), Aleph::GenTdRbTreeRk< NodeType, Key, Compare >::gotoRightAndColorRed(), has_constrained_edge(), has_curr(), Aleph::Array_Iterator< T >::has_curr(), Aleph::Dlink::Iterator::has_curr(), OhashCommon< HashTbl, Key >::Iterator::has_curr(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::has_curr(), Aleph::Gen_BPlus_Tree< Key, Compare, MinDegree >::Iterator::has_curr(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::has_curr(), Aleph::In_Arcs_Index< GT, SA >::Iterator::has_curr(), Aleph::GenLhashTable< Key, BucketType, Cmp >::Iterator::has_curr(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::has_curr(), Aleph::Gen_Treap_Rk< NodeType, Key, Compare >::Iterator::has_curr(), Aleph::Path< GT >::Iterator::has_current_arc(), QuadTree::has_four_leaf_children(), Aleph::Bounded_Cycle_Index< GT >::has_length(), Aleph::CsvReader::has_next(), Aleph::Bloom_Filter< T >::have_same_hashes(), Aleph::Gen_Polynomial< Coefficient >::hensel_lift(), hlpp_maximum_flow(), hopcroft_karp_matching(), graph_oracles::hops(), hungarian_max_assignment(), Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::ideals_equal(), Aleph::FFT< Real >::iir_filter_impl(), graph_oracles::immediate_dominators(), import_network_from_dimacs(), Aleph::CuttingEarsTriangulation::in_cone(), Aleph::Ellipse::in_unit_interval(), includes(), inconnected_components(), Aleph::net_detail::infinite_arc_preflow(), Aleph::FFT< Real >::initialize_root_guesses(), inOrderThreaded(), Aleph::Path< GT >::insert(), Aleph::GenLhashTable< Key, BucketType, Cmp >::insert(), Aleph::PatriciaSet< UInt >::insert(), Aleph::Dlink::insert(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::insert(), GenTdSplayTreeRk< NodeType, Key, Compare >::insert(), Aleph::SkipList< Key, Type >::insert(), GenTdSplayTree< NodeType, Key, Compare >::insert(), Aleph::Gen_Rand_Tree< NodeType, Key, Compare >::insert(), Aleph::Gen_Rb_Tree< NodeType, Key, Compare >::insert(), Aleph::GenTdRbTree< NodeType, Key, Compare >::insert(), Aleph::List_SGraph< __Graph_Node, __Graph_Arc >::insert_arc(), Aleph::Net_Graph< NodeT, ArcT >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::pdq_detail::insert_back(), Aleph::RTree< Payload, MaxEntries, MinEntries, Variant >::insert_descend(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::insert_dup(), GenTdSplayTreeRk< NodeType, Key, Compare >::insert_dup(), GenTdSplayTree< NodeType, Key, Compare >::insert_dup(), Aleph::Gen_Rand_Tree< NodeType, Key, Compare >::insert_dup(), Aleph::Gen_Rb_Tree< NodeType, Key, Compare >::insert_dup(), Aleph::GenTdRbTree< NodeType, Key, Compare >::insert_dup(), Aleph::PatriciaMap< UInt, T >::insert_impl(), Aleph::PersistentHashMap< Key, T, Cmp >::insert_impl(), Pointer_Table::insert_in_free_table(), Aleph::Gen_File_B_Map< Key, Value, Compare, MinDegree, KeyCodec, ValueCodec >::insert_or_assign(), Aleph::PersistentTreapMap< Key, T, Compare >::insert_or_assign_rec(), insert_sorted(), Aleph::Naive_Suffix_Tree::insert_suffix(), Aleph::Prefix_Tree::insert_word(), insertion_sort(), insertion_sort(), Aleph::AABBTree::insertion_sort_by_center(), insertion_sort_range(), Aleph::bucket_sort_detail::insertion_sort_range(), Aleph::CA::inspect_checkpoint(), Aleph::Compiler_Typed_Semantic_Analyzer::instantiate_type(), Aleph::Compiler_Dataflow_Detail::instruction_is_trivially_dead(), interpolate(), interpreter_values_equal(), Aleph::Rectangle::intersects(), Aleph::Segment::intersects_properly_with(), Pointer_Table::invariant(), Aleph::FFT< Real >::inverse_transform_real_optimized_impl(), invert_digraph(), Aleph::MonotonePolygonTriangulation::is_above(), Aleph::Is_Graph_Acyclique< GT, SA >::is_acyclique(), Aleph::lca_detail::Rooted_Tree_Data< GT, SA >::is_ancestor(), Aleph::Gen_Heavy_Light_Decomposition< GT, SA >::is_ancestor_id(), Aleph::Simplex< T >::is_artificial(), Aleph::Point::is_between(), Aleph::FFT< Real >::PoleZeroPair::is_cancellation(), Aleph::Gen_Polynomial< Coefficient >::is_constant(), is_double(), Aleph::Dlink::is_empty(), Aleph::MpscQueue< T >::is_empty(), Moved_From_Case< AABBTree >::is_empty(), Moved_From_Case< Aho_Corasick >::is_empty(), Moved_From_Case< Async_Life >::is_empty(), Moved_From_Case< Bit_Cell_Storage< 2 > >::is_empty(), Moved_From_Case< Centroid_Decomposition< Graph > >::is_empty(), Moved_From_Case< Cartesian_Tree< int > >::is_empty(), Moved_From_Case< Collector >::is_empty(), Moved_From_Case< CsvReader >::is_empty(), Moved_From_Case< Tree_DP< Graph, long > >::is_empty(), Moved_From_Case< Dense_Cell_Storage< int, 2 > >::is_empty(), Moved_From_Case< Density >::is_empty(), Moved_From_Case< Euler_Tour_LCA< int > >::is_empty(), Moved_From_Case< Floyd_All_Shortest_Paths< Dgraph > >::is_empty(), Moved_From_Case< F::ISTFTProcessor >::is_empty(), Moved_From_Case< F::LFilter >::is_empty(), Moved_From_Case< F::OverlapAdd >::is_empty(), Moved_From_Case< F::OverlapAddBank >::is_empty(), Moved_From_Case< F::OverlapSave >::is_empty(), Moved_From_Case< F::PartitionedConvolver >::is_empty(), Moved_From_Case< F::SOSFilter >::is_empty(), Moved_From_Case< F::STFTProcessor >::is_empty(), Moved_From_Case< Field_Grid >::is_empty(), Moved_From_Case< Field_Life >::is_empty(), Moved_From_Case< Ghost_Grid >::is_empty(), Moved_From_Case< Graph_Lattice< int > >::is_empty(), Moved_From_Case< Graph_Life >::is_empty(), Moved_From_Case< HLD_Sum< Graph, int > >::is_empty(), Moved_From_Case< Heavy_Light_Decomposition< Graph > >::is_empty(), Moved_From_Case< Hungarian_Assignment< long > >::is_empty(), Moved_From_Case< Hashlife_Engine >::is_empty(), Moved_From_Case< Binary_Lifting_LCA< Graph > >::is_empty(), Moved_From_Case< Euler_RMQ_LCA< Graph > >::is_empty(), Moved_From_Case< Li_Chao_Tree< long > >::is_empty(), Moved_From_Case< Life >::is_empty(), Moved_From_Case< Distinct_Count_Mo_On_Trees< Graph > >::is_empty(), Moved_From_Case< Distinct_Count_Mo_On_Tree_Node< int > >::is_empty(), Moved_From_Case< Naive_Suffix_Tree >::is_empty(), Moved_From_Case< Parallel_Life >::is_empty(), Moved_From_Case< PersistentHashMap< int, int > >::is_empty(), Moved_From_Case< PersistentVector< int > >::is_empty(), Moved_From_Case< Pointer_Table >::is_empty(), Moved_From_Case< HLD_Path_Query< Graph, int, Aleph::plus< int > > >::is_empty(), Moved_From_Case< Reroot_DP< Graph, long > >::is_empty(), Moved_From_Case< Rand_Tree< int > >::is_empty(), Moved_From_Case< Random_Life >::is_empty(), Moved_From_Case< RangeTree2D >::is_empty(), Moved_From_Case< Simplex< double > >::is_empty(), Moved_From_Case< RevisedSimplex< double > >::is_empty(), Moved_From_Case< Suffix_Automaton >::is_empty(), Moved_From_Case< Sum_Disjoint_Sparse_Table< int > >::is_empty(), Sparse_Table_Case< Table >::is_empty(), Moved_From_Case< Tiles >::is_empty(), Ordered_Tree_Case< Tree >::is_empty(), graph_oracles::is_euler_walk(), is_float(), Aleph::ThreadPool::is_idle(), Aleph::BinNodeInfixIterator< Node >::is_in_first(), Aleph::Killer_Move_Table< Move, true >::is_killer(), Aleph::Array_Iterator< T >::is_last(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::Node_Arc_Iterator::is_last(), Aleph::BinNodeInfixIterator< Node >::is_last(), Aleph::Rope< Char, LeafSize >::Node::is_leaf(), is_leaf(), Aleph::Gen_Cartesian_Tree< T, Comp >::is_leaf(), is_leap_year(), Aleph::Gen_Link_Cut_Tree< T, Monoid, LazyTag >::is_left(), Aleph::Gen_Polynomial< Coefficient >::is_monic(), Aleph::Bounded_Cycle_Result< GT, Cost_Type >::is_negative(), Aleph::Short_Cycle_Result< GT, Cost_Type >::is_negative(), graph_oracles::is_negative_cycle(), Aleph::FFT< Real >::is_one_sided_interior_bin(), Aleph::Network_Simplex< Net >::is_partial_flow(), Aleph::ConvexPolygonDecomposition::is_polygon_edge(), Aleph::FFT< Real >::is_power_of_two(), Aleph::NTT< MOD, ROOT >::is_power_of_two(), Aleph::Compiler_Dataflow_Detail::is_pure_instruction(), Event_Table< Signature >::is_registered(), Event_Table< void *(void *)>::is_registered(), Aleph::Gen_Link_Cut_Tree< T, Monoid, LazyTag >::is_root(), Aleph::Compact_Quotient_Filter< T >::is_run_start(), Aleph::Quotient_Filter< T >::is_run_start(), is_subsequence(), is_there_a_double_arc(), is_treap(), is_two_power(), Aleph::Dlink::is_unitarian(), Aleph::HTList::is_unitarian(), Aleph::Gen_Treap_Rk< NodeType, Key, Compare >::Iterator::is_updated(), Aleph::Source_Span::is_valid(), Pointer_Table::is_valid_index(), RingFileCache< T >::is_valid_position(), Aleph::detail::PersistentTreapNodeOps< Node, Key, Compare >::is_valid_under(), Aleph::Compiler_Dataflow_Detail::is_value_used(), Aleph::MonotonePolygonTriangulation::is_y_monotone(), Aleph::Matrix< Trow, Tcol, NumType >::is_zero(), Aleph::FFT< Real >::istft_impl(), Aleph::Random_Digraph< GT, Init_Node, Init_Arc >::join(), join(), Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::join_left(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::join_left_rb(), Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::join_right(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::join_right_rb(), Aleph::Random_Graph< GT, Init_Node, Init_Arc >::join_through_a_node(), Aleph::Random_Digraph< GT, Init_Node, Init_Arc >::join_through_a_path(), Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::join_with_pivot(), graph_oracles::kahn_ranks(), Aleph::min_mean_cycle_detail::karp_answer(), Aleph::howard_detail::karp_by_component(), Aleph::min_mean_cycle_detail::karp_solve(), Aleph::min_mean_cycle_detail::karp_sums(), Aleph::min_mean_cycle_detail::karp_table(), kmp_prefix_function(), kmp_search(), knapsack_01_value(), knapsack_bounded(), knapsack_unbounded(), Aleph::Simplex< T >::latex_matrix(), Aleph::ConstrainedDelaunayTriangulation::lawson_flip(), lazy_post_order(), Aleph::blossom_detail::Edmonds_Blossom_Matcher< GT, SA >::lca(), lcp_array_kasai(), Aleph::patricia_trie_detail::Bitwise_Trie_Utils< UInt >::leaf_for(), Aleph::Gen_BPlus_Tree< Key, Compare, MinDegree >::leftmost_leaf(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::leftmost_leaf_page(), Aleph::howard_detail::Arithmetic< Cost_Type, true >::less(), lesser(), Aleph::Compiler_Lexer::lex_block_comment(), Aleph::Compiler_Lexer::lex_char_literal(), Aleph::Compiler_Lexer::lex_identifier_or_keyword(), Aleph::Compiler_Lexer::lex_line_comment(), Aleph::Compiler_Lexer::lex_number(), Aleph::Compiler_Lexer::lex_punctuation_or_operator(), Aleph::Compiler_Lexer::lex_token(), lexicographical_compare(), Aleph::Gen_Binary_Lifting_LCA< GT, SA >::lift(), Aleph::Source_Manager::line_end_offset(), load_distance_option(), load_octal_number(), Aleph::CA::Hashlife_Engine::load_rle(), load_string(), longest_common_subsequence(), Aleph::Suffix_Automaton::longest_common_substring(), lower_bound(), lower_bound(), Aleph::Gen_BPlus_Tree< Key, Compare, MinDegree >::lower_bound_index(), Aleph::Gen_File_B_Tree< Key, Compare, MinDegree, Codec >::lower_bound_index(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::lower_bound_index(), Aleph::Compiler_IR_Lowering::Module_Builder::lower_expr(), Aleph::Compiler_HIR_Lowering::lower_function(), Aleph::Compiler_IR_Lowering::Module_Builder::lower_function_body(), Aleph::Compiler_SSA_Lowering::lower_function_internal(), Aleph::Compiler_CFG_Lowering::lower_statement_sequence(), Aleph::Compiler_IR_Lowering::Module_Builder::lower_stmt(), Aleph::planarity_detail::LR_Planarity_Checker< GT, SA >::lowest(), Aleph::blossom_weighted_detail::mwmatching::impl::MatchingContext< WeightType >::lset_get_best_blossom_edge(), Aleph::blossom_weighted_detail::mwmatching::impl::MatchingContext< WeightType >::lset_merge_blossoms(), Aleph::CA::ca_gif_detail::lzw_bytes(), main(), main(), main(), main(), Aleph::Compiler_Bytecode_VM::make_error(), Aleph::Random_Digraph< GT, Init_Node, Init_Arc >::make_eulerian(), Aleph::CA::make_path_graph_adjacency(), manacher(), map_arcs(), Aleph::ConstrainedDelaunayTriangulation::map_constraints(), map_cut_graph(), Aleph::Compute_Cut_Nodes< GT, SA >::map_cut_graph(), map_nodes(), Aleph::Compiler_Dataflow_Detail::mark_value_used(), Aleph::FlatMap< Key, T, Compare >::match_at(), Aleph::FlatSet< Key, Compare >::match_at(), graph_oracles::max_flow(), Aleph::Gen_B_Tree< Key, Compare, MinDegree >::max_in(), graph_oracles::max_matching(), Aleph::min_mean_cycle_detail::mean_order(), merge(), merge(), merge(), Aleph::timsort_detail::merge_collapse(), Aleph::timsort_detail::merge_force_collapse(), Aleph::timsort_detail::merge_hi(), merge_lists(), Aleph::timsort_detail::merge_lo(), Aleph::Compiler_Driver::merge_modules_from_order(), Aleph::Compiler_MVP_Frontend::merge_modules_from_order(), Aleph::parallel_detail::merge_sequential(), min_cut(), Aleph::Gen_B_Tree< Key, Compare, MinDegree >::min_in(), Aleph::Prim_Min_Spanning_Tree< GT, Distance, SA >::min_spanning_tree(), min_weighted_squared_distance_1d(), Aleph::FFT< Real >::minimum_cancellation_distance_impl(), Aleph::howard_detail::minimum_mean_cycle(), Aleph::RotatingCalipersConvexPolygon::minimum_width(), mismatch(), monotone_queue_min_dp(), most_negative_cycle_bounded(), most_negative_cycle_up_to_3(), Aleph::FFT< Real >::multiply_complex_impl(), Aleph::howard_detail::Arithmetic< Cost_Type, true >::multiply_overflows(), Aleph::FFT< Real >::multiply_real_optimized(), Aleph::Compiler_Type_Context::mutable_type(), Aleph::CA::Kernel2D< T, Rows, Cols >::neighbour_weight(), network_to_dot_string(), Aleph::Find_Depth_First_Spanning_Tree< GT, SA >::Frame::next_target(), Aleph::Build_Subgraph< GT, SA >::Arc_Frame::next_target(), nibble_to_char(), nonplanar_certificate_to_dot(), nonplanar_certificate_to_gexf(), nonplanar_certificate_to_graphml(), Aleph::MinkowskiSumConvex::normalize(), Aleph::Compiler_SSA_Detail::normalize_ir_function(), Aleph::ConvexPolygonIntersectionBasic::normalize_vertices(), Aleph::HalfPlaneIntersection::normalize_vertices(), Aleph::cancellation_detail::Exact_State::notify_locked_observers(), Aleph::Gen_Polynomial< Coefficient >::nth_derivative(), Aleph::df_tree_detail::number_tree(), Aleph::negative_cycles_detail::odd_significand(), Aleph::negative_cycles_detail::Best_Cycle< Cost_Type >::offer(), Aleph::negative_cycles_detail::Short_Cycle_Best< Cost_Type >::offer(), Aleph::Compiler_Driver::ok(), Aleph::Compiler_Generic_Driver::ok(), graph_oracles::on_cycle(), Aleph::CA::Density_Observer< State >::on_step_begin(), Aleph::CA::Entropy_Observer< MaxState >::on_step_begin(), Aleph::CA::Stationary_Detector::on_step_begin(), Aleph::CA::Sampling_Observer< Lattice >::on_step_begin(), Aleph::CA::Stationary_Detector::on_step_end(), only_alpha(), Aleph::Initialize_Dist< AM, Compare >::operator()(), Aleph::k_shortest_paths_detail::Filtered_Show_Arc< GT, SA >::operator()(), Aleph::logical_and< _Tp >::operator()(), Aleph::HalfPlaneIntersection::operator()(), Aleph::SweepLineSegmentIntersection::operator()(), Aleph::CA::BBM_Rule::operator()(), Aleph::CA::TM_Gas_Rule::operator()(), Aleph::DelaunayTriangulationRandomizedIncremental::operator()(), Aleph::GiftWrappingConvexHull::operator()(), Aleph::ConstrainedDelaunayTriangulation::operator()(), Aleph::AlphaShape::operator()(), Aleph::Invert_Digraph< GT, SA >::operator()(), Aleph::MinkowskiSumConvex::operator()(), Aleph::ConvexPolygonDecomposition::operator()(), Aleph::VisibilityPolygon::operator()(), Aleph::ShortestPathInPolygon::operator()(), Aleph::BruteForceConvexHull::CmpSegment::operator()(), Aleph::CA::Game_Of_Life_Functor::operator()(), InitArc::operator()(), Aleph::Build_Grid< GT, Operation_On_Node, Operation_On_Arc >::operator()(), Aleph::Compare_Tnode< Tlink, Tnode, T, Compare >::operator()(), Aleph::Dft_Arc_Cmp< GT >::operator()(), Graph_Traverse< GT, Itor, Q, Show_Arc >::operator()(), Graph_Traverse< GT, Itor, Q, Show_Arc >::operator()(), Polinomio::operator+=(), Aleph::Point::operator<(), Aleph::RingBuffer< T >::basic_iterator< IsConst >::operator==(), Aleph::BinTreeXt_Iterator< TreeType, Node, Key, Compare >::operator==(), Coord::operator==(), Aleph::Ellipse::operator==(), Aleph::FlatMap< Key, T, Compare >::operator==(), Aleph::FlatSet< Key, Compare >::operator==(), Foo::operator==(), Aleph::Gen_Polynomial< Coefficient >::operator==(), Aleph::CA::History_Cell< State, Depth >::operator==(), Aleph::Interval< T >::operator==(), Aleph::Gen_Treap_Rk< NodeType, Key, Compare >::Iterator::operator==(), Aleph::LineEq::operator==(), Aleph::Aho_Corasick::Match::operator==(), Aleph::CA::ca_hashlife_detail::Node_Key::operator==(), Aleph::Point::operator==(), Aleph::Point3D::operator==(), Aleph::CA::Reaction_Diffusion_Cell< Real >::operator==(), Aleph::Rectangle::operator==(), Aleph::Rope< Char, LeafSize >::operator==(), Aleph::RotatedEllipse::operator==(), Aleph::Segment::operator==(), Aleph::Segment3D::operator==(), Aleph::StlEnumerateIterator< Container >::operator==(), Aleph::StlZipIterator< Containers >::operator==(), Aleph::AssignLazyTag< T >::tag_type::operator==(), Aleph::Triangle::operator==(), Aleph::Gen_Interval_Tree< NodeType, T, Compare >::overlap_search(), Aleph::Interval< T >::overlaps(), Aleph::Gen_File_B_Tree< Key, Compare, MinDegree, Codec >::page(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::page(), Aleph::Gen_File_B_Tree< Key, Compare, MinDegree, Codec >::page(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::page(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::paint(), Aleph::AStar_Min_Path< GT, Distance, Heuristic, Itor, SA, HeapT >::paint_min_paths_tree(), Aleph::Dijkstra_Min_Paths< GT, Distance, Itor, SA, HeapT >::paint_min_paths_tree(), Aleph::Kruskal_Min_Spanning_Tree< GT, Distance, SA >::paint_min_spanning_tree(), Aleph::Prim_Min_Spanning_Tree< GT, Distance, SA >::paint_min_spanning_tree(), Aleph::AStar_Min_Path< GT, Distance, Heuristic, Itor, SA, HeapT >::paint_partial_min_paths_tree(), Aleph::Dijkstra_Min_Paths< GT, Distance, Itor, SA, HeapT >::paint_partial_min_paths_tree(), Aleph::AStar_Min_Path< GT, Distance, Heuristic, Itor, SA, HeapT >::paint_partial_path(), Aleph::Bellman_Ford< GT, Distance, Ait, NAit, SA >::paint_spanning_tree(), Aleph::planarity_detail::pair_empty(), Aleph::Compiler_Typed_Semantic_Analyzer::parameter_type(), parse_connexion(), parse_graph_definition(), Aleph::CA::Hashlife_Engine::parse_header_value(), Aleph::Compiler_Bytecode_Detail::parse_integer(), Aleph::Compiler_Line_Frontend::parse_integer(), Aleph::Compiler_Backend_C_Detail::parse_integer_literal(), Aleph::CA::ca_io_detail::parse_json_number(), Aleph::CA::ca_io_detail::parse_json_size_field(), Aleph::Compiler_Parser::parse_parenthesized_type(), Aleph::Compiler_Parser::parse_return_statement(), Aleph::CA::parse_rule(), Aleph::CA::Hashlife_Engine::parse_rule_field(), Aleph::Compiler_Parser_Stream::parse_separated_list(), Aleph::Compiler_Line_Frontend::parse_source_file(), Aleph::pdq_detail::partition_by_blocks(), Aleph::pdq_detail::partition_by_branches(), Aleph::pdq_detail::partition_left(), Aleph::FFT< Real >::pbatched_stft(), Aleph::NTT< MOD, ROOT >::pbigint_multiply(), Aleph::Topological_Sort< GT, Itor, SA >::perform(), Aleph::FFT< Real >::OverlapAddBank::pflush(), Aleph::FFT< Real >::phase_margin_impl(), Aleph::FFT< Real >::phase_margin_refined_impl(), Aleph::Network_Simplex< Net >::pivot_tree(), Aleph::Gen_Interval_Tree< NodeType, T, Compare >::place(), Aleph::negative_cycles_detail::Short_Cycle_Best< Cost_Type >::plain_sum(), planar_dual_metadata(), planar_geometric_drawing(), Aleph::DelaunayTriangulationRandomizedIncremental::point_in_tri(), Aleph::ShortestPathInPolygon::point_in_triangle(), Aleph::FFT< Real >::OverlapAdd::pointwise_multiply(), Aleph::FFT< Real >::OverlapAddBank::pointwise_multiply_batch(), Aleph::detail::pollard_rho_step(), Aleph::NTT< MOD, ROOT >::poly_power(), Aleph::NTT< MOD, ROOT >::poly_scalar_mul_series(), Aleph::NTT< MOD, ROOT >::poly_sqrt(), polygon_from_vertex_indices(), polygon_from_vertices(), Aleph::PersistentVector< T >::pop_back(), positions_of(), precompute_x_for_node(), preorder_to_bst(), preOrderThreaded(), Aleph::NTTExact::prime_supports_product_size(), Aleph::Network_Simplex< Net >::print_diagnostics(), Aleph::Negamax< Domain >::probe_transposition(), process_node(), Aleph::CA::Dense_Cell_Storage< T, N >::product(), proper_intersection(), Aleph::FFT< Real >::Plan::ptransform_batch(), put_portals(), put_segment_arrangement_result(), Aleph::Li_Chao_Tree< T >::query_impl(), Aleph::Gen_Segment_Tree< T, Op >::query_impl(), Aleph::Gen_Lazy_Segment_Tree< Policy >::query_impl(), Aleph::Segment_Tree_Beats< T >::query_max_impl(), Aleph::Segment_Tree_Beats< T >::query_min_impl(), Aleph::Convex_Hull_Trick< T >::query_monotone(), Aleph::RangeTree2D::query_range(), Aleph::Segment_Tree_Beats< T >::query_sum_impl(), quicksort_insertion(), Aleph::CA::ca_dot_detail::quote_id_if_needed(), rabin_karp_search(), Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::radical_member(), radix_sort(), random_select(), graph_harness::random_spec(), RingFileCache< T >::read_from(), RingFileCache< T >::read_from(), Aleph::CA::read_json_snapshot(), Aleph::CA::read_life_105(), Aleph::CA::read_life_106(), Aleph::CA::read_rle(), Aleph::FFT< Real >::recommended_cache_tile_size(), Aleph::NTTExact::reconstruct_product(), Aleph::Killer_Move_Table< Move, true >::record(), Aleph::Compiler_Typed_Semantic_Analyzer::record_param_type(), Aleph::Gen_File_B_Tree< Key, Compare, MinDegree, Codec >::recover_from_wal(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::recover_from_wal(), Aleph::Gen_File_B_Tree< Key, Compare, MinDegree, Codec >::recover_if_needed(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::recover_if_needed(), red_black_height_rk(), Aleph::Gen_MultiPolynomial< Coefficient, MonomOrder >::redundant_pair_by_chain_criterion(), Aleph::FFT< Real >::refine_scalar_crossing(), Aleph::Net_Graph< NodeT, ArcT >::register_ends_of_leaving(), Aleph::Bellman_Ford< GT, Distance, Ait, NAit, SA >::relaxes(), Aleph::detail::Pid_File_Lock::release(), Aleph::MemArray< T >::relocate_and_insert(), Aleph::FFT< Real >::remez_impl(), Aleph::GenLhashTable< Key, BucketType, Cmp >::remove(), Aleph::Range_Mode_Policy< T >::remove(), Aleph::Gen_B_Tree< Key, Compare, MinDegree >::remove(), Aleph::Gen_BPlus_Tree< Key, Compare, MinDegree >::remove(), Aleph::Gen_File_B_Tree< Key, Compare, MinDegree, Codec >::remove(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::remove(), Aleph::Gen_Treap< NodeType, Key, Compare >::remove(), Aleph::SkipList< Key, Type >::remove(), QuadTree::remove(), Aleph::Compact_Cuckoo_Filter< T, FingerprintBits, EntriesPerBucket >::remove(), Aleph::Cuckoo_Filter< T, FingerprintBits, EntriesPerBucket >::remove(), Aleph::Compact_Quotient_Filter< T >::remove(), Aleph::Quotient_Filter< T >::remove(), Aleph::Gen_File_B_Tree< Key, Compare, MinDegree, Codec >::remove_from(), Aleph::Gen_B_Tree< Key, Compare, MinDegree >::remove_from(), Aleph::GenBinHeap< NodeType, Key, Compare >::remove_last(), Aleph::Index_Graph< GT, Compare, Tree >::remove_node(), Pointer_Table::remove_pointer(), Aleph::Compiler_Driver_Detail::render_messages(), Aleph::Compiler_Bytecode_Context::reset(), Aleph::Compiler_Ast_Context::reset(), Aleph::Compiler_CFG_Context::reset(), Aleph::Compiler_HIR_Context::reset(), Aleph::Compiler_IR_Context::reset(), Aleph::Compiler_SSA_Context::reset(), Aleph::Slink_Nc::Iterator::reset_first(), Aleph::Dlink::Iterator::reset_first(), Aleph::Dlink::Iterator::reset_last(), Aleph::GenLhashTable< Key, BucketType, Cmp >::resize(), Aleph::Compiler_Driver::resolve_import_order(), Aleph::Compiler_Line_Frontend::resolve_import_order(), Aleph::Compiler_MVP_Frontend::resolve_import_order(), Aleph::Compiler_Module_Resolver_Detail::resolve_visit(), Aleph::GenTdRbTree< NodeType, Key, Compare >::restoreRedCondition(), Aleph::GenTdRbTreeRk< NodeType, Key, Compare >::restoreRedCondition(), Aleph::net_detail::return_dust(), reverse(), Aleph::Gen_BPlus_Tree< Key, Compare, MinDegree >::rightmost_leaf(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::rightmost_leaf_page(), Aleph::RTree< Payload, MaxEntries, MinEntries, Variant >::rstar_choose_overlap(), Aleph::RTree< Payload, MaxEntries, MinEntries, Variant >::rstar_split(), Aleph::Network_Simplex< Net >::run(), Aleph::Zero_One_BFS< GT, Distance, Itor, SA >::run_bfs(), Aleph::Dial_Min_Paths< GT, Distance, Itor, SA >::run_dial(), QueueTheadsPool< T >::run_event(), safe_atof(), safe_atol(), Aleph::Compiler_Bytecode_Detail::same_constant(), Aleph::HalfPlaneIntersection::same_direction(), Aleph::Compiler_Backend_C_Detail::sanitize_identifier(), graph_oracles::saturated_add(), save_level_pos_2(), graph_oracles::scc_partition(), Aleph::Aho_Corasick::search(), search(), Aleph::Tarjan_Connected_Components< GT, Itor, SA >::search(), Aleph::Find_Aumenting_Path< Net, Q >::search(), Aleph::Gen_Avl_Tree< NodeType, Key, Compare >::search_and_stack_avl(), Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::search_and_stack_avl(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::search_and_stack_rb(), Aleph::Gen_Rb_Tree< NodeType, Key, Compare >::search_and_stack_rb(), search_arc(), Aleph::Branch_And_Bound< Domain, ObjectivePolicy >::search_best_first(), search_directed_arc(), Aleph::Gen_Avl_Tree< NodeType, Key, Compare >::search_dup_and_stack_avl(), Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::search_dup_and_stack_avl(), search_n(), Aleph::GenLhashTable< Key, BucketType, Cmp >::search_or_insert(), Aleph::Gen_Treap_Rk< NodeType, Key, Compare >::search_or_insert(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::search_or_insert(), Aleph::Gen_Rb_Tree< NodeType, Key, Compare >::search_or_insert(), Aleph::GenTdRbTree< NodeType, Key, Compare >::search_or_insert(), search_spanning_tree_arc(), Aleph::GenTdRbTree< NodeType, Key, Compare >::searchFlipColorsAndInsert(), Aleph::GenTdRbTreeRk< NodeType, Key, Compare >::searchFlipColorsAndInsert(), Aleph::GenTdRbTree< NodeType, Key, Compare >::searchFlipColorsAndInsertDup(), Aleph::GenTdRbTreeRk< NodeType, Key, Compare >::searchFlipColorsAndInsertDup(), searchInBinTree(), segment_intersection_point(), Aleph::planarity_detail::segments_properly_intersect(), select(), Aleph::RevisedSimplex< T >::select_leaving_variable(), select_ne(), Aleph::Dlink::Iterator::set(), Aleph::Slink_Nc::Iterator::set(), Aleph::CA::Hashlife_Engine::set_alive(), Aleph::Gen_File_B_Tree< Key, Compare, MinDegree, Codec >::set_auto_sync(), Aleph::Matrix< Trow, Tcol, NumType >::set_entry(), Aleph::ThreadPool::set_queue_limits(), Aleph::Net_Sup_Dem_Graph< NodeT, ArcT >::set_supply_flow(), TimeoutQueue::Event::set_trigger_time(), shellsort(), Aleph::Compact_Quotient_Filter< T >::shift_elements_left(), Aleph::Quotient_Filter< T >::shift_elements_left(), graph_oracles::shortest_distances(), Aleph::k_shortest_paths_detail::shortest_path_filtered(), Aleph::detail::shortest_path_portals(), Aleph::FFT< Real >::should_parallelize_batch_work(), Aleph::NTT< MOD, ROOT >::Plan::should_use_avx2(), Aleph::FFT< Real >::Plan::should_use_avx2(), Aleph::NTT< MOD, ROOT >::Plan::should_use_neon(), Aleph::FFT< Real >::Plan::should_use_neon(), OhashCommon< HashTbl, Key >::shrink_after_removal(), Aleph::arrayheap_detail::sift_down(), Aleph::arrayheap_detail::sift_up(), Aleph::GenBinHeap< NodeType, Key, Compare >::sift_up(), Aleph::Gen_Polynomial< Coefficient >::sign_variations(), Aleph::FFT< Real >::simd_preference(), Aleph::NTT< MOD, ROOT >::simd_preference(), Aleph::VisvalingamWhyattSimplification::simplify_open_array(), Aleph::VisvalingamWhyattSimplification::simplify_polygon(), Aleph::Compiler_Dataflow_Detail::simulate_block(), Aleph::CsvReader::skip(), Aleph::Gen_BPlus_Tree< Key, Compare, MinDegree >::Iterator::skip_past_end(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::Iterator::skip_past_end(), Aleph::Compiler_Lexer::skip_whitespace(), Aleph::Rope< Char, LeafSize >::slice(), Aleph::SweepLineSegmentIntersection::slope_less(), adaptive_huffman_demo::snapshot(), Aleph::blossom_detail::Edmonds_Blossom_Matcher< GT, SA >::solve(), Aleph::Hungarian_Assignment< Cost_Type >::solve(), solve_circulation(), Aleph::pdq_detail::sort_loop(), sort_ranked_moves(), Aleph::planarity_detail::LR_Planarity_Checker< GT, SA >::sort_size_t_array(), Aleph::Source_Manager::span(), split_key(), Aleph::HTList::split_list(), Aleph::Dlink::split_list_ne(), Aleph::TrapezoidalMapPointLocation::split_multiple_trapezoids(), split_n(), Aleph::TrapezoidalMapPointLocation::split_single_trapezoid(), Aleph::random_detail::splitmix64_gives_the_numbers_of_its_reference(), Aleph::detail::spp_build_tris(), Aleph::detail::spp_find_sleeve(), Aleph::detail::spp_point_in_triangle(), ssp_init_potentials(), ssp_shortest_path(), Aleph::CA::Ffmpeg_Frame_Sink< Mapper >::start(), Aleph::CA::state_histogram(), std_zip(), stl_compare(), stl_drop_while(), stl_equal(), stl_range(), stl_zip_compare(), stl_zip_drop(), stl_zip_drop_while(), stl_zip_take(), stl_zip_to_pairs(), Aleph::search_engine_detail::stop_after_solution(), Aleph::CancellationToken::stop_requested(), Aleph::Gen_Polynomial< Coefficient >::sturm_sign_changes(), Aleph::Tikz_Plane::style_requires_patterns(), subset_sum(), subset_sum_count(), subset_sum_exists(), subset_sum_mitm(), Aleph::blossom_weighted_detail::mwmatching::impl::MatchingContext< WeightType >::substage_calc_dual_delta(), Aleph::howard_detail::Arithmetic< Cost_Type, true >::subtract_overflows(), Aleph::patricia_trie_detail::Bitwise_Trie_Utils< UInt >::subtree_matches(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::subtree_min(), successive_shortest_paths(), Aleph::FFT< Real >::Plan::supports_power_of_two_real_optimization(), Aleph::NTT< MOD, ROOT >::supports_power_of_two_size(), Aleph::NTTExact::supports_product_size(), Aleph::NTT< MOD, ROOT >::supports_root_order(), Aleph::NTT< MOD, ROOT >::supports_size(), Aleph::Dlink::swap(), Aleph::Gen_HLD< GT, T, Op, SA >::swap(), Aleph::Gen_HLD_Path_Query< GT, T, Op, SA >::swap(), Aleph::SmallVector< T, N >::swap(), hash_dry_detail::swap_compare(), swap_node_with_predecessor(), swap_node_with_successor(), Aleph::GenBinHeap< NodeType, Key, Compare >::swap_root_with_last(), Aleph::Compiler_Symbol_Bindings::symbol(), Aleph::Gen_File_B_Tree< Key, Compare, MinDegree, Codec >::sync(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::sync(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), Aleph::Compiler_Dataflow_Bit_Set::test(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), test_black_condition_rk(), test_DynSet(), test_DynSetLinHash(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), testResize(), Aleph::min_cost_matching_detail::to_ll_checked(), Aleph::Simplex< T >::to_pivot(), Aleph::NTT< MOD, ROOT >::tonelli_shanks(), Aleph::FFT< Real >::transform_axis_impl(), Aleph::FFT< Real >::Plan::transform_batch(), Aleph::FFT< Real >::transform_impl(), Aleph::FFT< Real >::transform_real_optimized(), Aleph::Graph_Traverse_Generator< GT, Itor, Q, Show_Arc >::traverse(), Aleph::in_arcs_detail::traverse_digraph_arcs_into(), Aleph::MonotonePolygonTriangulation::triangulate_monotone(), TimeoutQueue::triggerEvent(), Aleph::CA::ca_io_detail::trim_copy(), Aleph::Compiler_Line_Frontend::trim_copy(), Aleph::FFT< Real >::trim_leading_zeros_copy(), Aleph::Compiler_Line_Frontend::trim_quotes_copy(), Aleph::NTT< MOD, ROOT >::trim_trailing_zeros(), Aleph::NTT< MOD, ROOT >::truncate_poly(), Aleph::Array_Graph< __Graph_Node, __Graph_Arc >::try_insert_arc(), Aleph::Compiler_Type_Context::type(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST(), TYPED_TEST_P(), tzip(), tzip_longest(), tzipEq(), uni_compare(), uni_drop_while(), uni_equal(), uni_take(), Aleph::Gen_Interval_Tree< NodeType, T, Compare >::unlink(), Aleph::CancellationToken::ConditionVariableRegistration::unregister(), Aleph::detail::Pid_File_Lock::unregister_path(), Aleph::adaptive_huffman_detail::Model::update(), Aleph::Gen_Lazy_Segment_Tree< Policy >::update_impl(), Aleph::negative_cycles_detail::Exact_Sum< T >::upper(), upper_bound(), upper_bound(), Aleph::Gen_BPlus_Tree< Key, Compare, MinDegree >::upper_bound_index(), Aleph::Gen_File_B_Tree< Key, Compare, MinDegree, Codec >::upper_bound_index(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::upper_bound_index(), Aleph::HalfPlaneIntersection::upper_half(), Moved_From_Case< Aho_Corasick >::use(), Aleph::parallel_detail::use_sequential_parallel_path(), Aleph::parallel_detail::use_sequential_path(), Aleph::Packed_Row< Cols >::valid(), valid_day(), valid_month(), validate_bytecode_function(), validate_cfg_function(), validate_dataflow_analysis(), validate_dead_code_elimination(), validate_ir_function(), Aleph::graph_coloring_detail::validate_no_self_loops(), validate_nonplanar_certificate(), Aleph::FFT< Real >::validate_overlap_constraints(), validate_ssa_function(), Aleph::Compiler_Line_Frontend::validate_top_level_calls(), Aleph::blossom_weighted_detail::mwmatching::impl::MatchingVerifier< WeightType >::verify(), Aleph::Gen_Avl_Tree< NodeType, Key, Compare >::verify(), Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::verify(), Aleph::Gen_B_Tree< Key, Compare, MinDegree >::verify(), Aleph::Gen_BPlus_Tree< Key, Compare, MinDegree >::verify(), Aleph::Gen_File_B_Tree< Key, Compare, MinDegree, Codec >::verify(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::verify(), Aleph::PersistentHashMap< Key, T, Cmp >::verify(), Aleph::PersistentTreapSet< Key, Compare >::verify(), Aleph::PersistentTreapMap< Key, T, Compare >::verify(), Aleph::RTree< Payload, MaxEntries, MinEntries, Variant >::verify(), Aleph::RadixTree< T, Char >::verify(), Aleph::Gen_Rand_Tree< NodeType, Key, Compare >::verify(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::verify(), GenTdSplayTreeRk< NodeType, Key, Compare >::verify(), Aleph::GenTdRbTree< NodeType, Key, Compare >::verify(), Aleph::GenTdRbTreeRk< NodeType, Key, Compare >::verify(), Aleph::Gen_Treap< NodeType, Key, Compare >::verify(), Aleph::Gen_Treap_Rk< NodeType, Key, Compare >::verify(), Aleph::PersistentVector< T >::verify(), verify_assignment(), Aleph::howard_detail::verify_exactly(), Aleph::GenBinHeap< NodeType, Key, Compare >::verify_heap(), Aleph::Gen_BPlus_Tree< Key, Compare, MinDegree >::verify_leaf_chain(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::verify_leaf_chain(), Aleph::Gen_B_Tree< Key, Compare, MinDegree >::verify_node(), Aleph::Gen_BPlus_Tree< Key, Compare, MinDegree >::verify_node(), Aleph::Gen_File_BPlus_Tree< Key, Compare, MinDegree, Codec >::verify_node(), Aleph::Gen_File_B_Tree< Key, Compare, MinDegree, Codec >::verify_node(), Aleph::RTree< Payload, MaxEntries, MinEntries, Variant >::verify_rec(), Aleph::Rope< Char, LeafSize >::verify_rec(), Aleph::RadixTree< T, Char >::verify_rec(), Aleph::detail::PersistentTreapNodeOps< Node, Key, Compare >::verify_rec(), Aleph::PersistentHashMap< Key, T, Cmp >::verify_rec(), Aleph::blossom_weighted_detail::mwmatching::impl::MatchingVerifier< WeightType >::verify_vertex_duals(), vertex_connectivity(), Aleph::Bidirectional_BFS< GT, Fwd_Itor, Bck_Itor, SA >::visit_backward(), visualize_convex_hull(), Aleph::CA::ca_neighborhood_detail::von_neumann_count(), Aleph::CA::ca_vtk_detail::vtk_scalar_type(), Aleph::ThreadPool::wait_all_for(), Aleph::ThreadPool::wait_all_until(), warshall_compute_transitive_clausure(), Aleph::ThreadPool::worker_loop(), write_leaves(), Aleph::CA::ca_vtk_detail::write_scalar(), Aleph::CA::ca_io_detail::write_text_scalar(), Aleph::CA::ca_io_detail::write_wrapped_rle_body(), Aleph::planarity_detail::xml_escape_string(), yen_k_shortest_paths(), z_algorithm(), zip(), zip_drop(), zip_drop_while(), zip_longest(), zip_longest_opt(), zip_take(), and zipEq().
|
inlineconstexpr |
|
inlineconstexpr |
Default buffer size for token parsing.
Maximum size for individual tokens (strings, numbers). Tokens exceeding this size will cause an error.
Definition at line 134 of file parse_utils.H.
Referenced by get_token(), load_binary_number(), load_deway_number(), load_double(), load_escaped_string(), load_hex_number(), load_identifier(), load_number(), load_octal_number(), load_string(), parse_deway_number(), and TEST().
|
constexpr |
Special marker for arcs connecting a cut node to a non-cut block.
Used by paint_subgraphs()/map_cut_graph().
Definition at line 1818 of file tpl_graph_utils.H.
Referenced by __paint_from_cut_node(), is_a_cross_arc(), and Aleph::Compute_Cut_Nodes< GT, SA >::paint_from_cut_node().
|
inline |
Current column number in the input stream.
Updated automatically by read_char_from_stream(). Column numbering starts at 1, resets to 0 on newline.
Definition at line 150 of file parse_utils.H.
Referenced by Aleph::SourceLocation::current(), init_token_scanning(), load_binary_number(), load_double(), load_hex_number(), load_identifier(), load_octal_number(), mark_position(), read_char_from_stream(), reset_parse_state(), restore_position(), skip_block_comment(), skip_line_comment(), skip_whitespace_and_comments(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
|
inline |
Current line number in the input stream.
Updated automatically by read_char_from_stream(). Line numbering starts at 1.
Definition at line 142 of file parse_utils.H.
Referenced by Aleph::SourceLocation::current(), init_token_scanning(), mark_position(), read_char_from_stream(), reset_parse_state(), restore_position(), skip_block_comment(), skip_line_comment(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
| bool Aleph::daemonized = false |
Flag indicating if the process is running as a daemon.
Definition at line 40 of file ahDefs.C.
Referenced by daemonize().
| const unsigned Aleph::Default_Hash_Seed = 52679987 |
Definition at line 46 of file hash-fct.C.
Referenced by init_jsw(), jsw_hash(), jsw_hash(), TEST(), and TEST_F().
|
inlineconstexpr |
Sentinel marking an axis whose extent is only known at run time.
Definition at line 277 of file ah-mdspan.H.
Referenced by Aleph::extents< IndexType, Exts >::extents(), Aleph::extents< IndexType, Exts >::extents(), and Aleph::extents< IndexType, Exts >::extents().
|
inlineconstexpr |
Whether a Filter_Iterator keeps a copy of its container, and not its address.
A container that is a pointer (the node over whose arcs a Node_Arc_Iterator goes) or a small view of another container is usually a parameter or a temporary, whose address dies before the iterator: the iterator keeps its value instead. A view says so with a member filter_iterator_keeps_a_copy and a constructor of an empty view, usable by Filter_Iterator.
Definition at line 69 of file filter_iterator.H.
| const float Aleph::hash_default_lower_alpha = 0.25 |
Definition at line 38 of file hash-dry.C.
Referenced by Aleph::functional_detail::all_unique_hash_path(), OpenTableWithoutMemory< Table >::make(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), and TEST_F().
| const float Aleph::hash_default_upper_alpha = 0.90 |
Definition at line 40 of file hash-dry.C.
Referenced by Aleph::functional_detail::all_unique_hash_path(), OpenTableWithoutMemory< Table >::make(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), and TEST_F().
|
static |
Definition at line 54 of file hash-fct.C.
Referenced by Aleph::Arcs_Index< GT, Compare, Tree, SA >::Arcs_Index(), Aleph::Arcs_Index< GT, Compare, Tree, SA >::Arcs_Index(), Aleph::Gen_Cartesian_Tree< T, Comp >::Gen_Cartesian_Tree(), Aleph::Gen_Reroot_DP< GT, T, SA >::Gen_Reroot_DP(), Aleph::Gen_Tree_DP< GT, T, SA >::Gen_Tree_DP(), Aleph::Gsl_Compatible_Rng::Gsl_Compatible_Rng(), Aleph::Gsl_Compatible_Rng::Gsl_Compatible_Rng(), Aleph::Slinknc::Iterator::Iterator(), Aleph::CA::Multi_Field_Lattice< Layout, Boundary, Rank, Fields >::Multi_Field_Lattice(), Aleph::Nodes_Index< GT, Compare, Tree, SN >::Nodes_Index(), Aleph::Nodes_Index< GT, Compare, Tree, SN >::Nodes_Index(), Aleph::Path< GT >::Path(), Aleph::Path< GT >::append(), Aleph::Path< GT >::append_directed(), RingFileCache< T >::create(), Aleph::Interpreter_Runtime::evaluate_stmt(), Aleph::CA::Multi_Field_Lattice< Layout, Boundary, Rank, Fields >::fill(), Aleph::CA::Multi_Field_Lattice< Layout, Boundary, Rank, Fields >::fill_impl(), Aleph::Dial_Min_Paths< GT, Distance, Itor, SA >::find_min_path(), Aleph::Zero_One_BFS< GT, Distance, Itor, SA >::find_min_path(), Aleph::Bidirectional_BFS< GT, Fwd_Itor, Bck_Itor, SA >::find_path(), Aleph::FunctionalMixin< Derived, Type >::fold(), Aleph::FunctionalMixin< Derived, Type >::fold(), Aleph::FunctionalMixin< Derived, Type >::fold_left(), fold_perm(), fold_perm(), Aleph::FunctionalMixin< Derived, Type >::foldl(), foldl(), Aleph::Const_Graph_View< GT >::foldl_arcs(), foldl_arcs(), foldl_arcs(), foldl_in_arcs(), foldl_in_arcs(), Aleph::Const_Graph_View< GT >::foldl_nodes(), foldl_nodes(), foldl_out_arcs(), foldr(), init_jsw(), Aleph::Path< GT >::insert(), Aleph::Path< GT >::insert_directed(), is_jsw_initialized(), jsw_fill_table(), jsw_hash(), jsw_hash(), Aleph::CA::Multi_Field_Lattice< Layout, Boundary, Rank, Fields >::make_soa_init(), Aleph::Prim_Min_Spanning_Tree< GT, Distance, SA >::min_spanning_tree(), Aleph::Dial_Min_Paths< GT, Distance, Itor, SA >::paint_min_paths_tree(), Aleph::Zero_One_BFS< GT, Distance, Itor, SA >::paint_min_paths_tree(), Aleph::Compiler_Parser::parse_let_statement(), Aleph::detail::ranges_fold_left(), Aleph::Slinknc::Iterator::reset_first(), RingFileCache< T >::resize(), scanl(), scanl_sum(), Aleph::Gsl_Compatible_Rng::seed(), Aleph::Path< GT >::set_graph(), stl_foldl(), stl_foldr(), stl_reduce(), stl_scan_left(), stl_scan_right(), stl_zip_foldl(), stl_zip_reduce(), stl_zip_scan_left(), uni_foldl(), uni_reduce(), uni_scan_left(), uni_zip_foldl(), uni_zip_reduce(), uni_zip_scan_left(), zip_foldl(), and zip_foldl_eq().
|
extern |
Threshold for switching to insertion sort in hybrid algorithms.
When a partition becomes smaller than this threshold, hybrid sorting algorithms (like quicksort) switch to insertion sort, which is faster for small arrays due to lower overhead.
Default value: typically 10-20 elements.
Definition at line 36 of file tpl_sort_utils.C.
Referenced by quicksort_insertion().
True if F is known not to be idempotent over T.
Idempotency (f(a, a) == a) cannot be checked in general, so this is a list of known offenders, not a proof: the standard and Aleph arithmetic functors (plus, minus, multiplies, divides, modulus, std::bit_xor) over a numeric T other than bool. Class types are left out because their operators may mean something else (e.g. + as set union, which is idempotent), and so is bool, where plus and multiplies behave as OR and AND.
| F | functor type. |
| T | value type. |
true for your own non-idempotent functors so that Gen_Sparse_Table rejects them. Definition at line 137 of file tpl_sparse_table.H.
|
static |
Definition at line 53 of file hash-fct.C.
Referenced by init_jsw(), jsw_hash(), and jsw_hash().
|
static |
Definition at line 58 of file hash-fct.C.
Referenced by init_jsw(), init_jsw(), jsw_hash(), and jsw_hash().
|
inline |
Default epsilon for geometric comparisons.
Zero for exact rational arithmetic. Can be overridden in method calls for approximate comparisons.
| const long Aleph::Max_Priority = ULONG_MAX |
Maximum priority value (used for sentinel/leaves)
Definition at line 75 of file treapNode.H.
| double Aleph::max_time = 300 |
|
constexpr |
The depth of the trees that generate_tree() wrote before 7.3.2; it writes trees of any depth now.
Definition at line 158 of file generate_tree.H.
|
constexpr |
Minimum expected columns for a node record.
Definition at line 177 of file load_digraph.H.
Referenced by load_digraph(), and TEST().
| const long Aleph::Min_Priority = 0 |
Minimum priority value.
Definition at line 78 of file treapNode.H.
Referenced by Aleph::Gen_Interval_Tree< NodeType, T, Compare >::Gen_Interval_Tree(), Aleph::Gen_Interval_Tree< NodeType, T, Compare >::Gen_Interval_Tree(), Aleph::Gen_Treap< NodeType, Key, Compare >::Gen_Treap(), Aleph::Gen_Treap< NodeType, Key, Compare >::Gen_Treap(), Aleph::Gen_Treap< NodeType, Key, Compare >::Gen_Treap(), Aleph::Gen_Treap_Rk< NodeType, Key, Compare >::Gen_Treap_Rk(), Aleph::Gen_Treap_Rk< NodeType, Key, Compare >::Gen_Treap_Rk(), and Aleph::Gen_Treap_Rk< NodeType, Key, Compare >::Gen_Treap_Rk().
|
static |
Definition at line 56 of file aleph-graph.H.
|
extern |
Return value for search functions when element is not found.
Typically -1. Used by sequential_search(), random_search(), etc.
Definition at line 40 of file tpl_sort_utils.C.
Referenced by random_search(), random_search(), sequential_search(), and sequential_search().
| const IPv4_Address Aleph::Null_IPv4_Address = 0 |
|
constexpr |
|
constexpr |
Definition at line 130 of file point.H.
Referenced by process_tag_node(), TEST_F(), and TEST_F().
|
constexpr |
Definition at line 131 of file point.H.
Referenced by process_tag_node().
|
inline |
Column number at the start of the current token.
Set by init_token_scanning() before reading a token. Used for error reporting to show where the token began.
Definition at line 166 of file parse_utils.H.
Referenced by init_token_scanning(), Aleph::SourceLocation::previous(), print_parse_error_and_exit(), print_parse_warning(), reset_parse_state(), TEST(), TEST(), and TEST_F().
|
inline |
Line number at the start of the current token.
Set by init_token_scanning() before reading a token. Used for error reporting to show where the token began.
Definition at line 158 of file parse_utils.H.
Referenced by init_token_scanning(), Aleph::SourceLocation::previous(), print_parse_error_and_exit(), print_parse_warning(), reset_parse_state(), TEST(), TEST(), and TEST_F().
|
extern |
Threshold for using quicksort vs simpler algorithms.
Arrays smaller than this threshold may use simpler O(n²) algorithms.
Definition at line 38 of file tpl_sort_utils.C.
Referenced by introsort(), introsort_loop(), introsort_loop(), and quicksort().
| Gsl_Compatible_Rng * Aleph::rand_gen = nullptr |
Internal RNG handle used by the helper functors in this header.
It is set by gen_random_euclidian_graph(), to a Gsl_Compatible_Rng, which gives the numbers of the gsl_rng_mt19937 of GSL, and cleared before it returns or throws. This is not thread-safe.
Definition at line 38 of file euclidian-graph-common.C.
Referenced by gen_random_euclidian_graph(), Aleph::Init_P< GT >::operator()(), Aleph::Init_Arc< GT >::operator()(), and TEST().
|
inlineconstexpr |
Sentinel used by SearchLimits to mean "no bound".
Definition at line 70 of file state_search_common.H.
Referenced by Aleph::Alpha_Beta< Domain >::history_bonus(), Aleph::adversarial_search_detail::remaining_depth(), reserve_search_path(), Aleph::search_engine_detail::stop_after_solution(), and TEST().
|
static |
Definition at line 48 of file hash-fct.C.
Referenced by jsw_fill_table(), jsw_hash(), and jsw_hash().
|
inline |
The most recently scanned token.
Set by close_token_scanning() after completing a token. Useful for error messages to show what was being parsed.
Definition at line 174 of file parse_utils.H.
Referenced by close_token_scanning(), expect(), file_to_dynarrays(), load_char_literal(), print_parse_error_and_exit(), print_parse_warning(), reset_parse_state(), TEST(), TEST(), TEST(), TEST_F(), and TEST_F().
|
inlineconstexpr |
Tag value of type unexpect_t.
Use this constant to construct an expected in the error state:
Definition at line 160 of file ah-cpp-compat.H.
| const int Aleph::UnknownLine = -1 |
| const int Aleph::UnknownLoad = -1 |
| const int Aleph::UnknownSize = -1 |
| bool Aleph::verbose = false |
Flag enabling verbose output.
Definition at line 44 of file ahDefs.C.
Referenced by benchmark_comparison(), benchmark_set(), demo_bfs_topological_sort(), demo_dfs_topological_sort(), main(), monte_carlo_simulation(), run_kruskal(), run_performance_comparison(), and run_prim().