Giter VIP home page Giter VIP logo

Comments (4)

caballa avatar caballa commented on July 24, 2024

I'm not sure if it helps to solve the problem but could you please try
memcpy(static_cast<void*>(dense), static_cast<void*>(o.dense), sizeof(elt_t)*sz)?

from crab.

elazarg avatar elazarg commented on July 24, 2024

It silences the error. Also the following should be handled (either memcpy or realloc)
crab/install/include/crab/domains/graphs/util/Vec.h at 121, 148
crab/install/include/crab/domains/graphs/adapt_sgraph.hpp 274

Are you sure it doesn't mask a bug? It does seem strange to memcpy a non-trivially copyable data structure.

from crab.

caballa avatar caballa commented on July 24, 2024

It's done in this way for efficiency reasons. The copied objects are supposed to be basic types so it should be fine. Vec.h assumes that the type of the vector element is re-allocable so it should be also fine.
However, it's true that this makes the code less general. For instance, all this code is used to represent weighted graphs. Right now, the weights must be basic types but I would like to have other types (e.g., ikos::z_number) so it has been on my TODO list for a while.

from crab.

caballa avatar caballa commented on July 24, 2024

The compilation errors should be gone with commit 9e51d45
I created a new issue #22 related to this.

from crab.

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.