Skip to content

Commit

Permalink
Fix clang formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ckendrick committed Jul 29, 2021
1 parent 9a1a8f2 commit 0d3e6c1
Showing 1 changed file with 38 additions and 38 deletions.
76 changes: 38 additions & 38 deletions src/tensors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,10 @@ class vector
template<mem_type omem, resource r_ = resrc, typename = enable_for_host<r_>>
vector<P> operator-(vector<P, omem> const &right) const;
template<mem_type omem, resource r_ = resrc, typename = enable_for_host<r_>>
P operator*(vector<P, omem> const &) const;
P operator*(vector<P, omem> const &)const;

template<mem_type omem, resource r_ = resrc, typename = enable_for_host<r_>>
vector<P> operator*(matrix<P, omem> const &) const;
vector<P> operator*(matrix<P, omem> const &)const;

template<resource r_ = resrc, typename = enable_for_host<r_>>
vector<P> operator*(P const) const;
Expand Down Expand Up @@ -475,9 +475,9 @@ class matrix
template<resource r_ = resrc, typename = enable_for_host<r_>>
matrix<P> operator*(P const) const;
template<mem_type omem, resource r_ = resrc, typename = enable_for_host<r_>>
vector<P> operator*(vector<P, omem> const &) const;
vector<P> operator*(vector<P, omem> const &)const;
template<mem_type omem, resource r_ = resrc, typename = enable_for_host<r_>>
matrix<P> operator*(matrix<P, omem> const &) const;
matrix<P> operator*(matrix<P, omem> const &)const;
template<mem_type omem, resource r_ = resrc, typename = enable_for_host<r_>>
matrix<P> operator+(matrix<P, omem> const &) const;
template<mem_type omem, resource r_ = resrc, typename = enable_for_host<r_>>
Expand Down Expand Up @@ -1005,8 +1005,8 @@ fk::vector<P, mem, resrc>::vector(vector<P, mem, resrc> const &a)
// http://stackoverflow.com/questions/3279543/what-is-the-copy-and-swap-idiom
//
template<typename P, mem_type mem, resource resrc>
fk::vector<P, mem, resrc> &
fk::vector<P, mem, resrc>::operator=(vector<P, mem, resrc> const &a)
fk::vector<P, mem, resrc> &fk::vector<P, mem, resrc>::
operator=(vector<P, mem, resrc> const &a)
{
static_assert(mem != mem_type::const_view,
"cannot copy assign into const_view!");
Expand Down Expand Up @@ -1051,8 +1051,8 @@ fk::vector<P, mem, resrc>::vector(vector<P, mem, resrc> &&a)
// vector move assignment
//
template<typename P, mem_type mem, resource resrc>
fk::vector<P, mem, resrc> &
fk::vector<P, mem, resrc>::operator=(vector<P, mem, resrc> &&a)
fk::vector<P, mem, resrc> &fk::vector<P, mem, resrc>::
operator=(vector<P, mem, resrc> &&a)
{
static_assert(mem != mem_type::const_view,
"cannot move assign into const_view!");
Expand Down Expand Up @@ -1098,8 +1098,8 @@ fk::vector<P, mem, resrc>::vector(vector<PP, omem> const &a)
//
template<typename P, mem_type mem, resource resrc>
template<typename PP, mem_type omem, mem_type, typename, resource, typename>
fk::vector<P, mem> &
fk::vector<P, mem, resrc>::operator=(vector<PP, omem> const &a)
fk::vector<P, mem> &fk::vector<P, mem, resrc>::
operator=(vector<PP, omem> const &a)
{
expect(size() == a.size());

Expand Down Expand Up @@ -1133,8 +1133,8 @@ fk::vector<P, mem, resrc>::vector(vector<P, omem, resrc> const &a)
// assignment owner <-> view
template<typename P, mem_type mem, resource resrc>
template<mem_type omem, mem_type, typename>
fk::vector<P, mem, resrc> &
fk::vector<P, mem, resrc>::operator=(vector<P, omem, resrc> const &a)
fk::vector<P, mem, resrc> &fk::vector<P, mem, resrc>::
operator=(vector<P, omem, resrc> const &a)
{
expect(size() == a.size());
if constexpr (resrc == resource::host)
Expand Down Expand Up @@ -1200,8 +1200,8 @@ fk::vector<P, mem, resrc> &fk::vector<P, mem, resrc>::transfer_from(
//
template<typename P, mem_type mem, resource resrc>
template<mem_type, typename, resource, typename>
fk::vector<P, mem> &
fk::vector<P, mem, resrc>::operator=(std::vector<P> const &v)
fk::vector<P, mem> &fk::vector<P, mem, resrc>::
operator=(std::vector<P> const &v)
{
expect(size() == static_cast<int>(v.size()));
std::memcpy(data_, v.data(), v.size() * sizeof(P));
Expand Down Expand Up @@ -1287,8 +1287,8 @@ bool fk::vector<P, mem, resrc>::operator<(vector<P, omem> const &other) const
//
template<typename P, mem_type mem, resource resrc>
template<mem_type omem, resource, typename>
fk::vector<P>
fk::vector<P, mem, resrc>::operator+(vector<P, omem> const &right) const
fk::vector<P> fk::vector<P, mem, resrc>::
operator+(vector<P, omem> const &right) const
{
expect(size() == right.size());
vector<P> ans(size());
Expand All @@ -1302,8 +1302,8 @@ fk::vector<P, mem, resrc>::operator+(vector<P, omem> const &right) const
//
template<typename P, mem_type mem, resource resrc>
template<mem_type omem, resource, typename>
fk::vector<P>
fk::vector<P, mem, resrc>::operator-(vector<P, omem> const &right) const
fk::vector<P> fk::vector<P, mem, resrc>::
operator-(vector<P, omem> const &right) const
{
expect(size() == right.size());
vector<P> ans(size());
Expand Down Expand Up @@ -1332,8 +1332,8 @@ P fk::vector<P, mem, resrc>::operator*(vector<P, omem> const &right) const
//
template<typename P, mem_type mem, resource resrc>
template<mem_type omem, resource, typename>
fk::vector<P>
fk::vector<P, mem, resrc>::operator*(fk::matrix<P, omem> const &A) const
fk::vector<P> fk::vector<P, mem, resrc>::
operator*(fk::matrix<P, omem> const &A) const
{
// check dimension compatibility
expect(size() == A.nrows());
Expand Down Expand Up @@ -1789,8 +1789,8 @@ fk::matrix<P, mem, resrc>::matrix(matrix<P, mem, resrc> const &a)
// http://stackoverflow.com/questions/3279543/what-is-the-copy-and-swap-idiom
//
template<typename P, mem_type mem, resource resrc>
fk::matrix<P, mem, resrc> &
fk::matrix<P, mem, resrc>::operator=(matrix<P, mem, resrc> const &a)
fk::matrix<P, mem, resrc> &fk::matrix<P, mem, resrc>::
operator=(matrix<P, mem, resrc> const &a)
{
static_assert(mem != mem_type::const_view,
"cannot copy assign into const_view!");
Expand Down Expand Up @@ -1843,8 +1843,8 @@ fk::matrix<P, mem, resrc>::matrix(matrix<P, omem, resrc> const &a)
// assignment owner <-> view
template<typename P, mem_type mem, resource resrc>
template<mem_type omem, mem_type, typename>
fk::matrix<P, mem, resrc> &
fk::matrix<P, mem, resrc>::operator=(matrix<P, omem, resrc> const &a)
fk::matrix<P, mem, resrc> &fk::matrix<P, mem, resrc>::
operator=(matrix<P, omem, resrc> const &a)
{
expect(nrows() == a.nrows());
expect(ncols() == a.ncols());
Expand Down Expand Up @@ -1883,8 +1883,8 @@ fk::matrix<P, mem, resrc>::matrix(matrix<PP, omem> const &a)
//
template<typename P, mem_type mem, resource resrc>
template<typename PP, mem_type omem, mem_type, typename, resource, typename>
fk::matrix<P, mem> &
fk::matrix<P, mem, resrc>::operator=(matrix<PP, omem> const &a)
fk::matrix<P, mem> &fk::matrix<P, mem, resrc>::
operator=(matrix<PP, omem> const &a)
{
expect((nrows() == a.nrows()) && (ncols() == a.ncols()));

Expand Down Expand Up @@ -1975,8 +1975,8 @@ fk::matrix<P, mem, resrc>::matrix(matrix<P, mem, resrc> &&a)
// matrix move assignment
//
template<typename P, mem_type mem, resource resrc>
fk::matrix<P, mem, resrc> &
fk::matrix<P, mem, resrc>::operator=(matrix<P, mem, resrc> &&a)
fk::matrix<P, mem, resrc> &fk::matrix<P, mem, resrc>::
operator=(matrix<P, mem, resrc> &&a)
{
static_assert(mem != mem_type::const_view,
"cannot move assign into const_view!");
Expand Down Expand Up @@ -2007,8 +2007,8 @@ fk::matrix<P, mem, resrc>::operator=(matrix<P, mem, resrc> &&a)
//
template<typename P, mem_type mem, resource resrc>
template<mem_type omem, mem_type, typename, resource, typename>
fk::matrix<P, mem> &
fk::matrix<P, mem, resrc>::operator=(fk::vector<P, omem> const &v)
fk::matrix<P, mem> &fk::matrix<P, mem, resrc>::
operator=(fk::vector<P, omem> const &v)
{
expect(nrows() * ncols() == v.size());

Expand Down Expand Up @@ -2094,8 +2094,8 @@ bool fk::matrix<P, mem, resrc>::operator<(matrix<P, omem> const &other) const
//
template<typename P, mem_type mem, resource resrc>
template<mem_type omem, resource, typename>
fk::matrix<P>
fk::matrix<P, mem, resrc>::operator+(matrix<P, omem> const &right) const
fk::matrix<P> fk::matrix<P, mem, resrc>::
operator+(matrix<P, omem> const &right) const
{
expect(nrows() == right.nrows() && ncols() == right.ncols());

Expand All @@ -2115,8 +2115,8 @@ fk::matrix<P, mem, resrc>::operator+(matrix<P, omem> const &right) const
//
template<typename P, mem_type mem, resource resrc>
template<mem_type omem, resource, typename>
fk::matrix<P>
fk::matrix<P, mem, resrc>::operator-(matrix<P, omem> const &right) const
fk::matrix<P> fk::matrix<P, mem, resrc>::
operator-(matrix<P, omem> const &right) const
{
expect(nrows() == right.nrows() && ncols() == right.ncols());

Expand Down Expand Up @@ -2154,8 +2154,8 @@ fk::matrix<P> fk::matrix<P, mem, resrc>::operator*(P const right) const
//
template<typename P, mem_type mem, resource resrc>
template<mem_type omem, resource, typename>
fk::vector<P>
fk::matrix<P, mem, resrc>::operator*(fk::vector<P, omem> const &right) const
fk::vector<P> fk::matrix<P, mem, resrc>::
operator*(fk::vector<P, omem> const &right) const
{
// check dimension compatibility
expect(ncols() == right.size());
Expand All @@ -2181,8 +2181,8 @@ fk::matrix<P, mem, resrc>::operator*(fk::vector<P, omem> const &right) const
//
template<typename P, mem_type mem, resource resrc>
template<mem_type omem, resource, typename>
fk::matrix<P>
fk::matrix<P, mem, resrc>::operator*(matrix<P, omem> const &B) const
fk::matrix<P> fk::matrix<P, mem, resrc>::
operator*(matrix<P, omem> const &B) const
{
expect(ncols() == B.nrows()); // k == k

Expand Down

0 comments on commit 0d3e6c1

Please sign in to comment.