Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Persistence Matrix] replacing static_cast(-1) by method #1153

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

hschreiber
Copy link
Collaborator

c.f. issue #1152

@hschreiber
Copy link
Collaborator Author

hschreiber commented Nov 8, 2024

Hm, it seems that Windows does not like the initialization of a default parameter value with a static method:

Matrix(unsigned int numberOfColumns, Characteristic characteristic = get_null_value<Characteristic>())

Does anyone has a workaround for that or should I just go back to -1 for those cases?

Error produced:

[185/492] Building CXX object src\Persistence_matrix\example\CMakeFiles\Persistence_matrix_example_simplex_tree_to_matrix.dir\example_simplex_tree_to_matrix.cpp.obj
FAILED: src/Persistence_matrix/example/CMakeFiles/Persistence_matrix_example_simplex_tree_to_matrix.dir/example_simplex_tree_to_matrix.cpp.obj 
C:\PROGRA~1\MICROS~2\2022\ENTERP~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\x64\cl.exe  /nologo /TP -DBOOST_ALL_DYN_LINK -DBOOST_ALL_NO_LIB -DBOOST_RESULT_OF_USE_DECLTYPE -DBOOST_SYSTEM_NO_DEPRECATED -DEIGEN_DEFAULT_DENSE_INDEX_TYPE=int -DGUDHI_USE_TBB -DNOMINMAX -ID:\a\1\s\ext\hera\include -ID:\a\1\s\src\common\include -ID:\a\1\s\src\Alpha_complex\include -ID:\a\1\s\src\Bitmap_cubical_complex\include -ID:\a\1\s\src\Bottleneck_distance\include -ID:\a\1\s\src\Collapse\include -ID:\a\1\s\src\Contraction\include -ID:\a\1\s\src\Coxeter_triangulation\include -ID:\a\1\s\src\Cech_complex\include -ID:\a\1\s\src\Hasse_complex\include -ID:\a\1\s\src\Persistence_representations\include -ID:\a\1\s\src\Persistent_cohomology\include -ID:\a\1\s\src\Rips_complex\include -ID:\a\1\s\src\Ripser\include -ID:\a\1\s\src\Simplex_tree\include -ID:\a\1\s\src\Skeleton_blocker\include -ID:\a\1\s\src\Spatial_searching\include -ID:\a\1\s\src\Subsampling\include -ID:\a\1\s\src\Tangential_complex\include -ID:\a\1\s\src\Toplex_map\include -ID:\a\1\s\src\Witness_complex\include -ID:\a\1\s\src\Nerve_GIC\include -ID:\a\1\s\src\Persistence_matrix\include -ID:\a\1\s\src\Zigzag_persistence\include -external:IC:\vcpkg\installed\x64-windows\include -external:W0 /DWIN32 /D_WINDOWS /GR /EHsc /W3 /O2 /Ob2 /DNDEBUG -std:c++17 -MD /showIncludes /Fosrc\Persistence_matrix\example\CMakeFiles\Persistence_matrix_example_simplex_tree_to_matrix.dir\example_simplex_tree_to_matrix.cpp.obj /Fdsrc\Persistence_matrix\example\CMakeFiles\Persistence_matrix_example_simplex_tree_to_matrix.dir\ /FS -c D:\a\1\s\src\Persistence_matrix\example\example_simplex_tree_to_matrix.cpp
D:\a\1\s\src\Persistence_matrix\include\gudhi/Matrix.h(604): fatal error C1001: Internal compiler error.
(compiler file 'msc1.cpp', line 1611)
 To work around this problem, try simplifying or changing the program near the locations listed above.
If possible please provide a repro here: https://developercommunity.visualstudio.com/ 
Please choose the Technical Support command on the Visual C++ 
 Help menu, or open the Technical Support help file for more information
D:\a\1\s\src\Persistence_matrix\include\gudhi/Matrix.h(604): note: the template instantiation context (the oldest one first) is
D:\a\1\s\src\Persistence_matrix\example\example_simplex_tree_to_matrix.cpp(119): note: see instantiation of default argument expression required for 'Gudhi::persistence_matrix::Matrix<Gudhi::persistence_matrix::Default_options<Gudhi::persistence_matrix::Column_types::INTRUSIVE_SET,true,Gudhi::persistence_fields::Zp_field_operators<unsigned int,void>>>::Matrix(unsigned int,unsigned int)'
INTERNAL COMPILER ERROR in 'C:\PROGRA~1\MICROS~2\2022\ENTERP~1\VC\Tools\MSVC\1441~1.341\bin\Hostx64\x64\cl.exe'
    Please choose the Technical Support command on the Visual C++
    Help menu, or open the Technical Support help file for more information

@mglisse
Copy link
Member

mglisse commented Nov 8, 2024

Does it help if you say

Matrix(unsigned int numberOfColumns, Characteristic characteristic = Matrix::get_null_value<Characteristic>())

?
(https://developercommunity.visualstudio.com/t/ICE-calling-static-function-for-default-/10785885)

@hschreiber
Copy link
Collaborator Author

Does it help if you say

Matrix(unsigned int numberOfColumns, Characteristic characteristic = Matrix::get_null_value<Characteristic>())

?

Hopefully, it is as easy as this. We will see what the CI says.

Copy link
Contributor

@VincentRouvreau VincentRouvreau left a comment

Choose a reason for hiding this comment

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

There are still some -1 (persistence_interval.h, matrix_dimension_holder.h, entry_types.h), but they are identified with TODOs, and I also do not see how to fix them.

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.

3 participants