Shatunov Evgeniy - #3
Conversation
|
скудные тесты, и форматирование.... по этому 4 из 6 |
| data_.resize(vec_list.size(), std::vector<bool>(vec_list.size())); | ||
| for (size_t vec_index = 0; vec_index < vec_list.size(); vec_index++) | ||
| for (size_t index = 0; index < vec_list[vec_index].size(); index++) | ||
| data_[vec_index][vec_list[vec_index][index]] = vec_list[vec_index][index] || vec_list[vec_index][index] == 0 ? true : false; |
There was a problem hiding this comment.
warning: logical expression is always true [misc-redundant-expression]
data_[vec_index][vec_list[vec_index][index]] = vec_list[vec_index][index] || vec_list[vec_index][index] == 0 ? true : false;
^| data_.clear(); | ||
| data_.resize(unord_list.size(), std::vector<bool>(unord_list.size())); | ||
| for (size_t vec_index = 0; vec_index < unord_list.size(); vec_index++) | ||
| for (size_t elem : unord_list[vec_index]) |
There was a problem hiding this comment.
warning: variable 'elem' of type 'size_t' (aka 'unsigned long') can be declared 'const' [misc-const-correctness]
| for (size_t elem : unord_list[vec_index]) | |
| for (size_t const elem : unord_list[vec_index]) |
| data_.resize(unord_list.size(), std::vector<bool>(unord_list.size())); | ||
| for (size_t vec_index = 0; vec_index < unord_list.size(); vec_index++) | ||
| for (size_t elem : unord_list[vec_index]) | ||
| data_[vec_index][elem] = elem || elem == 0 ? true : false; |
There was a problem hiding this comment.
warning: logical expression is always true [misc-redundant-expression]
data_[vec_index][elem] = elem || elem == 0 ? true : false;
^| size_t max_vertex{0}; | ||
| for (size_t index = 0; index < edge_list.size(); index++) | ||
| { | ||
| std::pair<size_t, size_t> pair = edge_list[index]; |
There was a problem hiding this comment.
warning: variable 'pair' of type 'std::pair<size_t, size_t>' (aka 'pair<unsigned long, unsigned long>') can be declared 'const' [misc-const-correctness]
| std::pair<size_t, size_t> pair = edge_list[index]; | |
| std::pair<size_t, size_t> const pair = edge_list[index]; |
| for (size_t index = 0; index < edge_list.size(); index++) | ||
| { | ||
| std::pair<size_t, size_t> pair = edge_list[index]; | ||
| size_t parent = pair.first; |
There was a problem hiding this comment.
warning: variable 'parent' of type 'size_t' (aka 'unsigned long') can be declared 'const' [misc-const-correctness]
| size_t parent = pair.first; | |
| size_t const parent = pair.first; |
| const std::vector<std::vector<bool>>::iterator end() { return data_.end(); } | ||
|
|
||
| std::vector<std::vector<bool>> GetMatrix() const { return data_; } | ||
| void LoadMatrix(const std::vector<std::vector<bool>> new_data) { data_ = new_data; }; |
There was a problem hiding this comment.
warning: the const qualified parameter 'new_data' is copied for each invocation; consider making it a reference [performance-unnecessary-value-param]
| void LoadMatrix(const std::vector<std::vector<bool>> new_data) { data_ = new_data; }; | |
| void LoadMatrix(const std::vector<std::vector<bool>>& new_data) { data_ = new_data; }; |
| std::vector<std::vector<size_t>> data_; | ||
| public: | ||
| AdjacencyListVec(const size_t size) : data_(size) {} | ||
| AdjacencyListVec(const std::vector<std::vector<size_t>> data) : data_{data} {} |
There was a problem hiding this comment.
warning: the const qualified parameter 'data' is copied for each invocation; consider making it a reference [performance-unnecessary-value-param]
| AdjacencyListVec(const std::vector<std::vector<size_t>> data) : data_{data} {} | |
| AdjacencyListVec(const std::vector<std::vector<size_t>>& data) : data_{data} {} |
| const std::vector<std::vector<size_t>>::iterator end() { return data_.end(); } | ||
|
|
||
| std::vector<std::vector<size_t>> GetList() const { return data_; } | ||
| void LoadList(const std::vector<std::vector<size_t>> new_data) { data_ = new_data; }; |
There was a problem hiding this comment.
warning: the const qualified parameter 'new_data' is copied for each invocation; consider making it a reference [performance-unnecessary-value-param]
| void LoadList(const std::vector<std::vector<size_t>> new_data) { data_ = new_data; }; | |
| void LoadList(const std::vector<std::vector<size_t>>& new_data) { data_ = new_data; }; |
| std::vector<std::unordered_set<size_t>> data_; | ||
| public: | ||
| AdjacencyListUnorderedSet(const size_t size) : data_(size) {} | ||
| AdjacencyListUnorderedSet(const std::vector<std::unordered_set<size_t>> data) : data_{data} {} |
There was a problem hiding this comment.
warning: the const qualified parameter 'data' is copied for each invocation; consider making it a reference [performance-unnecessary-value-param]
| AdjacencyListUnorderedSet(const std::vector<std::unordered_set<size_t>> data) : data_{data} {} | |
| AdjacencyListUnorderedSet(const std::vector<std::unordered_set<size_t>>& data) : data_{data} {} |
| friend std::ostream& operator<< (std::ostream &ost, AdjacencyListUnorderedSet& list_unord_set); | ||
| bool operator() (const size_t parent, const size_t child){ | ||
| const std::unordered_set<size_t>& unord_set = data_[parent]; | ||
| return std::find(unord_set.begin(), unord_set.end(), child) != unord_set.end(); |
There was a problem hiding this comment.
warning: this STL algorithm call should be replaced with a container method [performance-inefficient-algorithm]
| return std::find(unord_set.begin(), unord_set.end(), child) != unord_set.end(); | |
| return unord_set.find(child) != unord_set.end(); |
Add own additional task with translation in different graph views