221 if (
size != 1)
mexErrMsgTxt(
"mxArray2bin: Size of data is not equal to one");
232 if (
size != 1)
mexErrMsgTxt(
"mxArray2short: Size of data is not equal to one");
234 return (
short)(*temp);
243 if (
size != 1)
mexErrMsgTxt(
"mxArray2int: Size of data is not equal to one");
254 if (
size != 1)
mexErrMsgTxt(
"mxArray2double: Size of data is not equal to one");
268 if (
size != 1)
mexErrMsgTxt(
"mxArray2double_complex: Size of data is not equal to one");
271 return std::complex<double>(0.0 , (*
tempI));
273 else if (
tempI == 0) {
274 return std::complex<double>((*
tempR), 0.0);
277 return std::complex<double>((*
tempR), (*
tempI));
285 mexErrMsgTxt(
"mxArray2string: Pointer to data is NULL");
288 mexErrMsgTxt(
"mxArray2string: Could not convert mxArray to string");
387 for (
i = 0;
i <
size;
i++) {
out(
i) = std::complex<double>(0.0, (*
tempI++)); }
389 else if (
tempI == 0) {
390 for (
i = 0;
i <
size;
i++) {
out(
i) = std::complex<double>((*
tempR++), 0.0); }
403 int r,
c, rows, cols;
408 if (rows == 0)
mexErrMsgTxt(
"mxArray2bmat: Data has zero rows");
410 if (cols == 0)
mexErrMsgTxt(
"mxArray2bmat: Data has zero columns");
414 for (
c = 0;
c < cols;
c++) {
415 for (r = 0; r < rows; r++) {
427 int r,
c, rows, cols;
432 if (rows == 0)
mexErrMsgTxt(
"mxArray2smat: Data has zero rows");
434 if (cols == 0)
mexErrMsgTxt(
"mxArray2smat: Data has zero columns");
438 for (
c = 0;
c < cols;
c++) {
439 for (r = 0; r < rows; r++) {
451 int r,
c, rows, cols;
456 if (rows == 0)
mexErrMsgTxt(
"mxArray2imat: Data has zero rows");
458 if (cols == 0)
mexErrMsgTxt(
"mxArray2imat: Data has zero columns");
461 for (
c = 0;
c < cols;
c++) {
462 for (r = 0; r < rows; r++) {
474 int r,
c, rows, cols;
479 if (rows == 0)
mexErrMsgTxt(
"mxArray2mat: Data has zero rows");
481 if (cols == 0)
mexErrMsgTxt(
"mxArray2mat: Data has zero columns");
484 for (
c = 0;
c < cols;
c++) {
485 for (r = 0; r < rows; r++) {
497 int r,
c, rows, cols;
504 if (rows == 0)
mexErrMsgTxt(
"mxArray2cmat: Data has zero rows");
506 if (cols == 0)
mexErrMsgTxt(
"mxArray2cmat: Data has zero columns");
510 for (
c = 0;
c < cols;
c++) {
for (r = 0; r < rows; r++) {
out(r,
c) = std::complex<double>(0.0 , (*
tempI++)); } }
512 else if (
tempI == 0) {
513 for (
c = 0;
c < cols;
c++) {
for (r = 0; r < rows; r++) {
out(r,
c) = std::complex<double>((*
tempR++), 0.0); } }
516 for (
c = 0;
c < cols;
c++) {
for (r = 0; r < rows; r++) {
out(r,
c) = std::complex<double>((*
tempR++), (*
tempI++)); } }
535 if (
tempR == 0)
mexErrMsgTxt(
"double_complex2mxArray: Pointer to real valued part is NULL");
536 if (
tempI == 0)
mexErrMsgTxt(
"double_complex2mxArray: Pointer to imaginary valued part is NULL");
545 mexErrMsgTxt(
"string2mxArray: Pointer to string is NULL");
548 mexErrMsgTxt(
"string2mxArray: Could not convert string to mxArray");
590 if (
tempR == 0)
mexErrMsgTxt(
"cvec2mxArray: Pointer to real valued part is NULL");
591 if (
tempI == 0)
mexErrMsgTxt(
"cvec2mxArray: Pointer to imaginary valued part is NULL");
602 int rows, cols, r,
c;
609 if (rows == 0)
mexErrMsgTxt(
"bmat2mxArray: Data has zero rows");
610 if (cols == 0)
mexErrMsgTxt(
"bmat2mxArray: Data has zero columns");
612 for (
c = 0;
c < cols;
c++) {
613 for (r = 0; r < rows; r++) {
625 int rows, cols, r,
c;
632 if (rows == 0)
mexErrMsgTxt(
"smat2mxArray: Data has zero rows");
633 if (cols == 0)
mexErrMsgTxt(
"smat2mxArray: Data has zero columns");
635 for (
c = 0;
c < cols;
c++) {
636 for (r = 0; r < rows; r++) {
645 int rows, cols, r,
c;
652 if (rows == 0)
mexErrMsgTxt(
"imat2mxArray: Data has zero rows");
653 if (cols == 0)
mexErrMsgTxt(
"imat2mxArray: Data has zero columns");
655 for (
c = 0;
c < cols;
c++) {
656 for (r = 0; r < rows; r++) {
665 int rows, cols, r,
c;
672 if (rows == 0)
mexErrMsgTxt(
"mat2mxArray: Data has zero rows");
673 if (cols == 0)
mexErrMsgTxt(
"mat2mxArray: Data has zero columns");
675 for (
c = 0;
c < cols;
c++) {
676 for (r = 0; r < rows; r++) {
685 int rows, cols, r,
c;
689 if (
tempR == 0)
mexErrMsgTxt(
"cvec2mxArray: Pointer to real valued part is NULL");
690 if (
tempI == 0)
mexErrMsgTxt(
"cvec2mxArray: Pointer to imaginary valued part is NULL");
694 if (rows == 0)
mexErrMsgTxt(
"cvec2mxArray: Data has zero rows");
695 if (cols == 0)
mexErrMsgTxt(
"cvec2mxArray: Data has zero columns");
697 for (
c = 0;
c < cols;
c++) {
698 for (r = 0; r < rows; r++) {
737 if (
tempR == 0)
mexErrMsgTxt(
"mxArray2Ccvec: Pointer to real valued part is NULL");
738 if (
tempI == 0)
mexErrMsgTxt(
"mxArray2Ccvec: Pointer to imaginary valued part is NULL");
750 if (rows == 0)
mexErrMsgTxt(
"mxArray2Csmat: Data has zero rows");
752 if (cols == 0)
mexErrMsgTxt(
"mxArray2Csmat: Data has zero columns");
753 for (
c = 0;
c < cols;
c++) {
754 for (r = 0; r < rows; r++) {
766 if (rows == 0)
mexErrMsgTxt(
"mxArray2Cimat: Data has zero rows");
768 if (cols == 0)
mexErrMsgTxt(
"mxArray2Cimat: Data has zero columns");
769 for (
c = 0;
c < cols;
c++) {
770 for (r = 0; r < rows; r++) {
782 if (rows == 0)
mexErrMsgTxt(
"mxArray2Cmat: Data has zero rows");
784 if (cols == 0)
mexErrMsgTxt(
"mxArray2Cmat: Data has zero columns");
785 for (
c = 0;
c < cols;
c++) {
786 for (r = 0; r < rows; r++) {
797 if (
tempR == 0)
mexErrMsgTxt(
"mxArray2Cmat: Pointer to real valued part is NULL");
798 if (
tempI == 0)
mexErrMsgTxt(
"mxArray2Cmat: Pointer to imaginary valued part is NULL");
800 if (rows == 0)
mexErrMsgTxt(
"mxArray2Cmat: Data has zero rows");
802 if (cols == 0)
mexErrMsgTxt(
"mxArray2Cmat: Data has zero columns");
803 for (
c = 0;
c < cols;
c++) {
804 for (r = 0; r < rows; r++) {
842 if (
tempR == 0)
mexErrMsgTxt(
"Ccvec2mxArray: Pointer to real valued part is NULL");
843 if (
tempI == 0)
mexErrMsgTxt(
"Ccvec2mxArray: Pointer to imaginary valued part is NULL");
855 if (rows == 0)
mexErrMsgTxt(
"Csmat2mxArray: Data has zero rows");
857 if (cols == 0)
mexErrMsgTxt(
"Csmat2mxArray: Data has zero columns");
858 for (
c = 0;
c < cols;
c++) {
859 for (r = 0; r < rows; r++) {
871 if (rows == 0)
mexErrMsgTxt(
"Cimat2mxArray: Data has zero rows");
873 if (cols == 0)
mexErrMsgTxt(
"Cimat2mxArray: Data has zero columns");
874 for (
c = 0;
c < cols;
c++) {
875 for (r = 0; r < rows; r++) {
887 if (rows == 0)
mexErrMsgTxt(
"Cmat2mxArray: Data has zero rows");
889 if (cols == 0)
mexErrMsgTxt(
"Cmat2mxArray: Data has zero columns");
890 for (
c = 0;
c < cols;
c++) {
891 for (r = 0; r < rows; r++) {
902 if (
tempR == 0)
mexErrMsgTxt(
"Ccmat2mxArray: Pointer to real valued part is NULL");
903 if (
tempI == 0)
mexErrMsgTxt(
"Ccmat2mxArray: Pointer to imaginary valued part is NULL");
905 if (rows == 0)
mexErrMsgTxt(
"Ccmat2mxArray: Data has zero rows");
907 if (cols == 0)
mexErrMsgTxt(
"Ccmat2mxArray: Data has zero columns");
908 for (
c = 0;
c < cols;
c++) {
909 for (r = 0; r < rows; r++) {
int size() const
Returns the number of data elements in the array object.
T * data
A pointer to the data area.
void set_size(int n, bool copy=false)
Resizing an Array<T>.
Binary arithmetic (boolean) class.
int size(const Vec< T > &v)
Length of vector.
void svec2mxArray(const svec &in, mxArray *out)
Convert svec to the matlab-format mxArray.
void Ccvec2mxArray(double *in_real, double *in_imag, mxArray *out)
Convert C-format pointers to double (real and imaginary parts) to matlab-format mxArray.
void double_complex2mxArray(const std::complex< double > &in, mxArray *out)
Convert complex<double> to the matlab-format mxArray.
void smat2mxArray(const smat &in, mxArray *out)
Convert smat to the matlab-format mxArray.
mat mxArray2mat(const mxArray *in)
Convert the matlab-format mxArray to mat.
void mxArray2Csvec(const mxArray *in, short *out)
Convert the matlab-format mxArray to C-format pointer to short.
void Cimat2mxArray(int **in, mxArray *out)
Convert C-format pointer to pointer to int to matlab-format mxArray.
void mxArray2Ccvec(const mxArray *in, double *out_real, double *out_imag)
Convert the matlab-format mxArray to C-format pointers to double (real and imaginary parts)
bvec mxArray2bvec(const mxArray *in)
Convert the matlab-format mxArray to bvec.
cvec mxArray2cvec(const mxArray *in)
Convert the matlab-format mxArray to cvec.
std::complex< double > mxArray2double_complex(const mxArray *in)
Convert the matlab-format mxArray to complex<double>
bmat mxArray2bmat(const mxArray *in)
Convert the matlab-format mxArray to bmat.
void mxArray2Cmat(const mxArray *in, double **out)
Convert the matlab-format mxArray to C-format pointer to pointer to double.
smat mxArray2smat(const mxArray *in)
Convert the matlab-format mxArray to smat.
void cmat2mxArray(const cmat &in, mxArray *out)
Convert cmat to the matlab-format mxArray.
void ivec2mxArray(const ivec &in, mxArray *out)
Convert ivec to the matlab-format mxArray.
void mat2mxArray(const mat &in, mxArray *out)
Convert mat to the matlab-format mxArray.
double mxArray2double(const mxArray *in)
Convert the matlab-format mxArray to double.
ivec mxArray2ivec(const mxArray *in)
Convert the matlab-format mxArray to ivec.
void double2mxArray(const double &in, mxArray *out)
Convert double to the matlab-format mxArray.
vec mxArray2vec(const mxArray *in)
Convert the matlab-format mxArray to vec.
void mxArray2Cimat(const mxArray *in, int **out)
Convert the matlab-format mxArray to C-format pointer to pointer to int.
void short2mxArray(const short &in, mxArray *out)
Convert short to the matlab-format mxArray.
imat mxArray2imat(const mxArray *in)
Convert the matlab-format mxArray to imat.
std::string mxArray2string(const mxArray *in)
Convert the matlab-format mxArray to string.
void Ccmat2mxArray(double **in_real, double **in_imag, mxArray *out)
Convert C-format pointer to pointer to double (real and imaginary parts) to matlab-format mxArray.
void int2mxArray(const int &in, mxArray *out)
Convert int to the matlab-format mxArray.
void mxArray2Csmat(const mxArray *in, short **out)
Convert the matlab-format mxArray to C-format pointer to pointer to short.
void mxArray2Civec(const mxArray *in, int *out)
Convert the matlab-format mxArray to C-format pointer to int.
void Cmat2mxArray(double **in, mxArray *out)
Convert C-format pointer to pointer to double to matlab-format mxArray.
void Cvec2mxArray(double *in, mxArray *out)
Convert C-format pointer to double to matlab-format mxArray.
int mxArray2int(const mxArray *in)
Convert the matlab-format mxArray to int.
bin mxArray2bin(const mxArray *in)
Convert the matlab-format mxArray to bin.
void bvec2mxArray(const bvec &in, mxArray *out)
Convert bvec to the matlab-format mxArray.
void Csvec2mxArray(short *in, mxArray *out)
Convert C-format pointer to short to matlab-format mxArray.
void Civec2mxArray(int *in, mxArray *out)
Convert C-format pointer to int to matlab-format mxArray.
void imat2mxArray(const imat &in, mxArray *out)
Convert imat to the matlab-format mxArray.
void cvec2mxArray(const cvec &in, mxArray *out)
Convert cvec to the matlab-format mxArray.
void vec2mxArray(const vec &in, mxArray *out)
Convert vec to the matlab-format mxArray.
void bin2mxArray(const bin &in, mxArray *out)
Convert bin to the matlab-format mxArray.
svec mxArray2svec(const mxArray *in)
Convert the matlab-format mxArray to svec.
void string2mxArray(const std::string &in, mxArray *&out)
Convert string to the matlab-format mxArray.
cmat mxArray2cmat(const mxArray *in)
Convert the matlab-format mxArray to cmat.
void mxArray2Ccmat(const mxArray *in, double **out_real, double **out_imag)
Convert the matlab-format mxArray to C-format pointer to pointer to double (real and imaginary parts)
void bmat2mxArray(const bmat &in, mxArray *out)
Convert bmat to the matlab-format mxArray.
short mxArray2short(const mxArray *in)
Convert the matlab-format mxArray to short.
void mxArray2Cvec(const mxArray *in, double *out)
Convert the matlab-format mxArray to C-format pointer to double.
void Csmat2mxArray(short **in, mxArray *out)
Convert C-format pointer to pointer to short to matlab-format mxArray.
Include file for the IT++ base module.
Mat< bin > bmat
bin matrix