From f1bae4835614a7141379898afa3ed9cc9aa0d590 Mon Sep 17 00:00:00 2001 From: Hassan Date: Thu, 9 Nov 2023 13:26:55 -0700 Subject: [PATCH] fixed bug in func type simplification in integer polynomes --- include/gravity/func.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/gravity/func.h b/include/gravity/func.h index 99b2d3bb..ab35d538 100755 --- a/include/gravity/func.h +++ b/include/gravity/func.h @@ -8179,16 +8179,28 @@ namespace gravity { auto pt = simplified->front(); if(pt.second==1){ _ftype = initial_ftype; + if(_pterms->size()==1 && !_qterms && !_expr) + _ftype = lin_; this->insert(sign, coef, *pt.first); return false; } if(pt.second==2){ _ftype = initial_ftype; + if(_pterms->size()==1 && !_expr) + _ftype = quad_; this->insert(sign, coef, *pt.first, *pt.first); return false; } } + if(simplified->size()==2 && simplified->front().second==1 && simplified->back().second==1){ + _ftype = initial_ftype; + if(_pterms->size()==1 && !_expr) + _ftype = quad_; + this->insert(sign, coef, *simplified->front().first, *simplified->back().first); + return false; + } newl = simplified; + newv = false; break; }