Skip to content

Commit 443579b

Browse files
#34 completed testing of lbfgs
1 parent 6fe35f2 commit 443579b

4 files changed

Lines changed: 21 additions & 9 deletions

File tree

src/Engine.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ Engine::Engine(DwnNetwork *myNetwork, ScenarioTree *myScenarioTree, SmpcConfigur
4141
priceUncertaintyFlag = true;
4242
demandUncertaintyFlag = true;
4343
if( algorithmName.compare("globalFbeAlgorithm") == 0){
44-
cout << " algorithm based on SMPC " << algorithmName <<endl;
44+
cout << "algorithm based on SMPC " << algorithmName <<endl;
4545
globalFbeFlag = true;
4646

4747
}else{
48-
cout << " algorithm based on SMPC " << algorithmName <<endl;
48+
cout << "algorithm based on SMPC " << algorithmName <<endl;
4949
globalFbeFlag = false;
5050
}
5151

src/SmpcController.cu

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ SmpcController::SmpcController(Forecaster *myForecaster, Engine *myEngine, SmpcC
5050

5151
vecPrimalInfs = new real_t[ptrMySmpcConfig->getMaxIterations()];
5252
vecValueFbe = new real_t[ptrMySmpcConfig->getMaxIterations()];
53+
vecTau = new real_t[ptrMySmpcConfig->getMaxIterations()];
5354

5455
economicKpi = 0;
5556
smoothKpi = 0;
@@ -81,6 +82,7 @@ SmpcController::SmpcController(string pathToConfigFile){
8182

8283
vecPrimalInfs = new real_t[ptrMySmpcConfig->getMaxIterations()];
8384
vecValueFbe = new real_t[ptrMySmpcConfig->getMaxIterations()];
85+
vecTau = new real_t[ptrMySmpcConfig->getMaxIterations()];
8486

8587
economicKpi = 0;
8688
smoothKpi = 0;
@@ -1688,4 +1690,5 @@ SmpcController::~SmpcController(){
16881690

16891691
vecPrimalInfs = NULL;
16901692
vecValueFbe = NULL;
1693+
vecTau = NULL;
16911694
}

src/main.cu

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ int main(void){
1212
uint_t TESTING = 1;
1313
if (TESTING){
1414
Testing *myTesting = new Testing();
15-
//_ASSERT( myTesting->testNetwork() );
16-
//_ASSERT( myTesting->testScenarioTree() );
17-
//_ASSERT( myTesting->testForecaster() );
18-
//_ASSERT( myTesting->testControllerConfig() );
19-
//_ASSERT( myTesting->testEngineTesting() );
20-
//_ASSERT( myTesting->testSmpcController() );
15+
_ASSERT( myTesting->testNetwork() );
16+
_ASSERT( myTesting->testScenarioTree() );
17+
_ASSERT( myTesting->testForecaster() );
18+
_ASSERT( myTesting->testControllerConfig() );
19+
_ASSERT( myTesting->testEngineTesting() );
20+
_ASSERT( myTesting->testSmpcController() );
21+
//Testing *otherTesting = new Testing();
22+
//_ASSERT( otherTesting->testSmpcFbeController() );
2123
_ASSERT( myTesting->testSmpcFbeController() );
2224
//myTesting->testNewEngineTesting();
2325
}else{

src/test/Testing.cu

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ uint_t Testing::testSmpcController(){
509509
_ASSERT( ptrMyTestSmpc->testProximalStep());
510510
_ASSERT( ptrMyTestSmpc->testDualUpdate() );
511511

512-
cout << "completed testing of the controller" << endl;
512+
cout << "completed testing of the APG controller" << endl;
513513
delete ptrMyDwnNetwork;
514514
delete ptrMyScenarioTree;
515515
delete ptrMySmpcConfig;
@@ -518,6 +518,11 @@ uint_t Testing::testSmpcController(){
518518
delete ptrMyTestSmpc;
519519
ptrMyDwnNetwork = NULL;
520520
ptrMyScenarioTree = NULL;
521+
ptrMySmpcConfig = NULL;
522+
ptrMyForecaster = NULL;
523+
ptrMySmpcConfig = NULL;
524+
ptrMyTestSmpc = NULL;
525+
521526

522527
delete [] y;
523528
return 1;
@@ -546,6 +551,8 @@ uint_t Testing::testSmpcFbeController(){
546551

547552
cout << "completed testing global FBE algorithm in smpc" << endl;
548553
delete ptrMyForecaster;
554+
delete ptrMyTestSmpc;
555+
ptrMyTestSmpc = NULL;
549556
ptrMyForecaster = NULL;
550557

551558
return 1;

0 commit comments

Comments
 (0)