diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2005-10-30 21:38:35 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2005-10-30 21:38:35 +0300 |
commit | 9cce3710ae84a5fba09333abcf2cb1cdcaaa948b (patch) | |
tree | 56880585f008343cd0bfce5878092f2ca5b011da /intern/opennl/extern | |
parent | 1f5193225949b6c42f42feac8ab233e73f24671e (diff) |
Support for adding elements in random positions in an opennl matrix.
Also some code formatting.
Diffstat (limited to 'intern/opennl/extern')
-rw-r--r-- | intern/opennl/extern/ONL_opennl.h | 101 |
1 files changed, 45 insertions, 56 deletions
diff --git a/intern/opennl/extern/ONL_opennl.h b/intern/opennl/extern/ONL_opennl.h index a84a153709d..128f1b137bc 100644 --- a/intern/opennl/extern/ONL_opennl.h +++ b/intern/opennl/extern/ONL_opennl.h @@ -52,33 +52,25 @@ extern "C" { #define NL_VERSION_0_0 1 -/* - * - * Datatypes - * - */ +/* Datatypes */ typedef unsigned int NLenum; typedef unsigned char NLboolean; typedef unsigned int NLbitfield; -typedef void NLvoid; -typedef signed char NLbyte; /* 1-byte signed */ -typedef short NLshort; /* 2-byte signed */ -typedef int NLint; /* 4-byte signed */ +typedef void NLvoid; +typedef signed char NLbyte; /* 1-byte signed */ +typedef short NLshort; /* 2-byte signed */ +typedef int NLint; /* 4-byte signed */ typedef unsigned char NLubyte; /* 1-byte unsigned */ typedef unsigned short NLushort; /* 2-byte unsigned */ typedef unsigned int NLuint; /* 4-byte unsigned */ -typedef int NLsizei; /* 4-byte signed */ -typedef float NLfloat; /* single precision float */ -typedef double NLdouble; /* double precision float */ +typedef int NLsizei; /* 4-byte signed */ +typedef float NLfloat; /* single precision float */ +typedef double NLdouble; /* double precision float */ -typedef void* NLContext ; +typedef void* NLContext; -/* - * - * Constants - * - */ +/* Constants */ #define NL_FALSE 0x0 #define NL_TRUE 0x1 @@ -106,54 +98,51 @@ typedef void* NLContext ; #define NL_RIGHT_HAND_SIDE 0x500 #define NL_ROW_SCALING 0x501 -/* - * Contexts - */ - NLContext nlNewContext(void) ; - void nlDeleteContext(NLContext context) ; - void nlMakeCurrent(NLContext context) ; - NLContext nlGetCurrent(void) ; +/* Contexts */ -/* - * State set/get - */ +NLContext nlNewContext(void); +void nlDeleteContext(NLContext context); +void nlMakeCurrent(NLContext context); +NLContext nlGetCurrent(void); - void nlSolverParameterf(NLenum pname, NLfloat param) ; - void nlSolverParameteri(NLenum pname, NLint param) ; +/* State get/set */ - void nlRowParameterf(NLenum pname, NLfloat param) ; - void nlRowParameteri(NLenum pname, NLint param) ; +void nlSolverParameterf(NLenum pname, NLfloat param); +void nlSolverParameteri(NLenum pname, NLint param); - void nlGetBooleanv(NLenum pname, NLboolean* params) ; - void nlGetFloatv(NLenum pname, NLfloat* params) ; - void nlGetIntergerv(NLenum pname, NLint* params) ; +void nlRowParameterf(NLenum pname, NLfloat param); +void nlRowParameteri(NLenum pname, NLint param); - void nlEnable(NLenum pname) ; - void nlDisable(NLenum pname) ; - NLboolean nlIsEnabled(NLenum pname) ; +void nlGetBooleanv(NLenum pname, NLboolean* params); +void nlGetFloatv(NLenum pname, NLfloat* params); +void nlGetIntergerv(NLenum pname, NLint* params); -/* - * Variables - */ - void nlSetVariable(NLuint index, NLfloat value) ; - NLfloat nlGetVariable(NLuint index) ; - void nlLockVariable(NLuint index) ; - void nlUnlockVariable(NLuint index) ; - NLboolean nlVariableIsLocked(NLuint index) ; +void nlEnable(NLenum pname); +void nlDisable(NLenum pname); +NLboolean nlIsEnabled(NLenum pname); -/* - * Begin/End - */ +/* Variables */ - void nlBegin(NLenum primitive) ; - void nlEnd(NLenum primitive) ; - void nlCoefficient(NLuint index, NLfloat value) ; +void nlSetVariable(NLuint index, NLfloat value); +NLfloat nlGetVariable(NLuint index); +void nlLockVariable(NLuint index); +void nlUnlockVariable(NLuint index); +NLboolean nlVariableIsLocked(NLuint index); -/* - * Solve - */ +/* Begin/End */ + +void nlBegin(NLenum primitive); +void nlEnd(NLenum primitive); +void nlCoefficient(NLuint index, NLfloat value); + +/* Setting random elements matrix/vector - not for least squares! */ + +void nlMatrixAdd(NLuint row, NLuint col, NLfloat value); +void nlRightHandSideAdd(NLuint index, NLfloat value); + +/* Solve */ - NLboolean nlSolve(void) ; +NLboolean nlSolve(void); #ifdef __cplusplus } |