當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。