repo.or.cz
/
factor.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Revert "lists: Add list literal doc example."
[factor.git]
/
basis
/
math
/
matrices
/
elimination
/
elimination-tests.factor
blob
cd2ed06015ceb56fd6645a3439ea8d07ae0c7183
1
IN: math.matrices.elimination.tests
2
USING: kernel math.matrices math.matrices.elimination
3
tools.test sequences ;
4
5
{
6
{
7
{ 1 0 0 0 }
8
{ 0 1 0 0 }
9
{ 0 0 1 0 }
10
{ 0 0 0 1 }
11
}
12
} [
13
{
14
{ 1 0 0 0 }
15
{ 0 1 0 0 }
16
{ 0 0 1 0 }
17
{ 0 0 0 1 }
18
} echelon
19
] unit-test
20
21
{
22
{
23
{ 1 0 0 0 }
24
{ 0 1 0 0 }
25
{ 0 0 1 0 }
26
{ 0 0 0 1 }
27
}
28
} [
29
{
30
{ 1 0 0 0 }
31
{ 1 1 0 0 }
32
{ 1 0 1 0 }
33
{ 1 0 0 1 }
34
} echelon
35
] unit-test
36
37
{
38
{
39
{ 1 0 0 0 }
40
{ 0 1 0 0 }
41
{ 0 0 1 0 }
42
{ 0 0 0 1 }
43
}
44
} [
45
{
46
{ 1 0 0 0 }
47
{ 1 1 0 0 }
48
{ 1 0 1 0 }
49
{ 1 1 0 1 }
50
} echelon
51
] unit-test
52
53
{
54
{
55
{ 1 0 0 0 }
56
{ 0 1 0 0 }
57
{ 0 0 1 0 }
58
{ 0 0 0 1 }
59
}
60
} [
61
{
62
{ 1 0 0 0 }
63
{ 1 1 0 0 }
64
{ 1 1 0 1 }
65
{ 1 0 1 0 }
66
} echelon
67
] unit-test
68
69
{
70
{
71
{ 1 0 0 0 }
72
{ 0 1 0 0 }
73
{ 0 0 0 0 }
74
{ 0 0 0 0 }
75
}
76
} [
77
{
78
{ 0 1 0 0 }
79
{ 1 0 0 0 }
80
{ 1 0 0 0 }
81
{ 1 0 0 0 }
82
} [
83
[ 1 ] [ 0 0 pivot-row ] unit-test
84
1 0 do-row
85
] with-matrix
86
] unit-test
87
88
{
89
{
90
{ 1 0 0 0 }
91
{ 0 1 0 0 }
92
{ 0 0 0 0 }
93
{ 0 0 0 0 }
94
}
95
} [
96
{
97
{ 0 1 0 0 }
98
{ 1 0 0 0 }
99
{ 1 0 0 0 }
100
{ 1 0 0 0 }
101
} echelon
102
] unit-test
103
104
{
105
{
106
{ 1 0 0 0 }
107
{ 0 1 0 0 }
108
{ 0 0 0 1 }
109
{ 0 0 0 0 }
110
}
111
} [
112
{
113
{ 1 0 0 0 }
114
{ 0 1 0 0 }
115
{ 1 0 0 1 }
116
{ 1 0 0 1 }
117
} echelon
118
] unit-test
119
120
{
121
{
122
{ 1 0 0 1 }
123
{ 0 1 0 1 }
124
{ 0 0 0 -1 }
125
{ 0 0 0 0 }
126
}
127
} [
128
{
129
{ 0 1 0 1 }
130
{ 1 0 0 1 }
131
{ 1 0 0 0 }
132
{ 1 1 0 1 }
133
} echelon
134
] unit-test
135
136
{
137
2
138
} [
139
{
140
{ 0 0 }
141
{ 0 0 }
142
} nullspace length
143
] unit-test
144
145
{
146
1 3
147
} [
148
{
149
{ 0 1 0 1 }
150
{ 1 0 0 1 }
151
{ 1 0 0 0 }
152
{ 1 1 0 1 }
153
} null/rank
154
] unit-test
155
156
{
157
1 3
158
} [
159
{
160
{ 0 0 0 0 0 1 0 1 }
161
{ 0 0 0 0 1 0 0 1 }
162
{ 0 0 0 0 1 0 0 0 }
163
{ 0 0 0 0 1 1 0 1 }
164
} null/rank
165
] unit-test
166
167
{ { { 1 0 -1 } { 0 1 2 } } }
168
[ { { 1 2 3 } { 4 5 6 } } solution ] unit-test