Algorithm 2.
Alternating least squares algorithm.
| Input: CP-format vectors F and G, with ranks ; |
| Output: out, such that is minimized |
| (1) Initialization: |
| construct and matrices |
| (2) for : |
| for : (Loop over coordinates) |
| (a) downdate: for all , r |
| (b) downdate: for all , r |
| (c) compute for all ic, r (Eq. (10)) |
| (d) solve linear system for (Eq. (11)); |
| replace for all ic, r |
| (e) normalize ; for all r; |
| (f) update: for all , r |
| (g) update: for all , r |