Does the library have some way to represent missing or invalid values in vectors and matrices? A good reference is Numpy masked arrays.
Asked
Active
Viewed 416 times
1 Answers
0
To represent a missing or invalid data (or any kind of data you can not trust) you can use double.NaN
. In that sense you can not trust any values obtained from that data. Those untrusted values will be double.NaN
too.
var d = double.NaN;
var A = DenseMatrix.OfArray(new double[,]
{
{ d, 0, 0 },
{ 0, 1, 0 },
{ 0, 0, 1 }
});
var B = DenseMatrix.OfArray(new double[,]
{
{ 1, 0, 0 },
{ 0, d, 0 },
{ 0, 0, 1 }
});
Console.WriteLine(A*B);
Gives:
DenseMatrix 3x3-Double
NaN NaN NaN
0 NaN 0
0 NaN 1

CSDev
- 3,177
- 6
- 19
- 37