22 #ifndef ASTSHIM_MATHMAP_H
23 #define ASTSHIM_MATHMAP_H
27 #include "astshim/base.h"
28 #include "astshim/Mapping.h"
374 MathMap(
int nin,
int nout, std::vector<std::string>
const & fwd,
375 std::vector<std::string>
const & rev, std::string
const & options=
"") :
376 Mapping(reinterpret_cast<AstMapping *>(
377 astMathMap(nin, nout,
378 fwd.size(), getCStrVec(fwd).data(),
379 rev.size(), getCStrVec(rev).data(), options.c_str())))
390 std::shared_ptr<MathMap>
copy()
const {
411 return _copyImpl<MathMap, AstMathMap>();
416 Mapping(reinterpret_cast<AstMapping *>(rawptr))
419 std::ostringstream os;
420 os <<
"this is a " <<
getClass() <<
", which is not a MathMap";
421 throw std::invalid_argument(os.str());
427 std::vector<char const *> getCStrVec(std::vector<std::string>
const & strVec) {
428 std::vector<char const *> cstrVec;
429 for (
auto const & str : strVec) {
430 cstrVec.push_back(str.c_str());
virtual std::shared_ptr< Object > _copyPolymorphic() const override
Definition: MathMap.h:410
MathMap(AstMathMap *rawptr)
Construct a MathMap from a raw AST pointer.
Definition: MathMap.h:415
bool getSimpFI() const
Definition: MathMap.h:402
std::string getClass() const
Definition: Object.h:117
MathMap(int nin, int nout, std::vector< std::string > const &fwd, std::vector< std::string > const &rev, std::string const &options="")
Definition: MathMap.h:374
bool getSimpIF() const
Definition: MathMap.h:407
int getSeed() const
Definition: MathMap.h:397
int getI(std::string const &attrib) const
Definition: Object.h:386
bool getB(std::string const &attrib) const
Definition: Object.h:334
AstObject const * getRawPtr() const
Definition: Object.h:260
std::shared_ptr< MathMap > copy() const
Return a deep copy of this object.
Definition: MathMap.h:390