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>
16namespace py = pybind11;
30 using MatrixDimI = Eigen::Matrix<IntScalarType, dim, dim>;
95 typename std::enable_if<dm==2,PyLatticeDirection<dm>>::type
100 typename std::enable_if<dm==3,PyLatticeDirection<dm>>::type
117 using IntScalarType =
long long int;
118 using MatrixDimD = Eigen::Matrix<double, dim, dim>;
119 using VectorDimD = Eigen::Matrix<double, dim, 1>;
120 using VectorDimI = Eigen::Matrix<IntScalarType, dim, 1>;
121 using MatrixDimI = Eigen::Matrix<IntScalarType, dim, dim>;
124 py::class_<PyReciprocalLatticeVector>(m, (
"ReciprocalLatticeVector" + std::to_string(dim) +
"D").c_str())
125 .def(py::init<const Lattice &>())
126 .def(py::init<const VectorDimD&, const Lattice&>())
127 .def(py::init<const VectorDimI&, const Lattice&>())
128 .def(py::init<const PyReciprocalLatticeVector&>())
131 .def(py::self + py::self)
132 .def(py::self - py::self)
134 return self * scalar;
135 }, py::is_operator())
137 return scalar * self;
138 }, py::is_operator())
139 .def(py::self -= py::self)
140 .def(py::self += py::self)
143 .def(
"cross",&PyReciprocalLatticeVector::template cross<dim>);
IntScalarType dot(const LatticeVector< dim > &other) const
std::enable_if< dm==2, LatticeDirection< dim > >::type cross(const ReciprocalLatticeVector< dim > &other) const
IntScalarType closestPlaneIndexOfPoint(const VectorDimD &P) const
VectorDimD cartesian() const
IntScalarType planeIndexOfPoint(const VectorDimD &P) 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)
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
IntScalarType planeIndexOfPoint(const gbLAB::LatticeVector< dim > &p) const
PyReciprocalLatticeVector(const Lattice &lattice)
void bind_ReciprocalLatticeVector(py::module_ &m)
PyLatticeVector< dim > operator*(const long long int &scalar, const PyLatticeVector< dim > &L)