You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
895 B
C

1 month ago
/*------------------------------------------------------------------------------
* Copyright (c) 2023 by Bai Bing (seread@163.com)
* S++ COPYING file for copying and redistribution conditions.
*
* Alians IT Studio.
*----------------------------------------------------------------------------*/
#pragma once
#include <string>
#include "ASMatrix.h"
namespace ais
{
//============================================================================
// Method Description:
/// Return specified diagonals.
///
/// @param array
/// @param offset (Defaults to 0)
/// @param axis (Optional, default ROW) axis the offset is applied to
/// @return Matrix
///
template <typename dtype>
Matrix<dtype> diagonal(const Matrix<dtype> &array, int64_t offset = 0, Axis axis = Axis::ROW)
{
return array.diagonal(offset, axis);
}
} // namespace ais