Skip to content

Commit

Permalink
Merge pull request #409 from mlpack/feature/arma_14.2.0_change
Browse files Browse the repository at this point in the history
Armadillo 14.2.0 deprecation changes to (index) .min() and .max()
  • Loading branch information
eddelbuettel authored Nov 20, 2024
2 parents 882f878 + b19f75e commit 7bff766
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 3 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
* Bump minimum Armadillo version to 10.8
([#404](https://github.com/mlpack/ensmallen/pull/404)).

* For Armadillo 14.2.0 switch to `.index_min()` and `.index_max()`
([#409](https://github.com/mlpack/ensmallen/pull/409).

### ensmallen 2.21.1: "Bent Antenna"
###### 2024-02-15
* Fix numerical precision issues for small-gradient L-BFGS scaling factor
Expand Down
3 changes: 1 addition & 2 deletions include/ensmallen_bits/fw/atoms.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ class Atoms
// Find possible atom to be deleted.
arma::vec gap = sqTerm -
currentCoeffs % trans(gradient.t() * currentAtoms);
arma::uword ind;
gap.min(ind);
arma::uword ind = gap.index_min();

// Try deleting the atom.
arma::mat newAtoms(currentAtoms.n_rows, currentAtoms.n_cols - 1);
Expand Down
4 changes: 2 additions & 2 deletions include/ensmallen_bits/fw/constr_lpball.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ class ConstrLpBallSolver
else
s = arma::abs(v);

arma::uword k = 0;
s.max(k); // k is the linear index of the largest element.
// k is the linear index of the largest element.
arma::uword k = s.index_max();
s.zeros();
// Take the sign of v(k).
s(k) = -((0.0 < v(k)) - (v(k) < 0.0));
Expand Down

0 comments on commit 7bff766

Please sign in to comment.