12
12
@test size (RowVector {Int} (1 ,3 )) === (1 ,3 )
13
13
@test size (RowVector {Int} ((3 ,))) === (1 ,3 )
14
14
@test size (RowVector {Int} ((1 ,3 ))) === (1 ,3 )
15
- @test_throws Exception RowVector {Float64, Vector{Int}} (v)
15
+ @test_throws ErrorException RowVector {Float64, Vector{Int}} (v)
16
16
17
17
@test (v.' ):: RowVector == [1 2 3 ]
18
18
@test (v' ):: RowVector == [1 2 3 ]
25
25
@test (rv.' ):: Vector == [1 , 2 , 3 ]
26
26
@test (rv' ):: Vector == [1 , 2 , 3 ]
27
27
@test (tz.' ):: Vector == [1 + im, 2 , 3 ]
28
- @test (tz' ):: Vector == [1 - im, 2 , 3 ]
28
+ @test (tz' ):: ConjVector == [1 - im, 2 , 3 ]
29
29
30
30
@test conj (rv) === rv
31
31
@test conj (tz) == [1 - im 2 3 ]
59
59
rv = v.'
60
60
61
61
@test (rv* d):: RowVector == [2 ,6 ,12 ].'
62
- @test_throws Exception d* rv
62
+ @test_throws DimensionMismatch d* rv
63
63
64
64
@test (d* rv.' ):: Vector == [2 ,6 ,12 ]
65
65
66
- @test_throws Exception rv.' * d
66
+ @test_throws DimensionMismatch rv.' * d
67
67
68
68
@test (d* rv' ):: Vector == [2 ,6 ,12 ]
69
69
70
- @test_throws Exception rv' * d
70
+ @test_throws DimensionMismatch rv' * d
71
71
72
72
@test (rv/ d):: RowVector ≈ [2 / 1 3 / 2 4 / 3 ]
73
73
74
- @test_throws Exception d \ rv
74
+ @test_throws DimensionMismatch d \ rv
75
75
end
76
76
77
77
@testset " Bidiagonal ambiguity methods" begin
81
81
82
82
@test (rv/ bd):: RowVector ≈ [2 / 1 3 / 2 4 / 3 ]
83
83
84
- @test_throws Exception bd \ rv
84
+ @test_throws DimensionMismatch bd \ rv
85
85
end
86
86
87
87
@testset " hcat" begin
94
94
v = [2 ,3 ,4 ]
95
95
rv = v.'
96
96
97
- @test_throws Exception mat \ rv
97
+ @test_throws DimensionMismatch mat \ rv
98
98
end
99
99
100
100
@testset " Multiplication" begin
@@ -104,65 +104,65 @@ end
104
104
105
105
@test (rv* v) === 14
106
106
@test (rv* mat):: RowVector == [1 4 9 ]
107
- @test_throws Exception [1 ]* reshape ([1 ],(1 ,1 )) # no longer permitted
108
- @test_throws Exception rv* rv
107
+ @test_throws DimensionMismatch [1 ]* reshape ([1 ],(1 ,1 )) # no longer permitted
108
+ @test_throws DimensionMismatch rv* rv
109
109
@test (v* rv):: Matrix == [1 2 3 ; 2 4 6 ; 3 6 9 ]
110
- @test_throws Exception v* v # Was previously a missing method error, now an error message
111
- @test_throws Exception mat* rv
110
+ @test_throws DimensionMismatch v* v # Was previously a missing method error, now an error message
111
+ @test_throws DimensionMismatch mat* rv
112
112
113
- @test_throws Exception rv* v.'
113
+ @test_throws DimensionMismatch rv* v.'
114
114
@test (rv* mat.' ):: RowVector == [1 4 9 ]
115
- @test_throws Exception [1 ]* reshape ([1 ],(1 ,1 )).' # no longer permitted
115
+ @test_throws DimensionMismatch [1 ]* reshape ([1 ],(1 ,1 )).' # no longer permitted
116
116
@test rv* rv.' === 14
117
- @test_throws Exception v* rv.'
117
+ @test_throws DimensionMismatch v* rv.'
118
118
@test (v* v.' ):: Matrix == [1 2 3 ; 2 4 6 ; 3 6 9 ]
119
119
@test (mat* rv.' ):: Vector == [1 ,4 ,9 ]
120
120
121
121
@test (rv.' * v.' ):: Matrix == [1 2 3 ; 2 4 6 ; 3 6 9 ]
122
- @test_throws Exception rv.' * mat.'
122
+ @test_throws DimensionMismatch rv.' * mat.'
123
123
@test (v.' * mat.' ):: RowVector == [1 4 9 ]
124
- @test_throws Exception rv.' * rv.'
124
+ @test_throws DimensionMismatch rv.' * rv.'
125
125
@test v.' * rv.' === 14
126
- @test_throws Exception v.' * v.'
126
+ @test_throws DimensionMismatch v.' * v.'
127
127
@test (mat.' * rv.' ):: Vector == [1 ,4 ,9 ]
128
128
129
- @test_throws Exception rv.' * v
130
- @test_throws Exception rv.' * mat
129
+ @test_throws DimensionMismatch rv.' * v
130
+ @test_throws DimensionMismatch rv.' * mat
131
131
@test (v.' * mat):: RowVector == [1 4 9 ]
132
132
@test (rv.' * rv):: Matrix == [1 2 3 ; 2 4 6 ; 3 6 9 ]
133
- @test_throws Exception v.' * rv
133
+ @test_throws DimensionMismatch v.' * rv
134
134
@test v.' * v === 14
135
- @test_throws Exception mat.' * rv
135
+ @test_throws DimensionMismatch mat.' * rv
136
136
137
137
z = [1 + im,2 ,3 ]
138
138
cz = z'
139
139
mat = diagm ([1 + im,2 ,3 ])
140
140
141
141
@test cz* z === 15 + 0im
142
142
143
- @test_throws Exception cz* z'
143
+ @test_throws DimensionMismatch cz* z'
144
144
@test (cz* mat' ):: RowVector == [- 2im 4 9 ]
145
- @test_throws Exception [1 ]* reshape ([1 ],(1 ,1 ))' # no longer permitted
145
+ @test_throws DimensionMismatch [1 ]* reshape ([1 ],(1 ,1 ))' # no longer permitted
146
146
@test cz* cz' === 15 + 0im
147
- @test_throws Exception z* vz '
147
+ @test_throws DimensionMismatch z* cz '
148
148
@test (z* z' ):: Matrix == [2 2 + 2im 3 + 3im ; 2 - 2im 4 6 ; 3 - 3im 6 9 ]
149
149
@test (mat* cz' ):: Vector == [2im ,4 ,9 ]
150
150
151
151
@test (cz' * z' ):: Matrix == [2 2 + 2im 3 + 3im ; 2 - 2im 4 6 ; 3 - 3im 6 9 ]
152
- @test_throws Exception cz' * mat'
152
+ @test_throws DimensionMismatch cz' * mat'
153
153
@test (z' * mat' ):: RowVector == [- 2im 4 9 ]
154
- @test_throws Exception cz' * cz'
154
+ @test_throws DimensionMismatch cz' * cz'
155
155
@test z' * cz' === 15 + 0im
156
- @test_throws Exception z' * z'
156
+ @test_throws DimensionMismatch z' * z'
157
157
@test (mat' * cz' ):: Vector == [2 ,4 ,9 ]
158
158
159
- @test_throws Exception cz' * z
160
- @test_throws Exception cz' * mat
159
+ @test_throws DimensionMismatch cz' * z
160
+ @test_throws DimensionMismatch cz' * mat
161
161
@test (z' * mat):: RowVector == [2 4 9 ]
162
162
@test (cz' * cz):: Matrix == [2 2 + 2im 3 + 3im ; 2 - 2im 4 6 ; 3 - 3im 6 9 ]
163
- @test_throws Exception z' * cz
163
+ @test_throws DimensionMismatch z' * cz
164
164
@test z' * z === 15 + 0im
165
- @test_throws Exception mat' * cz
165
+ @test_throws DimensionMismatch mat' * cz
166
166
end
167
167
168
168
@testset " norm" begin
202
202
203
203
@test (rv/ mat):: RowVector ≈ [2 / 1 3 / 2 4 / 3 ]
204
204
205
- @test_throws Exception mat\ rv
205
+ @test_throws DimensionMismatch mat\ rv
206
206
end
207
207
208
208
@testset " AbstractTriangular ambiguity methods" begin
@@ -211,31 +211,31 @@ end
211
211
rv = v.'
212
212
213
213
@test (rv* ut):: RowVector == [2 6 12 ]
214
- @test_throws Exception ut* rv
214
+ @test_throws DimensionMismatch ut* rv
215
215
216
216
@test (rv* ut.' ):: RowVector == [2 6 12 ]
217
217
@test (ut* rv.' ):: Vector == [2 ,6 ,12 ]
218
218
219
219
@test (ut.' * rv.' ):: Vector == [2 ,6 ,12 ]
220
- @test_throws Exception rv.' * ut.'
220
+ @test_throws DimensionMismatch rv.' * ut.'
221
221
222
- @test_throws Exception ut.' * rv
223
- @test_throws Exception rv.' * ut
222
+ @test_throws DimensionMismatch ut.' * rv
223
+ @test_throws DimensionMismatch rv.' * ut
224
224
225
225
@test (rv* ut' ):: RowVector == [2 6 12 ]
226
226
@test (ut* rv' ):: Vector == [2 ,6 ,12 ]
227
227
228
- @test_throws Exception rv' * ut'
228
+ @test_throws DimensionMismatch rv' * ut'
229
229
@test (ut' * rv' ):: Vector == [2 ,6 ,12 ]
230
230
231
- @test_throws Exception ut' * rv
232
- @test_throws Exception rv' * ut
231
+ @test_throws DimensionMismatch ut' * rv
232
+ @test_throws DimensionMismatch rv' * ut
233
233
234
234
@test (rv/ ut):: RowVector ≈ [2 / 1 3 / 2 4 / 3 ]
235
235
@test (rv/ ut.' ):: RowVector ≈ [2 / 1 3 / 2 4 / 3 ]
236
236
@test (rv/ ut' ):: RowVector ≈ [2 / 1 3 / 2 4 / 3 ]
237
237
238
- @test_throws Exception ut\ rv
238
+ @test_throws DimensionMismatch ut\ rv
239
239
end
240
240
241
241
0 commit comments