@Override
  public double getCoupon(
      final double dblValueDate, final org.drip.param.definition.ComponentMarketParams mktParams)
      throws java.lang.Exception {
    if (!org.drip.quant.common.NumberUtil.IsValid(dblValueDate) || null == mktParams)
      throw new java.lang.Exception("FloatingStream::getCoupon => Invalid Inputs");

    org.drip.analytics.period.Period currentPeriod = null;

    for (org.drip.analytics.period.CashflowPeriod period : _lsCouponPeriod) {
      if (null == period) continue;

      if (dblValueDate >= period.getStartDate() && dblValueDate < period.getEndDate()) {
        currentPeriod = period;
        break;
      }
    }

    if (null == currentPeriod)
      throw new java.lang.Exception("FloatingStream::getCoupon => Invalid Inputs");

    java.util.Map<
            org.drip.analytics.date.JulianDate,
            org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double>>
        mapFixings = mktParams.getFixings();

    if (null != mapFixings) {
      double dblCurrentResetDate = currentPeriod.getResetDate();

      if (org.drip.quant.common.NumberUtil.IsValid(dblCurrentResetDate)) {
        org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double> mapIndexFixing =
            mapFixings.get(new org.drip.analytics.date.JulianDate(dblCurrentResetDate));

        if (null != mapIndexFixing) {
          java.lang.Double dblFixing = mapIndexFixing.get(_fri.fullyQualifiedName());

          if (null != dblFixing) return dblFixing + _dblSpread;
        }
      }
    }

    org.drip.analytics.rates.DiscountCurve dc = mktParams.getDiscountCurve();

    if (null == dc)
      throw new java.lang.Exception("FloatingStream::getCoupon => cant determine index");

    return dc.libor(currentPeriod.getStartDate(), currentPeriod.getEndDate()) + _dblSpread;
  }
  @Override
  public org.drip.state.estimator.PredictorResponseWeightConstraint generateCalibPRLC(
      final org.drip.param.valuation.ValuationParams valParams,
      final org.drip.param.pricer.PricerParams pricerParams,
      final org.drip.param.definition.ComponentMarketParams mktParams,
      final org.drip.param.valuation.QuotingParams quotingParams,
      final org.drip.state.representation.LatentStateMetricMeasure lsmm) {
    if (null == valParams
        || valParams.valueDate() >= getMaturityDate().getJulian()
        || null == lsmm
        || !(lsmm instanceof org.drip.analytics.rates.RatesLSMM)
        || !org.drip.analytics.rates.DiscountCurve.LATENT_STATE_DISCOUNT.equalsIgnoreCase(
            lsmm.getID())) return null;

    if (org.drip.analytics.rates.DiscountCurve.QUANTIFICATION_METRIC_FORWARD_RATE.equalsIgnoreCase(
            lsmm.getQuantificationMetric())
        || org.drip.analytics.rates.DiscountCurve.QUANTIFICATION_METRIC_DISCOUNT_FACTOR
            .equalsIgnoreCase(lsmm.getQuantificationMetric())) {
      if (null == mktParams) return null;

      org.drip.analytics.rates.DiscountCurve dc = mktParams.getDiscountCurve();

      if (null == dc) return null;

      org.drip.state.estimator.PredictorResponseWeightConstraint prwc =
          new org.drip.state.estimator.PredictorResponseWeightConstraint();

      double dblDirtyCV100 = 0.;
      boolean bFirstPeriod = true;

      try {
        for (org.drip.analytics.period.CashflowPeriod period : _lsCouponPeriod) {
          if (null == period) continue;

          double dblPayDate = period.getPayDate();

          if (valParams.valueDate() > dblPayDate) continue;

          double dblPeriodDCF = period.getCouponDCF();

          if (bFirstPeriod) {
            bFirstPeriod = false;

            dblPeriodDCF -= period.getAccrualDCF(valParams.valueDate());
          }

          double dblPeriodCV100 = dblPeriodDCF * dc.df(dblPayDate) * getNotional(dblPayDate);

          dblDirtyCV100 += dblPeriodCV100;

          if (!prwc.addPredictorResponseWeight(dblPayDate, dblPeriodCV100 * _dblNotional))
            return null;
        }

        return prwc.updateValue(-1. * dblDirtyCV100 * _dblNotional * lsmm.getMeasureQuoteValue())
            ? prwc
            : null;
      } catch (java.lang.Exception e) {
        e.printStackTrace();

        return null;
      }
    }

    return null;
  }
  @Override
  public org.drip.quant.calculus.WengertJacobian calcQuoteDFMicroJack(
      final java.lang.String strQuote,
      final org.drip.param.valuation.ValuationParams valParams,
      final org.drip.param.pricer.PricerParams pricerParams,
      final org.drip.param.definition.ComponentMarketParams mktParams,
      final org.drip.param.valuation.QuotingParams quotingParams) {
    if (null == valParams
        || valParams.valueDate() >= _dblMaturity
        || null == strQuote
        || null == mktParams
        || null == mktParams.getDiscountCurve()) return null;

    if ("Rate".equalsIgnoreCase(strQuote) || "SwapRate".equalsIgnoreCase(strQuote)) {
      org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double> mapMeasures =
          value(valParams, pricerParams, mktParams, quotingParams);

      if (null == mapMeasures) return null;

      double dblDirtyDV01 = mapMeasures.get("DirtyDV01");

      double dblParSwapRate = mapMeasures.get("SwapRate");

      try {
        org.drip.quant.calculus.WengertJacobian wjSwapRateDFMicroJack = null;

        org.drip.analytics.rates.DiscountCurve dc = mktParams.getDiscountCurve();

        for (org.drip.analytics.period.CashflowPeriod p : _lsCouponPeriod) {
          double dblPeriodPayDate = p.getPayDate();

          if (dblPeriodPayDate < valParams.valueDate()) continue;

          org.drip.quant.calculus.WengertJacobian wjPeriodFwdRateDF =
              dc.getForwardRateJack(p.getStartDate(), p.getEndDate());

          org.drip.quant.calculus.WengertJacobian wjPeriodPayDFDF =
              dc.jackDDFDQuote(dblPeriodPayDate);

          if (null == wjPeriodFwdRateDF || null == wjPeriodPayDFDF) continue;

          double dblForwardRate = dc.libor(p.getStartDate(), p.getEndDate());

          double dblPeriodPayDF = dc.df(dblPeriodPayDate);

          if (null == wjSwapRateDFMicroJack)
            wjSwapRateDFMicroJack =
                new org.drip.quant.calculus.WengertJacobian(1, wjPeriodFwdRateDF.numParameters());

          double dblPeriodNotional = getNotional(p.getStartDate(), p.getEndDate());

          double dblPeriodDCF = p.getCouponDCF();

          for (int k = 0; k < wjPeriodFwdRateDF.numParameters(); ++k) {
            double dblPeriodMicroJack =
                (dblForwardRate - dblParSwapRate) * wjPeriodPayDFDF.getFirstDerivative(0, k)
                    + dblPeriodPayDF * wjPeriodFwdRateDF.getFirstDerivative(0, k);

            if (!wjSwapRateDFMicroJack.accumulatePartialFirstDerivative(
                0, k, dblPeriodNotional * dblPeriodDCF * dblPeriodMicroJack / dblDirtyDV01))
              return null;
          }
        }

        return wjSwapRateDFMicroJack;
      } catch (java.lang.Exception e) {
        e.printStackTrace();
      }
    }

    return null;
  }
  @Override
  public org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double> value(
      final org.drip.param.valuation.ValuationParams valParams,
      final org.drip.param.pricer.PricerParams pricerParams,
      final org.drip.param.definition.ComponentMarketParams mktParams,
      final org.drip.param.valuation.QuotingParams quotingParams) {
    if (null == valParams || null == mktParams) return null;

    org.drip.analytics.rates.DiscountCurve dc = mktParams.getDiscountCurve();

    if (null == dc) return null;

    long lStart = System.nanoTime();

    double dblFixing01 = 0.;
    double dblAccrued01 = 0.;
    double dblDirtyDV01 = 0.;
    boolean bFirstPeriod = true;
    double dblDirtyFloatingPV = 0.;
    double dblCashPayDF = java.lang.Double.NaN;
    double dblResetDate = java.lang.Double.NaN;
    double dblResetRate = java.lang.Double.NaN;

    java.lang.String strFRI = _fri.fullyQualifiedName();

    org.drip.analytics.rates.ForwardRateEstimator fc = mktParams.getForwardCurve();

    if (null != fc && !_fri.match(fc.index())) fc = null;

    for (org.drip.analytics.period.CashflowPeriod period : _lsCouponPeriod) {
      double dblFloatingRate = 0.;
      double dblDirtyPeriodDV01 = java.lang.Double.NaN;

      double dblPeriodPayDate = period.getPayDate();

      if (dblPeriodPayDate < valParams.valueDate()) continue;

      if (null == fc) fc = dc.forwardRateEstimator(dblPeriodPayDate, _fri);

      try {
        if (bFirstPeriod) {
          bFirstPeriod = false;

          if (null == mktParams.getFixings()
              || null
                  == mktParams
                      .getFixings()
                      .get(new org.drip.analytics.date.JulianDate(period.getResetDate()))
              || null
                  == mktParams
                      .getFixings()
                      .get(new org.drip.analytics.date.JulianDate(period.getResetDate()))
                      .get(strFRI))
            dblResetRate =
                dblFloatingRate =
                    null == fc ? dc.libor(_fri.tenor()) : fc.forward(period.getPayDate());
          else
            dblResetRate =
                dblFloatingRate =
                    mktParams
                        .getFixings()
                        .get(new org.drip.analytics.date.JulianDate(period.getResetDate()))
                        .get(strFRI);

          dblFixing01 =
              period.getAccrualDCF(valParams.valueDate())
                  * 0.0001
                  * getNotional(period.getAccrualStartDate(), valParams.valueDate());

          if (period.getStartDate() < valParams.valueDate()) dblAccrued01 = dblFixing01;

          dblResetDate = period.getResetDate();
        } else
          dblFloatingRate =
              null == fc
                  ? dc.libor(period.getStartDate(), period.getEndDate())
                  : fc.forward(period.getPayDate());

        dblDirtyPeriodDV01 =
            0.0001
                * period.getCouponDCF()
                * mktParams.getDiscountCurve().df(dblPeriodPayDate)
                * getNotional(period.getAccrualStartDate(), period.getEndDate());
      } catch (java.lang.Exception e) {
        e.printStackTrace();

        return null;
      }

      if (s_bBlog) {
        try {
          System.out.println(
              new org.drip.analytics.date.JulianDate(period.getResetDate())
                  + " ["
                  + new org.drip.analytics.date.JulianDate(period.getStartDate())
                  + "->"
                  + new org.drip.analytics.date.JulianDate(period.getEndDate())
                  + "] => "
                  + org.drip.quant.common.FormatUtil.FormatDouble(dblFloatingRate, 1, 4, 100.));
        } catch (java.lang.Exception e) {
          e.printStackTrace();
        }
      }

      dblDirtyDV01 += dblDirtyPeriodDV01;
      dblDirtyFloatingPV += dblDirtyPeriodDV01 * 10000. * dblFloatingRate;
    }

    try {
      double dblCashSettle = valParams.cashPayDate();

      if (null != _settleParams)
        dblCashSettle = _settleParams.cashSettleDate(valParams.valueDate());

      dblCashPayDF = mktParams.getDiscountCurve().df(dblCashSettle);
    } catch (java.lang.Exception e) {
      e.printStackTrace();

      return null;
    }

    dblDirtyDV01 /= dblCashPayDF;
    dblDirtyFloatingPV /= dblCashPayDF;
    double dblCleanDV01 = dblDirtyDV01 - dblAccrued01;
    double dblCleanFloatingPV = dblDirtyFloatingPV - dblAccrued01 * (dblResetRate + _dblSpread);

    org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double> mapResult =
        new org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double>();

    mapResult.put("ResetDate", dblResetDate);

    mapResult.put("ResetRate", dblResetRate);

    mapResult.put("Accrued01", dblAccrued01 * _dblNotional);

    mapResult.put("Fixing01", dblFixing01 * _dblNotional);

    mapResult.put(
        "FloatAccrued", dblAccrued01 * 10000. * (dblResetRate + _dblSpread) * _dblNotional);

    mapResult.put("DV01", dblCleanDV01 * _dblNotional);

    mapResult.put("CleanDV01", dblCleanDV01 * _dblNotional);

    mapResult.put("DirtyDV01", dblDirtyDV01 * _dblNotional);

    mapResult.put("CleanFloatingPV", dblCleanFloatingPV * _dblNotional);

    mapResult.put("DirtyFloatingPV", dblDirtyFloatingPV * _dblNotional);

    mapResult.put("PV", dblCleanFloatingPV * _dblNotional);

    mapResult.put("CleanPV", dblCleanFloatingPV * _dblNotional);

    mapResult.put("DirtyPV", dblDirtyFloatingPV * _dblNotional);

    mapResult.put("Upfront", dblCleanFloatingPV * _dblNotional);

    mapResult.put("FairPremium", dblCleanFloatingPV / dblCleanDV01);

    mapResult.put("Rate", dblCleanFloatingPV / dblCleanDV01);

    mapResult.put("ParRate", dblCleanFloatingPV / dblCleanDV01);

    double dblValueNotional = java.lang.Double.NaN;

    try {
      dblValueNotional = getNotional(valParams.valueDate());
    } catch (java.lang.Exception e) {
      e.printStackTrace();
    }

    if (org.drip.quant.common.NumberUtil.IsValid(dblValueNotional)) {
      double dblPrice = 100. * (1. + (dblCleanFloatingPV / _dblNotional / dblValueNotional));

      mapResult.put("Price", dblPrice);

      mapResult.put("CleanPrice", dblPrice);
    }

    mapResult.put("CalcTime", (System.nanoTime() - lStart) * 1.e-09);

    return mapResult;
  }
  @Override
  public double[] fxForward(
      final org.drip.param.valuation.ValuationParams valParam,
      final org.drip.analytics.rates.DiscountCurve dcNum,
      final org.drip.analytics.rates.DiscountCurve dcDenom,
      final boolean bBasisOnDenom,
      final boolean bFwdAsPIP) {
    org.drip.analytics.rates.DiscountCurve dcBasisAdj = null;
    double[] adblFXFwd = new double[_adblFXBasis.length];

    if (bBasisOnDenom) dcBasisAdj = dcDenom;
    else dcBasisAdj = dcNum;

    for (int i = 0; i < _adblFXBasis.length; ++i) {
      try {
        org.drip.product.definition.FXForward fxfwd =
            org.drip.product.creator.FXForwardBuilder.CreateFXForward(
                _cp,
                new org.drip.analytics.date.JulianDate(_dblSpotDate),
                new org.drip.analytics.date.JulianDate(_adblDate[i]));

        if (null == fxfwd) {
          System.out.println(
              "DerivedFXBasis::getFullFXFwd => Cannot make fxfwd at maturity "
                  + org.drip.analytics.date.DateUtil.FromJulian(_adblDate[i]));

          return null;
        }

        if (bBasisOnDenom) {
          if (_bIsFXBasisBootstrapped) {
            if (!(dcBasisAdj instanceof org.drip.analytics.rates.ExplicitBootDiscountCurve))
              return null;

            if (((org.drip.analytics.rates.ExplicitBootDiscountCurve) dcBasisAdj)
                .bumpNodeValue(i, _adblFXBasis[i])) return null;
            ;
          } else
            dcBasisAdj =
                (org.drip.analytics.rates.DiscountCurve)
                    dcDenom.parallelShiftQuantificationMetric(_adblFXBasis[i]);

          if (null == dcBasisAdj) {
            System.out.println(
                "DerivedFXBasis::getFullFXFwd => Cannot create bootstrapped/full denom curve at node "
                    + org.drip.analytics.date.DateUtil.FromJulian(_adblDate[i]));

            return null;
          }

          adblFXFwd[i] = fxfwd.imply(valParam, dcNum, dcBasisAdj, _dblFXSpot, bFwdAsPIP);
        } else {
          if (_bIsFXBasisBootstrapped) {
            if (!(dcBasisAdj instanceof org.drip.analytics.rates.ExplicitBootDiscountCurve))
              return null;

            if (((org.drip.analytics.rates.ExplicitBootDiscountCurve) dcBasisAdj)
                .bumpNodeValue(i, _adblFXBasis[i])) return null;
            ;
          } else
            dcBasisAdj =
                (org.drip.analytics.rates.DiscountCurve)
                    dcNum.parallelShiftQuantificationMetric(_adblFXBasis[i]);

          if (null == dcBasisAdj) {
            System.out.println(
                "DerivedFXBasis::getFullFXFwd => Cannot create bootstrapped/full num curve at node "
                    + org.drip.analytics.date.DateUtil.FromJulian(_adblDate[i]));

            return null;
          }

          adblFXFwd[i] = fxfwd.imply(valParam, dcBasisAdj, dcDenom, _dblFXSpot, bFwdAsPIP);
        }
      } catch (java.lang.Exception e) {
        e.printStackTrace();

        return null;
      }
    }

    return adblFXFwd;
  }
  private static final void CDSAPISample() throws Exception {
    JulianDate dtStart = JulianDate.Today();

    /*
     * Flat Discount Curve
     */

    DiscountCurve dc = DiscountCurveBuilder.CreateFromFlatRate(dtStart, "USD", 0.05);

    /*
     * Flat Credit Curve
     */

    CreditCurve cc = CreditCurveBuilder.FromFlatHazard(dtStart.getJulian(), "CC", "USD", 0.02, 0.4);

    /*
     * Component Market Parameters built from the Discount and the Credit Curves
     */

    ComponentMarketParams cmp = ComponentMarketParamsBuilder.MakeCreditCMP(dc, cc);

    /*
     * Create an SNAC CDS
     */

    CreditDefaultSwap cds = CDSBuilder.CreateSNAC(dtStart, "5Y", 0.1, "CC");

    /*
     * Valuation Parameters
     */

    ValuationParams valParams =
        ValuationParams.CreateValParams(dtStart, 0, "", Convention.DR_ACTUAL);

    /*
     * Standard Credit Pricer Parameters (check javadoc for details)
     */

    PricerParams pricerParams = PricerParams.MakeStdPricerParams();

    System.out.println(
        "Acc Start       Acc End     Pay Date    Index   Spread   Cpn DCF    Pay01    Surv01");

    System.out.println(
        "---------      ---------    ---------   ------  ------   -------- --------- --------");

    /*
     * CDS Coupon Cash Flow
     */

    for (CashflowPeriodCurveFactors p : cds.getCouponFlow(valParams, pricerParams, cmp))
      System.out.println(
          JulianDate.fromJulian(p.getAccrualStartDate())
              + FIELD_SEPARATOR
              + JulianDate.fromJulian(p.getAccrualEndDate())
              + FIELD_SEPARATOR
              + JulianDate.fromJulian(p.getPayDate())
              + FIELD_SEPARATOR
              + FormatUtil.FormatDouble(p.getIndexRate(), 1, 4, 1.)
              + FIELD_SEPARATOR
              + FormatUtil.FormatDouble(p.getSpread(), 1, 4, 1.)
              + FIELD_SEPARATOR
              + FormatUtil.FormatDouble(p.getCouponDCF(), 1, 4, 1.)
              + FIELD_SEPARATOR
              + FormatUtil.FormatDouble(dc.df(p.getPayDate()), 1, 4, 1.)
              + FIELD_SEPARATOR
              + FormatUtil.FormatDouble(cc.getSurvival(p.getPayDate()), 1, 4, 1.));

    System.out.println(
        "Loss Start     Loss End      Pay Date      Cpn    Notl     Rec    EffDF    StartSurv  EndSurv");

    System.out.println(
        "----------     --------      --------      ---    ----     ---    -----    ---------  -------");

    /*
     * CDS Loss Cash Flow
     */

    for (LossPeriodCurveFactors dp : cds.getLossFlow(valParams, pricerParams, cmp))
      System.out.println(
          JulianDate.fromJulian(dp.getStartDate())
              + FIELD_SEPARATOR
              + JulianDate.fromJulian(dp.getEndDate())
              + FIELD_SEPARATOR
              + JulianDate.fromJulian(dp.getPayDate())
              + FIELD_SEPARATOR
              + FormatUtil.FormatDouble(dp.getCouponDCF(), 1, 4, 1.)
              + FIELD_SEPARATOR
              + FormatUtil.FormatDouble(dp.effectiveNotional(), 1, 0, 1.)
              + FIELD_SEPARATOR
              + FormatUtil.FormatDouble(dp.effectiveRecovery(), 1, 2, 1.)
              + FIELD_SEPARATOR
              + FormatUtil.FormatDouble(dp.effectiveDF(), 1, 4, 1.)
              + FIELD_SEPARATOR
              + FormatUtil.FormatDouble(dp.startSurvival(), 1, 4, 1.)
              + FIELD_SEPARATOR
              + FormatUtil.FormatDouble(dp.endSurvival(), 1, 4, 1.));
  }
  private static final Map<String, ForwardCurve> xM6MBasisSample(
      final JulianDate dtSpot,
      final String strCurrency,
      final DiscountCurve dc,
      final int iTenorInMonths,
      final String[] astrxM6MFwdTenor,
      final double[] adblxM6MBasisSwapQuote)
      throws Exception {
    System.out.println("------------------------------------------------------------");

    System.out.println(" SPL =>              n=4               |         |         |");

    System.out.println("---------------------------------------|  LOG DF |  LIBOR  |");

    System.out.println(" MSR =>  RECALC  |  REFEREN |  DERIVED |         |         |");

    System.out.println("------------------------------------------------------------");

    /*
     * Construct the 6M-xM float-float basis swap.
     */

    FloatFloatComponent[] aFFC =
        MakexM6MBasisSwap(dtSpot, strCurrency, astrxM6MFwdTenor, iTenorInMonths);

    String strBasisTenor = iTenorInMonths + "M";

    ValuationParams valParams = new ValuationParams(dtSpot, dtSpot, strCurrency);

    /*
     * Calculate the starting forward rate off of the discount curve.
     */

    double dblStartingFwd = dc.forward(dtSpot.julian(), dtSpot.addTenor(strBasisTenor).julian());

    /*
     * Set the discount curve based component market parameters.
     */

    CurveSurfaceQuoteSet mktParams =
        MarketParamsBuilder.Create(dc, null, null, null, null, null, null);

    Map<String, ForwardCurve> mapForward = new HashMap<String, ForwardCurve>();

    /*
     * Construct the shape preserving forward curve off of Quartic Polynomial Basis Spline.
     */

    ForwardCurve fcxMQuartic =
        ScenarioForwardCurveBuilder.ShapePreservingForwardCurve(
            "QUARTIC_FWD" + strBasisTenor,
            ForwardLabel.Create(strCurrency, strBasisTenor),
            valParams,
            null,
            mktParams,
            null,
            MultiSegmentSequenceBuilder.BASIS_SPLINE_POLYNOMIAL,
            new PolynomialFunctionSetParams(5),
            aFFC,
            "ReferenceParBasisSpread",
            adblxM6MBasisSwapQuote,
            dblStartingFwd);

    mapForward.put(" QUARTIC_FWD" + strBasisTenor, fcxMQuartic);

    /*
     * Set the discount curve + quartic polynomial forward curve based component market parameters.
     */

    CurveSurfaceQuoteSet mktParamsQuarticFwd =
        MarketParamsBuilder.Create(dc, fcxMQuartic, null, null, null, null, null, null);

    int i = 0;
    int iFreq = 12 / iTenorInMonths;

    /*
     * Compute the following forward curve metrics for each of cubic polynomial forward, quartic
     * 	polynomial forward, and KLK Hyperbolic tension forward curves:
     * 	- Reference Basis Par Spread
     * 	- Derived Basis Par Spread
     *
     * Further compare these with a) the forward rate off of the discount curve, b) the LIBOR rate, and
     * 	c) Input Basis Swap Quote.
     */

    for (String strMaturityTenor : astrxM6MFwdTenor) {
      double dblFwdEndDate = dtSpot.addTenor(strMaturityTenor).julian();

      double dblFwdStartDate =
          dtSpot.addTenor(strMaturityTenor).subtractTenor(strBasisTenor).julian();

      FloatFloatComponent ffc = aFFC[i++];

      CaseInsensitiveTreeMap<Double> mapQuarticValue =
          ffc.value(valParams, null, mktParamsQuarticFwd, null);

      System.out.println(
          " "
              + strMaturityTenor
              + " =>  "
              + FormatUtil.FormatDouble(fcxMQuartic.forward(strMaturityTenor), 2, 2, 100.)
              + "  |  "
              + FormatUtil.FormatDouble(mapQuarticValue.get("ReferenceParBasisSpread"), 2, 2, 1.)
              + "  |  "
              + FormatUtil.FormatDouble(mapQuarticValue.get("DerivedParBasisSpread"), 2, 2, 1.)
              + "  |  "
              + FormatUtil.FormatDouble(
                  iFreq * java.lang.Math.log(dc.df(dblFwdStartDate) / dc.df(dblFwdEndDate)),
                  1,
                  2,
                  100.)
              + "  |  "
              + FormatUtil.FormatDouble(dc.libor(dblFwdStartDate, dblFwdEndDate), 1, 2, 100.)
              + "  |  ");
    }

    return mapForward;
  }
  @Override
  public boolean cookCustomCC(
      final java.lang.String strName,
      final java.lang.String strCustomName,
      final org.drip.param.valuation.ValuationParams valParams,
      final org.drip.analytics.rates.DiscountCurve dc,
      final org.drip.analytics.rates.DiscountCurve dcTSY,
      final org.drip.analytics.rates.DiscountCurve dcEDSF,
      final double[] adblQuotes,
      final double dblRecovery,
      final java.lang.String[] astrCalibMeasure,
      final java.util.Map<
              org.drip.analytics.date.JulianDate,
              org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double>>
          mmFixings,
      final org.drip.param.valuation.QuotingParams quotingParams,
      final boolean bFlat,
      final org.drip.param.definition.ResponseValueTweakParams mmtpDC,
      final org.drip.param.definition.ResponseValueTweakParams mmtpTSY,
      final org.drip.param.definition.ResponseValueTweakParams mmtpEDSF,
      final org.drip.param.definition.ResponseValueTweakParams mmtpCC) {
    if (null == strCustomName
        || strCustomName.isEmpty()
        || null == _ccsg
        || null == dc
        || null == adblQuotes
        || 0 == adblQuotes.length
        || !org.drip.quant.common.NumberUtil.IsValid(dblRecovery)
        || null == astrCalibMeasure
        || 0 == astrCalibMeasure.length
        || astrCalibMeasure.length != adblQuotes.length
        || (null == mmtpDC && null == mmtpTSY && null == mmtpEDSF && null == mmtpCC)) {
      if (s_bBlog)
        System.out.println("CreditCurveScenarioContainer.cookCustomCC => Bad Input params!");

      return false;
    }

    org.drip.analytics.rates.DiscountCurve dcAdj =
        (org.drip.analytics.rates.DiscountCurve) dc.customTweakManifestMeasure(mmtpDC);

    org.drip.analytics.rates.DiscountCurve dcTSYAdj =
        (org.drip.analytics.rates.DiscountCurve) dcTSY.customTweakManifestMeasure(mmtpTSY);

    org.drip.analytics.rates.DiscountCurve dcEDSFAdj =
        (org.drip.analytics.rates.DiscountCurve) dcEDSF.customTweakManifestMeasure(mmtpEDSF);

    org.drip.analytics.definition.CreditCurve ccBaseCustom =
        _ccsg.createCC(
            strName,
            valParams,
            null == dcAdj ? dc : dcAdj,
            null == dcTSYAdj ? dcTSY : dcTSYAdj,
            null == dcEDSFAdj ? dcEDSF : dcEDSFAdj,
            adblQuotes,
            dblRecovery,
            astrCalibMeasure,
            mmFixings,
            quotingParams,
            bFlat);

    if (null == ccBaseCustom) {
      if (s_bBlog)
        System.out.println(
            "CreditCurveScenarioContainer.cookCustomCC => Cannot create ccBaseCustom!");

      return false;
    }

    if (null == _mapCustomCC)
      _mapCustomCC =
          new org.drip.analytics.support.CaseInsensitiveTreeMap<
              org.drip.analytics.definition.CreditCurve>();

    org.drip.analytics.definition.CreditCurve ccCustom =
        (org.drip.analytics.definition.CreditCurve) ccBaseCustom.customTweakManifestMeasure(mmtpCC);

    if (null == ccCustom) _mapCustomCC.put(strCustomName, ccBaseCustom);
    else _mapCustomCC.put(strCustomName, ccCustom);

    return true;
  }