%% $Revision: 1.12 $ %% $RCSfile: sflip.tlc,v $ %% $Date: 1999/03/24 14:58:06 $ %% %% Authors: D. Orofino, J. Faneuff %% Copyright (c) 1995-1999 The MathWorks, Inc. All Rights Reserved. %% %% Abstract: Target file for the S-Function sflip.c %% %implements "sflip" "C" %% Function: Outputs ========================================================== %% %% Abstract: %% %function Outputs(block, system) Output /* DSP Blockset Flip (%) - % */ %% %assign INPORT = 0 %assign OUTPORT = 0 %assign inplace = (LibBlockInputSignalBufferDstPort(INPORT) == OUTPORT) %assign N = LibDataInputPortWidth(INPORT) %% %if LibBlockOutputSignalIsComplex(OUTPORT) == 0 %% REAL %% %if(inplace) %if N == 1 /* Scalar input does not require any work. */ %else { /* Get first pointer: */ real_T *top = %; real_T *bottom = top + %; int_T i = %; %% this must be an integer division, e.g., 5/2 = 2 while(i-- > 0) { real_T tmp = *top; *top++ = *bottom; *bottom-- = tmp; } } %endif %else %if N == 1 /* Scalar input. */ % = %; %else %% Vector input: { real_T *y = %; /* Last output */ %% %assign rollVars = ["U"] %roll sigIdx = RollRegions, lcv = RollThreshold, block,... "Roller", rollVars *y-- = %; %endroll } %endif %endif %else %% COMPLEX %% %if(inplace) %if N == 1 /* Scalar input does not require any work. */ %else { /* Get first pointer: */ creal_T *top = %; creal_T *bottom = top + %; int_T i = %; while(i-- > 0) { creal_T tmp = *top; *top++ = *bottom; *bottom-- = tmp; } } %endif %else %if N == 1 /* Scalar input. */ % = %; %else %% Vector input: { creal_T *y = %; /* Last output */ %% %assign rollVars = ["U"] %roll sigIdx = RollRegions, lcv = 3, block,... "Roller", rollVars *y-- = %; %endroll } %endif %endif %endif %endfunction %% Outputs %% EOF: sflip.tlc