Computational routine
eng


vectmultcmplx

File content


/* Modnumlib Scicos interfacing function
 * Copyright (C) 2009-2011 Alan Layec
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */
 
/* vectmultcmplx Scicos complexe vector multiplication
 * Type 4 simulation function ver 1.0 - scilab-3.0
 * 3 janvier 2005 - IRCOM GROUP - Author : A.Layec
 */

/* REVISION HISTORY :
 * $Log$
 */

#include "modnum_lib.h"
#include "scicos_block.h"

/* Cette fonction réalise la multiplication de deux vecteurs complexes.
 * y1=u1*u3-u2*u4
 * y2=u1*u4+u2*u3
 * entrées régulières : u1[0..nu-1] : parties réelles du vecteur 1
 *                      u2[0..nu-1] : parties imaginaires du vecteur 1
 *                      u3[0..nu-1] : parties réelles du vecteur 2
 *                      u4[0..nu-1] : parties imaginaires du vecteur 2
 * sorties régulière : y1[0..nu-1] : parties réelles du vecteur de sortie
 *                     y2[0..nu-1] : parties imaginaires du vecteur de sortie
 */

/*prototype*/
void vectmultcmplx(scicos_block *block,int flag)
{
  /*Déclaration*/
  double *y1,*y2;
  double *u1,*u2;
  double *u3,*u4;
  int nu;

  /*Récupération des adresses des ports réguliers*/
  y1=(double *)block->outptr[0];
  y2=(double *)block->outptr[1];
  u1=(double *)block->inptr[0];
  u2=(double *)block->inptr[1];
  u3=(double *)block->inptr[2];
  u4=(double *)block->inptr[3];

  /*Récupération de la taille d'entrée*/
  nu=block->insz[0];

  /*Réalise la multiplication vectorielle complexe*/
  /*Appel cmplxm_c*/
  cmplxmult_c(&nu,&u1[0],&u2[0],&u3[0],&u4[0],&y1[0],&y2[0]);
}