I am using the standard BinaryFormatter to serialize a very large object graph with some third-party objects in the mix. I tried others like Protobuf/JSON/XML and for one reason or another they all failed. The data is essentially the results of a complicated AI algorithm and has a large number of doubles in a heavily nested tree. Many of which could be NaN.
It seems that when a double is NaN then the BinaryFormatter fails silently and deals with it. It would be nice if it handled it correctly.
The core issue is described in this link.
Is there a work around so I can directly deal with NaN? I can serialize things directly however that could be a lot of work.
Edit:
In one of the heavy offenders which is a Naive Bayes implementation the code is:
public double[][][] Distributions { get; private set; }
public double[] Priors { get; private set; }