1#ifndef CPPAD_CG_GRAPH_MOD_INCLUDED
2#define CPPAD_CG_GRAPH_MOD_INCLUDED
39 size_t pos =
dep.getHandlerPosition();
40 if (
pos >= _codeBlocks.size() || &
dep != _codeBlocks[
pos]) {
41 throw CGException(
"The dependent variable does not belong to this handler");
60 _independentVariables.erase(_independentVariables.begin() +
indepIndex);
66 typename std::vector<OperationNode<Base> *>::const_iterator
it =
67 std::find(_independentVariables.begin(), _independentVariables.end(), &
indep);
68 if (
it == _independentVariables.end()) {
69 throw CGException(
"Variable not found in the independent variable vector");
72 indep.setOperation(CGOpCode::Inv);
77 if (
indep.getOperationType() != CGOpCode::Alias) {
78 throw CGException(
"Cannot remove independent variable: not an alias");
81 typename std::vector<OperationNode<Base> *>::iterator
it =
82 std::find(_independentVariables.begin(), _independentVariables.end(), &
indep);
83 if (
it == _independentVariables.end()) {
84 throw CGException(
"Variable not found in the independent variable vector");
86 _independentVariables.erase(
it);
void removeIndependent(Node &indep)
void substituteIndependent(const CGB &indep, const CGB &dep, bool removeFromIndeps=true)
void undoSubstituteIndependent(Node &indep)
bool GreaterThanZero(const cg::CG< Base > &x)