Release 12. XPRESS-MP Modeller Subroutine Library XMSL. Reference Manual

Size: px
Start display at page:

Download "Release 12. XPRESS-MP Modeller Subroutine Library XMSL. Reference Manual"

Transcription

1 Release 12 XPRESS-MP Modeller Subroutine Library XMSL Reference Manual Dash Associates June 15, 2000

2

3 XMSL Reference Manual Contents i Contents 1 Introduction 1 2 The XMSL Routines Functionality Features Return Values The C Interface initxm modver model freexm The FORTRAN Interface Compiling and Linking The XPRESS Environment Variable Using the Dynamic Link Library Edition Using XMSL with FORTRAN... 7 Appendix A: An Example C Program 9 Appendix B: An Example FORTRAN Program 11 Appendix C: An Example VB Program 13 Index 15

4

5 XMSL Reference Manual Introduction 1 1 Introduction The XPRESS-MP Modeller Subroutine Library (XMSL) is designed to provide the programmer with access to the XPRESS-MP model builder. It allows the developer to embed the functionality of the Console XPRESS model builder, mp-model, into bespoke applications. Together with the XPRESS-MP Optimiser Subroutine Library (XOSL), the developer can build integrated modelling and optimisation applications. For details of XOSL, see the XOSL Reference Manual. Greater flexibility, for example in interrogating and changing data tables, is provided by the XPRESS Entity Modelling and Optimisation Subroutine Library (EMOSL). See the EMOSL Reference Manual for details. XMSL is supplied as an object library or Dynamic Link Library which can be linked in with your own programs, together with a set of include files and tools. Chapter 2 describes the functionality, features and calling conventions of XMSL. Chapter 3 describes how to compile user-written routines and link them with XMSL. Example programs using XMSL in C, Fortran, and VB are contained in the the appendices. For details of the modelling language, the files used by the model builder, and connecting to databases and spreadsheets using XPRESS Connect ODBC, please see the XPRESS-MP Reference Manual. A tutorial-based introduction to these same topics is provided by the XPRESS-MP User Guide.

6

7 XMSL Reference Manual The XMSL Routines 3 2 The XMSL Routines 2.1 Functionality The XPRESS-MP modelling subroutine library contains four routines: initxm, model, freexm and modver. These routines give access to the modeller in a variety of ways, but essentially provide the same functionality as the Console XPRESS model builder, mp-model. Problems can be read from an ASCII model file or interactively from the terminal. Matrices may be generated or post-optimal processing performed. 2.2 Features Modelling mode - mode This allows the user to indicate whether the model routine should generate a matrix or perform post-optimal processing. When the mode is set to generate a matrix, the model file is read until a GENERATE, BIFGENERATE or END is encountered, at which point the matrix is generated (if the model is valid) and the routine finishes. When the mode is set to perform post-optimal processing, those statements following the GENERATE, BIFGENERATE or END are processed and the routine finishes without generating a matrix. Input/Output - echo This allows the user to indicate how the model routine should handle console input and output. It can be set so that: there is no console input/output; only error messages are produced; a full output listing is given; or input/output is read/written interactively (like mp-model). Error file - prterr A separate ASCII file listing all of the errors encountered by the model routine can be produced. This indicates where any errors have occurred in the model file without having to produce a full listing. This facility can be switched on or off using prterr. Number of errors - nerror The number of errors encountered by the model routine is returned into the nerror variable. 2.3 Return Values The routines return an integer value indicating success or failure. A return value of 0 indicates success while a non-zero return value indicates an invalid argument, a memory or file error or some sort of internal error. Below is a full list of return values and their meanings:-

8 XMSL Reference Manual The XMSL Routines 4 0 program terminated normally with END, GENERATE or BIFGENERATE 1 bad input encountered or termination with QUIT 2 bad or corrupt file - unrecoverable 4 memory error 8 corrupt use e.g. security violations, dongle not present or missing password and/or message files 16 program error 32 modeller has found errors in initialisation stage and has reverted into student mode 128 can't find coprocessor Note that a QUIT command in a model returns a return code of 1 by default from the model routine which is the same code used to indicate syntax or other errors in the model. If QUIT is followed by an expression, the value of the expression is returned, so QUIT 0 in the model file returns zero. 2.4 The C Interface initxm This routine controls the initialisation of the modeller. It must be called before any other XMSL routine. int initxm(char *qpath, int memry, int echo) where qpath memry echo is the directory where the XMSL security files mp-model.msg and xpress.pwd are stored. It is possible to pass a NULL argument instead, in which case the XPRESS environment variable is consulted. In either case, if the files are not found, then the directory containing the executable (or DLL for the DLL edition) is checked. is the amount of memory to be allocated to XMSL (in bytes). It is possible to supply a value of zero, in which case the XPMEMMOD environment variable is consulted instead. controls the console input and output from XMSL as follows: 0 indicates no console input/output 1 indicates banner heading and error message output only with no console input 2 indicates a full list output with no console input 3 indicates both console input and output. This is interactive (like mp-model). All console output is suppressed in the DLL edition of XMSL modver This routine gets the release number of XMSL. int modver(char *release) where release is a string buffer of 8 characters into which the release number string will inserted model This routine controls the processing of a model file. int model(char *qprblm, int mode, int prterr, int *nerror) where

9 XMSL Reference Manual The XMSL Routines 5 qprblm mode prterr nerror is the problem name, which is normally just the file name from which the problem is to be read. No file name extension is assumed and so files with any extension can be read; although if no extension is supplied, one of.mod is assumed. The file name can optionally include a drive and/or path specification. determines the modelling mode where: 1 indicates matrix generation 2 indicates post-optimal processing determines whether an ASCII error file is produced where: 0 indicates that no error file is produced 1 indicates that a error file is produced is an int variable that will be set to be the number of errors encountered in the problem file As with mp-model, the problem name is used as a basis for naming other files used by XMSL, unless overridden by file name specifications in the model. For instance, the listing file will be written to problem_name.lst, the error file to problem_name.err, and matrix to problem_name.mat. The problem name can also include d arguments, similar to mp-model, to define symbolic parameters to be used in the model. For instance, if the problem name string passed is "setex dfred=jim" then all occurrences of the string %fred% in the model setex will be replaced by jim freexm This routine frees the memory and resources used by the modeller. int freexm(void) 2.5 The FORTRAN Interface The FORTRAN version of the routines are called thus: call initxm_f(qpath, memry, echo) character*(*) qpath integer memry integer echo call modver_f(qver) character*(*) qver call model_f(qprblm, mode, prterr, nerror) character*(*) qprblm integer mode integer prterr integer nerror call freexm_f() All arguments are passed by reference. The variables take the same values as those defined in the C routines above.

10

11 XMSL Reference Manual Compiling and Linking 7 3 Compiling and Linking 3.1 The XPRESS Environment Variable All the makefiles supplied by Dash use the XPRESS environment variable to work out the location of various header and library files. It is important that this is set to the installation directory for the environment for which you are compiling. For example, if you are using the Windows 32-bit DLLs and you have installed the XPRESS-MP 32-bit DLL kit in the c:\xpressmp\library directory, then you should type the following before compiling XMSL applications. set XPRESS=c:\xpressmp\library 3.2 Using the Dynamic Link Library Edition Under Windows, XMSL exists as a dynamic link library (DLL) which can be called from any Microsoft Windows application. Each XMSL DLL function retains its name from the subroutine library but is capitalised and prefixed with XP (note that this is done automatically in the xpressm.h header file when using C). This is to avoid naming conflicts with some of the Windows development environments. All DLL functions take the same parameters as their subroutine library counterparts. int cb; int errors;... cb = initxm("c:\\xpressmp", ,0); cb = model("c:\\models\\setex",1,1,&errors); cb = freemod() 3.3 Using XMSL with FORTRAN The document Using the XPRESS Libraries with FORTRAN provided with the XPRESS Libraries distribution discusses the use of Compaq FORTRAN with XOSL.

12

13 XMSL Reference Manual An Example C Program 9 Appendix A: An Example C Program An example C program which calls XMSL is given below. It simply reads a model supplied by the user and generates a matrix assuming that the model contains no errors. #include <stdio.h> #include "xpressm.h" main() { char myproblem[128]; int errors, returnvalue; scanf("%s", myproblem); /* Initialise the modeller with no console I/O */ if( returnvalue = initxm(null, , 0) ) checkerror(returnvalue); /* Generate the matrix */ if( returnvalue = model(myproblem, 1, 1, &errors) ) checkerror(returnvalue); /* Free the modeller memory */ if( returnvalue = freexm() ) checkerror(returnvalue); } return 0; checkerror(int errno) { printf("error number %d encountered\n",errno); exit(1); }

14

15 XMSL Reference Manual An Example FORTRAN Program 11 Appendix B: An Example FORTRAN Program An example FORTRAN program which calls XMSL is given below. It reads the model setex1 from directory c:\models and generates the corresponding matrix. program model c c Example main program for the subroutine library. c character*128 myproblem character*128 security integer errors c myproblem = c:\models\setex1 c Initialise the modeller for no console I/O call initxm_f(, ,0) c c Generate the matrix c call model_f(myproblem, 1, 1, errors) if( errors.ne. 0 ) goto 8000 c freexm_f() c stop c 8000 print *,errors, errors detected. end

16

17 XMSL Reference Manual An Example VB Program 13 Appendix C: An Example VB Program The Visual Basic include file xpress.bas must be used in VB projects that use XPRESS-MP. Sub Modelit() Dim ssecurity As String Dim sproblem As String Dim lreturn As Long Dim lmodmemory As Long Dim lecho As Long Dim lmode As Long Dim lprterr As Long Dim lmoderrors As Long You may need to change the following to valid paths/files on your computer sproblem = "d:\model\pplan" lmodmemory = Initialise the Modeller lecho = 0 no console I/O lmode = 1 mode set for matrix generation lprterr = 1 produce a.err file lmoderrors = 0 number of errors in the model file lreturn = XPINITXM(vbNullString, lmodmemory, lecho) If lreturn <> 0 Then Call MsgBox(...) End End If Run the model lreturn = XPMODEL(sProblem, lmode, lprterr, lmoderrors) If lmoderrors > 0 Then Call MsgBox("...) lreturn = XPFREEXM() End End If Free the modeller memory lreturn = XPFREEXM() Now we are going to optimise....

18

19 XMSL Reference Manual Index 15 freexm_f 5 functionality 3 A Index arguments in problem name -d 5 C C example program 9 interface 4 compiling and linking 7 console input/output 3, 4 D -d arguments 5 DLL 7 dynamic link library see DLL E EMOSL 1 environment variable XPMEMMOD 4 XPRESS 4, 7 error file 3, 5 errors listed in file 3, 5 number of 3, 5 example program C example 9 FORTRAN example 11 VB example 13 F files security 4 files used by the model builder 1, 5 FORTRAN example program 11 interface 5 freeing XMSL 5 freexm 5 I initialising XMSL 4 initxm 4 initxm_f 5 input console 3, 4 interfaces C 4 FORTRAN 5 M matrix generation 3, 5 memory 4 mode modelling 3, 5 model 4 model file 3 processing 4 model_f 5 modelling language 1 modelling mode 3, 5 modver 4 modver_f 5 mp-model 1, 3 mp-model.msg 4 O output console 3, 4 P post-optimal processing 3, 5 problem name 5 Q QUIT command in model files 4 R release number 4 return values 3 routines 3 freexm 3 initxm 3

20 XMSL Reference Manual Index 16 S model 3 modver 3 security files 4 symbolic parameters defining 5 V VB example program 13 version 4 X XMSL 1 freeing 5 initialising 4 version 4 XOSL 1 XPMEMMOD environment variable 4 XPRESS Connect ODBC 1 XPRESS environment variable 4, 7 xpress.pwd 4

Release 12. Using the XPRESS Libraries with VB and VBA

Release 12. Using the XPRESS Libraries with VB and VBA Release 12 Using the XPRESS Libraries with VB and VBA Dash Associates June 15, 2000 Using the XPRESS Libraries with VB and VBA Contents i Contents 1 Introduction 1 1.1 Functionality... 1 1.2 Prerequisites...

More information

M4.1-R3: PROGRAMMING AND PROBLEM SOLVING THROUGH C LANGUAGE

M4.1-R3: PROGRAMMING AND PROBLEM SOLVING THROUGH C LANGUAGE M4.1-R3: PROGRAMMING AND PROBLEM SOLVING THROUGH C LANGUAGE NOTE: 1. There are TWO PARTS in this Module/Paper. PART ONE contains FOUR questions and PART TWO contains FIVE questions. 2. PART ONE is to be

More information

Subject: PROBLEM SOLVING THROUGH C Time: 3 Hours Max. Marks: 100

Subject: PROBLEM SOLVING THROUGH C Time: 3 Hours Max. Marks: 100 Code: DC-05 Subject: PROBLEM SOLVING THROUGH C Time: 3 Hours Max. Marks: 100 NOTE: There are 11 Questions in all. Question 1 is compulsory and carries 16 marks. Answer to Q. 1. must be written in the space

More information

A. Run-Time Error Messages

A. Run-Time Error Messages Appendix A A. Table A-1 lists possible Fortran run-time I/O errors. Other errors given by the operating system may also occur (refer to the intro(2) and perror(3f) reference pages for details). Each error

More information

Rocket UniVerse. GCI Guide. Version November 2013 UNV-112-GCI-1

Rocket UniVerse. GCI Guide. Version November 2013 UNV-112-GCI-1 Rocket UniVerse GCI Guide Version 11.2 November 2013 UNV-112-GCI-1 Notices Edition Publication date: November 2013 Book number: UNV-112-GCI-1 Product version: Rocket UniVerse V11.2 2 Copyright Rocket Software,

More information

B.V. Patel Institute of Business Management, Computer & Information Technology, Uka Tarsadia University

B.V. Patel Institute of Business Management, Computer & Information Technology, Uka Tarsadia University Unit 1 Programming Language and Overview of C 1. State whether the following statements are true or false. a. Every line in a C program should end with a semicolon. b. In C language lowercase letters are

More information

Computer Science 322 Operating Systems Mount Holyoke College Spring Topic Notes: C and Unix Overview

Computer Science 322 Operating Systems Mount Holyoke College Spring Topic Notes: C and Unix Overview Computer Science 322 Operating Systems Mount Holyoke College Spring 2010 Topic Notes: C and Unix Overview This course is about operating systems, but since most of our upcoming programming is in C on a

More information

Computer Science 2500 Computer Organization Rensselaer Polytechnic Institute Spring Topic Notes: C and Unix Overview

Computer Science 2500 Computer Organization Rensselaer Polytechnic Institute Spring Topic Notes: C and Unix Overview Computer Science 2500 Computer Organization Rensselaer Polytechnic Institute Spring 2009 Topic Notes: C and Unix Overview This course is about computer organization, but since most of our programming is

More information

Programming Environment Variable APIs

Programming Environment Variable APIs System i Programming Environment Variable APIs Version 6 Release 1 System i Programming Environment Variable APIs Version 6 Release 1 Note Before using this information and the product it supports, read

More information

Table of Contents. PREFACE... vii CONVENTIONS... vii HOW TO USE THIS MANUAL... vii Further Information...viii

Table of Contents. PREFACE... vii CONVENTIONS... vii HOW TO USE THIS MANUAL... vii Further Information...viii Table of Contents PREFACE... vii CONVENTIONS... vii HOW TO USE THIS MANUAL... vii Further Information...viii USING BASIC-52... 1 BASIC-52 PINOUT AND FEATURES... 1 8052AH and 80C52 DIFFERENCES... 1 DEFINITION

More information

Initialization Exit Programmer's Guide

Initialization Exit Programmer's Guide IBM Optim Initialization Exit Programmer's Guide Version 7.0 Release 3 IBM Optim Initialization Exit Programmer's Guide Version 7.0 Release 3 Note Before using this information and the product it supports,

More information

Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 18 I/O in C Standard C Library I/O commands are not included as part of the C language. Instead, they are part of the Standard C Library. A collection of functions and macros that must be implemented

More information

C How to Program, 6/e by Pearson Education, Inc. All Rights Reserved.

C How to Program, 6/e by Pearson Education, Inc. All Rights Reserved. C How to Program, 6/e 1992-2010 by Pearson Education, Inc. An important part of the solution to any problem is the presentation of the results. In this chapter, we discuss in depth the formatting features

More information

Programming Languages

Programming Languages Programming Languages Tevfik Koşar Lecture - VIII February 9 th, 2006 1 Roadmap Allocation techniques Static Allocation Stack-based Allocation Heap-based Allocation Scope Rules Static Scopes Dynamic Scopes

More information

CS201- Introduction to Programming Latest Solved Mcqs from Midterm Papers May 07,2011. MIDTERM EXAMINATION Spring 2010

CS201- Introduction to Programming Latest Solved Mcqs from Midterm Papers May 07,2011. MIDTERM EXAMINATION Spring 2010 CS201- Introduction to Programming Latest Solved Mcqs from Midterm Papers May 07,2011 Lectures 1-22 Moaaz Siddiq Asad Ali Latest Mcqs MIDTERM EXAMINATION Spring 2010 Question No: 1 ( Marks: 1 ) - Please

More information

Codewarrior for ColdFire (Eclipse) 10.0 Setup

Codewarrior for ColdFire (Eclipse) 10.0 Setup Codewarrior for ColdFire (Eclipse) 10.0 Setup 1. Goal This document is designed to ensure that your Codewarrior for Coldfire v10.0 environment is correctly setup and to orient you to it basic functionality

More information

Technical Questions. Q 1) What are the key features in C programming language?

Technical Questions. Q 1) What are the key features in C programming language? Technical Questions Q 1) What are the key features in C programming language? Portability Platform independent language. Modularity Possibility to break down large programs into small modules. Flexibility

More information

Programming for Engineers Arrays

Programming for Engineers Arrays Programming for Engineers Arrays ICEN 200 Spring 2018 Prof. Dola Saha 1 Array Ø Arrays are data structures consisting of related data items of the same type. Ø A group of contiguous memory locations that

More information

Slide Set 3. for ENCM 339 Fall Steve Norman, PhD, PEng. Electrical & Computer Engineering Schulich School of Engineering University of Calgary

Slide Set 3. for ENCM 339 Fall Steve Norman, PhD, PEng. Electrical & Computer Engineering Schulich School of Engineering University of Calgary Slide Set 3 for ENCM 339 Fall 2016 Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary September 2016 ENCM 339 Fall 2016 Slide Set 3 slide 2/46

More information

Problem Solving and 'C' Programming

Problem Solving and 'C' Programming Problem Solving and 'C' Programming Targeted at: Entry Level Trainees Session 15: Files and Preprocessor Directives/Pointers 2007, Cognizant Technology Solutions. All Rights Reserved. The information contained

More information

CS113: Lecture 7. Topics: The C Preprocessor. I/O, Streams, Files

CS113: Lecture 7. Topics: The C Preprocessor. I/O, Streams, Files CS113: Lecture 7 Topics: The C Preprocessor I/O, Streams, Files 1 Remember the name: Pre-processor Most commonly used features: #include, #define. Think of the preprocessor as processing the file so as

More information

ProvideX. C-Library File IO Routines

ProvideX. C-Library File IO Routines ProvideX C-Library File IO Routines Introduction 3 PVK_open( ) 5 PVK_openEx( ) 5 PVK_close( ) 6 PVK_read( ) 6 PVK_seek( ) 7 PVK_write( ) 7 PVK_insert( ) 8 PVK_update( ) 9 PVK_remove( ) 10 PVK_getpos( )

More information

M.CS201 Programming language

M.CS201 Programming language Power Engineering School M.CS201 Programming language Lecture 14 Lecturer: Prof. Dr. T.Uranchimeg Agenda Ending Loops Early The break Statement The continue Statement Executing Operating System Commands

More information

ASSIGNMENT TWO: PHONE BOOK

ASSIGNMENT TWO: PHONE BOOK ASSIGNMENT TWO: PHONE BOOK ADVANCED PROGRAMMING TECHNIQUES SEMESTER 1, 2017 SUMMARY In this assignment, you will use your C programming skills to create a phone book. The phone book loads its entries from

More information

SWEN-250 Personal SE. Introduction to C

SWEN-250 Personal SE. Introduction to C SWEN-250 Personal SE Introduction to C A Bit of History Developed in the early to mid 70s Dennis Ritchie as a systems programming language. Adopted by Ken Thompson to write Unix on a the PDP-11. At the

More information

C library = Header files + Reserved words + main method

C library = Header files + Reserved words + main method DAY 1: What are Libraries and Header files in C. Suppose you need to see an Atlas of a country in your college. What do you need to do? You will first go to the Library of your college and then to the

More information

Computers Programming Course 10. Iulian Năstac

Computers Programming Course 10. Iulian Năstac Computers Programming Course 10 Iulian Năstac Recap from previous course 5. Values returned by a function A return statement causes execution to leave the current subroutine and resume at the point in

More information

Strings(2) CS 201 String. String Constants. Characters. Strings(1) Initializing and Declaring String. Debzani Deb

Strings(2) CS 201 String. String Constants. Characters. Strings(1) Initializing and Declaring String. Debzani Deb CS 201 String Debzani Deb Strings(2) Two interpretations of String Arrays whose elements are characters. Pointer pointing to characters. Strings are always terminated with a NULL characters( \0 ). C needs

More information

File Access. FILE * fopen(const char *name, const char * mode);

File Access. FILE * fopen(const char *name, const char * mode); File Access, K&R 7.5 Dealing with named files is surprisingly similar to dealing with stdin and stdout. Start by declaring a "file pointer": FILE *fp; /* See Appendix B1.1, pg. 242 */ header

More information

Fundamentals of Programming Session 4

Fundamentals of Programming Session 4 Fundamentals of Programming Session 4 Instructor: Reza Entezari-Maleki Email: entezari@ce.sharif.edu 1 Fall 2011 These slides are created using Deitel s slides, ( 1992-2010 by Pearson Education, Inc).

More information

Slide Set 3. for ENCM 339 Fall 2017 Section 01. Steve Norman, PhD, PEng

Slide Set 3. for ENCM 339 Fall 2017 Section 01. Steve Norman, PhD, PEng Slide Set 3 for ENCM 339 Fall 2017 Section 01 Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary September 2017 ENCM 339 Fall 2017 Section 01

More information

Exercise 1.1 Hello world

Exercise 1.1 Hello world Exercise 1.1 Hello world The goal of this exercise is to verify that computer and compiler setup are functioning correctly. To verify that your setup runs fine, compile and run the hello world example

More information

dbx90: Fortran debugger March 9, 2009

dbx90: Fortran debugger March 9, 2009 dbx90: Fortran debugger March 9, 2009 1 Name dbx90 a Fortran 90/95 debugger for use with the NAG Fortran compiler. 2 Usage dbx90 [option]... executable-file 3 Description dbx90 is a Fortran 90/95 debugger

More information

INTRODUCTION...2 REQUIREMENTS...2 INSTALLATION...2 DISTRIBUTION...2 SAMPLE APPLICATION...3 FUNCTION: WinsockRCP...4

INTRODUCTION...2 REQUIREMENTS...2 INSTALLATION...2 DISTRIBUTION...2 SAMPLE APPLICATION...3 FUNCTION: WinsockRCP...4 Copyright 2002 Denicomp Systems. All rights reserved. INTRODUCTION...2 REQUIREMENTS...2 INSTALLATION...2 DISTRIBUTION...2 SAMPLE APPLICATION...3 FUNCTION: WinsockRCP...4 Usage... 4 Parameters... 4 Source

More information

.. Cal Poly CPE 101: Fundamentals of Computer Science I Alexander Dekhtyar..

.. Cal Poly CPE 101: Fundamentals of Computer Science I Alexander Dekhtyar.. .. Cal Poly CPE 101: Fundamentals of Computer Science I Alexander Dekhtyar.. A Simple Program. simple.c: Basics of C /* CPE 101 Fall 2008 */ /* Alex Dekhtyar */ /* A simple program */ /* This is a comment!

More information

A Fast Review of C Essentials Part I

A Fast Review of C Essentials Part I A Fast Review of C Essentials Part I Structural Programming by Z. Cihan TAYSI Outline Program development C Essentials Functions Variables & constants Names Formatting Comments Preprocessor Data types

More information

AMCAT Automata Coding Sample Questions And Answers

AMCAT Automata Coding Sample Questions And Answers 1) Find the syntax error in the below code without modifying the logic. #include int main() float x = 1.1; switch (x) case 1: printf( Choice is 1 ); default: printf( Invalid choice ); return

More information

Programs in memory. The layout of memory is roughly:

Programs in memory. The layout of memory is roughly: Memory 1 Programs in memory 2 The layout of memory is roughly: Virtual memory means that memory is allocated in pages or segments, accessed as if adjacent - the platform looks after this, so your program

More information

CROSSREF Manual. Tools and Utilities Library

CROSSREF Manual. Tools and Utilities Library Tools and Utilities Library CROSSREF Manual Abstract This manual describes the CROSSREF cross-referencing utility, including how to use it with C, COBOL 74, COBOL85, EXTENDED BASIC, FORTRAN, Pascal, SCREEN

More information

Arrays and Strings. Arash Rafiey. September 12, 2017

Arrays and Strings. Arash Rafiey. September 12, 2017 September 12, 2017 Arrays Array is a collection of variables with the same data type. Arrays Array is a collection of variables with the same data type. Instead of declaring individual variables, such

More information

System Programming. Standard Input/Output Library (Cont d)

System Programming. Standard Input/Output Library (Cont d) Content : by Dr. B. Boufama School of Computer Science University of Windsor Instructor: Dr. A. Habed adlane@cs.uwindsor.ca http://cs.uwindsor.ca/ adlane/60-256 Content Content 1 Binary I/O 2 3 4 5 Binary

More information

Computers Programming Course 11. Iulian Năstac

Computers Programming Course 11. Iulian Năstac Computers Programming Course 11 Iulian Năstac Recap from previous course Cap. Matrices (Arrays) Matrix representation is a method used by a computer language to store matrices of different dimension in

More information

15213 Recitation Section C

15213 Recitation Section C 15213 Recitation Section C Outline Sept. 9, 2002 Introduction Unix and C Playing with Bits Practice Problems Introducing Myself Try to pronounce my name: My office hour: Wed 2-3pm, WeH 8019 Contact: Email:

More information

IECD Institute for Entrepreneurship and Career Development Bharathidasan University, Tiruchirappalli 23.

IECD Institute for Entrepreneurship and Career Development Bharathidasan University, Tiruchirappalli 23. Subject code - CCP01 Chapt Chapter 1 INTRODUCTION TO C 1. A group of software developed for certain purpose are referred as ---- a. Program b. Variable c. Software d. Data 2. Software is classified into

More information

Professor Terje Haukaas University of British Columbia, Vancouver C++ Programming

Professor Terje Haukaas University of British Columbia, Vancouver  C++ Programming C++ Programming C++ code is essentially a collection of statements terminated by a semicolon, such as (spaces not needed): a = b + c; Most C++ code is organized into header files and cpp files, i.e., C++

More information

Binghamton University. CS-220 Spring Includes & Streams

Binghamton University. CS-220 Spring Includes & Streams Includes & Streams 1 C Pre-Processor C Program Pre-Processor Pre-processed C Program Header Files Header Files 2 #include Two flavors: #include Replace this line with the contents of file abc.h

More information

S Computer Architecture. Computer architecture assignment E1 A subroutine, which searches for given byte pattern from an byte array.

S Computer Architecture. Computer architecture assignment E1 A subroutine, which searches for given byte pattern from an byte array. S-87.3190 Computer Architecture Computer architecture assignment E1 A subroutine, which searches for given byte pattern from an byte array. Mikko Vestola Student ID: xxxxx Department: xxxx Email: xxxxx

More information

How to declare an array in C?

How to declare an array in C? Introduction An array is a collection of data that holds fixed number of values of same type. It is also known as a set. An array is a data type. Representation of a large number of homogeneous values.

More information

1 Chapter Plan...1 Exercise - Simple Program...2

1 Chapter Plan...1 Exercise - Simple Program...2 Chapter 1: Introduction Exercise - Simple Program...2 2 Subject Matter...4 1. What is PL/1?...4 2. PL/1: Strengths and Advantages...5 3. Program Structure...6 4. Data Types...7 5. Built-in Functions...8

More information

Assembler Programming. Lecture 10

Assembler Programming. Lecture 10 Assembler Programming Lecture 10 Lecture 10 Mixed language programming. C and Basic to MASM Interface. Mixed language programming Combine Basic, C, Pascal with assembler. Call MASM routines from HLL program.

More information

1 Lexical Considerations

1 Lexical Considerations Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.035, Spring 2013 Handout Decaf Language Thursday, Feb 7 The project for the course is to write a compiler

More information

NAGWare f95 Recent and Future Developments

NAGWare f95 Recent and Future Developments NAGWare f95 Recent and Future Developments Malcolm Cohen The Numerical Algorithms Group Ltd., Oxford Nihon Numerical Algorithms Group KK, Tokyo Contents 1. Standard Fortran 2. High Performance 3. NAGWare

More information

Using the PowerExchange CallProg Function to Call a User Exit Program

Using the PowerExchange CallProg Function to Call a User Exit Program Using the PowerExchange CallProg Function to Call a User Exit Program 2010 Informatica Abstract This article describes how to use the PowerExchange CallProg function in an expression in a data map record

More information

Accelerated Library Framework for Hybrid-x86

Accelerated Library Framework for Hybrid-x86 Software Development Kit for Multicore Acceleration Version 3.0 Accelerated Library Framework for Hybrid-x86 Programmer s Guide and API Reference Version 1.0 DRAFT SC33-8406-00 Software Development Kit

More information

About Codefrux While the current trends around the world are based on the internet, mobile and its applications, we try to make the most out of it. As for us, we are a well established IT professionals

More information

UNIVERSITY OF NEBRASKA AT OMAHA Computer Science 4500/8506 Operating Systems Fall Programming Assignment 1 (updated 9/16/2017)

UNIVERSITY OF NEBRASKA AT OMAHA Computer Science 4500/8506 Operating Systems Fall Programming Assignment 1 (updated 9/16/2017) UNIVERSITY OF NEBRASKA AT OMAHA Computer Science 4500/8506 Operating Systems Fall 2017 Programming Assignment 1 (updated 9/16/2017) Introduction The purpose of this programming assignment is to give you

More information

OMPlab on Sun - Lab Programs

OMPlab on Sun - Lab Programs IWOMP 2005 - OMPlab on Sun 1/8 OMPlab on Sun - Lab Programs Introduction We have prepared a set of lab programs for you. We have an exercise to implement OpenMP in a simple algorithm and also various programs

More information

Functions. Arash Rafiey. September 26, 2017

Functions. Arash Rafiey. September 26, 2017 September 26, 2017 are the basic building blocks of a C program. are the basic building blocks of a C program. A function can be defined as a set of instructions to perform a specific task. are the basic

More information

4 The Text VDU. 4.1 Text VDU Coordinate Systems. 4.2 Streams. AMSTRAD CPC464/664/6128 FIRMWARE Page 4.1

4 The Text VDU. 4.1 Text VDU Coordinate Systems. 4.2 Streams. AMSTRAD CPC464/664/6128 FIRMWARE Page 4.1 4 The Text VDU. The Text VDU is a character based screen driver. It controls 8 different streams each of which can have an area of screen allocated to it (a window). The Text VDU allows characters to be

More information

Memory Management. CSC215 Lecture

Memory Management. CSC215 Lecture Memory Management CSC215 Lecture Outline Static vs Dynamic Allocation Dynamic allocation functions malloc, realloc, calloc, free Implementation Common errors Static Allocation Allocation of memory at compile-time

More information

RPC Interface Specification November 2001 Introduction

RPC Interface Specification November 2001 Introduction Issue 2 Gordon Hopkins [M328] RPC Interface Specification November 2001 Introduction In order to provide reliable communications between a PC of any kind and a Model Railway layout, a strict communication

More information

Variables Data types Variable I/O. C introduction. Variables. Variables 1 / 14

Variables Data types Variable I/O. C introduction. Variables. Variables 1 / 14 C introduction Variables Variables 1 / 14 Contents Variables Data types Variable I/O Variables 2 / 14 Usage Declaration: t y p e i d e n t i f i e r ; Assignment: i d e n t i f i e r = v a l u e ; Definition

More information

BEA Tuxedo. System Messages CMDFML Catalog

BEA Tuxedo. System Messages CMDFML Catalog BEA Tuxedo System Messages CMDFML Catalog BEA Tuxedo Release 7.1 Document Edition 7.1 May 2000 Copyright Copyright 2000 BEA Systems, Inc. All Rights Reserved. Restricted Rights Legend This software and

More information

NAG Library Function Document nag_matop_complex_gen_matrix_fun_num (f01flc)

NAG Library Function Document nag_matop_complex_gen_matrix_fun_num (f01flc) NAG Library Function Document nag_matop_complex_gen_matrix_fun_num () 1 Purpose nag_matop_complex_gen_matrix_fun_num () computes the matrix function, fa ð Þ, of a complex n by n matrix A. Numerical differentiation

More information

Fundamentals of Programming. Lecture 3: Introduction to C Programming

Fundamentals of Programming. Lecture 3: Introduction to C Programming Fundamentals of Programming Lecture 3: Introduction to C Programming Instructor: Fatemeh Zamani f_zamani@ce.sharif.edu Sharif University of Technology Computer Engineering Department Outline A Simple C

More information

CS261: HOMEWORK 2 Due 04/13/2012, at 2pm

CS261: HOMEWORK 2 Due 04/13/2012, at 2pm CS261: HOMEWORK 2 Due 04/13/2012, at 2pm Submit six *.c files via the TEACH website: https://secure.engr.oregonstate.edu:8000/teach.php?type=want_auth 1. Introduction The purpose of HW2 is to help you

More information

IBM Informix Large Object Locator DataBlade Module User s Guide

IBM Informix Large Object Locator DataBlade Module User s Guide IBM Informix Large Object Locator DataBlade Module User s Guide Version 1.2A March 2003 Part No. CT1V1NA Note: Before using this information and the product it supports, read the information in the appendix

More information

CSE 124 Discussion (10/3) C/C++ Basics

CSE 124 Discussion (10/3) C/C++ Basics CSE 124 Discussion (10/3) C/C++ Basics Topics - main() function - Compiling with gcc/makefile - Primitives - Structs/Enums - Function calls/loops - C++ Classes/stdtl - Pointers/Arrays - Memory allocation/freeing

More information

An array is a collection of data that holds fixed number of values of same type. It is also known as a set. An array is a data type.

An array is a collection of data that holds fixed number of values of same type. It is also known as a set. An array is a data type. Data Structures Introduction An array is a collection of data that holds fixed number of values of same type. It is also known as a set. An array is a data type. Representation of a large number of homogeneous

More information

Introduction to C An overview of the programming language C, syntax, data types and input/output

Introduction to C An overview of the programming language C, syntax, data types and input/output Introduction to C An overview of the programming language C, syntax, data types and input/output Teil I. a first C program TU Bergakademie Freiberg INMO M. Brändel 2018-10-23 1 PROGRAMMING LANGUAGE C is

More information

BUFFER OVERFLOW. Jo, Heeseung

BUFFER OVERFLOW. Jo, Heeseung BUFFER OVERFLOW Jo, Heeseung IA-32/LINUX MEMORY LAYOUT Heap Runtime stack (8MB limit) Dynamically allocated storage When call malloc(), calloc(), new() DLLs (shared libraries) Data Text Dynamically linked

More information

Lesson 7. Reading and Writing a.k.a. Input and Output

Lesson 7. Reading and Writing a.k.a. Input and Output Lesson 7 Reading and Writing a.k.a. Input and Output Escape sequences for printf strings Source: http://en.wikipedia.org/wiki/escape_sequences_in_c Escape sequences for printf strings Why do we need escape

More information

Buffer Overflow. Jo, Heeseung

Buffer Overflow. Jo, Heeseung Buffer Overflow Jo, Heeseung IA-32/Linux Memory Layout Heap Runtime stack (8MB limit) Dynamically allocated storage When call malloc(), calloc(), new() DLLs (shared libraries) Data Text Dynamically linked

More information

Level 3 Computing Year 2 Lecturer: Phil Smith

Level 3 Computing Year 2 Lecturer: Phil Smith Level 3 Computing Year 2 Lecturer: Phil Smith Previously We started to build a GUI program using visual studio 2010 and vb.net. We have a form designed. We have started to write the code to provided the

More information

by Pearson Education, Inc. All Rights Reserved. 2

by Pearson Education, Inc. All Rights Reserved. 2 Data that is formatted and written to a sequential file as shown in Section 17.4 cannot be modified without the risk of destroying other data in the file. For example, if the name White needs to be changed

More information

Other Loop Options EXAMPLE

Other Loop Options EXAMPLE C++ 14 By EXAMPLE Other Loop Options Now that you have mastered the looping constructs, you should learn some loop-related statements. This chapter teaches the concepts of timing loops, which enable you

More information

Tribhuvan University Institute of Science and Technology 2065

Tribhuvan University Institute of Science and Technology 2065 1CSc.102-2065 2065 Candidates are required to give their answers in their own words as for as practicable. 1. Draw the flow chart for finding largest of three numbers and write an algorithm and explain

More information

A brief introduction to C programming for Java programmers

A brief introduction to C programming for Java programmers A brief introduction to C programming for Java programmers Sven Gestegård Robertz September 2017 There are many similarities between Java and C. The syntax in Java is basically

More information

#include <stdio.h> int main() { char s[] = Hsjodi, *p; for (p = s + 5; p >= s; p--) --*p; puts(s); return 0;

#include <stdio.h> int main() { char s[] = Hsjodi, *p; for (p = s + 5; p >= s; p--) --*p; puts(s); return 0; 1. Short answer questions: (a) Compare the typical contents of a module s header file to the contents of a module s implementation file. Which of these files defines the interface between a module and

More information

C How to Program, 6/e by Pearson Education, Inc. All Rights Reserved.

C How to Program, 6/e by Pearson Education, Inc. All Rights Reserved. C How to Program, 6/e 1992-2010 by Pearson Education, Inc. 1992-2010 by Pearson Education, Inc. 1992-2010 by Pearson Education, Inc. This chapter serves as an introduction to the important topic of data

More information

Preprocessor Directives

Preprocessor Directives C++ By 6 EXAMPLE Preprocessor Directives As you might recall from Chapter 2, What Is a Program?, the C++ compiler routes your programs through a preprocessor before it compiles them. The preprocessor can

More information

CSC209: Software tools. Unix files and directories permissions utilities/commands Shell programming quoting wild cards files

CSC209: Software tools. Unix files and directories permissions utilities/commands Shell programming quoting wild cards files CSC209 Review CSC209: Software tools Unix files and directories permissions utilities/commands Shell programming quoting wild cards files ... and systems programming C basic syntax functions arrays structs

More information

CSC209: Software tools. Unix files and directories permissions utilities/commands Shell programming quoting wild cards files. Compiler vs.

CSC209: Software tools. Unix files and directories permissions utilities/commands Shell programming quoting wild cards files. Compiler vs. CSC209 Review CSC209: Software tools Unix files and directories permissions utilities/commands Shell programming quoting wild cards files... and systems programming C basic syntax functions arrays structs

More information

Communications API. TEAM A : Communications and Integration Group. April 15, 1995

Communications API. TEAM A : Communications and Integration Group. April 15, 1995 Communications API TEAM A : Communications and Integration Group April 15, 1995 1 Introduction This document specifies the API provided by the Communications and Integration group for use in the AMC system.

More information

ONE DIMENSIONAL ARRAYS

ONE DIMENSIONAL ARRAYS LECTURE 14 ONE DIMENSIONAL ARRAYS Array : An array is a fixed sized sequenced collection of related data items of same data type. In its simplest form an array can be used to represent a list of numbers

More information

Programming with Microsoft Visual Basic.NET. Array. What have we learnt in last lesson? What is Array?

Programming with Microsoft Visual Basic.NET. Array. What have we learnt in last lesson? What is Array? What have we learnt in last lesson? Programming with Microsoft Visual Basic.NET Using Toolbar in Windows Form. Using Tab Control to separate information into different tab page Storage hierarchy information

More information

Application Note: AN00152 xscope - Bi-Directional Endpoint

Application Note: AN00152 xscope - Bi-Directional Endpoint Application Note: AN00152 xscope - Bi-Directional Endpoint This application note shows how to create a simple example which uses the XMOS xscope application trace system to provide bi-directional communication

More information

EDIABAS BEST/2 LANGUAGE DESCRIPTION. VERSION 6b. Electronic Diagnostic Basic System EDIABAS - BEST/2 LANGUAGE DESCRIPTION

EDIABAS BEST/2 LANGUAGE DESCRIPTION. VERSION 6b. Electronic Diagnostic Basic System EDIABAS - BEST/2 LANGUAGE DESCRIPTION EDIABAS Electronic Diagnostic Basic System BEST/2 LANGUAGE DESCRIPTION VERSION 6b Copyright BMW AG, created by Softing AG BEST2SPC.DOC CONTENTS CONTENTS...2 1. INTRODUCTION TO BEST/2...5 2. TEXT CONVENTIONS...6

More information

Variable A variable is a value that can change during the execution of a program.

Variable A variable is a value that can change during the execution of a program. Declare and use variables and constants Variable A variable is a value that can change during the execution of a program. Constant A constant is a value that is set when the program initializes and does

More information

Memory Based Driver Help Kepware Technologies

Memory Based Driver Help Kepware Technologies Memory Based Driver Help 2011 Kepware Technologies 2 Table of Contents Table of Contents 2 3 Overview 3 Channel Setup 4 Data Types Description 5 Address Descriptions 6 Error Descriptions 7 Address ''

More information

NAG Library Function Document nag_dtpttr (f01vcc)

NAG Library Function Document nag_dtpttr (f01vcc) NAG Library Function Document nag_dtpttr () 1 Purpose nag_dtpttr () unpacks a real triangular matrix, stored in a standard packed format array, to a full format array. 2 Specification #include

More information

CSE 333 Midterm Exam July 24, Name UW ID#

CSE 333 Midterm Exam July 24, Name UW ID# Name UW ID# There are 6 questions worth a total of 100 points. Please budget your time so you get to all of the questions. Keep your answers brief and to the point. The exam is closed book, closed notes,

More information

CS6202 - PROGRAMMING & DATA STRUCTURES UNIT I Part - A 1. W hat are Keywords? Keywords are certain reserved words that have standard and pre-defined meaning in C. These keywords can be used only for their

More information

LESSON 4. The DATA TYPE char

LESSON 4. The DATA TYPE char LESSON 4 This lesson introduces some of the basic ideas involved in character processing. The lesson discusses how characters are stored and manipulated by the C language, how characters can be treated

More information

Contents. Wbridge.DLL 4th June 2012

Contents. Wbridge.DLL 4th June 2012 Contents Contents... 1 wbridge.dll... 2 Installation... 2 wbridge.dll location... 2 wbridge.dll registration... 3 Microsoft required kits... 3 Mettler Toledo weighbridge cabling... 4 Rinstrum and Sabre

More information

Functions in C. Lecture Topics. Lecture materials. Homework. Machine problem. Announcements. ECE 190 Lecture 16 March 9, 2011

Functions in C. Lecture Topics. Lecture materials. Homework. Machine problem. Announcements. ECE 190 Lecture 16 March 9, 2011 Functions in C Lecture Topics Introduction to using functions in C Syntax Examples Memory allocation for variables Lecture materials Textbook 14.1-14.2, 12.5 Homework Machine problem MP3.2 due March 18,

More information

Intermediate Programming Programming-Tools and Sorting-Algorithms Exercise Sheet Deadline on 13th of November 2009

Intermediate Programming Programming-Tools and Sorting-Algorithms Exercise Sheet Deadline on 13th of November 2009 Institute of Scientific Computing Technische Universität Braunschweig Prof. Hermann G. Matthies, Ph. D. Dominik Jürgens Winter Term 2009 August 11, 2009 Intermediate Programming Programming-Tools and Sorting-Algorithms

More information

C Review. MaxMSP Developers Workshop Summer 2009 CNMAT

C Review. MaxMSP Developers Workshop Summer 2009 CNMAT C Review MaxMSP Developers Workshop Summer 2009 CNMAT C Syntax Program control (loops, branches): Function calls Math: +, -, *, /, ++, -- Variables, types, structures, assignment Pointers and memory (***

More information

Armide Documentation. Release Kyle Mayes

Armide Documentation. Release Kyle Mayes Armide Documentation Release 0.3.1 Kyle Mayes December 19, 2014 Contents 1 Introduction 1 1.1 Features.................................................. 1 1.2 License..................................................

More information

CS240: Programming in C. Lecture 14: Errors

CS240: Programming in C. Lecture 14: Errors CS240: Programming in C Lecture 14: Errors Errors We ve already seen a number of instances where unexpected (and uncaught) errors can take place: Memory buffer overflow/underflow unintended casts misuse

More information