22 #ifndef ASTSHIM_MATRIXMAP_H
23 #define ASTSHIM_MATRIXMAP_H
30 #include "astshim/base.h"
31 #include "astshim/Mapping.h"
56 explicit MatrixMap(ndarray::Array<double, 2, 2>
const &matrix, std::string
const &options =
"")
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()))) {}
84 std::shared_ptr<MatrixMap>
copy()
const {
90 return copyImpl<MatrixMap, AstMatrixMap>();
94 explicit MatrixMap(AstMatrixMap *rawptr) :
Mapping(reinterpret_cast<AstMapping *>(rawptr)) {
96 std::ostringstream os;
97 os <<
"this is a " <<
getClassName() <<
", which is not a MatrixMap";
98 throw std::invalid_argument(os.str());
Definition: MatrixMap.h:42
std::shared_ptr< MatrixMap > copy() const
Return a deep copy of this object.
Definition: MatrixMap.h:84
AstObject const * getRawPtr() const
Definition: Object.h:286
virtual std::shared_ptr< Object > copyPolymorphic() const override
Definition: MatrixMap.h:89
MatrixMap(AstMatrixMap *rawptr)
Construct a MatrixMap from a raw AST pointer.
Definition: MatrixMap.h:94
MatrixMap(ndarray::Array< double, 2, 2 > const &matrix, std::string const &options="")
Definition: MatrixMap.h:56
std::string getClassName() const
Definition: Object.h:133
MatrixMap(std::vector< double > const &diag, std::string const &options="")
Definition: MatrixMap.h:71