Fuse.Problem
Macros | Typedefs
problemShared.hpp File Reference

This is the only header that is necessary to write shared object. More...

#include <vector>
#include <cmath>
#include <cstddef>
Include dependency graph for problemShared.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PROBLEM_PRECISION   double
 
#define X()   (*xPtr)
 
#define Y()   (*yPtr)
 
#define P()   (*pPtr)
 
#define FUNCTION_DEFINE(name, content)
 
#define FUNCTION_EXPORT(size_f, size_x, size_p, ...)
 

Typedefs

typedef void(* Function) (void *, void *, void *)
 

Detailed Description

This is the only header that is necessary to write shared object.

This is the only header that user should include to work with problem.fuse and write problem shared object.

Please look at librosenbrock.cpp to see how to use it

Macro Definition Documentation

◆ FUNCTION_DEFINE

#define FUNCTION_DEFINE (   name,
  content 
)
Value:
extern "C" void name(void* _y, void *_x, void *_p) { \
std::vector<PROBLEM_PRECISION> *yPtr = reinterpret_cast< std::vector<PROBLEM_PRECISION>* >(_y); \
std::vector<PROBLEM_PRECISION> *pPtr = reinterpret_cast< std::vector<PROBLEM_PRECISION>* >(_p); \
std::vector<PROBLEM_PRECISION> *xPtr = reinterpret_cast< std::vector<PROBLEM_PRECISION>* >(_x); \
content; \
}

a new function that can be added inside the shared object and used in fuse.problem. The name argument allows to define a name for the function while the content is the content of the function.

◆ FUNCTION_EXPORT

#define FUNCTION_EXPORT (   size_f,
  size_x,
  size_p,
  ... 
)
Value:
extern "C" { \
size_t FunctionSizeF() { return size_f; }; \
size_t FunctionSizeX() { return size_x; }; \
size_t FunctionSizeP() { return size_p; }; \
Function FunctionArray[] = { __VA_ARGS__ }; \
}

to export the symbols. The first argument is the number of function that will be defined, size_x is the number of unknown in each function and size_p is the dimension of the parameter vector. All the other arguments is a variable list of function that will be exported. The number of function must be the same of f_size.

Typedef Documentation

◆ Function

typedef void(* Function) (void *, void *, void *)

Typedefinition of the pointer function. Only for internal usage