[GiNaC-devel] Simplifying powers
Alexei Sheplyakov
alexei.sheplyakov at gmail.com
Tue Jul 30 12:09:32 CEST 2013
Hi,
On Mon, Jul 29, 2013 at 10:41:01PM +0100, Vladimir V. Kisil wrote:
> Subject: [PATCH 3/3] Add an expansion law in power::expand(). The expansion
> (x*p)^c -> x^c*p^c is done for a positive expression p
> and a real exponent c. The corresponding check is added
> to exam_powerlaws.
>
> diff --git a/ginac/flags.h b/ginac/flags.h
> index 8f8f25d..f4f0f6b 100644
> --- a/ginac/flags.h
> +++ b/ginac/flags.h
> @@ -197,6 +197,9 @@ public:
> not_shareable = 0x0010, ///< don't share instances of this object between different expressions unless explicitly asked to (used by ex::compare())
> has_indices = 0x0020,
> has_no_indices = 0x0040 // ! (has_indices || has_no_indices) means "don't know"
> + is_positive = 0x0080,
> + is_negative = 0x0100,
> + purely_indefinite = 0x0200, // If set in a mul, then it does not contains any terms with determined signs, used in power::expand()
> };
> };
The `purely_idefinite' flag is redundant (that is !(is_positive || is_negative)
is equivalent to purely_indefinite). Also status_flags is quite a scarce
resource (there are only 32 of them). Could you please skip that flag?
Best regards,
Alexei
More information about the GiNaC-devel
mailing list