R/RcppExports.R

Defines functions cte_times_vel_cpp vel_plus_vel_cpp pos_minus_pos_cpp randomize_vl_cpp rename_nodes_cpp init_list_cpp pos_plus_vel_cpp cl_to_arc_matrix_cpp create_causlist_cpp initialize_cl_cpp

Documented in cl_to_arc_matrix_cpp create_causlist_cpp cte_times_vel_cpp initialize_cl_cpp init_list_cpp pos_minus_pos_cpp pos_plus_vel_cpp randomize_vl_cpp rename_nodes_cpp vel_plus_vel_cpp

# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' Create a causality list and initialize it
#' 
#' @param ordering a list with the order of the variables in t_0
#' @param size the size of the DBN
#' @return a causality list
initialize_cl_cpp <- function(ordering, size) {
    .Call('_psoho_initialize_cl_cpp', PACKAGE = 'psoho', ordering, size)
}

#' Create a causal list from a DBN. This is the C++ backend of the function.
#' 
#' @param cl an initialized causality list
#' @param net a dbn object treated as a list of lists
#' @param size the size of the DBN
#' @param ordering a list with the order of the variables in t_0
#' @return a list with a CharacterVector and a NumericVector
create_causlist_cpp <- function(cl, net, size, ordering) {
    .Call('_psoho_create_causlist_cpp', PACKAGE = 'psoho', cl, net, size, ordering)
}

#' Create a matrix with the arcs defined in a causlist object
#' 
#' @param cl a causal list
#' @param ordering a list with the order of the variables in t_0
#' @param rows number of arcs in the network
#' @return a list with a CharacterVector and a NumericVector
cl_to_arc_matrix_cpp <- function(cl, ordering, rows) {
    .Call('_psoho_cl_to_arc_matrix_cpp', PACKAGE = 'psoho', cl, ordering, rows)
}

#' Add a velocity to a position
#' 
#' @param cl the position's causal list
#' @param vl the velocity's causal list
#' @param n_arcs number of arcs present in the position
#' @return a list with the modified position and the new number of arcs
pos_plus_vel_cpp <- function(cl, vl, n_arcs) {
    .Call('_psoho_pos_plus_vel_cpp', PACKAGE = 'psoho', cl, vl, n_arcs)
}

#' Initialize the particles
#' 
#' @param nodes the names of the nodes
#' @param size the size of the DBN
#' @param n_inds the number of particles
#' @return a list with the randomly initialized particles
init_list_cpp <- function(nodes, size, n_inds) {
    .Call('_psoho_init_list_cpp', PACKAGE = 'psoho', nodes, size, n_inds)
}

#' Return a list of nodes with the time slice appended up to the desired size
#' of the network
#' 
#' @param nodes a list with the names of the nodes in the network
#' @param size the size of the DBN
#' @return a list with the renamed nodes in each timeslice
rename_nodes_cpp <- function(nodes, size) {
    .Call('_psoho_rename_nodes_cpp', PACKAGE = 'psoho', nodes, size)
}

#' Randomize a velocity with the given probabilities
#' 
#' @param vl a velocity list
#' @param probs the probabilities of each value in the set {-1,0,1}
#' @return a velocity list with randomized values
randomize_vl_cpp <- function(vl, probs) {
    .Call('_psoho_randomize_vl_cpp', PACKAGE = 'psoho', vl, probs)
}

#' Substracts two Positions to obtain the Velocity that transforms one into the other
#' 
#' @param cl the first position's causal list
#' @param ps the second position's causal list
#' @param vl the Velocity's causal list
#' @return a list with the Velocity's causal list and the number of operations
pos_minus_pos_cpp <- function(cl, ps, vl) {
    .Call('_psoho_pos_minus_pos_cpp', PACKAGE = 'psoho', cl, ps, vl)
}

#' Add two Velocities 
#' 
#' @param vl1 the first Velocity's causal list
#' @param vl2 the second Velocity's causal list
#' @param abs_op the final number of {1,-1} operations
#' @return a list with the Velocity's causal list and the number of operations
vel_plus_vel_cpp <- function(vl1, vl2, abs_op) {
    .Call('_psoho_vel_plus_vel_cpp', PACKAGE = 'psoho', vl1, vl2, abs_op)
}

#' Multiply a Velocity by a constant real number
#' 
#' @param k the constant real number
#' @param vl the Velocity's causal list
#' @param abs_op the final number of {1,-1} operations
#' @param max_op the maximum number of directions in the causal list
#' @return a list with the Velocity's new causal list and number of operations
cte_times_vel_cpp <- function(k, vl, abs_op, max_op) {
    .Call('_psoho_cte_times_vel_cpp', PACKAGE = 'psoho', k, vl, abs_op, max_op)
}
dkesada/PSOHO documentation built on Dec. 7, 2020, 11:35 p.m.