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

Chebyshev rangefinder #4

Merged
merged 8 commits into from
Mar 31, 2023

Conversation

lukevolpatti
Copy link
Contributor

No description provided.

for i in 2:q
Yi = (4 / ν) * A * A' * Yi_1 - 2 * Yi_2 - Yi_2
Y = hcat(Y, Yi)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if repeated use of hcat is bad practice in Julia (as opposed to e.g. allocating all the required space in a big matrix right at the start).

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where possible, I would allocate at the beginning of the call since Y changes size and then overwrite columns.

Also use non-allocating matrix operations where possible (see https://docs.julialang.org/en/v1/stdlib/LinearAlgebra/#Low-level-matrix-operations).

For example of doing the multiply, see

isnothing(Ω) && (Ω = GaussianTestMatrix(m, r))

Y0 = qr(Ω.Ω).Q
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this step make the Chebyshev rangefinder incompatible with SSFTTestMatrix?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Matrix(Ω) instead of Ω.Ω

Copy link
Owner

@tjdiamandis tjdiamandis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! See commented notes, but this looks almost done

isnothing(Ω) && (Ω = GaussianTestMatrix(m, r))

Y0 = qr(Ω.Ω).Q
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Matrix(Ω) instead of Ω.Ω

for i in 2:q
Yi = (4 / ν) * A * A' * Yi_1 - 2 * Yi_2 - Yi_2
Y = hcat(Y, Yi)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where possible, I would allocate at the beginning of the call since Y changes size and then overwrite columns.

Also use non-allocating matrix operations where possible (see https://docs.julialang.org/en/v1/stdlib/LinearAlgebra/#Low-level-matrix-operations).

For example of doing the multiply, see

Yi_1 = Y1
for i in 2:q
Yi = (4 / ν) * A * A' * Yi_1 - 2 * Yi_2 - Yi_2
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be - 2 * Yi_1

@tjdiamandis tjdiamandis merged commit 9111f08 into tjdiamandis:main Mar 31, 2023
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

Successfully merging this pull request may close these issues.

2 participants