Skip to content

Commit

Permalink
Hermitian nd (#293)
Browse files Browse the repository at this point in the history
* Allow hermitian to take any rank

* Fix hermitian Size with ND tensors
  • Loading branch information
cliffburdick authored Oct 14, 2022
1 parent ee70f76 commit f251759
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/matx/operators/hermitian.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ namespace matx
}
constexpr __MATX_INLINE__ __MATX_HOST__ __MATX_DEVICE__ index_t Size(int dim) const
{
return op_.Size(Rank() - dim - 1);
// Optimize these branches later
return (dim < (Rank() - 2)) ? op_.Size(dim) : op_.Size((dim == Rank() - 1) ? Rank() - 2 : Rank() - 1);
}
};
}
Expand Down

0 comments on commit f251759

Please sign in to comment.