void step() { std::queue<int> Q; // for BFS // Initialize arrays std::fill(intree_n, intree_n + n, false); std::fill(intree_m, intree_m + m, false); std::fill(parent, parent + n, -1); // Find root for(int i = 0; i < n; ++i) if(match_n[i] == -1) { Q.push(i); intree_n[i] = true; std::fill(where_min_cost, where_min_cost + m, i); break; } while(true) { while(!Q.empty()) { int cur = Q.front(); Q.pop(); for(int i = 0; i < m; ++i) if(!intree_m[i] && updated_cost(cur, i) == 0) { if(match_m[i] == -1) { finish_step(cur, i); return; } intree_m[i] = true; insert_into_tree(match_m[i], cur); Q.push(match_m[i]); } } update_labels(); for(int i = 0; i < m; ++i) if(!intree_m[i] && get_min_cost(i) == 0) { if(match_m[i] == -1) { finish_step(where_min_cost[i], i); return; } else { intree_m[i] = true; if(!intree_n[match_m[i]]) { Q.push(match_m[i]); insert_into_tree(match_m[i], where_min_cost[i]); } } } } }
int main(int argc,char *argv[]){ //システム環境を初期化する #include "steps/init.h" if(step == 0){ //ライブラリをインストールする #include "steps/step_lib.h" finish_step(); } if(step == 1){ //apache ca,mod_perlのインストール #include "steps/step_ca.h" finish_step(); } if(step == 2){ //svn環境の初期化 //#include "steps/step_svn_account.h" finish_step(); } if(step == 3){ //svnソースをゼロからcheckoutするか、source_copy.plが存在する場合、実行する #include "steps/step_svn_source.h" finish_step(); } if(step == 4){ //mysqlのdevel,shared,client環境の準備 #include "steps/step_mysql_client.h" finish_step(); } if(step == 5){ //app周り環境設定 #include "steps/step_app_ca.h" finish_step(); } if(step == 6){ //moduleインストール #include "steps/step_module.h" finish_step(); } if(step == 7){ //hotsanicインストール #include "steps/step_hotsanic.h" finish_step(); } if(step == 8){ #include "steps/step_janet_mail.h" finish_step(); } return 0; }
int main(int argc,char *argv[]){ //システム環境を初期化する #include "steps/init.h" if(step == 0){ //ライブラリをインストールする #include "steps/step_lib.h" #include "steps/step_janet_before.h" finish_step(); } if(step == 1){ //apache static,catalyst,mod_perlのインストール #include "steps/step_apache_static_catalyst.h" finish_step(); } if(step == 2){ //svn環境の初期化 #include "steps/step_svn_account.h" finish_step(); } if(step == 3){ //svnソースをゼロからcheckoutするか、source_copy.plが存在する場合、実行する #include "steps/step_svn_source.h" finish_step(); } if(step == 4){ //mysqlのdevel,shared,client環境の準備 #include "steps/step_mysql_client.h" finish_step(); } if(step == 5){ //app周り環境設定 #include "steps/step_app.h" finish_step(); } if(step == 6){ //moduleインストール #include "steps/step_module.h" finish_step(); } if(step == 7){ //hotsanicインストール #include "steps/step_hotsanic.h" finish_step(); } if(step == 8){ //サーバを立ち上げ #include "steps/step_janet_after.h" #include "steps/step_static_catalyst_finish.h" finish_step(); } if(step == 9){ #include "steps/step_janet_mail.h" system("/root/install64/copy_setting.sh"); system("usermod -a -G tasadmin "MAIL_ACCOUNT); system("find /var/www/janet -name '*.pl' -exec sed -i 's/[email protected]/"SVN_ACCOUNT"@adways.net/g' {} \\;"); finish_step(); } return 0; }
// Invert edges along an augmenting path void finish_step(int x, int y) { if(parent[x] != -1) finish_step(parent[x], match_n[x]); match_n[x] = y; match_m[y] = x; }