You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dminimp=0.0; // (always neg) min improvement we will accept, best improvement in any column so far. Init to 0 so we take first column with a pivot
1157
1158
1158
-
In=AS(C(AAV(w)[4]))[1]; // n=#rows/cols in M
1159
+
In=AS(box4)[1]; // n=#rows/cols in M
1159
1160
// convert types as needed; set ?v=pointer to data area for ?
1160
1161
D*bv; // pointer to b values if there are any
1161
1162
__m256dthresh; // ColThr Inf bkmin MinPivot validity thresholds, small positive values - for one-column mode, all lanes have the threshold for zero-clamp
I*exlist=0, nexlist, *yk; // exclusion list: list of excluded col|row pairs, length
1169
1170
Dbkmin; // the largest value for which bk is considered close enough to 0
1170
1171
1171
-
if(AR(C(AAV(w)[0]))==0){
1172
+
if(AR(box0)==0){
1172
1173
// single index value. set bv=0, zv non0 as a flag that we are storing the column
1173
1174
bv=0; ASSERT(AN(w)==6,EVLENGTH); // if goodvec is an atom, set bv=0 to indicate that bv is not used and verify no more input
1174
-
if(unlikely(n==0)){Rreshape(drop(num(-1),shape(C(AAV(w)[4]))),zeroionei(0));} // empty M, each product is 0
1175
-
ASSERT(AR(C(AAV(w)[5]))==0,EVRANK); ASSERT(AT(C(AAV(w)[5]))&FL,EVDOMAIN); // thresh must be a float atom
1176
-
Iepcol=AR(C(AAV(w)[4]))==3; // flag if we are doing an extended-precision column fetch
1177
-
GATV(z,FL,n<<epcol,1+epcol,AS(C(AAV(w)[4]))); zv=DAV(z); // allocate the result area for column extraction. Set zv nonzero so we use bkgrd of i. #M
1175
+
if(unlikely(n==0)){Rreshape(drop(num(-1),shape(box4)),zeroionei(0));} // empty M, each product is 0
1176
+
ASSERT(AR(box5)==0,EVRANK); ASSERT(AT(box5)&FL,EVDOMAIN); // thresh must be a float atom
1177
+
Iepcol=AR(box4)==3; // flag if we are doing an extended-precision column fetch
1178
+
GATV(z,FL,n<<epcol,1+epcol,AS(box4)); zv=DAV(z); // allocate the result area for column extraction. Set zv nonzero so we use bkgrd of i. #M
1178
1179
bvgrd0=0; bvgrde=bvgrd0+n; // length of column is #M
1179
-
thresh=_mm256_set1_pd(DAV(C(AAV(w)[5]))[0]); // load threshold in all lanes
1180
+
thresh=_mm256_set1_pd(DAV(box5)[0]); // load threshold in all lanes
1180
1181
}else{
1181
1182
// A list of index values. We are doing the DIP calculation or Dpiv
1182
-
ASSERT(AR(C(AAV(w)[5]))==1,EVRANK); ASSERT(AN(C(AAV(w)[5]))==0||AT(C(AAV(w)[5]))&INT,EVDOMAIN); bvgrd0=IAV(C(AAV(w)[5])); bvgrde=bvgrd0+AN(C(AAV(w)[5])); // bkgrd: the order of processing the rows, and end+1 ptr normally /: bk
1183
-
if(AN(C(AAV(w)[5]))==0){RETF(num(6))} // empty bk - give error/empty result 6
1184
-
ASSERT(BETWEENC(AN(w),8,11),EVLENGTH);
1185
-
ASSERT(AR(C(AAV(w)[8]))<=1,EVRANK); // Frow, one per row of M and column of A
1186
-
if(AN(C(AAV(w)[8]))==0)Frow=0;else{ASSERT(AT(C(AAV(w)[8]))&FL,EVDOMAIN); ASSERT(AN(C(AAV(w)[8]))==AS(C(AAV(w)[4]))[0]+AS(C(AAV(w)[1]))[0],EVLENGTH); Frow=DAV(C(AAV(w)[8]));} // if Frow omitted we are looking to make bks nonzero
ASSERT(AR(box5)==1,EVRANK); ASSERT(AN(box5)==0||AT(box5)&INT,EVDOMAIN); bvgrd0=IAV(box5); bvgrde=bvgrd0+AN(box5); // bkgrd: the order of processing the rows, and end+1 ptr normally /: bk
1184
+
if(AN(box5)==0){RETF(num(6))} // empty bk - give error/empty result 6
ASSERT(AR(box8)<=1,EVRANK); // Frow, one per row of M and column of A
1188
+
if(AN(box8)==0)Frow=0;else{ASSERT(AT(box8)&FL,EVDOMAIN); ASSERT(AN(box8)==n+AS(box1)[0],EVLENGTH); Frow=DAV(box8);} // if Frow omitted we are looking to make bks nonzero
ASSERT(AT(C(AAV(w)[7]))&FL,EVDOMAIN); ASSERT(AN(C(AAV(w)[7]))==AS(C(AAV(w)[4]))[0],EVLENGTH); bv=DAV(C(AAV(w)[7])); // bk, one per row of M
1196
-
zv=AN(C(AAV(w)[5]))==AN(C(AAV(w)[7]))?Frow:0; // set zv nonzero as a flag to process leading columns in order, until we have an improvement to shoot at. Do this only if ALL values in bk are to be processed
1197
+
ASSERT(AT(box7)&FL,EVDOMAIN); ASSERT(AS(box7)[AR(box7)-1]==n,EVLENGTH); bv=DAV(box7); // bk, one per row of M
1198
+
zv=AN(box5)==AS(box7)[AR(box7)-1]?Frow:0; // set zv nonzero as a flag to process leading columns in order, until we have an improvement to shoot at. Do this only if ALL values in bk are to be processed
1197
1199
if(AN(w)>9){
1198
1200
// nonimproving pivots with exlist
1201
+
Abox9=C(AAV(w)[9]), box10=C(AAV(w)[10]);
1199
1202
ASSERT(AN(w)==11,EVLENGTH);
1200
1203
// An exclusion list is given (and thus also yk). Remember their addresses. Its presence puts us through the 'nonimproving path' case
1201
-
exlist=IAV(C(AAV(w)[9])); // remember address of exclusions
1202
-
nexlist=AN(C(AAV(w)[9])); // and length of list
1203
-
ASSERT(AR(C(AAV(w)[9]))<=1,EVRANK); ASSERT(nexlist==0||ISDENSETYPE(AT(C(AAV(w)[9])),INT),EVDOMAIN); // must be integer list
1204
-
ASSERT(AR(C(AAV(w)[10]))<=1,EVRANK); ASSERT(ISDENSETYPE(AT(C(AAV(w)[10])),INT),EVDOMAIN); ASSERT(AN(C(AAV(w)[10]))==AS(C(AAV(w)[4]))[0],EVLENGTH); // yk, one per row of M
1205
-
yk=IAV(C(AAV(w)[10])); // remember address of translation table of row# to basis column#
1204
+
exlist=IAV(box9); // remember address of exclusions
1205
+
nexlist=AN(box9); // and length of list
1206
+
ASSERT(AR(box9)<=1,EVRANK); ASSERT(nexlist==0||ISDENSETYPE(AT(box9),INT),EVDOMAIN); // must be integer list
1207
+
ASSERT(AR(box10)<=1,EVRANK); ASSERT(ISDENSETYPE(AT(box10),INT),EVDOMAIN); ASSERT(AN(box10)==n,EVLENGTH); // yk, one per row of M
1208
+
yk=IAV(box10); // remember address of translation table of row# to basis column#
1206
1209
}
1207
1210
}else{
1208
1211
// Dpiv counting, with Dpiv. exlist is the Dpiv area
1212
+
Abox9=C(AAV(w)[9]);
1209
1213
ASSERT(AN(w)==10,EVLENGTH);
1210
1214
bv=zv=0;
1211
-
exlist=IAV(C(AAV(w)[9])); // remember address of exclusions
1212
-
ASSERT(AR(C(AAV(w)[9]))==1,EVRANK); ASSERT(ISDENSETYPE(AT(C(AAV(w)[9])),INT),EVDOMAIN); // must be integer list
1213
-
ASSERT(AN(C(AAV(w)[9]))==AS(C(AAV(w)[1]))[0]+AS(C(AAV(w)[4]))[0],EVLENGTH); // length of Dpiv is #cols of A + #rows of A (=M)
1215
+
exlist=IAV(box9); // remember address of exclusions
1216
+
ASSERT(AR(box9)==1,EVRANK); ASSERT(ISDENSETYPE(AT(box9),INT),EVDOMAIN); // must be integer list
1217
+
ASSERT(AN(box9)==AS(box1)[0]+n,EVLENGTH); // length of Dpiv is #cols of A + #rows of A (=M)
1214
1218
z=mtv; // no error is possible; use harmless return value
0 commit comments