Commit 1d1f14f5 authored by Laurent Belcour's avatar Laurent Belcour
Browse files

Correction of a missing return

parent 9622bd98
...@@ -6,7 +6,7 @@ CONFIG *= static \ ...@@ -6,7 +6,7 @@ CONFIG *= static \
DESTDIR = ../build DESTDIR = ../build
unix{ unix{
QMAKE_CXXFLAGS += -std=c++0x QMAKE_CXXFLAGS += -std=c++0x -Wall -pedantic
} }
HEADERS = args.h \ HEADERS = args.h \
......
...@@ -216,6 +216,7 @@ class compound_function: public nonlinear_function, public std::vector<nonlinear ...@@ -216,6 +216,7 @@ class compound_function: public nonlinear_function, public std::vector<nonlinear
virtual vec value(const vec& x) const virtual vec value(const vec& x) const
{ {
vec res(_nY); vec res(_nY);
res = vec::Zero(_nY);
for(int i=0; i<this->size(); ++i) for(int i=0; i<this->size(); ++i)
{ {
res = res + this->at(i)->value(x); res = res + this->at(i)->value(x);
...@@ -253,6 +254,7 @@ class compound_function: public nonlinear_function, public std::vector<nonlinear ...@@ -253,6 +254,7 @@ class compound_function: public nonlinear_function, public std::vector<nonlinear
//! Set the dimension of the input space of the function //! Set the dimension of the input space of the function
virtual void setDimX(int nX) virtual void setDimX(int nX)
{ {
function::setDimX(nX);
for(int i=0; i<this->size(); ++i) for(int i=0; i<this->size(); ++i)
{ {
this->at(i)->setDimX(nX); this->at(i)->setDimX(nX);
...@@ -261,6 +263,7 @@ class compound_function: public nonlinear_function, public std::vector<nonlinear ...@@ -261,6 +263,7 @@ class compound_function: public nonlinear_function, public std::vector<nonlinear
//! Set the dimension of the output space of the function //! Set the dimension of the output space of the function
virtual void setDimY(int nY) virtual void setDimY(int nY)
{ {
function::setDimY(nY);
for(int i=0; i<this->size(); ++i) for(int i=0; i<this->size(); ++i)
{ {
this->at(i)->setDimY(nY); this->at(i)->setDimY(nY);
...@@ -270,6 +273,7 @@ class compound_function: public nonlinear_function, public std::vector<nonlinear ...@@ -270,6 +273,7 @@ class compound_function: public nonlinear_function, public std::vector<nonlinear
// Acces to the domain of definition of the function // Acces to the domain of definition of the function
virtual void setMin(const vec& min) virtual void setMin(const vec& min)
{ {
function::setMin(min);
for(int i=0; i<this->size(); ++i) for(int i=0; i<this->size(); ++i)
{ {
this->at(i)->setMin(min); this->at(i)->setMin(min);
...@@ -277,6 +281,7 @@ class compound_function: public nonlinear_function, public std::vector<nonlinear ...@@ -277,6 +281,7 @@ class compound_function: public nonlinear_function, public std::vector<nonlinear
} }
virtual void setMax(const vec& max) virtual void setMax(const vec& max)
{ {
function::setMax(max);
for(int i=0; i<this->size(); ++i) for(int i=0; i<this->size(); ++i)
{ {
this->at(i)->setMax(max); this->at(i)->setMax(max);
...@@ -365,7 +370,9 @@ class compound_function: public nonlinear_function, public std::vector<nonlinear ...@@ -365,7 +370,9 @@ class compound_function: public nonlinear_function, public std::vector<nonlinear
} }
start_i += nb_f_params; start_i += nb_f_params;
} }
return jac;
} }
//! \brief can set the input parametrization of a non-parametrized //! \brief can set the input parametrization of a non-parametrized
......
...@@ -44,8 +44,9 @@ template<typename T> T open_library(const std::string& filename, const char* fun ...@@ -44,8 +44,9 @@ template<typename T> T open_library(const std::string& filename, const char* fun
#else #else
void* handle = dlopen(filename.c_str(), RTLD_LAZY); void* handle = dlopen(filename.c_str(), RTLD_LAZY);
if(handle != NULL) if(handle != NULL)
{ {
void* res = dlsym(handle, function); void (*res)();
*(void **)(&res) = dlsym(handle, function);
if(dlerror() != NULL) if(dlerror() != NULL)
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment