NOX Development
|
Utility class for NOX::Direction::Broyden method to manage the information stored in "limited" memory. More...
#include <NOX_Direction_Broyden.H>
Public Member Functions | |
BroydenMemory () | |
Constructor. | |
~BroydenMemory () | |
Destructor. | |
void | reset (int m) |
Reset the memory. | |
void | reset () |
Reset the memory. | |
void | push (const NOX::Abstract::Vector &d) |
Add new information to the memory. | |
bool | empty () const |
Returns true if the memory is empty. | |
int | size () const |
Number of items in memory. | |
BroydenMemoryUnit & | operator[] (int i) |
Return the ith MemoryUnit (unchecked access) | |
Utility class for NOX::Direction::Broyden method to manage the information stored in "limited" memory.
Store up to
NOX::Direction::Broyden::BroydenMemory::BroydenMemory | ( | ) |
Constructor.
Does nothing.
NOX::Direction::Broyden::BroydenMemory::~BroydenMemory | ( | ) |
Destructor.
Does nothing.
NOX::Direction::Broyden::BroydenMemoryUnit & NOX::Direction::Broyden::BroydenMemory::operator[] | ( | int | i | ) |
Return the ith MemoryUnit (unchecked access)
The zero entry is the oldest memory. The m-1 entry is the newest entry (where m denotes the memory size).
void NOX::Direction::Broyden::BroydenMemory::push | ( | const NOX::Abstract::Vector & | d | ) |
Add new information to the memory.
We need to calculate where the new udpate should be stored in memory and update the information in index.
Let k denote the index of where the new update should be stored. If there are current m items stored in memory and m < mMax, then we set k = m. Otherwise, we set k equal to the location of the oldest update. The oldest update is deleted to make room for the new update. In both cases, index must be updated appropriately so that the first (zero) entry points to the oldest update and the last entry points to the newest update.
void NOX::Direction::Broyden::BroydenMemory::reset | ( | ) |
Reset the memory.
Sets the size of the index vector to be zero.
void NOX::Direction::Broyden::BroydenMemory::reset | ( | int | m | ) |