% Copyright 2016 The MathWorks, Inc.

classdef VectorMinus < RTW.TflCOperationEntryML
methods
function obj = VectorMinus(varargin)
mlock;
obj@RTW.TflCOperationEntryML(varargin{:});
end

function ent = do_match(hThis, ...
hCSO, ... %#ok
targetBitPerChar, ... %#ok
targetBitPerShort, ... %#ok
targetBitPerInt, ... %#ok
targetBitPerLong, ... %#ok
targetBitPerLongLong ) %#ok

assert(strcmp(hThis.Implementation.Arguments(4).Name,'numElements'));

ent = RTW.TflCOperationEntry(hThis);
% calculate number of elements and set value of injected
% constant
ent.Implementation.Arguments(4).Value = prod(hCSO.ConceptualArgs(1).DimRange(1,:));
% Since the implementation has been modified for a specific
% DimRange, update the returned entry to only match similar
% CSOs
for idx =1:3
ent.ConceptualArgs(idx).DimRange = hCSO.ConceptualArgs(idx).DimRange;
end
end
end
end