28 #ifndef _AUX_MATLAB_HPP_
29 #define _AUX_MATLAB_HPP_
48 inline void col2row_major(
const double *
const colM,
double *rowM,
size_t num_rows,
size_t num_cols)
51 for (
size_t i=0; i<num_rows; i++)
52 for (
size_t j=0; j<num_cols; j++, p++)
53 *p = colM[i+j*num_rows];
61 inline TNT::Array2D<double>
col2row_major(
const double *
const colM,
size_t num_rows,
size_t num_cols)
63 TNT::Array2D<double> M (num_rows, num_cols);
65 for (
size_t i=0; i<num_rows; i++)
66 for (
size_t j=0; j<num_cols; j++, p++)
67 *p = colM[i+j*num_rows];
76 inline void row2col_major(
const double *
const rowM,
double *colM,
size_t num_rows,
size_t num_cols)
79 for (
size_t i=0; i<num_cols; i++)
80 for (
size_t j=0; j<num_rows; j++, p++)
81 *p = rowM[i+j*num_cols];
97 int readModel(
const mxArray *model, System &S);
104 int FIS2System(
const mxArray *FIS, System &S);
Fuzzy Logic Tools (FLT) namespace.
Definition: derivatives.hpp:41
void col2row_major(const double *const colM, double *rowM, size_t num_rows, size_t num_cols)
Converts a column-major matrix in a row-major one.
Definition: aux_matlab.hpp:48
int System2FIS(System &S, mxArray *FIS)
Writes the Fuzzy Model in a FIS variable.
Definition: aux_matlab.cpp:535
void row2col_major(const double *const rowM, double *colM, size_t num_rows, size_t num_cols)
Converts a row-major matrix in a column-major one.
Definition: aux_matlab.hpp:76
int readModel(const mxArray *model, System &S)
Reads a Fuzzy Model (TXT, FIS file or FIS variable)
Definition: aux_matlab.cpp:6
int FIS2System(const mxArray *FIS, System &S)
Reads the Fuzzy Model from a FIS variable.
Definition: aux_matlab.cpp:68
Implements useful functions for fuzzy systems.