diff --git a/doc/developer/elemtype.md b/doc/developer/elemtype.md index a758414197..21d370af61 100644 --- a/doc/developer/elemtype.md +++ b/doc/developer/elemtype.md @@ -28,7 +28,7 @@ types cannot be used. easily defined as below: ```c++ -typedef typename MatType::elem_type ElemType; +using ElemType = typename MatType::elem_type; ``` and otherwise a template parameter with the name `ElemType` can be used. It is diff --git a/doc/developer/trees.md b/doc/developer/trees.md index bd9b0de1b2..04917e2c0c 100644 --- a/doc/developer/trees.md +++ b/doc/developer/trees.md @@ -202,7 +202,7 @@ class ExampleTree public: // This is the element type held by the matrix. // It will generally either be `double`, or `float`. - typedef typename MatType::elem_type ElemType; + using ElemType = typename MatType::elem_type; ////////////////////// //// Constructors //// diff --git a/doc/tutorials/fastmks.md b/doc/tutorials/fastmks.md index 21a0d4afb8..16351003c8 100644 --- a/doc/tutorials/fastmks.md +++ b/doc/tutorials/fastmks.md @@ -386,8 +386,9 @@ IPMetric metric(pk); // the custom base of 1.5 (default is 1.3). We have to be sure to use the right // type here -- FastMKS needs the FastMKSStat object as the tree's // StatisticType. -typedef CoverTree, FirstPointIsRoot, FastMKSStat> - TreeType; // Convenience typedef. +// Convenience typedef. +using TreeType = + CoverTree, FirstPointIsRoot, FastMKSStat>; TreeType* tree = new TreeType(data, metric, 1.5); // Now initialize FastMKS with that statistic. We don't need to specify the @@ -455,7 +456,7 @@ extern arma::mat data; // The custom tree type. We'll assume that the first template parameter is the // statistic type. -typedef CustomTree TreeType; +using TreeType = CustomTree; // The FastMKS constructor will create the tree. FastMKS f(data); diff --git a/doc/tutorials/neighbor_search.md b/doc/tutorials/neighbor_search.md index b0a64d1516..dea0675e53 100644 --- a/doc/tutorials/neighbor_search.md +++ b/doc/tutorials/neighbor_search.md @@ -213,7 +213,7 @@ The `KNN` class is, specifically, a typedef of the more extensible distance. ```c++ -typedef NeighborSearch KNN; +using KNN = NeighborSearch; ``` Using the `KNN` class is particularly simple; first, the object must be diff --git a/doc/user/core/trees/ball_tree.md b/doc/user/core/trees/ball_tree.md index fdca730b6c..536343cfcc 100644 --- a/doc/user/core/trees/ball_tree.md +++ b/doc/user/core/trees/ball_tree.md @@ -553,9 +553,9 @@ find the number of leaf nodes with fewer than 10 children. // above). // This convenient typedef saves us a long type name! -typedef mlpack::BallTree TreeType; +using TreeType = mlpack::BallTree; TreeType tree; mlpack::data::Load("tree.bin", "tree", tree); diff --git a/doc/user/core/trees/binary_space_tree.md b/doc/user/core/trees/binary_space_tree.md index c6ce2d08ea..c804d9ca3b 100644 --- a/doc/user/core/trees/binary_space_tree.md +++ b/doc/user/core/trees/binary_space_tree.md @@ -1850,11 +1850,11 @@ arma::mat dataset; mlpack::data::Load("corel-histogram.csv", dataset, true); // Convenience typedef for the tree type. -typedef mlpack::BinarySpaceTree TreeType; +using TreeType = mlpack::BinarySpaceTree; // Build trees on the first half and the second half of points. TreeType tree1(dataset.cols(0, dataset.n_cols / 2)); @@ -1947,11 +1947,11 @@ manually and find the number of leaf nodes with less than 10 children. // above). // This convenient typedef saves us a long type name! -typedef mlpack::BinarySpaceTree TreeType; +using TreeType = mlpack::BinarySpaceTree; TreeType tree; mlpack::data::Load("tree.bin", "tree", tree); diff --git a/doc/user/core/trees/kdtree.md b/doc/user/core/trees/kdtree.md index 84c997dde9..8b4ac468f4 100644 --- a/doc/user/core/trees/kdtree.md +++ b/doc/user/core/trees/kdtree.md @@ -547,9 +547,9 @@ find the number of leaf nodes with fewer than 10 children. // above). // This convenient typedef saves us a long type name! -typedef mlpack::KDTree TreeType; +using TreeType = mlpack::KDTree; TreeType tree; mlpack::data::Load("tree.bin", "tree", tree); diff --git a/doc/user/core/trees/mean_split_ball_tree.md b/doc/user/core/trees/mean_split_ball_tree.md index d7ad1055b2..03c1923338 100644 --- a/doc/user/core/trees/mean_split_ball_tree.md +++ b/doc/user/core/trees/mean_split_ball_tree.md @@ -551,9 +551,9 @@ find the number of leaf nodes with fewer than 10 children. // above). // This convenient typedef saves us a long type name! -typedef mlpack::MeanSplitBallTree TreeType; +using TreeType = mlpack::MeanSplitBallTree; TreeType tree; mlpack::data::Load("tree.bin", "tree", tree); diff --git a/doc/user/core/trees/mean_split_kdtree.md b/doc/user/core/trees/mean_split_kdtree.md index d49912a90a..8197d73e50 100644 --- a/doc/user/core/trees/mean_split_kdtree.md +++ b/doc/user/core/trees/mean_split_kdtree.md @@ -560,9 +560,9 @@ manually and find the number of leaf nodes with fewer than 10 children. // above). // This convenient typedef saves us a long type name! -typedef mlpack::MeanSplitKDTree TreeType; +using TreeType = mlpack::MeanSplitKDTree; TreeType tree; mlpack::data::Load("tree.bin", "tree", tree); diff --git a/doc/user/core/trees/vptree.md b/doc/user/core/trees/vptree.md index b0b916651d..0e12a03f9b 100644 --- a/doc/user/core/trees/vptree.md +++ b/doc/user/core/trees/vptree.md @@ -558,9 +558,9 @@ find the number of leaf nodes with less than 10 children. // above). // This convenient typedef saves us a long type name! -typedef mlpack::VPTree TreeType; +using TreeType = mlpack::VPTree; TreeType tree; mlpack::data::Load("tree.bin", "tree", tree); diff --git a/doc/user/matrices.md b/doc/user/matrices.md index 840f91e8b2..4da53ad7a2 100644 --- a/doc/user/matrices.md +++ b/doc/user/matrices.md @@ -256,10 +256,10 @@ arma::Row labels = // Train in the constructor, using floating-point data. // The weak learner type is now a floating-point Perceptron. -typedef mlpack::Perceptron< +using PerceptronType = mlpack::Perceptron< mlpack::SimpleWeightUpdate, mlpack::ZeroInitialization, - arma::fmat> PerceptronType; + arma::fmat>; mlpack::AdaBoost ab(dataset, labels, 5); // Create test data (500 points). diff --git a/doc/user/methods/adaboost.md b/doc/user/methods/adaboost.md index 302e893db7..b7fb991b3f 100644 --- a/doc/user/methods/adaboost.md +++ b/doc/user/methods/adaboost.md @@ -418,9 +418,9 @@ arma::Row labels = // Train in the constructor, using floating-point data. // The weak learner type is now a floating-point Perceptron. -typedef mlpack::Perceptron PerceptronType; +using PerceptronType = mlpack::Perceptron; mlpack::AdaBoost ab(dataset, labels, 5); // Create test data (500 points). diff --git a/doc/user/methods/amf.md b/doc/user/methods/amf.md index 821f201dcd..d593e875fd 100644 --- a/doc/user/methods/amf.md +++ b/doc/user/methods/amf.md @@ -659,8 +659,9 @@ mlpack::RandomAcolInitialization<5> initW; mlpack::RandomAMFInitialization initH; // Combine the two initializations so we can pass it to the AMF class. -typedef mlpack::MergeInitialization, - mlpack::RandomAMFInitialization> InitType; +using InitType = + mlpack::MergeInitialization, + mlpack::RandomAMFInitialization>; InitType init(initW, initH); // Create an AMF object with the custom initialization.