---
name: "sc_SCMatrixDiagBlock"
section: "3"
platform: "linux"
package: "libsc-doc"
version: "2.3.1-22"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/sc_SCMatrixDiagBlock"
---

# sc\_SCMatrixDiagBlock(3)

The SCMatrixDiagBlock describes a diagonal piece of a matrix.

## NAME

sc::SCMatrixDiagBlock - The **SCMatrixDiagBlock** describes a diagonal piece of a matrix.

## SYNOPSIS

`#include <block.h>`

Inherits **sc::SCMatrixBlock**.

### Public Member Functions

**SCMatrixDiagBlock** (int istart, int iend, int jstart)\
 **SCMatrixDiagBlock** (int istart, int iend)\
 **SCMatrixDiagBlock** (**StateIn** &)\
 void **save\_data\_state** (**StateOut** &)\
 Save the base classes (with save\_data\_state) and the members in the same order that the **StateIn** CTOR initializes them.  **SCMatrixBlock** \* **deepcopy** () const\
 Return of copy of this.  void **process** (**SCElementOp** \*)\
 void **process** (**SCElementOp2** \*, **SCMatrixBlock** \*)\
 void **process** (**SCElementOp3** \*, **SCMatrixBlock** \*, **SCMatrixBlock** \*)\
 double \* **dat** ()\
 Return a pointer to the block's data and the number of elements in the block.  int **ndat** () const\

### Public Attributes

int **istart**\
 int **jstart**\
 int **iend**\
 double \* **data**\

### Additional Inherited Members

## Detailed Description

The **SCMatrixDiagBlock** describes a diagonal piece of a matrix.

The following bit of code illustrates the data layout: fill(double \*\*matrix, SCMatrixDiagBlock &b) { int i,j,offset=0; for (i=b.istart,j=b.jstart; i\<b.iend; i++,j++,offset++) { matrix\[i\]\[j\] = b.data\[offset\]; } }

## Member Function Documentation

### double \* sc::SCMatrixDiagBlock::dat ()` [virtual]`

Return a pointer to the block's data and the number of elements in the block. Some blocks cannot provide this information and a runtime error will be generated if these members are called. These routines are only used internally in the matrix library.

Reimplemented from **sc::SCMatrixBlock**.

### SCMatrixBlock \* sc::SCMatrixDiagBlock::deepcopy () const` [virtual]`

Return of copy of this. A runtime error will be generated for blocks that cannot do a deepcopy. These routines are only used internally in the matrix library.

Reimplemented from **sc::SCMatrixBlock**.

### int sc::SCMatrixDiagBlock::ndat () const` [virtual]`

Reimplemented from **sc::SCMatrixBlock**.

### void sc::SCMatrixDiagBlock::process (SCElementOp \*)` [virtual]`

Implements **sc::SCMatrixBlock**.

### void sc::SCMatrixDiagBlock::process (SCElementOp2 \*, SCMatrixBlock \*)` [virtual]`

Implements **sc::SCMatrixBlock**.

### void sc::SCMatrixDiagBlock::process (SCElementOp3 \*, SCMatrixBlock \*, SCMatrixBlock \*)` [virtual]`

Implements **sc::SCMatrixBlock**.

### void sc::SCMatrixDiagBlock::save\_data\_state (StateOut &)` [virtual]`

Save the base classes (with save\_data\_state) and the members in the same order that the **StateIn** CTOR initializes them. This must be implemented by the derived class if the class has data.

Reimplemented from **sc::SCMatrixBlock**.

## Author

Generated automatically by Doxygen for MPQC from the source code.
