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

# sc\_SCDimension(3)

The SCDimension class is used to determine the size and blocking of matrices.

## NAME

sc::SCDimension - The **SCDimension** class is used to determine the size and blocking of matrices.

## SYNOPSIS

`#include <dim.h>`

Inherits **sc::SavableState**.

### Public Member Functions

**SCDimension** (int **n**, const char \***name**=0)\
 Create a dimension with an optional name.  **SCDimension** (const **Ref**\< **SCBlockInfo** \> &, const char \***name**=0)\
 **SCDimension** (int **n**, int nblocks, const int \*blocksizes=0, const char \***name**=0)\
 **SCDimension** (const **Ref**\< **KeyVal** \> &)\
 The **KeyVal** constructor.  **SCDimension** (**StateIn** &s)\
 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.  int **equiv** (const **SCDimension** \*) const\
 Test to see if two dimensions are equivalent.  int **n** () const\
 Return the dimension.  const char \* **name** () const\
 Return the name of the dimension.  **Ref**\< **SCBlockInfo** \> **blocks** ()\
 Return the blocking information for this dimension.  void **print** (std::ostream &o=**ExEnv::out0**()) const\
 Print information about this dimension to o.

### Protected Member Functions

**SCDimension** (const char \***name**=0)\

### Protected Attributes

char \* **name\_**\
 int **n\_**\
 **Ref**\< **SCBlockInfo** \> **blocks\_**\

### Additional Inherited Members

## Detailed Description

The **SCDimension** class is used to determine the size and blocking of matrices.

The blocking information is stored by an object of class **SCBlockInfo**. \

## Constructor & Destructor Documentation

### sc::SCDimension::SCDimension (int n, const char \* name = `0`)

Create a dimension with an optional name. The name is a copy of the '0' terminated string name.

### sc::SCDimension::SCDimension (const Ref\< KeyVal \> &)

The **KeyVal** constructor.

- `n`

  This gives size of the dimension. One of n or blocks is required.

- `blocks`

  The block information for the dimension can be given as a **SCBlockInfo** object. One of n or blocks is required.

## Member Function Documentation

### const char \* sc::SCDimension::name () const` [inline]`

Return the name of the dimension. If no name was given to the constructor, then return 0.

### void sc::SCDimension::print (std::ostream & o = ExEnv::out0`()`) const` [virtual]`

Print information about this dimension to o.

Reimplemented from **sc::DescribedClass**.

### void sc::SCDimension::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::SavableState**.

## Author

Generated automatically by Doxygen for MPQC from the source code.
