Computes a table with values scaled from 1 to N describing a full-factorial design.
program example
use iso_fortran_env
use fstats
implicit none
! Local Variables
integer(int32) :: i, vars(3), tbl(24, 3)
! Define the number of design points for each of the 3 factors to study
vars = [2, 4, 3]
! Determine the design table
call full_factorial(vars, tbl)
! Display the table
do i = 1, size(tbl, 1)
print *, tbl(i,:)
end do
end program
The above program produces the following output.
1 1 1
1 1 2
1 1 3
1 2 1
1 2 2
1 2 3
1 3 1
1 3 2
1 3 3
1 4 1
1 4 2
1 4 3
2 1 1
2 1 2
2 1 3
2 2 1
2 2 2
2 2 3
2 3 1
2 3 2
2 3 3
2 4 1
2 4 2
2 4 3
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int32), | intent(in) | :: | vars(:) |
An M-element array containing the M factors to study. |
||
integer(kind=int32), | intent(out) | :: | tbl(:,:) |
A table where the design will be written. Use get_full_factorial_matrix_size to determine the appropriate table size. |
||
class(errors), | intent(inout), | optional, | target | :: | err |
A mechanism for communicating errors and warnings to the caller. Possible warning and error codes are as follows. - FS_NO_ERROR: No errors encountered. - FS_INVALID_INPUT_ERROR: Occurs if any items in vars are less than 1. - FS_ARRAY_SIZE_ERROR: Occurs if tbl is not properly sized. |