c.s << "[" << class_name() << " object]";
}
-/** Little wrapper arount print to be called within a debugger.
+/** Little wrapper around print to be called within a debugger.
* This is needed because you cannot call foo.print(cout) from within the
* debugger because it might not know what cout is. This method can be
* invoked with no argument and it will simply print to stdout.
std::cerr << std::endl;
}
-/** Little wrapper arount printtree to be called within a debugger.
+/** Little wrapper around printtree to be called within a debugger.
*
* @see basic::dbgprint
* @see basic::printtree */
}
/** Construct new expression by applying the specified function to all
- * sub-expressions. */
+ * sub-expressions (one level only, not recursively). */
ex basic::map(map_func f) const
{
unsigned num = nops();
/** Evaluate sums and products of matrices. */
ex basic::evalm(void) const
{
- unsigned num = nops();
- if (num == 0)
+ if (nops() == 0)
return *this;
else
return map(GiNaC::evalm);
{
/*
Sweet sweet shapes, sweet sweet shapes,
- Thats the key thing, right right.
+ That's the key thing, right right.
Feed feed face, feed feed shapes,
But who is the king tonight?
Who is the king tonight?
ex mul::evalm(void) const
{
// numeric*matrix
- if (seq.size() == 1 && is_ex_of_type(seq[0].rest, matrix))
+ if (seq.size() == 1 && seq[0].coeff.is_equal(_ex1())
+ && is_ex_of_type(seq[0].rest, matrix))
return ex_to_matrix(seq[0].rest).mul(ex_to_numeric(overall_coeff));
// Evaluate children first, look whether there are any matrices at all
bool wildcard::match(const ex & pattern, lst & repl_lst) const
{
// Wildcards must match exactly (this is required for subs() to work
- // properly because in the final step it substitues all wildcards by
+ // properly because in the final step it substitutes all wildcards by
// their matching expressions)
return is_equal(*pattern.bp);
}
namespace GiNaC {
-/** This class acts as a wildcard for subs() and matches(). An integer label
- * is used to identify different wildcards. */
+/** This class acts as a wildcard for subs(), match() and has(). An integer
+ * label is used to identify different wildcards. */
class wildcard : public basic
{
GINAC_DECLARE_REGISTERED_CLASS(wildcard, basic)