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