Skip to content

Commit

Permalink
some docs impoved + doc tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jtlap committed Dec 13, 2023
1 parent fbf4b37 commit a37b011
Show file tree
Hide file tree
Showing 17 changed files with 202 additions and 21 deletions.
10 changes: 5 additions & 5 deletions include/kyosu/functions/cyl_bessel_h1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ namespace kyosu
//! @addtogroup functions
//! @{
//! @var cyl_bessel_h1
//! @brief Computes the Bessel functions of the third kind \f$H^{(1)\f$ and \f$H^{(2)}\f$,
//! @brief Computes the Bessel functions of the third kind \f$H^{(1)}\f$,
//!
//! @code
//! #include <kyosu/functions.hpp>
Expand Down Expand Up @@ -87,16 +87,16 @@ namespace kyosu
//!
//! * `nu`: scalar floating order of the function.
//! * `z`: Value to process.
//! * `h1s: range able to contain int(nu)+1 complex values (of type complex_t<T> or Z respectively)
//! * `h1s: range able to contain `n = int(abs(nu))+1` complex values (of type complex_t<T> or Z respectively)
//!
//! **Return value**
//!
//! * returns \f$\{H^{(1)}_\nu(z)\}f$.
//! * returns \f$H^{(1)}_\nu(z)\f$.
//!
//! *Ouput values
//!
//! * on output (if present) h1s contains the values of \f$((H^{(1)}_{\vu_0+i})_{i = 0\cdot n}\f$;
//! where \f$\vu_0\f$ is the fractional part of $\vu\f$
//! * on output (if present) h1s contains the values of \f$ (H^{(1)}_{\nu_0+\epsilon i})_{i = 0 \cdots n} \f$;
//! where \f$ \nu_0 \f$ is the fractional part of \f$\nu\f$ and \f$\epsilon\f$ is the sign of \f$ \nu\f$.
//!
//! @groupheader{Example}
//!
Expand Down
12 changes: 6 additions & 6 deletions include/kyosu/functions/cyl_bessel_h12.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace kyosu
//! @addtogroup functions
//! @{
//! @var cyl_bessel_h12
//! @brief Computes the Bessel functions of the third kind \f$H^{(1)\f$ and \f$H^{(2)}\f$,
//! @brief Computes the Bessel functions of the third kind \f$ H^{(1)} \f$ and \f$ H^{(2)} \f$,
//!
//! @code
//! #include <kyosu/functions.hpp>
Expand All @@ -67,17 +67,17 @@ namespace kyosu
//!
//! * `n`: scalar floating order of the function.
//! * `z`: Value to process.
//! * `h1s: range able to contain int(nu)+1 complex values (of type complex_t<T> or Z respectively)
//! * `h2s: range able to contain int(nu)+1 complex values (of type complex_t<T> or Z respectively)
//! * `h1s: range able to contain `n = int(abs(nu))+1` complex values (of type complex_t<T> or Z respectively)
//! * `h2s: range able to contain `n = int(abs(nu))+1` complex values (of type complex_t<T> or Z respectively)
//!
//! **Return value**
//!
//! * returns the kumi pair \f$\{J_\nu(z), Y_\nu(z)\}f$.
//! * returns the kumi pair \f$ \{ H^{(1)}_\nu(z). H^{(2)}_\nu(z) \} \f$.
//!
//! *Ouput values
//!
//! * on output h1s contains the values of \f$((H^{1}_{\vu_0+i})_{i = 0\cdot \vu}\f$, where \f$\vu_0\f$ is the fractional part of $\vu\f$
//! * on output h2s contains the values of \f$((H^{2}_{\vu_0+i})_{i = 0\cdot \vu}\f$, where \f$\vu_0\f$ is the fractional part of $\vu\f$
//! * on output (if present) h1s and h2s contains the values of \f$ (H^{(1\|2)}_{\nu_0+\epsilon i})_{i = 0 \cdots n} \f$
//! respectively, where \f$ \nu_0 \f$ is the fractional part of \f$\nu\f$ and \f$\epsilon\f$ is the sign of \f$ \nu\f$.
//!
//! @groupheader{Example}
//!
Expand Down
4 changes: 2 additions & 2 deletions include/kyosu/functions/cyl_bessel_h1_0.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace kyosu::tags
template<eve::floating_ordered_value T>
static KYOSU_FORCEINLINE auto deferred_call(auto, T const& v) noexcept
{
auto fn = callable_cyl_bessel_h1_0{};
auto fn = callable_cyl_bessel_h1_0{};
return fn(complex(v));
}

Expand Down Expand Up @@ -55,7 +55,7 @@ namespace kyosu
//! namespace kyosu
//! {
//! template<kyosu::concepts::cayley_dickson T> constexpr auto cyl_bessel_h1_0(T z) noexcept;
//! template<eve::floating_ordered_value T> constexpr T cyl_bessel_h1_0(T z) noexcept;
//! template<eve::floating_ordered_value T> constexpr auto cyl_bessel_h1_0(T z) noexcept;
//! }
//! @endcode
//!
Expand Down
2 changes: 1 addition & 1 deletion include/kyosu/functions/cyl_bessel_h1_1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ namespace kyosu
//! namespace kyosu
//! {
//! template<kyosu::concepts::cayley_dickson T> constexpr auto cyl_bessel_h1_1(T z) noexcept;
//! template<eve::floating_ordered_value T> constexpr T cyl_bessel_h1_1(T z) noexcept;
//! template<eve::floating_ordered_value T> constexpr auto cyl_bessel_h1_1(T z) noexcept;
//! }
//! @endcode
//!
Expand Down
10 changes: 5 additions & 5 deletions include/kyosu/functions/cyl_bessel_h2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ namespace kyosu
//! @addtogroup functions
//! @{
//! @var cyl_bessel_h2
//! @brief Computes the Bessel functions of the third kind \f$H^{(2)\f$ and \f$H^{(2)}\f$,
//! @brief Computes the Bessel functions of the third kind \f$ H^{(2)}_\nu \f$,
//!
//! @code
//! #include <kyosu/functions.hpp>
Expand Down Expand Up @@ -87,16 +87,16 @@ namespace kyosu
//!
//! * `nu`: scalar floating order of the function.
//! * `z`: Value to process.
//! * `h2s: range able to contain int(nu)+1 complex values (of type complex_t<T> or Z respectively)
//! * `h2s: range able to contain `n = int(abs(nu))+1` complex values (of type complex_t<T> or Z respectively)
//!
//! **Return value**
//!
//! * returns \f$\{H^{(2)}_\nu(z)\}f$.
//! * returns \f$H^{(2)}_\nu(z)\f$.
//!
//! *Ouput values
//!
//! * on output (if present) h2s contains the values of \f$((H^{(2)}_{\vu_0+i})_{i = 0\cdot n}\f$;
//! where \f$\vu_0\f$ is the fractional part of $\vu\f$
//! * on output (if present) h2s contains the values of \f$ (H^{(2)}_{\nu_0+\epsilon i})_{i = 0 \cdots n} \f$,
//! where \f$ \nu_0 \f$ is the fractional part of \f$\nu\f$ and \f$\epsilon\f$ is the sign of \f$ \nu\f$.
//!
//! @groupheader{Example}
//!
Expand Down
14 changes: 13 additions & 1 deletion include/kyosu/functions/cyl_bessel_i.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,31 @@ namespace kyosu
//! constexpr auto cyl_bessel_i(N nu, T z) noexcept;
//!
//! template<eve::floating_ordered_value, eve::floating_ordered_value T>
//! constexpr T cyl_bessel_i(N n, T z) noexcept;
//! constexpr T cyl_bessel_i(N nu, T z) noexcept;
//!
//! template<eve::floating_ordered_value, kyosu::concepts::cayley_dickson T, Range R>
//! constexpr auto cyl_bessel_i(N nu, T z, R & is) noexcept;
//!
//! template<eve::floating_ordered_value, eve::floating_ordered_value T, Range R>
//! constexpr T cyl_bessel_i(N nu, T z, R& is) noexcept;
//! }
//! @endcode
//!
//! **Parameters**
//!
//! * `nu`: order of the function.
//! * `z`: Value to process.
//! * `is`: Ouput range able to contain `n = int(abs(nu))+1` complex values (of type complex_t<T> or Z respectively)
//!
//! **Return value**
//!
//! * returns \f$I_\nu(z)\f$.
//!
//! *Ouput values
//!
//! * on output (if present) 1s contains the values of \f$ (I^{(1)}_{\nu_0+\epsilon i})_{i = 0 \cdots n} \f$;
//! where \f$ \nu_0 \f$ is the fractional part of \f$\nu\f$ and \f$\epsilon\f$ is the sign of \f$ \nu\f$.
//!
//! @groupheader{Example}
//!
//! @godbolt{doc/cyl_bessel_i.cpp}
Expand Down
2 changes: 1 addition & 1 deletion include/kyosu/functions/sph_bessel_h1_0.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//======================================================================================================================
//======================================================================================================================
/*
Kyosu - Complex Without Complexes
Copyright: KYOSU Contributors & Maintainers
Expand Down
20 changes: 20 additions & 0 deletions test/doc/cyl_bessel_h1.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <iostream>

int main()
{
std::cout.precision(16);
using w_t = eve::wide<double, eve::fixed<2>>;
auto z = kyosu::complex(w_t(20.0, 1.5), w_t(0.0, 1.5));
auto v = 0.0;
std::cout << "z " << z << std::endl;
for(int n=0; n <= 3; ++n)
{
auto h1 = kyosu::cyl_bessel_h1(v, z);
std::cout << "v " << v << std::endl;
std::cout << "yl_bessel_h1(v, z) " << h1 << std::endl;
v = v+0.25;
}
return 0;
}
20 changes: 20 additions & 0 deletions test/doc/cyl_bessel_h12.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <iostream>

int main()
{
std::cout.precision(16);
using w_t = eve::wide<double, eve::fixed<2>>;
auto z = kyosu::complex(w_t(20.0, 1.5), w_t(0.0, 1.5));
auto v = 3.3;
std::cout << "z " << z << std::endl;
std::vector<decltype(z)> h1(4), h2(4);
kyosu::cyl_bessel_h12(v, z, h1, h2);
for(int n=0; n <= 3; ++n)
{
std::cout << "h1[" << n << "] = " << h1[n] << std::endl;
std::cout << "h2[" << n << "] = " << h2[n] << std::endl;
}
return 0;
}
13 changes: 13 additions & 0 deletions test/doc/cyl_bessel_h1_0.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <iostream>

int main()
{
std::cout.precision(16);
using w_t = eve::wide<double, eve::fixed<2>>;
auto z = kyosu::complex(w_t(20.0, 1.5), w_t(0.0, 1.5));
std::cout << "z " << z << std::endl;
std::cout << "cyl_bessel_h1_0(z) " << kyosu::cyl_bessel_h1_0(z) << std::endl;
return 0;
}
13 changes: 13 additions & 0 deletions test/doc/cyl_bessel_h1_1.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <iostream>

int main()
{
std::cout.precision(16);
using w_t = eve::wide<double, eve::fixed<2>>;
auto z = kyosu::complex(w_t(20.0, 1.5), w_t(0.0, 1.5));
std::cout << "z " << z << std::endl;
std::cout << "cyl_bessel_h1_1(z) " << kyosu::cyl_bessel_h1_1(z) << std::endl;
return 0;
}
20 changes: 20 additions & 0 deletions test/doc/cyl_bessel_h2.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <iostream>

int main()
{
std::cout.precision(16);
using w_t = eve::wide<double, eve::fixed<2>>;
auto z = kyosu::complex(w_t(20.0, 1.5), w_t(0.0, 1.5));
auto v = 0.0;
std::cout << "z " << z << std::endl;
for(int n=0; n <= 3; ++n)
{
auto h2 = kyosu::cyl_bessel_h2(v, z);
std::cout << "v " << v << std::endl;
std::cout << "yl_bessel_h2(v, z) " << h2 << std::endl;
v = v+0.25;
}
return 0;
}
13 changes: 13 additions & 0 deletions test/doc/cyl_bessel_h2_0.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <iostream>

int main()
{
std::cout.precision(16);
using w_t = eve::wide<double, eve::fixed<2>>;
auto z = kyosu::complex(w_t(20.0, 1.5), w_t(0.0, 1.5));
std::cout << "z " << z << std::endl;
std::cout << "cyl_bessel_h2_0(z) " << kyosu::cyl_bessel_h2_0(z) << std::endl;
return 0;
}
13 changes: 13 additions & 0 deletions test/doc/cyl_bessel_h2_1.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <iostream>

int main()
{
std::cout.precision(16);
using w_t = eve::wide<double, eve::fixed<2>>;
auto z = kyosu::complex(w_t(20.0, 1.5), w_t(0.0, 1.5));
std::cout << "z " << z << std::endl;
std::cout << "cyl_bessel_h2_1(z) " << kyosu::cyl_bessel_h2_1(z) << std::endl;
return 0;
}
19 changes: 19 additions & 0 deletions test/doc/cyl_bessel_i.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <iostream>

int main()
{
std::cout.precision(16);
using w_t = eve::wide<double, eve::fixed<2>>;
auto z = kyosu::complex(w_t(20.0, 1.5), w_t(0.0, 1.5));
auto v = 3.3;
std::cout << "z " << z << std::endl;
std::vector<decltype(z)> is(4);
kyosu::cyl_bessel_i(v, z, is);
for(int n=0; n <= 3; ++n)
{
std::cout << "is[" << n << "] = " << is[n] << std::endl;
}
return 0;
}
19 changes: 19 additions & 0 deletions test/doc/cyl_bessel_j.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <iostream>

int main()
{
std::cout.precision(16);
using w_t = eve::wide<double, eve::fixed<2>>;
auto z = kyosu::complex(w_t(20.0, 1.5), w_t(0.0, 1.5));
auto v = 3.3;
std::cout << "z " << z << std::endl;
std::vector<decltype(z)> js(4);
kyosu::cyl_bessel_j(v, z, js);
for(int n=0; n <= 3; ++n)
{
std::cout << "js[" << n << "] = " << js[n] << std::endl;
}
return 0;
}
19 changes: 19 additions & 0 deletions test/doc/cyl_bessel_k.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <kyosu/kyosu.hpp>
#include <eve/wide.hpp>
#include <iostream>

int main()
{
std::cout.precision(16);
using w_t = eve::wide<double, eve::fixed<2>>;
auto z = kyosu::complex(w_t(20.0, 1.5), w_t(0.0, 1.5));
auto v = 3.3;
std::cout << "z " << z << std::endl;
std::vector<decltype(z)> ks(4);
kyosu::cyl_bessel_k(v, z, ks);
for(int n=0; n <= 3; ++n)
{
std::cout << "ks[" << n << "] = " << ks[n] << std::endl;
}
return 0;
}

0 comments on commit a37b011

Please sign in to comment.