tesseract v5.3.3.20231005
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 180 of file networkscratch.h.

Constructor & Destructor Documentation

◆ GradientStore()

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

Definition at line 183 of file networkscratch.h.

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

◆ ~GradientStore()

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

Definition at line 184 of file networkscratch.h.

184 {
185 if (scratch_space_ != nullptr) {
186 scratch_space_->array_stack_.Return(array_);
187 }
188 }

Member Function Documentation

◆ get()

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

Definition at line 200 of file networkscratch.h.

200 {
201 return array_;
202 }

◆ Init()

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

Definition at line 190 of file networkscratch.h.

190 {
191 if (scratch_space_ != nullptr && array_ != nullptr) {
192 scratch_space_->array_stack_.Return(array_);
193 }
194 scratch_space_ = scratch;
195 array_ = scratch_space_->array_stack_.Borrow();
196 array_->Resize(size1, size2, 0.0);
197 }
void Resize(int size1, int size2, const T &empty)
Definition: matrix.h:110

◆ operator*()

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

Definition at line 203 of file networkscratch.h.

203 {
204 return *array_;
205 }

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