Add graph references

This commit is contained in:
Abdelrahman Said
2026-06-28 13:49:01 +01:00
parent 0a9807e448
commit a11edf0c53
2578 changed files with 868045 additions and 0 deletions
+362
View File
@@ -0,0 +1,362 @@
# Specify the list of .xml files that are used as-is
set(
DOCBOOK_SOURCES
fdl.xml
gpl.xml
igraph-docs.xml
installation.xml
introduction.xml
licenses.xml
glossary.xml
pmt.xml
tutorial.xml
)
# Specify the list of .xxml files that have to be piped through doxrox to
# obtain the final set of .xml files that serve as an input to DocBook
set(
DOXROX_SOURCES
adjlist.xxml
attributes.xxml
basicigraph.xxml
bipartite.xxml
bitset.xxml
cliques.xxml
coloring.xxml
community.xxml
cycles.xxml
dqueue.xxml
embedding.xxml
error.xxml
flows.xxml
foreign.xxml
games.xxml
generators.xxml
graphlets.xxml
heap.xxml
hrg.xxml
isomorphism.xxml
iterators.xxml
layout.xxml
linalg.xxml
matrix.xxml
memory.xxml
motifs.xxml
nongraph.xxml
operators.xxml
progress.xxml
processes.xxml
psumtree.xxml
random.xxml
separators.xxml
sparsemat.xxml
spatial.xxml
stack.xxml
status.xxml
structural.xxml
strvector.xxml
threading.xxml
vector.xxml
vectorlist.xxml
visitors.xxml
)
# Specify the igraph source files that may contain documentation chunks
file(
GLOB_RECURSE IGRAPH_SOURCES_FOR_DOXROX
LIST_DIRECTORIES FALSE
${CMAKE_SOURCE_DIR}/include/*.h
${CMAKE_BINARY_DIR}/include/*.h
${CMAKE_SOURCE_DIR}/src/*.c
${CMAKE_SOURCE_DIR}/src/*.cc
${CMAKE_SOURCE_DIR}/src/*.cpp
${CMAKE_SOURCE_DIR}/src/*.h
${CMAKE_SOURCE_DIR}/src/*.pmt
)
# Specify the igraph source files that are used as examples in the
# documentation
file(
GLOB DOCBOOK_EXAMPLES
LIST_DIRECTORIES FALSE
RELATIVE ${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/examples/simple/*.c
${CMAKE_SOURCE_DIR}/examples/tutorial/*.c
)
# You should not need to change anything below this line if you are simply
# trying to add new files to produce documentation from
# Documentation build requires Python and source-highlight
find_package(Python3)
find_program(SOURCE_HIGHLIGHT_COMMAND source-highlight)
# HTML documentation additionally requires xmlto from DocBook
find_program(XMLTO_COMMAND xmlto)
# PDF documentation additionally requires xsltproc, xmllint and Apache FOP
find_program(FOP_COMMAND fop)
find_program(XMLLINT_COMMAND xmllint)
find_program(XSLTPROC_COMMAND xsltproc)
# GNU Texinfo documentation additionally requires the docbook2X package,
# makeinfo (and xmllint as well). The docbook2texi command from docbook2X
# is renamed to docbook2x-texi by many Linux distros to avoid conflict with
# a command of the same name from the incompatible docbook-tools package.
# We look for both command names, and prefer docbook2x-texi if found.
# At the moment we do not validate that docbook2texi is from docbook2X
# instead of docbook-tools. Such validation will be possible with CMake >= 3.25.
find_program(DOCBOOK2XTEXI_COMMAND NAMES docbook2x-texi docbook2texi)
find_program(MAKEINFO_COMMAND makeinfo)
if(Python3_FOUND AND SOURCE_HIGHLIGHT_COMMAND)
set(DOC_BUILD_SUPPORTED TRUE)
else()
set(DOC_BUILD_SUPPORTED FALSE)
endif()
if(DOC_BUILD_SUPPORTED AND XMLTO_COMMAND)
set(HTML_DOC_BUILD_SUPPORTED TRUE)
else()
set(HTML_DOC_BUILD_SUPPORTED FALSE)
endif()
if(DOC_BUILD_SUPPORTED AND XMLLINT_COMMAND AND XSLTPROC_COMMAND AND FOP_COMMAND)
set(PDF_DOC_BUILD_SUPPORTED TRUE)
else()
set(PDF_DOC_BUILD_SUPPORTED FALSE)
endif()
if(DOC_BUILD_SUPPORTED AND XMLLINT_COMMAND AND DOCBOOK2XTEXI_COMMAND AND MAKEINFO_COMMAND)
set(INFO_DOC_BUILD_SUPPORTED TRUE)
else()
set(INFO_DOC_BUILD_SUPPORTED FALSE)
endif()
if(DOC_BUILD_SUPPORTED)
set(DOXROX_COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/doxrox.py)
set(DOXROX_RULES ${CMAKE_CURRENT_SOURCE_DIR}/c-docbook.re)
set(DOXROX_CHUNKS ${CMAKE_CURRENT_BINARY_DIR}/chunks.pickle)
set(DOXROX_CACHE ${CMAKE_CURRENT_BINARY_DIR}/doxrox.cache)
set(DOCBOOK_INPUTS "")
set(DOCBOOK_GENERATED_INPUTS "")
# Specify that each DocBook .xml file is to be copied to the build folder
# TODO(ntamas): currently this works with out-of-tree builds only
set(IGRAPH_VERSION ${PACKAGE_VERSION}) # for replacement in igraph-docs.xml
foreach(DOCBOOK_SOURCE ${DOCBOOK_SOURCES})
set(DOCBOOK_INPUT "${CMAKE_CURRENT_BINARY_DIR}/${DOCBOOK_SOURCE}")
list(APPEND DOCBOOK_INPUTS "${DOCBOOK_INPUT}")
configure_file(${DOCBOOK_SOURCE} ${DOCBOOK_INPUT})
endforeach()
# Specify that .xxml files should be piped through doxrox.py to get a
# DocBook-compatible .xml file. This step inserts the documentation chunks
# extracted from the igraph source to the DocBook sources
foreach(DOXROX_SOURCE ${DOXROX_SOURCES})
string(REGEX REPLACE "[.]xxml$" ".xml" DOXROX_OUTPUT ${DOXROX_SOURCE})
set(COMMENT "Generating ${DOXROX_OUTPUT} from ${DOXROX_SOURCE}")
string(PREPEND DOXROX_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/")
list(APPEND DOCBOOK_INPUTS "${DOXROX_OUTPUT}")
list(APPEND DOCBOOK_GENERATED_INPUTS "${DOXROX_OUTPUT}")
add_custom_command(
OUTPUT ${DOXROX_OUTPUT}
COMMAND ${DOXROX_COMMAND}
ARGS
-t ${CMAKE_CURRENT_SOURCE_DIR}/${DOXROX_SOURCE}
--chunks ${DOXROX_CHUNKS}
-o ${DOXROX_OUTPUT}
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/${DOXROX_SOURCE}
DEPENDS ${DOXROX_CHUNKS}
COMMENT ${COMMENT}
)
endforeach()
# When all .xxml and .xml files have been processed, we have to send them
# through a custom Python script that extracts the ID references and produces
# a ctags-compatible "tags" file. This will then be used later by
# source-highlight to cross-reference the known tokens from the source code
# of the examples
list(JOIN DOCBOOK_GENERATED_INPUTS ";" DOCBOOK_GENERATED_INPUTS_AS_STRING)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/tags"
COMMAND ${CMAKE_COMMAND}
ARGS
-DINPUT_FILES="${DOCBOOK_GENERATED_INPUTS_AS_STRING}"
-DOUTPUT_FILE=${CMAKE_CURRENT_BINARY_DIR}/tags
-P ${CMAKE_SOURCE_DIR}/etc/cmake/generate_tags_file.cmake
DEPENDS ${DOCBOOK_GENERATED_INPUTS}
COMMENT "Creating tags file from DocBook xmls"
)
# Specify that each example source file is to be piped through source-higlight
# to produce an .xml representation that can be used in the DocBook
# documentation
foreach(DOCBOOK_EXAMPLE_SOURCE ${DOCBOOK_EXAMPLES})
string(REGEX REPLACE "[.]c$" ".c.xml" DOCBOOK_EXAMPLE_OUTPUT ${DOCBOOK_EXAMPLE_SOURCE})
set(COMMENT "Highlighting source code in ${DOCBOOK_EXAMPLE_SOURCE}")
set(DOCBOOK_EXAMPLE_OUTPUT "${CMAKE_BINARY_DIR}/${DOCBOOK_EXAMPLE_SOURCE}.xml")
list(APPEND DOCBOOK_INPUTS "${DOCBOOK_EXAMPLE_OUTPUT}")
get_filename_component(DOCBOOK_EXAMPLE_OUTPUT_DIR "${DOCBOOK_EXAMPLE_OUTPUT}" DIRECTORY)
add_custom_command(
OUTPUT ${DOCBOOK_EXAMPLE_OUTPUT}
COMMAND ${CMAKE_COMMAND} -E make_directory ${DOCBOOK_EXAMPLE_OUTPUT_DIR}
COMMAND ${Python3_EXECUTABLE}
ARGS
${CMAKE_SOURCE_DIR}/tools/strip_licenses_from_examples.py
${CMAKE_SOURCE_DIR}/${DOCBOOK_EXAMPLE_SOURCE}
${CMAKE_BINARY_DIR}/${DOCBOOK_EXAMPLE_SOURCE}
COMMAND ${SOURCE_HIGHLIGHT_COMMAND}
ARGS
--src-lang c
--out-format docbook
--input ${CMAKE_BINARY_DIR}/${DOCBOOK_EXAMPLE_SOURCE}
--output ${DOCBOOK_EXAMPLE_OUTPUT}
--gen-references inline
--ctags=""
--outlang-def ${CMAKE_SOURCE_DIR}/doc/docbook.outlang
MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/${DOCBOOK_EXAMPLE_SOURCE}
DEPENDS tags
COMMENT ${COMMENT}
)
endforeach()
add_custom_command(
OUTPUT ${DOXROX_CHUNKS} ${DOXROX_CACHE}
COMMAND ${DOXROX_COMMAND}
ARGS
-e ${DOXROX_RULES}
-o ${DOXROX_CHUNKS}
--cache ${DOXROX_CACHE}
${IGRAPH_SOURCES_FOR_DOXROX}
MAIN_DEPENDENCY ${DOXROX_RULES}
DEPENDS ${IGRAPH_SOURCES_FOR_DOXROX}
COMMENT "Parsing documentation chunks from source code"
)
set(DOCXML_STAMP ${CMAKE_CURRENT_BINARY_DIR}/xmlstamp)
add_custom_command(
OUTPUT ${DOCXML_STAMP}
COMMAND ${CMAKE_COMMAND} -E touch ${DOCXML_STAMP}
MAIN_DEPENDENCY igraph-docs.xml
DEPENDS ${DOCBOOK_INPUTS}
)
add_custom_target(docxml DEPENDS ${DOCXML_STAMP})
if(HTML_DOC_BUILD_SUPPORTED)
set(HTML_STAMP ${CMAKE_CURRENT_BINARY_DIR}/html/stamp)
add_custom_command(
OUTPUT ${HTML_STAMP}
COMMAND ${XMLTO_COMMAND} -x ${CMAKE_CURRENT_SOURCE_DIR}/gtk-doc.xsl -o html xhtml igraph-docs.xml
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/html/*.css ${CMAKE_CURRENT_BINARY_DIR}/html
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/html/*.js ${CMAKE_CURRENT_BINARY_DIR}/html
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/html/*.png ${CMAKE_CURRENT_BINARY_DIR}/html
COMMAND ${CMAKE_COMMAND} -E touch ${HTML_STAMP}
MAIN_DEPENDENCY igraph-docs.xml
# The DEPENDS clause below needs to list both the xmlstamp file and the
# target that creates it. The former is needed to make Ninja rebuild the
# HTML files if the source is modified. The latter is needed to make the
# XCode build system happy.
DEPENDS ${DOCXML_STAMP} docxml
COMMENT "Generating HTML documentation with xmlto"
)
add_custom_target(html DEPENDS ${HTML_STAMP})
set(HTML_TARGET html)
endif()
add_custom_command(
OUTPUT igraph-docs-with-resolved-includes.xml
COMMAND ${XMLLINT_COMMAND}
ARGS
--xinclude
--output igraph-docs-with-resolved-includes-tmp.xml
igraph-docs.xml
COMMAND ${Python3_EXECUTABLE}
ARGS
${CMAKE_SOURCE_DIR}/tools/removeexamples.py
igraph-docs-with-resolved-includes-tmp.xml
igraph-docs-with-resolved-includes.xml
COMMAND ${CMAKE_COMMAND}
ARGS
-E remove igraph-docs-with-resolved-includes-tmp.xml
MAIN_DEPENDENCY igraph-docs.xml
# The DEPENDS clause below needs to list both the xmlstamp file and the
# target that creates it. The former is needed to make Ninja rebuild the
# PDF file if the source is modified. The latter is needed to make the
# XCode build system happy.
DEPENDS ${DOCXML_STAMP} docxml
)
# Intermediate custom target because Xcode projects cannot have commands that
# depend on intermediate files from other commands
add_custom_target(
_generate-resolved-docbook-xml DEPENDS igraph-docs-with-resolved-includes.xml
COMMENT "Resolving includes in DocBook XML source"
)
if(PDF_DOC_BUILD_SUPPORTED)
add_custom_command(
OUTPUT igraph-docs.fo
COMMAND ${XSLTPROC_COMMAND}
ARGS
--output igraph-docs.fo
--stringparam paper.type A4
http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl
igraph-docs-with-resolved-includes.xml
DEPENDS _generate-resolved-docbook-xml
COMMENT "Converting DocBook XML to Apache FOP format"
)
add_custom_command(
OUTPUT igraph-docs.pdf
COMMAND ${FOP_COMMAND}
ARGS -fo igraph-docs.fo -pdf igraph-docs.pdf
MAIN_DEPENDENCY igraph-docs.fo
COMMENT "Generating PDF documentation with Apache FOP"
)
add_custom_target(pdf DEPENDS igraph-docs.pdf)
set(PDF_TARGET pdf)
endif()
if(INFO_DOC_BUILD_SUPPORTED)
add_custom_command(
OUTPUT igraph-docs.texi
COMMAND ${DOCBOOK2XTEXI_COMMAND}
ARGS
--encoding=utf-8//TRANSLIT
--string-param output-file=igraph-docs
--string-param directory-category=Libraries
--string-param directory-description='A fast graph library \(C\)'
igraph-docs-with-resolved-includes.xml
DEPENDS _generate-resolved-docbook-xml
COMMENT "Converting DocBook XML to GNU Texinfo format"
)
add_custom_command(
OUTPUT igraph-docs.info
COMMAND ${MAKEINFO_COMMAND}
ARGS --no-split igraph-docs.texi
MAIN_DEPENDENCY igraph-docs.texi
COMMENT "Generating info documentation with GNU Makeinfo"
)
add_custom_target(info DEPENDS igraph-docs.info)
set(INFO_TARGET info)
endif()
add_custom_target(doc DEPENDS ${HTML_TARGET} ${PDF_TARGET} ${INFO_TARGET})
endif()
set(HTML_DOC_BUILD_SUPPORTED ${HTML_DOC_BUILD_SUPPORTED} PARENT_SCOPE)
set(PDF_DOC_BUILD_SUPPORTED ${PDF_DOC_BUILD_SUPPORTED} PARENT_SCOPE)
set(INFO_DOC_BUILD_SUPPORTED ${INFO_DOC_BUILD_SUPPORTED} PARENT_SCOPE)
+51
View File
@@ -0,0 +1,51 @@
<?xml version="1.0"?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY igraph "igraph">
]>
<section id="igraph-Adjlists">
<title>Adjacency lists</title>
<!-- doxrox-include about_adjlists -->
<section id="adjacent-vertices"><title>Adjacent vertices</title>
<!-- doxrox-include igraph_adjlist_init -->
<!-- doxrox-include igraph_adjlist_init_empty -->
<!-- doxrox-include igraph_adjlist_init_complementer -->
<!-- doxrox-include igraph_adjlist_init_from_inclist -->
<!-- doxrox-include igraph_adjlist_destroy -->
<!-- doxrox-include igraph_adjlist_get -->
<!-- doxrox-include igraph_adjlist_size -->
<!-- doxrox-include igraph_adjlist_clear -->
<!-- doxrox-include igraph_adjlist_sort -->
<!-- doxrox-include igraph_adjlist_simplify -->
</section>
<section id="incident-edges"><title>Incident edges</title>
<!-- doxrox-include igraph_inclist_init -->
<!-- doxrox-include igraph_inclist_destroy -->
<!-- doxrox-include igraph_inclist_get -->
<!-- doxrox-include igraph_inclist_size -->
<!-- doxrox-include igraph_inclist_clear -->
</section>
<section id="lazy-adjacency-list"><title>Lazy adjacency list for vertices</title>
<!-- doxrox-include igraph_lazy_adjlist_init -->
<!-- doxrox-include igraph_lazy_adjlist_destroy -->
<!-- doxrox-include igraph_lazy_adjlist_get -->
<!-- doxrox-include igraph_lazy_adjlist_has -->
<!-- doxrox-include igraph_lazy_adjlist_size -->
<!-- doxrox-include igraph_lazy_adjlist_clear -->
</section>
<section id="lazy-incidence-list"><title>Lazy incidence list for edges</title>
<!-- doxrox-include igraph_lazy_inclist_init -->
<!-- doxrox-include igraph_lazy_inclist_destroy -->
<!-- doxrox-include igraph_lazy_inclist_get -->
<!-- doxrox-include igraph_lazy_inclist_has -->
<!-- doxrox-include igraph_lazy_inclist_size -->
<!-- doxrox-include igraph_lazy_inclist_clear -->
</section>
</section>
+143
View File
@@ -0,0 +1,143 @@
<?xml version="1.0"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY igraph "igraph">
]>
<chapter id="igraph-Attributes">
<title>Graph, vertex and edge attributes</title>
<!-- doxrox-include about_attributes -->
<section id="attribute-handler-interface">
<title>The attribute handler interface</title>
<!-- doxrox-include about_attribute_table -->
<!-- doxrox-include igraph_attribute_table_t -->
<!-- doxrox-include igraph_set_attribute_table -->
<!-- doxrox-include igraph_attribute_type_t -->
<!-- doxrox-include igraph_attribute_elemtype_t -->
</section>
<section id="attribute-records">
<title>Attribute records</title>
<!-- doxrox-include about_attribute_record -->
<!-- doxrox-include igraph_attribute_record_t -->
<!-- doxrox-include igraph_attribute_record_init -->
<!-- doxrox-include igraph_attribute_record_init_copy -->
<!-- doxrox-include igraph_attribute_record_size -->
<!-- doxrox-include igraph_attribute_record_resize -->
<!-- doxrox-include igraph_attribute_record_set_name -->
<!-- doxrox-include igraph_attribute_record_set_type -->
<!-- doxrox-include igraph_attribute_record_set_default_numeric -->
<!-- doxrox-include igraph_attribute_record_set_default_string -->
<!-- doxrox-include igraph_attribute_record_set_default_boolean -->
<!-- doxrox-include igraph_attribute_record_destroy -->
</section>
<section id="attribute-combinations">
<title>Handling attribute combination lists</title>
<!-- doxrox-include about_attribute_combination -->
<!-- doxrox-include igraph_attribute_combination_init -->
<!-- doxrox-include igraph_attribute_combination_add -->
<!-- doxrox-include igraph_attribute_combination_remove -->
<!-- doxrox-include igraph_attribute_combination_destroy -->
<!-- doxrox-include igraph_attribute_combination_type_t -->
<!-- doxrox-include igraph_attribute_combination -->
</section>
<section id="accessing-attributes-from-c">
<title>Accessing attributes from C</title>
<!-- doxrox-include cattributes -->
<section id="query-attributes"><title>Query attributes</title>
<!-- doxrox-include igraph_cattribute_list -->
<!-- doxrox-include igraph_cattribute_has_attr -->
<!-- doxrox-include igraph_cattribute_GAN -->
<!-- doxrox-include GAN -->
<!-- doxrox-include igraph_cattribute_GAB -->
<!-- doxrox-include GAB -->
<!-- doxrox-include igraph_cattribute_GAS -->
<!-- doxrox-include GAS -->
<!-- doxrox-include igraph_cattribute_VAN -->
<!-- doxrox-include VAN -->
<!-- doxrox-include igraph_cattribute_VANV -->
<!-- doxrox-include VANV -->
<!-- doxrox-include igraph_cattribute_VAB -->
<!-- doxrox-include VAB -->
<!-- doxrox-include igraph_cattribute_VABV -->
<!-- doxrox-include VABV -->
<!-- doxrox-include igraph_cattribute_VAS -->
<!-- doxrox-include VAS -->
<!-- doxrox-include igraph_cattribute_VASV -->
<!-- doxrox-include VASV -->
<!-- doxrox-include igraph_cattribute_EAN -->
<!-- doxrox-include EAN -->
<!-- doxrox-include igraph_cattribute_EANV -->
<!-- doxrox-include EANV -->
<!-- doxrox-include igraph_cattribute_EAB -->
<!-- doxrox-include EAB -->
<!-- doxrox-include igraph_cattribute_EABV -->
<!-- doxrox-include EABV -->
<!-- doxrox-include igraph_cattribute_EAS -->
<!-- doxrox-include EAS -->
<!-- doxrox-include igraph_cattribute_EASV -->
<!-- doxrox-include EASV -->
</section>
<section id="set-attributes">
<title>Set attributes</title>
<!-- doxrox-include igraph_cattribute_GAN_set -->
<!-- doxrox-include SETGAN -->
<!-- doxrox-include igraph_cattribute_GAB_set -->
<!-- doxrox-include SETGAB -->
<!-- doxrox-include igraph_cattribute_GAS_set -->
<!-- doxrox-include SETGAS -->
<!-- doxrox-include igraph_cattribute_VAN_set -->
<!-- doxrox-include SETVAN -->
<!-- doxrox-include igraph_cattribute_VAB_set -->
<!-- doxrox-include SETVAB -->
<!-- doxrox-include igraph_cattribute_VAS_set -->
<!-- doxrox-include SETVAS -->
<!-- doxrox-include igraph_cattribute_EAN_set -->
<!-- doxrox-include SETEAN -->
<!-- doxrox-include igraph_cattribute_EAB_set -->
<!-- doxrox-include SETEAB -->
<!-- doxrox-include igraph_cattribute_EAS_set -->
<!-- doxrox-include SETEAS -->
<!-- doxrox-include igraph_cattribute_VAN_setv -->
<!-- doxrox-include SETVANV -->
<!-- doxrox-include igraph_cattribute_VAB_setv -->
<!-- doxrox-include SETVABV -->
<!-- doxrox-include igraph_cattribute_VAS_setv -->
<!-- doxrox-include SETVASV -->
<!-- doxrox-include igraph_cattribute_EAN_setv -->
<!-- doxrox-include SETEANV -->
<!-- doxrox-include igraph_cattribute_EAB_setv -->
<!-- doxrox-include SETEABV -->
<!-- doxrox-include igraph_cattribute_EAS_setv -->
<!-- doxrox-include SETEASV -->
</section>
<section id="remove-attributes"><title>Remove attributes</title>
<!-- doxrox-include igraph_cattribute_remove_g -->
<!-- doxrox-include DELGA -->
<!-- doxrox-include igraph_cattribute_remove_v -->
<!-- doxrox-include DELVA -->
<!-- doxrox-include igraph_cattribute_remove_e -->
<!-- doxrox-include DELEA -->
<!-- doxrox-include igraph_cattribute_remove_all -->
<!-- doxrox-include DELGAS -->
<!-- doxrox-include DELVAS -->
<!-- doxrox-include DELEAS -->
<!-- doxrox-include DELALL -->
</section>
<section id="c-attribute-combination-functions"><title>Custom attribute combination functions</title>
<!-- doxrox-include c_attribute_combination_functions -->
</section>
</section>
</chapter>
@@ -0,0 +1,241 @@
<?xml version="1.0"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY igraph "igraph">
]>
<chapter id="igraph-Basic">
<title>Basic data types and interface</title>
<section id="igraph-data-model"><title>The &igraph; data model</title>
<para>
The &igraph; library can handle directed and
undirected graphs. The &igraph; graphs are multisets
of ordered (if directed) or unordered (if undirected) labeled pairs.
The labels of the pairs plus the number of vertices always starts with
zero and ends with the number of edges minus one. In addition to that,
a table of metadata is also attached to every graph, its most
important entries being the number of vertices in the graph and whether
the graph is directed or undirected.
</para>
<para>
Like the edges, the &igraph; vertices are also
labeled by numbers between zero and the number of vertices minus one.
So, to summarize, a directed graph can be imagined like this:
<informalexample>
<programlisting>
( vertices: 6,
directed: yes,
{
(0,2),
(2,2),
(3,2),
(3,3),
(3,4),
(3,4),
(4,3),
(4,1)
}
)
</programlisting>
</informalexample>
Here the edges are ordered pairs or vertex ids, and the graph is a multiset
of edges plus some metadata.
</para>
<para>
An undirected graph is like this:
<informalexample>
<programlisting>
( vertices: 6,
directed: no,
{
(0,2),
(2,2),
(2,3),
(3,3),
(3,4),
(3,4),
(3,4),
(1,4)
}
)
</programlisting>
</informalexample>
Here, an edge is an unordered pair of two vertex IDs. A graph is a multiset
of edges plus metadata, just like in the directed case.
</para>
<para>It is possible to convert between directed and undirected graphs,
see the <link linkend="igraph_to_directed">
<function>igraph_to_directed()</function></link>
and <link linkend="igraph_to_undirected">
<function>igraph_to_undirected()</function></link> functions.
</para>
<para>&igraph; aims to robustly support multigraphs, i.e. graphs which
have more than one edge between some pairs of vertices, as well as
graphs with self-loops. Most functions which do not support such graphs
will check their input and issue an error if it is not valid. Those
rare functions which do not perform this check clearly indicate this
in their documentation. To eliminate multiple edges from a graph, you can use
<link linkend="igraph_simplify">
<function>igraph_simplify()</function></link>.
</para>
</section>
<section id="igraph-functions"><title>General conventions of &igraph; functions</title>
<para>
&igraph; has a simple and consistent interface. Most functions check
their input for validity and display an informative error message
when something goes wrong. In order to support this, the majority of functions
return an error code. In basic usage, this code can be ignored, as the
default behaviour is to abort the program immediately upon error. See
<link linkend="igraph-Error">the section on error handling</link> for
more information on this topic.
</para>
<para>
Results are typically returned through <emphasis>output arguments</emphasis>,
i.e. pointers to a data structure into which the result will be written.
In almost all cases, this data structure is expected to be pre-initialized.
A few simple functions communicate their result directly through their return
value—these functions can never encounter an error.
</para>
</section>
<section id="basic-data-types"><title>Atomic data types</title>
<indexterm><primary>igraph_int_t</primary></indexterm>
<para>
&igraph; introduces a few aliases to standard C data types that are then used
throughout the library. The most important of these types is
<type>igraph_int_t</type>, which is an alias to either a 32-bit or a 64-bit
<emphasis>signed</emphasis> integer, depending on whether &igraph; was compiled
in 32-bit or 64-bit mode. The size of <type>igraph_int_t</type> also
influences the maximum number of vertices that an &igraph; graph can represent
as the number of vertices is stored in a variable of type
<type>igraph_int_t</type>.
</para>
<para>
Before igraph 1.0, <type>igraph_int_t</type> was called <type>igraph_integer_t</type>.
This is still available as an alias to <type>igraph_int_t</type> and will remain
accessible until at least version 2.0 of the library.
</para>
<para>Since the size of a variable of type <type>igraph_int_t</type> may
change depending on how &igraph; is compiled, you cannot simply use
<code>%d</code> or <code>%ld</code> as a placeholder for &igraph; integers in
<code>printf</code> format strings. &igraph; provides the
<code>IGRAPH_PRId</code> macro, which maps to <code>d</code>, <code>ld</code>
or <code>lld</code> depending on the size of <type>igraph_int_t</type>, and
you must use this macro in <code>printf</code> format strings to avoid compiler
warnings.
</para>
<indexterm><primary>igraph_uint_t</primary></indexterm>
<para>Similarly to how <type>igraph_int_t</type> maps to the standard size
signed integer in the library, <type>igraph_uint_t</type> maps to a 32-bit or
a 64-bit <emphasis>unsigned</emphasis> integer. It is guaranteed that the size of
<type>igraph_int_t</type> is the same as the size of <type>igraph_uint_t</type>.
&igraph; provides <code>IGRAPH_PRIu</code> as a format string placeholder for
variables of type <type>igraph_uint_t</type>.
</para>
<indexterm><primary>igraph_real_t</primary></indexterm>
<para>Real numbers (i.e. quantities that can potentially be fractional or
infinite) are represented with a type named <type>igraph_real_t</type>. Currently
<type>igraph_real_t</type> is always aliased to <type>double</type>, but it is
still good practice to use <type>igraph_real_t</type> in your own code for sake
of consistency.</para>
<indexterm><primary>igraph_bool_t</primary></indexterm>
<para>Boolean values are represented with a type named <type>igraph_bool_t</type>.
It tries to be as small as possible since it only needs to represent a truth
value. For printing purposes, you can treat it as an integer and use
<code>%d</code> in format strings as a placeholder for an <type>igraph_bool_t</type>.
</para>
<indexterm><primary>IGRAPH_INTEGER_MAX</primary></indexterm>
<indexterm><primary>IGRAPH_INTEGER_MIN</primary></indexterm>
<indexterm><primary>IGRAPH_UINT_MAX</primary></indexterm>
<indexterm><primary>IGRAPH_UINT_MIN</primary></indexterm>
<para>
Upper and lower limits of <type>igraph_int_t</type> and
<type>igraph_uint_t</type> are provided by the constants named
<constant>IGRAPH_INTEGER_MIN</constant>, <constant>IGRAPH_INTEGER_MAX</constant>,
<constant>IGRAPH_UINT_MIN</constant> and <constant>IGRAPH_UINT_MAX</constant>.
</para>
</section>
<section><title>Setup and initialization</title>
<para>
Certain parts of &igraph; must be initialized before first use, which can be
accomplished using the setup functions below. As of igraph 1.0, most functions
will work correctly even if setup is not performed, as currently the only setup
action is seeding the random number generator. That said, it is strongly
recommended to call
<link linkend="igraph_setup"><function>igraph_setup()</function></link>
before using any other function, as future &igraph; versions may add critical
initialization steps.
</para>
<!-- doxrox-include igraph_setup -->
</section>
<section id="basic-interface"><title>The basic interface</title>
<!-- doxrox-include about_basic_interface -->
<section id="graph-constructors-and-destructors"><title>Graph constructors and destructors</title>
<!-- doxrox-include igraph_empty -->
<!-- doxrox-include igraph_empty_attrs -->
<!-- doxrox-include igraph_copy -->
<!-- doxrox-include igraph_destroy -->
</section>
<section id="basic-query-operations"><title>Basic query operations</title>
<!-- doxrox-include igraph_vcount -->
<!-- doxrox-include igraph_ecount -->
<!-- doxrox-include igraph_is_directed -->
<!-- doxrox-include igraph_edge -->
<!-- doxrox-include igraph_edges -->
<!-- doxrox-include IGRAPH_FROM -->
<!-- doxrox-include IGRAPH_TO -->
<!-- doxrox-include IGRAPH_OTHER -->
<!-- doxrox-include igraph_get_eid -->
<!-- doxrox-include igraph_get_eids -->
<!-- doxrox-include igraph_get_all_eids_between -->
<!-- doxrox-include igraph_neighbors -->
<!-- doxrox-include igraph_incident -->
<!-- doxrox-include igraph_degree -->
<!-- doxrox-include igraph_degree_1 -->
</section>
<section id="adding-and-deleting-vertices-and-edges"><title>Adding and deleting vertices and edges</title>
<!-- doxrox-include igraph_add_edge -->
<!-- doxrox-include igraph_add_edges -->
<!-- doxrox-include igraph_add_vertices -->
<!-- doxrox-include igraph_delete_edges -->
<!-- doxrox-include igraph_delete_vertices -->
<!-- doxrox-include igraph_delete_vertices_map -->
</section>
</section>
<section id="misc-helper-functions"><title>Miscellaneous macros and helper functions</title>
<!-- doxrox-include IGRAPH_VCOUNT_MAX -->
<!-- doxrox-include IGRAPH_ECOUNT_MAX -->
<!-- doxrox-include IGRAPH_UNLIMITED -->
<!-- doxrox-include igraph_expand_path_to_pairs -->
<!-- doxrox-include igraph_invalidate_cache -->
<!-- doxrox-include igraph_is_same_graph -->
</section>
</chapter>
@@ -0,0 +1,51 @@
<?xml version="1.0"?>
<!DOCTYPE bibliography PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
]>
<bibliography>
<biblioentry id="bib:barabasi99a">
<authorgroup>
<author><firstname>Albert-László</firstname>
<surname>Barabási</surname></author>
<author><firstname>Réka</firstname><surname>Albert</surname></author>
</authorgroup>
<subtitle>Emergence of scaling in random networks</subtitle>
<title>Science</title>
<pubdate>1999</pubdate>
<volumenum>286</volumenum>
<pagenums>509-512</pagenums>
</biblioentry>
<biblioentry id="bib:zalanyi03">
<authorgroup>
<author><firstname>László</firstname><surname>Zalányi</surname></author>
<author><firstname>Gábor</firstname><surname>Csárdi</surname></author>
<author><firstname>Tamás</firstname><surname>Kiss</surname></author>
<author><firstname>Máté</firstname><surname>Lengyel</surname></author>
<author><firstname>Rebecca</firstname><surname>Warner</surname></author>
<author><firstname>Jan</firstname><surname>Tobochnik</surname></author>
<author><firstname>Péter</firstname><surname>Érdi</surname></author>
</authorgroup>
<subtitle>Properties of a random attachment growing network</subtitle>
<title>Phyisical Review E</title>
<pubdate>2003</pubdate>
<volumenum>68</volumenum>
<pagenums>066104</pagenums>
</biblioentry>
<biblioentry id="bib:ford56">
<authorgroup>
<author><firstname>L. R.</firstname><surname>Ford Jr.</surname></author>
<author><firstname>D. R.</firstname><surname>Fulkerson</surname></author>
</authorgroup>
<subtitle>Maximal ow through a network</subtitle>
<title>Canadian J. Math.</title>
<pubdate>1956</pubdate>
<volumenum>8</volumenum>
<pagenums>399--404</pagenums>
</biblioentry>
</bibliography>
@@ -0,0 +1,37 @@
<?xml version="1.0"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY igraph "igraph">
]>
<chapter id="igraph-Bipartite">
<title>Bipartite, i.e. two-mode graphs</title>
<section id="about-bipartite">
<!-- doxrox-include about_bipartite -->
</section>
<section id="create-two-mode-networks"><title>Create two-mode networks</title>
<!-- doxrox-include igraph_create_bipartite -->
<!-- doxrox-include igraph_full_bipartite -->
<!-- doxrox-include igraph_bipartite_game_gnm -->
<!-- doxrox-include igraph_bipartite_game_gnp -->
<!-- doxrox-include igraph_bipartite_iea_game -->
</section>
<section id="bipartite-adjacency-matrices"><title>Bipartite adjacency matrices</title>
<!-- doxrox-include igraph_biadjacency -->
<!-- doxrox-include igraph_weighted_biadjacency -->
<!-- doxrox-include igraph_get_biadjacency -->
</section>
<section id="project-two-mode-graphs"><title>Project two-mode graphs</title>
<!-- doxrox-include igraph_bipartite_projection_size -->
<!-- doxrox-include igraph_bipartite_projection -->
</section>
<section id="other-operations-on-bipartite-graphs"><title>Other operations on bipartite graphs</title>
<!-- doxrox-include igraph_is_bipartite -->
</section>
</chapter>
+63
View File
@@ -0,0 +1,63 @@
<?xml version="1.0"?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY igraph "igraph">
]>
<section id="igraph-Bitsets">
<title>Bitsets</title>
<section id="igraph_bitset_t">
<!-- doxrox-include about_igraph_bitset_t_objects -->
</section>
<section id="bitset-constructors-and-destructors">
<!-- doxrox-include igraph_bitset_constructors_and_destructors -->
<!-- doxrox-include igraph_bitset_init -->
<!-- doxrox-include igraph_bitset_init_copy -->
<!-- doxrox-include igraph_bitset_destroy -->
</section>
<section id="bitset-accessing-elements">
<!-- doxrox-include igraph_bitset_accessing_elements -->
<!-- doxrox-include IGRAPH_BIT_MASK -->
<!-- doxrox-include IGRAPH_BIT_SLOT -->
<!-- doxrox-include IGRAPH_BIT_SET -->
<!-- doxrox-include IGRAPH_BIT_CLEAR -->
<!-- doxrox-include IGRAPH_BIT_TEST -->
<!-- doxrox-include IGRAPH_BIT_NSLOTS -->
</section>
<section id="bitset-operations"><title>Bitset operations</title>
<!-- doxrox-include igraph_bitset_fill -->
<!-- doxrox-include igraph_bitset_null -->
<!-- doxrox-include igraph_bitset_or -->
<!-- doxrox-include igraph_bitset_and -->
<!-- doxrox-include igraph_bitset_xor -->
<!-- doxrox-include igraph_bitset_not -->
<!-- doxrox-include igraph_bitset_popcount -->
<!-- doxrox-include igraph_bitset_countl_zero -->
<!-- doxrox-include igraph_bitset_countl_one -->
<!-- doxrox-include igraph_bitset_countr_zero -->
<!-- doxrox-include igraph_bitset_countr_one -->
<!-- doxrox-include igraph_bitset_is_all_zero -->
<!-- doxrox-include igraph_bitset_is_all_one -->
<!-- doxrox-include igraph_bitset_is_any_zero -->
<!-- doxrox-include igraph_bitset_is_any_one -->
</section>
<section id="bitset-properties"><title>Bitset properties</title>
<!-- doxrox-include igraph_bitset_size -->
<!-- doxrox-include igraph_bitset_capacity -->
</section>
<section id="bitset-resizing-operations"><title>Resizing operations</title>
<!-- doxrox-include igraph_bitset_reserve -->
<!-- doxrox-include igraph_bitset_resize -->
</section>
<section id="bitset-copying"><title>Copying bitsets</title>
<!-- doxrox-include igraph_bitset_update -->
</section>
</section>
+735
View File
@@ -0,0 +1,735 @@
REPLACE ----- remove the " * " prefix first -----------------*- mode:python -*-
^[ ]\*[ ]
WITH --------------------------------------------------------------------------
REPLACE ----- remove the " *" lines -------------------------------------------
^[ ]\*\s*\n
WITH --------------------------------------------------------------------------
\n
REPLACE IN typed_list.pmt ----- for the typed list template functions ---------
FUNCTION\(
(?P<suffix>[^\)]*)
\)\s*
WITH
igraph_vector_list_\g<suffix>
REPLACE IN typed_list.pmt ----- typed list template item type -----------------
ITEM_TYPE
WITH
igraph_vector_t
REPLACE IN typed_list.pmt ----- typed list template type ----------------------
TYPE
WITH
igraph_vector_list_t
REPLACE IN *.pmt ----- for the template functions -----------------------------
FUNCTION\(
(?P<base>[^, \)]*)\s*,\s*
(?P<suffix>[^\)]*)
\)\s*
WITH
\g<base>_\g<suffix>
REPLACE IN *.pmt ----- template type ------------------------------------------
TYPE\(
(?P<type>[^\)]*)
\)
WITH
\g<type>_t
REPLACE IN *.pmt ----- template base type, we cowardly assume real number -----
BASE
WITH
igraph_real_t
REPLACE ----- function object, extract its signature --------------------------
(?P<before>\A.*?) # head of the comment
\\function\s+ # \function keyword
(?P<name>(?P<pre>(igraph_)|(IGRAPH_)|())(?P<tail>\w+)) # the keyword, remove igraph_ prefix
[\s]*(?P<brief>[^\n]*?)\n # brief description
(?P<after>.*?)\*\/ # tail of the comment
\s*
(IGRAPH_EXPORT\s+)? # strip IGRAPH_EXPORT from prototype
(?P<def>.*?\)) # function head
(?=(\s*;)|(\s*\{)) # prototype ends with ; function head with {
.*\Z # and the remainder
WITH --------------------------------------------------------------------------
<section id="\g<name>">
<title><function>\g<name></function> &mdash; \g<brief></title>
<indexterm><primary>\g<tail></primary></indexterm>
<para>
<informalexample><programlisting>
\g<def>;
</programlisting></informalexample>
</para>
<para>
\g<before>
\g<after>
</para>
</section>
REPLACE ----- <paramdef> for functions (not used currently) -------------------
<paramdef>(?P<params>[^<]*)</paramdef>\n
RUN ---------------------------------------------------------------------------
dr_params=string.split(matched.group("params"), ',')
dr_out=""
for dr_i in dr_params:
dr_i=string.strip(dr_i)
if dr_i=="...":
dr_out=dr_out+"<varargs/>"
else:
dr_words=re.match(r"([\w\*\&\s]+)(\b\w+)$", dr_i).groups()
dr_out=dr_out+"<paramdef>"+dr_words[0]+"<parameter>"+dr_words[1]+ \
"</parameter></paramdef>\n"
actch=actch[0:matched.start()]+dr_out+actch[matched.end():]
REPLACE ----- function parameter descriptions, head ---------------------------
(?P<before>\A.*?) # head of the comment
\\param\b # first \param commant
WITH --------------------------------------------------------------------------
\g<before></para>
<formalpara><title>Arguments:</title><para>
<variablelist role="params">
\\param
REPLACE ----- function parameter descriptions, tail ---------------------------
# the end of the params is either an empty line after the last \param
# command or a \return or \sa statement (others might be added later)
# or the end of the comment
\\param\b # the last \param command
(?P<paramtext>.*?) # the text of the \param command
(?P<endmark> # this marks the end of the \param text
(\\return\b)|(\\sa\b)| # it is either a \return or \sa or
(\n\s*?\n)| # (at least) one empty line or
(\*\/)) # the end of the comment
(?P<after>.*?\Z) # remaining part
WITH
\\param\g<paramtext></variablelist></para></formalpara><para>
\g<endmark>\g<after>
REPLACE ----- function parameter descriptions ---------------------------------
\\param\b\s* # \param command
(?P<paramname>(\w+)|(...))\s+ # name of the parameter
(?P<paramtext>.*?) # text of the \param command
(?=(\\param)|(</variablelist>)|
(\n\s*\n))
WITH --------------------------------------------------------------------------
<varlistentry><term><parameter>\g<paramname></parameter>:</term>
<listitem><para>
\g<paramtext></para></listitem></varlistentry>
REPLACE ----- \return command -------------------------------------------------
# a return statement ends with an empty line or the end of the comment
\\return\b\s* # \return command
(?P<text>.*?) # the text
(?=(\n\s*?\n)| # empty line or
(\*\/)| # the end of the comment or
(\\sa\b)) # \sa command
WITH ----------------------------------------------------------------------TODO
</para><formalpara><title>Returns:</title><para><variablelist>
<varlistentry><term><parameter></parameter></term>
<listitem><para>
\g<text>
</para></listitem></varlistentry>
</variablelist></para></formalpara><para>
REPLACE ----- variables -------------------------------------------------------
(?P<before>\A.*?) # head of the comment
\\var\s+ # \var keyword + argument
(?P<name>(?P<pre>(igraph_)|(IGRAPH_)|())(?P<tail>\w+))
[\s]*(?P<brief>[^\n]*?)\n # brief description
(?P<after>.*?)\*\/ # tail of the comment
\s*
(IGRAPH_EXPORT\s+)? # strip IGRAPH_EXPORT
(?P<def>[^;]*;) # the definition of the variable
.*\Z # and the remainder
WITH --------------------------------------------------------------------------
<section id="\g<name>"><title><function>\g<name></function> &mdash; \g<brief></title>
<indexterm><primary>\g<tail></primary></indexterm>
<para>
<programlisting>
\g<def>
</programlisting>
</para><para>
\g<before>\g<after>
</para>
</section>
REPLACE ----- \define ---------------------------------------------------------
(?P<before>\A.*?) # head of the comment
\\define\s+ # \define command
(?P<name>(?P<pre>(igraph_)|(IGRAPH_)|())(?P<tail>\w+))
[\s]*(?P<brief>[^\n]*?)\n # brief description
(?P<after>.*?)\*\/ # tail of the comment
\s* # whitespace
(?P<def>\#define\s+[\w0-9,]+\s* # macro name
(\([\w0-9,. ]+\))?) # macro args (optional)
.*\Z # drop the remainder
WITH --------------------------------------------------------------------------
<section id="\g<name>"><title><function>\g<name></function> &mdash; \g<brief></title>
<indexterm><primary>\g<tail></primary></indexterm>
<para>
<programlisting>
\g<def>
</programlisting>
</para><para>
\g<before>\g<after>
</para>
</section>
REPLACE ----- \section without title ------------------------------------------
(?P<before>\A.*?) # head of the comment
\\section\s+(?P<name>\w+)\s*$ # \section + argument
(?P<after>.*?)\*\/ # tail of the comment
.*\Z # and the remainder, this is dropped
WITH
\g<before>
\g<after>
REPLACE ----- \section with title ---------------------------------------------
(?P<before>\A.*?) # head of the comment
\\section\s+(?P<name>\w+) # \section + argument
(?P<title>.*?) # section title
\n\s*?\n # empty line
(?P<after>.*?)\*\/ # tail of the comment
.*\Z # and the remainder, this is dropped
WITH
<title>\g<title></title>
\g<before>
\g<after>
REPLACE ----- \section with title ---------------------------------------------
(?P<before>\A.*?) # head of the comment
\\section\s+(?P<name>\w+) # \section + argument
(?P<title>.*?)\s*\*\/ # section title
.*\Z # and the remainder, this is dropped
WITH
<title>\g<title></title>
\g<before>
REPLACE ----- an enumeration typedef ------------------------------------------
(?P<before>\A.*?) # head of the comment
\\typedef\s+ # \typedef command
(?P<name>(?P<pre>(igraph_)|(IGRAPH_)|())(?P<tail>\w+))
[\s]*(?P<brief>[^\n]*?)\n # brief description
(?P<after>.*?) # tail of the comment
\*\/\s* # closing the comment
(?P<def>typedef\s*enum\s*\{ # typedef enum
[^\}]*\}\s*\w+\s*;) # rest of the definition
.*\Z
WITH --------------------------------------------------------------------------
<section id="\g<name>"><title><function>\g<name></function> &mdash; \g<brief></title>
<indexterm><primary>\g<tail></primary></indexterm>
<para>
<programlisting>
\g<def>
</programlisting>
</para>
<para>
\g<before>\g<after>
</para>
</section>
REPLACE ----- enumeration value descriptions, head ----------------------------
(?P<before>\A.*?) # head of the comment
\\enumval\b # first \param commant
WITH --------------------------------------------------------------------------
\g<before></para>
<formalpara><title>Values:</title><para>
<variablelist role="params">
\\enumval
REPLACE ----- enumeration value descriptions, tail ----------------------------
\\enumval\b # the last \enumval command
(?P<paramtext>.*?) # the text of the \enumval command
(?P<endmark> # this marks the end of the \enumval text
(\\return\b)|(\\sa\b)| # it is either a \return or \sa or
(\n\s*?\n)| # (at least) one empty line or
(\*\/)) # the end of the comment
(?P<after>.*?\Z) # remaining part
WITH
\\enumval\g<paramtext></variablelist></para></formalpara><para>
\g<endmark>\g<after>
REPLACE ----- enumeration value descriptions ----------------------------------
\\enumval\b\s* # \enumval command
(?P<paramname>(\w+)|(...))\s+ # name of the parameter
(?P<paramtext>.*?) # text of the \enumval command
(?=(\\enumval)|(</variablelist>)|
(\n\s*\n))
WITH --------------------------------------------------------------------------
<varlistentry><term><constant>\g<paramname></constant>:</term>
<listitem><para>
\g<paramtext></para></listitem></varlistentry>
REPLACE ----- \struct ---------------------------------------------------------
(?P<before>\A.*?) # head of the comment
\\struct\s+ # \struct command
(?P<name>(?P<pre>(igraph_)|(IGRAPH_)|())(?P<tail>[\w_]+))
[\s]*(?P<brief>[^\n]*?)(?=\n) # brief description
(?P<after>.*?) # tail of the command
\*\/\s* # closing the comment
(?P<def>typedef \s*struct\s*\w+\s*\{
.*\}\s*\w+\s*;)
.*\Z
WITH --------------------------------------------------------------------------
<section id="\g<name>"><title><function>\g<name></function> &mdash; \g<brief></title>
<indexterm><primary>\g<tail></primary></indexterm>
<para>
<programlisting>
\g<def>
</programlisting>
</para>
<para>
\g<before>\g<after>
</para>
</section>
REPLACE IN *.h ----- structure member descriptions, one block -----------------
^[\s]*\n
(?P<before2>.*?) # empty line+text
(?P<members>\\member\b.*?) # member commands
(?= # this marks the end of the \member text
(\\return\b)|(\\sa\b)| # it is either a \return or \sa or
(^[\s]*\n)| # (at least) one empty line or
(\*\/)) # the end of the comment
WITH --------------------------------------------------------------------------
</para>
<para>\g<before2></para>
<formalpara><title>Values:</title>
<para><variablelist role="params">
\g<members>
</variablelist></para></formalpara><para>
REPLACE IN *.h ----- structure member descriptions ----------------------------
\\member\b\s* # \enumval command
(?P<paramname>(\w+)|(...))\s+ # name of the parameter
(?P<paramtext>.*?) # text of the \enumval command
(?=(\\member)|(</variablelist>)|
(\n\s*\n))
WITH --------------------------------------------------------------------------
<varlistentry><term><constant>\g<paramname></constant>:</term>
<listitem><para>
\g<paramtext></para></listitem></varlistentry>
REPLACE ----- \typedef function -----------------------------------------------
(?P<before>\A.*?) # comment head
\\typedef\s+ # \typedef command
(?P<name>(?P<pre>(igraph_)|(IGRAPH_)|())(?P<tail>\w+))
[\s]*(?P<brief>[^\n]*?)\n # brief description
(?P<after>.*?) # comment tail
\*\/ # end of comment block
\s*
(?P<src>typedef\s+[^;]*;) # the typedef definition
.*\Z
WITH --------------------------------------------------------------------------
<section id="\g<name>"><title><function>\g<name></function> &mdash; \g<brief></title>
<indexterm><primary>\g<tail></primary></indexterm>
<para><programlisting>
\g<src>
</programlisting></para>
<para>
\g<before>\g<after>
</para>
</section>
REPLACE ----- ignore doxygen \ingroup command ---------------------------------
\\ingroup\s+\w+
WITH --------------------------------------------------------------------------
REPLACE ----- ignore doxygen \defgroup command --------------------------------
\\defgroup\s+\w+
WITH --------------------------------------------------------------------------
REPLACE ----- add the contents of \brief to the description -------------------
\\brief\b
WITH --------------------------------------------------------------------------
REPLACE ----- \varname command ------------------------------------------------
\\varname\b\s*
(?P<var>\w+\b)
WITH
<varname>\g<var></varname>
REPLACE ----- references, \ref command, special case for igraph_vector_int ----
\\ref\b\s*
igraph_vector_int_(?P<what>\w+)(?P<paren>([\(][\)])?)
WITH --------------------------------------------------------------------------
<link linkend="igraph_vector_\g<what>"><function>igraph_vector_int_\g<what>\g<paren></function></link>
REPLACE ----- references, \ref command ----------------------------------------
\\ref\b\s*
(?P<what>\w+)(?P<paren>([\(][\)])?)
WITH --------------------------------------------------------------------------
<link linkend="\g<what>"><function>\g<what>\g<paren></function></link>
REPLACE ----- \sa command -----------------------------------------------------
\\sa\b
\s*
(?P<text>.*?)
(?=(\n\s*?\n)|(\*\/))
WITH ----------------------------------------------------------------------TODO
</para><formalpara><title>See also:</title><para><variablelist>
<varlistentry><term><parameter></parameter></term>
<listitem><para>
\g<text>
</para></listitem></varlistentry>
</variablelist></para></formalpara><para>
REPLACE ----- \em command -----------------------------------------------------
\\em\b
\s*
(?P<text>[^\s]+)
WITH
<emphasis>\g<text></emphasis>
REPLACE ----- \emb command ----------------------------------------------------
\\emb\b
WITH
<emphasis>
REPLACE ----- \eme command ----------------------------------------------------
\\eme\b
WITH
</emphasis>
REPLACE ----- \verbatim -------------------------------------------------------
\\verbatim\b
WITH
<informalexample><programlisting>
REPLACE ----- \endverbatim ----------------------------------------------------
\\endverbatim\b
WITH
</programlisting></informalexample>
REPLACE ----- \clist ----------------------------------------------------------
\\clist\b
WITH
<variablelist>
REPLACE ----- \cli ------------------------------------------------------------
\\cli\s+(?P<term>.*?)$
(?P<text>.*?)
(?=(\\cli)|(\\endclist))
WITH --------------------------------------------------------------------------
<varlistentry><term><constant>\g<term></constant></term>
<listitem><para>
\g<text>
</para></listitem></varlistentry>
REPLACE ----- \endclist -------------------------------------------------------
\\endclist\b
WITH
</variablelist>
REPLACE ----- \olist ----------------------------------------------------------
\\olist\b
WITH
<orderedlist>
REPLACE ----- \oli ------------------------------------------------------------
\\oli\s+(?P<text>.*?)
(?=(\\oli)|(\\endolist))
WITH
<listitem><para>
\g<text>
</para></listitem>
REPLACE ----- \endolist -------------------------------------------------------
\\endolist\b
WITH
</orderedlist>
REPLACE ----- \ilist ----------------------------------------------------------
\\ilist\b
WITH
<itemizedlist>
REPLACE ----- \ili ------------------------------------------------------------
\\ili\s+(?P<text>.*?)
(?=(\\ili)|(\\endilist))
WITH
<listitem><para>
\g<text>
</para></listitem>
REPLACE ----- \endilist -------------------------------------------------------
\\endilist\b
WITH
</itemizedlist>
REPLACE ----- doxygen \c command is for <constant> ----------------------------
\\c\s+(?P<word>[\w\-^\']+)\b
WITH
<constant>\g<word></constant>
REPLACE ----- doxygen \p command is for <parameter> ---------------------------
\\p\s+(?P<word>\w+)\b
WITH
<parameter>\g<word></parameter>
REPLACE ----- doxygen \type command is for <type> -----------------------------
\\type\s+(?P<word>\w+)\b
WITH
<type>\g<word></type>
REPLACE ----- doxygen \a command is for <command> -----------------------------
\\a\s+(?P<word>\w+)\b
WITH
<command>\g<word></command>
REPLACE ----- doxygen \quote command is for <quote> ---------------------------
\\quote\s+
WITH
<quote>
REPLACE ----- doxygen \endquote command is for </quote> -----------------------
\s*\\endquote\b
WITH
</quote>
REPLACE ----- replace <code> with <literal> -----------------------------------
<(?P<c>/?)code>
WITH --------------------------------------------------------------------------
<\g<c>literal>
REPLACE ----- add http:// and https:// links ----------------------------------
(?P<link>https?:\/\/[-\+=&;%@.:/~()?'\w_]*[-\+=&;%@/~'\w_])
WITH --------------------------------------------------------------------------
<ulink url="\g<link>">\g<link></ulink>
REPLACE ----- blockquote ------------------------------------------------------
\\blockquote
WITH --------------------------------------------------------------------------
<blockquote>
REPLACE ----- blockquote ------------------------------------------------------
\\endblockquote
WITH --------------------------------------------------------------------------
</blockquote>
REPLACE ----- example file ---------------------------------------------------
\\example\b\s*
(?P<filename>[^\n]*?)\n
WITH --------------------------------------------------------------------------
<example role="sourcefile">
<title> File <code>\g<filename></code></title>
<xi:include href="../\g<filename>.xml"
xmlns:xi="http://www.w3.org/2001/XInclude"/>
<para></para>
</example>
REPLACE ----- \deprecated-by --------------------------------------------------
\\deprecated-by\b\s*
(?P<replacement>[^ \n]+)\s*
(?P<version>[^\n]+)\n
WITH --------------------------------------------------------------------------
</para>
<warning>
<para>Deprecated since version \g<version>. Please do not use this function in new
code; use <link linkend="\g<replacement>"><function>\g<replacement>()</function></link>
instead.</para>
</warning>
<para>
REPLACE ----- \deprecated -----------------------------------------------------
\\deprecated\b\s*
(?P<version>[^\n]*?)\n
WITH --------------------------------------------------------------------------
</para>
<warning>
<para>Deprecated since version \g<version>. Please do not use this function in new
code.</para>
</warning>
<para>
REPLACE ----- \experimental ---------------------------------------------------
\\experimental\b\s*\n
WITH --------------------------------------------------------------------------
</para>
<warning>
<para>This function is experimental and its signature is not considered final yet.
We reserve the right to change the function signature without changing the
major version of igraph. Use it at your own risk.</para>
</warning>
<para>
+45
View File
@@ -0,0 +1,45 @@
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY igraph "igraph">
]>
<chapter id="igraph-Cliques">
<title>Cliques and independent vertex sets</title>
<para>
These functions calculate various graph properties related
to cliques and independent vertex sets.
</para>
<section id="cliques"><title>Cliques</title>
<!-- doxrox-include igraph_is_complete -->
<!-- doxrox-include igraph_is_clique -->
<!-- doxrox-include igraph_cliques -->
<!-- doxrox-include igraph_clique_size_hist -->
<!-- doxrox-include igraph_cliques_callback -->
<!-- doxrox-include igraph_clique_handler_t -->
<!-- doxrox-include igraph_largest_cliques -->
<!-- doxrox-include igraph_maximal_cliques -->
<!-- doxrox-include igraph_maximal_cliques_count -->
<!-- doxrox-include igraph_maximal_cliques_file -->
<!-- doxrox-include igraph_maximal_cliques_subset -->
<!-- doxrox-include igraph_maximal_cliques_hist -->
<!-- doxrox-include igraph_maximal_cliques_callback -->
<!-- doxrox-include igraph_clique_number -->
</section>
<section id="weighted-cliques"><title>Weighted cliques</title>
<!-- doxrox-include igraph_weighted_cliques -->
<!-- doxrox-include igraph_largest_weighted_cliques -->
<!-- doxrox-include igraph_weighted_clique_number -->
</section>
<section id="independent-vertex-sets"><title>Independent vertex sets</title>
<!-- doxrox-include igraph_is_independent_vertex_set -->
<!-- doxrox-include igraph_independent_vertex_sets -->
<!-- doxrox-include igraph_largest_independent_vertex_sets -->
<!-- doxrox-include igraph_maximal_independent_vertex_sets -->
<!-- doxrox-include igraph_independence_number -->
</section>
</chapter>
+19
View File
@@ -0,0 +1,19 @@
<?xml version="1.0"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY igraph "igraph">
]>
<chapter id="igraph-Coloring">
<title>Graph coloring</title>
<!-- doxrox-include igraph_vertex_coloring_greedy -->
<!-- doxrox-include igraph_coloring_greedy_t -->
<!-- doxrox-include igraph_is_vertex_coloring -->
<!-- doxrox-include igraph_is_bipartite_coloring -->
<!-- doxrox-include igraph_is_edge_coloring -->
<!-- doxrox-include igraph_is_perfect -->
</chapter>
@@ -0,0 +1,66 @@
<?xml version="1.0"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY igraph "igraph">
]>
<chapter id="igraph-Community">
<title>Detecting community structure</title>
<!-- doxrox-include about_community -->
<section id="common-functions-related-to-community-detection"><title>Common functions related to community structure</title>
<!-- doxrox-include igraph_modularity -->
<!-- doxrox-include igraph_modularity_matrix -->
<!-- doxrox-include igraph_community_optimal_modularity -->
<!-- doxrox-include igraph_community_to_membership -->
<!-- doxrox-include igraph_reindex_membership -->
<!-- doxrox-include igraph_compare_communities -->
<!-- doxrox-include igraph_split_join_distance -->
</section>
<section id="community-detection-based-on-statistical-mechanics"><title>Community structure based on statistical mechanics</title>
<!-- doxrox-include igraph_community_spinglass -->
<!-- doxrox-include igraph_community_spinglass_single -->
</section>
<section id="community-structure-based-on-eigenvectors-of-matrices"><title>Community structure based on eigenvectors of matrices</title>
<!-- doxrox-include about_leading_eigenvector_methods -->
<!-- doxrox-include igraph_community_leading_eigenvector -->
<!-- doxrox-include igraph_community_leading_eigenvector_callback_t -->
<!-- doxrox-include igraph_le_community_to_membership -->
</section>
<section id="walktrap-community-structure-based-on-random-walks"><title>Walktrap: Community structure based on random walks</title>
<!-- doxrox-include igraph_community_walktrap -->
</section>
<section id="edge-betweenness-based-community-detection"><title>Edge betweenness based community detection</title>
<!-- doxrox-include igraph_community_edge_betweenness -->
<!-- doxrox-include igraph_community_eb_get_merges -->
</section>
<section id="community-structure-based-on-the-optimization-of-modularity"><title>Community structure based on the optimization of modularity</title>
<!-- doxrox-include igraph_community_fastgreedy -->
<!-- doxrox-include igraph_community_multilevel -->
<!-- doxrox-include igraph_community_leiden -->
<!-- doxrox-include igraph_community_leiden_simple -->
</section>
<section id="fluid-communities"><title>Fluid communities</title>
<!-- doxrox-include igraph_community_fluid_communities -->
</section>
<section id="label-propagation"><title>Label propagation</title>
<!-- doxrox-include igraph_community_label_propagation -->
</section>
<section id="infomap-algorithm"><title>The InfoMAP algorithm</title>
<!-- doxrox-include igraph_community_infomap -->
</section>
<section id="voronoi-communities"><title>Voronoi communities</title>
<!-- doxrox-include igraph_community_voronoi -->
</section>
</chapter>
+37
View File
@@ -0,0 +1,37 @@
<?xml version="1.0"?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY igraph "igraph">
]>
<chapter id="igraph-Cycles">
<title>Graph cycles</title>
<section id="finding-cycles"><title>Finding cycles</title>
<!-- doxrox-include igraph_find_cycle -->
<!-- doxrox-include igraph_simple_cycles -->
<!-- doxrox-include igraph_simple_cycles_callback -->
<!-- doxrox-include igraph_cycle_handler_t -->
</section>
<section id="acyclic-graphs-feedback-sets"><title>Acyclic graphs and feedback sets</title>
<!-- doxrox-include igraph_is_dag -->
<!-- doxrox-include igraph_is_acyclic -->
<!-- doxrox-include igraph_topological_sorting -->
<!-- doxrox-include igraph_feedback_arc_set -->
<!-- doxrox-include igraph_feedback_vertex_set -->
</section>
<section id="eulerian-cycles"><title>Eulerian cycles and paths</title>
<!-- doxrox-include about_eulerian -->
<!-- doxrox-include igraph_is_eulerian -->
<!-- doxrox-include igraph_eulerian_cycle -->
<!-- doxrox-include igraph_eulerian_path -->
</section>
<section id="cycle-bases"><title>Cycle bases</title>
<!-- doxrox-include igraph_fundamental_cycles -->
<!-- doxrox-include igraph_minimum_cycle_basis -->
</section>
</chapter>
@@ -0,0 +1,36 @@
# by Stuart Rackham
# http://www.methods.co.nz/asciidoc/source-highlight-filter.html
extension "xml"
bold "<emphasis role=\"strong\">$text</emphasis>"
italics "<emphasis>$text</emphasis>"
anchor "<anchor id=\"line$linenum\"/>$text"
postline_reference "<link linkend='line$linenum'>$text -> $linenum</link>"
postdoc_reference "<link linkend='line$linenum'>$text -> $linenum</link>"
reference "<link linkend='$text'>$text</link>"
doctemplate
"<!DOCTYPE article PUBLIC \"-//OASIS//DTD DocBook//EN\">
<article>
<articleinfo>
<title>$title</title>
</articleinfo>
<programlisting linenumbering=\"numbered\">"
"</programlisting>
</article>
"
end
nodoctemplate
"<programlisting linenumbering=\"numbered\">"
"</programlisting>
"
end
translations
"&" "&amp;"
"<" "&lt;"
">" "&gt;"
end
+567
View File
@@ -0,0 +1,567 @@
#! /usr/bin/env python3
# igraph library
# Copyright (C) 2005-2021 The igraph development team
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA
#
###################################################################
"""DocBook XML generator for igraph.
The generator parses one or more input files for documentation chunks
(embedded in the source code as Doxygen-style comments), and processes
them with a set of regex-based rules. The processed chunks are then
substituted into a template file containing <!-- doxrox-include -->
directives.
When a template file is not provided, the generator will read the input
files, process them with the ruleset and save a dictionary mapping chunk
names to the corresponding processed chunks into a Python pickle. This
can be used to speed up the processing of multiple input files as you can
generate the chunks once and then re-use them for multiple input files.
"""
import os
import re
import sys
from argparse import ArgumentParser
from collections import defaultdict
from contextlib import contextmanager
from dataclasses import dataclass
from enum import Enum
from fnmatch import fnmatch
from hashlib import sha1
from operator import itemgetter
from pathlib import Path
from pickle import dump, load
from time import time
from typing import Any, Callable, Dict, Iterator, List, Optional, Pattern
#: Constant indicating the start of a comment that doxrox.py will process
DOXHEAD: str = r"/\*\*"
#: Stores whether we want verbose output
verbose: bool = False
def fatal(message: str, code: int = 1):
"""Prints an error message and exits the program with the given error code."""
print(message, file=sys.stderr)
sys.exit(code)
#########################################################################
# The main function
#########################################################################
def main():
"""Main entry point of the script."""
global verbose
# get command line arguments
parser = create_argument_parser()
arguments = parser.parse_args()
outputfile: str = arguments.output_file
inputs: List[str] = arguments.inputs
verbose = arguments.verbose
if (
arguments.template_file in inputs
or arguments.rules_file in inputs
or outputfile in inputs
):
fatal("Special file is also used as an input file", 2)
# open the cache file if needed
cache = ChunkCache(arguments.cache_file) if arguments.cache_file else None
# get all regular expressions
rules: List[Rule]
if arguments.rules_file:
with operation("Reading regular expressions...") as op:
rules = read_regex_rules_file(arguments.rules_file)
op("{0} rules read".format(len(rules)))
else:
rules = []
# parse all input files and extract chunks, apply rules
if arguments.chunk_file:
with operation("Reading pickled chunks...") as op:
try:
with open(arguments.chunk_file, "rb") as f:
all_chunks = load(f)
except IOError:
fatal("Error reading chunk file: " + arguments.chunk_file, 9)
op("{0} chunks read".format(len(all_chunks)))
else:
all_chunks = {}
rule_timings = defaultdict(list)
for ifile in inputs:
with operation("Parsing input file {0}...".format(ifile)) as op:
try:
with open(ifile, "r") as f:
contents = f.read()
except IOError:
fatal("Error reading input file: " + ifile, 3)
if cache:
key = cache.key_of(contents)
chunks = cache.get(key)
else:
key, chunks = None, None
if chunks is not None:
op("{0} chunks read from cache".format(len(chunks)))
else:
chunks = collect_chunks_from_input_file(
ifile, contents, rules, rule_timings
)
op("{0} chunks parsed".format(len(chunks)))
if key and cache:
cache.put(key, chunks)
for name, chunk in chunks.items():
if name in all_chunks:
fatal(
"Multiple files provide chunks for {0!r}".format(name), code=4
)
all_chunks[name] = chunk
if arguments.timing_stats and rule_timings:
rule_timings = {name: sum(dts) / len(dts) for name, dts in rule_timings.items()}
for name, dt in sorted(rule_timings.items(), key=itemgetter(1), reverse=True):
print("{0}: {1:.3f}us".format(name, dt))
print("======")
if cache:
cache.close()
if arguments.template_file:
# substitute the template file
with operation("Reading template file..."):
try:
with open(arguments.template_file, "r") as tfile:
tstring = tfile.read()
except IOError:
fatal("Error reading the template file: " + arguments.template_file, 7)
with operation("Substituting template file..."):
chunk_iterator = re.finditer(
r"<!--\s*doxrox-include\s+(\w+)\s*-->", tstring
)
outstring = []
last = 0
for match in chunk_iterator:
try:
chunk = all_chunks[match.group(1)]
except KeyError:
fatal("Chunk not found: {0}".format(match.group(1)), code=4)
outstring.append(tstring[last : match.start()])
outstring.append(chunk)
last = match.end()
outstring.append(tstring[last:])
outstring = "".join(outstring)
# write output file
with operation("Writing output file..."):
try:
with open(outputfile, "w") as ofile:
ofile.write(outstring)
except IOError:
fatal("Error writing output file:" + outputfile, 8)
else:
# no template file given so just save the chunks as a pickle into the
# output file
with operation("Writing output file..."):
try:
with open(outputfile, "wb") as ofile:
dump(all_chunks, ofile)
except IOError:
fatal("Error writing output file:" + outputfile, 5)
#########################################################################
# Argument parser
#########################################################################
def create_argument_parser() -> ArgumentParser:
"""Creates the command line argument parser that the script uses."""
parser = ArgumentParser(description=(sys.modules[__name__].__doc__ or "").strip())
parser.add_argument(
"--cache",
metavar="FILE",
dest="cache_file",
help="optional cache file to store chunks from already processed files",
)
parser.add_argument(
"-t",
"--template",
metavar="FILE",
dest="template_file",
help="template file to process",
)
parser.add_argument(
"-e",
"--rules",
metavar="FILE",
dest="rules_file",
help="file containing matching and replacement rules",
)
parser.add_argument(
"-o",
"--output",
metavar="FILE",
dest="output_file",
required=True,
help="name of the output file",
)
parser.add_argument(
"-v",
"--verbose",
action="store_true",
default=False,
dest="verbose",
help="enable verbose output",
)
parser.add_argument(
"--chunks",
dest="chunk_file",
metavar="FILE",
help="name of a previously saved chunk file",
)
parser.add_argument(
"--timing-stats",
dest="timing_stats",
action="store_true",
default=False,
help="print the average time it takes to process regex rules from the rules file",
)
parser.add_argument(
"inputs", metavar="INPUT", nargs="*", help="input files to process"
)
return parser
#################
# classes and functions to read the regular expression rules
#################
class RuleType(Enum):
REPLACE = "replace"
RUN = "run"
@dataclass
class Rule:
regex: Pattern[str]
"""The regular expression that the rule will attempt to match."""
replacement: str
"""The replacement string for the match, or the code to execute on the
match.
"""
type: RuleType
"""Type of the rule"""
name: Optional[str]
"""Name of the rule, for debugging purposes."""
glob: Optional[str] = None
"""Optional glob pattern that specifies which input files the rule
applies to.
"""
def applies_to_filename(self, filename: str) -> bool:
"""Returns whether the rule applies to files with the given name."""
if self.glob:
return fnmatch(filename, self.glob)
else:
return True
def read_regex_rules_file(filename) -> List[Rule]:
"""Parses the file containing the regex-based rules that we use to chop
up the input source files into chunks that can later be fed into a
DocBook document.
Parameters:
filename: name of the input file
Returns:
the rules that were parsed from the input file
"""
rules: List[Rule] = []
def parse_error(lineno):
"""Helper function to indicate a parse error at the given line."""
fatal(
"Parse error in regex file ({0}), line {1}".format(filename, lineno), code=4
)
def store(
rule: List[str],
replacement: List[str],
rule_name: Optional[str],
rule_type: RuleType,
glob: Optional[str],
) -> None:
"""Helper function to append the current rule to the result."""
regex = re.compile("".join(rule), re.VERBOSE | re.MULTILINE | re.DOTALL)
replacement_str = "".join(replacement)[:-1]
rules.append(Rule(regex, replacement_str, rule_type, rule_name, glob))
mode = "empty"
regex, replacement = [], []
rule_name: Optional[str] = None
rule_type: Optional[RuleType] = None
glob: Optional[str] = None
try:
with open(filename, "r") as f:
for lineno, line in enumerate(f, 1):
if line.startswith("REPLACE"):
# a new pattern block starts
if mode not in ("empty", "with"):
parse_error(lineno)
else:
if regex and rule_type:
store(regex, replacement, rule_name, rule_type, glob)
regex.clear()
replacement.clear()
mode = "replace"
match = re.match(
r"^REPLACE( IN (?P<glob>[^\s]+))?\s+-+\s+(?P<name>.*)\s+-",
line,
)
rule_name = match.group("name") if match else None
glob = match.group("glob") if match else None
elif line.startswith("WITH") or line.startswith("RUN"):
# the second half of the pattern block starts
if mode != "replace":
parse_error(lineno)
else:
mode = "with"
rule_type = (
RuleType.REPLACE if line.startswith("WITH") else RuleType.RUN
)
elif re.match(r"^\s*$", line):
# empty line, do nothing
pass
else:
# normal line, append
if mode == "replace":
regex.append(line)
elif mode == "with":
replacement.append(line)
else:
parse_error(lineno)
if regex != "" and rule_type:
store(regex, replacement, rule_name, rule_type, glob)
except IOError:
fatal("Error reading regex file: " + filename, code=4)
return rules
#################
# parse an input file string
#################
def collect_chunks_from_input_file(
path: str, strinput: str, rules: List[Rule], rule_timings
) -> Dict[str, str]:
result: Dict[str, str] = {}
# split the file
chunks = re.split(DOXHEAD, strinput)
chunks = chunks[1:]
# get the filename part of the path
filename = os.path.basename(path)
# apply all rules to the chunks
for chunk in chunks:
name: Optional[str] = None
for rule in rules:
start = time()
if not name and "name" in rule.regex.groupindex:
# The regex might provide us with a chunk name so try figuring
# out what the "name" group might match to
matched = rule.regex.search(chunk)
if matched:
try:
name = matched.group("name")
except IndexError:
name = ""
if rule.applies_to_filename(filename):
if rule.type is RuleType.REPLACE:
# This is a simple regex replacement rule
try:
chunk = rule.regex.sub(rule.replacement, chunk)
except IndexError:
print("Index error:" + chunk[0:60] + "...")
print("Pattern:\n" + rule.regex.pattern)
print("Current state:" + chunk[0:60] + "...")
fatal("Parsing error", code=6)
elif rule.type is RuleType.RUN:
# This is a piece of Python code that has to be executed on
# the part that matched
matched = rule.regex.search(chunk)
if matched:
exec(rule.replacement)
else:
fatal("Invalid rule type: {0!r}".format(rule.type), code=6)
rule_timings[rule.name].append((time() - start) * 1000000)
if not name:
# print("Chunk without a name ignored:" + ch[0:60] + "...")
continue
result[name] = chunk.strip()
return result
@contextmanager
def operation(message: str) -> Iterator[Callable[[Any], None]]:
"""Helper function to show progress messages for a potentially long-running
operation in verbose mode.
Parameters:
message (str): the message to show
"""
global verbose
if verbose:
print(message, end="")
result = [None]
def set_result(obj: Any) -> None:
result[0] = obj
success = False
try:
yield set_result
success = True
finally:
if verbose and success:
if result[0] is None:
print(" done.")
else:
print(" done, {0}.".format(result[0]))
class ChunkCache:
"""Simple on-disk cache that stores SHA256 hashes of files along with the
DocBook documentation chunks that were parsed from them.
"""
_data: Optional[Dict[str, Dict[str, str]]]
_dirty: bool
_path: Path
def __init__(self, filename: str, hash=sha1):
"""Constructor.
Parameters:
filename: name of the file on the disk where the cache resides
hash: the hash function to use
"""
self._data = None
self._dirty = False
self._hash = hash
self._path = Path(filename)
def _load(self) -> None:
"""Populates the in-memory copy of the cache from the disk."""
if self._path.exists():
try:
with self._path.open("rb") as fp:
self._data = load(fp)
except (IOError, EOFError):
# cache corrupted
self._data = {}
else:
self._data = {}
self._dirty = False
def close(self) -> None:
"""Closes the cache and flushes its contents back to the disk if it
changed recently.
"""
if self._dirty:
self.flush()
def flush(self) -> None:
"""Flushes the contents of the cache back to the disk."""
with self._path.open("wb") as fp:
dump(self._data, fp)
self._dirty = False
def get(self, key: str) -> Optional[Dict[str, str]]:
"""Returns the chunks associated to the file with the given key, or
`None` if the key is not in the cache.
"""
if self._data is None:
self._load()
assert self._data is not None
return self._data.get(key)
def key_of(self, contents, encoding: str = "utf-8") -> str:
"""Returns the hash key corresponding to the file with the given
contents.
"""
if not isinstance(contents, bytes):
contents = contents.encode(encoding)
key = self._hash()
key.update(contents)
return key.hexdigest()
def put(self, key: str, chunks: Dict[str, str]) -> None:
"""Stores some chunks associated to the file with the given key."""
assert self._data is not None
self._data[key] = chunks
self._dirty = True
if __name__ == "__main__":
main()
+24
View File
@@ -0,0 +1,24 @@
<?xml version="1.0"?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY igraph "igraph">
]>
<section id="igraph-Dqueues">
<title id="double-ended-queues">Double-ended queues</title>
<!-- doxrox-include igraph_dqueue -->
<!-- doxrox-include igraph_dqueue_init -->
<!-- doxrox-include igraph_dqueue_destroy -->
<!-- doxrox-include igraph_dqueue_empty -->
<!-- doxrox-include igraph_dqueue_full -->
<!-- doxrox-include igraph_dqueue_clear -->
<!-- doxrox-include igraph_dqueue_size -->
<!-- doxrox-include igraph_dqueue_head -->
<!-- doxrox-include igraph_dqueue_back -->
<!-- doxrox-include igraph_dqueue_get -->
<!-- doxrox-include igraph_dqueue_pop -->
<!-- doxrox-include igraph_dqueue_pop_back -->
<!-- doxrox-include igraph_dqueue_push -->
</section>
@@ -0,0 +1,16 @@
<?xml version='1.0'?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY igraph "igraph">
]>
<chapter id="igraph-Embedding">
<title>Embedding of graphs</title>
<section id="spectral-embedding"><title>Spectral embedding</title>
<!-- doxrox-include igraph_adjacency_spectral_embedding -->
<!-- doxrox-include igraph_laplacian_spectral_embedding -->
<!-- doxrox-include igraph_dim_select -->
</section>
</chapter>
+88
View File
@@ -0,0 +1,88 @@
<?xml version="1.0"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY igraph "igraph">
]>
<chapter id="igraph-Error">
<title>Error handling</title>
<section id="error-handling-basics">
<!-- doxrox-include error_handling_basics -->
</section>
<section id="error-handlers">
<!-- doxrox-include error_handlers -->
<!-- doxrox-include igraph_error_handler_t -->
<!-- doxrox-include igraph_error_handler_abort -->
<!-- doxrox-include igraph_error_handler_ignore -->
<!-- doxrox-include igraph_error_handler_printignore -->
</section>
<section id="error-codes">
<!-- doxrox-include error_codes -->
<!-- doxrox-include igraph_error_t -->
<!-- doxrox-include igraph_error_type_t -->
<!-- doxrox-include igraph_strerror -->
</section>
<section id="warnings">
<!-- doxrox-include about_igraph_warnings -->
<!-- doxrox-include igraph_warning_handler_t -->
<!-- doxrox-include igraph_set_warning_handler -->
<!-- doxrox-include IGRAPH_WARNING -->
<!-- doxrox-include IGRAPH_WARNINGF -->
<!-- doxrox-include igraph_warning -->
<!-- doxrox-include igraph_warningf -->
<!-- doxrox-include igraph_warning_handler_ignore -->
<!-- doxrox-include igraph_warning_handler_print -->
</section>
<section id="error-advanced-topics">
<title>Advanced topics</title>
<section id="writing-error-handlers">
<!-- doxrox-include writing_error_handlers -->
<!-- doxrox-include igraph_set_error_handler -->
</section>
<section id="error-handling-internals">
<!-- doxrox-include error_handling_internals -->
<!-- doxrox-include IGRAPH_ERROR -->
<!-- doxrox-include IGRAPH_ERRORF -->
<!-- doxrox-include igraph_error -->
<!-- doxrox-include igraph_errorf -->
<!-- doxrox-include IGRAPH_CHECK -->
<!-- doxrox-include IGRAPH_CHECK_CALLBACK -->
</section>
<section id="deallocating-memory">
<!-- doxrox-include deallocating_memory -->
<!-- doxrox-include IGRAPH_FINALLY -->
<!-- doxrox-include IGRAPH_FINALLY_CLEAN -->
<!-- doxrox-include IGRAPH_FINALLY_FREE -->
</section>
<section id="writing-igraph-functions-with-proper-error-handling">
<!-- doxrox-include writing_functions_error_handling -->
</section>
<section id="fatal-error-handlers">
<!-- doxrox-include fatal_error_handlers -->
<!-- doxrox-include igraph_fatal_handler_t -->
<!-- doxrox-include igraph_set_fatal_handler -->
<!-- doxrox-include igraph_fatal_handler_abort -->
<!-- doxrox-include IGRAPH_FATAL -->
<!-- doxrox-include IGRAPH_FATALF -->
<!-- doxrox-include IGRAPH_ASSERT -->
<!-- doxrox-include igraph_fatal -->
<!-- doxrox-include igraph_fatalf -->
</section>
<section id="error-handling-and-threads">
<!-- doxrox-include error_handling_threads -->
</section>
</section>
</chapter>
+420
View File
@@ -0,0 +1,420 @@
<?xml version="1.0"?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
<section id="igraph-fdl">
<sectioninfo>
<edition>Version 1.2, November 2002</edition>
<copyright><year>2000</year><year>2001</year><year>2002</year>
<holder>Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
</holder>
</copyright>
<legalnotice><para>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
</para>
</legalnotice>
</sectioninfo>
<title>The GNU Free Documentation License</title>
<section><title>0. PREAMBLE</title>
<para>
The purpose of this License is to make a manual, textbook, or other
functional and useful document "free" in the sense of freedom: to
assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or noncommercially.
Secondarily, this License preserves for the author and publisher a way
to get credit for their work, while not being considered responsible
for modifications made by others.
</para><para>
This License is a kind of "copyleft", which means that derivative
works of the document must themselves be free in the same sense. It
complements the GNU General Public License, which is a copyleft
license designed for free software.
</para><para>
We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
software does. But this License is not limited to software manuals;
it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book. We recommend this License
principally for works whose purpose is instruction or reference.
</para>
</section><section><title>1. APPLICABILITY AND DEFINITIONS</title>
<para>
This License applies to any manual or other work, in any medium, that
contains a notice placed by the copyright holder saying it can be
distributed under the terms of this License. Such a notice grants a
world-wide, royalty-free license, unlimited in duration, to use that
work under the conditions stated herein. The "Document", below,
refers to any such manual or work. Any member of the public is a
licensee, and is addressed as "you". You accept the license if you
copy, modify or distribute the work in a way requiring permission
under copyright law.
</para><para>
A "Modified Version" of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
</para><para>
A "Secondary Section" is a named appendix or a front-matter section of
the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document's overall subject
(or to related matters) and contains nothing that could fall directly
within that overall subject. (Thus, if the Document is in part a
textbook of mathematics, a Secondary Section may not explain any
mathematics.) The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.
</para><para>
The "Invariant Sections" are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
that says that the Document is released under this License. If a
section does not fit the above definition of Secondary then it is not
allowed to be designated as Invariant. The Document may contain zero
Invariant Sections. If the Document does not identify any Invariant
Sections then there are none.
</para><para>
The "Cover Texts" are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
the Document is released under this License. A Front-Cover Text may
be at most 5 words, and a Back-Cover Text may be at most 25 words.
</para><para>
A "Transparent" copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters. A copy made in an otherwise Transparent file
format whose markup, or absence of markup, has been arranged to thwart
or discourage subsequent modification by readers is not Transparent.
An image format is not Transparent if used for any substantial amount
of text. A copy that is not "Transparent" is called "Opaque".
</para><para>
Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, LaTeX input format, SGML
or XML using a publicly available DTD, and standard-conforming simple
HTML, PostScript or PDF designed for human modification. Examples of
transparent image formats include PNG, XCF and JPG. Opaque formats
include proprietary formats that can be read and edited only by
proprietary word processors, SGML or XML for which the DTD and/or
processing tools are not generally available, and the
machine-generated HTML, PostScript or PDF produced by some word
processors for output purposes only.
</para><para>
The "Title Page" means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
this License requires to appear in the title page. For works in
formats which do not have any title page as such, "Title Page" means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.
</para><para>
A section "Entitled XYZ" means a named subunit of the Document whose
title either is precisely XYZ or contains XYZ in parentheses following
text that translates XYZ in another language. (Here XYZ stands for a
specific section name mentioned below, such as "Acknowledgements",
"Dedications", "Endorsements", or "History".) To "Preserve the Title"
of such a section when you modify the Document means that it remains a
section "Entitled XYZ" according to this definition.
</para><para>
The Document may include Warranty Disclaimers next to the notice which
states that this License applies to the Document. These Warranty
Disclaimers are considered to be included by reference in this
License, but only as regards disclaiming warranties: any other
implication that these Warranty Disclaimers may have is void and has
no effect on the meaning of this License.
</para>
</section><section><title>2. VERBATIM COPYING</title>
<para>
You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies
to the Document are reproduced in all copies, and that you add no other
conditions whatsoever to those of this License. You may not use
technical measures to obstruct or control the reading or further
copying of the copies you make or distribute. However, you may accept
compensation in exchange for copies. If you distribute a large enough
number of copies you must also follow the conditions in section 3.
</para><para>
You may also lend copies, under the same conditions stated above, and
you may publicly display copies.
</para>
</section><section><title>3. COPYING IN QUANTITY</title>
<para>
If you publish printed copies (or copies in media that commonly have
printed covers) of the Document, numbering more than 100, and the
Document's license notice requires Cover Texts, you must enclose the
copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover. Both covers must also clearly and legibly identify
you as the publisher of these copies. The front cover must present
the full title with all words of the title equally prominent and
visible. You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve
the title of the Document and satisfy these conditions, can be treated
as verbatim copying in other respects.
</para><para>
If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.
</para><para>
If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
a computer-network location from which the general network-using
public has access to download using public-standard network protocols
a complete Transparent copy of the Document, free of added material.
If you use the latter option, you must take reasonably prudent steps,
when you begin distribution of Opaque copies in quantity, to ensure
that this Transparent copy will remain thus accessible at the stated
location until at least one year after the last time you distribute an
Opaque copy (directly or through your agents or retailers) of that
edition to the public.
</para><para>
It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.
</para>
</section><section><title>4. MODIFICATIONS</title>
<para>
You may copy and distribute a Modified Version of the Document under
the conditions of sections 2 and 3 above, provided that you release
the Modified Version under precisely this License, with the Modified
Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it. In addition, you must do these things in the Modified Version:
</para><para>
<orderedlist numeration="upperalpha">
<listitem><para>
Use in the Title Page (and on the covers, if any) a title distinct
from that of the Document, and from those of previous versions
(which should, if there were any, be listed in the History section
of the Document). You may use the same title as a previous version
if the original publisher of that version gives permission.
</para></listitem><listitem><para>
List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the
Document (all of its principal authors, if it has fewer than five),
unless they release you from this requirement.
</para></listitem><listitem><para>
State on the Title page the name of the publisher of the
Modified Version, as the publisher.
</para></listitem><listitem><para>
Preserve all the copyright notices of the Document.
</para></listitem><listitem><para>
Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.
</para></listitem><listitem><para>
Include, immediately after the copyright notices, a license notice
giving the public permission to use the Modified Version under the
terms of this License, in the form shown in the Addendum below.
</para></listitem><listitem><para>
Preserve in that license notice the full lists of Invariant Sections
and required Cover Texts given in the Document's license notice.
</para></listitem><listitem><para>
Include an unaltered copy of this License.
</para></listitem><listitem><para>
Preserve the section Entitled "History", Preserve its Title, and add
to it an item stating at least the title, year, new authors, and
publisher of the Modified Version as given on the Title Page. If
there is no section Entitled "History" in the Document, create one
stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified
Version as stated in the previous sentence.
</para></listitem><listitem><para>
Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and likewise
the network locations given in the Document for previous versions
it was based on. These may be placed in the "History" section.
You may omit a network location for a work that was published at
least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.
</para></listitem><listitem><para>
For any section Entitled "Acknowledgements" or "Dedications",
Preserve the Title of the section, and preserve in the section all
the substance and tone of each of the contributor acknowledgements
and/or dedications given therein.
</para></listitem><listitem><para>
Preserve all the Invariant Sections of the Document,
unaltered in their text and in their titles. Section numbers
or the equivalent are not considered part of the section titles.
</para></listitem><listitem><para>
Delete any section Entitled "Endorsements". Such a section
may not be included in the Modified Version.
</para></listitem><listitem><para>
Do not retitle any existing section to be Entitled "Endorsements"
or to conflict in title with any Invariant Section.
</para></listitem><listitem><para>
Preserve any Warranty Disclaimers.
</para></listitem></orderedlist>
</para><para>
If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
of these sections as invariant. To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.
</para><para>
You may add a section Entitled "Endorsements", provided it contains
nothing but endorsements of your Modified Version by various
parties--for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.
</para><para>
You may add a passage of up to five words as a Front-Cover Text, and a
passage of up to 25 words as a Back-Cover Text, to the end of the list
of Cover Texts in the Modified Version. Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity. If the Document already
includes a cover text for the same cover, previously added by you or
by arrangement made by the same entity you are acting on behalf of,
you may not add another; but you may replace the old one, on explicit
permission from the previous publisher that added the old one.
</para><para>
The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.
</para>
</section><section><title>5. COMBINING DOCUMENTS</title>
<para>
You may combine the Document with other documents released under this
License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
license notice, and that you preserve all their Warranty Disclaimers.
</para><para>
The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy. If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by
adding at the end of it, in parentheses, the name of the original
author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.
</para><para>
In the combination, you must combine any sections Entitled "History"
in the various original documents, forming one section Entitled
"History"; likewise combine any sections Entitled "Acknowledgements",
and any sections Entitled "Dedications". You must delete all sections
Entitled "Endorsements".
</para>
</section><section><title>6. COLLECTIONS OF DOCUMENTS</title>
<para>
You may make a collection consisting of the Document and other documents
released under this License, and replace the individual copies of this
License in the various documents with a single copy that is included in
the collection, provided that you follow the rules of this License for
verbatim copying of each of the documents in all other respects.
</para><para>
You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.
</para>
</section><section><title>7. AGGREGATION WITH INDEPENDENT WORKS</title>
<para>
A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
distribution medium, is called an "aggregate" if the copyright
resulting from the compilation is not used to limit the legal rights
of the compilation's users beyond what the individual works permit.
When the Document is included in an aggregate, this License does not
apply to the other works in the aggregate which are not themselves
derivative works of the Document.
</para><para>
If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one half of
the entire aggregate, the Document's Cover Texts may be placed on
covers that bracket the Document within the aggregate, or the
electronic equivalent of covers if the Document is in electronic form.
Otherwise they must appear on printed covers that bracket the whole
aggregate.
</para>
</section><section><title>8. TRANSLATION</title>
<para>
Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section 4.
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also include
the original English version of this License and the original versions
of those notices and disclaimers. In case of a disagreement between
the translation and the original version of this License or a notice
or disclaimer, the original version will prevail.
</para><para>
If a section in the Document is Entitled "Acknowledgements",
"Dedications", or "History", the requirement (section 4) to Preserve
its Title (section 1) will typically require changing the actual
title.
</para>
</section><section><title>9. TERMINATION</title>
<para>
You may not copy, modify, sublicense, or distribute the Document except
as expressly provided for under this License. Any other attempt to
copy, modify, sublicense or distribute the Document is void, and will
automatically terminate your rights under this License. However,
parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such
parties remain in full compliance.
</para>
</section><section><title>10. FUTURE REVISIONS OF THIS LICENSE</title>
<para>
The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. See
http://www.gnu.org/copyleft/.
</para><para>
Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
License "or any later version" applies to it, you have the option of
following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
Free Software Foundation. If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation.
</para>
</section><section><title>G.1.1 ADDENDUM: How to use this License for your documents</title>
<para>
To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
license notices just after the title page:
</para>
<para><literallayout>
Copyright (c) YEAR YOUR NAME.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU
Free Documentation License".
</literallayout></para>
<para>
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
replace the "with...Texts." line with this:
</para>
<para><literallayout>
with the Invariant Sections being LIST THEIR TITLES, with the
Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
</literallayout></para>
<para>
If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.
</para><para>
If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.
</para>
</section>
</section>
+48
View File
@@ -0,0 +1,48 @@
<?xml version="1.0"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY igraph "igraph">
]>
<chapter id="igraph-Flows">
<title>Maximum flows, minimum cuts and related measures</title>
<section id="maximum-flows"><title>Maximum flows</title>
<!-- doxrox-include igraph_maxflow -->
<!-- doxrox-include igraph_maxflow_value -->
<!-- doxrox-include igraph_dominator_tree -->
<!-- doxrox-include igraph_maxflow_stats_t -->
</section>
<section id="cuts-and-minimum-cuts"><title>Cuts and minimum cuts</title>
<!-- doxrox-include igraph_st_mincut -->
<!-- doxrox-include igraph_st_mincut_value -->
<!-- doxrox-include igraph_all_st_cuts -->
<!-- doxrox-include igraph_all_st_mincuts -->
<!-- doxrox-include igraph_mincut -->
<!-- doxrox-include igraph_mincut_value -->
<!-- doxrox-include igraph_gomory_hu_tree -->
</section>
<section id="connectivity"><title>Connectivity</title>
<!-- doxrox-include igraph_st_edge_connectivity -->
<!-- doxrox-include igraph_edge_connectivity -->
<!-- doxrox-include igraph_st_vertex_connectivity -->
<!-- doxrox-include igraph_vertex_connectivity -->
</section>
<section id="edge-and-vertex-disjoint-paths"><title>Edge- and vertex-disjoint paths</title>
<!-- doxrox-include igraph_edge_disjoint_paths -->
<!-- doxrox-include igraph_vertex_disjoint_paths -->
</section>
<section id="graph-adhesion-and-cohesion"><title>Graph adhesion and cohesion</title>
<!-- doxrox-include igraph_adhesion -->
<!-- doxrox-include igraph_cohesion -->
</section>
<section id="cohesive-blocks"><title>Cohesive blocks</title>
<!-- doxrox-include igraph_cohesive_blocks -->
</section>
</chapter>
+59
View File
@@ -0,0 +1,59 @@
<?xml version="1.0"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY igraph "igraph">
]>
<chapter id="igraph-Foreign">
<title>Reading and writing graphs from and to files</title>
<!-- doxrox-include about_loadsave -->
<section id="simple-edge-list-and-similar-formats"><title>Simple edge list and similar formats</title>
<!-- doxrox-include igraph_read_graph_edgelist -->
<!-- doxrox-include igraph_write_graph_edgelist -->
<!-- doxrox-include igraph_read_graph_ncol -->
<!-- doxrox-include igraph_write_graph_ncol -->
<!-- doxrox-include igraph_read_graph_lgl -->
<!-- doxrox-include igraph_write_graph_lgl -->
<!-- doxrox-include igraph_read_graph_dimacs_flow -->
<!-- doxrox-include igraph_write_graph_dimacs_flow -->
</section>
<section id="binary-formats"><title>Binary formats</title>
<!-- doxrox-include igraph_read_graph_graphdb -->
</section>
<section id="graphml-format"><title>GraphML format</title>
<!-- doxrox-include igraph_read_graph_graphml -->
<!-- doxrox-include igraph_write_graph_graphml -->
</section>
<section id="gml-format"><title>GML format</title>
<!-- doxrox-include igraph_read_graph_gml -->
<!-- doxrox-include igraph_write_graph_gml -->
</section>
<section id="pajek-format"><title>Pajek format</title>
<!-- doxrox-include igraph_read_graph_pajek -->
<!-- doxrox-include igraph_write_graph_pajek -->
</section>
<section id="ucinets-dl-file-format"><title>UCINET's DL file format</title>
<!-- doxrox-include igraph_read_graph_dl -->
</section>
<section id="graphviz-format"><title>Graphviz format</title>
<!-- doxrox-include igraph_write_graph_dot -->
</section>
<section id="leda-format"><title>LEDA format</title>
<!-- doxrox-include igraph_write_graph_leda -->
</section>
<section id="locale-helpers"><title>Convenience functions for locale change</title>
<!-- doxrox-include igraph_enter_safelocale -->
<!-- doxrox-include igraph_exit_safelocale -->
</section>
</chapter>
+85
View File
@@ -0,0 +1,85 @@
<?xml version="1.0"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY igraph "igraph">
]>
<chapter id="igraph-Games">
<title>Stochastic graph generators ("games")</title>
<para>"Games" are random graph generators, i.e. they generate a different
graph every time they are called. igraph includes many such generators.
Some implement stochastic graph construction processes inspired by real-world
mechanics, such as preferential attachment, while others are designed to
produce graphs with certain used properties (e.g. fixed number of edges,
fixed degrees, etc.)</para>
<section id="erdos-renyi-games"><title>The Erdős-Rényi and related models</title>
<!-- doxrox-include about_erdos_renyi -->
<!-- doxrox-include igraph_erdos_renyi_game_gnm -->
<!-- doxrox-include igraph_erdos_renyi_game_gnp -->
<!-- doxrox-include igraph_iea_game -->
<!-- doxrox-include igraph_sbm_game -->
<!-- doxrox-include igraph_hsbm_game -->
<!-- doxrox-include igraph_hsbm_list_game -->
<!-- doxrox-include igraph_preference_game -->
<!-- doxrox-include igraph_asymmetric_preference_game -->
<!-- doxrox-include igraph_correlated_game -->
<!-- doxrox-include igraph_correlated_pair_game -->
</section>
<section id="preferential-attachment-games"><title>Preferential attachment and related models</title>
<para>Preferential attachment models are growing random graphs where vertices are added iteratively,
and connected to previously added vertices based on dynamically changing vertex properties, such as
degree or time since the vertex was added.</para>
<!-- doxrox-include igraph_barabasi_game -->
<!-- doxrox-include igraph_barabasi_aging_game -->
<!-- doxrox-include igraph_recent_degree_game -->
<!-- doxrox-include igraph_recent_degree_aging_game -->
<!-- doxrox-include igraph_lastcit_game -->
</section>
<section id="growing-random-games"><title>Growing random graph models</title>
<para>In growing random graphs, vertices are added iteratively, and connected based on various rules.
Preferential attachment models are documented <link linkend="preferential-attachment-games">in their
own section</link>.
</para>
<!-- doxrox-include igraph_growing_random_game -->
<!-- doxrox-include igraph_callaway_traits_game -->
<!-- doxrox-include igraph_establishment_game -->
<!-- doxrox-include igraph_cited_type_game -->
<!-- doxrox-include igraph_citing_cited_type_game -->
<!-- doxrox-include igraph_forest_fire_game -->
</section>
<section id="degree-constrained-games"><title>Degree-constrained models</title>
<para>Random graph models with hard or soft degree constraints.</para>
<!-- doxrox-include igraph_degree_sequence_game -->
<!-- doxrox-include igraph_k_regular_game -->
<!-- doxrox-include igraph_rewire -->
<!-- doxrox-include igraph_chung_lu_game -->
<!-- doxrox-include igraph_static_fitness_game -->
<!-- doxrox-include igraph_static_power_law_game -->
</section>
<section id="edge-rewiring-games"><title>Edge rewiring models</title>
<!-- doxrox-include igraph_watts_strogatz_game -->
<!-- doxrox-include igraph_rewire_edges -->
<!-- doxrox-include igraph_rewire_directed_edges -->
</section>
<section id="other-random-games"><title>Other random graphs</title>
<!-- doxrox-include igraph_grg_game -->
<!-- doxrox-include igraph_dot_product_game -->
<!-- doxrox-include igraph_simple_interconnected_islands_game -->
<!-- doxrox-include igraph_tree_game -->
</section>
<section id="generator-types-and-constants"><title>Common types and constants</title>
<!-- doxrox-include igraph_edge_type_sw_t -->
</section>
</chapter>
@@ -0,0 +1,93 @@
<?xml version="1.0"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY igraph "igraph">
]>
<chapter id="igraph-Generators">
<title>Deterministic graph generators</title>
<section id="about-generators"><title>About generators</title>
<para>
Most functions that create graphs in a deterministic manner are documented here. See also
<link linkend="igraph-Games">stochastic generators</link>,
<link linkend="spatial-generators">spatial graph generators</link>,
<link linkend="create-two-mode-networks">bipartite graph generators</link>,
and <link linkend="igraph-Operators">operators that transform graphs</link>.
</para>
</section>
<section><title id="basic-generators">Basic graph creation</title>
<!-- doxrox-include igraph_create -->
<!-- doxrox-include igraph_small -->
</section>
<section id="adjacency-generators"><title>Graphs from adjacency matrices and adjacency lists</title>
<para>These functions create graphs from weighted or unweighted adjacency matrices, or an adjacency list.</para>
<!-- doxrox-include igraph_adjacency -->
<!-- doxrox-include igraph_weighted_adjacency -->
<!-- doxrox-include igraph_sparse_adjacency -->
<!-- doxrox-include igraph_sparse_weighted_adjacency -->
<!-- doxrox-include igraph_adjlist -->
</section>
<section id="regular-structre-generators"><title>Regular structures</title>
<para>These functions produce various basic regular graph structures, such as paths, cycles or lattices.</para>
<!-- doxrox-include igraph_star -->
<!-- doxrox-include igraph_wheel -->
<!-- doxrox-include igraph_hypercube -->
<!-- doxrox-include igraph_square_lattice -->
<!-- doxrox-include igraph_triangular_lattice -->
<!-- doxrox-include igraph_hexagonal_lattice -->
<!-- doxrox-include igraph_ring -->
<!-- doxrox-include igraph_path_graph -->
<!-- doxrox-include igraph_cycle_graph -->
<!-- doxrox-include igraph_lcf -->
<!-- doxrox-include igraph_lcf_small -->
<!-- doxrox-include igraph_circulant -->
<!-- doxrox-include igraph_extended_chordal_ring -->
</section>
<section id="tree-generators"><title>Tree generators</title>
<para>These functions generate tree graphs.</para>
<!-- doxrox-include igraph_kary_tree -->
<!-- doxrox-include igraph_symmetric_tree -->
<!-- doxrox-include igraph_regular_tree -->
<!-- doxrox-include igraph_tree_from_parent_vector -->
<!-- doxrox-include igraph_from_prufer -->
</section>
<section id="degree-graph-generators"><title>Graphs with given degrees</title>
<para>These functions generate graphs with the specified degrees.</para>
<!-- doxrox-include igraph_realize_degree_sequence -->
<!-- doxrox-include igraph_realize_bipartite_degree_sequence -->
</section>
<section id="complete-graph-generators"><title>Complete graphs</title>
<para>These functions produce single and multipartite complete graphs, as well as related graphs.</para>
<!-- doxrox-include igraph_full -->
<!-- doxrox-include igraph_full_citation -->
<!-- doxrox-include igraph_full_multipartite -->
<!-- doxrox-include igraph_turan -->
</section>
<section id="pre-defined-generators"><title>Pre-defined graphs</title>
<para>These functions return graphs from various graph collections.</para>
<!-- doxrox-include igraph_famous -->
<!-- doxrox-include igraph_atlas -->
</section>
<section id="other-generators"><title>Other well-known graphs from graph theory</title>
<!-- doxrox-include igraph_de_bruijn -->
<!-- doxrox-include igraph_kautz -->
<!-- doxrox-include igraph_generalized_petersen -->
<!-- doxrox-include igraph_mycielski_graph -->
</section>
</chapter>
+32
View File
@@ -0,0 +1,32 @@
<!--
The glossary is generated from these Markdown sources using
pandoc glossary.md --to docbook > glossary.xml
and manually updated to fit into the documentation system.
-->
# Glossary
This glossary defines common terms used throughout the igraph documentation.
- **attribute**: A piece of data associated with a vertex, an edge, or the graph itself. The igraph C library currently supports numeric, string and Boolean attribute values, and provides a means for implementing attribute handlers that support custom types.
- **adjacent**: Two vertices are called **adjacent** if there is an edge connecting them. This term describes a vertex-to-vertex relation.
- **adjacency list**: A data structure that associates a list of neighbours (i.e. adjacent vertices) to each vertex.
- **adjacency matrix**: A representation of a graph as a square matrix. `A_ij` gives the number of edge endpoints connecting from the `i`th vertex to the `j`th vertex. Conventionally, the diagonal of the adjacency matrix of an undirected graph contains _twice_ the number of self-loops. All igraph functions follow this convention unless noted otherwise.
- **biadjacency matrix**: Analogous to the adjacency matrix, but used for bipartite graphs. Element `B_ij` gives the number of edges from the `i`th vertex of the first group to the `j`th vertex of the second group.
- **bipartite graph**: A graph whose vertices can be partitioned into two groups in such a way that connections are present only between members of different groups.
- **complete graph**: Also called **full graph** within the context of igraph, a graph in which all pairs of vertices are connected to each other.
- **connected graph**: A connected graph consists of a single component, in which any vertex is reachable from any other. In igraph, the null graph is not considered connected, as it has not one, but zero components.
- **edge**: A **connection** between two vertices, also called a **link**. In igraph, edges are referred to by integer indices called **edge IDs**.
- **finalizer stack**: A global stack used internally by igraph to keep track of currently allocated objects and their destructors, so that they can be automatically destroyed in case of an error.
- **game**: Within igraph, this term is used for stochastic graph generators, i.e. functions that sample from random graph models.
- **graph** or **network**: A set of vertices with connections between them. In igraph, graphs may carry associated data in the form of vertex, edge or graph attributes.
- **incident**: An edge is called **incident** to the vertices that are its endpoints. This term describes a vertex-to-edge relation.
- **incidence list**: A data structure that associates a list of incident edges to each vertex.
- **incidence matrix**: A matrix describing the incidence relation between vertices (rows) and edges (columns).
- **membership vector**: Membership vectors are a means of encoding a partitioning of items, usually vertices, into several groups. The `i`th element of the vector gives an integer identifier of the group the `i`th vertex belongs to. Membership vectors are typically used to describe a vertex clustering obtained through community detection, or by identifying the connected components of a graph.
- **multi-edges** or **parallel edges**: More than one edge connecting the same two vertices. In a directed graph, `a -> b, a -> b` are considered parallel edges, but `a -> b, a <- b` are not.
- **null graph**: A graph with no vertices (and no edges).
- **self-loop**, **self-edge**, or simply **loop**: An edge that connects a vertex to itself.
- **simple graph**: A graph that does not have self-loops or multi-edges.
- **singleton graph**: A graph having a single vertex. This term usually refers to a single vertex with no edges, but note that self-loops may in principle be present.
- **vertex**: Graphs consist of vertices, also called **nodes**, that are connected to each other. In igraph, vertices are referred to by integer indices called **vertex IDs**.
+197
View File
@@ -0,0 +1,197 @@
<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
]>
<!-- Do not edit this file directly. Edit glossary.md and re-generate this file using pandoc. -->
<chapter id="igraph-Glossary">
<title>Glossary</title>
<para>
This glossary defines common terms used throughout the igraph
documentation.
</para>
<itemizedlist spacing="compact">
<listitem>
<para>
<emphasis role="strong">attribute</emphasis>: A piece of data
associated with a vertex, an edge, or the graph itself. The
igraph C library currently supports numeric, string and Boolean
attribute values, and provides a means for implementing
attribute handlers that support custom types.
</para>
</listitem>
<listitem>
<para>
<emphasis role="strong">adjacent</emphasis>: Two vertices are
called <emphasis role="strong">adjacent</emphasis> if there is
an edge connecting them. This term describes a vertex-to-vertex
relation.
</para>
</listitem>
<listitem>
<para>
<emphasis role="strong">adjacency list</emphasis>: A data
structure that associates a list of neighbours (i.e. adjacent
vertices) to each vertex.
</para>
</listitem>
<listitem>
<para>
<emphasis role="strong">adjacency matrix</emphasis>: A
representation of a graph as a square matrix.
<literal>A_ij</literal> gives the number of edge endpoints
connecting from the <literal>i</literal>th vertex to the
<literal>j</literal>th vertex. Conventionally, the diagonal of
the adjacency matrix of an undirected graph contains
<emphasis>twice</emphasis> the number of self-loops. All igraph
functions follow this convention unless noted otherwise.
</para>
</listitem>
<listitem>
<para>
<emphasis role="strong">biadjacency matrix</emphasis>: Analogous
to the adjacency matrix, but used for bipartite graphs. Element
<literal>B_ij</literal> gives the number of edges from the
<literal>i</literal>th vertex of the first group to the
<literal>j</literal>th vertex of the second group.
</para>
</listitem>
<listitem>
<para>
<emphasis role="strong">bipartite graph</emphasis>: A graph
whose vertices can be partitioned into two groups in such a way
that connections are present only between members of different
groups.
</para>
</listitem>
<listitem>
<para>
<emphasis role="strong">complete graph</emphasis>: Also called
<emphasis role="strong">full graph</emphasis> within the context
of igraph, a graph in which all pairs of vertices are connected
to each other.
</para>
</listitem>
<listitem>
<para>
<emphasis role="strong">connected graph</emphasis>: A connected
graph consists of a single component, in which any vertex is
reachable from any other. In igraph, the null graph is not
considered connected, as it has not one, but zero components.
</para>
</listitem>
<listitem>
<para>
<emphasis role="strong">edge</emphasis>: A
<emphasis role="strong">connection</emphasis> between two
vertices, also called a <emphasis role="strong">link</emphasis>.
In igraph, edges are referred to by integer indices called
<emphasis role="strong">edge IDs</emphasis>.
</para>
</listitem>
<listitem>
<para>
<emphasis role="strong">finalizer stack</emphasis>: A global
stack used internally by igraph to keep track of currently
allocated objects and their destructors, so that they can be
automatically destroyed in case of an error.
</para>
</listitem>
<listitem>
<para>
<emphasis role="strong">game</emphasis>: Within igraph, this
term is used for stochastic graph generators, i.e. functions
that sample from random graph models.
</para>
</listitem>
<listitem>
<para>
<emphasis role="strong">graph</emphasis> or
<emphasis role="strong">network</emphasis>: A set of vertices
with connections between them. In igraph, graphs may carry
associated data in the form of vertex, edge or graph attributes.
</para>
</listitem>
<listitem>
<para>
<emphasis role="strong">incident</emphasis>: An edge is called
<emphasis role="strong">incident</emphasis> to the vertices that
are its endpoints. This term describes a vertex-to-edge
relation.
</para>
</listitem>
<listitem>
<para>
<emphasis role="strong">incidence list</emphasis>: A data
structure that associates a list of incident edges to each
vertex.
</para>
</listitem>
<listitem>
<para>
<emphasis role="strong">incidence matrix</emphasis>: A matrix
describing the incidence relation between vertices (rows) and
edges (columns).
</para>
</listitem>
<listitem>
<para>
<emphasis role="strong">membership vector</emphasis>: Membership
vectors are a means of encoding a partitioning of items, usually
vertices, into several groups. The <literal>i</literal>th
element of the vector gives an integer identifier of the group
the <literal>i</literal>th vertex belongs to. Membership vectors
are typically used to describe a vertex clustering obtained
through community detection, or by identifying the connected
components of a graph.
</para>
</listitem>
<listitem>
<para>
<emphasis role="strong">multi-edges</emphasis> or
<emphasis role="strong">parallel edges</emphasis>: More than one
edge connecting the same two vertices. In a directed graph,
<literal>a -&gt; b, a -&gt; b</literal> are considered parallel
edges, but <literal>a -&gt; b, a &lt;- b</literal> are not.
</para>
</listitem>
<listitem>
<para>
<emphasis role="strong">null graph</emphasis>: A graph with no
vertices (and no edges).
</para>
</listitem>
<listitem>
<para>
<emphasis role="strong">self-loop</emphasis>,
<emphasis role="strong">self-edge</emphasis>, or simply
<emphasis role="strong">loop</emphasis>: An edge that connects a
vertex to itself.
</para>
</listitem>
<listitem>
<para>
<emphasis role="strong">simple graph</emphasis>: A graph that
does not have self-loops or multi-edges.
</para>
</listitem>
<listitem>
<para>
<emphasis role="strong">singleton graph</emphasis>: A graph
having a single vertex. This term usually refers to a single
vertex with no edges, but note that self-loops may in principle
be present.
</para>
</listitem>
<listitem>
<para>
<emphasis role="strong">vertex</emphasis>: Graphs consist of
vertices, also called <emphasis role="strong">nodes</emphasis>,
that are connected to each other. In igraph, vertices are
referred to by integer indices called
<emphasis role="strong">vertex IDs</emphasis>.
</para>
</listitem>
</itemizedlist>
</chapter>
+444
View File
@@ -0,0 +1,444 @@
<?xml version="1.0"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
<section id="igraph-gpl">
<sectioninfo>
<edition>Version 2, June 1991</edition>
<copyright><year>1989</year><year>1991</year>
<holder> Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
</holder>
</copyright>
<legalnotice><para>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
</para></legalnotice>
</sectioninfo>
<title>THE GNU GENERAL PUBLIC LICENSE</title>
<section><title>Preamble</title>
<para>
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
</para>
<para>
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
</para>
<para>
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
</para>
<para>
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
</para>
<para>
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
</para>
<para>
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
</para>
<para>
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
</para>
<para>
The precise terms and conditions for copying, distribution and
modification follow.
</para>
</section>
<section id="sectiongpl"><title>GNU GENERAL PUBLIC LICENSE</title>
<subtitle>TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</subtitle>
<para>
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
</para>
<para>
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
</para>
<para>
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
</para>
<para>
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
</para>
<para>
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
</para>
<orderedlist numeration="loweralpha"><listitem><para>
You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
</para></listitem><listitem><para>
You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
</para></listitem><listitem><para>
If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
</para></listitem></orderedlist>
<para>
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
</para>
<para>
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
</para>
<para>
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
</para>
<para>
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
</para>
<orderedlist numeration="loweralpha"><listitem><para>
Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
</para></listitem><listitem><para>
Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
</para></listitem><listitem><para>
Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
</para></listitem></orderedlist>
<para>
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
</para>
<para>
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
</para>
<para>
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
</para>
<para>
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
</para>
<para>
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
</para>
<para>
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
</para>
<para>
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
</para>
<para>
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
</para>
<para>
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
</para>
<para>
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
</para>
<para>
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
</para>
<para>
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
</para>
<para>
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
</para>
<para>
NO WARRANTY
</para>
<para>
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
</para>
<para>
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
</para>
<para>
END OF TERMS AND CONDITIONS
</para>
</section>
<section><title>How to Apply These Terms to Your New Programs</title>
<para>
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
</para>
<para>
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
</para>
<para><literallayout>
&lt;one line to give the program's name and a brief idea of what it does.>
Copyright (C) &lt;year> &lt;name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
</literallayout></para>
<para>
Also add information on how to contact you by electronic and paper mail.
</para>
<para>
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
</para>
<para><literallayout>
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
</literallayout></para>
<para>
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
</para>
<para>
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
</para>
<para><literallayout>
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
&lt;signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
</literallayout></para>
<para>
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
</para>
</section>
</section>
@@ -0,0 +1,20 @@
<?xml version="1.0"?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY igraph "igraph">
]>
<chapter id="igraph-Graphlets">
<title>Graphlets</title>
<section id="about-graphlets">
<!-- doxrox-include graphlets_intro -->
</section>
<section id="performing-graphlet-decomposition"><title>Performing graphlet decomposition</title>
<!-- doxrox-include igraph_graphlets -->
<!-- doxrox-include igraph_graphlets_candidate_basis -->
<!-- doxrox-include igraph_graphlets_project -->
</section>
</chapter>
+342
View File
@@ -0,0 +1,342 @@
<?xml version='1.0'?> <!--*- mode: xml -*-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<!-- import the chunked XSL stylesheet -->
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl"/>
<xsl:include href="version-greater-or-equal.xsl"/>
<!-- change some parameters -->
<xsl:param name="bibliography.collection">bibdatabase.xml</xsl:param>
<xsl:param name="bibliography.numbered">1</xsl:param>
<xsl:param name="toc.section.depth">0</xsl:param>
<xsl:param name="generate.section.toc.level">2</xsl:param>
<xsl:param name="generate.toc">
book toc
chapter toc
section toc
</xsl:param>
<xsl:param name="default.encoding" select="'US-ASCII'"/>
<xsl:param name="chunker.output.encoding" select="'US-ASCII'"/>
<xsl:param name="chunker.output.indent" select="'yes'"/>
<xsl:param name="chunk.fast" select="1"/>
<xsl:param name="chunk.section.depth" select="0"/>
<xsl:param name="chunk.first.sections" select="0"/>
<xsl:param name="chapter.autolabel" select="1"/>
<xsl:param name="section.autolabel" select="1"/>
<xsl:param name="use.id.as.filename" select="1"/>
<xsl:param name="html.ext" select="'.html'"/>
<xsl:param name="refentry.generate.name" select="0"/>
<xsl:param name="refentry.generate.title" select="1"/>
<!-- use index filtering (if available) -->
<xsl:param name="index.on.role" select="1"/>
<!-- display variablelists as tables -->
<xsl:param name="variablelist.as.table" select="1"/>
<!-- this gets set on the command line ... -->
<xsl:param name="gtkdoc.version" select="''"/>
<xsl:param name="gtkdoc.bookname" select="''"/>
<!-- generate consistent IDs so permalinks and bookmarks stay useful when a
new igraph version is released -->
<xsl:param name="generate.consistent.ids" select="1"/>
<!-- ========================================================= -->
<!-- template to create the index.sgml anchor index -->
<xsl:template match="book|article">
<xsl:variable name="tooldver">
<xsl:call-template name="version-greater-or-equal">
<xsl:with-param name="ver1" select="$VERSION" />
<xsl:with-param name="ver2">1.36</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:if test="$tooldver = 0">
<xsl:message terminate="yes">
FATAL-ERROR: You need the DocBook XSL Stylesheets version 1.36 or higher
to build the documentation.
Get a newer version at http://docbook.sourceforge.net/projects/xsl/
</xsl:message>
</xsl:if>
<xsl:apply-imports/>
</xsl:template>
<!-- ========================================================= -->
<!-- template to output gtkdoclink elements for the unknown targets -->
<xsl:template match="link">
<xsl:choose>
<xsl:when test="id(@linkend)">
<xsl:apply-imports/>
</xsl:when>
<xsl:otherwise>
<GTKDOCLINK HREF="{@linkend}">
<xsl:apply-templates/>
</GTKDOCLINK>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ========================================================= -->
<!-- Below are the visual portions of the stylesheet. They provide
the normal gtk-doc output style. -->
<xsl:param name="shade.verbatim" select="0"/>
<xsl:param name="refentry.separator" select="0"/>
<xsl:template match="refsection">
<xsl:if test="preceding-sibling::refsection">
<hr/>
</xsl:if>
<xsl:apply-imports/>
</xsl:template>
<xsl:template name="user.head.content">
<script type="text/javascript" src="toggle.js"></script>
<xsl:if test="$gtkdoc.version">
<meta name="generator"
content="GTK-Doc V{$gtkdoc.version} (XML mode)"/>
</xsl:if>
<link rel="stylesheet" href="style.css" type="text/css"/>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css"/>
<!-- copied from the html.head template in the docbook stylesheets
we don't want links for all refentrys, thats just too much
-->
<xsl:variable name="this" select="."/>
<xsl:for-each select="//part
|//reference
|//preface
|//chapter
|//article
|//appendix[not(parent::article)]|appendix
|//glossary[not(parent::article)]|glossary
|//index[not(parent::article)]|index">
<link rel="{local-name(.)}">
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="context" select="$this"/>
<xsl:with-param name="object" select="."/>
</xsl:call-template>
</xsl:attribute>
<xsl:attribute name="title">
<xsl:apply-templates select="." mode="object.title.markup.textonly"/>
</xsl:attribute>
</link>
</xsl:for-each>
</xsl:template>
<xsl:template match="title" mode="book.titlepage.recto.mode">
</xsl:template>
<xsl:template name="header.navigation">
<xsl:param name="prev" select="/foo"/>
<xsl:param name="next" select="/foo"/>
<xsl:variable name="home" select="/*[1]"/>
<xsl:variable name="up" select="parent::*"/>
<xsl:if test="$suppress.navigation = '0' and $home != .">
<div class="navigation-header mb-4" width="100%"
summary = "Navigation header">
<div class="btn-group">
<xsl:if test="count($prev) > 0">
<a accesskey="p" class="btn btn-light">
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$prev"/>
</xsl:call-template>
</xsl:attribute>
<i class="fa fa-chevron-left"></i>
Previous
</a>
</xsl:if>
<xsl:if test="count($up) > 0 and $up != $home">
<a accesskey="u" class="btn btn-light">
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$up"/>
</xsl:call-template>
</xsl:attribute>
<i class="fa fa-chevron-up"></i>
Up
</a>
</xsl:if>
<xsl:if test="$home != .">
<a accesskey="h" class="btn btn-light">
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$home"/>
</xsl:call-template>
</xsl:attribute>
<i class="fa fa-home"></i>
Home
</a>
</xsl:if>
<xsl:if test="count($next) > 0">
<a accesskey="n" class="btn btn-light">
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$next"/>
</xsl:call-template>
</xsl:attribute>
<i class="fa fa-chevron-right"></i>
Next
</a>
</xsl:if>
</div>
</div>
</xsl:if>
</xsl:template>
<xsl:template name="footer.navigation">
<xsl:param name="prev" select="/foo"/>
<xsl:param name="next" select="/foo"/>
<xsl:if test="$suppress.navigation = '0'">
<table class="navigation-footer" width="100%"
summary="Navigation footer" cellpadding="2" cellspacing="0">
<tr valign="middle">
<td align="left">
<xsl:if test="count($prev) > 0">
<a accesskey="p">
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$prev"/>
</xsl:call-template>
</xsl:attribute>
<b>
<xsl:text>&#8592;&#160;</xsl:text>
<xsl:apply-templates select="$prev"
mode="object.title.markup"/>
</b>
</a>
</xsl:if>
</td>
<td align="right">
<xsl:if test="count($next) > 0">
<a accesskey="n">
<xsl:attribute name="href">
<xsl:call-template name="href.target">
<xsl:with-param name="object" select="$next"/>
</xsl:call-template>
</xsl:attribute>
<b>
<xsl:apply-templates select="$next"
mode="object.title.markup"/>
<xsl:text>&#160;&#8594;</xsl:text>
</b>
</a>
</xsl:if>
</td>
</tr>
</table>
</xsl:if>
</xsl:template>
<xsl:template name="user.footer.content">
</xsl:template>
<!-- avoid creating multiple identical indices
if the stylesheets don't support filtered indices
-->
<xsl:template match="index">
<xsl:variable name="has-filtered-index">
<xsl:call-template name="version-greater-or-equal">
<xsl:with-param name="ver1" select="$VERSION" />
<xsl:with-param name="ver2">1.66</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:if test="($has-filtered-index = 1) or (count(@role) = 0)">
<xsl:apply-imports/>
</xsl:if>
</xsl:template>
<xsl:template match="index" mode="toc">
<xsl:variable name="has-filtered-index">
<xsl:call-template name="version-greater-or-equal">
<xsl:with-param name="ver1" select="$VERSION" />
<xsl:with-param name="ver2">1.66</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:if test="($has-filtered-index = 1) or (count(@role) = 0)">
<xsl:apply-imports/>
</xsl:if>
</xsl:template>
<xsl:template match="para">
<xsl:choose>
<xsl:when test="@role = 'gallery'">
<div class="container">
<div class="gallery-spacer"> </div>
<xsl:apply-templates mode="gallery.mode"/>
<div class="gallery-spacer"> </div>
</div>
</xsl:when>
<xsl:otherwise>
<xsl:apply-imports/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="link" mode="gallery.mode">
<div class="gallery-float">
<xsl:apply-templates select="."/>
</div>
</xsl:template>
<!-- add gallery handling to refnamediv template -->
<xsl:template match="refnamediv">
<div class="{name(.)}">
<table width="100%">
<tr><td valign="top">
<xsl:call-template name="anchor"/>
<xsl:choose>
<xsl:when test="$refentry.generate.name != 0">
<h2>
<xsl:call-template name="gentext">
<xsl:with-param name="key" select="'RefName'"/>
</xsl:call-template>
</h2>
</xsl:when>
<xsl:when test="$refentry.generate.title != 0">
<h2>
<xsl:choose>
<xsl:when test="../refmeta/refentrytitle">
<xsl:apply-templates select="../refmeta/refentrytitle"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="refname[1]"/>
</xsl:otherwise>
</xsl:choose>
</h2>
</xsl:when>
</xsl:choose>
<p>
<xsl:apply-templates/>
</p>
</td>
<td valign="top" align="right">
<!-- find the gallery image to use here
- determine the id of the enclosing refentry
- look for an inlinegraphic inside a link with linkend == refentryid inside a para with role == gallery
- use it here
-->
<xsl:variable name="refentryid" select="../@id"/>
<xsl:apply-templates select="//para[@role = 'gallery']/link[@linkend = $refentryid]/inlinegraphic"/>
</td></tr>
</table>
</div>
</xsl:template>
<xsl:template match="example">
<xsl:variable name="id" select="@id"/>
<div class="hideshow" onClick="toggle(this, event)">
<xsl:apply-imports />
</div>
</xsl:template>
</xsl:stylesheet>
+21
View File
@@ -0,0 +1,21 @@
<?xml version="1.0"?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY igraph "igraph">
]>
<section id="igraph-Heaps">
<title>Maximum and minimum heaps</title>
<!-- doxrox-include igraph_heap_init -->
<!-- doxrox-include igraph_heap_init_array -->
<!-- doxrox-include igraph_heap_destroy -->
<!-- doxrox-include igraph_heap_clear -->
<!-- doxrox-include igraph_heap_empty -->
<!-- doxrox-include igraph_heap_push -->
<!-- doxrox-include igraph_heap_top -->
<!-- doxrox-include igraph_heap_delete_top -->
<!-- doxrox-include igraph_heap_size -->
<!-- doxrox-include igraph_heap_reserve -->
</section>
+45
View File
@@ -0,0 +1,45 @@
<?xml version="1.0"?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY igraph "igraph">
]>
<chapter id="igraph-HRG">
<title>Hierarchical random graphs</title>
<section id="hrg-intro">
<!-- doxrox-include hrg_intro -->
</section>
<section id="representing-hrgs"><title>Representing HRGs</title>
<!-- doxrox-include igraph_hrg_t -->
<!-- doxrox-include igraph_hrg_init -->
<!-- doxrox-include igraph_hrg_destroy -->
<!-- doxrox-include igraph_hrg_size -->
<!-- doxrox-include igraph_hrg_resize -->
</section>
<section id="fitting-hrgs"><title>Fitting HRGs</title>
<!-- doxrox-include igraph_hrg_fit -->
<!-- doxrox-include igraph_hrg_consensus -->
</section>
<section id="hrg-sampling"><title>HRG sampling</title>
<!-- doxrox-include igraph_hrg_sample -->
<!-- doxrox-include igraph_hrg_game -->
</section>
<section id="conversion-to-and-from-igraph-graphs"><title>Conversion to and from igraph graphs</title>
<!-- doxrox-include igraph_from_hrg_dendrogram -->
<!-- doxrox-include igraph_hrg_create -->
</section>
<section id="predicting-missing-edges"><title>Predicting missing edges</title>
<!-- doxrox-include igraph_hrg_predict -->
</section>
<section id="hrg-deprecated"><title>Deprecated functions</title>
<!-- doxrox-include igraph_hrg_dendrogram -->
</section>
</chapter>
Binary file not shown.

After

Width:  |  Height:  |  Size: 654 B

File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,627 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Chapter 22. Graph coloring</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="igraph Reference Manual">
<link rel="up" href="index.html" title="igraph Reference Manual">
<link rel="prev" href="igraph-Isomorphism.html" title="Chapter 21. Graph isomorphism">
<link rel="next" href="igraph-Flows.html" title="Chapter 23. Maximum flows, minimum cuts and related measures">
<script type="text/javascript" src="toggle.js"></script><link rel="stylesheet" href="style.css" type="text/css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css">
<link rel="chapter" href="igraph-Introduction.html" title="Chapter 1. Introduction">
<link rel="chapter" href="igraph-Installation.html" title="Chapter 2. Installation">
<link rel="chapter" href="igraph-Tutorial.html" title="Chapter 3. Tutorial">
<link rel="chapter" href="igraph-Basic.html" title="Chapter 4. Basic data types and interface">
<link rel="chapter" href="igraph-Error.html" title="Chapter 5. Error handling">
<link rel="chapter" href="igraph-Memory.html" title="Chapter 6. Memory (de)allocation">
<link rel="chapter" href="igraph-Data-structures.html" title="Chapter 7. Data structure library: vector, matrix, other data types">
<link rel="chapter" href="igraph-Random.html" title="Chapter 8. Random numbers">
<link rel="chapter" href="igraph-Iterators.html" title="Chapter 9. Vertex and edge selectors and sequences, iterators">
<link rel="chapter" href="igraph-Attributes.html" title="Chapter 10. Graph, vertex and edge attributes">
<link rel="chapter" href="igraph-Generators.html" title="Chapter 11. Deterministic graph generators">
<link rel="chapter" href="igraph-Games.html" title='Chapter 12. Stochastic graph generators ("games")'>
<link rel="chapter" href="igraph-Bipartite.html" title="Chapter 13. Bipartite, i.e. two-mode graphs">
<link rel="chapter" href="igraph-Spatial.html" title="Chapter 14. Spatial graphs">
<link rel="chapter" href="igraph-Operators.html" title="Chapter 15. Graph operators">
<link rel="chapter" href="igraph-Visitors.html" title="Chapter 16. Graph visitors">
<link rel="chapter" href="igraph-Structural.html" title="Chapter 17. Structural properties of graphs">
<link rel="chapter" href="igraph-Cycles.html" title="Chapter 18. Graph cycles">
<link rel="chapter" href="igraph-Cliques.html" title="Chapter 19. Cliques and independent vertex sets">
<link rel="chapter" href="igraph-Motifs.html" title="Chapter 20. Graph motifs, dyad census and triad census">
<link rel="chapter" href="igraph-Isomorphism.html" title="Chapter 21. Graph isomorphism">
<link rel="chapter" href="igraph-Coloring.html" title="Chapter 22. Graph coloring">
<link rel="chapter" href="igraph-Flows.html" title="Chapter 23. Maximum flows, minimum cuts and related measures">
<link rel="chapter" href="igraph-Separators.html" title="Chapter 24. Vertex separators">
<link rel="chapter" href="igraph-Community.html" title="Chapter 25. Detecting community structure">
<link rel="chapter" href="igraph-Graphlets.html" title="Chapter 26. Graphlets">
<link rel="chapter" href="igraph-HRG.html" title="Chapter 27. Hierarchical random graphs">
<link rel="chapter" href="igraph-Embedding.html" title="Chapter 28. Embedding of graphs">
<link rel="chapter" href="igraph-Layout.html" title="Chapter 29. Generating layouts for graph drawing">
<link rel="chapter" href="igraph-Processes.html" title="Chapter 30. Processes on graphs">
<link rel="chapter" href="igraph-Foreign.html" title="Chapter 31. Reading and writing graphs from and to files">
<link rel="chapter" href="igraph-Linalg.html" title="Chapter 32. Using BLAS, LAPACK and ARPACK for igraph matrices and graphs">
<link rel="chapter" href="igraph-Nongraph.html" title="Chapter 33. Non-graph related functions">
<link rel="chapter" href="igraph-Advanced.html" title="Chapter 34. Advanced igraph programming">
<link rel="chapter" href="igraph-Glossary.html" title="Chapter 35. Glossary">
<link rel="chapter" href="igraph-Licenses.html" title="Chapter 36. Licenses for igraph and this manual">
<link rel="index" href="ix01.html" title="Index">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navigation-header mb-4" width="100%" summary="Navigation header"><div class="btn-group">
<a accesskey="p" class="btn btn-light" href="igraph-Isomorphism.html"><i class="fa fa-chevron-left"></i>
Previous
</a><a accesskey="h" class="btn btn-light" href="index.html"><i class="fa fa-home"></i>
Home
</a><a accesskey="n" class="btn btn-light" href="igraph-Flows.html"><i class="fa fa-chevron-right"></i>
Next
</a>
</div></div>
<div class="chapter">
<div class="titlepage"><div><div><h1 class="title">
<a name="igraph-Coloring"></a>Chapter 22. Graph coloring</h1></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="igraph-Coloring.html#igraph_vertex_coloring_greedy">1. <code class="function">igraph_vertex_coloring_greedy</code> — Computes a vertex coloring using a greedy algorithm.</a></span></dt>
<dt><span class="section"><a href="igraph-Coloring.html#igraph_coloring_greedy_t">2. <code class="function">igraph_coloring_greedy_t</code> — Ordering heuristics for greedy graph coloring.</a></span></dt>
<dt><span class="section"><a href="igraph-Coloring.html#igraph_is_vertex_coloring">3. <code class="function">igraph_is_vertex_coloring</code> — Checks whether a vertex coloring is valid.</a></span></dt>
<dt><span class="section"><a href="igraph-Coloring.html#igraph_is_bipartite_coloring">4. <code class="function">igraph_is_bipartite_coloring</code> — Checks whether a bipartite vertex coloring is valid.</a></span></dt>
<dt><span class="section"><a href="igraph-Coloring.html#igraph_is_edge_coloring">5. <code class="function">igraph_is_edge_coloring</code> — Checks whether an edge coloring is valid.</a></span></dt>
<dt><span class="section"><a href="igraph-Coloring.html#igraph_is_perfect">6. <code class="function">igraph_is_perfect</code> — Checks if the graph is perfect.</a></span></dt>
</dl></div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="igraph_vertex_coloring_greedy"></a>1. <code class="function">igraph_vertex_coloring_greedy</code> — Computes a vertex coloring using a greedy algorithm.</h2></div></div></div>
<a class="indexterm" name="id-1.23.2.2"></a><p>
</p>
<div class="informalexample"><pre class="programlisting">
igraph_error_t igraph_vertex_coloring_greedy(const igraph_t *graph, igraph_vector_int_t *colors, igraph_coloring_greedy_t heuristic);
</pre></div>
<p>
</p>
<p>
This function assigns a "color"—represented as a non-negative integer—to
each vertex of the graph in such a way that neighboring vertices never have
the same color. The obtained coloring is not necessarily minimal.
</p>
<p>
Vertices are colored greedily, one by one, always choosing the smallest color
index that differs from that of already colored neighbors. Vertices are picked
in an order determined by the speified heuristic.
Colors are represented by non-negative integers 0, 1, 2, ...
</p>
<p><b>Arguments: </b>
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>graph</code></em>:</span></p></td>
<td><p>
The input graph.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>colors</code></em>:</span></p></td>
<td><p>
Pointer to an initialized integer vector. The vertex colors will be stored here.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>heuristic</code></em>:</span></p></td>
<td><p>
The vertex ordering heuristic to use during greedy coloring.
See <a class="link" href="igraph-Coloring.html#igraph_coloring_greedy_t" title="2. igraph_coloring_greedy_t — Ordering heuristics for greedy graph coloring."><code class="function">igraph_coloring_greedy_t</code></a> for more information.</p></td>
</tr>
</tbody>
</table></div>
<p>
</p>
<p><b>Returns: </b></p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code></code></em></span></p></td>
<td><p>
Error code.
</p></td>
</tr></tbody>
</table></div>
<p>
</p>
<p><b>See also: </b></p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code></code></em></span></p></td>
<td><p>
igraph_is_vertex_coloring() to check if a coloring is valid, i.e. if all
edges connect vertices of different colors.
</p></td>
</tr></tbody>
</table></div>
<p>
</p>
<div class="hideshow" onClick="toggle(this, event)">
<div class="example">
<a name="id-1.23.2.11.1"></a><p class="title"><b>Example 22.1.  File <code class="code">examples/simple/coloring.c</code></b></p>
<div class="example-contents">
<pre class="programlisting"><span class="strong"><strong>#include</strong></span> &lt;igraph.h&gt;
int <span class="strong"><strong>main</strong></span>(void) {
igraph_t graph;
igraph_vector_int_t colors;
igraph_bool_t valid_coloring;
<span class="emphasis"><em>/* Initialize the library. */</em></span>
<span class="strong"><strong><a class="link" href="igraph-Basic.html#igraph_setup" title="4.1. igraph_setup — Initializes the igraph library.">igraph_setup</a></strong></span>();
<span class="emphasis"><em>/* Setting a seed makes the result of erdos_renyi_game_gnm deterministic. */</em></span>
<span class="strong"><strong><a class="link" href="igraph-Random.html#igraph_rng_seed" title="3.3. igraph_rng_seed — Seeds a random number generator.">igraph_rng_seed</a></strong></span>(<span class="strong"><strong><a class="link" href="igraph-Random.html#igraph_rng_default" title="2.1. igraph_rng_default — Query the default random number generator.">igraph_rng_default</a></strong></span>(), 42);
<span class="emphasis"><em>/* IGRAPH_UNDIRECTED and IGRAPH_NO_LOOPS are both equivalent to 0/FALSE, but</em></span>
<span class="emphasis"><em> communicate intent better in this context. */</em></span>
<span class="strong"><strong><a class="link" href="igraph-Games.html#igraph_erdos_renyi_game_gnm" title="1.1. igraph_erdos_renyi_game_gnm — Generates a random (Erdős-Rényi) graph with a fixed number of edges.">igraph_erdos_renyi_game_gnm</a></strong></span>(&amp;graph, 1000, 10000, IGRAPH_UNDIRECTED, IGRAPH_SIMPLE_SW, IGRAPH_EDGE_UNLABELED);
<span class="emphasis"><em>/* As with all igraph functions, the vector in which the result is returned must</em></span>
<span class="emphasis"><em> be initialized in advance. */</em></span>
<span class="strong"><strong>igraph_vector_int_init</strong></span>(&amp;colors, 0);
<span class="strong"><strong><a class="link" href="igraph-Coloring.html#igraph_vertex_coloring_greedy" title="1. igraph_vertex_coloring_greedy — Computes a vertex coloring using a greedy algorithm.">igraph_vertex_coloring_greedy</a></strong></span>(&amp;graph, &amp;colors, IGRAPH_COLORING_GREEDY_COLORED_NEIGHBORS);
<span class="emphasis"><em>/* Verify that the colouring is valid, i.e. no two adjacent vertices have the same colour. */</em></span>
<span class="strong"><strong><a class="link" href="igraph-Coloring.html#igraph_is_vertex_coloring" title="3. igraph_is_vertex_coloring — Checks whether a vertex coloring is valid.">igraph_is_vertex_coloring</a></strong></span>(&amp;graph, &amp;colors, &amp;valid_coloring);
<span class="strong"><strong><a class="link" href="igraph-Error.html#IGRAPH_ASSERT" title="5.5.6. IGRAPH_ASSERT — igraph-specific replacement for assert().">IGRAPH_ASSERT</a></strong></span>(valid_coloring);
<span class="emphasis"><em>/* Destroy data structure when we are done. */</em></span>
<span class="strong"><strong>igraph_vector_int_destroy</strong></span>(&amp;colors);
<span class="strong"><strong><a class="link" href="igraph-Basic.html#igraph_destroy" title="5.1.4. igraph_destroy — Frees the memory allocated for a graph object.">igraph_destroy</a></strong></span>(&amp;graph);
<span class="strong"><strong>return</strong></span> 0;
}
</pre>
<p></p>
</div>
</div>
<br class="example-break">
</div>
<p>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="igraph_coloring_greedy_t"></a>2. <code class="function">igraph_coloring_greedy_t</code> — Ordering heuristics for greedy graph coloring.</h2></div></div></div>
<a class="indexterm" name="id-1.23.3.2"></a><p>
</p>
<pre class="programlisting">
typedef enum {
IGRAPH_COLORING_GREEDY_COLORED_NEIGHBORS = 0,
IGRAPH_COLORING_GREEDY_DSATUR = 1
} igraph_coloring_greedy_t;
</pre>
<p>
</p>
<p>
Ordering heuristics for <a class="link" href="igraph-Coloring.html#igraph_vertex_coloring_greedy" title="1. igraph_vertex_coloring_greedy — Computes a vertex coloring using a greedy algorithm."><code class="function">igraph_vertex_coloring_greedy()</code></a>.
</p>
<p><b>Values: </b>
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="constant">IGRAPH_COLORING_GREEDY_COLORED_NEIGHBORS</code>:</span></p></td>
<td><p>
Choose the vertex with largest number of already colored neighbors.
</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="constant">IGRAPH_COLORING_GREEDY_DSATUR</code>:</span></p></td>
<td><p>
Choose the vertex with largest number of unique colors in its neighborhood, i.e. its
"saturation degree". When multiple vertices have the same saturation degree, choose
the one with the most not yet colored neighbors. Added in igraph 0.10.4. This heuristic
is known as "DSatur", and was proposed in
Daniel Brélaz: New methods to color the vertices of a graph,
Commun. ACM 22, 4 (1979), 251256. <a class="ulink" href="https://doi.org/10.1145/359094.359101" target="_top">https://doi.org/10.1145/359094.359101</a></p></td>
</tr>
</tbody>
</table></div>
<p>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="igraph_is_vertex_coloring"></a>3. <code class="function">igraph_is_vertex_coloring</code> — Checks whether a vertex coloring is valid.</h2></div></div></div>
<a class="indexterm" name="id-1.23.4.2"></a><p>
</p>
<div class="informalexample"><pre class="programlisting">
igraph_error_t igraph_is_vertex_coloring(
const igraph_t *graph,
const igraph_vector_int_t *types,
igraph_bool_t *res);
</pre></div>
<p>
</p>
<p>
This function checks whether the given vertex type/color assignment is a valid
vertex coloring, i.e., no two adjacent vertices have the same color.
Self-loops are ignored.
</p>
<p><b>Arguments: </b>
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>graph</code></em>:</span></p></td>
<td><p>
The input graph.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>types</code></em>:</span></p></td>
<td><p>
The vertex types/colors as an integer vector.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>res</code></em>:</span></p></td>
<td><p>
Pointer to a boolean, the result is stored here.
</p></td>
</tr>
</tbody>
</table></div>
<p>
</p>
<p><b>Returns: </b></p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code></code></em></span></p></td>
<td><p>
Error code.
</p></td>
</tr></tbody>
</table></div>
<p>
Time complexity: O(|E|), linear in the number of edges.
</p>
<div class="hideshow" onClick="toggle(this, event)">
<div class="example">
<a name="id-1.23.4.8.1"></a><p class="title"><b>Example 22.2.  File <code class="code">examples/simple/coloring.c</code></b></p>
<div class="example-contents">
<pre class="programlisting"><span class="strong"><strong>#include</strong></span> &lt;igraph.h&gt;
int <span class="strong"><strong>main</strong></span>(void) {
igraph_t graph;
igraph_vector_int_t colors;
igraph_bool_t valid_coloring;
<span class="emphasis"><em>/* Initialize the library. */</em></span>
<span class="strong"><strong><a class="link" href="igraph-Basic.html#igraph_setup" title="4.1. igraph_setup — Initializes the igraph library.">igraph_setup</a></strong></span>();
<span class="emphasis"><em>/* Setting a seed makes the result of erdos_renyi_game_gnm deterministic. */</em></span>
<span class="strong"><strong><a class="link" href="igraph-Random.html#igraph_rng_seed" title="3.3. igraph_rng_seed — Seeds a random number generator.">igraph_rng_seed</a></strong></span>(<span class="strong"><strong><a class="link" href="igraph-Random.html#igraph_rng_default" title="2.1. igraph_rng_default — Query the default random number generator.">igraph_rng_default</a></strong></span>(), 42);
<span class="emphasis"><em>/* IGRAPH_UNDIRECTED and IGRAPH_NO_LOOPS are both equivalent to 0/FALSE, but</em></span>
<span class="emphasis"><em> communicate intent better in this context. */</em></span>
<span class="strong"><strong><a class="link" href="igraph-Games.html#igraph_erdos_renyi_game_gnm" title="1.1. igraph_erdos_renyi_game_gnm — Generates a random (Erdős-Rényi) graph with a fixed number of edges.">igraph_erdos_renyi_game_gnm</a></strong></span>(&amp;graph, 1000, 10000, IGRAPH_UNDIRECTED, IGRAPH_SIMPLE_SW, IGRAPH_EDGE_UNLABELED);
<span class="emphasis"><em>/* As with all igraph functions, the vector in which the result is returned must</em></span>
<span class="emphasis"><em> be initialized in advance. */</em></span>
<span class="strong"><strong>igraph_vector_int_init</strong></span>(&amp;colors, 0);
<span class="strong"><strong><a class="link" href="igraph-Coloring.html#igraph_vertex_coloring_greedy" title="1. igraph_vertex_coloring_greedy — Computes a vertex coloring using a greedy algorithm.">igraph_vertex_coloring_greedy</a></strong></span>(&amp;graph, &amp;colors, IGRAPH_COLORING_GREEDY_COLORED_NEIGHBORS);
<span class="emphasis"><em>/* Verify that the colouring is valid, i.e. no two adjacent vertices have the same colour. */</em></span>
<span class="strong"><strong><a class="link" href="igraph-Coloring.html#igraph_is_vertex_coloring" title="3. igraph_is_vertex_coloring — Checks whether a vertex coloring is valid.">igraph_is_vertex_coloring</a></strong></span>(&amp;graph, &amp;colors, &amp;valid_coloring);
<span class="strong"><strong><a class="link" href="igraph-Error.html#IGRAPH_ASSERT" title="5.5.6. IGRAPH_ASSERT — igraph-specific replacement for assert().">IGRAPH_ASSERT</a></strong></span>(valid_coloring);
<span class="emphasis"><em>/* Destroy data structure when we are done. */</em></span>
<span class="strong"><strong>igraph_vector_int_destroy</strong></span>(&amp;colors);
<span class="strong"><strong><a class="link" href="igraph-Basic.html#igraph_destroy" title="5.1.4. igraph_destroy — Frees the memory allocated for a graph object.">igraph_destroy</a></strong></span>(&amp;graph);
<span class="strong"><strong>return</strong></span> 0;
}
</pre>
<p></p>
</div>
</div>
<br class="example-break">
</div>
<p>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="igraph_is_bipartite_coloring"></a>4. <code class="function">igraph_is_bipartite_coloring</code> — Checks whether a bipartite vertex coloring is valid.</h2></div></div></div>
<a class="indexterm" name="id-1.23.5.2"></a><p>
</p>
<div class="informalexample"><pre class="programlisting">
igraph_error_t igraph_is_bipartite_coloring(
const igraph_t *graph,
const igraph_vector_bool_t *types,
igraph_bool_t *res,
igraph_neimode_t *mode);
</pre></div>
<p>
</p>
<p>
This function checks whether the given vertex type assignment is a valid
bipartite coloring, i.e., no two adjacent vertices have the same type.
Additionally, for directed graphs, it determines the mode of edge directions.
Self-loops are ignored.
</p>
<p><b>Arguments: </b>
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>graph</code></em>:</span></p></td>
<td><p>
The input graph.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>types</code></em>:</span></p></td>
<td><p>
The vertex types as a boolean vector.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>res</code></em>:</span></p></td>
<td><p>
Pointer to a boolean, the result is stored here.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>mode</code></em>:</span></p></td>
<td><p>
Pointer to store the edge direction mode. Can be <code class="constant">NULL</code> if not needed.
If all edges go from false to true vertices, <code class="constant">IGRAPH_OUT</code> is returned.
If all edges go from true to false vertices, <code class="constant">IGRAPH_IN</code> is returned.
If edges go in both directions or graph is undirected, <code class="constant">IGRAPH_ALL</code> is returned.
</p></td>
</tr>
</tbody>
</table></div>
<p>
</p>
<p><b>Returns: </b></p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code></code></em></span></p></td>
<td><p>
Error code.
</p></td>
</tr></tbody>
</table></div>
<p>
Time complexity: O(|E|), linear in the number of edges.
</p>
<p><b>See also: </b></p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code></code></em></span></p></td>
<td><p>
igraph_is_bipartite() to determine whether a graph is bipartite,
i.e. 2-colorable, and find such a coloring.
</p></td>
</tr></tbody>
</table></div>
<p>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="igraph_is_edge_coloring"></a>5. <code class="function">igraph_is_edge_coloring</code> — Checks whether an edge coloring is valid.</h2></div></div></div>
<a class="indexterm" name="id-1.23.6.2"></a><p>
</p>
<div class="informalexample"><pre class="programlisting">
igraph_error_t igraph_is_edge_coloring(
const igraph_t *graph,
const igraph_vector_int_t *types,
igraph_bool_t *res);
</pre></div>
<p>
</p>
<p>
This function checks whether the given edge color assignment is a valid
edge coloring, i.e., no two adjacent edges have the same color.
Note that this function does not consider self-edges (loops) as being
adjacent to themselves, so graphs with self-loops may still be considered
to have a valid edge coloring.
</p>
<p><b>Arguments: </b>
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>graph</code></em>:</span></p></td>
<td><p>
The input graph.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>types</code></em>:</span></p></td>
<td><p>
The edge colors as an integer vector.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>res</code></em>:</span></p></td>
<td><p>
Pointer to a boolean, the result is stored here.
</p></td>
</tr>
</tbody>
</table></div>
<p>
</p>
<p><b>Returns: </b></p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code></code></em></span></p></td>
<td><p>
Error code.
</p></td>
</tr></tbody>
</table></div>
<p>
Time complexity: O(|V|*d*log(d)), where d is the maximum degree.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="igraph_is_perfect"></a>6. <code class="function">igraph_is_perfect</code> — Checks if the graph is perfect.</h2></div></div></div>
<a class="indexterm" name="id-1.23.7.2"></a><p>
</p>
<div class="informalexample"><pre class="programlisting">
igraph_error_t igraph_is_perfect(const igraph_t *graph, igraph_bool_t *perfect);
</pre></div>
<p>
</p>
<p>
A perfect graph is an undirected graph in which the chromatic number of every induced
subgraph equals the order of the largest clique of that subgraph.
The chromatic number of a graph G is the smallest number of colors needed to
color the vertices of G so that no two adjacent vertices share the same color.
</p>
<p>
Warning: This function may create the complement of the graph internally,
which consumes a lot of memory. For moderately sized graphs, consider
decomposing them into biconnected components and running the check separately
on each component.
</p>
<p>
This implementation is based on the strong perfect graph theorem which was
conjectured by Claude Berge and proved by Maria Chudnovsky, Neil Robertson,
Paul Seymour, and Robin Thomas.
</p>
<p><b>Arguments: </b>
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>graph</code></em>:</span></p></td>
<td><p>
The input graph. It is expected to be undirected and simple.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>perfect</code></em>:</span></p></td>
<td><p>
Pointer to an integer, the result will be stored here.
</p></td>
</tr>
</tbody>
</table></div>
<p>
</p>
<p><b>Returns: </b></p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code></code></em></span></p></td>
<td><p>
Error code.
</p></td>
</tr></tbody>
</table></div>
<p>
Time complexity: worst case exponenital, often faster in practice.
</p>
</div>
</div>
<table class="navigation-footer" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle">
<td align="left"><a accesskey="p" href="igraph-Isomorphism.html"><b>← Chapter 21. Graph isomorphism</b></a></td>
<td align="right"><a accesskey="n" href="igraph-Flows.html"><b>Chapter 23. Maximum flows, minimum cuts and related measures →</b></a></td>
</tr></table>
</body>
</html>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,596 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Chapter 28. Embedding of graphs</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="igraph Reference Manual">
<link rel="up" href="index.html" title="igraph Reference Manual">
<link rel="prev" href="igraph-HRG.html" title="Chapter 27. Hierarchical random graphs">
<link rel="next" href="igraph-Layout.html" title="Chapter 29. Generating layouts for graph drawing">
<script type="text/javascript" src="toggle.js"></script><link rel="stylesheet" href="style.css" type="text/css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css">
<link rel="chapter" href="igraph-Introduction.html" title="Chapter 1. Introduction">
<link rel="chapter" href="igraph-Installation.html" title="Chapter 2. Installation">
<link rel="chapter" href="igraph-Tutorial.html" title="Chapter 3. Tutorial">
<link rel="chapter" href="igraph-Basic.html" title="Chapter 4. Basic data types and interface">
<link rel="chapter" href="igraph-Error.html" title="Chapter 5. Error handling">
<link rel="chapter" href="igraph-Memory.html" title="Chapter 6. Memory (de)allocation">
<link rel="chapter" href="igraph-Data-structures.html" title="Chapter 7. Data structure library: vector, matrix, other data types">
<link rel="chapter" href="igraph-Random.html" title="Chapter 8. Random numbers">
<link rel="chapter" href="igraph-Iterators.html" title="Chapter 9. Vertex and edge selectors and sequences, iterators">
<link rel="chapter" href="igraph-Attributes.html" title="Chapter 10. Graph, vertex and edge attributes">
<link rel="chapter" href="igraph-Generators.html" title="Chapter 11. Deterministic graph generators">
<link rel="chapter" href="igraph-Games.html" title='Chapter 12. Stochastic graph generators ("games")'>
<link rel="chapter" href="igraph-Bipartite.html" title="Chapter 13. Bipartite, i.e. two-mode graphs">
<link rel="chapter" href="igraph-Spatial.html" title="Chapter 14. Spatial graphs">
<link rel="chapter" href="igraph-Operators.html" title="Chapter 15. Graph operators">
<link rel="chapter" href="igraph-Visitors.html" title="Chapter 16. Graph visitors">
<link rel="chapter" href="igraph-Structural.html" title="Chapter 17. Structural properties of graphs">
<link rel="chapter" href="igraph-Cycles.html" title="Chapter 18. Graph cycles">
<link rel="chapter" href="igraph-Cliques.html" title="Chapter 19. Cliques and independent vertex sets">
<link rel="chapter" href="igraph-Motifs.html" title="Chapter 20. Graph motifs, dyad census and triad census">
<link rel="chapter" href="igraph-Isomorphism.html" title="Chapter 21. Graph isomorphism">
<link rel="chapter" href="igraph-Coloring.html" title="Chapter 22. Graph coloring">
<link rel="chapter" href="igraph-Flows.html" title="Chapter 23. Maximum flows, minimum cuts and related measures">
<link rel="chapter" href="igraph-Separators.html" title="Chapter 24. Vertex separators">
<link rel="chapter" href="igraph-Community.html" title="Chapter 25. Detecting community structure">
<link rel="chapter" href="igraph-Graphlets.html" title="Chapter 26. Graphlets">
<link rel="chapter" href="igraph-HRG.html" title="Chapter 27. Hierarchical random graphs">
<link rel="chapter" href="igraph-Embedding.html" title="Chapter 28. Embedding of graphs">
<link rel="chapter" href="igraph-Layout.html" title="Chapter 29. Generating layouts for graph drawing">
<link rel="chapter" href="igraph-Processes.html" title="Chapter 30. Processes on graphs">
<link rel="chapter" href="igraph-Foreign.html" title="Chapter 31. Reading and writing graphs from and to files">
<link rel="chapter" href="igraph-Linalg.html" title="Chapter 32. Using BLAS, LAPACK and ARPACK for igraph matrices and graphs">
<link rel="chapter" href="igraph-Nongraph.html" title="Chapter 33. Non-graph related functions">
<link rel="chapter" href="igraph-Advanced.html" title="Chapter 34. Advanced igraph programming">
<link rel="chapter" href="igraph-Glossary.html" title="Chapter 35. Glossary">
<link rel="chapter" href="igraph-Licenses.html" title="Chapter 36. Licenses for igraph and this manual">
<link rel="index" href="ix01.html" title="Index">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navigation-header mb-4" width="100%" summary="Navigation header"><div class="btn-group">
<a accesskey="p" class="btn btn-light" href="igraph-HRG.html"><i class="fa fa-chevron-left"></i>
Previous
</a><a accesskey="h" class="btn btn-light" href="index.html"><i class="fa fa-home"></i>
Home
</a><a accesskey="n" class="btn btn-light" href="igraph-Layout.html"><i class="fa fa-chevron-right"></i>
Next
</a>
</div></div>
<div class="chapter">
<div class="titlepage"><div><div><h1 class="title">
<a name="igraph-Embedding"></a>Chapter 28. Embedding of graphs</h1></div></div></div>
<div class="toc"><dl class="toc"><dt><span class="section"><a href="igraph-Embedding.html#spectral-embedding">1. Spectral embedding</a></span></dt></dl></div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="spectral-embedding"></a>1. Spectral embedding</h2></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="igraph-Embedding.html#igraph_adjacency_spectral_embedding">1.1. <code class="function">igraph_adjacency_spectral_embedding</code> — Adjacency spectral embedding</a></span></dt>
<dt><span class="section"><a href="igraph-Embedding.html#igraph_laplacian_spectral_embedding">1.2. <code class="function">igraph_laplacian_spectral_embedding</code> — Spectral embedding of the Laplacian of a graph</a></span></dt>
<dt><span class="section"><a href="igraph-Embedding.html#igraph_dim_select">1.3. <code class="function">igraph_dim_select</code> — Dimensionality selection.</a></span></dt>
</dl></div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="igraph_adjacency_spectral_embedding"></a>1.1. <code class="function">igraph_adjacency_spectral_embedding</code> — Adjacency spectral embedding</h3></div></div></div>
<a class="indexterm" name="id-1.29.2.2.2"></a><p>
</p>
<div class="informalexample"><pre class="programlisting">
igraph_error_t igraph_adjacency_spectral_embedding(const igraph_t *graph,
igraph_int_t n,
const igraph_vector_t *weights,
igraph_eigen_which_position_t which,
igraph_bool_t scaled,
igraph_matrix_t *X,
igraph_matrix_t *Y,
igraph_vector_t *D,
const igraph_vector_t *cvec,
igraph_arpack_options_t *options);
</pre></div>
<p>
</p>
<p>
Spectral decomposition of the adjacency matrices of graphs.
This function computes an <code class="literal">n</code>-dimensional Euclidean
representation of the graph based on its adjacency
matrix, A. This representation is computed via the singular value
decomposition of the adjacency matrix, A=U D V^T. In the case,
where the graph is a random dot product graph generated using latent
position vectors in R^n for each vertex, the embedding will
provide an estimate of these latent vectors.
</p>
<p>
For undirected graphs, the latent positions are calculated as
X = U^n D^(1/2) where U^n equals to the first no columns of U, and
D^(1/2) is a diagonal matrix containing the square root of the selected
singular values on the diagonal.
</p>
<p>
For directed graphs, the embedding is defined as the pair
X = U^n D^(1/2), Y = V^n D^(1/2).
(For undirected graphs U=V, so it is sufficient to keep one of them.)
</p>
<p><b>Arguments: </b>
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>graph</code></em>:</span></p></td>
<td><p>
The input graph, can be directed or undirected.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>n</code></em>:</span></p></td>
<td><p>
An integer scalar. This value is the embedding dimension of
the spectral embedding. Should be smaller than the number of
vertices. The largest n-dimensional non-zero
singular values are used for the spectral embedding.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>weights</code></em>:</span></p></td>
<td><p>
Optional edge weights. Supply a null pointer for
unweighted graphs.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>which</code></em>:</span></p></td>
<td>
<p>
Which eigenvalues (or singular values, for directed
graphs) to use, possible values:
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="constant">IGRAPH_EIGEN_LM</code></span></p></td>
<td><p>
the ones with the largest magnitude
</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="constant">IGRAPH_EIGEN_LA</code></span></p></td>
<td><p>
the (algebraic) largest ones
</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="constant">IGRAPH_EIGEN_SA</code></span></p></td>
<td><p>
the (algebraic) smallest ones.
</p></td>
</tr>
</tbody>
</table></div>
<p>
For directed graphs, <code class="literal">IGRAPH_EIGEN_LM</code> and
<code class="literal">IGRAPH_EIGEN_LA</code> are the same because singular
values are used for the ordering instead of eigenvalues.
</p>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>scaled</code></em>:</span></p></td>
<td><p>
Whether to return X and Y (if <code class="constant">scaled</code> is true), or
U and V.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>X</code></em>:</span></p></td>
<td><p>
Initialized matrix, the estimated latent positions are
stored here.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>Y</code></em>:</span></p></td>
<td><p>
Initialized matrix or a null pointer. If not a null
pointer, then the second half of the latent positions are
stored here. (For undirected graphs, this always equals X.)
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>D</code></em>:</span></p></td>
<td><p>
Initialized vector or a null pointer. If not a null
pointer, then the eigenvalues (for undirected graphs) or the
singular values (for directed graphs) are stored here.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cvec</code></em>:</span></p></td>
<td><p>
A numeric vector, its length is the number vertices in the
graph. This vector is added to the diagonal of the adjacency
matrix, before performing the SVD.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>options</code></em>:</span></p></td>
<td><p>
Options to ARPACK. See <a class="link" href="igraph-Linalg.html#igraph_arpack_options_t" title="3.1.1. igraph_arpack_options_t — Options for ARPACK."><code class="function">igraph_arpack_options_t</code></a>
for details. Supply <code class="constant">NULL</code> to use the defaults. Note that the
function overwrites the <code class="literal">n</code> (number of vertices),
<code class="literal">nev</code> and <code class="literal">which</code> parameters and it always
starts the calculation from a random start vector.
</p></td>
</tr>
</tbody>
</table></div>
<p>
</p>
<p><b>Returns: </b></p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code></code></em></span></p></td>
<td><p>
Error code.
</p></td>
</tr></tbody>
</table></div>
<p>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="igraph_laplacian_spectral_embedding"></a>1.2. <code class="function">igraph_laplacian_spectral_embedding</code> — Spectral embedding of the Laplacian of a graph</h3></div></div></div>
<a class="indexterm" name="id-1.29.2.3.2"></a><p>
</p>
<div class="informalexample"><pre class="programlisting">
igraph_error_t igraph_laplacian_spectral_embedding(const igraph_t *graph,
igraph_int_t n,
const igraph_vector_t *weights,
igraph_eigen_which_position_t which,
igraph_laplacian_spectral_embedding_type_t type,
igraph_bool_t scaled,
igraph_matrix_t *X,
igraph_matrix_t *Y,
igraph_vector_t *D,
igraph_arpack_options_t *options);
</pre></div>
<p>
</p>
<p>
This function essentially does the same as
<a class="link" href="igraph-Embedding.html#igraph_adjacency_spectral_embedding" title="1.1. igraph_adjacency_spectral_embedding — Adjacency spectral embedding"><code class="function">igraph_adjacency_spectral_embedding</code></a>, but works on the Laplacian
of the graph, instead of the adjacency matrix.
</p>
<p><b>Arguments: </b>
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>graph</code></em>:</span></p></td>
<td><p>
The input graph.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>n</code></em>:</span></p></td>
<td><p>
The number of eigenvectors (or singular vectors if the graph
is directed) to use for the embedding.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>weights</code></em>:</span></p></td>
<td><p>
Optional edge weights. Supply a null pointer for
unweighted graphs.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>which</code></em>:</span></p></td>
<td>
<p>
Which eigenvalues (or singular values, for directed
graphs) to use, possible values:
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="constant">IGRAPH_EIGEN_LM</code></span></p></td>
<td><p>
the ones with the largest magnitude
</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="constant">IGRAPH_EIGEN_LA</code></span></p></td>
<td><p>
the (algebraic) largest ones
</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="constant">IGRAPH_EIGEN_SA</code></span></p></td>
<td><p>
the (algebraic) smallest ones.
</p></td>
</tr>
</tbody>
</table></div>
<p>
For directed graphs, <code class="literal">IGRAPH_EIGEN_LM</code> and
<code class="literal">IGRAPH_EIGEN_LA</code> are the same because singular
values are used for the ordering instead of eigenvalues.
</p>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>type</code></em>:</span></p></td>
<td>
<p>
The type of the Laplacian to use. Various definitions
exist for the Laplacian of a graph, and one can choose
between them with this argument. Possible values:
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="constant">IGRAPH_EMBEDDING_D_A</code></span></p></td>
<td><p>
means D - A where D is the
degree matrix and A is the adjacency matrix
</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="constant">IGRAPH_EMBEDDING_DAD</code></span></p></td>
<td><p>
means Di times A times Di,
where Di is the inverse of the square root of the degree matrix;
</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="constant">IGRAPH_EMBEDDING_I_DAD</code></span></p></td>
<td><p>
means I - Di A Di, where I
is the identity matrix.
</p></td>
</tr>
</tbody>
</table></div>
<p>
</p>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>scaled</code></em>:</span></p></td>
<td><p>
Whether to return X and Y (if <code class="constant">scaled</code> is true), or
U and V.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>X</code></em>:</span></p></td>
<td><p>
Initialized matrix, the estimated latent positions are
stored here.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>Y</code></em>:</span></p></td>
<td><p>
Initialized matrix or a null pointer. If not a null
pointer, then the second half of the latent positions are
stored here. (For undirected graphs, this always equals X.)
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>D</code></em>:</span></p></td>
<td><p>
Initialized vector or a null pointer. If not a null
pointer, then the eigenvalues (for undirected graphs) or the
singular values (for directed graphs) are stored here.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>options</code></em>:</span></p></td>
<td><p>
Options to ARPACK. See <a class="link" href="igraph-Linalg.html#igraph_arpack_options_t" title="3.1.1. igraph_arpack_options_t — Options for ARPACK."><code class="function">igraph_arpack_options_t</code></a>
for details. Supply <code class="constant">NULL</code> to use the defaults. Note that the
function overwrites the <code class="literal">n</code> (number of vertices),
<code class="literal">nev</code> and <code class="literal">which</code> parameters and it always
starts the calculation from a random start vector.
</p></td>
</tr>
</tbody>
</table></div>
<p>
</p>
<p><b>Returns: </b></p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code></code></em></span></p></td>
<td><p>
Error code.
</p></td>
</tr></tbody>
</table></div>
<p>
</p>
<p><b>See also: </b></p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code></code></em></span></p></td>
<td><p>
<a class="link" href="igraph-Embedding.html#igraph_adjacency_spectral_embedding" title="1.1. igraph_adjacency_spectral_embedding — Adjacency spectral embedding"><code class="function">igraph_adjacency_spectral_embedding</code></a> to embed the adjacency
matrix.
</p></td>
</tr></tbody>
</table></div>
<p>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="igraph_dim_select"></a>1.3. <code class="function">igraph_dim_select</code> — Dimensionality selection.</h3></div></div></div>
<a class="indexterm" name="id-1.29.2.4.2"></a><p>
</p>
<div class="informalexample"><pre class="programlisting">
igraph_error_t igraph_dim_select(const igraph_vector_t *sv, igraph_int_t *dim);
</pre></div>
<p>
</p>
<p>
Dimensionality selection for singular values using
profile likelihood.
</p>
<p>
The input of the function is a numeric vector which contains
the measure of "importance" for each dimension.
</p>
<p>
For spectral embedding, these are the singular values of the adjacency
matrix. The singular values are assumed to be generated from a
Gaussian mixture distribution with two components that have different
means and same variance. The dimensionality d is chosen to
maximize the likelihood when the d largest singular values are
assigned to one component of the mixture and the rest of the singular
values assigned to the other component.
</p>
<p>
This function can also be used for the general separation problem,
where we assume that the left and the right of the vector are coming
from two normal distributions, with different means, and we want
to know their border.
</p>
<p><b>Arguments: </b>
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>sv</code></em>:</span></p></td>
<td><p>
A numeric vector, the ordered singular values.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dim</code></em>:</span></p></td>
<td><p>
The result is stored here.
</p></td>
</tr>
</tbody>
</table></div>
<p>
</p>
<p><b>Returns: </b></p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code></code></em></span></p></td>
<td><p>
Error code.
</p></td>
</tr></tbody>
</table></div>
<p>
Time complexity: O(n), n is the number of values in sv.
</p>
<p><b>See also: </b></p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code></code></em></span></p></td>
<td><p>
<a class="link" href="igraph-Embedding.html#igraph_adjacency_spectral_embedding" title="1.1. igraph_adjacency_spectral_embedding — Adjacency spectral embedding"><code class="function">igraph_adjacency_spectral_embedding()</code></a>.
</p></td>
</tr></tbody>
</table></div>
<p>
</p>
</div>
</div>
</div>
<table class="navigation-footer" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle">
<td align="left"><a accesskey="p" href="igraph-HRG.html"><b>← Chapter 27. Hierarchical random graphs</b></a></td>
<td align="right"><a accesskey="n" href="igraph-Layout.html"><b>Chapter 29. Generating layouts for graph drawing →</b></a></td>
</tr></table>
</body>
</html>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,212 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Chapter 35. Glossary</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="igraph Reference Manual">
<link rel="up" href="index.html" title="igraph Reference Manual">
<link rel="prev" href="igraph-Advanced.html" title="Chapter 34. Advanced igraph programming">
<link rel="next" href="igraph-Licenses.html" title="Chapter 36. Licenses for igraph and this manual">
<script type="text/javascript" src="toggle.js"></script><link rel="stylesheet" href="style.css" type="text/css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css">
<link rel="chapter" href="igraph-Introduction.html" title="Chapter 1. Introduction">
<link rel="chapter" href="igraph-Installation.html" title="Chapter 2. Installation">
<link rel="chapter" href="igraph-Tutorial.html" title="Chapter 3. Tutorial">
<link rel="chapter" href="igraph-Basic.html" title="Chapter 4. Basic data types and interface">
<link rel="chapter" href="igraph-Error.html" title="Chapter 5. Error handling">
<link rel="chapter" href="igraph-Memory.html" title="Chapter 6. Memory (de)allocation">
<link rel="chapter" href="igraph-Data-structures.html" title="Chapter 7. Data structure library: vector, matrix, other data types">
<link rel="chapter" href="igraph-Random.html" title="Chapter 8. Random numbers">
<link rel="chapter" href="igraph-Iterators.html" title="Chapter 9. Vertex and edge selectors and sequences, iterators">
<link rel="chapter" href="igraph-Attributes.html" title="Chapter 10. Graph, vertex and edge attributes">
<link rel="chapter" href="igraph-Generators.html" title="Chapter 11. Deterministic graph generators">
<link rel="chapter" href="igraph-Games.html" title='Chapter 12. Stochastic graph generators ("games")'>
<link rel="chapter" href="igraph-Bipartite.html" title="Chapter 13. Bipartite, i.e. two-mode graphs">
<link rel="chapter" href="igraph-Spatial.html" title="Chapter 14. Spatial graphs">
<link rel="chapter" href="igraph-Operators.html" title="Chapter 15. Graph operators">
<link rel="chapter" href="igraph-Visitors.html" title="Chapter 16. Graph visitors">
<link rel="chapter" href="igraph-Structural.html" title="Chapter 17. Structural properties of graphs">
<link rel="chapter" href="igraph-Cycles.html" title="Chapter 18. Graph cycles">
<link rel="chapter" href="igraph-Cliques.html" title="Chapter 19. Cliques and independent vertex sets">
<link rel="chapter" href="igraph-Motifs.html" title="Chapter 20. Graph motifs, dyad census and triad census">
<link rel="chapter" href="igraph-Isomorphism.html" title="Chapter 21. Graph isomorphism">
<link rel="chapter" href="igraph-Coloring.html" title="Chapter 22. Graph coloring">
<link rel="chapter" href="igraph-Flows.html" title="Chapter 23. Maximum flows, minimum cuts and related measures">
<link rel="chapter" href="igraph-Separators.html" title="Chapter 24. Vertex separators">
<link rel="chapter" href="igraph-Community.html" title="Chapter 25. Detecting community structure">
<link rel="chapter" href="igraph-Graphlets.html" title="Chapter 26. Graphlets">
<link rel="chapter" href="igraph-HRG.html" title="Chapter 27. Hierarchical random graphs">
<link rel="chapter" href="igraph-Embedding.html" title="Chapter 28. Embedding of graphs">
<link rel="chapter" href="igraph-Layout.html" title="Chapter 29. Generating layouts for graph drawing">
<link rel="chapter" href="igraph-Processes.html" title="Chapter 30. Processes on graphs">
<link rel="chapter" href="igraph-Foreign.html" title="Chapter 31. Reading and writing graphs from and to files">
<link rel="chapter" href="igraph-Linalg.html" title="Chapter 32. Using BLAS, LAPACK and ARPACK for igraph matrices and graphs">
<link rel="chapter" href="igraph-Nongraph.html" title="Chapter 33. Non-graph related functions">
<link rel="chapter" href="igraph-Advanced.html" title="Chapter 34. Advanced igraph programming">
<link rel="chapter" href="igraph-Glossary.html" title="Chapter 35. Glossary">
<link rel="chapter" href="igraph-Licenses.html" title="Chapter 36. Licenses for igraph and this manual">
<link rel="index" href="ix01.html" title="Index">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navigation-header mb-4" width="100%" summary="Navigation header"><div class="btn-group">
<a accesskey="p" class="btn btn-light" href="igraph-Advanced.html"><i class="fa fa-chevron-left"></i>
Previous
</a><a accesskey="h" class="btn btn-light" href="index.html"><i class="fa fa-home"></i>
Home
</a><a accesskey="n" class="btn btn-light" href="igraph-Licenses.html"><i class="fa fa-chevron-right"></i>
Next
</a>
</div></div>
<div class="chapter">
<div class="titlepage"><div><div><h1 class="title">
<a name="igraph-Glossary"></a>Chapter 35. Glossary</h1></div></div></div>
<p>
This glossary defines common terms used throughout the igraph
documentation.
</p>
<div class="itemizedlist"><ul class="itemizedlist compact" style="list-style-type: disc; ">
<li class="listitem"><p>
<span class="strong"><strong>attribute</strong></span>: A piece of data
associated with a vertex, an edge, or the graph itself. The
igraph C library currently supports numeric, string and Boolean
attribute values, and provides a means for implementing
attribute handlers that support custom types.
</p></li>
<li class="listitem"><p>
<span class="strong"><strong>adjacent</strong></span>: Two vertices are
called <span class="strong"><strong>adjacent</strong></span> if there is
an edge connecting them. This term describes a vertex-to-vertex
relation.
</p></li>
<li class="listitem"><p>
<span class="strong"><strong>adjacency list</strong></span>: A data
structure that associates a list of neighbours (i.e. adjacent
vertices) to each vertex.
</p></li>
<li class="listitem"><p>
<span class="strong"><strong>adjacency matrix</strong></span>: A
representation of a graph as a square matrix.
<code class="literal">A_ij</code> gives the number of edge endpoints
connecting from the <code class="literal">i</code>th vertex to the
<code class="literal">j</code>th vertex. Conventionally, the diagonal of
the adjacency matrix of an undirected graph contains
<span class="emphasis"><em>twice</em></span> the number of self-loops. All igraph
functions follow this convention unless noted otherwise.
</p></li>
<li class="listitem"><p>
<span class="strong"><strong>biadjacency matrix</strong></span>: Analogous
to the adjacency matrix, but used for bipartite graphs. Element
<code class="literal">B_ij</code> gives the number of edges from the
<code class="literal">i</code>th vertex of the first group to the
<code class="literal">j</code>th vertex of the second group.
</p></li>
<li class="listitem"><p>
<span class="strong"><strong>bipartite graph</strong></span>: A graph
whose vertices can be partitioned into two groups in such a way
that connections are present only between members of different
groups.
</p></li>
<li class="listitem"><p>
<span class="strong"><strong>complete graph</strong></span>: Also called
<span class="strong"><strong>full graph</strong></span> within the context
of igraph, a graph in which all pairs of vertices are connected
to each other.
</p></li>
<li class="listitem"><p>
<span class="strong"><strong>connected graph</strong></span>: A connected
graph consists of a single component, in which any vertex is
reachable from any other. In igraph, the null graph is not
considered connected, as it has not one, but zero components.
</p></li>
<li class="listitem"><p>
<span class="strong"><strong>edge</strong></span>: A
<span class="strong"><strong>connection</strong></span> between two
vertices, also called a <span class="strong"><strong>link</strong></span>.
In igraph, edges are referred to by integer indices called
<span class="strong"><strong>edge IDs</strong></span>.
</p></li>
<li class="listitem"><p>
<span class="strong"><strong>finalizer stack</strong></span>: A global
stack used internally by igraph to keep track of currently
allocated objects and their destructors, so that they can be
automatically destroyed in case of an error.
</p></li>
<li class="listitem"><p>
<span class="strong"><strong>game</strong></span>: Within igraph, this
term is used for stochastic graph generators, i.e. functions
that sample from random graph models.
</p></li>
<li class="listitem"><p>
<span class="strong"><strong>graph</strong></span> or
<span class="strong"><strong>network</strong></span>: A set of vertices
with connections between them. In igraph, graphs may carry
associated data in the form of vertex, edge or graph attributes.
</p></li>
<li class="listitem"><p>
<span class="strong"><strong>incident</strong></span>: An edge is called
<span class="strong"><strong>incident</strong></span> to the vertices that
are its endpoints. This term describes a vertex-to-edge
relation.
</p></li>
<li class="listitem"><p>
<span class="strong"><strong>incidence list</strong></span>: A data
structure that associates a list of incident edges to each
vertex.
</p></li>
<li class="listitem"><p>
<span class="strong"><strong>incidence matrix</strong></span>: A matrix
describing the incidence relation between vertices (rows) and
edges (columns).
</p></li>
<li class="listitem"><p>
<span class="strong"><strong>membership vector</strong></span>: Membership
vectors are a means of encoding a partitioning of items, usually
vertices, into several groups. The <code class="literal">i</code>th
element of the vector gives an integer identifier of the group
the <code class="literal">i</code>th vertex belongs to. Membership vectors
are typically used to describe a vertex clustering obtained
through community detection, or by identifying the connected
components of a graph.
</p></li>
<li class="listitem"><p>
<span class="strong"><strong>multi-edges</strong></span> or
<span class="strong"><strong>parallel edges</strong></span>: More than one
edge connecting the same two vertices. In a directed graph,
<code class="literal">a -&gt; b, a -&gt; b</code> are considered parallel
edges, but <code class="literal">a -&gt; b, a &lt;- b</code> are not.
</p></li>
<li class="listitem"><p>
<span class="strong"><strong>null graph</strong></span>: A graph with no
vertices (and no edges).
</p></li>
<li class="listitem"><p>
<span class="strong"><strong>self-loop</strong></span>,
<span class="strong"><strong>self-edge</strong></span>, or simply
<span class="strong"><strong>loop</strong></span>: An edge that connects a
vertex to itself.
</p></li>
<li class="listitem"><p>
<span class="strong"><strong>simple graph</strong></span>: A graph that
does not have self-loops or multi-edges.
</p></li>
<li class="listitem"><p>
<span class="strong"><strong>singleton graph</strong></span>: A graph
having a single vertex. This term usually refers to a single
vertex with no edges, but note that self-loops may in principle
be present.
</p></li>
<li class="listitem"><p>
<span class="strong"><strong>vertex</strong></span>: Graphs consist of
vertices, also called <span class="strong"><strong>nodes</strong></span>,
that are connected to each other. In igraph, vertices are
referred to by integer indices called
<span class="strong"><strong>vertex IDs</strong></span>.
</p></li>
</ul></div>
</div>
<table class="navigation-footer" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle">
<td align="left"><a accesskey="p" href="igraph-Advanced.html"><b>← Chapter 34. Advanced igraph programming</b></a></td>
<td align="right"><a accesskey="n" href="igraph-Licenses.html"><b>Chapter 36. Licenses for igraph and this manual →</b></a></td>
</tr></table>
</body>
</html>
@@ -0,0 +1,383 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Chapter 26. Graphlets</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="igraph Reference Manual">
<link rel="up" href="index.html" title="igraph Reference Manual">
<link rel="prev" href="igraph-Community.html" title="Chapter 25. Detecting community structure">
<link rel="next" href="igraph-HRG.html" title="Chapter 27. Hierarchical random graphs">
<script type="text/javascript" src="toggle.js"></script><link rel="stylesheet" href="style.css" type="text/css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css">
<link rel="chapter" href="igraph-Introduction.html" title="Chapter 1. Introduction">
<link rel="chapter" href="igraph-Installation.html" title="Chapter 2. Installation">
<link rel="chapter" href="igraph-Tutorial.html" title="Chapter 3. Tutorial">
<link rel="chapter" href="igraph-Basic.html" title="Chapter 4. Basic data types and interface">
<link rel="chapter" href="igraph-Error.html" title="Chapter 5. Error handling">
<link rel="chapter" href="igraph-Memory.html" title="Chapter 6. Memory (de)allocation">
<link rel="chapter" href="igraph-Data-structures.html" title="Chapter 7. Data structure library: vector, matrix, other data types">
<link rel="chapter" href="igraph-Random.html" title="Chapter 8. Random numbers">
<link rel="chapter" href="igraph-Iterators.html" title="Chapter 9. Vertex and edge selectors and sequences, iterators">
<link rel="chapter" href="igraph-Attributes.html" title="Chapter 10. Graph, vertex and edge attributes">
<link rel="chapter" href="igraph-Generators.html" title="Chapter 11. Deterministic graph generators">
<link rel="chapter" href="igraph-Games.html" title='Chapter 12. Stochastic graph generators ("games")'>
<link rel="chapter" href="igraph-Bipartite.html" title="Chapter 13. Bipartite, i.e. two-mode graphs">
<link rel="chapter" href="igraph-Spatial.html" title="Chapter 14. Spatial graphs">
<link rel="chapter" href="igraph-Operators.html" title="Chapter 15. Graph operators">
<link rel="chapter" href="igraph-Visitors.html" title="Chapter 16. Graph visitors">
<link rel="chapter" href="igraph-Structural.html" title="Chapter 17. Structural properties of graphs">
<link rel="chapter" href="igraph-Cycles.html" title="Chapter 18. Graph cycles">
<link rel="chapter" href="igraph-Cliques.html" title="Chapter 19. Cliques and independent vertex sets">
<link rel="chapter" href="igraph-Motifs.html" title="Chapter 20. Graph motifs, dyad census and triad census">
<link rel="chapter" href="igraph-Isomorphism.html" title="Chapter 21. Graph isomorphism">
<link rel="chapter" href="igraph-Coloring.html" title="Chapter 22. Graph coloring">
<link rel="chapter" href="igraph-Flows.html" title="Chapter 23. Maximum flows, minimum cuts and related measures">
<link rel="chapter" href="igraph-Separators.html" title="Chapter 24. Vertex separators">
<link rel="chapter" href="igraph-Community.html" title="Chapter 25. Detecting community structure">
<link rel="chapter" href="igraph-Graphlets.html" title="Chapter 26. Graphlets">
<link rel="chapter" href="igraph-HRG.html" title="Chapter 27. Hierarchical random graphs">
<link rel="chapter" href="igraph-Embedding.html" title="Chapter 28. Embedding of graphs">
<link rel="chapter" href="igraph-Layout.html" title="Chapter 29. Generating layouts for graph drawing">
<link rel="chapter" href="igraph-Processes.html" title="Chapter 30. Processes on graphs">
<link rel="chapter" href="igraph-Foreign.html" title="Chapter 31. Reading and writing graphs from and to files">
<link rel="chapter" href="igraph-Linalg.html" title="Chapter 32. Using BLAS, LAPACK and ARPACK for igraph matrices and graphs">
<link rel="chapter" href="igraph-Nongraph.html" title="Chapter 33. Non-graph related functions">
<link rel="chapter" href="igraph-Advanced.html" title="Chapter 34. Advanced igraph programming">
<link rel="chapter" href="igraph-Glossary.html" title="Chapter 35. Glossary">
<link rel="chapter" href="igraph-Licenses.html" title="Chapter 36. Licenses for igraph and this manual">
<link rel="index" href="ix01.html" title="Index">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navigation-header mb-4" width="100%" summary="Navigation header"><div class="btn-group">
<a accesskey="p" class="btn btn-light" href="igraph-Community.html"><i class="fa fa-chevron-left"></i>
Previous
</a><a accesskey="h" class="btn btn-light" href="index.html"><i class="fa fa-home"></i>
Home
</a><a accesskey="n" class="btn btn-light" href="igraph-HRG.html"><i class="fa fa-chevron-right"></i>
Next
</a>
</div></div>
<div class="chapter">
<div class="titlepage"><div><div><h1 class="title">
<a name="igraph-Graphlets"></a>Chapter 26. Graphlets</h1></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="igraph-Graphlets.html#about-graphlets">1. Introduction</a></span></dt>
<dt><span class="section"><a href="igraph-Graphlets.html#performing-graphlet-decomposition">2. Performing graphlet decomposition</a></span></dt>
</dl></div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="about-graphlets"></a>1.  Introduction</h2></div></div></div>
<p>
Graphlet decomposition models a weighted undirected graph
via the union of potentially overlapping dense social groups.
This is done by a two-step algorithm. In the first step, a candidate
set of groups (a candidate basis) is created by finding cliques
in the thresholded input graph. In the second step,
the graph is projected onto the candidate basis, resulting in a
weight coefficient for each clique in the candidate basis.
</p>
<p>
For more information on graphlet decomposition, see
Hossein Azari Soufiani and Edoardo M Airoldi: "Graphlet decomposition of a weighted network",
<a class="ulink" href="https://arxiv.org/abs/1203.2821" target="_top">https://arxiv.org/abs/1203.2821</a> and <a class="ulink" href="http://proceedings.mlr.press/v22/azari12/azari12.pdf" target="_top">http://proceedings.mlr.press/v22/azari12/azari12.pdf</a>
</p>
<p>
igraph contains three functions for performing the graphlet
decomponsition of a graph. The first is <a class="link" href="igraph-Graphlets.html#igraph_graphlets" title="2.1. igraph_graphlets — Calculate graphlets basis and project the graph on it."><code class="function">igraph_graphlets()</code></a>, which
performs both steps of the method and returns a list of subgraphs
with their corresponding weights. The other two functions
correspond to the first and second steps of the algorithm, and they are
useful if the user wishes to perform them individually:
<a class="link" href="igraph-Graphlets.html#igraph_graphlets_candidate_basis" title="2.2. igraph_graphlets_candidate_basis — Calculate a candidate graphlets basis"><code class="function">igraph_graphlets_candidate_basis()</code></a> and
<a class="link" href="igraph-Graphlets.html#igraph_graphlets_project" title="2.3. igraph_graphlets_project — Project a graph on a graphlets basis."><code class="function">igraph_graphlets_project()</code></a>.
</p>
<p>
<em><span class="remark">
Note: The term "graphlet" is used for several unrelated concepts
in the literature. If you are looking to count induced subgraphs, see
<a class="link" href="igraph-Motifs.html#igraph_motifs_randesu" title="4.1. igraph_motifs_randesu — Count the number of motifs in a graph."><code class="function">igraph_motifs_randesu()</code></a> and <a class="link" href="igraph-Isomorphism.html#igraph_subisomorphic_lad" title="4.1. igraph_subisomorphic_lad — Check subgraph isomorphism with the LAD algorithm"><code class="function">igraph_subisomorphic_lad()</code></a>.
</span></em>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="performing-graphlet-decomposition"></a>2. Performing graphlet decomposition</h2></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="igraph-Graphlets.html#igraph_graphlets">2.1. <code class="function">igraph_graphlets</code> — Calculate graphlets basis and project the graph on it.</a></span></dt>
<dt><span class="section"><a href="igraph-Graphlets.html#igraph_graphlets_candidate_basis">2.2. <code class="function">igraph_graphlets_candidate_basis</code> — Calculate a candidate graphlets basis</a></span></dt>
<dt><span class="section"><a href="igraph-Graphlets.html#igraph_graphlets_project">2.3. <code class="function">igraph_graphlets_project</code> — Project a graph on a graphlets basis.</a></span></dt>
</dl></div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="igraph_graphlets"></a>2.1. <code class="function">igraph_graphlets</code> — Calculate graphlets basis and project the graph on it.</h3></div></div></div>
<a class="indexterm" name="id-1.27.3.2.2"></a><p>
</p>
<div class="informalexample"><pre class="programlisting">
igraph_error_t igraph_graphlets(const igraph_t *graph,
const igraph_vector_t *weights,
igraph_vector_int_list_t *cliques,
igraph_vector_t *Mu, igraph_int_t niter);
</pre></div>
<p>
</p>
<p>
This function simply calls <a class="link" href="igraph-Graphlets.html#igraph_graphlets_candidate_basis" title="2.2. igraph_graphlets_candidate_basis — Calculate a candidate graphlets basis"><code class="function">igraph_graphlets_candidate_basis()</code></a>
and <a class="link" href="igraph-Graphlets.html#igraph_graphlets_project" title="2.3. igraph_graphlets_project — Project a graph on a graphlets basis."><code class="function">igraph_graphlets_project()</code></a>, and then orders the graphlets
according to decreasing weights.
</p>
<p><b>Arguments: </b>
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>graph</code></em>:</span></p></td>
<td><p>
The input graph, it must be a simple graph, edge directions are
ignored.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>weights</code></em>:</span></p></td>
<td><p>
Weights of the edges, a vector.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cliques</code></em>:</span></p></td>
<td><p>
An initialized list of integer vectors. The graphlet basis is
stored here. Each element of the list is an integer vector of
vertex IDs, encoding a single basis subgraph.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>Mu</code></em>:</span></p></td>
<td><p>
An initialized vector, the weights of the graphlets will
be stored here.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>niter</code></em>:</span></p></td>
<td><p>
The number of iterations to perform for the projection step.
</p></td>
</tr>
</tbody>
</table></div>
<p>
</p>
<p><b>Returns: </b></p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code></code></em></span></p></td>
<td><p>
Error code.
</p></td>
</tr></tbody>
</table></div>
<p>
See also: <a class="link" href="igraph-Graphlets.html#igraph_graphlets_candidate_basis" title="2.2. igraph_graphlets_candidate_basis — Calculate a candidate graphlets basis"><code class="function">igraph_graphlets_candidate_basis()</code></a> and
<a class="link" href="igraph-Graphlets.html#igraph_graphlets_project" title="2.3. igraph_graphlets_project — Project a graph on a graphlets basis."><code class="function">igraph_graphlets_project()</code></a>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="igraph_graphlets_candidate_basis"></a>2.2. <code class="function">igraph_graphlets_candidate_basis</code> — Calculate a candidate graphlets basis</h3></div></div></div>
<a class="indexterm" name="id-1.27.3.3.2"></a><p>
</p>
<div class="informalexample"><pre class="programlisting">
igraph_error_t igraph_graphlets_candidate_basis(const igraph_t *graph,
const igraph_vector_t *weights,
igraph_vector_int_list_t *cliques,
igraph_vector_t *thresholds);
</pre></div>
<p>
</p>
<p>
</p>
<p><b>Arguments: </b>
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>graph</code></em>:</span></p></td>
<td><p>
The input graph, it must be a simple graph, edge directions are
ignored.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>weights</code></em>:</span></p></td>
<td><p>
Weights of the edges, a vector.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cliques</code></em>:</span></p></td>
<td><p>
An initialized list of integer vectors. The graphlet basis is
stored here. Each element of the list is an integer vector of
vertex IDs, encoding a single basis subgraph.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>thresholds</code></em>:</span></p></td>
<td><p>
An initialized vector, the (highest possible)
weight thresholds for finding the basis subgraphs are stored
here.
</p></td>
</tr>
</tbody>
</table></div>
<p>
</p>
<p><b>Returns: </b></p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code></code></em></span></p></td>
<td><p>
Error code.
</p></td>
</tr></tbody>
</table></div>
<p>
See also: <a class="link" href="igraph-Graphlets.html#igraph_graphlets" title="2.1. igraph_graphlets — Calculate graphlets basis and project the graph on it."><code class="function">igraph_graphlets()</code></a> and <a class="link" href="igraph-Graphlets.html#igraph_graphlets_project" title="2.3. igraph_graphlets_project — Project a graph on a graphlets basis."><code class="function">igraph_graphlets_project()</code></a>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="igraph_graphlets_project"></a>2.3. <code class="function">igraph_graphlets_project</code> — Project a graph on a graphlets basis.</h3></div></div></div>
<a class="indexterm" name="id-1.27.3.4.2"></a><p>
</p>
<div class="informalexample"><pre class="programlisting">
igraph_error_t igraph_graphlets_project(const igraph_t *graph,
const igraph_vector_t *weights,
const igraph_vector_int_list_t *cliques,
igraph_vector_t *Mu, igraph_bool_t startMu,
igraph_int_t niter);
</pre></div>
<p>
</p>
<p>
Note that the graph projected does not have to be the same that
was used to calculate the graphlet basis, but it is assumed that
it has the same number of vertices, and the vertex IDs of the two
graphs match.
</p>
<p><b>Arguments: </b>
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>graph</code></em>:</span></p></td>
<td><p>
The input graph, it must be a simple graph, edge directions are
ignored.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>weights</code></em>:</span></p></td>
<td><p>
Weights of the edges in the input graph, a vector.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cliques</code></em>:</span></p></td>
<td><p>
An initialized list of integer vectors. The graphlet basis is
stored here. Each element of the list is an integer vector of
vertex IDs, encoding a single basis subgraph.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>Mu</code></em>:</span></p></td>
<td><p>
An initialized vector, the weights of the graphlets will
be stored here. This vector is also used to initialize the
the weight vector for the iterative algorithm, if the
<code class="constant">startMu</code> argument is true.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>startMu</code></em>:</span></p></td>
<td><p>
If true, then the supplied Mu vector is
used as the starting point of the iteration. Otherwise a
constant 1 vector is used.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>niter</code></em>:</span></p></td>
<td><p>
The number of iterations to perform.
</p></td>
</tr>
</tbody>
</table></div>
<p>
</p>
<p><b>Returns: </b></p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code></code></em></span></p></td>
<td><p>
Error code.
</p></td>
</tr></tbody>
</table></div>
<p>
See also: <a class="link" href="igraph-Graphlets.html#igraph_graphlets" title="2.1. igraph_graphlets — Calculate graphlets basis and project the graph on it."><code class="function">igraph_graphlets()</code></a> and
<a class="link" href="igraph-Graphlets.html#igraph_graphlets_candidate_basis" title="2.2. igraph_graphlets_candidate_basis — Calculate a candidate graphlets basis"><code class="function">igraph_graphlets_candidate_basis()</code></a>.
</p>
</div>
</div>
</div>
<table class="navigation-footer" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle">
<td align="left"><a accesskey="p" href="igraph-Community.html"><b>← Chapter 25. Detecting community structure</b></a></td>
<td align="right"><a accesskey="n" href="igraph-HRG.html"><b>Chapter 27. Hierarchical random graphs →</b></a></td>
</tr></table>
</body>
</html>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,661 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Chapter 2. Installation</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="igraph Reference Manual">
<link rel="up" href="index.html" title="igraph Reference Manual">
<link rel="prev" href="igraph-Introduction.html" title="Chapter 1. Introduction">
<link rel="next" href="igraph-Tutorial.html" title="Chapter 3. Tutorial">
<script type="text/javascript" src="toggle.js"></script><link rel="stylesheet" href="style.css" type="text/css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css">
<link rel="chapter" href="igraph-Introduction.html" title="Chapter 1. Introduction">
<link rel="chapter" href="igraph-Installation.html" title="Chapter 2. Installation">
<link rel="chapter" href="igraph-Tutorial.html" title="Chapter 3. Tutorial">
<link rel="chapter" href="igraph-Basic.html" title="Chapter 4. Basic data types and interface">
<link rel="chapter" href="igraph-Error.html" title="Chapter 5. Error handling">
<link rel="chapter" href="igraph-Memory.html" title="Chapter 6. Memory (de)allocation">
<link rel="chapter" href="igraph-Data-structures.html" title="Chapter 7. Data structure library: vector, matrix, other data types">
<link rel="chapter" href="igraph-Random.html" title="Chapter 8. Random numbers">
<link rel="chapter" href="igraph-Iterators.html" title="Chapter 9. Vertex and edge selectors and sequences, iterators">
<link rel="chapter" href="igraph-Attributes.html" title="Chapter 10. Graph, vertex and edge attributes">
<link rel="chapter" href="igraph-Generators.html" title="Chapter 11. Deterministic graph generators">
<link rel="chapter" href="igraph-Games.html" title='Chapter 12. Stochastic graph generators ("games")'>
<link rel="chapter" href="igraph-Bipartite.html" title="Chapter 13. Bipartite, i.e. two-mode graphs">
<link rel="chapter" href="igraph-Spatial.html" title="Chapter 14. Spatial graphs">
<link rel="chapter" href="igraph-Operators.html" title="Chapter 15. Graph operators">
<link rel="chapter" href="igraph-Visitors.html" title="Chapter 16. Graph visitors">
<link rel="chapter" href="igraph-Structural.html" title="Chapter 17. Structural properties of graphs">
<link rel="chapter" href="igraph-Cycles.html" title="Chapter 18. Graph cycles">
<link rel="chapter" href="igraph-Cliques.html" title="Chapter 19. Cliques and independent vertex sets">
<link rel="chapter" href="igraph-Motifs.html" title="Chapter 20. Graph motifs, dyad census and triad census">
<link rel="chapter" href="igraph-Isomorphism.html" title="Chapter 21. Graph isomorphism">
<link rel="chapter" href="igraph-Coloring.html" title="Chapter 22. Graph coloring">
<link rel="chapter" href="igraph-Flows.html" title="Chapter 23. Maximum flows, minimum cuts and related measures">
<link rel="chapter" href="igraph-Separators.html" title="Chapter 24. Vertex separators">
<link rel="chapter" href="igraph-Community.html" title="Chapter 25. Detecting community structure">
<link rel="chapter" href="igraph-Graphlets.html" title="Chapter 26. Graphlets">
<link rel="chapter" href="igraph-HRG.html" title="Chapter 27. Hierarchical random graphs">
<link rel="chapter" href="igraph-Embedding.html" title="Chapter 28. Embedding of graphs">
<link rel="chapter" href="igraph-Layout.html" title="Chapter 29. Generating layouts for graph drawing">
<link rel="chapter" href="igraph-Processes.html" title="Chapter 30. Processes on graphs">
<link rel="chapter" href="igraph-Foreign.html" title="Chapter 31. Reading and writing graphs from and to files">
<link rel="chapter" href="igraph-Linalg.html" title="Chapter 32. Using BLAS, LAPACK and ARPACK for igraph matrices and graphs">
<link rel="chapter" href="igraph-Nongraph.html" title="Chapter 33. Non-graph related functions">
<link rel="chapter" href="igraph-Advanced.html" title="Chapter 34. Advanced igraph programming">
<link rel="chapter" href="igraph-Glossary.html" title="Chapter 35. Glossary">
<link rel="chapter" href="igraph-Licenses.html" title="Chapter 36. Licenses for igraph and this manual">
<link rel="index" href="ix01.html" title="Index">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navigation-header mb-4" width="100%" summary="Navigation header"><div class="btn-group">
<a accesskey="p" class="btn btn-light" href="igraph-Introduction.html"><i class="fa fa-chevron-left"></i>
Previous
</a><a accesskey="h" class="btn btn-light" href="index.html"><i class="fa fa-home"></i>
Home
</a><a accesskey="n" class="btn btn-light" href="igraph-Tutorial.html"><i class="fa fa-chevron-right"></i>
Next
</a>
</div></div>
<div class="chapter">
<div class="titlepage"><div><div><h1 class="title">
<a name="igraph-Installation"></a>Chapter 2. Installation</h1></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="igraph-Installation.html#igraph-Installation-prerequisites">1. Prerequisites</a></span></dt>
<dt><span class="section"><a href="igraph-Installation.html#igraph-Installation-installation">2. Installation</a></span></dt>
<dt><span class="section"><a href="igraph-Installation.html#igraph-Installation-building-the-documentation">3. Building the documentation</a></span></dt>
<dt><span class="section"><a href="igraph-Installation.html#igraph-Installation-notes-for-package-maintainers">4. Notes for package maintainers</a></span></dt>
</dl></div>
<p>
This chapter describes building igraph from source code and installing it.
The source archive of the latest stable release is always available
<a class="ulink" href="https://igraph.org/c/#downloads" target="_top">from the igraph website</a>.
igraph is also included in many Linux distributions, as well as several package
managers such as <a class="ulink" href="https://vcpkg.io/" target="_top">vcpkg</a> (convenient on Windows),
<a class="ulink" href="https://www.macports.org/" target="_top">MacPorts</a> (macOS) and
<a class="ulink" href="https://brew.sh/" target="_top">Homebrew</a> (macOS), which provide an easier
means of installation. If you decide to use them, please consult their documentation
on how to install packages.
</p>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="igraph-Installation-prerequisites"></a>1. Prerequisites</h2></div></div></div>
<p>
To build igraph from sources, you will need at least:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>
<a class="ulink" href="https://cmake.org" target="_top">CMake</a> 3.18 or later
</p></li>
<li class="listitem"><p>
C and C++ compilers
</p></li>
</ul></div>
<p>
Visual Studio 2015 and later are supported. Earlier Visual Studio
versions may or may not work.
</p>
<p>
Certain features also require the following libraries:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
<a class="ulink" href="http://www.xmlsoft.org/" target="_top">libxml2</a>,
required for GraphML support
</p></li></ul></div>
<p>
igraph bundles a number of libraries for convenience. However, it is
preferable to use external versions of these libraries, which may
improve performance. These are:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>
<a class="ulink" href="https://gmplib.org/" target="_top">GMP</a> (the bundled
alternative is Mini-GMP)
</p></li>
<li class="listitem"><p>
<a class="ulink" href="https://www.gnu.org/software/glpk/" target="_top">GLPK</a> (version 4.57 or later)
</p></li>
<li class="listitem"><p>
<a class="ulink" href="https://github.com/opencollab/arpack-ng" target="_top">ARPACK</a>
</p></li>
<li class="listitem"><p>
<a class="ulink" href="https://github.com/ntamas/plfit" target="_top">plfit</a>
</p></li>
<li class="listitem"><p>
A library providing a
<a class="ulink" href="https://www.netlib.org/blas/" target="_top">BLAS</a> API
(available by default on macOS;
<a class="ulink" href="http://www.openmathlib.org/OpenBLAS/" target="_top">OpenBLAS</a> is one
option on other systems)
</p></li>
<li class="listitem"><p>
A library providing a
<a class="ulink" href="https://www.netlib.org/lapack/" target="_top">LAPACK</a>
API (available by default on macOS;
<a class="ulink" href="http://www.openmathlib.org/OpenBLAS/" target="_top">OpenBLAS</a> is one
option on other systems)
</p></li>
</ul></div>
<p>
When building the development version of igraph,
<code class="literal">bison</code>, <code class="literal">flex</code> and
<code class="literal">git</code> are also required. Released versions do not
require these tools.
</p>
<p>
To run the tests, <code class="literal">diff</code> is also required.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="igraph-Installation-installation"></a>2. Installation</h2></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="igraph-Installation.html#igraph-Installation-general-build-instructions">2.1. General build instructions</a></span></dt>
<dt><span class="section"><a href="igraph-Installation.html#igraph-Installation-specific-instructions-for-windows">2.2. Specific instructions for Windows</a></span></dt>
<dt><span class="section"><a href="igraph-Installation.html#igraph-Installation-notable-configuration-options">2.3. Notable configuration options</a></span></dt>
</dl></div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="igraph-Installation-general-build-instructions"></a>2.1. General build instructions</h3></div></div></div>
<p>
igraph uses a
<a class="ulink" href="https://cmake.org/cmake/help/latest/guide/user-interaction/index.html" target="_top">CMake-based
build system</a>. To compile it,
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem">
<p>
Enter the directory where the igraph sources are:
</p>
<pre class="programlisting">
$ cd igraph
</pre>
<p>
</p>
</li>
<li class="listitem">
<p>
Create a new directory. This is where igraph will be built:
</p>
<pre class="programlisting">
$ mkdir build
$ cd build
</pre>
<p>
</p>
</li>
<li class="listitem">
<p>
Run CMake, which will automatically configure igraph, and
report the configuration:
</p>
<pre class="programlisting">
$ cmake ..
</pre>
<p>
To set a non-default installation location, such as
<code class="literal">/opt/local</code>, use:
</p>
<pre class="programlisting">cmake .. -DCMAKE_INSTALL_PREFIX=/opt/local</pre>
<p>
</p>
</li>
<li class="listitem"><p>
Check the output carefully, and ensure that all features you
need are enabled. If CMake could not find certain libraries,
some features such as GraphML support may have been
automatically disabled.
</p></li>
<li class="listitem">
<p>
There are several ways to adjust the configuration:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; ">
<li class="listitem"><p>
Run <code class="literal">ccmake .</code> on Unix-like systems or
<code class="literal">cmake-gui</code> on Windows for a convenient
interface.
</p></li>
<li class="listitem"><p>
Simply edit the <code class="literal">CMakeCache.txt</code> file.
Some of the relevant options are listed below.
</p></li>
</ul></div>
</li>
<li class="listitem"><p>
Once the configuration has been adjusted, run
<code class="literal">cmake ..</code> again.
</p></li>
<li class="listitem">
<p>
Once igraph has been successfully configured, it can be built,
tested and installed using:
</p>
<pre class="programlisting">
$ cmake --build .
$ cmake --build . --target check
$ cmake --install .
</pre>
<p>
</p>
</li>
</ul></div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="igraph-Installation-specific-instructions-for-windows"></a>2.2. Specific instructions for Windows</h3></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="igraph-Installation.html#igraph-Installation-microsoft-visual-studio">2.2.1. Microsoft Visual Studio</a></span></dt>
<dt><span class="section"><a href="igraph-Installation.html#igraph-Installation-msys2">2.2.2. MSYS2</a></span></dt>
</dl></div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="igraph-Installation-microsoft-visual-studio"></a>2.2.1. Microsoft Visual Studio</h4></div></div></div>
<p>
With Visual Studio, the steps to build igraph are generally the
same as above. However, since the Visual Studio CMake generator is
a multi-configuration one, we must specify the configuration
(typically Release or Debug) with each build command using the
<code class="literal">--config</code> option:
</p>
<pre class="programlisting">
mkdir build
cd build
cmake ..
cmake --build . --config Release
cmake --build . --target check --config Release
</pre>
<p>
When building the development version, <code class="literal">bison</code>
and <code class="literal">flex</code> must be available on the system.
<a class="ulink" href="https://github.com/lexxmark/winflexbison" target="_top"><code class="literal">winflexbison</code></a>
for Bison version 3.x can be useful for this purpose—make sure
that the executables are in the system <code class="literal">PATH</code>.
The easiest installation option is probably by installing
<code class="literal">winflexbison3</code> from the
<a class="ulink" href="https://chocolatey.org/packages/winflexbison3" target="_top">Chocolatey
package manager</a>.
</p>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="igraph-Installation-vcpkg"></a>2.2.1.1. vcpkg</h5></div></div></div>
<p>
Most external dependencies can be conveniently installed using
<a class="ulink" href="https://github.com/microsoft/vcpkg#quick-start-windows" target="_top"><code class="literal">vcpkg</code></a>.
Note that <code class="literal">igraph</code> bundles all dependencies
except <code class="literal">libxml2</code>, which is needed for GraphML
support.
</p>
<p>
In order to use vcpkg integrate it in the build environment by executing
<code class="literal">vcpkg.exe integrate install</code> on the command line.
When configuring igraph, point CMake to the correct
<code class="literal">vcpkg.cmake</code> file using <code class="literal">-DCMAKE_TOOLCHAIN_FILE=...</code>,
as instructed.
</p>
<p>
Additionally, it might be that you need to set the appropriate
so-called triplet using
<code class="literal">-DVCPKG_TARGET_TRIPLET</code> when running
<code class="literal">cmake</code>, for exampling, setting it to
<code class="literal">x64-windows</code> when using shared builds of packages or
<code class="literal">x64-windows-static</code> when using static builds.
Similarly, you also need to specify this target triplet when
installing packages. For example, to install
<code class="literal">libxml2</code> as a shared library, use
<code class="literal">vcpkg.exe install libxml2:x64-windows</code> and to
install <code class="literal">libxml2</code> as a static library, use
<code class="literal">vcpkg.exe install libxml2:x64-windows-static</code>.
In addition, there is the possibility to use a static library
with dynamic runtime linking using the
<code class="literal">x64-windows-static-md</code> triplet.
</p>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="igraph-Installation-msys2"></a>2.2.2. MSYS2</h4></div></div></div>
<p>
MSYS2 can be installed from <a class="ulink" href="https://www.msys2.org/" target="_top">msys2.org</a>. After installing MSYS2,
ensure that it is up to date by opening a terminal and running
<code class="literal">pacman -Syuu</code>.
</p>
<p>
The instructions below assume that you want to compile for a 64-bit
target.
</p>
<p>
Install the following packages using <code class="literal">pacman -S</code>.
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>
Minimal requirements:
<code class="literal">mingw-w64-x86_64-toolchain</code>,
<code class="literal">mingw-w64-x86_64-cmake</code>.
</p></li>
<li class="listitem"><p>
Optional dependencies that enable certain features:
<code class="literal">mingw-w64-x86_64-gmp</code>,
<code class="literal">mingw-w64-x86_64-libxml2</code>
</p></li>
<li class="listitem"><p>
Optional external libraries for better performance:
<code class="literal">mingw-w64-x86_64-openblas</code>,
<code class="literal">mingw-w64-x86_64-arpack</code>,
<code class="literal">mingw-w64-x86_64-glpk</code>
</p></li>
<li class="listitem"><p>
Only needed for running the tests: <code class="literal">diffutils</code>
</p></li>
<li class="listitem"><p>
Required only when building the development version:
<code class="literal">git</code>, <code class="literal">bison</code>,
<code class="literal">flex</code>
</p></li>
</ul></div>
<p>
The following command will install of these at once:
</p>
<pre class="programlisting">
pacman -S \
mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake \
mingw-w64-x86_64-gmp mingw-w64-x86_64-libxml2 \
mingw-w64-x86_64-openblas mingw-w64-x86_64-arpack \
mingw-w64-x86_64-glpk diffutils git bison flex
</pre>
<p>
In order to build igraph, follow the <span class="strong"><strong>General
build instructions</strong></span> above, paying attention to the
following:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>
When using MSYS2, start the <span class="quote"><span class="quote">MSYS2 MinGW 64-bit</span></span>
terminal, and <span class="emphasis"><em>not</em></span> the <span class="quote"><span class="quote">MSYS2
MSYS</span></span> one.
</p></li>
<li class="listitem"><p>
Be sure to install the <code class="literal">mingw-w64-x86_64-cmake</code>
package and not the <code class="literal">cmake</code> one. The latter
will not work.
</p></li>
<li class="listitem"><p>
When running <code class="literal">cmake</code>, pass the option
<code class="literal">-G"MSYS Makefiles"</code>.
</p></li>
<li class="listitem"><p>
Note that <code class="literal">ccmake</code> is not currently available.
<code class="literal">cmake-gui</code> can be used only if the
<code class="literal">mingw-w64-x86_64-qt5</code> package is installed.
</p></li>
</ul></div>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="igraph-Installation-notable-configuration-options"></a>2.3. Notable configuration options</h3></div></div></div>
<p>
The following options may be set to <code class="literal">ON</code> or
<code class="literal">OFF</code>. Some of them have an <code class="literal">AUTO</code>
setting, which chooses a reasonable default based on what libraries
are available on the current system.
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>
igraph bundles some of its dependencies for convenience. The
<code class="literal">IGRAPH_USE_INTERNAL_XXX</code> flags control whether
these should be used instead of external versions. Set them to
<code class="literal">ON</code> to use the bundled
(<span class="quote"><span class="quote">vendored</span></span>) versions. Generally, external versions
are preferable as they may be newer and usually provide better
performance.
</p></li>
<li class="listitem"><p>
<code class="literal">IGRAPH_GLPK_SUPPORT</code>: whether to make use of
the
<a class="ulink" href="https://www.gnu.org/software/glpk/" target="_top">GLPK</a>
library. Some features, such as finding a minimum feedback arc
set or finding communities through exact modularity
optimization, require this.
</p></li>
<li class="listitem"><p>
<code class="literal">IGRAPH_GRAPHML_SUPPORT</code>: whether to enable
support for reading and writing
<a class="ulink" href="http://graphml.graphdrawing.org/" target="_top">GraphML</a>
files. Requires the
<a class="ulink" href="http://xmlsoft.org/" target="_top">libxml2</a> library.
</p></li>
<li class="listitem"><p>
<code class="literal">IGRAPH_INFOMAP_SUPPORT</code>: whether to enable
the Infomap community detection algorithm. The Infomap library
is licensed under the GPLv3+. Compiling it into igraph causes
GPLv3+ to apply to the resulting binary, instead of igraph's
GPLv2+ license.
</p></li>
<li class="listitem"><p>
<code class="literal">IGRAPH_OPENMP_SUPPORT</code>: whether to use OpenMP
parallelization to accelerate certain functions such as PageRank
calculation. Compiler support is required.
</p></li>
<li class="listitem"><p>
<code class="literal">IGRAPH_ENABLE_LTO</code>: whether to build igraph
with link-time optimization, which improves performance. Not
supported with all compilers.
</p></li>
<li class="listitem"><p>
<code class="literal">IGRAPH_ENABLE_TLS</code>: whether to enable
thread-local storage. Required when using igraph from multiple
threads.
</p></li>
<li class="listitem"><p>
<code class="literal">IGRAPH_WARNINGS_AS_ERRORS</code>: whether to treat
compiler warnings as errors. We strive to eliminate all compiler
warnings during development so this switch is turned on by default.
If your compiler prints warnings for some parts of the code that we
did not anticipate, you can turn off this option to prevent the
warnings from stopping the compilation.
</p></li>
<li class="listitem"><p>
<a class="ulink" href="https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html" target="_top"><code class="literal">BUILD_SHARED_LIBS</code></a>:
whether to build a shared library instead of a static one.
</p></li>
<li class="listitem"><p>
<code class="literal">BLA_VENDOR</code>: controls which library to use for
<a class="ulink" href="https://cmake.org/cmake/help/latest/module/FindBLAS.html" target="_top">BLAS</a>
and
<a class="ulink" href="https://cmake.org/cmake/help/latest/module/FindLAPACK.html" target="_top">LAPACK</a>
functionality.
</p></li>
<li class="listitem"><p>
<a class="ulink" href="https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html" target="_top"><code class="literal">CMAKE_INSTALL_PREFIX</code></a>:
the location where igraph will be installed.
</p></li>
</ul></div>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="igraph-Installation-building-the-documentation"></a>3. Building the documentation</h2></div></div></div>
<p>
Most users will not need to build the documentation, as the release
tarball contains pre-built HTML documentation in the <code class="literal">doc</code>
directory.
</p>
<p>
To build the documentation for the development version, simply build the
<code class="literal">html</code>, <code class="literal">pdf</code> or <code class="literal">info</code>
targets for the HTML, PDF and Info versions of the documentation,
respectively.
</p>
<pre class="programlisting">
$ cmake --build . --target html
</pre>
<p>
Building the HTML documentation requires Python 3, <code class="literal">xmlto</code>
and <code class="literal">source-highlight</code>. On some platforms, it is necessary
to explicitly install the docbook-xsl package as well. Building the PDF
documentation also requires <code class="literal">xsltproc</code>,
<code class="literal">xmllint</code> and <code class="literal">fop</code>. Building the Texinfo
documentation also requires the docbook2X package, <code class="literal">xmllint</code>
and <code class="literal">makeinfo</code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="igraph-Installation-notes-for-package-maintainers"></a>4. Notes for package maintainers</h2></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="igraph-Installation.html#igraph-Installation-auto-detection-of-dependencies">4.1. Auto-detection of dependencies</a></span></dt>
<dt><span class="section"><a href="igraph-Installation.html#igraph-Installation-shared-and-static-builds">4.2. Shared and static builds</a></span></dt>
<dt><span class="section"><a href="igraph-Installation.html#igraph-Installation-cross-compiling">4.3. Cross-compiling</a></span></dt>
<dt><span class="section"><a href="igraph-Installation.html#igraph-Installation-additional-notes">4.4. Additional notes</a></span></dt>
</dl></div>
<p>
This section is for people who package igraph for Linux distros or
other package managers. Please read it carefully before packaging
igraph.
</p>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="igraph-Installation-auto-detection-of-dependencies"></a>4.1. Auto-detection of dependencies</h3></div></div></div>
<p>
igraph bundles several of its dependencies (or simplified versions
of its dependencies). During configuration time, it checks whether
each dependency is present on the system. If yes, it uses it.
Otherwise, it falls back to the bundled (<span class="quote"><span class="quote">vendored</span></span>)
version. In order to make configuration as deterministic as
possible, you may want to disable this auto-detection. To do so, set
each of the <code class="literal">IGRAPH_USE_INTERNAL_XXX</code> options
described above. Additionally, set <code class="literal">BLA_VENDOR</code> to
use the BLAS and LAPACK implementations of your choice. This should
be the same BLAS and LAPACK library that igraph's other dependencies
(e.g., ARPACK) are linked against.
</p>
<p>
For example, to force igraph to use external versions of all
dependencies except plfit, and to use OpenBLAS for BLAS/LAPACK, use
</p>
<p>
</p>
<pre class="programlisting">
$ cmake .. \
-DIGRAPH_USE_INTERNAL_BLAS=OFF \
-DIGRAPH_USE_INTERNAL_LAPACK=OFF \
-DIGRAPH_USE_INTERNAL_ARPACK=OFF \
-DIGRAPH_USE_INTERNAL_GLPK=OFF \
-DIGRAPH_USE_INTERNAL_GMP=OFF \
-DIGRAPH_USE_INTERNAL_PLFIT=ON \
-DBLA_VENDOR=OpenBLAS \
-DIGRAPH_GRAPHML_SUPPORT=ON
</pre>
<p>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="igraph-Installation-shared-and-static-builds"></a>4.2. Shared and static builds</h3></div></div></div>
<p>
On Windows, shared and static builds should not be installed in the same
location. If you decide to do so anyway, keep in mind the following:
Both builds contain an <code class="literal">igraph.lib</code> file. The static one
should be renamed to avoid conflict. The headers from the static build
are incompatible with the shared library. The headers from the shared build
may be used with the static library, but <code class="literal">IGRAPH_STATIC</code>
must be defined when compiling programs that will link to igraph statically.
</p>
<p>
These issues do not affect Unix-like systems.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="igraph-Installation-cross-compiling"></a>4.3. Cross-compiling</h3></div></div></div>
<p>
When building igraph with an internal ARPACK, LAPACK or BLAS, it
makes use of f2c, which compiles and runs the <code class="literal">arithchk</code>
program at build time to detect the floating point characteristics of the
current system. It writes the results into the <code class="literal">arith.h</code>
header. However, running this program is not possible when cross-compiling
without providing a userspace emulator that can run executables of the
target platform on the host system. Therefore, when cross-compiling, you
either need to provide such an emulator with the
<code class="literal">CMAKE_CROSSCOMPILING_EMULATOR</code> option, or you need to
specify a pre-generated version of the <code class="literal">arith.h</code> header
file through the <code class="literal">F2C_EXTERNAL_ARITH_HEADER</code>
CMake option. An example version of this header follows for the
x86_64 and arm64 target architectures on macOS. Warning: Do not use this
version of <code class="literal">arith.h</code> on other systems or architectures.
</p>
<p>
</p>
<pre class="programlisting">
#define IEEE_8087
#define Arith_Kind_ASL 1
#define Long int
#define Intcast (int)(long)
#define Double_Align
#define X64_bit_pointers
#define NANCHECK
#define QNaN0 0x0
#define QNaN1 0x7ff80000
</pre>
<p>
</p>
<p>
igraph also checks whether the endianness of <code class="literal">uint64_t</code>
matches the endianness of <code class="literal">double</code> on the platform
being compiled. This is needed to ensure that certain functions in igraph's
random number generator work properly. However, it is not possible to
execute this check when cross-compiling without an emulator, so in this
case igraph simply assumes that the endianness matches (which is the case
for the vast majority of platforms anyway). The only case where you might
run into problems is when you cross-compile for Apple Silicon
(<code class="literal">arm64</code>) from an Intel-based Mac, in which case CMake
might not realize that you are cross-compiling and will try to execute
the check anyway. You can work around this by setting
<code class="literal">IEEE754_DOUBLE_ENDIANNESS_MATCHES</code> to <code class="literal">ON</code>
explicitly before invoking CMake.
</p>
<p>
Providing an emulator in <code class="literal">CMAKE_CROSSCOMPILING_EMULATOR</code>
has the added benefit that you can run the compiled unit tests on the
host platform. We have experimented with cross-compiling to 64-bit ARM
CPUs (<code class="literal">aarch64</code>) on 64-bit Intel CPUs (<code class="literal">amd64</code>),
and we can confirm that using <code class="literal">qemu-aarch64</code> works as a
cross-compiling emulator in this setup.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="igraph-Installation-additional-notes"></a>4.4. Additional notes</h3></div></div></div>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>
As of igraph 0.10, there is no tangible benefit to using an
external GMP, as igraph does not yet use GMP in any
performance-critical way. The bundled Mini-GMP is sufficient.
</p></li>
<li class="listitem"><p>
Link-time optimization noticeably improves the performance of
some igraph functions. To enable it, use
<code class="literal">-DIGRAPH_ENABLE_LTO=ON</code>.
The <code class="literal">AUTO</code> setting is also supported, and will
enable link-time optimization only if the current compiler
supports it. Note that this is detected by CMake, and the
detection is not always accurate.
</p></li>
<li class="listitem"><p>
We saw occasional hangs on Windows when igraph was built for a
32-bit target with MinGW and linked to OpenBLAS. We believe this
to be an issue with OpenBLAS, not igraph. On this platform, you
may want to opt for a different BLAS/LAPACK or the bundled
BLAS/LAPACK.
</p></li>
</ul></div>
</div>
</div>
</div>
<table class="navigation-footer" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle">
<td align="left"><a accesskey="p" href="igraph-Introduction.html"><b>← Chapter 1. Introduction</b></a></td>
<td align="right"><a accesskey="n" href="igraph-Tutorial.html"><b>Chapter 3. Tutorial →</b></a></td>
</tr></table>
</body>
</html>
@@ -0,0 +1,175 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Chapter 1. Introduction</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="igraph Reference Manual">
<link rel="up" href="index.html" title="igraph Reference Manual">
<link rel="prev" href="index.html" title="igraph Reference Manual">
<link rel="next" href="igraph-Installation.html" title="Chapter 2. Installation">
<script type="text/javascript" src="toggle.js"></script><link rel="stylesheet" href="style.css" type="text/css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css">
<link rel="chapter" href="igraph-Introduction.html" title="Chapter 1. Introduction">
<link rel="chapter" href="igraph-Installation.html" title="Chapter 2. Installation">
<link rel="chapter" href="igraph-Tutorial.html" title="Chapter 3. Tutorial">
<link rel="chapter" href="igraph-Basic.html" title="Chapter 4. Basic data types and interface">
<link rel="chapter" href="igraph-Error.html" title="Chapter 5. Error handling">
<link rel="chapter" href="igraph-Memory.html" title="Chapter 6. Memory (de)allocation">
<link rel="chapter" href="igraph-Data-structures.html" title="Chapter 7. Data structure library: vector, matrix, other data types">
<link rel="chapter" href="igraph-Random.html" title="Chapter 8. Random numbers">
<link rel="chapter" href="igraph-Iterators.html" title="Chapter 9. Vertex and edge selectors and sequences, iterators">
<link rel="chapter" href="igraph-Attributes.html" title="Chapter 10. Graph, vertex and edge attributes">
<link rel="chapter" href="igraph-Generators.html" title="Chapter 11. Deterministic graph generators">
<link rel="chapter" href="igraph-Games.html" title='Chapter 12. Stochastic graph generators ("games")'>
<link rel="chapter" href="igraph-Bipartite.html" title="Chapter 13. Bipartite, i.e. two-mode graphs">
<link rel="chapter" href="igraph-Spatial.html" title="Chapter 14. Spatial graphs">
<link rel="chapter" href="igraph-Operators.html" title="Chapter 15. Graph operators">
<link rel="chapter" href="igraph-Visitors.html" title="Chapter 16. Graph visitors">
<link rel="chapter" href="igraph-Structural.html" title="Chapter 17. Structural properties of graphs">
<link rel="chapter" href="igraph-Cycles.html" title="Chapter 18. Graph cycles">
<link rel="chapter" href="igraph-Cliques.html" title="Chapter 19. Cliques and independent vertex sets">
<link rel="chapter" href="igraph-Motifs.html" title="Chapter 20. Graph motifs, dyad census and triad census">
<link rel="chapter" href="igraph-Isomorphism.html" title="Chapter 21. Graph isomorphism">
<link rel="chapter" href="igraph-Coloring.html" title="Chapter 22. Graph coloring">
<link rel="chapter" href="igraph-Flows.html" title="Chapter 23. Maximum flows, minimum cuts and related measures">
<link rel="chapter" href="igraph-Separators.html" title="Chapter 24. Vertex separators">
<link rel="chapter" href="igraph-Community.html" title="Chapter 25. Detecting community structure">
<link rel="chapter" href="igraph-Graphlets.html" title="Chapter 26. Graphlets">
<link rel="chapter" href="igraph-HRG.html" title="Chapter 27. Hierarchical random graphs">
<link rel="chapter" href="igraph-Embedding.html" title="Chapter 28. Embedding of graphs">
<link rel="chapter" href="igraph-Layout.html" title="Chapter 29. Generating layouts for graph drawing">
<link rel="chapter" href="igraph-Processes.html" title="Chapter 30. Processes on graphs">
<link rel="chapter" href="igraph-Foreign.html" title="Chapter 31. Reading and writing graphs from and to files">
<link rel="chapter" href="igraph-Linalg.html" title="Chapter 32. Using BLAS, LAPACK and ARPACK for igraph matrices and graphs">
<link rel="chapter" href="igraph-Nongraph.html" title="Chapter 33. Non-graph related functions">
<link rel="chapter" href="igraph-Advanced.html" title="Chapter 34. Advanced igraph programming">
<link rel="chapter" href="igraph-Glossary.html" title="Chapter 35. Glossary">
<link rel="chapter" href="igraph-Licenses.html" title="Chapter 36. Licenses for igraph and this manual">
<link rel="index" href="ix01.html" title="Index">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navigation-header mb-4" width="100%" summary="Navigation header"><div class="btn-group">
<a accesskey="p" class="btn btn-light" href="index.html"><i class="fa fa-chevron-left"></i>
Previous
</a><a accesskey="h" class="btn btn-light" href="index.html"><i class="fa fa-home"></i>
Home
</a><a accesskey="n" class="btn btn-light" href="igraph-Installation.html"><i class="fa fa-chevron-right"></i>
Next
</a>
</div></div>
<div class="chapter">
<div class="titlepage"><div><div><h1 class="title">
<a name="igraph-Introduction"></a>Chapter 1. Introduction</h1></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="igraph-Introduction.html#igraph-is-free-software">1. igraph is free software</a></span></dt>
<dt><span class="section"><a href="igraph-Introduction.html#citing-igraph">2. Citing igraph</a></span></dt>
</dl></div>
<p>
igraph is a library for creating and manipulating graphs.
You can look at it in two ways: first, igraph contains the implementation
of quite a lot of graph algorithms. These include classic graph
algorithms like graph isomorphism, graph girth and connectivity and
also the new wave graph algorithms like transitivity, graph motifs and
community structure detection. Skim through the table of contents
or the index of this book to get an impression of what is available.</p>
<p>
Second, igraph provides a platform for developing and/or
implementing graph algorithms. It has an efficient data structure
for representing graphs, and a number of other data structures like
flexible vectors, stacks, heaps, queues, adjacency lists that are useful for implementing graph algorithms. In fact these data structures evolved along with the
implementation of the classic and non-classic graph algorithms which
make up the major part of the igraph library. This way, they were fine-tuned
and checked for correctness several times.
</p>
<p>
Our main goal with developing igraph was to create a graph library
which is efficient on large, but not extremely large graphs. More
precisely, it is assumed that the graph(s) fit into the physical
memory of the computer. Nowadays this means graphs with
several million vertices and/or edges. Our definition of efficient is
that it runs fast, both in theory and (more importantly) in practice.
</p>
<p>
We believe that one of the big strengths of igraph is that it can be
embedded into a higher-level language or environment. Three such
embeddings (or interfaces if you look at them another way)
are currently being developed by us: an R
package, a Python extension module, and a Mathematica (Wolfram Language) package. Others are
likely to come. High level languages such as R or Python make it
possible to use graph routines with much greater comfort, without
actually writing a single line of C code. They have some, usually very
small, speed penalty compared to the C version, but add ease of use and much
flexibility. This manual, however, covers only the C library. If you
want to use Python, R or the Wolfram Language, please see the documentation written
specifically for these interfaces and come back here only if you are
interested in some detail which is not covered in those documents.
</p>
<p>
We still consider igraph as a child project. It has much room for
development and we are sure that it will improve a lot in the near
future. Any feedback we can get from the users is very important for
us, as most of the time these questions and comments guide us in what
to add and what to improve.
</p>
<p>
igraph is open source and distributed under the terms of the GNU GPL
version 2 or (at your option) any later version.
We strongly believe that all the algorithms used in science, let that
be graph theory or not, should have an efficient open-source
implementation allowing use and modification for anyone.
</p>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="igraph-is-free-software"></a>1. igraph is free software</h2></div></div></div>
<p>
igraph library
</p>
<p>
Copyright (C) 2003-2004 Gábor Csárdi &lt;csardi.gabor@gmail.com&gt;
</p>
<p>
Copyright (C) 2005-2019 Gábor Csárdi &lt;csardi.gabor@gmail.com&gt; and Tamás Nepusz &lt;ntamas@gmail.com&gt;
</p>
<p>
Copyright (C) 2020-2023 The igraph development team
</p>
<p>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
</p>
<p>
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
</p>
<p>
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="citing-igraph"></a>2. Citing igraph</h2></div></div></div>
<p>
To cite igraph in publications, please use the following
reference:
</p>
<p>
Gábor Csárdi, Tamás Nepusz: The igraph software package for complex network
research. InterJournal Complex Systems, 1695, 2006.
</p>
<p>
The igraph C library is assigned the DOI <a class="ulink" href="https://doi.org/10.5281/zenodo.3630268" target="_top">10.5281/zenodo.3630268</a> on Zenodo.
</p>
</div>
</div>
<table class="navigation-footer" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle">
<td align="left"><a accesskey="p" href="index.html"><b>← igraph Reference Manual</b></a></td>
<td align="right"><a accesskey="n" href="igraph-Installation.html"><b>Chapter 2. Installation →</b></a></td>
</tr></table>
</body>
</html>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,994 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Chapter 36. Licenses for igraph and this manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="igraph Reference Manual">
<link rel="up" href="index.html" title="igraph Reference Manual">
<link rel="prev" href="igraph-Glossary.html" title="Chapter 35. Glossary">
<link rel="next" href="ix01.html" title="Index">
<script type="text/javascript" src="toggle.js"></script><link rel="stylesheet" href="style.css" type="text/css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css">
<link rel="chapter" href="igraph-Introduction.html" title="Chapter 1. Introduction">
<link rel="chapter" href="igraph-Installation.html" title="Chapter 2. Installation">
<link rel="chapter" href="igraph-Tutorial.html" title="Chapter 3. Tutorial">
<link rel="chapter" href="igraph-Basic.html" title="Chapter 4. Basic data types and interface">
<link rel="chapter" href="igraph-Error.html" title="Chapter 5. Error handling">
<link rel="chapter" href="igraph-Memory.html" title="Chapter 6. Memory (de)allocation">
<link rel="chapter" href="igraph-Data-structures.html" title="Chapter 7. Data structure library: vector, matrix, other data types">
<link rel="chapter" href="igraph-Random.html" title="Chapter 8. Random numbers">
<link rel="chapter" href="igraph-Iterators.html" title="Chapter 9. Vertex and edge selectors and sequences, iterators">
<link rel="chapter" href="igraph-Attributes.html" title="Chapter 10. Graph, vertex and edge attributes">
<link rel="chapter" href="igraph-Generators.html" title="Chapter 11. Deterministic graph generators">
<link rel="chapter" href="igraph-Games.html" title='Chapter 12. Stochastic graph generators ("games")'>
<link rel="chapter" href="igraph-Bipartite.html" title="Chapter 13. Bipartite, i.e. two-mode graphs">
<link rel="chapter" href="igraph-Spatial.html" title="Chapter 14. Spatial graphs">
<link rel="chapter" href="igraph-Operators.html" title="Chapter 15. Graph operators">
<link rel="chapter" href="igraph-Visitors.html" title="Chapter 16. Graph visitors">
<link rel="chapter" href="igraph-Structural.html" title="Chapter 17. Structural properties of graphs">
<link rel="chapter" href="igraph-Cycles.html" title="Chapter 18. Graph cycles">
<link rel="chapter" href="igraph-Cliques.html" title="Chapter 19. Cliques and independent vertex sets">
<link rel="chapter" href="igraph-Motifs.html" title="Chapter 20. Graph motifs, dyad census and triad census">
<link rel="chapter" href="igraph-Isomorphism.html" title="Chapter 21. Graph isomorphism">
<link rel="chapter" href="igraph-Coloring.html" title="Chapter 22. Graph coloring">
<link rel="chapter" href="igraph-Flows.html" title="Chapter 23. Maximum flows, minimum cuts and related measures">
<link rel="chapter" href="igraph-Separators.html" title="Chapter 24. Vertex separators">
<link rel="chapter" href="igraph-Community.html" title="Chapter 25. Detecting community structure">
<link rel="chapter" href="igraph-Graphlets.html" title="Chapter 26. Graphlets">
<link rel="chapter" href="igraph-HRG.html" title="Chapter 27. Hierarchical random graphs">
<link rel="chapter" href="igraph-Embedding.html" title="Chapter 28. Embedding of graphs">
<link rel="chapter" href="igraph-Layout.html" title="Chapter 29. Generating layouts for graph drawing">
<link rel="chapter" href="igraph-Processes.html" title="Chapter 30. Processes on graphs">
<link rel="chapter" href="igraph-Foreign.html" title="Chapter 31. Reading and writing graphs from and to files">
<link rel="chapter" href="igraph-Linalg.html" title="Chapter 32. Using BLAS, LAPACK and ARPACK for igraph matrices and graphs">
<link rel="chapter" href="igraph-Nongraph.html" title="Chapter 33. Non-graph related functions">
<link rel="chapter" href="igraph-Advanced.html" title="Chapter 34. Advanced igraph programming">
<link rel="chapter" href="igraph-Glossary.html" title="Chapter 35. Glossary">
<link rel="chapter" href="igraph-Licenses.html" title="Chapter 36. Licenses for igraph and this manual">
<link rel="index" href="ix01.html" title="Index">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navigation-header mb-4" width="100%" summary="Navigation header"><div class="btn-group">
<a accesskey="p" class="btn btn-light" href="igraph-Glossary.html"><i class="fa fa-chevron-left"></i>
Previous
</a><a accesskey="h" class="btn btn-light" href="index.html"><i class="fa fa-home"></i>
Home
</a><a accesskey="n" class="btn btn-light" href="ix01.html"><i class="fa fa-chevron-right"></i>
Next
</a>
</div></div>
<div class="chapter">
<div class="titlepage"><div><div><h1 class="title">
<a name="igraph-Licenses"></a>Chapter 36. Licenses for igraph and this manual</h1></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="igraph-Licenses.html#igraph-gpl">1. THE GNU GENERAL PUBLIC LICENSE</a></span></dt>
<dt><span class="section"><a href="igraph-Licenses.html#igraph-fdl">2. The GNU Free Documentation License</a></span></dt>
</dl></div>
<div class="section">
<div class="titlepage"><div>
<div><h2 class="title" style="clear: both">
<a name="igraph-gpl"></a>1. THE GNU GENERAL PUBLIC LICENSE</h2></div>
<div><p class="copyright">Copyright © 1989, 1991 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
</p></div>
<div><div class="legalnotice">
<a name="id-1.37.2.1.3"></a><p>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
</p>
</div></div>
</div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="igraph-Licenses.html#id-1.37.2.3">1.1. Preamble</a></span></dt>
<dt><span class="section"><a href="igraph-Licenses.html#sectiongpl">1.2. GNU GENERAL PUBLIC LICENSE</a></span></dt>
<dt><span class="section"><a href="igraph-Licenses.html#id-1.37.2.5">1.3. How to Apply These Terms to Your New Programs</a></span></dt>
</dl></div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="id-1.37.2.3"></a>1.1. Preamble</h3></div></div></div>
<p>
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
</p>
<p>
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
</p>
<p>
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
</p>
<p>
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
</p>
<p>
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
</p>
<p>
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
</p>
<p>
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
</p>
<p>
The precise terms and conditions for copying, distribution and
modification follow.
</p>
</div>
<div class="section">
<div class="titlepage"><div>
<div><h3 class="title">
<a name="sectiongpl"></a>1.2. GNU GENERAL PUBLIC LICENSE</h3></div>
<div><h4 class="subtitle">TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</h4></div>
</div></div>
<p>
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
</p>
<p>
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
</p>
<p>
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
</p>
<p>
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
</p>
<p>
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
</p>
<div class="orderedlist"><ol class="orderedlist" type="a">
<li class="listitem"><p>
You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
</p></li>
<li class="listitem"><p>
You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
</p></li>
<li class="listitem"><p>
If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
</p></li>
</ol></div>
<p>
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
</p>
<p>
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
</p>
<p>
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
</p>
<p>
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
</p>
<div class="orderedlist"><ol class="orderedlist" type="a">
<li class="listitem"><p>
Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
</p></li>
<li class="listitem"><p>
Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
</p></li>
<li class="listitem"><p>
Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
</p></li>
</ol></div>
<p>
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
</p>
<p>
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
</p>
<p>
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
</p>
<p>
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
</p>
<p>
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
</p>
<p>
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
</p>
<p>
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
</p>
<p>
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
</p>
<p>
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
</p>
<p>
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
</p>
<p>
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
</p>
<p>
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
</p>
<p>
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
</p>
<p>
NO WARRANTY
</p>
<p>
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
</p>
<p>
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
</p>
<p>
END OF TERMS AND CONDITIONS
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="id-1.37.2.5"></a>1.3. How to Apply These Terms to Your New Programs</h3></div></div></div>
<p>
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
</p>
<p>
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
</p>
<div class="literallayout"><p><br>
    &lt;one line to give the program's name and a brief idea of what it does.&gt;<br>
    Copyright (C) &lt;year&gt;  &lt;name of author&gt;<br>
<br>
    This program is free software; you can redistribute it and/or modify<br>
    it under the terms of the GNU General Public License as published by<br>
    the Free Software Foundation; either version 2 of the License, or<br>
    (at your option) any later version.<br>
<br>
    This program is distributed in the hope that it will be useful,<br>
    but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the<br>
    GNU General Public License for more details.<br>
<br>
    You should have received a copy of the GNU General Public License<br>
    along with this program; if not, write to the Free Software<br>
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA<br>
</p></div>
<p>
Also add information on how to contact you by electronic and paper mail.
</p>
<p>
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
</p>
<div class="literallayout"><p><br>
    Gnomovision version 69, Copyright (C) year name of author<br>
    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.<br>
    This is free software, and you are welcome to redistribute it<br>
    under certain conditions; type `show c' for details.<br>
</p></div>
<p>
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
</p>
<p>
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
</p>
<div class="literallayout"><p><br>
  Yoyodyne, Inc., hereby disclaims all copyright interest in the program<br>
  `Gnomovision' (which makes passes at compilers) written by James Hacker.<br>
<br>
  &lt;signature of Ty Coon&gt;, 1 April 1989<br>
  Ty Coon, President of Vice<br>
</p></div>
<p>
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
</p>
</div>
</div>
<div class="section">
<div class="titlepage"><div>
<div><h2 class="title" style="clear: both">
<a name="igraph-fdl"></a>2. The GNU Free Documentation License</h2></div>
<div><p class="copyright">Copyright © 2000, 2001, 2002 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
</p></div>
<div><div class="legalnotice">
<a name="id-1.37.3.1.3"></a><p>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
</p>
</div></div>
</div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="igraph-Licenses.html#id-1.37.3.3">2.1. 0. PREAMBLE</a></span></dt>
<dt><span class="section"><a href="igraph-Licenses.html#id-1.37.3.4">2.2. 1. APPLICABILITY AND DEFINITIONS</a></span></dt>
<dt><span class="section"><a href="igraph-Licenses.html#id-1.37.3.5">2.3. 2. VERBATIM COPYING</a></span></dt>
<dt><span class="section"><a href="igraph-Licenses.html#id-1.37.3.6">2.4. 3. COPYING IN QUANTITY</a></span></dt>
<dt><span class="section"><a href="igraph-Licenses.html#id-1.37.3.7">2.5. 4. MODIFICATIONS</a></span></dt>
<dt><span class="section"><a href="igraph-Licenses.html#id-1.37.3.8">2.6. 5. COMBINING DOCUMENTS</a></span></dt>
<dt><span class="section"><a href="igraph-Licenses.html#id-1.37.3.9">2.7. 6. COLLECTIONS OF DOCUMENTS</a></span></dt>
<dt><span class="section"><a href="igraph-Licenses.html#id-1.37.3.10">2.8. 7. AGGREGATION WITH INDEPENDENT WORKS</a></span></dt>
<dt><span class="section"><a href="igraph-Licenses.html#id-1.37.3.11">2.9. 8. TRANSLATION</a></span></dt>
<dt><span class="section"><a href="igraph-Licenses.html#id-1.37.3.12">2.10. 9. TERMINATION</a></span></dt>
<dt><span class="section"><a href="igraph-Licenses.html#id-1.37.3.13">2.11. 10. FUTURE REVISIONS OF THIS LICENSE</a></span></dt>
<dt><span class="section"><a href="igraph-Licenses.html#id-1.37.3.14">2.12. G.1.1 ADDENDUM: How to use this License for your documents</a></span></dt>
</dl></div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="id-1.37.3.3"></a>2.1. 0. PREAMBLE</h3></div></div></div>
<p>
The purpose of this License is to make a manual, textbook, or other
functional and useful document "free" in the sense of freedom: to
assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or noncommercially.
Secondarily, this License preserves for the author and publisher a way
to get credit for their work, while not being considered responsible
for modifications made by others.
</p>
<p>
This License is a kind of "copyleft", which means that derivative
works of the document must themselves be free in the same sense. It
complements the GNU General Public License, which is a copyleft
license designed for free software.
</p>
<p>
We have designed this License in order to use it for manuals for free
software, because free software needs free documentation: a free
program should come with manuals providing the same freedoms that the
software does. But this License is not limited to software manuals;
it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book. We recommend this License
principally for works whose purpose is instruction or reference.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="id-1.37.3.4"></a>2.2. 1. APPLICABILITY AND DEFINITIONS</h3></div></div></div>
<p>
This License applies to any manual or other work, in any medium, that
contains a notice placed by the copyright holder saying it can be
distributed under the terms of this License. Such a notice grants a
world-wide, royalty-free license, unlimited in duration, to use that
work under the conditions stated herein. The "Document", below,
refers to any such manual or work. Any member of the public is a
licensee, and is addressed as "you". You accept the license if you
copy, modify or distribute the work in a way requiring permission
under copyright law.
</p>
<p>
A "Modified Version" of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
</p>
<p>
A "Secondary Section" is a named appendix or a front-matter section of
the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document's overall subject
(or to related matters) and contains nothing that could fall directly
within that overall subject. (Thus, if the Document is in part a
textbook of mathematics, a Secondary Section may not explain any
mathematics.) The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.
</p>
<p>
The "Invariant Sections" are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
that says that the Document is released under this License. If a
section does not fit the above definition of Secondary then it is not
allowed to be designated as Invariant. The Document may contain zero
Invariant Sections. If the Document does not identify any Invariant
Sections then there are none.
</p>
<p>
The "Cover Texts" are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
the Document is released under this License. A Front-Cover Text may
be at most 5 words, and a Back-Cover Text may be at most 25 words.
</p>
<p>
A "Transparent" copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters. A copy made in an otherwise Transparent file
format whose markup, or absence of markup, has been arranged to thwart
or discourage subsequent modification by readers is not Transparent.
An image format is not Transparent if used for any substantial amount
of text. A copy that is not "Transparent" is called "Opaque".
</p>
<p>
Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, LaTeX input format, SGML
or XML using a publicly available DTD, and standard-conforming simple
HTML, PostScript or PDF designed for human modification. Examples of
transparent image formats include PNG, XCF and JPG. Opaque formats
include proprietary formats that can be read and edited only by
proprietary word processors, SGML or XML for which the DTD and/or
processing tools are not generally available, and the
machine-generated HTML, PostScript or PDF produced by some word
processors for output purposes only.
</p>
<p>
The "Title Page" means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
this License requires to appear in the title page. For works in
formats which do not have any title page as such, "Title Page" means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.
</p>
<p>
A section "Entitled XYZ" means a named subunit of the Document whose
title either is precisely XYZ or contains XYZ in parentheses following
text that translates XYZ in another language. (Here XYZ stands for a
specific section name mentioned below, such as "Acknowledgements",
"Dedications", "Endorsements", or "History".) To "Preserve the Title"
of such a section when you modify the Document means that it remains a
section "Entitled XYZ" according to this definition.
</p>
<p>
The Document may include Warranty Disclaimers next to the notice which
states that this License applies to the Document. These Warranty
Disclaimers are considered to be included by reference in this
License, but only as regards disclaiming warranties: any other
implication that these Warranty Disclaimers may have is void and has
no effect on the meaning of this License.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="id-1.37.3.5"></a>2.3. 2. VERBATIM COPYING</h3></div></div></div>
<p>
You may copy and distribute the Document in any medium, either
commercially or noncommercially, provided that this License, the
copyright notices, and the license notice saying this License applies
to the Document are reproduced in all copies, and that you add no other
conditions whatsoever to those of this License. You may not use
technical measures to obstruct or control the reading or further
copying of the copies you make or distribute. However, you may accept
compensation in exchange for copies. If you distribute a large enough
number of copies you must also follow the conditions in section 3.
</p>
<p>
You may also lend copies, under the same conditions stated above, and
you may publicly display copies.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="id-1.37.3.6"></a>2.4. 3. COPYING IN QUANTITY</h3></div></div></div>
<p>
If you publish printed copies (or copies in media that commonly have
printed covers) of the Document, numbering more than 100, and the
Document's license notice requires Cover Texts, you must enclose the
copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover. Both covers must also clearly and legibly identify
you as the publisher of these copies. The front cover must present
the full title with all words of the title equally prominent and
visible. You may add other material on the covers in addition.
Copying with changes limited to the covers, as long as they preserve
the title of the Document and satisfy these conditions, can be treated
as verbatim copying in other respects.
</p>
<p>
If the required texts for either cover are too voluminous to fit
legibly, you should put the first ones listed (as many as fit
reasonably) on the actual cover, and continue the rest onto adjacent
pages.
</p>
<p>
If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
a computer-network location from which the general network-using
public has access to download using public-standard network protocols
a complete Transparent copy of the Document, free of added material.
If you use the latter option, you must take reasonably prudent steps,
when you begin distribution of Opaque copies in quantity, to ensure
that this Transparent copy will remain thus accessible at the stated
location until at least one year after the last time you distribute an
Opaque copy (directly or through your agents or retailers) of that
edition to the public.
</p>
<p>
It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="id-1.37.3.7"></a>2.5. 4. MODIFICATIONS</h3></div></div></div>
<p>
You may copy and distribute a Modified Version of the Document under
the conditions of sections 2 and 3 above, provided that you release
the Modified Version under precisely this License, with the Modified
Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it. In addition, you must do these things in the Modified Version:
</p>
<p>
</p>
<div class="orderedlist"><ol class="orderedlist" type="A">
<li class="listitem"><p>
Use in the Title Page (and on the covers, if any) a title distinct
from that of the Document, and from those of previous versions
(which should, if there were any, be listed in the History section
of the Document). You may use the same title as a previous version
if the original publisher of that version gives permission.
</p></li>
<li class="listitem"><p>
List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the
Document (all of its principal authors, if it has fewer than five),
unless they release you from this requirement.
</p></li>
<li class="listitem"><p>
State on the Title page the name of the publisher of the
Modified Version, as the publisher.
</p></li>
<li class="listitem"><p>
Preserve all the copyright notices of the Document.
</p></li>
<li class="listitem"><p>
Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.
</p></li>
<li class="listitem"><p>
Include, immediately after the copyright notices, a license notice
giving the public permission to use the Modified Version under the
terms of this License, in the form shown in the Addendum below.
</p></li>
<li class="listitem"><p>
Preserve in that license notice the full lists of Invariant Sections
and required Cover Texts given in the Document's license notice.
</p></li>
<li class="listitem"><p>
Include an unaltered copy of this License.
</p></li>
<li class="listitem"><p>
Preserve the section Entitled "History", Preserve its Title, and add
to it an item stating at least the title, year, new authors, and
publisher of the Modified Version as given on the Title Page. If
there is no section Entitled "History" in the Document, create one
stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified
Version as stated in the previous sentence.
</p></li>
<li class="listitem"><p>
Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and likewise
the network locations given in the Document for previous versions
it was based on. These may be placed in the "History" section.
You may omit a network location for a work that was published at
least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.
</p></li>
<li class="listitem"><p>
For any section Entitled "Acknowledgements" or "Dedications",
Preserve the Title of the section, and preserve in the section all
the substance and tone of each of the contributor acknowledgements
and/or dedications given therein.
</p></li>
<li class="listitem"><p>
Preserve all the Invariant Sections of the Document,
unaltered in their text and in their titles. Section numbers
or the equivalent are not considered part of the section titles.
</p></li>
<li class="listitem"><p>
Delete any section Entitled "Endorsements". Such a section
may not be included in the Modified Version.
</p></li>
<li class="listitem"><p>
Do not retitle any existing section to be Entitled "Endorsements"
or to conflict in title with any Invariant Section.
</p></li>
<li class="listitem"><p>
Preserve any Warranty Disclaimers.
</p></li>
</ol></div>
<p>
</p>
<p>
If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
of these sections as invariant. To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.
</p>
<p>
You may add a section Entitled "Endorsements", provided it contains
nothing but endorsements of your Modified Version by various
parties--for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.
</p>
<p>
You may add a passage of up to five words as a Front-Cover Text, and a
passage of up to 25 words as a Back-Cover Text, to the end of the list
of Cover Texts in the Modified Version. Only one passage of
Front-Cover Text and one of Back-Cover Text may be added by (or
through arrangements made by) any one entity. If the Document already
includes a cover text for the same cover, previously added by you or
by arrangement made by the same entity you are acting on behalf of,
you may not add another; but you may replace the old one, on explicit
permission from the previous publisher that added the old one.
</p>
<p>
The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="id-1.37.3.8"></a>2.6. 5. COMBINING DOCUMENTS</h3></div></div></div>
<p>
You may combine the Document with other documents released under this
License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
license notice, and that you preserve all their Warranty Disclaimers.
</p>
<p>
The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
copy. If there are multiple Invariant Sections with the same name but
different contents, make the title of each such section unique by
adding at the end of it, in parentheses, the name of the original
author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.
</p>
<p>
In the combination, you must combine any sections Entitled "History"
in the various original documents, forming one section Entitled
"History"; likewise combine any sections Entitled "Acknowledgements",
and any sections Entitled "Dedications". You must delete all sections
Entitled "Endorsements".
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="id-1.37.3.9"></a>2.7. 6. COLLECTIONS OF DOCUMENTS</h3></div></div></div>
<p>
You may make a collection consisting of the Document and other documents
released under this License, and replace the individual copies of this
License in the various documents with a single copy that is included in
the collection, provided that you follow the rules of this License for
verbatim copying of each of the documents in all other respects.
</p>
<p>
You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="id-1.37.3.10"></a>2.8. 7. AGGREGATION WITH INDEPENDENT WORKS</h3></div></div></div>
<p>
A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
distribution medium, is called an "aggregate" if the copyright
resulting from the compilation is not used to limit the legal rights
of the compilation's users beyond what the individual works permit.
When the Document is included in an aggregate, this License does not
apply to the other works in the aggregate which are not themselves
derivative works of the Document.
</p>
<p>
If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one half of
the entire aggregate, the Document's Cover Texts may be placed on
covers that bracket the Document within the aggregate, or the
electronic equivalent of covers if the Document is in electronic form.
Otherwise they must appear on printed covers that bracket the whole
aggregate.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="id-1.37.3.11"></a>2.9. 8. TRANSLATION</h3></div></div></div>
<p>
Translation is considered a kind of modification, so you may
distribute translations of the Document under the terms of section 4.
Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also include
the original English version of this License and the original versions
of those notices and disclaimers. In case of a disagreement between
the translation and the original version of this License or a notice
or disclaimer, the original version will prevail.
</p>
<p>
If a section in the Document is Entitled "Acknowledgements",
"Dedications", or "History", the requirement (section 4) to Preserve
its Title (section 1) will typically require changing the actual
title.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="id-1.37.3.12"></a>2.10. 9. TERMINATION</h3></div></div></div>
<p>
You may not copy, modify, sublicense, or distribute the Document except
as expressly provided for under this License. Any other attempt to
copy, modify, sublicense or distribute the Document is void, and will
automatically terminate your rights under this License. However,
parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such
parties remain in full compliance.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="id-1.37.3.13"></a>2.11. 10. FUTURE REVISIONS OF THIS LICENSE</h3></div></div></div>
<p>
The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. See
http://www.gnu.org/copyleft/.
</p>
<p>
Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
License "or any later version" applies to it, you have the option of
following the terms and conditions either of that specified version or
of any later version that has been published (not as a draft) by the
Free Software Foundation. If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="id-1.37.3.14"></a>2.12. G.1.1 ADDENDUM: How to use this License for your documents</h3></div></div></div>
<p>
To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
license notices just after the title page:
</p>
<div class="literallayout"><p><br>
    Copyright (c)  YEAR  YOUR NAME.<br>
    Permission is granted to copy, distribute and/or modify this document<br>
    under the terms of the GNU Free Documentation License, Version 1.2<br>
    or any later version published by the Free Software Foundation;<br>
    with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.<br>
    A copy of the license is included in the section entitled "GNU<br>
    Free Documentation License".<br>
</p></div>
<p>
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
replace the "with...Texts." line with this:
</p>
<div class="literallayout"><p><br>
    with the Invariant Sections being LIST THEIR TITLES, with the<br>
    Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.<br>
</p></div>
<p>
If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.
</p>
<p>
If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.
</p>
</div>
</div>
</div>
<table class="navigation-footer" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle">
<td align="left"><a accesskey="p" href="igraph-Glossary.html"><b>← Chapter 35. Glossary</b></a></td>
<td align="right"><a accesskey="n" href="ix01.html"><b>Index →</b></a></td>
</tr></table>
</body>
</html>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,381 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Chapter 6. Memory (de)allocation</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="igraph Reference Manual">
<link rel="up" href="index.html" title="igraph Reference Manual">
<link rel="prev" href="igraph-Error.html" title="Chapter 5. Error handling">
<link rel="next" href="igraph-Data-structures.html" title="Chapter 7. Data structure library: vector, matrix, other data types">
<script type="text/javascript" src="toggle.js"></script><link rel="stylesheet" href="style.css" type="text/css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css">
<link rel="chapter" href="igraph-Introduction.html" title="Chapter 1. Introduction">
<link rel="chapter" href="igraph-Installation.html" title="Chapter 2. Installation">
<link rel="chapter" href="igraph-Tutorial.html" title="Chapter 3. Tutorial">
<link rel="chapter" href="igraph-Basic.html" title="Chapter 4. Basic data types and interface">
<link rel="chapter" href="igraph-Error.html" title="Chapter 5. Error handling">
<link rel="chapter" href="igraph-Memory.html" title="Chapter 6. Memory (de)allocation">
<link rel="chapter" href="igraph-Data-structures.html" title="Chapter 7. Data structure library: vector, matrix, other data types">
<link rel="chapter" href="igraph-Random.html" title="Chapter 8. Random numbers">
<link rel="chapter" href="igraph-Iterators.html" title="Chapter 9. Vertex and edge selectors and sequences, iterators">
<link rel="chapter" href="igraph-Attributes.html" title="Chapter 10. Graph, vertex and edge attributes">
<link rel="chapter" href="igraph-Generators.html" title="Chapter 11. Deterministic graph generators">
<link rel="chapter" href="igraph-Games.html" title='Chapter 12. Stochastic graph generators ("games")'>
<link rel="chapter" href="igraph-Bipartite.html" title="Chapter 13. Bipartite, i.e. two-mode graphs">
<link rel="chapter" href="igraph-Spatial.html" title="Chapter 14. Spatial graphs">
<link rel="chapter" href="igraph-Operators.html" title="Chapter 15. Graph operators">
<link rel="chapter" href="igraph-Visitors.html" title="Chapter 16. Graph visitors">
<link rel="chapter" href="igraph-Structural.html" title="Chapter 17. Structural properties of graphs">
<link rel="chapter" href="igraph-Cycles.html" title="Chapter 18. Graph cycles">
<link rel="chapter" href="igraph-Cliques.html" title="Chapter 19. Cliques and independent vertex sets">
<link rel="chapter" href="igraph-Motifs.html" title="Chapter 20. Graph motifs, dyad census and triad census">
<link rel="chapter" href="igraph-Isomorphism.html" title="Chapter 21. Graph isomorphism">
<link rel="chapter" href="igraph-Coloring.html" title="Chapter 22. Graph coloring">
<link rel="chapter" href="igraph-Flows.html" title="Chapter 23. Maximum flows, minimum cuts and related measures">
<link rel="chapter" href="igraph-Separators.html" title="Chapter 24. Vertex separators">
<link rel="chapter" href="igraph-Community.html" title="Chapter 25. Detecting community structure">
<link rel="chapter" href="igraph-Graphlets.html" title="Chapter 26. Graphlets">
<link rel="chapter" href="igraph-HRG.html" title="Chapter 27. Hierarchical random graphs">
<link rel="chapter" href="igraph-Embedding.html" title="Chapter 28. Embedding of graphs">
<link rel="chapter" href="igraph-Layout.html" title="Chapter 29. Generating layouts for graph drawing">
<link rel="chapter" href="igraph-Processes.html" title="Chapter 30. Processes on graphs">
<link rel="chapter" href="igraph-Foreign.html" title="Chapter 31. Reading and writing graphs from and to files">
<link rel="chapter" href="igraph-Linalg.html" title="Chapter 32. Using BLAS, LAPACK and ARPACK for igraph matrices and graphs">
<link rel="chapter" href="igraph-Nongraph.html" title="Chapter 33. Non-graph related functions">
<link rel="chapter" href="igraph-Advanced.html" title="Chapter 34. Advanced igraph programming">
<link rel="chapter" href="igraph-Glossary.html" title="Chapter 35. Glossary">
<link rel="chapter" href="igraph-Licenses.html" title="Chapter 36. Licenses for igraph and this manual">
<link rel="index" href="ix01.html" title="Index">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navigation-header mb-4" width="100%" summary="Navigation header"><div class="btn-group">
<a accesskey="p" class="btn btn-light" href="igraph-Error.html"><i class="fa fa-chevron-left"></i>
Previous
</a><a accesskey="h" class="btn btn-light" href="index.html"><i class="fa fa-home"></i>
Home
</a><a accesskey="n" class="btn btn-light" href="igraph-Data-structures.html"><i class="fa fa-chevron-right"></i>
Next
</a>
</div></div>
<div class="chapter">
<div class="titlepage"><div><div><h1 class="title">
<a name="igraph-Memory"></a>Chapter 6. Memory (de)allocation</h1></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="igraph-Memory.html#about-alloc-funcs">1. About allocation functions</a></span></dt>
<dt><span class="section"><a href="igraph-Memory.html#available-alloc-funcs">2. Available allocation functions</a></span></dt>
</dl></div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="about-alloc-funcs"></a>1.  About allocation functions</h2></div></div></div>
<p>
Some igraph functions return a pointer vector (<span class="type">igraph_vector_ptr_t</span>)
containing pointers to other igraph or other data types. These data
types are dynamically allocated and have to be deallocated
manually when the user does not need them any more. <span class="type">igraph_vector_ptr_t</span>
has functions to deallocate the contained pointers on its own, but in this
case it has to be ensured that these pointers are allocated by a function
that corresponds to the deallocator function that igraph uses.
</p>
<p>
To this end, igraph exports the memory allocation functions that are used
internally so the user of the library can ensure that the proper functions
are used when pointers are moved between the code written by the user and
the code of the igraph library.
</p>
<p>
Additionally, the memory allocator functions used by igraph work around the
quirks of classical <code class="constant">malloc</code>(), <code class="constant">realloc</code>() and <code class="constant">calloc</code>() implementations
where the behaviour of allocating zero bytes is undefined. igraph allocator
functions will always allocate at least one byte.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="available-alloc-funcs"></a>2. Available allocation functions</h2></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="igraph-Memory.html#igraph_malloc">2.1. <code class="function">igraph_malloc</code> — Allocates memory that can be safely deallocated by igraph functions.</a></span></dt>
<dt><span class="section"><a href="igraph-Memory.html#igraph_calloc">2.2. <code class="function">igraph_calloc</code> — Allocates memory that can be safely deallocated by igraph functions.</a></span></dt>
<dt><span class="section"><a href="igraph-Memory.html#igraph_realloc">2.3. <code class="function">igraph_realloc</code> — Reallocate memory that can be safely deallocated by igraph functions.</a></span></dt>
<dt><span class="section"><a href="igraph-Memory.html#igraph_free">2.4. <code class="function">igraph_free</code> — Deallocates memory that was allocated by igraph functions.</a></span></dt>
</dl></div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="igraph_malloc"></a>2.1. <code class="function">igraph_malloc</code> — Allocates memory that can be safely deallocated by igraph functions.</h3></div></div></div>
<a class="indexterm" name="id-1.7.3.2.2"></a><p>
</p>
<div class="informalexample"><pre class="programlisting">
void *igraph_malloc(size_t size);
</pre></div>
<p>
</p>
<p>
This function behaves like <code class="constant">malloc</code>(), but it ensures that at least one
byte is allocated even when the caller asks for zero bytes.
</p>
<p><b>Arguments: </b>
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>size</code></em>:</span></p></td>
<td><p>
Number of bytes to be allocated. Zero is treated as one byte.
</p></td>
</tr></tbody>
</table></div>
<p>
</p>
<p><b>Returns: </b></p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code></code></em></span></p></td>
<td><p>
Pointer to the piece of allocated memory; <code class="constant">NULL</code> if the allocation
failed.
</p></td>
</tr></tbody>
</table></div>
<p>
</p>
<p><b>See also: </b></p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code></code></em></span></p></td>
<td><p>
<a class="link" href="igraph-Memory.html#igraph_calloc" title="2.2. igraph_calloc — Allocates memory that can be safely deallocated by igraph functions."><code class="function">igraph_calloc()</code></a>, <a class="link" href="igraph-Memory.html#igraph_realloc" title="2.3. igraph_realloc — Reallocate memory that can be safely deallocated by igraph functions."><code class="function">igraph_realloc()</code></a>, <a class="link" href="igraph-Memory.html#igraph_free" title="2.4. igraph_free — Deallocates memory that was allocated by igraph functions."><code class="function">igraph_free()</code></a>
</p></td>
</tr></tbody>
</table></div>
<p>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="igraph_calloc"></a>2.2. <code class="function">igraph_calloc</code> — Allocates memory that can be safely deallocated by igraph functions.</h3></div></div></div>
<a class="indexterm" name="id-1.7.3.3.2"></a><p>
</p>
<div class="informalexample"><pre class="programlisting">
void *igraph_calloc(size_t count, size_t size);
</pre></div>
<p>
</p>
<p>
This function behaves like <code class="constant">calloc</code>(), but it ensures that at least one
byte is allocated even when the caller asks for zero bytes.
</p>
<p><b>Arguments: </b>
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>count</code></em>:</span></p></td>
<td><p>
Number of items to be allocated.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>size</code></em>:</span></p></td>
<td><p>
Size of a single item to be allocated.
</p></td>
</tr>
</tbody>
</table></div>
<p>
</p>
<p><b>Returns: </b></p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code></code></em></span></p></td>
<td><p>
Pointer to the piece of allocated memory; <code class="constant">NULL</code> if the allocation
failed.
</p></td>
</tr></tbody>
</table></div>
<p>
</p>
<p><b>See also: </b></p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code></code></em></span></p></td>
<td><p>
<a class="link" href="igraph-Memory.html#igraph_malloc" title="2.1. igraph_malloc — Allocates memory that can be safely deallocated by igraph functions."><code class="function">igraph_malloc()</code></a>, <a class="link" href="igraph-Memory.html#igraph_realloc" title="2.3. igraph_realloc — Reallocate memory that can be safely deallocated by igraph functions."><code class="function">igraph_realloc()</code></a>, <a class="link" href="igraph-Memory.html#igraph_free" title="2.4. igraph_free — Deallocates memory that was allocated by igraph functions."><code class="function">igraph_free()</code></a>
</p></td>
</tr></tbody>
</table></div>
<p>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="igraph_realloc"></a>2.3. <code class="function">igraph_realloc</code> — Reallocate memory that can be safely deallocated by igraph functions.</h3></div></div></div>
<a class="indexterm" name="id-1.7.3.4.2"></a><p>
</p>
<div class="informalexample"><pre class="programlisting">
void *igraph_realloc(void *ptr, size_t size);
</pre></div>
<p>
</p>
<p>
This function behaves like <code class="constant">realloc</code>(), but it ensures that at least one
byte is allocated even when the caller asks for zero bytes.
</p>
<p><b>Arguments: </b>
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>ptr</code></em>:</span></p></td>
<td><p>
The pointer to reallocate.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>size</code></em>:</span></p></td>
<td><p>
Number of bytes to be allocated.
</p></td>
</tr>
</tbody>
</table></div>
<p>
</p>
<p><b>Returns: </b></p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code></code></em></span></p></td>
<td><p>
Pointer to the piece of allocated memory; <code class="constant">NULL</code> if the allocation
failed.
</p></td>
</tr></tbody>
</table></div>
<p>
</p>
<p><b>See also: </b></p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code></code></em></span></p></td>
<td><p>
<a class="link" href="igraph-Memory.html#igraph_free" title="2.4. igraph_free — Deallocates memory that was allocated by igraph functions."><code class="function">igraph_free()</code></a>, <a class="link" href="igraph-Memory.html#igraph_malloc" title="2.1. igraph_malloc — Allocates memory that can be safely deallocated by igraph functions."><code class="function">igraph_malloc()</code></a>
</p></td>
</tr></tbody>
</table></div>
<p>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="igraph_free"></a>2.4. <code class="function">igraph_free</code> — Deallocates memory that was allocated by igraph functions.</h3></div></div></div>
<a class="indexterm" name="id-1.7.3.5.2"></a><p>
</p>
<div class="informalexample"><pre class="programlisting">
void igraph_free(void *ptr);
</pre></div>
<p>
</p>
<p>
This function exposes the <code class="constant">free</code>() function used internally by igraph.
</p>
<p><b>Arguments: </b>
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>ptr</code></em>:</span></p></td>
<td><p>
Pointer to the piece of memory to be deallocated.</p></td>
</tr></tbody>
</table></div>
<p>
Time complexity: platform dependent, ideally it should be O(1).
</p>
<p><b>See also: </b></p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code></code></em></span></p></td>
<td><p>
<a class="link" href="igraph-Memory.html#igraph_calloc" title="2.2. igraph_calloc — Allocates memory that can be safely deallocated by igraph functions."><code class="function">igraph_calloc()</code></a>, <a class="link" href="igraph-Memory.html#igraph_malloc" title="2.1. igraph_malloc — Allocates memory that can be safely deallocated by igraph functions."><code class="function">igraph_malloc()</code></a>, <a class="link" href="igraph-Memory.html#igraph_realloc" title="2.3. igraph_realloc — Reallocate memory that can be safely deallocated by igraph functions."><code class="function">igraph_realloc()</code></a>
</p></td>
</tr></tbody>
</table></div>
<p>
</p>
</div>
</div>
</div>
<table class="navigation-footer" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle">
<td align="left"><a accesskey="p" href="igraph-Error.html"><b>← Chapter 5. Error handling</b></a></td>
<td align="right"><a accesskey="n" href="igraph-Data-structures.html"><b>Chapter 7. Data structure library: vector, matrix, other data types →</b></a></td>
</tr></table>
</body>
</html>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,274 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Chapter 30. Processes on graphs</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="igraph Reference Manual">
<link rel="up" href="index.html" title="igraph Reference Manual">
<link rel="prev" href="igraph-Layout.html" title="Chapter 29. Generating layouts for graph drawing">
<link rel="next" href="igraph-Foreign.html" title="Chapter 31. Reading and writing graphs from and to files">
<script type="text/javascript" src="toggle.js"></script><link rel="stylesheet" href="style.css" type="text/css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css">
<link rel="chapter" href="igraph-Introduction.html" title="Chapter 1. Introduction">
<link rel="chapter" href="igraph-Installation.html" title="Chapter 2. Installation">
<link rel="chapter" href="igraph-Tutorial.html" title="Chapter 3. Tutorial">
<link rel="chapter" href="igraph-Basic.html" title="Chapter 4. Basic data types and interface">
<link rel="chapter" href="igraph-Error.html" title="Chapter 5. Error handling">
<link rel="chapter" href="igraph-Memory.html" title="Chapter 6. Memory (de)allocation">
<link rel="chapter" href="igraph-Data-structures.html" title="Chapter 7. Data structure library: vector, matrix, other data types">
<link rel="chapter" href="igraph-Random.html" title="Chapter 8. Random numbers">
<link rel="chapter" href="igraph-Iterators.html" title="Chapter 9. Vertex and edge selectors and sequences, iterators">
<link rel="chapter" href="igraph-Attributes.html" title="Chapter 10. Graph, vertex and edge attributes">
<link rel="chapter" href="igraph-Generators.html" title="Chapter 11. Deterministic graph generators">
<link rel="chapter" href="igraph-Games.html" title='Chapter 12. Stochastic graph generators ("games")'>
<link rel="chapter" href="igraph-Bipartite.html" title="Chapter 13. Bipartite, i.e. two-mode graphs">
<link rel="chapter" href="igraph-Spatial.html" title="Chapter 14. Spatial graphs">
<link rel="chapter" href="igraph-Operators.html" title="Chapter 15. Graph operators">
<link rel="chapter" href="igraph-Visitors.html" title="Chapter 16. Graph visitors">
<link rel="chapter" href="igraph-Structural.html" title="Chapter 17. Structural properties of graphs">
<link rel="chapter" href="igraph-Cycles.html" title="Chapter 18. Graph cycles">
<link rel="chapter" href="igraph-Cliques.html" title="Chapter 19. Cliques and independent vertex sets">
<link rel="chapter" href="igraph-Motifs.html" title="Chapter 20. Graph motifs, dyad census and triad census">
<link rel="chapter" href="igraph-Isomorphism.html" title="Chapter 21. Graph isomorphism">
<link rel="chapter" href="igraph-Coloring.html" title="Chapter 22. Graph coloring">
<link rel="chapter" href="igraph-Flows.html" title="Chapter 23. Maximum flows, minimum cuts and related measures">
<link rel="chapter" href="igraph-Separators.html" title="Chapter 24. Vertex separators">
<link rel="chapter" href="igraph-Community.html" title="Chapter 25. Detecting community structure">
<link rel="chapter" href="igraph-Graphlets.html" title="Chapter 26. Graphlets">
<link rel="chapter" href="igraph-HRG.html" title="Chapter 27. Hierarchical random graphs">
<link rel="chapter" href="igraph-Embedding.html" title="Chapter 28. Embedding of graphs">
<link rel="chapter" href="igraph-Layout.html" title="Chapter 29. Generating layouts for graph drawing">
<link rel="chapter" href="igraph-Processes.html" title="Chapter 30. Processes on graphs">
<link rel="chapter" href="igraph-Foreign.html" title="Chapter 31. Reading and writing graphs from and to files">
<link rel="chapter" href="igraph-Linalg.html" title="Chapter 32. Using BLAS, LAPACK and ARPACK for igraph matrices and graphs">
<link rel="chapter" href="igraph-Nongraph.html" title="Chapter 33. Non-graph related functions">
<link rel="chapter" href="igraph-Advanced.html" title="Chapter 34. Advanced igraph programming">
<link rel="chapter" href="igraph-Glossary.html" title="Chapter 35. Glossary">
<link rel="chapter" href="igraph-Licenses.html" title="Chapter 36. Licenses for igraph and this manual">
<link rel="index" href="ix01.html" title="Index">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navigation-header mb-4" width="100%" summary="Navigation header"><div class="btn-group">
<a accesskey="p" class="btn btn-light" href="igraph-Layout.html"><i class="fa fa-chevron-left"></i>
Previous
</a><a accesskey="h" class="btn btn-light" href="index.html"><i class="fa fa-home"></i>
Home
</a><a accesskey="n" class="btn btn-light" href="igraph-Foreign.html"><i class="fa fa-chevron-right"></i>
Next
</a>
</div></div>
<div class="chapter">
<div class="titlepage"><div><div><h1 class="title">
<a name="igraph-Processes"></a>Chapter 30. Processes on graphs</h1></div></div></div>
<div class="toc"><dl class="toc"><dt><span class="section"><a href="igraph-Processes.html#epidemic-models">1. Epidemic models</a></span></dt></dl></div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="epidemic-models"></a>1. Epidemic models</h2></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="igraph-Processes.html#igraph_sir">1.1. <code class="function">igraph_sir</code> — Performs a number of SIR epidemics model runs on a graph.</a></span></dt>
<dt><span class="section"><a href="igraph-Processes.html#igraph_sir_t">1.2. <code class="function">igraph_sir_t</code> — The result of one SIR model simulation.</a></span></dt>
<dt><span class="section"><a href="igraph-Processes.html#igraph_sir_destroy">1.3. <code class="function">igraph_sir_destroy</code> — Deallocates memory associated with a SIR simulation run.</a></span></dt>
</dl></div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="igraph_sir"></a>1.1. <code class="function">igraph_sir</code> — Performs a number of SIR epidemics model runs on a graph.</h3></div></div></div>
<a class="indexterm" name="id-1.31.2.2.2"></a><p>
</p>
<div class="informalexample"><pre class="programlisting">
igraph_error_t igraph_sir(const igraph_t *graph, igraph_real_t beta,
igraph_real_t gamma, igraph_int_t no_sim,
igraph_vector_ptr_t *result);
</pre></div>
<p>
</p>
<p>
The SIR model is a simple model from epidemiology. The individuals
of the population might be in three states: susceptible, infected
and recovered. Recovered people are assumed to be immune to the
disease. Susceptibles become infected with a rate that depends on
their number of infected neighbors. Infected people become recovered
with a constant rate. See these parameters below.
</p>
<p>
This function runs multiple simulations, all starting with a
single uniformly randomly chosen infected individual. A simulation
is stopped when no infected individuals are left.
</p>
<p><b>Arguments: </b>
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>graph</code></em>:</span></p></td>
<td><p>
The graph to perform the model on. For directed graphs
edge directions are ignored and a warning is given.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>beta</code></em>:</span></p></td>
<td><p>
The rate of infection of an individual that is
susceptible and has a single infected neighbor.
The infection rate of a susceptible individual with n
infected neighbors is n times beta. Formally
this is the rate parameter of an exponential distribution.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>gamma</code></em>:</span></p></td>
<td><p>
The rate of recovery of an infected individual.
Formally, this is the rate parameter of an exponential
distribution.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>no_sim</code></em>:</span></p></td>
<td><p>
The number of simulation runs to perform.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>result</code></em>:</span></p></td>
<td><p>
The result of the simulation is stored here,
in a list of <a class="link" href="igraph-Processes.html#igraph_sir_t" title="1.2. igraph_sir_t — The result of one SIR model simulation."><code class="function">igraph_sir_t</code></a> objects. To deallocate
memory, the user needs to call <a class="link" href="igraph-Processes.html#igraph_sir_destroy" title="1.3. igraph_sir_destroy — Deallocates memory associated with a SIR simulation run."><code class="function">igraph_sir_destroy</code></a> on
each element, before destroying the pointer vector itself
using <a class="link" href="igraph-Data-structures.html#igraph_vector_ptr_destroy_all" title="2.17.5. igraph_vector_ptr_destroy_all — Frees all the elements and destroys the pointer vector."><code class="function">igraph_vector_ptr_destroy_all()</code></a>.
</p></td>
</tr>
</tbody>
</table></div>
<p>
</p>
<p><b>Returns: </b></p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code></code></em></span></p></td>
<td><p>
Error code.
</p></td>
</tr></tbody>
</table></div>
<p>
Time complexity: O(no_sim * (|V| + |E| log(|V|))).
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="igraph_sir_t"></a>1.2. <code class="function">igraph_sir_t</code> — The result of one SIR model simulation.</h3></div></div></div>
<a class="indexterm" name="id-1.31.2.3.2"></a><p>
</p>
<pre class="programlisting">
typedef struct igraph_sir_t {
igraph_vector_t times;
igraph_vector_int_t no_s, no_i, no_r;
} igraph_sir_t;
</pre>
<p>
</p>
<p>
</p>
<p>Data structure to store the results of one simulation
of the SIR (susceptible-infected-recovered) model on a graph.
It has the following members. They are all (real or integer)
vectors, and they are of the same length.
</p>
<p><b>Values: </b></p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="constant">times</code>:</span></p></td>
<td><p>
A vector, the times of the events are stored here.
</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="constant">no_s</code>:</span></p></td>
<td><p>
An integer vector, the number of susceptibles in
each time step is stored here.
</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="constant">no_i</code>:</span></p></td>
<td><p>
An integer vector, the number of infected individuals
at each time step, is stored here.
</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="constant">no_r</code>:</span></p></td>
<td><p>
An integer vector, the number of recovered individuals
is stored here at each time step.</p></td>
</tr>
</tbody>
</table></div>
<p>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="igraph_sir_destroy"></a>1.3. <code class="function">igraph_sir_destroy</code> — Deallocates memory associated with a SIR simulation run.</h3></div></div></div>
<a class="indexterm" name="id-1.31.2.4.2"></a><p>
</p>
<div class="informalexample"><pre class="programlisting">
void igraph_sir_destroy(igraph_sir_t *sir);
</pre></div>
<p>
</p>
<p>
</p>
<p><b>Arguments: </b>
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>sir</code></em>:</span></p></td>
<td><p>
The <a class="link" href="igraph-Processes.html#igraph_sir_t" title="1.2. igraph_sir_t — The result of one SIR model simulation."><code class="function">igraph_sir_t</code></a> object storing the simulation.</p></td>
</tr></tbody>
</table></div>
<p>
</p>
</div>
</div>
</div>
<table class="navigation-footer" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle">
<td align="left"><a accesskey="p" href="igraph-Layout.html"><b>← Chapter 29. Generating layouts for graph drawing</b></a></td>
<td align="right"><a accesskey="n" href="igraph-Foreign.html"><b>Chapter 31. Reading and writing graphs from and to files →</b></a></td>
</tr></table>
</body>
</html>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,776 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Chapter 24. Vertex separators</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="igraph Reference Manual">
<link rel="up" href="index.html" title="igraph Reference Manual">
<link rel="prev" href="igraph-Flows.html" title="Chapter 23. Maximum flows, minimum cuts and related measures">
<link rel="next" href="igraph-Community.html" title="Chapter 25. Detecting community structure">
<script type="text/javascript" src="toggle.js"></script><link rel="stylesheet" href="style.css" type="text/css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css">
<link rel="chapter" href="igraph-Introduction.html" title="Chapter 1. Introduction">
<link rel="chapter" href="igraph-Installation.html" title="Chapter 2. Installation">
<link rel="chapter" href="igraph-Tutorial.html" title="Chapter 3. Tutorial">
<link rel="chapter" href="igraph-Basic.html" title="Chapter 4. Basic data types and interface">
<link rel="chapter" href="igraph-Error.html" title="Chapter 5. Error handling">
<link rel="chapter" href="igraph-Memory.html" title="Chapter 6. Memory (de)allocation">
<link rel="chapter" href="igraph-Data-structures.html" title="Chapter 7. Data structure library: vector, matrix, other data types">
<link rel="chapter" href="igraph-Random.html" title="Chapter 8. Random numbers">
<link rel="chapter" href="igraph-Iterators.html" title="Chapter 9. Vertex and edge selectors and sequences, iterators">
<link rel="chapter" href="igraph-Attributes.html" title="Chapter 10. Graph, vertex and edge attributes">
<link rel="chapter" href="igraph-Generators.html" title="Chapter 11. Deterministic graph generators">
<link rel="chapter" href="igraph-Games.html" title='Chapter 12. Stochastic graph generators ("games")'>
<link rel="chapter" href="igraph-Bipartite.html" title="Chapter 13. Bipartite, i.e. two-mode graphs">
<link rel="chapter" href="igraph-Spatial.html" title="Chapter 14. Spatial graphs">
<link rel="chapter" href="igraph-Operators.html" title="Chapter 15. Graph operators">
<link rel="chapter" href="igraph-Visitors.html" title="Chapter 16. Graph visitors">
<link rel="chapter" href="igraph-Structural.html" title="Chapter 17. Structural properties of graphs">
<link rel="chapter" href="igraph-Cycles.html" title="Chapter 18. Graph cycles">
<link rel="chapter" href="igraph-Cliques.html" title="Chapter 19. Cliques and independent vertex sets">
<link rel="chapter" href="igraph-Motifs.html" title="Chapter 20. Graph motifs, dyad census and triad census">
<link rel="chapter" href="igraph-Isomorphism.html" title="Chapter 21. Graph isomorphism">
<link rel="chapter" href="igraph-Coloring.html" title="Chapter 22. Graph coloring">
<link rel="chapter" href="igraph-Flows.html" title="Chapter 23. Maximum flows, minimum cuts and related measures">
<link rel="chapter" href="igraph-Separators.html" title="Chapter 24. Vertex separators">
<link rel="chapter" href="igraph-Community.html" title="Chapter 25. Detecting community structure">
<link rel="chapter" href="igraph-Graphlets.html" title="Chapter 26. Graphlets">
<link rel="chapter" href="igraph-HRG.html" title="Chapter 27. Hierarchical random graphs">
<link rel="chapter" href="igraph-Embedding.html" title="Chapter 28. Embedding of graphs">
<link rel="chapter" href="igraph-Layout.html" title="Chapter 29. Generating layouts for graph drawing">
<link rel="chapter" href="igraph-Processes.html" title="Chapter 30. Processes on graphs">
<link rel="chapter" href="igraph-Foreign.html" title="Chapter 31. Reading and writing graphs from and to files">
<link rel="chapter" href="igraph-Linalg.html" title="Chapter 32. Using BLAS, LAPACK and ARPACK for igraph matrices and graphs">
<link rel="chapter" href="igraph-Nongraph.html" title="Chapter 33. Non-graph related functions">
<link rel="chapter" href="igraph-Advanced.html" title="Chapter 34. Advanced igraph programming">
<link rel="chapter" href="igraph-Glossary.html" title="Chapter 35. Glossary">
<link rel="chapter" href="igraph-Licenses.html" title="Chapter 36. Licenses for igraph and this manual">
<link rel="index" href="ix01.html" title="Index">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navigation-header mb-4" width="100%" summary="Navigation header"><div class="btn-group">
<a accesskey="p" class="btn btn-light" href="igraph-Flows.html"><i class="fa fa-chevron-left"></i>
Previous
</a><a accesskey="h" class="btn btn-light" href="index.html"><i class="fa fa-home"></i>
Home
</a><a accesskey="n" class="btn btn-light" href="igraph-Community.html"><i class="fa fa-chevron-right"></i>
Next
</a>
</div></div>
<div class="chapter">
<div class="titlepage"><div><div><h1 class="title">
<a name="igraph-Separators"></a>Chapter 24. Vertex separators</h1></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="igraph-Separators.html#igraph_is_separator">1. <code class="function">igraph_is_separator</code> — Would removing this set of vertices disconnect the graph?</a></span></dt>
<dt><span class="section"><a href="igraph-Separators.html#igraph_is_minimal_separator">2. <code class="function">igraph_is_minimal_separator</code> — Decides whether a set of vertices is a minimal separator.</a></span></dt>
<dt><span class="section"><a href="igraph-Separators.html#igraph_all_minimal_st_separators">3. <code class="function">igraph_all_minimal_st_separators</code> — List all vertex sets that are minimal (s,t) separators for some s and t.</a></span></dt>
<dt><span class="section"><a href="igraph-Separators.html#igraph_minimum_size_separators">4. <code class="function">igraph_minimum_size_separators</code> — Find all minimum size separating vertex sets.</a></span></dt>
<dt><span class="section"><a href="igraph-Separators.html#igraph_even_tarjan_reduction">5. <code class="function">igraph_even_tarjan_reduction</code> — Even-Tarjan reduction of a graph.</a></span></dt>
</dl></div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="igraph_is_separator"></a>1. <code class="function">igraph_is_separator</code> — Would removing this set of vertices disconnect the graph?</h2></div></div></div>
<a class="indexterm" name="id-1.25.2.2"></a><p>
</p>
<div class="informalexample"><pre class="programlisting">
igraph_error_t igraph_is_separator(const igraph_t *graph,
const igraph_vs_t candidate,
igraph_bool_t *res);
</pre></div>
<p>
</p>
<p>
A vertex set <code class="constant">S</code> is a separator if there are vertices <code class="constant">u</code> and <code class="constant">v</code>
in the graph such that all paths between <code class="constant">u</code> and <code class="constant">v</code> pass through
some vertices in <code class="constant">S</code>.
</p>
<p><b>Arguments: </b>
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>graph</code></em>:</span></p></td>
<td><p>
The input graph. It may be directed, but edge
directions are ignored.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>candidate</code></em>:</span></p></td>
<td><p>
The candidate separator.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>res</code></em>:</span></p></td>
<td><p>
Pointer to a boolean variable, the result is stored here.
</p></td>
</tr>
</tbody>
</table></div>
<p>
</p>
<p><b>Returns: </b></p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code></code></em></span></p></td>
<td><p>
Error code.
</p></td>
</tr></tbody>
</table></div>
<p>
Time complexity: O(|V|+|E|), linear in the number vertices and edges.
</p>
<div class="hideshow" onClick="toggle(this, event)">
<div class="example">
<a name="id-1.25.2.8.1"></a><p class="title"><b>Example 24.1.  File <code class="code">examples/simple/igraph_is_separator.c</code></b></p>
<div class="example-contents">
<pre class="programlisting"><span class="strong"><strong>#include</strong></span> &lt;igraph.h&gt;
<span class="strong"><strong>#include</strong></span> &lt;stdio.h&gt;
<span class="strong"><strong>#define</strong></span> <span class="strong"><strong>FAIL</strong></span>(msg, error) <span class="strong"><strong>do</strong></span> { <span class="strong"><strong>printf</strong></span>(msg "\n") ; <span class="strong"><strong>return</strong></span> error; } <span class="strong"><strong>while</strong></span> (0)
int <span class="strong"><strong>main</strong></span>(void) {
igraph_t graph;
igraph_vector_int_t sep;
igraph_bool_t result;
<span class="emphasis"><em>/* Initialize the library. */</em></span>
<span class="strong"><strong><a class="link" href="igraph-Basic.html#igraph_setup" title="4.1. igraph_setup — Initializes the igraph library.">igraph_setup</a></strong></span>();
<span class="emphasis"><em>/* Simple star graph, remove the center */</em></span>
<span class="strong"><strong><a class="link" href="igraph-Generators.html#igraph_star" title="4.1. igraph_star — Creates a star graph, every vertex connects only to the center.">igraph_star</a></strong></span>(&amp;graph, 10, IGRAPH_STAR_UNDIRECTED, 0);
<span class="strong"><strong><a class="link" href="igraph-Separators.html#igraph_is_separator" title="1. igraph_is_separator — Would removing this set of vertices disconnect the graph?">igraph_is_separator</a></strong></span>(&amp;graph, <span class="strong"><strong><a class="link" href="igraph-Iterators.html#igraph_vss_1" title="4.3. igraph_vss_1 — Vertex set with a single vertex (immediate version).">igraph_vss_1</a></strong></span>(0), &amp;result);
<span class="strong"><strong>if</strong></span> (!result) {
<span class="strong"><strong>FAIL</strong></span>("Center of star graph failed.", 1);
}
<span class="emphasis"><em>/* Same graph, but another vertex */</em></span>
<span class="strong"><strong><a class="link" href="igraph-Separators.html#igraph_is_separator" title="1. igraph_is_separator — Would removing this set of vertices disconnect the graph?">igraph_is_separator</a></strong></span>(&amp;graph, <span class="strong"><strong><a class="link" href="igraph-Iterators.html#igraph_vss_1" title="4.3. igraph_vss_1 — Vertex set with a single vertex (immediate version).">igraph_vss_1</a></strong></span>(6), &amp;result);
<span class="strong"><strong>if</strong></span> (result) {
<span class="strong"><strong>FAIL</strong></span>("Non-center of star graph failed.", 2);
}
<span class="emphasis"><em>/* Same graph, all vertices but the center */</em></span>
<span class="strong"><strong><a class="link" href="igraph-Separators.html#igraph_is_separator" title="1. igraph_is_separator — Would removing this set of vertices disconnect the graph?">igraph_is_separator</a></strong></span>(&amp;graph, <span class="strong"><strong><a class="link" href="igraph-Iterators.html#igraph_vss_range" title="4.5. igraph_vss_range — An interval of vertices (immediate version).">igraph_vss_range</a></strong></span>(1, 10), &amp;result);
<span class="strong"><strong>if</strong></span> (result) {
<span class="strong"><strong>FAIL</strong></span>("All non-central vertices of star graph failed.", 5);
}
<span class="emphasis"><em>/* Same graph, all vertices */</em></span>
<span class="strong"><strong><a class="link" href="igraph-Separators.html#igraph_is_separator" title="1. igraph_is_separator — Would removing this set of vertices disconnect the graph?">igraph_is_separator</a></strong></span>(&amp;graph, <span class="strong"><strong><a class="link" href="igraph-Iterators.html#igraph_vss_range" title="4.5. igraph_vss_range — An interval of vertices (immediate version).">igraph_vss_range</a></strong></span>(0, 10), &amp;result);
<span class="strong"><strong>if</strong></span> (result) {
<span class="strong"><strong>FAIL</strong></span>("All vertices of star graph failed.", 6);
}
<span class="strong"><strong><a class="link" href="igraph-Basic.html#igraph_destroy" title="5.1.4. igraph_destroy — Frees the memory allocated for a graph object.">igraph_destroy</a></strong></span>(&amp;graph);
<span class="emphasis"><em>/* Karate club */</em></span>
<span class="strong"><strong><a class="link" href="igraph-Generators.html#igraph_famous" title="8.1. igraph_famous — Create a famous graph by simply providing its name.">igraph_famous</a></strong></span>(&amp;graph, "zachary");
<span class="strong"><strong>igraph_vector_int_init</strong></span>(&amp;sep, 0);
<span class="strong"><strong>igraph_vector_int_push_back</strong></span>(&amp;sep, 32);
<span class="strong"><strong>igraph_vector_int_push_back</strong></span>(&amp;sep, 33);
<span class="strong"><strong><a class="link" href="igraph-Separators.html#igraph_is_separator" title="1. igraph_is_separator — Would removing this set of vertices disconnect the graph?">igraph_is_separator</a></strong></span>(&amp;graph, <span class="strong"><strong><a class="link" href="igraph-Iterators.html#igraph_vss_vector" title="4.4. igraph_vss_vector — Vertex set based on a vector (immediate version).">igraph_vss_vector</a></strong></span>(&amp;sep), &amp;result);
<span class="strong"><strong>if</strong></span> (!result) {
<span class="strong"><strong>FAIL</strong></span>("Karate network (32,33) failed", 3);
}
<span class="strong"><strong>igraph_vector_int_resize</strong></span>(&amp;sep, 5);
<span class="strong"><strong><a class="link" href="igraph-Data-structures.html#VECTOR" title="2.4.1. VECTOR — Accessing an element of a vector.">VECTOR</a></strong></span>(sep)[0] = 8;
<span class="strong"><strong><a class="link" href="igraph-Data-structures.html#VECTOR" title="2.4.1. VECTOR — Accessing an element of a vector.">VECTOR</a></strong></span>(sep)[1] = 9;
<span class="strong"><strong><a class="link" href="igraph-Data-structures.html#VECTOR" title="2.4.1. VECTOR — Accessing an element of a vector.">VECTOR</a></strong></span>(sep)[2] = 19;
<span class="strong"><strong><a class="link" href="igraph-Data-structures.html#VECTOR" title="2.4.1. VECTOR — Accessing an element of a vector.">VECTOR</a></strong></span>(sep)[3] = 30;
<span class="strong"><strong><a class="link" href="igraph-Data-structures.html#VECTOR" title="2.4.1. VECTOR — Accessing an element of a vector.">VECTOR</a></strong></span>(sep)[4] = 31;
<span class="strong"><strong><a class="link" href="igraph-Separators.html#igraph_is_separator" title="1. igraph_is_separator — Would removing this set of vertices disconnect the graph?">igraph_is_separator</a></strong></span>(&amp;graph, <span class="strong"><strong><a class="link" href="igraph-Iterators.html#igraph_vss_vector" title="4.4. igraph_vss_vector — Vertex set based on a vector (immediate version).">igraph_vss_vector</a></strong></span>(&amp;sep), &amp;result);
<span class="strong"><strong>if</strong></span> (result) {
<span class="strong"><strong>FAIL</strong></span>("Karate network (8,9,19,30,31) failed", 4);
}
<span class="strong"><strong><a class="link" href="igraph-Basic.html#igraph_destroy" title="5.1.4. igraph_destroy — Frees the memory allocated for a graph object.">igraph_destroy</a></strong></span>(&amp;graph);
<span class="strong"><strong>igraph_vector_int_destroy</strong></span>(&amp;sep);
<span class="strong"><strong>return</strong></span> 0;
}
</pre>
<p></p>
</div>
</div>
<br class="example-break">
</div>
<p>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="igraph_is_minimal_separator"></a>2. <code class="function">igraph_is_minimal_separator</code> — Decides whether a set of vertices is a minimal separator.</h2></div></div></div>
<a class="indexterm" name="id-1.25.3.2"></a><p>
</p>
<div class="informalexample"><pre class="programlisting">
igraph_error_t igraph_is_minimal_separator(const igraph_t *graph,
const igraph_vs_t candidate,
igraph_bool_t *res);
</pre></div>
<p>
</p>
<p>
A vertex separator <code class="constant">S</code> is minimal is no proper subset of <code class="constant">S</code>
is also a separator.
</p>
<p><b>Arguments: </b>
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>graph</code></em>:</span></p></td>
<td><p>
The input graph. It may be directed, but edge
directions are ignored.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>candidate</code></em>:</span></p></td>
<td><p>
The candidate minimal separators.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>res</code></em>:</span></p></td>
<td><p>
Pointer to a boolean variable, the result is stored
here.
</p></td>
</tr>
</tbody>
</table></div>
<p>
</p>
<p><b>Returns: </b></p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code></code></em></span></p></td>
<td><p>
Error code.
</p></td>
</tr></tbody>
</table></div>
<p>
Time complexity: O(|V|+|E|), linear in the number vertices and edges.
</p>
<div class="hideshow" onClick="toggle(this, event)">
<div class="example">
<a name="id-1.25.3.8.1"></a><p class="title"><b>Example 24.2.  File <code class="code">examples/simple/igraph_is_minimal_separator.c</code></b></p>
<div class="example-contents">
<pre class="programlisting"><span class="strong"><strong>#include</strong></span> &lt;igraph.h&gt;
<span class="strong"><strong>#include</strong></span> &lt;stdio.h&gt;
<span class="strong"><strong>#define</strong></span> <span class="strong"><strong>FAIL</strong></span>(msg, error) <span class="strong"><strong>do</strong></span> { <span class="strong"><strong>printf</strong></span>(msg "\n") ; <span class="strong"><strong>return</strong></span> error; } <span class="strong"><strong>while</strong></span> (0)
int <span class="strong"><strong>main</strong></span>(void) {
igraph_t graph;
igraph_vector_int_t sep;
igraph_bool_t result;
<span class="emphasis"><em>/* Initialize the library. */</em></span>
<span class="strong"><strong><a class="link" href="igraph-Basic.html#igraph_setup" title="4.1. igraph_setup — Initializes the igraph library.">igraph_setup</a></strong></span>();
<span class="emphasis"><em>/* Simple star graph, remove the center */</em></span>
<span class="strong"><strong><a class="link" href="igraph-Generators.html#igraph_star" title="4.1. igraph_star — Creates a star graph, every vertex connects only to the center.">igraph_star</a></strong></span>(&amp;graph, 10, IGRAPH_STAR_UNDIRECTED, 0);
<span class="strong"><strong><a class="link" href="igraph-Separators.html#igraph_is_minimal_separator" title="2. igraph_is_minimal_separator — Decides whether a set of vertices is a minimal separator.">igraph_is_minimal_separator</a></strong></span>(&amp;graph, <span class="strong"><strong><a class="link" href="igraph-Iterators.html#igraph_vss_1" title="4.3. igraph_vss_1 — Vertex set with a single vertex (immediate version).">igraph_vss_1</a></strong></span>(0), &amp;result);
<span class="strong"><strong>if</strong></span> (!result) {
<span class="strong"><strong>FAIL</strong></span>("Center of star graph failed.", 1);
}
<span class="emphasis"><em>/* Same graph, but another vertex */</em></span>
<span class="strong"><strong><a class="link" href="igraph-Separators.html#igraph_is_minimal_separator" title="2. igraph_is_minimal_separator — Decides whether a set of vertices is a minimal separator.">igraph_is_minimal_separator</a></strong></span>(&amp;graph, <span class="strong"><strong><a class="link" href="igraph-Iterators.html#igraph_vss_1" title="4.3. igraph_vss_1 — Vertex set with a single vertex (immediate version).">igraph_vss_1</a></strong></span>(6), &amp;result);
<span class="strong"><strong>if</strong></span> (result) {
<span class="strong"><strong>FAIL</strong></span>("Non-center of star graph failed.", 2);
}
<span class="strong"><strong><a class="link" href="igraph-Basic.html#igraph_destroy" title="5.1.4. igraph_destroy — Frees the memory allocated for a graph object.">igraph_destroy</a></strong></span>(&amp;graph);
<span class="emphasis"><em>/* Karate club */</em></span>
<span class="strong"><strong><a class="link" href="igraph-Generators.html#igraph_famous" title="8.1. igraph_famous — Create a famous graph by simply providing its name.">igraph_famous</a></strong></span>(&amp;graph, "zachary");
<span class="strong"><strong>igraph_vector_int_init</strong></span>(&amp;sep, 0);
<span class="strong"><strong>igraph_vector_int_push_back</strong></span>(&amp;sep, 32);
<span class="strong"><strong>igraph_vector_int_push_back</strong></span>(&amp;sep, 33);
<span class="strong"><strong><a class="link" href="igraph-Separators.html#igraph_is_minimal_separator" title="2. igraph_is_minimal_separator — Decides whether a set of vertices is a minimal separator.">igraph_is_minimal_separator</a></strong></span>(&amp;graph, <span class="strong"><strong><a class="link" href="igraph-Iterators.html#igraph_vss_vector" title="4.4. igraph_vss_vector — Vertex set based on a vector (immediate version).">igraph_vss_vector</a></strong></span>(&amp;sep), &amp;result);
<span class="strong"><strong>if</strong></span> (!result) {
<span class="strong"><strong>FAIL</strong></span>("Karate network (32,33) failed", 3);
}
<span class="strong"><strong>igraph_vector_int_resize</strong></span>(&amp;sep, 5);
<span class="strong"><strong><a class="link" href="igraph-Data-structures.html#VECTOR" title="2.4.1. VECTOR — Accessing an element of a vector.">VECTOR</a></strong></span>(sep)[0] = 8;
<span class="strong"><strong><a class="link" href="igraph-Data-structures.html#VECTOR" title="2.4.1. VECTOR — Accessing an element of a vector.">VECTOR</a></strong></span>(sep)[1] = 9;
<span class="strong"><strong><a class="link" href="igraph-Data-structures.html#VECTOR" title="2.4.1. VECTOR — Accessing an element of a vector.">VECTOR</a></strong></span>(sep)[2] = 19;
<span class="strong"><strong><a class="link" href="igraph-Data-structures.html#VECTOR" title="2.4.1. VECTOR — Accessing an element of a vector.">VECTOR</a></strong></span>(sep)[3] = 30;
<span class="strong"><strong><a class="link" href="igraph-Data-structures.html#VECTOR" title="2.4.1. VECTOR — Accessing an element of a vector.">VECTOR</a></strong></span>(sep)[4] = 31;
<span class="strong"><strong><a class="link" href="igraph-Separators.html#igraph_is_minimal_separator" title="2. igraph_is_minimal_separator — Decides whether a set of vertices is a minimal separator.">igraph_is_minimal_separator</a></strong></span>(&amp;graph, <span class="strong"><strong><a class="link" href="igraph-Iterators.html#igraph_vss_vector" title="4.4. igraph_vss_vector — Vertex set based on a vector (immediate version).">igraph_vss_vector</a></strong></span>(&amp;sep), &amp;result);
<span class="strong"><strong>if</strong></span> (result) {
<span class="strong"><strong>FAIL</strong></span>("Karate network (8,9,19,30,31) failed", 4);
}
<span class="strong"><strong><a class="link" href="igraph-Basic.html#igraph_destroy" title="5.1.4. igraph_destroy — Frees the memory allocated for a graph object.">igraph_destroy</a></strong></span>(&amp;graph);
<span class="strong"><strong>igraph_vector_int_destroy</strong></span>(&amp;sep);
<span class="strong"><strong>return</strong></span> 0;
}
</pre>
<p></p>
</div>
</div>
<br class="example-break">
</div>
<p>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="igraph_all_minimal_st_separators"></a>3. <code class="function">igraph_all_minimal_st_separators</code> — List all vertex sets that are minimal (s,t) separators for some s and t.</h2></div></div></div>
<a class="indexterm" name="id-1.25.4.2"></a><p>
</p>
<div class="informalexample"><pre class="programlisting">
igraph_error_t igraph_all_minimal_st_separators(
const igraph_t *graph, igraph_vector_int_list_t *separators
);
</pre></div>
<p>
</p>
<p>
This function lists all vertex sets that are minimal (s,t)
separators for some (s,t) vertex pair.
</p>
<p>
Note that some vertex sets returned by this function may not be minimal
with respect to disconnecting the graph (or increasing the number of
connected components). Take for example the 5-vertex graph with edges
<code class="literal">0-1-2-3-4-1</code>. This function returns the vertex sets
<code class="literal">{1}</code>, <code class="literal">{2,4}</code> and <code class="literal">{1,3}</code>.
Notice that <code class="literal">{1,3}</code> is not minimal with respect to disconnecting
the graph, as <code class="literal">{1}</code> would be sufficient for that. However, it is
minimal with respect to separating vertices <code class="constant">2</code> and <code class="constant">4</code>.
</p>
<p>
See more about the implemented algorithm in
Anne Berry, Jean-Paul Bordat and Olivier Cogis: Generating All the
Minimal Separators of a Graph, In: Peter Widmayer, Gabriele Neyer
and Stephan Eidenbenz (editors): Graph-theoretic concepts in
computer science, 1665, 167--172, 1999. Springer.
<a class="ulink" href="https://doi.org/10.1007/3-540-46784-X_17" target="_top">https://doi.org/10.1007/3-540-46784-X_17</a>
</p>
<p><b>Arguments: </b>
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>graph</code></em>:</span></p></td>
<td><p>
The input graph. It may be directed, but edge
directions are ignored.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>separators</code></em>:</span></p></td>
<td><p>
Pointer to a list of integer vectors, the separators
will be stored here.
</p></td>
</tr>
</tbody>
</table></div>
<p>
</p>
<p><b>Returns: </b></p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code></code></em></span></p></td>
<td><p>
Error code.
</p></td>
</tr></tbody>
</table></div>
<p>
</p>
<p><b>See also: </b></p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code></code></em></span></p></td>
<td><p>
<a class="link" href="igraph-Separators.html#igraph_minimum_size_separators" title="4. igraph_minimum_size_separators — Find all minimum size separating vertex sets."><code class="function">igraph_minimum_size_separators()</code></a>
</p></td>
</tr></tbody>
</table></div>
<p>
Time complexity: O(n|V|^3), |V| is the number of vertices, n is the
number of separators.
</p>
<div class="hideshow" onClick="toggle(this, event)">
<div class="example">
<a name="id-1.25.4.12.1"></a><p class="title"><b>Example 24.3.  File <code class="code">examples/simple/igraph_minimal_separators.c</code></b></p>
<div class="example-contents">
<pre class="programlisting"><span class="strong"><strong>#include</strong></span> &lt;igraph.h&gt;
<span class="strong"><strong>#include</strong></span> &lt;stdio.h&gt;
int <span class="strong"><strong>main</strong></span>(void) {
igraph_t graph;
igraph_vector_int_list_t separators;
igraph_int_t i, n;
<span class="emphasis"><em>/* Initialize the library. */</em></span>
<span class="strong"><strong><a class="link" href="igraph-Basic.html#igraph_setup" title="4.1. igraph_setup — Initializes the igraph library.">igraph_setup</a></strong></span>();
<span class="strong"><strong><a class="link" href="igraph-Generators.html#igraph_famous" title="8.1. igraph_famous — Create a famous graph by simply providing its name.">igraph_famous</a></strong></span>(&amp;graph, "zachary");
<span class="strong"><strong>igraph_vector_int_list_init</strong></span>(&amp;separators, 0);
<span class="strong"><strong><a class="link" href="igraph-Separators.html#igraph_all_minimal_st_separators" title="3. igraph_all_minimal_st_separators — List all vertex sets that are minimal (s,t) separators for some s and t.">igraph_all_minimal_st_separators</a></strong></span>(&amp;graph, &amp;separators);
n = <span class="strong"><strong>igraph_vector_int_list_size</strong></span>(&amp;separators);
<span class="strong"><strong>for</strong></span> (i = 0; i &lt; n; i++) {
igraph_bool_t res;
igraph_vector_int_t *sep = <span class="strong"><strong>igraph_vector_int_list_get_ptr</strong></span>(&amp;separators, i);
<span class="strong"><strong><a class="link" href="igraph-Separators.html#igraph_is_separator" title="1. igraph_is_separator — Would removing this set of vertices disconnect the graph?">igraph_is_separator</a></strong></span>(&amp;graph, <span class="strong"><strong><a class="link" href="igraph-Iterators.html#igraph_vss_vector" title="4.4. igraph_vss_vector — Vertex set based on a vector (immediate version).">igraph_vss_vector</a></strong></span>(sep), &amp;res);
<span class="strong"><strong>if</strong></span> (!res) {
<span class="strong"><strong>printf</strong></span>("Vertex set %" IGRAPH_PRId " is not a separator!\n", i);
<span class="strong"><strong>igraph_vector_int_print</strong></span>(sep);
<span class="strong"><strong>return</strong></span> 1;
}
}
<span class="strong"><strong><a class="link" href="igraph-Basic.html#igraph_destroy" title="5.1.4. igraph_destroy — Frees the memory allocated for a graph object.">igraph_destroy</a></strong></span>(&amp;graph);
<span class="strong"><strong>igraph_vector_int_list_destroy</strong></span>(&amp;separators);
<span class="strong"><strong>return</strong></span> 0;
}
</pre>
<p></p>
</div>
</div>
<br class="example-break">
</div>
<p>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="igraph_minimum_size_separators"></a>4. <code class="function">igraph_minimum_size_separators</code> — Find all minimum size separating vertex sets.</h2></div></div></div>
<a class="indexterm" name="id-1.25.5.2"></a><p>
</p>
<div class="informalexample"><pre class="programlisting">
igraph_error_t igraph_minimum_size_separators(
const igraph_t *graph, igraph_vector_int_list_t *separators
);
</pre></div>
<p>
</p>
<p>
This function lists all separator vertex sets of minimum size.
A vertex set is a separator if its removal disconnects the graph.
</p>
<p>
If the graph is already disconnected, no separators are returned.
Note that this convention differs from that used by some other
funtions such as <a class="link" href="igraph-Separators.html#igraph_all_minimal_st_separators" title="3. igraph_all_minimal_st_separators — List all vertex sets that are minimal (s,t) separators for some s and t."><code class="function">igraph_all_minimal_st_separators()</code></a>.
</p>
<p>
Complete graphs have no vertex separators.
</p>
<p>
The implementation is based on the following paper:
Arkady Kanevsky: Finding all minimum-size separating vertex sets in
a graph, Networks 23, 533--541, 1993.
<a class="ulink" href="https://doi.org/10.1002/net.3230230604" target="_top">https://doi.org/10.1002/net.3230230604</a>
</p>
<p><b>Arguments: </b>
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>graph</code></em>:</span></p></td>
<td><p>
The input graph, which must be undirected.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>separators</code></em>:</span></p></td>
<td><p>
An initialized list of integer vectors, the separators
are stored here. It is a list of pointers to <span class="type">igraph_vector_int_t</span>
objects. Each vector will contain the IDs of the vertices in
the separator. The separators are returned in an arbitrary order.
</p></td>
</tr>
</tbody>
</table></div>
<p>
</p>
<p><b>Returns: </b></p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code></code></em></span></p></td>
<td><p>
Error code.
</p></td>
</tr></tbody>
</table></div>
<p>
Time complexity: TODO.
</p>
<div class="hideshow" onClick="toggle(this, event)">
<div class="example">
<a name="id-1.25.5.11.1"></a><p class="title"><b>Example 24.4.  File <code class="code">examples/simple/igraph_minimum_size_separators.c</code></b></p>
<div class="example-contents">
<pre class="programlisting"><span class="strong"><strong>#include</strong></span> &lt;igraph.h&gt;
int <span class="strong"><strong>main</strong></span>(void) {
<span class="strong"><strong><a class="link" href="igraph-Basic.html#igraph_setup" title="4.1. igraph_setup — Initializes the igraph library.">igraph_setup</a></strong></span>();
igraph_t g;
igraph_vector_int_list_t sep;
<span class="strong"><strong><a class="link" href="igraph-Generators.html#igraph_small" title="2.2. igraph_small — Shorthand to create a small graph, giving the edges as arguments.">igraph_small</a></strong></span>(&amp;g, 7, IGRAPH_UNDIRECTED,
1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0,
-1);
<span class="strong"><strong>igraph_vector_int_list_init</strong></span>(&amp;sep, 0);
<span class="strong"><strong><a class="link" href="igraph-Separators.html#igraph_minimum_size_separators" title="4. igraph_minimum_size_separators — Find all minimum size separating vertex sets.">igraph_minimum_size_separators</a></strong></span>(&amp;g, &amp;sep);
<span class="strong"><strong>for</strong></span> (igraph_int_t i = 0; i &lt; <span class="strong"><strong>igraph_vector_int_list_size</strong></span>(&amp;sep); i++) {
igraph_vector_int_t* v = <span class="strong"><strong>igraph_vector_int_list_get_ptr</strong></span>(&amp;sep, i);
<span class="strong"><strong>igraph_vector_int_print</strong></span>(v);
}
<span class="strong"><strong>igraph_vector_int_list_destroy</strong></span>(&amp;sep);
<span class="strong"><strong><a class="link" href="igraph-Basic.html#igraph_destroy" title="5.1.4. igraph_destroy — Frees the memory allocated for a graph object.">igraph_destroy</a></strong></span>(&amp;g);
<span class="strong"><strong>return</strong></span> 0;
}
</pre>
<p></p>
</div>
</div>
<br class="example-break">
</div>
<p>
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="igraph_even_tarjan_reduction"></a>5. <code class="function">igraph_even_tarjan_reduction</code> — Even-Tarjan reduction of a graph.</h2></div></div></div>
<a class="indexterm" name="id-1.25.6.2"></a><p>
</p>
<div class="informalexample"><pre class="programlisting">
igraph_error_t igraph_even_tarjan_reduction(const igraph_t *graph, igraph_t *graphbar,
igraph_vector_t *capacity);
</pre></div>
<p>
</p>
<p>
A digraph is created with twice as many vertices and edges. For each
original vertex <code class="constant">i</code>, two vertices <code class="literal">i' = i</code> and
<code class="literal">i'' = i' + n</code> are created,
with a directed edge from <code class="literal">i'</code> to <code class="literal">i''</code>.
For each original directed edge from <code class="constant">i</code> to <code class="constant">j</code>, two new edges are created,
from <code class="literal">i'</code> to <code class="literal">j''</code> and from <code class="literal">i''</code>
to <code class="literal">j'</code>.
</p>
<p>This reduction is used in the paper (observation 2):
Arkady Kanevsky: Finding all minimum-size separating vertex sets in
a graph, Networks 23, 533--541, 1993.
</p>
<p>The original paper where this reduction was conceived is
Shimon Even and R. Endre Tarjan: Network Flow and Testing Graph
Connectivity, SIAM J. Comput., 4(4), 507518.
<a class="ulink" href="https://doi.org/10.1137/0204043" target="_top">https://doi.org/10.1137/0204043</a>
</p>
<p><b>Arguments: </b>
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>graph</code></em>:</span></p></td>
<td><p>
A graph. Although directness is not checked, this function
is commonly used only on directed graphs.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>graphbar</code></em>:</span></p></td>
<td><p>
Pointer to a new directed graph that will contain the
reduction, with twice as many vertices and edges.
</p></td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>capacity</code></em>:</span></p></td>
<td><p>
Pointer to an initialized vector or a null pointer. If
not a null pointer, then it will be filled the capacity from
the reduction: the first |E| elements are 1, the remaining |E|
are equal to |V| (which is used to indicate infinity).
</p></td>
</tr>
</tbody>
</table></div>
<p>
</p>
<p><b>Returns: </b></p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code></code></em></span></p></td>
<td><p>
Error code.
</p></td>
</tr></tbody>
</table></div>
<p>
Time complexity: O(|E|+|V|).
</p>
<div class="hideshow" onClick="toggle(this, event)">
<div class="example">
<a name="id-1.25.6.10.1"></a><p class="title"><b>Example 24.5.  File <code class="code">examples/simple/even_tarjan.c</code></b></p>
<div class="example-contents">
<pre class="programlisting"><span class="strong"><strong>#include</strong></span> &lt;igraph.h&gt;
<span class="strong"><strong>#include</strong></span> &lt;limits.h&gt;
int <span class="strong"><strong>main</strong></span>(void) {
igraph_t g, gbar;
igraph_int_t k1, k2 = INT_MAX;
igraph_real_t tmpk;
igraph_int_t i, j, n;
<a class="link" href="igraph-Flows.html#igraph_maxflow_stats_t" title="1.4. igraph_maxflow_stats_t — Data structure holding statistics from the push-relabel maximum flow solver.">igraph_maxflow_stats_t</a> stats;
<span class="emphasis"><em>/* Initialize the library. */</em></span>
<span class="strong"><strong><a class="link" href="igraph-Basic.html#igraph_setup" title="4.1. igraph_setup — Initializes the igraph library.">igraph_setup</a></strong></span>();
<span class="strong"><strong><a class="link" href="igraph-Generators.html#igraph_famous" title="8.1. igraph_famous — Create a famous graph by simply providing its name.">igraph_famous</a></strong></span>(&amp;g, "meredith");
<span class="strong"><strong><a class="link" href="igraph-Separators.html#igraph_even_tarjan_reduction" title="5. igraph_even_tarjan_reduction — Even-Tarjan reduction of a graph.">igraph_even_tarjan_reduction</a></strong></span>(&amp;g, &amp;gbar, <span class="emphasis"><em>/*capacity=*/</em></span> NULL);
<span class="strong"><strong><a class="link" href="igraph-Flows.html#igraph_vertex_connectivity" title="3.4. igraph_vertex_connectivity — The vertex connectivity of a graph.">igraph_vertex_connectivity</a></strong></span>(&amp;g, &amp;k1, <span class="emphasis"><em>/* checks= */</em></span> false);
n = <span class="strong"><strong><a class="link" href="igraph-Basic.html#igraph_vcount" title="5.2.1. igraph_vcount — The number of vertices in a graph.">igraph_vcount</a></strong></span>(&amp;g);
<span class="strong"><strong>for</strong></span> (i = 0; i &lt; n; i++) {
<span class="strong"><strong>for</strong></span> (j = i + 1; j &lt; n; j++) {
igraph_bool_t conn;
<span class="strong"><strong><a class="link" href="igraph-Structural.html#igraph_are_adjacent" title="1.1. igraph_are_adjacent — Decides whether two vertices are adjacent.">igraph_are_adjacent</a></strong></span>(&amp;g, i, j, &amp;conn);
<span class="strong"><strong>if</strong></span> (conn) {
<span class="strong"><strong>continue</strong></span>;
}
<span class="strong"><strong><a class="link" href="igraph-Flows.html#igraph_maxflow_value" title="1.2. igraph_maxflow_value — Maximum flow in a network with the push/relabel algorithm.">igraph_maxflow_value</a></strong></span>(&amp;gbar, &amp;tmpk,
<span class="emphasis"><em>/* source= */</em></span> i + n,
<span class="emphasis"><em>/* target= */</em></span> j,
<span class="emphasis"><em>/* capacity= */</em></span> 0,
&amp;stats);
<span class="strong"><strong>if</strong></span> (tmpk &lt; k2) {
k2 = tmpk;
}
}
}
<span class="strong"><strong><a class="link" href="igraph-Basic.html#igraph_destroy" title="5.1.4. igraph_destroy — Frees the memory allocated for a graph object.">igraph_destroy</a></strong></span>(&amp;gbar);
<span class="strong"><strong><a class="link" href="igraph-Basic.html#igraph_destroy" title="5.1.4. igraph_destroy — Frees the memory allocated for a graph object.">igraph_destroy</a></strong></span>(&amp;g);
<span class="strong"><strong>if</strong></span> (k1 != k2) {
<span class="strong"><strong>printf</strong></span>("k1 = %" IGRAPH_PRId " while k2 = %" IGRAPH_PRId "\n", k1, k2);
<span class="strong"><strong>return</strong></span> 1;
}
<span class="strong"><strong>return</strong></span> 0;
}
</pre>
<p></p>
</div>
</div>
<br class="example-break">
</div>
<p>
</p>
</div>
</div>
<table class="navigation-footer" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle">
<td align="left"><a accesskey="p" href="igraph-Flows.html"><b>← Chapter 23. Maximum flows, minimum cuts and related measures</b></a></td>
<td align="right"><a accesskey="n" href="igraph-Community.html"><b>Chapter 25. Detecting community structure →</b></a></td>
</tr></table>
</body>
</html>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,520 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Chapter 3. Tutorial</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="igraph Reference Manual">
<link rel="up" href="index.html" title="igraph Reference Manual">
<link rel="prev" href="igraph-Installation.html" title="Chapter 2. Installation">
<link rel="next" href="igraph-Basic.html" title="Chapter 4. Basic data types and interface">
<script type="text/javascript" src="toggle.js"></script><link rel="stylesheet" href="style.css" type="text/css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css">
<link rel="chapter" href="igraph-Introduction.html" title="Chapter 1. Introduction">
<link rel="chapter" href="igraph-Installation.html" title="Chapter 2. Installation">
<link rel="chapter" href="igraph-Tutorial.html" title="Chapter 3. Tutorial">
<link rel="chapter" href="igraph-Basic.html" title="Chapter 4. Basic data types and interface">
<link rel="chapter" href="igraph-Error.html" title="Chapter 5. Error handling">
<link rel="chapter" href="igraph-Memory.html" title="Chapter 6. Memory (de)allocation">
<link rel="chapter" href="igraph-Data-structures.html" title="Chapter 7. Data structure library: vector, matrix, other data types">
<link rel="chapter" href="igraph-Random.html" title="Chapter 8. Random numbers">
<link rel="chapter" href="igraph-Iterators.html" title="Chapter 9. Vertex and edge selectors and sequences, iterators">
<link rel="chapter" href="igraph-Attributes.html" title="Chapter 10. Graph, vertex and edge attributes">
<link rel="chapter" href="igraph-Generators.html" title="Chapter 11. Deterministic graph generators">
<link rel="chapter" href="igraph-Games.html" title='Chapter 12. Stochastic graph generators ("games")'>
<link rel="chapter" href="igraph-Bipartite.html" title="Chapter 13. Bipartite, i.e. two-mode graphs">
<link rel="chapter" href="igraph-Spatial.html" title="Chapter 14. Spatial graphs">
<link rel="chapter" href="igraph-Operators.html" title="Chapter 15. Graph operators">
<link rel="chapter" href="igraph-Visitors.html" title="Chapter 16. Graph visitors">
<link rel="chapter" href="igraph-Structural.html" title="Chapter 17. Structural properties of graphs">
<link rel="chapter" href="igraph-Cycles.html" title="Chapter 18. Graph cycles">
<link rel="chapter" href="igraph-Cliques.html" title="Chapter 19. Cliques and independent vertex sets">
<link rel="chapter" href="igraph-Motifs.html" title="Chapter 20. Graph motifs, dyad census and triad census">
<link rel="chapter" href="igraph-Isomorphism.html" title="Chapter 21. Graph isomorphism">
<link rel="chapter" href="igraph-Coloring.html" title="Chapter 22. Graph coloring">
<link rel="chapter" href="igraph-Flows.html" title="Chapter 23. Maximum flows, minimum cuts and related measures">
<link rel="chapter" href="igraph-Separators.html" title="Chapter 24. Vertex separators">
<link rel="chapter" href="igraph-Community.html" title="Chapter 25. Detecting community structure">
<link rel="chapter" href="igraph-Graphlets.html" title="Chapter 26. Graphlets">
<link rel="chapter" href="igraph-HRG.html" title="Chapter 27. Hierarchical random graphs">
<link rel="chapter" href="igraph-Embedding.html" title="Chapter 28. Embedding of graphs">
<link rel="chapter" href="igraph-Layout.html" title="Chapter 29. Generating layouts for graph drawing">
<link rel="chapter" href="igraph-Processes.html" title="Chapter 30. Processes on graphs">
<link rel="chapter" href="igraph-Foreign.html" title="Chapter 31. Reading and writing graphs from and to files">
<link rel="chapter" href="igraph-Linalg.html" title="Chapter 32. Using BLAS, LAPACK and ARPACK for igraph matrices and graphs">
<link rel="chapter" href="igraph-Nongraph.html" title="Chapter 33. Non-graph related functions">
<link rel="chapter" href="igraph-Advanced.html" title="Chapter 34. Advanced igraph programming">
<link rel="chapter" href="igraph-Glossary.html" title="Chapter 35. Glossary">
<link rel="chapter" href="igraph-Licenses.html" title="Chapter 36. Licenses for igraph and this manual">
<link rel="index" href="ix01.html" title="Index">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="navigation-header mb-4" width="100%" summary="Navigation header"><div class="btn-group">
<a accesskey="p" class="btn btn-light" href="igraph-Installation.html"><i class="fa fa-chevron-left"></i>
Previous
</a><a accesskey="h" class="btn btn-light" href="index.html"><i class="fa fa-home"></i>
Home
</a><a accesskey="n" class="btn btn-light" href="igraph-Basic.html"><i class="fa fa-chevron-right"></i>
Next
</a>
</div></div>
<div class="chapter">
<div class="titlepage"><div><div><h1 class="title">
<a name="igraph-Tutorial"></a>Chapter 3. Tutorial</h1></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="igraph-Tutorial.html#tut-lesson-1">1. Compiling programs using igraph</a></span></dt>
<dt><span class="section"><a href="igraph-Tutorial.html#tut-lesson-2">2. Creating your first graphs</a></span></dt>
<dt><span class="section"><a href="igraph-Tutorial.html#tut-lesson-3">3. Calculating various properties of graphs</a></span></dt>
</dl></div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="tut-lesson-1"></a>1. Compiling programs using igraph</h2></div></div></div>
<div class="toc"><dl class="toc">
<dt><span class="section"><a href="igraph-Tutorial.html#tut-lesson-1-compiling-with-cmake">1.1. Compiling with CMake</a></span></dt>
<dt><span class="section"><a href="igraph-Tutorial.html#tut-lesson-1-compiling-without-cmake">1.2. Compiling without CMake</a></span></dt>
<dt><span class="section"><a href="igraph-Tutorial.html#tut-lesson-1-running-the-program">1.3. Running the program</a></span></dt>
</dl></div>
<p>
The following short example program demonstrates the basic usage of
the <span class="command"><strong>igraph</strong></span> library. Save it into a file named
<code class="filename">igraph_test.c</code>.
</p>
<pre class="programlisting"><span class="strong"><strong>#include</strong></span> &lt;igraph.h&gt;
int <span class="strong"><strong>main</strong></span>(void) {
igraph_int_t num_vertices = 1000;
igraph_int_t num_edges = 1000;
igraph_real_t diameter, mean_degree;
igraph_t graph;
<span class="emphasis"><em>/* Initialize the library. */</em></span>
<span class="strong"><strong><a class="link" href="igraph-Basic.html#igraph_setup" title="4.1. igraph_setup — Initializes the igraph library.">igraph_setup</a></strong></span>();
<span class="emphasis"><em>/* Ensure identical results across runs. */</em></span>
<span class="strong"><strong><a class="link" href="igraph-Random.html#igraph_rng_seed" title="3.3. igraph_rng_seed — Seeds a random number generator.">igraph_rng_seed</a></strong></span>(<span class="strong"><strong><a class="link" href="igraph-Random.html#igraph_rng_default" title="2.1. igraph_rng_default — Query the default random number generator.">igraph_rng_default</a></strong></span>(), 42);
<span class="strong"><strong><a class="link" href="igraph-Games.html#igraph_erdos_renyi_game_gnm" title="1.1. igraph_erdos_renyi_game_gnm — Generates a random (Erdős-Rényi) graph with a fixed number of edges.">igraph_erdos_renyi_game_gnm</a></strong></span>(
&amp;graph, num_vertices, num_edges,
IGRAPH_UNDIRECTED, IGRAPH_SIMPLE_SW, IGRAPH_EDGE_UNLABELED);
<span class="strong"><strong><a class="link" href="igraph-Structural.html#igraph_diameter" title="3.22. igraph_diameter — Calculates the weighted diameter of a graph using Dijkstra's algorithm.">igraph_diameter</a></strong></span>(
&amp;graph, <span class="emphasis"><em>/* weights = */</em></span> NULL,
&amp;diameter,
<span class="emphasis"><em>/* from = */</em></span> NULL, <span class="emphasis"><em>/* to = */</em></span> NULL,
<span class="emphasis"><em>/* vertex_path = */</em></span> NULL, <span class="emphasis"><em>/* edge_path = */</em></span> NULL,
IGRAPH_UNDIRECTED, <span class="emphasis"><em>/* unconn= */</em></span> true);
<span class="strong"><strong><a class="link" href="igraph-Structural.html#igraph_mean_degree" title="26.2. igraph_mean_degree — The mean degree of a graph.">igraph_mean_degree</a></strong></span>(&amp;graph, &amp;mean_degree, IGRAPH_LOOPS);
<span class="strong"><strong>printf</strong></span>("Diameter of a random graph with average degree %g: %g\n",
mean_degree, diameter);
<span class="strong"><strong><a class="link" href="igraph-Basic.html#igraph_destroy" title="5.1.4. igraph_destroy — Frees the memory allocated for a graph object.">igraph_destroy</a></strong></span>(&amp;graph);
<span class="strong"><strong>return</strong></span> 0;
}
</pre>
<p>
</p>
<p>
This example illustrates a couple of points:
</p>
<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
<li class="listitem"><p>
First, programs
using the <span class="command"><strong>igraph</strong></span> library should include the
<code class="filename">igraph.h</code> header
file. Note that while igraph installs several sub-headers, the organization of these may change
without notice. Only use <code class="filename">igraph.h</code> in your projects, not any of the sub-headers.
</p></li>
<li class="listitem"><p>
Second, the library must be initialized using
<a class="link" href="igraph-Basic.html#igraph_setup" title="4.1. igraph_setup — Initializes the igraph library."><code class="function">igraph_setup()</code></a>
before use.
</p></li>
<li class="listitem"><p>
Third, <span class="command"><strong>igraph</strong></span> uses the
<span class="type">igraph_int_t</span> type for integers instead of
<span class="type">int</span> or <span class="type">long int</span>, and it also uses the
<span class="type">igraph_real_t</span> type for real numbers instead of
<span class="type">double</span>. Depending on how <span class="command"><strong>igraph</strong></span> was compiled, and whether you are
using a 32-bit or 64-bit system, <span class="type">igraph_int_t</span> may be a 32-bit
or 64-bit integer.
</p></li>
<li class="listitem"><p>
Fourth, <span class="command"><strong>igraph</strong></span> graph objects are represented by the <span class="type">igraph_t</span> data
type.
</p></li>
<li class="listitem"><p>
Fifth, the <a class="link" href="igraph-Games.html#igraph_erdos_renyi_game_gnm" title="1.1. igraph_erdos_renyi_game_gnm — Generates a random (Erdős-Rényi) graph with a fixed number of edges."><code class="function">igraph_erdos_renyi_game_gnm()</code></a>
creates a graph and <a class="link" href="igraph-Basic.html#igraph_destroy" title="5.1.4. igraph_destroy — Frees the memory allocated for a graph object."><code class="function">igraph_destroy()</code></a>
destroys it, i.e. deallocates the memory associated to it.
</p></li>
</ul></div>
<p>
For compiling this program you need a C compiler. Optionally,
<a class="ulink" href="https://cmake.org" target="_top">CMake</a> can be used to automate the compilation.
</p>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="tut-lesson-1-compiling-with-cmake"></a>1.1. Compiling with CMake</h3></div></div></div>
<p>
It is convenient to use CMake because it can automatically discover the
necessary compilation flags on all operating systems. Many IDEs support
CMake, and can work with CMake projects directly. To create a CMake project
for this example program, create a file name <code class="filename">CMakeLists.txt</code> with the
following contents:
</p>
<pre class="programlisting">
cmake_minimum_required(VERSION 3.18)
project(igraph_test)
find_package(igraph REQUIRED)
add_executable(igraph_test igraph_test.c)
target_link_libraries(igraph_test PUBLIC igraph::igraph)
</pre>
<p>
</p>
<p>
To compile the project, create a new directory called <code class="filename">build</code> in
the root of the <span class="command"><strong>igraph</strong></span> source tree, and switch to it:
</p>
<pre class="programlisting">
mkdir build
cd build
</pre>
<p>
</p>
<p>
Run CMake to configure the project:
</p>
<pre class="programlisting">
cmake ..
</pre>
<p>
</p>
<p>
If <span class="command"><strong>igraph</strong></span> was installed at a non-standard location, specify its prefix
using the <code class="option">-DCMAKE_PREFIX_PATH=...</code> option. The prefix must be
the same directory that was specified as the <code class="option">CMAKE_INSTALL_PREFIX</code>
when compiling igraph.
</p>
<p>
If configuration has succeeded, build the program using
</p>
<pre class="programlisting">
cmake --build .
</pre>
<p>
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">C++ must be enabled in igraph projects</h3>
<p>Parts of <span class="command"><strong>igraph</strong></span> are implemented in C++; therefore, any CMake target that
depends on <span class="command"><strong>igraph</strong></span> should use the C++ linker. Furthermore, OpenMP support in
igraph works correctly only if C++ is enabled in the CMake project. The script
that finds <span class="command"><strong>igraph</strong></span> on the host machine will throw an error if C++ support is
not enabled in the CMake project.</p>
<p>C++ support is enabled by default when no languages are explicitly
specified in CMake's <a class="ulink" href="https://cmake.org/cmake/help/latest/command/project.html" target="_top"><code class="code">project</code></a>
command, e.g. <code class="code">project(igraph_test)</code>. If you do specify some languages explicitly,
make sure to also include <code class="code">CXX</code>, e.g. <code class="code">project(igraph_test C CXX)</code>.
</p>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="tut-lesson-1-compiling-without-cmake"></a>1.2. Compiling without CMake</h3></div></div></div>
<p>
On most Unix-like systems, the default C compiler is called <span class="command"><strong>cc</strong></span>.
To compile the test program, you will need a command similar to the following:
</p>
<pre class="programlisting">
cc igraph_test.c -I/usr/local/include/igraph -L/usr/local/lib -ligraph -o igraph_test
</pre>
<p>
</p>
<p>
The exact form depends on where <span class="command"><strong>igraph</strong></span> was installed on your
system, whether it was compiled as a shared or static library, and the external
libraries it was linked to. The directory after the <code class="option">-I</code> switch
is the one containing the <code class="filename">igraph.h</code> file, while the one
following <code class="option">-L</code> should contain the library file itself, usually a
file called <code class="filename">libigraph.a</code> (static library on macOS and
Linux), <code class="filename">libigraph.so</code> (shared library on Linux),
<code class="filename">libigraph.dylib</code> (shared library on macOS),
<code class="filename">igraph.lib</code> (static library on Windows) or
<code class="filename">igraph.dll</code> (shared library on Windows). If
<span class="command"><strong>igraph</strong></span> was compiled as a static library, it is also
necessary to manually link to all of its dependencies.
</p>
<p>
If your system has the <span class="command"><strong>pkg-config</strong></span> utility you are
likely to get the necessary compile options by issuing the command
</p>
<pre class="programlisting">
pkg-config --libs --cflags igraph
</pre>
<p>
(if <span class="command"><strong>igraph</strong></span> was built as a shared library) or
</p>
<pre class="programlisting">
pkg-config --static --libs --cflags igraph
</pre>
<p>
(if <span class="command"><strong>igraph</strong></span> was built as a static library).
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="tut-lesson-1-running-the-program"></a>1.3. Running the program</h3></div></div></div>
<p>
On most systems, the executable can be run by simply typing its name like this:
</p>
<pre class="programlisting">
./igraph_test
</pre>
<p>
If you use dynamic linking and the <span class="command"><strong>igraph</strong></span>
library is not installed in a standard place, you may need to add its location to the
<code class="envar">LD_LIBRARY_PATH</code> (Linux), <code class="envar">DYLD_LIBRARY_PATH</code> (macOS)
or <code class="envar">PATH</code> (Windows) environment variables. This is typically necessary
on Windows systems.
</p>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="tut-lesson-2"></a>2. Creating your first graphs</h2></div></div></div>
<p>
The functions generating graph objects are called graph
generators. Stochastic (i.e. randomized) graph generators are called
<span class="quote"><span class="quote">games</span></span>.
</p>
<p>
<span class="command"><strong>igraph</strong></span> can handle directed and undirected graphs. Most graph
generators are able to create both types of graphs and most other
functions are usually also capable of handling
both. E.g., <a class="link" href="igraph-Structural.html#igraph_get_shortest_paths" title="3.8. igraph_get_shortest_paths — Shortest paths from a vertex."><code class="function">igraph_get_shortest_paths()</code></a>,
which calculates shortest paths from a vertex to other vertices, can calculate
directed or undirected paths.
</p>
<p>
<span class="command"><strong>igraph</strong></span> has sophisticated ways for creating graphs. The simplest
graphs are deterministic regular structures like star graphs
(<a class="link" href="igraph-Generators.html#igraph_star" title="4.1. igraph_star — Creates a star graph, every vertex connects only to the center."><code class="function">igraph_star()</code></a>),
cycle graphs (<a class="link" href="igraph-Generators.html#igraph_cycle_graph" title="4.9. igraph_cycle_graph — A cycle graph C_n."><code class="function">igraph_cycle_graph()</code></a>), lattices
(<a class="link" href="igraph-Generators.html#igraph_square_lattice" title="4.4. igraph_square_lattice — Arbitrary dimensional square lattices."><code class="function">igraph_square_lattice()</code></a>) or trees
(<a class="link" href="igraph-Generators.html#igraph_kary_tree" title="5.1. igraph_kary_tree — Creates a k-ary tree in which almost all vertices have k children."><code class="function">igraph_kary_tree()</code></a>), and many more.
</p>
<p>
The following example creates an undirected regular circular lattice,
adds some random edges to it and calculates the average length of
shortest paths between all pairs of vertices in the graph before and
after adding the random edges. (The message is that some random edges
can reduce path lengths a lot.)
</p>
<pre class="programlisting"><span class="strong"><strong>#include</strong></span> &lt;igraph.h&gt;
int <span class="strong"><strong>main</strong></span>(void) {
igraph_t graph;
igraph_vector_int_t dimvector;
igraph_vector_int_t edges;
igraph_vector_bool_t periodic;
igraph_real_t avg_path_len;
<span class="emphasis"><em>/* Initialize the library. */</em></span>
<span class="strong"><strong><a class="link" href="igraph-Basic.html#igraph_setup" title="4.1. igraph_setup — Initializes the igraph library.">igraph_setup</a></strong></span>();
<span class="strong"><strong>igraph_vector_int_init</strong></span>(&amp;dimvector, 2);
<span class="strong"><strong><a class="link" href="igraph-Data-structures.html#VECTOR" title="2.4.1. VECTOR — Accessing an element of a vector.">VECTOR</a></strong></span>(dimvector)[0] = 30;
<span class="strong"><strong><a class="link" href="igraph-Data-structures.html#VECTOR" title="2.4.1. VECTOR — Accessing an element of a vector.">VECTOR</a></strong></span>(dimvector)[1] = 30;
<span class="strong"><strong>igraph_vector_bool_init</strong></span>(&amp;periodic, 2);
<span class="strong"><strong>igraph_vector_bool_fill</strong></span>(&amp;periodic, true);
<span class="strong"><strong><a class="link" href="igraph-Generators.html#igraph_square_lattice" title="4.4. igraph_square_lattice — Arbitrary dimensional square lattices.">igraph_square_lattice</a></strong></span>(&amp;graph, &amp;dimvector, 0, IGRAPH_UNDIRECTED,
<span class="emphasis"><em>/* mutual= */</em></span> false, &amp;periodic);
<span class="strong"><strong><a class="link" href="igraph-Structural.html#igraph_average_path_length" title="3.20. igraph_average_path_length — The average shortest path length between all vertex pairs.">igraph_average_path_length</a></strong></span>(&amp;graph, NULL, &amp;avg_path_len, NULL,
IGRAPH_UNDIRECTED, <span class="emphasis"><em>/* unconn= */</em></span> true);
<span class="strong"><strong>printf</strong></span>("Average path length (lattice): %g\n", (double) avg_path_len);
<span class="emphasis"><em>/* Seed the RNG to ensure identical results across runs. */</em></span>
<span class="strong"><strong><a class="link" href="igraph-Random.html#igraph_rng_seed" title="3.3. igraph_rng_seed — Seeds a random number generator.">igraph_rng_seed</a></strong></span>(<span class="strong"><strong><a class="link" href="igraph-Random.html#igraph_rng_default" title="2.1. igraph_rng_default — Query the default random number generator.">igraph_rng_default</a></strong></span>(), 42);
<span class="strong"><strong>igraph_vector_int_init</strong></span>(&amp;edges, 20);
<span class="strong"><strong>for</strong></span> (igraph_int_t i = 0; i &lt; <span class="strong"><strong>igraph_vector_int_size</strong></span>(&amp;edges); i++) {
<span class="strong"><strong><a class="link" href="igraph-Data-structures.html#VECTOR" title="2.4.1. VECTOR — Accessing an element of a vector.">VECTOR</a></strong></span>(edges)[i] = <span class="strong"><strong>RNG_INTEGER</strong></span>(0, <span class="strong"><strong><a class="link" href="igraph-Basic.html#igraph_vcount" title="5.2.1. igraph_vcount — The number of vertices in a graph.">igraph_vcount</a></strong></span>(&amp;graph) - 1);
}
<span class="strong"><strong><a class="link" href="igraph-Basic.html#igraph_add_edges" title="5.3.2. igraph_add_edges — Adds edges to a graph object.">igraph_add_edges</a></strong></span>(&amp;graph, &amp;edges, NULL);
<span class="strong"><strong><a class="link" href="igraph-Structural.html#igraph_average_path_length" title="3.20. igraph_average_path_length — The average shortest path length between all vertex pairs.">igraph_average_path_length</a></strong></span>(&amp;graph, NULL, &amp;avg_path_len, NULL,
IGRAPH_UNDIRECTED, <span class="emphasis"><em>/* unconn= */</em></span> true);
<span class="strong"><strong>printf</strong></span>("Average path length (randomized lattice): %g\n", (double) avg_path_len);
<span class="strong"><strong>igraph_vector_bool_destroy</strong></span>(&amp;periodic);
<span class="strong"><strong>igraph_vector_int_destroy</strong></span>(&amp;dimvector);
<span class="strong"><strong>igraph_vector_int_destroy</strong></span>(&amp;edges);
<span class="strong"><strong><a class="link" href="igraph-Basic.html#igraph_destroy" title="5.1.4. igraph_destroy — Frees the memory allocated for a graph object.">igraph_destroy</a></strong></span>(&amp;graph);
<span class="strong"><strong>return</strong></span> 0;
}
</pre>
<p>
</p>
<p>
This example illustrates some new points. <span class="command"><strong>igraph</strong></span> uses
<a class="link" href="igraph-Data-structures.html#igraph_vector_t" title="2.1.  About igraph_vector_t objects"><span class="type">igraph_vector_t</span></a>
and its related types (<span class="type">igraph_vector_int_t</span>, <span class="type">igraph_vector_bool_t</span>
and so on) instead of plain C arrays. <span class="type">igraph_vector_t</span> is superior to
regular arrays in almost every sense. Vectors are created by the
<a class="link" href="igraph-Data-structures.html#igraph_vector_init" title="2.2.1. igraph_vector_init — Initializes a vector object (constructor)."><code class="function">igraph_vector_init()</code></a>
function and, like graphs, they should be destroyed if not
needed any more by calling
<a class="link" href="igraph-Data-structures.html#igraph_vector_destroy" title="2.2.5. igraph_vector_destroy — Destroys a vector object."><code class="function">igraph_vector_destroy()</code></a>
on them. A vector can be indexed by the
<a class="link" href="igraph-Data-structures.html#VECTOR" title="2.4.1. VECTOR — Accessing an element of a vector."><code class="function">VECTOR()</code></a> function
(right now it is a macro). The elements of a vector are of type <span class="type">igraph_real_t</span>
for <a class="link" href="igraph-Data-structures.html#igraph_vector_t" title="2.1.  About igraph_vector_t objects"><span class="type">igraph_vector_t</span></a>,
and of type <span class="type">igraph_int_t</span> for <span class="type">igraph_vector_int_t</span>.
As you might expect, <span class="type">igraph_vector_bool_t</span> holds
<span class="type">igraph_bool_t</span> values. Vectors can be resized and most <span class="command"><strong>igraph</strong></span>
functions returning the result in a vector automatically resize it to the size they need.
</p>
<p>
<a class="link" href="igraph-Generators.html#igraph_square_lattice" title="4.4. igraph_square_lattice — Arbitrary dimensional square lattices."><code class="function">igraph_square_lattice()</code></a>
takes an integer vector argument specifying the dimensions of
the lattice. In this example we generate a 30x30 two dimensional
periodic lattice. See the documentation of
<a class="link" href="igraph-Generators.html#igraph_square_lattice" title="4.4. igraph_square_lattice — Arbitrary dimensional square lattices."><code class="function">igraph_square_lattice()</code></a> in
the reference manual for the other arguments.
</p>
<p>
The vertices in a graph are identified by a <span class="emphasis"><em>vertex ID</em></span>, an integer between
<code class="code">0</code> and <code class="code">n - 1</code>, where <code class="code">n</code> is the number of vertices in the graph.
The vertex count can be retrieved using <a class="link" href="igraph-Basic.html#igraph_vcount" title="5.2.1. igraph_vcount — The number of vertices in a graph."><code class="function">igraph_vcount()</code></a>,
as in the example.
</p>
<p>
The <a class="link" href="igraph-Basic.html#igraph_add_edges" title="5.3.2. igraph_add_edges — Adds edges to a graph object."><code class="function">igraph_add_edges()</code></a>
function simply takes a graph and a vector of
vertex IDs defining the new edges. The first edge is between the first
two vertex IDs in the vector, the second edge is between the second
two, etc. This way we add ten random edges to the lattice.
</p>
<p>
Note that this example program may add <span class="emphasis"><em>loop edges</em></span>, edges
pointing a vertex to itself, or <span class="emphasis"><em>multiple edges</em></span>, more than one edge
between the same pair of vertices.
<span class="type">igraph_t</span> can of course represent loops and multiple edges, although some
routines expect simple graphs, i.e. graphs which contain neither of these. This is because some
structural properties are ill-defined for non-simple graphs. Loop and multi-edges can be removed by calling
<a class="link" href="igraph-Operators.html#igraph_simplify" title="3.11. igraph_simplify — Removes loop and/or multiple edges from the graph."><code class="function">igraph_simplify()</code></a>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="tut-lesson-3"></a>3. Calculating various properties of graphs</h2></div></div></div>
<p>
In our next example we will calculate various centrality measures in a
friendship graph. The friendship graph is from the famous Zachary karate
club study. (Do a web search on "Zachary karate" if you want to know more about
this.) Centrality measures quantify how central is the position of
individual vertices in the graph.
</p>
<pre class="programlisting"><span class="strong"><strong>#include</strong></span> &lt;igraph.h&gt;
int <span class="strong"><strong>main</strong></span>(void) {
igraph_t graph;
igraph_vector_int_t result;
<a class="link" href="igraph-Data-structures.html#igraph_vector_t" title="2.1.  About igraph_vector_t objects">igraph_vector_t</a> result_real;
igraph_int_t edges_array[] = {
0,1, 0,2, 0,3, 0,4, 0,5, 0,6, 0,7, 0,8,
0,10, 0,11, 0,12, 0,13, 0,17, 0,19, 0,21, 0,31,
1, 2, 1, 3, 1, 7, 1,13, 1,17, 1,19, 1,21, 1,30,
2, 3, 2, 7, 2,27, 2,28, 2,32, 2, 9, 2, 8, 2,13,
3, 7, 3,12, 3,13, 4, 6, 4,10, 5, 6, 5,10, 5,16,
6,16, 8,30, 8,32, 8,33, 9,33, 13,33, 14,32, 14,33,
15,32, 15,33, 18,32, 18,33, 19,33, 20,32, 20,33,
22,32, 22,33, 23,25, 23,27, 23,32, 23,33, 23,29,
24,25, 24,27, 24,31, 25,31, 26,29, 26,33, 27,33,
28,31, 28,33, 29,32, 29,33, 30,32, 30,33, 31,32,
31,33, 32,33
};
igraph_vector_int_t edges =
<span class="strong"><strong>igraph_vector_int_view</strong></span>(edges_array, <span class="strong"><strong>sizeof</strong></span>(edges_array) / <span class="strong"><strong>sizeof</strong></span>(edges_array[0]));
<span class="emphasis"><em>/* Initialize the library. */</em></span>
<span class="strong"><strong><a class="link" href="igraph-Basic.html#igraph_setup" title="4.1. igraph_setup — Initializes the igraph library.">igraph_setup</a></strong></span>();
<span class="strong"><strong><a class="link" href="igraph-Generators.html#igraph_create" title="2.1. igraph_create — Creates a graph with the specified edges.">igraph_create</a></strong></span>(&amp;graph, &amp;edges, 0, IGRAPH_UNDIRECTED);
<span class="strong"><strong>igraph_vector_int_init</strong></span>(&amp;result, 0);
<span class="strong"><strong><a class="link" href="igraph-Data-structures.html#igraph_vector_init" title="2.2.1. igraph_vector_init — Initializes a vector object (constructor).">igraph_vector_init</a></strong></span>(&amp;result_real, 0);
<span class="strong"><strong><a class="link" href="igraph-Basic.html#igraph_degree" title="5.2.14. igraph_degree — The degree of some vertices in a graph.">igraph_degree</a></strong></span>(&amp;graph, &amp;result, <span class="strong"><strong><a class="link" href="igraph-Iterators.html#igraph_vss_all" title="4.1. igraph_vss_all — All vertices of a graph (immediate version).">igraph_vss_all</a></strong></span>(), IGRAPH_ALL, IGRAPH_LOOPS);
<span class="strong"><strong>printf</strong></span>("Maximum degree is %10" IGRAPH_PRId ", vertex %2" IGRAPH_PRId ".\n",
<span class="strong"><strong>igraph_vector_int_max</strong></span>(&amp;result),
<span class="strong"><strong>igraph_vector_int_which_max</strong></span>(&amp;result));
<span class="strong"><strong><a class="link" href="igraph-Structural.html#igraph_closeness" title="11.1. igraph_closeness — Closeness centrality calculations for some vertices.">igraph_closeness</a></strong></span>(&amp;graph, &amp;result_real, NULL, NULL, <span class="strong"><strong><a class="link" href="igraph-Iterators.html#igraph_vss_all" title="4.1. igraph_vss_all — All vertices of a graph (immediate version).">igraph_vss_all</a></strong></span>(),
IGRAPH_ALL, <span class="emphasis"><em>/* weights= */</em></span> NULL, <span class="emphasis"><em>/* normalized= */</em></span> false);
<span class="strong"><strong>printf</strong></span>("Maximum closeness is %10g, vertex %2" IGRAPH_PRId ".\n",
(double) <span class="strong"><strong><a class="link" href="igraph-Data-structures.html#igraph_vector_max" title="2.10.2. igraph_vector_max — Largest element of a vector.">igraph_vector_max</a></strong></span>(&amp;result_real),
<span class="strong"><strong><a class="link" href="igraph-Data-structures.html#igraph_vector_which_max" title="2.10.4. igraph_vector_which_max — Gives the index of the maximum element of the vector.">igraph_vector_which_max</a></strong></span>(&amp;result_real));
<span class="strong"><strong><a class="link" href="igraph-Structural.html#igraph_betweenness" title="11.3. igraph_betweenness — Betweenness centrality of some vertices.">igraph_betweenness</a></strong></span>(&amp;graph, <span class="emphasis"><em>/* weights= */</em></span> NULL, &amp;result_real, <span class="strong"><strong><a class="link" href="igraph-Iterators.html#igraph_vss_all" title="4.1. igraph_vss_all — All vertices of a graph (immediate version).">igraph_vss_all</a></strong></span>(),
IGRAPH_UNDIRECTED, <span class="emphasis"><em>/* normalized= */</em></span> false);
<span class="strong"><strong>printf</strong></span>("Maximum betweenness is %10g, vertex %2" IGRAPH_PRId ".\n",
(double) <span class="strong"><strong><a class="link" href="igraph-Data-structures.html#igraph_vector_max" title="2.10.2. igraph_vector_max — Largest element of a vector.">igraph_vector_max</a></strong></span>(&amp;result_real),
<span class="strong"><strong><a class="link" href="igraph-Data-structures.html#igraph_vector_which_max" title="2.10.4. igraph_vector_which_max — Gives the index of the maximum element of the vector.">igraph_vector_which_max</a></strong></span>(&amp;result_real));
<span class="strong"><strong>igraph_vector_int_destroy</strong></span>(&amp;result);
<span class="strong"><strong><a class="link" href="igraph-Data-structures.html#igraph_vector_destroy" title="2.2.5. igraph_vector_destroy — Destroys a vector object.">igraph_vector_destroy</a></strong></span>(&amp;result_real);
<span class="strong"><strong><a class="link" href="igraph-Basic.html#igraph_destroy" title="5.1.4. igraph_destroy — Frees the memory allocated for a graph object.">igraph_destroy</a></strong></span>(&amp;graph);
<span class="strong"><strong>return</strong></span> 0;
}
</pre>
<p>
</p>
<p>
This example demonstrates some new operations. First of all, it shows a
way to create a graph a list of edges stored in a plain C array.
Function <a class="link" href="igraph-Data-structures.html#igraph_vector_view" title="2.5.1. igraph_vector_view — Handle a regular C array as a igraph_vector_t."><code class="function">igraph_vector_view()</code></a>
creates a <span class="emphasis"><em>view</em></span> of a C array. It does not copy any data,
which means that you must not call
<a class="link" href="igraph-Data-structures.html#igraph_vector_destroy" title="2.2.5. igraph_vector_destroy — Destroys a vector object."><code class="function">igraph_vector_destroy()</code></a>
on a vector created this way. This vector is then used to create the
undirected graph.
</p>
<p>
Then the degree, closeness and betweenness centrality of the vertices
is calculated and the highest values are printed. Note that the vector
<code class="varname">result</code>, into which these functions will write their
result, must be initialized first, and also that the functions resize
it to be able to hold the result.
</p>
<p>
Notice that in order to print values of type <span class="type">igraph_int_t</span>,
we used the <code class="constant">IGRAPH_PRId</code> format macro constant. This
macro is similar to the standard <code class="constant">PRI</code> constants defined
in <code class="code">stdint.h</code>, and expands to the correct <code class="code">printf</code>
format specifier on each platform that <span class="command"><strong>igraph</strong></span> supports.
</p>
<p>
The <a class="link" href="igraph-Iterators.html#igraph_vss_all" title="4.1. igraph_vss_all — All vertices of a graph (immediate version)."><code class="function">igraph_vss_all()</code></a> argument
tells the functions to calculate the property for every vertex in the graph.
It is shorthand for a <span class="emphasis"><em>vertex selector</em></span>, represented by type
<span class="type">igraph_vs_t</span>.
Vertex selectors help perform operations on a subset of vertices.
You can read more about them in <a class="link" href="igraph-Iterators.html" title="Chapter 9. Vertex and edge selectors and sequences, iterators">one
of the following chapters</a>.
</p>
</div>
</div>
<table class="navigation-footer" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle">
<td align="left"><a accesskey="p" href="igraph-Installation.html"><b>← Chapter 2. Installation</b></a></td>
<td align="right"><a accesskey="n" href="igraph-Basic.html"><b>Chapter 4. Basic data types and interface →</b></a></td>
</tr></table>
</body>
</html>
File diff suppressed because it is too large Load Diff
+165
View File
@@ -0,0 +1,165 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>igraph Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="igraph Reference Manual">
<link rel="next" href="igraph-Introduction.html" title="Chapter 1. Introduction">
<script type="text/javascript" src="toggle.js"></script><link rel="stylesheet" href="style.css" type="text/css">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css">
<link rel="chapter" href="igraph-Introduction.html" title="Chapter 1. Introduction">
<link rel="chapter" href="igraph-Installation.html" title="Chapter 2. Installation">
<link rel="chapter" href="igraph-Tutorial.html" title="Chapter 3. Tutorial">
<link rel="chapter" href="igraph-Basic.html" title="Chapter 4. Basic data types and interface">
<link rel="chapter" href="igraph-Error.html" title="Chapter 5. Error handling">
<link rel="chapter" href="igraph-Memory.html" title="Chapter 6. Memory (de)allocation">
<link rel="chapter" href="igraph-Data-structures.html" title="Chapter 7. Data structure library: vector, matrix, other data types">
<link rel="chapter" href="igraph-Random.html" title="Chapter 8. Random numbers">
<link rel="chapter" href="igraph-Iterators.html" title="Chapter 9. Vertex and edge selectors and sequences, iterators">
<link rel="chapter" href="igraph-Attributes.html" title="Chapter 10. Graph, vertex and edge attributes">
<link rel="chapter" href="igraph-Generators.html" title="Chapter 11. Deterministic graph generators">
<link rel="chapter" href="igraph-Games.html" title='Chapter 12. Stochastic graph generators ("games")'>
<link rel="chapter" href="igraph-Bipartite.html" title="Chapter 13. Bipartite, i.e. two-mode graphs">
<link rel="chapter" href="igraph-Spatial.html" title="Chapter 14. Spatial graphs">
<link rel="chapter" href="igraph-Operators.html" title="Chapter 15. Graph operators">
<link rel="chapter" href="igraph-Visitors.html" title="Chapter 16. Graph visitors">
<link rel="chapter" href="igraph-Structural.html" title="Chapter 17. Structural properties of graphs">
<link rel="chapter" href="igraph-Cycles.html" title="Chapter 18. Graph cycles">
<link rel="chapter" href="igraph-Cliques.html" title="Chapter 19. Cliques and independent vertex sets">
<link rel="chapter" href="igraph-Motifs.html" title="Chapter 20. Graph motifs, dyad census and triad census">
<link rel="chapter" href="igraph-Isomorphism.html" title="Chapter 21. Graph isomorphism">
<link rel="chapter" href="igraph-Coloring.html" title="Chapter 22. Graph coloring">
<link rel="chapter" href="igraph-Flows.html" title="Chapter 23. Maximum flows, minimum cuts and related measures">
<link rel="chapter" href="igraph-Separators.html" title="Chapter 24. Vertex separators">
<link rel="chapter" href="igraph-Community.html" title="Chapter 25. Detecting community structure">
<link rel="chapter" href="igraph-Graphlets.html" title="Chapter 26. Graphlets">
<link rel="chapter" href="igraph-HRG.html" title="Chapter 27. Hierarchical random graphs">
<link rel="chapter" href="igraph-Embedding.html" title="Chapter 28. Embedding of graphs">
<link rel="chapter" href="igraph-Layout.html" title="Chapter 29. Generating layouts for graph drawing">
<link rel="chapter" href="igraph-Processes.html" title="Chapter 30. Processes on graphs">
<link rel="chapter" href="igraph-Foreign.html" title="Chapter 31. Reading and writing graphs from and to files">
<link rel="chapter" href="igraph-Linalg.html" title="Chapter 32. Using BLAS, LAPACK and ARPACK for igraph matrices and graphs">
<link rel="chapter" href="igraph-Nongraph.html" title="Chapter 33. Non-graph related functions">
<link rel="chapter" href="igraph-Advanced.html" title="Chapter 34. Advanced igraph programming">
<link rel="chapter" href="igraph-Glossary.html" title="Chapter 35. Glossary">
<link rel="chapter" href="igraph-Licenses.html" title="Chapter 36. Licenses for igraph and this manual">
<link rel="index" href="ix01.html" title="Index">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<div class="book">
<div class="titlepage">
<div>
<div></div>
<div><div class="authorgroup">
<div class="author">
<h3 class="author">
<span class="firstname">Gábor</span> <span class="surname">Csárdi</span>
</h3>
<div class="affiliation">
<span class="orgname">Department of Statistics, Harvard University<br></span><div class="address"><p>1 Oxford street, Cambridge, MA, 02138 USA</p></div>
</div>
</div>
<div class="author">
<h3 class="author">
<span class="firstname">Tamás</span> <span class="surname">Nepusz</span>
</h3>
<div class="affiliation">
<span class="orgname">Department of Biological Physics, Eötvös Loránd University<br></span><div class="address"><p>1/a Pázmány Péter sétány, 1117 Budapest, Hungary</p></div>
</div>
</div>
<div class="author">
<h3 class="author">
<span class="firstname">Vincent</span> <span class="surname">Traag</span>
</h3>
<div class="affiliation">
<span class="orgname">Centre for Science and Technology Studies, Leiden University<br></span><div class="address"><p>Room B5.31, Kolffpad 1, 2333 BN Leiden, Netherlands</p></div>
</div>
</div>
<div class="author">
<h3 class="author">
<span class="firstname">Szabolcs</span> <span class="surname">Horvát</span>
</h3>
<div class="affiliation">
<span class="orgname">Department of Computer Science, Reykjavik University<br></span><div class="address"><p>Menntavegur 1, 102 Reykjavík, Iceland</p></div>
</div>
</div>
<div class="author">
<h3 class="author">
<span class="firstname">Fabio</span> <span class="surname">Zanini</span>
</h3>
<div class="affiliation">
<span class="orgname">Lowy Cancer Research Centre, University of New South Wales<br></span><div class="address"><p>Room 211, Botany and High St, Kensington, NSW, 2033, Australia</p></div>
</div>
</div>
<div class="author">
<h3 class="author">
<span class="firstname">Daniel</span> <span class="surname">Noom</span>
</h3>
<div class="affiliation">
<span class="orgname">jitjit software development<br></span><div class="address"><p>Amsterdam, Netherlands</p></div>
</div>
</div>
</div></div>
<div><p class="releaseinfo">1.0.1</p></div>
<div><div class="legalnotice">
<a name="id-1.1.4"></a><p>This manual is for igraph, version 1.0.1.</p>
<p>
Copyright (C) 2005-2019 Gábor Csárdi and Tamás Nepusz.
Copyright (C) 2020-2025 igraph development team.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
Texts. A copy of the license is included in the section entitled
<span class="quote"><span class="quote">GNU Free Documentation License</span></span>.
</p>
</div></div>
</div>
<hr>
</div>
<div class="toc"><dl class="toc">
<dt><span class="chapter"><a href="igraph-Introduction.html">1. Introduction</a></span></dt>
<dt><span class="chapter"><a href="igraph-Installation.html">2. Installation</a></span></dt>
<dt><span class="chapter"><a href="igraph-Tutorial.html">3. Tutorial</a></span></dt>
<dt><span class="chapter"><a href="igraph-Basic.html">4. Basic data types and interface</a></span></dt>
<dt><span class="chapter"><a href="igraph-Error.html">5. Error handling</a></span></dt>
<dt><span class="chapter"><a href="igraph-Memory.html">6. Memory (de)allocation</a></span></dt>
<dt><span class="chapter"><a href="igraph-Data-structures.html">7. Data structure library: vector, matrix, other data types</a></span></dt>
<dt><span class="chapter"><a href="igraph-Random.html">8. Random numbers</a></span></dt>
<dt><span class="chapter"><a href="igraph-Iterators.html">9. Vertex and edge selectors and sequences, iterators</a></span></dt>
<dt><span class="chapter"><a href="igraph-Attributes.html">10. Graph, vertex and edge attributes</a></span></dt>
<dt><span class="chapter"><a href="igraph-Generators.html">11. Deterministic graph generators</a></span></dt>
<dt><span class="chapter"><a href="igraph-Games.html">12. Stochastic graph generators ("games")</a></span></dt>
<dt><span class="chapter"><a href="igraph-Bipartite.html">13. Bipartite, i.e. two-mode graphs</a></span></dt>
<dt><span class="chapter"><a href="igraph-Spatial.html">14. Spatial graphs</a></span></dt>
<dt><span class="chapter"><a href="igraph-Operators.html">15. Graph operators</a></span></dt>
<dt><span class="chapter"><a href="igraph-Visitors.html">16. Graph visitors</a></span></dt>
<dt><span class="chapter"><a href="igraph-Structural.html">17. Structural properties of graphs</a></span></dt>
<dt><span class="chapter"><a href="igraph-Cycles.html">18. Graph cycles</a></span></dt>
<dt><span class="chapter"><a href="igraph-Cliques.html">19. Cliques and independent vertex sets</a></span></dt>
<dt><span class="chapter"><a href="igraph-Motifs.html">20. Graph motifs, dyad census and triad census</a></span></dt>
<dt><span class="chapter"><a href="igraph-Isomorphism.html">21. Graph isomorphism</a></span></dt>
<dt><span class="chapter"><a href="igraph-Coloring.html">22. Graph coloring</a></span></dt>
<dt><span class="chapter"><a href="igraph-Flows.html">23. Maximum flows, minimum cuts and related measures</a></span></dt>
<dt><span class="chapter"><a href="igraph-Separators.html">24. Vertex separators</a></span></dt>
<dt><span class="chapter"><a href="igraph-Community.html">25. Detecting community structure</a></span></dt>
<dt><span class="chapter"><a href="igraph-Graphlets.html">26. Graphlets</a></span></dt>
<dt><span class="chapter"><a href="igraph-HRG.html">27. Hierarchical random graphs</a></span></dt>
<dt><span class="chapter"><a href="igraph-Embedding.html">28. Embedding of graphs</a></span></dt>
<dt><span class="chapter"><a href="igraph-Layout.html">29. Generating layouts for graph drawing</a></span></dt>
<dt><span class="chapter"><a href="igraph-Processes.html">30. Processes on graphs</a></span></dt>
<dt><span class="chapter"><a href="igraph-Foreign.html">31. Reading and writing graphs from and to files</a></span></dt>
<dt><span class="chapter"><a href="igraph-Linalg.html">32. Using BLAS, LAPACK and ARPACK for igraph matrices and graphs</a></span></dt>
<dt><span class="chapter"><a href="igraph-Nongraph.html">33. Non-graph related functions </a></span></dt>
<dt><span class="chapter"><a href="igraph-Advanced.html">34. Advanced igraph programming</a></span></dt>
<dt><span class="chapter"><a href="igraph-Glossary.html">35. Glossary</a></span></dt>
<dt><span class="chapter"><a href="igraph-Licenses.html">36. Licenses for igraph and this manual</a></span></dt>
<dt><span class="index"><a href="ix01.html">Index</a></span></dt>
</dl></div>
</div>
<table class="navigation-footer" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle">
<td align="left"></td>
<td align="right"><a accesskey="n" href="igraph-Introduction.html"><b>Chapter 1. Introduction →</b></a></td>
</tr></table>
</body>
</html>
File diff suppressed because it is too large Load Diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 459 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 472 B

+279
View File
@@ -0,0 +1,279 @@
.author { padding: 0px 30px 0pt; }
.chapter { padding: 0px 20px 10px; }
.section { padding: 0px 20px 10px; }
.index { padding: 0px 20px 10px; }
.legalnotice { padding: 0px 20px 10px; }
.releaseinfo { padding: 0px 20px 10px; }
.navigation-header { position: absolute; right: 20px; top: 7px; }
.navigation-footer { padding: 0px 20px 10px; }
.programlisting
{
background: #eeeeff;
border: solid 1px #4444ff;
padding: 0.5em;
font-size: 16px;
overflow: auto;
}
.constant, .literal {
font-size: 16px;
}
.variablelist
{
padding: 4px;
margin-left: 3em;
}
.variablelist td:first-child
{
vertical-align: top;
}
code
{
font-size: 16px;
}
table.navigation
{
color: #fff;
margin: 0;
padding: 7px 0 7px 15px;
text-shadow: 0px 1px 2px #000;
background: #005fd7 url(header_blue.png) repeat-x;
border-bottom: 1px solid #1c477f;
font-size: large;
}
table.navigation a
{
color: #fff;
}
.navigation .title
{
font-size: 200%;
}
div.refnamediv
{
margin-top: 2em;
}
div.gallery-float
{
float: left;
padding: 10px;
}
div.gallery-float img
{
border-style: none;
}
div.gallery-spacer
{
clear: both;
}
body {
font: medium/150% "Lucida Grande", sans-serif;
margin: 0; padding: 0px 0px 10px;
color: #333; background: #fff;
}
h1 {
color: #fff;
margin: 0;
padding: 7px 0 7px 15px;
text-shadow: 0px 1px 2px #000;
background: #005fd7 url(images/header_blue.png) repeat-x;
border-bottom: 1px solid #1c477f;
font-size: large;
}
.chapter h1 {
/* compensate for main page horizontal padding */
margin: 0 -20px;
padding: 7px 20px 7px 35px;
}
h2 {
font-size: 1.2em;
}
h3 {
font-size: 1em;
}
body.error h1 {
background: #d70000;
border-bottom: 1px solid #7f0000;
}
.main {
padding: 7px 15px;
}
ul.no-bullet {
list-style-type: none;
padding: 0; margin: 0;
}
ul.no-bullet li {
padding: 0; margin: 0;
}
li.download {
line-height: 1em;
padding-bottom: 10px !important;
}
li.download .name {
font-weight: bold;
padding-left: 20px;
}
li.download .comment {
font-size: 0.8em;
color: #888;
}
li.download-c {
background: url(images/icon_c.png) no-repeat 0px 0px;
}
li.download-r {
background: url(images/icon_r.png) no-repeat 0px 0px;
}
li.download-python {
background: url(images/icon_python.png) no-repeat 0px 0px;
}
li.download-ruby {
background: url(images/icon_ruby.png) no-repeat 0px 0px;
}
ul.download-links {
list-style-type: none;
padding: 2px 0 0 20px; margin: 0;
font-size: 0.8em;
}
ul.download-links li {
padding: 0px 10px 0px 0px; margin: 0;
display: inline;
padding-bottom: 5px !important;
}
ul.download-links li.download-source {
background: url(images/icon_source.png) no-repeat 0px 0px;
padding-left: 18px;
}
ul.download-links li.download-windows {
background: url(images/icon_windows.png) no-repeat 0px 0px;
padding-left: 18px;
}
ul.download-links li.download-debian {
background: url(images/icon_debian.png) no-repeat 0px 0px;
padding-left: 18px;
}
ul.download-links li.download-osx {
background: url(images/icon_osx.png) no-repeat 0px 0px;
padding-left: 18px;
}
ul.download-links li.download-external {
background: url(images/icon_links.png) no-repeat 0px 0px;
padding-left: 18px;
}
a { color: #22d; text-decoration: none }
a:visited { color: #219 }
a:hover { color: #22d; text-decoration: underline; cursor: hand; }
h1 a, h1 a:visited, h1 a:hover { color: #fff; text-decoration: none }
h2 a, h2 a:visited, h2 a:hover { color: #000; text-decoration: none }
h3 a, h3 a:visited, h3 a:hover { color: #000; text-decoration: none }
.navigation-header a {
color: white;
text-decoration: none;
padding: 4px 10px;
text-shadow: 0 1px 2px #000;
transition: background-color 300ms;
border-radius: 4px;
}
.navigation-header a:visited { color: white; text-decoration: none }
.navigation-header a:hover { color: white; text-decoration: none; background-color: rgba(255, 255, 255, 0.3) }
span.type { font-family: monospace; font-size: 16px; }
/* Version info */
#version_info {
float: right;
font-size: 0.8em;
color: #888;
padding: 3px 15px 0px 0px;
}
/* Menu items */
ul.menu {
list-style-type: none;
padding: 0; margin: 0;
}
ul.menu-upper {
list-style-type: none;
padding: 0px 0px 0px 15px; margin: 0;
}
ul.menu li {
padding: 0px 0px 10px 20px;
margin: 0px;
}
ul.menu-upper li {
padding: 3px 10px 10px 20px;
font-size: 0.8em;
margin: 0px;
display: inline;
}
ul li.item-introduction {
background: url(images/icon_introduction.png) no-repeat 0px 3px;
}
ul li.item-download {
background: url(images/icon_download.png) no-repeat 0px 3px;
}
ul li.item-news {
background: url(images/icon_news.png) no-repeat 0px 3px;
}
ul li.item-documentation {
background: url(images/icon_documentation.png) no-repeat 0px 3px;
}
ul li.item-screenshots {
background: url(images/icon_screenshots.png) no-repeat 0px 3px;
}
ul li.item-community {
background: url(images/icon_community.png) no-repeat 0px 3px;
}
ul li.item-links {
background: url(images/icon_links.png) no-repeat 0px 3px;
}
ul li.item-license {
background: url(images/icon_license.png) no-repeat 0px 3px;
}
/* Forms */
label {
display: block;
float: left;
width: 130px;
font-weight: bold;
}
label.normal {
color: #444;
}
div.explanation {
border-left: 130px solid white;
font-size: 0.8em;
color: #888;
}
div.example-contents {
display: none;
}
.example p.title {
color: blue;
font-size:0.8em;
}
.example p.title b:before {
content: '\25B6\00a0';
}
.example p.title:hover {
color: #00f;
text-decoration: underline;
cursor: hand;
}
.warning {
background-color: #ffc;
padding: 0.2em 1em;
border: 1px solid #f80;
}
.warning .title {
color: #f80;
}
@@ -0,0 +1,23 @@
function getElementByClass(element, className) {
tc = element.childNodes;
for (var i = 0; i < tc.length; i++) {
if (tc[i].className == className) { return tc[i]; }
}
return null;
}
function toggle(target, event) {
exdiv = getElementByClass(target, "example");
excdiv = getElementByClass(exdiv, "example-contents");
titlediv = getElementByClass(exdiv, "title");
if (!titlediv || !titlediv.contains(event.target)) {
return;
}
if (excdiv.style.display != 'block') {
excdiv.style.display = 'block';
} else {
excdiv.style.display = 'none';
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

File diff suppressed because it is too large Load Diff
+172
View File
@@ -0,0 +1,172 @@
<?xml version="1.0"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY igraph "igraph">
<!ENTITY version "@IGRAPH_VERSION@">
<!ENTITY mdash "&#8212;">
<!ENTITY aacute "&#xe1;">
<!ENTITY ccaron "&#269;">
<!ENTITY uuml "&#252;">
<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED
'http://www.w3.org/2001/XInclude'" >
]>
<book id="index" xmlns:xi="http://www.w3.org/2001/XInclude">
<bookinfo>
<title>&igraph; Reference Manual</title>
<releaseinfo>&version;</releaseinfo>
<authorgroup>
<author><firstname>Gábor</firstname><surname>Csárdi</surname>
<affiliation>
<orgname>Department of Statistics, Harvard University</orgname>
<address>1 Oxford street, Cambridge, MA, 02138 USA</address>
</affiliation>
</author>
<author><firstname>Tamás</firstname><surname>Nepusz</surname>
<affiliation>
<orgname>Department of Biological Physics, Eötvös Loránd University</orgname>
<address>1/a Pázmány Péter sétány, 1117 Budapest, Hungary</address>
</affiliation>
</author>
<author><firstname>Vincent</firstname><surname>Traag</surname>
<affiliation>
<orgname>Centre for Science and Technology Studies, Leiden University</orgname>
<address>Room B5.31, Kolffpad 1, 2333 BN Leiden, Netherlands</address>
</affiliation>
</author>
<author><firstname>Szabolcs</firstname><surname>Horvát</surname>
<affiliation>
<orgname>Department of Computer Science, Reykjavik University</orgname>
<address>Menntavegur 1, 102 Reykjavík, Iceland</address>
</affiliation>
</author>
<author><firstname>Fabio</firstname><surname>Zanini</surname>
<affiliation>
<orgname>Lowy Cancer Research Centre, University of New South Wales</orgname>
<address>Room 211, Botany and High St, Kensington, NSW, 2033, Australia</address>
</affiliation>
</author>
<author><firstname>Daniel</firstname><surname>Noom</surname>
<affiliation>
<orgname>jitjit software development</orgname>
<address>Amsterdam, Netherlands</address>
</affiliation>
</author>
</authorgroup>
<legalnotice>
<para>This manual is for &igraph;, version &version;.</para>
<para>
Copyright (C) 2005-2019 Gábor Csárdi and Tamás Nepusz.
Copyright (C) 2020-2025 igraph development team.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
Texts. A copy of the license is included in the section entitled
<quote>GNU Free Documentation License</quote>.
</para>
</legalnotice>
</bookinfo>
<xi:include href="introduction.xml"/>
<xi:include href="installation.xml"/>
<xi:include href="tutorial.xml"/>
<xi:include href="basicigraph.xml"/>
<xi:include href="error.xml"/>
<xi:include href="memory.xml" />
<chapter id="igraph-Data-structures">
<title>Data structure library: vector, matrix, other data types</title>
<xi:include href="pmt.xml"/>
<xi:include href="vector.xml"/>
<xi:include href="matrix.xml"/>
<xi:include href="sparsemat.xml"/>
<xi:include href="stack.xml"/>
<xi:include href="dqueue.xml"/>
<xi:include href="heap.xml"/>
<xi:include href="strvector.xml"/>
<xi:include href="vectorlist.xml"/>
<xi:include href="adjlist.xml"/>
<xi:include href="psumtree.xml"/>
<xi:include href="bitset.xml"/>
</chapter>
<xi:include href="random.xml"/>
<xi:include href="iterators.xml"/>
<xi:include href="attributes.xml"/>
<xi:include href="generators.xml"/>
<xi:include href="games.xml"/>
<xi:include href="bipartite.xml"/>
<xi:include href="spatial.xml"/>
<xi:include href="operators.xml"/>
<xi:include href="visitors.xml"/>
<xi:include href="structural.xml"/>
<xi:include href="cycles.xml"/>
<xi:include href="cliques.xml"/>
<xi:include href="motifs.xml"/>
<xi:include href="isomorphism.xml"/>
<xi:include href="coloring.xml"/>
<xi:include href="flows.xml"/>
<xi:include href="separators.xml"/>
<xi:include href="community.xml"/>
<xi:include href="graphlets.xml"/>
<xi:include href="hrg.xml"/>
<xi:include href="embedding.xml"/>
<xi:include href="layout.xml"/>
<xi:include href="processes.xml"/>
<xi:include href="foreign.xml"/>
<xi:include href="linalg.xml"/>
<xi:include href="nongraph.xml"/>
<chapter id="igraph-Advanced">
<title>Advanced igraph programming</title>
<xi:include href="threading.xml" />
<xi:include href="progress.xml" />
<xi:include href="status.xml" />
</chapter>
<xi:include href="glossary.xml"/>
<xi:include href="licenses.xml"/>
<index/>
</book>
+47
View File
@@ -0,0 +1,47 @@
.\" Hey, Emacs! This is an -*- nroff -*- source file.
.\"
.\" Copyright (C) 2006-2021 The igraph development team
.\"
.\" This is free software; you can redistribute it and/or modify it under
.\" the terms of the GNU General Public License as published by the Free
.\" Software Foundation; either version 2, or (at your option) any later
.\" version.
.\"
.\" This is distributed in the hope that it will be useful, but WITHOUT
.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
.\" for more details.
.\"
.\" You should have received a copy of the GNU General Public License with
.\" your Debian GNU/Linux system, in /usr/share/common-licenses/GPL, or with
.\" the dpkg source package as the file COPYING. If not, write to the Free
.\" Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
.\"
.TH IGRAPH 3 "May 2021" "igraph library"
.SH NAME
igraph \- a library for creating and manipulating graphs
.SH DESCRIPTION
.B igraph
is a C library for complex network analysis and graph theory, with emphasis on
efficiency, portability and ease of use.
.SH DOCUMENTATION
The full documentation can be downloaded from the homepage of the
library:
.RI < https://igraph.org/c/doc >
.SH BUGS
If you think you have found a bug in igraph, feel free to file a bug report
in the issue tracker at:
.RI < https://github.com/igraph/igraph/issues >
.SH AUTHORS
Gabor Csardi <csardi.gabor@gmail.com>,
.br
Tamas Nepusz <ntamas@gmail.com>,
.br
Vincent Traag <vtraag@gmail.com>,
.br
Szabolcs Horvat <szhorvat@gmail.com>,
.br
Fabio Zanini <fabio.zanini@fastmail.fm>,
.br
Daniel Noom <ggatw@outlook.com>
Binary file not shown.
@@ -0,0 +1,634 @@
<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY igraph "igraph">
]>
<chapter id="igraph-Installation">
<title>Installation</title>
<para>
This chapter describes building igraph from source code and installing it.
The source archive of the latest stable release is always available
<ulink url="https://igraph.org/c/#downloads">from the igraph website</ulink>.
igraph is also included in many Linux distributions, as well as several package
managers such as <ulink url="https://vcpkg.io/">vcpkg</ulink> (convenient on Windows),
<ulink url="https://www.macports.org/">MacPorts</ulink> (macOS) and
<ulink url="https://brew.sh/">Homebrew</ulink> (macOS), which provide an easier
means of installation. If you decide to use them, please consult their documentation
on how to install packages.
</para>
<section id="igraph-Installation-prerequisites">
<title>Prerequisites</title>
<para>
To build igraph from sources, you will need at least:
</para>
<itemizedlist>
<listitem>
<para>
<ulink url="https://cmake.org">CMake</ulink> 3.18 or later
</para>
</listitem>
<listitem>
<para>
C and C++ compilers
</para>
</listitem>
</itemizedlist>
<para>
Visual Studio 2015 and later are supported. Earlier Visual Studio
versions may or may not work.
</para>
<para>
Certain features also require the following libraries:
</para>
<itemizedlist>
<listitem>
<para>
<ulink url="http://www.xmlsoft.org/">libxml2</ulink>,
required for GraphML support
</para>
</listitem>
</itemizedlist>
<para>
igraph bundles a number of libraries for convenience. However, it is
preferable to use external versions of these libraries, which may
improve performance. These are:
</para>
<itemizedlist>
<listitem>
<para>
<ulink url="https://gmplib.org/">GMP</ulink> (the bundled
alternative is Mini-GMP)
</para>
</listitem>
<listitem>
<para>
<ulink url="https://www.gnu.org/software/glpk/">GLPK</ulink> (version 4.57 or later)
</para>
</listitem>
<listitem>
<para>
<ulink url="https://github.com/opencollab/arpack-ng">ARPACK</ulink>
</para>
</listitem>
<listitem>
<para>
<ulink url="https://github.com/ntamas/plfit">plfit</ulink>
</para>
</listitem>
<listitem>
<para>
A library providing a
<ulink url="https://www.netlib.org/blas/">BLAS</ulink> API
(available by default on macOS;
<ulink url="http://www.openmathlib.org/OpenBLAS/">OpenBLAS</ulink> is one
option on other systems)
</para>
</listitem>
<listitem>
<para>
A library providing a
<ulink url="https://www.netlib.org/lapack/">LAPACK</ulink>
API (available by default on macOS;
<ulink url="http://www.openmathlib.org/OpenBLAS/">OpenBLAS</ulink> is one
option on other systems)
</para>
</listitem>
</itemizedlist>
<para>
When building the development version of igraph,
<literal>bison</literal>, <literal>flex</literal> and
<literal>git</literal> are also required. Released versions do not
require these tools.
</para>
<para>
To run the tests, <literal>diff</literal> is also required.
</para>
</section>
<section id="igraph-Installation-installation">
<title>Installation</title>
<section id="igraph-Installation-general-build-instructions">
<title>General build instructions</title>
<para>
igraph uses a
<ulink url="https://cmake.org/cmake/help/latest/guide/user-interaction/index.html">CMake-based
build system</ulink>. To compile it,
</para>
<itemizedlist>
<listitem>
<para>
Enter the directory where the igraph sources are:
<programlisting>
$ cd igraph
</programlisting>
</para>
</listitem>
<listitem>
<para>
Create a new directory. This is where igraph will be built:
<programlisting>
$ mkdir build
$ cd build
</programlisting>
</para>
</listitem>
<listitem>
<para>
Run CMake, which will automatically configure igraph, and
report the configuration:
<programlisting>
$ cmake ..
</programlisting>
To set a non-default installation location, such as
<literal>/opt/local</literal>, use:
<programlisting>cmake .. -DCMAKE_INSTALL_PREFIX=/opt/local</programlisting>
</para>
</listitem>
<listitem>
<para>
Check the output carefully, and ensure that all features you
need are enabled. If CMake could not find certain libraries,
some features such as GraphML support may have been
automatically disabled.
</para>
</listitem>
<listitem>
<para>
There are several ways to adjust the configuration:
</para>
<itemizedlist>
<listitem>
<para>
Run <literal>ccmake .</literal> on Unix-like systems or
<literal>cmake-gui</literal> on Windows for a convenient
interface.
</para>
</listitem>
<listitem>
<para>
Simply edit the <literal>CMakeCache.txt</literal> file.
Some of the relevant options are listed below.
</para>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<para>
Once the configuration has been adjusted, run
<literal>cmake ..</literal> again.
</para>
</listitem>
<listitem>
<para>
Once igraph has been successfully configured, it can be built,
tested and installed using:
<programlisting>
$ cmake --build .
$ cmake --build . --target check
$ cmake --install .
</programlisting>
</para>
</listitem>
</itemizedlist>
</section>
<section id="igraph-Installation-specific-instructions-for-windows">
<title>Specific instructions for Windows</title>
<section id="igraph-Installation-microsoft-visual-studio">
<title>Microsoft Visual Studio</title>
<para>
With Visual Studio, the steps to build igraph are generally the
same as above. However, since the Visual Studio CMake generator is
a multi-configuration one, we must specify the configuration
(typically Release or Debug) with each build command using the
<literal>--config</literal> option:
</para>
<programlisting>
mkdir build
cd build
cmake ..
cmake --build . --config Release
cmake --build . --target check --config Release
</programlisting>
<para>
When building the development version, <literal>bison</literal>
and <literal>flex</literal> must be available on the system.
<ulink url="https://github.com/lexxmark/winflexbison"><literal>winflexbison</literal></ulink>
for Bison version 3.x can be useful for this purpose—make sure
that the executables are in the system <literal>PATH</literal>.
The easiest installation option is probably by installing
<literal>winflexbison3</literal> from the
<ulink url="https://chocolatey.org/packages/winflexbison3">Chocolatey
package manager</ulink>.
</para>
<section id="igraph-Installation-vcpkg">
<title>vcpkg</title>
<para>
Most external dependencies can be conveniently installed using
<ulink url="https://github.com/microsoft/vcpkg#quick-start-windows"><literal>vcpkg</literal></ulink>.
Note that <literal>igraph</literal> bundles all dependencies
except <literal>libxml2</literal>, which is needed for GraphML
support.
</para>
<para>
In order to use vcpkg integrate it in the build environment by executing
<literal>vcpkg.exe integrate install</literal> on the command line.
When configuring igraph, point CMake to the correct
<literal>vcpkg.cmake</literal> file using <literal>-DCMAKE_TOOLCHAIN_FILE=...</literal>,
as instructed.
</para>
<para>
Additionally, it might be that you need to set the appropriate
so-called triplet using
<literal>-DVCPKG_TARGET_TRIPLET</literal> when running
<literal>cmake</literal>, for exampling, setting it to
<literal>x64-windows</literal> when using shared builds of packages or
<literal>x64-windows-static</literal> when using static builds.
Similarly, you also need to specify this target triplet when
installing packages. For example, to install
<literal>libxml2</literal> as a shared library, use
<literal>vcpkg.exe install libxml2:x64-windows</literal> and to
install <literal>libxml2</literal> as a static library, use
<literal>vcpkg.exe install libxml2:x64-windows-static</literal>.
In addition, there is the possibility to use a static library
with dynamic runtime linking using the
<literal>x64-windows-static-md</literal> triplet.
</para>
</section>
</section>
<section id="igraph-Installation-msys2">
<title>MSYS2</title>
<para>
MSYS2 can be installed from <ulink url="https://www.msys2.org/">msys2.org</ulink>. After installing MSYS2,
ensure that it is up to date by opening a terminal and running
<literal>pacman -Syuu</literal>.
</para>
<para>
The instructions below assume that you want to compile for a 64-bit
target.
</para>
<para>
Install the following packages using <literal>pacman -S</literal>.
</para>
<itemizedlist>
<listitem>
<para>
Minimal requirements:
<literal>mingw-w64-x86_64-toolchain</literal>,
<literal>mingw-w64-x86_64-cmake</literal>.
</para>
</listitem>
<listitem>
<para>
Optional dependencies that enable certain features:
<literal>mingw-w64-x86_64-gmp</literal>,
<literal>mingw-w64-x86_64-libxml2</literal>
</para>
</listitem>
<listitem>
<para>
Optional external libraries for better performance:
<literal>mingw-w64-x86_64-openblas</literal>,
<literal>mingw-w64-x86_64-arpack</literal>,
<literal>mingw-w64-x86_64-glpk</literal>
</para>
</listitem>
<listitem>
<para>
Only needed for running the tests: <literal>diffutils</literal>
</para>
</listitem>
<listitem>
<para>
Required only when building the development version:
<literal>git</literal>, <literal>bison</literal>,
<literal>flex</literal>
</para>
</listitem>
</itemizedlist>
<para>
The following command will install of these at once:
</para>
<programlisting>
pacman -S \
mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake \
mingw-w64-x86_64-gmp mingw-w64-x86_64-libxml2 \
mingw-w64-x86_64-openblas mingw-w64-x86_64-arpack \
mingw-w64-x86_64-glpk diffutils git bison flex
</programlisting>
<para>
In order to build igraph, follow the <emphasis role="strong">General
build instructions</emphasis> above, paying attention to the
following:
</para>
<itemizedlist>
<listitem>
<para>
When using MSYS2, start the <quote>MSYS2 MinGW 64-bit</quote>
terminal, and <emphasis>not</emphasis> the <quote>MSYS2
MSYS</quote> one.
</para>
</listitem>
<listitem>
<para>
Be sure to install the <literal>mingw-w64-x86_64-cmake</literal>
package and not the <literal>cmake</literal> one. The latter
will not work.
</para>
</listitem>
<listitem>
<para>
When running <literal>cmake</literal>, pass the option
<literal>-G&quot;MSYS Makefiles&quot;</literal>.
</para>
</listitem>
<listitem>
<para>
Note that <literal>ccmake</literal> is not currently available.
<literal>cmake-gui</literal> can be used only if the
<literal>mingw-w64-x86_64-qt5</literal> package is installed.
</para>
</listitem>
</itemizedlist>
</section>
</section>
<section id="igraph-Installation-notable-configuration-options">
<title>Notable configuration options</title>
<para>
The following options may be set to <literal>ON</literal> or
<literal>OFF</literal>. Some of them have an <literal>AUTO</literal>
setting, which chooses a reasonable default based on what libraries
are available on the current system.
</para>
<itemizedlist>
<listitem>
<para>
igraph bundles some of its dependencies for convenience. The
<literal>IGRAPH_USE_INTERNAL_XXX</literal> flags control whether
these should be used instead of external versions. Set them to
<literal>ON</literal> to use the bundled
(<quote>vendored</quote>) versions. Generally, external versions
are preferable as they may be newer and usually provide better
performance.
</para>
</listitem>
<listitem>
<para>
<literal>IGRAPH_GLPK_SUPPORT</literal>: whether to make use of
the
<ulink url="https://www.gnu.org/software/glpk/">GLPK</ulink>
library. Some features, such as finding a minimum feedback arc
set or finding communities through exact modularity
optimization, require this.
</para>
</listitem>
<listitem>
<para>
<literal>IGRAPH_GRAPHML_SUPPORT</literal>: whether to enable
support for reading and writing
<ulink url="http://graphml.graphdrawing.org/">GraphML</ulink>
files. Requires the
<ulink url="http://xmlsoft.org/">libxml2</ulink> library.
</para>
</listitem>
<listitem>
<para>
<literal>IGRAPH_INFOMAP_SUPPORT</literal>: whether to enable
the Infomap community detection algorithm. The Infomap library
is licensed under the GPLv3+. Compiling it into igraph causes
GPLv3+ to apply to the resulting binary, instead of igraph's
GPLv2+ license.
</para>
</listitem>
<listitem>
<para>
<literal>IGRAPH_OPENMP_SUPPORT</literal>: whether to use OpenMP
parallelization to accelerate certain functions such as PageRank
calculation. Compiler support is required.
</para>
</listitem>
<listitem>
<para>
<literal>IGRAPH_ENABLE_LTO</literal>: whether to build igraph
with link-time optimization, which improves performance. Not
supported with all compilers.
</para>
</listitem>
<listitem>
<para>
<literal>IGRAPH_ENABLE_TLS</literal>: whether to enable
thread-local storage. Required when using igraph from multiple
threads.
</para>
</listitem>
<listitem>
<para>
<literal>IGRAPH_WARNINGS_AS_ERRORS</literal>: whether to treat
compiler warnings as errors. We strive to eliminate all compiler
warnings during development so this switch is turned on by default.
If your compiler prints warnings for some parts of the code that we
did not anticipate, you can turn off this option to prevent the
warnings from stopping the compilation.
</para>
</listitem>
<listitem>
<para>
<ulink url="https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html"><literal>BUILD_SHARED_LIBS</literal></ulink>:
whether to build a shared library instead of a static one.
</para>
</listitem>
<listitem>
<para>
<literal>BLA_VENDOR</literal>: controls which library to use for
<ulink url="https://cmake.org/cmake/help/latest/module/FindBLAS.html">BLAS</ulink>
and
<ulink url="https://cmake.org/cmake/help/latest/module/FindLAPACK.html">LAPACK</ulink>
functionality.
</para>
</listitem>
<listitem>
<para>
<ulink url="https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html"><literal>CMAKE_INSTALL_PREFIX</literal></ulink>:
the location where igraph will be installed.
</para>
</listitem>
</itemizedlist>
</section>
</section>
<section id="igraph-Installation-building-the-documentation">
<title>Building the documentation</title>
<para>
Most users will not need to build the documentation, as the release
tarball contains pre-built HTML documentation in the <literal>doc</literal>
directory.
</para>
<para>
To build the documentation for the development version, simply build the
<literal>html</literal>, <literal>pdf</literal> or <literal>info</literal>
targets for the HTML, PDF and Info versions of the documentation,
respectively.
</para>
<programlisting>
$ cmake --build . --target html
</programlisting>
<para>
Building the HTML documentation requires Python 3, <literal>xmlto</literal>
and <literal>source-highlight</literal>. On some platforms, it is necessary
to explicitly install the docbook-xsl package as well. Building the PDF
documentation also requires <literal>xsltproc</literal>,
<literal>xmllint</literal> and <literal>fop</literal>. Building the Texinfo
documentation also requires the docbook2X package, <literal>xmllint</literal>
and <literal>makeinfo</literal>.
</para>
</section>
<section id="igraph-Installation-notes-for-package-maintainers">
<title>Notes for package maintainers</title>
<para>
This section is for people who package igraph for Linux distros or
other package managers. Please read it carefully before packaging
igraph.
</para>
<section id="igraph-Installation-auto-detection-of-dependencies">
<title>Auto-detection of dependencies</title>
<para>
igraph bundles several of its dependencies (or simplified versions
of its dependencies). During configuration time, it checks whether
each dependency is present on the system. If yes, it uses it.
Otherwise, it falls back to the bundled (<quote>vendored</quote>)
version. In order to make configuration as deterministic as
possible, you may want to disable this auto-detection. To do so, set
each of the <literal>IGRAPH_USE_INTERNAL_XXX</literal> options
described above. Additionally, set <literal>BLA_VENDOR</literal> to
use the BLAS and LAPACK implementations of your choice. This should
be the same BLAS and LAPACK library that igraph's other dependencies
(e.g., ARPACK) are linked against.
</para>
<para>
For example, to force igraph to use external versions of all
dependencies except plfit, and to use OpenBLAS for BLAS/LAPACK, use
</para>
<para>
<programlisting>
$ cmake .. \
-DIGRAPH_USE_INTERNAL_BLAS=OFF \
-DIGRAPH_USE_INTERNAL_LAPACK=OFF \
-DIGRAPH_USE_INTERNAL_ARPACK=OFF \
-DIGRAPH_USE_INTERNAL_GLPK=OFF \
-DIGRAPH_USE_INTERNAL_GMP=OFF \
-DIGRAPH_USE_INTERNAL_PLFIT=ON \
-DBLA_VENDOR=OpenBLAS \
-DIGRAPH_GRAPHML_SUPPORT=ON
</programlisting>
</para>
</section>
<section id="igraph-Installation-shared-and-static-builds">
<title>Shared and static builds</title>
<para>
On Windows, shared and static builds should not be installed in the same
location. If you decide to do so anyway, keep in mind the following:
Both builds contain an <literal>igraph.lib</literal> file. The static one
should be renamed to avoid conflict. The headers from the static build
are incompatible with the shared library. The headers from the shared build
may be used with the static library, but <literal>IGRAPH_STATIC</literal>
must be defined when compiling programs that will link to igraph statically.
</para>
<para>
These issues do not affect Unix-like systems.
</para>
</section>
<section id="igraph-Installation-cross-compiling">
<title>Cross-compiling</title>
<para>
When building igraph with an internal ARPACK, LAPACK or BLAS, it
makes use of f2c, which compiles and runs the <literal>arithchk</literal>
program at build time to detect the floating point characteristics of the
current system. It writes the results into the <literal>arith.h</literal>
header. However, running this program is not possible when cross-compiling
without providing a userspace emulator that can run executables of the
target platform on the host system. Therefore, when cross-compiling, you
either need to provide such an emulator with the
<literal>CMAKE_CROSSCOMPILING_EMULATOR</literal> option, or you need to
specify a pre-generated version of the <literal>arith.h</literal> header
file through the <literal>F2C_EXTERNAL_ARITH_HEADER</literal>
CMake option. An example version of this header follows for the
x86_64 and arm64 target architectures on macOS. Warning: Do not use this
version of <literal>arith.h</literal> on other systems or architectures.
</para>
<para>
<programlisting>
#define IEEE_8087
#define Arith_Kind_ASL 1
#define Long int
#define Intcast (int)(long)
#define Double_Align
#define X64_bit_pointers
#define NANCHECK
#define QNaN0 0x0
#define QNaN1 0x7ff80000
</programlisting>
</para>
<para>
igraph also checks whether the endianness of <literal>uint64_t</literal>
matches the endianness of <literal>double</literal> on the platform
being compiled. This is needed to ensure that certain functions in igraph's
random number generator work properly. However, it is not possible to
execute this check when cross-compiling without an emulator, so in this
case igraph simply assumes that the endianness matches (which is the case
for the vast majority of platforms anyway). The only case where you might
run into problems is when you cross-compile for Apple Silicon
(<literal>arm64</literal>) from an Intel-based Mac, in which case CMake
might not realize that you are cross-compiling and will try to execute
the check anyway. You can work around this by setting
<literal>IEEE754_DOUBLE_ENDIANNESS_MATCHES</literal> to <literal>ON</literal>
explicitly before invoking CMake.
</para>
<para>
Providing an emulator in <literal>CMAKE_CROSSCOMPILING_EMULATOR</literal>
has the added benefit that you can run the compiled unit tests on the
host platform. We have experimented with cross-compiling to 64-bit ARM
CPUs (<literal>aarch64</literal>) on 64-bit Intel CPUs (<literal>amd64</literal>),
and we can confirm that using <literal>qemu-aarch64</literal> works as a
cross-compiling emulator in this setup.
</para>
</section>
<section id="igraph-Installation-additional-notes">
<title>Additional notes</title>
<itemizedlist>
<listitem>
<para>
As of igraph 0.10, there is no tangible benefit to using an
external GMP, as igraph does not yet use GMP in any
performance-critical way. The bundled Mini-GMP is sufficient.
</para>
</listitem>
<listitem>
<para>
Link-time optimization noticeably improves the performance of
some igraph functions. To enable it, use
<literal>-DIGRAPH_ENABLE_LTO=ON</literal>.
The <literal>AUTO</literal> setting is also supported, and will
enable link-time optimization only if the current compiler
supports it. Note that this is detected by CMake, and the
detection is not always accurate.
</para>
</listitem>
<listitem>
<para>
We saw occasional hangs on Windows when igraph was built for a
32-bit target with MinGW and linked to OpenBLAS. We believe this
to be an issue with OpenBLAS, not igraph. On this platform, you
may want to opt for a different BLAS/LAPACK or the bundled
BLAS/LAPACK.
</para>
</listitem>
</itemizedlist>
</section>
</section>
</chapter>
@@ -0,0 +1,109 @@
<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY igraph "igraph">
]>
<chapter id="igraph-Introduction">
<title>Introduction</title>
<para>
igraph is a library for creating and manipulating graphs.
You can look at it in two ways: first, igraph contains the implementation
of quite a lot of graph algorithms. These include classic graph
algorithms like graph isomorphism, graph girth and connectivity and
also the new wave graph algorithms like transitivity, graph motifs and
community structure detection. Skim through the table of contents
or the index of this book to get an impression of what is available.</para>
<para>
Second, igraph provides a platform for developing and/or
implementing graph algorithms. It has an efficient data structure
for representing graphs, and a number of other data structures like
flexible vectors, stacks, heaps, queues, adjacency lists that are useful for implementing graph algorithms. In fact these data structures evolved along with the
implementation of the classic and non-classic graph algorithms which
make up the major part of the igraph library. This way, they were fine-tuned
and checked for correctness several times.
</para>
<para>
Our main goal with developing igraph was to create a graph library
which is efficient on large, but not extremely large graphs. More
precisely, it is assumed that the graph(s) fit into the physical
memory of the computer. Nowadays this means graphs with
several million vertices and/or edges. Our definition of efficient is
that it runs fast, both in theory and (more importantly) in practice.
</para>
<para>
We believe that one of the big strengths of igraph is that it can be
embedded into a higher-level language or environment. Three such
embeddings (or interfaces if you look at them another way)
are currently being developed by us: an R
package, a Python extension module, and a Mathematica (Wolfram Language) package. Others are
likely to come. High level languages such as R or Python make it
possible to use graph routines with much greater comfort, without
actually writing a single line of C code. They have some, usually very
small, speed penalty compared to the C version, but add ease of use and much
flexibility. This manual, however, covers only the C library. If you
want to use Python, R or the Wolfram Language, please see the documentation written
specifically for these interfaces and come back here only if you are
interested in some detail which is not covered in those documents.
</para>
<para>
We still consider igraph as a child project. It has much room for
development and we are sure that it will improve a lot in the near
future. Any feedback we can get from the users is very important for
us, as most of the time these questions and comments guide us in what
to add and what to improve.
</para>
<para>
igraph is open source and distributed under the terms of the GNU GPL
version 2 or (at your option) any later version.
We strongly believe that all the algorithms used in science, let that
be graph theory or not, should have an efficient open-source
implementation allowing use and modification for anyone.
</para>
<section id="igraph-is-free-software"><title>&igraph; is free software</title>
<para>
igraph library
</para><para>
Copyright (C) 2003-2004 Gábor Csárdi &lt;csardi.gabor@gmail.com>
</para><para>
Copyright (C) 2005-2019 Gábor Csárdi &lt;csardi.gabor@gmail.com> and Tamás Nepusz &lt;ntamas@gmail.com>
</para><para>
Copyright (C) 2020-2023 The igraph development team
</para><para>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
</para><para>
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
</para><para>
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc.
</para>
</section>
<section id="citing-igraph"><title>Citing &igraph;</title>
<para>
To cite &igraph; in publications, please use the following
reference:
</para><para>
Gábor Csárdi, Tamás Nepusz: The igraph software package for complex network
research. InterJournal Complex Systems, 1695, 2006.
</para><para>
The igraph C library is assigned the DOI <ulink url="https://doi.org/10.5281/zenodo.3630268">10.5281/zenodo.3630268</ulink> on Zenodo.
</para>
</section>
</chapter>
@@ -0,0 +1,63 @@
<?xml version="1.0"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY igraph "igraph">
]>
<chapter id="igraph-Isomorphism">
<title>Graph isomorphism</title>
<section id="isomorphism-simple-interface"><title>The simple interface</title>
<!-- doxrox-include about_graph_isomorphism -->
<!-- doxrox-include igraph_isomorphic -->
<!-- doxrox-include igraph_subisomorphic -->
<!-- doxrox-include igraph_count_automorphisms -->
<!-- doxrox-include igraph_automorphism_group -->
<!-- doxrox-include igraph_canonical_permutation -->
</section>
<section id="bliss-algorithm"><title>The BLISS algorithm</title>
<!-- doxrox-include about_bliss -->
<!-- doxrox-include igraph_bliss_sh_t -->
<!-- doxrox-include igraph_bliss_info_t -->
<!-- doxrox-include igraph_isomorphic_bliss -->
<!-- doxrox-include igraph_count_automorphisms_bliss -->
<!-- doxrox-include igraph_automorphism_group_bliss -->
<!-- doxrox-include igraph_canonical_permutation_bliss -->
</section>
<section id="vf2-algorithm"><title>The VF2 algorithm</title>
<!-- doxrox-include about_vf2 -->
<!-- doxrox-include igraph_isomorphic_vf2 -->
<!-- doxrox-include igraph_count_isomorphisms_vf2 -->
<!-- doxrox-include igraph_get_isomorphisms_vf2 -->
<!-- doxrox-include igraph_get_isomorphisms_vf2_callback -->
<!-- doxrox-include igraph_isohandler_t -->
<!-- doxrox-include igraph_isocompat_t -->
<!-- doxrox-include igraph_subisomorphic_vf2 -->
<!-- doxrox-include igraph_count_subisomorphisms_vf2 -->
<!-- doxrox-include igraph_get_subisomorphisms_vf2 -->
<!-- doxrox-include igraph_get_subisomorphisms_vf2_callback -->
</section>
<section id="lad-algorithm"><title>The LAD algorithm</title>
<!-- doxrox-include about_lad -->
<!-- doxrox-include igraph_subisomorphic_lad -->
</section>
<section id="functions-for-graphs-with-3-or-4-vertices"><title>Functions for small graphs</title>
<!-- doxrox-include igraph_isoclass -->
<!-- doxrox-include igraph_isoclass_subgraph -->
<!-- doxrox-include igraph_isoclass_create -->
<!-- doxrox-include igraph_graph_count -->
</section>
<section id="isomorphism-utility-functions"><title>Utility functions</title>
<!-- doxrox-include igraph_invert_permutation -->
<!-- doxrox-include igraph_permute_vertices -->
<!-- doxrox-include igraph_simplify_and_colorize -->
</section>
</chapter>
+101
View File
@@ -0,0 +1,101 @@
<?xml version="1.0"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY igraph "igraph">
]>
<chapter id="igraph-Iterators">
<title>Vertex and edge selectors and sequences, iterators</title>
<section id="about-iterators">
<!-- doxrox-include about_iterators -->
</section>
<section id="vertex-selector-constructors"><title>Vertex selector constructors</title>
<!-- doxrox-include about_vertex_selectors -->
<!-- doxrox-include igraph_vs_all -->
<!-- doxrox-include igraph_vs_adj -->
<!-- doxrox-include igraph_vs_nonadj -->
<!-- doxrox-include igraph_vs_none -->
<!-- doxrox-include igraph_vs_1 -->
<!-- doxrox-include igraph_vs_vector -->
<!-- doxrox-include igraph_vs_vector_small -->
<!-- doxrox-include igraph_vs_vector_copy -->
<!-- doxrox-include igraph_vs_range -->
</section>
<section id="generic-vertex-selector-operations"><title>Generic vertex selector operations</title>
<!-- doxrox-include igraph_vs_copy -->
<!-- doxrox-include igraph_vs_destroy -->
<!-- doxrox-include igraph_vs_is_all -->
<!-- doxrox-include igraph_vs_size -->
<!-- doxrox-include igraph_vs_type -->
</section>
<section id="immediate-vertex-selectors"><title>Immediate vertex selectors</title>
<!-- doxrox-include igraph_vss_all -->
<!-- doxrox-include igraph_vss_none -->
<!-- doxrox-include igraph_vss_1 -->
<!-- doxrox-include igraph_vss_vector -->
<!-- doxrox-include igraph_vss_range -->
</section>
<section id="vertex-iterators"><title>Vertex iterators</title>
<!-- doxrox-include igraph_vit_create -->
<!-- doxrox-include igraph_vit_destroy -->
<section id="stepping-over-vertices"><!-- doxrox-include IGRAPH_VIT --></section>
<!-- doxrox-include IGRAPH_VIT_NEXT -->
<!-- doxrox-include IGRAPH_VIT_END -->
<!-- doxrox-include IGRAPH_VIT_SIZE -->
<!-- doxrox-include IGRAPH_VIT_RESET -->
<!-- doxrox-include IGRAPH_VIT_GET -->
</section>
<section id="edge-selector-constructors"><title>Edge selector constructors</title>
<!-- doxrox-include igraph_es_all -->
<!-- doxrox-include igraph_es_incident -->
<!-- doxrox-include igraph_es_none -->
<!-- doxrox-include igraph_es_1 -->
<!-- doxrox-include igraph_es_all_between -->
<!-- doxrox-include igraph_es_vector -->
<!-- doxrox-include igraph_es_range -->
<!-- doxrox-include igraph_es_pairs -->
<!-- doxrox-include igraph_es_pairs_small -->
<!-- doxrox-include igraph_es_path -->
<!-- doxrox-include igraph_es_vector_copy -->
</section>
<section id="immediate-edge-selectors"><title>Immediate edge selectors</title>
<!-- doxrox-include igraph_ess_all -->
<!-- doxrox-include igraph_ess_none -->
<!-- doxrox-include igraph_ess_1 -->
<!-- doxrox-include igraph_ess_vector -->
<!-- doxrox-include igraph_ess_range -->
</section>
<section id="generic-edge-selector-operations"><title>Generic edge selector operations</title>
<!-- doxrox-include igraph_es_as_vector -->
<!-- doxrox-include igraph_es_copy -->
<!-- doxrox-include igraph_es_destroy -->
<!-- doxrox-include igraph_es_is_all -->
<!-- doxrox-include igraph_es_size -->
<!-- doxrox-include igraph_es_type -->
</section>
<section id="edge-iterators"><title>Edge iterators</title>
<!-- doxrox-include igraph_eit_create -->
<!-- doxrox-include igraph_eit_destroy -->
<section id="stepping-over-edges"><!-- doxrox-include IGRAPH_EIT --></section>
<!-- doxrox-include IGRAPH_EIT_NEXT -->
<!-- doxrox-include IGRAPH_EIT_END -->
<!-- doxrox-include IGRAPH_EIT_SIZE -->
<!-- doxrox-include IGRAPH_EIT_RESET -->
<!-- doxrox-include IGRAPH_EIT_GET -->
</section>
<!--
<section id="examples"><title>Examples</title>
</section>
-->
</chapter>
+57
View File
@@ -0,0 +1,57 @@
<?xml version="1.0"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY igraph "igraph">
]>
<chapter id="igraph-Layout">
<title>Generating layouts for graph drawing</title>
<section id="two-d-layout-generators"><title>2D layout generators</title>
<!-- doxrox-include about_layouts -->
<!-- doxrox-include igraph_layout_random -->
<!-- doxrox-include igraph_layout_circle -->
<!-- doxrox-include igraph_layout_star -->
<!-- doxrox-include igraph_layout_grid -->
<!-- doxrox-include igraph_layout_graphopt -->
<!-- doxrox-include igraph_layout_bipartite -->
<section id="drl-layout-generator"><title>The DrL layout generator</title>
<!-- doxrox-include about_drl -->
<!-- doxrox-include igraph_layout_drl_options_t -->
<!-- doxrox-include igraph_layout_drl_default_t -->
<!-- doxrox-include igraph_layout_drl_options_init -->
<!-- doxrox-include igraph_layout_drl -->
<!-- doxrox-include igraph_layout_drl_3d -->
</section>
<!-- doxrox-include igraph_layout_fruchterman_reingold -->
<!-- doxrox-include igraph_layout_kamada_kawai -->
<!-- doxrox-include igraph_layout_gem -->
<!-- doxrox-include igraph_layout_davidson_harel -->
<!-- doxrox-include igraph_layout_mds -->
<!-- doxrox-include igraph_layout_lgl -->
</section>
<section id="layouts-for-trees-and-acyclic-graphs"><title>Layouts for trees and acyclic graphs</title>
<!-- doxrox-include igraph_layout_reingold_tilford -->
<!-- doxrox-include igraph_layout_reingold_tilford_circular -->
<!-- doxrox-include igraph_roots_for_tree_layout -->
<!-- doxrox-include igraph_layout_sugiyama -->
<!-- doxrox-include igraph_layout_umap -->
<!-- doxrox-include igraph_layout_umap_compute_weights -->
</section>
<section id="three-d-layout-generators"><title>3D layout generators</title>
<!-- doxrox-include igraph_layout_random_3d -->
<!-- doxrox-include igraph_layout_sphere -->
<!-- doxrox-include igraph_layout_grid_3d -->
<!-- doxrox-include igraph_layout_fruchterman_reingold_3d -->
<!-- doxrox-include igraph_layout_kamada_kawai_3d -->
<!-- doxrox-include igraph_layout_umap_3d -->
</section>
<section id="pp-layouts"><title>Post-processing layouts</title>
<!-- doxrox-include igraph_layout_merge_dla -->
<!-- doxrox-include igraph_layout_align -->
</section>
</chapter>
+14
View File
@@ -0,0 +1,14 @@
<?xml version="1.0"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED
'http://www.w3.org/2001/XInclude'" >
]>
<chapter id="igraph-Licenses">
<title>Licenses for igraph and this manual</title>
<xi:include href="gpl.xml"/>
<xi:include href="fdl.xml"/>
</chapter>
@@ -0,0 +1,515 @@
CeCILL-B FREE SOFTWARE LICENSE AGREEMENT
Notice
This Agreement is a Free Software license agreement that is the result
of discussions between its authors in order to ensure compliance with
the two main principles guiding its drafting:
* firstly, compliance with the principles governing the distribution
of Free Software: access to source code, broad rights granted to
users,
* secondly, the election of a governing law, French law, with which
it is conformant, both as regards the law of torts and
intellectual property law, and the protection that it offers to
both authors and holders of the economic rights over software.
The authors of the CeCILL-B (for Ce[a] C[nrs] I[nria] L[ogiciel] L[ibre])
license are:
Commissariat à l'Energie Atomique - CEA, a public scientific, technical
and industrial research establishment, having its principal place of
business at 25 rue Leblanc, immeuble Le Ponant D, 75015 Paris, France.
Centre National de la Recherche Scientifique - CNRS, a public scientific
and technological establishment, having its principal place of business
at 3 rue Michel-Ange, 75794 Paris cedex 16, France.
Institut National de Recherche en Informatique et en Automatique -
INRIA, a public scientific and technological establishment, having its
principal place of business at Domaine de Voluceau, Rocquencourt, BP
105, 78153 Le Chesnay cedex, France.
Preamble
This Agreement is an open source software license intended to give users
significant freedom to modify and redistribute the software licensed
hereunder.
The exercising of this freedom is conditional upon a strong obligation
of giving credits for everybody that distributes a software
incorporating a software ruled by the current license so as all
contributions to be properly identified and acknowledged.
In consideration of access to the source code and the rights to copy,
modify and redistribute granted by the license, users are provided only
with a limited warranty and the software's author, the holder of the
economic rights, and the successive licensors only have limited liability.
In this respect, the risks associated with loading, using, modifying
and/or developing or reproducing the software by the user are brought to
the user's attention, given its Free Software status, which may make it
complicated to use, with the result that its use is reserved for
developers and experienced professionals having in-depth computer
knowledge. Users are therefore encouraged to load and test the
suitability of the software as regards their requirements in conditions
enabling the security of their systems and/or data to be ensured and,
more generally, to use and operate it in the same conditions of
security. This Agreement may be freely reproduced and published,
provided it is not altered, and that no provisions are either added or
removed herefrom.
This Agreement may apply to any or all software for which the holder of
the economic rights decides to submit the use thereof to its provisions.
Article 1 - DEFINITIONS
For the purpose of this Agreement, when the following expressions
commence with a capital letter, they shall have the following meaning:
Agreement: means this license agreement, and its possible subsequent
versions and annexes.
Software: means the software in its Object Code and/or Source Code form
and, where applicable, its documentation, "as is" when the Licensee
accepts the Agreement.
Initial Software: means the Software in its Source Code and possibly its
Object Code form and, where applicable, its documentation, "as is" when
it is first distributed under the terms and conditions of the Agreement.
Modified Software: means the Software modified by at least one
Contribution.
Source Code: means all the Software's instructions and program lines to
which access is required so as to modify the Software.
Object Code: means the binary files originating from the compilation of
the Source Code.
Holder: means the holder(s) of the economic rights over the Initial
Software.
Licensee: means the Software user(s) having accepted the Agreement.
Contributor: means a Licensee having made at least one Contribution.
Licensor: means the Holder, or any other individual or legal entity, who
distributes the Software under the Agreement.
Contribution: means any or all modifications, corrections, translations,
adaptations and/or new functions integrated into the Software by any or
all Contributors, as well as any or all Internal Modules.
Module: means a set of sources files including their documentation that
enables supplementary functions or services in addition to those offered
by the Software.
External Module: means any or all Modules, not derived from the
Software, so that this Module and the Software run in separate address
spaces, with one calling the other when they are run.
Internal Module: means any or all Module, connected to the Software so
that they both execute in the same address space.
Parties: mean both the Licensee and the Licensor.
These expressions may be used both in singular and plural form.
Article 2 - PURPOSE
The purpose of the Agreement is the grant by the Licensor to the
Licensee of a non-exclusive, transferable and worldwide license for the
Software as set forth in Article 5 hereinafter for the whole term of the
protection granted by the rights over said Software.
Article 3 - ACCEPTANCE
3.1 The Licensee shall be deemed as having accepted the terms and
conditions of this Agreement upon the occurrence of the first of the
following events:
* (i) loading the Software by any or all means, notably, by
downloading from a remote server, or by loading from a physical
medium;
* (ii) the first time the Licensee exercises any of the rights
granted hereunder.
3.2 One copy of the Agreement, containing a notice relating to the
characteristics of the Software, to the limited warranty, and to the
fact that its use is restricted to experienced users has been provided
to the Licensee prior to its acceptance as set forth in Article 3.1
hereinabove, and the Licensee hereby acknowledges that it has read and
understood it.
Article 4 - EFFECTIVE DATE AND TERM
4.1 EFFECTIVE DATE
The Agreement shall become effective on the date when it is accepted by
the Licensee as set forth in Article 3.1.
4.2 TERM
The Agreement shall remain in force for the entire legal term of
protection of the economic rights over the Software.
Article 5 - SCOPE OF RIGHTS GRANTED
The Licensor hereby grants to the Licensee, who accepts, the following
rights over the Software for any or all use, and for the term of the
Agreement, on the basis of the terms and conditions set forth hereinafter.
Besides, if the Licensor owns or comes to own one or more patents
protecting all or part of the functions of the Software or of its
components, the Licensor undertakes not to enforce the rights granted by
these patents against successive Licensees using, exploiting or
modifying the Software. If these patents are transferred, the Licensor
undertakes to have the transferees subscribe to the obligations set
forth in this paragraph.
5.1 RIGHT OF USE
The Licensee is authorized to use the Software, without any limitation
as to its fields of application, with it being hereinafter specified
that this comprises:
1. permanent or temporary reproduction of all or part of the Software
by any or all means and in any or all form.
2. loading, displaying, running, or storing the Software on any or
all medium.
3. entitlement to observe, study or test its operation so as to
determine the ideas and principles behind any or all constituent
elements of said Software. This shall apply when the Licensee
carries out any or all loading, displaying, running, transmission
or storage operation as regards the Software, that it is entitled
to carry out hereunder.
5.2 ENTITLEMENT TO MAKE CONTRIBUTIONS
The right to make Contributions includes the right to translate, adapt,
arrange, or make any or all modifications to the Software, and the right
to reproduce the resulting software.
The Licensee is authorized to make any or all Contributions to the
Software provided that it includes an explicit notice that it is the
author of said Contribution and indicates the date of the creation thereof.
5.3 RIGHT OF DISTRIBUTION
In particular, the right of distribution includes the right to publish,
transmit and communicate the Software to the general public on any or
all medium, and by any or all means, and the right to market, either in
consideration of a fee, or free of charge, one or more copies of the
Software by any means.
The Licensee is further authorized to distribute copies of the modified
or unmodified Software to third parties according to the terms and
conditions set forth hereinafter.
5.3.1 DISTRIBUTION OF SOFTWARE WITHOUT MODIFICATION
The Licensee is authorized to distribute true copies of the Software in
Source Code or Object Code form, provided that said distribution
complies with all the provisions of the Agreement and is accompanied by:
1. a copy of the Agreement,
2. a notice relating to the limitation of both the Licensor's
warranty and liability as set forth in Articles 8 and 9,
and that, in the event that only the Object Code of the Software is
redistributed, the Licensee allows effective access to the full Source
Code of the Software at a minimum during the entire period of its
distribution of the Software, it being understood that the additional
cost of acquiring the Source Code shall not exceed the cost of
transferring the data.
5.3.2 DISTRIBUTION OF MODIFIED SOFTWARE
If the Licensee makes any Contribution to the Software, the resulting
Modified Software may be distributed under a license agreement other
than this Agreement subject to compliance with the provisions of Article
5.3.4.
5.3.3 DISTRIBUTION OF EXTERNAL MODULES
When the Licensee has developed an External Module, the terms and
conditions of this Agreement do not apply to said External Module, that
may be distributed under a separate license agreement.
5.3.4 CREDITS
Any Licensee who may distribute a Modified Software hereby expressly
agrees to:
1. indicate in the related documentation that it is based on the
Software licensed hereunder, and reproduce the intellectual
property notice for the Software,
2. ensure that written indications of the Software intended use,
intellectual property notice and license hereunder are included in
easily accessible format from the Modified Software interface,
3. mention, on a freely accessible website describing the Modified
Software, at least throughout the distribution term thereof, that
it is based on the Software licensed hereunder, and reproduce the
Software intellectual property notice,
4. where it is distributed to a third party that may distribute a
Modified Software without having to make its source code
available, make its best efforts to ensure that said third party
agrees to comply with the obligations set forth in this Article .
If the Software, whether or not modified, is distributed with an
External Module designed for use in connection with the Software, the
Licensee shall submit said External Module to the foregoing obligations.
5.3.5 COMPATIBILITY WITH THE CeCILL AND CeCILL-C LICENSES
Where a Modified Software contains a Contribution subject to the CeCILL
license, the provisions set forth in Article 5.3.4 shall be optional.
A Modified Software may be distributed under the CeCILL-C license. In
such a case the provisions set forth in Article 5.3.4 shall be optional.
Article 6 - INTELLECTUAL PROPERTY
6.1 OVER THE INITIAL SOFTWARE
The Holder owns the economic rights over the Initial Software. Any or
all use of the Initial Software is subject to compliance with the terms
and conditions under which the Holder has elected to distribute its work
and no one shall be entitled to modify the terms and conditions for the
distribution of said Initial Software.
The Holder undertakes that the Initial Software will remain ruled at
least by this Agreement, for the duration set forth in Article 4.2.
6.2 OVER THE CONTRIBUTIONS
The Licensee who develops a Contribution is the owner of the
intellectual property rights over this Contribution as defined by
applicable law.
6.3 OVER THE EXTERNAL MODULES
The Licensee who develops an External Module is the owner of the
intellectual property rights over this External Module as defined by
applicable law and is free to choose the type of agreement that shall
govern its distribution.
6.4 JOINT PROVISIONS
The Licensee expressly undertakes:
1. not to remove, or modify, in any manner, the intellectual property
notices attached to the Software;
2. to reproduce said notices, in an identical manner, in the copies
of the Software modified or not.
The Licensee undertakes not to directly or indirectly infringe the
intellectual property rights of the Holder and/or Contributors on the
Software and to take, where applicable, vis-à-vis its staff, any and all
measures required to ensure respect of said intellectual property rights
of the Holder and/or Contributors.
Article 7 - RELATED SERVICES
7.1 Under no circumstances shall the Agreement oblige the Licensor to
provide technical assistance or maintenance services for the Software.
However, the Licensor is entitled to offer this type of services. The
terms and conditions of such technical assistance, and/or such
maintenance, shall be set forth in a separate instrument. Only the
Licensor offering said maintenance and/or technical assistance services
shall incur liability therefor.
7.2 Similarly, any Licensor is entitled to offer to its licensees, under
its sole responsibility, a warranty, that shall only be binding upon
itself, for the redistribution of the Software and/or the Modified
Software, under terms and conditions that it is free to decide. Said
warranty, and the financial terms and conditions of its application,
shall be subject of a separate instrument executed between the Licensor
and the Licensee.
Article 8 - LIABILITY
8.1 Subject to the provisions of Article 8.2, the Licensee shall be
entitled to claim compensation for any direct loss it may have suffered
from the Software as a result of a fault on the part of the relevant
Licensor, subject to providing evidence thereof.
8.2 The Licensor's liability is limited to the commitments made under
this Agreement and shall not be incurred as a result of in particular:
(i) loss due the Licensee's total or partial failure to fulfill its
obligations, (ii) direct or consequential loss that is suffered by the
Licensee due to the use or performance of the Software, and (iii) more
generally, any consequential loss. In particular the Parties expressly
agree that any or all pecuniary or business loss (i.e. loss of data,
loss of profits, operating loss, loss of customers or orders,
opportunity cost, any disturbance to business activities) or any or all
legal proceedings instituted against the Licensee by a third party,
shall constitute consequential loss and shall not provide entitlement to
any or all compensation from the Licensor.
Article 9 - WARRANTY
9.1 The Licensee acknowledges that the scientific and technical
state-of-the-art when the Software was distributed did not enable all
possible uses to be tested and verified, nor for the presence of
possible defects to be detected. In this respect, the Licensee's
attention has been drawn to the risks associated with loading, using,
modifying and/or developing and reproducing the Software which are
reserved for experienced users.
The Licensee shall be responsible for verifying, by any or all means,
the suitability of the product for its requirements, its good working
order, and for ensuring that it shall not cause damage to either persons
or properties.
9.2 The Licensor hereby represents, in good faith, that it is entitled
to grant all the rights over the Software (including in particular the
rights set forth in Article 5).
9.3 The Licensee acknowledges that the Software is supplied "as is" by
the Licensor without any other express or tacit warranty, other than
that provided for in Article 9.2 and, in particular, without any warranty
as to its commercial value, its secured, safe, innovative or relevant
nature.
Specifically, the Licensor does not warrant that the Software is free
from any error, that it will operate without interruption, that it will
be compatible with the Licensee's own equipment and software
configuration, nor that it will meet the Licensee's requirements.
9.4 The Licensor does not either expressly or tacitly warrant that the
Software does not infringe any third party intellectual property right
relating to a patent, software or any other property right. Therefore,
the Licensor disclaims any and all liability towards the Licensee
arising out of any or all proceedings for infringement that may be
instituted in respect of the use, modification and redistribution of the
Software. Nevertheless, should such proceedings be instituted against
the Licensee, the Licensor shall provide it with technical and legal
assistance for its defense. Such technical and legal assistance shall be
decided on a case-by-case basis between the relevant Licensor and the
Licensee pursuant to a memorandum of understanding. The Licensor
disclaims any and all liability as regards the Licensee's use of the
name of the Software. No warranty is given as regards the existence of
prior rights over the name of the Software or as regards the existence
of a trademark.
Article 10 - TERMINATION
10.1 In the event of a breach by the Licensee of its obligations
hereunder, the Licensor may automatically terminate this Agreement
thirty (30) days after notice has been sent to the Licensee and has
remained ineffective.
10.2 A Licensee whose Agreement is terminated shall no longer be
authorized to use, modify or distribute the Software. However, any
licenses that it may have granted prior to termination of the Agreement
shall remain valid subject to their having been granted in compliance
with the terms and conditions hereof.
Article 11 - MISCELLANEOUS
11.1 EXCUSABLE EVENTS
Neither Party shall be liable for any or all delay, or failure to
perform the Agreement, that may be attributable to an event of force
majeure, an act of God or an outside cause, such as defective
functioning or interruptions of the electricity or telecommunications
networks, network paralysis following a virus attack, intervention by
government authorities, natural disasters, water damage, earthquakes,
fire, explosions, strikes and labor unrest, war, etc.
11.2 Any failure by either Party, on one or more occasions, to invoke
one or more of the provisions hereof, shall under no circumstances be
interpreted as being a waiver by the interested Party of its right to
invoke said provision(s) subsequently.
11.3 The Agreement cancels and replaces any or all previous agreements,
whether written or oral, between the Parties and having the same
purpose, and constitutes the entirety of the agreement between said
Parties concerning said purpose. No supplement or modification to the
terms and conditions hereof shall be effective as between the Parties
unless it is made in writing and signed by their duly authorized
representatives.
11.4 In the event that one or more of the provisions hereof were to
conflict with a current or future applicable act or legislative text,
said act or legislative text shall prevail, and the Parties shall make
the necessary amendments so as to comply with said act or legislative
text. All other provisions shall remain effective. Similarly, invalidity
of a provision of the Agreement, for any reason whatsoever, shall not
cause the Agreement as a whole to be invalid.
11.5 LANGUAGE
The Agreement is drafted in both French and English and both versions
are deemed authentic.
Article 12 - NEW VERSIONS OF THE AGREEMENT
12.1 Any person is authorized to duplicate and distribute copies of this
Agreement.
12.2 So as to ensure coherence, the wording of this Agreement is
protected and may only be modified by the authors of the License, who
reserve the right to periodically publish updates or new versions of the
Agreement, each with a separate number. These subsequent versions may
address new issues encountered by Free Software.
12.3 Any Software distributed under a given version of the Agreement may
only be subsequently distributed under the same version of the Agreement
or a subsequent version.
Article 13 - GOVERNING LAW AND JURISDICTION
13.1 The Agreement is governed by French law. The Parties agree to
endeavor to seek an amicable solution to any disagreements or disputes
that may arise during the performance of the Agreement.
13.2 Failing an amicable solution within two (2) months as from their
occurrence, and unless emergency proceedings are necessary, the
disagreements or disputes shall be referred to the Paris Courts having
jurisdiction, by the more diligent Party.
Version 1.0 dated 2006-09-05.
@@ -0,0 +1,519 @@
CONTRAT DE LICENCE DE LOGICIEL LIBRE CeCILL-B
Avertissement
Ce contrat est une licence de logiciel libre issue d'une concertation
entre ses auteurs afin que le respect de deux grands principes préside à
sa rédaction:
* d'une part, le respect des principes de diffusion des logiciels
libres: accès au code source, droits étendus conférés aux
utilisateurs,
* d'autre part, la désignation d'un droit applicable, le droit
français, auquel elle est conforme, tant au regard du droit de la
responsabilité civile que du droit de la propriété intellectuelle
et de la protection qu'il offre aux auteurs et titulaires des
droits patrimoniaux sur un logiciel.
Les auteurs de la licence CeCILL-B (pour Ce[a] C[nrs] I[nria] L[ogiciel]
L[ibre]) sont:
Commissariat à l'Energie Atomique - CEA, établissement public de
recherche à caractère scientifique, technique et industriel, dont le
siège est situé 25 rue Leblanc, immeuble Le Ponant D, 75015 Paris.
Centre National de la Recherche Scientifique - CNRS, établissement
public à caractère scientifique et technologique, dont le siège est
situé 3 rue Michel-Ange, 75794 Paris cedex 16.
Institut National de Recherche en Informatique et en Automatique -
INRIA, établissement public à caractère scientifique et technologique,
dont le siège est situé Domaine de Voluceau, Rocquencourt, BP 105, 78153
Le Chesnay cedex.
Préambule
Ce contrat est une licence de logiciel libre dont l'objectif est de
conférer aux utilisateurs une très large liberté de modification et de
redistribution du logiciel régi par cette licence.
L'exercice de cette liberté est assorti d'une obligation forte de
citation à la charge de ceux qui distribueraient un logiciel incorporant
un logiciel régi par la présente licence afin d'assurer que les
contributions de tous soient correctement identifiées et reconnues.
L'accessibilité au code source et les droits de copie, de modification
et de redistribution qui découlent de ce contrat ont pour contrepartie
de n'offrir aux utilisateurs qu'une garantie limitée et de ne faire
peser sur l'auteur du logiciel, le titulaire des droits patrimoniaux et
les concédants successifs qu'une responsabilité restreinte.
A cet égard l'attention de l'utilisateur est attirée sur les risques
associés au chargement, à l'utilisation, à la modification et/ou au
développement et à la reproduction du logiciel par l'utilisateur étant
donné sa spécificité de logiciel libre, qui peut le rendre complexe à
manipuler et qui le réserve donc à des développeurs ou des
professionnels avertis possédant des connaissances informatiques
approfondies. Les utilisateurs sont donc invités à charger et tester
l'adéquation du logiciel à leurs besoins dans des conditions permettant
d'assurer la sécurité de leurs systèmes et/ou de leurs données et, plus
généralement, à l'utiliser et l'exploiter dans les mêmes conditions de
sécurité. Ce contrat peut être reproduit et diffusé librement, sous
réserve de le conserver en l'état, sans ajout ni suppression de clauses.
Ce contrat est susceptible de s'appliquer à tout logiciel dont le
titulaire des droits patrimoniaux décide de soumettre l'exploitation aux
dispositions qu'il contient.
Article 1 - DEFINITIONS
Dans ce contrat, les termes suivants, lorsqu'ils seront écrits avec une
lettre capitale, auront la signification suivante:
Contrat: désigne le présent contrat de licence, ses éventuelles versions
postérieures et annexes.
Logiciel: désigne le logiciel sous sa forme de Code Objet et/ou de Code
Source et le cas échéant sa documentation, dans leur état au moment de
l'acceptation du Contrat par le Licencié.
Logiciel Initial: désigne le Logiciel sous sa forme de Code Source et
éventuellement de Code Objet et le cas échéant sa documentation, dans
leur état au moment de leur première diffusion sous les termes du Contrat.
Logiciel Modifié: désigne le Logiciel modifié par au moins une
Contribution.
Code Source: désigne l'ensemble des instructions et des lignes de
programme du Logiciel et auquel l'accès est nécessaire en vue de
modifier le Logiciel.
Code Objet: désigne les fichiers binaires issus de la compilation du
Code Source.
Titulaire: désigne le ou les détenteurs des droits patrimoniaux d'auteur
sur le Logiciel Initial.
Licencié: désigne le ou les utilisateurs du Logiciel ayant accepté le
Contrat.
Contributeur: désigne le Licencié auteur d'au moins une Contribution.
Concédant: désigne le Titulaire ou toute personne physique ou morale
distribuant le Logiciel sous le Contrat.
Contribution: désigne l'ensemble des modifications, corrections,
traductions, adaptations et/ou nouvelles fonctionnalités intégrées dans
le Logiciel par tout Contributeur, ainsi que tout Module Interne.
Module: désigne un ensemble de fichiers sources y compris leur
documentation qui permet de réaliser des fonctionnalités ou services
supplémentaires à ceux fournis par le Logiciel.
Module Externe: désigne tout Module, non dérivé du Logiciel, tel que ce
Module et le Logiciel s'exécutent dans des espaces d'adressage
différents, l'un appelant l'autre au moment de leur exécution.
Module Interne: désigne tout Module lié au Logiciel de telle sorte
qu'ils s'exécutent dans le même espace d'adressage.
Parties: désigne collectivement le Licencié et le Concédant.
Ces termes s'entendent au singulier comme au pluriel.
Article 2 - OBJET
Le Contrat a pour objet la concession par le Concédant au Licencié d'une
licence non exclusive, cessible et mondiale du Logiciel telle que
définie ci-après à l'article 5 pour toute la durée de protection des droits
portant sur ce Logiciel.
Article 3 - ACCEPTATION
3.1 L'acceptation par le Licencié des termes du Contrat est réputée
acquise du fait du premier des faits suivants:
* (i) le chargement du Logiciel par tout moyen notamment par
téléchargement à partir d'un serveur distant ou par chargement à
partir d'un support physique;
* (ii) le premier exercice par le Licencié de l'un quelconque des
droits concédés par le Contrat.
3.2 Un exemplaire du Contrat, contenant notamment un avertissement
relatif aux spécificités du Logiciel, à la restriction de garantie et à
la limitation à un usage par des utilisateurs expérimentés a été mis à
disposition du Licencié préalablement à son acceptation telle que
définie à l'article 3.1 ci dessus et le Licencié reconnaît en avoir pris
connaissance.
Article 4 - ENTREE EN VIGUEUR ET DUREE
4.1 ENTREE EN VIGUEUR
Le Contrat entre en vigueur à la date de son acceptation par le Licencié
telle que définie en 3.1.
4.2 DUREE
Le Contrat produira ses effets pendant toute la durée légale de
protection des droits patrimoniaux portant sur le Logiciel.
Article 5 - ETENDUE DES DROITS CONCEDES
Le Concédant concède au Licencié, qui accepte, les droits suivants sur
le Logiciel pour toutes destinations et pour la durée du Contrat dans
les conditions ci-après détaillées.
Par ailleurs, si le Concédant détient ou venait à détenir un ou
plusieurs brevets d'invention protégeant tout ou partie des
fonctionnalités du Logiciel ou de ses composants, il s'engage à ne pas
opposer les éventuels droits conférés par ces brevets aux Licenciés
successifs qui utiliseraient, exploiteraient ou modifieraient le
Logiciel. En cas de cession de ces brevets, le Concédant s'engage à
faire reprendre les obligations du présent alinéa aux cessionnaires.
5.1 DROIT D'UTILISATION
Le Licencié est autorisé à utiliser le Logiciel, sans restriction quant
aux domaines d'application, étant ci-après précisé que cela comporte:
1. la reproduction permanente ou provisoire du Logiciel en tout ou
partie par tout moyen et sous toute forme.
2. le chargement, l'affichage, l'exécution, ou le stockage du
Logiciel sur tout support.
3. la possibilité d'en observer, d'en étudier, ou d'en tester le
fonctionnement afin de déterminer les idées et principes qui sont
à la base de n'importe quel élément de ce Logiciel; et ceci,
lorsque le Licencié effectue toute opération de chargement,
d'affichage, d'exécution, de transmission ou de stockage du
Logiciel qu'il est en droit d'effectuer en vertu du Contrat.
5.2 DROIT D'APPORTER DES CONTRIBUTIONS
Le droit d'apporter des Contributions comporte le droit de traduire,
d'adapter, d'arranger ou d'apporter toute autre modification au Logiciel
et le droit de reproduire le logiciel en résultant.
Le Licencié est autorisé à apporter toute Contribution au Logiciel sous
réserve de mentionner, de façon explicite, son nom en tant qu'auteur de
cette Contribution et la date de création de celle-ci.
5.3 DROIT DE DISTRIBUTION
Le droit de distribution comporte notamment le droit de diffuser, de
transmettre et de communiquer le Logiciel au public sur tout support et
par tout moyen ainsi que le droit de mettre sur le marché à titre
onéreux ou gratuit, un ou des exemplaires du Logiciel par tout procédé.
Le Licencié est autorisé à distribuer des copies du Logiciel, modifié ou
non, à des tiers dans les conditions ci-après détaillées.
5.3.1 DISTRIBUTION DU LOGICIEL SANS MODIFICATION
Le Licencié est autorisé à distribuer des copies conformes du Logiciel,
sous forme de Code Source ou de Code Objet, à condition que cette
distribution respecte les dispositions du Contrat dans leur totalité et
soit accompagnée:
1. d'un exemplaire du Contrat,
2. d'un avertissement relatif à la restriction de garantie et de
responsabilité du Concédant telle que prévue aux articles 8
et 9,
et que, dans le cas où seul le Code Objet du Logiciel est redistribué,
le Licencié permette un accès effectif au Code Source complet du
Logiciel pendant au moins toute la durée de sa distribution du Logiciel,
étant entendu que le coût additionnel d'acquisition du Code Source ne
devra pas excéder le simple coût de transfert des données.
5.3.2 DISTRIBUTION DU LOGICIEL MODIFIE
Lorsque le Licencié apporte une Contribution au Logiciel, le Logiciel
Modifié peut être distribué sous un contrat de licence autre que le
présent Contrat sous réserve du respect des dispositions de l'article
5.3.4.
5.3.3 DISTRIBUTION DES MODULES EXTERNES
Lorsque le Licencié a développé un Module Externe les conditions du
Contrat ne s'appliquent pas à ce Module Externe, qui peut être distribué
sous un contrat de licence différent.
5.3.4 CITATIONS
Le Licencié qui distribue un Logiciel Modifié s'engage expressément:
1. à indiquer dans sa documentation qu'il a été réalisé à partir du
Logiciel régi par le Contrat, en reproduisant les mentions de
propriété intellectuelle du Logiciel,
2. à faire en sorte que l'utilisation du Logiciel, ses mentions de
propriété intellectuelle et le fait qu'il est régi par le Contrat
soient indiqués dans un texte facilement accessible depuis
l'interface du Logiciel Modifié,
3. à mentionner, sur un site Web librement accessible décrivant le
Logiciel Modifié, et pendant au moins toute la durée de sa
distribution, qu'il a été réalisé à partir du Logiciel régi par le
Contrat, en reproduisant les mentions de propriété intellectuelle
du Logiciel,
4. lorsqu'il le distribue à un tiers susceptible de distribuer
lui-même un Logiciel Modifié, sans avoir à en distribuer le code
source, à faire ses meilleurs efforts pour que les obligations du
présent article 5.3.4 soient reprises par le dit tiers.
Lorsque le Logiciel modifié ou non est distribué avec un Module Externe
qui a été conçu pour l'utiliser, le Licencié doit soumettre le dit
Module Externe aux obligations précédentes.
5.3.5 COMPATIBILITE AVEC LES LICENCES CeCILL et CeCILL-C
Lorsqu'un Logiciel Modifié contient une Contribution soumise au contrat
de licence CeCILL, les stipulations prévues à l'article 5.3.4 sont
facultatives.
Un Logiciel Modifié peut être distribué sous le contrat de licence
CeCILL-C. Les stipulations prévues à l'article 5.3.4 sont alors
facultatives.
Article 6 - PROPRIETE INTELLECTUELLE
6.1 SUR LE LOGICIEL INITIAL
Le Titulaire est détenteur des droits patrimoniaux sur le Logiciel
Initial. Toute utilisation du Logiciel Initial est soumise au respect
des conditions dans lesquelles le Titulaire a choisi de diffuser son
oeuvre et nul autre n'a la faculté de modifier les conditions de
diffusion de ce Logiciel Initial.
Le Titulaire s'engage à ce que le Logiciel Initial reste au moins régi
par le Contrat et ce, pour la durée visée à l'article 4.2.
6.2 SUR LES CONTRIBUTIONS
Le Licencié qui a développé une Contribution est titulaire sur celle-ci
des droits de propriété intellectuelle dans les conditions définies par
la législation applicable.
6.3 SUR LES MODULES EXTERNES
Le Licencié qui a développé un Module Externe est titulaire sur celui-ci
des droits de propriété intellectuelle dans les conditions définies par
la législation applicable et reste libre du choix du contrat régissant
sa diffusion.
6.4 DISPOSITIONS COMMUNES
Le Licencié s'engage expressément:
1. à ne pas supprimer ou modifier de quelque manière que ce soit les
mentions de propriété intellectuelle apposées sur le Logiciel;
2. à reproduire à l'identique lesdites mentions de propriété
intellectuelle sur les copies du Logiciel modifié ou non.
Le Licencié s'engage à ne pas porter atteinte, directement ou
indirectement, aux droits de propriété intellectuelle du Titulaire et/ou
des Contributeurs sur le Logiciel et à prendre, le cas échéant, à
l'égard de son personnel toutes les mesures nécessaires pour assurer le
respect des dits droits de propriété intellectuelle du Titulaire et/ou
des Contributeurs.
Article 7 - SERVICES ASSOCIES
7.1 Le Contrat n'oblige en aucun cas le Concédant à la réalisation de
prestations d'assistance technique ou de maintenance du Logiciel.
Cependant le Concédant reste libre de proposer ce type de services. Les
termes et conditions d'une telle assistance technique et/ou d'une telle
maintenance seront alors déterminés dans un acte séparé. Ces actes de
maintenance et/ou assistance technique n'engageront que la seule
responsabilité du Concédant qui les propose.
7.2 De même, tout Concédant est libre de proposer, sous sa seule
responsabilité, à ses licenciés une garantie, qui n'engagera que lui,
lors de la redistribution du Logiciel et/ou du Logiciel Modifié et ce,
dans les conditions qu'il souhaite. Cette garantie et les modalités
financières de son application feront l'objet d'un acte séparé entre le
Concédant et le Licencié.
Article 8 - RESPONSABILITE
8.1 Sous réserve des dispositions de l'article 8.2, le Licencié a la
faculté, sous réserve de prouver la faute du Concédant concerné, de
solliciter la réparation du préjudice direct qu'il subirait du fait du
Logiciel et dont il apportera la preuve.
8.2 La responsabilité du Concédant est limitée aux engagements pris en
application du Contrat et ne saurait être engagée en raison notamment:
(i) des dommages dus à l'inexécution, totale ou partielle, de ses
obligations par le Licencié, (ii) des dommages directs ou indirects
découlant de l'utilisation ou des performances du Logiciel subis par le
Licencié et (iii) plus généralement d'un quelconque dommage indirect. En
particulier, les Parties conviennent expressément que tout préjudice
financier ou commercial (par exemple perte de données, perte de
bénéfices, perte d'exploitation, perte de clientèle ou de commandes,
manque à gagner, trouble commercial quelconque) ou toute action dirigée
contre le Licencié par un tiers, constitue un dommage indirect et
n'ouvre pas droit à réparation par le Concédant.
Article 9 - GARANTIE
9.1 Le Licencié reconnaît que l'état actuel des connaissances
scientifiques et techniques au moment de la mise en circulation du
Logiciel ne permet pas d'en tester et d'en vérifier toutes les
utilisations ni de détecter l'existence d'éventuels défauts. L'attention
du Licencié a été attirée sur ce point sur les risques associés au
chargement, à l'utilisation, la modification et/ou au développement et à
la reproduction du Logiciel qui sont réservés à des utilisateurs avertis.
Il relève de la responsabilité du Licencié de contrôler, par tous
moyens, l'adéquation du produit à ses besoins, son bon fonctionnement et
de s'assurer qu'il ne causera pas de dommages aux personnes et aux biens.
9.2 Le Concédant déclare de bonne foi être en droit de concéder
l'ensemble des droits attachés au Logiciel (comprenant notamment les
droits visés à l'article 5).
9.3 Le Licencié reconnaît que le Logiciel est fourni "en l'état" par le
Concédant sans autre garantie, expresse ou tacite, que celle prévue à
l'article 9.2 et notamment sans aucune garantie sur sa valeur commerciale,
son caractère sécurisé, innovant ou pertinent.
En particulier, le Concédant ne garantit pas que le Logiciel est exempt
d'erreur, qu'il fonctionnera sans interruption, qu'il sera compatible
avec l'équipement du Licencié et sa configuration logicielle ni qu'il
remplira les besoins du Licencié.
9.4 Le Concédant ne garantit pas, de manière expresse ou tacite, que le
Logiciel ne porte pas atteinte à un quelconque droit de propriété
intellectuelle d'un tiers portant sur un brevet, un logiciel ou sur tout
autre droit de propriété. Ainsi, le Concédant exclut toute garantie au
profit du Licencié contre les actions en contrefaçon qui pourraient être
diligentées au titre de l'utilisation, de la modification, et de la
redistribution du Logiciel. Néanmoins, si de telles actions sont
exercées contre le Licencié, le Concédant lui apportera son aide
technique et juridique pour sa défense. Cette aide technique et
juridique est déterminée au cas par cas entre le Concédant concerné et
le Licencié dans le cadre d'un protocole d'accord. Le Concédant dégage
toute responsabilité quant à l'utilisation de la dénomination du
Logiciel par le Licencié. Aucune garantie n'est apportée quant à
l'existence de droits antérieurs sur le nom du Logiciel et sur
l'existence d'une marque.
Article 10 - RESILIATION
10.1 En cas de manquement par le Licencié aux obligations mises à sa
charge par le Contrat, le Concédant pourra résilier de plein droit le
Contrat trente (30) jours après notification adressée au Licencié et
restée sans effet.
10.2 Le Licencié dont le Contrat est résilié n'est plus autorisé à
utiliser, modifier ou distribuer le Logiciel. Cependant, toutes les
licences qu'il aura concédées antérieurement à la résiliation du Contrat
resteront valides sous réserve qu'elles aient été effectuées en
conformité avec le Contrat.
Article 11 - DISPOSITIONS DIVERSES
11.1 CAUSE EXTERIEURE
Aucune des Parties ne sera responsable d'un retard ou d'une défaillance
d'exécution du Contrat qui serait dû à un cas de force majeure, un cas
fortuit ou une cause extérieure, telle que, notamment, le mauvais
fonctionnement ou les interruptions du réseau électrique ou de
télécommunication, la paralysie du réseau liée à une attaque
informatique, l'intervention des autorités gouvernementales, les
catastrophes naturelles, les dégâts des eaux, les tremblements de terre,
le feu, les explosions, les grèves et les conflits sociaux, l'état de
guerre...
11.2 Le fait, par l'une ou l'autre des Parties, d'omettre en une ou
plusieurs occasions de se prévaloir d'une ou plusieurs dispositions du
Contrat, ne pourra en aucun cas impliquer renonciation par la Partie
intéressée à s'en prévaloir ultérieurement.
11.3 Le Contrat annule et remplace toute convention antérieure, écrite
ou orale, entre les Parties sur le même objet et constitue l'accord
entier entre les Parties sur cet objet. Aucune addition ou modification
aux termes du Contrat n'aura d'effet à l'égard des Parties à moins
d'être faite par écrit et signée par leurs représentants dûment habilités.
11.4 Dans l'hypothèse où une ou plusieurs des dispositions du Contrat
s'avèrerait contraire à une loi ou à un texte applicable, existants ou
futurs, cette loi ou ce texte prévaudrait, et les Parties feraient les
amendements nécessaires pour se conformer à cette loi ou à ce texte.
Toutes les autres dispositions resteront en vigueur. De même, la
nullité, pour quelque raison que ce soit, d'une des dispositions du
Contrat ne saurait entraîner la nullité de l'ensemble du Contrat.
11.5 LANGUE
Le Contrat est rédigé en langue française et en langue anglaise, ces
deux versions faisant également foi.
Article 12 - NOUVELLES VERSIONS DU CONTRAT
12.1 Toute personne est autorisée à copier et distribuer des copies de
ce Contrat.
12.2 Afin d'en préserver la cohérence, le texte du Contrat est protégé
et ne peut être modifié que par les auteurs de la licence, lesquels se
réservent le droit de publier périodiquement des mises à jour ou de
nouvelles versions du Contrat, qui posséderont chacune un numéro
distinct. Ces versions ultérieures seront susceptibles de prendre en
compte de nouvelles problématiques rencontrées par les logiciels libres.
12.3 Tout Logiciel diffusé sous une version donnée du Contrat ne pourra
faire l'objet d'une diffusion ultérieure que sous la même version du
Contrat ou une version postérieure.
Article 13 - LOI APPLICABLE ET COMPETENCE TERRITORIALE
13.1 Le Contrat est régi par la loi française. Les Parties conviennent
de tenter de régler à l'amiable les différends ou litiges qui
viendraient à se produire par suite ou à l'occasion du Contrat.
13.2 A défaut d'accord amiable dans un délai de deux (2) mois à compter
de leur survenance et sauf situation relevant d'une procédure d'urgence,
les différends ou litiges seront portés par la Partie la plus diligente
devant les Tribunaux compétents de Paris.
Version 1.0 du 2006-09-05.
@@ -0,0 +1,280 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
@@ -0,0 +1,621 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
@@ -0,0 +1,458 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
@@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
+54
View File
@@ -0,0 +1,54 @@
<?xml version="1.0"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY igraph "igraph">
<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED
'http://www.w3.org/2001/XInclude'" >
]>
<chapter id="igraph-Linalg">
<title>Using BLAS, LAPACK and ARPACK for igraph matrices and graphs</title>
<section id="about-blas">
<!-- doxrox-include about_blas -->
<!-- doxrox-include igraph_blas_ddot -->
<!-- doxrox-include igraph_blas_dnrm2 -->
<!-- doxrox-include igraph_blas_dgemv -->
<!-- doxrox-include igraph_blas_dgemm -->
<!-- doxrox-include igraph_blas_dgemv_array -->
</section>
<section id="about-lapack">
<!-- doxrox-include about_lapack -->
<section id="matrix-factorization"><title>Matrix factorization, solving linear systems</title>
<!-- doxrox-include igraph_lapack_dgetrf -->
<!-- doxrox-include igraph_lapack_dgetrs -->
<!-- doxrox-include igraph_lapack_dgesv -->
</section>
<section id="eigenvalues"><title>Eigenvalues and eigenvectors of matrices</title>
<!-- doxrox-include igraph_lapack_dsyevr -->
<!-- doxrox-include igraph_lapack_dgeev -->
<!-- doxrox-include igraph_lapack_dgeevx -->
</section>
</section>
<section id="about-arpack">
<!-- doxrox-include about_arpack -->
<section id="arpack-data-structures"><title>Data structures</title>
<!-- doxrox-include igraph_arpack_options_t -->
<!-- doxrox-include igraph_arpack_storage_t -->
<!-- doxrox-include igraph_arpack_function_t -->
<!-- doxrox-include igraph_arpack_options_init -->
<!-- doxrox-include igraph_arpack_storage_init -->
<!-- doxrox-include igraph_arpack_storage_destroy -->
</section>
<section id="arpack-solvers"><title>ARPACK solvers</title>
<!-- doxrox-include igraph_arpack_rssolve -->
<!-- doxrox-include igraph_arpack_rnsolve -->
<!-- doxrox-include igraph_arpack_unpack_complex -->
</section>
</section>
</chapter>
+131
View File
@@ -0,0 +1,131 @@
<?xml version="1.0"?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY igraph "igraph">
]>
<section id="igraph-Matrices">
<title>Matrices</title>
<section id="about-matrix">
<!-- doxrox-include about_igraph_matrix_t_objects -->
</section>
<section id="matrix-constructor-and-destructor">
<!-- doxrox-include igraph_matrix_constructor_and_destructor -->
<!-- doxrox-include igraph_matrix_init -->
<!-- doxrox-include igraph_matrix_init_array -->
<!-- doxrox-include igraph_matrix_init_copy -->
<!-- doxrox-include igraph_matrix_destroy -->
</section>
<section id="matrix-initializing-elements"><title>Initializing elements</title>
<!-- doxrox-include igraph_matrix_null -->
<!-- doxrox-include igraph_matrix_fill -->
</section>
<section id="matrix-accessing-elements">
<!-- doxrox-include igraph_matrix_accessing_elements -->
<!-- doxrox-include MATRIX -->
<!-- doxrox-include igraph_matrix_get -->
<!-- doxrox-include igraph_matrix_get_ptr -->
<!-- doxrox-include igraph_matrix_set -->
</section>
<section id="matrix-views"><title>Matrix views</title>
<!-- doxrox-include igraph_matrix_view -->
<!-- doxrox-include igraph_matrix_view_from_vector -->
</section>
<section id="copying-matrices"><title>Copying matrices</title>
<!-- doxrox-include igraph_matrix_copy_to -->
<!-- doxrox-include igraph_matrix_update -->
<!-- doxrox-include igraph_matrix_swap -->
</section>
<section id="operations-on-rows-and-columns"><title>Operations on rows and columns</title>
<!--doxrox-include igraph_matrix_get_row -->
<!--doxrox-include igraph_matrix_get_col -->
<!--doxrox-include igraph_matrix_set_row -->
<!--doxrox-include igraph_matrix_set_col -->
<!--doxrox-include igraph_matrix_swap_rows -->
<!--doxrox-include igraph_matrix_swap_cols -->
<!--doxrox-include igraph_matrix_select_rows -->
<!--doxrox-include igraph_matrix_select_cols -->
<!--doxrox-include igraph_matrix_select_rows_cols -->
</section>
<section id="matrix-operations"><title>Matrix operations</title>
<!-- doxrox-include igraph_matrix_add_constant -->
<!-- doxrox-include igraph_matrix_scale -->
<!-- doxrox-include igraph_matrix_add -->
<!-- doxrox-include igraph_matrix_sub -->
<!-- doxrox-include igraph_matrix_mul_elements -->
<!-- doxrox-include igraph_matrix_div_elements -->
<!-- doxrox-include igraph_matrix_sum -->
<!-- doxrox-include igraph_matrix_prod -->
<!-- doxrox-include igraph_matrix_rowsum -->
<!-- doxrox-include igraph_matrix_colsum -->
<!-- doxrox-include igraph_matrix_transpose -->
</section>
<section id="matrix-comparisons"><title>Matrix comparisons</title>
<!-- doxrox-include igraph_matrix_all_e -->
<!-- doxrox-include igraph_matrix_all_almost_e -->
<!-- doxrox-include igraph_matrix_all_l -->
<!-- doxrox-include igraph_matrix_all_g -->
<!-- doxrox-include igraph_matrix_all_le -->
<!-- doxrox-include igraph_matrix_all_ge -->
<!-- doxrox-include igraph_matrix_zapsmall -->
</section>
<section id="combining-matrices"><title>Combining matrices</title>
<!-- doxrox-include igraph_matrix_rbind -->
<!-- doxrox-include igraph_matrix_cbind -->
</section>
<section id="matrix-finding-minimum-and-maximum"><title>Finding minimum and maximum</title>
<!-- doxrox-include igraph_matrix_min -->
<!-- doxrox-include igraph_matrix_max -->
<!-- doxrox-include igraph_matrix_which_min -->
<!-- doxrox-include igraph_matrix_which_max -->
<!-- doxrox-include igraph_matrix_minmax -->
<!-- doxrox-include igraph_matrix_which_minmax -->
</section>
<section id="matrix-properties"><title>Matrix properties</title>
<!-- doxrox-include igraph_matrix_empty -->
<!-- doxrox-include igraph_matrix_isnull -->
<!-- doxrox-include igraph_matrix_size -->
<!-- doxrox-include igraph_matrix_capacity -->
<!-- doxrox-include igraph_matrix_nrow -->
<!-- doxrox-include igraph_matrix_ncol -->
<!-- doxrox-include igraph_matrix_is_symmetric -->
<!-- doxrox-include igraph_matrix_maxdifference -->
</section>
<section id="matrix-searching-for-elements"><title>Searching for elements</title>
<!-- doxrox-include igraph_matrix_contains -->
<!-- doxrox-include igraph_matrix_search -->
</section>
<section id="matrix-resizing-operations"><title>Resizing operations</title>
<!-- doxrox-include igraph_matrix_resize -->
<!-- doxrox-include igraph_matrix_resize_min -->
<!-- doxrox-include igraph_matrix_add_rows -->
<!-- doxrox-include igraph_matrix_add_cols -->
<!-- doxrox-include igraph_matrix_remove_row -->
<!-- doxrox-include igraph_matrix_remove_col -->
</section>
<section id="complex-matrices"><title>Complex matrix operations</title>
<!-- doxrox-include igraph_matrix_complex_real -->
<!-- doxrox-include igraph_matrix_complex_imag -->
<!-- doxrox-include igraph_matrix_complex_realimag -->
<!-- doxrox-include igraph_matrix_complex_create -->
<!-- doxrox-include igraph_matrix_complex_create_polar -->
<!-- doxrox-include igraph_matrix_complex_all_almost_e -->
<!-- doxrox-include igraph_matrix_complex_zapsmall -->
</section>
</section>
+22
View File
@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY igraph "igraph">
]>
<chapter id="igraph-Memory">
<title>Memory (de)allocation</title>
<section id="about-alloc-funcs">
<!-- doxrox-include about_alloc_funcs -->
</section>
<section id="available-alloc-funcs">
<title>Available allocation functions</title>
<!-- doxrox-include igraph_malloc -->
<!-- doxrox-include igraph_calloc -->
<!-- doxrox-include igraph_realloc -->
<!-- doxrox-include igraph_free -->
</section>
</chapter>
+33
View File
@@ -0,0 +1,33 @@
<?xml version="1.0"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY igraph "igraph">
]>
<chapter id="igraph-Motifs">
<title>Graph motifs, dyad census and triad census</title>
<para>
This section deals with functions which find small induced subgraphs in a
graph. These were first defined for subgraphs of two and three vertices
by Holland and Leinhardt, and named dyad census and triad census.
</para>
<!-- doxrox-include igraph_dyad_census -->
<!-- doxrox-include igraph_triad_census -->
<section id="finding-triangles"><title>Finding triangles</title>
<!-- doxrox-include igraph_count_adjacent_triangles -->
<!-- doxrox-include igraph_count_triangles -->
<!-- doxrox-include igraph_list_triangles -->
</section>
<section id="graph-motifs"><title>Graph motifs</title>
<!-- doxrox-include igraph_motifs_randesu -->
<!-- doxrox-include igraph_motifs_randesu_no -->
<!-- doxrox-include igraph_motifs_randesu_estimate -->
<!-- doxrox-include igraph_motifs_randesu_callback -->
<!-- doxrox-include igraph_motifs_handler_t -->
</section>
</chapter>
+40
View File
@@ -0,0 +1,40 @@
<?xml version="1.0"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY igraph "igraph">
]>
<chapter id="igraph-Nongraph">
<title>Non-graph related functions </title>
<section id="igraph-version-number"><title>igraph version number</title>
<!-- doxrox-include igraph_version -->
</section>
<section id="running-mean-of-a-time-series"><title>Running mean of a time series</title>
<!-- doxrox-include igraph_running_mean -->
</section>
<section id="random-sampling-from-very-long-sequences"><title>Random sampling from very long sequences</title>
<!-- doxrox-include igraph_random_sample -->
</section>
<section id="random-sampling-of-spatial-points"><title>Random sampling of spatial points</title>
<!-- doxrox-include igraph_rng_sample_sphere_surface -->
<!-- doxrox-include igraph_rng_sample_sphere_volume -->
<!-- doxrox-include igraph_rng_sample_dirichlet -->
</section>
<section id="fitting-powerlaw-distributions-to-empirical-data"><title>Fitting power-law distributions to empirical data</title>
<!-- doxrox-include igraph_plfit_result_t -->
<!-- doxrox-include igraph_power_law_fit -->
<!-- doxrox-include igraph_plfit_result_calculate_p_value -->
</section>
<section id="compare-floats-with-tolerance"><title>Comparing floats with a tolerance</title>
<!-- doxrox-include igraph_cmp_epsilon -->
<!-- doxrox-include igraph_almost_equals -->
<!-- doxrox-include igraph_complex_almost_equals -->
</section>
</chapter>
@@ -0,0 +1,42 @@
<?xml version="1.0"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY igraph "igraph">
]>
<chapter id="igraph-Operators">
<title>Graph operators</title>
<section id="union-and-intersection"><title>Union and intersection</title>
<!-- doxrox-include igraph_disjoint_union -->
<!-- doxrox-include igraph_disjoint_union_many -->
<!-- doxrox-include igraph_join -->
<!-- doxrox-include igraph_union -->
<!-- doxrox-include igraph_union_many -->
<!-- doxrox-include igraph_intersection -->
<!-- doxrox-include igraph_intersection_many -->
</section>
<section id="other-setlike-operators"><title>Other set-like operators</title>
<!-- doxrox-include igraph_difference -->
<!-- doxrox-include igraph_complementer -->
<!-- doxrox-include igraph_compose -->
</section>
<section id="miscellaneous-operators"><title>Miscellaneous operators</title>
<!-- doxrox-include igraph_connect_neighborhood -->
<!-- doxrox-include igraph_contract_vertices -->
<!-- doxrox-include igraph_graph_power -->
<!-- doxrox-include igraph_product -->
<!-- doxrox-include igraph_rooted_product -->
<!-- doxrox-include igraph_induced_subgraph -->
<!-- doxrox-include igraph_induced_subgraph_map -->
<!-- doxrox-include igraph_induced_subgraph_edges -->
<!-- doxrox-include igraph_linegraph -->
<!-- doxrox-include igraph_mycielskian -->
<!-- doxrox-include igraph_simplify -->
<!-- doxrox-include igraph_subgraph_from_edges -->
<!-- doxrox-include igraph_reverse_edges -->
</section>
</chapter>
+146
View File
@@ -0,0 +1,146 @@
<?xml version="1.0"?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY igraph "igraph">
]>
<section id="igraph-PMT">
<title>About template types</title>
<para>
Some of the container types listed in this section are defined for
many base types. This is similar to templates in C++ and generics in
Ada, but it is implemented via preprocessor macros since the C language
cannot handle it. Here is the list of template types and the all base
types they currently support:
<glosslist>
<glossentry><glossterm>vector</glossterm><glossdef><para>
Vector is currently defined for <type>igraph_real_t</type>,
<type>igraph_int_t</type> (int), <type>char</type> (char),
<type>igraph_bool_t</type> (bool), <type>igraph_complex_t</type>
(complex) and and <type>void *</type> (ptr). The default is
<type>igraph_real_t</type>.
</para></glossdef></glossentry>
<glossentry><glossterm>matrix</glossterm><glossdef><para>
Matrix is currently defined for <type>igraph_real_t</type>,
<type>igraph_int_t</type> (int), <type>char</type> (char),
<type>igraph_bool_t</type> (bool) and <type>igraph_complex_t</type>
(complex). The default is <type>igraph_real_t</type>.
</para></glossdef></glossentry>
<glossentry><glossterm>array3</glossterm><glossdef><para>
Array3 is currently defined for <type>igraph_real_t</type>,
<type>igraph_int_t</type> (int), <type>char</type> (char) and
<type>igraph_bool_t</type> (bool). The default is
<type>igraph_real_t</type>.
</para></glossdef></glossentry>
<glossentry><glossterm>stack</glossterm><glossdef><para>
Stack is currently defined for <type>igraph_real_t</type>,
<type>igraph_int_t</type> (int), <type>char</type> (char) and
<type>igraph_bool_t</type> (bool).
The default is <type>igraph_real_t</type>.
</para></glossdef></glossentry>
<glossentry><glossterm>double-ended queue</glossterm><glossdef><para>
Dqueue is currently defined for <type>igraph_real_t</type>,
<type>igraph_int_t</type> (int), <type>char</type> (char) and
<type>igraph_bool_t</type> (bool). The default is
<type>igraph_real_t</type>.
</para></glossdef></glossentry>
<glossentry><glossterm>heap</glossterm><glossdef><para>
Heap is currently defined for <type>igraph_real_t</type>,
<type>igraph_int_t</type> (int), <type>char</type> (char).
In addition both maximum and minimum heaps are available.
The default is the <type>igraph_real_t</type> maximum heap.
</para></glossdef></glossentry>
<glossentry><glossterm>list of vectors</glossterm><glossdef><para>
Lists of vectors are currently defined for vectors holding
<type>igraph_real_t</type> and <type>igraph_int_t</type> (int).
The default is <type>igraph_real_t</type>.
</para></glossdef></glossentry>
<glossentry><glossterm>list of matrices</glossterm><glossdef><para>
Lists of matrices are currently defined for matrices holding
<type>igraph_real_t</type> only.
</para></glossdef></glossentry>
</glosslist>
</para>
<para>
The name of the base element (in parentheses) is added to the function
names, except for the default type.
</para>
<para>
Some examples:
<itemizedlist>
<listitem><para>
<type>igraph_vector_t</type> is a vector of
<type>igraph_real_t</type> elements. Its functions are
<function>igraph_vector_init</function>,
<function>igraph_vector_destroy</function>,
<function>igraph_vector_sort</function>, etc.
</para></listitem>
<listitem><para>
<type>igraph_vector_bool_t</type> is a vector of
<type>igraph_bool_t</type> elements; initialize it with
<function>igraph_vector_bool_init</function>, destroy it with
<function>igraph_vector_bool_destroy</function>, etc.
</para></listitem>
<listitem><para>
<type>igraph_heap_t</type> is a maximum heap with
<type>igraph_real_t</type> elements. The corresponding functions are
<function>igraph_heap_init</function>,
<function>igraph_heap_pop</function>, etc.
</para></listitem>
<listitem><para>
<type>igraph_heap_min_t</type> is a minimum heap with
<type>igraph_real_t</type> elements. The corresponding functions are
called <function>igraph_heap_min_init</function>,
<function>igraph_heap_min_pop</function>, etc.
</para></listitem>
<listitem><para>
<type>igraph_heap_int_t</type> is a maximum heap with <type>igraph_int_t</type>
elements. Its functions have the <function>igraph_heap_int_</function> prefix.
</para></listitem>
<listitem><para>
<type>igraph_heap_min_int_t</type> is a minimum heap containing
<type>igraph_int_t</type> elements. Its functions have the
<function>igraph_heap_min_int_</function> prefix.
</para></listitem>
<listitem><para>
<type>igraph_vector_list_t</type> is a list of (floating-point) vectors; each
element in this data structure is an <type>igraph_vector_t</type>.
Similarly, <type>igraph_matrix_list_t</type> is a list of (floating-point)
matrices; each element in this data structure is an <type>igraph_matrix_t</type>.
</para></listitem>
<listitem><para>
<type>igraph_vector_int_list_t</type> is a list of integer vectors; each
element in this data structure is an <type>igraph_vector_int_t</type>.
</para></listitem>
</itemizedlist>
</para>
<para>
Note that the <link linkend="VECTOR">VECTOR</link> and the <link
linkend="MATRIX">MATRIX</link> macros can be used on <emphasis>all</emphasis>
vector and matrix types. <link linkend="VECTOR">VECTOR</link> cannot be used
on <emphasis>lists</emphasis> of vectors, though, only on the individial
vectors in the list.
</para>
</section>
@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY igraph "igraph">
]>
<chapter id="igraph-Processes">
<title>Processes on graphs</title>
<section id="epidemic-models"><title>Epidemic models</title>
<!-- doxrox-include igraph_sir -->
<!-- doxrox-include igraph_sir_t -->
<!-- doxrox-include igraph_sir_destroy -->
</section>
</chapter>

Some files were not shown because too many files have changed in this diff Show More