Creates a linear solver.

    Parameters
    ----------
    name : string
    prop : string
    
    Returns
    -------
    solver : :class:`LinSolver <optalg.lin_solver.LinSolver>`
436193
def new_linsolver(name,prop):
    
    
    if name == 'mumps':
        return LinSolverMUMPS(prop)
    elif name == 'superlu':
        return LinSolverSUPERLU(prop)
    elif name == 'umfpack':
        return LinSolverUMFPACK(prop)
    elif name == 'default':
        try:
            return new_linsolver('mumps',prop)
        except ImportError:
            return new_linsolver('superlu',prop)            
    else:
        raise ValueError('invalid linear solver name')
558490
def _set_bool_prop(self, name, value):
        
        rPr = self._element.get_or_add_rPr()
        rPr._set_bool_val(name, value)
158438
def _get_solver(self, **kwargs):
        """"""
        solver_args = dict(kwargs)
        solver_args.update(self._solver_args)
        return generic.Solver(**solver_args)
1372024
function(name) {
      if (name) {
        var i = 0;
        var comps = this.jCal[COMPONENT_INDEX];
        var len = comps.length;

        for (; i < len; i++) {
          if (comps[i][NAME_INDEX] === name) {
            var result = this._hydrateComponent(i);
            return result;
          }
        }
      } else {
        if (this.jCal[COMPONENT_INDEX].length) {
          return this._hydrateComponent(0);
        }
      }

      // ensure we return a value (strict mode)
      return null;
    }
342167
def _prop_name(self):
        
        if ':' in self._nsptagname:
            start = self._nsptagname.index(':') + 1
        else:
            start = 0
        return self._nsptagname[start:]
704294
public static void loadProp(Props props, Configuration conf, String name) {
    String prop = props.get(name);
    if (prop != null) {
      conf.set(name, prop);
    }
  }
507029
function(name, data) {
      return {
        name: null,
        task: null,
        weight: 0,
        inquire: null,
        conf: {
          type: 'pluginconfig',
          key: data.option.name || null,
          plugin: name
        }
      };
    }
1091323
def clone(self, name=None):
    
    if name is None:
      name = self.module_name + "_clone"
    return Linear(output_size=self.output_size,
                  use_bias=self._use_bias,
                  initializers=self._initializers,
                  partitioners=self._partitioners,
                  regularizers=self._regularizers,
                  name=name)
78918
def build(self, name):
        ""
        if isinstance(name, basestring):
            type = self.resolver.find(name)
            if type is None:
                raise TypeNotFound(name)
        else:
            type = name
        cls = type.name
        if type.mixed():
            data = Factory.property(cls)
        else:
            data = Factory.object(cls)
        resolved = type.resolve()
        md = data.__metadata__
        md.sxtype = resolved
        md.ordering = self.ordering(resolved)
        history = []
        self.add_attributes(data, resolved)
        for child, ancestry in type.children():
            if self.skip_child(child, ancestry):
                continue
            self.process(data, child, history[:])
        return data
374302
def solve(self, lam):
        ''''''
        if self.penalty == 'dp':
            return self.solve_dp(lam)
        if self.penalty == 'gfl':
            return self.solve_gfl(lam)
        if self.penalty == 'gamlasso':
            return self.solve_gfl(lam)
        raise Exception('Unknown penalty type: {0}'.format(self.penalty))
828088
def get_property_as_float(self, name: str) -> float:
        
        return float(self.__instrument.get_property(name))
461843
def linear_constraints(self):
        
        if self.lin_N == 0:
            return None, array([]), array([])

        A = lil_matrix((self.lin_N, self.var_N), dtype=float64)
        l = -Inf * ones(self.lin_N)
        u = -l

        for lin in self.lin_constraints:
            if lin.N:                   # non-zero number of rows to add
                Ak = lin.A              # A for kth linear constrain set
                i1 = lin.i1             # starting row index
                iN = lin.iN             # ending row index
                vsl = lin.vs            # var set list
                kN = -1                 # initialize last col of Ak used
                Ai = lil_matrix((lin.N, self.var_N), dtype=float64)
                for v in vsl:
                    var = self.get_var(v)
                    j1 = var.i1         # starting column in A
                    jN = var.iN         # ending column in A
                    k1 = kN + 1         # starting column in Ak
                    kN = kN + var.N     # ending column in Ak

                    if j1 == jN:
                        # FIXME: Single column slicing broken in lil.
                        for i in range(Ai.shape[0]):
                            Ai[i, j1] = Ak[i, k1]
                    else:
                        Ai[:, j1:jN + 1] = Ak[:, k1:kN + 1]

                A[i1:iN + 1, :] = Ai
                l[i1:iN + 1] = lin.l
                u[i1:iN + 1] = lin.u

        return A.tocsr(), l, u
324693
def initial_solve_constraints
      @identifier.initial_dependencies.flat_map do |dependency|
        dependency.constraints.map do |constraint|
          [dependency.name, constraint]
        end
      end
    end
983375
def add_constraint(self, con):
        
        if isinstance(con, LinearConstraint):
            N, M = con.A.shape
            if con.name in [c.name for c in self.lin_constraints]:
                logger.error("Constraint set named '%s' already exists."
                             % con.name)
                return False
            else:
                con.i1 = self.lin_N# + 1
                con.iN = self.lin_N + N - 1

                nv = 0
                for vs in con.vs:
                    nv = nv + self.get_var_N(vs)
                if M != nv:
                    logger.error("Number of columns of A does not match number"
                        " of variables, A is %d x %d, nv = %d", N, M, nv)
                self.lin_constraints.append(con)
        elif isinstance(con, NonLinearConstraint):
            N = con.N
            if con.name in [c.name for c in self.nln_constraints]:
                logger.error("Constraint set named '%s' already exists."
                             % con.name)
                return False
            else:
                con.i1 = self.nln_N# + 1
                con.iN = self.nln_N + N
                self.nln_constraints.append(con)
        else:
            raise ValueError

        return True
588596
def field_by_name(name)
      field = fields[name.to_sym] unless name.blank?
      if field.nil?
        dotted = name.to_s.split('.')[0]
        field = fields[dotted.to_sym] unless dotted.blank?
        if field && field.key_relation.nil?
          return nil
        end
      end
      field
    end
1059757
function(name, val, resolveUp) {
                // Allow variables with dots by automatically creating the
                // nested structure
                var parts = name.split('.');
                var obj = this.variables;
                var frame = this;

                if (resolveUp) {
                    if ((frame = this.resolve(parts[0]))) {
                        frame.set(name, val);
                        return;
                    }
                    frame = this;
                }

                for (var i = 0; i < parts.length - 1; i++) {
                    var id = parts[i];

                    if (!obj[id]) {
                        obj[id] = {};
                    }
                    obj = obj[id];
                }

                obj[parts[parts.length - 1]] = val;
            }
1196645
def solvers(config_file, profile, solver_def, list_solvers):
    

    with Client.from_config(
            config_file=config_file, profile=profile, solver=solver_def) as client:

        try:
            solvers = client.get_solvers(**client.default_solver)
        except SolverNotFoundError:
            click.echo("Solver(s) {} not found.".format(solver_def))
            return 1

        if list_solvers:
            for solver in solvers:
                click.echo(solver.id)
            return

        # ~YAML output
        for solver in solvers:
            click.echo("Solver: {}".format(solver.id))
            click.echo("  Parameters:")
            for name, val in sorted(solver.parameters.items()):
                click.echo("    {}: {}".format(name, strtrunc(val) if val else '?'))
            solver.properties.pop('parameters', None)
            click.echo("  Properties:")
            for name, val in sorted(solver.properties.items()):
                click.echo("    {}: {}".format(name, strtrunc(val)))
            click.echo("  Derived properties:")
            for name in sorted(solver.derived_properties):
                click.echo("    {}: {}".format(name, strtrunc(getattr(solver, name))))
            click.echo()