Aurora not function
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
#include <Eigen/SVD>
|
#include <Eigen/SVD>
|
||||||
#include <mkl_lapack.h>
|
#include <mkl_lapack.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
using namespace Aurora;
|
using namespace Aurora;
|
||||||
|
|
||||||
@@ -199,6 +200,19 @@ Aurora::Matrix Aurora::round(const Aurora::Matrix &&matrix) {
|
|||||||
return matrix;
|
return matrix;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Matrix Aurora::auroraNot(const Matrix& aMatrix){
|
||||||
|
return auroraNot(std::forward<Matrix&&>(aMatrix.deepCopy()));
|
||||||
|
}
|
||||||
|
|
||||||
|
Matrix Aurora::auroraNot(Matrix&& aMatrix){
|
||||||
|
Eigen::Map<Eigen::VectorXd> v2(aMatrix.getData(), aMatrix.getDataSize());
|
||||||
|
v2 = (v2.array()>0).select(1,v2);
|
||||||
|
v2 = (v2.array()<0).select(0,v2);
|
||||||
|
v2 = v2.array()+1.0;
|
||||||
|
v2 = (v2.array() == 2.0).select(0.0, v2);
|
||||||
|
return aMatrix;
|
||||||
|
}
|
||||||
|
|
||||||
Aurora::Matrix Aurora::sqrt(const Aurora::Matrix& matrix) {
|
Aurora::Matrix Aurora::sqrt(const Aurora::Matrix& matrix) {
|
||||||
|
|
||||||
if (matrix.getValueType() != Complex) {
|
if (matrix.getValueType() != Complex) {
|
||||||
|
|||||||
@@ -113,6 +113,9 @@ namespace Aurora {
|
|||||||
*/
|
*/
|
||||||
void padding(Matrix& aMatrix, int aIndex, double aValue);
|
void padding(Matrix& aMatrix, int aIndex, double aValue);
|
||||||
|
|
||||||
|
Matrix auroraNot(const Matrix& aMatrix);
|
||||||
|
Matrix auroraNot(Matrix&& aMatrix);
|
||||||
|
|
||||||
Matrix convertfp16tofloat(short* aData, int aRows, int aColumns);
|
Matrix convertfp16tofloat(short* aData, int aRows, int aColumns);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user