#include "sgm_esl.h"

void SGM_ESL::CalPartialModel(_1dArray& out_obs_array)
{
	int i,j;
#pragma omp parallel for private(i,j) schedule(guided)
	for (i = 0; i < obs_points_num_; i++){
		out_obs_array[i] = 0.0;
		for (j = 0; j < mod_blocks_num_; j++){
			out_obs_array[i] += GM_kernel_[i][j] * invert_model_[j];
		}
	}
	return;
}

void SGM_ESL::CalPartialModel(_1dArray& out_obs_array,_1dArray weight_list)
{
	int i,j;
#pragma omp parallel for private(i,j) schedule(guided)
	for (i = 0; i < obs_points_num_; i++){
		out_obs_array[i] = 0.0;
		for (j = 0; j < mod_blocks_num_; j++){
			out_obs_array[i] += GM_kernel_[i][j] * invert_model_[j] * weight_list[j];
		}
	}
	return;
}