22 #ifndef ASTSHIM_MATRIXMAP_H 23 #define ASTSHIM_MATRIXMAP_H 30 #include "astshim/base.h" 31 #include "astshim/Mapping.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()))) {}
88 return copyImpl<MatrixMap, AstMatrixMap>();
92 explicit MatrixMap(AstMatrixMap *rawptr) :
Mapping(reinterpret_cast<AstMapping *>(rawptr)) {
94 std::ostringstream os;
95 os <<
"this is a " <<
getClassName() <<
", which is not a MatrixMap";
96 throw std::invalid_argument(os.str());
ndarray::Array< const double, 2, 2 > ConstArray2D
Definition: base.h:46
AstObject const * getRawPtr() const
Definition: Object.h:289
Definition: MatrixMap.h:42
AST wrapper classes and functions.
Definition: attributes_channel.dox:1
std::string getClassName() const
Definition: Object.h:136
virtual std::shared_ptr< Object > copyPolymorphic() const override
Definition: MatrixMap.h:87
MatrixMap(AstMatrixMap *rawptr)
Construct a MatrixMap from a raw AST pointer.
Definition: MatrixMap.h:92
std::shared_ptr< MatrixMap > copy() const
Return a deep copy of this object.
Definition: MatrixMap.h:84
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