gcc/libstdc++-v3
Alexandre Oliva c787deb012 skip Cholesky decomposition in is>>n_mv_dist
normal_mv_distribution maintains the variance-covariance matrix param
in Cholesky-decomposed form.  Existing param_type constructors, when
taking a full or lower-triangle varcov matrix, perform Cholesky
decomposition to convert it to the internal representation.  This
internal representation is visible both in the varcov() result, and in
the streamed-out representation of a normal_mv_distribution object.

The problem is that when that representation is streamed back in, the
read-back decomposed varcov matrix is used as a lower-triangle
non-decomposed varcov matrix, and it undergoes Cholesky decomposition
again.  So, each cycle of stream-out/stream-in changes the varcov
matrix to its "square root", instead of restoring the original
params.

This patch includes Corentin's changes that introduce verification in
testsuite/ext/random/normal_mv_distribution/operators/serialize.cc and
other similar tests that the object read back in compares equal to the
written-out object: the modified tests pass only if (u == v).

This patch also fixes the error exposed by his change, introducing an
alternate private constructor for param_type, used only by operator>>.


for  libstdc++-v3/ChangeLog

	* include/ext/random
	(normal_mv_distribution::param_type::param_type): New private
	ctor taking a decomposed varcov matrix, for use by...
	(operator>>): ... this, befriended.
	* include/ext/random.tcc (operator>>): Use it.
	(normal_mv_distribution::param_type::_M_init_lower): Adjust
	member function name in exception message.

for  libstdc++-v3/ChangeLog
from  Corentin Gay  <gay@adacore.com>

	* testsuite/ext/random/beta_distribution/operators/serialize.cc,
	testsuite/ext/random/hypergeometric_distribution/operators/serialize.cc,
	testsuite/ext/random/normal_mv_distribution/operators/serialize.cc,
	testsuite/ext/random/triangular_distribution/operators/serialize.cc,
	testsuite/ext/random/von_mises_distribution/operators/serialize.cc:
	Add call to `VERIFY`.

From-SVN: r274233
2019-08-09 09:20:58 +00:00
..
config * config/abi/post/m68k-linux-gnu/baseline_symbols.txt: Update. 2019-07-19 09:57:08 +00:00
doc documentation_hacking.xml: doxygen.org is now doxygen.nl. 2019-08-04 13:20:32 +00:00
include skip Cholesky decomposition in is>>n_mv_dist 2019-08-09 09:20:58 +00:00
libsupc++ PR libstdc++/51333 Define recursive_init_error constructor non-inline 2019-07-29 15:27:19 +01:00
po
python Have std::vector printer's iterator return bool for vector<bool> 2019-06-19 23:57:06 +01:00
scripts
src PR libstdc++/91012 fixfilesystem_error::what() string 2019-06-27 10:42:39 +01:00
testsuite skip Cholesky decomposition in is>>n_mv_dist 2019-08-09 09:20:58 +00:00
acinclude.m4 PR libstdc++/91067 fix missing exports for filesystem iterators 2019-07-03 22:06:25 +01:00
aclocal.m4
ChangeLog skip Cholesky decomposition in is>>n_mv_dist 2019-08-09 09:20:58 +00:00
ChangeLog-1998
ChangeLog-1999
ChangeLog-2000
ChangeLog-2001
ChangeLog-2002
ChangeLog-2003
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015
ChangeLog-2016
ChangeLog-2017
ChangeLog-2018
config.h.in
configure PR libstdc++/91067 fix missing exports for filesystem iterators 2019-07-03 22:06:25 +01:00
configure.ac Fix libstdc++ install-pdf support. 2019-07-01 19:30:52 -07:00
configure.host
crossconfig.m4
fragment.am
linkage.m4
Makefile.am
Makefile.in
README

file: libstdc++-v3/README

New users may wish to point their web browsers to the file
index.html in the 'doc/html' subdirectory.  It contains brief
building instructions and notes on how to configure the library in
interesting ways.