Changeset 16226 for branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Problems.DynamicalSystemsModelling/3.3/Problem.cs
- Timestamp:
- 10/10/18 11:49:47 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Problems.DynamicalSystemsModelling/3.3/Problem.cs
r16225 r16226 258 258 [DllImport("sundials_cvodes.dll", EntryPoint = "CVodeSStolerances", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] 259 259 public static extern int CVodeSStolerances( 260 IntPtr cvode_mem, 261 double reltol, 260 IntPtr cvode_mem, 261 double reltol, 262 262 double abstol 263 263 ); … … 272 272 [DllImport("sundials_cvodes.dll", EntryPoint = "CVDlsSetJacFn", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] 273 273 public static extern int CVDlsSetJacFn( 274 IntPtr cvode_mem, 274 IntPtr cvode_mem, 275 275 CVDlsJacFunc jacFunc 276 276 ); … … 309 309 [DllImport("sundials_cvodes.dll", EntryPoint = "SUNLinSolSetup", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] 310 310 public static extern int SUNLinSolSetup( 311 IntPtr linearSolver, 311 IntPtr linearSolver, 312 312 IntPtr A // SUNMatrix 313 313 ); … … 340 340 public static extern void N_VConst_Serial(double c, IntPtr vec); 341 341 342 342 343 343 [DllImport("sundials_cvodes.dll", EntryPoint = "N_VL1Norm_Serial", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] 344 344 public static extern double N_VL1Norm_Serial(IntPtr vec); … … 356 356 [DllImport("sundials_cvodes.dll", EntryPoint = "N_VMake_Serial", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] 357 357 public unsafe static extern double* N_VGetArrayPointer_Serial(IntPtr vec); 358 359 /* 360 #define NV_CONTENT_S(v) ( (N_VectorContent_Serial)(v->content) ) 361 362 #define NV_LENGTH_S(v) ( NV_CONTENT_S(v)->length ) 363 364 #define NV_OWN_DATA_S(v) ( NV_CONTENT_S(v)->own_data ) 365 366 #define NV_DATA_S(v) ( NV_CONTENT_S(v)->data ) 367 368 #define NV_Ith_S(v,i) ( NV_DATA_S(v)[i] ) 369 */ 370 // methods for macros 371 public unsafe static int* NV_CONTENT_S(IntPtr v) { 372 int* content = (int*)*(int*)v.ToPointer(); 373 return content; 374 } 375 376 public unsafe static long NV_LENGTH_S(IntPtr v) { 377 long length = *NV_CONTENT_S(v); 378 return length; 379 } 380 public unsafe static bool NV_OWN_DATA_S(IntPtr v) { 381 var content = NV_CONTENT_S(v); 382 int own_data = *(content + 2); 383 return own_data > 0; 384 } 385 public unsafe static double* NV_DATA_S(IntPtr v) { 386 var content = NV_CONTENT_S(v); 387 double* data = (double*)*(content + 3); 388 return data; 389 } 390 public unsafe static double NV_Get_Ith_S(IntPtr v, long i) { 391 return NV_DATA_S(v)[i]; 392 } 393 public unsafe static void NV_Set_Ith_S(IntPtr v, long i, double val) { 394 NV_DATA_S(v)[i] = val; 395 } 358 396 #endregion 359 397
Note: See TracChangeset
for help on using the changeset viewer.