Skip to main content

MultiIndices example 3

Modules and classes

  • [[MultiIndices_]]

Usage

PROGRAM main
USE easifemBase
type(multiindices_) :: obj
integer(i4b) :: n, d
integer(i4b), allocatable :: indices(:,:)

!!! note "Initiate" Initiate the object.

  obj=MultiIndices(n=0, d=1)
indices = GetMultiIndices(obj=obj, upto=.true.)
CALL Display(indices, "indices=")

!!! example "result" indices=

0 0

!!! note "n=1, d=1"

  obj=MultiIndices(n=1, d=1)
indices = GetMultiIndices(obj, .true.)
CALL Display(transpose(indices), "indices=")

!!! example "result" indices=

0 0 0 1 1 0

!!! note "n=2, d=1"

  obj=MultiIndices(n=2, d=1)
indices = GetMultiIndices(obj, .true.)
CALL Display(transpose(indices), "indices=")

!!! example "result" indices=

0 0 0 1 1 0 0 2 1 1 2 0

!!! note "n=2, d=2"

  obj=MultiIndices(n=2, d=2)
indices = GetMultiIndices(obj, .true.)
CALL Display(transpose(indices), "indices=")

!!! example "result" indices=

0 0 0 0 0 1 0 1 0 1 0 0 0 0 2 0 1 1 0 2 0 1 0 1 1 1 0 2 0 0

!!! note "n=2, d=3"

  obj=MultiIndices(n=2, d=3)
indices = GetMultiIndices(obj, .true.)
CALL Display(transpose(indices), "indices=")

!!! example "result" indices=

0 0 0 0 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 2 0 0 1 1 0 0 2 0 0 1 0 1 0 1 1 0 0 2 0 0 1 0 0 1 1 0 1 0 1 1 0 0 2 0 0 0

END PROGRAM main