From 4ccc2cf6bf87395ffd7f64b39ed3da8a71e89c98 Mon Sep 17 00:00:00 2001 From: Ryan Curtin Date: Wed, 2 Oct 2024 10:32:55 -0400 Subject: [PATCH 01/24] First steps towards documenting VPTree. --- doc/sidebar.html | 5 + doc/user/core/trees/binary_space_tree.md | 345 ++++++++++++++++++++- src/mlpack/core/tree/hollow_ball_bound.hpp | 10 - 3 files changed, 348 insertions(+), 12 deletions(-) diff --git a/doc/sidebar.html b/doc/sidebar.html index e49272ed4f..d02d5a3047 100644 --- a/doc/sidebar.html +++ b/doc/sidebar.html @@ -86,6 +86,11 @@ when the sidebar is built for each page. MeanSplitKDTree +
  • + + VPTree + +
  • BinarySpaceTree diff --git a/doc/user/core/trees/binary_space_tree.md b/doc/user/core/trees/binary_space_tree.md index de906335aa..1dcb401d2d 100644 --- a/doc/user/core/trees/binary_space_tree.md +++ b/doc/user/core/trees/binary_space_tree.md @@ -421,6 +421,8 @@ write a custom `BoundType` for use with `BinarySpaceTree`: * [`HRectBound`](#hrectbound): hyperrectangle bound, encloses the descendant points in the smallest possible hyperrectangle + * [`HollowBallBound`](#hollowballbound): hollow ball bound, equivalent to a + ball bound with a ball subtracted from it. * [Custom `BoundType`s](#custom-boundtypes): implement a fully custom `BoundType` @@ -567,7 +569,7 @@ operations with data points or other bounds. Once an `HRectBound` has been successfully created and set to the desired bounding hyperrectangle, there are a number of functions that can bound the -distance between a `HRectBound` and other objects. +distance between an `HRectBound` and other objects. * `b.Contains(point)` * `b.Contains(bound)` @@ -764,13 +766,352 @@ std::cout << "Distance between Manhattan distance HRectBound and " // point. arma::fmat floatData(3, 25, arma::fill::randu); mlpack::HRectBound cb; -cb |= floatData; // This will set the bound to [2.0, 3.0] in every dimension. +cb |= floatData; // Note the use of arma::fvec to represent a point, since ElemType is float. const mlpack::RangeType r3 = cb.RangeDistance(arma::fvec("1.5 1.5 4.0")); std::cout << "Distance between Chebyshev distance HRectBound and " << "[1.5, 1.5, 4.0]: [" << r3.Lo() << ", " << r3.Hi() << "]." << std::endl; ``` +### `HollowBallBound` + +The `HollowBallBound` class represents a bounding shape that is an +arbitrary-dimensional ball bound with another smaller ball subtracted from its +inside. A `HollowBallBound` consists of a center point, an outer radius, and a +secondary center point and inner radius. An example `HollowBallBound` is shown +below in two dimensions; shaded area represents area held within the bound. + +
    +hollow ball bound +
    + +`HollowBallBound` is used directly by the [`VPTree`](vptree.md) class. + +#### Constructors + +`HollowBallBound` allows configurable behavior via its two template parameters: + +``` +HollowBallBound +``` + +Different constructor forms can be used to specify different template parameters +(and thus different bound behavior). + + * `b = HollowBallBound(dimensionality)` + - Construct a `HollowBallBound` with the given `dimensionality`. + - The bound will be empty with invalid centers and radii (e.g., `b` will not + contain any points at all). + - The bound will use the [Euclidean distance](../distances.md#lmetric) for + distance computation, and will expect data to have elements with type + `double`. + + * `b = HollowBallBound(dimensionality)` + - Construct a `HollowBallBound` with the given `dimensionality` that will use + the given `DistanceType` class to compute distances, and expect data to + have elements with type `ElemType`. + - `ElemType` should generally be `double` or `float`. + + + +***Note***: these constructors provide an empty bound; be sure to +[grow](#growing-and-shrinking-the-bound-1) the bound or +[directly modify the bound](#accessing-and-modifying-properties-of-the-bound-1) +before using it! + +--- + + * `b = HollowBallBound(innerRadius, outerRadius, center)` + - Construct a `HollowBallBound` with the given `innerRadius` for the inner + ball, `outerRadius` for the outer ball, and `center`. + - Both the inner and outer ball are centered at `center`. + - `innerRadius` and `outerRadius` should have type `double`. + - `center` should have type `arma::vec`. + - The bound will use the [Euclidean distance](../distances.md#lmetric) for + distance computation, and will expect data to have elements with type + `double`. + + * `b = HollowBallBound(innerRadius, outerRadius, center)` + - Construct a `HollowBallBound` with the given `innerRadius` for the inner + ball, `outerRadius` for the outer ball, and `center`. + - Both the inner and outer ball are centered at `center`. + - `innerRadius` and `outerRadius` should have type `ElemType`. + - `center` should be a vector with element type `ElemType` (e.g. + `arma::Col`). + - The bound will use the given `DistanceType` class to compute distances, and + expect data to have elements with type `ElemType`. + +#### Accessing and modifying properties of the bound + +The individual bounds associated with each dimension of a `HollowBallBound` can +be accessed and modified. + + * `b.Dim()` will return a `size_t` indicating the dimensionality of the bound. + + * `b.Center()` returns an `arma::vec&` containing the center of the outer ball. + Its elements can be directly modified. + + * `b.HollowCenter()` returns an `arma::vec&` containing the center of the inner + ball. Its elements can be directly modified. + + * `b.OuterRadius()` will return a `double` that is the radius of the outer + ball. + - `b.OuterRadius() = r` will set the radius of the outer ball to `r`. + + * `b.InnerRadius()` will return a `double` that is the radius of the inner + ball. + - `b.InnerRadius() = r` will set the radius of the inner ball to `r`. + + * `b[dim]` will return a [`Range`](../math.md#range) object representing the + extents of the bound in dimension `dim`. + - The range is defined as + `[b.Center()[dim] - b.OuterRadius(), b.Center()[dim] + b.OuterRadius()]`. + - ***Note:*** this returns the maximum extents of the bound and does not + consider the inner (hollow) ball. + + * `b.Diameter()` returns the diameter of the ball. This is always equal to + `2 * b.OuterRadius()`. + + * `b.MinWidth()` returns the minimum width of the bound in any dimension as a + `double`. This is always equal to `b.Diameter()`. + + * `b.Distance()` returns either a + [`EuclideanDistance`](../distances.md#lmetric) distance metric object, or a + `DistanceType` if a custom `DistanceType` has been specified in the + constructor. + + * `b.Center(center)` will store the center of the `HollowBallBound` in the + vector `center`. `center` should be of type `arma::vec`. + + * `b.MinWidth()` returns the minimum width of the bound in any dimension as a + `double`. This value is cached and no computation is performed when calling + `b.MinWidth()`. If the bound is empty, `0` is returned. + + * `b.Distance()` returns either a + [`EuclideanDistance`](../distances.md#lmetric) distance metric object, or a + `DistanceType` if a custom `DistanceType` has been specified in the + constructor. + + * `b.Center(center)` will compute the center of the `HRectBound` (e.g. the + vector with elements equal to the midpoint of `b` in each dimension) and + store it in the vector `center`. `center` should be of type `arma::vec`. + + * `b.Volume()` computes the volume of the hyperrectangle specified by `b`. The + volume is returned as a `double`. + + * `b.Diameter()` computes the longest diagonal of the hyperrectangle specified + by `b`. + + * A `HollowBallBound` can be serialized with + [`data::Save()` and `data::Load()`](../../load_save.md#mlpack-objects). + +***Note:*** if a custom `ElemType` was specified in the constructor, then: + + * `b[dim]` will return a `RangeType`; + * `b.OuterRadius()`, `b.InnerRadius()`, `b.MinWidth()`, and `b.Diameter()` will + return `ElemType`; + * `b.Center()` and `b.HollowCenter()` will return `arma::Col&`; and + * `b.Center(center)` expects `center` to be of type `arma::Col`. + +#### Growing the bound + +The `HollowBallBound` uses the logical `|=` to grow the bound to include points. + + * `b |= data` expands `b` so the outer ball includes all of the data points in + `data`, shrinking the inner ball as necessary. `data` should be a + [column-major `arma::mat`](../../matrices.md#representing-data-in-mlpack). + The expansion operation is minimal, so `b` is not expanded any more than + necessary. + - The bound is grown using [Jack Ritter's bounding sphere + algorithm](https://en.wikipedia.org/wiki/Bounding_sphere#Ritter's_bounding_sphere), + which may move the center of the bound as it iteratively adds points to the + bound. (The hollow center is not moved.) + - If the bound is empty, the centers are initialized to the first point of + `data`. + - If the bound is not empty, then `data` is expected to have dimensionality + that matches `b.Dim()`. + +***Notes:*** + + - The growth operation does not grow the inner (hollow) ball. Properties + related to the inner ball should be set manually with `b.HollowCenter()` and + `b.InnerRadius()`. + + - If a custom `ElemType` was specified, then any `data` argument should be a + matrix with that `ElemType` (e.g. `arma::Mat`). + +#### Bounding distances to other objects + +Once a `HollowBallBound` has been successfully created and set to the desired +bounding balls, there are a number of functions that can bound the +distance between a `HollowBallBound` and other objects. + + * `b.Contains(point)` + * `b.Contains(bound)` + - Return a `bool` indicating whether or not `b` contains the given `point` + (an `arma::vec`) or another `bound` (an `HRectBound`). + - When passing another `bound`, `true` will be returned if `bound` even + partially overlaps with `b`. + + * `b.MinDistance(point)` + * `b.MinDistance(bound)` + - Return a `double` whose value is the minimum possible distance between `b` + and either a `point` (an `arma::vec`) or another `bound` (a + `HollowBallBound`). + - The minimum distance between `b` and another point or bound is the length + of the shortest possible line that can connect the other point or bound to + `b`. + - If `point` or `bound` are contained in `b`, then the returned distance is + 0. + + * `b.MaxDistance(point)` + * `b.MaxDistance(bound)` + - Return a `double` whose value is the maximum possible distance between `b` + and either a `point` (an `arma::vec`) or another `bound` (a + `HollowBallBound`). + - The maximum distance between `b` and a given `point` is the furthest + possible distance between `point` and any possible point falling within the + bounding hyperrectangle of `b`. + - The maximum distance between `b` and another `bound` is the furthest + possible distance between any possible point falling within the bounding + hyperrectangle of `b`, and any possible point falling within the bounding + hyperrectangle of `bound`. + - Note that this definition means that even if `b.Contains(point)` or + `b.Contains(bound)` is `true`, the maximum distance may be greater than + `0`. + + * `b.RangeDistance(point)` + * `b.RangeDistance(bound)` + - Compute the minimum and maximum distance between `b` and `point` or + `bound`, returning the result as a [`Range`](../math.md#range) object. + - This is more efficient than calling `b.MinDistance()` and + `b.MaxDistance()`. + +***Note:*** if a custom `DistanceType` and `ElemType` were specified in the +constructor, then all distances will be computed with respect to the specified +`DistanceType` and all return values will either be `ElemType` or +[`RangeType`](../math.md#range) (except for `Contains()`, which will +still return a `bool`). + +#### Example usage + +```c++ +// Create a hollow ball bound in 3 dimensions whose outer ball is the unit ball +// and whose inner ball is the ball with radius 0.5 centered at the origin. +// The bounding range for all three dimensions is [0.0, 1.0]. +mlpack::HollowBallBound b(0.5, 1.0, arma::vec(3)); + +std::cout << "Hollow unit ball bound created manually:" << std::endl; +std::cout << " - Center: " << b.Center().t(); +std::cout << " - Outer radius: " << b.OuterRadius() << "." << std::endl; +std::cout << " - Hollow center: " << b.HollowCenter.(); +std::cout << " - Inner radius: " << b.InnerRadius() << "." << std::endl; +for (size_t i = 0; i < 3; ++i) +{ + std::cout << " - Dimension " << i << " extents: [" << b[i].Lo() << ", " + << b[i].Hi() << "]." << std::endl; +} +std::cout << std::endl; + +// Create a small dataset of 5 points. +arma::mat dataset(3, 5); +dataset.col(0) = arma::vec("2.0 2.0 2.0"); +dataset.col(1) = arma::vec("2.5 2.5 2.5"); +dataset.col(2) = arma::vec("3.0 2.0 3.0"); +dataset.col(3) = arma::vec("2.0 3.0 2.0"); +dataset.col(4) = arma::vec("3.0 3.0 3.0"); + +// If we simply build a HollowBallBound to enclose those points, the hollow part +// of the ball is unmodified and remains empty. +mlpack::HollowBallBound b2(3); +b2 |= dataset; +std::cout << "Hollow ball bound on points with only `operator|=()`:" + << std::endl; +std::cout << " - Center: " << b2.Center().t(); +std::cout << " - Outer radius: " << b2.OuterRadius() << "." << std::endl; +std::cout << " - Hollow center: " << b2.HollowCenter().t(); +std::cout << " - Inner radius: " << b2.InnerRadius() << "." << std::endl; +std::cout << std::endl; + +// On the other hand, if we initialize a HollowBallBound to a non-empty bound, +// then `operator|=()` will shrink the hollow ball as necessary. +// +// We initialize this ball bound to a "slice" with radii [2.6, 2.7]. +mlpack::HollowBallBound b3(2.6, 2.7, arma::vec(3)); +b3 |= dataset; +std::cout << "Hollow ball bound on points with pre-initialization and " + << "`operator|=()`:" << std::endl; +std::cout << " - Center: " << b3.Center().t(); +std::cout << " - Outer radius: " << b3.OuterRadius() << "." << std::endl; +std::cout << " - Hollow center: " << b3.HollowCenter().t(); +std::cout << " - Inner radius: " << b3.InnerRadius() << "." << std::endl; +std::cout << std::endl; + +// Manually create a hollow ball bound whose hollow center is different than the +// outer ball's center. +mlpack::HollowBallBound b4(3); +b4.OuterRadius() = 3.0; +b4.InnerRadius() = 1.5; +b4.Center() = arma::vec(3); +b4.HollowCenter() = arma::vec("1.0 1.0 1.0"); + +// Compute the minimum distance between a point inside the hollow unit ball's +// outer ball. +const double d1 = b.MinDistance(arma::vec("0.75 0.75 0.75")); +std::cout << "Minimum distance between hollow unit ball bound and [0.75, 0.75, " + << "0.75]: " << d1 << "." << std::endl; + +// Compute the minimum distance between a point inside the hollow unit ball's +// inner ball (so the point is not contained in the bound---it is within the +// hollow section). +const double d2 = b.MinDistance(arma::vec("0.25 0.25 0.25")); +std::cout << "Minimum distance between hollow unit ball bound and [0.25, 0.25, " + << "0.25]: " << d2 << "." << std::endl; +std::cout << std::endl; + +// Use Contains(). In this case, the 'else' will be taken. +if (b.Contains(arma::vec("1.5 1.5 1.5"))) +{ + std::cout << "Hollow unit ball bound contains [1.5, 1.5, 1.5]." << std::endl; +} +else +{ + std::cout << "Hollow unit ball bound does not contain [1.5, 1.5, 1.5]." + << std::endl; +} +std::cout << std::endl; + +// Compute the maximum distance between a point inside the unit ball and the +// unit hollow ball bound. +const double d2 = b4.MaxDistance(arma::vec("0.1 0.1 0.1")); +std::cout << "Maximum distance between hollow unit ball bound and [0.1, 0.1, " + << "0.1]: " << d2 << "." << std::endl; + +// Compute the minimum and maximum distances between the hollow unit ball bound +// and the bound built on data points. +const mlpack::Range r = b.RangeDistance(b3); +std::cout << "Distances between hollow unit ball bound and second hollow " + << "dataset bound: [" << r.Lo() << ", " << r.Hi() << "]." << std::endl; + +// Create a bound using the Manhattan (L1) distance and compute the minimum and +// maximum distance to a point. +mlpack::HollowBallBound mb(2.0, 5.0, arma::vec(3)); +const mlpack::Range r2 = mb.RangeDistance(arma::vec("1.5 1.5 4.0")); +std::cout << "Distance between Manhattan distance HollowBallBound and " + << "[1.5, 1.5, 4.0]: [" << r2.Lo() << ", " << r2.Hi() << "]." << std::endl; + +// Create a bound using the Chebyshev (L-inf) distance, using random 32-bit +// floating point elements, and compute the minimum and maximum distance to a +// point. +arma::fmat floatData(3, 25, arma::fill::randu); +mlpack::HollowBallBound cb; +cb |= floatData; +// Note the use of arma::fvec to represent a point, since ElemType is float. +const mlpack::RangeType r3 = cb.RangeDistance(arma::fvec("1.5 1.5 4.0")); +std::cout << "Distance between Chebyshev distance HollowBallBound and " + << "[1.5, 1.5, 4.0]: [" << r3.Lo() << ", " << r3.Hi() << "]." << std::endl; +``` + ### Custom `BoundType`s The `BinarySpaceTree` class allows an arbitrary `BoundType` template parameter diff --git a/src/mlpack/core/tree/hollow_ball_bound.hpp b/src/mlpack/core/tree/hollow_ball_bound.hpp index 2cad206b82..a41c10798f 100644 --- a/src/mlpack/core/tree/hollow_ball_bound.hpp +++ b/src/mlpack/core/tree/hollow_ball_bound.hpp @@ -212,16 +212,6 @@ class HollowBallBound template const HollowBallBound& operator|=(const MatType& data); - /** - * Expand the bound to include the given bound. The centroid will not be - * moved. - * - * @tparam MatType Type of matrix; could be arma::mat, arma::spmat, or a - * vector. - * @tparam data Data points to add. - */ - const HollowBallBound& operator|=(const HollowBallBound& other); - /** * Returns the diameter of the ballbound. */ From d8b7c6654f22f775d52f882506508b5554faba14 Mon Sep 17 00:00:00 2001 From: Ryan Curtin Date: Wed, 2 Oct 2024 12:49:16 -0400 Subject: [PATCH 02/24] Add documentation for VantagePointSplit. --- doc/user/core/trees/binary_space_tree.md | 46 ++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/doc/user/core/trees/binary_space_tree.md b/doc/user/core/trees/binary_space_tree.md index 1dcb401d2d..561ba1df26 100644 --- a/doc/user/core/trees/binary_space_tree.md +++ b/doc/user/core/trees/binary_space_tree.md @@ -1295,6 +1295,8 @@ to write a fully custom split: with maximum width * [`MeanSplit`](#meansplit): splits on the mean value of the points in the dimension with maximum width + * [`VantagePointSplit`](#vantagepointsplit): split by selecting a 'vantage + point' and then split points into 'near' and 'far' sets * [Custom `SplitType`s](#custom-splittypes): implement a fully custom `SplitType` class @@ -1343,6 +1345,50 @@ task*. For implementation details, see [the source code](/src/mlpack/core/tree/binary_space_tree/mean_split_impl.hpp). +### `VantagePointSplit` + +The `VantagePointSplit` class is a splitting strategy that can be used by +[`BinarySpaceTree`](#binaryspacetree). It is the default strategy for splitting +[`VPTree`s](vptree.md), and is detailed in [the paper](...). +Due to the nature of the split, ***`VantagePointSplit` should always be used +with the [`HollowBallBound`](#hollowballbound)***. + +The splitting strategy for the `VantagePointSplit` class is, given a set of +points: + + * Select a vantage point from a sample of 100 random candidate points (or use + the full set if there are fewer than 100 points): + - Compute the distances between each candidate point and 100 additional + random samples (or the full set if there are fewer than 100 points). + - Select the vantage point as the candidate with maximum average distance to + the additional random samples. + * Compute a boundary distance `mu` that is the median distance between the + vantage point and its random samples. + * Points with distance less than `mu` from the vantage point will go to the + left child. + * Points with distance greater than `mu` from the vantage point will go to the + right child. + +The `VantagePointSplit` class has three template parameters: + +``` +VantagePointSplit +``` + +If a custom number of samples `S` is desired, the easiest way to specify is via +a template typedef: + +``` +template +using MyVantagePointSplit = VantagePointSplit; +``` + +Then, `MyVantagePointSplit` can be used directly with `BinarySpaceTree` as a +`SplitType`. + +For implementation details, see +[the source code](/src/mlpack/core/tree/binary_space_tree/vantage_point_split_impl.hpp). + ### Custom `SplitType`s Custom split strategies for a binary space tree can be implemented via the From 548950080613be526cefc7740ab6939afd347654 Mon Sep 17 00:00:00 2001 From: Ryan Curtin Date: Wed, 2 Oct 2024 14:50:09 -0400 Subject: [PATCH 03/24] Remove useless assert (it is always true). --- .../core/tree/binary_space_tree/vantage_point_split_impl.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mlpack/core/tree/binary_space_tree/vantage_point_split_impl.hpp b/src/mlpack/core/tree/binary_space_tree/vantage_point_split_impl.hpp index d19dcb1f18..b815b849b4 100644 --- a/src/mlpack/core/tree/binary_space_tree/vantage_point_split_impl.hpp +++ b/src/mlpack/core/tree/binary_space_tree/vantage_point_split_impl.hpp @@ -89,7 +89,6 @@ SelectVantagePoint(const DistanceType& distance, const MatType& data, mu = arma::median(distances); } } - assert(bestSpread > 0); } } // namespace mlpack From 3a69b4a615613c46acb167af220e8f6c0ab364e8 Mon Sep 17 00:00:00 2001 From: Ryan Curtin Date: Wed, 2 Oct 2024 15:08:01 -0400 Subject: [PATCH 04/24] Make sure that Go installed on MacOS CI builds. --- .ci/macos-steps.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.ci/macos-steps.yaml b/.ci/macos-steps.yaml index d6f177f28a..c29979479a 100644 --- a/.ci/macos-steps.yaml +++ b/.ci/macos-steps.yaml @@ -24,6 +24,10 @@ steps: brew install --cask julia fi + if [ "$BINDING" = "go" ]; then + brew install go + fi + displayName: 'Install Build Dependencies' # Configure mlpack (CMake) From 00c11fca42d6fad87c0bce1ea016c9eaa7c611f3 Mon Sep 17 00:00:00 2001 From: Ryan Curtin Date: Wed, 2 Oct 2024 17:28:37 -0400 Subject: [PATCH 05/24] I think the -t option is not necessary (it sets the timeout?). --- .ci/macos-steps.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/macos-steps.yaml b/.ci/macos-steps.yaml index c29979479a..b250b6e690 100644 --- a/.ci/macos-steps.yaml +++ b/.ci/macos-steps.yaml @@ -36,7 +36,7 @@ steps: if [ "$BINDING" = "go" ]; then export GOPATH=$PWD/src/mlpack/bindings/go export GO111MODULE=off - go get -u -t gonum.org/v1/gonum/... + go get -u gonum.org/v1/gonum/... fi if [ "$BINDING" = "python" ]; then cmake $CMAKEARGS -DPYTHON_EXECUTABLE=$(which python) .. From b64d741147ee90883d09039c0591b1ffe0e41318 Mon Sep 17 00:00:00 2001 From: Ryan Curtin Date: Wed, 2 Oct 2024 17:29:21 -0400 Subject: [PATCH 06/24] Add documentation for VPTree. --- doc/img/hollowballbound.png | Bin 0 -> 72856 bytes doc/user/core/trees/vptree.md | 634 ++++++++++++++++++++++++++++++++++ 2 files changed, 634 insertions(+) create mode 100644 doc/img/hollowballbound.png create mode 100644 doc/user/core/trees/vptree.md diff --git a/doc/img/hollowballbound.png b/doc/img/hollowballbound.png new file mode 100644 index 0000000000000000000000000000000000000000..3660328b3ab9fdb4ae8ccbd959b03d1c50f64ee1 GIT binary patch literal 72856 zcmd3N^5^`y)M!*nX*N2gMY^R0BnAVddy{6=fQ`Y3 z@g48aKk@xx+k<;g&dz=A>s;r$&;5LU)6-ESBVi!9bLS43hWe|wckbNlz`wXC|HF@H z!nCXLA5ZPn-)i5v6UcSv&ZmewcP{WlpLXut@fE&vXZQV`JF*#f?$Cb7Y15a-e{s)N zQ|;Bw4ONB6DE_YpAJk2~@q;G+du0!FHQ)z{d^EIGiFQctJr?1eRy1S94^i6L==k9; ze}CuB!)N$w@s{pRG6NO)@xOFOklHfl^I>ez25}7D=Oqt5cSf^Yt| z{P-DL1f??Z|8H+5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)7)w=DB7qOInql2`P+s4-M?b9L&(nAu2NqF+_M7%9W;pJQtFQd3{;J4|CW@eORj7%UeX2v%~PJR{`BBXpNpDsnLa znT}=QgiUxQ+|rp)(Y+fj88Jm_3Sr1*X5eo`V|GdFA5daZ-`x{+-|q6+&Z)?M5H7OY z`CnDD5Bofrqr=rG!-0X zEK*e==i)1PEI@Yz-}1}te>7Onf6e#8IZ63Hy9`=SZriKsjDHi|6BP>j3}NU_{5(lW zXo@Clh{{HI&KSN_aM&nVqfJ1D{^BNa=6E-Ff%#T#^c_0L99@hsZq_pAhT82zm`c}9#>Oh+A>xx9Fu3Z%kLtNJG~&!+rHRj7JQZaYTUE1_6o=`(4@+(1}J2m^F%LD zuV&Tof3Mxo%dQsx-rXMPyr;LH);jXZM?tpLiNZ`xVdP6< + +The `VPTree` class represents a `k`-dimensional vantage point tree, +and is a well-known data structure for efficient distance operations (such as +nearest neighbor search) in low dimensions---typically less than 100. The +vantage point tree is also known as the 'metric tree'. + +A vantage point tree is a binary tree where each node selects a 'vantage +point', and child nodes partition points into those that are nearer to the +vantage point and those that are further from it. `VPTree` supports arbitrary +[distance metrics](../distances.md) that are not +[`LMetric`](../distances.md#lmetric), making it more flexible than `KDTree`. + +mlpack's `VPTree` implementation supports three template parameters for +configurable behavior, and implements all the functionality required by the +[TreeType API](../../../developer/trees.md#the-treetype-api), plus some +additional functionality specific to vantage point trees. + + * [Template parameters](#template-parameters) + * [Constructors](#constructors) + * [Basic tree properties](#basic-tree-properties) + * [Bounding distances with the tree](#bounding-distances-with-the-tree) + * [Tree traversals](#tree-traversals) + * [Example usage](#example-usage) + +## See also + + + + * [Vantage point tree on Wikipedia](https://en.wikipedia.org/wiki/Vantage-point_tree) + * [`BinarySpaceTree`](binary_space_tree.md) + * [Binary space partitioning on Wikipedia](https://dl.acm.org/doi/pdf/10.1145/361002.361007) + * [Data structures and algorithms for nearest neighbor search in general metric spaces (pdf)](https://scholar.archive.org/work/og2s6vjmcngfbkmesu3dbsazpq/access/wayback/https://dl.acm.org/doi/pdf/10.5555/313559.313789) + * [Satisfying General Proximity/Similarity Queries with Metric Trees (pdf)](https://www.mlpack.org/papers/uhlmann91.pdf) + * [Tree-Independent Dual-Tree Algorithms (pdf)](https://www.ratml.org/pub/pdf/2013tree.pdf) + +## Template parameters + +In accordance with the [TreeType +API](../../../developer/trees.md#template-parameters-required-by-the-treetype-policy) +(see also [this more detailed section](../../../developer/trees.md#template-parameters)), +the `VPTree` class takes three template parameters: + +``` +VPTree +``` + + * `DistanceType`: the [distance metric](../distances.md) to use for distance + computations. By default, this is + [`EuclideanDistance`](../distances.md#lmetric). + * [`StatisticType`](binary_space_tree.md#statistictype): this holds auxiliary + information in each tree node. By default, + [`EmptyStatistic`](binary_space_tree.md#emptystatistic) is used, which holds + no information. + * `MatType`: the type of matrix used to represent points. Must be a type + matching the [Armadillo API](../../matrices.md). By default, `arma::mat` is + used, but other types such as `arma::fmat` or similar will work just fine. + +The `VPTree` class itself is a convenience typedef of the generic +[`BinarySpaceTree`](binary_space_tree.md) class, using the +[`HollowBallBound`](binary_space_tree.md#hollowballbound) class as the bounding +structure, and using the +[`VantagePointSplit`](binary_space_tree.md#vantagepointsplit) splitting strategy +for construction, which splits points into those that are nearer and further +from a 'vantage point'. + +## Constructors + +`VPTree`s are efficiently constructed by permuting points in a dataset in a +quicksort-like algorithm. However, this means that the ordering of points in +the tree's dataset (accessed with `node.Dataset()`) after construction may be +different. + +--- + + * `node = VPTree(data, maxLeafSize=20)` + * `node = VPTree(data, oldFromNew, maxLeafSize=20)` + * `node = VPTree(data, oldFromNew, newFromOld, maxLeafSize=20)` + - Construct a `VPTree` on the given `data`, using `maxLeafSize` as the + maximum number of points held in a leaf. + - By default, `data` is copied. Avoid a copy by using `std::move()` (e.g. + `std::move(data)`); when doing this, `data` will be set to an empty matrix. + - Optionally, construct mappings from old points to new points. `oldFromNew` + and `newFromOld` will have length `data.n_cols`, and: + * `oldFromNew[i]` indicates that point `i` in the tree's dataset was + originally point `oldFromNew[i]` in `data`; that is, + `node.Dataset().col(i)` is the point `data.col(oldFromNew[i])`. + * `newFromOld[i]` indicates that point `i` in `data` is now point + `newFromOld[i]` in the tree's dataset; that is, + `node.Dataset().col(newFromOld[i])` is the point `data.col(i)`. + +--- + + * `node = VPTree(data, maxLeafSize=20)` + * `node = VPTree(data, oldFromNew, maxLeafSize=20)` + * `node = VPTree(data, oldFromNew, newFromOld, maxLeafSize=20)` + - Construct a `VPTree` on the given `data`, using custom template parameters + to control the behavior of the tree, using `maxLeafSize` as the maximum + number of points held in a leaf. + - By default, `data` is copied. Avoid a copy by using `std::move()` (e.g. + `std::move(data)`); when doing this, `data` will be set to an empty matrix. + - Optionally, construct mappings from old points to new points. `oldFromNew` + and `newFromOld` will have length `data.n_cols`, and: + * `oldFromNew[i]` indicates that point `i` in the tree's dataset was + originally point `oldFromNew[i]` in `data`; that is, + `node.Dataset().col(i)` is the point `data.col(oldFromNew[i])`. + * `newFromOld[i]` indicates that point `i` in `data` is now point + `newFromOld[i]` in the tree's dataset; that is, + `node.Dataset().col(newFromOld[i])` is the point `data.col(i)`. + +--- + + * `node = VPTree()` + - Construct an empty vantage point tree with no children and no points. + +--- + +***Notes:*** + + - The name `node` is used here for `VPTree` objects instead of `tree`, because + each `VPTree` object is a single node in the tree. The constructor returns + the node that is the root of the tree. + + - Inserting individual points or removing individual points from a `VPTree` is + not supported, because this generally results in a vantage point tree with + very loose bounding balls. It is better to simply build a new `VPTree` on + the modified dataset. For trees that support individual insertion and + deletions, see the `RectangleTree` class and all its variants (e.g. `RTree`, + `RStarTree`, etc.). + + - See also the + [developer documentation on tree constructors](../../../developer/trees.md#constructors-and-destructors). + + + +--- + +### Constructor parameters: + +| **name** | **type** | **description** | **default** | +|----------|----------|-----------------|-------------| +| `data` | [`arma::mat`](../../matrices.md) | [Column-major](../../matrices.md#representing-data-in-mlpack) matrix to build the tree on. Pass with `std::move(data)` to avoid copying the matrix. | _(N/A)_ | +| `maxLeafSize` | `size_t` | Maximum number of points to store in each leaf. | `20` | +| `oldFromNew` | `std::vector` | Mappings from points in `node.Dataset()` to points in `data`. | _(N/A)_ | +| `newFromOld` | `std::vector` | Mappings from points in `data` to points in `node.Dataset()`. | _(N/A)_ | + +## Basic tree properties + +Once a `VPTree` object is constructed, various properties of the tree can be +accessed or inspected. Many of these functions are required by the [TreeType +API](../../../developer/trees.md#the-treetype-api). + +### Navigating the tree + + * `node.NumChildren()` returns the number of children in `node`. This is + either `2` if `node` has children, or `0` if `node` is a leaf. + + * `node.IsLeaf()` returns a `bool` indicating whether or not `node` is a leaf. + + * `node.Child(i)` returns a `VPTree&` that is the `i`th child. + - `i` must be `0` or `1`. + - This function should only be called if `node.NumChildren()` is not `0` + (e.g. if `node` is not a leaf). Note that this returns a valid `VPTree&` + that can itself be used just like the root node of the tree! + - `node.Left()` and `node.Right()` are convenience functions specific to + `VPTree` that will return `VPTree*` (pointers) to the left and right + children, respectively, or `NULL` if `node` has no children. + + * `node.Parent()` will return a `VPTree*` that points to the parent of `node`, + or `NULL` if `node` is the root of the `VPTree`. + +--- + +### Accessing members of a tree + + * `node.Bound()` will return an + [`HollowBallBound&`](binary_space_tree.md#hollowballbound) object that + represents the hollow bounding ball of `node`. This structure encloses all + the descendant points of `node`. + + * `node.Stat()` will return an `EmptyStatistic&` (or a `StatisticType&` if a + [custom `StatisticType`](#template-parameters) was specified as a template + parameter) holding the statistics of the node that were computed during tree + construction. + + * `node.Distance()` will return a + [`EuclideanDistance&`](../distances.md#lmetric) (or a `DistanceType&` if a + [custom `DistanceType`](#template-parameters) was specified as a template + parameter). + +See also the +[developer documentation](../../../developer/trees.md#basic-tree-functionality) +for basic tree functionality in mlpack. + +--- + +### Accessing data held in a tree + + * `node.Dataset()` will return a `const arma::mat&` that is the dataset the + tree was built on. Note that this is a permuted version of the `data` matrix + passed to the constructor. + - If a [custom `MatType`](#template-parameters) is being used, the return + type will be `const MatType&` instead of `const arma::mat&`. + + * `node.NumPoints()` returns a `size_t` indicating the number of points held + directly in `node`. + - If `node` is not a leaf, this will return `0`, as `VPTree` only holds + points directly in its leaves. + - If `node` is a leaf, then the number of points will be less than or equal + to the `maxLeafSize` that was specified when the tree was constructed. + + * `node.Point(i)` returns a `size_t` indicating the index of the `i`'th point + in `node.Dataset()`. + - `i` must be in the range `[0, node.NumPoints() - 1]` (inclusive). + - `node` must be a leaf (as non-leaves do not hold any points). + - The `i`'th point in `node` can then be accessed as + `node.Dataset().col(node.Point(i))`. + - In a `VPTree`, because of the permutation of points done [during + construction](#constructors), point indices are contiguous: + `node.Point(i + j)` is the same as `node.Point(i) + j` for valid `i` and + `j`. + - Accessing the actual `i`'th point itself can be done with, e.g., + `node.Dataset().col(node.Point(i))`. + + * `node.NumDescendants()` returns a `size_t` indicating the number of points + held in all descendant leaves of `node`. + - If `node` is the root of the tree, then `node.NumDescendants()` will be + equal to `node.Dataset().n_cols`. + + * `node.Descendant(i)` returns a `size_t` indicating the index of the `i`'th + descendant point in `node.Dataset()`. + - `i` must be in the range `[0, node.NumDescendants() - 1]` (inclusive). + - `node` does not need to be a leaf. + - The `i`'th descendant point in `node` can then be accessed as + `node.Dataset().col(node.Descendant(i))`. + - In a `VPTree`, because of the permutation of points done [during + construction](#constructors), point indices are contiguous: + `node.Descendant(i + j)` is the same as `node.Descendant(i) + j` for valid + `i` and `j`. + - Accessing the actual `i`'th descendant itself can be done with, e.g., + `node.Dataset().col(node.Descendant(i))`. + + * `node.Begin()` returns a `size_t` indicating the index of the first + descendant point of `node`. + - This is equivalent to `node.Descendant(0)`. + + * `node.Count()` returns a `size_t` indicating the number of descendant points of `node`. + - This is equivalent to `node.NumDescendants()`. + +--- + +### Accessing computed bound quantities of a tree + +The following quantities are cached for each node in a `VPTree`, and so +accessing them does not require any computation. + + * `node.FurthestPointDistance()` returns a `double` representing the distance + between the center of the hollow bounding ball of `node` and the furthest + point held by `node`. + - If `node` is not a leaf, this returns 0 (because `node` does not hold any + points). + + * `node.FurthestDescendantDistance()` returns a `double` representing the + distance between the center of the hollow bounding ball of `node` and the + furthest descendant point held by `node`. + + * `node.MinimumBoundDistance()` returns a `double` representing minimum + possible distance from the center of the node to any edge of the + hollow ball bound. + - This quantity is equivalent to `node.Bound().OuterRadius()`. + + * `node.ParentDistance()` returns a `double` representing the distance between + the center of the hollow bounding ball of `node` and the center of the + hollow bounding ball of its parent. + - If `node` is the root of the tree, `0` is returned. + +***Notes:*** + + - If a [custom `MatType`](#template-parameters) was specified when constructing + the `VPTree`, then the return type of each method is the element type of the + given `MatType` instead of `double`. (e.g., if `MatType` is `arma::fmat`, + then the return type is `float`.) + + - For more details on each bound quantity, see the + [developer documentation](../../../developer/trees.md#complex-tree-functionality-and-bounds) + on bound quantities for trees. + +--- + +### Other functionality + + * `node.Center(center)` computes the center of the hollow bounding ball of + `node` and stores it in `center`. + - `center` should be of type `arma::vec&`. (If a [custom + `MatType`](#template-parameters) was specified when constructing the + `VPTree`, the type is instead the column vector type for the given + `MatType`; e.g., `arma::fvec&` when `MatType` is `arma::fmat`.) + - `center` will be set to have size equivalent to the dimensionality of the + dataset held by `node`. + - This is equivalent to calling `node.Bound().Center(center)`. + + * A `VPTree` can be serialized with + [`data::Save()` and `data::Load()`](../../load_save.md#mlpack-objects). + +## Bounding distances with the tree + +The primary use of trees in mlpack is bounding distances to points or other tree +nodes. The following functions can be used for these tasks. + + * `node.GetNearestChild(point)` + * `node.GetFurthestChild(point)` + - Return a `size_t` indicating the index of the child (`0` for left, `1` for + right) that is closest to (or furthest from) `point`, with respect + to the `MinDistance()` (or `MaxDistance()`) function. + - If there is a tie, `0` (the left child) is returned. + - If `node` is a leaf, `0` is returned. + - `point` should be of type `arma::vec`. (If a [custom + `MatType`](#template-parameters) was specified when constructing the + `VPTree`, the type is instead the column vector type for the given + `MatType`; e.g., `arma::fvec` when `MatType` is `arma::fmat`.) + + * `node.GetNearestChild(other)` + * `node.GetFurthestChild(other)` + - Return a `size_t` indicating the index of the child (`0` for left, `1` for + right) that is closest to (or furthest from) the `VPTree` node `other`, + with respect to the `MinDistance()` (or `MaxDistance()`) function. + - If there is a tie, `2` (an invalid index) is returned. ***Note that this + behavior differs from the version above that takes a point.*** + - If `node` is a leaf, `0` is returned. + +--- + + * `node.MinDistance(point)` + * `node.MinDistance(other)` + - Return a `double` indicating the minimum possible distance between `node` + and `point`, or the `VPTree` node `other`. + - This is equivalent to the minimum possible distance between any point + contained in the hollow bounding ball of `node` and `point`, or between + any point contained in the hollow bounding ball of `node` and any point + contained in the hollow bounding ball of `other`. + - `point` should be of type `arma::vec`. (If a [custom + `MatType`](#template-parameters) was specified when constructing the + `VPTree`, the type is instead the column vector type for the given + `MatType`, and the return type is the element type of `MatType`; e.g., + `point` should be `arma::fvec` when `MatType` is `arma::fmat`, and the + returned distance is `float`). + + * `node.MaxDistance(point)` + * `node.MaxDistance(other)` + - Return a `double` indicating the maximum possible distance between `node` + and `point`, or the `VPTree` node `other`. + - This is equivalent to the maximum possible distance between any point + contained in the hollow bounding ball of `node` and `point`, or between + any point contained in the hollow bounding ball of `node` and any point + contained in the hollow bounding ball of `other`. + - `point` should be of type `arma::vec`. (If a [custom + `MatType`](#template-parameters) was specified when constructing the + `VPTree`, the type is instead the column vector type for the given + `MatType`, and the return type is the element type of `MatType`; e.g., + `point` should be `arma::fvec` when `MatType` is `arma::fmat`, and the + returned distance is `float`). + + * `node.RangeDistance(point)` + * `node.RangeDistance(other)` + - Return a [`Range`](../math.md#range) whose lower bound is + `node.MinDistance(point)` or `node.MinDistance(other)`, and whose upper + bound is `node.MaxDistance(point)` or `node.MaxDistance(other)`. + - `point` should be of type `arma::vec`. (If a + [custom `MatType`](#template-parameters) was specified when constructing + the `VPTree`, the type is instead the column vector type for the given + `MatType`, and the return type is a `RangeType` with element type the same + as `MatType`; e.g., `point` should be `arma::fvec` when `MatType` is + `arma::fmat`, and the returned type is + [`RangeType`](../math.md#range)). + +### Tree traversals + +Like every mlpack tree, the `VPTree` class provides a [single-tree and dual-tree +traversal](../../../developer/trees.md#traversals) that can be paired with a +[`RuleType` class](../../../developer/trees.md#rules) to implement a single-tree +or dual-tree algorithm. + + * `VPTree::SingleTreeTraverser` + - Implements a depth-first single-tree traverser. + + * `VPTree::DualTreeTraverser` + - Implements a dual-depth-first dual-tree traverser. + +In addition to those two classes, which are required by the +[`TreeType` policy](../../../developer/trees.md), an additional traverser is +available: + + * `VPTree::BreadthFirstDualTreeTraverser` + - Implements a dual-breadth-first dual-tree traverser. + - ***Note:*** this traverser is not useful for all tasks; because the + `VPTree` only holds points in the leaves, this means that no base cases + (e.g. comparisons between points) will be called until *all* pairs of + intermediate nodes have been scored! + +## Example usage + +Build a `VPTree` on the `cloud` dataset and print basic statistics about the +tree. + +```c++ +// See https://datasets.mlpack.org/cloud.csv. +arma::mat dataset; +mlpack::data::Load("cloud.csv", dataset, true); + +// Build the vp-tree with a leaf size of 10. (This means that nodes are split +// until they contain 10 or fewer points.) +// +// The std::move() means that `dataset` will be empty after this call, and no +// data will be copied during tree building. +// +// Note that the '<>' isn't necessary if C++20 is being used (e.g. +// `mlpack::VPTree tree(...)` will work fine in C++20 or newer). +mlpack::VPTree<> tree(std::move(dataset)); + +// Print the bounding ball of the root node. (There will be no hollow ball.) +std::cout << "Bounding ball of root node:" << std::endl; +std::cout << " - Center: " << tree.Bound().Center().t(); +std::cout << " - Outer radius: " << tree.Bound().OuterRadius() << "." + << std::endl; +std::cout << " - Hollow center: " << tree.Bound().HollowCenter().t(); +std::cout << " - Inner radius: " << tree.Bound().InnerRadius() << "." + << std::endl; +std::cout << std::endl; + +// Print the bounding ball of the right child. (This will have a hollow ball.) +std::cout << "Bounding ball of right child: " << std::endl; +std::cout << " - Center: " << tree.Right()->Bound().Center().t(); +std::cout << " - Outer radius: " << tree.Right()->Bound().OuterRadius() << "." + << std::endl; +std::cout << " - Hollow center: " << tree.Right()->Bound().HollowCenter().t(); +std::cout << " - Inner radius: " << tree.Right()->Bound().InnerRadius() << "." + << std::endl; +std::cout << " - Distance between centers: " << +mlpack::EuclideanDistance::Evaluate(tree.Right()->Bound().Center(), +tree.Right()->Bound().HollowCenter()) << "." << std::endl; +std::cout << std::endl; + +// Print the number of descendant points of the root, and of each of its +// children. +std::cout << "Descendant points of root: " + << tree.NumDescendants() << "." << std::endl; +std::cout << "Descendant points of left child: " + << tree.Left()->NumDescendants() << "." << std::endl; +std::cout << "Descendant points of right child: " + << tree.Right()->NumDescendants() << "." << std::endl; +std::cout << std::endl; + +// Print the center of the vp-tree. +arma::vec center; +tree.Center(center); +std::cout << "Center of vp-tree: " << center.t(); +``` + +--- + +Build two `VPTree`s on subsets of the corel dataset and compute various +bounding quantities. + +```c++ +// See https://datasets.mlpack.org/corel-histogram.csv. +arma::mat dataset; +mlpack::data::Load("corel-histogram.csv", dataset, true); + +// Build vp-trees on the first half and the second half of points. +mlpack::VPTree<> tree1(dataset.cols(0, dataset.n_cols / 2)); +mlpack::VPTree<> tree2(dataset.cols(dataset.n_cols / 2 + 1, + dataset.n_cols - 1)); + +// Compute the maximum distance between the trees. +std::cout << "Maximum distance between tree root nodes: " + << tree1.MaxDistance(tree2) << "." << std::endl; + +// Get the leftmost grandchild of the first tree's root---if it exists. +if (!tree1.IsLeaf() && !tree1.Child(0).IsLeaf()) +{ + mlpack::VPTree<>& node1 = tree1.Child(0).Child(0); + + // Get the rightmost grandchild of the second tree's root---if it exists. + if (!tree2.IsLeaf() && !tree2.Child(1).IsLeaf()) + { + mlpack::VPTree<>& node2 = tree2.Child(1).Child(1); + + // Print the minimum and maximum distance between the nodes. + mlpack::Range dists = node1.RangeDistance(node2); + std::cout << "Possible distances between two grandchild nodes: [" + << dists.Lo() << ", " << dists.Hi() << "]." << std::endl; + + // Print the minimum distance between the first node and the first + // descendant point of the second node. + const size_t descendantIndex = node2.Descendant(0); + const double descendantMinDist = + node1.MinDistance(node2.Dataset().col(descendantIndex)); + std::cout << "Minimum distance between grandchild node and descendant " + << "point: " << descendantMinDist << "." << std::endl; + + // Which child of node2 is closer to node1? + const size_t closerIndex = node2.GetNearestChild(node1); + if (closerIndex == 0) + std::cout << "The left child of node2 is closer to node1." << std::endl; + else if (closerIndex == 1) + std::cout << "The right child of node2 is closer to node1." << std::endl; + else // closerIndex == 2 in this case. + std::cout << "Both children of node2 are equally close to node1." + << std::endl; + + // And which child of node1 is further from node2? + const size_t furtherIndex = node1.GetFurthestChild(node2); + if (furtherIndex == 0) + std::cout << "The left child of node1 is further from node2." + << std::endl; + else if (furtherIndex == 1) + std::cout << "The right child of node1 is further from node2." + << std::endl; + else // furtherIndex == 2 in this case. + std::cout << "Both children of node1 are equally far from node2." + << std::endl; + } +} +``` + +--- + +Build a `VPTree` on 32-bit floating point data and save it to disk. + +```c++ +// See https://datasets.mlpack.org/corel-histogram.csv. +arma::fmat dataset; +mlpack::data::Load("corel-histogram.csv", dataset); + +// Build the VPTree using 32-bit floating point data as the matrix type. +// We will still use the default EmptyStatistic and EuclideanDistance +// parameters. A leaf size of 100 is used here. +mlpack::VPTree tree(std::move(dataset), 100); + +// Save the VPTree to disk with the name 'tree'. +mlpack::data::Save("tree.bin", "tree", tree); + +std::cout << "Saved tree with " << tree.Dataset().n_cols << " points to " + << "'tree.bin'." << std::endl; +``` + +--- + +Load a 32-bit floating point `VPTree` from disk, then traverse it manually and +find the number of leaf nodes with less than 10 children. + +```c++ +// This assumes the tree has already been saved to 'tree.bin' (as in the example +// above). + +// This convenient typedef saves us a long type name! +typedef mlpack::VPTree TreeType; + +TreeType tree; +mlpack::data::Load("tree.bin", "tree", tree); +std::cout << "Tree loaded with " << tree.NumDescendants() << " points." + << std::endl; + +// Recurse in a depth-first manner. Count both the total number of leaves, and +// the number of leaves with less than 10 points. +size_t leafCount = 0; +size_t totalLeafCount = 0; +std::stack stack; +stack.push(&tree); +while (!stack.empty()) +{ + TreeType* node = stack.top(); + stack.pop(); + + if (node->NumPoints() < 10) + ++leafCount; + ++totalLeafCount; + + if (!node->IsLeaf()) + { + stack.push(node->Left()); + stack.push(node->Right()); + } +} + +// Note that it would be possible to use TreeType::SingleTreeTraverser to +// perform the recursion above, but that is more well-suited for more complex +// tasks that require pruning and other non-trivial behavior; so using a simple +// stack is the better option here. + +// Print the results. +std::cout << leafCount << " out of " << totalLeafCount << " leaves have less " + << "than 10 points." << std::endl; +``` + +--- + +Build a `VPTree` and map between original points and new points. + +```c++ +// See https://datasets.mlpack.org/cloud.csv. +arma::mat dataset; +mlpack::data::Load("cloud.csv", dataset, true); + +// Build the tree. +std::vector oldFromNew, newFromOld; +mlpack::VPTree<> tree(dataset, oldFromNew, newFromOld); + +// oldFromNew and newFromOld will be set to the same size as the dataset. +std::cout << "Number of points in dataset: " << dataset.n_cols << "." + << std::endl; +std::cout << "Size of oldFromNew: " << oldFromNew.size() << "." << std::endl; +std::cout << "Size of newFromOld: " << newFromOld.size() << "." << std::endl; +std::cout << std::endl; + +// See where point 42 in the tree's dataset came from. +std::cout << "Point 42 in the permuted tree's dataset:" << std::endl; +std::cout << " " << tree.Dataset().col(42).t(); +std::cout << "Was originally point " << oldFromNew[42] << ":" << std::endl; +std::cout << " " << dataset.col(oldFromNew[42]).t(); +std::cout << std::endl; + +// See where point 7 in the original dataset was mapped. +std::cout << "Point 7 in original dataset:" << std::endl; +std::cout << " " << dataset.col(7).t(); +std::cout << "Mapped to point " << newFromOld[7] << ":" << std::endl; +std::cout << " " << tree.Dataset().col(newFromOld[7]).t(); +``` From 5665e3f3944bbd47d0ef30bd13e1883668cd79a9 Mon Sep 17 00:00:00 2001 From: Ryan Curtin Date: Wed, 2 Oct 2024 17:33:47 -0400 Subject: [PATCH 07/24] Minor fixes to HollowBallBound documentation. --- doc/user/core/trees/binary_space_tree.md | 51 +++++++++++++++++------- 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/doc/user/core/trees/binary_space_tree.md b/doc/user/core/trees/binary_space_tree.md index 561ba1df26..ef66cecd1e 100644 --- a/doc/user/core/trees/binary_space_tree.md +++ b/doc/user/core/trees/binary_space_tree.md @@ -413,7 +413,7 @@ class uses a hyperrectangle bound. An example `HRectBound` is shown below; the bound is the smallest rectangle that encloses all of the points.
    -hyperrectangle bound enclosing points +hyperrectangle bound enclosing points
    mlpack supplies several drop-in `BoundType` classes, and it is also possible to @@ -782,11 +782,13 @@ secondary center point and inner radius. An example `HollowBallBound` is shown below in two dimensions; shaded area represents area held within the bound.
    -hollow ball bound +hollow ball bound
    `HollowBallBound` is used directly by the [`VPTree`](vptree.md) class. +--- + #### Constructors `HollowBallBound` allows configurable behavior via its two template parameters: @@ -841,6 +843,8 @@ before using it! - The bound will use the given `DistanceType` class to compute distances, and expect data to have elements with type `ElemType`. +--- + #### Accessing and modifying properties of the bound The individual bounds associated with each dimension of a `HollowBallBound` can @@ -853,6 +857,7 @@ be accessed and modified. * `b.HollowCenter()` returns an `arma::vec&` containing the center of the inner ball. Its elements can be directly modified. + - It is possible that `b.HollowCenter()` is outside of the outer ball! * `b.OuterRadius()` will return a `double` that is the radius of the outer ball. @@ -861,6 +866,9 @@ be accessed and modified. * `b.InnerRadius()` will return a `double` that is the radius of the inner ball. - `b.InnerRadius() = r` will set the radius of the inner ball to `r`. + - It is possible that `b.InnerRadius() > b.OuterRadius()`, and this implies + that the hollow center is outside the outer ball (otherwise the bound is + empty). * `b[dim]` will return a [`Range`](../math.md#range) object representing the extents of the bound in dimension `dim`. @@ -913,9 +921,12 @@ be accessed and modified. * `b.Center()` and `b.HollowCenter()` will return `arma::Col&`; and * `b.Center(center)` expects `center` to be of type `arma::Col`. +--- + #### Growing the bound -The `HollowBallBound` uses the logical `|=` to grow the bound to include points. +The `HollowBallBound` uses the logical `|=` to grow the bound to include points +or other bounds. * `b |= data` expands `b` so the outer ball includes all of the data points in `data`, shrinking the inner ball as necessary. `data` should be a @@ -931,6 +942,14 @@ The `HollowBallBound` uses the logical `|=` to grow the bound to include points. - If the bound is not empty, then `data` is expected to have dimensionality that matches `b.Dim()`. + * `b |= bound` expands `b` to include all of the volume included in `bound`. + The center points will not be modified. + - The outer ball's radius will be expanded to include the outer balls of both + `b` and `bound`. + - The inner (hollow) ball's radius will be shrunk to be the intersection of + the inner balls of `b` and `bound`. (This may result in `b.InnerRadius()` + being 0.) + ***Notes:*** - The growth operation does not grow the inner (hollow) ball. Properties @@ -940,6 +959,8 @@ The `HollowBallBound` uses the logical `|=` to grow the bound to include points. - If a custom `ElemType` was specified, then any `data` argument should be a matrix with that `ElemType` (e.g. `arma::Mat`). +--- + #### Bounding distances to other objects Once a `HollowBallBound` has been successfully created and set to the desired @@ -993,6 +1014,8 @@ constructor, then all distances will be computed with respect to the specified [`RangeType`](../math.md#range) (except for `Contains()`, which will still return a `bool`). +--- + #### Example usage ```c++ @@ -1004,7 +1027,7 @@ mlpack::HollowBallBound b(0.5, 1.0, arma::vec(3)); std::cout << "Hollow unit ball bound created manually:" << std::endl; std::cout << " - Center: " << b.Center().t(); std::cout << " - Outer radius: " << b.OuterRadius() << "." << std::endl; -std::cout << " - Hollow center: " << b.HollowCenter.(); +std::cout << " - Hollow center: " << b.HollowCenter().t(); std::cout << " - Inner radius: " << b.InnerRadius() << "." << std::endl; for (size_t i = 0; i < 3; ++i) { @@ -1036,8 +1059,8 @@ std::cout << std::endl; // On the other hand, if we initialize a HollowBallBound to a non-empty bound, // then `operator|=()` will shrink the hollow ball as necessary. // -// We initialize this ball bound to a "slice" with radii [2.6, 2.7]. -mlpack::HollowBallBound b3(2.6, 2.7, arma::vec(3)); +// We initialize this ball bound to a "slice" with radii [3.6, 3.7]. +mlpack::HollowBallBound b3(3.6, 3.7, arma::vec(3)); b3 |= dataset; std::cout << "Hollow ball bound on points with pre-initialization and " << "`operator|=()`:" << std::endl; @@ -1057,16 +1080,16 @@ b4.HollowCenter() = arma::vec("1.0 1.0 1.0"); // Compute the minimum distance between a point inside the hollow unit ball's // outer ball. -const double d1 = b.MinDistance(arma::vec("0.75 0.75 0.75")); -std::cout << "Minimum distance between hollow unit ball bound and [0.75, 0.75, " - << "0.75]: " << d1 << "." << std::endl; +const double d1 = b.MinDistance(arma::vec("0.9 0.9 0.9")); +std::cout << "Minimum distance between hollow unit ball bound and [0.9, 0.9, " + << "0.9]: " << d1 << "." << std::endl; // Compute the minimum distance between a point inside the hollow unit ball's // inner ball (so the point is not contained in the bound---it is within the // hollow section). -const double d2 = b.MinDistance(arma::vec("0.25 0.25 0.25")); -std::cout << "Minimum distance between hollow unit ball bound and [0.25, 0.25, " - << "0.25]: " << d2 << "." << std::endl; +const double d2 = b.MinDistance(arma::vec("0.0 0.0 0.0")); +std::cout << "Minimum distance between hollow unit ball bound and [0.0, 0.0, " + << "0.0]: " << d2 << "." << std::endl; std::cout << std::endl; // Use Contains(). In this case, the 'else' will be taken. @@ -1083,9 +1106,9 @@ std::cout << std::endl; // Compute the maximum distance between a point inside the unit ball and the // unit hollow ball bound. -const double d2 = b4.MaxDistance(arma::vec("0.1 0.1 0.1")); +const double d3 = b4.MaxDistance(arma::vec("0.1 0.1 0.1")); std::cout << "Maximum distance between hollow unit ball bound and [0.1, 0.1, " - << "0.1]: " << d2 << "." << std::endl; + << "0.1]: " << d3 << "." << std::endl; // Compute the minimum and maximum distances between the hollow unit ball bound // and the bound built on data points. From 959333cebda6cb10e3625271c4aa4b40cf30f1f2 Mon Sep 17 00:00:00 2001 From: Ryan Curtin Date: Wed, 2 Oct 2024 17:34:07 -0400 Subject: [PATCH 08/24] Add default template parameters for VPTree typedef. --- src/mlpack/core/tree/binary_space_tree/typedef.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mlpack/core/tree/binary_space_tree/typedef.hpp b/src/mlpack/core/tree/binary_space_tree/typedef.hpp index 021ecbdd7d..c14d1da02e 100644 --- a/src/mlpack/core/tree/binary_space_tree/typedef.hpp +++ b/src/mlpack/core/tree/binary_space_tree/typedef.hpp @@ -194,7 +194,9 @@ template using VPTreeSplit = VantagePointSplit; -template +template using VPTree = BinarySpaceTree Date: Wed, 2 Oct 2024 17:34:21 -0400 Subject: [PATCH 09/24] Restore operator|=() overload because it actually was implemented. --- src/mlpack/core/tree/hollow_ball_bound.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/mlpack/core/tree/hollow_ball_bound.hpp b/src/mlpack/core/tree/hollow_ball_bound.hpp index a41c10798f..2cad206b82 100644 --- a/src/mlpack/core/tree/hollow_ball_bound.hpp +++ b/src/mlpack/core/tree/hollow_ball_bound.hpp @@ -212,6 +212,16 @@ class HollowBallBound template const HollowBallBound& operator|=(const MatType& data); + /** + * Expand the bound to include the given bound. The centroid will not be + * moved. + * + * @tparam MatType Type of matrix; could be arma::mat, arma::spmat, or a + * vector. + * @tparam data Data points to add. + */ + const HollowBallBound& operator|=(const HollowBallBound& other); + /** * Returns the diameter of the ballbound. */ From 100d50089aec4e55fb711b1750ff06f48e31eda7 Mon Sep 17 00:00:00 2001 From: Ryan Curtin Date: Wed, 2 Oct 2024 17:34:57 -0400 Subject: [PATCH 10/24] Fix bugs in HollowBallBound implementation. --- src/mlpack/core/tree/hollow_ball_bound_impl.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mlpack/core/tree/hollow_ball_bound_impl.hpp b/src/mlpack/core/tree/hollow_ball_bound_impl.hpp index 4d65a0aeec..41d3122234 100644 --- a/src/mlpack/core/tree/hollow_ball_bound_impl.hpp +++ b/src/mlpack/core/tree/hollow_ball_bound_impl.hpp @@ -316,8 +316,8 @@ RangeType HollowBallBound::RangeDistance( typename std::enable_if_t::value>* /* junk */) const { if (radii.Hi() < 0) - return Range(std::numeric_limits::max(), - std::numeric_limits::max()); + return RangeType(std::numeric_limits::max(), + std::numeric_limits::max()); else { RangeType range; @@ -461,7 +461,7 @@ void HollowBallBound::serialize( ar(CEREAL_NVP(radii)); ar(CEREAL_NVP(center)); ar(CEREAL_NVP(hollowCenter)); - ar(CEREAL_POINTER(distance)); + if (cereal::is_loading()) { // If we're loading, delete the local distance since we'll have a new one. @@ -470,6 +470,8 @@ void HollowBallBound::serialize( ownsDistance = true; } + + ar(CEREAL_POINTER(distance)); } } // namespace mlpack From 0eb90aeb4db7a4d346a625b92ca1cd716343cc9c Mon Sep 17 00:00:00 2001 From: Ryan Curtin Date: Wed, 2 Oct 2024 17:41:20 -0400 Subject: [PATCH 11/24] Add HISTORY.md entry for fixes. --- HISTORY.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index 81689fcada..bc7d882b5a 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -4,8 +4,9 @@ _????-??-??_ - * Fix compilation with clang 19 (#3799) + * Fix compilation with clang 19 (#3799). + * Fix serialization and `MinDistance()` bugs with `HollowBallBound` (#3808). ## mlpack 4.5.0 From 06703fbd3c1ec98d47867a8fc61c25286fd7f8a7 Mon Sep 17 00:00:00 2001 From: Ryan Curtin Date: Mon, 7 Oct 2024 10:57:13 -0400 Subject: [PATCH 12/24] Don't search for gonum anymore; it's automatically installed by Go modules. --- .ci/linux-steps.yaml | 5 ----- .ci/macos-steps.yaml | 5 ----- README.md | 3 ++- src/mlpack/bindings/go/CMakeLists.txt | 7 ++----- src/mlpack/bindings/go/tests/CMakeLists.txt | 3 --- 5 files changed, 4 insertions(+), 19 deletions(-) diff --git a/.ci/linux-steps.yaml b/.ci/linux-steps.yaml index cb669ba27e..b5e208e265 100644 --- a/.ci/linux-steps.yaml +++ b/.ci/linux-steps.yaml @@ -69,11 +69,6 @@ steps: # Configure mlpack (CMake) - script: | mkdir build && cd build - if [ "$BINDING" = "go" ]; then - export GOPATH=$PWD/src/mlpack/bindings/go - export GO111MODULE=off - go get -u -t gonum.org/v1/gonum/... - fi cmake $CMAKEARGS -DPYTHON_EXECUTABLE=`which python` -DCEREAL_INCLUDE_DIR=/usr/include/ .. displayName: 'CMake' diff --git a/.ci/macos-steps.yaml b/.ci/macos-steps.yaml index b250b6e690..f94c273da6 100644 --- a/.ci/macos-steps.yaml +++ b/.ci/macos-steps.yaml @@ -33,11 +33,6 @@ steps: # Configure mlpack (CMake) - script: | mkdir build && cd build - if [ "$BINDING" = "go" ]; then - export GOPATH=$PWD/src/mlpack/bindings/go - export GO111MODULE=off - go get -u gonum.org/v1/gonum/... - fi if [ "$BINDING" = "python" ]; then cmake $CMAKEARGS -DPYTHON_EXECUTABLE=$(which python) .. else diff --git a/README.md b/README.md index 4fb8659634..495b0e13a7 100644 --- a/README.md +++ b/README.md @@ -396,7 +396,8 @@ and then `using mlpack` should work. *See also the [Go quickstart](doc/quickstart/go.md).* To build mlpack's Go bindings, ensure that Go >= 1.11.0 is installed, and that -the Gonum package is available. You can use `go get` to install mlpack for Go: +the Gonum package is available. You can use `go get` to install mlpack as a +module in a Go project: ```sh go get -u -d mlpack.org/v1/mlpack diff --git a/src/mlpack/bindings/go/CMakeLists.txt b/src/mlpack/bindings/go/CMakeLists.txt index 079348cad0..50fa4677f3 100644 --- a/src/mlpack/bindings/go/CMakeLists.txt +++ b/src/mlpack/bindings/go/CMakeLists.txt @@ -40,20 +40,17 @@ endif () if (BUILD_GO_BINDINGS) + # Gonum will automatically be installed by Go's module support during build. find_package(Go 1.11.0) if (NOT GO_FOUND) set(GO_NOT_FOUND_MSG "${GO_NOT_FOUND_MSG}\n - Go") endif () - find_package(Gonum) - if (NOT GONUM_FOUND) - set(GO_NOT_FOUND_MSG "${GO_NOT_FOUND_MSG}\n - Gonum") - endif () ## We need to check here if Golang is even available. Although actually ## technically, I'm not sure if we even need to know! For the tests though we ## do. So it's probably a good idea to check. if (FORCE_BUILD_GO_BINDINGS) - if (NOT GO_FOUND OR NOT GONUM_FOUND) + if (NOT GO_FOUND) unset(BUILD_GO_BINDINGS CACHE) set(BUILD_GO_SHLIB OFF) message(FATAL_ERROR "\nCould not Build Go Bindings; the following modules are not available: ${GO_NOT_FOUND_MSG}") diff --git a/src/mlpack/bindings/go/tests/CMakeLists.txt b/src/mlpack/bindings/go/tests/CMakeLists.txt index 17b6aa85a2..1bf80326eb 100644 --- a/src/mlpack/bindings/go/tests/CMakeLists.txt +++ b/src/mlpack/bindings/go/tests/CMakeLists.txt @@ -5,7 +5,4 @@ if (BUILD_GO_BINDINGS) add_test(NAME go_binding_test COMMAND ${GO_EXECUTABLE} test -v ${CMAKE_CURRENT_SOURCE_DIR}/go_binding_test.go WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/src/mlpack/bindings/go/src/mlpack.org/v1/mlpack/) -set_tests_properties(go_binding_test - PROPERTIES ENVIRONMENT "GOPATH=$ENV{GOPATH}:${CMAKE_BINARY_DIR}/src/mlpack/bindings/go/; - LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}:${CMAKE_BINARY_DIR}/src/mlpack/bindings/go/src/mlpack.org/v1/mlpack/") endif() From b5c024525f6b1328a8f6f12cdc34eaa0e83d4ef1 Mon Sep 17 00:00:00 2001 From: Ryan Curtin Date: Mon, 7 Oct 2024 11:50:35 -0400 Subject: [PATCH 13/24] Update documentation for how to use Go bindings with modules. --- README.md | 15 ++++++++++++--- doc/quickstart/go.md | 14 +++++++++++--- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 495b0e13a7..2c95a012aa 100644 --- a/README.md +++ b/README.md @@ -400,11 +400,20 @@ the Gonum package is available. You can use `go get` to install mlpack as a module in a Go project: ```sh -go get -u -d mlpack.org/v1/mlpack -cd ${GOPATH}/src/mlpack.org/v1/mlpack -make install +go get -u mlpack.org/v1/mlpack ``` +The Go bindings themselves will then need to be compiled. Find the mlpack +directory under `$GOMODCACHE/mlpack.org/v1/mlpack` and run these commands: + +```sh +make +sudo make install +``` + +Then, `go run my_code.go` will be able to correctly link against mlpack's Go +bindings and run. + The process of building the Go bindings by hand is a little tedious, so following the steps above is recommended. However, if you wish to build the Go bindings by hand anyway, you can do this by running the following commands from diff --git a/doc/quickstart/go.md b/doc/quickstart/go.md index bdb6ea62ca..ffb6fbe2c9 100644 --- a/doc/quickstart/go.md +++ b/doc/quickstart/go.md @@ -9,13 +9,21 @@ This quickstart guide is also available for [C++](cpp.md), [Python](python.md), ## Installing mlpack Installing the mlpack bindings for Go is somewhat time-consuming as the library -must be built; you can run the following code: +must be built; you can run the following to add mlpack as a dependency inside of +a Go module: ```sh go get -u -d mlpack.org/v1/mlpack -cd ${GOPATH}/src/mlpack.org/v1/mlpack -make install ``` + +The Go bindings themselves will then need to be compiled. Find the mlpack +directory under `$GOMODCACHE/mlpack.org/v1/mlpack` and run these commands: + +```sh +make +sudo make install +``` + Building the Go bindings from scratch is a little more in-depth, though. For information on that, follow the instructions in the [main README](../../README.md). From 471a3daa270f98cd54914cd7f11abe3a4a3358e5 Mon Sep 17 00:00:00 2001 From: Martin Lambertsen Date: Fri, 11 Oct 2024 18:39:44 +0200 Subject: [PATCH 14/24] Modernize STL type traits With newer standards the readability of template heavy code can be improved a lot by using a form with trailing _t for ::type and _v for ::value respectively. Especially for ::type it also makes the additional typename before the trait dispensable. This PR combines multiple commits that modernize the traits, starting with what clang-tidy could achieve while analyzing test files and continuing by regex replaces with few manual corrections. While it does not guarantee that all current occurrences are modernized, it moves the codebase considerably into the modern direction. Note that also before this PR both notations were used, so missing a few should be acceptable. --- doc/developer/trees.md | 4 +- doc/user/cv.md | 2 +- src/mlpack/bindings/R/default_param.hpp | 32 +++---- src/mlpack/bindings/R/default_param_impl.hpp | 42 ++++---- src/mlpack/bindings/R/get_printable_param.hpp | 24 ++--- src/mlpack/bindings/R/get_printable_type.hpp | 94 +++++++++--------- .../bindings/R/get_printable_type_impl.hpp | 96 +++++++++---------- src/mlpack/bindings/R/get_r_type.hpp | 84 ++++++++-------- src/mlpack/bindings/R/get_type.hpp | 92 +++++++++--------- src/mlpack/bindings/R/print_doc.hpp | 2 +- src/mlpack/bindings/R/print_input_param.hpp | 2 +- .../bindings/R/print_input_processing.hpp | 20 ++-- .../bindings/R/print_output_processing.hpp | 24 ++--- .../bindings/R/print_serialize_util.hpp | 12 +-- src/mlpack/bindings/R/print_type_doc.hpp | 24 ++--- src/mlpack/bindings/R/print_type_doc_impl.hpp | 38 ++++---- src/mlpack/bindings/cli/add_to_cli11.hpp | 80 ++++++++-------- src/mlpack/bindings/cli/cli_option.hpp | 10 +- src/mlpack/bindings/cli/default_param.hpp | 32 +++---- .../bindings/cli/default_param_impl.hpp | 32 +++---- .../bindings/cli/delete_allocated_memory.hpp | 12 +-- .../bindings/cli/get_allocated_memory.hpp | 12 +-- src/mlpack/bindings/cli/get_param.hpp | 20 ++-- .../bindings/cli/get_printable_param.hpp | 24 ++--- .../bindings/cli/get_printable_param_impl.hpp | 28 +++--- .../bindings/cli/get_printable_param_name.hpp | 20 ++-- .../cli/get_printable_param_name_impl.hpp | 18 ++-- .../cli/get_printable_param_value.hpp | 20 ++-- .../cli/get_printable_param_value_impl.hpp | 18 ++-- .../bindings/cli/get_printable_type.hpp | 24 ++--- .../bindings/cli/get_printable_type_impl.hpp | 46 ++++----- src/mlpack/bindings/cli/get_raw_param.hpp | 20 ++-- src/mlpack/bindings/cli/in_place_copy.hpp | 22 ++--- .../bindings/cli/map_parameter_name.hpp | 18 ++-- src/mlpack/bindings/cli/output_param.hpp | 24 ++--- src/mlpack/bindings/cli/output_param_impl.hpp | 22 ++--- src/mlpack/bindings/cli/print_type_doc.hpp | 24 ++--- .../bindings/cli/print_type_doc_impl.hpp | 46 ++++----- src/mlpack/bindings/cli/set_param.hpp | 24 ++--- src/mlpack/bindings/cli/string_type_param.hpp | 8 +- .../bindings/cli/string_type_param_impl.hpp | 8 +- src/mlpack/bindings/go/default_param.hpp | 32 +++---- src/mlpack/bindings/go/default_param_impl.hpp | 44 ++++----- src/mlpack/bindings/go/get_go_type.hpp | 82 ++++++++-------- .../bindings/go/get_printable_param.hpp | 24 ++--- src/mlpack/bindings/go/get_printable_type.hpp | 82 ++++++++-------- .../bindings/go/get_printable_type_impl.hpp | 80 ++++++++-------- src/mlpack/bindings/go/get_type.hpp | 56 +++++------ src/mlpack/bindings/go/print_defn_input.hpp | 20 ++-- src/mlpack/bindings/go/print_defn_output.hpp | 20 ++-- src/mlpack/bindings/go/print_doc.hpp | 2 +- .../bindings/go/print_input_processing.hpp | 22 ++--- .../bindings/go/print_method_config.hpp | 28 +++--- src/mlpack/bindings/go/print_method_init.hpp | 28 +++--- .../bindings/go/print_output_processing.hpp | 24 ++--- src/mlpack/bindings/go/print_type_doc.hpp | 24 ++--- .../bindings/go/print_type_doc_impl.hpp | 34 +++---- src/mlpack/bindings/julia/default_param.hpp | 32 +++---- .../bindings/julia/default_param_impl.hpp | 42 ++++---- src/mlpack/bindings/julia/get_julia_type.hpp | 94 +++++++++--------- .../bindings/julia/get_printable_param.hpp | 24 ++--- .../bindings/julia/get_printable_type.hpp | 24 ++--- .../julia/get_printable_type_impl.hpp | 46 ++++----- .../bindings/julia/print_input_param.hpp | 4 +- .../bindings/julia/print_input_processing.hpp | 28 +++--- .../julia/print_input_processing_impl.hpp | 32 +++---- .../julia/print_model_type_import.hpp | 12 +-- .../julia/print_output_processing.hpp | 28 +++--- .../julia/print_output_processing_impl.hpp | 44 ++++----- .../bindings/julia/print_param_defn.hpp | 12 +-- src/mlpack/bindings/julia/print_type_doc.hpp | 24 ++--- .../bindings/julia/print_type_doc_impl.hpp | 38 ++++---- .../bindings/markdown/default_param.hpp | 10 +- .../bindings/markdown/get_printable_param.hpp | 24 ++--- .../markdown/get_printable_param_name.hpp | 20 ++-- .../get_printable_param_name_impl.hpp | 18 ++-- .../markdown/get_printable_param_value.hpp | 20 ++-- .../get_printable_param_value_impl.hpp | 18 ++-- .../bindings/markdown/get_printable_type.hpp | 10 +- .../bindings/markdown/is_serializable.hpp | 8 +- .../bindings/markdown/print_type_doc.hpp | 10 +- src/mlpack/bindings/python/default_param.hpp | 32 +++---- .../bindings/python/default_param_impl.hpp | 42 ++++---- .../bindings/python/get_cython_type.hpp | 50 +++++----- .../bindings/python/get_printable_param.hpp | 24 ++--- .../bindings/python/get_printable_type.hpp | 92 +++++++++--------- .../python/get_printable_type_impl.hpp | 94 +++++++++--------- src/mlpack/bindings/python/import_decl.hpp | 12 +-- .../bindings/python/is_serializable.hpp | 6 +- .../bindings/python/print_class_defn.hpp | 12 +-- src/mlpack/bindings/python/print_defn.hpp | 2 +- src/mlpack/bindings/python/print_doc.hpp | 2 +- .../python/print_input_processing.hpp | 40 ++++---- .../python/print_output_processing.hpp | 20 ++-- src/mlpack/bindings/python/print_type_doc.hpp | 24 ++--- .../bindings/python/print_type_doc_impl.hpp | 38 ++++---- .../tests/delete_allocated_memory.hpp | 12 +-- .../bindings/tests/get_allocated_memory.hpp | 12 +-- .../bindings/tests/get_printable_param.hpp | 24 ++--- .../tests/get_printable_param_impl.hpp | 22 ++--- src/mlpack/core/cereal/is_loading.hpp | 16 ++-- src/mlpack/core/cereal/is_saving.hpp | 16 ++-- src/mlpack/core/cv/cv_base.hpp | 16 ++-- src/mlpack/core/cv/cv_base_impl.hpp | 37 +++---- src/mlpack/core/cv/k_fold_cv.hpp | 8 +- src/mlpack/core/cv/meta_info_extractor.hpp | 14 +-- src/mlpack/core/cv/simple_cv.hpp | 4 +- src/mlpack/core/data/dataset_mapper_impl.hpp | 4 +- src/mlpack/core/data/has_serialize.hpp | 2 +- src/mlpack/core/data/load_numeric_csv.hpp | 10 +- src/mlpack/core/data/string_encoding.hpp | 4 +- src/mlpack/core/data/string_encoding_impl.hpp | 22 ++--- .../distributions/discrete_distribution.hpp | 2 +- .../discrete_distribution_impl.hpp | 4 +- .../core/distributions/gamma_distribution.hpp | 8 +- src/mlpack/core/hpt/cv_function.hpp | 16 ++-- src/mlpack/core/hpt/deduce_hp_types.hpp | 2 +- src/mlpack/core/hpt/fixed.hpp | 2 +- src/mlpack/core/hpt/hpt.hpp | 10 +- src/mlpack/core/hpt/hpt_impl.hpp | 4 +- src/mlpack/core/math/digamma.hpp | 6 +- src/mlpack/core/math/trigamma.hpp | 4 +- src/mlpack/core/tree/address.hpp | 20 ++-- .../tree/binary_space_tree/ub_tree_split.hpp | 4 +- src/mlpack/core/tree/build_tree.hpp | 8 +- src/mlpack/core/tree/cellbound.hpp | 4 +- .../rectangle_tree/discrete_hilbert_value.hpp | 4 +- .../tree/rectangle_tree/rectangle_tree.hpp | 2 +- src/mlpack/core/util/ens_traits.hpp | 12 +-- .../core/util/first_element_is_arma.hpp | 4 +- src/mlpack/core/util/prefixedoutstream.hpp | 4 +- .../core/util/prefixedoutstream_impl.hpp | 4 +- src/mlpack/core/util/sfinae_utility.hpp | 29 +++--- src/mlpack/core/util/size_checks.hpp | 10 +- src/mlpack/core/util/using.hpp | 2 +- src/mlpack/methods/adaboost/adaboost.hpp | 10 +- src/mlpack/methods/adaboost/adaboost_impl.hpp | 10 +- .../ann/convolution_rules/fft_convolution.hpp | 8 +- .../convolution_rules/naive_convolution.hpp | 8 +- src/mlpack/methods/ann/ffn.hpp | 8 +- src/mlpack/methods/ann/ffn_impl.hpp | 8 +- src/mlpack/methods/ann/not_adapted/brnn.hpp | 8 +- .../methods/ann/not_adapted/brnn_impl.hpp | 12 +-- .../methods/ann/not_adapted/gan/gan.hpp | 34 +++---- .../methods/ann/not_adapted/gan/gan_impl.hpp | 12 +-- .../methods/ann/not_adapted/gan/wgan_impl.hpp | 6 +- .../ann/not_adapted/gan/wgangp_impl.hpp | 12 +-- .../methods/ann/not_adapted/rbm/rbm.hpp | 38 ++++---- .../methods/ann/not_adapted/rbm/rbm_impl.hpp | 14 +-- .../not_adapted/rbm/spike_slab_rbm_impl.hpp | 22 ++--- .../bayesian_linear_regression.hpp | 36 +++---- .../methods/decision_tree/decision_tree.hpp | 16 ++-- .../decision_tree/decision_tree_impl.hpp | 67 +++++++------ .../decision_tree/decision_tree_regressor.hpp | 16 ++-- .../decision_tree_regressor_impl.hpp | 72 +++++++------- .../best_binary_categorical_split_impl.hpp | 2 +- .../splits/best_binary_numeric_split.hpp | 8 +- .../splits/best_binary_numeric_split_impl.hpp | 8 +- src/mlpack/methods/det/dtree_impl.hpp | 2 +- src/mlpack/methods/gmm/em_fit_impl.hpp | 16 ++-- .../gmm/positive_definite_constraint.hpp | 4 +- src/mlpack/methods/kde/kde_impl.hpp | 4 +- src/mlpack/methods/kde/kde_model.hpp | 12 +-- src/mlpack/methods/kde/kde_rules.hpp | 2 +- .../methods/kmeans/dual_tree_kmeans_impl.hpp | 8 +- src/mlpack/methods/lars/lars.hpp | 96 +++++++++---------- .../linear_regression/linear_regression.hpp | 44 ++++----- .../linear_regression_impl.hpp | 4 +- src/mlpack/methods/linear_svm/linear_svm.hpp | 44 ++++----- src/mlpack/methods/lmnn/lmnn.hpp | 20 ++-- .../local_coordinate_coding/lcc_impl.hpp | 2 +- .../logistic_regression.hpp | 48 +++++----- src/mlpack/methods/mean_shift/mean_shift.hpp | 4 +- .../methods/mean_shift/mean_shift_impl.hpp | 4 +- .../naive_bayes_classifier_impl.hpp | 24 ++--- src/mlpack/methods/nca/nca.hpp | 20 ++-- src/mlpack/methods/pca/pca_impl.hpp | 12 +-- src/mlpack/methods/perceptron/perceptron.hpp | 8 +- .../methods/perceptron/perceptron_impl.hpp | 8 +- .../softmax_regression/softmax_regression.hpp | 46 ++++----- src/mlpack/tests/cv_test.cpp | 4 +- src/mlpack/tests/distribution_test.cpp | 32 +++---- src/mlpack/tests/lars_test.cpp | 6 +- src/mlpack/tests/lmnn_test.cpp | 24 ++--- .../tests/main_tests/main_test_fixture.hpp | 2 +- src/mlpack/tests/nca_test.cpp | 6 +- src/mlpack/tests/pca_test.cpp | 6 +- src/mlpack/tests/sparse_coding_test.cpp | 6 +- src/mlpack/tests/test_catch_tools.hpp | 20 ++-- src/mlpack/tests/ub_tree_test.cpp | 4 +- 190 files changed, 2142 insertions(+), 2141 deletions(-) diff --git a/doc/developer/trees.md b/doc/developer/trees.md index 48f548996e..aa31c277f0 100644 --- a/doc/developer/trees.md +++ b/doc/developer/trees.md @@ -222,7 +222,7 @@ class ExampleTree template ExampleTree( Archive& ar, - const typename std::enable_if_c::type* = 0); + const std::enable_if_t* = 0); // Release any resources held by the tree. ~ExampleTree(); @@ -476,7 +476,7 @@ archive: template ExampleTree( Archive& ar, - const typename std::enable_if_c::type* = 0); + const std::enable_if_t* = 0); ``` This has implications on how the tree must be stored. In this case, the dataset diff --git a/doc/user/cv.md b/doc/user/cv.md index 53067911d7..51302b57cd 100644 --- a/doc/user/cv.md +++ b/doc/user/cv.md @@ -111,7 +111,7 @@ DecisionTree(MatType&& data, WeightsType&& weights, const size_t minimumLeafSize = 10, const std::enable_if_t::type>::value>* + std::remove_reference_t>::value>* = 0); ``` diff --git a/src/mlpack/bindings/R/default_param.hpp b/src/mlpack/bindings/R/default_param.hpp index 1b39120275..1e05baf21e 100644 --- a/src/mlpack/bindings/R/default_param.hpp +++ b/src/mlpack/bindings/R/default_param.hpp @@ -26,13 +26,13 @@ namespace r { template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>* = 0, + const std::enable_if_t>>* = 0); /** * Return the default value of a vector option. @@ -40,7 +40,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0); /** * Return the default value of a string option. @@ -48,8 +48,8 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if::value - >::type* = 0); + const std::enable_if_t + >* = 0); /** * Return the default value of a matrix option, a tuple option, a @@ -59,10 +59,10 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if< + const std::enable_if_t< arma::is_arma_type::value || - std::is_same>::value>::type* /* junk */ = 0); + std::is_same_v>>* /* junk */ = 0); /** * Return the default value of a model option (this returns the default @@ -71,8 +71,8 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0); /** * Return the default value of an option. This is the function that will be @@ -84,7 +84,7 @@ void DefaultParam(util::ParamData& data, void* output) { std::string* outstr = (std::string*) output; - *outstr = DefaultParamImpl::type>(data); + *outstr = DefaultParamImpl>(data); } } // namespace r diff --git a/src/mlpack/bindings/R/default_param_impl.hpp b/src/mlpack/bindings/R/default_param_impl.hpp index a69a13892f..a542cf7885 100644 --- a/src/mlpack/bindings/R/default_param_impl.hpp +++ b/src/mlpack/bindings/R/default_param_impl.hpp @@ -24,15 +24,15 @@ namespace r { template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>*, + const std::enable_if_t>>*) { std::ostringstream oss; - if (std::is_same::value) + if (std::is_same_v) { // If this is the verbose option, print the default that uses the global // package option. @@ -58,13 +58,13 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*) { // Print each element in an array delimited by square brackets. std::ostringstream oss; const T& vector = std::any_cast(data.value); oss << "c("; - if (std::is_same>::value) + if (std::is_same_v>) { if (vector.size() > 0) { @@ -101,7 +101,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type*) + const std::enable_if_t>*) { const std::string& s = *std::any_cast(&data.value); return "\"" + s + "\""; @@ -114,21 +114,21 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& /* data */, - const typename std::enable_if< + const std::enable_if_t< arma::is_arma_type::value || - std::is_same>::value>::type* /* junk */) + std::is_same_v>>* /* junk */) { // Get the filename and return it, or return an empty string. - if (std::is_same::value || - std::is_same::value || - std::is_same::value) + if (std::is_same_v || + std::is_same_v || + std::is_same_v) { return "matrix(numeric(), 0, 0)"; } - else if (std::is_same>::value || - std::is_same>::value || - std::is_same>::value) + else if (std::is_same_v> || + std::is_same_v> || + std::is_same_v>) { return "matrix(integer(), 0, 0)"; } @@ -144,8 +144,8 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& /* data */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*) { return "NA"; } diff --git a/src/mlpack/bindings/R/get_printable_param.hpp b/src/mlpack/bindings/R/get_printable_param.hpp index e1857855ba..e644113114 100644 --- a/src/mlpack/bindings/R/get_printable_param.hpp +++ b/src/mlpack/bindings/R/get_printable_param.hpp @@ -25,11 +25,11 @@ namespace r { template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0) { std::ostringstream oss; oss << std::any_cast(data.value); @@ -42,7 +42,7 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { const T& t = std::any_cast(data.value); @@ -58,7 +58,7 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { // Get the matrix. const T& matrix = std::any_cast(data.value); @@ -74,8 +74,8 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { std::ostringstream oss; oss << data.cppType << " model at " << std::any_cast(data.value); @@ -88,8 +88,8 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t>>* = 0) { // Get the matrix. const T& tuple = std::any_cast(data.value); @@ -116,7 +116,7 @@ void GetPrintableParam(util::ParamData& data, void* output) { *((std::string*) output) = - GetPrintableParam::type>(data); + GetPrintableParam>(data); } } // namespace r diff --git a/src/mlpack/bindings/R/get_printable_type.hpp b/src/mlpack/bindings/R/get_printable_type.hpp index 6ca4932fe1..72e9d0c5cf 100644 --- a/src/mlpack/bindings/R/get_printable_type.hpp +++ b/src/mlpack/bindings/R/get_printable_type.hpp @@ -23,88 +23,88 @@ namespace r { template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0); template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*); + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*); template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*); + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*); template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if< - !util::IsStdVector::value>::type*, - const typename std::enable_if< - !data::HasSerialize::value>::type*, - const typename std::enable_if< - !arma::is_arma_type::value>::type*, - const typename std::enable_if< - !std::is_same>::value>::type*); + const std::enable_if_t< + !util::IsStdVector::value>*, + const std::enable_if_t< + !data::HasSerialize::value>*, + const std::enable_if_t< + !arma::is_arma_type::value>*, + const std::enable_if_t< + !std::is_same_v>>*); template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*); + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*); template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*); + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*); template inline std::string GetPrintableType( util::ParamData& d, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0); template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0); template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t>>* = 0); template inline std::string GetPrintableType( util::ParamData& d, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0); template void GetPrintableType(util::ParamData& d, @@ -112,7 +112,7 @@ void GetPrintableType(util::ParamData& d, void* output) { *((std::string*) output) = - GetPrintableType::type>(d); + GetPrintableType>(d); } } // namespace r diff --git a/src/mlpack/bindings/R/get_printable_type_impl.hpp b/src/mlpack/bindings/R/get_printable_type_impl.hpp index 5dea060aad..0f388103c8 100644 --- a/src/mlpack/bindings/R/get_printable_type_impl.hpp +++ b/src/mlpack/bindings/R/get_printable_type_impl.hpp @@ -22,11 +22,11 @@ namespace r { template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { return "unknown"; } @@ -34,11 +34,11 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { return "integer"; } @@ -46,11 +46,11 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { return "numeric"; } @@ -58,15 +58,15 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if< - !util::IsStdVector::value>::type*, - const typename std::enable_if< - !data::HasSerialize::value>::type*, - const typename std::enable_if< - !arma::is_arma_type::value>::type*, - const typename std::enable_if< - !std::is_same>::value>::type*) + const std::enable_if_t< + !util::IsStdVector::value>*, + const std::enable_if_t< + !data::HasSerialize::value>*, + const std::enable_if_t< + !arma::is_arma_type::value>*, + const std::enable_if_t< + !std::is_same_v>>*) { return "character"; } @@ -74,11 +74,11 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { return "integer"; } @@ -86,11 +86,11 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { return "logical"; } @@ -98,9 +98,9 @@ inline std::string GetPrintableType( template inline std::string GetPrintableType( util::ParamData& d, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { return "vector of " + GetPrintableType(d) + "s"; } @@ -108,17 +108,17 @@ inline std::string GetPrintableType( template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { std::string type = "numeric matrix"; - if (std::is_same::value) + if (std::is_same_v) { if (T::is_row || T::is_col) type = "numeric vector"; } - else if (std::is_same::value) + else if (std::is_same_v) { type = "integer matrix"; if (T::is_row || T::is_col) @@ -131,8 +131,8 @@ inline std::string GetPrintableType( template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if>::value>::type*) + const std::enable_if_t>>*) { return "categorical matrix/data.frame"; } @@ -140,10 +140,10 @@ inline std::string GetPrintableType( template inline std::string GetPrintableType( util::ParamData& d, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { std::string type = util::StripType(d.cppType); if (type == "mlpackModel") diff --git a/src/mlpack/bindings/R/get_r_type.hpp b/src/mlpack/bindings/R/get_r_type.hpp index 3e92bb717d..fe8c3dd7e8 100644 --- a/src/mlpack/bindings/R/get_r_type.hpp +++ b/src/mlpack/bindings/R/get_r_type.hpp @@ -23,11 +23,11 @@ namespace r { template inline std::string GetRType( util::ParamData& /* d */, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0) { return "unknown"; } @@ -35,11 +35,11 @@ inline std::string GetRType( template<> inline std::string GetRType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { return "logical"; } @@ -47,11 +47,11 @@ inline std::string GetRType( template<> inline std::string GetRType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { return "integer"; } @@ -59,11 +59,11 @@ inline std::string GetRType( template<> inline std::string GetRType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { return "integer"; } @@ -71,11 +71,11 @@ inline std::string GetRType( template<> inline std::string GetRType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { return "numeric"; } @@ -83,15 +83,15 @@ inline std::string GetRType( template<> inline std::string GetRType( util::ParamData& /* d */, - const typename std::enable_if< - !util::IsStdVector::value>::type*, - const typename std::enable_if< - !data::HasSerialize::value>::type*, - const typename std::enable_if< - !arma::is_arma_type::value>::type*, - const typename std::enable_if< - !std::is_same>::value>::type*) + const std::enable_if_t< + !util::IsStdVector::value>*, + const std::enable_if_t< + !data::HasSerialize::value>*, + const std::enable_if_t< + !arma::is_arma_type::value>*, + const std::enable_if_t< + !std::is_same_v>>*) { return "character"; } @@ -99,7 +99,7 @@ inline std::string GetRType( template inline std::string GetRType( util::ParamData& d, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { return GetRType(d) + " vector"; } @@ -107,9 +107,9 @@ inline std::string GetRType( template inline std::string GetRType( util::ParamData& d, - const typename std::enable_if>::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t>>* = 0, + const std::enable_if_t::value>* = 0) { std::string elemType = GetRType(d); std::string type = "matrix"; @@ -124,8 +124,8 @@ inline std::string GetRType( template inline std::string GetRType( util::ParamData& /* d */, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t>>* = 0) { return "numeric matrix/data.frame with info"; } @@ -133,8 +133,8 @@ inline std::string GetRType( template inline std::string GetRType( util::ParamData& d, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { return util::StripType(d.cppType); } diff --git a/src/mlpack/bindings/R/get_type.hpp b/src/mlpack/bindings/R/get_type.hpp index 55264eedb5..1ef816f7bc 100644 --- a/src/mlpack/bindings/R/get_type.hpp +++ b/src/mlpack/bindings/R/get_type.hpp @@ -24,11 +24,11 @@ namespace r { template inline std::string GetType( util::ParamData& /* d */, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0) { return "unknown"; } @@ -36,11 +36,11 @@ inline std::string GetType( template<> inline std::string GetType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { return "Int"; } @@ -48,11 +48,11 @@ inline std::string GetType( template<> inline std::string GetType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { return "Float"; } @@ -60,11 +60,11 @@ inline std::string GetType( template<> inline std::string GetType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { return "Double"; } @@ -72,14 +72,14 @@ inline std::string GetType( template<> inline std::string GetType( util::ParamData& /* d */, - const typename std::enable_if< - !util::IsStdVector::value>::type*, - const typename std::enable_if< - !data::HasSerialize::value>::type*, - const typename std::enable_if< - !arma::is_arma_type::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t< + !util::IsStdVector::value>*, + const std::enable_if_t< + !data::HasSerialize::value>*, + const std::enable_if_t< + !arma::is_arma_type::value>*, + const std::enable_if_t>>*) { return "String"; } @@ -87,11 +87,11 @@ inline std::string GetType( template<> inline std::string GetType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { return "Bool"; } @@ -99,9 +99,9 @@ inline std::string GetType( template inline std::string GetType( util::ParamData& d, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0) { return "Vec" + GetType(d); } @@ -109,12 +109,12 @@ inline std::string GetType( template inline std::string GetType( util::ParamData& /* d */, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0) { std::string type = ""; - if (std::is_same::value) + if (std::is_same_v) { if (T::is_row) type = "Row"; @@ -123,7 +123,7 @@ inline std::string GetType( else type = "Mat"; } - else if (std::is_same::value) + else if (std::is_same_v) { if (T::is_row) type = "URow"; @@ -139,8 +139,8 @@ inline std::string GetType( template inline std::string GetType( util::ParamData& /* d */, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t>>* = 0) { return "MatWithInfo"; } @@ -148,8 +148,8 @@ inline std::string GetType( template inline std::string GetType( util::ParamData& d, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { return d.cppType; } @@ -170,7 +170,7 @@ void GetType(util::ParamData& d, void* output) { *((std::string*) output) = - GetType::type>(d); + GetType>(d); } } // namespace r diff --git a/src/mlpack/bindings/R/print_doc.hpp b/src/mlpack/bindings/R/print_doc.hpp index 9acdb03dcf..5dc2ea65a7 100644 --- a/src/mlpack/bindings/R/print_doc.hpp +++ b/src/mlpack/bindings/R/print_doc.hpp @@ -82,7 +82,7 @@ void PrintDoc(util::ParamData& d, } } - oss << " (" << GetRType::type>(d) << ")."; + oss << " (" << GetRType>(d) << ")."; if (out) oss << "}"; diff --git a/src/mlpack/bindings/R/print_input_param.hpp b/src/mlpack/bindings/R/print_input_param.hpp index 4af58ca80c..d56af209c1 100644 --- a/src/mlpack/bindings/R/print_input_param.hpp +++ b/src/mlpack/bindings/R/print_input_param.hpp @@ -29,7 +29,7 @@ void PrintInputParam(util::ParamData& d, void* /* output */) { MLPACK_COUT_STREAM << d.name; - if (std::is_same::value) + if (std::is_same_v) { if (d.name == "verbose") { diff --git a/src/mlpack/bindings/R/print_input_processing.hpp b/src/mlpack/bindings/R/print_input_processing.hpp index 40a073c970..49ce8de9be 100644 --- a/src/mlpack/bindings/R/print_input_processing.hpp +++ b/src/mlpack/bindings/R/print_input_processing.hpp @@ -26,10 +26,10 @@ namespace r { template void PrintInputProcessing( util::ParamData& d, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0) { if (!d.required) { @@ -72,7 +72,7 @@ void PrintInputProcessing( template void PrintInputProcessing( util::ParamData& d, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { std::string extraTransStr = ""; if (d.cppType == "arma::mat") @@ -135,8 +135,8 @@ void PrintInputProcessing( template void PrintInputProcessing( util::ParamData& d, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t>>* = 0) { if (!d.required) { @@ -182,8 +182,8 @@ void PrintInputProcessing( template void PrintInputProcessing( util::ParamData& d, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { if (!d.required) { @@ -229,7 +229,7 @@ void PrintInputProcessing(util::ParamData& d, const void* /* input */, void* /* output */) { - PrintInputProcessing::type>(d); + PrintInputProcessing>(d); } } // namespace r diff --git a/src/mlpack/bindings/R/print_output_processing.hpp b/src/mlpack/bindings/R/print_output_processing.hpp index ad06ba31f1..df64d2451d 100644 --- a/src/mlpack/bindings/R/print_output_processing.hpp +++ b/src/mlpack/bindings/R/print_output_processing.hpp @@ -26,10 +26,10 @@ namespace r { template void PrintOutputProcessing( util::ParamData& d, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0) { /** * This gives us code like: @@ -48,9 +48,9 @@ void PrintOutputProcessing( template void PrintOutputProcessing( util::ParamData& d, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0) { /** * This gives us code like: @@ -69,8 +69,8 @@ void PrintOutputProcessing( template void PrintOutputProcessing( util::ParamData& d, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t>>* = 0) { /** * This gives us code like: @@ -89,8 +89,8 @@ void PrintOutputProcessing( template void PrintOutputProcessing( util::ParamData& d, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { /** * This gives us code like: @@ -112,7 +112,7 @@ void PrintOutputProcessing(util::ParamData& d, const void* /*input*/, void* /* output */) { - PrintOutputProcessing::type>(d); + PrintOutputProcessing>(d); } } // namespace r diff --git a/src/mlpack/bindings/R/print_serialize_util.hpp b/src/mlpack/bindings/R/print_serialize_util.hpp index 362adbfe34..4a44781061 100644 --- a/src/mlpack/bindings/R/print_serialize_util.hpp +++ b/src/mlpack/bindings/R/print_serialize_util.hpp @@ -25,8 +25,8 @@ namespace r { template void PrintSerializeUtil( util::ParamData& /* d */, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { // Do Nothing. } @@ -37,7 +37,7 @@ void PrintSerializeUtil( template void PrintSerializeUtil( util::ParamData& /* d */, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { // Do Nothing. } @@ -48,8 +48,8 @@ void PrintSerializeUtil( template void PrintSerializeUtil( util::ParamData& d, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { /** * This gives us code like: @@ -76,7 +76,7 @@ void PrintSerializeUtil(util::ParamData& d, const void* /*input*/, void* /* output */) { - PrintSerializeUtil::type>(d); + PrintSerializeUtil>(d); } } // namespace r diff --git a/src/mlpack/bindings/R/print_type_doc.hpp b/src/mlpack/bindings/R/print_type_doc.hpp index 5f0253578b..9925372eee 100644 --- a/src/mlpack/bindings/R/print_type_doc.hpp +++ b/src/mlpack/bindings/R/print_type_doc.hpp @@ -25,11 +25,11 @@ namespace r { template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0); /** * Return a string representing the command-line type of a vector. @@ -37,7 +37,7 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0); /** * Return a string representing the command-line type of a matrix option. @@ -45,7 +45,7 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0); /** * Return a string representing the command-line type of a matrix tuple option. @@ -53,8 +53,8 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t>>* = 0); /** * Return a string representing the command-line type of a model. @@ -62,8 +62,8 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0); /** * Print the command-line type of an option into a string. @@ -74,7 +74,7 @@ void PrintTypeDoc(util::ParamData& data, void* output) { *((std::string*) output) = - PrintTypeDoc::type>(data); + PrintTypeDoc>(data); } } // namespace r diff --git a/src/mlpack/bindings/R/print_type_doc_impl.hpp b/src/mlpack/bindings/R/print_type_doc_impl.hpp index bc8ba85f25..a5f837a811 100644 --- a/src/mlpack/bindings/R/print_type_doc_impl.hpp +++ b/src/mlpack/bindings/R/print_type_doc_impl.hpp @@ -24,29 +24,29 @@ namespace r { template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { // A flag type. - if (std::is_same::value) + if (std::is_same_v) { return "A boolean flag option (i.e. `TRUE` or `FALSE`)."; } // An integer. - else if (std::is_same::value) + else if (std::is_same_v) { return "An integer (i.e., `1`)."; } // A floating point value. - else if (std::is_same::value) + else if (std::is_same_v) { return "A floating-point number (i.e., `0.5`)."; } // A string. - else if (std::is_same::value) + else if (std::is_same_v) { return "A character string (i.e., `\"hello\"`)."; } @@ -64,13 +64,13 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*) { - if (std::is_same>::value) + if (std::is_same_v>) { return "A vector of integers; i.e., `c(0, 1, 2)`."; } - else if (std::is_same>::value) + else if (std::is_same_v>) { return "A vector of strings; i.e., `c(\"hello\", \"goodbye\")`."; } @@ -86,9 +86,9 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*) { - if (std::is_same::value) + if (std::is_same_v) { if (T::is_col || T::is_row) { @@ -102,7 +102,7 @@ std::string PrintTypeDoc( "2-d `matrix`)."; } } - else if (std::is_same::value) + else if (std::is_same_v) { if (T::is_col || T::is_row) { @@ -128,8 +128,8 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& /* data */, - const typename std::enable_if>::value>::type*) + const std::enable_if_t>>*) { return "A 2-d array containing `numeric` data. Like the regular 2-d matrices" ", this can be a `matrix`, or a `data.frame`. However, this type can also" @@ -146,8 +146,8 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& /* data */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*) { return "An mlpack model pointer. `` refers to the type of model that " "is being stored, so, e.g., for `cf()`, the type will be `CFModel`. " diff --git a/src/mlpack/bindings/cli/add_to_cli11.hpp b/src/mlpack/bindings/cli/add_to_cli11.hpp index c9b0e87bae..5bbb3eff9d 100644 --- a/src/mlpack/bindings/cli/add_to_cli11.hpp +++ b/src/mlpack/bindings/cli/add_to_cli11.hpp @@ -33,15 +33,15 @@ template void AddToCLI11(const std::string& cliName, util::ParamData& param, CLI::App& app, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>::value>::type* = 0) + arma::mat>>>* = 0) { app.add_option_function(cliName.c_str(), [¶m](const std::string& value) @@ -65,15 +65,15 @@ template void AddToCLI11(const std::string& cliName, util::ParamData& param, CLI::App& app, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if< - data::HasSerialize::value>::type* = 0, - const typename std::enable_if>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t< + data::HasSerialize::value>* = 0, + const std::enable_if_t>::value>::type* = 0) + arma::mat>>>* = 0) { app.add_option_function(cliName.c_str(), [¶m](const std::string& value) @@ -97,13 +97,13 @@ template void AddToCLI11(const std::string& cliName, util::ParamData& param, CLI::App& app, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if< - arma::is_arma_type::value>::type* = 0, - const typename std::enable_if>* = 0, + const std::enable_if_t< + arma::is_arma_type::value>* = 0, + const std::enable_if_t>::value>::type* = 0) + arma::mat>>>* = 0) { app.add_option_function(cliName.c_str(), [¶m](const std::string& value) @@ -127,15 +127,15 @@ template void AddToCLI11(const std::string& cliName, util::ParamData& param, CLI::App& app, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>::value>::type* = 0) + arma::mat>>>* = 0) { app.add_option_function(cliName.c_str(), [¶m](const T& value) @@ -157,15 +157,15 @@ template void AddToCLI11(const std::string& cliName, util::ParamData& param, CLI::App& app, - const typename std::enable_if< - std::is_same::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>::value>::type* = 0) + arma::mat>>>* = 0) { app.add_flag_function(cliName.c_str(), [¶m](const T& value) @@ -194,14 +194,14 @@ void AddToCLI11(util::ParamData& param, // Generate the name to be given to CLI11. const std::string mappedName = - MapParameterName::type>(param.name); + MapParameterName>(param.name); std::string cliName = (param.alias != '\0') ? "-" + std::string(1, param.alias) + ",--" + mappedName : "--" + mappedName; // Note that we have to add the option as type equal to the mapped type, not // the true type of the option. - AddToCLI11::type>( + AddToCLI11>( cliName, param, *app); } diff --git a/src/mlpack/bindings/cli/cli_option.hpp b/src/mlpack/bindings/cli/cli_option.hpp index 52c41474ce..a1c1032be5 100644 --- a/src/mlpack/bindings/cli/cli_option.hpp +++ b/src/mlpack/bindings/cli/cli_option.hpp @@ -91,21 +91,21 @@ class CLIOption data.cppType = cppName; // Apply default value. - if (std::is_same::type, - typename ParameterType::type>::type>::value) + if (std::is_same_v, + typename ParameterType< + std::remove_pointer_t>::type>) { data.value = defaultValue; } else { - typename ParameterType::type>::type tmp; + typename ParameterType>::type tmp; data.value = std::tuple(defaultValue, tmp); } const std::string tname = data.tname; const std::string cliName = MapParameterName< - typename std::remove_pointer::type>(identifier); + std::remove_pointer_t>(identifier); std::string progOptId = (alias[0] != '\0') ? "-" + std::string(1, alias[0]) + ",--" + cliName : "--" + cliName; diff --git a/src/mlpack/bindings/cli/default_param.hpp b/src/mlpack/bindings/cli/default_param.hpp index f8d97bdc1c..256afdbc51 100644 --- a/src/mlpack/bindings/cli/default_param.hpp +++ b/src/mlpack/bindings/cli/default_param.hpp @@ -26,13 +26,13 @@ namespace cli { template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>* = 0, + const std::enable_if_t>>* = 0); /** * Return the default value of a vector option. @@ -40,7 +40,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0); /** * Return the default value of a string option. @@ -48,8 +48,8 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if::value - >::type* = 0); + const std::enable_if_t + >* = 0); /** * Return the default value of a matrix option, a tuple option, a @@ -59,10 +59,10 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if< + const std::enable_if_t< arma::is_arma_type::value || - std::is_same>::value>::type* /* junk */ = 0); + std::is_same_v>>* /* junk */ = 0); /** * Return the default value of a model option (this returns the default @@ -71,8 +71,8 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0); /** * Return the default value of an option. This is the function that will be @@ -84,7 +84,7 @@ void DefaultParam(util::ParamData& data, void* output) { std::string* outstr = (std::string*) output; - *outstr = DefaultParamImpl::type>(data); + *outstr = DefaultParamImpl>(data); } } // namespace cli diff --git a/src/mlpack/bindings/cli/default_param_impl.hpp b/src/mlpack/bindings/cli/default_param_impl.hpp index 498f950ff8..d7e0506d1e 100644 --- a/src/mlpack/bindings/cli/default_param_impl.hpp +++ b/src/mlpack/bindings/cli/default_param_impl.hpp @@ -24,16 +24,16 @@ namespace cli { template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>*, + const std::enable_if_t>>*) { std::ostringstream oss; - if (!std::is_same::value) + if (!std::is_same_v) oss << std::any_cast(data.value); return oss.str(); @@ -45,13 +45,13 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*) { // Print each element in an array delimited by square brackets. std::ostringstream oss; const T& vector = std::any_cast(data.value); oss << "["; - if (std::is_same>::value) + if (std::is_same_v>) { if (vector.size() > 0) { @@ -89,7 +89,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type*) + const std::enable_if_t>*) { const std::string& s = *std::any_cast(&data.value); return "'" + s + "'"; @@ -101,10 +101,10 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& /* data */, - const typename std::enable_if< + const std::enable_if_t< arma::is_arma_type::value || - std::is_same>::value>::type* /* junk */) + std::is_same_v>>* /* junk */) { // The filename will always be empty. return "''"; @@ -116,8 +116,8 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& /* data */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*) { return "''"; } diff --git a/src/mlpack/bindings/cli/delete_allocated_memory.hpp b/src/mlpack/bindings/cli/delete_allocated_memory.hpp index d6c8c2f814..d73715fa59 100644 --- a/src/mlpack/bindings/cli/delete_allocated_memory.hpp +++ b/src/mlpack/bindings/cli/delete_allocated_memory.hpp @@ -21,8 +21,8 @@ namespace cli { template void DeleteAllocatedMemoryImpl( util::ParamData& /* d */, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { // Do nothing. } @@ -30,7 +30,7 @@ void DeleteAllocatedMemoryImpl( template void DeleteAllocatedMemoryImpl( util::ParamData& /* d */, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { // Do nothing. } @@ -38,8 +38,8 @@ void DeleteAllocatedMemoryImpl( template void DeleteAllocatedMemoryImpl( util::ParamData& d, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { // Delete the allocated memory (hopefully we actually own it). typedef std::tuple TupleType; @@ -52,7 +52,7 @@ void DeleteAllocatedMemory( const void* /* input */, void* /* output */) { - DeleteAllocatedMemoryImpl::type>(d); + DeleteAllocatedMemoryImpl>(d); } } // namespace cli diff --git a/src/mlpack/bindings/cli/get_allocated_memory.hpp b/src/mlpack/bindings/cli/get_allocated_memory.hpp index 426cf350cb..989dab1535 100644 --- a/src/mlpack/bindings/cli/get_allocated_memory.hpp +++ b/src/mlpack/bindings/cli/get_allocated_memory.hpp @@ -22,8 +22,8 @@ namespace cli { template void* GetAllocatedMemory( util::ParamData& /* d */, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { return NULL; } @@ -31,7 +31,7 @@ void* GetAllocatedMemory( template void* GetAllocatedMemory( util::ParamData& /* d */, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { return NULL; } @@ -39,8 +39,8 @@ void* GetAllocatedMemory( template void* GetAllocatedMemory( util::ParamData& d, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { // Here we have a model, which is a tuple, and we need the address of the // memory. @@ -54,7 +54,7 @@ void GetAllocatedMemory(util::ParamData& d, void* output) { *((void**) output) = - GetAllocatedMemory::type>(d); + GetAllocatedMemory>(d); } } // namespace cli diff --git a/src/mlpack/bindings/cli/get_param.hpp b/src/mlpack/bindings/cli/get_param.hpp index 528f0f8753..a768a2902a 100644 --- a/src/mlpack/bindings/cli/get_param.hpp +++ b/src/mlpack/bindings/cli/get_param.hpp @@ -28,10 +28,10 @@ namespace cli { template T& GetParam( util::ParamData& d, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0) { // No mapping is needed, so just cast it directly. return *std::any_cast(&d.value); @@ -45,7 +45,7 @@ T& GetParam( template T& GetParam( util::ParamData& d, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { // If the matrix is an input matrix, we have to load the matrix. 'value' // contains the filename. It's possible we could load empty matrices many @@ -80,8 +80,8 @@ T& GetParam( template T& GetParam( util::ParamData& d, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t>>* = 0) { // If this is an input parameter, we need to load both the matrix and the // dataset info. @@ -110,8 +110,8 @@ T& GetParam( template T*& GetParam( util::ParamData& d, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { // If the model is an input model, we have to load it from file. 'value' // contains the filename. @@ -140,7 +140,7 @@ template void GetParam(util::ParamData& d, const void* /* input */, void* output) { // Cast to the correct type. - *((T**) output) = &GetParam::type>(d); + *((T**) output) = &GetParam>(d); } } // namespace cli diff --git a/src/mlpack/bindings/cli/get_printable_param.hpp b/src/mlpack/bindings/cli/get_printable_param.hpp index 2cd2221101..bffe499f37 100644 --- a/src/mlpack/bindings/cli/get_printable_param.hpp +++ b/src/mlpack/bindings/cli/get_printable_param.hpp @@ -27,11 +27,11 @@ namespace cli { template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0); /** * Print a vector option, with spaces between it. @@ -39,7 +39,7 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0); /** * Print a matrix/tuple option (this just prints the filename). @@ -47,9 +47,9 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if::value || - std::is_same>::value>::type* = 0); + const std::enable_if_t::value || + std::is_same_v>>* = 0); /** * Print a model option (this just prints the filename). @@ -57,8 +57,8 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0); /** * Print an option into a std::string. This should print a short, one-line @@ -71,7 +71,7 @@ void GetPrintableParam(util::ParamData& data, void* output) { *((std::string*) output) = - GetPrintableParam::type>(data); + GetPrintableParam>(data); } } // namespace cli diff --git a/src/mlpack/bindings/cli/get_printable_param_impl.hpp b/src/mlpack/bindings/cli/get_printable_param_impl.hpp index 6e7ae18c42..d9dadfecde 100644 --- a/src/mlpack/bindings/cli/get_printable_param_impl.hpp +++ b/src/mlpack/bindings/cli/get_printable_param_impl.hpp @@ -23,11 +23,11 @@ namespace cli { template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { std::ostringstream oss; oss << std::any_cast(data.value); @@ -38,7 +38,7 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if::value>::type* + const std::enable_if_t::value>* /* junk */) { const T& t = std::any_cast(data.value); @@ -53,7 +53,7 @@ std::string GetPrintableParam( template std::string GetMatrixSize( T& matrix, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { std::ostringstream oss; oss << matrix.n_rows << "x" << matrix.n_cols << " matrix"; @@ -64,8 +64,8 @@ std::string GetMatrixSize( template std::string GetMatrixSize( T& matrixAndInfo, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t>>* = 0) { return GetMatrixSize(std::get<1>(matrixAndInfo)); } @@ -74,9 +74,9 @@ std::string GetMatrixSize( template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if::value || - std::is_same>::value>::type* /* junk */) + const std::enable_if_t::value || + std::is_same_v>>* /* junk */) { // Extract the string from the tuple that's being held. typedef std::tuple::type> TupleType; @@ -103,8 +103,8 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*) { // Extract the string from the tuple that's being held. typedef std::tuple::type> TupleType; diff --git a/src/mlpack/bindings/cli/get_printable_param_name.hpp b/src/mlpack/bindings/cli/get_printable_param_name.hpp index b875d2f72d..f5619ca377 100644 --- a/src/mlpack/bindings/cli/get_printable_param_name.hpp +++ b/src/mlpack/bindings/cli/get_printable_param_name.hpp @@ -26,10 +26,10 @@ namespace cli { template std::string GetPrintableParamName( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0); /** * Get the parameter name for a matrix type (where the user has to pass the file @@ -38,7 +38,7 @@ std::string GetPrintableParamName( template std::string GetPrintableParamName( util::ParamData& data, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0); /** * Get the parameter name for a serializable model type (where the user has to @@ -47,8 +47,8 @@ std::string GetPrintableParamName( template std::string GetPrintableParamName( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0); /** * Get the parameter name for a mapped matrix type (where the user has to pass @@ -57,8 +57,8 @@ std::string GetPrintableParamName( template std::string GetPrintableParamName( util::ParamData& data, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t>>* = 0); /** * Get the parameter's name as seen by the user. @@ -70,7 +70,7 @@ void GetPrintableParamName( void* output) { *((std::string*) output) = - GetPrintableParamName::type>(d); + GetPrintableParamName>(d); } } // namespace cli diff --git a/src/mlpack/bindings/cli/get_printable_param_name_impl.hpp b/src/mlpack/bindings/cli/get_printable_param_name_impl.hpp index 7c355c3dbc..3d21f56b2a 100644 --- a/src/mlpack/bindings/cli/get_printable_param_name_impl.hpp +++ b/src/mlpack/bindings/cli/get_printable_param_name_impl.hpp @@ -26,10 +26,10 @@ namespace cli { template std::string GetPrintableParamName( util::ParamData& data, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { return "--" + data.name; } @@ -41,7 +41,7 @@ std::string GetPrintableParamName( template std::string GetPrintableParamName( util::ParamData& data, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*) { return "--" + data.name + "_file"; } @@ -53,8 +53,8 @@ std::string GetPrintableParamName( template std::string GetPrintableParamName( util::ParamData& data, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*) { return "--" + data.name + "_file"; } @@ -66,8 +66,8 @@ std::string GetPrintableParamName( template std::string GetPrintableParamName( util::ParamData& data, - const typename std::enable_if>::value>::type*) + const std::enable_if_t>>*) { return "--" + data.name + "_file"; } diff --git a/src/mlpack/bindings/cli/get_printable_param_value.hpp b/src/mlpack/bindings/cli/get_printable_param_value.hpp index 621640b3c1..f7be9a7b7b 100644 --- a/src/mlpack/bindings/cli/get_printable_param_value.hpp +++ b/src/mlpack/bindings/cli/get_printable_param_value.hpp @@ -27,10 +27,10 @@ template std::string GetPrintableParamValue( util::ParamData& data, const std::string& value, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0); /** * Get the parameter name for a matrix type (where the user has to pass the file @@ -40,7 +40,7 @@ template std::string GetPrintableParamValue( util::ParamData& data, const std::string& value, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0); /** * Get the parameter name for a serializable model type (where the user has to @@ -50,8 +50,8 @@ template std::string GetPrintableParamValue( util::ParamData& data, const std::string& value, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0); /** * Get the parameter name for a mapped matrix type (where the user has to pass @@ -61,8 +61,8 @@ template std::string GetPrintableParamValue( util::ParamData& data, const std::string& value, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t>>* = 0); /** * Get the parameter's name as seen by the user. @@ -74,7 +74,7 @@ void GetPrintableParamValue( void* output) { *((std::string*) output) = - GetPrintableParamValue::type>(d, + GetPrintableParamValue>(d, *((std::string*) input)); } diff --git a/src/mlpack/bindings/cli/get_printable_param_value_impl.hpp b/src/mlpack/bindings/cli/get_printable_param_value_impl.hpp index 3bb42b01b1..96785cc5d8 100644 --- a/src/mlpack/bindings/cli/get_printable_param_value_impl.hpp +++ b/src/mlpack/bindings/cli/get_printable_param_value_impl.hpp @@ -28,10 +28,10 @@ template std::string GetPrintableParamValue( util::ParamData& /* data */, const std::string& input, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { return input; } @@ -44,7 +44,7 @@ template std::string GetPrintableParamValue( util::ParamData& /* data */, const std::string& input, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*) { return input + ".csv"; } @@ -57,8 +57,8 @@ template std::string GetPrintableParamValue( util::ParamData& /* data */, const std::string& input, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*) { return input + ".bin"; } @@ -71,8 +71,8 @@ template std::string GetPrintableParamValue( util::ParamData& /* data */, const std::string& input, - const typename std::enable_if>::value>::type*) + const std::enable_if_t>>*) { return input + ".arff"; } diff --git a/src/mlpack/bindings/cli/get_printable_type.hpp b/src/mlpack/bindings/cli/get_printable_type.hpp index 07fd10609a..328e8f1055 100644 --- a/src/mlpack/bindings/cli/get_printable_type.hpp +++ b/src/mlpack/bindings/cli/get_printable_type.hpp @@ -23,11 +23,11 @@ namespace cli { template std::string GetPrintableType( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0); /** * Return a string representing the command-line type of a vector. @@ -35,7 +35,7 @@ std::string GetPrintableType( template std::string GetPrintableType( util::ParamData& data, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0); /** * Return a string representing the command-line type of a matrix option. @@ -43,7 +43,7 @@ std::string GetPrintableType( template std::string GetPrintableType( util::ParamData& data, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0); /** * Return a string representing the command-line type of a matrix tuple option. @@ -51,8 +51,8 @@ std::string GetPrintableType( template std::string GetPrintableType( util::ParamData& data, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t>>* = 0); /** * Return a string representing the command-line type of a model. @@ -60,8 +60,8 @@ std::string GetPrintableType( template std::string GetPrintableType( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0); /** * Print the command-line type of an option into a string. @@ -72,7 +72,7 @@ void GetPrintableType(util::ParamData& data, void* output) { *((std::string*) output) = - GetPrintableType::type>(data); + GetPrintableType>(data); } } // namespace cli diff --git a/src/mlpack/bindings/cli/get_printable_type_impl.hpp b/src/mlpack/bindings/cli/get_printable_type_impl.hpp index 14a259b8b6..d3dbbf5050 100644 --- a/src/mlpack/bindings/cli/get_printable_type_impl.hpp +++ b/src/mlpack/bindings/cli/get_printable_type_impl.hpp @@ -25,19 +25,19 @@ namespace cli { template std::string GetPrintableType( util::ParamData& data, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { - if (std::is_same::value) + if (std::is_same_v) return "flag"; - else if (std::is_same::value) + else if (std::is_same_v) return "int"; - else if (std::is_same::value) + else if (std::is_same_v) return "double"; - else if (std::is_same::value) + else if (std::is_same_v) return "string"; else throw std::invalid_argument("unknown parameter type" + data.cppType); @@ -49,11 +49,11 @@ std::string GetPrintableType( template std::string GetPrintableType( util::ParamData& data, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*) { - if (std::is_same>::value) + if (std::is_same_v>) return "int vector"; - else if (std::is_same>::value) + else if (std::is_same_v>) return "string vector"; else throw std::invalid_argument("unknown vector type " + data.cppType); @@ -65,19 +65,19 @@ std::string GetPrintableType( template std::string GetPrintableType( util::ParamData& data, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*) { - if (std::is_same::value) + if (std::is_same_v) return "2-d matrix file"; - else if (std::is_same>::value) + else if (std::is_same_v>) return "2-d index matrix file"; - else if (std::is_same::value) + else if (std::is_same_v) return "1-d matrix file"; - else if (std::is_same>::value) + else if (std::is_same_v>) return "1-d index matrix file"; - else if (std::is_same::value) + else if (std::is_same_v) return "1-d matrix file"; - else if (std::is_same>::value) + else if (std::is_same_v>) return "1-d index matrix file"; else throw std::invalid_argument("unknown Armadillo type" + data.cppType); @@ -89,8 +89,8 @@ std::string GetPrintableType( template std::string GetPrintableType( util::ParamData& /* data */, - const typename std::enable_if>::value>::type*) + const std::enable_if_t>>*) { return "2-d categorical matrix file"; } @@ -101,8 +101,8 @@ std::string GetPrintableType( template std::string GetPrintableType( util::ParamData& data, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*) { return data.cppType + " file"; } diff --git a/src/mlpack/bindings/cli/get_raw_param.hpp b/src/mlpack/bindings/cli/get_raw_param.hpp index 0724a542f3..acd2788e79 100644 --- a/src/mlpack/bindings/cli/get_raw_param.hpp +++ b/src/mlpack/bindings/cli/get_raw_param.hpp @@ -27,10 +27,10 @@ namespace cli { template T& GetRawParam( util::ParamData& d, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0) { // No mapping is needed, so just cast it directly. return *std::any_cast(&d.value); @@ -42,10 +42,10 @@ T& GetRawParam( template T& GetRawParam( util::ParamData& d, - const typename std::enable_if< + const std::enable_if_t< arma::is_arma_type::value || - std::is_same>::value>::type* = 0) + std::is_same_v>>* = 0) { // Don't load the matrix. typedef std::tuple> TupleType; @@ -59,8 +59,8 @@ T& GetRawParam( template T*& GetRawParam( util::ParamData& d, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { // Don't load the model. typedef std::tuple TupleType; @@ -82,7 +82,7 @@ void GetRawParam(util::ParamData& d, void* output) { // Cast to the correct type. - *((T**) output) = &GetRawParam::type>( + *((T**) output) = &GetRawParam>( const_cast(d)); } diff --git a/src/mlpack/bindings/cli/in_place_copy.hpp b/src/mlpack/bindings/cli/in_place_copy.hpp index 4ffbb0e03d..861e1e2729 100644 --- a/src/mlpack/bindings/cli/in_place_copy.hpp +++ b/src/mlpack/bindings/cli/in_place_copy.hpp @@ -31,10 +31,10 @@ template void InPlaceCopyInternal( util::ParamData& /* d */, util::ParamData& /* input */, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0) { // Nothing to do. } @@ -50,11 +50,11 @@ template void InPlaceCopyInternal( util::ParamData& d, util::ParamData& input, - const typename std::enable_if< + const std::enable_if_t< arma::is_arma_type::value || - std::is_same>::value - >::type* = 0) + std::is_same_v> + >* = 0) { // Make the output filename the same as the input filename. typedef std::tuple::type> TupleType; @@ -76,8 +76,8 @@ template void InPlaceCopyInternal( util::ParamData& d, util::ParamData& input, - const typename std::enable_if< - data::HasSerialize::value>::type* = 0) + const std::enable_if_t< + data::HasSerialize::value>* = 0) { // Make the output filename the same as the input filename. typedef std::tuple::type> TupleType; @@ -102,7 +102,7 @@ void InPlaceCopy(util::ParamData& d, void* /* output */) { // Cast to the correct type. - InPlaceCopyInternal::type>( + InPlaceCopyInternal>( const_cast(d), *((util::ParamData*) input)); } diff --git a/src/mlpack/bindings/cli/map_parameter_name.hpp b/src/mlpack/bindings/cli/map_parameter_name.hpp index 74f20a6431..a4e9416b83 100644 --- a/src/mlpack/bindings/cli/map_parameter_name.hpp +++ b/src/mlpack/bindings/cli/map_parameter_name.hpp @@ -27,10 +27,10 @@ namespace cli { template std::string MapParameterName( const std::string& identifier, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0) { return identifier; } @@ -43,11 +43,11 @@ std::string MapParameterName( template std::string MapParameterName( const std::string& identifier, - const typename std::enable_if< + const std::enable_if_t< arma::is_arma_type::value || - std::is_same>::value || - data::HasSerialize::value>::type* /* junk */ = 0) + std::is_same_v> || + data::HasSerialize::value>* /* junk */ = 0) { return identifier + "_file"; } @@ -67,7 +67,7 @@ void MapParameterName(util::ParamData& d, // Store the mapped name in the output pointer, which is actually a string // pointer. *((std::string*) output) = - MapParameterName::type>(d.name); + MapParameterName>(d.name); } } // namespace cli diff --git a/src/mlpack/bindings/cli/output_param.hpp b/src/mlpack/bindings/cli/output_param.hpp index bef23ed43e..9fd335caab 100644 --- a/src/mlpack/bindings/cli/output_param.hpp +++ b/src/mlpack/bindings/cli/output_param.hpp @@ -26,11 +26,11 @@ namespace cli { template void OutputParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0); /** * Output a vector option (print to stdout). @@ -38,7 +38,7 @@ void OutputParamImpl( template void OutputParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0); /** * Output a matrix option (this saves it to the given file). @@ -46,7 +46,7 @@ void OutputParamImpl( template void OutputParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0); /** * Output a serializable class option (this saves it to the given file). @@ -54,8 +54,8 @@ void OutputParamImpl( template void OutputParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0); /** * Output a mapped dataset. @@ -63,8 +63,8 @@ void OutputParamImpl( template void OutputParamImpl( util::ParamData& data, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t>>* = 0); /** * Output an option. This is the function that will be called by the IO @@ -75,7 +75,7 @@ void OutputParam(util::ParamData& data, const void* /* input */, void* /* output */) { - OutputParamImpl::type>(data); + OutputParamImpl>(data); } } // namespace cli diff --git a/src/mlpack/bindings/cli/output_param_impl.hpp b/src/mlpack/bindings/cli/output_param_impl.hpp index 1725a2e890..0addc718b8 100644 --- a/src/mlpack/bindings/cli/output_param_impl.hpp +++ b/src/mlpack/bindings/cli/output_param_impl.hpp @@ -24,11 +24,11 @@ namespace cli { template void OutputParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { std::cout << data.name << ": " << *std::any_cast(&data.value) << std::endl; @@ -38,7 +38,7 @@ void OutputParamImpl( template void OutputParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*) { std::cout << data.name << ": "; const T& t = *std::any_cast(&data.value); @@ -51,7 +51,7 @@ void OutputParamImpl( template void OutputParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*) { typedef std::tuple> TupleType; const T& output = std::get<0>(*std::any_cast(&data.value)); @@ -71,8 +71,8 @@ void OutputParamImpl( template void OutputParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*) { // The const cast is necessary here because Serialize() can't ever be marked // const. In this case we can assume it though, since we will be saving and @@ -91,8 +91,8 @@ void OutputParamImpl( template void OutputParamImpl( util::ParamData& data, - const typename std::enable_if>::value>::type* /* junk */) + const std::enable_if_t>>* /* junk */) { // Output the matrix with the mappings. typedef std::tuple> TupleType; diff --git a/src/mlpack/bindings/cli/print_type_doc.hpp b/src/mlpack/bindings/cli/print_type_doc.hpp index 10acab4f5b..52b4e01f6e 100644 --- a/src/mlpack/bindings/cli/print_type_doc.hpp +++ b/src/mlpack/bindings/cli/print_type_doc.hpp @@ -25,11 +25,11 @@ namespace cli { template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0); /** * Return a string representing the command-line type of a vector. @@ -37,7 +37,7 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0); /** * Return a string representing the command-line type of a matrix option. @@ -45,7 +45,7 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0); /** * Return a string representing the command-line type of a matrix tuple option. @@ -53,8 +53,8 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t>>* = 0); /** * Return a string representing the command-line type of a model. @@ -62,8 +62,8 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0); /** * Print the command-line type of an option into a string. @@ -74,7 +74,7 @@ void PrintTypeDoc(util::ParamData& data, void* output) { *((std::string*) output) = - PrintTypeDoc::type>(data); + PrintTypeDoc>(data); } } // namespace cli diff --git a/src/mlpack/bindings/cli/print_type_doc_impl.hpp b/src/mlpack/bindings/cli/print_type_doc_impl.hpp index 1836732bf8..8a95d8666f 100644 --- a/src/mlpack/bindings/cli/print_type_doc_impl.hpp +++ b/src/mlpack/bindings/cli/print_type_doc_impl.hpp @@ -24,30 +24,30 @@ namespace cli { template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { // A flag type. - if (std::is_same::value) + if (std::is_same_v) { return "A boolean flag option. If not specified, it is false; if " "specified, it is true."; } // An integer. - else if (std::is_same::value) + else if (std::is_same_v) { return "An integer (i.e., \"1\")."; } // A floating point value. - else if (std::is_same::value) + else if (std::is_same_v) { return "A floating-point number (i.e., \"0.5\")."; } // A string. - else if (std::is_same::value) + else if (std::is_same_v) { return "A character string (i.e., \"hello\")."; } @@ -64,13 +64,13 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*) { - if (std::is_same>::value) + if (std::is_same_v>) { return "A vector of integers, separated by commas (i.e., \"1,2,3\")."; } - else if (std::is_same>::value) + else if (std::is_same_v>) { return "A vector of strings, separated by commas (i.e., " "\"hello\",\"goodbye\")."; @@ -87,9 +87,9 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*) { - if (std::is_same::value) + if (std::is_same_v) { return "A data matrix filename. The file can be CSV (.csv), TSV (.csv), " "ASCII (space-separated values, .txt), Armadillo ASCII (.txt), PGM " @@ -102,7 +102,7 @@ std::string PrintTypeDoc( "is found, the first row will be loaded as a data point. All values of" " the matrix will be loaded as double-precision floating point data."; } - else if (std::is_same>::value) + else if (std::is_same_v>) { return "A data matrix filename, where the matrix holds only non-negative " "integer values. This type is often used for labels or indices. The " @@ -117,15 +117,15 @@ std::string PrintTypeDoc( " loaded as a data point. All values of the matrix will be loaded as " "unsigned integers."; } - else if (std::is_same::value || - std::is_same::value) + else if (std::is_same_v || + std::is_same_v) { return "A one-dimensional vector filename. This file can take the same " "formats as the data matrix filenames; however, it must either contain " "one row and many columns, or one column and many rows."; } - else if (std::is_same>::value || - std::is_same>::value) + else if (std::is_same_v> || + std::is_same_v>) { return "A one-dimensional vector filename, where the matrix holds only non-" "negative integer values. This type is typically used for labels or " @@ -145,8 +145,8 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& /* data */, - const typename std::enable_if>::value>::type*) + const std::enable_if_t>>*) { return "A filename for a data matrix that can contain categorical " "(non-numeric) data. If the file contains only numeric data, then the " @@ -165,8 +165,8 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& /* data */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*) { return "A filename containing an mlpack model. These can have one of three " "formats: binary (.bin), text (.txt), and XML (.xml). The XML format " diff --git a/src/mlpack/bindings/cli/set_param.hpp b/src/mlpack/bindings/cli/set_param.hpp index df2fb85bcd..6ff35afb80 100644 --- a/src/mlpack/bindings/cli/set_param.hpp +++ b/src/mlpack/bindings/cli/set_param.hpp @@ -27,11 +27,11 @@ template void SetParam( util::ParamData& d, const std::any& value, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0, + const std::enable_if_t>* = 0) { // No mapping is needed. d.value = *std::any_cast(&value); @@ -44,7 +44,7 @@ template void SetParam( util::ParamData& d, const std::any& /* value */, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t>* = 0) { // Force set to the value of whether or not this was passed. d.value = d.wasPassed; @@ -58,9 +58,9 @@ template void SetParam( util::ParamData& d, const std::any& value, - const typename std::enable_if::value || - std::is_same>::value>::type* = 0) + const std::enable_if_t::value || + std::is_same_v>>* = 0) { // We're setting the string filename. typedef std::tuple::type> TupleType; @@ -76,8 +76,8 @@ template void SetParam( util::ParamData& d, const std::any& value, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { // We're setting the string filename. typedef std::tuple::type> TupleType; @@ -96,7 +96,7 @@ void SetParam( template void SetParam(util::ParamData& d, const void* input, void* /* output */) { - SetParam::type>( + SetParam>( const_cast(d), *((std::any*) input)); } diff --git a/src/mlpack/bindings/cli/string_type_param.hpp b/src/mlpack/bindings/cli/string_type_param.hpp index decf9e794d..bd9e2c81ef 100644 --- a/src/mlpack/bindings/cli/string_type_param.hpp +++ b/src/mlpack/bindings/cli/string_type_param.hpp @@ -26,22 +26,22 @@ namespace cli { */ template std::string StringTypeParamImpl( - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0); /** * Return a string containing the type of the parameter, for vector options. */ template std::string StringTypeParamImpl( - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0); /** * Return a string containing the type of the parameter, */ template std::string StringTypeParamImpl( - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0); /** * Return a string containing the type of a parameter. This overload is used if diff --git a/src/mlpack/bindings/cli/string_type_param_impl.hpp b/src/mlpack/bindings/cli/string_type_param_impl.hpp index f0fc89a34c..5bc52703cb 100644 --- a/src/mlpack/bindings/cli/string_type_param_impl.hpp +++ b/src/mlpack/bindings/cli/string_type_param_impl.hpp @@ -23,8 +23,8 @@ namespace cli { */ template std::string StringTypeParamImpl( - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*) { // Don't know what type this is. return "unknown"; @@ -35,7 +35,7 @@ std::string StringTypeParamImpl( */ template std::string StringTypeParamImpl( - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*) { return "vector"; } @@ -45,7 +45,7 @@ std::string StringTypeParamImpl( */ template std::string StringTypeParamImpl( - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*) { return "string"; } diff --git a/src/mlpack/bindings/go/default_param.hpp b/src/mlpack/bindings/go/default_param.hpp index 38c7272a00..9c749759f4 100644 --- a/src/mlpack/bindings/go/default_param.hpp +++ b/src/mlpack/bindings/go/default_param.hpp @@ -26,13 +26,13 @@ namespace go { template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>* = 0, + const std::enable_if_t>>* = 0); /** * Return the default value of a vector option. @@ -40,7 +40,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0); /** * Return the default value of a string option. @@ -48,8 +48,8 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if::value - >::type* = 0); + const std::enable_if_t + >* = 0); /** * Return the default value of a matrix option, a tuple option, a @@ -59,10 +59,10 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if< + const std::enable_if_t< arma::is_arma_type::value || - std::is_same>::value>::type* = 0); + std::is_same_v>>* = 0); /** * Return the default value of a model option (this returns the default @@ -71,8 +71,8 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0); /** * Return the default value of an option. This is the function that will be @@ -84,7 +84,7 @@ void DefaultParam(util::ParamData& data, void* output) { std::string* outstr = (std::string*) output; - *outstr = DefaultParamImpl::type>(data); + *outstr = DefaultParamImpl>(data); } } // namespace go diff --git a/src/mlpack/bindings/go/default_param_impl.hpp b/src/mlpack/bindings/go/default_param_impl.hpp index 12a80f1f2b..a4abee84ea 100644 --- a/src/mlpack/bindings/go/default_param_impl.hpp +++ b/src/mlpack/bindings/go/default_param_impl.hpp @@ -24,16 +24,16 @@ namespace go { template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>*, + const std::enable_if_t>>*) { std::ostringstream oss; - if (std::is_same::value) + if (std::is_same_v) oss << "false"; else oss << std::any_cast(data.value); @@ -47,12 +47,12 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*) { // Print each element in an array delimited by square brackets. std::ostringstream oss; const T& vector = std::any_cast(data.value); - if (std::is_same>::value) + if (std::is_same_v>) { oss << "[]string{"; if (vector.size() > 0) @@ -67,7 +67,7 @@ std::string DefaultParamImpl( oss << "}"; } - else if (std::is_same>::value) + else if (std::is_same_v>) { oss << "[]int{"; if (vector.size() > 0) @@ -91,7 +91,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type*) + const std::enable_if_t>*) { const std::string& s = *std::any_cast(&data.value); return "\"" + s + "\""; @@ -103,23 +103,23 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& /* data */, - const typename std::enable_if< + const std::enable_if_t< arma::is_arma_type::value || - std::is_same>::value>::type* /* junk */) + std::is_same_v>>* /* junk */) { // Get the filename and return it, or return an empty string. - if (std::is_same::value || - std::is_same::value) + if (std::is_same_v || + std::is_same_v) { return "mat.NewDense(1, 1, nil)"; } - else if (std::is_same>::value || - std::is_same>::value) + else if (std::is_same_v> || + std::is_same_v>) { return "mat.NewDense(1, 1, nil)"; } - else if (std::is_same>::value) + else if (std::is_same_v>) { return "mat.NewDense(1, 1, nil)"; } @@ -135,8 +135,8 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& /* data */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*) { return "nil"; } diff --git a/src/mlpack/bindings/go/get_go_type.hpp b/src/mlpack/bindings/go/get_go_type.hpp index 4fc800ecbf..b4db78e753 100644 --- a/src/mlpack/bindings/go/get_go_type.hpp +++ b/src/mlpack/bindings/go/get_go_type.hpp @@ -25,11 +25,11 @@ namespace go { template inline std::string GetGoType( util::ParamData& /* d */, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0) { return "unknown"; } @@ -37,11 +37,11 @@ inline std::string GetGoType( template<> inline std::string GetGoType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { return "int"; } @@ -49,11 +49,11 @@ inline std::string GetGoType( template<> inline std::string GetGoType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { return "float32"; } @@ -61,11 +61,11 @@ inline std::string GetGoType( template<> inline std::string GetGoType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { return "float64"; } @@ -73,14 +73,14 @@ inline std::string GetGoType( template<> inline std::string GetGoType( util::ParamData& /* d */, - const typename std::enable_if< - !util::IsStdVector::value>::type*, - const typename std::enable_if< - !data::HasSerialize::value>::type*, - const typename std::enable_if< - !arma::is_arma_type::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t< + !util::IsStdVector::value>*, + const std::enable_if_t< + !data::HasSerialize::value>*, + const std::enable_if_t< + !arma::is_arma_type::value>*, + const std::enable_if_t>>*) { return "string"; } @@ -88,11 +88,11 @@ inline std::string GetGoType( template<> inline std::string GetGoType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { return "bool"; } @@ -100,7 +100,7 @@ inline std::string GetGoType( template inline std::string GetGoType( util::ParamData& d, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { return "[]" + GetGoType(d); } @@ -108,9 +108,9 @@ inline std::string GetGoType( template inline std::string GetGoType( util::ParamData& /* d */, - const typename std::enable_if>::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t>>* = 0, + const std::enable_if_t::value>* = 0) { return "mat.Dense"; } @@ -118,8 +118,8 @@ inline std::string GetGoType( template inline std::string GetGoType( util::ParamData& /* d */, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t>>* = 0) { return "matrixWithInfo"; } @@ -127,8 +127,8 @@ inline std::string GetGoType( template inline std::string GetGoType( util::ParamData& d, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { std::string goStrippedType, strippedType, printedType, defaultsType; StripType(d.cppType, goStrippedType, strippedType, printedType, defaultsType); diff --git a/src/mlpack/bindings/go/get_printable_param.hpp b/src/mlpack/bindings/go/get_printable_param.hpp index 107e7203c3..057d5c24d6 100644 --- a/src/mlpack/bindings/go/get_printable_param.hpp +++ b/src/mlpack/bindings/go/get_printable_param.hpp @@ -25,11 +25,11 @@ namespace go { template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0) { std::ostringstream oss; oss << std::any_cast(data.value); @@ -42,7 +42,7 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { const T& t = std::any_cast(data.value); @@ -58,7 +58,7 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { // Get the matrix. const T& matrix = std::any_cast(data.value); @@ -74,8 +74,8 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { std::ostringstream oss; oss << data.cppType << " model at " << std::any_cast(data.value); @@ -88,8 +88,8 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t>>* = 0) { // Get the matrix. const T& tuple = std::any_cast(data.value); @@ -116,7 +116,7 @@ void GetPrintableParam(util::ParamData& data, void* output) { *((std::string*) output) = - GetPrintableParam::type>(data); + GetPrintableParam>(data); } } // namespace go diff --git a/src/mlpack/bindings/go/get_printable_type.hpp b/src/mlpack/bindings/go/get_printable_type.hpp index 5b2cadece3..6316b69e3a 100644 --- a/src/mlpack/bindings/go/get_printable_type.hpp +++ b/src/mlpack/bindings/go/get_printable_type.hpp @@ -23,78 +23,78 @@ namespace go { template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0); template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*); + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*); template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*); + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*); template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if< - !util::IsStdVector::value>::type*, - const typename std::enable_if< - !data::HasSerialize::value>::type*, - const typename std::enable_if< - !arma::is_arma_type::value>::type*, - const typename std::enable_if>::value>::type*); + const std::enable_if_t< + !util::IsStdVector::value>*, + const std::enable_if_t< + !data::HasSerialize::value>*, + const std::enable_if_t< + !arma::is_arma_type::value>*, + const std::enable_if_t>>*); template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*); + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*); template inline std::string GetPrintableType( util::ParamData& d, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0); template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0); template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t>>* = 0); template inline std::string GetPrintableType( util::ParamData& d, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0); template void GetPrintableType(util::ParamData& d, @@ -102,7 +102,7 @@ void GetPrintableType(util::ParamData& d, void* output) { *((std::string*) output) = - GetPrintableType::type>(d); + GetPrintableType>(d); } } // namespace go diff --git a/src/mlpack/bindings/go/get_printable_type_impl.hpp b/src/mlpack/bindings/go/get_printable_type_impl.hpp index cdbfe9feb5..0c01ccbe83 100644 --- a/src/mlpack/bindings/go/get_printable_type_impl.hpp +++ b/src/mlpack/bindings/go/get_printable_type_impl.hpp @@ -23,11 +23,11 @@ namespace go { template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { return "unknown"; } @@ -35,11 +35,11 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { return "int"; } @@ -47,11 +47,11 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { return "float64"; } @@ -59,14 +59,14 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if< - !util::IsStdVector::value>::type*, - const typename std::enable_if< - !data::HasSerialize::value>::type*, - const typename std::enable_if< - !arma::is_arma_type::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t< + !util::IsStdVector::value>*, + const std::enable_if_t< + !data::HasSerialize::value>*, + const std::enable_if_t< + !arma::is_arma_type::value>*, + const std::enable_if_t>>*) { return "string"; } @@ -74,11 +74,11 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { return "bool"; } @@ -86,9 +86,9 @@ inline std::string GetPrintableType( template inline std::string GetPrintableType( util::ParamData& d, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { return "array of " + GetPrintableType(d) + "s"; } @@ -96,9 +96,9 @@ inline std::string GetPrintableType( template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { std::string type = "*mat.Dense"; if (T::is_row || T::is_col) @@ -110,8 +110,8 @@ inline std::string GetPrintableType( template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if>::value>::type*) + const std::enable_if_t>>*) { return "matrixWithInfo"; } @@ -119,10 +119,10 @@ inline std::string GetPrintableType( template inline std::string GetPrintableType( util::ParamData& d, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { std::string goStrippedType, strippedType, printedType, defaultsType; StripType(d.cppType, goStrippedType, strippedType, printedType, defaultsType); diff --git a/src/mlpack/bindings/go/get_type.hpp b/src/mlpack/bindings/go/get_type.hpp index 828085d375..ac60755f31 100644 --- a/src/mlpack/bindings/go/get_type.hpp +++ b/src/mlpack/bindings/go/get_type.hpp @@ -24,9 +24,9 @@ namespace go { template inline std::string GetType( util::ParamData& /* d */, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { return "unknown"; } @@ -34,9 +34,9 @@ inline std::string GetType( template<> inline std::string GetType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*) { return "Int"; } @@ -44,9 +44,9 @@ inline std::string GetType( template<> inline std::string GetType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*) { return "Float"; } @@ -54,9 +54,9 @@ inline std::string GetType( template<> inline std::string GetType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*) { return "Double"; } @@ -64,12 +64,12 @@ inline std::string GetType( template<> inline std::string GetType( util::ParamData& /* d */, - const typename std::enable_if< - !util::IsStdVector::value>::type*, - const typename std::enable_if< - !data::HasSerialize::value>::type*, - const typename std::enable_if< - !arma::is_arma_type::value>::type*) + const std::enable_if_t< + !util::IsStdVector::value>*, + const std::enable_if_t< + !data::HasSerialize::value>*, + const std::enable_if_t< + !arma::is_arma_type::value>*) { return "String"; } @@ -77,9 +77,9 @@ inline std::string GetType( template<> inline std::string GetType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*) { return "Bool"; } @@ -87,7 +87,7 @@ inline std::string GetType( template inline std::string GetType( util::ParamData& d, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { return "Vec" + GetType(d); } @@ -95,10 +95,10 @@ inline std::string GetType( template inline std::string GetType( util::ParamData& /* d */, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { std::string type = ""; - if (std::is_same::value) + if (std::is_same_v) { if (T::is_row) type = "Row"; @@ -107,7 +107,7 @@ inline std::string GetType( else type = "Mat"; } - else if (std::is_same::value) + else if (std::is_same_v) { if (T::is_row) type = "Urow"; @@ -123,8 +123,8 @@ inline std::string GetType( template inline std::string GetType( util::ParamData& d, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { return d.cppType + "*"; } @@ -145,7 +145,7 @@ void GetType(util::ParamData& d, void* output) { *((std::string*) output) = - GetType::type>(d); + GetType>(d); } } // namespace go diff --git a/src/mlpack/bindings/go/print_defn_input.hpp b/src/mlpack/bindings/go/print_defn_input.hpp index c51dfa110b..e021b1ec19 100644 --- a/src/mlpack/bindings/go/print_defn_input.hpp +++ b/src/mlpack/bindings/go/print_defn_input.hpp @@ -28,10 +28,10 @@ namespace go { template void PrintDefnInput( util::ParamData& d, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0) { if (d.required) { @@ -46,7 +46,7 @@ void PrintDefnInput( template void PrintDefnInput( util::ParamData& d, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { // param_name *mat.Dense if (d.required) @@ -62,8 +62,8 @@ void PrintDefnInput( template void PrintDefnInput( util::ParamData& d, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t>>* = 0) { // param_name *DataWithInfo if (d.required) @@ -79,8 +79,8 @@ void PrintDefnInput( template void PrintDefnInput( util::ParamData& d, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { // Get the type names we need to use. std::string goStrippedType, strippedType, printedType, defaultsType; @@ -113,7 +113,7 @@ void PrintDefnInput(util::ParamData& d, const void* /* input */, void* /* output */) { - PrintDefnInput::type>(d); + PrintDefnInput>(d); } } // namespace go diff --git a/src/mlpack/bindings/go/print_defn_output.hpp b/src/mlpack/bindings/go/print_defn_output.hpp index b18233d1d0..0207c4ea88 100644 --- a/src/mlpack/bindings/go/print_defn_output.hpp +++ b/src/mlpack/bindings/go/print_defn_output.hpp @@ -27,10 +27,10 @@ namespace go { template void PrintDefnOutput( util::ParamData& d, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0) { std::cout << GetGoType(d); } @@ -41,7 +41,7 @@ void PrintDefnOutput( template void PrintDefnOutput( util::ParamData& d, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { // *mat.Dense std::cout << "*" << GetGoType(d); @@ -53,8 +53,8 @@ void PrintDefnOutput( template void PrintDefnOutput( util::ParamData& d, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t>>* = 0) { // *mat.Dense std::cout << "*" << GetGoType(d); @@ -66,8 +66,8 @@ void PrintDefnOutput( template void PrintDefnOutput( util::ParamData& d, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { // Get the type names we need to use. std::string goStrippedType, strippedType, printedType, defaultsType; @@ -94,7 +94,7 @@ void PrintDefnOutput(util::ParamData& d, const void* /* input */, void* /* output */) { - PrintDefnOutput::type>(d); + PrintDefnOutput>(d); } } // namespace go diff --git a/src/mlpack/bindings/go/print_doc.hpp b/src/mlpack/bindings/go/print_doc.hpp index 86f3bbe813..2ba21e0f5c 100644 --- a/src/mlpack/bindings/go/print_doc.hpp +++ b/src/mlpack/bindings/go/print_doc.hpp @@ -45,7 +45,7 @@ void PrintDoc(util::ParamData& d, std::ostringstream oss; oss << " - "; oss << util::CamelCase(d.name, Lower) << " ("; - oss << GetGoType::type>(d) << "): " + oss << GetGoType>(d) << "): " << d.desc; // Print a default, if possible. diff --git a/src/mlpack/bindings/go/print_input_processing.hpp b/src/mlpack/bindings/go/print_input_processing.hpp index f46936ea3e..c64e5ed4e2 100644 --- a/src/mlpack/bindings/go/print_input_processing.hpp +++ b/src/mlpack/bindings/go/print_input_processing.hpp @@ -29,15 +29,15 @@ template void PrintInputProcessing( util::ParamData& d, const size_t indent, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0) { const std::string prefix(indent, ' '); std::string def = "nil"; - if (std::is_same::value) + if (std::is_same_v) def = "false"; // Capitalize the first letter of parameter name so it is @@ -131,7 +131,7 @@ template void PrintInputProcessing( util::ParamData& d, const size_t indent, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { const std::string prefix(indent, ' '); @@ -206,8 +206,8 @@ template void PrintInputProcessing( util::ParamData& d, const size_t indent, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t>>* = 0) { const std::string prefix(indent, ' '); @@ -268,8 +268,8 @@ template void PrintInputProcessing( util::ParamData& d, const size_t indent, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { // First, get the correct classparamName if needed. std::string goStrippedType, strippedType, printedType, defaultsType; @@ -340,7 +340,7 @@ void PrintInputProcessing(util::ParamData& d, const void* input, void* /* output */) { - PrintInputProcessing::type>(d, + PrintInputProcessing>(d, *((size_t*) input)); } diff --git a/src/mlpack/bindings/go/print_method_config.hpp b/src/mlpack/bindings/go/print_method_config.hpp index 6a51d7205d..5d6d1d5fd6 100644 --- a/src/mlpack/bindings/go/print_method_config.hpp +++ b/src/mlpack/bindings/go/print_method_config.hpp @@ -29,15 +29,15 @@ template void PrintMethodConfig( util::ParamData& d, const size_t indent, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0) { const std::string prefix(indent, ' '); std::string def = "nil"; - if (std::is_same::value) + if (std::is_same_v) def = "false"; // Capitalize the first letter of parameter name so it is @@ -64,12 +64,12 @@ template void PrintMethodConfig( util::ParamData& d, const size_t indent, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { const std::string prefix(indent, ' '); std::string def = "nil"; - if (std::is_same::value) + if (std::is_same_v) def = "false"; // Capitalize the first letter of parameter name so it is @@ -96,13 +96,13 @@ template void PrintMethodConfig( util::ParamData& d, const size_t indent, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t>>* = 0) { const std::string prefix(indent, ' '); std::string def = "nil"; - if (std::is_same::value) + if (std::is_same_v) def = "false"; // Capitalize the first letter of parameter name so it is @@ -129,13 +129,13 @@ template void PrintMethodConfig( util::ParamData& d, const size_t indent, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { const std::string prefix(indent, ' '); std::string def = "nil"; - if (std::is_same::value) + if (std::is_same_v) def = "false"; // Capitalize the first letter of parameter name so it is @@ -171,7 +171,7 @@ void PrintMethodConfig(util::ParamData& d, const void* input, void* /* output */) { - PrintMethodConfig::type>(d, + PrintMethodConfig>(d, *((size_t*) input)); } diff --git a/src/mlpack/bindings/go/print_method_init.hpp b/src/mlpack/bindings/go/print_method_init.hpp index ef766f2536..6448874dee 100644 --- a/src/mlpack/bindings/go/print_method_init.hpp +++ b/src/mlpack/bindings/go/print_method_init.hpp @@ -29,15 +29,15 @@ template void PrintMethodInit( util::ParamData& d, const size_t indent, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0) { const std::string prefix(indent, ' '); std::string def = "nil"; - if (std::is_same::value) + if (std::is_same_v) def = "false"; // Capitalize the first letter of parameter name so it is @@ -86,12 +86,12 @@ template void PrintMethodInit( util::ParamData& d, const size_t indent, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { const std::string prefix(indent, ' '); std::string def = "nil"; - if (std::is_same::value) + if (std::is_same_v) def = "false"; // Capitalize the first letter of parameter name so it is @@ -118,13 +118,13 @@ template void PrintMethodInit( util::ParamData& d, const size_t indent, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t>>* = 0) { const std::string prefix(indent, ' '); std::string def = "nil"; - if (std::is_same::value) + if (std::is_same_v) def = "false"; // Capitalize the first letter of parameter name so it is @@ -151,13 +151,13 @@ template void PrintMethodInit( util::ParamData& d, const size_t indent, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { const std::string prefix(indent, ' '); std::string def = "nil"; - if (std::is_same::value) + if (std::is_same_v) def = "false"; // Capitalize the first letter of parameter name so it is @@ -193,7 +193,7 @@ void PrintMethodInit(util::ParamData& d, const void* input, void* /* output */) { - PrintMethodInit::type>(d, + PrintMethodInit>(d, *((size_t*) input)); } diff --git a/src/mlpack/bindings/go/print_output_processing.hpp b/src/mlpack/bindings/go/print_output_processing.hpp index 563b45125f..90dcdd7b4a 100644 --- a/src/mlpack/bindings/go/print_output_processing.hpp +++ b/src/mlpack/bindings/go/print_output_processing.hpp @@ -29,10 +29,10 @@ template void PrintOutputProcessing( util::ParamData& d, const size_t indent, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0) { const std::string prefix(indent, ' '); @@ -56,9 +56,9 @@ template void PrintOutputProcessing( util::ParamData& d, const size_t indent, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0) { const std::string prefix(indent, ' '); @@ -84,8 +84,8 @@ template void PrintOutputProcessing( util::ParamData& d, const size_t indent, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t>>* = 0) { const std::string prefix(indent, ' '); @@ -111,8 +111,8 @@ template void PrintOutputProcessing( util::ParamData& d, const size_t indent, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { // Get the type names we need to use. std::string goStrippedType, strippedType, printedType, defaultsType; @@ -144,7 +144,7 @@ void PrintOutputProcessing(util::ParamData& d, const void* /*input*/, void* /* output */) { - PrintOutputProcessing::type>(d, 2); + PrintOutputProcessing>(d, 2); } } // namespace go diff --git a/src/mlpack/bindings/go/print_type_doc.hpp b/src/mlpack/bindings/go/print_type_doc.hpp index b5dde90fa0..f8550dc9e5 100644 --- a/src/mlpack/bindings/go/print_type_doc.hpp +++ b/src/mlpack/bindings/go/print_type_doc.hpp @@ -25,11 +25,11 @@ namespace go { template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0); /** * Return a string representing the command-line type of a vector. @@ -37,7 +37,7 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0); /** * Return a string representing the command-line type of a matrix option. @@ -45,7 +45,7 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0); /** * Return a string representing the command-line type of a matrix tuple option. @@ -53,8 +53,8 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t>>* = 0); /** * Return a string representing the command-line type of a model. @@ -62,8 +62,8 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0); /** * Print the command-line type of an option into a string. @@ -74,7 +74,7 @@ void PrintTypeDoc(util::ParamData& data, void* output) { *((std::string*) output) = - PrintTypeDoc::type>(data); + PrintTypeDoc>(data); } } // namespace go diff --git a/src/mlpack/bindings/go/print_type_doc_impl.hpp b/src/mlpack/bindings/go/print_type_doc_impl.hpp index 568ef9b059..d97667503c 100644 --- a/src/mlpack/bindings/go/print_type_doc_impl.hpp +++ b/src/mlpack/bindings/go/print_type_doc_impl.hpp @@ -24,29 +24,29 @@ namespace go { template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { // A flag type. - if (std::is_same::value) + if (std::is_same_v) { return "A boolean flag option (`true` or `false`)."; } // An integer. - else if (std::is_same::value) + else if (std::is_same_v) { return "An integer (i.e., `1`)."; } // A floating point value. - else if (std::is_same::value) + else if (std::is_same_v) { return "A floating-point number (i.e., `0.5`)."; } // A string. - else if (std::is_same::value) + else if (std::is_same_v) { return "A character string (i.e., `\"hello\"`)."; } @@ -63,13 +63,13 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*) { - if (std::is_same>::value) + if (std::is_same_v>) { return "An array of integers; i.e., `[]int{0, 1, 2}`."; } - else if (std::is_same>::value) + else if (std::is_same_v>) { return "An array of strings; i.e., `[]string{\"hello\", \"goodbye\"}`."; } @@ -85,7 +85,7 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& /* data */, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*) { if (T::is_col || T::is_row) { @@ -105,8 +105,8 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& /* data */, - const typename std::enable_if>::value>::type*) + const std::enable_if_t>>*) { return "A Tuple(matrixWithInfo) containing `float64` data (Data) along with a" " boolean array (Categoricals) indicating which dimensions are categorical" @@ -122,8 +122,8 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& /* data */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*) { return "An mlpack model pointer. This type holds a pointer to C++ memory " "containing the mlpack model. Note that this means the mlpack model " diff --git a/src/mlpack/bindings/julia/default_param.hpp b/src/mlpack/bindings/julia/default_param.hpp index b466d0135a..d6a96c2237 100644 --- a/src/mlpack/bindings/julia/default_param.hpp +++ b/src/mlpack/bindings/julia/default_param.hpp @@ -26,13 +26,13 @@ namespace julia { template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>* = 0, + const std::enable_if_t>>* = 0); /** * Return the default value of a vector option. @@ -40,7 +40,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0); /** * Return the default value of a string option. @@ -48,8 +48,8 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if::value - >::type* = 0); + const std::enable_if_t + >* = 0); /** * Return the default value of a matrix option, a tuple option, a @@ -59,10 +59,10 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if< + const std::enable_if_t< arma::is_arma_type::value || - std::is_same>::value>::type* = 0); + std::is_same_v>>* = 0); /** * Return the default value of a model option (this returns the default @@ -71,8 +71,8 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0); /** * Return the default value of an option. This is the function that will be @@ -84,7 +84,7 @@ void DefaultParam(util::ParamData& data, void* output) { std::string* outstr = (std::string*) output; - *outstr = DefaultParamImpl::type>(data); + *outstr = DefaultParamImpl>(data); } } // namespace julia diff --git a/src/mlpack/bindings/julia/default_param_impl.hpp b/src/mlpack/bindings/julia/default_param_impl.hpp index 94224814c4..9812a1990f 100644 --- a/src/mlpack/bindings/julia/default_param_impl.hpp +++ b/src/mlpack/bindings/julia/default_param_impl.hpp @@ -24,16 +24,16 @@ namespace julia { template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>*, + const std::enable_if_t>>*) { std::ostringstream oss; - if (std::is_same::value) + if (std::is_same_v) oss << "false"; else oss << std::any_cast(data.value); @@ -47,13 +47,13 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*) { // Print each element in an array delimited by square brackets. std::ostringstream oss; const T& vector = std::any_cast(data.value); oss << "["; - if (std::is_same>::value) + if (std::is_same_v>) { if (vector.size() > 0) { @@ -90,7 +90,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type*) + const std::enable_if_t>*) { const std::string& s = *std::any_cast(&data.value); return "\"" + s + "\""; @@ -103,23 +103,23 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& /* data */, - const typename std::enable_if< + const std::enable_if_t< arma::is_arma_type::value || - std::is_same>::value>::type* /* junk */) + std::is_same_v>>* /* junk */) { // Get the filename and return it, or return an empty string. - if (std::is_same::value || - std::is_same::value) + if (std::is_same_v || + std::is_same_v) { return "Float64[]"; } - else if (std::is_same>::value || - std::is_same>::value) + else if (std::is_same_v> || + std::is_same_v>) { return "Int[]"; } - else if (std::is_same>::value) + else if (std::is_same_v>) { return "zeros(Int, 0, 0)"; } @@ -135,8 +135,8 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& /* data */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*) { return "nothing"; } diff --git a/src/mlpack/bindings/julia/get_julia_type.hpp b/src/mlpack/bindings/julia/get_julia_type.hpp index a3fa2c863a..464934d5e3 100644 --- a/src/mlpack/bindings/julia/get_julia_type.hpp +++ b/src/mlpack/bindings/julia/get_julia_type.hpp @@ -21,11 +21,11 @@ namespace julia { template inline std::string GetJuliaType( util::ParamData& /* d */, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0, + const std::enable_if_t::value>* = 0) { return "unknown_"; // This will cause an error most likely... } @@ -33,11 +33,11 @@ inline std::string GetJuliaType( template<> inline std::string GetJuliaType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*, + const std::enable_if_t::value>*) { return "Bool"; } @@ -45,11 +45,11 @@ inline std::string GetJuliaType( template<> inline std::string GetJuliaType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*, + const std::enable_if_t::value>*) { return "Int"; } @@ -57,11 +57,11 @@ inline std::string GetJuliaType( template<> inline std::string GetJuliaType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*, + const std::enable_if_t::value>*) { return "UInt"; } @@ -69,11 +69,11 @@ inline std::string GetJuliaType( template<> inline std::string GetJuliaType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*, + const std::enable_if_t::value>*) { // I suppose on some systems this may not be 64 bit. return "Float64"; @@ -82,14 +82,14 @@ inline std::string GetJuliaType( template<> inline std::string GetJuliaType( util::ParamData& /* d */, - const typename std::enable_if< - !util::IsStdVector::value>::type*, - const typename std::enable_if< - !arma::is_arma_type::value>::type*, - const typename std::enable_if>::value>::type*, - const typename std::enable_if< - !data::HasSerialize::value>::type*) + const std::enable_if_t< + !util::IsStdVector::value>*, + const std::enable_if_t< + !arma::is_arma_type::value>*, + const std::enable_if_t>>*, + const std::enable_if_t< + !data::HasSerialize::value>*) { return "String"; } @@ -97,10 +97,10 @@ inline std::string GetJuliaType( template inline std::string GetJuliaType( util::ParamData& d, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0, + const std::enable_if_t::value>* = 0) { return "Vector{" + GetJuliaType(d) + "}"; } @@ -108,14 +108,14 @@ inline std::string GetJuliaType( template inline std::string GetJuliaType( util::ParamData& d, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0, + const std::enable_if_t::value>* = 0) { // size_t matrices are special: we want to represent them in Julia as // Array{Int, X} not UInt because Julia displays UInts strangely. - if (std::is_same::value) + if (std::is_same_v) return std::string("Array{Int, ") + (T::is_col || T::is_row ? "1" : "2") + "}"; else @@ -126,8 +126,8 @@ inline std::string GetJuliaType( template inline std::string GetJuliaType( util::ParamData& /* d */, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t>>* = 0) { return "Tuple{Array{Bool, 1}, Array{Float64, 2}}"; } @@ -136,9 +136,9 @@ inline std::string GetJuliaType( template inline std::string GetJuliaType( util::ParamData& d, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { // Serializable types are just held as a pointer to nothing, but they're // wrapped in a struct. diff --git a/src/mlpack/bindings/julia/get_printable_param.hpp b/src/mlpack/bindings/julia/get_printable_param.hpp index 99ef72726d..25783d8910 100644 --- a/src/mlpack/bindings/julia/get_printable_param.hpp +++ b/src/mlpack/bindings/julia/get_printable_param.hpp @@ -25,11 +25,11 @@ namespace julia { template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0) { std::ostringstream oss; oss << std::any_cast(data.value); @@ -42,7 +42,7 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { const T& t = std::any_cast(data.value); @@ -58,7 +58,7 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { // Get the matrix. const T& matrix = std::any_cast(data.value); @@ -74,8 +74,8 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { std::ostringstream oss; oss << data.cppType << " model at " << std::any_cast(data.value); @@ -88,8 +88,8 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t>>* = 0) { // Get the matrix. const T& tuple = std::any_cast(data.value); @@ -116,7 +116,7 @@ void GetPrintableParam(util::ParamData& data, void* output) { *((std::string*) output) = - GetPrintableParam::type>(data); + GetPrintableParam>(data); } } // namespace julia diff --git a/src/mlpack/bindings/julia/get_printable_type.hpp b/src/mlpack/bindings/julia/get_printable_type.hpp index 9fa2a03fec..751928eacc 100644 --- a/src/mlpack/bindings/julia/get_printable_type.hpp +++ b/src/mlpack/bindings/julia/get_printable_type.hpp @@ -23,11 +23,11 @@ namespace julia { template std::string GetPrintableType( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0); /** * Return a string representing the command-line type of a vector. @@ -35,7 +35,7 @@ std::string GetPrintableType( template std::string GetPrintableType( util::ParamData& data, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0); /** * Return a string representing the command-line type of a matrix option. @@ -43,7 +43,7 @@ std::string GetPrintableType( template std::string GetPrintableType( util::ParamData& data, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0); /** * Return a string representing the command-line type of a matrix tuple option. @@ -51,8 +51,8 @@ std::string GetPrintableType( template std::string GetPrintableType( util::ParamData& data, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t>>* = 0); /** * Return a string representing the command-line type of a model. @@ -60,8 +60,8 @@ std::string GetPrintableType( template std::string GetPrintableType( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0); /** * Print the command-line type of an option into a string. @@ -72,7 +72,7 @@ void GetPrintableType(util::ParamData& data, void* output) { *((std::string*) output) = - GetPrintableType::type>(data); + GetPrintableType>(data); } } // namespace julia diff --git a/src/mlpack/bindings/julia/get_printable_type_impl.hpp b/src/mlpack/bindings/julia/get_printable_type_impl.hpp index bbf32869b2..dca8dc981e 100644 --- a/src/mlpack/bindings/julia/get_printable_type_impl.hpp +++ b/src/mlpack/bindings/julia/get_printable_type_impl.hpp @@ -26,19 +26,19 @@ namespace julia { template std::string GetPrintableType( util::ParamData& data, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { - if (std::is_same::value) + if (std::is_same_v) return "Bool"; - else if (std::is_same::value) + else if (std::is_same_v) return "Int"; - else if (std::is_same::value) + else if (std::is_same_v) return "Float64"; - else if (std::is_same::value) + else if (std::is_same_v) return "String"; else throw std::invalid_argument("unknown parameter type " + data.cppType); @@ -50,11 +50,11 @@ std::string GetPrintableType( template std::string GetPrintableType( util::ParamData& data, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*) { - if (std::is_same>::value) + if (std::is_same_v>) return "Array{Int, 1}"; - else if (std::is_same>::value) + else if (std::is_same_v>) return "Array{String, 1}"; else throw std::invalid_argument("unknown vector type " + data.cppType); @@ -66,19 +66,19 @@ std::string GetPrintableType( template std::string GetPrintableType( util::ParamData& data, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*) { - if (std::is_same::value) + if (std::is_same_v) return "Float64 matrix-like"; - else if (std::is_same>::value) + else if (std::is_same_v>) return "Int matrix-like"; - else if (std::is_same::value) + else if (std::is_same_v) return "Float64 vector-like"; - else if (std::is_same>::value) + else if (std::is_same_v>) return "Int vector-like"; - else if (std::is_same::value) + else if (std::is_same_v) return "Float64 vector-like"; - else if (std::is_same>::value) + else if (std::is_same_v>) return "Int vector-like"; else throw std::invalid_argument("unknown Armadillo type " + data.cppType); @@ -90,8 +90,8 @@ std::string GetPrintableType( template std::string GetPrintableType( util::ParamData& /* data */, - const typename std::enable_if>::value>::type*) + const std::enable_if_t>>*) { return "Tuple{Array{Bool, 1}, Array{Float64, 2}}"; } @@ -102,8 +102,8 @@ std::string GetPrintableType( template std::string GetPrintableType( util::ParamData& data, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*) { std::string type = util::StripType(data.cppType); if (type == "mlpackModel") diff --git a/src/mlpack/bindings/julia/print_input_param.hpp b/src/mlpack/bindings/julia/print_input_param.hpp index 9091747b49..e46d3bf42b 100644 --- a/src/mlpack/bindings/julia/print_input_param.hpp +++ b/src/mlpack/bindings/julia/print_input_param.hpp @@ -39,12 +39,12 @@ void PrintInputParam(util::ParamData& d, // If it's required, then we need the type. if (d.required) { - std::cout << GetJuliaType::type>(d); + std::cout << GetJuliaType>(d); } else { std::cout << "Union{" - << GetJuliaType::type>(d) + << GetJuliaType>(d) << ", Missing} = missing"; } } diff --git a/src/mlpack/bindings/julia/print_input_processing.hpp b/src/mlpack/bindings/julia/print_input_processing.hpp index cd19359fd3..d6339c3016 100644 --- a/src/mlpack/bindings/julia/print_input_processing.hpp +++ b/src/mlpack/bindings/julia/print_input_processing.hpp @@ -24,10 +24,10 @@ template void PrintInputProcessing( util::ParamData& d, const std::string& functionName, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0); /** * Print the input processing for an Armadillo type. @@ -36,9 +36,9 @@ template void PrintInputProcessing( util::ParamData& d, const std::string& functionName, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0); /** * Print the input processing for a serializable type. @@ -47,10 +47,10 @@ template void PrintInputProcessing( util::ParamData& d, const std::string& functionName, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0); /** * Print the input processing (basically calling params.Get<>()) for a @@ -60,8 +60,8 @@ template void PrintInputProcessing( util::ParamData& d, const std::string& functionName, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t>>* = 0); /** * Print the input processing (basically calling params.Get<>()) for a type. @@ -72,7 +72,7 @@ void PrintInputProcessing(util::ParamData& d, void* /* output */) { // Call out to the right overload. - PrintInputProcessing::type>(d, + PrintInputProcessing>(d, *((std::string*) input)); } diff --git a/src/mlpack/bindings/julia/print_input_processing_impl.hpp b/src/mlpack/bindings/julia/print_input_processing_impl.hpp index ec9299b540..e6078fb905 100644 --- a/src/mlpack/bindings/julia/print_input_processing_impl.hpp +++ b/src/mlpack/bindings/julia/print_input_processing_impl.hpp @@ -27,10 +27,10 @@ template void PrintInputProcessing( util::ParamData& d, const std::string& /* functionName */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { // "type" is a reserved keyword or function. const std::string juliaName = (d.name == "type") ? "type_" : d.name; @@ -66,9 +66,9 @@ template void PrintInputProcessing( util::ParamData& d, const std::string& /* functionName */, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { // "type" is a reserved keyword or function. const std::string juliaName = (d.name == "type") ? "type_" : d.name; @@ -83,7 +83,7 @@ void PrintInputProcessing( // For an Armadillo type, we have to call a different overload for columns and // rows than for regular matrices. - std::string uChar = (std::is_same::value) ? + std::string uChar = (std::is_same_v) ? "U" : ""; std::string indent(extraIndent + 2, ' '); std::string matTypeModifier = ""; @@ -125,10 +125,10 @@ template void PrintInputProcessing( util::ParamData& d, const std::string& functionName, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { // "type" is a reserved keyword or function. const std::string juliaName = (d.name == "type") ? "type_" : d.name; @@ -151,11 +151,11 @@ void PrintInputProcessing( std::string indent(extraIndent + 2, ' '); std::string type = util::StripType(d.cppType); std::cout << indent << "push!(modelPtrs, convert(" - << GetJuliaType::type>(d) << ", " + << GetJuliaType>(d) << ", " << juliaName << ").ptr)" << std::endl; std::cout << indent << functionName << "_internal.SetParam" << type << "(p, \"" << d.name << "\", convert(" - << GetJuliaType::type>(d) << ", " + << GetJuliaType>(d) << ", " << juliaName << "))" << std::endl; if (!d.required) @@ -172,8 +172,8 @@ template void PrintInputProcessing( util::ParamData& d, const std::string& /* functionName */, - const typename std::enable_if>::value>::type*) + const std::enable_if_t>>*) { // "type" is a reserved keyword or function. const std::string juliaName = (d.name == "type") ? "type_" : d.name; diff --git a/src/mlpack/bindings/julia/print_model_type_import.hpp b/src/mlpack/bindings/julia/print_model_type_import.hpp index 8b10454750..9630fb05f5 100644 --- a/src/mlpack/bindings/julia/print_model_type_import.hpp +++ b/src/mlpack/bindings/julia/print_model_type_import.hpp @@ -25,8 +25,8 @@ namespace julia { template void PrintModelTypeImport( util::ParamData& /* d */, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { // Do nothing. } @@ -37,7 +37,7 @@ void PrintModelTypeImport( template void PrintModelTypeImport( util::ParamData& /* d */, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { // Do nothing. } @@ -48,8 +48,8 @@ void PrintModelTypeImport( template void PrintModelTypeImport( util::ParamData& d, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { // We need to print, e.g., // import .. @@ -67,7 +67,7 @@ void PrintModelTypeImport(util::ParamData& d, const void* /* input */, void* /* output */) { - PrintModelTypeImport::type>(d); + PrintModelTypeImport>(d); } } // namespace julia diff --git a/src/mlpack/bindings/julia/print_output_processing.hpp b/src/mlpack/bindings/julia/print_output_processing.hpp index e4f72ede36..c44184e8c2 100644 --- a/src/mlpack/bindings/julia/print_output_processing.hpp +++ b/src/mlpack/bindings/julia/print_output_processing.hpp @@ -26,10 +26,10 @@ template void PrintOutputProcessing( util::ParamData& d, const std::string& functionName, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0); /** * Print the output processing for an Armadillo type. @@ -38,9 +38,9 @@ template void PrintOutputProcessing( util::ParamData& d, const std::string& functionName, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0); /** * Print the output processing for a serializable type. @@ -49,10 +49,10 @@ template void PrintOutputProcessing( util::ParamData& d, const std::string& functionName, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0); /** * Print the output processing for a mat/DatasetInfo tuple type. @@ -61,8 +61,8 @@ template void PrintOutputProcessing( util::ParamData& d, const std::string& functionName, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t>>* = 0); /** * Print the output processing (basically calling params.Get<>()) for a type. @@ -73,7 +73,7 @@ void PrintOutputProcessing(util::ParamData& d, void* /* output */) { // Call out to the right overload. - PrintOutputProcessing::type>(d, + PrintOutputProcessing>(d, *((std::string*) input)); } diff --git a/src/mlpack/bindings/julia/print_output_processing_impl.hpp b/src/mlpack/bindings/julia/print_output_processing_impl.hpp index b3de0f688a..6bfa6e10af 100644 --- a/src/mlpack/bindings/julia/print_output_processing_impl.hpp +++ b/src/mlpack/bindings/julia/print_output_processing_impl.hpp @@ -29,34 +29,34 @@ template void PrintOutputProcessing( util::ParamData& d, const std::string& /* functionName */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { std::string type; - if (std::is_same::value) + if (std::is_same_v) type = "Bool"; - else if (std::is_same::value) + else if (std::is_same_v) type = "Int"; - else if (std::is_same::value) + else if (std::is_same_v) type = "Double"; - else if (std::is_same::value) + else if (std::is_same_v) type = "String"; - else if (std::is_same>::value) + else if (std::is_same_v>) type = "VectorStr"; - else if (std::is_same>::value) + else if (std::is_same_v>) type = "VectorInt"; else type = "Unknown"; // Strings need a little special handling. - if (std::is_same::value) + if (std::is_same_v) std::cout << "Base.unsafe_string("; std::cout << "GetParam" << type << "(p, \"" << d.name << "\")"; - if (std::is_same::value) + if (std::is_same_v) std::cout << ")"; } @@ -67,11 +67,11 @@ template void PrintOutputProcessing( util::ParamData& d, const std::string& /* functionName */, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { - std::string uChar = (std::is_same::value) ? + std::string uChar = (std::is_same_v) ? "U" : ""; std::string matTypeSuffix = ""; std::string extra = ""; @@ -100,10 +100,10 @@ template void PrintOutputProcessing( util::ParamData& d, const std::string& functionName, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { std::string type = util::StripType(d.cppType); std::cout << functionName << "_internal.GetParam" @@ -117,8 +117,8 @@ template void PrintOutputProcessing( util::ParamData& d, const std::string& /* functionName */, - const typename std::enable_if>::value>::type*) + const std::enable_if_t>>*) { std::cout << "GetParamMatWithInfo(p, \"" << d.name << "\", juliaOwnedMemory)"; } diff --git a/src/mlpack/bindings/julia/print_param_defn.hpp b/src/mlpack/bindings/julia/print_param_defn.hpp index df862c2aac..7883a4d8ff 100644 --- a/src/mlpack/bindings/julia/print_param_defn.hpp +++ b/src/mlpack/bindings/julia/print_param_defn.hpp @@ -26,8 +26,8 @@ template void PrintParamDefn( util::ParamData& /* d */, const std::string& /* programName */, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { // Do nothing. } @@ -39,7 +39,7 @@ template void PrintParamDefn( util::ParamData& /* d */, const std::string& /* programName */, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { // Do nothing. } @@ -51,8 +51,8 @@ template void PrintParamDefn( util::ParamData& d, const std::string& programName, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { // We need to print something of the form below: // @@ -171,7 +171,7 @@ void PrintParamDefn(util::ParamData& d, const void* input, void* /* output */) { - PrintParamDefn::type>(d, + PrintParamDefn>(d, *(std::string*) input); } diff --git a/src/mlpack/bindings/julia/print_type_doc.hpp b/src/mlpack/bindings/julia/print_type_doc.hpp index eabda5a067..a007ac88d8 100644 --- a/src/mlpack/bindings/julia/print_type_doc.hpp +++ b/src/mlpack/bindings/julia/print_type_doc.hpp @@ -25,11 +25,11 @@ namespace julia { template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0); /** * Return a string representing the command-line type of a vector. @@ -37,7 +37,7 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0); /** * Return a string representing the command-line type of a matrix option. @@ -45,7 +45,7 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0); /** * Return a string representing the command-line type of a matrix tuple option. @@ -53,8 +53,8 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t>>* = 0); /** * Return a string representing the command-line type of a model. @@ -62,8 +62,8 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0); /** * Print the command-line type of an option into a string. @@ -74,7 +74,7 @@ void PrintTypeDoc(util::ParamData& data, void* output) { *((std::string*) output) = - PrintTypeDoc::type>(data); + PrintTypeDoc>(data); } } // namespace julia diff --git a/src/mlpack/bindings/julia/print_type_doc_impl.hpp b/src/mlpack/bindings/julia/print_type_doc_impl.hpp index 378147f13c..1f1a5eb971 100644 --- a/src/mlpack/bindings/julia/print_type_doc_impl.hpp +++ b/src/mlpack/bindings/julia/print_type_doc_impl.hpp @@ -24,29 +24,29 @@ namespace julia { template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { // A flag type. - if (std::is_same::value) + if (std::is_same_v) { return "A boolean flag option (`true` or `false`)."; } // An integer. - else if (std::is_same::value) + else if (std::is_same_v) { return "An integer (i.e., `1`)."; } // A floating point value. - else if (std::is_same::value) + else if (std::is_same_v) { return "A floating-point number (i.e., `0.5`)."; } // A string. - else if (std::is_same::value) + else if (std::is_same_v) { return "A character string (i.e., `\"hello\"`)."; } @@ -63,13 +63,13 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*) { - if (std::is_same>::value) + if (std::is_same_v>) { return "A vector of integers; i.e., `[0, 1, 2]`."; } - else if (std::is_same>::value) + else if (std::is_same_v>) { return "A vector of strings; i.e., `[\"hello\", \"goodbye\"]`."; } @@ -85,9 +85,9 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*) { - if (std::is_same::value) + if (std::is_same_v) { if (T::is_col || T::is_row) { @@ -104,7 +104,7 @@ std::string PrintTypeDoc( "`false` when calling mlpack bindings."; } } - else if (std::is_same::value) + else if (std::is_same_v) { if (T::is_col || T::is_row) { @@ -135,8 +135,8 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& /* data */, - const typename std::enable_if>::value>::type*) + const std::enable_if_t>>*) { return "A 2-d array containing `Float64` data along with a boolean array " "indicating which dimensions are categorical (represented by `true`) and " @@ -154,8 +154,8 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& /* data */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*) { return "An mlpack model pointer. `` refers to the type of model that " "is being stored, so, e.g., for `CF()`, the type will be `CFModel`. " diff --git a/src/mlpack/bindings/markdown/default_param.hpp b/src/mlpack/bindings/markdown/default_param.hpp index cf4a175a29..130d89049b 100644 --- a/src/mlpack/bindings/markdown/default_param.hpp +++ b/src/mlpack/bindings/markdown/default_param.hpp @@ -38,27 +38,27 @@ void DefaultParam(util::ParamData& data, if (BindingInfo::Language() == "cli") { *((std::string*) output) = - cli::DefaultParamImpl::type>(data); + cli::DefaultParamImpl>(data); } else if (BindingInfo::Language() == "python") { *((std::string*) output) = - python::DefaultParamImpl::type>(data); + python::DefaultParamImpl>(data); } else if (BindingInfo::Language() == "julia") { *((std::string*) output) = - julia::DefaultParamImpl::type>(data); + julia::DefaultParamImpl>(data); } else if (BindingInfo::Language() == "go") { *((std::string*) output) = - go::DefaultParamImpl::type>(data); + go::DefaultParamImpl>(data); } else if (BindingInfo::Language() == "r") { *((std::string*) output) = - r::DefaultParamImpl::type>(data); + r::DefaultParamImpl>(data); } else { diff --git a/src/mlpack/bindings/markdown/get_printable_param.hpp b/src/mlpack/bindings/markdown/get_printable_param.hpp index 0bc5b37f7c..f2d8d13d22 100644 --- a/src/mlpack/bindings/markdown/get_printable_param.hpp +++ b/src/mlpack/bindings/markdown/get_printable_param.hpp @@ -25,11 +25,11 @@ namespace markdown { template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0) { std::ostringstream oss; oss << std::any_cast(data.value); @@ -42,7 +42,7 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { const T& t = std::any_cast(data.value); @@ -58,7 +58,7 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { // Get the matrix. const T& matrix = std::any_cast(data.value); @@ -74,8 +74,8 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { std::ostringstream oss; oss << data.cppType << " model at " << std::any_cast(data.value); @@ -88,8 +88,8 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t>>* = 0) { // Get the matrix. const T& tuple = std::any_cast(data.value); @@ -116,7 +116,7 @@ void GetPrintableParam(util::ParamData& data, void* output) { *((std::string*) output) = - GetPrintableParam::type>(data); + GetPrintableParam>(data); } } // namespace markdown diff --git a/src/mlpack/bindings/markdown/get_printable_param_name.hpp b/src/mlpack/bindings/markdown/get_printable_param_name.hpp index c222ea10fd..8243b2fcc7 100644 --- a/src/mlpack/bindings/markdown/get_printable_param_name.hpp +++ b/src/mlpack/bindings/markdown/get_printable_param_name.hpp @@ -26,10 +26,10 @@ namespace markdown { template std::string GetPrintableParamName( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0); /** * Get the parameter name for a matrix type (where the user has to pass the file @@ -38,7 +38,7 @@ std::string GetPrintableParamName( template std::string GetPrintableParamName( util::ParamData& data, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0); /** * Get the parameter name for a serializable model type (where the user has to @@ -47,8 +47,8 @@ std::string GetPrintableParamName( template std::string GetPrintableParamName( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0); /** * Get the parameter name for a mapped matrix type (where the user has to pass @@ -57,8 +57,8 @@ std::string GetPrintableParamName( template std::string GetPrintableParamName( util::ParamData& data, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t>>* = 0); /** * Get the parameter's name as seen by the user. @@ -70,7 +70,7 @@ void GetPrintableParamName( void* output) { *((std::string*) output) = - GetPrintableParamName::type>(d); + GetPrintableParamName>(d); } } // namespace markdown diff --git a/src/mlpack/bindings/markdown/get_printable_param_name_impl.hpp b/src/mlpack/bindings/markdown/get_printable_param_name_impl.hpp index b7e9f91fac..41b739692f 100644 --- a/src/mlpack/bindings/markdown/get_printable_param_name_impl.hpp +++ b/src/mlpack/bindings/markdown/get_printable_param_name_impl.hpp @@ -26,10 +26,10 @@ namespace markdown { template std::string GetPrintableParamName( util::ParamData& data, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { return "--" + data.name; } @@ -41,7 +41,7 @@ std::string GetPrintableParamName( template std::string GetPrintableParamName( util::ParamData& data, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*) { return "--" + data.name + "_file"; } @@ -53,8 +53,8 @@ std::string GetPrintableParamName( template std::string GetPrintableParamName( util::ParamData& data, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*) { return "--" + data.name + "_file"; } @@ -66,8 +66,8 @@ std::string GetPrintableParamName( template std::string GetPrintableParamName( util::ParamData& data, - const typename std::enable_if>::value>::type*) + const std::enable_if_t>>*) { return "--" + data.name + "_file"; } diff --git a/src/mlpack/bindings/markdown/get_printable_param_value.hpp b/src/mlpack/bindings/markdown/get_printable_param_value.hpp index a0708fc2af..ddaac3e2d9 100644 --- a/src/mlpack/bindings/markdown/get_printable_param_value.hpp +++ b/src/mlpack/bindings/markdown/get_printable_param_value.hpp @@ -27,10 +27,10 @@ template std::string GetPrintableParamValue( util::ParamData& data, const std::string& value, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0); /** * Get the parameter name for a matrix type (where the user has to pass the file @@ -40,7 +40,7 @@ template std::string GetPrintableParamValue( util::ParamData& data, const std::string& value, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0); /** * Get the parameter name for a serializable model type (where the user has to @@ -50,8 +50,8 @@ template std::string GetPrintableParamValue( util::ParamData& data, const std::string& value, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0); /** * Get the parameter name for a mapped matrix type (where the user has to pass @@ -61,8 +61,8 @@ template std::string GetPrintableParamValue( util::ParamData& data, const std::string& value, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t>>* = 0); /** * Get the parameter's name as seen by the user. @@ -74,7 +74,7 @@ void GetPrintableParamValue( void* output) { *((std::string*) output) = - GetPrintableParamValue::type>(d, + GetPrintableParamValue>(d, *((std::string*) input)); } diff --git a/src/mlpack/bindings/markdown/get_printable_param_value_impl.hpp b/src/mlpack/bindings/markdown/get_printable_param_value_impl.hpp index 0753a7b03e..3c4e6110a6 100644 --- a/src/mlpack/bindings/markdown/get_printable_param_value_impl.hpp +++ b/src/mlpack/bindings/markdown/get_printable_param_value_impl.hpp @@ -28,10 +28,10 @@ template std::string GetPrintableParamValue( util::ParamData& /* data */, const std::string& input, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { return input; } @@ -44,7 +44,7 @@ template std::string GetPrintableParamValue( util::ParamData& /* data */, const std::string& input, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*) { return input + ".csv"; } @@ -57,8 +57,8 @@ template std::string GetPrintableParamValue( util::ParamData& /* data */, const std::string& input, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*) { return input + ".bin"; } @@ -71,8 +71,8 @@ template std::string GetPrintableParamValue( util::ParamData& /* data */, const std::string& input, - const typename std::enable_if>::value>::type*) + const std::enable_if_t>>*) { return input + ".arff"; } diff --git a/src/mlpack/bindings/markdown/get_printable_type.hpp b/src/mlpack/bindings/markdown/get_printable_type.hpp index 2848947b54..b4316b036a 100644 --- a/src/mlpack/bindings/markdown/get_printable_type.hpp +++ b/src/mlpack/bindings/markdown/get_printable_type.hpp @@ -37,27 +37,27 @@ void GetPrintableType(util::ParamData& data, if (BindingInfo::Language() == "cli") { *((std::string*) output) = - cli::GetPrintableType::type>(data); + cli::GetPrintableType>(data); } else if (BindingInfo::Language() == "python") { *((std::string*) output) = - python::GetPrintableType::type>(data); + python::GetPrintableType>(data); } else if (BindingInfo::Language() == "julia") { *((std::string*) output) = - julia::GetPrintableType::type>(data); + julia::GetPrintableType>(data); } else if (BindingInfo::Language() == "go") { *((std::string*) output) = - go::GetPrintableType::type>(data); + go::GetPrintableType>(data); } else if (BindingInfo::Language() == "r") { *((std::string*) output) = - r::GetPrintableType::type>(data); + r::GetPrintableType>(data); } else { diff --git a/src/mlpack/bindings/markdown/is_serializable.hpp b/src/mlpack/bindings/markdown/is_serializable.hpp index fa66d53f08..bd2c738528 100644 --- a/src/mlpack/bindings/markdown/is_serializable.hpp +++ b/src/mlpack/bindings/markdown/is_serializable.hpp @@ -25,7 +25,7 @@ namespace markdown { */ template bool IsSerializable( - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { return false; } @@ -35,8 +35,8 @@ bool IsSerializable( */ template bool IsSerializable( - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { return true; } @@ -49,7 +49,7 @@ void IsSerializable(util::ParamData& /* data */, const void* /* input */, void* output) { - *((bool*) output) = IsSerializable::type>(); + *((bool*) output) = IsSerializable>(); } } // namespace markdown diff --git a/src/mlpack/bindings/markdown/print_type_doc.hpp b/src/mlpack/bindings/markdown/print_type_doc.hpp index 34a1906fa0..0e4f750979 100644 --- a/src/mlpack/bindings/markdown/print_type_doc.hpp +++ b/src/mlpack/bindings/markdown/print_type_doc.hpp @@ -34,23 +34,23 @@ std::string PrintTypeDoc(util::ParamData& data) { if (BindingInfo::Language() == "cli") { - return cli::PrintTypeDoc::type>(data); + return cli::PrintTypeDoc>(data); } else if (BindingInfo::Language() == "python") { - return python::PrintTypeDoc::type>(data); + return python::PrintTypeDoc>(data); } else if (BindingInfo::Language() == "julia") { - return julia::PrintTypeDoc::type>(data); + return julia::PrintTypeDoc>(data); } else if (BindingInfo::Language() == "go") { - return go::PrintTypeDoc::type>(data); + return go::PrintTypeDoc>(data); } else if (BindingInfo::Language() == "r") { - return r::PrintTypeDoc::type>(data); + return r::PrintTypeDoc>(data); } else { diff --git a/src/mlpack/bindings/python/default_param.hpp b/src/mlpack/bindings/python/default_param.hpp index d7d92283d9..2482ed0f75 100644 --- a/src/mlpack/bindings/python/default_param.hpp +++ b/src/mlpack/bindings/python/default_param.hpp @@ -26,13 +26,13 @@ namespace python { template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>* = 0, + const std::enable_if_t>>* = 0); /** * Return the default value of a vector option. @@ -40,7 +40,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0); /** * Return the default value of a string option. @@ -48,8 +48,8 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if::value - >::type* = 0); + const std::enable_if_t + >* = 0); /** * Return the default value of a matrix option, a tuple option, a @@ -59,10 +59,10 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if< + const std::enable_if_t< arma::is_arma_type::value || - std::is_same>::value>::type* = 0); + std::is_same_v>>* = 0); /** * Return the default value of a model option (this returns the default @@ -71,8 +71,8 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0); /** * Return the default value of an option. This is the function that will be @@ -84,7 +84,7 @@ void DefaultParam(util::ParamData& data, void* output) { std::string* outstr = (std::string*) output; - *outstr = DefaultParamImpl::type>(data); + *outstr = DefaultParamImpl>(data); } } // namespace python diff --git a/src/mlpack/bindings/python/default_param_impl.hpp b/src/mlpack/bindings/python/default_param_impl.hpp index 1e1cab95d5..1153574181 100644 --- a/src/mlpack/bindings/python/default_param_impl.hpp +++ b/src/mlpack/bindings/python/default_param_impl.hpp @@ -24,16 +24,16 @@ namespace python { template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>*, + const std::enable_if_t>>*) { std::ostringstream oss; - if (std::is_same::value) + if (std::is_same_v) oss << "False"; else oss << std::any_cast(data.value); @@ -47,13 +47,13 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*) { // Print each element in an array delimited by square brackets. std::ostringstream oss; const T& vector = std::any_cast(data.value); oss << "["; - if (std::is_same>::value) + if (std::is_same_v>) { if (vector.size() > 0) { @@ -90,7 +90,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const typename std::enable_if::value>::type*) + const std::enable_if_t>*) { const std::string& s = *std::any_cast(&data.value); return "'" + s + "'"; @@ -103,23 +103,23 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& /* data */, - const typename std::enable_if< + const std::enable_if_t< arma::is_arma_type::value || - std::is_same>::value>::type* /* junk */) + std::is_same_v>>* /* junk */) { // Get the filename and return it, or return an empty string. - if (std::is_same::value || - std::is_same::value) + if (std::is_same_v || + std::is_same_v) { return "np.empty([0])"; } - else if (std::is_same>::value || - std::is_same>::value) + else if (std::is_same_v> || + std::is_same_v>) { return "np.empty([0], dtype=np.uint64)"; } - else if (std::is_same>::value) + else if (std::is_same_v>) { return "np.empty([0, 0], dtype=np.uint64)"; } @@ -135,8 +135,8 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& /* data */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*) { return "None"; } diff --git a/src/mlpack/bindings/python/get_cython_type.hpp b/src/mlpack/bindings/python/get_cython_type.hpp index fd6682832e..a1b12abcda 100644 --- a/src/mlpack/bindings/python/get_cython_type.hpp +++ b/src/mlpack/bindings/python/get_cython_type.hpp @@ -23,9 +23,9 @@ namespace python { template inline std::string GetCythonType( util::ParamData& /* d */, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { return "unknown"; } @@ -33,9 +33,9 @@ inline std::string GetCythonType( template<> inline std::string GetCythonType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*) { return "int"; } @@ -43,9 +43,9 @@ inline std::string GetCythonType( template<> inline std::string GetCythonType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*) { return "double"; } @@ -53,12 +53,12 @@ inline std::string GetCythonType( template<> inline std::string GetCythonType( util::ParamData& /* d */, - const typename std::enable_if< - !util::IsStdVector::value>::type*, - const typename std::enable_if< - !data::HasSerialize::value>::type*, - const typename std::enable_if< - !arma::is_arma_type::value>::type*) + const std::enable_if_t< + !util::IsStdVector::value>*, + const std::enable_if_t< + !data::HasSerialize::value>*, + const std::enable_if_t< + !arma::is_arma_type::value>*) { return "string"; } @@ -66,9 +66,9 @@ inline std::string GetCythonType( template<> inline std::string GetCythonType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*) { return "size_t"; } @@ -76,9 +76,9 @@ inline std::string GetCythonType( template<> inline std::string GetCythonType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*) { return "cbool"; } @@ -86,7 +86,7 @@ inline std::string GetCythonType( template inline std::string GetCythonType( util::ParamData& d, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { return "vector[" + GetCythonType(d) + "]"; } @@ -94,7 +94,7 @@ inline std::string GetCythonType( template inline std::string GetCythonType( util::ParamData& d, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { std::string type = "Mat"; if (T::is_row) @@ -108,8 +108,8 @@ inline std::string GetCythonType( template inline std::string GetCythonType( util::ParamData& d, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { return d.cppType + "*"; } diff --git a/src/mlpack/bindings/python/get_printable_param.hpp b/src/mlpack/bindings/python/get_printable_param.hpp index bfbb386e87..db87a6ae72 100644 --- a/src/mlpack/bindings/python/get_printable_param.hpp +++ b/src/mlpack/bindings/python/get_printable_param.hpp @@ -25,11 +25,11 @@ namespace python { template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0) { std::ostringstream oss; oss << std::any_cast(data.value); @@ -42,7 +42,7 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { const T& t = std::any_cast(data.value); @@ -58,7 +58,7 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { // Get the matrix. const T& matrix = std::any_cast(data.value); @@ -74,8 +74,8 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { std::ostringstream oss; oss << data.cppType << " model at " << std::any_cast(data.value); @@ -88,8 +88,8 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t>>* = 0) { // Get the matrix. const T& tuple = std::any_cast(data.value); @@ -116,7 +116,7 @@ void GetPrintableParam(util::ParamData& data, void* output) { *((std::string*) output) = - GetPrintableParam::type>(data); + GetPrintableParam>(data); } } // namespace python diff --git a/src/mlpack/bindings/python/get_printable_type.hpp b/src/mlpack/bindings/python/get_printable_type.hpp index 1d454b172a..741dd68061 100644 --- a/src/mlpack/bindings/python/get_printable_type.hpp +++ b/src/mlpack/bindings/python/get_printable_type.hpp @@ -23,87 +23,87 @@ namespace python { template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0); template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*); + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*); template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*); + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*); template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if< - !util::IsStdVector::value>::type*, - const typename std::enable_if< - !data::HasSerialize::value>::type*, - const typename std::enable_if< - !arma::is_arma_type::value>::type*, - const typename std::enable_if>::value>::type*); + const std::enable_if_t< + !util::IsStdVector::value>*, + const std::enable_if_t< + !data::HasSerialize::value>*, + const std::enable_if_t< + !arma::is_arma_type::value>*, + const std::enable_if_t>>*); template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*); + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*); template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*); + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*); template inline std::string GetPrintableType( util::ParamData& d, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0); template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0); template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t>>* = 0); template inline std::string GetPrintableType( util::ParamData& d, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0); template void GetPrintableType(util::ParamData& d, @@ -111,7 +111,7 @@ void GetPrintableType(util::ParamData& d, void* output) { *((std::string*) output) = - GetPrintableType::type>(d); + GetPrintableType>(d); } } // namespace python diff --git a/src/mlpack/bindings/python/get_printable_type_impl.hpp b/src/mlpack/bindings/python/get_printable_type_impl.hpp index 5a903af575..fab3255956 100644 --- a/src/mlpack/bindings/python/get_printable_type_impl.hpp +++ b/src/mlpack/bindings/python/get_printable_type_impl.hpp @@ -22,11 +22,11 @@ namespace python { template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { return "unknown"; } @@ -34,11 +34,11 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { return "int"; } @@ -46,11 +46,11 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { return "float"; } @@ -58,14 +58,14 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if< - !util::IsStdVector::value>::type*, - const typename std::enable_if< - !data::HasSerialize::value>::type*, - const typename std::enable_if< - !arma::is_arma_type::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t< + !util::IsStdVector::value>*, + const std::enable_if_t< + !data::HasSerialize::value>*, + const std::enable_if_t< + !arma::is_arma_type::value>*, + const std::enable_if_t>>*) { return "str"; } @@ -73,11 +73,11 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { return "int"; } @@ -85,11 +85,11 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { return "bool"; } @@ -97,9 +97,9 @@ inline std::string GetPrintableType( template inline std::string GetPrintableType( util::ParamData& d, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { return "list of " + GetPrintableType(d) + "s"; } @@ -107,17 +107,17 @@ inline std::string GetPrintableType( template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { std::string type = "matrix"; - if (std::is_same::value) + if (std::is_same_v) { if (T::is_row || T::is_col) type = "vector"; } - else if (std::is_same::value) + else if (std::is_same_v) { type = "int matrix"; if (T::is_row || T::is_col) @@ -130,8 +130,8 @@ inline std::string GetPrintableType( template inline std::string GetPrintableType( util::ParamData& /* d */, - const typename std::enable_if>::value>::type*) + const std::enable_if_t>>*) { return "categorical matrix"; } @@ -139,10 +139,10 @@ inline std::string GetPrintableType( template inline std::string GetPrintableType( util::ParamData& d, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { return d.cppType + "Type"; } diff --git a/src/mlpack/bindings/python/import_decl.hpp b/src/mlpack/bindings/python/import_decl.hpp index e6518ce461..66edbc388f 100644 --- a/src/mlpack/bindings/python/import_decl.hpp +++ b/src/mlpack/bindings/python/import_decl.hpp @@ -26,8 +26,8 @@ template void ImportDecl( util::ParamData& d, const size_t indent, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { // First, we have to parse the type. If we have something like, e.g., // 'LogisticRegression<>', we must convert this to 'LogisticRegression[T=*].' @@ -53,8 +53,8 @@ template void ImportDecl( util::ParamData& /* d */, const size_t /* indent */, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { // Print nothing. } @@ -66,7 +66,7 @@ template void ImportDecl( util::ParamData& /* d */, const size_t /* indent */, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { // Print nothing. } @@ -84,7 +84,7 @@ void ImportDecl(util::ParamData& d, const void* indent, void* /* output */) { - ImportDecl::type>(d, *((size_t*) indent)); + ImportDecl>(d, *((size_t*) indent)); } } // namespace python diff --git a/src/mlpack/bindings/python/is_serializable.hpp b/src/mlpack/bindings/python/is_serializable.hpp index 83197e87f3..0c326dd81c 100644 --- a/src/mlpack/bindings/python/is_serializable.hpp +++ b/src/mlpack/bindings/python/is_serializable.hpp @@ -21,7 +21,7 @@ namespace python { template inline bool IsSerializable( util::ParamData& /* d */, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { return false; } @@ -29,7 +29,7 @@ inline bool IsSerializable( template inline bool IsSerializable( util::ParamData& /* d */, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { return true; } @@ -40,7 +40,7 @@ void IsSerializable(util::ParamData& data, void* output) { *((bool*) output) = - IsSerializable::type>(data); + IsSerializable>(data); } } // namespace python diff --git a/src/mlpack/bindings/python/print_class_defn.hpp b/src/mlpack/bindings/python/print_class_defn.hpp index b3938c4ff1..cd4a0b19a6 100644 --- a/src/mlpack/bindings/python/print_class_defn.hpp +++ b/src/mlpack/bindings/python/print_class_defn.hpp @@ -25,8 +25,8 @@ namespace python { template void PrintClassDefn( util::ParamData& /* d */, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { // Do nothing. } @@ -37,7 +37,7 @@ void PrintClassDefn( template void PrintClassDefn( util::ParamData& /* d */, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { // Do nothing. } @@ -48,8 +48,8 @@ void PrintClassDefn( template void PrintClassDefn( util::ParamData& d, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { // First, we have to parse the type. If we have something like, e.g., // 'LogisticRegression<>', we must convert this to 'LogisticRegression[].' @@ -153,7 +153,7 @@ void PrintClassDefn(util::ParamData& d, const void* /* input */, void* /* output */) { - PrintClassDefn::type>(d); + PrintClassDefn>(d); } } // namespace python diff --git a/src/mlpack/bindings/python/print_defn.hpp b/src/mlpack/bindings/python/print_defn.hpp index 06d1108352..7039510cb5 100644 --- a/src/mlpack/bindings/python/print_defn.hpp +++ b/src/mlpack/bindings/python/print_defn.hpp @@ -32,7 +32,7 @@ void PrintDefn(util::ParamData& d, std::string name = GetValidName(d.name); std::cout << name; - if (std::is_same::value) + if (std::is_same_v) std::cout << "=False"; else if (!d.required) std::cout << "=None"; diff --git a/src/mlpack/bindings/python/print_doc.hpp b/src/mlpack/bindings/python/print_doc.hpp index eaf142b8bc..d9410c3a44 100644 --- a/src/mlpack/bindings/python/print_doc.hpp +++ b/src/mlpack/bindings/python/print_doc.hpp @@ -42,7 +42,7 @@ void PrintDoc(util::ParamData& d, oss << " - "; oss << GetValidName(d.name); oss << " ("; - oss << GetPrintableType::type>(d) << "): " + oss << GetPrintableType>(d) << "): " << d.desc; // Print a default, if possible. diff --git a/src/mlpack/bindings/python/print_input_processing.hpp b/src/mlpack/bindings/python/print_input_processing.hpp index 86c163d489..e20a28503d 100644 --- a/src/mlpack/bindings/python/print_input_processing.hpp +++ b/src/mlpack/bindings/python/print_input_processing.hpp @@ -32,11 +32,11 @@ template void PrintInputProcessing( util::ParamData& d, const size_t indent, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0) { // The copy_all_inputs parameter must be handled first, and therefore is // outside the scope of this code. @@ -46,7 +46,7 @@ void PrintInputProcessing( const std::string prefix(indent, ' '); std::string def = "None"; - if (std::is_same::value) + if (std::is_same_v) def = "False"; // Make sure that we don't use names that are Python keywords. @@ -165,11 +165,11 @@ template void PrintInputProcessing( util::ParamData& d, const size_t indent, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0, + const std::enable_if_t::value>* = 0) { const std::string prefix(indent, ' '); @@ -255,8 +255,8 @@ template void PrintInputProcessing( util::ParamData& d, const size_t indent, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { const std::string prefix(indent, ' '); @@ -383,9 +383,9 @@ template void PrintInputProcessing( util::ParamData& d, const size_t indent, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { // First, get the correct class name if needed. std::string strippedType, printedType, defaultsType; @@ -458,9 +458,9 @@ template void PrintInputProcessing( util::ParamData& d, const size_t indent, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0) { std::string name = GetValidName(d.name); @@ -550,7 +550,7 @@ void PrintInputProcessing(util::ParamData& d, const void* input, void* /* output */) { - PrintInputProcessing::type>(d, + PrintInputProcessing>(d, *((size_t*) input)); } diff --git a/src/mlpack/bindings/python/print_output_processing.hpp b/src/mlpack/bindings/python/print_output_processing.hpp index 8082190013..01a1c13b0d 100644 --- a/src/mlpack/bindings/python/print_output_processing.hpp +++ b/src/mlpack/bindings/python/print_output_processing.hpp @@ -31,10 +31,10 @@ void PrintOutputProcessing( util::ParamData& d, const size_t indent, const bool onlyOutput, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0) { const std::string prefix(indent, ' '); @@ -88,7 +88,7 @@ void PrintOutputProcessing( util::ParamData& d, const size_t indent, const bool onlyOutput, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { const std::string prefix(indent, ' '); @@ -129,8 +129,8 @@ void PrintOutputProcessing( util::ParamData& d, const size_t indent, const bool onlyOutput, - const typename std::enable_if>::value>::type* = 0) + const std::enable_if_t>>* = 0) { const std::string prefix(indent, ' '); @@ -171,8 +171,8 @@ void PrintOutputProcessing( util::ParamData& d, const size_t indent, const bool onlyOutput, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { // Get the type names we need to use. std::string strippedType, printedType, defaultsType; @@ -305,7 +305,7 @@ void PrintOutputProcessing(util::ParamData& d, typedef std::tuple> TupleType; TupleType* tuple = (TupleType*) input; - PrintOutputProcessing::type>( + PrintOutputProcessing>( std::get<0>(*tuple), d, std::get<0>(std::get<1>(*tuple)), std::get<1>(std::get<1>(*tuple))); } diff --git a/src/mlpack/bindings/python/print_type_doc.hpp b/src/mlpack/bindings/python/print_type_doc.hpp index aad90ee4b7..2f4b906b8c 100644 --- a/src/mlpack/bindings/python/print_type_doc.hpp +++ b/src/mlpack/bindings/python/print_type_doc.hpp @@ -25,11 +25,11 @@ namespace python { template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0); /** * Return a string representing the command-line type of a vector. @@ -37,7 +37,7 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0); /** * Return a string representing the command-line type of a matrix option. @@ -45,7 +45,7 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0); /** * Return a string representing the command-line type of a matrix tuple option. @@ -53,8 +53,8 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t>>* = 0); /** * Return a string representing the command-line type of a model. @@ -62,8 +62,8 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0); /** * Print the command-line type of an option into a string. @@ -74,7 +74,7 @@ void PrintTypeDoc(util::ParamData& data, void* output) { *((std::string*) output) = - PrintTypeDoc::type>(data); + PrintTypeDoc>(data); } } // namespace python diff --git a/src/mlpack/bindings/python/print_type_doc_impl.hpp b/src/mlpack/bindings/python/print_type_doc_impl.hpp index 7e50d24e85..fef2c61b95 100644 --- a/src/mlpack/bindings/python/print_type_doc_impl.hpp +++ b/src/mlpack/bindings/python/print_type_doc_impl.hpp @@ -24,29 +24,29 @@ namespace python { template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { // A flag type. - if (std::is_same::value) + if (std::is_same_v) { return "A boolean flag option (True or False)."; } // An integer. - else if (std::is_same::value) + else if (std::is_same_v) { return "An integer (i.e., \"1\")."; } // A floating point value. - else if (std::is_same::value) + else if (std::is_same_v) { return "A floating-point number (i.e., \"0.5\")."; } // A string. - else if (std::is_same::value) + else if (std::is_same_v) { return "A character string (i.e., \"hello\")."; } @@ -63,13 +63,13 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*) { - if (std::is_same>::value) + if (std::is_same_v>) { return "A list of integers; i.e., `[0, 1, 2]`."; } - else if (std::is_same>::value) + else if (std::is_same_v>) { return "A list of strings; i.e., `[\"hello\", \"goodbye\"]`."; } @@ -85,9 +85,9 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& data, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*) { - if (std::is_same::value) + if (std::is_same_v) { if (T::is_col || T::is_row) { @@ -103,7 +103,7 @@ std::string PrintTypeDoc( "float64, it will be converted."; } } - else if (std::is_same::value) + else if (std::is_same_v) { if (T::is_col || T::is_row) { @@ -131,8 +131,8 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& /* data */, - const typename std::enable_if>::value>::type*) + const std::enable_if_t>>*) { return "A 2-d arraylike containing data. Like the regular 2-d matrices, this" " can be a list of lists, a numpy ndarray, or a pandas DataFrame. " @@ -150,8 +150,8 @@ std::string PrintTypeDoc( template std::string PrintTypeDoc( util::ParamData& /* data */, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*) { return "An mlpack model pointer. This type can be pickled to or from disk, " "and internally holds a pointer to C++ memory containing the mlpack " diff --git a/src/mlpack/bindings/tests/delete_allocated_memory.hpp b/src/mlpack/bindings/tests/delete_allocated_memory.hpp index 033a7527a0..e882159b45 100644 --- a/src/mlpack/bindings/tests/delete_allocated_memory.hpp +++ b/src/mlpack/bindings/tests/delete_allocated_memory.hpp @@ -21,8 +21,8 @@ namespace tests { template void DeleteAllocatedMemoryImpl( util::ParamData& /* d */, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { // Do nothing. } @@ -30,7 +30,7 @@ void DeleteAllocatedMemoryImpl( template void DeleteAllocatedMemoryImpl( util::ParamData& d, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { (*std::any_cast(&d.value)).clear(); } @@ -38,8 +38,8 @@ void DeleteAllocatedMemoryImpl( template void DeleteAllocatedMemoryImpl( util::ParamData& d, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { // Delete the allocated memory (hopefully we actually own it). delete *std::any_cast(&d.value); @@ -51,7 +51,7 @@ void DeleteAllocatedMemory( const void* /* input */, void* /* output */) { - DeleteAllocatedMemoryImpl::type>(d); + DeleteAllocatedMemoryImpl>(d); } } // namespace tests diff --git a/src/mlpack/bindings/tests/get_allocated_memory.hpp b/src/mlpack/bindings/tests/get_allocated_memory.hpp index fc936c48d9..dccf4f2a6c 100644 --- a/src/mlpack/bindings/tests/get_allocated_memory.hpp +++ b/src/mlpack/bindings/tests/get_allocated_memory.hpp @@ -22,8 +22,8 @@ namespace tests { template void* GetAllocatedMemory( util::ParamData& /* d */, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { return NULL; } @@ -31,7 +31,7 @@ void* GetAllocatedMemory( template void* GetAllocatedMemory( util::ParamData& d, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0) { return (*std::any_cast(&d.value)).memptr(); } @@ -39,8 +39,8 @@ void* GetAllocatedMemory( template void* GetAllocatedMemory( util::ParamData& d, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0) { // Here we have a model; return its memory location. return *std::any_cast(&d.value); @@ -52,7 +52,7 @@ void GetAllocatedMemory(util::ParamData& d, void* output) { *((void**) output) = - GetAllocatedMemory::type>(d); + GetAllocatedMemory>(d); } } // namespace tests diff --git a/src/mlpack/bindings/tests/get_printable_param.hpp b/src/mlpack/bindings/tests/get_printable_param.hpp index 0bf5e2ff24..c7f12cd08f 100644 --- a/src/mlpack/bindings/tests/get_printable_param.hpp +++ b/src/mlpack/bindings/tests/get_printable_param.hpp @@ -27,11 +27,11 @@ namespace tests { template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t>>* = 0); /** * Print a vector option, with spaces between it. @@ -39,7 +39,7 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0); /** * Print a matrix option (this just prints the filename). @@ -47,7 +47,7 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0); /** * Print a serializable class option (this just prints the filename). @@ -55,8 +55,8 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if::value>::type* = 0, - const typename std::enable_if::value>::type* = 0); + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0); /** * Print a mapped matrix option (this just prints the filename). @@ -64,8 +64,8 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if>::value>::type* = 0); + const std::enable_if_t>>* = 0); /** * Print an option into a std::string. This should print a short, one-line @@ -78,7 +78,7 @@ void GetPrintableParam(util::ParamData& data, void* output) { *((std::string*) output) = - GetPrintableParam::type>(data); + GetPrintableParam>(data); } } // namespace tests diff --git a/src/mlpack/bindings/tests/get_printable_param_impl.hpp b/src/mlpack/bindings/tests/get_printable_param_impl.hpp index c800a0aa7a..5015fffca3 100644 --- a/src/mlpack/bindings/tests/get_printable_param_impl.hpp +++ b/src/mlpack/bindings/tests/get_printable_param_impl.hpp @@ -22,11 +22,11 @@ namespace tests { template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*, - const typename std::enable_if>::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t>>*) { std::ostringstream oss; oss << std::any_cast(data.value); @@ -37,7 +37,7 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*) { const T& t = std::any_cast(data.value); @@ -51,7 +51,7 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& /* data */, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*) { return "matrix type"; } @@ -60,8 +60,8 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const typename std::enable_if::value>::type*, - const typename std::enable_if::value>::type*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*) { // Extract the string from the tuple that's being held. std::ostringstream oss; @@ -73,8 +73,8 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& /* data */, - const typename std::enable_if>::value>::type* /* junk */) + const std::enable_if_t>>* /* junk */) { return "matrix/DatatsetInfo tuple"; } diff --git a/src/mlpack/core/cereal/is_loading.hpp b/src/mlpack/core/cereal/is_loading.hpp index 085358b2f4..3be9d12426 100644 --- a/src/mlpack/core/cereal/is_loading.hpp +++ b/src/mlpack/core/cereal/is_loading.hpp @@ -28,26 +28,26 @@ struct is_cereal_archive { // Archive::is_loading is not implemented yet, so we can use std::is_same<> // to check if it is a loading archive. - constexpr static bool value = std::is_same::value || + constexpr static bool value = std::is_same_v || // #if (BINDING_TYPE != BINDING_TYPE_R) - std::is_same::value || + std::is_same_v || // #endif - std::is_same::value; + std::is_same_v; }; template bool is_loading( - const typename std::enable_if< - is_cereal_archive::value, Archive>::type* = 0) + const std::enable_if_t< + is_cereal_archive::value, Archive>* = 0) { return true; } template bool is_loading( - const typename std::enable_if< - !is_cereal_archive::value, Archive>::type* = 0) + const std::enable_if_t< + !is_cereal_archive::value, Archive>* = 0) { return false; } diff --git a/src/mlpack/core/cereal/is_saving.hpp b/src/mlpack/core/cereal/is_saving.hpp index e54362913f..6a23333a7f 100644 --- a/src/mlpack/core/cereal/is_saving.hpp +++ b/src/mlpack/core/cereal/is_saving.hpp @@ -29,26 +29,26 @@ struct is_cereal_archive_saving { // Archive::is_saving is not implemented yet, so we can use std::is_same<> // to check if it is a loading archive. - constexpr static bool value = std::is_same::value || + constexpr static bool value = std::is_same_v || // #if (BINDING_TYPE != BINDING_TYPE_R) - std::is_same::value || + std::is_same_v || // #endif - std::is_same::value; + std::is_same_v; }; template bool is_saving( - const typename std::enable_if< - is_cereal_archive_saving::value, Archive>::type* = 0) + const std::enable_if_t< + is_cereal_archive_saving::value, Archive>* = 0) { return true; } template bool is_saving( - const typename std::enable_if< - !is_cereal_archive_saving::value, Archive>::type* = 0) + const std::enable_if_t< + !is_cereal_archive_saving::value, Archive>* = 0) { return false; } diff --git a/src/mlpack/core/cv/cv_base.hpp b/src/mlpack/core/cv/cv_base.hpp index 02166eb4e0..832f65a694 100644 --- a/src/mlpack/core/cv/cv_base.hpp +++ b/src/mlpack/core/cv/cv_base.hpp @@ -126,7 +126,7 @@ class CVBase */ template::type> + typename = std::enable_if_t> MLAlgorithm TrainModel(const MatType& xs, const PredictionsType& ys, const MLAlgorithmArgs&... args); @@ -137,7 +137,7 @@ class CVBase */ template::type, + typename = std::enable_if_t, typename = void> MLAlgorithm TrainModel(const MatType& xs, const PredictionsType& ys, @@ -149,7 +149,7 @@ class CVBase */ template::type, + typename = std::enable_if_t, typename = void, typename = void> MLAlgorithm TrainModel(const MatType& xs, @@ -162,7 +162,7 @@ class CVBase */ template::type> + typename = std::enable_if_t> MLAlgorithm TrainModel(const MatType& xs, const PredictionsType& ys, const WeightsType& weights, @@ -174,7 +174,7 @@ class CVBase */ template::type, + typename = std::enable_if_t, typename = void> MLAlgorithm TrainModel(const MatType& xs, const PredictionsType& ys, @@ -187,7 +187,7 @@ class CVBase */ template::type, + typename = std::enable_if_t, typename = void, typename = void> MLAlgorithm TrainModel(const MatType& xs, @@ -207,7 +207,7 @@ class CVBase template::type> + std::enable_if_t> MLAlgorithm TrainModel(const MatType& xs, const PredictionsType& ys, const MLAlgorithmArgs&... args); @@ -219,7 +219,7 @@ class CVBase template::type, + std::enable_if_t, typename = void> MLAlgorithm TrainModel(const MatType& xs, const PredictionsType& ys, diff --git a/src/mlpack/core/cv/cv_base_impl.hpp b/src/mlpack/core/cv/cv_base_impl.hpp index d5e5acc7b0..33d48a68cb 100644 --- a/src/mlpack/core/cv/cv_base_impl.hpp +++ b/src/mlpack/core/cv/cv_base_impl.hpp @@ -141,8 +141,8 @@ MLAlgorithm CVBase::value, + std::is_constructible_v, "The given MLAlgorithm is not constructible from the passed arguments"); return MLAlgorithm(xs, ys, args...); @@ -161,8 +161,9 @@ MLAlgorithm CVBase::value, + std::is_constructible_v, "The given MLAlgorithm is not constructible from the passed arguments"); return MLAlgorithm(xs, ys, numClasses, args...); @@ -182,15 +183,16 @@ MLAlgorithm CVBase::value, + MLAlgorithmArgs...>, "The given MLAlgorithm is not constructible with a data::DatasetInfo " "parameter and the passed arguments"); static const bool constructableWithoutDatasetInfo = - std::is_constructible::value; + std::is_constructible_v; return TrainModel(xs, ys, args...); } @@ -208,8 +210,9 @@ MLAlgorithm CVBase::value, + std::is_constructible_v, "The given MLAlgorithm is not constructible from the passed arguments"); return MLAlgorithm(xs, ys, weights, args...); @@ -229,8 +232,9 @@ MLAlgorithm CVBase::value, + std::is_constructible_v, "The given MLAlgorithm is not constructible from the passed arguments"); return MLAlgorithm(xs, ys, numClasses, weights, args...); @@ -251,15 +255,16 @@ MLAlgorithm CVBase::value, + const WeightsType&, MLAlgorithmArgs...>, "The given MLAlgorithm is not constructible with a data::DatasetInfo " "parameter and the passed arguments"); static const bool constructableWithoutDatasetInfo = - std::is_constructible::value; + std::is_constructible_v; return TrainModel(xs, ys, weights, args...); } diff --git a/src/mlpack/core/cv/k_fold_cv.hpp b/src/mlpack/core/cv/k_fold_cv.hpp index 652975cbaf..3538236180 100644 --- a/src/mlpack/core/cv/k_fold_cv.hpp +++ b/src/mlpack/core/cv/k_fold_cv.hpp @@ -189,7 +189,7 @@ class KFoldCV * the model type. */ template::type> + typename = std::enable_if_t> void Shuffle(); /** @@ -197,7 +197,7 @@ class KFoldCV * model type. */ template::type, + typename = std::enable_if_t, typename = void> void Shuffle(); @@ -257,7 +257,7 @@ class KFoldCV */ template::type> + typename = std::enable_if_t> double TrainAndEvaluate(const MLAlgorithmArgs& ...mlAlgorithmArgs); /** @@ -265,7 +265,7 @@ class KFoldCV */ template::type, + typename = std::enable_if_t, typename = void> double TrainAndEvaluate(const MLAlgorithmArgs& ...mlAlgorithmArgs); diff --git a/src/mlpack/core/cv/meta_info_extractor.hpp b/src/mlpack/core/cv/meta_info_extractor.hpp index 936501da40..704bb62842 100644 --- a/src/mlpack/core/cv/meta_info_extractor.hpp +++ b/src/mlpack/core/cv/meta_info_extractor.hpp @@ -217,11 +217,11 @@ struct SelectMethodForm template struct Implementation { - using Type = typename std::conditional< + using Type = std::conditional_t< HasMethodForm::value, Form, - typename Implementation::Type>::type; + typename Implementation::Type>; }; public: @@ -305,9 +305,9 @@ class MetaInfoExtractor /* An indication whether a method form is selected */ template - using Selects = typename std::conditional< - std::is_same::Type, NotFoundMethodForm>::value, - std::false_type, std::true_type>::type; + using Selects = std::conditional_t< + std::is_same_v::Type, NotFoundMethodForm>, + std::false_type, std::true_type>; public: /** @@ -328,12 +328,12 @@ class MetaInfoExtractor * An indication whether PredictionsType has been identified (i.e. MLAlgorithm * is supported by MetaInfoExtractor). */ - static const bool IsSupported = !std::is_same::value; + static const bool IsSupported = !std::is_same_v; /** * An indication whether MLAlgorithm supports weighted learning. */ - static const bool SupportsWeights = !std::is_same::value; + static const bool SupportsWeights = !std::is_same_v; /** * An indication whether MLAlgorithm takes a data::DatasetInfo parameter. diff --git a/src/mlpack/core/cv/simple_cv.hpp b/src/mlpack/core/cv/simple_cv.hpp index fa2c985b86..573b6006ce 100644 --- a/src/mlpack/core/cv/simple_cv.hpp +++ b/src/mlpack/core/cv/simple_cv.hpp @@ -289,7 +289,7 @@ class SimpleCV */ template::type> + typename = std::enable_if_t> double TrainAndEvaluate(const MLAlgorithmArgs&... args); /** @@ -297,7 +297,7 @@ class SimpleCV */ template::type, + typename = std::enable_if_t, typename = void> double TrainAndEvaluate(const MLAlgorithmArgs&... args); }; diff --git a/src/mlpack/core/data/dataset_mapper_impl.hpp b/src/mlpack/core/data/dataset_mapper_impl.hpp index 7422adc673..46c8c61ca9 100644 --- a/src/mlpack/core/data/dataset_mapper_impl.hpp +++ b/src/mlpack/core/data/dataset_mapper_impl.hpp @@ -52,7 +52,7 @@ void CallMapFirstPass( const InputType& input, const size_t dimension, std::vector& types, - const typename std::enable_if::type* = 0) + const std::enable_if_t* = 0) { policy.template MapFirstPass(input, dimension, types); } @@ -64,7 +64,7 @@ void CallMapFirstPass( const InputType& /* input */, const size_t /* dimension */, std::vector& /* types */, - const typename std::enable_if::type* = 0) + const std::enable_if_t* = 0) { // Nothing to do here. } diff --git a/src/mlpack/core/data/has_serialize.hpp b/src/mlpack/core/data/has_serialize.hpp index 7c2c3d114a..8eee0813ce 100644 --- a/src/mlpack/core/data/has_serialize.hpp +++ b/src/mlpack/core/data/has_serialize.hpp @@ -52,7 +52,7 @@ struct HasSerialize template struct check; template static yes& chk( // This matches classes. check::value>*, + typename std::enable_if_t>*, typename std::enable_if_t::value>*>*); template static no& chk(...); // This matches non-classes. diff --git a/src/mlpack/core/data/load_numeric_csv.hpp b/src/mlpack/core/data/load_numeric_csv.hpp index 7fba6e6498..c8bfdb3735 100644 --- a/src/mlpack/core/data/load_numeric_csv.hpp +++ b/src/mlpack/core/data/load_numeric_csv.hpp @@ -24,7 +24,7 @@ namespace data { template inline eT SafeNegInf( const bool neg, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t>* = 0) { // For an unsigned type, we cannot return negative infinity, so instead return // 0. @@ -34,7 +34,7 @@ inline eT SafeNegInf( template inline eT SafeNegInf( const bool neg, - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t>* = 0) { return neg ? -(std::numeric_limits::infinity()) : std::numeric_limits::infinity(); @@ -88,13 +88,13 @@ bool LoadCSV::ConvertToken(eT& val, // Convert the token into correct type. // If we have a eT as unsigned int, // it will convert all negative numbers to 0. - if (std::is_floating_point::value) + if (std::is_floating_point_v) { val = eT(std::strtod(str, &endptr)); } - else if (std::is_integral::value) + else if (std::is_integral_v) { - if (std::is_signed::value) + if (std::is_signed_v) val = eT(std::strtoll(str, &endptr, 10)); else { diff --git a/src/mlpack/core/data/string_encoding.hpp b/src/mlpack/core/data/string_encoding.hpp index 95067de79f..8edc498d5b 100644 --- a/src/mlpack/core/data/string_encoding.hpp +++ b/src/mlpack/core/data/string_encoding.hpp @@ -198,8 +198,8 @@ class StringEncoding std::vector>& output, const TokenizerType& tokenizer, PolicyType& policy, - typename std::enable_if::onePassEncoding>::type* = 0); + std::enable_if_t::onePassEncoding>* = 0); private: //! The encoding policy object. diff --git a/src/mlpack/core/data/string_encoding_impl.hpp b/src/mlpack/core/data/string_encoding_impl.hpp index cee7a5665f..2a0f091161 100644 --- a/src/mlpack/core/data/string_encoding_impl.hpp +++ b/src/mlpack/core/data/string_encoding_impl.hpp @@ -70,9 +70,9 @@ void StringEncoding::CreateMap( auto token = tokenizer(strView); static_assert( - std::is_same::type, - typename std::remove_reference::type>::value, + std::is_same_v, + std::remove_reference_t>, "The dictionary token type doesn't match the return value type " "of the tokenizer."); @@ -116,9 +116,9 @@ EncodeHelper(const std::vector& input, auto token = tokenizer(strView); static_assert( - std::is_same::type, - typename std::remove_reference::type>::value, + std::is_same_v, + std::remove_reference_t>, "The dictionary token type doesn't match the return value type " "of the tokenizer."); @@ -163,8 +163,8 @@ EncodeHelper(const std::vector& input, std::vector>& output, const TokenizerType& tokenizer, PolicyType& policy, - typename std::enable_if::onePassEncoding>::type*) + std::enable_if_t::onePassEncoding>*) { policy.Reset(); @@ -176,9 +176,9 @@ EncodeHelper(const std::vector& input, auto token = tokenizer(strView); static_assert( - std::is_same::type, - typename std::remove_reference::type>::value, + std::is_same_v, + std::remove_reference_t>, "The dictionary token type doesn't match the return value type " "of the tokenizer."); diff --git a/src/mlpack/core/distributions/discrete_distribution.hpp b/src/mlpack/core/distributions/discrete_distribution.hpp index 3821cafa72..c309ece04d 100644 --- a/src/mlpack/core/distributions/discrete_distribution.hpp +++ b/src/mlpack/core/distributions/discrete_distribution.hpp @@ -153,7 +153,7 @@ class DiscreteDistribution { // Adding 0.5 helps ensure that we cast the floating point to a size_t // correctly. - const size_t obs = (std::is_floating_point::value) ? + const size_t obs = (std::is_floating_point_v) ? size_t(observation(dimension) + 0.5) : size_t(observation(dimension)); // Ensure that the observation is within the bounds. diff --git a/src/mlpack/core/distributions/discrete_distribution_impl.hpp b/src/mlpack/core/distributions/discrete_distribution_impl.hpp index 360c382a94..1c232501be 100644 --- a/src/mlpack/core/distributions/discrete_distribution_impl.hpp +++ b/src/mlpack/core/distributions/discrete_distribution_impl.hpp @@ -83,7 +83,7 @@ inline void DiscreteDistribution::Train( // Add the probability of each observation. The addition of 0.5 to the // observation is to turn the default flooring operation of the size_t // cast into a rounding observation. - const size_t obs = (std::is_floating_point::value) ? + const size_t obs = (std::is_floating_point_v) ? size_t(observations(i, r) + 0.5) : size_t(observations(i, r)); // Ensure that the observation is within the bounds. @@ -141,7 +141,7 @@ inline void DiscreteDistribution::Train( // Add the probability of each observation. The addition of 0.5 // to the observation is to turn the default flooring operation // of the size_t cast into a rounding observation. - const size_t obs = (std::is_floating_point::value) ? + const size_t obs = (std::is_floating_point_v) ? size_t(observations(i, r) + 0.5) : size_t(observations(i, r)); // Ensure that the observation is within the bounds. diff --git a/src/mlpack/core/distributions/gamma_distribution.hpp b/src/mlpack/core/distributions/gamma_distribution.hpp index b1b8079a99..f9364b3899 100644 --- a/src/mlpack/core/distributions/gamma_distribution.hpp +++ b/src/mlpack/core/distributions/gamma_distribution.hpp @@ -75,7 +75,7 @@ class GammaDistribution */ GammaDistribution(const MatType& data, const ElemType tol = - std::is_same::value ? 1e-4 : 1e-8); + std::is_same_v ? 1e-4 : 1e-8); /** * Construct the Gamma distribution given two vectors alpha and beta. @@ -101,7 +101,7 @@ class GammaDistribution */ void Train(const MatType& rdata, const ElemType tol = - std::is_same::value ? 1e-4 : 1e-8); + std::is_same_v ? 1e-4 : 1e-8); /** * Fits an alpha and beta parameter according to observation probabilities. @@ -117,7 +117,7 @@ class GammaDistribution void Train(const MatType& observations, const VecType& probabilities, const ElemType tol = - std::is_same::value ? 1e-4 : 1e-8); + std::is_same_v ? 1e-4 : 1e-8); /** * This function trains (fits distribution parameters) to a dataset with @@ -136,7 +136,7 @@ class GammaDistribution const VecType& meanLogxVec, const VecType& meanxVec, const ElemType tol = - std::is_same::value ? 1e-4 : 1e-8); + std::is_same_v ? 1e-4 : 1e-8); /** * This function returns the probability of a group of observations. diff --git a/src/mlpack/core/hpt/cv_function.hpp b/src/mlpack/core/hpt/cv_function.hpp index 9fef73a7a4..264b878d7d 100644 --- a/src/mlpack/core/hpt/cv_function.hpp +++ b/src/mlpack/core/hpt/cv_function.hpp @@ -130,8 +130,8 @@ class CVFunction template::type> + typename = + std::enable_if_t<(BoundArgIndex + ParamIndex < TotalArgs)>> inline double Evaluate(const arma::mat& parameters, const Args&... args); /** @@ -140,8 +140,8 @@ class CVFunction template::type, + typename = + std::enable_if_t, typename = void> inline double Evaluate(const arma::mat& parameters, const Args&... args); @@ -151,8 +151,8 @@ class CVFunction template::value>::type> + typename = std::enable_if_t< + UseBoundArg::value>> inline double PutNextArg(const arma::mat& parameters, const Args&... args); /** @@ -162,8 +162,8 @@ class CVFunction template::value>::type, + typename = std::enable_if_t< + !UseBoundArg::value>, typename = void> inline double PutNextArg(const arma::mat& parameters, const Args&... args); }; diff --git a/src/mlpack/core/hpt/deduce_hp_types.hpp b/src/mlpack/core/hpt/deduce_hp_types.hpp index d48c9da280..e4f0e903f6 100644 --- a/src/mlpack/core/hpt/deduce_hp_types.hpp +++ b/src/mlpack/core/hpt/deduce_hp_types.hpp @@ -51,7 +51,7 @@ struct DeduceHyperParameterTypes * A type function to deduce the result hyper-parameter type for ArgumentType. */ template::value> + bool IsArithmetic = std::is_arithmetic_v> struct ResultHPType; template diff --git a/src/mlpack/core/hpt/fixed.hpp b/src/mlpack/core/hpt/fixed.hpp index d8f6a3df35..55bf2adc6b 100644 --- a/src/mlpack/core/hpt/fixed.hpp +++ b/src/mlpack/core/hpt/fixed.hpp @@ -101,7 +101,7 @@ class IsPreFixedArg struct Implementation> : std::true_type {}; public: - static const bool value = Implementation::type>::value; + static const bool value = Implementation>::value; }; } // namespace mlpack diff --git a/src/mlpack/core/hpt/hpt.hpp b/src/mlpack/core/hpt/hpt.hpp index c9d8dee829..9f20b7deb7 100644 --- a/src/mlpack/core/hpt/hpt.hpp +++ b/src/mlpack/core/hpt/hpt.hpp @@ -199,10 +199,10 @@ class HyperParameterTuner }; //! A short alias for the full type of the cross-validation. - using CVType = typename std::conditional, CV, MatType, PredictionsType, - WeightsType>>::type; + WeightsType>>; //! The cross-validation object for assessing sets of hyper-parameters. @@ -234,15 +234,15 @@ class HyperParameterTuner * PreFixedArg. */ template - using IsPreFixed = IsPreFixedArg::type>; + using IsPreFixed = IsPreFixedArg>; /** * A type function to check whether the element I of the tuple type is an * arithmetic type. */ template - using IsArithmetic = std::is_arithmetic::type>::type>; + using IsArithmetic = std::is_arithmetic>>; /** * The set of methods to initialize auxiliary objects (a CVFunction object and diff --git a/src/mlpack/core/hpt/hpt_impl.hpp b/src/mlpack/core/hpt/hpt_impl.hpp index 596f58e0ab..019598c09c 100644 --- a/src/mlpack/core/hpt/hpt_impl.hpp +++ b/src/mlpack/core/hpt/hpt_impl.hpp @@ -130,8 +130,8 @@ void HyperParameterTuner& datasetInfo, FixedArgs... fixedArgs) { - using PreFixedArgT = typename std::remove_reference< - typename std::tuple_element::type>::type; + using PreFixedArgT = std::remove_reference_t< + std::tuple_element_t>; using FixedArgT = FixedArg; InitAndOptimize(args, bestParams, datasetInfo, fixedArgs..., diff --git a/src/mlpack/core/math/digamma.hpp b/src/mlpack/core/math/digamma.hpp index 3a252ce5db..ecb1be9a41 100644 --- a/src/mlpack/core/math/digamma.hpp +++ b/src/mlpack/core/math/digamma.hpp @@ -27,7 +27,7 @@ namespace mlpack { * @param x Input for which digamma will be calculated. */ template -typename std::enable_if::type +std::enable_if_t EvaluatePolyLarge(const T(&a)[N], const T& x) { T x2 = x * x; @@ -60,7 +60,7 @@ EvaluatePolyLarge(const T(&a)[N], const T& x) * @param x Input for which digamma will be calculated. */ template -typename std::enable_if::type +std::enable_if_t EvaluatePoly12(const T(&a)[N], const T& x) { T x2 = x * x; @@ -91,7 +91,7 @@ EvaluatePoly12(const T(&a)[N], const T& x) * @param x Input for which digamma will be calculated. */ template -typename std::enable_if::type +std::enable_if_t EvaluatePoly12(const T(&a)[N], const T& x) { T x2 = x * x; diff --git a/src/mlpack/core/math/trigamma.hpp b/src/mlpack/core/math/trigamma.hpp index 5cab44654d..70a6a1910b 100644 --- a/src/mlpack/core/math/trigamma.hpp +++ b/src/mlpack/core/math/trigamma.hpp @@ -30,7 +30,7 @@ namespace mlpack { * @param x Input for which we have to calculate trigamma. */ template -typename std::enable_if::type +std::enable_if_t EvaluatePolyPrec(const T(&a)[N], const T& x) { T x2 = x * x; @@ -60,7 +60,7 @@ EvaluatePolyPrec(const T(&a)[N], const T& x) * @param x Input for which we have to calculate trigamma. */ template -typename std::enable_if::type +std::enable_if_t EvaluatePolyPrec(const T(&a)[N], const T& x) { T x2 = x * x; diff --git a/src/mlpack/core/tree/address.hpp b/src/mlpack/core/tree/address.hpp index bd3b6c3538..e999e01144 100644 --- a/src/mlpack/core/tree/address.hpp +++ b/src/mlpack/core/tree/address.hpp @@ -56,12 +56,12 @@ void PointToAddress(AddressType& address, const VecType& point) { typedef typename VecType::elem_type VecElemType; // Check that the arguments are compatible. - typedef typename std::conditional::type AddressElemType; + uint64_t>AddressElemType; - static_assert(std::is_same::value == true, "The vector element type does not " + static_assert(std::is_same_v == true, "The vector element type does not " "correspond to the address element type."); arma::Col result(point.n_elem); @@ -152,12 +152,12 @@ void AddressToPoint(VecType& point, const AddressType& address) { typedef typename VecType::elem_type VecElemType; // Check that the arguments are compatible. - typedef typename std::conditional::type AddressElemType; + uint64_t>AddressElemType; - static_assert(std::is_same::value == true, "The vector element type does not " + static_assert(std::is_same_v == true, "The vector element type does not " "correspond to the address element type."); constexpr size_t order = sizeof(AddressElemType) * CHAR_BIT; @@ -230,8 +230,8 @@ void AddressToPoint(VecType& point, const AddressType& address) template int CompareAddresses(const AddressType1& addr1, const AddressType2& addr2) { - static_assert(std::is_same::value == true, "Can't compare " + static_assert(std::is_same_v == true, "Can't compare " "addresses of distinct types"); assert(addr1.n_elem == addr2.n_elem); diff --git a/src/mlpack/core/tree/binary_space_tree/ub_tree_split.hpp b/src/mlpack/core/tree/binary_space_tree/ub_tree_split.hpp index 68a7e4ec68..59d8add197 100644 --- a/src/mlpack/core/tree/binary_space_tree/ub_tree_split.hpp +++ b/src/mlpack/core/tree/binary_space_tree/ub_tree_split.hpp @@ -29,10 +29,10 @@ class UBTreeSplit { public: //! The type of an address element. - typedef typename std::conditional< + typedef std::conditional_t< sizeof(typename MatType::elem_type) * CHAR_BIT <= 32, uint32_t, - uint64_t>::type AddressElemType; + uint64_t>AddressElemType; //! An information about the partition. struct SplitInfo diff --git a/src/mlpack/core/tree/build_tree.hpp b/src/mlpack/core/tree/build_tree.hpp index d6ac3b63bd..3042684fd3 100644 --- a/src/mlpack/core/tree/build_tree.hpp +++ b/src/mlpack/core/tree/build_tree.hpp @@ -21,8 +21,8 @@ template TreeType* BuildTree( MatType&& dataset, std::vector& oldFromNew, - const typename std::enable_if< - TreeTraits::RearrangesDataset>::type* = 0) + const std::enable_if_t< + TreeTraits::RearrangesDataset>* = 0) { return new TreeType(std::forward(dataset), oldFromNew); } @@ -32,8 +32,8 @@ template TreeType* BuildTree( MatType&& dataset, const std::vector& /* oldFromNew */, - const typename std::enable_if< - !TreeTraits::RearrangesDataset>::type* = 0) + const std::enable_if_t< + !TreeTraits::RearrangesDataset>* = 0) { return new TreeType(std::forward(dataset)); } diff --git a/src/mlpack/core/tree/cellbound.hpp b/src/mlpack/core/tree/cellbound.hpp index 40b78ebe1f..3fb2bfbb09 100644 --- a/src/mlpack/core/tree/cellbound.hpp +++ b/src/mlpack/core/tree/cellbound.hpp @@ -76,9 +76,9 @@ class CellBound public: //! Depending on the precision of the tree element type, we may need to use //! uint32_t or uint64_t. - typedef typename std::conditional::type AddressElemType; + uint64_t>AddressElemType; /** * Empty constructor; creates a bound of dimensionality 0. diff --git a/src/mlpack/core/tree/rectangle_tree/discrete_hilbert_value.hpp b/src/mlpack/core/tree/rectangle_tree/discrete_hilbert_value.hpp index 9ecb85ed86..3ccd204a75 100644 --- a/src/mlpack/core/tree/rectangle_tree/discrete_hilbert_value.hpp +++ b/src/mlpack/core/tree/rectangle_tree/discrete_hilbert_value.hpp @@ -30,9 +30,9 @@ class DiscreteHilbertValue public: //! Depending on the precision of the tree element type, we may need to use //! uint32_t or uint64_t. - typedef typename std::conditional::type HilbertElemType; + uint64_t>HilbertElemType; //! Default constructor. DiscreteHilbertValue(); diff --git a/src/mlpack/core/tree/rectangle_tree/rectangle_tree.hpp b/src/mlpack/core/tree/rectangle_tree/rectangle_tree.hpp index 8978bcb9ff..6d382b822a 100644 --- a/src/mlpack/core/tree/rectangle_tree/rectangle_tree.hpp +++ b/src/mlpack/core/tree/rectangle_tree/rectangle_tree.hpp @@ -53,7 +53,7 @@ template::value, + static_assert(std::is_same_v, "RectangleTree: DistanceType must be EuclideanDistance."); public: diff --git a/src/mlpack/core/util/ens_traits.hpp b/src/mlpack/core/util/ens_traits.hpp index 79c1635c3c..cade7a7069 100644 --- a/src/mlpack/core/util/ens_traits.hpp +++ b/src/mlpack/core/util/ens_traits.hpp @@ -45,7 +45,7 @@ struct IsEnsOptimizer OptimizerType, FunctionType, MatType, - std::is_class::value + std::is_class_v >::value; }; @@ -55,8 +55,8 @@ struct IsEnsOptimizerInternal { // If OptimizerType is a reference type, then forming the types below will // fail. So we need to strip the reference (and the const for good measure). - typedef typename std::remove_cv< - typename std::remove_reference::type>::type + typedef std::remove_cv_t< + std::remove_reference_t> SafeOptimizerType; using OptimizeElemReturnForm = @@ -85,9 +85,9 @@ template struct IsEnsCallbackTypes { constexpr static bool value = - std::is_class::type - >::type>::value && IsEnsCallbackTypes::value; + std::is_class_v + >> && IsEnsCallbackTypes::value; }; template<> diff --git a/src/mlpack/core/util/first_element_is_arma.hpp b/src/mlpack/core/util/first_element_is_arma.hpp index d5828dcb5a..7bec0f54e7 100644 --- a/src/mlpack/core/util/first_element_is_arma.hpp +++ b/src/mlpack/core/util/first_element_is_arma.hpp @@ -39,9 +39,9 @@ template struct FirstElementIsArma { static constexpr bool value = arma::is_arma_type< - typename std::remove_reference< + std::remove_reference_t< typename First::type - >::type>::value; + >>::value; }; } // namespace mlpack diff --git a/src/mlpack/core/util/prefixedoutstream.hpp b/src/mlpack/core/util/prefixedoutstream.hpp index bca5639444..2947f24481 100644 --- a/src/mlpack/core/util/prefixedoutstream.hpp +++ b/src/mlpack/core/util/prefixedoutstream.hpp @@ -134,7 +134,7 @@ class PrefixedOutStream * @param val The The data to be output. */ template - typename std::enable_if::value>::type + std::enable_if_t::value> BaseLogic(const T& val); /** @@ -148,7 +148,7 @@ class PrefixedOutStream * @param val The The data to be output. */ template - typename std::enable_if::value>::type + std::enable_if_t::value> BaseLogic(const T& val); /** diff --git a/src/mlpack/core/util/prefixedoutstream_impl.hpp b/src/mlpack/core/util/prefixedoutstream_impl.hpp index 5f2aa48142..498fad50f3 100644 --- a/src/mlpack/core/util/prefixedoutstream_impl.hpp +++ b/src/mlpack/core/util/prefixedoutstream_impl.hpp @@ -146,7 +146,7 @@ inline PrefixedOutStream& PrefixedOutStream::operator<<( // For non-Armadillo types. template -typename std::enable_if::value>::type +std::enable_if_t::value> PrefixedOutStream::BaseLogic(const T& val) { // We will use this to track whether or not we need to terminate at the end of @@ -254,7 +254,7 @@ PrefixedOutStream::BaseLogic(const T& val) // For Armadillo types. template -typename std::enable_if::value>::type +std::enable_if_t::value> PrefixedOutStream::BaseLogic(const T& val) { // Extract printable object from the input. diff --git a/src/mlpack/core/util/sfinae_utility.hpp b/src/mlpack/core/util/sfinae_utility.hpp index 848fa515b7..b1747bd4a4 100644 --- a/src/mlpack/core/util/sfinae_utility.hpp +++ b/src/mlpack/core/util/sfinae_utility.hpp @@ -156,7 +156,7 @@ struct NAME \ \ template \ using EnableIfVoid = \ - typename std::enable_if::value, ResultType>::type; \ + std::enable_if_t, ResultType>; \ \ template \ static EnableIfVoid()(&C::METHOD)), yes&> chk(int); \ @@ -196,20 +196,19 @@ struct NAME \ * function in the given class name. * This can also be used in conjunction with std::enable_if. */ -#define HAS_ANY_METHOD_FORM(FUNC, NAME) \ -template \ -struct NAME \ -{ \ - template \ - static typename \ - std::enable_if::value, \ - int>::type \ - f(int) { return 1;} \ - \ - template \ - static char f(char) { return 0; } \ - \ - static const bool value = sizeof(f(0)) != sizeof(char); \ +#define HAS_ANY_METHOD_FORM(FUNC, NAME) \ +template \ +struct NAME \ +{ \ + template \ + static \ + std::enable_if_t, int>\ + f(int) { return 1;} \ + \ + template \ + static char f(char) { return 0; } \ + \ + static const bool value = sizeof(f(0)) != sizeof(char); \ }; /* * A macro that can be used for passing arguments containing commas to other diff --git a/src/mlpack/core/util/size_checks.hpp b/src/mlpack/core/util/size_checks.hpp index 4f25af8021..2d55c25f23 100644 --- a/src/mlpack/core/util/size_checks.hpp +++ b/src/mlpack/core/util/size_checks.hpp @@ -39,8 +39,8 @@ inline void CheckSameSizes( const std::string& addInfo = "labels", const bool& isDataTranspose = false, const bool& isLabelTranspose = false, - const typename std::enable_if< - !std::is_integral::value>::type* = 0) + const std::enable_if_t< + !std::is_integral_v>* = 0) { const size_t dataPoints = (isDataTranspose == true) ? data.n_rows : data.n_cols; @@ -67,7 +67,7 @@ inline void CheckSameSizes( const SizeType& size, const std::string& callerDescription, const std::string& addInfo = "labels", - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t>* = 0) { if (data.n_cols != size) { @@ -96,7 +96,7 @@ inline void CheckSameDimensionality( const DimType& dimension, const std::string& callerDescription, const std::string& addInfo = "dataset", - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t>* = 0) { if (data.n_rows != dimension.n_rows) { @@ -119,7 +119,7 @@ inline void CheckSameDimensionality( const DimType& dimension, const std::string& callerDescription, const std::string& addInfo = "dataset", - const typename std::enable_if::value>::type* = 0) + const std::enable_if_t>* = 0) { if (data.n_rows != dimension) { diff --git a/src/mlpack/core/util/using.hpp b/src/mlpack/core/util/using.hpp index 719a255cf6..de5f1c81a4 100644 --- a/src/mlpack/core/util/using.hpp +++ b/src/mlpack/core/util/using.hpp @@ -92,7 +92,7 @@ struct GetFillType // If the matrix type is a Bandicoot type, use Bandicoot fill objects instead. template< typename MatType, - typename = typename std::enable_if::value>::type*> + typename = std::enable_if_t::value>*> struct GetFillType { static constexpr const decltype(coot::fill::none)& none = coot::fill::none; diff --git a/src/mlpack/methods/adaboost/adaboost.hpp b/src/mlpack/methods/adaboost/adaboost.hpp index 6c5f19c9dd..e6a71275d1 100644 --- a/src/mlpack/methods/adaboost/adaboost.hpp +++ b/src/mlpack/methods/adaboost/adaboost.hpp @@ -130,9 +130,9 @@ class AdaBoost const WeakLearnerInType& other, const size_t maxIterations = 100, const ElemType tolerance = 1e-6, - const typename std::enable_if< - std::is_same::value - >::type* = 0); + const std::enable_if_t< + std::is_same_v + >* = 0); //! Get the maximum number of weak learners allowed in the model. size_t MaxIterations() const { return maxIterations; } @@ -189,8 +189,8 @@ class AdaBoost const std::optional maxIterations = std::nullopt, const std::optional tolerance = std::nullopt, // Necessary to distinguish from other overloads. - const typename std::enable_if< - std::is_same::value>::type* = 0); + const std::enable_if_t< + std::is_same_v>* = 0); /** * Train AdaBoost on the given dataset, using the given parameters. The last diff --git a/src/mlpack/methods/adaboost/adaboost_impl.hpp b/src/mlpack/methods/adaboost/adaboost_impl.hpp index 006e4d8dde..7609ee7749 100644 --- a/src/mlpack/methods/adaboost/adaboost_impl.hpp +++ b/src/mlpack/methods/adaboost/adaboost_impl.hpp @@ -57,8 +57,8 @@ AdaBoost::AdaBoost( const WeakLearnerInType& other, const size_t maxIterations, const typename MatType::elem_type tol, - const typename std::enable_if< - std::is_same::value>::type*) : + const std::enable_if_t< + std::is_same_v>*) : maxIterations(maxIterations), tolerance(tol) { @@ -102,8 +102,8 @@ typename MatType::elem_type AdaBoost::Train( const WeakLearnerInType& other, const std::optional maxIterations, const std::optional tolerance, - const typename std::enable_if< - std::is_same::value>::type*) + const std::enable_if_t< + std::is_same_v>*) { if (maxIterations.has_value()) this->maxIterations = maxIterations.value(); @@ -229,7 +229,7 @@ void AdaBoost::serialize(Archive& ar, // In earlier versions, `alpha` was a vector of doubles---but it might not // be now. - if (std::is_same::value) + if (std::is_same_v) { ar(CEREAL_NVP(alpha)); // The easy case. } diff --git a/src/mlpack/methods/ann/convolution_rules/fft_convolution.hpp b/src/mlpack/methods/ann/convolution_rules/fft_convolution.hpp index a6e48ea4af..0405619572 100644 --- a/src/mlpack/methods/ann/convolution_rules/fft_convolution.hpp +++ b/src/mlpack/methods/ann/convolution_rules/fft_convolution.hpp @@ -48,8 +48,8 @@ class FFTConvolution * @param output Output data that contains the results of the convolution. */ template - static typename std::enable_if< - std::is_same::value, void>::type + static std::enable_if_t< + std::is_same_v, void> Convolution(const MatType& input, const MatType& filter, MatType& output, @@ -83,8 +83,8 @@ class FFTConvolution * @param output Output data that contains the results of the convolution. */ template - static typename std::enable_if< - std::is_same::value, void>::type + static std::enable_if_t< + std::is_same_v, void> Convolution(const MatType& input, const MatType& filter, MatType& output, diff --git a/src/mlpack/methods/ann/convolution_rules/naive_convolution.hpp b/src/mlpack/methods/ann/convolution_rules/naive_convolution.hpp index a472966794..1243479b74 100644 --- a/src/mlpack/methods/ann/convolution_rules/naive_convolution.hpp +++ b/src/mlpack/methods/ann/convolution_rules/naive_convolution.hpp @@ -49,8 +49,8 @@ class NaiveConvolution */ template - static typename std::enable_if< - std::is_same::value, void>::type + static std::enable_if_t< + std::is_same_v, void> Convolution(const InMatType& input, const FilMatType& filter, OutMatType& output, @@ -110,8 +110,8 @@ class NaiveConvolution */ template - static typename std::enable_if< - std::is_same::value, void>::type + static std::enable_if_t< + std::is_same_v, void> Convolution(const InMatType& input, const FilMatType& filter, OutMatType& output, diff --git a/src/mlpack/methods/ann/ffn.hpp b/src/mlpack/methods/ann/ffn.hpp index 7b895c0663..671d82f962 100644 --- a/src/mlpack/methods/ann/ffn.hpp +++ b/src/mlpack/methods/ann/ffn.hpp @@ -486,9 +486,9 @@ class FFN * @param samples Number of datapoints in the dataset. */ template - typename std::enable_if< + std::enable_if_t< ens::traits::HasMaxIterationsSignature::value, void - >::type + > WarnMessageMaxIterations(OptimizerType& optimizer, size_t samples) const; /** @@ -500,9 +500,9 @@ class FFN * @param samples Number of datapoints in the dataset. */ template - typename std::enable_if< + std::enable_if_t< !ens::traits::HasMaxIterationsSignature::value, void - >::type + > WarnMessageMaxIterations(OptimizerType& optimizer, size_t samples) const; //! Instantiated output layer used to evaluate the network. diff --git a/src/mlpack/methods/ann/ffn_impl.hpp b/src/mlpack/methods/ann/ffn_impl.hpp index 8e1bfdbb5f..980e3fd2a6 100644 --- a/src/mlpack/methods/ann/ffn_impl.hpp +++ b/src/mlpack/methods/ann/ffn_impl.hpp @@ -694,9 +694,9 @@ template template -typename std::enable_if< +std::enable_if_t< ens::traits::HasMaxIterationsSignature::value, void ->::type +> FFN< OutputLayerType, InitializationRuleType, @@ -718,9 +718,9 @@ template template -typename std::enable_if< +std::enable_if_t< !ens::traits::HasMaxIterationsSignature::value, void ->::type +> FFN< OutputLayerType, InitializationRuleType, diff --git a/src/mlpack/methods/ann/not_adapted/brnn.hpp b/src/mlpack/methods/ann/not_adapted/brnn.hpp index d38089ed76..c90f59c196 100644 --- a/src/mlpack/methods/ann/not_adapted/brnn.hpp +++ b/src/mlpack/methods/ann/not_adapted/brnn.hpp @@ -89,9 +89,9 @@ class BRNN * @param samples Number of datapoints in the dataset. */ template - typename std::enable_if< + std::enable_if_t< HasMaxIterations - ::value, void>::type + ::value, void> WarnMessageMaxIterations(OptimizerType& optimizer, size_t samples) const; /** @@ -103,9 +103,9 @@ class BRNN * @param samples Number of datapoints in the dataset. */ template - typename std::enable_if< + std::enable_if_t< !HasMaxIterations - ::value, void>::type + ::value, void> WarnMessageMaxIterations(OptimizerType& optimizer, size_t samples) const; /** diff --git a/src/mlpack/methods/ann/not_adapted/brnn_impl.hpp b/src/mlpack/methods/ann/not_adapted/brnn_impl.hpp index 1d08a3cd7d..fdc7cb8e51 100644 --- a/src/mlpack/methods/ann/not_adapted/brnn_impl.hpp +++ b/src/mlpack/methods/ann/not_adapted/brnn_impl.hpp @@ -78,9 +78,9 @@ template template -typename std::enable_if< +std::enable_if_t< HasMaxIterations - ::value, void>::type + ::value, void> BRNN::WarnMessageMaxIterations (OptimizerType& optimizer, size_t samples) const @@ -102,9 +102,9 @@ template template -typename std::enable_if< +std::enable_if_t< !HasMaxIterations - ::value, void>::type + ::value, void> BRNN::WarnMessageMaxIterations (OptimizerType& /* optimizer */, size_t /* samples */) const @@ -201,7 +201,7 @@ void BRNN>::value) + if (std::is_same_v>) { results = zeros(outputSize * 2, predictors.n_cols, rho); } @@ -438,7 +438,7 @@ EvaluateWithGradient(const arma::mat& /* parameters */, } arma::cube results; - if (std::is_same>::value) + if (std::is_same_v>) { results = zeros(outputSize * 2, batchSize, rho); } diff --git a/src/mlpack/methods/ann/not_adapted/gan/gan.hpp b/src/mlpack/methods/ann/not_adapted/gan/gan.hpp index 4b32a605a1..2b754dddbe 100644 --- a/src/mlpack/methods/ann/not_adapted/gan/gan.hpp +++ b/src/mlpack/methods/ann/not_adapted/gan/gan.hpp @@ -134,8 +134,8 @@ class GAN * @param batchSize Variable to store the present number of inputs. */ template - typename std::enable_if::value || - std::is_same::value, double>::type + std::enable_if_t || + std::is_same_v, double> Evaluate(const arma::mat& parameters, const size_t i, const size_t batchSize); @@ -149,8 +149,8 @@ class GAN * @param batchSize Variable to store the present number of inputs. */ template - typename std::enable_if::value, - double>::type + std::enable_if_t, + double> Evaluate(const arma::mat& parameters, const size_t i, const size_t batchSize); @@ -164,8 +164,8 @@ class GAN * @param batchSize Variable to store the present number of inputs. */ template - typename std::enable_if::value, - double>::type + std::enable_if_t, + double> Evaluate(const arma::mat& parameters, const size_t i, const size_t batchSize); @@ -181,8 +181,8 @@ class GAN * @param batchSize Variable to store the present number of inputs. */ template - typename std::enable_if::value || - std::is_same::value, double>::type + std::enable_if_t || + std::is_same_v, double> EvaluateWithGradient(const arma::mat& parameters, const size_t i, GradType& gradient, @@ -199,8 +199,8 @@ class GAN * @param batchSize Variable to store the present number of inputs. */ template - typename std::enable_if::value, - double>::type + std::enable_if_t, + double> EvaluateWithGradient(const arma::mat& parameters, const size_t i, GradType& gradient, @@ -217,8 +217,8 @@ class GAN * @param batchSize Variable to store the present number of inputs. */ template - typename std::enable_if::value, - double>::type + std::enable_if_t, + double> EvaluateWithGradient(const arma::mat& parameters, const size_t i, GradType& gradient, @@ -235,8 +235,8 @@ class GAN * @param batchSize Variable to store the present number of inputs. */ template - typename std::enable_if::value || - std::is_same::value, void>::type + std::enable_if_t || + std::is_same_v, void> Gradient(const arma::mat& parameters, const size_t i, arma::mat& gradient, @@ -253,7 +253,7 @@ class GAN * @param batchSize Variable to store the present number of inputs. */ template - typename std::enable_if::value, void>::type + std::enable_if_t, void> Gradient(const arma::mat& parameters, const size_t i, arma::mat& gradient, @@ -270,8 +270,8 @@ class GAN * @param batchSize Variable to store the present number of inputs. */ template - typename std::enable_if::value, - void>::type + std::enable_if_t, + void> Gradient(const arma::mat& parameters, const size_t i, arma::mat& gradient, diff --git a/src/mlpack/methods/ann/not_adapted/gan/gan_impl.hpp b/src/mlpack/methods/ann/not_adapted/gan/gan_impl.hpp index 56459ddc57..88371bab52 100644 --- a/src/mlpack/methods/ann/not_adapted/gan/gan_impl.hpp +++ b/src/mlpack/methods/ann/not_adapted/gan/gan_impl.hpp @@ -233,8 +233,8 @@ template< typename PolicyType > template -typename std::enable_if::value || - std::is_same::value, double>::type +std::enable_if_t || + std::is_same_v, double> GAN::Evaluate( const arma::mat& /* parameters */, const size_t i, @@ -288,8 +288,8 @@ template< typename PolicyType > template -typename std::enable_if::value || - std::is_same::value, double>::type +std::enable_if_t || + std::is_same_v, double> GAN:: EvaluateWithGradient(const arma::mat& /* parameters */, const size_t i, @@ -391,8 +391,8 @@ template< typename PolicyType > template -typename std::enable_if::value || - std::is_same::value, void>::type +std::enable_if_t || + std::is_same_v, void> GAN:: Gradient(const arma::mat& parameters, const size_t i, diff --git a/src/mlpack/methods/ann/not_adapted/gan/wgan_impl.hpp b/src/mlpack/methods/ann/not_adapted/gan/wgan_impl.hpp index 56e02e7318..75fbfa1289 100644 --- a/src/mlpack/methods/ann/not_adapted/gan/wgan_impl.hpp +++ b/src/mlpack/methods/ann/not_adapted/gan/wgan_impl.hpp @@ -27,7 +27,7 @@ template< typename PolicyType > template -typename std::enable_if::value, double>::type +std::enable_if_t, double> GAN::Evaluate( const arma::mat& /* parameters */, const size_t i, @@ -82,7 +82,7 @@ template< typename PolicyType > template -typename std::enable_if::value, double>::type +std::enable_if_t, double> GAN:: EvaluateWithGradient(const arma::mat& /* parameters */, const size_t i, @@ -185,7 +185,7 @@ template< typename PolicyType > template -typename std::enable_if::value, void>::type +std::enable_if_t, void> GAN:: Gradient(const arma::mat& parameters, const size_t i, diff --git a/src/mlpack/methods/ann/not_adapted/gan/wgangp_impl.hpp b/src/mlpack/methods/ann/not_adapted/gan/wgangp_impl.hpp index f86fe5c43b..d4f49ace20 100644 --- a/src/mlpack/methods/ann/not_adapted/gan/wgangp_impl.hpp +++ b/src/mlpack/methods/ann/not_adapted/gan/wgangp_impl.hpp @@ -27,8 +27,8 @@ template< typename PolicyType > template -typename std::enable_if::value, - double>::type +std::enable_if_t, + double> GAN::Evaluate( const arma::mat& /* parameters */, const size_t i, @@ -95,8 +95,8 @@ template< typename PolicyType > template -typename std::enable_if::value, - double>::type +std::enable_if_t, + double> GAN:: EvaluateWithGradient(const arma::mat& /* parameters */, const size_t i, @@ -209,8 +209,8 @@ template< typename PolicyType > template -typename std::enable_if::value, - void>::type +std::enable_if_t, + void> GAN:: Gradient(const arma::mat& parameters, const size_t i, diff --git a/src/mlpack/methods/ann/not_adapted/rbm/rbm.hpp b/src/mlpack/methods/ann/not_adapted/rbm/rbm.hpp index c7c34b9f08..cd15b08d01 100644 --- a/src/mlpack/methods/ann/not_adapted/rbm/rbm.hpp +++ b/src/mlpack/methods/ann/not_adapted/rbm/rbm.hpp @@ -70,12 +70,12 @@ class RBM // Reset the network. template - typename std::enable_if::value, void>::type + std::enable_if_t, void> Reset(); // Reset the network. template - typename std::enable_if::value, void>::type + std::enable_if_t, void> Reset(); /** @@ -116,7 +116,7 @@ class RBM * @param input The visible neurons. */ template - typename std::enable_if::value, double>::type + std::enable_if_t, double> FreeEnergy(const arma::Mat& input); /** @@ -130,8 +130,8 @@ class RBM * @param input The visible layer neurons. */ template - typename std::enable_if::value, - double>::type + std::enable_if_t, + double> FreeEnergy(const arma::Mat& input); /** @@ -141,7 +141,7 @@ class RBM * @param gradient Stores the gradient of the RBM network. */ template - typename std::enable_if::value, void>::type + std::enable_if_t, void> Phase(const InputType& input, DataType& gradient); /** @@ -151,7 +151,7 @@ class RBM * @param gradient Stores the gradient of the RBM network. */ template - typename std::enable_if::value, void>::type + std::enable_if_t, void> Phase(const InputType& input, DataType& gradient); /** @@ -162,7 +162,7 @@ class RBM * @param output The sampled hidden layer. */ template - typename std::enable_if::value, void>::type + std::enable_if_t, void> SampleHidden(const arma::Mat& input, arma::Mat& output); /** @@ -176,7 +176,7 @@ class RBM * @param output Sampled slab neurons. */ template - typename std::enable_if::value, void>::type + std::enable_if_t, void> SampleHidden(const arma::Mat& input, arma::Mat& output); /** @@ -187,7 +187,7 @@ class RBM * @param output The sampled visible layer. */ template - typename std::enable_if::value, void>::type + std::enable_if_t, void> SampleVisible(arma::Mat& input, arma::Mat& output); /** @@ -201,7 +201,7 @@ class RBM * @param output The sampled visible layer. */ template - typename std::enable_if::value, void>::type + std::enable_if_t, void> SampleVisible(arma::Mat& input, arma::Mat& output); /** @@ -211,7 +211,7 @@ class RBM * @param output Visible neuron activations. */ template - typename std::enable_if::value, void>::type + std::enable_if_t, void> VisibleMean(InputType& input, DataType& output); /** @@ -223,7 +223,7 @@ class RBM * @param output Mean of the of the Normal distribution. */ template - typename std::enable_if::value, void>::type + std::enable_if_t, void> VisibleMean(InputType& input, DataType& output); /** @@ -233,7 +233,7 @@ class RBM * @param output Hidden neuron activations. */ template - typename std::enable_if::value, void>::type + std::enable_if_t, void> HiddenMean(const InputType& input, DataType& output); /** @@ -247,7 +247,7 @@ class RBM * @param output Consists of both the spike samples and slab samples. */ template - typename std::enable_if::value, void>::type + std::enable_if_t, void> HiddenMean(const InputType& input, DataType& output); /** @@ -259,7 +259,7 @@ class RBM * @param spikeMean Indicates P(h|v). */ template - typename std::enable_if::value, void>::type + std::enable_if_t, void> SpikeMean(const InputType& visible, DataType& spikeMean); /** @@ -268,7 +268,7 @@ class RBM * @param spike Sampled binary spike variables. */ template - typename std::enable_if::value, void>::type + std::enable_if_t, void> SampleSpike(InputType& spikeMean, DataType& spike); /** @@ -281,7 +281,7 @@ class RBM * @param slabMean The mean of the Normal distribution of slab neurons. */ template - typename std::enable_if::value, void>::type + std::enable_if_t, void> SlabMean(const DataType& visible, DataType& spike, DataType& slabMean); /** @@ -295,7 +295,7 @@ class RBM * @param slab Sampled slab variable from the Normal distribution. */ template - typename std::enable_if::value, void>::type + std::enable_if_t, void> SampleSlab(InputType& slabMean, DataType& slab); /** diff --git a/src/mlpack/methods/ann/not_adapted/rbm/rbm_impl.hpp b/src/mlpack/methods/ann/not_adapted/rbm/rbm_impl.hpp index 2ec598d424..0ab6129f95 100644 --- a/src/mlpack/methods/ann/not_adapted/rbm/rbm_impl.hpp +++ b/src/mlpack/methods/ann/not_adapted/rbm/rbm_impl.hpp @@ -58,7 +58,7 @@ template< typename PolicyType > template -typename std::enable_if::value, void>::type +std::enable_if_t, void> RBM::Reset() { size_t shape = (visibleSize * hiddenSize) + visibleSize + hiddenSize; @@ -108,7 +108,7 @@ template< typename PolicyType > template -typename std::enable_if::value, double>::type +std::enable_if_t, double> RBM::FreeEnergy( const arma::Mat& input) { @@ -124,7 +124,7 @@ template< typename PolicyType > template -typename std::enable_if::value, void>::type +std::enable_if_t, void> RBM::Phase( const InputType& input, DataType& gradient) @@ -161,7 +161,7 @@ template< typename PolicyType > template -typename std::enable_if::value, void>::type +std::enable_if_t, void> RBM::SampleHidden( const arma::Mat& input, arma::Mat& output) @@ -180,7 +180,7 @@ template< typename PolicyType > template -typename std::enable_if::value, void>::type +std::enable_if_t, void> RBM::SampleVisible( arma::Mat& input, arma::Mat& output) @@ -199,7 +199,7 @@ template< typename PolicyType > template -typename std::enable_if::value, void>::type +std::enable_if_t, void> RBM::VisibleMean( InputType& input, DataType& output) @@ -215,7 +215,7 @@ template< typename PolicyType > template -typename std::enable_if::value, void>::type +std::enable_if_t, void> RBM::HiddenMean( const InputType& input, DataType& output) diff --git a/src/mlpack/methods/ann/not_adapted/rbm/spike_slab_rbm_impl.hpp b/src/mlpack/methods/ann/not_adapted/rbm/spike_slab_rbm_impl.hpp index 3a8da8c70e..633ddf9c53 100644 --- a/src/mlpack/methods/ann/not_adapted/rbm/spike_slab_rbm_impl.hpp +++ b/src/mlpack/methods/ann/not_adapted/rbm/spike_slab_rbm_impl.hpp @@ -25,7 +25,7 @@ template< typename PolicyType > template -typename std::enable_if::value, void>::type +std::enable_if_t, void> RBM::Reset() { size_t shape = (visibleSize * hiddenSize * poolSize) + visibleSize + @@ -65,7 +65,7 @@ template< typename PolicyType > template -typename std::enable_if::value, double>::type +std::enable_if_t, double> RBM::FreeEnergy( const arma::Mat& input) { @@ -90,7 +90,7 @@ template< typename PolicyType > template -typename std::enable_if::value, void>::type +std::enable_if_t, void> RBM::Phase( const InputType& input, DataType& gradient) @@ -123,7 +123,7 @@ template< typename PolicyType > template -typename std::enable_if::value, void>::type +std::enable_if_t, void> RBM::SampleHidden( const arma::Mat& input, arma::Mat& output) @@ -146,7 +146,7 @@ template< typename PolicyType > template -typename std::enable_if::value, void>::type +std::enable_if_t, void> RBM::SampleVisible( arma::Mat& input, arma::Mat& output) @@ -184,7 +184,7 @@ template< typename PolicyType > template -typename std::enable_if::value, void>::type +std::enable_if_t, void> RBM::VisibleMean( InputType& input, DataType& output) @@ -209,7 +209,7 @@ template< typename PolicyType > template -typename std::enable_if::value, void>::type +std::enable_if_t, void> RBM::HiddenMean( const InputType& input, DataType& output) @@ -231,7 +231,7 @@ template< typename PolicyType > template -typename std::enable_if::value, void>::type +std::enable_if_t, void> RBM::SpikeMean( const InputType& visible, DataType& spikeMean) @@ -250,7 +250,7 @@ template< typename PolicyType > template -typename std::enable_if::value, void>::type +std::enable_if_t, void> RBM::SampleSpike( InputType& spikeMean, DataType& spike) @@ -267,7 +267,7 @@ template< typename PolicyType > template -typename std::enable_if::value, void>::type +std::enable_if_t, void> RBM::SlabMean( const DataType& visible, DataType& spike, @@ -286,7 +286,7 @@ template< typename PolicyType > template -typename std::enable_if::value, void>::type +std::enable_if_t, void> RBM::SampleSlab( InputType& slabMean, DataType& slab) diff --git a/src/mlpack/methods/bayesian_linear_regression/bayesian_linear_regression.hpp b/src/mlpack/methods/bayesian_linear_regression/bayesian_linear_regression.hpp index f59dea34b1..84779e9723 100644 --- a/src/mlpack/methods/bayesian_linear_regression/bayesian_linear_regression.hpp +++ b/src/mlpack/methods/bayesian_linear_regression/bayesian_linear_regression.hpp @@ -139,9 +139,9 @@ class BayesianLinearRegression */ template::value - >::type> + typename = std::enable_if_t< + std::is_same_v + >> BayesianLinearRegression(const MatType& data, const ResponsesType& responses, const bool centerData = true, @@ -175,9 +175,9 @@ class BayesianLinearRegression template::value - >::type> + typename = std::enable_if_t< + std::is_same_v + >> ElemType Train(const MatType& data, const ResponsesType& responses, const std::optional centerData = std::nullopt, @@ -187,9 +187,9 @@ class BayesianLinearRegression template::value - >::type> + typename = std::enable_if_t< + std::is_same_v + >> ElemType Train(const MatType& data, const ResponsesType& responses, const bool centerData, @@ -231,9 +231,9 @@ class BayesianLinearRegression */ template::value - >::type> + typename = std::enable_if_t< + std::is_same_v + >> void Predict(const MatType& points, ResponsesType& predictions) const; @@ -249,9 +249,9 @@ class BayesianLinearRegression */ template::value - >::type> + typename = std::enable_if_t< + std::is_same_v + >> void Predict(const MatType& points, ResponsesType& predictions, ResponsesType& std) const; @@ -266,9 +266,9 @@ class BayesianLinearRegression **/ template::value - >::type> + typename = std::enable_if_t< + std::is_same_v + >> ElemType RMSE(const MatType& data, const ResponsesType& responses) const; diff --git a/src/mlpack/methods/decision_tree/decision_tree.hpp b/src/mlpack/methods/decision_tree/decision_tree.hpp index 24409fa2db..5ed4cbd9bd 100644 --- a/src/mlpack/methods/decision_tree/decision_tree.hpp +++ b/src/mlpack/methods/decision_tree/decision_tree.hpp @@ -130,7 +130,7 @@ class DecisionTree : const size_t maximumDepth = 0, DimensionSelectionType dimensionSelector = DimensionSelectionType(), const std::enable_if_t::type>::value>* = 0); + std::remove_reference_t>::value>* = 0); /** * Construct the decision tree on the given data and labels with weights, @@ -161,7 +161,7 @@ class DecisionTree : const size_t maximumDepth = 0, DimensionSelectionType dimensionSelector = DimensionSelectionType(), const std::enable_if_t::type>::value>* = 0); + std::remove_reference_t>::value>* = 0); /** * Using the hyperparameters of another decision tree, train on the given data @@ -193,7 +193,7 @@ class DecisionTree : const size_t minimumLeafSize = 10, const double minimumGainSplit = 1e-7, const std::enable_if_t::type>::value>* = 0); + std::remove_reference_t>::value>* = 0); /** * Take ownership of another decision tree and train on the given data and @@ -225,7 +225,7 @@ class DecisionTree : const size_t maximumDepth = 0, DimensionSelectionType dimensionSelector = DimensionSelectionType(), const std::enable_if_t::type>::value>* = 0); + std::remove_reference_t>::value>* = 0); /** * Construct a decision tree without training it. It will be a leaf node with @@ -359,8 +359,8 @@ class DecisionTree : const size_t maximumDepth = 0, DimensionSelectionType dimensionSelector = DimensionSelectionType(), - const std::enable_if_t::type>::value>* = 0); + const std::enable_if_t>::value>* = 0); /** * Train the decision tree on the given weighted data, assuming that all @@ -391,8 +391,8 @@ class DecisionTree : const size_t maximumDepth = 0, DimensionSelectionType dimensionSelector = DimensionSelectionType(), - const std::enable_if_t::type>::value>* = 0); + const std::enable_if_t>::value>* = 0); /** * Classify the given point, using the entire tree. The predicted label is diff --git a/src/mlpack/methods/decision_tree/decision_tree_impl.hpp b/src/mlpack/methods/decision_tree/decision_tree_impl.hpp index 799aebf406..b8102a2445 100644 --- a/src/mlpack/methods/decision_tree/decision_tree_impl.hpp +++ b/src/mlpack/methods/decision_tree/decision_tree_impl.hpp @@ -37,8 +37,8 @@ DecisionTree::type; - using TrueLabelsType = typename std::decay::type; + using TrueMatType = std::decay_t; + using TrueLabelsType = std::decay_t; // Copy or move data. TrueMatType tmpData(std::move(data)); @@ -74,8 +74,8 @@ DecisionTree::type; - using TrueLabelsType = typename std::decay::type; + using TrueMatType = std::decay_t; + using TrueLabelsType = std::decay_t; // Copy or move data. TrueMatType tmpData(std::move(data)); @@ -112,11 +112,11 @@ DecisionTree::type>::value>*) + std::remove_reference_t>::value>*) { - using TrueMatType = typename std::decay::type; - using TrueLabelsType = typename std::decay::type; - using TrueWeightsType = typename std::decay::type; + using TrueMatType = std::decay_t; + using TrueLabelsType = std::decay_t; + using TrueWeightsType = std::decay_t; // Copy or move data. TrueMatType tmpData(std::move(data)); @@ -153,11 +153,11 @@ DecisionTree::type>::value>*) + std::remove_reference_t>::value>*) { - using TrueMatType = typename std::decay::type; - using TrueLabelsType = typename std::decay::type; - using TrueWeightsType = typename std::decay::type; + using TrueMatType = std::decay_t; + using TrueLabelsType = std::decay_t; + using TrueWeightsType = std::decay_t; // Copy or move data. TrueMatType tmpData(std::move(data)); @@ -193,13 +193,13 @@ DecisionTree::type>::value>*): + std::remove_reference_t>::value>*): NumericAuxiliarySplitInfo(other), CategoricalAuxiliarySplitInfo(other) { - using TrueMatType = typename std::decay::type; - using TrueLabelsType = typename std::decay::type; - using TrueWeightsType = typename std::decay::type; + using TrueMatType = std::decay_t; + using TrueLabelsType = std::decay_t; + using TrueWeightsType = std::decay_t; // Copy or move data. TrueMatType tmpData(std::move(data)); @@ -233,14 +233,13 @@ DecisionTree::type>::value>*): + std::remove_reference_t>::value>*): NumericAuxiliarySplitInfo(other), CategoricalAuxiliarySplitInfo(other) // other info does need to copy { - using TrueMatType = typename std::decay::type; - using TrueLabelsType = typename std::decay::type; - using TrueWeightsType = typename std::decay::type; + using TrueMatType = std::decay_t; + using TrueLabelsType = std::decay_t; + using TrueWeightsType = std::decay_t; // Copy or move data. TrueMatType tmpData(std::move(data)); @@ -458,8 +457,8 @@ double DecisionTree::type; - using TrueLabelsType = typename std::decay::type; + using TrueMatType = std::decay_t; + using TrueLabelsType = std::decay_t; // Copy or move data. TrueMatType tmpData(std::move(data)); @@ -498,8 +497,8 @@ double DecisionTree::type; - using TrueLabelsType = typename std::decay::type; + using TrueMatType = std::decay_t; + using TrueLabelsType = std::decay_t; // Copy or move data. TrueMatType tmpData(std::move(data)); @@ -538,15 +537,14 @@ double DecisionTree::type>::value>*) + std::remove_reference_t>::value>*) { // Sanity check on data. util::CheckSameSizes(data, labels, "DecisionTree::Train()"); - using TrueMatType = typename std::decay::type; - using TrueLabelsType = typename std::decay::type; - using TrueWeightsType = typename std::decay::type; + using TrueMatType = std::decay_t; + using TrueLabelsType = std::decay_t; + using TrueWeightsType = std::decay_t; // Copy or move data. TrueMatType tmpData(std::move(data)); @@ -584,15 +582,14 @@ double DecisionTree::type>::value>*) + std::remove_reference_t>::value>*) { // Sanity check on data. util::CheckSameSizes(data, labels, "DecisionTree::Train()"); - using TrueMatType = typename std::decay::type; - using TrueLabelsType = typename std::decay::type; - using TrueWeightsType = typename std::decay::type; + using TrueMatType = std::decay_t; + using TrueLabelsType = std::decay_t; + using TrueWeightsType = std::decay_t; // Copy or move data. TrueMatType tmpData(std::move(data)); diff --git a/src/mlpack/methods/decision_tree/decision_tree_regressor.hpp b/src/mlpack/methods/decision_tree/decision_tree_regressor.hpp index f5441b509d..b0f4a61241 100644 --- a/src/mlpack/methods/decision_tree/decision_tree_regressor.hpp +++ b/src/mlpack/methods/decision_tree/decision_tree_regressor.hpp @@ -129,7 +129,7 @@ class DecisionTreeRegressor : const size_t maximumDepth = 0, DimensionSelectionType dimensionSelector = DimensionSelectionType(), const std::enable_if_t::type>::value>* = 0); + std::remove_reference_t>::value>* = 0); /** * Construct the decision tree on the given data and responses with weights, @@ -158,7 +158,7 @@ class DecisionTreeRegressor : const size_t maximumDepth = 0, DimensionSelectionType dimensionSelector = DimensionSelectionType(), const std::enable_if_t::type>::value>* = 0); + std::remove_reference_t>::value>* = 0); /** * Take ownership of another decision tree and train on the given data and @@ -188,7 +188,7 @@ class DecisionTreeRegressor : const size_t minimumLeafSize = 10, const double minimumGainSplit = 1e-7, const std::enable_if_t::type>::value>* = 0); + std::remove_reference_t>::value>* = 0); /** * Take ownership of another decision tree and train on the given data and @@ -218,7 +218,7 @@ class DecisionTreeRegressor : const size_t maximumDepth = 0, DimensionSelectionType dimensionSelector = DimensionSelectionType(), const std::enable_if_t::type>::value>* = 0); + std::remove_reference_t>::value>* = 0); /** * Copy another tree. This may use a lot of memory---be sure that it's what @@ -347,8 +347,8 @@ class DecisionTreeRegressor : DimensionSelectionType dimensionSelector = DimensionSelectionType(), FitnessFunction fitnessFunction = FitnessFunction(), - const std::enable_if_t::type>::value>* = 0); + const std::enable_if_t>::value>* = 0); /** * Train the decision tree on the given weighted data, assuming that all @@ -380,8 +380,8 @@ class DecisionTreeRegressor : DimensionSelectionType dimensionSelector = DimensionSelectionType(), FitnessFunction fitnessFunction = FitnessFunction(), - const std::enable_if_t::type>::value>* = 0); + const std::enable_if_t>::value>* = 0); /** * Make prediction for the given point, using the entire tree. The predicted diff --git a/src/mlpack/methods/decision_tree/decision_tree_regressor_impl.hpp b/src/mlpack/methods/decision_tree/decision_tree_regressor_impl.hpp index 05875a75f1..b2fc5538a5 100644 --- a/src/mlpack/methods/decision_tree/decision_tree_regressor_impl.hpp +++ b/src/mlpack/methods/decision_tree/decision_tree_regressor_impl.hpp @@ -52,8 +52,8 @@ DecisionTreeRegressor::type; - using TrueResponsesType = typename std::decay::type; + using TrueMatType = std::decay_t; + using TrueResponsesType = std::decay_t; // Copy or move data. TrueMatType tmpData(std::move(data)); @@ -88,8 +88,8 @@ DecisionTreeRegressor::type; - using TrueResponsesType = typename std::decay::type; + using TrueMatType = std::decay_t; + using TrueResponsesType = std::decay_t; // Copy or move data. TrueMatType tmpData(std::move(data)); @@ -125,12 +125,12 @@ DecisionTreeRegressor::type>::value>*) + std::remove_reference_t>::value>*) : splitInfo() { - using TrueMatType = typename std::decay::type; - using TrueResponsesType = typename std::decay::type; - using TrueWeightsType = typename std::decay::type; + using TrueMatType = std::decay_t; + using TrueResponsesType = std::decay_t; + using TrueWeightsType = std::decay_t; TrueMatType tmpData(std::move(data)); TrueResponsesType tmpResponses(std::move(responses)); @@ -166,12 +166,12 @@ DecisionTreeRegressor::type>::value>*) : splitInfo() + std::remove_reference_t< + WeightsType>>::value>*) : splitInfo() { - using TrueMatType = typename std::decay::type; - using TrueResponsesType = typename std::decay::type; - using TrueWeightsType = typename std::decay::type; + using TrueMatType = std::decay_t; + using TrueResponsesType = std::decay_t; + using TrueWeightsType = std::decay_t; // Copy or move data. TrueMatType tmpData(std::move(data)); @@ -206,14 +206,14 @@ DecisionTreeRegressor::type>::value>*): + std::remove_reference_t>::value>*): splitInfo(std::move(other.splitInfo)), NumericAuxiliarySplitInfo(other), CategoricalAuxiliarySplitInfo(other) { - using TrueMatType = typename std::decay::type; - using TrueResponsesType = typename std::decay::type; - using TrueWeightsType = typename std::decay::type; + using TrueMatType = std::decay_t; + using TrueResponsesType = std::decay_t; + using TrueWeightsType = std::decay_t; // Copy or move data. TrueMatType tmpData(std::move(data)); @@ -246,15 +246,15 @@ DecisionTreeRegressor::type>::value>*): + std::remove_reference_t< + WeightsType>>::value>*): splitInfo(std::move(other.splitInfo)), NumericAuxiliarySplitInfo(other), CategoricalAuxiliarySplitInfo(other) // other info does need to copy { - using TrueMatType = typename std::decay::type; - using TrueResponsesType = typename std::decay::type; - using TrueWeightsType = typename std::decay::type; + using TrueMatType = std::decay_t; + using TrueResponsesType = std::decay_t; + using TrueWeightsType = std::decay_t; // Copy or move data. TrueMatType tmpData(std::move(data)); @@ -442,8 +442,8 @@ double DecisionTreeRegressor::type; - using TrueResponsesType = typename std::decay::type; + using TrueMatType = std::decay_t; + using TrueResponsesType = std::decay_t; // Copy or move data. TrueMatType tmpData(std::move(data)); @@ -482,8 +482,8 @@ double DecisionTreeRegressor::type; - using TrueResponsesType = typename std::decay::type; + using TrueMatType = std::decay_t; + using TrueResponsesType = std::decay_t; // Copy or move data. TrueMatType tmpData(std::move(data)); @@ -522,15 +522,15 @@ double DecisionTreeRegressor::type>::value>*) + std::remove_reference_t< + WeightsType>>::value>*) { // Sanity check on data. util::CheckSameSizes(data, responses, "DecisionTreeRegressor::Train()"); - using TrueMatType = typename std::decay::type; - using TrueResponsesType = typename std::decay::type; - using TrueWeightsType = typename std::decay::type; + using TrueMatType = std::decay_t; + using TrueResponsesType = std::decay_t; + using TrueWeightsType = std::decay_t; // Copy or move data. TrueMatType tmpData(std::move(data)); @@ -568,15 +568,15 @@ double DecisionTreeRegressor::type>::value>*) + std::remove_reference_t< + WeightsType>>::value>*) { // Sanity check on data. util::CheckSameSizes(data, responses, "DecisionTreeRegressor::Train()"); - using TrueMatType = typename std::decay::type; - using TrueResponsesType = typename std::decay::type; - using TrueWeightsType = typename std::decay::type; + using TrueMatType = std::decay_t; + using TrueResponsesType = std::decay_t; + using TrueWeightsType = std::decay_t; // Copy or move data. TrueMatType tmpData(std::move(data)); diff --git a/src/mlpack/methods/decision_tree/splits/best_binary_categorical_split_impl.hpp b/src/mlpack/methods/decision_tree/splits/best_binary_categorical_split_impl.hpp index d5cd9ccd58..1e078c5600 100644 --- a/src/mlpack/methods/decision_tree/splits/best_binary_categorical_split_impl.hpp +++ b/src/mlpack/methods/decision_tree/splits/best_binary_categorical_split_impl.hpp @@ -157,7 +157,7 @@ double BestBinaryCategoricalSplit::SplitIfBetter( AuxiliarySplitInfo& aux, FitnessFunction& fitnessFunction) { - static_assert(std::is_same::value, + static_assert(std::is_same_v, "BestBinaryCategoricalSplit: regression FitnessFunction must be " "MSEGain."); const size_t n = data.n_elem; diff --git a/src/mlpack/methods/decision_tree/splits/best_binary_numeric_split.hpp b/src/mlpack/methods/decision_tree/splits/best_binary_numeric_split.hpp index bc1adac8f9..3857ff9cd5 100644 --- a/src/mlpack/methods/decision_tree/splits/best_binary_numeric_split.hpp +++ b/src/mlpack/methods/decision_tree/splits/best_binary_numeric_split.hpp @@ -108,9 +108,9 @@ class BestBinaryNumericSplit */ template - static typename std::enable_if< + static std::enable_if_t< !HasOptimizedBinarySplitForms::value, - double>::type + double> SplitIfBetter( const double bestGain, const VecType& data, @@ -145,9 +145,9 @@ class BestBinaryNumericSplit */ template - static typename std::enable_if< + static std::enable_if_t< HasOptimizedBinarySplitForms::value, - double>::type + double> SplitIfBetter( const double bestGain, const VecType& data, diff --git a/src/mlpack/methods/decision_tree/splits/best_binary_numeric_split_impl.hpp b/src/mlpack/methods/decision_tree/splits/best_binary_numeric_split_impl.hpp index a5717e2347..4687506a16 100644 --- a/src/mlpack/methods/decision_tree/splits/best_binary_numeric_split_impl.hpp +++ b/src/mlpack/methods/decision_tree/splits/best_binary_numeric_split_impl.hpp @@ -207,9 +207,9 @@ double BestBinaryNumericSplit::SplitIfBetter( template template -typename std::enable_if< +std::enable_if_t< !HasOptimizedBinarySplitForms::value, - double>::type + double> BestBinaryNumericSplit::SplitIfBetter( const double bestGain, const VecType& data, @@ -363,9 +363,9 @@ BestBinaryNumericSplit::SplitIfBetter( template template -typename std::enable_if< +std::enable_if_t< HasOptimizedBinarySplitForms::value, - double>::type + double> BestBinaryNumericSplit::SplitIfBetter( const double bestGain, const VecType& data, diff --git a/src/mlpack/methods/det/dtree_impl.hpp b/src/mlpack/methods/det/dtree_impl.hpp index fe1100b178..e62c851f9e 100644 --- a/src/mlpack/methods/det/dtree_impl.hpp +++ b/src/mlpack/methods/det/dtree_impl.hpp @@ -30,7 +30,7 @@ void ExtractSplits(std::vector>& splitVec, const size_t minLeafSize) { static_assert( - std::is_same::value == true, + std::is_same_v == true, "The ElemType does not correspond to the matrix's element type."); typedef std::pair SplitItem; diff --git a/src/mlpack/methods/gmm/em_fit_impl.hpp b/src/mlpack/methods/gmm/em_fit_impl.hpp index 19fc220b7d..485d147c02 100644 --- a/src/mlpack/methods/gmm/em_fit_impl.hpp +++ b/src/mlpack/methods/gmm/em_fit_impl.hpp @@ -44,7 +44,7 @@ Estimate(const arma::mat& observations, arma::vec& weights, const bool useInitialModel) { - if (std::is_same>::value) + if (std::is_same_v>) { #ifdef _WIN32 Log::Warn << "Cannot use arma::gmm_diag on Visual Studio due to OpenMP" @@ -55,8 +55,8 @@ Estimate(const arma::mat& observations, return; #endif } - else if (std::is_same::value - && std::is_same>::value) + else if (std::is_same_v + && std::is_same_v>) { // EMFit::Estimate() using DiagonalConstraint with GaussianDistribution // makes use of slower implementation. @@ -129,7 +129,7 @@ Estimate(const arma::mat& observations, // If the distribution is DiagonalGaussianDistribution, calculate the // covariance only with diagonal components. - if (std::is_same>::value) + if (std::is_same_v>) { arma::vec covariance = sum((tmp % tmp) % (ones(observations.n_rows) * @@ -240,7 +240,7 @@ Estimate(const arma::mat& observations, // If the distribution is DiagonalGaussianDistribution, calculate the // covariance only with diagonal components. - if (std::is_same>::value) + if (std::is_same_v>) { arma::vec cov = sum((tmp % tmp) % (ones(observations.n_rows) * @@ -292,8 +292,8 @@ InitialClustering(const arma::mat& observations, // Check if the type of Distribution is DiagonalGaussianDistribution. If so, // we can get faster performance by using diagonal elements when calculating // the covariance. - const bool isDiagGaussDist = std::is_same>::value; + const bool isDiagGaussDist = std::is_same_v>; std::vector means(dists.size()); @@ -437,7 +437,7 @@ ArmadilloGMMWrapper(const arma::mat& observations, // Armadillo's implementation. If mlpack ever changes k-means defaults to use // something that is reliably quicker than the Lloyd iteration k-means update, // then this code maybe should be revisited. - if (!std::is_same>::value || useInitialModel) + if (!std::is_same_v> || useInitialModel) { // Use clusterer to get initial values. if (!useInitialModel) diff --git a/src/mlpack/methods/gmm/positive_definite_constraint.hpp b/src/mlpack/methods/gmm/positive_definite_constraint.hpp index 23742975bb..a153533ded 100644 --- a/src/mlpack/methods/gmm/positive_definite_constraint.hpp +++ b/src/mlpack/methods/gmm/positive_definite_constraint.hpp @@ -35,7 +35,7 @@ class PositiveDefiniteConstraint template static void ApplyConstraint( MatType& covariance, - const typename std::enable_if::value>::type* + const std::enable_if_t::value>* /* junk */ = 0) { typedef typename MatType::elem_type ElemType; @@ -82,7 +82,7 @@ class PositiveDefiniteConstraint template static void ApplyConstraint( VecType& diagCovariance, - const typename std::enable_if::value>::type* + const std::enable_if_t::value>* /* junk */ = 0) { typedef typename VecType::elem_type ElemType; diff --git a/src/mlpack/methods/kde/kde_impl.hpp b/src/mlpack/methods/kde/kde_impl.hpp index 4bf4b939c0..6e5fe10fed 100644 --- a/src/mlpack/methods/kde/kde_impl.hpp +++ b/src/mlpack/methods/kde/kde_impl.hpp @@ -498,7 +498,7 @@ Evaluate(Tree* queryTree, } // Clean accumulated alpha if Monte Carlo estimations are available. - if (monteCarlo && std::is_same::value) + if (monteCarlo && std::is_same_v) { KDECleanRules cleanRules; SingleTreeTraversalType> cleanTraverser(cleanRules); @@ -562,7 +562,7 @@ Evaluate(arma::vec& estimations) estimations.fill(arma::fill::zeros); // Clean accumulated alpha if Monte Carlo estimations are available. - if (monteCarlo && std::is_same::value) + if (monteCarlo && std::is_same_v) { KDECleanRules cleanRules; SingleTreeTraversalType> cleanTraverser(cleanRules); diff --git a/src/mlpack/methods/kde/kde_model.hpp b/src/mlpack/methods/kde/kde_model.hpp index 835c883a94..e520405f14 100644 --- a/src/mlpack/methods/kde/kde_model.hpp +++ b/src/mlpack/methods/kde/kde_model.hpp @@ -43,9 +43,9 @@ class KernelNormalizer KernelType& /* kernel */, const size_t /* dimension */, arma::vec& /* estimations */, - const typename std::enable_if< - !HasNormalizer::value>:: - type* = 0) + const std::enable_if_t< + !HasNormalizer::value>* + = 0) { return; } //! Normalize kernels that have normalizer. @@ -54,9 +54,9 @@ class KernelNormalizer KernelType& kernel, const size_t dimension, arma::vec& estimations, - const typename std::enable_if< - HasNormalizer::value>:: - type* = 0) + const std::enable_if_t< + HasNormalizer::value>* + = 0) { estimations /= kernel.Normalizer(dimension); } diff --git a/src/mlpack/methods/kde/kde_rules.hpp b/src/mlpack/methods/kde/kde_rules.hpp index 671abbc478..1a77894c40 100644 --- a/src/mlpack/methods/kde/kde_rules.hpp +++ b/src/mlpack/methods/kde/kde_rules.hpp @@ -159,7 +159,7 @@ class KDERules //! Whether the kernel used for the rule is the Gaussian Kernel. constexpr static bool kernelIsGaussian = - std::is_same::value; + std::is_same_v; //! Absolute error tolerance available for each reference point. const double absErrorTol; diff --git a/src/mlpack/methods/kmeans/dual_tree_kmeans_impl.hpp b/src/mlpack/methods/kmeans/dual_tree_kmeans_impl.hpp index 8181b49512..691e8b75e8 100644 --- a/src/mlpack/methods/kmeans/dual_tree_kmeans_impl.hpp +++ b/src/mlpack/methods/kmeans/dual_tree_kmeans_impl.hpp @@ -27,8 +27,8 @@ template TreeType* BuildForcedLeafSizeTree( MatType&& dataset, std::vector& oldFromNew, - const typename std::enable_if< - TreeTraits::RearrangesDataset>::type* = 0) + const std::enable_if_t< + TreeTraits::RearrangesDataset>* = 0) { // This is a hack. I know this will be BinarySpaceTree, so force a leaf size // of one. @@ -40,8 +40,8 @@ template TreeType* BuildForcedLeafSizeTree( MatType&& dataset, const std::vector& /* oldFromNew */, - const typename std::enable_if< - !TreeTraits::RearrangesDataset>::type* = 0) + const std::enable_if_t< + !TreeTraits::RearrangesDataset>* = 0) { return new TreeType(std::forward(dataset)); } diff --git a/src/mlpack/methods/lars/lars.hpp b/src/mlpack/methods/lars/lars.hpp index 32bf5c6b7e..fa001aba96 100644 --- a/src/mlpack/methods/lars/lars.hpp +++ b/src/mlpack/methods/lars/lars.hpp @@ -165,9 +165,9 @@ class LARS */ template::value - >::type> + typename = std::enable_if_t< + std::is_same_v + >> LARS(const MatType& data, const ResponsesType& responses, bool colMajor = true, @@ -204,9 +204,9 @@ class LARS */ template::value - >::type> + typename = std::enable_if_t< + std::is_same_v + >> LARS(const MatType& data, const ResponsesType& responses, const bool colMajor, @@ -296,12 +296,12 @@ class LARS template::value - >::type, - typename = typename std::enable_if< - !std::is_same::value - >::type> + typename = std::enable_if_t< + std::is_same_v + >, + typename = std::enable_if_t< + !std::is_same_v + >> ElemType Train(const MatType& data, const ResponsesType& responses, const bool colMajor = true); @@ -309,9 +309,9 @@ class LARS template::value - >::type> + typename = std::enable_if_t< + std::is_same_v + >> ElemType Train(const MatType& data, const ResponsesType& responses, const bool colMajor, @@ -320,9 +320,9 @@ class LARS template::value - >::type> + typename = std::enable_if_t< + std::is_same_v + >> ElemType Train(const MatType& data, const ResponsesType& responses, const bool colMajor, @@ -332,9 +332,9 @@ class LARS template::value - >::type> + typename = std::enable_if_t< + std::is_same_v + >> ElemType Train(const MatType& data, const ResponsesType& responses, const bool colMajor, @@ -345,9 +345,9 @@ class LARS template::value - >::type> + typename = std::enable_if_t< + std::is_same_v + >> ElemType Train(const MatType& data, const ResponsesType& responses, const bool colMajor, @@ -359,9 +359,9 @@ class LARS template::value - >::type> + typename = std::enable_if_t< + std::is_same_v + >> ElemType Train(const MatType& data, const ResponsesType& responses, const bool colMajor, @@ -374,9 +374,9 @@ class LARS template::value - >::type> + typename = std::enable_if_t< + std::is_same_v + >> ElemType Train(const MatType& data, const ResponsesType& responses, const bool colMajor, @@ -407,9 +407,9 @@ class LARS template::value - >::type> + typename = std::enable_if_t< + std::is_same_v + >> ElemType Train(const MatType& data, const ResponsesType& responses, const bool colMajor, @@ -419,9 +419,9 @@ class LARS template::value - >::type> + typename = std::enable_if_t< + std::is_same_v + >> ElemType Train(const MatType& data, const ResponsesType& responses, const bool colMajor, @@ -432,9 +432,9 @@ class LARS template::value - >::type> + typename = std::enable_if_t< + std::is_same_v + >> ElemType Train(const MatType& data, const ResponsesType& responses, const bool colMajor, @@ -446,9 +446,9 @@ class LARS template::value - >::type> + typename = std::enable_if_t< + std::is_same_v + >> ElemType Train(const MatType& data, const ResponsesType& responses, const bool colMajor, @@ -461,9 +461,9 @@ class LARS template::value - >::type> + typename = std::enable_if_t< + std::is_same_v + >> ElemType Train(const MatType& data, const ResponsesType& responses, const bool colMajor, @@ -477,9 +477,9 @@ class LARS template::value - >::type> + typename = std::enable_if_t< + std::is_same_v + >> ElemType Train(const MatType& data, const ResponsesType& responses, const bool colMajor, diff --git a/src/mlpack/methods/linear_regression/linear_regression.hpp b/src/mlpack/methods/linear_regression/linear_regression.hpp index 71d28e1933..639d23eb01 100644 --- a/src/mlpack/methods/linear_regression/linear_regression.hpp +++ b/src/mlpack/methods/linear_regression/linear_regression.hpp @@ -43,9 +43,9 @@ class LinearRegression */ template::value - >::type> + typename = std::enable_if_t< + std::is_same_v + >> LinearRegression(const MatType& predictors, const ResponsesType& responses, const double lambda = 0, @@ -63,12 +63,12 @@ class LinearRegression template::value - >::type, - typename = typename std::enable_if< - std::is_same::value - >::type> + typename = std::enable_if_t< + std::is_same_v + >, + typename = std::enable_if_t< + std::is_same_v + >> LinearRegression(const MatType& predictors, const ResponsesType& responses, const WeightsType& weights, @@ -103,8 +103,8 @@ class LinearRegression double Train(const arma::mat& predictors, const arma::rowvec& responses, const T intercept, - const typename std::enable_if::value - >::type* = 0); + const std::enable_if_t + >* = 0); /** * Train the LinearRegression model on the given data and instance weights. @@ -129,8 +129,8 @@ class LinearRegression const arma::rowvec& responses, const arma::rowvec& weights, const T intercept, - const typename std::enable_if::value - >::type* = 0); + const std::enable_if_t + >* = 0); /** * Train the LinearRegression model. This is a dummy overload so that @@ -157,9 +157,9 @@ class LinearRegression template::value - >::type> + typename = std::enable_if_t< + std::is_same_v + >> ElemType Train(const MatType& predictors, const ResponsesType& responses, const std::optional lambda = std::nullopt, @@ -192,12 +192,12 @@ class LinearRegression template::value - >::type, - typename = typename std::enable_if< - std::is_same::value - >::type> + typename = std::enable_if_t< + std::is_same_v + >, + typename = std::enable_if_t< + std::is_same_v + >> ElemType Train(const MatType& predictors, const ResponsesType& responses, const WeightsType& weights, diff --git a/src/mlpack/methods/linear_regression/linear_regression_impl.hpp b/src/mlpack/methods/linear_regression/linear_regression_impl.hpp index 1b3569d1e8..7676370ef3 100644 --- a/src/mlpack/methods/linear_regression/linear_regression_impl.hpp +++ b/src/mlpack/methods/linear_regression/linear_regression_impl.hpp @@ -51,7 +51,7 @@ inline double LinearRegression::Train( const arma::mat& predictors, const arma::rowvec& responses, const T intercept, - const typename std::enable_if::value>::type*) + const std::enable_if_t>*) { return Train(predictors, responses, arma::rowvec(), this->lambda, intercept); } @@ -63,7 +63,7 @@ inline double LinearRegression::Train( const arma::rowvec& responses, const arma::rowvec& weights, const T intercept, - const typename std::enable_if::value>::type*) + const std::enable_if_t>*) { return Train(predictors, responses, weights, this->lambda, intercept); } diff --git a/src/mlpack/methods/linear_svm/linear_svm.hpp b/src/mlpack/methods/linear_svm/linear_svm.hpp index 61fb7875f6..dd680da97b 100644 --- a/src/mlpack/methods/linear_svm/linear_svm.hpp +++ b/src/mlpack/methods/linear_svm/linear_svm.hpp @@ -135,14 +135,14 @@ class LinearSVM */ template, ModelMatType - >::value>::type, - typename = typename std::enable_if::value>, + typename = std::enable_if_t::value>::type> + >::value>> [[deprecated("Will be removed in mlpack 5.0.0, use other constructors")]] LinearSVM(const arma::mat& data, const arma::Row& labels, @@ -173,11 +173,11 @@ class LinearSVM * @param optimizer Desired optimizer. */ template, ModelMatType - >::value>::type> + >::value>> [[deprecated("Will be removed in mlpack 5.0.0, use other constructors")]] LinearSVM(const arma::mat& data, const arma::Row& labels, @@ -203,9 +203,9 @@ class LinearSVM */ template::value>::type> + >::value>> LinearSVM(const MatType& data, const arma::Row& labels, const size_t numClasses, @@ -232,9 +232,9 @@ class LinearSVM template::value>::type> + >::value>> LinearSVM(const MatType& data, const arma::Row& labels, const size_t numClasses, @@ -259,9 +259,9 @@ class LinearSVM */ template::value>::type> + >::value>> ElemType Train(const MatType& data, const arma::Row& labels, const size_t numClasses, @@ -269,9 +269,9 @@ class LinearSVM template::value>::type> + >::value>> ElemType Train(const MatType& data, const arma::Row& labels, const size_t numClasses, @@ -299,14 +299,14 @@ class LinearSVM template, ModelMatType - >::value>::type, - typename = typename std::enable_if::value>, + typename = std::enable_if_t::value>::type> + >::value>> ElemType Train(const MatType& data, const arma::Row& labels, const size_t numClasses, @@ -316,14 +316,14 @@ class LinearSVM template, ModelMatType - >::value>::type, - typename = typename std::enable_if::value>, + typename = std::enable_if_t::value>::type> + >::value>> ElemType Train(const MatType& data, const arma::Row& labels, const size_t numClasses, diff --git a/src/mlpack/methods/lmnn/lmnn.hpp b/src/mlpack/methods/lmnn/lmnn.hpp index 8dadc5b31e..6f62734b4b 100644 --- a/src/mlpack/methods/lmnn/lmnn.hpp +++ b/src/mlpack/methods/lmnn/lmnn.hpp @@ -97,12 +97,12 @@ class LMNN * See https://www.ensmallen.org/docs.html#callback-documentation. */ template::value>::type, - typename = typename std::enable_if< + >::value>, + typename = std::enable_if_t< !FirstElementIsArma::value - >::type> + >> [[deprecated("Will be removed in mlpack 5.0.0. Use the version that takes a " "dataset as a parameter.")]] void LearnDistance(arma::mat& outputMatrix, CallbackTypes&&... callbacks); @@ -122,14 +122,14 @@ class LMNN template::type, LMNNFunction, MatType - >::value>::type, - typename = typename std::enable_if::value>, + typename = std::enable_if_t::value>::type> + >::value>> void LearnDistance(const MatType& dataset, const LabelsType& labels, MatType& outputMatrix, @@ -152,11 +152,11 @@ class LMNN typename LabelsType, typename OptimizerType, typename... CallbackTypes, - typename = typename std::enable_if, MatType - >::value>::type> + >::value>> void LearnDistance(const MatType& dataset, const LabelsType& labels, MatType& outputMatrix, diff --git a/src/mlpack/methods/local_coordinate_coding/lcc_impl.hpp b/src/mlpack/methods/local_coordinate_coding/lcc_impl.hpp index 2894d015f6..f7d9c7090c 100644 --- a/src/mlpack/methods/local_coordinate_coding/lcc_impl.hpp +++ b/src/mlpack/methods/local_coordinate_coding/lcc_impl.hpp @@ -145,7 +145,7 @@ inline void LocalCoordinateCoding::Encode(const MatType& data, bool useCholesky = false; // Normalization and fitting and intercept are disabled. - const double tol = std::is_same::value ? + const double tol = std::is_same_v ? 1e-8 : 1e-16; LARS lars(useCholesky, 0.5 * lambda, 0, tol, false, false); diff --git a/src/mlpack/methods/logistic_regression/logistic_regression.hpp b/src/mlpack/methods/logistic_regression/logistic_regression.hpp index 37fddf2f15..6dd06dbd00 100644 --- a/src/mlpack/methods/logistic_regression/logistic_regression.hpp +++ b/src/mlpack/methods/logistic_regression/logistic_regression.hpp @@ -67,9 +67,9 @@ class LogisticRegression * @param lambda L2-regularization parameter. */ template::value>::type> + >::value>> LogisticRegression(const MatType& predictors, const arma::Row& responses, const double lambda = 0.0, @@ -91,9 +91,9 @@ class LogisticRegression * (L-BFGS). */ template::value>::type> + >::value>> LogisticRegression(const MatType& predictors, const arma::Row& responses, const RowType& initialPoint, @@ -117,12 +117,12 @@ class LogisticRegression */ template, RowType - >::value>::type, - typename = typename std::enable_if::value>, + typename = std::enable_if_t::value>::type> + >::value>> LogisticRegression(const MatType& predictors, const arma::Row& responses, OptimizerType& optimizer, @@ -147,12 +147,12 @@ class LogisticRegression */ template, RowType - >::value>::type, - typename = typename std::enable_if::value>, + typename = std::enable_if_t::value>::type> + >::value>> LogisticRegression(const MatType& predictors, const arma::Row& responses, OptimizerType& optimizer, @@ -179,9 +179,9 @@ class LogisticRegression */ template::value>::type> + >::value>> ElemType Train(const MatType& predictors, const arma::Row& responses, CallbackTypes&&... callbacks); @@ -206,9 +206,9 @@ class LogisticRegression */ template::value>::type> + >::value>> ElemType Train(const MatType& predictors, const arma::Row& responses, const double lambda, @@ -234,12 +234,12 @@ class LogisticRegression */ template, RowType - >::value>::type, - typename = typename std::enable_if::value>, + typename = std::enable_if_t::value>::type> + >::value>> ElemType Train(const MatType& predictors, const arma::Row& responses, OptimizerType& optimizer, @@ -266,12 +266,12 @@ class LogisticRegression */ template, RowType - >::value>::type, - typename = typename std::enable_if::value>, + typename = std::enable_if_t::value>::type> + >::value>> ElemType Train(const MatType& predictors, const arma::Row& responses, OptimizerType& optimizer, diff --git a/src/mlpack/methods/mean_shift/mean_shift.hpp b/src/mlpack/methods/mean_shift/mean_shift.hpp index 6316daa8b6..08e8507ecd 100644 --- a/src/mlpack/methods/mean_shift/mean_shift.hpp +++ b/src/mlpack/methods/mean_shift/mean_shift.hpp @@ -155,7 +155,7 @@ class MeanShift # @param centroid Store calculated centroid */ template - typename std::enable_if::type + std::enable_if_t CalculateCentroid(const MatType& data, const std::vector& neighbors, const std::vector& distances, @@ -170,7 +170,7 @@ class MeanShift # @param centroid Store calculated centroid */ template - typename std::enable_if::type + std::enable_if_t CalculateCentroid(const MatType& data, const std::vector& neighbors, const std::vector&, /*unused*/ diff --git a/src/mlpack/methods/mean_shift/mean_shift_impl.hpp b/src/mlpack/methods/mean_shift/mean_shift_impl.hpp index e3ea0dd09e..9c8faa7154 100644 --- a/src/mlpack/methods/mean_shift/mean_shift_impl.hpp +++ b/src/mlpack/methods/mean_shift/mean_shift_impl.hpp @@ -131,7 +131,7 @@ void MeanShift::GenSeeds(const MatType& data, // Calculate new centroid with given kernel. template template -typename std::enable_if::type +std::enable_if_t MeanShift::CalculateCentroid( const MatType& data, const std::vector& neighbors, @@ -163,7 +163,7 @@ MeanShift::CalculateCentroid( // Calculate new centroid by mean. template template -typename std::enable_if::type +std::enable_if_t MeanShift::CalculateCentroid( const MatType& data, const std::vector& neighbors, diff --git a/src/mlpack/methods/naive_bayes/naive_bayes_classifier_impl.hpp b/src/mlpack/methods/naive_bayes/naive_bayes_classifier_impl.hpp index 877079ae12..7e8ced7b3c 100644 --- a/src/mlpack/methods/naive_bayes/naive_bayes_classifier_impl.hpp +++ b/src/mlpack/methods/naive_bayes/naive_bayes_classifier_impl.hpp @@ -35,7 +35,7 @@ NaiveBayesClassifier::NaiveBayesClassifier( trainingPoints(0), // Set when we call Train(). epsilon(epsilon) { - static_assert(std::is_same::value, + static_assert(std::is_same_v, "NaiveBayesClassifier: element type of given data must match the element " "type of the model!"); @@ -82,7 +82,7 @@ void NaiveBayesClassifier::Train( const size_t numClasses, const bool incremental) { - static_assert(std::is_same::value, + static_assert(std::is_same_v, "NaiveBayesClassifier: element type of given data must match the element " "type of the model!"); @@ -178,7 +178,7 @@ template void NaiveBayesClassifier::Train(const VecType& point, const size_t label) { - static_assert(std::is_same::value, + static_assert(std::is_same_v, "NaiveBayesClassifier: element type of given data must match the element " "type of the model!"); @@ -213,7 +213,7 @@ void NaiveBayesClassifier::LogLikelihood( const MatType& data, ModelMatType& logLikelihoods) const { - static_assert(std::is_same::value, + static_assert(std::is_same_v, "NaiveBayesClassifier: element type of given data must match the element " "type of the model!"); @@ -241,7 +241,7 @@ template template size_t NaiveBayesClassifier::Classify(const VecType& point) const { - static_assert(std::is_same::value, + static_assert(std::is_same_v, "NaiveBayesClassifier: element type of given data must match the element " "type of the model!"); @@ -270,11 +270,11 @@ void NaiveBayesClassifier::Classify( size_t& prediction, ProbabilitiesVecType& probabilities) const { - static_assert(std::is_same::value, + static_assert(std::is_same_v, "NaiveBayesClassifier: element type of given data must match the element " "type of the model!"); - static_assert(std::is_same::value, + static_assert(std::is_same_v, "NaiveBayesClassifier: element type of given data must match the element " "type of the model!"); @@ -312,7 +312,7 @@ void NaiveBayesClassifier::Classify( const MatType& data, arma::Row& predictions) const { - static_assert(std::is_same::value, + static_assert(std::is_same_v, "NaiveBayesClassifier: element type of given data must match the element " "type of the model!"); @@ -345,11 +345,11 @@ void NaiveBayesClassifier::Classify( arma::Row& predictions, ProbabilitiesMatType& predictionProbs) const { - static_assert(std::is_same::value, + static_assert(std::is_same_v, "NaiveBayesClassifier: element type of given data must match the element " "type of the model!"); - static_assert(std::is_same::value, + static_assert(std::is_same_v, "NaiveBayesClassifier: element type of given data must match the element " "type of the model!"); diff --git a/src/mlpack/methods/nca/nca.hpp b/src/mlpack/methods/nca/nca.hpp index fd66154b28..1d68ef4db3 100644 --- a/src/mlpack/methods/nca/nca.hpp +++ b/src/mlpack/methods/nca/nca.hpp @@ -80,12 +80,12 @@ class NCA * See https://www.ensmallen.org/docs.html#callback-documentation. */ template::value>::type, - typename = typename std::enable_if< + >::value>, + typename = std::enable_if_t< !FirstElementIsArma::value - >::type> + >> [[deprecated("Will be removed in mlpack 5.0.0. Use the version that takes a " "dataset as a parameter.")]] void LearnDistance(arma::mat& outputMatrix, CallbackTypes&&... callbacks); @@ -106,14 +106,14 @@ class NCA template::type, SoftmaxErrorFunction, MatType - >::value>::type, - typename = typename std::enable_if::value>, + typename = std::enable_if_t::value>::type> + >::value>> void LearnDistance(const MatType& dataset, const LabelsType& labels, MatType& outputMatrix, @@ -137,11 +137,11 @@ class NCA typename LabelsType, typename OptimizerType, typename... CallbackTypes, - typename = typename std::enable_if, MatType - >::value>::type> + >::value>> void LearnDistance(const MatType& dataset, const LabelsType& labels, MatType& outputMatrix, diff --git a/src/mlpack/methods/pca/pca_impl.hpp b/src/mlpack/methods/pca/pca_impl.hpp index 865c968300..d8da5362bc 100644 --- a/src/mlpack/methods/pca/pca_impl.hpp +++ b/src/mlpack/methods/pca/pca_impl.hpp @@ -47,8 +47,8 @@ void PCA::Apply(const MatType& data, "PCA::Apply(): transformedData must be a matrix type!"); static_assert(IsBaseMatType::value, "PCA::Apply(): eigVal must be a vector type!"); - static_assert(std::is_same::value, + static_assert(std::is_same_v, "PCA::Apply(): data and transformedData must have the same element " "types!"); @@ -81,8 +81,8 @@ void PCA::Apply(const MatType& data, "PCA::Apply(): transformedData must be a matrix type!"); static_assert(IsBaseMatType::value, "PCA::Apply(): eigVal must be a vector type!"); - static_assert(std::is_same::value, + static_assert(std::is_same_v, "PCA::Apply(): data and transformedData must have the same element " "types!"); @@ -104,8 +104,8 @@ void PCA::Apply(const MatType& data, // Sanity checks on input types. static_assert(IsBaseMatType::value, "PCA::Apply(): transformedData must be a matrix type!"); - static_assert(std::is_same::value, + static_assert(std::is_same_v, "PCA::Apply(): data and transformedData must have the same element " "types!"); diff --git a/src/mlpack/methods/perceptron/perceptron.hpp b/src/mlpack/methods/perceptron/perceptron.hpp index 1988d980b6..dccc250975 100644 --- a/src/mlpack/methods/perceptron/perceptron.hpp +++ b/src/mlpack/methods/perceptron/perceptron.hpp @@ -92,8 +92,8 @@ class Perceptron const size_t numClasses, const WeightsType& instanceWeights, const size_t maxIterations = 1000, - const typename std::enable_if< - arma::is_arma_type::value>::type* = 0); + const std::enable_if_t< + arma::is_arma_type::value>* = 0); /** * Alternate constructor which copies parameters from an already initiated @@ -114,8 +114,8 @@ class Perceptron const arma::Row& labels, const size_t numClasses, const WeightsType& instanceWeights, - const typename std::enable_if< - arma::is_arma_type::value>::type* = 0); + const std::enable_if_t< + arma::is_arma_type::value>* = 0); /** * Train the perceptron on the given data for up to the given maximum number diff --git a/src/mlpack/methods/perceptron/perceptron_impl.hpp b/src/mlpack/methods/perceptron/perceptron_impl.hpp index 28f02a8f4d..b8dcc740e8 100644 --- a/src/mlpack/methods/perceptron/perceptron_impl.hpp +++ b/src/mlpack/methods/perceptron/perceptron_impl.hpp @@ -83,8 +83,8 @@ Perceptron::Perceptron( const size_t numClasses, const WeightsType& instanceWeights, const size_t maxIterations, - const typename std::enable_if< - arma::is_arma_type::value>::type*) : + const std::enable_if_t< + arma::is_arma_type::value>*) : maxIterations(maxIterations) { // Start training. @@ -114,8 +114,8 @@ Perceptron::Perceptron( const arma::Row& labels, const size_t numClasses, const WeightsType& instanceWeights, - const typename std::enable_if< - arma::is_arma_type::value>::type*) : + const std::enable_if_t< + arma::is_arma_type::value>*) : maxIterations(other.maxIterations) { TrainInternal(data, labels, numClasses, instanceWeights); diff --git a/src/mlpack/methods/softmax_regression/softmax_regression.hpp b/src/mlpack/methods/softmax_regression/softmax_regression.hpp index fb5f3b0c57..8ce97ab28d 100644 --- a/src/mlpack/methods/softmax_regression/softmax_regression.hpp +++ b/src/mlpack/methods/softmax_regression/softmax_regression.hpp @@ -93,12 +93,12 @@ class SoftmaxRegression */ template, DenseMatType - >::value>::type, - typename = typename std::enable_if::value>, + typename = std::enable_if_t::value>::type> + >::value>> SoftmaxRegression(const MatType& data, const arma::Row& labels, const size_t numClasses, @@ -125,12 +125,12 @@ class SoftmaxRegression */ template, DenseMatType - >::value>::type, - typename = typename std::enable_if::value>, + typename = std::enable_if_t::value>::type> + >::value>> SoftmaxRegression(const MatType& data, const arma::Row& labels, const size_t numClasses, @@ -158,15 +158,15 @@ class SoftmaxRegression template, DenseMatType - >::value>::type, - typename = typename std::enable_if< - std::is_class::value - >::type, - typename = typename std::enable_if::value>, + typename = std::enable_if_t< + std::is_class_v + >, + typename = std::enable_if_t::value>::type> + >::value>> [[deprecated("Will be removed in mlpack 5.0.0, use other Train() variants")]] double Train(const MatType& data, const arma::Row& labels, @@ -191,12 +191,12 @@ class SoftmaxRegression */ template, DenseMatType - >::value>::type, - typename = typename std::enable_if::value>, + typename = std::enable_if_t::value>::type> + >::value>> ElemType Train(const MatType& data, const arma::Row& labels, const size_t numClasses, @@ -221,12 +221,12 @@ class SoftmaxRegression */ template, DenseMatType - >::value>::type, - typename = typename std::enable_if::value>, + typename = std::enable_if_t::value>::type> + >::value>> ElemType Train(const MatType& data, const arma::Row& labels, const size_t numClasses, diff --git a/src/mlpack/tests/cv_test.cpp b/src/mlpack/tests/cv_test.cpp index b78e651f9d..a5ff8dc001 100644 --- a/src/mlpack/tests/cv_test.cpp +++ b/src/mlpack/tests/cv_test.cpp @@ -299,7 +299,7 @@ void CheckPredictionsType() { using Extractor = MetaInfoExtractor; using ActualPT = typename Extractor::PredictionsType; - static_assert(std::is_same::value, + static_assert(std::is_same_v, "Should be the same"); } @@ -350,7 +350,7 @@ void CheckWeightsType() { using Extractor = MetaInfoExtractor; using ActualWT = typename Extractor::WeightsType; - static_assert(std::is_same::value, + static_assert(std::is_same_v, "Should be the same"); } diff --git a/src/mlpack/tests/distribution_test.cpp b/src/mlpack/tests/distribution_test.cpp index ac73f2ad8b..b1325d557c 100644 --- a/src/mlpack/tests/distribution_test.cpp +++ b/src/mlpack/tests/distribution_test.cpp @@ -454,7 +454,7 @@ TEMPLATE_TEST_CASE("GaussianUnivariateProbabilityTest", "[DistributionTest]", typedef typename arma::Col VecType; typedef typename arma::Mat MatType; - const ElemType tol = (std::is_same::value) ? 1e-4 : 1e-7; + const ElemType tol = (std::is_same_v) ? 1e-4 : 1e-7; GaussianDistribution g(VecType("0.0"), MatType("1.0")); @@ -500,7 +500,7 @@ TEMPLATE_TEST_CASE("GaussianMultivariateProbabilityTest", "[DistributionTest]", typedef typename arma::Col VecType; typedef typename arma::Mat MatType; - const ElemType tol = (std::is_same::value) ? 1e-4 : 1e-7; + const ElemType tol = (std::is_same_v) ? 1e-4 : 1e-7; // Simple case. VecType mean = "0 0"; @@ -611,7 +611,7 @@ TEMPLATE_TEST_CASE("GaussianDistributionRandomTest", "[DistributionTest]", typedef typename arma::Col VecType; typedef typename arma::Mat MatType; - const ElemType tol = (std::is_same::value) ? 0.3 : 0.125; + const ElemType tol = (std::is_same_v) ? 0.3 : 0.125; VecType mean("1.0 2.25"); MatType cov("0.85 0.60;" @@ -648,7 +648,7 @@ TEMPLATE_TEST_CASE("GaussianDistributionTrainTest", "[DistributionTest]", float, typedef typename arma::Col VecType; typedef typename arma::Mat MatType; - const ElemType tol = (std::is_same::value) ? 1e-3 : 1e-5; + const ElemType tol = (std::is_same_v) ? 1e-3 : 1e-5; VecType mean("1.0 3.0 0.0 2.5"); MatType cov("3.0 0.0 1.0 4.0;" @@ -695,7 +695,7 @@ TEMPLATE_TEST_CASE("GaussianDistributionTrainWithProbabilitiesTest", typedef typename arma::Col VecType; typedef typename arma::Mat MatType; - const ElemType tol = (std::is_same::value) ? 0.25 : 0.1; + const ElemType tol = (std::is_same_v) ? 0.25 : 0.1; VecType mean = ("5.0"); VecType cov = ("2.0"); @@ -739,8 +739,8 @@ TEMPLATE_TEST_CASE("GaussianDistributionWithProbabilties1Test", typedef typename arma::Col VecType; typedef typename arma::Mat MatType; - const ElemType tol1 = (std::is_same::value) ? 1e-10 : 1e-17; - const ElemType tol2 = (std::is_same::value) ? 1e-2 : 1e-4; + const ElemType tol1 = (std::is_same_v) ? 1e-10 : 1e-17; + const ElemType tol2 = (std::is_same_v) ? 1e-2 : 1e-4; VecType mean = ("5.0"); VecType cov = ("4.0"); @@ -891,7 +891,7 @@ TEMPLATE_TEST_CASE("GammaDistributionTrainWithProbabilitiesTest", typedef typename arma::Col VecType; typedef typename arma::Mat MatType; - const ElemType tol = (std::is_same::value) ? 0.03 : 0.015; + const ElemType tol = (std::is_same_v) ? 0.03 : 0.015; ElemType alphaReal = 5.4; ElemType betaReal = 6.7; @@ -986,7 +986,7 @@ TEMPLATE_TEST_CASE("GammaDistributionTrainTwoDistProbabilities1Test", typedef typename arma::Col VecType; typedef typename arma::Mat MatType; - const ElemType tol = (std::is_same::value) ? 0.25 : 0.075; + const ElemType tol = (std::is_same_v) ? 0.25 : 0.075; ElemType alphaReal = 5.4; ElemType betaReal = 6.7; @@ -1275,7 +1275,7 @@ TEMPLATE_TEST_CASE("DiscreteDistributionTest", "[DistributionTest]", typedef typename arma::Col ObsVecType; typedef typename arma::Mat ObsMatType; - const ElemType tol = (std::is_same::value) ? 1e-4 : 1e-8; + const ElemType tol = (std::is_same_v) ? 1e-4 : 1e-8; // I assume that I am properly saving vectors, so, this should be // straightforward. @@ -1600,7 +1600,7 @@ TEMPLATE_TEST_CASE("DiagonalGaussianUnivariateProbabilityTest", typedef typename arma::Col VecType; typedef typename arma::Mat MatType; - const ElemType tol = (std::is_same::value) ? 1e-4 : 1e-7; + const ElemType tol = (std::is_same_v) ? 1e-4 : 1e-7; DiagonalGaussianDistribution d(VecType("0.0"), VecType("1.0")); @@ -1640,7 +1640,7 @@ TEMPLATE_TEST_CASE("DiagonalGaussianMultivariateProbabilityTest", typedef typename arma::Col VecType; typedef typename arma::Mat MatType; - const ElemType tol = (std::is_same::value) ? 1e-4 : 1e-7; + const ElemType tol = (std::is_same_v) ? 1e-4 : 1e-7; VecType mean("0 0"); VecType cov("2 2"); @@ -1706,7 +1706,7 @@ TEMPLATE_TEST_CASE("DiagonalGaussianDistributionRandomTest", typedef typename arma::Col VecType; typedef typename arma::Mat MatType; - const ElemType tol = (std::is_same::value) ? 0.2 : 0.1; + const ElemType tol = (std::is_same_v) ? 0.2 : 0.1; VecType mean("2.5 1.25"); VecType cov("0.50 0.25"); @@ -1739,7 +1739,7 @@ TEMPLATE_TEST_CASE("DiagonalGaussianDistributionTrainTest", typedef typename arma::Col VecType; typedef typename arma::Mat MatType; - const ElemType tol = (std::is_same::value) ? 1e-3 : 1e-5; + const ElemType tol = (std::is_same_v) ? 1e-3 : 1e-5; VecType mean("2.5 1.5 8.2 3.1"); VecType cov("1.2 3.1 8.3 4.3"); @@ -1778,7 +1778,7 @@ TEMPLATE_TEST_CASE("DiagonalGaussianUnbiasedEstimatorTest", typedef typename arma::Col VecType; typedef typename arma::Mat MatType; - const ElemType tol = (std::is_same::value) ? 1e-4 : 1e-7; + const ElemType tol = (std::is_same_v) ? 1e-4 : 1e-7; // Generate the observations. MatType observations("3 5 2 7;" @@ -1816,7 +1816,7 @@ TEMPLATE_TEST_CASE("DiagonalGaussianWeightedParametersReductionTest", typedef typename arma::Col VecType; typedef typename arma::Mat MatType; - const ElemType tol = (std::is_same::value) ? 1e-4 : 1e-7; + const ElemType tol = (std::is_same_v) ? 1e-4 : 1e-7; VecType mean("2.5 1.5 8.2 3.1"); VecType cov("1.2 3.1 8.3 4.3"); diff --git a/src/mlpack/tests/lars_test.cpp b/src/mlpack/tests/lars_test.cpp index 196e6c23c7..c143fbd426 100644 --- a/src/mlpack/tests/lars_test.cpp +++ b/src/mlpack/tests/lars_test.cpp @@ -35,7 +35,7 @@ void LARSVerifyCorrectness(const VecType& beta, size_t nDims = beta.n_elem; // floats require a much larger tolerance. - const ElemType tol = (std::is_same::value) ? 1e-8 : 5e-3; + const ElemType tol = (std::is_same_v) ? 1e-8 : 5e-3; for (size_t j = 0; j < nDims; ++j) { @@ -1226,7 +1226,7 @@ TEMPLATE_TEST_CASE("LARSSelectBetaTest", "[LARSTest]", arma::fmat, arma::mat) typedef TestType MatType; typedef typename MatType::elem_type ElemType; - const ElemType tol = (std::is_same::value) ? 1e-5 : 5e-3; + const ElemType tol = (std::is_same_v) ? 1e-5 : 5e-3; // Train a model on a randomly generated problem. Then, we will iterate // through different selected lambda values, ensuring that the error on the @@ -1244,7 +1244,7 @@ TEMPLATE_TEST_CASE("LARSSelectBetaTest", "[LARSTest]", arma::fmat, arma::mat) // Now step through numerous different lambda values. ElemType lastError = std::numeric_limits::max(); - const ElemType errorTol = (std::is_same::value) ? 1e-8 : + const ElemType errorTol = (std::is_same_v) ? 1e-8 : 0.05; for (ElemType i = 5.0; i >= -5.0; i -= 0.1) { diff --git a/src/mlpack/tests/lmnn_test.cpp b/src/mlpack/tests/lmnn_test.cpp index 394474511b..5192483972 100644 --- a/src/mlpack/tests/lmnn_test.cpp +++ b/src/mlpack/tests/lmnn_test.cpp @@ -116,8 +116,8 @@ TEMPLATE_TEST_CASE("LMNNInitialPointTest", "[LMNNTest]", float, double) LMNNFunction> lmnnfn(dataset, labels, 1, 0.5, 1); // Verify the initial point is the identity matrix. - const double eps = std::is_same::value ? 1e-4 : 1e-7; - const double margin = std::is_same::value ? 1e-4 : 1e-5; + const double eps = std::is_same_v ? 1e-4 : 1e-7; + const double margin = std::is_same_v ? 1e-4 : 1e-5; arma::Mat initialPoint = lmnnfn.GetInitialPoint(); for (int row = 0; row < 5; row++) { @@ -148,7 +148,7 @@ TEMPLATE_TEST_CASE("LMNNInitialEvaluationTest", "[LMNNTest]", float, double) ElemType objective = lmnnfn.Evaluate(arma::eye>(2, 2)); // Result calculated by hand. - const double eps = std::is_same::value ? 1e-4 : 1e-7; + const double eps = std::is_same_v ? 1e-4 : 1e-7; REQUIRE(objective == Approx(9.456).epsilon(eps)); } @@ -171,8 +171,8 @@ TEMPLATE_TEST_CASE("LMNNInitialGradientTest", "[LMNNTest]", float, double) lmnnfn.Gradient(coordinates, gradient); // Result calculated by hand. - const double eps = std::is_same::value ? 1e-4 : 1e-7; - const double margin = std::is_same::value ? 1e-4 : 1e-5; + const double eps = std::is_same_v ? 1e-4 : 1e-7; + const double margin = std::is_same_v ? 1e-4 : 1e-5; REQUIRE(gradient(0, 0) == Approx(-0.288).epsilon(eps)); REQUIRE(gradient(1, 0) == Approx(0.0).margin(margin)); REQUIRE(gradient(0, 1) == Approx(0.0).margin(margin)); @@ -198,8 +198,8 @@ TEMPLATE_TEST_CASE("LMNNInitialEvaluateWithGradientTest", "[LMNNTest]", float, arma::Mat coordinates = arma::eye>(2, 2); ElemType objective = lmnnfn.EvaluateWithGradient(coordinates, gradient); - const double eps = std::is_same::value ? 1e-4 : 1e-7; - const double margin = std::is_same::value ? 1e-4 : 1e-5; + const double eps = std::is_same_v ? 1e-4 : 1e-7; + const double margin = std::is_same_v ? 1e-4 : 1e-5; // Result calculated by hand. REQUIRE(objective == Approx(9.456).epsilon(eps)); @@ -225,7 +225,7 @@ TEMPLATE_TEST_CASE("LMNNSeparableObjectiveTest", "[LMNNTest]", float, double) LMNNFunction> lmnnfn(dataset, labels, 1, 0.6, 1); // Result calculated by hand. - const double eps = std::is_same::value ? 1e-4 : 1e-7; + const double eps = std::is_same_v ? 1e-4 : 1e-7; arma::Mat coordinates = arma::eye>(2, 2); REQUIRE(lmnnfn.Evaluate(coordinates, 0, 1) == Approx(1.576).epsilon(eps)); REQUIRE(lmnnfn.Evaluate(coordinates, 1, 1) == Approx(1.576).epsilon(eps)); @@ -254,8 +254,8 @@ TEMPLATE_TEST_CASE("LMNNSeparableGradientTest", "[LMNNTest]", float, double) lmnnfn.Gradient(coordinates, 0, gradient, 1); - const double eps = std::is_same::value ? 1e-4 : 1e-7; - const double margin = std::is_same::value ? 1e-4 : 1e-5; + const double eps = std::is_same_v ? 1e-4 : 1e-7; + const double margin = std::is_same_v ? 1e-4 : 1e-5; REQUIRE(gradient(0, 0) == Approx(-0.048).epsilon(eps)); REQUIRE(gradient(0, 1) == Approx(0.0).margin(margin)); @@ -318,8 +318,8 @@ TEMPLATE_TEST_CASE("LMNNSeparableEvaluateWithGradientTest", "[LMNNTest]", float, ElemType objective = lmnnfn.EvaluateWithGradient(coordinates, 0, gradient, 1); - const double eps = std::is_same::value ? 1e-4 : 1e-7; - const double margin = std::is_same::value ? 1e-4 : 1e-5; + const double eps = std::is_same_v ? 1e-4 : 1e-7; + const double margin = std::is_same_v ? 1e-4 : 1e-5; REQUIRE(objective == Approx(1.576).epsilon(eps)); diff --git a/src/mlpack/tests/main_tests/main_test_fixture.hpp b/src/mlpack/tests/main_tests/main_test_fixture.hpp index 44ba2642e2..5c9cf94bac 100644 --- a/src/mlpack/tests/main_tests/main_test_fixture.hpp +++ b/src/mlpack/tests/main_tests/main_test_fixture.hpp @@ -106,7 +106,7 @@ class MainTestFixture template void SetInputParam(const std::string& name, T&& value) { - params.Get::type>(name) = + params.Get>(name) = std::forward(value); params.SetPassed(name); } diff --git a/src/mlpack/tests/nca_test.cpp b/src/mlpack/tests/nca_test.cpp index f618363404..09024d67ec 100644 --- a/src/mlpack/tests/nca_test.cpp +++ b/src/mlpack/tests/nca_test.cpp @@ -41,8 +41,8 @@ TEMPLATE_TEST_CASE("SoftmaxInitialPoint", "[NCATest]", float, double) // Verify the initial point is the identity matrix. arma::Mat initialPoint = sef.GetInitialPoint(); - const double eps = std::is_same::value ? 1e-4 : 1e-7; - const double margin = std::is_same::value ? 1e-4 : 1e-5; + const double eps = std::is_same_v ? 1e-4 : 1e-7; + const double margin = std::is_same_v ? 1e-4 : 1e-5; for (int row = 0; row < 5; row++) { for (int col = 0; col < 5; col++) @@ -131,7 +131,7 @@ TEMPLATE_TEST_CASE("SoftmaxOptimalEvaluation", "[NCATest]", float, double) // Use a very close tolerance for optimality; we need to be sure this function // gives optimal results correctly. - const double eps = std::is_same::value ? 1e-6 : 1e-12; + const double eps = std::is_same_v ? 1e-6 : 1e-12; REQUIRE(objective == Approx(-4.0).epsilon(eps)); } diff --git a/src/mlpack/tests/pca_test.cpp b/src/mlpack/tests/pca_test.cpp index 4957280df4..2878913e2c 100644 --- a/src/mlpack/tests/pca_test.cpp +++ b/src/mlpack/tests/pca_test.cpp @@ -361,7 +361,7 @@ TEMPLATE_TEST_CASE("PCASubviewTest", "[PCATest]", ExactSVDPolicy, p.Apply(data.cols(0, 1999), transData3, eigval2, eigvec); // Only check for deterministic policies. - if (std::is_same::value) + if (std::is_same_v) { arma::mat trueTransData, trueEigvec; arma::vec trueEigval; @@ -408,7 +408,7 @@ TEMPLATE_TEST_CASE("PCAExpressionTest", "[PCATest]", ExactSVDPolicy, p.Apply(2 * data + 1, transData3, eigval2, eigvec); // Only check for deterministic policies. - if (std::is_same::value) + if (std::is_same_v) { arma::mat trueTransData, trueEigvec; arma::vec trueEigval; @@ -456,7 +456,7 @@ TEMPLATE_TEST_CASE("PCAFloatTest", "[PCATest]", ExactSVDPolicy, // Verify the PCA results based on the eigenvalues. We don't check for // QUIC-SVD, since that method has a lot of noise. - if (!std::is_same::value) + if (!std::is_same_v) { for (size_t i = 0; i < eigVal.n_elem; ++i) { diff --git a/src/mlpack/tests/sparse_coding_test.cpp b/src/mlpack/tests/sparse_coding_test.cpp index fa22dbc9cc..0a732cf2a5 100644 --- a/src/mlpack/tests/sparse_coding_test.cpp +++ b/src/mlpack/tests/sparse_coding_test.cpp @@ -23,7 +23,7 @@ void SCVerifyCorrectness(const VecType& beta, const VecType& errCorr, double lambda) { - const double tol = std::is_same::value ? + const double tol = std::is_same_v ? 1e-6 : 1e-12; size_t nDims = beta.n_elem; for (size_t j = 0; j < nDims; ++j) @@ -122,7 +122,7 @@ TEMPLATE_TEST_CASE("SparseCodingTestDictionaryStep", "[SparseCodingTest]", { typedef TestType MatType; - const double tol = std::is_same::value ? + const double tol = std::is_same_v ? 0.01 : 1e-6; double lambda1 = 0.1; @@ -215,7 +215,7 @@ TEMPLATE_TEST_CASE("SparseCodingTrainReturnObjective", "[SparseCodingTest]", { typedef TestType MatType; - const double tol = std::is_same::value ? + const double tol = std::is_same_v ? 0.01 : 1e-6; double lambda1 = 0.1; diff --git a/src/mlpack/tests/test_catch_tools.hpp b/src/mlpack/tests/test_catch_tools.hpp index 288cd26075..1377b7359a 100644 --- a/src/mlpack/tests/test_catch_tools.hpp +++ b/src/mlpack/tests/test_catch_tools.hpp @@ -23,8 +23,8 @@ // Simple wrapper class to prevent copies of Armadillo matrices. template ::value>> + typename = std::enable_if_t>> class MatProxy { public: @@ -54,9 +54,9 @@ class MatProxy, ElemType> template ::value && arma::is_arma_type::value - && std::is_same::value - && !std::is_integral::value>> + && std::is_same_v + && !std::is_integral_v>> inline void CheckMatrices(const MatTypeA& _a, const MatTypeB& _b, double tolerance = 1e-5) @@ -103,8 +103,8 @@ inline void CheckFields(const FieldType& a, // Simple wrapper class to prevent copies of Armadillo cubes. template ::value>> + typename = std::enable_if_t>> class CubeProxy { public: @@ -136,9 +136,9 @@ class CubeProxy, ElemType> template ::value && arma::is_arma_cube_type::value - && std::is_same::value - && !std::is_integral::value>, + && std::is_same_v + && !std::is_integral_v>, typename = void> inline void CheckMatrices(const CubeTypeA& _a, const CubeTypeB& _b, diff --git a/src/mlpack/tests/ub_tree_test.cpp b/src/mlpack/tests/ub_tree_test.cpp index fbd134535a..874c5bab18 100644 --- a/src/mlpack/tests/ub_tree_test.cpp +++ b/src/mlpack/tests/ub_tree_test.cpp @@ -44,9 +44,9 @@ template void CheckSplit(const TreeType& tree) { typedef typename TreeType::ElemType ElemType; - typedef typename std::conditional::type AddressElemType; + uint64_t>AddressElemType; if (tree.IsLeaf()) return; From 469cce1724a422b3bbbeacfd975c89c47a7b2a1b Mon Sep 17 00:00:00 2001 From: Martin Lambertsen Date: Mon, 14 Oct 2024 22:33:57 +0200 Subject: [PATCH 15/24] Remove trailing whitespaces --- src/mlpack/core/hpt/cv_function.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mlpack/core/hpt/cv_function.hpp b/src/mlpack/core/hpt/cv_function.hpp index 264b878d7d..90dd1da5c5 100644 --- a/src/mlpack/core/hpt/cv_function.hpp +++ b/src/mlpack/core/hpt/cv_function.hpp @@ -130,7 +130,7 @@ class CVFunction template> inline double Evaluate(const arma::mat& parameters, const Args&... args); @@ -140,7 +140,7 @@ class CVFunction template, typename = void> inline double Evaluate(const arma::mat& parameters, const Args&... args); From 395c63383cd08aeb21c96047beaff7937bb8976c Mon Sep 17 00:00:00 2001 From: Ryan Curtin Date: Wed, 16 Oct 2024 12:33:00 -0400 Subject: [PATCH 16/24] Fix some minor links. --- doc/user/core/trees/binary_space_tree.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/user/core/trees/binary_space_tree.md b/doc/user/core/trees/binary_space_tree.md index 7eab97e542..05313b16e9 100644 --- a/doc/user/core/trees/binary_space_tree.md +++ b/doc/user/core/trees/binary_space_tree.md @@ -842,8 +842,8 @@ Different constructor forms can be used to specify different template parameters any points at all). ***Note***: these constructors provide an empty bound; be sure to -[grow](#growing-and-shrinking-the-bound) the bound or -[directly modify the bound](#accessing-and-modifying-properties-of-the-bound) +[grow](#growing-the-bound) the bound or +[directly modify the bound](#accessing-and-modifying-properties-of-the-bound-1) before using it! --- @@ -1122,7 +1122,7 @@ Different constructor forms can be used to specify different template parameters - `ElemType` should generally be `double` or `float`. ***Note***: these constructors provide an empty bound; be sure to -[grow](#growing-and-shrinking-the-bound-2) the bound or +[grow](#growing-the-bound-1) the bound or [directly modify the bound](#accessing-and-modifying-properties-of-the-bound-2) before using it! @@ -1205,7 +1205,7 @@ be accessed and modified. `DistanceType` if a custom `DistanceType` has been specified in the constructor. - * `b.Center(center)` will compute the center of the `HRectBound` (e.g. the + * `b.Center(center)` will compute the center of the `HollowBallBound` (e.g. the vector with elements equal to the midpoint of `b` in each dimension) and store it in the vector `center`. `center` should be of type `arma::vec`. From 05281d6e17f249906cfff1f41be47db877b4e7fc Mon Sep 17 00:00:00 2001 From: Ryan Curtin Date: Wed, 16 Oct 2024 13:26:48 -0400 Subject: [PATCH 17/24] Fix paper link. --- doc/user/core/trees/binary_space_tree.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/user/core/trees/binary_space_tree.md b/doc/user/core/trees/binary_space_tree.md index 05313b16e9..0d51f7cdf1 100644 --- a/doc/user/core/trees/binary_space_tree.md +++ b/doc/user/core/trees/binary_space_tree.md @@ -1679,7 +1679,8 @@ For implementation details, see The `VantagePointSplit` class is a splitting strategy that can be used by [`BinarySpaceTree`](#binaryspacetree). It is the default strategy for splitting -[`VPTree`s](vptree.md), and is detailed in [the paper](...). +[`VPTree`s](vptree.md), and is detailed in +[the paper](https://www.mlpack.org/paper/uhlmann91.pdf). Due to the nature of the split, ***`VantagePointSplit` should always be used with the [`HollowBallBound`](#hollowballbound)***. From d24f019d1ac74f4ebf128eb05106f69e9660d7d6 Mon Sep 17 00:00:00 2001 From: Martin Lambertsen Date: Sat, 19 Oct 2024 10:42:42 +0200 Subject: [PATCH 18/24] Apply formatting and some small manual fixes found by chance. --- src/mlpack/bindings/R/default_param.hpp | 5 +- src/mlpack/bindings/R/default_param_impl.hpp | 2 +- src/mlpack/bindings/R/get_printable_type.hpp | 9 ++-- .../bindings/R/get_printable_type_impl.hpp | 9 ++-- src/mlpack/bindings/R/get_r_type.hpp | 9 ++-- src/mlpack/bindings/R/get_type.hpp | 9 ++-- src/mlpack/bindings/cli/add_to_cli11.hpp | 52 +++++++------------ src/mlpack/bindings/cli/cli_option.hpp | 3 +- src/mlpack/bindings/cli/default_param.hpp | 8 ++- .../bindings/cli/default_param_impl.hpp | 5 +- .../bindings/cli/get_allocated_memory.hpp | 3 +- .../bindings/cli/get_printable_param.hpp | 3 +- .../bindings/cli/get_printable_param_impl.hpp | 6 +-- .../bindings/cli/get_printable_type.hpp | 3 +- src/mlpack/bindings/cli/get_raw_param.hpp | 2 +- src/mlpack/bindings/cli/in_place_copy.hpp | 8 ++- .../bindings/cli/map_parameter_name.hpp | 3 +- src/mlpack/bindings/cli/print_type_doc.hpp | 3 +- src/mlpack/bindings/cli/set_param.hpp | 3 +- src/mlpack/bindings/go/default_param.hpp | 8 ++- src/mlpack/bindings/go/default_param_impl.hpp | 8 ++- src/mlpack/bindings/go/get_go_type.hpp | 9 ++-- .../bindings/go/get_printable_param.hpp | 3 +- src/mlpack/bindings/go/get_printable_type.hpp | 12 ++--- .../bindings/go/get_printable_type_impl.hpp | 9 ++-- src/mlpack/bindings/go/get_type.hpp | 12 ++--- src/mlpack/bindings/go/print_doc.hpp | 3 +- .../bindings/go/print_input_processing.hpp | 3 +- .../bindings/go/print_method_config.hpp | 3 +- src/mlpack/bindings/go/print_method_init.hpp | 3 +- src/mlpack/bindings/go/print_type_doc.hpp | 3 +- src/mlpack/bindings/julia/default_param.hpp | 8 ++- .../bindings/julia/default_param_impl.hpp | 8 ++- src/mlpack/bindings/julia/get_julia_type.hpp | 9 ++-- .../bindings/julia/get_printable_param.hpp | 3 +- .../bindings/julia/get_printable_type.hpp | 3 +- .../bindings/julia/print_input_param.hpp | 3 +- .../bindings/julia/print_input_processing.hpp | 3 +- .../julia/print_input_processing_impl.hpp | 8 +-- .../julia/print_output_processing.hpp | 3 +- .../bindings/julia/print_param_defn.hpp | 3 +- src/mlpack/bindings/julia/print_type_doc.hpp | 3 +- .../bindings/markdown/get_printable_param.hpp | 3 +- src/mlpack/bindings/python/default_param.hpp | 8 ++- .../bindings/python/default_param_impl.hpp | 8 ++- .../bindings/python/get_cython_type.hpp | 9 ++-- .../bindings/python/get_printable_param.hpp | 3 +- .../bindings/python/get_printable_type.hpp | 12 ++--- .../python/get_printable_type_impl.hpp | 9 ++-- .../bindings/python/is_serializable.hpp | 3 +- src/mlpack/bindings/python/print_doc.hpp | 3 +- .../python/print_input_processing.hpp | 3 +- src/mlpack/bindings/python/print_type_doc.hpp | 3 +- .../bindings/tests/get_allocated_memory.hpp | 3 +- .../bindings/tests/get_printable_param.hpp | 3 +- src/mlpack/core/cereal/is_loading.hpp | 6 +-- src/mlpack/core/cv/cv_base.hpp | 6 +-- src/mlpack/core/data/string_encoding_impl.hpp | 12 ++--- src/mlpack/core/hpt/hpt.hpp | 3 +- src/mlpack/core/tree/address.hpp | 4 +- .../tree/binary_space_tree/ub_tree_split.hpp | 2 +- src/mlpack/core/tree/build_tree.hpp | 6 +-- src/mlpack/core/tree/cellbound.hpp | 2 +- .../rectangle_tree/discrete_hilbert_value.hpp | 2 +- src/mlpack/core/util/ens_traits.hpp | 8 ++- .../core/util/first_element_is_arma.hpp | 4 +- src/mlpack/core/util/sfinae_utility.hpp | 9 ++-- src/mlpack/core/util/size_checks.hpp | 3 +- src/mlpack/methods/adaboost/adaboost.hpp | 3 +- .../ann/convolution_rules/fft_convolution.hpp | 6 +-- .../convolution_rules/naive_convolution.hpp | 6 +-- src/mlpack/methods/ann/ffn.hpp | 6 +-- src/mlpack/methods/ann/ffn_impl.hpp | 6 +-- .../methods/ann/not_adapted/gan/gan.hpp | 21 +++----- .../methods/ann/not_adapted/gan/gan_impl.hpp | 6 +-- .../ann/not_adapted/gan/wgangp_impl.hpp | 9 ++-- .../methods/ann/not_adapted/rbm/rbm.hpp | 3 +- .../bayesian_linear_regression.hpp | 18 +++---- .../decision_tree/decision_tree_impl.hpp | 6 +-- .../decision_tree_regressor_impl.hpp | 22 +++----- src/mlpack/methods/det/dtree_impl.hpp | 3 +- src/mlpack/methods/gmm/em_fit_impl.hpp | 4 +- .../gmm/positive_definite_constraint.hpp | 6 +-- .../methods/kmeans/dual_tree_kmeans_impl.hpp | 6 +-- src/mlpack/methods/lars/lars.hpp | 48 ++++++----------- .../linear_regression/linear_regression.hpp | 24 +++------ src/mlpack/methods/lmnn/lmnn.hpp | 3 +- src/mlpack/methods/lsh/lsh_search_impl.hpp | 3 +- .../naive_bayes_classifier_impl.hpp | 4 +- src/mlpack/methods/nca/nca.hpp | 11 ++-- src/mlpack/methods/pca/pca_impl.hpp | 6 +-- .../methods/perceptron/perceptron_impl.hpp | 6 +-- .../softmax_regression/softmax_regression.hpp | 27 ++++------ src/mlpack/tests/cv_test.cpp | 3 +- src/mlpack/tests/lars_test.cpp | 3 +- .../tests/main_tests/main_test_fixture.hpp | 3 +- src/mlpack/tests/test_catch_tools.hpp | 4 +- src/mlpack/tests/ub_tree_test.cpp | 6 +-- 98 files changed, 251 insertions(+), 443 deletions(-) diff --git a/src/mlpack/bindings/R/default_param.hpp b/src/mlpack/bindings/R/default_param.hpp index 1e05baf21e..be6fdbf57b 100644 --- a/src/mlpack/bindings/R/default_param.hpp +++ b/src/mlpack/bindings/R/default_param.hpp @@ -48,8 +48,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const std::enable_if_t - >* = 0); + const std::enable_if_t>* = 0); /** * Return the default value of a matrix option, a tuple option, a @@ -62,7 +61,7 @@ std::string DefaultParamImpl( const std::enable_if_t< arma::is_arma_type::value || std::is_same_v>>* /* junk */ = 0); + arma::mat>>>* /* junk */ = 0); /** * Return the default value of a model option (this returns the default diff --git a/src/mlpack/bindings/R/default_param_impl.hpp b/src/mlpack/bindings/R/default_param_impl.hpp index a542cf7885..d210f1c6bd 100644 --- a/src/mlpack/bindings/R/default_param_impl.hpp +++ b/src/mlpack/bindings/R/default_param_impl.hpp @@ -117,7 +117,7 @@ std::string DefaultParamImpl( const std::enable_if_t< arma::is_arma_type::value || std::is_same_v>>* /* junk */) + arma::mat>>>* /* junk */) { // Get the filename and return it, or return an empty string. if (std::is_same_v || diff --git a/src/mlpack/bindings/R/get_printable_type.hpp b/src/mlpack/bindings/R/get_printable_type.hpp index 72e9d0c5cf..d04f06f025 100644 --- a/src/mlpack/bindings/R/get_printable_type.hpp +++ b/src/mlpack/bindings/R/get_printable_type.hpp @@ -50,12 +50,9 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const std::enable_if_t< - !util::IsStdVector::value>*, - const std::enable_if_t< - !data::HasSerialize::value>*, - const std::enable_if_t< - !arma::is_arma_type::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, const std::enable_if_t< !std::is_same_v>>*); diff --git a/src/mlpack/bindings/R/get_printable_type_impl.hpp b/src/mlpack/bindings/R/get_printable_type_impl.hpp index 0f388103c8..9b59da016d 100644 --- a/src/mlpack/bindings/R/get_printable_type_impl.hpp +++ b/src/mlpack/bindings/R/get_printable_type_impl.hpp @@ -58,12 +58,9 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const std::enable_if_t< - !util::IsStdVector::value>*, - const std::enable_if_t< - !data::HasSerialize::value>*, - const std::enable_if_t< - !arma::is_arma_type::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, const std::enable_if_t< !std::is_same_v>>*) diff --git a/src/mlpack/bindings/R/get_r_type.hpp b/src/mlpack/bindings/R/get_r_type.hpp index fe8c3dd7e8..fdc43beecc 100644 --- a/src/mlpack/bindings/R/get_r_type.hpp +++ b/src/mlpack/bindings/R/get_r_type.hpp @@ -83,12 +83,9 @@ inline std::string GetRType( template<> inline std::string GetRType( util::ParamData& /* d */, - const std::enable_if_t< - !util::IsStdVector::value>*, - const std::enable_if_t< - !data::HasSerialize::value>*, - const std::enable_if_t< - !arma::is_arma_type::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, const std::enable_if_t< !std::is_same_v>>*) diff --git a/src/mlpack/bindings/R/get_type.hpp b/src/mlpack/bindings/R/get_type.hpp index 1ef816f7bc..0b62a0cfdc 100644 --- a/src/mlpack/bindings/R/get_type.hpp +++ b/src/mlpack/bindings/R/get_type.hpp @@ -72,12 +72,9 @@ inline std::string GetType( template<> inline std::string GetType( util::ParamData& /* d */, - const std::enable_if_t< - !util::IsStdVector::value>*, - const std::enable_if_t< - !data::HasSerialize::value>*, - const std::enable_if_t< - !arma::is_arma_type::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, const std::enable_if_t>>*) { diff --git a/src/mlpack/bindings/cli/add_to_cli11.hpp b/src/mlpack/bindings/cli/add_to_cli11.hpp index 5bbb3eff9d..907eb1d3bc 100644 --- a/src/mlpack/bindings/cli/add_to_cli11.hpp +++ b/src/mlpack/bindings/cli/add_to_cli11.hpp @@ -33,15 +33,12 @@ template void AddToCLI11(const std::string& cliName, util::ParamData& param, CLI::App& app, - const std::enable_if_t>* = 0, - const std::enable_if_t::value>* = 0, - const std::enable_if_t::value>* = 0, + const std::enable_if_t>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, const std::enable_if_t>>* = 0) + arma::mat>>>* = 0) { app.add_option_function(cliName.c_str(), [¶m](const std::string& value) @@ -65,15 +62,12 @@ template void AddToCLI11(const std::string& cliName, util::ParamData& param, CLI::App& app, - const std::enable_if_t>* = 0, - const std::enable_if_t::value>* = 0, - const std::enable_if_t< - data::HasSerialize::value>* = 0, + const std::enable_if_t>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, const std::enable_if_t>>* = 0) + arma::mat>>>* = 0) { app.add_option_function(cliName.c_str(), [¶m](const std::string& value) @@ -97,13 +91,11 @@ template void AddToCLI11(const std::string& cliName, util::ParamData& param, CLI::App& app, - const std::enable_if_t>* = 0, - const std::enable_if_t< - arma::is_arma_type::value>* = 0, + const std::enable_if_t>* = 0, + const std::enable_if_t::value>* = 0, const std::enable_if_t>>* = 0) + arma::mat>>>* = 0) { app.add_option_function(cliName.c_str(), [¶m](const std::string& value) @@ -127,15 +119,12 @@ template void AddToCLI11(const std::string& cliName, util::ParamData& param, CLI::App& app, - const std::enable_if_t>* = 0, - const std::enable_if_t::value>* = 0, - const std::enable_if_t::value>* = 0, + const std::enable_if_t>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, const std::enable_if_t>>* = 0) + arma::mat>>>* = 0) { app.add_option_function(cliName.c_str(), [¶m](const T& value) @@ -157,15 +146,12 @@ template void AddToCLI11(const std::string& cliName, util::ParamData& param, CLI::App& app, - const std::enable_if_t< - std::is_same_v>* = 0, - const std::enable_if_t::value>* = 0, - const std::enable_if_t::value>* = 0, + const std::enable_if_t>* = 0, + const std::enable_if_t::value>* = 0, + const std::enable_if_t::value>* = 0, const std::enable_if_t>>* = 0) + arma::mat>>>* = 0) { app.add_flag_function(cliName.c_str(), [¶m](const T& value) diff --git a/src/mlpack/bindings/cli/cli_option.hpp b/src/mlpack/bindings/cli/cli_option.hpp index a1c1032be5..af9a83057f 100644 --- a/src/mlpack/bindings/cli/cli_option.hpp +++ b/src/mlpack/bindings/cli/cli_option.hpp @@ -92,8 +92,7 @@ class CLIOption // Apply default value. if (std::is_same_v, - typename ParameterType< - std::remove_pointer_t>::type>) + typename ParameterType>::type>) { data.value = defaultValue; } diff --git a/src/mlpack/bindings/cli/default_param.hpp b/src/mlpack/bindings/cli/default_param.hpp index 256afdbc51..7bdda5972b 100644 --- a/src/mlpack/bindings/cli/default_param.hpp +++ b/src/mlpack/bindings/cli/default_param.hpp @@ -29,8 +29,7 @@ std::string DefaultParamImpl( const std::enable_if_t::value>* = 0, const std::enable_if_t::value>* = 0, const std::enable_if_t::value>* = 0, - const std::enable_if_t>* = 0, + const std::enable_if_t>* = 0, const std::enable_if_t>>* = 0); @@ -48,8 +47,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const std::enable_if_t - >* = 0); + const std::enable_if_t>* = 0); /** * Return the default value of a matrix option, a tuple option, a @@ -62,7 +60,7 @@ std::string DefaultParamImpl( const std::enable_if_t< arma::is_arma_type::value || std::is_same_v>>* /* junk */ = 0); + arma::mat>>>* /* junk */ = 0); /** * Return the default value of a model option (this returns the default diff --git a/src/mlpack/bindings/cli/default_param_impl.hpp b/src/mlpack/bindings/cli/default_param_impl.hpp index d7e0506d1e..cdefb16d22 100644 --- a/src/mlpack/bindings/cli/default_param_impl.hpp +++ b/src/mlpack/bindings/cli/default_param_impl.hpp @@ -27,8 +27,7 @@ std::string DefaultParamImpl( const std::enable_if_t::value>*, const std::enable_if_t::value>*, const std::enable_if_t::value>*, - const std::enable_if_t>*, + const std::enable_if_t>*, const std::enable_if_t>>*) { @@ -104,7 +103,7 @@ std::string DefaultParamImpl( const std::enable_if_t< arma::is_arma_type::value || std::is_same_v>>* /* junk */) + arma::mat>>>* /* junk */) { // The filename will always be empty. return "''"; diff --git a/src/mlpack/bindings/cli/get_allocated_memory.hpp b/src/mlpack/bindings/cli/get_allocated_memory.hpp index 989dab1535..6cc4d2e94e 100644 --- a/src/mlpack/bindings/cli/get_allocated_memory.hpp +++ b/src/mlpack/bindings/cli/get_allocated_memory.hpp @@ -53,8 +53,7 @@ void GetAllocatedMemory(util::ParamData& d, const void* /* input */, void* output) { - *((void**) output) = - GetAllocatedMemory>(d); + *((void**) output) = GetAllocatedMemory>(d); } } // namespace cli diff --git a/src/mlpack/bindings/cli/get_printable_param.hpp b/src/mlpack/bindings/cli/get_printable_param.hpp index bffe499f37..c8c25f3a9f 100644 --- a/src/mlpack/bindings/cli/get_printable_param.hpp +++ b/src/mlpack/bindings/cli/get_printable_param.hpp @@ -47,8 +47,7 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const std::enable_if_t::value || - std::is_same_v::value || std::is_same_v>>* = 0); /** diff --git a/src/mlpack/bindings/cli/get_printable_param_impl.hpp b/src/mlpack/bindings/cli/get_printable_param_impl.hpp index d9dadfecde..3bbd8989fc 100644 --- a/src/mlpack/bindings/cli/get_printable_param_impl.hpp +++ b/src/mlpack/bindings/cli/get_printable_param_impl.hpp @@ -38,8 +38,7 @@ std::string GetPrintableParam( template std::string GetPrintableParam( util::ParamData& data, - const std::enable_if_t::value>* - /* junk */) + const std::enable_if_t::value>* /* junk */) { const T& t = std::any_cast(data.value); @@ -74,8 +73,7 @@ std::string GetMatrixSize( template std::string GetPrintableParam( util::ParamData& data, - const std::enable_if_t::value || - std::is_same_v::value || std::is_same_v>>* /* junk */) { // Extract the string from the tuple that's being held. diff --git a/src/mlpack/bindings/cli/get_printable_type.hpp b/src/mlpack/bindings/cli/get_printable_type.hpp index 328e8f1055..1e6e127d2a 100644 --- a/src/mlpack/bindings/cli/get_printable_type.hpp +++ b/src/mlpack/bindings/cli/get_printable_type.hpp @@ -71,8 +71,7 @@ void GetPrintableType(util::ParamData& data, const void* /* input */, void* output) { - *((std::string*) output) = - GetPrintableType>(data); + *((std::string*) output) = GetPrintableType>(data); } } // namespace cli diff --git a/src/mlpack/bindings/cli/get_raw_param.hpp b/src/mlpack/bindings/cli/get_raw_param.hpp index acd2788e79..5464b01d72 100644 --- a/src/mlpack/bindings/cli/get_raw_param.hpp +++ b/src/mlpack/bindings/cli/get_raw_param.hpp @@ -45,7 +45,7 @@ T& GetRawParam( const std::enable_if_t< arma::is_arma_type::value || std::is_same_v>>* = 0) + arma::mat>>>* = 0) { // Don't load the matrix. typedef std::tuple> TupleType; diff --git a/src/mlpack/bindings/cli/in_place_copy.hpp b/src/mlpack/bindings/cli/in_place_copy.hpp index 861e1e2729..2e8b2a5efc 100644 --- a/src/mlpack/bindings/cli/in_place_copy.hpp +++ b/src/mlpack/bindings/cli/in_place_copy.hpp @@ -52,9 +52,8 @@ void InPlaceCopyInternal( util::ParamData& input, const std::enable_if_t< arma::is_arma_type::value || - std::is_same_v> - >* = 0) + std::is_same_v>>* + = 0) { // Make the output filename the same as the input filename. typedef std::tuple::type> TupleType; @@ -76,8 +75,7 @@ template void InPlaceCopyInternal( util::ParamData& d, util::ParamData& input, - const std::enable_if_t< - data::HasSerialize::value>* = 0) + const std::enable_if_t::value>* = 0) { // Make the output filename the same as the input filename. typedef std::tuple::type> TupleType; diff --git a/src/mlpack/bindings/cli/map_parameter_name.hpp b/src/mlpack/bindings/cli/map_parameter_name.hpp index a4e9416b83..17235ed3a1 100644 --- a/src/mlpack/bindings/cli/map_parameter_name.hpp +++ b/src/mlpack/bindings/cli/map_parameter_name.hpp @@ -45,8 +45,7 @@ std::string MapParameterName( const std::string& identifier, const std::enable_if_t< arma::is_arma_type::value || - std::is_same_v> || + std::is_same_v> || data::HasSerialize::value>* /* junk */ = 0) { return identifier + "_file"; diff --git a/src/mlpack/bindings/cli/print_type_doc.hpp b/src/mlpack/bindings/cli/print_type_doc.hpp index 52b4e01f6e..630ebf7f9b 100644 --- a/src/mlpack/bindings/cli/print_type_doc.hpp +++ b/src/mlpack/bindings/cli/print_type_doc.hpp @@ -73,8 +73,7 @@ void PrintTypeDoc(util::ParamData& data, const void* /* input */, void* output) { - *((std::string*) output) = - PrintTypeDoc>(data); + *((std::string*) output) = PrintTypeDoc>(data); } } // namespace cli diff --git a/src/mlpack/bindings/cli/set_param.hpp b/src/mlpack/bindings/cli/set_param.hpp index 6ff35afb80..73f493c660 100644 --- a/src/mlpack/bindings/cli/set_param.hpp +++ b/src/mlpack/bindings/cli/set_param.hpp @@ -58,8 +58,7 @@ template void SetParam( util::ParamData& d, const std::any& value, - const std::enable_if_t::value || - std::is_same_v::value || std::is_same_v>>* = 0) { // We're setting the string filename. diff --git a/src/mlpack/bindings/go/default_param.hpp b/src/mlpack/bindings/go/default_param.hpp index 9c749759f4..e67185d619 100644 --- a/src/mlpack/bindings/go/default_param.hpp +++ b/src/mlpack/bindings/go/default_param.hpp @@ -29,8 +29,7 @@ std::string DefaultParamImpl( const std::enable_if_t::value>* = 0, const std::enable_if_t::value>* = 0, const std::enable_if_t::value>* = 0, - const std::enable_if_t>* = 0, + const std::enable_if_t>* = 0, const std::enable_if_t>>* = 0); @@ -48,8 +47,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const std::enable_if_t - >* = 0); + const std::enable_if_t>* = 0); /** * Return the default value of a matrix option, a tuple option, a @@ -62,7 +60,7 @@ std::string DefaultParamImpl( const std::enable_if_t< arma::is_arma_type::value || std::is_same_v>>* = 0); + arma::mat>>>* = 0); /** * Return the default value of a model option (this returns the default diff --git a/src/mlpack/bindings/go/default_param_impl.hpp b/src/mlpack/bindings/go/default_param_impl.hpp index a4abee84ea..6d78a5ef1c 100644 --- a/src/mlpack/bindings/go/default_param_impl.hpp +++ b/src/mlpack/bindings/go/default_param_impl.hpp @@ -27,8 +27,7 @@ std::string DefaultParamImpl( const std::enable_if_t::value>*, const std::enable_if_t::value>*, const std::enable_if_t::value>*, - const std::enable_if_t>*, + const std::enable_if_t>*, const std::enable_if_t>>*) { @@ -106,11 +105,10 @@ std::string DefaultParamImpl( const std::enable_if_t< arma::is_arma_type::value || std::is_same_v>>* /* junk */) + arma::mat>>>* /* junk */) { // Get the filename and return it, or return an empty string. - if (std::is_same_v || - std::is_same_v) + if (std::is_same_v || std::is_same_v) { return "mat.NewDense(1, 1, nil)"; } diff --git a/src/mlpack/bindings/go/get_go_type.hpp b/src/mlpack/bindings/go/get_go_type.hpp index b4db78e753..3790a0e0e2 100644 --- a/src/mlpack/bindings/go/get_go_type.hpp +++ b/src/mlpack/bindings/go/get_go_type.hpp @@ -73,12 +73,9 @@ inline std::string GetGoType( template<> inline std::string GetGoType( util::ParamData& /* d */, - const std::enable_if_t< - !util::IsStdVector::value>*, - const std::enable_if_t< - !data::HasSerialize::value>*, - const std::enable_if_t< - !arma::is_arma_type::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, const std::enable_if_t>>*) { diff --git a/src/mlpack/bindings/go/get_printable_param.hpp b/src/mlpack/bindings/go/get_printable_param.hpp index 057d5c24d6..01b94df15a 100644 --- a/src/mlpack/bindings/go/get_printable_param.hpp +++ b/src/mlpack/bindings/go/get_printable_param.hpp @@ -115,8 +115,7 @@ void GetPrintableParam(util::ParamData& data, const void* /* input */, void* output) { - *((std::string*) output) = - GetPrintableParam>(data); + *((std::string*) output) = GetPrintableParam>(data); } } // namespace go diff --git a/src/mlpack/bindings/go/get_printable_type.hpp b/src/mlpack/bindings/go/get_printable_type.hpp index 6316b69e3a..e5db191fae 100644 --- a/src/mlpack/bindings/go/get_printable_type.hpp +++ b/src/mlpack/bindings/go/get_printable_type.hpp @@ -50,12 +50,9 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const std::enable_if_t< - !util::IsStdVector::value>*, - const std::enable_if_t< - !data::HasSerialize::value>*, - const std::enable_if_t< - !arma::is_arma_type::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, const std::enable_if_t>>*); @@ -101,8 +98,7 @@ void GetPrintableType(util::ParamData& d, const void* /* input */, void* output) { - *((std::string*) output) = - GetPrintableType>(d); + *((std::string*) output) = GetPrintableType>(d); } } // namespace go diff --git a/src/mlpack/bindings/go/get_printable_type_impl.hpp b/src/mlpack/bindings/go/get_printable_type_impl.hpp index 0c01ccbe83..1bde9d0a7a 100644 --- a/src/mlpack/bindings/go/get_printable_type_impl.hpp +++ b/src/mlpack/bindings/go/get_printable_type_impl.hpp @@ -59,12 +59,9 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const std::enable_if_t< - !util::IsStdVector::value>*, - const std::enable_if_t< - !data::HasSerialize::value>*, - const std::enable_if_t< - !arma::is_arma_type::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, const std::enable_if_t>>*) { diff --git a/src/mlpack/bindings/go/get_type.hpp b/src/mlpack/bindings/go/get_type.hpp index ac60755f31..1134ee6148 100644 --- a/src/mlpack/bindings/go/get_type.hpp +++ b/src/mlpack/bindings/go/get_type.hpp @@ -64,12 +64,9 @@ inline std::string GetType( template<> inline std::string GetType( util::ParamData& /* d */, - const std::enable_if_t< - !util::IsStdVector::value>*, - const std::enable_if_t< - !data::HasSerialize::value>*, - const std::enable_if_t< - !arma::is_arma_type::value>*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*) { return "String"; } @@ -144,8 +141,7 @@ void GetType(util::ParamData& d, const void* /* input */, void* output) { - *((std::string*) output) = - GetType>(d); + *((std::string*) output) = GetType>(d); } } // namespace go diff --git a/src/mlpack/bindings/go/print_doc.hpp b/src/mlpack/bindings/go/print_doc.hpp index 2ba21e0f5c..05f59cea0b 100644 --- a/src/mlpack/bindings/go/print_doc.hpp +++ b/src/mlpack/bindings/go/print_doc.hpp @@ -45,8 +45,7 @@ void PrintDoc(util::ParamData& d, std::ostringstream oss; oss << " - "; oss << util::CamelCase(d.name, Lower) << " ("; - oss << GetGoType>(d) << "): " - << d.desc; + oss << GetGoType>(d) << "): " << d.desc; // Print a default, if possible. if (!d.required) diff --git a/src/mlpack/bindings/go/print_input_processing.hpp b/src/mlpack/bindings/go/print_input_processing.hpp index c64e5ed4e2..8bd00d1b18 100644 --- a/src/mlpack/bindings/go/print_input_processing.hpp +++ b/src/mlpack/bindings/go/print_input_processing.hpp @@ -340,8 +340,7 @@ void PrintInputProcessing(util::ParamData& d, const void* input, void* /* output */) { - PrintInputProcessing>(d, - *((size_t*) input)); + PrintInputProcessing>(d, *((size_t*) input)); } } // namespace go diff --git a/src/mlpack/bindings/go/print_method_config.hpp b/src/mlpack/bindings/go/print_method_config.hpp index 5d6d1d5fd6..2895101377 100644 --- a/src/mlpack/bindings/go/print_method_config.hpp +++ b/src/mlpack/bindings/go/print_method_config.hpp @@ -171,8 +171,7 @@ void PrintMethodConfig(util::ParamData& d, const void* input, void* /* output */) { - PrintMethodConfig>(d, - *((size_t*) input)); + PrintMethodConfig>(d, *((size_t*) input)); } } // namespace go diff --git a/src/mlpack/bindings/go/print_method_init.hpp b/src/mlpack/bindings/go/print_method_init.hpp index 6448874dee..e2fab09052 100644 --- a/src/mlpack/bindings/go/print_method_init.hpp +++ b/src/mlpack/bindings/go/print_method_init.hpp @@ -193,8 +193,7 @@ void PrintMethodInit(util::ParamData& d, const void* input, void* /* output */) { - PrintMethodInit>(d, - *((size_t*) input)); + PrintMethodInit>(d, *((size_t*) input)); } } // namespace go diff --git a/src/mlpack/bindings/go/print_type_doc.hpp b/src/mlpack/bindings/go/print_type_doc.hpp index f8550dc9e5..4815d15ab2 100644 --- a/src/mlpack/bindings/go/print_type_doc.hpp +++ b/src/mlpack/bindings/go/print_type_doc.hpp @@ -73,8 +73,7 @@ void PrintTypeDoc(util::ParamData& data, const void* /* input */, void* output) { - *((std::string*) output) = - PrintTypeDoc>(data); + *((std::string*) output) = PrintTypeDoc>(data); } } // namespace go diff --git a/src/mlpack/bindings/julia/default_param.hpp b/src/mlpack/bindings/julia/default_param.hpp index d6a96c2237..dc0bb49c2f 100644 --- a/src/mlpack/bindings/julia/default_param.hpp +++ b/src/mlpack/bindings/julia/default_param.hpp @@ -29,8 +29,7 @@ std::string DefaultParamImpl( const std::enable_if_t::value>* = 0, const std::enable_if_t::value>* = 0, const std::enable_if_t::value>* = 0, - const std::enable_if_t>* = 0, + const std::enable_if_t>* = 0, const std::enable_if_t>>* = 0); @@ -48,8 +47,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const std::enable_if_t - >* = 0); + const std::enable_if_t>* = 0); /** * Return the default value of a matrix option, a tuple option, a @@ -62,7 +60,7 @@ std::string DefaultParamImpl( const std::enable_if_t< arma::is_arma_type::value || std::is_same_v>>* = 0); + arma::mat>>>* = 0); /** * Return the default value of a model option (this returns the default diff --git a/src/mlpack/bindings/julia/default_param_impl.hpp b/src/mlpack/bindings/julia/default_param_impl.hpp index 9812a1990f..233a2073c8 100644 --- a/src/mlpack/bindings/julia/default_param_impl.hpp +++ b/src/mlpack/bindings/julia/default_param_impl.hpp @@ -27,8 +27,7 @@ std::string DefaultParamImpl( const std::enable_if_t::value>*, const std::enable_if_t::value>*, const std::enable_if_t::value>*, - const std::enable_if_t>*, + const std::enable_if_t>*, const std::enable_if_t>>*) { @@ -106,11 +105,10 @@ std::string DefaultParamImpl( const std::enable_if_t< arma::is_arma_type::value || std::is_same_v>>* /* junk */) + arma::mat>>>* /* junk */) { // Get the filename and return it, or return an empty string. - if (std::is_same_v || - std::is_same_v) + if (std::is_same_v || std::is_same_v) { return "Float64[]"; } diff --git a/src/mlpack/bindings/julia/get_julia_type.hpp b/src/mlpack/bindings/julia/get_julia_type.hpp index 464934d5e3..bf3ceae334 100644 --- a/src/mlpack/bindings/julia/get_julia_type.hpp +++ b/src/mlpack/bindings/julia/get_julia_type.hpp @@ -82,14 +82,11 @@ inline std::string GetJuliaType( template<> inline std::string GetJuliaType( util::ParamData& /* d */, - const std::enable_if_t< - !util::IsStdVector::value>*, - const std::enable_if_t< - !arma::is_arma_type::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, const std::enable_if_t>>*, - const std::enable_if_t< - !data::HasSerialize::value>*) + const std::enable_if_t::value>*) { return "String"; } diff --git a/src/mlpack/bindings/julia/get_printable_param.hpp b/src/mlpack/bindings/julia/get_printable_param.hpp index 25783d8910..d5d8743652 100644 --- a/src/mlpack/bindings/julia/get_printable_param.hpp +++ b/src/mlpack/bindings/julia/get_printable_param.hpp @@ -115,8 +115,7 @@ void GetPrintableParam(util::ParamData& data, const void* /* input */, void* output) { - *((std::string*) output) = - GetPrintableParam>(data); + *((std::string*) output) = GetPrintableParam>(data); } } // namespace julia diff --git a/src/mlpack/bindings/julia/get_printable_type.hpp b/src/mlpack/bindings/julia/get_printable_type.hpp index 751928eacc..7a63863864 100644 --- a/src/mlpack/bindings/julia/get_printable_type.hpp +++ b/src/mlpack/bindings/julia/get_printable_type.hpp @@ -71,8 +71,7 @@ void GetPrintableType(util::ParamData& data, const void* /* input */, void* output) { - *((std::string*) output) = - GetPrintableType>(data); + *((std::string*) output) = GetPrintableType>(data); } } // namespace julia diff --git a/src/mlpack/bindings/julia/print_input_param.hpp b/src/mlpack/bindings/julia/print_input_param.hpp index e46d3bf42b..57baeef693 100644 --- a/src/mlpack/bindings/julia/print_input_param.hpp +++ b/src/mlpack/bindings/julia/print_input_param.hpp @@ -43,8 +43,7 @@ void PrintInputParam(util::ParamData& d, } else { - std::cout << "Union{" - << GetJuliaType>(d) + std::cout << "Union{" << GetJuliaType>(d) << ", Missing} = missing"; } } diff --git a/src/mlpack/bindings/julia/print_input_processing.hpp b/src/mlpack/bindings/julia/print_input_processing.hpp index d6339c3016..1d1a1e8031 100644 --- a/src/mlpack/bindings/julia/print_input_processing.hpp +++ b/src/mlpack/bindings/julia/print_input_processing.hpp @@ -72,8 +72,7 @@ void PrintInputProcessing(util::ParamData& d, void* /* output */) { // Call out to the right overload. - PrintInputProcessing>(d, - *((std::string*) input)); + PrintInputProcessing>(d, *((std::string*) input)); } } // namespace julia diff --git a/src/mlpack/bindings/julia/print_input_processing_impl.hpp b/src/mlpack/bindings/julia/print_input_processing_impl.hpp index e6078fb905..206cb69414 100644 --- a/src/mlpack/bindings/julia/print_input_processing_impl.hpp +++ b/src/mlpack/bindings/julia/print_input_processing_impl.hpp @@ -151,12 +151,12 @@ void PrintInputProcessing( std::string indent(extraIndent + 2, ' '); std::string type = util::StripType(d.cppType); std::cout << indent << "push!(modelPtrs, convert(" - << GetJuliaType>(d) << ", " - << juliaName << ").ptr)" << std::endl; + << GetJuliaType>(d) << ", " << juliaName + << ").ptr)" << std::endl; std::cout << indent << functionName << "_internal.SetParam" << type << "(p, \"" << d.name << "\", convert(" - << GetJuliaType>(d) << ", " - << juliaName << "))" << std::endl; + << GetJuliaType>(d) << ", " << juliaName + << "))" << std::endl; if (!d.required) { diff --git a/src/mlpack/bindings/julia/print_output_processing.hpp b/src/mlpack/bindings/julia/print_output_processing.hpp index c44184e8c2..7d94ee2b59 100644 --- a/src/mlpack/bindings/julia/print_output_processing.hpp +++ b/src/mlpack/bindings/julia/print_output_processing.hpp @@ -73,8 +73,7 @@ void PrintOutputProcessing(util::ParamData& d, void* /* output */) { // Call out to the right overload. - PrintOutputProcessing>(d, - *((std::string*) input)); + PrintOutputProcessing>(d, *((std::string*) input)); } } // namespace julia diff --git a/src/mlpack/bindings/julia/print_param_defn.hpp b/src/mlpack/bindings/julia/print_param_defn.hpp index 7883a4d8ff..c5022875bf 100644 --- a/src/mlpack/bindings/julia/print_param_defn.hpp +++ b/src/mlpack/bindings/julia/print_param_defn.hpp @@ -171,8 +171,7 @@ void PrintParamDefn(util::ParamData& d, const void* input, void* /* output */) { - PrintParamDefn>(d, - *(std::string*) input); + PrintParamDefn>(d, *(std::string*) input); } } // namespace julia diff --git a/src/mlpack/bindings/julia/print_type_doc.hpp b/src/mlpack/bindings/julia/print_type_doc.hpp index a007ac88d8..4acc30c144 100644 --- a/src/mlpack/bindings/julia/print_type_doc.hpp +++ b/src/mlpack/bindings/julia/print_type_doc.hpp @@ -73,8 +73,7 @@ void PrintTypeDoc(util::ParamData& data, const void* /* input */, void* output) { - *((std::string*) output) = - PrintTypeDoc>(data); + *((std::string*) output) = PrintTypeDoc>(data); } } // namespace julia diff --git a/src/mlpack/bindings/markdown/get_printable_param.hpp b/src/mlpack/bindings/markdown/get_printable_param.hpp index f2d8d13d22..c3a971fb6f 100644 --- a/src/mlpack/bindings/markdown/get_printable_param.hpp +++ b/src/mlpack/bindings/markdown/get_printable_param.hpp @@ -115,8 +115,7 @@ void GetPrintableParam(util::ParamData& data, const void* /* input */, void* output) { - *((std::string*) output) = - GetPrintableParam>(data); + *((std::string*) output) = GetPrintableParam>(data); } } // namespace markdown diff --git a/src/mlpack/bindings/python/default_param.hpp b/src/mlpack/bindings/python/default_param.hpp index 2482ed0f75..9495949af5 100644 --- a/src/mlpack/bindings/python/default_param.hpp +++ b/src/mlpack/bindings/python/default_param.hpp @@ -29,8 +29,7 @@ std::string DefaultParamImpl( const std::enable_if_t::value>* = 0, const std::enable_if_t::value>* = 0, const std::enable_if_t::value>* = 0, - const std::enable_if_t>* = 0, + const std::enable_if_t>* = 0, const std::enable_if_t>>* = 0); @@ -48,8 +47,7 @@ std::string DefaultParamImpl( template std::string DefaultParamImpl( util::ParamData& data, - const std::enable_if_t - >* = 0); + const std::enable_if_t>* = 0); /** * Return the default value of a matrix option, a tuple option, a @@ -62,7 +60,7 @@ std::string DefaultParamImpl( const std::enable_if_t< arma::is_arma_type::value || std::is_same_v>>* = 0); + arma::mat>>>* = 0); /** * Return the default value of a model option (this returns the default diff --git a/src/mlpack/bindings/python/default_param_impl.hpp b/src/mlpack/bindings/python/default_param_impl.hpp index 1153574181..e318febfc9 100644 --- a/src/mlpack/bindings/python/default_param_impl.hpp +++ b/src/mlpack/bindings/python/default_param_impl.hpp @@ -27,8 +27,7 @@ std::string DefaultParamImpl( const std::enable_if_t::value>*, const std::enable_if_t::value>*, const std::enable_if_t::value>*, - const std::enable_if_t>*, + const std::enable_if_t>*, const std::enable_if_t>>*) { @@ -106,11 +105,10 @@ std::string DefaultParamImpl( const std::enable_if_t< arma::is_arma_type::value || std::is_same_v>>* /* junk */) + arma::mat>>>* /* junk */) { // Get the filename and return it, or return an empty string. - if (std::is_same_v || - std::is_same_v) + if (std::is_same_v || std::is_same_v) { return "np.empty([0])"; } diff --git a/src/mlpack/bindings/python/get_cython_type.hpp b/src/mlpack/bindings/python/get_cython_type.hpp index a1b12abcda..5d1b48ad50 100644 --- a/src/mlpack/bindings/python/get_cython_type.hpp +++ b/src/mlpack/bindings/python/get_cython_type.hpp @@ -53,12 +53,9 @@ inline std::string GetCythonType( template<> inline std::string GetCythonType( util::ParamData& /* d */, - const std::enable_if_t< - !util::IsStdVector::value>*, - const std::enable_if_t< - !data::HasSerialize::value>*, - const std::enable_if_t< - !arma::is_arma_type::value>*) + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*) { return "string"; } diff --git a/src/mlpack/bindings/python/get_printable_param.hpp b/src/mlpack/bindings/python/get_printable_param.hpp index db87a6ae72..3e205760fb 100644 --- a/src/mlpack/bindings/python/get_printable_param.hpp +++ b/src/mlpack/bindings/python/get_printable_param.hpp @@ -115,8 +115,7 @@ void GetPrintableParam(util::ParamData& data, const void* /* input */, void* output) { - *((std::string*) output) = - GetPrintableParam>(data); + *((std::string*) output) = GetPrintableParam>(data); } } // namespace python diff --git a/src/mlpack/bindings/python/get_printable_type.hpp b/src/mlpack/bindings/python/get_printable_type.hpp index 741dd68061..8d55a30b92 100644 --- a/src/mlpack/bindings/python/get_printable_type.hpp +++ b/src/mlpack/bindings/python/get_printable_type.hpp @@ -50,12 +50,9 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const std::enable_if_t< - !util::IsStdVector::value>*, - const std::enable_if_t< - !data::HasSerialize::value>*, - const std::enable_if_t< - !arma::is_arma_type::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, const std::enable_if_t>>*); @@ -110,8 +107,7 @@ void GetPrintableType(util::ParamData& d, const void* /* input */, void* output) { - *((std::string*) output) = - GetPrintableType>(d); + *((std::string*) output) = GetPrintableType>(d); } } // namespace python diff --git a/src/mlpack/bindings/python/get_printable_type_impl.hpp b/src/mlpack/bindings/python/get_printable_type_impl.hpp index fab3255956..cd8851da38 100644 --- a/src/mlpack/bindings/python/get_printable_type_impl.hpp +++ b/src/mlpack/bindings/python/get_printable_type_impl.hpp @@ -58,12 +58,9 @@ inline std::string GetPrintableType( template<> inline std::string GetPrintableType( util::ParamData& /* d */, - const std::enable_if_t< - !util::IsStdVector::value>*, - const std::enable_if_t< - !data::HasSerialize::value>*, - const std::enable_if_t< - !arma::is_arma_type::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, + const std::enable_if_t::value>*, const std::enable_if_t>>*) { diff --git a/src/mlpack/bindings/python/is_serializable.hpp b/src/mlpack/bindings/python/is_serializable.hpp index 0c326dd81c..6c014593fc 100644 --- a/src/mlpack/bindings/python/is_serializable.hpp +++ b/src/mlpack/bindings/python/is_serializable.hpp @@ -39,8 +39,7 @@ void IsSerializable(util::ParamData& data, const void* /* input */, void* output) { - *((bool*) output) = - IsSerializable>(data); + *((bool*) output) = IsSerializable>(data); } } // namespace python diff --git a/src/mlpack/bindings/python/print_doc.hpp b/src/mlpack/bindings/python/print_doc.hpp index d9410c3a44..dfb49fa136 100644 --- a/src/mlpack/bindings/python/print_doc.hpp +++ b/src/mlpack/bindings/python/print_doc.hpp @@ -42,8 +42,7 @@ void PrintDoc(util::ParamData& d, oss << " - "; oss << GetValidName(d.name); oss << " ("; - oss << GetPrintableType>(d) << "): " - << d.desc; + oss << GetPrintableType>(d) << "): " << d.desc; // Print a default, if possible. if (!d.required) diff --git a/src/mlpack/bindings/python/print_input_processing.hpp b/src/mlpack/bindings/python/print_input_processing.hpp index e20a28503d..f7a7ab98a8 100644 --- a/src/mlpack/bindings/python/print_input_processing.hpp +++ b/src/mlpack/bindings/python/print_input_processing.hpp @@ -550,8 +550,7 @@ void PrintInputProcessing(util::ParamData& d, const void* input, void* /* output */) { - PrintInputProcessing>(d, - *((size_t*) input)); + PrintInputProcessing>(d, *((size_t*) input)); } } // namespace python diff --git a/src/mlpack/bindings/python/print_type_doc.hpp b/src/mlpack/bindings/python/print_type_doc.hpp index 2f4b906b8c..e7981d89f9 100644 --- a/src/mlpack/bindings/python/print_type_doc.hpp +++ b/src/mlpack/bindings/python/print_type_doc.hpp @@ -73,8 +73,7 @@ void PrintTypeDoc(util::ParamData& data, const void* /* input */, void* output) { - *((std::string*) output) = - PrintTypeDoc>(data); + *((std::string*) output) = PrintTypeDoc>(data); } } // namespace python diff --git a/src/mlpack/bindings/tests/get_allocated_memory.hpp b/src/mlpack/bindings/tests/get_allocated_memory.hpp index dccf4f2a6c..903b17420f 100644 --- a/src/mlpack/bindings/tests/get_allocated_memory.hpp +++ b/src/mlpack/bindings/tests/get_allocated_memory.hpp @@ -51,8 +51,7 @@ void GetAllocatedMemory(util::ParamData& d, const void* /* input */, void* output) { - *((void**) output) = - GetAllocatedMemory>(d); + *((void**) output) = GetAllocatedMemory>(d); } } // namespace tests diff --git a/src/mlpack/bindings/tests/get_printable_param.hpp b/src/mlpack/bindings/tests/get_printable_param.hpp index c7f12cd08f..bb72dd93a2 100644 --- a/src/mlpack/bindings/tests/get_printable_param.hpp +++ b/src/mlpack/bindings/tests/get_printable_param.hpp @@ -77,8 +77,7 @@ void GetPrintableParam(util::ParamData& data, const void* /* input */, void* output) { - *((std::string*) output) = - GetPrintableParam>(data); + *((std::string*) output) = GetPrintableParam>(data); } } // namespace tests diff --git a/src/mlpack/core/cereal/is_loading.hpp b/src/mlpack/core/cereal/is_loading.hpp index 3be9d12426..f6346abfce 100644 --- a/src/mlpack/core/cereal/is_loading.hpp +++ b/src/mlpack/core/cereal/is_loading.hpp @@ -38,16 +38,14 @@ struct is_cereal_archive template bool is_loading( - const std::enable_if_t< - is_cereal_archive::value, Archive>* = 0) + const std::enable_if_t::value, Archive>* = 0) { return true; } template bool is_loading( - const std::enable_if_t< - !is_cereal_archive::value, Archive>* = 0) + const std::enable_if_t::value, Archive>* = 0) { return false; } diff --git a/src/mlpack/core/cv/cv_base.hpp b/src/mlpack/core/cv/cv_base.hpp index 832f65a694..1ca40368ff 100644 --- a/src/mlpack/core/cv/cv_base.hpp +++ b/src/mlpack/core/cv/cv_base.hpp @@ -206,8 +206,7 @@ class CVBase */ template> + typename = std::enable_if_t> MLAlgorithm TrainModel(const MatType& xs, const PredictionsType& ys, const MLAlgorithmArgs&... args); @@ -218,8 +217,7 @@ class CVBase */ template, + typename = std::enable_if_t, typename = void> MLAlgorithm TrainModel(const MatType& xs, const PredictionsType& ys, diff --git a/src/mlpack/core/data/string_encoding_impl.hpp b/src/mlpack/core/data/string_encoding_impl.hpp index 2a0f091161..764fbae11a 100644 --- a/src/mlpack/core/data/string_encoding_impl.hpp +++ b/src/mlpack/core/data/string_encoding_impl.hpp @@ -71,8 +71,8 @@ void StringEncoding::CreateMap( static_assert( std::is_same_v, - std::remove_reference_t>, + std::remove_reference_t>, "The dictionary token type doesn't match the return value type " "of the tokenizer."); @@ -117,8 +117,8 @@ EncodeHelper(const std::vector& input, static_assert( std::is_same_v, - std::remove_reference_t>, + std::remove_reference_t>, "The dictionary token type doesn't match the return value type " "of the tokenizer."); @@ -177,8 +177,8 @@ EncodeHelper(const std::vector& input, static_assert( std::is_same_v, - std::remove_reference_t>, + std::remove_reference_t>, "The dictionary token type doesn't match the return value type " "of the tokenizer."); diff --git a/src/mlpack/core/hpt/hpt.hpp b/src/mlpack/core/hpt/hpt.hpp index 9f20b7deb7..fdfc237f9f 100644 --- a/src/mlpack/core/hpt/hpt.hpp +++ b/src/mlpack/core/hpt/hpt.hpp @@ -201,8 +201,7 @@ class HyperParameterTuner //! A short alias for the full type of the cross-validation. using CVType = std::conditional_t, - CV, MatType, PredictionsType, - WeightsType>>; + CV, MatType, PredictionsType, WeightsType>>; //! The cross-validation object for assessing sets of hyper-parameters. diff --git a/src/mlpack/core/tree/address.hpp b/src/mlpack/core/tree/address.hpp index e999e01144..e2e4250887 100644 --- a/src/mlpack/core/tree/address.hpp +++ b/src/mlpack/core/tree/address.hpp @@ -58,7 +58,7 @@ void PointToAddress(AddressType& address, const VecType& point) // Check that the arguments are compatible. typedef std::conditional_tAddressElemType; + uint64_t> AddressElemType; static_assert(std::is_same_v == true, "The vector element type does not " @@ -154,7 +154,7 @@ void AddressToPoint(VecType& point, const AddressType& address) // Check that the arguments are compatible. typedef std::conditional_tAddressElemType; + uint64_t> AddressElemType; static_assert(std::is_same_v == true, "The vector element type does not " diff --git a/src/mlpack/core/tree/binary_space_tree/ub_tree_split.hpp b/src/mlpack/core/tree/binary_space_tree/ub_tree_split.hpp index 59d8add197..79e2ba818d 100644 --- a/src/mlpack/core/tree/binary_space_tree/ub_tree_split.hpp +++ b/src/mlpack/core/tree/binary_space_tree/ub_tree_split.hpp @@ -32,7 +32,7 @@ class UBTreeSplit typedef std::conditional_t< sizeof(typename MatType::elem_type) * CHAR_BIT <= 32, uint32_t, - uint64_t>AddressElemType; + uint64_t> AddressElemType; //! An information about the partition. struct SplitInfo diff --git a/src/mlpack/core/tree/build_tree.hpp b/src/mlpack/core/tree/build_tree.hpp index 3042684fd3..dc2b2570db 100644 --- a/src/mlpack/core/tree/build_tree.hpp +++ b/src/mlpack/core/tree/build_tree.hpp @@ -21,8 +21,7 @@ template TreeType* BuildTree( MatType&& dataset, std::vector& oldFromNew, - const std::enable_if_t< - TreeTraits::RearrangesDataset>* = 0) + const std::enable_if_t::RearrangesDataset>* = 0) { return new TreeType(std::forward(dataset), oldFromNew); } @@ -32,8 +31,7 @@ template TreeType* BuildTree( MatType&& dataset, const std::vector& /* oldFromNew */, - const std::enable_if_t< - !TreeTraits::RearrangesDataset>* = 0) + const std::enable_if_t::RearrangesDataset>* = 0) { return new TreeType(std::forward(dataset)); } diff --git a/src/mlpack/core/tree/cellbound.hpp b/src/mlpack/core/tree/cellbound.hpp index 3fb2bfbb09..21b31dbe9f 100644 --- a/src/mlpack/core/tree/cellbound.hpp +++ b/src/mlpack/core/tree/cellbound.hpp @@ -78,7 +78,7 @@ class CellBound //! uint32_t or uint64_t. typedef std::conditional_tAddressElemType; + uint64_t> AddressElemType; /** * Empty constructor; creates a bound of dimensionality 0. diff --git a/src/mlpack/core/tree/rectangle_tree/discrete_hilbert_value.hpp b/src/mlpack/core/tree/rectangle_tree/discrete_hilbert_value.hpp index 3ccd204a75..62c1329b5f 100644 --- a/src/mlpack/core/tree/rectangle_tree/discrete_hilbert_value.hpp +++ b/src/mlpack/core/tree/rectangle_tree/discrete_hilbert_value.hpp @@ -32,7 +32,7 @@ class DiscreteHilbertValue //! uint32_t or uint64_t. typedef std::conditional_tHilbertElemType; + uint64_t> HilbertElemType; //! Default constructor. DiscreteHilbertValue(); diff --git a/src/mlpack/core/util/ens_traits.hpp b/src/mlpack/core/util/ens_traits.hpp index cade7a7069..36faa4dcc8 100644 --- a/src/mlpack/core/util/ens_traits.hpp +++ b/src/mlpack/core/util/ens_traits.hpp @@ -55,8 +55,7 @@ struct IsEnsOptimizerInternal { // If OptimizerType is a reference type, then forming the types below will // fail. So we need to strip the reference (and the const for good measure). - typedef std::remove_cv_t< - std::remove_reference_t> + typedef std::remove_cv_t> SafeOptimizerType; using OptimizeElemReturnForm = @@ -85,9 +84,8 @@ template struct IsEnsCallbackTypes { constexpr static bool value = - std::is_class_v - >> && IsEnsCallbackTypes::value; + std::is_class_v>> + && IsEnsCallbackTypes::value; }; template<> diff --git a/src/mlpack/core/util/first_element_is_arma.hpp b/src/mlpack/core/util/first_element_is_arma.hpp index 7bec0f54e7..dd6d1fc11b 100644 --- a/src/mlpack/core/util/first_element_is_arma.hpp +++ b/src/mlpack/core/util/first_element_is_arma.hpp @@ -39,9 +39,7 @@ template struct FirstElementIsArma { static constexpr bool value = arma::is_arma_type< - std::remove_reference_t< - typename First::type - >>::value; + std::remove_reference_t::type>>::value; }; } // namespace mlpack diff --git a/src/mlpack/core/util/sfinae_utility.hpp b/src/mlpack/core/util/sfinae_utility.hpp index b1747bd4a4..62b8c795f6 100644 --- a/src/mlpack/core/util/sfinae_utility.hpp +++ b/src/mlpack/core/util/sfinae_utility.hpp @@ -155,8 +155,7 @@ struct NAME \ using no = char[2]; \ \ template \ - using EnableIfVoid = \ - std::enable_if_t, ResultType>; \ + using EnableIfVoid = std::enable_if_t, ResultType>; \ \ template \ static EnableIfVoid()(&C::METHOD)), yes&> chk(int); \ @@ -169,13 +168,13 @@ struct NAME \ template \ struct WithGreaterOrEqualNumberOfAdditionalArgs \ { \ - using type = typename std::conditional< \ + using type = std::conditional_t< \ WithNAdditionalArgs::value, \ std::true_type, \ - typename std::conditional< \ + std::conditional_t< \ N < MAXN, \ WithGreaterOrEqualNumberOfAdditionalArgs, \ - std::false_type>::type>::type; \ + std::false_type>>; \ static const bool value = type::value; \ }; \ \ diff --git a/src/mlpack/core/util/size_checks.hpp b/src/mlpack/core/util/size_checks.hpp index 2d55c25f23..6999ad31e3 100644 --- a/src/mlpack/core/util/size_checks.hpp +++ b/src/mlpack/core/util/size_checks.hpp @@ -39,8 +39,7 @@ inline void CheckSameSizes( const std::string& addInfo = "labels", const bool& isDataTranspose = false, const bool& isLabelTranspose = false, - const std::enable_if_t< - !std::is_integral_v>* = 0) + const std::enable_if_t>* = 0) { const size_t dataPoints = (isDataTranspose == true) ? data.n_rows : data.n_cols; diff --git a/src/mlpack/methods/adaboost/adaboost.hpp b/src/mlpack/methods/adaboost/adaboost.hpp index e6a71275d1..a4d8b79966 100644 --- a/src/mlpack/methods/adaboost/adaboost.hpp +++ b/src/mlpack/methods/adaboost/adaboost.hpp @@ -131,8 +131,7 @@ class AdaBoost const size_t maxIterations = 100, const ElemType tolerance = 1e-6, const std::enable_if_t< - std::is_same_v - >* = 0); + std::is_same_v>* = 0); //! Get the maximum number of weak learners allowed in the model. size_t MaxIterations() const { return maxIterations; } diff --git a/src/mlpack/methods/ann/convolution_rules/fft_convolution.hpp b/src/mlpack/methods/ann/convolution_rules/fft_convolution.hpp index 0405619572..5e2dfa4772 100644 --- a/src/mlpack/methods/ann/convolution_rules/fft_convolution.hpp +++ b/src/mlpack/methods/ann/convolution_rules/fft_convolution.hpp @@ -48,8 +48,7 @@ class FFTConvolution * @param output Output data that contains the results of the convolution. */ template - static std::enable_if_t< - std::is_same_v, void> + static std::enable_if_t, void> Convolution(const MatType& input, const MatType& filter, MatType& output, @@ -83,8 +82,7 @@ class FFTConvolution * @param output Output data that contains the results of the convolution. */ template - static std::enable_if_t< - std::is_same_v, void> + static std::enable_if_t, void> Convolution(const MatType& input, const MatType& filter, MatType& output, diff --git a/src/mlpack/methods/ann/convolution_rules/naive_convolution.hpp b/src/mlpack/methods/ann/convolution_rules/naive_convolution.hpp index 1243479b74..a323c7b38f 100644 --- a/src/mlpack/methods/ann/convolution_rules/naive_convolution.hpp +++ b/src/mlpack/methods/ann/convolution_rules/naive_convolution.hpp @@ -49,8 +49,7 @@ class NaiveConvolution */ template - static std::enable_if_t< - std::is_same_v, void> + static std::enable_if_t, void> Convolution(const InMatType& input, const FilMatType& filter, OutMatType& output, @@ -110,8 +109,7 @@ class NaiveConvolution */ template - static std::enable_if_t< - std::is_same_v, void> + static std::enable_if_t, void> Convolution(const InMatType& input, const FilMatType& filter, OutMatType& output, diff --git a/src/mlpack/methods/ann/ffn.hpp b/src/mlpack/methods/ann/ffn.hpp index 671d82f962..f4ca7ea933 100644 --- a/src/mlpack/methods/ann/ffn.hpp +++ b/src/mlpack/methods/ann/ffn.hpp @@ -487,8 +487,7 @@ class FFN */ template std::enable_if_t< - ens::traits::HasMaxIterationsSignature::value, void - > + ens::traits::HasMaxIterationsSignature::value, void> WarnMessageMaxIterations(OptimizerType& optimizer, size_t samples) const; /** @@ -501,8 +500,7 @@ class FFN */ template std::enable_if_t< - !ens::traits::HasMaxIterationsSignature::value, void - > + !ens::traits::HasMaxIterationsSignature::value, void> WarnMessageMaxIterations(OptimizerType& optimizer, size_t samples) const; //! Instantiated output layer used to evaluate the network. diff --git a/src/mlpack/methods/ann/ffn_impl.hpp b/src/mlpack/methods/ann/ffn_impl.hpp index 980e3fd2a6..e41b2f2db8 100644 --- a/src/mlpack/methods/ann/ffn_impl.hpp +++ b/src/mlpack/methods/ann/ffn_impl.hpp @@ -695,8 +695,7 @@ template template std::enable_if_t< - ens::traits::HasMaxIterationsSignature::value, void -> + ens::traits::HasMaxIterationsSignature::value, void> FFN< OutputLayerType, InitializationRuleType, @@ -719,8 +718,7 @@ template template std::enable_if_t< - !ens::traits::HasMaxIterationsSignature::value, void -> + !ens::traits::HasMaxIterationsSignature::value, void> FFN< OutputLayerType, InitializationRuleType, diff --git a/src/mlpack/methods/ann/not_adapted/gan/gan.hpp b/src/mlpack/methods/ann/not_adapted/gan/gan.hpp index 2b754dddbe..0b2a43d0f8 100644 --- a/src/mlpack/methods/ann/not_adapted/gan/gan.hpp +++ b/src/mlpack/methods/ann/not_adapted/gan/gan.hpp @@ -135,7 +135,7 @@ class GAN */ template std::enable_if_t || - std::is_same_v, double> + std::is_same_v, double> Evaluate(const arma::mat& parameters, const size_t i, const size_t batchSize); @@ -149,8 +149,7 @@ class GAN * @param batchSize Variable to store the present number of inputs. */ template - std::enable_if_t, - double> + std::enable_if_t, double> Evaluate(const arma::mat& parameters, const size_t i, const size_t batchSize); @@ -164,8 +163,7 @@ class GAN * @param batchSize Variable to store the present number of inputs. */ template - std::enable_if_t, - double> + std::enable_if_t, double> Evaluate(const arma::mat& parameters, const size_t i, const size_t batchSize); @@ -182,7 +180,7 @@ class GAN */ template std::enable_if_t || - std::is_same_v, double> + std::is_same_v, double> EvaluateWithGradient(const arma::mat& parameters, const size_t i, GradType& gradient, @@ -199,8 +197,7 @@ class GAN * @param batchSize Variable to store the present number of inputs. */ template - std::enable_if_t, - double> + std::enable_if_t, double> EvaluateWithGradient(const arma::mat& parameters, const size_t i, GradType& gradient, @@ -217,8 +214,7 @@ class GAN * @param batchSize Variable to store the present number of inputs. */ template - std::enable_if_t, - double> + std::enable_if_t, double> EvaluateWithGradient(const arma::mat& parameters, const size_t i, GradType& gradient, @@ -236,7 +232,7 @@ class GAN */ template std::enable_if_t || - std::is_same_v, void> + std::is_same_v, void> Gradient(const arma::mat& parameters, const size_t i, arma::mat& gradient, @@ -270,8 +266,7 @@ class GAN * @param batchSize Variable to store the present number of inputs. */ template - std::enable_if_t, - void> + std::enable_if_t, void> Gradient(const arma::mat& parameters, const size_t i, arma::mat& gradient, diff --git a/src/mlpack/methods/ann/not_adapted/gan/gan_impl.hpp b/src/mlpack/methods/ann/not_adapted/gan/gan_impl.hpp index 88371bab52..1e29a4c573 100644 --- a/src/mlpack/methods/ann/not_adapted/gan/gan_impl.hpp +++ b/src/mlpack/methods/ann/not_adapted/gan/gan_impl.hpp @@ -234,7 +234,7 @@ template< > template std::enable_if_t || - std::is_same_v, double> + std::is_same_v, double> GAN::Evaluate( const arma::mat& /* parameters */, const size_t i, @@ -289,7 +289,7 @@ template< > template std::enable_if_t || - std::is_same_v, double> + std::is_same_v, double> GAN:: EvaluateWithGradient(const arma::mat& /* parameters */, const size_t i, @@ -392,7 +392,7 @@ template< > template std::enable_if_t || - std::is_same_v, void> + std::is_same_v, void> GAN:: Gradient(const arma::mat& parameters, const size_t i, diff --git a/src/mlpack/methods/ann/not_adapted/gan/wgangp_impl.hpp b/src/mlpack/methods/ann/not_adapted/gan/wgangp_impl.hpp index d4f49ace20..d983e48eb3 100644 --- a/src/mlpack/methods/ann/not_adapted/gan/wgangp_impl.hpp +++ b/src/mlpack/methods/ann/not_adapted/gan/wgangp_impl.hpp @@ -27,8 +27,7 @@ template< typename PolicyType > template -std::enable_if_t, - double> +std::enable_if_t, double> GAN::Evaluate( const arma::mat& /* parameters */, const size_t i, @@ -95,8 +94,7 @@ template< typename PolicyType > template -std::enable_if_t, - double> +std::enable_if_t, double> GAN:: EvaluateWithGradient(const arma::mat& /* parameters */, const size_t i, @@ -209,8 +207,7 @@ template< typename PolicyType > template -std::enable_if_t, - void> +std::enable_if_t, void> GAN:: Gradient(const arma::mat& parameters, const size_t i, diff --git a/src/mlpack/methods/ann/not_adapted/rbm/rbm.hpp b/src/mlpack/methods/ann/not_adapted/rbm/rbm.hpp index cd15b08d01..b5afe73bf9 100644 --- a/src/mlpack/methods/ann/not_adapted/rbm/rbm.hpp +++ b/src/mlpack/methods/ann/not_adapted/rbm/rbm.hpp @@ -130,8 +130,7 @@ class RBM * @param input The visible layer neurons. */ template - std::enable_if_t, - double> + std::enable_if_t, double> FreeEnergy(const arma::Mat& input); /** diff --git a/src/mlpack/methods/bayesian_linear_regression/bayesian_linear_regression.hpp b/src/mlpack/methods/bayesian_linear_regression/bayesian_linear_regression.hpp index 84779e9723..06459fbd1f 100644 --- a/src/mlpack/methods/bayesian_linear_regression/bayesian_linear_regression.hpp +++ b/src/mlpack/methods/bayesian_linear_regression/bayesian_linear_regression.hpp @@ -140,8 +140,7 @@ class BayesianLinearRegression template - >> + std::is_same_v>> BayesianLinearRegression(const MatType& data, const ResponsesType& responses, const bool centerData = true, @@ -176,8 +175,7 @@ class BayesianLinearRegression typename ResponsesType, typename = void, /* so MetaInfoExtractor does not get confused */ typename = std::enable_if_t< - std::is_same_v - >> + std::is_same_v>> ElemType Train(const MatType& data, const ResponsesType& responses, const std::optional centerData = std::nullopt, @@ -188,8 +186,7 @@ class BayesianLinearRegression typename ResponsesType, typename = void, /* so MetaInfoExtractor does not get confused */ typename = std::enable_if_t< - std::is_same_v - >> + std::is_same_v>> ElemType Train(const MatType& data, const ResponsesType& responses, const bool centerData, @@ -232,8 +229,7 @@ class BayesianLinearRegression template - >> + std::is_same_v>> void Predict(const MatType& points, ResponsesType& predictions) const; @@ -250,8 +246,7 @@ class BayesianLinearRegression template - >> + std::is_same_v>> void Predict(const MatType& points, ResponsesType& predictions, ResponsesType& std) const; @@ -267,8 +262,7 @@ class BayesianLinearRegression template - >> + std::is_same_v>> ElemType RMSE(const MatType& data, const ResponsesType& responses) const; diff --git a/src/mlpack/methods/decision_tree/decision_tree_impl.hpp b/src/mlpack/methods/decision_tree/decision_tree_impl.hpp index b8102a2445..c677e34c47 100644 --- a/src/mlpack/methods/decision_tree/decision_tree_impl.hpp +++ b/src/mlpack/methods/decision_tree/decision_tree_impl.hpp @@ -536,8 +536,7 @@ double DecisionTree>::value>*) + arma::is_arma_type>::value>*) { // Sanity check on data. util::CheckSameSizes(data, labels, "DecisionTree::Train()"); @@ -581,8 +580,7 @@ double DecisionTree>::value>*) + arma::is_arma_type>::value>*) { // Sanity check on data. util::CheckSameSizes(data, labels, "DecisionTree::Train()"); diff --git a/src/mlpack/methods/decision_tree/decision_tree_regressor_impl.hpp b/src/mlpack/methods/decision_tree/decision_tree_regressor_impl.hpp index b2fc5538a5..dd950a97f8 100644 --- a/src/mlpack/methods/decision_tree/decision_tree_regressor_impl.hpp +++ b/src/mlpack/methods/decision_tree/decision_tree_regressor_impl.hpp @@ -165,9 +165,8 @@ DecisionTreeRegressor>::value>*) : splitInfo() + arma::is_arma_type>::value>*) + : splitInfo() { using TrueMatType = std::decay_t; using TrueResponsesType = std::decay_t; @@ -246,11 +245,10 @@ DecisionTreeRegressor>::value>*): - splitInfo(std::move(other.splitInfo)), - NumericAuxiliarySplitInfo(other), - CategoricalAuxiliarySplitInfo(other) // other info does need to copy + std::remove_reference_t>::value>*) + : splitInfo(std::move(other.splitInfo)), + NumericAuxiliarySplitInfo(other), + CategoricalAuxiliarySplitInfo(other) // other info does need to copy { using TrueMatType = std::decay_t; using TrueResponsesType = std::decay_t; @@ -521,9 +519,7 @@ double DecisionTreeRegressor>::value>*) + arma::is_arma_type>::value>*) { // Sanity check on data. util::CheckSameSizes(data, responses, "DecisionTreeRegressor::Train()"); @@ -567,9 +563,7 @@ double DecisionTreeRegressor>::value>*) + arma::is_arma_type>::value>*) { // Sanity check on data. util::CheckSameSizes(data, responses, "DecisionTreeRegressor::Train()"); diff --git a/src/mlpack/methods/det/dtree_impl.hpp b/src/mlpack/methods/det/dtree_impl.hpp index e62c851f9e..78239a60de 100644 --- a/src/mlpack/methods/det/dtree_impl.hpp +++ b/src/mlpack/methods/det/dtree_impl.hpp @@ -29,8 +29,7 @@ void ExtractSplits(std::vector>& splitVec, const size_t end, const size_t minLeafSize) { - static_assert( - std::is_same_v == true, + static_assert(std::is_same_v, "The ElemType does not correspond to the matrix's element type."); typedef std::pair SplitItem; diff --git a/src/mlpack/methods/gmm/em_fit_impl.hpp b/src/mlpack/methods/gmm/em_fit_impl.hpp index 485d147c02..26af885206 100644 --- a/src/mlpack/methods/gmm/em_fit_impl.hpp +++ b/src/mlpack/methods/gmm/em_fit_impl.hpp @@ -298,8 +298,8 @@ InitialClustering(const arma::mat& observations, std::vector means(dists.size()); // Conditional covariance instantiation. - std::vector::type> covs(dists.size()); + std::vector> + covs(dists.size()); // Now calculate the means, covariances, and weights. weights.zeros(); diff --git a/src/mlpack/methods/gmm/positive_definite_constraint.hpp b/src/mlpack/methods/gmm/positive_definite_constraint.hpp index a153533ded..29d1e12f67 100644 --- a/src/mlpack/methods/gmm/positive_definite_constraint.hpp +++ b/src/mlpack/methods/gmm/positive_definite_constraint.hpp @@ -35,8 +35,7 @@ class PositiveDefiniteConstraint template static void ApplyConstraint( MatType& covariance, - const std::enable_if_t::value>* - /* junk */ = 0) + const std::enable_if_t::value>* /* junk */ = 0) { typedef typename MatType::elem_type ElemType; typedef typename GetColType::type VecType; @@ -82,8 +81,7 @@ class PositiveDefiniteConstraint template static void ApplyConstraint( VecType& diagCovariance, - const std::enable_if_t::value>* - /* junk */ = 0) + const std::enable_if_t::value>* /* junk */ = 0) { typedef typename VecType::elem_type ElemType; diff --git a/src/mlpack/methods/kmeans/dual_tree_kmeans_impl.hpp b/src/mlpack/methods/kmeans/dual_tree_kmeans_impl.hpp index 691e8b75e8..f5c7df5a58 100644 --- a/src/mlpack/methods/kmeans/dual_tree_kmeans_impl.hpp +++ b/src/mlpack/methods/kmeans/dual_tree_kmeans_impl.hpp @@ -27,8 +27,7 @@ template TreeType* BuildForcedLeafSizeTree( MatType&& dataset, std::vector& oldFromNew, - const std::enable_if_t< - TreeTraits::RearrangesDataset>* = 0) + const std::enable_if_t::RearrangesDataset>* = 0) { // This is a hack. I know this will be BinarySpaceTree, so force a leaf size // of one. @@ -40,8 +39,7 @@ template TreeType* BuildForcedLeafSizeTree( MatType&& dataset, const std::vector& /* oldFromNew */, - const std::enable_if_t< - !TreeTraits::RearrangesDataset>* = 0) + const std::enable_if_t::RearrangesDataset>* = 0) { return new TreeType(std::forward(dataset)); } diff --git a/src/mlpack/methods/lars/lars.hpp b/src/mlpack/methods/lars/lars.hpp index fa001aba96..0700b686f5 100644 --- a/src/mlpack/methods/lars/lars.hpp +++ b/src/mlpack/methods/lars/lars.hpp @@ -166,8 +166,7 @@ class LARS template - >> + std::is_same_v>> LARS(const MatType& data, const ResponsesType& responses, bool colMajor = true, @@ -205,8 +204,7 @@ class LARS template - >> + std::is_same_v>> LARS(const MatType& data, const ResponsesType& responses, const bool colMajor, @@ -297,11 +295,9 @@ class LARS typename ResponsesType, typename = void, /* so MetaInfoExtractor does not get confused */ typename = std::enable_if_t< - std::is_same_v - >, + std::is_same_v>, typename = std::enable_if_t< - !std::is_same_v - >> + !std::is_same_v>> ElemType Train(const MatType& data, const ResponsesType& responses, const bool colMajor = true); @@ -310,8 +306,7 @@ class LARS typename ResponsesType, typename = void, /* so MetaInfoExtractor does not get confused */ typename = std::enable_if_t< - std::is_same_v - >> + std::is_same_v>> ElemType Train(const MatType& data, const ResponsesType& responses, const bool colMajor, @@ -321,8 +316,7 @@ class LARS typename ResponsesType, typename = void, /* so MetaInfoExtractor does not get confused */ typename = std::enable_if_t< - std::is_same_v - >> + std::is_same_v>> ElemType Train(const MatType& data, const ResponsesType& responses, const bool colMajor, @@ -333,8 +327,7 @@ class LARS typename ResponsesType, typename = void, /* so MetaInfoExtractor does not get confused */ typename = std::enable_if_t< - std::is_same_v - >> + std::is_same_v>> ElemType Train(const MatType& data, const ResponsesType& responses, const bool colMajor, @@ -346,8 +339,7 @@ class LARS typename ResponsesType, typename = void, /* so MetaInfoExtractor does not get confused */ typename = std::enable_if_t< - std::is_same_v - >> + std::is_same_v>> ElemType Train(const MatType& data, const ResponsesType& responses, const bool colMajor, @@ -360,8 +352,7 @@ class LARS typename ResponsesType, typename = void, /* so MetaInfoExtractor does not get confused */ typename = std::enable_if_t< - std::is_same_v - >> + std::is_same_v>> ElemType Train(const MatType& data, const ResponsesType& responses, const bool colMajor, @@ -375,8 +366,7 @@ class LARS typename ResponsesType, typename = void, /* so MetaInfoExtractor does not get confused */ typename = std::enable_if_t< - std::is_same_v - >> + std::is_same_v>> ElemType Train(const MatType& data, const ResponsesType& responses, const bool colMajor, @@ -408,8 +398,7 @@ class LARS typename ResponsesType, typename = void, /* so MetaInfoExtractor does not get confused */ typename = std::enable_if_t< - std::is_same_v - >> + std::is_same_v>> ElemType Train(const MatType& data, const ResponsesType& responses, const bool colMajor, @@ -420,8 +409,7 @@ class LARS typename ResponsesType, typename = void, /* so MetaInfoExtractor does not get confused */ typename = std::enable_if_t< - std::is_same_v - >> + std::is_same_v>> ElemType Train(const MatType& data, const ResponsesType& responses, const bool colMajor, @@ -433,8 +421,7 @@ class LARS typename ResponsesType, typename = void, /* so MetaInfoExtractor does not get confused */ typename = std::enable_if_t< - std::is_same_v - >> + std::is_same_v>> ElemType Train(const MatType& data, const ResponsesType& responses, const bool colMajor, @@ -447,8 +434,7 @@ class LARS typename ResponsesType, typename = void, /* so MetaInfoExtractor does not get confused */ typename = std::enable_if_t< - std::is_same_v - >> + std::is_same_v>> ElemType Train(const MatType& data, const ResponsesType& responses, const bool colMajor, @@ -462,8 +448,7 @@ class LARS typename ResponsesType, typename = void, /* so MetaInfoExtractor does not get confused */ typename = std::enable_if_t< - std::is_same_v - >> + std::is_same_v>> ElemType Train(const MatType& data, const ResponsesType& responses, const bool colMajor, @@ -478,8 +463,7 @@ class LARS typename ResponsesType, typename = void, /* so MetaInfoExtractor does not get confused */ typename = std::enable_if_t< - std::is_same_v - >> + std::is_same_v>> ElemType Train(const MatType& data, const ResponsesType& responses, const bool colMajor, diff --git a/src/mlpack/methods/linear_regression/linear_regression.hpp b/src/mlpack/methods/linear_regression/linear_regression.hpp index 639d23eb01..d36c855d7d 100644 --- a/src/mlpack/methods/linear_regression/linear_regression.hpp +++ b/src/mlpack/methods/linear_regression/linear_regression.hpp @@ -44,8 +44,7 @@ class LinearRegression template - >> + std::is_same_v>> LinearRegression(const MatType& predictors, const ResponsesType& responses, const double lambda = 0, @@ -64,11 +63,9 @@ class LinearRegression typename ResponsesType, typename WeightsType, typename = std::enable_if_t< - std::is_same_v - >, + std::is_same_v>, typename = std::enable_if_t< - std::is_same_v - >> + std::is_same_v>> LinearRegression(const MatType& predictors, const ResponsesType& responses, const WeightsType& weights, @@ -103,8 +100,7 @@ class LinearRegression double Train(const arma::mat& predictors, const arma::rowvec& responses, const T intercept, - const std::enable_if_t - >* = 0); + const std::enable_if_t>* = 0); /** * Train the LinearRegression model on the given data and instance weights. @@ -129,8 +125,7 @@ class LinearRegression const arma::rowvec& responses, const arma::rowvec& weights, const T intercept, - const std::enable_if_t - >* = 0); + const std::enable_if_t>* = 0); /** * Train the LinearRegression model. This is a dummy overload so that @@ -158,8 +153,7 @@ class LinearRegression typename ResponsesType, typename = void, /* so MetaInfoExtractor does not get confused */ typename = std::enable_if_t< - std::is_same_v - >> + std::is_same_v>> ElemType Train(const MatType& predictors, const ResponsesType& responses, const std::optional lambda = std::nullopt, @@ -193,11 +187,9 @@ class LinearRegression typename ResponsesType, typename WeightsType, typename = std::enable_if_t< - std::is_same_v - >, + std::is_same_v>, typename = std::enable_if_t< - std::is_same_v - >> + std::is_same_v>> ElemType Train(const MatType& predictors, const ResponsesType& responses, const WeightsType& weights, diff --git a/src/mlpack/methods/lmnn/lmnn.hpp b/src/mlpack/methods/lmnn/lmnn.hpp index 6f62734b4b..e2ba1edebc 100644 --- a/src/mlpack/methods/lmnn/lmnn.hpp +++ b/src/mlpack/methods/lmnn/lmnn.hpp @@ -101,8 +101,7 @@ class LMNN CallbackTypes... >::value>, typename = std::enable_if_t< - !FirstElementIsArma::value - >> + !FirstElementIsArma::value>> [[deprecated("Will be removed in mlpack 5.0.0. Use the version that takes a " "dataset as a parameter.")]] void LearnDistance(arma::mat& outputMatrix, CallbackTypes&&... callbacks); diff --git a/src/mlpack/methods/lsh/lsh_search_impl.hpp b/src/mlpack/methods/lsh/lsh_search_impl.hpp index 151c84f238..c45a9eebc2 100644 --- a/src/mlpack/methods/lsh/lsh_search_impl.hpp +++ b/src/mlpack/methods/lsh/lsh_search_impl.hpp @@ -647,8 +647,7 @@ void LSHSearch::GetAdditionalProbingBins( std::priority_queue< std::pair, // contents: pairs of (score, index) std::vector< // container: vector of pairs - std::pair - >, + std::pair>, std::greater< std::pair > // comparator of pairs > minHeap; // our minheap diff --git a/src/mlpack/methods/naive_bayes/naive_bayes_classifier_impl.hpp b/src/mlpack/methods/naive_bayes/naive_bayes_classifier_impl.hpp index 7e8ced7b3c..16343bc01c 100644 --- a/src/mlpack/methods/naive_bayes/naive_bayes_classifier_impl.hpp +++ b/src/mlpack/methods/naive_bayes/naive_bayes_classifier_impl.hpp @@ -274,7 +274,7 @@ void NaiveBayesClassifier::Classify( "NaiveBayesClassifier: element type of given data must match the element " "type of the model!"); static_assert(std::is_same_v, + typename ProbabilitiesVecType::elem_type>, "NaiveBayesClassifier: element type of given data must match the element " "type of the model!"); @@ -349,7 +349,7 @@ void NaiveBayesClassifier::Classify( "NaiveBayesClassifier: element type of given data must match the element " "type of the model!"); static_assert(std::is_same_v, + typename ProbabilitiesMatType::elem_type>, "NaiveBayesClassifier: element type of given data must match the element " "type of the model!"); diff --git a/src/mlpack/methods/nca/nca.hpp b/src/mlpack/methods/nca/nca.hpp index 1d68ef4db3..189e5236d5 100644 --- a/src/mlpack/methods/nca/nca.hpp +++ b/src/mlpack/methods/nca/nca.hpp @@ -81,11 +81,9 @@ class NCA */ template::value>, + CallbackTypes...>::value>, typename = std::enable_if_t< - !FirstElementIsArma::value - >> + !FirstElementIsArma::value>> [[deprecated("Will be removed in mlpack 5.0.0. Use the version that takes a " "dataset as a parameter.")]] void LearnDistance(arma::mat& outputMatrix, CallbackTypes&&... callbacks); @@ -111,9 +109,8 @@ class NCA SoftmaxErrorFunction, MatType >::value>, - typename = std::enable_if_t::value>> + typename = std::enable_if_t< + IsEnsCallbackTypes::value>> void LearnDistance(const MatType& dataset, const LabelsType& labels, MatType& outputMatrix, diff --git a/src/mlpack/methods/pca/pca_impl.hpp b/src/mlpack/methods/pca/pca_impl.hpp index d8da5362bc..d4d4784036 100644 --- a/src/mlpack/methods/pca/pca_impl.hpp +++ b/src/mlpack/methods/pca/pca_impl.hpp @@ -48,7 +48,7 @@ void PCA::Apply(const MatType& data, static_assert(IsBaseMatType::value, "PCA::Apply(): eigVal must be a vector type!"); static_assert(std::is_same_v, + typename OutMatType::elem_type>, "PCA::Apply(): data and transformedData must have the same element " "types!"); @@ -82,7 +82,7 @@ void PCA::Apply(const MatType& data, static_assert(IsBaseMatType::value, "PCA::Apply(): eigVal must be a vector type!"); static_assert(std::is_same_v, + typename OutMatType::elem_type>, "PCA::Apply(): data and transformedData must have the same element " "types!"); @@ -105,7 +105,7 @@ void PCA::Apply(const MatType& data, static_assert(IsBaseMatType::value, "PCA::Apply(): transformedData must be a matrix type!"); static_assert(std::is_same_v, + typename OutMatType::elem_type>, "PCA::Apply(): data and transformedData must have the same element " "types!"); diff --git a/src/mlpack/methods/perceptron/perceptron_impl.hpp b/src/mlpack/methods/perceptron/perceptron_impl.hpp index b8dcc740e8..c03533889c 100644 --- a/src/mlpack/methods/perceptron/perceptron_impl.hpp +++ b/src/mlpack/methods/perceptron/perceptron_impl.hpp @@ -83,8 +83,7 @@ Perceptron::Perceptron( const size_t numClasses, const WeightsType& instanceWeights, const size_t maxIterations, - const std::enable_if_t< - arma::is_arma_type::value>*) : + const std::enable_if_t::value>*) : maxIterations(maxIterations) { // Start training. @@ -114,8 +113,7 @@ Perceptron::Perceptron( const arma::Row& labels, const size_t numClasses, const WeightsType& instanceWeights, - const std::enable_if_t< - arma::is_arma_type::value>*) : + const std::enable_if_t::value>*) : maxIterations(other.maxIterations) { TrainInternal(data, labels, numClasses, instanceWeights); diff --git a/src/mlpack/methods/softmax_regression/softmax_regression.hpp b/src/mlpack/methods/softmax_regression/softmax_regression.hpp index 8ce97ab28d..838bace925 100644 --- a/src/mlpack/methods/softmax_regression/softmax_regression.hpp +++ b/src/mlpack/methods/softmax_regression/softmax_regression.hpp @@ -96,9 +96,8 @@ class SoftmaxRegression typename = std::enable_if_t, DenseMatType >::value>, - typename = std::enable_if_t::value>> + typename = std::enable_if_t< + IsEnsCallbackTypes::value>> SoftmaxRegression(const MatType& data, const arma::Row& labels, const size_t numClasses, @@ -128,9 +127,8 @@ class SoftmaxRegression typename = std::enable_if_t, DenseMatType >::value>, - typename = std::enable_if_t::value>> + typename = std::enable_if_t< + IsEnsCallbackTypes::value>> SoftmaxRegression(const MatType& data, const arma::Row& labels, const size_t numClasses, @@ -161,12 +159,9 @@ class SoftmaxRegression typename = std::enable_if_t, DenseMatType >::value>, + typename = std::enable_if_t>, typename = std::enable_if_t< - std::is_class_v - >, - typename = std::enable_if_t::value>> + IsEnsCallbackTypes::value>> [[deprecated("Will be removed in mlpack 5.0.0, use other Train() variants")]] double Train(const MatType& data, const arma::Row& labels, @@ -194,9 +189,8 @@ class SoftmaxRegression typename = std::enable_if_t, DenseMatType >::value>, - typename = std::enable_if_t::value>> + typename = std::enable_if_t< + IsEnsCallbackTypes::value>> ElemType Train(const MatType& data, const arma::Row& labels, const size_t numClasses, @@ -224,9 +218,8 @@ class SoftmaxRegression typename = std::enable_if_t, DenseMatType >::value>, - typename = std::enable_if_t::value>> + typename = std::enable_if_t< + IsEnsCallbackTypes::value>> ElemType Train(const MatType& data, const arma::Row& labels, const size_t numClasses, diff --git a/src/mlpack/tests/cv_test.cpp b/src/mlpack/tests/cv_test.cpp index a5ff8dc001..059dd80642 100644 --- a/src/mlpack/tests/cv_test.cpp +++ b/src/mlpack/tests/cv_test.cpp @@ -299,8 +299,7 @@ void CheckPredictionsType() { using Extractor = MetaInfoExtractor; using ActualPT = typename Extractor::PredictionsType; - static_assert(std::is_same_v, - "Should be the same"); + static_assert(std::is_same_v, "Should be the same"); } /** diff --git a/src/mlpack/tests/lars_test.cpp b/src/mlpack/tests/lars_test.cpp index c143fbd426..95220bccff 100644 --- a/src/mlpack/tests/lars_test.cpp +++ b/src/mlpack/tests/lars_test.cpp @@ -1244,8 +1244,7 @@ TEMPLATE_TEST_CASE("LARSSelectBetaTest", "[LARSTest]", arma::fmat, arma::mat) // Now step through numerous different lambda values. ElemType lastError = std::numeric_limits::max(); - const ElemType errorTol = (std::is_same_v) ? 1e-8 : - 0.05; + const ElemType errorTol = (std::is_same_v) ? 1e-8 : 0.05; for (ElemType i = 5.0; i >= -5.0; i -= 0.1) { const ElemType selLambda1 = std::pow(10.0, (ElemType) i); diff --git a/src/mlpack/tests/main_tests/main_test_fixture.hpp b/src/mlpack/tests/main_tests/main_test_fixture.hpp index 5c9cf94bac..1b7357513b 100644 --- a/src/mlpack/tests/main_tests/main_test_fixture.hpp +++ b/src/mlpack/tests/main_tests/main_test_fixture.hpp @@ -106,8 +106,7 @@ class MainTestFixture template void SetInputParam(const std::string& name, T&& value) { - params.Get>(name) = - std::forward(value); + params.Get>(name) = std::forward(value); params.SetPassed(name); } diff --git a/src/mlpack/tests/test_catch_tools.hpp b/src/mlpack/tests/test_catch_tools.hpp index 1377b7359a..229063ab9e 100644 --- a/src/mlpack/tests/test_catch_tools.hpp +++ b/src/mlpack/tests/test_catch_tools.hpp @@ -55,7 +55,7 @@ template ::value && arma::is_arma_type::value && std::is_same_v + typename MatTypeB::elem_type> && !std::is_integral_v>> inline void CheckMatrices(const MatTypeA& _a, const MatTypeB& _b, @@ -137,7 +137,7 @@ template ::value && arma::is_arma_cube_type::value && std::is_same_v + typename CubeTypeB::elem_type> && !std::is_integral_v>, typename = void> inline void CheckMatrices(const CubeTypeA& _a, diff --git a/src/mlpack/tests/ub_tree_test.cpp b/src/mlpack/tests/ub_tree_test.cpp index 874c5bab18..baf811019d 100644 --- a/src/mlpack/tests/ub_tree_test.cpp +++ b/src/mlpack/tests/ub_tree_test.cpp @@ -19,9 +19,9 @@ using namespace mlpack; TEST_CASE("AddressTest", "[UBTreeTest]") { typedef double ElemType; - typedef typename std::conditional::type AddressElemType; + uint64_t> AddressElemType; arma::Mat dataset(8, 1000); dataset.randu(); @@ -46,7 +46,7 @@ void CheckSplit(const TreeType& tree) typedef typename TreeType::ElemType ElemType; typedef std::conditional_tAddressElemType; + uint64_t> AddressElemType; if (tree.IsLeaf()) return; From c9263b5615e084e084181bbc1d02d5d3a3aee4ce Mon Sep 17 00:00:00 2001 From: Omar Shrit Date: Sun, 20 Oct 2024 23:21:45 +0200 Subject: [PATCH 19/24] Update src/mlpack/tests/cv_test.cpp Co-authored-by: Ryan Curtin --- src/mlpack/tests/cv_test.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/mlpack/tests/cv_test.cpp b/src/mlpack/tests/cv_test.cpp index 059dd80642..f7c4f66625 100644 --- a/src/mlpack/tests/cv_test.cpp +++ b/src/mlpack/tests/cv_test.cpp @@ -349,8 +349,7 @@ void CheckWeightsType() { using Extractor = MetaInfoExtractor; using ActualWT = typename Extractor::WeightsType; - static_assert(std::is_same_v, - "Should be the same"); + static_assert(std::is_same_v, "Should be the same"); } /** From 324b7dfc32d9bdd1a7d2c93fc18d2bdbf03b9bbe Mon Sep 17 00:00:00 2001 From: Martin Lambertsen Date: Mon, 21 Oct 2024 06:32:18 +0200 Subject: [PATCH 20/24] Fix line length --- src/mlpack/bindings/go/get_printable_param.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mlpack/bindings/go/get_printable_param.hpp b/src/mlpack/bindings/go/get_printable_param.hpp index 01b94df15a..2c89eb7fb7 100644 --- a/src/mlpack/bindings/go/get_printable_param.hpp +++ b/src/mlpack/bindings/go/get_printable_param.hpp @@ -96,8 +96,8 @@ std::string GetPrintableParam( const arma::mat& matrix = std::get<1>(tuple); std::ostringstream oss; - oss << matrix.n_rows << "x" << matrix.n_cols << " matrix with dimension type " - << "information"; + oss << matrix.n_rows << "x" << matrix.n_cols + << " matrix with dimension type information"; return oss.str(); } From 2e47805d5e9171cdef3ccc12b08cb5885bd20449 Mon Sep 17 00:00:00 2001 From: Martin Lambertsen Date: Mon, 21 Oct 2024 17:03:33 +0200 Subject: [PATCH 21/24] More formatting --- src/mlpack/core/util/sfinae_utility.hpp | 2 +- .../decision_tree_regressor_impl.hpp | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/mlpack/core/util/sfinae_utility.hpp b/src/mlpack/core/util/sfinae_utility.hpp index 62b8c795f6..e9cfc7eb54 100644 --- a/src/mlpack/core/util/sfinae_utility.hpp +++ b/src/mlpack/core/util/sfinae_utility.hpp @@ -202,7 +202,7 @@ struct NAME \ template \ static \ std::enable_if_t, int>\ - f(int) { return 1;} \ + f(int) { return 1; } \ \ template \ static char f(char) { return 0; } \ diff --git a/src/mlpack/methods/decision_tree/decision_tree_regressor_impl.hpp b/src/mlpack/methods/decision_tree/decision_tree_regressor_impl.hpp index dd950a97f8..73b226c89b 100644 --- a/src/mlpack/methods/decision_tree/decision_tree_regressor_impl.hpp +++ b/src/mlpack/methods/decision_tree/decision_tree_regressor_impl.hpp @@ -165,8 +165,8 @@ DecisionTreeRegressor>::value>*) - : splitInfo() + arma::is_arma_type>::value>*) : + splitInfo() { using TrueMatType = std::decay_t; using TrueResponsesType = std::decay_t; @@ -205,10 +205,10 @@ DecisionTreeRegressor>::value>*): - splitInfo(std::move(other.splitInfo)), - NumericAuxiliarySplitInfo(other), - CategoricalAuxiliarySplitInfo(other) + std::remove_reference_t>::value>*) : + splitInfo(std::move(other.splitInfo)), + NumericAuxiliarySplitInfo(other), + CategoricalAuxiliarySplitInfo(other) { using TrueMatType = std::decay_t; using TrueResponsesType = std::decay_t; @@ -245,10 +245,10 @@ DecisionTreeRegressor>::value>*) - : splitInfo(std::move(other.splitInfo)), - NumericAuxiliarySplitInfo(other), - CategoricalAuxiliarySplitInfo(other) // other info does need to copy + std::remove_reference_t>::value>*) : + splitInfo(std::move(other.splitInfo)), + NumericAuxiliarySplitInfo(other), + CategoricalAuxiliarySplitInfo(other) // other info does need to copy { using TrueMatType = std::decay_t; using TrueResponsesType = std::decay_t; From 61844246907242ebb3e77007dc556c9ea80d9cfe Mon Sep 17 00:00:00 2001 From: Ryan Curtin Date: Mon, 21 Oct 2024 21:29:14 -0400 Subject: [PATCH 22/24] Fix link. --- doc/user/core/trees/binary_space_tree.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/user/core/trees/binary_space_tree.md b/doc/user/core/trees/binary_space_tree.md index 0d51f7cdf1..c6ce2d08ea 100644 --- a/doc/user/core/trees/binary_space_tree.md +++ b/doc/user/core/trees/binary_space_tree.md @@ -1680,7 +1680,7 @@ For implementation details, see The `VantagePointSplit` class is a splitting strategy that can be used by [`BinarySpaceTree`](#binaryspacetree). It is the default strategy for splitting [`VPTree`s](vptree.md), and is detailed in -[the paper](https://www.mlpack.org/paper/uhlmann91.pdf). +[the paper](https://www.mlpack.org/papers/uhlmann91.pdf). Due to the nature of the split, ***`VantagePointSplit` should always be used with the [`HollowBallBound`](#hollowballbound)***. From 8f5bf8da77f5e0232d8c5198096f8295f7ba6c98 Mon Sep 17 00:00:00 2001 From: Ryan Curtin Date: Tue, 22 Oct 2024 09:18:01 -0400 Subject: [PATCH 23/24] Just use the direct ACM paper link instead of archive.org. --- doc/user/core/trees/vptree.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/user/core/trees/vptree.md b/doc/user/core/trees/vptree.md index f4f6c5e400..b0b916651d 100644 --- a/doc/user/core/trees/vptree.md +++ b/doc/user/core/trees/vptree.md @@ -32,7 +32,7 @@ additional functionality specific to vantage point trees. * [Vantage point tree on Wikipedia](https://en.wikipedia.org/wiki/Vantage-point_tree) * [`BinarySpaceTree`](binary_space_tree.md) * [Binary space partitioning on Wikipedia](https://dl.acm.org/doi/pdf/10.1145/361002.361007) - * [Data structures and algorithms for nearest neighbor search in general metric spaces (pdf)](https://scholar.archive.org/work/og2s6vjmcngfbkmesu3dbsazpq/access/wayback/https://dl.acm.org/doi/pdf/10.5555/313559.313789) + * [Data structures and algorithms for nearest neighbor search in general metric spaces (pdf)](https://dl.acm.org/doi/pdf/10.5555/313559.313789) * [Satisfying General Proximity/Similarity Queries with Metric Trees (pdf)](https://www.mlpack.org/papers/uhlmann91.pdf) * [Tree-Independent Dual-Tree Algorithms (pdf)](https://www.ratml.org/pub/pdf/2013tree.pdf) From 48333f91107e18eb418e877cb38b1f73cf229975 Mon Sep 17 00:00:00 2001 From: Ryan Curtin Date: Mon, 21 Oct 2024 21:31:26 -0400 Subject: [PATCH 24/24] Fix link to HMM regression PDF. --- doc/user/core/distributions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/user/core/distributions.md b/doc/user/core/distributions.md index 5fcedd558c..a01057b1ab 100644 --- a/doc/user/core/distributions.md +++ b/doc/user/core/distributions.md @@ -849,7 +849,7 @@ regression model's prediction on `x`. This class is meant to be used with mlpack's [HMM](/src/mlpack/methods/hmm/hmm.hpp) class for the task of -[HMM regression (pdf)](https://conservancy.umn.edu/bitstream/handle/11299/2532/1195.pdf). +[HMM regression (pdf)](https://citeseerx.ist.psu.edu/document?repid=rep1&type=pdf&doi=93a56eb64e77ac83404fddfd0036e95a742fcee6). ### Constructors