Skip to main content
. 2023 Jul 27;25(8):1130. doi: 10.3390/e25081130
Algorithm 2: Proposed method: Monte Carlo AMM with preprocessing
Require:  A∈Rm×k and B∈Rk×n, and c∈N
Ensure:  Z∈Rm×n, such that ∥AB−Z∥ is small
  1:  Z←O
  2:  vc←Aβ, vr←α⊤B, w←α⊤β
  3:  Zij←Zij−w+[vc]i+[vr]j for all 1≤i≤m and 1≤j≤n
  4:  Set p1,…,pk such that ∑l=1kpl=1
  5:  for  t=1,…,c  do
  6:        Pick it with P[it=l]=pl
  7:       Z←Z+A′(it)B(it)′cpit
  8:  end for