forked from JohnCremona/eclib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
svectest1.out
29 lines (28 loc) · 848 Bytes
/
svectest1.out
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
Test run of sparse vector package.
Enter n : Uninitialized new vec v = []
Copy of v = []
Enter new entries of v: Dimension = Number of entries = Position: Entry: Position: Entry: Position: Entry: Now v = [(1:2),(3:4),(5:6)]
w = []
After w=v,
Now v = [(1:2),(3:4),(5:6)]
Now w = [(1:2),(3:4),(5:6)]
w==v: 1
w!=v: 0
v+w = [(1:4),(3:8),(5:12)]
v-w = []
Enter i : After w*=2, w = [(1:4),(3:8),(5:12)]
3*v = [(1:6),(3:12),(5:18)]
Now v = [(1:2),(3:4),(5:6)]
v+w = [(1:6),(3:12),(5:18)]
Now v = [(1:2),(3:4),(5:6)]
v-w = [(1:-2),(3:-4),(5:-6)]
Now v = [(1:2),(3:4),(5:6)]
w/2 = [(1:2),(3:4),(5:6)]
Now w = [(1:4),(3:8),(5:12)]
-v = [(1:-2),(3:-4),(5:-6)]
+v = [(1:2),(3:4),(5:6)]
+w = [(1:4),(3:8),(5:12)]
2*v-w = []
Resetting w[1] to 99: w = [(1:99),(3:8),(5:12)]
After w-=2*v, w = [(1:95)]
v as an ordinary vector = [2,0,4,0,6,0,0,0,0,0]