OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
mumps_idll Module Reference

Data Types

type  idll_node_t
type  idll_t

Functions/Subroutines

integer function idll_create (dll)
integer function idll_destroy (dll)
integer function idll_push_front (dll, elmt)
integer function idll_pop_front (dll, elmt)
integer function idll_push_back (dll, elmt)
integer function idll_pop_back (dll, elmt)
integer function idll_insert (dll, pos, elmt)
integer function idll_insert_before (dll, node_after, elmt)
integer function idll_insert_after (dll, node_before, elmt)
integer function idll_lookup (dll, pos, elmt)
integer function idll_remove_pos (dll, pos, elmt)
integer function idll_remove_elmt (dll, elmt, pos)
integer function idll_length (dll)
integer function idll_iterator_begin (dll, ptr)
integer function idll_iterator_end (dll, ptr)
logical function idll_is_empty (dll)
integer function idll_2_array (dll, array, length)

Function/Subroutine Documentation

◆ idll_2_array()

integer function mumps_idll::idll_2_array ( type ( idll_t ), pointer dll,
integer, dimension (:), pointer array,
integer, intent(out) length )

Definition at line 495 of file double_linked_list.F.

496 INTEGER :: IDLL_2_ARRAY
497#if defined(MUMPS_F2003)
498 TYPE ( IDLL_T ), POINTER, INTENT ( IN ) :: DLL
499 INTEGER, POINTER, DIMENSION (:), INTENT ( OUT ) :: ARRAY
500#else
501 TYPE ( IDLL_T ), POINTER :: DLL
502 INTEGER, POINTER, DIMENSION (:) :: ARRAY
503#endif
504 INTEGER, INTENT ( OUT ) :: LENGTH
505 TYPE ( IDLL_NODE_T ), POINTER :: AUX
506 INTEGER :: I, IERR
507 IF ( .NOT. associated ( dll ) ) THEN
508 idll_2_array = -1
509 RETURN
510 END IF
511 length = idll_length(dll)
512 ALLOCATE ( array( max(1,length) ), stat=ierr )
513 IF ( ierr .NE. 0 ) THEN
514 idll_2_array = -2
515 RETURN
516 END IF
517 i = 1
518 aux => dll%FRONT
519 DO WHILE ( associated ( aux ) )
520 array( i ) = aux%ELMT
521 i = i + 1
522 aux => aux%NEXT
523 END DO
524 idll_2_array = 0
#define max(a, b)
Definition macros.h:21

◆ idll_create()

integer function mumps_idll::idll_create ( type ( idll_t ), pointer dll)

Definition at line 24 of file double_linked_list.F.

25 INTEGER :: IDLL_CREATE
26#if defined(MUMPS_F2003)
27 TYPE ( IDLL_T ), POINTER, INTENT ( OUT ) :: DLL
28#else
29 TYPE ( IDLL_T ), POINTER :: DLL
30#endif
31 INTEGER IERR
32 ALLOCATE ( dll, stat=ierr )
33 IF ( ierr .NE. 0 ) THEN
34 idll_create = -2
35 RETURN
36 END IF
37 NULLIFY ( dll%FRONT )
38 NULLIFY ( dll%BACK )
39 idll_create = 0
40 RETURN

◆ idll_destroy()

integer function mumps_idll::idll_destroy ( type ( idll_t ), pointer dll)

Definition at line 42 of file double_linked_list.F.

43 INTEGER :: IDLL_DESTROY
44#if defined(MUMPS_F2003)
45 TYPE ( IDLL_T ), POINTER, INTENT ( OUT ) :: DLL
46#else
47 TYPE ( IDLL_T ), POINTER :: DLL
48#endif
49 TYPE ( IDLL_NODE_T ), POINTER :: AUX
50 IF ( .NOT. associated ( dll ) ) THEN
51 idll_destroy = -1
52 RETURN
53 END IF
54 DO WHILE ( associated ( dll%FRONT ) )
55 aux => dll%FRONT
56 dll%FRONT => dll%FRONT%NEXT
57 DEALLOCATE( aux )
58 END DO
59 DEALLOCATE( dll )
60 idll_destroy = 0

◆ idll_insert()

integer function mumps_idll::idll_insert ( type ( idll_t ), pointer dll,
integer, intent(in) pos,
integer, intent(in) elmt )

Definition at line 182 of file double_linked_list.F.

183 INTEGER :: IDLL_INSERT
184#if defined(MUMPS_F2003)
185 TYPE ( IDLL_T ), POINTER, INTENT ( INOUT ) :: DLL
186#else
187 TYPE ( IDLL_T ), POINTER :: DLL
188#endif
189 INTEGER, INTENT ( IN ) :: POS, ELMT
190 TYPE ( IDLL_NODE_T ), POINTER :: NODE
191 TYPE ( IDLL_NODE_T ), POINTER :: NEW_PTR, OLD_PTR
192 INTEGER :: IERR, CPT
193 IF ( .NOT. associated ( dll ) ) THEN
194 idll_insert = -1
195 RETURN
196 END IF
197 IF ( pos .LE. 0 ) THEN
198 idll_insert = -4
199 RETURN
200 END IF
201 cpt = 1
202 new_ptr => dll%FRONT
203 NULLIFY ( old_ptr )
204 DO WHILE ( ( cpt .LT. pos ) .AND.
205 & ( associated ( new_ptr ) ) )
206 old_ptr => new_ptr
207 new_ptr => new_ptr%NEXT
208 cpt = cpt + 1
209 END DO
210 ALLOCATE ( node, stat=ierr )
211 IF ( ierr .NE. 0 ) THEN
212 idll_insert = -2
213 RETURN
214 END IF
215 node%ELMT = elmt
216 IF ( .NOT. associated ( old_ptr ) ) THEN
217 IF ( .NOT. associated ( new_ptr ) ) THEN
218 NULLIFY ( node%PREV )
219 NULLIFY ( node%NEXT )
220 dll%FRONT => node
221 dll%BACK => node
222 ELSE
223 NULLIFY ( node%PREV )
224 node%NEXT => new_ptr
225 new_ptr%PREV => node
226 dll%FRONT => node
227 END IF
228 ELSE
229 IF ( .NOT. associated ( new_ptr ) ) THEN
230 node%PREV => old_ptr
231 NULLIFY ( node%NEXT )
232 old_ptr%NEXT => node
233 dll%BACK => node
234 ELSE
235 node%PREV => old_ptr
236 node%NEXT => new_ptr
237 old_ptr%NEXT => node
238 new_ptr%PREV => node
239 END IF
240 END IF
241 idll_insert = 0

◆ idll_insert_after()

integer function mumps_idll::idll_insert_after ( type ( idll_t ), pointer dll,
type ( idll_node_t ), pointer node_before,
integer, intent(in) elmt )

Definition at line 274 of file double_linked_list.F.

275 INTEGER :: IDLL_INSERT_AFTER
276#if defined(MUMPS_F2003)
277 TYPE ( IDLL_T ), POINTER, INTENT ( INOUT ) :: DLL
278 TYPE ( IDLL_NODE_T ), POINTER, INTENT ( IN ) :: NODE_BEFORE
279#else
280 TYPE ( IDLL_T ), POINTER :: DLL
281 TYPE ( IDLL_NODE_T ), POINTER :: NODE_BEFORE
282#endif
283 INTEGER, INTENT ( IN ) :: ELMT
284 TYPE ( IDLL_NODE_T ), POINTER :: NODE_AFTER
285 INTEGER :: IERR
286 ALLOCATE ( node_after, stat=ierr )
287 IF ( ierr .NE. 0 ) THEN
288 idll_insert_after = -2
289 RETURN
290 END IF
291 node_after%ELMT = elmt
292 IF ( .NOT. associated ( node_before%NEXT ) ) THEN
293 node_before%NEXT => node_after
294 node_after%PREV => node_before
295 NULLIFY ( node_after%NEXT )
296 dll%BACK => node_after
297 ELSE
298 node_after%PREV => node_before
299 node_after%NEXT => node_before%NEXT
300 node_before%NEXT => node_after
301 node_after%NEXT%PREV => node_after
302 END IF
303 idll_insert_after = 0

◆ idll_insert_before()

integer function mumps_idll::idll_insert_before ( type ( idll_t ), pointer dll,
type ( idll_node_t ), pointer node_after,
integer, intent(in) elmt )

Definition at line 243 of file double_linked_list.F.

244 INTEGER :: IDLL_INSERT_BEFORE
245#if defined(MUMPS_F2003)
246 TYPE ( IDLL_T ), POINTER, INTENT ( INOUT ) :: DLL
247 TYPE ( IDLL_NODE_T ), POINTER, INTENT ( IN ) :: NODE_AFTER
248#else
249 TYPE ( IDLL_T ), POINTER :: DLL
250 TYPE ( IDLL_NODE_T ), POINTER :: NODE_AFTER
251#endif
252 INTEGER, INTENT ( IN ) :: ELMT
253 TYPE ( IDLL_NODE_T ), POINTER :: NODE_BEFORE
254 INTEGER :: IERR
255 ALLOCATE ( node_before, stat=ierr )
256 IF ( ierr .NE. 0 ) THEN
257 idll_insert_before = -2
258 RETURN
259 END IF
260 node_before%ELMT = elmt
261 IF ( .NOT. associated ( node_after%PREV ) ) THEN
262 node_after%PREV => node_before
263 node_before%NEXT => node_after
264 NULLIFY ( node_before%PREV )
265 dll%FRONT => node_before
266 ELSE
267 node_before%NEXT => node_after
268 node_before%PREV => node_after%PREV
269 node_after%PREV => node_before
270 node_before%PREV%NEXT => node_before
271 END IF
272 idll_insert_before = 0

◆ idll_is_empty()

logical function mumps_idll::idll_is_empty ( type ( idll_t ), pointer dll)

Definition at line 486 of file double_linked_list.F.

487 LOGICAL :: IDLL_IS_EMPTY
488#if defined(MUMPS_F2003)
489 TYPE ( IDLL_T ), POINTER, INTENT ( IN ) :: DLL
490#else
491 TYPE ( IDLL_T ), POINTER :: DLL
492#endif
493 idll_is_empty = ( associated ( dll%FRONT ) )

◆ idll_iterator_begin()

integer function mumps_idll::idll_iterator_begin ( type ( idll_t ), pointer dll,
type ( idll_node_t ), pointer ptr )

Definition at line 454 of file double_linked_list.F.

455 INTEGER :: IDLL_ITERATOR_BEGIN
456#if defined(MUMPS_F2003)
457 TYPE ( IDLL_T ), POINTER, INTENT ( IN ) :: DLL
458 TYPE ( IDLL_NODE_T ), POINTER, INTENT ( OUT ) :: PTR
459#else
460 TYPE ( IDLL_T ), POINTER :: DLL
461 TYPE ( IDLL_NODE_T ), POINTER :: PTR
462#endif
463 IF ( .NOT. associated ( dll ) ) THEN
464 idll_iterator_begin = -1
465 RETURN
466 END IF
467 ptr => dll%FRONT
468 idll_iterator_begin = 0

◆ idll_iterator_end()

integer function mumps_idll::idll_iterator_end ( type ( idll_t ), pointer dll,
type ( idll_node_t ), pointer ptr )

Definition at line 470 of file double_linked_list.F.

471 INTEGER :: IDLL_ITERATOR_END
472#if defined(MUMPS_F2003)
473 TYPE ( IDLL_T ), POINTER, INTENT ( IN ) :: DLL
474 TYPE ( IDLL_NODE_T ), POINTER, INTENT ( OUT ) :: PTR
475#else
476 TYPE ( IDLL_T ), POINTER :: DLL
477 TYPE ( IDLL_NODE_T ), POINTER :: PTR
478#endif
479 IF ( .NOT. associated ( dll ) ) THEN
480 idll_iterator_end = -1
481 RETURN
482 END IF
483 ptr => dll%BACK
484 idll_iterator_end = 0

◆ idll_length()

integer function mumps_idll::idll_length ( type ( idll_t ), pointer dll)

Definition at line 433 of file double_linked_list.F.

434 INTEGER :: IDLL_LENGTH
435#if defined(MUMPS_F2003)
436 TYPE ( IDLL_T ), POINTER, INTENT ( IN ) :: DLL
437#else
438 TYPE ( IDLL_T ), POINTER :: DLL
439#endif
440 INTEGER :: LENGTH
441 TYPE ( IDLL_NODE_T ), POINTER :: AUX
442 length = 0
443 IF ( .NOT. associated ( dll ) ) THEN
444 idll_length = -1
445 RETURN
446 END IF
447 aux => dll%FRONT
448 DO WHILE ( associated ( aux ) )
449 length = length + 1
450 aux => aux%NEXT
451 END DO
452 idll_length = length

◆ idll_lookup()

integer function mumps_idll::idll_lookup ( type ( idll_t ), pointer dll,
integer, intent(in) pos,
integer, intent(out) elmt )

Definition at line 305 of file double_linked_list.F.

306 INTEGER :: IDLL_LOOKUP
307#if defined(MUMPS_F2003)
308 TYPE ( IDLL_T ), POINTER, INTENT ( INOUT ) :: DLL
309#else
310 TYPE ( IDLL_T ), POINTER :: DLL
311#endif
312 INTEGER, INTENT ( IN ) :: POS
313 INTEGER, INTENT ( OUT ) :: ELMT
314 TYPE ( IDLL_NODE_T ), POINTER :: AUX
315 INTEGER :: CPT
316 IF ( .NOT. associated ( dll ) ) THEN
317 idll_lookup = -1
318 RETURN
319 END IF
320 IF ( pos .LE. 0 ) THEN
321 idll_lookup = -4
322 RETURN
323 END IF
324 cpt = 1
325 aux => dll%FRONT
326 DO WHILE ( ( cpt .LT. pos ) .AND. ( associated ( aux ) ) )
327 cpt = cpt + 1
328 aux => aux%NEXT
329 END DO
330 IF ( .NOT. associated ( aux ) ) THEN
331 idll_lookup = -3
332 RETURN
333 END IF
334 elmt = aux%ELMT
335 idll_lookup = 0

◆ idll_pop_back()

integer function mumps_idll::idll_pop_back ( type ( idll_t ), pointer dll,
integer, intent(out) elmt )

Definition at line 153 of file double_linked_list.F.

154 INTEGER :: IDLL_POP_BACK
155#if defined(MUMPS_F2003)
156 TYPE ( IDLL_T ), POINTER, INTENT ( INOUT ) :: DLL
157#else
158 TYPE ( IDLL_T ), POINTER :: DLL
159#endif
160 INTEGER, INTENT ( OUT ) :: ELMT
161 TYPE ( IDLL_NODE_T ), POINTER :: AUX
162 IF ( .NOT. associated ( dll ) ) THEN
163 idll_pop_back = -1
164 RETURN
165 END IF
166 IF ( .NOT. associated ( dll%BACK ) ) THEN
167 idll_pop_back = -3
168 RETURN
169 END IF
170 elmt = dll%BACK%ELMT
171 aux => dll%BACK
172 dll%BACK => dll%BACK%PREV
173 IF ( associated ( dll%BACK ) ) THEN
174 NULLIFY ( dll%BACK%NEXT )
175 END IF
176 IF ( associated ( dll%FRONT, aux ) ) THEN
177 NULLIFY ( dll%FRONT )
178 END IF
179 DEALLOCATE ( aux )
180 idll_pop_back = 0

◆ idll_pop_front()

integer function mumps_idll::idll_pop_front ( type ( idll_t ), pointer dll,
integer, intent(out) elmt )

Definition at line 93 of file double_linked_list.F.

94 INTEGER :: IDLL_POP_FRONT
95#if defined(MUMPS_F2003)
96 TYPE ( IDLL_T ), POINTER, INTENT ( INOUT ) :: DLL
97#else
98 TYPE ( IDLL_T ), POINTER :: DLL
99#endif
100 INTEGER, INTENT ( OUT ) :: ELMT
101 TYPE ( IDLL_NODE_T ), POINTER :: AUX
102 IF ( .NOT. associated ( dll ) ) THEN
103 idll_pop_front = -1
104 RETURN
105 END IF
106 IF ( .NOT. associated ( dll%FRONT ) ) THEN
107 idll_pop_front = -3
108 RETURN
109 END IF
110 elmt = dll%FRONT%ELMT
111 aux => dll%FRONT
112 dll%FRONT => dll%FRONT%NEXT
113 IF ( associated ( dll%FRONT ) ) THEN
114 NULLIFY ( dll%FRONT%PREV )
115 END IF
116 IF ( associated ( dll%BACK, aux ) ) THEN
117 NULLIFY ( dll%BACK )
118 END IF
119 DEALLOCATE ( aux )
120 idll_pop_front = 0

◆ idll_push_back()

integer function mumps_idll::idll_push_back ( type ( idll_t ), pointer dll,
integer, intent(in) elmt )

Definition at line 122 of file double_linked_list.F.

123 INTEGER :: IDLL_PUSH_BACK
124#if defined(MUMPS_F2003)
125 TYPE ( IDLL_T ), POINTER, INTENT ( INOUT ) :: DLL
126#else
127 TYPE ( IDLL_T ), POINTER :: DLL
128#endif
129 INTEGER, INTENT ( IN ) :: ELMT
130 TYPE ( IDLL_NODE_T ), POINTER :: NODE
131 INTEGER IERR
132 IF ( .NOT. associated ( dll ) ) THEN
133 idll_push_back = -1
134 RETURN
135 END IF
136 ALLOCATE( node, stat=ierr )
137 IF ( ierr .NE. 0 ) THEN
138 idll_push_back = -2
139 RETURN
140 END IF
141 node%ELMT = elmt
142 NULLIFY ( node%NEXT )
143 node%PREV => dll%BACK
144 IF ( associated ( dll%BACK ) ) THEN
145 dll%BACK%NEXT => node
146 END IF
147 dll%BACK => node
148 IF ( .NOT. associated ( dll%FRONT ) ) THEN
149 dll%FRONT => node
150 END IF
151 idll_push_back = 0

◆ idll_push_front()

integer function mumps_idll::idll_push_front ( type ( idll_t ), pointer dll,
integer, intent(in) elmt )

Definition at line 62 of file double_linked_list.F.

63 INTEGER :: IDLL_PUSH_FRONT
64#if defined(MUMPS_F2003)
65 TYPE ( IDLL_T ), POINTER, INTENT ( INOUT ) :: DLL
66#else
67 TYPE ( IDLL_T ), POINTER :: DLL
68#endif
69 INTEGER, INTENT ( IN ) :: ELMT
70 TYPE ( IDLL_NODE_T ), POINTER :: NODE
71 INTEGER IERR
72 IF ( .NOT. associated ( dll ) ) THEN
73 idll_push_front = -1
74 RETURN
75 END IF
76 ALLOCATE( node, stat=ierr )
77 IF ( ierr .NE. 0 ) THEN
78 idll_push_front = -2
79 RETURN
80 END IF
81 node%ELMT = elmt
82 node%NEXT => dll%FRONT
83 NULLIFY ( node%PREV )
84 IF ( associated ( dll%FRONT ) ) THEN
85 dll%FRONT%PREV => node
86 END IF
87 dll%FRONT => node
88 IF ( .NOT. associated ( dll%BACK ) ) THEN
89 dll%BACK => node
90 END IF
91 idll_push_front = 0

◆ idll_remove_elmt()

integer function mumps_idll::idll_remove_elmt ( type ( idll_t ), pointer dll,
integer, intent(in) elmt,
integer, intent(out) pos )

Definition at line 385 of file double_linked_list.F.

386 INTEGER :: IDLL_REMOVE_ELMT
387#if defined(MUMPS_F2003)
388 TYPE ( IDLL_T ), POINTER, INTENT ( INOUT ) :: DLL
389#else
390 TYPE ( IDLL_T ), POINTER :: DLL
391#endif
392 INTEGER, INTENT ( IN ) :: ELMT
393 INTEGER, INTENT ( OUT ) :: POS
394 TYPE ( IDLL_NODE_T ), POINTER :: AUX
395 INTEGER :: CPT
396 IF ( .NOT. associated ( dll ) ) THEN
397 idll_remove_elmt = -1
398 RETURN
399 END IF
400 cpt = 1
401 aux => dll%FRONT
402 DO WHILE ( ( associated ( aux ) ) .AND.
403 & ( aux%ELMT .NE. elmt ) )
404 cpt = cpt + 1
405 aux => aux%NEXT
406 END DO
407 IF ( associated ( aux ) ) THEN
408 IF ( .NOT. associated ( aux%PREV ) ) THEN
409 IF ( .NOT. associated ( aux%NEXT ) ) THEN
410 NULLIFY ( dll%FRONT )
411 NULLIFY ( dll%BACK )
412 ELSE
413 NULLIFY ( aux%NEXT%PREV )
414 dll%FRONT => aux%NEXT
415 END IF
416 ELSE
417 IF ( .NOT. associated ( aux%NEXT ) ) THEN
418 NULLIFY ( aux%PREV%NEXT )
419 dll%BACK => aux%PREV
420 ELSE
421 aux%PREV%NEXT => aux%NEXT
422 aux%NEXT%PREV => aux%PREV
423 END IF
424 END IF
425 pos = cpt
426 DEALLOCATE ( aux )
427 ELSE
428 idll_remove_elmt = -3
429 RETURN
430 END IF
431 idll_remove_elmt = 0

◆ idll_remove_pos()

integer function mumps_idll::idll_remove_pos ( type ( idll_t ), pointer dll,
integer, intent(in) pos,
integer, intent(out) elmt )

Definition at line 337 of file double_linked_list.F.

338 INTEGER :: IDLL_REMOVE_POS
339#if defined(MUMPS_F2003)
340 TYPE ( IDLL_T ), POINTER, INTENT ( INOUT ) :: DLL
341#else
342 TYPE ( IDLL_T ), POINTER :: DLL
343#endif
344 INTEGER, INTENT ( IN ) :: POS
345 INTEGER, INTENT ( OUT ) :: ELMT
346 TYPE ( IDLL_NODE_T ), POINTER :: AUX
347 INTEGER :: CPT
348 IF ( .NOT. associated ( dll ) ) THEN
349 idll_remove_pos = -1
350 RETURN
351 END IF
352 cpt = 1
353 aux => dll%FRONT
354 DO WHILE ( ( associated ( aux ) ) .AND.
355 & ( cpt .LT. pos ) )
356 cpt = cpt + 1
357 aux => aux%NEXT
358 END DO
359 IF ( associated ( aux ) ) THEN
360 IF ( .NOT. associated ( aux%PREV ) ) THEN
361 IF ( .NOT. associated ( aux%NEXT ) ) THEN
362 NULLIFY ( dll%FRONT )
363 NULLIFY ( dll%BACK )
364 ELSE
365 NULLIFY ( aux%NEXT%PREV )
366 dll%FRONT => aux%NEXT
367 END IF
368 ELSE
369 IF ( .NOT. associated ( aux%NEXT ) ) THEN
370 NULLIFY ( aux%PREV%NEXT )
371 dll%BACK => aux%PREV
372 ELSE
373 aux%PREV%NEXT => aux%NEXT
374 aux%NEXT%PREV => aux%PREV
375 END IF
376 END IF
377 elmt = aux%ELMT
378 DEALLOCATE ( aux )
379 ELSE
380 idll_remove_pos = -3
381 RETURN
382 END IF
383 idll_remove_pos = 0