Blame view

fvn_sparse/UMFPACK/Source/umf_assemble.c 33.1 KB
422234dc3   daniau   git-svn-id: https...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
  /* ========================================================================== */
  /* === UMF_assemble ========================================================= */
  /* ========================================================================== */
  
  /* -------------------------------------------------------------------------- */
  /* UMFPACK Copyright (c) Timothy A. Davis, CISE,                              */
  /* Univ. of Florida.  All Rights Reserved.  See ../Doc/License for License.   */
  /* web: http://www.cise.ufl.edu/research/sparse/umfpack                       */
  /* -------------------------------------------------------------------------- */
  
  /*  Degree update and numerical assembly.  This is compiled twice (with and
   *  without FIXQ) for each real/complex int/UF_long version, for a total of 8
   *  versions.*/
  
  #include "umf_internal.h"
  #include "umf_mem_free_tail_block.h"
  
  /* ========================================================================== */
  /* === row_assemble ========================================================= */
  /* ========================================================================== */
  
  PRIVATE void row_assemble
  (
      Int row,
      NumericType *Numeric,
      WorkType *Work
  )
  {
  
      Entry *S, *Fcblock, *Frow ;
      Int tpi, e, *E, *Fcpos, *Frpos, *Row_degree, *Row_tuples, *Row_tlen, rdeg0,
  	f, nrows, ncols, *Rows, *Cols, col, ncolsleft, j ;
      Tuple *tp, *tp1, *tp2, *tpend ;
      Unit *Memory, *p ;
      Element *ep ;
  
  #ifndef FIXQ
      Int *Col_degree ;
      Col_degree = Numeric->Cperm ;
  #endif
  
      Row_tuples = Numeric->Uip ;
      tpi = Row_tuples [row] ;
      if (!tpi) return ;
  
      Memory = Numeric->Memory ;
      E = Work->E ;
      Fcpos = Work->Fcpos ;
      Frpos = Work->Frpos ;
      Row_degree = Numeric->Rperm ;
      Row_tlen   = Numeric->Uilen ;
      E = Work->E ;
      Memory = Numeric->Memory ;
      rdeg0 = Work->rdeg0 ;
      Fcblock = Work->Fcblock ;
  
  #ifndef NDEBUG
      DEBUG6 (("SCAN2-row: "ID"
  ", row)) ;
      UMF_dump_rowcol (0, Numeric, Work, row, FALSE) ;
  #endif
  
      ASSERT (NON_PIVOTAL_ROW (row)) ;
  
      tp = (Tuple *) (Memory + tpi) ;
      tp1 = tp ;
      tp2 = tp ;
      tpend = tp + Row_tlen [row] ;
      for ( ; tp < tpend ; tp++)
      {
  	e = tp->e ;
  	ASSERT (e > 0 && e <= Work->nel) ;
  	if (!E [e]) continue ;	/* element already deallocated */
  	f = tp->f ;
  	p = Memory + E [e] ;
  	ep = (Element *) p ;
  	p += UNITS (Element, 1) ;
  	Cols = (Int *) p ;
  	Rows = Cols + ep->ncols ;
  	if (Rows [f] == EMPTY) continue ;   /* row already assembled */
  	ASSERT (row == Rows [f] && row >= 0 && row < Work->n_row) ;
  
  	if (ep->rdeg == rdeg0)
  	{
  	    /* ------------------------------------------------------ */
  	    /* this is an old Lson - assemble just one row */
  	    /* ------------------------------------------------------ */
  
  	    /* flag the row as assembled from the Lson */
  	    Rows [f] = EMPTY ;
  
  	    nrows = ep->nrows ;
  	    ncols = ep->ncols ;
  
  	    p += UNITS (Int, ncols + nrows) ;
  	    S = ((Entry *) p) + f ;
  
  	    DEBUG6 (("Old LSON: "ID"
  ", e)) ;
  #ifndef NDEBUG
  	    UMF_dump_element (Numeric, Work, e, FALSE) ;
  #endif
  
  	    ncolsleft = ep->ncolsleft ;
  
  	    Frow = Fcblock + Frpos [row] ;
  	    DEBUG6 (("LSON found (in scan2-row): "ID"
  ", e)) ;
  
  	    Row_degree [row] -= ncolsleft ;
  
  	    if (ncols == ncolsleft)
  	    {
  		/* -------------------------------------------------- */
  		/* no columns assembled out this Lson yet */
  		/* -------------------------------------------------- */
  
  #pragma ivdep
  		for (j = 0 ; j < ncols ; j++)
  		{
  		    col = Cols [j] ;
  		    ASSERT (col >= 0 && col < Work->n_col) ;
  #ifndef FIXQ
  		    Col_degree [col] -- ;
  #endif
  		    /* Frow [Fcpos [col]] += *S ; */
  		    ASSEMBLE (Frow [Fcpos [col]], *S) ;
  		    S += nrows ;
  		}
  
  	    }
  	    else
  	    {
  		/* -------------------------------------------------- */
  		/* some columns have been assembled out of this Lson */
  		/* -------------------------------------------------- */
  
  #pragma ivdep
  		for (j = 0 ; j < ncols ; j++)
  		{
  		    col = Cols [j] ;
  		    if (col >= 0)
  		    {
  			ASSERT (col < Work->n_col) ;
  #ifndef FIXQ
  			Col_degree [col] -- ;
  #endif
  			/* Frow [Fcpos [col]] += *S ; */
  			ASSEMBLE (Frow [Fcpos [col]], *S) ;
  		    }
  		    S += nrows ;
  		}
  
  	    }
  	    ep->nrowsleft-- ;
  	    ASSERT (ep->nrowsleft > 0) ;
  	}
  	else
  	{
  	    *tp2++ = *tp ;	/* leave the tuple in the list */
  	}
      }
      Row_tlen [row] = tp2 - tp1 ;
  
  #ifndef NDEBUG
      DEBUG7 (("row assembled in scan2-row: "ID"
  ", row)) ;
      UMF_dump_rowcol (0, Numeric, Work, row, FALSE) ;
      DEBUG7 (("Current frontal matrix: (scan 1b)
  ")) ;
      UMF_dump_current_front (Numeric, Work, TRUE) ;
  #endif
  }
  
  /* ========================================================================== */
  /* === col_assemble ========================================================= */
  /* ========================================================================== */
  
  PRIVATE void col_assemble
  (
      Int col,
      NumericType *Numeric,
      WorkType *Work
  )
  {
  
      Entry *S, *Fcblock, *Fcol ;
      Int tpi, e, *E, *Fcpos, *Frpos, *Row_degree, *Col_tuples, *Col_tlen, cdeg0,
  	f, nrows, ncols, *Rows, *Cols, row, nrowsleft, i ;
      Tuple *tp, *tp1, *tp2, *tpend ;
      Unit *Memory, *p ;
      Element *ep ;
  
  #if !defined (FIXQ) || !defined (NDEBUG)
      Int *Col_degree ;
      Col_degree = Numeric->Cperm ;
  #endif
  
      Col_tuples = Numeric->Lip ;
      tpi = Col_tuples [col] ;
      if (!tpi) return ;
  
      Memory = Numeric->Memory ;
      E = Work->E ;
      Fcpos = Work->Fcpos ;
      Frpos = Work->Frpos ;
      Row_degree = Numeric->Rperm ;
      Col_tlen   = Numeric->Lilen ;
      E = Work->E ;
      Memory = Numeric->Memory ;
      cdeg0 = Work->cdeg0 ;
      Fcblock = Work->Fcblock ;
  
      DEBUG6 (("SCAN2-col: "ID"
  ", col)) ;
  #ifndef NDEBUG
      UMF_dump_rowcol (1, Numeric, Work, col, FALSE) ;
  #endif
  
      ASSERT (NON_PIVOTAL_COL (col)) ;
      tp = (Tuple *) (Memory + tpi) ;
      tp1 = tp ;
      tp2 = tp ;
      tpend = tp + Col_tlen [col] ;
      for ( ; tp < tpend ; tp++)
      {
  	e = tp->e ;
  	ASSERT (e > 0 && e <= Work->nel) ;
  	if (!E [e]) continue ;	/* element already deallocated */
  	f = tp->f ;
  	p = Memory + E [e] ;
  	ep = (Element *) p ;
  	p += UNITS (Element, 1) ;
  	Cols = (Int *) p ;
  
  	if (Cols [f] == EMPTY) continue ;   /* col already assembled */
  	ASSERT (col == Cols [f] && col >= 0 && col < Work->n_col) ;
  
  	if (ep->cdeg == cdeg0)
  	{
  	    /* ------------------------------------------------------ */
  	    /* this is an old Uson - assemble just one col */
  	    /* ------------------------------------------------------ */
  
  	    /* flag the col as assembled from the Uson */
  	    Cols [f] = EMPTY ;
  
  	    nrows = ep->nrows ;
  	    ncols = ep->ncols ;
  	    Rows = Cols + ncols ;
  	    p += UNITS (Int, ncols + nrows) ;
  	    S = ((Entry *) p) + f * nrows ;
  
  	    DEBUG6 (("Old USON: "ID"
  ", e)) ;
  #ifndef NDEBUG
  	    UMF_dump_element (Numeric, Work, e, FALSE) ;
  #endif
  
  	    nrowsleft = ep->nrowsleft ;
  
  	    Fcol = Fcblock + Fcpos [col] ;
  	    DEBUG6 (("USON found (in scan2-col): "ID"
  ", e)) ;
  #ifndef FIXQ
  	    Col_degree [col] -= nrowsleft ;
  #endif
  	    if (nrows == nrowsleft)
  	    {
  		/* -------------------------------------------------- */
  		/* no rows assembled out of this Uson yet */
  		/* -------------------------------------------------- */
  
  #pragma ivdep
  		for (i = 0 ; i < nrows ; i++)
  		{
  		    row = Rows [i] ;
  		    ASSERT (row >= 0 && row < Work->n_row) ;
  		    Row_degree [row]-- ;
  		    /* Fcol [Frpos [row]] += S [i] ; */
  		    ASSEMBLE (Fcol [Frpos [row]], S [i]) ;
  		}
  	    }
  	    else
  	    {
  		/* -------------------------------------------------- */
  		/* some rows have been assembled out of this Uson */
  		/* -------------------------------------------------- */
  
  #pragma ivdep
  		for (i = 0 ; i < nrows ; i++)
  		{
  		    row = Rows [i] ;
  		    if (row >= 0)
  		    {
  			ASSERT (row < Work->n_row) ;
  			Row_degree [row]-- ;
  			/* Fcol [Frpos [row]] += S [i] ; */
  			ASSEMBLE (Fcol [Frpos [row]], S [i]) ;
  		    }
  		}
  	    }
  	    ep->ncolsleft-- ;
  	    ASSERT (ep->ncolsleft > 0) ;
  	}
  	else
  	{
  	    *tp2++ = *tp ;	/* leave the tuple in the list */
  	}
      }
      Col_tlen [col] = tp2 - tp1 ;
  
  #ifndef NDEBUG
      DEBUG7 (("Column assembled in scan2-col: "ID"
  ", col)) ;
      UMF_dump_rowcol (1, Numeric, Work, col, FALSE) ;
      DEBUG7 (("Current frontal matrix: after scan2-col
  ")) ;
      UMF_dump_current_front (Numeric, Work, TRUE) ;
  #endif
  
  }
  
  
  /* ========================================================================== */
  /* === UMF_assemble / UMF_assemble_fixq ===================================== */
  /* ========================================================================== */
  
  #ifndef FIXQ
  GLOBAL void UMF_assemble
  #else
  GLOBAL void UMF_assemble_fixq
  #endif
  (
      NumericType *Numeric,
      WorkType *Work
  )
  {
      /* ---------------------------------------------------------------------- */
      /* local variables */
      /* ---------------------------------------------------------------------- */
  
      Int e, i, row, col, i2, nrows, ncols, f, tpi, extcdeg, extrdeg, rdeg0,
  	cdeg0, son_list, next, nrows_to_assemble,
  	ncols_to_assemble, ngetrows, j, j2,
  	nrowsleft,	/* number of rows remaining in S */
  	ncolsleft,	/* number of columns remaining in S */
  	prior_Lson, prior_Uson, *E, *Cols, *Rows, *Wm, *Woo,
  	*Row_tuples, *Row_degree, *Row_tlen,
  	*Col_tuples, *Col_tlen ;
      Unit *Memory, *p ;
      Element *ep ;
      Tuple *tp, *tp1, *tp2, *tpend ;
      Entry
  	*S,		/* a pointer into the contribution block of a son */
  	*Fcblock,	/* current contribution block */
  	*Fcol ;		/* a column of FC */
      Int *Frpos,
  	*Fcpos,
  	fnrows,		/* number of rows in contribution block in F */
  	fncols ;	/* number of columns in contribution block in F */
  
  #if !defined (FIXQ) || !defined (NDEBUG)
      Int *Col_degree ;
  #endif
  
  #ifndef NDEBUG
      Int n_row, n_col ;
      n_row = Work->n_row ;
      n_col = Work->n_col ;
      DEBUG3 (("::Assemble SCANS 1-4
  ")) ;
      UMF_dump_current_front (Numeric, Work, TRUE) ;
  #endif
  
  #if !defined (FIXQ) || !defined (NDEBUG)
      Col_degree = Numeric->Cperm ;   /* not updated if FIXQ is true */
  #endif
  
      /* ---------------------------------------------------------------------- */
      /* get parameters */
      /* ---------------------------------------------------------------------- */
  
      fncols = Work->fncols ;
      fnrows = Work->fnrows ;
      Fcpos = Work->Fcpos ;
      Frpos = Work->Frpos ;
      Row_degree = Numeric->Rperm ;
      Row_tuples = Numeric->Uip ;
      Row_tlen   = Numeric->Uilen ;
      Col_tuples = Numeric->Lip ;
      Col_tlen   = Numeric->Lilen ;
      E = Work->E ;
      Memory = Numeric->Memory ;
      Wm = Work->Wm ;
      Woo = Work->Woo ;
      rdeg0 = Work->rdeg0 ;
      cdeg0 = Work->cdeg0 ;
  
  #ifndef NDEBUG
      DEBUG6 (("============================================
  ")) ;
      DEBUG6 (("Degree update, assembly.
  ")) ;
      DEBUG6 (("pivot row pattern:  fncols="ID"
  ", fncols)) ;
      for (j = 0 ; j < fncols ; j++)
      {
  	col = Work->Fcols [j] ;
  	DEBUG6 ((ID" ", col)) ;
  	ASSERT (Fcpos [col] == j * Work->fnr_curr) ;
  	ASSERT (NON_PIVOTAL_COL (col)) ;
      }
      ASSERT (Fcpos [Work->pivcol] >= 0) ;
      DEBUG6 (("pivcol: "ID" pos "ID" fnr_curr "ID" fncols "ID"
  ",
  	Work->pivcol, Fcpos [Work->pivcol], Work->fnr_curr, fncols)) ;
      ASSERT (Fcpos [Work->pivcol] <  fncols * Work->fnr_curr) ;
      DEBUG6 (("
  pivot col pattern:  fnrows="ID"
  ", fnrows)) ;
      for (i = 0 ; i < fnrows ; i++)
      {
  	row = Work->Frows [i] ;
  	DEBUG6 ((ID" ", row)) ;
  	ASSERT (Frpos [row] == i) ;
  	ASSERT (NON_PIVOTAL_ROW (row)) ;
      }
      DEBUG6 (("
  ")) ;
      ASSERT (Frpos [Work->pivrow] >= 0) ;
      ASSERT (Frpos [Work->pivrow] < fnrows) ;
      ASSERT (Work->Flublock == (Entry *) (Numeric->Memory + E [0])) ;
      ASSERT (Work->Fcblock == Work->Flublock + Work->nb *
  	(Work->nb + Work->fnr_curr + Work->fnc_curr)) ;
  #endif
  
      Fcblock = Work->Fcblock ;
  
      /* ---------------------------------------------------------------------- */
      /* determine the largest actual frontal matrix size (for Info only) */
      /* ---------------------------------------------------------------------- */
  
      ASSERT (fnrows == Work->fnrows_new + 1) ;
      ASSERT (fncols == Work->fncols_new + 1) ;
  
      Numeric->maxnrows = MAX (Numeric->maxnrows, fnrows) ;
      Numeric->maxncols = MAX (Numeric->maxncols, fncols) ;
  
      /* this is safe from integer overflow, since the current frontal matrix
       * is already allocated. */
      Numeric->maxfrsize = MAX (Numeric->maxfrsize, fnrows * fncols) ;
  
      /* ---------------------------------------------------------------------- */
      /* assemble from prior elements into the current frontal matrix */
      /* ---------------------------------------------------------------------- */
  
      DEBUG2 (("New assemble start [prior_element:"ID"
  ", Work->prior_element)) ;
  
      /* Currently no rows or columns are marked.  No elements are scanned, */
      /* that is, (ep->next == EMPTY) is true for all elements */
  
      son_list = 0 ;	/* start creating son_list [ */
  
      /* ---------------------------------------------------------------------- */
      /* determine if most recent element is Lson or Uson of current front */
      /* ---------------------------------------------------------------------- */
  
      if (!Work->do_extend)
      {
  	prior_Uson = ( Work->pivcol_in_front && !Work->pivrow_in_front) ;
  	prior_Lson = (!Work->pivcol_in_front &&  Work->pivrow_in_front) ;
  	if (prior_Uson || prior_Lson)
  	{
  	    e = Work->prior_element ;
  	    if (e != EMPTY)
  	    {
  		ASSERT (E [e]) ;
  		p = Memory + E [e] ;
  		ep = (Element *) p ;
  		ep->next = son_list ;
  		son_list = e ;
  #ifndef NDEBUG
  		DEBUG2 (("e "ID" is Prior son "ID" "ID"
  ",
  		    e, prior_Uson, prior_Lson)) ;
  		UMF_dump_element (Numeric, Work, e, FALSE) ;
  #endif
  		ASSERT (E [e]) ;
  	    }
  	}
      }
      Work->prior_element = EMPTY ;
  
      /* ---------------------------------------------------------------------- */
      /* SCAN1-row:  scan the element lists of each new row in the pivot col */
      /* and compute the external column degree for each frontal */
      /* ---------------------------------------------------------------------- */
  
      for (i2 = Work->fscan_row ; i2 < fnrows ; i2++)
      {
  	/* Get a row */
  	row = Work->NewRows [i2] ;
  	if (row < 0) row = FLIP (row) ;
  	ASSERT (row >= 0 && row < n_row) ;
  
  	DEBUG6 (("SCAN1-row: "ID"
  ", row)) ;
  #ifndef NDEBUG
  	UMF_dump_rowcol (0, Numeric, Work, row, FALSE) ;
  #endif
  
  	ASSERT (NON_PIVOTAL_ROW (row)) ;
  	tpi = Row_tuples [row] ;
  	if (!tpi) continue ;
  	tp = (Tuple *) (Memory + tpi) ;
  	tp1 = tp ;
  	tp2 = tp ;
  	tpend = tp + Row_tlen [row] ;
  	for ( ; tp < tpend ; tp++)
  	{
  	    e = tp->e ;
  	    ASSERT (e > 0 && e <= Work->nel) ;
  	    if (!E [e]) continue ;	/* element already deallocated */
  	    f = tp->f ;
  	    p = Memory + E [e] ;
  	    ep = (Element *) p ;
  	    p += UNITS (Element, 1) ;
  	    Rows = ((Int *) p) + ep->ncols ;
  	    if (Rows [f] == EMPTY) continue ;	/* row already assembled */
  	    ASSERT (row == Rows [f]) ;
  
  	    if (ep->cdeg < cdeg0)
  	    {
  		/* first time seen in scan1-row */
  		ep->cdeg = ep->nrowsleft + cdeg0 ;
  		DEBUG6 (("e "ID" First seen: cdeg: "ID" ", e, ep->cdeg-cdeg0)) ;
  		ASSERT (ep->ncolsleft > 0 && ep->nrowsleft > 0) ;
  	    }
  
  	    ep->cdeg-- ;	/* decrement external column degree */
  	    DEBUG6 (("e "ID" New ext col deg: "ID"
  ", e, ep->cdeg - cdeg0)) ;
  
  	    /* this element is not yet in the new son list */
  	    if (ep->cdeg == cdeg0 && ep->next == EMPTY)
  	    {
  		/* A new LUson or Uson has been found */
  		ep->next = son_list ;
  		son_list = e ;
  	    }
  
  	    ASSERT (ep->cdeg >= cdeg0) ;
  	    *tp2++ = *tp ;	/* leave the tuple in the list */
  	}
  	Row_tlen [row] = tp2 - tp1 ;
      }
  
      /* ---------------------------------------------------------------------- */
      /* SCAN1-col:  scan the element lists of each new col in the pivot row */
      /*	 and compute the external row degree for each frontal */
      /* ---------------------------------------------------------------------- */
  
      for (j2 = Work->fscan_col ; j2 < fncols ; j2++)
      {
  	/* Get a column */
  	col = Work->NewCols [j2] ;
  	if (col < 0) col = FLIP (col) ;
  	ASSERT (col >= 0 && col < n_col) ;
  
  	DEBUG6 (("SCAN 1-col: "ID"
  ", col)) ;
  #ifndef NDEBUG
  	UMF_dump_rowcol (1, Numeric, Work, col, FALSE) ;
  #endif
  
  	ASSERT (NON_PIVOTAL_COL (col)) ;
  	tpi = Col_tuples [col] ;
  	if (!tpi) continue ;
  	tp = (Tuple *) (Memory + tpi) ;
  	tp1 = tp ;
  	tp2 = tp ;
  	tpend = tp + Col_tlen [col] ;
  	for ( ; tp < tpend ; tp++)
  	{
  	    e = tp->e ;
  	    ASSERT (e > 0 && e <= Work->nel) ;
  	    if (!E [e]) continue ;	/* element already deallocated */
  	    f = tp->f ;
  	    p = Memory + E [e] ;
  	    ep = (Element *) p ;
  	    p += UNITS (Element, 1) ;
  	    Cols = (Int *) p ;
  	    if (Cols [f] == EMPTY) continue ;	/* column already assembled */
  	    ASSERT (col == Cols [f]) ;
  
  	    if (ep->rdeg < rdeg0)
  	    {
  		/* first time seen in scan1-col */
  		ep->rdeg = ep->ncolsleft + rdeg0 ;
  		DEBUG6 (("e "ID" First seen: rdeg: "ID" ", e, ep->rdeg-rdeg0)) ;
  		ASSERT (ep->ncolsleft > 0 && ep->nrowsleft > 0) ;
  	    }
  
  	    ep->rdeg-- ;	/* decrement external row degree */
  	    DEBUG6 (("e "ID" New ext row degree: "ID"
  ", e, ep->rdeg-rdeg0)) ;
  
  	    if (ep->rdeg == rdeg0 && ep->next == EMPTY)
  	    {
  		/* A new LUson or Lson has been found */
  		ep->next = son_list ;
  		son_list = e ;
  	    }
  
  	    ASSERT (ep->rdeg >= rdeg0) ;
  	    *tp2++ = *tp ;	/* leave the tuple in the list */
  	}
  	Col_tlen [col] = tp2 - tp1 ;
      }
  
      /* ---------------------------------------------------------------------- */
      /* assemble new sons via full scans */
      /* ---------------------------------------------------------------------- */
  
      next = EMPTY ;
  
      for (e = son_list ; e > 0 ; e = next)
      {
  	ASSERT (e > 0 && e <= Work->nel && E [e]) ;
  	p = Memory + E [e] ;
  	DEBUG2 (("New son: "ID"
  ", e)) ;
  #ifndef NDEBUG
  	UMF_dump_element (Numeric, Work, e, FALSE) ;
  #endif
  	GET_ELEMENT (ep, p, Cols, Rows, ncols, nrows, S) ;
  	nrowsleft = ep->nrowsleft ;
  	ncolsleft = ep->ncolsleft ;
  	next = ep->next ;
  	ep->next = EMPTY ;
  
  	extrdeg = (ep->rdeg < rdeg0) ? ncolsleft : (ep->rdeg - rdeg0) ;
  	extcdeg = (ep->cdeg < cdeg0) ? nrowsleft : (ep->cdeg - cdeg0) ;
  	ncols_to_assemble = ncolsleft - extrdeg ;
  	nrows_to_assemble = nrowsleft - extcdeg ;
  	DEBUG2 (("extrdeg "ID" extcdeg "ID"
  ", extrdeg, extcdeg)) ;
  
  	if (extrdeg == 0 && extcdeg == 0)
  	{
  
  	    /* -------------------------------------------------------------- */
  	    /* this is an LUson - assemble an entire contribution block */
  	    /* -------------------------------------------------------------- */
  
  	    DEBUG6 (("LUson found: "ID"
  ", e)) ;
  
  	    if (nrows == nrowsleft)
  	    {
  		/* ---------------------------------------------------------- */
  		/* no rows assembled out of this LUson yet */
  		/* ---------------------------------------------------------- */
  
  		/* compute the compressed column offset vector*/
  		/* [ use Wm [0..nrows-1] for offsets */
  #pragma ivdep
  		for (i = 0 ; i < nrows ; i++)
  		{
  		    row = Rows [i] ;
  		    Row_degree [row] -= ncolsleft ;
  		    Wm [i] = Frpos [row] ;
  		}
  
  		if (ncols == ncolsleft)
  		{
  		    /* ------------------------------------------------------ */
  		    /* no rows or cols assembled out of LUson yet */
  		    /* ------------------------------------------------------ */
  
  		    for (j = 0 ; j < ncols ; j++)
  		    {
  			col = Cols [j] ;
  #ifndef FIXQ
  			Col_degree [col] -= nrowsleft ;
  #endif
  			Fcol = Fcblock + Fcpos [col] ;
  #pragma ivdep
  			for (i = 0 ; i < nrows ; i++)
  			{
  			    /* Fcol [Wm [i]] += S [i] ; */
  			    ASSEMBLE (Fcol [Wm [i]], S [i]) ;
  			}
  			S += nrows ;
  		    }
  
  
  		}
  		else
  		{
  		    /* ------------------------------------------------------ */
  		    /* only cols have been assembled out of LUson */
  		    /* ------------------------------------------------------ */
  
  		    for (j = 0 ; j < ncols ; j++)
  		    {
  			col = Cols [j] ;
  			if (col >= 0)
  			{
  #ifndef FIXQ
  			    Col_degree [col] -= nrowsleft ;
  #endif
  			    Fcol = Fcblock + Fcpos [col] ;
  #pragma ivdep
  			    for (i = 0 ; i < nrows ; i++)
  			    {
  				/* Fcol [Wm [i]] += S [i] ; */
  				ASSEMBLE (Fcol [Wm [i]], S [i]) ;
  			    }
  			}
  			S += nrows ;
  		    }
  
  		}
  		/* ] done using Wm [0..nrows-1] for offsets */
  	    }
  	    else
  	    {
  		/* ---------------------------------------------------------- */
  		/* some rows have been assembled out of this LUson */
  		/* ---------------------------------------------------------- */
  
  		/* compute the compressed column offset vector*/
  		/* [ use Woo,Wm [0..nrowsleft-1] for offsets */
  		ngetrows = 0 ;
  		for (i = 0 ; i < nrows ; i++)
  		{
  		    row = Rows [i] ;
  		    if (row >= 0)
  		    {
  			Row_degree [row] -= ncolsleft ;
  			Woo [ngetrows] = i ;
  			Wm [ngetrows++] = Frpos [row] ;
  		    }
  		}
  		ASSERT (ngetrows == nrowsleft) ;
  
  		if (ncols == ncolsleft)
  		{
  		    /* ------------------------------------------------------ */
  		    /* only rows have been assembled out of this LUson */
  		    /* ------------------------------------------------------ */
  
  		    for (j = 0 ; j < ncols ; j++)
  		    {
  			col = Cols [j] ;
  #ifndef FIXQ
  			Col_degree [col] -= nrowsleft ;
  #endif
  			Fcol = Fcblock + Fcpos [col] ;
  #pragma ivdep
  			for (i = 0 ; i < nrowsleft ; i++)
  			{
  			    /* Fcol [Wm [i]] += S [Woo [i]] ; */
  			    ASSEMBLE (Fcol [Wm [i]], S [Woo [i]]) ;
  			}
  			S += nrows ;
  		    }
  
  		}
  		else
  		{
  		    /* ------------------------------------------------------ */
  		    /* both rows and columns have been assembled out of LUson */
  		    /* ------------------------------------------------------ */
  
  		    for (j = 0 ; j < ncols ; j++)
  		    {
  			col = Cols [j] ;
  			if (col >= 0)
  			{
  #ifndef FIXQ
  			    Col_degree [col] -= nrowsleft ;
  #endif
  			    Fcol = Fcblock + Fcpos [col] ;
  #pragma ivdep
  			    for (i = 0 ; i < nrowsleft ; i++)
  			    {
  				/* Fcol [Wm [i]] += S [Woo [i]] ; */
  				ASSEMBLE (Fcol [Wm [i]], S [Woo [i]]) ;
  			    }
  			}
  			S += nrows ;
  		    }
  
  		}
  		/* ] done using Woo,Wm [0..nrowsleft-1] */
  	    }
  
  	    /* deallocate the element: remove from ordered list */
  	    UMF_mem_free_tail_block (Numeric, E [e]) ;
  	    E [e] = 0 ;
  
  	}
  	else if (extcdeg == 0)
  	{
  
  	    /* -------------------------------------------------------------- */
  	    /* this is a Uson - assemble all possible columns */
  	    /* -------------------------------------------------------------- */
  
  	    DEBUG6 (("New USON: "ID"
  ", e)) ;
  	    ASSERT (extrdeg > 0) ;
  
  	    DEBUG6 (("New uson "ID" cols to do "ID"
  ", e, ncols_to_assemble)) ;
  
  	    if (ncols_to_assemble > 0)
  	    {
  
  		Int skip = FALSE ;
  		if (ncols_to_assemble * 16 < ncols && nrows == 1)
  		{
  		    /* this is a tall and thin frontal matrix consisting of
  		     * only one column (most likely an original column). Do
  		     * not assemble it.   It cannot be the pivot column, since
  		     * the pivot column element would be an LU son, not an Lson,
  		     * of the current frontal matrix. */
  		    ASSERT (nrowsleft == 1) ;
  		    ASSERT (Rows [0] >= 0 && Rows [0] < Work->n_row) ;
  		    skip = TRUE ;
  		    Work->any_skip = TRUE ;
  		}
  
  		if (!skip)
  		{
  
  		    if (nrows == nrowsleft)
  		    {
  			/* -------------------------------------------------- */
  			/* no rows have been assembled out of this Uson yet */
  			/* -------------------------------------------------- */
  
  			/* compute the compressed column offset vector */
  			/* [ use Wm [0..nrows-1] for offsets */
  #pragma ivdep
  			for (i = 0 ; i < nrows ; i++)
  			{
  			    row = Rows [i] ;
  			    ASSERT (row >= 0 && row < n_row) ;
  			    Row_degree [row] -= ncols_to_assemble ;
  			    Wm [i] = Frpos [row] ;
  			}
  
  			for (j = 0 ; j < ncols ; j++)
  			{
  			    col = Cols [j] ;
  			    if ((col >= 0) && (Fcpos [col] >= 0))
  			    {
  #ifndef FIXQ
  				Col_degree [col] -= nrowsleft ;
  #endif
  				Fcol = Fcblock + Fcpos [col] ;
  #pragma ivdep
  				for (i = 0 ; i < nrows ; i++)
  				{
  				    /* Fcol [Wm [i]] += S [i] ; */
  				    ASSEMBLE (Fcol [Wm [i]], S [i]) ;
  				}
  				/* flag the column as assembled from Uson */
  				Cols [j] = EMPTY ;
  			    }
  			    S += nrows ;
  			}
  
  
  			/* ] done using Wm [0..nrows-1] for offsets */
  		    }
  		    else
  		    {
  			/* -------------------------------------------------- */
  			/* some rows have been assembled out of this Uson */
  			/* -------------------------------------------------- */
  
  			/* compute the compressed column offset vector*/
  			/* [ use Woo,Wm [0..nrows-1] for offsets */
  			ngetrows = 0 ;
  			for (i = 0 ; i < nrows ; i++)
  			{
  			    row = Rows [i] ;
  			    if (row >= 0)
  			    {
  				Row_degree [row] -= ncols_to_assemble ;
  				ASSERT (row < n_row && Frpos [row] >= 0) ;
  				Woo [ngetrows] = i ;
  				Wm [ngetrows++] = Frpos [row] ;
  			    }
  			}
  			ASSERT (ngetrows == nrowsleft) ;
  
  			for (j = 0 ; j < ncols ; j++)
  			{
  			    col = Cols [j] ;
  			    if ((col >= 0) && (Fcpos [col] >= 0))
  			    {
  #ifndef FIXQ
  				Col_degree [col] -= nrowsleft ;
  #endif
  				Fcol = Fcblock + Fcpos [col] ;
  #pragma ivdep
  				for (i = 0 ; i < nrowsleft ; i++)
  				{
  				    /* Fcol [Wm [i]] += S [Woo [i]] ; */
  				    ASSEMBLE (Fcol [Wm [i]], S [Woo [i]]) ;
  				}
  				/* flag the column as assembled from Uson */
  				Cols [j] = EMPTY ;
  			    }
  			    S += nrows ;
  			}
  
  			/* ] done using Woo,Wm */
  		    }
  		    ep->ncolsleft = extrdeg ;
  		}
  	    }
  
  	}
  	else
  	{
  
  	    /* -------------------------------------------------------------- */
  	    /* this is an Lson - assemble all possible rows */
  	    /* -------------------------------------------------------------- */
  
  	    DEBUG6 (("New LSON: "ID"
  ", e)) ;
  	    ASSERT (extrdeg == 0 && extcdeg > 0) ;
  
  	    DEBUG6 (("New lson "ID" rows to do "ID"
  ", e, nrows_to_assemble)) ;
  
  	    if (nrows_to_assemble > 0)
  	    {
  
  		Int skip = FALSE ;
  		if (nrows_to_assemble * 16 < nrows && ncols == 1)
  		{
  		    /* this is a tall and thin frontal matrix consisting of
  		     * only one column (most likely an original column). Do
  		     * not assemble it.   It cannot be the pivot column, since
  		     * the pivot column element would be an LU son, not an Lson,
  		     * of the current frontal matrix. */
  		    ASSERT (ncolsleft == 1) ;
  		    ASSERT (Cols [0] >= 0 && Cols [0] < Work->n_col) ;
  		    Work->any_skip = TRUE ;
  		    skip = TRUE ;
  		}
  
  		if (!skip)
  		{
  
  		    /* compute the compressed column offset vector */
  		    /* [ use Woo,Wm [0..nrows-1] for offsets */
  		    ngetrows = 0 ;
  		    for (i = 0 ; i < nrows ; i++)
  		    {
  			row = Rows [i] ;
  			if ((row >= 0) && (Frpos [row] >= 0))
  			{
  			    ASSERT (row < n_row) ;
  			    Row_degree [row] -= ncolsleft ;
  			    Woo [ngetrows] = i ;
  			    Wm [ngetrows++] = Frpos [row] ;
  			    /* flag the row as assembled from the Lson */
  			    Rows [i] = EMPTY ;
  			}
  		    }
  		    ASSERT (nrowsleft - ngetrows == extcdeg) ;
  		    ASSERT (ngetrows == nrows_to_assemble) ;
  
  		    if (ncols == ncolsleft)
  		    {
  			/* -------------------------------------------------- */
  			/* no columns assembled out this Lson yet */
  			/* -------------------------------------------------- */
  
  			for (j = 0 ; j < ncols ; j++)
  			{
  			    col = Cols [j] ;
  			    ASSERT (col >= 0 && col < n_col) ;
  #ifndef FIXQ
  			    Col_degree [col] -= nrows_to_assemble ;
  #endif
  			    Fcol = Fcblock + Fcpos [col] ;
  #pragma ivdep
  			    for (i = 0 ; i < nrows_to_assemble ; i++)
  			    {
  				/* Fcol [Wm [i]] += S [Woo [i]] ; */
  				ASSEMBLE (Fcol [Wm [i]], S [Woo [i]]) ;
  			    }
  			    S += nrows ;
  			}
  
  
  		    }
  		    else
  		    {
  			/* -------------------------------------------------- */
  			/* some columns have been assembled out of this Lson */
  			/* -------------------------------------------------- */
  
  			for (j = 0 ; j < ncols ; j++)
  			{
  			    col = Cols [j] ;
  			    ASSERT (col < n_col) ;
  			    if (col >= 0)
  			    {
  #ifndef FIXQ
  				Col_degree [col] -= nrows_to_assemble ;
  #endif
  				Fcol = Fcblock + Fcpos [col] ;
  #pragma ivdep
  				for (i = 0 ; i < nrows_to_assemble ; i++)
  				{
  				    /* Fcol [Wm [i]] += S [Woo [i]] ; */
  				    ASSEMBLE (Fcol [Wm [i]], S [Woo [i]]) ;
  				}
  			    }
  			    S += nrows ;
  			}
  
  		    }
  
  		    /* ] done using Woo,Wm */
  
  		    ep->nrowsleft = extcdeg ;
  		}
  	    }
  	}
      }
  
      /* Note that garbage collection, and build tuples */
      /* both destroy the son list. */
  
      /* ] son_list now empty */
  
      /* ---------------------------------------------------------------------- */
      /* If frontal matrix extended, assemble old L/Usons from new rows/cols */
      /* ---------------------------------------------------------------------- */
  
      /* ---------------------------------------------------------------------- */
      /* SCAN2-row:  assemble rows of old Lsons from the new rows */
      /* ---------------------------------------------------------------------- */
  
  #ifndef NDEBUG
      DEBUG7 (("Current frontal matrix: (prior to scan2-row)
  ")) ;
      UMF_dump_current_front (Numeric, Work, TRUE) ;
  #endif
  
      /* rescan the pivot row */
      if (Work->any_skip)
      {
  	row_assemble (Work->pivrow, Numeric, Work) ;
      }
  
      if (Work->do_scan2row)
      {
  	for (i2 = Work->fscan_row ; i2 < fnrows ; i2++)
  	{
  	    /* Get a row */
  	    row = Work->NewRows [i2] ;
  	    if (row < 0) row = FLIP (row) ;
  	    ASSERT (row >= 0 && row < n_row) ;
  	    if (!(row == Work->pivrow && Work->any_skip))
  	    {
  		/* assemble it */
  		row_assemble (row, Numeric, Work) ;
  	    }
  	}
      }
  
      /* ---------------------------------------------------------------------- */
      /* SCAN2-col:  assemble columns of old Usons from the new columns */
      /* ---------------------------------------------------------------------- */
  
  #ifndef NDEBUG
      DEBUG7 (("Current frontal matrix: (prior to scan2-col)
  ")) ;
      UMF_dump_current_front (Numeric, Work, TRUE) ;
  #endif
  
      /* rescan the pivot col */
      if (Work->any_skip)
      {
  	col_assemble (Work->pivcol, Numeric, Work) ;
      }
  
      if (Work->do_scan2col)
      {
  
  	for (j2 = Work->fscan_col ; j2 < fncols ; j2++)
  	{
  	    /* Get a column */
  	    col = Work->NewCols [j2] ;
  	    if (col < 0) col = FLIP (col) ;
  	    ASSERT (col >= 0 && col < n_col) ;
  	    if (!(col == Work->pivcol && Work->any_skip))
  	    {
  		/* assemble it */
  		col_assemble (col, Numeric, Work) ;
  	    }
  	}
      }
  
      /* ---------------------------------------------------------------------- */
      /* done.  the remainder of this routine is used only when in debug mode */
      /* ---------------------------------------------------------------------- */
  
  #ifndef NDEBUG
  
      /* ---------------------------------------------------------------------- */
      /* when debugging: make sure the assembly did everything that it could */
      /* ---------------------------------------------------------------------- */
  
      DEBUG3 (("::Assemble done
  ")) ;
  
      for (i2 = 0 ; i2 < fnrows ; i2++)
      {
  	/* Get a row */
  	row = Work->Frows [i2] ;
  	ASSERT (row >= 0 && row < n_row) ;
  
  	DEBUG6 (("DEBUG SCAN 1: "ID"
  ", row)) ;
  	UMF_dump_rowcol (0, Numeric, Work, row, TRUE) ;
  
  	ASSERT (NON_PIVOTAL_ROW (row)) ;
  	tpi = Row_tuples [row] ;
  	if (!tpi) continue ;
  	tp = (Tuple *) (Memory + tpi) ;
  	tpend = tp + Row_tlen [row] ;
  	for ( ; tp < tpend ; tp++)
  	{
  	    e = tp->e ;
  	    ASSERT (e > 0 && e <= Work->nel) ;
  	    if (!E [e]) continue ;	/* element already deallocated */
  	    f = tp->f ;
  	    p = Memory + E [e] ;
  	    ep = (Element *) p ;
  	    p += UNITS (Element, 1) ;
  	    Cols = (Int *) p ;
  	    Rows = ((Int *) p) + ep->ncols ;
  	    if (Rows [f] == EMPTY) continue ;	/* row already assembled */
  	    ASSERT (row == Rows [f]) ;
  	    extrdeg = (ep->rdeg < rdeg0) ? ep->ncolsleft : (ep->rdeg - rdeg0) ;
  	    extcdeg = (ep->cdeg < cdeg0) ? ep->nrowsleft : (ep->cdeg - cdeg0) ;
  	    DEBUG6 ((
  		"e "ID" After assembly ext row deg: "ID" ext col degree "ID"
  ",
  		e, extrdeg, extcdeg)) ;
  
  	    if (Work->any_skip)
  	    {
  		/* no Lsons in any row, except for very tall and thin ones */
  		ASSERT (extrdeg >= 0) ;
  		if (extrdeg == 0)
  		{
  		    /* this is an unassemble Lson */
  		    ASSERT (ep->ncols == 1) ;
  		    ASSERT (ep->ncolsleft == 1) ;
  		    col = Cols [0] ;
  		    ASSERT (col != Work->pivcol) ;
  		}
  	    }
  	    else
  	    {
  		/* no Lsons in any row */
  		ASSERT (extrdeg > 0) ;
  		/* Uson external row degree is = number of cols left */
  		ASSERT (IMPLIES (extcdeg == 0, extrdeg == ep->ncolsleft)) ;
  	    }
  	}
      }
  
      /* ---------------------------------------------------------------------- */
  
      for (j2 = 0 ; j2 < fncols ; j2++)
      {
  	/* Get a column */
  	col = Work->Fcols [j2] ;
  	ASSERT (col >= 0 && col < n_col) ;
  
  	DEBUG6 (("DEBUG SCAN 2: "ID"
  ", col)) ;
  #ifndef FIXQ
  	UMF_dump_rowcol (1, Numeric, Work, col, TRUE) ;
  #else
  	UMF_dump_rowcol (1, Numeric, Work, col, FALSE) ;
  #endif
  
  	ASSERT (NON_PIVOTAL_COL (col)) ;
  	tpi = Col_tuples [col] ;
  	if (!tpi) continue ;
  	tp = (Tuple *) (Memory + tpi) ;
  	tpend = tp + Col_tlen [col] ;
  	for ( ; tp < tpend ; tp++)
  	{
  	    e = tp->e ;
  	    ASSERT (e > 0 && e <= Work->nel) ;
  	    if (!E [e]) continue ;	/* element already deallocated */
  	    f = tp->f ;
  	    p = Memory + E [e] ;
  	    ep = (Element *) p ;
  	    p += UNITS (Element, 1) ;
  	    Cols = (Int *) p ;
  	    Rows = ((Int *) p) + ep->ncols ;
  	    if (Cols [f] == EMPTY) continue ;	/* column already assembled */
  	    ASSERT (col == Cols [f]) ;
  	    extrdeg = (ep->rdeg < rdeg0) ? ep->ncolsleft : (ep->rdeg - rdeg0) ;
  	    extcdeg = (ep->cdeg < cdeg0) ? ep->nrowsleft : (ep->cdeg - cdeg0) ;
  	    DEBUG6 (("e "ID" After assembly ext col deg: "ID"
  ", e, extcdeg)) ;
  
  	    if (Work->any_skip)
  	    {
  		/* no Usons in any column, except for very tall and thin ones */
  		ASSERT (extcdeg >= 0) ;
  		if (extcdeg == 0)
  		{
  		    /* this is an unassemble Uson */
  		    ASSERT (ep->nrows == 1) ;
  		    ASSERT (ep->nrowsleft == 1) ;
  		    row = Rows [0] ;
  		    ASSERT (row != Work->pivrow) ;
  		}
  	    }
  	    else
  	    {
  		/* no Usons in any column */
  		ASSERT (extcdeg > 0) ;
  		/* Lson external column degree is = number of rows left */
  		ASSERT (IMPLIES (extrdeg == 0, extcdeg == ep->nrowsleft)) ;
  	    }
  	}
      }
  #endif /* NDEBUG */
  }