diff -urN projects/RQuantLib-orig/NAMESPACE projects/RQuantLib/NAMESPACE --- projects/RQuantLib-orig/NAMESPACE 2011-09-10 09:11:15.000000000 -0400 +++ projects/RQuantLib/NAMESPACE 2013-09-16 18:30:38.190089857 -0400 @@ -31,6 +31,7 @@ "FittedBondCurve", ##--calendars.R "isBusinessDay", "businessDay", + "nextIMMDate", "isHoliday", "isWeekend", "isEndOfMonth", diff -urN projects/RQuantLib-orig/R/calendars.R projects/RQuantLib/R/calendars.R --- projects/RQuantLib-orig/R/calendars.R 2010-08-07 12:03:16.000000000 -0400 +++ projects/RQuantLib/R/calendars.R 2013-09-16 18:06:13.000000000 -0400 @@ -29,6 +29,13 @@ names(val) <- dates val } + +nextIMMDate <- function(dates=Sys.Date()) { + stopifnot(class(dates)=="Date") + val <- .Call("nextIMMDate", dates, PACKAGE="RQuantLib") + val +} + businessDay <- function(calendar="TARGET", dates=Sys.Date()) { ## may get deprecated one day isBusinessDay(calendar, dates) } diff -urN projects/RQuantLib-orig/src/calendars.cpp projects/RQuantLib/src/calendars.cpp --- projects/RQuantLib-orig/src/calendars.cpp 2013-02-17 16:16:25.000000000 -0500 +++ projects/RQuantLib/src/calendars.cpp 2013-09-16 18:06:49.000000000 -0400 @@ -130,6 +130,27 @@ return R_NilValue; } +RcppExport SEXP nextIMMDate(SEXP dateSexp){ + + try { + Rcpp::DateVector dates = Rcpp::DateVector(dateSexp); + int n = dates.size(); + QuantLib::Date immdate; + for(int i=0; i swFloatingLegIndex(new QuantLib::Euribor6M); + QuantLib::DayCounter swFixedLegDayCounter = QuantLib::Thirty360(QuantLib::Thirty360::USA); + boost::shared_ptr swFloatingLegIndex(new + QuantLib::USDLibor(QuantLib::Period(3, QuantLib::Months))); boost::shared_ptr quote(new QuantLib::SimpleQuote(r)); boost::shared_ptr swap(new QuantLib::SwapRateHelper( QuantLib::Handle(quote),