Skip to content

Commit 89fb837

Browse files
rootroot
authored andcommitted
modify annotations in vector3 class
1 parent 68fdb1b commit 89fb837

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

source/module_base/test/vector3_test.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@
5757
* - overload operator "^" to calculate
5858
* - the cross product of two 3d vectors
5959
* - VeqV
60-
* - reload operator "==" to assert
60+
* - overload operator "==" to assert
6161
* - the equality between two 3d vectors
6262
* - VneV
63-
* - reload operator "!=" to assert
64-
* - the non-equality between two 3d vectors
63+
* - overload operator "!=" to assert
64+
* - the inequality between two 3d vectors
6565
* - StdOutV
66-
* - reload operator "<<" to print out
66+
* - overload operator "<<" to print out
6767
* - a 3d vectors on standard output
6868
* - PrintV
6969
* - print a 3d vectors on standard output

source/module_base/vector3.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,13 +345,27 @@ template <class T> inline bool operator==(const Vector3<T> &u, const Vector3<T>
345345
return false;
346346
}
347347

348+
/**
349+
* @brief Print a Vector3 on standard output with formats
350+
*
351+
*/
348352
template <class T> void Vector3<T>::print(void) const
349353
{
350354
std::cout.precision(5);
351355
std::cout << "(" << std::setw(10) << x << "," << std::setw(10) << y << "," << std::setw(10) << z << ")"
352356
<< std::endl;
353357
return;
354358
}
359+
360+
/**
361+
* @brief Overload "<<" tor print out a
362+
* Vector3 on standard output
363+
*
364+
* @tparam T
365+
* @param[in] os
366+
* @param[in] u
367+
* @return std::ostream&
368+
*/
355369
template <class T> static std::ostream &operator<<(std::ostream &os, const Vector3<T> &u)
356370
{
357371
os << "(" << std::setw(10) << u.x << "," << std::setw(10) << u.y << "," << std::setw(10) << u.z << ")";

0 commit comments

Comments
 (0)