MCPcopy Create free account
hub / github.com/EdwardRaff/JSAT / qrUpdateR

Method qrUpdateR

JSAT/src/jsat/linear/DenseMatrix.java:210–229  ·  view source on GitHub ↗
(int k, int N, DenseMatrix A, double[] vk, double TwoOverBeta, int M)

Source from the content-addressed store, hash-verified

208 }
209
210 private void qrUpdateR(int k, int N, DenseMatrix A, double[] vk, double TwoOverBeta, int M)
211 {
212 //First run of loop removed, as it will be setting zeros. More accurate to just set them ourselves
213 if(k < N)
214 {
215 qrUpdateRFirstIteration(A, k, vk, TwoOverBeta, M);
216 }
217 //The rest of the normal look
218 for(int j = k+1; j < N; j++)
219 {
220 double[] A_j = A.matrix[j];
221 double y = 0;//y = vk dot A_j
222 for(int i = k; i < A.cols(); i++)
223 y += vk[i]*A_j[i];
224
225 y *= TwoOverBeta;
226 for(int i = k; i < M; i++)
227 A_j[i] -= y*vk[i];
228 }
229 }
230
231 private void qrUpdateRFirstIteration(DenseMatrix A, int k, double[] vk, double TwoOverBeta, int M)
232 {

Callers 1

qrMethod · 0.95

Calls 2

colsMethod · 0.45

Tested by

no test coverage detected