void fb_poly_set_penta(int a, int b, int c) {
	fb_t f;

	fb_null(f);

	TRY {
		fb_new(f);

		poly_a = a;
		poly_b = b;
		poly_c = c;

		pos_a = poly_a >> FB_DIG_LOG;
		pos_b = poly_b >> FB_DIG_LOG;
		pos_c = poly_c >> FB_DIG_LOG;

		fb_zero(f);
		fb_set_bit(f, FB_BITS, 1);
		fb_set_bit(f, a, 1);
		fb_set_bit(f, b, 1);
		fb_set_bit(f, c, 1);
		fb_set_bit(f, 0, 1);
		fb_poly_set(f);
	}
	CATCH_ANY {
		THROW(ERR_CAUGHT);
	}
	FINALLY {
		fb_free(f);
	}
}
void fb_poly_set_trino(int a) {
	fb_t f;

	fb_null(f);

	TRY {
		poly_a = a;
		poly_b = poly_c = 0;

		pos_a = poly_a >> FB_DIG_LOG;
		pos_b = pos_c = -1;

		fb_new(f);
		fb_zero(f);
		fb_set_bit(f, FB_BITS, 1);
		fb_set_bit(f, a, 1);
		fb_set_bit(f, 0, 1);
		fb_poly_set(f);
	}
	CATCH_ANY {
		THROW(ERR_CAUGHT);
	}
	FINALLY {
		fb_free(f);
	}
}
Exemple #3
0
void fb_poly_set_penta(int a, int b, int c) {
	fb_t f;
	ctx_t *ctx = core_get();

	fb_null(f);

	TRY {
		fb_new(f);

		ctx->fb_pa = a;
		ctx->fb_pb = b;
		ctx->fb_pc = c;

		ctx->fb_na = ctx->fb_pa >> FB_DIG_LOG;
		ctx->fb_nb = ctx->fb_pb >> FB_DIG_LOG;
		ctx->fb_nc = ctx->fb_pc >> FB_DIG_LOG;

		fb_zero(f);
		fb_set_bit(f, FB_BITS, 1);
		fb_set_bit(f, a, 1);
		fb_set_bit(f, b, 1);
		fb_set_bit(f, c, 1);
		fb_set_bit(f, 0, 1);
		fb_poly_set(f);
	}
	CATCH_ANY {
		THROW(ERR_CAUGHT);
	}
	FINALLY {
		fb_free(f);
	}
}
Exemple #4
0
void fb_poly_set_trino(int a) {
	fb_t f;
	ctx_t *ctx = core_get();

	fb_null(f);

	TRY {
		ctx->fb_pa = a;
		ctx->fb_pb = ctx->fb_pc = 0;

		ctx->fb_na = ctx->fb_pa >> FB_DIG_LOG;
		ctx->fb_nb = ctx->fb_nc = -1;

		fb_new(f);
		fb_zero(f);
		fb_set_bit(f, FB_BITS, 1);
		fb_set_bit(f, a, 1);
		fb_set_bit(f, 0, 1);
		fb_poly_set(f);
	}
	CATCH_ANY {
		THROW(ERR_CAUGHT);
	}
	FINALLY {
		fb_free(f);
	}
}
void fb_poly_set_dense(fb_t f) {
	fb_poly_set(f);
	poly_a = poly_b = poly_c = 0;
	pos_a = pos_b = pos_c = -1;
}
Exemple #6
0
void fb_poly_set_dense(const fb_t f) {
	ctx_t *ctx = core_get();
	fb_poly_set(f);
	ctx->fb_pa = ctx->fb_pb = ctx->fb_pc = 0;
	ctx->fb_na = ctx->fb_nb = ctx->fb_nc = -1;
}