humoto
solution.h
Go to the documentation of this file.
1 /**
2  @file
3  @author Alexander Sherikov
4 
5  @brief
6 */
7 
8 
9 #pragma once
10 
11 
12 namespace humoto
13 {
14  namespace quadprogpp
15  {
16  /**
17  * @brief Solution of a QP.
18  */
20  {
21  public:
22  /// The return value of quadprogpp.
24 
25 
26  public:
27  /**
28  * @brief Status description
29  *
30  * @return description of the status if available
31  */
32  std::string getStatusDescription() const
33  {
34  if (quadprogpp_return_value_ == std::numeric_limits<double>::infinity())
35  {
36  return ("quadprogpp: an infeasible or degenerate problem.");
37  }
38  else
39  {
40  return ("quadprogpp: Ok.");
41  }
42  }
43 
44 
45  /**
46  * @brief Log a QP problem
47  *
48  * @param[in,out] logger logger
49  * @param[in] parent parent
50  * @param[in] name name
51  */
53  const LogEntryName &parent = LogEntryName(),
54  const std::string &name = "solution") const
55  {
56  LogEntryName subname = parent; subname.add(name);
57 
58  humoto::Solution::log(logger, subname, "");
59 
60  logger.log(LogEntryName(subname).add("quadprogpp_return_value"), quadprogpp_return_value_);
61  }
62  };
63  }
64 }
std::string getStatusDescription() const
Status description.
Definition: solution.h:32
#define HUMOTO_LOCAL
Definition: export_import.h:26
#define HUMOTO_GLOBAL_LOGGER_IF_DEFINED
Definition: logger.h:997
Container of the solution.
Definition: solution.h:176
Represents log entry name.
Definition: logger.h:169
Solution of a QP.
Definition: solution.h:19
Threaded logger: any data sent to this logger is wrapped in a message and pushed to a queue...
Definition: logger.h:555
virtual void log(humoto::Logger &logger, const LogEntryName &parent=LogEntryName(), const std::string &name="solution") const
Log a QP problem.
Definition: solution.h:351
The root namespace of HuMoTo.
Definition: config.h:12
double quadprogpp_return_value_
The return value of quadprogpp.
Definition: solution.h:23
LogEntryName & add(const char *name)
extends entry name with a subname
Definition: logger.h:232
void log(humoto::Logger &logger, const LogEntryName &parent=LogEntryName(), const std::string &name="solution") const
Log a QP problem.
Definition: solution.h:52