当前位置: 首页>>代码示例>>C++>>正文


C++ creall函数代码示例

本文整理汇总了C++中creall函数的典型用法代码示例。如果您正苦于以下问题:C++ creall函数的具体用法?C++ creall怎么用?C++ creall使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了creall函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: escribeMatrizArchivo_completo

void escribeMatrizArchivo_completo(matriz * mtz, matriz * epsilon1, matriz * epsilon2, long double *angulos, long double delta1, long double delta2, char* conjugado_corto, char *conjugado_largo, char *nombre, int fila_noAstig, int columna_noAstig, long double astigmatismo)
{
    FILE *archivo;
    archivo = fopen(nombre,"w");
    int fila, columna;
    fprintf(archivo, "Configuracion optima,\n\n");
    fprintf(archivo,"delta 1 [m],Theta 1 [rad],delta 2 [m],Theta 2 [rad],Conjugado corto, Conjugado largo, Astigmatismo (spot tan / spot sag)\n");
    fprintf(archivo,"%.15Le,%.15Le,%.15Le,%.15Le,%s,%s,%.15Le\n\n",delta1+creall(obtieneElemento(epsilon1,1,fila_noAstig)),angulos[0],delta2+creall(obtieneElemento(epsilon2,1,columna_noAstig)),angulos[1],conjugado_corto,conjugado_largo, creall(astigmatismo));
    fprintf(archivo, "epsilon 1 [m],epsilon2 [m]\n");
    fprintf(archivo, "%.15Le,%.15Le,\n\n",creall(obtieneElemento(epsilon1,1,fila_noAstig)),creall(obtieneElemento(epsilon2,1,columna_noAstig)));
    fprintf(archivo, " ,epsilon 2 [m],");
    for(columna=1;columna<=mtz->columnas;columna++)
        fprintf(archivo, "%.15Le,",creall(elem(epsilon2,1,columna)));
    fprintf(archivo, "\nepsilon 1 [m],\n");
    for (fila=1;fila<=mtz->filas;fila++)
    {
        fprintf(archivo,"%.15Le, ,",creall(elem(epsilon1,1,fila)));
        for(columna=1;columna<=mtz->columnas;columna++)
        {
            //Imprime el elemento de punto flotante
            fprintf(archivo, "%.15Le+%.15Lei,", creall(elem(mtz,fila,columna)),cimagl(elem(mtz,fila,columna)));
            //fprintf(archivo, "%6.5f\t", cimagl(elem(mtz,fila,columna)));
        }
        fprintf(archivo,"\n");
    }
    fclose(archivo);
}
开发者ID:JAMoreno-Larios,项目名称:calculadoraTitanioZafiro,代码行数:27,代码来源:matrices.c

示例2: escribeMatrizDoubleArchivo

void escribeMatrizDoubleArchivo(matriz * mtz, char *nombre)
{
    FILE *archivo;
    archivo = fopen(nombre,"w");
    int fila, columna;
    fprintf(archivo,"double datos={");
    for (fila=1;fila<=mtz->filas-1;fila++)
    {
        fprintf(archivo,"{");
        for(columna=1;columna<=mtz->columnas;columna++)
        {
            //Imprime el elemento de punto flotante
            fprintf(archivo, "%.15Le,", creall(elem(mtz,fila,columna)));
            //fprintf(archivo, "%6.5f\t", cimagl(elem(mtz,fila,columna)));
        }
        fprintf(archivo,"},\n");
    }
    fila=mtz->filas;
    fprintf(archivo,"{");
    for(columna=1;columna<=mtz->columnas;columna++)
        {
            //Imprime el elemento de punto flotante
            fprintf(archivo, "%.15Le,", creall(elem(mtz,fila,columna)));
            //fprintf(archivo, "%6.5f\t", cimagl(elem(mtz,fila,columna)));
        }
    fprintf(archivo,"}};");
    fclose(archivo);
}
开发者ID:JAMoreno-Larios,项目名称:calculadoraTitanioZafiro,代码行数:28,代码来源:matrices.c

示例3: test_nans

/*
 * Test the handling of NaNs.
 */
static void
test_nans()
{

	assert(creall(t_csqrt(CMPLXL(INFINITY, NAN))) == INFINITY);
	assert(isnan(cimagl(t_csqrt(CMPLXL(INFINITY, NAN)))));

	assert(isnan(creall(t_csqrt(CMPLXL(-INFINITY, NAN)))));
	assert(isinf(cimagl(t_csqrt(CMPLXL(-INFINITY, NAN)))));

	assert_equal(t_csqrt(CMPLXL(NAN, INFINITY)),
		     CMPLXL(INFINITY, INFINITY));
	assert_equal(t_csqrt(CMPLXL(NAN, -INFINITY)),
		     CMPLXL(INFINITY, -INFINITY));

	assert_equal(t_csqrt(CMPLXL(0.0, NAN)), CMPLXL(NAN, NAN));
	assert_equal(t_csqrt(CMPLXL(-0.0, NAN)), CMPLXL(NAN, NAN));
	assert_equal(t_csqrt(CMPLXL(42.0, NAN)), CMPLXL(NAN, NAN));
	assert_equal(t_csqrt(CMPLXL(-42.0, NAN)), CMPLXL(NAN, NAN));
	assert_equal(t_csqrt(CMPLXL(NAN, 0.0)), CMPLXL(NAN, NAN));
	assert_equal(t_csqrt(CMPLXL(NAN, -0.0)), CMPLXL(NAN, NAN));
	assert_equal(t_csqrt(CMPLXL(NAN, 42.0)), CMPLXL(NAN, NAN));
	assert_equal(t_csqrt(CMPLXL(NAN, -42.0)), CMPLXL(NAN, NAN));
	assert_equal(t_csqrt(CMPLXL(NAN, NAN)), CMPLXL(NAN, NAN));
}
开发者ID:2asoft,项目名称:freebsd,代码行数:28,代码来源:csqrt_test.c

示例4: catanl

long double complex
catanl(long double complex z)
{
	long double complex w;

	w = catanhl(CMPLXL(cimagl(z), creall(z)));
	return (CMPLXL(cimagl(w), creall(w)));
}
开发者ID:android,项目名称:platform_bionic,代码行数:8,代码来源:catrigl.c

示例5: cacosl

long double complex
cacosl(long double complex z)
{
	long double x, y, ax, ay, rx, ry, B, sqrt_A2mx2, new_x;
	int sx, sy;
	int B_is_usable;
	long double complex w;

	x = creall(z);
	y = cimagl(z);
	sx = signbit(x);
	sy = signbit(y);
	ax = fabsl(x);
	ay = fabsl(y);

	if (isnan(x) || isnan(y)) {
		if (isinf(x))
			return (CMPLXL(y + y, -INFINITY));
		if (isinf(y))
			return (CMPLXL(x + x, -y));
		if (x == 0)
			return (CMPLXL(pio2_hi + pio2_lo, y + y));
		return (CMPLXL(nan_mix(x, y), nan_mix(x, y)));
	}

	if (ax > RECIP_EPSILON || ay > RECIP_EPSILON) {
		w = clog_for_large_values(z);
		rx = fabsl(cimagl(w));
		ry = creall(w) + m_ln2;
		if (sy == 0)
			ry = -ry;
		return (CMPLXL(rx, ry));
	}

	if (x == 1 && y == 0)
		return (CMPLXL(0, -y));

	raise_inexact();

	if (ax < SQRT_6_EPSILON / 4 && ay < SQRT_6_EPSILON / 4)
		return (CMPLXL(pio2_hi - (x - pio2_lo), -y));

	do_hard_work(ay, ax, &ry, &B_is_usable, &B, &sqrt_A2mx2, &new_x);
	if (B_is_usable) {
		if (sx == 0)
			rx = acosl(B);
		else
			rx = acosl(-B);
	} else {
		if (sx == 0)
			rx = atan2l(sqrt_A2mx2, new_x);
		else
			rx = atan2l(sqrt_A2mx2, -new_x);
	}
	if (sy == 0)
		ry = -ry;
	return (CMPLXL(rx, ry));
}
开发者ID:android,项目名称:platform_bionic,代码行数:58,代码来源:catrigl.c

示例6: ccosl

long double complex
ccosl(long double complex z)
{
	long double complex w;
	long double ch, sh;

	_cchshl(cimagl(z), &ch, &sh);
	w = cosl(creall(z)) * ch - (sinl(creall(z)) * sh) * I;
	return w;
}
开发者ID:alexandermerritt,项目名称:dragonfly,代码行数:10,代码来源:ccosl.c

示例7: csinl

long double complex
csinl(long double complex z)
{
	long double complex w;
	long double ch, sh;

	cchshl(cimagl(z), &ch, &sh);
	w = sinl(creall(z)) * ch + (cosl(creall(z)) * sh) * I;
	return (w);
}
开发者ID:447327642,项目名称:openlibm,代码行数:10,代码来源:s_csinl.c

示例8: casinl

// FIXME
long double complex casinl(long double complex z)
{
	long double complex w;
	long double x, y;

	x = creall(z);
	y = cimagl(z);
	w = CMPLXL(1.0 - (x - y)*(x + y), -2.0*x*y);
	long double complex r = clogl(CMPLXL(-y, x) + csqrtl(w));
	return CMPLXL(cimagl(r), -creall(r));
}
开发者ID:bminor,项目名称:musl,代码行数:12,代码来源:casinl.c

示例9: imprimeListaReal

void imprimeListaReal(matriz * ejeX, matriz * ejeY, matriz * datosTan, matriz * datosSag, char* rutaArchivo)
{
    FILE *archivo;
    archivo = fopen(rutaArchivo,"w");
    fprintf(archivo,"#Datos a graficar con Gnuplot, e1, e2, tan, sag\n");
    for(int i=1;i<=ejeX->columnas;i++)
    {
        for(int j=1;j<=ejeY->columnas;j++)
        {
            fprintf(archivo,"%Le %Le %Le %Le\n",creall(obtieneElemento(ejeX,1,i)),creall(obtieneElemento(ejeY,1,j)),creall(obtieneElemento(datosTan,i,j)),creall(obtieneElemento(datosSag,i,j)));
        }
    }
    fclose(archivo);
}
开发者ID:JAMoreno-Larios,项目名称:calculadoraTitanioZafiro,代码行数:14,代码来源:matrices.c

示例10: clog_for_large_values

static long double complex
clog_for_large_values(long double complex z)
{
	long double x, y;
	long double ax, ay, t;

	x = creall(z);
	y = cimagl(z);
	ax = fabsl(x);
	ay = fabsl(y);
	if (ax < ay) {
		t = ax;
		ax = ay;
		ay = t;
	}

	if (ax > HALF_MAX)
		return (CMPLXL(logl(hypotl(x / m_e, y / m_e)) + 1,
		    atan2l(y, x)));

	if (ax > QUARTER_SQRT_MAX || ay < SQRT_MIN)
		return (CMPLXL(logl(hypotl(x, y)), atan2l(y, x)));

	return (CMPLXL(logl(ax * ax + ay * ay) / 2, atan2l(y, x)));
}
开发者ID:android,项目名称:platform_bionic,代码行数:25,代码来源:catrigl.c

示例11: catanl

long double complex
catanl(long double complex z)
{
	long double complex w;
	long double a, t, x, x2, y;

	x = creall(z);
	y = cimagl(z);

	if ((x == 0.0L) && (y > 1.0L))
		goto ovrf;

	x2 = x * x;
	a = 1.0L - x2 - (y * y);
	if (a == 0.0L)
		goto ovrf;

	t = atan2l(2.0L * x, a) * 0.5L;
	w = redupil(t);

	t = y - 1.0L;
	a = x2 + (t * t);
	if (a == 0.0L)
		goto ovrf;

	t = y + 1.0L;
	a = (x2 + (t * t)) / a;
	w = w + (0.25L * logl(a)) * I;
	return (w);

ovrf:
	/*mtherr( "catanl", OVERFLOW );*/
	w = LDBL_MAX + LDBL_MAX * I;
	return (w);
}
开发者ID:SylvestreG,项目名称:bitrig,代码行数:35,代码来源:s_catanl.c

示例12: casinhl

long double complex
casinhl(long double complex z)
{
	long double x, y, ax, ay, rx, ry, B, sqrt_A2my2, new_y;
	int B_is_usable;
	long double complex w;

	x = creall(z);
	y = cimagl(z);
	ax = fabsl(x);
	ay = fabsl(y);

	if (isnan(x) || isnan(y)) {
		if (isinf(x))
			return (CMPLXL(x, y + y));
		if (isinf(y))
			return (CMPLXL(y, x + x));
		if (y == 0)
			return (CMPLXL(x + x, y));
		return (CMPLXL(nan_mix(x, y), nan_mix(x, y)));
	}

	if (ax > RECIP_EPSILON || ay > RECIP_EPSILON) {
		if (signbit(x) == 0)
			w = clog_for_large_values(z) + m_ln2;
		else
			w = clog_for_large_values(-z) + m_ln2;
		return (CMPLXL(copysignl(creall(w), x),
		    copysignl(cimagl(w), y)));
	}

	if (x == 0 && y == 0)
		return (z);

	raise_inexact();

	if (ax < SQRT_6_EPSILON / 4 && ay < SQRT_6_EPSILON / 4)
		return (z);

	do_hard_work(ax, ay, &rx, &B_is_usable, &B, &sqrt_A2my2, &new_y);
	if (B_is_usable)
		ry = asinl(B);
	else
		ry = atan2l(new_y, sqrt_A2my2);
	return (CMPLXL(copysignl(rx, x), copysignl(ry, y)));
}
开发者ID:android,项目名称:platform_bionic,代码行数:46,代码来源:catrigl.c

示例13: cacosl

long double complex
cacosl(long double complex z)
{
    long double complex w;

    w = casinl(z);
    w = (PIO2L - creall(w)) - cimagl(w) * I;
    return (w);
}
开发者ID:iblis17,项目名称:openlibm,代码行数:9,代码来源:s_cacosl.c

示例14: cexpl

long double complex
cexpl(long double complex z)
{
	long double complex w;
	long double r;

	r = expl(creall(z));
	w = r * cosl(cimagl(z)) + (r * sinl(cimagl(z))) * I;
	return (w);
}
开发者ID:SylvestreG,项目名称:bitrig,代码行数:10,代码来源:s_cexpl.c

示例15: casinl

// FIXME
long double complex casinl(long double complex z)
{
	long double complex w;
	long double x, y;

	x = creall(z);
	y = cimagl(z);
	w = cpackl(1.0 - (x - y)*(x + y), -2.0*x*y);
	return clogl(cpackl(-y, x) + csqrtl(w));
}
开发者ID:GregorR,项目名称:musl,代码行数:11,代码来源:casinl.c


注:本文中的creall函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。