$extrastylesheet
libMesh::METIS_CSR_Graph Class Reference

#include <metis_csr_graph.h>

List of all members.

Public Member Functions

void prep_n_nonzeros (const libMesh::dof_id_type row, const libMesh::dof_id_type n_nonzeros_in)
libMesh::dof_id_type n_nonzeros (const libMesh::dof_id_type row) const
void prepare_for_use ()
int & operator() (const libMesh::dof_id_type row, const libMesh::dof_id_type nonzero)
const int & operator() (const libMesh::dof_id_type row, const libMesh::dof_id_type nonzero) const

Public Attributes

std::vector< int > offsets
std::vector< int > vals

Detailed Description

This utility class provides a convenient implementation for building the compressed-row-storage graph required for the METIS/ParMETIS graph partitioning schemes.

Definition at line 40 of file metis_csr_graph.h.


Member Function Documentation

Definition at line 54 of file metis_csr_graph.h.

References offsets.

  {
    libmesh_assert_less (row+1, offsets.size());
    return (offsets[row+1] - offsets[row]);
  }
int& libMesh::METIS_CSR_Graph::operator() ( const libMesh::dof_id_type  row,
const libMesh::dof_id_type  nonzero 
) [inline]

Definition at line 73 of file metis_csr_graph.h.

References offsets, and vals.

  {
    libmesh_assert_greater (vals.size(), offsets[row]+nonzero);

    return vals[offsets[row]+nonzero];
  }
const int& libMesh::METIS_CSR_Graph::operator() ( const libMesh::dof_id_type  row,
const libMesh::dof_id_type  nonzero 
) const [inline]

Definition at line 82 of file metis_csr_graph.h.

References offsets, and vals.

  {
    libmesh_assert_greater (vals.size(), offsets[row]+nonzero);

    return vals[offsets[row]+nonzero];
  }
void libMesh::METIS_CSR_Graph::prep_n_nonzeros ( const libMesh::dof_id_type  row,
const libMesh::dof_id_type  n_nonzeros_in 
) [inline]

Definition at line 45 of file metis_csr_graph.h.

References offsets.

Referenced by libMesh::MetisPartitioner::_do_partition().

  {
    libmesh_assert_less (row+1, offsets.size());
    offsets[row+1] = n_nonzeros_in;
  }

Definition at line 61 of file metis_csr_graph.h.

References libMesh::libmesh_assert(), offsets, and vals.

Referenced by libMesh::MetisPartitioner::_do_partition().

  {
    std::partial_sum (offsets.begin(), offsets.end(), offsets.begin());
    libmesh_assert (!offsets.empty());
    vals.resize(offsets.back());

    if (vals.empty())
      vals.push_back(0);
  }

Member Data Documentation


The documentation for this class was generated from the following file: