Files
Aurora/src/Function1D.h

130 lines
3.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);
/**
*
* @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
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-04-23 16:37:23 +08:00
Matrix mod(const Matrix& aMatrix, double aValue);
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-04-25 11:24:24 +08:00
double norm(const Matrix& aMatrix, NormMethod aNormMethod);
Matrix transpose(const Matrix& aMatrix);
2023-04-25 15:17:15 +08:00
Matrix horzcat(const Matrix& aMatrix1, const Matrix& aMatrix2);
Matrix vecnorm(const Matrix& aMatrix, NormMethod aNormMethod, int aDim);
2023-04-26 13:41:57 +08:00
Matrix linspace(double aStart, double aEnd, int aNum);
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);
/**
*
* @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
*/
void nantoval(Matrix& aMatrix,double 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
*/
void padding(Matrix& aMatrix, int aIndex, double 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-05-09 17:56:15 +08:00
Matrix convertfp16tofloat(short* aData, int aRows, int aColumns);
};
#endif //AURORA_FUNCTION1D_H