Files
Aurora/src/Function1D.h

153 lines
4.3 KiB
C
Raw Normal View History

#ifndef AURORA_FUNCTION1D_H
#define AURORA_FUNCTION1D_H
#include "Matrix.h"
2023-05-16 10:24:09 +08:00
#include <cmath>
namespace Aurora {
2023-04-20 15:34:38 +08:00
enum InterpnMethod
{
Spline=0,Linear
};
2023-04-25 11:24:24 +08:00
enum NormMethod
{
Norm1=1,Norm2,NormF
};
Matrix complex(const Matrix& matrix);
Matrix real(const Matrix& matrix);
Matrix imag(const Matrix& matrix);
Matrix ceil(const Matrix& matrix);
Matrix ceil(const Matrix&& matrix);
Matrix round(const Matrix& matrix);
Matrix round(const Matrix&& matrix);
2023-05-18 16:52:03 +08:00
Matrix floor(const Matrix& matrix);
Matrix floor(const Matrix&& matrix);
/**
*
* @param matrix
* @return
*/
Matrix sqrt(const Matrix& matrix);
2023-04-23 10:39:26 +08:00
Matrix sqrt(Matrix&& matrix);
Matrix abs(const Matrix& matrix);
2023-04-23 10:39:26 +08:00
Matrix abs(Matrix&& matrix);
Matrix sign(const Matrix& matrix);
2023-04-23 10:39:26 +08:00
Matrix sign(Matrix&& matrix);
2023-04-20 15:34:38 +08:00
Matrix interp1(const Matrix& aX, const Matrix& aV, const Matrix& aX1, InterpnMethod aMethod);
Matrix repmat(const Matrix& aMatrix,int aRowTimes, int aColumnTimes);
Matrix repmat(const Matrix& aMatrix,int aRowTimes, int aColumnTimes, int aSliceTimes);
2023-04-20 17:52:36 +08:00
2023-06-08 15:23:54 +08:00
Matrix repmat3d(const Matrix& aMatrix,int aRowTimes, int aColumnTimes, int aSliceTimes);
2023-04-20 17:52:36 +08:00
Matrix log(const Matrix& aMatrix, int aBaseNum = -1);
2023-04-23 11:12:00 +08:00
2023-04-23 15:47:29 +08:00
Matrix exp(const Matrix& aMatrix);
2023-10-08 15:58:43 +08:00
Matrix mod(const Matrix& aMatrix, float aValue);
2023-04-23 16:37:23 +08:00
2023-04-24 09:58:51 +08:00
Matrix acos(const Matrix& aMatrix);
2023-04-24 11:21:31 +08:00
Matrix acosd(const Matrix& aMatrix);
2023-04-24 13:05:44 +08:00
Matrix conj(const Matrix& aMatrix);
2023-10-08 15:58:43 +08:00
float norm(const Matrix& aMatrix, NormMethod aNormMethod);
2023-04-25 11:24:24 +08:00
Matrix transpose(const Matrix& aMatrix);
2023-04-25 15:17:15 +08:00
Matrix horzcat(const Matrix& aMatrix1, const Matrix& aMatrix2);
2023-06-09 15:13:52 +08:00
Matrix vertcat(const Matrix& aMatrix1, const Matrix& aMatrix2);
Matrix vecnorm(const Matrix& aMatrix, NormMethod aNormMethod, int aDim);
2023-10-08 15:58:43 +08:00
Matrix linspace(float aStart, float aEnd, int aNum);
2023-04-26 13:41:57 +08:00
2023-04-26 15:57:29 +08:00
Matrix auroraUnion(const Matrix& aMatrix1, const Matrix& aMatrix2);
Matrix intersect(const Matrix& aMatrix1, const Matrix& aMatrix2);
2023-04-26 17:57:34 +08:00
Matrix reshape(const Matrix& aMatrix, int aRows, int aColumns, int aSlices);
2023-05-18 11:42:48 +08:00
Matrix xcorr(const Matrix& aMatrix1, const Matrix& aMatrix2);
2023-05-24 16:34:51 +08:00
Matrix deleteColumn(const Matrix& aMatrix, int aColumnIndex);
2023-06-12 13:17:15 +08:00
2023-10-08 15:58:43 +08:00
Matrix createVectorMatrix(float aStartValue, float aStepValue, float aEndValue);
2023-06-14 11:01:21 +08:00
Matrix uniqueByRows(const Matrix& aMatrix, Matrix& aIndexResult);
/**
*
* @param aIa, [C,ia,~] = intersect(A,B)ia的返回值
* @return
*/
Matrix intersect(const Matrix& aMatrix1, const Matrix& aMatrix2, Matrix& aIa);
2023-04-23 11:12:00 +08:00
/**
*
* @brief p[1 0 1],x[3 2 5], y = x^2 + 1 (x=3, x=2, x=5)y
* @attention
* @param aP
* @param aX
* @return
*/
Matrix polyval(const Matrix& aP, const Matrix& aX);
2023-05-06 14:14:46 +08:00
/**
* nan值设置为特定值
* @attention
* @param aMatrix
* @param val
*/
2023-10-08 15:58:43 +08:00
void nantoval(Matrix& aMatrix,float val);
2023-05-06 14:14:46 +08:00
2023-05-16 10:24:09 +08:00
2023-05-16 10:27:55 +08:00
Matrix isnan(const Matrix& aMatrix);
2023-05-16 10:24:09 +08:00
2023-05-16 10:27:55 +08:00
Matrix isfinite(const Matrix& aMatrix);
2023-05-16 10:24:09 +08:00
2023-05-06 14:14:46 +08:00
/**
* 使
* @attention
* @param aMatrix
* @param aIndex
* @param aValue
*/
2023-10-08 15:58:43 +08:00
void padding(Matrix& aMatrix, int aIndex, float aValue);
2023-05-09 16:33:51 +08:00
2023-05-15 16:18:29 +08:00
Matrix auroraNot(const Matrix& aMatrix);
Matrix auroraNot(Matrix&& aMatrix);
2023-06-08 15:59:57 +08:00
enum CompareOp{
EQ,GT,LT,NG,NL,NE
};
2023-10-08 15:58:43 +08:00
void compareSet(Matrix& aValueMatrix,float compareValue, float newValue,CompareOp op);
void compareSet(Matrix& aValueMatrix,Matrix& aCompareMatrix,float compareValue, float newValue,CompareOp op);
void compareSet(Matrix& aDesAndCompareMatrix,Matrix& aOtherCompareMatrix, float newValue,CompareOp op);
void compareSet(Matrix& aCompareMatrix,float compareValue, Matrix& aNewValueMatrix,CompareOp op);
2023-05-15 16:18:29 +08:00
2023-05-09 17:56:15 +08:00
Matrix convertfp16tofloat(short* aData, int aRows, int aColumns);
};
#endif //AURORA_FUNCTION1D_H