IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 36399


Ignore:
Timestamp:
Dec 17, 2013, 10:28:08 AM (13 years ago)
Author:
eugene
Message:

add cast function and floor, ceil, rint opihi math functions

Location:
branches/eam_branches/ipp-20131211/Ohana/src/opihi
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20131211/Ohana/src/opihi/cmd.data/Makefile

    r36375 r36399  
    2525$(SRC)/book.$(ARCH).o           \
    2626$(SRC)/book_commands.$(ARCH).o  \
     27$(SRC)/cast.$(ARCH).o           \
    2728$(SRC)/center.$(ARCH).o \
    2829$(SRC)/clear.$(ARCH).o          \
  • branches/eam_branches/ipp-20131211/Ohana/src/opihi/cmd.data/init.c

    r36375 r36399  
    1010int center           PROTO((int, char **));
    1111int parity           PROTO((int, char **));
     12int cast             PROTO((int, char **));
    1213int circstats        PROTO((int, char **));
    1314int clear            PROTO((int, char **));
     
    164165  {1, "buffers",      list_buffers,     "list the currently allocated buffers (images)"},
    165166  {1, "center",       center,           "center image on coords"},
     167  {1, "cast",         cast,             "cast input vector to specified type"},
    166168  {1, "circstats",    circstats,        "circular statistics"},
    167169  {1, "clear",        clear,            "erase plot"},
  • branches/eam_branches/ipp-20131211/Ohana/src/opihi/lib.shell/convert_to_RPN.c

    r36375 r36399  
    3030    if (!strcmp (argv[i], "abs"))    { type = ST_UNARY; goto gotit; }
    3131    if (!strcmp (argv[i], "int"))    { type = ST_UNARY; goto gotit; }
     32    if (!strcmp (argv[i], "floor"))  { type = ST_UNARY; goto gotit; }
     33    if (!strcmp (argv[i], "round"))  { type = ST_UNARY; goto gotit; }
     34    if (!strcmp (argv[i], "ceil"))   { type = ST_UNARY; goto gotit; }
     35    if (!strcmp (argv[i], "rint"))   { type = ST_UNARY; goto gotit; }
    3236    if (!strcmp (argv[i], "exp"))    { type = ST_UNARY; goto gotit; }
    3337    if (!strcmp (argv[i], "ten"))    { type = ST_UNARY; goto gotit; }
  • branches/eam_branches/ipp-20131211/Ohana/src/opihi/lib.shell/stack_math.c

    r36375 r36399  
    11231123  if (!strcmp (op, "abs"))    S_FUNC(fabs(M1), ST_SCALAR_INT);
    11241124  if (!strcmp (op, "int"))    S_FUNC((long long)(M1), ST_SCALAR_INT);
     1125  if (!strcmp (op, "floor"))  S_FUNC(floor (M1), ST_SCALAR_FLT);
     1126  if (!strcmp (op, "ceil"))   S_FUNC(ceil (M1), ST_SCALAR_FLT);
     1127  if (!strcmp (op, "rint"))   S_FUNC(nearbyint (M1), ST_SCALAR_FLT);
    11251128  if (!strcmp (op, "exp"))    S_FUNC(exp (M1), ST_SCALAR_FLT);
    11261129  if (!strcmp (op, "ten"))    S_FUNC(pow (10.0,M1), ST_SCALAR_FLT);
     
    12021205  if (!strcmp (op, "abs"))    V_FUNC(fabs(*M1), ST_SCALAR_INT);
    12031206  if (!strcmp (op, "int"))    V_FUNC((long long)(*M1), ST_SCALAR_INT);
     1207  if (!strcmp (op, "floor"))  V_FUNC(floor (*M1), ST_SCALAR_FLT);
     1208  if (!strcmp (op, "ceil"))   V_FUNC(ceil (*M1), ST_SCALAR_FLT);
     1209  if (!strcmp (op, "rint"))   V_FUNC(nearbyint (*M1), ST_SCALAR_FLT);
    12041210  if (!strcmp (op, "exp"))    V_FUNC(exp(*M1), ST_SCALAR_FLT);
    12051211  if (!strcmp (op, "ten"))    V_FUNC(pow(10.0,*M1), ST_SCALAR_FLT);
     
    12731279  if (!strcmp (op, "abs"))   { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = fabs(*M1);         }}
    12741280  if (!strcmp (op, "int"))   { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = (opihi_flt)(long long)(*M1); }}
     1281
     1282  if (!strcmp (op, "floor")) { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = floor (*M1); }}
     1283  if (!strcmp (op, "ceil"))  { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = ceil (*M1); }}
     1284  if (!strcmp (op, "rint"))  { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = nearbyint (*M1); }}
     1285
    12751286  if (!strcmp (op, "exp"))   { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = exp(*M1);          }}
    12761287  if (!strcmp (op, "ten"))   { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = pow(10.0,*M1);     }}
Note: See TracChangeset for help on using the changeset viewer.