Skip to main content

geographdb_core/
lib.rs

1//! GeoGraphDB Core - 3D Spatial Indexing for Graph Databases
2
3pub mod acceleration;
4pub mod algorithms;
5pub mod cfg_store;
6pub mod corpus;
7pub mod cypher_4d;
8pub mod spatial;
9pub mod storage;
10pub mod telemetry;
11
12// Re-export commonly used types
13pub use algorithms::adam::{clip_gradients, grad_norm, Adam};
14pub use algorithms::astar::{CfgGraphNode, CfgPath, PathComplexity};
15pub use algorithms::attention::{GraphAttentionClassifier, GraphAttentionGradients};
16pub use algorithms::causal::{causal_intervals, causal_stats, CausalInterval, CausalStats};
17pub use algorithms::complexity::{ComplexityBlock, ComplexityRating, ComplexityResult};
18pub use algorithms::delay_embed::{correlation_dimension, delay_embedding, min_cache_size_takens};
19pub use algorithms::dominance::{compute_dominance, compute_dominance_frontier, DominanceResult};
20pub use algorithms::four_d::{
21    articulation_points_4d, astar_find_path_4d, bridges_4d, earliest_arrival_path_4d,
22    fastest_temporal_path_4d, reachable_4d, strongly_connected_components_4d,
23    time_dependent_dijkstra_4d, GraphNode4D, GraphPath4D, GraphProperties, SpatialIndex,
24    SpatialRegion, TemporalArrival4D, TemporalDijkstraResult4D, TemporalEdge, TemporalJourney4D,
25    TemporalWindow, TraversalContext4D,
26};
27pub use algorithms::infogeo::{info_geometry, InfoEdge, InfoNode};
28pub use algorithms::kv_cache_mps::KvCacheMps;
29pub use algorithms::kv_frame_codec::FrameCodec;
30pub use algorithms::loop_detection::{LoopAnalysisResult, LoopBlock, LoopInfo};
31pub use algorithms::mlp::{
32    cross_entropy_from_logits, cross_entropy_logits_grad, cross_entropy_loss, matmul, one_hot,
33    EmbeddingMlpClassifier, EmbeddingMlpGradients, MlpClassifier, MlpForward, MlpGradients,
34};
35pub use algorithms::mpo::{
36    compress_matrix_to_mpo, compress_matrix_to_mpo_auto, factor_dimension, mpo_apply,
37    mpo_compression_ratio, mpo_reconstruction_error, mpo_to_graph_nodes, Mpo, MpoSite,
38};
39pub use algorithms::mps::{
40    build_mps, get_tensor, mps_apply_gate, mps_apply_gate_2site, mps_norm_sq, set_tensor,
41};
42pub use algorithms::natural_grad::{
43    compare_steps, diagonal_fisher, fisher_rao_dist, kl_divergence, natural_gradient, softmax,
44    StepComparison,
45};
46pub use algorithms::natural_loops::{find_back_edges, find_natural_loops, NaturalLoop};
47pub use algorithms::oscar_rotation::{
48    apply_rotation, compress_rotation, covariance_to_rotation, dequantize_int2,
49    empirical_query_covariance, mpo_compression_ratio_rotation, quantize_int2, rotation_fidelity,
50    rotation_quantization_error, RotationMpo,
51};
52pub use algorithms::percolation::{find_critical_radius, percolation_sweep, PercolationPoint};
53pub use algorithms::persistence::{
54    compute_temporal_barcode, temporal_persistence_sweep, TemporalBarcode, TemporalPersistencePoint,
55};
56pub use algorithms::ricci::{curvature_map, curvature_map_fast, ollivier_ricci, RicciEdge};
57pub use algorithms::scc::{condense_graph, find_cycles, has_cycles, tarjan_scc, SccResult};
58pub use algorithms::slicing::{backward_slice, forward_slice, SliceResult};
59pub use algorithms::sparse_attn::{
60    attention_stats, sparse_attention, AttentionResult, AttentionStats, Token,
61};
62pub use algorithms::symmetry_13::{
63    analyze_13_symmetry_comprehensive, c13_rotate, check_13_cage, circulant_graph_13,
64    cusp_form_gamma0_13, cyclotomic_13, d13_reflect, detect_13_fold_symmetry,
65    detect_c13_automorphism, dihedral_d13_permutations, gaussian_periods_cubic_13, graph_cover_13,
66    hauptmodul_x0_13, is_13_regular, paley_graph_13, power_residue_symbol_13,
67    real_subfield_basis_13, regular_13_gon, roots_of_unity_13, star_polygon_13,
68};
69pub use algorithms::tnet4d::{
70    build_tnet4d, site_id, tnet4d_apply_gate_1site, tnet4d_apply_gate_2site, tnet4d_find,
71    tnet4d_norm_sq, GridDims, SiteCoord,
72};
73pub use algorithms::topo_sort::{
74    critical_path_length, is_dag, topological_sort, TopoError, TopoResult,
75};
76pub use algorithms::transitive::{transitive_closure, transitive_reduction, ReachabilityResult};
77pub use cypher_4d::{query_4d, GeoCypherError, GeoCypherResult, GeoCypherRow};
78pub use telemetry::{LoopGuard, OpTracer};
79
80// Re-export dual-octree spatial page storage types
81pub use storage::{
82    build_spatial_pages, BoundingBox, DualEdgeType, DualGraph, DualVertex, OctreeNode,
83    OctreePageStore, SpatialPage, SpatialPageHeader,
84};
85
86/// Library version
87pub const VERSION: &str = env!("CARGO_PKG_VERSION");
88
89// Re-export sectioned storage types
90pub use storage::{
91    GeoFileHeader, Section, SectionEntry, SectionedStorage, FILE_MAGIC, FORMAT_VERSION,
92    HEADER_SIZE, HEADER_SIZE_USIZE, MAX_SECTION_NAME_LEN, SECTION_ENTRY_SIZE,
93    SECTION_ENTRY_SIZE_USIZE,
94};
95
96// Re-export sidecar path helpers
97pub use storage::{all_sidecar_paths, geo_cfg_path, geo_complexity_path, geo_idx_path};
98
99// Re-export Graph4D persistence helpers
100pub use storage::{load_graph4d, save_graph4d};
101
102// Re-export section adapters
103pub use storage::{
104    CfgData, CfgEdge, CfgSectionAdapter, GraphData, GraphSectionAdapter, SerializableCfgBlock,
105};
106
107// Re-export property store types
108pub use storage::prop_store::{build_prop_store, lookup, read_prop_store, write_prop_store};
109pub use storage::prop_store::{NodeProperties, PropLookupEntry, PropStore, PropertyValue};