Lines Matching refs:script

52     QStringList script;  in testCorrect_data()  local
54 script.clear(); in testCorrect_data()
55 script << QStringLiteral("range(10)"); in testCorrect_data()
56 QTest::newRow("simple range") << script << "list { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }"; in testCorrect_data()
58 script.clear(); in testCorrect_data()
59 script << QStringLiteral("range(-1.5, 2)"); in testCorrect_data()
60 QTest::newRow("range(-1.5, 2)") << script << "list { -1.5, -0.5, 0.5, 1.5 }"; in testCorrect_data()
62 script.clear(); in testCorrect_data()
63 script << QStringLiteral("range(0, 1, 0.2)"); in testCorrect_data()
64 QTest::newRow("range(0, 1, 0.2)") << script << "list { 0, 0.2, 0.4, 0.6, 0.8, 1 }"; in testCorrect_data()
66 script.clear(); in testCorrect_data()
67 script << QStringLiteral("vector(3, -2.3)"); in testCorrect_data()
68 QTest::newRow("simple fill vector") << script << "vector { -2.3, -2.3, -2.3 }"; in testCorrect_data()
70 script.clear(); in testCorrect_data()
71 script << QStringLiteral("7*vector(34, 14.2)[23]"); in testCorrect_data()
72 QTest::newRow("select fill vector") << script << "99.4"; in testCorrect_data()
74 script.clear(); in testCorrect_data()
75 script << QStringLiteral("seq := range(14, 20, 2)"); in testCorrect_data()
76 script << QStringLiteral("vector(seq)"); in testCorrect_data()
77 QTest::newRow("vector by range/seq") << script << "vector { 14, 16, 18, 20 }"; in testCorrect_data()
79 script.clear(); in testCorrect_data()
80 script << QStringLiteral("matrix(3, 2, -15.7)"); in testCorrect_data()
81 …QTest::newRow("simple fill matrix") << script << "matrix { matrixrow { -15.7, -15.7 }, matrixrow {… in testCorrect_data()
83 script.clear(); in testCorrect_data()
84 script << QStringLiteral("matrix(2)"); in testCorrect_data()
85 …QTest::newRow("simple fill square matrix") << script << "matrix { matrixrow { 0, 0 }, matrixrow { … in testCorrect_data()
87 script.clear(); in testCorrect_data()
88 script << QStringLiteral("matrix(3, 2)"); in testCorrect_data()
89 …QTest::newRow("simple matrix") << script << "matrix { matrixrow { 0, 0 }, matrixrow { 0, 0 }, matr… in testCorrect_data()
91 script.clear(); in testCorrect_data()
92 script << QStringLiteral("matrix(3, 2, -9.8)[2][1]"); in testCorrect_data()
93 QTest::newRow("select simple matrix") << script << "-9.8"; in testCorrect_data()
95 script.clear(); in testCorrect_data()
96 script << QStringLiteral("matrix(vector{2,3}, vector{7, 4})"); in testCorrect_data()
97 …QTest::newRow("matrix by vectors/columns") << script << "matrix { matrixrow { 2, 7 }, matrixrow { … in testCorrect_data()
99 script.clear(); in testCorrect_data()
100 script << QStringLiteral("matrix(matrixrow{2,3}, matrixrow{7, 4})"); in testCorrect_data()
101 … QTest::newRow("matrix by rows") << script << "matrix { matrixrow { 2, 3 }, matrixrow { 7, 4 } }"; in testCorrect_data()
103 script.clear(); in testCorrect_data()
104 script << QStringLiteral("A := matrix{matrixrow{13,6}, matrixrow{-2,5}}"); in testCorrect_data()
105 script << QStringLiteral("matrix(vector{2,3}, vector{7, 4}) + A"); in testCorrect_data()
106 …QTest::newRow("matrix by vectors/columns + A") << script << "matrix { matrixrow { 15, 13 }, matrix… in testCorrect_data()
108 script.clear(); in testCorrect_data()
109 script << QStringLiteral("A := matrix{matrixrow{2, 3, 6}, matrixrow{-5, 0, 2.3}}"); in testCorrect_data()
110 script << QStringLiteral("matrix(2, 3, -9) + A"); in testCorrect_data()
111 …QTest::newRow("fill + A") << script << "matrix { matrixrow { -7, -6, -3 }, matrixrow { -14, -9, -6… in testCorrect_data()
113 script.clear(); in testCorrect_data()
114 script << QStringLiteral("A := matrix{matrixrow{2, 3}, matrixrow{-5, 1}}"); in testCorrect_data()
115 script << QStringLiteral("B := matrix{matrixrow{12, 13}, matrixrow{-15, 11}}"); in testCorrect_data()
116 script << QStringLiteral("blockmatrix(matrixrow{A, B})"); in testCorrect_data()
117 …QTest::newRow("simple block matrix") << script << "matrix { matrixrow { 2, 3, 12, 13 }, matrixrow … in testCorrect_data()
121 script.clear(); in testCorrect_data()
122 script << QStringLiteral("A := matrix(vector{1,3}, vector{8,5})"); in testCorrect_data()
123 script << QStringLiteral("B := matrix{matrixrow{7,6}, matrixrow{0,2}}"); in testCorrect_data()
124 script << QStringLiteral("C := matrix(matrixrow{1,4})"); in testCorrect_data()
125 script << QStringLiteral("D := matrix(vector{9}, vector{3})"); in testCorrect_data()
126 script << QStringLiteral("blockmatrix(matrixrow{A, B}, matrixrow{C, D})"); in testCorrect_data()
127 QTest::newRow("block matrix 4 blocks conf 1") << script << resultblockmatrix; in testCorrect_data()
129 script.clear(); in testCorrect_data()
130 script << QStringLiteral("A := matrix{matrixrow{1,8,7}, matrixrow{3,5,0}}"); in testCorrect_data()
131 script << QStringLiteral("B := matrix(vector{6,2})"); in testCorrect_data()
132 script << QStringLiteral("C := matrix(matrixrow{1,4,9})"); in testCorrect_data()
133 script << QStringLiteral("D := matrix(1,1,3)"); in testCorrect_data()
134 script << QStringLiteral("blockmatrix(matrixrow{A, B}, matrixrow{C, D})"); in testCorrect_data()
135 QTest::newRow("block matrix by rows, conf 2") << script << resultblockmatrix; in testCorrect_data()
137 script.clear(); in testCorrect_data()
138 script << QStringLiteral("A := matrix(matrixrow{1,8})"); in testCorrect_data()
139 script << QStringLiteral("B := transpose(matrix(diag(diag(7,6))))"); in testCorrect_data()
140 script << QStringLiteral("C := matrix{matrixrow{3,5}}"); in testCorrect_data()
141 script << QStringLiteral("D := matrix(matrixrow{0,2})"); in testCorrect_data()
142 script << QStringLiteral("E := matrix(vector{1},vector{4})"); in testCorrect_data()
143 script << QStringLiteral("F := matrix{matrixrow{9,3}}"); in testCorrect_data()
144 script << QStringLiteral("blockmatrix(matrixrow{A, B}, matrixrow{C, D}, matrixrow{E, F})"); in testCorrect_data()
145 QTest::newRow("block matrix by rows, conf 3") << script << resultblockmatrix; in testCorrect_data()
147 script.clear(); in testCorrect_data()
148 script << QStringLiteral("A := matrix(vector{1,3}, vector{8,5})"); in testCorrect_data()
149 script << QStringLiteral("B := matrix(matrixrow{1,4})"); in testCorrect_data()
150 script << QStringLiteral("C := matrix{matrixrow{7,6}, matrixrow{0,2}}"); in testCorrect_data()
151 script << QStringLiteral("D := matrix(vector{9}, vector{3})"); in testCorrect_data()
152 script << QStringLiteral("blockmatrix(vector{A, B}, vector{C, D})"); in testCorrect_data()
153 QTest::newRow("block matrix by cols, conf 1") << script << resultblockmatrix; in testCorrect_data()
155 script.clear(); in testCorrect_data()
156 script << QStringLiteral("A := matrix{matrixrow{1,8}}"); in testCorrect_data()
157 script << QStringLiteral("B := matrix(matrixrow{3,5})"); in testCorrect_data()
158 script << QStringLiteral("C := matrix(matrixrow{1,4})"); in testCorrect_data()
159 script << QStringLiteral("D := matrix{matrixrow{7,6}}"); in testCorrect_data()
160 script << QStringLiteral("E := matrix(matrixrow{0,2})"); in testCorrect_data()
161 script << QStringLiteral("F := matrix(matrixrow{9,3})"); in testCorrect_data()
162 script << QStringLiteral("blockmatrix(vector{A, B, C}, vector{D, E, F})"); in testCorrect_data()
163 QTest::newRow("block matrix by cols, conf 2") << script << resultblockmatrix; in testCorrect_data()
165 script.clear(); in testCorrect_data()
166 script << QStringLiteral("matrix(2,5)"); in testCorrect_data()
167 …QTest::newRow("simple 0") << script << "matrix { matrixrow { 0, 0, 0, 0, 0 }, matrixrow { 0, 0, 0,… in testCorrect_data()
169 script.clear(); in testCorrect_data()
170 script << QStringLiteral("identitymatrix(3)"); in testCorrect_data()
171 …QTest::newRow("simple I") << script << "matrix { matrixrow { 1, 0, 0 }, matrixrow { 0, 1, 0 }, mat… in testCorrect_data()
173 script.clear(); in testCorrect_data()
174 script << QStringLiteral("identitymatrix(3)-identitymatrix(3)"); in testCorrect_data()
175 …QTest::newRow("I - I") << script << "matrix { matrixrow { 0, 0, 0 }, matrixrow { 0, 0, 0 }, matrix… in testCorrect_data()
177 script.clear(); in testCorrect_data()
178 script << QStringLiteral("0*identitymatrix(3)"); in testCorrect_data()
179 …QTest::newRow("0*I") << script << "matrix { matrixrow { 0, 0, 0 }, matrixrow { 0, 0, 0 }, matrixro… in testCorrect_data()
181 script.clear(); in testCorrect_data()
182 script << QStringLiteral("matrix(3,3) + identitymatrix(3)"); in testCorrect_data()
183 …QTest::newRow("0 + I") << script << "matrix { matrixrow { 1, 0, 0 }, matrixrow { 0, 1, 0 }, matrix… in testCorrect_data()
185 script.clear(); in testCorrect_data()
186 script << QStringLiteral("diag(5, 3.2, 6, -9)"); in testCorrect_data()
187 …QTest::newRow("simple diag") << script << "matrix { matrixrow { 5, 0, 0, 0 }, matrixrow { 0, 3.2, … in testCorrect_data()
189 script.clear(); in testCorrect_data()
190 script << QStringLiteral("diag(vector{5, 3.2, 6, -9})"); in testCorrect_data()
191 …QTest::newRow("simple diag by vector") << script << "matrix { matrixrow { 5, 0, 0, 0 }, matrixrow … in testCorrect_data()
193 script.clear(); in testCorrect_data()
194 script << QStringLiteral("diag(1, 1, 1) - identitymatrix(3)"); in testCorrect_data()
195 …QTest::newRow("zeromatrix: diag - I") << script << "matrix { matrixrow { 0, 0, 0 }, matrixrow { 0,… in testCorrect_data()
197 script.clear(); in testCorrect_data()
198 script << QStringLiteral("diag(vector{1, 1, 1}) - identitymatrix(3)"); in testCorrect_data()
199 …QTest::newRow("zeromatrix: diag by vector - I") << script << "matrix { matrixrow { 0, 0, 0 }, matr… in testCorrect_data()
201 script.clear(); in testCorrect_data()
202 script << QStringLiteral("diag(5, 7.8, -0.6, 3.5)[3][3] + diag(5, 7.8, -0.6, 3.5)[2][3]"); in testCorrect_data()
203 QTest::newRow("selector diag") << script << "-0.6"; in testCorrect_data()
205 script.clear(); in testCorrect_data()
206 script << QStringLiteral("v := vector{5, 7.8, -0.6, 3.5}"); in testCorrect_data()
207 script << QStringLiteral("diag(v)[3][3] + diag(v)[2][3]"); in testCorrect_data()
208 QTest::newRow("selector diag by vector") << script << "-0.6"; in testCorrect_data()
210 script.clear(); in testCorrect_data()
211script << QStringLiteral("blockdiag(matrix{matrixrow{1, 3}, matrixrow{-6, 8}}, matrix{matrixrow{5,… in testCorrect_data()
212 …QTest::newRow("simple block diagonal") << script << "matrix { matrixrow { 1, 3, 0, 0 }, matrixrow … in testCorrect_data()
214 script.clear(); in testCorrect_data()
215 script << QStringLiteral("I := identitymatrix(3)"); in testCorrect_data()
216 script << QStringLiteral("A := matrix(2,3, -6)"); in testCorrect_data()
217 script << QStringLiteral("B := 3*I"); in testCorrect_data()
218 script << QStringLiteral("blockdiag(I, A, B)"); in testCorrect_data()
219 …QTest::newRow("block diagonal") << script << "matrix { matrixrow { 1, 0, 0, 0, 0, 0, 0, 0, 0 }, ma… in testCorrect_data()
221 script.clear(); in testCorrect_data()
222 script << QStringLiteral("tridiag(-2.1, 3.6, 48, 5)"); in testCorrect_data()
223 …QTest::newRow("simple tridiag") << script << "matrix { matrixrow { 3.6, 48, 0, 0, 0 }, matrixrow {… in testCorrect_data()
225 script.clear(); in testCorrect_data()
226script << QStringLiteral("A := matrix{matrixrow{-7.8, 2.3, 5}, matrixrow{0, -1.2, cos(pi)}, matrix… in testCorrect_data()
227 script << QStringLiteral("tridiag(-8, 10, 7.2, 3) - identitymatrix(3) + A"); in testCorrect_data()
228 …QTest::newRow("tridiag - I + A") << script << "matrix { matrixrow { 1.2, 9.5, 5 }, matrixrow { -8,… in testCorrect_data()
230 script.clear(); in testCorrect_data()
231script << QStringLiteral("A := matrix{matrixrow{-7.8, 2.3, 5}, matrixrow{0, -12, 1}, matrixrow{-45… in testCorrect_data()
232 script << QStringLiteral("diag(A)"); in testCorrect_data()
233 QTest::newRow("simple diag(A)") << script << "vector { -7.8, -12, -1 }"; in testCorrect_data()
235 script.clear(); in testCorrect_data()
236 script << QStringLiteral("A := matrix{matrixrow{8, 2.3, 5}, matrixrow{-45, -cos(pi), 12}}"); in testCorrect_data()
237 script << QStringLiteral("diag(A)"); in testCorrect_data()
238 QTest::newRow("getdiag fat") << script << "vector { 8, 1 }"; in testCorrect_data()
240 script.clear(); in testCorrect_data()
241script << QStringLiteral("A := matrix{matrixrow{8, 2.3, 1}, matrixrow{3, 32, 2}, matrixrow{-45, 12… in testCorrect_data()
242 script << QStringLiteral("diag(A)"); in testCorrect_data()
243 QTest::newRow("getdiag skinny") << script << "vector { 8, 32, 3 }"; in testCorrect_data()
245 script.clear(); in testCorrect_data()
246script << QStringLiteral("A := matrix{matrixrow{-7.8, 2.3, 5}, matrixrow{0, -12, 1}, matrixrow{-45… in testCorrect_data()
247 script << QStringLiteral("diag(A)[2]"); in testCorrect_data()
248 QTest::newRow("selector getdiag") << script << "-12"; in testCorrect_data()
250 script.clear(); in testCorrect_data()
251 script << QStringLiteral("v := vector{5,5,0}"); in testCorrect_data()
252script << QStringLiteral("A := matrix{matrixrow{0, -1, 2}, matrixrow{4, 0, -3.2}, matrixrow{5.8, -… in testCorrect_data()
253 script << QStringLiteral("B := matrix(3,3, 4.5)"); in testCorrect_data()
254 script << QStringLiteral("D := diag(v)"); in testCorrect_data()
255 script << QStringLiteral("I := identitymatrix(3)"); in testCorrect_data()
256 script << QStringLiteral("O := matrix(3,3)"); in testCorrect_data()
257 script << QStringLiteral("T := tridiag(2,1,8,3)"); in testCorrect_data()
258 script << QStringLiteral("A + B + D - cos(pi)*I + O + T"); in testCorrect_data()
259 …QTest::newRow("complex exp") << script << "matrix { matrixrow { 11.5, 11.5, 6.5 }, matrixrow { 10.… in testCorrect_data()
268 script.clear(); in testCorrect_data()
269 script << square; in testCorrect_data()
270 script << QStringLiteral("diag(A,2)"); in testCorrect_data()
271 QTest::newRow("getndiag square +2") << script << "vector { 0, 20, 90 }"; in testCorrect_data()
273 script.clear(); in testCorrect_data()
274 script << square; in testCorrect_data()
275 script << QStringLiteral("diag(A,-2)"); in testCorrect_data()
276 QTest::newRow("getndiag square -2") << script << "vector { 1, -7, 3 }"; in testCorrect_data()
278 script.clear(); in testCorrect_data()
279 script << square; in testCorrect_data()
280 script << QStringLiteral("diag(A,-3)"); in testCorrect_data()
281 QTest::newRow("getndiag square -3") << script << "vector { 0, 4 }"; in testCorrect_data()
283 script.clear(); in testCorrect_data()
284 script << square; in testCorrect_data()
285 script << QStringLiteral("diag(A,3)"); in testCorrect_data()
286 QTest::newRow("getndiag square +3") << script << "vector { 9, 100 }"; in testCorrect_data()
288 script.clear(); in testCorrect_data()
289 script << square; in testCorrect_data()
290 script << QStringLiteral("diag(A,-3)"); in testCorrect_data()
291 QTest::newRow("getndiag square -3") << script << "vector { 0, 4 }"; in testCorrect_data()
293 script.clear(); in testCorrect_data()
294 script << square; in testCorrect_data()
295 script << QStringLiteral("diag(A,4)[1]"); in testCorrect_data()
296 QTest::newRow("selector getndiag square corner +") << script << "80"; in testCorrect_data()
298 script.clear(); in testCorrect_data()
299 script << square; in testCorrect_data()
300 script << QStringLiteral("diag(A,-4)[1]"); in testCorrect_data()
301 QTest::newRow("selector getndiag square corner -") << script << "5"; in testCorrect_data()
310 script.clear(); in testCorrect_data()
311 script << fat; in testCorrect_data()
312 script << QStringLiteral("diag(A,5)"); in testCorrect_data()
313 QTest::newRow("getndiag fat +5") << script << "vector { 4, 7 }"; in testCorrect_data()
315 script.clear(); in testCorrect_data()
316 script << fat; in testCorrect_data()
317 script << QStringLiteral("diag(A,1)"); in testCorrect_data()
318 QTest::newRow("getndiag fat +1") << script << "vector { 42, 45, 47, 48, 3 }"; in testCorrect_data()
320 script.clear(); in testCorrect_data()
321 script << fat; in testCorrect_data()
322 script << QStringLiteral("diag(A,-1)"); in testCorrect_data()
323 QTest::newRow("getndiag fat -1") << script << "vector { -4.1, 2.2, -2.3, -2.1 }"; in testCorrect_data()
325 script.clear(); in testCorrect_data()
326 script << fat; in testCorrect_data()
327 script << QStringLiteral("diag(A,6)[1]"); in testCorrect_data()
328 QTest::newRow("selector getndiag fat corner +") << script << "15"; in testCorrect_data()
330 script.clear(); in testCorrect_data()
331 script << fat; in testCorrect_data()
332 script << QStringLiteral("diag(A,-4)[1]"); in testCorrect_data()
333 QTest::newRow("selector getndiag fat corner -") << script << "2"; in testCorrect_data()
342 script.clear(); in testCorrect_data()
343 script << fat; in testCorrect_data()
344 script << QStringLiteral("diag(A,1)[1]"); in testCorrect_data()
345 QTest::newRow("selector getndiag skinny corner +") << script << "42"; in testCorrect_data()
347 script.clear(); in testCorrect_data()
348 script << skinny; in testCorrect_data()
349 script << QStringLiteral("diag(A,-1)"); in testCorrect_data()
350 QTest::newRow("getndiag skinny -1") << script << "vector { -4.1, 2.2 }"; in testCorrect_data()
352 script.clear(); in testCorrect_data()
353 script << skinny; in testCorrect_data()
354 script << QStringLiteral("diag(A,-3)"); in testCorrect_data()
355 QTest::newRow("getndiag skinny -3") << script << "vector { 0, 4 }"; in testCorrect_data()
357 script.clear(); in testCorrect_data()
358 script << skinny; in testCorrect_data()
359 script << QStringLiteral("diag(A,-4)"); in testCorrect_data()
360 QTest::newRow("getndiag skinny -4") << script << "vector { 2 }"; in testCorrect_data()
362 script.clear(); in testCorrect_data()
363 script << skinny; in testCorrect_data()
364 script << QStringLiteral("isdiag(A)"); in testCorrect_data()
365 QTest::newRow("is not diag") << script << "false"; in testCorrect_data()
367 script.clear(); in testCorrect_data()
368 script << QStringLiteral("iszeromatrix(matrix(8,5))"); in testCorrect_data()
369 QTest::newRow("is zero matrix") << script << "true"; in testCorrect_data()
371 script.clear(); in testCorrect_data()
372 script << QStringLiteral("isidentitymatrix(identitymatrix(5))"); in testCorrect_data()
373 QTest::newRow("Id is identity matrix") << script << "true"; in testCorrect_data()
375 script.clear(); in testCorrect_data()
376script << QStringLiteral("isidentitymatrix(blockdiag(identitymatrix(3), matrix{matrixrow{1}}, iden… in testCorrect_data()
377 QTest::newRow("block of Id is Id matrix") << script << "true"; in testCorrect_data()
379 script.clear(); in testCorrect_data()
380 script << QStringLiteral("isdiag(identitymatrix(4))"); in testCorrect_data()
381 QTest::newRow("Id is diag matrix") << script << "true"; in testCorrect_data()
384 script.clear(); in testCorrect_data()
385 script << QStringLiteral("eigenvalues(identitymatrix(4))"); in testCorrect_data()
386 QTest::newRow("eigenvalues: from Id") << script << "list { 1, 1, 1, 1 }"; in testCorrect_data()
388 script.clear(); in testCorrect_data()
389 script << QStringLiteral("eigenvalues(matrix(vector{3,4}, vector{-2, -1}))"); in testCorrect_data()
390 QTest::newRow("eigenvalues: full complex") << script << "list { 1+2*i, 1-2*i }"; in testCorrect_data()
392 script.clear(); in testCorrect_data()
393 script << QStringLiteral("eigenvectors(identitymatrix(4))"); in testCorrect_data()
394 …QTest::newRow("eigenvectors: from Id") << script << "list { vector { 1, 0, 0, 0 }, vector { 0, 1, … in testCorrect_data()
396 script.clear(); in testCorrect_data()
397 script << QStringLiteral("eigenvectors(matrix(vector{3,4}, vector{-2, -1}))"); in testCorrect_data()
398 …QTest::newRow("complex eigenvectors") << script << "list { vector { -0.408248290464+0.408248290464… in testCorrect_data()
424 QString script = expression.join(QStringLiteral("\n")); in testCorrect() local
425 script+=QLatin1String("\n\n\n"); in testCorrect()
426 QTextStream stream(&script); in testCorrect()