Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-14725: Eliminate explicit use of ndarray::EigenView in C++ code #19

Merged
merged 1 commit into from
Jun 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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