36#if !defined(LOOS_HESSIAN_HPP)
37#define LOOS_HESSIAN_HPP
42#include "spring_functions.hpp"
70 virtual ~SuperBlock() { }
72 uint size()
const {
return(
static_cast<uint
>(nodes.size())); }
76 virtual SpringFunction::Params
setParams(
const SpringFunction::Params& v) {
102 if (i >= size() || j >= size())
103 throw(std::runtime_error(
"Invalid index in Hessian SuperBlock"));
106 throw(std::runtime_error(
"No spring function defined for hessian!"));
114 for (uint y=0; y<3; ++y)
115 for (uint x=0; x<3; ++x)
116 B(x, y) = d[x]*d[y] * K(x,y);
193 if (connectivity.rows() != connectivity.cols() && connectivity.cols() != size())
194 throw(std::runtime_error(
"Connectivity matrix and Nodelist have differing sizes"));
201 if (connectivity(j, i))
204 return(decorated->
block(j, i));
208 SpringFunction::Params
setParams(
const SpringFunction::Params& v) {
209 SpringFunction::Params u = bound_spring->
setParams(v);
Decorator for switching spring functions based on a matrix of flags.
Definition hessian.hpp:186
loos::DoubleMatrix block(const uint j, const uint i)
Returns a 3x3 matrix representing a superblock in the Hessian for the two nodes.
Definition hessian.hpp:200
uint paramSize() const
Returns the aggregate parameter size.
Definition hessian.hpp:219
bool validParams() const
Both the alternate and all decorated parameters are valid.
Definition hessian.hpp:216
SpringFunction::Params setParams(const SpringFunction::Params &v)
Assign parameters and propagate to the decorated superblock.
Definition hessian.hpp:208
Interface for ENM spring functions.
Definition spring_functions.hpp:75
virtual uint paramSize() const =0
How many internal constants there are.
virtual Params setParams(const Params &konst)=0
Sets the internal constants, returning the unused ones.
virtual bool validParams() const =0
Determines if the internal constants are "valid".
SuperBlock decorator base class.
Definition hessian.hpp:135
SuperBlockDecorator(SuperBlock *b)
Constructor that takes a SuperBlock to decorate.
Definition hessian.hpp:139
This class creates superblocks in a hessian.
Definition hessian.hpp:52
virtual bool validParams() const
Forwards to the contained SpringFunction...
Definition hessian.hpp:81
loos::DoubleMatrix blockImpl(const uint j, const uint i, SpringFunction *fptr)
Implementation of the superblock calculation.
Definition hessian.hpp:101
virtual SpringFunction::Params setParams(const SpringFunction::Params &v)
Forwards to the contained SpringFunction...
Definition hessian.hpp:76
SuperBlock(SpringFunction *func, const loos::AtomicGroup &nodelist)
Constructor taking a spring function and a list of nodes.
Definition hessian.hpp:68
virtual uint paramSize() const
Forwards to the contained SpringFunction...
Definition hessian.hpp:84
virtual loos::DoubleMatrix block(const uint j, const uint i)
Returns a 3x3 matrix representing a superblock in the Hessian for the two nodes.
Definition hessian.hpp:88
Class for handling groups of Atoms (pAtoms, actually)
Definition AtomicGroup.hpp:108
Simple matrix template class using policy classes to determine behavior.
Definition MatrixImpl.hpp:148
Namespace to encapsulate Elastic Network Model routines.
Definition anm-lib.hpp:32