Skip to content

Commit

Permalink
Add Mosek based libshogun examples if Mosek is enabled
Browse files Browse the repository at this point in the history
Fix Mosek env creation in CCSOSVM for mosek v7
add USE_MOSEK macro to config.h
  • Loading branch information
vigsterkr committed Sep 20, 2013
1 parent 83b821f commit ac174a6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/undocumented/libshogun/CMakeLists.txt
Expand Up @@ -106,6 +106,10 @@ SET(EXAMPLES
so_factorgraph
)

IF (USE_MOSEK)
LIST(APPEND EXAMPLES so_fg_model so_multiclass)
ENDIF ()

FOREACH(EXAMPLE ${EXAMPLES})
add_executable(${EXAMPLE} ${CMAKE_CURRENT_SOURCE_DIR}/${EXAMPLE}.${EXT_SRC_CPP})
target_link_libraries(${EXAMPLE} shogun ${SANITIZER_LIBRARY})
Expand Down
1 change: 1 addition & 0 deletions src/shogun/lib/config.h.in
Expand Up @@ -45,6 +45,7 @@
#cmakedefine USE_PATHDEBUG 1

#cmakedefine USE_SVMLIGHT 1
#cmakedefine USE_MOSEK 1

#cmakedefine USE_GLPK 1
#cmakedefine USE_LZO 1
Expand Down
6 changes: 6 additions & 0 deletions src/shogun/structure/CCSOSVM.cpp
Expand Up @@ -108,7 +108,13 @@ int32_t CCCSOSVM::mosek_qp_optimize(float64_t** G, float64_t* delta, float64_t*
buc[0] = m_C;

/* create mosek environment */
#if (MSK_VERSION_MAJOR == 6)
r = MSK_makeenv(&env, NULL, NULL, NULL, NULL);
#elif (MSK_VERSION_MAJOR == 7)
r = MSK_makeenv(&env, NULL);
#else
#error "Unsupported Mosek version"
#endif

/* check return code */
if (r==MSK_RES_OK)
Expand Down

0 comments on commit ac174a6

Please sign in to comment.