MPQC  3.0.0-alpha
sc::sma2::Index Class Reference

An Index is used in the symbolic notation for contractions. More...

#include <chemistry/qc/lmp2/sma.h>

Public Member Functions

 Index (const std::string &name)
 Allocate a named index. More...
 
 Index (int value)
 Allocate an index with a specific value. More...
 
 Index (const std::string &name, int value)
 Allocate an Index with a fixed value and a name. More...
 
const std::string name () const
 Return the name of the index. More...
 
int value () const
 Return the value of the index. More...
 
bool has_value () const
 Returns true if the index has a value, indicating that the index is to be fixed.
 
bool symbolically_equivalent (const Index &i) const
 Returns true if the indices have non-empty names which are the same. More...
 
bool operator== (const Index &i) const
 Returns true if the indices are equivalent.
 
void set_value (int value)
 Set the value of the index.
 

Detailed Description

An Index is used in the symbolic notation for contractions.

Constructor & Destructor Documentation

◆ Index() [1/3]

sc::sma2::Index::Index ( const std::string &  name)
inline

Allocate a named index.

Indices with names can be external or internal indices.

◆ Index() [2/3]

sc::sma2::Index::Index ( int  value)
inline

Allocate an index with a specific value.

The value will be fixed during array manipulations. An Index with a value and no name may appear in just a single array, but this only makes sense, and is only allowed, when all of the blocks for that index are size one.

◆ Index() [3/3]

sc::sma2::Index::Index ( const std::string &  name,
int  value 
)
inline

Allocate an Index with a fixed value and a name.

This sort of Index can be used to specify fixed external indices. This is the only way to used fixed indices when the block size of the fixed index might be greater than one. The value is the fixed block number in this case.

Member Function Documentation

◆ name()

const std::string sc::sma2::Index::name ( ) const
inline

Return the name of the index.

This is only valid if has_name() returns true.

Referenced by operator==(), and symbolically_equivalent().

◆ symbolically_equivalent()

bool sc::sma2::Index::symbolically_equivalent ( const Index i) const
inline

Returns true if the indices have non-empty names which are the same.

The result is undefined if array operations are done when two Index names are the same but their values are different.

References name().

◆ value()

int sc::sma2::Index::value ( ) const
inline

Return the value of the index.

This is only valid if has_value is true.

Referenced by set_value().


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

Generated at Sun Jan 26 2020 23:24:15 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.8.16.