* [#16553](https://bugzilla.scilab.org/16553): `unique(["" ""])` returned `["" ""]`.
* [#16557](https://bugzilla.scilab.org/16557): `macr2tree` + `tree2code` translated `e={2}` into `"e=1"` and `e={2,"ab"}` into `"e=[2,"ab"]"`.
* [#16559](https://bugzilla.scilab.org/16553): `isempty(A)` was true for sparse matrix of dimension 2^16 or larger.
+* [#16622](https://bugzilla.scilab.org/16622): `inv` could no longer be overloaded for hypermatrices of decimal or complex numbers.
* [#16623](https://bugzilla.scilab.org/16623): `rand(2,2,2)^2` yielded a wrong result instead of trying to call the `%s_p_s` overload for input hypermatrices.
* [#16644](https://bugzilla.scilab.org/16644): `input("message:")` yielded a wrong error message about `mprintf` in case of non-interpretable input.
double* pData = NULL;
int ret = 0;
- if (in.size() != 1)
+ if (in.size() < 1)
{
Scierror(77, _("%s: Wrong number of input argument(s): %d expected.\n"), "inv", 1);
return types::Function::Error;
pDbl = in[0]->getAs<types::Double>()->clone()->getAs<types::Double>(); // input data will be modified
- if (pDbl->getRows() != pDbl->getCols())
+ if (pDbl->getDims() > 2)
+ {
+ std::wstring wstFuncName = L"%s_inv";
+ return Overload::call(wstFuncName, in, _iRetCount, out);
+ }
+
+ if (in.size() > 1)
{
- Scierror(20, _("%s: Wrong type for argument %d: Square matrix expected.\n"), "inv", 1);
+ Scierror(77, _("%s: Wrong number of input argument(s): %d expected.\n"), "inv", 1);
return types::Function::Error;
}
return types::Function::OK;
}
+ if (pDbl->getRows() != pDbl->getCols())
+ {
+ Scierror(20, _("%s: Argument %d: Square matrix expected. Please use pinv() otherwise.\n"), "inv", 1);
+ return types::Function::Error;
+ }
+
if (pDbl->isComplex())
{
/* c -> z */