TSVD.jl icon indicating copy to clipboard operation
TSVD.jl copied to clipboard

should raise error if nvals > ndim

Open qiyang-ustc opened this issue 3 months ago • 2 comments

julia> U2,S2,V2=tsvd(A)
([-0.6544776144364567; -0.2676920846823157; -0.26769208468231576; -0.6544776144364568;;], [2.853906087544359], [-0.6544776144364567; -0.2676920846823159; -0.2676920846823158; -0.6544776144364568;;])

julia> S2
1-element Vector{Float64}:
 2.853906087544359

julia> U2,S2,V2=tsvd(A,Dcut)
([0.654477614436457 0.6544776144364569 … -0.49252301879505456 -0.19490429776098736; 0.2676920846823159 0.2676920846823158 … 0.0845812528300824 0.9612271076541434; 0.267692084682316 0.26769208468231587 … 0.013783293964742562 -0.008187951147854398; 0.6544776144364569 0.6544776144364569 … 0.8660699539450618 -0.19490438329188542], [2.8539060875443587, 2.8539060875443587, 2.8539060875443587, 2.8539060875443587, 2.0358732663215466, 2.035873266321546, 2.035873266321546, 2.0358732663215457, 7.108766756901759e-17, 3.2358193537960736e-17, 1.4179287268498347e-28, 3.2170949177493824e-32, 5.810616027417892e-33, 1.6873455521628154e-47, 4.0399669801870604e-53, 6.421440610886164e-63], [0.6544776144364571 0.6544776144364569 … -0.2491734053545246 0.0978243652967914; 0.2676920846823158 0.26769208468231587 … 0.350771410883203 -0.8973344438061487; 0.26769208468231587 0.2676920846823158 … 0.8676315621246694 0.41899488211487207; 0.6544776144364568 0.6544776144364568 … -0.24917340535492025 0.097824365300088])

julia> S2
16-element Vector{Float64}:
 2.8539060875443587
 2.8539060875443587
 2.8539060875443587
 2.8539060875443587
 2.0358732663215466
 2.035873266321546
 2.035873266321546
 2.0358732663215457
 7.108766756901759e-17
 3.2358193537960736e-17
 1.4179287268498347e-28
 3.2170949177493824e-32
 5.810616027417892e-33
 1.6873455521628154e-47
 4.0399669801870604e-53
 6.421440610886164e-63

qiyang-ustc avatar Nov 26 '24 09:11 qiyang-ustc