Geogram  Version 1.9.1-rc
A programming library of geometric algorithms
nl_context.h File Reference

Internal OpenNL functions to manipulate contexts. More...

#include "nl_private.h"
#include "nl_matrix.h"

Go to the source code of this file.

Classes

struct  NLBufferBinding
 Stores the information relevant to access variables stored in buffers. More...
 
struct  NLContextStruct
 

Macros

#define NL_STATE_INITIAL   0
 
#define NL_STATE_SYSTEM   1
 
#define NL_STATE_MATRIX   2
 
#define NL_STATE_ROW   3
 
#define NL_STATE_MATRIX_CONSTRUCTED   4
 
#define NL_STATE_SYSTEM_CONSTRUCTED   5
 
#define NL_STATE_SOLVED   6
 
#define NL_STATE_MATRIX_PATTERN   7
 
#define NL_BUFFER_ITEM(B, i)    *(double*)((void*)((char*)((B).base_address)+((i)*(B).stride)))
 Access to a double value in a buffer. More...
 

Typedefs

typedef NLboolean(* NLSolverFunc) (void)
 The callback type for solver routines. More...
 
typedef void(* NLProgressFunc) (NLuint cur_iter, NLuint max_iter, double cur_err, double max_err)
 The callback type for displaying progress. More...
 

Functions

void nlCheckState (NLenum state)
 Makes sure that the finite state automaton is in the expected state. More...
 
void nlTransition (NLenum from_state, NLenum to_state)
 Implements a transition of the finite state automaton. More...
 
NLboolean nlDefaultSolver (void)
 Implements the default solver. More...
 

Variables

NLContextStructnlCurrentContext
 Pointer to the current context.
 

Detailed Description

Internal OpenNL functions to manipulate contexts.

Definition in file nl_context.h.

Macro Definition Documentation

◆ NL_BUFFER_ITEM

#define NL_BUFFER_ITEM (   B,
 
)     *(double*)((void*)((char*)((B).base_address)+((i)*(B).stride)))

Access to a double value in a buffer.

Parameters
[in]Ba NLBufferBinding
[in]iindex
Returns
the i th value in B

Definition at line 100 of file nl_context.h.

Typedef Documentation

◆ NLProgressFunc

typedef void(* NLProgressFunc) (NLuint cur_iter, NLuint max_iter, double cur_err, double max_err)

The callback type for displaying progress.

Used by nlSetFunction(NL_FUNC_PROGRESS,f)

Definition at line 65 of file nl_context.h.

◆ NLSolverFunc

typedef NLboolean(* NLSolverFunc) (void)

The callback type for solver routines.

Used by nlSetFunction(NL_FUNC_SOLVER,f)

Definition at line 59 of file nl_context.h.

Function Documentation

◆ nlCheckState()

void nlCheckState ( NLenum  state)

Makes sure that the finite state automaton is in the expected state.

If expected state and current state differ, then the program is aborted with an error message.

Parameters
[in]statethe expected state.

◆ nlDefaultSolver()

NLboolean nlDefaultSolver ( void  )

Implements the default solver.

Calls the right solver according to nlCurrentContext->solver.

Return values
NL_TRUEif solve was successful
NL_FALSEotherwise

◆ nlTransition()

void nlTransition ( NLenum  from_state,
NLenum  to_state 
)

Implements a transition of the finite state automaton.

If the current state does not match state, then the program is aborted with an error message. The current state is replaced by to_state.

Parameters
[in]from_statethe expected current state
[in]to_statethe new state