- edited description
Error compiling BB * inv(trans(LL)) for StaticMatrix
Hello Klaus, long time no see )
Yesterday I tried to compile some of my 2 years old code with the recent Blaze and ran into a compilation error. Here is the minimal example:
#include <blaze/Math.h>
int main(int, char **)
{
using namespace blaze;
std::size_t const columns = 4, rows = 3;
StaticMatrix<double, columns, columns, columnMajor> LL;
StaticMatrix<double, rows, columns, columnMajor> BB, XX;
randomize(LL);
randomize(BB);
XX = evaluate(BB * inv(trans(LL)));
return 0;
}
Clang output:
$ clang++ test.cpp
In file included from test.cpp:1:
In file included from /usr/local/include/blaze/Math.h:48:
In file included from /usr/local/include/blaze/math/CompressedMatrix.h:49:
In file included from /usr/local/include/blaze/math/SparseMatrix.h:86:
In file included from /usr/local/include/blaze/math/expressions/SMatTransExpr.h:49:
/usr/local/include/blaze/math/expressions/DMatTransposer.h:354:11: error: no member named 'resize' in 'blaze::StaticMatrix<double, 3, 4, true, blaze::aligned, blaze::padded>'
dm_.resize( m, n, preserve );
~~~ ^
/usr/local/include/blaze/math/expressions/Matrix.h:1033:14: note: in instantiation of member function 'blaze::DMatTransposer<blaze::StaticMatrix<double, 3, 4, true, blaze::aligned, blaze::padded>, false>::resize' requested here
(*matrix).resize( m, n, preserve );
^
/usr/local/include/blaze/math/expressions/Matrix.h:1110:4: note: in instantiation of function template specialization 'blaze::resize_backend<blaze::DMatTransposer<blaze::StaticMatrix<double, 3, 4, true, blaze::aligned, blaze::padded>, false>, false>' requested here
resize_backend( matrix, m, n, preserve );
^
/usr/local/include/blaze/math/dense/LSE.h:129:4: note: in instantiation of function template specialization 'blaze::resize<blaze::DMatTransposer<blaze::StaticMatrix<double, 3, 4, true, blaze::aligned, blaze::padded>, false>, false>' requested here
resize( *X, 0UL, (*B).columns() );
^
/usr/local/include/blaze/math/dense/LSE.h:6472:17: note: in instantiation of function template specialization 'blaze::solve0x0<blaze::StaticMatrix<double, 4, 4, true, blaze::aligned, blaze::padded>, true, blaze::DMatTransposer<blaze::StaticMatrix<double, 3, 4, true, blaze::aligned, blaze::padded>, false>, false, blaze::DMatTransExpr<blaze::StaticMatrix<double, 3, 4, true, blaze::aligned, blaze::padded>, false>, false>' requested here
case 0UL: solve0x0( *A, *X, *B ); break;
^
/usr/local/include/blaze/math/expressions/DMatDMatSolveExpr.h:225:7: note: in instantiation of function template specialization 'blaze::solve<blaze::StaticMatrix<double, 4, 4, true, blaze::aligned, blaze::padded>, true, blaze::DMatTransposer<blaze::StaticMatrix<double, 3, 4, true, blaze::aligned, blaze::padded>, false>, false, blaze::DMatTransExpr<blaze::StaticMatrix<double, 3, 4, true, blaze::aligned, blaze::padded>, false>, false>' requested here
solve( rhs.leftOperand(), *lhs, rhs.rightOperand() );
^
/usr/local/include/blaze/math/expressions/DMatTransExpr.h:393:7: note: in instantiation of function template specialization 'blaze::assign<blaze::DMatTransposer<blaze::StaticMatrix<double, 3, 4, true, blaze::aligned, blaze::padded>, false>, false>' requested here
assign( tmp, rhs.dm_ );
^
/usr/local/include/blaze/math/dense/StaticMatrix.h:4295:4: note: in instantiation of function template specialization 'blaze::assign<blaze::StaticMatrix<double, 3, 4, true, blaze::aligned, blaze::padded>, true>' requested here
assign( *this, *m );
^
/usr/local/include/blaze/math/expressions/Matrix.h:1284:28: note: in instantiation of function template specialization 'blaze::StaticMatrix<double, 3, 4, true, blaze::aligned, blaze::padded>::StaticMatrix<blaze::DMatTransExpr<blaze::DMatDMatSolveExpr<blaze::StaticMatrix<double, 4, 4, true, blaze::aligned, blaze::padded>, blaze::DMatTransExpr<blaze::StaticMatrix<double, 3, 4, true, blaze::aligned, blaze::padded>, false>, false>, true>, true>' requested here
typename MT::ResultType tmp( *matrix );
^
test.cpp:16:10: note: in instantiation of function template specialization 'blaze::evaluate<blaze::DMatTransExpr<blaze::DMatDMatSolveExpr<blaze::StaticMatrix<double, 4, 4, true, blaze::aligned, blaze::padded>, blaze::DMatTransExpr<blaze::StaticMatrix<double, 3, 4, true, blaze::aligned, blaze::padded>, false>, false>, true>, true>' requested here
XX = evaluate(BB * inv(trans(LL)));
^
1 error generated.
I believe that the code above is perfectly valid and it used to work fine. Could you please fix the issue?
Kind regards,
Misha
Comments (12)
-
reporter -
Hi Mikhail!
It’s great to hear from you again. And thanks for reporting this defect. You are correct, this problem was introduced with the refactoring of the
IsResizable
type trait. I’ll fix it as quickly as possible.Best regards,
Klaus!
-
- changed status to resolved
Commit 1adc0f2 fixes the
IsResizable
type trait, which causes the described compilation error. The fix is immediately available via cloning the Blaze repository and will be officially released in Blaze 3.9. -
reporter Thank you for fixing it quickly!
-
Commit 1adc0f2 fixes the
IsResizable
type trait, which causes the described compilation error. The fix is immediately available via cloning the Blaze repository and will be officially released in Blaze 3.9.This fix is not good as it breaks building 25% of the tests. Namely,
IsResizable<int>::value
(or for any other fundamental type) is a compilation error with that change instead of being 0. -
reporter The error is back, but with a different compilation error:
/home/freeman/software/tt/blaze/install/include/blaze/math/dense/StaticMatrix.h:4292:4: error: static assertion failed due to requirement 'OtherRows == -1 || OtherRows == 3UL': Invalid setup of static matrix BLAZE_STATIC_ASSERT_MSG( OtherRows == -1 || OtherRows == M, "Invalid setup of static matrix" ); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/freeman/software/tt/blaze/install/include/blaze/util/StaticAssert.h:124:4: note: expanded from macro 'BLAZE_STATIC_ASSERT_MSG' static_assert( expr, msg ) ^ ~~~~ /home/freeman/software/tt/blaze/install/include/blaze/math/dense/Inversion.h:556:38: note: in instantiation of function template specialization 'blaze::StaticMatrix<double, 3, 3, true>::StaticMatrix<blaze::StaticMatrix<double, 4, 4, true>, true>' requested here const StaticMatrix<ET,3UL,3UL,SO> A( *dm ); ^ /home/freeman/software/tt/blaze/install/include/blaze/math/dense/Inversion.h:943:25: note: in instantiation of function template specialization 'blaze::invertGeneral3x3<blaze::StaticMatrix<double, 4, 4, true>, true>' requested here case byLU : invertGeneral3x3 ( *dm ); break; ^ /home/freeman/software/tt/blaze/install/include/blaze/math/dense/Inversion.h:3954:17: note: in instantiation of function template specialization 'blaze::invert3x3<blaze::asGeneral, blaze::StaticMatrix<double, 4, 4, true>, true>' requested here case 3UL: invert3x3<IF>( *dm ); break; ^ /home/freeman/software/tt/blaze/install/include/blaze/math/dense/Inversion.h:3894:4: note: in instantiation of function template specialization 'blaze::invert<blaze::asGeneral, blaze::StaticMatrix<double, 4, 4, true>, true>' requested here invert< getInversionFlag<MT>() >( *dm ); ^ /home/freeman/software/tt/blaze/install/include/blaze/math/expressions/DMatInvExpr.h:212:7: note: in instantiation of function template specialization 'blaze::invert<blaze::StaticMatrix<double, 4, 4, true>, true>' requested here invert( *lhs ); ^ /home/freeman/software/tt/blaze/install/include/blaze/math/dense/StaticMatrix.h:4305:4: note: (skipping 3 contexts in backtrace; use -ftemplate-backtrace-limit=0 to see all) assign( *this, *m ); ^ /home/freeman/software/tt/blaze/install/include/blaze/math/expressions/DMatDMatSolveExpr.h:225:7: note: in instantiation of function template specialization 'blaze::solve<blaze::StaticMatrix<double, 4, 4, true>, true, blaze::DMatTransposer<blaze::StaticMatrix<double, 3, 4, true>, false>, false, blaze::DMatTransExpr<blaze::StaticMatrix<double, 3, 4, true>, false>, false>' requested here solve( rhs.leftOperand(), *lhs, rhs.rightOperand() ); ^ /home/freeman/software/tt/blaze/install/include/blaze/math/expressions/DMatTransExpr.h:393:7: note: in instantiation of function template specialization 'blaze::assign<blaze::DMatTransposer<blaze::StaticMatrix<double, 3, 4, true>, false>, false>' requested here assign( tmp, rhs.dm_ ); ^ /home/freeman/software/tt/blaze/install/include/blaze/math/dense/StaticMatrix.h:4305:4: note: in instantiation of function template specialization 'blaze::assign<blaze::StaticMatrix<double, 3, 4, true>, true>' requested here assign( *this, *m ); ^ /home/freeman/software/tt/blaze/install/include/blaze/math/expressions/Matrix.h:1284:28: note: in instantiation of function template specialization 'blaze::StaticMatrix<double, 3, 4, true>::StaticMatrix<blaze::DMatTransExpr<blaze::DMatDMatSolveExpr<blaze::StaticMatrix<double, 4, 4, true>, blaze::DMatTransExpr<blaze::StaticMatrix<double, 3, 4, true>, false>, false>, true>, true>' requested here typename MT::ResultType tmp( *matrix ); ^ blaze_test.cpp:15:10: note: in instantiation of function template specialization 'blaze::evaluate<blaze::DMatTransExpr<blaze::DMatDMatSolveExpr<blaze::StaticMatrix<double, 4, 4, true>, blaze::DMatTransExpr<blaze::StaticMatrix<double, 3, 4, true>, false>, false>, true>, true>' requested here XX = evaluate(BB * inv(trans(LL)));
-
reporter - changed status to open
The error is back
-
reporter This is the commit that (re)introduces the bug: 6058199
-
Thanks (as always) for pointing out the regression. The according commit has been reverted, the bug should be fixed again.
-
- changed status to resolved
Commit eb8ef72 fixes the regression introduces by adding a compile time check for the setup of
StaticMatrix
. The fix is immediately available via cloning the Blaze repository and will be officially released in Blaze 3.9. -
Hi everyone, sorry for the offtopic, but I have posted 4 issues here during the past 6 months (#465, #467, #469, #471), strangely they are all marked as “SUBMITTED” and cannot be viewed when I am not logged in. So Klaus can you see those issues?
…or can anyone see this comment? am I banned by Bitbucket?
-
Hi theoractice!
Thanks for submitting these 4 issues. Unfortunately Blaze is no longer maintained and no more issues will be resolved. I apologize for that.
Best regards,
Klaus!
- Log in to comment