FidoProject / Fido

A lightweight C++ machine learning library for embedded electronics and robotics.
http://fidoproject.github.io/
MIT License
437 stars 81 forks source link

Remove any use of std::vector #52

Open truell20 opened 8 years ago

truell20 commented 8 years ago

Switch to C arrays for speed and availability on microcontrollers

patrickelectric commented 8 years ago

It's possible to change std::vector to std::array in the project ? The array template is easier to implement than the vector in embedded systems.

truell20 commented 8 years ago

@patrickelectric It is?

truell20 commented 8 years ago

@patrickelectric Ideally we'd move to c arrays so that Fido could immediately work on AVR

patrickelectric commented 8 years ago

@truell20 and @joshuagruenstein, take a look here. I compile this vector< vector<double> > input = { {1}, {2}, {5}, {6} }; without problems.

truell20 commented 8 years ago

@patrickelectric Thank you for the link!

joshuagruenstein commented 8 years ago

@patrickelectric: I still think we should switch to c arrays for a number of reasons.

  1. MCUs have limited flash, and that would take up a lot of room
  2. MCUs have limited processing power, and switching to c arrays would be much faster
  3. Minimal dependencies is a core foundation of our library.

Basically, it seem to me that using a library like that would be a bit of a "hack." I think switching to C arrays, although a larger process right now, will be beneficial for the future of the Fido Library. Of course, that means we need to get around to actually making the switch. @truell20 and I are both somewhat busy this summer, so we'd appreciate help from contributors such as @FlyingGraysons, @Sydriax, and of course you @patrickelectric.

astroesteban commented 6 years ago

Is the goal of this issue still to switch to C arrays?

hajikhorasani commented 5 years ago

@joshuagruenstein, Do you still think about moving to C arrays ?