Skip to content

Commit

Permalink
R7z (#76)
Browse files Browse the repository at this point in the history
* Begin adding tests for non-owning view engines

* wip

* Make negation a view full-time, and remove option for it to be traits type

* WIP on the way to updating full functionality for views; mostly, figured out how to make correctly nest mdspan accessor policies

* WIP

* WIP

* Working on D7

* wip

* wip

* wip

* wip

* Adjust CI build

* Update conan test project build

* wip

* wip

* Update CMake file for tests to include /permissive- flag for MSVC; apparently necessary when using concepts

* Update CMake file for conan test package tests to include /permissive- flag for MSVC

* Remove XCode/AppleClang for now, as it does not support concepts

* Configure Clang 10 to build using its own libc++

* Configure Clang 10 to build using its own libc++

* wip

* wip

* wip

* wip

* wip

* Refining private members

* wip -- refining matrix_storage engine and adding test cases

* Continuing to add engine unit tests

* Continue unit test work

* Continue unit test work

* First version of mse unit tests done; builds and runs with all compilers

* Expansion of mse_data<T,X,A,L> for matrix types complete; commit prior to switchover in matrix_storage_engine

* Initial switchover to expanded mse_data in matrix_storage_engine complete and unit tests pass

* Switchover to expanded mse_data in matrix_storage_engine for vector engines

* Refactor out unnecessary members of mse_data

* Work on cleaning up mdspan interfaces

* Update engine-relatednconcept definitions

* Clean up and commenting

* Put mse_data into its own header; continued clean-up; added comments

* Add basic_matrix.hpp header

* Add basic_matrix<ET, OT> and start filling it in

* Continue filling in basic_matrix<ET, OT> and refactoring supporting concepts and traits

* Fix general-case assignment to account for resizing

* Continue adding to engine_support

* Fix return type

* Commit prior to possible mse_support refactor

* Making progress toward refactor

* More progress

* Even more progress

* First rev vector_engine_support working; mse_support removed

* Concept cleanup - 1 of N

* Concept cleanup - 2 of N

* Concept cleanup - 3 of N

* Concept cleanup - 4 of N

* Concept cleanup - 5 of N

* Concept cleanup - 6 of N

* Concept cleanup - 7 of N

* Concept cleanup - 8 of N

* Add basic_vector to the mix

* More work on basic_vector

* Concept cleanup - 9 of N

* Convert all element traits to 3-parameter form

* Add static op traits validation/extraction tests for addition

* Remove GCC 9 from the Travis builds

* Update README to reflect current compiler requirements

* Remove unsupported compilers from the Travis builds

* Remove support for GCC-9's version of concepts

* Convert op traits - 1 of N

* Convert op traits - 2 of N

* Convert op traits - 3 of N - first pass at addition

* Try to fix test_package link error with Clang

* Try to fix test_package link error with Clang

* The big clean-up - part 1 of N

* The big clean-up - part 2 of N

* Start adding views back into the mix - part 1 of N

* wip

* More work on view support; add transpose, submatrix, row, column

* wip

* wip

* wip - cleanup storage engine; begin implementing mdspan support for views

* First pass at mdspan support for matrix views

* Add initial support for negation and subvector views into basic_vector

* BIG cleanup - obsolete files deleted and project adjusted accordingly

* remove experimental tests

* Consolidate operation traits and support into one header

* Add VS/VC++ version warning

* Fix small issues

* Remove support_traits.hpp from project

* Concept cleanup and re-factor

* Remove unoriented tag for vector storage engines, use void instead; move row_major and column major tag into matrix_layout struct

* Fix comments related to layout tags

* Convert second template parameter from 'operation traits' to 'customized operation traits'

* Add support for conjugate view

* Minor view updates

* Fix typo; remove subset tag

* Continue work on views; add identity view; add operation customization traits injection via basic_matrix::adopt

* Clean-up; trying to get back into it

* More work on addition traits and general cleanup

* Some small progress on compile-time extent determination

* Some progress on new addition engine traits

* more (small) progress

* Update P1385D7.md

Work on header synopsis for Nov-20 mailing.

* Complete synoptic replacement for concept based design

* Updates to  synopsis (wip)

* Some more updates

* Updated template parameter nomenclature

* Added matrix_storage_engine definitions

* Added matrix_view_engine definitions

Note that the vector view engines templated over const_negation and const_conjugate are partial specialisations that aren't explicitly defined by any means other than an implementation defined requires clause.

* Added justification text for arithmetic customisation and vector-vector multiplication via operator*

* wip: engine traits improvements

* WIP: major refactor to matrix-only approach -- first commit

* WIP: major refactor to matrix-only approach -- second commit

* WIP: update for V

* WIP: Removing all vestiges of vector_engine

* WIP: Refining addition engine traits

* WIP: Updated add traits

* WIP: Updated add traits - fix typo

* WIP: constexpr failure in clang; moving to other system for debug

* WIP: constexpr problem fixed (possibly)

* WIP: subtraction

* WIP: add multiplication

* WIP: add back in mul/div tests in VS

* WIP: add sizing constructors for dynamic row/column vectors

* New framing of the motivation without a separate vector object.

* Pin version of mdspan, for now

* Update some comments for readability

* Move default template parameter defintion to class definition

* Update various unit tests, especially, adding constexpr

* Update to support changes due to mdspan updates made in June 2021, see commit 5694f21. Mostly, this was converting all uses of ptrdiff_t to size_t and updating for changed mdspan-related names.

* wip

* Rename basic_matrix as matrix

* Rename driver heaeder file from matrix.hpp to matrix

* Refactoring mdspan and general cleanup

* Add new header for mdspan utilities; remove extents as template parameter in partial specializations; simplify mdspan support in matrix_storage_engine

* Re-factor mdspan support for the view engine partial specializations

* Update google test external to the latest release

* Begin re-arranging operations traits code

* Update for VS

* Rename some files and continue refactoring operation traits

* Next round of operations traits refactoring

* Update VS project files for most recent refactoring

* As experiment, adding nested layout_type alias to storage and view engines

* wip

* Updates for layout traits

* Clean-up and re-arrangement

* Clean-up and re-arrangement

* Withdraw all vector-related declarations

* Updated matrix::column_type and matrix::row_type

* Create P1385R7.pdf

* Update to support latest mdspan, with integer type template parameter in extents class

* WIP: clean-up

* Cleanup of include guards and some comments

* Fix up ADL issue with dynamic_extent; more commenting and cleanup

* Updates for VS2022 and NuGet gtest 1.8.1.7

* Disable automated builds, temporarily

* Rename extraction aliases

* Update some comments

* Remove matrix_operation_traits type from library, move it into tests

* Start R8 paper

* Do some template parameter renaming and general clean-up

---------

Co-authored-by: J Guy Davidson <guy@hatcat.com>
  • Loading branch information
BobSteagall and hatcat authored Feb 13, 2023
1 parent 38021ca commit 44e1e55
Show file tree
Hide file tree
Showing 80 changed files with 21,715 additions and 16,935 deletions.
17 changes: 17 additions & 0 deletions .conan/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,27 @@ conan_basic_setup(TARGETS)

find_package(wg21_linear_algebra REQUIRED)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED YES)
set(CMAKE_CXX_EXTENSIONS NO)

add_executable(test_linear_algebra
test_package.cpp
)

target_compile_options(test_linear_algebra
PRIVATE
$<$<OR:$<CXX_COMPILER_ID:GNU>>:-fconcepts -Wall -pedantic -Wextra -Wno-unused-function -Wno-unused-variable -W -Wno-unused-but-set-variable -Wno-unused-local-typedefs -fmax-errors=10>
$<$<OR:$<CXX_COMPILER_ID:Clang>>:-stdlib=libc++ -Wall -pedantic -Wextra -Wno-unused-parameter -Wno-unused-function -Wno-unused-local-typedefs>
$<$<OR:$<CXX_COMPILER_ID:MSVC>>:/permissive->
$<$<OR:$<CXX_COMPILER_ID:AppleClang>>:-Wall -pedantic -Wextra -Wno-unused-parameter -Wno-unused-function -Wno-unused-local-typedefs>
)

target_compile_options(test_linear_algebra
PRIVATE
$<$<OR:$<CXX_COMPILER_ID:Clang>>:-stdlib=libc++>
)

target_link_libraries(test_linear_algebra PRIVATE wg21_linear_algebra::wg21_linear_algebra)

set_target_properties(test_linear_algebra
Expand Down
7 changes: 3 additions & 4 deletions .conan/test_package/test_package.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#include <linear_algebra.hpp>
#include <matrix>

using namespace STD_LA;

int main()
{
STD_LA::vector<fs_vector_engine<double, 4>> v;
STD_LA::matrix<fs_matrix_engine<double, 4, 4>> m;
v*m;
STD_LA::fixed_size_matrix<float, 4, 4> m;
m.rows();

return EXIT_SUCCESS;
}
File renamed without changes.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
build*
cmake-*
extsrc*
externals*
externals/
obsolete*
packages/
tmp
x64*
x86*
pgen*
wg21*
*/pgen*
*/x64*
*/x86*
*/wg21*
Expand Down
109 changes: 52 additions & 57 deletions .vs2019/lin_alg_test.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,76 +19,71 @@
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\include\linear_algebra.hpp" />
<ClInclude Include="..\include\linear_algebra\addition_traits.hpp" />
<ClInclude Include="..\include\linear_algebra\matrix.hpp" />
<ClInclude Include="..\include\linear_algebra\debug_helpers.hpp" />
<ClInclude Include="..\include\linear_algebra\division_traits.hpp" />
<ClInclude Include="..\include\linear_algebra\dynamic_matrix_engine.hpp" />
<ClInclude Include="..\include\linear_algebra\dynamic_vector_engine.hpp" />
<ClInclude Include="..\include\linear_algebra\fixed_size_matrix_engine.hpp" />
<ClInclude Include="..\include\linear_algebra\fixed_size_vector_engine.hpp" />
<ClInclude Include="..\include\linear_algebra\engine_support.hpp" />
<ClInclude Include="..\include\linear_algebra\matrix_view_engine.hpp" />
<ClInclude Include="..\include\linear_algebra\private_support.hpp" />
<ClInclude Include="..\include\linear_algebra\forward_declarations.hpp" />
<ClInclude Include="..\include\linear_algebra\matrix.hpp" />
<ClInclude Include="..\include\linear_algebra\public_support.hpp" />
<ClInclude Include="..\include\linear_algebra\arithmetic_operators.hpp" />
<ClInclude Include="..\include\linear_algebra\multiplication_traits.hpp" />
<ClInclude Include="..\include\linear_algebra\negation_traits.hpp" />
<ClInclude Include="..\include\linear_algebra\mdspan_support.hpp" />
<ClInclude Include="..\include\linear_algebra\operation_traits.hpp" />
<ClInclude Include="..\include\linear_algebra\subtraction_traits.hpp" />
<ClInclude Include="..\include\linear_algebra\vector.hpp" />
<ClInclude Include="..\include\linear_algebra\vector_iterators.hpp" />
<ClInclude Include="..\include\linear_algebra\vector_view_engine.hpp" />
<ClInclude Include="..\include\linear_algebra\op_traits_addition.hpp" />
<ClInclude Include="..\include\linear_algebra\op_traits_division.hpp" />
<ClInclude Include="..\include\linear_algebra\op_traits_multiplication.hpp" />
<ClInclude Include="..\include\linear_algebra\op_traits_subtraction.hpp" />
<ClInclude Include="..\include\linear_algebra\op_traits_support.hpp" />
<ClInclude Include="..\tests\test_common.hpp" />
<ClInclude Include="..\tests\test_new_arithmetic.hpp" />
<ClInclude Include="..\tests\test_new_engine.hpp" />
<ClInclude Include="..\tests\test_new_number.hpp" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\tests\test_01.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\tests\test_02.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\tests\test_dynamic_engines.cpp" />
<ClCompile Include="..\tests\test_fixed_size_engines.cpp" />
<ClInclude Include="..\include\linear_algebra\matrix_storage_engine.hpp" />
<ClCompile Include="..\tests\test_main.cpp" />
<ClCompile Include="..\tests\test_obj_matrix.cpp" />
<ClCompile Include="..\tests\test_mve_00.cpp" />
<ClCompile Include="..\tests\test_mse_2A.cpp" />
<ClCompile Include="..\tests\test_mse_2B.cpp" />
<ClCompile Include="..\tests\test_mse_2C.cpp" />
<ClCompile Include="..\tests\test_mse_3A.cpp" />
<ClCompile Include="..\tests\test_mse_3B.cpp" />
<ClCompile Include="..\tests\test_mse_3C.cpp" />
<ClCompile Include="..\tests\test_mse_4A.cpp" />
<ClCompile Include="..\tests\test_mse_4B.cpp" />
<ClCompile Include="..\tests\test_mse_4C.cpp" />
<ClCompile Include="..\tests\test_mse_4D.cpp" />
<ClCompile Include="..\tests\test_mse_4E.cpp" />
<ClCompile Include="..\tests\test_op_add.cpp" />
<ClCompile Include="..\tests\test_op_add_traits.cpp" />
<ClCompile Include="..\tests\test_op_div_traits.cpp" />
<ClCompile Include="..\tests\test_op_mul_traits.cpp" />
<ClCompile Include="..\tests\test_op_neg_traits.cpp" />
<ClCompile Include="..\tests\test_op_sub_traits.cpp" />
<ClCompile Include="..\tests\test_geometry_2.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ClCompile Include="..\tests\test_op_div.cpp" />
<ClCompile Include="..\tests\test_op_div_traits.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\tests\test_geometry_3.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ClCompile Include="..\tests\test_op_mul.cpp" />
<ClCompile Include="..\tests\test_op_mul_traits.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\tests\test_geometry_4.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ClCompile Include="..\tests\test_op_sub.cpp" />
<ClCompile Include="..\tests\test_op_sub_traits.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="..\docs\papers\P1385D7.md" />
<None Include="..\include\matrix" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Text Include="..\CMakeLists.txt" />
<Text Include="..\tests\CMakeLists.txt" />
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{8D598CBC-C629-4CC0-ACFC-E791A695ACD1}</ProjectGuid>
Expand All @@ -99,26 +94,26 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
Expand Down Expand Up @@ -238,12 +233,12 @@
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
<Import Project="..\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.1.8.1.3\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.targets" Condition="Exists('..\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.1.8.1.3\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.targets')" />
<Import Project="..\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.1.8.1.7\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.targets" Condition="Exists('..\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.1.8.1.7\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.targets')" />
</ImportGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.1.8.1.3\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.1.8.1.3\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.1.8.1.7\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.1.8.1.7\build\native\Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn.targets'))" />
</Target>
</Project>
Loading

0 comments on commit 44e1e55

Please sign in to comment.