10 |
|
* |
11 |
|
*/ |
12 |
|
|
13 |
+ |
#define _USE_MATH_DEFINES |
14 |
|
#include "rtio.h" |
15 |
|
#include <stdlib.h> |
16 |
|
#include <math.h> |
608 |
|
{ |
609 |
|
const SDTre *sdt; |
610 |
|
double inCoord[2]; |
610 |
– |
int vflags; |
611 |
|
int i; |
612 |
|
SDTreCDst *cd, *cdlast; |
613 |
|
/* check arguments */ |
622 |
|
return NULL; /* should be internal error */ |
623 |
|
cdlast = NULL; /* check for direction in cache list */ |
624 |
|
for (cd = (SDTreCDst *)sdc->cdList; cd != NULL; |
625 |
< |
cdlast = cd, cd = (SDTreCDst *)cd->next) { |
625 |
> |
cdlast = cd, cd = cd->next) { |
626 |
|
for (i = sdt->st->ndim - 2; i--; ) |
627 |
|
if ((cd->clim[i][0] > inCoord[i]) | |
628 |
|
(inCoord[i] >= cd->clim[i][1])) |
634 |
|
cdlast = cd = make_cdist(sdt, inCoord); |
635 |
|
if (cdlast != NULL) { /* move entry to head of cache list */ |
636 |
|
cdlast->next = cd->next; |
637 |
< |
cd->next = sdc->cdList; |
637 |
> |
cd->next = (SDTreCDst *)sdc->cdList; |
638 |
|
sdc->cdList = (SDCDst *)cd; |
639 |
|
} |
640 |
|
return (SDCDst *)cd; /* ready to go */ |
710 |
|
/* binary search to find position */ |
711 |
|
ilower = 0; iupper = cd->calen; |
712 |
|
while ((i = (iupper + ilower) >> 1) != ilower) |
713 |
< |
if ((long)target >= (long)cd->carr[i].cuml) |
713 |
> |
if (target >= cd->carr[i].cuml) |
714 |
|
ilower = i; |
715 |
|
else |
716 |
|
iupper = i; |
880 |
|
SDSpectralDF *df; |
881 |
|
SDTre *sdt; |
882 |
|
char *sdata; |
883 |
– |
int i; |
883 |
|
/* allocate BSDF component */ |
884 |
|
sdata = ezxml_txt(ezxml_child(wdb, "WavelengthDataDirection")); |
885 |
|
if (!sdata) |