Skip to content

1888/derive multivector - #2068

Open
MarcelKoch wants to merge 10 commits into
1888/multivectorfrom
1888/derive-multivector
Open

1888/derive multivector#2068
MarcelKoch wants to merge 10 commits into
1888/multivectorfrom
1888/derive-multivector

Conversation

@MarcelKoch

Copy link
Copy Markdown
Member

This PR derives the Dense (here MultiVector) class from the AbstractMultiVector interface.

@MarcelKoch MarcelKoch added this to the Ginkgo 2.0 milestone Aug 17, 2026
@MarcelKoch MarcelKoch self-assigned this Aug 17, 2026
@MarcelKoch MarcelKoch mentioned this pull request Aug 17, 2026
9 tasks
@ginkgo-bot ginkgo-bot added reg:testing This is related to testing. mod:core This is related to the core module. type:matrix-format This is related to the Matrix formats labels Aug 17, 2026
@MarcelKoch
MarcelKoch force-pushed the 1888/derive-multivector branch from 2efa831 to f284722 Compare August 18, 2026 14:37
@MarcelKoch
MarcelKoch force-pushed the 1888/derive-multivector branch from f284722 to 152f952 Compare August 18, 2026 14:57
@MarcelKoch
MarcelKoch force-pushed the 1888/derive-multivector branch from 152f952 to 449b684 Compare August 19, 2026 12:38
@MarcelKoch
MarcelKoch force-pushed the 1888/derive-multivector branch from 449b684 to bfbe9df Compare August 19, 2026 12:56
Comment on lines -105 to +103
using value_type = ValueType;
using value_type = typename EnableMultiVector<MultiVector>::value_type;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is any reason to use this way?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency. EnableMultiVector already defines value_type, so we should (need) to use the same here.

Comment on lines +175 to +177
std::unique_ptr<MultiVector> transpose() const;

std::unique_ptr<LinOp> conj_transpose() const override;
std::unique_ptr<MultiVector> conj_transpose() const;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should multivector have transpose? or rather calling from dense matrix?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm open to removing it. I have no strong opinion for it to stay.

Comment on lines +1200 to +1207
} else if constexpr (is_complex<ValueType>() &&
std::is_same_v<to_complex<OtherValueType>,
ValueType>) {
// The value type of this is complex and the other value type is the
// corresponding real value type (std::complex<double> vs double).
// This conversion is allowed, since the real view of this can be used
return temporary_conversion<MultiVector<OtherValueType>>::create(
this->create_real_view());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if only check is_complex<ValueType>, it will allow mixedComplex version again?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will check again if it works. I remember that it didn't the last time I tried. (Because the target for the copy-back step wouldn't be alive anymore.)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1:ST:ready-for-review This PR is ready for review 1:ST:skip-full-test mod:core This is related to the core module. reg:testing This is related to testing. type:matrix-format This is related to the Matrix formats

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants