bool GetNonzerosSlice2::isEqual(const MXNode* node, int depth) const { // Check dependencies if (!sameOpAndDeps(node, depth)) return false; // Check if same node const GetNonzerosSlice2* n = dynamic_cast<const GetNonzerosSlice2*>(node); if (n==0) return false; // Check sparsity if (this->sparsity()!=node->sparsity()) return false; // Check indices if (this->inner_ != n->inner_ || this->outer_!=n->outer_) return false; return true; }
bool GetNonzerosVector::isEqual(const MXNode* node, int depth) const { // Check dependencies if (!sameOpAndDeps(node, depth)) return false; // Check if same node const GetNonzerosVector* n = dynamic_cast<const GetNonzerosVector*>(node); if (n==0) return false; // Check sparsity if (this->sparsity()!=node->sparsity()) return false; // Check indices if (this->nz_.size()!=n->nz_.size()) return false; if (!std::equal(this->nz_.begin(), this->nz_.end(), n->nz_.begin())) return false; return true; }
/** \brief Check if two nodes are equivalent up to a given depth */ virtual bool isEqual(const MXNode* node, int depth) const { return sameOpAndDeps(node, depth);}
/** \brief Check if two nodes are equivalent up to a given depth */ bool is_equal(const MXNode* node, casadi_int depth) const override { return sameOpAndDeps(node, depth); }
/** \brief Check if two nodes are equivalent up to a given depth */ virtual bool is_equal(const MXNode* node, int depth) const { return sameOpAndDeps(node, depth) && dynamic_cast<const Multiplication*>(node)!=0; }
/** \brief Check if two nodes are equivalent up to a given depth */ virtual bool zz_isEqual(const MXNode* node, int depth) const { return sameOpAndDeps(node, depth) && sparsity()==node->sparsity();}
/** \brief Check if two nodes are equivalent up to a given depth */ bool is_equal(const MXNode* node, casadi_int depth) const override { return sameOpAndDeps(node, depth) && dynamic_cast<const Einstein*>(node)!=nullptr; }