test43.cpp
来自「boost库提供标准的C++ API 配合dev c++使用,功能更加强大」· C++ 代码 · 共 387 行 · 第 1/2 页
CPP
387 行
#endif
#endif
}
catch (std::exception &e) {
std::cout << e.what () << std::endl;
}
catch (...) {
std::cout << "unknown exception" << std::endl;
}
#endif
}
};
// Test matrix
void test_matrix () {
std::cout << "test_matrix" << std::endl;
#ifdef USE_BANDED
#ifdef USE_BOUNDED_ARRAY
#ifdef USE_FLOAT
std::cout << "float, bounded_array" << std::endl;
test_my_matrix<ublas::banded_matrix<float, ublas::row_major, ublas::bounded_array<float, 3 * 3> >, 3 > () ();
test_my_matrix<ublas::banded_matrix<float, ublas::row_major, ublas::bounded_array<float, 3 * 3> >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "double, bounded_array" << std::endl;
test_my_matrix<ublas::banded_matrix<double, ublas::row_major, ublas::bounded_array<double, 3 * 3> >, 3 > () ();
test_my_matrix<ublas::banded_matrix<double, ublas::row_major, ublas::bounded_array<double, 3 * 3> >, 3 > () (0);
#endif
#ifdef USE_STD_COMPLEX
#ifdef USE_FLOAT
std::cout << "std::complex<float>, bounded_array" << std::endl;
test_my_matrix<ublas::banded_matrix<std::complex<float>, ublas::row_major, ublas::bounded_array<std::complex<float>, 3 * 3> >, 3 > () ();
test_my_matrix<ublas::banded_matrix<std::complex<float>, ublas::row_major, ublas::bounded_array<std::complex<float>, 3 * 3> >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "std::complex<double>, bounded_array" << std::endl;
test_my_matrix<ublas::banded_matrix<std::complex<double>, ublas::row_major, ublas::bounded_array<std::complex<double>, 3 * 3> >, 3 > () ();
test_my_matrix<ublas::banded_matrix<std::complex<double>, ublas::row_major, ublas::bounded_array<std::complex<double>, 3 * 3> >, 3 > () (0);
#endif
#endif
#endif
#ifdef USE_UNBOUNDED_ARRAY
#ifdef USE_FLOAT
std::cout << "float, unbounded_array" << std::endl;
test_my_matrix<ublas::banded_matrix<float, ublas::row_major, ublas::unbounded_array<float> >, 3 > () ();
test_my_matrix<ublas::banded_matrix<float, ublas::row_major, ublas::unbounded_array<float> >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "double, unbounded_array" << std::endl;
test_my_matrix<ublas::banded_matrix<double, ublas::row_major, ublas::unbounded_array<double> >, 3 > () ();
test_my_matrix<ublas::banded_matrix<double, ublas::row_major, ublas::unbounded_array<double> >, 3 > () (0);
#endif
#ifdef USE_STD_COMPLEX
#ifdef USE_FLOAT
std::cout << "std::complex<float>, unbounded_array" << std::endl;
test_my_matrix<ublas::banded_matrix<std::complex<float>, ublas::row_major, ublas::unbounded_array<std::complex<float> > >, 3 > () ();
test_my_matrix<ublas::banded_matrix<std::complex<float>, ublas::row_major, ublas::unbounded_array<std::complex<float> > >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "std::complex<double>, unbounded_array" << std::endl;
test_my_matrix<ublas::banded_matrix<std::complex<double>, ublas::row_major, ublas::unbounded_array<std::complex<double> > >, 3 > () ();
test_my_matrix<ublas::banded_matrix<std::complex<double>, ublas::row_major, ublas::unbounded_array<std::complex<double> > >, 3 > () (0);
#endif
#endif
#endif
#ifdef USE_STD_VECTOR
#ifdef USE_FLOAT
std::cout << "float, std::vector" << std::endl;
test_my_matrix<ublas::banded_matrix<float, ublas::row_major, std::vector<float> >, 3 > () ();
test_my_matrix<ublas::banded_matrix<float, ublas::row_major, std::vector<float> >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "double, std::vector" << std::endl;
test_my_matrix<ublas::banded_matrix<double, ublas::row_major, std::vector<double> >, 3 > () ();
test_my_matrix<ublas::banded_matrix<double, ublas::row_major, std::vector<double> >, 3 > () (0);
#endif
#ifdef USE_STD_COMPLEX
#ifdef USE_FLOAT
std::cout << "std::complex<float>, std::vector" << std::endl;
test_my_matrix<ublas::banded_matrix<std::complex<float>, ublas::row_major, std::vector<std::complex<float> > >, 3 > () ();
test_my_matrix<ublas::banded_matrix<std::complex<float>, ublas::row_major, std::vector<std::complex<float> > >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "std::complex<double>, std::vector" << std::endl;
test_my_matrix<ublas::banded_matrix<std::complex<double>, ublas::row_major, std::vector<std::complex<double> > >, 3 > () ();
test_my_matrix<ublas::banded_matrix<std::complex<double>, ublas::row_major, std::vector<std::complex<double> > >, 3 > () (0);
#endif
#endif
#endif
#endif
#ifdef USE_DIAGONAL
#ifdef USE_BOUNDED_ARRAY
#ifdef USE_FLOAT
std::cout << "float, bounded_array" << std::endl;
test_my_matrix<ublas::diagonal_matrix<float, ublas::row_major, ublas::bounded_array<float, 3 * 3> >, 3 > () ();
test_my_matrix<ublas::diagonal_matrix<float, ublas::row_major, ublas::bounded_array<float, 3 * 3> >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "double, bounded_array" << std::endl;
test_my_matrix<ublas::diagonal_matrix<double, ublas::row_major, ublas::bounded_array<double, 3 * 3> >, 3 > () ();
test_my_matrix<ublas::diagonal_matrix<double, ublas::row_major, ublas::bounded_array<double, 3 * 3> >, 3 > () (0);
#endif
#ifdef USE_STD_COMPLEX
#ifdef USE_FLOAT
std::cout << "std::complex<float>, bounded_array" << std::endl;
test_my_matrix<ublas::diagonal_matrix<std::complex<float>, ublas::row_major, ublas::bounded_array<std::complex<float>, 3 * 3> >, 3 > () ();
test_my_matrix<ublas::diagonal_matrix<std::complex<float>, ublas::row_major, ublas::bounded_array<std::complex<float>, 3 * 3> >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "std::complex<double>, bounded_array" << std::endl;
test_my_matrix<ublas::diagonal_matrix<std::complex<double>, ublas::row_major, ublas::bounded_array<std::complex<double>, 3 * 3> >, 3 > () ();
test_my_matrix<ublas::diagonal_matrix<std::complex<double>, ublas::row_major, ublas::bounded_array<std::complex<double>, 3 * 3> >, 3 > () (0);
#endif
#endif
#endif
#ifdef USE_UNBOUNDED_ARRAY
#ifdef USE_FLOAT
std::cout << "float, unbounded_array" << std::endl;
test_my_matrix<ublas::diagonal_matrix<float, ublas::row_major, ublas::unbounded_array<float> >, 3 > () ();
test_my_matrix<ublas::diagonal_matrix<float, ublas::row_major, ublas::unbounded_array<float> >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "double, unbounded_array" << std::endl;
test_my_matrix<ublas::diagonal_matrix<double, ublas::row_major, ublas::unbounded_array<double> >, 3 > () ();
test_my_matrix<ublas::diagonal_matrix<double, ublas::row_major, ublas::unbounded_array<double> >, 3 > () (0);
#endif
#ifdef USE_STD_COMPLEX
#ifdef USE_FLOAT
std::cout << "std::complex<float>, unbounded_array" << std::endl;
test_my_matrix<ublas::diagonal_matrix<std::complex<float>, ublas::row_major, ublas::unbounded_array<std::complex<float> > >, 3 > () ();
test_my_matrix<ublas::diagonal_matrix<std::complex<float>, ublas::row_major, ublas::unbounded_array<std::complex<float> > >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "std::complex<double>, unbounded_array" << std::endl;
test_my_matrix<ublas::diagonal_matrix<std::complex<double>, ublas::row_major, ublas::unbounded_array<std::complex<double> > >, 3 > () ();
test_my_matrix<ublas::diagonal_matrix<std::complex<double>, ublas::row_major, ublas::unbounded_array<std::complex<double> > >, 3 > () (0);
#endif
#endif
#endif
#ifdef USE_STD_VECTOR
#ifdef USE_FLOAT
std::cout << "float, std::vector" << std::endl;
test_my_matrix<ublas::diagonal_matrix<float, ublas::row_major, std::vector<float> >, 3 > () ();
test_my_matrix<ublas::diagonal_matrix<float, ublas::row_major, std::vector<float> >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "double, std::vector" << std::endl;
test_my_matrix<ublas::diagonal_matrix<double, ublas::row_major, std::vector<double> >, 3 > () ();
test_my_matrix<ublas::diagonal_matrix<double, ublas::row_major, std::vector<double> >, 3 > () (0);
#endif
#ifdef USE_STD_COMPLEX
#ifdef USE_FLOAT
std::cout << "std::complex<float>, std::vector" << std::endl;
test_my_matrix<ublas::diagonal_matrix<std::complex<float>, ublas::row_major, std::vector<std::complex<float> > >, 3 > () ();
test_my_matrix<ublas::diagonal_matrix<std::complex<float>, ublas::row_major, std::vector<std::complex<float> > >, 3 > () (0);
#endif
#ifdef USE_DOUBLE
std::cout << "std::complex<double>, std::vector" << std::endl;
test_my_matrix<ublas::diagonal_matrix<std::complex<double>, ublas::row_major, std::vector<std::complex<double> > >, 3 > () ();
test_my_matrix<ublas::diagonal_matrix<std::complex<double>, ublas::row_major, std::vector<std::complex<double> > >, 3 > () (0);
#endif
#endif
#endif
#endif
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?