Greens-code
A modular quantum transport code
Classes | Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
state_collection Class Reference

#include <state.hpp>

Public Types

typedef STD_TR1::shared_ptr< state_collectionref
 
typedef STD_TR1::shared_ptr< const state_collectionconst_ref
 

Public Member Functions

std::string filename (size_t index) const
 
std::string minimal_identifier (const std::string &, size_t, size_t)
 
const std::string & state_identifier (size_t index) const
 
Rectangle_const_ref state_geometry (size_t index) const
 
size_t state_size (size_t index) const
 
state push_pointer (complex *)
 
void pop_pointer ()
 
void add_empty_state (Rectangle_const_ref, const std::string &identifier)
 
void add_states (const t_filename_list_ref files)
 
void add_states (Rectangle_const_ref, Vector &, const std::string &identifier)
 
ref copy () const
 
template<class Pr >
ref copy_if (Pr) const
 
void clear ()
 
state get_state (size_t index)
 
const state get_state (size_t index) const
 
void write () const
 
void write (size_t index) const
 
size_t N () const
 
void set_write_out_immediately (bool woi)
 
void set_prefix (const std::string &s)
 
const std::string & get_prefix () const
 
double state_norm (int)
 |wf(i)|_2 -> norm
 
void state_dot (int, int, complex &result)
 wf(i)^* wf(j) -> result
 
void state_scale (int, complex alpha)
 alpha*wf(i) -> wf(i)
 
void state_axpy (int i, int j, complex alpha)
 alpha*wf(i) + wf(j) -> wf(j)
 
void state_copy (int i, int j)
 wf(i) -> wf(j)
 
void state_maxpby (const complex *prefactors, int &istart, int &iend, complex &alpha, int &j)
 alpha*wf(j) + sum_{k=istart}^{iend} prefactors(k)*wf(k) -> wf(j)
 
template<class Pr >
STD_TR1::shared_ptr< state_collectioncopy_if (Pr pred) const
 

Static Public Member Functions

static ref create (MPI_Comm c)
 
static ref create (MPI_Comm c, t_filename_list_ref files)
 

Friends

class state
 

Detailed Description

A state collection keeps track of calculated or time-propagated eigenstates. they can be saved, loaded, and modified Note that the memory is allocated by state_collection hence copying of states is always shallow, even if you copy the state collection When loading and saving in parallel environements, state collection assumes that other threads are saving and loading too, and chooses filenames appropriately to prevent conflicts. To use this feature, have each thread create and handle a local state collection with the states used by this thread. To quickly create a state object out of a pointer, use push_pointer and pop_pointer. Push_pointer(complex*) creates a new state based on the state with the last index pop_pointer removes the state with the highest index


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