Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
be115c0
Change signature of MatrixFunctor class
Jun 7, 2022
54e6d04
Declare imfs and lambda as constant class members in MatrixFunctor
Jun 7, 2022
93d7c4c
Order MatrixFunctor constructor parameters consistently with MatrixCo…
Jun 8, 2022
b453a17
Expose lambda type in the functor matrix
Jun 8, 2022
d7e5efe
Create Identity matrix as a MatrixFunctor
Jun 8, 2022
6d8e2e0
Minor fixes
Jun 8, 2022
ce83c74
Enable compilation of constant matrix unit test
Jun 8, 2022
bff740c
Adapt the constant matrix unit test to the current repo state
Jun 8, 2022
70b8aa8
Make MatrixBase a friend of MatrixFunctor so it can call its methods
Jun 9, 2022
982d168
Restore identity matrix implementatin to use std::function instead of…
Jun 9, 2022
b12ca44
Remove obsolete code and comments
Jun 9, 2022
1db87f4
Generalize MatrixFunctor for constant matrices
Jun 9, 2022
a786632
Adapt Zero matrix factory method to the current interface
Jun 9, 2022
41d03bc
Enable set/getInitialized in reference/matrix.hpp only for ALP matrices
Jun 10, 2022
0fc0e39
Make Matrix conditionally inherit from Container of Functor
Jun 10, 2022
ed3cfcb
Adapt Functor Matrix constructor calls to the new interface
Jun 10, 2022
3ece1e5
Fix the implementation of getInitialized for ALP vector
Jun 10, 2022
6916fea
Expose certain type definitions within ALP vector
Jun 10, 2022
5f57e73
Fix rebase mistake
Jun 15, 2022
162422a
Use view type traits to differentiate between different internal ALP …
Jun 15, 2022
27c1a83
Properly name the static property indicating whether a container allo…
Jun 15, 2022
b25b6a3
Add type traits to check the underlying nature of an ALP container
Jun 17, 2022
2792eb5
Add const reference getter to a functor object of a functor-based matrix
Jun 20, 2022
2c2bdbc
Improve the SFINAE conditions for storage-based matrix containers
Jun 21, 2022
8262f45
Add matrix constructors for functor and view based matrices.
Jun 21, 2022
265b655
Update doxygen to reflect the SINAFE mechanism changes
Jun 21, 2022
4dbeca3
Add missing parameters to getStorageIndex in reference vector
Jun 21, 2022
1669b19
Re-enable dense outer unit test
Jun 21, 2022
86dab6f
Update other matrix specializations with the new constructor selectio…
Jun 21, 2022
3d98291
Remove obsolete speciaization for constant matrices
Jun 21, 2022
e81c023
Code review fix: add Vector functor constructors
Jun 23, 2022
e02b966
Code review fix: Correct the return type of getFunctor forward declar…
Jun 23, 2022
72f278b
Remove unnecessary reference to size_t lambda function parameters
Jun 23, 2022
618f139
Fix dims relatd issues in matrix base classes
Jun 23, 2022
ead034a
Correct the base type property of matrix
Jun 23, 2022
537e5bc
Correct type in static_cast in get/setInitialized for vectors
Jun 23, 2022
4d13ba6
Add a temporary version of buildVector
Jun 23, 2022
5d11e7f
Update dense_outer test
Jun 23, 2022
a2357fd
Change the way lambda function is used in functor-based matrices
Jun 24, 2022
f66a242
Use consistent SFINAE enable_ifs
Jun 24, 2022
b8db487
Fix the base type of various matrix specializations
Jun 24, 2022
6aa1ad3
Add correctness check in the dense outer product unit test
Jun 24, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions include/alp/reference/blas3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1130,7 +1130,7 @@ namespace alp {
class Operator
>
Matrix< typename Operator::D3, structures::General, Density::Dense,
view::Functor< std::function< void( InputType1 &, const size_t &, const size_t & ) > >,
view::Functor< std::function< void( InputType1 &, const size_t, const size_t ) > >,
imf::Id, imf::Id,
reference
>
Expand All @@ -1151,8 +1151,8 @@ namespace alp {
"called with a postfactor vector that does not match the first domain "
"of the given multiplication operator" );

std::function< void( typename Operator::D3 &, const size_t &, const size_t & ) > lambda =
[ &x, &y, &mul ]( typename Operator::D3 &result, const size_t &i, const size_t &j ) {
std::function< void( typename Operator::D3 &, const size_t, const size_t ) > lambda =
[ &x, &y, &mul ]( typename Operator::D3 &result, const size_t i, const size_t j ) {
//set( ret, alp::identities::zero );
internal::apply( result, x[ i ], y[ j ], mul );
};
Expand All @@ -1161,14 +1161,14 @@ namespace alp {
typename Operator::D3,
structures::General,
Density::Dense,
view::Functor< std::function< void( typename Operator::D3 &, const size_t &, const size_t & ) > >,
view::Functor< std::function< void( typename Operator::D3 &, const size_t, const size_t ) > >,
imf::Id, imf::Id,
reference
>(
internal::getInitialized( x ) && internal::getInitialized( y ), // Temporary solution, pending proper implemention
lambda,
imf::Id( getLength( x ) ),
imf::Id( getLength( y ) )
getLength( x ),
getLength( y ),
lambda
);

}
Expand All @@ -1183,7 +1183,7 @@ namespace alp {
class Operator
>
Matrix< typename Operator::D3, structures::Symmetric, Density::Dense,
view::Functor< std::function< void( typename Operator::D3 &, const size_t &, const size_t & ) > >,
view::Functor< std::function< void( typename Operator::D3 &, const size_t, const size_t ) > >,
imf::Id, imf::Id,
reference
>
Expand All @@ -1202,8 +1202,8 @@ namespace alp {
"called with a prefactor vector that does not match the first domain "
"of the given multiplication operator" );

std::function< void( typename Operator::D3 &, const size_t &, const size_t & ) > lambda =
[ &x, &mul ]( typename Operator::D3 &result, const size_t &i, const size_t &j ) {
std::function< void( typename Operator::D3 &, const size_t, const size_t ) > lambda =
[ &x, &mul ]( typename Operator::D3 &result, const size_t i, const size_t j ) {
//set( ret, alp::identities::zero );
internal::apply( result, x[ i ], x[ j ], mul );
};
Expand All @@ -1212,13 +1212,13 @@ namespace alp {
typename Operator::D3,
structures::Symmetric,
Density::Dense,
view::Functor< std::function< void( typename Operator::D3 &, const size_t &, const size_t & ) > >,
view::Functor< std::function< void( typename Operator::D3 &, const size_t, const size_t ) > >,
imf::Id, imf::Id,
reference
>(
internal::getInitialized( x ),
lambda,
imf::Id( getLength( x ) )
getLength( x ),
lambda
);

}
Expand Down
26 changes: 26 additions & 0 deletions include/alp/reference/io.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,32 @@ namespace alp {
return PANIC;
}

/**
* @brief \a buildVector version.
*
*/
template< typename InputType, typename Structure, typename View, typename Imf, typename fwd_iterator >
RC buildVector(
Vector< InputType, Structure, Density::Dense, View, Imf, reference > &v,
const fwd_iterator &start,
const fwd_iterator &end
) noexcept {

// Temporarily assuming 1-1 mapping with user container
internal::setInitialized(v, true);

InputType * praw, * p;

size_t len = internal::getLength( internal::getContainer( v ) );
praw = p = internal::getRaw( internal::getContainer( v ) );

for( fwd_iterator it = start; p < praw + len && it != end; ++it, ++p ) {
*p = *it;
}

return PANIC;
}

} // end namespace ``alp''

#endif // end ``_H_ALP_REFERENCE_IO''
Expand Down
Loading