GetDiagonal

Return a diagonal of a matrix as a vector.

C++ API

void GetDiagonal(const Matrix<T> &A, Matrix<T> &d, Int offset = 0)
void GetDiagonal(const DistMatrix<T, U, V> &A, AbstractDistMatrix<T> &d, Int offset = 0)
void GetRealPartOfDiagonal(const Matrix<T> &A, Matrix<Base<T>> &d, Int offset = 0)
void GetRealPartOfDiagonal(const DistMatrix<T, U, V> &A, AbstractDistMatrix<Base<T>> &d, Int offset = 0)
void GetImagPartOfDiagonal(const Matrix<T> &A, Matrix<Base<T>> &d, Int offset = 0)
void GetImagPartOfDiagonal(const DistMatrix<T, U, V> &A, AbstractDistMatrix<Base<T>> &d, Int offset = 0)
Matrix<T> GetDiagonal(const Matrix<T> &A, Int offset = 0)
DistMatrix<T, DiagCol<U, V>(), DiagRow<U, V>()> GetDiagonal(const DistMatrix<T, U, V> &A, Int offset = 0)
Matrix<Base<T>> GetRealPartOfDiagonal(const Matrix<T> &A, Int offset = 0)
DistMatrix<Base<T>, DiagCol<U, V>(), DiagRow<U, V>()> GetRealPartOfDiagonal(const DistMatrix<T, U, V> &A, Int offset = 0)
Matrix<Base<T>> GetImagPartOfDiagonal(const Matrix<T> &A, Int offset = 0)
DistMatrix<Base<T>, DiagCol<U, V>(), DiagRow<U, V>()> GetImagPartOfDiagonal(const DistMatrix<T, U, V> &A, Int offset = 0)

C API

TODO

Python API

TODO