// "delete" to delete the Faust::Transform<SCALAR> object dynamically allocated previously
// "multiply" to multiply the Faust::Transform<SCALAR> object by a vector or a matrix
// prhs[1] : address of the Faust::Transform<SCALAR> object dynamically allocated previously
// prhs[2] (only necessary if prhs[0] matches "multiply") : vector or matrix A to multiply by the Faust::Transform<SCALAR> object
typedef @FAUST_SCALAR@ SCALAR;
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
#ifdef FAUST_VERBOSE
if (typeid(SCALAR) == typeid(float))
{
std::cout<<"SCALAR == float"<<std::endl;
}
if (typeid(SCALAR) == typeid(double))
{
std::cout<<"SCALAR == double"<<std::endl;
}
#endif
try{
// Get the command string
char cmd[256];
if (nrhs < 1 || mxGetString(prhs[0], cmd, sizeof(cmd)))
mexErrMsgTxt("First input should be a command string less than 256 characters long.");
// Check there is a second input, which should be the class instance handle
if (nrhs < 2)
mexErrMsgTxt("Second input should be a class instance handle.");
// New
if (!strcmp("new", cmd))
{
if(nlhs!=1)
mexErrMsgTxt("1 output is expected.");
if((nrhs<2) || (nrhs>4))
mexErrMsgTxt("between 1 and 3 inputs are expected.");
if(!mxIsCell(prhs[1]))
mexErrMsgTxt("1st arg input must be a cell-array");
// v1105 : Faust::Transform<SCALAR,Cpu> is no longer made of Faust::MatSparse<SCALAR,Cpu> but of pointer of abstract class Faust::MatGeneric<SCALAR,Cpu>
//old version : std::vector<Faust::MatSparse<SCALAR,Cpu> > vec_spmat;
// "delete" to delete the Faust::Transform<SCALAR> object dynamically allocated previously
// "multiply" to multiply the Faust::Transform<SCALAR> object by a vector or a matrix
// prhs[1] : address of the Faust::Transform<SCALAR> object dynamically allocated previously
// prhs[2] (only necessary if prhs[0] matches "multiply") : vector or matrix A to multiply by the Faust::Transform<SCALAR> object
typedef @FAUST_SCALAR@ SCALAR;
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
#ifdef FAUST_VERBOSE
if (typeid(SCALAR) == typeid(float))
{
std::cout<<"SCALAR == float"<<std::endl;
}
if (typeid(SCALAR) == typeid(double))
{
std::cout<<"SCALAR == double"<<std::endl;
}
#endif
try{
// Get the command string
char cmd[256];
if (nrhs < 1 || mxGetString(prhs[0], cmd, sizeof(cmd)))
mexErrMsgTxt("First input should be a command string less than 256 characters long.");
// Check there is a second input, which should be the class instance handle
if (nrhs < 2)
mexErrMsgTxt("Second input should be a class instance handle.");
// New
if (!strcmp("new", cmd))
{
if(nlhs!=1)
mexErrMsgTxt("1 output is expected.");
if((nrhs<2) || (nrhs>4))
mexErrMsgTxt("between 1 and 3 inputs are expected.");
if(!mxIsCell(prhs[1]))
mexErrMsgTxt("1st arg input must be a cell-array");
// v1105 : Faust::Transform<SCALAR,Cpu> is no longer made of Faust::MatSparse<SCALAR,Cpu> but of pointer of abstract class Faust::MatGeneric<SCALAR,Cpu>
//old version : std::vector<Faust::MatSparse<SCALAR,Cpu> > vec_spmat;