C++ Neural Networks and Fuzzy Logic: Preface


Figure 7.2   Class hierarchy used in the backpropagation simulator. Function overloading can be seen in the definition of the calc_error()



Download 1,14 Mb.
Pdf ko'rish
bet167/443
Sana29.12.2021
Hajmi1,14 Mb.
#77367
1   ...   163   164   165   166   167   168   169   170   ...   443
Bog'liq
C neural networks and fuzzy logic

Figure 7.2

  Class hierarchy used in the backpropagation simulator.

Function overloading can be seen in the definition of the calc_error() function. It is used in the input_layer

with no parameters, while it is used in the output_layer (which the input_layer inherits from) with one

parameter. Using the same function name is not a problem, and this is referred to as overloading. Besides

function overloading, you may also have operator overloading, which is using an operator that performs some

familiar function like + for addition, for another function, say, vector addition.

When you have overloading with the same parameters and the keyword virtual, then you have the potential

for dynamic binding, which means that you determine which overloaded function to execute at run time and

not at compile time. Compile time binding is referred to as static binding. If you put a bunch of C++ objects in

an array of pointers to the base class, and then go through a loop that indexes each pointer and executes an

overloaded virtual function that pointer is pointing to, then you will be using dynamic binding. This is exactly

the case in the function calc_out(), which is declared with the virtual keyword in the layer base class. Each

descendant of layer can provide a version of calc_out(), which differs in functionality from the base class, and

the correct function will be selected at run time based on the object’s identity. In this case calc_out(), which is

a function to calculate the outputs for each layer, is different for the input layer than for the other two types of

layers.

Let’s look at some details in the header file in Listing 7.1:




Download 1,14 Mb.

Do'stlaringiz bilan baham:
1   ...   163   164   165   166   167   168   169   170   ...   443




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish