NumCpp
2.4.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
fillDiagnol.hpp
Go to the documentation of this file.
1
#pragma once
29
30
#include "
NumCpp/Core/Shape.hpp
"
31
#include "
NumCpp/Core/Types.hpp
"
32
#include "
NumCpp/NdArray.hpp
"
33
34
namespace
nc
35
{
36
//============================================================================
37
// Method Description:
45
template
<
typename
dtype>
46
void
fillDiagonal
(
NdArray<dtype>
& inArray, dtype inValue) noexcept
47
{
48
const
auto
inShape = inArray.shape();
49
for
(
uint32
row = 0; row < inShape.rows; ++row)
50
{
51
if
(row < inShape.cols)
52
{
53
inArray(row, row) = inValue;
54
}
55
}
56
}
57
}
// namespace nc
nc::NdArray< dtype >
nc::uint32
std::uint32_t uint32
Definition:
Types.hpp:40
NdArray.hpp
nc::fillDiagonal
void fillDiagonal(NdArray< dtype > &inArray, dtype inValue) noexcept
Definition:
fillDiagnol.hpp:46
Shape.hpp
nc
Definition:
Coordinate.hpp:44
Types.hpp
include
NumCpp
Functions
fillDiagnol.hpp
Generated by
1.8.17