Fixes #2735: Component-wise cbrt

This commit is contained in:
Kyle Macfarlan
2023-10-25 03:06:13 +00:00
committed by Charles Schlosser
parent 48b254a4bc
commit 5de0f2f89e
14 changed files with 87 additions and 2 deletions

View File

@@ -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)

View File

@@ -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

View File

@@ -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()

View File

@@ -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

View File

@@ -0,0 +1,2 @@
Array3d v(1,2,4);
cout << v.cbrt() << endl;