mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-22 13:15:12 +00:00
Fix typos in documentation (#1635)
* Always capitalize Eigen * Fix spelling
This commit is contained in:
parent
21bf16f5b8
commit
09330b94ea
@ -37,7 +37,7 @@ that maps into the source ``numpy.ndarray`` data: this requires both that the
|
|||||||
data types are the same (e.g. ``dtype='float64'`` and ``MatrixType::Scalar`` is
|
data types are the same (e.g. ``dtype='float64'`` and ``MatrixType::Scalar`` is
|
||||||
``double``); and that the storage is layout compatible. The latter limitation
|
``double``); and that the storage is layout compatible. The latter limitation
|
||||||
is discussed in detail in the section below, and requires careful
|
is discussed in detail in the section below, and requires careful
|
||||||
consideration: by default, numpy matrices and eigen matrices are *not* storage
|
consideration: by default, numpy matrices and Eigen matrices are *not* storage
|
||||||
compatible.
|
compatible.
|
||||||
|
|
||||||
If the numpy matrix cannot be used as is (either because its types differ, e.g.
|
If the numpy matrix cannot be used as is (either because its types differ, e.g.
|
||||||
@ -226,7 +226,7 @@ order.
|
|||||||
Failing rather than copying
|
Failing rather than copying
|
||||||
===========================
|
===========================
|
||||||
|
|
||||||
The default behaviour when binding ``Eigen::Ref<const MatrixType>`` eigen
|
The default behaviour when binding ``Eigen::Ref<const MatrixType>`` Eigen
|
||||||
references is to copy matrix values when passed a numpy array that does not
|
references is to copy matrix values when passed a numpy array that does not
|
||||||
conform to the element type of ``MatrixType`` or does not have a compatible
|
conform to the element type of ``MatrixType`` or does not have a compatible
|
||||||
stride layout. If you want to explicitly avoid copying in such a case, you
|
stride layout. If you want to explicitly avoid copying in such a case, you
|
||||||
@ -289,13 +289,13 @@ will be passed as such a column vector. If not, but the Eigen type constraints
|
|||||||
will accept a row vector, it will be passed as a row vector. (The column
|
will accept a row vector, it will be passed as a row vector. (The column
|
||||||
vector takes precedence when both are supported, for example, when passing a
|
vector takes precedence when both are supported, for example, when passing a
|
||||||
1D numpy array to a MatrixXd argument). Note that the type need not be
|
1D numpy array to a MatrixXd argument). Note that the type need not be
|
||||||
expicitly a vector: it is permitted to pass a 1D numpy array of size 5 to an
|
explicitly a vector: it is permitted to pass a 1D numpy array of size 5 to an
|
||||||
Eigen ``Matrix<double, Dynamic, 5>``: you would end up with a 1x5 Eigen matrix.
|
Eigen ``Matrix<double, Dynamic, 5>``: you would end up with a 1x5 Eigen matrix.
|
||||||
Passing the same to an ``Eigen::MatrixXd`` would result in a 5x1 Eigen matrix.
|
Passing the same to an ``Eigen::MatrixXd`` would result in a 5x1 Eigen matrix.
|
||||||
|
|
||||||
When returning an eigen vector to numpy, the conversion is ambiguous: a row
|
When returning an Eigen vector to numpy, the conversion is ambiguous: a row
|
||||||
vector of length 4 could be returned as either a 1D array of length 4, or as a
|
vector of length 4 could be returned as either a 1D array of length 4, or as a
|
||||||
2D array of size 1x4. When encoutering such a situation, pybind11 compromises
|
2D array of size 1x4. When encountering such a situation, pybind11 compromises
|
||||||
by considering the returned Eigen type: if it is a compile-time vector--that
|
by considering the returned Eigen type: if it is a compile-time vector--that
|
||||||
is, the type has either the number of rows or columns set to 1 at compile
|
is, the type has either the number of rows or columns set to 1 at compile
|
||||||
time--pybind11 converts to a 1D numpy array when returning the value. For
|
time--pybind11 converts to a 1D numpy array when returning the value. For
|
||||||
|
Loading…
Reference in New Issue
Block a user