# net::network

网络包含格点和格点上的半边,两个半边可以相连接 More...

#include <network.hpp>

Inherits from std::map< std::string, node< NodeVal, EdgeVal, std::string, stdEdgeKey, default_traits< NodeVal, EdgeVal, std::string, stdEdgeKey > >, Trait::nodekey_less >

# Public Types

Name
using typename network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait >::iterator IterNode
using node< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait > NodeType
using NodeKey NodeKeyType
using std::set< NodeKey, typename Trait::nodekey_less > NodeKeySetType
using NodeVal NodeValType
using EdgeKey EdgeKeyType
using EdgeVal EdgeValType
using Trait TraitType

# Public Functions

Name
network() =default
network(const network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait > & N)
network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait > & operator=(const network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait > & N)
network(network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait > && ) =default
network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait > & operator=(network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait > && ) =default
IterNode add(const NodeKey & nodekey)
加一个格点,返回这个格点的iterator
void add(const network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait > & n)
加一个网络
void add_edge(const NodeKey & nodekey1, const NodeKey & nodekey2, const EdgeKey & ind1, const EdgeKey & ind2, const EdgeVal & edgeval =EdgeVal())
加一条边
void add_edge(IterNode , IterNode , const EdgeKey & , const EdgeKey & , const EdgeVal & =EdgeVal())
void add_edge(const NodeKey & nodekey1, const NodeKey & nodekey2, const EdgeVal & edgeval =EdgeVal())
加一条边。根据格点名字和Trait::bind自动生成边的名字
void add_edge(IterNode , IterNode , const EdgeVal & =EdgeVal())
void connect_edge(const NodeKey & nodekey1, const NodeKey & nodekey2, const EdgeKey & ind1, const EdgeKey & ind2)
连接两条半边
void connect_edge(IterNode , IterNode , const EdgeKey & , const EdgeKey & )
void add_half_edge(const NodeKey & nodekey1, const EdgeKey & ind1, const EdgeVal & edgeval =EdgeVal())
加一条半边
void add_half_edge(IterNode , const EdgeKey & , const EdgeVal & =EdgeVal())
void del(const NodeKey & nodekey)
删除一个格点
void del(IterNode )
void del_edges(const NodeKey & nodekey1, const NodeKey & nodekey2)
删除两个格点之间的所有边
void del_edges(IterNode , IterNode )
void del_edge(const NodeKey & nodekey, const EdgeKey & ind)
删除一个腿连着的边
void del_edge(IterNode , const EdgeKey & )
void del_half_edge(const NodeKey & nodekey, const EdgeKey & ind)
删除一个半边
void del_half_edge(IterNode , const EdgeKey & )
void break_edge(const NodeKey & nodekey, const EdgeKey & ind)
将一个半边组成的边拆开
void break_edge(IterNode , const EdgeKey & )
IterNode rename(const NodeKey & old_key, const NodeKey & new_key)
重命名一个格点
IterNode rename(const IterNode & , const NodeKey & )
int edge_num(const NodeKey & nk)
返回边数目
int edge_num(const IterNode & )
template <typename absorb_type ,typename contract_type >
void
absorb(const NodeKey & nodekey1, const NodeKey & nodekey2, const absorb_type & absorb_fun, const contract_type & contract_fun)
缩并两个格点,以及它们相连的边
template <typename absorb_type ,typename contract_type >
void
absorb(IterNode , IterNode , const absorb_type & , const contract_type & )
template <typename split_type >
void
split(const NodeKey & nodekey1, const NodeKey & nodekey2, const NodeKey & nodekey3, const std::unordered_set< EdgeKey > & inds, const EdgeKey & ind2, const EdgeKey & ind3, const split_type & split_fun)
将格点1分解为格点2和格点3,inds为属于格点3点半边,格点2和格点3通过半边ind2和ind3相连。
template <typename split_type >
std::pair< IterNode, IterNode >
split(IterNode , const NodeKey & , const NodeKey & , const std::unordered_set< EdgeKey > & , const EdgeKey & , const EdgeKey & , const split_type & )
template <typename split_type >
void
split(const NodeKey & nodekey1, const NodeKey & nodekey2, const std::unordered_set< EdgeKey > & inds, const EdgeKey & ind1, const EdgeKey & ind2, const split_type & split_fun)
将格点1分解为格点1和格点2,inds为属于格点2点半边,格点1和格点2通过半边ind2和ind3相连。
template <typename split_type >
IterNode
split(IterNode , const NodeKey & , const std::unordered_set< EdgeKey > & , const EdgeKey & , const EdgeKey & , const split_type & )
std::string gviz(const std::string & title, const std::vector< std::set< NodeKey, typename Trait::nodekey_less > > & groups, const bool label_bond) const
将网络转化为graphviz格式的字符串
std::string gviz_legend(const std::vector< std::set< NodeKey, typename Trait::nodekey_less > > & groups) const
bool contains(const NodeKey & nodekey)
判断网络是否包含一个格点
bool consistency(std::ostream & diagnosis =std::cout) const
判断网络是否是没有冲突
template <typename absorb_type ,typename contract_type >
NodeVal
contract(const absorb_type & absorb_fun, const contract_type & contract_fun) const
缩并整个网络(不改变网络,只得到值)
template <typename absorb_type ,typename contract_type >
NodeVal
contract(std::set< NodeKey, typename Trait::nodekey_less > part, const absorb_type & absorb_fun, const contract_type & contract_fun) const
缩并一部分网络(不改变网络,只得到值)
template <typename TreeType ,typename absorb_type ,typename contract_type >
NodeVal
contract_tree(std::shared_ptr< TreeType > ctree, const absorb_type & absorb_fun, const contract_type & contract_fun) const
缩并一个树(不改变网络,只得到值)
template <typename absorb_type ,typename contract_type >
NodeKey
absorb(std::set< NodeKey, typename Trait::nodekey_less > part, const absorb_type & absorb_fun, const contract_type & contract_fun)
缩并一部分网络(改变网络)
template <typename TreeType ,typename absorb_type ,typename contract_type >
NodeKey
absorb_tree(std::shared_ptr< TreeType > ctree, const absorb_type & absorb_fun, const contract_type & contract_fun)
缩并一个树(改变网络)
template <typename absorb_type ,typename contract_type >
void
tn_contract1(const NodeKey & nodekey, const std::set< NodeKey, typename Trait::nodekey_less > & group, NodeVal & ten, const absorb_type & absorb_fun, const contract_type & contract_fun) const
缩并的辅助函数
template <typename absorb_type ,typename contract_type >
void
tn_contract1(IterNode , const std::set< NodeKey, typename Trait::nodekey_less > & , NodeVal & , const absorb_type & , const contract_type & ) const
template <typename absorb_type ,typename contract_type >
NodeVal
tn_contract2(const std::set< NodeKey, typename Trait::nodekey_less > & group1, const NodeVal & ten1, const std::set< NodeKey, typename Trait::nodekey_less > & group2, const NodeVal & ten2, const absorb_type & absorb_fun, const contract_type & contract_fun) const
缩并的辅助函数
template <typename NetType2 >
NetType2
fmap(std::function< typename NetType2::NodeValType(const NodeVal &)> f1, std::function< typename NetType2::EdgeValType(const EdgeVal &)> f2) const
利用格点上的信息的函数和边上信息的函数从一个网络得到另一个网络
template <typename NetType2 >
NetType2
fmap(std::function< typename NetType2::NodeValType(const NodeVal &)> f1, std::function< typename NetType2::EdgeValType(const EdgeVal &)> f2, std::function< typename NetType2::NodeKeyType(const NodeKey &)> f3, std::function< typename NetType2::EdgeKeyType(const EdgeKey &)> f4) const
利用格点上的信息的函数和边上信息的函数从一个网络得到另一个网络,同时做sitekey和edgekey的变换
template <typename NodeVal2 ,typename EdgeVal2 ,typename Trait2 >
network< NodeVal2, EdgeVal2, NodeKey, EdgeKey, Trait2 >
gfmap(std::function< NodeVal2(const node< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait > &)> f1, std::function< EdgeVal2(const node< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait > &, const EdgeKey &)> f2) const
利用格点上的信息的函数和边上信息的函数从一个网络得到另一个网络
void fope(std::function< NodeVal(const NodeVal &)> f1, std::function< EdgeVal(const EdgeVal &)> f2)
利用函数更新格点和边上的信息
void gfope(std::function< NodeVal(const node< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait > &)> f1, std::function< EdgeVal(const node< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait > &, const EdgeKey &)> f2)
利用函数更新格点和边上的信息,可用于初始化
template <typename absorb_type ,typename contract_type >
void
absorb(network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait >::IterNode node_itr1, network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait >::IterNode node_itr2, const absorb_type & absorb_fun, const contract_type & contract_fun)
缩并两个格点,以及它们相连的边
template <typename split_type >
std::pair< typename network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait >::IterNode, typename network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait >::IterNode >
split(network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait >::IterNode s1, const NodeKey & nodekey2, const NodeKey & nodekey3, const std::unordered_set< EdgeKey > & inds, const EdgeKey & ind2, const EdgeKey & ind3, const split_type & split_fun)
将格点1分解为格点2和格点3,inds为属于格点3点半边,格点2和格点3通过半边ind2和ind3相连。
template <typename split_type >
network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait >::IterNode
split(network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait >::IterNode s1, const NodeKey & nodekey2, const std::unordered_set< EdgeKey > & inds, const EdgeKey & ind1, const EdgeKey & ind2, const split_type & split_fun)
将格点1分解为格点1和格点2,inds为属于格点2点半边,格点1和格点2通过半边ind2和ind3相连。
template <typename absorb_type ,typename contract_type >
void
tn_contract1(network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait >::IterNode it1, const std::set< NodeKey, typename Trait::nodekey_less > & group, NodeVal & ten, const absorb_type & absorb_fun, const contract_type & contract_fun) const
缩并的辅助函数

# Friends

Name
std::ostream & operator<<(std::ostream & , const network< NodeVal1, EdgeVal1, NodeKey1, EdgeKey1, Trait1 > & )
网络的字符串输出
std::istream & operator>>(std::istream & , network< NodeVal1, EdgeVal1, NodeKey1, EdgeKey1, Trait1 > & )
网络的字符串输入
std::ostream & operator<(std::ostream & , const network< NodeVal1, EdgeVal1, NodeKey1, EdgeKey1, Trait1 > & )
网络的二进制输出
std::istream & operator>(std::istream & , network< NodeVal1, EdgeVal1, NodeKey1, EdgeKey1, Trait1 > & )
网络的二进制输出

# Detailed Description

template <typename NodeVal ,
typename EdgeVal ,
typename NodeKey  =std::string,
typename EdgeKey  =stdEdgeKey,
typename Trait  =default_traits<NodeVal, EdgeVal, NodeKey, EdgeKey>>
class net::network;

网络包含格点和格点上的半边,两个半边可以相连接

Template Parameters:

  • NodeVal 每个格点中附着的信息类型
  • EdgeVal 每个边上附着的信息类型
  • NodeKey 格点名字的类型
  • EdgeKey 边的名字的类型
  • Trait 以上类型的特征,包括输入输出和比较

See: node, half_edge

每个格点和半边拥有一个名字,网络可以通过格点名称寻找格点和半边

# Public Types Documentation

# using IterNode

using net::network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait >::IterNode =  typename network<NodeVal, EdgeVal, NodeKey, EdgeKey, Trait>::iterator;

# using NodeType

using net::network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait >::NodeType =  node<NodeVal, EdgeVal, NodeKey, EdgeKey, Trait>;

# using NodeKeyType

using net::network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait >::NodeKeyType =  NodeKey;

# using NodeKeySetType

using net::network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait >::NodeKeySetType =  std::set<NodeKey, typename Trait::nodekey_less>;

# using NodeValType

using net::network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait >::NodeValType =  NodeVal;

# using EdgeKeyType

using net::network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait >::EdgeKeyType =  EdgeKey;

# using EdgeValType

using net::network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait >::EdgeValType =  EdgeVal;

# using TraitType

using net::network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait >::TraitType =  Trait;

# Public Functions Documentation

# function network

network() =default

# function network

network(
    const network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait > & N
)

# function operator=

network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait > & operator=(
    const network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait > & N
)

# function network

network(
    network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait > && 
) =default

# function operator=

network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait > & operator=(
    network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait > && 
) =default

# function add

IterNode add(
    const NodeKey & nodekey
)

加一个格点,返回这个格点的iterator

# function add

void add(
    const network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait > & n
)

加一个网络

# function add_edge

void add_edge(
    const NodeKey & nodekey1,
    const NodeKey & nodekey2,
    const EdgeKey & ind1,
    const EdgeKey & ind2,
    const EdgeVal & edgeval =EdgeVal()
)

加一条边

# function add_edge

void add_edge(
    IterNode ,
    IterNode ,
    const EdgeKey & ,
    const EdgeKey & ,
    const EdgeVal &  =EdgeVal()
)

# function add_edge

void add_edge(
    const NodeKey & nodekey1,
    const NodeKey & nodekey2,
    const EdgeVal & edgeval =EdgeVal()
)

加一条边。根据格点名字和Trait::bind自动生成边的名字

# function add_edge

void add_edge(
    IterNode ,
    IterNode ,
    const EdgeVal &  =EdgeVal()
)

# function connect_edge

void connect_edge(
    const NodeKey & nodekey1,
    const NodeKey & nodekey2,
    const EdgeKey & ind1,
    const EdgeKey & ind2
)

连接两条半边

# function connect_edge

void connect_edge(
    IterNode ,
    IterNode ,
    const EdgeKey & ,
    const EdgeKey & 
)

# function add_half_edge

void add_half_edge(
    const NodeKey & nodekey1,
    const EdgeKey & ind1,
    const EdgeVal & edgeval =EdgeVal()
)

加一条半边

# function add_half_edge

void add_half_edge(
    IterNode ,
    const EdgeKey & ,
    const EdgeVal &  =EdgeVal()
)

# function del

void del(
    const NodeKey & nodekey
)

删除一个格点

# function del

void del(
    IterNode 
)

# function del_edges

void del_edges(
    const NodeKey & nodekey1,
    const NodeKey & nodekey2
)

删除两个格点之间的所有边

# function del_edges

void del_edges(
    IterNode ,
    IterNode 
)

# function del_edge

void del_edge(
    const NodeKey & nodekey,
    const EdgeKey & ind
)

删除一个腿连着的边

# function del_edge

void del_edge(
    IterNode ,
    const EdgeKey & 
)

# function del_half_edge

void del_half_edge(
    const NodeKey & nodekey,
    const EdgeKey & ind
)

删除一个半边

# function del_half_edge

void del_half_edge(
    IterNode ,
    const EdgeKey & 
)

# function break_edge

void break_edge(
    const NodeKey & nodekey,
    const EdgeKey & ind
)

将一个半边组成的边拆开

# function break_edge

void break_edge(
    IterNode ,
    const EdgeKey & 
)

# function rename

IterNode rename(
    const NodeKey & old_key,
    const NodeKey & new_key
)

重命名一个格点

# function rename

IterNode rename(
    const IterNode & ,
    const NodeKey & 
)

# function edge_num

int edge_num(
    const NodeKey & nk
)

返回边数目

# function edge_num

int edge_num(
    const IterNode & 
)

# function absorb

template <typename absorb_type ,
typename contract_type >
void absorb(
    const NodeKey & nodekey1,
    const NodeKey & nodekey2,
    const absorb_type & absorb_fun,
    const contract_type & contract_fun
)

缩并两个格点,以及它们相连的边

# function absorb

template <typename absorb_type ,
typename contract_type >
void absorb(
    IterNode ,
    IterNode ,
    const absorb_type & ,
    const contract_type & 
)

# function split

template <typename split_type >
void split(
    const NodeKey & nodekey1,
    const NodeKey & nodekey2,
    const NodeKey & nodekey3,
    const std::unordered_set< EdgeKey > & inds,
    const EdgeKey & ind2,
    const EdgeKey & ind3,
    const split_type & split_fun
)

将格点1分解为格点2和格点3,inds为属于格点3点半边,格点2和格点3通过半边ind2和ind3相连。

# function split

template <typename split_type >
std::pair< IterNode, IterNode > split(
    IterNode ,
    const NodeKey & ,
    const NodeKey & ,
    const std::unordered_set< EdgeKey > & ,
    const EdgeKey & ,
    const EdgeKey & ,
    const split_type & 
)

# function split

template <typename split_type >
void split(
    const NodeKey & nodekey1,
    const NodeKey & nodekey2,
    const std::unordered_set< EdgeKey > & inds,
    const EdgeKey & ind1,
    const EdgeKey & ind2,
    const split_type & split_fun
)

将格点1分解为格点1和格点2,inds为属于格点2点半边,格点1和格点2通过半边ind2和ind3相连。

# function split

template <typename split_type >
IterNode split(
    IterNode ,
    const NodeKey & ,
    const std::unordered_set< EdgeKey > & ,
    const EdgeKey & ,
    const EdgeKey & ,
    const split_type & 
)

# function gviz

std::string gviz(
    const std::string & title,
    const std::vector< std::set< NodeKey, typename Trait::nodekey_less > > & groups,
    const bool label_bond
) const

将网络转化为graphviz格式的字符串

# function gviz_legend

std::string gviz_legend(
    const std::vector< std::set< NodeKey, typename Trait::nodekey_less > > & groups
) const

# function contains

bool contains(
    const NodeKey & nodekey
)

判断网络是否包含一个格点

# function consistency

bool consistency(
    std::ostream & diagnosis =std::cout
) const

判断网络是否是没有冲突

# function contract

template <typename absorb_type ,
typename contract_type >
NodeVal contract(
    const absorb_type & absorb_fun,
    const contract_type & contract_fun
) const

缩并整个网络(不改变网络,只得到值)

# function contract

template <typename absorb_type ,
typename contract_type >
NodeVal contract(
    std::set< NodeKey, typename Trait::nodekey_less > part,
    const absorb_type & absorb_fun,
    const contract_type & contract_fun
) const

缩并一部分网络(不改变网络,只得到值)

# function contract_tree

template <typename TreeType ,
typename absorb_type ,
typename contract_type >
NodeVal contract_tree(
    std::shared_ptr< TreeType > ctree,
    const absorb_type & absorb_fun,
    const contract_type & contract_fun
) const

缩并一个树(不改变网络,只得到值)

# function absorb

template <typename absorb_type ,
typename contract_type >
NodeKey absorb(
    std::set< NodeKey, typename Trait::nodekey_less > part,
    const absorb_type & absorb_fun,
    const contract_type & contract_fun
)

缩并一部分网络(改变网络)

# function absorb_tree

template <typename TreeType ,
typename absorb_type ,
typename contract_type >
NodeKey absorb_tree(
    std::shared_ptr< TreeType > ctree,
    const absorb_type & absorb_fun,
    const contract_type & contract_fun
)

缩并一个树(改变网络)

# function tn_contract1

template <typename absorb_type ,
typename contract_type >
void tn_contract1(
    const NodeKey & nodekey,
    const std::set< NodeKey, typename Trait::nodekey_less > & group,
    NodeVal & ten,
    const absorb_type & absorb_fun,
    const contract_type & contract_fun
) const

缩并的辅助函数

# function tn_contract1

template <typename absorb_type ,
typename contract_type >
void tn_contract1(
    IterNode ,
    const std::set< NodeKey, typename Trait::nodekey_less > & ,
    NodeVal & ,
    const absorb_type & ,
    const contract_type & 
) const

# function tn_contract2

template <typename absorb_type ,
typename contract_type >
NodeVal tn_contract2(
    const std::set< NodeKey, typename Trait::nodekey_less > & group1,
    const NodeVal & ten1,
    const std::set< NodeKey, typename Trait::nodekey_less > & group2,
    const NodeVal & ten2,
    const absorb_type & absorb_fun,
    const contract_type & contract_fun
) const

缩并的辅助函数

# function fmap

template <typename NetType2 >
NetType2 fmap(
    std::function< typename NetType2::NodeValType(const NodeVal &)> f1,
    std::function< typename NetType2::EdgeValType(const EdgeVal &)> f2
) const

利用格点上的信息的函数和边上信息的函数从一个网络得到另一个网络

# function fmap

template <typename NetType2 >
NetType2 fmap(
    std::function< typename NetType2::NodeValType(const NodeVal &)> f1,
    std::function< typename NetType2::EdgeValType(const EdgeVal &)> f2,
    std::function< typename NetType2::NodeKeyType(const NodeKey &)> f3,
    std::function< typename NetType2::EdgeKeyType(const EdgeKey &)> f4
) const

利用格点上的信息的函数和边上信息的函数从一个网络得到另一个网络,同时做sitekey和edgekey的变换

# function gfmap

template <typename NodeVal2 ,
typename EdgeVal2 ,
typename Trait2 >
network< NodeVal2, EdgeVal2, NodeKey, EdgeKey, Trait2 > gfmap(
    std::function< NodeVal2(const node< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait > &)> f1,
    std::function< EdgeVal2(const node< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait > &, const EdgeKey &)> f2
) const

利用格点上的信息的函数和边上信息的函数从一个网络得到另一个网络

# function fope

void fope(
    std::function< NodeVal(const NodeVal &)> f1,
    std::function< EdgeVal(const EdgeVal &)> f2
)

利用函数更新格点和边上的信息

# function gfope

void gfope(
    std::function< NodeVal(const node< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait > &)> f1,
    std::function< EdgeVal(const node< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait > &, const EdgeKey &)> f2
)

利用函数更新格点和边上的信息,可用于初始化

# function absorb

template <typename absorb_type ,
typename contract_type >
void absorb(
    network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait >::IterNode node_itr1,
    network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait >::IterNode node_itr2,
    const absorb_type & absorb_fun,
    const contract_type & contract_fun
)

缩并两个格点,以及它们相连的边

# function split

template <typename split_type >
std::pair< typename network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait >::IterNode, typename network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait >::IterNode > split(
    network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait >::IterNode s1,
    const NodeKey & nodekey2,
    const NodeKey & nodekey3,
    const std::unordered_set< EdgeKey > & inds,
    const EdgeKey & ind2,
    const EdgeKey & ind3,
    const split_type & split_fun
)

将格点1分解为格点2和格点3,inds为属于格点3点半边,格点2和格点3通过半边ind2和ind3相连。

# function split

template <typename split_type >
network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait >::IterNode split(
    network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait >::IterNode s1,
    const NodeKey & nodekey2,
    const std::unordered_set< EdgeKey > & inds,
    const EdgeKey & ind1,
    const EdgeKey & ind2,
    const split_type & split_fun
)

将格点1分解为格点1和格点2,inds为属于格点2点半边,格点1和格点2通过半边ind2和ind3相连。

# function tn_contract1

template <typename absorb_type ,
typename contract_type >
void tn_contract1(
    network< NodeVal, EdgeVal, NodeKey, EdgeKey, Trait >::IterNode it1,
    const std::set< NodeKey, typename Trait::nodekey_less > & group,
    NodeVal & ten,
    const absorb_type & absorb_fun,
    const contract_type & contract_fun
) const

缩并的辅助函数

# Friends

# friend operator<<

friend std::ostream & operator<<(
    std::ostream & ,
    const network< NodeVal1, EdgeVal1, NodeKey1, EdgeKey1, Trait1 > & 
);

网络的字符串输出

# friend operator>>

friend std::istream & operator>>(
    std::istream & ,
    network< NodeVal1, EdgeVal1, NodeKey1, EdgeKey1, Trait1 > & 
);

网络的字符串输入

# friend operator<

friend std::ostream & operator<(
    std::ostream & ,
    const network< NodeVal1, EdgeVal1, NodeKey1, EdgeKey1, Trait1 > & 
);

网络的二进制输出

# friend operator>

friend std::istream & operator>(
    std::istream & ,
    network< NodeVal1, EdgeVal1, NodeKey1, EdgeKey1, Trait1 > & 
);

网络的二进制输出


Updated on 15 June 2022 at 16:04:19 CST