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

Minor change of the file sweeps.h #106

Merged
merged 1 commit into from Jul 9, 2016

Conversation

@mingpu
Copy link
Contributor

@mingpu mingpu commented Jun 29, 2016

Minor change of the file sweeps.h. Now if the number of row of sweep parameters in the input file is less than nsweep, the last row will repeat.

parameters in the input file is less than nsweep, the last row will
repeat.
@emstoudenmire
Copy link
Contributor

@emstoudenmire emstoudenmire commented Jun 30, 2016

Hi Mingpu, this is a nice idea. One question is, this seems to rely on a certain behavior of the line
table.file() >> maxm_[i] >> ...
namely that it will set maxm_[i] to zero (or leave it as zero) if there is no more input. Is this relying on a particular guaranteed behavior of the >> operator for input streams? What if someone leaves a space between the last line in the table and the closing brace (closing } )? I just want to better understand if the condition we are relying on here is robust. Thanks!

@mingpu
Copy link
Contributor Author

@mingpu mingpu commented Jun 30, 2016

Hi Miles, thanks. I think ifstream ignores white spaces. So if there are white spaces at the end of the file, the value of maxm_[i] will be the default value when it is declared, which is 0 for std::vector.

@emstoudenmire
Copy link
Contributor

@emstoudenmire emstoudenmire commented Jul 9, 2016

Thanks Mingpu - I hope it doesn't lead to any surprising behavior but it is definitely an improvement to the current behavior!

@emstoudenmire emstoudenmire merged commit 4df7b8c into ITensor:master Jul 9, 2016
emstoudenmire added a commit that referenced this pull request Sep 5, 2016
…alized to nsweep_ (thanks Bill Huggins for reporting this)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.