2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2013 - Scilab Enterprises - Calixte DENIZET
5 * Copyright (C) 2012 - 2016 - Scilab Enterprises
7 * This file is hereby licensed under the terms of the GNU GPL v2.0,
8 * pursuant to article 5.3.4 of the CeCILL v.2.1.
9 * This file was originally licensed under the terms of the CeCILL v2.1,
10 * and continues to be available under such terms.
11 * For more information, see the COPYING file which you should have received
12 * along with this program.
14 * Please note that piece of code will be rewrited for the Scilab 6 family
15 * However, the API (profile of the functions in the header files) will be
16 * still available and supported in Scilab 6.
24 #include "polynom.hxx"
25 #include "gatewaystruct.hxx"
29 #include "api_scilab.h"
30 #include "api_internal_common.h"
31 #include "api_internal_double.h"
32 #include "localization.h"
34 #include "call_scilab.h"
37 int isHypermatType(void* _pvCtx, int* _piAddress)
39 types::InternalType* it = (types::InternalType*)_piAddress;
40 if (it->isGenericType() == false)
45 types::GenericType* gt = it->getAs<types::GenericType>();
46 if (gt->getDims() < 3)
54 int isHypermatComplex(void* _pvCtx, int* _piAddress)
56 types::InternalType* it = (types::InternalType*)_piAddress;
57 if (it->isGenericType() == false)
62 types::GenericType* gt = it->getAs<types::GenericType>();
71 SciErr getHypermatType(void *_pvCtx, int *_piAddress, int *_piType)
73 return getVarType(_pvCtx, _piAddress, _piType);
76 SciErr getHypermatOfIntegerPrecision(void *_pvCtx, int *_piAddress, int *_piPrecision)
78 return getMatrixOfIntegerPrecision(_pvCtx, _piAddress, _piPrecision);
81 SciErr getHypermatDimensions(void *_pvCtx, int *_piAddress, int **_dims, int *_ndims)
83 SciErr sciErr = sciErrInit();
84 types::InternalType* it = (types::InternalType*)_piAddress;
85 if (it->isGenericType() == false)
87 addErrorMessage(&sciErr, API_ERROR_NOT_MATRIX_TYPE, _("%s: matrix argument expected"), "getHypermatDimensions");
91 types::GenericType* gt = it->getAs<types::GenericType>();
92 *_ndims = gt->getDims();
93 *_dims = gt->getDimsArray();
97 static int getHypermatEntries(void* _pvCtx, int* _piAddress, void** _piEntriesAddress)
99 types::InternalType* it = (types::InternalType*)_piAddress;
100 if (it->isGenericType() == false)
105 switch (it->getType())
107 case types::InternalType::ScilabDouble:
109 *_piEntriesAddress = it->getAs<types::Double>();
112 case types::InternalType::ScilabBool:
114 *_piEntriesAddress = it->getAs<types::Bool>();
117 case types::InternalType::ScilabString:
119 *_piEntriesAddress = it->getAs<types::String>();
122 case types::InternalType::ScilabPolynom:
124 *_piEntriesAddress = it->getAs<types::Polynom>();
127 case types::InternalType::ScilabInt8:
129 *_piEntriesAddress = it->getAs<types::Int8>();
132 case types::InternalType::ScilabInt16:
134 *_piEntriesAddress = it->getAs<types::Int16>();
137 case types::InternalType::ScilabInt32:
139 *_piEntriesAddress = it->getAs<types::Int32>();
142 case types::InternalType::ScilabInt64:
144 *_piEntriesAddress = it->getAs<types::Int64>();
147 case types::InternalType::ScilabUInt8:
149 *_piEntriesAddress = it->getAs<types::UInt8>();
152 case types::InternalType::ScilabUInt16:
154 *_piEntriesAddress = it->getAs<types::UInt16>();
157 case types::InternalType::ScilabUInt32:
159 *_piEntriesAddress = it->getAs<types::UInt32>();
162 case types::InternalType::ScilabUInt64:
164 *_piEntriesAddress = it->getAs<types::UInt64>();
169 *_piEntriesAddress = NULL;
177 SciErr getHypermatOfDouble(void* _pvCtx, int* _piAddress, int **_dims, int *_ndims, double** _pdblReal)
179 SciErr sciErr = sciErrInit();
180 void* entries = NULL;
182 int ret = getHypermatEntries(_pvCtx, _piAddress, &entries);
183 if (ret || entries == NULL || ((types::InternalType*)entries)->isDouble() == false)
185 addErrorMessage(&sciErr, API_ERROR_GET_DOUBLE, _("%s: Unable to get argument #%d"), "getHypermatOfDouble", getRhsFromAddress(_pvCtx, _piAddress));
189 types::Double* d = (types::Double*)entries;
190 *_dims = d->getDimsArray();
191 *_ndims = d->getDims();
192 *_pdblReal = d->get();
196 SciErr getComplexHypermatOfDouble(void* _pvCtx, int* _piAddress, int **_dims, int *_ndims, double** _pdblReal, double** _pdblImg)
198 SciErr sciErr = sciErrInit();
199 void* entries = NULL;
201 int ret = getHypermatEntries(_pvCtx, _piAddress, &entries);
202 if (ret || entries == NULL || ((types::InternalType*)entries)->isDouble() == false)
204 addErrorMessage(&sciErr, API_ERROR_GET_DOUBLE, _("%s: Unable to get argument #%d"), "getHypermatOfDouble", getRhsFromAddress(_pvCtx, _piAddress));
208 types::Double* d = (types::Double*)entries;
209 *_dims = d->getDimsArray();
210 *_ndims = d->getDims();
211 *_pdblReal = d->get();
212 *_pdblImg = d->getImg();
216 SciErr getHypermatPolyVariableName(void* _pvCtx, int* _piAddress, char* _pstVarName, int* _piVarNameLen)
218 SciErr sciErr = sciErrInit();
219 void * entries = NULL;
221 int ret = getHypermatEntries(_pvCtx, _piAddress, &entries);
223 if (ret || entries == NULL || ((types::InternalType*)entries)->isPoly() == false)
225 addErrorMessage(&sciErr, API_ERROR_INVALID_POINTER, _("%s: Invalid argument address"), "getHypermatPolyVariableName");
229 types::Polynom* p = (types::Polynom*)entries;
230 std::wstring var = p->getVariableName();
232 char* varname = wide_string_to_UTF8(var.data());
233 *_piVarNameLen = static_cast<int>(strlen(varname));
237 strcpy(_pstVarName, varname);
244 SciErr getHypermatOfPoly(void* _pvCtx, int* _piAddress, int **_dims, int *_ndims, int* _piNbCoef, double** _pdblReal)
246 SciErr sciErr = sciErrInit();
247 void * entries = NULL;
249 int ret = getHypermatEntries(_pvCtx, _piAddress, &entries);
251 if (ret || entries == NULL || ((types::InternalType*)entries)->isPoly() == false)
253 addErrorMessage(&sciErr, API_ERROR_INVALID_POINTER, _("%s: Invalid argument address"), "getHypermatOfPoly");
257 types::Polynom* p = (types::Polynom*)entries;
258 *_dims = p->getDimsArray();
259 *_ndims = p->getDims();
261 if (_piNbCoef == NULL)
266 p->getSizes(_piNbCoef);
268 if (_pdblReal == NULL)
273 int size = p->getSize();
274 types::SinglePoly** s = p->get();
276 for (int i = 0; i < size; i++)
278 memcpy(_pdblReal[i], s[i]->get(), sizeof(double) * s[i]->getSize());
284 SciErr getComplexHypermatOfPoly(void* _pvCtx, int* _piAddress, int **_dims, int *_ndims, int* _piNbCoef, double** _pdblReal, double** _pdblImg)
286 SciErr sciErr = sciErrInit();
287 void * entries = NULL;
289 int ret = getHypermatEntries(_pvCtx, _piAddress, &entries);
291 if (ret || entries == NULL || ((types::InternalType*)entries)->isPoly() == false)
293 addErrorMessage(&sciErr, API_ERROR_INVALID_POINTER, _("%s: Invalid argument address"), "getComplexHypermatOfPoly");
297 types::Polynom* p = (types::Polynom*)entries;
299 if (p->isComplex() == false)
301 addErrorMessage(&sciErr, API_ERROR_INVALID_COMPLEXITY, _("%s: Bad call to get a non complex matrix"), "getComplexHypermatOfPoly");
305 *_dims = p->getDimsArray();
306 *_ndims = p->getDims();
308 if (_piNbCoef == NULL)
313 p->getSizes(_piNbCoef);
315 if (_pdblReal == NULL)
320 int size = p->getSize();
321 types::SinglePoly** s = p->get();
323 for (int i = 0; i < size; i++)
325 memcpy(_pdblReal[i], s[i]->get(), sizeof(double) * s[i]->getSize());
326 memcpy(_pdblImg[i], s[i]->getImg(), sizeof(double) * s[i]->getSize());
332 SciErr getHypermatOfString(void* _pvCtx, int* _piAddress, int **_dims, int *_ndims, int* _piLength, char** _pstStrings)
334 SciErr sciErr = sciErrInit();
335 void * entries = NULL;
337 int ret = getHypermatEntries(_pvCtx, _piAddress, &entries);
339 if (ret || entries == NULL || ((types::InternalType*)entries)->isString() == false)
341 addErrorMessage(&sciErr, API_ERROR_INVALID_POINTER, _("%s: Invalid argument address"), "getHypermatOfString");
345 types::String* p = (types::String*)entries;
346 *_dims = p->getDimsArray();
347 *_ndims = p->getDims();
348 int size = p->getSize();
350 if (_piLength == NULL)
356 if (_pstStrings == NULL || *_pstStrings == NULL)
358 wchar_t** s = p->get();
359 for (int i = 0; i < size; i++)
361 char* c = wide_string_to_UTF8(s[i]);
362 _piLength[i] = (int)strlen(c);
368 wchar_t** s = p->get();
369 for (int i = 0; i < size; i++)
371 if (_pstStrings[i] == NULL)
373 addErrorMessage(&sciErr, API_ERROR_INVALID_SUBSTRING_POINTER, _("%s: Invalid argument address"), "getHypermatOfString");
377 char* c = wide_string_to_UTF8(s[i]);
378 strcpy(_pstStrings[i], c);
386 SciErr getHypermatOfWideString(void* _pvCtx, int* _piAddress, int **_dims, int *_ndims, int* _piLength, wchar_t** _pwstStrings)
388 SciErr sciErr = sciErrInit();
389 void * entries = NULL;
391 int ret = getHypermatEntries(_pvCtx, _piAddress, &entries);
393 if (ret || entries == NULL || ((types::InternalType*)entries)->isString() == false)
395 addErrorMessage(&sciErr, API_ERROR_INVALID_POINTER, _("%s: Invalid argument address"), "getHypermatOfWideString");
399 types::String* p = (types::String*)entries;
400 *_dims = p->getDimsArray();
401 *_ndims = p->getDims();
402 int size = p->getSize();
404 if (_piLength == NULL)
410 if (_pwstStrings == NULL || *_pwstStrings == NULL)
412 wchar_t** s = p->get();
413 for (int i = 0; i < size; i++)
415 _piLength[i] = (int)wcslen(s[i]);
420 wchar_t** s = p->get();
421 for (int i = 0; i < size; i++)
423 if (_pwstStrings[i] == NULL)
425 addErrorMessage(&sciErr, API_ERROR_INVALID_SUBSTRING_POINTER, _("%s: Invalid argument address"), "getHypermatOfWideString");
429 wcscpy(_pwstStrings[i], s[i]);
436 SciErr getHypermatOfInteger8(void* _pvCtx, int* _piAddress, int **_dims, int *_ndims, char** _pcData8)
438 SciErr sciErr = sciErrInit();
439 void * entries = NULL;
441 int ret = getHypermatEntries(_pvCtx, _piAddress, &entries);
443 if (ret || entries == NULL || ((types::InternalType*)entries)->isInt8() == false)
445 addErrorMessage(&sciErr, API_ERROR_INVALID_POINTER, _("%s: Invalid argument address"), "getHypermatOfInteger8");
449 types::Int8* p = (types::Int8*)entries;
450 *_dims = p->getDimsArray();
451 *_ndims = p->getDims();
452 *_pcData8 = p->get();
456 SciErr getHypermatOfUnsignedInteger8(void* _pvCtx, int* _piAddress, int **_dims, int *_ndims, unsigned char** _pucData8)
458 SciErr sciErr = sciErrInit();
459 void * entries = NULL;
461 int ret = getHypermatEntries(_pvCtx, _piAddress, &entries);
463 if (ret || entries == NULL || ((types::InternalType*)entries)->isUInt8() == false)
465 addErrorMessage(&sciErr, API_ERROR_INVALID_POINTER, _("%s: Invalid argument address"), "getHypermatOfUnsignedInteger8");
469 types::UInt8* p = (types::UInt8*)entries;
470 *_dims = p->getDimsArray();
471 *_ndims = p->getDims();
472 *_pucData8 = p->get();
476 SciErr getHypermatOfInteger16(void* _pvCtx, int* _piAddress, int **_dims, int *_ndims, short** _psData16)
478 SciErr sciErr = sciErrInit();
479 void * entries = NULL;
481 int ret = getHypermatEntries(_pvCtx, _piAddress, &entries);
483 if (ret || entries == NULL || ((types::InternalType*)entries)->isInt16() == false)
485 addErrorMessage(&sciErr, API_ERROR_INVALID_POINTER, _("%s: Invalid argument address"), "getHypermatOfInteger16");
489 types::Int16* p = (types::Int16*)entries;
490 *_dims = p->getDimsArray();
491 *_ndims = p->getDims();
492 *_psData16 = p->get();
496 SciErr getHypermatOfUnsignedInteger16(void* _pvCtx, int* _piAddress, int **_dims, int *_ndims, unsigned short** _pusData16)
498 SciErr sciErr = sciErrInit();
499 void * entries = NULL;
501 int ret = getHypermatEntries(_pvCtx, _piAddress, &entries);
503 if (ret || entries == NULL || ((types::InternalType*)entries)->isUInt16() == false)
505 addErrorMessage(&sciErr, API_ERROR_INVALID_POINTER, _("%s: Invalid argument address"), "getHypermatOfUnsignedInteger16");
509 types::UInt16* p = (types::UInt16*)entries;
510 *_dims = p->getDimsArray();
511 *_ndims = p->getDims();
512 *_pusData16 = p->get();
516 SciErr getHypermatOfInteger32(void* _pvCtx, int* _piAddress, int **_dims, int *_ndims, int** _piData32)
518 SciErr sciErr = sciErrInit();
519 void * entries = NULL;
521 int ret = getHypermatEntries(_pvCtx, _piAddress, &entries);
523 if (ret || entries == NULL || ((types::InternalType*)entries)->isInt32() == false)
525 addErrorMessage(&sciErr, API_ERROR_INVALID_POINTER, _("%s: Invalid argument address"), "getHypermatOfInteger32");
529 types::Int32* p = (types::Int32*)entries;
530 *_dims = p->getDimsArray();
531 *_ndims = p->getDims();
532 *_piData32 = p->get();
536 SciErr getHypermatOfUnsignedInteger32(void* _pvCtx, int* _piAddress, int **_dims, int *_ndims, unsigned int** _puiData32)
538 SciErr sciErr = sciErrInit();
539 void * entries = NULL;
541 int ret = getHypermatEntries(_pvCtx, _piAddress, &entries);
543 if (ret || entries == NULL || ((types::InternalType*)entries)->isUInt32() == false)
545 addErrorMessage(&sciErr, API_ERROR_INVALID_POINTER, _("%s: Invalid argument address"), "getHypermatOfUnsignedInteger32");
549 types::UInt32* p = (types::UInt32*)entries;
550 *_dims = p->getDimsArray();
551 *_ndims = p->getDims();
552 *_puiData32 = p->get();
556 SciErr getHypermatOfInteger64(void* _pvCtx, int* _piAddress, int **_dims, int *_ndims, long long** _pllData64)
558 SciErr sciErr = sciErrInit();
559 void * entries = NULL;
561 int ret = getHypermatEntries(_pvCtx, _piAddress, &entries);
563 if (ret || entries == NULL || ((types::InternalType*)entries)->isInt64() == false)
565 addErrorMessage(&sciErr, API_ERROR_INVALID_POINTER, _("%s: Invalid argument address"), "getHypermatOfInteger64");
569 types::Int64* p = (types::Int64*)entries;
570 *_dims = p->getDimsArray();
571 *_ndims = p->getDims();
572 *_pllData64 = p->get();
576 SciErr getHypermatOfUnsignedInteger64(void* _pvCtx, int* _piAddress, int **_dims, int *_ndims, unsigned long long** _pullData64)
578 SciErr sciErr = sciErrInit();
579 void * entries = NULL;
581 int ret = getHypermatEntries(_pvCtx, _piAddress, &entries);
583 if (ret || entries == NULL || ((types::InternalType*)entries)->isUInt64() == false)
585 addErrorMessage(&sciErr, API_ERROR_INVALID_POINTER, _("%s: Invalid argument address"), "getHypermatOfUnsignedInteger64");
589 types::UInt64* p = (types::UInt64*)entries;
590 *_dims = p->getDimsArray();
591 *_ndims = p->getDims();
592 *_pullData64 = p->get();
596 SciErr getHypermatOfBoolean(void* _pvCtx, int* _piAddress, int **_dims, int *_ndims, int** _piBool)
598 SciErr sciErr = sciErrInit();
599 void * entries = NULL;
601 int ret = getHypermatEntries(_pvCtx, _piAddress, &entries);
603 if (ret || entries == NULL || ((types::InternalType*)entries)->isBool() == false)
605 addErrorMessage(&sciErr, API_ERROR_INVALID_POINTER, _("%s: Invalid argument address"), "getHypermatOfBoolean");
609 types::Bool* p = (types::Bool*)entries;
610 *_dims = p->getDimsArray();
611 *_ndims = p->getDims();
616 SciErr createHypermatOfString(void *_pvCtx, int _iVar, int * _dims, int _ndims, const char* const* _pstStrings)
618 SciErr sciErr = sciErrInit();
619 types::GatewayStruct* pStr = (types::GatewayStruct*)_pvCtx;
620 types::typed_list in = *pStr->m_pIn;
621 types::InternalType** out = pStr->m_pOut;
622 int rhs = _iVar - *getNbInputArgument(_pvCtx);
624 types::String* p = new types::String(_ndims, _dims);
625 int size = p->getSize();
630 out[rhs - 1] = types::Double::Empty();
634 for (int i = 0; i < size; ++i)
636 wchar_t* w = to_wide_string(_pstStrings[i]);
645 SciErr createHypermatOfPoly(void *_pvCtx, int _iVar, char* _pstVarName, int * _dims, int _ndims, const int* _piNbCoef, const double* const* _pdblReal)
647 SciErr sciErr = sciErrInit();
648 types::GatewayStruct* pStr = (types::GatewayStruct*)_pvCtx;
649 types::typed_list in = *pStr->m_pIn;
650 types::InternalType** out = pStr->m_pOut;
651 int rhs = _iVar - *getNbInputArgument(_pvCtx);
653 wchar_t* w = to_wide_string(_pstVarName);
654 types::Polynom* p = new types::Polynom(w, _ndims, _dims, _piNbCoef);
656 int size = p->getSize();
660 out[rhs - 1] = types::Double::Empty();
665 types::SinglePoly** s = p->get();
667 for (int i = 0; i < size; ++i)
669 s[i]->setCoef(_pdblReal[i], NULL);
677 SciErr createComplexHypermatOfPoly(void *_pvCtx, int _iVar, char* _pstVarName, int * _dims, int _ndims, const int* _piNbCoef, const double* const* _pdblReal, const double* const* _pdblImg)
679 SciErr sciErr = sciErrInit();
680 types::GatewayStruct* pStr = (types::GatewayStruct*)_pvCtx;
681 types::typed_list in = *pStr->m_pIn;
682 types::InternalType** out = pStr->m_pOut;
683 int rhs = _iVar - *getNbInputArgument(_pvCtx);
685 wchar_t* w = to_wide_string(_pstVarName);
686 types::Polynom* p = new types::Polynom(w, _ndims, _dims, _piNbCoef);
689 int size = p->getSize();
693 out[rhs - 1] = types::Double::Empty();
698 types::SinglePoly** s = p->get();
700 for (int i = 0; i < size; ++i)
702 s[i]->setCoef(_pdblReal[i], _pdblImg[i]);
710 SciErr allocHypermatOfDouble(void *_pvCtx, int _iVar, int * _dims, int _ndims, double** _pdblReal)
712 SciErr sciErr = sciErrInit();
713 types::GatewayStruct* pStr = (types::GatewayStruct*)_pvCtx;
714 types::typed_list in = *pStr->m_pIn;
715 types::InternalType** out = pStr->m_pOut;
716 int rhs = _iVar - *getNbInputArgument(_pvCtx);
718 types::Double* p = new types::Double(_ndims, _dims);
720 int size = p->getSize();
724 out[rhs - 1] = types::Double::Empty();
728 *_pdblReal = p->get();
733 SciErr createHypermatOfDouble(void *_pvCtx, int _iVar, int * _dims, int _ndims, const double * _pdblReal)
735 SciErr sciErr = sciErrInit();
736 types::GatewayStruct* pStr = (types::GatewayStruct*)_pvCtx;
737 types::typed_list in = *pStr->m_pIn;
738 types::InternalType** out = pStr->m_pOut;
739 int rhs = _iVar - *getNbInputArgument(_pvCtx);
741 types::Double* p = new types::Double(_ndims, _dims);
743 int size = p->getSize();
747 out[rhs - 1] = types::Double::Empty();
756 SciErr createComplexHypermatOfDouble(void *_pvCtx, int _iVar, int * _dims, int _ndims, const double * _pdblReal, const double * _pdblImg)
758 SciErr sciErr = sciErrInit();
759 types::GatewayStruct* pStr = (types::GatewayStruct*)_pvCtx;
760 types::typed_list in = *pStr->m_pIn;
761 types::InternalType** out = pStr->m_pOut;
762 int rhs = _iVar - *getNbInputArgument(_pvCtx);
764 types::Double* p = new types::Double(_ndims, _dims, true);
766 int size = p->getSize();
770 out[rhs - 1] = types::Double::Empty();
780 SciErr createHypermatOfBoolean(void *_pvCtx, int _iVar, int * _dims, int _ndims, const int * _piBool)
782 SciErr sciErr = sciErrInit();
783 types::GatewayStruct* pStr = (types::GatewayStruct*)_pvCtx;
784 types::typed_list in = *pStr->m_pIn;
785 types::InternalType** out = pStr->m_pOut;
786 int rhs = _iVar - *getNbInputArgument(_pvCtx);
788 types::Bool* p = new types::Bool(_ndims, _dims);
790 int size = p->getSize();
794 out[rhs - 1] = types::Double::Empty();
803 SciErr createHypermatOfInteger8(void *_pvCtx, int _iVar, int * _dims, int _ndims, const char * _pcData8)
805 SciErr sciErr = sciErrInit();
806 types::GatewayStruct* pStr = (types::GatewayStruct*)_pvCtx;
807 types::typed_list in = *pStr->m_pIn;
808 types::InternalType** out = pStr->m_pOut;
809 int rhs = _iVar - *getNbInputArgument(_pvCtx);
811 types::Int8* p = new types::Int8(_ndims, _dims);
813 int size = p->getSize();
817 out[rhs - 1] = types::Double::Empty();
826 SciErr createHypermatOfUnsignedInteger8(void *_pvCtx, int _iVar, int * _dims, int _ndims, const unsigned char * _pucData8)
828 SciErr sciErr = sciErrInit();
829 types::GatewayStruct* pStr = (types::GatewayStruct*)_pvCtx;
830 types::typed_list in = *pStr->m_pIn;
831 types::InternalType** out = pStr->m_pOut;
832 int rhs = _iVar - *getNbInputArgument(_pvCtx);
834 types::UInt8* p = new types::UInt8(_ndims, _dims);
836 int size = p->getSize();
840 out[rhs - 1] = types::Double::Empty();
849 SciErr createHypermatOfInteger16(void *_pvCtx, int _iVar, int * _dims, int _ndims, const short * _psData16)
851 SciErr sciErr = sciErrInit();
852 types::GatewayStruct* pStr = (types::GatewayStruct*)_pvCtx;
853 types::typed_list in = *pStr->m_pIn;
854 types::InternalType** out = pStr->m_pOut;
855 int rhs = _iVar - *getNbInputArgument(_pvCtx);
857 types::Int16* p = new types::Int16(_ndims, _dims);
859 int size = p->getSize();
863 out[rhs - 1] = types::Double::Empty();
872 SciErr createHypermatOfUnsignedInteger16(void *_pvCtx, int _iVar, int * _dims, int _ndims, const unsigned short * _pusData16)
874 SciErr sciErr = sciErrInit();
875 types::GatewayStruct* pStr = (types::GatewayStruct*)_pvCtx;
876 types::typed_list in = *pStr->m_pIn;
877 types::InternalType** out = pStr->m_pOut;
878 int rhs = _iVar - *getNbInputArgument(_pvCtx);
880 types::UInt16* p = new types::UInt16(_ndims, _dims);
882 int size = p->getSize();
886 out[rhs - 1] = types::Double::Empty();
895 SciErr createHypermatOfInteger32(void *_pvCtx, int _iVar, int * _dims, int _ndims, const int * _piData32)
897 SciErr sciErr = sciErrInit();
898 types::GatewayStruct* pStr = (types::GatewayStruct*)_pvCtx;
899 types::typed_list in = *pStr->m_pIn;
900 types::InternalType** out = pStr->m_pOut;
901 int rhs = _iVar - *getNbInputArgument(_pvCtx);
903 types::Int32* p = new types::Int32(_ndims, _dims);
905 int size = p->getSize();
909 out[rhs - 1] = types::Double::Empty();
918 SciErr createHypermatOfUnsignedInteger32(void *_pvCtx, int _iVar, int * _dims, int _ndims, const unsigned int * _puiData32)
920 SciErr sciErr = sciErrInit();
921 types::GatewayStruct* pStr = (types::GatewayStruct*)_pvCtx;
922 types::typed_list in = *pStr->m_pIn;
923 types::InternalType** out = pStr->m_pOut;
924 int rhs = _iVar - *getNbInputArgument(_pvCtx);
926 types::UInt32* p = new types::UInt32(_ndims, _dims);
928 int size = p->getSize();
932 out[rhs - 1] = types::Double::Empty();
941 SciErr createHypermatOfInteger64(void *_pvCtx, int _iVar, int * _dims, int _ndims, const long long* _pllData64)
943 SciErr sciErr = sciErrInit();
944 types::GatewayStruct* pStr = (types::GatewayStruct*)_pvCtx;
945 types::typed_list in = *pStr->m_pIn;
946 types::InternalType** out = pStr->m_pOut;
947 int rhs = _iVar - *getNbInputArgument(_pvCtx);
949 types::Int64* p = new types::Int64(_ndims, _dims);
951 int size = p->getSize();
955 out[rhs - 1] = types::Double::Empty();
964 SciErr createHypermatOfUnsignedInteger64(void *_pvCtx, int _iVar, int * _dims, int _ndims, const unsigned long long* _pullData64)
966 SciErr sciErr = sciErrInit();
967 types::GatewayStruct* pStr = (types::GatewayStruct*)_pvCtx;
968 types::typed_list in = *pStr->m_pIn;
969 types::InternalType** out = pStr->m_pOut;
970 int rhs = _iVar - *getNbInputArgument(_pvCtx);
972 types::UInt64* p = new types::UInt64(_ndims, _dims);
974 int size = p->getSize();
978 out[rhs - 1] = types::Double::Empty();