#include "analytical.h"

#include "base/lattice.h"

namespace tbplas::builder {

AnalyticalModel::AnalyticalModel(
    orbital_index_t num_orb,
    orbital_index_t num_hop,
    const Eigen::Matrix3d& lattice)
    : num_orb_(num_orb)
    , num_hop_(num_hop)
    , lattice_(lattice)
    , reciprocal_lattice_(base::gen_reciprocal_vectors(lattice))
{
}

orbital_index_t AnalyticalModel::get_num_orbitals() const
{
    return num_orb_;
}

orbital_index_t AnalyticalModel::get_num_hopping() const
{
    return num_hop_;
}

const Eigen::Matrix3d& AnalyticalModel::get_lattice() const
{
    return lattice_;
}

double AnalyticalModel::get_lattice_area(const std::string& direction) const
{
    return base::get_lattice_area(lattice_, direction);
}

double AnalyticalModel::get_lattice_volume() const
{
    return base::get_lattice_volume(lattice_);
}

const Eigen::Matrix3d& AnalyticalModel::get_reciprocal_lattice() const
{
    return reciprocal_lattice_;
}

void AnalyticalModel::build_ham_dr_coo(
    std::vector<orbital_index_t>& hop_i,
    std::vector<orbital_index_t>& hop_j,
    std::vector<complex_t>& hop_v,
    Eigen::Matrix3Xd& dr_nm) const
{
    std::cerr << "ERROR: AnalyticalModel::build_ham_dr_coo not implemented!" << std::endl;
    std::exit(-1);
}

void AnalyticalModel::build_ham_curr_csr(
    std::vector<orbital_index_t>& indptr,
    std::vector<orbital_index_t>& indices,
    Eigen::VectorXcd& ham,
    Eigen::VectorXcd& curr_coeff_x,
    Eigen::VectorXcd& curr_coeff_y) const
{
    std::cerr << "ERROR: AnalyticalModel::build_ham_curr_csr not implemented!" << std::endl;
    std::exit(-1);
}

void AnalyticalModel::build_ham_dense(
    const Eigen::Vector3d& k_point,
    Eigen::MatrixXcd& ham,
    int convention) const
{
    std::cerr << "ERROR: AnalyticalModel::build_ham_dense not implemented!" << std::endl;
    std::exit(-1);
}

void AnalyticalModel::build_density_coeff(
    const Eigen::Vector3d& q_point,
    Eigen::VectorXcd& coeff_q,
    Eigen::VectorXcd& coeff_mq) const
{
    std::cerr << "ERROR: AnalyticalModel::build_density_coeff not implemented!" << std::endl;
    std::exit(-1);
}

void AnalyticalModel::build_ham_der_dense(
    const Eigen::Vector3d& k_point,
    Eigen::MatrixXcd& dh_dka,
    Eigen::MatrixXcd& dh_dkb,
    Eigen::MatrixXcd& dh_dkc,
    int convention) const
{
    std::cerr << "ERROR: AnalyticalModel::build_ham_der_dense not implemented!" << std::endl;
    std::exit(-1);
}
} // namespace tbplas::builder
