|
| 1 | + |
| 2 | +(** This file is part of RAGlib (Real Algebraic Geometry Library). |
| 3 | + * |
| 4 | + * RAGlib is free software: you can redistribute it and/or modify |
| 5 | + * it under the terms of the GNU General Public License as published by |
| 6 | + * the Free Software Foundation, either version 2 of the License, or |
| 7 | + * (at your option) any later version. |
| 8 | + * |
| 9 | + * RAGlib is distributed in the hope that it will be useful, |
| 10 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | + * GNU General Public License for more details. |
| 13 | + * |
| 14 | + * You should have received a copy of the GNU General Public License |
| 15 | + * along with RAGlib. If not, see <https://www.gnu.org/licenses/> |
| 16 | + * |
| 17 | + * Authors: |
| 18 | + * Mohab Safey El Din **) |
| 19 | + |
| 20 | +#Exported functions of RAGlib |
| 21 | + |
| 22 | +HasRealSolutions:=proc(eqs, pos, ineqs, opts:={}) |
| 23 | +local isempty, _l, newopts; |
| 24 | + |
| 25 | + if type(subs(opts, "isempty"), integer) then |
| 26 | + isempty:=subs(opts, "isempty"); |
| 27 | + else |
| 28 | + isempty:=0: |
| 29 | + end if; |
| 30 | + |
| 31 | + if isempty = 0 then |
| 32 | + return SemiAlgebraicSolve(eqs, pos, ineqs, opts union {"isempty"=1}); |
| 33 | + else |
| 34 | + newopts:=map(_l->if lhs(_l)="isempty" then lhs(_l)=1 else _l fi, opts); |
| 35 | + return SemiAlgebraicSolve(eqs, pos, ineqs, newopts); |
| 36 | + end if; |
| 37 | +end proc: |
| 38 | + |
| 39 | +PointsPerComponents:=proc(eqs, pos, ineqs, opts:={}) |
| 40 | +local isempty, _l, newopts; |
| 41 | + |
| 42 | + if type(subs(opts, "isempty"), integer) then |
| 43 | + isempty:=subs(opts, "isempty"); |
| 44 | + else |
| 45 | + isempty:=0: |
| 46 | + end if; |
| 47 | + |
| 48 | + if isempty = 0 then |
| 49 | + return SemiAlgebraicSolve(eqs, pos, ineqs, opts); |
| 50 | + else |
| 51 | + newopts:=map(_l->if lhs(_l)="isempty" then lhs(_l)=0 else _l fi, opts); |
| 52 | + return SemiAlgebraicSolve(eqs, pos, ineqs, newopts); |
| 53 | + end if; |
| 54 | +end proc: |
0 commit comments