/**
   * Print the name and title of the Nelder-Mead algorithm
   *
   * @param textCase the text case
   * @param textOut the text output destination
   * @param useShortName use the short name?
   * @return the next case
   */
  protected static final ETextCase printNelderMead(
      final ETextCase textCase, final ITextOutput textOut, final boolean useShortName) {
    ETextCase next;

    textOut.append(OptimizationBasedFitter.NAME_NELDER_MEAD);
    if (!useShortName) {
      textOut.append(' ');
      next = textCase.nextCase().appendWord(OptimizationBasedFitter.NAME_ALGORITHM, textOut);
    } else {
      next = textCase.nextCase();
    }

    if (textOut instanceof IComplexText) {
      try (final BibliographyBuilder builder =
          ((IComplexText) textOut).cite(ECitationMode.ID, next, ESequenceMode.COMMA)) {
        builder.add(OptimizationBasedFitter.REFERENCE_NELDER_MEAD);
      }
    }

    return next.nextCase();
  }
  /**
   * Print the name and title of the Levenberg-Marcquardt algorithm
   *
   * @param textCase the text case
   * @param textOut the text output destination
   * @param useShortName use the short name?
   * @return the next case
   */
  protected static final ETextCase printLevenbergMarcquardt(
      final ETextCase textCase, final ITextOutput textOut, final boolean useShortName) {
    ETextCase next;

    textOut.append(OptimizationBasedFitter.NAME_LEVENBERG_MARCQUARDT);
    next = textCase.nextCase();
    if (!useShortName) {
      textOut.append(' ');
      next = next.appendWord(OptimizationBasedFitter.NAME_ALGORITHM, textOut);
    }

    if (textOut instanceof IComplexText) {
      try (final BibliographyBuilder builder =
          ((IComplexText) textOut).cite(ECitationMode.ID, next, ESequenceMode.COMMA)) {
        builder.add(OptimizationBasedFitter.REFERENCE_LEVENBERG_MARCQUARDT_1);
        builder.add(OptimizationBasedFitter.REFERENCE_LEVENBERG_MARCQUARDT_2);
      }
    }

    return next.nextCase();
  }
  /**
   * Print the name and title of the CMAES algorithm
   *
   * @param textCase the text case
   * @param textOut the text output destination
   * @param useShortName use the short name?
   * @return the next case
   */
  protected static final ETextCase printCMAES(
      final ETextCase textCase, final ITextOutput textOut, final boolean useShortName) {
    textOut.append(
        useShortName
            ? OptimizationBasedFitter.NAME_CMAES_SHORT
            : OptimizationBasedFitter.NAME_CMAES_LONG);

    if (textOut instanceof IComplexText) {
      try (final BibliographyBuilder builder =
          ((IComplexText) textOut).cite(ECitationMode.ID, textCase, ESequenceMode.COMMA)) {
        builder.add(OptimizationBasedFitter.REFERENCE_CMAES);
      }
    }

    return textCase.nextCase();
  }
  /** {@inheritDoc} */
  @Override
  protected ETextCase printNameInDescription(
      final ITextOutput textOut,
      final ETextCase textCase,
      final boolean fromYAxisSemanticComponent) {
    ETextCase next;

    next = super.printNameInDescription(textOut, textCase, fromYAxisSemanticComponent);

    if (!fromYAxisSemanticComponent) {
      if (textOut instanceof IComplexText) {
        try (final BibliographyBuilder builder =
            ((IComplexText) textOut).cite(ECitationMode.ID, next, ESequenceMode.COMMA)) {
          builder.addAll(ECDF.REFERENCES);
        }
      }
    }

    return next.nextCase();
  }