Commits

Martin Felis committed e1b6184 Draft

added ginac switch to CMakelists.txt

Comments (0)

Files changed (5)

 OPTION (BUILD_TESTS "Build the test executables" OFF)
 OPTION (RBDL_ENABLE_LOGGING "Enable logging (warning: major impact on performance!)" OFF)
 OPTION (RBDL_USE_SIMPLE_MATH "Use slow math instead of the fast Eigen3 library (faster compilation)" OFF)
+OPTION (RBDL_USE_GINAC "Use GiNaC to use symbolic computation (horribly
+slow!)" OFF)
 
 SET ( RBDL_SOURCES 
 	src/mathutils.cc
 		std::vector<ContactInfo> &ContactData,
 		VectorNd &QDDot
 		) {
-#ifdef GINAC_MATH
+#ifdef RBDL_USE_GINAC
 	assert (0 && !"Function not supported with ginac math");
 #else
 	LOG << "-------- " << __func__ << " --------" << std::endl;
 		std::vector<ContactInfo> &ContactData,
 		VectorNd &QDotPlus
 		) {
-#ifdef GINAC_MATH
+#ifdef RBDL_USE_GINAC
 	assert (0 && !"Function not supported in ginac math");
 #else
 	LOG << "-------- " << __func__ << " --------" << std::endl;
 }
 
 bool LinSolveGaussElimPivot (MatrixNd A, VectorNd b, VectorNd &x) {
-#ifdef GINAC_MATH
+#ifdef RBDL_USE_GINAC
 	assert (0 && !"function not supported with GiNaC");
 #else
 	x = VectorNd::Zero(x.size());
 }
 
 bool SpatialMatrixCompareEpsilon (const SpatialMatrix &matrix_a, const SpatialMatrix &matrix_b, double epsilon) {
-#ifdef GINAC_MATH
+#ifdef RBDL_USE_GINAC
 	assert (0 && !"Function not supported with GiNaC!");
 #else
 	assert (epsilon >= 0.);
 }
 
 bool SpatialVectorCompareEpsilon (const SpatialVector &vector_a, const SpatialVector &vector_b, double epsilon) {
-#ifdef GINAC_MATH
+#ifdef RBDL_USE_GINAC
 	assert (0 && !"Function not supported with GiNaC!");
 #else
 	assert (epsilon >= 0.);

src/mathwrapper.h

 
 #include "rbdlconfig.h"
 
-// #define GINAC_MATH
-
-#ifdef GINAC_MATH
+#ifdef RBDL_USE_GINAC
 	#define RBDL_USE_SIMPLE_MATH
 	
 	#include "ginac.h"

src/rbdlconfig.h.cmake

 #ifndef _RBDLCONFIG_H
 #define _RBDLCONFIG_H
 
+#cmakedefine RBDL_ENABLE_LOGGING
 #cmakedefine RBDL_USE_SIMPLE_MATH
-#cmakedefine RBDL_ENABLE_LOGGING
+#cmakedefine RBDL_USE_GINAC
 
 #endif