TVectorFunction Typedef

Header: Dew.Math/Optimization.h · Cross-compiler

typedef void (*TVectorFunction)(TVec *, TVec *, const DewArray<double> &, const DewArray<tObject *> &);

Defines vector function of several variables.

Defines vector function of several variables.

Examples

cpp
#include "MtxVec.h"
#include "Optimization.h"
#include "Units.Math387.h"

using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::Math387;

static void VecFun(TVec* x, TVec* f, const DewArray<double>& c, const DewArray<tObject*>& o)
{
    (*f)[0] = (*x)[0]*Sqrt((*x)[0]*(*x)[0] + (*x)[1]*(*x)[1]);
    (*f)[1] = (*x)[1]*Sqrt((*x)[0]*(*x)[0] + (*x)[1]*(*x)[1]);
    (*f)[2] = (*x)[0]*((*x)[1] - (*x)[0])*((*x)[1] - (*x)[0]);
}

void Example()
{
}