Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions check/features.frm
Original file line number Diff line number Diff line change
Expand Up @@ -2509,3 +2509,60 @@ TableBase "no212.tbl" open, readonly;
.end
assert runtime_error?('Trying to open non-existent TableBase in readonly mode: no212.tbl')
*--#] tablebase_ro_2 :
*--#[ Dimension_1 :
#-
Off Statistics;

Symbol m{d=1},m2{d=2},s{d=2},t{d=2},sqrts{d=1};

#define DIM "4"
Local test1 = (m^2 + m2 + s + t)^{`DIM'/2};
Local test2 = test1;
.sort
Hide test2;

* Set s = 1 WLOG
Identify s = 1;

* Do some work

* Restore s dependence
$dim = dimension_;
Multiply s^((`DIM'-$dim)/2);
ModuleOption,local $dim;
.sort

Drop;
Local diff = test1 - test2;
Print +s;
.end
assert succeeded?
assert result("diff") =~ expr("0")
*--#] Dimension_1 :
*--#[ Dimension_2 :
#-
Off Statistics;

Symbol m{d=1},s{d=2},t{d=2};
CFunction f;

* Oops! Forgot the ^2
Local test = f(m + s + t);
.sort

ArgToExtraSymbol f;
Identify f(m?) = f(m);
Argument f;
FromPolynomial;
EndArgument;

Print +s;
.end
assert succeeded?
assert stdout =~ exact_pattern(<<'EOF')
Dimension is not the same in the terms of the expression
t
s
m
EOF
*--#] Dimension_2 :
3 changes: 2 additions & 1 deletion sources/reshuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ WORD DimensionExpression(PHEAD WORD *expr)
dim = DimensionTerm(term);
if ( dim == MAXPOSITIVE ) goto undefined;
if ( dim == -MAXPOSITIVE ) goto outofrange;
if ( first ) { x = dim; }
if ( first ) { x = dim; first = 0; }
else if ( x != dim ) {
old = AN.currentTerm;
MLOCK(ErrorMessageLock);
Expand All @@ -1015,6 +1015,7 @@ WORD DimensionExpression(PHEAD WORD *expr)
while ( *term ) {
AN.currentTerm = term;
MesPrint(" %T");
term += *term;
}
MUNLOCK(ErrorMessageLock);
AN.currentTerm = old;
Expand Down
Loading