Explore chapters and articles related to this topic
Introduction to Algorithms and Data Structures
Published in Sriraman Sridharan, R. Balakrishnan, Foundations of Discrete Mathematics with Algorithms and Programming, 2019
Sriraman Sridharan, R. Balakrishnan
Stacks: A stack is a special case of a list in which the operations of insertion and suppression of an element of the list are performed at one end. (If the elements of a list are written from left to right, then the list has two ends, the left end and right end.) The end in which the operations of insertion and deletion are done is called the top of the stack. An example of a stack is the set of dishes in a cafeteria, where it is easy to remove the top dish or add a new dish at the top of the pile. A stack is also referred to as a “LIFO” (last-in-first-out) list. The operation of adding a new element at the top is referred to as “push” and the reverse operation of deleting the element at the top of the stack is called “pop.” The main application of stacks is in the implementation of recursion in programming languages. To convert a recursive program into a non-recursive one, the programmer has to manage the stack explicitly.
Computer Architecture
Published in Bogdan M. Wilamowski, J. David Irwin, Fundamentals of Industrial Electronics, 2018
A dedicated stack pointer (SP) register contains the address of the top element on the stack. An operation called PUSH adds an element to the stack, and an operation called POP or PULL removes an element from the stack, as illustrated in Figure 23.10. The SP automatically increments and decrements as elements are added to and removed from the stack. ARM does not have dedicated PUSH/PULL instructions, although the memory-addressing capabilities of the memory load and store instructions can perform basic stack operations, using any of the 16 registers as an SP. In lieu of a stack, ARM saves its program counter and the current PSR in registers R14 and SPSR (saved processor status register), respectively, for subroutine calls and interrupts.
Computer Architecture — an Introduction
Published in K. S. Fu, Ichikawa Tadao, Special Computer Architectures for Pattern Processing, 1982
C. V. Ramamoorthy, Benjamin W. Wah
A stack is a last-in-first-out data structure. Figure 4 shows a stack with a pointer TOP. Normally, only the element pointed to by TOP is accessible. The bottom of the stack is fixed and the top of the stack can grow or shrink. There are two operations, PUSH and POP, that can be applied on the stack. The PUSH operation pushes a new element onto the stack and increments the value of TOP. However, if the stack is full before the PUSH, the routine reports an error. The POP operation pops the top element off the stack. However, if the stack is empty before the POP, the routine reports an error. With the use of a stack, both arithmetic and block-oriented languages can be executed very efficiently.
Individual yarn fibre extraction from micro-CT: multilevel machine learning approach
Published in The Journal of The Textile Institute, 2021
The resultant CT stacks were converted to 3D array with metadata regarding to resolution and origins. The noise was removed by median filter with spherical structure element. Further, the binarisation based on the Otsu’s method was performed. Once the binarised images were obtained, the Euclidean distance map was computed. It benefits from the circular cross-section of individual fibres. At fibre centre, a distance is minimal with respect to the background and peak occurs. Optimally, the peak has the half value of fibre diameter, but due to a noise, the peak filter works in range 4.7–6.3 μm for TEX-Y and 4.5–7 for the woven structure TEX-2DW. The fibre diameter is known either from manufacturer (see Subsection 2.1) or can be estimated from distance map histogram. Moreover, the crossing fibres can be separated by the distance peaks and thus no additional step is required (Figure 5). The new binarised data are obtained from filter the distance peaks defined by range above. Due to small gaps in the peaks, the morphological dilatation with small structuring element was used to close such gaps. The final step is to apply the skeletonisation on binary array and get one-pixel centres of fibre parts. In order to remove the ‘H’ like connections and another crossings, the pixel were tested for the neighbourhoods by 26-connectivity and those with more than two neighbourhoods were removed. Finally, the disconnected parts were labelled and sorted ascendantly according to fibre segment length.
Prediction of Neutronics Parameters Within a Two-Dimensional Reflective PWR Assembly Using Deep Learning
Published in Nuclear Science and Engineering, 2021
Forrest Shriver, Cole Gentry, Justin Watson
The thermal-hydraulic parameters are relatively straightforward to decompose as they follow directly from the previous example. The different parameters are reshaped into a 2-D 1717 array and fed into the network as completely separate channels of information (designated “stacks” hereinafter). Of note is that the moderator density within the guide tubes does not necessarily need a full 1717 representation as the image will have values only at the guide tube locations and will be zero everywhere else. For ease of exploration, however, these values were still shaped into a 1717 format, although special attention was paid when designing convolutional operations to operate on these and other parameter stacks that possess values only in guide tube locations, as detailed further in Sec. III.B.
Recursive estimation in piecewise affine systems using parameter identifiers and concurrent learning
Published in International Journal of Control, 2019
Denote with (, , ) the jth triplet that is recorded while subsystem i is active. Let a total of such triplets be recorded for each subsystem i. The elements of the triplets are stored in the three history stacks , and . For now, let the number of triplets q be fixed and the stack elements , and be constant. Later, this assumption will be discarded without loss of generality. Furthermore, it will be shown how to record new data for the history stacks and when to replace existing data with new data.