1#ifndef CPPAD_CG_CG_INCLUDED
2#define CPPAD_CG_CG_INCLUDED
40 std::unique_ptr<Base> value_;
80 inline CG(
const Base& val);
139 inline bool isIdenticalZero()
const;
140 inline bool isIdenticalOne()
const;
149 inline CG<Base>& operator+=(
const Base& right);
150 inline CG<Base>& operator-=(
const Base& right);
151 inline CG<Base>& operator*=(
const Base& right);
152 inline CG<Base>& operator/=(
const Base& right);
155 inline CG<Base>& operator+=(
const T &right);
157 inline CG<Base>& operator-=(
const T &right);
159 inline CG<Base>& operator/=(
const T &right);
161 inline CG<Base>& operator*=(
const T &right);
176 inline void makeParameter(
const Base& b);
181 std::unique_ptr<Base>& value);
192 friend class Loop<Base>;
207 friend bool GreaterThanOrZero <Base> (
const CG<Base>& x);
208 friend bool LessThanZero <Base> (
const CG<Base>& x);
209 friend bool LessThanOrZero <Base> (
const CG<Base>& x);
216 friend bool NearEqual <Base> (
const CG<Base>& x,
const CG<Base>& y,
const Base& r,
const Base& a);
217 friend bool NearEqual <Base> (
const Base& x,
const CG<Base>& y,
const Base& r,
const Base& a);
218 friend bool NearEqual <Base> (
const CG<Base>& x,
const Base& y,
const Base& r,
const Base& a);
226 bool (*compare)(
const Base&,
const Base&));
249#if CPPAD_USE_CPLUSPLUS_2011
270 static thread_local std::function<std::ostream& (std::ostream&,
const CG<Base>&)> FUNC;
274thread_local std::function<std::ostream& (std::ostream&,
const CG<Base>&)> CGOStreamFunc<Base>::FUNC =
nullptr;
281inline std::ostream& operator<<(
285 if(CGOStreamFunc<Base>::FUNC !=
nullptr) {
286 return CGOStreamFunc<Base>::FUNC(os, v);
292 os << *v.getOperationNode();
301inline std::ostringstream& operator<<(
302 std::ostringstream& os,
305 if (v.isParameter()) {
308 os << *v.getOperationNode();
309 if (v.isValueDefined()) {
310 os <<
" (" << v.getValue() <<
")";
317inline std::istream& operator>>(
330int Integer(
const CppAD::cg::CG<Base>& x) {
334 CppAD::ErrorHandler::Call(
false, __LINE__, __FILE__,
"Integer()",
"No value defined");
friend CG< Base > sign(const CG< Base > &x)
CG & operator=(CG< Base > &&rhs)
CG & operator=(const Base &rhs)
void setValue(const Base &val)
CG & operator=(const CG< Base > &rhs)
CG(const Argument< Base > &arg)
const Base & getValue() const
bool isValueDefined() const
CG(OperationNode< Base > &node)
CodeHandler< Base > * getCodeHandler() const
friend bool GreaterThanZero(const CG< Base > &x)
friend CG< Base > pow(const CG< Base > &x, const CG< Base > &y)
CG(const CG< Base > &orig)
friend CG< Base > CondExp(CGOpCode op, const CG< Base > &left, const CG< Base > &right, const CG< Base > &trueCase, const CG< Base > &falseCase, bool(*compare)(const Base &, const Base &))