@@ -87,19 +87,19 @@ Matrix space of 3 rows and 3 columns
87
87
over univariate polynomial ring in t over rationals
88
88
89
89
julia> A = S()
90
- [0 0 0 ]
91
- [0 0 0 ]
92
- [0 0 0 ]
90
+ [. . . ]
91
+ [. . . ]
92
+ [. . . ]
93
93
94
94
julia> B = S(12)
95
- [12 0 0 ]
96
- [ 0 12 0 ]
97
- [ 0 0 12]
95
+ [12 . . ]
96
+ [ . 12 . ]
97
+ [ . . 12]
98
98
99
99
julia> C = S(R(11))
100
- [11 0 0 ]
101
- [ 0 11 0 ]
102
- [ 0 0 11]
100
+ [11 . . ]
101
+ [ . 11 . ]
102
+ [ . . 11]
103
103
104
104
```
105
105
@@ -155,23 +155,23 @@ Matrix ring of degree 2
155
155
156
156
julia> M1 = S(Rational{BigInt}[2 3 1; 1 0 4])
157
157
[2//1 3//1 1//1]
158
- [1//1 0//1 4//1]
158
+ [1//1 . 4//1]
159
159
160
160
julia> M2 = S(BigInt[2 3 1; 1 0 4])
161
161
[2//1 3//1 1//1]
162
- [1//1 0//1 4//1]
162
+ [1//1 . 4//1]
163
163
164
164
julia> M3 = S(BigInt[2, 3, 1, 1, 0, 4])
165
165
[2//1 3//1 1//1]
166
- [1//1 0//1 4//1]
166
+ [1//1 . 4//1]
167
167
168
168
julia> N1 = T(Rational{BigInt}[2 3; 1 0])
169
169
[2//1 3//1]
170
- [1//1 0//1 ]
170
+ [1//1 . ]
171
171
172
172
julia> N2 = T(BigInt[2 3; 1 0])
173
173
[2//1 3//1]
174
- [1//1 0//1 ]
174
+ [1//1 . ]
175
175
176
176
julia> N3 = T(BigInt[2, 3, 1, 1])
177
177
[2//1 3//1]
@@ -186,7 +186,7 @@ Matrix space of 3 rows and 3 columns
186
186
187
187
julia> M = R[t + 1 1; t^2 0]
188
188
[t + 1 1]
189
- [ t^2 0 ]
189
+ [ t^2 . ]
190
190
191
191
julia> N = R[t + 1 2 t] # create a row vector
192
192
[t + 1 2 t]
@@ -228,25 +228,25 @@ Construct the $r\times c$ AbstractAlgebra.jl zero matrix over the ring `R`.
228
228
``` jldoctest
229
229
julia> M = matrix(ZZ, BigInt[3 1 2; 2 0 1])
230
230
[3 1 2]
231
- [2 0 1]
231
+ [2 . 1]
232
232
233
233
julia> N = matrix(ZZ, 3, 2, BigInt[3, 1, 2, 2, 0, 1])
234
234
[3 1]
235
235
[2 2]
236
- [0 1]
236
+ [. 1]
237
237
238
238
julia> P = zero_matrix(ZZ, 3, 2)
239
- [0 0 ]
240
- [0 0 ]
241
- [0 0 ]
239
+ [. . ]
240
+ [. . ]
241
+ [. . ]
242
242
243
243
julia> R = matrix_ring(ZZ, 2)
244
244
Matrix ring of degree 2
245
245
over integers
246
246
247
247
julia> M = R()
248
- [0 0 ]
249
- [0 0 ]
248
+ [. . ]
249
+ [. . ]
250
250
```
251
251
252
252
## Block diagonal matrix constructors
@@ -267,10 +267,10 @@ block_diagonal_matrix(::Ring, ::Vector{<:Matrix{T}}) where T <: RingElement
267
267
268
268
``` jldoctest
269
269
julia> block_diagonal_matrix(ZZ, [[1 2; 3 4], [4 5 6; 7 8 9]])
270
- [1 2 0 0 0 ]
271
- [3 4 0 0 0 ]
272
- [0 0 4 5 6]
273
- [0 0 7 8 9]
270
+ [1 2 . . . ]
271
+ [3 4 . . . ]
272
+ [. . 4 5 6]
273
+ [. . 7 8 9]
274
274
275
275
julia> M = matrix(ZZ, [1 2; 3 4])
276
276
[1 2]
@@ -281,10 +281,10 @@ julia> N = matrix(ZZ, [4 5 6; 7 8 9])
281
281
[7 8 9]
282
282
283
283
julia> block_diagonal_matrix([M, N])
284
- [1 2 0 0 0 ]
285
- [3 4 0 0 0 ]
286
- [0 0 4 5 6]
287
- [0 0 7 8 9]
284
+ [1 2 . . . ]
285
+ [3 4 . . . ]
286
+ [. . 4 5 6]
287
+ [. . 7 8 9]
288
288
```
289
289
290
290
## Conversion to Julia matrices, iteration and broacasting
@@ -554,7 +554,7 @@ julia> Z = divexact(2*A, 2)
554
554
[ -2 t + 2 t^2 + t + 1]
555
555
556
556
julia> M = matrix(ZZ, BigInt[2 3 0; 1 1 1])
557
- [2 3 0 ]
557
+ [2 3 . ]
558
558
[1 1 1]
559
559
560
560
julia> M[1, 2] = BigInt(4)
@@ -685,22 +685,22 @@ julia> M = matrix(ZZ, BigInt[1 2 3; 2 3 4; 3 4 5])
685
685
[3 4 5]
686
686
687
687
julia> N = matrix(ZZ, BigInt[1 0 1; 0 1 0; 1 0 1])
688
- [1 0 1]
689
- [0 1 0 ]
690
- [1 0 1]
688
+ [1 . 1]
689
+ [. 1 . ]
690
+ [1 . 1]
691
691
692
692
julia> P = hcat(M, N)
693
- [1 2 3 1 0 1]
694
- [2 3 4 0 1 0 ]
695
- [3 4 5 1 0 1]
693
+ [1 2 3 1 . 1]
694
+ [2 3 4 . 1 . ]
695
+ [3 4 5 1 . 1]
696
696
697
697
julia> Q = vcat(M, N)
698
698
[1 2 3]
699
699
[2 3 4]
700
700
[3 4 5]
701
- [1 0 1]
702
- [0 1 0 ]
703
- [1 0 1]
701
+ [1 . 1]
702
+ [. 1 . ]
703
+ [1 . 1]
704
704
705
705
```
706
706
@@ -740,7 +740,7 @@ Test whether the given matrix has a value associated with indices `i` and `j`.
740
740
``` jldoctest
741
741
julia> M = matrix(ZZ, BigInt[3 1 2; 2 0 1])
742
742
[3 1 2]
743
- [2 0 1]
743
+ [2 . 1]
744
744
745
745
julia> isassigned(M, 1, 2)
746
746
true
@@ -756,8 +756,8 @@ julia> isassigned(A, 1, 2)
756
756
false
757
757
758
758
julia> B = zero(M)
759
- [0 0 0 ]
760
- [0 0 0 ]
759
+ [. . . ]
760
+ [. . . ]
761
761
762
762
julia> C = similar(M, 4, 5)
763
763
[#undef #undef #undef #undef #undef]
@@ -769,8 +769,8 @@ julia> base_ring(B)
769
769
Integers
770
770
771
771
julia> D = zero(M, QQ, 2, 2)
772
- [0//1 0//1 ]
773
- [0//1 0//1 ]
772
+ [. . ]
773
+ [. . ]
774
774
775
775
julia> base_ring(D)
776
776
Rationals
@@ -839,7 +839,7 @@ Matrix space of 3 rows and 3 columns
839
839
over residue field of univariate polynomial ring modulo x^3 + 3*x + 1
840
840
841
841
julia> A = S([K(0) 2a + 3 a^2 + 1; a^2 - 2 a - 1 2a; a^2 - 2 a - 1 2a])
842
- [ 0 2*x + 3 x^2 + 1]
842
+ [ . 2*x + 3 x^2 + 1]
843
843
[x^2 - 2 x - 1 2*x]
844
844
[x^2 - 2 x - 1 2*x]
845
845
@@ -876,7 +876,7 @@ Matrix space of 3 rows and 3 columns
876
876
over residue field of univariate polynomial ring modulo x^3 + 3*x + 1
877
877
878
878
julia> M = S([K(0) 2a + 3 a^2 + 1; a^2 - 2 a - 1 2a; a^2 + 3a + 1 2a K(1)])
879
- [ 0 2*x + 3 x^2 + 1]
879
+ [ . 2*x + 3 x^2 + 1]
880
880
[ x^2 - 2 x - 1 2*x]
881
881
[x^2 + 3*x + 1 2*x 1]
882
882
@@ -894,7 +894,7 @@ Matrix space of 3 rows and 3 columns
894
894
over univariate polynomial ring in x over integers
895
895
896
896
julia> M = S([R(0) 2x + 3 x^2 + 1; x^2 - 2 x - 1 2x; x^2 + 3x + 1 2x R(1)])
897
- [ 0 2*x + 3 x^2 + 1]
897
+ [ . 2*x + 3 x^2 + 1]
898
898
[ x^2 - 2 x - 1 2*x]
899
899
[x^2 + 3*x + 1 2*x 1]
900
900
@@ -949,10 +949,10 @@ julia> R, x = polynomial_ring(QQ, ["x$i" for i in 1:6])
949
949
(Multivariate polynomial ring in 6 variables over rationals, AbstractAlgebra.Generic.MPoly{Rational{BigInt}}[x1, x2, x3, x4, x5, x6])
950
950
951
951
julia> M = R[0 x[1] x[2] x[3]; -x[1] 0 x[4] x[5]; -x[2] -x[4] 0 x[6]; -x[3] -x[5] -x[6] 0]
952
- [ 0 x1 x2 x3]
953
- [-x1 0 x4 x5]
954
- [-x2 -x4 0 x6]
955
- [-x3 -x5 -x6 0 ]
952
+ [ . x1 x2 x3]
953
+ [-x1 . x4 x5]
954
+ [-x2 -x4 . x6]
955
+ [-x3 -x5 -x6 . ]
956
956
957
957
julia> pfaffian(M)
958
958
x1*x6 - x2*x5 + x3*x4
@@ -999,7 +999,7 @@ Matrix space of 3 rows and 3 columns
999
999
over residue field of univariate polynomial ring modulo x^3 + 3*x + 1
1000
1000
1001
1001
julia> A = S([K(0) 2a + 3 a^2 + 1; a^2 - 2 a - 1 2a; a^2 + 3a + 1 2a K(1)])
1002
- [ 0 2*x + 3 x^2 + 1]
1002
+ [ . 2*x + 3 x^2 + 1]
1003
1003
[ x^2 - 2 x - 1 2*x]
1004
1004
[x^2 + 3*x + 1 2*x 1]
1005
1005
@@ -1022,7 +1022,7 @@ Matrix space of 3 rows and 3 columns
1022
1022
over univariate polynomial ring in x over integers
1023
1023
1024
1024
julia> A = S([R(0) 2x + 3 x^2 + 1; x^2 - 2 x - 1 2x; x^2 + 3x + 1 2x R(1)])
1025
- [ 0 2*x + 3 x^2 + 1]
1025
+ [ . 2*x + 3 x^2 + 1]
1026
1026
[ x^2 - 2 x - 1 2*x]
1027
1027
[x^2 + 3*x + 1 2*x 1]
1028
1028
@@ -1059,15 +1059,15 @@ Matrix space of 4 rows and 4 columns
1059
1059
julia> M = S([R(1) R(2) R(4) R(3); R(2) R(5) R(1) R(0);
1060
1060
R(6) R(1) R(3) R(2); R(1) R(1) R(3) R(5)])
1061
1061
[1 2 4 3]
1062
- [2 5 1 0 ]
1062
+ [2 5 1 . ]
1063
1063
[6 1 3 2]
1064
1064
[1 1 3 5]
1065
1065
1066
1066
julia> A = hessenberg(M)
1067
1067
[1 5 5 3]
1068
- [2 1 1 0 ]
1069
- [0 1 3 2]
1070
- [0 0 2 2]
1068
+ [2 1 1 . ]
1069
+ [. 1 3 2]
1070
+ [. . 2 2]
1071
1071
1072
1072
julia> is_hessenberg(A)
1073
1073
true
@@ -1112,9 +1112,9 @@ julia> A = matrix(ZZ, [2 3 -1; 3 5 7; 11 1 12])
1112
1112
[11 1 12]
1113
1113
1114
1114
julia> H = hnf(A)
1115
- [1 0 255]
1116
- [0 1 17]
1117
- [0 0 281]
1115
+ [1 . 255]
1116
+ [. 1 17]
1117
+ [. . 281]
1118
1118
1119
1119
julia> is_hnf(H)
1120
1120
true
@@ -1123,9 +1123,9 @@ julia> H, U = hnf_with_transform(A)
1123
1123
([1 0 255; 0 1 17; 0 0 281], [-47 28 1; -3 2 0; -52 31 1])
1124
1124
1125
1125
julia> U*A
1126
- [1 0 255]
1127
- [0 1 17]
1128
- [0 0 281]
1126
+ [1 . 255]
1127
+ [. 1 17]
1128
+ [. . 281]
1129
1129
```
1130
1130
1131
1131
### Smith normal form
@@ -1148,17 +1148,17 @@ julia> A = matrix(ZZ, [2 3 -1; 3 5 7; 11 1 12])
1148
1148
[11 1 12]
1149
1149
1150
1150
julia> S = snf(A)
1151
- [1 0 0 ]
1152
- [0 1 0 ]
1153
- [0 0 281]
1151
+ [1 . . ]
1152
+ [. 1 . ]
1153
+ [. . 281]
1154
1154
1155
1155
julia> S, T, U = snf_with_transform(A)
1156
1156
([1 0 0; 0 1 0; 0 0 281], [1 0 0; 7 1 0; 229 31 1], [0 -3 26; 0 2 -17; -1 0 1])
1157
1157
1158
1158
julia> T*A*U
1159
- [1 0 0 ]
1160
- [0 1 0 ]
1161
- [0 0 281]
1159
+ [1 . . ]
1160
+ [. 1 . ]
1161
+ [. . 281]
1162
1162
```
1163
1163
1164
1164
### (Weak) Popov form
@@ -1189,14 +1189,14 @@ julia> A = matrix(R, map(R, Any[1 2 3 x; x 2*x 3*x x^2; x x^2+1 x^3+x^2 x^4+x^2+
1189
1189
1190
1190
julia> P = weak_popov(A)
1191
1191
[ 1 2 3 x]
1192
- [ 0 0 0 0 ]
1192
+ [ . . . . ]
1193
1193
[-x^3 -2*x^3 + x^2 - 2*x + 1 -2*x^3 + x^2 - 3*x 1]
1194
1194
1195
1195
julia> P, U = weak_popov_with_transform(A)
1196
1196
([1 2 3 x; 0 0 0 0; -x^3 -2*x^3+x^2-2*x+1 -2*x^3+x^2-3*x 1], [1 0 0; -x 1 0; -x^3-x 0 1])
1197
1197
1198
1198
julia> U*A
1199
1199
[ 1 2 3 x]
1200
- [ 0 0 0 0 ]
1200
+ [ . . . . ]
1201
1201
[-x^3 -2*x^3 + x^2 - 2*x + 1 -2*x^3 + x^2 - 3*x 1]
1202
1202
```
0 commit comments