Psi4
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
psi::THCE Class Reference

#include <thce.h>

Public Member Functions

 THCE ()
 Instance Constructor. More...
 
virtual ~THCE ()
 Instance Destructor. More...
 
std::map< std::string, int > & dimensions ()
 Accessor to the list of currently declared dimensions (dimension classes) More...
 
std::map< std::string,
std::shared_ptr< Tensor > > & 
tensors ()
 Accessor to the list of currently declared tensors. More...
 
std::shared_ptr< Tensor > & operator[] (const std::string &key)
 Direct tensor element accessor. More...
 
void print_header (std::string fh="outfile") const
 Print a brief summary. More...
 
void print (std::string fh="outfile", int print=1) const
 Print a more detailed trace of the object. More...
 
size_t core_doubles () const
 Return the current core memory utilization of this instance, in doubles. More...
 
size_t disk_doubles () const
 Return the current disk memory utilization of this instance, in doubles. More...
 
void new_dimension (const std::string &name, int size)
 Add or overwrite a dimension to this instance. More...
 
void delete_dimension (const std::string &name)
 Remove a dimension from this instance. More...
 
void new_core_tensor (const std::string &name, const std::string &dimensions, double *data=NULL, bool trust=false)
 Add or overwrite a new core tensor, given a name and comma-separated dimension list. More...
 
void new_disk_tensor (const std::string &name, const std::string &dimensions, bool save=false, bool load=false)
 Add or overwrite a new disk tensor, given a name and comma-separated dimension list. More...
 
void add_tensor (const std::string &name, std::shared_ptr< Tensor > tensor)
 Add or alias an existing Tensor of any type. More...
 
void delete_tensor (const std::string &name)
 Decrement a Tensor of any type (removes from tensors_) More...
 

Protected Member Functions

void dimension_check (const std::string &name)
 Throws if a dimension name is not in dimensions_. More...
 
void tensor_check (const std::string &name)
 Throws if a tensor name is not in tensors_. More...
 

Static Protected Member Functions

static int unique_id ()
 Get a unique ID number for a tensor (prevents disk clash) More...
 

Protected Attributes

std::map< std::string, int > dimensions_
 List of currently declared dimensions (dimension classes) More...
 
std::map< std::string,
std::shared_ptr< Tensor > > 
tensors_
 List of currently declated tensors. More...
 

Detailed Description

Class THCE is a container and interface to a collection of Tensor objects

Constructor & Destructor Documentation

psi::THCE::THCE ( )

Instance Constructor.

psi::THCE::~THCE ( )
virtual

Instance Destructor.

Member Function Documentation

void psi::THCE::add_tensor ( const std::string &  name,
std::shared_ptr< Tensor tensor 
)

Add or alias an existing Tensor of any type.

size_t psi::THCE::core_doubles ( ) const

Return the current core memory utilization of this instance, in doubles.

void psi::THCE::delete_dimension ( const std::string &  name)

Remove a dimension from this instance.

void psi::THCE::delete_tensor ( const std::string &  name)

Decrement a Tensor of any type (removes from tensors_)

void psi::THCE::dimension_check ( const std::string &  name)
protected

Throws if a dimension name is not in dimensions_.

std::map<std::string, int>& psi::THCE::dimensions ( )
inline

Accessor to the list of currently declared dimensions (dimension classes)

size_t psi::THCE::disk_doubles ( ) const

Return the current disk memory utilization of this instance, in doubles.

void psi::THCE::new_core_tensor ( const std::string &  name,
const std::string &  dimensions,
double *  data = NULL,
bool  trust = false 
)

Add or overwrite a new core tensor, given a name and comma-separated dimension list.

void psi::THCE::new_dimension ( const std::string &  name,
int  size 
)

Add or overwrite a dimension to this instance.

void psi::THCE::new_disk_tensor ( const std::string &  name,
const std::string &  dimensions,
bool  save = false,
bool  load = false 
)

Add or overwrite a new disk tensor, given a name and comma-separated dimension list.

std::shared_ptr<Tensor>& psi::THCE::operator[] ( const std::string &  key)
inline

Direct tensor element accessor.

void psi::THCE::print ( std::string  fh = "outfile",
int  print = 1 
) const

Print a more detailed trace of the object.

void psi::THCE::print_header ( std::string  fh = "outfile") const
inline

Print a brief summary.

void psi::THCE::tensor_check ( const std::string &  name)
protected

Throws if a tensor name is not in tensors_.

std::map<std::string, std::shared_ptr<Tensor> >& psi::THCE::tensors ( )
inline

Accessor to the list of currently declared tensors.

static int psi::THCE::unique_id ( )
staticprotected

Get a unique ID number for a tensor (prevents disk clash)

Member Data Documentation

std::map<std::string, int> psi::THCE::dimensions_
protected

List of currently declared dimensions (dimension classes)

std::map<std::string, std::shared_ptr<Tensor> > psi::THCE::tensors_
protected

List of currently declated tensors.


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