Skip to content

Commit

Permalink
Merge pull request #100 from lsst/tickets/DM-3549
Browse files Browse the repository at this point in the history
afw/DM-3549: transform features in support of new astrometry fitter
  • Loading branch information
TallJimbo committed Oct 26, 2016
2 parents bf6e0bc + a186269 commit 777a146
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
26 changes: 25 additions & 1 deletion include/lsst/afw/geom/AffineTransform.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class AffineTransform {
) : _linear(linear), _translation(translation) {}

/** Construct an AffineTransform from a LinearTransform. */
explicit AffineTransform(LinearTransform const & linear)
AffineTransform(LinearTransform const & linear)
: _linear(linear), _translation() {}

/** Construct a translation-only AffineTransform from an Extent2D. */
Expand Down Expand Up @@ -180,6 +180,30 @@ class AffineTransform {
return *this;
}

AffineTransform & operator+=(AffineTransform const & other) {
_linear += other._linear;
_translation += other._translation;
return *this;
}

AffineTransform operator+(AffineTransform const & other) {
AffineTransform tmp(*this);
tmp += other;
return tmp;
}

AffineTransform & operator-=(AffineTransform const & other) {
_linear -= other._linear;
_translation -= other._translation;
return *this;
}

AffineTransform operator-(AffineTransform const & other) {
AffineTransform tmp(*this);
tmp -= other;
return tmp;
}

/**
* \brief Construct a new AffineTransform that represents a uniform scaling.
*
Expand Down
23 changes: 22 additions & 1 deletion include/lsst/afw/geom/LinearTransform.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,28 @@ class LinearTransform {
return *this;
}

LinearTransform & operator+=(LinearTransform const & other) {
_matrix += other._matrix;
return *this;
}

LinearTransform operator+(LinearTransform const & other) {
LinearTransform tmp(*this);
tmp += other;
return tmp;
}

LinearTransform & operator-=(LinearTransform const & other) {
_matrix -= other._matrix;
return *this;
}

LinearTransform operator-(LinearTransform const & other) {
LinearTransform tmp(*this);
tmp -= other;
return tmp;
}

ParameterVector const getParameterVector() const;
void setParameterVector(ParameterVector const & vector);

Expand All @@ -116,7 +138,6 @@ class LinearTransform {
return const_cast<Matrix&>(_matrix)(i % 2, i / 2);
}


LinearTransform const invert() const;

double computeDeterminant() const;
Expand Down

0 comments on commit 777a146

Please sign in to comment.