|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r62293 - branches/ublas-doxygen
From: david.bellot_at_[hidden]
Date: 2010-05-28 09:02:48
Author: david.bellot
Date: 2010-05-28 09:02:47 EDT (Fri, 28 May 2010)
New Revision: 62293
URL: http://svn.boost.org/trac/boost/changeset/62293
Log:
blas level 1 done
Text files modified:
branches/ublas-doxygen/blas.hpp | 81 ++++++++++++++++++++++++++-------------
1 files changed, 54 insertions(+), 27 deletions(-)
Modified: branches/ublas-doxygen/blas.hpp
==============================================================================
--- branches/ublas-doxygen/blas.hpp (original)
+++ branches/ublas-doxygen/blas.hpp 2010-05-28 09:02:47 EDT (Fri, 28 May 2010)
@@ -23,78 +23,105 @@
/// More information about BLAS can be found at http://en.wikipedia.org/wiki/BLAS
namespace blas_1 {
- /** \brief 1-Norm: \f$\sum_i |x_i|\f$
- \ingroup blas1
- */
+ /// \brief 1-Norm: \f$\sum_i |x_i|\f$ (also called \f$\f$mathcal{L}_1 or Manhattan norm)
+ /// \tparam V type of the vector (not needed by default)
+ /// \param v a vector or vector expression
+ /// \return the 1-Norm with type of the vector's type
template<class V>
typename type_traits<typename V::value_type>::real_type
asum (const V &v) {
return norm_1 (v);
}
- /** \brief 2-Norm: \f$\sum_i |x_i|^2\f$
- \ingroup blas1
- */
+
+ /// \brief 2-Norm: \f$\sum_i |x_i|^2\f$ (also called \f$\f$mathcal{L}_2 or Euclidean norm)
+ /// \tparam V type of the vector (not needed by default)
+ /// \param v a vector or vector expression
+ /// \return the 2-Norm with type of the vector's type
template<class V>
typename type_traits<typename V::value_type>::real_type
nrm2 (const V &v) {
return norm_2 (v);
}
- /** \brief element with larges absolute value: \f$\max_i |x_i|\f$
- \ingroup blas1
- */
+
+ /// \brief Infinite-norm: \f$\max_i |x_i|\f$ (also called \f$\f$mathcal{L}_\infty norm)
+ /// \tparam V type of the vector (not needed by default)
+ /// \param v a vector or vector expression
+ /// \return the Infinite-Norm with type of the vector's type
template<class V>
typename type_traits<typename V::value_type>::real_type
amax (const V &v) {
return norm_inf (v);
}
- /** \brief inner product of vectors \a v1 and \a v2
- \ingroup blas1
- */
+ /// \brief Inner product of vectors \a v1 and \a v2
+ /// \tparam V1 type of first vector (not needed by default)
+ /// \tparam V2 type of second vector (not needed by default)
+ /// \param v1 first vector of the inner product
+ /// \param v2 second vector of the inner product
+ /// \return the inner product of the type of the most generic type of the 2 vectors
template<class V1, class V2>
typename promote_traits<typename V1::value_type, typename V2::value_type>::promote_type
dot (const V1 &v1, const V2 &v2) {
return inner_prod (v1, v2);
}
- /** \brief copy vector \a v2 to \a v1
- \ingroup blas1
- */
+ /// \brief Copy vector \a v2 to \a v1
+ /// \tparam V1 type of first vector (not needed by default)
+ /// \tparam V2 type of second vector (not needed by default)
+ /// \param v1 target vector
+ /// \param v2 source vector
+ /// \return a reference to the target vector
template<class V1, class V2>
V1 &
copy (V1 &v1, const V2 &v2) {
return v1.assign (v2);
}
- /** \brief swap vectors \a v1 and \a v2
- \ingroup blas1
- */
+ /// \brief swap vectors \a v1 and \a v2
+ /// \tparam V1 type of first vector (not needed by default)
+ /// \tparam V2 type of second vector (not needed by default)
+ /// \param v1 first vector
+ /// \param v2 second vector
template<class V1, class V2>
void swap (V1 &v1, V2 &v2) {
v1.swap (v2);
}
- /** \brief scale vector \a v with scalar \a t
- \ingroup blas1
- */
+ /// \brief scale vector \a v with scalar \a t
+ /// \tparam V type of the vector (not needed by default)
+ /// \tparam T type of the scalar (not needed by default)
+ /// \param v vector to be scaled
+ /// \param t the scalar
+ /// \return \c t*v
template<class V, class T>
V &
scal (V &v, const T &t) {
return v *= t;
}
- /** \brief compute \a v1 = \a v1 + \a t * \a v2
- \ingroup blas1
- */
+ /// \brief Compute \f$v_1= v_1 + t.v_2\f$
+ /// \tparam V1 type of the first vector (not needed by default)
+ /// \tparam V2 type of the second vector (not needed by default)
+ /// \tparam T type of the scalar (not needed by default)
+ /// \param v1 target and first vector
+ /// \param v2 second vector
+ /// \param t the scalar
+ /// \return a reference to the first and target vector
template<class V1, class T, class V2>
V1 &
axpy (V1 &v1, const T &t, const V2 &v2) {
return v1.plus_assign (t * v2);
}
- /** \brief apply plane rotation
- \ingroup blas1
- */
+ /// \brief Apply plane rotation
+ /// \tparam T1 type of the first scalar (not needed by default)
+ /// \tparam V1 type of the first vector (not needed by default)
+ /// \tparam T2 type of the second scalar (not needed by default)
+ /// \tparam V2 type of the second vector (not needed by default)
+ /// \param t1 first scalar
+ /// \param v1 first vector
+ /// \param t2 second scalar
+ /// \param v2 second vector
template<class T1, class V1, class T2, class V2>
void
rot (const T1 &t1, V1 &v1, const T2 &t2, V2 &v2) {
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk