Index: branches/2925_AutoDiffForDynamicalModels/AutoDiffForDynamicalModelsTest/TestCvodes.cs
===================================================================
--- branches/2925_AutoDiffForDynamicalModels/AutoDiffForDynamicalModelsTest/TestCvodes.cs	(revision 16225)
+++ branches/2925_AutoDiffForDynamicalModels/AutoDiffForDynamicalModelsTest/TestCvodes.cs	(revision 16226)
@@ -33,5 +33,7 @@
       int numberOfEquations = 1;
       var y = Problem.N_VNew_Serial(numberOfEquations);
-      Problem.N_VConst_Serial(100.0, y);
+      // y must be initialized before calling CVodeInit
+      // Problem.N_VConst_Serial(100.0, y);
+      Problem.NV_Set_Ith_S(y, 0, 100.0);
 
       var cvode_mem = Problem.CVodeCreate(Problem.MultistepMethod.CV_ADAMS, Problem.NonlinearSolverIteration.CV_FUNCTIONAL);
@@ -85,5 +87,5 @@
       IntPtr user_data) {
 
-      Problem.N_VScale(-0.1, y, ydot);
+      Problem.NV_Set_Ith_S(ydot, 0, -0.1 * Problem.NV_Get_Ith_S(y, 0));
       return 0;
       ;
Index: branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Problems.DynamicalSystemsModelling/3.3/Problem.cs
===================================================================
--- branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Problems.DynamicalSystemsModelling/3.3/Problem.cs	(revision 16225)
+++ branches/2925_AutoDiffForDynamicalModels/HeuristicLab.Problems.DynamicalSystemsModelling/3.3/Problem.cs	(revision 16226)
@@ -258,6 +258,6 @@
     [DllImport("sundials_cvodes.dll", EntryPoint = "CVodeSStolerances", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
     public static extern int CVodeSStolerances(
-      IntPtr cvode_mem, 
-      double reltol, 
+      IntPtr cvode_mem,
+      double reltol,
       double abstol
       );
@@ -272,5 +272,5 @@
     [DllImport("sundials_cvodes.dll", EntryPoint = "CVDlsSetJacFn", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
     public static extern int CVDlsSetJacFn(
-      IntPtr cvode_mem, 
+      IntPtr cvode_mem,
       CVDlsJacFunc jacFunc
       );
@@ -309,5 +309,5 @@
     [DllImport("sundials_cvodes.dll", EntryPoint = "SUNLinSolSetup", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
     public static extern int SUNLinSolSetup(
-      IntPtr linearSolver, 
+      IntPtr linearSolver,
       IntPtr A // SUNMatrix
       );
@@ -340,5 +340,5 @@
     public static extern void N_VConst_Serial(double c, IntPtr vec);
 
-    
+
     [DllImport("sundials_cvodes.dll", EntryPoint = "N_VL1Norm_Serial", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
     public static extern double N_VL1Norm_Serial(IntPtr vec);
@@ -356,4 +356,42 @@
     [DllImport("sundials_cvodes.dll", EntryPoint = "N_VMake_Serial", ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
     public unsafe static extern double* N_VGetArrayPointer_Serial(IntPtr vec);
+
+    /*
+#define NV_CONTENT_S(v)  ( (N_VectorContent_Serial)(v->content) )
+
+#define NV_LENGTH_S(v)   ( NV_CONTENT_S(v)->length )
+
+#define NV_OWN_DATA_S(v) ( NV_CONTENT_S(v)->own_data )
+
+#define NV_DATA_S(v)     ( NV_CONTENT_S(v)->data )
+
+#define NV_Ith_S(v,i)    ( NV_DATA_S(v)[i] )
+*/
+// methods for macros
+    public unsafe static int* NV_CONTENT_S(IntPtr v) {
+      int* content = (int*)*(int*)v.ToPointer();
+      return content;
+    }
+
+    public unsafe static long NV_LENGTH_S(IntPtr v) {
+      long length = *NV_CONTENT_S(v);
+      return length;
+    }
+    public unsafe static bool NV_OWN_DATA_S(IntPtr v) {
+      var content = NV_CONTENT_S(v);
+      int own_data = *(content + 2);
+      return own_data > 0;
+    }
+    public unsafe static double* NV_DATA_S(IntPtr v) {
+      var content = NV_CONTENT_S(v);
+      double* data = (double*)*(content + 3);
+      return data;
+    }
+    public unsafe static double NV_Get_Ith_S(IntPtr v, long i) {
+      return NV_DATA_S(v)[i];
+    }
+    public unsafe static void NV_Set_Ith_S(IntPtr v, long i, double val) {
+      NV_DATA_S(v)[i] = val;
+    }
     #endregion
 
