# sc_RefDiagSCMatrix man page

sc::RefDiagSCMatrix — The **RefDiagSCMatrix** class is a smart pointer to an **DiagSCMatrix** specialization.

## Synopsis

`#include <matrix.h>`

Inherits **sc::Ref< DiagSCMatrix >**.

### Public Member Functions

RefDiagSCMatrix()Initializes the matrix pointer to 0.RefDiagSCMatrix(constRefDiagSCMatrix&m)Make this and m refer to the sameSCMatrix.RefDiagSCMatrix(DiagSCMatrix*m)Make this refer to m.RefDiagSCMatrix&operator=(DiagSCMatrix*m)Make this refer to m.RefDiagSCMatrix&operator=(constRefDiagSCMatrix&m)Make this and m refer to the same matrix.RefDiagSCMatrix(constRefSCDimension&, constRef<SCMatrixKit> &)Create a diagonal matrix with dimension d by d.RefSCMatrix operator*(constRefSCMatrix&) constMultiply this by a matrix and return a matrix.RefDiagSCMatrix operator*(double) constRefDiagSCMatrix operator+(constRefDiagSCMatrix&) constMatrix addition and subtraction.RefDiagSCMatrix operator-(constRefDiagSCMatrix&) constRefDiagSCMatrix i() constReturn the inverse of this.RefDiagSCMatrix gi() constReturn the generalized inverse of this.RefDiagSCMatrix clone() constThese call theSCMatrixmembers of the same name after checking for references to 0.RefDiagSCMatrix copy() const

voidset_element(int, double) const

voidaccumulate_element(int, double) const

doubleget_element(int) const

voidrandomize() const

voidassign(constRefDiagSCMatrix&) const

voidscale(double) const

voidassign(double) const

voidassign(const double *) const

voidconvert(double *) const

voidaccumulate(constRefDiagSCMatrix&) const

voidelement_op(constRef<SCElementOp> &) const

voidelement_op(constRef<SCElementOp2> &, constRefDiagSCMatrix&) const

voidelement_op(constRef<SCElementOp3> &, constRefDiagSCMatrix&, constRefDiagSCMatrix&) const

intn() constRefSCDimension dim() constRef<SCMatrixKit>kit() const

doubletrace() const

void

voidExEnv::out0(), int=10) const

voidsave(StateOut&)

voidrestore(StateIn&)Restores the matrix fromStateInobject. The matrix must have been initialized already.

doubledeterm() constReturns the determinant of the referenced matrix.DiagSCMatrixdouble operator()(inti) constAssign and examine matrix elements.

intnblock() constIf this matrix is blocked return the number of blocks.RefDiagSCMatrix block(inti) constIf this matrix is blocked return block i.

### Additional Inherited Members

## Detailed Description

The **RefDiagSCMatrix** class is a smart pointer to an **DiagSCMatrix** specialization.

## Constructor & Destructor Documentation

### sc::RefDiagSCMatrix::RefDiagSCMatrix ()

Initializes the matrix pointer to 0. The reference must be initialized before it is used.

### sc::RefDiagSCMatrix::RefDiagSCMatrix (const RefSCDimension &, const Ref< SCMatrixKit > &)

Create a diagonal matrix with dimension d by d. The data values are undefined.

## Member Function Documentation

### RefDiagSCMatrix sc::RefDiagSCMatrix::block (int i) const

If this matrix is blocked return block i. Otherwise return this as block 0.

### RefDiagSCMatrix sc::RefDiagSCMatrix::clone () const

These call the **SCMatrix** members of the same name after checking for references to 0.

### int sc::RefDiagSCMatrix::nblock () const

If this matrix is blocked return the number of blocks. Otherwise return 1.

## Author

Generated automatically by Doxygen for MPQC from the source code.

## Info

Fri May 6 2016 Version 2.3.1 MPQC