示例#1
0
 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);
 }
示例#2
0
  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);
  }
示例#3
0
 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);
 }
示例#4
0
            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]);
            }
示例#5
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); 
}
示例#6
0
IntervalMatrix IntervalMatrix::transpose() const {
	return _transpose(*this);
}
示例#7
0
文件: math.hpp 项目: bmabey/graphchi
 DistMat & operator~(){
   return _transpose();
 }
示例#8
0
QJSValue THREEMatrix4::transpose()
{
    return m_engine->newQObject(_transpose());
}
示例#9
0
Matrix Matrix::transpose() const {
	return _transpose(*this);
}