Add polyval to Function1D

This commit is contained in:
Krad
2023-04-23 11:12:00 +08:00
parent 5e85d0f361
commit 57e712a006
5 changed files with 43 additions and 27 deletions

View File

@@ -20,24 +20,6 @@ namespace Aurora {
return result;
}
double *polyval(double *pX, double *pP, int size) {
auto result = new double[size];
auto powArg = new double[size];
for (int j = size, i = 0; j > 0; --j, ++i) {
powArg[i] = (double) (j - 1);
}
auto temp = new double[size];
for (int i = 0; i < size; ++i) {
vdPowI(size, pX + i, 0, powArg, 1, temp, 1);
vdMul(size, pP, temp, temp);
result[i] = cblas_dasum(3, temp, 1);
}
delete[] powArg;
delete[] temp;
return result;
}
double *std(int rows, int cols, double *input) {
auto std = new double[cols];
// #pragma omp parallel for num_threads(4)