Ticket #4410: matrix_assign_problem.cpp

File matrix_assign_problem.cpp, 587 bytes (added by Marco Guazzone <marco.guazzone@…>, 12 years ago)

A sample program for showing the problem (the program should not compile).

Line 
1#include <complex>
2#include <boost/numeric/ublas/matrix.hpp>
3#include <boost/numeric/ublas/symmetric.hpp>
4
5namespace ublas = boost::numeric::ublas;
6
7int main()
8{
9 typedef double in_value_type;
10 typedef std::complex<double> out_value_type;
11
12 const std::size_t n = 4;
13
14 ublas::matrix<in_value_type> IN(n,n);
15 ublas::matrix<out_value_type> OUT(IN); // COMPILE
16 OUT = IN; // COMPILE
17
18 ublas::symmetric_matrix<in_value_type,ublas::lower> sym_IN(n,n);
19 ublas::symmetric_matrix<out_value_type,ublas::lower> sym_OUT(sym_IN); // NOT COMPILE
20 OUT = IN; // NOT COMPILE
21}