40 #ifndef OPENNL_CONTEXT_H
41 #define OPENNL_CONTEXT_H
66 NLuint cur_iter,
NLuint max_iter,
double cur_err,
double max_err
69 #define NL_STATE_INITIAL 0
70 #define NL_STATE_SYSTEM 1
71 #define NL_STATE_MATRIX 2
72 #define NL_STATE_ROW 3
73 #define NL_STATE_MATRIX_CONSTRUCTED 4
74 #define NL_STATE_SYSTEM_CONSTRUCTED 5
75 #define NL_STATE_SOLVED 6
76 #define NL_STATE_MATRIX_PATTERN 7
100 #define NL_BUFFER_ITEM(B,i) \
101 *(double*)((void*)((char*)((B).base_address)+((i)*(B).stride)))
uint32_t NLuint
A 4-bytes unsigned integer.
uint64_t NLulong
A 8-bytes unsigned integer.
double NLdouble
A double-precision floating-point number.
unsigned int NLenum
A symbolic constant.
unsigned char NLboolean
A truth value (NL_TRUE or NL_FALSE).
void nlCheckState(NLenum state)
Makes sure that the finite state automaton is in the expected state.
NLboolean nlDefaultSolver(void)
Implements the default solver.
NLboolean(* NLSolverFunc)(void)
The callback type for solver routines.
NLContextStruct * nlCurrentContext
Pointer to the current context.
void(* NLProgressFunc)(NLuint cur_iter, NLuint max_iter, double cur_err, double max_err)
The callback type for displaying progress.
void nlTransition(NLenum from_state, NLenum to_state)
Implements a transition of the finite state automaton.
Internal OpenNL functions to manipulate sparse matrices.
Some macros and functions used internally by OpenNL.
Stores the information relevant to access variables stored in buffers.
NLuint stride
Number of bytes between the addresses of two consecutive elements in the buffer.
void * base_address
Address of the first element in the buffer.
NLRowColumn af
The coefficients that correspond to the free variables in the row being built.
NLuint nb_variables
The number of variables.
NLboolean has_matrix_pattern
true if nlBegin(NL_MATRIX_PATTERN) was called.
NLuint nb_systems
The number of linear systems to solve.
NLenum matrix_mode
The current matrix mode.
NLenum solver
The used solver, as a symbolic constant.
NLdouble * temp_eigen_value
temporary array for eigen values, used for sorting.
NLenum state
State of the finite-state automaton.
NLSolverFunc solver_func
the function pointer for the solver.
NLdouble * x
The vector of free variables, solution of the system.
NLdouble elapsed_time
elapsed time for latest solve.
NLRowColumn al
The coefficients that correspond to the locked variables in the row being built.
NLuint current_row
The index of the current row.
NLboolean normalize_rows
If true, all the rows are normalized.
NLboolean no_variables_indirection
if no_variables_indirection is set, then there is no locked variable, and the linear system directly ...
NLProgressFunc progress_func
the function pointer for logging progress.
NLdouble * eigen_value
the array of eigen values. Dimension = nb_systems.
NLboolean * variable_is_locked
Locked flags of the variables, dimension = nb_variables.
NLdouble error
error obtained after latest solve.
NLBufferBinding * variable_buffer
Buffer bindings for the variables, dimension = nb_systems.
NLdouble row_scaling
The scaling coefficient for the row being build.
NLboolean ij_coefficient_called
True if NLIJCoefficient() was called.
NLboolean preconditioner_defined
True if preconditioner was defined by client.
NLuint n
The number of not locked variables.
NLMatrix B
The right-hand side matrix.
NLMatrix P
The preconditioner.
NLuint max_iterations
Maximum number of iterations.
NLuint * variable_index
Index of the variable in the actual linear system, dimension = nb_variables.
NLboolean symmetric
Indicates whether the matrix is symmetric.
NLboolean max_iterations_defined
True if max_iterations was defined by client.
NLuint used_iterations
used number of iterations during latest solve.
NLenum eigen_solver
The eigen solver. Should be NL_ARPACK_EXT.
NLdouble omega
Relaxation parameter for the SSOR preconditioner.
NLdouble threshold
Convergence threshold.
NLboolean threshold_defined
True if threshold was defined by client.
NLdouble * variable_value
Values of the variables, dimension = nb_systems * nb_variables.
NLdouble * right_hand_side
The right hand sides of the row being built. An array of nb_systems doubles.
NLdouble eigen_shift
The shift parameter of the spectral shift-invert transform.
NLboolean least_squares
Indicates whether a least squares system is constructed.
NLboolean user_variable_buffers
NL_TRUE if variables are allocated by the user, NL_FALSE if they are managed by OpenNL.
NLdouble start_time
start time marking the beginning of latest solve.
NLdouble * b
The vector of right hand sides, of size nb_systems * n.
NLMatrix M
The matrix of the system.
NLboolean verbose
if true, some logging information is displayed during solve.
NLenum preconditioner
The used preconditioner, as a symbolic constant.
NLboolean eigen_shift_invert
NL_TRUE if spectral shift-invert transform is used, NL_FALSE otherwise;.
NLulong flops
Total number of floating point operations used during latest solve.
NLuint inner_iterations
Maximum number of inner iterations.
The base class for abstract matrices.
Represents a row or a column of a sparse matrix.