]> www.ginac.de Git - ginac.git/commitdiff
- fixed typos
authorChristian Bauer <Christian.Bauer@uni-mainz.de>
Tue, 5 Jun 2001 15:18:29 +0000 (15:18 +0000)
committerChristian Bauer <Christian.Bauer@uni-mainz.de>
Tue, 5 Jun 2001 15:18:29 +0000 (15:18 +0000)
- c*M^n with M being a matrix wasn't correctly evalm()'d for n!=1

ginac/basic.cpp
ginac/mul.cpp
ginac/wildcard.cpp
ginac/wildcard.h

index 1990ebcba938bd4b5fedf81f1ac74b5724d5729f..16d0dfddafe37419f7e2fe911c1e5afa07cd2579 100644 (file)
@@ -134,7 +134,7 @@ void basic::print(const print_context & c, unsigned level) const
                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.
@@ -146,7 +146,7 @@ void basic::dbgprint(void) const
        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 */
@@ -231,7 +231,7 @@ bool basic::has(const ex & other) const
 }
 
 /** 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();
@@ -366,8 +366,7 @@ ex basic::evalf(int level) const
 /** 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);
@@ -433,7 +432,7 @@ bool basic::match(const ex & pattern, lst & repl_lst) const
 {
 /*
        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?
index cb6794323b8cb96911b40e3dc14d2b125d3edd6e..3dfe48ebd387bcf8a62671a34a82b1d63c4da310 100644 (file)
@@ -408,7 +408,8 @@ ex mul::evalf(int level) const
 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
index 0d782622975ff773c63d5cb1af7875b9cc291c73..528df593f0bbb5528499a28715fc4f669b053aa9 100644 (file)
@@ -116,7 +116,7 @@ unsigned wildcard::calchash(void) const
 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);
 }
index e55788e7b18d257ec7b17bd939892fb564f16d17..2e76e193d3ee4b83f4efe4e8c08744741f8d7bfc 100644 (file)
@@ -28,8 +28,8 @@
 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)