22 #ifndef ASTSHIM_MATHMAP_H
23 #define ASTSHIM_MATHMAP_H
27 #include "astshim/base.h"
28 #include "astshim/Mapping.h"
375 MathMap(
int nin,
int nout, std::vector<std::string>
const &fwd, std::vector<std::string>
const &rev,
376 std::string
const &options =
"")
377 :
Mapping(reinterpret_cast<AstMapping *>(astMathMap(nin, nout, fwd.size(), getCStrVec(fwd).data(),
378 rev.size(), getCStrVec(rev).data(),
"%s",
379 options.c_str()))) {}
408 return copyImpl<MathMap, AstMathMap>();
412 explicit MathMap(AstMathMap *rawptr) :
Mapping(reinterpret_cast<AstMapping *>(rawptr)) {
414 std::ostringstream os;
415 os <<
"this is a " <<
getClassName() <<
", which is not a MathMap";
416 throw std::invalid_argument(os.str());
422 std::vector<char const *> getCStrVec(std::vector<std::string>
const &strVec) {
423 std::vector<char const *> cstrVec;
424 for (
auto const &str : strVec) {
425 cstrVec.push_back(str.c_str());
std::shared_ptr< MathMap > copy() const
Return a deep copy of this object.
Definition: MathMap.h:389
int getSeed() const
Definition: MathMap.h:394
bool getB(std::string const &attrib) const
Definition: Object.h:347
AstObject const * getRawPtr() const
Definition: Object.h:286
MathMap(AstMathMap *rawptr)
Construct a MathMap from a raw AST pointer.
Definition: MathMap.h:412
virtual std::shared_ptr< Object > copyPolymorphic() const override
Definition: MathMap.h:407
bool getSimpIF() const
Definition: MathMap.h:404
int getI(std::string const &attrib) const
Definition: Object.h:399
MathMap(int nin, int nout, std::vector< std::string > const &fwd, std::vector< std::string > const &rev, std::string const &options="")
Definition: MathMap.h:375
std::string getClassName() const
Definition: Object.h:133
bool getSimpFI() const
Definition: MathMap.h:399