Authors@RisnowusedinDESCRIPTIONasmandatedbyCRAN
ChangesinRcppAttributes:
ChangesinRcppDocumentation:
TheRcpp.bibfilehasbeenrefreshedtocurrentpackageversions.
SeveralGitHubActionshavebeenupdated.
Accomodatefourdigitversionnumbersinunittest(Dirk)
SmallupdatestotheCItestcontainershavebeenmade
Someofchangesalsoappliedtoaninterimrelease1.0.8.3madeforCRANon2022-03-14.
ForthcomingChangesinRcppAPI:
ChangesinRcppsupportfunctions:
Rcpp.package.skeleton()avoidswarningfromR.(Dirk)
ChangesinRcppSugar:
Thepdffileoftheearlierintroductionisagaintypesetwithbibliographicinformation(Dirk).
ThedefaultCIrunnerwasupgradedtoR4.0.0(Dirk).
TheCImatrixspansR3.5,3.6,r-releaseandr-devel(Dirk).
The.github/directorynowhasmoreexplicitguidanceoncontributing,issues,andpullrequests(Dirk).
Thebibfileforthevignettewasonceagainupdatedtocurrentpackageversions(Dirk).
ChangesinRcppModules:
Minorwhitespacealignmentsandeditsweremadeinthreevignettesfollowingthenewpinprelease(Dirk).
NewbadgesforDOIandCRANandBioConductorreversedependencieshavebeenaddedtoREADME.md(Dirk).
Errormessagesfromsubsettingarenowmoreinformative(QiangandDirk).
HappytenthbirthdaytoRcpp,andhellorelease1.0!
TheemptydestructorfortheDateclasswasremovedtopleaseg++-9(prerelease)and-Wdeprecated-copy(Dirk).
TheDockerfileforContinuousIntegrationsetstherequiredtestflag(forreleaseversions)insidethecontainer(Dirk).
CorrecttheRCMDcheckcalltoskipvignettes(Dirk).
Severalvignettesnowusethecollapseargumenttoshowoutputinthecorrespondingcodeblock.
Anewclass,SuspendRNGSynchronizationScope,canbecreatedandusedtoensurethatcallstoRcppfunctionsdonotattempttocall::GetRNGstate()or::PutRNGstate()forthedurationofsomecodeblock.
TwointernallinkstotheintroductionpublishedinJSShavebeenupdatedtothechangedfilenamegiventhenewerTASintroduction.
AcitationtotheRcppintroducionintheTheAmericanStatisticianhasbeenaddedtotheintroductoryandFAQvignettes.
TheRcppFAQvignetteisnowindexedas'Rcpp-FAQ';astaleGmanereferencewasremovedandentryforgettingcompilersunderCondawasadded.
Thetop-levelREADME.mdnowhasaSupportsection.
TheRcpp.bibreferencefilewasrefreshedtocurrentversions.
TheRcppFAQnowshowsRcpp::Rcpp.plugin.maker()andnottheoutdated:::useapplicablenon-exportedfunctions.
NewDateVectorandDatetimeVectorclassesarenowthedefaultfullydeprecatingtheoldclassesasannouncedoneyearago.
ChangesinRcppPackage:
DESCRIPTIONfilenowlistdoiinformationperCRANsuggestion.
UpdateCITATIONfilewithdoiinformationandPeerJpreprint.
Addedanewvignette‘Rcpp-introduction’basedonnewPeerJpreprint,renamedexistingintroductionto‘Rcpp-jss-2011’.
TheC++17standardissupportedwithanewplugin(usedegforg++-6.2).
AnoverdueexplanationofhowC++11,C++14,andC++17canbeusedwasaddedtotheRcppFAQ.
ChangesinRcppunittests
ChangesinRcppbuildsystem
Atestforexpressionvectorswascorrected.
TheconstructortestfordatetimevectorsreflectsthenewclasseswhichtreatsInfcorrectly(andstillasanon-finitevalue)
ChangesinRcppAttributes
UpdatedDateandDatetimevectorclasses:
BydefiningRCPP_NEW_DATE_DATETIME_VECTORSthenewclassescanactivated.Weintendtomakethenewclassesthedefaultnosoonerthantwelvemonthsfromthisrelease.
Thecapabilities()functioncanalsobeusedforpresenceofthisfeature
ChangesinRcppExamples:
TheRcpp-attributesvignetteisnowmentionedmoreprominentlyinquestiononeoftheRcppFAQvignette.
ThebibfilewasupdatedwithrespecttotherecentJSSpublicationforRProtoBuf.
CorrecthandlingofdependentfilepathsonWindows(usewinslash="/").
TheRcpp-FAQvignettenowcontainsatableofcontent.
ChangesinRcppRepository:
EnableexportofC++interfaceforfunctionsthatreturnvoid.
TheNEWSfilenowlinkstoGitHubissueticketsandpullrequests.
TheRcpp.bibfilewithbibliographicreferenceswasupdated.
CorrectuseofWIN32insteadof_WIN32topleaseWindows10
Rcpp_eval()nolongerusesR_ToplevelExecwhenevaluatingRexpressions;thisshouldresolveerrorswherecallinghandlers(e.g.throughsuppressMessages())werenotproperlyrespected.
Usemorerobustmethodofensuringuniquepathsforgeneratedsharedlibraries.
TheevalCppfunctionnowalsosupportsthepluginsargument.
Correctlyhandlesignatureterminationcharacters('{'or';')containedinquotes.
TheincludedRcpp.bibbibtexfile(whichisalsousedbyotherRcpp*packages)wasupdatedwithrespecttoitsCRANreferences.
Theunwindingofexceptionswasrefinedtoprotectagainstinadvertentmemoryleaks.
Headerfilesnowtryevenhardernottoletmacrodefinitionsleak.
Matriceshaveanewdefaultconstructorforzero-by-zerodimensionmatrices(viaapullrequestbyDmitriiMeleshko).
Anewempty()stringconstructorwasadded(viaanotherpullrequest).
BettersupportforVectorswithastoragepolicydifferentfromthedefault,i.e.NoProtectStorage,wasadded.
Rtools3.3isnowsupported.
Anerrorhandlerfortinyformatwasdefinedtopreventtheassert()macrofromspilling.
TheRcpp::warningfunctionwasaddedasawrapperforRf_warning.
TheXPtrclasswasextendedwithnewchecked_getandreleasefunctionsaswellasimprovedbehavior(throwanexceptionratherthancrash)whenaNULLexternalpointerisdereferenced.
RcodeisevaluatedwithinanR_toplevelExecblocktopreventuserinterruptsfrombypassingC++destructorsonthestack.
TheRcpp::Environmentconstructorcannowuseasuppliedparentenvironment.
TheRcpp::Functionconstructorcannowuseasuppliedenvironmentornamespace.
Theattributes_hiddenmacrofromRisusedtoshieldinternalfunctions;theR_ext/Visibility.hheaderisnowincludedaswell.
ARcpp::printfunctionwasaddedasawrapperaroundRf_PrintValue.
Thepkg_types.hfileisnowincludedinRcppExports.cppifitispresentineithertheinst/includeorsrc.
sourceCppwasmodifiedtoallowincludesoflocalfiles(e.g.#include"foo.hpp").Implementationfiles(*.cc;*.cpp)correspondingtolocalincludesarealsoautomaticallybuiltiftheyexist.
ThegeneratedattributescodewassimplifiedwithrespecttoRNGScopeandnowusesRObjectanditsdestructorratherthanSEXPprotect/unprotect.
SupportadditionoftherngparameterinRcpp::exporttosuppresstheotherwiseautomaticinclusionofRNGScopeingeneratedcode.
Attributescodewasmademorerobustandcane.g.nolongerrecurse.
Version3.2oftheRtoolsisnowcorrectlydetectedaswell.
Allow'R'tocomeimmediatelyafter'***'fordefiningembeddedRcodechunksinsourceCpp.
Theattributesvignettehasbeenupdatedwithdocumentationonnewfeaturesaddedoverthepastseveralreleases.
ChangesinRcpptests:
OnTravisCI,allbuilddependenciesareinstalledasbinary.debpackagesresultinginfastertests.
TheListOf
The[dpq]nbinom_mu()scalarfunctionsarenowavailableviatheR::namespacewhenR3.1.2ornewerisused.
AddanadditionaltestforAIXbeforeattemptingtoincludeexecinfo.h.
Rcpp::stopnowsupportsimprovedprintf-likesyntaxusingthesmalltinyformatheader-onlylibrary(followingasimilarimplementationinRcpp11)
PairlistobjectsarenowprotectedviaanadditionalShield<>assuggestedbyMartinMorganonthercpp-devellist.
SortingisnowprohibitedatcompiletimeforobjectsoftypeList,RawVectorandExpressionVector.
VectorsnowhaveaVector::const\_iteratorthatis'constcorrect'thankstofixbyRomainfollowingabugreportinrcpp-develbyMartynPlummer.
Themean()sugarfunctionnowusesamorerobusttwo-passmethod,andnewunittestsformean()wereaddedatthesametime.
Themean()andvar()functionsnowsupportallcorevectortypes.
Thesetequal()sugarfunctionhasbeencorrectedviasuggestionbyQiangKoufollowingabugreportbySrenHjsgaard.
Themacrosmajor,minor,andmakedevnolongerleakinfromthe(Linux)systemheadersys/sysmacros.h.
Thepush_front()stringfunctionwascorrected.
Onlylookforpluginsinthepackage'snamespace(ratherthanentiresearchpath).
AlsoscanheaderfilesfordefinitionsoffunctionstobeconsiderdbyAttributes.
Correcttheregularexpressionforsourcefileswhicharescanned.
Addedanewbinarytestwhichwillloadapre-builtpackagetoensurethattheApplicationBinaryInterface(ABI)didnotchange;thistestwill(mostlyor)onlyrunatTraviswherewehavereasonablecontrolovertheplatformrunningthetestandcanprovideabinary.
Newunittestsforsugarfunctionsmean,setequalandvarwereaddedasnotedabove.
Forthe(old)examplesConvolveBenchmarksandOpenMP,therespectiveMakefilewasrenamedtoGNUmakefiletopleaseRCMDcheckaswellastheCRANMaintainers.
ThedeprecationofRCPP_FUNCTION_*whichwasannouncedwithrelease0.10.5lastyearisproceedingasplanned,andthefilemacros/preprocessor_generated.hhasbeenremoved.
Timernolongerrecordstimebetweensteps,buttimesfromtheorigin.Italsogainsaget_timers(int)methodsthatcreatesavectorofTimerthathavethesameorigin.ThisismodelledontheRcpp11implementationandismoreusefulforsituationswhereweusetimersinseveralthreads.Timeralsogainsaconstructortakingananotime_ttouseasitsorigin,andaoriginmethod.Thiscanbeusefulforsituationswherethenumberofthreadsisnotknowninadvancebutwestillwanttotrackwhatgoesonineachthread.
Acasttoboolwasremovedinthevectorproxycodeasinconsistentbehaviourbetweenclangandg++compilationswasnoticed.
Amissingupdate(SEXP)methodwasaddedthankstopullrequestbyOmarAndresZapataMesa.
AproxyforDimNameswasadded.
Ano_initoptionwasaddedforMatricesandVectors.
TheInternalFunctionclasswasupdatedtoworkwithstd::function(providedasuitableC++11compilerisavailable)viaapullrequestbyChristianAuthmann.
Anew_env()functionwasaddedtoEnvironment.h
ThereturnvalueofrangeeraserforVectorswasfixedinapullrequestbyYixuanQiu.
Inifelse(),thereturnedNAtypewascorrectedforoperator[].
IncludeLinkingToinDESCRIPTIONfieldsscannedtoconfirmthatC++dependenciesarereferencedbypackage.
AdddryRunparametertosourceCpp.
CorrectedissuewithrelativepathandRchunkuseforsourceCpp.
TheRcpp-FAQvignettewasupdatedwithrespecttoOSXissues.
AnewentryintheRcpp-FAQclarifiestheuseoflicenses.
Vignettesbuildresultsnolongercopiedto/tmptopleaseCRAN.
TheDescriptioninDESCRIPTIONhasbeenshortened.
Themodules=TRUEcaseforRcpp.package.skeleton()hasbeenimprovedandnowrunswithoutcomplaintsfromRCMDcheckaswell.
ChangesinRcppunittestfunctions:
ThetestRcppModuleandtestRcppClasssamplepackagesnowpassRCMDcheck--as-crancleanlywithNOTESorWARNINGS
Implicitconversions,e.g.betweenNumericVectorandIntegerVector,willnowgivewarningsifyouuse\#defineRCPP_WARN_ON_COERCEbeforeincludingtheRcppheaders.
TemplatedListcontainers,ListOf
Inanumberofinstances,returnedresultsareprotectedand/orcastmorecarefully.
Trailinglinecommentsarenowstrippedbytheattributesparser.ThisallowstheparsertohandleC++sourcefilescontainingcommentsinlinewithfunctionarguments.
TheUSE_CXX1Xenvironmentvariableisnowdefinedbythecpp11pluginwhenR>=3.1.TwoadditionalpluginshavebeenaddedforusewithC++0x(egwhenusingg++4.6.*asonWindows)aswellasC++1yforcompilersbeginningtosupportthenextrevisionofthestandard;additionalfallbackisprovidedforWindows.
compileAttributes()nowalsoconsidersImports:whichmaysuppressawarningwhenrunningRcpp.package.skeleton().
AddmissingdefaultconstructortoReferenceclassthatwasomittedintheheader-onlyrewrite
FixesforNAandNaNhandlingoftheIndexHashclass,aswellasthevector.sort()method.ThesefixesensurethatsugarfunctionsdependingonIndexHash(i.e.unique(),sort_unique(),match())willnowproperlyhandleNAandNaNvaluesfornumericvectors.
DataFrame::nrowsnowmoreaccuratelymimicsR'sinternalbehavior(checkstherow.namesattribute)
NumerouschangestopermitcompilationontheSolarisOS
Rcppvectorsgainasubsettingmethod–itisnowpossibletosubsetanRcppvectorusingCharacterVectors(subsetbyname),LogicalVectors(logicalsubsetting),andIntegerVectors(0-basedindexsubsetting).SuchsubsettingwillalsoworkwithRcppsugarexpressions,enablingexpressionssuchasx[x>0].
Commainitialization(e.g.CharacterVectorx="a","b","c";,hasbeendisabled,asitcausesproblemswiththebehaviorofthe=operatorwithRcpp::Lists.Userswhowanttore-enablethisfunctionalitycanuse#defineRCPP_COMMA_INITIALIZATION,butbeawareoftheabovecaveat.ThemoreverboseCharacterVectorx=CharacterVector::create("a","b","c")ispreferred.
FixissuepreventingpackageswithRcpp::interfacesattributefromcompiling.
Fixbehaviorwithattributesparsingof::createfordefaultarguments,andalsoallowconstructorsofagivensize(e.g.NumericVectorv=NumericVector(10))givesadefaultvalueofnumeric(10)attheRlevel).AlsomakeNAspreservetypewhenexportedtoR(e.g.NA_STRINGasadefaultargumentmapstoNA_character_attheRlevel)
ChangesinRcppmodules
Correctedtheun_pointerimplementationforobject
UpdatedtheRcpp.package.skeleton()functionaccordingly.
NewclassStretchyListforpairlistswithfastadditionofelementsatthefrontandback.Thisabstractsthe3functionsNewList,GrowListandInsertusedinvariouspackagesandinparsersinR.
Thefunctiondnt,pnt,qntsugarfunctionswereincorrectlyexpandingtotheno-degree-of-freedomsvariant.
Unittestsforpntwereadded.
ThesugartablefunctiondidnothandleNAsandNaNsproperlyfornumericvectors.Fixedandtestsadded.
TheinternalcoercionmechanismmappingnumericstostringshasbeenupdatedtobettermatchR(specificallywithInf,-Inf,andNaN.)
AppliedtwobugfixestoVectorsort()andRObjectdefinitionspottedandcorrectedbyKevinUshey
NewcheckUserInterrupt()functionthatprovidesaC++friendlyimplementationofR_CheckUserInterrupt.
ChangesinRcppattributes:
EmbeddedRcodechunksinsourceCpparenowexecutedwithintheworkingdirectoryoftheC++sourcefile.
EmbeddedRcodechunksinsourceCppcannowbedisabled.
ChangesinRcppdocumentation:
TheRcpp-FAQandRcpp-packagevignetteshavebeenupdatedandexpanded.
Vignettesarenowtypesetwithgreybackgroundforcodeboxes.
Thebibtexreferencefilehasbeenupdatetoreflexctcurrentpackageversions.
ChangesinRcppunittests:
Thefunctiontest()wasrewritten;itprovidesaneasyentrypointtorunningunittestsoftheinstalledpackage
ThefunctionexposeClasstakesadescriptionoftheconstructors,fieldsandmethodstobeexposedfromaC++class,andwritesC++andRfilesinthepackage.Inheritedclassescanbedealtwith,butrequiredatatypeinformation.Thisapproachavoidshand-codingmodulefiles.
Twomissingis<>()templatesforCharacterVectorandCharacterMatrixhavebeenadded,andsometestsforis_na()andis_finite()havebeencorrectedthankstoThomasTse.
ChangesinRcode:
ExportlinkinghelperfunctionLdFlagsaswellasRcppLdFlags.
FunctionRcpp.package.skeleton()nolongerpassesanamespaceargumentontopackage.skeleton()
ChangesinRsetup:
RaiserequirementforRitselftobeversion3.0.0orlaterasneededbythevignetteprocessing
sourceCppnowcorrectlybindstoRtools3.0and3.1
NewRfunctiondemanglethatcallstheDEMANGLEmacro.
NewRfunctionsizeoftoquerythebytesizeofatype.ThisreturnsanobjectofS3classbytesthathasaprintmethodshowingbytesandbits.
Adddefined(__sun)tolistsofoperatingsystemstotestforwhencheckingforlackofbacktrace()neededforstacktraces.
as
DoubleVectorasbeenaddedasanaliastoNumericVector
Newtemplatefunctionis
wrapcannowhandlemoretypes,i.e.typesthatiterateoverstd::pair
std::map
boost::unordered_map
Otherexamplesofthisareincludedattheendofthewrapunittestfile(runit.wrap.Randwrap.cpp).
wrapnowhandlescontainersofclasseshandledbymodules.e.g.ifyouexposeaclassFooviamodules,thenyoucanwrapvector
RcppLdFlags(),oftenusedinMakevarsfilesofpackagesusingRcpp,isnowexportedfromthepackagenamespace.
ChangesinAttributes:
Objectsexportedbyamodule(i.e.byaRCPP_MODULEcallinafilethatisprocessedbysourceCpp)arenowdirectlyavailableintheenvironment.Weusedtomakethemoduleobjectavailable,whichwaslessuseful.
ApluginforopenmphasbeenaddedtosupportuseofOpenMP.
Rcpp::exportnowtakesadvantageofthemoreflexibleas<>,handlingconstnessandreferencenessoftheinputtypes.Forusers,itmeansthatfortheparametersoffunctionexportedbymodules,wecannowusereferences,pointersandconstversionsofthem.ThefileModule.cppfilehasanexample.
Nolongercallnon-exportedfunctionsfromthetoolspackage
NolongersearchtheinlinepackageasafallbackwhenloadingpluginsforthetheRcpp::pluginsattribute.
ChangesinModules:
WecannowexposefunctionsandmethodsthattakeT&orconstT&asarguments.Inthesesituationsobjectsarenolongercopiedastheyusedtobe.
Changesinsugar:
is_nasupportsclassesDatetimeVectorandDateVector
Thevignetteshavebeenmovedfrominst/doc/tothevignettesdirectorywhichisnowpreferred.
TheappearanceofthevignetteshasbeenrefreshedbyswitchingtotheBistreamCharterfont,andmicrotypepackage.
DeprecationofRCPP_FUNCTION_*:
Themacrosfromthepreprocessor_generated.hfilehavebeendeprecated.Theyarestillavailable,buttheyprintamessageinadditiontotheirexpectedbehavior.
ThemacroswillbepermanentlyremovedinthefirstRcppreleaseafterJuly2014.
Usersofthesemacrosshouldstartreplacingthemwithmoreup-to-datecode,suchasusing'Rcppattributes'or'Rcppmodules'.
ChangesinRcode:NonebeyondthosedetailedforRcppAttributes
FixedproblemwherebytheinteractionbetweenthegcandtheRNGScopedestructorcouldcauseacrash.
Don'tincludepackageheaderfileingeneratedC++interfaceheaderfiles.
Lookuppluginsininlinepackageiftheyaren'tfoundwithintheRcpppackage.
Disallowcompilationforfilesthatdon'thaveextensionssupportedbyRCMDSHLIB
TheDataFrame::createsetoffunctionshasbeenreworkedtojustuseList::createandfeedtotheDataFrameconstructor
Theoperator-()semanticsforDateandDatetimearenowmoreinlinewithstandardC++behaviour;withthankstoRobinGirardforthereport.
RNGScopecounternowusesunsignedlongratherthanint.
Vector<*>::erase(iterator,iterator)wasfixed.Nowitdoesnotremovetheelementpointedbylast(similartowhatisdoneonstltypesandwhatwasintendedinitially).ReportedonRcpp-develbyToniGiorgino.
AddedequalityoperatorbetweenelementsofCharacterVectors.
ChangesinRcppsugar:
Newfunctionna_omitbasedonaStackOverflowthread
Newfunctionis_finiteandis_infinitethatreproducesthebehaviorofR'sis.finiteandis.infinitefunctions
ChangesinRcppbuildtools:
FixbyMartynPlummerforSolarisinhandlingofSingleLogicalResult.
Thesrc/Makevarsfilecannowoptionallyoverridethepathfor/usr/bin/install_name_toolwhichisusedonOSX.
Vignettesaretryinghardernottobebuiltinparallel.
UpdatedthebibliographyinRcpp.bib(whichisalsosourcedbypackagesusingRcpp).
UpdatedtheTHANKSfile.
PlannedDeprecationofRCPP_FUNCTION_*:
ThesetofmacrosRCPP_FUNCTION_etc...fromthepreprocessor_generated.hfilewillbedeprecatedinthenextversionofRcpp,i.etheywillstillbeavailablebutwillgeneratesomewarninginadditiontotheirexpectedbehavior.
Inthefirstreleasethatisatleast12monthsafterthisannouncement,themacroswillberemovedfromRcpp.
Usersofthesemacros(ifthereareany)shouldstartreplacingthemwithmoreuptodatecode,suchasusingRcppattributesorRcppmodules.
PreventbuildfailuresonWindowsnwhenRcppisinstalledinalibrarypathwithspaces(transformpathsinthesamemannerthatRdoesbeforepassingthemtothebuildsystem).
RcppmodulescannowbeusedwithsourceCpp
Standaloneroxygenchunks(e.g.todocumentaclass)arenowtransposedintoRcppExports.R
AddedRcpp::pluginsattributeforbindingdirectlytoinlineplugins.PluginscanberegisteredusingthenewregisterPluginfunction.
Addedbuilt-incpp11pluginforspecifyingtheuseofC++11inatranslationunit
MergeexistingvaluesofbuildrelatedenvironmentvariablesforsourceCpp
AddglobalpackageincludefiletoRcppExports.cppifitexists
StopwithanerrorifthefilenamepassedtosourceCpphasspacesinit
Returninvisiblyfromvoidfunctions
Ensurethatlinecommentsinvalidateblockcommentswhenparsingforattributes
EliminatedspuriousemptyhelloworldfunctiondefinitioninRcpp.package.skeleton
TheverycentraluseofRAPIR_PreserveObjectandR_ReleaseObjecthasbeenreplacedbyanewsystembasedonthefunctionsRcpp_PreserveObject,Rcpp_ReleaseObjectandRcpp_ReplaceObjectwhichshowsbetterperformanceandisimplementedusingagenericvectortreatedasastackinsteadofapairlistintheRimplementation.However,asthispreserve/releasecodeisstillalittleroughattheedges,anew#defineisused(inconfig.h)todisableitfornow.
Platform-dependentcodeinTimer.cppnowrecognisesafewmoreBSDvariantsthankstocontributeddefined()testsuggestions
SupportforwidecharacterstringshasbeenaddedthroughouttheAPI.InparticularString,CharacterVector,wrapandasareawareofwidecharacterstrings
Sourceandheaderfileswerereorganizedandconsolidatedsothatcompiletimearenowsignificantlylower
AddedadditionalcheckinRstreambufdeletetion
Addedsupportforclang++whenusinglibc++,andforancicpcinstd=c++11mode,thankstoapatchbyYanZhou
NewclassRcpp::Stringtofacilitateworkingwithasingleelementofacharactervector
Newutilityclasssugar::IndexHashinspiredfromSimonUrbanek'sfastmatchpackage
ImplementationoftheequalityoperatorbetweentwoRcomplex
RNGScopenowhasaninternalcounterthatenablesittobesafelyusedmultipletimesinthesamestackframe.
NewclassRcpp::Timerforbenchmarking
MoreefficientversionofmatchbasedonIndexHash
MoreefficientversionofuniquebaseonIndexHash
MoreefficientversionofinbaseonIndexHash
MoreefficientversionofduplicatedbaseonIndexHash
Moreefficientversionofself_matchbaseonIndexHash
Newfunctioncollapsethatimplementspaste(.,collapse="")
UsecodegenerationratherthanmodulestoimplementsourceCppandcompileAttributes(eliminatesproblemwithexceptionsnotbeingabletocrosssharedlibraryboundariesonWindows)
ExportedfunctionsnowautomaticallyestablishanRNGScope
FunctionsexportedbysourceCppnowdirectlyreferencetheexternalfunctionpointerratherthanrelyondynliblookup
OnWindows,RtoolsisautomaticallyaddedtothePATHduringsourceCppcompilations
DiagnosticsareprintedtotheconsoleifsourceCppfailsandC++developmenttoolsarenotinstalled
AwarningisprintedifwhencompileAttributesdetectsRcpp::dependsattributesinsourcefilesthatarenotmatchedbyDepends/LinkingToentriesinthepackageDESCRIPTION
Newfunctions:setdiff,union_,intersectsetequal,in,min,max,range,match,table,duplicated
Newfunction:clampwhichcombinespminandpmax,e.g.clamp(a,x,b)isthesameaspmax(b,pmin(x,a))
Newfunction:self_matchwhichimplementssomethingsimilartomatch(x,unique(x))
TheVectortemplateclass(henceNumericVector...)gettheis_naandtheget_nastaticmethods.
Newhelperclassno_initthatcanbeusedtocreateavectorwithoutinitializingitsdata,e.g.:IntegerVectorout=no_init(n);
Newexceptionconstructorrequiringonlyamessage;stopfunctiontothrowanexception
DataFramegainsanrowsmethod
AbilitytoembedRcodechunks(viaspeciallyformattedblockcomments)inC++sourcefiles.
Allowspecificationofargumentdefaultsforexportedfunctions.
NewschemeformoreflexiblemixingofgeneratedandusercomposedC++headers.
Printwarningifnoexportattributesarefoundinsourcefile.
UpdatedvignettewithadditionaldocumentationonexposingC++interfacesfrompackagesandsignalingerrors.
ChangesinRcppmodules:
Enclose.ExternalinvocationsinBEGIN_RCPP/END_RCPP
NewfunctionareMacrosDefined
AdditionstoRcpp.package.skeleton:
attributesparametertogenerateaversionofrcpp_hello_worldthatusesRcpp::export.
cpp_filesparametertoprovidealistofC++filestoincludetheinthesrcdirectoryofthepackage.
Miscellaneouschanges:
Newexample'pisimulation'usingRandC++viaRcppattributes
SupportforC++11styleattributes(embeddedincomments)toenableuseofC++withininteractivesessionsandtoautomaticallygeneratemoduledeclarationsforpackages:
Rcpp::exportattributetoexportaC++functiontoR
sourceCpp()functiontosourceexportedfunctionsfromafile
cppFunction()andevalCpp()functionsforinlinedeclarationsandexecution
compileAttribtes()functiontogenerateRcppmodulesfromexportedfunctionswithinapackage
Rcpp::dependsattributeforspecifyingadditionalbuilddependenciesforsourceCpp()
Rcpp::interfacesattributetospecifytheexternalbindingscompileAttributes()shouldgenerate(defaultstoR-onlybutaC++includefileusingR_GetCCallablecanalsobegenerated)
Newvignette"Rcpp-attribute"
Rcppmodulesfeaturesethasbeenexpanded:
Functionsandmethodscannowreturnobjectsfromclassesthatareexposedthroughmodules.Thisusesthemake_new_objecttemplateinternally.ThisfeaturerequiresthatsomeclasstraitsaredeclaredtoindicateRcpp'swrap/assystemthattheseclassesarecoveredbymodules.ThemacroRCPP_EXPOSED_CLASSandRCPP_EXPOSED_CLASS_NODECLcanbeusedtodeclaredthesetypetraits.
Classesexposedthroughmodulescanalsobeusedasparametersofexposedfunctionsormethods.
Exposedclassescandeclarefactorieswith".factory".Afactoryisac++functionthatreturnsapointertothetargetclass.Itisassumedthattheseobjectsareallocatedwithnewonthefactory.OntheRside,factoriesarecalledjustlikeotherconstructors,withthe"new"function.Thisfeatureallowsanalternativewaytoconstructobjects.
"converter"canbeusedtodeclareawaytoconvertanobjectofatypetoanothertype.Thisgetstranslatedtotheappropriate"as"methodontheRside.
Inheritance.Aclasscannowdeclarethatitinheritsfromanotherclasswiththe.derives
Newsugarfunctions:
which_minimplementswhich.min.Traversingthesugarexpressionandreturningtheindexofthefirsttimetheminimumvalueisfound.
which_maxidem
uniqueusesunordered_settofinduniquevalues.Inparticular,theversionforCharacterVectorisfoundtobemoreefficientthanR'sversion
sort_uniquecalculatesuniquevaluesandthensortsthem.
Improvementstooutputfacilities:
Implementedsync()sothatflushingoutputstreamsworks
AddedRcerroutputstream(forwardingtoREprintf)
Provideanamespace'R'forthestandaloneRmathlibrarysothatRcppuserscanaccessthosefunctionstoo;alsoaddedunittests
DevelopmentreleasessetsvariableRunAllRcppTeststoyestorunalltests(unlessitwasalredysetto'no');CRANreleasesdonotandstillrequiresetting–whichhelpswiththedesiredCRANdefaultoflesstestingattheCRANserverfarm.
Untanglingtheclang++buildissueaboutthelocationoftheexceptionsheaderbydirectlycheckingfortheincludefile–anapproachprovidedbyMartinMorganinakindlycontributedpatchasunittestsforthem.
TheDateandDatetimetypesnowcorrectlyhandleNA,NaNandInfrepresentation;theDatetypeswitchedtoaninternalrepresentationviadouble
AddedDateandDatetimeunittestsforthenewfeatures
AnadditionalPROTECTwasaddedforparsingexceptionmessagesbeforereturningthemtoR,followingareportbyBenNorth
AddednewRcppsugarfunctionstrunc(),round()andsignif(),aswellasunittestsforthem
Bemoreconservativeaboutwherewesupportclang++andtheinclusionofexception_defines.handpreventthisfrombeingattemptedonOSXwhereitfailedforclang3.1
CorrectedatypoinModule.hwhichnowagainpermitsuseoffinalizers
Smallcorrectionfor(unexported)bib()function(whichprovidesapathtothebibtexfilethatshipswithRcpp)
ConvertedNEWStoNEWS.Rd
TrulycorrectedRcpp::Environmentclassbyhavingdefaultconstructorusetheglobalenvironment,andremovingthedefaultargumentofglobalenvironmentfromtheSEXPconstructor
Addedtestsforclang++versiontoincludebits/exception_defines.hforversions3.0orhigher(similartog++4.6.0orlater),neededtoincludeoneparticularexceptionsheader
MademoreregressiontestsconditionalontheRunAllRcppTeststocomeclosertotheCRANmandateofrunningtestsinsixtyseconds
Updatedunittestwrappertests/doRUnit.RaswellasunitTests/runTests.R
CorrectedRcpp::Environmentclassbyremoving(empty)ctorfollowingrev3592(onMay2)wheredefaultargumentforctorwasmoved
UnittestingnowchecksforenvironmentvariableRunAllRcppTestsbeingsetto"yes";otherwisesometestsareskipped.Thisisarguablynottherightthingtodo,butCRANmaintainersinsistonfastertests.
UnittestwrapperscriptrunTests.Rhasnewoption–allTeststosettheenvironmentvariable
Thecleanupscriptnowalsoconsidersinst/unitTests/testRcppClass/src
Newmemberfunctionforvectors(andlistsetc)containsElementNamed()whichreturnsabooleanindicatingifthegivenelementnameispresent
UpdatedtheRcpp.package.skeleton()supportforRcppmodulesbycarryingfunctionsalreadypresentfromthecorrespondingunittestwhichwasalsoslightlyexpanded;andaddedmorecommentstothecode
RcppmodulescannowbeloadedvialoadRcppModules()from.onLoad(),orvialoadModule("moduleName")fromanyRfile
ExtendedfunctionalitytoletRmodifyC++clasesimportedviamodulesdocumentedinhelp(setRcppClass)
SupportcompilationinCygwinthankstoapatchbyDarioButtari
ExtensionstotheRcpp-FAQandtheRcpp-modulesvignettes
TheminiumversionofRisnow2.15.1whichisrequiredforsomeoftheRcppmodulessupport
RearrangeheaderssothatRcpp::RcoutcanbeusedbyRcppArmadilloetal
NewRcppsugarfunctionmapply(limitedtotwoorthreeinputvectors)
AddedcustomversionoftheRcppsugardifffunctionfornumericvectorsskippingunncesserrychecksforNA
SomeinternalcodechangestoreflectchangesandstricterrequirementsinRCMDcheckinthecurrentR-develversions
Correctedfixed-valueinitializationforIntegerVector(withthankstoGregorKastnerforspottingthis)
NewRcpp-FAQentryonsimplewaytosetcompileroptionforcxxfunction
Revertingthe'int64'changesfromrelease0.9.8whichadverselyaffectpackagesusingRcpp:Wewillre-applythe'int64'changesinawaywhichshouldcooperatemoreeasilywith'long'and'unsignedlong'.
UnittestoutputdirectoryfallbackchangedtouseRcpp.Rcheck
ConditionedtwounitteststonotrunonWindowswheretheynowbreakwhereastheypassedbefore,andcontinuetopassonotherOSs
wrapnowhandles64bitintegers(int64_t,uint64_t)andcontainersofthem,andRcppnowdependsontheint64package(alsoonCRAN).ThisworkhasbeensponsoredbytheGoogleOpenSourceProgramsOffice.
AddedsetRcppClass()functiontocreateextendedreferenceclasseswithaninterfacetoaC++class(typicallyviaRcppModule)whichcanhaveR-basedfieldsandmethodsinadditiontothosefromtheC++.
AppliedpatchbyJelmerYpmawhichaddsanoutputstreamclass'Rcout'notunlikestd::cout,butimplementedviaRprintftocooperatewithRanditsoutputbuffering.
Newunittestsforpf(),pnf(),pchisq(),pnchisq()andpcauchy()
XPtrconstructornowchecksforcorrespondingtypeinSEXP
Updatedvignettesforusewithupdatedhighlightpackage
UpdatelinkingcommandforolderfastLm()exampleusingexternalArmadillo
AppliedtwopatcheskindlyprovidedbyMartynPlummerwhichprovidesupportforcompilationonSolarisusingtheSunProcompiler
Minorcodereorganisationinwhichexceptionspecifiersareremoved;thiseffectivelyonlyimplementsarun-time(ratherthancompile-time)checkandisgenerallyseenasasomewhatdepreatedC++idiom.ThankstoDarrenCookforalertingustothisissue.
Newexample'OpenMPandInline.r'intheOpenMP/directory,showinghoweasilyuseOpenMPbymodifyingtheRcppPluginoutput
Newexample'ifelseLooped.r'showingRcppcanaccelerateloopsthatmaybedifficulttovectoriseduetodependencies
Newexampledirectoryexamples/Misc/regroupingthenewexampleaswellasthefibonacciexampleaddedinRcpp0.9.6
NewRcpp-FAQexamplewarningoflossyconversionfrom64-bitlongintegertypesintoa53-bitmantissawhichhasnoclearfixyet.
Newunittestforaccessinganon-exportedfunctionfromanamespace
AddedhelpertraitstofacilitateimplementationoftheRcppEigenpackage:Theis_eigen_basetraitsidentifiesifaclassderivesfromEigenBaseusingSFINAE;andnewdispatchlayerwasaddedtowrap()tohelpRcppEigen
XPtrnowacceptsasecondtemplateparameter,whichisafunctiontakingapointertothetargetclass.Thisallowsthedeveloppertosupplyhis/herownfinalizer.Thetemplateparameterhasadefaultvaluewhichretainstheoriginalbehaviour(callingdeleteonthepointer)
NewexampleRcppGibbs,extendingSanjogMisra'sRcppillustrationofDarrenWilkinson'scomparisonofMCMCGibbsSamplerimplementations;alsoaddedshorttimingonNormalandGaussianRNGdrawsbetweenRcppandGSLasR'srgamma()isseentosignificantlyslower
NewexampleonrecursivelycomputingaFibonaccinumberusingRcppandcomparingthistoRandbyte-compiledRforasignificantspeedgain
NewRcpp-FAQexamplesonusingthepluginmakerforinline'scxxfunction(),andonsettingrowandcolumnnamesformatrices
Newsugarfunctions:mean,var,sd
MinorcorrectionandextensiontoSTLdocumentationinRcpp-quickref
wrap()isnowresilienttoNULLpointerspassedasinconstchar*
loadRcppModules()gainsa"direct"argumenttoexposethemoduleinsteadofexposingwhatisinsideit
SuppressaspuriouswarningfromRCMDcheckonpackagescreatedwithRcpp.package.skeleton(...,module=TRUE)
SomefixesandimprovementsforRcppsugarfunction'rlnorm()'
BeginningsofnewexampleusingOpenMPandrecognisinguserinterrupts
NewRfunction"loadRcppModules"toloadRcppmodulesautomaticallyfromapackage.Thisfunctionmustbecalledfromthe.onLoadfunctionandworkswiththe"RcppModules"fieldofthepackage'sDESCRIPTIONfile
TheModulesexamplewrappedtheSTLstd::vectorreceivedsomeeditingtodisambiguatesomesymbolsthenewercompilersdidnotlike
CoercingofvectorsoffactorsisnowdonewithanexplicitcallbacktoR's"as.character()"asRf_coerceVectornolongerplaysalong
ACITATIONfileforthepublishedJSSpaperhasbeenadded,andreferenceswereaddedtoRcpp-package.Rdandthedifferentvignettes
Fixedabuginwhichmodulescodewasnotbehavingwhencompiledtwiceascaneasilyhappenwithinline'edversion
Exceptionscodeincludesexception_defines.honlywheng++is4.5oryoungerasthefilenolongerexistswithg++-4.6
ThedocumentationMakefilenowusesthe$R_HOMEenvironmentvariable
ThedocumentationMakefilenolongercallscleaninthealltarget
C++conformanceissuefoundbyclang/llvmaddressedbyre-orderingdeclarationsingrow.hasunqualifiednamesmustbedeclaredbeforetheyareused,evenwhenusedwithintemplates
The'longlong'typedefnowdependsonC++0xbeingenabledasthiswasnotafeatureinC++98;thissuppressesanewg++-4.5warning
TheRcpp-introductionvignettewasupdatedtotheforthcomingJSSpaper
TheunitTestrunit.Module.client.package.RisnowskippedonolderOSXreleasesasittriggersabugwithg++4.2.1orolder;OSX10.6isfinebutasitnolongersupportppcwetrytoaccomodate10.5tooThankstoSimonUrbanekforpinningthisdownandBaptisteAuguieandKenWilliamsforadditonaltesting
RcppCommon.hnowrecognisestheIntelCompilerthankstoashortpatchbyAlexeyStukalov;thisturnsoffCxx0xandTR1featurestoo
ThreemoresetupquestionswereaddedtotheRcpp-FAQvignette
OnequestionaboutRcppArmadillowasaddedtotheRcpp-FAQvignette
Anumberofinternalchangestothememoryallocation/protectionoftemporaryobjectsweremade—withaheartfelt"ThankYou!"tobothDougBatesforverypersistentdebuggingofRcppmodulescode,andtoLukeTierneywhoaddedadditionalmemoryallocationdebuggingtoolstoR-devel(whichwillbeinR2.13.0andmayalsobeinR2.12.2)
RemovedanotherGNUMake-specificvariablefromsrc/Makevarsinordertomakethebuildmoreportable;thiswasnoticedonFreeBSD
On*BSD,donottrytocomputeastacktracebutprovidefileandlinenumber(whichisthesamebehaviourasimplementedinWindows)
FixedanintconversionbugreportedbyDanielSabanesBoveonr-devel,addedunittestaswell
Addedunittestsforcomplex-typedvectors(thankstoChristianGunning)
ExpandedtheRcpp-quickrefvignette(withthankstoChristianGunning)
AdditionalexampleswereaddedtotheRcpp-FAQvignette
TheclassicAPIwasfactoredoutintoitsownpackageRcppClassicwhichisreleasedconcurrentlywiththisversion.
Ifanobjectiscreatedbutnotinitialized,attemptingtouseitnowgivesamoresensibleerrormessage(byforwardinganRcpp::not_initializedexceptiontoR).
SubMatrixfixed,andMatrixtypesnowhaveanested::Subtypedef.
NewunexportedfunctionSHLIB()toaidincreatingasharedlibraryonthecommand-lineorinMakefile(similartoCxxFlags()/LdFlags()).
Modulegetsaseven-argumentctorthankstoapatchfromTamaMa.
The(stillincomplete)QuickRefvignettehasgrownthankstoapatchbyChristianGunning.
Addedasprintftemplateintendedforlogginganderrormessages.
Date::getYear()corrected(whereadditionof1900wasnotcalledfor);correspondingchangeinconstructorfromthreeintsmadeaswell.
Date()andDatetime()constructorsfromstringreceivedamissingconversiontointanddoublefollowingstrptime.ThedefaultformatstringfortheDatetime()strptimecallwasalsocorrected.
Afewminorfixesthroughout,seeChangeLog.
Manyimprovementsweremadein'Rcppmodules':-exposingmultipleconstructors-overloadedmethods-self-documentationofclasses,methods,constructors,fieldsandfunctions.-newRfunction"populate"tofacilitateworkingwithmodulesinpackages.-formalargumentspecificationoffunctions.-updatedsupportforRcpp.package.skeleton.-constructorscannowtakemanymorearguments.
The'Rcpp-modules'vignettewasupdatedaswellanddescribemanyofthenewfeatures
NewtemplateclassRcpp::SubMatrix
ReferenceClassesnolongerrequireadefaultconstructorforsubclassesofC++classes
ConsistentlyreverttousingbackticksratherthanshellexpansiontocomputelibraryfilelocationwhenbuildingpackagesagainstRcpponthedefaultplatforms;thishasbeenappliedtointernaltestpackagesaswellasCRAN/BioCpackagesusingRcpp
NewsyntacticshortcuttoextractrowsandcolumnsofaMatrix.x(i,_)extractsthei-throwandx(_,i)extractsthei-thcolumn.
Matrixindexingismoreefficient.However,fasterindexingisdisabledifg++4.5.0orlaterisused.
AfewnewRcppoperatorssuchascumsum,operator=(sugar)
Varietyofbugfixes:-columnindexingwasincorrectinsomecases-compilationusingclang/llvm(thankstoKarlMillarforthepatch)-instantationorderofModulecorrected-POSIXct,POSIXtnowcorrectlyorderedforR2.12.0
Asofthisversion,RcppdependsonR2.12orgreaterasitinterfacesthenewreferenceclasses(seebelow)andalsoreflectsthePOSIXtclassreorderingbothofwhichappearedwithRversion2.12.0
newRcpp::Referenceclass,thatallowsinternalmanipulationofR2.12.0referenceclasses.Theclassexposesaconstructorthattakesthenameofthetargetreferenceclassandafield(string)methodthatimplementstheproxypatterntoget/setreferencefieldsusingcallbackstotheRoperators"$"and"$<-"inordertopreservetheR-levelencapsulation
theRsideoftheprecedingitemallowsmethodstobewritteninRasperReferenceClasses,accessingfieldsbynameandassigningthemusing"<<-".ClassesextractedfrommodulesareRreferenceclasses.TheycanbesubclassedinR,and/orRmethodscanbedefinedusingthe$methods(...)mechanism.
internalperformanceimprovementsforRcppsugaraswellasanadded'noNA()'wrappertoomittestsforNAvalues–seetheincludedexamplesininst/examples/convolveBenchmarksforthespeedups
moreinternalperformancegainswithFunctionsandEnvironments
newmacroRCPP_VERSIONandRcpp_VersiontoallowconditionalcompilingbasedontheversionofRcpp#ifdefined(RCPP_VERSION)&&RCPP_VERSION>=Rcpp_Version(0,8,6)#endif
newsugarfunctionsforstatisticaldistributions(d-p-q-rfunctions)withdistributions:unif,norm,gamma,chisq,lnorm,weibull,logis,f,pois,binom,t,beta.
newctorforVectortakingsizeandfunctionpointersothatforexampleNumericVector(10,norm_rand)generatesaN(0,1)vectorofsize10
addedbinaryoperatorsforcomplexnumbers,aswellassugarsupport
moresugarmathfunctions:sqrt,log,log10,exp,sin,cos,...
startednewvignetteRcpp-quickref:quickreferenceguideofRcppAPI(stillworkinprogress)
variouspatchestocomplywithsolaris/sunccstricterstandards
minorenhancementstoConvolutionBenchmarkexample
simplifiedsrc/MakefiletonolongerrequireGNUmake;packagesusingRcppstilldoforthecompile-timetestoflibrarylocations
speedimprovements.Vector::names,RObject::slothavebeenimprovedtotakeadvantageofRAPIfunctionsinsteadofcallbackstoR
SomesmallupdatestotheRd-baseddocumentationwhichnowpointstocontentinthevignettes.AlsoasmallformattingchangetosuppressawarningfromthedevelopmentversionofR.
MinorchangestoDate()codewhichmayreenableSunStudiobuilds
newsugarvectorfunctions:rep,rep_len,rep_each,rev,head,tail,diag
sugarhasbeenextendedtomatrices:TheMatrixclassnowextendstheMatrix_BasetemplatethatimplementsCRTP.Currentlysugarfunctionsformatricesare:outer,col,row,lower_tri,upper_tri,diag
Theunittestshavebeenreorganisedintofewerfileswithonecalleachtocxxfunction()(coveringmultipletests)resultinginasignificantspeedup
TheDateclassnowusesthesamemktime()replacementthatRuses(basedonoriginalcodefromthetimezonelibrarybyArthurOlson)permittingwidedaterangesonalloperatingsystems
TheFastLMexamplehasbeenupdated,anewbenchmarkbasedonthehistoricalLongleydatasethasbeenadded
RcppStringVectornowusesstd::vector
settingthe.DataslotofS4objectsdidnotworkproperly
Newhelperfunctionsothat"Rcppsomething"bringsupRcpphelp
RcppModulescannowexposepublicdatamembers
NewclassesDate,Datetime,DateVectorandDatetimeVectorwithproper'new'APIintegrationsuchasas(),wrap(),iterators,...
Theso-calledclassicAPIheadershavebeenmovedtoasubdirectoryclassic/Thisshouldnotaffectclient-codeasonlyRcpp.hwaseverincluded.
RcppDatenowhasaconstructorfromSEXPaswell
RcppDateVectorandRcppDatetimeVectorgetconstructorsfromintandbothconst/non-constoperator(inti)functions
NewAPIclassRcpp::InternalFunctionthatcanexposeC++functionstoRwithoutmodules.ThefunctionisexposedasanS4objectofclassC++Function
Bug-fixreleaseforsuncccompilerwiththankstoBrianRipleyforadditionaltesting.
ThisreleaseaddsRcppmodules.AnRcppmoduleisacollectionofinternal(C++)functionsandclassesthatareexposedtoR.ThisfunctionalityhasbeeninspiredbyBoost.Python.ModulesarecreatedinternallyusingtheRCPP_MODULEmacroandretrievedintheRsidewiththeModulefunction.Thisisapreviewreleaseofthemodulefunctionality,whichwillkeepimprovinguntiltheRcpp0.9.0release.Thenewvignette"Rcpp-modules"documentsthecurrentfeaturesetofRcppmodules.
Thenewvignette"Rcpp-package"detailsthestepsinvolvedinmakingapackagethatusesRcpp.
Thenewvignette"Rcpp-FAQ"collectsanumberoffrequentlyaskedquestionsandanswersaboutRcpp.
Thenewvignette"Rcpp-extending"documentshowtoextendRcppwithuserdefinedtypesortypesfromthirdpartylibraries.BasedonourexperiencewithRcppArmadillo
Rcpp.package.skeletonhasbeenimprovedtogenerateapackageusinganRcppmodule,controlledbythe"module"argument
Evaluatingacallinsideanenvironmentdidnotworkproperly
cppfunctionhasbeenwithdrawnsincetheintroductionofthemoreflexiblecxxfunctionintheinlinepackage(0.3.5).RcppnolongerdependsoninlinesincemanyusesofRcppdonotrequireinlineatall.WestilluseinlineforunittestsbutthisisnowhandledlocallyintheunittestsloaderrunTests.R.Usersofthenow-withdrawnfunctioncppfunctioncanredefineitas:cppfunction<-function(...)cxxfunction(...,plugin="Rcpp")
Supportforstd::complexwasincompleteandhasbeenenhanced.
ThemethodsXPtr
END_RCPPnowreturnstheRNilvalues;newmacroVOID_END_RCPPreplicatespriorbehabiour
AllRcppheadershavebeenmovedtotheinst/includedirectory,allowinguseof'LinkingTo:Rcpp'.ButtheMakevarsandMakevars.winarestillneededtolinkagainsttheuserlibrary.
Automaticexceptionforwardinghasbeenwithdrawnbecauseofportabilityissues(asitdidnotworkontheWindowsplatform).Exceptionforwardingisstillpossiblebutisnowbasedonexplicitcodeoftheform:try{//usercode}catch(std::exception&__ex__){forward_exception_to_r(__ex___);Alternatively,themacroBEGIN_RCPPandEND_RCPPcanuseusedtoenclosecodesothatitcapturesexceptionsandforwardthemtoR.BEGIN_RCPP//usercodeEND_RCPP
Rcppnowdependsoninline(>=0.3.4)
AnewRfunction"cppfunction"wasaddedwhichinvokescfunctionfrominlinewithfocusonRcppusage(enforcing.Call,addingtheRcppnamespace,setupexceptionforwarding).cppfunctionusesBEGIN_RCPPandEND_RCPPmacrostoenclosetheusercode
newclassRcpp::FormulatohelpbuildingformulaeinC++
newclassRcpp::DataFrametohelpbuildingdataframesinC++
Rcpp.package.skeletongainsanargument"example_code"andcannowbeusedwithanemptylist,sothatonlytheskeletonisgenerated.IthasalsobeenreworkedtoshowhowtouseLinkingTo:Rcpp
wrapnowsupportscontainersofthefollowingtypes:long,longdouble,unsignedlong,shortandunsignedshortwhicharesilentlyconvertedtothemostacceptableRtype.
Reverttonotdouble-quoteprotectingthepathonWindowsasthisbreaksbackticksexpansionusednMakevars.winetc
ExceptionsclasseshavebeenmovedoutofRcppclasses,e.g.Rcpp::RObject::not_a_matrixisnowRcpp::not_a_matrix
UndoshQuote()toprotectWindowspathnames(whichmaycontainspaces)asbackticksuseisstillbroken;useof$(shell...)works
Vector<>gainsasetoftemplatedfactorymethods"create"whichtakesupto20argumentsandcancreatenamedorunnamedvectors.ThisgreatlyfacilitatescreatingobjectsthatarereturnedtoR.
Matrixnowhasadiag()methodtocreatediagonalmatrices,andanewconstructorusingasingleinttocreatesquarematrices
Vectornowhasanewfill()methodtopropagateasinglevalue
Namedisnomoreaclassbutatemplatedfunction.BothinterfacesNamed(.,.)andNamed(.)=.arepreserved,andextendedtoworkalsoonsimplevectors(throughVector<>::create)
AppliedpatchbyAlistairGeetomakeColDatummorerobust
FixedabuginVectorthatcausedrandombehaviorduetothelackofcopyconstructorintheVectortemplate
newclassRcpp::S4whoseconstructorchecksiftheobjectisanS4object
maximumnumberoftemplatedargumentstothepairlistfunction,theDottedPairconstructor,theLanguageconstructorandthePairlistconstructorhasbeenupdatedto20(was5)andascripthasbeenaddedtothesourcetreeshouldwewanttochangeitagain
useshQuote()toprotectWindowspathnames(whichmaycontainspaces)
AnothersmallimprovementtoWindowsbuildflags
bugfixon64bitplatforms.Thetraitsclasses(wrap_type_traits,etc)usedsize_twhentheyneededtoactuallyuseunsignedint
fixedpregcc4.3compatibility.Thetraitclassthatwasusedtoidentifyifatypeisconvertibletoanotherhadtoomanyfalsepositivesonpregcc4.3(notr1orc++0xfeatures).fixedbyimplementingthesection2.7of"ModernC++Design"book.
AllvectorclassesarenowgeneratedfromthesametemplateclassRcpp::Vector
NewtemplateclassRcpp::Matrix
NewclassRcpp::Row
NewclassRcpp::Column
TheRcpp::astemplatefunctionhasbeenreworkedtobemoregeneric.ItnowhandlesmoreSTLcontainers,suchasdequeandlist,andthegenericitycanbeusedtoimplementasformoretypes.ThepackageRcppArmadillohasexamplesofthis
newtemplateclassRcpp::fixed_callthatcanbeusedinSTLalgorithmssuchasstd::generate.
RcppExampleetalhavebeenmovedtoanewpackageRcppExamples;src/Makevarsandsrc/Makevars.winsimplifiedaccordingly
NewclassRcpp::StringTransformerandhelperfunctionRcpp::make_string_transformerthatcanbeusedtocreateafunctionthattransformsastringcharacterbycharacter.ForexampleRcpp::make_string_transformer(tolower)transformseachcharacterusingtolower.TheRcppExamplespackagehasanexampleofthis.
Improvedsrc/Makevars.winthankstoBrianRipley
AnewpackageRcppArmadillo(tobereleasedshortly)nowservesasaconcreteexampleonhowtoextendRcpptoworkwithamodernC++librarysuchastheheavily-templatedArmadillolibrary
Addedanewvignette'Rcpp-introduction'basedonajust-submittedoverviewarticleonRcpp
newtemplateclassesRcpp::unary_callandRcpp::binary_callthatfacilitatesusingRlanguagecallstogetherwithSTLalgorithms.
fixedabuginLanguageconstructorstakingastringastheirfirstargument.Thecreatedcallwaswrong.
SEXP_Vector(andExpressionVectorandGenericVector,a.k.aList)nowhavemethodspush_front,push_backandinsertthataretemplated
SEXP_Vectornowhasint-andrange-valuederase()members
Environmentclasshasadefaultconstructor(forRInside)
SEXP_Vector_BasefactoredoutofSEXP_Vector(Effect.C++#44)
SEXP_Vector_Base::iteratoraddedaswellasbegin()andend()sothatSTLalgorithmscanbeappliedtoRcppobjects
CharacterVectorgainsarandomaccessiterator,begin()andend()tosupportSTLalgorithms;iteratordereferencestoaStringProxy
RestoreWindowsbuild;successfullytestedon32and64bit;
Smallfixestoinst/skeletonfilesforbootstrappingapackage
RObject::asFoodeprecatedinfavourofRcpp::as
wraphasbeenmuchimproved.wrappabletypesnoware:-primitivetypes:int,double,Rbyte,Rcomplex,float,bool-std::string-STLcontainerswhichhaveiteratorsoverwrappabletypes:(e.g.std::vector
TherangebasedversionofwrapisnowexposedattheRcpp::levelwiththefollowinginterface:Rcpp::wrap(InputIteratorfirst,InputIteratorlast)Thisisdispatchedinternallytothemostappropriateimplementationusingtraits
anewnamespaceRcpp::traitshasbeenaddedtohostthevarioustypetraitsusedbywrap
Thedoxygendocumentationnowshowstheexamples
Anewfileinst/THANKSacknowledgesthekindhelpwegotfromothers
TheRcppSexphasbeenremovedfromthelibrary.
ThemethodsRObject::asFooaredeprecatedandwillberemovedinthenextversion.Thealternativeistouseas
ThemethodRObject::slotcannowbeusedtogetorsettheassociatedslot.Thisisonemoreexampleoftheproxypattern
Rcpp::VectorBasegainsanames()methodthatallowsgetting/settingthenamesofavector.Thisisyetanotherexampleoftheproxypattern.
Rcpp::DottedPairgainstemplatedoperator<
Rcpp::DottedPair,Rcpp::Language,Rcpp::PairlistarelessdependentonC++0xfeatures.Theygainconstructorswithupto5templatedarguments.5waschoosedarbitrarilyandmightbeupdateduponrequest.
functioncallsbytheRcpp::FunctionclassislessdependentonC++0x.Itisnowpossibletocallafunctionwithupto5templatedarguments(candidateforimplicitwrap)
addedsupportfor64-bitWindows(thankstoBrianRipleyandUweLigges)
matrix-likeindexingusingoperator()forallvectortypes:IntegerVector,NumericVector,RawVector,CharacterVectorLogicalVector,GenericVectorandExpressionVector.
newclassRcpp::Dimensiontosupportcreationofvectorswithdimensions.AllvectorclassesgainaconstructortakingaDimensionreference.
anintermediatetemplateclass"SimpleVector"hasbeenadded.AllsimplevectorclassesarenowgeneratedfromtheSimpleVectortemplate:IntegerVector,NumericVector,RawVector,CharacterVectorLogicalVector.
anintermediatetemplateclass"SEXP_Vector"hasbeenaddedtogenerateGenericVectorandExpressionVector.
theclonetemplatefunctionwasintroducedtoexplicitelycloneanRObjectbyduplicatingtheSEXPitencapsulates.
evensmarterwrapprogrammingusingtraitsandtemplatemeta-programmingusingaprivateheadertobeincludeonlyRcppCommon.h
theastemplateisnowsmarter.ThetemplatenowattemptstobuildanobjectoftherequestedtemplateparameterTbyusingtheconstructorforthetypetakingaSEXP.ThisallowsthirdpartycodetocreateaclassFoowithaconstructorFoo(SEXP)tohaveas
wrapbecomesatemplate.ForanobjectoftypeT,wrap
allspecializationsofwrap:wrap
configurehasbeenwithdrawn.C++0xfeaturescannowbeactivatedbysettingtheRCPP_CXX0Xenvironmentvariableto"yes".
newtemplater_cast
Environmentnowtakesadvantageoftheaugmentedsmartnessofasandwraptemplates.Ifas
Environment::assignbecomesatemplateandalsouseswraptocreateasuitableSEXP
Manymoreunittestsforthenewfeatures;alsoaddedunittestsforolderAPI
NewRfunctionRcpp.package.skeleton,modelledafterutils::package.skeletontohelpcreatingapackagewithsupportforRcppuse.
indexingisnowfasterforsimplevectorsduetoinliningoftheoperator[]andcachingthearraypointer
TheclassRcpp::VectorBasewasintroduced.Allvectorclassesderivefromit.Theclasshandlesbehaviourthatiscommontoallvectortypes:length,names,etc...
exceptionforwardingisextendedtocompilersotherthanGCCbutdefaultvaluesareusedfortheexceptionclassandtheexceptionmessage,becausewedon'tknowhowtodoit.
ImproveddetectionofC++0xcapabilities
Rcpp::Pairlistgainsadefaultconstructor
Rcpp::Environmentgainsanew_childmethodtocreateanewenvironmentwhoseparentisthis
Rcpp::Environment::Bindinggainsatemplatedimplicitconversionoperator
Rcpp::ExpressionVectorgainsanevalmethodtoevaluateitself
Rcpp::ExpressionVectorgainsaconstructortakingastd::stringrepresentingsomeRcodetoparse.
Rcpp::GenericVector::ProxygainsanassignmentoperatortodealwithEnvironment::Proxyobjects
Rcpp::LdFlags()nowdefaultstostaticlinkingOSX,asitalreadydidonWindows;thisdefaultcanbeoverridden.
anewbenchmarkwasaddedtotheexamplesdirectoryaroundtheclassicconvolutionexamplefromWritingRextensionstocompareCandC++implementations
Rcpp::CharacterVector::StringProxygainsa+=operator
Rcpp::Environmentgainsanoperator[](string)toget/setobjectsfromtheenvironment.operator[]returnsanobjectofclassRcpp::Environment::Bindingwhichimplementstheproxypattern.InspiredfromItem30of'MoreEffectiveC++'
Rcpp::PairlistandRcpp::Languagegainanoperator[](int)alsousingtheproxypattern
Rcpp::RObject.attrcannowbeusedontherhsorthelhs,togetorsetanattribute.Thisalsousestheproxypattern
Rcpp::PairlistandRcpp::Languagegainnewmethodspush_backreplace,length,size,remove,insert
wrapnowreturnsanobjectofasuitableclass,notjustRObjectanymore.Forexamplewrap(bool)returnsaLogicalVector
Rcpp::RObjectgainsmethodstodealwithS4objects:isS4,slotandhasSlot
newclassRcpp::ComplexVectortomanagecomplexvectors(CPLXSXP)
newclassRcpp::Promisetomanagepromises(PROMSXP)
newclassRcpp::ExpressionVectortomanageexpressionvectors(EXPRSXP)
newclassRcpp::GenericVectortomanagegenericvectors,a.k.alists(VECSXP)
newclassRcpp::IntegerVectortomanageintegervectors(INTSXP)
newclassRcpp::NumericVectortomanagenumericvectors(REALSXP)
newclassRcpp::RawVectortomanagerawvectors(RAWSXP)
newclassRcpp::CharacterVectortomanagecharactervectors(STRSXP)
newclassRcpp::Functiontomanagefunctions(CLOSXP,SPECIALSXP,BUILTINSXP)
newclassRcpp::Pairlisttomanagepairlists(LISTSXP)
newclassRcpp::Languagetomanagecalls(LANGSXP)
newspecializationsofwraptodealwithstd::initializerlistsonlyavailablewithGCC>=4.4
newRfunctionRcpp:::capabilitiesthatcanqueryifvariousfeaturesareavailable:exceptionhandling,variadictemplatesinitializerlists
newsetoffunctionswrap(T)convertingfromTtoRObject
newtemplatefunctionas
newclassRcpp::Namedtodealwithnamedwithnamedobjectsinapairlist,oracall
newclassRcpp::Symboltomanagesymbols(SYMSXP)
Thegarbagecollectionhasbeenimprovedandisnowautomaticandhidden.Theuserneedsnottoworryaboutitatall.
Rcpp::Environment(SEXP)usestheas.environmentRfunction
Doxygen-generateddocumentationisnolongerincludedasitisbothtoolargeandtoovolatile.Zipfilesareprovidedonthewebsite.
Romainisnowaco-authorofRcpp
NewbaseclassRcpp::RObjectreplaceRcppSexp(whichisprovidedforbackwardscompatibility)
RObjecthassimplewrappersforobjectcreationandconversiontoSEXP
NewclassesRcpp::EvaluatorandRcpp::Environmentforexpressionevaluationandenvironmentaccess,respectively
NewclassRcpp::XPtrforexternalpointers
Enhancedexceptionhandlingallowsfortrappingofexceptionsoutsideoftry/catchblocks
Namespacesupportwithanewnamespace'Rcpp'
Unittestsformostofthenewclasses,basedontheRUnitpackage
Inlinesupportnowprovidedbytheupdateinlinepackage,soanewDependson'inline(>=0.3.4)'replacesthecodeinthatwastemporarilyinRcpp
Inlinesupportviaamodifiedversionof'cfunction'fromOlegSklyar's'inline'package:simpleC++programscannowbecompiled,linkedandloadedautomagicallyfromtheRprompt,includingsupportforexternalpackages.AlsoworksonWindows(withR-toolsinstalled)
Newexamplesfortheinlinesupportbasedon'IntrotoHPC'tutorials
NewtypeRcppSexpforsimpleint,double,std::stringscalarsandvectors
Everyclassisnowinitsownheaderandsourcefile
FixtoRcppParams.RdthankstoFrankS.Thomas
RcppVersion.RremovedasredundantgivenDESCRIPTIONandread.dcf()
SwitchedtoR_PreserveObjectandR_ReleaseObjectforRcppSexpwiththankstoRomain
LicensingchangedfromLGPL2.1(orlater)toGPL2(orlater),fileCOPYINGupdated
Severalclassesnowsplitoffintotheirownheaderandsourcefiles
NewheaderfileRcppCommon.hregroupingcommondefinesandincludes
Makevars{,.win}updatedtoreflectsrc/reorg
NewclassRcppListforsimplelistsanddatastructuresofdifferenttypesanddimensions,usefulforRProtoBufprojectonR-Forge
Startedtosplitclassesintotheirownheaderandsourcefiles
AddedshortREADMEfileabouthistoryandstatus
SmalldocumentationmarkupfixthankstoKurt;updateddoxygendocs
NewexamplesdirectoryfunctionCallback/forRfunctionpassedtoC++andbeingcalled
UpdatedDoxygendocumentation
RcppParamsclassgainsanewexists()memberfunction
SmallOSXbuildcorrectionusingR_ARCHvariable
IncludeLGPLlicenseasfileCOPYING
Usestd::namespacethroughoutinsteadof'usingnamespacestd'
DefineR_NO_REMAPsothatRprovidesRf_length()etcinlieuoflength()tominimiseclasheswithotherprojectshavingsimilarfunctions
IncludeDoxygendocumentation,andDoxygenconfigurationfile
MinorWindowsbuildfix(withthankstoUweandSimon)
OSXbuildfixwiththankstoSimon
Added'view-only'classesforintanddoublevectorandmatrixclasesaswellasstringvectorclassses,kindlysuggsted/providedbyDavidReiss
AddtwoshorterhelperfunctionsRcpp:::CxxFlags()andRcpp:::LdFlags()forcompilationandlinkerflags
SmallbutimportantfixforLinuxbuildsinRcpp:::RcppLdFlags()
Nowsrc/Makevarsreplacessrc/Makefile,thisbringsproperOSXmulti-archsupportwiththankstoSimon
Old#ifdefstatementsrelatedtoQuantLibremoved;RcppisnowdecoupledfromQuantLibheadersyetbeusedbyRQuantLib
AddedRcppLdPath()toreturnthelib.directorypatchandonLinuxtherpathsettings
AddednewRcppVectorExample()
AugmenteddocumentationonusageinRcpp-package.Rd
Newmaintainer,takingoverRcppTemplate(whichhasbeenwithoutanupdatesinceNov2006)underitsinitialnameRcpp
Newfilessrc/Makefile{,.win}includingfunctionalityfrombothconfigureandRcppSrc/Makefile;wenowbuildtwolibraries,oneforusebythepackagewhichalsorunstheexample,andoneforuserstolinkagainst,andremovedsrc/Makevars.in
Filessrc/Rcpp.{cpp,h}movedinfrom../RcppSrc
AddednewclassRcppDatetimecorrespondingtoPOSIXctinwithfullsupportformicrosecondtimeresolutionbetweenRandC++
Severalnewmanualpagesadded
Removedconfigure{,.in,.win}assrc/Makefile*canhandlethismoreeasily
MinorcleanupandreformattingforDESCRIPTION,Date:nowusessvn:keywordDateproperty
RenamedRcppTemplateVersiontoRcppVersion,deletedRcppDemo
Directorydemo/removedasvignette("RcppAPI")iseasierandmorereliabletoshowvignettedocumentation
RcppTemplateDemo()removedfromR/zzz.R,vignette("RcppAPI")iseasier;man/RcppTemplateDemo.Rdremovedaswell
SomemorecodereindentationandformattingtoRdefaultarguments,somerenamedfromRcppTemplate*toRcpp*
Addedfootnoteontotitlepageofinst/doc/RcppAPI.{Rnw,pdf}abouthowthisdocumenthasnot(yet)beenupdatedalongwiththechanngesmade