[MAP Logo]

Materials Algorithms Project
Program Library



Program MAP_UTIL_RANDOM

  1. Provenance of code.
  2. Purpose of code.
  3. Specification.
  4. Description of subroutine's operation.
  5. References.
  6. Parameter descriptions.
  7. Error indicators.
  8. Accuracy estimate.
  9. Any additional information.
  10. Example of code
  11. Auxiliary subroutines required.
  12. Keywords.
  13. Download source code.
  14. Links.

Provenance of Source Code

G.J. Hopkin,
Phase Transformations Group,
Department of Materials Science and Metallurgy,
University of Cambridge,
Cambridge, U.K.


Return to top of Document

Purpose

Reads in a set of lines of data from a file called DATA and writes them to a file called OUTPUT in a pseudo-random order.


Return to top of Document

Specification

Language:FORTRAN
Product form:Source code

Complete Program.


Return to top of Document

Description

Data are firstly read in from a file called DATA which must consist of a matrix of data between 1 row by 2 columns and 6000 rows by 49 columns.

A matrix of two rows is then produced (A), the first column (A1) consisting of an ascending array of integers from 1 up to the number of rows. The second (A2) is a produced useing a pseudo-random number generator. This matrix is then sorted on the column of pseudo-random numbers (A2).

The data matrix read in from the file DATA is then written out to the file OUTPUT in the order given by the integers in A1, i.e. in a pseudo-random order.


Return to top of Document

References

None.


Return to top of Document

Parameters

Input parameters

DATA - real
File containing input dataset.

NOCOL - real
Number of columns of data in file DATA.

NOROW - real
Number of rows of data in file DATA.

Output parameters

OUTPUT - real
Randomised dataset.


Return to top of Document

Error Indicators

None.


Return to top of Document

Accuracy

All variables are defined as real*8, hence all figures in the output will be to this accuracy.


Return to top of Document

Further Comments

none


Return to top of Document

Example

1. Program data in file DATA

	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

2. Program text

 PLEASE INPUT NUMBER OF ROWS
10
 
 PLEASE INPUT NUMBER OF COLUMNS
3

2. Program output to OUTPUT

     19.000000000000    20.000000000000    21.000000000000
     25.000000000000    26.000000000000    27.000000000000
     13.000000000000    14.000000000000    15.000000000000
     28.000000000000    29.000000000000    30.000000000000
    10.0000000000000    11.000000000000    12.000000000000
     16.000000000000    17.000000000000    18.000000000000
     22.000000000000    23.000000000000    24.000000000000
     4.0000000000000    5.0000000000000    6.0000000000000
     7.0000000000000    8.0000000000000    9.0000000000000
     1.0000000000000    2.0000000000000    3.0000000000000

3. Program output to stdout

 your data will be in a file called OUTPUT
 Thank you for using ethethetheth scorchio


Return to top of Document

Auxiliary Routines

Subroutines :-
NAG routine G05CAF

Keywords

neural network, random, data


Download source code



MAP originated from a joint project of the National Physical Laboratory and the University of Cambridge.

MAP Website administration / map@msm.cam.ac.uk

Top | Index | MAP Homepage Valid HTML 3.2!