2 #include <symengine/assumptions.h>
4 #include <symengine/test_visitors.h>
17 : assumptions_(assumptions)
21 void bvisit(
const Basic &x){};
24 is_toeplitz_ = tribool::indeterminate;
29 is_toeplitz_ = tribool::tritrue;
34 is_toeplitz_ = tribool::tritrue;
39 tribool current = tribool::tritrue;
40 auto vec = x.get_container();
41 if (vec.size() == 1) {
42 is_toeplitz_ = tribool::tritrue;
46 for (
auto it = vec.begin() + 1; it != vec.end(); ++it) {
47 auto diff =
sub(first, *it);
48 tribool next = is_zero(*diff, assumptions_);
53 current = andwk_tribool(current, next);
55 is_toeplitz_ = current;
60 size_t i_start, j_start, i, j;
62 is_toeplitz_ = tribool::tritrue;
64 for (
size_t w = 0; w <
std::max(x.nrows(), x.ncols()) - 1; w++) {
67 for (
size_t k = 0; k < 2; k++) {
68 if (k == 0 && w <= x.ncols()) {
71 }
else if (k == 1 && w <= x.nrows() && w != 0) {
77 auto first = x.get(i_start, j_start);
79 for (i = i_start + 1, j = j_start + 1;
80 i < x.nrows() && j < x.ncols(); i++, j++) {
81 is_toeplitz_ = and_tribool(
82 is_toeplitz_, visitor.apply(*
sub(first, x.get(i, j))));
83 if (is_false(is_toeplitz_)) {
101 return visitor.apply(m);
The base class for SymEngine.
The lowest unit of symbolic representation.
Main namespace for SymEngine package.
RCP< const Basic > sub(const RCP< const Basic > &a, const RCP< const Basic > &b)
Substracts b from a.