22 #ifndef ASTSHIM_MATRIXMAP_H 23 #define ASTSHIM_MATRIXMAP_H 57 :
Mapping(reinterpret_cast<AstMapping *>(
59 astMatrixMap(matrix.getSize<1>(), matrix.getSize<0>(), 0, matrix.getData(),
"%s",
71 explicit MatrixMap(std::vector<double>
const &diag, std::string
const &options =
"")
72 :
Mapping(reinterpret_cast<AstMapping *>(
74 astMatrixMap(diag.size(), diag.size(), 1, diag.data(),
"%s", options.c_str()))) {}
89 return copyImpl<MatrixMap, AstMatrixMap>();
93 explicit MatrixMap(AstMatrixMap *rawptr) :
Mapping(reinterpret_cast<AstMapping *>(rawptr)) {
95 std::ostringstream os;
96 os <<
"this is a " <<
getClassName() <<
", which is not a MatrixMap";
97 throw std::invalid_argument(os.str());
ndarray::Array< const double, 2, 2 > ConstArray2D
Definition: base.h:46
AstObject const * getRawPtr() const
Definition: Object.h:291
Definition: MatrixMap.h:42
AST wrapper classes and functions.
Definition: attributes_channel.dox:1
std::string getClassName() const
Definition: Object.h:138
virtual std::shared_ptr< Object > copyPolymorphic() const override
Definition: MatrixMap.h:88
MatrixMap(AstMatrixMap *rawptr)
Construct a MatrixMap from a raw AST pointer.
Definition: MatrixMap.h:93
MatrixMap & operator=(MatrixMap const &)=delete
virtual ~MatrixMap()
Definition: MatrixMap.h:76
std::shared_ptr< MatrixMap > copy() const
Return a deep copy of this object.
Definition: MatrixMap.h:85
MatrixMap(std::vector< double > const &diag, std::string const &options="")
Definition: MatrixMap.h:71
MatrixMap(ConstArray2D const &matrix, std::string const &options="")
Definition: MatrixMap.h:56