Commit ebe4b169 authored by MIJIEUX Thomas's avatar MIJIEUX Thomas

Fix template parameter name convention

parent b463be7c
......@@ -40,7 +40,8 @@ namespace fabulous {
/**
* \brief Global constants that depends on the Arithmetic used
*/
template<class S> struct Arithmetik
template<class S>
struct Arithmetik
{
static_assert(
sizeof(S) != sizeof(S),// always false if instantiated
......
......@@ -64,7 +64,7 @@ S real(S a) { return a; }
/* ******************** array inverse ******************** */
/** \brief compute the inverse of each entry in an array of scalars. */
template< class S >
template<class S>
std::vector<S> array_inverse(const std::vector<S> &arr)
{
std::vector<S> inv;
......
......@@ -16,7 +16,8 @@
namespace fabulous {
template<class T>
struct IW_matrix_type {
struct IW_matrix_type
{
enum { value = -1 };
};
......@@ -51,10 +52,10 @@ public:
file.close();
}
template< class Matrix >
template<class Matrix>
void LoadMatrix(Matrix &A, std::ifstream &file, bool check_square = true)
{
using V = typename Matrix::value_type;
using S = typename Matrix::value_type;
if (!file.is_open()) {
std::cerr << "file not opened!" << std::endl;
......@@ -65,13 +66,13 @@ public:
int type = header[0];
int M = header[1];
int N = header[2];
if (type != IW_matrix_type<V>::value) {
if (type != IW_matrix_type<S>::value) {
FABULOUS_FATAL_ERROR(
"Different Size between Scalar and sizeEl\n"
"Check what you are doing. Exiting ...\n"
);
}
std::cerr << "Type: '" << IW_matrix_type<V>::name
std::cerr << "Type: '" << IW_matrix_type<S>::name
<< "' sizes=("<<M<<", "<<N<<")\n";
if (check_square && N != M) {
......@@ -82,10 +83,10 @@ public:
}
A.resize(M, N, M*N);
std::vector<V> vec;
std::vector<S> vec;
vec.resize(M*N);
file.read((char*) vec.data(), sizeof(V)*N*M);
file.read((char*) vec.data(), sizeof(S)*N*M);
for (int j = 0; j < N; ++j)
for (int i = 0; i < M; ++i)
A.at(i, j) = vec[j*N+i];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment