6 #include "StrongNumber.h"
19 SMARTENGINE_DECLARE_CLASS(
IMatrix)
22 virtual bool IsReadOnly()
const = 0;
86 SMARTENGINE_EXPORT ObjPtr Matrix_CreateInstance(int64 rows, int64 cols);
87 SMARTENGINE_EXPORT
int Matrix_IsReadOnly(ObjPtr
object);
88 SMARTENGINE_EXPORT int64 Matrix_RowCount(ObjPtr
object);
89 SMARTENGINE_EXPORT int64 Matrix_ColCount(ObjPtr
object);
90 SMARTENGINE_EXPORT
float Matrix_GetValue(ObjPtr
object, int64 row, int64 col);
91 SMARTENGINE_EXPORT
void Matrix_GetRow(ObjPtr
object, int64 row,
float* buffer, int64 bufferCount);
92 SMARTENGINE_EXPORT
void Matrix_GetBuffer(ObjPtr
object,
float* buffer, int64 bufferCount);
93 SMARTENGINE_EXPORT
void Matrix_SetValue(ObjPtr
object, int64 row, int64 col,
float value);
94 SMARTENGINE_EXPORT
void Matrix_Resize(ObjPtr
object, int64 rows, int64 cols);
95 SMARTENGINE_EXPORT
void Matrix_Zero(ObjPtr
object);
96 SMARTENGINE_EXPORT
int Matrix_HasNaN(ObjPtr
object);
virtual MatrixIndex ColCount() const =0
Returns the number of columns in the matrix
virtual void Resize(MatrixIndex rows, MatrixIndex cols)=0
Resizes the matrix to the specified number of rows and columns. This will error if the matrix is read...
Definition: StrongNumber.h:9
virtual void GetBuffer(float *buffer, MatrixIndex bufferCount) const =0
Fills the buffer with all elements from this matrix. The elements in the buffer will be laid out in r...
SMARTENGINE_EXPORT ObjectPtr< IMatrix > CreateMatrix(MatrixIndex rows, MatrixIndex cols)
Creates an instance of IMatrix
virtual void SetValue(MatrixIndex row, MatrixIndex col, float value)=0
Sets a value in the matrix. This will error if the matrix is read only.
Smart pointer to an IObject. Automatic ref counting.
Definition: ObjectPtr.h:16
virtual void GetRow(MatrixIndex row, float *buffer, MatrixIndex bufferCount) const =0
Fills the buffer with a single row from the matrix. The buffer should have space for at least RowCoun...
Definition: A2CTrainer.h:10
Base class for SmartEngine AI objects. It is not common to deal with this class directly.
Definition: Object.h:19
virtual void Zero()=0
Assigns 0 to all values in the matrix.
Wrapper around either a const or a mutable matrix.
Definition: Matrix.h:17
virtual float GetValue(MatrixIndex row, MatrixIndex col) const =0
Returns the value at location [row, col]
virtual MatrixIndex RowCount() const =0
Returns the number of rows in the matrix
virtual bool HasNaN()=0
Returns true if any value is NaN, false otherwise.