#include <CompressedVMatrix.h>
Inheritance diagram for PLearn::CompressedVMatrix:
Public Member Functions | |
CompressedVMatrix () | |
default constructor (for automatic deserialization) | |
CompressedVMatrix (int the_max_length, int the_width, size_t memory_alloc=0) | |
CompressedVMatrix (VMat v, size_t memory_alloc=0) | |
PLEARN_DECLARE_OBJECT (CompressedVMatrix) | |
virtual | ~CompressedVMatrix () |
virtual void | appendRow (Vec v) |
This method must be implemented for matrices that are allowed to grow. | |
size_t | memoryAllocated () |
returns the number of bytes allocated for the data | |
size_t | memoryUsed () |
returns the memory actually used for the data | |
virtual void | compacify () |
This will reallocate the data chunk to be exactly of the needed size, so that no memory will be wasted. | |
Protected Member Functions | |
void | init (int the_max_length, int the_width, size_t memory_alloc) |
virtual void | getNewRow (int i, const Vec &v) const |
This is the only method requiring implementation in subclasses. | |
Protected Attributes | |
int | max_length |
maximum number of rows that can be appended to the initially empty matrix | |
signed char * | data |
signed char ** | rowstarts |
signed char * | dataend |
data+memory_alloc | |
signed char * | curpos |
next writing position in data chunk | |
Private Types | |
typedef RowBufferedVMatrix | inherited |
Definition at line 63 of file CompressedVMatrix.h.
|
Reimplemented from PLearn::RowBufferedVMatrix. Definition at line 65 of file CompressedVMatrix.h. |
|
default constructor (for automatic deserialization)
Definition at line 53 of file CompressedVMatrix.cc. |
|
This initializes the matrix with a length of 0 (but up to the_max_length rows can be appended) If no memory_alloc value is given, a sufficient default value will be used initially. You can always call reallocateCompactMemory() later to use the minimum memory Definition at line 58 of file CompressedVMatrix.cc. References init(). |
|
This initializes a matrix from the data of another. If no memory_alloc value is given, a sufficient default value will be used initially. You can always call reallocateCompactMemory() later to use the minimum memory Definition at line 73 of file CompressedVMatrix.cc. References appendRow(), init(), PLearn::VMat::length(), PLearn::Vec, and PLearn::VMat::width(). |
|
Definition at line 125 of file CompressedVMatrix.cc. |
|
This method must be implemented for matrices that are allowed to grow.
Reimplemented from PLearn::VMatrix. Definition at line 96 of file CompressedVMatrix.cc. References curpos, dataend, max_length, PLERROR, and rowstarts. Referenced by CompressedVMatrix(). |
|
This will reallocate the data chunk to be exactly of the needed size, so that no memory will be wasted.
Reimplemented from PLearn::VMatrix. Definition at line 107 of file CompressedVMatrix.cc. References curpos, data, dataend, max_length, and rowstarts. |
|
This is the only method requiring implementation in subclasses.
Implements PLearn::RowBufferedVMatrix. Definition at line 85 of file CompressedVMatrix.cc. References PLearn::TVec< T >::length(), PLERROR, and rowstarts. |
|
This initializes the matrix with a length of 0 (but up to the_max_length rows can be appended) A memory_alloc of length*(2 + 4*width + width/128) should be enough in every case (and much less is needed for matrices containing a lot of 0 or small integers) Definition at line 62 of file CompressedVMatrix.cc. References curpos, data, dataend, max_length, and rowstarts. Referenced by CompressedVMatrix(). |
|
returns the number of bytes allocated for the data
Definition at line 113 of file CompressedVMatrix.h. |
|
returns the memory actually used for the data
Definition at line 116 of file CompressedVMatrix.h. |
|
|
|
next writing position in data chunk
Definition at line 75 of file CompressedVMatrix.h. Referenced by appendRow(), compacify(), init(), and memoryUsed(). |
|
Definition at line 70 of file CompressedVMatrix.h. Referenced by compacify(), init(), memoryAllocated(), memoryUsed(), and ~CompressedVMatrix(). |
|
data+memory_alloc
Definition at line 72 of file CompressedVMatrix.h. Referenced by appendRow(), compacify(), init(), and memoryAllocated(). |
|
maximum number of rows that can be appended to the initially empty matrix
Definition at line 68 of file CompressedVMatrix.h. Referenced by appendRow(), compacify(), and init(). |
|
Definition at line 71 of file CompressedVMatrix.h. Referenced by appendRow(), compacify(), getNewRow(), init(), and ~CompressedVMatrix(). |