@@ -655,17 +655,17 @@ public ScatteredLabelledArcsASCIIGraph(final Iterator<long[]> arcs, final Long2I
655
655
656
656
int j ;
657
657
int [] source = new int [batchSize ], target = new int [batchSize ];
658
- long [] labelStart = new long [batchSize ];
658
+ long [] start = new long [batchSize ];
659
659
FastByteArrayOutputStream fbos = new FastByteArrayOutputStream ();
660
660
OutputBitStream obs = new OutputBitStream (fbos );
661
- Label prototype = null ;
662
661
final ObjectArrayList <File > batches = new ObjectArrayList <>(), labelBatches = new ObjectArrayList <>();
663
662
664
663
if (pl != null ) {
665
664
pl .itemsName = "labelled arcs" ;
666
665
pl .start ("Creating sorted batches..." );
667
666
}
668
667
668
+ Label l = null ;
669
669
j = 0 ;
670
670
long pairs = 0 ; // Number of pairs
671
671
while (arcs .hasNext ()) {
@@ -681,19 +681,18 @@ public ScatteredLabelledArcsASCIIGraph(final Iterator<long[]> arcs, final Long2I
681
681
throw new IllegalArgumentException ("Not enough labels" );
682
682
}
683
683
684
- Label l = arcLabels .next ();
685
- prototype = prototype == null ? l : prototype ;
684
+ l = arcLabels .next ();
686
685
687
686
if (s != t || !noLoops ) {
688
687
source [j ] = s ;
689
688
target [j ] = t ;
690
- labelStart [j ] = obs .writtenBits ();
689
+ start [j ] = obs .writtenBits ();
691
690
l .toBitStream (obs , s );
692
691
j ++;
693
692
694
693
if (j == batchSize ) {
695
694
obs .flush ();
696
- pairs += processTransposeBatch (batchSize , source , target , labelStart , new InputBitStream (fbos .array ), tempDir , batches , labelBatches , prototype , labelMergeStrategy );
695
+ pairs += processTransposeBatch (batchSize , source , target , start , new InputBitStream (fbos .array ), tempDir , batches , labelBatches , l , labelMergeStrategy );
697
696
fbos = new FastByteArrayOutputStream ();
698
697
obs = new OutputBitStream (fbos );
699
698
j = 0 ;
@@ -702,13 +701,13 @@ public ScatteredLabelledArcsASCIIGraph(final Iterator<long[]> arcs, final Long2I
702
701
if (symmetrize && s != t ) {
703
702
source [j ] = t ;
704
703
target [j ] = s ;
705
- labelStart [j ] = obs .writtenBits ();
704
+ start [j ] = obs .writtenBits ();
706
705
l .toBitStream (obs , t );
707
706
j ++;
708
707
709
708
if (j == batchSize ) {
710
709
obs .flush ();
711
- pairs += processTransposeBatch (batchSize , source , target , labelStart , new InputBitStream (fbos .array ), tempDir , batches , labelBatches , prototype , labelMergeStrategy );
710
+ pairs += processTransposeBatch (batchSize , source , target , start , new InputBitStream (fbos .array ), tempDir , batches , labelBatches , l , labelMergeStrategy );
712
711
fbos = new FastByteArrayOutputStream ();
713
712
obs = new OutputBitStream (fbos );
714
713
j = 0 ;
@@ -725,7 +724,7 @@ public ScatteredLabelledArcsASCIIGraph(final Iterator<long[]> arcs, final Long2I
725
724
726
725
if (j != 0 ) {
727
726
obs .flush ();
728
- pairs += processTransposeBatch (j , source , target , labelStart , new InputBitStream (fbos .array ), tempDir , batches , labelBatches , prototype , labelMergeStrategy );
727
+ pairs += processTransposeBatch (j , source , target , start , new InputBitStream (fbos .array ), tempDir , batches , labelBatches , l , labelMergeStrategy );
729
728
}
730
729
731
730
if (pl != null ) {
@@ -736,13 +735,13 @@ public ScatteredLabelledArcsASCIIGraph(final Iterator<long[]> arcs, final Long2I
736
735
numNodes = function == null ? (int )map .size () : function .size ();
737
736
source = null ;
738
737
target = null ;
739
- labelStart = null ;
738
+ start = null ;
740
739
741
740
if (function == null ) {
742
741
ids = map .getIds (tempDir );
743
742
}
744
743
745
- this .arcLabelledBatchGraph = new Transform .ArcLabelledBatchGraph (function == null ? numNodes : n , pairs , batches , labelBatches , prototype , labelMergeStrategy );
744
+ this .arcLabelledBatchGraph = new Transform .ArcLabelledBatchGraph (function == null ? numNodes : n , pairs , batches , labelBatches , l , labelMergeStrategy );
746
745
}
747
746
748
747
protected static void logBatches (final ObjectArrayList <File > batches , final long pairs , final ProgressLogger pl ) {
0 commit comments