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


C++ Absolute函数代码示例

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


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

示例1: Determinant2x2

hacd::HaF64 Determinant2x2 (const hacd::HaF64 matrix[2][2], hacd::HaF64* const error)
{
	hacd::HaF64 a00xa11 = matrix[0][0] * matrix[1][1];
	hacd::HaF64 a01xa10 = matrix[0][1] * matrix[1][0];
	*error = Absolute(a00xa11) + Absolute(a01xa10);
	return a00xa11 - a01xa10;
}
开发者ID:ColinGilbert,项目名称:juliohull,代码行数:7,代码来源:dgSmallDeterminant.cpp

示例2: Determinant2x2

dgFloat64 Determinant2x2 (const dgFloat64 matrix[2][2], dgFloat64* const error)
{
	dgFloat64 a00xa11 = matrix[0][0] * matrix[1][1];
	dgFloat64 a01xa10 = matrix[0][1] * matrix[1][0];
	*error = Absolute(a00xa11) + Absolute(a01xa10);
	return a00xa11 - a01xa10;
}
开发者ID:blabz2007,项目名称:prime.mod,代码行数:7,代码来源:dgSmallDeterminant.cpp

示例3: Absolute

bool Path::CopyDir(String srcFolder, String dstFolder)
{
	srcFolder = Absolute(srcFolder);

	// Remove trailing seperators
	dstFolder = Absolute(dstFolder);
	dstFolder.TrimBack(Path::sep);

	if(!CreateDir(dstFolder))
		return false;

	Vector<FileInfo> files = Files::ScanFiles(srcFolder);
	for(auto& file : files)
	{
		String commonPath = RemoveBase(file.fullPath, srcFolder);
		String dstPath = dstFolder + Path::sep + commonPath;
		if(file.type == FileType::Folder)
		{
			if(!CopyDir(file.fullPath, dstPath))
				return false;
		}
		else
		{
			if(!Copy(file.fullPath, dstPath))
				return false;
		}
	}
	return true;
}
开发者ID:guusw,项目名称:unnamed-sdvx-clone,代码行数:29,代码来源:Path.cpp

示例4: return

bool CBoltEffectCreator::PointInImage (int x, int y, int iTick, int iVariant) const

//	PointInImage
//
//	Returns TRUE if the given point is in the image

	{
	return (Absolute(x) < m_iWidth && Absolute(y) < m_iWidth);
	}
开发者ID:alanhorizon,项目名称:Transport,代码行数:9,代码来源:SFXBolt.cpp

示例5: return

bool CBeamEffectCreator::PointInImage (int x, int y, int iTick, int iVariant) const

//	PointInImage
//
//	Returns TRUE if the given point is in the image

	{
	return (Absolute(x) < m_iIntensity && Absolute(y) < m_iIntensity);
	}
开发者ID:alanhorizon,项目名称:Transcendence,代码行数:9,代码来源:SFXBeam.cpp

示例6: Diff

static inline bool Diff(int c1, int c2)
{
   int c1y = (c1 & Ymask) - (c2 & Ymask);
   if (Absolute(c1y) > trY) return true;
   int c1u = (c1 & Umask) - (c2 & Umask);
   if (Absolute(c1u) > trU) return true;
   int c1v = (c1 & Vmask) - (c2 & Vmask);
   if (Absolute(c1v) > trV) return true;

   return false;
}
开发者ID:joshg253,项目名称:snes9x-gx,代码行数:11,代码来源:filter.cpp

示例7: Determinant3x3

dgFloat64 Determinant3x3 (const dgFloat64 matrix[3][3], dgFloat64* const error)
{
	dgFloat64 sign = dgFloat64 (-1.0f);
	dgFloat64 det = dgFloat64 (0.0f);
	dgFloat64 accError = dgFloat64 (0.0f); 
	for (dgInt32 i = 0; i < 3; i ++)  {
		dgFloat64 cofactor[2][2];
		for (dgInt32 j = 0; j < 2; j ++) {
			dgInt32 k0 = 0;
			for (dgInt32 k = 0; k < 3; k ++) {
				if (k != i) {
					cofactor[j][k0] = matrix[j][k];
					k0 ++;
				}
			}
		}

		dgFloat64 parcialError;
		dgFloat64 minorDet = Determinant2x2 (cofactor, &parcialError);
		accError += parcialError * Absolute (matrix[2][i]);
		det += sign * minorDet * matrix[2][i];
		sign *= dgFloat64 (-1.0f);
	}

	*error = accError;
	return det;
}
开发者ID:blabz2007,项目名称:prime.mod,代码行数:27,代码来源:dgSmallDeterminant.cpp

示例8: Apu3F

void Apu3F()  // CALL absolute
{
   Absolute();
   // 0xB6f for Star Fox 2
   SPC700_PushW(IAPU.PC + 3 - IAPU.RAM);
   IAPU.PC = IAPU.RAM + IAPU.Address;
}
开发者ID:tuluse,项目名称:CATSFC-libretro,代码行数:7,代码来源:spc700.c

示例9: Absolute

void C_CPU::ASL_0E(WORD opcode)// absolute, 6 cycles
{
	WORD memLoc = Absolute(6);
	WORD result = systemMem[memLoc];

	// carry flag is bit 7 before shift	
	if(result & 0x80)
		m_flagC = 1;
	else
		m_flagC = 0;
	
	// shift left
	result <<= 1; 

	// if result is zero set the Z flag
	if(result == 0)
		m_flagZ = 1;
	else
		m_flagZ = 0;

	// set N flag if bit 7 is set
	if(result & 0x80)
		m_flagN = 1;
	else
		m_flagN = 0;

	//put result back in memory
	systemMem[memLoc] = result;
}
开发者ID:Cephas1982,项目名称:NES,代码行数:29,代码来源:shifts.cpp

示例10: Determinant4x4

hacd::HaF64 Determinant4x4 (const hacd::HaF64 matrix[4][4], hacd::HaF64* const error)
{
	hacd::HaF64 sign = hacd::HaF64 (1.0f);
	hacd::HaF64 det = hacd::HaF64 (0.0f);
	hacd::HaF64 accError = hacd::HaF64 (0.0f); 
	for (hacd::HaI32 i = 0; i < 4; i ++)  {
		hacd::HaF64 cofactor[3][3];
		for (hacd::HaI32 j = 0; j < 3; j ++) {
			hacd::HaI32 k0 = 0;
			for (hacd::HaI32 k = 0; k < 4; k ++) {
				if (k != i) {
					cofactor[j][k0] = matrix[j][k];
					k0 ++;
				}
			}
		}

		hacd::HaF64 parcialError;
		hacd::HaF64 minorDet = Determinant3x3 (cofactor, &parcialError);
		accError +=  parcialError * Absolute (matrix[3][i]);
		det += sign * minorDet * matrix[3][i];
		sign *= hacd::HaF64 (-1.0f);
	}

	*error = accError;
	return det;
}
开发者ID:ColinGilbert,项目名称:juliohull,代码行数:27,代码来源:dgSmallDeterminant.cpp

示例11: Apu25

void Apu25()
{
   // AND A,abs
   Absolute();
   IAPU.YA.B.A &= S9xAPUGetByte(IAPU.Address);
   APUSetZN8(IAPU.YA.B.A);
   IAPU.PC += 3;
}
开发者ID:NunaticAlumina,项目名称:pocketsnes-libretro,代码行数:8,代码来源:spc700.c

示例12: Apu65

void Apu65()
{
   // CMP A,abs
   Absolute();
   uint8 Work8 = S9xAPUGetByte(IAPU.Address);
   CMP(IAPU.YA.B.A, Work8);
   IAPU.PC += 3;
}
开发者ID:NunaticAlumina,项目名称:pocketsnes-libretro,代码行数:8,代码来源:spc700.c

示例13: Apu5E

void Apu5E()
{
   // CMP Y,abs
   Absolute();
   uint8 Work8 = S9xAPUGetByte(((IAPU.Address)));
   CMP(IAPU.YA.B.Y, Work8);
   IAPU.PC += 3;
}
开发者ID:NunaticAlumina,项目名称:pocketsnes-libretro,代码行数:8,代码来源:spc700.c

示例14: Apu85

void Apu85()
{
   // ADC A, abs
   Absolute();
   uint8 Work8 = S9xAPUGetByte(((IAPU.Address)));
   ADC(IAPU.YA.B.A, Work8);
   IAPU.PC += 3;
}
开发者ID:NunaticAlumina,项目名称:pocketsnes-libretro,代码行数:8,代码来源:spc700.c

示例15: Apu45

void Apu45()
{
   // EOR A,abs
   Absolute();
   IAPU.YA.B.A ^= S9xAPUGetByte(IAPU.Address);
   APUSetZN8(IAPU.YA.B.A);
   IAPU.PC += 3;
}
开发者ID:NunaticAlumina,项目名称:pocketsnes-libretro,代码行数:8,代码来源:spc700.c


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