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

# sc\_SavableState(3)

Base class for objects that can save/restore state.

## NAME

sc::SavableState - Base class for objects that can save/restore state.

## SYNOPSIS

`#include <state.h>`

Inherits **sc::DescribedClass**.

Inherited by **sc::AccumH**` [virtual]`, **sc::AngularIntegrator**` [virtual]`, **sc::AtomInfo**, **sc::Convergence**` [virtual]`, **sc::Debugger**, **sc::DenFunctional**` [virtual]`, **sc::DenIntegrator**` [virtual]`, **sc::Function**` [virtual]`, **sc::GaussianBasisSet**, **sc::GaussianShell**, **sc::HessianUpdate**` [virtual]`, **sc::IntCoor**, **sc::IntCoorGen**, **sc::Integral**, **sc::IntegrationWeight**` [virtual]`, **sc::MOIndexSpace**` [virtual]`, **sc::MOIntsTransformFactory**` [virtual]`, **sc::MP2R12Energy**` [virtual]`, **sc::MolecularCoor**, **sc::MolecularFrequencies**, **sc::MolecularHessian**` [virtual]`, **sc::Molecule**, **sc::Optimize**` [virtual]`, **sc::OverlapOrthog**` [virtual]`, **sc::PointGroup**, **sc::R12IntEval**` [virtual]`, **sc::R12IntEvalInfo**` [virtual]`, **sc::R12IntsAcc**` [virtual]`, **sc::RadialIntegrator**` [virtual]`, **sc::SCBlockInfo**, **sc::SCDimension**, **sc::SCElementOp**, **sc::SCElementOp2**, **sc::SCElementOp3**, **sc::SCExtrapData**, **sc::SCExtrapError**, **sc::SCMatrixBlock**, **sc::SCMatrixBlockList**, **sc::SelfConsistentExtrapolation**, **sc::SetIntCoor**, **sc::ShellPairCints**` [virtual]`, **sc::ShellPairsCints**` [virtual]`, **sc::TwoBodyGrid**` [virtual]`, **sc::TwoBodyMOIntsTransform**` [virtual]`, and **sc::Units**.

### Public Member Functions

**SavableState** & **operator=** (const **SavableState** &)\
 void **save\_state** (**StateOut** &)\
 Save the state of the object as specified by the **StateOut** object.  void **save\_object\_state** (**StateOut** &)\
 This can be used for saving state when the exact type of the object is known for both the save and the restore.  virtual void **save\_vbase\_state** (**StateOut** &)\
 Save the virtual bases for the object.  virtual 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.

### Static Public Member Functions

static void **save\_state** (**SavableState** \*s, **StateOut** &)\
 static **SavableState** \* **restore\_state** (**StateIn** &si)\
 Restores objects saved with save\_state.  static **SavableState** \* **key\_restore\_state** (**StateIn** &si, const char \*keyword)\
 Like restore\_state, but keyword is used to override values while restoring.  static **SavableState** \* **dir\_restore\_state** (**StateIn** &si, const char \*objectname, const char \*keyword=0)\

### Protected Member Functions

**SavableState** (const **SavableState** &)\
 **SavableState** (**StateIn** &)\
 Each derived class **StateIn** CTOR handles the restore corresponding to calling save\_object\_state, save\_vbase\_state, and save\_data\_state listed above.

## Detailed Description

Base class for objects that can save/restore state.

## Constructor & Destructor Documentation

### sc::SavableState::SavableState (StateIn &)` [protected]`

Each derived class **StateIn** CTOR handles the restore corresponding to calling save\_object\_state, save\_vbase\_state, and save\_data\_state listed above. All derived class **StateIn**& constructors must invoke the **SavableState(StateIn&)** constructor.

## Member Function Documentation

### static SavableState \* sc::SavableState::restore\_state (StateIn & si)` [static]`

Restores objects saved with save\_state. The exact type of the next object in si can be any type publically derived from the **SavableState**. Derived classes implement a similar static function that returns a pointer to the derived class. If the objectname is given the directory will be consulted to find and restore that object.

### virtual void sc::SavableState::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 in **sc::IntCoor**, **sc::SumIntCoor**, **sc::SetIntCoor**, **sc::IntCoorGen**, **sc::MolecularCoor**, **sc::IntMolecularCoor**, **sc::SymmMolecularCoor**, **sc::RedundMolecularCoor**, **sc::CartMolecularCoor**, **sc::MolecularEnergy**, **sc::SumMolecularEnergy**, **sc::MolEnergyConvergence**, **sc::FinDispMolecularHessian**, **sc::MolecularHessian**, **sc::ReadMolecularHessian**, **sc::GuessMolecularHessian**, **sc::DiagMolecularHessian**, **sc::Molecule**, **sc::MolecularFrequencies**, **sc::SimpleCo**, **sc::TaylorMolecularEnergy**, **sc::GaussianBasisSet**, **sc::GaussianShell**, **sc::Integral**, **sc::OverlapOrthog**, **sc::IntegralCints**, **sc::ShellPairCints**, **sc::ShellPairsCints**, **sc::CLKS**, **sc::DenFunctional**, **sc::NElFunctional**, **sc::SumDenFunctional**, **sc::StdDenFunctional**, **sc::LSDACFunctional**, **sc::PBECFunctional**, **sc::PW91CFunctional**, **sc::P86CFunctional**, **sc::NewP86CFunctional**, **sc::SlaterXFunctional**, **sc::VWNLCFunctional**, **sc::VWN1LCFunctional**, **sc::VWN2LCFunctional**, **sc::VWN3LCFunctional**, **sc::VWN4LCFunctional**, **sc::VWN5LCFunctional**, **sc::PW92LCFunctional**, **sc::PZ81LCFunctional**, **sc::XalphaFunctional**, **sc::Becke88XFunctional**, **sc::LYPCFunctional**, **sc::PW86XFunctional**, **sc::PBEXFunctional**, **sc::PW91XFunctional**, **sc::mPW91XFunctional**, **sc::G96XFunctional**, **sc::HSOSKS**, **sc::DenIntegrator**, **sc::IntegrationWeight**, **sc::BeckeIntegrationWeight**, **sc::RadialIntegrator**, **sc::AngularIntegrator**, **sc::EulerMaclaurinRadialIntegrator**, **sc::LebedevLaikovIntegrator**, **sc::GaussLegendreAngularIntegrator**, **sc::RadialAngularIntegrator**, **sc::UKS**, **sc::IntegralCCA**, **sc::IntegralV3**, **sc::MBPT2**, **sc::MP2BasisExtrap**, **sc::MBPT2\_R12**, **sc::MOIndexSpace**, **sc::MP2R12Energy**, **sc::R12IntsAcc**, **sc::R12IntsAcc\_MemoryGrp**, **sc::R12IntsAcc\_MPIIOFile**, **sc::R12IntsAcc\_MPIIOFile\_Ind**, **sc::R12IntsAcc\_Node0File**, **sc::R12IntEval**, **sc::MOIntsTransformFactory**, **sc::TwoBodyMOIntsTransform\_ijxy**, **sc::TwoBodyMOIntsTransform\_ikjy**, **sc::TwoBodyMOIntsTransform\_ixjy**, **sc::TwoBodyMOIntsTransform**, **sc::TwoBodyGrid**, **sc::R12IntEvalInfo**, **sc::PsiWavefunction**, **sc::PsiSCF**, **sc::PsiCCSD**, **sc::PsiCCSD\_T**, **sc::CLHF**, **sc::CLSCF**, **sc::HSOSHF**, **sc::HSOSSCF**, **sc::OSSHF**, **sc::OSSSCF**, **sc::SCF**, **sc::TCHF**, **sc::TCSCF**, **sc::UHF**, **sc::UnrestrictedSCF**, **sc::AccumH**, **sc::AccumHNull**, **sc::SumAccumH**, **sc::ExtendedHuckelWfn**, **sc::OneBodyWavefunction**, **sc::HCoreWfn**, **sc::BEMSolventH**, **sc::Wavefunction**, **sc::Convergence**, **sc::DIIS**, **sc::EFCOpt**, **sc::Function**, **sc::GDIISOpt**, **sc::NewtonOpt**, **sc::Optimize**, **sc::LineOpt**, **sc::QNewtonOpt**, **sc::SCExtrapData**, **sc::SCExtrapError**, **sc::SelfConsistentExtrapolation**, **sc::SymmSCMatrixSCExtrapData**, **sc::SymmSCMatrix2SCExtrapData**, **sc::SymmSCMatrix4SCExtrapData**, **sc::SymmSCMatrixNSCExtrapData**, **sc::SymmSCMatrixSCExtrapError**, **sc::SteepestDescentOpt**, **sc::HessianUpdate**, **sc::DFPUpdate**, **sc::BFGSUpdate**, **sc::PowellUpdate**, **sc::SCMatrixBlockList**, **sc::SCVectorSimpleBlock**, **sc::SCVectorSimpleSubBlock**, **sc::SCMatrixRectBlock**, **sc::SCMatrixRectSubBlock**, **sc::SCMatrixLTriBlock**, **sc::SCMatrixLTriSubBlock**, **sc::SCMatrixDiagBlock**, **sc::SCMatrixDiagSubBlock**, **sc::SCBlockInfo**, **sc::SCDimension**, **sc::SCElementScalarProduct**, **sc::SCDestructiveElementProduct**, **sc::SCElementScale**, **sc::SCElementRandomize**, **sc::SCElementAssign**, **sc::SCElementSquareRoot**, **sc::SCElementInvert**, **sc::SCElementScaleDiagonal**, **sc::SCElementShiftDiagonal**, **sc::SCElementMaxAbs**, **sc::SCElementMinAbs**, **sc::SCElementSumAbs**, **sc::SCElementKNorm**, **sc::SCElementDot**, **sc::Debugger**, **sc::AtomInfo**, **sc::SCMatrixBlock**, **sc::Units**, and **sc::PointGroup**.

### void sc::SavableState::save\_object\_state (StateOut &)

This can be used for saving state when the exact type of the object is known for both the save and the restore. To restore objects saved in this way the user must directly invoke the object's **StateIn**& constructor.

### void sc::SavableState::save\_state (StateOut &)

Save the state of the object as specified by the **StateOut** object. This routine saves the state of the object (which includes the nonvirtual bases), the virtual bases, and type information. The default implementation should be adequate.

### virtual void sc::SavableState::save\_vbase\_state (StateOut &)` [virtual]`

Save the virtual bases for the object. This must be done in the same order that the ctor initializes the virtual bases. This does not include the **DescribedClass** and **SavableState** virtual base classes. This must be implemented by the user if the class has other virtual bases. (These virtual bases must come after **SavableState**, if **SavableState** is virtual.)

## Author

Generated automatically by Doxygen for MPQC from the source code.
