]> www.ginac.de Git - ginac.git/blobdiff - ginac/matrix.cpp
- added find() (like has(), but returns list of all occurrences)
[ginac.git] / ginac / matrix.cpp
index 8d2e0b88b99e9fb7f8e5fb5e374b7c2dfcfd03e8..91382c2fd303612a1899a8f59c7d59b25b478880 100644 (file)
@@ -259,6 +259,16 @@ int matrix::compare_same_type(const basic & other) const
        return 0;
 }
 
+bool matrix::match_same_type(const basic & other) const
+{
+       GINAC_ASSERT(is_exactly_of_type(other, matrix));
+       const matrix & o = static_cast<const matrix &>(other);
+       
+       // The number of rows and columns must be the same. This is necessary to
+       // prevent a 2x3 matrix from matching a 3x2 one.
+       return row == o.rows() && col == o.cols();
+}
+
 /** Automatic symbolic evaluation of an indexed matrix. */
 ex matrix::eval_indexed(const basic & i) const
 {