Skip to content

Commit

Permalink
Merge pull request #19 from lsst/tickets/DM-14725
Browse files Browse the repository at this point in the history
DM-14725: Eliminate explicit use of ndarray::EigenView in C++ code
  • Loading branch information
r-owen committed Jun 8, 2018
2 parents e6e5c2d + f253b77 commit 915046d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/ConversionMatrix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ void ConversionMatrix::multiplyOnLeft(
} else {
i = ConversionSingleton::get().getL2H().begin();
}
ndarray::EigenView<double,1,0> vector(array);
auto vector = array.asEigen();
for (int offset = 0; offset < vector.size(); ++i) {
vector.segment(offset, i->rows()).transpose() *= i->transpose();
offset += i->rows();
Expand All @@ -214,7 +214,7 @@ void ConversionMatrix::multiplyOnRight(
} else {
i = ConversionSingleton::get().getL2H().begin();
}
ndarray::EigenView<double,1,0> vector(array);
auto vector = array.asEigen();
for (int offset = 0; offset < vector.size(); ++i) {
vector.segment(offset, i->rows()).transpose() *= (*i);
offset += i->rows();
Expand Down
4 changes: 2 additions & 2 deletions src/GaussHermiteConvolution.cc
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ ImplN::ImplN(
ndarray::Array<double const,2,2> ImplN::evaluate(
afw::geom::ellipses::Ellipse & ellipse
) const {
ndarray::EigenView<double,2,2> result(_result);
ndarray::EigenView<double const,1,1> psf_coeff(_psf.getCoefficients());
auto result = _result.asEigen();
auto psf_coeff = _psf.getCoefficients().asEigen();

Eigen::Matrix2d psfT = _psf.getEllipse().getCore().getGridTransform().invert().getMatrix();
Eigen::Matrix2d modelT = ellipse.getCore().getGridTransform().invert().getMatrix();
Expand Down
2 changes: 1 addition & 1 deletion src/MatrixBuilder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ namespace {
// helper function for the next two ctors: test if a MultiShapeletBasisComponent has unit scaling
// and identity remap matrix
bool isSimple(MultiShapeletBasisComponent const & component) {
ndarray::EigenView<double const,2,2> matrix(component.getMatrix());
auto matrix = component.getMatrix().asEigen();
return std::abs(component.getRadius() - 1.0) < std::numeric_limits<double>::epsilon() &&
matrix.rows() == matrix.cols() &&
matrix.isApprox(
Expand Down
2 changes: 1 addition & 1 deletion src/ShapeletFunction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ ShapeletFunctionEvaluator::ShapeletFunctionEvaluator(
ShapeletFunction ShapeletFunction::convolve(ShapeletFunction const & other) const {
GaussHermiteConvolution convolution(getOrder(), other);
afw::geom::ellipses::Ellipse newEllipse(_ellipse);
ndarray::EigenView<double const,2,2> matrix(convolution.evaluate(newEllipse));
auto matrix = convolution.evaluate(newEllipse).asEigen();
if (_basisType == LAGUERRE) {
ConversionMatrix::convertCoefficientVector(_coefficients, LAGUERRE, HERMITE, getOrder());
}
Expand Down

0 comments on commit 915046d

Please sign in to comment.