diff --git a/src/lte/model/lte-mi-error-model.cc b/src/lte/model/lte-mi-error-model.cc index 6ca5ba9f3..d6bbe4e35 100644 --- a/src/lte/model/lte-mi-error-model.cc +++ b/src/lte/model/lte-mi-error-model.cc @@ -230,7 +230,7 @@ LteMiErrorModel::Mib (SpectrumValue& sinr, std::vector map, uint8_t mcs) if (mcs <= 10) // QPSK { int tr = 0; - while (MI_map_qpsk_axis[tr] < sinr_db) + while ((tr map, uint8_t mcs) } else { + NS_ASSERT_MSG (tr map, uint8_t mcs) if (mcs > 10 && mcs < 20 ) // 16-QAM { int tr = 0; - while (MI_map_16qam_axis[tr] < sinr_db) + while ((tr map, uint8_t mcs) } else { + NS_ASSERT_MSG (tr map, uint8_t mcs) } else { + NS_ASSERT_MSG (tr=0 && mcs < 32, "MCS out of range"); int tbsIndex = TbsIndex[mcs]; int cbIndex = 1; - while (cbMiSizeTable[cbIndex]< cbSize) + while ((cbIndex < 9)&&(cbMiSizeTable[cbIndex]< cbSize)) { cbIndex++; } @@ -308,7 +312,7 @@ LteMiErrorModel::MappingMiBler (double mib, uint8_t mcs, uint16_t cbSize) //take the lowest CB size including this CB for removing CB size //quatization errors int i = cbIndex; - while (b<0) + while ((i<9)&&(b<0)) { b = bEcrTable[i++][tbsIndex]; } @@ -319,7 +323,7 @@ LteMiErrorModel::MappingMiBler (double mib, uint8_t mcs, uint16_t cbSize) //take the lowest CB size including this CB for removing CB size //quatization errors int i = cbIndex; - while (c<0) + while ((i<9)&&(c<0)) { c = cEcrTable[i++][tbsIndex]; }