aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc
diff options
context:
space:
mode:
authorGravatar Ilya Tokar <tokarip@google.com>2019-12-16 16:00:35 -0500
committerGravatar Ilya Tokar <tokarip@google.com>2020-01-07 21:22:44 +0000
commit19876ced76bd1730008e02fc4c43c2228faed38a (patch)
tree22f999134e79f84f6f9dc0d19bdfa6740db416f0 /doc
parentd0ae052da4ce25a5b4306bfbb5bf8edcd010b663 (diff)
Bug #1785: Introduce numext::rint.
This provides a new op that matches std::rint and previous behavior of pround. Also adds corresponding unsupported/../Tensor op. Performance is the same as e. g. floor (tested SSE/AVX).
Diffstat (limited to 'doc')
-rw-r--r--doc/CoeffwiseMathFunctionsTable.dox11
-rw-r--r--doc/snippets/Cwise_rint.cpp3
2 files changed, 14 insertions, 0 deletions
diff --git a/doc/CoeffwiseMathFunctionsTable.dox b/doc/CoeffwiseMathFunctionsTable.dox
index 8186a5272..ce2f5e097 100644
--- a/doc/CoeffwiseMathFunctionsTable.dox
+++ b/doc/CoeffwiseMathFunctionsTable.dox
@@ -395,6 +395,17 @@ This also means that, unless specified, if the function \c std::foo is available
<td>SSE4,AVX,ZVector (f,d)</td>
</tr>
<tr>
+ <td class="code">
+ \anchor cwisetable_rint
+ a.\link ArrayBase::rint rint\endlink(); \n
+ \link Eigen::rint rint\endlink(a);
+ </td>
+ <td>nearest integer, \n rounding to nearest even in halfway cases</td>
+ <td>built-in generic implementation using <a href="http://en.cppreference.com/w/cpp/numeric/math/rint">\c std::rint</a>
+ or <a href="http://en.cppreference.com/w/c/numeric/math/rint">\c rintf</a>; </td>
+ <td>SSE4,AVX (f,d)</td>
+</tr>
+<tr>
<th colspan="4">Floating point manipulation functions</th>
</tr>
<tr>
diff --git a/doc/snippets/Cwise_rint.cpp b/doc/snippets/Cwise_rint.cpp
new file mode 100644
index 000000000..1dc7b2fd1
--- /dev/null
+++ b/doc/snippets/Cwise_rint.cpp
@@ -0,0 +1,3 @@
+ArrayXd v = ArrayXd::LinSpaced(7,-2,2);
+cout << v << endl << endl;
+cout << rint(v) << endl;