@@ -143,7 +143,7 @@ jttk(J jt, A a, A w) {
143
143
r = AR (w);
144
144
s = AS (w);
145
145
t = AT (w);
146
- if ((t & SPARSE) != 0 ) return jttks (jt, a, w);
146
+ if (is_sparse (w) ) return jttks (jt, a, w);
147
147
DO (
148
148
n, if (!u[i]) {
149
149
b = 1 ;
@@ -196,8 +196,8 @@ jttake(J jt, A a, A w) {
196
196
FPREFIP;
197
197
if (!(a && w)) return 0 ;
198
198
I wt = AT (w); // wt=type of w
199
- if ((SPARSE & AT (a)) != 0 ) RZ (a = jtdenseit (jt, a));
200
- if (!(SPARSE & wt )) RZ (w = jtsetfv (jt, w, w));
199
+ if (is_sparse (a) ) RZ (a = jtdenseit (jt, a));
200
+ if (!is_sparse (w )) RZ (w = jtsetfv (jt, w, w));
201
201
ar = AR (a);
202
202
acr = jt->ranks >> RANKTX;
203
203
acr = ar < acr ? ar : acr;
@@ -252,7 +252,7 @@ jttake(J jt, A a, A w) {
252
252
}
253
253
}
254
254
a = s;
255
- // correct if(!(ar|wf|(SPARSE&wt )|!wcr|(AFLAG(w)&(AFNJA)))){ // if there is only 1 take axis, w has no frame
255
+ // correct if(!(ar|wf|is_sparse(w )|!wcr|(AFLAG(w)&(AFNJA)))){ // if there is only 1 take axis, w has no frame
256
256
// and is not atomic
257
257
if (!(ar | wf | ((NOUN & ~(DIRECT | RECURSIBLE)) & wt) | !wcr |
258
258
(AFLAG (w) & (AFNJA)))) { // if there is only 1 take axis, w has no frame and is not atomic NJAwhy
@@ -334,7 +334,7 @@ jtdrop(J jt, A a, A w) {
334
334
n = AN (a);
335
335
u = AV (a); // n=#axes to drop, u->1st axis
336
336
// virtual case: scalar a
337
- // correct if(!(ar|wf|(SPARSE&wt )|!wcr|(AFLAG(w)&(AFNJA)))){ // if there is only 1 take axis, w has no frame
337
+ // correct if(!(ar|wf|is_sparse(w )|!wcr|(AFLAG(w)&(AFNJA)))){ // if there is only 1 take axis, w has no frame
338
338
// and is not atomic
339
339
if (!(ar | wf | ((NOUN & ~(DIRECT | RECURSIBLE)) & wt) | !wcr |
340
340
(AFLAG (w) & (AFNJA)))) { // if there is only 1 take axis, w has no frame and is not atomic BJAwhy
@@ -439,9 +439,9 @@ jthead(J jt, A w) {
439
439
return jtfrom (jtinplace, num (0 ), w); // could call jtfromi directly for non-sparse w
440
440
}
441
441
} else {
442
- return SPARSE & AT (w) ? jtirs2 (jt, jfalse, jttake (jt, jtrue, w), 0L , 0L , wcr, reinterpret_cast <AF>(jtfrom))
443
- : jtrsh0 (jt, w); // cell of w is empty - create a cell of fills jt->ranks is still
444
- // set for use in take. Left rank is garbage, but that's OK
442
+ return is_sparse (w) ? jtirs2 (jt, jfalse, jttake (jt, jtrue, w), 0L , 0L , wcr, reinterpret_cast <AF>(jtfrom))
443
+ : jtrsh0 (jt, w); // cell of w is empty - create a cell of fills jt->ranks is still
444
+ // set for use in take. Left rank is garbage, but that's OK
445
445
}
446
446
// pristinity from the called verb
447
447
}
@@ -457,7 +457,7 @@ jttail(J jt, A w) {
457
457
return !wcr || AS (w)[wf] ? jtfrom (jtinplace, num (-1 ), w)
458
458
: // if cells are atoms, or if the cells are nonempty arrays, result is last cell(s)
459
459
// scaf should generate virtual block here for speed
460
- SPARSE & AT (w) ? jtirs2 (jt, jfalse, jttake (jt, num (-1 ), w), 0L , 0L , wcr, reinterpret_cast <AF>(jtfrom))
461
- : jtrsh0 (jt, w);
460
+ is_sparse (w) ? jtirs2 (jt, jfalse, jttake (jt, num (-1 ), w), 0L , 0L , wcr, reinterpret_cast <AF>(jtfrom))
461
+ : jtrsh0 (jt, w);
462
462
// pristinity from other verbs
463
463
}
0 commit comments