2.1.0
User Documentation for Apache MADlib
dense_linear_systems.sql_in File Reference

SQL functions for linear systems. More...

Functions

bytea8 dense_residual_norm_transition (bytea8 state, float8[] a, float8 b, float8[] x)
 
bytea8 dense_residual_norm_merge_states (bytea8 state1, bytea8 state2)
 
residual_norm_result dense_residual_norm_final (bytea8 state)
 
aggregate residual_norm_result dense_residual_norm (float8[] left_hand_side, float8 right_hand_side, float8[] solution)
 Compute the residual after solving the dense linear systems. More...
 
float8 [] dense_direct_linear_system_transition (float8[] state, integer row_id, float8[] a, float8 b, integer num_rows, integer algorithm)
 
float8 [] dense_direct_linear_system_merge_states (float8[] state1, float8[] state2)
 
dense_linear_solver_result dense_direct_linear_system_final (float8[] state)
 
aggregate dense_linear_solver_result dense_direct_linear_system (integer row_id, float8[] left_hand_side, float8 right_hand_side, integer numEquations, integer algorithm)
 Solve a system of linear equations using the direct method. More...
 
varchar linear_solver_dense (varchar input_string)
 Help function, to print out the supported families. More...
 
varchar linear_solver_dense ()
 
void linear_solver_dense (varchar source_table, varchar out_table, varchar row_id, varchar left_hand_side, varchar right_hand_side, varchar grouping_cols, varchar optimizer, varchar optimizer_options)
 A wrapper function for the various marginal linear_systemsion analyzes. More...
 
void linear_solver_dense (varchar source_table, varchar out_table, varchar row_id, varchar left_hand_side, varchar right_hand_side)
 Marginal effects with default variables. More...
 

Detailed Description

Date
July 2013
See also
Computes the solution of a consistent linear system, for more details see the module description at Dense Linear Systems

Function Documentation

◆ dense_direct_linear_system()

aggregate dense_linear_solver_result dense_direct_linear_system ( integer  row_id,
float8 []  left_hand_side,
float8  right_hand_side,
integer  numEquations,
integer  algorithm 
)
Parameters
row_idColumn containing the row_id
left_hand_sideColumn containing the left hand side of the system
right_hand_sideColumn containing the right hand side of the system
numEquationsNumber of equations
algorithmAlgorithm used for the dense linear solver
Returns
A composite value:
  • solution FLOAT8[] - Array of marginal effects
  • residual_norm FLOAT8 - Norm of the residual
  • iters INTEGER - Iterations taken
Usage
  • Get all the diagnostic statistics:
     SELECT linear_system_dense(row_id,
                                      left_hand_side,
                                       right_hand_side ,
                                       numEquations )
     FROM dataTable;
    

◆ dense_direct_linear_system_final()

dense_linear_solver_result dense_direct_linear_system_final ( float8 []  state)

◆ dense_direct_linear_system_merge_states()

float8 [] dense_direct_linear_system_merge_states ( float8 []  state1,
float8 []  state2 
)

◆ dense_direct_linear_system_transition()

float8 [] dense_direct_linear_system_transition ( float8 []  state,
integer  row_id,
float8 []  a,
float8  b,
integer  num_rows,
integer  algorithm 
)

◆ dense_residual_norm()

aggregate residual_norm_result dense_residual_norm ( float8 []  left_hand_side,
float8  right_hand_side,
float8 []  solution 
)
Parameters
left_hand_sideColumn containing the left hand side of the system
right_hand_sideColumn containing the right hand side of the system
solutionSolution of the linear system
Returns
residual_norm FLOAT8:
Usage
  • Get all the diagnostic statistics:
     SELECT dense_residual_norm(row_id,
                                      left_hand_side,
                                       right_hand_side ,
                                       solution )
     FROM dataTable;
    

◆ dense_residual_norm_final()

residual_norm_result dense_residual_norm_final ( bytea8  state)

◆ dense_residual_norm_merge_states()

bytea8 dense_residual_norm_merge_states ( bytea8  state1,
bytea8  state2 
)

◆ dense_residual_norm_transition()

bytea8 dense_residual_norm_transition ( bytea8  state,
float8 []  a,
float8  b,
float8 []  x 
)

◆ linear_solver_dense() [1/4]

varchar linear_solver_dense ( varchar  input_string)

◆ linear_solver_dense() [2/4]

varchar linear_solver_dense ( )

◆ linear_solver_dense() [3/4]

void linear_solver_dense ( varchar  source_table,
varchar  out_table,
varchar  row_id,
varchar  left_hand_side,
varchar  right_hand_side,
varchar  grouping_cols,
varchar  optimizer,
varchar  optimizer_options 
)
Parameters
source_tableString identifying the input table
out_tableString identifying the output table to be created
row_idColumn containing the row_id
left_hand_sideColumn containing the left hand side of the system
right_hand_sideColumn containing the right hand side of the system
grouping_colsColumns to group by
optimizerOptimizer to be used
optimizer_optionsOptimal parameters for the algorithms
Returns
void
Usage
For function summary information. Run sql> select linear_solver_dense('help'); OR sql> select linear_solver_dense(); OR sql> select linear_solver_dense('?'); For function usage information. Run sql> select linear_solver_dense('usage');

◆ linear_solver_dense() [4/4]

void linear_solver_dense ( varchar  source_table,
varchar  out_table,
varchar  row_id,
varchar  left_hand_side,
varchar  right_hand_side 
)