mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Fixes #2735: Component-wise cbrt
This commit is contained in:
committed by
Charles Schlosser
parent
48b254a4bc
commit
5de0f2f89e
@@ -140,6 +140,8 @@ R.array().square() // P .^ 2
|
||||
R.array().cube() // P .^ 3
|
||||
R.cwiseSqrt() // sqrt(P)
|
||||
R.array().sqrt() // sqrt(P)
|
||||
R.cwiseCbrt() // cbrt(P)
|
||||
R.array().cbrt() // cbrt(P)
|
||||
R.array().exp() // exp(P)
|
||||
R.array().log() // log(P)
|
||||
R.cwiseMax(P) // max(R, P)
|
||||
|
||||
@@ -170,6 +170,19 @@ This also means that, unless specified, if the function \c std::foo is available
|
||||
sqrt(a[i]);</td>
|
||||
<td>SSE2, AVX (f,d)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="code">
|
||||
\anchor cwisetable_cbrt
|
||||
a.\link ArrayBase::cbrt cbrt\endlink(); \n
|
||||
\link Eigen::cbrt cbrt\endlink(a);\n
|
||||
m.\link MatrixBase::cwiseCbrt cwiseCbrt\endlink();
|
||||
</td>
|
||||
<td>computes cube root (\f$ \cbrt a_i \f$)</td>
|
||||
<td class="code">
|
||||
using <a href="http://en.cppreference.com/w/cpp/numeric/math/cbrt">std::cbrt</a>; \n
|
||||
cbrt(a[i]);</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="code">
|
||||
\anchor cwisetable_rsqrt
|
||||
|
||||
@@ -458,6 +458,7 @@ mat1.cwiseMax(mat2) mat1.cwiseMax(scalar)
|
||||
mat1.cwiseAbs2()
|
||||
mat1.cwiseAbs()
|
||||
mat1.cwiseSqrt()
|
||||
mat1.cwiseCbrt()
|
||||
mat1.cwiseInverse()
|
||||
mat1.cwiseProduct(mat2)
|
||||
mat1.cwiseQuotient(mat2)
|
||||
@@ -470,6 +471,7 @@ mat1.array().max(mat2.array()) mat1.array().max(scalar)
|
||||
mat1.array().abs2()
|
||||
mat1.array().abs()
|
||||
mat1.array().sqrt()
|
||||
mat1.array().cbrt()
|
||||
mat1.array().inverse()
|
||||
mat1.array() * mat2.array()
|
||||
mat1.array() / mat2.array()
|
||||
|
||||
@@ -172,6 +172,7 @@ sm2 = perm * sm1; // Permute the columns
|
||||
sm1.cwiseMax(sm2);
|
||||
sm1.cwiseAbs();
|
||||
sm1.cwiseSqrt();
|
||||
sm1.cwiseCbrt();
|
||||
\endcode</td>
|
||||
<td>
|
||||
sm1 and sm2 should have the same storage order
|
||||
|
||||
2
doc/snippets/Cwise_cbrt.cpp
Normal file
2
doc/snippets/Cwise_cbrt.cpp
Normal file
@@ -0,0 +1,2 @@
|
||||
Array3d v(1,2,4);
|
||||
cout << v.cbrt() << endl;
|
||||
Reference in New Issue
Block a user