21 #include <ns3/object.h> 22 #include <ns3/spectrum-value.h> 23 #include <ns3/spectrum-converter.h> 35 #define TOLERANCE 1e-6 42 virtual void DoRun (
void);
98 std::vector<double> freqs;
100 for (
int i = 1; i <= 5; i++)
112 doubleValue = 1.12345600000000;
114 v1[0] = 0.700539792840;
115 v1[1] = -0.554277600423;
116 v1[2] = 0.750309319469;
117 v1[3] = -0.892299213192;
118 v1[4] = 0.987045234885;
120 v2[0] = 0.870441628737;
121 v2[1] = 0.271419263880;
122 v2[2] = 0.451557288312;
123 v2[3] = 0.968992859395;
124 v2[4] = -0.929186654705;
126 v3[0] = 1.570981421577;
127 v3[1] = -0.282858336543;
128 v3[2] = 1.201866607781;
129 v3[3] = 0.076693646203;
130 v3[4] = 0.057858580180;
132 v4[0] = -0.169901835897;
133 v4[1] = -0.825696864302;
134 v4[2] = 0.298752031158;
135 v4[3] = -1.861292072588;
136 v4[4] = 1.916231889590;
138 v5[0] = 0.609778998275;
139 v5[1] = -0.150441618292;
140 v5[2] = 0.338807641695;
141 v5[3] = -0.864631566028;
142 v5[4] = -0.917149259846;
144 v6[0] = 0.804809615846;
145 v6[1] = -2.042145397125;
146 v6[2] = 1.661603829438;
147 v6[3] = -0.920852207053;
148 v6[4] = -1.062267984465;
150 v7[0] = 1.823995792840;
151 v7[1] = 0.569178399577;
152 v7[2] = 1.873765319469;
153 v7[3] = 0.231156786808;
154 v7[4] = 2.110501234885;
156 v8[0] = -0.422916207160;
157 v8[1] = -1.677733600423;
158 v8[2] = -0.373146680531;
159 v8[3] = -2.015755213192;
160 v8[4] = -0.136410765115;
162 v9[0] = 0.787025633505;
163 v9[1] = -0.622706495860;
164 v9[2] = 0.842939506814;
165 v9[3] = -1.002458904856;
166 v9[4] = 1.108901891403;
168 v10[0] = 0.623557836569;
169 v10[1] = -0.493368320987;
170 v10[2] = 0.667858215604;
171 v10[3] = -0.794244913190;
172 v10[4] = 0.878579343459;
207 tv7a = v1 + doubleValue;
208 tv8a = v1 - doubleValue;
209 tv9a = v1 * doubleValue;
210 tv10a = v1 / doubleValue;
217 tv7b = doubleValue + v1;
218 tv8b = doubleValue - v1;
219 tv9b = doubleValue * v1;
220 tv10b = doubleValue / v1;
265 std::vector<double> f1;
266 for (
f = 3;
f <= 7;
f += 2)
274 std::vector<double> f2;
275 for (
f = 2;
f <= 8;
f += 1)
323 t21b[0] = 3 * 0.25 + 5 * 0.5 + 1 * 0.25;
324 t21b[1] = 1 * 0.25 + 2 * 0.5 + 4 * 0.25;
325 t21b[2] = 4 * 0.25 + 6 * 0.5 + 3 * 0.25;
static SpectrumValueTestSuite g_SpectrumValueTestSuite
Class which implements a converter between SpectrumValue which are defined over different SpectrumMod...
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
virtual void DoRun(void)
Implementation to actually run this TestCase.
SpectrumValueTestCase(SpectrumValue a, SpectrumValue b, std::string name)
double f(double x, void *params)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual ~SpectrumValueTestCase()
Ptr< const SpectrumModel > GetSpectrumModel() const
Ptr< SpectrumValue > Convert(Ptr< const SpectrumValue > vvf) const
Convert a particular ValueVsFreq instance to.
#define NS_TEST_ASSERT_MSG_SPECTRUM_VALUE_EQ_TOL(actual, expected, tol, msg)
Test if two SpectrumValue instances are equal within a given tolerance.
bool MoreOrLessEqual(SpectrumValue x, SpectrumValue y)
double Norm(const SpectrumValue &x)
SpectrumConverterTestSuite()
Set of values corresponding to a given SpectrumModel.
static SpectrumConverterTestSuite g_SpectrumConverterTestSuite
#define NS_TEST_ASSERT_MSG_SPECTRUM_MODEL_EQ_TOL(actual, expected, tol, msg)
Test if two SpectrumModel instances are equal within a given tolerance.