Fix some operations API mismatch
* Compound operators were not usable properly. * std::size_t was used in the API in places where Index should have been used.
This commit is contained in:
parent
f8cb289529
commit
c7aa4a0afa
12 changed files with 152 additions and 120 deletions
|
|
@ -17,7 +17,7 @@
|
|||
//==================================================================================================
|
||||
CLASSNAME::CLASSNAME() : storage_(std::make_unique<payload>(0, 0)) {}
|
||||
|
||||
CLASSNAME::CLASSNAME(std::size_t r, std::size_t c)
|
||||
CLASSNAME::CLASSNAME(Index r, Index c)
|
||||
: storage_(std::make_unique<payload>(r, c))
|
||||
{
|
||||
}
|
||||
|
|
@ -27,9 +27,7 @@ CLASSNAME::CLASSNAME(std::initializer_list<std::initializer_list<TYPE>> init)
|
|||
{
|
||||
}
|
||||
|
||||
CLASSNAME::CLASSNAME(std::size_t r,
|
||||
std::size_t c,
|
||||
std::initializer_list<TYPE> init)
|
||||
CLASSNAME::CLASSNAME(Index r, Index c, std::initializer_list<TYPE> init)
|
||||
: CLASSNAME(r, c)
|
||||
{
|
||||
auto first = init.begin();
|
||||
|
|
@ -71,32 +69,32 @@ rotgen::Index CLASSNAME::size() const
|
|||
return storage_->data.size();
|
||||
}
|
||||
|
||||
void CLASSNAME::resize(std::size_t new_rows, std::size_t new_cols)
|
||||
void CLASSNAME::resize(Index new_rows, Index new_cols)
|
||||
{
|
||||
storage_->data.resize(new_rows, new_cols);
|
||||
}
|
||||
|
||||
void CLASSNAME::conservativeResize(std::size_t new_rows, std::size_t new_cols)
|
||||
void CLASSNAME::conservativeResize(Index new_rows, Index new_cols)
|
||||
{
|
||||
storage_->data.conservativeResize(new_rows, new_cols);
|
||||
}
|
||||
|
||||
TYPE& CLASSNAME::operator()(std::size_t i, std::size_t j)
|
||||
TYPE& CLASSNAME::operator()(Index i, Index j)
|
||||
{
|
||||
return storage_->data(i, j);
|
||||
}
|
||||
|
||||
TYPE const& CLASSNAME::operator()(std::size_t i, std::size_t j) const
|
||||
TYPE const& CLASSNAME::operator()(Index i, Index j) const
|
||||
{
|
||||
return storage_->data(i, j);
|
||||
}
|
||||
|
||||
TYPE& CLASSNAME::operator()(std::size_t index)
|
||||
TYPE& CLASSNAME::operator()(Index index)
|
||||
{
|
||||
return storage_->data(index);
|
||||
}
|
||||
|
||||
TYPE const& CLASSNAME::operator()(std::size_t index) const
|
||||
TYPE const& CLASSNAME::operator()(Index index) const
|
||||
{
|
||||
return storage_->data(index);
|
||||
}
|
||||
|
|
@ -303,27 +301,27 @@ CLASSNAME& CLASSNAME::operator/=(TYPE s)
|
|||
//==============================================================================
|
||||
// Generators functions
|
||||
//==============================================================================
|
||||
void CLASSNAME::setOnes(std::size_t rows, std::size_t cols)
|
||||
void CLASSNAME::setOnes(Index rows, Index cols)
|
||||
{
|
||||
storage_->assign(payload::data_type::Ones(rows, cols).eval());
|
||||
}
|
||||
|
||||
void CLASSNAME::setZero(std::size_t rows, std::size_t cols)
|
||||
void CLASSNAME::setZero(Index rows, Index cols)
|
||||
{
|
||||
storage_->assign(payload::data_type::Zero(rows, cols).eval());
|
||||
}
|
||||
|
||||
void CLASSNAME::setConstant(std::size_t rows, std::size_t cols, TYPE value)
|
||||
void CLASSNAME::setConstant(Index rows, Index cols, TYPE value)
|
||||
{
|
||||
storage_->assign(payload::data_type::Constant(rows, cols, value).eval());
|
||||
}
|
||||
|
||||
void CLASSNAME::setRandom(std::size_t rows, std::size_t cols)
|
||||
void CLASSNAME::setRandom(Index rows, Index cols)
|
||||
{
|
||||
storage_->assign(payload::data_type::Random(rows, cols).eval());
|
||||
}
|
||||
|
||||
void CLASSNAME::setIdentity(std::size_t rows, std::size_t cols)
|
||||
void CLASSNAME::setIdentity(Index rows, Index cols)
|
||||
{
|
||||
storage_->assign(payload::data_type::Identity(rows, cols).eval());
|
||||
}
|
||||
|
|
@ -331,21 +329,21 @@ void CLASSNAME::setIdentity(std::size_t rows, std::size_t cols)
|
|||
//==============================================================================
|
||||
// Static functions
|
||||
//==============================================================================
|
||||
CLASSNAME CLASSNAME::Ones(std::size_t rows, std::size_t cols)
|
||||
CLASSNAME CLASSNAME::Ones(Index rows, Index cols)
|
||||
{
|
||||
CLASSNAME m;
|
||||
m.storage_ = std::make_unique<payload>(payload::data_type::Ones(rows, cols));
|
||||
return m;
|
||||
}
|
||||
|
||||
CLASSNAME CLASSNAME::Zero(std::size_t rows, std::size_t cols)
|
||||
CLASSNAME CLASSNAME::Zero(Index rows, Index cols)
|
||||
{
|
||||
CLASSNAME m;
|
||||
m.storage_ = std::make_unique<payload>(payload::data_type::Zero(rows, cols));
|
||||
return m;
|
||||
}
|
||||
|
||||
CLASSNAME CLASSNAME::Constant(std::size_t rows, std::size_t cols, TYPE value)
|
||||
CLASSNAME CLASSNAME::Constant(Index rows, Index cols, TYPE value)
|
||||
{
|
||||
CLASSNAME m;
|
||||
m.storage_ =
|
||||
|
|
@ -353,7 +351,7 @@ CLASSNAME CLASSNAME::Constant(std::size_t rows, std::size_t cols, TYPE value)
|
|||
return m;
|
||||
}
|
||||
|
||||
CLASSNAME CLASSNAME::Random(std::size_t rows, std::size_t cols)
|
||||
CLASSNAME CLASSNAME::Random(Index rows, Index cols)
|
||||
{
|
||||
CLASSNAME m;
|
||||
m.storage_ =
|
||||
|
|
@ -361,7 +359,7 @@ CLASSNAME CLASSNAME::Random(std::size_t rows, std::size_t cols)
|
|||
return m;
|
||||
}
|
||||
|
||||
CLASSNAME CLASSNAME::Identity(std::size_t rows, std::size_t cols)
|
||||
CLASSNAME CLASSNAME::Identity(Index rows, Index cols)
|
||||
{
|
||||
CLASSNAME m;
|
||||
m.storage_ =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue