gwnavruntime/abstractgraph/blobs/halfsquarematrix.h Source File
Go to the documentation of this file.
7 #ifndef Navigation_HalfSquaeMatrix_H
8 #define Navigation_HalfSquaeMatrix_H
18 class HalfSquareMatrix
29 , m_bufferSize(bufferSize)
35 if (rowIdx < columnIdx)
37 KyUInt32 index = GetIndexInHalfMatrix(rowIdx, columnIdx);
38 return &m_buffer[index];
40 else if (rowIdx > columnIdx)
41 return GetValue(columnIdx, rowIdx);
51 KY_ASSERT(rowIdx < columnIdx);
54 KyUInt32 fullMatrixIdx = count * rowIdx + columnIdx;
55 KyUInt32 rowSizedMatrixLength = rowIdx+1;
56 KyUInt32 rowSizedMatrixSize = rowSizedMatrixLength*rowSizedMatrixLength;
57 KyUInt32 rowSizedHalfMatrixSize = (rowSizedMatrixSize - rowSizedMatrixLength)/2;
58 KyUInt32 elementToRemoveFromFullMatrix = rowSizedMatrixSize - rowSizedHalfMatrixSize;
59 KyUInt32 index = fullMatrixIdx - elementToRemoveFromFullMatrix;
78 return ((count*count)-count) / 2;
#define KY_NULL
Null value.
Definition: types.h:247
Definition: gamekitcrowddispersion.h:20
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36