This function is called by optimbase.checkcostfun
to check whether the
dimensions of a cost function output match the expectations.
optimbase.checkshape(this = NULL, varname = NULL, data = NULL, index = NULL,
expectednrows = NULL, expectedncols = NULL)
An optimization object.
The name of the output being checked, either 'f', 'c', or 'g'.
A content of the output.
The index (see vignette('optimbase',package='optimbase')
for more details).
Number of expected rows.
Number of expected columns.
Return the optimization object or an error message if the dimensions are inconsistent.