Sponsored Content
Top Forums Programming FORTRAN -Returning index fir which values fall in a region Post 302476042 by jgt on Tuesday 30th of November 2010 04:28:45 PM
Old 11-30-2010
Sort an array. Univac Fortran V. I don't think that the implicit statement is still supported though, and I don't have a compiler to confirm that there are no typos in the following code.

Code:
     *DIMENSION TABLE (14,500)
     *FILL TABLE WITH DATA AND SORT ON COLUMNS 2,1,3

     SUBROUTINE TXSORT
     IMPLICIT INTEGER (A-Y)
     X0=TABCTR         * TABCTR IS ONE MORE THAN NUMBER OF ENTRIES IN THE TABLE.
10   X0=X0/2
     IF (X0) 15,70,15
15   X1=TABCTR-X0
     X2=1
20   X3=X2
30   X4=X3+X0
     IF (TABLE(2,X3)-TABLE(2,X4)) 60,45,40
45   IF (TABLE(1,X3)-TABLE(1,X4)) 40,46,60
46   IF (TABLE(3,X3)-TABLE(3,X4)) 60,60,40
40   DO 50 I=1,14
     X5=TABLE(I,X3)
     TABLE(I,X3)=TABLE(I,X4)
     TABLE(I,X4)=X5
50   CONTINUE
     X3=X3-X0
     IF (X3-1) 60,30,30
60   X2=X1
     IF (X2-X1) 20,20,10
70   RETURN

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Returning Values (shell Script)

I have an application on Informix 4GL, and I am invoking the shell script from the program, but I need to know if the shell script work fine or not, in order to continue the process. I know that we can use $? to get the final status but this is on unix command. How can I return a value from the... (3 Replies)
Discussion started by: jennifer01
3 Replies

2. Shell Programming and Scripting

Returning values from child to parent shell

I need to send the status from child shell failure to parent shell. I would like to know how could we accomplish this. My parent.sh is as below: #!/bin/ksh set -x echo "I am in parent shell now..." child.sh ret_stat=$? echo "rest_stat=$ret_stat" echo "I am below parent shell end..." ... (4 Replies)
Discussion started by: acheepi
4 Replies

3. Solaris

awk/nawk returning decimal values?

Hi Running a specific nawk statement over a 17m lines files returns the following: /bin/nawk: not enough args in ..... input record number 1,25955e+06, file test.1 source line number 1 I'd like to report the line number (in bold above) in decimal not floating so that i can spot it out. ... (1 Reply)
Discussion started by: moutaye
1 Replies

4. Programming

random array index returning values not contained

For kicks I wrote up a Password generator after lunch. Let me start with the code: unsigned int x,y,z,c; unsigned int KISS(); unsigned int devrand(); int main( int argc, char** argv ) { int i, j = 1; char pwd = "abcdefghijklmnopqrstuvwxyz" ... (5 Replies)
Discussion started by: VRoemer
5 Replies

5. Programming

returning multiple values from a function in C

hi how can I return multiple values from a C function. I tried the following: #include <stdio.h> void foo(int id, char *first_name, char *last_name) { /* this is just an example to illustrate my problem... real code makes use of the "id" parameter. */ first_name = (char... (8 Replies)
Discussion started by: Andrewkl
8 Replies

6. Programming

FORTRAN: Getting Consecutive DIST Values

I have this code and I want to get the first two consecutive distances (obtained by calling GET_TH(IT, 'DIST', DIST) at index IT, the result stored in DIST) for which (ITFLG(IT) .NE. 1). L_FIRST get the first DIST for which ITFLG(IT) .NE. 1. Getting a bit confused on how to achieve this. ... (0 Replies)
Discussion started by: kristinu
0 Replies

7. Shell Programming and Scripting

Finding index values

I have an array XOFFS of size N. I have VDISTMIN and VDISTMAX. I want to find the beginning and and index in XOFFS such that values are within Example Let XOFFS = (10 20 30 40 50) If VDISTMIN = -20 and VDISTMAX = 20 Then ISTR = 1 and IEND = 2 as XOFFS through XOFFS fall within the... (2 Replies)
Discussion started by: kristinu
2 Replies

8. UNIX for Dummies Questions & Answers

For loop returning more values

Hi All, Thanks all of you for the help you provide to me. Well, I have one more problem, where I am trying to pull file system information in the loop and display the filesystem percentege. I am using following code to achive this, nut it's giving the weired output. My file system is ... (1 Reply)
Discussion started by: alok.behria
1 Replies

9. Shell Programming and Scripting

Output breaking when returning multiple values

I've been trying to write a command-line function to grab a website's MX records and their ip addresses. The code below works with domains that only have one MX record: function kmx { mx=`host -t MX $1 | awk '{ print $7 }'`; ip=`host $mx | sed '/IPv6/d;/handled/d' | awk '{ print $4 }'`; ... (8 Replies)
Discussion started by: Azrael
8 Replies

10. Shell Programming and Scripting

Returning multiple values in Shell

Hi I have a code as the following #!/usr/bin/ksh set -x row() { a=$1 b=$2 c=$(($a + $b)) d=$(($a * $b)) echo $a $b } e=`row 2 3` set $e echo "The value of c is $c" echo "The value of d is $d" My requirement is I need to pass two arguments to a function and return two values... (5 Replies)
Discussion started by: Priya Amaresh
5 Replies
GLDRAWRANGEELEMENTSB(3G)					    OpenGL 3.3						  GLDRAWRANGEELEMENTSB(3G)

NAME
glDrawRangeElementsBaseVertex - render primitives from array data with a per-element offset C SPECIFICATION
void glDrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLvoid *indices, GLint basevertex); PARAMETERS
mode Specifies what kind of primitives to render. Symbolic constants GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, and GL_TRIANGLES are accepted. start Specifies the minimum array index contained in indices. end Specifies the maximum array index contained in indices. count Specifies the number of elements to be rendered. type Specifies the type of the values in indices. Must be one of GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT, or GL_UNSIGNED_INT. indices Specifies a pointer to the location where the indices are stored. basevertex Specifies a constant that should be added to each element of indices when chosing elements from the enabled vertex arrays. DESCRIPTION
glDrawRangeElementsBaseVertex is a restricted form of glDrawElementsBaseVertex(). mode, start, end, count and basevertex match the corresponding arguments to glDrawElementsBaseVertex(), with the additional constraint that all values in the array indices must lie between start and end, inclusive, prior to adding basevertex. Index values lying outside the range [start, end] are treated in the same way as glDrawElementsBaseVertex(). The ith element transferred by the corresponding draw call will be taken from element indices[i] + basevertex of each enabled array. If the resulting value is larger than the maximum value representable by type, it is as if the calculation were upconverted to 32-bit unsigned integers (with wrapping on overflow conditions). The operation is undefined if the sum would be negative. NOTES
glDrawRangeElementsBaseVertex is only supported if the GL version is 3.2 or greater, or if the ARB_draw_elements_base_vertex extension is supported. .SH "ERRORS" GL_INVALID_ENUM is generated if mode is not an accepted value. GL_INVALID_VALUE is generated if count is negative. GL_INVALID_VALUE is generated if end < start. GL_INVALID_OPERATION is generated if a geometry shader is active and mode is incompatible with the input primitive type of the geometry shader in the currently installed program object. GL_INVALID_OPERATION is generated if a non-zero buffer object name is bound to an enabled array or the element array and the buffer object's data store is currently mapped. SEE ALSO
glDrawElements(), glDrawElementsBaseVertex(), glDrawRangeElements(), glDrawElementsInstanced(), glDrawElementsInstancedBaseVertex() COPYRIGHT
Copyright (C) 2010 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/. OpenGL 3.3 03/08/2011 GLDRAWRANGEELEMENTSB(3G)
All times are GMT -4. The time now is 07:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy