openjij
Framework for the Ising model and QUBO.
Loading...
Searching...
No Matches
openjij::graph::Graph Class Reference

Abstract graph class. More...

#include <graph.hpp>

Inheritance diagram for openjij::graph::Graph:

Public Member Functions

 Graph (std::size_t num_spins)
 Graph constructor.
 
template<typename RandomNumberEngine >
const Spins gen_spin (RandomNumberEngine &random_numder_engine) const
 generate spins randomly.
 
template<typename RandomNumberEngine >
const Binaries gen_binary (RandomNumberEngine &random_numder_engine) const
 generate spins randomly.
 
std::size_t get_num_spins () const noexcept
 get number of spins
 
std::size_t size () const noexcept
 get number of spins
 

Private Attributes

const std::size_t _num_spins
 total number of spins
 

Detailed Description

Abstract graph class.

Constructor & Destructor Documentation

◆ Graph()

openjij::graph::Graph::Graph ( std::size_t  num_spins)
inlineexplicit

Graph constructor.

Parameters
num_spinstotal number of spins

Member Function Documentation

◆ gen_binary()

template<typename RandomNumberEngine >
const Binaries openjij::graph::Graph::gen_binary ( RandomNumberEngine &  random_numder_engine) const
inline

generate spins randomly.

Returns
generated spins

References _num_spins, and openjij::graph::json_parse().

Referenced by openjij::declare_Graph().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gen_spin()

template<typename RandomNumberEngine >
const Spins openjij::graph::Graph::gen_spin ( RandomNumberEngine &  random_numder_engine) const
inline

generate spins randomly.

Returns
generated spins

References _num_spins, and openjij::graph::json_parse().

Referenced by openjij::declare_Graph().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_num_spins()

std::size_t openjij::graph::Graph::get_num_spins ( ) const
inlinenoexcept

get number of spins

Deprecated:
please use size()
Returns
number of spins

References _num_spins.

Referenced by openjij::system::ClassicalIsing< graph::CSRSparse< FloatType > >::ClassicalIsing(), openjij::system::ClassicalIsing< graph::Dense< FloatType > >::ClassicalIsing(), openjij::system::ClassicalIsing< graph::Sparse< FloatType > >::ClassicalIsing(), openjij::system::ContinuousTimeIsing< graph::Sparse< FloatType > >::ContinuousTimeIsing(), openjij::system::ContinuousTimeIsing< graph::CSRSparse< FloatType > >::ContinuousTimeIsing(), openjij::graph::CSRSparse< FloatType >::energy(), openjij::graph::Dense< FloatType >::energy(), openjij::graph::Sparse< FloatType >::energy(), openjij::graph::CSRSparse< FloatType >::energy(), openjij::graph::Dense< FloatType >::energy(), openjij::graph::Sparse< FloatType >::energy(), openjij::utility::gen_matrix_from_graph(), openjij::utility::gen_matrix_from_graph(), openjij::graph::Dense< FloatType >::h(), openjij::graph::Sparse< FloatType >::h(), openjij::graph::Dense< FloatType >::h(), openjij::graph::Sparse< FloatType >::h(), openjij::graph::Dense< FloatType >::J(), openjij::graph::Sparse< FloatType >::J(), openjij::graph::Dense< FloatType >::J(), openjij::graph::Sparse< FloatType >::J(), openjij::graph::Sparse< FloatType >::set_adj_node(), openjij::graph::Dense< FloatType >::set_interaction_matrix(), openjij::graph::Square< FloatType >::to_rc(), and openjij::graph::Chimera< FloatType >::to_rci().

Here is the caller graph for this function:

◆ size()

std::size_t openjij::graph::Graph::size ( ) const
inlinenoexcept

get number of spins

Returns
number of spins

References _num_spins.

Referenced by openjij::graph::Polynomial< FloatType >::CheckKeyValid(), openjij::declare_Graph(), and openjij::graph::Polynomial< FloatType >::energy().

Here is the caller graph for this function:

Member Data Documentation

◆ _num_spins

const std::size_t openjij::graph::Graph::_num_spins
private

total number of spins

Referenced by gen_binary(), gen_spin(), get_num_spins(), and size().


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