TABLE OF CONTENTS


ABINIT/m_VectorInt [ Modules ]

[ Top ] [ Modules ]

NAME

  m_VectorInt

FUNCTION

  Manage an integer vector

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

28 #include "defs.h"
29 MODULE m_VectorInt
30 USE m_Global
31 IMPLICIT NONE

ABINIT/m_VectorInt/VectorInt_clear [ Functions ]

[ Top ] [ Functions ]

NAME

  VectorInt_clear

FUNCTION

  Clear vector

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this=vector

OUTPUT

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

340 SUBROUTINE VectorInt_clear(this)
341 
342 !Arguments ------------------------------------
343 
344 !This section has been created automatically by the script Abilint (TD).
345 !Do not modify the following lines by hand.
346 #undef ABI_FUNC
347 #define ABI_FUNC 'VectorInt_clear'
348 !End of the abilint section
349 
350   TYPE(VectorInt), INTENT(INOUT) :: this
351   this%tail = 0 
352 END SUBROUTINE VectorInt_clear

ABINIT/m_VectorInt/VectorInt_destroy [ Functions ]

[ Top ] [ Functions ]

NAME

  VectorInt_destroy

FUNCTION

  Destroy vector 

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this=vector

OUTPUT

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

446 SUBROUTINE VectorInt_destroy(this)
447 
448 !Arguments ------------------------------------
449 
450 !This section has been created automatically by the script Abilint (TD).
451 !Do not modify the following lines by hand.
452 #undef ABI_FUNC
453 #define ABI_FUNC 'VectorInt_destroy'
454 !End of the abilint section
455 
456   TYPE(VectorInt), INTENT(INOUT) :: this
457 
458   FREEIF(this%vec)
459 
460   this%tail     = 0
461   this%size     = 0
462 END SUBROUTINE VectorInt_destroy

ABINIT/m_VectorInt/VectorInt_enlarge [ Functions ]

[ Top ] [ Functions ]

NAME

  VectorInt_enlarge

FUNCTION

  enlarge memory size

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this=vector
  size=memory size to add

OUTPUT

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

215 SUBROUTINE VectorInt_enlarge(this, size)
216 
217 !Arguments ------------------------------------
218 
219 !This section has been created automatically by the script Abilint (TD).
220 !Do not modify the following lines by hand.
221 #undef ABI_FUNC
222 #define ABI_FUNC 'VectorInt_enlarge'
223 !End of the abilint section
224 
225   TYPE(VectorInt)     , INTENT(INOUT)        :: this
226   INTEGER             , INTENT(IN   )        :: size
227 !Local variables ------------------------------
228   INTEGER                                 :: width
229   INTEGER                                 :: tail
230   INTEGER, ALLOCATABLE, DIMENSION(:) :: thistemp 
231   INTEGER                                 :: size_val
232 
233   IF ( ALLOCATED(this%vec) ) THEN
234     FREEIF(thistemp)
235     width = this%size
236     tail  = this%tail
237     size_val = size 
238     MALLOC(thistemp,(1:tail))
239     thistemp(1:tail) = this%vec(1:tail)
240     FREE(this%vec)
241     this%size = width + size_val
242     MALLOC(this%vec,(1:this%size))
243     this%vec(1:tail) = thistemp(1:tail)
244     FREE(thistemp)
245   ELSE
246     CALL VectorInt_init(this, Global_SIZE)
247   END IF
248 END SUBROUTINE VectorInt_enlarge

ABINIT/m_VectorInt/VectorInt_init [ Functions ]

[ Top ] [ Functions ]

NAME

  VectorInt_init

FUNCTION

  initialize

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this=vector
  size=size of initialization

OUTPUT

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

101 SUBROUTINE VectorInt_init(this, size)
102 
103 !Arguments ------------------------------------
104 
105 !This section has been created automatically by the script Abilint (TD).
106 !Do not modify the following lines by hand.
107 #undef ABI_FUNC
108 #define ABI_FUNC 'VectorInt_init'
109 !End of the abilint section
110 
111   TYPE(VectorInt)     , INTENT(INOUT) :: this
112   INTEGER, OPTIONAL, INTENT(IN   ) :: size
113 !Local variables ------------------------------
114   INTEGER                          :: size_val
115 
116   size_val = Global_SIZE
117   IF ( PRESENT(size) ) size_val = size
118   this%size = size_val
119   FREEIF(this%vec)
120   MALLOC(this%vec,(1:size_val))
121   this%tail = 0 
122   this%vec  = 0
123 END SUBROUTINE VectorInt_init

ABINIT/m_VectorInt/VectorInt_print [ Functions ]

[ Top ] [ Functions ]

NAME

  VectorInt_print

FUNCTION

  print vector

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this=vector
  ostream=file stream

OUTPUT

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

386 SUBROUTINE VectorInt_print(this,ostream)
387 
388 !Arguments ------------------------------------
389 
390 !This section has been created automatically by the script Abilint (TD).
391 !Do not modify the following lines by hand.
392 #undef ABI_FUNC
393 #define ABI_FUNC 'VectorInt_print'
394 !End of the abilint section
395 
396   TYPE(VectorInt), INTENT(IN) :: this
397   INTEGER, OPTIONAL, INTENT(IN) :: ostream
398 !Local variables ------------------------------
399   INTEGER                       :: ostream_val
400   INTEGER                       :: it1
401   CHARACTER(LEN=4 )             :: size
402   CHARACTER(LEN=15)             :: string
403 
404   ostream_val = 6
405   IF ( PRESENT(ostream) ) ostream_val = ostream
406   WRITE(size,'(I4)') this%tail
407   WRITE(ostream_val,'(A)') "("
408   string ='(1x,1ES10.2)'
409   DO it1 = 1, this%tail
410     WRITE(ostream_val,string) this%vec(it1)
411   END DO
412   WRITE(ostream_val,'(A)') ")"
413 END SUBROUTINE VectorInt_print

ABINIT/m_VectorInt/VectorInt_pushBack [ Functions ]

[ Top ] [ Functions ]

NAME

  VectorInt_pushBack

FUNCTION

  push an element at the end

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this=vector
  value=value to add

OUTPUT

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

282 SUBROUTINE VectorInt_pushBack(this, value)
283 
284 !Arguments ------------------------------------
285 
286 !This section has been created automatically by the script Abilint (TD).
287 !Do not modify the following lines by hand.
288 #undef ABI_FUNC
289 #define ABI_FUNC 'VectorInt_pushBack'
290 !End of the abilint section
291 
292   TYPE(VectorInt)    , INTENT(INOUT) :: this
293   INTEGER, INTENT(IN   ) :: value
294 !Local variables ------------------------------
295   INTEGER                         :: tail
296 
297   IF ( this%size .EQ. 0 ) THEN
298     CALL VectorInt_init(this, Global_SIZE)
299   END IF
300   tail = this%tail
301   tail = tail + 1
302   IF ( tail .GT. this%size ) THEN
303     CALL VectorInt_enlarge(this,Global_SIZE)
304   END IF
305   this%vec(tail) = value
306   this%tail      = tail
307 END SUBROUTINE VectorInt_pushBack

ABINIT/m_VectorInt/VectorInt_setSize [ Functions ]

[ Top ] [ Functions ]

NAME

  VectorInt_setSize

FUNCTION

  impose size

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

INPUTS

  this=vector
  new_tail=new_size

OUTPUT

SIDE EFFECTS

NOTES

PARENTS

  Will be filled automatically by the parent script

CHILDREN

  Will be filled automatically by the parent script

SOURCE

157 SUBROUTINE VectorInt_setSize(this,new_tail)
158 
159 !Arguments ------------------------------------
160 
161 !This section has been created automatically by the script Abilint (TD).
162 !Do not modify the following lines by hand.
163 #undef ABI_FUNC
164 #define ABI_FUNC 'VectorInt_setSize'
165 !End of the abilint section
166 
167   TYPE(VectorInt), INTENT(INOUT) :: this
168   INTEGER     , INTENT(IN   ) :: new_tail
169 !Local variables ------------------------------
170   INTEGER                     :: size
171 
172   IF ( .NOT. ALLOCATED(this%vec) ) THEN
173     CALL VectorInt_init(this,new_tail)
174   ELSE
175     size = this%size
176     IF( new_tail .GT. size ) THEN
177       CALL VectorInt_enlarge(this,MAX(new_tail-size,Global_SIZE))
178     END IF
179   END IF
180   this%tail = new_tail
181 END SUBROUTINE VectorInt_setSize  

m_VectorInt/VectorInt [ Types ]

[ Top ] [ m_VectorInt ] [ Types ]

NAME

  VectorInt

FUNCTION

  This structured datatype contains the necessary data

COPYRIGHT

  Copyright (C) 2013-2018 ABINIT group (J. Bieder)
  This file is distributed under the terms of the
  GNU General Public License, see ~abinit/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

SOURCE

52 TYPE, PUBLIC :: VectorInt
53   INTEGER _PRIVATE :: size
54   INTEGER          :: tail
55   INTEGER, ALLOCATABLE, DIMENSION(:)         :: vec
56 END TYPE VectorInt