Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
eigen
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
What's new
5
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sergiu Deitsch
eigen
Commits
171bd08c
There was an error fetching the commit references. Please try again later.
Commit
171bd08c
authored
2 months ago
by
Charles Schlosser
Committed by
Rasmus Munk Larsen
2 months ago
Browse files
Options
Downloads
Patches
Plain Diff
fix 2849
parent
db85838e
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Eigen/src/Core/VectorwiseOp.h
+5
-6
5 additions, 6 deletions
Eigen/src/Core/VectorwiseOp.h
test/vectorwiseop.cpp
+12
-0
12 additions, 0 deletions
test/vectorwiseop.cpp
with
17 additions
and
6 deletions
Eigen/src/Core/VectorwiseOp.h
+
5
−
6
View file @
171bd08c
...
...
@@ -603,9 +603,8 @@ class VectorwiseOp {
/** Returns the expression where each subvector is the product of the vector \a other
* by the corresponding subvector of \c *this */
template
<
typename
OtherDerived
>
EIGEN_STRONG_INLINE
EIGEN_DEVICE_FUNC
CwiseBinaryOp
<
internal
::
scalar_product_op
<
Scalar
>
,
const
ExpressionTypeNestedCleaned
,
const
typename
ExtendedType
<
OtherDerived
>::
Type
>
EIGEN_DEVICE_FUNC
EIGEN_DEVICE_FUNC
CwiseBinaryOp
<
internal
::
scalar_product_op
<
Scalar
,
typename
OtherDerived
::
Scalar
>
,
const
ExpressionTypeNestedCleaned
,
const
typename
ExtendedType
<
OtherDerived
>::
Type
>
operator
*
(
const
DenseBase
<
OtherDerived
>&
other
)
const
{
EIGEN_STATIC_ASSERT_VECTOR_ONLY
(
OtherDerived
)
EIGEN_STATIC_ASSERT_ARRAYXPR
(
ExpressionType
)
...
...
@@ -616,8 +615,8 @@ class VectorwiseOp {
/** Returns the expression where each subvector is the quotient of the corresponding
* subvector of \c *this by the vector \a other */
template
<
typename
OtherDerived
>
EIGEN_DEVICE_FUNC
CwiseBinaryOp
<
internal
::
scalar_quotient_op
<
Scalar
>
,
const
ExpressionTypeNestedCleaned
,
const
typename
ExtendedType
<
OtherDerived
>::
Type
>
EIGEN_DEVICE_FUNC
CwiseBinaryOp
<
internal
::
scalar_quotient_op
<
Scalar
,
typename
OtherDerived
::
Scalar
>
,
const
ExpressionTypeNestedCleaned
,
const
typename
ExtendedType
<
OtherDerived
>::
Type
>
operator
/
(
const
DenseBase
<
OtherDerived
>&
other
)
const
{
EIGEN_STATIC_ASSERT_VECTOR_ONLY
(
OtherDerived
)
EIGEN_STATIC_ASSERT_ARRAYXPR
(
ExpressionType
)
...
...
This diff is collapsed.
Click to expand it.
test/vectorwiseop.cpp
+
12
−
0
View file @
171bd08c
...
...
@@ -214,6 +214,17 @@ void vectorwiseop_matrix(const MatrixType& m) {
VERIFY_IS_EQUAL
(
m1
.
real
().
middleCols
(
0
,
fix
<
0
>
).
colwise
().
maxCoeff
().
eval
().
cols
(),
0
);
}
void
vectorwiseop_mixedscalar
()
{
Matrix4cd
a
=
Matrix4cd
::
Random
();
Vector4cd
b
=
Vector4cd
::
Random
();
b
.
imag
().
setZero
();
Vector4d
b_real
=
b
.
real
();
Matrix4cd
c
=
a
.
array
().
rowwise
()
*
b
.
array
().
transpose
();
Matrix4cd
d
=
a
.
array
().
rowwise
()
*
b_real
.
array
().
transpose
();
VERIFY_IS_CWISE_EQUAL
(
c
,
d
);
}
EIGEN_DECLARE_TEST
(
vectorwiseop
)
{
CALL_SUBTEST_1
(
vectorwiseop_array
(
Array22cd
()));
CALL_SUBTEST_2
(
vectorwiseop_array
(
Array
<
double
,
3
,
2
>
()));
...
...
@@ -226,4 +237,5 @@ EIGEN_DECLARE_TEST(vectorwiseop) {
MatrixXd
(
internal
::
random
<
int
>
(
1
,
EIGEN_TEST_MAX_SIZE
),
internal
::
random
<
int
>
(
1
,
EIGEN_TEST_MAX_SIZE
))));
CALL_SUBTEST_7
(
vectorwiseop_matrix
(
VectorXd
(
internal
::
random
<
int
>
(
1
,
EIGEN_TEST_MAX_SIZE
))));
CALL_SUBTEST_7
(
vectorwiseop_matrix
(
RowVectorXd
(
internal
::
random
<
int
>
(
1
,
EIGEN_TEST_MAX_SIZE
))));
CALL_SUBTEST_8
(
vectorwiseop_mixedscalar
());
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment