1#ifndef CPPAD_CG_VARIABLE_INCLUDED
2#define CPPAD_CG_VARIABLE_INCLUDED
24 return node_->getCodeHandler();
31 return node_ !=
nullptr;
36 return node_ ==
nullptr;
41 return value_ !=
nullptr;
46 if (!isValueDefined()) {
47 throw CGException(
"No value defined for this variable");
55 if (value_ !=
nullptr) {
58 value_.reset(
new Base(b));
68inline bool CG<Base>::isIdenticalOne()
const {
73inline void CG<Base>::makeParameter(
const Base &b) {
79inline void CG<Base>::makeVariable(OperationNode<Base>& operation) {
85inline void CG<Base>::makeVariable(OperationNode<Base>& operation,
86 std::unique_ptr<Base>& value) {
88 value_ = std::move(value);
92inline OperationNode<Base>* CG<Base>::getOperationNode()
const {
void setValue(const Base &val)
const Base & getValue() const
bool isValueDefined() const
CodeHandler< Base > * getCodeHandler() const
bool IdenticalOne(const cg::CG< Base > &x)
bool IdenticalZero(const cg::CG< Base > &x)