Skip to content

499 Clean up get_view interface#56

Merged
14 commits merged into
303-develop-reference_dense-backendfrom
499-get_view-uses-directly-amffactory-outside-of-matrix-vector-constructors
Aug 19, 2022
Merged

499 Clean up get_view interface#56
14 commits merged into
303-develop-reference_dense-backendfrom
499-get_view-uses-directly-amffactory-outside-of-matrix-vector-constructors

Conversation

@ghost

@ghost ghost commented Aug 18, 2022

Copy link
Copy Markdown

Move all AMFFactory invokations to Matrix constructors
Add type trait that defines new container types with a possibility to modify a single template parameter.
Add vector view type used for gather view on a matrix when one dimension is of size 1 (returning a vector)
Remove redundant get_view implementations

Move all AMFFactory invokations to Matrix constructors
Add type trait that defines new container types with a possibility to modify a single template parameter.
Add vector view type used for gather view on a matrix when one dimension is of size 1 (returning a vector)
Remove redundant get_view implementations
@ghost
ghost requested a review from hidanielesgit August 18, 2022 14:50
Comment thread include/alp/reference/matrix.hpp Outdated
) {}

/**
* Constructor for a view over another storage-based matrix.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Should we mark this constructor type as deprecated for now? If it becomes unused over time than we could proceed dropping it. (Comment valid also for other structures)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

We did indeed talk about making it deprecated when it was just delegated to the constructor with IMFs. But then we found another use for it - to make the reshaping views.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Perhaps we are talking about two different constructors :) I was referring to the AMF-based one below (the first comment line in the code was as close as I could get to the constructor in review). Is this also the one you are referring to?

Comment thread include/alp/reference/matrix.hpp Outdated
Comment thread include/alp/reference/matrix.hpp Outdated
Comment thread include/alp/reference/matrix.hpp Outdated
Comment thread include/alp/reference/matrix.hpp Outdated
base_type( source_vector ) {}

/**
* Constructor for a view over another storage-based vector.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

deprecated?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Same answer as for matrix

>
Vector( TargetType &target_vector, ImfR imf_r, ImfC imf_c ) :
Vector( SourceType &target_vector, ImfR imf_r, ImfC imf_c ) :
base_type( getFunctor( target_vector ), imf_r, imf_c ) {}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Does Matrix have such constructor?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I suggest to address this during the clean-up of views on functor-based containers.

>
Vector( TargetType &target_vector ) :
Vector( SourceType &target_vector ) :
base_type( getFunctor( target_vector ),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Does Matrix have such constructor?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Same answer as above

Comment thread include/alp/views.hpp Outdated

static constexpr Views type_id = Views::gather;

static std::pair< size_t, size_t > dims( std::pair< size_t, size_t > dims_pair ) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think we can drop this as it is no longer required by the AMF-based infrastructure.

Vladimir Dimic added 3 commits August 19, 2022 13:51
@ghost
ghost requested a review from hidanielesgit August 19, 2022 12:03
Comment thread include/alp/reference/matrix.hpp Outdated

template < bool d >
struct view_type< view::gather, d > {
// View -> view::Gather< self_type > ?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

In what sense? Same comment appears in other specializations.

) {}

/**
* Constructor for a view over another storage-based matrix.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Perhaps we are talking about two different constructors :) I was referring to the AMF-based one below (the first comment line in the code was as close as I could get to the constructor in review). Is this also the one you are referring to?

@ghost
ghost merged commit bfe20e4 into 303-develop-reference_dense-backend Aug 19, 2022
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant