Psi4
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
psi::IntVector Class Reference

#include <vector.h>

Public Member Functions

 IntVector ()
 Default constructor, zeros everything out. More...
 
 IntVector (const IntVector &copy)
 Copy constructor. More...
 
 IntVector (int nirrep, int *dimpi)
 Constructor, allocates memory. More...
 
 IntVector (int dim)
 Constructor, convenience for 1 irrep. More...
 
 IntVector (const std::string &name, int nirrep, int *dimpi)
 Constructor, allocates memory. More...
 
 IntVector (const std::string &name, int dim)
 Constructor, convenience for 1 irrep. More...
 
virtual ~IntVector ()
 Destructor, frees memory. More...
 
void init (int nirrep, int *dimpi)
 
void set (int *vec)
 Sets the vector_ to the data in vec. More...
 
int * pointer (int h=0)
 Returns a pointer to irrep h. More...
 
int get (int h, int m)
 Returns a single element value. More...
 
void set (int h, int m, int val)
 Sets a single element value. More...
 
int * to_block_vector ()
 Returns a copy of the vector_. More...
 
int dim (int h=0) const
 Returns the dimension per irrep h. More...
 
int * dimpi () const
 Returns the dimension array. More...
 
int nirrep () const
 Returns the number of irreps. More...
 
void set_name (const std::string &name)
 
std::string name () const
 
void print_out ()
 Python compatible printer. More...
 
void print (std::string outfile="outfile", const char *extra=nullptr) const
 
void copy (const IntVector *rhs)
 Copies rhs to this. More...
 
void copy (const IntVector &rhs)
 Copies rhs to this. More...
 

Protected Member Functions

void alloc ()
 Allocates vector_. More...
 
void release ()
 Releases vector_. More...
 
void copy_from (int **)
 Copies data to vector_. More...
 

Protected Attributes

int ** vector_
 IntVector data. More...
 
int nirrep_
 Number of irreps. More...
 
int * dimpi_
 Dimensions per irrep. More...
 
std::string name_
 Name of the IntVector. More...
 

Friends

class VectorIterator
 

Detailed Description

Constructor & Destructor Documentation

IntVector::IntVector ( )

Default constructor, zeros everything out.

IntVector::IntVector ( const IntVector copy)

Copy constructor.

IntVector::IntVector ( int  nirrep,
int *  dimpi 
)

Constructor, allocates memory.

IntVector::IntVector ( int  dim)

Constructor, convenience for 1 irrep.

IntVector::IntVector ( const std::string &  name,
int  nirrep,
int *  dimpi 
)

Constructor, allocates memory.

IntVector::IntVector ( const std::string &  name,
int  dim 
)

Constructor, convenience for 1 irrep.

IntVector::~IntVector ( )
virtual

Destructor, frees memory.

Member Function Documentation

void IntVector::alloc ( )
protected

Allocates vector_.

void IntVector::copy ( const IntVector rhs)

Copies rhs to this.

void IntVector::copy ( const IntVector rhs)

Copies rhs to this.

void IntVector::copy_from ( int **  c)
protected

Copies data to vector_.

int psi::IntVector::dim ( int  h = 0) const
inline

Returns the dimension per irrep h.

int* psi::IntVector::dimpi ( ) const
inline

Returns the dimension array.

int psi::IntVector::get ( int  h,
int  m 
)
inline

Returns a single element value.

void IntVector::init ( int  nirrep,
int *  dimpi 
)
std::string psi::IntVector::name ( ) const
inline

Gets the name of the matrix.

int psi::IntVector::nirrep ( void  ) const
inline

Returns the number of irreps.

int* psi::IntVector::pointer ( int  h = 0)
inline

Returns a pointer to irrep h.

void IntVector::print ( std::string  outfile = "outfile",
const char *  extra = nullptr 
) const

Print the matrix using print_mat

Parameters
outfileFile point to use, defaults to Psi4's outfile.
extraWhen printing the name of the 'extra' will be printing after the name.
void psi::IntVector::print_out ( )
inline

Python compatible printer.

void IntVector::release ( )
protected

Releases vector_.

void IntVector::set ( int *  vec)

Sets the vector_ to the data in vec.

void psi::IntVector::set ( int  h,
int  m,
int  val 
)
inline

Sets a single element value.

void psi::IntVector::set_name ( const std::string &  name)
inline

Sets the name of the vector, used in print(...)

Parameters
nameNew name to use.
int * IntVector::to_block_vector ( )

Returns a copy of the vector_.

Friends And Related Function Documentation

friend class VectorIterator
friend

Member Data Documentation

int* psi::IntVector::dimpi_
protected

Dimensions per irrep.

std::string psi::IntVector::name_
protected

Name of the IntVector.

int psi::IntVector::nirrep_
protected

Number of irreps.

int** psi::IntVector::vector_
protected

IntVector data.


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