.TH "sc::Function" 3 "Sun Oct 4 2020" "Version 2.3.1" "MPQC" \" -*- nroff -*- .ad l .nh .SH NAME sc::Function \- The \fBFunction\fP class is an abstract base class that, given a set of coordinates, will compute a value and possibly a gradient and hessian at that point\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBsc::SavableState\fP, and \fBsc::Compute\fP\&. .PP Inherited by \fBsc::MolecularEnergy\fP, and \fBsc::Volume\fP\&. .SS "Public Member Functions" .PP .RI "\fBGradient Members\fP" .br These are analogous to the routines that deal with values, but work with gradients instead\&. .PP .in +1c .in +1c .ti -1c .RI "virtual \fBRefSCVector\fP \fBgradient\fP ()" .br .ti -1c .RI "int \fBgradient_needed\fP () const" .br .ti -1c .RI "int \fBdo_gradient\fP (int)" .br .ti -1c .RI "virtual void \fBset_desired_gradient_accuracy\fP (double)" .br .ti -1c .RI "virtual double \fBactual_gradient_accuracy\fP () const" .br .ti -1c .RI "virtual double \fBdesired_gradient_accuracy\fP () const" .br .ti -1c .RI "\fBAccResultRefSCVector\fP & \fBgradient_result\fP ()" .br .in -1c .in -1c .PP .RI "\fBHessian Members\fP" .br These are analogous to the routines that deal with values, but work with the hessian instead\&. .PP .in +1c .in +1c .ti -1c .RI "virtual \fBRefSymmSCMatrix\fP \fBhessian\fP ()" .br .ti -1c .RI "int \fBhessian_needed\fP () const" .br .ti -1c .RI "int \fBdo_hessian\fP (int)" .br .ti -1c .RI "virtual void \fBset_desired_hessian_accuracy\fP (double)" .br .ti -1c .RI "virtual double \fBactual_hessian_accuracy\fP () const" .br .ti -1c .RI "virtual double \fBdesired_hessian_accuracy\fP () const" .br .ti -1c .RI "\fBAccResultRefSymmSCMatrix\fP & \fBhessian_result\fP ()" .br .ti -1c .RI "virtual void \fBguess_hessian\fP (\fBRefSymmSCMatrix\fP &)" .br .RI "\fBCompute\fP a quick, approximate hessian\&. " .ti -1c .RI "virtual \fBRefSymmSCMatrix\fP \fBinverse_hessian\fP (\fBRefSymmSCMatrix\fP &)" .br .ti -1c .RI "virtual int \fBvalue_implemented\fP () const" .br .RI "Information about the availability of values, gradients, and hessians\&. " .ti -1c .RI "virtual int \fBgradient_implemented\fP () const" .br .ti -1c .RI "virtual int \fBhessian_implemented\fP () const" .br .ti -1c .RI "virtual void \fBset_x\fP (const \fBRefSCVector\fP &)" .br .RI "Set and retrieve the coordinate values\&. " .ti -1c .RI "\fBRefSCVector\fP \fBget_x\fP () const" .br .ti -1c .RI "const \fBRefSCVector\fP & \fBget_x_no_copy\fP () const" .br .ti -1c .RI "virtual \fBRef\fP< \fBNonlinearTransform\fP > \fBchange_coordinates\fP ()" .br .RI "An optimizer can call change coordinates periodically to give the function an opportunity to change its coordinate system\&. " .ti -1c .RI "virtual void \fBprint\fP (std::ostream &=\fBExEnv::out0\fP()) const" .br .RI "Print information about the object\&. " .in -1c .in -1c .SS "Protected Member Functions" .PP .RI "\fBUpdate Members\fP" .br Update the various computable results\&. .PP .in +1c .in +1c .ti -1c .RI "virtual void \fBset_value\fP (double)" .br .ti -1c .RI "virtual void \fBset_gradient\fP (\fBRefSCVector\fP &)" .br .ti -1c .RI "virtual void \fBset_hessian\fP (\fBRefSymmSCMatrix\fP &)" .br .ti -1c .RI "virtual void \fBset_matrixkit\fP (const \fBRef\fP< \fBSCMatrixKit\fP > &)" .br .RI "Set the \fBSCMatrixKit\fP that should be used to construct the requisite vectors and matrices\&. " .ti -1c .RI "virtual void \fBset_dimension\fP (const \fBRefSCDimension\fP &)" .br .in -1c .in -1c .SS "Protected Attributes" .in +1c .ti -1c .RI "\fBRef\fP< \fBSCMatrixKit\fP > \fBmatrixkit_\fP" .br .RI "Used to construct new matrices\&. " .ti -1c .RI "\fBRefSCVector\fP \fBx_\fP" .br .RI "The variables\&. " .ti -1c .RI "\fBRefSCDimension\fP \fBdim_\fP" .br .RI "The dimension of x_\&. " .ti -1c .RI "\fBAccResultdouble\fP \fBvalue_\fP" .br .RI "The value of the function at x_\&. " .ti -1c .RI "\fBAccResultRefSCVector\fP \fBgradient_\fP" .br .RI "The gradient at x_\&. " .ti -1c .RI "\fBAccResultRefSymmSCMatrix\fP \fBhessian_\fP" .br .RI "The hessian at x_\&. " .in -1c .SS "Accuracy Setting Members" Set the accuracies with which the various computables have been computed\&. .in +1c .ti -1c .RI "virtual void \fBset_actual_value_accuracy\fP (double)" .br .ti -1c .RI "virtual void \fBset_actual_gradient_accuracy\fP (double)" .br .ti -1c .RI "virtual void \fBset_actual_hessian_accuracy\fP (double)" .br .ti -1c .RI "\fBRefSCVector\fP & \fBget_x_reference\fP ()" .br .RI "Get read/write access to the coordinates for modification\&. " .ti -1c .RI "void \fBdo_change_coordinates\fP (const \fBRef\fP< \fBNonlinearTransform\fP > &)" .br .RI "Change the coordinate system and apply the given transform to intermediates matrices and vectors\&. " .ti -1c .RI "\fBFunction\fP ()" .br .ti -1c .RI "\fBFunction\fP (\fBStateIn\fP &)" .br .ti -1c .RI "\fBFunction\fP (const \fBFunction\fP &)" .br .ti -1c .RI "\fBFunction\fP (const \fBRef\fP< \fBKeyVal\fP > &, double funcacc=DBL_EPSILON, double gradacc=DBL_EPSILON, double hessacc=DBL_EPSILON)" .br .RI "The keyval constructor reads the following keywords: " .ti -1c .RI "virtual \fB~Function\fP ()" .br .ti -1c .RI "\fBFunction\fP & \fBoperator=\fP (const \fBFunction\fP &)" .br .ti -1c .RI "\fBRef\fP< \fBSCMatrixKit\fP > \fBmatrixkit\fP () const" .br .RI "Return the \fBSCMatrixKit\fP used to construct vectors and matrices\&. " .ti -1c .RI "\fBRefSCDimension\fP \fBdimension\fP () const" .br .RI "Return the \fBSCDimension\fP of the problem\&. " .ti -1c .RI "virtual void \fBsave_data_state\fP (\fBStateOut\fP &)" .br .RI "Save the base classes (with save_data_state) and the members in the same order that the \fBStateIn\fP CTOR initializes them\&. " .ti -1c .RI "virtual double \fBvalue\fP ()" .br .RI "Return the value of the function\&. " .ti -1c .RI "int \fBvalue_needed\fP () const" .br .RI "Returns nonzero if the current value is not up-to-date\&. " .ti -1c .RI "int \fBdo_value\fP (int)" .br .RI "If passed a nonzero number, compute the value the next time \fBcompute()\fP is called\&. " .ti -1c .RI "\fBAccResultdouble\fP & \fBvalue_result\fP ()" .br .ti -1c .RI "virtual void \fBset_desired_value_accuracy\fP (double)" .br .RI "Set the accuracy to which the value is to be computed\&. " .ti -1c .RI "virtual double \fBactual_value_accuracy\fP () const" .br .RI "Return the accuracy with which the value has been computed\&. " .ti -1c .RI "virtual double \fBdesired_value_accuracy\fP () const" .br .RI "Return the accuracy with which the value is to be computed\&. " .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP The \fBFunction\fP class is an abstract base class that, given a set of coordinates, will compute a value and possibly a gradient and hessian at that point\&. .SH "Constructor & Destructor Documentation" .PP .SS "sc::Function::Function (const \fBRef\fP< \fBKeyVal\fP > &, double funcacc = \fCDBL_EPSILON\fP, double gradacc = \fCDBL_EPSILON\fP, double hessacc = \fCDBL_EPSILON\fP)" .PP The keyval constructor reads the following keywords: .IP "\fB\fCmatrixkit\fP\fP" 1c Gives a \fBSCMatrixKit\fP object\&. If it is not specified, a default \fBSCMatrixKit\fP is selected\&. .PP .IP "\fB\fCvalue_accuracy\fP\fP" 1c Sets the accuracy to which values are computed\&. The default is the machine accuracy\&. .PP .IP "\fB\fCgradient_accuracy\fP\fP" 1c Sets the accuracy to which gradients are computed\&. The default is the machine accuracy\&. .PP .IP "\fB\fChessian_accuracy\fP\fP" 1c Sets the accuracy to which hessians are computed\&. The default is the machine accuracy\&. .PP .PP .SH "Member Function Documentation" .PP .SS "virtual \fBRef\fP<\fBNonlinearTransform\fP> sc::Function::change_coordinates ()\fC [virtual]\fP" .PP An optimizer can call change coordinates periodically to give the function an opportunity to change its coordinate system\&. A return value of 0 means the coordinates were not changed\&. Otherwise, a transform object to the new coordinate system is return\&. The function object applies the transform to any objects it contains\&. This will obsolete the function data\&. .PP Reimplemented in \fBsc::MolecularEnergy\fP\&. .SS "int sc::Function::do_value (int)" .PP If passed a nonzero number, compute the value the next time \fBcompute()\fP is called\&. Return a nonzero number if the value was previously to be computed\&. .SS "virtual void sc::Function::save_data_state (\fBStateOut\fP &)\fC [virtual]\fP" .PP Save the base classes (with save_data_state) and the members in the same order that the \fBStateIn\fP CTOR initializes them\&. This must be implemented by the derived class if the class has data\&. .PP Reimplemented from \fBsc::SavableState\fP\&. .PP Reimplemented in \fBsc::Wavefunction\fP, \fBsc::HCoreWfn\fP, \fBsc::OneBodyWavefunction\fP, \fBsc::ExtendedHuckelWfn\fP, \fBsc::UnrestrictedSCF\fP, \fBsc::UHF\fP, \fBsc::TCSCF\fP, \fBsc::TCHF\fP, \fBsc::SCF\fP, \fBsc::OSSSCF\fP, \fBsc::OSSHF\fP, \fBsc::HSOSSCF\fP, \fBsc::HSOSHF\fP, \fBsc::CLSCF\fP, \fBsc::CLHF\fP, \fBsc::PsiCCSD_T\fP, \fBsc::PsiCCSD\fP, \fBsc::PsiSCF\fP, \fBsc::PsiWavefunction\fP, \fBsc::MBPT2_R12\fP, \fBsc::MP2BasisExtrap\fP, \fBsc::MBPT2\fP, \fBsc::UKS\fP, \fBsc::HSOSKS\fP, \fBsc::CLKS\fP, \fBsc::TaylorMolecularEnergy\fP, \fBsc::SumMolecularEnergy\fP, and \fBsc::MolecularEnergy\fP\&. .SH "Author" .PP Generated automatically by Doxygen for MPQC from the source code\&.