#ifndef LSHOPTIMIZER_H
#define LSHOPTIMIZER_H

#include "SETTINGS.h"

struct adamParams
{
    double stepSize = 0.001;
    double bet1 = 0.9;
    double bet2 = 0.999;
    double eps = 1e-8;
};

VECTOR lshsToParam(const std::vector<superHelix>& lshs);

void updateLSHsState(std::vector<superHelix>& lshs, const VECTOR& newState);

VECTOR adamOptimizeLSHChainEnd(adamParams aP, const std::vector<superHelix>& lshs, const VEC3& p0, const MATRIX3& F0, const VEC3& targetEnd,
                               bool debug = false, double kSpring = 100);

VECTOR adamOptimizeLSHChainEndHotStart(adamParams aP, const std::vector<superHelix>& lshs, const VEC3& p0, const MATRIX3& F0, const VEC3& targetEnd,
                               const VECTOR& hotStart,
                               bool debug = false, double kSpring = 100);

VECTOR adamOptimizeLSHChainGeneral(adamParams aP, const std::vector<superHelix> & lshs, const VEC3& p0, const MATRIX3& F0, const std::vector<double> sAs, const std::vector<VEC3>& targetEnds, 
                                   bool debug = false, double kSpring = 100);

#endif