-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dijkstraクラスの作成 #9
base: master
Are you sure you want to change the base?
Conversation
lib/Graph/dijkstra.cpp
Outdated
Dijkstra(int n, bool dir); | ||
vector<long long> cost; | ||
vector<int> prever; | ||
void add_edge(int f, int t, long long c); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
アッパーキャメルケースにしてください
lib/Graph/dijkstra.cpp
Outdated
vector<long long> cost; | ||
vector<int> prever; | ||
void add_edge(int f, int t, long long c); | ||
bool has_path(int t); // tに至るパスはあるか |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
アッパーキャメルケースにしてください
lib/Graph/dijkstra.cpp
Outdated
vector<int> prever; | ||
void add_edge(int f, int t, long long c); | ||
bool has_path(int t); // tに至るパスはあるか | ||
vector<int> get_shortest_path(int t); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
アッパーキャメルケースにしてください
lib/Graph/dijkstra.cpp
Outdated
void add_edge(int f, int t, long long c); | ||
bool has_path(int t); // tに至るパスはあるか | ||
vector<int> get_shortest_path(int t); | ||
void run(int f); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
アッパーキャメルケースにしてください
lib/Graph/dijkstra.cpp
Outdated
private: | ||
bool is_dir = false; // 無向グラフ: false, 有向グラフ: true | ||
long long INFl = (long long)1e15; | ||
int array_size_of_cost; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ローワーキャメルケースにしてください
lib/Graph/dijkstra.cpp
Outdated
#include "template.h" | ||
|
||
struct Edge { | ||
long long cost; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Int
を使って下さい
lib/Graph/dijkstra.cpp
Outdated
struct Edge { | ||
long long cost; | ||
int to; | ||
Edge(int t, long long c) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Int
を使って下さい
lib/Graph/dijkstra.cpp
Outdated
class Dijkstra { | ||
private: | ||
bool is_dir = false; // 無向グラフ: false, 有向グラフ: true | ||
long long INFl = (long long)1e15; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Int
を使って下さい
commitID:a37f441の時 Run関数内でfirst_state, sum_cost, current_stateという変数を宣言しているがテストに通っています |
cpplintは変数名の形式をチェックしません |
なるほど.目で確認するしかないのですね… |
ググったら正規表現でチェックするツールが有りました |
long long をIntにするの,人によってかなり変わる気がするのでlong longでも良いとは思うのですが,どうなのでしょう |
全部long longということ? |
そうです.long longであれば誰であれ実行できると思うので |
#10 の dinicと構造体Edgeの構造が異なるのが気になります(templateと非templateの違い) |
構造体Edgeは別でプルリクを出しておきます. |
lib/Graph/dijkstra.h
Outdated
}; | ||
|
||
template <typename T> | ||
Dijkstra<T>::Dijkstra(int n, bool dir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
他のグラフアルゴリズムのクラスでは、基本的に有向グラフを構築する仕様になっています
ダイクストラだけコンストラクタで、有向グラフかどうかを指定するのは違和感があります
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
なるほど.修正します.
Dijkstraクラスを作ってたものをプルリク送りました.改善点あれば修正します.