Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tnl-dev
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
TNL
tnl-dev
Commits
1a3a21fd
There was an error fetching the commit references. Please try again later.
Commit
1a3a21fd
authored
6 years ago
by
Nina Džugasová
Committed by
Tomáš Oberhuber
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Documentation of 1-dim StaticVector.
parent
883a8d26
No related branches found
No related tags found
1 merge request
!19
Nina
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/TNL/Containers/StaticVector.h
+23
-11
23 additions, 11 deletions
src/TNL/Containers/StaticVector.h
src/TNL/Containers/Vector.h
+1
-1
1 addition, 1 deletion
src/TNL/Containers/Vector.h
with
24 additions
and
12 deletions
src/TNL/Containers/StaticVector.h
+
23
−
11
View file @
1a3a21fd
...
...
@@ -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 v
ector co
mponents to v
/
** \brief See StaticVector::StaticV
ector
(
co
nst 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
;
...
...
This diff is collapsed.
Click to expand it.
src/TNL/Containers/Vector.h
+
1
−
1
View file @
1a3a21fd
...
...
@@ -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.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment