Skip to content

Commit

Permalink
Merge pull request #37 from lsst/tickets/DM-4035
Browse files Browse the repository at this point in the history
Migrate boost::array to std::array
  • Loading branch information
Pim Schellart authored and Pim Schellart committed May 4, 2016
2 parents a48c9d8 + b6d1faf commit df30282
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions include/lsst/meas/base/ApertureFlux.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#ifndef LSST_MEAS_BASE_ApertureFlux_h_INCLUDED
#define LSST_MEAS_BASE_ApertureFlux_h_INCLUDED

#include "boost/array.hpp"
#include <array>
#include "lsst/pex/config.h"
#include "lsst/afw/image/Exposure.h"
#include "lsst/afw/table/arrays.h"
Expand Down Expand Up @@ -222,7 +222,7 @@ class ApertureFluxAlgorithm : public SimpleAlgorithm {
/**
* Return the flag definitions which apply to aperture flux measurements.
*/
static boost::array<FlagDefinition,ApertureFluxAlgorithm::N_FLAGS> const & getFlagDefinitions();
static std::array<FlagDefinition,ApertureFluxAlgorithm::N_FLAGS> const & getFlagDefinitions();

protected:

Expand Down
2 changes: 1 addition & 1 deletion include/lsst/meas/base/FlagHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class FlagHandler {
* @param[in] end Iterator to one past the end of an array of FlagDefinition.
*
* We use pointers rather than an iterator type for the FlagDefinition array to allow the user
* maximum flexibility in the array type - C arrays, std::array, boost::array, and std::vector
* maximum flexibility in the array type - C arrays, std::array, std::array, and std::vector
* (as well as any other container with contiguous memory) may be used. The pointers must remain
* valid only for the duration of the call to this function.
*/
Expand Down
6 changes: 3 additions & 3 deletions src/ApertureFlux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ namespace lsst { namespace meas { namespace base {

ApertureFluxControl::ApertureFluxControl() : radii(10), maxSincRadius(10.0), shiftKernel("lanczos5") {
// defaults here stolen from HSC pipeline defaults
static boost::array<double,10> defaultRadii = {{
static std::array<double,10> defaultRadii = {{
3.0, 4.5, 6.0, 9.0, 12.0, 17.0, 25.0, 35.0, 50.0, 70.0
}};
std::copy(defaultRadii.begin(), defaultRadii.end(), radii.begin());
}

boost::array<FlagDefinition,ApertureFluxAlgorithm::N_FLAGS> const & ApertureFluxAlgorithm::getFlagDefinitions() {
static boost::array<FlagDefinition,ApertureFluxAlgorithm::N_FLAGS> flagDefs = {{
std::array<FlagDefinition,ApertureFluxAlgorithm::N_FLAGS> const & ApertureFluxAlgorithm::getFlagDefinitions() {
static std::array<FlagDefinition,ApertureFluxAlgorithm::N_FLAGS> flagDefs = {{
{"flag", "general failure flag"},
{"flag_apertureTruncated", "aperture did not fit within measurement image"},
{"flag_sincCoeffsTruncated", "full sinc coefficient image did not fit within measurement image"}
Expand Down
4 changes: 2 additions & 2 deletions src/Blendedness.cc
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ void computeMoments(

} // anonymous

boost::array<FlagDefinition,BlendednessAlgorithm::N_FLAGS> const & getFlagDefinitions() {
static boost::array<FlagDefinition,BlendednessAlgorithm::N_FLAGS> const flagDefs = {{
std::array<FlagDefinition,BlendednessAlgorithm::N_FLAGS> const & getFlagDefinitions() {
static std::array<FlagDefinition,BlendednessAlgorithm::N_FLAGS> const flagDefs = {{
{"flag", "general failure flag"},
{"flag_noCentroid", "Object has no centroid"},
{"flag_noShape", "Object has no shape"}
Expand Down
4 changes: 2 additions & 2 deletions src/GaussianCentroid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -499,8 +499,8 @@ MAKE_TWODG(afw::image::Image<float>);
MAKE_TWODG(afw::image::Image<double>);
MAKE_TWODG(afw::image::Image<int>);

boost::array<FlagDefinition,GaussianCentroidAlgorithm::N_FLAGS> const & getFlagDefinitions() {
static boost::array<FlagDefinition,GaussianCentroidAlgorithm::N_FLAGS> const flagDefs = {{
std::array<FlagDefinition,GaussianCentroidAlgorithm::N_FLAGS> const & getFlagDefinitions() {
static std::array<FlagDefinition,GaussianCentroidAlgorithm::N_FLAGS> const flagDefs = {{
{"flag", "general failure flag, set if anything went wrong"},
{"flag_noPeak", "Fitted Centroid has a negative peak"}
}};
Expand Down
2 changes: 1 addition & 1 deletion src/GaussianFlux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ GaussianFluxAlgorithm::GaussianFluxAlgorithm(
_centroidExtractor(schema, name),
_shapeExtractor(schema, name)
{
static boost::array<FlagDefinition,N_FLAGS> const flagDefs = {{
static std::array<FlagDefinition,N_FLAGS> const flagDefs = {{
{"flag", "general failure flag, set if anything went wrong"}
}};
_flagHandler = FlagHandler::addFields(schema, name, flagDefs.begin(), flagDefs.end());
Expand Down
4 changes: 2 additions & 2 deletions src/NaiveCentroid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ namespace lsst { namespace meas { namespace base {

namespace {

boost::array<FlagDefinition,NaiveCentroidAlgorithm::N_FLAGS> const & getFlagDefinitions() {
static boost::array<FlagDefinition,NaiveCentroidAlgorithm::N_FLAGS> const flagDefs = {{
std::array<FlagDefinition,NaiveCentroidAlgorithm::N_FLAGS> const & getFlagDefinitions() {
static std::array<FlagDefinition,NaiveCentroidAlgorithm::N_FLAGS> const flagDefs = {{
{"flag", "general failure flag, set if anything went wrong"},
{"flag_noCounts", "Object to be centroided has no counts"},
{"flag_edge", "Object too close to edge"}
Expand Down
2 changes: 1 addition & 1 deletion src/PeakLikelihoodFlux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ PeakLikelihoodFluxAlgorithm::PeakLikelihoodFluxAlgorithm(
),
_centroidExtractor(schema, name)
{
static boost::array<FlagDefinition,N_FLAGS> const flagDefs = {{
static std::array<FlagDefinition,N_FLAGS> const flagDefs = {{
{"flag", "general failure flag, set if anything went wrong"}
}};
_flagHandler = FlagHandler::addFields(schema, name, flagDefs.begin(), flagDefs.end());
Expand Down
6 changes: 3 additions & 3 deletions src/PsfFlux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* see <http://www.lsstcorp.org/LegalNotices/>.
*/

#include "boost/array.hpp"
#include <array>

#include "ndarray/eigen.h"

Expand All @@ -35,8 +35,8 @@ namespace lsst { namespace meas { namespace base {

namespace {

boost::array<FlagDefinition,PsfFluxAlgorithm::N_FLAGS> const & getFlagDefinitions() {
static boost::array<FlagDefinition,PsfFluxAlgorithm::N_FLAGS> const flagDefs = {{
std::array<FlagDefinition,PsfFluxAlgorithm::N_FLAGS> const & getFlagDefinitions() {
static std::array<FlagDefinition,PsfFluxAlgorithm::N_FLAGS> const flagDefs = {{
{"flag", "general failure flag"},
{"flag_noGoodPixels", "not enough non-rejected pixels in data to attempt the fit"},
{"flag_edge", "object was too close to the edge of the image to use the full PSF model"}
Expand Down
4 changes: 2 additions & 2 deletions src/SdssCentroid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,8 @@ smoothAndBinImage(CONST_PTR(lsst::afw::detection::Psf) psf,
return std::make_pair(smoothedImage, smoothingSigma);
}

boost::array<FlagDefinition,SdssCentroidAlgorithm::N_FLAGS> const & getFlagDefinitions() {
static boost::array<FlagDefinition,SdssCentroidAlgorithm::N_FLAGS> const flagDefs = {{
std::array<FlagDefinition,SdssCentroidAlgorithm::N_FLAGS> const & getFlagDefinitions() {
static std::array<FlagDefinition,SdssCentroidAlgorithm::N_FLAGS> const flagDefs = {{
{"flag", "general failure flag, set if anything went wrong"},
{"flag_edge", "Object too close to edge"},
{"flag_noSecondDerivative", "Vanishing second derivative"},
Expand Down
2 changes: 1 addition & 1 deletion src/SdssShape.cc
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ SdssShapeResult::SdssShapeResult() :
flux_xy_Cov(std::numeric_limits<ErrElement>::quiet_NaN())
{}

static boost::array<FlagDefinition,SdssShapeAlgorithm::N_FLAGS> const flagDefs = {{
static std::array<FlagDefinition,SdssShapeAlgorithm::N_FLAGS> const flagDefs = {{
{"flag", "general failure flag, set if anything went wrong"},
{"flag_unweightedBad", "Both weighted and unweighted moments were invalid"},
{"flag_unweighted", "Weighted moments converged to an invalid value; using unweighted moments"},
Expand Down
2 changes: 1 addition & 1 deletion tests/SillyCentroid.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class SillyCentroidAlgorithm : public lsst::meas::base::SimpleAlgorithm {
),
_centroidExtractor(schema, name, true)
{
static boost::array<lsst::meas::base::FlagDefinition,N_FLAGS> const flagDefs = {{
static std::array<lsst::meas::base::FlagDefinition,N_FLAGS> const flagDefs = {{
{"flag", "general failure flag, set if anything went wrong"},
{"flag_noCounts", "Object to be centroided has no counts"},
{"flag_edge", "Object too close to edge"}
Expand Down

0 comments on commit df30282

Please sign in to comment.