Skip to content

Commit

Permalink
rand: testing input configurations, nakagami-m
Browse files Browse the repository at this point in the history
  • Loading branch information
jgaeddert committed Dec 3, 2023
1 parent 3a23578 commit 5432e31
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/random/tests/random_autotest.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,5 +201,17 @@ void autotest_random_config()
// gamma: pdf, cdf with valid input, but negative variable
CONTEND_EQUALITY( randgammaf_pdf(-2.0f, 1.2f, 2.3f), 0.0f );
CONTEND_EQUALITY( randgammaf_cdf(-2.0f, 1.2f, 2.3f), 0.0f );

// nakagami-m: parameters out of range (m)
CONTEND_EQUALITY( randnakmf ( 0.2f, 1.0f), 0.0f );
CONTEND_EQUALITY( randnakmf_pdf( 0.0f, 0.2f, 1.0f), 0.0f );
CONTEND_EQUALITY( randnakmf_cdf( 0.0f, 0.2f, 1.0f), 0.0f );
// nakagami-m: parameters out of range (omega)
CONTEND_EQUALITY( randnakmf ( 1.0f, -1.0f), 0.0f );
CONTEND_EQUALITY( randnakmf_pdf( 0.0f, 1.0f, -1.0f), 0.0f );
CONTEND_EQUALITY( randnakmf_cdf( 0.0f, 1.0f, -1.0f), 0.0f );
// nakagami-m: pdf, cdf with valid input, but negative variable
CONTEND_EQUALITY( randnakmf_pdf(-2.0f, 1.2f, 2.3f), 0.0f );
CONTEND_EQUALITY( randnakmf_cdf(-2.0f, 1.2f, 2.3f), 0.0f );
}

0 comments on commit 5432e31

Please sign in to comment.