colville_function.hpp
Go to the documentation of this file.
1 
12 #ifndef MLPACK_CORE_OPTIMIZERS_PROBLEMS_COLVILLE_FUNCTION_HPP
13 #define MLPACK_CORE_OPTIMIZERS_PROBLEMS_COLVILLE_FUNCTION_HPP
14 
15 #include <mlpack/prereqs.hpp>
16 
17 namespace mlpack {
18 namespace optimization {
19 namespace test {
20 
45 {
46  public:
49 
54  void Shuffle();
55 
57  size_t NumFunctions() const { return 1; }
58 
60  arma::mat GetInitialPoint() const { return arma::mat("-5; 3; 1; -9"); }
61 
62  /*
63  * Evaluate a function for a particular batch-size.
64  *
65  * @param coordinates The function coordinates.
66  * @param begin The first function.
67  * @param batchSize Number of points to process.
68  */
69  double Evaluate(const arma::mat& coordinates,
70  const size_t begin,
71  const size_t batchSize) const;
72 
73  /*
74  * Evaluate a function with the given coordinates.
75  *
76  * @param coordinates The function coordinates.
77  */
78  double Evaluate(const arma::mat& coordinates) const;
79 
80  /*
81  * Evaluate the gradient of a function for a particular batch-size.
82  *
83  * @param coordinates The function coordinates.
84  * @param begin The first function.
85  * @param gradient The function gradient.
86  * @param batchSize Number of points to process.
87  */
88  void Gradient(const arma::mat& coordinates,
89  const size_t begin,
90  arma::mat& gradient,
91  const size_t batchSize) const;
92 
93  /*
94  * Evaluate the gradient of a function with the given coordinates.
95  *
96  * @param coordinates The function coordinates.
97  * @param gradient The function gradient.
98  */
99  void Gradient(const arma::mat& coordinates, arma::mat& gradient) const;
100 };
101 
102 } // namespace test
103 } // namespace optimization
104 } // namespace mlpack
105 
106 #endif // MLPACK_CORE_OPTIMIZERS_PROBLEMS_COLVILLE_FUNCTION_HPP
.hpp
Definition: add_to_po.hpp:21
The core includes that mlpack expects; standard C++ includes and Armadillo.
size_t NumFunctions() const
Return 1 (the number of functions).
void Shuffle()
Shuffle the order of function visitation.
ColvilleFunction()
Initialize the ColvilleFunction.
double Evaluate(const arma::mat &coordinates, const size_t begin, const size_t batchSize) const
void Gradient(const arma::mat &coordinates, const size_t begin, arma::mat &gradient, const size_t batchSize) const
arma::mat GetInitialPoint() const
Get the starting point.
The Colville function, defined by.