@@ -36,24 +36,15 @@ using namespace GraphEngineSpace;
3636class CGraphEngine
3737{
3838public:
39- #ifndef AI_COMPILER
40- using CSolverPriorityQueue = CDataStorageBinaryHeap;
41- using CStringPriorityQueue = CDataStorageBinaryHeap;
42- #endif
43- using CPriorityQueue = CDataStorageBucketList<u32 , u32 , 8 *1024 , false >;
44- using CVertexManager = CVertexManagerFixed<u32 , u32 , 8 >;
45-
46- #ifndef AI_COMPILER
47- using CSolverVertexManager = CVertexManagerHashFixed<u32 , _solver_index_type, 256 , 8 *1024 >;
48- using CStringVertexManager = CVertexManagerHashFixed<u32 , shared_str, 128 , 1024 >;
49- #endif
39+ // common algorithm
40+ using CPriorityQueue = CDataStorageBucketList<u32 , u32 , 8 *1024 , false >;
41+ using CVertexManager = CVertexManagerFixed<u32 , u32 , 8 >;
5042#ifdef AI_COMPILER
51- using CVertexAllocator = CVertexAllocatorFixed< 2 *1024 *1024 > ;
43+ static const size_t VertexAllocatorReserve = 2 *1024 *1024 ;
5244#else
53- using CVertexAllocator = CVertexAllocatorFixed<64 *1024 >;
54- using CSolverVertexAllocator = CVertexAllocatorFixed<8 *1024 >;
55- using CStringVertexAllocator = CVertexAllocatorFixed<1024 >;
45+ static const size_t VertexAllocatorReserve = 64 *1024 ;
5646#endif
47+ using CVertexAllocator = CVertexAllocatorFixed<VertexAllocatorReserve>;
5748 using AlgorithmStorage = CVertexPath<true >;
5849 using CAlgorithm = CAStar<
5950 _dist_type,
@@ -62,21 +53,28 @@ class CGraphEngine
6253 CVertexAllocator,
6354 true ,
6455 AlgorithmStorage>;
65-
56+
6657#ifndef AI_COMPILER
58+ // solver algorithm
59+ using CSolverPriorityQueue = CDataStorageBinaryHeap;
60+ using CSolverVertexManager = CVertexManagerHashFixed<u32 , _solver_index_type, 256 , 8 *1024 >;
61+ using CSolverVertexAllocator = CVertexAllocatorFixed<8 *1024 >;
6762 using SolverAlgorithmStorage = CEdgePath<_solver_edge_type, true >;
68- using CSolverAlgorithm = CAStar<
69- _solver_dist_type,
70- CSolverPriorityQueue,
71- CSolverVertexManager,
72- CSolverVertexAllocator,
73- true ,
63+ using CSolverAlgorithm = CAStar<
64+ _solver_dist_type,
65+ CSolverPriorityQueue,
66+ CSolverVertexManager,
67+ CSolverVertexAllocator,
68+ true ,
7469 SolverAlgorithmStorage>;
75-
76- using _string_dist_type = float ;
70+ // string algorithm
71+ using CStringPriorityQueue = CDataStorageBinaryHeap;
72+ using CStringVertexManager = CVertexManagerHashFixed<u32 , shared_str, 128 , 1024 >;
73+ using CStringVertexAllocator = CVertexAllocatorFixed<1024 >;
7774 using StringAlgorithmStorage = AlgorithmStorage;
75+ using StringAlgorithmDistance = float ;
7876 using CStringAlgorithm = CAStar<
79- _string_dist_type ,
77+ StringAlgorithmDistance ,
8078 CStringPriorityQueue,
8179 CStringVertexManager,
8280 CStringVertexAllocator,
0 commit comments