File: testdata.h

package info (click to toggle)
singular 1%3A4.1.1-p2%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 35,860 kB
  • sloc: cpp: 288,280; ansic: 17,387; lisp: 4,242; yacc: 1,654; python: 1,608; makefile: 1,424; lex: 1,387; perl: 632; sh: 567; xml: 182
file content (53 lines) | stat: -rw-r--r-- 2,296 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// testdata.h

// This file provides an interface for generating test data.

#ifndef TESTDATA_H
#define TESTDATA_H

#include "globals.h"

extern int random_matrix(const short& rows, const short& columns,
                         const Integer& lower_bound,
                         const Integer& upper_bound,
                         ofstream& MATRIX);

// Creates a random matrix of size rows x columns with entries between
// lower_bound and upper_bound. This matrix is written in the MATRIX file
// in the format explained in IP_algorithms.h, together with a randomly
// generated (integer) cost vector with entries between 0 and upper_bound.

// The positive row space vector needed by the algorithms of Hosten/Sturmfels
// and Bigatti/LaScala/Robbiano has to be entered by hand. It can be computed
// (or its existence can be verified) with the Simplex algorithm that is not
// included in this package.

extern int transportation_problem(const short& sources, const short& targets,
                                  const Integer& upper_bound,
                                  ofstream& MATRIX);

// Creates a transportation problem with the given number of sources and
// targets. This involves creating the (fixed) constraint matrix of size
// (sources + targets) x (sources * targets) and a randomly chosen cost vector
// (the "transportation matrix") of size targets*sources with entries between
// 0 and upper_bound.

// In the case of the transportation problem, a positive row space vector
// is given e.g. by the vector where all entries are 1, so it is printed
// automatically.

extern int random_problems (const short& vector_dimension,
                            const long& number_of_instances,
                            const Integer& lower_bound,
                            const Integer& upper_bound,
                            ofstream& PROBLEM);

// Creates number_of_instances random vectors of size vector_dimension
// with entries beteewn lower_bound and upper_bound. These vectors are
// written in the PROBLEM file in the format explained in IP_algorithms.h.

// For the (Positive) Conti-Traverso algorithm it might be more useful to
// generate some problems by hand (randomly created instances show to be
// unsolvable in many cases).

#endif  // TESTDATA_H