Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ced84a1a58 | ||
|
|
81a513640b | ||
|
|
27b1c5f59f | ||
|
|
26e69d1e3a | ||
|
|
efab35fc57 | ||
|
|
928e5d497f | ||
|
|
ef95c25d2f | ||
|
|
2b606b139c | ||
|
|
c7a284cb86 | ||
|
|
ac6156edab | ||
|
|
e5b38c4d25 | ||
|
|
f9e28e2761 | ||
|
|
0acc48af3c | ||
|
|
70c64fabc0 | ||
|
|
e0a25e5936 | ||
|
|
54bfbe711b | ||
|
|
b499e8f460 | ||
|
|
ac08d9b0cc |
@@ -543,7 +543,7 @@ Conrad Sanderson and Ryan Curtin.
|
||||
<tr style="background-color: #F5F5F5;"><td><a href="#running_stat">running_stat</a></td><td> </td><td>running statistics of scalars (one dimensional process/signal)</td></tr>
|
||||
<tr style="background-color: #F5F5F5;"><td><a href="#running_stat_vec">running_stat_vec</a></td><td> </td><td>running statistics of vectors (multi-dimensional process/signal)</td></tr>
|
||||
<tr><td><a href="#kmeans">kmeans</a></td><td> </td><td>cluster data into disjoint sets</td></tr>
|
||||
<tr><td><a href="#gmm_diag">gmm_diag/gmm_full</a></td><td> </td><td>probabilistic clustering and likelihood calculation via Gaussian mixture models</td></tr>
|
||||
<tr><td><a href="#gmm_diag">gmm_diag/gmm_full</a></td><td> </td><td>probabilistic clustering and likelihood calculation via mixture of Gaussians</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</ul>
|
||||
@@ -4218,7 +4218,6 @@ See also:
|
||||
<li><a href="#submat">submatrix views</a></li>
|
||||
<li><a href="#diag">diagonal views</a></li>
|
||||
<li><a href="#repmat">repmat()</a></li>
|
||||
<li><a href="#pow">pow()</a></li>
|
||||
<li><a href="#for_each">.for_each()</a></li>
|
||||
<li><a href="#each_slice">.each_slice()</a></li>
|
||||
</ul>
|
||||
@@ -4323,7 +4322,6 @@ See also:
|
||||
<ul>
|
||||
<li><a href="#operators">math & relational operators</a></li>
|
||||
<li><a href="#subcube">subcube views</a></li>
|
||||
<li><a href="#pow">pow()</a></li>
|
||||
<li><a href="#for_each">.for_each()</a></li>
|
||||
<li><a href="#each_colrow">.each_col() & .each_row()</a> </li>
|
||||
<li><a href="https://www.cprogramming.com/c++11/c++11-lambda-closures.html">lambda function</a> at cprogramming.com</li>
|
||||
@@ -10757,9 +10755,11 @@ See also:
|
||||
<tbody>
|
||||
<tr><td><b>pow( A, scalar )</b></td><td> </td><td>(form 1)</td></tr>
|
||||
<tr><td><b>pow( A, B )</b></td><td> </td><td>(form 2)</td></tr>
|
||||
<!--
|
||||
<tr><td><b>pow( M.each_col(), C )</b></td><td> </td><td>(form 3)</td></tr>
|
||||
<tr><td><b>pow( M.each_row(), R )</b></td><td> </td><td>(form 4)</td></tr>
|
||||
<tr><td><b>pow( Q.each_slice(), M )</b></td><td> </td><td>(form 5)</td></tr>
|
||||
-->
|
||||
</tbody>
|
||||
</table>
|
||||
<ul>
|
||||
@@ -10767,9 +10767,9 @@ See also:
|
||||
<br>
|
||||
<li>form 1: raise all elements in <i>A</i> to the power denoted by the given scalar</li>
|
||||
<br>
|
||||
<li>form 2: raise each element in <i>A</i> to the power denoted by the corresponding element in <i>B</i>;
|
||||
<br>the sizes of <i>A</i> and <i>B</i> must be the same</li>
|
||||
<li>form 2: raise each element in <i>A</i> to the power denoted by the corresponding element in <i>B</i>; sizes of <i>A</i> and <i>B</i> must be the same</li>
|
||||
<br>
|
||||
<!--
|
||||
<li>form 3: for each column vector of matrix <i>M</i>, raise each element to the power denoted by the corresponding element in column vector <i>C</i>;
|
||||
<br>the number of rows in <i>M</i> and <i>C</i> must be the same</li>
|
||||
<br>
|
||||
@@ -10779,6 +10779,7 @@ See also:
|
||||
<li>form 5: for each slice of cube <i>Q</i>, raise each element to the power denoted by the corresponding element in matrix <i>M</i>;
|
||||
<br>the number of rows and columns in <i>Q</i> and <i>M</i> must be the same</li>
|
||||
<br>
|
||||
-->
|
||||
<li><b>Caveats</b>:
|
||||
<ul>
|
||||
<li>to raise all elements to the power 2, use <a href="#misc_fns">square()</a> instead</li>
|
||||
@@ -10794,13 +10795,14 @@ mat B(5, 6, fill::randu);
|
||||
|
||||
mat X = pow(A, 3.45);
|
||||
mat Y = pow(A, B);
|
||||
|
||||
</pre>
|
||||
<!--
|
||||
vec C(5, fill::randu);
|
||||
rowvec R(6, fill::randu);
|
||||
|
||||
mat Z1 = pow(A.each_col(), C);
|
||||
mat Z2 = pow(A.each_row(), R);
|
||||
</pre>
|
||||
-->
|
||||
</ul>
|
||||
</li>
|
||||
<br>
|
||||
@@ -10808,10 +10810,11 @@ mat Z2 = pow(A.each_row(), R);
|
||||
See also:
|
||||
<ul>
|
||||
<li><a href="#powmat">powmat()</a></li>
|
||||
<li><a href="#abs">abs()</a></li>
|
||||
<li><a href="#misc_fns">miscellaneous element-wise functions</a></li>
|
||||
<!--
|
||||
<li><a href="#each_colrow">.each_col() & .each_row()</a></li>
|
||||
<li><a href="#each_slice">.each_slice()</a></li>
|
||||
-->
|
||||
</ul>
|
||||
</li>
|
||||
<br>
|
||||
@@ -15359,8 +15362,8 @@ For the <i>var()</i> and <i>stddev()</i> functions:
|
||||
<br>
|
||||
<li>
|
||||
<b>Caveat:</b>
|
||||
to obtain statistics for integer matrices/vectors (eg. <a href="#Mat">umat</a>, <a href="#Mat">imat</a>, <a href="#Col">uvec</a>, <a href="#Col">ivec</a>),
|
||||
convert to a matrix/vector with floating point values (eg. <a href="#Mat">mat</a>, <a href="#Col">vec</a>) using the <a href="#conv_to">conv_to()</a> function
|
||||
to obtain statistics for an integer vector or matrix (eg. <a href="#Col">uvec</a>, <a href="#Col">ivec</a>),
|
||||
first use the <a href="#conv_to">conv_to()</a> function to obtain a floating point representation (eg. <a href="#Col">vec</a>)
|
||||
</li>
|
||||
<br>
|
||||
<li>
|
||||
@@ -15375,6 +15378,9 @@ double m = mean(mean(A));
|
||||
|
||||
vec v(5, fill::randu);
|
||||
double x = var(v);
|
||||
|
||||
ivec w = {1, 2, 3, 4}; // integer vector
|
||||
double y = mean( conv_to<vec>::from(w) );
|
||||
</pre>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -19116,7 +19122,7 @@ Armadillo extensively uses template meta-programming,
|
||||
so it's recommended to enable optimisation when compiling programs (eg. use the -O2 or -O3 options for GCC or clang)
|
||||
</li>
|
||||
<br>
|
||||
<li>See the <a href="http://arma.sourceforge.net/faq.html">Questions</a> page for more info on compiling and linking</li>
|
||||
<li>See the <a href="https://arma.sourceforge.net/faq.html">Questions</a> page for more info on compiling and linking</li>
|
||||
<br>
|
||||
<li>See also the example program that comes with the Armadillo archive</li>
|
||||
</ul>
|
||||
@@ -20212,7 +20218,7 @@ List of additions and changes for each version:
|
||||
<a name="version_114"></a>
|
||||
<li>Version 11.4:
|
||||
<ul>
|
||||
<li>extended <a href="#pow">pow()</a> with various forms of element-wise power operations</li>
|
||||
<li>extended <a href="#pow">pow()</a> with secondary element-wise form</li>
|
||||
<li>added <a href="#find_nan">find_nan()</a> to find indices of NaN elements</li>
|
||||
<li>faster handling of compound expressions by <a href="#sum">sum()</a></li>
|
||||
</ul>
|
||||
@@ -20589,7 +20595,7 @@ this requires a C++11/C++14 compiler with OpenMP 3.1+ support
|
||||
<ul>
|
||||
<li>
|
||||
changed license to the permissive <a href="https://opensource.org/licenses/Apache-2.0">Apache License 2.0</a>;
|
||||
see the <a href="http://arma.sourceforge.net/faq.html#license">Questions page</a> for more info
|
||||
see the <a href="https://arma.sourceforge.net/faq.html#license">Questions page</a> for more info
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#define ARMA_VERSION_MAJOR 14
|
||||
#define ARMA_VERSION_MINOR 0
|
||||
#define ARMA_VERSION_PATCH 2
|
||||
#define ARMA_VERSION_PATCH 4
|
||||
#define ARMA_VERSION_NAME "Stochastic Parrot"
|
||||
|
||||
|
||||
|
||||
@@ -50,7 +50,8 @@ class fft_engine_fftw3
|
||||
podarray<cx_type> Y_work; // for storing output
|
||||
|
||||
inline
|
||||
~fft_engine_fftw3()
|
||||
void
|
||||
finish()
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
@@ -59,6 +60,33 @@ class fft_engine_fftw3
|
||||
// fftw3::cleanup<cx_type>(); // NOTE: this also removes any wisdom acquired by FFTW3
|
||||
}
|
||||
|
||||
inline
|
||||
~fft_engine_fftw3()
|
||||
{
|
||||
arma_debug_sigprint();
|
||||
|
||||
#if defined(ARMA_USE_OPENMP)
|
||||
{
|
||||
#pragma omp critical (arma_fft_engine_fftw3)
|
||||
{
|
||||
(*this).finish();
|
||||
}
|
||||
}
|
||||
#elif defined(ARMA_USE_STD_MUTEX)
|
||||
{
|
||||
std::mutex& plan_mutex = fft_engine_fftw3_aux::get_plan_mutex();
|
||||
|
||||
const std::lock_guard<std::mutex> lock(plan_mutex);
|
||||
|
||||
(*this).finish();
|
||||
}
|
||||
#else
|
||||
{
|
||||
(*this).finish();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
inline
|
||||
fft_engine_fftw3(const uword in_N)
|
||||
: N (in_N )
|
||||
|
||||
@@ -993,6 +993,8 @@ accu(const SpGlue<T1,T2,spglue_schur>& expr)
|
||||
const SpProxy<T1> px(expr.A);
|
||||
const SpProxy<T2> py(expr.B);
|
||||
|
||||
arma_conform_assert_same_size(px.get_n_rows(), px.get_n_cols(), py.get_n_rows(), py.get_n_cols(), "element-wise multiplication");
|
||||
|
||||
typename SpProxy<T1>::const_iterator_type x_it = px.begin();
|
||||
typename SpProxy<T1>::const_iterator_type x_it_end = px.end();
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
template<typename T1, typename T2>
|
||||
arma_warn_unused
|
||||
arma_inline
|
||||
inline
|
||||
typename
|
||||
enable_if2
|
||||
<
|
||||
@@ -44,7 +44,7 @@ pow
|
||||
|
||||
|
||||
template<typename parent, unsigned int mode, typename T2>
|
||||
arma_warn_unused
|
||||
arma_deprecated
|
||||
inline
|
||||
Mat<typename parent::elem_type>
|
||||
pow
|
||||
@@ -62,7 +62,7 @@ pow
|
||||
|
||||
template<typename T1, typename T2>
|
||||
arma_warn_unused
|
||||
arma_inline
|
||||
inline
|
||||
const GlueCube<T1, T2, glue_powext>
|
||||
pow
|
||||
(
|
||||
@@ -78,7 +78,7 @@ pow
|
||||
|
||||
|
||||
template<typename eT, typename T2>
|
||||
arma_warn_unused
|
||||
arma_deprecated
|
||||
inline
|
||||
Cube<eT>
|
||||
pow
|
||||
@@ -100,7 +100,7 @@ pow
|
||||
|
||||
template<typename T1, typename T2>
|
||||
arma_warn_unused
|
||||
arma_inline
|
||||
inline
|
||||
typename
|
||||
enable_if2
|
||||
<
|
||||
@@ -121,7 +121,7 @@ pow
|
||||
|
||||
|
||||
template<typename parent, unsigned int mode, typename T2>
|
||||
arma_warn_unused
|
||||
arma_deprecated
|
||||
inline
|
||||
typename
|
||||
enable_if2
|
||||
@@ -144,7 +144,7 @@ pow
|
||||
|
||||
template<typename T1, typename T2>
|
||||
arma_warn_unused
|
||||
arma_inline
|
||||
inline
|
||||
const mtGlueCube<typename T1::elem_type, T1, T2, glue_powext_cx>
|
||||
pow
|
||||
(
|
||||
@@ -160,7 +160,7 @@ pow
|
||||
|
||||
|
||||
template<typename T, typename T2>
|
||||
arma_warn_unused
|
||||
arma_deprecated
|
||||
inline
|
||||
Cube< std::complex<T> >
|
||||
pow
|
||||
|
||||
@@ -41,7 +41,7 @@ op_median::apply(Mat<typename T1::elem_type>& out, const Op<T1,op_median>& expr)
|
||||
{
|
||||
Mat<eT> tmp;
|
||||
|
||||
op_median::apply_noalias(out, U.M, dim);
|
||||
op_median::apply_noalias(tmp, U.M, dim);
|
||||
|
||||
out.steal_mem(tmp);
|
||||
}
|
||||
|
||||
@@ -216,7 +216,19 @@ op_powmat_cx::apply_direct(Mat< std::complex<typename T1::pod_type> >& out, cons
|
||||
Col<in_T> eigval;
|
||||
Mat<in_eT> eigvec;
|
||||
|
||||
const bool eig_status = eig_sym(eigval, eigvec, A);
|
||||
bool eig_status = eig_sym(eigval, eigvec, A);
|
||||
|
||||
if(eig_status)
|
||||
{
|
||||
// NOTE: when in_eT is real, pow(eigval, y) will produce NaN for negative eigenvalues and non-integer exponent;
|
||||
// NOTE: the all_pos check is a workaround
|
||||
|
||||
bool all_pos = true;
|
||||
|
||||
for(uword i=0; i < eigval.n_elem; ++i) { all_pos = (eigval[i] <= in_T(0)) ? false : all_pos; }
|
||||
|
||||
if(all_pos == false) { eig_status = false; }
|
||||
}
|
||||
|
||||
if(eig_status)
|
||||
{
|
||||
|
||||
@@ -2027,6 +2027,7 @@ sp_auxlib::run_aupd_plain
|
||||
arma_ignore(n_eigvals);
|
||||
arma_ignore(which);
|
||||
arma_ignore(X);
|
||||
arma_ignore(Xst);
|
||||
arma_ignore(sym);
|
||||
arma_ignore(n);
|
||||
arma_ignore(tol);
|
||||
|
||||
@@ -43,7 +43,7 @@ class subview_cube_each_common
|
||||
|
||||
|
||||
|
||||
|
||||
// NOTE: deliberately not derived from BaseCube
|
||||
template<typename eT>
|
||||
class subview_cube_each1 : public subview_cube_each_common<eT>
|
||||
{
|
||||
@@ -71,6 +71,7 @@ class subview_cube_each1 : public subview_cube_each_common<eT>
|
||||
|
||||
|
||||
|
||||
// NOTE: deliberately not derived from BaseCube
|
||||
template<typename eT, typename TB>
|
||||
class subview_cube_each2 : public subview_cube_each_common<eT>
|
||||
{
|
||||
|
||||
@@ -50,7 +50,7 @@ class subview_each_common
|
||||
|
||||
|
||||
|
||||
|
||||
// NOTE: deliberately not derived from Base
|
||||
template<typename parent, unsigned int mode>
|
||||
class subview_each1 : public subview_each_common<parent, mode>
|
||||
{
|
||||
@@ -80,6 +80,7 @@ class subview_each1 : public subview_each_common<parent, mode>
|
||||
|
||||
|
||||
|
||||
// NOTE: deliberately not derived from Base
|
||||
template<typename parent, unsigned int mode, typename TB>
|
||||
class subview_each2 : public subview_each_common<parent, mode>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user