Skip to content

Commit

Permalink
Run clang-format on C++ code
Browse files Browse the repository at this point in the history
  • Loading branch information
r-owen committed May 24, 2018
1 parent 1c835d6 commit 4127a58
Show file tree
Hide file tree
Showing 278 changed files with 2,907 additions and 3,242 deletions.
10 changes: 5 additions & 5 deletions examples/imageStatistics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ typedef math::MaskedVector<float> MaskedVectorF;
template <typename Image>
void printStats(Image &img, math::StatisticsControl const &sctrl) {
// initialize a Statistics object with any stats we might want
ImgStat stats =
math::makeStatistics(img, math::NPOINT | math::STDEV | math::MEAN | math::VARIANCE |
math::ERRORS | math::MIN | math::MAX | math::VARIANCECLIP |
math::MEANCLIP | math::MEDIAN | math::IQRANGE | math::STDEVCLIP,
sctrl);
ImgStat stats = math::makeStatistics(
img,
math::NPOINT | math::STDEV | math::MEAN | math::VARIANCE | math::ERRORS | math::MIN | math::MAX |
math::VARIANCECLIP | math::MEANCLIP | math::MEDIAN | math::IQRANGE | math::STDEVCLIP,
sctrl);

// get various stats with getValue() and their errors with getError()
double const npoint = stats.getValue(math::NPOINT);
Expand Down
2 changes: 1 addition & 1 deletion examples/maskedImage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ void printVariance(image::MaskedImage<ImagePixelT> const& img, string const& tit
cout << endl;
}
}
}
} // namespace

int main() {
image::MaskedImage<ImagePixelT> img(lsst::geom::Extent2I(3, 5));
Expand Down
3 changes: 2 additions & 1 deletion examples/spatialCellExample.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ readImage() {

std::string filename = dataDir + "/CFHT/D4/cal-53535-i-797722_1.fits";

lsst::geom::Box2I bbox = lsst::geom::Box2I(lsst::geom::Point2I(270, 2530), lsst::geom::Extent2I(512, 512));
lsst::geom::Box2I bbox =
lsst::geom::Box2I(lsst::geom::Point2I(270, 2530), lsst::geom::Extent2I(512, 512));

std::shared_ptr<lsst::daf::base::PropertySet> md;
mi.reset(new afwImage::MaskedImage<PixelT>(filename, md, bbox));
Expand Down
4 changes: 2 additions & 2 deletions examples/wcsTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
*/

/*
* Simple test code for the Wcs Class
*/
* Simple test code for the Wcs Class
*/

#include <iostream>
#include <sstream>
Expand Down
8 changes: 4 additions & 4 deletions include/lsst/afw/cameraGeom/CameraSys.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@ extern CameraSysPrefix const ACTUAL_PIXELS;
std::ostream &operator<<(std::ostream &os, CameraSysPrefix const &detSysPrefix);

std::ostream &operator<<(std::ostream &os, CameraSys const &cameraSys);
}
}
}
} // namespace cameraGeom
} // namespace afw
} // namespace lsst

namespace std {
template <>
Expand All @@ -218,6 +218,6 @@ template <>
struct hash<lsst::afw::cameraGeom::CameraSys> {
size_t operator()(lsst::afw::cameraGeom::CameraSys const &obj) const noexcept { return obj.hash(); }
};
}
} // namespace std

#endif
4 changes: 2 additions & 2 deletions include/lsst/afw/cameraGeom/Detector.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,11 +294,11 @@ class Detector {
int _id; ///< detector numeric ID
DetectorType _type; ///< type of detectorsize_t
std::string _serial; ///< serial "number" that identifies the physical detector
lsst::geom::Box2I _bbox; ///< bounding box
lsst::geom::Box2I _bbox; ///< bounding box
table::AmpInfoCatalog _ampInfoCatalog; ///< list of amplifier data
_AmpInfoMap _ampNameIterMap; ///< map of amplifier name: catalog iterator
Orientation _orientation; ///< position and orientation of detector in focal plane
lsst::geom::Extent2D _pixelSize; ///< pixel size (mm)
lsst::geom::Extent2D _pixelSize; ///< pixel size (mm)
CameraSys _nativeSys; ///< native coordinate system of this detector
TransformMap _transformMap; ///< registry of coordinate transforms
CrosstalkMatrix _crosstalk; ///< crosstalk coefficients
Expand Down
6 changes: 3 additions & 3 deletions include/lsst/afw/cameraGeom/Orientation.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ class Orientation {
// Turn off alignment since this is dynamically allocated (via Detector)
Eigen::Matrix<double, 2, 2, Eigen::DontAlign> _rotMat;
};
}
}
}
} // namespace cameraGeom
} // namespace afw
} // namespace lsst

#endif
9 changes: 4 additions & 5 deletions include/lsst/afw/cameraGeom/TransformMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace cameraGeom {
*/
class TransformMap final {
private:
// Functor for boost::transform_iterator: given an entry in a std::map or unordered_map, return the key
// Functor for boost::transform_iterator: given an entry in a std::map or unordered_map, return the key
struct GetKey {
CameraSys const &operator()(std::pair<const CameraSys, int> const &p) const { return p.first; };
};
Expand Down Expand Up @@ -115,15 +115,15 @@ class TransformMap final {
* `fromSys` or `toSys` is not supported.
*/
lsst::geom::Point2D transform(lsst::geom::Point2D const &point, CameraSys const &fromSys,
CameraSys const &toSys) const;
CameraSys const &toSys) const;

/**
* Convert a list of points from one coordinate system to another.
*
* @overload
*/
std::vector<lsst::geom::Point2D> transform(std::vector<lsst::geom::Point2D> const &pointList,
CameraSys const &fromSys, CameraSys const &toSys) const;
CameraSys const &fromSys, CameraSys const &toSys) const;

CameraSysIterator begin() const { return boost::make_transform_iterator(_frameIds.begin(), GetKey()); }

Expand Down Expand Up @@ -182,8 +182,7 @@ class TransformMap final {
* @throws lsst::pex::exceptions::InvalidParameterError Thrown if either
* `fromSys` or `toSys` is not supported.
*/
std::shared_ptr<ast::Mapping const> _getMapping(CameraSys const &fromSys,
CameraSys const &toSys) const;
std::shared_ptr<ast::Mapping const> _getMapping(CameraSys const &fromSys, CameraSys const &toSys) const;

/// Allows conversions between LSST and AST data formats
static lsst::afw::geom::Point2Endpoint _pointConverter;
Expand Down
6 changes: 3 additions & 3 deletions include/lsst/afw/coord/Coord.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ std::string angleToDmsString(lsst::geom::Angle const deg);
/// a function to convert decimal degrees to a string with form hh:mm:ss.s
std::string angleToHmsString(lsst::geom::Angle const deg);

}
}
}
} // namespace coord
} // namespace afw
} // namespace lsst

#endif
9 changes: 4 additions & 5 deletions include/lsst/afw/coord/Observatory.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ class Observatory {
* @param[in] latitude telescope latitude
* @param[in] elevation telescope elevation (meters above reference spheroid)
*/
Observatory(lsst::geom::Angle const longitude, lsst::geom::Angle const latitude,
double const elevation);
Observatory(lsst::geom::Angle const longitude, lsst::geom::Angle const latitude, double const elevation);

/**
* Construct an Observatory with longitude and latitude specified as sexagesimal strings
Expand Down Expand Up @@ -108,8 +107,8 @@ class Observatory {
* @param[in] obs the Observatory to print
*/
std::ostream& operator<<(std::ostream& os, Observatory const& obs);
}
}
}
} // namespace coord
} // namespace afw
} // namespace lsst

#endif
6 changes: 3 additions & 3 deletions include/lsst/afw/coord/Weather.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ class Weather {

/// print a Weather to an output stream
std::ostream &operator<<(std::ostream &os, Weather const &weath);
}
}
} // lsst::afw::coord
} // namespace coord
} // namespace afw
} // namespace lsst

#endif // !LSST_AFW_COORD_WEATHER_H_INCLUDED
40 changes: 20 additions & 20 deletions include/lsst/afw/detection/Footprint.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ class Footprint : public lsst::daf::base::Citizen,
* @param region Bounding box of the image in which the Footprint was created,
defaults to empty box.
*/
explicit Footprint(std::shared_ptr<geom::SpanSet> inputSpans, afw::table::Schema const & peakSchema,
lsst::geom::Box2I const & region=lsst::geom::Box2I());
explicit Footprint(std::shared_ptr<geom::SpanSet> inputSpans, afw::table::Schema const &peakSchema,
lsst::geom::Box2I const &region = lsst::geom::Box2I());

/** @brief Constructor of a empty Footprint object
*/
Expand All @@ -114,7 +114,7 @@ class Footprint : public lsst::daf::base::Citizen,
virtual bool isHeavy() const { return false; }

/** Return a shared pointer to the SpanSet
*/
*/
std::shared_ptr<geom::SpanSet> getSpans() const { return _spans; }

/** Sets the shared pointer to the SpanSet in the Footprint
Expand Down Expand Up @@ -199,10 +199,10 @@ class Footprint : public lsst::daf::base::Citizen,
void shift(int dx, int dy);

/**
* Shift a Footprint by a given extent
*
* @param d ExtentI object which gives the dimensions the Footprint should be shifted
*/
* Shift a Footprint by a given extent
*
* @param d ExtentI object which gives the dimensions the Footprint should be shifted
*/
void shift(lsst::geom::ExtentI const &d) { shift(d.getX(), d.getY()); }

/**
Expand Down Expand Up @@ -338,19 +338,19 @@ class Footprint : public lsst::daf::base::Citizen,
bool isContiguous() const { return getSpans()->isContiguous(); };

/**
* Split a multi-component Footprint into a vector of contiguous Footprints
*
* Split a multi-component Footprint such that each Footprint in the output vector
* is contiguous and contains only peaks that can be found within the bounds of the
* Footprint
*/
* Split a multi-component Footprint into a vector of contiguous Footprints
*
* Split a multi-component Footprint such that each Footprint in the output vector
* is contiguous and contains only peaks that can be found within the bounds of the
* Footprint
*/
std::vector<std::shared_ptr<Footprint>> split() const;

/**
* equality operator
*
* @param other The Footprint for which equality will be computed
*/
* equality operator
*
* @param other The Footprint for which equality will be computed
*/
bool operator==(Footprint const &other) const;

protected:
Expand Down Expand Up @@ -405,8 +405,8 @@ std::shared_ptr<Footprint> mergeFootprints(Footprint const &footprint1, Footprin
* @param footprint Footprint to turn into bounding box list
*/
std::vector<lsst::geom::Box2I> footprintToBBoxList(Footprint const &footprint);
}
}
} // Close namespace lsst::afw::detection
} // namespace detection
} // namespace afw
} // namespace lsst

#endif // LSST_DETECTION_FOOTPRINT_H
10 changes: 5 additions & 5 deletions include/lsst/afw/detection/FootprintCtrl.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class FootprintControl {
#define DEFINE_ACCESSORS(NAME, UNAME) \
/** Set whether Footprint should be grown in a NAME sort of */ \
void grow##UNAME(bool val /**!< Should grow be of type NAME? */ \
) { \
) { \
_##NAME = val ? TRUE_ : FALSE_; \
} \
/** Return <isSet, Value> for NAME grows */ \
Expand All @@ -79,7 +79,7 @@ class FootprintControl {

/// Set whether Footprint should be grown isotropically
void growIsotropic(bool val ///< Should grow be isotropic?
) {
) {
_circular = TRUE_;
_isotropic = val ? TRUE_ : FALSE_;
}
Expand Down Expand Up @@ -128,8 +128,8 @@ class HeavyFootprintCtrl {
long _maskVal;
double _varianceVal;
};
}
}
}
} // namespace detection
} // namespace afw
} // namespace lsst

#endif
6 changes: 3 additions & 3 deletions include/lsst/afw/detection/FootprintMerge.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ class FootprintMergeList {
afw::table::SchemaMapper _peakSchemaMapper;
std::shared_ptr<PeakTable> _peakTable;
};
}
}
} // namespace lsst::afw::detection
} // namespace detection
} // namespace afw
} // namespace lsst

#endif // !LSST_AFW_DETECTION_FOOTPRINTMERGE_H
14 changes: 7 additions & 7 deletions include/lsst/afw/detection/FootprintSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class FootprintSet : public lsst::daf::base::Citizen {
*/
FootprintSet(FootprintSet const& rhs);
FootprintSet(FootprintSet const& set, int rGrow, FootprintControl const& ctrl);
FootprintSet(FootprintSet && rhs);
FootprintSet(FootprintSet&& rhs);
~FootprintSet();
/**
* Grow all the Footprints in the input FootprintSet, returning a new FootprintSet
Expand All @@ -135,7 +135,7 @@ class FootprintSet : public lsst::daf::base::Citizen {

/// Assignment operator.
FootprintSet& operator=(FootprintSet const& rhs);
FootprintSet& operator=(FootprintSet && rhs);
FootprintSet& operator=(FootprintSet&& rhs);

void swap(FootprintSet& rhs) {
using std::swap; // See Meyers, Effective C++, Item 25
Expand Down Expand Up @@ -200,7 +200,7 @@ class FootprintSet : public lsst::daf::base::Citizen {
template <typename MaskPixelT>
void setMask(image::Mask<MaskPixelT>* mask, ///< Set bits in the mask
std::string const& planeName ///< Here's the name of the mask plane to fit
) {
) {
for (auto const& foot : *_footprints) {
foot->getSpans()->setMask(*mask, image::Mask<MaskPixelT>::getPlaneBitMask(planeName));
}
Expand All @@ -209,7 +209,7 @@ class FootprintSet : public lsst::daf::base::Citizen {
template <typename MaskPixelT>
void setMask(std::shared_ptr<image::Mask<MaskPixelT>> mask, ///< Set bits in the mask
std::string const& planeName ///< Here's the name of the mask plane to fit
) {
) {
setMask(mask.get(), planeName);
}

Expand Down Expand Up @@ -237,8 +237,8 @@ class FootprintSet : public lsst::daf::base::Citizen {
std::shared_ptr<FootprintList> _footprints; ///< the Footprints of detected objects
lsst::geom::Box2I _region; ///< The corners of the MaskedImage that the detections live in
};
}
}
}
} // namespace detection
} // namespace afw
} // namespace lsst

#endif
6 changes: 3 additions & 3 deletions include/lsst/afw/detection/GaussianPsf.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ class GaussianPsf : public afw::table::io::PersistableFacade<GaussianPsf>, publi
lsst::geom::Extent2I _dimensions;
double _sigma;
};
}
}
} // namespace lsst::afw::detection
} // namespace detection
} // namespace afw
} // namespace lsst

#endif // !LSST_AFW_DETECTION_Psf_h_INCLUDED
6 changes: 3 additions & 3 deletions include/lsst/afw/detection/HeavyFootprint.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ template <typename ImagePixelT, typename MaskPixelT, typename VariancePixelT>
std::shared_ptr<HeavyFootprint<ImagePixelT, MaskPixelT, VariancePixelT> > mergeHeavyFootprints(
HeavyFootprint<ImagePixelT, MaskPixelT, VariancePixelT> const& h1,
HeavyFootprint<ImagePixelT, MaskPixelT, VariancePixelT> const& h2);
}
}
}
} // namespace detection
} // namespace afw
} // namespace lsst

#endif
6 changes: 3 additions & 3 deletions include/lsst/afw/detection/Peak.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ inline void PeakRecord::setPeakValue(float peakValue) { set(PeakTable::getPeakVa
typedef afw::table::ColumnViewT<PeakRecord> PeakColumnView;
typedef afw::table::CatalogT<PeakRecord> PeakCatalog;
typedef afw::table::CatalogT<PeakRecord const> ConstPeakCatalog;
}
}
} // namespace lsst::afw::detection
} // namespace detection
} // namespace afw
} // namespace lsst

#endif // !AFW_DETECTION_Peak_h_INCLUDED

0 comments on commit 4127a58

Please sign in to comment.