Chapter 10 Additional Features of Arrays Dr. Ali Can Takinacı İstanbul Technical University Faculty of Naval Architecture and Ocean Engineering İstanbul.

Slides:



Advertisements
Similar presentations
Introduction to arrays
Advertisements

Thinking about Systolic Arrays Peter Cappello This presentation assumes that you have read the Chapter by C. Leiserson and H.-T. Kung.
Topic 9C – Multiple Dimension Arrays. CISC105 – Topic 9C Multiple Dimension Arrays A multiple dimension array is an array that has two or more dimensions.
Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room A, Chris Hill, Room ,
Need for Arrays Exercise Read the IDs and the grades for all ICS 101 students. Compute and print the average of the students. Print the grades and IDs.
Fortran: Array Features Session Five ICoCSIS. Outline 1.Zero-sized Array 2.Assumed-shaped Array 3.Automatic Objects 4.Allocation of Data 5.Elemental Operations.
Chapter 5 Basic I/O Concepts Dr. Ali Can Takinacı İstanbul Technical University Faculty of Naval Architecture and Ocean Engineering İstanbul - Turkey Tel:
Application of Fortran 90 to ocean model codes Mark Hadfield National Institute of Water and Atmospheric Research New Zealand.
Chapter 8 Introduction to Arrays Part II Dr. Ali Can Takinacı İstanbul Technical University Faculty of Naval Architecture and Ocean Engineering İstanbul.
Functions & Subroutines HTML version DFMain.chm. Types of subprograms Internal External Module Pure Elemental Recursive Optional arguments Generic Defined.
Chapter 3 Program Design and Branching Structures Dr. Ali Can Takinacı İstanbul Technical University Faculty of Naval Architecture and Ocean Engineering.
Chapter 7 Introduction to Arrays Part I Dr. Ali Can Takinacı İstanbul Technical University Faculty of Naval Architecture and Ocean Engineering İstanbul.
18 April, 2000 CS1001 Lecture 23 Quiz 5 Multi-Dimensional Array.
Chapter 2 Basic Elements of Fortan
CS Data Structures Chapter 2 Arrays and Structures.
Chapter 11 Additional Intrinsic Data Types Dr. Ali Can Takinacı İstanbul Technical University Faculty of Naval Architecture and Ocean Engineering İstanbul.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 11P. 1Winter Quarter Arrays Lecture 11.
Chapter 4 Loops and Character Manipulation Dr. Ali Can Takinacı İstanbul Technical University Faculty of Naval Architecture and Ocean Engineering İstanbul.
Chapter 10 Modules and programming with subroutines.
1 CS 201 Array Debzani Deb. 2 Having trouble linking math.h? Link with the following option gcc –lm –o test test.o.
Chapter 8 Arrays and Strings
Arrays (Part II). Two- and Multidimensional Arrays Two-dimensional array: collection of a fixed number of components (of the same type) arranged in two.
Chapter 9 Introduction to Procedures Dr. Ali Can Takinacı İstanbul Technical University Faculty of Naval Architecture and Ocean Engineering İstanbul -
1 Contents. 2 Run-Time Storage Organization 3 Static Allocation In many early languages, notably assembly and FORTRAN, all storage allocation is static.
Chapter 6 AN INTRODUCTION TO FILES AND FILE PROCESSING Dr. Ali Can Takinacı İstanbul Technical University Faculty of Naval Architecture and Ocean Engineering.
11 Chapter 8 ARRAYS Continued. 22 MULTI-DIMENSIONAL ARRAYS A one-dimensional array is useful for storing/processing a list of values. For example: –The.
Fortran- Subprograms Chapters 6, 7 in your Fortran book.
Fortran: Specification Statements Session Six ICoCSIS.
Fortran: Program Units and Procedures Session Four ICoCSIS.
IE 212: Computational Methods for Industrial Engineering
CPS120: Introduction to Computer Science Arrays. Arrays: A Definition A list of variables accessed using a single identifier May be of any data type Can.
Multi-Dimensional Arrays
Chapter 8 Arrays and Strings
Arrays- Part 2 Spring 2013Programming and Data Structure1.
Lecture Contents Arrays and Vectors: Concepts of array. Memory index of array. Defining and Initializing an array. Processing an array. Parsing an array.
Two dimensional arrays in Java Computer Science 3 Gerb Objective: Use matrices in Java.
CHAPTER: 12. Array is a collection of variables of the same data type that are referenced by a common name. An Array of 10 Elements of type double.
Arrays & Vectors Week 5. The simplest form of the multidimensional array is the two-dimensional array. A two- dimensional array is, in essence, a list.
Computer Science: A Structured Programming Approach Using C1 8-7 Two-Dimensional Arrays The arrays we have discussed so far are known as one- dimensional.
CHAPTER 9 MUTIDIMENSIONAL ARRAYS. Introduction to multidimensional Arrays and Multiply subscripted variables.
An introduction to arrays WEEK 7 Introduction In scientific and engineering computing, it is very common to need to manipulate ordered sets of values,
Arrays Introduction In scientific and engineering computing, it is very common to need to manipulate ordered sets of values, such as vectors and matrices.
Working with Arrays in MATLAB
CPS120: Introduction to Computer Science Lecture 15 Arrays.
Addressing Modes Chapter 6 S. Dandamudi To be used with S. Dandamudi, “Introduction to Assembly Language Programming,” Second Edition, Springer,
Concordia University Department of Computer Science and Software Engineering Click to edit Master title style ADVANCED PROGRAM DESIGN WITH C++ Static arrays.
 2008 Pearson Education, Inc. All rights reserved. 1 Arrays and Vectors.
EGR 115 Introduction to Computing for Engineers MATLAB Basics 1: Variables & Arrays Wednesday 03 Sept 2014 EGR 115 Introduction to Computing for Engineers.
Computer Science: A Structured Programming Approach Using C1 8-7 Two-Dimensional Arrays The arrays we have discussed so far are known as one- dimensional.
Chapter 6Java: an Introduction to Computer Science & Programming - Walter Savitch 1 Chapter 6 l Array Basics l Arrays in Classes and Methods l Programming.
1. Define an array 1 Create reference arrays of objects in Java program 2 Initialize elements of arrays 3 Pass array to methods 4 Return array to methods.
Chapter 8: Part 3 Collections and Two-dimensional arrays.
Engineering Computing I Chapter 5 Pointers and Arrays.
Multidimensional Arrays Vectors of Vectors When One Is Not Enough.
Using a Pointer as an Array Name C allows us to subscript a pointer as though it were an array name Here's an example: #define N 100 int a[N], i, sum =0,
Arrays Declaring arrays Passing arrays to functions Searching arrays with linear search Sorting arrays with insertion sort Multidimensional arrays Programming.
C++ Array 1. C++ provides a data structure, the array, which stores a fixed-size sequential collection of elements of the same type. An array is used.
In C programming, one of the frequently arising problem is to handle similar types of data. For example: If the user want to store marks of 100 students.
MULTI-DIMENSIONAL ARRAYS 1. Multi-dimensional Arrays The types of arrays discussed so far are all linear arrays. That is, they all dealt with a single.
Arrays (Chapter 5)‏ Definition Applications One-Dimensional –Declaration –Initialization –Use Multidimensional.
Chapter 4 Section 1 Organizing Data into Matrices.
Chapter 1 Computing Tools Variables, Scalars, and Arrays Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Array processing and Matrix manipulation
C Passing arrays to a Function
Chapter2 Creating Arrays
Multidimensional array
Chapter 6 Data Types.
Array processing and Matrix manipulation
ประกาศกระทรวงอุตสาหกรรม ฉบับที่ 5292 (พ.ศ. 2562)
Presentation transcript:

Chapter 10 Additional Features of Arrays Dr. Ali Can Takinacı İstanbul Technical University Faculty of Naval Architecture and Ocean Engineering İstanbul - Turkey Tel: +90 ( ) Fax: +90 ( )

Additional Features of Procedures PASSING MULTIDIMENSIONAL ARRAYS TO SUBROUTINES AND FUNCTIONS Multidimensional arrays can be passed to subroutines or functions in a manner similar to that for one-dimensional arrays. However, the subroutine or function will need to know both the number of dimensions and the extent of each dimension in order to use the array properly. © 2010, Dr. ALİ CAN TAKİNACI Slide No: 2

Additional Features of Procedures 1. Explicit-Shape Dummy Arrays The first approach is to use explicit-shape dummy arrays. In this case, we pass the array and the extent of each dimension of the array to the subroutine. The extent values are used to declare the size of the array in the subroutine, and thus the subroutine knows all about the array. When explicit-shape dummy arrays are used, the size and shape of each dummy array in the subprogram is known to the compiler. © 2010, Dr. ALİ CAN TAKİNACI Slide No: 3

Additional Features of Procedures 2. Assumed-Shape Dummy Arrays Assumed-shape arrays are declared by using colons as placeholders for each subscript of the array. These arrays work only if the subroutine or function has an explicit interface, so that the calling program knows everything about the subroutine interface. © 2010, Dr. ALİ CAN TAKİNACI Slide No: 4

Additional Features of Procedures One and Two Dimensional Array (Matrix) Intrinsics Fortran provides three intrinsic functions specifically designed for vector and matrix operations, where it is assumed that matrices are stored in two-dimensional arrays and vectors are stored in one- dimensional arrays. © 2010, Dr. ALİ CAN TAKİNACI Slide No: 5