Fido icon indicating copy to clipboard operation
Fido copied to clipboard

Remove any use of std::vector

Open truell20 opened this issue 8 years ago • 8 comments

Switch to C arrays for speed and availability on microcontrollers

truell20 avatar May 14 '16 15:05 truell20

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.

patrickelectric avatar Jun 03 '16 16:06 patrickelectric

@patrickelectric It is?

truell20 avatar Jun 03 '16 17:06 truell20

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

truell20 avatar Jun 03 '16 17:06 truell20

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

patrickelectric avatar Jun 04 '16 02:06 patrickelectric

@patrickelectric Thank you for the link!

truell20 avatar Jun 04 '16 15:06 truell20

@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.

joshuagruenstein avatar Jun 04 '16 15:06 joshuagruenstein

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

astroesteban avatar Feb 10 '18 01:02 astroesteban

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

hajikhorasani avatar Nov 18 '18 07:11 hajikhorasani