-
Notifications
You must be signed in to change notification settings - Fork 248
simple_continued_fraction: added public functions to access and modify the coefficients #971
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
Open
Tomaqa
wants to merge
6
commits into
boostorg:develop
Choose a base branch
from
Tomaqa:simple_continued_fraction
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
08f0490
Add free function for calculation of simple continued fraction coeffs
mborland b547ac7
Update docs
mborland 1f3a079
Fix casting for MSVC
mborland d83bd53
Typedef for Z `int_type`; replaced member variable `x_` with `precisi…
25ab7c5
Implemented `simple_continued_fraction(std::vector<Z>)`
c4c4592
Implemented templated free function `Rational to_rational(simple_cont…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Implemented
simple_continued_fraction(std::vector<Z>)
- Loading branch information
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As written this makes a copy of the data vector and then moves it into
b_. I expect you want to take an r-value reference instead.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
simple_continued_fraction(std::vector<Z>)can be used both withstd::vector<Z>&&andconst std::vector<Z>&arguments, whereassimple_continued_fraction(std::vector<Z>&&)cannot be used withconst std::vector<Z>&. In the case ofstd::vector<Z>&&argument, there should no significant difference (std::vector<Z>can require one more call to move constructor, which is negligible).More importantly, I'm pretty sure that your suggestion
simple_continued_fraction(std::vector<Z>&& data) : b_{data}will call copy constructor ondata, because you pass it as an lvalue, not as an rvalue.