OLD | NEW |
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2011 The Boeing Company | 3 * Copyright (c) 2011 The Boeing Company |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 double ber = 0.0; | 66 double ber = 0.0; |
67 | 67 |
68 for (uint32_t k = 2; k <= 16; k++) | 68 for (uint32_t k = 2; k <= 16; k++) |
69 { | 69 { |
70 ber += m_binomialCoefficients[k] * exp (20.0 * snr * (1.0 / k - 1.0)); | 70 ber += m_binomialCoefficients[k] * exp (20.0 * snr * (1.0 / k - 1.0)); |
71 } | 71 } |
72 | 72 |
73 ber = ber * 8.0 / 15.0 / 16.0; | 73 ber = ber * 8.0 / 15.0 / 16.0; |
74 | 74 |
75 ber = std::min (ber, 1.0); | 75 ber = std::min (ber, 1.0); |
76 double retval = pow (1.0 - ber, nbits); | 76 double retval = pow (1.0 - ber, (double)nbits); |
77 return retval; | 77 return retval; |
78 } | 78 } |
79 | 79 |
80 } // namespace ns3 | 80 } // namespace ns3 |
OLD | NEW |