tesseract  4.0.0-1-g2a2b
tesseract::NetworkScratch::GradientStore Class Reference

#include <networkscratch.h>

Public Member Functions

 GradientStore ()
 
 ~GradientStore ()
 
void Init (int size1, int size2, NetworkScratch *scratch)
 
TransposedArrayget () const
 
const TransposedArrayoperator* () const
 

Detailed Description

Definition at line 176 of file networkscratch.h.

Constructor & Destructor Documentation

◆ GradientStore()

tesseract::NetworkScratch::GradientStore::GradientStore ( )
inline

Definition at line 179 of file networkscratch.h.

179 : array_(nullptr), scratch_space_(nullptr) {}

◆ ~GradientStore()

tesseract::NetworkScratch::GradientStore::~GradientStore ( )
inline

Definition at line 180 of file networkscratch.h.

180  {
181  if (scratch_space_ != nullptr) scratch_space_->array_stack_.Return(array_);
182  }

Member Function Documentation

◆ get()

TransposedArray* tesseract::NetworkScratch::GradientStore::get ( ) const
inline

Definition at line 193 of file networkscratch.h.

193 { return array_; }

◆ Init()

void tesseract::NetworkScratch::GradientStore::Init ( int  size1,
int  size2,
NetworkScratch scratch 
)
inline

Definition at line 184 of file networkscratch.h.

184  {
185  if (scratch_space_ != nullptr && array_ != nullptr)
186  scratch_space_->array_stack_.Return(array_);
187  scratch_space_ = scratch;
188  array_ = scratch_space_->array_stack_.Borrow();
189  array_->Resize(size1, size2, 0.0);
190  }
void Resize(int size1, int size2, const T &empty)
Definition: matrix.h:105

◆ operator*()

const TransposedArray& tesseract::NetworkScratch::GradientStore::operator* ( ) const
inline

Definition at line 194 of file networkscratch.h.

194 { return *array_; }

The documentation for this class was generated from the following file: