[Rquantlib-commits] r293 - in pkg/RQuantLib: R inst src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Aug 7 17:56:13 CEST 2010


Author: edd
Date: 2010-08-07 17:56:13 +0200 (Sat, 07 Aug 2010)
New Revision: 293

Modified:
   pkg/RQuantLib/R/arrays.R
   pkg/RQuantLib/R/asian.R
   pkg/RQuantLib/R/bermudan.R
   pkg/RQuantLib/R/bond.R
   pkg/RQuantLib/R/calendars.R
   pkg/RQuantLib/R/discount.R
   pkg/RQuantLib/R/hullWhiteCalibration.R
   pkg/RQuantLib/R/implied.R
   pkg/RQuantLib/R/option.R
   pkg/RQuantLib/inst/ChangeLog
   pkg/RQuantLib/src/asian.cpp
   pkg/RQuantLib/src/barrier_binary.cpp
   pkg/RQuantLib/src/bermudan.cpp
   pkg/RQuantLib/src/bonds.cpp
   pkg/RQuantLib/src/calendars.cpp
   pkg/RQuantLib/src/discount.cpp
   pkg/RQuantLib/src/hullwhite.cpp
   pkg/RQuantLib/src/implieds.cpp
   pkg/RQuantLib/src/vanilla.cpp
Log:
drop QL_ prefix on all C++ functions called from R via .Call
hence adjust R/*s and src/*cpp 
needed a single explit QuantLib:: qualifier in barrier_binary


Modified: pkg/RQuantLib/R/arrays.R
===================================================================
--- pkg/RQuantLib/R/arrays.R	2010-08-06 11:17:25 UTC (rev 292)
+++ pkg/RQuantLib/R/arrays.R	2010-08-07 15:56:13 UTC (rev 293)
@@ -46,7 +46,7 @@
         for (r in 1:n.riskFreeRate)
           for (t in 1:n.maturity)
             for (v in 1:n.volatility) {
-              val <- .Call("QL_EuropeanOption",
+              val <- .Call("EuropeanOption",
                            list(type=as.character(type),
                                 underlying=as.double(underlying[s]),
                                 strike=as.double(strike[k]),
@@ -78,3 +78,29 @@
                    volatility=volatility)))
 }
 
+newEuropeanOptionArrays <- function(type, underlying, strike, dividendYield,
+                                    riskFreeRate, maturity, volatility) {
+    lv <- c(length(underlying) > 1,
+           length(strike) > 1,
+           length(dividendYield) > 1,
+           length(riskFreeRate) > 1, +
+           length(maturity) > 1, +
+           length(volatility) > 1)
+    if (sum(lv) != 2) {
+        warning("Need exactly two arguments as vectors")
+        return(NULL)
+    }
+    type <- match.arg(type, c("call", "put"))
+    pars <- expand.grid(underlying, strike, dividendYield,
+                        riskFreeRate, maturity, volatility)
+    nonconst <- which( apply(pars, 2, sd) != 0)
+    colnames <- c("spot", "strike", "div", "rfrate", "mat", "vol")
+
+    #val <- .Call("EuropeanOptionArray", type, pars, PACKAGE="RQuantLib")
+
+
+}
+
+
+
+

Modified: pkg/RQuantLib/R/asian.R
===================================================================
--- pkg/RQuantLib/R/asian.R	2010-08-06 11:17:25 UTC (rev 292)
+++ pkg/RQuantLib/R/asian.R	2010-08-07 15:56:13 UTC (rev 293)
@@ -41,7 +41,7 @@
             maturity <- 1.0             # actually unused for arithmetic option case
         }
     }
-    val <- .Call("QL_AsianOption",
+    val <- .Call("AsianOption",
                  list(averageType=as.character(averageType),
                       type=as.character(type),
                       underlying=as.double(underlying),

Modified: pkg/RQuantLib/R/bermudan.R
===================================================================
--- pkg/RQuantLib/R/bermudan.R	2010-08-06 11:17:25 UTC (rev 292)
+++ pkg/RQuantLib/R/bermudan.R	2010-08-07 15:56:13 UTC (rev 293)
@@ -37,7 +37,7 @@
   if(!is.numeric(unlist(tsQuotes))) {
     stop("Term structure quotes must have numeric values")
   }
-  
+
   # Check for correct matrix/vector types
   if(!is.matrix(volMatrix)
      || !is.vector(swaptionMaturities)
@@ -54,7 +54,7 @@
   # We could coerce types here and pass as.integer(round(swapTenors)),
   # temp <- as.double(volMatrix), dim(temp) < dim(a) [and pass temp instead
   # of volMatrix]. But this is taken care of in the C/C++ code.
-  val <- .Call("QL_BermudanSwaption",
+  val <- .Call("BermudanSwaption",
                params, tsQuotes,
                swaptionMaturities,
                swapTenors,

Modified: pkg/RQuantLib/R/bond.R
===================================================================
--- pkg/RQuantLib/R/bond.R	2010-08-06 11:17:25 UTC (rev 292)
+++ pkg/RQuantLib/R/bond.R	2010-08-07 15:56:13 UTC (rev 293)
@@ -44,7 +44,7 @@
     dateparams <- matchParams(dateparams)
 
 
-    val <- .Call("QL_ZeroBondWithRebuiltCurve",
+    val <- .Call("ZeroBondWithRebuiltCurve",
                  bond, c(discountCurve$table$date),
                  discountCurve$table$zeroRates, dateparams,
                  PACKAGE="RQuantLib")
@@ -67,17 +67,17 @@
                               dayCounter=2, frequency=2,
                               compound=0, businessDayConvention=4){
 
-     val <- .Call("QL_ZeroPriceByYield",
-                     list(
-   		          yield=as.double(yield),
-	                  faceAmount = as.double(faceAmount),
-	                  dayCounter = as.double(dayCounter),
-                          compound = as.double(compound),
-                          businessDayConvention = as.double(businessDayConvention),
-	                  frequency = as.double(frequency),
-	                  maturityDate = maturityDate,
-	                  issueDate = issueDate),
-                 PACKAGE="RQuantLib")
+     val <- .Call("ZeroPriceByYield",
+                  list(
+                       yield=as.double(yield),
+                       faceAmount = as.double(faceAmount),
+                       dayCounter = as.double(dayCounter),
+                       compound = as.double(compound),
+                       businessDayConvention = as.double(businessDayConvention),
+                       frequency = as.double(frequency),
+                       maturityDate = maturityDate,
+                       issueDate = issueDate),
+                  PACKAGE="RQuantLib")
      class(val) <- c("ZeroPriceByYield")
      val
 }
@@ -93,17 +93,17 @@
                               dayCounter=2, frequency=2,
                               compound=0, businessDayConvention=4){
 
-     val <- .Call("QL_ZeroYield",
-                     list(
-   		          price=as.double(price),
-	                  faceAmount = as.double(faceAmount),
-	                  dayCounter = as.double(dayCounter),
-                          compound = as.double(compound),
-                          businessDayConvention = as.double(businessDayConvention),
-	                  frequency = as.double(frequency),
-	                  maturityDate = maturityDate,
-	                  issueDate = issueDate),
-                 PACKAGE="RQuantLib")
+     val <- .Call("ZeroYield",
+                  list(
+                       price=as.double(price),
+                       faceAmount = as.double(faceAmount),
+                       dayCounter = as.double(dayCounter),
+                       compound = as.double(compound),
+                       businessDayConvention = as.double(businessDayConvention),
+                       frequency = as.double(frequency),
+                       maturityDate = maturityDate,
+                       issueDate = issueDate),
+                  PACKAGE="RQuantLib")
      class(val) <- c("ZeroYield")
      val
 }
@@ -151,7 +151,7 @@
 
     dateparams <- matchParams(dateparams)
 
-    val <- .Call("QL_FixedRateWithRebuiltCurve",
+    val <- .Call("FixedRateWithRebuiltCurve",
                  bond, rates, c(discountCurve$table$date),
                  discountCurve$table$zeroRates, dateparams,
                  PACKAGE="RQuantLib")
@@ -173,7 +173,7 @@
                                 period, calendar = "us", rates,
                                 dayCounter=2, businessDayConvention=0,
                                 compound = 0, redemption = 100, issueDate) {
-     val <- .Call("QL_FixedRateBondYield",
+     val <- .Call("FixedRateBondYield",
                     list(
                          settlementDays=as.double(settlementDays),
                          price = as.double(price),
@@ -206,7 +206,7 @@
                                 period, calendar = "us", rates,
                                 dayCounter=2, businessDayConvention=0,
                                 compound = 0, redemption = 100, issueDate) {
-     val <- .Call("QL_FixedRateBondPriceByYield",
+     val <- .Call("FixedRateBondPriceByYield",
                     list(
                          settlementDays=as.double(settlementDays),
                          yield = as.double(yield),
@@ -277,7 +277,7 @@
     indexparams <- list(type=index$type, length=index$length,
                         inTermOf=index$inTermOf)
     ibor <- index$term
-    val <- .Call("QL_FloatingWithRebuiltCurve",
+    val <- .Call("FloatingWithRebuiltCurve",
                  bond, gearings, spreads, caps, floors, indexparams,
                  c(ibor$table$date), ibor$table$zeroRates,
                  c(curve$table$date), curve$table$zeroRates,
@@ -334,7 +334,7 @@
     dividendSchedule <- bondparams$divSch
     dividendYield <- process$divYield
     riskFreeRate <- process$rff
-    val <- .Call("QL_ConvertibleZeroBond",
+    val <- .Call("ConvertibleZeroBond",
                     bondparams, process,
                     c(dividendYield$table$date),
                     dividendYield$table$zeroRates,
@@ -392,7 +392,7 @@
     dividendSchedule <- bondparams$divSch
     dividendYield <- process$divYield
     riskFreeRate <- process$rff
-    val <- .Call("QL_ConvertibleFixedBond",
+    val <- .Call("ConvertibleFixedBond",
                     bondparams, coupon, process,
                     c(dividendYield$table$date),
                     dividendYield$table$zeroRates,
@@ -454,7 +454,7 @@
                         inTermOf=iborindex$inTermOf)
     ibor <- iborindex$term
 
-    val <- .Call("QL_ConvertibleFloatingBond",
+    val <- .Call("ConvertibleFloatingBond",
                     bondparams,  process,
                     c(dividendYield$table$date),
                     dividendYield$table$zeroRates,
@@ -508,7 +508,7 @@
     callSch <- bondparams$callSch
 #    hw.termStructure <- hullWhite$term
 
-    val <- .Call("QL_CallableBond", bondparams, hullWhite,coupon,
+    val <- .Call("CallableBond", bondparams, hullWhite,coupon,
 #                c(hw.termStructure$table$date),
 #                hw.termStructure$table$zeroRates,
                 callSch, dateparams,
@@ -532,7 +532,7 @@
                                     dateparams){
     val <- 0
     dateparams <- matchParams(dateparams)
-    val <- .Call("QL_FittedBondCurve", curveparams,
+    val <- .Call("FittedBondCurve", curveparams,
                  lengths, coupons, marketQuotes, dateparams, PACKAGE="RQuantLib")
 
     class(val) <- c("DiscountCurve")
@@ -554,7 +554,7 @@
 #   volMatrix <- swaptionVol$volatilityMatrix
 #   swapIndex <- matchParams(swapIndex)
 #   ibor <- iborIndex$term
-#   val <- .Call("QL_CMSBond", bondparams, iborIndex, swapIndex, cap, floor, gearings, spreads,
+#   val <- .Call("CMSBond", bondparams, iborIndex, swapIndex, cap, floor, gearings, spreads,
 #                swaptionVol, atmOptionTenors, atmSwapTenors, volMatrix, pricer
 #                ibor$table$dates, ibor$table$zeroRates)
 #}

Modified: pkg/RQuantLib/R/calendars.R
===================================================================
--- pkg/RQuantLib/R/calendars.R	2010-08-06 11:17:25 UTC (rev 292)
+++ pkg/RQuantLib/R/calendars.R	2010-08-07 15:56:13 UTC (rev 293)
@@ -24,7 +24,7 @@
 isBusinessDay <- function(calendar="TARGET", dates=Sys.Date()) {
     stopifnot(is.character(calendar))
     stopifnot(class(dates)=="Date")
-    val <- .Call("QL_isBusinessDay", calendar, dates, PACKAGE="RQuantLib")
+    val <- .Call("isBusinessDay", calendar, dates, PACKAGE="RQuantLib")
     val <- as.logical(val)
     names(val) <- dates
     val
@@ -36,7 +36,7 @@
 isHoliday <- function(calendar="TARGET", dates=Sys.Date()) {
     stopifnot(is.character(calendar))
     stopifnot(class(dates)=="Date")
-    val <- .Call("QL_isHoliday", calendar, dates, PACKAGE="RQuantLib")
+    val <- .Call("isHoliday", calendar, dates, PACKAGE="RQuantLib")
     val <- as.logical(val)
     names(val) <- dates
     val
@@ -45,7 +45,7 @@
 isWeekend <- function(calendar="TARGET", dates=Sys.Date()) {
     stopifnot(is.character(calendar))
     stopifnot(class(dates)=="Date")
-    val <- .Call("QL_isWeekend", calendar, dates, PACKAGE="RQuantLib")
+    val <- .Call("isWeekend", calendar, dates, PACKAGE="RQuantLib")
     val <- as.logical(val)
     names(val) <- dates
     val
@@ -54,7 +54,7 @@
 isEndOfMonth <- function(calendar="TARGET", dates=Sys.Date()) {
     stopifnot(is.character(calendar))
     stopifnot(class(dates)=="Date")
-    val <- .Call("QL_isEndOfMonth", calendar, dates, PACKAGE="RQuantLib")
+    val <- .Call("isEndOfMonth", calendar, dates, PACKAGE="RQuantLib")
     val <- as.logical(val)
     names(val) <- dates
     val
@@ -63,7 +63,7 @@
 getEndOfMonth <- function(calendar="TARGET", dates=Sys.Date()) {
     stopifnot(is.character(calendar))
     stopifnot(class(dates)=="Date")
-    val <- .Call("QL_endOfMonth", calendar, dates, PACKAGE="RQuantLib")
+    val <- .Call("endOfMonth", calendar, dates, PACKAGE="RQuantLib")
     names(val) <- dates
     val
 }
@@ -75,7 +75,7 @@
 adjust <- function(calendar="TARGET", dates=Sys.Date(), bdc = 0 ) {
     stopifnot(is.character(calendar))
     stopifnot(class(dates)=="Date")
-    val <- .Call("QL_adjust", calendar, as.double(bdc), dates, PACKAGE="RQuantLib")
+    val <- .Call("adjust", calendar, as.double(bdc), dates, PACKAGE="RQuantLib")
     names(val) <- dates
     val
 }
@@ -91,7 +91,7 @@
     stopifnot(call1 | call2)
     val <- NULL
     if (call1)
-        val <- .Call("QL_advance1",
+        val <- .Call("advance1",
                      calendar,
                      list(amount = as.double(n),
                           unit = as.double(timeUnit),
@@ -100,7 +100,7 @@
                      dates,
                      PACKAGE="RQuantLib")
     if (call2)
-        val <- .Call("QL_advance2",
+        val <- .Call("advance2",
                      calendar,
                      list(period = as.double(period),
                           bdc = as.double(bdc),
@@ -120,7 +120,7 @@
     stopifnot(is.character(calendar))
     stopifnot(class(from)=="Date")
     stopifnot(class(to)=="Date")
-    val <- .Call("QL_businessDaysBetween",
+    val <- .Call("businessDaysBetween",
                  calendar,
                  list(includeFirst = as.double(includeFirst),
                       includeLast = as.double(includeLast)),
@@ -137,7 +137,7 @@
     stopifnot(is.character(calendar))
     stopifnot(class(from)=="Date")
     stopifnot(class(to)=="Date")
-    val <- .Call("QL_holidayList",
+    val <- .Call("holidayList",
                  calendar,
                  list(includeWeekends=as.double(includeWeekends), from=from, to=to),
                  PACKAGE="RQuantLib")
@@ -151,7 +151,7 @@
 setCalendarContext <- function(calendar="TARGET",
                                fixingDays = 2,
                                settleDate = Sys.Date() + 2) {
-    val <- .Call("QL_setContext",
+    val <- .Call("setContext",
                  list(calendar = calendar,
                       fixingDays = fixingDays,
                       settleDate = settleDate),

Modified: pkg/RQuantLib/R/discount.R
===================================================================
--- pkg/RQuantLib/R/discount.R	2010-08-06 11:17:25 UTC (rev 292)
+++ pkg/RQuantLib/R/discount.R	2010-08-07 15:56:13 UTC (rev 293)
@@ -44,7 +44,7 @@
     }
 
     ## Finally ready to make the call...
-    val <- .Call("QL_DiscountCurve", params, tsQuotes, times, PACKAGE="RQuantLib")
+    val <- .Call("DiscountCurve", params, tsQuotes, times, PACKAGE="RQuantLib")
     class(val) <- c("DiscountCurve")
     val
 }

Modified: pkg/RQuantLib/R/hullWhiteCalibration.R
===================================================================
--- pkg/RQuantLib/R/hullWhiteCalibration.R	2010-08-06 11:17:25 UTC (rev 292)
+++ pkg/RQuantLib/R/hullWhiteCalibration.R	2010-08-07 15:56:13 UTC (rev 293)
@@ -27,7 +27,7 @@
   indexparams <- list(type=index$type);
   ibor <- index$term
 
-  val <- .Call("QL_HullWhiteCalibrationUsingCap",
+  val <- .Call("HullWhiteCalibrationUsingCap",
                termStrc$table$date,
                termStrc$table$zeroRates,
                capData,
@@ -44,7 +44,7 @@
   indexparams <- list(type=index$type);
   ibor <- index$term
 
-  val <- .Call("QL_HullWhiteCalibrationUsingSwap",
+  val <- .Call("HullWhiteCalibrationUsingSwap",
                termStrc$table$date,
                termStrc$table$zeroRates,
                swapData,

Modified: pkg/RQuantLib/R/implied.R
===================================================================
--- pkg/RQuantLib/R/implied.R	2010-08-06 11:17:25 UTC (rev 292)
+++ pkg/RQuantLib/R/implied.R	2010-08-07 15:56:13 UTC (rev 293)
@@ -31,7 +31,7 @@
 EuropeanOptionImpliedVolatility.default <-
   function(type, value, underlying, strike, dividendYield,
             riskFreeRate, maturity, volatility) {
-  val <- .Call("QL_EuropeanOptionImpliedVolatility",
+  val <- .Call("EuropeanOptionImpliedVolatility",
                list(type=as.character(type),
 		    value=as.double(value),
                     underlying=as.double(underlying),
@@ -56,7 +56,7 @@
 AmericanOptionImpliedVolatility.default <-
   function(type, value, underlying, strike, dividendYield, riskFreeRate,
             maturity, volatility, timeSteps=150, gridPoints=151) {
-  val <- .Call("QL_AmericanOptionImpliedVolatility",
+  val <- .Call("AmericanOptionImpliedVolatility",
                list(type=as.character(type),
 		    value=as.double(value),
                     underlying=as.double(underlying),
@@ -84,7 +84,7 @@
 BinaryOptionImpliedVolatility.default <-
   function(type, value, underlying, strike, dividendYield, riskFreeRate,
             maturity, volatility, cashPayoff=1) {
-  val <- .Call("QL_BinaryOptionImpliedVolatility",
+  val <- .Call("BinaryOptionImpliedVolatility",
                list(type=as.character(type),
 		    value=as.double(value),
                     underlying=as.double(underlying),

Modified: pkg/RQuantLib/R/option.R
===================================================================
--- pkg/RQuantLib/R/option.R	2010-08-06 11:17:25 UTC (rev 292)
+++ pkg/RQuantLib/R/option.R	2010-08-07 15:56:13 UTC (rev 293)
@@ -29,7 +29,7 @@
                                    riskFreeRate, maturity, volatility) {
 
     type <- match.arg(type, c("call", "put"))
-    val <- .Call("QL_EuropeanOption",
+    val <- .Call("EuropeanOption",
                  list(type=as.character(type),
                       underlying=as.double(underlying),
                       strike=as.double(strike),
@@ -52,7 +52,7 @@
                                    riskFreeRate, maturity, volatility,
                                    timeSteps=150, gridPoints=151) {
     type <- match.arg(type, c("call", "put"))
-    val <- .Call("QL_AmericanOption",
+    val <- .Call("AmericanOption",
                  list(type=as.character(type),
                       underlying=as.double(underlying),
                       strike=as.double(strike),
@@ -85,7 +85,7 @@
     type <- match.arg(type, c("call", "put"))
     binType <- match.arg(binType, c("cash", "asset", "gap"))
     excType <- match.arg(excType, c("american", "european"))
-    val <- .Call("QL_BinaryOption",
+    val <- .Call("BinaryOption",
                  list(binType=as.character(binType),
                       type=as.character(type),
                       excType=as.character(excType),
@@ -112,7 +112,7 @@
                                   volatility, barrier, rebate=0.0) {
     type <- match.arg(type, c("call", "put"))
     barrType <- match.arg(barrType, c("downin", "upin", "downout", "upout"))
-    val <- .Call("QL_BarrierOption",
+    val <- .Call("BarrierOption",
                  list(barrType=as.character(barrType),
                       type=as.character(type),
                       underlying=as.double(underlying),

Modified: pkg/RQuantLib/inst/ChangeLog
===================================================================
--- pkg/RQuantLib/inst/ChangeLog	2010-08-06 11:17:25 UTC (rev 292)
+++ pkg/RQuantLib/inst/ChangeLog	2010-08-07 15:56:13 UTC (rev 293)
@@ -1,3 +1,8 @@
+2010-08-07  Dirk Eddelbuettel  <edd at dexter>
+
+	* src/*cpp: Drop QL_ prefix from functions called from R
+	* R/*: Drop QL_ prefix in functions called by .Call()
+
 2010-08-06  Dirk Eddelbuettel  <edd at debian.org>
 
 	* src/rquantlib.hpp: Renamed to rquantlib.h to suppress a warning

Modified: pkg/RQuantLib/src/asian.cpp
===================================================================
--- pkg/RQuantLib/src/asian.cpp	2010-08-06 11:17:25 UTC (rev 292)
+++ pkg/RQuantLib/src/asian.cpp	2010-08-07 15:56:13 UTC (rev 293)
@@ -25,7 +25,7 @@
 
 #include <rquantlib.h>
 
-RcppExport SEXP QL_AsianOption(SEXP optionParameters){
+RcppExport SEXP AsianOption(SEXP optionParameters){
 
     try{
         Rcpp::List rparam(optionParameters);

Modified: pkg/RQuantLib/src/barrier_binary.cpp
===================================================================
--- pkg/RQuantLib/src/barrier_binary.cpp	2010-08-06 11:17:25 UTC (rev 292)
+++ pkg/RQuantLib/src/barrier_binary.cpp	2010-08-07 15:56:13 UTC (rev 293)
@@ -24,7 +24,7 @@
 
 #include "rquantlib.h"
 
-RcppExport  SEXP QL_BinaryOption(SEXP optionParameters) {
+RcppExport SEXP BinaryOption(SEXP optionParameters) {
 
     try {
         Rcpp::List rparam(optionParameters);
@@ -125,7 +125,7 @@
 
 // dumped core when we tried last
 // no longer under 0.3.10 and g++ 4.0.1 (Aug 2005)
-RcppExport  SEXP QL_BinaryOptionImpliedVolatility(SEXP optionParameters) {
+RcppExport SEXP BinaryOptionImpliedVolatility(SEXP optionParameters) {
 
     try {
 
@@ -186,7 +186,7 @@
     return R_NilValue;
 }
 
-RcppExport  SEXP QL_BarrierOption(SEXP optionParameters) {
+RcppExport SEXP BarrierOption(SEXP optionParameters) {
 
     try {
 
@@ -255,11 +255,12 @@
 
         boost::shared_ptr<PricingEngine> engine(new AnalyticBarrierEngine(stochProcess));
 
-        BarrierOption barrierOption(barrierType,
-                                    barrier,
-                                    rebate,
-                                    payoff,
-                                    exercise);
+        // need to explicitly reference BarrierOption from QuantLib here
+        QuantLib::BarrierOption barrierOption(barrierType,
+                                              barrier,
+                                              rebate,
+                                              payoff,
+                                              exercise);
         barrierOption.setPricingEngine(engine);
 
         Rcpp::List rl = Rcpp::List::create(Rcpp::Named("value") = barrierOption.NPV(),

Modified: pkg/RQuantLib/src/bermudan.cpp
===================================================================
--- pkg/RQuantLib/src/bermudan.cpp	2010-08-06 11:17:25 UTC (rev 292)
+++ pkg/RQuantLib/src/bermudan.cpp	2010-08-07 15:56:13 UTC (rev 293)
@@ -45,9 +45,9 @@
     }	
 }	
 
-RcppExport SEXP QL_BermudanSwaption(SEXP params, SEXP tsQuotes, 
-                                    SEXP maturities, SEXP tenors, 
-                                    SEXP vols) {
+RcppExport SEXP BermudanSwaption(SEXP params, SEXP tsQuotes, 
+                                 SEXP maturities, SEXP tenors, 
+                                 SEXP vols) {
 
     try {
 

Modified: pkg/RQuantLib/src/bonds.cpp
===================================================================
--- pkg/RQuantLib/src/bonds.cpp	2010-08-06 11:17:25 UTC (rev 292)
+++ pkg/RQuantLib/src/bonds.cpp	2010-08-07 15:56:13 UTC (rev 293)
@@ -28,7 +28,7 @@
 using namespace boost;
 
 
-RcppExport SEXP QL_ZeroPriceByYield(SEXP optionParameters) {
+RcppExport SEXP ZeroPriceByYield(SEXP optionParameters) {
 
     try {
         Rcpp::List rparam(optionParameters);
@@ -71,7 +71,7 @@
 }
 
 
-RcppExport SEXP QL_ZeroYield(SEXP optionParameters) {
+RcppExport SEXP ZeroYield(SEXP optionParameters) {
 
     try {
         Rcpp::List rparam(optionParameters);
@@ -114,9 +114,9 @@
 }
 
 
-RcppExport SEXP QL_ZeroBond(SEXP bondparam, 
-                            Handle<YieldTermStructure> &discountCurve,
-                            SEXP dateparams) {
+RcppExport SEXP ZeroBond(SEXP bondparam, 
+                         Handle<YieldTermStructure> &discountCurve,
+                         SEXP dateparams) {
 
     try {
         Rcpp::List rparam(bondparam);
@@ -176,9 +176,9 @@
 }
 
 
-RcppExport SEXP QL_FixedBond(SEXP bondparam, SEXP ratesVec,
-                             Handle<YieldTermStructure> &discountCurve,
-                             SEXP dateparams){
+RcppExport SEXP FixedBond(SEXP bondparam, SEXP ratesVec,
+                          Handle<YieldTermStructure> &discountCurve,
+                          SEXP dateparams){
 
     try {
         Rcpp::List rparam(bondparam);
@@ -249,7 +249,7 @@
 }
    
 
-RcppExport  SEXP QL_FixedRateBondYield(SEXP optionParameters, SEXP ratesVec) {
+RcppExport SEXP FixedRateBondYield(SEXP optionParameters, SEXP ratesVec) {
   
     try {
         Rcpp::List rparam(optionParameters);
@@ -307,7 +307,7 @@
 }
 
  
-RcppExport SEXP QL_FixedRateBondPriceByYield(SEXP optionParameters, SEXP ratesVec) {
+RcppExport SEXP FixedRateBondPriceByYield(SEXP optionParameters, SEXP ratesVec) {
   
     try {
         Rcpp::List rparam(optionParameters);
@@ -365,12 +365,12 @@
 }
 
 
-SEXP QL_FloatingBond(SEXP bondparam, SEXP gearingsVec, SEXP spreadsVec,
-                     SEXP capsVec, SEXP floorsVec, 
-                     Handle<YieldTermStructure> &index,
-                     SEXP indexparams,
-                     Handle<YieldTermStructure> &discountCurve,
-                     SEXP dateparams) 
+SEXP FloatingBond(SEXP bondparam, SEXP gearingsVec, SEXP spreadsVec,
+                  SEXP capsVec, SEXP floorsVec, 
+                  Handle<YieldTermStructure> &index,
+                  SEXP indexparams,
+                  Handle<YieldTermStructure> &discountCurve,
+                  SEXP dateparams) 
 {
   
     try {
@@ -465,19 +465,18 @@
     return R_NilValue;
 }
 
-RcppExport SEXP QL_FloatBond1(SEXP bond, SEXP gearings, SEXP caps,
-                              SEXP spreads,
-                              SEXP floors, SEXP indexparams, SEXP index, 
-                              SEXP discountCurve, SEXP dateparams)
+RcppExport SEXP FloatBond1(SEXP bond, SEXP gearings, SEXP caps, SEXP spreads,
+                           SEXP floors, SEXP indexparams, SEXP index, 
+                           SEXP discountCurve, SEXP dateparams)
 {
     
     try{
 
         Handle<YieldTermStructure> discount_curve(getFlatCurve(discountCurve));
         Handle<YieldTermStructure> ibor_curve(getFlatCurve(index));
-        return Rcpp::wrap(QL_FloatingBond(bond, gearings, caps, spreads,
-                                          floors, ibor_curve, indexparams,
-                                          discount_curve, dateparams));       
+        return Rcpp::wrap(FloatingBond(bond, gearings, caps, spreads,
+                                       floors, ibor_curve, indexparams,
+                                       discount_curve, dateparams));       
         
     } catch(std::exception &ex) { 
         forward_exception_to_r(ex); 
@@ -489,11 +488,10 @@
 }
 
 
-RcppExport SEXP QL_FloatBond2(SEXP bond, SEXP gearings, SEXP caps,
-                              SEXP spreads,
-                              SEXP floors, SEXP indexparams, SEXP index_params, 
-                              SEXP index_tsQuotes, SEXP index_times,
-                              SEXP discountCurve, SEXP dateparams)
+RcppExport SEXP FloatBond2(SEXP bond, SEXP gearings, SEXP caps, SEXP spreads,
+                           SEXP floors, SEXP indexparams, SEXP index_params, 
+                           SEXP index_tsQuotes, SEXP index_times,
+                           SEXP discountCurve, SEXP dateparams)
 {
     
     try{
@@ -502,9 +500,9 @@
         Handle<YieldTermStructure> ibor_curve(buildTermStructure(index_params,
                                                                  index_tsQuotes,
                                                                  index_times));
-        return Rcpp::wrap(QL_FloatingBond(bond, gearings, caps, spreads,
-                                          floors, ibor_curve, indexparams,
-                                          discount_curve, dateparams));       
+        return Rcpp::wrap(FloatingBond(bond, gearings, caps, spreads,
+                                       floors, ibor_curve, indexparams,
+                                       discount_curve, dateparams));       
         
     } catch(std::exception &ex) { 
         forward_exception_to_r(ex); 
@@ -516,11 +514,11 @@
 }
 
 
-RcppExport SEXP QL_FloatBond3(SEXP bond, SEXP gearings, SEXP caps,
-                              SEXP spreads, SEXP floors, 
-                              SEXP indexparams, SEXP index, 
-                              SEXP discount_params, SEXP discount_tsQuotes,
-                              SEXP discount_times, SEXP dateparams)
+RcppExport SEXP FloatBond3(SEXP bond, SEXP gearings, SEXP caps,
+                           SEXP spreads, SEXP floors, 
+                           SEXP indexparams, SEXP index, 
+                           SEXP discount_params, SEXP discount_tsQuotes,
+                           SEXP discount_times, SEXP dateparams)
 {
     
     try {
@@ -529,9 +527,9 @@
         Handle<YieldTermStructure> discount_curve(buildTermStructure(discount_params,
                                                                      discount_tsQuotes,
                                                                      discount_times));
-        return Rcpp::wrap(QL_FloatingBond(bond, gearings, caps, spreads,
-                                          floors, ibor_curve, indexparams,
-                                          discount_curve, dateparams));       
+        return Rcpp::wrap(FloatingBond(bond, gearings, caps, spreads,
+                                       floors, ibor_curve, indexparams,
+                                       discount_curve, dateparams));       
         
     } catch(std::exception &ex) { 
         forward_exception_to_r(ex); 
@@ -543,12 +541,12 @@
 }
 
 
-RcppExport SEXP QL_FloatBond4(SEXP bond, SEXP gearings, SEXP caps,
-                              SEXP spreads, SEXP floors, 
-                              SEXP indexparams, SEXP index_params, 
-                              SEXP index_tsQuotes, SEXP index_times,
-                              SEXP discount_params, SEXP discount_tsQuotes,
-                              SEXP discount_times, SEXP dateparams)
+RcppExport SEXP FloatBond4(SEXP bond, SEXP gearings, SEXP caps,
+                           SEXP spreads, SEXP floors, 
+                           SEXP indexparams, SEXP index_params, 
+                           SEXP index_tsQuotes, SEXP index_times,
+                           SEXP discount_params, SEXP discount_tsQuotes,
+                           SEXP discount_times, SEXP dateparams)
 {
     
     try {
@@ -560,9 +558,9 @@
         Handle<YieldTermStructure> discount_curve(buildTermStructure(discount_params,
                                                                  discount_tsQuotes,
                                                                  discount_times));
-        return Rcpp::wrap(QL_FloatingBond(bond, gearings, caps, spreads,
-                                          floors, ibor_curve, indexparams,
-                                          discount_curve, dateparams));       
+        return Rcpp::wrap(FloatingBond(bond, gearings, caps, spreads,
+                                       floors, ibor_curve, indexparams,
+                                       discount_curve, dateparams));       
         
     } catch(std::exception &ex) { 
         forward_exception_to_r(ex); 
@@ -573,20 +571,20 @@
     return R_NilValue;
 }
 
-RcppExport SEXP QL_FloatingWithRebuiltCurve(SEXP bondparams, SEXP gearings,
-                                            SEXP spreads, SEXP caps,
-                                            SEXP floors, SEXP indexparams,
-                                            SEXP iborDateSexp, SEXP iborzeroSexp,
-                                            SEXP dateSexp, SEXP zeroSexp,
-                                            SEXP dateparams) {
+RcppExport SEXP FloatingWithRebuiltCurve(SEXP bondparams, SEXP gearings,
+                                         SEXP spreads, SEXP caps,
+                                         SEXP floors, SEXP indexparams,
+                                         SEXP iborDateSexp, SEXP iborzeroSexp,
+                                         SEXP dateSexp, SEXP zeroSexp,
+                                         SEXP dateparams) {
 
     try {
         Handle<YieldTermStructure> ibor_curve(rebuildCurveFromZeroRates(iborDateSexp, iborzeroSexp));       
         Handle<YieldTermStructure> curve(rebuildCurveFromZeroRates(dateSexp, zeroSexp));       
         
-        SEXP flrtbond = QL_FloatingBond(bondparams, gearings, caps, spreads,
-                                        floors, ibor_curve, indexparams,
-                                        curve, dateparams);
+        SEXP flrtbond = FloatingBond(bondparams, gearings, caps, spreads,
+                                     floors, ibor_curve, indexparams,
+                                     curve, dateparams);
         return flrtbond;
 
     } catch(std::exception &ex) { 
@@ -599,12 +597,12 @@
 }
 
 
-RcppExport SEXP QL_FixedRateWithRebuiltCurve(SEXP bondparam, SEXP ratesVec,
-                                             SEXP dateSexp, SEXP zeroSexp,
-                                             SEXP dateparams){
+RcppExport SEXP FixedRateWithRebuiltCurve(SEXP bondparam, SEXP ratesVec,
+                                          SEXP dateSexp, SEXP zeroSexp,
+                                          SEXP dateparams){
     try {
         Handle<YieldTermStructure> curve(rebuildCurveFromZeroRates(dateSexp, zeroSexp));
-        return Rcpp::wrap(QL_FixedBond(bondparam, ratesVec, curve, dateparams));
+        return Rcpp::wrap(FixedBond(bondparam, ratesVec, curve, dateparams));
         
     } catch(std::exception &ex) { 
         forward_exception_to_r(ex); 
@@ -616,13 +614,13 @@
 }
 
 
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/rquantlib -r 293


More information about the Rquantlib-commits mailing list