These are chat archives for symengine/symengine

6th
Jan 2017
Shikhar Jaiswal
@ShikharJ
Jan 06 2017 17:34

I'm having a problem here :

FunctionSymbol::FunctionSymbol(std::string name, const RCP<const Basic> &arg)
    : name_{name}, arg_{{arg}}
{
    SYMENGINE_ASSIGN_TYPEID()
    SYMENGINE_ASSERT(is_canonical(arg_))
}

I didn't quite follow the statement You can have a similar constructor FunctionSymbol. Did you meant creating a constructor similar to FunctionSymbol constructor in MultiArgFunction? or creating a new type of constructor for FunctionSymbol all together? Or am I missing something?

Running make returns:
/home/shikhar/symengine/symengine/functions.cpp: In constructor ‘SymEngine::FunctionSymbol::FunctionSymbol(std::__cxx11::string, const Teuchos::RCP<const SymEngine::Basic>&)’:
/home/shikhar/symengine/symengine/functions.cpp:1261:30: error: no matching function for call to ‘SymEngine::MultiArgFunction::MultiArgFunction()’
     : name_{name}, arg_{{arg}}
                              ^
In file included from /home/shikhar/symengine/symengine/pow.h:9:0,
                 from /home/shikhar/symengine/symengine/polys/upolybase.h:9,
                 from /home/shikhar/symengine/symengine/polys/uintpoly_flint.h:8,
                 from /home/shikhar/symengine/symengine/visitor.h:9,
                 from /home/shikhar/symengine/symengine/functions.cpp:1:
/home/shikhar/symengine/symengine/functions.h:132:5: note: candidate: SymEngine::MultiArgFunction::MultiArgFunction(const vec_basic&)
     MultiArgFunction(const vec_basic &arg) : arg_{arg} {};
     ^
/home/shikhar/symengine/symengine/functions.h:132:5: note:   candidate expects 1 argument, 0 provided
@isuruf
Isuru Fernando
@isuruf
Jan 06 2017 17:36
I meant remove the extra constructor in MultiArgFunction
Shikhar Jaiswal
@ShikharJ
Jan 06 2017 17:38
@isuruf What would be a proper way to pass an RCP<const Basic> object to MultiArgFunction constructor?
Isuru Fernando
@isuruf
Jan 06 2017 17:38
create a vector and pass it
or just pass, {arg}
Shikhar Jaiswal
@ShikharJ
Jan 06 2017 17:39
That wouldn't work inside std::move() I guess.
Isuru Fernando
@isuruf
Jan 06 2017 17:42
you don't need std::move to pass a rvalue.
Shikhar Jaiswal
@ShikharJ
Jan 06 2017 17:43
Thanks, I'll update the PR and give you an update.