tesseract  5.0.0-alpha-619-ge9db
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 174 of file networkscratch.h.

Constructor & Destructor Documentation

◆ GradientStore()

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

Definition at line 177 of file networkscratch.h.

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

◆ ~GradientStore()

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

Definition at line 178 of file networkscratch.h.

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

Member Function Documentation

◆ get()

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

Definition at line 191 of file networkscratch.h.

191 { return array_; }

◆ Init()

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

Definition at line 182 of file networkscratch.h.

182  {
183  if (scratch_space_ != nullptr && array_ != nullptr)
184  scratch_space_->array_stack_.Return(array_);
185  scratch_space_ = scratch;
186  array_ = scratch_space_->array_stack_.Borrow();
187  array_->Resize(size1, size2, 0.0);
188  }

◆ operator*()

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

Definition at line 192 of file networkscratch.h.

192 { return *array_; }

The documentation for this class was generated from the following file:
GENERIC_2D_ARRAY::Resize
void Resize(int size1, int size2, const T &empty)
Definition: matrix.h:104