Matrix class update.
This commit is contained in:
10
src/Matrix.h
10
src/Matrix.h
@@ -4,12 +4,13 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#define ALL_DIM -1
|
||||
|
||||
namespace Aurora {
|
||||
enum ValueType{
|
||||
Normal=1,
|
||||
Complex
|
||||
};
|
||||
const int $ = -1;
|
||||
|
||||
class Matrix {
|
||||
public:
|
||||
@@ -28,14 +29,17 @@ namespace Aurora {
|
||||
*/
|
||||
class MatrixSlice{
|
||||
public:
|
||||
MatrixSlice(int aSize,int aStride, double* aData,ValueType aType = Normal);
|
||||
MatrixSlice(int aSize,int aStride, double* aData,ValueType aType = Normal,int SliceMode = 1,int aSize2 = 0, int aStride2 = 0);
|
||||
MatrixSlice& operator=(const MatrixSlice& slice);
|
||||
MatrixSlice& operator=(const Matrix& matrix);
|
||||
Matrix toMatrix();
|
||||
private:
|
||||
int mSliceMode = 0;//0 scalar, 1 vector, 2 Matrix
|
||||
double* mData;
|
||||
int mSize;
|
||||
int mSize2;
|
||||
int mStride;
|
||||
int mStride2;
|
||||
ValueType mType;
|
||||
};
|
||||
|
||||
@@ -50,7 +54,7 @@ namespace Aurora {
|
||||
Matrix deepCopy() const;
|
||||
|
||||
//切片,暂时不支持三维
|
||||
MatrixSlice operator()(int r, int c = ALL_DIM, int s = ALL_DIM) const;
|
||||
MatrixSlice operator()(int r, int c = $, int aSliceIdx = $) const;
|
||||
|
||||
// add
|
||||
Matrix operator+(double aScalar) const;
|
||||
|
||||
Reference in New Issue
Block a user