// File: myudelson[P]hmm-scalable/utilsSt.cpp
// Function: set_task_defaults(task*)
void set_task_defaults(struct task *task) {
	// configurable - set
    task->tol                   = 0.01;
    task->tol_mode              = 'p';
	task->is_scaled             = 0;
    task->do_not_check_constraints = 0;
	task->sliced                = 0;
    task->duplicate_console     = 0;
	task->maxiter               = 200;
	task->quiet                 = 0;
	task->single_skill          = 0;
	task->structure			 = 1; // default is by skill
	task->solver				 = 2; // default is Gradient Descent
	task->solver_setting		 = -1; // -1 - not set
    task->metrics               = 0;
    task->metrics_target_obs    = 0;
    task->predictions           = 0;
    task->update_known          = 'r';
    task->update_unknown        = 't';
    task->binaryinput           = 0;
	task->Cw                     = Calloc(NUMBER, (size_t)1);
    task->Cw[0]                  = 0;
    task->Ccenters              = NULL;
    task->initfile[0]           = 0; // 1st bit is 0 - no file
    task->init_param_values     = Calloc(NUMBER, (size_t)5);
    task->init_param_values_n   = 5;
	task->init_param_values[0]  = 0.5; // PI[0]
	task->init_param_values[1]  = 1.0; // p(not forget)
	task->init_param_values[2]  = 0.4; // p(learn)
	task->init_param_values[3]  = 0.8; // p(not slip)
	task->init_param_values[4]  = 0.2; // p(guess)
    task->elo_type              = 0; // default is type 0 – not an Elo
    task->elo_scope             = 0b111; // default is full scope over Pi, A, B = 0b111
    task->elo_param_values      = NULL; // Calloc(NUMBER, (size_t)1); // single K
    // task->elo_param_values[0]   = 0; // no-effect 0 sensitivity K
    task->elo_param_values_n    = 0; // one Elo param Ks
	task->param_values_lb    	= Calloc(NUMBER, (size_t)10);
	task->param_values_lb[0]    = 0; task->param_values_lb[1] = 0; task->param_values_lb[2] = 1; task->param_values_lb[3] = 0; task->param_values_lb[4] = 0;
	task->param_values_lb[5]    = 0; task->param_values_lb[6] = 0; task->param_values_lb[7] = 0; task->param_values_lb[8] = 0; task->param_values_lb[9] = 0;
	task->param_values_ub		= Calloc(NUMBER, (size_t)10);
	task->param_values_ub[0]    = 1; task->param_values_ub[1] = 1; task->param_values_ub[2] = 1; task->param_values_ub[3] = 0; task->param_values_ub[4] = 1;
	task->param_values_ub[5]    = 1; task->param_values_ub[6] = 1; task->param_values_ub[7] = 0.3; task->param_values_ub[8] = 0.3; task->param_values_ub[9] = 1;
	task->cv_folds = 0;
	task->cv_strat = 'g'; // default group(student)-stratified
    task->cv_target_obs = 0; // 1st state to validate agains by default, cv_folds enables cross-validation
    task->cv_folds_file[0] = 0; // empty folds file
    task->cv_inout_flag = 'o'; // default rule, we're writing folds out
    task->multiskill = 0; // single skill per ovservation by default
    task->parallel = 0; // parallelization flag, no parallelization (0) by default
    // parse running settings
    task->init_reset = false; // init parameters specified
    task->lb_specd = false; // parameter limits s`pecified
    task->ub_specd = false; // parameter limits s`pecified
    task->stat_specd_gt2 = false; // number of states specified to be >2
    // vocabilaries
    task->map_group_fwd = NULL;
    task->map_group_bwd = NULL;
    task->map_step_fwd = NULL;
    task->map_step_bwd = NULL;
    task->map_skill_fwd = NULL;
    task->map_skill_bwd = NULL;
	// derived from data - set to 0
    task->N  = 0; //will be dynamically set in read_data_...()
    task->Nst = 0; //will be dynamically set in read_data_...()
	task->nS = 2;
	task->nO = 0;
	task->nG = 0;
	task->nK = 0;
	task->nI = 0;
    task->nZ = 1;
//    task->all_data = NULL;
//    task->nSeq = 0;
//	task->k_numg = NULL;
//	task->k_data = NULL;
//	task->k_g_data = NULL;
//	task->g_numk = NULL;
//	task->g_data = NULL;
//	task->g_k_data = NULL;
    task->N_null = 0;
    task->first_null_skill = -1; // ix of first null skill
    task->last_null_skill = -1; // ix of last null skill
//    task->n_null_skill_group = 0;
//    task->null_skills = NULL;
	// fitting specific - Armijo rule
	task->ArmijoC1            = 1e-4;
	task->ArmijoC2            = 0.9; // since we're not newton method
	task->ArmijoReduceFactor  = 2;//1/0.9;//
	task->ArmijoSeed          = 1.0; //1; - since we use smooth stepping 1 is the only thing we need
    task->ArmijoMinStep       = 0.1; //  0.000001~20steps, 0.001~10steps
    // coord descend
    task->first_iteration_qualify = 2;
    task->iterations_to_qualify   = 2;
    task->iterations_limit        = 200;
    // block fitting of some parameters
    task->block_fitting_type = 0; // no bocking of fitting - TODO, enable diff block types
    task->block_fitting[0] = 0; // no bocking fitting for PI
    task->block_fitting[1] = 0; // no bocking fitting for A
    task->block_fitting[2] = 0; // no bocking fitting for B
//    task->per_kc_rmse_acc = false;
    // data
    task->dat_obs = NULL;
    task->dat_obs_stacked = NULL;
    task->dat_group = NULL;
    task->dat_skill = NULL;
    task->dat_skill_stacked = NULL;
    task->dat_skill_rcount = NULL;
    task->dat_skill_rix = NULL;
    task->dat_item = NULL;
//    task->dat_multiskill = NULL;
    task->dat_slice = NULL;
    task->dat_predict = NULL;
    task->dat_predict_k = NULL;

//	task->tag1 = 0;
    // connectivities
    task->n_connectivities = 0;
    task->n_connectivity_X = NULL;
    task->n_connectivity_Y = NULL;
    task->connectivities = NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movsd 0x12d10(%rip), %xmm0    # 0x1bab8
movsd %xmm0, 0x38(%rax)
movq -0x8(%rbp), %rax
movb $0x70, 0x40(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x41(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x42(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x43(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x44(%rax)
movq -0x8(%rbp), %rax
movl $0xc8, 0x48(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x4c(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x4d(%rax)
movq -0x8(%rbp), %rax
movb $0x1, 0x4e(%rax)
movq -0x8(%rbp), %rax
movb $0x2, 0x4f(%rax)
movq -0x8(%rbp), %rax
movb $-0x1, 0x50(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x68(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x6c(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x70(%rax)
movq -0x8(%rbp), %rax
movb $0x72, 0x74(%rax)
movq -0x8(%rbp), %rax
movb $0x74, 0x75(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x78(%rax)
movl $0x1, %edi
movl $0x8, %esi
callq 0x3170
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x58(%rax)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x60(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x7c(%rax)
movl $0x5, %edi
movl $0x8, %esi
callq 0x3170
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movb $0x5, 0x8(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movsd 0x12c02(%rip), %xmm0    # 0x1bab0
movsd %xmm0, (%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movsd 0x12b7f(%rip), %xmm0    # 0x1ba40
movsd %xmm0, 0x8(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movsd 0x12bd3(%rip), %xmm0    # 0x1baa8
movsd %xmm0, 0x10(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movsd 0x12bb7(%rip), %xmm0    # 0x1baa0
movsd %xmm0, 0x18(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movsd 0x12b9b(%rip), %xmm0    # 0x1ba98
movsd %xmm0, 0x20(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x20(%rax)
movq -0x8(%rbp), %rax
movl $0x7, 0x24(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x30(%rax)
movl $0xa, %edi
movl $0x8, %esi
callq 0x3170
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movsd 0x12ace(%rip), %xmm0    # 0x1ba40
movsd %xmm0, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x18(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x20(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x28(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x30(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x38(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x40(%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x48(%rax)
movl $0xa, %edi
movl $0x8, %esi
callq 0x3170
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movsd 0x12a2f(%rip), %xmm0    # 0x1ba40
movsd %xmm0, (%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movsd 0x12a1b(%rip), %xmm0    # 0x1ba40
movsd %xmm0, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movsd 0x12a06(%rip), %xmm0    # 0x1ba40
movsd %xmm0, 0x10(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x18(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movsd 0x129e1(%rip), %xmm0    # 0x1ba40
movsd %xmm0, 0x20(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movsd 0x129cc(%rip), %xmm0    # 0x1ba40
movsd %xmm0, 0x28(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movsd 0x129b7(%rip), %xmm0    # 0x1ba40
movsd %xmm0, 0x30(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movsd 0x129f2(%rip), %xmm0    # 0x1ba90
movsd %xmm0, 0x38(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movsd 0x129dd(%rip), %xmm0    # 0x1ba90
movsd %xmm0, 0x40(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movsd 0x12978(%rip), %xmm0    # 0x1ba40
movsd %xmm0, 0x48(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x47c(%rax)
movq -0x8(%rbp), %rax
movb $0x67, 0x47d(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x47e(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x47f(%rax)
movq -0x8(%rbp), %rax
movb $0x6f, 0x87f(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x920(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x51(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x921(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x922(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x923(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x924(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x928(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x930(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x938(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x940(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x948(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x950(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x8f8(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x8fc(%rax)
movq -0x8(%rbp), %rax
movb $0x2, 0x900(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x901(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x904(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x908(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x90c(%rax)
movq -0x8(%rbp), %rax
movb $0x1, 0x910(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x914(%rax)
movq -0x8(%rbp), %rax
movl $0xffffffff, 0x918(%rax) # imm = 0xFFFFFFFF
movq -0x8(%rbp), %rax
movl $0xffffffff, 0x91c(%rax) # imm = 0xFFFFFFFF
movq -0x8(%rbp), %rax
movsd 0x1284e(%rip), %xmm0    # 0x1ba88
movsd %xmm0, 0x958(%rax)
movq -0x8(%rbp), %rax
movsd 0x12832(%rip), %xmm0    # 0x1ba80
movsd %xmm0, 0x960(%rax)
movq -0x8(%rbp), %rax
movsd 0x11dae(%rip), %xmm0    # 0x1b010
movsd %xmm0, 0x968(%rax)
movq -0x8(%rbp), %rax
movsd 0x127ca(%rip), %xmm0    # 0x1ba40
movsd %xmm0, 0x970(%rax)
movq -0x8(%rbp), %rax
movsd 0x127ee(%rip), %xmm0    # 0x1ba78
movsd %xmm0, 0x978(%rax)
movq -0x8(%rbp), %rax
movb $0x2, 0x980(%rax)
movq -0x8(%rbp), %rax
movb $0x2, 0x981(%rax)
movq -0x8(%rbp), %rax
movl $0xc8, 0x984(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x988(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x989(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x98a(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x98b(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x880(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x888(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x890(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x898(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x8a0(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x8a8(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x8b0(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x8b8(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x8c0(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x8c8(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x8d0(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x8d8(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x8e0(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x8e8(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x8f0(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)