added some asserts
This commit is contained in:
@@ -53,6 +53,10 @@ namespace Divergence {
|
||||
auto log1 = std::log(det1);
|
||||
auto log2 = std::log(det2);
|
||||
|
||||
//determinate shouldn't be 0!
|
||||
Assert::isNot0(det1, "Determinat of the first Gauss is Zero! Check the Cov Matrix.");
|
||||
Assert::isNot0(det2, "Determinat of the second Gauss is Zero! Check the Cov Matrix.");
|
||||
|
||||
//trace
|
||||
Eigen::MatrixXd toTrace(norm1.getSigma().rows(),norm1.getSigma().cols());
|
||||
toTrace = norm2.getSigmaInv() * norm1.getSigma();
|
||||
@@ -74,6 +78,8 @@ namespace Divergence {
|
||||
if(klb < 0.0){
|
||||
Assert::doThrow("The Kullback Leibler Distance is < 0! Thats not possible");
|
||||
}
|
||||
Assert::isNotNaN(klb, "The Kullback Leibler Distance is NaN!");
|
||||
|
||||
return klb;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user