25 #include <opencog/atomspace/atom_types.h>
31 using namespace opencog;
36 :
FoldLink(ARITHMETIC_LINK, oset, tv, av)
47 throw InvalidParamException(TRACE_INFO,
"Expecting a ArithmeticLink");
57 throw InvalidParamException(TRACE_INFO,
"Expecting a ArithmeticLink");
66 throw InvalidParamException(TRACE_INFO,
"Expecting a ArithmeticLink");
72 knild = std::numeric_limits<double>::quiet_NaN();
95 if (NULL == alp)
return red;
96 return alp->reorder();
121 if (h->getType() == VARIABLE_NODE)
123 else if (h->getType() == NUMBER_NODE)
124 numbers.push_back(h);
130 for (
const Handle& h : vars) result.push_back(h);
131 for (
const Handle& h : exprs) result.push_back(h);
132 for (
const Handle& h : numbers) result.push_back(h);
152 throw RuntimeException(TRACE_INFO,
153 "Expecting a NumberNode, got %s",
156 return nnn->get_value();
164 #ifdef CIRCULAR_SHARED_LIBS
170 #ifdef CIRCULAR_SHARED_LIBS
178 if (NULL == flp and
classserver().isA(h->getType(), FUNCTION_LINK))
ArithmeticLink(Type, const HandleSeq &oset, TruthValuePtr tv=TruthValue::NULL_TV(), AttentionValuePtr av=AttentionValue::DEFAULT_AV())
AtomSpace * getAtomSpace(void)
std::vector< Handle > HandleSeq
a list of handles
static LinkPtr factory(LinkPtr)
std::shared_ptr< TruthValue > TruthValuePtr
virtual Handle execute(AtomSpace *as) const
std::shared_ptr< AttentionValue > AttentionValuePtr
static double get_double(AtomSpace *as, Handle h)
std::shared_ptr< FunctionLink > FunctionLinkPtr
ClassServer & classserver(ClassServerFactory *=ClassServer::createInstance)
std::shared_ptr< NumberNode > NumberNodePtr
std::shared_ptr< ArithmeticLink > ArithmeticLinkPtr
static FunctionLinkPtr FunctionLinkCast(const Handle &h)
virtual Handle reorder(void)
virtual double konsd(double, double) const =0
static LinkPtr LinkCast(const Handle &h)
virtual Handle reduce(void)
static NumberNodePtr NumberNodeCast(const Handle &h)
Handle execute(const Handle &expr)
unsigned short Type
type of Atoms, represented as short integer (16 bits)
static ArithmeticLinkPtr ArithmeticLinkCast(const Handle &h)
Handle add_atom(AtomPtr atom, bool async=false)