Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pgacreate(8) [debian man page]

PGACreate(8)							      PGAPack							      PGACreate(8)

NAME
PGACreate - creates an uninitialized context variable. The Fortran version of this function call contains only the last three arguments INPUT PARAMETERS
argc - address of the count of the number of command line arguments. argv - array of command line arguments. datatype - the data type used for the strings. Must be one of PGA_DATATYPE_BINARY, PGA_DATATYPE_CHARACTER, PGA_DATATYPE_INTEGER, PGA_DATATYPE_REAL, or PGA_DATATYPE_USER binary -valued, character-valued, integer-valued, real -valued, or a user-defined datatype, respectively. len - the string length (number of genes). maxormin - the direction of optimization. Must be one of PGA_MAXIMIZE or PGA_MINIMIZE for maximization or minimization, respectively. OUTPUT PARAMETERS
none SYNOPSIS
#include "pgapack.h" PGAContext * PGACreate(argc, argv, datatype, len, maxormin) int *argc char **argv int datatype int len int maxormin LOCATION
create.c EXAMPLE
Example: In C: void main(int argc, char **argv) { PGAContext *ctx; : ctx = PGACreate(&argc, argv, PGA_DATATYPE_BINARY, 100, PGA_MAXIMIZE); : // Set options here : PGASetUp(ctx); : // Run the GA here : PGADestroy(ctx); } In FORTRAN: integer ctx : ctx = PGACreate(PGA_DATATYPE_BINARY, 100, PGA_MAXIMIZE) : c Set options here : call PGASetUp(ctx) : c Run the GA here : call PGADestroy(ctx) stop end 05/01/95 PGACreate(8)

Check Out this Related Man Page

PGASetRealInitRange(2)						      PGAPack						    PGASetRealInitRange(2)

NAME
PGASetRealInitRange - sets the upper and lower bounds for randomly initializing real-valued genes. DESCRIPTION
For each gene these bounds define an interval from which the initial allele value is selected uniformly randomly. The user specifies two arrays containing lower and bound for each gene to define the interval. This is the default strategy for initializing real-valued strings. The default interval is $[0,1.0]$ for each gene. INPUT PARAMETERS
ctx - context variable min - array containing the lower bound of the interval for each gene mac - array containing the upper bound of the interval for each gene OUTPUT PARAMETERS
none SYNOPSIS
#include "pgapack.h" void PGASetRealInitRange(ctx, min, max) PGAContext *ctx double *min double *max LOCATION
real.c EXAMPLE
Set the initialization routines to select a value for each real-valued gene i uniformly randomly from the interval [-10.,i] Assumes all strings are of the same length. PGAContext *ctx; double *low, *high; int i, stringlen; : stringlen = PGAGetStringLength(ctx); low = (double *) malloc(stringlen*sizeof(double)); high = (double *) malloc(stringlen*sizeof(double)); for(i=0;i<stringlen;i++) { low[i] = -10.0; high[i] = i; } PGASetRealInitRange(ctx, low, high); 05/01/95 PGASetRealInitRange(2)
Man Page

15 More Discussions You Might Find Interesting

1. Programming

echo help

i found this code in the book but was unable to execute it. /*myecho -- echo command line arguments */ main(int argc, char **argv) { while(--argc > 0) printf("%s ", *++argv); printf("\n"); } this is another program that would invoke the one above char * const argin =... (5 Replies)
Discussion started by: bb00y
5 Replies

2. Programming

moving directory

what is the system call for moving directory? i tried main(int argc, char * argv){ if(link(argv, destinationDir)==-1){ perror("link failed"); //argv is the name of the directory i want to move input from command promt. it displayed the link failed message. thanks (1 Reply)
Discussion started by: bb00y
1 Replies

3. Programming

Using argv argc

I searched on the forums. No advises. I am using a previous source code. I changed the main function main(int argc, char **argv) in a function misc(int argc, char **argv). How do you use the argc and argv parameters? This is how I am calling the function : char param; strcat(param,"wgrib ");... (4 Replies)
Discussion started by: Akeson Chihiro
4 Replies

4. Programming

command line arguments

Hi How to pass multi line text as a command line argument to a program. (i.e) ./a.out hi this is sample 0 file1 where hi this is sample should be stored in argv 0 in argv and so on... (3 Replies)
Discussion started by: bankpro
3 Replies

5. Programming

The Ampersand

In my program, I'm using argc and argv to accept command line arguments. However, if I have to get the '&' to work i.e. make it run the child as a background process, do I have to write some special code in C or does Unix handle it automatically? If I have to add the special code, how does it look... (2 Replies)
Discussion started by: Legend986
2 Replies

6. Programming

help wid C-script in tcsh

Hello Freinds I have just started off with Unix (TCSH) although I have a pretty sound background with C-programming. Kindly convey any error in foll script. #include<stdio.h> #include<math.h> #define PI 3.142857 main () { float r, A; printf("Enter the value of radius: "); scanf(" %f... (12 Replies)
Discussion started by: mahendrakamath
12 Replies

7. Programming

help for argv argc

Hi C experts, I have the following code for adding command line option for a program int main (argc, argv) int argc; char *argv; { char *mem_type; //memory type char *name; //name of the memory int addr; //address bits int data; ... (5 Replies)
Discussion started by: return_user
5 Replies

8. Programming

ambiguity in program output

1 #include <fcntl.h> 2 3 main(int argc, char *argv) 4 { 5 char buf; 6 int fd, count = 0; 7 8 if (argc > 1) 9 fd = open(argv, O_RDONLY); 10 else 11 fd = 0; /* Use standard input */ 12 13 while (read(fd, buf, 1) > 0) { 14 if (count < 5) write(1, buf, 1); 15 ... (3 Replies)
Discussion started by: bishweshwar
3 Replies

9. Programming

Strange behavior in C++

I have the following program: int main(int argc, char** argv){ unsigned long int mean=0; for(int i=1;i<10;i++){ mean+=poisson(12); cout<<mean<<endl; } cout<<"Sum of poisson: "<< mean; return 0; } when I run it, I get the... (4 Replies)
Discussion started by: santiagorf
4 Replies

10. UNIX for Dummies Questions & Answers

Processes in Unix

I am trying to play and create processes and found this piece of code.... int myMain(int argc , char* argv){ childID = 0; for (j=1;j<3;j++) if (childID = fork()) break; fprintf(stderr, " process ID:%d parent ID:%d child ID:%d\n", getpid(), getppid(), childID); return... (3 Replies)
Discussion started by: joker40
3 Replies

11. Programming

How to get the size of the datatype passed as the command line argumet?

#include <stdio.h> int main(int argc, char *argv) { printf("%d\n", sizeof(argv)); return 0; } when I run the executable a.out after compiling the above program as: a.out short (or) a.out "long double", I expected to get the output as 2 and 12, but I am always getting the size of... (2 Replies)
Discussion started by: royalibrahim
2 Replies

12. Shell Programming and Scripting

Help with separating datatype, column name

Hi All, I am new to unix but have a requirement wherein I need to separate datatype,length, and column name from input file which is of below format -- record integer(10) empid; string(25) name; date("YYYY-MM-DD") dob; decimal(10) salary; end now after getting datatype,its length and... (4 Replies)
Discussion started by: phoenix09
4 Replies

13. UNIX for Advanced & Expert Users

O argv, argv, wherefore art thou argv?

All of my machines (various open source derivatives on x86 and amd64) store argv above the stack (at a higher memory address). I am curious to learn if any systems store argv below the stack (at a lower memory address). I am particularly interested in proprietary Unices, such as Solaris, HP-UX,... (9 Replies)
Discussion started by: alister
9 Replies

14. Homework & Coursework Questions

Help using argc/argv in assignment

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: First, create a "hello world" program that prints "Hello World". But NOW, instead use argc to verify that a... (9 Replies)
Discussion started by: miniviking10
9 Replies

15. Programming

Segmentation Fault ERROR in C

Hello guys, i have this code: int main(int argc, char *argv) { int i, j, N, result = 0, **vec; if (argc < 2) { fprintf(stderr, "Usage: %s N\n", argv); } /* ... how many numbers to read */ N = atoi(argv); /* check if N is a power of two; exit if not */ if (!... (3 Replies)
Discussion started by: DinisR
3 Replies