GithubHelp home page GithubHelp logo

Comments (9)

bradbell avatar bradbell commented on July 23, 2024

Run your program in gdb (I assume from the message above that you are compiling with debugging).
When the error occurs, the program will stop at the debugger prompt.
Use the debugger command where to see the current call stack.
You can then determine the line in your source code where are are trying to access an non-existent element of the vector.

from cppad.

bradbell avatar bradbell commented on July 23, 2024

Would you please close this issue if this solves it for you.

from cppad.

hichamhendy avatar hichamhendy commented on July 23, 2024

I happen to run against this problem in actually a very trivial line namely
std::cout << solution.x[x_start + 1]; and CppAD::ipopt::solve_result<Dvector> solution; abd by the way const size_t x_start = 0;

any ideas?

from cppad.

passer-by-Wang avatar passer-by-Wang commented on July 23, 2024

hello, I met this issue ,too. Could you please give a solution of if you have solved it?

from cppad.

bradbell avatar bradbell commented on July 23, 2024

@passer-by-Wang Have you tried running the program in a debugger like gdb ?

from cppad.

passer-by-Wang avatar passer-by-Wang commented on July 23, 2024

could you please give me more details about a debugger like gdb? I run it in terminal in ubuntu. Commands are as follow:
mkdir build
cd build
cmake ../
make
./cppad_ipopt_demo

from cppad.

passer-by-Wang avatar passer-by-Wang commented on July 23, 2024

actually, it successes under ubuntu system of VMware but fails under ubuntu system under my Desktop computer with dual systems

from cppad.

bradbell avatar bradbell commented on July 23, 2024

Here is a gdb tutorial:
https://web.eecs.umich.edu/~sugih/pointers/summary.html

All you should need to do is to run it in the debugger. Then when the error occurs, use the up command until you get to the source code that is trying to use the vector outside of its valid range; see
https://visualgdb.com/gdbreference/commands/up

from cppad.

bradbell avatar bradbell commented on July 23, 2024

@passer-by-Wang Did the suggestion above work for you ?

from cppad.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.