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

Method run

JSAT/src/jsat/linear/DenseMatrix.java:914–952  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

912 }
913
914 public void run()
915 {
916 //Computing Q
917 {
918 //We are computing Q' in what we are treating as the column major order, which represents Q in row major order, which is what we want!
919 for(int j = 0+threadID; j < Q.cols(); j+=LogicalCores)
920 {
921 double[] Q_j = Q.matrix[j];
922 double y = 0;//y = vk dot A_j
923 for (int i = k; i < Q.cols(); i++)
924 y += vk[i] * Q_j[i];
925
926 y *= TwoOverBeta;
927 for (int i = k; i < Q.rows(); i++)
928 {
929 Q_j[i] -= y*vk[i];
930 }
931 }
932 }
933
934 //First run of loop removed, as it will be setting zeros. More accurate to just set them ourselves
935 if(k < N && threadID == 0)
936 {
937 qrUpdateRFirstIteration(A, k, vk, TwoOverBeta, M);
938 }
939 //The rest of the normal look
940 for(int j = k+1+threadID; j < N; j+=LogicalCores)
941 {
942 double[] A_j = A.matrix[j];
943 double y = 0;//y = vk dot A_j
944 for(int i = k; i < A.cols(); i++)
945 y += vk[i]*A_j[i];
946
947 y *= TwoOverBeta;
948 for(int i = k; i < M; i++)
949 A_j[i] -= y*vk[i];
950 }
951 latch.countDown();
952 }
953
954 }
955

Callers

nothing calls this directly

Calls 4

countDownMethod · 0.80
colsMethod · 0.45
rowsMethod · 0.45

Tested by

no test coverage detected