File tree 2 files changed +7
-4
lines changed
2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -1146,6 +1146,9 @@ function (/)(A::AbstractVecOrMat, B::AbstractVecOrMat)
1146
1146
size (A,2 ) != size (B,2 ) && throw (DimensionMismatch (" Both inputs should have the same number of columns" ))
1147
1147
return copy (adjoint (adjoint (B) \ adjoint (A)))
1148
1148
end
1149
+ # \(A::StridedMatrix,x::Number) = inv(A)*x Should be added at some point when the old elementwise version has been deprecated long enough
1150
+ # /(x::Number,A::StridedMatrix) = x*inv(A)
1151
+ / (x:: Number , v:: AbstractVector ) = x* pinv (v)
1149
1152
1150
1153
cond (x:: Number ) = iszero (x) ? Inf : 1.0
1151
1154
cond (x:: Number , p) = cond (x)
Original file line number Diff line number Diff line change @@ -1129,12 +1129,12 @@ end
1129
1129
end
1130
1130
1131
1131
function test_rdiv_pinv_consistency (a, b)
1132
- @test a* (b/ b) ≈ (a* b)* pinv (b) ≈ a* (b* pinv (b))
1133
- @test typeof (a* (b/ b)) == typeof ((a* b)* pinv (b)) == typeof (a* (b* pinv (b)))
1132
+ @test (a * b) / b ≈ a* (b/ b) ≈ (a* b)* pinv (b) ≈ a* (b* pinv (b))
1133
+ @test typeof ((a * b) / b) == typeof ( a* (b/ b)) == typeof ((a* b)* pinv (b)) == typeof (a* (b* pinv (b)))
1134
1134
end
1135
1135
function test_ldiv_pinv_consistency (a, b)
1136
- @test (a\ a)* b ≈ (pinv (a)* a)* b ≈ pinv (a)* (a* b)
1137
- @test typeof ((a\ a)* b) == typeof ((pinv (a)* a)* b) == typeof (pinv (a)* (a* b))
1136
+ @test a \ (a * b) ≈ (a\ a)* b ≈ (pinv (a)* a)* b ≈ pinv (a)* (a* b)
1137
+ @test typeof (a \ (a * b)) == typeof ( (a\ a)* b) == typeof ((pinv (a)* a)* b) == typeof (pinv (a)* (a* b))
1138
1138
end
1139
1139
function test_div_pinv_consistency (a, b)
1140
1140
test_rdiv_pinv_consistency (a, b)
You can’t perform that action at this time.
0 commit comments