Skip to content

Commit b9191c7

Browse files
committed
j = 0 needs to be changed to j = ai
1 parent 834b673 commit b9191c7

1 file changed

Lines changed: 26 additions & 26 deletions

File tree

src/main/java/org/apache/sysds/runtime/codegen/LibSpoofPrimitives.java

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2183,7 +2183,7 @@ public static SparseRowVector vectMultWrite(int len, double[] a, double bval, in
21832183
if( a == null ) return c;
21842184
int[] indexes = c.indexes();
21852185
double[] values = c.values();
2186-
for(int j = 0; j < ai+alen; j++) {
2186+
for(int j = ai; j < ai+alen; j++) {
21872187
indexes[j] = aix[j];
21882188
values[j] = a[j]*bval;
21892189
}
@@ -2251,15 +2251,15 @@ public static void vectWrite(double[] a, int[] aix, double[] c, int ci, int len)
22512251

22522252
public static void vectWrite(double[] a, double[] c, int[] aix, int ai, int ci, int alen) {
22532253
if( a == null ) return;
2254-
for(int j = 0; j < ai+alen; j++)
2254+
for(int j = ai; j < ai+alen; j++)
22552255
c[ci+aix[j]] = a[j];
22562256
}
22572257

22582258
public static SparseRowVector vectDivWrite(int len, double[] a, double bval, int[] aix, int ai, int alen) {
22592259
SparseRowVector c = allocSparseVector(alen);
22602260
int[] indexes = c.indexes();
22612261
double[] values = c.values();
2262-
for( int j = 0; j < ai+alen; j++ ) {
2262+
for( int j = ai; j < ai+alen; j++ ) {
22632263
indexes[j] = aix[j];
22642264
values[j] = a[j] / bval;
22652265
}
@@ -2271,7 +2271,7 @@ public static SparseRowVector vectDivWrite(int len, double bval, double[] a, int
22712271
SparseRowVector c = allocSparseVector(alen);
22722272
int[] indexes = c.indexes();
22732273
double[] values = c.values();
2274-
for(int j = 0; j < ai+alen; j++) {
2274+
for(int j = ai; j < ai+alen; j++) {
22752275
indexes[j] = aix[j];
22762276
values[j] = bval / a[j];
22772277
}
@@ -2478,7 +2478,7 @@ public static SparseRowVector vectXorWrite(int len, double[] a, double bval, int
24782478
SparseRowVector c = allocSparseVector(alen);
24792479
int[] indexes = c.indexes();
24802480
double[] values = c.values();
2481-
for(int j = 0; j < ai+alen; j++) {
2481+
for(int j = ai; j < ai+alen; j++) {
24822482
indexes[j] = aix[j];
24832483
values[j] = (a[j] != 0) ? 1 : 0;
24842484
}
@@ -2560,7 +2560,7 @@ public static SparseRowVector vectPowWrite(int len, double[] a, double bval, int
25602560
SparseRowVector c = allocSparseVector(alen);
25612561
int[] indexes = c.indexes();
25622562
double[] values = c.values();
2563-
for(int j = 0; j < ai+alen; j++) {
2563+
for(int j = ai; j < ai+alen; j++) {
25642564
indexes[j] = aix[j];
25652565
values[j] = Math.pow(a[j], bval);
25662566
}
@@ -2596,7 +2596,7 @@ public static SparseRowVector vectMinWrite(int len, double[] a, double bval, int
25962596
SparseRowVector c = allocSparseVector(alen);
25972597
int[] indexes = c.indexes();
25982598
double[] values = c.values();
2599-
for(int j = 0; j < ai+alen; j++) {
2599+
for(int j = ai; j < ai+alen; j++) {
26002600
indexes[j] = aix[j];
26012601
values[j] = Math.min(a[j], bval);
26022602
}
@@ -2678,7 +2678,7 @@ public static SparseRowVector vectMaxWrite(int len, double[] a, double bval, int
26782678
SparseRowVector c = allocSparseVector(alen);
26792679
int[] indexes = c.indexes();
26802680
double[] values = c.values();
2681-
for(int j = 0; j < ai+alen; j++) {
2681+
for(int j = ai; j < ai+alen; j++) {
26822682
indexes[j] = aix[j];
26832683
values[j] = Math.max(a[j], bval);
26842684
}
@@ -2760,7 +2760,7 @@ public static SparseRowVector vectEqualWrite(int len, double[] a, double bval, i
27602760
SparseRowVector c = allocSparseVector(alen);
27612761
int[] indexes = c.indexes();
27622762
double[] values = c.values();
2763-
for(int j = 0; j < ai+alen; j++) {
2763+
for(int j = ai; j < ai+alen; j++) {
27642764
indexes[j] = aix[j];
27652765
values[j] = a[j] == bval ? 1 : 0;
27662766
}
@@ -2825,7 +2825,7 @@ public static SparseRowVector vectNotequalWrite(int len, double[] a, double bval
28252825
SparseRowVector c = allocSparseVector(alen);
28262826
int[] indexes = c.indexes();
28272827
double[] values = c.values();
2828-
for(int j = 0; j < ai+alen; j++) {
2828+
for(int j = ai; j < ai+alen; j++) {
28292829
indexes[j] = aix[j];
28302830
values[j] = a[j] != bval ? 1 : 0;
28312831
}
@@ -2907,7 +2907,7 @@ public static SparseRowVector vectLessWrite(int len, double[] a, double bval, in
29072907
SparseRowVector c = allocSparseVector(alen);
29082908
int[] indexes = c.indexes();
29092909
double[] values = c.values();
2910-
for(int j = 0; j < ai+alen; j++) {
2910+
for(int j = ai; j < ai+alen; j++) {
29112911
indexes[j] = aix[j];
29122912
values[j] = a[j] < bval ? 1 : 0;
29132913
}
@@ -2989,7 +2989,7 @@ public static SparseRowVector vectLessequalWrite(int len, double[] a, double bva
29892989
SparseRowVector c = allocSparseVector(alen);
29902990
int[] indexes = c.indexes();
29912991
double[] values = c.values();
2992-
for(int j = 0; j < ai+alen; j++) {
2992+
for(int j = ai; j < ai+alen; j++) {
29932993
indexes[j] = aix[j];
29942994
values[j] = a[j] <= bval ? 1 : 0;
29952995
}
@@ -3054,7 +3054,7 @@ public static SparseRowVector vectGreaterWrite(int len, double[] a, double bval,
30543054
SparseRowVector c = allocSparseVector(alen);
30553055
int[] indexes = c.indexes();
30563056
double[] values = c.values();
3057-
for(int j = 0; j < ai+alen; j++) {
3057+
for(int j = ai; j < ai+alen; j++) {
30583058
indexes[j] = aix[j];
30593059
values[j] = a[j] > bval ? 1 : 0;
30603060
}
@@ -3136,7 +3136,7 @@ public static SparseRowVector vectGreaterequalWrite(int len, double[] a, double
31363136
SparseRowVector c = allocSparseVector(alen);
31373137
int[] indexes = c.indexes();
31383138
double[] values = c.values();
3139-
for(int j = 0; j < ai+alen; j++) {
3139+
for(int j = ai; j < ai+alen; j++) {
31403140
indexes[j] = aix[j];
31413141
values[j] = a[j] >= bval ? 1 : 0;
31423142
}
@@ -3221,7 +3221,7 @@ public static SparseRowVector vectSqrtWrite(int len, double[] a, int[] aix, int
32213221
SparseRowVector c = allocSparseVector(alen);
32223222
int[] indexes = c.indexes();
32233223
double[] values = c.values();
3224-
for(int j = 0; j < ai+alen; j++) {
3224+
for(int j = ai; j < ai+alen; j++) {
32253225
indexes[j] = aix[j];
32263226
values[j] = Math.sqrt(a[j]);
32273227
}
@@ -3233,7 +3233,7 @@ public static SparseRowVector vectAbsWrite(int len, double[] a, int[] aix, int a
32333233
SparseRowVector c = allocSparseVector(alen);
32343234
int[] indexes = c.indexes();
32353235
double[] values = c.values();
3236-
for(int j = 0; j < ai+alen; j++) {
3236+
for(int j = ai; j < ai+alen; j++) {
32373237
indexes[j] = aix[j];
32383238
values[j] = Math.abs(a[j]);
32393239
}
@@ -3245,7 +3245,7 @@ public static SparseRowVector vectRoundWrite(int len, double[] a, int[] aix, int
32453245
SparseRowVector c = allocSparseVector(alen);
32463246
int[] indexes = c.indexes();
32473247
double[] values = c.values();
3248-
for(int j = 0; j < ai+alen; j++) {
3248+
for(int j = ai; j < ai+alen; j++) {
32493249
indexes[j] = aix[j];
32503250
values[j] = Math.round(a[j]);
32513251
}
@@ -3257,7 +3257,7 @@ public static SparseRowVector vectCeilWrite(int len, double[] a, int[] aix, int
32573257
SparseRowVector c = allocSparseVector(alen);
32583258
int[] indexes = c.indexes();
32593259
double[] values = c.values();
3260-
for(int j = 0; j < ai+alen; j++) {
3260+
for(int j = ai; j < ai+alen; j++) {
32613261
indexes[j] = aix[j];
32623262
values[j] = Math.ceil(a[j]);
32633263
}
@@ -3269,7 +3269,7 @@ public static SparseRowVector vectFloorWrite(int len, double[] a, int[] aix, int
32693269
SparseRowVector c = allocSparseVector(alen);
32703270
int[] indexes = c.indexes();
32713271
double[] values = c.values();
3272-
for(int j = 0; j < ai+alen; j++) {
3272+
for(int j = ai; j < ai+alen; j++) {
32733273
indexes[j] = aix[j];
32743274
values[j] = Math.floor(a[j]);
32753275
}
@@ -3281,7 +3281,7 @@ public static SparseRowVector vectSinWrite(int len, double[] a, int[] aix, int a
32813281
SparseRowVector c = allocSparseVector(alen);
32823282
int[] indexes = c.indexes();
32833283
double[] values = c.values();
3284-
for(int j = 0; j < ai+alen; j++) {
3284+
for(int j = ai; j < ai+alen; j++) {
32853285
indexes[j] = aix[j];
32863286
values[j] = Math.sin(a[j]);
32873287
}
@@ -3293,7 +3293,7 @@ public static SparseRowVector vectTanWrite(int len, double[] a, int[] aix, int a
32933293
SparseRowVector c = allocSparseVector(alen);
32943294
int[] indexes = c.indexes();
32953295
double[] values = c.values();
3296-
for(int j = 0; j < ai+alen; j++) {
3296+
for(int j = ai; j < ai+alen; j++) {
32973297
indexes[j] = aix[j];
32983298
values[j] = Math.tan(a[j]);
32993299
}
@@ -3305,7 +3305,7 @@ public static SparseRowVector vectAsinWrite(int len, double[] a, int[] aix, int
33053305
SparseRowVector c = allocSparseVector(alen);
33063306
int[] indexes = c.indexes();
33073307
double[] values = c.values();
3308-
for(int j = 0; j < ai+alen; j++) {
3308+
for(int j = ai; j < ai+alen; j++) {
33093309
indexes[j] = aix[j];
33103310
values[j] = Math.asin(a[j]);
33113311
}
@@ -3317,7 +3317,7 @@ public static SparseRowVector vectAtanWrite(int len, double[] a, int[] aix, int
33173317
SparseRowVector c = allocSparseVector(alen);
33183318
int[] indexes = c.indexes();
33193319
double[] values = c.values();
3320-
for(int j = 0; j < ai+alen; j++) {
3320+
for(int j = ai; j < ai+alen; j++) {
33213321
indexes[j] = aix[j];
33223322
values[j] = Math.atan(a[j]);
33233323
}
@@ -3329,7 +3329,7 @@ public static SparseRowVector vectSinhWrite(int len, double[] a, int[] aix, int
33293329
SparseRowVector c = allocSparseVector(alen);
33303330
int[] indexes = c.indexes();
33313331
double[] values = c.values();
3332-
for(int j = 0; j < ai+alen; j++) {
3332+
for(int j = ai; j < ai+alen; j++) {
33333333
indexes[j] = aix[j];
33343334
values[j] = Math.sinh(a[j]);
33353335
}
@@ -3341,7 +3341,7 @@ public static SparseRowVector vectTanhWrite(int len, double[] a, int[] aix, int
33413341
SparseRowVector c = allocSparseVector(alen);
33423342
int[] indexes = c.indexes();
33433343
double[] values = c.values();
3344-
for(int j = 0; j < ai+alen; j++) {
3344+
for(int j = ai; j < ai+alen; j++) {
33453345
indexes[j] = aix[j];
33463346
values[j] = Math.tanh(a[j]);
33473347
}
@@ -3353,7 +3353,7 @@ public static SparseRowVector vectSignWrite(int len, double[] a, int[] aix, int
33533353
SparseRowVector c = allocSparseVector(alen);
33543354
int[] indexes = c.indexes();
33553355
double[] values = c.values();
3356-
for(int j = 0; j < ai+alen; j++) {
3356+
for(int j = ai; j < ai+alen; j++) {
33573357
indexes[j] = aix[j];
33583358
values[j] = Math.signum(a[j]);
33593359
}

0 commit comments

Comments
 (0)