Skip to content

Conversation

@jodavies
Copy link
Collaborator

@jodavies jodavies commented Nov 6, 2024

These created numerators of 0. Fixes #567

@coveralls
Copy link

coveralls commented Nov 6, 2024

Coverage Status

coverage: 50.107%. remained the same
when pulling 362336d on jodavies:issue-567
into 8599601 on vermaseren:master.

@jodavies jodavies added this to the v4.3.2 milestone Nov 6, 2024
@tueda
Copy link
Collaborator

tueda commented Nov 7, 2024

Should this check (*e < 0) be in poly::argument_to_poly() or poly::get_variables()?

@jodavies
Copy link
Collaborator Author

jodavies commented Nov 7, 2024

You are right, this check could equally go in get_variables and makes more sense there. I will move it.

@jodavies jodavies changed the title Check for bad terms in fast notation in argument_to_poly Check for bad terms in fast notation in get_variables Nov 7, 2024
Copy link
Collaborator

@tueda tueda left a comment

Choose a reason for hiding this comment

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

Now the code looks fine.

Optionally, the code for triggering the error could be reused with goto, like:

		else if (*e < 0) {
term_too_complicated_error:
			MLOCK(ErrorMessageLock);
			MesPrint("ERROR: polynomials and polyratfuns must contain symbols only");
			MUNLOCK(ErrorMessageLock);
			Terminate(1);
		}
		else {
			for (int i=with_arghead ? ARGHEAD : 0; with_arghead ? i<e[0] : e[i]!=0; i+=e[i]) {
				if (i+1<i+e[i]-ABS(e[i+e[i]-1]) && e[i+1]!=SYMBOL) {
					goto term_too_complicated_error;
				}

@jodavies
Copy link
Collaborator Author

jodavies commented Nov 8, 2024

While here it would probably be fine, other areas of the code have been cumbersome to debug because you have to determine which of many goto have actually caused a termination. In my opinion it could be beneficial to actually remove this pattern from the code entirely, but that requires some effort also...

@vermaseren
Copy link
Collaborator

vermaseren commented Nov 8, 2024 via email

@jodavies
Copy link
Collaborator Author

jodavies commented Nov 8, 2024

When this PR is done #526 , Terminate is replaced with a macro which prints the file and line information of every terminate call.

But still if you have several goto which land at a Terminate, you can't know which goto caused the crash without stepping through in a debugger (hard if the crash is in a long running script with no useful way to set a breakpoint) or putting print statements at each of the goto.

@jodavies jodavies merged commit 3c5b5ce into form-dev:master Nov 11, 2024
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.

Vector in polyratfun vanishes

4 participants