Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 20 additions & 14 deletions dash/include/dash/Matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -609,54 +609,58 @@ class Matrix
local_type sub_local() noexcept;

/**
* Projection to given offset in first sub-dimension (column), same as
* \c sub<0>(n).
* Projection to given offset in second sub-dimension (column), same as
* \c sub<1>(n).
*
* \returns A \ref MatrixRef object representing the nth column
*
* \see sub
* \see row
*/
const_view_type<NumDimensions-1> col(
typename std::enable_if<NumDimensions==2, const_view_type<1>>::type
col(
size_type n ///< Column offset.
) const;

/**
* Projection to given offset in first sub-dimension (column), same as
* \c sub<0>(n).
* Projection to given offset in second sub-dimension (column), same as
* \c sub<1>(n).
*
* \returns A \ref MatrixRef object representing the nth column
*
* \see sub
* \see row
*/
view_type<NumDimensions-1> col(
typename std::enable_if<NumDimensions==2, view_type<1>>::type
col(
size_type n ///< Column offset.
);

/**
* Projection to given offset in second sub-dimension (rows), same as
* \c sub<1>(n).
* Projection to given offset in first sub-dimension (rows), same as
* \c sub<0>(n).
*
* \returns A \ref MatrixRef object representing the nth row
*
* \see sub
* \see col
*/
const_view_type<NumDimensions-1> row(
typename std::enable_if<NumDimensions==2, const_view_type<1>>::type
row(
size_type n ///< Row offset.
) const;

/**
* Projection to given offset in second sub-dimension (rows), same as
* \c sub<1>(n).
* Projection to given offset in first sub-dimension (rows), same as
* \c sub<0>(n).
*
* \returns A \ref MatrixRef object representing the nth row
*
* \see sub
* \see col
*/
view_type<NumDimensions-1> row(
typename std::enable_if<NumDimensions==2, view_type<1>>::type
row(
size_type n ///< Row offset.
);

Expand All @@ -669,7 +673,8 @@ class Matrix
*
* \see sub
*/
view_type<NumDimensions> cols(
typename std::enable_if<NumDimensions==2, view_type<2>>::type
cols(
size_type offset, ///< Offset of first column in range.
size_type range ///< Number of columns in the range.
);
Expand All @@ -683,7 +688,8 @@ class Matrix
*
* \see sub
*/
view_type<NumDimensions> rows(
typename std::enable_if<NumDimensions==2, view_type<2>>::type
rows(
size_type n, ///< Offset of first row in range.
size_type range ///< Number of rows in the range.
);
Expand Down
18 changes: 12 additions & 6 deletions dash/include/dash/matrix/internal/Matrix-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,8 @@ ::sub(
}

template <typename T, dim_t NumDim, typename IndexT, class PatternT, typename LocalMemT>
MatrixRef<const T, NumDim, NumDim-1, PatternT, LocalMemT>
typename std::enable_if<(NumDim==2),
MatrixRef<const T, NumDim, 1, PatternT, LocalMemT>>::type
Matrix<T, NumDim, IndexT, PatternT, LocalMemT>
::col(
size_type n) const
Expand All @@ -620,7 +621,8 @@ ::col(
}

template <typename T, dim_t NumDim, typename IndexT, class PatternT, typename LocalMemT>
MatrixRef<T, NumDim, NumDim-1, PatternT, LocalMemT>
typename std::enable_if<(NumDim==2),
MatrixRef<T, NumDim, 1, PatternT, LocalMemT>>::type
Matrix<T, NumDim, IndexT, PatternT, LocalMemT>
::col(
size_type n)
Expand All @@ -629,7 +631,8 @@ ::col(
}

template <typename T, dim_t NumDim, typename IndexT, class PatternT, typename LocalMemT>
MatrixRef<const T, NumDim, NumDim-1, PatternT, LocalMemT>
typename std::enable_if<(NumDim==2),
MatrixRef<const T, NumDim, 1, PatternT, LocalMemT>>::type
Matrix<T, NumDim, IndexT, PatternT, LocalMemT>
::row(
size_type n) const
Expand All @@ -638,7 +641,8 @@ ::row(
}

template <typename T, dim_t NumDim, typename IndexT, class PatternT, typename LocalMemT>
MatrixRef<T, NumDim, NumDim-1, PatternT, LocalMemT>
typename std::enable_if<(NumDim==2),
MatrixRef<T, NumDim, 1, PatternT, LocalMemT>>::type
Matrix<T, NumDim, IndexT, PatternT, LocalMemT>
::row(
size_type n)
Expand All @@ -647,7 +651,8 @@ ::row(
}

template <typename T, dim_t NumDim, typename IndexT, class PatternT, typename LocalMemT>
MatrixRef<T, NumDim, NumDim, PatternT, LocalMemT>
typename std::enable_if<(NumDim==2),
MatrixRef<T, NumDim, 2, PatternT, LocalMemT>>::type
Matrix<T, NumDim, IndexT, PatternT, LocalMemT>
::rows(
size_type offset,
Expand All @@ -657,7 +662,8 @@ ::rows(
}

template <typename T, dim_t NumDim, typename IndexT, class PatternT, typename LocalMemT>
MatrixRef<T, NumDim, NumDim, PatternT, LocalMemT>
typename std::enable_if<(NumDim==2),
MatrixRef<T, NumDim, 2, PatternT, LocalMemT>>::type
Matrix<T, NumDim, IndexT, PatternT, LocalMemT>
::cols(
size_type offset,
Expand Down