libsim Versione 7.2.6

◆ displaydoubleprecision()

subroutine displaydoubleprecision ( class(doubleprecisionlist), intent(inout) this)

Print the double precision list.

Definizione alla linea 79 del file list_doubleprecision.F03.

80!> \brief class to use lists in fortran 2003.
81!!
82!! Linked data structure is a data structure which
83!! consists of a set of data records (nodes) linked together and organized by references .
84!!
85!! A doubly-linked list is a linked data structure that consists of a set
86!! of sequentially linked records called nodes. Each node contains two
87!! fields, called links, that are references to the previous and to the
88!! next node in the sequence of nodes. The beginning and ending nodes'
89!! previous and next links, respectively, point to some kind of
90!! terminator.
91!!
92!! The program example is the better starting point:
93!!\include example_list.F03
94!!\ingroup base
95!!
98 private
99 public :: doubleprecisionlist
100!> Double precision specific implementation of doubly-linked list
101!!
102!! extend list_abstract::list
103 type, extends(list) :: doubleprecisionlist
104#ifdef DOXYGEN
105 integer::none ! doxigen workaround: if missed do not show procedure
106#endif
107 contains
108! procedure :: addDoubleprecision !< add doubleprecision in list
109 procedure :: current => currentdoubleprecision !< get doubleprecision pointed by iterator
110 procedure :: display => displaydoubleprecision !< print the doubleprecision list
111! generic :: add => addDoubleprecision
112 end type doubleprecisionlist
113
114contains
115
116!> Print the double precision list
117subroutine displaydoubleprecision(this)
118class(doubleprecisionList),intent(inout) :: this
119
120call this%rewind()
121do while(this%element())
122 print *,"index:",this%currentindex()," value:", this%current()
123 call this%next()
124end do
125end subroutine displaydoubleprecision
126
127!!$ subroutine addDoubleprecision(this, value)
128!!$ class(doubleprecisionList) :: this
129!!$ doubleprecision value
130!!$ class(*), allocatable :: v
131!!$
132!!$ allocate(v,source=value)
133!!$ call this%addvalue(v)
134!!$
135!!$ end subroutine addDoubleprecision
136
137
138!> get double precision pointed by iterator
139doubleprecision function currentdoubleprecision(this)
140class(doubleprecisionList) :: this
141class(*), pointer :: v
142
143v => this%currentpoli()
144select type(v)
145type is (doubleprecision)
146 currentdoubleprecision = v
147end select
148end function currentdoubleprecision
149
150end module list_doubleprecision
abstract class to use lists in fortran 2003.
class to use lists in fortran 2003.
Abstract implementation of doubly-linked list.
Double precision specific implementation of doubly-linked list.

Generated with Doxygen.