File: array_test.ref

package info (click to toggle)
libitpp 4.0.4-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 7,520 kB
  • ctags: 6,341
  • sloc: cpp: 51,608; sh: 9,248; makefile: 636; fortran: 8
file content (29 lines) | stat: -rw-r--r-- 628 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Testing simple Arrays of integers:
A1 = {1 1 42 1 1 1 1 1 1 1}
A2 = {5 5 5 5 5 5 5 5 5 5 5 5 5 5 5}

Testing Array initialisation with: "{[1 1] [1 0 1 0] [0 0 1]}":
A3 = {[1 1] [1 0 1 0] [0 0 1]}

Testing Array initialisation with: "{{[5 3; 020 4] [1 0; 3 9]} {[0 -3; 1 0xa]}}":
A4 = {{[[5 3]
 [16 4]] [[1 0]
 [3 9]]} {[[0 -3]
 [1 10]]}}

Testing Array::operator():
A4(1) = {[[0 -3]
 [1 10]]}
A4(0)(1) = [[1 0]
 [3 9]]

Testing Array::left(), Array::right() and Array::mid():
A1.left(4) = {1 1 42 1}
A1.right(5) = {1 1 1 1 1}
A1.mid(2, 3) = {42 1 1}

Testing A4.swap(0, 1):
{{[[0 -3]
 [1 10]]} {[[5 3]
 [16 4]] [[1 0]
 [3 9]]}}