geographdb-core 0.5.4

Geometric graph database core - 3D spatial indexing for code analysis
Documentation
//! GeoGraphDB Core - 3D Spatial Indexing for Graph Databases

pub mod acceleration;
pub mod algorithms;
pub mod cfg_store;
pub mod corpus;
pub mod cypher_4d;
pub mod spatial;
pub mod storage;
pub mod telemetry;

// Re-export commonly used types
pub use algorithms::adam::{clip_gradients, grad_norm, Adam};
pub use algorithms::astar::{CfgGraphNode, CfgPath, PathComplexity};
pub use algorithms::attention::{GraphAttentionClassifier, GraphAttentionGradients};
pub use algorithms::causal::{causal_intervals, causal_stats, CausalInterval, CausalStats};
pub use algorithms::complexity::{ComplexityBlock, ComplexityRating, ComplexityResult};
pub use algorithms::delay_embed::{correlation_dimension, delay_embedding, min_cache_size_takens};
pub use algorithms::dominance::{compute_dominance, compute_dominance_frontier, DominanceResult};
pub use algorithms::four_d::{
    articulation_points_4d, astar_find_path_4d, bridges_4d, earliest_arrival_path_4d,
    fastest_temporal_path_4d, reachable_4d, strongly_connected_components_4d,
    time_dependent_dijkstra_4d, GraphNode4D, GraphPath4D, GraphProperties, SpatialIndex,
    SpatialRegion, TemporalArrival4D, TemporalDijkstraResult4D, TemporalEdge, TemporalJourney4D,
    TemporalWindow, TraversalContext4D,
};
pub use algorithms::infogeo::{info_geometry, InfoEdge, InfoNode};
pub use algorithms::kv_cache_mps::KvCacheMps;
pub use algorithms::kv_frame_codec::FrameCodec;
pub use algorithms::loop_detection::{LoopAnalysisResult, LoopBlock, LoopInfo};
pub use algorithms::mlp::{
    cross_entropy_from_logits, cross_entropy_logits_grad, cross_entropy_loss, matmul, one_hot,
    EmbeddingMlpClassifier, EmbeddingMlpGradients, MlpClassifier, MlpForward, MlpGradients,
};
pub use algorithms::mpo::{
    compress_matrix_to_mpo, compress_matrix_to_mpo_auto, factor_dimension, mpo_apply,
    mpo_compression_ratio, mpo_reconstruction_error, mpo_to_graph_nodes, Mpo, MpoSite,
};
pub use algorithms::mps::{
    build_mps, get_tensor, mps_apply_gate, mps_apply_gate_2site, mps_norm_sq, set_tensor,
};
pub use algorithms::natural_grad::{
    compare_steps, diagonal_fisher, fisher_rao_dist, kl_divergence, natural_gradient, softmax,
    StepComparison,
};
pub use algorithms::natural_loops::{find_back_edges, find_natural_loops, NaturalLoop};
pub use algorithms::oscar_rotation::{
    apply_rotation, compress_rotation, covariance_to_rotation, dequantize_int2,
    empirical_query_covariance, mpo_compression_ratio_rotation, quantize_int2, rotation_fidelity,
    rotation_quantization_error, RotationMpo,
};
pub use algorithms::percolation::{find_critical_radius, percolation_sweep, PercolationPoint};
pub use algorithms::persistence::{
    compute_temporal_barcode, temporal_persistence_sweep, TemporalBarcode, TemporalPersistencePoint,
};
pub use algorithms::ricci::{curvature_map, curvature_map_fast, ollivier_ricci, RicciEdge};
pub use algorithms::scc::{condense_graph, find_cycles, has_cycles, tarjan_scc, SccResult};
pub use algorithms::slicing::{backward_slice, forward_slice, SliceResult};
pub use algorithms::sparse_attn::{
    attention_stats, sparse_attention, AttentionResult, AttentionStats, Token,
};
pub use algorithms::symmetry_13::{
    analyze_13_symmetry_comprehensive, c13_rotate, check_13_cage, circulant_graph_13,
    cusp_form_gamma0_13, cyclotomic_13, d13_reflect, detect_13_fold_symmetry,
    detect_c13_automorphism, dihedral_d13_permutations, gaussian_periods_cubic_13, graph_cover_13,
    hauptmodul_x0_13, is_13_regular, paley_graph_13, power_residue_symbol_13,
    real_subfield_basis_13, regular_13_gon, roots_of_unity_13, star_polygon_13,
};
pub use algorithms::tnet4d::{
    build_tnet4d, site_id, tnet4d_apply_gate_1site, tnet4d_apply_gate_2site, tnet4d_find,
    tnet4d_norm_sq, GridDims, SiteCoord,
};
pub use algorithms::topo_sort::{
    critical_path_length, is_dag, topological_sort, TopoError, TopoResult,
};
pub use algorithms::transitive::{transitive_closure, transitive_reduction, ReachabilityResult};
pub use cypher_4d::{query_4d, GeoCypherError, GeoCypherResult, GeoCypherRow};
pub use telemetry::{LoopGuard, OpTracer};

// Re-export dual-octree spatial page storage types
pub use storage::{
    build_spatial_pages, BoundingBox, DualEdgeType, DualGraph, DualVertex, OctreeNode,
    OctreePageStore, SpatialPage, SpatialPageHeader,
};

/// Library version
pub const VERSION: &str = env!("CARGO_PKG_VERSION");

// Re-export sectioned storage types
pub use storage::{
    GeoFileHeader, Section, SectionEntry, SectionedStorage, FILE_MAGIC, FORMAT_VERSION,
    HEADER_SIZE, HEADER_SIZE_USIZE, MAX_SECTION_NAME_LEN, SECTION_ENTRY_SIZE,
    SECTION_ENTRY_SIZE_USIZE,
};

// Re-export sidecar path helpers
pub use storage::{all_sidecar_paths, geo_cfg_path, geo_complexity_path, geo_idx_path};

// Re-export Graph4D persistence helpers
pub use storage::{load_graph4d, save_graph4d};

// Re-export section adapters
pub use storage::{
    CfgData, CfgEdge, CfgSectionAdapter, GraphData, GraphSectionAdapter, SerializableCfgBlock,
};

// Re-export property store types
pub use storage::prop_store::{build_prop_store, lookup, read_prop_store, write_prop_store};
pub use storage::prop_store::{NodeProperties, PropLookupEntry, PropStore, PropertyValue};