genmax2.c File Reference

#include "machine.h"
#include "genmax2.h"

Include dependency graph for genmax2.c:

Go to the source code of this file.

Defines

#define MAX2(Xtype, Ytype)

Typedefs

typedef signed char integer1
typedef short integer2

Functions

void C2F() genmax2 (integer *n, void *dx, integer *incx, integer *xtyp, void *dy, integer *ytyp, integer *ind, integer *no)


Define Documentation

#define MAX2 ( Xtype,
Ytype   ) 

Value:

{\
Xtype *DX;\
Ytype *DY;\
    DY=(Ytype *)dy;\
    --DY;\
    DX=(Xtype *)dx;\
    --DX;\
    ix = 1;\
    for (i = 1; i <= *n; ++i) {\
      if ((Ytype)DX[ix] > DY[i]) {\
        DY[i] = (Ytype)DX[ix];\
        ind[i-1] = *no;}\
        ix = ix + *incx;\
    }\
}

Definition at line 7 of file genmax2.c.

Referenced by genmax2().


Typedef Documentation

typedef signed char integer1

Definition at line 3 of file genmax2.c.

typedef short integer2

Definition at line 4 of file genmax2.c.


Function Documentation

void C2F() genmax2 ( integer n,
void *  dx,
integer incx,
integer xtyp,
void *  dy,
integer ytyp,
integer ind,
integer no 
)

Definition at line 23 of file genmax2.c.

References i, ix, and MAX2.

00024 {
00025 
00026   static integer i,ix;
00027   /*  printf("%d %d\n",*xtyp,*ytyp);*/
00028 
00029   switch (*xtyp) {
00030   case 0:
00031     switch (*ytyp) {
00032     case 0:
00033       MAX2(double,double);
00034       break;
00035     case 4:
00036       MAX2(double,integer);
00037       break;
00038     case 2:
00039       MAX2(double,integer2);
00040       break;
00041     case 1:
00042       MAX2(double,integer1);
00043       break;
00044     case 14:
00045       MAX2(double,unsigned int);
00046       break;
00047     case 12:
00048       MAX2(double,unsigned short);
00049       break;
00050     case 11:
00051       MAX2(double,unsigned char);
00052       break;
00053     }
00054     break;
00055   case 1:
00056     switch (*ytyp) {
00057     case 0:
00058       MAX2(integer1,double);
00059       break;
00060     case 4:
00061       MAX2(integer1,integer);
00062       break;
00063     case 2:
00064       MAX2(integer1,integer2);
00065       break;
00066     case 1:
00067       MAX2(integer1,integer1);
00068       break;
00069     case 14:
00070       MAX2(integer1,unsigned int);
00071       break;
00072     case 12:
00073       MAX2(integer1,unsigned short);
00074       break;
00075     case 11:
00076       MAX2(integer1,unsigned char);
00077       break;
00078     }
00079     break;
00080   case 2:
00081     switch (*ytyp) {
00082     case 0:
00083       MAX2(integer2,double);
00084       break;
00085     case 4:
00086       MAX2(integer2,integer);
00087       break;
00088     case 2:
00089       MAX2(integer2,integer2);
00090       break;
00091     case 1:
00092       MAX2(integer2,integer1);
00093       break;
00094     case 14:
00095       MAX2(integer2,unsigned int);
00096       break;
00097     case 12:
00098       MAX2(integer2,unsigned short);
00099       break;
00100     case 11:
00101       MAX2(integer2,unsigned char);
00102       break;
00103     }
00104     break;
00105   case 4:
00106     switch (*ytyp) {
00107     case 0:
00108       MAX2(integer,double);
00109       break;
00110     case 2:
00111       MAX2(integer,integer2);
00112       break;
00113     case 4:
00114       MAX2(integer,integer);
00115       break;
00116     case 11:
00117       MAX2(integer,unsigned char);
00118       break;
00119     case 12:
00120       MAX2(integer,unsigned short);
00121       break;
00122     case 14:
00123       MAX2(integer,unsigned int);
00124       break;
00125     }
00126     break;
00127   case 11:
00128     switch (*ytyp) {
00129     case 0:
00130       MAX2(unsigned char,double);
00131       break;
00132     case 4:
00133       MAX2(unsigned char,integer);
00134       break;
00135     case 2:
00136       MAX2(unsigned char,integer2);
00137       break;
00138     case 1:
00139       MAX2(unsigned char,integer1);
00140       break;
00141     case 14:
00142       MAX2(unsigned char,unsigned int);
00143       break;
00144     case 12:
00145       MAX2(unsigned char,unsigned short);
00146       break;
00147     case 11:
00148       MAX2(unsigned char,unsigned char);
00149       break;
00150     }
00151     break;
00152   case 12:
00153     switch (*ytyp) {
00154     case 0:
00155       MAX2(unsigned short,double);
00156       break;
00157     case 4:
00158       MAX2(unsigned short,integer);
00159       break;
00160     case 2:
00161       MAX2(unsigned short,integer2);
00162       break;
00163     case 1:
00164       MAX2(unsigned short,integer1);
00165       break;
00166     case 14:
00167       MAX2(unsigned short,unsigned int);
00168       break;
00169     case 12:
00170       MAX2(unsigned short,unsigned short);
00171       break;
00172     case 11:
00173       MAX2(unsigned short,unsigned char);
00174       break;
00175     }
00176     break;
00177   case 14:
00178     switch (*ytyp) {
00179     case 0:
00180       MAX2(integer,double);
00181       break;
00182     case 4:
00183       MAX2(integer,integer);
00184       break;
00185     case 2:
00186       MAX2(integer,integer2);
00187       break;
00188     case 1:
00189       MAX2(integer,integer1);
00190       break;
00191     case 14:
00192       MAX2(integer,unsigned int);
00193       break;
00194     case 12:
00195       MAX2(integer,unsigned short);
00196       break;
00197     case 11:
00198       MAX2(integer,unsigned char);
00199       break;
00200     }
00201     break;
00202   }
00203 }


Generated on Sun Mar 4 16:07:56 2007 for Scilab [trunk] by  doxygen 1.5.1