-
Notifications
You must be signed in to change notification settings - Fork 3
/
matrix.h
1311 lines (1124 loc) · 44.6 KB
/
matrix.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* External header for the libmx library.
*
* Copyright 1984-2018 The MathWorks, Inc.
* All Rights Reserved.
*/
#ifdef MDA_ARRAY_HPP_
#error Using MATLAB Data API with C Matrix API is not supported.
#endif
#if defined(_MSC_VER)
#pragma once
#endif
#if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 3))
#pragma once
#endif
#ifndef matrix_h
#define matrix_h
#include <stdlib.h>
#include <stddef.h>
#include "tmwtypes.h"
#ifdef __cplusplus
#define LIBMMWMATRIX_PUBLISHED_API_EXTERN_C extern "C"
#else
#define LIBMMWMATRIX_PUBLISHED_API_EXTERN_C extern
#endif
#define MW_FIRST_API_VERSION 700
#define R2017b 700
#define R2018a 800
#define R2018b 800
#define R2019a 800
#define R2019b 800
#define R201aa 800
#define R201ab 800
#define R201ba 800
#define R201bb 800
#define R201ca 800
#define R201cb 800
#define R201da 800
#define R201db 800
#define R201ea 800
#define R201eb 800
#define R201fa 800
#define R201fb 800
#define R2020a 800
#define R2020b 800
#define R2021a 800
#define R2021b 800
#define R2022a 800
#define MW_LATEST_API_VERSION 800
#define MW_REL2VER(A) A
#if defined(MX_COMPAT_32) || defined(MEX_DOUBLE_HANDLE)
#if defined(MATLAB_MEXCMD_RELEASE) || defined(MATLAB_MEXSRC_RELEASE)
/* Errors! Legacy knobs cannot be used with release-based hard knobs */
#if defined(MX_COMPAT_32) && defined(MATLAB_MEXCMD_RELEASE)
#error "MEX command option -R20XXx is incompatible with MX_COMPAT_32"
#endif
#if defined(MEX_DOUBLE_HANDLE) && defined(MATLAB_MEXCMD_RELEASE)
#error "MEX command option -R20XXx is incompatible with MEX_DOUBLE_HANDLE"
#endif
#if defined(MX_COMPAT_32) && defined(MATLAB_MEXSRC_RELEASE)
#error "Source code macro MATLAB_MEXSRC_RELEASE is incompatible with MX_COMPAT_32"
#endif
#if defined(MEX_DOUBLE_HANDLE) && defined(MATLAB_MEXSRC_RELEASE)
#error "Source code macro MATLAB_MEXSRC_RELEASE is incompatible with MEX_DOUBLE_HANDLE"
#endif
#else
/* Legacy knobs are defined */
#define MATLAB_TARGET_API_VERSION MW_FIRST_API_VERSION
#endif
#else /* defined(MX_COMPAT_32) || defined(MEX_DOUBLE_HANDLE) */
/* No Legacy knobs. Check release-based tag */
#if defined(MATLAB_MEXCMD_RELEASE)
#define MW_MEXCMD_VERSION MW_REL2VER(MATLAB_MEXCMD_RELEASE)
#if MW_MEXCMD_VERSION < MW_FIRST_API_VERSION
#error invalid MATLAB_MEXCMD_RELEASE definition
#endif
#endif
#if defined(MATLAB_MEXSRC_RELEASE)
#define MW_MEXSRC_VERSION MW_REL2VER(MATLAB_MEXSRC_RELEASE)
#if MW_MEXSRC_VERSION < MW_FIRST_API_VERSION
#error invalid MATLAB_MEXSRC_RELEASE definition
#endif
#endif
#if defined(MATLAB_DEFAULT_RELEASE)
#define MW_DEFAULT_VERSION MW_REL2VER(MATLAB_DEFAULT_RELEASE)
#if MW_DEFAULT_VERSION < MW_FIRST_API_VERSION
#error invalid MATLAB_DEFAULT_RELEASE definition
#endif
#endif
#if defined(MATLAB_MEXCMD_RELEASE) && defined(MATLAB_MEXSRC_RELEASE)
#if MW_MEXCMD_VERSION != MW_MEXSRC_VERSION
#error "MEX command option -R20XXx is incompatible with MATLAB_MEXSRC_RELEASE"
#endif
#endif
#if defined(MATLAB_MEXCMD_RELEASE) || defined(MATLAB_MEXSRC_RELEASE)
/* Check whether MEXCMD and MEXSRC release tags are compatible */
#if defined(MATLAB_MEXCMD_RELEASE)
#define MATLAB_TARGET_API_VERSION MW_MEXCMD_VERSION
#else
#define MATLAB_TARGET_API_VERSION MW_MEXSRC_VERSION
#endif
#else /* defined(MATLAB_MEXCMD_RELEASE) || defined(MATLAB_MEXSRC_RELEASE) */
#if defined(MATLAB_DEFAULT_RELEASE)
#define MATLAB_TARGET_API_VERSION MW_DEFAULT_VERSION
#else
/* None of the input macros are defined. Use LATEST */
#define MATLAB_TARGET_API_VERSION MW_LATEST_API_VERSION
#endif /* defined(MATLAB_DEFAULT_RELEASE) */
#endif /* defined(MATLAB_MEXCMD_RELEASE) || defined(MATLAB_MEXSRC_RELEASE) */
#endif /* defined(MX_COMPAT_32) || defined(MEX_DOUBLE_HANDLE) */
#if defined(TARGET_API_VERSION)
#if MATLAB_TARGET_API_VERSION != TARGET_API_VERSION
#error MATLAB_TARGET_API_VERSION != TARGET_API_VERSION
#endif
#else
#define TARGET_API_VERSION MATLAB_TARGET_API_VERSION
#endif
/**
* Forward declaration for mxArray
*/
typedef struct mxArray_tag mxArray;
/**
* MEX-file entry point type
*/
typedef void (*mxFunctionPtr)(int nlhs, mxArray *plhs[], int nrhs, mxArray *prhs[]);
/**
* Maximum mxArray name length
*/
#define mxMAXNAM TMW_NAME_LENGTH_MAX
/**
* Logical type
*/
typedef bool mxLogical;
/**
* Required for Unicode support in MATLAB
*/
typedef CHAR16_T mxChar;
/**
* mxArray classes.
*/
#if !defined(__cplusplus) || __cplusplus < 201103L || defined(SWIG)
typedef enum
#else
enum mxClassID : int
#endif
{
mxUNKNOWN_CLASS = 0,
mxCELL_CLASS,
mxSTRUCT_CLASS,
mxLOGICAL_CLASS,
mxCHAR_CLASS,
mxVOID_CLASS,
mxDOUBLE_CLASS,
mxSINGLE_CLASS,
mxINT8_CLASS,
mxUINT8_CLASS,
mxINT16_CLASS,
mxUINT16_CLASS,
mxINT32_CLASS,
mxUINT32_CLASS,
mxINT64_CLASS,
mxUINT64_CLASS,
mxFUNCTION_CLASS,
mxOPAQUE_CLASS,
mxOBJECT_CLASS,
#if defined(_LP64) || defined(_WIN64)
mxINDEX_CLASS = mxUINT64_CLASS
#else
mxINDEX_CLASS = mxUINT32_CLASS
#endif
}
#if !defined(__cplusplus) || __cplusplus < 201103L || defined(SWIG)
mxClassID
#endif
;
/**
* Indicates whether floating-point mxArrays are real or complex.
*/
typedef enum { mxREAL, mxCOMPLEX } mxComplexity;
/*
* MATRIX numeric real data types
*/
typedef double mxDouble;
typedef float mxSingle;
typedef int8_T mxInt8;
typedef uint8_T mxUint8;
typedef int16_T mxInt16;
typedef uint16_T mxUint16;
typedef int32_T mxInt32;
typedef uint32_T mxUint32;
typedef int64_T mxInt64;
typedef uint64_T mxUint64;
#if TARGET_API_VERSION >= 800
/*
* MATRIX numeric complex data types
*/
typedef struct { mxDouble real, imag; } mxComplexDouble;
typedef struct { mxSingle real, imag; } mxComplexSingle;
typedef struct { mxInt8 real, imag; } mxComplexInt8;
typedef struct { mxUint8 real, imag; } mxComplexUint8;
typedef struct { mxInt16 real, imag; } mxComplexInt16;
typedef struct { mxUint16 real, imag; } mxComplexUint16;
typedef struct { mxInt32 real, imag; } mxComplexInt32;
typedef struct { mxUint32 real, imag; } mxComplexUint32;
typedef struct { mxInt64 real, imag; } mxComplexInt64;
typedef struct { mxUint64 real, imag; } mxComplexUint64;
#endif /* TARGET_API_VERSION >= 800 */
#if defined(TARGET_API_VERSION)
#if !(TARGET_API_VERSION == 700 || TARGET_API_VERSION == 800)
#error invalid TARGET_VERSION_API definition
#elif defined(MEX_DOUBLE_HANDLE) && TARGET_API_VERSION != 700
#error It is illegal to use MEX_DOUBLE_HANDLE with linear versioning
#elif defined(MX_COMPAT_32) && TARGET_API_VERSION != 700
#error It is illegal to use MX_COMPAT_32 with linear versioning
#endif
#endif
#if !defined(TARGET_API_VERSION) || TARGET_API_VERSION == 700
/*
* PUBLISHED APIs with changes in MATLAB 7.3
*/
#if !defined(MX_COMPAT_32)
#define mxSetProperty mxSetProperty_730
#define mxGetProperty mxGetProperty_730
#define mxSetField mxSetField_730
#define mxSetFieldByNumber mxSetFieldByNumber_730
#define mxGetFieldByNumber mxGetFieldByNumber_730
#define mxGetField mxGetField_730
#define mxCreateStructMatrix mxCreateStructMatrix_730
#define mxCreateCellMatrix mxCreateCellMatrix_730
#define mxCreateCharMatrixFromStrings mxCreateCharMatrixFromStrings_730
#define mxGetString mxGetString_730
#define mxGetNumberOfDimensions mxGetNumberOfDimensions_730
#define mxGetDimensions mxGetDimensions_730
#define mxSetDimensions mxSetDimensions_730
#define mxSetIr mxSetIr_730
#define mxGetIr mxGetIr_730
#define mxSetJc mxSetJc_730
#define mxGetJc mxGetJc_730
#define mxCreateStructArray mxCreateStructArray_730
#define mxCreateCharArray mxCreateCharArray_730
#define mxCreateNumericArray mxCreateNumericArray_730
#define mxCreateCellArray mxCreateCellArray_730
#define mxCreateLogicalArray mxCreateLogicalArray_730
#define mxGetCell mxGetCell_730
#define mxSetCell mxSetCell_730
#define mxSetNzmax mxSetNzmax_730
#define mxSetN mxSetN_730
#define mxSetM mxSetM_730
#define mxGetNzmax mxGetNzmax_730
#define mxCreateDoubleMatrix mxCreateDoubleMatrix_730
#define mxCreateNumericMatrix mxCreateNumericMatrix_730
#define mxCreateLogicalMatrix mxCreateLogicalMatrix_730
#define mxCreateSparse mxCreateSparse_730
#define mxCreateSparseLogicalMatrix mxCreateSparseLogicalMatrix_730
#define mxGetNChars mxGetNChars_730
#define mxCreateStringFromNChars mxCreateStringFromNChars_730
#define mxCalcSingleSubscript mxCalcSingleSubscript_730
#define mxGetDimensions_fcn mxGetDimensions_730
#else /* MX_COMPAT_32 */
/*
* 32-bit compatibility APIs
*/
#define mxGetNumberOfDimensions mxGetNumberOfDimensions_700
#define mxGetDimensions mxGetDimensions_700
#define mxGetDimensions_fcn mxGetDimensions_700
#define mxGetIr mxGetIr_700
#define mxGetJc mxGetJc_700
#define mxGetCell mxGetCell_700
#define mxGetNzmax mxGetNzmax_700
#define mxSetNzmax mxSetNzmax_700
#define mxGetFieldByNumber mxGetFieldByNumber_700
#define mxSetProperty mxSetProperty_700
#define mxGetProperty mxGetProperty_700
#define mxSetField mxSetField_700
#define mxSetFieldByNumber mxSetFieldByNumber_700
#define mxGetField mxGetField_700
#define mxCreateStructMatrix mxCreateStructMatrix_700
#define mxCreateCellMatrix mxCreateCellMatrix_700
#define mxCreateCharMatrixFromStrings mxCreateCharMatrixFromStrings_700
#define mxGetString mxGetString_700
#define mxSetDimensions mxSetDimensions_700
#define mxSetIr mxSetIr_700
#define mxSetJc mxSetJc_700
#define mxCreateStructArray mxCreateStructArray_700
#define mxCreateCharArray mxCreateCharArray_700
#define mxCreateNumericArray mxCreateNumericArray_700
#define mxCreateCellArray mxCreateCellArray_700
#define mxCreateLogicalArray mxCreateLogicalArray_700
#define mxSetCell mxSetCell_700
#define mxSetN mxSetN_700
#define mxSetM mxSetM_700
#define mxCreateDoubleMatrix mxCreateDoubleMatrix_700
#define mxCreateNumericMatrix mxCreateNumericMatrix_700
#define mxCreateLogicalMatrix mxCreateLogicalMatrix_700
#define mxCreateSparse mxCreateSparse_700
#define mxCreateSparseLogicalMatrix mxCreateSparseLogicalMatrix_700
#define mxGetNChars mxGetNChars_700
#define mxCreateStringFromNChars mxCreateStringFromNChars_700
#define mxCalcSingleSubscript mxCalcSingleSubscript_700
#endif /* #ifdef MX_COMPAT_32 */
#elif TARGET_API_VERSION == 800
#define mxMalloc mxMalloc_800
#define mxCalloc mxCalloc_800
#define mxRealloc mxRealloc_800
#define mxGetM mxGetM_800
#define mxGetN mxGetN_800
#define mxGetNumberOfElements mxGetNumberOfElements_800
#define mxFree mxFree_800
#define mxGetEps mxGetEps_800
#define mxGetInf mxGetInf_800
#define mxGetFieldNameByNumber mxGetFieldNameByNumber_800
#define mxGetClassID mxGetClassID_800
#define mxIsNumeric mxIsNumeric_800
#define mxIsCell mxIsCell_800
#define mxIsLogical mxIsLogical_800
#define mxIsChar mxIsChar_800
#define mxIsStruct mxIsStruct_800
#define mxIsSparse mxIsSparse_800
#define mxIsDouble mxIsDouble_800
#define mxIsSingle mxIsSingle_800
#define mxIsInt8 mxIsInt8_800
#define mxIsUint8 mxIsUint8_800
#define mxIsInt16 mxIsInt16_800
#define mxIsUint16 mxIsUint16_800
#define mxIsInt32 mxIsInt32_800
#define mxIsUint32 mxIsUint32_800
#define mxIsInt64 mxIsInt64_800
#define mxIsUint64 mxIsUint64_800
#define mxIsFromGlobalWS mxIsFromGlobalWS_800
#define mxIsEmpty mxIsEmpty_800
#define mxGetFieldNumber mxGetFieldNumber_800
#define mxGetNumberOfFields mxGetNumberOfFields_800
#define mxGetClassName mxGetClassName_800
#define mxIsClass mxIsClass_800
#define mxDestroyArray mxDestroyArray_800
#define mxCreateDoubleScalar mxCreateDoubleScalar_800
#define mxCreateString mxCreateString_800
#define mxAddField mxAddField_800
#define mxRemoveField mxRemoveField_800
#define mxGetNaN mxGetNaN_800
#define mxIsFinite mxIsFinite_800
#define mxIsInf mxIsInf_800
#define mxIsNaN mxIsNaN_800
#define mxIsScalar mxIsScalar_800
#define mxIsOpaque mxIsOpaque_800
#define mxIsFunctionHandle mxIsFunctionHandle_800
#define mxIsObject mxIsObject_800
#define mxGetChars mxGetChars_800
#define mxGetUserBits mxGetUserBits_800
#define mxSetUserBits mxSetUserBits_800
#define mxSetFromGlobalWS mxSetFromGlobalWS_800
#define mxCreateUninitNumericMatrix mxCreateUninitNumericMatrix_800
#define mxCreateUninitNumericArray mxCreateUninitNumericArray_800
#define mxGetLogicals mxGetLogicals_800
#define mxCreateLogicalScalar mxCreateLogicalScalar_800
#define mxIsLogicalScalar mxIsLogicalScalar_800
#define mxIsLogicalScalarTrue mxIsLogicalScalarTrue_800
#define mxArrayToString mxArrayToString_800
#define mxArrayToUTF8String mxArrayToUTF8String_800
#define mxSetClassName mxSetClassName_800
#define mxGetNumberOfDimensions mxGetNumberOfDimensions_800
#define mxGetDimensions mxGetDimensions_800
#define mxGetIr mxGetIr_800
#define mxGetJc mxGetJc_800
#define mxGetNzmax mxGetNzmax_800
#define mxGetFieldByNumber mxGetFieldByNumber_800
#define mxGetCell mxGetCell_800
#define mxSetIr mxSetIr_800
#define mxSetJc mxSetJc_800
#define mxCalcSingleSubscript mxCalcSingleSubscript_800
#define mxSetCell mxSetCell_800
#define mxSetFieldByNumber mxSetFieldByNumber_800
#define mxGetField mxGetField_800
#define mxSetField mxSetField_800
#define mxGetProperty mxGetProperty_800
#define mxSetProperty mxSetProperty_800
#define mxCreateNumericMatrix mxCreateNumericMatrix_800
#define mxCreateNumericArray mxCreateNumericArray_800
#define mxCreateCharArray mxCreateCharArray_800
#define mxCreateDoubleMatrix mxCreateDoubleMatrix_800
#define mxCreateSparse mxCreateSparse_800
#define mxGetString mxGetString_800
#define mxCreateCharMatrixFromStrings mxCreateCharMatrixFromStrings_800
#define mxCreateCellMatrix mxCreateCellMatrix_800
#define mxCreateCellArray mxCreateCellArray_800
#define mxCreateStructMatrix mxCreateStructMatrix_800
#define mxCreateStructArray mxCreateStructArray_800
#define mxCreateLogicalArray mxCreateLogicalArray_800
#define mxCreateLogicalMatrix mxCreateLogicalMatrix_800
#define mxCreateSparseLogicalMatrix mxCreateSparseLogicalMatrix_800
#define mxCreateStringFromNChars mxCreateStringFromNChars_800
#define mxGetNChars mxGetNChars_800
#define mxSetM mxSetM_800
#define mxSetN mxSetN_800
#define mxSetDimensions mxSetDimensions_800
#define mxSetNzmax mxSetNzmax_800
#define mxGetData mxGetData_800
#define mxSetData mxSetData_800
#define mxIsComplex mxIsComplex_800
#define mxGetScalar mxGetScalar_800
#define mxGetPr mxGetPr_800
#define mxSetPr mxSetPr_800
#define mxGetElementSize mxGetElementSize_800
#define mxDuplicateArray mxDuplicateArray_800
#define mxGetDoubles mxGetDoubles_800
#define mxSetDoubles mxSetDoubles_800
#define mxGetComplexDoubles mxGetComplexDoubles_800
#define mxSetComplexDoubles mxSetComplexDoubles_800
#define mxGetSingles mxGetSingles_800
#define mxSetSingles mxSetSingles_800
#define mxGetComplexSingles mxGetComplexSingles_800
#define mxSetComplexSingles mxSetComplexSingles_800
#define mxGetInt8s mxGetInt8s_800
#define mxSetInt8s mxSetInt8s_800
#define mxGetComplexInt8s mxGetComplexInt8s_800
#define mxSetComplexInt8s mxSetComplexInt8s_800
#define mxGetUint8s mxGetUint8s_800
#define mxSetUint8s mxSetUint8s_800
#define mxGetComplexUint8s mxGetComplexUint8s_800
#define mxSetComplexUint8s mxSetComplexUint8s_800
#define mxGetInt16s mxGetInt16s_800
#define mxSetInt16s mxSetInt16s_800
#define mxGetComplexInt16s mxGetComplexInt16s_800
#define mxSetComplexInt16s mxSetComplexInt16s_800
#define mxGetUint16s mxGetUint16s_800
#define mxSetUint16s mxSetUint16s_800
#define mxGetComplexUint16s mxGetComplexUint16s_800
#define mxSetComplexUint16s mxSetComplexUint16s_800
#define mxGetInt32s mxGetInt32s_800
#define mxSetInt32s mxSetInt32s_800
#define mxGetComplexInt32s mxGetComplexInt32s_800
#define mxSetComplexInt32s mxSetComplexInt32s_800
#define mxGetUint32s mxGetUint32s_800
#define mxSetUint32s mxSetUint32s_800
#define mxGetComplexUint32s mxGetComplexUint32s_800
#define mxSetComplexUint32s mxSetComplexUint32s_800
#define mxGetInt64s mxGetInt64s_800
#define mxSetInt64s mxSetInt64s_800
#define mxGetComplexInt64s mxGetComplexInt64s_800
#define mxSetComplexInt64s mxSetComplexInt64s_800
#define mxGetUint64s mxGetUint64s_800
#define mxSetUint64s mxSetUint64s_800
#define mxGetComplexUint64s mxGetComplexUint64s_800
#define mxSetComplexUint64s mxSetComplexUint64s_800
#define mxMakeArrayReal mxMakeArrayReal_800
#define mxMakeArrayComplex mxMakeArrayComplex_800
#define mxGetPi mxGetPiIsDeprecated
#define mxGetImagData mxGetImagDataIsDeprecated
#define mxSetImagData mxSetImagDataIsDeprecated
#define mxSetPi mxSetPiIsDeprecated
#define mxCreateSharedDataCopy mxCreateSharedDataCopyIsDeprecated
#define mxCreateUninitDoubleMatrix mxCreateUninitDoubleMatrixIsDeprecated
#define mxFastZeros mxFastZerosIsDeprecated
#define mxUnreference mxUnreferenceIsDeprecated
#define mxUnshareArray mxUnshareArrayIsDeprecated
#define mxGetPropertyShared mxGetPropertySharedIsDeprecated
#define mxSetPropertyShared mxSetPropertySharedIsDeprecated
#endif /* TARGET_API_VERSION */
/*
* allocate memory, notifying registered listener
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C void *mxMalloc(size_t n /* number of bytes */
);
/*
* allocate cleared memory, notifying registered listener.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C void *mxCalloc(size_t n, /* number of objects */
size_t size /* size of objects */
);
/*
* free memory, notifying registered listener.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C void mxFree(void *ptr) /* pointer to memory to be freed */;
/*
* reallocate memory, notifying registered listener.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C void *mxRealloc(void *ptr, size_t size);
/*
* Get number of dimensions in array
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C mwSize mxGetNumberOfDimensions(const mxArray *pa);
/*
* Get pointer to dimension array
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C const mwSize *mxGetDimensions(const mxArray *pa);
/*
* Get row dimension
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C size_t mxGetM(const mxArray *pa);
/*
* Get row data pointer for sparse numeric array
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C mwIndex *mxGetIr(const mxArray *pa);
/*
* Get column data pointer for sparse numeric array
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C mwIndex *mxGetJc(const mxArray *pa);
/*
* Get maximum nonzero elements for sparse numeric array
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C mwSize mxGetNzmax(const mxArray *pa);
/*
* Set maximum nonzero elements for numeric array
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C void mxSetNzmax(mxArray *pa, mwSize nzmax);
/*
* Return pointer to the nth field name
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C const char *mxGetFieldNameByNumber(const mxArray *pa, int n);
/*
* Return a pointer to the contents of the named field for
* the ith element (zero based).
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C mxArray *
mxGetFieldByNumber(const mxArray *pa, mwIndex i, int fieldnum);
/*
* Get a pointer to the specified cell element.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C mxArray *mxGetCell(const mxArray *pa, mwIndex i);
/*
* Return the class (category) of data that the array holds.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C mxClassID mxGetClassID(const mxArray *pa);
/*
* Get pointer to data
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C void *mxGetData(const mxArray *pa /* pointer to array */
);
/*
* Set pointer to data
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C void mxSetData(mxArray *pa, /* pointer to array */
void *newdata /* pointer to data */
);
/*
* Determine whether the specified array contains numeric (as opposed
* to cell or struct) data.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C bool mxIsNumeric(const mxArray *pa);
/*
* Determine whether the given array is a cell array.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C bool mxIsCell(const mxArray *pa);
/*
* Determine whether the given array's logical flag is on.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C bool mxIsLogical(const mxArray *pa);
/*
* Determine whether the given array's scalar flag is on.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C bool mxIsScalar(const mxArray *pa);
/*
* Determine whether the given array contains character data.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C bool mxIsChar(const mxArray *pa);
/*
* Determine whether the given array is a structure array.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C bool mxIsStruct(const mxArray *pa);
/*
* Determine whether the given array is an opaque array.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C bool mxIsOpaque(const mxArray *pa);
/*
* Returns true if specified array is a function object.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C bool mxIsFunctionHandle(const mxArray *pa);
/*
* This function is deprecated and is preserved only for backward compatibility.
* DO NOT USE if possible.
* Is array user defined MATLAB v5 object
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C bool mxIsObject(const mxArray *pa /* pointer to array */
);
#if !defined(TARGET_API_VERSION) || (TARGET_API_VERSION == 700)
/*
* Get imaginary data pointer for numeric array
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C void *mxGetImagData(const mxArray *pa /* pointer to array */
);
/*
* Set imaginary data pointer for numeric array
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C void
mxSetImagData(mxArray *pa, /* pointer to array */
void *newdata /* imaginary data array pointer */
);
#endif
/*
* Determine whether the given array contains complex data.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C bool mxIsComplex(const mxArray *pa);
/*
* Determine whether the given array is a sparse (as opposed to full).
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C bool mxIsSparse(const mxArray *pa);
/*
* Determine whether the specified array represents its data as
* double-precision floating-point numbers.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C bool mxIsDouble(const mxArray *pa);
/*
* Determine whether the specified array represents its data as
* single-precision floating-point numbers.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C bool mxIsSingle(const mxArray *pa);
/*
* Determine whether the specified array represents its data as
* signed 8-bit integers.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C bool mxIsInt8(const mxArray *pa);
/*
* Determine whether the specified array represents its data as
* unsigned 8-bit integers.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C bool mxIsUint8(const mxArray *pa);
/*
* Determine whether the specified array represents its data as
* signed 16-bit integers.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C bool mxIsInt16(const mxArray *pa);
/*
* Determine whether the specified array represents its data as
* unsigned 16-bit integers.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C bool mxIsUint16(const mxArray *pa);
/*
* Determine whether the specified array represents its data as
* signed 32-bit integers.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C bool mxIsInt32(const mxArray *pa);
/*
* Determine whether the specified array represents its data as
* unsigned 32-bit integers.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C bool mxIsUint32(const mxArray *pa);
/*
* Determine whether the specified array represents its data as
* signed 64-bit integers.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C bool mxIsInt64(const mxArray *pa);
/*
* Determine whether the specified array represents its data as
* unsigned 64-bit integers.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C bool mxIsUint64(const mxArray *pa);
/*
* Get number of elements in array
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C size_t mxGetNumberOfElements(
const mxArray *pa /* pointer to array */
);
#if !defined(TARGET_API_VERSION) || (TARGET_API_VERSION == 700)
/*
* Get imaginary data pointer for numeric array
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C double *mxGetPi(const mxArray *pa /* pointer to array */
);
/*
* Set imaginary data pointer for numeric array
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C void mxSetPi(mxArray *pa, /* pointer to array */
double *pi /* imaginary data array pointer */
);
#endif
/*
* Get string array data
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C mxChar *mxGetChars(const mxArray *pa /* pointer to array */
);
/*
* Get 8 bits of user data stored in the mxArray header. NOTE: The state
* of these bits is not guaranteed to be preserved after API function
* calls.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C int mxGetUserBits(const mxArray *pa /* pointer to array */
);
/*
* Set 8 bits of user data stored in the mxArray header. NOTE: The state
* of these bits is not guaranteed to be preserved after API function
* calls.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C void mxSetUserBits(mxArray *pa, /* pointer to array */
int value);
/*
* Get the real component of the specified array's first data element.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C double mxGetScalar(const mxArray *pa);
/*
* Inform Watcom compilers that scalar double return values
* will be in the FPU register.
*/
#ifdef __WATCOMC__
#pragma aux mxGetScalar value[8087];
#endif
/*
* Is the isFromGlobalWorkspace bit set?
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C bool mxIsFromGlobalWS(const mxArray *pa);
/*
* Set the isFromGlobalWorkspace bit.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C void mxSetFromGlobalWS(mxArray *pa, bool global);
/*
* Set row dimension
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C void mxSetM(mxArray *pa, mwSize m);
/*
* Get column dimension
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C size_t mxGetN(const mxArray *pa);
/*
* Is array empty
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C bool mxIsEmpty(const mxArray *pa /* pointer to array */
);
/*
* Get the index to the named field.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C int mxGetFieldNumber(const mxArray *pa, const char *name);
/*
* Set row data pointer for sparse numeric array
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C void mxSetIr(mxArray *pa, mwIndex *newir);
/*
* Set column data pointer for sparse numeric array
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C void mxSetJc(mxArray *pa, mwIndex *newjc);
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C double *mxGetPr(const mxArray *pa);
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C void mxSetPr(mxArray *pa, double *newdata);
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C size_t mxGetElementSize(const mxArray *pa);
/*
* Return the offset (in number of elements) from the beginning of
* the array to a given subscript.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C mwIndex mxCalcSingleSubscript(const mxArray *pa,
mwSize nsubs,
const mwIndex *subs);
/*
* Get number of structure fields in array
* Returns 0 if mxArray is non-struct.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C int mxGetNumberOfFields(const mxArray *pa /* pointer to array */
);
/*
* Set an element in a cell array to the specified value.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C void mxSetCell(mxArray *pa, mwIndex i, mxArray *value);
/*
* Set pa[i][fieldnum] = value
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C void
mxSetFieldByNumber(mxArray *pa, mwIndex i, int fieldnum, mxArray *value);
/*
* Return a pointer to the contents of the named field for the ith
* element (zero based). Returns NULL on no such field or if the
* field itself is NULL
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C mxArray *
mxGetField(const mxArray *pa, mwIndex i, const char *fieldname);
/*
* Sets the contents of the named field for the ith element (zero based).
* The input 'value' is stored in the input array 'pa' - no copy is made.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C void
mxSetField(mxArray *pa, mwIndex i, const char *fieldname, mxArray *value);
/*
* mxGetProperty returns the value of a property for a given object and index.
* The property must be public.
*
* If the given property name doesn't exist, or isn't public, or the object isn't
* the right type, then mxGetProperty returns NULL.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C mxArray *
mxGetProperty(const mxArray *pa, const mwIndex i, const char *propname);
/*
* mxSetProperty sets the value of a property for a given object and index.
* The property must be public.
*
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C void
mxSetProperty(mxArray *pa, mwIndex i, const char *propname, const mxArray *value);
/*
* Return the name of an array's class.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C const char *mxGetClassName(const mxArray *pa);
/*
* Determine whether an array is a member of the specified class.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C bool mxIsClass(const mxArray *pa, const char *name);
/*
* Create a numeric matrix and initialize all its data elements to 0.
* In standalone mode, out-of-memory will mean a NULL pointer is returned.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C mxArray *
mxCreateNumericMatrix(mwSize m, mwSize n, mxClassID classid, mxComplexity flag);
/*
* Create an uninitialized numeric matrix.
* The resulting array must be freed with mxDestroyArray.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C mxArray *
mxCreateUninitNumericMatrix(size_t m, size_t n, mxClassID classid, mxComplexity flag);
/*
* Create an uninitialized numeric array.
* The resulting array must be freed with mxDestroyArray.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C mxArray *
mxCreateUninitNumericArray(size_t ndim, size_t *dims, mxClassID classid, mxComplexity flag);
/*
* Set column dimension
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C void mxSetN(mxArray *pa, mwSize n);
/*
* Set dimension array and number of dimensions. Returns 0 on success and 1
* if there was not enough memory available to reallocate the dimensions array.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C int
mxSetDimensions(mxArray *pa, const mwSize *pdims, mwSize ndims);
/*
* mxArray destructor
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C void mxDestroyArray(mxArray *pa);
/*
* Create a numeric array and initialize all its data elements to 0.
*
* As with mxCreateNumericMatrix, in a standalone application,
* out-of-memory will mean a NULL pointer is returned.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C mxArray *
mxCreateNumericArray(mwSize ndim, const mwSize *dims, mxClassID classid, mxComplexity flag);
/*
* Create an N-Dimensional array to hold string data;
* initialize all elements to 0.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C mxArray *mxCreateCharArray(mwSize ndim, const mwSize *dims);
/*
* Create a two-dimensional array to hold double-precision
* floating-point data; initialize each data element to 0.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C mxArray *
mxCreateDoubleMatrix(mwSize m, mwSize n, mxComplexity flag);
/*
* Get a properly typed pointer to the elements of a logical array.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C mxLogical *mxGetLogicals(const mxArray *pa);
/*
* Create a logical array and initialize its data elements to false.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C mxArray *mxCreateLogicalArray(mwSize ndim, const mwSize *dims);
/*
* Create a two-dimensional array to hold logical data and
* initialize each data element to false.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C mxArray *mxCreateLogicalMatrix(mwSize m, mwSize n);
/*
* Create a logical scalar mxArray having the specified value.
*/
LIBMMWMATRIX_PUBLISHED_API_EXTERN_C mxArray *mxCreateLogicalScalar(bool value);