/[ascend]/trunk/base/generic/solver/rel.c
ViewVC logotype

Diff of /trunk/base/generic/solver/rel.c

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

revision 751 by johnpye, Thu Jul 6 08:54:42 2006 UTC revision 752 by johnpye, Wed Jul 12 02:50:54 2006 UTC
# Line 596  struct ExtRelCache *CreateExtRelCache(st Line 596  struct ExtRelCache *CreateExtRelCache(st
596    cache->inputlist = LinearizeArgList(cache->arglist,1,n_input_args);    cache->inputlist = LinearizeArgList(cache->arglist,1,n_input_args);
597            /* Note: we own the cache of the LinearizeArgList call. */            /* Note: we own the cache of the LinearizeArgList call. */
598    
599      ninputs = (int32)gl_length(cache->inputlist);
600      noutputs = (int32)CountNumberOfArgs(cache->arglist,n_input_args+1,
601                        n_input_args+n_output_args);
602      cache->ninputs = ninputs;
603      cache->noutputs = noutputs;
604    
605    /*    /*
606      Create the 'invars' and 'outvars' lists so that we can insert stuff      Create the 'invars' and 'outvars' lists so that we can insert stuff
607      into the solverside matrix correctly      into the solverside matrix correctly
# Line 604  struct ExtRelCache *CreateExtRelCache(st Line 610  struct ExtRelCache *CreateExtRelCache(st
610    cache->invars = NULL;    cache->invars = NULL;
611    cache->outvars = ASC_NEW_ARRAY_CLEAR(struct var_variable *,noutputs);    cache->outvars = ASC_NEW_ARRAY_CLEAR(struct var_variable *,noutputs);
612    
613    ninputs = (int32)gl_length(cache->inputlist);    REL_DEBUG("ALLOCATED FOR %d OUTPUTS",noutputs);
   noutputs = (int32)CountNumberOfArgs(cache->arglist,n_input_args+1,  
                     n_input_args+n_output_args);  
   cache->ninputs = ninputs;  
   cache->noutputs = noutputs;  
   
614    cache->inputs = ASC_NEW_ARRAY_CLEAR(double,ninputs);    cache->inputs = ASC_NEW_ARRAY_CLEAR(double,ninputs);
615    cache->outputs = ASC_NEW_ARRAY_CLEAR(double,noutputs);    cache->outputs = ASC_NEW_ARRAY_CLEAR(double,noutputs);
616    cache->jacobian = ASC_NEW_ARRAY_CLEAR(double,ninputs*noutputs);    cache->jacobian = ASC_NEW_ARRAY_CLEAR(double,ninputs*noutputs);
# Line 654  void extrel_store_output_var(struct rel_ Line 655  void extrel_store_output_var(struct rel_
655      whichvar = rel_extwhichvar(rel);      whichvar = rel_extwhichvar(rel);
656    
657      REL_DEBUG("outvar[%d] at %p",whichvar-cache->ninputs-1,var);      REL_DEBUG("outvar[%d] at %p",whichvar-cache->ninputs-1,var);
658        asc_assert(cache->outvars!=NULL);
659      cache->outvars[whichvar - cache->ninputs - 1] = var;      cache->outvars[whichvar - cache->ninputs - 1] = var;
660  }  }
661    
# Line 661  static struct var_variable *extrel_outva Line 663  static struct var_variable *extrel_outva
663          struct ExtRelCache *cache          struct ExtRelCache *cache
664          ,int whichvar          ,int whichvar
665  ){  ){
666        asc_assert(cache->outvars!=NULL);
667      return cache->outvars[whichvar-cache->ninputs-1];      return cache->outvars[whichvar-cache->ninputs-1];
668  }  }
669    

Legend:
Removed from v.751  
changed lines
  Added in v.752

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22