99cuBool_Matrix regular_path_query_with_transposed (
1010 // vector of sparse graph matrices for each label
1111 const std::vector<cuBool_Matrix> &graph, const std::vector<cuBool_Index> &source_vertices,
12- // vector of sparse automat matrices for each label
13- const std::vector<cuBool_Matrix> &automat , const std::vector<cuBool_Index> &start_states,
14- // transposed matrices for graph and automat
12+ // vector of sparse automaton matrices for each label
13+ const std::vector<cuBool_Matrix> &automaton , const std::vector<cuBool_Index> &start_states,
14+ // transposed matrices for graph and automaton
1515 const std::vector<cuBool_Matrix> &graph_transposed,
16- const std::vector<cuBool_Matrix> &automat_transposed ,
16+ const std::vector<cuBool_Matrix> &automaton_transposed ,
1717
1818 const std::vector<bool > &inversed_labels_input, bool all_labels_are_inversed) {
1919 cuBool_Status status;
2020
2121 auto inversed_labels = inversed_labels_input;
22- inversed_labels.resize (std::max (graph.size (), automat .size ()));
22+ inversed_labels.resize (std::max (graph.size (), automaton .size ()));
2323
2424 for (uint32_t i = 0 ; i < inversed_labels.size (); i++) {
2525 bool is_inverse = inversed_labels[i];
@@ -28,7 +28,7 @@ cuBool_Matrix regular_path_query_with_transposed(
2828 }
2929
3030 cuBool_Index graph_nodes_number = 0 ;
31- cuBool_Index automat_nodes_number = 0 ;
31+ cuBool_Index automaton_nodes_number = 0 ;
3232
3333 // get number of graph nodes
3434 for (auto label_matrix : graph) {
@@ -39,31 +39,31 @@ cuBool_Matrix regular_path_query_with_transposed(
3939 }
4040
4141 // get number of automat nodes
42- for (auto label_matrix : automat ) {
42+ for (auto label_matrix : automaton ) {
4343 if (label_matrix != nullptr ) {
44- cuBool_Matrix_Nrows (label_matrix, &automat_nodes_number );
44+ cuBool_Matrix_Nrows (label_matrix, &automaton_nodes_number );
4545 break ;
4646 }
4747 }
4848
4949 // this will be answer
5050 cuBool_Matrix reacheble {};
51- status = cuBool_Matrix_New (&reacheble, automat_nodes_number , graph_nodes_number);
51+ status = cuBool_Matrix_New (&reacheble, automaton_nodes_number , graph_nodes_number);
5252 assert (status == CUBOOL_STATUS_SUCCESS);
5353
5454 // allocate neccessary for algorithm matrices
5555 cuBool_Matrix frontier {}, symbol_frontier {}, next_frontier {};
56- status = cuBool_Matrix_New (&next_frontier, automat_nodes_number , graph_nodes_number);
56+ status = cuBool_Matrix_New (&next_frontier, automaton_nodes_number , graph_nodes_number);
5757 assert (status == CUBOOL_STATUS_SUCCESS);
58- status = cuBool_Matrix_New (&frontier, automat_nodes_number , graph_nodes_number);
58+ status = cuBool_Matrix_New (&frontier, automaton_nodes_number , graph_nodes_number);
5959 assert (status == CUBOOL_STATUS_SUCCESS);
60- status = cuBool_Matrix_New (&symbol_frontier, automat_nodes_number , graph_nodes_number);
60+ status = cuBool_Matrix_New (&symbol_frontier, automaton_nodes_number , graph_nodes_number);
6161 assert (status == CUBOOL_STATUS_SUCCESS);
6262
6363 // init start values of algorithm matricies
6464 for (const auto state : start_states) {
6565 for (const auto vert : source_vertices) {
66- assert (state < automat_nodes_number );
66+ assert (state < automaton_nodes_number );
6767 assert (vert < graph_nodes_number);
6868 cuBool_Matrix_SetElement (next_frontier, state, vert);
6969 cuBool_Matrix_SetElement (reacheble, state, vert);
@@ -74,10 +74,10 @@ cuBool_Matrix regular_path_query_with_transposed(
7474
7575 // temporary matrix for write result of cubool functions
7676 cuBool_Matrix result;
77- status = cuBool_Matrix_New (&result, automat_nodes_number , graph_nodes_number);
77+ status = cuBool_Matrix_New (&result, automaton_nodes_number , graph_nodes_number);
7878 assert (status == CUBOOL_STATUS_SUCCESS);
7979
80- const auto label_number = std::min (graph.size (), automat .size ());
80+ const auto label_number = std::min (graph.size (), automaton .size ());
8181 while (states > 0 ) {
8282 std::swap (frontier, next_frontier);
8383
@@ -86,12 +86,12 @@ cuBool_Matrix regular_path_query_with_transposed(
8686 assert (status == CUBOOL_STATUS_SUCCESS);
8787
8888 for (int i = 0 ; i < label_number; i++) {
89- if (graph[i] == nullptr || automat [i] == nullptr ) {
89+ if (graph[i] == nullptr || automaton [i] == nullptr ) {
9090 continue ;
9191 }
9292
93- cuBool_Matrix automat_matrix = all_labels_are_inversed ? automat [i] : automat_transposed [i];
94- status = cuBool_MxM (symbol_frontier, automat_matrix , frontier, CUBOOL_HINT_NO);
93+ cuBool_Matrix automaton_matrix = all_labels_are_inversed ? automaton [i] : automaton_transposed [i];
94+ status = cuBool_MxM (symbol_frontier, automaton_matrix , frontier, CUBOOL_HINT_NO);
9595 assert (status == CUBOOL_STATUS_SUCCESS);
9696
9797 // next_frontier += (symbol_frontier * graph[i]) & (!reachible)
@@ -127,7 +127,7 @@ cuBool_Matrix regular_path_query(
127127 // vector of sparse graph matrices for each label
128128 const std::vector<cuBool_Matrix> &graph, const std::vector<cuBool_Index> &source_vertices,
129129 // vector of sparse automat matrices for each label
130- const std::vector<cuBool_Matrix> &automat , const std::vector<cuBool_Index> &start_states,
130+ const std::vector<cuBool_Matrix> &automaton , const std::vector<cuBool_Index> &start_states,
131131 // work with inverted labels
132132 const std::vector<bool > &inversed_labels_input, bool all_labels_are_inversed) {
133133 cuBool_Status status;
@@ -154,10 +154,10 @@ cuBool_Matrix regular_path_query(
154154 }
155155
156156 // transpose automat matrices
157- std::vector<cuBool_Matrix> automat_transposed ;
158- automat_transposed .reserve (automat .size ());
159- for (auto label_matrix : automat ) {
160- automat_transposed .emplace_back ();
157+ std::vector<cuBool_Matrix> automaton_transposed ;
158+ automaton_transposed .reserve (automaton .size ());
159+ for (auto label_matrix : automaton ) {
160+ automaton_transposed .emplace_back ();
161161 if (label_matrix == nullptr ) {
162162 continue ;
163163 }
@@ -166,24 +166,24 @@ cuBool_Matrix regular_path_query(
166166 cuBool_Matrix_Nrows (label_matrix, &nrows);
167167 cuBool_Matrix_Ncols (label_matrix, &ncols);
168168
169- status = cuBool_Matrix_New (&automat_transposed .back (), ncols, nrows);
169+ status = cuBool_Matrix_New (&automaton_transposed .back (), ncols, nrows);
170170 assert (status == CUBOOL_STATUS_SUCCESS);
171- status = cuBool_Matrix_Transpose (automat_transposed .back (), label_matrix, CUBOOL_HINT_NO);
171+ status = cuBool_Matrix_Transpose (automaton_transposed .back (), label_matrix, CUBOOL_HINT_NO);
172172 assert (status == CUBOOL_STATUS_SUCCESS);
173173 }
174174
175175 auto result = regular_path_query_with_transposed (
176176 graph, source_vertices,
177- automat , start_states,
178- graph_transposed, automat_transposed ,
177+ automaton , start_states,
178+ graph_transposed, automaton_transposed ,
179179 inversed_labels_input, all_labels_are_inversed);
180180
181181 for (cuBool_Matrix matrix : graph_transposed) {
182182 if (matrix != nullptr ) {
183183 cuBool_Matrix_Free (matrix);
184184 }
185185 }
186- for (cuBool_Matrix matrix : automat_transposed ) {
186+ for (cuBool_Matrix matrix : automaton_transposed ) {
187187 if (matrix != nullptr ) {
188188 cuBool_Matrix_Free (matrix);
189189 }
0 commit comments