/[escript]/branches/arrayview_from_1695_trunk/finley/src/NodeMapping.c
ViewVC logotype

Diff of /branches/arrayview_from_1695_trunk/finley/src/NodeMapping.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1780 by jfenwick, Mon Aug 11 03:33:40 2008 UTC revision 1781 by jfenwick, Thu Sep 11 05:03:14 2008 UTC
# Line 19  Line 19 
19  Finley_NodeMapping* Finley_NodeMapping_alloc(dim_t numNodes, index_t* target, index_t unused)  Finley_NodeMapping* Finley_NodeMapping_alloc(dim_t numNodes, index_t* target, index_t unused)
20  {  {
21    dim_t i;    dim_t i;
22    index_t min_target, numTargets;    index_t min_target, numTargets, max_target;
23    Finley_NodeMapping* out=NULL;    Finley_NodeMapping* out=NULL;
24    /*  allocate the return value */    /*  allocate the return value */
25    min_target=Finley_Util_getFlaggedMinInt(1,numNodes,target,unused);    min_target=Finley_Util_getFlaggedMinInt(1,numNodes,target,unused);
   numTargets=Finley_Util_getFlaggedMaxInt(1,numNodes,target,unused)+1;  
26    if (min_target<0) {    if (min_target<0) {
27       Finley_setError(VALUE_ERROR,"Finley_NodeMapping_alloc: target has negative entry.");       Finley_setError(VALUE_ERROR,"Finley_NodeMapping_alloc: target has negative entry.");
28       return NULL;       return NULL;
29    }    }
30      /* now we assume min_target=0! */
31      max_target=Finley_Util_getFlaggedMaxInt(1,numNodes,target,unused);
32      numTargets= min_target<max_target ? max_target+1 :0;
33    out=MEMALLOC(1,Finley_NodeMapping);    out=MEMALLOC(1,Finley_NodeMapping);
34    if (!Finley_checkPtr(out)) {    if (!Finley_checkPtr(out)) {
35       out->reference_counter=1;       out->reference_counter=1;

Legend:
Removed from v.1780  
changed lines
  Added in v.1781

  ViewVC Help
Powered by ViewVC 1.1.26