c - Most memory-efficient way to define hundreds of double constants -


What is the most memory-efficient way of defining hundreds of double (64-bit floating point) constants for use in embedded C program? Please note that this application is archive-bound and should save me as much RAM as possible.

An Atom ARR 8 MHz 32 K Flash with 2048 B RAM.

In large part, the method of maintaining a constant is to not use memory, file it and read them as needed.

If you can not do this, then the constants should be made part of the program, and they will keep the memory in one way or the other, either in the data segment or in the instructions immediately.

If absolute precision is not required, you may be able to reduce the data instead of float instead of double .

Some processors provide encoding to simple floating-point constants in architecture instructions. If you are targeting such a processor, then you should study your documents to know what constants are. It is unlikely to be useful for normal data.

If there is a pattern of data, then you may be able to use that part as per run-time requirement (this includes various forms of compression and decompression, depending on the pattern of data ). Obviously, it depends on the nature of the data, which you have not included in your question.

Another possibility that should be considered is whether your program needs all the raw data to be used or whether some parts of the work should be done to reduce the required data in advance. Could.

Otherwise, by and large, data is data, and it takes this space.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -