#ifndef SOLUTIONNLE_H
#define SOLUTIONNLE_H
namespace csc350Lib_calculus_snle
{
typedefenum SolutionStatus
{
SEARCH_SUCCESSFUL = 0,
SEARCH_FAILED_TOO_MANY_ITERATIONS = 1,
SEARCH_FAILED_OUT_OF_RANGE = 2,
SEARCH_FAILED_NUMERICAL_ERROR = 3,
SEARCH_FAILED_OTHER_REASON = 4
}
SolutionStatus;
class SolutionNLE
{
SolutionStatus searchStatus;
float xStop = 0.f;
float fStop = 0.f;
int numIterations = 0;
public:
SolutionNLE(void);
virtual ~SolutionNLE(void);
SolutionStatus getStatus(void); //This method returns the search's status.
float getSolution(void); //This method returns the value of the solution estimate computed. This value makes sense when the search has been successful and also to some extent for a search that stopped after too many iterations.
float getValueAtSolution(void); //This method returns the value of the function at the solution estimate computed.
int getNumberOfIterations(void); //This method returns the number of iterations when the search stopped.
private:
};
}
#endif /* SOLUTIONNLE_H */
Initialize your members in the constructor, preferably in its initialization list. Only static const integral members can be initialized inside the class definition like that.