code: private LinkedHashMap<String, Num> mapValues(String infix, Object... values) {
          LinkedHashMap<String, Num> vNames = null;
          int remain = 0;
        
          Matcher mat = pVariableNames.matcher(infix);
          while (mat.find()) {
              if (vNames == null)
                  vNames = new LinkedHashMap<String, Num>();
  
              String vName = mat.group();
              if (!vNames.containsKey(vName)) {
                  remain++;
                  Num num = findValue(vName, true, values);
                  vNames.put(vName, num);
  
                  if (num != null)
                      remain--;
              }
          }
  
          // pair names with values without name
          if (vNames != null) {
              int lastPos = 0;
              for (Entry<String, Num> entry : vNames.entrySet()) {
                  if (entry.getValue() == null) {
                      for (int i = lastPos; i < values.length; i++) {
                          Object v = values[i];
                          if (v != null) {
                              if (v instanceof Num) {
                                  Num n = (Num) v;
                                  if (n.getName() == null)
                                      entry.setValue(n);
                                  else if (n.getName().equals(entry.getValue()))
                                      entry.setValue(n);
                              }
                              else
                                  entry.setValue(Num.toNum(v));
  
                              values[i] = null;
                              lastPos = i;
                              remain--;
                          }
                      }
                  }
              }
          }
  
          if (remain > 0 && vNames != null) {
              StringBuilder sb = new StringBuilder();
              int c = 0;
              for (Entry<String, Num> entry : vNames.entrySet()) {
                  if (entry.getValue() == null) {
                      if (c++ > 0)
                          sb.append(", ");
                      sb.append(entry.getKey());
                  }
              }
  
              throw new CalculatorException("Undefined values for expression (" + infix + ") variables: " + sb.toString());
          }
  
          return vNames;
      }
docs: map variable names from expression with values
  
  @param infix
  @param values
  @return
  @