Skip to content

Commit

Permalink
Format files
Browse files Browse the repository at this point in the history
Co-authored-by: Tobias Ribizel <upsj@users.noreply.github.com>
  • Loading branch information
ginkgo-bot and upsj committed Dec 2, 2020
1 parent 6e40c3c commit 2d65cc8
Show file tree
Hide file tree
Showing 20 changed files with 86 additions and 77 deletions.
18 changes: 12 additions & 6 deletions core/preconditioner/jacobi_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,18 @@ struct precision_reduction_descriptor {
static constexpr GKO_ATTRIBUTES uint32
singleton(const precision_reduction &pr)
{
return pr == precision_reduction(0, 0) ? p0n0
: pr == precision_reduction(0, 1) ? p0n1
: pr == precision_reduction(0, 2) ? p0n2
: pr == precision_reduction(1, 0) ? p1n0
: pr == precision_reduction(1, 1) ? p1n1
: pr == precision_reduction(2, 0) ? p2n0
return pr == precision_reduction(0, 0)
? p0n0
: pr == precision_reduction(0, 1)
? p0n1
: pr == precision_reduction(0, 2)
? p0n2
: pr == precision_reduction(1, 0)
? p1n0
: pr == precision_reduction(1, 1)
? p1n1
: pr == precision_reduction(2, 0)
? p2n0
: p0n0;
}
};
Expand Down
2 changes: 1 addition & 1 deletion core/test/base/executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ struct mock_free : T {
* with `()` operator instead of `{}`.
*/
template <typename... Params>
mock_free(Params &&...params) : T(std::forward<Params>(params)...)
mock_free(Params &&... params) : T(std::forward<Params>(params)...)
{}

void raw_free(void *ptr) const noexcept override
Expand Down
12 changes: 7 additions & 5 deletions core/test/utils/matrix_generator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ template <typename MatrixType = matrix::Dense<>, typename NonzeroDistribution,
std::unique_ptr<MatrixType> generate_random_matrix(
size_type num_rows, size_type num_cols, NonzeroDistribution &&nonzero_dist,
ValueDistribution &&value_dist, Engine &&engine,
std::shared_ptr<const Executor> exec, MatrixArgs &&...args)
std::shared_ptr<const Executor> exec, MatrixArgs &&... args)
{
using value_type = typename MatrixType::value_type;
using index_type = typename MatrixType::index_type;
Expand Down Expand Up @@ -151,7 +151,7 @@ template <typename MatrixType = matrix::Dense<>, typename NonzeroDistribution,
std::unique_ptr<MatrixType> generate_random_sparsity_matrix(
size_type num_rows, size_type num_cols, NonzeroDistribution &&nonzero_dist,
typename MatrixType::value_type value, Engine &&engine,
std::shared_ptr<const Executor> exec, MatrixArgs &&...args)
std::shared_ptr<const Executor> exec, MatrixArgs &&... args)
{
using value_type = typename MatrixType::value_type;
using index_type = typename MatrixType::index_type;
Expand Down Expand Up @@ -213,7 +213,7 @@ std::unique_ptr<MatrixType> generate_random_triangular_matrix(
size_type num_rows, size_type num_cols, bool ones_on_diagonal,
bool lower_triangular, NonzeroDistribution &&nonzero_dist,
ValueDistribution &&value_dist, Engine &&engine,
std::shared_ptr<const Executor> exec, MatrixArgs &&...args)
std::shared_ptr<const Executor> exec, MatrixArgs &&... args)
{
using value_type = typename MatrixType::value_type;
using index_type = typename MatrixType::index_type;
Expand Down Expand Up @@ -297,7 +297,8 @@ template <typename MatrixType = matrix::Dense<>, typename NonzeroDistribution,
std::unique_ptr<MatrixType> generate_random_lower_triangular_matrix(
size_type num_rows, size_type num_cols, bool ones_on_diagonal,
NonzeroDistribution &&nonzero_dist, ValueDistribution &&value_dist,
Engine &&engine, std::shared_ptr<const Executor> exec, MatrixArgs &&...args)
Engine &&engine, std::shared_ptr<const Executor> exec,
MatrixArgs &&... args)
{
return generate_random_triangular_matrix<MatrixType>(
num_rows, num_cols, ones_on_diagonal, true, nonzero_dist, value_dist,
Expand Down Expand Up @@ -330,7 +331,8 @@ template <typename MatrixType = matrix::Dense<>, typename NonzeroDistribution,
std::unique_ptr<MatrixType> generate_random_upper_triangular_matrix(
size_type num_rows, size_type num_cols, bool ones_on_diagonal,
NonzeroDistribution &&nonzero_dist, ValueDistribution &&value_dist,
Engine &&engine, std::shared_ptr<const Executor> exec, MatrixArgs &&...args)
Engine &&engine, std::shared_ptr<const Executor> exec,
MatrixArgs &&... args)
{
return generate_random_triangular_matrix<MatrixType>(
num_rows, num_cols, ones_on_diagonal, false, nonzero_dist, value_dist,
Expand Down
4 changes: 2 additions & 2 deletions include/ginkgo/core/base/abstract_factory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class AbstractFactory
* @return an instance of AbstractProductType
*/
template <typename... Args>
std::unique_ptr<AbstractProductType> generate(Args &&...args) const
std::unique_ptr<AbstractProductType> generate(Args &&... args) const
{
auto product = this->generate_impl({std::forward<Args>(args)...});
for (auto logger : this->loggers_) {
Expand Down Expand Up @@ -159,7 +159,7 @@ class EnableDefaultFactory
using components_type = typename PolymorphicBase::components_type;

template <typename... Args>
std::unique_ptr<ProductType> generate(Args &&...args) const
std::unique_ptr<ProductType> generate(Args &&... args) const
{
auto product = std::unique_ptr<ProductType>(static_cast<ProductType *>(
this->generate_impl({std::forward<Args>(args)...}).release()));
Expand Down
10 changes: 5 additions & 5 deletions include/ginkgo/core/base/combination.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ class Combination : public EnableLinOp<Combination<ValueType>>,
*
* @return a list of coefficients
*/
const std::vector<std::shared_ptr<const LinOp>> &get_coefficients()
const noexcept
const std::vector<std::shared_ptr<const LinOp>> &get_coefficients() const
noexcept
{
return coefficients_;
}
Expand All @@ -78,8 +78,8 @@ class Combination : public EnableLinOp<Combination<ValueType>>,
*
* @return a list of operators
*/
const std::vector<std::shared_ptr<const LinOp>> &get_operators()
const noexcept
const std::vector<std::shared_ptr<const LinOp>> &get_operators() const
noexcept
{
return operators_;
}
Expand Down Expand Up @@ -152,7 +152,7 @@ class Combination : public EnableLinOp<Combination<ValueType>>,
*/
template <typename... Rest>
explicit Combination(std::shared_ptr<const LinOp> coef,
std::shared_ptr<const LinOp> oper, Rest &&...rest)
std::shared_ptr<const LinOp> oper, Rest &&... rest)
: Combination(std::forward<Rest>(rest)...)
{
GKO_ASSERT_EQUAL_DIMENSIONS(coef, dim<2>(1, 1));
Expand Down
6 changes: 3 additions & 3 deletions include/ginkgo/core/base/composition.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ class Composition : public EnableLinOp<Composition<ValueType>>,
*
* @return a list of operators
*/
const std::vector<std::shared_ptr<const LinOp>> &get_operators()
const noexcept
const std::vector<std::shared_ptr<const LinOp>> &get_operators() const
noexcept
{
return operators_;
}
Expand Down Expand Up @@ -133,7 +133,7 @@ class Composition : public EnableLinOp<Composition<ValueType>>,
* @param rest remainging operators
*/
template <typename... Rest>
explicit Composition(std::shared_ptr<const LinOp> oper, Rest &&...rest)
explicit Composition(std::shared_ptr<const LinOp> oper, Rest &&... rest)
: Composition(std::forward<Rest>(rest)...)
{
GKO_ASSERT_CONFORMANT(oper, operators_[0]);
Expand Down
2 changes: 1 addition & 1 deletion include/ginkgo/core/base/dim.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ struct dim {
*/
template <typename... Rest>
constexpr GKO_ATTRIBUTES dim(const dimension_type &first,
const Rest &...rest)
const Rest &... rest)
: first_{first}, rest_{static_cast<dimension_type>(rest)...}
{}

Expand Down
4 changes: 2 additions & 2 deletions include/ginkgo/core/base/executor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ private: \
::gko::syn::as_list<::gko::syn::range<0, sizeof...(Args)>>; \
\
public: \
explicit _name##_operation(Args &&...args) \
explicit _name##_operation(Args &&... args) \
: data(std::forward<Args>(args)...) \
{} \
\
Expand All @@ -365,7 +365,7 @@ private: \
}; \
\
template <typename... Args> \
static _name##_operation<Args...> make_##_name(Args &&...args) \
static _name##_operation<Args...> make_##_name(Args &&... args) \
{ \
return _name##_operation<Args...>(std::forward<Args>(args)...); \
} \
Expand Down
6 changes: 3 additions & 3 deletions include/ginkgo/core/base/lin_op.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ public: \
mutable _name{__VA_ARGS__}; \
\
template <typename... Args> \
auto with_##_name(Args &&..._value) \
auto with_##_name(Args &&... _value) \
const->const std::decay_t<decltype(*this)> & \
{ \
using type = decltype(this->_name); \
Expand Down Expand Up @@ -1029,7 +1029,7 @@ public: \
mutable _name{__VA_ARGS__}; \
\
template <typename... Args> \
auto with_##_name(Args &&..._value) \
auto with_##_name(Args &&... _value) \
const->const std::decay_t<decltype(*this)> & \
{ \
GKO_NOT_IMPLEMENTED; \
Expand Down Expand Up @@ -1058,7 +1058,7 @@ public: \
mutable _name{__VA_ARGS__}; \
\
template <typename... Args> \
auto with_##_name(Args &&..._value) \
auto with_##_name(Args &&... _value) \
const->const std::decay_t<decltype(*this)> & \
{ \
using type = decltype(this->_name); \
Expand Down
2 changes: 1 addition & 1 deletion include/ginkgo/core/base/mtx_io.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void write_raw(std::ostream &os, const matrix_data<ValueType, IndexType> &data,
* @return A MatrixType LinOp filled with data from filename
*/
template <typename MatrixType, typename StreamType, typename... MatrixArgs>
inline std::unique_ptr<MatrixType> read(StreamType &&is, MatrixArgs &&...args)
inline std::unique_ptr<MatrixType> read(StreamType &&is, MatrixArgs &&... args)
{
auto mtx = MatrixType::create(std::forward<MatrixArgs>(args)...);
mtx->read(read_raw<typename MatrixType::value_type,
Expand Down
2 changes: 1 addition & 1 deletion include/ginkgo/core/base/polymorphic_object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ template <typename ConcreteType>
class EnableCreateMethod {
public:
template <typename... Args>
static std::unique_ptr<ConcreteType> create(Args &&...args)
static std::unique_ptr<ConcreteType> create(Args &&... args)
{
return std::unique_ptr<ConcreteType>(
new ConcreteType(std::forward<Args>(args)...));
Expand Down
Loading

0 comments on commit 2d65cc8

Please sign in to comment.