Add matrix isNan function.

This commit is contained in:
sunwen
2023-05-05 17:21:33 +08:00
parent dbd69936bd
commit 73f58cfca8
2 changed files with 14 additions and 0 deletions

View File

@@ -252,6 +252,18 @@ namespace Aurora {
return !mData || mInfo.empty();
}
bool Matrix::isNan() const
{
for(size_t i=0; i<getDataSize(); ++i)
{
if(mData.get()[i] != NAN)
{
return false;
}
}
return true;
}
bool Matrix::isScalar() const {
return (getDimSize(0) == 1 &&
getDimSize(1) == 1 &&

View File

@@ -178,6 +178,8 @@ namespace Aurora {
*/
bool isNull() const;
bool isNan() const;
bool isVector() const;
/**