ADMB Documentation  11.1.1631
 All Classes Files Functions Variables Typedefs Friends Defines
adpvm.h
Go to the documentation of this file.
00001 /*
00002  * $Id: adpvm.h 1112 2013-07-12 21:41:41Z johnoel $
00003  *
00004  * Author: David Fournier
00005  * Copyright (c) 2008-2012 Regents of the University of California
00006  *
00007  * ADModelbuilder and associated libraries and documentations are
00008  * provided under the general terms of the "BSD" license.
00009  *
00010  * License:
00011  *
00012  * Redistribution and use in source and binary forms, with or without
00013  * modification, are permitted provided that the following conditions are
00014  * met:
00015  *
00016  * 1. Redistributions of source code must retain the above copyright
00017  * notice, this list of conditions and the following disclaimer.
00018  *
00019  * 2.  Redistributions in binary form must reproduce the above copyright
00020  * notice, this list of conditions and the following disclaimer in the
00021  * documentation and/or other materials provided with the distribution.
00022  *
00023  * 3.  Neither the name of the  University of California, Otter Research,
00024  * nor the ADMB Foundation nor the names of its contributors may be used
00025  * to endorse or promote products derived from this software without
00026  * specific prior written permission.
00027  *
00028  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00029  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00030  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00031  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00032  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00033  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00034  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00035  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00036  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00037  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00038  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00039  *
00040  */
00045 #if !defined(__ADPVM__)
00046 #  define __ADPVM__
00047 void adpvm_pack_number_derivative(void);
00048 void adpvm_send_derivatives(void);
00049 void adpvm_recv(int id,int n);
00050 void adpvm_receive_derivatives(void);
00051 void adpvm_send(int id,int n);
00052 void adpvm_unpack_vector_derivatives(void);
00053 void initialize_pvm_buffer(void);
00054 void  adpvm_end_receive();
00055 void adpvm_unpack_number_derivative(void);
00056 void adpvm_pack_vector_derivatives(void);
00057 
00058 void pvm_pack(const prevariable& _v);
00059 void pvm_pack(const dvar_vector& _v);
00060 void pvm_pack(const dvar_matrix & _m);
00061 void pvm_pack(const dvar3_array & _m);
00062 void pvm_pack(const dvar4_array & _m);
00063 void pvm_pack(const dvar5_array & _m);
00064 
00065 void pvm_unpack(const int& _v);
00066 void pvm_unpack(const prevariable& _v);
00067 void pvm_unpack(const dvar_vector& _v);
00068 void pvm_unpack(const dvar_matrix & _m);
00069 void pvm_unpack(const dvar3_array & _m);
00070 void pvm_unpack(const dvar4_array & _m);
00071 void pvm_unpack(const dvar5_array & _m);
00072 
00073 void pvm_pack(double v);
00074 void pvm_pack(const dvector& _v);
00075 void pvm_pack(const dmatrix & _m);
00076 void pvm_pack(const d3_array & _m);
00077 void pvm_pack(const d4_array & _m);
00078 void pvm_pack(const d5_array & _m);
00079 
00080 void pvm_unpack(const double& _v);
00081 void pvm_unpack(const dvector& _v);
00082 void pvm_unpack(const dmatrix & _m);
00083 void pvm_unpack(const d3_array & _m);
00084 void pvm_unpack(const d4_array & _m);
00085 void pvm_unpack(const d5_array & _m);
00086 
00087 void pvm_pack(int v);
00088 void pvm_pack(const ivector& _v);
00089 void pvm_pack(const imatrix & _m);
00090 void pvm_pack(const i3_array & _m);
00091 //void pvm_pack(const i4_array & _m);
00092 //void pvm_pack(const i5_array & _m);
00093 
00094 void pvm_unpack(const int& _v);
00095 void pvm_unpack(const ivector& _v);
00096 void pvm_unpack(const imatrix & _m);
00097 void pvm_unpack(const i3_array & _m);
00098 //void pvm_unpack(const i4_array & _m);
00099 //void pvm_unpack(const i5_array & _m);
00100 
00101 extern "C" {
00102 typedef
00103   __declspec(dllexport)
00104   int (*ADPVM_SETOPT )(int,int);
00105 
00106 typedef
00107   __declspec(dllexport)
00108   int (*ADPVM_RECV)(int,int);
00109 
00110 typedef
00111   __declspec(dllexport)
00112   int (*ADPVM_CATCHOUT)(FILE*);
00113 
00114 typedef
00115   __declspec(dllexport)
00116   int (*ADPVM_SEND)(int,int);
00117 
00118 typedef
00119   __declspec(dllexport)
00120   int (*ADPVM_CONFIG )(int*,int*,struct pvmhostinfo **);
00121 
00122 typedef
00123   __declspec(dllexport)
00124   int (*ADPVM_SPAWN )(char *,char **,int,char *,int,int *);
00125 
00126 typedef
00127   __declspec(dllexport)
00128   int (*ADPVM_PARENT) (void);
00129 
00130 typedef
00131   __declspec(dllexport)
00132   int (*ADPVM_INITSEND) (int);
00133 
00134 typedef
00135   __declspec(dllexport)
00136   int (*ADPVM_UPKDOUBLE) (double*,int,int);
00137 
00138 typedef
00139   __declspec(dllexport)
00140   int (*ADPVM_PKINT) (int*,int,int);
00141 
00142 typedef
00143   __declspec(dllexport)
00144   int (*ADPVM_PKSTR) (char*);
00145 
00146 typedef
00147   __declspec(dllexport)
00148   int (*ADPVM_UPKSTR) (char*);
00149 
00150 typedef
00151   __declspec(dllexport)
00152   int (*ADPVM_PKDOUBLE) (double*,int,int);
00153 
00154 typedef
00155   __declspec(dllexport)
00156   int (*ADPVM_UPKINT) (int*,int,int);
00157 
00158 
00159 extern ADPVM_PARENT ppvm_parent;
00160 extern ADPVM_SEND ppvm_send;
00161 extern ADPVM_RECV ppvm_recv;
00162 extern ADPVM_PKINT ppvm_pkint;
00163 extern ADPVM_PKSTR ppvm_pkstr;
00164 extern ADPVM_UPKSTR ppvm_upkstr;
00165 extern ADPVM_PKDOUBLE ppvm_pkdouble;
00166 extern ADPVM_UPKINT ppvm_upkint;
00167 extern ADPVM_UPKDOUBLE ppvm_upkdouble;
00168 extern ADPVM_SETOPT ppvm_setopt;
00169 extern ADPVM_CONFIG ppvm_config;
00170 extern ADPVM_SPAWN ppvm_spawn;
00171 extern ADPVM_INITSEND ppvm_initsend;
00172 extern ADPVM_CATCHOUT ppvm_catchout;
00173 
00174 }
00175 int load_adpvm_library(void);
00176 
00177 void send_dv3_to_master(const dvar3_array& v);
00178 #endif