Sleipnir
Public Member Functions
Sleipnir::CBinaryMatrix Class Reference

A special symmetric matrix in which each entry consumes exactly one bit. More...

#include <halfmatrix.h>

Inheritance diagram for Sleipnir::CBinaryMatrix:
Sleipnir::CHalfMatrix< unsigned char > Sleipnir::CHalfMatrixBase

Public Member Functions

bool Get (size_t iY, size_t iX) const
 Returns the value at the requested matrix position.
void Set (size_t iY, size_t iX, bool fValue)
 Set the value at the requested matrix position.
void Initialize (size_t iSize, bool fClear=false, unsigned char **aabData=NULL)
 Create a new matrix of the requested size and, optionally, referencing the given data.

Detailed Description

A special symmetric matrix in which each entry consumes exactly one bit.

Remarks:
Sort of the logical extreme of CCompactMatrix, except symmetric and much more simple to implement.

Definition at line 427 of file halfmatrix.h.


Member Function Documentation

bool Sleipnir::CBinaryMatrix::Get ( size_t  iY,
size_t  iX 
) const [inline]

Returns the value at the requested matrix position.

Parameters:
iYMatrix row.
iXMatrix column.
Returns:
Value at the requested matrix position.
Remarks:
For efficiency, no bounds checking is performed. The given row and column must be smaller than the size.
See also:
Set

Reimplemented from Sleipnir::CHalfMatrix< unsigned char >.

Definition at line 449 of file halfmatrix.h.

References Sleipnir::CHalfMatrix< unsigned char >::m_aaData.

Referenced by Sleipnir::CDataMask::AttachComplement(), Sleipnir::CDataMask::AttachRandom(), Sleipnir::CDatasetCompactMap::IsExample(), and Sleipnir::CDataMask::IsExample().

void Sleipnir::CBinaryMatrix::Initialize ( size_t  iSize,
bool  fClear = false,
unsigned char **  aabData = NULL 
) [inline]

Create a new matrix of the requested size and, optionally, referencing the given data.

Parameters:
iSizeMatrix elements.
fClearIf true, initialize the new matrix to contain only false values.
aabDataIf non-null, the memory that will back the newly created matrix.
Remarks:
A reference is held to the given memory; it is not copied, so it should not be destroyed before the newly initialized matrix.

Definition at line 502 of file halfmatrix.h.

References Sleipnir::CHalfMatrix< unsigned char >::m_aaData, Sleipnir::CHalfMatrix< unsigned char >::m_fMemory, and Sleipnir::CHalfMatrix< unsigned char >::Reset().

Referenced by Sleipnir::CDataMask::Attach(), and Sleipnir::CDatasetCompactMap::Open().

void Sleipnir::CBinaryMatrix::Set ( size_t  iY,
size_t  iX,
bool  fValue 
) [inline]

Set the value at the requested matrix position.

Parameters:
iYMatrix row.
iXMatrix column.
fValueValue to store.
Remarks:
For efficiency, no bounds checking is performed. The given row and column must be smaller than the size.
See also:
Get

Definition at line 476 of file halfmatrix.h.

References Sleipnir::CHalfMatrix< unsigned char >::m_aaData.

Referenced by Sleipnir::CDataMask::Attach(), Sleipnir::CDataMask::AttachComplement(), Sleipnir::CDataMask::AttachRandom(), Sleipnir::CDatasetCompactMap::Open(), Sleipnir::CDatasetCompactMap::Remove(), and Sleipnir::CDataMask::Remove().


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