5#ifndef OILAB_RECIPROCALLATTICEVECTORBINDINGS_H
6#define OILAB_RECIPROCALLATTICEVECTORBINDINGS_H
8#include <pybind11/pybind11.h>
9#include <pybind11/operators.h>
10#include <pybind11/numpy.h>
11#include <pybind11/eigen.h>
13#include "../Lattices/LatticeModule.h"
16namespace py = pybind11;
30 using MatrixDimI = Eigen::Matrix<IntScalarType, dim, dim>;
96 typename std::enable_if<dm==2,PyLatticeDirection<dm>>::type
101 typename std::enable_if<dm==3,PyLatticeDirection<dm>>::type
118 using IntScalarType =
long long int;
119 using MatrixDimD = Eigen::Matrix<double, dim, dim>;
120 using VectorDimD = Eigen::Matrix<double, dim, 1>;
121 using VectorDimI = Eigen::Matrix<IntScalarType, dim, 1>;
122 using MatrixDimI = Eigen::Matrix<IntScalarType, dim, dim>;
125 py::class_<PyReciprocalLatticeVector>(
126 m, (
"ReciprocalLatticeVector" + std::to_string(dim) +
"D").c_str())
127 .def(py::init<const Lattice &>())
128 .def(py::init<const VectorDimD &, const Lattice &>())
129 .def(py::init<const VectorDimI &, const Lattice &>())
130 .def(py::init<const PyReciprocalLatticeVector &>())
132 .def(
"integerCoordinates",
134 .def(py::self + py::self)
135 .def(py::self - py::self)
139 const IntScalarType &scalar) {
return self * scalar; },
144 const IntScalarType &scalar) {
return scalar * self; },
146 .def(py::self -= py::self)
147 .def(py::self += py::self)
150 .def(
"cross", &PyReciprocalLatticeVector::template cross<dim>);
IntScalarType closestPlaneIndexOfPoint(const VectorDimD &P) const
IntScalarType dot(const LatticeVector< dim > &other) const
VectorDimD cartesian() const
IntScalarType planeIndexOfPoint(const VectorDimD &P) const
std::enable_if< dm==2, LatticeDirection< dim > >::type cross(const ReciprocalLatticeVector< dim > &other) const
VectorDimD cartesian() const
PyReciprocalLatticeVector operator+(const PyReciprocalLatticeVector &other) const
IntScalarType closestPlaneIndexOfPoint(const VectorDimD &p) const
ReciprocalLatticeVector rlv
PyReciprocalLatticeVector operator+=(const PyReciprocalLatticeVector &other)
IntScalarType dot(const PyLatticeVector< dim > &other) const
PyReciprocalLatticeVector operator-=(const PyReciprocalLatticeVector &other)
Eigen::Matrix< double, dim, 1 > VectorDimD
std::enable_if< dm==2, PyLatticeDirection< dm > >::type cross(const PyReciprocalLatticeVector< dm > &other)
PyReciprocalLatticeVector(const PyReciprocalLatticeVector &)=default
std::enable_if< dm==3, PyLatticeDirection< dm > >::type cross(const PyReciprocalLatticeVector< dm > &other)
PyReciprocalLatticeVector(const ReciprocalLatticeVector &rlv)
PyReciprocalLatticeVector operator*(const IntScalarType &scalar) const
PyReciprocalLatticeVector(const VectorDimI &integerCoordinates, const Lattice &lattice)
IntScalarType planeIndexOfPoint(const VectorDimD &p)
IntScalarType planeIndexOfPoint(const oILAB::LatticeVector< dim > &p) const
VectorDimI integerCoordinates() const
Eigen::Matrix< IntScalarType, dim, 1 > VectorDimI
PyReciprocalLatticeVector operator-(const PyReciprocalLatticeVector &other) const
PyReciprocalLatticeVector(const VectorDimD &cartesianCoordinates, const Lattice &lattice)
Eigen::Matrix< IntScalarType, dim, dim > MatrixDimI
long long int IntScalarType
Eigen::Matrix< double, dim, dim > MatrixDimD
PyReciprocalLatticeVector(const Lattice &lattice)
void bind_ReciprocalLatticeVector(py::module_ &m)
PyLatticeVector< dim > operator*(const long long int &scalar, const PyLatticeVector< dim > &L)