Index: branches/2925_AutoDiffForDynamicalModels/AutoDiffForDynamicalModelsTest/TestCvodes.cs
===================================================================
--- branches/2925_AutoDiffForDynamicalModels/AutoDiffForDynamicalModelsTest/TestCvodes.cs	(revision 16246)
+++ branches/2925_AutoDiffForDynamicalModels/AutoDiffForDynamicalModelsTest/TestCvodes.cs	(revision 16248)
@@ -10,8 +10,8 @@
       // test vectors
       var arr = new double[] { 3.14, 2.71 };
-      var vec = Problem.N_VMake_Serial(2, arr);
-      Problem.N_VDestroy_Serial(vec);
-
-      vec = Problem.N_VNew_Serial(10);
+      var vec = CVODES.N_VMake_Serial(2, arr);
+      CVODES.N_VDestroy_Serial(vec);
+
+      vec = CVODES.N_VNew_Serial(10);
 
       unsafe {
@@ -24,42 +24,42 @@
         double data0 = *data;
       }
-      Problem.N_VConst_Serial(2.0, vec);
-      Problem.N_VPrint_Serial(vec);
-      Assert.AreEqual(20, Problem.N_VL1Norm_Serial(vec));
-      Problem.N_VDestroy_Serial(vec);
+      CVODES.N_VConst_Serial(2.0, vec);
+      CVODES.N_VPrint_Serial(vec);
+      Assert.AreEqual(20, CVODES.N_VL1Norm_Serial(vec));
+      CVODES.N_VDestroy_Serial(vec);
 
 
       // linear oscillator
       int numberOfEquations = 2;
-      var y = Problem.N_VNew_Serial(numberOfEquations);
+      var y = CVODES.N_VNew_Serial(numberOfEquations);
       // y must be initialized before calling CVodeInit
-      // Problem.N_VConst_Serial(100.0, y);
-      Problem.NV_Set_Ith_S(y, 0, 0.5); // x
-      Problem.NV_Set_Ith_S(y, 1, 1);  // v
-
-      var cvode_mem = Problem.CVodeCreate(Problem.MultistepMethod.CV_ADAMS, Problem.NonlinearSolverIteration.CV_FUNCTIONAL);
-
-      var flag = Problem.CVodeInit(cvode_mem, F, 0.0, y);
-      Assert.AreEqual(Problem.CV_SUCCESS, flag);
-
-      flag = Problem.CVodeSStolerances(cvode_mem, 1E-4, 1.0);
-      Assert.AreEqual(Problem.CV_SUCCESS, flag);
-
-      var A = Problem.SUNDenseMatrix(numberOfEquations, numberOfEquations);
+      // CVODES.N_VConst_Serial(100.0, y);
+      CVODES.NV_Set_Ith_S(y, 0, 0.5); // x
+      CVODES.NV_Set_Ith_S(y, 1, 1);  // v
+
+      var cvode_mem = CVODES.CVodeCreate(CVODES.MultistepMethod.CV_ADAMS, CVODES.NonlinearSolverIteration.CV_FUNCTIONAL);
+
+      var flag = CVODES.CVodeInit(cvode_mem, F, 0.0, y);
+      Assert.AreEqual(CVODES.CV_SUCCESS, flag);
+
+      flag = CVODES.CVodeSStolerances(cvode_mem, 1E-4, 1.0);
+      Assert.AreEqual(CVODES.CV_SUCCESS, flag);
+
+      var A = CVODES.SUNDenseMatrix(numberOfEquations, numberOfEquations);
       Assert.AreNotSame(A, IntPtr.Zero);
 
 
-      var linearSolver = Problem.SUNDenseLinearSolver(y, A);
+      var linearSolver = CVODES.SUNDenseLinearSolver(y, A);
       Assert.AreNotSame(linearSolver, IntPtr.Zero);
 
-      flag = Problem.CVDlsSetLinearSolver(cvode_mem, linearSolver, A);
-      Assert.AreEqual(Problem.CV_SUCCESS, flag);
-
-      // flag = Problem.CVDlsSetJacFn(cvode_mem, JacF);
-      // Assert.AreEqual(Problem.CV_SUCCESS, flag);
+      flag = CVODES.CVDlsSetLinearSolver(cvode_mem, linearSolver, A);
+      Assert.AreEqual(CVODES.CV_SUCCESS, flag);
+
+      // flag = CVODES.CVDlsSetJacFn(cvode_mem, JacF);
+      // Assert.AreEqual(CVODES.CV_SUCCESS, flag);
 
       // var ns = 1; // number of parameters
       // var p = new double[1]; // set as user-data
-      // var yS0 = Problem.N_VCloneVectorArray_Serial(ns, y); // clone the output vector for each parameter, TODO: free
+      // var yS0 = CVODES.N_VCloneVectorArray_Serial(ns, y); // clone the output vector for each parameter, TODO: free
       // for(int i=0;i<ns;i++) {
       // 
@@ -67,13 +67,13 @@
 
 
-      var q = Problem.N_VNew_Serial(1);
-      Problem.NV_Set_Ith_S(q, 0, 0.0);
-      flag = Problem.CVodeQuadInit(cvode_mem, FQ, q);
-      Assert.AreEqual(Problem.CV_SUCCESS, flag);
+      var q = CVODES.N_VNew_Serial(1);
+      CVODES.NV_Set_Ith_S(q, 0, 0.0);
+      flag = CVODES.CVodeQuadInit(cvode_mem, FQ, q);
+      Assert.AreEqual(CVODES.CV_SUCCESS, flag);
 
 
       int steps = 10;
-      flag = Problem.CVodeAdjInit(cvode_mem, steps, Problem.CV_HERMITE);
-      Assert.AreEqual(Problem.CV_SUCCESS, flag);
+      flag = CVODES.CVodeAdjInit(cvode_mem, steps, CVODES.CV_HERMITE);
+      Assert.AreEqual(CVODES.CV_SUCCESS, flag);
 
       /* step by step forward integration 
@@ -82,8 +82,8 @@
       int nout = 100; // number of output times
       for (int iout = 0; iout < nout; iout++) {
-        flag = Problem.CVode(cvode_mem, tout, y, ref t, Problem.CV_NORMAL);
-        Assert.AreEqual(Problem.CV_SUCCESS, flag);
-        Console.WriteLine("{0} {1} {2}", t, Problem.NV_Get_Ith_S(y, 0), Problem.NV_Get_Ith_S(y, 1));
-        // Problem.N_VPrint_Serial(y);
+        flag = CVODES.CVode(cvode_mem, tout, y, ref t, CVODES.CV_NORMAL);
+        Assert.AreEqual(CVODES.CV_SUCCESS, flag);
+        Console.WriteLine("{0} {1} {2}", t, CVODES.NV_Get_Ith_S(y, 0), CVODES.NV_Get_Ith_S(y, 1));
+        // CVODES.N_VPrint_Serial(y);
         tout += 0.1; 
       }
@@ -94,85 +94,85 @@
       double time = 0.0;
       int ncheck = 0; // number of checkpoints
-      flag = Problem.CVodeF(cvode_mem, tout, y, ref time, Problem.CV_NORMAL, ref ncheck);
-      Assert.AreEqual(Problem.CV_SUCCESS, flag);
+      flag = CVODES.CVodeF(cvode_mem, tout, y, ref time, CVODES.CV_NORMAL, ref ncheck);
+      Assert.AreEqual(CVODES.CV_SUCCESS, flag);
 
       long numSteps = 0;
-      flag = Problem.CVodeGetNumSteps(cvode_mem, ref numSteps);
-      Assert.AreEqual(Problem.CV_SUCCESS, flag);
-
-      var yB = Problem.N_VNew_Serial(numberOfEquations);
-      Problem.N_VConst_Serial(0.0, yB);
+      flag = CVODES.CVodeGetNumSteps(cvode_mem, ref numSteps);
+      Assert.AreEqual(CVODES.CV_SUCCESS, flag);
+
+      var yB = CVODES.N_VNew_Serial(numberOfEquations);
+      CVODES.N_VConst_Serial(0.0, yB);
 
       int numberOfParameters = 2;
-      var qB = Problem.N_VNew_Serial(numberOfParameters);
-      Problem.N_VConst_Serial(0.0, qB);
+      var qB = CVODES.N_VNew_Serial(numberOfParameters);
+      CVODES.N_VConst_Serial(0.0, qB);
 
       int indexB = 0;
-      flag = Problem.CVodeCreateB(cvode_mem, Problem.MultistepMethod.CV_BDF, Problem.NonlinearSolverIteration.CV_NEWTON, ref indexB);
-      Assert.AreEqual(Problem.CV_SUCCESS, flag);
+      flag = CVODES.CVodeCreateB(cvode_mem, CVODES.MultistepMethod.CV_BDF, CVODES.NonlinearSolverIteration.CV_NEWTON, ref indexB);
+      Assert.AreEqual(CVODES.CV_SUCCESS, flag);
 
       var TB1 = tout;
-      flag = Problem.CVodeInitB(cvode_mem, indexB, FB, TB1, yB);
-      Assert.AreEqual(Problem.CV_SUCCESS, flag);
+      flag = CVODES.CVodeInitB(cvode_mem, indexB, FB, TB1, yB);
+      Assert.AreEqual(CVODES.CV_SUCCESS, flag);
 
       var relTolB = 1E-6;
       var absTolB = 1E-8;
-      flag = Problem.CVodeSStolerancesB(cvode_mem, indexB, relTolB, absTolB);
-      Assert.AreEqual(Problem.CV_SUCCESS, flag);
-
-      var AB = Problem.SUNDenseMatrix(numberOfEquations, numberOfEquations);
+      flag = CVODES.CVodeSStolerancesB(cvode_mem, indexB, relTolB, absTolB);
+      Assert.AreEqual(CVODES.CV_SUCCESS, flag);
+
+      var AB = CVODES.SUNDenseMatrix(numberOfEquations, numberOfEquations);
       Assert.AreNotSame(linearSolver, IntPtr.Zero);
 
-      var lsB = Problem.SUNDenseLinearSolver(yB, AB);
+      var lsB = CVODES.SUNDenseLinearSolver(yB, AB);
       Assert.AreNotSame(linearSolver, IntPtr.Zero);
 
-      flag = Problem.CVDlsSetLinearSolverB(cvode_mem, indexB, lsB, AB);
-      Assert.AreEqual(Problem.CV_SUCCESS, flag);
-
-      flag = Problem.CVDlsSetJacFnB(cvode_mem, indexB, JacFB);
-      Assert.AreEqual(Problem.CV_SUCCESS, flag);
-
-      flag = Problem.CVodeQuadInitB(cvode_mem, indexB, FQB, qB);
-      Assert.AreEqual(Problem.CV_SUCCESS, flag);
+      flag = CVODES.CVDlsSetLinearSolverB(cvode_mem, indexB, lsB, AB);
+      Assert.AreEqual(CVODES.CV_SUCCESS, flag);
+
+      flag = CVODES.CVDlsSetJacFnB(cvode_mem, indexB, JacFB);
+      Assert.AreEqual(CVODES.CV_SUCCESS, flag);
+
+      flag = CVODES.CVodeQuadInitB(cvode_mem, indexB, FQB, qB);
+      Assert.AreEqual(CVODES.CV_SUCCESS, flag);
 
       /* First get results at t = TBout1 */
 
-      /* Call CVodeB to integrate the backward ODE problem. */
+      /* Call CVodeB to integrate the backward ODE CVODES. */
       var tBackOut = 50.0;
-      flag = Problem.CVodeB(cvode_mem, tBackOut, Problem.CV_NORMAL);
-      Assert.AreEqual(Problem.CV_SUCCESS, flag);
-
-      /* Call CVodeGetB to get yB of the backward ODE problem. */
-      flag = Problem.CVodeGetB(cvode_mem, indexB, ref time, yB);
-      Assert.AreEqual(Problem.CV_SUCCESS, flag);
+      flag = CVODES.CVodeB(cvode_mem, tBackOut, CVODES.CV_NORMAL);
+      Assert.AreEqual(CVODES.CV_SUCCESS, flag);
+
+      /* Call CVodeGetB to get yB of the backward ODE CVODES. */
+      flag = CVODES.CVodeGetB(cvode_mem, indexB, ref time, yB);
+      Assert.AreEqual(CVODES.CV_SUCCESS, flag);
 
       /* Call CVodeGetAdjY to get the interpolated value of the forward solution
          y during a backward integration. */
-      flag = Problem.CVodeGetAdjY(cvode_mem, tBackOut, y);
-      Assert.AreEqual(Problem.CV_SUCCESS, flag);
+      flag = CVODES.CVodeGetAdjY(cvode_mem, tBackOut, y);
+      Assert.AreEqual(CVODES.CV_SUCCESS, flag);
 
       /* Then at t = T0 */
 
       double t0 = 0.0;
-      flag = Problem.CVodeB(cvode_mem, t0, Problem.CV_NORMAL);
-      Assert.AreEqual(Problem.CV_SUCCESS, flag);
+      flag = CVODES.CVodeB(cvode_mem, t0, CVODES.CV_NORMAL);
+      Assert.AreEqual(CVODES.CV_SUCCESS, flag);
 
       long nstB = 0;
-      Problem.CVodeGetNumSteps(Problem.CVodeGetAdjCVodeBmem(cvode_mem, indexB), ref nstB);
-
-      flag = Problem.CVodeGetB(cvode_mem, indexB, ref time, yB);
-      Assert.AreEqual(Problem.CV_SUCCESS, flag);
-
-
-      flag = Problem.CVodeGetQuadB(cvode_mem, indexB, ref time, qB);
-      Assert.AreEqual(Problem.CV_SUCCESS, flag);
-
-      flag = Problem.CVodeGetAdjY(cvode_mem, t0, y);
-      Assert.AreEqual(Problem.CV_SUCCESS, flag);
-
-      Problem.N_VDestroy_Serial(y);
-      Problem.CVodeFree(cvode_mem);
-      Problem.SUNLinSolFree(linearSolver);
-      Problem.SUNMatDestroy(A);
+      CVODES.CVodeGetNumSteps(CVODES.CVodeGetAdjCVodeBmem(cvode_mem, indexB), ref nstB);
+
+      flag = CVODES.CVodeGetB(cvode_mem, indexB, ref time, yB);
+      Assert.AreEqual(CVODES.CV_SUCCESS, flag);
+
+
+      flag = CVODES.CVodeGetQuadB(cvode_mem, indexB, ref time, qB);
+      Assert.AreEqual(CVODES.CV_SUCCESS, flag);
+
+      flag = CVODES.CVodeGetAdjY(cvode_mem, t0, y);
+      Assert.AreEqual(CVODES.CV_SUCCESS, flag);
+
+      CVODES.N_VDestroy_Serial(y);
+      CVODES.CVodeFree(cvode_mem);
+      CVODES.SUNLinSolFree(linearSolver);
+      CVODES.SUNMatDestroy(A);
     }
 
@@ -182,63 +182,63 @@
       // linear oscillator
       int numberOfEquations = 2;
-      var y = Problem.N_VNew_Serial(numberOfEquations);
+      var y = CVODES.N_VNew_Serial(numberOfEquations);
       // y must be initialized before calling CVodeInit
-      // Problem.N_VConst_Serial(100.0, y);
-      Problem.NV_Set_Ith_S(y, 0, 0.5); // x
-      Problem.NV_Set_Ith_S(y, 1, 1);  // v
-
-      var cvode_mem = Problem.CVodeCreate(Problem.MultistepMethod.CV_ADAMS, Problem.NonlinearSolverIteration.CV_FUNCTIONAL);
-
-      var flag = Problem.CVodeInit(cvode_mem, F, 0.0, y);
-      Assert.AreEqual(Problem.CV_SUCCESS, flag);
-
-      flag = Problem.CVodeSStolerances(cvode_mem, 1E-4, 1.0);
-      Assert.AreEqual(Problem.CV_SUCCESS, flag);
-
-      var A = Problem.SUNDenseMatrix(numberOfEquations, numberOfEquations);
+      // CVODES.N_VConst_Serial(100.0, y);
+      CVODES.NV_Set_Ith_S(y, 0, 0.5); // x
+      CVODES.NV_Set_Ith_S(y, 1, 1);  // v
+
+      var cvode_mem = CVODES.CVodeCreate(CVODES.MultistepMethod.CV_ADAMS, CVODES.NonlinearSolverIteration.CV_FUNCTIONAL);
+
+      var flag = CVODES.CVodeInit(cvode_mem, F, 0.0, y);
+      Assert.AreEqual(CVODES.CV_SUCCESS, flag);
+
+      flag = CVODES.CVodeSStolerances(cvode_mem, 1E-4, 1.0);
+      Assert.AreEqual(CVODES.CV_SUCCESS, flag);
+
+      var A = CVODES.SUNDenseMatrix(numberOfEquations, numberOfEquations);
       Assert.AreNotSame(A, IntPtr.Zero);
-      Console.WriteLine(Problem.SUNDenseMatrix_Get(A, 0, 0));
-
-
-      var linearSolver = Problem.SUNDenseLinearSolver(y, A);
+      Console.WriteLine(CVODES.SUNDenseMatrix_Get(A, 0, 0));
+
+
+      var linearSolver = CVODES.SUNDenseLinearSolver(y, A);
       Assert.AreNotSame(linearSolver, IntPtr.Zero);
 
-      flag = Problem.CVDlsSetLinearSolver(cvode_mem, linearSolver, A);
-      Assert.AreEqual(Problem.CV_SUCCESS, flag);
-
-      flag = Problem.CVDlsSetJacFn(cvode_mem, JacF);
-      Assert.AreEqual(Problem.CV_SUCCESS, flag);
+      flag = CVODES.CVDlsSetLinearSolver(cvode_mem, linearSolver, A);
+      Assert.AreEqual(CVODES.CV_SUCCESS, flag);
+
+      flag = CVODES.CVDlsSetJacFn(cvode_mem, JacF);
+      Assert.AreEqual(CVODES.CV_SUCCESS, flag);
 
       var ns = 1; // number of parameters
       var p = new double[1]; // set as user-data
-      var yS0 = Problem.N_VCloneVectorArray_Serial(ns, y); // clone the output vector for each parameter, TODO: free
+      var yS0 = CVODES.N_VCloneVectorArray_Serial(ns, y); // clone the output vector for each parameter, TODO: free
       unsafe {
         for (int i = 0; i < ns; i++) {
           var yS0_i = *((IntPtr*)yS0.ToPointer() + i);
-          Problem.N_VConst_Serial(0.0, yS0_i);
+          CVODES.N_VConst_Serial(0.0, yS0_i);
         }
       }
 
 
-      flag = Problem.CVodeSensInit(cvode_mem, ns, Problem.CV_SIMULTANEOUS, FS, yS0);
-      Assert.AreEqual(Problem.CV_SUCCESS, flag);
+      flag = CVODES.CVodeSensInit(cvode_mem, ns, CVODES.CV_SIMULTANEOUS, FS, yS0);
+      Assert.AreEqual(CVODES.CV_SUCCESS, flag);
 
       double reltolS = 1E-5;
       var abstolS = new double[] { 1E-6 };
-      // flag = Problem.CVodeSensSStolerances(cvode_mem, reltolS, abstolS);
-      // Assert.AreEqual(Problem.CV_SUCCESS, flag);
-      flag = Problem.CVodeSensEEtolerances(cvode_mem);
-      Assert.AreEqual(Problem.CV_SUCCESS, flag);
-
-
-      // var q = Problem.N_VNew_Serial(1);
-      // Problem.NV_Set_Ith_S(q, 0, 0.0);
-      // flag = Problem.CVodeQuadInit(cvode_mem, FQ, q);
-      // Assert.AreEqual(Problem.CV_SUCCESS, flag);
+      // flag = CVODES.CVodeSensSStolerances(cvode_mem, reltolS, abstolS);
+      // Assert.AreEqual(CVODES.CV_SUCCESS, flag);
+      flag = CVODES.CVodeSensEEtolerances(cvode_mem);
+      Assert.AreEqual(CVODES.CV_SUCCESS, flag);
+
+
+      // var q = CVODES.N_VNew_Serial(1);
+      // CVODES.NV_Set_Ith_S(q, 0, 0.0);
+      // flag = CVODES.CVodeQuadInit(cvode_mem, FQ, q);
+      // Assert.AreEqual(CVODES.CV_SUCCESS, flag);
 
 
       // int steps = 10;
-      // flag = Problem.CVodeAdjInit(cvode_mem, steps, Problem.CV_HERMITE);
-      // Assert.AreEqual(Problem.CV_SUCCESS, flag);
+      // flag = CVODES.CVodeAdjInit(cvode_mem, steps, CVODES.CV_HERMITE);
+      // Assert.AreEqual(CVODES.CV_SUCCESS, flag);
 
       // step by step forward integration 
@@ -247,13 +247,13 @@
       int nout = 1000; // number of output times
       for (int iout = 0; iout < nout; iout++) {
-        flag = Problem.CVode(cvode_mem, tout, y, ref t, Problem.CV_NORMAL);
-        Assert.AreEqual(Problem.CV_SUCCESS, flag);
+        flag = CVODES.CVode(cvode_mem, tout, y, ref t, CVODES.CV_NORMAL);
+        Assert.AreEqual(CVODES.CV_SUCCESS, flag);
 
         // get sensitivities
-        flag = Problem.CVodeGetSens(cvode_mem, ref t, yS0);
-        Assert.AreEqual(Problem.CV_SUCCESS, flag);
+        flag = CVODES.CVodeGetSens(cvode_mem, ref t, yS0);
+        Assert.AreEqual(CVODES.CV_SUCCESS, flag);
         unsafe {
           var ySP0 = *(IntPtr*)yS0.ToPointer(); // parameter of sensitivities for first component
-          Console.WriteLine("{0} {1} {2} {3} {4}", t, Problem.NV_Get_Ith_S(y, 0), Problem.NV_Get_Ith_S(y, 1), Problem.NV_Get_Ith_S(ySP0, 0), Problem.NV_Get_Ith_S(ySP0, 1));
+          Console.WriteLine("{0} {1} {2} {3} {4}", t, CVODES.NV_Get_Ith_S(y, 0), CVODES.NV_Get_Ith_S(y, 1), CVODES.NV_Get_Ith_S(ySP0, 0), CVODES.NV_Get_Ith_S(ySP0, 1));
         }
 
@@ -263,8 +263,8 @@
 
 
-      Problem.N_VDestroy_Serial(y);
-      Problem.CVodeFree(cvode_mem);
-      Problem.SUNLinSolFree(linearSolver);
-      Problem.SUNMatDestroy(A);
+      CVODES.N_VDestroy_Serial(y);
+      CVODES.CVodeFree(cvode_mem);
+      CVODES.SUNLinSolFree(linearSolver);
+      CVODES.SUNMatDestroy(A);
     }
 
@@ -280,6 +280,6 @@
       // ∂y1/∂t = y2
       // ∂y2/∂t = -0.3 y1
-      Problem.NV_Set_Ith_S(ydot, 0, Problem.NV_Get_Ith_S(y, 1));
-      Problem.NV_Set_Ith_S(ydot, 1, -0.3 * Problem.NV_Get_Ith_S(y, 0));
+      CVODES.NV_Set_Ith_S(ydot, 0, CVODES.NV_Get_Ith_S(y, 1));
+      CVODES.NV_Set_Ith_S(ydot, 1, -0.3 * CVODES.NV_Get_Ith_S(y, 0));
       return 0;
       ;
@@ -297,8 +297,8 @@
       //  ∂f2/∂y1  ∂f2/∂y2
 
-      Problem.SUNDenseMatrix_Set(Jac, 0, 0, 0.0);
-      Problem.SUNDenseMatrix_Set(Jac, 0, 1, 1.0);
-      Problem.SUNDenseMatrix_Set(Jac, 1, 0, -0.3);
-      Problem.SUNDenseMatrix_Set(Jac, 1, 1, 0.0);
+      CVODES.SUNDenseMatrix_Set(Jac, 0, 0, 0.0);
+      CVODES.SUNDenseMatrix_Set(Jac, 0, 1, 1.0);
+      CVODES.SUNDenseMatrix_Set(Jac, 1, 0, -0.3);
+      CVODES.SUNDenseMatrix_Set(Jac, 1, 1, 0.0);
       return 0;
     }
@@ -323,18 +323,18 @@
 
       // (∂f /∂y)s_i(t) + ∂f /∂p_i
-      var y1 = Problem.NV_Get_Ith_S(y, 0); var y2 = Problem.NV_Get_Ith_S(y, 1);
+      var y1 = CVODES.NV_Get_Ith_S(y, 0); var y2 = CVODES.NV_Get_Ith_S(y, 1);
 
       unsafe {
         var yS_p0 = *(IntPtr*)yS.ToPointer();
-        var s1 = Problem.NV_Get_Ith_S(yS_p0, 0); var s2 = Problem.NV_Get_Ith_S(yS_p0, 1);
-
-
-        // (∂f /∂y)s_i(t)  = Jac s_i(t)
+        var s1 = CVODES.NV_Get_Ith_S(yS_p0, 0); var s2 = CVODES.NV_Get_Ith_S(yS_p0, 1);
+
+
+        // (∂f /∂y)s_i(t)  == Jac s_i(t)
         var sd1 = s2;
         var sd2 = -0.3 * s1;
 
         var s_p0 = *(IntPtr*)ySdot.ToPointer();
-        Problem.NV_Set_Ith_S(s_p0, 0, sd1 + 0.0);
-        Problem.NV_Set_Ith_S(s_p0, 1, sd2 - 0.3);
+        CVODES.NV_Set_Ith_S(s_p0, 0, sd1 + 0.0);
+        CVODES.NV_Set_Ith_S(s_p0, 1, sd2 - 0.3);
       }
 
@@ -365,6 +365,6 @@
       // λ2' = 1.0 λ1 - 0.0
 
-      Problem.NV_Set_Ith_S(yBdot, 0, 0.3 * Problem.NV_Get_Ith_S(yB, 1));
-      Problem.NV_Set_Ith_S(yBdot, 1, Problem.NV_Get_Ith_S(yB, 0));
+      CVODES.NV_Set_Ith_S(yBdot, 0, 0.3 * CVODES.NV_Get_Ith_S(yB, 1));
+      CVODES.NV_Set_Ith_S(yBdot, 1, CVODES.NV_Get_Ith_S(yB, 0));
 
       return 0;
@@ -374,5 +374,5 @@
     private int FQ(double t, IntPtr y, IntPtr yQdot, IntPtr user_data) {
       // TODO: squared error
-      Problem.NV_Set_Ith_S(yQdot, 0, Problem.NV_Get_Ith_S(y, 2));
+      CVODES.NV_Set_Ith_S(yQdot, 0, CVODES.NV_Get_Ith_S(y, 2));
       return 0;
     }
