-1

I am working on statistical analyses in my field, and using c++. I am implementing several tests, and some of them need to compare the calculated value with a table, say a distribution table for example, like this one.

I want my different functions in my different classes to be able to access a specific value, to evaluate the significance of my result, for example something like this:

float F = fisherTest(serie1, serie2);
auto tableValue = findValue(serie1.size(), serie2.size());

if(tableValue < F) {
        cout << "Not significant";
        return -1;
    }

This is just an example, as this test actually makes no sense. But I just want to be able to read values from a predefined table.

Do you have an idea of how I can achieve this? Can I store this in a "resource file"?

I hope my question is clear! Thank you.

Andre Debuisne
  • 303
  • 1
  • 3
  • 15

2 Answers2

0

You can have some data files and pass a configuration during startup (e.g. commandline) to the application so it can find the files and read them. The data structure can then be fed to the test.

stefaanv
  • 14,072
  • 2
  • 31
  • 53
0

It is possible to get the predefined data from several sources:

  1. Hard coded tables in your program.
  2. One or more functions that can compute the data on demand.
  3. Files on your local disk.
  4. Data stored in a database server.

You and your team need to decide which makes the most sense for your application.

R Sahu
  • 204,454
  • 14
  • 159
  • 270