libDAI
createfg.h
Go to the documentation of this file.
1 /* This file is part of libDAI - http://www.libdai.org/
2  *
3  * Copyright (c) 2006-2011, The libDAI authors. All rights reserved.
4  *
5  * Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
6  */
7 
8 
11 
12 
13 #ifndef __defined_libdai_createfg_h
14 #define __defined_libdai_createfg_h
15 
16 
17 #include <dai/factor.h>
18 #include <vector>
19 #include <map>
20 
21 
22 namespace dai {
23 
25 DAI_ENUM(FactorType,ISINGGAUSS,ISINGUNIFORM,EXPGAUSS,POTTS);
26 
27 
29 
34 FactorGraph createFG( const GraphAL &G, FactorType ft, size_t states, const PropertySet &props );
35 
36 FactorGraph createHOIFG( size_t N, size_t M, size_t k, Real beta );
37 
38 BipartiteGraph createRandomBipartiteGraph( size_t N1, size_t N2, size_t d1, size_t d2 );
39 
40 int powmod (int x, int n, int p);
41 
42 size_t order (int x, int p);
43 
44 bool isPrime (size_t n);
45 
46 BipartiteGraph createSmallLDPCGraph();
47 
48 BipartiteGraph createGroupStructuredLDPCGraph( size_t p, size_t j, size_t k );
49 
50 void createParityCheck( Real *result, size_t n, Real eps );
51 } // end of namespace dai
52 
53 
54 #endif
BipartiteGraph createSmallLDPCGraph()
Constructs a regular LDPC graph with N=6, j=2, K=4, k=3.
Definition: createfg.cpp:217
FactorGraph createFG(const GraphAL &G, FactorType ft, size_t states, const PropertySet &props)
Creates a factor graph from a pairwise interactions graph.
Definition: createfg.cpp:35
BipartiteGraph createGroupStructuredLDPCGraph(size_t p, size_t j, size_t k)
Creates group-structured LDPC code.
Definition: createfg.cpp:247
double Real
Real number (alias for double, which could be changed to long double if necessary) ...
Definition: util.h:98
FactorGraph createHOIFG(size_t N, size_t M, size_t k, Real beta)
Return a random factor graph with higher-order interactions.
Definition: createfg.cpp:115
size_t order(int x, int p)
Returns order of x in GF(p) with p prime.
Definition: createfg.cpp:193
DAI_ENUM(LDPCType, SMALL, GROUP, RANDOM)
Possible LDPC structures.
int powmod(int x, int n, int p)
Returns x**n % p, assuming p is prime.
Definition: createfg.cpp:184
BipartiteGraph createRandomBipartiteGraph(size_t N1, size_t N2, size_t d1, size_t d2)
Creates a regular random bipartite graph.
Definition: createfg.cpp:149
bool isPrime(size_t n)
Returns whether n is a prime number.
Definition: createfg.cpp:207
Namespace for libDAI.
Definition: alldai.cpp:16
Defines TFactor<> and Factor classes which represent factors in probability distributions.