aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2015-06-16 19:46:23 -0700
committerGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2015-06-16 19:46:23 -0700
commitea160a898cdea65387827c8f24aa6c872f831625 (patch)
tree5966c00841e098fdb7df733129da2df83559b53a /unsupported/Eigen
parent367794e668fab068a9e35e1d915ef19f362f9d78 (diff)
parent736a805883a1e20c0a224a06b1ea5c1067c7a670 (diff)
Pulled latest updates from trunk
Diffstat (limited to 'unsupported/Eigen')
-rw-r--r--unsupported/Eigen/CXX11/src/Tensor/TensorConcatenation.h28
-rw-r--r--unsupported/Eigen/CXX11/src/Tensor/TensorImagePatch.h10
-rw-r--r--unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h20
-rw-r--r--unsupported/Eigen/CXX11/src/Tensor/TensorRef.h8
4 files changed, 41 insertions, 25 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorConcatenation.h b/unsupported/Eigen/CXX11/src/Tensor/TensorConcatenation.h
index 1a736ee2b..6979fb4ec 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorConcatenation.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorConcatenation.h
@@ -135,19 +135,21 @@ struct TensorEvaluator<const TensorConcatenationOp<Axis, LeftArgType, RightArgTy
eigen_assert(0 <= m_axis && m_axis < NumDims);
const Dimensions& lhs_dims = m_leftImpl.dimensions();
const Dimensions& rhs_dims = m_rightImpl.dimensions();
- int i = 0;
- for (; i < m_axis; ++i) {
- eigen_assert(lhs_dims[i] > 0);
- eigen_assert(lhs_dims[i] == rhs_dims[i]);
- m_dimensions[i] = lhs_dims[i];
- }
- eigen_assert(lhs_dims[i] > 0); // Now i == m_axis.
- eigen_assert(rhs_dims[i] > 0);
- m_dimensions[i] = lhs_dims[i] + rhs_dims[i];
- for (++i; i < NumDims; ++i) {
- eigen_assert(lhs_dims[i] > 0);
- eigen_assert(lhs_dims[i] == rhs_dims[i]);
- m_dimensions[i] = lhs_dims[i];
+ {
+ int i = 0;
+ for (; i < m_axis; ++i) {
+ eigen_assert(lhs_dims[i] > 0);
+ eigen_assert(lhs_dims[i] == rhs_dims[i]);
+ m_dimensions[i] = lhs_dims[i];
+ }
+ eigen_assert(lhs_dims[i] > 0); // Now i == m_axis.
+ eigen_assert(rhs_dims[i] > 0);
+ m_dimensions[i] = lhs_dims[i] + rhs_dims[i];
+ for (++i; i < NumDims; ++i) {
+ eigen_assert(lhs_dims[i] > 0);
+ eigen_assert(lhs_dims[i] == rhs_dims[i]);
+ m_dimensions[i] = lhs_dims[i];
+ }
}
if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) {
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorImagePatch.h b/unsupported/Eigen/CXX11/src/Tensor/TensorImagePatch.h
index a513f1891..313144846 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorImagePatch.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorImagePatch.h
@@ -142,15 +142,25 @@ struct TensorEvaluator<const TensorImagePatchOp<Rows, Cols, ArgType>, Device>
switch (op.padding_type()) {
case PADDING_VALID:
+<<<<<<< local
m_outputRows = std::ceil((m_inputRows - op.patch_rows() + 1.f) / static_cast<float>(m_row_strides));
m_outputCols = std::ceil((m_inputCols - op.patch_cols() + 1.f) / static_cast<float>(m_col_strides));
+=======
+ m_outputRows = numext::ceil((m_inputRows - op.patch_rows() + 1.f) / static_cast<float>(m_row_strides));
+ m_outputCols = numext::ceil((m_inputCols - op.patch_cols() + 1.f) / static_cast<float>(m_col_strides));
+>>>>>>> other
// Calculate the padding
m_rowPaddingTop = ((m_outputRows - 1) * m_row_strides + op.patch_rows() - m_inputRows) / 2;
m_colPaddingLeft = ((m_outputCols - 1) * m_col_strides + op.patch_cols() - m_inputCols) / 2;
break;
case PADDING_SAME:
+<<<<<<< local
m_outputRows = std::ceil(m_inputRows / static_cast<float>(m_row_strides));
m_outputCols = std::ceil(m_inputCols / static_cast<float>(m_col_strides));
+=======
+ m_outputRows = numext::ceil(m_inputRows / static_cast<float>(m_row_strides));
+ m_outputCols = numext::ceil(m_inputCols / static_cast<float>(m_col_strides));
+>>>>>>> other
// Calculate the padding
m_rowPaddingTop = ((m_outputRows - 1) * m_row_strides + op.patch_rows() - m_inputRows) / 2;
m_colPaddingLeft = ((m_outputCols - 1) * m_col_strides + op.patch_cols() - m_inputCols) / 2;
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h b/unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h
index 2a7dd45c0..5a165dab0 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h
@@ -185,11 +185,13 @@ struct TensorEvaluator<const TensorPaddingOp<PaddingDimensions, ArgType>, Device
{
Index inputIndex;
if (static_cast<int>(Layout) == static_cast<int>(ColMajor)) {
- const Index idx = coords[0];
- if (idx < m_padding[0].first || idx >= m_dimensions[0] - m_padding[0].second) {
- return Scalar(0);
+ {
+ const Index idx = coords[0];
+ if (idx < m_padding[0].first || idx >= m_dimensions[0] - m_padding[0].second) {
+ return Scalar(0);
+ }
+ inputIndex = idx - m_padding[0].first;
}
- inputIndex = idx - m_padding[0].first;
for (int i = 1; i < NumDims; ++i) {
const Index idx = coords[i];
if (idx < m_padding[i].first || idx >= m_dimensions[i] - m_padding[i].second) {
@@ -198,11 +200,13 @@ struct TensorEvaluator<const TensorPaddingOp<PaddingDimensions, ArgType>, Device
inputIndex += (idx - m_padding[i].first) * m_inputStrides[i];
}
} else {
- const Index idx = coords[NumDims-1];
- if (idx < m_padding[NumDims-1].first || idx >= m_dimensions[NumDims-1] - m_padding[NumDims-1].second) {
- return Scalar(0);
+ {
+ const Index idx = coords[NumDims-1];
+ if (idx < m_padding[NumDims-1].first || idx >= m_dimensions[NumDims-1] - m_padding[NumDims-1].second) {
+ return Scalar(0);
+ }
+ inputIndex = idx - m_padding[NumDims-1].first;
}
- inputIndex = idx - m_padding[NumDims-1].first;
for (int i = NumDims - 2; i >= 0; --i) {
const Index idx = coords[i];
if (idx < m_padding[i].first || idx >= m_dimensions[i] - m_padding[i].second) {
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorRef.h b/unsupported/Eigen/CXX11/src/Tensor/TensorRef.h
index fba7b20a9..6b25b2ba0 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorRef.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorRef.h
@@ -197,15 +197,15 @@ template<typename PlainObjectType> class TensorRef : public TensorBase<TensorRef
template<typename... IndexTypes> EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE const Scalar operator()(Index firstIndex, IndexTypes... otherIndices) const
{
- const std::size_t NumIndices = (sizeof...(otherIndices) + 1);
- const array<Index, NumIndices> indices{{firstIndex, otherIndices...}};
+ const std::size_t num_indices = (sizeof...(otherIndices) + 1);
+ const array<Index, num_indices> indices{{firstIndex, otherIndices...}};
return coeff(indices);
}
template<typename... IndexTypes> EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE Scalar& coeffRef(Index firstIndex, IndexTypes... otherIndices)
{
- const std::size_t NumIndices = (sizeof...(otherIndices) + 1);
- const array<Index, NumIndices> indices{{firstIndex, otherIndices...}};
+ const std::size_t num_indices = (sizeof...(otherIndices) + 1);
+ const array<Index, num_indices> indices{{firstIndex, otherIndices...}};
return coeffRef(indices);
}
#else