Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

preconditioner #197

Open
behinger opened this issue Apr 30, 2024 · 1 comment
Open

preconditioner #197

behinger opened this issue Apr 30, 2024 · 1 comment

Comments

@behinger
Copy link
Member

behinger commented Apr 30, 2024

I saw in simple testing a ~12% increase in performance just by scaling

function scale_ls!(A)
    s = ones(size(A, 2))
    for j = 1 : size(A, 2)
      i = A.colptr[j]
      k = A.colptr[j+1] - 1
      nj = i <= k ? norm(A.nzval[i:k]) : 0.0
      if nj > 0.0
        A.nzval[i:k] ./= nj
        s[j] = nj
      end
    end
    return s  # s contains the diagonal elements of the (right) diagonal scaling
  end

before scaling ~ 1.42s, after scaling 1.23s +0.03s scaling => 12% speedup
the scaling is fast, and can be ignored when multiple channels are fitted

@behinger
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant