Commit a5a48831 authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

grouped operator documentation

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/branches/libfourier
SVN Revision: 3944
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent c9dfa7d2
......@@ -43,11 +43,18 @@
#include<aff/array.h>
/*! \brief
* Array operators are defined through the macro mechanism in operators.h
* and \ref group_operators
* \ingroup group_array
*/
//@{
#define AFF_OPERATORS_CLASS aff::Array
#define AFF_OPERATORS_CONSTCLASS aff::ConstArray
#include <aff/lib/operators.h>
#undef AFF_OPERATORS_CLASS
#undef AFF_OPERATORS_CONSTCLASS
//@}
#endif // AFF_ARRAYOPERATORS_H_VERSION (includeguard)
......
......@@ -36,6 +36,14 @@
* ============================================================================
*/
/*! \brief Container operators
* \defgroup group_operators Container operators
*
* Operators for containers are defined through a macro expansion mechanism,
* since the basic algorithm is the same for all containers.
* We make use of iterators to traverse the elements of the containers.
*/
// include guard
#ifndef AFF_OPERATORS_CLASS
#error "never ever inlcude this from your code!"
......@@ -49,10 +57,27 @@
namespace aff {
/*! \brief Basic macro type definitions for operators (see details).
* \ingroup group_operators
*
* The macros
* - #AFF_OPERATORS_CLASS
* - #AFF_OPERATORS_CONSTCLASS
*
* are defined by the header file including this header file.
* \sa arrayoperators.h, seriesoperators.h
*/
//@{
#define AFF_OPERATORS_TEMPAR T
#define AFF_OPERATORS_CONT AFF_OPERATORS_CLASS< AFF_OPERATORS_TEMPAR >
#define AFF_OPERATORS_CONSTCONT AFF_OPERATORS_CONSTCLASS< AFF_OPERATORS_TEMPAR >
//@}
/*----------------------------------------------------------------------*/
/*! \brief unary operator macro for containers with common value type
* \ingroup group_operators
*/
#define AFF_OPERATORS_UNOP( CONT, OP ) \
template<class AFF_OPERATORS_TEMPAR > \
const CONT& operator OP ## =(const CONT& container, \
......@@ -63,6 +88,11 @@ namespace aff {
return(container); \
}
/*----------------------------------------------------------------------*/
/*! \brief binary operator macro for containers with common value type
* \ingroup group_operators
*/
#define AFF_OPERATORS_BINOP( RETCONT, INCONT, OP ) \
template<class AFF_OPERATORS_TEMPAR > \
RETCONT operator OP(const INCONT& container, \
......@@ -80,7 +110,11 @@ namespace aff {
const INCONT& container) \
{ return( container OP value ); }
/*----------------------------------------------------------------------*/
/*! \brief unary operator macro for containers with different value type
* \ingroup group_operators
*/
#define AFF_OPERATORS_UNOPB( RETCONT, INCONT, OP ) \
template<class A , class B > \
RETCONT< A >& operator OP ## =(RETCONT< A >& container1, \
......@@ -93,6 +127,11 @@ namespace aff {
return(container1); \
}
/*----------------------------------------------------------------------*/
/*! \brief binary operator macro for containers with different value type
* \ingroup group_operators
*/
#define AFF_OPERATORS_BINOPB( RETCONT, INCONT, OP ) \
template<class A , class B > \
RETCONT< A > operator OP(const INCONT< A >& container1, \
......@@ -108,36 +147,62 @@ namespace aff {
return(retval); \
}
/*======================================================================*/
/*! \brief unary operators
* \ingroup group_operators
* This makes use of #AFF_OPERATORS_THEUNOP and #AFF_OPERATORS_UNOP
*/
//@{
#define AFF_OPERATORS_THEUNOP( OP ) \
AFF_OPERATORS_UNOP( AFF_OPERATORS_CONT , OP )
AFF_OPERATORS_THEUNOP( + )
AFF_OPERATORS_THEUNOP( * )
AFF_OPERATORS_THEUNOP( / )
AFF_OPERATORS_THEUNOP( - )
//@}
#undef AFF_OPERATORS_THEUNOP
/*! \brief binary operators
* \ingroup group_operators
* This makes use of #AFF_OPERATORS_THEBINOP and #AFF_OPERATORS_BINOP
*/
//@{
#define AFF_OPERATORS_THEBINOP( OP ) \
AFF_OPERATORS_BINOP( AFF_OPERATORS_CONT , AFF_OPERATORS_CONSTCONT, OP )
AFF_OPERATORS_THEBINOP( + )
AFF_OPERATORS_THEBINOP( * )
AFF_OPERATORS_THEBINOP( / )
AFF_OPERATORS_THEBINOP( - )
//@}
#undef AFF_OPERATORS_THEBINOP
/*! \brief binary operators
* \ingroup group_operators
* This makes use of #AFF_OPERATORS_THEBINOP and #AFF_OPERATORS_BINOPB
*/
//@{
#define AFF_OPERATORS_THEBINOP( OP ) \
AFF_OPERATORS_BINOPB( AFF_OPERATORS_CLASS , AFF_OPERATORS_CONSTCLASS , OP )
AFF_OPERATORS_THEBINOP( + )
AFF_OPERATORS_THEBINOP( * )
AFF_OPERATORS_THEBINOP( / )
AFF_OPERATORS_THEBINOP( - )
//@}
#undef AFF_OPERATORS_THEBINOP
/*! \brief unary operators
* \ingroup group_operators
* This makes use of #AFF_OPERATORS_THEUNOP and #AFF_OPERATORS_UNOPB
*/
//@{
#define AFF_OPERATORS_THEUNOP( OP ) \
AFF_OPERATORS_UNOPB( AFF_OPERATORS_CLASS , AFF_OPERATORS_CONSTCLASS , OP )
AFF_OPERATORS_THEUNOP( + )
AFF_OPERATORS_THEUNOP( * )
AFF_OPERATORS_THEUNOP( / )
AFF_OPERATORS_THEUNOP( - )
//@}
#undef AFF_OPERATORS_THEUNOP
#undef AFF_OPERATORS_UNOP
......
......@@ -43,11 +43,18 @@
#include<aff/series.h>
/*! \brief
* Series operators are defined through the macro mechanism in operators.h
* and \ref group_operators
* \ingroup group_series
*/
//@{
#define AFF_OPERATORS_CLASS aff::Series
#define AFF_OPERATORS_CONSTCLASS aff::ConstSeries
#include <aff/lib/operators.h>
#undef AFF_OPERATORS_CLASS
#undef AFF_OPERATORS_CONSTCLASS
//@}
#endif // AFF_SERIESOPERATORS_H_VERSION (includeguard)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment