2023-04-19 11:31:01 +08:00
|
|
|
|
#ifndef AURORA_FUNCTION1D_H
|
|
|
|
|
|
#define AURORA_FUNCTION1D_H
|
|
|
|
|
|
|
|
|
|
|
|
#include "Matrix.h"
|
|
|
|
|
|
|
|
|
|
|
|
namespace Aurora {
|
2023-04-20 15:34:38 +08:00
|
|
|
|
|
|
|
|
|
|
enum InterpnMethod
|
|
|
|
|
|
{
|
|
|
|
|
|
Spline=0,Linear
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2023-04-19 11:31:01 +08:00
|
|
|
|
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);
|
2023-04-19 11:31:01 +08:00
|
|
|
|
|
|
|
|
|
|
Matrix abs(const Matrix& matrix);
|
|
|
|
|
|
|
2023-04-23 10:39:26 +08:00
|
|
|
|
Matrix abs(Matrix&& matrix);
|
2023-04-19 11:31:01 +08:00
|
|
|
|
|
|
|
|
|
|
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-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-04-19 11:31:01 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif //AURORA_FUNCTION1D_H
|