26 for (
size_t i = 0; i < nx; i++)
80 const size_t size = elements.size();
81 std::string parameterValue;
83 for (
size_t i = 1; i <= size; i++) {
84 std::stringstream sstream;
85 sstream << elements[i - 1];
86 parameterValue.append(sstream.str());
90 parameterValue.append(
";");
93 parameterValue.append(
",");
123 if ((other.m_affineMatrix.numCols() != this->m_affineMatrix.numCols()) ||
124 (other.m_affineMatrix.numRows() != this->m_affineMatrix.numRows())) {
125 throw std::runtime_error(
"Cannot make assignemnts between "
126 "AffineMatrixParameter when the matrixes are of "
129 if (
this != &other) {
142 : m_affineMatrix(other.m_affineMatrix) {
148 for (
size_t i = 0; i < nx; i++)
159 if (newMatrix.
numRows() != this->m_affineMatrix.numRows())
160 throw std::runtime_error(
"setMatrix(): Number of rows must match!");
161 if (newMatrix.
numCols() != this->m_affineMatrix.numCols())
162 throw std::runtime_error(
"setMatrix(): Number of columns must match!");
std::string parameterXMLTemplate(const std::string &valueXMLtext) const
Type to wrap an affine matrix and allow serialization via xml.
AffineMatrixParameter & operator=(const AffineMatrixParameter &other)
Assignment operator.
std::string getName() const override
Get the name of the parameter.
bool isValid() const override
Getter for the valid status.
void copyRawMatrix()
Copy elements from affinematrix into raw array.
coord_t ** m_rawMatrix
Raw matrix used for speed (array of pointers to columns).
coord_t * m_rawMem
pointer to large memory block (matrix)
AffineMatrixType m_affineMatrix
Affine matrix.
AffineMatrixType getAffineMatrix() const
Gets copy of internal affine matrix.
std::string toXMLString() const override
Serialize the Affine Matrix Parameter.
~AffineMatrixParameter() override
Destructor.
static std::string parameterName()
Gets the type parameter name.
AffineMatrixParameter * clone() const override
Clone the parameter.
coord_t ** getRawMatrix()
Get the matrix in its raw array form.
AffineMatrixParameter(size_t outD, size_t inD)
Constructor.
void setMatrix(const AffineMatrixType &newMatrix)
Setter for the internal affine matrix.
void identityMatrix()
Makes the matrix an idenity matrix.
std::vector< T > getVector() const
size_t numRows() const
Return the number of rows in the matrix.
size_t numCols() const
Return the number of columns in the matrix.
float coord_t
Typedef for the data type to use for coordinate axes in MD objects such as MDBox, MDEventWorkspace,...