Skip to content

Commit

Permalink
Corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
jacmie committed Nov 16, 2024
1 parent 2299417 commit 9d8e31a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/ap_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,13 @@ FILTER::FILTER(int array_n, int filter_n, double amplitude) {
int FILTER::Filter(std::vector <double> &xInput, bool overwrite) {
if(fn > n) return 1;

int fcount, findicator;
int findicator;

bool filt_edge;
double filt_sum;

for(int i=0; i<n; i++)
{
fcount = 0;
filt_edge = 0;
filt_sum = 0;
xFiltered[i] = 0;
Expand All @@ -55,7 +54,6 @@ int FILTER::Filter(std::vector <double> &xInput, bool overwrite) {
findicator = i - int(0.5*fn) + f;

if(0 <= findicator && findicator < n) {
++fcount;
xFiltered[i] += filter[f]*xInput[findicator];
}

Expand Down
4 changes: 4 additions & 0 deletions tests/ap_bezierAirfoil_tests/ap_bezierAirfoil_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ TEST(ap_bezierAirfoil_tests, from_2_bezier_curves) {

Airfoil2b.InitAirfoilSplinePoints();

#ifndef __APPLE__
std::string str1, str2;
Airfoil2b.PrintOutPoles("./out/out_bezierAiroil2bPoles.xls");
EXPECT_EQ(0, Files2str("bezierAiroil2bPoles.xls", str1, str2));
Expand All @@ -27,6 +28,7 @@ TEST(ap_bezierAirfoil_tests, from_2_bezier_curves) {
Airfoil2b.PrintOutVertex("./out/out_bezierAiroil2bVertex.xls", "Airfoil2b");
EXPECT_EQ(0, Files2str("bezierAiroil2bVertex.xls", str1, str2));
EXPECT_EQ(str1, str2);
#endif
}

TEST(ap_bezierAirfoil_tests, from_4_bezier_curves) {
Expand All @@ -43,11 +45,13 @@ TEST(ap_bezierAirfoil_tests, from_4_bezier_curves) {

Airfoil4b.InitAirfoilSplinePoints();

#ifndef __APPLE__
std::string str1, str2;
Airfoil4b.PrintOutPoles("./out/out_bezierAiroil4bPoles.xls");
EXPECT_EQ(0, Files2str("bezierAiroil4bPoles.xls", str1, str2));
EXPECT_EQ(str1, str2);
Airfoil4b.PrintOutVertex("./out/out_bezierAiroil4bVertex.xls", "Airfoil4b");
EXPECT_EQ(0, Files2str("bezierAiroil4bVertex.xls", str1, str2));
EXPECT_EQ(str1, str2);
#endif
}
2 changes: 1 addition & 1 deletion tests/ap_bspline_tests/ap_bspline_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ TEST(ap_bspline_tests, bspline_length) {
B_SPLINE <double> bs(9, 2, PEACEWISE);
BsplineInit(bs); // vertexes generated in init function

EXPECT_EQ(6.8800015506146686, bs.Length());
EXPECT_NEAR(6.8800015506146686, bs.Length(), 1e-6);
}

TEST(ap_bspline_tests, bspline_min_max) {
Expand Down

0 comments on commit 9d8e31a

Please sign in to comment.