@@ -67,7 +67,8 @@ function rs_direct_interpolation_pass1(S, A, splitting)
67
67
if splitting[i] == C_NODE
68
68
nnz += 1
69
69
else
70
- for jj = Sp[i]: Sp[i+ 1 ]- 1
70
+ for jj = Sp[i]: Sp[i+ 1 ]
71
+ jj > length (Sj) && continue
71
72
if splitting[Sj[jj]] == C_NODE && Sj[jj] != i
72
73
nnz += 1
73
74
end
@@ -94,7 +95,6 @@ function rs_direct_interpolation_pass1(S, A, splitting)
94
95
Bj = zeros (Ti, Bp[end ])
95
96
Bx = zeros (Float64, Bp[end ])
96
97
n_nodes = size (A, 1 )
97
- # Bp += 1
98
98
99
99
for i = 1 : n_nodes
100
100
if splitting[i] == C_NODE
@@ -103,8 +103,8 @@ function rs_direct_interpolation_pass1(S, A, splitting)
103
103
else
104
104
sum_strong_pos = 0
105
105
sum_strong_neg = 0
106
- for jj = Sp[i]: Sp[i+ 1 ]- 1
107
- jj > length (Sp ) && continue
106
+ for jj = Sp[i]: Sp[i+ 1 ]
107
+ jj > length (Sj ) && continue
108
108
if splitting[Sj[jj]] == C_NODE && Sj[jj] != i
109
109
if Sx[jj] < 0
110
110
sum_strong_neg += Sx[jj]
@@ -118,7 +118,7 @@ function rs_direct_interpolation_pass1(S, A, splitting)
118
118
sum_all_neg = 0
119
119
diag = 0 ;
120
120
for jj = Ap[i]: Ap[i+ 1 ]
121
- jj > length (Ap ) && continue
121
+ jj > length (Aj ) && continue
122
122
if Aj[jj] == i
123
123
diag += Ax[jj]
124
124
else
@@ -138,8 +138,8 @@ function rs_direct_interpolation_pass1(S, A, splitting)
138
138
beta = 0
139
139
end
140
140
141
- neg_coeff = - alpha/ diag;
142
- pos_coeff = - beta/ diag;
141
+ neg_coeff = - alpha / diag
142
+ pos_coeff = - beta / diag
143
143
144
144
nnz = Bp[i]
145
145
for jj = Sp[i]: Sp[i+ 1 ]
@@ -150,8 +150,8 @@ function rs_direct_interpolation_pass1(S, A, splitting)
150
150
Bx[nnz] = neg_coeff * Sx[jj]
151
151
else
152
152
Bx[nnz] = pos_coeff * Sx[jj]
153
- nnz += 1
154
153
end
154
+ nnz += 1
155
155
end
156
156
end
157
157
end
0 commit comments