Skip to content

Nikita Tikhonov - #23

Open
nikita-tihonov wants to merge 2 commits into
DafeMipt213:mainfrom
nikita-tihonov:main
Open

Nikita Tikhonov#23
nikita-tihonov wants to merge 2 commits into
DafeMipt213:mainfrom
nikita-tihonov:main

Conversation

@nikita-tihonov

Copy link
Copy Markdown

No description provided.

…_tasks/graph_view/CMakeLists.txt

	renamed:    additional_tasks/template_task/README.md -> additional_tasks/graph_view/README.md
	renamed:    additional_tasks/template_task/src/main.cpp -> additional_tasks/graph_view/src/main.cpp
	new file:   additional_tasks/graph_view/src/test.cpp
	new file:   additional_tasks/graph_view/src/translation.hpp
	deleted:    additional_tasks/template_task/src/test.cpp
	deleted:    additional_tasks/template_task/src/utils.cpp
	deleted:    additional_tasks/template_task/src/utils.hpp
	modified:   task_01/src/test.cpp
	modified:   task_01/src/topology_sort.cpp
	modified:   task_01/src/topology_sort.hpp
	new file:   task_02/src/search_bridges_and_vertices.hpp
	modified:   task_02/src/test.cpp
	new file:   task_03/src/Johnson.hpp
	modified:   task_03/src/test.cpp
	new file:   task_04/src/dijkstra.cpp
	new file:   task_04/src/dijkstra.hpp
	modified:   task_04/src/test.cpp
	new file:   task_05/src/rmq.hpp
	modified:   task_05/src/test.cpp
	new file:   task_06/src/lca.hpp
	modified:   task_06/src/test.cpp

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

There were too many comments to post at once. Showing the first 25 out of 79. Check the log or trigger a new build to see more.

#include <unordered_set>
#include <vector>

std::vector<std::unordered_set<int>> convert_vec_vec_to_vec_set(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'convert_vec_vec_to_vec_set' defined in a header file; function definitions in header files can lead to ODR violations [misc-definitions-in-headers]

std::vector<std::unordered_set<int>> convert_vec_vec_to_vec_set(
                                     ^
Additional context

additional_tasks/graph_view/src/translation.hpp:4: make as 'inline'

std::vector<std::unordered_set<int>> convert_vec_vec_to_vec_set(
                                     ^

return graph_new;
}

std::vector<std::vector<int>> convert_vec_vec_to_matrix(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'convert_vec_vec_to_matrix' defined in a header file; function definitions in header files can lead to ODR violations [misc-definitions-in-headers]

std::vector<std::vector<int>> convert_vec_vec_to_matrix(
                              ^
Additional context

additional_tasks/graph_view/src/translation.hpp:14: make as 'inline'

std::vector<std::vector<int>> convert_vec_vec_to_matrix(
                              ^

return graph_new;
}

std::vector<std::pair<int, int>> convert_vec_vec_to_vec_pair(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'convert_vec_vec_to_vec_pair' defined in a header file; function definitions in header files can lead to ODR violations [misc-definitions-in-headers]

std::vector<std::pair<int, int>> convert_vec_vec_to_vec_pair(
                                 ^
Additional context

additional_tasks/graph_view/src/translation.hpp:33: make as 'inline'

std::vector<std::pair<int, int>> convert_vec_vec_to_vec_pair(
                                 ^

return graph_new;
}

std::vector<std::vector<int>> convert_vec_set_to_vec_vec(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'convert_vec_set_to_vec_vec' defined in a header file; function definitions in header files can lead to ODR violations [misc-definitions-in-headers]

std::vector<std::vector<int>> convert_vec_set_to_vec_vec(
                              ^
Additional context

additional_tasks/graph_view/src/translation.hpp:43: make as 'inline'

std::vector<std::vector<int>> convert_vec_set_to_vec_vec(
                              ^

return graph_new;
}

std::vector<std::vector<int>> convert_matrix_to_vec_vec(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: function 'convert_matrix_to_vec_vec' defined in a header file; function definitions in header files can lead to ODR violations [misc-definitions-in-headers]

std::vector<std::vector<int>> convert_matrix_to_vec_vec(
                              ^
Additional context

additional_tasks/graph_view/src/translation.hpp:52: make as 'inline'

std::vector<std::vector<int>> convert_matrix_to_vec_vec(
                              ^

p->y = y;
p->next = this->edges[x];
this->edges[x] = p;
this->degree[x]++;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: do not use array subscript when the index is not an integer constant expression [cppcoreguidelines-pro-bounds-constant-array-index]

  this->degree[x]++;
  ^

Edgenote *p;
for (i = 1; i <= this->nvertices; ++i) {
std::cout << i << ":";
p = this->edges[i];

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: do not use array subscript when the index is not an integer constant expression [cppcoreguidelines-pro-bounds-constant-array-index]

    p = this->edges[i];
        ^

}

int Graph::EdgeClassification(int x, int y) {
if (parent[y] == x) return TREE;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: do not use array subscript when the index is not an integer constant expression [cppcoreguidelines-pro-bounds-constant-array-index]

  if (parent[y] == x) return TREE;
      ^


int Graph::EdgeClassification(int x, int y) {
if (parent[y] == x) return TREE;
if (discovered[y] && !processed[y]) return BACK;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: do not use array subscript when the index is not an integer constant expression [cppcoreguidelines-pro-bounds-constant-array-index]

  if (discovered[y] && !processed[y]) return BACK;
      ^


int Graph::EdgeClassification(int x, int y) {
if (parent[y] == x) return TREE;
if (discovered[y] && !processed[y]) return BACK;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: do not use array subscript when the index is not an integer constant expression [cppcoreguidelines-pro-bounds-constant-array-index]

  if (discovered[y] && !processed[y]) return BACK;
                        ^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant