Re: How to switfh off combine functrion in sparse?

117 views
Skip to first unread message
Message has been deleted

Kristoffer Carlsson

unread,
Aug 12, 2016, 12:28:26 PM8/12/16
to julia-users
try sparse(I,J,V,m,n,(a,b) ->a)

On Friday, August 12, 2016 at 5:06:29 PM UTC+2, program...@gmail.com wrote:
How to switfh off combine functrion  in sparse? I need to ingore new value if in data is duplicat row/col. Somthing like this : sparse(I,J,V,m,n,+=0) but this dont work.

Paul

program...@gmail.com

unread,
Aug 12, 2016, 3:23:09 PM8/12/16
to julia-users
ThX, Paul
Message has been deleted

program...@gmail.com

unread,
Nov 25, 2016, 4:04:53 AM11/25/16
to julia-users
Why "/" not work ?

julia> I
4-element Array{Int64,1}:
1
1
2
3
julia> J
4-element Array{Int64,1}:
1
1
2
3
julia> V
4-element Array{Int64,1}:
2
5
1
1

julia> sparse(I,J,V,3,3,*)
3x3 sparse matrix with 3 Int64 entries:
[1, 1] = 10
[2, 2] = 1
[3, 3] = 1

julia> sparse(I,J,V,3,3,+)
3x3 sparse matrix with 3 Int64 entries:
[1, 1] = 7
[2, 2] = 1
[3, 3] = 1

julia> sparse(I,J,V,3,3,/)
ERROR: InexactError()
in convert at int.jl:209

julia> sparse(I,J,V,3,3,div)
3x3 sparse matrix with 3 Int64 entries:
[1, 1] = 0
[2, 2] = 1
[3, 3] = 1

Reply all
Reply to author
Forward
0 new messages