chiark / gitweb /
put a few more functions into the C++ API
authorstevenj <stevenj@alum.mit.edu>
Mon, 5 Apr 2010 19:17:49 +0000 (15:17 -0400)
committerstevenj <stevenj@alum.mit.edu>
Mon, 5 Apr 2010 19:17:49 +0000 (15:17 -0400)
darcs-hash:20100405191749-c8de0-2bb5cb5b80befa74a8a666be82866d91817a9153.gz

api/nlopt-in.hpp

index cc09c44ee9010a488210f610c8b60966a7d551cb..5187afb4a32d2ea4bb757dabe8cad9b8dee78cea 100644 (file)
@@ -119,6 +119,10 @@ namespace nlopt {
       if (!o) throw std::runtime_error("uninitialized nlopt::opt");
       return algorithm(nlopt_get_algorithm(o));
     }
+    const char *get_algorithm_name() const {
+      if (!o) throw std::runtime_error("uninitialized nlopt::opt");
+      return nlopt_algorithm_name(nlopt_get_algorithm(o));
+    }
     unsigned get_dimension() const {
       if (!o) throw std::runtime_error("uninitialized nlopt::opt");
       return nlopt_get_dimension(o);
@@ -262,4 +266,18 @@ namespace nlopt {
 
   //////////////////////////////////////////////////////////////////////
 
+  inline void srand(unsigned long seed) { nlopt_srand(seed); }
+  inline void srand_time(void) { nlopt_srand_time(); }
+  inline void version(int &major, int &minor, int &bugfix) {
+    nlopt_version(&major, &minor, &bugfix);
+  }
+  inline const char *algorithm_name(nlopt_algorithm a) {
+    return nlopt_algorithm_name(a);
+  }
+  inline const char *algorithm_name(algorithm a) {
+    return algorithm_name(nlopt_algorithm(a));
+  }
+
+  //////////////////////////////////////////////////////////////////////
+
 } // namespace nlopt