Changeset 5c28402 in tol
- Timestamp:
- Nov 9, 2009, 10:20:45 AM (17 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 71426bc
- Parents:
- 3affc27
- File:
-
- 1 edited
-
tol_pkg/GraphTools/_GraphTools.tol (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tol_pkg/GraphTools/_GraphTools.tol
r3affc27 r5c28402 220 220 VMatrix _.edge.map = Rand(0,0,0,0); 221 221 VMatrix _.edge.adjacency = Rand(0,0,0,0); 222 VMatrix _.edge.rep = Rand(0,0,0,0); 222 223 Real _.edge.check.rep = ?; 223 224 … … 263 264 Matrix in = If(_.directed, in_, Max(in_, out_)); 264 265 Matrix _.edge::_.data := out | in | SubCol(data,Range(3,Columns(data),1)); 266 265 267 Matrix idx = DifEq(1/(1-B),Rand(_.edge.num,1,1,1)); 266 VMatrix triplet = Triplet(out|in|idx,_.vertex.num,_.vertex.num);267 VMatrix _.edge.map := Convert(triplet,"Cholmod.R.Sparse");268 268 Matrix idx.rep = Rand(_.edge.num,1,1,1); 269 VMatrix triplet.rep = Triplet(out|in|idx.rep,_.vertex.num,_.vertex.num); 270 VMatrix _.edge.adjacency := Convert(triplet.rep,"Cholmod.R.Sparse"); 271 Real _.edge.check.rep := VMatMax(_.edge.adjacency)>1; 272 If(_.edge.check.rep, 269 Matrix outInRep = out|in|idx.rep; 270 VMatrix triplet.rep = Triplet(outInRep,_.vertex.num,_.vertex.num); 271 VMatrix _.edge.rep := Convert(triplet.rep,"Cholmod.R.Sparse"); 272 Real _.edge.check.rep := VMatMax(_.edge.rep)>1; 273 VMatrix triplet.map = If(!_.edge.check.rep, 274 { 275 VMatrix _.edge.adjacency := _.edge.rep; 276 Triplet(out|in|idx,_.vertex.num,_.vertex.num) 277 }, 273 278 { 274 279 WriteLn("[GraphTools::@Graph "+_.name+"::edge.build()] "+ 275 "There are repeated edges","W") 280 "There are repeated edges","W"); 281 VMatrix triplet.adj = TripletUnique(outInRep,_.vertex.num,_.vertex.num); 282 VMatrix _.edge.adjacency := Convert(triplet.adj,"Cholmod.R.Sparse"); 283 TripletUnique(out|in|idx,_.vertex.num,_.vertex.num) 276 284 }); 285 VMatrix _.edge.map := Convert(triplet.map,"Cholmod.R.Sparse"); 277 286 True 278 287 }; … … 335 344 Real in = If(_.directed, in_, Max(in_, out_)); 336 345 Real edge.idx = VMatDat(_.edge.map, out, in); 337 edge.idx / VMatDat(_.edge.adjacency, out, in)346 edge.idx 338 347 }; 339 348
Note: See TracChangeset
for help on using the changeset viewer.
