Giter Club home page Giter Club logo

Comments (2)

hongkai-dai avatar hongkai-dai commented on September 28, 2024

The size is checked in the debug mode

drake/solvers/cost.h

Lines 135 to 136 in b37aa69

DRAKE_ASSERT(Q_.rows() == Q_.cols());
DRAKE_ASSERT(Q_.cols() == b_.rows());

Since pybind is built in the release mode, it bypasses the check.

@jwnimmer-tri I can activate the check in the release mode. But what would be our general strategy? It is quite hard for python users to switch to debug mode, so shall we prefer DRAKE_DEMAND to DRAKE_ASSERT in our C++ code?

from drake.

jwnimmer-tri avatar jwnimmer-tri commented on September 28, 2024

See #7827. The functions DRAKE_DEMAND and DRAKE_ASSERT are only appropriate for Drake checking its own internal invariants. User input should always be checked with DRAKE_THROW_UNLESS (or something similar, like an if-test with a throw statement).

Ideally, any patches to this function would also change it obey https://drake.mit.edu/styleguide/cppguide.html#Inline_Functions, but if this an emergency maybe the platform reviewer will let you get away without doing that part.

from drake.

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.