1 /* This file is part of libDAI - http://www.libdai.org/
3 * Copyright (c) 2006-2011, The libDAI authors. All rights reserved.
5 * Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
10 /// \brief Provides functionality for input/output of data structures in various file formats
13 #ifndef __defined_libdai_io_h
14 #define __defined_libdai_io_h
17 #include <dai/factor.h>
25 /// Reads factor graph (as a pair of a variable vector and factor vector) from a file in the UAI approximate inference challenge format
26 /** \param[in] filename The filename (usually ends with ".uai")
27 * \param[in] verbose The amount of output sent to cout
28 * \param[out] vars Array of variables read from the file
29 * \param[out] factors Array of factors read from the file
30 * \param[out] permutations Array of permutations, which permute between libDAI canonical ordering and ordering specified by the file
31 * \see http://www.cs.huji.ac.il/project/UAI10 and http://graphmod.ics.uci.edu/uai08
33 void ReadUaiAieFactorGraphFile( const char *filename
, size_t verbose
, std::vector
<Var
>& vars
, std::vector
<Factor
>& factors
, std::vector
<Permute
>& permutations
);
36 /// Reads evidence (a mapping from observed variable labels to the observed values) from a file in the UAI approximate inference challenge format
37 /** \param[in] filename The filename (usually ends with ".uai.evid")
38 * \param[in] verbose The amount of output sent to cout
39 * \see http://www.cs.huji.ac.il/project/UAI10 and http://graphmod.ics.uci.edu/uai08
41 std::vector
<std::map
<size_t, size_t> > ReadUaiAieEvidenceFile( const char* filename
, size_t verbose
);
44 } // end of namespace dai