B u `± ã@sBddlmZddlmZd dd„Zdd„Zd dd „Zdd d „ZdS)é)ÚVar)ÚUnindexedComponent_setNcCs6|dkr| ¡r| ¡}nt}t|ƒ}| ||¡|S)N)Ú is_indexedÚ index_setrrZ add_component)ÚcompÚnameÚblockrÚnew_var©r ú6/tmp/pip-unpacked-wheel-n62dbgi3/pyomo/network/util.pyÚ create_vars  r cCs„|j}|j}| ¡s|j|_|jdk rN|dkr<| |j¡n| t||jƒ¡|jdk r€|dkrn| |j¡n| t||jƒ¡dS)N)ZlbZubZ is_continuousÚdomainZsetlbÚmaxZsetubÚmin)ÚsrcÚdestZ starting_lbZ starting_ubr r r Ú_tightens  rc CsŒ|dkr| ¡r| ¡}nt}| ¡rdx`|D]2}yt||||ƒWq,tk r\PYq,Xq,Wn$yt||ƒWntk r†YnX|S)N)rrrrÚAttributeError)rr rÚir r r Útighten_var_domain)s  rcCst||||ƒ}t|||ƒ|S)a Create a new variable that will have the same indexing set, domain, and bounds as the provided component, and add it to the given block. Optionally pass an index set to use that to build the variable, but this set must be symmetric to comp's index set. )r r)rrrrr r r r Ú replicate_var@s r)N)N)N)Z pyomo.corerZ!pyomo.core.base.indexed_componentrr rrrr r r r Ú s