code: public void encodeCardinality(final MiniSatStyleSolver s, final LNGIntVector lits, int rhs) {
      switch (this.cardinalityEncoding) {
        case TOTALIZER:
          this.totalizer.build(s, lits, rhs);
          if (this.totalizer.hasCreatedEncoding())
            this.totalizer.update(s, rhs);
          break;
        case MTOTALIZER:
          this.mtotalizer.encode(s, lits, rhs);
          break;
        default:
          throw new IllegalStateException("Unknown cardinality encoding: " + this.cardinalityEncoding);
      }
    }
docs: Encodes a cardinality constraint in the given solver.
  @param s    the solver
  @param lits the literals for the constraint
  @param rhs  the right hand side of the constraint
  @throws IllegalStateException if the cardinality encoding is unknown