AgsFunction

AgsFunction — Function to translate values

Functions

Properties

gchar * normalized-function Read / Write
gpointer pivot-table Read / Write
gchar * source-function Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── AgsConversion
        ╰── AgsFunction
            ╰── AgsSynthGenerator

Includes

#include <ags/lib/ags_function.h>

Description

The AgsFunction translates values from linear math to a given function.

Functions

ags_function_find_literals ()

gchar **
ags_function_find_literals (AgsFunction *function,
                            guint *n_symbols);

Find literal symbols i.e. variable names.

Parameters

function

The AgsFunction

 

n_symbols

return location of symbols count

 

Returns

The string vector containing symbols

Since: 0.7.2


ags_function_literal_solve ()

void
ags_function_literal_solve (AgsFunction *function);

Solves :source-function literally, allocates the pivot table and creates the normalized function.

Parameters

function

the AgsFunction

 

Since: 0.7.2


ags_function_push_equation ()

gboolean
ags_function_push_equation (AgsFunction *function,
                            gchar *equation);

Push an equation to the solver stack.

Parameters

function

the AgsFunction

 

equation

an equation as string

 

Returns

TRUE on success, otherwise FALSE

Since: 0.7.2


ags_function_pop_equation ()

void
ags_function_pop_equation (AgsFunction *function,
                           GError **error);

Pops the functions of the equation stack. Call this function as you're finished with pushing equations.

Parameters

function

the AgsFunction

 

error

a GError

 

Since: 0.7.2


ags_function_get_expanded ()

gchar *
ags_function_get_expanded (AgsFunction *function,
                           gchar **symbols,
                           guint n_symbols);

Expands symbols to normalized form.

Parameters

function

the AgsFunction

 

symbols

the symbols to compute

 

n_symbols

the count of symbols

 

Returns

the normalized form as string

Since: 0.7.2


ags_funciton_get_normalized ()

gchar *
ags_funciton_get_normalized (AgsFunction *function);

Get internal normalized string.

Parameters

function

the AgsFunction

 

Returns

the normalized string

Since: 0.7.2


ags_function_compute_term ()

AgsComplex *
ags_function_compute_term (gchar *term,
                           gchar *substitute_symbol,
                           AgsComplex *substitute_value);

Compute term by substituting substitute_symbol with substitue_value and do basic solving.

Parameters

term

the term as string to compute

 

substitute_symbol

a variable to substitute

 

substitute_value

the AgsComplex value representing substitute_symbol

 

Returns

the AgsComplex value resulted by substitution

Since: 0.7.2


ags_function_symbolic_translate_value ()

AgsComplex **
ags_function_symbolic_translate_value (AgsFunction *function,
                                       gchar *symbol,
                                       AgsComplex *value);

Symbolic translate to value for symbol and compute resulting vector.

Parameters

function

the AgsFunction

 

symbol

the symbol to translate

 

value

the value to substitute

 

Returns

the new AgsComplex vector

Since: 0.7.2


ags_function_substitute_values ()

gboolean
ags_function_substitute_values (AgsFunction *function,
                                gchar *symbol,
                                ...);

Verify :source-function to be TRUE or FALSE by substiution.

Parameters

function

the AgsFunction

 

symbol

the first symbol as string, or NULL if no more symbol and value pair.

 

...

NULL terminated symbol and value pairs of list.

 

Returns

TRUE if function evaluates, otherwise FALSE

Since: 0.7.2


ags_function_translate_value ()

AgsComplex *
ags_function_translate_value (AgsFunction *function,
                              AgsComplex *value);

Translates value by source function.

Parameters

function

the AgsFunction

 

value

the AgsComplex value to translate

 

Returns

the solution as AgsComplex boxed-type.

Since: 0.7.2


ags_function_new ()

AgsFunction *
ags_function_new (gchar *source_function);

Instantiate a new AgsFunction.

Parameters

source_function

the source function

 

Returns

the new instance

Since: 0.7.2

Types and Values

AGS_SYMBOLIC_EULER

#define AGS_SYMBOLIC_EULER "ℯ\0"


AGS_SYMBOLIC_PI

#define AGS_SYMBOLIC_PI "𝜋\0"


AGS_SYMBOLIC_INFINIT

#define AGS_SYMBOLIC_INFINIT "∞\0"


AGS_SYMBOLIC_COMPLEX_UNIT

#define AGS_SYMBOLIC_COMPLEX_UNIT "𝑖\0"


enum AgsFunctionFlags

Members

AGS_FUNCTION_LINEAR

   

AGS_FUNCTION_EXPONENTIAL

   

AGS_FUNCTION_LOGARITHMIC

   

AGS_FUNCTION_IS_UNIQUE

   

AGS_FUNCTION_SOLVE_PIVOT_TABLE

   

AGS_FUNCTION_SOLVE_MAXIMUM_COLON

   

AGS_FUNCTION_SOLVE_GAUSS

   

Property Details

The “normalized-function” property

  “normalized-function”      gchar *

The normalized form of function to use to translate values.

Flags: Read / Write

Default value: NULL

Since: 0.7.2


The “pivot-table” property

  “pivot-table”              gpointer

The original pivot table representation.

Flags: Read / Write

Since: 0.7.2


The “source-function” property

  “source-function”          gchar *

The function to use to translate values.

Flags: Read / Write

Default value: NULL

Since: 0.7.2