Skip to content

Commit 159b71e

Browse files
author
Ajay_kumar
committed
#38 and #37 complted and tested the Naive implementation of Nama
1 parent 0f9890d commit 159b71e

13 files changed

Lines changed: 4221 additions & 3634 deletions

src/Engine.cuh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public:
5353
*
5454
* @param network
5555
* @param forecaster
56-
* @todo remove `SmpcConfig` from here
56+
* TODO remove `SmpcConfig` from here
5757
*/
5858
Engine( DwnNetwork *network,
5959
ScenarioTree *scenarioTree,

src/SmpcController.cu

Lines changed: 150 additions & 79 deletions
Large diffs are not rendered by default.

src/SmpcController.cuh

Lines changed: 53 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,13 @@ protected:
231231
* @param real_t step-size in the direction of the lbfgs direction
232232
*/
233233
real_t computeLineSearchLbfgsUpdate(real_t valueFbeYvar);
234+
/*
235+
* compute the line search update of the tau for the AME
236+
* @param valueAmeYvar the value of the AME at the current dual variable Y
237+
*
238+
* @param real_t step-size of the lbfgs direction and fixed point residual
239+
*/
240+
real_t computeLineSearchAmeLbfgsUpdate(real_t valueAmeYvar);
234241
/**
235242
* This method executes the APG algorithm and returns the primal infeasibility.
236243
* @return primalInfeasibilty;
@@ -283,6 +290,11 @@ protected:
283290
* intialise the dual vectors in the optimisation algorithm
284291
*/
285292
void initialiseAlgorithm();
293+
/*
294+
* update the current and the previous fixed-point residual
295+
* for NAMA algorithm
296+
*/
297+
void updateFixedPointResidualNamaAlgorithm();
286298
/*
287299
* deallocate the memory of the APG in the device
288300
*/
@@ -487,11 +499,12 @@ protected:
487499
/*
488500
* pointer array to the previous fixed point residual
489501
*/
490-
real_t **devPtrVecFixedPointResidualXi;
502+
real_t *devVecCurrentFixedPointResidualXi;
491503
/*
492-
* pointer array to the previous fixed point residual
504+
* pointer to the previous fixed point residual
493505
*/
494-
real_t **devPtrVecFixedPointResidualPsi;
506+
real_t *devVecCurrentFixedPointResidualPsi;
507+
495508
/* ----- quasi-newton direction ----- */
496509
/**
497510
* Pointer array for the vector required for solve step Xi
@@ -534,6 +547,22 @@ protected:
534547
* pointer to the direction from the LBFGS psi in the device
535548
*/
536549
real_t *devVecLbfgsDirPsi;
550+
/*
551+
* Hessian oracle with respect to fixed point residual x
552+
*/
553+
real_t *devVecFixedPointXdir;
554+
/*
555+
* Hessian oracle with respect to fixed point residual x
556+
*/
557+
real_t *devVecFixedPointUdir;
558+
/*
559+
* Hessian oracle with respect to fixed point residual x
560+
*/
561+
real_t *devVecFixedPointPrimalXiDir;
562+
/*
563+
* Hessian oracle with respect to fixed point residual x
564+
*/
565+
real_t *devVecFixedPointPrimalPsiDir;
537566
/*
538567
* pointer array to the device pointer of Hessian-direction in X
539568
*/
@@ -580,19 +609,33 @@ protected:
580609
* vector rho in the lbfgs-buffer rho_k = 1/(y_k*s_k)
581610
*/
582611
real_t *lbfgsBufferRho;
583-
612+
/*
613+
* current col of the lbfgs buffer
614+
*/
584615
uint_t lbfgsBufferCol;
585-
616+
/*
617+
* memory of the lbfgs buffer
618+
*/
586619
uint_t lbfgsBufferMemory;
587-
620+
/*
621+
* skip count of the lbfgs buffer
622+
*/
588623
uint_t lbfgsSkipCount;
589-
624+
/*
625+
* inverse Hessian with the lbfgs
626+
*/
590627
real_t lbfgsBufferHessian;
591-
628+
/*
629+
* value of the proximal function of g with state box
630+
*/
592631
real_t valueFunGxBox;
593-
632+
/*
633+
* value of the proximal function of g with state safe volume
634+
*/
594635
real_t valueFunGxSafe;
595-
636+
/*
637+
* value of the proximal function of g with control box
638+
*/
596639
real_t valueFunGuBox;
597640

598641
/**

src/main.cu

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ int main(void){
2121
//Testing *otherTesting = new Testing();
2222
//_ASSERT( otherTesting->testSmpcFbeController() );
2323
_ASSERT( myTesting->testSmpcFbeController() );
24+
_ASSERT( myTesting->testSmpcNamaController() );
2425
//myTesting->testNewEngineTesting();
2526
}else{
2627
startTicToc();

0 commit comments

Comments
 (0)