Gets a {@code TableFactorBuilder} where each outcome is initialized with a
weight of 1.

@param variables
@return
353244
public static TableFactorBuilder ones(VariableNumMap variables) {
    TableFactorBuilder builder = new TableFactorBuilder(variables);
    Iterator<Assignment> allAssignmentIter = new AllAssignmentIterator(variables);
    while (allAssignmentIter.hasNext()) {
      builder.setWeight(allAssignmentIter.next(), 1.0);
    }
    return builder;
  }
405548
@SuppressWarnings("unchecked")
  public <T extends TypedValue> T getVariableLocalTyped(String variableName) {
    TypedValue variable = associationManager.getVariableLocal(variableName);
    return variable != null ? (T) variable : null;
  }
1263308
public Concept getConcept(Variable var) {
        var = equivalentVars.componentOf(var);
        assert var != null;

        @Nullable Concept concept = concepts.get(var);

        if (concept == null) {
            @Nullable ConceptBuilder builder = conceptBuilders.remove(var);

            if (builder != null) {
                concept = buildConcept(var, builder);
            }
        }

        if (concept != null) {
            return concept;
        }

        LOG.debug("Could not build concept for {}\nconcepts = {}\nconceptBuilders = {}", var, concepts, conceptBuilders);

        throw GraqlQueryException.insertUndefinedVariable(printableRepresentation(var));
    }
396917
private void compute(final List<Integer> variables) {
        final Stack<Integer> candidates = createInitialCandidates(variables);
        while (candidates.size() > 0) {
            final int lit = candidates.pop();
            if (solve(lit)) {
                refineUpperBound();
            } else {
                addBackboneLiteral(lit);
            }
        }
    }
140722
static Hashtable<String, String> generateJmxTable(Map<String, String> variables) {
		Hashtable<String, String> ht = new Hashtable<>(variables.size());
		for (Map.Entry<String, String> variable : variables.entrySet()) {
			ht.put(replaceInvalidChars(variable.getKey()), replaceInvalidChars(variable.getValue()));
		}
		return ht;
	}
416551
public ExecuteSQLQueryBuilder extract(String columnName, String variableName) {
		action.getExtractVariables().put(columnName, variableName);
		return this;
	}
843466
public static String get(VariableElement variable) {
    StringBuilder result = new StringBuilder();
    AnnotationMirror qualifier = getQualifier(variable.getAnnotationMirrors());
    if (qualifier != null) {
      qualifierToString(qualifier, result);
    }
    typeToString(variable.asType(), result, '$');
    return result.toString();
  }
786546
public List<T> getVariable() throws InitializationTypeConflictException {
		if (!materialized) {
			throw new IllegalStateException("The Broadcast Variable has not yet been materialized.");
		}
		if (disposed) {
			throw new IllegalStateException("The Broadcast Variable has been disposed");
		}

		synchronized (references) {
			if (transformed != null) {
				if (transformed instanceof List) {
					@SuppressWarnings("unchecked")
					List<T> casted = (List<T>) transformed;
					return casted;
				} else {
					throw new InitializationTypeConflictException(transformed.getClass());
				}
			}
			else {
				return data;
			}
		}
	}
453500
public List<Variable> variables() {
        List<Variable> result = new ArrayList<Variable>(inputVariables.size() + outputVariables.size());
        result.addAll(inputVariables);
        result.addAll(outputVariables);
        return result;
    }
386777
private static Iterator<int[]> initializeValueIterator(VariableNumMap vars) {
		int[] dimensionSizes = new int[vars.size()];
		
		List<DiscreteVariable> discreteVars = vars.getDiscreteVariables();
		for (int i = 0; i < discreteVars.size(); i++) {
		  dimensionSizes[i] = discreteVars.get(i).numValues();
		}
		return new IntegerArrayIterator(dimensionSizes, new int[0]);
	}
924278
private static String buildKey(Set<String> variables) {
    return variables.stream().sorted().collect(Collectors.joining(", "));
  }
152554
public ValueExpression resolveVariable(String variable)
    {
        ValueExpression ve = null;
        try
        {
            if (_vars != null)
            {
                ve = (ValueExpression) _vars.get(variable);

                // Is this code in a block that wants to cache 
                // the resulting expression(s) and variable has been resolved?
                if (_trackResolveVariables && ve != null)
                {
                    _variableResolved = true;
                }
            }
            
            if (ve == null)
            {
                return _target.resolveVariable(variable);
            }
            
            return ve;
        }
        catch (StackOverflowError e)
        {
            throw new ELException("Could not Resolve Variable [Overflow]: " + variable, e);
        }
    }
1043888
private Set<MemberLookupResult> performNestedLookup(String variable) {
    Set<MemberLookupResult> ret = new LinkedHashSet<>();
    // start with the first part
    String[] parts = StringUtils.split(variable, ".");
    if (parts.length > 2) {
      Set<MemberLookupResult> subResult = performNestedLookup(StringUtils.substringBeforeLast(variable, "."));
      for (MemberLookupResult result : subResult) {
        if (result.matches(parts[parts.length - 1])) {
          ret.addAll(getResultsForClass(result.getReturnType(), variable));
        }
      }
    }
    else {
      Set<MemberLookupResult> subResults = performMemberLookup(parts[0]);
      for (MemberLookupResult result : subResults) {
        if (result.matches(parts[1])) {
          // we found a method which has the correct name, now we can resolv this
          ret.addAll(getResultsForClass(result.getReturnType(), variable));
        }
      }
    }
    return ret;
  }
1292073
public UriTemplate with(TemplateVariables variables) {

		Assert.notNull(variables, "TemplateVariables must not be null!");

		if (variables.equals(TemplateVariables.NONE)) {
			return this;
		}

		UriComponents components = UriComponentsBuilder.fromUriString(baseUri).build();
		List<TemplateVariable> result = new ArrayList<>();

		for (TemplateVariable variable : variables) {

			boolean isRequestParam = variable.isRequestParameterVariable();
			boolean alreadyPresent = components.getQueryParams().containsKey(variable.getName());

			if (isRequestParam && alreadyPresent) {
				continue;
			}

			if (variable.isFragment() && StringUtils.hasText(components.getFragment())) {
				continue;
			}

			result.add(variable);
		}

		return new UriTemplate(baseUri, this.variables.concat(result));
	}
423960
public static TableFactor logUnity(VariableNumMap vars) {
    TableFactorBuilder builder = new TableFactorBuilder(vars, SparseTensorBuilder.getFactory());
    return builder.buildSparseInLogSpace();
  }
78091
public void tableEntry(CodeBuilder mv) {
    mv.visitLocalVariable(
        variableName(),
        resultType().getDescriptor(),
        null, // no generic signature
        start(),
        end(),
        index());
  }
726741
public final Variable getVariable(int variableNum) {
    int index = getVariableIndex(variableNum);
    if (index >= 0) {
      return vars[index];
    } else {
      return null;
    }
  }