Skip to content
Snippets Groups Projects
Commit 1a3a21fd authored by Nina Džugasová's avatar Nina Džugasová Committed by Tomáš Oberhuber
Browse files

Documentation of 1-dim StaticVector.

parent 883a8d26
No related branches found
No related tags found
1 merge request!19Nina
......@@ -227,6 +227,9 @@ class StaticVector : public StaticArray< Size, Real >
#endif
};
/**
* \brief Specific static vector with the size of 1. Works like the class StaticVector.
*/
template< typename Real >
class StaticVector< 1, Real > : public StaticArray< 1, Real >
{
......@@ -235,79 +238,88 @@ class StaticVector< 1, Real > : public StaticArray< 1, Real >
typedef StaticVector< 1, Real > ThisType;
enum { size = 1 };
/** \brief See StaticVector::StaticVector().*/
__cuda_callable__
StaticVector();
/** \brief See StaticVector::StaticVector(const Real v[Size]).*/
// Note: the template avoids ambiguity of overloaded functions with literal 0 and pointer
// reference: https://stackoverflow.com/q/4610503
template< typename _unused = void >
__cuda_callable__
StaticVector( const Real v[ 1 ] );
//! This sets all vector components to v
/** \brief See StaticVector::StaticVector( const Real& v ).*/
__cuda_callable__
StaticVector( const Real& v );
//! Copy constructor
/** \brief See StaticVector::StaticVector( const StaticVector< Size, Real >& v ).*/
__cuda_callable__
StaticVector( const StaticVector< 1, Real >& v );
bool setup( const Config::ParameterContainer& parameters,
const String& prefix = "" );
/** \brief See StaticVector::getType().*/
static String getType();
//! Addition operator
/** \brief See StaticVector::operator += ( const StaticVector& v ).*/
__cuda_callable__
StaticVector& operator += ( const StaticVector& v );
//! Subtraction operator
/** \brief See StaticVector::operator -= ( const StaticVector& v ).*/
__cuda_callable__
StaticVector& operator -= ( const StaticVector& v );
//! Multiplication with number
/** \brief See StaticVector::operator *= ( const Real& c ).*/
__cuda_callable__
StaticVector& operator *= ( const Real& c );
//! Division by number
/** \brief See StaticVector::operator *= ( const Real& c ).*/
__cuda_callable__
StaticVector& operator /= ( const Real& c );
//! Addition operator
/** \brief See StaticVector::operator + ( const StaticVector& u ) const.*/
__cuda_callable__
StaticVector operator + ( const StaticVector& u ) const;
//! Subtraction operator
/** \brief See StaticVector::operator - ( const StaticVector& u ) const.*/
__cuda_callable__
StaticVector operator - ( const StaticVector& u ) const;
//! Multiplication with number
/** \brief See StaticVector::operator * ( const Real& c ) const.*/
__cuda_callable__
StaticVector operator * ( const Real& c ) const;
//! Scalar product
/** \brief See StaticVector::operator * ( const StaticVector& u ) const.*/
__cuda_callable__
Real operator * ( const StaticVector& u ) const;
/** \brief See StaticVector::operator <.*/
__cuda_callable__
bool operator < ( const StaticVector& v ) const;
/** \brief See StaticVector::operator <=.*/
__cuda_callable__
bool operator <= ( const StaticVector& v ) const;
/** \brief See StaticVector::operator <.*/
__cuda_callable__
bool operator > ( const StaticVector& v ) const;
/** \brief See StaticVector::operator <=.*/
__cuda_callable__
bool operator >= ( const StaticVector& v ) const;
template< typename OtherReal >
__cuda_callable__
operator StaticVector< 1, OtherReal >() const;
/** \brief See StaticVector::abs() const.*/
__cuda_callable__
ThisType abs() const;
/** \brief See StaticVector::lpNorm( const Real& p ) const.*/
__cuda_callable__
Real lpNorm( const Real& p ) const;
......
......@@ -77,7 +77,7 @@ class Vector
Vector& operator -= ( const VectorT& vector );
/**
* \brief This function adds \e vector from this vector and returns the resulting vector.
* \brief This function adds \e vector to this vector and returns the resulting vector.
*
* The addition is applied to all the vector elements separately.
* \param vector Reference to another vector.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment