/* ************************************************************   
   *                                                          *   
   *     Elementare numerische Methoden der Mathematik        *   
   *                                                          *   
   *     Arbeiten mit vektorwertigen Funktionen               *   
   *                                                          *   
   *     (c) 2009 Jens Burmeister, Universitaet Kiel,         *   
   *              Institut fuer Informatik                    *   
   *              Lehrstuhl  Scientific Computing             *   
   *                                                          *   
   *     Version Wed Dec  9 15:14:49 MET 2009                 *   
   *                                                          *   
   ************************************************************ */

#include <stdlib.h>   
  /*  wegen calloc                                 */
#include "Vectors.h"                
  /* wegen PVector                                 */
#include "VectorValuedFunctions.h"  
  /* wegen PVectorValuedFunction                   */
  /* wegen TVectorValuedFunction_Create            */
  /* wegen TVectorValuedFunction_Destroy           */
  /* wegen TVectorValuedFunction_Evaluate          */
  /* wegen TVectorValuedFunction_Evaluate_Create   */

PVectorValuedFunction TVectorValuedFunction_Create(int n){

  return (PVectorValuedFunction) calloc(n, sizeof(PComponentFunction));

}

void TVectorValuedFunction_Destroy(PVectorValuedFunction F){

  free(F);

}

void TVectorValuedFunction_Evaluate(int n, PVector y, PVectorValuedFunction F, PVector x){

  int i;

  for (i=0; i<n; i=i+1) y[i] = F[i](n, x);

}

PVector TVectorValuedFunction_Evaluate_Create(int n, PVectorValuedFunction F, PVector x){

  PVector y;

  y = TVector_Create(n);
  TVectorValuedFunction_Evaluate(n, y, F, x);
  
  return y;  
}

/* ************************************************************************   
   *                                                                      *   
   *     Logbuch fuer  VectorValuedFunctions.c                            *   
   *  ------------------------------------------------------------------  *   
   *                                                                      *   
   *     Version 1.0 vom Wed Dec  9 15:14:49 MET 2009                     *   
   *                                                                      *   
   *     - Funktionen erzeugt                                             *   
   *                                                                      *   
   *       PVectorValuedFunction TVectorValuedFunction_Create(int);       *
   *       void TVectorValuedFunction_Destroy(PVectorValuedFunction);     *
   *                                                                      *
   *       void TVectorValuedFunction_Evaluate(                           *
   *              int, PVector, PVectorValuedFunction, PVector);          *
   *       PVector TVectorValuedFunction_Evaluate_Create(                 *
   *                 int, PVectorValuedFunction, PVector);                *
   *                                                                      *   
   ********************************************************************** */

