Test Data generator.

Test Data generator.

Simple sample data generator.

6 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.

This is just a simple program written in java for anyone who wants test data. You can just edit the variables for fileNumber (for the number of files you want) and gridSize (for the size of each grid).

I can't seem to attach the program so here is the code:

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintWriter;

/* Simple data generator to write text files with different size arrays
* The values will be in the range of valueRange
* If you want to change the valueRange change the value at the bottom
* To change the number of files for this program to output change the fileNumber value,at the start of the *for loop
*/

public class GenerateData
{
public static void main(String[]args) throws FileNotFoundException
{
int valueRange = 20000;
int gridSize = 5;

for(int fileNumber = 1;fileNumber <= 5;fileNumber++)
{
PrintWriter output = new PrintWriter(new FileOutputStream("testData" + fileNumber+".txt"));

for(int i = 0;i {
for(int y = 0;y {
if(Math.random()<0.5)
output.print((int)(Math.random()*valueRange)+" ");
else
output.print(-(int)(Math.random()*valueRange)+" ");
}
output.println();
}
output.close();
}
}
}

You can add files to you profile by clicking "Ajouter des fichier" (and some blind click-and-try later, unless you know French, which is not my case : )

I also attach my data set generator. You can find it in here , a single file Python script

(click link -> fichiers -> ficiers -> msr.data.generator)

Are we assuming arrays are going to be square ?Cause the one in the example isn't...

Portrait de ph0b

Quoting jmikians

You can add files to you profile by clicking "Ajouter des fichier" (and some blind click-and-try later, unless you know French, which is not my case : )

I also attach my data set generator. You can find it in here , a single file Python script

(click link -> fichiers -> ficiers -> msr.data.generator)

The online file browser on your profile shows my files, not yours.
You can share them directly with their URL http://software.intel.com/file/FILE_ID

Here is my simple python script :

#!/usr/bin/python2.6

import random

cols = random.randint(0,10000);
rows = random.randint(0,10000);

for i in range(rows):
        for j in range(cols):
                print random.randint(-32000,32000), " ",
        print "\n",

Thanks, the generator is HERE .

In the generator, you need to add rectangles (can be overlaying) with specified values; at the end you know where is the desired solution

Connectez-vous pour laisser un commentaire.