From 2c9eca6dcf983bbca109ed386d548504f3cdfff4 Mon Sep 17 00:00:00 2001 From: Christian Bauer Date: Tue, 19 Jun 2001 19:50:14 +0000 Subject: [PATCH] added decomp_rational() --- ginsh/ginsh.1.in | 3 +++ ginsh/ginsh_parser.yy | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/ginsh/ginsh.1.in b/ginsh/ginsh.1.in index becefecf..e8c24a50 100644 --- a/ginsh/ginsh.1.in +++ b/ginsh/ginsh.1.in @@ -246,6 +246,9 @@ detail here. Please refer to the GiNaC documentation. .BI content( expression ", " symbol ) \- content part of a polynomial .br +.BI decomp_rational( expression ", " symbol ) +\- decompose rational function into polynomial and proper rational function +.br .BI degree( expression ", " object ) \- degree of a polynomial .br diff --git a/ginsh/ginsh_parser.yy b/ginsh/ginsh_parser.yy index be3f6862..2e514778 100644 --- a/ginsh/ginsh_parser.yy +++ b/ginsh/ginsh_parser.yy @@ -319,6 +319,12 @@ static ex f_content(const exprseq &e) return e[0].content(ex_to(e[1])); } +static ex f_decomp_rational(const exprseq &e) +{ + CHECK_ARG(1, symbol, decomp_rational); + return decomp_rational(e[0], ex_to(e[1])); +} + static ex f_determinant(const exprseq &e) { CHECK_ARG(0, matrix, determinant); @@ -489,6 +495,7 @@ static const fcn_init builtin_fcns[] = { {"collect", fcn_desc(f_collect, 2)}, {"collect_distributed", fcn_desc(f_collect_distributed, 2)}, {"content", fcn_desc(f_content, 2)}, + {"decomp_rational", fcn_desc(f_decomp_rational, 2)}, {"degree", fcn_desc(f_degree, 2)}, {"denom", fcn_desc(f_denom, 1)}, {"determinant", fcn_desc(f_determinant, 1)}, -- 2.44.0