Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
ROOTR: checked with git-clang-format
  • Loading branch information
omazapa committed Mar 20, 2017
commit a05222a9b608cc5fcc6f03a447fb9994c423dd8c
5 changes: 3 additions & 2 deletions bindings/r/inc/RExports.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,12 @@ namespace ROOT {
extern VARIABLE_IS_NOT_USED SEXP ModuleSymRef;
template<class T> class class_: public Rcpp::class_<T> {
public:
class_(const Char_t *name_, const Char_t *doc = 0): Rcpp::class_<T>(name_, doc) {}
class_(const Char_t *name_, const Char_t *doc = 0) : Rcpp::class_<T>(name_, doc) {}
};

//________________________________________________________________________________________________________
template<class T> void function(const Char_t *name_, T fun, const Char_t *docstring = 0)
template <class T>
void function(const Char_t *name_, T fun, const Char_t *docstring = 0)
{
//template function required to create modules using the macro ROOTR_MODULE
Rcpp::function(name_, fun, docstring);
Expand Down
18 changes: 6 additions & 12 deletions bindings/r/inc/TRDataFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ namespace ROOT {
*/
template <class T> Binding operator=(T var)
{
Int_t size = fDf.size(), i = 0 ;
Int_t size = fDf.size(), i = 0;
Rcpp::CharacterVector names = fDf.attr("names");
Bool_t found = false;
while (i < size) {
Expand Down Expand Up @@ -238,7 +238,7 @@ namespace ROOT {
*/
Binding operator=(Binding obj)
{
Int_t size = fDf.size(), i = 0 ;
Int_t size = fDf.size(), i = 0;
Rcpp::CharacterVector names = fDf.attr("names");
Bool_t found = false;
while (i < size) {
Expand Down Expand Up @@ -291,7 +291,7 @@ namespace ROOT {
*/
template <class T> Binding &operator <<(T var)
{
Int_t size = fDf.size(), i = 0 ;
Int_t size = fDf.size(), i = 0;
Rcpp::CharacterVector names = fDf.attr("names");
Bool_t found = false;
while (i < size) {
Expand Down Expand Up @@ -392,18 +392,12 @@ namespace ROOT {
Method to get the number of colunms
\return number of cols
*/
Int_t GetNcols()
{
return df.size();
}
Int_t GetNcols() { return df.size(); }
/**
Method to get the number of rows
\return number of rows
*/
Int_t GetNrows()
{
return df.nrows();
}
Int_t GetNrows() { return df.nrows(); }
/**
Method to get labels of dataframe
\return colunms names
Expand All @@ -412,7 +406,7 @@ namespace ROOT {
{
Rcpp::CharacterVector names = df.attr("names");
TVectorString rnames(GetNcols());
for (Int_t i = 0; i < GetNcols(); i++)rnames[i] = names[i];
for (Int_t i = 0; i < GetNcols(); i++) rnames[i] = names[i];
return rnames;
}

Expand Down
4 changes: 3 additions & 1 deletion bindings/r/inc/TRInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,9 @@ namespace ROOT {
\param verbose default false
\param interactive default true
*/
TRInterface(const Int_t argc = 0, const Char_t *argv[] = NULL, const Bool_t loadRcpp = true, const Bool_t verbose = false, const Bool_t interactive = true);
TRInterface(const Int_t argc = 0, const Char_t *argv[] = NULL, const Bool_t loadRcpp = true,
const Bool_t verbose = false, const Bool_t interactive = true);

public:
~TRInterface();

Expand Down
2 changes: 1 addition & 1 deletion bindings/r/src/RExports.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ namespace Rcpp {
template<> TMatrixT<Float_t> as(SEXP m)
{
NumericMatrix mat =::Rcpp::as<NumericMatrix>(m);
std::vector<Float_t> dat = Rcpp::as<std::vector<Float_t> >(mat);
std::vector<Float_t> dat = Rcpp::as<std::vector<Float_t>>(mat);
return TMatrixT<Float_t>(mat.rows(), mat.cols(), &dat[0], "F");
}

Expand Down
9 changes: 6 additions & 3 deletions bindings/r/src/TRInterface.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ ClassImp(TRInterface)
static ROOT::R::TRInterface *gR = NULL;
static Bool_t statusEventLoop;

TRInterface::TRInterface(const Int_t argc, const Char_t *argv[], const Bool_t loadRcpp, const Bool_t verbose, const Bool_t interactive): TObject()
TRInterface::TRInterface(const Int_t argc, const Char_t *argv[], const Bool_t loadRcpp, const Bool_t verbose,
const Bool_t interactive)
: TObject()
{
if (RInside::instancePtr()) throw std::runtime_error("Can only have one TRInterface instance");
fR = new RInside(argc, argv, loadRcpp, verbose, interactive);
Expand Down Expand Up @@ -153,7 +155,8 @@ void TRInterface::Interactive()
TRInterface *TRInterface::InstancePtr()
{
if (!gR) {
const Char_t *R_argv[] = {"rootr", "--gui=none", "--no-save", "--no-readline", "--silent", "--vanilla", "--slave"};
const Char_t *R_argv[] = {"rootr", "--gui=none", "--no-save", "--no-readline",
"--silent", "--vanilla", "--slave"};
gR = new TRInterface(7, R_argv, true, false, false);
}
gR->ProcessEventsLoop();
Expand Down Expand Up @@ -198,7 +201,7 @@ void TRInterface::ProcessEventsLoop()
if (!statusEventLoop) {
th = new TThread([](void *args) {
while (kTRUE) {
if (gR) {//in case global object was freed
if (gR) { // in case global object was freed
fd_set *fd;
Int_t usec = 10000;
fd = R_checkActivity(usec, 0);
Expand Down