Academic Research in Educational Sciences
Volume 4 | Issue 5 | 2023
ISSN: 2181-1385
ISI: 0,967 | Cite-Factor: 0,89 | SIS: 1,9 | ASI: 1,3 | SJIF: 5,771 | UIF: 6,1
sa
517
May, 2023
https://t.me/ares_uz Multidisciplinary Scientific Journal
4.
Loop alignment.
def loop_alignment_optimization(loop_body, alignment_factor):
alignment = len(loop_body) % alignment_factor # alignment factorni hisoblash
if alignment != 0:
alignment_body = loop_body[-alignment:] # alignment tanasini ajratib olish
loop_body.extend(alignment_body) # loop tanasini
alignment tanasi bilan
kengaytirish
return loop_body
Ushbu kodda „loop_alignment_optimization‟ funksiyasi kirish sifatida
„loop_body‟ va „alignment_factorni‟ oladi. U sikl tanasining
uzunligini tekislash
koeffitsientiga bo'lishning qolgan qismini topib, tekislash
koeffitsientini hisoblab
chiqadi. Agar tekislash nolga teng bo'lmasa, u sikl tanasining oxiridan tekislash
tanasini chiqaradi va tekislash tanasini qo'shish orqali sikl tanasini kengaytiradi.
Nihoyat, u tekislangan sikl tanasini qaytaradi.
E'tibor bering, alignment factor kerakli tekislash o'lchamini
yoki chegarasini
ifodalaydi va u muayyan optimallashtirish texnikasi yoki dastur talablariga bog'liq
bo'lishi mumkin. [5]
5.
Dostları ilə paylaş: