Deallocate memory from constraints
327355
function (infos, silent) {
		each(infos, function (info) {
			info.key.destroy(silent);
			info.value.destroy(silent);
			info.index.destroy(silent);
		});
	}
142364
def __eliminate_unused_constraits (self, objects):
        
        result = []
        for c in self.constraints_:
            if c [0] in objects and c [1] in objects:
                result.append (c)

        return result
347996
def remove_constraint(self, twig=None, **kwargs):
        
        # let's run delayed constraints first to ensure that we get the same
        # results in interactive and non-interactive modes as well as to make
        # sure we don't have delayed constraints for the constraint we're
        #  about to remove.  This could perhaps be optimized by searching
        #  for this/these constraints and only running/removing those, but
        #  probably isn't worth the savings.
        changed_params = self.run_delayed_constraints()

        kwargs['twig'] = twig
        redo_kwargs = deepcopy(kwargs)

        kwargs['context'] = 'constraint'

        # we'll get the constraint so that we can undo the bookkeeping
        # and also reproduce an undo command
        constraint = self.get_parameter(**kwargs)

        # undo parameter bookkeeping
        constraint._remove_bookkeeping()

        # and finally remove it
        self.remove_parameter(**kwargs)


        undo_kwargs = {k: v for k, v in constraint.to_dict().items()
                       if v is not None and
                       k not in ['uniqueid', 'uniquetwig', 'twig',
                                 'Class', 'context']}
        self._add_history(redo_func='remove_constraint',
                          redo_kwargs=redo_kwargs,
                          undo_func='add_constraint',
                          undo_kwargs=undo_kwargs)
987479
def purgeAutoSelected(self):
        """"""
        params = self._autoParams.allData()
        for p in params:
            comps_to_remove = []
            for comp in p['selection']:
                if self.indexByComponent(comp) is None:
                    comps_to_remove.append(comp)
            for orphaned in comps_to_remove:
                p['selection'].remove(orphaned)
338913
private void reduce() {
        Long[] keys = counter.asMap().keySet().toArray(ArrayUtils.EMPTY_LONG_OBJECT_ARRAY);
        Arrays.sort(keys);
        for (int i = 0, n = keys.length - maxNumBlocks + BUFFER_NUM_BLOCKS; i < n; i++) {
            counter.remove(keys[i]);
        }
    }
360705
def _minimize_constraints_fun_summation(x):
    '''
    
    '''
    summation = sum([x[i] for i in CONSTRAINT_PARAMS_IDX])
    return CONSTRAINT_UPPERBOUND >= summation >= CONSTRAINT_LOWERBOUND
1054315
function Constraint (i0, i1) {
  this.i0 = i0
  this.i1 = i1

  this.restLength = vec3.distance(position[i0], position[i1])
}
303457
def store_constraint(constr)
      # Update the constraint to track the index in the model
      index = LPSolve.get_Nrows(@ptr)
      constr.model = self
      constr.index = index
      constr.freeze
      @constr_count += 1

      # Set constraint properties
      if constr.name
        ret = LPSolve.set_row_name(@ptr, index, constr.name)
        fail if ret != 1
      end

      # Determine the correct constant for the type of constraint
      case constr.sense
      when :==
        type = LPSolve::EQ
      when :>=
        type = LPSolve::GE
      when :<=
        type = LPSolve::LE
      end

      store_constraint_matrix constr, type
      @constraints << constr
    end
741684
def delete(self, *args, **kwargs):
        """"""
        # Store ids in memory as relations are also deleted with the Data object.
        storage_ids = list(self.storages.values_list('pk', flat=True))  # pylint: disable=no-member

        super().delete(*args, **kwargs)

        Storage.objects.filter(pk__in=storage_ids, data=None).delete()
663689
def cleanup(self):
        
        remove = []
        for handle, assoc in self.assocs.iteritems():
            if assoc.getExpiresIn() == 0:
                remove.append(handle)
        for handle in remove:
            del self.assocs[handle]
        return len(remove), len(self.assocs)
1262376
def cleanup(self):
        ""
        if self.m_glVertBuffer != 0:
            glDeleteBuffers(1, (self.m_glIndexBuffer,))
            glDeleteVertexArrays( 1, (self.m_glVertArray,) )
            glDeleteBuffers(1, (self.m_glVertBuffer,))
            self.m_glIndexBuffer = 0
            self.m_glVertArray = 0
            self.m_glVertBuffer = 0
559936
def cleanup(self):
        
        remove = []
        for handle, assoc in self.assocs.items():
            if assoc.expiresIn == 0:
                remove.append(handle)
        for handle in remove:
            del self.assocs[handle]
        return len(remove), len(self.assocs)
49767
def unload(self):
        

        if self.loaded:
            self.loaded = False
            self._openalprpy_lib.dispose(self.alpr_pointer)
58510
def store_constraint_matrix(constr, type)
      # Initialize arrays used to hold the coefficients for each variable
      row = []
      colno = []
      constr.expression.terms.each do |var, coeff|
        row << coeff * 1.0
        colno << var.index
      end

      row_buffer = build_pointer_array row, :double
      colno_buffer = build_pointer_array colno, :int

      ret = LPSolve.add_constraintex(@ptr, constr.expression.terms.length,
                                     row_buffer, colno_buffer,
                                     type, constr.rhs)
      fail if ret != 1
    end
864161
void discardUnusedTail()
    {
        // we guard this with the OpOrdering instead of synchronised due to potential dead-lock with CLSM.advanceAllocatingFrom()
        // this actually isn't strictly necessary, as currently all calls to discardUnusedTail occur within a block
        // already protected by this OpOrdering, but to prevent future potential mistakes, we duplicate the protection here
        // so that the contract between discardUnusedTail() and sync() is more explicit.
        try (OpOrder.Group group = appendOrder.start())
        {
            while (true)
            {
                int prev = allocatePosition.get();
                // we set allocatePosition past buffer.capacity() to make sure we always set discardedTailFrom
                int next = buffer.capacity() + 1;
                if (prev == next)
                    return;
                if (allocatePosition.compareAndSet(prev, next))
                {
                    discardedTailFrom = prev;
                    return;
                }
            }
        }
    }
391639
public void removeConstraint( final int idx ) {
        //If the constraint being is a parent of another correct the other constraint's parent accordingly
        FieldConstraint constraintToRemove = this.constraints[ idx ];
        if ( constraintToRemove instanceof SingleFieldConstraint ) {
            final SingleFieldConstraint sfc = (SingleFieldConstraint) constraintToRemove;
            FieldConstraint parent = sfc.getParent();
            for ( FieldConstraint child : this.constraints ) {
                if ( child instanceof SingleFieldConstraint ) {
                    SingleFieldConstraint sfcChild = (SingleFieldConstraint) child;
                    if ( sfcChild.getParent() == constraintToRemove ) {
                        sfcChild.setParent( parent );
                        break;
                    }
                }
            }
        }
        final FieldConstraint[] newList = new FieldConstraint[ this.constraints.length - 1 ];
        int newIdx = 0;
        for ( int i = 0; i < this.constraints.length; i++ ) {

            if ( i != idx ) {
                newList[ newIdx ] = this.constraints[ i ];
                newIdx++;
            }

        }
        this.constraints = newList;

    }
819286
def dealloc(subseqs):
        """"""
        print('            . dealloc')
        lines = Lines()
        lines.add(1, 'cpdef inline dealloc(self):')
        for seq in subseqs:
            lines.add(2, 'PyMem_Free(self.%s)' % seq.name)
        return lines