Skip to content

Commit bffd6ff

Browse files
Fix indentation
1 parent 2b8d411 commit bffd6ff

File tree

2 files changed

+32
-32
lines changed

2 files changed

+32
-32
lines changed

inst/include/Rcpp/sugar/matrix/lower_tri.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// lower_tri.h: Rcpp R/C++ interface class library -- lower.tri
44
//
55
// Copyright (C) 2010 - 2017 Dirk Eddelbuettel and Romain Francois
6-
// Copyright (C) 2017 Dirk Eddelbuettel, Romain Francois, and Nathan Russell
6+
// Copyright (C) 2017 Dirk Eddelbuettel, Romain Francois, and Nathan Russell
77
//
88
// This file is part of Rcpp.
99
//
@@ -29,39 +29,39 @@ namespace sugar {
2929
template <int RTYPE, bool NA, typename T>
3030
class LowerTri : public MatrixBase<LGLSXP, false, LowerTri<RTYPE, NA, T> > {
3131
public:
32-
typedef Rcpp::MatrixBase<RTYPE, NA, T> MatBase;
32+
typedef Rcpp::MatrixBase<RTYPE, NA, T> MatBase;
3333

34-
LowerTri(const T& lhs, bool diag)
35-
: nr(lhs.nrow()),
34+
LowerTri(const T& lhs, bool diag)
35+
: nr(lhs.nrow()),
3636
nc(lhs.ncol()),
37-
getter(diag ? (&LowerTri::get_diag_true) : (&LowerTri::get_diag_false))
37+
getter(diag ? (&LowerTri::get_diag_true) : (&LowerTri::get_diag_false))
3838
{}
3939

40-
inline int operator()(int i, int j) const { return get(i, j); }
40+
inline int operator()(int i, int j) const { return get(i, j); }
4141

42-
inline R_xlen_t size() const { return static_cast<R_xlen_t>(nr) * nc; }
43-
inline int nrow() const { return nr; }
44-
inline int ncol() const { return nc; }
42+
inline R_xlen_t size() const { return static_cast<R_xlen_t>(nr) * nc; }
43+
inline int nrow() const { return nr; }
44+
inline int ncol() const { return nc; }
4545

4646
private:
47-
typedef bool (LowerTri::*Method)(int, int) const;
47+
typedef bool (LowerTri::*Method)(int, int) const;
4848

49-
int nr, nc;
50-
Method getter;
49+
int nr, nc;
50+
Method getter;
5151

52-
inline bool get_diag_true(int i, int j) const { return i >= j; }
52+
inline bool get_diag_true(int i, int j) const { return i >= j; }
5353

54-
inline bool get_diag_false(int i, int j) const { return i > j; }
54+
inline bool get_diag_false(int i, int j) const { return i > j; }
5555

56-
inline bool get(int i, int j) const { return (this->*getter)(i, j); }
56+
inline bool get(int i, int j) const { return (this->*getter)(i, j); }
5757
};
5858

5959
} // sugar
6060

6161
template <int RTYPE, bool NA, typename T>
6262
inline sugar::LowerTri<RTYPE, NA, T>
6363
lower_tri(const Rcpp::MatrixBase<RTYPE, NA, T>& lhs, bool diag = false) {
64-
return sugar::LowerTri<RTYPE, NA, T>(lhs, diag);
64+
return sugar::LowerTri<RTYPE, NA, T>(lhs, diag);
6565
}
6666

6767
} // Rcpp

inst/include/Rcpp/sugar/matrix/upper_tri.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,39 +29,39 @@ namespace sugar {
2929
template <int RTYPE, bool NA, typename T>
3030
class UpperTri : public MatrixBase<LGLSXP, false, UpperTri<RTYPE, NA, T> > {
3131
public:
32-
typedef Rcpp::MatrixBase<RTYPE, NA, T> MatBase;
32+
typedef Rcpp::MatrixBase<RTYPE, NA, T> MatBase;
3333

34-
UpperTri(const T& lhs, bool diag)
35-
: nr(lhs.nrow()),
36-
nc(lhs.ncol()),
37-
getter(diag ? (&UpperTri::get_diag_true) : (&UpperTri::get_diag_false))
34+
UpperTri(const T& lhs, bool diag)
35+
: nr(lhs.nrow()),
36+
nc(lhs.ncol()),
37+
getter(diag ? (&UpperTri::get_diag_true) : (&UpperTri::get_diag_false))
3838
{}
3939

40-
inline int operator()(int i, int j) const { return get(i, j); }
40+
inline int operator()(int i, int j) const { return get(i, j); }
4141

42-
inline R_xlen_t size() const { return static_cast<R_xlen_t>(nr) * nc; }
43-
inline int nrow() const { return nr; }
44-
inline int ncol() const { return nc; }
42+
inline R_xlen_t size() const { return static_cast<R_xlen_t>(nr) * nc; }
43+
inline int nrow() const { return nr; }
44+
inline int ncol() const { return nc; }
4545

4646
private:
47-
typedef bool (UpperTri::*Method)(int, int) const;
47+
typedef bool (UpperTri::*Method)(int, int) const;
4848

49-
int nr, nc;
50-
Method getter;
49+
int nr, nc;
50+
Method getter;
5151

52-
inline bool get_diag_true(int i, int j) const { return i <= j; }
52+
inline bool get_diag_true(int i, int j) const { return i <= j; }
5353

54-
inline bool get_diag_false(int i, int j) const { return i < j; }
54+
inline bool get_diag_false(int i, int j) const { return i < j; }
5555

56-
inline bool get(int i, int j) const { return (this->*getter)(i, j); }
56+
inline bool get(int i, int j) const { return (this->*getter)(i, j); }
5757
};
5858

5959
} // sugar
6060

6161
template <int RTYPE, bool NA, typename T>
6262
inline sugar::UpperTri<RTYPE, NA, T>
6363
upper_tri(const Rcpp::MatrixBase<RTYPE, NA, T>& lhs, bool diag = false) {
64-
return sugar::UpperTri<RTYPE, NA, T>(lhs, diag);
64+
return sugar::UpperTri<RTYPE, NA, T>(lhs, diag);
6565
}
6666

6767
} // Rcpp

0 commit comments

Comments
 (0)