Igraph Reference Manual

Igraph Reference Manual

igraph Reference Manual Gábor Csárdi Department of Biophysics, Research Institute for Nuclear and Particle Physics of the Hungarian Academy of Sciences 29-33 Konkoly-Thege Miklós road, Budapest H-1121, Hungary Center for Complex Systems Studies, Kalamazoo College 1200 Academy st, Kalamazoo, 49006, MI, USA Tamás Nepusz Department of Biophysics, Research Institute for Nuclear and Particle Physics of the Hungarian Academy of Sciences 29-33 Konkoly-Thege Miklós road, Budapest H-1121, Hungary igraph Reference Manual by Gábor Csárdi and Tamás Nepusz Copyright (C) 2005, 2006 Gábor Csárdi and Tamás Nepusz. 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”. Table of Contents 1. Introduction............................................................................................................................................1 1.1. igraph is free software.................................................................................................................1 1.2. Citing igraph...............................................................................................................................2 2. Installation..............................................................................................................................................3 3. Tutorial...................................................................................................................................................5 3.1. Lesson 1. Compiling programs using igraph..............................................................................5 3.2. Lesson 2. Creating your first graphs...........................................................................................6 3.3. Lesson 3. Calculating various properties of graphs....................................................................8 4. About igraph graphs, the basic interface..........................................................................................10 4.1. The igraph data model...............................................................................................................10 4.2. The basic interface....................................................................................................................11 4.2.1. Graph Constructors and Destructors............................................................................11 4.2.2. Basic Query Operations................................................................................................14 4.2.3. Adding and Deleting Vertices and Edges.....................................................................20 5. Error Handling....................................................................................................................................25 5.1. Error handling basics................................................................................................................25 5.2. Error handlers............................................................................................................................25 5.2.1. igraph_error_handler_t — Type of error handler functions...............................25 5.2.2. igraph_error_handler_abort — Abort program in case of error.......................26 5.2.3. igraph_error_handler_ignore — Ignore errors.................................................26 5.2.4. igraph_error_handler_printignore — Print and ignore errors.......................27 5.3. Error codes................................................................................................................................27 5.3.1. igraph_error_type_t — Error code type..............................................................27 5.3.2. igraph_strerror — Textual description of an error...............................................30 5.4. Advanced topics........................................................................................................................31 5.4.1. Writing error handlers..................................................................................................31 5.4.2. Error handling internals................................................................................................32 5.4.3. Deallocating memory...................................................................................................34 5.4.4. Writing igraph functions with proper error handling..................................................35 5.4.5. Error handling and threads...........................................................................................36 6. Data structure library: vector, matrix, other data types..................................................................37 6.1. About template types................................................................................................................37 6.2. Vectors.......................................................................................................................................38 6.2.1. About igraph_vector_t objects......................................................................................38 6.2.2. Constructors and Destructors.......................................................................................39 6.2.3. Initializing elements.....................................................................................................42 6.2.4. Accessing elements......................................................................................................43 6.2.5. Vector views.................................................................................................................47 6.2.6. Copying vectors............................................................................................................48 6.2.7. Exchanging elements....................................................................................................50 6.2.8. Vector operations..........................................................................................................51 6.2.9. Finding minimum and maximum.................................................................................55 6.2.10. Vector properties.........................................................................................................59 6.2.11. Searching for elements...............................................................................................63 iii 6.2.12. Resizing operations....................................................................................................66 6.2.13. Sorting........................................................................................................................71 6.2.14. Pointer vectors (igraph_vector_ptr_t).........................................................................71 6.3. Matrices.....................................................................................................................................77 6.3.1. About igraph_matrix_t objects.....................................................................................77 6.3.2. Matrix constructors and destructors.............................................................................77 6.3.3. Initializing elements.....................................................................................................79 6.3.4. Copying matrices..........................................................................................................80 6.3.5. Accessing elements of a matrix....................................................................................82 6.3.6. Operations on rows and columns..................................................................................84 6.3.7. Matrix operations..........................................................................................................90 6.3.8. Combining matrices......................................................................................................96 6.3.9. Finding minimum and maximum.................................................................................97 6.3.10. Matrix properties......................................................................................................101 6.3.11. Searching for elements.............................................................................................105 6.3.12. Resizing operations..................................................................................................107 6.4. Sparse matrices.......................................................................................................................110 6.4.1. About igraph_spmatrix_t objects...............................................................................110 6.4.2. Sparse matrix constructors and destructors................................................................111 6.4.3. Accessing elements of a sparse matrix.......................................................................112 6.4.4. Matrix query operations.............................................................................................114 6.4.5. Matrix operations........................................................................................................117 6.5. Stacks......................................................................................................................................120

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    497 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us