[arithmetic] Improve the description of functions parameters.

This commit is contained in:
Adam Wulkiewicz
2014-07-11 02:30:28 +02:00
parent bd76327102
commit 7d11f8650d
2 changed files with 25 additions and 8 deletions

View File

@@ -117,6 +117,7 @@ struct point_assignment
\brief Adds the same value to each coordinate of a point
\ingroup arithmetic
\details
\tparam Point \tparam_point
\param p point
\param value value to add
*/
@@ -133,6 +134,8 @@ inline void add_value(Point& p, typename detail::param<Point>::type value)
\ingroup arithmetic
\details The coordinates of the second point will be added to those of the first point.
The second point is not modified.
\tparam Point1 \tparam_point
\tparam Point2 \tparam_point
\param p1 first point
\param p2 second point
*/
@@ -149,6 +152,7 @@ inline void add_point(Point1& p1, Point2 const& p2)
\brief Subtracts the same value to each coordinate of a point
\ingroup arithmetic
\details
\tparam Point \tparam_point
\param p point
\param value value to subtract
*/
@@ -165,6 +169,8 @@ inline void subtract_value(Point& p, typename detail::param<Point>::type value)
\ingroup arithmetic
\details The coordinates of the second point will be subtracted to those of the first point.
The second point is not modified.
\tparam Point1 \tparam_point
\tparam Point2 \tparam_point
\param p1 first point
\param p2 second point
*/
@@ -181,6 +187,7 @@ inline void subtract_point(Point1& p1, Point2 const& p2)
\brief Multiplies each coordinate of a point by the same value
\ingroup arithmetic
\details
\tparam Point \tparam_point
\param p point
\param value value to multiply by
*/
@@ -197,6 +204,8 @@ inline void multiply_value(Point& p, typename detail::param<Point>::type value)
\ingroup arithmetic
\details The coordinates of the first point will be multiplied by those of the second point.
The second point is not modified.
\tparam Point1 \tparam_point
\tparam Point2 \tparam_point
\param p1 first point
\param p2 second point
\note This is *not* a dot, cross or wedge product. It is a mere field-by-field multiplication.
@@ -214,6 +223,7 @@ inline void multiply_point(Point1& p1, Point2 const& p2)
\brief Divides each coordinate of the same point by a value
\ingroup arithmetic
\details
\tparam Point \tparam_point
\param p point
\param value value to divide by
*/
@@ -230,6 +240,8 @@ inline void divide_value(Point& p, typename detail::param<Point>::type value)
\ingroup arithmetic
\details The coordinates of the first point will be divided by those of the second point.
The second point is not modified.
\tparam Point1 \tparam_point
\tparam Point2 \tparam_point
\param p1 first point
\param p2 second point
*/
@@ -246,6 +258,7 @@ inline void divide_point(Point1& p1, Point2 const& p2)
\brief Assign each coordinate of a point the same value
\ingroup arithmetic
\details
\tparam Point \tparam_point
\param p point
\param value value to assign
*/
@@ -262,11 +275,13 @@ inline void assign_value(Point& p, typename detail::param<Point>::type value)
\ingroup arithmetic
\details The coordinates of the first point will be assigned those of the second point.
The second point is not modified.
\tparam Point1 \tparam_point
\tparam Point2 \tparam_point
\param p1 first point
\param p2 second point
*/
template <typename Point1, typename Point2>
inline void assign_point(Point1& p1, const Point2& p2)
inline void assign_point(Point1& p1, Point2 const& p2)
{
BOOST_CONCEPT_ASSERT( (concept::Point<Point1>) );
BOOST_CONCEPT_ASSERT( (concept::ConstPoint<Point2>) );

View File

@@ -59,21 +59,23 @@ struct dot_product_maker<P1, P2, DimensionCount, DimensionCount>
/*!
\brief Computes the dot product (or scalar product) of 2 vectors (points).
\ingroup arithmetic
\tparam Point1 \tparam_point
\tparam Point2 \tparam_point
\param p1 first point
\param p2 second point
\return the dot product
*/
template <typename P1, typename P2>
inline typename select_coordinate_type<P1, P2>::type dot_product(
P1 const& p1, P2 const& p2)
template <typename Point1, typename Point2>
inline typename select_coordinate_type<Point1, Point2>::type dot_product(
Point1 const& p1, Point2 const& p2)
{
BOOST_CONCEPT_ASSERT( (concept::ConstPoint<P1>) );
BOOST_CONCEPT_ASSERT( (concept::ConstPoint<P2>) );
BOOST_CONCEPT_ASSERT( (concept::ConstPoint<Point1>) );
BOOST_CONCEPT_ASSERT( (concept::ConstPoint<Point2>) );
return detail::dot_product_maker
<
P1, P2,
0, dimension<P1>::type::value - 1
Point1, Point2,
0, dimension<Point1>::type::value - 1
>::apply(p1, p2);
}