$search
00001 /* 00002 * OpenNL: Numerical Library 00003 * Copyright (C) 2004 Bruno Levy 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation; either version 2 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00018 * 00019 * If you modify this software, you should include a notice giving the 00020 * name of the person performing the modification, the date of modification, 00021 * and the reason for such modification. 00022 * 00023 * Contact: Bruno Levy 00024 * 00025 * levy@loria.fr 00026 * 00027 * ISA Project 00028 * LORIA, INRIA Lorraine, 00029 * Campus Scientifique, BP 239 00030 * 54506 VANDOEUVRE LES NANCY CEDEX 00031 * FRANCE 00032 * 00033 * Note that the GNU General Public License does not permit incorporating 00034 * the Software into proprietary programs. 00035 */ 00036 00037 00038 #ifndef __nl_h__ 00039 #define __nl_h__ 00040 00041 #ifdef __cplusplus 00042 extern "C" { 00043 #endif 00044 00045 #define NL_VERSION_0_0 1 00046 00047 #define NLAPI 00048 #define NLAPIENTRY 00049 00050 /* 00051 * 00052 * Datatypes 00053 * 00054 */ 00055 00056 typedef unsigned int NLenum; 00057 typedef unsigned char NLboolean; 00058 typedef unsigned int NLbitfield; 00059 typedef void NLvoid; 00060 typedef signed char NLbyte; /* 1-byte signed */ 00061 typedef short NLshort; /* 2-byte signed */ 00062 typedef int NLint; /* 4-byte signed */ 00063 typedef unsigned char NLubyte; /* 1-byte unsigned */ 00064 typedef unsigned short NLushort; /* 2-byte unsigned */ 00065 typedef unsigned int NLuint; /* 4-byte unsigned */ 00066 typedef int NLsizei; /* 4-byte signed */ 00067 typedef float NLfloat; /* single precision float */ 00068 typedef double NLdouble; /* double precision float */ 00069 00070 typedef void* NLContext ; 00071 00072 /* 00073 * 00074 * Constants 00075 * 00076 */ 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 #define NL_ROW 0x2 00086 00087 00088 /* Solver Parameters */ 00089 00090 #define NL_SOLVER 0x100 00091 #define NL_NB_VARIABLES 0x101 00092 #define NL_LEAST_SQUARES 0x102 00093 #define NL_MAX_ITERATIONS 0x103 00094 #define NL_THRESHOLD 0x104 00095 #define NL_OMEGA 0x105 00096 #define NL_SYMMETRIC 0x106 00097 #define NL_USED_ITERATIONS 0x107 00098 #define NL_ERROR 0x108 00099 #define NL_INNER_ITERATIONS 0x109 00100 #define NL_ELAPSED_TIME 0x10a 00101 #define NL_PRECONDITIONER 0x10b 00102 00103 /* Solvers */ 00104 00105 #define NL_CG 0x200 00106 #define NL_BICGSTAB 0x201 00107 #define NL_GMRES 0x202 00108 #define NL_SUPERLU_EXT 0x210 00109 #define NL_PERM_SUPERLU_EXT 0x211 00110 #define NL_SYMMETRIC_SUPERLU_EXT 0x212 00111 #define NL_SOLVER_USER 0x213 00112 00113 /* Preconditioners */ 00114 00115 #define NL_PRECOND_NONE 0x000 00116 #define NL_PRECOND_JACOBI 0x300 00117 #define NL_PRECOND_SSOR 0x301 00118 #define NL_PRECOND_USER 0x303 00119 00120 /* Enable / Disable */ 00121 00122 #define NL_NORMALIZE_ROWS 0x400 00123 00124 /* Row parameters */ 00125 00126 #define NL_RIGHT_HAND_SIDE 0x500 00127 #define NL_ROW_SCALING 0x501 00128 00129 /* Functions */ 00130 00131 #define NL_FUNC_SOLVER 0x600 00132 #define NL_FUNC_MATRIX 0x601 00133 #define NL_FUNC_PRECONDITIONER 0x602 00134 00135 /* 00136 * Contexts 00137 */ 00138 NLAPI NLContext NLAPIENTRY nlNewContext() ; 00139 NLAPI void NLAPIENTRY nlDeleteContext(NLContext context) ; 00140 NLAPI void NLAPIENTRY nlMakeCurrent(NLContext context) ; 00141 NLAPI NLContext NLAPIENTRY nlGetCurrent() ; 00142 NLAPI NLboolean NLAPIENTRY nlInitExtension(char* extension) ; 00143 00144 /* 00145 * State set/get 00146 */ 00147 00148 NLAPI void NLAPIENTRY nlSolverParameterd(NLenum pname, NLdouble param) ; 00149 NLAPI void NLAPIENTRY nlSolverParameteri(NLenum pname, NLint param) ; 00150 00151 NLAPI void NLAPIENTRY nlRowParameterd(NLenum pname, NLdouble param) ; 00152 NLAPI void NLAPIENTRY nlRowParameteri(NLenum pname, NLint param) ; 00153 00154 NLAPI void NLAPIENTRY nlGetBooleanv(NLenum pname, NLboolean* params) ; 00155 NLAPI void NLAPIENTRY nlGetDoublev(NLenum pname, NLdouble* params) ; 00156 NLAPI void NLAPIENTRY nlGetIntergerv(NLenum pname, NLint* params) ; 00157 00158 NLAPI void NLAPIENTRY nlEnable(NLenum pname) ; 00159 NLAPI void NLAPIENTRY nlDisable(NLenum pname) ; 00160 NLAPI NLboolean nlIsEnabled(NLenum pname) ; 00161 00162 /* 00163 * Functions 00164 */ 00165 NLAPI void NLAPIENTRY nlSetFunction(NLenum pname, void* param) ; 00166 NLAPI void NLAPIENTRY nlGetFunction(NLenum pname, void** param) ; 00167 00168 /* 00169 * Variables 00170 */ 00171 NLAPI void NLAPIENTRY nlSetVariable(NLuint index, NLdouble value) ; 00172 NLAPI NLdouble NLAPIENTRY nlGetVariable(NLuint index) ; 00173 NLAPI void NLAPIENTRY nlLockVariable(NLuint index) ; 00174 NLAPI void NLAPIENTRY nlUnlockVariable(NLuint index) ; 00175 NLAPI NLboolean NLAPIENTRY nlVariableIsLocked(NLuint index) ; 00176 00177 /* 00178 * Begin/End 00179 */ 00180 00181 NLAPI void NLAPIENTRY nlBegin(NLenum primitive) ; 00182 NLAPI void NLAPIENTRY nlEnd(NLenum primitive) ; 00183 NLAPI void NLAPIENTRY nlCoefficient(NLuint index, NLdouble value) ; 00184 00185 /* 00186 * Solve 00187 */ 00188 00189 NLAPI NLboolean NLAPIENTRY nlSolve() ; 00190 00191 00192 00193 #ifdef __cplusplus 00194 } 00195 #endif 00196 00197 #endif