example: Optimize vector initialization
This commit is contained in:
@@ -62,39 +62,42 @@ int main (int argc, char *argv[])
|
||||
{
|
||||
std::ofstream file ("80211n-mimo-throughput.plt");
|
||||
|
||||
std::vector <std::string> modes;
|
||||
modes.push_back ("HtMcs0");
|
||||
modes.push_back ("HtMcs1");
|
||||
modes.push_back ("HtMcs2");
|
||||
modes.push_back ("HtMcs3");
|
||||
modes.push_back ("HtMcs4");
|
||||
modes.push_back ("HtMcs5");
|
||||
modes.push_back ("HtMcs6");
|
||||
modes.push_back ("HtMcs7");
|
||||
modes.push_back ("HtMcs8");
|
||||
modes.push_back ("HtMcs9");
|
||||
modes.push_back ("HtMcs10");
|
||||
modes.push_back ("HtMcs11");
|
||||
modes.push_back ("HtMcs12");
|
||||
modes.push_back ("HtMcs13");
|
||||
modes.push_back ("HtMcs14");
|
||||
modes.push_back ("HtMcs15");
|
||||
modes.push_back ("HtMcs16");
|
||||
modes.push_back ("HtMcs17");
|
||||
modes.push_back ("HtMcs18");
|
||||
modes.push_back ("HtMcs19");
|
||||
modes.push_back ("HtMcs20");
|
||||
modes.push_back ("HtMcs21");
|
||||
modes.push_back ("HtMcs22");
|
||||
modes.push_back ("HtMcs23");
|
||||
modes.push_back ("HtMcs24");
|
||||
modes.push_back ("HtMcs25");
|
||||
modes.push_back ("HtMcs26");
|
||||
modes.push_back ("HtMcs27");
|
||||
modes.push_back ("HtMcs28");
|
||||
modes.push_back ("HtMcs29");
|
||||
modes.push_back ("HtMcs30");
|
||||
modes.push_back ("HtMcs31");
|
||||
// clang-format off
|
||||
std::vector <std::string> modes = {
|
||||
"HtMcs0",
|
||||
"HtMcs1",
|
||||
"HtMcs2",
|
||||
"HtMcs3",
|
||||
"HtMcs4",
|
||||
"HtMcs5",
|
||||
"HtMcs6",
|
||||
"HtMcs7",
|
||||
"HtMcs8",
|
||||
"HtMcs9",
|
||||
"HtMcs10",
|
||||
"HtMcs11",
|
||||
"HtMcs12",
|
||||
"HtMcs13",
|
||||
"HtMcs14",
|
||||
"HtMcs15",
|
||||
"HtMcs16",
|
||||
"HtMcs17",
|
||||
"HtMcs18",
|
||||
"HtMcs19",
|
||||
"HtMcs20",
|
||||
"HtMcs21",
|
||||
"HtMcs22",
|
||||
"HtMcs23",
|
||||
"HtMcs24",
|
||||
"HtMcs25",
|
||||
"HtMcs26",
|
||||
"HtMcs27",
|
||||
"HtMcs28",
|
||||
"HtMcs29",
|
||||
"HtMcs30",
|
||||
"HtMcs31",
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
bool udp = true;
|
||||
double simulationTime = 5; //seconds
|
||||
|
||||
@@ -40,22 +40,25 @@ int main (int argc, char *argv[])
|
||||
std::ofstream yansfile ("yans-frame-success-rate-be.plt");
|
||||
std::ofstream nistfile ("nist-frame-success-rate-be.plt");
|
||||
std::ofstream tablefile ("table-frame-success-rate-be.plt");
|
||||
std::vector <std::string> modes;
|
||||
|
||||
modes.push_back ("EhtMcs0");
|
||||
modes.push_back ("EhtMcs1");
|
||||
modes.push_back ("EhtMcs2");
|
||||
modes.push_back ("EhtMcs3");
|
||||
modes.push_back ("EhtMcs4");
|
||||
modes.push_back ("EhtMcs5");
|
||||
modes.push_back ("EhtMcs6");
|
||||
modes.push_back ("EhtMcs7");
|
||||
modes.push_back ("EhtMcs8");
|
||||
modes.push_back ("EhtMcs9");
|
||||
modes.push_back ("EhtMcs10");
|
||||
modes.push_back ("EhtMcs11");
|
||||
modes.push_back ("EhtMcs12");
|
||||
modes.push_back ("EhtMcs13");
|
||||
// clang-format off
|
||||
std::vector <std::string> modes = {
|
||||
"EhtMcs0",
|
||||
"EhtMcs1",
|
||||
"EhtMcs2",
|
||||
"EhtMcs3",
|
||||
"EhtMcs4",
|
||||
"EhtMcs5",
|
||||
"EhtMcs6",
|
||||
"EhtMcs7",
|
||||
"EhtMcs8",
|
||||
"EhtMcs9",
|
||||
"EhtMcs10",
|
||||
"EhtMcs11",
|
||||
"EhtMcs12",
|
||||
"EhtMcs13",
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
CommandLine cmd (__FILE__);
|
||||
cmd.AddValue ("FrameSize", "The frame size", FrameSize);
|
||||
|
||||
@@ -38,20 +38,23 @@ int main (int argc, char *argv[])
|
||||
std::ofstream yansfile ("yans-frame-success-rate-ax.plt");
|
||||
std::ofstream nistfile ("nist-frame-success-rate-ax.plt");
|
||||
std::ofstream tablefile ("table-frame-success-rate-ax.plt");
|
||||
std::vector <std::string> modes;
|
||||
|
||||
modes.push_back ("HeMcs0");
|
||||
modes.push_back ("HeMcs1");
|
||||
modes.push_back ("HeMcs2");
|
||||
modes.push_back ("HeMcs3");
|
||||
modes.push_back ("HeMcs4");
|
||||
modes.push_back ("HeMcs5");
|
||||
modes.push_back ("HeMcs6");
|
||||
modes.push_back ("HeMcs7");
|
||||
modes.push_back ("HeMcs8");
|
||||
modes.push_back ("HeMcs9");
|
||||
modes.push_back ("HeMcs10");
|
||||
modes.push_back ("HeMcs11");
|
||||
// clang-format off
|
||||
std::vector <std::string> modes = {
|
||||
"HeMcs0",
|
||||
"HeMcs1",
|
||||
"HeMcs2",
|
||||
"HeMcs3",
|
||||
"HeMcs4",
|
||||
"HeMcs5",
|
||||
"HeMcs6",
|
||||
"HeMcs7",
|
||||
"HeMcs8",
|
||||
"HeMcs9",
|
||||
"HeMcs10",
|
||||
"HeMcs11",
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
CommandLine cmd (__FILE__);
|
||||
cmd.AddValue ("FrameSize", "The frame size", FrameSize);
|
||||
|
||||
@@ -38,16 +38,19 @@ int main (int argc, char *argv[])
|
||||
std::ofstream yansfile ("yans-frame-success-rate-n.plt");
|
||||
std::ofstream nistfile ("nist-frame-success-rate-n.plt");
|
||||
std::ofstream tablefile ("table-frame-success-rate-n.plt");
|
||||
std::vector <std::string> modes;
|
||||
|
||||
modes.push_back ("HtMcs0");
|
||||
modes.push_back ("HtMcs1");
|
||||
modes.push_back ("HtMcs2");
|
||||
modes.push_back ("HtMcs3");
|
||||
modes.push_back ("HtMcs4");
|
||||
modes.push_back ("HtMcs5");
|
||||
modes.push_back ("HtMcs6");
|
||||
modes.push_back ("HtMcs7");
|
||||
// clang-format off
|
||||
std::vector <std::string> modes = {
|
||||
"HtMcs0",
|
||||
"HtMcs1",
|
||||
"HtMcs2",
|
||||
"HtMcs3",
|
||||
"HtMcs4",
|
||||
"HtMcs5",
|
||||
"HtMcs6",
|
||||
"HtMcs7",
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
|
||||
CommandLine cmd (__FILE__);
|
||||
|
||||
@@ -40,16 +40,19 @@ int main (int argc, char *argv[])
|
||||
std::ofstream yansfile ("yans-frame-success-rate-ofdm.plt");
|
||||
std::ofstream nistfile ("nist-frame-success-rate-ofdm.plt");
|
||||
std::ofstream tablefile ("table-frame-success-rate-ofdm.plt");
|
||||
std::vector <std::string> modes;
|
||||
|
||||
modes.push_back ("OfdmRate6Mbps");
|
||||
modes.push_back ("OfdmRate9Mbps");
|
||||
modes.push_back ("OfdmRate12Mbps");
|
||||
modes.push_back ("OfdmRate18Mbps");
|
||||
modes.push_back ("OfdmRate24Mbps");
|
||||
modes.push_back ("OfdmRate36Mbps");
|
||||
modes.push_back ("OfdmRate48Mbps");
|
||||
modes.push_back ("OfdmRate54Mbps");
|
||||
// clang-format off
|
||||
std::vector <std::string> modes = {
|
||||
"OfdmRate6Mbps",
|
||||
"OfdmRate9Mbps",
|
||||
"OfdmRate12Mbps",
|
||||
"OfdmRate18Mbps",
|
||||
"OfdmRate24Mbps",
|
||||
"OfdmRate36Mbps",
|
||||
"OfdmRate48Mbps",
|
||||
"OfdmRate54Mbps",
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
CommandLine cmd (__FILE__);
|
||||
cmd.AddValue ("FrameSize", "The frame size in bytes", FrameSize);
|
||||
|
||||
@@ -39,17 +39,20 @@ int main (int argc, char *argv[])
|
||||
std::ofstream yansfile ("yans-frame-success-rate-ac.plt");
|
||||
std::ofstream nistfile ("nist-frame-success-rate-ac.plt");
|
||||
std::ofstream tablefile ("table-frame-success-rate-ac.plt");
|
||||
std::vector <std::string> modes;
|
||||
|
||||
modes.push_back ("VhtMcs0");
|
||||
modes.push_back ("VhtMcs1");
|
||||
modes.push_back ("VhtMcs2");
|
||||
modes.push_back ("VhtMcs3");
|
||||
modes.push_back ("VhtMcs4");
|
||||
modes.push_back ("VhtMcs5");
|
||||
modes.push_back ("VhtMcs6");
|
||||
modes.push_back ("VhtMcs7");
|
||||
modes.push_back ("VhtMcs8");
|
||||
// clang-format off
|
||||
std::vector<std::string> modes = {
|
||||
"VhtMcs0",
|
||||
"VhtMcs1",
|
||||
"VhtMcs2",
|
||||
"VhtMcs3",
|
||||
"VhtMcs4",
|
||||
"VhtMcs5",
|
||||
"VhtMcs6",
|
||||
"VhtMcs7",
|
||||
"VhtMcs8",
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
CommandLine cmd (__FILE__);
|
||||
cmd.AddValue ("FrameSize", "The frame size in bytes", FrameSize);
|
||||
|
||||
Reference in New Issue
Block a user