00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include <basix/mmx_syntax.hpp>
00014 #include <mblad/bav.hpp>
00015 #include <bav.h>
00016
00018 namespace mmx {
00019 #define Coordinate multivariate_coordinate<>
00020
00021 Coordinate
00022 derive (const Coordinate& u, const vector<Coordinate>& v) {
00023 if (N(v) == 0) return u;
00024 generic y= **u;
00025 vector<generic> g;
00026 if (is<compound> (y) && exact_eq (y[0], GEN_CACHED_DERIVE))
00027 g= compound_to_vector (y);
00028 else
00029 g= vec (GEN_CACHED_DERIVE, y);
00030 for (nat i= 0; i < N(v); i++)
00031 g << **v[i];
00032 return Coordinate (vector_to_compound (g)); }
00033
00034 }
00035