Add operator [] to Matrix
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "Matrix.h"
|
||||
|
||||
#include <cstddef>
|
||||
#include <mkl_cblas.h>
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
@@ -468,6 +469,9 @@ namespace Aurora {
|
||||
Matrix operator^( Matrix &&matrix,int times) {
|
||||
return operatorMxA(&vdPowI, times, std::forward<Matrix&&>(matrix));
|
||||
}
|
||||
|
||||
double Matrix::operator[](size_t index) const { return getData()[index];}
|
||||
|
||||
void Matrix::printf() {
|
||||
if(isNull())
|
||||
{
|
||||
|
||||
@@ -169,6 +169,9 @@ namespace Aurora {
|
||||
friend Matrix operator==(double aScalar, const Matrix &matrix);
|
||||
Matrix operator==(const Matrix &matrix) const;
|
||||
|
||||
// sub
|
||||
double operator[](size_t index) const;
|
||||
|
||||
|
||||
/**
|
||||
* 矩阵乘法
|
||||
|
||||
Reference in New Issue
Block a user