Exemplo n.º 1
0
Arquivo: sgs.py Projeto: EvoNet/hpgl
def _create_hpgl_nonparam_cdf(cdf_data):
	cd2 = cdf_data
	assert isinstance(cdf_data, CdfData)
	return __checked_create(
		hpgl_non_parametric_cdf_t,
		values = cd2.values.ctypes.data_as(C.POINTER(C.c_float)),
		probs = cd2.probs.ctypes.data_as(C.POINTER(C.c_float)),
		size = cd2.values.size)
Exemplo n.º 2
0
Arquivo: sgs.py Projeto: watmough/hpgl
def _create_hpgl_nonparam_cdf(cdf_data):
    cd2 = cdf_data
    assert isinstance(cdf_data, CdfData)
    return __checked_create(
        hpgl_non_parametric_cdf_t,
        values=cd2.values.ctypes.data_as(C.POINTER(C.c_float)),
        probs=cd2.probs.ctypes.data_as(C.POINTER(C.c_float)),
        size=cd2.values.size)
Exemplo n.º 3
0
def __create_hpgl_ik_params(data, indicator_count, is_lvm, marginal_probs):
    ikps = []
    assert len(data) == indicator_count
    for i in range(indicator_count):
        ikd = data[i]
        ikp = __checked_create(
            _HPGL_IK_PARAMS,
            covariance_type=ikd["cov_model"].type,
            ranges=(C.c_double * 3)(*ikd["cov_model"].ranges),
            angles=(C.c_double * 3)(*ikd["cov_model"].angles),
            sill=ikd["cov_model"].sill,
            nugget=ikd["cov_model"].nugget,
            radiuses=(C.c_int * 3)(*ikd["radiuses"]),
            max_neighbours=ikd["max_neighbours"],
            marginal_prob=0 if is_lvm else marginal_probs[i])
        ikps.append(ikp)
    return _c_array(_HPGL_IK_PARAMS, indicator_count, ikps)
Exemplo n.º 4
0
Arquivo: sis.py Projeto: EvoNet/hpgl
def __create_hpgl_ik_params(data, indicator_count, is_lvm, marginal_probs):
	ikps = []
	assert len(data) == indicator_count
	for i in range(indicator_count):
		ikd = data[i]
		ikp = __checked_create(
			_HPGL_IK_PARAMS,
			covariance_type = ikd["cov_model"].type,
			ranges = (C.c_double * 3)(*ikd["cov_model"].ranges),
			angles = (C.c_double * 3)(*ikd["cov_model"].angles),
			sill = ikd["cov_model"].sill,
			nugget = ikd["cov_model"].nugget,
			radiuses = (C.c_int * 3)(*ikd["radiuses"]),
			max_neighbours = ikd["max_neighbours"],
			marginal_prob = 0 if is_lvm else marginal_probs[i])
		ikps.append(ikp)
	return _c_array(_HPGL_IK_PARAMS, indicator_count, ikps)