Skip to content

Commit

Permalink
updating standard arithmetic operations documentation for Field
Browse files Browse the repository at this point in the history
  • Loading branch information
Haaaaron committed Dec 15, 2023
1 parent 3c556ec commit 744c74c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
11 changes: 8 additions & 3 deletions docs/guide/user_guide/field.dox
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
\page field_documentation Field

Field is the most important Datatype offered by HILA. The Field is a container of lattice fields, and is the general object we evolve and iterate over. The Field can be comprised of either [Standard types](#standard) or [Basic types](#basic) listed on the \subpage datatypes page.
Field is the most important Datatype offered by HILA. The Field is a container of lattice fields, and is the general object we evolve and iterate over. The Field can be comprised of either [Standard types](#standard) or [Basic types](#basic) listed on the [datatypes](#datatypes) page.

To see all the possible methods of a Field see the class page which lists comprehensive documentation.

Expand Down Expand Up @@ -427,7 +427,7 @@ onsites(ALL) f[X].gaussian_random();

# FFT

# Standard arithmetic methods and mathematical functions
# Standard mathematical methods

The standard arithmetic methods defined for fields are:

Expand All @@ -443,8 +443,13 @@ And arithmetic assignment methods:
- `Field::operator*=`
- `Field::operator/=`

The following mathematical methods which are defined for the field, use the definition of the element type of the Field:
The following mathematical methods which are defined for the field, use the definition of the element type T of the Field<T>:

- `Field::exp`
- `Field::log`
- `Field::sin`
- `Field::cos`
- `Field::tan`
- `Field::`

*/
1 change: 1 addition & 0 deletions docs/guide/user_guide/user_guide.dox
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This section is comprehensive description of the functionality HILA offers. For

- \subpage makefile
- \subpage field_documentation

- \subpage datatypes
- \subpage input_library
- \subpage test_input_and_layout
Expand Down
13 changes: 5 additions & 8 deletions libraries/plumbing/field.h
Original file line number Diff line number Diff line change
Expand Up @@ -722,12 +722,6 @@ class Field {
}
#endif

/**
* @name Standard arithmetic operations
* @brief Not all are always callable, e.g. division may not be implemented by all field types
* since division is not defined for all @p Field::T types.
* @{
*/
/**
* @brief Assignment operator.
*
Expand Down Expand Up @@ -1128,7 +1122,6 @@ class Field {
f[ALL] = ::imag((*this)[X]);
return f;
}
/** @} */

// Communication routines. These are all internal.
dir_mask_t start_gather(Direction d, Parity p = ALL) const;
Expand Down Expand Up @@ -1743,6 +1736,11 @@ void swap(Field<T> &A, Field<T> &B) {
///////////////////////////////////////////////////////////////////////
// Allow some arithmetic functions if implemented


/**
* @brief Exponential
* @memberof Field
*/
template <typename T, typename R = decltype(exp(std::declval<T>()))>
Field<R> exp(const Field<T> &arg) {
Field<R> res;
Expand Down Expand Up @@ -1867,7 +1865,6 @@ Field<A> imag(const Field<T> &arg) {
return arg.imag();
}


template <typename A, typename B, typename R = decltype(std::declval<A>() - std::declval<B>())>
double squarenorm_relative(const Field<A> &a, const Field<B> &b) {
double res = 0;
Expand Down

0 comments on commit 744c74c

Please sign in to comment.