Skip to content

Commit

Permalink
Unit tests: Replaced emplace_back with vector c'tor to create multipl…
Browse files Browse the repository at this point in the history
…e regressors
  • Loading branch information
patrikhuber committed Apr 30, 2015
1 parent 02b4a47 commit 912813d
Showing 1 changed file with 5 additions and 55 deletions.
60 changes: 5 additions & 55 deletions test/test_SupervisedDescentOptimiser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,7 @@ TEST(SupervisedDescentOptimiser, SinConvergenceCascade) {

Mat x0 = 0.5f * Mat::ones(numValues, 1, CV_32FC1); // fixed initialization x0 = c = 0.5.

vector<LinearRegressor<>> regressors;
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
vector<LinearRegressor<>> regressors(10);
SupervisedDescentOptimiser<LinearRegressor<>> sdo(regressors);
sdo.train(x_tr, x0, y_tr, h);

Expand Down Expand Up @@ -225,17 +215,7 @@ TEST(SupervisedDescentOptimiser, XCubeConvergenceCascade) {

Mat x0 = 0.5f * Mat::ones(numValues, 1, CV_32FC1); // fixed initialization x0 = c = 0.5.

vector<LinearRegressor<>> regressors;
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
vector<LinearRegressor<>> regressors(10);
SupervisedDescentOptimiser<LinearRegressor<>> sdo(regressors);
sdo.train(x_tr, x0, y_tr, h);

Expand Down Expand Up @@ -334,17 +314,7 @@ TEST(SupervisedDescentOptimiser, ErfConvergenceCascade) {

Mat x0 = 0.5f * Mat::ones(numValues, 1, CV_32FC1); // fixed initialization x0 = c = 0.5.

vector<LinearRegressor<>> regressors;
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
vector<LinearRegressor<>> regressors(10);
SupervisedDescentOptimiser<LinearRegressor<>> sdo(regressors);
sdo.train(x_tr, x0, y_tr, h);

Expand Down Expand Up @@ -443,17 +413,7 @@ TEST(SupervisedDescentOptimiser, ExpConvergenceCascade) {

Mat x0 = 0.5f * Mat::ones(numValues, 1, CV_32FC1); // fixed initialization x0 = c = 0.5.

vector<LinearRegressor<>> regressors;
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
vector<LinearRegressor<>> regressors(10);
SupervisedDescentOptimiser<LinearRegressor<>> sdo(regressors);
sdo.train(x_tr, x0, y_tr, h);

Expand Down Expand Up @@ -530,17 +490,7 @@ TEST(SupervisedDescentOptimiser, SinErfConvergenceCascadeMultiY) {

Mat x0 = 0.5f * Mat::ones(numValues, 2, CV_32FC1); // fixed initialization x0 = c = 0.5.

vector<LinearRegressor<>> regressors;
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
regressors.emplace_back(LinearRegressor<>());
vector<LinearRegressor<>> regressors(10);
SupervisedDescentOptimiser<LinearRegressor<>> sdo(regressors);

sdo.train(x_tr, x0, y_tr, h);
Expand Down

0 comments on commit 912813d

Please sign in to comment.