types::ndarray<T,N> transpose(types::ndarray<T,N> const & a) { long t[N]; for(unsigned long i = 0; i<N; ++i) t[N-1-i] = i; return _transpose(a, t); }
namespace numpy { template <class T> auto swapaxes(T &&a, int axis1, int axis2) -> decltype(_transpose( std::forward<T>(a), std::declval<long[std::decay<T>::type::value]>())); PROXY_DECL(pythonic::numpy, swapaxes); }
types::ndarray<T,N> swapaxes(types::ndarray<T,N> const & a, int axis1, int axis2) { long t[N]; for(unsigned long i = 0; i<N; ++i) t[i] = i; std::swap(t[axis1], t[axis2]); return _transpose(a, t); }
types::ndarray<T,N> transpose(types::ndarray<T,N> const & a, types::array<long, M> const& t) { static_assert(N==M, "axes don't match array"); long val = t[M-1]; if(val>=long(N)) throw types::ValueError("invalid axis for this array"); return _transpose(a, &t[0]); }
/*-------------------------------------------------------------*/ void AzDmat::transpose(AzDmat *m_out, int col_begin, int col_end) const { int col_b = col_begin, col_e = col_end; if (col_b < 0) { col_b = 0; col_e = col_num; } else { if (col_b >= col_num || col_e < 0 || col_e > col_num || col_e - col_b <= 0) { throw new AzException("AzDmat::transpose", "column range error"); } } _transpose(m_out, col_b, col_e); }
IntervalMatrix IntervalMatrix::transpose() const { return _transpose(*this); }
DistMat & operator~(){ return _transpose(); }
QJSValue THREEMatrix4::transpose() { return m_engine->newQObject(_transpose()); }
Matrix Matrix::transpose() const { return _transpose(*this); }