You are here: Symbol Reference > Optimization Namespace > Types > Optimization.TVectorFunction Type
MtxVec VCL
ContentsIndex
PreviousUpNext
Optimization.TVectorFunction Type

Defines vector function of several variables.

Pascal
TVectorFunction = procedure (const X,Y: TVec; const Consts: array of double; const PConsts: array of TObject);
Parameters 
Description 
Function variables. 
Function results. 
Consts 
Array of additional constants which can be used in math formula. 
PConsts 
Array of additional constants (pointers) which can be used in math formula. 

Defines vector function of several variables.

Define the vector function f(x,y) with three components:

Uses MtxVec, Math387; procedure VecFun(const x,f: TVec; const c: Array of double; Const o: Array of TObject); begin f[0] := x[0]*Sqrt(Sqr(x[0]+Sqr(x[1])); f[1] := x[1]*Sqrt(Sqr(x[0]+Sqr(x[1])); f[2] := x[0]*Sqr(x[1]-x[0]); end;
#include "MtxExpr.hpp" #include "Math387.hpp" void __fastcall VecFun(TVec* const x, TVec* const f, const double* c, conts int c_count, System::TObject* const* o, const int o_count); { double* X = X.PValues1D(0); (*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]); }
Examples on GitHub
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!