Blender V2.61 - r43446

ONL_opennl.h

Go to the documentation of this file.
00001 
00004 /*
00005  *  OpenNL: Numerical Library
00006  *  Copyright (C) 2004 Bruno Levy
00007  *
00008  *  This program is free software; you can redistribute it and/or modify
00009  *  it under the terms of the GNU General Public License as published by
00010  *  the Free Software Foundation; either version 2 of the License, or
00011  *  (at your option) any later version.
00012  *
00013  *  This program is distributed in the hope that it will be useful,
00014  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  *  GNU General Public License for more details.
00017  *
00018  *  You should have received a copy of the GNU General Public License
00019  *  along with this program; if not, write to the Free Software
00020  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00021  *
00022  *  If you modify this software, you should include a notice giving the
00023  *  name of the person performing the modification, the date of modification,
00024  *  and the reason for such modification.
00025  *
00026  *  Contact: Bruno Levy
00027  *
00028  *     levy@loria.fr
00029  *
00030  *     ISA Project
00031  *     LORIA, INRIA Lorraine, 
00032  *     Campus Scientifique, BP 239
00033  *     54506 VANDOEUVRE LES NANCY CEDEX 
00034  *     FRANCE
00035  *
00036  *  Note that the GNU General Public License does not permit incorporating
00037  *  the Software into proprietary programs. 
00038  */
00039 
00040 /*
00041 #define NL_DEBUG
00042 #define NL_PARANOID
00043 */
00044 
00045 #define NL_USE_SUPERLU
00046 
00047 #ifndef nlOPENNL_H
00048 #define nlOPENNL_H
00049 
00050 #ifdef __cplusplus
00051 extern "C" {
00052 #endif
00053 
00054 #define NL_VERSION_0_0 1
00055 
00056 /* Datatypes */
00057 
00058 typedef unsigned int    NLenum;
00059 typedef unsigned char   NLboolean;
00060 typedef unsigned int    NLbitfield;
00061 typedef void            NLvoid;
00062 typedef signed char     NLbyte;     /* 1-byte signed */
00063 typedef short           NLshort;    /* 2-byte signed */
00064 typedef int             NLint;      /* 4-byte signed */
00065 typedef unsigned char   NLubyte;    /* 1-byte unsigned */
00066 typedef unsigned short  NLushort;   /* 2-byte unsigned */
00067 typedef unsigned int    NLuint;     /* 4-byte unsigned */
00068 typedef int             NLsizei;    /* 4-byte signed */
00069 typedef float           NLfloat;    /* single precision float */
00070 typedef double          NLdouble;   /* double precision float */
00071 
00072 typedef void* NLContext;
00073 
00074 /* Constants */
00075 
00076 #define NL_FALSE   0x0
00077 #define NL_TRUE    0x1
00078 
00079 /* Primitives */
00080 
00081 #define NL_SYSTEM  0x0
00082 #define NL_MATRIX  0x1
00083 
00084 /* Solver Parameters */
00085 
00086 #define NL_SOLVER              0x100
00087 #define NL_NB_VARIABLES        0x101
00088 #define NL_LEAST_SQUARES       0x102
00089 #define NL_SYMMETRIC           0x106
00090 #define NL_ERROR               0x108
00091 #define NL_NB_ROWS             0x110
00092 #define NL_NB_RIGHT_HAND_SIDES 0x112 /* 4 max */
00093 
00094 /* Contexts */
00095 
00096 NLContext nlNewContext(void);
00097 void nlDeleteContext(NLContext context);
00098 void nlMakeCurrent(NLContext context);
00099 NLContext nlGetCurrent(void);
00100 
00101 /* State get/set */
00102 
00103 void nlSolverParameterf(NLenum pname, NLfloat param);
00104 void nlSolverParameteri(NLenum pname, NLint param);
00105 
00106 void nlGetBooleanv(NLenum pname, NLboolean* params);
00107 void nlGetFloatv(NLenum pname, NLfloat* params);
00108 void nlGetIntergerv(NLenum pname, NLint* params);
00109 
00110 void nlEnable(NLenum pname);
00111 void nlDisable(NLenum pname);
00112 NLboolean nlIsEnabled(NLenum pname);
00113 
00114 /* Variables */
00115 
00116 void nlSetVariable(NLuint rhsindex, NLuint index, NLfloat value);
00117 NLfloat nlGetVariable(NLuint rhsindex, NLuint index);
00118 void nlLockVariable(NLuint index);
00119 void nlUnlockVariable(NLuint index);
00120 NLboolean nlVariableIsLocked(NLuint index);
00121 
00122 /* Begin/End */
00123 
00124 void nlBegin(NLenum primitive);
00125 void nlEnd(NLenum primitive);
00126 
00127 /* Setting elements in matrix/vector */
00128 
00129 void nlMatrixAdd(NLuint row, NLuint col, NLfloat value);
00130 void nlRightHandSideAdd(NLuint rhsindex, NLuint index, NLfloat value);
00131 void nlRightHandSideSet(NLuint rhsindex, NLuint index, NLfloat value);
00132 
00133 /* Multiply */
00134 
00135 void nlMatrixMultiply(NLfloat *x, NLfloat *y);
00136 
00137 /* Solve */
00138 
00139 void nlPrintMatrix(void);
00140 NLboolean nlSolve(void);
00141 NLboolean nlSolveAdvanced(NLint *permutation, NLboolean solveAgain);
00142 
00143 #ifdef __cplusplus
00144 }
00145 #endif
00146 
00147 #endif
00148