QUBO++ Library with QUBO Solver APIs
Author: Koji Nakano, License: Non-commercial research and evaluation purposes without any guarantees.
Public Member Functions | Private Member Functions | Private Attributes | List of all members
qbpp::Vector< T > Class Template Reference

#include <qbpp.hpp>

Public Member Functions

 Vector ()=default
 
 Vector (const Vector< T > &)=default
 
 Vector (Vector< T > &&)=default
 
 Vector (std::initializer_list< T > init)
 
Vectoroperator= (const Vector< T > &)=default
 
Vectoroperator= (Vector< T > &&)=default
 
 Vector (size_t size)
 
template<typename U , typename = typename std::enable_if< std::is_integral<U>::value>::type>
 Vector (U size, const T &value)
 
template<typename U , typename = typename std::enable_if< !std::is_integral<U>::value>::type>
 Vector (U begin, U end)
 
template<typename U >
 Vector (const Vector< U > &rhs)
 
const std::vector< T > get_data () const
 
std::vector< T > get_data ()
 
void resize (size_t size)
 
void push_back (const T &t)
 
void emplace_back (T &&t)
 
void reserve (size_t size)
 
T & operator[] (size_t i)
 
const T & operator[] (size_t i) const
 
size_t size () const
 
auto begin () const
 
auto end () const
 
auto begin ()
 
auto end ()
 
std::vector< T >::iterator erase (typename std::vector< T >::iterator pos)
 
std::vector< T >::iterator erase (typename std::vector< T >::iterator first, typename std::vector< T >::iterator last)
 
Vector< T > & operator= (const Expr &rhs)
 
Vector< T > & operator= (energy_t rhs)
 
template<typename U >
Vector< T > & operator+= (const Vector< U > &rhs)
 
template<typename U >
Vector< T > & operator+= (Vector< U > &&rhs)
 
template<typename U >
Vector< T > & operator-= (const Vector< U > &rhs)
 
template<typename U >
Vector< T > & operator-= (Vector< U > &&rhs)
 
template<typename U >
Vector< T > & operator*= (const Vector< U > &rhs)
 
template<typename U >
Vector< T > & operator*= (Vector< U > &&rhs)
 
Vector< T > & operator+= (const Expr &expr)
 
Vector< T > & operator-= (const Expr &expr)
 
Vector< T > & operator*= (const Expr &expr)
 
Vector< T > & operator/= (energy_t val)
 
Vector< T > & sqr ()
 
Vector< T > & simplify (Vars(*sort_vars_func)(const Vars &)=sort_vars)
 
Vector< T > & simplify_as_binary ()
 
Vector< T > & simplify_as_spin ()
 
Vector< T > & binary_to_spin ()
 
Vector< T > & spin_to_binary ()
 
Vector< T > & replace (const MapList &map_list)
 
Vector< T > & reduce ()
 
Vector< T > & transpose ()
 

Private Member Functions

template<typename U , typename Op >
Vector< T > & vector_operation (const Vector< U > &rhs, Op operation)
 
template<typename U , typename Op >
Vector< T > & vector_operation (Vector< U > &&rhs, Op operation)
 
template<typename Op >
Vector< T > & vector_operation (const Expr &rhs, Op operation)
 

Private Attributes

std::vector< T > data_
 

Detailed Description

template<typename T>
class qbpp::Vector< T >

Definition at line 290 of file qbpp.hpp.

Constructor & Destructor Documentation

◆ Vector() [1/8]

template<typename T >
qbpp::Vector< T >::Vector ( )
default

◆ Vector() [2/8]

template<typename T >
qbpp::Vector< T >::Vector ( const Vector< T > &  )
default

◆ Vector() [3/8]

template<typename T >
qbpp::Vector< T >::Vector ( Vector< T > &&  )
default

◆ Vector() [4/8]

template<typename T >
qbpp::Vector< T >::Vector ( std::initializer_list< T >  init)
inline

Definition at line 346 of file qbpp.hpp.

◆ Vector() [5/8]

template<typename T >
qbpp::Vector< T >::Vector ( size_t  size)
inlineexplicit

Definition at line 352 of file qbpp.hpp.

◆ Vector() [6/8]

template<typename T >
template<typename U , typename = typename std::enable_if< std::is_integral<U>::value>::type>
qbpp::Vector< T >::Vector ( size,
const T &  value 
)
inline

Definition at line 356 of file qbpp.hpp.

◆ Vector() [7/8]

template<typename T >
template<typename U , typename = typename std::enable_if< !std::is_integral<U>::value>::type>
qbpp::Vector< T >::Vector ( begin,
end 
)
inline

Definition at line 360 of file qbpp.hpp.

◆ Vector() [8/8]

template<typename T >
template<typename U >
qbpp::Vector< T >::Vector ( const Vector< U > &  rhs)
inline

Definition at line 363 of file qbpp.hpp.

Here is the call graph for this function:

Member Function Documentation

◆ vector_operation() [1/3]

template<typename T >
template<typename U , typename Op >
Vector<T>& qbpp::Vector< T >::vector_operation ( const Vector< U > &  rhs,
Op  operation 
)
inlineprivate

Definition at line 294 of file qbpp.hpp.

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

◆ vector_operation() [2/3]

template<typename T >
template<typename U , typename Op >
Vector<T>& qbpp::Vector< T >::vector_operation ( Vector< U > &&  rhs,
Op  operation 
)
inlineprivate

Definition at line 310 of file qbpp.hpp.

Here is the call graph for this function:

◆ vector_operation() [3/3]

template<typename T >
template<typename Op >
Vector<T>& qbpp::Vector< T >::vector_operation ( const Expr rhs,
Op  operation 
)
inlineprivate

Definition at line 328 of file qbpp.hpp.

Here is the call graph for this function:

◆ operator=() [1/4]

template<typename T >
Vector& qbpp::Vector< T >::operator= ( const Vector< T > &  )
default

◆ operator=() [2/4]

template<typename T >
Vector& qbpp::Vector< T >::operator= ( Vector< T > &&  )
default

◆ get_data() [1/2]

template<typename T >
const std::vector<T> qbpp::Vector< T >::get_data ( ) const
inline

Definition at line 369 of file qbpp.hpp.

◆ get_data() [2/2]

template<typename T >
std::vector<T> qbpp::Vector< T >::get_data ( )
inline

Definition at line 371 of file qbpp.hpp.

◆ resize()

template<typename T >
void qbpp::Vector< T >::resize ( size_t  size)
inline

Definition at line 373 of file qbpp.hpp.

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

◆ push_back()

template<typename T >
void qbpp::Vector< T >::push_back ( const T &  t)
inline

Definition at line 375 of file qbpp.hpp.

Here is the caller graph for this function:

◆ emplace_back()

template<typename T >
void qbpp::Vector< T >::emplace_back ( T &&  t)
inline

Definition at line 377 of file qbpp.hpp.

Here is the caller graph for this function:

◆ reserve()

template<typename T >
void qbpp::Vector< T >::reserve ( size_t  size)
inline

Definition at line 379 of file qbpp.hpp.

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

◆ operator[]() [1/2]

template<typename T >
T& qbpp::Vector< T >::operator[] ( size_t  i)
inline

Definition at line 381 of file qbpp.hpp.

◆ operator[]() [2/2]

template<typename T >
const T& qbpp::Vector< T >::operator[] ( size_t  i) const
inline

Definition at line 383 of file qbpp.hpp.

◆ size()

template<typename T >
size_t qbpp::Vector< T >::size ( ) const
inline

Definition at line 385 of file qbpp.hpp.

Here is the caller graph for this function:

◆ begin() [1/2]

template<typename T >
auto qbpp::Vector< T >::begin ( ) const
inline

Definition at line 387 of file qbpp.hpp.

◆ end() [1/2]

template<typename T >
auto qbpp::Vector< T >::end ( ) const
inline

Definition at line 389 of file qbpp.hpp.

◆ begin() [2/2]

template<typename T >
auto qbpp::Vector< T >::begin ( )
inline

Definition at line 391 of file qbpp.hpp.

◆ end() [2/2]

template<typename T >
auto qbpp::Vector< T >::end ( )
inline

Definition at line 393 of file qbpp.hpp.

◆ erase() [1/2]

template<typename T >
std::vector<T>::iterator qbpp::Vector< T >::erase ( typename std::vector< T >::iterator  pos)
inline

Definition at line 395 of file qbpp.hpp.

◆ erase() [2/2]

template<typename T >
std::vector<T>::iterator qbpp::Vector< T >::erase ( typename std::vector< T >::iterator  first,
typename std::vector< T >::iterator  last 
)
inline

Definition at line 400 of file qbpp.hpp.

◆ operator=() [3/4]

template<typename T >
Vector<T>& qbpp::Vector< T >::operator= ( const Expr rhs)
inline

Definition at line 407 of file qbpp.hpp.

Here is the call graph for this function:

◆ operator=() [4/4]

template<typename T >
Vector<T>& qbpp::Vector< T >::operator= ( energy_t  rhs)
inline

Definition at line 412 of file qbpp.hpp.

Here is the call graph for this function:

◆ operator+=() [1/3]

template<typename T >
template<typename U >
Vector<T>& qbpp::Vector< T >::operator+= ( const Vector< U > &  rhs)
inline

Definition at line 418 of file qbpp.hpp.

Here is the call graph for this function:

◆ operator+=() [2/3]

template<typename T >
template<typename U >
Vector<T>& qbpp::Vector< T >::operator+= ( Vector< U > &&  rhs)
inline

Definition at line 423 of file qbpp.hpp.

Here is the call graph for this function:

◆ operator-=() [1/3]

template<typename T >
template<typename U >
Vector<T>& qbpp::Vector< T >::operator-= ( const Vector< U > &  rhs)
inline

Definition at line 431 of file qbpp.hpp.

Here is the call graph for this function:

◆ operator-=() [2/3]

template<typename T >
template<typename U >
Vector<T>& qbpp::Vector< T >::operator-= ( Vector< U > &&  rhs)
inline

Definition at line 436 of file qbpp.hpp.

Here is the call graph for this function:

◆ operator*=() [1/3]

template<typename T >
template<typename U >
Vector<T>& qbpp::Vector< T >::operator*= ( const Vector< U > &  rhs)
inline

Definition at line 444 of file qbpp.hpp.

Here is the call graph for this function:

◆ operator*=() [2/3]

template<typename T >
template<typename U >
Vector<T>& qbpp::Vector< T >::operator*= ( Vector< U > &&  rhs)
inline

Definition at line 449 of file qbpp.hpp.

Here is the call graph for this function:

◆ operator+=() [3/3]

template<typename T >
Vector<T>& qbpp::Vector< T >::operator+= ( const Expr expr)
inline

Definition at line 456 of file qbpp.hpp.

Here is the call graph for this function:

◆ operator-=() [3/3]

template<typename T >
Vector<T>& qbpp::Vector< T >::operator-= ( const Expr expr)
inline

Definition at line 461 of file qbpp.hpp.

Here is the call graph for this function:

◆ operator*=() [3/3]

template<typename T >
Vector<T>& qbpp::Vector< T >::operator*= ( const Expr expr)
inline

Definition at line 466 of file qbpp.hpp.

Here is the call graph for this function:

◆ operator/=()

template<typename T >
Vector<T>& qbpp::Vector< T >::operator/= ( energy_t  val)
inline

Definition at line 471 of file qbpp.hpp.

Here is the call graph for this function:

◆ sqr()

template<typename T >
Vector<T>& qbpp::Vector< T >::sqr ( )
inline

Definition at line 481 of file qbpp.hpp.

◆ simplify()

template<typename T >
Vector< T > & qbpp::Vector< T >::simplify ( Vars(*)(const Vars &)  sort_vars_func = sort_vars)

Definition at line 3657 of file qbpp.hpp.

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

◆ simplify_as_binary()

template<typename T >
Vector<T>& qbpp::Vector< T >::simplify_as_binary ( )
inline

Definition at line 488 of file qbpp.hpp.

Here is the call graph for this function:

◆ simplify_as_spin()

template<typename T >
Vector<T>& qbpp::Vector< T >::simplify_as_spin ( )
inline

Definition at line 493 of file qbpp.hpp.

Here is the call graph for this function:

◆ binary_to_spin()

template<typename T >
Vector<T>& qbpp::Vector< T >::binary_to_spin ( )
inline

Definition at line 498 of file qbpp.hpp.

Here is the call graph for this function:

◆ spin_to_binary()

template<typename T >
Vector<T>& qbpp::Vector< T >::spin_to_binary ( )
inline

Definition at line 503 of file qbpp.hpp.

Here is the call graph for this function:

◆ replace()

template<typename T >
Vector< T > & qbpp::Vector< T >::replace ( const MapList map_list)

Definition at line 3663 of file qbpp.hpp.

Here is the call graph for this function:

◆ reduce()

template<typename T >
Vector< T > & qbpp::Vector< T >::reduce

Definition at line 3669 of file qbpp.hpp.

Here is the call graph for this function:

◆ transpose()

template<typename T >
Vector<T>& qbpp::Vector< T >::transpose ( )
inline

Definition at line 512 of file qbpp.hpp.

Member Data Documentation

◆ data_

template<typename T >
std::vector<T> qbpp::Vector< T >::data_
private

Definition at line 291 of file qbpp.hpp.


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