Explore chapters and articles related to this topic
Introduction
Published in Randall L. Eubank, Ana Kupresanin, Statistical Computing in C++ and R, 2011
Randall L. Eubank, Ana Kupresanin
Inheritance is a feature of object-oriented languages that allows new classes to be constructed from existing or base classes. The new or derived classes inherit the public members and methods of the base class and can modify them if necessary to produce a polymorphic behavior. For example, a banded matrix is a matrix whose special structure can be exploited to realize savings in terms of both storage and speed of various matrix operations including inversion. Thus, we might envision a general matrix class from which a banded matrix class is derived. While some of the methods from the base matrix class may work well with banded matrices, methods such as matrix-vector multiplication should be specialized to allow for proper use of the band limited structure. The approach is to again create another version of the * operator, except that in this instance the solution lies in making * a virtual method; this allows * to coexist as a method in both the base and derived class but behave differently depending on whether a full or banded matrix object uses the operator. Note that this is not the same as function overloading where the function’s arguments determine its behavior.
I
Published in Phillip A. Laplante, Dictionary of Computer Science, Engineering, and Technology, 2017
inheritance a method in object-oriented languages for creating new classes, called subclasses or derived classes. A class from which another class has been derived is said to be a superclass of that class. A subclass will inherit some or all of the methods of its superclass, and may selectively override these methods to modify the subclass’s behavior. A subclass may contain additional methods not in its superclass. If the language constrains the subclass to be derived from no more than one class, then this is called single inheritance. If a subclass can be derived directly from two or more superclasses, inheriting data and methods from each, the language is said to allow multiple inheritance.
The Application Server
Published in David Austerberry, Digital Asset Management, 2012
A tape class is a blueprint or prototype that defines the variables: size, playing time, format, and the methods (play, rewind, and record). A subclass inherits states from the superclass, but can have its own states and behaviors. The principle of inheritance allows programmers to reuse class code in subclasses.
Psychological aspects of equation-based modelling
Published in Mathematical and Computer Modelling of Dynamical Systems, 2019
Alexander Pollok, Andreas Klöckner, Dirk Zimmer
A capacitor model can now reuse these equations using an extends-statement. This is the Modelica version of inheritance. Multiple inheritance is possible. There are also language constructs that enable the use of models as parameters. Furthermore, the language not only supports differential equations for continuous systems but also the formulation of discrete events. Finally, causal assignments like in a conventional programming language can be used to model causal relations or algorithms. What finally results is a declarative model that describes the dynamic behaviour of a system. The model code does not state what to do with this description. Typically, an automatic tool is used to generate executable code based on this model description and a specified solver.