Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/10/18 11:49:47 (6 years ago)
Author:
gkronber
Message:

#2925: added vector access methods

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2925_AutoDiffForDynamicalModels/AutoDiffForDynamicalModelsTest/TestCvodes.cs

    r16225 r16226  
    3333      int numberOfEquations = 1;
    3434      var y = Problem.N_VNew_Serial(numberOfEquations);
    35       Problem.N_VConst_Serial(100.0, y);
     35      // y must be initialized before calling CVodeInit
     36      // Problem.N_VConst_Serial(100.0, y);
     37      Problem.NV_Set_Ith_S(y, 0, 100.0);
    3638
    3739      var cvode_mem = Problem.CVodeCreate(Problem.MultistepMethod.CV_ADAMS, Problem.NonlinearSolverIteration.CV_FUNCTIONAL);
     
    8587      IntPtr user_data) {
    8688
    87       Problem.N_VScale(-0.1, y, ydot);
     89      Problem.NV_Set_Ith_S(ydot, 0, -0.1 * Problem.NV_Get_Ith_S(y, 0));
    8890      return 0;
    8991      ;
Note: See TracChangeset for help on using the changeset viewer.